Built motion from commit (unavailable).|2.5.3
authorCris Di Sclafani <cris.disclafani@gmail.com>
Wed, 16 Sep 2020 13:51:27 +0000 (15:51 +0200)
committerCris Di Sclafani <cris.disclafani@gmail.com>
Wed, 16 Sep 2020 13:51:27 +0000 (15:51 +0200)
1137 files changed:
apidoc/api_project.js
apidoc/api_project.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/notification/index.js
server/api/notification/notification.attributes.js
server/api/notification/notification.controller.js
server/api/notification/notification.events.js
server/api/notification/notification.model.js
server/api/notification/notification.rpc.js
server/api/notification/notification.socket.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/integrations/configuration.js
server/components/interaction/service.js
server/components/license/service.js
server/components/parsers/advancedSearch.js
server/components/parsers/qs.js
server/config/express.js
server/config/license/hardware.js
server/config/license/index.js
server/config/license/util.js
server/config/local.env.js
server/config/logger.js
server/config/pm2/config.js
server/config/pm2/index.js
server/config/schedule/chat.js
server/config/schedule/index.js
server/config/schedule/transcribe.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.js
server/errors/index.js
server/mysqldb/index.js
server/routes.js
server/rpc/index.js
server/services/agi/channel.js
server/services/agi/error.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/google/index.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/action.js
server/services/ami/dialer/agentComplete.js
server/services/ami/dialer/final.js
server/services/ami/dialer/hangup.js
server/services/ami/dialer/history.js
server/services/ami/dialer/index.js
server/services/ami/dialer/queueCallerAbandon.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/dynamics365Account.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/freshsalesAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/servicenowAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/dynamics365.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/freshsales.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/servicenow.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/dynamics365.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/freshsales.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/servicenow.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/script/index.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/model/whatsappQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/rpc/whatsappInteraction.js
server/services/routing/rpc/whatsappMessage.js
server/services/routing/rpc/whatsappQueue.js
server/services/routing/rpc/whatsappQueueReport.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js

index 5f9aae0..252ca54 100644 (file)
@@ -1 +1 @@
-define({\r  "name": "xCALLY Motion API",\r  "version": "2.5.3",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre class=\"prettyprint lang-sh\">GET /api/users\n</pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre class=\"prettyprint lang-sh\">https://motion.xcally.com/api/users\n</pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre class=\"prettyprint lang-sh\">GET  /api/users/{id}\n</pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n</pre>\n<h3>API Key</h3>\n<p>In your request, specify the API Key in apikey query parameter</p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n</pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2020-09-16T08:42:17.368Z",\r    "url": "http://apidocjs.com",\r    "version": "0.19.0"\r  }\r});
+define({\r  "name": "xCALLY Motion API",\r  "version": "2.5.3",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre class=\"prettyprint lang-sh\">GET /api/users\n</pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre class=\"prettyprint lang-sh\">https://motion.xcally.com/api/users\n</pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre class=\"prettyprint lang-sh\">GET  /api/users/{id}\n</pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n</pre>\n<h3>API Key</h3>\n<p>In your request, specify the API Key in apikey query parameter</p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n</pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2020-09-16T13:43:56.154Z",\r    "url": "http://apidocjs.com",\r    "version": "0.19.0"\r  }\r});
index 517b095..42f3afb 100644 (file)
@@ -1 +1 @@
-{\r  "name": "xCALLY Motion API",\r  "version": "2.5.3",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre class=\"prettyprint lang-sh\">GET /api/users\n</pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre class=\"prettyprint lang-sh\">https://motion.xcally.com/api/users\n</pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre class=\"prettyprint lang-sh\">GET  /api/users/{id}\n</pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n</pre>\n<h3>API Key</h3>\n<p>In your request, specify the API Key in apikey query parameter</p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n</pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2020-09-16T08:42:17.368Z",\r    "url": "http://apidocjs.com",\r    "version": "0.19.0"\r  }\r}
+{\r  "name": "xCALLY Motion API",\r  "version": "2.5.3",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre class=\"prettyprint lang-sh\">GET /api/users\n</pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre class=\"prettyprint lang-sh\">https://motion.xcally.com/api/users\n</pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre class=\"prettyprint lang-sh\">GET  /api/users/{id}\n</pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n</pre>\n<h3>API Key</h3>\n<p>In your request, specify the API Key in apikey query parameter</p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n</pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2020-09-16T13:43:56.154Z",\r    "url": "http://apidocjs.com",\r    "version": "0.19.0"\r  }\r}
index 2a3904e..6d77541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e8e=['urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL','getDataValue','STRING','integration','motionbar'];(function(_0x21f3ca,_0x493fa1){var _0x51e18e=function(_0x43db0f){while(--_0x43db0f){_0x21f3ca['push'](_0x21f3ca['shift']());}};_0x51e18e(++_0x493fa1);}(_0x4e8e,0x1b6));var _0xe4e8=function(_0xf5947e,_0x34fb8e){_0xf5947e=_0xf5947e-0x0;var _0x53b0cd=_0x4e8e[_0xf5947e];return _0x53b0cd;};'use strict';var Sequelize=require(_0xe4e8('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4e8('0x1')],'get':function(_0x292dd0){return this[_0xe4e8('0x2')]('action');}},'action':{'type':Sequelize[_0xe4e8('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xe4e8('0x4'),_0xe4e8('0x5'),'jscripty',_0xe4e8('0x6'),_0xe4e8('0x7'),_0xe4e8('0x8'),'script']],'msg':_0xe4e8('0x9')}},'comment':_0xe4e8('0x9')},'data1':{'type':Sequelize[_0xe4e8('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xe4e8('0x3')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xe4e8('0x3')](0x1000),'comment':_0xe4e8('0xa')},'data4':{'type':Sequelize[_0xe4e8('0x3')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xe4e8('0x3')]},'data7':{'type':Sequelize[_0xe4e8('0xb')]}};
\ No newline at end of file
+var _0xef52=['integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x1f37bd,_0xd654f6){var _0x133a2c=function(_0x5afc09){while(--_0x5afc09){_0x1f37bd['push'](_0x1f37bd['shift']());}};_0x133a2c(++_0xd654f6);}(_0xef52,0x71));var _0x2ef5=function(_0x91384,_0x545eef){_0x91384=_0x91384-0x0;var _0x44daa0=_0xef52[_0x91384];return _0x44daa0;};'use strict';var Sequelize=require(_0x2ef5('0x0'));module[_0x2ef5('0x1')]={'name':{'type':Sequelize[_0x2ef5('0x2')],'get':function(_0x5c7220){return this[_0x2ef5('0x3')](_0x2ef5('0x4'));}},'action':{'type':Sequelize[_0x2ef5('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2ef5('0x6'),_0x2ef5('0x7'),_0x2ef5('0x8'),_0x2ef5('0x9'),'urlForward',_0x2ef5('0xa'),'bot',_0x2ef5('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x2ef5('0xc')},'data1':{'type':Sequelize[_0x2ef5('0x5')](0x1000),'comment':_0x2ef5('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x2ef5('0x5')](0x1000),'comment':_0x2ef5('0xe')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x2ef5('0x5')]},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 5a8d104..c59231d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ccf=['update','body','find','params','catch','Action','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','jsforce','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','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send'];(function(_0x5ccad7,_0x419630){var _0x3d3af8=function(_0x29bb0a){while(--_0x29bb0a){_0x5ccad7['push'](_0x5ccad7['shift']());}};_0x3d3af8(++_0x419630);}(_0x8ccf,0xc6));var _0xf8cc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8ccf[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xf8cc('0x0'));var emlformat=require(_0xf8cc('0x1'));var rimraf=require(_0xf8cc('0x2'));var zipdir=require(_0xf8cc('0x3'));var jsonpatch=require(_0xf8cc('0x4'));var rp=require(_0xf8cc('0x5'));var moment=require(_0xf8cc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf8cc('0x7'));var util=require(_0xf8cc('0x8'));var path=require('path');var sox=require(_0xf8cc('0x9'));var csv=require(_0xf8cc('0xa'));var ejs=require(_0xf8cc('0xb'));var fs=require('fs');var _=require(_0xf8cc('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf8cc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf8cc('0xa'));var querystring=require(_0xf8cc('0xe'));var Papa=require(_0xf8cc('0xf'));var Redis=require(_0xf8cc('0x10'));var authService=require(_0xf8cc('0x11'));var qs=require(_0xf8cc('0x12'));var as=require(_0xf8cc('0x13'));var hardwareService=require(_0xf8cc('0x14'));var logger=require(_0xf8cc('0x15'))(_0xf8cc('0x16'));var utils=require(_0xf8cc('0x17'));var config=require(_0xf8cc('0x18'));var db=require(_0xf8cc('0x19'))['db'];function respondWithStatusCode(_0x4395eb,_0x2d7e8a){_0x2d7e8a=_0x2d7e8a||0xcc;return function(_0x3e2f07){if(_0x3e2f07){return _0x4395eb[_0xf8cc('0x1a')](_0x2d7e8a);}return _0x4395eb[_0xf8cc('0x1b')](_0x2d7e8a)['end']();};}function respondWithResult(_0x3ae319,_0x3f4dbd){_0x3f4dbd=_0x3f4dbd||0xc8;return function(_0x2a7a35){if(_0x2a7a35){return _0x3ae319[_0xf8cc('0x1b')](_0x3f4dbd)[_0xf8cc('0x1c')](_0x2a7a35);}};}function respondWithFilteredResult(_0x564fe8,_0x552a54){return function(_0xf7fa33){if(_0xf7fa33){var _0x32bade=_0xf7fa33['count'],_0x50d06d=_0x552a54[_0xf8cc('0x1d')],_0x3fac09=_0x552a54[_0xf8cc('0x1d')]+_0x552a54[_0xf8cc('0x1e')],_0x56c06d;if(_0x3fac09>=_0x32bade){_0x3fac09=_0x32bade;_0x56c06d=0xc8;}else{_0x56c06d=0xce;}_0x564fe8[_0xf8cc('0x1b')](_0x56c06d);return _0x564fe8[_0xf8cc('0x1f')](_0xf8cc('0x20'),_0x50d06d+'-'+_0x3fac09+'/'+_0x32bade)[_0xf8cc('0x1c')](_0xf7fa33);}return null;};}function patchUpdates(_0x3a223b){return function(_0x4670cf){try{jsonpatch[_0xf8cc('0x21')](_0x4670cf,_0x3a223b,!![]);}catch(_0x2b56c2){return BPromise[_0xf8cc('0x22')](_0x2b56c2);}return _0x4670cf[_0xf8cc('0x23')]();};}function saveUpdates(_0x3631ee,_0x594382){return function(_0x43c214){if(_0x43c214){return _0x43c214['update'](_0x3631ee)[_0xf8cc('0x24')](function(_0x13573b){return _0x13573b;});}return null;};}function removeEntity(_0x20eb7a,_0x4e6f05){return function(_0x547118){if(_0x547118){return _0x547118[_0xf8cc('0x25')]()[_0xf8cc('0x24')](function(){_0x20eb7a[_0xf8cc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6f437,_0xd48b7d){return function(_0x38d74d){if(!_0x38d74d){_0xd6f437['sendStatus'](0x194);}return _0x38d74d;};}function handleError(_0x2aef8e,_0x97db3e){_0x97db3e=_0x97db3e||0x1f4;return function(_0x203209){logger[_0xf8cc('0x26')](_0x203209[_0xf8cc('0x27')]);if(_0x203209[_0xf8cc('0x28')]){delete _0x203209['name'];}_0x2aef8e[_0xf8cc('0x1b')](_0x97db3e)[_0xf8cc('0x29')](_0x203209);};}exports[_0xf8cc('0x2a')]=function(_0x5b5281,_0x25d8f3){if(_0x5b5281[_0xf8cc('0x2b')]['id']){delete _0x5b5281['body']['id'];}return db['Action'][_0xf8cc('0x2c')]({'where':{'id':_0x5b5281[_0xf8cc('0x2d')]['id']}})['then'](handleEntityNotFound(_0x25d8f3,null))[_0xf8cc('0x24')](saveUpdates(_0x5b5281[_0xf8cc('0x2b')],null))[_0xf8cc('0x24')](respondWithResult(_0x25d8f3,null))[_0xf8cc('0x2e')](handleError(_0x25d8f3,null));};exports['destroy']=function(_0x68a5d5,_0x33b87a){return db[_0xf8cc('0x2f')][_0xf8cc('0x2c')]({'where':{'id':_0x68a5d5[_0xf8cc('0x2d')]['id']}})[_0xf8cc('0x24')](handleEntityNotFound(_0x33b87a,null))[_0xf8cc('0x24')](removeEntity(_0x33b87a,null))['catch'](handleError(_0x33b87a,null));};
\ No newline at end of file
+var _0x0bf7=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','destroy','error','stack','name','send','body','Action','find','params','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x1d9934,_0x15c292){var _0x3f8856=function(_0x2db3ea){while(--_0x2db3ea){_0x1d9934['push'](_0x1d9934['shift']());}};_0x3f8856(++_0x15c292);}(_0x0bf7,0x104));var _0x70bf=function(_0x3c49fa,_0x4587d2){_0x3c49fa=_0x3c49fa-0x0;var _0x43907a=_0x0bf7[_0x3c49fa];return _0x43907a;};'use strict';var pdf=require(_0x70bf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x70bf('0x1'));var zipdir=require(_0x70bf('0x2'));var jsonpatch=require(_0x70bf('0x3'));var rp=require(_0x70bf('0x4'));var moment=require(_0x70bf('0x5'));var BPromise=require(_0x70bf('0x6'));var Mustache=require('mustache');var util=require(_0x70bf('0x7'));var path=require(_0x70bf('0x8'));var sox=require(_0x70bf('0x9'));var csv=require(_0x70bf('0xa'));var ejs=require(_0x70bf('0xb'));var fs=require('fs');var _=require(_0x70bf('0xc'));var squel=require(_0x70bf('0xd'));var crypto=require('crypto');var jsforce=require(_0x70bf('0xe'));var deskjs=require(_0x70bf('0xf'));var toCsv=require(_0x70bf('0xa'));var querystring=require(_0x70bf('0x10'));var Papa=require(_0x70bf('0x11'));var Redis=require(_0x70bf('0x12'));var authService=require(_0x70bf('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x70bf('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x70bf('0x15'));var config=require(_0x70bf('0x16'));var db=require(_0x70bf('0x17'))['db'];function respondWithStatusCode(_0x10266d,_0x341a22){_0x341a22=_0x341a22||0xcc;return function(_0x4c2558){if(_0x4c2558){return _0x10266d[_0x70bf('0x18')](_0x341a22);}return _0x10266d[_0x70bf('0x19')](_0x341a22)[_0x70bf('0x1a')]();};}function respondWithResult(_0x81e7a6,_0xa75b14){_0xa75b14=_0xa75b14||0xc8;return function(_0x3da06d){if(_0x3da06d){return _0x81e7a6[_0x70bf('0x19')](_0xa75b14)[_0x70bf('0x1b')](_0x3da06d);}};}function respondWithFilteredResult(_0x586439,_0x19da27){return function(_0x1310c1){if(_0x1310c1){var _0x31f6a4=_0x1310c1[_0x70bf('0x1c')],_0x420789=_0x19da27['offset'],_0x58fa0d=_0x19da27[_0x70bf('0x1d')]+_0x19da27[_0x70bf('0x1e')],_0x33faf9;if(_0x58fa0d>=_0x31f6a4){_0x58fa0d=_0x31f6a4;_0x33faf9=0xc8;}else{_0x33faf9=0xce;}_0x586439[_0x70bf('0x19')](_0x33faf9);return _0x586439[_0x70bf('0x1f')]('Content-Range',_0x420789+'-'+_0x58fa0d+'/'+_0x31f6a4)[_0x70bf('0x1b')](_0x1310c1);}return null;};}function patchUpdates(_0x374da0){return function(_0x380ff8){try{jsonpatch[_0x70bf('0x20')](_0x380ff8,_0x374da0,!![]);}catch(_0x4eafc8){return BPromise[_0x70bf('0x21')](_0x4eafc8);}return _0x380ff8['save']();};}function saveUpdates(_0x13f0a8,_0x2b5ff8){return function(_0x5c1fec){if(_0x5c1fec){return _0x5c1fec['update'](_0x13f0a8)[_0x70bf('0x22')](function(_0x1ff01c){return _0x1ff01c;});}return null;};}function removeEntity(_0x182aad,_0xc887a4){return function(_0x15898f){if(_0x15898f){return _0x15898f[_0x70bf('0x23')]()['then'](function(){_0x182aad[_0x70bf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27b056,_0xbaa834){return function(_0x4f888f){if(!_0x4f888f){_0x27b056['sendStatus'](0x194);}return _0x4f888f;};}function handleError(_0x5874fd,_0x12f9cd){_0x12f9cd=_0x12f9cd||0x1f4;return function(_0x3451f9){logger[_0x70bf('0x24')](_0x3451f9[_0x70bf('0x25')]);if(_0x3451f9[_0x70bf('0x26')]){delete _0x3451f9[_0x70bf('0x26')];}_0x5874fd['status'](_0x12f9cd)[_0x70bf('0x27')](_0x3451f9);};}exports['update']=function(_0x2eb698,_0x25d190){if(_0x2eb698[_0x70bf('0x28')]['id']){delete _0x2eb698[_0x70bf('0x28')]['id'];}return db[_0x70bf('0x29')][_0x70bf('0x2a')]({'where':{'id':_0x2eb698[_0x70bf('0x2b')]['id']}})[_0x70bf('0x22')](handleEntityNotFound(_0x25d190,null))[_0x70bf('0x22')](saveUpdates(_0x2eb698['body'],null))[_0x70bf('0x22')](respondWithResult(_0x25d190,null))[_0x70bf('0x2c')](handleError(_0x25d190,null));};exports[_0x70bf('0x23')]=function(_0x881308,_0x357df8){return db[_0x70bf('0x29')]['find']({'where':{'id':_0x881308[_0x70bf('0x2b')]['id']}})[_0x70bf('0x22')](handleEntityNotFound(_0x357df8,null))[_0x70bf('0x22')](removeEntity(_0x357df8,null))[_0x70bf('0x2c')](handleError(_0x357df8,null));};
\ No newline at end of file
index f9c2e7b..32383d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf78d=['request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util','api','moment'];(function(_0x1d06c9,_0x353fd4){var _0x4293d0=function(_0x172051){while(--_0x172051){_0x1d06c9['push'](_0x1d06c9['shift']());}};_0x4293d0(++_0x353fd4);}(_0xf78d,0x1f4));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdf78('0x0'));var util=require(_0xdf78('0x1'));var logger=require('../../config/logger')(_0xdf78('0x2'));var moment=require(_0xdf78('0x3'));var BPromise=require('bluebird');var rp=require(_0xdf78('0x4'));var fs=require('fs');var path=require(_0xdf78('0x5'));var rimraf=require(_0xdf78('0x6'));var config=require(_0xdf78('0x7'));var attributes=require(_0xdf78('0x8'));module[_0xdf78('0x9')]=function(_0x5ea578,_0x381314){return _0x5ea578[_0xdf78('0xa')]('Action',attributes,{'tableName':_0xdf78('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad8b=['./action.attributes','define','tools_actions','lodash','api','bluebird','rimraf','../../config/environment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xad8b,0x1bb));var _0xbad8=function(_0x2c61c7,_0x4f5da0){_0x2c61c7=_0x2c61c7-0x0;var _0x8ceb1=_0xad8b[_0x2c61c7];return _0x8ceb1;};'use strict';var _=require(_0xbad8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbad8('0x1'));var moment=require('moment');var BPromise=require(_0xbad8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbad8('0x3'));var config=require(_0xbad8('0x4'));var attributes=require(_0xbad8('0x5'));module['exports']=function(_0x4b69eb,_0x5d5fdd){return _0x4b69eb[_0xbad8('0x6')]('Action',attributes,{'tableName':_0xbad8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5381de1..f231a2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x21d3e3,_0x5e8394){var _0x59f8de=function(_0x2ca4cf){while(--_0x2ca4cf){_0x21d3e3['push'](_0x21d3e3['shift']());}};_0x59f8de(++_0x5e8394);}(_0xe706,0xa3));var _0x6e70=function(_0x2bf76a,_0xb01832){_0x2bf76a=_0x2bf76a-0x0;var _0x1ec759=_0xe706[_0x2bf76a];return _0x1ec759;};'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']('Action,\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']('Action,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1e4e22,_0x567aad){var _0x5a26ea=function(_0x1f9afd){while(--_0x1f9afd){_0x1e4e22['push'](_0x1e4e22['shift']());}};_0x5a26ea(++_0x567aad);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
index eea2d25..f5c698e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f6b=['isAuthenticated','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./action.controller','/:id'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x4f6b,0xff));var _0xb4f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4f6b[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xb4f6('0x0'));var util=require('util');var path=require(_0xb4f6('0x1'));var timeout=require(_0xb4f6('0x2'));var express=require(_0xb4f6('0x3'));var router=express[_0xb4f6('0x4')]();var auth=require(_0xb4f6('0x5'));var interaction=require(_0xb4f6('0x6'));var config=require('../../config/environment');var controller=require(_0xb4f6('0x7'));router['put'](_0xb4f6('0x8'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xb4f6('0x9')](),controller[_0xb4f6('0xa')]);module[_0xb4f6('0xb')]=router;
\ No newline at end of file
+var _0xf439=['update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./action.controller','/:id','isAuthenticated'];(function(_0x1fc8b6,_0x1b61d9){var _0x558f29=function(_0x222551){while(--_0x222551){_0x1fc8b6['push'](_0x1fc8b6['shift']());}};_0x558f29(++_0x1b61d9);}(_0xf439,0x1e2));var _0x9f43=function(_0x48cc5b,_0x40aae5){_0x48cc5b=_0x48cc5b-0x0;var _0x161a80=_0xf439[_0x48cc5b];return _0x161a80;};'use strict';var multer=require(_0x9f43('0x0'));var util=require(_0x9f43('0x1'));var path=require('path');var timeout=require(_0x9f43('0x2'));var express=require(_0x9f43('0x3'));var router=express[_0x9f43('0x4')]();var auth=require(_0x9f43('0x5'));var interaction=require(_0x9f43('0x6'));var config=require('../../config/environment');var controller=require(_0x9f43('0x7'));router['put'](_0x9f43('0x8'),auth[_0x9f43('0x9')](),controller[_0x9f43('0xa')]);router[_0x9f43('0xb')](_0x9f43('0x8'),auth[_0x9f43('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index ec77aae..a01ba2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1924=['TEXT','STRING'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x1924,0xff));var _0x4192=function(_0x557325,_0x3427be){_0x557325=_0x557325-0x0;var _0x3c6e68=_0x1924[_0x557325];return _0x3c6e68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4192('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4192('0x0')]},'table':{'type':Sequelize[_0x4192('0x0')]},'conditions':{'type':Sequelize[_0x4192('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xe966=['exports','STRING','TEXT'];(function(_0x5a3bd0,_0x44f68a){var _0x4754bc=function(_0x3063a4){while(--_0x3063a4){_0x5a3bd0['push'](_0x5a3bd0['shift']());}};_0x4754bc(++_0x44f68a);}(_0xe966,0x1aa));var _0x6e96=function(_0x4f1c2b,_0x589774){_0x4f1c2b=_0x4f1c2b-0x0;var _0x417317=_0xe966[_0x4f1c2b];return _0x417317;};'use strict';var Sequelize=require('sequelize');module[_0x6e96('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6e96('0x1')]},'parent':{'type':Sequelize[_0x6e96('0x1')]},'table':{'type':Sequelize[_0x6e96('0x1')]},'conditions':{'type':Sequelize[_0x6e96('0x2')]},'joins':{'type':Sequelize[_0x6e96('0x2')]}};
\ No newline at end of file
index c542b0b..c9d2c49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2904=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','status','count','offset','limit','Content-Range','apply','reject','update','then','get','CustomReports','UserProfileResource','end','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','length','group','field','condition','value','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','AVG(%s)','SEC_TO_TIME(%s)','operator','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','%s.%s\x20=\x20%s.%s','debug','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','run','runReport','Limited\x20Query:','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x2904,0x137));var _0x4290=function(_0x3897bf,_0x35d7f9){_0x3897bf=_0x3897bf-0x0;var _0x41082f=_0x2904[_0x3897bf];return _0x41082f;};'use strict';var pdf=require(_0x4290('0x0'));var emlformat=require(_0x4290('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4290('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4290('0x3'));var moment=require(_0x4290('0x4'));var BPromise=require(_0x4290('0x5'));var Mustache=require(_0x4290('0x6'));var util=require(_0x4290('0x7'));var path=require('path');var sox=require(_0x4290('0x8'));var csv=require(_0x4290('0x9'));var ejs=require(_0x4290('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4290('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4290('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4290('0xd'));var Papa=require(_0x4290('0xe'));var Redis=require('ioredis');var authService=require(_0x4290('0xf'));var qs=require(_0x4290('0x10'));var as=require(_0x4290('0x11'));var hardwareService=require(_0x4290('0x12'));var logger=require(_0x4290('0x13'))(_0x4290('0x14'));var utils=require(_0x4290('0x15'));var config=require(_0x4290('0x16'));var db=require(_0x4290('0x17'))['db'];var dbH=require('../../mysqldb')[_0x4290('0x18')];function respondWithStatusCode(_0x1a2b4b,_0x5d3384){_0x5d3384=_0x5d3384||0xcc;return function(_0x18223a){if(_0x18223a){return _0x1a2b4b['sendStatus'](_0x5d3384);}return _0x1a2b4b[_0x4290('0x19')](_0x5d3384)['end']();};}function respondWithResult(_0x418062,_0x252b4e){_0x252b4e=_0x252b4e||0xc8;return function(_0x59a02c){if(_0x59a02c){return _0x418062[_0x4290('0x19')](_0x252b4e)['json'](_0x59a02c);}};}function respondWithFilteredResult(_0x1c8d95,_0xf2f5c9){return function(_0x1ff10f){if(_0x1ff10f){var _0x5d0a1f=_0x1ff10f[_0x4290('0x1a')],_0x10ff09=_0xf2f5c9[_0x4290('0x1b')],_0x15f816=_0xf2f5c9[_0x4290('0x1b')]+_0xf2f5c9[_0x4290('0x1c')],_0x47fe8a;if(_0x15f816>=_0x5d0a1f){_0x15f816=_0x5d0a1f;_0x47fe8a=0xc8;}else{_0x47fe8a=0xce;}_0x1c8d95[_0x4290('0x19')](_0x47fe8a);return _0x1c8d95['set'](_0x4290('0x1d'),_0x10ff09+'-'+_0x15f816+'/'+_0x5d0a1f)['json'](_0x1ff10f);}return null;};}function patchUpdates(_0x10efd1){return function(_0x25cb57){try{jsonpatch[_0x4290('0x1e')](_0x25cb57,_0x10efd1,!![]);}catch(_0x5f3058){return BPromise[_0x4290('0x1f')](_0x5f3058);}return _0x25cb57['save']();};}function saveUpdates(_0x3f95ca,_0x5ee14a){return function(_0x52fedc){if(_0x52fedc){return _0x52fedc[_0x4290('0x20')](_0x3f95ca)[_0x4290('0x21')](function(_0x832c9f){return _0x832c9f;});}return null;};}function removeEntity(_0x301b94,_0x3a7445){return function(_0x3b178d){if(_0x3b178d){return _0x3b178d['destroy']()[_0x4290('0x21')](function(){var _0x5e912a=_0x3b178d[_0x4290('0x22')]({'plain':!![]});var _0x46d4bd=_0x4290('0x23');return db[_0x4290('0x24')]['destroy']({'where':{'type':_0x46d4bd,'resourceId':_0x5e912a['id']}})['then'](function(){return _0x3b178d;});})[_0x4290('0x21')](function(){_0x301b94[_0x4290('0x19')](0xcc)[_0x4290('0x25')]();});}};}function handleEntityNotFound(_0x423e34,_0x1fcbb9){return function(_0x2031a6){if(!_0x2031a6){_0x423e34[_0x4290('0x26')](0x194);}return _0x2031a6;};}function handleError(_0x3c4def,_0x1af4b8){_0x1af4b8=_0x1af4b8||0x1f4;return function(_0x4675a9){logger['error'](_0x4675a9[_0x4290('0x27')]);if(_0x4675a9[_0x4290('0x28')]){delete _0x4675a9['name'];}_0x3c4def[_0x4290('0x19')](_0x1af4b8)[_0x4290('0x29')](_0x4675a9);};}exports[_0x4290('0x2a')]=function(_0x3b6579,_0x53c1c0){var _0x3fa5e8={},_0x660773={},_0x58788e={'count':0x0,'rows':[]};var _0x2d73ca=_[_0x4290('0x2b')](db[_0x4290('0x2c')][_0x4290('0x2d')],function(_0x3569bd){return{'name':_0x3569bd[_0x4290('0x2e')],'type':_0x3569bd[_0x4290('0x2f')][_0x4290('0x30')]};});_0x660773[_0x4290('0x31')]=_[_0x4290('0x2b')](_0x2d73ca,_0x4290('0x28'));_0x660773[_0x4290('0x32')]=_[_0x4290('0x33')](_0x3b6579[_0x4290('0x32')]);_0x660773[_0x4290('0x34')]=_[_0x4290('0x35')](_0x660773[_0x4290('0x31')],_0x660773[_0x4290('0x32')]);_0x3fa5e8[_0x4290('0x36')]=_[_0x4290('0x35')](_0x660773[_0x4290('0x31')],qs['fields'](_0x3b6579['query'][_0x4290('0x37')]));_0x3fa5e8[_0x4290('0x36')]=_0x3fa5e8['attributes']['length']?_0x3fa5e8[_0x4290('0x36')]:_0x660773[_0x4290('0x31')];if(!_0x3b6579[_0x4290('0x32')][_0x4290('0x38')](_0x4290('0x39'))){_0x3fa5e8['limit']=qs[_0x4290('0x1c')](_0x3b6579[_0x4290('0x32')][_0x4290('0x1c')]);_0x3fa5e8[_0x4290('0x1b')]=qs['offset'](_0x3b6579['query'][_0x4290('0x1b')]);}_0x3fa5e8[_0x4290('0x3a')]=qs[_0x4290('0x3b')](_0x3b6579[_0x4290('0x32')][_0x4290('0x3b')]);_0x3fa5e8[_0x4290('0x3c')]=qs[_0x4290('0x34')](_[_0x4290('0x3d')](_0x3b6579[_0x4290('0x32')],_0x660773[_0x4290('0x34')]),_0x2d73ca);if(_0x3b6579[_0x4290('0x32')][_0x4290('0x3e')]){_0x3fa5e8[_0x4290('0x3c')]=_[_0x4290('0x3f')](_0x3fa5e8['where'],{'$or':_[_0x4290('0x2b')](_0x2d73ca,function(_0x332c4e){if(_0x332c4e[_0x4290('0x2f')]!=='VIRTUAL'){var _0x1527d3={};_0x1527d3[_0x332c4e[_0x4290('0x28')]]={'$like':'%'+_0x3b6579['query'][_0x4290('0x3e')]+'%'};return _0x1527d3;}})});}_0x3fa5e8=_['merge']({},_0x3fa5e8,_0x3b6579[_0x4290('0x40')]);var _0x56458e={'where':_0x3fa5e8[_0x4290('0x3c')]};return db[_0x4290('0x2c')][_0x4290('0x1a')](_0x56458e)['then'](function(_0x4cbd84){_0x58788e[_0x4290('0x1a')]=_0x4cbd84;if(_0x3b6579[_0x4290('0x32')][_0x4290('0x41')]){_0x3fa5e8[_0x4290('0x42')]=[{'all':!![]}];}return db[_0x4290('0x2c')][_0x4290('0x43')](_0x3fa5e8);})['then'](function(_0x16d1b0){_0x58788e[_0x4290('0x44')]=_0x16d1b0;return _0x58788e;})[_0x4290('0x21')](respondWithFilteredResult(_0x53c1c0,_0x3fa5e8))[_0x4290('0x45')](handleError(_0x53c1c0,null));};exports[_0x4290('0x46')]=function(_0x344a3d,_0xb9d8bf){var _0xfe2aed={'raw':![],'where':{'id':_0x344a3d[_0x4290('0x47')]['id']}},_0x5adf89={};_0x5adf89[_0x4290('0x31')]=_[_0x4290('0x33')](db[_0x4290('0x2c')][_0x4290('0x2d')]);_0x5adf89[_0x4290('0x32')]=_[_0x4290('0x33')](_0x344a3d[_0x4290('0x32')]);_0x5adf89['filters']=_[_0x4290('0x35')](_0x5adf89[_0x4290('0x31')],_0x5adf89[_0x4290('0x32')]);_0xfe2aed['attributes']=_[_0x4290('0x35')](_0x5adf89[_0x4290('0x31')],qs[_0x4290('0x37')](_0x344a3d['query'][_0x4290('0x37')]));_0xfe2aed[_0x4290('0x36')]=_0xfe2aed[_0x4290('0x36')]['length']?_0xfe2aed['attributes']:_0x5adf89[_0x4290('0x31')];if(_0x344a3d[_0x4290('0x32')]['includeAll']){_0xfe2aed[_0x4290('0x42')]=[{'all':!![]}];}_0xfe2aed=_[_0x4290('0x3f')]({},_0xfe2aed,_0x344a3d['options']);return db[_0x4290('0x2c')][_0x4290('0x48')](_0xfe2aed)[_0x4290('0x21')](handleEntityNotFound(_0xb9d8bf,null))['then'](respondWithResult(_0xb9d8bf,null))[_0x4290('0x45')](handleError(_0xb9d8bf,null));};exports[_0x4290('0x49')]=function(_0xaa2195,_0x4eb700){return db[_0x4290('0x2c')][_0x4290('0x49')](_0xaa2195[_0x4290('0x4a')],{})['then'](function(_0xf1418f){var _0xb29b1=_0xaa2195[_0x4290('0x4b')][_0x4290('0x22')]({'plain':!![]});if(!_0xb29b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb29b1[_0x4290('0x4c')]===_0x4290('0x4b')){var _0x427f7b=_0xf1418f[_0x4290('0x22')]({'plain':!![]});var _0x186b59=_0x4290('0x4d');return db[_0x4290('0x4e')][_0x4290('0x48')]({'where':{'name':_0x186b59,'userProfileId':_0xb29b1[_0x4290('0x4f')]},'raw':!![]})['then'](function(_0x5a7949){if(_0x5a7949&&_0x5a7949['autoAssociation']===0x0){return db[_0x4290('0x24')][_0x4290('0x49')]({'name':_0x427f7b[_0x4290('0x28')],'resourceId':_0x427f7b['id'],'type':'CustomReports','sectionId':_0x5a7949['id']},{})[_0x4290('0x21')](function(){return _0xf1418f;});}else{return _0xf1418f;}})[_0x4290('0x45')](function(_0x20f6a2){logger['error'](_0x4290('0x50'),_0x20f6a2);throw _0x20f6a2;});}return _0xf1418f;})['then'](respondWithResult(_0x4eb700,0xc9))[_0x4290('0x45')](handleError(_0x4eb700,null));};exports[_0x4290('0x20')]=function(_0x4ce61f,_0x179a74){if(_0x4ce61f[_0x4290('0x4a')]['id']){delete _0x4ce61f[_0x4290('0x4a')]['id'];}return db[_0x4290('0x2c')]['find']({'where':{'id':_0x4ce61f['params']['id']}})[_0x4290('0x21')](handleEntityNotFound(_0x179a74,null))[_0x4290('0x21')](saveUpdates(_0x4ce61f[_0x4290('0x4a')],null))[_0x4290('0x21')](respondWithResult(_0x179a74,null))[_0x4290('0x45')](handleError(_0x179a74,null));};exports[_0x4290('0x51')]=function(_0x4b7e50,_0x54fc77){return db['AnalyticCustomReport'][_0x4290('0x48')]({'where':{'id':_0x4b7e50[_0x4290('0x47')]['id']}})[_0x4290('0x21')](handleEntityNotFound(_0x54fc77,null))[_0x4290('0x21')](removeEntity(_0x54fc77,null))[_0x4290('0x45')](handleError(_0x54fc77,null));};exports[_0x4290('0x52')]=function(_0x5e8735,_0x13d031){var _0x4ef85e=0xa;var _0x176ba6=[_0x4290('0x53'),_0x4290('0x54'),'right_join',_0x4290('0x55')];var _0x568209={'SUM':_0x4290('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4290('0x57'),'MAX':_0x4290('0x58'),'MIN':_0x4290('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4290('0x5a'),'GROUP_CONCAT ASC':_0x4290('0x5b'),'GROUP_CONCAT DESC':_0x4290('0x5c')};var _0x5dc4e2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4290('0x5d'),'HOUR':_0x4290('0x5e'),'ROUND':_0x4290('0x5f'),'UNIX_TIMESTAMP':_0x4290('0x60')};var _0x27070e=function(_0x1a41d7){return!_[_0x4290('0x61')]([_0x4290('0x62'),_0x4290('0x63'),_0x4290('0x64'),'IS\x20NOT\x20EMPTY'],_0x1a41d7);};var _0x485156=function(_0x3b3031){if(!_0x3b3031||!_0x3b3031[_0x4290('0x65')]['length']){return'';}for(var _0x3577b9='(',_0x2f0813=0x0;_0x2f0813<_0x3b3031['rules'][_0x4290('0x66')];_0x2f0813+=0x1){_0x2f0813>0x0&&(_0x3577b9+='\x20'+_0x3b3031['operator']+'\x20');_0x3577b9+=_0x3b3031[_0x4290('0x65')][_0x2f0813]['group']?_0x485156(_0x3b3031[_0x4290('0x65')][_0x2f0813][_0x4290('0x67')]):_0x3b3031[_0x4290('0x65')][_0x2f0813][_0x4290('0x68')]+'\x20'+_0x3b3031[_0x4290('0x65')][_0x2f0813][_0x4290('0x69')]+(_0x27070e(_0x3b3031[_0x4290('0x65')][_0x2f0813][_0x4290('0x69')])?'\x20'+_0x3b3031['rules'][_0x2f0813][_0x4290('0x6a')]:'');}return _0x3577b9+')';};var _0x376a96={'where':{'id':_0x5e8735[_0x4290('0x47')]['id']}},_0x56f869,_0x22346c,_0xe77aa2,_0x2a324d,_0x4d1ffd;_0x376a96=_[_0x4290('0x3f')]({},_0x376a96,_0x5e8735[_0x4290('0x40')]);return db[_0x4290('0x2c')][_0x4290('0x48')](_0x376a96)['then'](function(_0x39ecfb){if(_0x39ecfb){_0x56f869=_0x39ecfb;return _0x39ecfb[_0x4290('0x6b')]();}return null;})[_0x4290('0x21')](function(_0x50b472){if(_0x50b472){if(!_0x50b472[_0x4290('0x66')]){throw new db[(_0x4290('0x6c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x22346c=_0x50b472;return db[_0x4290('0x6d')][_0x4290('0x43')]({'raw':!![]});}return null;})[_0x4290('0x21')](function(_0x233047){if(_0x233047){_0xe77aa2=_[_0x4290('0x6e')](_0x233047,'id');var _0x5eef61;var _0x593bdd=squel[_0x4290('0x6f')]();_0x593bdd[_0x4290('0x70')](_0x56f869[_0x4290('0x71')]);for(var _0xb8e4e9=0x0;_0xb8e4e9<_0x22346c[_0x4290('0x66')];_0xb8e4e9+=0x1){_0x5eef61=_0x22346c[_0xb8e4e9]['MetricId']?_0xe77aa2[_0x22346c[_0xb8e4e9][_0x4290('0x72')]][_0x4290('0x73')]:_0x22346c[_0xb8e4e9][_0x4290('0x68')];_0x5eef61=_0x22346c[_0xb8e4e9][_0x4290('0x74')]?_['replace'](_0x568209[_0x22346c[_0xb8e4e9][_0x4290('0x74')]],'%s',_0x5eef61):_0x5eef61;_0x5eef61=_0x22346c[_0xb8e4e9][_0x4290('0x75')]?_[_0x4290('0x76')](_0x5dc4e2[_0x22346c[_0xb8e4e9]['format']],'%s',_0x5eef61):_0x5eef61;if(_0x22346c[_0xb8e4e9][_0x4290('0x77')]){_0x593bdd[_0x4290('0x67')](_0x5eef61);}_0x22346c[_0xb8e4e9]['orderBy']&&_0x593bdd[_0x4290('0x3a')](_0x5eef61,_0x22346c[_0xb8e4e9][_0x4290('0x78')]===_0x4290('0x79')?![]:!![]);_0x593bdd[_0x4290('0x68')](_0x5eef61,_0x22346c[_0xb8e4e9][_0x4290('0x7a')]||_0x5eef61);}if(_0x56f869[_0x4290('0x7b')]){_0x56f869[_0x4290('0x7b')]=JSON[_0x4290('0x7c')](_0x56f869[_0x4290('0x7b')]);for(var _0x565866=0x0;_0x565866<_0x56f869[_0x4290('0x7b')][_0x4290('0x66')];_0x565866+=0x1){if(_0x56f869[_0x4290('0x7b')][_0x565866][_0x4290('0x2f')]&&_['includes'](_0x176ba6,_0x56f869[_0x4290('0x7b')][_0x565866][_0x4290('0x2f')])&&_0x56f869[_0x4290('0x7b')][_0x565866][_0x4290('0x7d')]&&_0x56f869[_0x4290('0x7b')][_0x565866][_0x4290('0x7e')]&&_0x56f869[_0x4290('0x7b')][_0x565866][_0x4290('0x7f')]){_0x593bdd[_0x56f869[_0x4290('0x7b')][_0x565866][_0x4290('0x2f')]](_0x56f869[_0x4290('0x7b')][_0x565866]['foreignTable'],null,util[_0x4290('0x75')]('%s.%s\x20=\x20%s.%s',_0x56f869[_0x4290('0x71')],_0x56f869[_0x4290('0x7b')][_0x565866][_0x4290('0x7d')],_0x56f869['joins'][_0x565866][_0x4290('0x7e')],_0x56f869['joins'][_0x565866][_0x4290('0x7f')]));}}}if(_0x56f869[_0x4290('0x80')]){_0x56f869[_0x4290('0x80')]=JSON[_0x4290('0x7c')](_0x56f869['conditions']);_0x593bdd[_0x4290('0x3c')](_0x485156(_0x56f869[_0x4290('0x80')]['group']));}_0x4d1ffd=_0x593bdd[_0x4290('0x81')]();_0x593bdd[_0x4290('0x1c')](_0x4ef85e);_0x593bdd[_0x4290('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x593bdd[_0x4290('0x82')]());return db[_0x4290('0x83')][_0x4290('0x32')](_0x593bdd[_0x4290('0x82')](),{'type':db['sequelize'][_0x4290('0x84')][_0x4290('0x85')]});}})['then'](respondWithResult(_0x13d031,null))[_0x4290('0x45')](handleError(_0x13d031,null));};function runReport(_0xd29d06,_0x29074d,_0x5d1faa){var _0x3bf5c0=_0x29074d[_0x4290('0x28')];var _0x17b73e=0xa;var _0x2963d8=[_0x4290('0x53'),_0x4290('0x54'),_0x4290('0x86'),_0x4290('0x55')];var _0x136be5={'SUM':_0x4290('0x56'),'COUNT':_0x4290('0x87'),'COUNT DISTINCT':_0x4290('0x57'),'MAX':_0x4290('0x58'),'MIN':_0x4290('0x59'),'AVG':_0x4290('0x88'),'GROUP_CONCAT':_0x4290('0x5a'),'GROUP_CONCAT ASC':_0x4290('0x5b'),'GROUP_CONCAT DESC':_0x4290('0x5c')};var _0x1e4314={'SEC_TO_TIME':_0x4290('0x89'),'DATE':'DATE(%s)','HOUR':_0x4290('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4290('0x60')};var _0x255d80=function(_0x2ff7c0){return!_[_0x4290('0x61')]([_0x4290('0x62'),'IS\x20NOT\x20NULL',_0x4290('0x64'),'IS\x20NOT\x20EMPTY'],_0x2ff7c0);};var _0x1027ed=function(_0x1fab0b){if(!_0x1fab0b||!_0x1fab0b[_0x4290('0x65')][_0x4290('0x66')]){return'';}for(var _0x24f83e='(',_0x3c79c4=0x0;_0x3c79c4<_0x1fab0b['rules'][_0x4290('0x66')];_0x3c79c4+=0x1){_0x3c79c4>0x0&&(_0x24f83e+='\x20'+_0x1fab0b[_0x4290('0x8a')]+'\x20');_0x24f83e+=_0x1fab0b[_0x4290('0x65')][_0x3c79c4][_0x4290('0x67')]?_0x1027ed(_0x1fab0b[_0x4290('0x65')][_0x3c79c4][_0x4290('0x67')]):_0x1fab0b[_0x4290('0x65')][_0x3c79c4][_0x4290('0x68')]+'\x20'+_0x1fab0b[_0x4290('0x65')][_0x3c79c4][_0x4290('0x69')]+(_0x255d80(_0x1fab0b['rules'][_0x3c79c4][_0x4290('0x69')])?'\x20'+_0x1fab0b[_0x4290('0x65')][_0x3c79c4][_0x4290('0x6a')]:'');}return _0x24f83e+')';};var _0x277f6a={'where':{'id':_0xd29d06['id']}},_0x221a64,_0x52210a,_0x93206b,_0x377885,_0x1b399c;_0x277f6a=_[_0x4290('0x3f')]({},_0x277f6a,_0x5d1faa);return db[_0x4290('0x2c')][_0x4290('0x48')](_0x277f6a)[_0x4290('0x21')](function(_0x52ac31){if(_0x52ac31){_0x221a64=_0x52ac31;return _0x52ac31[_0x4290('0x6b')]();}return null;})['then'](function(_0x2ff701){if(_0x2ff701){if(!_0x2ff701[_0x4290('0x66')]){throw new db[(_0x4290('0x6c'))][(_0x4290('0x8b'))](_0x4290('0x8c'),0x193);}_0x52210a=_0x2ff701;return db[_0x4290('0x6d')][_0x4290('0x43')]({'raw':!![]});}return null;})[_0x4290('0x21')](function(_0x4c867d){if(_0x4c867d){_0x93206b=_['keyBy'](_0x4c867d,'id');var _0x3ca11d;var _0x17eb83=squel[_0x4290('0x6f')]();_0x17eb83[_0x4290('0x70')](_0x221a64[_0x4290('0x71')]);for(var _0x51e412=0x0;_0x51e412<_0x52210a[_0x4290('0x66')];_0x51e412+=0x1){_0x3ca11d=_0x52210a[_0x51e412][_0x4290('0x72')]?_0x93206b[_0x52210a[_0x51e412][_0x4290('0x72')]]['metric']:_0x52210a[_0x51e412][_0x4290('0x68')];_0x3ca11d=_0x52210a[_0x51e412][_0x4290('0x74')]?_[_0x4290('0x76')](_0x136be5[_0x52210a[_0x51e412][_0x4290('0x74')]],'%s',_0x3ca11d):_0x3ca11d;_0x3ca11d=_0x52210a[_0x51e412][_0x4290('0x75')]?_[_0x4290('0x76')](_0x1e4314[_0x52210a[_0x51e412][_0x4290('0x75')]],'%s',_0x3ca11d):_0x3ca11d;if(_0x52210a[_0x51e412][_0x4290('0x77')]){_0x17eb83[_0x4290('0x67')](_0x3ca11d);}_0x52210a[_0x51e412]['orderBy']&&_0x17eb83[_0x4290('0x3a')](_0x3ca11d,_0x52210a[_0x51e412]['orderBy']===_0x4290('0x79')?![]:!![]);_0x17eb83[_0x4290('0x68')](_0x3ca11d,_0x52210a[_0x51e412][_0x4290('0x7a')]||_0x3ca11d);}if(_0x221a64[_0x4290('0x7b')]){_0x221a64[_0x4290('0x7b')]=JSON[_0x4290('0x7c')](_0x221a64['joins']);for(var _0x2988a7=0x0;_0x2988a7<_0x221a64[_0x4290('0x7b')][_0x4290('0x66')];_0x2988a7+=0x1){if(_0x221a64[_0x4290('0x7b')][_0x2988a7]['type']&&_[_0x4290('0x61')](_0x2963d8,_0x221a64[_0x4290('0x7b')][_0x2988a7][_0x4290('0x2f')])&&_0x221a64['joins'][_0x2988a7][_0x4290('0x7d')]&&_0x221a64['joins'][_0x2988a7][_0x4290('0x7e')]&&_0x221a64[_0x4290('0x7b')][_0x2988a7][_0x4290('0x7f')]){_0x17eb83[_0x221a64[_0x4290('0x7b')][_0x2988a7][_0x4290('0x2f')]](_0x221a64[_0x4290('0x7b')][_0x2988a7][_0x4290('0x7e')],null,util['format'](_0x4290('0x8d'),_0x221a64[_0x4290('0x71')],_0x221a64[_0x4290('0x7b')][_0x2988a7][_0x4290('0x7d')],_0x221a64[_0x4290('0x7b')][_0x2988a7][_0x4290('0x7e')],_0x221a64[_0x4290('0x7b')][_0x2988a7]['foreignKey']));}}}if(_0x221a64[_0x4290('0x80')]){_0x221a64[_0x4290('0x80')]=JSON[_0x4290('0x7c')](_0x221a64[_0x4290('0x80')]);_0x17eb83[_0x4290('0x3c')](_0x1027ed(_0x221a64[_0x4290('0x80')][_0x4290('0x67')]));}_0x1b399c=_0x17eb83[_0x4290('0x81')]();_0x17eb83['limit'](_0x17b73e);_0x17eb83[_0x4290('0x1b')](0x0);logger[_0x4290('0x8e')]('Limited\x20Query:',_0x17eb83[_0x4290('0x82')]());return db[_0x4290('0x83')][_0x4290('0x32')](_0x17eb83[_0x4290('0x82')](),{'type':db[_0x4290('0x83')]['QueryTypes'][_0x4290('0x85')]});}})[_0x4290('0x21')](function(_0x55b479){if(!_0x55b479[_0x4290('0x66')]){throw new db['Sequelize'][(_0x4290('0x8b'))]('No\x20available\x20data',0xcc);}if(_0x29074d[_0x4290('0x8f')]===_0x4290('0x90')){return null;}var _0x3bae44=_[_0x4290('0x3f')](_0x29074d,{'name':_0x29074d[_0x4290('0x91')]||_0x29074d[_0x4290('0x28')]||_0x221a64['name'],'basename':_0x3bf5c0,'savename':util[_0x4290('0x75')](_0x4290('0x92'),_0x29074d['name']||_0x221a64[_0x4290('0x28')],require(_0x4290('0x93'))[_0x4290('0x94')](0x4),_0x29074d['output']||'csv'),'reportId':_0x221a64['id'],'reportType':_0x4290('0x95')});return db[_0x4290('0x96')][_0x4290('0x49')](_0x3bae44,{'raw':!![]});})[_0x4290('0x21')](function(_0x92ae30){if(_0x221a64[_0x4290('0x71')]===_0x4290('0x97')){_0x1b399c[_0x4290('0x3c')](_0x221a64['table']+_0x4290('0x98'),_0x29074d[_0x4290('0x99')],_0x29074d[_0x4290('0x9a')]);}else{_0x1b399c[_0x4290('0x3c')](_0x221a64[_0x4290('0x71')]+_0x4290('0x9b'),_0x29074d['startDate'],_0x29074d[_0x4290('0x9a')]);}if(_0x92ae30){logger[_0x4290('0x9c')](_0x4290('0x9d'),_0x1b399c[_0x4290('0x82')]());require(_0x4290('0x9e'))['fork'](path['join'](__dirname,'../../components/export/',_0x92ae30[_0x4290('0x8f')]),[_0x92ae30['id'],_0x1b399c[_0x4290('0x82')](),path[_0x4290('0x53')](__dirname,_0x4290('0x9f'),_0x92ae30[_0x4290('0xa0')]),_0x3bf5c0]);return _0x92ae30;}else{var _0x1a1c64=squel[_0x4290('0x6f')]();_0x1a1c64[_0x4290('0x70')]('('+_0x1b399c['toString']()+')',_0x4290('0xa1'));_0x1a1c64[_0x4290('0x68')]('COUNT(*)','count');_0x1b399c[_0x4290('0x1c')](_0x29074d[_0x4290('0x1c')]||_0x17b73e);_0x1b399c[_0x4290('0x1b')](_0x29074d[_0x4290('0x1b')]||0x0);return dbH[_0x4290('0x83')][_0x4290('0x32')](_0x1a1c64[_0x4290('0x82')](),{'type':dbH[_0x4290('0x83')][_0x4290('0x84')]['SELECT']})[_0x4290('0x21')](function(_0x5bc477){if(!_0x5bc477[_0x4290('0x66')]){_0x377885=0x0;}else{_0x377885=_0x5bc477[0x0]['count']||0x0;}return dbH[_0x4290('0x83')][_0x4290('0x32')](_0x1b399c[_0x4290('0x82')](),{'type':dbH[_0x4290('0x83')][_0x4290('0x84')]['SELECT']});})[_0x4290('0x21')](function(_0x587763){return{'rows':_0x587763||[],'count':_0x377885};});}});}exports[_0x4290('0xa2')]=function(_0x1e7a8e,_0x348076){return runReport(_0x1e7a8e['params'],_0x1e7a8e[_0x4290('0x32')],_0x1e7a8e[_0x4290('0x40')])[_0x4290('0x21')](respondWithResult(_0x348076,null))[_0x4290('0x45')](handleError(_0x348076,null));};exports[_0x4290('0xa3')]=runReport;exports[_0x4290('0x32')]=function(_0x2c110f,_0x400f89){var _0x1bbcef=0xa;var _0x4796cb=[_0x4290('0x53'),_0x4290('0x54'),'right_join',_0x4290('0x55')];var _0x78bdb5={'SUM':_0x4290('0x56'),'COUNT':_0x4290('0x87'),'COUNT DISTINCT':_0x4290('0x57'),'MAX':_0x4290('0x58'),'MIN':_0x4290('0x59'),'AVG':_0x4290('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4290('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2d92fc={'SEC_TO_TIME':_0x4290('0x89'),'DATE':_0x4290('0x5d'),'HOUR':_0x4290('0x5e'),'ROUND':_0x4290('0x5f'),'UNIX_TIMESTAMP':_0x4290('0x60')};var _0x17f3bf=function(_0x44291b){return!_[_0x4290('0x61')]([_0x4290('0x62'),_0x4290('0x63'),_0x4290('0x64'),'IS\x20NOT\x20EMPTY'],_0x44291b);};var _0x4a32a8=function(_0xf9aeb5){if(!_0xf9aeb5||!_0xf9aeb5[_0x4290('0x65')]['length']){return'';}for(var _0x5e0e98='(',_0x196692=0x0;_0x196692<_0xf9aeb5[_0x4290('0x65')][_0x4290('0x66')];_0x196692+=0x1){_0x196692>0x0&&(_0x5e0e98+='\x20'+_0xf9aeb5[_0x4290('0x8a')]+'\x20');_0x5e0e98+=_0xf9aeb5[_0x4290('0x65')][_0x196692][_0x4290('0x67')]?_0x4a32a8(_0xf9aeb5[_0x4290('0x65')][_0x196692][_0x4290('0x67')]):_0xf9aeb5['rules'][_0x196692][_0x4290('0x68')]+'\x20'+_0xf9aeb5['rules'][_0x196692]['condition']+(_0x17f3bf(_0xf9aeb5['rules'][_0x196692][_0x4290('0x69')])?'\x20'+_0xf9aeb5[_0x4290('0x65')][_0x196692][_0x4290('0x6a')]:'');}return _0x5e0e98+')';};var _0x277747={'where':{'id':_0x2c110f[_0x4290('0x47')]['id']}},_0x1e0d9d,_0x87546c,_0x28332f,_0x527ba4,_0x21385b;_0x277747=_[_0x4290('0x3f')]({},_0x277747,_0x2c110f[_0x4290('0x40')]);return db['AnalyticCustomReport'][_0x4290('0x48')](_0x277747)[_0x4290('0x21')](function(_0x55234e){if(_0x55234e){_0x1e0d9d=_0x55234e;return _0x55234e[_0x4290('0x6b')]();}return null;})[_0x4290('0x21')](function(_0x2c1bee){if(_0x2c1bee){if(!_0x2c1bee[_0x4290('0x66')]){throw new db[(_0x4290('0x6c'))][(_0x4290('0x8b'))](_0x4290('0x8c'),0x193);}_0x87546c=_0x2c1bee;return db['AnalyticMetric'][_0x4290('0x43')]({'raw':!![]});}return null;})[_0x4290('0x21')](function(_0x48645b){if(_0x48645b){_0x28332f=_[_0x4290('0x6e')](_0x48645b,'id');var _0x193cb0;var _0xe0c564=squel[_0x4290('0x6f')]();_0xe0c564[_0x4290('0x70')](_0x1e0d9d[_0x4290('0x71')]);for(var _0x5e04c1=0x0;_0x5e04c1<_0x87546c[_0x4290('0x66')];_0x5e04c1+=0x1){_0x193cb0=_0x87546c[_0x5e04c1]['MetricId']?_0x28332f[_0x87546c[_0x5e04c1][_0x4290('0x72')]]['metric']:_0x87546c[_0x5e04c1][_0x4290('0x68')];_0x193cb0=_0x87546c[_0x5e04c1][_0x4290('0x74')]?_['replace'](_0x78bdb5[_0x87546c[_0x5e04c1][_0x4290('0x74')]],'%s',_0x193cb0):_0x193cb0;_0x193cb0=_0x87546c[_0x5e04c1]['format']?_[_0x4290('0x76')](_0x2d92fc[_0x87546c[_0x5e04c1][_0x4290('0x75')]],'%s',_0x193cb0):_0x193cb0;if(_0x87546c[_0x5e04c1][_0x4290('0x77')]){_0xe0c564[_0x4290('0x67')](_0x193cb0);}_0x87546c[_0x5e04c1]['orderBy']&&_0xe0c564[_0x4290('0x3a')](_0x193cb0,_0x87546c[_0x5e04c1]['orderBy']===_0x4290('0x79')?![]:!![]);_0xe0c564[_0x4290('0x68')](_0x193cb0,_0x87546c[_0x5e04c1][_0x4290('0x7a')]||_0x193cb0);}if(_0x1e0d9d[_0x4290('0x7b')]){_0x1e0d9d[_0x4290('0x7b')]=JSON['parse'](_0x1e0d9d[_0x4290('0x7b')]);for(var _0xf53208=0x0;_0xf53208<_0x1e0d9d['joins'][_0x4290('0x66')];_0xf53208+=0x1){if(_0x1e0d9d[_0x4290('0x7b')][_0xf53208]['type']&&_[_0x4290('0x61')](_0x4796cb,_0x1e0d9d[_0x4290('0x7b')][_0xf53208][_0x4290('0x2f')])&&_0x1e0d9d['joins'][_0xf53208][_0x4290('0x7d')]&&_0x1e0d9d[_0x4290('0x7b')][_0xf53208][_0x4290('0x7e')]&&_0x1e0d9d[_0x4290('0x7b')][_0xf53208][_0x4290('0x7f')]){_0xe0c564[_0x1e0d9d[_0x4290('0x7b')][_0xf53208][_0x4290('0x2f')]](_0x1e0d9d['joins'][_0xf53208][_0x4290('0x7e')],null,util[_0x4290('0x75')](_0x4290('0x8d'),_0x1e0d9d[_0x4290('0x71')],_0x1e0d9d[_0x4290('0x7b')][_0xf53208][_0x4290('0x7d')],_0x1e0d9d[_0x4290('0x7b')][_0xf53208][_0x4290('0x7e')],_0x1e0d9d[_0x4290('0x7b')][_0xf53208]['foreignKey']));}}}if(_0x1e0d9d[_0x4290('0x80')]){_0x1e0d9d['conditions']=JSON[_0x4290('0x7c')](_0x1e0d9d[_0x4290('0x80')]);_0xe0c564[_0x4290('0x3c')](_0x4a32a8(_0x1e0d9d['conditions'][_0x4290('0x67')]));}_0x21385b=_0xe0c564['clone']();_0xe0c564[_0x4290('0x1c')](_0x1bbcef);_0xe0c564[_0x4290('0x1b')](0x0);logger[_0x4290('0x8e')](_0x4290('0xa4'),_0xe0c564['toString']());return db[_0x4290('0x83')][_0x4290('0x32')](_0xe0c564[_0x4290('0x82')](),{'type':db['sequelize'][_0x4290('0x84')][_0x4290('0x85')]});}})[_0x4290('0x21')](function(){return{'sql':_0x21385b[_0x4290('0x82')]()};})[_0x4290('0x21')](respondWithResult(_0x400f89,null))['catch'](handleError(_0x400f89,null));};
\ No newline at end of file
+var _0x130d=['sendStatus','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','parentKey','conditions','clone','Limited\x20Query:','toString','QueryTypes','SELECT','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','IS\x20NULL','merge','ValidationErrorItem','select','%s.%s\x20=\x20%s.%s','debug','sequelize','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','run','options','runReport','cross_join','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','end'];(function(_0x287436,_0x2dc3ab){var _0x59190a=function(_0x36a225){while(--_0x36a225){_0x287436['push'](_0x287436['shift']());}};_0x59190a(++_0x2dc3ab);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd130('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd130('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd130('0x2'));var rp=require(_0xd130('0x3'));var moment=require(_0xd130('0x4'));var BPromise=require(_0xd130('0x5'));var Mustache=require(_0xd130('0x6'));var util=require(_0xd130('0x7'));var path=require(_0xd130('0x8'));var sox=require(_0xd130('0x9'));var csv=require(_0xd130('0xa'));var ejs=require(_0xd130('0xb'));var fs=require('fs');var _=require(_0xd130('0xc'));var squel=require(_0xd130('0xd'));var crypto=require(_0xd130('0xe'));var jsforce=require(_0xd130('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd130('0xa'));var querystring=require('querystring');var Papa=require(_0xd130('0x10'));var Redis=require(_0xd130('0x11'));var authService=require(_0xd130('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd130('0x13'));var hardwareService=require(_0xd130('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd130('0x15'));var config=require('../../config/environment');var db=require(_0xd130('0x16'))['db'];var dbH=require(_0xd130('0x16'))['dbH'];function respondWithStatusCode(_0x176cbf,_0x3ec517){_0x3ec517=_0x3ec517||0xcc;return function(_0xc035a){if(_0xc035a){return _0x176cbf['sendStatus'](_0x3ec517);}return _0x176cbf['status'](_0x3ec517)['end']();};}function respondWithResult(_0x1f56b7,_0x39a129){_0x39a129=_0x39a129||0xc8;return function(_0x13e06a){if(_0x13e06a){return _0x1f56b7[_0xd130('0x17')](_0x39a129)[_0xd130('0x18')](_0x13e06a);}};}function respondWithFilteredResult(_0x573e6b,_0x1239d7){return function(_0x3a59de){if(_0x3a59de){var _0x1f96e0=_0x3a59de[_0xd130('0x19')],_0x15bcac=_0x1239d7[_0xd130('0x1a')],_0x57930b=_0x1239d7[_0xd130('0x1a')]+_0x1239d7[_0xd130('0x1b')],_0x418890;if(_0x57930b>=_0x1f96e0){_0x57930b=_0x1f96e0;_0x418890=0xc8;}else{_0x418890=0xce;}_0x573e6b[_0xd130('0x17')](_0x418890);return _0x573e6b[_0xd130('0x1c')](_0xd130('0x1d'),_0x15bcac+'-'+_0x57930b+'/'+_0x1f96e0)['json'](_0x3a59de);}return null;};}function patchUpdates(_0x543144){return function(_0x5638c3){try{jsonpatch[_0xd130('0x1e')](_0x5638c3,_0x543144,!![]);}catch(_0x1fa466){return BPromise['reject'](_0x1fa466);}return _0x5638c3[_0xd130('0x1f')]();};}function saveUpdates(_0xcf5ce,_0x3c93d3){return function(_0x1d9cc8){if(_0x1d9cc8){return _0x1d9cc8[_0xd130('0x20')](_0xcf5ce)[_0xd130('0x21')](function(_0x4e5860){return _0x4e5860;});}return null;};}function removeEntity(_0x311c3a,_0x331b1a){return function(_0xbc75fa){if(_0xbc75fa){return _0xbc75fa[_0xd130('0x22')]()[_0xd130('0x21')](function(){var _0x159a02=_0xbc75fa[_0xd130('0x23')]({'plain':!![]});var _0x316540=_0xd130('0x24');return db[_0xd130('0x25')]['destroy']({'where':{'type':_0x316540,'resourceId':_0x159a02['id']}})[_0xd130('0x21')](function(){return _0xbc75fa;});})[_0xd130('0x21')](function(){_0x311c3a[_0xd130('0x17')](0xcc)[_0xd130('0x26')]();});}};}function handleEntityNotFound(_0x26dd6a,_0xf79e5c){return function(_0x51c187){if(!_0x51c187){_0x26dd6a[_0xd130('0x27')](0x194);}return _0x51c187;};}function handleError(_0x4eef42,_0x149e5a){_0x149e5a=_0x149e5a||0x1f4;return function(_0x4e2cb4){logger['error'](_0x4e2cb4['stack']);if(_0x4e2cb4[_0xd130('0x28')]){delete _0x4e2cb4[_0xd130('0x28')];}_0x4eef42[_0xd130('0x17')](_0x149e5a)[_0xd130('0x29')](_0x4e2cb4);};}exports['index']=function(_0x1d8d1c,_0x154eb6){var _0x28127d={},_0x562aef={},_0x84ae4b={'count':0x0,'rows':[]};var _0x4fee50=_[_0xd130('0x2a')](db['AnalyticCustomReport'][_0xd130('0x2b')],function(_0x19c180){return{'name':_0x19c180[_0xd130('0x2c')],'type':_0x19c180['type'][_0xd130('0x2d')]};});_0x562aef[_0xd130('0x2e')]=_[_0xd130('0x2a')](_0x4fee50,_0xd130('0x28'));_0x562aef[_0xd130('0x2f')]=_['keys'](_0x1d8d1c[_0xd130('0x2f')]);_0x562aef[_0xd130('0x30')]=_[_0xd130('0x31')](_0x562aef['model'],_0x562aef[_0xd130('0x2f')]);_0x28127d[_0xd130('0x32')]=_['intersection'](_0x562aef[_0xd130('0x2e')],qs[_0xd130('0x33')](_0x1d8d1c['query'][_0xd130('0x33')]));_0x28127d[_0xd130('0x32')]=_0x28127d[_0xd130('0x32')][_0xd130('0x34')]?_0x28127d[_0xd130('0x32')]:_0x562aef[_0xd130('0x2e')];if(!_0x1d8d1c['query'][_0xd130('0x35')](_0xd130('0x36'))){_0x28127d[_0xd130('0x1b')]=qs[_0xd130('0x1b')](_0x1d8d1c[_0xd130('0x2f')][_0xd130('0x1b')]);_0x28127d[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x1d8d1c[_0xd130('0x2f')]['offset']);}_0x28127d[_0xd130('0x37')]=qs[_0xd130('0x38')](_0x1d8d1c['query'][_0xd130('0x38')]);_0x28127d[_0xd130('0x39')]=qs[_0xd130('0x30')](_[_0xd130('0x3a')](_0x1d8d1c[_0xd130('0x2f')],_0x562aef['filters']),_0x4fee50);if(_0x1d8d1c[_0xd130('0x2f')][_0xd130('0x3b')]){_0x28127d[_0xd130('0x39')]=_['merge'](_0x28127d[_0xd130('0x39')],{'$or':_[_0xd130('0x2a')](_0x4fee50,function(_0x52e3b3){if(_0x52e3b3[_0xd130('0x3c')]!==_0xd130('0x3d')){var _0x2dbbd6={};_0x2dbbd6[_0x52e3b3[_0xd130('0x28')]]={'$like':'%'+_0x1d8d1c[_0xd130('0x2f')][_0xd130('0x3b')]+'%'};return _0x2dbbd6;}})});}_0x28127d=_['merge']({},_0x28127d,_0x1d8d1c['options']);var _0xae03e={'where':_0x28127d[_0xd130('0x39')]};return db[_0xd130('0x3e')]['count'](_0xae03e)['then'](function(_0x4d446a){_0x84ae4b['count']=_0x4d446a;if(_0x1d8d1c[_0xd130('0x2f')][_0xd130('0x3f')]){_0x28127d[_0xd130('0x40')]=[{'all':!![]}];}return db[_0xd130('0x3e')][_0xd130('0x41')](_0x28127d);})['then'](function(_0x36856b){_0x84ae4b[_0xd130('0x42')]=_0x36856b;return _0x84ae4b;})[_0xd130('0x21')](respondWithFilteredResult(_0x154eb6,_0x28127d))[_0xd130('0x43')](handleError(_0x154eb6,null));};exports[_0xd130('0x44')]=function(_0x10154a,_0x10bbd6){var _0x3d88dd={'raw':![],'where':{'id':_0x10154a[_0xd130('0x45')]['id']}},_0x4f8d4f={};_0x4f8d4f[_0xd130('0x2e')]=_['keys'](db[_0xd130('0x3e')]['rawAttributes']);_0x4f8d4f[_0xd130('0x2f')]=_[_0xd130('0x46')](_0x10154a['query']);_0x4f8d4f[_0xd130('0x30')]=_['intersection'](_0x4f8d4f[_0xd130('0x2e')],_0x4f8d4f[_0xd130('0x2f')]);_0x3d88dd[_0xd130('0x32')]=_[_0xd130('0x31')](_0x4f8d4f[_0xd130('0x2e')],qs[_0xd130('0x33')](_0x10154a[_0xd130('0x2f')][_0xd130('0x33')]));_0x3d88dd[_0xd130('0x32')]=_0x3d88dd[_0xd130('0x32')][_0xd130('0x34')]?_0x3d88dd[_0xd130('0x32')]:_0x4f8d4f[_0xd130('0x2e')];if(_0x10154a[_0xd130('0x2f')]['includeAll']){_0x3d88dd['include']=[{'all':!![]}];}_0x3d88dd=_['merge']({},_0x3d88dd,_0x10154a['options']);return db['AnalyticCustomReport']['find'](_0x3d88dd)['then'](handleEntityNotFound(_0x10bbd6,null))[_0xd130('0x21')](respondWithResult(_0x10bbd6,null))['catch'](handleError(_0x10bbd6,null));};exports['create']=function(_0x1ac59c,_0x5c0e12){return db['AnalyticCustomReport'][_0xd130('0x47')](_0x1ac59c[_0xd130('0x48')],{})[_0xd130('0x21')](function(_0x4e3bfa){var _0x7a23a9=_0x1ac59c[_0xd130('0x49')][_0xd130('0x23')]({'plain':!![]});if(!_0x7a23a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7a23a9[_0xd130('0x4a')]==='user'){var _0x4622f2=_0x4e3bfa[_0xd130('0x23')]({'plain':!![]});var _0x554f62='Reports';return db[_0xd130('0x4b')][_0xd130('0x4c')]({'where':{'name':_0x554f62,'userProfileId':_0x7a23a9[_0xd130('0x4d')]},'raw':!![]})[_0xd130('0x21')](function(_0x54f406){if(_0x54f406&&_0x54f406[_0xd130('0x4e')]===0x0){return db[_0xd130('0x25')][_0xd130('0x47')]({'name':_0x4622f2['name'],'resourceId':_0x4622f2['id'],'type':_0xd130('0x24'),'sectionId':_0x54f406['id']},{})[_0xd130('0x21')](function(){return _0x4e3bfa;});}else{return _0x4e3bfa;}})[_0xd130('0x43')](function(_0x5ba415){logger[_0xd130('0x4f')](_0xd130('0x50'),_0x5ba415);throw _0x5ba415;});}return _0x4e3bfa;})[_0xd130('0x21')](respondWithResult(_0x5c0e12,0xc9))['catch'](handleError(_0x5c0e12,null));};exports[_0xd130('0x20')]=function(_0x395ffd,_0x4e7187){if(_0x395ffd['body']['id']){delete _0x395ffd[_0xd130('0x48')]['id'];}return db[_0xd130('0x3e')][_0xd130('0x4c')]({'where':{'id':_0x395ffd[_0xd130('0x45')]['id']}})[_0xd130('0x21')](handleEntityNotFound(_0x4e7187,null))[_0xd130('0x21')](saveUpdates(_0x395ffd[_0xd130('0x48')],null))['then'](respondWithResult(_0x4e7187,null))[_0xd130('0x43')](handleError(_0x4e7187,null));};exports['destroy']=function(_0x19de3e,_0x1c3f82){return db[_0xd130('0x3e')]['find']({'where':{'id':_0x19de3e[_0xd130('0x45')]['id']}})[_0xd130('0x21')](handleEntityNotFound(_0x1c3f82,null))[_0xd130('0x21')](removeEntity(_0x1c3f82,null))[_0xd130('0x43')](handleError(_0x1c3f82,null));};exports['preview']=function(_0x46bfb6,_0x94554e){var _0x20f135=0xa;var _0x176f4a=[_0xd130('0x51'),_0xd130('0x52'),_0xd130('0x53'),'cross_join'];var _0x35ecec={'SUM':_0xd130('0x54'),'COUNT':_0xd130('0x55'),'COUNT DISTINCT':_0xd130('0x56'),'MAX':_0xd130('0x57'),'MIN':_0xd130('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd130('0x59'),'GROUP_CONCAT DESC':_0xd130('0x5a')};var _0x4f122e={'SEC_TO_TIME':_0xd130('0x5b'),'DATE':_0xd130('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xd130('0x5d'),'UNIX_TIMESTAMP':_0xd130('0x5e')};var _0x30edda=function(_0x3d563a){return!_[_0xd130('0x5f')](['IS\x20NULL',_0xd130('0x60'),_0xd130('0x61'),_0xd130('0x62')],_0x3d563a);};var _0x4c4fb=function(_0x57a594){if(!_0x57a594||!_0x57a594[_0xd130('0x63')][_0xd130('0x34')]){return'';}for(var _0x3711b0='(',_0x291f40=0x0;_0x291f40<_0x57a594[_0xd130('0x63')][_0xd130('0x34')];_0x291f40+=0x1){_0x291f40>0x0&&(_0x3711b0+='\x20'+_0x57a594[_0xd130('0x64')]+'\x20');_0x3711b0+=_0x57a594[_0xd130('0x63')][_0x291f40]['group']?_0x4c4fb(_0x57a594[_0xd130('0x63')][_0x291f40][_0xd130('0x65')]):_0x57a594[_0xd130('0x63')][_0x291f40][_0xd130('0x66')]+'\x20'+_0x57a594[_0xd130('0x63')][_0x291f40][_0xd130('0x67')]+(_0x30edda(_0x57a594[_0xd130('0x63')][_0x291f40][_0xd130('0x67')])?'\x20'+_0x57a594[_0xd130('0x63')][_0x291f40][_0xd130('0x68')]:'');}return _0x3711b0+')';};var _0xffdc9d={'where':{'id':_0x46bfb6[_0xd130('0x45')]['id']}},_0x289dde,_0x2f68b1,_0x19a1d5,_0x236d1c,_0x2244b2;_0xffdc9d=_['merge']({},_0xffdc9d,_0x46bfb6['options']);return db[_0xd130('0x3e')]['find'](_0xffdc9d)[_0xd130('0x21')](function(_0x3db45c){if(_0x3db45c){_0x289dde=_0x3db45c;return _0x3db45c[_0xd130('0x69')]();}return null;})['then'](function(_0x56b3ba){if(_0x56b3ba){if(!_0x56b3ba['length']){throw new db[(_0xd130('0x6a'))]['ValidationErrorItem'](_0xd130('0x6b'),0x193);}_0x2f68b1=_0x56b3ba;return db[_0xd130('0x6c')][_0xd130('0x41')]({'raw':!![]});}return null;})[_0xd130('0x21')](function(_0x2655b8){if(_0x2655b8){_0x19a1d5=_[_0xd130('0x6d')](_0x2655b8,'id');var _0x3b5d95;var _0x7f2d1f=squel['select']();_0x7f2d1f[_0xd130('0x6e')](_0x289dde[_0xd130('0x6f')]);for(var _0x5e7be3=0x0;_0x5e7be3<_0x2f68b1[_0xd130('0x34')];_0x5e7be3+=0x1){_0x3b5d95=_0x2f68b1[_0x5e7be3][_0xd130('0x70')]?_0x19a1d5[_0x2f68b1[_0x5e7be3][_0xd130('0x70')]][_0xd130('0x71')]:_0x2f68b1[_0x5e7be3][_0xd130('0x66')];_0x3b5d95=_0x2f68b1[_0x5e7be3][_0xd130('0x72')]?_[_0xd130('0x73')](_0x35ecec[_0x2f68b1[_0x5e7be3]['function']],'%s',_0x3b5d95):_0x3b5d95;_0x3b5d95=_0x2f68b1[_0x5e7be3][_0xd130('0x74')]?_['replace'](_0x4f122e[_0x2f68b1[_0x5e7be3][_0xd130('0x74')]],'%s',_0x3b5d95):_0x3b5d95;if(_0x2f68b1[_0x5e7be3][_0xd130('0x75')]){_0x7f2d1f[_0xd130('0x65')](_0x3b5d95);}_0x2f68b1[_0x5e7be3][_0xd130('0x76')]&&_0x7f2d1f[_0xd130('0x37')](_0x3b5d95,_0x2f68b1[_0x5e7be3][_0xd130('0x76')]===_0xd130('0x77')?![]:!![]);_0x7f2d1f['field'](_0x3b5d95,_0x2f68b1[_0x5e7be3][_0xd130('0x78')]||_0x3b5d95);}if(_0x289dde[_0xd130('0x79')]){_0x289dde[_0xd130('0x79')]=JSON[_0xd130('0x7a')](_0x289dde[_0xd130('0x79')]);for(var _0x139e1d=0x0;_0x139e1d<_0x289dde[_0xd130('0x79')][_0xd130('0x34')];_0x139e1d+=0x1){if(_0x289dde['joins'][_0x139e1d][_0xd130('0x3c')]&&_['includes'](_0x176f4a,_0x289dde[_0xd130('0x79')][_0x139e1d][_0xd130('0x3c')])&&_0x289dde[_0xd130('0x79')][_0x139e1d]['parentKey']&&_0x289dde[_0xd130('0x79')][_0x139e1d][_0xd130('0x7b')]&&_0x289dde['joins'][_0x139e1d][_0xd130('0x7c')]){_0x7f2d1f[_0x289dde[_0xd130('0x79')][_0x139e1d][_0xd130('0x3c')]](_0x289dde[_0xd130('0x79')][_0x139e1d][_0xd130('0x7b')],null,util[_0xd130('0x74')]('%s.%s\x20=\x20%s.%s',_0x289dde[_0xd130('0x6f')],_0x289dde[_0xd130('0x79')][_0x139e1d][_0xd130('0x7d')],_0x289dde[_0xd130('0x79')][_0x139e1d][_0xd130('0x7b')],_0x289dde[_0xd130('0x79')][_0x139e1d][_0xd130('0x7c')]));}}}if(_0x289dde['conditions']){_0x289dde[_0xd130('0x7e')]=JSON[_0xd130('0x7a')](_0x289dde[_0xd130('0x7e')]);_0x7f2d1f[_0xd130('0x39')](_0x4c4fb(_0x289dde[_0xd130('0x7e')][_0xd130('0x65')]));}_0x2244b2=_0x7f2d1f[_0xd130('0x7f')]();_0x7f2d1f['limit'](_0x20f135);_0x7f2d1f[_0xd130('0x1a')](0x0);logger['debug'](_0xd130('0x80'),_0x7f2d1f[_0xd130('0x81')]());return db['sequelize'][_0xd130('0x2f')](_0x7f2d1f[_0xd130('0x81')](),{'type':db['sequelize'][_0xd130('0x82')][_0xd130('0x83')]});}})[_0xd130('0x21')](respondWithResult(_0x94554e,null))[_0xd130('0x43')](handleError(_0x94554e,null));};function runReport(_0xf6eab9,_0x923946,_0x24ad53){var _0x2e69e0=_0x923946[_0xd130('0x28')];var _0xf872f6=0xa;var _0x24877b=[_0xd130('0x51'),_0xd130('0x52'),'right_join','cross_join'];var _0x329196={'SUM':_0xd130('0x54'),'COUNT':_0xd130('0x55'),'COUNT DISTINCT':_0xd130('0x56'),'MAX':'MAX(%s)','MIN':_0xd130('0x58'),'AVG':_0xd130('0x84'),'GROUP_CONCAT':_0xd130('0x85'),'GROUP_CONCAT ASC':_0xd130('0x59'),'GROUP_CONCAT DESC':_0xd130('0x5a')};var _0x3c2f5e={'SEC_TO_TIME':_0xd130('0x5b'),'DATE':_0xd130('0x5c'),'HOUR':_0xd130('0x86'),'ROUND':_0xd130('0x5d'),'UNIX_TIMESTAMP':_0xd130('0x5e')};var _0x40d778=function(_0x2ddcfa){return!_[_0xd130('0x5f')]([_0xd130('0x87'),_0xd130('0x60'),_0xd130('0x61'),_0xd130('0x62')],_0x2ddcfa);};var _0x22959b=function(_0x513c3f){if(!_0x513c3f||!_0x513c3f[_0xd130('0x63')]['length']){return'';}for(var _0x5fb166='(',_0x5729c=0x0;_0x5729c<_0x513c3f[_0xd130('0x63')][_0xd130('0x34')];_0x5729c+=0x1){_0x5729c>0x0&&(_0x5fb166+='\x20'+_0x513c3f[_0xd130('0x64')]+'\x20');_0x5fb166+=_0x513c3f[_0xd130('0x63')][_0x5729c][_0xd130('0x65')]?_0x22959b(_0x513c3f[_0xd130('0x63')][_0x5729c][_0xd130('0x65')]):_0x513c3f[_0xd130('0x63')][_0x5729c][_0xd130('0x66')]+'\x20'+_0x513c3f[_0xd130('0x63')][_0x5729c][_0xd130('0x67')]+(_0x40d778(_0x513c3f[_0xd130('0x63')][_0x5729c]['condition'])?'\x20'+_0x513c3f[_0xd130('0x63')][_0x5729c][_0xd130('0x68')]:'');}return _0x5fb166+')';};var _0x3df558={'where':{'id':_0xf6eab9['id']}},_0x143f0c,_0x262114,_0x212d8e,_0x29d8dc,_0x8fb916;_0x3df558=_[_0xd130('0x88')]({},_0x3df558,_0x24ad53);return db[_0xd130('0x3e')][_0xd130('0x4c')](_0x3df558)['then'](function(_0x275ce8){if(_0x275ce8){_0x143f0c=_0x275ce8;return _0x275ce8[_0xd130('0x69')]();}return null;})[_0xd130('0x21')](function(_0x2a97bd){if(_0x2a97bd){if(!_0x2a97bd[_0xd130('0x34')]){throw new db['Sequelize'][(_0xd130('0x89'))](_0xd130('0x6b'),0x193);}_0x262114=_0x2a97bd;return db[_0xd130('0x6c')][_0xd130('0x41')]({'raw':!![]});}return null;})[_0xd130('0x21')](function(_0x705f25){if(_0x705f25){_0x212d8e=_['keyBy'](_0x705f25,'id');var _0x5d3d13;var _0x14e718=squel[_0xd130('0x8a')]();_0x14e718[_0xd130('0x6e')](_0x143f0c[_0xd130('0x6f')]);for(var _0x33cb7a=0x0;_0x33cb7a<_0x262114['length'];_0x33cb7a+=0x1){_0x5d3d13=_0x262114[_0x33cb7a]['MetricId']?_0x212d8e[_0x262114[_0x33cb7a][_0xd130('0x70')]][_0xd130('0x71')]:_0x262114[_0x33cb7a][_0xd130('0x66')];_0x5d3d13=_0x262114[_0x33cb7a][_0xd130('0x72')]?_[_0xd130('0x73')](_0x329196[_0x262114[_0x33cb7a][_0xd130('0x72')]],'%s',_0x5d3d13):_0x5d3d13;_0x5d3d13=_0x262114[_0x33cb7a][_0xd130('0x74')]?_[_0xd130('0x73')](_0x3c2f5e[_0x262114[_0x33cb7a][_0xd130('0x74')]],'%s',_0x5d3d13):_0x5d3d13;if(_0x262114[_0x33cb7a]['groupBy']){_0x14e718[_0xd130('0x65')](_0x5d3d13);}_0x262114[_0x33cb7a][_0xd130('0x76')]&&_0x14e718[_0xd130('0x37')](_0x5d3d13,_0x262114[_0x33cb7a]['orderBy']===_0xd130('0x77')?![]:!![]);_0x14e718[_0xd130('0x66')](_0x5d3d13,_0x262114[_0x33cb7a][_0xd130('0x78')]||_0x5d3d13);}if(_0x143f0c['joins']){_0x143f0c[_0xd130('0x79')]=JSON[_0xd130('0x7a')](_0x143f0c['joins']);for(var _0x578c05=0x0;_0x578c05<_0x143f0c['joins'][_0xd130('0x34')];_0x578c05+=0x1){if(_0x143f0c['joins'][_0x578c05][_0xd130('0x3c')]&&_[_0xd130('0x5f')](_0x24877b,_0x143f0c['joins'][_0x578c05][_0xd130('0x3c')])&&_0x143f0c[_0xd130('0x79')][_0x578c05][_0xd130('0x7d')]&&_0x143f0c[_0xd130('0x79')][_0x578c05]['foreignTable']&&_0x143f0c[_0xd130('0x79')][_0x578c05][_0xd130('0x7c')]){_0x14e718[_0x143f0c[_0xd130('0x79')][_0x578c05][_0xd130('0x3c')]](_0x143f0c[_0xd130('0x79')][_0x578c05]['foreignTable'],null,util[_0xd130('0x74')](_0xd130('0x8b'),_0x143f0c['table'],_0x143f0c['joins'][_0x578c05]['parentKey'],_0x143f0c[_0xd130('0x79')][_0x578c05]['foreignTable'],_0x143f0c[_0xd130('0x79')][_0x578c05]['foreignKey']));}}}if(_0x143f0c[_0xd130('0x7e')]){_0x143f0c[_0xd130('0x7e')]=JSON[_0xd130('0x7a')](_0x143f0c[_0xd130('0x7e')]);_0x14e718[_0xd130('0x39')](_0x22959b(_0x143f0c['conditions'][_0xd130('0x65')]));}_0x8fb916=_0x14e718[_0xd130('0x7f')]();_0x14e718[_0xd130('0x1b')](_0xf872f6);_0x14e718[_0xd130('0x1a')](0x0);logger[_0xd130('0x8c')]('Limited\x20Query:',_0x14e718[_0xd130('0x81')]());return db[_0xd130('0x8d')][_0xd130('0x2f')](_0x14e718[_0xd130('0x81')](),{'type':db['sequelize'][_0xd130('0x82')][_0xd130('0x83')]});}})['then'](function(_0x2f2852){if(!_0x2f2852[_0xd130('0x34')]){throw new db[(_0xd130('0x6a'))][(_0xd130('0x89'))](_0xd130('0x8e'),0xcc);}if(_0x923946[_0xd130('0x8f')]===_0xd130('0x90')){return null;}var _0x24f6dc=_[_0xd130('0x88')](_0x923946,{'name':_0x923946[_0xd130('0x91')]||_0x923946['name']||_0x143f0c[_0xd130('0x28')],'basename':_0x2e69e0,'savename':util[_0xd130('0x74')]('%s-%s.%s',_0x923946['name']||_0x143f0c[_0xd130('0x28')],require(_0xd130('0x92'))[_0xd130('0x93')](0x4),_0x923946['output']||_0xd130('0x94')),'reportId':_0x143f0c['id'],'reportType':_0xd130('0x95')});return db[_0xd130('0x96')][_0xd130('0x47')](_0x24f6dc,{'raw':!![]});})['then'](function(_0x5f2d66){if(_0x143f0c[_0xd130('0x6f')]===_0xd130('0x97')){_0x8fb916['where'](_0x143f0c[_0xd130('0x6f')]+_0xd130('0x98'),_0x923946[_0xd130('0x99')],_0x923946[_0xd130('0x9a')]);}else{_0x8fb916[_0xd130('0x39')](_0x143f0c[_0xd130('0x6f')]+_0xd130('0x9b'),_0x923946[_0xd130('0x99')],_0x923946[_0xd130('0x9a')]);}if(_0x5f2d66){logger['info'](_0xd130('0x9c'),_0x8fb916[_0xd130('0x81')]());require(_0xd130('0x9d'))['fork'](path[_0xd130('0x51')](__dirname,_0xd130('0x9e'),_0x5f2d66[_0xd130('0x8f')]),[_0x5f2d66['id'],_0x8fb916[_0xd130('0x81')](),path[_0xd130('0x51')](__dirname,_0xd130('0x9f'),_0x5f2d66[_0xd130('0xa0')]),_0x2e69e0]);return _0x5f2d66;}else{var _0x4fd511=squel[_0xd130('0x8a')]();_0x4fd511[_0xd130('0x6e')]('('+_0x8fb916['toString']()+')','countTable');_0x4fd511[_0xd130('0x66')](_0xd130('0xa1'),_0xd130('0x19'));_0x8fb916['limit'](_0x923946['limit']||_0xf872f6);_0x8fb916[_0xd130('0x1a')](_0x923946[_0xd130('0x1a')]||0x0);return dbH[_0xd130('0x8d')]['query'](_0x4fd511[_0xd130('0x81')](),{'type':dbH['sequelize'][_0xd130('0x82')]['SELECT']})['then'](function(_0x70adb0){if(!_0x70adb0['length']){_0x29d8dc=0x0;}else{_0x29d8dc=_0x70adb0[0x0][_0xd130('0x19')]||0x0;}return dbH['sequelize']['query'](_0x8fb916[_0xd130('0x81')](),{'type':dbH[_0xd130('0x8d')][_0xd130('0x82')]['SELECT']});})['then'](function(_0x1a06a7){return{'rows':_0x1a06a7||[],'count':_0x29d8dc};});}});}exports[_0xd130('0xa2')]=function(_0x5a33a0,_0x5962a4){return runReport(_0x5a33a0[_0xd130('0x45')],_0x5a33a0['query'],_0x5a33a0[_0xd130('0xa3')])['then'](respondWithResult(_0x5962a4,null))['catch'](handleError(_0x5962a4,null));};exports[_0xd130('0xa4')]=runReport;exports[_0xd130('0x2f')]=function(_0x18f4d2,_0x159c95){var _0x5699f3=0xa;var _0x228124=[_0xd130('0x51'),'left_join',_0xd130('0x53'),_0xd130('0xa5')];var _0x2aea92={'SUM':_0xd130('0x54'),'COUNT':_0xd130('0x55'),'COUNT DISTINCT':_0xd130('0x56'),'MAX':_0xd130('0x57'),'MIN':_0xd130('0x58'),'AVG':_0xd130('0x84'),'GROUP_CONCAT':_0xd130('0x85'),'GROUP_CONCAT ASC':_0xd130('0x59'),'GROUP_CONCAT DESC':_0xd130('0x5a')};var _0x345280={'SEC_TO_TIME':_0xd130('0x5b'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd130('0x5d'),'UNIX_TIMESTAMP':_0xd130('0x5e')};var _0x10d279=function(_0x59c917){return!_[_0xd130('0x5f')]([_0xd130('0x87'),_0xd130('0x60'),_0xd130('0x61'),_0xd130('0x62')],_0x59c917);};var _0x2ee05a=function(_0x10f70b){if(!_0x10f70b||!_0x10f70b[_0xd130('0x63')][_0xd130('0x34')]){return'';}for(var _0x43cd4a='(',_0x5904bd=0x0;_0x5904bd<_0x10f70b['rules'][_0xd130('0x34')];_0x5904bd+=0x1){_0x5904bd>0x0&&(_0x43cd4a+='\x20'+_0x10f70b[_0xd130('0x64')]+'\x20');_0x43cd4a+=_0x10f70b['rules'][_0x5904bd][_0xd130('0x65')]?_0x2ee05a(_0x10f70b[_0xd130('0x63')][_0x5904bd]['group']):_0x10f70b['rules'][_0x5904bd][_0xd130('0x66')]+'\x20'+_0x10f70b[_0xd130('0x63')][_0x5904bd][_0xd130('0x67')]+(_0x10d279(_0x10f70b[_0xd130('0x63')][_0x5904bd][_0xd130('0x67')])?'\x20'+_0x10f70b['rules'][_0x5904bd]['value']:'');}return _0x43cd4a+')';};var _0x41d4df={'where':{'id':_0x18f4d2[_0xd130('0x45')]['id']}},_0x4856ce,_0x1b9130,_0x26e27e,_0x472ff2,_0x41fc9d;_0x41d4df=_[_0xd130('0x88')]({},_0x41d4df,_0x18f4d2[_0xd130('0xa3')]);return db[_0xd130('0x3e')]['find'](_0x41d4df)[_0xd130('0x21')](function(_0x805cd1){if(_0x805cd1){_0x4856ce=_0x805cd1;return _0x805cd1[_0xd130('0x69')]();}return null;})[_0xd130('0x21')](function(_0x49a359){if(_0x49a359){if(!_0x49a359[_0xd130('0x34')]){throw new db[(_0xd130('0x6a'))][(_0xd130('0x89'))](_0xd130('0x6b'),0x193);}_0x1b9130=_0x49a359;return db[_0xd130('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4682ac){if(_0x4682ac){_0x26e27e=_[_0xd130('0x6d')](_0x4682ac,'id');var _0x23764b;var _0x347431=squel[_0xd130('0x8a')]();_0x347431[_0xd130('0x6e')](_0x4856ce[_0xd130('0x6f')]);for(var _0x333fc7=0x0;_0x333fc7<_0x1b9130[_0xd130('0x34')];_0x333fc7+=0x1){_0x23764b=_0x1b9130[_0x333fc7]['MetricId']?_0x26e27e[_0x1b9130[_0x333fc7][_0xd130('0x70')]][_0xd130('0x71')]:_0x1b9130[_0x333fc7][_0xd130('0x66')];_0x23764b=_0x1b9130[_0x333fc7][_0xd130('0x72')]?_[_0xd130('0x73')](_0x2aea92[_0x1b9130[_0x333fc7]['function']],'%s',_0x23764b):_0x23764b;_0x23764b=_0x1b9130[_0x333fc7][_0xd130('0x74')]?_['replace'](_0x345280[_0x1b9130[_0x333fc7][_0xd130('0x74')]],'%s',_0x23764b):_0x23764b;if(_0x1b9130[_0x333fc7]['groupBy']){_0x347431[_0xd130('0x65')](_0x23764b);}_0x1b9130[_0x333fc7][_0xd130('0x76')]&&_0x347431[_0xd130('0x37')](_0x23764b,_0x1b9130[_0x333fc7]['orderBy']==='DESC'?![]:!![]);_0x347431[_0xd130('0x66')](_0x23764b,_0x1b9130[_0x333fc7]['alias']||_0x23764b);}if(_0x4856ce[_0xd130('0x79')]){_0x4856ce[_0xd130('0x79')]=JSON[_0xd130('0x7a')](_0x4856ce[_0xd130('0x79')]);for(var _0x283b21=0x0;_0x283b21<_0x4856ce[_0xd130('0x79')][_0xd130('0x34')];_0x283b21+=0x1){if(_0x4856ce[_0xd130('0x79')][_0x283b21]['type']&&_[_0xd130('0x5f')](_0x228124,_0x4856ce[_0xd130('0x79')][_0x283b21][_0xd130('0x3c')])&&_0x4856ce[_0xd130('0x79')][_0x283b21][_0xd130('0x7d')]&&_0x4856ce[_0xd130('0x79')][_0x283b21]['foreignTable']&&_0x4856ce[_0xd130('0x79')][_0x283b21]['foreignKey']){_0x347431[_0x4856ce['joins'][_0x283b21][_0xd130('0x3c')]](_0x4856ce[_0xd130('0x79')][_0x283b21][_0xd130('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4856ce[_0xd130('0x6f')],_0x4856ce[_0xd130('0x79')][_0x283b21][_0xd130('0x7d')],_0x4856ce[_0xd130('0x79')][_0x283b21]['foreignTable'],_0x4856ce[_0xd130('0x79')][_0x283b21][_0xd130('0x7c')]));}}}if(_0x4856ce[_0xd130('0x7e')]){_0x4856ce[_0xd130('0x7e')]=JSON[_0xd130('0x7a')](_0x4856ce[_0xd130('0x7e')]);_0x347431['where'](_0x2ee05a(_0x4856ce[_0xd130('0x7e')][_0xd130('0x65')]));}_0x41fc9d=_0x347431[_0xd130('0x7f')]();_0x347431[_0xd130('0x1b')](_0x5699f3);_0x347431['offset'](0x0);logger['debug'](_0xd130('0x80'),_0x347431[_0xd130('0x81')]());return db[_0xd130('0x8d')]['query'](_0x347431[_0xd130('0x81')](),{'type':db['sequelize']['QueryTypes'][_0xd130('0x83')]});}})[_0xd130('0x21')](function(){return{'sql':_0x41fc9d[_0xd130('0x81')]()};})['then'](respondWithResult(_0x159c95,null))[_0xd130('0x43')](handleError(_0x159c95,null));};
\ No newline at end of file
index 3c77c63..27224bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64f5=['./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x582877,_0x40aa72){var _0x1b4d0e=function(_0x3f5d09){while(--_0x3f5d09){_0x582877['push'](_0x582877['shift']());}};_0x1b4d0e(++_0x40aa72);}(_0x64f5,0x19b));var _0x564f=function(_0x4f5505,_0x42812e){_0x4f5505=_0x4f5505-0x0;var _0x30bca0=_0x64f5[_0x4f5505];return _0x30bca0;};'use strict';var _=require('lodash');var util=require(_0x564f('0x0'));var logger=require(_0x564f('0x1'))(_0x564f('0x2'));var moment=require(_0x564f('0x3'));var BPromise=require(_0x564f('0x4'));var rp=require(_0x564f('0x5'));var fs=require('fs');var path=require(_0x564f('0x6'));var rimraf=require(_0x564f('0x7'));var config=require(_0x564f('0x8'));var attributes=require(_0x564f('0x9'));module[_0x564f('0xa')]=function(_0x4a23e0,_0x202369){return _0x4a23e0[_0x564f('0xb')](_0x564f('0xc'),attributes,{'tableName':_0x564f('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa3ac=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x5c0d82,_0x19f536){var _0x2d3f53=function(_0x9775ae){while(--_0x9775ae){_0x5c0d82['push'](_0x5c0d82['shift']());}};_0x2d3f53(++_0x19f536);}(_0xa3ac,0x13b));var _0xca3a=function(_0x16f287,_0x2da575){_0x16f287=_0x16f287-0x0;var _0x1919aa=_0xa3ac[_0x16f287];return _0x1919aa;};'use strict';var _=require(_0xca3a('0x0'));var util=require(_0xca3a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xca3a('0x2'));var BPromise=require(_0xca3a('0x3'));var rp=require(_0xca3a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca3a('0x5'));var config=require(_0xca3a('0x6'));var attributes=require(_0xca3a('0x7'));module[_0xca3a('0x8')]=function(_0x2efac2,_0x465239){return _0x2efac2[_0xca3a('0x9')](_0xca3a('0xa'),attributes,{'tableName':_0xca3a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e959c3f..7c6e514 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ecd=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','result','message','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent'];(function(_0x1359c9,_0x553c03){var _0x352cc3=function(_0x4cc25b){while(--_0x4cc25b){_0x1359c9['push'](_0x1359c9['shift']());}};_0x352cc3(++_0x553c03);}(_0x7ecd,0x121));var _0xd7ec=function(_0x6ef9eb,_0x17f4c2){_0x6ef9eb=_0x6ef9eb-0x0;var _0x3d1f4a=_0x7ecd[_0x6ef9eb];return _0x3d1f4a;};'use strict';var _=require('lodash');var util=require(_0xd7ec('0x0'));var moment=require(_0xd7ec('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7ec('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7ec('0x4'))(_0xd7ec('0x5'));var config=require(_0xd7ec('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7ec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2abbb7,_0x5d4f67,_0x3126d4){return new BPromise(function(_0xa62716,_0x24abe3){return client['request'](_0x2abbb7,_0x3126d4)[_0xd7ec('0x8')](function(_0x4d4efb){logger[_0xd7ec('0x9')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d4f67,_0xd7ec('0xa'));logger[_0xd7ec('0xb')](_0xd7ec('0xc'),_0x5d4f67,_0xd7ec('0xa'),JSON[_0xd7ec('0xd')](_0x4d4efb));if(_0x4d4efb['error']){if(_0x4d4efb[_0xd7ec('0xe')][_0xd7ec('0xf')]===0x1f4){logger[_0xd7ec('0xe')](_0xd7ec('0x10'),_0x5d4f67,_0x4d4efb[_0xd7ec('0xe')]['message']);return _0x24abe3(_0x4d4efb[_0xd7ec('0xe')]['message']);}logger['error'](_0xd7ec('0x10'),_0x5d4f67,_0x4d4efb[_0xd7ec('0xe')]['message']);return _0xa62716(_0x4d4efb[_0xd7ec('0xe')]['message']);}else{logger[_0xd7ec('0x9')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d4f67,_0xd7ec('0xa'));_0xa62716(_0x4d4efb[_0xd7ec('0x11')][_0xd7ec('0x12')]);}})[_0xd7ec('0x13')](function(_0x3f58a8){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5d4f67,_0x3f58a8);_0x24abe3(_0x3f58a8);});});}
\ No newline at end of file
+var _0xd9bc=['moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1cca82,_0x5c2d29){var _0xe5527d=function(_0x308708){while(--_0x308708){_0x1cca82['push'](_0x1cca82['shift']());}};_0xe5527d(++_0x5c2d29);}(_0xd9bc,0x1a3));var _0xcd9b=function(_0x312883,_0x313fa4){_0x312883=_0x312883-0x0;var _0x2b6685=_0xd9bc[_0x312883];return _0x2b6685;};'use strict';var _=require(_0xcd9b('0x0'));var util=require('util');var moment=require(_0xcd9b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd9b('0x2'))['db'];var utils=require(_0xcd9b('0x3'));var logger=require(_0xcd9b('0x4'))('rpc');var config=require(_0xcd9b('0x5'));var jayson=require(_0xcd9b('0x6'));var client=jayson[_0xcd9b('0x7')][_0xcd9b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56cad8,_0xcb5bec,_0x14908d){return new BPromise(function(_0x13d98c,_0x552405){return client[_0xcd9b('0x9')](_0x56cad8,_0x14908d)[_0xcd9b('0xa')](function(_0x447140){logger[_0xcd9b('0xb')](_0xcd9b('0xc'),_0xcb5bec,_0xcd9b('0xd'));logger['debug'](_0xcd9b('0xe'),_0xcb5bec,_0xcd9b('0xd'),JSON[_0xcd9b('0xf')](_0x447140));if(_0x447140[_0xcd9b('0x10')]){if(_0x447140[_0xcd9b('0x10')][_0xcd9b('0x11')]===0x1f4){logger[_0xcd9b('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0xcb5bec,_0x447140['error'][_0xcd9b('0x12')]);return _0x552405(_0x447140[_0xcd9b('0x10')][_0xcd9b('0x12')]);}logger['error'](_0xcd9b('0xc'),_0xcb5bec,_0x447140[_0xcd9b('0x10')][_0xcd9b('0x12')]);return _0x13d98c(_0x447140['error'][_0xcd9b('0x12')]);}else{logger[_0xcd9b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0xcb5bec,'request\x20sent');_0x13d98c(_0x447140[_0xcd9b('0x13')]['message']);}})[_0xcd9b('0x14')](function(_0x3aaf8f){logger[_0xcd9b('0x10')](_0xcd9b('0xc'),_0xcb5bec,_0x3aaf8f);_0x552405(_0x3aaf8f);});});}
\ No newline at end of file
index 4d69999..f1e8853 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28d7=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28d7,0x118));var _0x728d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28d7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x728d('0x0'));var path=require(_0x728d('0x1'));var timeout=require(_0x728d('0x2'));var express=require(_0x728d('0x3'));var router=express[_0x728d('0x4')]();var auth=require(_0x728d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x728d('0x6'));router[_0x728d('0x7')]('/',auth[_0x728d('0x8')](),controller['index']);router[_0x728d('0x7')](_0x728d('0x9'),auth[_0x728d('0x8')](),controller[_0x728d('0xa')]);router['get']('/:id/preview',auth[_0x728d('0x8')](),controller[_0x728d('0xb')]);router[_0x728d('0x7')](_0x728d('0xc'),auth[_0x728d('0x8')](),controller[_0x728d('0xd')]);router['get'](_0x728d('0xe'),auth[_0x728d('0x8')](),controller[_0x728d('0xf')]);router[_0x728d('0x10')]('/',auth['isAuthenticated'](),controller[_0x728d('0x11')]);router[_0x728d('0x12')](_0x728d('0x9'),auth[_0x728d('0x8')](),controller[_0x728d('0x13')]);router[_0x728d('0x14')](_0x728d('0x9'),auth['isAuthenticated'](),controller[_0x728d('0x15')]);module[_0x728d('0x16')]=router;
\ No newline at end of file
+var _0x4ff1=['/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5974d0,_0x762561){var _0x48a5cd=function(_0x2ba5da){while(--_0x2ba5da){_0x5974d0['push'](_0x5974d0['shift']());}};_0x48a5cd(++_0x762561);}(_0x4ff1,0xf7));var _0x14ff=function(_0x12a612,_0x2a147e){_0x12a612=_0x12a612-0x0;var _0x20eea8=_0x4ff1[_0x12a612];return _0x20eea8;};'use strict';var multer=require(_0x14ff('0x0'));var util=require(_0x14ff('0x1'));var path=require('path');var timeout=require(_0x14ff('0x2'));var express=require(_0x14ff('0x3'));var router=express[_0x14ff('0x4')]();var auth=require(_0x14ff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x14ff('0x6'));var controller=require(_0x14ff('0x7'));router[_0x14ff('0x8')]('/',auth[_0x14ff('0x9')](),controller[_0x14ff('0xa')]);router['get'](_0x14ff('0xb'),auth['isAuthenticated'](),controller[_0x14ff('0xc')]);router[_0x14ff('0x8')](_0x14ff('0xd'),auth[_0x14ff('0x9')](),controller[_0x14ff('0xe')]);router['get'](_0x14ff('0xf'),auth[_0x14ff('0x9')](),controller[_0x14ff('0x10')]);router[_0x14ff('0x8')](_0x14ff('0x11'),auth['isAuthenticated'](),controller[_0x14ff('0x12')]);router[_0x14ff('0x13')]('/',auth['isAuthenticated'](),controller[_0x14ff('0x14')]);router[_0x14ff('0x15')]('/:id',auth[_0x14ff('0x9')](),controller[_0x14ff('0x16')]);router[_0x14ff('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x14ff('0x18')]);module[_0x14ff('0x19')]=router;
\ No newline at end of file
index c0265f0..1429965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4459=['TEXT','sequelize','STRING'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x4459,0x1c0));var _0x9445=function(_0x287c21,_0x1b7be5){_0x287c21=_0x287c21-0x0;var _0x145e31=_0x4459[_0x287c21];return _0x145e31;};'use strict';var Sequelize=require(_0x9445('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9445('0x1')]},'parent':{'type':Sequelize[_0x9445('0x1')]},'table':{'type':Sequelize[_0x9445('0x1')]},'conditions':{'type':Sequelize[_0x9445('0x2')]},'joins':{'type':Sequelize[_0x9445('0x2')]}};
\ No newline at end of file
+var _0x8f67=['TEXT','sequelize','exports','STRING'];(function(_0x1e69f7,_0x5499c0){var _0x35051d=function(_0x2ac6bb){while(--_0x2ac6bb){_0x1e69f7['push'](_0x1e69f7['shift']());}};_0x35051d(++_0x5499c0);}(_0x8f67,0xc9));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x78f6('0x0'));module[_0x78f6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x78f6('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x78f6('0x2')]},'conditions':{'type':Sequelize[_0x78f6('0x3')]},'joins':{'type':Sequelize[_0x78f6('0x3')]}};
\ No newline at end of file
index cd62c4b..8b9cef0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6c6=['savename','countTable','COUNT(*)','run','runReport','SUM(%s)','clone','debug','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','dbH','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','cross_join','ROUND(%s)','value','select','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','Run\x20Query:','child_process','fork'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xe6c6,0xaf));var _0x6e6c=function(_0x23c3a8,_0x3b3caf){_0x23c3a8=_0x23c3a8-0x0;var _0x58c843=_0xe6c6[_0x23c3a8];return _0x58c843;};'use strict';var pdf=require(_0x6e6c('0x0'));var emlformat=require(_0x6e6c('0x1'));var rimraf=require(_0x6e6c('0x2'));var zipdir=require(_0x6e6c('0x3'));var jsonpatch=require(_0x6e6c('0x4'));var rp=require(_0x6e6c('0x5'));var moment=require(_0x6e6c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6e6c('0x7'));var util=require(_0x6e6c('0x8'));var path=require(_0x6e6c('0x9'));var sox=require('sox');var csv=require(_0x6e6c('0xa'));var ejs=require(_0x6e6c('0xb'));var fs=require('fs');var _=require(_0x6e6c('0xc'));var squel=require('squel');var crypto=require(_0x6e6c('0xd'));var jsforce=require(_0x6e6c('0xe'));var deskjs=require(_0x6e6c('0xf'));var toCsv=require(_0x6e6c('0xa'));var querystring=require(_0x6e6c('0x10'));var Papa=require('papaparse');var Redis=require(_0x6e6c('0x11'));var authService=require(_0x6e6c('0x12'));var qs=require(_0x6e6c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e6c('0x14'));var logger=require('../../config/logger')(_0x6e6c('0x15'));var utils=require(_0x6e6c('0x16'));var config=require(_0x6e6c('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x6e6c('0x18')];function respondWithStatusCode(_0x2e04ab,_0x263828){_0x263828=_0x263828||0xcc;return function(_0x4a58){if(_0x4a58){return _0x2e04ab[_0x6e6c('0x19')](_0x263828);}return _0x2e04ab['status'](_0x263828)[_0x6e6c('0x1a')]();};}function respondWithResult(_0x356d8b,_0xad984c){_0xad984c=_0xad984c||0xc8;return function(_0x1531e1){if(_0x1531e1){return _0x356d8b[_0x6e6c('0x1b')](_0xad984c)[_0x6e6c('0x1c')](_0x1531e1);}};}function respondWithFilteredResult(_0x2de6bd,_0x463b73){return function(_0x44d4fb){if(_0x44d4fb){var _0x2a2037=_0x44d4fb[_0x6e6c('0x1d')],_0xe8251a=_0x463b73[_0x6e6c('0x1e')],_0x165af1=_0x463b73[_0x6e6c('0x1e')]+_0x463b73[_0x6e6c('0x1f')],_0x3487fb;if(_0x165af1>=_0x2a2037){_0x165af1=_0x2a2037;_0x3487fb=0xc8;}else{_0x3487fb=0xce;}_0x2de6bd[_0x6e6c('0x1b')](_0x3487fb);return _0x2de6bd[_0x6e6c('0x20')](_0x6e6c('0x21'),_0xe8251a+'-'+_0x165af1+'/'+_0x2a2037)[_0x6e6c('0x1c')](_0x44d4fb);}return null;};}function patchUpdates(_0x2cfd4b){return function(_0x1031fd){try{jsonpatch[_0x6e6c('0x22')](_0x1031fd,_0x2cfd4b,!![]);}catch(_0x13a301){return BPromise[_0x6e6c('0x23')](_0x13a301);}return _0x1031fd[_0x6e6c('0x24')]();};}function saveUpdates(_0x18ba35,_0x3c3fca){return function(_0x145277){if(_0x145277){return _0x145277[_0x6e6c('0x25')](_0x18ba35)['then'](function(_0x23fd09){return _0x23fd09;});}return null;};}function removeEntity(_0x5d93a5,_0x1d7591){return function(_0x4e2744){if(_0x4e2744){return _0x4e2744[_0x6e6c('0x26')]()[_0x6e6c('0x27')](function(){var _0x11bab9=_0x4e2744[_0x6e6c('0x28')]({'plain':!![]});var _0x3ad72f='DefaultReports';return db[_0x6e6c('0x29')][_0x6e6c('0x26')]({'where':{'type':_0x3ad72f,'resourceId':_0x11bab9['id']}})[_0x6e6c('0x27')](function(){return _0x4e2744;});})['then'](function(){_0x5d93a5[_0x6e6c('0x1b')](0xcc)[_0x6e6c('0x1a')]();});}};}function handleEntityNotFound(_0x3e0707,_0x40bffc){return function(_0x3ada21){if(!_0x3ada21){_0x3e0707['sendStatus'](0x194);}return _0x3ada21;};}function handleError(_0x53a8e5,_0x1b6635){_0x1b6635=_0x1b6635||0x1f4;return function(_0x4ba965){logger['error'](_0x4ba965[_0x6e6c('0x2a')]);if(_0x4ba965['name']){delete _0x4ba965[_0x6e6c('0x2b')];}_0x53a8e5[_0x6e6c('0x1b')](_0x1b6635)[_0x6e6c('0x2c')](_0x4ba965);};}exports[_0x6e6c('0x2d')]=function(_0x2bf1d0,_0x53321d){var _0x33d1d3={},_0x542817={},_0x384433={'count':0x0,'rows':[]};var _0x982b54=_[_0x6e6c('0x2e')](db[_0x6e6c('0x2f')][_0x6e6c('0x30')],function(_0xb068d8){return{'name':_0xb068d8[_0x6e6c('0x31')],'type':_0xb068d8[_0x6e6c('0x32')][_0x6e6c('0x33')]};});_0x542817[_0x6e6c('0x34')]=_['map'](_0x982b54,_0x6e6c('0x2b'));_0x542817[_0x6e6c('0x35')]=_[_0x6e6c('0x36')](_0x2bf1d0[_0x6e6c('0x35')]);_0x542817[_0x6e6c('0x37')]=_[_0x6e6c('0x38')](_0x542817[_0x6e6c('0x34')],_0x542817[_0x6e6c('0x35')]);_0x33d1d3['attributes']=_[_0x6e6c('0x38')](_0x542817[_0x6e6c('0x34')],qs[_0x6e6c('0x39')](_0x2bf1d0[_0x6e6c('0x35')]['fields']));_0x33d1d3[_0x6e6c('0x3a')]=_0x33d1d3[_0x6e6c('0x3a')][_0x6e6c('0x3b')]?_0x33d1d3[_0x6e6c('0x3a')]:_0x542817[_0x6e6c('0x34')];if(!_0x2bf1d0[_0x6e6c('0x35')][_0x6e6c('0x3c')](_0x6e6c('0x3d'))){_0x33d1d3['limit']=qs['limit'](_0x2bf1d0['query'][_0x6e6c('0x1f')]);_0x33d1d3[_0x6e6c('0x1e')]=qs[_0x6e6c('0x1e')](_0x2bf1d0[_0x6e6c('0x35')][_0x6e6c('0x1e')]);}_0x33d1d3[_0x6e6c('0x3e')]=qs[_0x6e6c('0x3f')](_0x2bf1d0[_0x6e6c('0x35')][_0x6e6c('0x3f')]);_0x33d1d3[_0x6e6c('0x40')]=qs[_0x6e6c('0x37')](_['pick'](_0x2bf1d0[_0x6e6c('0x35')],_0x542817[_0x6e6c('0x37')]),_0x982b54);if(_0x2bf1d0[_0x6e6c('0x35')]['filter']){_0x33d1d3[_0x6e6c('0x40')]=_['merge'](_0x33d1d3[_0x6e6c('0x40')],{'$or':_['map'](_0x982b54,function(_0x103e0f){if(_0x103e0f['type']!==_0x6e6c('0x41')){var _0x1f1585={};_0x1f1585[_0x103e0f['name']]={'$like':'%'+_0x2bf1d0[_0x6e6c('0x35')][_0x6e6c('0x42')]+'%'};return _0x1f1585;}})});}_0x33d1d3=_[_0x6e6c('0x43')]({},_0x33d1d3,_0x2bf1d0[_0x6e6c('0x44')]);var _0x411b2a={'where':_0x33d1d3[_0x6e6c('0x40')]};return db[_0x6e6c('0x2f')][_0x6e6c('0x1d')](_0x411b2a)[_0x6e6c('0x27')](function(_0x20e689){_0x384433[_0x6e6c('0x1d')]=_0x20e689;if(_0x2bf1d0[_0x6e6c('0x35')][_0x6e6c('0x45')]){_0x33d1d3['include']=[{'all':!![]}];}return db[_0x6e6c('0x2f')][_0x6e6c('0x46')](_0x33d1d3);})[_0x6e6c('0x27')](function(_0x1e39ab){_0x384433['rows']=_0x1e39ab;return _0x384433;})[_0x6e6c('0x27')](respondWithFilteredResult(_0x53321d,_0x33d1d3))[_0x6e6c('0x47')](handleError(_0x53321d,null));};exports['show']=function(_0x3d70b1,_0x2c5155){var _0x14d71b={'raw':!![],'where':{'id':_0x3d70b1[_0x6e6c('0x48')]['id']}},_0x3819b1={};_0x3819b1[_0x6e6c('0x34')]=_[_0x6e6c('0x36')](db[_0x6e6c('0x2f')]['rawAttributes']);_0x3819b1[_0x6e6c('0x35')]=_[_0x6e6c('0x36')](_0x3d70b1['query']);_0x3819b1[_0x6e6c('0x37')]=_[_0x6e6c('0x38')](_0x3819b1['model'],_0x3819b1[_0x6e6c('0x35')]);_0x14d71b[_0x6e6c('0x3a')]=_[_0x6e6c('0x38')](_0x3819b1[_0x6e6c('0x34')],qs['fields'](_0x3d70b1[_0x6e6c('0x35')][_0x6e6c('0x39')]));_0x14d71b[_0x6e6c('0x3a')]=_0x14d71b[_0x6e6c('0x3a')][_0x6e6c('0x3b')]?_0x14d71b['attributes']:_0x3819b1[_0x6e6c('0x34')];if(_0x3d70b1[_0x6e6c('0x35')]['includeAll']){_0x14d71b['include']=[{'all':!![]}];}_0x14d71b=_[_0x6e6c('0x43')]({},_0x14d71b,_0x3d70b1[_0x6e6c('0x44')]);return db['AnalyticDefaultReport'][_0x6e6c('0x49')](_0x14d71b)[_0x6e6c('0x27')](handleEntityNotFound(_0x2c5155,null))[_0x6e6c('0x27')](respondWithResult(_0x2c5155,null))['catch'](handleError(_0x2c5155,null));};exports[_0x6e6c('0x4a')]=function(_0x392bcf,_0x59cd10){return db[_0x6e6c('0x2f')]['create'](_0x392bcf[_0x6e6c('0x4b')],{})[_0x6e6c('0x27')](function(_0x520064){var _0x119ad3=_0x392bcf[_0x6e6c('0x4c')][_0x6e6c('0x28')]({'plain':!![]});if(!_0x119ad3)throw new Error(_0x6e6c('0x4d'));if(_0x119ad3['role']===_0x6e6c('0x4c')){var _0x26fee3=_0x520064[_0x6e6c('0x28')]({'plain':!![]});var _0x391ffa=_0x6e6c('0x4e');return db[_0x6e6c('0x4f')][_0x6e6c('0x49')]({'where':{'name':_0x391ffa,'userProfileId':_0x119ad3[_0x6e6c('0x50')]},'raw':!![]})['then'](function(_0x2f6aa5){if(_0x2f6aa5&&_0x2f6aa5[_0x6e6c('0x51')]===0x0){return db[_0x6e6c('0x29')][_0x6e6c('0x4a')]({'name':_0x26fee3[_0x6e6c('0x2b')],'resourceId':_0x26fee3['id'],'type':_0x6e6c('0x52'),'sectionId':_0x2f6aa5['id']},{})[_0x6e6c('0x27')](function(){return _0x520064;});}else{return _0x520064;}})['catch'](function(_0x4f58aa){logger['error'](_0x6e6c('0x53'),_0x4f58aa);throw _0x4f58aa;});}return _0x520064;})[_0x6e6c('0x27')](respondWithResult(_0x59cd10,0xc9))[_0x6e6c('0x47')](handleError(_0x59cd10,null));};exports[_0x6e6c('0x25')]=function(_0x2facc0,_0x2247b5){if(_0x2facc0['body']['id']){delete _0x2facc0[_0x6e6c('0x4b')]['id'];}return db[_0x6e6c('0x2f')]['find']({'where':{'id':_0x2facc0[_0x6e6c('0x48')]['id']}})[_0x6e6c('0x27')](handleEntityNotFound(_0x2247b5,null))['then'](saveUpdates(_0x2facc0[_0x6e6c('0x4b')],null))[_0x6e6c('0x27')](respondWithResult(_0x2247b5,null))[_0x6e6c('0x47')](handleError(_0x2247b5,null));};exports[_0x6e6c('0x26')]=function(_0x1dafe7,_0x301220){return db[_0x6e6c('0x2f')][_0x6e6c('0x49')]({'where':{'id':_0x1dafe7[_0x6e6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x301220,null))['then'](removeEntity(_0x301220,null))[_0x6e6c('0x47')](handleError(_0x301220,null));};exports[_0x6e6c('0x54')]=function(_0x326e6a,_0x3f2d5f){var _0x7abe5a=0xa;var _0x55b691=['join',_0x6e6c('0x55'),_0x6e6c('0x56'),'cross_join'];var _0x42015c={'SUM':'SUM(%s)','COUNT':_0x6e6c('0x57'),'COUNT DISTINCT':_0x6e6c('0x58'),'MAX':_0x6e6c('0x59'),'MIN':_0x6e6c('0x5a'),'AVG':_0x6e6c('0x5b'),'GROUP_CONCAT':_0x6e6c('0x5c'),'GROUP_CONCAT ASC':_0x6e6c('0x5d'),'GROUP_CONCAT DESC':_0x6e6c('0x5e')};var _0x1234ac={'SEC_TO_TIME':_0x6e6c('0x5f'),'DATE':_0x6e6c('0x60'),'HOUR':_0x6e6c('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6e6c('0x62')};var _0x548170=function(_0xe50a1c){return!_[_0x6e6c('0x63')]([_0x6e6c('0x64'),_0x6e6c('0x65'),_0x6e6c('0x66'),_0x6e6c('0x67')],_0xe50a1c);};var _0x40e503=function(_0x213dda){if(!_0x213dda||!_0x213dda[_0x6e6c('0x68')][_0x6e6c('0x3b')]){return'';}for(var _0x15cb5b='(',_0x4544f9=0x0;_0x4544f9<_0x213dda[_0x6e6c('0x68')]['length'];_0x4544f9+=0x1){_0x4544f9>0x0&&(_0x15cb5b+='\x20'+_0x213dda[_0x6e6c('0x69')]+'\x20');_0x15cb5b+=_0x213dda[_0x6e6c('0x68')][_0x4544f9][_0x6e6c('0x6a')]?_0x40e503(_0x213dda[_0x6e6c('0x68')][_0x4544f9][_0x6e6c('0x6a')]):_0x213dda[_0x6e6c('0x68')][_0x4544f9][_0x6e6c('0x6b')]+'\x20'+_0x213dda[_0x6e6c('0x68')][_0x4544f9]['condition']+(_0x548170(_0x213dda[_0x6e6c('0x68')][_0x4544f9][_0x6e6c('0x6c')])?'\x20'+_0x213dda[_0x6e6c('0x68')][_0x4544f9]['value']:'');}return _0x15cb5b+')';};var _0xeebde={'where':{'id':_0x326e6a[_0x6e6c('0x48')]['id']}},_0x583be6,_0x23aaa9,_0x51fa0c,_0x5114b5,_0x39e058;_0xeebde=_[_0x6e6c('0x43')]({},_0xeebde,_0x326e6a[_0x6e6c('0x44')]);return db[_0x6e6c('0x2f')]['find'](_0xeebde)['then'](function(_0x28a000){if(_0x28a000){_0x583be6=_0x28a000;return _0x28a000[_0x6e6c('0x6d')]();}return null;})['then'](function(_0x3ed74f){if(_0x3ed74f){if(!_0x3ed74f['length']){throw new db[(_0x6e6c('0x6e'))][(_0x6e6c('0x6f'))](_0x6e6c('0x70'),0x193);}_0x23aaa9=_0x3ed74f;return db[_0x6e6c('0x71')][_0x6e6c('0x46')]({'raw':!![]});}return null;})[_0x6e6c('0x27')](function(_0x1fb590){if(_0x1fb590){_0x51fa0c=_[_0x6e6c('0x72')](_0x1fb590,'id');var _0x5ac523;var _0x3ebfa3=squel['select']();_0x3ebfa3[_0x6e6c('0x73')](_0x583be6[_0x6e6c('0x74')]);for(var _0x185b60=0x0;_0x185b60<_0x23aaa9[_0x6e6c('0x3b')];_0x185b60+=0x1){_0x5ac523=_0x23aaa9[_0x185b60][_0x6e6c('0x75')]?_0x51fa0c[_0x23aaa9[_0x185b60]['MetricId']][_0x6e6c('0x76')]:_0x23aaa9[_0x185b60][_0x6e6c('0x6b')];_0x5ac523=_0x23aaa9[_0x185b60][_0x6e6c('0x77')]?_['replace'](_0x42015c[_0x23aaa9[_0x185b60][_0x6e6c('0x77')]],'%s',_0x5ac523):_0x5ac523;_0x5ac523=_0x23aaa9[_0x185b60]['format']?_[_0x6e6c('0x78')](_0x1234ac[_0x23aaa9[_0x185b60][_0x6e6c('0x79')]],'%s',_0x5ac523):_0x5ac523;if(_0x23aaa9[_0x185b60][_0x6e6c('0x7a')]){_0x3ebfa3[_0x6e6c('0x6a')](_0x5ac523);}_0x23aaa9[_0x185b60][_0x6e6c('0x7b')]&&_0x3ebfa3['order'](_0x5ac523,_0x23aaa9[_0x185b60][_0x6e6c('0x7b')]===_0x6e6c('0x7c')?![]:!![]);_0x3ebfa3[_0x6e6c('0x6b')](_0x5ac523,_0x23aaa9[_0x185b60][_0x6e6c('0x7d')]||_0x5ac523);}if(_0x583be6[_0x6e6c('0x7e')]){_0x583be6['joins']=JSON[_0x6e6c('0x7f')](_0x583be6[_0x6e6c('0x7e')]);for(var _0x5bf47a=0x0;_0x5bf47a<_0x583be6['joins']['length'];_0x5bf47a+=0x1){if(_0x583be6[_0x6e6c('0x7e')][_0x5bf47a]['type']&&_[_0x6e6c('0x63')](_0x55b691,_0x583be6[_0x6e6c('0x7e')][_0x5bf47a][_0x6e6c('0x32')])&&_0x583be6[_0x6e6c('0x7e')][_0x5bf47a][_0x6e6c('0x80')]&&_0x583be6[_0x6e6c('0x7e')][_0x5bf47a][_0x6e6c('0x81')]&&_0x583be6[_0x6e6c('0x7e')][_0x5bf47a][_0x6e6c('0x82')]){_0x3ebfa3[_0x583be6[_0x6e6c('0x7e')][_0x5bf47a][_0x6e6c('0x32')]](_0x583be6['joins'][_0x5bf47a][_0x6e6c('0x81')],null,util[_0x6e6c('0x79')](_0x6e6c('0x83'),_0x583be6[_0x6e6c('0x74')],_0x583be6['joins'][_0x5bf47a][_0x6e6c('0x80')],_0x583be6[_0x6e6c('0x7e')][_0x5bf47a][_0x6e6c('0x81')],_0x583be6[_0x6e6c('0x7e')][_0x5bf47a][_0x6e6c('0x82')]));}}}if(_0x583be6['conditions']){_0x583be6[_0x6e6c('0x84')]=JSON[_0x6e6c('0x7f')](_0x583be6[_0x6e6c('0x84')]);_0x3ebfa3[_0x6e6c('0x40')](_0x40e503(_0x583be6[_0x6e6c('0x84')][_0x6e6c('0x6a')]));}_0x39e058=_0x3ebfa3['clone']();_0x3ebfa3[_0x6e6c('0x1f')](_0x7abe5a);_0x3ebfa3[_0x6e6c('0x1e')](0x0);logger['debug'](_0x6e6c('0x85'),_0x3ebfa3[_0x6e6c('0x86')]());return db[_0x6e6c('0x87')][_0x6e6c('0x35')](_0x3ebfa3[_0x6e6c('0x86')](),{'type':db[_0x6e6c('0x87')][_0x6e6c('0x88')][_0x6e6c('0x89')]});}})[_0x6e6c('0x27')](respondWithResult(_0x3f2d5f,null))[_0x6e6c('0x47')](handleError(_0x3f2d5f,null));};function runReport(_0x124160,_0x520846,_0x37362a){var _0x17f369=_0x520846[_0x6e6c('0x2b')];var _0x3931dc=0xa;var _0x2182b5=[_0x6e6c('0x8a'),_0x6e6c('0x55'),_0x6e6c('0x56'),_0x6e6c('0x8b')];var _0x462b68={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6e6c('0x58'),'MAX':'MAX(%s)','MIN':_0x6e6c('0x5a'),'AVG':_0x6e6c('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6e6c('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5af175={'SEC_TO_TIME':_0x6e6c('0x5f'),'DATE':_0x6e6c('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x6e6c('0x8c'),'UNIX_TIMESTAMP':_0x6e6c('0x62')};var _0x17aa9c=function(_0x1fdfab){return!_[_0x6e6c('0x63')]([_0x6e6c('0x64'),_0x6e6c('0x65'),'IS\x20EMPTY',_0x6e6c('0x67')],_0x1fdfab);};var _0x3997f6=function(_0x43b218){if(!_0x43b218||!_0x43b218[_0x6e6c('0x68')]['length']){return'';}for(var _0x29f0f3='(',_0x2c1e7d=0x0;_0x2c1e7d<_0x43b218[_0x6e6c('0x68')][_0x6e6c('0x3b')];_0x2c1e7d+=0x1){_0x2c1e7d>0x0&&(_0x29f0f3+='\x20'+_0x43b218[_0x6e6c('0x69')]+'\x20');_0x29f0f3+=_0x43b218[_0x6e6c('0x68')][_0x2c1e7d][_0x6e6c('0x6a')]?_0x3997f6(_0x43b218['rules'][_0x2c1e7d]['group']):_0x43b218['rules'][_0x2c1e7d][_0x6e6c('0x6b')]+'\x20'+_0x43b218[_0x6e6c('0x68')][_0x2c1e7d][_0x6e6c('0x6c')]+(_0x17aa9c(_0x43b218[_0x6e6c('0x68')][_0x2c1e7d][_0x6e6c('0x6c')])?'\x20'+_0x43b218[_0x6e6c('0x68')][_0x2c1e7d][_0x6e6c('0x8d')]:'');}return _0x29f0f3+')';};var _0x2a2c89={'where':{'id':_0x124160['id']}},_0x145707,_0x381b6b,_0xaefd98,_0x65eba1,_0x322ab4;_0x2a2c89=_[_0x6e6c('0x43')]({},_0x2a2c89,_0x37362a);return db[_0x6e6c('0x2f')][_0x6e6c('0x49')](_0x2a2c89)[_0x6e6c('0x27')](function(_0x52954a){if(_0x52954a){_0x145707=_0x52954a;return _0x52954a[_0x6e6c('0x6d')]();}return null;})[_0x6e6c('0x27')](function(_0x53b69f){if(_0x53b69f){if(!_0x53b69f['length']){throw new db['Sequelize'][(_0x6e6c('0x6f'))](_0x6e6c('0x70'),0x193);}_0x381b6b=_0x53b69f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x6e6c('0x27')](function(_0x377610){if(_0x377610){_0xaefd98=_['keyBy'](_0x377610,'id');var _0x4ef371;var _0x247582=squel[_0x6e6c('0x8e')]();_0x247582[_0x6e6c('0x73')](_0x145707[_0x6e6c('0x74')]);for(var _0x55131c=0x0;_0x55131c<_0x381b6b[_0x6e6c('0x3b')];_0x55131c+=0x1){_0x4ef371=_0x381b6b[_0x55131c][_0x6e6c('0x75')]?_0xaefd98[_0x381b6b[_0x55131c][_0x6e6c('0x75')]]['metric']:_0x381b6b[_0x55131c]['field'];_0x4ef371=_0x381b6b[_0x55131c][_0x6e6c('0x77')]?_[_0x6e6c('0x78')](_0x462b68[_0x381b6b[_0x55131c][_0x6e6c('0x77')]],'%s',_0x4ef371):_0x4ef371;_0x4ef371=_0x381b6b[_0x55131c][_0x6e6c('0x79')]?_[_0x6e6c('0x78')](_0x5af175[_0x381b6b[_0x55131c][_0x6e6c('0x79')]],'%s',_0x4ef371):_0x4ef371;if(_0x381b6b[_0x55131c][_0x6e6c('0x7a')]){_0x247582['group'](_0x4ef371);}_0x381b6b[_0x55131c][_0x6e6c('0x7b')]&&_0x247582[_0x6e6c('0x3e')](_0x4ef371,_0x381b6b[_0x55131c]['orderBy']===_0x6e6c('0x7c')?![]:!![]);_0x247582[_0x6e6c('0x6b')](_0x4ef371,_0x381b6b[_0x55131c]['alias']||_0x4ef371);}if(_0x145707['joins']){_0x145707['joins']=JSON[_0x6e6c('0x7f')](_0x145707['joins']);for(var _0x426159=0x0;_0x426159<_0x145707[_0x6e6c('0x7e')][_0x6e6c('0x3b')];_0x426159+=0x1){if(_0x145707[_0x6e6c('0x7e')][_0x426159][_0x6e6c('0x32')]&&_[_0x6e6c('0x63')](_0x2182b5,_0x145707[_0x6e6c('0x7e')][_0x426159][_0x6e6c('0x32')])&&_0x145707[_0x6e6c('0x7e')][_0x426159][_0x6e6c('0x80')]&&_0x145707[_0x6e6c('0x7e')][_0x426159][_0x6e6c('0x81')]&&_0x145707[_0x6e6c('0x7e')][_0x426159][_0x6e6c('0x82')]){_0x247582[_0x145707['joins'][_0x426159][_0x6e6c('0x32')]](_0x145707[_0x6e6c('0x7e')][_0x426159][_0x6e6c('0x81')],null,util[_0x6e6c('0x79')](_0x6e6c('0x83'),_0x145707[_0x6e6c('0x74')],_0x145707[_0x6e6c('0x7e')][_0x426159][_0x6e6c('0x80')],_0x145707['joins'][_0x426159][_0x6e6c('0x81')],_0x145707['joins'][_0x426159][_0x6e6c('0x82')]));}}}if(_0x145707['conditions']){_0x145707['conditions']=JSON[_0x6e6c('0x7f')](_0x145707[_0x6e6c('0x84')]);_0x247582[_0x6e6c('0x40')](_0x3997f6(_0x145707[_0x6e6c('0x84')][_0x6e6c('0x6a')]));}_0x322ab4=_0x247582['clone']();_0x247582[_0x6e6c('0x1f')](_0x3931dc);_0x247582[_0x6e6c('0x1e')](0x0);logger['debug'](_0x6e6c('0x85'),_0x247582[_0x6e6c('0x86')]());return db[_0x6e6c('0x87')]['query'](_0x247582[_0x6e6c('0x86')](),{'type':db[_0x6e6c('0x87')]['QueryTypes'][_0x6e6c('0x89')]});}})[_0x6e6c('0x27')](function(_0xca1a31){if(!_0xca1a31[_0x6e6c('0x3b')]){throw new db['Sequelize'][(_0x6e6c('0x6f'))](_0x6e6c('0x8f'),0xcc);}if(_0x520846[_0x6e6c('0x90')]===_0x6e6c('0x91')){return null;}var _0x38a6af=_[_0x6e6c('0x43')](_0x520846,{'name':_0x520846[_0x6e6c('0x92')]||_0x520846[_0x6e6c('0x2b')]||_0x145707[_0x6e6c('0x2b')],'basename':_0x17f369,'savename':util['format']('%s-%s.%s',_0x520846[_0x6e6c('0x2b')]||_0x145707[_0x6e6c('0x2b')],require(_0x6e6c('0x93'))[_0x6e6c('0x94')](0x4),_0x520846[_0x6e6c('0x90')]||_0x6e6c('0x95')),'reportId':_0x145707['id'],'reportType':_0x6e6c('0x96')});return db[_0x6e6c('0x97')][_0x6e6c('0x4a')](_0x38a6af,{'raw':!![]});})['then'](function(_0x54dc){if(_0x145707[_0x6e6c('0x74')]===_0x6e6c('0x98')){_0x322ab4[_0x6e6c('0x40')](_0x145707[_0x6e6c('0x74')]+_0x6e6c('0x99'),_0x520846['startDate'],_0x520846[_0x6e6c('0x9a')]);}else{_0x322ab4['where'](_0x145707[_0x6e6c('0x74')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x520846[_0x6e6c('0x9b')],_0x520846[_0x6e6c('0x9a')]);}if(_0x54dc){logger['info'](_0x6e6c('0x9c'),_0x322ab4[_0x6e6c('0x86')]());require(_0x6e6c('0x9d'))[_0x6e6c('0x9e')](path['join'](__dirname,'../../components/export/',_0x54dc[_0x6e6c('0x90')]),[_0x54dc['id'],_0x322ab4[_0x6e6c('0x86')](),path[_0x6e6c('0x8a')](__dirname,'../../files/reports',_0x54dc[_0x6e6c('0x9f')]),_0x17f369]);return _0x54dc;}else{var _0x18ef66=squel[_0x6e6c('0x8e')]();_0x18ef66[_0x6e6c('0x73')]('('+_0x322ab4[_0x6e6c('0x86')]()+')',_0x6e6c('0xa0'));_0x18ef66[_0x6e6c('0x6b')](_0x6e6c('0xa1'),_0x6e6c('0x1d'));_0x322ab4[_0x6e6c('0x1f')](_0x520846[_0x6e6c('0x1f')]||_0x3931dc);_0x322ab4['offset'](_0x520846[_0x6e6c('0x1e')]||0x0);return dbH[_0x6e6c('0x87')][_0x6e6c('0x35')](_0x18ef66['toString'](),{'type':dbH[_0x6e6c('0x87')][_0x6e6c('0x88')][_0x6e6c('0x89')]})['then'](function(_0x3e990e){if(!_0x3e990e['length']){_0x65eba1=0x0;}else{_0x65eba1=_0x3e990e[0x0][_0x6e6c('0x1d')]||0x0;}return dbH['sequelize']['query'](_0x322ab4['toString'](),{'type':dbH[_0x6e6c('0x87')][_0x6e6c('0x88')][_0x6e6c('0x89')]});})[_0x6e6c('0x27')](function(_0xa49433){return{'rows':_0xa49433||[],'count':_0x65eba1};});}});}exports[_0x6e6c('0xa2')]=function(_0x5a8151,_0x1bea8e){return runReport(_0x5a8151[_0x6e6c('0x48')],_0x5a8151[_0x6e6c('0x35')],_0x5a8151[_0x6e6c('0x44')])[_0x6e6c('0x27')](respondWithResult(_0x1bea8e,null))[_0x6e6c('0x47')](handleError(_0x1bea8e,null));};exports[_0x6e6c('0xa3')]=runReport;exports['query']=function(_0x553960,_0x1a4a8a){var _0x28fad3=0xa;var _0x373f2b=[_0x6e6c('0x8a'),_0x6e6c('0x55'),_0x6e6c('0x56'),_0x6e6c('0x8b')];var _0x2bbd40={'SUM':_0x6e6c('0xa4'),'COUNT':_0x6e6c('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6e6c('0x59'),'MIN':_0x6e6c('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6e6c('0x5c'),'GROUP_CONCAT ASC':_0x6e6c('0x5d'),'GROUP_CONCAT DESC':_0x6e6c('0x5e')};var _0x8ae280={'SEC_TO_TIME':_0x6e6c('0x5f'),'DATE':'DATE(%s)','HOUR':_0x6e6c('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6e6c('0x62')};var _0x4d91ee=function(_0x2f2de0){return!_[_0x6e6c('0x63')]([_0x6e6c('0x64'),_0x6e6c('0x65'),_0x6e6c('0x66'),_0x6e6c('0x67')],_0x2f2de0);};var _0x9ab8a6=function(_0x4985e1){if(!_0x4985e1||!_0x4985e1['rules'][_0x6e6c('0x3b')]){return'';}for(var _0x4faea4='(',_0x1cc077=0x0;_0x1cc077<_0x4985e1[_0x6e6c('0x68')][_0x6e6c('0x3b')];_0x1cc077+=0x1){_0x1cc077>0x0&&(_0x4faea4+='\x20'+_0x4985e1[_0x6e6c('0x69')]+'\x20');_0x4faea4+=_0x4985e1['rules'][_0x1cc077][_0x6e6c('0x6a')]?_0x9ab8a6(_0x4985e1[_0x6e6c('0x68')][_0x1cc077][_0x6e6c('0x6a')]):_0x4985e1[_0x6e6c('0x68')][_0x1cc077][_0x6e6c('0x6b')]+'\x20'+_0x4985e1['rules'][_0x1cc077]['condition']+(_0x4d91ee(_0x4985e1[_0x6e6c('0x68')][_0x1cc077][_0x6e6c('0x6c')])?'\x20'+_0x4985e1[_0x6e6c('0x68')][_0x1cc077][_0x6e6c('0x8d')]:'');}return _0x4faea4+')';};var _0x5b8e25={'where':{'id':_0x553960['params']['id']}},_0x5e4452,_0x2367fd,_0x16d12e,_0xde6ae0,_0x594ce6;_0x5b8e25=_[_0x6e6c('0x43')]({},_0x5b8e25,_0x553960[_0x6e6c('0x44')]);return db[_0x6e6c('0x2f')][_0x6e6c('0x49')](_0x5b8e25)[_0x6e6c('0x27')](function(_0x5504fb){if(_0x5504fb){_0x5e4452=_0x5504fb;return _0x5504fb['getFields']();}return null;})[_0x6e6c('0x27')](function(_0x47cfda){if(_0x47cfda){if(!_0x47cfda[_0x6e6c('0x3b')]){throw new db['Sequelize'][(_0x6e6c('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2367fd=_0x47cfda;return db[_0x6e6c('0x71')][_0x6e6c('0x46')]({'raw':!![]});}return null;})[_0x6e6c('0x27')](function(_0x77b73){if(_0x77b73){_0x16d12e=_['keyBy'](_0x77b73,'id');var _0x358ba3;var _0xfc0ffc=squel[_0x6e6c('0x8e')]();_0xfc0ffc[_0x6e6c('0x73')](_0x5e4452['table']);for(var _0x3060a2=0x0;_0x3060a2<_0x2367fd[_0x6e6c('0x3b')];_0x3060a2+=0x1){_0x358ba3=_0x2367fd[_0x3060a2]['MetricId']?_0x16d12e[_0x2367fd[_0x3060a2][_0x6e6c('0x75')]][_0x6e6c('0x76')]:_0x2367fd[_0x3060a2][_0x6e6c('0x6b')];_0x358ba3=_0x2367fd[_0x3060a2][_0x6e6c('0x77')]?_[_0x6e6c('0x78')](_0x2bbd40[_0x2367fd[_0x3060a2][_0x6e6c('0x77')]],'%s',_0x358ba3):_0x358ba3;_0x358ba3=_0x2367fd[_0x3060a2]['format']?_[_0x6e6c('0x78')](_0x8ae280[_0x2367fd[_0x3060a2][_0x6e6c('0x79')]],'%s',_0x358ba3):_0x358ba3;if(_0x2367fd[_0x3060a2][_0x6e6c('0x7a')]){_0xfc0ffc['group'](_0x358ba3);}_0x2367fd[_0x3060a2][_0x6e6c('0x7b')]&&_0xfc0ffc['order'](_0x358ba3,_0x2367fd[_0x3060a2][_0x6e6c('0x7b')]===_0x6e6c('0x7c')?![]:!![]);_0xfc0ffc['field'](_0x358ba3,_0x2367fd[_0x3060a2][_0x6e6c('0x7d')]||_0x358ba3);}if(_0x5e4452[_0x6e6c('0x7e')]){_0x5e4452['joins']=JSON[_0x6e6c('0x7f')](_0x5e4452[_0x6e6c('0x7e')]);for(var _0x181c3f=0x0;_0x181c3f<_0x5e4452['joins'][_0x6e6c('0x3b')];_0x181c3f+=0x1){if(_0x5e4452[_0x6e6c('0x7e')][_0x181c3f][_0x6e6c('0x32')]&&_[_0x6e6c('0x63')](_0x373f2b,_0x5e4452[_0x6e6c('0x7e')][_0x181c3f]['type'])&&_0x5e4452[_0x6e6c('0x7e')][_0x181c3f]['parentKey']&&_0x5e4452[_0x6e6c('0x7e')][_0x181c3f][_0x6e6c('0x81')]&&_0x5e4452[_0x6e6c('0x7e')][_0x181c3f][_0x6e6c('0x82')]){_0xfc0ffc[_0x5e4452[_0x6e6c('0x7e')][_0x181c3f]['type']](_0x5e4452['joins'][_0x181c3f][_0x6e6c('0x81')],null,util[_0x6e6c('0x79')](_0x6e6c('0x83'),_0x5e4452[_0x6e6c('0x74')],_0x5e4452['joins'][_0x181c3f][_0x6e6c('0x80')],_0x5e4452[_0x6e6c('0x7e')][_0x181c3f]['foreignTable'],_0x5e4452[_0x6e6c('0x7e')][_0x181c3f][_0x6e6c('0x82')]));}}}if(_0x5e4452[_0x6e6c('0x84')]){_0x5e4452[_0x6e6c('0x84')]=JSON['parse'](_0x5e4452[_0x6e6c('0x84')]);_0xfc0ffc['where'](_0x9ab8a6(_0x5e4452[_0x6e6c('0x84')][_0x6e6c('0x6a')]));}_0x594ce6=_0xfc0ffc[_0x6e6c('0xa5')]();_0xfc0ffc[_0x6e6c('0x1f')](_0x28fad3);_0xfc0ffc[_0x6e6c('0x1e')](0x0);logger[_0x6e6c('0xa6')](_0x6e6c('0x85'),_0xfc0ffc[_0x6e6c('0x86')]());return db[_0x6e6c('0x87')][_0x6e6c('0x35')](_0xfc0ffc[_0x6e6c('0x86')](),{'type':db['sequelize'][_0x6e6c('0x88')][_0x6e6c('0x89')]});}})[_0x6e6c('0x27')](function(){return{'sql':_0x594ce6[_0x6e6c('0x86')]()};})[_0x6e6c('0x27')](respondWithResult(_0x1a4a8a,null))[_0x6e6c('0x47')](handleError(_0x1a4a8a,null));};
\ No newline at end of file
+var _0xe1df=['name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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\x20DESC)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','field','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','sequelize','QueryTypes','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','select','DESC','foreignKey','debug','Limited\x20Query:','toString','SELECT','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','run','runReport','ROUND(%s)','AnalyticMetric','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','get','DefaultReports','then','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe1df,0x80));var _0xfe1d=function(_0x530723,_0x13390e){_0x530723=_0x530723-0x0;var _0x57adb3=_0xe1df[_0x530723];return _0x57adb3;};'use strict';var pdf=require(_0xfe1d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfe1d('0x1'));var zipdir=require(_0xfe1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe1d('0x3'));var moment=require('moment');var BPromise=require(_0xfe1d('0x4'));var Mustache=require(_0xfe1d('0x5'));var util=require('util');var path=require(_0xfe1d('0x6'));var sox=require(_0xfe1d('0x7'));var csv=require(_0xfe1d('0x8'));var ejs=require(_0xfe1d('0x9'));var fs=require('fs');var _=require(_0xfe1d('0xa'));var squel=require(_0xfe1d('0xb'));var crypto=require(_0xfe1d('0xc'));var jsforce=require(_0xfe1d('0xd'));var deskjs=require(_0xfe1d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfe1d('0xf'));var Papa=require('papaparse');var Redis=require(_0xfe1d('0x10'));var authService=require(_0xfe1d('0x11'));var qs=require(_0xfe1d('0x12'));var as=require(_0xfe1d('0x13'));var hardwareService=require(_0xfe1d('0x14'));var logger=require(_0xfe1d('0x15'))(_0xfe1d('0x16'));var utils=require('../../config/utils');var config=require(_0xfe1d('0x17'));var db=require(_0xfe1d('0x18'))['db'];var dbH=require(_0xfe1d('0x18'))[_0xfe1d('0x19')];function respondWithStatusCode(_0x42b9c5,_0x1d9bf1){_0x1d9bf1=_0x1d9bf1||0xcc;return function(_0x277522){if(_0x277522){return _0x42b9c5[_0xfe1d('0x1a')](_0x1d9bf1);}return _0x42b9c5['status'](_0x1d9bf1)[_0xfe1d('0x1b')]();};}function respondWithResult(_0x47476b,_0x121c00){_0x121c00=_0x121c00||0xc8;return function(_0x5a24a3){if(_0x5a24a3){return _0x47476b['status'](_0x121c00)[_0xfe1d('0x1c')](_0x5a24a3);}};}function respondWithFilteredResult(_0x5bea41,_0x9b1c5a){return function(_0x19badd){if(_0x19badd){var _0x1511a7=_0x19badd[_0xfe1d('0x1d')],_0x2d5e97=_0x9b1c5a[_0xfe1d('0x1e')],_0x179b4e=_0x9b1c5a[_0xfe1d('0x1e')]+_0x9b1c5a[_0xfe1d('0x1f')],_0x11a4d8;if(_0x179b4e>=_0x1511a7){_0x179b4e=_0x1511a7;_0x11a4d8=0xc8;}else{_0x11a4d8=0xce;}_0x5bea41[_0xfe1d('0x20')](_0x11a4d8);return _0x5bea41[_0xfe1d('0x21')](_0xfe1d('0x22'),_0x2d5e97+'-'+_0x179b4e+'/'+_0x1511a7)['json'](_0x19badd);}return null;};}function patchUpdates(_0x80676b){return function(_0x4d018f){try{jsonpatch[_0xfe1d('0x23')](_0x4d018f,_0x80676b,!![]);}catch(_0x33478e){return BPromise[_0xfe1d('0x24')](_0x33478e);}return _0x4d018f[_0xfe1d('0x25')]();};}function saveUpdates(_0x30f950,_0x3ab893){return function(_0x6d2aa){if(_0x6d2aa){return _0x6d2aa[_0xfe1d('0x26')](_0x30f950)['then'](function(_0x196bd4){return _0x196bd4;});}return null;};}function removeEntity(_0x1b3bb2,_0x2e6b81){return function(_0x220259){if(_0x220259){return _0x220259[_0xfe1d('0x27')]()['then'](function(){var _0x3ec9df=_0x220259[_0xfe1d('0x28')]({'plain':!![]});var _0x543424=_0xfe1d('0x29');return db['UserProfileResource'][_0xfe1d('0x27')]({'where':{'type':_0x543424,'resourceId':_0x3ec9df['id']}})[_0xfe1d('0x2a')](function(){return _0x220259;});})[_0xfe1d('0x2a')](function(){_0x1b3bb2[_0xfe1d('0x20')](0xcc)[_0xfe1d('0x1b')]();});}};}function handleEntityNotFound(_0x40ba4e,_0x1b6e89){return function(_0xbbca00){if(!_0xbbca00){_0x40ba4e[_0xfe1d('0x1a')](0x194);}return _0xbbca00;};}function handleError(_0x3294e9,_0x4fc156){_0x4fc156=_0x4fc156||0x1f4;return function(_0x479e18){logger[_0xfe1d('0x2b')](_0x479e18['stack']);if(_0x479e18[_0xfe1d('0x2c')]){delete _0x479e18['name'];}_0x3294e9[_0xfe1d('0x20')](_0x4fc156)[_0xfe1d('0x2d')](_0x479e18);};}exports[_0xfe1d('0x2e')]=function(_0x486383,_0x4fc546){var _0x4bf39c={},_0x2a7507={},_0x565e58={'count':0x0,'rows':[]};var _0x2b7aab=_[_0xfe1d('0x2f')](db['AnalyticDefaultReport'][_0xfe1d('0x30')],function(_0x3eec3b){return{'name':_0x3eec3b[_0xfe1d('0x31')],'type':_0x3eec3b[_0xfe1d('0x32')]['key']};});_0x2a7507[_0xfe1d('0x33')]=_[_0xfe1d('0x2f')](_0x2b7aab,_0xfe1d('0x2c'));_0x2a7507[_0xfe1d('0x34')]=_[_0xfe1d('0x35')](_0x486383[_0xfe1d('0x34')]);_0x2a7507[_0xfe1d('0x36')]=_[_0xfe1d('0x37')](_0x2a7507[_0xfe1d('0x33')],_0x2a7507['query']);_0x4bf39c[_0xfe1d('0x38')]=_[_0xfe1d('0x37')](_0x2a7507[_0xfe1d('0x33')],qs['fields'](_0x486383[_0xfe1d('0x34')]['fields']));_0x4bf39c[_0xfe1d('0x38')]=_0x4bf39c['attributes'][_0xfe1d('0x39')]?_0x4bf39c[_0xfe1d('0x38')]:_0x2a7507[_0xfe1d('0x33')];if(!_0x486383[_0xfe1d('0x34')][_0xfe1d('0x3a')](_0xfe1d('0x3b'))){_0x4bf39c[_0xfe1d('0x1f')]=qs['limit'](_0x486383[_0xfe1d('0x34')][_0xfe1d('0x1f')]);_0x4bf39c[_0xfe1d('0x1e')]=qs[_0xfe1d('0x1e')](_0x486383['query'][_0xfe1d('0x1e')]);}_0x4bf39c['order']=qs[_0xfe1d('0x3c')](_0x486383['query'][_0xfe1d('0x3c')]);_0x4bf39c[_0xfe1d('0x3d')]=qs[_0xfe1d('0x36')](_[_0xfe1d('0x3e')](_0x486383['query'],_0x2a7507[_0xfe1d('0x36')]),_0x2b7aab);if(_0x486383[_0xfe1d('0x34')]['filter']){_0x4bf39c[_0xfe1d('0x3d')]=_[_0xfe1d('0x3f')](_0x4bf39c[_0xfe1d('0x3d')],{'$or':_[_0xfe1d('0x2f')](_0x2b7aab,function(_0x41e488){if(_0x41e488[_0xfe1d('0x32')]!==_0xfe1d('0x40')){var _0x329c14={};_0x329c14[_0x41e488[_0xfe1d('0x2c')]]={'$like':'%'+_0x486383[_0xfe1d('0x34')][_0xfe1d('0x41')]+'%'};return _0x329c14;}})});}_0x4bf39c=_[_0xfe1d('0x3f')]({},_0x4bf39c,_0x486383[_0xfe1d('0x42')]);var _0x181623={'where':_0x4bf39c[_0xfe1d('0x3d')]};return db[_0xfe1d('0x43')][_0xfe1d('0x1d')](_0x181623)['then'](function(_0x490ed1){_0x565e58[_0xfe1d('0x1d')]=_0x490ed1;if(_0x486383[_0xfe1d('0x34')][_0xfe1d('0x44')]){_0x4bf39c[_0xfe1d('0x45')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0xfe1d('0x46')](_0x4bf39c);})['then'](function(_0x408ab8){_0x565e58[_0xfe1d('0x47')]=_0x408ab8;return _0x565e58;})[_0xfe1d('0x2a')](respondWithFilteredResult(_0x4fc546,_0x4bf39c))['catch'](handleError(_0x4fc546,null));};exports[_0xfe1d('0x48')]=function(_0x400c10,_0x12383a){var _0x865eb7={'raw':!![],'where':{'id':_0x400c10[_0xfe1d('0x49')]['id']}},_0x3f4b6b={};_0x3f4b6b['model']=_[_0xfe1d('0x35')](db[_0xfe1d('0x43')]['rawAttributes']);_0x3f4b6b[_0xfe1d('0x34')]=_['keys'](_0x400c10[_0xfe1d('0x34')]);_0x3f4b6b['filters']=_[_0xfe1d('0x37')](_0x3f4b6b[_0xfe1d('0x33')],_0x3f4b6b['query']);_0x865eb7[_0xfe1d('0x38')]=_['intersection'](_0x3f4b6b[_0xfe1d('0x33')],qs[_0xfe1d('0x4a')](_0x400c10[_0xfe1d('0x34')]['fields']));_0x865eb7[_0xfe1d('0x38')]=_0x865eb7[_0xfe1d('0x38')][_0xfe1d('0x39')]?_0x865eb7['attributes']:_0x3f4b6b[_0xfe1d('0x33')];if(_0x400c10[_0xfe1d('0x34')][_0xfe1d('0x44')]){_0x865eb7['include']=[{'all':!![]}];}_0x865eb7=_[_0xfe1d('0x3f')]({},_0x865eb7,_0x400c10[_0xfe1d('0x42')]);return db[_0xfe1d('0x43')][_0xfe1d('0x4b')](_0x865eb7)[_0xfe1d('0x2a')](handleEntityNotFound(_0x12383a,null))[_0xfe1d('0x2a')](respondWithResult(_0x12383a,null))[_0xfe1d('0x4c')](handleError(_0x12383a,null));};exports['create']=function(_0x2bbd94,_0xf26879){return db['AnalyticDefaultReport'][_0xfe1d('0x4d')](_0x2bbd94[_0xfe1d('0x4e')],{})[_0xfe1d('0x2a')](function(_0x340441){var _0x515543=_0x2bbd94[_0xfe1d('0x4f')][_0xfe1d('0x28')]({'plain':!![]});if(!_0x515543)throw new Error(_0xfe1d('0x50'));if(_0x515543[_0xfe1d('0x51')]===_0xfe1d('0x4f')){var _0x4a6222=_0x340441[_0xfe1d('0x28')]({'plain':!![]});var _0x4a1907='Reports';return db[_0xfe1d('0x52')]['find']({'where':{'name':_0x4a1907,'userProfileId':_0x515543[_0xfe1d('0x53')]},'raw':!![]})['then'](function(_0x34e74b){if(_0x34e74b&&_0x34e74b[_0xfe1d('0x54')]===0x0){return db[_0xfe1d('0x55')][_0xfe1d('0x4d')]({'name':_0x4a6222[_0xfe1d('0x2c')],'resourceId':_0x4a6222['id'],'type':'DefaultReports','sectionId':_0x34e74b['id']},{})[_0xfe1d('0x2a')](function(){return _0x340441;});}else{return _0x340441;}})[_0xfe1d('0x4c')](function(_0xa1a657){logger[_0xfe1d('0x2b')](_0xfe1d('0x56'),_0xa1a657);throw _0xa1a657;});}return _0x340441;})[_0xfe1d('0x2a')](respondWithResult(_0xf26879,0xc9))[_0xfe1d('0x4c')](handleError(_0xf26879,null));};exports[_0xfe1d('0x26')]=function(_0x3c2a60,_0x5ff75b){if(_0x3c2a60[_0xfe1d('0x4e')]['id']){delete _0x3c2a60[_0xfe1d('0x4e')]['id'];}return db[_0xfe1d('0x43')]['find']({'where':{'id':_0x3c2a60['params']['id']}})[_0xfe1d('0x2a')](handleEntityNotFound(_0x5ff75b,null))[_0xfe1d('0x2a')](saveUpdates(_0x3c2a60['body'],null))[_0xfe1d('0x2a')](respondWithResult(_0x5ff75b,null))['catch'](handleError(_0x5ff75b,null));};exports[_0xfe1d('0x27')]=function(_0x2a1b65,_0x33b465){return db[_0xfe1d('0x43')][_0xfe1d('0x4b')]({'where':{'id':_0x2a1b65[_0xfe1d('0x49')]['id']}})[_0xfe1d('0x2a')](handleEntityNotFound(_0x33b465,null))['then'](removeEntity(_0x33b465,null))[_0xfe1d('0x4c')](handleError(_0x33b465,null));};exports[_0xfe1d('0x57')]=function(_0x3ada8f,_0x11cc4a){var _0x39388e=0xa;var _0x35eecf=[_0xfe1d('0x58'),_0xfe1d('0x59'),_0xfe1d('0x5a'),_0xfe1d('0x5b')];var _0x5c064c={'SUM':_0xfe1d('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfe1d('0x5d'),'MAX':'MAX(%s)','MIN':_0xfe1d('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfe1d('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfe1d('0x60')};var _0x3322af={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfe1d('0x61'),'HOUR':_0xfe1d('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x365a2b=function(_0x4c9426){return!_[_0xfe1d('0x63')]([_0xfe1d('0x64'),'IS\x20NOT\x20NULL',_0xfe1d('0x65'),'IS\x20NOT\x20EMPTY'],_0x4c9426);};var _0x196e02=function(_0x325b6c){if(!_0x325b6c||!_0x325b6c[_0xfe1d('0x66')][_0xfe1d('0x39')]){return'';}for(var _0x4cd6a8='(',_0x422659=0x0;_0x422659<_0x325b6c[_0xfe1d('0x66')][_0xfe1d('0x39')];_0x422659+=0x1){_0x422659>0x0&&(_0x4cd6a8+='\x20'+_0x325b6c[_0xfe1d('0x67')]+'\x20');_0x4cd6a8+=_0x325b6c['rules'][_0x422659][_0xfe1d('0x68')]?_0x196e02(_0x325b6c[_0xfe1d('0x66')][_0x422659][_0xfe1d('0x68')]):_0x325b6c[_0xfe1d('0x66')][_0x422659]['field']+'\x20'+_0x325b6c[_0xfe1d('0x66')][_0x422659][_0xfe1d('0x69')]+(_0x365a2b(_0x325b6c[_0xfe1d('0x66')][_0x422659][_0xfe1d('0x69')])?'\x20'+_0x325b6c[_0xfe1d('0x66')][_0x422659][_0xfe1d('0x6a')]:'');}return _0x4cd6a8+')';};var _0x5e1025={'where':{'id':_0x3ada8f[_0xfe1d('0x49')]['id']}},_0x34732a,_0x1661cb,_0x2b1a98,_0x383671,_0x56528f;_0x5e1025=_['merge']({},_0x5e1025,_0x3ada8f['options']);return db[_0xfe1d('0x43')][_0xfe1d('0x4b')](_0x5e1025)['then'](function(_0x20f4db){if(_0x20f4db){_0x34732a=_0x20f4db;return _0x20f4db[_0xfe1d('0x6b')]();}return null;})[_0xfe1d('0x2a')](function(_0x43e2aa){if(_0x43e2aa){if(!_0x43e2aa[_0xfe1d('0x39')]){throw new db[(_0xfe1d('0x6c'))][(_0xfe1d('0x6d'))](_0xfe1d('0x6e'),0x193);}_0x1661cb=_0x43e2aa;return db['AnalyticMetric'][_0xfe1d('0x46')]({'raw':!![]});}return null;})[_0xfe1d('0x2a')](function(_0x1cca19){if(_0x1cca19){_0x2b1a98=_[_0xfe1d('0x6f')](_0x1cca19,'id');var _0x13e951;var _0x452024=squel['select']();_0x452024[_0xfe1d('0x70')](_0x34732a[_0xfe1d('0x71')]);for(var _0xe09a0=0x0;_0xe09a0<_0x1661cb['length'];_0xe09a0+=0x1){_0x13e951=_0x1661cb[_0xe09a0][_0xfe1d('0x72')]?_0x2b1a98[_0x1661cb[_0xe09a0][_0xfe1d('0x72')]][_0xfe1d('0x73')]:_0x1661cb[_0xe09a0]['field'];_0x13e951=_0x1661cb[_0xe09a0][_0xfe1d('0x74')]?_[_0xfe1d('0x75')](_0x5c064c[_0x1661cb[_0xe09a0]['function']],'%s',_0x13e951):_0x13e951;_0x13e951=_0x1661cb[_0xe09a0][_0xfe1d('0x76')]?_[_0xfe1d('0x75')](_0x3322af[_0x1661cb[_0xe09a0][_0xfe1d('0x76')]],'%s',_0x13e951):_0x13e951;if(_0x1661cb[_0xe09a0][_0xfe1d('0x77')]){_0x452024['group'](_0x13e951);}_0x1661cb[_0xe09a0][_0xfe1d('0x78')]&&_0x452024[_0xfe1d('0x79')](_0x13e951,_0x1661cb[_0xe09a0][_0xfe1d('0x78')]==='DESC'?![]:!![]);_0x452024[_0xfe1d('0x7a')](_0x13e951,_0x1661cb[_0xe09a0][_0xfe1d('0x7b')]||_0x13e951);}if(_0x34732a[_0xfe1d('0x7c')]){_0x34732a[_0xfe1d('0x7c')]=JSON[_0xfe1d('0x7d')](_0x34732a[_0xfe1d('0x7c')]);for(var _0x31d1a1=0x0;_0x31d1a1<_0x34732a[_0xfe1d('0x7c')][_0xfe1d('0x39')];_0x31d1a1+=0x1){if(_0x34732a[_0xfe1d('0x7c')][_0x31d1a1]['type']&&_[_0xfe1d('0x63')](_0x35eecf,_0x34732a[_0xfe1d('0x7c')][_0x31d1a1][_0xfe1d('0x32')])&&_0x34732a[_0xfe1d('0x7c')][_0x31d1a1][_0xfe1d('0x7e')]&&_0x34732a[_0xfe1d('0x7c')][_0x31d1a1][_0xfe1d('0x7f')]&&_0x34732a[_0xfe1d('0x7c')][_0x31d1a1]['foreignKey']){_0x452024[_0x34732a['joins'][_0x31d1a1][_0xfe1d('0x32')]](_0x34732a[_0xfe1d('0x7c')][_0x31d1a1][_0xfe1d('0x7f')],null,util[_0xfe1d('0x76')](_0xfe1d('0x80'),_0x34732a[_0xfe1d('0x71')],_0x34732a[_0xfe1d('0x7c')][_0x31d1a1]['parentKey'],_0x34732a[_0xfe1d('0x7c')][_0x31d1a1][_0xfe1d('0x7f')],_0x34732a[_0xfe1d('0x7c')][_0x31d1a1]['foreignKey']));}}}if(_0x34732a[_0xfe1d('0x81')]){_0x34732a[_0xfe1d('0x81')]=JSON['parse'](_0x34732a[_0xfe1d('0x81')]);_0x452024[_0xfe1d('0x3d')](_0x196e02(_0x34732a['conditions']['group']));}_0x56528f=_0x452024[_0xfe1d('0x82')]();_0x452024[_0xfe1d('0x1f')](_0x39388e);_0x452024[_0xfe1d('0x1e')](0x0);logger['debug']('Limited\x20Query:',_0x452024['toString']());return db[_0xfe1d('0x83')][_0xfe1d('0x34')](_0x452024['toString'](),{'type':db[_0xfe1d('0x83')][_0xfe1d('0x84')]['SELECT']});}})['then'](respondWithResult(_0x11cc4a,null))[_0xfe1d('0x4c')](handleError(_0x11cc4a,null));};function runReport(_0x15ae42,_0x4b7c83,_0x4e7fb2){var _0x45cbf6=_0x4b7c83['name'];var _0x1a1967=0xa;var _0x4fb472=[_0xfe1d('0x58'),_0xfe1d('0x59'),_0xfe1d('0x5a'),'cross_join'];var _0x4af7f4={'SUM':'SUM(%s)','COUNT':_0xfe1d('0x85'),'COUNT DISTINCT':_0xfe1d('0x5d'),'MAX':_0xfe1d('0x86'),'MIN':_0xfe1d('0x5e'),'AVG':_0xfe1d('0x87'),'GROUP_CONCAT':_0xfe1d('0x5f'),'GROUP_CONCAT ASC':_0xfe1d('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x533f52={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfe1d('0x89')};var _0x35676a=function(_0x2542cf){return!_[_0xfe1d('0x63')]([_0xfe1d('0x64'),_0xfe1d('0x8a'),_0xfe1d('0x65'),_0xfe1d('0x8b')],_0x2542cf);};var _0x2a655f=function(_0x20bdde){if(!_0x20bdde||!_0x20bdde[_0xfe1d('0x66')][_0xfe1d('0x39')]){return'';}for(var _0x16d1fa='(',_0x376e40=0x0;_0x376e40<_0x20bdde[_0xfe1d('0x66')][_0xfe1d('0x39')];_0x376e40+=0x1){_0x376e40>0x0&&(_0x16d1fa+='\x20'+_0x20bdde[_0xfe1d('0x67')]+'\x20');_0x16d1fa+=_0x20bdde[_0xfe1d('0x66')][_0x376e40][_0xfe1d('0x68')]?_0x2a655f(_0x20bdde[_0xfe1d('0x66')][_0x376e40][_0xfe1d('0x68')]):_0x20bdde['rules'][_0x376e40]['field']+'\x20'+_0x20bdde[_0xfe1d('0x66')][_0x376e40][_0xfe1d('0x69')]+(_0x35676a(_0x20bdde['rules'][_0x376e40]['condition'])?'\x20'+_0x20bdde[_0xfe1d('0x66')][_0x376e40][_0xfe1d('0x6a')]:'');}return _0x16d1fa+')';};var _0x5e9d8={'where':{'id':_0x15ae42['id']}},_0x2ec3ee,_0x20aa46,_0x2ec451,_0x1e5f12,_0x1693cf;_0x5e9d8=_[_0xfe1d('0x3f')]({},_0x5e9d8,_0x4e7fb2);return db[_0xfe1d('0x43')]['find'](_0x5e9d8)[_0xfe1d('0x2a')](function(_0x4358e5){if(_0x4358e5){_0x2ec3ee=_0x4358e5;return _0x4358e5[_0xfe1d('0x6b')]();}return null;})[_0xfe1d('0x2a')](function(_0x61a7cf){if(_0x61a7cf){if(!_0x61a7cf[_0xfe1d('0x39')]){throw new db[(_0xfe1d('0x6c'))][(_0xfe1d('0x6d'))](_0xfe1d('0x6e'),0x193);}_0x20aa46=_0x61a7cf;return db['AnalyticMetric'][_0xfe1d('0x46')]({'raw':!![]});}return null;})[_0xfe1d('0x2a')](function(_0x3d1acd){if(_0x3d1acd){_0x2ec451=_[_0xfe1d('0x6f')](_0x3d1acd,'id');var _0x1c59aa;var _0x40f881=squel[_0xfe1d('0x8c')]();_0x40f881[_0xfe1d('0x70')](_0x2ec3ee[_0xfe1d('0x71')]);for(var _0x297ff6=0x0;_0x297ff6<_0x20aa46[_0xfe1d('0x39')];_0x297ff6+=0x1){_0x1c59aa=_0x20aa46[_0x297ff6][_0xfe1d('0x72')]?_0x2ec451[_0x20aa46[_0x297ff6][_0xfe1d('0x72')]][_0xfe1d('0x73')]:_0x20aa46[_0x297ff6][_0xfe1d('0x7a')];_0x1c59aa=_0x20aa46[_0x297ff6][_0xfe1d('0x74')]?_['replace'](_0x4af7f4[_0x20aa46[_0x297ff6][_0xfe1d('0x74')]],'%s',_0x1c59aa):_0x1c59aa;_0x1c59aa=_0x20aa46[_0x297ff6][_0xfe1d('0x76')]?_[_0xfe1d('0x75')](_0x533f52[_0x20aa46[_0x297ff6][_0xfe1d('0x76')]],'%s',_0x1c59aa):_0x1c59aa;if(_0x20aa46[_0x297ff6]['groupBy']){_0x40f881[_0xfe1d('0x68')](_0x1c59aa);}_0x20aa46[_0x297ff6][_0xfe1d('0x78')]&&_0x40f881[_0xfe1d('0x79')](_0x1c59aa,_0x20aa46[_0x297ff6][_0xfe1d('0x78')]===_0xfe1d('0x8d')?![]:!![]);_0x40f881[_0xfe1d('0x7a')](_0x1c59aa,_0x20aa46[_0x297ff6][_0xfe1d('0x7b')]||_0x1c59aa);}if(_0x2ec3ee[_0xfe1d('0x7c')]){_0x2ec3ee[_0xfe1d('0x7c')]=JSON[_0xfe1d('0x7d')](_0x2ec3ee[_0xfe1d('0x7c')]);for(var _0x29f800=0x0;_0x29f800<_0x2ec3ee[_0xfe1d('0x7c')][_0xfe1d('0x39')];_0x29f800+=0x1){if(_0x2ec3ee[_0xfe1d('0x7c')][_0x29f800][_0xfe1d('0x32')]&&_[_0xfe1d('0x63')](_0x4fb472,_0x2ec3ee['joins'][_0x29f800][_0xfe1d('0x32')])&&_0x2ec3ee[_0xfe1d('0x7c')][_0x29f800][_0xfe1d('0x7e')]&&_0x2ec3ee[_0xfe1d('0x7c')][_0x29f800][_0xfe1d('0x7f')]&&_0x2ec3ee['joins'][_0x29f800][_0xfe1d('0x8e')]){_0x40f881[_0x2ec3ee['joins'][_0x29f800]['type']](_0x2ec3ee[_0xfe1d('0x7c')][_0x29f800]['foreignTable'],null,util[_0xfe1d('0x76')](_0xfe1d('0x80'),_0x2ec3ee[_0xfe1d('0x71')],_0x2ec3ee['joins'][_0x29f800][_0xfe1d('0x7e')],_0x2ec3ee[_0xfe1d('0x7c')][_0x29f800][_0xfe1d('0x7f')],_0x2ec3ee[_0xfe1d('0x7c')][_0x29f800][_0xfe1d('0x8e')]));}}}if(_0x2ec3ee[_0xfe1d('0x81')]){_0x2ec3ee[_0xfe1d('0x81')]=JSON[_0xfe1d('0x7d')](_0x2ec3ee[_0xfe1d('0x81')]);_0x40f881[_0xfe1d('0x3d')](_0x2a655f(_0x2ec3ee[_0xfe1d('0x81')]['group']));}_0x1693cf=_0x40f881['clone']();_0x40f881[_0xfe1d('0x1f')](_0x1a1967);_0x40f881[_0xfe1d('0x1e')](0x0);logger[_0xfe1d('0x8f')](_0xfe1d('0x90'),_0x40f881[_0xfe1d('0x91')]());return db['sequelize'][_0xfe1d('0x34')](_0x40f881[_0xfe1d('0x91')](),{'type':db[_0xfe1d('0x83')][_0xfe1d('0x84')][_0xfe1d('0x92')]});}})['then'](function(_0x4e7a9a){if(!_0x4e7a9a[_0xfe1d('0x39')]){throw new db[(_0xfe1d('0x6c'))][(_0xfe1d('0x6d'))](_0xfe1d('0x93'),0xcc);}if(_0x4b7c83[_0xfe1d('0x94')]===_0xfe1d('0x95')){return null;}var _0x410232=_['merge'](_0x4b7c83,{'name':_0x4b7c83[_0xfe1d('0x96')]||_0x4b7c83['name']||_0x2ec3ee[_0xfe1d('0x2c')],'basename':_0x45cbf6,'savename':util[_0xfe1d('0x76')](_0xfe1d('0x97'),_0x4b7c83[_0xfe1d('0x2c')]||_0x2ec3ee[_0xfe1d('0x2c')],require(_0xfe1d('0x98'))[_0xfe1d('0x99')](0x4),_0x4b7c83[_0xfe1d('0x94')]||'csv'),'reportId':_0x2ec3ee['id'],'reportType':_0xfe1d('0x9a')});return db[_0xfe1d('0x9b')]['create'](_0x410232,{'raw':!![]});})[_0xfe1d('0x2a')](function(_0x19e328){if(_0x2ec3ee[_0xfe1d('0x71')]===_0xfe1d('0x9c')){_0x1693cf[_0xfe1d('0x3d')](_0x2ec3ee[_0xfe1d('0x71')]+_0xfe1d('0x9d'),_0x4b7c83[_0xfe1d('0x9e')],_0x4b7c83[_0xfe1d('0x9f')]);}else{_0x1693cf[_0xfe1d('0x3d')](_0x2ec3ee['table']+_0xfe1d('0xa0'),_0x4b7c83[_0xfe1d('0x9e')],_0x4b7c83[_0xfe1d('0x9f')]);}if(_0x19e328){logger[_0xfe1d('0xa1')](_0xfe1d('0xa2'),_0x1693cf[_0xfe1d('0x91')]());require(_0xfe1d('0xa3'))[_0xfe1d('0xa4')](path['join'](__dirname,'../../components/export/',_0x19e328[_0xfe1d('0x94')]),[_0x19e328['id'],_0x1693cf[_0xfe1d('0x91')](),path[_0xfe1d('0x58')](__dirname,_0xfe1d('0xa5'),_0x19e328[_0xfe1d('0xa6')]),_0x45cbf6]);return _0x19e328;}else{var _0x44ddb6=squel['select']();_0x44ddb6[_0xfe1d('0x70')]('('+_0x1693cf[_0xfe1d('0x91')]()+')','countTable');_0x44ddb6['field'](_0xfe1d('0xa7'),_0xfe1d('0x1d'));_0x1693cf[_0xfe1d('0x1f')](_0x4b7c83[_0xfe1d('0x1f')]||_0x1a1967);_0x1693cf[_0xfe1d('0x1e')](_0x4b7c83[_0xfe1d('0x1e')]||0x0);return dbH[_0xfe1d('0x83')][_0xfe1d('0x34')](_0x44ddb6[_0xfe1d('0x91')](),{'type':dbH['sequelize'][_0xfe1d('0x84')][_0xfe1d('0x92')]})['then'](function(_0xdefd28){if(!_0xdefd28[_0xfe1d('0x39')]){_0x1e5f12=0x0;}else{_0x1e5f12=_0xdefd28[0x0][_0xfe1d('0x1d')]||0x0;}return dbH[_0xfe1d('0x83')][_0xfe1d('0x34')](_0x1693cf[_0xfe1d('0x91')](),{'type':dbH[_0xfe1d('0x83')][_0xfe1d('0x84')][_0xfe1d('0x92')]});})[_0xfe1d('0x2a')](function(_0x5c2c11){return{'rows':_0x5c2c11||[],'count':_0x1e5f12};});}});}exports[_0xfe1d('0xa8')]=function(_0xe6bd1b,_0x149bb4){return runReport(_0xe6bd1b[_0xfe1d('0x49')],_0xe6bd1b['query'],_0xe6bd1b[_0xfe1d('0x42')])['then'](respondWithResult(_0x149bb4,null))['catch'](handleError(_0x149bb4,null));};exports[_0xfe1d('0xa9')]=runReport;exports[_0xfe1d('0x34')]=function(_0x308349,_0x546264){var _0x561894=0xa;var _0x26f2f0=[_0xfe1d('0x58'),_0xfe1d('0x59'),'right_join',_0xfe1d('0x5b')];var _0x813af0={'SUM':_0xfe1d('0x5c'),'COUNT':_0xfe1d('0x85'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfe1d('0x86'),'MIN':_0xfe1d('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfe1d('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfe1d('0x60')};var _0x1931aa={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfe1d('0x61'),'HOUR':_0xfe1d('0x62'),'ROUND':_0xfe1d('0xaa'),'UNIX_TIMESTAMP':_0xfe1d('0x89')};var _0x3949e1=function(_0x438344){return!_[_0xfe1d('0x63')]([_0xfe1d('0x64'),_0xfe1d('0x8a'),_0xfe1d('0x65'),_0xfe1d('0x8b')],_0x438344);};var _0x5a10fe=function(_0x567dc5){if(!_0x567dc5||!_0x567dc5[_0xfe1d('0x66')][_0xfe1d('0x39')]){return'';}for(var _0x31a33b='(',_0x45e9de=0x0;_0x45e9de<_0x567dc5[_0xfe1d('0x66')]['length'];_0x45e9de+=0x1){_0x45e9de>0x0&&(_0x31a33b+='\x20'+_0x567dc5['operator']+'\x20');_0x31a33b+=_0x567dc5[_0xfe1d('0x66')][_0x45e9de]['group']?_0x5a10fe(_0x567dc5[_0xfe1d('0x66')][_0x45e9de][_0xfe1d('0x68')]):_0x567dc5[_0xfe1d('0x66')][_0x45e9de][_0xfe1d('0x7a')]+'\x20'+_0x567dc5[_0xfe1d('0x66')][_0x45e9de]['condition']+(_0x3949e1(_0x567dc5['rules'][_0x45e9de]['condition'])?'\x20'+_0x567dc5[_0xfe1d('0x66')][_0x45e9de]['value']:'');}return _0x31a33b+')';};var _0x54638f={'where':{'id':_0x308349[_0xfe1d('0x49')]['id']}},_0x43ac00,_0x309b28,_0x4c1568,_0x3547cc,_0x51b304;_0x54638f=_[_0xfe1d('0x3f')]({},_0x54638f,_0x308349[_0xfe1d('0x42')]);return db[_0xfe1d('0x43')][_0xfe1d('0x4b')](_0x54638f)[_0xfe1d('0x2a')](function(_0x9acfce){if(_0x9acfce){_0x43ac00=_0x9acfce;return _0x9acfce[_0xfe1d('0x6b')]();}return null;})[_0xfe1d('0x2a')](function(_0x161796){if(_0x161796){if(!_0x161796[_0xfe1d('0x39')]){throw new db[(_0xfe1d('0x6c'))][(_0xfe1d('0x6d'))](_0xfe1d('0x6e'),0x193);}_0x309b28=_0x161796;return db[_0xfe1d('0xab')][_0xfe1d('0x46')]({'raw':!![]});}return null;})[_0xfe1d('0x2a')](function(_0x43b55d){if(_0x43b55d){_0x4c1568=_[_0xfe1d('0x6f')](_0x43b55d,'id');var _0x548d5f;var _0xdb6438=squel['select']();_0xdb6438[_0xfe1d('0x70')](_0x43ac00[_0xfe1d('0x71')]);for(var _0x379d5f=0x0;_0x379d5f<_0x309b28[_0xfe1d('0x39')];_0x379d5f+=0x1){_0x548d5f=_0x309b28[_0x379d5f][_0xfe1d('0x72')]?_0x4c1568[_0x309b28[_0x379d5f][_0xfe1d('0x72')]][_0xfe1d('0x73')]:_0x309b28[_0x379d5f][_0xfe1d('0x7a')];_0x548d5f=_0x309b28[_0x379d5f][_0xfe1d('0x74')]?_['replace'](_0x813af0[_0x309b28[_0x379d5f][_0xfe1d('0x74')]],'%s',_0x548d5f):_0x548d5f;_0x548d5f=_0x309b28[_0x379d5f][_0xfe1d('0x76')]?_[_0xfe1d('0x75')](_0x1931aa[_0x309b28[_0x379d5f][_0xfe1d('0x76')]],'%s',_0x548d5f):_0x548d5f;if(_0x309b28[_0x379d5f][_0xfe1d('0x77')]){_0xdb6438[_0xfe1d('0x68')](_0x548d5f);}_0x309b28[_0x379d5f][_0xfe1d('0x78')]&&_0xdb6438[_0xfe1d('0x79')](_0x548d5f,_0x309b28[_0x379d5f]['orderBy']===_0xfe1d('0x8d')?![]:!![]);_0xdb6438['field'](_0x548d5f,_0x309b28[_0x379d5f]['alias']||_0x548d5f);}if(_0x43ac00[_0xfe1d('0x7c')]){_0x43ac00[_0xfe1d('0x7c')]=JSON[_0xfe1d('0x7d')](_0x43ac00[_0xfe1d('0x7c')]);for(var _0x4d6a3a=0x0;_0x4d6a3a<_0x43ac00[_0xfe1d('0x7c')][_0xfe1d('0x39')];_0x4d6a3a+=0x1){if(_0x43ac00[_0xfe1d('0x7c')][_0x4d6a3a][_0xfe1d('0x32')]&&_['includes'](_0x26f2f0,_0x43ac00[_0xfe1d('0x7c')][_0x4d6a3a][_0xfe1d('0x32')])&&_0x43ac00[_0xfe1d('0x7c')][_0x4d6a3a][_0xfe1d('0x7e')]&&_0x43ac00[_0xfe1d('0x7c')][_0x4d6a3a][_0xfe1d('0x7f')]&&_0x43ac00[_0xfe1d('0x7c')][_0x4d6a3a][_0xfe1d('0x8e')]){_0xdb6438[_0x43ac00['joins'][_0x4d6a3a][_0xfe1d('0x32')]](_0x43ac00['joins'][_0x4d6a3a]['foreignTable'],null,util[_0xfe1d('0x76')]('%s.%s\x20=\x20%s.%s',_0x43ac00[_0xfe1d('0x71')],_0x43ac00[_0xfe1d('0x7c')][_0x4d6a3a][_0xfe1d('0x7e')],_0x43ac00[_0xfe1d('0x7c')][_0x4d6a3a][_0xfe1d('0x7f')],_0x43ac00[_0xfe1d('0x7c')][_0x4d6a3a][_0xfe1d('0x8e')]));}}}if(_0x43ac00[_0xfe1d('0x81')]){_0x43ac00[_0xfe1d('0x81')]=JSON[_0xfe1d('0x7d')](_0x43ac00[_0xfe1d('0x81')]);_0xdb6438[_0xfe1d('0x3d')](_0x5a10fe(_0x43ac00[_0xfe1d('0x81')]['group']));}_0x51b304=_0xdb6438[_0xfe1d('0x82')]();_0xdb6438[_0xfe1d('0x1f')](_0x561894);_0xdb6438[_0xfe1d('0x1e')](0x0);logger[_0xfe1d('0x8f')](_0xfe1d('0x90'),_0xdb6438['toString']());return db[_0xfe1d('0x83')][_0xfe1d('0x34')](_0xdb6438[_0xfe1d('0x91')](),{'type':db[_0xfe1d('0x83')][_0xfe1d('0x84')]['SELECT']});}})[_0xfe1d('0x2a')](function(){return{'sql':_0x51b304[_0xfe1d('0x91')]()};})[_0xfe1d('0x2a')](respondWithResult(_0x546264,null))[_0xfe1d('0x4c')](handleError(_0x546264,null));};
\ No newline at end of file
index c79d003..45dc590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7290=['../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2e7218,_0x598ccf){var _0x4a1310=function(_0xfc453e){while(--_0xfc453e){_0x2e7218['push'](_0x2e7218['shift']());}};_0x4a1310(++_0x598ccf);}(_0x7290,0x184));var _0x0729=function(_0x5d6600,_0x9a9e9b){_0x5d6600=_0x5d6600-0x0;var _0x3c85cc=_0x7290[_0x5d6600];return _0x3c85cc;};'use strict';var _=require(_0x0729('0x0'));var util=require(_0x0729('0x1'));var logger=require(_0x0729('0x2'))(_0x0729('0x3'));var moment=require(_0x0729('0x4'));var BPromise=require(_0x0729('0x5'));var rp=require(_0x0729('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0729('0x7'));var config=require(_0x0729('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x452cdc,_0x1cdf1f){return _0x452cdc[_0x0729('0x9')](_0x0729('0xa'),attributes,{'tableName':_0x0729('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3c4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger'];(function(_0xddddab,_0x2f147e){var _0x57e97f=function(_0x1e21d1){while(--_0x1e21d1){_0xddddab['push'](_0xddddab['shift']());}};_0x57e97f(++_0x2f147e);}(_0xc3c4,0xf5));var _0x4c3c=function(_0x104064,_0x26ee24){_0x104064=_0x104064-0x0;var _0x23e0c3=_0xc3c4[_0x104064];return _0x23e0c3;};'use strict';var _=require(_0x4c3c('0x0'));var util=require('util');var logger=require(_0x4c3c('0x1'))(_0x4c3c('0x2'));var moment=require(_0x4c3c('0x3'));var BPromise=require(_0x4c3c('0x4'));var rp=require(_0x4c3c('0x5'));var fs=require('fs');var path=require(_0x4c3c('0x6'));var rimraf=require(_0x4c3c('0x7'));var config=require(_0x4c3c('0x8'));var attributes=require(_0x4c3c('0x9'));module[_0x4c3c('0xa')]=function(_0x1f93e5,_0x10cc5f){return _0x1f93e5['define'](_0x4c3c('0xb'),attributes,{'tableName':_0x4c3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d4bb689..3dbbdd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab1=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5a018c,_0x4dfb95){var _0x2a8d54=function(_0x4da2aa){while(--_0x4da2aa){_0x5a018c['push'](_0x5a018c['shift']());}};_0x2a8d54(++_0x4dfb95);}(_0x1ab1,0x83));var _0x11ab=function(_0x17b26d,_0xdb468b){_0x17b26d=_0x17b26d-0x0;var _0x55f1d8=_0x1ab1[_0x17b26d];return _0x55f1d8;};'use strict';var _=require('lodash');var util=require(_0x11ab('0x0'));var moment=require(_0x11ab('0x1'));var BPromise=require(_0x11ab('0x2'));var rs=require(_0x11ab('0x3'));var fs=require('fs');var Redis=require(_0x11ab('0x4'));var db=require(_0x11ab('0x5'))['db'];var utils=require(_0x11ab('0x6'));var logger=require('../../config/logger')(_0x11ab('0x7'));var config=require(_0x11ab('0x8'));var jayson=require(_0x11ab('0x9'));var client=jayson[_0x11ab('0xa')][_0x11ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x531999,_0xe4281a,_0x26c091){return new BPromise(function(_0x4702b2,_0xa65ec9){return client['request'](_0x531999,_0x26c091)[_0x11ab('0xc')](function(_0x3979f9){logger[_0x11ab('0xd')](_0x11ab('0xe'),_0xe4281a,_0x11ab('0xf'));logger[_0x11ab('0x10')](_0x11ab('0x11'),_0xe4281a,'request\x20sent',JSON[_0x11ab('0x12')](_0x3979f9));if(_0x3979f9['error']){if(_0x3979f9[_0x11ab('0x13')][_0x11ab('0x14')]===0x1f4){logger[_0x11ab('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe4281a,_0x3979f9['error'][_0x11ab('0x15')]);return _0xa65ec9(_0x3979f9[_0x11ab('0x13')]['message']);}logger[_0x11ab('0x13')](_0x11ab('0xe'),_0xe4281a,_0x3979f9['error'][_0x11ab('0x15')]);return _0x4702b2(_0x3979f9['error'][_0x11ab('0x15')]);}else{logger[_0x11ab('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe4281a,'request\x20sent');_0x4702b2(_0x3979f9[_0x11ab('0x16')][_0x11ab('0x15')]);}})[_0x11ab('0x17')](function(_0x396011){logger[_0x11ab('0x13')](_0x11ab('0xe'),_0xe4281a,_0x396011);_0xa65ec9(_0x396011);});});}
\ No newline at end of file
+var _0xd64b=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1daad3,_0x3d060a){var _0x2483dd=function(_0x4c4328){while(--_0x4c4328){_0x1daad3['push'](_0x1daad3['shift']());}};_0x2483dd(++_0x3d060a);}(_0xd64b,0xc1));var _0xbd64=function(_0x21140e,_0x5d3c73){_0x21140e=_0x21140e-0x0;var _0x5d6eff=_0xd64b[_0x21140e];return _0x5d6eff;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});}
\ No newline at end of file
index 516a8c3..2a6c49b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42f6=['put','update','delete','destroy','exports','util','express','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0xc81f48,_0xa077a){var _0x26393b=function(_0x4d9240){while(--_0x4d9240){_0xc81f48['push'](_0xc81f48['shift']());}};_0x26393b(++_0xa077a);}(_0x42f6,0x9f));var _0x642f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x42f6[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x642f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x642f('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x642f('0x2'));var config=require(_0x642f('0x3'));var controller=require(_0x642f('0x4'));router[_0x642f('0x5')]('/',auth[_0x642f('0x6')](),controller[_0x642f('0x7')]);router['get'](_0x642f('0x8'),auth[_0x642f('0x6')](),controller[_0x642f('0x9')]);router[_0x642f('0x5')](_0x642f('0xa'),auth[_0x642f('0x6')](),controller[_0x642f('0xb')]);router['get'](_0x642f('0xc'),auth[_0x642f('0x6')](),controller[_0x642f('0xd')]);router[_0x642f('0x5')](_0x642f('0xe'),auth['isAuthenticated'](),controller[_0x642f('0xf')]);router[_0x642f('0x10')]('/',auth[_0x642f('0x6')](),controller['create']);router[_0x642f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x642f('0x12')]);router[_0x642f('0x13')](_0x642f('0x8'),auth[_0x642f('0x6')](),controller[_0x642f('0x14')]);module[_0x642f('0x15')]=router;
\ No newline at end of file
+var _0x576c=['query','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','/:id','show','get','/:id/preview','preview','/:id/run','run','/:id/query'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x576c,0x13f));var _0xc576=function(_0x1a69d2,_0x316b1d){_0x1a69d2=_0x1a69d2-0x0;var _0x6a6e44=_0x576c[_0x1a69d2];return _0x6a6e44;};'use strict';var multer=require('multer');var util=require(_0xc576('0x0'));var path=require(_0xc576('0x1'));var timeout=require(_0xc576('0x2'));var express=require(_0xc576('0x3'));var router=express[_0xc576('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc576('0x5'));var config=require(_0xc576('0x6'));var controller=require(_0xc576('0x7'));router['get']('/',auth[_0xc576('0x8')](),controller['index']);router['get'](_0xc576('0x9'),auth[_0xc576('0x8')](),controller[_0xc576('0xa')]);router[_0xc576('0xb')](_0xc576('0xc'),auth[_0xc576('0x8')](),controller[_0xc576('0xd')]);router[_0xc576('0xb')](_0xc576('0xe'),auth[_0xc576('0x8')](),controller[_0xc576('0xf')]);router[_0xc576('0xb')](_0xc576('0x10'),auth[_0xc576('0x8')](),controller[_0xc576('0x11')]);router[_0xc576('0x12')]('/',auth[_0xc576('0x8')](),controller[_0xc576('0x13')]);router['put'](_0xc576('0x9'),auth[_0xc576('0x8')](),controller[_0xc576('0x14')]);router[_0xc576('0x15')](_0xc576('0x9'),auth[_0xc576('0x8')](),controller[_0xc576('0x16')]);module[_0xc576('0x17')]=router;
\ No newline at end of file
index 88808c7..8167918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf80=['UNSIGNED','sequelize','exports','STRING','csv','DATE','Loading','ENUM','manual','scheduled','INTEGER'];(function(_0x1b7223,_0x5451a4){var _0x1aedea=function(_0x588afa){while(--_0x588afa){_0x1b7223['push'](_0x1b7223['shift']());}};_0x1aedea(++_0x5451a4);}(_0xdf80,0x6f));var _0x0df8=function(_0xcaf223,_0xd39f07){_0xcaf223=_0xcaf223-0x0;var _0x17e00d=_0xdf80[_0xcaf223];return _0x17e00d;};'use strict';var Sequelize=require(_0x0df8('0x0'));var moment=require('moment');module[_0x0df8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x0df8('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x0df8('0x3'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x0df8('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x0df8('0x4')]},'endDate':{'type':Sequelize[_0x0df8('0x4')]},'status':{'type':Sequelize[_0x0df8('0x2')],'defaultValue':_0x0df8('0x5')},'type':{'type':Sequelize[_0x0df8('0x6')](_0x0df8('0x7'),_0x0df8('0x8')),'allowNull':![],'defaultValue':_0x0df8('0x7')},'reportId':{'type':Sequelize[_0x0df8('0x9')](0xb)[_0x0df8('0xa')]},'reportType':{'type':Sequelize[_0x0df8('0x2')]}};
\ No newline at end of file
+var _0x3fd0=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED'];(function(_0x3ca454,_0x34e294){var _0x2dd303=function(_0x465890){while(--_0x465890){_0x3ca454['push'](_0x3ca454['shift']());}};_0x2dd303(++_0x34e294);}(_0x3fd0,0x144));var _0x03fd=function(_0x143559,_0x24f9b0){_0x143559=_0x143559-0x0;var _0x66b778=_0x3fd0[_0x143559];return _0x66b778;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x03fd('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x03fd('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x03fd('0x2')](_0x03fd('0x3'),_0x03fd('0x4'),_0x03fd('0x5')),'allowNull':![],'defaultValue':_0x03fd('0x3')},'savename':{'type':Sequelize[_0x03fd('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x03fd('0x6')]},'status':{'type':Sequelize[_0x03fd('0x1')],'defaultValue':_0x03fd('0x7')},'type':{'type':Sequelize[_0x03fd('0x2')]('manual',_0x03fd('0x8')),'allowNull':![],'defaultValue':_0x03fd('0x9')},'reportId':{'type':Sequelize[_0x03fd('0xa')](0xb)[_0x03fd('0xb')]},'reportType':{'type':Sequelize[_0x03fd('0x1')]}};
\ No newline at end of file
index 97c0459..5d08264 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1903=['format','%s.%s','basename','toLowerCase','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','filters','intersection','attributes','hasOwnProperty','sort','where','filter','merge','count','findAll','rows','show','params','keys','fields','includeAll','include','catch','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','root','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join'];(function(_0x235e0f,_0x349081){var _0x15c4e0=function(_0x36d764){while(--_0x36d764){_0x235e0f['push'](_0x235e0f['shift']());}};_0x15c4e0(++_0x349081);}(_0x1903,0x158));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x3190('0x0'));var emlformat=require(_0x3190('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3190('0x2'));var jsonpatch=require(_0x3190('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3190('0x4'));var Mustache=require(_0x3190('0x5'));var util=require(_0x3190('0x6'));var path=require(_0x3190('0x7'));var sox=require(_0x3190('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3190('0x9'));var squel=require(_0x3190('0xa'));var crypto=require(_0x3190('0xb'));var jsforce=require(_0x3190('0xc'));var deskjs=require(_0x3190('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3190('0xe'));var Papa=require(_0x3190('0xf'));var Redis=require(_0x3190('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3190('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3190('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3190('0x13'));var config=require(_0x3190('0x14'));var db=require(_0x3190('0x15'))['db'];function respondWithStatusCode(_0x436e41,_0x1a08cd){_0x1a08cd=_0x1a08cd||0xcc;return function(_0x25833d){if(_0x25833d){return _0x436e41[_0x3190('0x16')](_0x1a08cd);}return _0x436e41[_0x3190('0x17')](_0x1a08cd)[_0x3190('0x18')]();};}function respondWithResult(_0x40cc35,_0x1ef375){_0x1ef375=_0x1ef375||0xc8;return function(_0x15b622){if(_0x15b622){return _0x40cc35[_0x3190('0x17')](_0x1ef375)['json'](_0x15b622);}};}function respondWithFilteredResult(_0x371758,_0x71b267){return function(_0x23e15a){if(_0x23e15a){var _0x12d56a=_0x23e15a['count'],_0x4bd3fa=_0x71b267['offset'],_0x463c92=_0x71b267[_0x3190('0x19')]+_0x71b267[_0x3190('0x1a')],_0x36c52f;if(_0x463c92>=_0x12d56a){_0x463c92=_0x12d56a;_0x36c52f=0xc8;}else{_0x36c52f=0xce;}_0x371758[_0x3190('0x17')](_0x36c52f);return _0x371758[_0x3190('0x1b')]('Content-Range',_0x4bd3fa+'-'+_0x463c92+'/'+_0x12d56a)['json'](_0x23e15a);}return null;};}function patchUpdates(_0x378bfc){return function(_0xc3339c){try{jsonpatch[_0x3190('0x1c')](_0xc3339c,_0x378bfc,!![]);}catch(_0x2dfc6e){return BPromise[_0x3190('0x1d')](_0x2dfc6e);}return _0xc3339c['save']();};}function saveUpdates(_0x19307b,_0x4c4522){return function(_0x304231){if(_0x304231){return _0x304231[_0x3190('0x1e')](_0x19307b)[_0x3190('0x1f')](function(_0x46b69c){return _0x46b69c;});}return null;};}function removeEntity(_0x33fad3,_0x16bfa8){return function(_0x604f89){if(_0x604f89){return _0x604f89[_0x3190('0x20')]()[_0x3190('0x1f')](function(){var _0x3e31f8=_0x604f89[_0x3190('0x21')]({'plain':!![]});var _0x46ef5e=_0x3190('0x22');return db[_0x3190('0x23')][_0x3190('0x20')]({'where':{'type':_0x46ef5e,'resourceId':_0x3e31f8['id']}})[_0x3190('0x1f')](function(){return _0x604f89;});})['then'](function(){_0x33fad3[_0x3190('0x17')](0xcc)[_0x3190('0x18')]();});}};}function handleEntityNotFound(_0x364be4,_0x9c9bf9){return function(_0x5575e1){if(!_0x5575e1){_0x364be4[_0x3190('0x16')](0x194);}return _0x5575e1;};}function handleError(_0x55c119,_0x479356){_0x479356=_0x479356||0x1f4;return function(_0x2fe73c){logger[_0x3190('0x24')](_0x2fe73c['stack']);if(_0x2fe73c['name']){delete _0x2fe73c[_0x3190('0x25')];}_0x55c119[_0x3190('0x17')](_0x479356)[_0x3190('0x26')](_0x2fe73c);};}exports['index']=function(_0xc119ca,_0x426865){var _0x465fdd={},_0x437ed5={},_0x38fdb9={'count':0x0,'rows':[]};var _0x2fcf24=_[_0x3190('0x27')](db[_0x3190('0x28')][_0x3190('0x29')],function(_0x4ca85c){return{'name':_0x4ca85c['fieldName'],'type':_0x4ca85c[_0x3190('0x2a')][_0x3190('0x2b')]};});_0x437ed5[_0x3190('0x2c')]=_[_0x3190('0x27')](_0x2fcf24,_0x3190('0x25'));_0x437ed5[_0x3190('0x2d')]=_['keys'](_0xc119ca[_0x3190('0x2d')]);_0x437ed5[_0x3190('0x2e')]=_[_0x3190('0x2f')](_0x437ed5[_0x3190('0x2c')],_0x437ed5['query']);_0x465fdd[_0x3190('0x30')]=_[_0x3190('0x2f')](_0x437ed5['model'],qs['fields'](_0xc119ca[_0x3190('0x2d')]['fields']));_0x465fdd[_0x3190('0x30')]=_0x465fdd[_0x3190('0x30')]['length']?_0x465fdd[_0x3190('0x30')]:_0x437ed5[_0x3190('0x2c')];if(!_0xc119ca['query'][_0x3190('0x31')]('nolimit')){_0x465fdd[_0x3190('0x1a')]=qs[_0x3190('0x1a')](_0xc119ca[_0x3190('0x2d')]['limit']);_0x465fdd[_0x3190('0x19')]=qs[_0x3190('0x19')](_0xc119ca['query'][_0x3190('0x19')]);}_0x465fdd['order']=qs['sort'](_0xc119ca[_0x3190('0x2d')][_0x3190('0x32')]);_0x465fdd[_0x3190('0x33')]=qs['filters'](_['pick'](_0xc119ca[_0x3190('0x2d')],_0x437ed5[_0x3190('0x2e')]),_0x2fcf24);if(_0xc119ca['query'][_0x3190('0x34')]){_0x465fdd[_0x3190('0x33')]=_[_0x3190('0x35')](_0x465fdd[_0x3190('0x33')],{'$or':_[_0x3190('0x27')](_0x2fcf24,function(_0x3d22f1){if(_0x3d22f1['type']!=='VIRTUAL'){var _0x5e41c6={};_0x5e41c6[_0x3d22f1[_0x3190('0x25')]]={'$like':'%'+_0xc119ca[_0x3190('0x2d')][_0x3190('0x34')]+'%'};return _0x5e41c6;}})});}_0x465fdd=_[_0x3190('0x35')]({},_0x465fdd,_0xc119ca['options']);var _0x1696b8={'where':_0x465fdd[_0x3190('0x33')]};return db['AnalyticExtractedReport'][_0x3190('0x36')](_0x1696b8)[_0x3190('0x1f')](function(_0x26d8f5){_0x38fdb9[_0x3190('0x36')]=_0x26d8f5;if(_0xc119ca[_0x3190('0x2d')]['includeAll']){_0x465fdd['include']=[{'all':!![]}];}return db[_0x3190('0x28')][_0x3190('0x37')](_0x465fdd);})['then'](function(_0x41f6b4){_0x38fdb9[_0x3190('0x38')]=_0x41f6b4;return _0x38fdb9;})[_0x3190('0x1f')](respondWithFilteredResult(_0x426865,_0x465fdd))['catch'](handleError(_0x426865,null));};exports[_0x3190('0x39')]=function(_0x4e60ec,_0x486d41){var _0xa4ca77={'raw':!![],'where':{'id':_0x4e60ec[_0x3190('0x3a')]['id']}},_0x4ed21a={};_0x4ed21a[_0x3190('0x2c')]=_[_0x3190('0x3b')](db[_0x3190('0x28')][_0x3190('0x29')]);_0x4ed21a[_0x3190('0x2d')]=_['keys'](_0x4e60ec[_0x3190('0x2d')]);_0x4ed21a[_0x3190('0x2e')]=_['intersection'](_0x4ed21a[_0x3190('0x2c')],_0x4ed21a[_0x3190('0x2d')]);_0xa4ca77['attributes']=_[_0x3190('0x2f')](_0x4ed21a[_0x3190('0x2c')],qs[_0x3190('0x3c')](_0x4e60ec[_0x3190('0x2d')][_0x3190('0x3c')]));_0xa4ca77[_0x3190('0x30')]=_0xa4ca77[_0x3190('0x30')]['length']?_0xa4ca77['attributes']:_0x4ed21a[_0x3190('0x2c')];if(_0x4e60ec[_0x3190('0x2d')][_0x3190('0x3d')]){_0xa4ca77[_0x3190('0x3e')]=[{'all':!![]}];}_0xa4ca77=_[_0x3190('0x35')]({},_0xa4ca77,_0x4e60ec['options']);return db['AnalyticExtractedReport']['find'](_0xa4ca77)[_0x3190('0x1f')](handleEntityNotFound(_0x486d41,null))[_0x3190('0x1f')](respondWithResult(_0x486d41,null))[_0x3190('0x3f')](handleError(_0x486d41,null));};exports[_0x3190('0x40')]=function(_0x184233,_0x25f2ce){return db[_0x3190('0x28')][_0x3190('0x40')](_0x184233[_0x3190('0x41')],{})[_0x3190('0x1f')](function(_0x2c4b18){var _0x56106c=_0x184233[_0x3190('0x42')][_0x3190('0x21')]({'plain':!![]});if(!_0x56106c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56106c['role']===_0x3190('0x42')){var _0x586145=_0x2c4b18[_0x3190('0x21')]({'plain':!![]});var _0x10ebe7=_0x3190('0x22');return db[_0x3190('0x43')][_0x3190('0x44')]({'where':{'name':_0x10ebe7,'userProfileId':_0x56106c[_0x3190('0x45')]},'raw':!![]})['then'](function(_0x31f1b6){if(_0x31f1b6&&_0x31f1b6[_0x3190('0x46')]===0x0){return db[_0x3190('0x23')][_0x3190('0x40')]({'name':_0x586145['name'],'resourceId':_0x586145['id'],'type':_0x31f1b6[_0x3190('0x25')],'sectionId':_0x31f1b6['id']},{})[_0x3190('0x1f')](function(){return _0x2c4b18;});}else{return _0x2c4b18;}})['catch'](function(_0x24d77e){logger[_0x3190('0x24')](_0x3190('0x47'),_0x24d77e);throw _0x24d77e;});}return _0x2c4b18;})[_0x3190('0x1f')](respondWithResult(_0x25f2ce,0xc9))[_0x3190('0x3f')](handleError(_0x25f2ce,null));};exports['update']=function(_0x44fd43,_0x4f1325){if(_0x44fd43[_0x3190('0x41')]['id']){delete _0x44fd43['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x44fd43[_0x3190('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4f1325,null))[_0x3190('0x1f')](saveUpdates(_0x44fd43[_0x3190('0x41')],null))[_0x3190('0x1f')](respondWithResult(_0x4f1325,null))[_0x3190('0x3f')](handleError(_0x4f1325,null));};exports[_0x3190('0x20')]=function(_0x14be97,_0x3f42e4){return db[_0x3190('0x28')][_0x3190('0x44')]({'where':{'id':_0x14be97['params']['id']}})[_0x3190('0x1f')](handleEntityNotFound(_0x3f42e4,null))[_0x3190('0x1f')](removeEntity(_0x3f42e4,null))['catch'](handleError(_0x3f42e4,null));};exports[_0x3190('0x48')]=function(_0x408b0e,_0x2a880f,_0x180321){return db['AnalyticExtractedReport'][_0x3190('0x44')]({'where':{'id':_0x408b0e[_0x3190('0x3a')]['id']},'attributes':[_0x3190('0x25'),'basename','savename',_0x3190('0x49')],'raw':!![]})[_0x3190('0x1f')](handleEntityNotFound(_0x2a880f,null))[_0x3190('0x1f')](function(_0x188aba){if(_0x188aba){if(!fs['existsSync'](path['join'](config[_0x3190('0x4a')],'server/files/reports',_0x188aba[_0x3190('0x4b')]))){throw new db[(_0x3190('0x4c'))][(_0x3190('0x4d'))](_0x3190('0x4e'));}if(_0x408b0e['query'][_0x3190('0x4f')]){return _0x2a880f['sendStatus'](0xc8);}return _0x2a880f['download'](path[_0x3190('0x50')](config[_0x3190('0x4a')],'server/files/reports',_0x188aba[_0x3190('0x4b')]),util[_0x3190('0x51')](_0x3190('0x52'),_0x188aba[_0x3190('0x53')]||_0x188aba[_0x3190('0x25')],_0x188aba[_0x3190('0x49')][_0x3190('0x54')]()));}})[_0x3190('0x3f')](handleError(_0x2a880f,null));};
\ No newline at end of file
+var _0x5aec=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','error','stack','index','AnalyticExtractedReport','fieldName','type','key','model','map','name','keys','intersection','query','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','options','catch','create','body','ExtractedReports','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','root','format','%s.%s','toLowerCase','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x5aec,0x19a));var _0xc5ae=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5aec[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0xc5ae('0x0'));var emlformat=require(_0xc5ae('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc5ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5ae('0x3'));var moment=require('moment');var BPromise=require(_0xc5ae('0x4'));var Mustache=require(_0xc5ae('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc5ae('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc5ae('0x7'));var squel=require(_0xc5ae('0x8'));var crypto=require(_0xc5ae('0x9'));var jsforce=require(_0xc5ae('0xa'));var deskjs=require(_0xc5ae('0xb'));var toCsv=require(_0xc5ae('0x6'));var querystring=require(_0xc5ae('0xc'));var Papa=require(_0xc5ae('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5ae('0xe'));var as=require(_0xc5ae('0xf'));var hardwareService=require(_0xc5ae('0x10'));var logger=require('../../config/logger')(_0xc5ae('0x11'));var utils=require(_0xc5ae('0x12'));var config=require(_0xc5ae('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551c31,_0x1ff9d1){_0x1ff9d1=_0x1ff9d1||0xcc;return function(_0x3d0632){if(_0x3d0632){return _0x551c31[_0xc5ae('0x14')](_0x1ff9d1);}return _0x551c31[_0xc5ae('0x15')](_0x1ff9d1)[_0xc5ae('0x16')]();};}function respondWithResult(_0xd6b466,_0x102df9){_0x102df9=_0x102df9||0xc8;return function(_0x4729ad){if(_0x4729ad){return _0xd6b466['status'](_0x102df9)[_0xc5ae('0x17')](_0x4729ad);}};}function respondWithFilteredResult(_0x5d9dc8,_0x2ab8dd){return function(_0x3f6bea){if(_0x3f6bea){var _0x95e073=_0x3f6bea[_0xc5ae('0x18')],_0x2f05ae=_0x2ab8dd[_0xc5ae('0x19')],_0x480f21=_0x2ab8dd['offset']+_0x2ab8dd[_0xc5ae('0x1a')],_0x56b577;if(_0x480f21>=_0x95e073){_0x480f21=_0x95e073;_0x56b577=0xc8;}else{_0x56b577=0xce;}_0x5d9dc8[_0xc5ae('0x15')](_0x56b577);return _0x5d9dc8[_0xc5ae('0x1b')](_0xc5ae('0x1c'),_0x2f05ae+'-'+_0x480f21+'/'+_0x95e073)['json'](_0x3f6bea);}return null;};}function patchUpdates(_0x86f7e3){return function(_0x38b7b3){try{jsonpatch[_0xc5ae('0x1d')](_0x38b7b3,_0x86f7e3,!![]);}catch(_0x5aebed){return BPromise[_0xc5ae('0x1e')](_0x5aebed);}return _0x38b7b3[_0xc5ae('0x1f')]();};}function saveUpdates(_0x4d9aca,_0x2355c2){return function(_0x5e1b35){if(_0x5e1b35){return _0x5e1b35[_0xc5ae('0x20')](_0x4d9aca)['then'](function(_0x6497eb){return _0x6497eb;});}return null;};}function removeEntity(_0x244477,_0x397ad0){return function(_0x4eee0a){if(_0x4eee0a){return _0x4eee0a[_0xc5ae('0x21')]()[_0xc5ae('0x22')](function(){var _0x369935=_0x4eee0a[_0xc5ae('0x23')]({'plain':!![]});var _0x12fd57='ExtractedReports';return db['UserProfileResource'][_0xc5ae('0x21')]({'where':{'type':_0x12fd57,'resourceId':_0x369935['id']}})[_0xc5ae('0x22')](function(){return _0x4eee0a;});})['then'](function(){_0x244477['status'](0xcc)[_0xc5ae('0x16')]();});}};}function handleEntityNotFound(_0x408b72,_0x59d7df){return function(_0x4eedd7){if(!_0x4eedd7){_0x408b72[_0xc5ae('0x14')](0x194);}return _0x4eedd7;};}function handleError(_0x2ce582,_0x565c17){_0x565c17=_0x565c17||0x1f4;return function(_0x135c82){logger[_0xc5ae('0x24')](_0x135c82[_0xc5ae('0x25')]);if(_0x135c82['name']){delete _0x135c82['name'];}_0x2ce582[_0xc5ae('0x15')](_0x565c17)['send'](_0x135c82);};}exports[_0xc5ae('0x26')]=function(_0x4be3d1,_0x495235){var _0x4f9c6a={},_0x1ce6c5={},_0xae1123={'count':0x0,'rows':[]};var _0x4b843d=_['map'](db[_0xc5ae('0x27')]['rawAttributes'],function(_0x14115b){return{'name':_0x14115b[_0xc5ae('0x28')],'type':_0x14115b[_0xc5ae('0x29')][_0xc5ae('0x2a')]};});_0x1ce6c5[_0xc5ae('0x2b')]=_[_0xc5ae('0x2c')](_0x4b843d,_0xc5ae('0x2d'));_0x1ce6c5['query']=_[_0xc5ae('0x2e')](_0x4be3d1['query']);_0x1ce6c5['filters']=_[_0xc5ae('0x2f')](_0x1ce6c5[_0xc5ae('0x2b')],_0x1ce6c5[_0xc5ae('0x30')]);_0x4f9c6a[_0xc5ae('0x31')]=_[_0xc5ae('0x2f')](_0x1ce6c5[_0xc5ae('0x2b')],qs[_0xc5ae('0x32')](_0x4be3d1[_0xc5ae('0x30')][_0xc5ae('0x32')]));_0x4f9c6a[_0xc5ae('0x31')]=_0x4f9c6a[_0xc5ae('0x31')][_0xc5ae('0x33')]?_0x4f9c6a[_0xc5ae('0x31')]:_0x1ce6c5[_0xc5ae('0x2b')];if(!_0x4be3d1['query']['hasOwnProperty'](_0xc5ae('0x34'))){_0x4f9c6a[_0xc5ae('0x1a')]=qs[_0xc5ae('0x1a')](_0x4be3d1[_0xc5ae('0x30')][_0xc5ae('0x1a')]);_0x4f9c6a[_0xc5ae('0x19')]=qs['offset'](_0x4be3d1[_0xc5ae('0x30')]['offset']);}_0x4f9c6a['order']=qs[_0xc5ae('0x35')](_0x4be3d1[_0xc5ae('0x30')][_0xc5ae('0x35')]);_0x4f9c6a[_0xc5ae('0x36')]=qs[_0xc5ae('0x37')](_['pick'](_0x4be3d1[_0xc5ae('0x30')],_0x1ce6c5[_0xc5ae('0x37')]),_0x4b843d);if(_0x4be3d1[_0xc5ae('0x30')][_0xc5ae('0x38')]){_0x4f9c6a[_0xc5ae('0x36')]=_[_0xc5ae('0x39')](_0x4f9c6a[_0xc5ae('0x36')],{'$or':_[_0xc5ae('0x2c')](_0x4b843d,function(_0x403d13){if(_0x403d13[_0xc5ae('0x29')]!==_0xc5ae('0x3a')){var _0x5dd546={};_0x5dd546[_0x403d13[_0xc5ae('0x2d')]]={'$like':'%'+_0x4be3d1['query']['filter']+'%'};return _0x5dd546;}})});}_0x4f9c6a=_[_0xc5ae('0x39')]({},_0x4f9c6a,_0x4be3d1['options']);var _0x49cf10={'where':_0x4f9c6a['where']};return db['AnalyticExtractedReport']['count'](_0x49cf10)['then'](function(_0x2e0536){_0xae1123['count']=_0x2e0536;if(_0x4be3d1['query'][_0xc5ae('0x3b')]){_0x4f9c6a[_0xc5ae('0x3c')]=[{'all':!![]}];}return db[_0xc5ae('0x27')][_0xc5ae('0x3d')](_0x4f9c6a);})[_0xc5ae('0x22')](function(_0xd810d2){_0xae1123[_0xc5ae('0x3e')]=_0xd810d2;return _0xae1123;})['then'](respondWithFilteredResult(_0x495235,_0x4f9c6a))['catch'](handleError(_0x495235,null));};exports['show']=function(_0x33e21,_0x25c41d){var _0x5f05c8={'raw':!![],'where':{'id':_0x33e21['params']['id']}},_0x57d350={};_0x57d350['model']=_['keys'](db[_0xc5ae('0x27')]['rawAttributes']);_0x57d350[_0xc5ae('0x30')]=_[_0xc5ae('0x2e')](_0x33e21['query']);_0x57d350[_0xc5ae('0x37')]=_[_0xc5ae('0x2f')](_0x57d350[_0xc5ae('0x2b')],_0x57d350[_0xc5ae('0x30')]);_0x5f05c8['attributes']=_[_0xc5ae('0x2f')](_0x57d350[_0xc5ae('0x2b')],qs[_0xc5ae('0x32')](_0x33e21[_0xc5ae('0x30')][_0xc5ae('0x32')]));_0x5f05c8['attributes']=_0x5f05c8[_0xc5ae('0x31')][_0xc5ae('0x33')]?_0x5f05c8[_0xc5ae('0x31')]:_0x57d350['model'];if(_0x33e21[_0xc5ae('0x30')][_0xc5ae('0x3b')]){_0x5f05c8['include']=[{'all':!![]}];}_0x5f05c8=_['merge']({},_0x5f05c8,_0x33e21[_0xc5ae('0x3f')]);return db[_0xc5ae('0x27')]['find'](_0x5f05c8)[_0xc5ae('0x22')](handleEntityNotFound(_0x25c41d,null))[_0xc5ae('0x22')](respondWithResult(_0x25c41d,null))[_0xc5ae('0x40')](handleError(_0x25c41d,null));};exports[_0xc5ae('0x41')]=function(_0x3d0de9,_0x5ae1d3){return db[_0xc5ae('0x27')][_0xc5ae('0x41')](_0x3d0de9[_0xc5ae('0x42')],{})[_0xc5ae('0x22')](function(_0x4c24d8){var _0x5a9344=_0x3d0de9['user'][_0xc5ae('0x23')]({'plain':!![]});if(!_0x5a9344)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a9344['role']==='user'){var _0x1f100e=_0x4c24d8[_0xc5ae('0x23')]({'plain':!![]});var _0x5979b1=_0xc5ae('0x43');return db[_0xc5ae('0x44')][_0xc5ae('0x45')]({'where':{'name':_0x5979b1,'userProfileId':_0x5a9344[_0xc5ae('0x46')]},'raw':!![]})[_0xc5ae('0x22')](function(_0x1aaa5){if(_0x1aaa5&&_0x1aaa5['autoAssociation']===0x0){return db[_0xc5ae('0x47')][_0xc5ae('0x41')]({'name':_0x1f100e[_0xc5ae('0x2d')],'resourceId':_0x1f100e['id'],'type':_0x1aaa5[_0xc5ae('0x2d')],'sectionId':_0x1aaa5['id']},{})[_0xc5ae('0x22')](function(){return _0x4c24d8;});}else{return _0x4c24d8;}})[_0xc5ae('0x40')](function(_0x391ae6){logger['error'](_0xc5ae('0x48'),_0x391ae6);throw _0x391ae6;});}return _0x4c24d8;})[_0xc5ae('0x22')](respondWithResult(_0x5ae1d3,0xc9))[_0xc5ae('0x40')](handleError(_0x5ae1d3,null));};exports[_0xc5ae('0x20')]=function(_0x19ca05,_0x43532f){if(_0x19ca05['body']['id']){delete _0x19ca05[_0xc5ae('0x42')]['id'];}return db[_0xc5ae('0x27')][_0xc5ae('0x45')]({'where':{'id':_0x19ca05[_0xc5ae('0x49')]['id']}})['then'](handleEntityNotFound(_0x43532f,null))[_0xc5ae('0x22')](saveUpdates(_0x19ca05[_0xc5ae('0x42')],null))[_0xc5ae('0x22')](respondWithResult(_0x43532f,null))[_0xc5ae('0x40')](handleError(_0x43532f,null));};exports['destroy']=function(_0x23ce62,_0x283b4e){return db[_0xc5ae('0x27')]['find']({'where':{'id':_0x23ce62['params']['id']}})[_0xc5ae('0x22')](handleEntityNotFound(_0x283b4e,null))[_0xc5ae('0x22')](removeEntity(_0x283b4e,null))[_0xc5ae('0x40')](handleError(_0x283b4e,null));};exports[_0xc5ae('0x4a')]=function(_0x359bcd,_0x45c81a,_0xb8b803){return db[_0xc5ae('0x27')]['find']({'where':{'id':_0x359bcd[_0xc5ae('0x49')]['id']},'attributes':[_0xc5ae('0x2d'),_0xc5ae('0x4b'),_0xc5ae('0x4c'),_0xc5ae('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x45c81a,null))['then'](function(_0x3357ed){if(_0x3357ed){if(!fs['existsSync'](path[_0xc5ae('0x4e')](config['root'],_0xc5ae('0x4f'),_0x3357ed[_0xc5ae('0x4c')]))){throw new db['Sequelize'][(_0xc5ae('0x50'))](_0xc5ae('0x51'));}if(_0x359bcd[_0xc5ae('0x30')]['exists']){return _0x45c81a[_0xc5ae('0x14')](0xc8);}return _0x45c81a['download'](path[_0xc5ae('0x4e')](config[_0xc5ae('0x52')],'server/files/reports',_0x3357ed[_0xc5ae('0x4c')]),util[_0xc5ae('0x53')](_0xc5ae('0x54'),_0x3357ed[_0xc5ae('0x4b')]||_0x3357ed[_0xc5ae('0x2d')],_0x3357ed[_0xc5ae('0x4d')][_0xc5ae('0x55')]()));}})['catch'](handleError(_0x45c81a,null));};
\ No newline at end of file
index 12b56ca..8864ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb96e=['exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','path','./analyticExtractedReport.attributes'];(function(_0x350b1d,_0x164714){var _0x1b4cb2=function(_0x5477b9){while(--_0x5477b9){_0x350b1d['push'](_0x350b1d['shift']());}};_0x1b4cb2(++_0x164714);}(_0xb96e,0x1e7));var _0xeb96=function(_0x49e279,_0x504953){_0x49e279=_0x49e279-0x0;var _0x340d57=_0xb96e[_0x49e279];return _0x340d57;};'use strict';var _=require(_0xeb96('0x0'));var util=require(_0xeb96('0x1'));var logger=require(_0xeb96('0x2'))(_0xeb96('0x3'));var moment=require(_0xeb96('0x4'));var BPromise=require(_0xeb96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb96('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb96('0x7'));module[_0xeb96('0x8')]=function(_0xf91576,_0x182d7f){return _0xf91576['define'](_0xeb96('0x9'),attributes,{'tableName':_0xeb96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd07f=['./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','api','moment','bluebird','request-promise'];(function(_0x187b69,_0x4c0cbc){var _0x4afabc=function(_0x1d34c1){while(--_0x1d34c1){_0x187b69['push'](_0x187b69['shift']());}};_0x4afabc(++_0x4c0cbc);}(_0xd07f,0xdc));var _0xfd07=function(_0x550352,_0x54a823){_0x550352=_0x550352-0x0;var _0x551f23=_0xd07f[_0x550352];return _0x551f23;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xfd07('0x0'));var moment=require(_0xfd07('0x1'));var BPromise=require(_0xfd07('0x2'));var rp=require(_0xfd07('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd07('0x4'));module['exports']=function(_0x3610f9,_0x74e224){return _0x3610f9[_0xfd07('0x5')](_0xfd07('0x6'),attributes,{'tableName':_0xfd07('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 686fdc1..a721f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb5a=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0xbb5a,0x1cc));var _0xabb5=function(_0x4cd864,_0x22afcb){_0x4cd864=_0x4cd864-0x0;var _0x165565=_0xbb5a[_0x4cd864];return _0x165565;};'use strict';var _=require('lodash');var util=require(_0xabb5('0x0'));var moment=require(_0xabb5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabb5('0x2'));var db=require(_0xabb5('0x3'))['db'];var utils=require(_0xabb5('0x4'));var logger=require(_0xabb5('0x5'))(_0xabb5('0x6'));var config=require(_0xabb5('0x7'));var jayson=require(_0xabb5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee943,_0x346120,_0x4379e6){return new BPromise(function(_0x3f812d,_0x136aa5){return client[_0xabb5('0x9')](_0x3ee943,_0x4379e6)['then'](function(_0x33acf0){logger[_0xabb5('0xa')](_0xabb5('0xb'),_0x346120,_0xabb5('0xc'));logger[_0xabb5('0xd')](_0xabb5('0xe'),_0x346120,_0xabb5('0xc'),JSON[_0xabb5('0xf')](_0x33acf0));if(_0x33acf0[_0xabb5('0x10')]){if(_0x33acf0[_0xabb5('0x10')][_0xabb5('0x11')]===0x1f4){logger[_0xabb5('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x346120,_0x33acf0['error'][_0xabb5('0x12')]);return _0x136aa5(_0x33acf0['error']['message']);}logger[_0xabb5('0x10')](_0xabb5('0xb'),_0x346120,_0x33acf0[_0xabb5('0x10')]['message']);return _0x3f812d(_0x33acf0[_0xabb5('0x10')]['message']);}else{logger[_0xabb5('0xa')](_0xabb5('0xb'),_0x346120,_0xabb5('0xc'));_0x3f812d(_0x33acf0['result'][_0xabb5('0x12')]);}})[_0xabb5('0x13')](function(_0x2e5c11){logger[_0xabb5('0x10')](_0xabb5('0xb'),_0x346120,_0x2e5c11);_0x136aa5(_0x2e5c11);});});}
\ No newline at end of file
+var _0xca76=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x13932d,_0xf930d3){var _0x1a7b81=function(_0x5c7b67){while(--_0x5c7b67){_0x13932d['push'](_0x13932d['shift']());}};_0x1a7b81(++_0xf930d3);}(_0xca76,0x122));var _0x6ca7=function(_0x4a8081,_0x40aaf9){_0x4a8081=_0x4a8081-0x0;var _0x1808bc=_0xca76[_0x4a8081];return _0x1808bc;};'use strict';var _=require(_0x6ca7('0x0'));var util=require(_0x6ca7('0x1'));var moment=require(_0x6ca7('0x2'));var BPromise=require(_0x6ca7('0x3'));var rs=require(_0x6ca7('0x4'));var fs=require('fs');var Redis=require(_0x6ca7('0x5'));var db=require(_0x6ca7('0x6'))['db'];var utils=require(_0x6ca7('0x7'));var logger=require(_0x6ca7('0x8'))(_0x6ca7('0x9'));var config=require(_0x6ca7('0xa'));var jayson=require(_0x6ca7('0xb'));var client=jayson[_0x6ca7('0xc')][_0x6ca7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1b40df,_0x4bd6f6,_0x28a00e){return new BPromise(function(_0x5ae159,_0x420831){return client['request'](_0x1b40df,_0x28a00e)[_0x6ca7('0xe')](function(_0xd0d2df){logger[_0x6ca7('0xf')](_0x6ca7('0x10'),_0x4bd6f6,_0x6ca7('0x11'));logger[_0x6ca7('0x12')](_0x6ca7('0x13'),_0x4bd6f6,_0x6ca7('0x11'),JSON[_0x6ca7('0x14')](_0xd0d2df));if(_0xd0d2df[_0x6ca7('0x15')]){if(_0xd0d2df['error'][_0x6ca7('0x16')]===0x1f4){logger['error'](_0x6ca7('0x10'),_0x4bd6f6,_0xd0d2df['error'][_0x6ca7('0x17')]);return _0x420831(_0xd0d2df['error']['message']);}logger[_0x6ca7('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4bd6f6,_0xd0d2df['error'][_0x6ca7('0x17')]);return _0x5ae159(_0xd0d2df[_0x6ca7('0x15')][_0x6ca7('0x17')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4bd6f6,_0x6ca7('0x11'));_0x5ae159(_0xd0d2df[_0x6ca7('0x18')][_0x6ca7('0x17')]);}})[_0x6ca7('0x19')](function(_0x155fb3){logger[_0x6ca7('0x15')](_0x6ca7('0x10'),_0x4bd6f6,_0x155fb3);_0x420831(_0x155fb3);});});}
\ No newline at end of file
index e080ee3..73e7d00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88e9=['express','Router','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','destroy','exports','path','connect-timeout'];(function(_0x305001,_0x2e4db6){var _0x1ea154=function(_0x22b023){while(--_0x22b023){_0x305001['push'](_0x305001['shift']());}};_0x1ea154(++_0x2e4db6);}(_0x88e9,0x141));var _0x988e=function(_0x43e67b,_0x4d7187){_0x43e67b=_0x43e67b-0x0;var _0x47b5bc=_0x88e9[_0x43e67b];return _0x47b5bc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x988e('0x0'));var timeout=require(_0x988e('0x1'));var express=require(_0x988e('0x2'));var router=express[_0x988e('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x988e('0x4'));var controller=require(_0x988e('0x5'));router[_0x988e('0x6')]('/',auth[_0x988e('0x7')](),controller[_0x988e('0x8')]);router['get']('/:id',auth[_0x988e('0x7')](),controller[_0x988e('0x9')]);router[_0x988e('0x6')](_0x988e('0xa'),auth[_0x988e('0x7')](),controller[_0x988e('0xb')]);router[_0x988e('0xc')]('/',auth[_0x988e('0x7')](),controller[_0x988e('0xd')]);router[_0x988e('0xe')](_0x988e('0xf'),auth[_0x988e('0x7')](),controller[_0x988e('0x10')]);router['delete']('/:id',auth[_0x988e('0x7')](),controller[_0x988e('0x11')]);module[_0x988e('0x12')]=router;
\ No newline at end of file
+var _0x7615=['download','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x7615,0xec));var _0x5761=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x7615[_0x5c4f6b];return _0x104c4e;};'use strict';var multer=require(_0x5761('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5761('0x1'));var express=require('express');var router=express[_0x5761('0x2')]();var auth=require(_0x5761('0x3'));var interaction=require(_0x5761('0x4'));var config=require(_0x5761('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x5761('0x6')]('/',auth[_0x5761('0x7')](),controller[_0x5761('0x8')]);router[_0x5761('0x6')](_0x5761('0x9'),auth[_0x5761('0x7')](),controller['show']);router[_0x5761('0x6')](_0x5761('0xa'),auth[_0x5761('0x7')](),controller[_0x5761('0xb')]);router[_0x5761('0xc')]('/',auth[_0x5761('0x7')](),controller[_0x5761('0xd')]);router[_0x5761('0xe')](_0x5761('0x9'),auth[_0x5761('0x7')](),controller[_0x5761('0xf')]);router[_0x5761('0x10')]('/:id',auth[_0x5761('0x7')](),controller[_0x5761('0x11')]);module[_0x5761('0x12')]=router;
\ No newline at end of file
index 4a361be..6613e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x431c02,_0x5144de){var _0x57750f=function(_0x2366a3){while(--_0x2366a3){_0x431c02['push'](_0x431c02['shift']());}};_0x57750f(++_0x5144de);}(_0x7217,0x19e));var _0x7721=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x7217[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'field':{'type':Sequelize[_0x7721('0x1')]},'alias':{'type':Sequelize[_0x7721('0x2')]},'function':{'type':Sequelize[_0x7721('0x2')]},'format':{'type':Sequelize[_0x7721('0x2')]},'groupBy':{'type':Sequelize[_0x7721('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x7217=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x4009ce,_0x5c7a5a){var _0x4d60aa=function(_0x60b7be){while(--_0x60b7be){_0x4009ce['push'](_0x4009ce['shift']());}};_0x4d60aa(++_0x5c7a5a);}(_0x7217,0x19e));var _0x7721=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x7217[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'field':{'type':Sequelize[_0x7721('0x1')]},'alias':{'type':Sequelize[_0x7721('0x2')]},'function':{'type':Sequelize[_0x7721('0x2')]},'format':{'type':Sequelize[_0x7721('0x2')]},'groupBy':{'type':Sequelize[_0x7721('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index ccc3c90..5320864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ffa=['send','index','AnalyticFieldReport','rawAttributes','type','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','keys','filters','includeAll','merge','find','create','body','bulkCreate','params','addFields','sequelize','CustomReportId','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','destroy','then','error','stack','name'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x2ffa,0x16e));var _0xa2ff=function(_0x1ae1db,_0x11a203){_0x1ae1db=_0x1ae1db-0x0;var _0x4438cb=_0x2ffa[_0x1ae1db];return _0x4438cb;};'use strict';var pdf=require(_0xa2ff('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2ff('0x1'));var rp=require(_0xa2ff('0x2'));var moment=require(_0xa2ff('0x3'));var BPromise=require(_0xa2ff('0x4'));var Mustache=require(_0xa2ff('0x5'));var util=require(_0xa2ff('0x6'));var path=require(_0xa2ff('0x7'));var sox=require(_0xa2ff('0x8'));var csv=require('to-csv');var ejs=require(_0xa2ff('0x9'));var fs=require('fs');var _=require(_0xa2ff('0xa'));var squel=require(_0xa2ff('0xb'));var crypto=require(_0xa2ff('0xc'));var jsforce=require(_0xa2ff('0xd'));var deskjs=require(_0xa2ff('0xe'));var toCsv=require(_0xa2ff('0xf'));var querystring=require(_0xa2ff('0x10'));var Papa=require(_0xa2ff('0x11'));var Redis=require(_0xa2ff('0x12'));var authService=require(_0xa2ff('0x13'));var qs=require(_0xa2ff('0x14'));var as=require(_0xa2ff('0x15'));var hardwareService=require(_0xa2ff('0x16'));var logger=require(_0xa2ff('0x17'))(_0xa2ff('0x18'));var utils=require(_0xa2ff('0x19'));var config=require(_0xa2ff('0x1a'));var db=require(_0xa2ff('0x1b'))['db'];function respondWithStatusCode(_0x46faf1,_0x26e876){_0x26e876=_0x26e876||0xcc;return function(_0x2a5b0f){if(_0x2a5b0f){return _0x46faf1[_0xa2ff('0x1c')](_0x26e876);}return _0x46faf1[_0xa2ff('0x1d')](_0x26e876)[_0xa2ff('0x1e')]();};}function respondWithResult(_0x596227,_0x5e3720){_0x5e3720=_0x5e3720||0xc8;return function(_0x42e074){if(_0x42e074){return _0x596227[_0xa2ff('0x1d')](_0x5e3720)['json'](_0x42e074);}};}function respondWithFilteredResult(_0x3eca92,_0x31923c){return function(_0x48d2a0){if(_0x48d2a0){var _0x4f922d=_0x48d2a0[_0xa2ff('0x1f')],_0x24f4d2=_0x31923c[_0xa2ff('0x20')],_0x360fca=_0x31923c[_0xa2ff('0x20')]+_0x31923c['limit'],_0x4e7322;if(_0x360fca>=_0x4f922d){_0x360fca=_0x4f922d;_0x4e7322=0xc8;}else{_0x4e7322=0xce;}_0x3eca92[_0xa2ff('0x1d')](_0x4e7322);return _0x3eca92[_0xa2ff('0x21')]('Content-Range',_0x24f4d2+'-'+_0x360fca+'/'+_0x4f922d)[_0xa2ff('0x22')](_0x48d2a0);}return null;};}function patchUpdates(_0x1e87c4){return function(_0x21c075){try{jsonpatch[_0xa2ff('0x23')](_0x21c075,_0x1e87c4,!![]);}catch(_0x40aa80){return BPromise[_0xa2ff('0x24')](_0x40aa80);}return _0x21c075[_0xa2ff('0x25')]();};}function saveUpdates(_0xd28e39,_0x2494c5){return function(_0x2361c1){if(_0x2361c1){return _0x2361c1[_0xa2ff('0x26')](_0xd28e39)['then'](function(_0x2a9020){return _0x2a9020;});}return null;};}function removeEntity(_0x2dad0a,_0x1a0502){return function(_0x1ae1fc){if(_0x1ae1fc){return _0x1ae1fc[_0xa2ff('0x27')]()[_0xa2ff('0x28')](function(){_0x2dad0a[_0xa2ff('0x1d')](0xcc)[_0xa2ff('0x1e')]();});}};}function handleEntityNotFound(_0x229e42,_0x418369){return function(_0x4ee337){if(!_0x4ee337){_0x229e42[_0xa2ff('0x1c')](0x194);}return _0x4ee337;};}function handleError(_0x248fe3,_0x4d514a){_0x4d514a=_0x4d514a||0x1f4;return function(_0x2eddaa){logger[_0xa2ff('0x29')](_0x2eddaa[_0xa2ff('0x2a')]);if(_0x2eddaa[_0xa2ff('0x2b')]){delete _0x2eddaa['name'];}_0x248fe3[_0xa2ff('0x1d')](_0x4d514a)[_0xa2ff('0x2c')](_0x2eddaa);};}exports[_0xa2ff('0x2d')]=function(_0x1e6109,_0x3ea503){var _0x574ae3={},_0x5f5ab7={},_0x5807fe={'count':0x0,'rows':[]};var _0x459ca9=_['map'](db[_0xa2ff('0x2e')][_0xa2ff('0x2f')],function(_0x160025){return{'name':_0x160025['fieldName'],'type':_0x160025[_0xa2ff('0x30')]['key']};});_0x5f5ab7[_0xa2ff('0x31')]=_[_0xa2ff('0x32')](_0x459ca9,'name');_0x5f5ab7['query']=_['keys'](_0x1e6109[_0xa2ff('0x33')]);_0x5f5ab7['filters']=_[_0xa2ff('0x34')](_0x5f5ab7['model'],_0x5f5ab7['query']);_0x574ae3['attributes']=_[_0xa2ff('0x34')](_0x5f5ab7['model'],qs[_0xa2ff('0x35')](_0x1e6109['query'][_0xa2ff('0x35')]));_0x574ae3[_0xa2ff('0x36')]=_0x574ae3['attributes']['length']?_0x574ae3['attributes']:_0x5f5ab7['model'];if(!_0x1e6109['query'][_0xa2ff('0x37')](_0xa2ff('0x38'))){_0x574ae3['limit']=qs[_0xa2ff('0x39')](_0x1e6109[_0xa2ff('0x33')][_0xa2ff('0x39')]);_0x574ae3[_0xa2ff('0x20')]=qs[_0xa2ff('0x20')](_0x1e6109[_0xa2ff('0x33')][_0xa2ff('0x20')]);}_0x574ae3[_0xa2ff('0x3a')]=qs[_0xa2ff('0x3b')](_0x1e6109['query'][_0xa2ff('0x3b')]);_0x574ae3[_0xa2ff('0x3c')]=qs['filters'](_[_0xa2ff('0x3d')](_0x1e6109[_0xa2ff('0x33')],_0x5f5ab7['filters']),_0x459ca9);if(_0x1e6109[_0xa2ff('0x33')][_0xa2ff('0x3e')]){_0x574ae3[_0xa2ff('0x3c')]=_['merge'](_0x574ae3[_0xa2ff('0x3c')],{'$or':_[_0xa2ff('0x32')](_0x459ca9,function(_0x28e12d){if(_0x28e12d[_0xa2ff('0x30')]!==_0xa2ff('0x3f')){var _0x5578e4={};_0x5578e4[_0x28e12d[_0xa2ff('0x2b')]]={'$like':'%'+_0x1e6109[_0xa2ff('0x33')]['filter']+'%'};return _0x5578e4;}})});}_0x574ae3=_['merge']({},_0x574ae3,_0x1e6109[_0xa2ff('0x40')]);var _0x56e330={'where':_0x574ae3[_0xa2ff('0x3c')]};return db[_0xa2ff('0x2e')]['count'](_0x56e330)['then'](function(_0x1fea17){_0x5807fe[_0xa2ff('0x1f')]=_0x1fea17;if(_0x1e6109[_0xa2ff('0x33')]['includeAll']){_0x574ae3[_0xa2ff('0x41')]=[{'all':!![]}];}return db[_0xa2ff('0x2e')][_0xa2ff('0x42')](_0x574ae3);})['then'](function(_0xf025b7){_0x5807fe[_0xa2ff('0x43')]=_0xf025b7;return _0x5807fe;})[_0xa2ff('0x28')](respondWithFilteredResult(_0x3ea503,_0x574ae3))[_0xa2ff('0x44')](handleError(_0x3ea503,null));};exports[_0xa2ff('0x45')]=function(_0x4a2c66,_0x568b28){var _0x4074c4={'raw':![],'where':{'id':_0x4a2c66['params']['id']}},_0x483ffa={};_0x483ffa['model']=_[_0xa2ff('0x46')](db['AnalyticFieldReport']['rawAttributes']);_0x483ffa[_0xa2ff('0x33')]=_[_0xa2ff('0x46')](_0x4a2c66['query']);_0x483ffa[_0xa2ff('0x47')]=_[_0xa2ff('0x34')](_0x483ffa[_0xa2ff('0x31')],_0x483ffa[_0xa2ff('0x33')]);_0x4074c4[_0xa2ff('0x36')]=_[_0xa2ff('0x34')](_0x483ffa['model'],qs[_0xa2ff('0x35')](_0x4a2c66[_0xa2ff('0x33')][_0xa2ff('0x35')]));_0x4074c4[_0xa2ff('0x36')]=_0x4074c4['attributes']['length']?_0x4074c4['attributes']:_0x483ffa[_0xa2ff('0x31')];if(_0x4a2c66[_0xa2ff('0x33')][_0xa2ff('0x48')]){_0x4074c4[_0xa2ff('0x41')]=[{'all':!![]}];}_0x4074c4=_[_0xa2ff('0x49')]({},_0x4074c4,_0x4a2c66[_0xa2ff('0x40')]);return db['AnalyticFieldReport'][_0xa2ff('0x4a')](_0x4074c4)[_0xa2ff('0x28')](handleEntityNotFound(_0x568b28,null))[_0xa2ff('0x28')](respondWithResult(_0x568b28,null))[_0xa2ff('0x44')](handleError(_0x568b28,null));};exports[_0xa2ff('0x4b')]=function(_0x43c02b,_0x18bd58){return db[_0xa2ff('0x2e')][_0xa2ff('0x4b')](_0x43c02b[_0xa2ff('0x4c')],{})[_0xa2ff('0x28')](respondWithResult(_0x18bd58,0xc9))['catch'](handleError(_0x18bd58,null));};exports['bulkCreate']=function(_0x9cdce,_0x955924){return db[_0xa2ff('0x2e')][_0xa2ff('0x4d')](_0x9cdce[_0xa2ff('0x4c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x955924,0xc9))[_0xa2ff('0x44')](handleError(_0x955924,null));};exports[_0xa2ff('0x26')]=function(_0x1af0d5,_0x548d09){if(_0x1af0d5[_0xa2ff('0x4c')]['id']){delete _0x1af0d5[_0xa2ff('0x4c')]['id'];}return db[_0xa2ff('0x2e')]['find']({'where':{'id':_0x1af0d5[_0xa2ff('0x4e')]['id']}})[_0xa2ff('0x28')](handleEntityNotFound(_0x548d09,null))[_0xa2ff('0x28')](saveUpdates(_0x1af0d5[_0xa2ff('0x4c')],null))[_0xa2ff('0x28')](respondWithResult(_0x548d09,null))[_0xa2ff('0x44')](handleError(_0x548d09,null));};exports['destroy']=function(_0x4db906,_0x1cf20a){return db['AnalyticFieldReport'][_0xa2ff('0x4a')]({'where':{'id':_0x4db906[_0xa2ff('0x4e')]['id']}})[_0xa2ff('0x28')](handleEntityNotFound(_0x1cf20a,null))['then'](removeEntity(_0x1cf20a,null))[_0xa2ff('0x44')](handleError(_0x1cf20a,null));};exports['bulkDestroy']=function(_0x5af896,_0x41b248){return db[_0xa2ff('0x2e')][_0xa2ff('0x27')]({'where':{'id':_0x5af896['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xa2ff('0x28')](respondWithResult(_0x41b248,0xcc))[_0xa2ff('0x44')](handleError(_0x41b248,null));};exports[_0xa2ff('0x4f')]=function(_0x51e4a9,_0x259671,_0x138de6){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x51e4a9[_0xa2ff('0x4e')]['id']}})[_0xa2ff('0x28')](handleEntityNotFound(_0x259671,null))['then'](function(_0x16facf){if(_0x16facf){return db[_0xa2ff('0x50')]['transaction'](function(_0x51fc46){return db[_0xa2ff('0x2e')][_0xa2ff('0x27')]({'where':{'CustomReportId':_0x51e4a9[_0xa2ff('0x4e')]['id']},'transaction':_0x51fc46})[_0xa2ff('0x28')](function(_0x14c4a0){var _0x9b2e1e=_[_0xa2ff('0x32')](_0x51e4a9[_0xa2ff('0x4c')],function(_0x3adaf9){delete _0x3adaf9['id'];_0x3adaf9[_0xa2ff('0x51')]=_0x51e4a9['params']['id'];return _0x3adaf9;});return db[_0xa2ff('0x2e')][_0xa2ff('0x4d')](_0x9b2e1e,{'transaction':_0x51fc46});});})['then'](function(){return db[_0xa2ff('0x2e')][_0xa2ff('0x42')]({'where':{'CustomReportId':_0x51e4a9['params']['id']}});});}})[_0xa2ff('0x28')](respondWithResult(_0x259671,null))[_0xa2ff('0x44')](handleError(_0x259671,null));};
\ No newline at end of file
+var _0x0223=['findAll','catch','show','params','fields','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','map','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticFieldReport','includeAll','include'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0223,0xaf));var _0x3022=function(_0x5f4952,_0x1a31f4){_0x5f4952=_0x5f4952-0x0;var _0x2e54a1=_0x0223[_0x5f4952];return _0x2e54a1;};'use strict';var pdf=require(_0x3022('0x0'));var emlformat=require(_0x3022('0x1'));var rimraf=require(_0x3022('0x2'));var zipdir=require(_0x3022('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3022('0x4'));var moment=require(_0x3022('0x5'));var BPromise=require(_0x3022('0x6'));var Mustache=require(_0x3022('0x7'));var util=require(_0x3022('0x8'));var path=require(_0x3022('0x9'));var sox=require(_0x3022('0xa'));var csv=require(_0x3022('0xb'));var ejs=require(_0x3022('0xc'));var fs=require('fs');var _=require(_0x3022('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3022('0xe'));var toCsv=require(_0x3022('0xb'));var querystring=require('querystring');var Papa=require(_0x3022('0xf'));var Redis=require(_0x3022('0x10'));var authService=require(_0x3022('0x11'));var qs=require(_0x3022('0x12'));var as=require(_0x3022('0x13'));var hardwareService=require(_0x3022('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3022('0x15'));var config=require('../../config/environment');var db=require(_0x3022('0x16'))['db'];function respondWithStatusCode(_0x49e4c2,_0x21f87f){_0x21f87f=_0x21f87f||0xcc;return function(_0x15caeb){if(_0x15caeb){return _0x49e4c2[_0x3022('0x17')](_0x21f87f);}return _0x49e4c2[_0x3022('0x18')](_0x21f87f)[_0x3022('0x19')]();};}function respondWithResult(_0xe0d010,_0x510c3a){_0x510c3a=_0x510c3a||0xc8;return function(_0x23d6fc){if(_0x23d6fc){return _0xe0d010[_0x3022('0x18')](_0x510c3a)['json'](_0x23d6fc);}};}function respondWithFilteredResult(_0x401b86,_0x4b79af){return function(_0x1d5fd9){if(_0x1d5fd9){var _0x3dd72e=_0x1d5fd9[_0x3022('0x1a')],_0x55cedb=_0x4b79af[_0x3022('0x1b')],_0xd628c3=_0x4b79af['offset']+_0x4b79af[_0x3022('0x1c')],_0x5cf5f7;if(_0xd628c3>=_0x3dd72e){_0xd628c3=_0x3dd72e;_0x5cf5f7=0xc8;}else{_0x5cf5f7=0xce;}_0x401b86[_0x3022('0x18')](_0x5cf5f7);return _0x401b86['set'](_0x3022('0x1d'),_0x55cedb+'-'+_0xd628c3+'/'+_0x3dd72e)[_0x3022('0x1e')](_0x1d5fd9);}return null;};}function patchUpdates(_0x40267e){return function(_0x26d806){try{jsonpatch[_0x3022('0x1f')](_0x26d806,_0x40267e,!![]);}catch(_0x5811cf){return BPromise['reject'](_0x5811cf);}return _0x26d806[_0x3022('0x20')]();};}function saveUpdates(_0x29a69d,_0x5e81d1){return function(_0x404dfb){if(_0x404dfb){return _0x404dfb[_0x3022('0x21')](_0x29a69d)[_0x3022('0x22')](function(_0x79880d){return _0x79880d;});}return null;};}function removeEntity(_0x5c63f7,_0x32a945){return function(_0x53947c){if(_0x53947c){return _0x53947c[_0x3022('0x23')]()['then'](function(){_0x5c63f7[_0x3022('0x18')](0xcc)[_0x3022('0x19')]();});}};}function handleEntityNotFound(_0x49da67,_0x4af23a){return function(_0xd7d37){if(!_0xd7d37){_0x49da67[_0x3022('0x17')](0x194);}return _0xd7d37;};}function handleError(_0x4f7756,_0x2268fa){_0x2268fa=_0x2268fa||0x1f4;return function(_0x3af8d6){logger[_0x3022('0x24')](_0x3af8d6['stack']);if(_0x3af8d6[_0x3022('0x25')]){delete _0x3af8d6[_0x3022('0x25')];}_0x4f7756[_0x3022('0x18')](_0x2268fa)[_0x3022('0x26')](_0x3af8d6);};}exports[_0x3022('0x27')]=function(_0xe447b9,_0x36583a){var _0x2eab6e={},_0x1795e7={},_0x43d1d6={'count':0x0,'rows':[]};var _0x4d6659=_['map'](db['AnalyticFieldReport'][_0x3022('0x28')],function(_0x2cb86b){return{'name':_0x2cb86b[_0x3022('0x29')],'type':_0x2cb86b[_0x3022('0x2a')]['key']};});_0x1795e7[_0x3022('0x2b')]=_['map'](_0x4d6659,_0x3022('0x25'));_0x1795e7['query']=_[_0x3022('0x2c')](_0xe447b9['query']);_0x1795e7[_0x3022('0x2d')]=_[_0x3022('0x2e')](_0x1795e7[_0x3022('0x2b')],_0x1795e7[_0x3022('0x2f')]);_0x2eab6e[_0x3022('0x30')]=_['intersection'](_0x1795e7[_0x3022('0x2b')],qs['fields'](_0xe447b9[_0x3022('0x2f')]['fields']));_0x2eab6e[_0x3022('0x30')]=_0x2eab6e[_0x3022('0x30')][_0x3022('0x31')]?_0x2eab6e[_0x3022('0x30')]:_0x1795e7['model'];if(!_0xe447b9[_0x3022('0x2f')][_0x3022('0x32')](_0x3022('0x33'))){_0x2eab6e[_0x3022('0x1c')]=qs['limit'](_0xe447b9[_0x3022('0x2f')][_0x3022('0x1c')]);_0x2eab6e[_0x3022('0x1b')]=qs[_0x3022('0x1b')](_0xe447b9[_0x3022('0x2f')][_0x3022('0x1b')]);}_0x2eab6e[_0x3022('0x34')]=qs['sort'](_0xe447b9[_0x3022('0x2f')][_0x3022('0x35')]);_0x2eab6e[_0x3022('0x36')]=qs['filters'](_[_0x3022('0x37')](_0xe447b9['query'],_0x1795e7[_0x3022('0x2d')]),_0x4d6659);if(_0xe447b9[_0x3022('0x2f')][_0x3022('0x38')]){_0x2eab6e[_0x3022('0x36')]=_['merge'](_0x2eab6e[_0x3022('0x36')],{'$or':_['map'](_0x4d6659,function(_0x73326){if(_0x73326[_0x3022('0x2a')]!=='VIRTUAL'){var _0x48363f={};_0x48363f[_0x73326[_0x3022('0x25')]]={'$like':'%'+_0xe447b9[_0x3022('0x2f')][_0x3022('0x38')]+'%'};return _0x48363f;}})});}_0x2eab6e=_[_0x3022('0x39')]({},_0x2eab6e,_0xe447b9[_0x3022('0x3a')]);var _0x4c7f1d={'where':_0x2eab6e['where']};return db[_0x3022('0x3b')][_0x3022('0x1a')](_0x4c7f1d)[_0x3022('0x22')](function(_0x376c7b){_0x43d1d6[_0x3022('0x1a')]=_0x376c7b;if(_0xe447b9['query'][_0x3022('0x3c')]){_0x2eab6e[_0x3022('0x3d')]=[{'all':!![]}];}return db[_0x3022('0x3b')][_0x3022('0x3e')](_0x2eab6e);})[_0x3022('0x22')](function(_0x2d4619){_0x43d1d6['rows']=_0x2d4619;return _0x43d1d6;})[_0x3022('0x22')](respondWithFilteredResult(_0x36583a,_0x2eab6e))[_0x3022('0x3f')](handleError(_0x36583a,null));};exports[_0x3022('0x40')]=function(_0x4129dd,_0x157f14){var _0x23e9af={'raw':![],'where':{'id':_0x4129dd[_0x3022('0x41')]['id']}},_0x46081f={};_0x46081f[_0x3022('0x2b')]=_[_0x3022('0x2c')](db[_0x3022('0x3b')][_0x3022('0x28')]);_0x46081f[_0x3022('0x2f')]=_[_0x3022('0x2c')](_0x4129dd[_0x3022('0x2f')]);_0x46081f['filters']=_[_0x3022('0x2e')](_0x46081f['model'],_0x46081f[_0x3022('0x2f')]);_0x23e9af[_0x3022('0x30')]=_[_0x3022('0x2e')](_0x46081f[_0x3022('0x2b')],qs[_0x3022('0x42')](_0x4129dd['query'][_0x3022('0x42')]));_0x23e9af['attributes']=_0x23e9af[_0x3022('0x30')][_0x3022('0x31')]?_0x23e9af[_0x3022('0x30')]:_0x46081f[_0x3022('0x2b')];if(_0x4129dd['query'][_0x3022('0x3c')]){_0x23e9af[_0x3022('0x3d')]=[{'all':!![]}];}_0x23e9af=_[_0x3022('0x39')]({},_0x23e9af,_0x4129dd['options']);return db[_0x3022('0x3b')][_0x3022('0x43')](_0x23e9af)[_0x3022('0x22')](handleEntityNotFound(_0x157f14,null))[_0x3022('0x22')](respondWithResult(_0x157f14,null))[_0x3022('0x3f')](handleError(_0x157f14,null));};exports[_0x3022('0x44')]=function(_0x525a96,_0x2f5da8){return db['AnalyticFieldReport']['create'](_0x525a96[_0x3022('0x45')],{})[_0x3022('0x22')](respondWithResult(_0x2f5da8,0xc9))[_0x3022('0x3f')](handleError(_0x2f5da8,null));};exports[_0x3022('0x46')]=function(_0x332087,_0x3fa116){return db['AnalyticFieldReport']['bulkCreate'](_0x332087[_0x3022('0x45')],{'raw':![],'individualHooks':!![]})[_0x3022('0x22')](respondWithResult(_0x3fa116,0xc9))[_0x3022('0x3f')](handleError(_0x3fa116,null));};exports['update']=function(_0x290802,_0x2b7e2a){if(_0x290802['body']['id']){delete _0x290802[_0x3022('0x45')]['id'];}return db['AnalyticFieldReport'][_0x3022('0x43')]({'where':{'id':_0x290802[_0x3022('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b7e2a,null))[_0x3022('0x22')](saveUpdates(_0x290802[_0x3022('0x45')],null))['then'](respondWithResult(_0x2b7e2a,null))[_0x3022('0x3f')](handleError(_0x2b7e2a,null));};exports[_0x3022('0x23')]=function(_0x51fcdd,_0x4cfe41){return db['AnalyticFieldReport'][_0x3022('0x43')]({'where':{'id':_0x51fcdd[_0x3022('0x41')]['id']}})[_0x3022('0x22')](handleEntityNotFound(_0x4cfe41,null))['then'](removeEntity(_0x4cfe41,null))[_0x3022('0x3f')](handleError(_0x4cfe41,null));};exports[_0x3022('0x47')]=function(_0x1b0ce6,_0x5e4702){return db[_0x3022('0x3b')][_0x3022('0x23')]({'where':{'id':_0x1b0ce6[_0x3022('0x2f')][_0x3022('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x3022('0x22')](respondWithResult(_0x5e4702,0xcc))[_0x3022('0x3f')](handleError(_0x5e4702,null));};exports[_0x3022('0x49')]=function(_0x214774,_0x2de8ce,_0x49b708){return db[_0x3022('0x4a')][_0x3022('0x4b')]({'where':{'id':_0x214774[_0x3022('0x41')]['id']}})[_0x3022('0x22')](handleEntityNotFound(_0x2de8ce,null))[_0x3022('0x22')](function(_0x95a88e){if(_0x95a88e){return db[_0x3022('0x4c')]['transaction'](function(_0x236543){return db[_0x3022('0x3b')][_0x3022('0x23')]({'where':{'CustomReportId':_0x214774['params']['id']},'transaction':_0x236543})[_0x3022('0x22')](function(_0x59c2b2){var _0x5a7b21=_[_0x3022('0x4d')](_0x214774['body'],function(_0x3bd8aa){delete _0x3bd8aa['id'];_0x3bd8aa[_0x3022('0x4e')]=_0x214774[_0x3022('0x41')]['id'];return _0x3bd8aa;});return db[_0x3022('0x3b')]['bulkCreate'](_0x5a7b21,{'transaction':_0x236543});});})[_0x3022('0x22')](function(){return db[_0x3022('0x3b')]['findAll']({'where':{'CustomReportId':_0x214774[_0x3022('0x41')]['id']}});});}})['then'](respondWithResult(_0x2de8ce,null))[_0x3022('0x3f')](handleError(_0x2de8ce,null));};
\ No newline at end of file
index d99a25e..02e5884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c5c=['bluebird','path','rimraf','../../config/environment','exports','AnalyticFieldReport','util','api','moment'];(function(_0x176292,_0x4d5cf1){var _0x342d88=function(_0x1ded91){while(--_0x1ded91){_0x176292['push'](_0x176292['shift']());}};_0x342d88(++_0x4d5cf1);}(_0x4c5c,0x1ec));var _0xc4c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc4c5('0x0'));var logger=require('../../config/logger')(_0xc4c5('0x1'));var moment=require(_0xc4c5('0x2'));var BPromise=require(_0xc4c5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4c5('0x4'));var rimraf=require(_0xc4c5('0x5'));var config=require(_0xc4c5('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0xc4c5('0x7')]=function(_0x8e324d,_0x2f9cdc){return _0x8e324d['define'](_0xc4c5('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a99=['bluebird','request-promise','path','../../config/environment','exports','lodash','api','moment'];(function(_0x32e312,_0xcbff54){var _0x403f17=function(_0x3e61a1){while(--_0x3e61a1){_0x32e312['push'](_0x32e312['shift']());}};_0x403f17(++_0xcbff54);}(_0x8a99,0x11d));var _0x98a9=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x8a99[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x98a9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x98a9('0x1'));var moment=require(_0x98a9('0x2'));var BPromise=require(_0x98a9('0x3'));var rp=require(_0x98a9('0x4'));var fs=require('fs');var path=require(_0x98a9('0x5'));var rimraf=require('rimraf');var config=require(_0x98a9('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x98a9('0x7')]=function(_0x492ac2,_0x1db4e9){return _0x492ac2['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c01a290..54e38bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x817d=['code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3f6434,_0x35f420){var _0x3454f6=function(_0x407b00){while(--_0x407b00){_0x3f6434['push'](_0x3f6434['shift']());}};_0x3454f6(++_0x35f420);}(_0x817d,0x17b));var _0xd817=function(_0xe897b1,_0x533ff2){_0xe897b1=_0xe897b1-0x0;var _0x32ddc0=_0x817d[_0xe897b1];return _0x32ddc0;};'use strict';var _=require('lodash');var util=require(_0xd817('0x0'));var moment=require('moment');var BPromise=require(_0xd817('0x1'));var rs=require(_0xd817('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd817('0x3'));var logger=require(_0xd817('0x4'))(_0xd817('0x5'));var config=require(_0xd817('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd817('0x7')][_0xd817('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5672db,_0x261a13,_0x2472a5){return new BPromise(function(_0x38b0f7,_0x274bdf){return client[_0xd817('0x9')](_0x5672db,_0x2472a5)[_0xd817('0xa')](function(_0x1f70f8){logger[_0xd817('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x261a13,_0xd817('0xc'));logger[_0xd817('0xd')](_0xd817('0xe'),_0x261a13,_0xd817('0xc'),JSON[_0xd817('0xf')](_0x1f70f8));if(_0x1f70f8[_0xd817('0x10')]){if(_0x1f70f8['error'][_0xd817('0x11')]===0x1f4){logger[_0xd817('0x10')](_0xd817('0x12'),_0x261a13,_0x1f70f8['error'][_0xd817('0x13')]);return _0x274bdf(_0x1f70f8[_0xd817('0x10')]['message']);}logger['error'](_0xd817('0x12'),_0x261a13,_0x1f70f8[_0xd817('0x10')][_0xd817('0x13')]);return _0x38b0f7(_0x1f70f8[_0xd817('0x10')]['message']);}else{logger[_0xd817('0xb')](_0xd817('0x12'),_0x261a13,'request\x20sent');_0x38b0f7(_0x1f70f8[_0xd817('0x14')]['message']);}})[_0xd817('0x15')](function(_0x24e1fa){logger[_0xd817('0x10')](_0xd817('0x12'),_0x261a13,_0x24e1fa);_0x274bdf(_0x24e1fa);});});}
\ No newline at end of file
+var _0xd18c=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util'];(function(_0x173158,_0x1609cf){var _0x4ad038=function(_0x2922d7){while(--_0x2922d7){_0x173158['push'](_0x173158['shift']());}};_0x4ad038(++_0x1609cf);}(_0xd18c,0x1b7));var _0xcd18=function(_0x735da9,_0x38b186){_0x735da9=_0x735da9-0x0;var _0x39160b=_0xd18c[_0x735da9];return _0x39160b;};'use strict';var _=require(_0xcd18('0x0'));var util=require(_0xcd18('0x1'));var moment=require(_0xcd18('0x2'));var BPromise=require(_0xcd18('0x3'));var rs=require(_0xcd18('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd18('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd18('0x6'))(_0xcd18('0x7'));var config=require(_0xcd18('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcd18('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42efe1,_0x862e17,_0x3e5b74){return new BPromise(function(_0x520dc7,_0x47531e){return client[_0xcd18('0xa')](_0x42efe1,_0x3e5b74)[_0xcd18('0xb')](function(_0x36300c){logger['info'](_0xcd18('0xc'),_0x862e17,_0xcd18('0xd'));logger['debug'](_0xcd18('0xe'),_0x862e17,_0xcd18('0xd'),JSON[_0xcd18('0xf')](_0x36300c));if(_0x36300c[_0xcd18('0x10')]){if(_0x36300c[_0xcd18('0x10')][_0xcd18('0x11')]===0x1f4){logger['error'](_0xcd18('0xc'),_0x862e17,_0x36300c[_0xcd18('0x10')][_0xcd18('0x12')]);return _0x47531e(_0x36300c[_0xcd18('0x10')][_0xcd18('0x12')]);}logger[_0xcd18('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x862e17,_0x36300c[_0xcd18('0x10')][_0xcd18('0x12')]);return _0x520dc7(_0x36300c['error'][_0xcd18('0x12')]);}else{logger[_0xcd18('0x13')](_0xcd18('0xc'),_0x862e17,_0xcd18('0xd'));_0x520dc7(_0x36300c[_0xcd18('0x14')][_0xcd18('0x12')]);}})['catch'](function(_0x356e1b){logger[_0xcd18('0x10')](_0xcd18('0xc'),_0x862e17,_0x356e1b);_0x47531e(_0x356e1b);});});}
\ No newline at end of file
index 004aa62..027c942 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['./analyticFieldReport.controller','get','isAuthenticated','index','show','post','create','/create_many','/:id/create_many','addFields','/:id','delete','/destroy_many','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0xc682af,_0x509267){var _0x5f5c85=function(_0x47bf57){while(--_0x47bf57){_0xc682af['push'](_0xc682af['shift']());}};_0x5f5c85(++_0x509267);}(_0x3e74,0x175));var _0x43e7=function(_0x4612c4,_0x40e012){_0x4612c4=_0x4612c4-0x0;var _0x4bfc80=_0x3e74[_0x4612c4];return _0x4bfc80;};'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 auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['post'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x43e7('0xa')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router['put'](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0x11'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x13')]);module[_0x43e7('0x14')]=router;
\ No newline at end of file
+var _0x3e74=['./analyticFieldReport.controller','get','isAuthenticated','index','show','post','create','/create_many','/:id/create_many','addFields','/:id','delete','/destroy_many','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x4fee76,_0xc60073){var _0x4335f4=function(_0xbd9fb1){while(--_0xbd9fb1){_0x4fee76['push'](_0x4fee76['shift']());}};_0x4335f4(++_0xc60073);}(_0x3e74,0x175));var _0x43e7=function(_0x53142f,_0x12d913){_0x53142f=_0x53142f-0x0;var _0x220b10=_0x3e74[_0x53142f];return _0x220b10;};'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 auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['post'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x43e7('0xa')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router['put'](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0x11'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x13')]);module[_0x43e7('0x14')]=router;
\ No newline at end of file
index 934e2a0..6df1264 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e22=['exports','name','STRING','TEXT'];(function(_0x26ebe3,_0x4ee6b7){var _0x337695=function(_0x377cf1){while(--_0x377cf1){_0x26ebe3['push'](_0x26ebe3['shift']());}};_0x337695(++_0x4ee6b7);}(_0x3e22,0xa8));var _0x23e2=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x3e22[_0x25248b];return _0x509939;};'use strict';var Sequelize=require('sequelize');module[_0x23e2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x23e2('0x1')},'table':{'type':Sequelize[_0x23e2('0x2')]},'metric':{'type':Sequelize[_0x23e2('0x3')]},'description':{'type':Sequelize[_0x23e2('0x2')]}};
\ No newline at end of file
+var _0xe486=['TEXT','sequelize','exports','STRING','name'];(function(_0x458c3a,_0xe41198){var _0x1d144d=function(_0x4b4410){while(--_0x4b4410){_0x458c3a['push'](_0x458c3a['shift']());}};_0x1d144d(++_0xe41198);}(_0xe486,0x6a));var _0x6e48=function(_0x32eb8b,_0x5ac0b5){_0x32eb8b=_0x32eb8b-0x0;var _0x5bc68b=_0xe486[_0x32eb8b];return _0x5bc68b;};'use strict';var Sequelize=require(_0x6e48('0x0'));module[_0x6e48('0x1')]={'name':{'type':Sequelize[_0x6e48('0x2')],'allowNull':![],'unique':_0x6e48('0x3')},'table':{'type':Sequelize[_0x6e48('0x2')]},'metric':{'type':Sequelize[_0x6e48('0x4')]},'description':{'type':Sequelize[_0x6e48('0x2')]}};
\ No newline at end of file
index 63b3a84..2f1ab05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['count','include','rows','catch','show','includeAll','create','user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge'];(function(_0xf73d73,_0x23fb95){var _0x22fe1f=function(_0x379f39){while(--_0x379f39){_0xf73d73['push'](_0xf73d73['shift']());}};_0x22fe1f(++_0x23fb95);}(_0x34b7,0x196));var _0x734b=function(_0x4aab29,_0xe600b8){_0x4aab29=_0x4aab29-0x0;var _0x521231=_0x34b7[_0x4aab29];return _0x521231;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x734b('0x0'));var zipdir=require(_0x734b('0x1'));var jsonpatch=require(_0x734b('0x2'));var rp=require(_0x734b('0x3'));var moment=require(_0x734b('0x4'));var BPromise=require(_0x734b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x734b('0x6'));var sox=require(_0x734b('0x7'));var csv=require(_0x734b('0x8'));var ejs=require(_0x734b('0x9'));var fs=require('fs');var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var db=require(_0x734b('0x16'))['db'];function respondWithStatusCode(_0x257657,_0x1e0fca){_0x1e0fca=_0x1e0fca||0xcc;return function(_0x189a82){if(_0x189a82){return _0x257657[_0x734b('0x17')](_0x1e0fca);}return _0x257657[_0x734b('0x18')](_0x1e0fca)[_0x734b('0x19')]();};}function respondWithResult(_0x5a5613,_0x18fc18){_0x18fc18=_0x18fc18||0xc8;return function(_0x252510){if(_0x252510){return _0x5a5613[_0x734b('0x18')](_0x18fc18)[_0x734b('0x1a')](_0x252510);}};}function respondWithFilteredResult(_0x19f427,_0x2e00ad){return function(_0x2372bd){if(_0x2372bd){var _0x2c03bd=_0x2372bd['count'],_0xa6d111=_0x2e00ad[_0x734b('0x1b')],_0x4b8c63=_0x2e00ad[_0x734b('0x1b')]+_0x2e00ad[_0x734b('0x1c')],_0x42407a;if(_0x4b8c63>=_0x2c03bd){_0x4b8c63=_0x2c03bd;_0x42407a=0xc8;}else{_0x42407a=0xce;}_0x19f427[_0x734b('0x18')](_0x42407a);return _0x19f427['set']('Content-Range',_0xa6d111+'-'+_0x4b8c63+'/'+_0x2c03bd)[_0x734b('0x1a')](_0x2372bd);}return null;};}function patchUpdates(_0x3033cd){return function(_0x1e6ed9){try{jsonpatch[_0x734b('0x1d')](_0x1e6ed9,_0x3033cd,!![]);}catch(_0x1c605c){return BPromise[_0x734b('0x1e')](_0x1c605c);}return _0x1e6ed9[_0x734b('0x1f')]();};}function saveUpdates(_0x6572ee,_0x67eed){return function(_0x1d2b27){if(_0x1d2b27){return _0x1d2b27[_0x734b('0x20')](_0x6572ee)[_0x734b('0x21')](function(_0x477d6d){return _0x477d6d;});}return null;};}function removeEntity(_0x19fc51,_0x56f807){return function(_0x1e4dcc){if(_0x1e4dcc){return _0x1e4dcc[_0x734b('0x22')]()['then'](function(){var _0x38154d=_0x1e4dcc[_0x734b('0x23')]({'plain':!![]});var _0x1a7908=_0x734b('0x24');return db[_0x734b('0x25')][_0x734b('0x22')]({'where':{'type':_0x1a7908,'resourceId':_0x38154d['id']}})[_0x734b('0x21')](function(){return _0x1e4dcc;});})[_0x734b('0x21')](function(){_0x19fc51[_0x734b('0x18')](0xcc)[_0x734b('0x19')]();});}};}function handleEntityNotFound(_0x44ffa9,_0x148abe){return function(_0x3bb651){if(!_0x3bb651){_0x44ffa9['sendStatus'](0x194);}return _0x3bb651;};}function handleError(_0x49732b,_0x13cc5a){_0x13cc5a=_0x13cc5a||0x1f4;return function(_0x3680a0){logger['error'](_0x3680a0[_0x734b('0x26')]);if(_0x3680a0[_0x734b('0x27')]){delete _0x3680a0[_0x734b('0x27')];}_0x49732b[_0x734b('0x18')](_0x13cc5a)[_0x734b('0x28')](_0x3680a0);};}exports[_0x734b('0x29')]=function(_0x3ba39c,_0x5c6c5d){var _0x1f3652={},_0x436efe={},_0x42e9ae={'count':0x0,'rows':[]};var _0x241c89=_[_0x734b('0x2a')](db[_0x734b('0x2b')][_0x734b('0x2c')],function(_0x21ed3c){return{'name':_0x21ed3c[_0x734b('0x2d')],'type':_0x21ed3c[_0x734b('0x2e')]['key']};});_0x436efe[_0x734b('0x2f')]=_[_0x734b('0x2a')](_0x241c89,'name');_0x436efe[_0x734b('0x30')]=_[_0x734b('0x31')](_0x3ba39c[_0x734b('0x30')]);_0x436efe[_0x734b('0x32')]=_[_0x734b('0x33')](_0x436efe[_0x734b('0x2f')],_0x436efe[_0x734b('0x30')]);_0x1f3652[_0x734b('0x34')]=_[_0x734b('0x33')](_0x436efe[_0x734b('0x2f')],qs[_0x734b('0x35')](_0x3ba39c[_0x734b('0x30')][_0x734b('0x35')]));_0x1f3652[_0x734b('0x34')]=_0x1f3652[_0x734b('0x34')]['length']?_0x1f3652[_0x734b('0x34')]:_0x436efe['model'];if(!_0x3ba39c[_0x734b('0x30')][_0x734b('0x36')](_0x734b('0x37'))){_0x1f3652[_0x734b('0x1c')]=qs[_0x734b('0x1c')](_0x3ba39c[_0x734b('0x30')]['limit']);_0x1f3652['offset']=qs[_0x734b('0x1b')](_0x3ba39c['query'][_0x734b('0x1b')]);}_0x1f3652['order']=qs[_0x734b('0x38')](_0x3ba39c['query'][_0x734b('0x38')]);_0x1f3652['where']=qs[_0x734b('0x32')](_[_0x734b('0x39')](_0x3ba39c[_0x734b('0x30')],_0x436efe[_0x734b('0x32')]),_0x241c89);if(_0x3ba39c[_0x734b('0x30')][_0x734b('0x3a')]){_0x1f3652[_0x734b('0x3b')]=_['merge'](_0x1f3652[_0x734b('0x3b')],{'$or':_[_0x734b('0x2a')](_0x241c89,function(_0x58db39){if(_0x58db39[_0x734b('0x2e')]!==_0x734b('0x3c')){var _0x2bb422={};_0x2bb422[_0x58db39[_0x734b('0x27')]]={'$like':'%'+_0x3ba39c['query'][_0x734b('0x3a')]+'%'};return _0x2bb422;}})});}_0x1f3652=_[_0x734b('0x3d')]({},_0x1f3652,_0x3ba39c['options']);var _0x40674c={'where':_0x1f3652[_0x734b('0x3b')]};return db['AnalyticMetric'][_0x734b('0x3e')](_0x40674c)[_0x734b('0x21')](function(_0x2820f9){_0x42e9ae[_0x734b('0x3e')]=_0x2820f9;if(_0x3ba39c['query']['includeAll']){_0x1f3652[_0x734b('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x1f3652);})[_0x734b('0x21')](function(_0x50bde2){_0x42e9ae[_0x734b('0x40')]=_0x50bde2;return _0x42e9ae;})['then'](respondWithFilteredResult(_0x5c6c5d,_0x1f3652))[_0x734b('0x41')](handleError(_0x5c6c5d,null));};exports[_0x734b('0x42')]=function(_0xe4fe38,_0x4c3fdc){var _0x5cf3a0={'raw':!![],'where':{'id':_0xe4fe38['params']['id']}},_0x2e1aa8={};_0x2e1aa8['model']=_[_0x734b('0x31')](db[_0x734b('0x2b')]['rawAttributes']);_0x2e1aa8[_0x734b('0x30')]=_['keys'](_0xe4fe38[_0x734b('0x30')]);_0x2e1aa8[_0x734b('0x32')]=_[_0x734b('0x33')](_0x2e1aa8['model'],_0x2e1aa8[_0x734b('0x30')]);_0x5cf3a0[_0x734b('0x34')]=_[_0x734b('0x33')](_0x2e1aa8[_0x734b('0x2f')],qs['fields'](_0xe4fe38['query']['fields']));_0x5cf3a0[_0x734b('0x34')]=_0x5cf3a0['attributes']['length']?_0x5cf3a0[_0x734b('0x34')]:_0x2e1aa8['model'];if(_0xe4fe38[_0x734b('0x30')][_0x734b('0x43')]){_0x5cf3a0[_0x734b('0x3f')]=[{'all':!![]}];}_0x5cf3a0=_[_0x734b('0x3d')]({},_0x5cf3a0,_0xe4fe38['options']);return db[_0x734b('0x2b')]['find'](_0x5cf3a0)[_0x734b('0x21')](handleEntityNotFound(_0x4c3fdc,null))[_0x734b('0x21')](respondWithResult(_0x4c3fdc,null))[_0x734b('0x41')](handleError(_0x4c3fdc,null));};exports['create']=function(_0x370326,_0x4c3efb){return db[_0x734b('0x2b')][_0x734b('0x44')](_0x370326['body'],{})[_0x734b('0x21')](function(_0x410ba9){var _0x145ced=_0x370326[_0x734b('0x45')][_0x734b('0x23')]({'plain':!![]});if(!_0x145ced)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x145ced[_0x734b('0x46')]==='user'){var _0x171575=_0x410ba9['get']({'plain':!![]});var _0xd3c688=_0x734b('0x24');return db[_0x734b('0x47')][_0x734b('0x48')]({'where':{'name':_0xd3c688,'userProfileId':_0x145ced[_0x734b('0x49')]},'raw':!![]})['then'](function(_0x4c0378){if(_0x4c0378&&_0x4c0378['autoAssociation']===0x0){return db[_0x734b('0x25')][_0x734b('0x44')]({'name':_0x171575['name'],'resourceId':_0x171575['id'],'type':_0x4c0378[_0x734b('0x27')],'sectionId':_0x4c0378['id']},{})[_0x734b('0x21')](function(){return _0x410ba9;});}else{return _0x410ba9;}})['catch'](function(_0x167173){logger[_0x734b('0x4a')](_0x734b('0x4b'),_0x167173);throw _0x167173;});}return _0x410ba9;})['then'](respondWithResult(_0x4c3efb,0xc9))[_0x734b('0x41')](handleError(_0x4c3efb,null));};exports[_0x734b('0x20')]=function(_0x423b22,_0xe605be){if(_0x423b22['body']['id']){delete _0x423b22[_0x734b('0x4c')]['id'];}return db[_0x734b('0x2b')][_0x734b('0x48')]({'where':{'id':_0x423b22[_0x734b('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe605be,null))[_0x734b('0x21')](saveUpdates(_0x423b22['body'],null))[_0x734b('0x21')](respondWithResult(_0xe605be,null))[_0x734b('0x41')](handleError(_0xe605be,null));};exports[_0x734b('0x22')]=function(_0x3d330e,_0x58d665){return db[_0x734b('0x2b')][_0x734b('0x48')]({'where':{'id':_0x3d330e['params']['id']}})['then'](handleEntityNotFound(_0x58d665,null))[_0x734b('0x21')](removeEntity(_0x58d665,null))['catch'](handleError(_0x58d665,null));};
\ No newline at end of file
+var _0x1775=['reject','save','update','then','destroy','Metrics','UserProfileResource','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','options','find','body','user','get','UserProfileSection','userProfileId','autoAssociation','create','error','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','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5177('0x0'));var rimraf=require(_0x5177('0x1'));var zipdir=require(_0x5177('0x2'));var jsonpatch=require(_0x5177('0x3'));var rp=require(_0x5177('0x4'));var moment=require(_0x5177('0x5'));var BPromise=require(_0x5177('0x6'));var Mustache=require(_0x5177('0x7'));var util=require(_0x5177('0x8'));var path=require(_0x5177('0x9'));var sox=require(_0x5177('0xa'));var csv=require(_0x5177('0xb'));var ejs=require(_0x5177('0xc'));var fs=require('fs');var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xb'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var db=require(_0x5177('0x1a'))['db'];function respondWithStatusCode(_0x22fe21,_0xc613b9){_0xc613b9=_0xc613b9||0xcc;return function(_0x3c4ced){if(_0x3c4ced){return _0x22fe21[_0x5177('0x1b')](_0xc613b9);}return _0x22fe21[_0x5177('0x1c')](_0xc613b9)[_0x5177('0x1d')]();};}function respondWithResult(_0x2ec90f,_0x3e6224){_0x3e6224=_0x3e6224||0xc8;return function(_0x1eb9dd){if(_0x1eb9dd){return _0x2ec90f[_0x5177('0x1c')](_0x3e6224)[_0x5177('0x1e')](_0x1eb9dd);}};}function respondWithFilteredResult(_0x29cd2c,_0x31aff8){return function(_0x1b32e6){if(_0x1b32e6){var _0x175ca6=_0x1b32e6['count'],_0x2ab5e5=_0x31aff8[_0x5177('0x1f')],_0x7dba6f=_0x31aff8[_0x5177('0x1f')]+_0x31aff8[_0x5177('0x20')],_0xe6dcf6;if(_0x7dba6f>=_0x175ca6){_0x7dba6f=_0x175ca6;_0xe6dcf6=0xc8;}else{_0xe6dcf6=0xce;}_0x29cd2c[_0x5177('0x1c')](_0xe6dcf6);return _0x29cd2c['set'](_0x5177('0x21'),_0x2ab5e5+'-'+_0x7dba6f+'/'+_0x175ca6)[_0x5177('0x1e')](_0x1b32e6);}return null;};}function patchUpdates(_0x13d5d4){return function(_0x5b5918){try{jsonpatch[_0x5177('0x22')](_0x5b5918,_0x13d5d4,!![]);}catch(_0x4cf600){return BPromise[_0x5177('0x23')](_0x4cf600);}return _0x5b5918[_0x5177('0x24')]();};}function saveUpdates(_0x219744,_0x27b732){return function(_0x451e5c){if(_0x451e5c){return _0x451e5c[_0x5177('0x25')](_0x219744)[_0x5177('0x26')](function(_0xfc1bd4){return _0xfc1bd4;});}return null;};}function removeEntity(_0x2152d4,_0x2a95cc){return function(_0x23dad2){if(_0x23dad2){return _0x23dad2[_0x5177('0x27')]()['then'](function(){var _0x3dcea1=_0x23dad2['get']({'plain':!![]});var _0x30b60f=_0x5177('0x28');return db[_0x5177('0x29')][_0x5177('0x27')]({'where':{'type':_0x30b60f,'resourceId':_0x3dcea1['id']}})['then'](function(){return _0x23dad2;});})[_0x5177('0x26')](function(){_0x2152d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a0c2,_0x15cb93){return function(_0x577bf7){if(!_0x577bf7){_0x19a0c2[_0x5177('0x1b')](0x194);}return _0x577bf7;};}function handleError(_0x4eba3a,_0x231d35){_0x231d35=_0x231d35||0x1f4;return function(_0x1cbd29){logger['error'](_0x1cbd29[_0x5177('0x2a')]);if(_0x1cbd29[_0x5177('0x2b')]){delete _0x1cbd29[_0x5177('0x2b')];}_0x4eba3a[_0x5177('0x1c')](_0x231d35)[_0x5177('0x2c')](_0x1cbd29);};}exports[_0x5177('0x2d')]=function(_0x5577bb,_0x498fcd){var _0x45cf20={},_0x1c660e={},_0x7dae59={'count':0x0,'rows':[]};var _0x174f7a=_[_0x5177('0x2e')](db[_0x5177('0x2f')][_0x5177('0x30')],function(_0x72dced){return{'name':_0x72dced['fieldName'],'type':_0x72dced[_0x5177('0x31')][_0x5177('0x32')]};});_0x1c660e['model']=_[_0x5177('0x2e')](_0x174f7a,'name');_0x1c660e[_0x5177('0x33')]=_[_0x5177('0x34')](_0x5577bb[_0x5177('0x33')]);_0x1c660e['filters']=_['intersection'](_0x1c660e[_0x5177('0x35')],_0x1c660e[_0x5177('0x33')]);_0x45cf20[_0x5177('0x36')]=_[_0x5177('0x37')](_0x1c660e[_0x5177('0x35')],qs[_0x5177('0x38')](_0x5577bb[_0x5177('0x33')][_0x5177('0x38')]));_0x45cf20['attributes']=_0x45cf20[_0x5177('0x36')][_0x5177('0x39')]?_0x45cf20['attributes']:_0x1c660e[_0x5177('0x35')];if(!_0x5577bb[_0x5177('0x33')][_0x5177('0x3a')](_0x5177('0x3b'))){_0x45cf20[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x5577bb['query'][_0x5177('0x20')]);_0x45cf20[_0x5177('0x1f')]=qs[_0x5177('0x1f')](_0x5577bb[_0x5177('0x33')][_0x5177('0x1f')]);}_0x45cf20[_0x5177('0x3c')]=qs[_0x5177('0x3d')](_0x5577bb['query'][_0x5177('0x3d')]);_0x45cf20[_0x5177('0x3e')]=qs['filters'](_['pick'](_0x5577bb[_0x5177('0x33')],_0x1c660e[_0x5177('0x3f')]),_0x174f7a);if(_0x5577bb[_0x5177('0x33')][_0x5177('0x40')]){_0x45cf20[_0x5177('0x3e')]=_[_0x5177('0x41')](_0x45cf20[_0x5177('0x3e')],{'$or':_[_0x5177('0x2e')](_0x174f7a,function(_0xa2ed49){if(_0xa2ed49[_0x5177('0x31')]!==_0x5177('0x42')){var _0x1f15f8={};_0x1f15f8[_0xa2ed49[_0x5177('0x2b')]]={'$like':'%'+_0x5577bb['query'][_0x5177('0x40')]+'%'};return _0x1f15f8;}})});}_0x45cf20=_[_0x5177('0x41')]({},_0x45cf20,_0x5577bb['options']);var _0x7341c0={'where':_0x45cf20['where']};return db[_0x5177('0x2f')][_0x5177('0x43')](_0x7341c0)[_0x5177('0x26')](function(_0x5742aa){_0x7dae59['count']=_0x5742aa;if(_0x5577bb[_0x5177('0x33')][_0x5177('0x44')]){_0x45cf20[_0x5177('0x45')]=[{'all':!![]}];}return db[_0x5177('0x2f')][_0x5177('0x46')](_0x45cf20);})[_0x5177('0x26')](function(_0x41d874){_0x7dae59[_0x5177('0x47')]=_0x41d874;return _0x7dae59;})['then'](respondWithFilteredResult(_0x498fcd,_0x45cf20))[_0x5177('0x48')](handleError(_0x498fcd,null));};exports['show']=function(_0x5e3d30,_0x30e4f3){var _0x17dc98={'raw':!![],'where':{'id':_0x5e3d30[_0x5177('0x49')]['id']}},_0x5172f8={};_0x5172f8['model']=_['keys'](db[_0x5177('0x2f')][_0x5177('0x30')]);_0x5172f8[_0x5177('0x33')]=_[_0x5177('0x34')](_0x5e3d30[_0x5177('0x33')]);_0x5172f8[_0x5177('0x3f')]=_[_0x5177('0x37')](_0x5172f8['model'],_0x5172f8['query']);_0x17dc98[_0x5177('0x36')]=_['intersection'](_0x5172f8[_0x5177('0x35')],qs[_0x5177('0x38')](_0x5e3d30[_0x5177('0x33')][_0x5177('0x38')]));_0x17dc98['attributes']=_0x17dc98[_0x5177('0x36')][_0x5177('0x39')]?_0x17dc98[_0x5177('0x36')]:_0x5172f8[_0x5177('0x35')];if(_0x5e3d30[_0x5177('0x33')][_0x5177('0x44')]){_0x17dc98[_0x5177('0x45')]=[{'all':!![]}];}_0x17dc98=_[_0x5177('0x41')]({},_0x17dc98,_0x5e3d30[_0x5177('0x4a')]);return db[_0x5177('0x2f')][_0x5177('0x4b')](_0x17dc98)['then'](handleEntityNotFound(_0x30e4f3,null))[_0x5177('0x26')](respondWithResult(_0x30e4f3,null))['catch'](handleError(_0x30e4f3,null));};exports['create']=function(_0x5bda8a,_0x2f9ff9){return db[_0x5177('0x2f')]['create'](_0x5bda8a[_0x5177('0x4c')],{})[_0x5177('0x26')](function(_0x208483){var _0x4891fe=_0x5bda8a[_0x5177('0x4d')]['get']({'plain':!![]});if(!_0x4891fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4891fe['role']===_0x5177('0x4d')){var _0x37d5dd=_0x208483[_0x5177('0x4e')]({'plain':!![]});var _0x5a1f8b='Metrics';return db[_0x5177('0x4f')]['find']({'where':{'name':_0x5a1f8b,'userProfileId':_0x4891fe[_0x5177('0x50')]},'raw':!![]})[_0x5177('0x26')](function(_0x430e8e){if(_0x430e8e&&_0x430e8e[_0x5177('0x51')]===0x0){return db[_0x5177('0x29')][_0x5177('0x52')]({'name':_0x37d5dd[_0x5177('0x2b')],'resourceId':_0x37d5dd['id'],'type':_0x430e8e[_0x5177('0x2b')],'sectionId':_0x430e8e['id']},{})[_0x5177('0x26')](function(){return _0x208483;});}else{return _0x208483;}})[_0x5177('0x48')](function(_0x89fe3a){logger[_0x5177('0x53')](_0x5177('0x54'),_0x89fe3a);throw _0x89fe3a;});}return _0x208483;})['then'](respondWithResult(_0x2f9ff9,0xc9))['catch'](handleError(_0x2f9ff9,null));};exports[_0x5177('0x25')]=function(_0x5d5016,_0x649c6f){if(_0x5d5016['body']['id']){delete _0x5d5016[_0x5177('0x4c')]['id'];}return db[_0x5177('0x2f')][_0x5177('0x4b')]({'where':{'id':_0x5d5016['params']['id']}})['then'](handleEntityNotFound(_0x649c6f,null))[_0x5177('0x26')](saveUpdates(_0x5d5016[_0x5177('0x4c')],null))[_0x5177('0x26')](respondWithResult(_0x649c6f,null))[_0x5177('0x48')](handleError(_0x649c6f,null));};exports['destroy']=function(_0x5718a1,_0x3f0e89){return db[_0x5177('0x2f')][_0x5177('0x4b')]({'where':{'id':_0x5718a1[_0x5177('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f0e89,null))[_0x5177('0x26')](removeEntity(_0x3f0e89,null))[_0x5177('0x48')](handleError(_0x3f0e89,null));};
\ No newline at end of file
index 6a2375c..f2335d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9017=['exports','define','AnalyticMetric','analytics_metrics','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2132a0,_0x3a4227){var _0x424a16=function(_0x3f2373){while(--_0x3f2373){_0x2132a0['push'](_0x2132a0['shift']());}};_0x424a16(++_0x3a4227);}(_0x9017,0x7c));var _0x7901=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9017[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7901('0x0'))('api');var moment=require(_0x7901('0x1'));var BPromise=require(_0x7901('0x2'));var rp=require(_0x7901('0x3'));var fs=require('fs');var path=require(_0x7901('0x4'));var rimraf=require(_0x7901('0x5'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x7901('0x6')]=function(_0x33dc04,_0x47b7d3){return _0x33dc04[_0x7901('0x7')](_0x7901('0x8'),attributes,{'tableName':_0x7901('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6ef9=['bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','api','moment'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x6ef9,0x11c));var _0x96ef=function(_0x3f6c29,_0x370d86){_0x3f6c29=_0x3f6c29-0x0;var _0x4af959=_0x6ef9[_0x3f6c29];return _0x4af959;};'use strict';var _=require(_0x96ef('0x0'));var util=require(_0x96ef('0x1'));var logger=require('../../config/logger')(_0x96ef('0x2'));var moment=require(_0x96ef('0x3'));var BPromise=require(_0x96ef('0x4'));var rp=require(_0x96ef('0x5'));var fs=require('fs');var path=require(_0x96ef('0x6'));var rimraf=require('rimraf');var config=require(_0x96ef('0x7'));var attributes=require(_0x96ef('0x8'));module[_0x96ef('0x9')]=function(_0x53afba,_0x2c8d51){return _0x53afba[_0x96ef('0xa')]('AnalyticMetric',attributes,{'tableName':_0x96ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a6ca252..9896c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0422=['../../config/logger','rpc','../../config/environment','client','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x25fb36,_0x1a9d10){var _0x2b0cd6=function(_0x48b433){while(--_0x48b433){_0x25fb36['push'](_0x25fb36['shift']());}};_0x2b0cd6(++_0x1a9d10);}(_0x0422,0xa6));var _0x2042=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x0422[_0x1344d6];return _0xf45b24;};'use strict';var _=require(_0x2042('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2042('0x1'));var fs=require('fs');var Redis=require(_0x2042('0x2'));var db=require(_0x2042('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2042('0x4'))(_0x2042('0x5'));var config=require(_0x2042('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2042('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e5f43,_0x2a3ebf,_0x5aa2d4){return new BPromise(function(_0x489ac0,_0x284415){return client['request'](_0x3e5f43,_0x5aa2d4)[_0x2042('0x8')](function(_0x4cca37){logger[_0x2042('0x9')](_0x2042('0xa'),_0x2a3ebf,_0x2042('0xb'));logger[_0x2042('0xc')](_0x2042('0xd'),_0x2a3ebf,'request\x20sent',JSON['stringify'](_0x4cca37));if(_0x4cca37[_0x2042('0xe')]){if(_0x4cca37['error'][_0x2042('0xf')]===0x1f4){logger[_0x2042('0xe')](_0x2042('0xa'),_0x2a3ebf,_0x4cca37[_0x2042('0xe')][_0x2042('0x10')]);return _0x284415(_0x4cca37[_0x2042('0xe')][_0x2042('0x10')]);}logger[_0x2042('0xe')](_0x2042('0xa'),_0x2a3ebf,_0x4cca37[_0x2042('0xe')]['message']);return _0x489ac0(_0x4cca37[_0x2042('0xe')][_0x2042('0x10')]);}else{logger['info'](_0x2042('0xa'),_0x2a3ebf,_0x2042('0xb'));_0x489ac0(_0x4cca37['result']['message']);}})['catch'](function(_0x134636){logger[_0x2042('0xe')](_0x2042('0xa'),_0x2a3ebf,_0x134636);_0x284415(_0x134636);});});}
\ No newline at end of file
+var _0xdd93=['code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5c83f4,_0x83d00){var _0x237bf1=function(_0x1a528c){while(--_0x1a528c){_0x5c83f4['push'](_0x5c83f4['shift']());}};_0x237bf1(++_0x83d00);}(_0xdd93,0x1f1));var _0x3dd9=function(_0x3b57c0,_0xc11303){_0x3b57c0=_0x3b57c0-0x0;var _0x33aafa=_0xdd93[_0x3b57c0];return _0x33aafa;};'use strict';var _=require(_0x3dd9('0x0'));var util=require('util');var moment=require(_0x3dd9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3dd9('0x2'));var db=require(_0x3dd9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3dd9('0x4'))(_0x3dd9('0x5'));var config=require(_0x3dd9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3dd9('0x7')][_0x3dd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x433626,_0x4c682a,_0xb18162){return new BPromise(function(_0x47543e,_0x3da91e){return client['request'](_0x433626,_0xb18162)[_0x3dd9('0x9')](function(_0x3fc546){logger[_0x3dd9('0xa')](_0x3dd9('0xb'),_0x4c682a,_0x3dd9('0xc'));logger[_0x3dd9('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4c682a,_0x3dd9('0xc'),JSON[_0x3dd9('0xe')](_0x3fc546));if(_0x3fc546['error']){if(_0x3fc546[_0x3dd9('0xf')][_0x3dd9('0x10')]===0x1f4){logger[_0x3dd9('0xf')](_0x3dd9('0xb'),_0x4c682a,_0x3fc546[_0x3dd9('0xf')][_0x3dd9('0x11')]);return _0x3da91e(_0x3fc546[_0x3dd9('0xf')][_0x3dd9('0x11')]);}logger[_0x3dd9('0xf')](_0x3dd9('0xb'),_0x4c682a,_0x3fc546[_0x3dd9('0xf')][_0x3dd9('0x11')]);return _0x47543e(_0x3fc546['error'][_0x3dd9('0x11')]);}else{logger[_0x3dd9('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x4c682a,_0x3dd9('0xc'));_0x47543e(_0x3fc546['result'][_0x3dd9('0x11')]);}})[_0x3dd9('0x12')](function(_0x343ffc){logger['error'](_0x3dd9('0xb'),_0x4c682a,_0x343ffc);_0x3da91e(_0x343ffc);});});}
\ No newline at end of file
index 9c38b9d..680ba19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','show','update','/:id','exports','multer','util','path','express'];(function(_0x5d3222,_0x4adb06){var _0x126ca7=function(_0x4c3a97){while(--_0x4c3a97){_0x5d3222['push'](_0x5d3222['shift']());}};_0x126ca7(++_0x4adb06);}(_0x7a54,0x106));var _0x47a5=function(_0xe67b43,_0x35029b){_0xe67b43=_0xe67b43-0x0;var _0x130f7c=_0x7a54[_0xe67b43];return _0x130f7c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/:id',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['post']('/',auth[_0x47a5('0x9')](),controller['create']);router['put']('/:id',auth[_0x47a5('0x9')](),controller[_0x47a5('0xb')]);router['delete'](_0x47a5('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0x6d38=['path','connect-timeout','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util'];(function(_0x520a12,_0x10e69c){var _0x248e1f=function(_0x5045cf){while(--_0x5045cf){_0x520a12['push'](_0x520a12['shift']());}};_0x248e1f(++_0x10e69c);}(_0x6d38,0x1ef));var _0x86d3=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6d38[_0xefd519];return _0x4bb882;};'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 auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['show']);router['post']('/',auth[_0x86d3('0x9')](),controller[_0x86d3('0xa')]);router[_0x86d3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xc')]);router[_0x86d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router;
\ No newline at end of file
index 48a4dd8..482ebf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d7=['exports','sequelize'];(function(_0x18b232,_0x3cd1e9){var _0x303efe=function(_0xac931d){while(--_0xac931d){_0x18b232['push'](_0x18b232['shift']());}};_0x303efe(++_0x3cd1e9);}(_0x16d7,0x1a9));var _0x716d=function(_0x5db05c,_0x9fddff){_0x5db05c=_0x5db05c-0x0;var _0x1726f1=_0x16d7[_0x5db05c];return _0x1726f1;};'use strict';var Sequelize=require(_0x716d('0x0'));module[_0x716d('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x0cd8=['TEXT','sequelize','exports'];(function(_0xd099f4,_0x405b29){var _0x371b07=function(_0x46612c){while(--_0x46612c){_0xd099f4['push'](_0xd099f4['shift']());}};_0x371b07(++_0x405b29);}(_0x0cd8,0x1ab));var _0x80cd=function(_0x4d76e6,_0x92952b){_0x4d76e6=_0x4d76e6-0x0;var _0x3ec886=_0x0cd8[_0x4d76e6];return _0x3ec886;};'use strict';var Sequelize=require(_0x80cd('0x0'));module[_0x80cd('0x1')]={'tree':{'type':Sequelize[_0x80cd('0x2')],'allowNull':![]}};
\ No newline at end of file
index 6f07ce2..d2034ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c34=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','fast-json-patch','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x9c34,0x6e));var _0x49c3=function(_0x3ffd0d,_0x4d34ea){_0x3ffd0d=_0x3ffd0d-0x0;var _0x2906d5=_0x9c34[_0x3ffd0d];return _0x2906d5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x49c3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x49c3('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x49c3('0x2'));var util=require(_0x49c3('0x3'));var path=require('path');var sox=require(_0x49c3('0x4'));var csv=require(_0x49c3('0x5'));var ejs=require(_0x49c3('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x49c3('0x7'));var jsforce=require(_0x49c3('0x8'));var deskjs=require(_0x49c3('0x9'));var toCsv=require(_0x49c3('0x5'));var querystring=require(_0x49c3('0xa'));var Papa=require(_0x49c3('0xb'));var Redis=require(_0x49c3('0xc'));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(_0x49c3('0xd'))(_0x49c3('0xe'));var utils=require(_0x49c3('0xf'));var config=require('../../config/environment');var db=require(_0x49c3('0x10'))['db'];function respondWithStatusCode(_0x58cd6e,_0x1fede0){_0x1fede0=_0x1fede0||0xcc;return function(_0x6a2b7b){if(_0x6a2b7b){return _0x58cd6e[_0x49c3('0x11')](_0x1fede0);}return _0x58cd6e[_0x49c3('0x12')](_0x1fede0)[_0x49c3('0x13')]();};}function respondWithResult(_0x47006a,_0x4ced78){_0x4ced78=_0x4ced78||0xc8;return function(_0x50d3d1){if(_0x50d3d1){return _0x47006a[_0x49c3('0x12')](_0x4ced78)[_0x49c3('0x14')](_0x50d3d1);}};}function respondWithFilteredResult(_0xeb85bd,_0xf1b94d){return function(_0x570620){if(_0x570620){var _0x4c3b09=_0x570620[_0x49c3('0x15')],_0x53aa37=_0xf1b94d[_0x49c3('0x16')],_0x5644a2=_0xf1b94d[_0x49c3('0x16')]+_0xf1b94d[_0x49c3('0x17')],_0x11fcb8;if(_0x5644a2>=_0x4c3b09){_0x5644a2=_0x4c3b09;_0x11fcb8=0xc8;}else{_0x11fcb8=0xce;}_0xeb85bd[_0x49c3('0x12')](_0x11fcb8);return _0xeb85bd[_0x49c3('0x18')](_0x49c3('0x19'),_0x53aa37+'-'+_0x5644a2+'/'+_0x4c3b09)[_0x49c3('0x14')](_0x570620);}return null;};}function patchUpdates(_0x25cca9){return function(_0x401d31){try{jsonpatch[_0x49c3('0x1a')](_0x401d31,_0x25cca9,!![]);}catch(_0x5b8597){return BPromise[_0x49c3('0x1b')](_0x5b8597);}return _0x401d31[_0x49c3('0x1c')]();};}function saveUpdates(_0x513ad4,_0x1de65b){return function(_0x3bb1e2){if(_0x3bb1e2){return _0x3bb1e2[_0x49c3('0x1d')](_0x513ad4)[_0x49c3('0x1e')](function(_0x52c3a1){return _0x52c3a1;});}return null;};}function removeEntity(_0x338f75,_0x538835){return function(_0x2d368d){if(_0x2d368d){return _0x2d368d[_0x49c3('0x1f')]()[_0x49c3('0x1e')](function(){_0x338f75[_0x49c3('0x12')](0xcc)[_0x49c3('0x13')]();});}};}function handleEntityNotFound(_0x2954db,_0x58e381){return function(_0xf42a1b){if(!_0xf42a1b){_0x2954db[_0x49c3('0x11')](0x194);}return _0xf42a1b;};}function handleError(_0x2d4cb7,_0x44d66a){_0x44d66a=_0x44d66a||0x1f4;return function(_0x9a407d){logger[_0x49c3('0x20')](_0x9a407d[_0x49c3('0x21')]);if(_0x9a407d[_0x49c3('0x22')]){delete _0x9a407d[_0x49c3('0x22')];}_0x2d4cb7[_0x49c3('0x12')](_0x44d66a)[_0x49c3('0x23')](_0x9a407d);};}exports[_0x49c3('0x24')]=function(_0x24707f,_0x1f1f06){var _0x369656={},_0x2f53fe={},_0x2da42f={'count':0x0,'rows':[]};var _0x16d5b0=_[_0x49c3('0x25')](db[_0x49c3('0x26')][_0x49c3('0x27')],function(_0xffa7d9){return{'name':_0xffa7d9[_0x49c3('0x28')],'type':_0xffa7d9[_0x49c3('0x29')][_0x49c3('0x2a')]};});_0x2f53fe[_0x49c3('0x2b')]=_[_0x49c3('0x25')](_0x16d5b0,'name');_0x2f53fe[_0x49c3('0x2c')]=_[_0x49c3('0x2d')](_0x24707f[_0x49c3('0x2c')]);_0x2f53fe[_0x49c3('0x2e')]=_[_0x49c3('0x2f')](_0x2f53fe[_0x49c3('0x2b')],_0x2f53fe[_0x49c3('0x2c')]);_0x369656[_0x49c3('0x30')]=_['intersection'](_0x2f53fe[_0x49c3('0x2b')],qs[_0x49c3('0x31')](_0x24707f[_0x49c3('0x2c')][_0x49c3('0x31')]));_0x369656['attributes']=_0x369656['attributes']['length']?_0x369656[_0x49c3('0x30')]:_0x2f53fe['model'];if(!_0x24707f[_0x49c3('0x2c')]['hasOwnProperty'](_0x49c3('0x32'))){_0x369656[_0x49c3('0x17')]=qs[_0x49c3('0x17')](_0x24707f[_0x49c3('0x2c')][_0x49c3('0x17')]);_0x369656[_0x49c3('0x16')]=qs[_0x49c3('0x16')](_0x24707f[_0x49c3('0x2c')][_0x49c3('0x16')]);}_0x369656['order']=qs[_0x49c3('0x33')](_0x24707f['query'][_0x49c3('0x33')]);_0x369656[_0x49c3('0x34')]=qs[_0x49c3('0x2e')](_['pick'](_0x24707f['query'],_0x2f53fe[_0x49c3('0x2e')]),_0x16d5b0);if(_0x24707f[_0x49c3('0x2c')][_0x49c3('0x35')]){_0x369656['where']=_['merge'](_0x369656[_0x49c3('0x34')],{'$or':_['map'](_0x16d5b0,function(_0x346d88){if(_0x346d88[_0x49c3('0x29')]!==_0x49c3('0x36')){var _0x2f5454={};_0x2f5454[_0x346d88[_0x49c3('0x22')]]={'$like':'%'+_0x24707f[_0x49c3('0x2c')][_0x49c3('0x35')]+'%'};return _0x2f5454;}})});}_0x369656=_[_0x49c3('0x37')]({},_0x369656,_0x24707f[_0x49c3('0x38')]);var _0x376f5c={'where':_0x369656[_0x49c3('0x34')]};return db['AnalyticTreeReport'][_0x49c3('0x15')](_0x376f5c)[_0x49c3('0x1e')](function(_0x33c966){_0x2da42f[_0x49c3('0x15')]=_0x33c966;if(_0x24707f['query'][_0x49c3('0x39')]){_0x369656[_0x49c3('0x3a')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x49c3('0x3b')](_0x369656);})[_0x49c3('0x1e')](function(_0x54ffc4){_0x2da42f[_0x49c3('0x3c')]=_0x54ffc4;return _0x2da42f;})['then'](respondWithFilteredResult(_0x1f1f06,_0x369656))[_0x49c3('0x3d')](handleError(_0x1f1f06,null));};exports['show']=function(_0x1332d7,_0x26a5d4){var _0x31aed3={'raw':!![],'where':{'id':_0x1332d7[_0x49c3('0x3e')]['id']}},_0xc59fee={};_0xc59fee['model']=_[_0x49c3('0x2d')](db[_0x49c3('0x26')][_0x49c3('0x27')]);_0xc59fee[_0x49c3('0x2c')]=_[_0x49c3('0x2d')](_0x1332d7[_0x49c3('0x2c')]);_0xc59fee['filters']=_[_0x49c3('0x2f')](_0xc59fee['model'],_0xc59fee['query']);_0x31aed3['attributes']=_[_0x49c3('0x2f')](_0xc59fee[_0x49c3('0x2b')],qs[_0x49c3('0x31')](_0x1332d7[_0x49c3('0x2c')][_0x49c3('0x31')]));_0x31aed3[_0x49c3('0x30')]=_0x31aed3[_0x49c3('0x30')][_0x49c3('0x3f')]?_0x31aed3[_0x49c3('0x30')]:_0xc59fee[_0x49c3('0x2b')];if(_0x1332d7[_0x49c3('0x2c')][_0x49c3('0x39')]){_0x31aed3['include']=[{'all':!![]}];}_0x31aed3=_[_0x49c3('0x37')]({},_0x31aed3,_0x1332d7[_0x49c3('0x38')]);return db[_0x49c3('0x26')][_0x49c3('0x40')](_0x31aed3)[_0x49c3('0x1e')](handleEntityNotFound(_0x26a5d4,null))[_0x49c3('0x1e')](respondWithResult(_0x26a5d4,null))['catch'](handleError(_0x26a5d4,null));};exports[_0x49c3('0x41')]=function(_0xc911b8,_0x2bed89){return db[_0x49c3('0x26')][_0x49c3('0x41')](_0xc911b8[_0x49c3('0x42')],{})[_0x49c3('0x1e')](respondWithResult(_0x2bed89,0xc9))[_0x49c3('0x3d')](handleError(_0x2bed89,null));};exports[_0x49c3('0x1d')]=function(_0x14e553,_0x104620){if(_0x14e553[_0x49c3('0x42')]['id']){delete _0x14e553[_0x49c3('0x42')]['id'];}return db[_0x49c3('0x26')]['find']({'where':{'id':_0x14e553[_0x49c3('0x3e')]['id']}})[_0x49c3('0x1e')](handleEntityNotFound(_0x104620,null))['then'](saveUpdates(_0x14e553[_0x49c3('0x42')],null))[_0x49c3('0x1e')](respondWithResult(_0x104620,null))['catch'](handleError(_0x104620,null));};exports['destroy']=function(_0x401b36,_0x682783){return db['AnalyticTreeReport'][_0x49c3('0x40')]({'where':{'id':_0x401b36[_0x49c3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x682783,null))[_0x49c3('0x1e')](removeEntity(_0x682783,null))['catch'](handleError(_0x682783,null));};
\ No newline at end of file
+var _0x7137=['Content-Range','reject','save','then','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','update','body','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x7137,0x102));var _0x7713=function(_0x3e9898,_0x3dd20e){_0x3e9898=_0x3e9898-0x0;var _0x4f93e5=_0x7137[_0x3e9898];return _0x4f93e5;};'use strict';var pdf=require(_0x7713('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7713('0x1'));var zipdir=require(_0x7713('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7713('0x3'));var moment=require(_0x7713('0x4'));var BPromise=require(_0x7713('0x5'));var Mustache=require(_0x7713('0x6'));var util=require(_0x7713('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7713('0x8'));var ejs=require(_0x7713('0x9'));var fs=require('fs');var _=require(_0x7713('0xa'));var squel=require(_0x7713('0xb'));var crypto=require(_0x7713('0xc'));var jsforce=require(_0x7713('0xd'));var deskjs=require(_0x7713('0xe'));var toCsv=require(_0x7713('0x8'));var querystring=require(_0x7713('0xf'));var Papa=require('papaparse');var Redis=require(_0x7713('0x10'));var authService=require(_0x7713('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7713('0x12'));var hardwareService=require(_0x7713('0x13'));var logger=require('../../config/logger')(_0x7713('0x14'));var utils=require(_0x7713('0x15'));var config=require(_0x7713('0x16'));var db=require(_0x7713('0x17'))['db'];function respondWithStatusCode(_0x48df8e,_0x31dd7a){_0x31dd7a=_0x31dd7a||0xcc;return function(_0x4d7598){if(_0x4d7598){return _0x48df8e[_0x7713('0x18')](_0x31dd7a);}return _0x48df8e[_0x7713('0x19')](_0x31dd7a)[_0x7713('0x1a')]();};}function respondWithResult(_0x4058a8,_0x3216c4){_0x3216c4=_0x3216c4||0xc8;return function(_0x5e7a6a){if(_0x5e7a6a){return _0x4058a8['status'](_0x3216c4)['json'](_0x5e7a6a);}};}function respondWithFilteredResult(_0x1d8dd4,_0x1a8ec0){return function(_0xe0b76e){if(_0xe0b76e){var _0x2f4eef=_0xe0b76e[_0x7713('0x1b')],_0x135721=_0x1a8ec0[_0x7713('0x1c')],_0x1b5afb=_0x1a8ec0[_0x7713('0x1c')]+_0x1a8ec0[_0x7713('0x1d')],_0x266b45;if(_0x1b5afb>=_0x2f4eef){_0x1b5afb=_0x2f4eef;_0x266b45=0xc8;}else{_0x266b45=0xce;}_0x1d8dd4[_0x7713('0x19')](_0x266b45);return _0x1d8dd4['set'](_0x7713('0x1e'),_0x135721+'-'+_0x1b5afb+'/'+_0x2f4eef)['json'](_0xe0b76e);}return null;};}function patchUpdates(_0x2ac769){return function(_0x2b3e09){try{jsonpatch['apply'](_0x2b3e09,_0x2ac769,!![]);}catch(_0x500fc8){return BPromise[_0x7713('0x1f')](_0x500fc8);}return _0x2b3e09[_0x7713('0x20')]();};}function saveUpdates(_0x457afc,_0x5713e8){return function(_0x3cc820){if(_0x3cc820){return _0x3cc820['update'](_0x457afc)[_0x7713('0x21')](function(_0x2de6ae){return _0x2de6ae;});}return null;};}function removeEntity(_0x541686,_0xec29f3){return function(_0x2d27d4){if(_0x2d27d4){return _0x2d27d4['destroy']()['then'](function(){_0x541686[_0x7713('0x19')](0xcc)[_0x7713('0x1a')]();});}};}function handleEntityNotFound(_0x13dd6f,_0x4017f1){return function(_0x34fe6d){if(!_0x34fe6d){_0x13dd6f['sendStatus'](0x194);}return _0x34fe6d;};}function handleError(_0x4c30f5,_0x19ad1f){_0x19ad1f=_0x19ad1f||0x1f4;return function(_0x412179){logger[_0x7713('0x22')](_0x412179['stack']);if(_0x412179['name']){delete _0x412179[_0x7713('0x23')];}_0x4c30f5[_0x7713('0x19')](_0x19ad1f)[_0x7713('0x24')](_0x412179);};}exports[_0x7713('0x25')]=function(_0x5b6f52,_0x31e2f7){var _0x36a37b={},_0x70adc2={},_0x3e861f={'count':0x0,'rows':[]};var _0xb92ba9=_[_0x7713('0x26')](db[_0x7713('0x27')][_0x7713('0x28')],function(_0x54c0b3){return{'name':_0x54c0b3[_0x7713('0x29')],'type':_0x54c0b3[_0x7713('0x2a')][_0x7713('0x2b')]};});_0x70adc2[_0x7713('0x2c')]=_[_0x7713('0x26')](_0xb92ba9,_0x7713('0x23'));_0x70adc2[_0x7713('0x2d')]=_[_0x7713('0x2e')](_0x5b6f52['query']);_0x70adc2[_0x7713('0x2f')]=_['intersection'](_0x70adc2[_0x7713('0x2c')],_0x70adc2[_0x7713('0x2d')]);_0x36a37b[_0x7713('0x30')]=_['intersection'](_0x70adc2[_0x7713('0x2c')],qs[_0x7713('0x31')](_0x5b6f52[_0x7713('0x2d')][_0x7713('0x31')]));_0x36a37b[_0x7713('0x30')]=_0x36a37b['attributes'][_0x7713('0x32')]?_0x36a37b[_0x7713('0x30')]:_0x70adc2['model'];if(!_0x5b6f52['query'][_0x7713('0x33')](_0x7713('0x34'))){_0x36a37b[_0x7713('0x1d')]=qs['limit'](_0x5b6f52[_0x7713('0x2d')][_0x7713('0x1d')]);_0x36a37b['offset']=qs['offset'](_0x5b6f52['query'][_0x7713('0x1c')]);}_0x36a37b['order']=qs[_0x7713('0x35')](_0x5b6f52[_0x7713('0x2d')][_0x7713('0x35')]);_0x36a37b[_0x7713('0x36')]=qs[_0x7713('0x2f')](_[_0x7713('0x37')](_0x5b6f52[_0x7713('0x2d')],_0x70adc2[_0x7713('0x2f')]),_0xb92ba9);if(_0x5b6f52[_0x7713('0x2d')]['filter']){_0x36a37b[_0x7713('0x36')]=_[_0x7713('0x38')](_0x36a37b[_0x7713('0x36')],{'$or':_['map'](_0xb92ba9,function(_0x2f5d03){if(_0x2f5d03[_0x7713('0x2a')]!==_0x7713('0x39')){var _0x2fbb0f={};_0x2fbb0f[_0x2f5d03[_0x7713('0x23')]]={'$like':'%'+_0x5b6f52[_0x7713('0x2d')][_0x7713('0x3a')]+'%'};return _0x2fbb0f;}})});}_0x36a37b=_[_0x7713('0x38')]({},_0x36a37b,_0x5b6f52[_0x7713('0x3b')]);var _0x105448={'where':_0x36a37b['where']};return db[_0x7713('0x27')][_0x7713('0x1b')](_0x105448)[_0x7713('0x21')](function(_0x286949){_0x3e861f['count']=_0x286949;if(_0x5b6f52['query'][_0x7713('0x3c')]){_0x36a37b[_0x7713('0x3d')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x7713('0x3e')](_0x36a37b);})[_0x7713('0x21')](function(_0x202e85){_0x3e861f[_0x7713('0x3f')]=_0x202e85;return _0x3e861f;})['then'](respondWithFilteredResult(_0x31e2f7,_0x36a37b))[_0x7713('0x40')](handleError(_0x31e2f7,null));};exports[_0x7713('0x41')]=function(_0x555294,_0x32757e){var _0xa0f2e={'raw':!![],'where':{'id':_0x555294[_0x7713('0x42')]['id']}},_0x2aa03a={};_0x2aa03a[_0x7713('0x2c')]=_['keys'](db['AnalyticTreeReport'][_0x7713('0x28')]);_0x2aa03a[_0x7713('0x2d')]=_['keys'](_0x555294['query']);_0x2aa03a[_0x7713('0x2f')]=_[_0x7713('0x43')](_0x2aa03a['model'],_0x2aa03a[_0x7713('0x2d')]);_0xa0f2e[_0x7713('0x30')]=_[_0x7713('0x43')](_0x2aa03a['model'],qs[_0x7713('0x31')](_0x555294[_0x7713('0x2d')]['fields']));_0xa0f2e[_0x7713('0x30')]=_0xa0f2e['attributes']['length']?_0xa0f2e[_0x7713('0x30')]:_0x2aa03a[_0x7713('0x2c')];if(_0x555294[_0x7713('0x2d')][_0x7713('0x3c')]){_0xa0f2e[_0x7713('0x3d')]=[{'all':!![]}];}_0xa0f2e=_['merge']({},_0xa0f2e,_0x555294[_0x7713('0x3b')]);return db[_0x7713('0x27')][_0x7713('0x44')](_0xa0f2e)[_0x7713('0x21')](handleEntityNotFound(_0x32757e,null))[_0x7713('0x21')](respondWithResult(_0x32757e,null))[_0x7713('0x40')](handleError(_0x32757e,null));};exports[_0x7713('0x45')]=function(_0x2d2fb9,_0x9a2ba4){return db['AnalyticTreeReport'][_0x7713('0x45')](_0x2d2fb9['body'],{})[_0x7713('0x21')](respondWithResult(_0x9a2ba4,0xc9))[_0x7713('0x40')](handleError(_0x9a2ba4,null));};exports[_0x7713('0x46')]=function(_0x2de1fe,_0x1dd608){if(_0x2de1fe[_0x7713('0x47')]['id']){delete _0x2de1fe[_0x7713('0x47')]['id'];}return db[_0x7713('0x27')][_0x7713('0x44')]({'where':{'id':_0x2de1fe[_0x7713('0x42')]['id']}})[_0x7713('0x21')](handleEntityNotFound(_0x1dd608,null))[_0x7713('0x21')](saveUpdates(_0x2de1fe[_0x7713('0x47')],null))[_0x7713('0x21')](respondWithResult(_0x1dd608,null))[_0x7713('0x40')](handleError(_0x1dd608,null));};exports['destroy']=function(_0x5122c7,_0x1f5544){return db['AnalyticTreeReport']['find']({'where':{'id':_0x5122c7[_0x7713('0x42')]['id']}})[_0x7713('0x21')](handleEntityNotFound(_0x1f5544,null))[_0x7713('0x21')](removeEntity(_0x1f5544,null))[_0x7713('0x40')](handleError(_0x1f5544,null));};
\ No newline at end of file
index 097118c..0fe3fcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['rimraf','exports','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x429876,_0x4e6d82){var _0x2cd07e=function(_0x2d6d38){while(--_0x2d6d38){_0x429876['push'](_0x429876['shift']());}};_0x2cd07e(++_0x4e6d82);}(_0xc2c7,0x134));var _0x7c2c=function(_0x118cf4,_0x988663){_0x118cf4=_0x118cf4-0x0;var _0x54d333=_0xc2c7[_0x118cf4];return _0x54d333;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var logger=require(_0x7c2c('0x1'))(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var rp=require(_0x7c2c('0x5'));var fs=require('fs');var path=require(_0x7c2c('0x6'));var rimraf=require(_0x7c2c('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x7c2c('0x8')]=function(_0x42ecc9,_0x23c038){return _0x42ecc9['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7669=['analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2c16bc,_0x280258){var _0x50f93c=function(_0x361c5b){while(--_0x361c5b){_0x2c16bc['push'](_0x2c16bc['shift']());}};_0x50f93c(++_0x280258);}(_0x7669,0xe5));var _0x9766=function(_0x3bdf14,_0x5f2a29){_0x3bdf14=_0x3bdf14-0x0;var _0x2c2535=_0x7669[_0x3bdf14];return _0x2c2535;};'use strict';var _=require(_0x9766('0x0'));var util=require(_0x9766('0x1'));var logger=require(_0x9766('0x2'))('api');var moment=require(_0x9766('0x3'));var BPromise=require(_0x9766('0x4'));var rp=require(_0x9766('0x5'));var fs=require('fs');var path=require(_0x9766('0x6'));var rimraf=require(_0x9766('0x7'));var config=require(_0x9766('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x9766('0x9')]=function(_0x1f49b5,_0x245178){return _0x1f49b5[_0x9766('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x9766('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9be32d7..06df49f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb233=['info','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xaf1c8d,_0x1a9f9a){var _0x3a65f7=function(_0x7d4630){while(--_0x7d4630){_0xaf1c8d['push'](_0xaf1c8d['shift']());}};_0x3a65f7(++_0x1a9f9a);}(_0xb233,0x141));var _0x3b23=function(_0x119c71,_0x3d7cb0){_0x119c71=_0x119c71-0x0;var _0x5f4552=_0xb233[_0x119c71];return _0x5f4552;};'use strict';var _=require(_0x3b23('0x0'));var util=require(_0x3b23('0x1'));var moment=require('moment');var BPromise=require(_0x3b23('0x2'));var rs=require(_0x3b23('0x3'));var fs=require('fs');var Redis=require(_0x3b23('0x4'));var db=require(_0x3b23('0x5'))['db'];var utils=require(_0x3b23('0x6'));var logger=require(_0x3b23('0x7'))(_0x3b23('0x8'));var config=require(_0x3b23('0x9'));var jayson=require(_0x3b23('0xa'));var client=jayson[_0x3b23('0xb')][_0x3b23('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28706a,_0x3bdc0f,_0x81ab45){return new BPromise(function(_0x5c2304,_0x195364){return client[_0x3b23('0xd')](_0x28706a,_0x81ab45)[_0x3b23('0xe')](function(_0x301493){logger[_0x3b23('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x3bdc0f,_0x3b23('0x10'));logger['debug'](_0x3b23('0x11'),_0x3bdc0f,_0x3b23('0x10'),JSON['stringify'](_0x301493));if(_0x301493[_0x3b23('0x12')]){if(_0x301493[_0x3b23('0x12')][_0x3b23('0x13')]===0x1f4){logger[_0x3b23('0x12')]('AnalyticTreeReport,\x20%s,\x20%s',_0x3bdc0f,_0x301493['error']['message']);return _0x195364(_0x301493[_0x3b23('0x12')][_0x3b23('0x14')]);}logger[_0x3b23('0x12')](_0x3b23('0x15'),_0x3bdc0f,_0x301493['error'][_0x3b23('0x14')]);return _0x5c2304(_0x301493[_0x3b23('0x12')][_0x3b23('0x14')]);}else{logger[_0x3b23('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x3bdc0f,'request\x20sent');_0x5c2304(_0x301493[_0x3b23('0x16')]['message']);}})[_0x3b23('0x17')](function(_0x1a7765){logger[_0x3b23('0x12')](_0x3b23('0x15'),_0x3bdc0f,_0x1a7765);_0x195364(_0x1a7765);});});}
\ No newline at end of file
+var _0x0ccb=['http','request','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x3f13ca,_0x5eab02){var _0x33ab93=function(_0x29f868){while(--_0x29f868){_0x3f13ca['push'](_0x3f13ca['shift']());}};_0x33ab93(++_0x5eab02);}(_0x0ccb,0x1d2));var _0xb0cc=function(_0x1d50a1,_0x4b707e){_0x1d50a1=_0x1d50a1-0x0;var _0x1b95f7=_0x0ccb[_0x1d50a1];return _0x1b95f7;};'use strict';var _=require(_0xb0cc('0x0'));var util=require(_0xb0cc('0x1'));var moment=require(_0xb0cc('0x2'));var BPromise=require(_0xb0cc('0x3'));var rs=require(_0xb0cc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb0cc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb0cc('0x6'));var jayson=require(_0xb0cc('0x7'));var client=jayson[_0xb0cc('0x8')][_0xb0cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ddd9d,_0xf3fe3c,_0x4677f0){return new BPromise(function(_0x201eac,_0x458cfc){return client[_0xb0cc('0xa')](_0x2ddd9d,_0x4677f0)['then'](function(_0x33cdda){logger['info'](_0xb0cc('0xb'),_0xf3fe3c,_0xb0cc('0xc'));logger['debug'](_0xb0cc('0xd'),_0xf3fe3c,_0xb0cc('0xc'),JSON[_0xb0cc('0xe')](_0x33cdda));if(_0x33cdda[_0xb0cc('0xf')]){if(_0x33cdda[_0xb0cc('0xf')]['code']===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0xf3fe3c,_0x33cdda[_0xb0cc('0xf')][_0xb0cc('0x10')]);return _0x458cfc(_0x33cdda['error'][_0xb0cc('0x10')]);}logger['error'](_0xb0cc('0xb'),_0xf3fe3c,_0x33cdda[_0xb0cc('0xf')]['message']);return _0x201eac(_0x33cdda[_0xb0cc('0xf')][_0xb0cc('0x10')]);}else{logger[_0xb0cc('0x11')](_0xb0cc('0xb'),_0xf3fe3c,_0xb0cc('0xc'));_0x201eac(_0x33cdda['result'][_0xb0cc('0x10')]);}})[_0xb0cc('0x12')](function(_0x261daa){logger[_0xb0cc('0xf')](_0xb0cc('0xb'),_0xf3fe3c,_0x261daa);_0x458cfc(_0x261daa);});});}
\ No newline at end of file
index d6d1aee..9e61405 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa247=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5f40e2,_0x191e3b){var _0x2fd0eb=function(_0x3617dc){while(--_0x3617dc){_0x5f40e2['push'](_0x5f40e2['shift']());}};_0x2fd0eb(++_0x191e3b);}(_0xa247,0x68));var _0x7a24=function(_0x945924,_0xb8370){_0x945924=_0x945924-0x0;var _0x3afd53=_0xa247[_0x945924];return _0x3afd53;};'use strict';var multer=require(_0x7a24('0x0'));var util=require(_0x7a24('0x1'));var path=require(_0x7a24('0x2'));var timeout=require(_0x7a24('0x3'));var express=require('express');var router=express[_0x7a24('0x4')]();var auth=require(_0x7a24('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7a24('0x6'));var controller=require(_0x7a24('0x7'));router[_0x7a24('0x8')]('/',auth[_0x7a24('0x9')](),controller[_0x7a24('0xa')]);router[_0x7a24('0x8')](_0x7a24('0xb'),auth['isAuthenticated'](),controller[_0x7a24('0xc')]);router[_0x7a24('0xd')]('/',auth['isAuthenticated'](),controller[_0x7a24('0xe')]);router[_0x7a24('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7a24('0x10')]);router[_0x7a24('0x11')](_0x7a24('0xb'),auth[_0x7a24('0x9')](),controller[_0x7a24('0x12')]);module[_0x7a24('0x13')]=router;
\ No newline at end of file
+var _0x0a52=['../../config/environment','get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x1e5da0,_0x236246){var _0x16ffeb=function(_0x68f835){while(--_0x68f835){_0x1e5da0['push'](_0x1e5da0['shift']());}};_0x16ffeb(++_0x236246);}(_0x0a52,0x1ca));var _0x20a5=function(_0x2078d4,_0x5415ab){_0x2078d4=_0x2078d4-0x0;var _0x2b7d38=_0x0a52[_0x2078d4];return _0x2b7d38;};'use strict';var multer=require(_0x20a5('0x0'));var util=require(_0x20a5('0x1'));var path=require(_0x20a5('0x2'));var timeout=require(_0x20a5('0x3'));var express=require(_0x20a5('0x4'));var router=express['Router']();var auth=require(_0x20a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x20a5('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x20a5('0x7')]('/',auth[_0x20a5('0x8')](),controller[_0x20a5('0x9')]);router[_0x20a5('0x7')](_0x20a5('0xa'),auth[_0x20a5('0x8')](),controller[_0x20a5('0xb')]);router[_0x20a5('0xc')]('/',auth[_0x20a5('0x8')](),controller['create']);router['put'](_0x20a5('0xa'),auth[_0x20a5('0x8')](),controller[_0x20a5('0xd')]);router['delete'](_0x20a5('0xa'),auth['isAuthenticated'](),controller[_0x20a5('0xe')]);module[_0x20a5('0xf')]=router;
\ No newline at end of file
index fc6e7c5..9296a8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf744=['STRING','sequelize'];(function(_0x8a3dea,_0x142bc6){var _0x98397f=function(_0x563edd){while(--_0x563edd){_0x8a3dea['push'](_0x8a3dea['shift']());}};_0x98397f(++_0x142bc6);}(_0xf744,0x147));var _0x4f74=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xf744[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0x4f74('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f74('0x1')]},'basename':{'type':Sequelize[_0x4f74('0x1')]},'type':{'type':Sequelize[_0x4f74('0x1')]}};
\ No newline at end of file
+var _0xf57a=['STRING','sequelize','exports'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0xf57a,0x1b4));var _0xaf57=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xf57a[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0xaf57('0x0'));module[_0xaf57('0x1')]={'name':{'type':Sequelize[_0xaf57('0x2')]},'basename':{'type':Sequelize[_0xaf57('0x2')]},'type':{'type':Sequelize[_0xaf57('0x2')]}};
\ No newline at end of file
index 0f4f686..a664aa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3e6=['then','destroy','error','name','send','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','Attachment','keys','find','clone','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','mimetype','download','findOne','root','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xc3e6,0x1ee));var _0x6c3e=function(_0x274638,_0x578968){_0x274638=_0x274638-0x0;var _0x5755df=_0xc3e6[_0x274638];return _0x5755df;};'use strict';var pdf=require(_0x6c3e('0x0'));var emlformat=require(_0x6c3e('0x1'));var rimraf=require(_0x6c3e('0x2'));var zipdir=require(_0x6c3e('0x3'));var jsonpatch=require(_0x6c3e('0x4'));var rp=require(_0x6c3e('0x5'));var moment=require(_0x6c3e('0x6'));var BPromise=require(_0x6c3e('0x7'));var Mustache=require(_0x6c3e('0x8'));var util=require(_0x6c3e('0x9'));var path=require(_0x6c3e('0xa'));var sox=require(_0x6c3e('0xb'));var csv=require('to-csv');var ejs=require(_0x6c3e('0xc'));var fs=require('fs');var _=require(_0x6c3e('0xd'));var squel=require(_0x6c3e('0xe'));var crypto=require('crypto');var jsforce=require(_0x6c3e('0xf'));var deskjs=require(_0x6c3e('0x10'));var toCsv=require(_0x6c3e('0x11'));var querystring=require(_0x6c3e('0x12'));var Papa=require('papaparse');var Redis=require(_0x6c3e('0x13'));var authService=require(_0x6c3e('0x14'));var qs=require(_0x6c3e('0x15'));var as=require(_0x6c3e('0x16'));var hardwareService=require(_0x6c3e('0x17'));var logger=require(_0x6c3e('0x18'))(_0x6c3e('0x19'));var utils=require('../../config/utils');var config=require(_0x6c3e('0x1a'));var db=require(_0x6c3e('0x1b'))['db'];function respondWithStatusCode(_0x4b7665,_0x316101){_0x316101=_0x316101||0xcc;return function(_0x5c9015){if(_0x5c9015){return _0x4b7665[_0x6c3e('0x1c')](_0x316101);}return _0x4b7665['status'](_0x316101)[_0x6c3e('0x1d')]();};}function respondWithResult(_0x405a49,_0x59a509){_0x59a509=_0x59a509||0xc8;return function(_0x2d0517){if(_0x2d0517){return _0x405a49[_0x6c3e('0x1e')](_0x59a509)[_0x6c3e('0x1f')](_0x2d0517);}};}function respondWithFilteredResult(_0xd66448,_0x277e48){return function(_0x294281){if(_0x294281){var _0x4ee80d=_0x294281[_0x6c3e('0x20')],_0x17b5c8=_0x277e48[_0x6c3e('0x21')],_0x4a6807=_0x277e48[_0x6c3e('0x21')]+_0x277e48['limit'],_0x22da7c;if(_0x4a6807>=_0x4ee80d){_0x4a6807=_0x4ee80d;_0x22da7c=0xc8;}else{_0x22da7c=0xce;}_0xd66448[_0x6c3e('0x1e')](_0x22da7c);return _0xd66448[_0x6c3e('0x22')](_0x6c3e('0x23'),_0x17b5c8+'-'+_0x4a6807+'/'+_0x4ee80d)[_0x6c3e('0x1f')](_0x294281);}return null;};}function patchUpdates(_0x6b562e){return function(_0x85c20a){try{jsonpatch[_0x6c3e('0x24')](_0x85c20a,_0x6b562e,!![]);}catch(_0x108c23){return BPromise[_0x6c3e('0x25')](_0x108c23);}return _0x85c20a[_0x6c3e('0x26')]();};}function saveUpdates(_0x48c604,_0x1a3cf6){return function(_0x1d4b86){if(_0x1d4b86){return _0x1d4b86[_0x6c3e('0x27')](_0x48c604)[_0x6c3e('0x28')](function(_0x1613cf){return _0x1613cf;});}return null;};}function removeEntity(_0x212272,_0x5a8ba1){return function(_0x138de4){if(_0x138de4){return _0x138de4[_0x6c3e('0x29')]()[_0x6c3e('0x28')](function(){_0x212272['status'](0xcc)[_0x6c3e('0x1d')]();});}};}function handleEntityNotFound(_0x5037fc,_0xe41d7e){return function(_0xaa7d3a){if(!_0xaa7d3a){_0x5037fc['sendStatus'](0x194);}return _0xaa7d3a;};}function handleError(_0xa17b31,_0x24a8c3){_0x24a8c3=_0x24a8c3||0x1f4;return function(_0x18ca92){logger[_0x6c3e('0x2a')](_0x18ca92['stack']);if(_0x18ca92[_0x6c3e('0x2b')]){delete _0x18ca92['name'];}_0xa17b31[_0x6c3e('0x1e')](_0x24a8c3)[_0x6c3e('0x2c')](_0x18ca92);};}exports['index']=function(_0x119b6d,_0x5ca680){var _0x509fa9={},_0x383a5d={},_0x4255da={'count':0x0,'rows':[]};var _0x54b31f=_[_0x6c3e('0x2d')](db['Attachment'][_0x6c3e('0x2e')],function(_0x1ebe5f){return{'name':_0x1ebe5f[_0x6c3e('0x2f')],'type':_0x1ebe5f[_0x6c3e('0x30')]['key']};});_0x383a5d[_0x6c3e('0x31')]=_[_0x6c3e('0x2d')](_0x54b31f,_0x6c3e('0x2b'));_0x383a5d[_0x6c3e('0x32')]=_['keys'](_0x119b6d[_0x6c3e('0x32')]);_0x383a5d['filters']=_[_0x6c3e('0x33')](_0x383a5d[_0x6c3e('0x31')],_0x383a5d[_0x6c3e('0x32')]);_0x509fa9[_0x6c3e('0x34')]=_[_0x6c3e('0x33')](_0x383a5d[_0x6c3e('0x31')],qs[_0x6c3e('0x35')](_0x119b6d[_0x6c3e('0x32')]['fields']));_0x509fa9[_0x6c3e('0x34')]=_0x509fa9['attributes'][_0x6c3e('0x36')]?_0x509fa9['attributes']:_0x383a5d['model'];if(!_0x119b6d[_0x6c3e('0x32')][_0x6c3e('0x37')](_0x6c3e('0x38'))){_0x509fa9['limit']=qs['limit'](_0x119b6d[_0x6c3e('0x32')]['limit']);_0x509fa9['offset']=qs['offset'](_0x119b6d[_0x6c3e('0x32')][_0x6c3e('0x21')]);}_0x509fa9['order']=qs[_0x6c3e('0x39')](_0x119b6d[_0x6c3e('0x32')][_0x6c3e('0x39')]);_0x509fa9[_0x6c3e('0x3a')]=qs[_0x6c3e('0x3b')](_[_0x6c3e('0x3c')](_0x119b6d[_0x6c3e('0x32')],_0x383a5d['filters']),_0x54b31f);if(_0x119b6d['query'][_0x6c3e('0x3d')]){_0x509fa9[_0x6c3e('0x3a')]=_[_0x6c3e('0x3e')](_0x509fa9[_0x6c3e('0x3a')],{'$or':_[_0x6c3e('0x2d')](_0x54b31f,function(_0x25c73c){if(_0x25c73c['type']!==_0x6c3e('0x3f')){var _0x5dcdf5={};_0x5dcdf5[_0x25c73c[_0x6c3e('0x2b')]]={'$like':'%'+_0x119b6d['query'][_0x6c3e('0x3d')]+'%'};return _0x5dcdf5;}})});}_0x509fa9=_[_0x6c3e('0x3e')]({},_0x509fa9,_0x119b6d[_0x6c3e('0x40')]);var _0xc21442={'where':_0x509fa9[_0x6c3e('0x3a')]};return db['Attachment'][_0x6c3e('0x20')](_0xc21442)['then'](function(_0xc3c6aa){_0x4255da[_0x6c3e('0x20')]=_0xc3c6aa;if(_0x119b6d[_0x6c3e('0x32')][_0x6c3e('0x41')]){_0x509fa9[_0x6c3e('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x6c3e('0x43')](_0x509fa9);})[_0x6c3e('0x28')](function(_0x30cbab){_0x4255da[_0x6c3e('0x44')]=_0x30cbab;return _0x4255da;})[_0x6c3e('0x28')](respondWithFilteredResult(_0x5ca680,_0x509fa9))[_0x6c3e('0x45')](handleError(_0x5ca680,null));};exports[_0x6c3e('0x46')]=function(_0x4c549c,_0x5d4fef){var _0x1be846={'raw':!![],'where':{'id':_0x4c549c[_0x6c3e('0x47')]['id']}},_0x23c13d={};_0x23c13d[_0x6c3e('0x31')]=_['keys'](db[_0x6c3e('0x48')]['rawAttributes']);_0x23c13d[_0x6c3e('0x32')]=_[_0x6c3e('0x49')](_0x4c549c[_0x6c3e('0x32')]);_0x23c13d[_0x6c3e('0x3b')]=_['intersection'](_0x23c13d[_0x6c3e('0x31')],_0x23c13d[_0x6c3e('0x32')]);_0x1be846['attributes']=_[_0x6c3e('0x33')](_0x23c13d[_0x6c3e('0x31')],qs[_0x6c3e('0x35')](_0x4c549c[_0x6c3e('0x32')][_0x6c3e('0x35')]));_0x1be846['attributes']=_0x1be846['attributes'][_0x6c3e('0x36')]?_0x1be846[_0x6c3e('0x34')]:_0x23c13d[_0x6c3e('0x31')];if(_0x4c549c[_0x6c3e('0x32')]['includeAll']){_0x1be846[_0x6c3e('0x42')]=[{'all':!![]}];}_0x1be846=_[_0x6c3e('0x3e')]({},_0x1be846,_0x4c549c['options']);return db[_0x6c3e('0x48')][_0x6c3e('0x4a')](_0x1be846)[_0x6c3e('0x28')](handleEntityNotFound(_0x5d4fef,null))[_0x6c3e('0x28')](respondWithResult(_0x5d4fef,null))['catch'](handleError(_0x5d4fef,null));};exports[_0x6c3e('0x4b')]=function(_0x4b660e,_0x57e1f4){var _0x53ec3a={'where':{'id':_0x4b660e['params']['id']}},_0x1a8879={};_0x1a8879['model']=_['keys'](db[_0x6c3e('0x48')][_0x6c3e('0x2e')]);_0x53ec3a[_0x6c3e('0x34')]=_[_0x6c3e('0x33')](_0x1a8879['model'],qs['fields'](_0x4b660e[_0x6c3e('0x32')]['fields']));_0x53ec3a[_0x6c3e('0x34')]=_0x53ec3a[_0x6c3e('0x34')][_0x6c3e('0x36')]?_0x53ec3a['attributes']:_0x1a8879[_0x6c3e('0x31')];if(_0x4b660e['query'][_0x6c3e('0x41')]){_0x53ec3a['include']=[{'all':!![]}];}_0x53ec3a=_[_0x6c3e('0x3e')]({},_0x53ec3a,_0x4b660e[_0x6c3e('0x40')]);return db[_0x6c3e('0x48')][_0x6c3e('0x4a')](_0x53ec3a)[_0x6c3e('0x28')](handleEntityNotFound(_0x57e1f4,null))['then'](function(_0x1a7d77){if(_0x1a7d77){var _0x5a106e=_0x1a7d77[_0x6c3e('0x4c')]({'plain':!![]});_0x5a106e=qs[_0x6c3e('0x4d')](_0x5a106e,['id',_0x6c3e('0x4e'),_0x6c3e('0x4f')]);_0x4b660e[_0x6c3e('0x50')]=_['omit'](_0x4b660e[_0x6c3e('0x50')],['id',_0x6c3e('0x4e'),_0x6c3e('0x4f')]);return db['Attachment'][_0x6c3e('0x51')](_[_0x6c3e('0x3e')](_0x5a106e,_0x4b660e[_0x6c3e('0x50')]),{'include':_0x4b660e['query'][_0x6c3e('0x41')]?[{'all':!![]}]:undefined});}})[_0x6c3e('0x28')](respondWithResult(_0x57e1f4,0xc9))[_0x6c3e('0x45')](handleError(_0x57e1f4,null));};exports[_0x6c3e('0x27')]=function(_0x36def0,_0x40524b){if(_0x36def0[_0x6c3e('0x50')]['id']){delete _0x36def0[_0x6c3e('0x50')]['id'];}return db[_0x6c3e('0x48')]['find']({'where':{'id':_0x36def0[_0x6c3e('0x47')]['id']}})[_0x6c3e('0x28')](handleEntityNotFound(_0x40524b,null))['then'](saveUpdates(_0x36def0[_0x6c3e('0x50')],null))['then'](respondWithResult(_0x40524b,null))['catch'](handleError(_0x40524b,null));};exports[_0x6c3e('0x29')]=function(_0x524f81,_0x58faa6){return db[_0x6c3e('0x48')]['find']({'where':{'id':_0x524f81['params']['id']}})[_0x6c3e('0x28')](handleEntityNotFound(_0x58faa6,null))[_0x6c3e('0x28')](removeEntity(_0x58faa6,null))['catch'](handleError(_0x58faa6,null));};exports[_0x6c3e('0x51')]=function(_0x2548b9,_0x47f810,_0x289cfe){_0x2548b9['body']['name']=_0x2548b9['file'][_0x6c3e('0x52')];_0x2548b9[_0x6c3e('0x50')][_0x6c3e('0x53')]=_0x2548b9[_0x6c3e('0x54')]['filename'];_0x2548b9[_0x6c3e('0x50')][_0x6c3e('0x30')]=_0x2548b9[_0x6c3e('0x54')][_0x6c3e('0x55')];return db['Attachment'][_0x6c3e('0x51')](_0x2548b9[_0x6c3e('0x50')])[_0x6c3e('0x28')](respondWithResult(_0x47f810,0xc9))[_0x6c3e('0x45')](handleError(_0x47f810,null));};exports[_0x6c3e('0x56')]=function(_0x436ff2,_0x35dce0,_0x5a299d){return db[_0x6c3e('0x48')][_0x6c3e('0x57')]({'where':{'id':_0x436ff2['params']['id']},'raw':!![]})[_0x6c3e('0x28')](handleEntityNotFound(_0x35dce0,null))[_0x6c3e('0x28')](function(_0x265281){if(_0x265281){return _0x35dce0[_0x6c3e('0x56')](path['join'](config[_0x6c3e('0x58')],'server/files/attachments/',_0x265281['basename']));}})[_0x6c3e('0x45')](handleError(_0x35dce0,null));};
\ No newline at end of file
+var _0x4264=['path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','find','clone','omit','createdAt','updatedAt','body','includeAll','create','file','originalname','basename','filename','mimetype','findOne','download','root','server/files/attachments/','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x12a95e,_0x3d40e3){var _0xd3ae8f=function(_0x59c849){while(--_0x59c849){_0x12a95e['push'](_0x12a95e['shift']());}};_0xd3ae8f(++_0x3d40e3);}(_0x4264,0x151));var _0x4426=function(_0x2cd235,_0x52df43){_0x2cd235=_0x2cd235-0x0;var _0x2c1532=_0x4264[_0x2cd235];return _0x2c1532;};'use strict';var pdf=require(_0x4426('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4426('0x1'));var zipdir=require(_0x4426('0x2'));var jsonpatch=require(_0x4426('0x3'));var rp=require(_0x4426('0x4'));var moment=require(_0x4426('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4426('0x6'));var path=require(_0x4426('0x7'));var sox=require(_0x4426('0x8'));var csv=require(_0x4426('0x9'));var ejs=require(_0x4426('0xa'));var fs=require('fs');var _=require(_0x4426('0xb'));var squel=require(_0x4426('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4426('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4426('0xe'));var Papa=require(_0x4426('0xf'));var Redis=require(_0x4426('0x10'));var authService=require(_0x4426('0x11'));var qs=require(_0x4426('0x12'));var as=require(_0x4426('0x13'));var hardwareService=require(_0x4426('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4426('0x15'));var db=require(_0x4426('0x16'))['db'];function respondWithStatusCode(_0x209dec,_0x3346fc){_0x3346fc=_0x3346fc||0xcc;return function(_0x16640b){if(_0x16640b){return _0x209dec['sendStatus'](_0x3346fc);}return _0x209dec[_0x4426('0x17')](_0x3346fc)[_0x4426('0x18')]();};}function respondWithResult(_0x1c8670,_0x5746b8){_0x5746b8=_0x5746b8||0xc8;return function(_0x55172f){if(_0x55172f){return _0x1c8670[_0x4426('0x17')](_0x5746b8)[_0x4426('0x19')](_0x55172f);}};}function respondWithFilteredResult(_0x4261e8,_0x596905){return function(_0x45e52e){if(_0x45e52e){var _0xca74a6=_0x45e52e[_0x4426('0x1a')],_0x413ac5=_0x596905[_0x4426('0x1b')],_0x4380b2=_0x596905[_0x4426('0x1b')]+_0x596905[_0x4426('0x1c')],_0x27d6ee;if(_0x4380b2>=_0xca74a6){_0x4380b2=_0xca74a6;_0x27d6ee=0xc8;}else{_0x27d6ee=0xce;}_0x4261e8[_0x4426('0x17')](_0x27d6ee);return _0x4261e8['set'](_0x4426('0x1d'),_0x413ac5+'-'+_0x4380b2+'/'+_0xca74a6)[_0x4426('0x19')](_0x45e52e);}return null;};}function patchUpdates(_0x7462c7){return function(_0x14bb8a){try{jsonpatch['apply'](_0x14bb8a,_0x7462c7,!![]);}catch(_0x47e0f3){return BPromise[_0x4426('0x1e')](_0x47e0f3);}return _0x14bb8a[_0x4426('0x1f')]();};}function saveUpdates(_0x47daed,_0x595b64){return function(_0x1d1a24){if(_0x1d1a24){return _0x1d1a24[_0x4426('0x20')](_0x47daed)[_0x4426('0x21')](function(_0x9678f0){return _0x9678f0;});}return null;};}function removeEntity(_0x49a949,_0x13d035){return function(_0x23b58b){if(_0x23b58b){return _0x23b58b[_0x4426('0x22')]()[_0x4426('0x21')](function(){_0x49a949[_0x4426('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x299453,_0x5e291b){return function(_0x5b0ee3){if(!_0x5b0ee3){_0x299453[_0x4426('0x23')](0x194);}return _0x5b0ee3;};}function handleError(_0x1643b5,_0x1cfa91){_0x1cfa91=_0x1cfa91||0x1f4;return function(_0x4660f5){logger[_0x4426('0x24')](_0x4660f5[_0x4426('0x25')]);if(_0x4660f5[_0x4426('0x26')]){delete _0x4660f5[_0x4426('0x26')];}_0x1643b5[_0x4426('0x17')](_0x1cfa91)[_0x4426('0x27')](_0x4660f5);};}exports[_0x4426('0x28')]=function(_0xde598f,_0x13f695){var _0x52627b={},_0xba759f={},_0xc6e728={'count':0x0,'rows':[]};var _0x1a340d=_[_0x4426('0x29')](db[_0x4426('0x2a')][_0x4426('0x2b')],function(_0x489ff9){return{'name':_0x489ff9[_0x4426('0x2c')],'type':_0x489ff9[_0x4426('0x2d')]['key']};});_0xba759f[_0x4426('0x2e')]=_[_0x4426('0x29')](_0x1a340d,_0x4426('0x26'));_0xba759f['query']=_[_0x4426('0x2f')](_0xde598f['query']);_0xba759f[_0x4426('0x30')]=_[_0x4426('0x31')](_0xba759f[_0x4426('0x2e')],_0xba759f[_0x4426('0x32')]);_0x52627b[_0x4426('0x33')]=_[_0x4426('0x31')](_0xba759f[_0x4426('0x2e')],qs[_0x4426('0x34')](_0xde598f[_0x4426('0x32')][_0x4426('0x34')]));_0x52627b['attributes']=_0x52627b[_0x4426('0x33')][_0x4426('0x35')]?_0x52627b['attributes']:_0xba759f[_0x4426('0x2e')];if(!_0xde598f['query'][_0x4426('0x36')](_0x4426('0x37'))){_0x52627b['limit']=qs['limit'](_0xde598f[_0x4426('0x32')]['limit']);_0x52627b[_0x4426('0x1b')]=qs['offset'](_0xde598f[_0x4426('0x32')][_0x4426('0x1b')]);}_0x52627b[_0x4426('0x38')]=qs[_0x4426('0x39')](_0xde598f[_0x4426('0x32')][_0x4426('0x39')]);_0x52627b[_0x4426('0x3a')]=qs[_0x4426('0x30')](_[_0x4426('0x3b')](_0xde598f[_0x4426('0x32')],_0xba759f['filters']),_0x1a340d);if(_0xde598f[_0x4426('0x32')]['filter']){_0x52627b[_0x4426('0x3a')]=_[_0x4426('0x3c')](_0x52627b[_0x4426('0x3a')],{'$or':_[_0x4426('0x29')](_0x1a340d,function(_0xb6a5a){if(_0xb6a5a[_0x4426('0x2d')]!==_0x4426('0x3d')){var _0x179737={};_0x179737[_0xb6a5a['name']]={'$like':'%'+_0xde598f['query'][_0x4426('0x3e')]+'%'};return _0x179737;}})});}_0x52627b=_[_0x4426('0x3c')]({},_0x52627b,_0xde598f[_0x4426('0x3f')]);var _0xa5b96={'where':_0x52627b[_0x4426('0x3a')]};return db['Attachment'][_0x4426('0x1a')](_0xa5b96)[_0x4426('0x21')](function(_0x4079e2){_0xc6e728[_0x4426('0x1a')]=_0x4079e2;if(_0xde598f[_0x4426('0x32')]['includeAll']){_0x52627b[_0x4426('0x40')]=[{'all':!![]}];}return db[_0x4426('0x2a')][_0x4426('0x41')](_0x52627b);})[_0x4426('0x21')](function(_0x374b91){_0xc6e728['rows']=_0x374b91;return _0xc6e728;})['then'](respondWithFilteredResult(_0x13f695,_0x52627b))[_0x4426('0x42')](handleError(_0x13f695,null));};exports[_0x4426('0x43')]=function(_0x34c22e,_0x5464d8){var _0xa382ea={'raw':!![],'where':{'id':_0x34c22e[_0x4426('0x44')]['id']}},_0x7a779c={};_0x7a779c[_0x4426('0x2e')]=_['keys'](db['Attachment']['rawAttributes']);_0x7a779c[_0x4426('0x32')]=_[_0x4426('0x2f')](_0x34c22e[_0x4426('0x32')]);_0x7a779c[_0x4426('0x30')]=_[_0x4426('0x31')](_0x7a779c['model'],_0x7a779c[_0x4426('0x32')]);_0xa382ea['attributes']=_['intersection'](_0x7a779c[_0x4426('0x2e')],qs['fields'](_0x34c22e[_0x4426('0x32')][_0x4426('0x34')]));_0xa382ea[_0x4426('0x33')]=_0xa382ea[_0x4426('0x33')]['length']?_0xa382ea['attributes']:_0x7a779c[_0x4426('0x2e')];if(_0x34c22e[_0x4426('0x32')]['includeAll']){_0xa382ea['include']=[{'all':!![]}];}_0xa382ea=_[_0x4426('0x3c')]({},_0xa382ea,_0x34c22e['options']);return db[_0x4426('0x2a')][_0x4426('0x45')](_0xa382ea)[_0x4426('0x21')](handleEntityNotFound(_0x5464d8,null))[_0x4426('0x21')](respondWithResult(_0x5464d8,null))[_0x4426('0x42')](handleError(_0x5464d8,null));};exports[_0x4426('0x46')]=function(_0x3c1936,_0x35a6bb){var _0x5c8bb3={'where':{'id':_0x3c1936['params']['id']}},_0x4f2db0={};_0x4f2db0[_0x4426('0x2e')]=_['keys'](db[_0x4426('0x2a')]['rawAttributes']);_0x5c8bb3[_0x4426('0x33')]=_['intersection'](_0x4f2db0['model'],qs[_0x4426('0x34')](_0x3c1936['query'][_0x4426('0x34')]));_0x5c8bb3[_0x4426('0x33')]=_0x5c8bb3[_0x4426('0x33')][_0x4426('0x35')]?_0x5c8bb3[_0x4426('0x33')]:_0x4f2db0[_0x4426('0x2e')];if(_0x3c1936[_0x4426('0x32')]['includeAll']){_0x5c8bb3[_0x4426('0x40')]=[{'all':!![]}];}_0x5c8bb3=_[_0x4426('0x3c')]({},_0x5c8bb3,_0x3c1936[_0x4426('0x3f')]);return db[_0x4426('0x2a')]['find'](_0x5c8bb3)[_0x4426('0x21')](handleEntityNotFound(_0x35a6bb,null))[_0x4426('0x21')](function(_0x8bfb0c){if(_0x8bfb0c){var _0x31b548=_0x8bfb0c['get']({'plain':!![]});_0x31b548=qs[_0x4426('0x47')](_0x31b548,['id',_0x4426('0x48'),_0x4426('0x49')]);_0x3c1936[_0x4426('0x4a')]=_['omit'](_0x3c1936[_0x4426('0x4a')],['id',_0x4426('0x48'),'updatedAt']);return db[_0x4426('0x2a')]['create'](_[_0x4426('0x3c')](_0x31b548,_0x3c1936[_0x4426('0x4a')]),{'include':_0x3c1936[_0x4426('0x32')][_0x4426('0x4b')]?[{'all':!![]}]:undefined});}})[_0x4426('0x21')](respondWithResult(_0x35a6bb,0xc9))[_0x4426('0x42')](handleError(_0x35a6bb,null));};exports[_0x4426('0x20')]=function(_0x1864c8,_0x548609){if(_0x1864c8[_0x4426('0x4a')]['id']){delete _0x1864c8[_0x4426('0x4a')]['id'];}return db['Attachment'][_0x4426('0x45')]({'where':{'id':_0x1864c8[_0x4426('0x44')]['id']}})['then'](handleEntityNotFound(_0x548609,null))['then'](saveUpdates(_0x1864c8[_0x4426('0x4a')],null))[_0x4426('0x21')](respondWithResult(_0x548609,null))[_0x4426('0x42')](handleError(_0x548609,null));};exports[_0x4426('0x22')]=function(_0x552deb,_0x3f5363){return db[_0x4426('0x2a')][_0x4426('0x45')]({'where':{'id':_0x552deb[_0x4426('0x44')]['id']}})[_0x4426('0x21')](handleEntityNotFound(_0x3f5363,null))['then'](removeEntity(_0x3f5363,null))[_0x4426('0x42')](handleError(_0x3f5363,null));};exports[_0x4426('0x4c')]=function(_0xc1a00d,_0x625b2b,_0xa11b4c){_0xc1a00d[_0x4426('0x4a')]['name']=_0xc1a00d[_0x4426('0x4d')][_0x4426('0x4e')];_0xc1a00d[_0x4426('0x4a')][_0x4426('0x4f')]=_0xc1a00d['file'][_0x4426('0x50')];_0xc1a00d['body'][_0x4426('0x2d')]=_0xc1a00d[_0x4426('0x4d')][_0x4426('0x51')];return db['Attachment'][_0x4426('0x4c')](_0xc1a00d['body'])[_0x4426('0x21')](respondWithResult(_0x625b2b,0xc9))[_0x4426('0x42')](handleError(_0x625b2b,null));};exports['download']=function(_0x51d765,_0x4cbfc2,_0x116e22){return db[_0x4426('0x2a')][_0x4426('0x52')]({'where':{'id':_0x51d765[_0x4426('0x44')]['id']},'raw':!![]})[_0x4426('0x21')](handleEntityNotFound(_0x4cbfc2,null))[_0x4426('0x21')](function(_0x4c1494){if(_0x4c1494){return _0x4cbfc2[_0x4426('0x53')](path['join'](config[_0x4426('0x54')],_0x4426('0x55'),_0x4c1494[_0x4426('0x4f')]));}})[_0x4426('0x42')](handleError(_0x4cbfc2,null));};
\ No newline at end of file
index e254c85..bd94f30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1cc=['attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./attachment.attributes','exports'];(function(_0x37994c,_0x35f8c8){var _0x2b50e0=function(_0xd35957){while(--_0xd35957){_0x37994c['push'](_0x37994c['shift']());}};_0x2b50e0(++_0x35f8c8);}(_0xa1cc,0x10f));var _0xca1c=function(_0x52f878,_0x38b9ed){_0x52f878=_0x52f878-0x0;var _0x45c857=_0xa1cc[_0x52f878];return _0x45c857;};'use strict';var _=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var logger=require(_0xca1c('0x2'))('api');var moment=require(_0xca1c('0x3'));var BPromise=require(_0xca1c('0x4'));var rp=require(_0xca1c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca1c('0x6'));var config=require('../../config/environment');var attributes=require(_0xca1c('0x7'));module[_0xca1c('0x8')]=function(_0x375837,_0x98dd5f){return _0x375837['define']('Attachment',attributes,{'tableName':_0xca1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2a2=['./attachment.attributes','exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x28104d,_0x1ddce1){var _0xca609b=function(_0x2b3b26){while(--_0x2b3b26){_0x28104d['push'](_0x28104d['shift']());}};_0xca609b(++_0x1ddce1);}(_0xc2a2,0x84));var _0x2c2a=function(_0x37821b,_0x4ace3a){_0x37821b=_0x37821b-0x0;var _0x2b7304=_0xc2a2[_0x37821b];return _0x2b7304;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var logger=require(_0x2c2a('0x2'))(_0x2c2a('0x3'));var moment=require('moment');var BPromise=require(_0x2c2a('0x4'));var rp=require(_0x2c2a('0x5'));var fs=require('fs');var path=require(_0x2c2a('0x6'));var rimraf=require('rimraf');var config=require(_0x2c2a('0x7'));var attributes=require(_0x2c2a('0x8'));module[_0x2c2a('0x9')]=function(_0x17db27,_0x51c919){return _0x17db27['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5800a61..a6a8138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9e4=['client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3f6374,_0x94dc37){var _0x28490a=function(_0x42d2b5){while(--_0x42d2b5){_0x3f6374['push'](_0x3f6374['shift']());}};_0x28490a(++_0x94dc37);}(_0xf9e4,0x1c7));var _0x4f9e=function(_0x11d395,_0xd62c44){_0x11d395=_0x11d395-0x0;var _0x392f77=_0xf9e4[_0x11d395];return _0x392f77;};'use strict';var _=require(_0x4f9e('0x0'));var util=require('util');var moment=require(_0x4f9e('0x1'));var BPromise=require(_0x4f9e('0x2'));var rs=require(_0x4f9e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f9e('0x4'))['db'];var utils=require(_0x4f9e('0x5'));var logger=require(_0x4f9e('0x6'))(_0x4f9e('0x7'));var config=require(_0x4f9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4f9e('0x9')][_0x4f9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20acc1,_0x3cf987,_0x1cec2f){return new BPromise(function(_0x2275d7,_0xfa0833){return client[_0x4f9e('0xb')](_0x20acc1,_0x1cec2f)[_0x4f9e('0xc')](function(_0x30467d){logger[_0x4f9e('0xd')](_0x4f9e('0xe'),_0x3cf987,'request\x20sent');logger[_0x4f9e('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x3cf987,_0x4f9e('0x10'),JSON[_0x4f9e('0x11')](_0x30467d));if(_0x30467d[_0x4f9e('0x12')]){if(_0x30467d[_0x4f9e('0x12')][_0x4f9e('0x13')]===0x1f4){logger[_0x4f9e('0x12')](_0x4f9e('0xe'),_0x3cf987,_0x30467d['error'][_0x4f9e('0x14')]);return _0xfa0833(_0x30467d[_0x4f9e('0x12')][_0x4f9e('0x14')]);}logger['error'](_0x4f9e('0xe'),_0x3cf987,_0x30467d[_0x4f9e('0x12')]['message']);return _0x2275d7(_0x30467d['error']['message']);}else{logger[_0x4f9e('0xd')](_0x4f9e('0xe'),_0x3cf987,_0x4f9e('0x10'));_0x2275d7(_0x30467d[_0x4f9e('0x15')][_0x4f9e('0x14')]);}})[_0x4f9e('0x16')](function(_0x554efe){logger['error'](_0x4f9e('0xe'),_0x3cf987,_0x554efe);_0xfa0833(_0x554efe);});});}exports[_0x4f9e('0x17')]=function(_0x47adcb){var _0x2e4220=this;return new Promise(function(_0x479178,_0xdd4739){return db[_0x4f9e('0x18')][_0x4f9e('0x19')](_0x47adcb[_0x4f9e('0x1a')],{'raw':_0x47adcb[_0x4f9e('0x1b')]?_0x47adcb[_0x4f9e('0x1b')][_0x4f9e('0x1c')]===undefined?!![]:![]:!![]})[_0x4f9e('0xc')](function(_0x218c54){logger[_0x4f9e('0xd')](_0x4f9e('0x17'),_0x47adcb);logger['debug'](_0x4f9e('0x17'),_0x47adcb,JSON[_0x4f9e('0x11')](_0x218c54));_0x479178(_0x218c54);})[_0x4f9e('0x16')](function(_0x413793){logger['error'](_0x4f9e('0x17'),_0x413793['message'],_0x47adcb);_0xdd4739(_0x2e4220[_0x4f9e('0x12')](0x1f4,_0x413793[_0x4f9e('0x14')]));});});};
\ No newline at end of file
+var _0x6ef6=['options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateAttachment','Attachment','create','body'];(function(_0x55922b,_0x3e3916){var _0x1dba37=function(_0x20e386){while(--_0x20e386){_0x55922b['push'](_0x55922b['shift']());}};_0x1dba37(++_0x3e3916);}(_0x6ef6,0x8e));var _0x66ef=function(_0x4f2797,_0x4abfff){_0x4f2797=_0x4f2797-0x0;var _0xd5c811=_0x6ef6[_0x4f2797];return _0xd5c811;};'use strict';var _=require('lodash');var util=require(_0x66ef('0x0'));var moment=require(_0x66ef('0x1'));var BPromise=require(_0x66ef('0x2'));var rs=require(_0x66ef('0x3'));var fs=require('fs');var Redis=require(_0x66ef('0x4'));var db=require(_0x66ef('0x5'))['db'];var utils=require(_0x66ef('0x6'));var logger=require('../../config/logger')(_0x66ef('0x7'));var config=require(_0x66ef('0x8'));var jayson=require(_0x66ef('0x9'));var client=jayson[_0x66ef('0xa')][_0x66ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52388c,_0x356777,_0x3809ca){return new BPromise(function(_0x241506,_0x170110){return client[_0x66ef('0xc')](_0x52388c,_0x3809ca)['then'](function(_0x322683){logger['info'](_0x66ef('0xd'),_0x356777,_0x66ef('0xe'));logger[_0x66ef('0xf')](_0x66ef('0x10'),_0x356777,_0x66ef('0xe'),JSON[_0x66ef('0x11')](_0x322683));if(_0x322683['error']){if(_0x322683['error']['code']===0x1f4){logger[_0x66ef('0x12')](_0x66ef('0xd'),_0x356777,_0x322683[_0x66ef('0x12')][_0x66ef('0x13')]);return _0x170110(_0x322683[_0x66ef('0x12')][_0x66ef('0x13')]);}logger[_0x66ef('0x12')]('Attachment,\x20%s,\x20%s',_0x356777,_0x322683['error'][_0x66ef('0x13')]);return _0x241506(_0x322683[_0x66ef('0x12')]['message']);}else{logger[_0x66ef('0x14')](_0x66ef('0xd'),_0x356777,_0x66ef('0xe'));_0x241506(_0x322683['result'][_0x66ef('0x13')]);}})[_0x66ef('0x15')](function(_0x13cbbc){logger[_0x66ef('0x12')](_0x66ef('0xd'),_0x356777,_0x13cbbc);_0x170110(_0x13cbbc);});});}exports[_0x66ef('0x16')]=function(_0x5b5d3b){var _0x21d4f6=this;return new Promise(function(_0x808d58,_0x1a178c){return db[_0x66ef('0x17')][_0x66ef('0x18')](_0x5b5d3b[_0x66ef('0x19')],{'raw':_0x5b5d3b['options']?_0x5b5d3b[_0x66ef('0x1a')][_0x66ef('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x57a79f){logger['info'](_0x66ef('0x16'),_0x5b5d3b);logger[_0x66ef('0xf')](_0x66ef('0x16'),_0x5b5d3b,JSON['stringify'](_0x57a79f));_0x808d58(_0x57a79f);})[_0x66ef('0x15')](function(_0x360e49){logger[_0x66ef('0x12')](_0x66ef('0x16'),_0x360e49['message'],_0x5b5d3b);_0x1a178c(_0x21d4f6['error'](0x1f4,_0x360e49['message']));});});};
\ No newline at end of file
index b0a05bb..db032f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x627e=['../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/clone','join','root','server/files/attachments/','%s-%s','now','originalname','post','single','file','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x535282,_0x22c94c){var _0x5d2143=function(_0x5ee926){while(--_0x5ee926){_0x535282['push'](_0x535282['shift']());}};_0x5d2143(++_0x22c94c);}(_0x627e,0x14a));var _0xe627=function(_0x5cd9b6,_0x265741){_0x5cd9b6=_0x5cd9b6-0x0;var _0x2da0e3=_0x627e[_0x5cd9b6];return _0x2da0e3;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require(_0xe627('0x3'));var express=require(_0xe627('0x4'));var router=express['Router']();var auth=require(_0xe627('0x5'));var interaction=require(_0xe627('0x6'));var config=require(_0xe627('0x7'));var controller=require('./attachment.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe627('0x8')]);router[_0xe627('0x9')](_0xe627('0xa'),auth[_0xe627('0xb')](),controller[_0xe627('0xc')]);router[_0xe627('0x9')]('/:id/download',auth[_0xe627('0xb')](),controller['download']);router['post'](_0xe627('0xd'),auth[_0xe627('0xb')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16db2f,_0x2c1820,_0x1a3e35){_0x1a3e35(null,path[_0xe627('0xe')](config[_0xe627('0xf')],_0xe627('0x10')));},'filename':function(_0x24261d,_0x3919be,_0x1922f5){_0x1922f5(null,util['format'](_0xe627('0x11'),Date[_0xe627('0x12')](),_0x3919be[_0xe627('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe627('0x14')]('/',upload[_0xe627('0x15')](_0xe627('0x16')),controller[_0xe627('0x17')]);router[_0xe627('0x18')](_0xe627('0xa'),auth[_0xe627('0xb')](),controller['update']);router[_0xe627('0x19')](_0xe627('0xa'),auth[_0xe627('0xb')](),controller[_0xe627('0x1a')]);module[_0xe627('0x1b')]=router;
\ No newline at end of file
+var _0xc3b7=['isAuthenticated','/:id/download','download','post','/:id/clone','clone','diskStorage','join','root','format','%s-%s','now','replace','single','file','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','index','get','/:id'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x67227e,_0x549cd3){_0x67227e=_0x67227e-0x0;var _0x3dc6e4=_0xc3b7[_0x67227e];return _0x3dc6e4;};'use strict';var multer=require('multer');var util=require(_0x7c3b('0x0'));var path=require(_0x7c3b('0x1'));var timeout=require(_0x7c3b('0x2'));var express=require(_0x7c3b('0x3'));var router=express[_0x7c3b('0x4')]();var auth=require(_0x7c3b('0x5'));var interaction=require(_0x7c3b('0x6'));var config=require(_0x7c3b('0x7'));var controller=require(_0x7c3b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7c3b('0x9')]);router[_0x7c3b('0xa')](_0x7c3b('0xb'),auth[_0x7c3b('0xc')](),controller['show']);router[_0x7c3b('0xa')](_0x7c3b('0xd'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0xe')]);router[_0x7c3b('0xf')](_0x7c3b('0x10'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0x11')]);var upload=multer({'storage':multer[_0x7c3b('0x12')]({'destination':function(_0x220f21,_0x74dc35,_0xf4883f){_0xf4883f(null,path[_0x7c3b('0x13')](config[_0x7c3b('0x14')],'server/files/attachments/'));},'filename':function(_0x157e55,_0x455145,_0x4c7871){_0x4c7871(null,util[_0x7c3b('0x15')](_0x7c3b('0x16'),Date[_0x7c3b('0x17')](),_0x455145['originalname'][_0x7c3b('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7c3b('0xf')]('/',upload[_0x7c3b('0x19')](_0x7c3b('0x1a')),controller['create']);router[_0x7c3b('0x1b')](_0x7c3b('0xb'),auth['isAuthenticated'](),controller[_0x7c3b('0x1c')]);router[_0x7c3b('0x1d')](_0x7c3b('0xb'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0x1e')]);module[_0x7c3b('0x1f')]=router;
\ No newline at end of file
index a8f08c2..ffb0689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5481=['disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','profile','email','callback','/login','use','clientID','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','User','find','emails','value','user','agent','then'];(function(_0x41591c,_0x1f7594){var _0x1959be=function(_0xac1101){while(--_0xac1101){_0x41591c['push'](_0x41591c['shift']());}};_0x1959be(++_0x1f7594);}(_0x5481,0x74));var _0x1548=function(_0x4f0039,_0x57f47a){_0x4f0039=_0x4f0039-0x0;var _0x319fec=_0x5481[_0x4f0039];return _0x319fec;};'use strict';var _=require(_0x1548('0x0'));var passport=require(_0x1548('0x1'));var GoogleStrategy=require(_0x1548('0x2'))[_0x1548('0x3')];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x1548('0x4'));var signToken=require(_0x1548('0x5'))[_0x1548('0x6')];var utils=require(_0x1548('0x7'));exports['login']=passport[_0x1548('0x8')](_0x1548('0x9'),{'failureRedirect':'/login','scope':[_0x1548('0xa'),_0x1548('0xb')],'session':![]});exports[_0x1548('0xc')]=passport[_0x1548('0x8')](_0x1548('0x9'),{'failureRedirect':_0x1548('0xd'),'session':![]});passport[_0x1548('0xe')](new GoogleStrategy({'clientID':config[_0x1548('0x9')]?config[_0x1548('0x9')][_0x1548('0xf')]:'id','clientSecret':config['google']?config[_0x1548('0x9')]['clientSecret']:_0x1548('0x10'),'callbackURL':config[_0x1548('0x9')]?config['google'][_0x1548('0x11')]:''},function(_0x3dfead,_0x370830,_0x482483,_0x741487){var _0x3881d9,_0x8a5ffe;return db[_0x1548('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x1548('0x13'),_0x1548('0x14')],'raw':!![]})['then'](function(_0x5d51d5){_0x3881d9=_0x5d51d5;return db[_0x1548('0x15')][_0x1548('0x16')]({'where':{'email':_['map'](_0x482483[_0x1548('0x17')],_0x1548('0x18')),'role':{'$or':['admin',_0x1548('0x19'),_0x1548('0x1a')]}}});})[_0x1548('0x1b')](function(_0x439cc5){_0x8a5ffe=_0x439cc5;if(_0x8a5ffe){if(_0x8a5ffe[_0x1548('0x1c')]){return _0x741487(_0x1548('0x1d'));}else if(_0x3881d9[_0x1548('0x14')]>0x0){if(_0x8a5ffe[_0x1548('0x1e')]){if(moment(_0x8a5ffe[_0x1548('0x1f')])[_0x1548('0x20')](_0x3881d9[_0x1548('0x14')],_0x1548('0x21'))>moment()){return _0x741487(_0x1548('0x1d'));}else{return utils[_0x1548('0x22')](_0x8a5ffe,0x0,![],null)[_0x1548('0x1b')](function(){return utils[_0x1548('0x23')](_0x8a5ffe);})[_0x1548('0x1b')](function(){return _0x741487(null,_0x8a5ffe);});}}else{return utils[_0x1548('0x23')](_0x8a5ffe)[_0x1548('0x1b')](function(){return _0x741487(null,_0x8a5ffe);});}}else{return utils[_0x1548('0x23')](_0x8a5ffe)['then'](function(){return _0x741487(null,_0x8a5ffe);});}}return _0x741487(_0x1548('0x1d'));})['catch'](function(_0x35791e){_0x741487(_0x35791e);});}));
\ No newline at end of file
+var _0xd8b0=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','email','callback','/login','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','user','agent','disabled'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xd8b0,0x194));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var passport=require(_0x0d8b('0x1'));var GoogleStrategy=require(_0x0d8b('0x2'))[_0x0d8b('0x3')];var moment=require('moment');var db=require(_0x0d8b('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0x0d8b('0x5'))[_0x0d8b('0x6')];var utils=require(_0x0d8b('0x7'));exports[_0x0d8b('0x8')]=passport[_0x0d8b('0x9')](_0x0d8b('0xa'),{'failureRedirect':'/login','scope':['profile',_0x0d8b('0xb')],'session':![]});exports[_0x0d8b('0xc')]=passport[_0x0d8b('0x9')]('google',{'failureRedirect':_0x0d8b('0xd'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x0d8b('0xa')]?config[_0x0d8b('0xa')][_0x0d8b('0xe')]:'id','clientSecret':config[_0x0d8b('0xa')]?config['google'][_0x0d8b('0xf')]:'secret','callbackURL':config[_0x0d8b('0xa')]?config['google'][_0x0d8b('0x10')]:''},function(_0x3f49f6,_0x36e705,_0x50ae14,_0x1d991b){var _0x9946bb,_0x3afe1c;return db[_0x0d8b('0x11')][_0x0d8b('0x12')]({'where':{'id':0x1},'attributes':[_0x0d8b('0x13'),'blockDuration'],'raw':!![]})[_0x0d8b('0x14')](function(_0x4c7ffb){_0x9946bb=_0x4c7ffb;return db[_0x0d8b('0x15')]['find']({'where':{'email':_['map'](_0x50ae14['emails'],'value'),'role':{'$or':['admin',_0x0d8b('0x16'),_0x0d8b('0x17')]}}});})[_0x0d8b('0x14')](function(_0x3eb260){_0x3afe1c=_0x3eb260;if(_0x3afe1c){if(_0x3afe1c[_0x0d8b('0x18')]){return _0x1d991b(_0x0d8b('0x19'));}else if(_0x9946bb['blockDuration']>0x0){if(_0x3afe1c[_0x0d8b('0x1a')]){if(moment(_0x3afe1c[_0x0d8b('0x1b')])[_0x0d8b('0x1c')](_0x9946bb['blockDuration'],_0x0d8b('0x1d'))>moment()){return _0x1d991b(_0x0d8b('0x19'));}else{return utils[_0x0d8b('0x1e')](_0x3afe1c,0x0,![],null)[_0x0d8b('0x14')](function(){return utils['getLicense'](_0x3afe1c);})[_0x0d8b('0x14')](function(){return _0x1d991b(null,_0x3afe1c);});}}else{return utils[_0x0d8b('0x1f')](_0x3afe1c)['then'](function(){return _0x1d991b(null,_0x3afe1c);});}}else{return utils[_0x0d8b('0x1f')](_0x3afe1c)[_0x0d8b('0x14')](function(){return _0x1d991b(null,_0x3afe1c);});}}return _0x1d991b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x0d8b('0x20')](function(_0x39d28b){_0x1d991b(_0x39d28b);});}));
\ No newline at end of file
index 9ed02f0..a5096bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd04b=['login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','get'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xd04b,0x145));var _0xbd04=function(_0x46f5bd,_0x3337ff){_0x46f5bd=_0x46f5bd-0x0;var _0x82b2cf=_0xd04b[_0x46f5bd];return _0x82b2cf;};'use strict';var express=require(_0xbd04('0x0'));var passport=require(_0xbd04('0x1'));var router=express[_0xbd04('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xbd04('0x3'));var authService=require('../../components/auth/service');router[_0xbd04('0x4')]('/',controller[_0xbd04('0x5')]);router[_0xbd04('0x4')](_0xbd04('0x6'),controller[_0xbd04('0x7')],authService[_0xbd04('0x8')],userController[_0xbd04('0x5')],authService[_0xbd04('0x9')]);module[_0xbd04('0xa')]=router;
\ No newline at end of file
+var _0xd51f=['../user/user.controller.js','get','login','/callback','callback','setTokenCookie','express','passport','./authGoogle.controller'];(function(_0x33fb76,_0x450ed3){var _0x41033e=function(_0x14ed5e){while(--_0x14ed5e){_0x33fb76['push'](_0x33fb76['shift']());}};_0x41033e(++_0x450ed3);}(_0xd51f,0xf0));var _0xfd51=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd51f[_0x1cc8fe];return _0x230054;};'use strict';var express=require(_0xfd51('0x0'));var passport=require(_0xfd51('0x1'));var router=express['Router']();var controller=require(_0xfd51('0x2'));var userController=require(_0xfd51('0x3'));var authService=require('../../components/auth/service');router[_0xfd51('0x4')]('/',controller[_0xfd51('0x5')]);router['get'](_0xfd51('0x6'),controller[_0xfd51('0x7')],authService['isMiddleware'],userController[_0xfd51('0x5')],authService[_0xfd51('0x8')]);module['exports']=router;
\ No newline at end of file
index 4ffa149..43e40bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f5f=['randomstring','../../mysqldb','../../components/auth/service','../../config/utils','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','blocked','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','format','request','SendMail','error','message','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','generate','trim','toLowerCase','User','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','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','securePassword','use','util','passport','passport-local','Strategy','jayson/promise','lodash'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x7f5f,0xa0));var _0xf7f5=function(_0x12de60,_0x3fe1a6){_0x12de60=_0x12de60-0x0;var _0x173631=_0x7f5f[_0x12de60];return _0x173631;};'use strict';var util=require(_0xf7f5('0x0'));var passport=require(_0xf7f5('0x1'));var LocalStrategy=require(_0xf7f5('0x2'))[_0xf7f5('0x3')];var jayson=require(_0xf7f5('0x4'));var _=require(_0xf7f5('0x5'));var rs=require(_0xf7f5('0x6'));var moment=require('moment');var db=require(_0xf7f5('0x7'))['db'];var authService=require(_0xf7f5('0x8'));var utils=require(_0xf7f5('0x9'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x53b8a5,_0xde7bc4,_0x5e554e,_0xdb5ef2){var _0x3cb338,_0x59b945;return db[_0xf7f5('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xf7f5('0xb'),_0xf7f5('0xc')],'raw':!![]})[_0xf7f5('0xd')](function(_0x20f38e){_0x3cb338=_0x20f38e;return _0x53b8a5[_0xf7f5('0xe')]({'attributes':['id','name',_0xf7f5('0xf'),_0xf7f5('0x10'),_0xf7f5('0x11'),_0xf7f5('0x12'),_0xf7f5('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0xde7bc4,'role':{'$or':[_0xf7f5('0x14'),_0xf7f5('0x15'),_0xf7f5('0x16')]}}});})[_0xf7f5('0xd')](function(_0x5f2dc9){if(!_0x5f2dc9||_0x5f2dc9&&_0x5f2dc9['name']!==_0xde7bc4){throw new Error(_0xf7f5('0x17'));}else{_0x59b945=_0x5f2dc9;return _0x59b945;}})['then'](function(){_0x59b945[_0xf7f5('0x18')](_0x5e554e,function(_0x19e199,_0x49cc1a){var _0x4786cc=_0x59b945[_0xf7f5('0x19')]+0x1;if(_0x19e199){return _0xdb5ef2(_0x19e199);}else if(!_0x49cc1a){if(_0x59b945[_0xf7f5('0x12')]){return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});}else if(_0x3cb338[_0xf7f5('0xb')]>0x0){if(_0x59b945[_0xf7f5('0x13')]){if(_0x3cb338[_0xf7f5('0xc')]>0x0){if(moment(_0x59b945['blockedAt'])[_0xf7f5('0x1a')](_0x3cb338[_0xf7f5('0xc')],_0xf7f5('0x1b'))>moment()){return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});}else{return utils[_0xf7f5('0x1c')](_0x59b945,_0x4786cc,![],null)['then'](function(){return _0xdb5ef2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});}}else{if(_0x4786cc>=_0x3cb338[_0xf7f5('0xb')]){return utils[_0xf7f5('0x1c')](_0x59b945,0x0,!![],moment())['then'](function(){return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});});}else{return utils[_0xf7f5('0x1c')](_0x59b945,_0x4786cc,![],null)['then'](function(){return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});});}}}else{return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});}}else{if(_0x59b945['disabled']){return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});}else if(_0x3cb338[_0xf7f5('0xb')]>0x0){if(_0x59b945['blocked']){if(_0x3cb338[_0xf7f5('0xc')]>0x0){if(moment(_0x59b945[_0xf7f5('0x1d')])['add'](_0x3cb338[_0xf7f5('0xc')],_0xf7f5('0x1b'))>moment()){return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});}else{return utils[_0xf7f5('0x1c')](_0x59b945,0x0,![],null)['then'](function(){return utils[_0xf7f5('0x1e')](_0x59b945);})[_0xf7f5('0xd')](function(){return _0xdb5ef2(null,_0x59b945);});}}else{return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});}}else{return utils['clearBlockUser'](_0x59b945,0x0,![],null)[_0xf7f5('0xd')](function(){return utils[_0xf7f5('0x1e')](_0x59b945);})['then'](function(){return _0xdb5ef2(null,_0x59b945);})[_0xf7f5('0x1f')](function(_0x204256){return _0xdb5ef2(null,![],_0x204256);});}}else{if(_0x59b945[_0xf7f5('0x13')]){return _0xdb5ef2(null,![],{'message':_0xf7f5('0x17')});}else{return utils['getLicense'](_0x59b945)[_0xf7f5('0xd')](function(){return _0xdb5ef2(null,_0x59b945);});}}}});})[_0xf7f5('0x1f')](function(_0x4b2af1){return _0xdb5ef2(null,![],_0x4b2af1);});}function sendServiceMail(_0x3ac1ca){return db[_0xf7f5('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0xf7f5('0x21'),_0xf7f5('0x22')],'include':[{'model':db[_0xf7f5('0x23')],'as':_0xf7f5('0x24')}]})[_0xf7f5('0xd')](function(_0x4005ad){if(!_0x4005ad){throw new Error(_0xf7f5('0x25'));}var _0x839804={'tls':{'rejectUnauthorized':![]}};if(_0x4005ad[_0xf7f5('0x24')][_0xf7f5('0x26')]){_0x839804[_0xf7f5('0x26')]=_0x4005ad[_0xf7f5('0x24')][_0xf7f5('0x26')];}else{_0x839804[_0xf7f5('0x27')]=_0x4005ad[_0xf7f5('0x24')][_0xf7f5('0x27')];_0x839804[_0xf7f5('0x28')]=_0x4005ad[_0xf7f5('0x24')][_0xf7f5('0x28')];_0x839804[_0xf7f5('0x29')]=_0x4005ad[_0xf7f5('0x24')][_0xf7f5('0x29')];}if(_0x4005ad['Smtp']['authentication']){_0x839804[_0xf7f5('0x2a')]={'user':_0x4005ad['Smtp'][_0xf7f5('0x15')],'pass':_0x4005ad[_0xf7f5('0x24')][_0xf7f5('0x2b')]};}var _0x396f0e={'account':_0x839804,'message':_['merge']({'from':util[_0xf7f5('0x2c')]('\x22%s\x22\x20<%s>',_0x4005ad[_0xf7f5('0x21')],_0x4005ad[_0xf7f5('0x22')]||_0x4005ad['Smtp'][_0xf7f5('0x15')])},_0x3ac1ca)};return client[_0xf7f5('0x2d')](_0xf7f5('0x2e'),_0x396f0e);})['then'](function(_0xa1a0c){if(_0xa1a0c[_0xf7f5('0x2f')]){throw new Error(util[_0xf7f5('0x2c')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xa1a0c[_0xf7f5('0x2f')][_0xf7f5('0x30')]||JSON['stringify'](_0xa1a0c['error'])));}return!![];});}function handleError(_0x52759f,_0x1c89fa,_0x242556){return _0x52759f['status'](_0x1c89fa||0x1f4)[_0xf7f5('0x31')]({'message':_0x242556?_0x242556['message']||_0x242556:''});}function checkPasswordPattern(_0x2d4987,_0x3d2f35,_0x42ff10){if(_0x42ff10){var _0x462fd9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x462fd9[_0xf7f5('0x32')](_0x3d2f35)){return _0x2d4987;}else{throw new Error(_0xf7f5('0x33'));}}else{return _0x2d4987;}}exports[_0xf7f5('0x34')]=function(_0x23ab00,_0x3e8d60,_0xec68f6){passport[_0xf7f5('0x18')](_0xf7f5('0x35'),function(_0x5d0f6c,_0x5b6a36,_0x506515){var _0x2877a1=_0x5d0f6c||_0x506515;if(_0x2877a1){return handleError(_0x3e8d60,0x191,_0x2877a1);}if(!_0x5b6a36){return handleError(_0x3e8d60,0x194,{'message':_0xf7f5('0x36')});}else{var _0x20ad1b={'payload':{'id':_0x5b6a36['id'],'role':_0x5b6a36[_0xf7f5('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xf7f5('0x37')](_0x20ad1b)[_0xf7f5('0xd')](function(_0x560cce){_0x3e8d60[_0xf7f5('0x38')]({'id':_0x5b6a36['id'],'token':_0x560cce,'statusCall':'','isAlreadyLogged':_0x5b6a36[_0xf7f5('0x39')]});});}})(_0x23ab00,_0x3e8d60,_0xec68f6);};exports['forgot']=function(_0x204c8c,_0x10664c,_0x413f1a){if(!_0x204c8c[_0xf7f5('0x3a')][_0xf7f5('0x22')]){return handleError(_0x10664c,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1aa08e=rs[_0xf7f5('0x3b')]();_0x204c8c[_0xf7f5('0x3a')]['email']=_0x204c8c[_0xf7f5('0x3a')]['email'][_0xf7f5('0x3c')]()[_0xf7f5('0x3d')]();var _0x15afe9;return db['Setting'][_0xf7f5('0xe')]({'where':{'id':0x1},'attributes':[_0xf7f5('0xb'),'blockDuration'],'raw':!![]})[_0xf7f5('0xd')](function(_0x1fac0d){_0x15afe9=_0x1fac0d;return db[_0xf7f5('0x3e')][_0xf7f5('0x3f')]({'where':{'email':_0x204c8c['body']['email']}});})['then'](function(_0x23e783){if(!_0x23e783){throw new Error(_0xf7f5('0x40'));}if(_0x23e783['disabled']){throw new Error(_0xf7f5('0x41'));}if(_0x23e783['blocked']){if(moment(_0x23e783[_0xf7f5('0x1d')])[_0xf7f5('0x1a')](_0x15afe9[_0xf7f5('0xc')],_0xf7f5('0x1b'))>moment()){throw new Error(_0xf7f5('0x42'));}else{_0x23e783['blocked']=![];_0x23e783[_0xf7f5('0x1d')]=null;}}_0x23e783[_0xf7f5('0x43')]=_0x1aa08e;_0x23e783[_0xf7f5('0x44')]=Date[_0xf7f5('0x45')]()+0x36ee80;return _0x23e783[_0xf7f5('0x46')]();})[_0xf7f5('0xd')](function(){return sendServiceMail({'to':_0x204c8c[_0xf7f5('0x3a')][_0xf7f5('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf7f5('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xf7f5('0x48')+_0x204c8c[_0xf7f5('0x49')][_0xf7f5('0x27')]+_0xf7f5('0x4a')+_0x1aa08e+'\x0a\x0a'+_0xf7f5('0x4b')});})['then'](function(){_0x10664c[_0xf7f5('0x4c')](0xc8)['send']({'message':_0xf7f5('0x4d')});})[_0xf7f5('0x1f')](function(_0x36d3d6){return handleError(_0x10664c,0x1f4,_0x36d3d6);});};exports[_0xf7f5('0x4e')]=function(_0x29b4ce,_0xd0349f,_0x4f0ec4){var _0x2845a6;return db[_0xf7f5('0x3e')][_0xf7f5('0x3f')]({'where':{'resetPasswordToken':_0x29b4ce[_0xf7f5('0x4f')][_0xf7f5('0x50')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xf7f5('0xd')](function(_0x3b27c8){_0x2845a6=_0x3b27c8;if(!_0x2845a6){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xf7f5('0xa')][_0xf7f5('0xe')]({'attributes':['id','securePassword']});})[_0xf7f5('0xd')](function(_0x157b58){return checkPasswordPattern(_0x157b58,_0x29b4ce['body']['password'],_0x157b58[_0xf7f5('0x51')]);})[_0xf7f5('0xd')](function(){_0x2845a6[_0xf7f5('0xf')]=_0x29b4ce[_0xf7f5('0x3a')][_0xf7f5('0xf')];_0x2845a6['resetPasswordToken']=null;_0x2845a6[_0xf7f5('0x44')]=null;return _0x2845a6['save']();})[_0xf7f5('0xd')](function(){_0xd0349f[_0xf7f5('0x4c')](0xc8)[_0xf7f5('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x149e11){return handleError(_0xd0349f,0x1f4,_0x149e11);});};passport[_0xf7f5('0x52')](new LocalStrategy({'usernameField':_0xf7f5('0x21'),'passwordField':_0xf7f5('0xf')},function(_0x836850,_0x3580f1,_0x45cf8e){return localAuthenticate(db[_0xf7f5('0x3e')],_0x836850,_0x3580f1,_0x45cf8e);}));
\ No newline at end of file
+var _0x8de8=['Setting','securePassword','resetPasswordToken','util','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','blockDuration','then','name','password','salt','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','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0x8de8,0x19d));var _0x88de=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8de8[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x88de('0x0'));var passport=require('passport');var LocalStrategy=require(_0x88de('0x1'))[_0x88de('0x2')];var jayson=require(_0x88de('0x3'));var _=require('lodash');var rs=require(_0x88de('0x4'));var moment=require(_0x88de('0x5'));var db=require(_0x88de('0x6'))['db'];var authService=require(_0x88de('0x7'));var utils=require(_0x88de('0x8'));var client=jayson[_0x88de('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x40550a,_0xcd2390,_0x5837f7,_0x3219a9){var _0x2eafef,_0x196cc9;return db['Setting'][_0x88de('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x88de('0xb')],'raw':!![]})[_0x88de('0xc')](function(_0x4f3378){_0x2eafef=_0x4f3378;return _0x40550a[_0x88de('0xa')]({'attributes':['id',_0x88de('0xd'),_0x88de('0xe'),_0x88de('0xf'),_0x88de('0x10'),_0x88de('0x11'),_0x88de('0x12'),_0x88de('0x13'),_0x88de('0x14')],'where':{'name':_0xcd2390,'role':{'$or':[_0x88de('0x15'),_0x88de('0x16'),_0x88de('0x17')]}}});})[_0x88de('0xc')](function(_0x2b15c4){if(!_0x2b15c4||_0x2b15c4&&_0x2b15c4[_0x88de('0xd')]!==_0xcd2390){throw new Error(_0x88de('0x18'));}else{_0x196cc9=_0x2b15c4;return _0x196cc9;}})[_0x88de('0xc')](function(){_0x196cc9[_0x88de('0x19')](_0x5837f7,function(_0x5ed58b,_0x3eb4dc){var _0x44a419=_0x196cc9[_0x88de('0x14')]+0x1;if(_0x5ed58b){return _0x3219a9(_0x5ed58b);}else if(!_0x3eb4dc){if(_0x196cc9[_0x88de('0x11')]){return _0x3219a9(null,![],{'message':_0x88de('0x18')});}else if(_0x2eafef[_0x88de('0x1a')]>0x0){if(_0x196cc9[_0x88de('0x12')]){if(_0x2eafef[_0x88de('0xb')]>0x0){if(moment(_0x196cc9['blockedAt'])[_0x88de('0x1b')](_0x2eafef[_0x88de('0xb')],_0x88de('0x1c'))>moment()){return _0x3219a9(null,![],{'message':_0x88de('0x18')});}else{return utils[_0x88de('0x1d')](_0x196cc9,_0x44a419,![],null)[_0x88de('0xc')](function(){return _0x3219a9(null,![],{'message':_0x88de('0x18')});});}}else{return _0x3219a9(null,![],{'message':_0x88de('0x18')});}}else{if(_0x44a419>=_0x2eafef[_0x88de('0x1a')]){return utils[_0x88de('0x1d')](_0x196cc9,0x0,!![],moment())[_0x88de('0xc')](function(){return _0x3219a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x88de('0x1d')](_0x196cc9,_0x44a419,![],null)[_0x88de('0xc')](function(){return _0x3219a9(null,![],{'message':_0x88de('0x18')});});}}}else{return _0x3219a9(null,![],{'message':_0x88de('0x18')});}}else{if(_0x196cc9['disabled']){return _0x3219a9(null,![],{'message':_0x88de('0x18')});}else if(_0x2eafef['allowedLoginAttempts']>0x0){if(_0x196cc9[_0x88de('0x12')]){if(_0x2eafef[_0x88de('0xb')]>0x0){if(moment(_0x196cc9[_0x88de('0x13')])[_0x88de('0x1b')](_0x2eafef[_0x88de('0xb')],_0x88de('0x1c'))>moment()){return _0x3219a9(null,![],{'message':_0x88de('0x18')});}else{return utils[_0x88de('0x1d')](_0x196cc9,0x0,![],null)[_0x88de('0xc')](function(){return utils[_0x88de('0x1e')](_0x196cc9);})[_0x88de('0xc')](function(){return _0x3219a9(null,_0x196cc9);});}}else{return _0x3219a9(null,![],{'message':_0x88de('0x18')});}}else{return utils[_0x88de('0x1d')](_0x196cc9,0x0,![],null)['then'](function(){return utils[_0x88de('0x1e')](_0x196cc9);})['then'](function(){return _0x3219a9(null,_0x196cc9);})[_0x88de('0x1f')](function(_0x4110cf){return _0x3219a9(null,![],_0x4110cf);});}}else{if(_0x196cc9['blocked']){return _0x3219a9(null,![],{'message':_0x88de('0x18')});}else{return utils['getLicense'](_0x196cc9)[_0x88de('0xc')](function(){return _0x3219a9(null,_0x196cc9);});}}}});})['catch'](function(_0xf271f3){return _0x3219a9(null,![],_0xf271f3);});}function sendServiceMail(_0x569aa5){return db[_0x88de('0x20')][_0x88de('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x88de('0x22')],'include':[{'model':db[_0x88de('0x23')],'as':_0x88de('0x24')}]})['then'](function(_0x5016a3){if(!_0x5016a3){throw new Error(_0x88de('0x25'));}var _0x2b4485={'tls':{'rejectUnauthorized':![]}};if(_0x5016a3[_0x88de('0x24')][_0x88de('0x26')]){_0x2b4485[_0x88de('0x26')]=_0x5016a3[_0x88de('0x24')][_0x88de('0x26')];}else{_0x2b4485['host']=_0x5016a3[_0x88de('0x24')][_0x88de('0x27')];_0x2b4485[_0x88de('0x28')]=_0x5016a3[_0x88de('0x24')][_0x88de('0x28')];_0x2b4485[_0x88de('0x29')]=_0x5016a3[_0x88de('0x24')][_0x88de('0x29')];}if(_0x5016a3['Smtp'][_0x88de('0x2a')]){_0x2b4485[_0x88de('0x2b')]={'user':_0x5016a3[_0x88de('0x24')][_0x88de('0x16')],'pass':_0x5016a3['Smtp'][_0x88de('0x2c')]};}var _0x2d3514={'account':_0x2b4485,'message':_['merge']({'from':util[_0x88de('0x2d')](_0x88de('0x2e'),_0x5016a3[_0x88de('0xd')],_0x5016a3[_0x88de('0x22')]||_0x5016a3[_0x88de('0x24')]['user'])},_0x569aa5)};return client[_0x88de('0x2f')](_0x88de('0x30'),_0x2d3514);})[_0x88de('0xc')](function(_0x4c3ca8){if(_0x4c3ca8[_0x88de('0x31')]){throw new Error(util[_0x88de('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4c3ca8['error'][_0x88de('0x32')]||JSON[_0x88de('0x33')](_0x4c3ca8[_0x88de('0x31')])));}return!![];});}function handleError(_0x690ede,_0x32249c,_0x14529c){return _0x690ede[_0x88de('0x34')](_0x32249c||0x1f4)['send']({'message':_0x14529c?_0x14529c[_0x88de('0x32')]||_0x14529c:''});}function checkPasswordPattern(_0x9c4563,_0x352af1,_0x1464b8){if(_0x1464b8){var _0x32029a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32029a[_0x88de('0x35')](_0x352af1)){return _0x9c4563;}else{throw new Error(_0x88de('0x36'));}}else{return _0x9c4563;}}exports['login']=function(_0x30a6cb,_0x18411b,_0x32ef22){passport[_0x88de('0x19')]('local',function(_0x304ab5,_0x3c2610,_0x4f1155){var _0x2f5c05=_0x304ab5||_0x4f1155;if(_0x2f5c05){return handleError(_0x18411b,0x191,_0x2f5c05);}if(!_0x3c2610){return handleError(_0x18411b,0x194,{'message':_0x88de('0x37')});}else{var _0x5d5b09={'payload':{'id':_0x3c2610['id'],'role':_0x3c2610[_0x88de('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5d5b09)['then'](function(_0x11c665){_0x18411b[_0x88de('0x38')]({'id':_0x3c2610['id'],'token':_0x11c665,'statusCall':'','isAlreadyLogged':_0x3c2610[_0x88de('0x39')]});});}})(_0x30a6cb,_0x18411b,_0x32ef22);};exports[_0x88de('0x3a')]=function(_0x4fe892,_0x4798f3,_0x1f5f60){if(!_0x4fe892['body']['email']){return handleError(_0x4798f3,0x1f4,{'message':_0x88de('0x3b')});}var _0x1ccc5a=rs[_0x88de('0x3c')]();_0x4fe892[_0x88de('0x3d')]['email']=_0x4fe892[_0x88de('0x3d')]['email'][_0x88de('0x3e')]()[_0x88de('0x3f')]();var _0x353e92;return db['Setting'][_0x88de('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x88de('0xb')],'raw':!![]})[_0x88de('0xc')](function(_0x414852){_0x353e92=_0x414852;return db[_0x88de('0x40')][_0x88de('0x21')]({'where':{'email':_0x4fe892[_0x88de('0x3d')][_0x88de('0x22')]}});})[_0x88de('0xc')](function(_0x3e8625){if(!_0x3e8625){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3e8625[_0x88de('0x11')]){throw new Error(_0x88de('0x41'));}if(_0x3e8625[_0x88de('0x12')]){if(moment(_0x3e8625[_0x88de('0x13')])[_0x88de('0x1b')](_0x353e92['blockDuration'],_0x88de('0x1c'))>moment()){throw new Error(_0x88de('0x42'));}else{_0x3e8625['blocked']=![];_0x3e8625[_0x88de('0x13')]=null;}}_0x3e8625['resetPasswordToken']=_0x1ccc5a;_0x3e8625['resetPasswordExpires']=Date[_0x88de('0x43')]()+0x36ee80;return _0x3e8625[_0x88de('0x44')]();})[_0x88de('0xc')](function(){return sendServiceMail({'to':_0x4fe892[_0x88de('0x3d')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x88de('0x45')+_0x88de('0x46')+_0x4fe892[_0x88de('0x47')]['host']+_0x88de('0x48')+_0x1ccc5a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x88de('0xc')](function(){_0x4798f3[_0x88de('0x34')](0xc8)[_0x88de('0x49')]({'message':_0x88de('0x4a')});})[_0x88de('0x1f')](function(_0x4a0b2a){return handleError(_0x4798f3,0x1f4,_0x4a0b2a);});};exports[_0x88de('0x4b')]=function(_0x24a3df,_0x591263,_0x51d15d){var _0x3f3bf1;return db[_0x88de('0x40')][_0x88de('0x21')]({'where':{'resetPasswordToken':_0x24a3df[_0x88de('0x4c')][_0x88de('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x88de('0xc')](function(_0x232141){_0x3f3bf1=_0x232141;if(!_0x3f3bf1){throw new Error(_0x88de('0x4e'));}return db[_0x88de('0x4f')]['findOne']({'attributes':['id',_0x88de('0x50')]});})[_0x88de('0xc')](function(_0x23418d){return checkPasswordPattern(_0x23418d,_0x24a3df[_0x88de('0x3d')]['password'],_0x23418d['securePassword']);})[_0x88de('0xc')](function(){_0x3f3bf1[_0x88de('0xe')]=_0x24a3df[_0x88de('0x3d')][_0x88de('0xe')];_0x3f3bf1[_0x88de('0x51')]=null;_0x3f3bf1['resetPasswordExpires']=null;return _0x3f3bf1[_0x88de('0x44')]();})[_0x88de('0xc')](function(){_0x591263[_0x88de('0x34')](0xc8)[_0x88de('0x49')]({'message':'Password\x20reset!'});})[_0x88de('0x1f')](function(_0x5e2791){return handleError(_0x591263,0x1f4,_0x5e2791);});};passport['use'](new LocalStrategy({'usernameField':_0x88de('0xd'),'passwordField':_0x88de('0xe')},function(_0x857433,_0x4949b5,_0x6f4a3e){return localAuthenticate(db['User'],_0x857433,_0x4949b5,_0x6f4a3e);}));
\ No newline at end of file
index 96bb139..11e85ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa29e=['/forgot','/reset/:token','reset','express','Router','./authLocal.controller','login'];(function(_0x56d5ea,_0x530395){var _0x3080c=function(_0xa87a3a){while(--_0xa87a3a){_0x56d5ea['push'](_0x56d5ea['shift']());}};_0x3080c(++_0x530395);}(_0xa29e,0xb2));var _0xea29=function(_0x190b37,_0x386197){_0x190b37=_0x190b37-0x0;var _0x4e7eb7=_0xa29e[_0x190b37];return _0x4e7eb7;};'use strict';var express=require(_0xea29('0x0'));var router=express[_0xea29('0x1')]();var controller=require(_0xea29('0x2'));router['post']('/',controller[_0xea29('0x3')]);router['post'](_0xea29('0x4'),controller['forgot']);router['post'](_0xea29('0x5'),controller[_0xea29('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x19ef=['forgot','express','Router','post','login','/forgot'];(function(_0xb60dba,_0xc37d23){var _0x2cd16a=function(_0x1558ae){while(--_0x1558ae){_0xb60dba['push'](_0xb60dba['shift']());}};_0x2cd16a(++_0xc37d23);}(_0x19ef,0x9d));var _0xf19e=function(_0x9bb4e1,_0x3870c8){_0x9bb4e1=_0x9bb4e1-0x0;var _0x38b73e=_0x19ef[_0x9bb4e1];return _0x38b73e;};'use strict';var express=require(_0xf19e('0x0'));var router=express[_0xf19e('0x1')]();var controller=require('./authLocal.controller');router[_0xf19e('0x2')]('/',controller[_0xf19e('0x3')]);router['post'](_0xf19e('0x4'),controller[_0xf19e('0x5')]);router[_0xf19e('0x2')]('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
index 3d2f206..19b609a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda18=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0xac9b71,_0x4c8fa2){var _0x276103=function(_0x97a41a){while(--_0x97a41a){_0xac9b71['push'](_0xac9b71['shift']());}};_0x276103(++_0x4c8fa2);}(_0xda18,0x1c0));var _0x8da1=function(_0x53b363,_0x9bd12f){_0x53b363=_0x53b363-0x0;var _0x1ddf68=_0xda18[_0x53b363];return _0x1ddf68;};'use strict';var Sequelize=require(_0x8da1('0x0'));module['exports']={'name':{'type':Sequelize[_0x8da1('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x8da1('0x1')]},'description':{'type':Sequelize[_0x8da1('0x1')]},'status':{'type':Sequelize[_0x8da1('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8da1('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xf766=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x467b5d,_0x22ca71){var _0x3a64da=function(_0x2709b7){while(--_0x2709b7){_0x467b5d['push'](_0x467b5d['shift']());}};_0x3a64da(++_0x22ca71);}(_0xf766,0xac));var _0x6f76=function(_0xfca0bf,_0x8ac9f9){_0xfca0bf=_0xfca0bf-0x0;var _0xc72568=_0xf766[_0xfca0bf];return _0xc72568;};'use strict';var Sequelize=require(_0x6f76('0x0'));module[_0x6f76('0x1')]={'name':{'type':Sequelize[_0x6f76('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6f76('0x2')]},'status':{'type':Sequelize[_0x6f76('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6f76('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index 41f66a5..1eb7eac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddf6=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','Automation','count','includeAll','include','rows','catch','show','rawAttributes','create','body','params','addConditions','ids','omit','findOne','Condition','pick','getConditions','find','addActions','Action','getActions','html-pdf','rimraf','zip-dir'];(function(_0x3e69ee,_0x6a675a){var _0x48a37e=function(_0x190c2c){while(--_0x190c2c){_0x3e69ee['push'](_0x3e69ee['shift']());}};_0x48a37e(++_0x6a675a);}(_0xddf6,0x9b));var _0x6ddf=function(_0x559fa7,_0x54f784){_0x559fa7=_0x559fa7-0x0;var _0x1cd4c3=_0xddf6[_0x559fa7];return _0x1cd4c3;};'use strict';var pdf=require(_0x6ddf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6ddf('0x1'));var zipdir=require(_0x6ddf('0x2'));var jsonpatch=require(_0x6ddf('0x3'));var rp=require(_0x6ddf('0x4'));var moment=require(_0x6ddf('0x5'));var BPromise=require(_0x6ddf('0x6'));var Mustache=require(_0x6ddf('0x7'));var util=require(_0x6ddf('0x8'));var path=require('path');var sox=require(_0x6ddf('0x9'));var csv=require(_0x6ddf('0xa'));var ejs=require(_0x6ddf('0xb'));var fs=require('fs');var _=require(_0x6ddf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6ddf('0xd'));var deskjs=require(_0x6ddf('0xe'));var toCsv=require(_0x6ddf('0xa'));var querystring=require('querystring');var Papa=require(_0x6ddf('0xf'));var Redis=require(_0x6ddf('0x10'));var authService=require(_0x6ddf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6ddf('0x12'));var hardwareService=require(_0x6ddf('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6ddf('0x14'));var db=require(_0x6ddf('0x15'))['db'];function respondWithStatusCode(_0xb03973,_0x20d77d){_0x20d77d=_0x20d77d||0xcc;return function(_0x43befa){if(_0x43befa){return _0xb03973['sendStatus'](_0x20d77d);}return _0xb03973[_0x6ddf('0x16')](_0x20d77d)['end']();};}function respondWithResult(_0x3294e2,_0xcdf5a){_0xcdf5a=_0xcdf5a||0xc8;return function(_0x5b6bbf){if(_0x5b6bbf){return _0x3294e2['status'](_0xcdf5a)[_0x6ddf('0x17')](_0x5b6bbf);}};}function respondWithFilteredResult(_0x3906a3,_0x587fce){return function(_0x502fad){if(_0x502fad){var _0x20756b=_0x502fad['count'],_0x4c7a00=_0x587fce[_0x6ddf('0x18')],_0x209311=_0x587fce['offset']+_0x587fce[_0x6ddf('0x19')],_0x1ecaf3;if(_0x209311>=_0x20756b){_0x209311=_0x20756b;_0x1ecaf3=0xc8;}else{_0x1ecaf3=0xce;}_0x3906a3[_0x6ddf('0x16')](_0x1ecaf3);return _0x3906a3['set'](_0x6ddf('0x1a'),_0x4c7a00+'-'+_0x209311+'/'+_0x20756b)[_0x6ddf('0x17')](_0x502fad);}return null;};}function patchUpdates(_0x10e6bd){return function(_0x709867){try{jsonpatch[_0x6ddf('0x1b')](_0x709867,_0x10e6bd,!![]);}catch(_0x5c891f){return BPromise['reject'](_0x5c891f);}return _0x709867[_0x6ddf('0x1c')]();};}function saveUpdates(_0x28235b,_0x79244b){return function(_0x25e5a2){if(_0x25e5a2){return _0x25e5a2[_0x6ddf('0x1d')](_0x28235b)[_0x6ddf('0x1e')](function(_0x1c228b){return _0x1c228b;});}return null;};}function removeEntity(_0x1fa922,_0x2265dd){return function(_0x2bec02){if(_0x2bec02){return _0x2bec02[_0x6ddf('0x1f')]()[_0x6ddf('0x1e')](function(){_0x1fa922[_0x6ddf('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x295a19,_0x15225f){return function(_0x183545){if(!_0x183545){_0x295a19['sendStatus'](0x194);}return _0x183545;};}function handleError(_0xebdb5b,_0x54f762){_0x54f762=_0x54f762||0x1f4;return function(_0x20cfa2){logger[_0x6ddf('0x20')](_0x20cfa2[_0x6ddf('0x21')]);if(_0x20cfa2[_0x6ddf('0x22')]){delete _0x20cfa2[_0x6ddf('0x22')];}_0xebdb5b[_0x6ddf('0x16')](_0x54f762)[_0x6ddf('0x23')](_0x20cfa2);};}exports[_0x6ddf('0x24')]=function(_0x202c49,_0x53b342){var _0x5a7496={},_0x3d3b78={},_0x2839da={'count':0x0,'rows':[]};var _0x5c50ed=_[_0x6ddf('0x25')](db['Automation']['rawAttributes'],function(_0x22d088){return{'name':_0x22d088[_0x6ddf('0x26')],'type':_0x22d088[_0x6ddf('0x27')]['key']};});_0x3d3b78['model']=_['map'](_0x5c50ed,'name');_0x3d3b78[_0x6ddf('0x28')]=_[_0x6ddf('0x29')](_0x202c49[_0x6ddf('0x28')]);_0x3d3b78[_0x6ddf('0x2a')]=_[_0x6ddf('0x2b')](_0x3d3b78[_0x6ddf('0x2c')],_0x3d3b78[_0x6ddf('0x28')]);_0x5a7496[_0x6ddf('0x2d')]=_[_0x6ddf('0x2b')](_0x3d3b78['model'],qs[_0x6ddf('0x2e')](_0x202c49['query'][_0x6ddf('0x2e')]));_0x5a7496[_0x6ddf('0x2d')]=_0x5a7496[_0x6ddf('0x2d')][_0x6ddf('0x2f')]?_0x5a7496[_0x6ddf('0x2d')]:_0x3d3b78[_0x6ddf('0x2c')];if(!_0x202c49[_0x6ddf('0x28')][_0x6ddf('0x30')](_0x6ddf('0x31'))){_0x5a7496[_0x6ddf('0x19')]=qs[_0x6ddf('0x19')](_0x202c49['query'][_0x6ddf('0x19')]);_0x5a7496['offset']=qs[_0x6ddf('0x18')](_0x202c49['query'][_0x6ddf('0x18')]);}_0x5a7496[_0x6ddf('0x32')]=qs['sort'](_0x202c49[_0x6ddf('0x28')][_0x6ddf('0x33')]);_0x5a7496[_0x6ddf('0x34')]=qs['filters'](_['pick'](_0x202c49[_0x6ddf('0x28')],_0x3d3b78[_0x6ddf('0x2a')]),_0x5c50ed);if(_0x202c49[_0x6ddf('0x28')][_0x6ddf('0x35')]){_0x5a7496[_0x6ddf('0x34')]=_['merge'](_0x5a7496[_0x6ddf('0x34')],{'$or':_['map'](_0x5c50ed,function(_0x4a3c55){if(_0x4a3c55[_0x6ddf('0x27')]!==_0x6ddf('0x36')){var _0x44fb96={};_0x44fb96[_0x4a3c55['name']]={'$like':'%'+_0x202c49['query'][_0x6ddf('0x35')]+'%'};return _0x44fb96;}})});}_0x5a7496=_[_0x6ddf('0x37')]({},_0x5a7496,_0x202c49[_0x6ddf('0x38')]);var _0x3b90f8={'where':_0x5a7496[_0x6ddf('0x34')]};return db[_0x6ddf('0x39')][_0x6ddf('0x3a')](_0x3b90f8)['then'](function(_0x2400f4){_0x2839da[_0x6ddf('0x3a')]=_0x2400f4;if(_0x202c49[_0x6ddf('0x28')][_0x6ddf('0x3b')]){_0x5a7496[_0x6ddf('0x3c')]=[{'all':!![]}];}return db[_0x6ddf('0x39')]['findAll'](_0x5a7496);})[_0x6ddf('0x1e')](function(_0x590ad3){_0x2839da[_0x6ddf('0x3d')]=_0x590ad3;return _0x2839da;})[_0x6ddf('0x1e')](respondWithFilteredResult(_0x53b342,_0x5a7496))[_0x6ddf('0x3e')](handleError(_0x53b342,null));};exports[_0x6ddf('0x3f')]=function(_0xa041e6,_0x3235a4){var _0x38d631={'raw':![],'where':{'id':_0xa041e6['params']['id']}},_0x20639d={};_0x20639d[_0x6ddf('0x2c')]=_['keys'](db[_0x6ddf('0x39')][_0x6ddf('0x40')]);_0x20639d[_0x6ddf('0x28')]=_['keys'](_0xa041e6[_0x6ddf('0x28')]);_0x20639d[_0x6ddf('0x2a')]=_['intersection'](_0x20639d[_0x6ddf('0x2c')],_0x20639d['query']);_0x38d631[_0x6ddf('0x2d')]=_[_0x6ddf('0x2b')](_0x20639d[_0x6ddf('0x2c')],qs[_0x6ddf('0x2e')](_0xa041e6['query'][_0x6ddf('0x2e')]));_0x38d631[_0x6ddf('0x2d')]=_0x38d631['attributes'][_0x6ddf('0x2f')]?_0x38d631[_0x6ddf('0x2d')]:_0x20639d[_0x6ddf('0x2c')];if(_0xa041e6[_0x6ddf('0x28')]['includeAll']){_0x38d631[_0x6ddf('0x3c')]=[{'all':!![]}];}_0x38d631=_[_0x6ddf('0x37')]({},_0x38d631,_0xa041e6['options']);return db[_0x6ddf('0x39')]['find'](_0x38d631)[_0x6ddf('0x1e')](handleEntityNotFound(_0x3235a4,null))[_0x6ddf('0x1e')](respondWithResult(_0x3235a4,null))['catch'](handleError(_0x3235a4,null));};exports[_0x6ddf('0x41')]=function(_0x1370f5,_0xd9f9){return db[_0x6ddf('0x39')][_0x6ddf('0x41')](_0x1370f5[_0x6ddf('0x42')],{})[_0x6ddf('0x1e')](respondWithResult(_0xd9f9,0xc9))[_0x6ddf('0x3e')](handleError(_0xd9f9,null));};exports[_0x6ddf('0x1d')]=function(_0x2a6fbc,_0x83c20a){if(_0x2a6fbc['body']['id']){delete _0x2a6fbc[_0x6ddf('0x42')]['id'];}return db[_0x6ddf('0x39')]['find']({'where':{'id':_0x2a6fbc[_0x6ddf('0x43')]['id']}})['then'](handleEntityNotFound(_0x83c20a,null))[_0x6ddf('0x1e')](saveUpdates(_0x2a6fbc[_0x6ddf('0x42')],null))[_0x6ddf('0x1e')](respondWithResult(_0x83c20a,null))['catch'](handleError(_0x83c20a,null));};exports[_0x6ddf('0x1f')]=function(_0x439fce,_0x4c4646){return db[_0x6ddf('0x39')]['find']({'where':{'id':_0x439fce[_0x6ddf('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c4646,null))[_0x6ddf('0x1e')](removeEntity(_0x4c4646,null))[_0x6ddf('0x3e')](handleError(_0x4c4646,null));};exports[_0x6ddf('0x44')]=function(_0x299b9f,_0x4c2508,_0x179899){return db['Condition']['find']({'where':{'id':_0x299b9f['params']['id']}})[_0x6ddf('0x1e')](handleEntityNotFound(_0x4c2508,null))[_0x6ddf('0x1e')](function(_0x425e81){if(_0x425e81){return _0x425e81[_0x6ddf('0x44')](_0x299b9f[_0x6ddf('0x42')][_0x6ddf('0x45')],_[_0x6ddf('0x46')](_0x299b9f[_0x6ddf('0x42')],[_0x6ddf('0x45'),'id'])||{});}})[_0x6ddf('0x1e')](respondWithResult(_0x4c2508,null))['catch'](handleError(_0x4c2508,null));};exports['getConditions']=function(_0x18de3a,_0x5ba0fe,_0xca952f){var _0x2016f3={};var _0x2dd619={};var _0x526bce;var _0xc61ef7;return db[_0x6ddf('0x39')][_0x6ddf('0x47')]({'where':{'id':_0x18de3a['params']['id']}})[_0x6ddf('0x1e')](handleEntityNotFound(_0x5ba0fe,null))[_0x6ddf('0x1e')](function(_0x5d563e){if(_0x5d563e){_0x526bce=_0x5d563e;_0x2dd619['model']=_['keys'](db[_0x6ddf('0x48')][_0x6ddf('0x40')]);_0x2dd619['query']=_[_0x6ddf('0x29')](_0x18de3a[_0x6ddf('0x28')]);_0x2dd619['filters']=_[_0x6ddf('0x2b')](_0x2dd619[_0x6ddf('0x2c')],_0x2dd619[_0x6ddf('0x28')]);_0x2016f3['attributes']=_[_0x6ddf('0x2b')](_0x2dd619[_0x6ddf('0x2c')],qs['fields'](_0x18de3a[_0x6ddf('0x28')][_0x6ddf('0x2e')]));_0x2016f3['attributes']=_0x2016f3['attributes'][_0x6ddf('0x2f')]?_0x2016f3[_0x6ddf('0x2d')]:_0x2dd619[_0x6ddf('0x2c')];_0x2016f3['order']=qs['sort'](_0x18de3a['query'][_0x6ddf('0x33')]);_0x2016f3[_0x6ddf('0x34')]=qs[_0x6ddf('0x2a')](_[_0x6ddf('0x49')](_0x18de3a[_0x6ddf('0x28')],_0x2dd619[_0x6ddf('0x2a')]));if(_0x18de3a[_0x6ddf('0x28')][_0x6ddf('0x35')]){_0x2016f3[_0x6ddf('0x34')]=_[_0x6ddf('0x37')](_0x2016f3[_0x6ddf('0x34')],{'$or':_[_0x6ddf('0x25')](_0x2016f3[_0x6ddf('0x2d')],function(_0x4e9b8b){var _0x129d05={};_0x129d05[_0x4e9b8b]={'$like':'%'+_0x18de3a['query'][_0x6ddf('0x35')]+'%'};return _0x129d05;})});}_0x2016f3=_[_0x6ddf('0x37')]({},_0x2016f3,_0x18de3a[_0x6ddf('0x38')]);return _0x526bce['getConditions'](_0x2016f3);}})['then'](function(_0x23199b){if(_0x23199b){_0xc61ef7=_0x23199b['length'];if(!_0x18de3a[_0x6ddf('0x28')]['hasOwnProperty'](_0x6ddf('0x31'))){_0x2016f3['limit']=qs[_0x6ddf('0x19')](_0x18de3a[_0x6ddf('0x28')][_0x6ddf('0x19')]);_0x2016f3[_0x6ddf('0x18')]=qs[_0x6ddf('0x18')](_0x18de3a[_0x6ddf('0x28')][_0x6ddf('0x18')]);}return _0x526bce[_0x6ddf('0x4a')](_0x2016f3);}})[_0x6ddf('0x1e')](function(_0x247b90){if(_0x247b90){return _0x247b90?{'count':_0xc61ef7,'rows':_0x247b90}:null;}})[_0x6ddf('0x1e')](respondWithResult(_0x5ba0fe,null))[_0x6ddf('0x3e')](handleError(_0x5ba0fe,null));};exports['addActions']=function(_0x20bb5f,_0xb66c3d,_0x1c2760){return db['Action'][_0x6ddf('0x4b')]({'where':{'id':_0x20bb5f['params']['id']}})[_0x6ddf('0x1e')](handleEntityNotFound(_0xb66c3d,null))[_0x6ddf('0x1e')](function(_0x2411e5){if(_0x2411e5){return _0x2411e5[_0x6ddf('0x4c')](_0x20bb5f[_0x6ddf('0x42')][_0x6ddf('0x45')],_['omit'](_0x20bb5f[_0x6ddf('0x42')],[_0x6ddf('0x45'),'id'])||{});}})['then'](respondWithResult(_0xb66c3d,null))[_0x6ddf('0x3e')](handleError(_0xb66c3d,null));};exports['getActions']=function(_0x5b2b19,_0x3455fe,_0xa06fbe){var _0x33d8e={};var _0x375484={};var _0x285592;var _0xd56feb;return db['Automation'][_0x6ddf('0x47')]({'where':{'id':_0x5b2b19['params']['id']}})[_0x6ddf('0x1e')](handleEntityNotFound(_0x3455fe,null))['then'](function(_0x416c45){if(_0x416c45){_0x285592=_0x416c45;_0x375484[_0x6ddf('0x2c')]=_[_0x6ddf('0x29')](db[_0x6ddf('0x4d')][_0x6ddf('0x40')]);_0x375484['query']=_[_0x6ddf('0x29')](_0x5b2b19['query']);_0x375484[_0x6ddf('0x2a')]=_[_0x6ddf('0x2b')](_0x375484[_0x6ddf('0x2c')],_0x375484[_0x6ddf('0x28')]);_0x33d8e[_0x6ddf('0x2d')]=_[_0x6ddf('0x2b')](_0x375484[_0x6ddf('0x2c')],qs['fields'](_0x5b2b19[_0x6ddf('0x28')][_0x6ddf('0x2e')]));_0x33d8e['attributes']=_0x33d8e[_0x6ddf('0x2d')][_0x6ddf('0x2f')]?_0x33d8e[_0x6ddf('0x2d')]:_0x375484[_0x6ddf('0x2c')];_0x33d8e[_0x6ddf('0x32')]=qs[_0x6ddf('0x33')](_0x5b2b19[_0x6ddf('0x28')][_0x6ddf('0x33')]);_0x33d8e['where']=qs[_0x6ddf('0x2a')](_[_0x6ddf('0x49')](_0x5b2b19[_0x6ddf('0x28')],_0x375484[_0x6ddf('0x2a')]));if(_0x5b2b19[_0x6ddf('0x28')][_0x6ddf('0x35')]){_0x33d8e[_0x6ddf('0x34')]=_[_0x6ddf('0x37')](_0x33d8e[_0x6ddf('0x34')],{'$or':_[_0x6ddf('0x25')](_0x33d8e[_0x6ddf('0x2d')],function(_0x125774){var _0x2ef894={};_0x2ef894[_0x125774]={'$like':'%'+_0x5b2b19['query'][_0x6ddf('0x35')]+'%'};return _0x2ef894;})});}_0x33d8e=_[_0x6ddf('0x37')]({},_0x33d8e,_0x5b2b19[_0x6ddf('0x38')]);return _0x285592[_0x6ddf('0x4e')](_0x33d8e);}})[_0x6ddf('0x1e')](function(_0x2e37b9){if(_0x2e37b9){_0xd56feb=_0x2e37b9[_0x6ddf('0x2f')];if(!_0x5b2b19[_0x6ddf('0x28')][_0x6ddf('0x30')](_0x6ddf('0x31'))){_0x33d8e[_0x6ddf('0x19')]=qs[_0x6ddf('0x19')](_0x5b2b19[_0x6ddf('0x28')][_0x6ddf('0x19')]);_0x33d8e[_0x6ddf('0x18')]=qs['offset'](_0x5b2b19['query']['offset']);}return _0x285592[_0x6ddf('0x4e')](_0x33d8e);}})[_0x6ddf('0x1e')](function(_0x893646){if(_0x893646){return _0x893646?{'count':_0xd56feb,'rows':_0x893646}:null;}})['then'](respondWithResult(_0x3455fe,null))['catch'](handleError(_0x3455fe,null));};
\ No newline at end of file
+var _0x8ce2=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','limit','reject','save','update','error','stack','name','send','index','Automation','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','findAll','then','params','intersection','catch','create','body','destroy','find','addConditions','ids','omit','findOne','Condition','getConditions','addActions','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','querystring'];(function(_0x5e202e,_0x1bf6ec){var _0x4777ad=function(_0x4332f2){while(--_0x4332f2){_0x5e202e['push'](_0x5e202e['shift']());}};_0x4777ad(++_0x1bf6ec);}(_0x8ce2,0x1c6));var _0x28ce=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x8ce2[_0x47b58b];return _0x46bebe;};'use strict';var pdf=require(_0x28ce('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x28ce('0x1'));var zipdir=require(_0x28ce('0x2'));var jsonpatch=require(_0x28ce('0x3'));var rp=require(_0x28ce('0x4'));var moment=require(_0x28ce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x28ce('0x6'));var util=require(_0x28ce('0x7'));var path=require(_0x28ce('0x8'));var sox=require('sox');var csv=require(_0x28ce('0x9'));var ejs=require(_0x28ce('0xa'));var fs=require('fs');var _=require(_0x28ce('0xb'));var squel=require(_0x28ce('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x28ce('0x9'));var querystring=require(_0x28ce('0xd'));var Papa=require(_0x28ce('0xe'));var Redis=require('ioredis');var authService=require(_0x28ce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x28ce('0x10'));var hardwareService=require(_0x28ce('0x11'));var logger=require('../../config/logger')(_0x28ce('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x28ce('0x13'))['db'];function respondWithStatusCode(_0xf88d5,_0x41590c){_0x41590c=_0x41590c||0xcc;return function(_0x4f298a){if(_0x4f298a){return _0xf88d5[_0x28ce('0x14')](_0x41590c);}return _0xf88d5[_0x28ce('0x15')](_0x41590c)[_0x28ce('0x16')]();};}function respondWithResult(_0x2ee968,_0x1bdc6e){_0x1bdc6e=_0x1bdc6e||0xc8;return function(_0x336955){if(_0x336955){return _0x2ee968[_0x28ce('0x15')](_0x1bdc6e)[_0x28ce('0x17')](_0x336955);}};}function respondWithFilteredResult(_0x4c88a9,_0x266946){return function(_0x524abc){if(_0x524abc){var _0x15049d=_0x524abc['count'],_0xbd607c=_0x266946['offset'],_0x1342e5=_0x266946[_0x28ce('0x18')]+_0x266946[_0x28ce('0x19')],_0x5bdc42;if(_0x1342e5>=_0x15049d){_0x1342e5=_0x15049d;_0x5bdc42=0xc8;}else{_0x5bdc42=0xce;}_0x4c88a9[_0x28ce('0x15')](_0x5bdc42);return _0x4c88a9['set']('Content-Range',_0xbd607c+'-'+_0x1342e5+'/'+_0x15049d)['json'](_0x524abc);}return null;};}function patchUpdates(_0x35dd81){return function(_0x3e5a15){try{jsonpatch['apply'](_0x3e5a15,_0x35dd81,!![]);}catch(_0x207747){return BPromise[_0x28ce('0x1a')](_0x207747);}return _0x3e5a15[_0x28ce('0x1b')]();};}function saveUpdates(_0x3cae6b,_0x595c7c){return function(_0x8db703){if(_0x8db703){return _0x8db703[_0x28ce('0x1c')](_0x3cae6b)['then'](function(_0x389796){return _0x389796;});}return null;};}function removeEntity(_0x24fdaa,_0x1b1dc2){return function(_0x503ec1){if(_0x503ec1){return _0x503ec1['destroy']()['then'](function(){_0x24fdaa['status'](0xcc)[_0x28ce('0x16')]();});}};}function handleEntityNotFound(_0x3b1834,_0x412b50){return function(_0x43cf12){if(!_0x43cf12){_0x3b1834[_0x28ce('0x14')](0x194);}return _0x43cf12;};}function handleError(_0x3ff376,_0x3c89e4){_0x3c89e4=_0x3c89e4||0x1f4;return function(_0x3aff14){logger[_0x28ce('0x1d')](_0x3aff14[_0x28ce('0x1e')]);if(_0x3aff14[_0x28ce('0x1f')]){delete _0x3aff14[_0x28ce('0x1f')];}_0x3ff376[_0x28ce('0x15')](_0x3c89e4)[_0x28ce('0x20')](_0x3aff14);};}exports[_0x28ce('0x21')]=function(_0x5252ad,_0x5e6ec4){var _0x42855c={},_0x181264={},_0x50e8c7={'count':0x0,'rows':[]};var _0x2a87d9=_['map'](db[_0x28ce('0x22')][_0x28ce('0x23')],function(_0x24d201){return{'name':_0x24d201[_0x28ce('0x24')],'type':_0x24d201['type'][_0x28ce('0x25')]};});_0x181264[_0x28ce('0x26')]=_['map'](_0x2a87d9,'name');_0x181264[_0x28ce('0x27')]=_[_0x28ce('0x28')](_0x5252ad[_0x28ce('0x27')]);_0x181264[_0x28ce('0x29')]=_['intersection'](_0x181264[_0x28ce('0x26')],_0x181264[_0x28ce('0x27')]);_0x42855c['attributes']=_['intersection'](_0x181264[_0x28ce('0x26')],qs[_0x28ce('0x2a')](_0x5252ad[_0x28ce('0x27')][_0x28ce('0x2a')]));_0x42855c[_0x28ce('0x2b')]=_0x42855c[_0x28ce('0x2b')][_0x28ce('0x2c')]?_0x42855c[_0x28ce('0x2b')]:_0x181264[_0x28ce('0x26')];if(!_0x5252ad[_0x28ce('0x27')][_0x28ce('0x2d')](_0x28ce('0x2e'))){_0x42855c[_0x28ce('0x19')]=qs[_0x28ce('0x19')](_0x5252ad[_0x28ce('0x27')][_0x28ce('0x19')]);_0x42855c[_0x28ce('0x18')]=qs['offset'](_0x5252ad[_0x28ce('0x27')]['offset']);}_0x42855c[_0x28ce('0x2f')]=qs[_0x28ce('0x30')](_0x5252ad[_0x28ce('0x27')][_0x28ce('0x30')]);_0x42855c[_0x28ce('0x31')]=qs['filters'](_[_0x28ce('0x32')](_0x5252ad[_0x28ce('0x27')],_0x181264['filters']),_0x2a87d9);if(_0x5252ad['query'][_0x28ce('0x33')]){_0x42855c[_0x28ce('0x31')]=_[_0x28ce('0x34')](_0x42855c[_0x28ce('0x31')],{'$or':_[_0x28ce('0x35')](_0x2a87d9,function(_0x505b25){if(_0x505b25[_0x28ce('0x36')]!==_0x28ce('0x37')){var _0x45a66c={};_0x45a66c[_0x505b25[_0x28ce('0x1f')]]={'$like':'%'+_0x5252ad[_0x28ce('0x27')]['filter']+'%'};return _0x45a66c;}})});}_0x42855c=_[_0x28ce('0x34')]({},_0x42855c,_0x5252ad[_0x28ce('0x38')]);var _0x309398={'where':_0x42855c[_0x28ce('0x31')]};return db[_0x28ce('0x22')][_0x28ce('0x39')](_0x309398)['then'](function(_0x2bce60){_0x50e8c7['count']=_0x2bce60;if(_0x5252ad[_0x28ce('0x27')][_0x28ce('0x3a')]){_0x42855c[_0x28ce('0x3b')]=[{'all':!![]}];}return db[_0x28ce('0x22')][_0x28ce('0x3c')](_0x42855c);})[_0x28ce('0x3d')](function(_0x32c126){_0x50e8c7['rows']=_0x32c126;return _0x50e8c7;})[_0x28ce('0x3d')](respondWithFilteredResult(_0x5e6ec4,_0x42855c))['catch'](handleError(_0x5e6ec4,null));};exports['show']=function(_0x503dc3,_0x4b2807){var _0x9797d3={'raw':![],'where':{'id':_0x503dc3[_0x28ce('0x3e')]['id']}},_0x403c54={};_0x403c54['model']=_[_0x28ce('0x28')](db['Automation'][_0x28ce('0x23')]);_0x403c54[_0x28ce('0x27')]=_[_0x28ce('0x28')](_0x503dc3[_0x28ce('0x27')]);_0x403c54['filters']=_['intersection'](_0x403c54[_0x28ce('0x26')],_0x403c54[_0x28ce('0x27')]);_0x9797d3['attributes']=_[_0x28ce('0x3f')](_0x403c54[_0x28ce('0x26')],qs[_0x28ce('0x2a')](_0x503dc3[_0x28ce('0x27')][_0x28ce('0x2a')]));_0x9797d3[_0x28ce('0x2b')]=_0x9797d3['attributes'][_0x28ce('0x2c')]?_0x9797d3[_0x28ce('0x2b')]:_0x403c54[_0x28ce('0x26')];if(_0x503dc3[_0x28ce('0x27')][_0x28ce('0x3a')]){_0x9797d3[_0x28ce('0x3b')]=[{'all':!![]}];}_0x9797d3=_[_0x28ce('0x34')]({},_0x9797d3,_0x503dc3[_0x28ce('0x38')]);return db['Automation']['find'](_0x9797d3)[_0x28ce('0x3d')](handleEntityNotFound(_0x4b2807,null))[_0x28ce('0x3d')](respondWithResult(_0x4b2807,null))[_0x28ce('0x40')](handleError(_0x4b2807,null));};exports[_0x28ce('0x41')]=function(_0xd07c1e,_0x1e15b9){return db[_0x28ce('0x22')][_0x28ce('0x41')](_0xd07c1e[_0x28ce('0x42')],{})[_0x28ce('0x3d')](respondWithResult(_0x1e15b9,0xc9))[_0x28ce('0x40')](handleError(_0x1e15b9,null));};exports[_0x28ce('0x1c')]=function(_0x1e155d,_0x822bc1){if(_0x1e155d[_0x28ce('0x42')]['id']){delete _0x1e155d[_0x28ce('0x42')]['id'];}return db[_0x28ce('0x22')]['find']({'where':{'id':_0x1e155d[_0x28ce('0x3e')]['id']}})[_0x28ce('0x3d')](handleEntityNotFound(_0x822bc1,null))[_0x28ce('0x3d')](saveUpdates(_0x1e155d[_0x28ce('0x42')],null))[_0x28ce('0x3d')](respondWithResult(_0x822bc1,null))[_0x28ce('0x40')](handleError(_0x822bc1,null));};exports[_0x28ce('0x43')]=function(_0x2b95f8,_0x538dc7){return db[_0x28ce('0x22')][_0x28ce('0x44')]({'where':{'id':_0x2b95f8[_0x28ce('0x3e')]['id']}})[_0x28ce('0x3d')](handleEntityNotFound(_0x538dc7,null))[_0x28ce('0x3d')](removeEntity(_0x538dc7,null))[_0x28ce('0x40')](handleError(_0x538dc7,null));};exports[_0x28ce('0x45')]=function(_0x1adb0c,_0x18a863,_0x34b391){return db['Condition'][_0x28ce('0x44')]({'where':{'id':_0x1adb0c[_0x28ce('0x3e')]['id']}})[_0x28ce('0x3d')](handleEntityNotFound(_0x18a863,null))[_0x28ce('0x3d')](function(_0x19727d){if(_0x19727d){return _0x19727d[_0x28ce('0x45')](_0x1adb0c[_0x28ce('0x42')][_0x28ce('0x46')],_[_0x28ce('0x47')](_0x1adb0c['body'],[_0x28ce('0x46'),'id'])||{});}})['then'](respondWithResult(_0x18a863,null))[_0x28ce('0x40')](handleError(_0x18a863,null));};exports['getConditions']=function(_0x28051c,_0x305a99,_0x3c7d6f){var _0x3abee4={};var _0x17d05a={};var _0x450db9;var _0x876ac5;return db['Automation'][_0x28ce('0x48')]({'where':{'id':_0x28051c[_0x28ce('0x3e')]['id']}})[_0x28ce('0x3d')](handleEntityNotFound(_0x305a99,null))[_0x28ce('0x3d')](function(_0x5637dc){if(_0x5637dc){_0x450db9=_0x5637dc;_0x17d05a[_0x28ce('0x26')]=_[_0x28ce('0x28')](db[_0x28ce('0x49')][_0x28ce('0x23')]);_0x17d05a[_0x28ce('0x27')]=_['keys'](_0x28051c[_0x28ce('0x27')]);_0x17d05a[_0x28ce('0x29')]=_['intersection'](_0x17d05a[_0x28ce('0x26')],_0x17d05a[_0x28ce('0x27')]);_0x3abee4['attributes']=_['intersection'](_0x17d05a[_0x28ce('0x26')],qs[_0x28ce('0x2a')](_0x28051c[_0x28ce('0x27')][_0x28ce('0x2a')]));_0x3abee4[_0x28ce('0x2b')]=_0x3abee4[_0x28ce('0x2b')][_0x28ce('0x2c')]?_0x3abee4['attributes']:_0x17d05a[_0x28ce('0x26')];_0x3abee4[_0x28ce('0x2f')]=qs[_0x28ce('0x30')](_0x28051c[_0x28ce('0x27')][_0x28ce('0x30')]);_0x3abee4[_0x28ce('0x31')]=qs[_0x28ce('0x29')](_[_0x28ce('0x32')](_0x28051c[_0x28ce('0x27')],_0x17d05a['filters']));if(_0x28051c[_0x28ce('0x27')][_0x28ce('0x33')]){_0x3abee4[_0x28ce('0x31')]=_[_0x28ce('0x34')](_0x3abee4[_0x28ce('0x31')],{'$or':_['map'](_0x3abee4[_0x28ce('0x2b')],function(_0x1f25e4){var _0xceb4d6={};_0xceb4d6[_0x1f25e4]={'$like':'%'+_0x28051c[_0x28ce('0x27')]['filter']+'%'};return _0xceb4d6;})});}_0x3abee4=_['merge']({},_0x3abee4,_0x28051c['options']);return _0x450db9[_0x28ce('0x4a')](_0x3abee4);}})['then'](function(_0x244165){if(_0x244165){_0x876ac5=_0x244165[_0x28ce('0x2c')];if(!_0x28051c[_0x28ce('0x27')][_0x28ce('0x2d')](_0x28ce('0x2e'))){_0x3abee4[_0x28ce('0x19')]=qs[_0x28ce('0x19')](_0x28051c[_0x28ce('0x27')][_0x28ce('0x19')]);_0x3abee4[_0x28ce('0x18')]=qs['offset'](_0x28051c[_0x28ce('0x27')][_0x28ce('0x18')]);}return _0x450db9[_0x28ce('0x4a')](_0x3abee4);}})[_0x28ce('0x3d')](function(_0x4c23e5){if(_0x4c23e5){return _0x4c23e5?{'count':_0x876ac5,'rows':_0x4c23e5}:null;}})[_0x28ce('0x3d')](respondWithResult(_0x305a99,null))['catch'](handleError(_0x305a99,null));};exports[_0x28ce('0x4b')]=function(_0x2f353e,_0x21d67d,_0x3564a5){return db[_0x28ce('0x4c')][_0x28ce('0x44')]({'where':{'id':_0x2f353e['params']['id']}})[_0x28ce('0x3d')](handleEntityNotFound(_0x21d67d,null))[_0x28ce('0x3d')](function(_0x37666e){if(_0x37666e){return _0x37666e[_0x28ce('0x4b')](_0x2f353e[_0x28ce('0x42')][_0x28ce('0x46')],_['omit'](_0x2f353e['body'],['ids','id'])||{});}})[_0x28ce('0x3d')](respondWithResult(_0x21d67d,null))['catch'](handleError(_0x21d67d,null));};exports[_0x28ce('0x4d')]=function(_0x35b7de,_0x29337c,_0xa64b6f){var _0x505d9a={};var _0x30ce23={};var _0x489dd6;var _0x35851d;return db[_0x28ce('0x22')][_0x28ce('0x48')]({'where':{'id':_0x35b7de[_0x28ce('0x3e')]['id']}})['then'](handleEntityNotFound(_0x29337c,null))[_0x28ce('0x3d')](function(_0x10083c){if(_0x10083c){_0x489dd6=_0x10083c;_0x30ce23[_0x28ce('0x26')]=_[_0x28ce('0x28')](db[_0x28ce('0x4c')][_0x28ce('0x23')]);_0x30ce23[_0x28ce('0x27')]=_[_0x28ce('0x28')](_0x35b7de[_0x28ce('0x27')]);_0x30ce23[_0x28ce('0x29')]=_[_0x28ce('0x3f')](_0x30ce23[_0x28ce('0x26')],_0x30ce23[_0x28ce('0x27')]);_0x505d9a[_0x28ce('0x2b')]=_['intersection'](_0x30ce23[_0x28ce('0x26')],qs['fields'](_0x35b7de[_0x28ce('0x27')][_0x28ce('0x2a')]));_0x505d9a[_0x28ce('0x2b')]=_0x505d9a[_0x28ce('0x2b')][_0x28ce('0x2c')]?_0x505d9a[_0x28ce('0x2b')]:_0x30ce23['model'];_0x505d9a['order']=qs[_0x28ce('0x30')](_0x35b7de['query'][_0x28ce('0x30')]);_0x505d9a['where']=qs['filters'](_['pick'](_0x35b7de['query'],_0x30ce23[_0x28ce('0x29')]));if(_0x35b7de[_0x28ce('0x27')][_0x28ce('0x33')]){_0x505d9a[_0x28ce('0x31')]=_[_0x28ce('0x34')](_0x505d9a[_0x28ce('0x31')],{'$or':_['map'](_0x505d9a[_0x28ce('0x2b')],function(_0x291d91){var _0x303a66={};_0x303a66[_0x291d91]={'$like':'%'+_0x35b7de[_0x28ce('0x27')][_0x28ce('0x33')]+'%'};return _0x303a66;})});}_0x505d9a=_['merge']({},_0x505d9a,_0x35b7de[_0x28ce('0x38')]);return _0x489dd6[_0x28ce('0x4d')](_0x505d9a);}})[_0x28ce('0x3d')](function(_0x1fb633){if(_0x1fb633){_0x35851d=_0x1fb633[_0x28ce('0x2c')];if(!_0x35b7de[_0x28ce('0x27')]['hasOwnProperty'](_0x28ce('0x2e'))){_0x505d9a[_0x28ce('0x19')]=qs['limit'](_0x35b7de[_0x28ce('0x27')][_0x28ce('0x19')]);_0x505d9a[_0x28ce('0x18')]=qs[_0x28ce('0x18')](_0x35b7de['query'][_0x28ce('0x18')]);}return _0x489dd6[_0x28ce('0x4d')](_0x505d9a);}})[_0x28ce('0x3d')](function(_0x2a145f){if(_0x2a145f){return _0x2a145f?{'count':_0x35851d,'rows':_0x2a145f}:null;}})[_0x28ce('0x3d')](respondWithResult(_0x29337c,null))[_0x28ce('0x40')](handleError(_0x29337c,null));};
\ No newline at end of file
index 1d2fa2f..f3e7af9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33d0=['rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0x33d0,0xb0));var _0x033d=function(_0xb7bda8,_0x3c2d28){_0xb7bda8=_0xb7bda8-0x0;var _0x6707bf=_0x33d0[_0xb7bda8];return _0x6707bf;};'use strict';var _=require(_0x033d('0x0'));var util=require(_0x033d('0x1'));var logger=require(_0x033d('0x2'))(_0x033d('0x3'));var moment=require(_0x033d('0x4'));var BPromise=require('bluebird');var rp=require(_0x033d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x033d('0x6'));var config=require(_0x033d('0x7'));var attributes=require(_0x033d('0x8'));module[_0x033d('0x9')]=function(_0x10e3c4,_0x3cf1ff){return _0x10e3c4[_0x033d('0xa')](_0x033d('0xb'),attributes,{'tableName':_0x033d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8093=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x4b775b,_0x2aadc6){var _0xf84d39=function(_0x55ac96){while(--_0x55ac96){_0x4b775b['push'](_0x4b775b['shift']());}};_0xf84d39(++_0x2aadc6);}(_0x8093,0xa9));var _0x3809=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x8093[_0x52f1e6];return _0x21f104;};'use strict';var _=require(_0x3809('0x0'));var util=require(_0x3809('0x1'));var logger=require(_0x3809('0x2'))(_0x3809('0x3'));var moment=require(_0x3809('0x4'));var BPromise=require(_0x3809('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3809('0x6'));var rimraf=require(_0x3809('0x7'));var config=require(_0x3809('0x8'));var attributes=require(_0x3809('0x9'));module[_0x3809('0xa')]=function(_0x17ab0b,_0x29d5dc){return _0x17ab0b[_0x3809('0xb')](_0x3809('0xc'),attributes,{'tableName':_0x3809('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a9ace2..532ba16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eb0=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','Automation,\x20%s,\x20%s','message','info','result'];(function(_0x350732,_0x499627){var _0x2e7291=function(_0x18feab){while(--_0x18feab){_0x350732['push'](_0x350732['shift']());}};_0x2e7291(++_0x499627);}(_0x9eb0,0xb5));var _0x09eb=function(_0x59ddf2,_0x34dd4e){_0x59ddf2=_0x59ddf2-0x0;var _0x1f533c=_0x9eb0[_0x59ddf2];return _0x1f533c;};'use strict';var _=require('lodash');var util=require(_0x09eb('0x0'));var moment=require('moment');var BPromise=require(_0x09eb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09eb('0x2'));var db=require(_0x09eb('0x3'))['db'];var utils=require(_0x09eb('0x4'));var logger=require(_0x09eb('0x5'))('rpc');var config=require(_0x09eb('0x6'));var jayson=require(_0x09eb('0x7'));var client=jayson[_0x09eb('0x8')][_0x09eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54943d,_0x478b99,_0x33c77a){return new BPromise(function(_0x5ef612,_0xb70c0){return client[_0x09eb('0xa')](_0x54943d,_0x33c77a)['then'](function(_0x5997e8){logger['info']('Automation,\x20%s,\x20%s',_0x478b99,'request\x20sent');logger['debug'](_0x09eb('0xb'),_0x478b99,_0x09eb('0xc'),JSON['stringify'](_0x5997e8));if(_0x5997e8['error']){if(_0x5997e8['error'][_0x09eb('0xd')]===0x1f4){logger[_0x09eb('0xe')](_0x09eb('0xf'),_0x478b99,_0x5997e8['error']['message']);return _0xb70c0(_0x5997e8['error'][_0x09eb('0x10')]);}logger[_0x09eb('0xe')]('Automation,\x20%s,\x20%s',_0x478b99,_0x5997e8['error'][_0x09eb('0x10')]);return _0x5ef612(_0x5997e8['error'][_0x09eb('0x10')]);}else{logger[_0x09eb('0x11')](_0x09eb('0xf'),_0x478b99,_0x09eb('0xc'));_0x5ef612(_0x5997e8[_0x09eb('0x12')][_0x09eb('0x10')]);}})[_0x09eb('0x13')](function(_0x4a19a9){logger['error'](_0x09eb('0xf'),_0x478b99,_0x4a19a9);_0xb70c0(_0x4a19a9);});});}
\ No newline at end of file
+var _0x9393=['jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x83487c,_0x1104d8){var _0x25ce18=function(_0x5814dd){while(--_0x5814dd){_0x83487c['push'](_0x83487c['shift']());}};_0x25ce18(++_0x1104d8);}(_0x9393,0xea));var _0x3939=function(_0x4437c9,_0x6b22ae){_0x4437c9=_0x4437c9-0x0;var _0x40d91d=_0x9393[_0x4437c9];return _0x40d91d;};'use strict';var _=require('lodash');var util=require(_0x3939('0x0'));var moment=require(_0x3939('0x1'));var BPromise=require(_0x3939('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3939('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3939('0x4'));var logger=require(_0x3939('0x5'))(_0x3939('0x6'));var config=require(_0x3939('0x7'));var jayson=require(_0x3939('0x8'));var client=jayson[_0x3939('0x9')][_0x3939('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49fd79,_0xf56eed,_0x105095){return new BPromise(function(_0x2386f6,_0x30f998){return client[_0x3939('0xb')](_0x49fd79,_0x105095)[_0x3939('0xc')](function(_0x452e38){logger[_0x3939('0xd')](_0x3939('0xe'),_0xf56eed,_0x3939('0xf'));logger[_0x3939('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0xf56eed,_0x3939('0xf'),JSON['stringify'](_0x452e38));if(_0x452e38[_0x3939('0x11')]){if(_0x452e38[_0x3939('0x11')][_0x3939('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0xf56eed,_0x452e38['error'][_0x3939('0x13')]);return _0x30f998(_0x452e38[_0x3939('0x11')][_0x3939('0x13')]);}logger[_0x3939('0x11')](_0x3939('0xe'),_0xf56eed,_0x452e38[_0x3939('0x11')][_0x3939('0x13')]);return _0x2386f6(_0x452e38['error'][_0x3939('0x13')]);}else{logger[_0x3939('0xd')](_0x3939('0xe'),_0xf56eed,'request\x20sent');_0x2386f6(_0x452e38[_0x3939('0x14')][_0x3939('0x13')]);}})[_0x3939('0x15')](function(_0x28eae7){logger[_0x3939('0x11')](_0x3939('0xe'),_0xf56eed,_0x28eae7);_0x30f998(_0x28eae7);});});}
\ No newline at end of file
index 3ca2f2c..b1f4b3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4db9=['get','index','isAuthenticated','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions','put','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x342523,_0x54a242){var _0x5ded1b=function(_0x1b2c82){while(--_0x1b2c82){_0x342523['push'](_0x342523['shift']());}};_0x5ded1b(++_0x54a242);}(_0x4db9,0x1d9));var _0x94db=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x4db9[_0x393500];return _0x120d3b;};'use strict';var multer=require(_0x94db('0x0'));var util=require(_0x94db('0x1'));var path=require(_0x94db('0x2'));var timeout=require(_0x94db('0x3'));var express=require('express');var router=express[_0x94db('0x4')]();var auth=require(_0x94db('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x94db('0x6'));var controller=require('./automation.controller');router[_0x94db('0x7')]('/',auth['isAuthenticated'](),controller[_0x94db('0x8')]);router[_0x94db('0x7')]('/:id',auth[_0x94db('0x9')](),controller['show']);router['get'](_0x94db('0xa'),auth[_0x94db('0x9')](),controller[_0x94db('0xb')]);router[_0x94db('0x7')]('/:id/actions',auth[_0x94db('0x9')](),controller[_0x94db('0xc')]);router[_0x94db('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x94db('0xd')](_0x94db('0xa'),auth[_0x94db('0x9')](),controller[_0x94db('0xe')]);router['post'](_0x94db('0xf'),auth[_0x94db('0x9')](),controller['addActions']);router[_0x94db('0x10')](_0x94db('0x11'),auth[_0x94db('0x9')](),controller[_0x94db('0x12')]);router['delete'](_0x94db('0x11'),auth[_0x94db('0x9')](),controller['destroy']);module[_0x94db('0x13')]=router;
\ No newline at end of file
+var _0x1808=['connect-timeout','express','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/actions','getActions','post','/:id/conditions','addActions','update','destroy','exports','multer','util'];(function(_0x219c79,_0x139b63){var _0xf7e0b6=function(_0x3940c3){while(--_0x3940c3){_0x219c79['push'](_0x219c79['shift']());}};_0xf7e0b6(++_0x139b63);}(_0x1808,0xe2));var _0x8180=function(_0x4d1965,_0x43152e){_0x4d1965=_0x4d1965-0x0;var _0xdcfade=_0x1808[_0x4d1965];return _0xdcfade;};'use strict';var multer=require(_0x8180('0x0'));var util=require(_0x8180('0x1'));var path=require('path');var timeout=require(_0x8180('0x2'));var express=require(_0x8180('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8180('0x4'));var config=require(_0x8180('0x5'));var controller=require(_0x8180('0x6'));router[_0x8180('0x7')]('/',auth[_0x8180('0x8')](),controller['index']);router[_0x8180('0x7')](_0x8180('0x9'),auth[_0x8180('0x8')](),controller[_0x8180('0xa')]);router[_0x8180('0x7')]('/:id/conditions',auth[_0x8180('0x8')](),controller['getConditions']);router['get'](_0x8180('0xb'),auth[_0x8180('0x8')](),controller[_0x8180('0xc')]);router[_0x8180('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8180('0xd')](_0x8180('0xe'),auth['isAuthenticated'](),controller['addConditions']);router[_0x8180('0xd')](_0x8180('0xb'),auth[_0x8180('0x8')](),controller[_0x8180('0xf')]);router['put']('/:id',auth[_0x8180('0x8')](),controller[_0x8180('0x10')]);router['delete'](_0x8180('0x9'),auth['isAuthenticated'](),controller[_0x8180('0x11')]);module[_0x8180('0x12')]=router;
\ No newline at end of file
index 3742346..3b26193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6780=['#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','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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)','sequelize','exports','STRING','name','ivr','BOOLEAN','INTEGER','UNSIGNED','#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)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x6780,0xa9));var _0x0678=function(_0x120b6e,_0xb83858){_0x120b6e=_0x120b6e-0x0;var _0x15c48f=_0x6780[_0x120b6e];return _0x15c48f;};'use strict';var Sequelize=require(_0x0678('0x0'));module[_0x0678('0x1')]={'name':{'type':Sequelize[_0x0678('0x2')],'unique':_0x0678('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x0678('0x4')},'description':{'type':Sequelize[_0x0678('0x2')]},'active':{'type':Sequelize[_0x0678('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x0678('0x6')](0x4)[_0x0678('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0678('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0678('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0678('0x6')](0x3)[_0x0678('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0678('0x6')](0x3)[_0x0678('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0678('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0678('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0678('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x0678('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0678('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0678('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0678('0x6')](0x3)[_0x0678('0x7')],'defaultValue':0x3,'comment':_0x0678('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0678('0x6')](0x5)[_0x0678('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0678('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0678('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0678('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0678('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x0678('0xf'),_0x0678('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0678('0x5')],'defaultValue':0x0,'comment':_0x0678('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0678('0x12')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0678('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0678('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0678('0x6')](0x9)[_0x0678('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0678('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0678('0x6')](0x9)[_0x0678('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0678('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0678('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0678('0x6')](0x9)[_0x0678('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0678('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0678('0x6')](0x9)[_0x0678('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0678('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0678('0x6')](0x5)[_0x0678('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0678('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0678('0x6')](0x9)[_0x0678('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0678('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0678('0x1a')](_0x0678('0x1b'),_0x0678('0x1c')),'defaultValue':_0x0678('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x0678('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0678('0x1d')},'dialCutDigit':{'type':Sequelize[_0x0678('0x6')](0x3)[_0x0678('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0678('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0678('0x6')](0x3)[_0x0678('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0678('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0678('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0678('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x0678('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0678('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0678('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0678('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0678('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0678('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x0678('0x6')](0x3)[_0x0678('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0678('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0678('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0678('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0678('0x6')](0x3)[_0x0678('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0678('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0678('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x1920=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3c68e5,_0x19d28f){var _0x32f0bc=function(_0x29a62f){while(--_0x29a62f){_0x3c68e5['push'](_0x3c68e5['shift']());}};_0x32f0bc(++_0x19d28f);}(_0x1920,0x1b2));var _0x0192=function(_0x51eddf,_0x205238){_0x51eddf=_0x51eddf-0x0;var _0x33e9aa=_0x1920[_0x51eddf];return _0x33e9aa;};'use strict';var Sequelize=require(_0x0192('0x0'));module[_0x0192('0x1')]={'name':{'type':Sequelize[_0x0192('0x2')],'unique':_0x0192('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0192('0x4')),'allowNull':![],'defaultValue':_0x0192('0x4')},'description':{'type':Sequelize[_0x0192('0x2')]},'active':{'type':Sequelize[_0x0192('0x5')],'defaultValue':0x0,'comment':_0x0192('0x6')},'limitCalls':{'type':Sequelize[_0x0192('0x7')](0x4)[_0x0192('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0192('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0192('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0192('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0192('0x7')](0x3)[_0x0192('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0192('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0192('0x7')](0x3)[_0x0192('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0192('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0192('0x7')](0x5)[_0x0192('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0192('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x0192('0x7')](0x3)[_0x0192('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0192('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0192('0x7')](0x5)[_0x0192('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0192('0x7')](0x3)[_0x0192('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0192('0x7')](0x5)[_0x0192('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0192('0x7')](0x3)[_0x0192('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0192('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0192('0x2')],'defaultValue':_0x0192('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x0192('0xf')](_0x0192('0x10'),_0x0192('0x11'),_0x0192('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0192('0x7')](0x9)[_0x0192('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0192('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x0192('0x7')](0x9)[_0x0192('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0192('0x7')](0x9)[_0x0192('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0192('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0192('0x7')](0x9)[_0x0192('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0192('0x7')](0x9)[_0x0192('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0192('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0192('0x7')](0x9)[_0x0192('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0192('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0192('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0192('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0192('0x7')](0x5)[_0x0192('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0192('0x7')](0x9)[_0x0192('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0192('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0192('0xf')](_0x0192('0x19'),_0x0192('0x1a')),'defaultValue':_0x0192('0x19')},'dialPrefix':{'type':Sequelize[_0x0192('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0192('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0192('0x1b')},'dialCutDigit':{'type':Sequelize[_0x0192('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0192('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0192('0x7')](0x3)[_0x0192('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0192('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0192('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0192('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x0192('0x7')](0x3)[_0x0192('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0192('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x0192('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0192('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0192('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0192('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0192('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0192('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0192('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0192('0x7')](0x5)[_0x0192('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0192('0x7')](0x3)[_0x0192('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0192('0x7')](0x5)[_0x0192('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0192('0x23')}};
\ No newline at end of file
index bbc81db..bb3031e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1137=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Campaign','count','includeAll','include','findAll','rows','catch','show','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','createdAt','updatedAt','omit','update','params','getHoppers','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','ContactId','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x46b38b,_0x4a222f){var _0x4b5c0a=function(_0x2769d4){while(--_0x2769d4){_0x46b38b['push'](_0x46b38b['shift']());}};_0x4b5c0a(++_0x4a222f);}(_0x1137,0x100));var _0x7113=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0x1137[_0x5ac0f0];return _0x4aceec;};'use strict';var pdf=require(_0x7113('0x0'));var emlformat=require(_0x7113('0x1'));var rimraf=require(_0x7113('0x2'));var zipdir=require(_0x7113('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7113('0x4'));var moment=require(_0x7113('0x5'));var BPromise=require(_0x7113('0x6'));var Mustache=require(_0x7113('0x7'));var util=require(_0x7113('0x8'));var path=require(_0x7113('0x9'));var sox=require(_0x7113('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7113('0xb'));var squel=require(_0x7113('0xc'));var crypto=require(_0x7113('0xd'));var jsforce=require(_0x7113('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7113('0xf'));var querystring=require(_0x7113('0x10'));var Papa=require(_0x7113('0x11'));var Redis=require('ioredis');var authService=require(_0x7113('0x12'));var qs=require(_0x7113('0x13'));var as=require(_0x7113('0x14'));var hardwareService=require(_0x7113('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7113('0x16'));var config=require(_0x7113('0x17'));var db=require(_0x7113('0x18'))['db'];function respondWithStatusCode(_0x5ca727,_0xefc065){_0xefc065=_0xefc065||0xcc;return function(_0x5ca8c6){if(_0x5ca8c6){return _0x5ca727[_0x7113('0x19')](_0xefc065);}return _0x5ca727[_0x7113('0x1a')](_0xefc065)['end']();};}function respondWithResult(_0x3e176f,_0x529b2a){_0x529b2a=_0x529b2a||0xc8;return function(_0x644ceb){if(_0x644ceb){return _0x3e176f[_0x7113('0x1a')](_0x529b2a)[_0x7113('0x1b')](_0x644ceb);}};}function respondWithFilteredResult(_0x48dad8,_0x2ceb11){return function(_0x2807a0){if(_0x2807a0){var _0x57a0e4=_0x2807a0['count'],_0x8b7934=_0x2ceb11['offset'],_0x2721ea=_0x2ceb11[_0x7113('0x1c')]+_0x2ceb11['limit'],_0x399b39;if(_0x2721ea>=_0x57a0e4){_0x2721ea=_0x57a0e4;_0x399b39=0xc8;}else{_0x399b39=0xce;}_0x48dad8[_0x7113('0x1a')](_0x399b39);return _0x48dad8[_0x7113('0x1d')](_0x7113('0x1e'),_0x8b7934+'-'+_0x2721ea+'/'+_0x57a0e4)[_0x7113('0x1b')](_0x2807a0);}return null;};}function patchUpdates(_0x14566f){return function(_0x29c4f0){try{jsonpatch[_0x7113('0x1f')](_0x29c4f0,_0x14566f,!![]);}catch(_0x2cdc34){return BPromise['reject'](_0x2cdc34);}return _0x29c4f0[_0x7113('0x20')]();};}function saveUpdates(_0x349f78,_0x1bcd02){return function(_0x15b916){if(_0x15b916){return _0x15b916['update'](_0x349f78)[_0x7113('0x21')](function(_0x52b996){return _0x52b996;});}return null;};}function removeEntity(_0xca15b,_0xb425de){return function(_0x4d1096){if(_0x4d1096){return _0x4d1096[_0x7113('0x22')]()[_0x7113('0x21')](function(){var _0x2d8c74=_0x4d1096[_0x7113('0x23')]({'plain':!![]});var _0x1d3362=_0x7113('0x24');return db[_0x7113('0x25')][_0x7113('0x22')]({'where':{'type':_0x1d3362,'resourceId':_0x2d8c74['id']}})['then'](function(){return _0x4d1096;});})['then'](function(){_0xca15b[_0x7113('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb383e1,_0x3a28a0){return function(_0xd9cb7d){if(!_0xd9cb7d){_0xb383e1[_0x7113('0x19')](0x194);}return _0xd9cb7d;};}function handleError(_0x46160a,_0x382993){_0x382993=_0x382993||0x1f4;return function(_0x505c12){logger[_0x7113('0x26')](_0x505c12[_0x7113('0x27')]);if(_0x505c12[_0x7113('0x28')]){delete _0x505c12['name'];}_0x46160a['status'](_0x382993)[_0x7113('0x29')](_0x505c12);};}exports['index']=function(_0x3e0230,_0x4e7b98){var _0x128d02={},_0x44d28d={},_0x2a842d={'count':0x0,'rows':[]};var _0x14d945=_['map'](db['Campaign'][_0x7113('0x2a')],function(_0x48fb63){return{'name':_0x48fb63[_0x7113('0x2b')],'type':_0x48fb63[_0x7113('0x2c')][_0x7113('0x2d')]};});_0x44d28d['model']=_[_0x7113('0x2e')](_0x14d945,_0x7113('0x28'));_0x44d28d[_0x7113('0x2f')]=_[_0x7113('0x30')](_0x3e0230[_0x7113('0x2f')]);_0x44d28d['filters']=_[_0x7113('0x31')](_0x44d28d[_0x7113('0x32')],_0x44d28d['query']);_0x128d02[_0x7113('0x33')]=_['intersection'](_0x44d28d['model'],qs[_0x7113('0x34')](_0x3e0230[_0x7113('0x2f')][_0x7113('0x34')]));_0x128d02[_0x7113('0x33')]=_0x128d02['attributes'][_0x7113('0x35')]?_0x128d02[_0x7113('0x33')]:_0x44d28d['model'];if(!_0x3e0230['query'][_0x7113('0x36')](_0x7113('0x37'))){_0x128d02['limit']=qs[_0x7113('0x38')](_0x3e0230[_0x7113('0x2f')][_0x7113('0x38')]);_0x128d02[_0x7113('0x1c')]=qs[_0x7113('0x1c')](_0x3e0230['query'][_0x7113('0x1c')]);}_0x128d02[_0x7113('0x39')]=qs[_0x7113('0x3a')](_0x3e0230[_0x7113('0x2f')][_0x7113('0x3a')]);_0x128d02['where']=qs[_0x7113('0x3b')](_[_0x7113('0x3c')](_0x3e0230['query'],_0x44d28d[_0x7113('0x3b')]),_0x14d945);if(_0x3e0230[_0x7113('0x2f')][_0x7113('0x3d')]){_0x128d02[_0x7113('0x3e')]=_[_0x7113('0x3f')](_0x128d02['where'],{'$or':_['map'](_0x14d945,function(_0x3ee391){if(_0x3ee391[_0x7113('0x2c')]!==_0x7113('0x40')){var _0xaa46a5={};_0xaa46a5[_0x3ee391[_0x7113('0x28')]]={'$like':'%'+_0x3e0230[_0x7113('0x2f')][_0x7113('0x3d')]+'%'};return _0xaa46a5;}})});}_0x128d02=_[_0x7113('0x3f')]({},_0x128d02,_0x3e0230[_0x7113('0x41')]);var _0xb3728c={'where':_0x128d02[_0x7113('0x3e')]};return db[_0x7113('0x42')][_0x7113('0x43')](_0xb3728c)[_0x7113('0x21')](function(_0x322874){_0x2a842d[_0x7113('0x43')]=_0x322874;if(_0x3e0230['query'][_0x7113('0x44')]){_0x128d02[_0x7113('0x45')]=[{'all':!![]}];}return db[_0x7113('0x42')][_0x7113('0x46')](_0x128d02);})[_0x7113('0x21')](function(_0x2419cc){_0x2a842d[_0x7113('0x47')]=_0x2419cc;return _0x2a842d;})[_0x7113('0x21')](respondWithFilteredResult(_0x4e7b98,_0x128d02))[_0x7113('0x48')](handleError(_0x4e7b98,null));};exports[_0x7113('0x49')]=function(_0xcdbb4,_0x3053a6){var _0xeb05e7={'raw':![],'where':{'id':_0xcdbb4['params']['id']}},_0x51643b={};_0x51643b[_0x7113('0x32')]=_['keys'](db['Campaign'][_0x7113('0x2a')]);_0x51643b[_0x7113('0x2f')]=_[_0x7113('0x30')](_0xcdbb4[_0x7113('0x2f')]);_0x51643b[_0x7113('0x3b')]=_[_0x7113('0x31')](_0x51643b['model'],_0x51643b[_0x7113('0x2f')]);_0xeb05e7[_0x7113('0x33')]=_['intersection'](_0x51643b['model'],qs[_0x7113('0x34')](_0xcdbb4['query'][_0x7113('0x34')]));_0xeb05e7[_0x7113('0x33')]=_0xeb05e7[_0x7113('0x33')][_0x7113('0x35')]?_0xeb05e7[_0x7113('0x33')]:_0x51643b['model'];if(_0xcdbb4[_0x7113('0x2f')]['includeAll']){_0xeb05e7[_0x7113('0x45')]=[{'all':!![]}];}_0xeb05e7=_[_0x7113('0x3f')]({},_0xeb05e7,_0xcdbb4[_0x7113('0x41')]);return db[_0x7113('0x42')][_0x7113('0x4a')](_0xeb05e7)[_0x7113('0x21')](handleEntityNotFound(_0x3053a6,null))[_0x7113('0x21')](respondWithResult(_0x3053a6,null))[_0x7113('0x48')](handleError(_0x3053a6,null));};exports['create']=function(_0x413ceb,_0x526e5a){return db['Campaign'][_0x7113('0x4b')](_0x413ceb[_0x7113('0x4c')],{})[_0x7113('0x21')](function(_0x1485c9){var _0x24d70e=_0x413ceb[_0x7113('0x4d')][_0x7113('0x23')]({'plain':!![]});if(!_0x24d70e)throw new Error(_0x7113('0x4e'));if(_0x24d70e[_0x7113('0x4f')]==='user'){var _0x2878d9=_0x1485c9[_0x7113('0x23')]({'plain':!![]});var _0x458e28=_0x7113('0x24');return db[_0x7113('0x50')][_0x7113('0x4a')]({'where':{'name':_0x458e28,'userProfileId':_0x24d70e[_0x7113('0x51')]},'raw':!![]})[_0x7113('0x21')](function(_0x41b147){if(_0x41b147&&_0x41b147[_0x7113('0x52')]===0x0){return db[_0x7113('0x25')][_0x7113('0x4b')]({'name':_0x2878d9[_0x7113('0x28')],'resourceId':_0x2878d9['id'],'type':_0x41b147[_0x7113('0x28')],'sectionId':_0x41b147['id']},{})[_0x7113('0x21')](function(){return _0x1485c9;});}else{return _0x1485c9;}})[_0x7113('0x48')](function(_0x48ae73){logger[_0x7113('0x26')](_0x7113('0x53'),_0x48ae73);throw _0x48ae73;});}return _0x1485c9;})[_0x7113('0x21')](respondWithResult(_0x526e5a,0xc9))[_0x7113('0x48')](handleError(_0x526e5a,null));};exports[_0x7113('0x54')]=function(_0xc86478,_0x2e4e42){var _0x853ab8={'where':{'id':_0xc86478['params']['id']}},_0x507348={};_0x507348['model']=_['keys'](db[_0x7113('0x42')][_0x7113('0x2a')]);_0x853ab8[_0x7113('0x33')]=_[_0x7113('0x31')](_0x507348[_0x7113('0x32')],qs[_0x7113('0x34')](_0xc86478[_0x7113('0x2f')][_0x7113('0x34')]));_0x853ab8[_0x7113('0x33')]=_0x853ab8[_0x7113('0x33')][_0x7113('0x35')]?_0x853ab8[_0x7113('0x33')]:_0x507348[_0x7113('0x32')];if(_0xc86478['query'][_0x7113('0x44')]){_0x853ab8[_0x7113('0x45')]=[{'all':!![]}];}_0x853ab8=_['merge']({},_0x853ab8,_0xc86478[_0x7113('0x41')]);return db[_0x7113('0x42')]['find'](_0x853ab8)[_0x7113('0x21')](handleEntityNotFound(_0x2e4e42,null))[_0x7113('0x21')](function(_0x310687){if(_0x310687){var _0x564024=_0x310687['get']({'plain':!![]});_0x564024=qs['omit'](_0x564024,['id',_0x7113('0x55'),_0x7113('0x56')]);_0xc86478[_0x7113('0x4c')]=_[_0x7113('0x57')](_0xc86478[_0x7113('0x4c')],['id',_0x7113('0x55'),_0x7113('0x56')]);return db[_0x7113('0x42')][_0x7113('0x4b')](_[_0x7113('0x3f')](_0x564024,_0xc86478[_0x7113('0x4c')]),{'include':_0xc86478[_0x7113('0x2f')][_0x7113('0x44')]?[{'all':!![]}]:undefined})[_0x7113('0x21')](function(_0x929b72){var _0x5eeb98=_0xc86478[_0x7113('0x4d')][_0x7113('0x23')]({'plain':!![]});if(!_0x5eeb98)throw new Error(_0x7113('0x4e'));if(_0x5eeb98[_0x7113('0x4f')]===_0x7113('0x4d')){var _0x584f93=_0x929b72[_0x7113('0x23')]({'plain':!![]});var _0x4ec3fe='IvrCampaigns';return db[_0x7113('0x50')]['find']({'where':{'name':_0x4ec3fe,'userProfileId':_0x5eeb98[_0x7113('0x51')]},'raw':!![]})[_0x7113('0x21')](function(_0x287e90){if(_0x287e90&&_0x287e90[_0x7113('0x52')]===0x0){return db[_0x7113('0x25')][_0x7113('0x4b')]({'name':_0x584f93['name'],'resourceId':_0x584f93['id'],'type':_0x287e90['name'],'sectionId':_0x287e90['id']},{})[_0x7113('0x21')](function(){return _0x929b72;});}else{return _0x929b72;}})['catch'](function(_0x420976){logger[_0x7113('0x26')](_0x7113('0x53'),_0x420976);throw _0x420976;});}return _0x929b72;});}})[_0x7113('0x21')](respondWithResult(_0x2e4e42,0xc9))[_0x7113('0x48')](handleError(_0x2e4e42,null));};exports[_0x7113('0x58')]=function(_0x2e0f2c,_0x579d98){if(_0x2e0f2c['body']['id']){delete _0x2e0f2c['body']['id'];}return db[_0x7113('0x42')][_0x7113('0x4a')]({'where':{'id':_0x2e0f2c[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x579d98,null))[_0x7113('0x21')](saveUpdates(_0x2e0f2c[_0x7113('0x4c')],null))[_0x7113('0x21')](respondWithResult(_0x579d98,null))[_0x7113('0x48')](handleError(_0x579d98,null));};exports[_0x7113('0x22')]=function(_0x41fb97,_0x3d50da){return db['Campaign'][_0x7113('0x4a')]({'where':{'id':_0x41fb97[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x3d50da,null))[_0x7113('0x21')](removeEntity(_0x3d50da,null))[_0x7113('0x48')](handleError(_0x3d50da,null));};exports[_0x7113('0x5a')]=function(_0x203df9,_0x2e48e3,_0xd25f9c){var _0xad86ad={'raw':!![],'where':{}};var _0x198e87={};var _0x27298e={'count':0x0,'rows':[]};return db[_0x7113('0x42')][_0x7113('0x5b')]({'where':{'id':_0x203df9[_0x7113('0x59')]['id']}})['then'](handleEntityNotFound(_0x2e48e3,null))[_0x7113('0x21')](function(_0x4da25f){if(_0x4da25f){_0x198e87[_0x7113('0x32')]=_['keys'](db[_0x7113('0x5c')][_0x7113('0x2a')]);_0x198e87[_0x7113('0x2f')]=_[_0x7113('0x30')](_0x203df9['query']);_0x198e87['filters']=_[_0x7113('0x31')](_0x198e87[_0x7113('0x32')],_0x198e87[_0x7113('0x2f')]);_0xad86ad['attributes']=_[_0x7113('0x31')](_0x198e87['model'],qs[_0x7113('0x34')](_0x203df9[_0x7113('0x2f')][_0x7113('0x34')]));_0xad86ad[_0x7113('0x33')]=_0xad86ad[_0x7113('0x33')][_0x7113('0x35')]?_0xad86ad[_0x7113('0x33')]:_0x198e87['model'];if(!_0x203df9['query']['hasOwnProperty']('nolimit')){_0xad86ad[_0x7113('0x38')]=qs[_0x7113('0x38')](_0x203df9[_0x7113('0x2f')]['limit']);_0xad86ad[_0x7113('0x1c')]=qs[_0x7113('0x1c')](_0x203df9['query'][_0x7113('0x1c')]);}_0xad86ad[_0x7113('0x39')]=qs[_0x7113('0x3a')](_0x203df9['query'][_0x7113('0x3a')]);_0xad86ad['where']=qs[_0x7113('0x3b')](_[_0x7113('0x3c')](_0x203df9[_0x7113('0x2f')],_0x198e87[_0x7113('0x3b')]));_0xad86ad['where'][_0x7113('0x5d')]=_0x4da25f['id'];if(_0x203df9[_0x7113('0x2f')]['filter']){_0xad86ad[_0x7113('0x3e')]=_[_0x7113('0x3f')](_0xad86ad[_0x7113('0x3e')],{'$or':_['map'](_0xad86ad[_0x7113('0x33')],function(_0x395cf9){var _0x20fa38={};_0x20fa38[_0x395cf9]={'$like':'%'+_0x203df9[_0x7113('0x2f')][_0x7113('0x3d')]+'%'};return _0x20fa38;})});}_0xad86ad=_['merge']({},_0xad86ad,_0x203df9[_0x7113('0x41')]);return db[_0x7113('0x5c')]['count']({'where':_0xad86ad['where']})['then'](function(_0x2dd22b){_0x27298e[_0x7113('0x43')]=_0x2dd22b;if(_0x203df9[_0x7113('0x2f')][_0x7113('0x44')]){_0xad86ad[_0x7113('0x45')]=[{'all':!![]}];}return db[_0x7113('0x5c')][_0x7113('0x46')](_0xad86ad);})['then'](function(_0x258e25){_0x27298e[_0x7113('0x47')]=_0x258e25;return _0x27298e;});}})['then'](respondWithFilteredResult(_0x2e48e3,_0xad86ad))['catch'](handleError(_0x2e48e3,null));};exports['getHopperHistories']=function(_0x483e99,_0x308639,_0x9889a4){var _0x2f4b58={'raw':!![],'where':{}};var _0x13e50b={};var _0x43a147={'count':0x0,'rows':[]};return db[_0x7113('0x42')][_0x7113('0x5b')]({'where':{'id':_0x483e99['params']['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x308639,null))[_0x7113('0x21')](function(_0x1917cd){if(_0x1917cd){_0x13e50b['model']=_['keys'](db[_0x7113('0x5e')][_0x7113('0x2a')]);_0x13e50b['query']=_[_0x7113('0x30')](_0x483e99[_0x7113('0x2f')]);_0x13e50b[_0x7113('0x3b')]=_[_0x7113('0x31')](_0x13e50b['model'],_0x13e50b[_0x7113('0x2f')]);_0x2f4b58['attributes']=_[_0x7113('0x31')](_0x13e50b[_0x7113('0x32')],qs[_0x7113('0x34')](_0x483e99[_0x7113('0x2f')][_0x7113('0x34')]));_0x2f4b58[_0x7113('0x33')]=_0x2f4b58[_0x7113('0x33')]['length']?_0x2f4b58[_0x7113('0x33')]:_0x13e50b['model'];if(!_0x483e99['query'][_0x7113('0x36')](_0x7113('0x37'))){_0x2f4b58['limit']=qs['limit'](_0x483e99['query'][_0x7113('0x38')]);_0x2f4b58[_0x7113('0x1c')]=qs['offset'](_0x483e99[_0x7113('0x2f')][_0x7113('0x1c')]);}_0x2f4b58[_0x7113('0x39')]=qs[_0x7113('0x3a')](_0x483e99['query']['sort']);_0x2f4b58[_0x7113('0x3e')]=qs[_0x7113('0x3b')](_[_0x7113('0x3c')](_0x483e99['query'],_0x13e50b[_0x7113('0x3b')]));_0x2f4b58[_0x7113('0x3e')][_0x7113('0x5d')]=_0x1917cd['id'];if(_0x483e99[_0x7113('0x2f')][_0x7113('0x3d')]){_0x2f4b58[_0x7113('0x3e')]=_[_0x7113('0x3f')](_0x2f4b58['where'],{'$or':_['map'](_0x2f4b58['attributes'],function(_0x56f756){var _0x3e0c5d={};_0x3e0c5d[_0x56f756]={'$like':'%'+_0x483e99[_0x7113('0x2f')][_0x7113('0x3d')]+'%'};return _0x3e0c5d;})});}_0x2f4b58=_[_0x7113('0x3f')]({},_0x2f4b58,_0x483e99[_0x7113('0x41')]);return db[_0x7113('0x5e')][_0x7113('0x43')]({'where':_0x2f4b58['where']})['then'](function(_0x303c5a){_0x43a147[_0x7113('0x43')]=_0x303c5a;if(_0x483e99['query'][_0x7113('0x44')]){_0x2f4b58[_0x7113('0x45')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x2f4b58);})[_0x7113('0x21')](function(_0x4be9a3){_0x43a147[_0x7113('0x47')]=_0x4be9a3;return _0x43a147;});}})[_0x7113('0x21')](respondWithFilteredResult(_0x308639,_0x2f4b58))['catch'](handleError(_0x308639,null));};exports[_0x7113('0x5f')]=function(_0x23a53b,_0x51fbd6,_0x918d5){var _0x71dc36={'raw':!![],'where':{}};var _0x3b6e88={};var _0x5b3a14={'count':0x0,'rows':[]};return db[_0x7113('0x42')][_0x7113('0x5b')]({'where':{'id':_0x23a53b[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x51fbd6,null))[_0x7113('0x21')](function(_0x262d1a){if(_0x262d1a){_0x3b6e88[_0x7113('0x32')]=_[_0x7113('0x30')](db[_0x7113('0x60')]['rawAttributes']);_0x3b6e88[_0x7113('0x2f')]=_[_0x7113('0x30')](_0x23a53b[_0x7113('0x2f')]);_0x3b6e88['filters']=_[_0x7113('0x31')](_0x3b6e88['model'],_0x3b6e88[_0x7113('0x2f')]);_0x71dc36[_0x7113('0x33')]=_[_0x7113('0x31')](_0x3b6e88[_0x7113('0x32')],qs[_0x7113('0x34')](_0x23a53b[_0x7113('0x2f')][_0x7113('0x34')]));_0x71dc36['attributes']=_0x71dc36['attributes'][_0x7113('0x35')]?_0x71dc36[_0x7113('0x33')]:_0x3b6e88[_0x7113('0x32')];if(!_0x23a53b[_0x7113('0x2f')]['hasOwnProperty']('nolimit')){_0x71dc36[_0x7113('0x38')]=qs[_0x7113('0x38')](_0x23a53b['query'][_0x7113('0x38')]);_0x71dc36[_0x7113('0x1c')]=qs[_0x7113('0x1c')](_0x23a53b[_0x7113('0x2f')][_0x7113('0x1c')]);}_0x71dc36['order']=qs[_0x7113('0x3a')](_0x23a53b[_0x7113('0x2f')][_0x7113('0x3a')]);_0x71dc36['where']=qs[_0x7113('0x3b')](_[_0x7113('0x3c')](_0x23a53b[_0x7113('0x2f')],_0x3b6e88['filters']));_0x71dc36['where'][_0x7113('0x5d')]=_0x262d1a['id'];if(_0x23a53b['query'][_0x7113('0x3d')]){_0x71dc36['where']=_['merge'](_0x71dc36[_0x7113('0x3e')],{'$or':_['map'](_0x71dc36[_0x7113('0x33')],function(_0x58c426){var _0x47253e={};_0x47253e[_0x58c426]={'$like':'%'+_0x23a53b[_0x7113('0x2f')]['filter']+'%'};return _0x47253e;})});}_0x71dc36=_[_0x7113('0x3f')]({},_0x71dc36,_0x23a53b[_0x7113('0x41')]);return db['CmHopperFinal']['count']({'where':_0x71dc36[_0x7113('0x3e')]})[_0x7113('0x21')](function(_0x14db36){_0x5b3a14[_0x7113('0x43')]=_0x14db36;if(_0x23a53b[_0x7113('0x2f')]['includeAll']){_0x71dc36['include']=[{'all':!![]}];}return db[_0x7113('0x60')][_0x7113('0x46')](_0x71dc36);})['then'](function(_0x39ad77){_0x5b3a14[_0x7113('0x47')]=_0x39ad77;return _0x5b3a14;});}})['then'](respondWithFilteredResult(_0x51fbd6,_0x71dc36))[_0x7113('0x48')](handleError(_0x51fbd6,null));};exports['getHopperBlacks']=function(_0x27c806,_0x27b1a5,_0x5f5a13){var _0x267d04={'raw':!![],'where':{}};var _0x3e1b86={};var _0x49948f={'count':0x0,'rows':[]};return db[_0x7113('0x42')][_0x7113('0x5b')]({'where':{'id':_0x27c806[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x27b1a5,null))[_0x7113('0x21')](function(_0x453a5e){if(_0x453a5e){_0x3e1b86[_0x7113('0x32')]=_[_0x7113('0x30')](db[_0x7113('0x61')][_0x7113('0x2a')]);_0x3e1b86['query']=_['keys'](_0x27c806[_0x7113('0x2f')]);_0x3e1b86['filters']=_[_0x7113('0x31')](_0x3e1b86['model'],_0x3e1b86[_0x7113('0x2f')]);_0x267d04[_0x7113('0x33')]=_['intersection'](_0x3e1b86[_0x7113('0x32')],qs[_0x7113('0x34')](_0x27c806[_0x7113('0x2f')][_0x7113('0x34')]));_0x267d04['attributes']=_0x267d04[_0x7113('0x33')][_0x7113('0x35')]?_0x267d04[_0x7113('0x33')]:_0x3e1b86[_0x7113('0x32')];if(!_0x27c806['query'][_0x7113('0x36')](_0x7113('0x37'))){_0x267d04[_0x7113('0x38')]=qs[_0x7113('0x38')](_0x27c806['query'][_0x7113('0x38')]);_0x267d04['offset']=qs[_0x7113('0x1c')](_0x27c806[_0x7113('0x2f')]['offset']);}_0x267d04['order']=qs['sort'](_0x27c806[_0x7113('0x2f')]['sort']);_0x267d04[_0x7113('0x3e')]=qs['filters'](_['pick'](_0x27c806[_0x7113('0x2f')],_0x3e1b86[_0x7113('0x3b')]));_0x267d04['where']['CampaignId']=_0x453a5e['id'];if(_0x27c806[_0x7113('0x2f')][_0x7113('0x3d')]){_0x267d04[_0x7113('0x3e')]=_[_0x7113('0x3f')](_0x267d04[_0x7113('0x3e')],{'$or':_[_0x7113('0x2e')](_0x267d04[_0x7113('0x33')],function(_0x26b0d7){var _0x713d16={};_0x713d16[_0x26b0d7]={'$like':'%'+_0x27c806[_0x7113('0x2f')][_0x7113('0x3d')]+'%'};return _0x713d16;})});}_0x267d04=_[_0x7113('0x3f')]({},_0x267d04,_0x27c806[_0x7113('0x41')]);return db['CmHopperBlack'][_0x7113('0x43')]({'where':_0x267d04[_0x7113('0x3e')]})['then'](function(_0x32c484){_0x49948f[_0x7113('0x43')]=_0x32c484;if(_0x27c806[_0x7113('0x2f')][_0x7113('0x44')]){_0x267d04[_0x7113('0x45')]=[{'all':!![]}];}return db[_0x7113('0x61')]['findAll'](_0x267d04);})[_0x7113('0x21')](function(_0x2ede6e){_0x49948f[_0x7113('0x47')]=_0x2ede6e;return _0x49948f;});}})[_0x7113('0x21')](respondWithFilteredResult(_0x27b1a5,_0x267d04))['catch'](handleError(_0x27b1a5,null));};exports[_0x7113('0x62')]=function(_0x46fc34,_0x944949,_0x52c0a6){var _0x1d83d9={};var _0x44c32f={};var _0x1cc963;var _0x5947d4;return db['Campaign'][_0x7113('0x5b')]({'where':{'id':_0x46fc34[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x944949,null))[_0x7113('0x21')](function(_0x2a10e3){if(_0x2a10e3){_0x1cc963=_0x2a10e3;_0x44c32f['model']=_[_0x7113('0x30')](db['CmList']['rawAttributes']);_0x44c32f[_0x7113('0x2f')]=_[_0x7113('0x30')](_0x46fc34[_0x7113('0x2f')]);_0x44c32f[_0x7113('0x3b')]=_[_0x7113('0x31')](_0x44c32f[_0x7113('0x32')],_0x44c32f[_0x7113('0x2f')]);_0x1d83d9['attributes']=_[_0x7113('0x31')](_0x44c32f[_0x7113('0x32')],qs[_0x7113('0x34')](_0x46fc34['query']['fields']));_0x1d83d9[_0x7113('0x33')]=_0x1d83d9[_0x7113('0x33')][_0x7113('0x35')]?_0x1d83d9[_0x7113('0x33')]:_0x44c32f[_0x7113('0x32')];_0x1d83d9[_0x7113('0x39')]=qs[_0x7113('0x3a')](_0x46fc34[_0x7113('0x2f')][_0x7113('0x3a')]);_0x1d83d9[_0x7113('0x3e')]=qs[_0x7113('0x3b')](_[_0x7113('0x3c')](_0x46fc34[_0x7113('0x2f')],_0x44c32f['filters']));if(_0x46fc34['query'][_0x7113('0x3d')]){_0x1d83d9[_0x7113('0x3e')]=_[_0x7113('0x3f')](_0x1d83d9[_0x7113('0x3e')],{'$or':_[_0x7113('0x2e')](_0x1d83d9['attributes'],function(_0x3ddbde){var _0x134a63={};_0x134a63[_0x3ddbde]={'$like':'%'+_0x46fc34[_0x7113('0x2f')][_0x7113('0x3d')]+'%'};return _0x134a63;})});}_0x1d83d9=_['merge']({},_0x1d83d9,_0x46fc34[_0x7113('0x41')]);return _0x1cc963['getLists'](_0x1d83d9);}})[_0x7113('0x21')](function(_0x45c893){if(_0x45c893){_0x5947d4=_0x45c893['length'];if(!_0x46fc34[_0x7113('0x2f')][_0x7113('0x36')](_0x7113('0x37'))){_0x1d83d9[_0x7113('0x38')]=qs[_0x7113('0x38')](_0x46fc34['query'][_0x7113('0x38')]);_0x1d83d9['offset']=qs[_0x7113('0x1c')](_0x46fc34[_0x7113('0x2f')][_0x7113('0x1c')]);}return _0x1cc963[_0x7113('0x62')](_0x1d83d9);}})[_0x7113('0x21')](function(_0x29eda3){if(_0x29eda3){return _0x29eda3?{'count':_0x5947d4,'rows':_0x29eda3}:null;}})[_0x7113('0x21')](respondWithResult(_0x944949,null))[_0x7113('0x48')](handleError(_0x944949,null));};exports[_0x7113('0x63')]=function(_0x349bf6,_0x50fff5,_0x1bf889){var _0x3d5955,_0x2508f0;return db[_0x7113('0x42')]['find']({'where':{'id':_0x349bf6[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x50fff5,null))[_0x7113('0x21')](function(_0x20f650){if(_0x20f650){_0x2508f0=_0x20f650;return _0x20f650[_0x7113('0x63')](_0x349bf6['body'][_0x7113('0x64')],_[_0x7113('0x57')](_0x349bf6['body'],[_0x7113('0x64'),'id'])||{});}return null;})[_0x7113('0x65')](function(_0x77f303){var _0x20b4b4;_0x3d5955=_0x77f303||[];var _0x4fdc61=[];if(_0x77f303){for(var _0x557c21=0x0;_0x557c21<_0x77f303[_0x7113('0x35')];_0x557c21+=0x1){var _0x492b99=_0x77f303[_0x557c21][_0x7113('0x23')]({'plain':!![]});_0x2508f0['dialCheckDuplicateType']=_0x349bf6[_0x7113('0x4c')][_0x7113('0x66')]?_0x349bf6['body']['dialCheckDuplicateType']:_0x2508f0['dialCheckDuplicateType'];switch(_0x2508f0['dialCheckDuplicateType']){case _0x7113('0x67'):_0x20b4b4=squel[_0x7113('0x68')]()[_0x7113('0x69')](_0x7113('0x6a'))[_0x7113('0x6b')](['phone',_0x7113('0x6c'),'ContactId',_0x7113('0x6d'),_0x7113('0x5d'),_0x7113('0x55'),_0x7113('0x56')],squel[_0x7113('0x6e')]()[_0x7113('0x6f')](_0x7113('0x70'),_0x7113('0x70'))[_0x7113('0x6f')](_0x7113('0x71'),_0x7113('0x6c'))[_0x7113('0x6f')]('id','ContactId')[_0x7113('0x6f')](_0x492b99[_0x7113('0x72')]['toString'](),'ListId')[_0x7113('0x6f')](_0x349bf6[_0x7113('0x59')]['id'][_0x7113('0x73')](),_0x7113('0x5d'))[_0x7113('0x6f')]('NOW()',_0x7113('0x55'))[_0x7113('0x6f')](_0x7113('0x71'),_0x7113('0x56'))[_0x7113('0x74')](_0x7113('0x75'))[_0x7113('0x3e')]('deletedAt\x20IS\x20NULL')[_0x7113('0x3e')](_0x7113('0x76'),_0x492b99['CmListId'][_0x7113('0x73')]())[_0x7113('0x3e')](_0x7113('0x77'))['where'](_0x7113('0x78'),squel[_0x7113('0x6e')]()[_0x7113('0x6f')](_0x7113('0x79'))[_0x7113('0x74')](_0x7113('0x7a'))['where'](_0x7113('0x7b'),_0x349bf6[_0x7113('0x59')]['id'][_0x7113('0x73')]()))[_0x7113('0x3e')](_0x7113('0x78'),squel[_0x7113('0x6e')]()[_0x7113('0x6f')]('COALESCE(phone,\x27\x27)')[_0x7113('0x74')](_0x7113('0x6a'))[_0x7113('0x3e')]('CampaignId\x20=\x20?',_0x349bf6[_0x7113('0x59')]['id'][_0x7113('0x73')]())))[_0x7113('0x73')]();break;case _0x7113('0x7c'):_0x20b4b4=squel['insert']()[_0x7113('0x69')](_0x7113('0x6a'))[_0x7113('0x6b')]([_0x7113('0x70'),_0x7113('0x6c'),_0x7113('0x7d'),'ListId',_0x7113('0x5d'),_0x7113('0x55'),_0x7113('0x56')],squel[_0x7113('0x6e')]()[_0x7113('0x6f')](_0x7113('0x70'),'phone')[_0x7113('0x6f')](_0x7113('0x71'),'scheduledAt')[_0x7113('0x6f')]('id',_0x7113('0x7d'))[_0x7113('0x6f')](_0x492b99[_0x7113('0x72')][_0x7113('0x73')](),'ListId')['field'](_0x349bf6[_0x7113('0x59')]['id']['toString'](),_0x7113('0x5d'))[_0x7113('0x6f')](_0x7113('0x71'),'createdAt')[_0x7113('0x6f')](_0x7113('0x71'),_0x7113('0x56'))[_0x7113('0x74')](_0x7113('0x75'))[_0x7113('0x3e')](_0x7113('0x7e'))['where'](_0x7113('0x76'),_0x492b99['CmListId']['toString']())[_0x7113('0x3e')](_0x7113('0x77'))['where'](_0x7113('0x78'),squel[_0x7113('0x6e')]()[_0x7113('0x6f')](_0x7113('0x7f'))[_0x7113('0x74')](_0x7113('0x6a'))[_0x7113('0x3e')](_0x7113('0x7b'),_0x349bf6[_0x7113('0x59')]['id'][_0x7113('0x73')]())))[_0x7113('0x73')]();break;default:_0x20b4b4=squel[_0x7113('0x68')]()['into'](_0x7113('0x6a'))[_0x7113('0x6b')]([_0x7113('0x70'),_0x7113('0x6c'),_0x7113('0x7d'),_0x7113('0x6d'),_0x7113('0x5d'),'createdAt','updatedAt'],squel['select']()[_0x7113('0x6f')](_0x7113('0x70'),_0x7113('0x70'))['field'](_0x7113('0x71'),_0x7113('0x6c'))[_0x7113('0x6f')]('id',_0x7113('0x7d'))[_0x7113('0x6f')](_0x492b99[_0x7113('0x72')][_0x7113('0x73')](),_0x7113('0x6d'))[_0x7113('0x6f')](_0x349bf6[_0x7113('0x59')]['id'][_0x7113('0x73')](),_0x7113('0x5d'))[_0x7113('0x6f')](_0x7113('0x71'),_0x7113('0x55'))['field'](_0x7113('0x71'),_0x7113('0x56'))[_0x7113('0x74')]('cm_contacts')['where'](_0x7113('0x7e'))['where'](_0x7113('0x76'),_0x492b99['CmListId']['toString']())[_0x7113('0x3e')](_0x7113('0x77')))[_0x7113('0x73')]();}_0x4fdc61[_0x7113('0x80')](db['sequelize']['query'](_0x20b4b4));}return BPromise[_0x7113('0x81')](_0x4fdc61);}})['then'](function(){return _0x3d5955;})[_0x7113('0x21')](respondWithResult(_0x50fff5,null))['catch'](handleError(_0x50fff5,null));};exports[_0x7113('0x82')]=function(_0xcffe65,_0x42c91f,_0x249d22){return db[_0x7113('0x42')][_0x7113('0x4a')]({'where':{'id':_0xcffe65[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x42c91f,null))[_0x7113('0x21')](function(_0x2ffdd3){if(_0x2ffdd3){return _0x2ffdd3['removeLists'](_0xcffe65['query'][_0x7113('0x64')]);}})['then'](function(_0x26ff81){if(_0x26ff81){return db[_0x7113('0x5c')][_0x7113('0x22')]({'where':{'ListId':_0xcffe65[_0x7113('0x2f')]['ids'],'CampaignId':_0xcffe65['params']['id']}})['then'](function(){return _0x26ff81;});}})[_0x7113('0x21')](respondWithStatusCode(_0x42c91f,null))[_0x7113('0x48')](handleError(_0x42c91f,null));};exports[_0x7113('0x83')]=function(_0x49e387,_0x3ebac0,_0xfa6c63){var _0x362122={'raw':!![],'where':{}};var _0x3b4cf9={};var _0x460ae1={'count':0x0,'rows':[]};return db[_0x7113('0x42')][_0x7113('0x5b')]({'where':{'id':_0x49e387[_0x7113('0x59')]['id']}})['then'](handleEntityNotFound(_0x3ebac0,null))['then'](function(_0x36c97d){if(_0x36c97d){_0x3b4cf9[_0x7113('0x32')]=_[_0x7113('0x30')](db[_0x7113('0x84')][_0x7113('0x2a')]);_0x3b4cf9[_0x7113('0x2f')]=_['keys'](_0x49e387[_0x7113('0x2f')]);_0x3b4cf9['filters']=_[_0x7113('0x31')](_0x3b4cf9['model'],_0x3b4cf9['query']);_0x362122['attributes']=_[_0x7113('0x31')](_0x3b4cf9[_0x7113('0x32')],qs[_0x7113('0x34')](_0x49e387[_0x7113('0x2f')][_0x7113('0x34')]));_0x362122['attributes']=_0x362122[_0x7113('0x33')]['length']?_0x362122[_0x7113('0x33')]:_0x3b4cf9[_0x7113('0x32')];if(!_0x49e387['query']['hasOwnProperty'](_0x7113('0x37'))){_0x362122[_0x7113('0x38')]=qs[_0x7113('0x38')](_0x49e387['query'][_0x7113('0x38')]);_0x362122[_0x7113('0x1c')]=qs['offset'](_0x49e387['query'][_0x7113('0x1c')]);}_0x362122['order']=qs[_0x7113('0x3a')](_0x49e387[_0x7113('0x2f')][_0x7113('0x3a')]);_0x362122[_0x7113('0x3e')]=qs[_0x7113('0x3b')](_['pick'](_0x49e387[_0x7113('0x2f')],_0x3b4cf9[_0x7113('0x3b')]));_0x362122[_0x7113('0x3e')]['CampaignId']=_0x36c97d['id'];if(_0x49e387[_0x7113('0x2f')][_0x7113('0x3d')]){_0x362122['where']=_[_0x7113('0x3f')](_0x362122[_0x7113('0x3e')],{'$or':_[_0x7113('0x2e')](_0x362122[_0x7113('0x33')],function(_0x541503){var _0x15385e={};_0x15385e[_0x541503]={'$like':'%'+_0x49e387[_0x7113('0x2f')]['filter']+'%'};return _0x15385e;})});}_0x362122=_[_0x7113('0x3f')]({},_0x362122,_0x49e387['options']);return db[_0x7113('0x84')][_0x7113('0x43')]({'where':_0x362122[_0x7113('0x3e')]})[_0x7113('0x21')](function(_0x4d5c07){_0x460ae1['count']=_0x4d5c07;if(_0x49e387[_0x7113('0x2f')][_0x7113('0x44')]){_0x362122['include']=[{'all':!![]}];}return db[_0x7113('0x84')]['findAll'](_0x362122);})[_0x7113('0x21')](function(_0x3ff036){_0x460ae1[_0x7113('0x47')]=_0x3ff036;return _0x460ae1;});}})[_0x7113('0x21')](respondWithFilteredResult(_0x3ebac0,_0x362122))[_0x7113('0x48')](handleError(_0x3ebac0,null));};exports[_0x7113('0x85')]=function(_0x400025,_0x18cdb9,_0x214c01){var _0x45013f,_0x5b52be;return db[_0x7113('0x42')][_0x7113('0x4a')]({'where':{'id':_0x400025[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x18cdb9,null))[_0x7113('0x21')](function(_0x57f65a){if(_0x57f65a){_0x5b52be=_0x57f65a;return _0x57f65a[_0x7113('0x85')](_0x400025[_0x7113('0x4c')]['ids'],_[_0x7113('0x57')](_0x400025[_0x7113('0x4c')],[_0x7113('0x64'),'id'])||{});}return null;})[_0x7113('0x65')](function(_0x4eff88){var _0x20b836;_0x45013f=_0x4eff88||[];var _0x3beb6e=[];if(_0x4eff88){for(var _0x338977=0x0;_0x338977<_0x4eff88[_0x7113('0x35')];_0x338977+=0x1){var _0x1c3d02=_0x4eff88[_0x338977][_0x7113('0x23')]({'plain':!![]});_0x20b836=squel[_0x7113('0x68')]()['into'](_0x7113('0x86'))[_0x7113('0x6b')]([_0x7113('0x70'),'ContactId',_0x7113('0x6d'),_0x7113('0x5d'),_0x7113('0x55'),_0x7113('0x56')],squel['select']()[_0x7113('0x6f')](_0x7113('0x70'),_0x7113('0x70'))['field']('id',_0x7113('0x7d'))[_0x7113('0x6f')](_0x1c3d02[_0x7113('0x72')][_0x7113('0x73')](),_0x7113('0x6d'))['field'](_0x400025[_0x7113('0x59')]['id']['toString'](),_0x7113('0x5d'))[_0x7113('0x6f')](_0x7113('0x71'),_0x7113('0x55'))[_0x7113('0x6f')](_0x7113('0x71'),_0x7113('0x56'))[_0x7113('0x74')](_0x7113('0x75'))['where']('deletedAt\x20IS\x20NULL')[_0x7113('0x3e')]('ListId\x20=\x20?',_0x1c3d02[_0x7113('0x72')]['toString']())[_0x7113('0x3e')](_0x7113('0x77')))[_0x7113('0x73')]();_0x3beb6e[_0x7113('0x80')](db[_0x7113('0x87')]['query'](_0x20b836));}return BPromise['all'](_0x3beb6e);}})[_0x7113('0x21')](function(){return _0x45013f;})[_0x7113('0x21')](respondWithResult(_0x18cdb9,null))[_0x7113('0x48')](handleError(_0x18cdb9,null));};exports[_0x7113('0x88')]=function(_0x254901,_0x35d2c8,_0x292095){return db[_0x7113('0x42')][_0x7113('0x4a')]({'where':{'id':_0x254901[_0x7113('0x59')]['id']}})[_0x7113('0x21')](handleEntityNotFound(_0x35d2c8,null))[_0x7113('0x21')](function(_0x1464ec){if(_0x1464ec){return _0x1464ec['removeBlackLists'](_0x254901[_0x7113('0x2f')][_0x7113('0x64')]);}})[_0x7113('0x21')](function(_0x7bc354){if(_0x7bc354){return db[_0x7113('0x61')][_0x7113('0x22')]({'where':{'ListId':_0x254901[_0x7113('0x2f')][_0x7113('0x64')],'CampaignId':_0x254901[_0x7113('0x59')]['id']}})[_0x7113('0x21')](function(){return _0x7bc354;});}})[_0x7113('0x21')](respondWithStatusCode(_0x35d2c8,null))['catch'](handleError(_0x35d2c8,null));};
\ No newline at end of file
+var _0x884a=['Content-Range','apply','reject','save','destroy','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','Campaign','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','user','userProfileId','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper','sort','CampaignId','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','toString','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set'];(function(_0x5d4fed,_0xd2b5e5){var _0x1f29b0=function(_0x1317c2){while(--_0x1317c2){_0x5d4fed['push'](_0x5d4fed['shift']());}};_0x1f29b0(++_0xd2b5e5);}(_0x884a,0x1f2));var _0xa884=function(_0x448f77,_0x41b8eb){_0x448f77=_0x448f77-0x0;var _0x2b2fed=_0x884a[_0x448f77];return _0x2b2fed;};'use strict';var pdf=require(_0xa884('0x0'));var emlformat=require(_0xa884('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa884('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa884('0x3'));var moment=require(_0xa884('0x4'));var BPromise=require(_0xa884('0x5'));var Mustache=require(_0xa884('0x6'));var util=require(_0xa884('0x7'));var path=require(_0xa884('0x8'));var sox=require(_0xa884('0x9'));var csv=require(_0xa884('0xa'));var ejs=require(_0xa884('0xb'));var fs=require('fs');var _=require(_0xa884('0xc'));var squel=require(_0xa884('0xd'));var crypto=require(_0xa884('0xe'));var jsforce=require(_0xa884('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa884('0x10'));var Papa=require('papaparse');var Redis=require(_0xa884('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa884('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa884('0x13'));var logger=require(_0xa884('0x14'))('api');var utils=require(_0xa884('0x15'));var config=require(_0xa884('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21598a,_0x337c25){_0x337c25=_0x337c25||0xcc;return function(_0x5de13c){if(_0x5de13c){return _0x21598a[_0xa884('0x17')](_0x337c25);}return _0x21598a[_0xa884('0x18')](_0x337c25)['end']();};}function respondWithResult(_0x1c8d1e,_0x11e28c){_0x11e28c=_0x11e28c||0xc8;return function(_0x124d67){if(_0x124d67){return _0x1c8d1e[_0xa884('0x18')](_0x11e28c)[_0xa884('0x19')](_0x124d67);}};}function respondWithFilteredResult(_0x492817,_0x57272b){return function(_0x3acbb9){if(_0x3acbb9){var _0x3813e0=_0x3acbb9[_0xa884('0x1a')],_0x23ba6c=_0x57272b[_0xa884('0x1b')],_0x20c78e=_0x57272b['offset']+_0x57272b[_0xa884('0x1c')],_0x44b938;if(_0x20c78e>=_0x3813e0){_0x20c78e=_0x3813e0;_0x44b938=0xc8;}else{_0x44b938=0xce;}_0x492817[_0xa884('0x18')](_0x44b938);return _0x492817[_0xa884('0x1d')](_0xa884('0x1e'),_0x23ba6c+'-'+_0x20c78e+'/'+_0x3813e0)[_0xa884('0x19')](_0x3acbb9);}return null;};}function patchUpdates(_0x23600e){return function(_0x13301e){try{jsonpatch[_0xa884('0x1f')](_0x13301e,_0x23600e,!![]);}catch(_0x550c57){return BPromise[_0xa884('0x20')](_0x550c57);}return _0x13301e[_0xa884('0x21')]();};}function saveUpdates(_0x412471,_0x263916){return function(_0x4b3947){if(_0x4b3947){return _0x4b3947['update'](_0x412471)['then'](function(_0x24a952){return _0x24a952;});}return null;};}function removeEntity(_0x4eb2e8,_0x344766){return function(_0x1d76d2){if(_0x1d76d2){return _0x1d76d2[_0xa884('0x22')]()[_0xa884('0x23')](function(){var _0x584f26=_0x1d76d2[_0xa884('0x24')]({'plain':!![]});var _0x58662f=_0xa884('0x25');return db[_0xa884('0x26')][_0xa884('0x22')]({'where':{'type':_0x58662f,'resourceId':_0x584f26['id']}})[_0xa884('0x23')](function(){return _0x1d76d2;});})[_0xa884('0x23')](function(){_0x4eb2e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x121852,_0x57c652){return function(_0x20e34d){if(!_0x20e34d){_0x121852[_0xa884('0x17')](0x194);}return _0x20e34d;};}function handleError(_0x11e2dc,_0x46fb84){_0x46fb84=_0x46fb84||0x1f4;return function(_0x39740d){logger[_0xa884('0x27')](_0x39740d[_0xa884('0x28')]);if(_0x39740d[_0xa884('0x29')]){delete _0x39740d[_0xa884('0x29')];}_0x11e2dc[_0xa884('0x18')](_0x46fb84)[_0xa884('0x2a')](_0x39740d);};}exports[_0xa884('0x2b')]=function(_0x232b0f,_0x58ccdd){var _0x5c96d8={},_0x4770b3={},_0x2ba557={'count':0x0,'rows':[]};var _0x306a2c=_['map'](db[_0xa884('0x2c')]['rawAttributes'],function(_0x5f1f48){return{'name':_0x5f1f48['fieldName'],'type':_0x5f1f48['type'][_0xa884('0x2d')]};});_0x4770b3[_0xa884('0x2e')]=_[_0xa884('0x2f')](_0x306a2c,_0xa884('0x29'));_0x4770b3[_0xa884('0x30')]=_[_0xa884('0x31')](_0x232b0f[_0xa884('0x30')]);_0x4770b3[_0xa884('0x32')]=_[_0xa884('0x33')](_0x4770b3[_0xa884('0x2e')],_0x4770b3['query']);_0x5c96d8[_0xa884('0x34')]=_[_0xa884('0x33')](_0x4770b3[_0xa884('0x2e')],qs[_0xa884('0x35')](_0x232b0f[_0xa884('0x30')][_0xa884('0x35')]));_0x5c96d8['attributes']=_0x5c96d8['attributes'][_0xa884('0x36')]?_0x5c96d8[_0xa884('0x34')]:_0x4770b3['model'];if(!_0x232b0f[_0xa884('0x30')][_0xa884('0x37')](_0xa884('0x38'))){_0x5c96d8[_0xa884('0x1c')]=qs[_0xa884('0x1c')](_0x232b0f[_0xa884('0x30')][_0xa884('0x1c')]);_0x5c96d8['offset']=qs['offset'](_0x232b0f['query']['offset']);}_0x5c96d8[_0xa884('0x39')]=qs['sort'](_0x232b0f[_0xa884('0x30')]['sort']);_0x5c96d8[_0xa884('0x3a')]=qs[_0xa884('0x32')](_[_0xa884('0x3b')](_0x232b0f[_0xa884('0x30')],_0x4770b3[_0xa884('0x32')]),_0x306a2c);if(_0x232b0f[_0xa884('0x30')][_0xa884('0x3c')]){_0x5c96d8[_0xa884('0x3a')]=_['merge'](_0x5c96d8[_0xa884('0x3a')],{'$or':_['map'](_0x306a2c,function(_0x2e15c8){if(_0x2e15c8[_0xa884('0x3d')]!=='VIRTUAL'){var _0x4a14a3={};_0x4a14a3[_0x2e15c8[_0xa884('0x29')]]={'$like':'%'+_0x232b0f['query']['filter']+'%'};return _0x4a14a3;}})});}_0x5c96d8=_[_0xa884('0x3e')]({},_0x5c96d8,_0x232b0f[_0xa884('0x3f')]);var _0x46b8c5={'where':_0x5c96d8[_0xa884('0x3a')]};return db[_0xa884('0x2c')][_0xa884('0x1a')](_0x46b8c5)[_0xa884('0x23')](function(_0x388279){_0x2ba557['count']=_0x388279;if(_0x232b0f[_0xa884('0x30')][_0xa884('0x40')]){_0x5c96d8[_0xa884('0x41')]=[{'all':!![]}];}return db[_0xa884('0x2c')][_0xa884('0x42')](_0x5c96d8);})['then'](function(_0x1a2ed7){_0x2ba557[_0xa884('0x43')]=_0x1a2ed7;return _0x2ba557;})['then'](respondWithFilteredResult(_0x58ccdd,_0x5c96d8))['catch'](handleError(_0x58ccdd,null));};exports['show']=function(_0x5556ab,_0x2b9ab3){var _0xcab4f1={'raw':![],'where':{'id':_0x5556ab[_0xa884('0x44')]['id']}},_0x1282a0={};_0x1282a0[_0xa884('0x2e')]=_[_0xa884('0x31')](db[_0xa884('0x2c')][_0xa884('0x45')]);_0x1282a0[_0xa884('0x30')]=_[_0xa884('0x31')](_0x5556ab[_0xa884('0x30')]);_0x1282a0['filters']=_[_0xa884('0x33')](_0x1282a0[_0xa884('0x2e')],_0x1282a0[_0xa884('0x30')]);_0xcab4f1['attributes']=_[_0xa884('0x33')](_0x1282a0[_0xa884('0x2e')],qs['fields'](_0x5556ab[_0xa884('0x30')][_0xa884('0x35')]));_0xcab4f1[_0xa884('0x34')]=_0xcab4f1[_0xa884('0x34')][_0xa884('0x36')]?_0xcab4f1[_0xa884('0x34')]:_0x1282a0['model'];if(_0x5556ab['query'][_0xa884('0x40')]){_0xcab4f1[_0xa884('0x41')]=[{'all':!![]}];}_0xcab4f1=_[_0xa884('0x3e')]({},_0xcab4f1,_0x5556ab[_0xa884('0x3f')]);return db[_0xa884('0x2c')][_0xa884('0x46')](_0xcab4f1)['then'](handleEntityNotFound(_0x2b9ab3,null))[_0xa884('0x23')](respondWithResult(_0x2b9ab3,null))[_0xa884('0x47')](handleError(_0x2b9ab3,null));};exports[_0xa884('0x48')]=function(_0x186fd2,_0x243683){return db[_0xa884('0x2c')][_0xa884('0x48')](_0x186fd2[_0xa884('0x49')],{})[_0xa884('0x23')](function(_0x205cf9){var _0x5641cd=_0x186fd2[_0xa884('0x4a')][_0xa884('0x24')]({'plain':!![]});if(!_0x5641cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5641cd['role']==='user'){var _0x5a8d2f=_0x205cf9[_0xa884('0x24')]({'plain':!![]});var _0x31ee08='IvrCampaigns';return db['UserProfileSection'][_0xa884('0x46')]({'where':{'name':_0x31ee08,'userProfileId':_0x5641cd[_0xa884('0x4b')]},'raw':!![]})[_0xa884('0x23')](function(_0x2d3885){if(_0x2d3885&&_0x2d3885['autoAssociation']===0x0){return db[_0xa884('0x26')][_0xa884('0x48')]({'name':_0x5a8d2f['name'],'resourceId':_0x5a8d2f['id'],'type':_0x2d3885[_0xa884('0x29')],'sectionId':_0x2d3885['id']},{})['then'](function(){return _0x205cf9;});}else{return _0x205cf9;}})[_0xa884('0x47')](function(_0x404e34){logger[_0xa884('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x404e34);throw _0x404e34;});}return _0x205cf9;})[_0xa884('0x23')](respondWithResult(_0x243683,0xc9))['catch'](handleError(_0x243683,null));};exports['clone']=function(_0x3673cb,_0xb77cf4){var _0x42e9b9={'where':{'id':_0x3673cb[_0xa884('0x44')]['id']}},_0x2422ec={};_0x2422ec[_0xa884('0x2e')]=_['keys'](db['Campaign']['rawAttributes']);_0x42e9b9[_0xa884('0x34')]=_[_0xa884('0x33')](_0x2422ec[_0xa884('0x2e')],qs['fields'](_0x3673cb['query'][_0xa884('0x35')]));_0x42e9b9[_0xa884('0x34')]=_0x42e9b9[_0xa884('0x34')][_0xa884('0x36')]?_0x42e9b9[_0xa884('0x34')]:_0x2422ec[_0xa884('0x2e')];if(_0x3673cb[_0xa884('0x30')][_0xa884('0x40')]){_0x42e9b9[_0xa884('0x41')]=[{'all':!![]}];}_0x42e9b9=_['merge']({},_0x42e9b9,_0x3673cb['options']);return db[_0xa884('0x2c')][_0xa884('0x46')](_0x42e9b9)['then'](handleEntityNotFound(_0xb77cf4,null))[_0xa884('0x23')](function(_0xb370ff){if(_0xb370ff){var _0x41ee5b=_0xb370ff[_0xa884('0x24')]({'plain':!![]});_0x41ee5b=qs[_0xa884('0x4c')](_0x41ee5b,['id',_0xa884('0x4d'),_0xa884('0x4e')]);_0x3673cb[_0xa884('0x49')]=_['omit'](_0x3673cb['body'],['id',_0xa884('0x4d'),_0xa884('0x4e')]);return db[_0xa884('0x2c')][_0xa884('0x48')](_[_0xa884('0x3e')](_0x41ee5b,_0x3673cb[_0xa884('0x49')]),{'include':_0x3673cb[_0xa884('0x30')][_0xa884('0x40')]?[{'all':!![]}]:undefined})[_0xa884('0x23')](function(_0xca7343){var _0x72de1d=_0x3673cb[_0xa884('0x4a')]['get']({'plain':!![]});if(!_0x72de1d)throw new Error(_0xa884('0x4f'));if(_0x72de1d[_0xa884('0x50')]==='user'){var _0x1da4c1=_0xca7343[_0xa884('0x24')]({'plain':!![]});var _0x23a6a3=_0xa884('0x25');return db[_0xa884('0x51')]['find']({'where':{'name':_0x23a6a3,'userProfileId':_0x72de1d[_0xa884('0x4b')]},'raw':!![]})[_0xa884('0x23')](function(_0x4e76e4){if(_0x4e76e4&&_0x4e76e4[_0xa884('0x52')]===0x0){return db[_0xa884('0x26')]['create']({'name':_0x1da4c1[_0xa884('0x29')],'resourceId':_0x1da4c1['id'],'type':_0x4e76e4['name'],'sectionId':_0x4e76e4['id']},{})[_0xa884('0x23')](function(){return _0xca7343;});}else{return _0xca7343;}})[_0xa884('0x47')](function(_0x56db16){logger[_0xa884('0x27')](_0xa884('0x53'),_0x56db16);throw _0x56db16;});}return _0xca7343;});}})[_0xa884('0x23')](respondWithResult(_0xb77cf4,0xc9))[_0xa884('0x47')](handleError(_0xb77cf4,null));};exports[_0xa884('0x54')]=function(_0x3e485c,_0x55905a){if(_0x3e485c[_0xa884('0x49')]['id']){delete _0x3e485c['body']['id'];}return db['Campaign'][_0xa884('0x46')]({'where':{'id':_0x3e485c[_0xa884('0x44')]['id']}})['then'](handleEntityNotFound(_0x55905a,null))[_0xa884('0x23')](saveUpdates(_0x3e485c[_0xa884('0x49')],null))[_0xa884('0x23')](respondWithResult(_0x55905a,null))[_0xa884('0x47')](handleError(_0x55905a,null));};exports[_0xa884('0x22')]=function(_0x36062a,_0x14b913){return db[_0xa884('0x2c')][_0xa884('0x46')]({'where':{'id':_0x36062a[_0xa884('0x44')]['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x14b913,null))['then'](removeEntity(_0x14b913,null))['catch'](handleError(_0x14b913,null));};exports[_0xa884('0x55')]=function(_0x4dad45,_0x8808d5,_0x3562e4){var _0x40b5a5={'raw':!![],'where':{}};var _0x20f7fc={};var _0x1925dd={'count':0x0,'rows':[]};return db[_0xa884('0x2c')]['findOne']({'where':{'id':_0x4dad45[_0xa884('0x44')]['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x8808d5,null))[_0xa884('0x23')](function(_0x18d035){if(_0x18d035){_0x20f7fc[_0xa884('0x2e')]=_[_0xa884('0x31')](db[_0xa884('0x56')]['rawAttributes']);_0x20f7fc['query']=_[_0xa884('0x31')](_0x4dad45['query']);_0x20f7fc[_0xa884('0x32')]=_[_0xa884('0x33')](_0x20f7fc['model'],_0x20f7fc['query']);_0x40b5a5[_0xa884('0x34')]=_[_0xa884('0x33')](_0x20f7fc['model'],qs[_0xa884('0x35')](_0x4dad45['query'][_0xa884('0x35')]));_0x40b5a5[_0xa884('0x34')]=_0x40b5a5[_0xa884('0x34')]['length']?_0x40b5a5['attributes']:_0x20f7fc[_0xa884('0x2e')];if(!_0x4dad45[_0xa884('0x30')][_0xa884('0x37')](_0xa884('0x38'))){_0x40b5a5['limit']=qs[_0xa884('0x1c')](_0x4dad45['query'][_0xa884('0x1c')]);_0x40b5a5['offset']=qs[_0xa884('0x1b')](_0x4dad45[_0xa884('0x30')][_0xa884('0x1b')]);}_0x40b5a5['order']=qs[_0xa884('0x57')](_0x4dad45[_0xa884('0x30')][_0xa884('0x57')]);_0x40b5a5[_0xa884('0x3a')]=qs['filters'](_[_0xa884('0x3b')](_0x4dad45['query'],_0x20f7fc['filters']));_0x40b5a5[_0xa884('0x3a')][_0xa884('0x58')]=_0x18d035['id'];if(_0x4dad45['query'][_0xa884('0x3c')]){_0x40b5a5[_0xa884('0x3a')]=_[_0xa884('0x3e')](_0x40b5a5[_0xa884('0x3a')],{'$or':_[_0xa884('0x2f')](_0x40b5a5[_0xa884('0x34')],function(_0x47bd7d){var _0x2d224e={};_0x2d224e[_0x47bd7d]={'$like':'%'+_0x4dad45[_0xa884('0x30')][_0xa884('0x3c')]+'%'};return _0x2d224e;})});}_0x40b5a5=_[_0xa884('0x3e')]({},_0x40b5a5,_0x4dad45['options']);return db[_0xa884('0x56')]['count']({'where':_0x40b5a5[_0xa884('0x3a')]})['then'](function(_0x53ff98){_0x1925dd[_0xa884('0x1a')]=_0x53ff98;if(_0x4dad45['query'][_0xa884('0x40')]){_0x40b5a5[_0xa884('0x41')]=[{'all':!![]}];}return db[_0xa884('0x56')][_0xa884('0x42')](_0x40b5a5);})[_0xa884('0x23')](function(_0x3af90e){_0x1925dd[_0xa884('0x43')]=_0x3af90e;return _0x1925dd;});}})['then'](respondWithFilteredResult(_0x8808d5,_0x40b5a5))[_0xa884('0x47')](handleError(_0x8808d5,null));};exports[_0xa884('0x59')]=function(_0x45f3af,_0x397380,_0x1c589c){var _0x568c91={'raw':!![],'where':{}};var _0x44e105={};var _0x2a72e1={'count':0x0,'rows':[]};return db[_0xa884('0x2c')][_0xa884('0x5a')]({'where':{'id':_0x45f3af[_0xa884('0x44')]['id']}})['then'](handleEntityNotFound(_0x397380,null))[_0xa884('0x23')](function(_0xb2f058){if(_0xb2f058){_0x44e105[_0xa884('0x2e')]=_[_0xa884('0x31')](db[_0xa884('0x5b')][_0xa884('0x45')]);_0x44e105['query']=_[_0xa884('0x31')](_0x45f3af[_0xa884('0x30')]);_0x44e105[_0xa884('0x32')]=_[_0xa884('0x33')](_0x44e105[_0xa884('0x2e')],_0x44e105['query']);_0x568c91[_0xa884('0x34')]=_[_0xa884('0x33')](_0x44e105[_0xa884('0x2e')],qs[_0xa884('0x35')](_0x45f3af[_0xa884('0x30')]['fields']));_0x568c91[_0xa884('0x34')]=_0x568c91[_0xa884('0x34')][_0xa884('0x36')]?_0x568c91[_0xa884('0x34')]:_0x44e105[_0xa884('0x2e')];if(!_0x45f3af[_0xa884('0x30')][_0xa884('0x37')](_0xa884('0x38'))){_0x568c91[_0xa884('0x1c')]=qs[_0xa884('0x1c')](_0x45f3af[_0xa884('0x30')]['limit']);_0x568c91['offset']=qs[_0xa884('0x1b')](_0x45f3af[_0xa884('0x30')][_0xa884('0x1b')]);}_0x568c91['order']=qs[_0xa884('0x57')](_0x45f3af[_0xa884('0x30')][_0xa884('0x57')]);_0x568c91[_0xa884('0x3a')]=qs[_0xa884('0x32')](_['pick'](_0x45f3af['query'],_0x44e105[_0xa884('0x32')]));_0x568c91['where'][_0xa884('0x58')]=_0xb2f058['id'];if(_0x45f3af[_0xa884('0x30')][_0xa884('0x3c')]){_0x568c91[_0xa884('0x3a')]=_[_0xa884('0x3e')](_0x568c91[_0xa884('0x3a')],{'$or':_[_0xa884('0x2f')](_0x568c91[_0xa884('0x34')],function(_0x1b21f4){var _0x436d29={};_0x436d29[_0x1b21f4]={'$like':'%'+_0x45f3af['query'][_0xa884('0x3c')]+'%'};return _0x436d29;})});}_0x568c91=_[_0xa884('0x3e')]({},_0x568c91,_0x45f3af[_0xa884('0x3f')]);return db[_0xa884('0x5b')][_0xa884('0x1a')]({'where':_0x568c91[_0xa884('0x3a')]})[_0xa884('0x23')](function(_0x4925e6){_0x2a72e1['count']=_0x4925e6;if(_0x45f3af[_0xa884('0x30')][_0xa884('0x40')]){_0x568c91[_0xa884('0x41')]=[{'all':!![]}];}return db[_0xa884('0x5b')]['findAll'](_0x568c91);})[_0xa884('0x23')](function(_0x155e4c){_0x2a72e1[_0xa884('0x43')]=_0x155e4c;return _0x2a72e1;});}})[_0xa884('0x23')](respondWithFilteredResult(_0x397380,_0x568c91))[_0xa884('0x47')](handleError(_0x397380,null));};exports['getHopperFinals']=function(_0xbf48a0,_0x1dc40b,_0x236c22){var _0x2a3bad={'raw':!![],'where':{}};var _0x2e8e3f={};var _0x35dad6={'count':0x0,'rows':[]};return db[_0xa884('0x2c')]['findOne']({'where':{'id':_0xbf48a0[_0xa884('0x44')]['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x1dc40b,null))[_0xa884('0x23')](function(_0x2c6a16){if(_0x2c6a16){_0x2e8e3f[_0xa884('0x2e')]=_['keys'](db[_0xa884('0x5c')][_0xa884('0x45')]);_0x2e8e3f['query']=_[_0xa884('0x31')](_0xbf48a0[_0xa884('0x30')]);_0x2e8e3f[_0xa884('0x32')]=_['intersection'](_0x2e8e3f['model'],_0x2e8e3f[_0xa884('0x30')]);_0x2a3bad[_0xa884('0x34')]=_['intersection'](_0x2e8e3f['model'],qs[_0xa884('0x35')](_0xbf48a0['query'][_0xa884('0x35')]));_0x2a3bad['attributes']=_0x2a3bad['attributes'][_0xa884('0x36')]?_0x2a3bad[_0xa884('0x34')]:_0x2e8e3f[_0xa884('0x2e')];if(!_0xbf48a0['query'][_0xa884('0x37')]('nolimit')){_0x2a3bad[_0xa884('0x1c')]=qs[_0xa884('0x1c')](_0xbf48a0[_0xa884('0x30')][_0xa884('0x1c')]);_0x2a3bad[_0xa884('0x1b')]=qs[_0xa884('0x1b')](_0xbf48a0['query'][_0xa884('0x1b')]);}_0x2a3bad[_0xa884('0x39')]=qs[_0xa884('0x57')](_0xbf48a0[_0xa884('0x30')]['sort']);_0x2a3bad['where']=qs[_0xa884('0x32')](_[_0xa884('0x3b')](_0xbf48a0[_0xa884('0x30')],_0x2e8e3f[_0xa884('0x32')]));_0x2a3bad[_0xa884('0x3a')][_0xa884('0x58')]=_0x2c6a16['id'];if(_0xbf48a0[_0xa884('0x30')]['filter']){_0x2a3bad[_0xa884('0x3a')]=_['merge'](_0x2a3bad[_0xa884('0x3a')],{'$or':_['map'](_0x2a3bad[_0xa884('0x34')],function(_0x3271e7){var _0x1f165c={};_0x1f165c[_0x3271e7]={'$like':'%'+_0xbf48a0[_0xa884('0x30')][_0xa884('0x3c')]+'%'};return _0x1f165c;})});}_0x2a3bad=_[_0xa884('0x3e')]({},_0x2a3bad,_0xbf48a0[_0xa884('0x3f')]);return db[_0xa884('0x5c')][_0xa884('0x1a')]({'where':_0x2a3bad[_0xa884('0x3a')]})[_0xa884('0x23')](function(_0x4bc0a9){_0x35dad6['count']=_0x4bc0a9;if(_0xbf48a0[_0xa884('0x30')]['includeAll']){_0x2a3bad[_0xa884('0x41')]=[{'all':!![]}];}return db[_0xa884('0x5c')][_0xa884('0x42')](_0x2a3bad);})[_0xa884('0x23')](function(_0x5e4494){_0x35dad6[_0xa884('0x43')]=_0x5e4494;return _0x35dad6;});}})[_0xa884('0x23')](respondWithFilteredResult(_0x1dc40b,_0x2a3bad))['catch'](handleError(_0x1dc40b,null));};exports[_0xa884('0x5d')]=function(_0xbd717f,_0x43c23f,_0x4f185f){var _0x447db2={'raw':!![],'where':{}};var _0x2e8a1e={};var _0x2c775a={'count':0x0,'rows':[]};return db[_0xa884('0x2c')][_0xa884('0x5a')]({'where':{'id':_0xbd717f[_0xa884('0x44')]['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x43c23f,null))[_0xa884('0x23')](function(_0xcbd3db){if(_0xcbd3db){_0x2e8a1e['model']=_[_0xa884('0x31')](db['CmHopperBlack'][_0xa884('0x45')]);_0x2e8a1e[_0xa884('0x30')]=_[_0xa884('0x31')](_0xbd717f[_0xa884('0x30')]);_0x2e8a1e[_0xa884('0x32')]=_[_0xa884('0x33')](_0x2e8a1e[_0xa884('0x2e')],_0x2e8a1e['query']);_0x447db2[_0xa884('0x34')]=_['intersection'](_0x2e8a1e[_0xa884('0x2e')],qs[_0xa884('0x35')](_0xbd717f[_0xa884('0x30')][_0xa884('0x35')]));_0x447db2['attributes']=_0x447db2[_0xa884('0x34')][_0xa884('0x36')]?_0x447db2[_0xa884('0x34')]:_0x2e8a1e[_0xa884('0x2e')];if(!_0xbd717f['query'][_0xa884('0x37')](_0xa884('0x38'))){_0x447db2[_0xa884('0x1c')]=qs['limit'](_0xbd717f[_0xa884('0x30')]['limit']);_0x447db2[_0xa884('0x1b')]=qs[_0xa884('0x1b')](_0xbd717f[_0xa884('0x30')]['offset']);}_0x447db2[_0xa884('0x39')]=qs['sort'](_0xbd717f[_0xa884('0x30')][_0xa884('0x57')]);_0x447db2[_0xa884('0x3a')]=qs[_0xa884('0x32')](_[_0xa884('0x3b')](_0xbd717f[_0xa884('0x30')],_0x2e8a1e[_0xa884('0x32')]));_0x447db2[_0xa884('0x3a')][_0xa884('0x58')]=_0xcbd3db['id'];if(_0xbd717f[_0xa884('0x30')][_0xa884('0x3c')]){_0x447db2['where']=_[_0xa884('0x3e')](_0x447db2[_0xa884('0x3a')],{'$or':_[_0xa884('0x2f')](_0x447db2[_0xa884('0x34')],function(_0x111461){var _0xb80c65={};_0xb80c65[_0x111461]={'$like':'%'+_0xbd717f[_0xa884('0x30')][_0xa884('0x3c')]+'%'};return _0xb80c65;})});}_0x447db2=_[_0xa884('0x3e')]({},_0x447db2,_0xbd717f[_0xa884('0x3f')]);return db['CmHopperBlack'][_0xa884('0x1a')]({'where':_0x447db2[_0xa884('0x3a')]})['then'](function(_0x4a703f){_0x2c775a[_0xa884('0x1a')]=_0x4a703f;if(_0xbd717f[_0xa884('0x30')][_0xa884('0x40')]){_0x447db2[_0xa884('0x41')]=[{'all':!![]}];}return db[_0xa884('0x5e')]['findAll'](_0x447db2);})['then'](function(_0x4210d9){_0x2c775a[_0xa884('0x43')]=_0x4210d9;return _0x2c775a;});}})[_0xa884('0x23')](respondWithFilteredResult(_0x43c23f,_0x447db2))['catch'](handleError(_0x43c23f,null));};exports[_0xa884('0x5f')]=function(_0x3bf34d,_0x638350,_0x53ffec){var _0x5e0470={};var _0x4d36df={};var _0x85b914;var _0x40665a;return db[_0xa884('0x2c')]['findOne']({'where':{'id':_0x3bf34d[_0xa884('0x44')]['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x638350,null))[_0xa884('0x23')](function(_0x2633b0){if(_0x2633b0){_0x85b914=_0x2633b0;_0x4d36df[_0xa884('0x2e')]=_['keys'](db['CmList']['rawAttributes']);_0x4d36df[_0xa884('0x30')]=_['keys'](_0x3bf34d[_0xa884('0x30')]);_0x4d36df['filters']=_[_0xa884('0x33')](_0x4d36df[_0xa884('0x2e')],_0x4d36df['query']);_0x5e0470[_0xa884('0x34')]=_[_0xa884('0x33')](_0x4d36df['model'],qs[_0xa884('0x35')](_0x3bf34d['query'][_0xa884('0x35')]));_0x5e0470['attributes']=_0x5e0470['attributes'][_0xa884('0x36')]?_0x5e0470[_0xa884('0x34')]:_0x4d36df[_0xa884('0x2e')];_0x5e0470[_0xa884('0x39')]=qs['sort'](_0x3bf34d['query'][_0xa884('0x57')]);_0x5e0470['where']=qs[_0xa884('0x32')](_[_0xa884('0x3b')](_0x3bf34d[_0xa884('0x30')],_0x4d36df[_0xa884('0x32')]));if(_0x3bf34d['query'][_0xa884('0x3c')]){_0x5e0470[_0xa884('0x3a')]=_[_0xa884('0x3e')](_0x5e0470[_0xa884('0x3a')],{'$or':_[_0xa884('0x2f')](_0x5e0470[_0xa884('0x34')],function(_0x144c5d){var _0x33919d={};_0x33919d[_0x144c5d]={'$like':'%'+_0x3bf34d[_0xa884('0x30')][_0xa884('0x3c')]+'%'};return _0x33919d;})});}_0x5e0470=_[_0xa884('0x3e')]({},_0x5e0470,_0x3bf34d[_0xa884('0x3f')]);return _0x85b914[_0xa884('0x5f')](_0x5e0470);}})[_0xa884('0x23')](function(_0x1a010f){if(_0x1a010f){_0x40665a=_0x1a010f[_0xa884('0x36')];if(!_0x3bf34d[_0xa884('0x30')]['hasOwnProperty'](_0xa884('0x38'))){_0x5e0470['limit']=qs[_0xa884('0x1c')](_0x3bf34d[_0xa884('0x30')]['limit']);_0x5e0470[_0xa884('0x1b')]=qs[_0xa884('0x1b')](_0x3bf34d['query'][_0xa884('0x1b')]);}return _0x85b914[_0xa884('0x5f')](_0x5e0470);}})[_0xa884('0x23')](function(_0x351fcb){if(_0x351fcb){return _0x351fcb?{'count':_0x40665a,'rows':_0x351fcb}:null;}})[_0xa884('0x23')](respondWithResult(_0x638350,null))[_0xa884('0x47')](handleError(_0x638350,null));};exports['addLists']=function(_0x485245,_0x1342e0,_0x395ad7){var _0x334e74,_0x38ede5;return db[_0xa884('0x2c')][_0xa884('0x46')]({'where':{'id':_0x485245['params']['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x1342e0,null))[_0xa884('0x23')](function(_0x1f9182){if(_0x1f9182){_0x38ede5=_0x1f9182;return _0x1f9182[_0xa884('0x60')](_0x485245['body']['ids'],_[_0xa884('0x4c')](_0x485245[_0xa884('0x49')],[_0xa884('0x61'),'id'])||{});}return null;})[_0xa884('0x62')](function(_0x210ceb){var _0x555ada;_0x334e74=_0x210ceb||[];var _0x1f4c92=[];if(_0x210ceb){for(var _0xb59394=0x0;_0xb59394<_0x210ceb['length'];_0xb59394+=0x1){var _0x1ffe81=_0x210ceb[_0xb59394][_0xa884('0x24')]({'plain':!![]});_0x38ede5[_0xa884('0x63')]=_0x485245['body'][_0xa884('0x63')]?_0x485245['body'][_0xa884('0x63')]:_0x38ede5[_0xa884('0x63')];switch(_0x38ede5['dialCheckDuplicateType']){case'always':_0x555ada=squel['insert']()[_0xa884('0x64')](_0xa884('0x65'))[_0xa884('0x66')]([_0xa884('0x67'),_0xa884('0x68'),_0xa884('0x69'),_0xa884('0x6a'),_0xa884('0x58'),_0xa884('0x4d'),_0xa884('0x4e')],squel['select']()['field']('phone',_0xa884('0x67'))[_0xa884('0x6b')](_0xa884('0x6c'),_0xa884('0x68'))[_0xa884('0x6b')]('id',_0xa884('0x69'))[_0xa884('0x6b')](_0x1ffe81['CmListId'][_0xa884('0x6d')](),'ListId')[_0xa884('0x6b')](_0x485245[_0xa884('0x44')]['id']['toString'](),_0xa884('0x58'))[_0xa884('0x6b')](_0xa884('0x6c'),_0xa884('0x4d'))[_0xa884('0x6b')](_0xa884('0x6c'),_0xa884('0x4e'))['from'](_0xa884('0x6e'))[_0xa884('0x3a')]('deletedAt\x20IS\x20NULL')[_0xa884('0x3a')](_0xa884('0x6f'),_0x1ffe81[_0xa884('0x70')][_0xa884('0x6d')]())[_0xa884('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xa884('0x3a')](_0xa884('0x71'),squel[_0xa884('0x72')]()[_0xa884('0x6b')](_0xa884('0x73'))[_0xa884('0x74')]('cm_hopper_final')[_0xa884('0x3a')]('CampaignId\x20=\x20?',_0x485245[_0xa884('0x44')]['id']['toString']()))[_0xa884('0x3a')](_0xa884('0x71'),squel[_0xa884('0x72')]()[_0xa884('0x6b')](_0xa884('0x75'))[_0xa884('0x74')](_0xa884('0x65'))[_0xa884('0x3a')](_0xa884('0x76'),_0x485245[_0xa884('0x44')]['id']['toString']())))['toString']();break;case _0xa884('0x77'):_0x555ada=squel[_0xa884('0x78')]()[_0xa884('0x64')]('cm_hopper')[_0xa884('0x66')]([_0xa884('0x67'),_0xa884('0x68'),_0xa884('0x69'),'ListId',_0xa884('0x58'),_0xa884('0x4d'),_0xa884('0x4e')],squel[_0xa884('0x72')]()['field'](_0xa884('0x67'),_0xa884('0x67'))['field'](_0xa884('0x6c'),_0xa884('0x68'))['field']('id',_0xa884('0x69'))['field'](_0x1ffe81[_0xa884('0x70')]['toString'](),'ListId')[_0xa884('0x6b')](_0x485245[_0xa884('0x44')]['id'][_0xa884('0x6d')](),'CampaignId')[_0xa884('0x6b')](_0xa884('0x6c'),'createdAt')['field']('NOW()','updatedAt')[_0xa884('0x74')](_0xa884('0x6e'))[_0xa884('0x3a')](_0xa884('0x79'))[_0xa884('0x3a')](_0xa884('0x6f'),_0x1ffe81['CmListId'][_0xa884('0x6d')]())[_0xa884('0x3a')](_0xa884('0x7a'))[_0xa884('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa884('0x72')]()['field'](_0xa884('0x75'))['from'](_0xa884('0x65'))['where'](_0xa884('0x76'),_0x485245[_0xa884('0x44')]['id']['toString']())))['toString']();break;default:_0x555ada=squel[_0xa884('0x78')]()['into'](_0xa884('0x65'))[_0xa884('0x66')]([_0xa884('0x67'),_0xa884('0x68'),_0xa884('0x69'),'ListId',_0xa884('0x58'),'createdAt',_0xa884('0x4e')],squel['select']()[_0xa884('0x6b')](_0xa884('0x67'),'phone')['field'](_0xa884('0x6c'),_0xa884('0x68'))['field']('id','ContactId')[_0xa884('0x6b')](_0x1ffe81[_0xa884('0x70')][_0xa884('0x6d')](),'ListId')[_0xa884('0x6b')](_0x485245[_0xa884('0x44')]['id'][_0xa884('0x6d')](),'CampaignId')[_0xa884('0x6b')](_0xa884('0x6c'),_0xa884('0x4d'))['field'](_0xa884('0x6c'),_0xa884('0x4e'))[_0xa884('0x74')](_0xa884('0x6e'))[_0xa884('0x3a')]('deletedAt\x20IS\x20NULL')[_0xa884('0x3a')](_0xa884('0x6f'),_0x1ffe81[_0xa884('0x70')][_0xa884('0x6d')]())[_0xa884('0x3a')](_0xa884('0x7a')))[_0xa884('0x6d')]();}_0x1f4c92[_0xa884('0x7b')](db[_0xa884('0x7c')]['query'](_0x555ada));}return BPromise[_0xa884('0x7d')](_0x1f4c92);}})[_0xa884('0x23')](function(){return _0x334e74;})[_0xa884('0x23')](respondWithResult(_0x1342e0,null))[_0xa884('0x47')](handleError(_0x1342e0,null));};exports[_0xa884('0x7e')]=function(_0x394a9f,_0x326270,_0x1a42dc){return db['Campaign'][_0xa884('0x46')]({'where':{'id':_0x394a9f[_0xa884('0x44')]['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x326270,null))[_0xa884('0x23')](function(_0x1ac561){if(_0x1ac561){return _0x1ac561[_0xa884('0x7e')](_0x394a9f[_0xa884('0x30')][_0xa884('0x61')]);}})[_0xa884('0x23')](function(_0x10a0d0){if(_0x10a0d0){return db[_0xa884('0x56')][_0xa884('0x22')]({'where':{'ListId':_0x394a9f[_0xa884('0x30')][_0xa884('0x61')],'CampaignId':_0x394a9f[_0xa884('0x44')]['id']}})[_0xa884('0x23')](function(){return _0x10a0d0;});}})[_0xa884('0x23')](respondWithStatusCode(_0x326270,null))[_0xa884('0x47')](handleError(_0x326270,null));};exports[_0xa884('0x7f')]=function(_0x4cd0b6,_0x351319,_0x28abc5){var _0x59efd2={'raw':!![],'where':{}};var _0x2b74ed={};var _0x4d6538={'count':0x0,'rows':[]};return db[_0xa884('0x2c')][_0xa884('0x5a')]({'where':{'id':_0x4cd0b6[_0xa884('0x44')]['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x351319,null))[_0xa884('0x23')](function(_0x45e156){if(_0x45e156){_0x2b74ed[_0xa884('0x2e')]=_[_0xa884('0x31')](db[_0xa884('0x80')]['rawAttributes']);_0x2b74ed[_0xa884('0x30')]=_[_0xa884('0x31')](_0x4cd0b6[_0xa884('0x30')]);_0x2b74ed[_0xa884('0x32')]=_[_0xa884('0x33')](_0x2b74ed[_0xa884('0x2e')],_0x2b74ed[_0xa884('0x30')]);_0x59efd2[_0xa884('0x34')]=_[_0xa884('0x33')](_0x2b74ed[_0xa884('0x2e')],qs[_0xa884('0x35')](_0x4cd0b6[_0xa884('0x30')][_0xa884('0x35')]));_0x59efd2[_0xa884('0x34')]=_0x59efd2[_0xa884('0x34')][_0xa884('0x36')]?_0x59efd2[_0xa884('0x34')]:_0x2b74ed['model'];if(!_0x4cd0b6['query'][_0xa884('0x37')]('nolimit')){_0x59efd2['limit']=qs[_0xa884('0x1c')](_0x4cd0b6['query'][_0xa884('0x1c')]);_0x59efd2[_0xa884('0x1b')]=qs['offset'](_0x4cd0b6[_0xa884('0x30')][_0xa884('0x1b')]);}_0x59efd2[_0xa884('0x39')]=qs[_0xa884('0x57')](_0x4cd0b6[_0xa884('0x30')][_0xa884('0x57')]);_0x59efd2[_0xa884('0x3a')]=qs[_0xa884('0x32')](_[_0xa884('0x3b')](_0x4cd0b6['query'],_0x2b74ed[_0xa884('0x32')]));_0x59efd2[_0xa884('0x3a')][_0xa884('0x58')]=_0x45e156['id'];if(_0x4cd0b6['query']['filter']){_0x59efd2[_0xa884('0x3a')]=_[_0xa884('0x3e')](_0x59efd2[_0xa884('0x3a')],{'$or':_[_0xa884('0x2f')](_0x59efd2[_0xa884('0x34')],function(_0x2ea08c){var _0x32ffe3={};_0x32ffe3[_0x2ea08c]={'$like':'%'+_0x4cd0b6['query'][_0xa884('0x3c')]+'%'};return _0x32ffe3;})});}_0x59efd2=_[_0xa884('0x3e')]({},_0x59efd2,_0x4cd0b6[_0xa884('0x3f')]);return db[_0xa884('0x80')][_0xa884('0x1a')]({'where':_0x59efd2[_0xa884('0x3a')]})[_0xa884('0x23')](function(_0x58dc45){_0x4d6538[_0xa884('0x1a')]=_0x58dc45;if(_0x4cd0b6[_0xa884('0x30')]['includeAll']){_0x59efd2['include']=[{'all':!![]}];}return db['CmList'][_0xa884('0x42')](_0x59efd2);})[_0xa884('0x23')](function(_0xb9708){_0x4d6538[_0xa884('0x43')]=_0xb9708;return _0x4d6538;});}})[_0xa884('0x23')](respondWithFilteredResult(_0x351319,_0x59efd2))[_0xa884('0x47')](handleError(_0x351319,null));};exports[_0xa884('0x81')]=function(_0x29e9d2,_0x1e6ebc,_0x30e14e){var _0x739fff,_0x3684a0;return db['Campaign'][_0xa884('0x46')]({'where':{'id':_0x29e9d2['params']['id']}})['then'](handleEntityNotFound(_0x1e6ebc,null))['then'](function(_0x4a5d0c){if(_0x4a5d0c){_0x3684a0=_0x4a5d0c;return _0x4a5d0c[_0xa884('0x81')](_0x29e9d2[_0xa884('0x49')][_0xa884('0x61')],_[_0xa884('0x4c')](_0x29e9d2[_0xa884('0x49')],[_0xa884('0x61'),'id'])||{});}return null;})[_0xa884('0x62')](function(_0x56fcc6){var _0x476509;_0x739fff=_0x56fcc6||[];var _0x5e295b=[];if(_0x56fcc6){for(var _0x2ac760=0x0;_0x2ac760<_0x56fcc6['length'];_0x2ac760+=0x1){var _0x3ce942=_0x56fcc6[_0x2ac760]['get']({'plain':!![]});_0x476509=squel[_0xa884('0x78')]()[_0xa884('0x64')](_0xa884('0x82'))[_0xa884('0x66')]([_0xa884('0x67'),_0xa884('0x69'),_0xa884('0x6a'),_0xa884('0x58'),_0xa884('0x4d'),_0xa884('0x4e')],squel[_0xa884('0x72')]()[_0xa884('0x6b')](_0xa884('0x67'),_0xa884('0x67'))[_0xa884('0x6b')]('id',_0xa884('0x69'))[_0xa884('0x6b')](_0x3ce942[_0xa884('0x70')][_0xa884('0x6d')](),_0xa884('0x6a'))['field'](_0x29e9d2[_0xa884('0x44')]['id'][_0xa884('0x6d')](),'CampaignId')[_0xa884('0x6b')](_0xa884('0x6c'),'createdAt')[_0xa884('0x6b')](_0xa884('0x6c'),'updatedAt')[_0xa884('0x74')]('cm_contacts')['where'](_0xa884('0x79'))[_0xa884('0x3a')]('ListId\x20=\x20?',_0x3ce942[_0xa884('0x70')][_0xa884('0x6d')]())[_0xa884('0x3a')](_0xa884('0x7a')))[_0xa884('0x6d')]();_0x5e295b[_0xa884('0x7b')](db['sequelize'][_0xa884('0x30')](_0x476509));}return BPromise[_0xa884('0x7d')](_0x5e295b);}})[_0xa884('0x23')](function(){return _0x739fff;})['then'](respondWithResult(_0x1e6ebc,null))['catch'](handleError(_0x1e6ebc,null));};exports['removeBlackLists']=function(_0x38ced9,_0x22a3c8,_0x2008ab){return db['Campaign'][_0xa884('0x46')]({'where':{'id':_0x38ced9[_0xa884('0x44')]['id']}})[_0xa884('0x23')](handleEntityNotFound(_0x22a3c8,null))[_0xa884('0x23')](function(_0x35db81){if(_0x35db81){return _0x35db81[_0xa884('0x83')](_0x38ced9[_0xa884('0x30')]['ids']);}})[_0xa884('0x23')](function(_0x501591){if(_0x501591){return db[_0xa884('0x5e')]['destroy']({'where':{'ListId':_0x38ced9[_0xa884('0x30')]['ids'],'CampaignId':_0x38ced9['params']['id']}})[_0xa884('0x23')](function(){return _0x501591;});}})[_0xa884('0x23')](respondWithStatusCode(_0x22a3c8,null))[_0xa884('0x47')](handleError(_0x22a3c8,null));};
\ No newline at end of file
index 6b6e19f..4decc6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x517b=['request-promise','rimraf','./campaign.attributes','exports','define','Campaign','campaigns','util','../../config/logger','moment','bluebird'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x517b,0xc2));var _0xb517=function(_0x5aba2a,_0x1f4c7d){_0x5aba2a=_0x5aba2a-0x0;var _0x2a2322=_0x517b[_0x5aba2a];return _0x2a2322;};'use strict';var _=require('lodash');var util=require(_0xb517('0x0'));var logger=require(_0xb517('0x1'))('api');var moment=require(_0xb517('0x2'));var BPromise=require(_0xb517('0x3'));var rp=require(_0xb517('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb517('0x5'));var config=require('../../config/environment');var attributes=require(_0xb517('0x6'));module[_0xb517('0x7')]=function(_0x58c7cd,_0x2b5997){return _0x58c7cd[_0xb517('0x8')](_0xb517('0x9'),attributes,{'tableName':_0xb517('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdaf1=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./campaign.attributes','Campaign','campaigns'];(function(_0x5b34c8,_0x424a2b){var _0x569f3b=function(_0x5dd227){while(--_0x5dd227){_0x5b34c8['push'](_0x5b34c8['shift']());}};_0x569f3b(++_0x424a2b);}(_0xdaf1,0x1bc));var _0x1daf=function(_0x1081cf,_0x31b91f){_0x1081cf=_0x1081cf-0x0;var _0x17ef66=_0xdaf1[_0x1081cf];return _0x17ef66;};'use strict';var _=require('lodash');var util=require(_0x1daf('0x0'));var logger=require(_0x1daf('0x1'))(_0x1daf('0x2'));var moment=require(_0x1daf('0x3'));var BPromise=require(_0x1daf('0x4'));var rp=require(_0x1daf('0x5'));var fs=require('fs');var path=require(_0x1daf('0x6'));var rimraf=require(_0x1daf('0x7'));var config=require(_0x1daf('0x8'));var attributes=require(_0x1daf('0x9'));module['exports']=function(_0x3d49c2,_0x15139d){return _0x3d49c2['define'](_0x1daf('0xa'),attributes,{'tableName':_0x1daf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 303ba9d..8d67a09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x183a6b,_0x4c63c0){var _0x343012=function(_0x512e6c){while(--_0x512e6c){_0x183a6b['push'](_0x183a6b['shift']());}};_0x343012(++_0x4c63c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x40236e,_0x2b5c76){var _0x3d61d1=function(_0x369469){while(--_0x369469){_0x40236e['push'](_0x40236e['shift']());}};_0x3d61d1(++_0x2b5c76);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});};
\ No newline at end of file
index 53a6597..e6f7c0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x412f=['connect-timeout','express','Router','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','update','delete','removeLists','removeBlackLists','exports','path'];(function(_0x4a6cf8,_0x5534ef){var _0x22205e=function(_0x3f4d0d){while(--_0x3f4d0d){_0x4a6cf8['push'](_0x4a6cf8['shift']());}};_0x22205e(++_0x5534ef);}(_0x412f,0x7b));var _0xf412=function(_0x26c530,_0x3a9512){_0x26c530=_0x26c530-0x0;var _0x58bfff=_0x412f[_0x26c530];return _0x58bfff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf412('0x0'));var timeout=require(_0xf412('0x1'));var express=require(_0xf412('0x2'));var router=express[_0xf412('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf412('0x4'));var controller=require(_0xf412('0x5'));router[_0xf412('0x6')]('/',auth[_0xf412('0x7')](),controller['index']);router[_0xf412('0x6')](_0xf412('0x8'),auth[_0xf412('0x7')](),controller[_0xf412('0x9')]);router[_0xf412('0x6')]('/:id/hoppers',auth[_0xf412('0x7')](),controller[_0xf412('0xa')]);router[_0xf412('0x6')](_0xf412('0xb'),auth[_0xf412('0x7')](),controller[_0xf412('0xc')]);router[_0xf412('0x6')](_0xf412('0xd'),auth[_0xf412('0x7')](),controller['getHopperFinals']);router[_0xf412('0x6')](_0xf412('0xe'),auth[_0xf412('0x7')](),controller[_0xf412('0xf')]);router['get'](_0xf412('0x10'),auth['isAuthenticated'](),controller[_0xf412('0x11')]);router[_0xf412('0x6')](_0xf412('0x12'),auth['isAuthenticated'](),controller[_0xf412('0x13')]);router['post']('/',auth[_0xf412('0x7')](),controller[_0xf412('0x14')]);router[_0xf412('0x15')](_0xf412('0x16'),auth[_0xf412('0x7')](),controller[_0xf412('0x17')]);router[_0xf412('0x15')]('/:id/lists',auth[_0xf412('0x7')](),controller[_0xf412('0x18')]);router['post'](_0xf412('0x12'),auth['isAuthenticated'](),controller[_0xf412('0x19')]);router['put'](_0xf412('0x8'),auth[_0xf412('0x7')](),controller[_0xf412('0x1a')]);router['delete'](_0xf412('0x8'),auth[_0xf412('0x7')](),controller['destroy']);router[_0xf412('0x1b')](_0xf412('0x10'),auth[_0xf412('0x7')](),controller[_0xf412('0x1c')]);router[_0xf412('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xf412('0x1d')]);module[_0xf412('0x1e')]=router;
\ No newline at end of file
+var _0x3789=['addLists','addBlackLists','put','/:id','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','/:id/clone','/:id/lists'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x3789,0xe2));var _0x9378=function(_0x409bd8,_0x3ca346){_0x409bd8=_0x409bd8-0x0;var _0xb82592=_0x3789[_0x409bd8];return _0xb82592;};'use strict';var multer=require(_0x9378('0x0'));var util=require(_0x9378('0x1'));var path=require(_0x9378('0x2'));var timeout=require(_0x9378('0x3'));var express=require(_0x9378('0x4'));var router=express[_0x9378('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9378('0x6'));var config=require(_0x9378('0x7'));var controller=require(_0x9378('0x8'));router[_0x9378('0x9')]('/',auth[_0x9378('0xa')](),controller[_0x9378('0xb')]);router[_0x9378('0x9')]('/:id',auth[_0x9378('0xa')](),controller[_0x9378('0xc')]);router[_0x9378('0x9')](_0x9378('0xd'),auth['isAuthenticated'](),controller[_0x9378('0xe')]);router[_0x9378('0x9')](_0x9378('0xf'),auth['isAuthenticated'](),controller[_0x9378('0x10')]);router[_0x9378('0x9')](_0x9378('0x11'),auth[_0x9378('0xa')](),controller['getHopperFinals']);router[_0x9378('0x9')](_0x9378('0x12'),auth[_0x9378('0xa')](),controller[_0x9378('0x13')]);router[_0x9378('0x9')]('/:id/lists',auth[_0x9378('0xa')](),controller[_0x9378('0x14')]);router['get']('/:id/blacklists',auth[_0x9378('0xa')](),controller[_0x9378('0x15')]);router[_0x9378('0x16')]('/',auth[_0x9378('0xa')](),controller[_0x9378('0x17')]);router[_0x9378('0x16')](_0x9378('0x18'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x9378('0x19'),auth['isAuthenticated'](),controller[_0x9378('0x1a')]);router[_0x9378('0x16')]('/:id/blacklists',auth[_0x9378('0xa')](),controller[_0x9378('0x1b')]);router[_0x9378('0x1c')](_0x9378('0x1d'),auth['isAuthenticated'](),controller[_0x9378('0x1e')]);router['delete'](_0x9378('0x1d'),auth['isAuthenticated'](),controller[_0x9378('0x1f')]);router[_0x9378('0x20')](_0x9378('0x19'),auth[_0x9378('0xa')](),controller[_0x9378('0x21')]);router[_0x9378('0x20')]('/:id/blacklists',auth[_0x9378('0xa')](),controller[_0x9378('0x22')]);module[_0x9378('0x23')]=router;
\ No newline at end of file
index d7d8031..1b3e8a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2840=['STRING','getDataValue','key','sequelize','exports'];(function(_0x276dd6,_0x567f00){var _0x4d534b=function(_0x3204d2){while(--_0x3204d2){_0x276dd6['push'](_0x276dd6['shift']());}};_0x4d534b(++_0x567f00);}(_0x2840,0x85));var _0x0284=function(_0x329808,_0x343255){_0x329808=_0x329808-0x0;var _0x1bbad0=_0x2840[_0x329808];return _0x1bbad0;};'use strict';var Sequelize=require(_0x0284('0x0'));module[_0x0284('0x1')]={'key':{'type':Sequelize[_0x0284('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0284('0x3')](_0x0284('0x4'));}}};
\ No newline at end of file
+var _0xc8de=['STRING','VIRTUAL','key','sequelize','exports','TEXT'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0xc8de,0x135));var _0xec8d=function(_0x4973ca,_0x556d8a){_0x4973ca=_0x4973ca-0x0;var _0x24a142=_0xc8de[_0x4973ca];return _0x24a142;};'use strict';var Sequelize=require(_0xec8d('0x0'));module[_0xec8d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xec8d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xec8d('0x3')]},'name':{'type':Sequelize[_0xec8d('0x4')],'get':function(){return this['getDataValue'](_0xec8d('0x5'));}}};
\ No newline at end of file
index e270cbc..ce76c40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3c=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','CannedAnswers','UserProfileResource','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox'];(function(_0x1cd592,_0x593d39){var _0x357cc1=function(_0x501fc1){while(--_0x501fc1){_0x1cd592['push'](_0x1cd592['shift']());}};_0x357cc1(++_0x593d39);}(_0xeb3c,0x15c));var _0xceb3=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xeb3c[_0x18a79d];return _0x4f8848;};'use strict';var pdf=require(_0xceb3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xceb3('0x1'));var zipdir=require(_0xceb3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xceb3('0x3'));var moment=require('moment');var BPromise=require(_0xceb3('0x4'));var Mustache=require(_0xceb3('0x5'));var util=require('util');var path=require(_0xceb3('0x6'));var sox=require(_0xceb3('0x7'));var csv=require(_0xceb3('0x8'));var ejs=require(_0xceb3('0x9'));var fs=require('fs');var _=require(_0xceb3('0xa'));var squel=require(_0xceb3('0xb'));var crypto=require(_0xceb3('0xc'));var jsforce=require(_0xceb3('0xd'));var deskjs=require(_0xceb3('0xe'));var toCsv=require(_0xceb3('0x8'));var querystring=require(_0xceb3('0xf'));var Papa=require(_0xceb3('0x10'));var Redis=require(_0xceb3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xceb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xceb3('0x13'));var logger=require(_0xceb3('0x14'))(_0xceb3('0x15'));var utils=require('../../config/utils');var config=require(_0xceb3('0x16'));var db=require(_0xceb3('0x17'))['db'];function respondWithStatusCode(_0x2d3deb,_0x27a082){_0x27a082=_0x27a082||0xcc;return function(_0x281aed){if(_0x281aed){return _0x2d3deb[_0xceb3('0x18')](_0x27a082);}return _0x2d3deb['status'](_0x27a082)[_0xceb3('0x19')]();};}function respondWithResult(_0x283643,_0x436736){_0x436736=_0x436736||0xc8;return function(_0x552361){if(_0x552361){return _0x283643[_0xceb3('0x1a')](_0x436736)[_0xceb3('0x1b')](_0x552361);}};}function respondWithFilteredResult(_0x451c8a,_0x217757){return function(_0x2937cf){if(_0x2937cf){var _0x51e62a=_0x2937cf[_0xceb3('0x1c')],_0x502488=_0x217757['offset'],_0x2cbd2b=_0x217757[_0xceb3('0x1d')]+_0x217757[_0xceb3('0x1e')],_0x4d5f08;if(_0x2cbd2b>=_0x51e62a){_0x2cbd2b=_0x51e62a;_0x4d5f08=0xc8;}else{_0x4d5f08=0xce;}_0x451c8a[_0xceb3('0x1a')](_0x4d5f08);return _0x451c8a[_0xceb3('0x1f')](_0xceb3('0x20'),_0x502488+'-'+_0x2cbd2b+'/'+_0x51e62a)['json'](_0x2937cf);}return null;};}function patchUpdates(_0x237282){return function(_0xb3f740){try{jsonpatch[_0xceb3('0x21')](_0xb3f740,_0x237282,!![]);}catch(_0x49961c){return BPromise[_0xceb3('0x22')](_0x49961c);}return _0xb3f740[_0xceb3('0x23')]();};}function saveUpdates(_0xfa57c3,_0x3277e9){return function(_0x344589){if(_0x344589){return _0x344589['update'](_0xfa57c3)['then'](function(_0x5465ec){return _0x5465ec;});}return null;};}function removeEntity(_0x39ace9,_0x30f948){return function(_0x43716c){if(_0x43716c){return _0x43716c[_0xceb3('0x24')]()[_0xceb3('0x25')](function(){var _0x38ad0b=_0x43716c[_0xceb3('0x26')]({'plain':!![]});var _0x1c559c=_0xceb3('0x27');return db[_0xceb3('0x28')]['destroy']({'where':{'type':_0x1c559c,'resourceId':_0x38ad0b['id']}})['then'](function(){return _0x43716c;});})['then'](function(){_0x39ace9['status'](0xcc)[_0xceb3('0x19')]();});}};}function handleEntityNotFound(_0x2c333a,_0x11438e){return function(_0x541c6a){if(!_0x541c6a){_0x2c333a[_0xceb3('0x18')](0x194);}return _0x541c6a;};}function handleError(_0x3ed5c6,_0x165f27){_0x165f27=_0x165f27||0x1f4;return function(_0x45df99){logger['error'](_0x45df99[_0xceb3('0x29')]);if(_0x45df99[_0xceb3('0x2a')]){delete _0x45df99['name'];}_0x3ed5c6[_0xceb3('0x1a')](_0x165f27)[_0xceb3('0x2b')](_0x45df99);};}exports['index']=function(_0x17f7a6,_0x2ba90a){var _0x433902={},_0x42bc30={},_0x153d0f={'count':0x0,'rows':[]};var _0x17d7f1=_[_0xceb3('0x2c')](db[_0xceb3('0x2d')][_0xceb3('0x2e')],function(_0x4787c2){return{'name':_0x4787c2[_0xceb3('0x2f')],'type':_0x4787c2[_0xceb3('0x30')]['key']};});_0x42bc30[_0xceb3('0x31')]=_[_0xceb3('0x2c')](_0x17d7f1,_0xceb3('0x2a'));_0x42bc30[_0xceb3('0x32')]=_[_0xceb3('0x33')](_0x17f7a6[_0xceb3('0x32')]);_0x42bc30[_0xceb3('0x34')]=_[_0xceb3('0x35')](_0x42bc30[_0xceb3('0x31')],_0x42bc30['query']);_0x433902[_0xceb3('0x36')]=_['intersection'](_0x42bc30[_0xceb3('0x31')],qs[_0xceb3('0x37')](_0x17f7a6[_0xceb3('0x32')]['fields']));_0x433902[_0xceb3('0x36')]=_0x433902['attributes'][_0xceb3('0x38')]?_0x433902[_0xceb3('0x36')]:_0x42bc30[_0xceb3('0x31')];if(!_0x17f7a6[_0xceb3('0x32')]['hasOwnProperty'](_0xceb3('0x39'))){_0x433902[_0xceb3('0x1e')]=qs[_0xceb3('0x1e')](_0x17f7a6[_0xceb3('0x32')][_0xceb3('0x1e')]);_0x433902[_0xceb3('0x1d')]=qs['offset'](_0x17f7a6[_0xceb3('0x32')][_0xceb3('0x1d')]);}_0x433902[_0xceb3('0x3a')]=qs['sort'](_0x17f7a6['query'][_0xceb3('0x3b')]);_0x433902[_0xceb3('0x3c')]=qs[_0xceb3('0x34')](_['pick'](_0x17f7a6['query'],_0x42bc30[_0xceb3('0x34')]),_0x17d7f1);if(_0x17f7a6[_0xceb3('0x32')][_0xceb3('0x3d')]){_0x433902[_0xceb3('0x3c')]=_[_0xceb3('0x3e')](_0x433902['where'],{'$or':_[_0xceb3('0x2c')](_0x17d7f1,function(_0x40f5ee){if(_0x40f5ee[_0xceb3('0x30')]!=='VIRTUAL'){var _0x3f341f={};_0x3f341f[_0x40f5ee[_0xceb3('0x2a')]]={'$like':'%'+_0x17f7a6['query']['filter']+'%'};return _0x3f341f;}})});}_0x433902=_[_0xceb3('0x3e')]({},_0x433902,_0x17f7a6[_0xceb3('0x3f')]);var _0x512a26={'where':_0x433902[_0xceb3('0x3c')]};return db[_0xceb3('0x2d')][_0xceb3('0x1c')](_0x512a26)[_0xceb3('0x25')](function(_0x50af74){_0x153d0f[_0xceb3('0x1c')]=_0x50af74;if(_0x17f7a6[_0xceb3('0x32')][_0xceb3('0x40')]){_0x433902[_0xceb3('0x41')]=[{'all':!![]}];}return db[_0xceb3('0x2d')][_0xceb3('0x42')](_0x433902);})['then'](function(_0x5a71d7){_0x153d0f[_0xceb3('0x43')]=_0x5a71d7;return _0x153d0f;})[_0xceb3('0x25')](respondWithFilteredResult(_0x2ba90a,_0x433902))[_0xceb3('0x44')](handleError(_0x2ba90a,null));};exports[_0xceb3('0x45')]=function(_0x57489f,_0xd8c4a2){var _0x635c29={'raw':!![],'where':{'id':_0x57489f[_0xceb3('0x46')]['id']}},_0x4ee413={};_0x4ee413['model']=_[_0xceb3('0x33')](db[_0xceb3('0x2d')][_0xceb3('0x2e')]);_0x4ee413[_0xceb3('0x32')]=_[_0xceb3('0x33')](_0x57489f[_0xceb3('0x32')]);_0x4ee413[_0xceb3('0x34')]=_[_0xceb3('0x35')](_0x4ee413[_0xceb3('0x31')],_0x4ee413['query']);_0x635c29[_0xceb3('0x36')]=_[_0xceb3('0x35')](_0x4ee413[_0xceb3('0x31')],qs[_0xceb3('0x37')](_0x57489f[_0xceb3('0x32')][_0xceb3('0x37')]));_0x635c29['attributes']=_0x635c29[_0xceb3('0x36')][_0xceb3('0x38')]?_0x635c29['attributes']:_0x4ee413[_0xceb3('0x31')];if(_0x57489f[_0xceb3('0x32')][_0xceb3('0x40')]){_0x635c29['include']=[{'all':!![]}];}_0x635c29=_[_0xceb3('0x3e')]({},_0x635c29,_0x57489f[_0xceb3('0x3f')]);return db[_0xceb3('0x2d')][_0xceb3('0x47')](_0x635c29)['then'](handleEntityNotFound(_0xd8c4a2,null))[_0xceb3('0x25')](respondWithResult(_0xd8c4a2,null))['catch'](handleError(_0xd8c4a2,null));};exports[_0xceb3('0x48')]=function(_0x3a1619,_0x38ef83){if(_0x3a1619[_0xceb3('0x49')]['id']){delete _0x3a1619[_0xceb3('0x49')]['id'];}return db[_0xceb3('0x2d')][_0xceb3('0x47')]({'where':{'id':_0x3a1619[_0xceb3('0x46')]['id']}})[_0xceb3('0x25')](handleEntityNotFound(_0x38ef83,null))[_0xceb3('0x25')](saveUpdates(_0x3a1619[_0xceb3('0x49')],null))[_0xceb3('0x25')](respondWithResult(_0x38ef83,null))[_0xceb3('0x44')](handleError(_0x38ef83,null));};exports[_0xceb3('0x24')]=function(_0x2f816e,_0x5151a2){return db['CannedAnswer'][_0xceb3('0x47')]({'where':{'id':_0x2f816e[_0xceb3('0x46')]['id']}})[_0xceb3('0x25')](handleEntityNotFound(_0x5151a2,null))[_0xceb3('0x25')](removeEntity(_0x5151a2,null))[_0xceb3('0x44')](handleError(_0x5151a2,null));};exports[_0xceb3('0x4a')]=function(_0x34486b,_0x5e7cbf){var _0x1cda9a={'key':_0x34486b[_0xceb3('0x49')][_0xceb3('0x4b')]};if(_0x34486b[_0xceb3('0x49')][_0xceb3('0x4c')]){_0x1cda9a[_0xceb3('0x4c')]=_0x34486b[_0xceb3('0x49')][_0xceb3('0x4c')];}else if(_0x34486b[_0xceb3('0x49')][_0xceb3('0x4d')]){_0x1cda9a[_0xceb3('0x4d')]=_0x34486b[_0xceb3('0x49')]['SmsAccountId'];}else if(_0x34486b[_0xceb3('0x49')][_0xceb3('0x4e')]){_0x1cda9a['OpenchannelAccountId']=_0x34486b[_0xceb3('0x49')]['OpenchannelAccountId'];}else if(_0x34486b[_0xceb3('0x49')][_0xceb3('0x4f')]){_0x1cda9a[_0xceb3('0x4f')]=_0x34486b['body'][_0xceb3('0x4f')];}return db['CannedAnswer'][_0xceb3('0x47')]({'where':_0x1cda9a})['then'](function(_0x15e7e5){if(_0x15e7e5){throw new db['Sequelize'][(_0xceb3('0x50'))](_0xceb3('0x51'));}return db[_0xceb3('0x2d')][_0xceb3('0x4a')](_0x34486b[_0xceb3('0x49')]);})[_0xceb3('0x25')](function(_0x349660){var _0x31e0e3=_0x34486b[_0xceb3('0x52')][_0xceb3('0x26')]({'plain':!![]});if(!_0x31e0e3)throw new Error(_0xceb3('0x53'));if(_0x31e0e3['role']===_0xceb3('0x52')){var _0x3697a4=_0x349660['get']({'plain':!![]});return db[_0xceb3('0x54')][_0xceb3('0x47')]({'where':{'name':_0xceb3('0x27'),'userProfileId':_0x31e0e3[_0xceb3('0x55')]},'raw':!![]})['then'](function(_0x195d5e){if(_0x195d5e&&_0x195d5e[_0xceb3('0x56')]===0x0){return db[_0xceb3('0x28')]['create']({'name':_0x3697a4[_0xceb3('0x2a')],'resourceId':_0x3697a4['id'],'type':_0x195d5e['name'],'sectionId':_0x195d5e['id']},{})[_0xceb3('0x25')](function(){return _0x349660;});}else{return _0x349660;}})[_0xceb3('0x44')](function(_0x68145c){logger[_0xceb3('0x57')](_0xceb3('0x58'),_0x68145c);throw _0x68145c;});}return _0x349660;})['then'](respondWithResult(_0x5e7cbf,0xc9))[_0xceb3('0x44')](handleError(_0x5e7cbf,null));};
\ No newline at end of file
+var _0x1eff=['options','includeAll','include','findAll','rows','show','params','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL'];(function(_0x5606c0,_0xf27c2){var _0x535e89=function(_0x49c2fc){while(--_0x49c2fc){_0x5606c0['push'](_0x5606c0['shift']());}};_0x535e89(++_0xf27c2);}(_0x1eff,0x1da));var _0xf1ef=function(_0x37563b,_0x5188d7){_0x37563b=_0x37563b-0x0;var _0x2b2778=_0x1eff[_0x37563b];return _0x2b2778;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf1ef('0x0'));var rimraf=require(_0xf1ef('0x1'));var zipdir=require(_0xf1ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf1ef('0x3'));var BPromise=require(_0xf1ef('0x4'));var Mustache=require('mustache');var util=require(_0xf1ef('0x5'));var path=require(_0xf1ef('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1ef('0x7'));var fs=require('fs');var _=require(_0xf1ef('0x8'));var squel=require(_0xf1ef('0x9'));var crypto=require(_0xf1ef('0xa'));var jsforce=require(_0xf1ef('0xb'));var deskjs=require(_0xf1ef('0xc'));var toCsv=require(_0xf1ef('0xd'));var querystring=require(_0xf1ef('0xe'));var Papa=require(_0xf1ef('0xf'));var Redis=require(_0xf1ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf1ef('0x11'));var as=require(_0xf1ef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1ef('0x13'))(_0xf1ef('0x14'));var utils=require(_0xf1ef('0x15'));var config=require(_0xf1ef('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55d9f0,_0x197cd3){_0x197cd3=_0x197cd3||0xcc;return function(_0x4c55d5){if(_0x4c55d5){return _0x55d9f0[_0xf1ef('0x17')](_0x197cd3);}return _0x55d9f0[_0xf1ef('0x18')](_0x197cd3)[_0xf1ef('0x19')]();};}function respondWithResult(_0x1d105d,_0xf95649){_0xf95649=_0xf95649||0xc8;return function(_0x3c1b13){if(_0x3c1b13){return _0x1d105d[_0xf1ef('0x18')](_0xf95649)[_0xf1ef('0x1a')](_0x3c1b13);}};}function respondWithFilteredResult(_0x314eca,_0x5344e9){return function(_0x4bf986){if(_0x4bf986){var _0x264c8b=_0x4bf986[_0xf1ef('0x1b')],_0xa2b2ed=_0x5344e9[_0xf1ef('0x1c')],_0x20b230=_0x5344e9[_0xf1ef('0x1c')]+_0x5344e9[_0xf1ef('0x1d')],_0x1fc6b5;if(_0x20b230>=_0x264c8b){_0x20b230=_0x264c8b;_0x1fc6b5=0xc8;}else{_0x1fc6b5=0xce;}_0x314eca['status'](_0x1fc6b5);return _0x314eca[_0xf1ef('0x1e')](_0xf1ef('0x1f'),_0xa2b2ed+'-'+_0x20b230+'/'+_0x264c8b)[_0xf1ef('0x1a')](_0x4bf986);}return null;};}function patchUpdates(_0x22fa70){return function(_0x26303c){try{jsonpatch[_0xf1ef('0x20')](_0x26303c,_0x22fa70,!![]);}catch(_0x3a448e){return BPromise['reject'](_0x3a448e);}return _0x26303c[_0xf1ef('0x21')]();};}function saveUpdates(_0x17329e,_0x3f3261){return function(_0x2699dc){if(_0x2699dc){return _0x2699dc[_0xf1ef('0x22')](_0x17329e)[_0xf1ef('0x23')](function(_0x261683){return _0x261683;});}return null;};}function removeEntity(_0x426ee7,_0x2730b1){return function(_0x141f18){if(_0x141f18){return _0x141f18[_0xf1ef('0x24')]()[_0xf1ef('0x23')](function(){var _0x574bc0=_0x141f18[_0xf1ef('0x25')]({'plain':!![]});var _0x404d05='CannedAnswers';return db['UserProfileResource'][_0xf1ef('0x24')]({'where':{'type':_0x404d05,'resourceId':_0x574bc0['id']}})[_0xf1ef('0x23')](function(){return _0x141f18;});})[_0xf1ef('0x23')](function(){_0x426ee7[_0xf1ef('0x18')](0xcc)[_0xf1ef('0x19')]();});}};}function handleEntityNotFound(_0x5ec5ef,_0x26c989){return function(_0x10cc92){if(!_0x10cc92){_0x5ec5ef[_0xf1ef('0x17')](0x194);}return _0x10cc92;};}function handleError(_0x2953d9,_0x886a5b){_0x886a5b=_0x886a5b||0x1f4;return function(_0x388e78){logger[_0xf1ef('0x26')](_0x388e78[_0xf1ef('0x27')]);if(_0x388e78[_0xf1ef('0x28')]){delete _0x388e78[_0xf1ef('0x28')];}_0x2953d9[_0xf1ef('0x18')](_0x886a5b)[_0xf1ef('0x29')](_0x388e78);};}exports[_0xf1ef('0x2a')]=function(_0x521a70,_0x4e10d4){var _0x254c87={},_0x15db70={},_0x57592c={'count':0x0,'rows':[]};var _0x2859c2=_[_0xf1ef('0x2b')](db[_0xf1ef('0x2c')][_0xf1ef('0x2d')],function(_0x55b121){return{'name':_0x55b121[_0xf1ef('0x2e')],'type':_0x55b121['type'][_0xf1ef('0x2f')]};});_0x15db70[_0xf1ef('0x30')]=_[_0xf1ef('0x2b')](_0x2859c2,_0xf1ef('0x28'));_0x15db70[_0xf1ef('0x31')]=_[_0xf1ef('0x32')](_0x521a70['query']);_0x15db70[_0xf1ef('0x33')]=_['intersection'](_0x15db70[_0xf1ef('0x30')],_0x15db70[_0xf1ef('0x31')]);_0x254c87[_0xf1ef('0x34')]=_[_0xf1ef('0x35')](_0x15db70['model'],qs[_0xf1ef('0x36')](_0x521a70[_0xf1ef('0x31')][_0xf1ef('0x36')]));_0x254c87['attributes']=_0x254c87[_0xf1ef('0x34')][_0xf1ef('0x37')]?_0x254c87[_0xf1ef('0x34')]:_0x15db70[_0xf1ef('0x30')];if(!_0x521a70[_0xf1ef('0x31')][_0xf1ef('0x38')](_0xf1ef('0x39'))){_0x254c87[_0xf1ef('0x1d')]=qs['limit'](_0x521a70[_0xf1ef('0x31')]['limit']);_0x254c87[_0xf1ef('0x1c')]=qs['offset'](_0x521a70[_0xf1ef('0x31')][_0xf1ef('0x1c')]);}_0x254c87[_0xf1ef('0x3a')]=qs[_0xf1ef('0x3b')](_0x521a70[_0xf1ef('0x31')][_0xf1ef('0x3b')]);_0x254c87['where']=qs[_0xf1ef('0x33')](_[_0xf1ef('0x3c')](_0x521a70[_0xf1ef('0x31')],_0x15db70[_0xf1ef('0x33')]),_0x2859c2);if(_0x521a70[_0xf1ef('0x31')][_0xf1ef('0x3d')]){_0x254c87['where']=_[_0xf1ef('0x3e')](_0x254c87[_0xf1ef('0x3f')],{'$or':_['map'](_0x2859c2,function(_0x480692){if(_0x480692[_0xf1ef('0x40')]!==_0xf1ef('0x41')){var _0x37a627={};_0x37a627[_0x480692[_0xf1ef('0x28')]]={'$like':'%'+_0x521a70['query'][_0xf1ef('0x3d')]+'%'};return _0x37a627;}})});}_0x254c87=_[_0xf1ef('0x3e')]({},_0x254c87,_0x521a70[_0xf1ef('0x42')]);var _0x181b8b={'where':_0x254c87[_0xf1ef('0x3f')]};return db['CannedAnswer'][_0xf1ef('0x1b')](_0x181b8b)[_0xf1ef('0x23')](function(_0x161805){_0x57592c[_0xf1ef('0x1b')]=_0x161805;if(_0x521a70[_0xf1ef('0x31')][_0xf1ef('0x43')]){_0x254c87[_0xf1ef('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf1ef('0x45')](_0x254c87);})[_0xf1ef('0x23')](function(_0x255e0b){_0x57592c[_0xf1ef('0x46')]=_0x255e0b;return _0x57592c;})[_0xf1ef('0x23')](respondWithFilteredResult(_0x4e10d4,_0x254c87))['catch'](handleError(_0x4e10d4,null));};exports[_0xf1ef('0x47')]=function(_0x305109,_0x3aa880){var _0xea1df8={'raw':!![],'where':{'id':_0x305109[_0xf1ef('0x48')]['id']}},_0x1f8b4a={};_0x1f8b4a['model']=_[_0xf1ef('0x32')](db['CannedAnswer']['rawAttributes']);_0x1f8b4a[_0xf1ef('0x31')]=_[_0xf1ef('0x32')](_0x305109['query']);_0x1f8b4a[_0xf1ef('0x33')]=_[_0xf1ef('0x35')](_0x1f8b4a[_0xf1ef('0x30')],_0x1f8b4a[_0xf1ef('0x31')]);_0xea1df8[_0xf1ef('0x34')]=_[_0xf1ef('0x35')](_0x1f8b4a[_0xf1ef('0x30')],qs[_0xf1ef('0x36')](_0x305109[_0xf1ef('0x31')][_0xf1ef('0x36')]));_0xea1df8['attributes']=_0xea1df8[_0xf1ef('0x34')][_0xf1ef('0x37')]?_0xea1df8[_0xf1ef('0x34')]:_0x1f8b4a[_0xf1ef('0x30')];if(_0x305109[_0xf1ef('0x31')][_0xf1ef('0x43')]){_0xea1df8[_0xf1ef('0x44')]=[{'all':!![]}];}_0xea1df8=_['merge']({},_0xea1df8,_0x305109[_0xf1ef('0x42')]);return db[_0xf1ef('0x2c')][_0xf1ef('0x49')](_0xea1df8)[_0xf1ef('0x23')](handleEntityNotFound(_0x3aa880,null))['then'](respondWithResult(_0x3aa880,null))[_0xf1ef('0x4a')](handleError(_0x3aa880,null));};exports[_0xf1ef('0x22')]=function(_0x20ef75,_0x1c466e){if(_0x20ef75[_0xf1ef('0x4b')]['id']){delete _0x20ef75['body']['id'];}return db['CannedAnswer'][_0xf1ef('0x49')]({'where':{'id':_0x20ef75[_0xf1ef('0x48')]['id']}})[_0xf1ef('0x23')](handleEntityNotFound(_0x1c466e,null))[_0xf1ef('0x23')](saveUpdates(_0x20ef75[_0xf1ef('0x4b')],null))['then'](respondWithResult(_0x1c466e,null))[_0xf1ef('0x4a')](handleError(_0x1c466e,null));};exports[_0xf1ef('0x24')]=function(_0x44b414,_0x23034b){return db[_0xf1ef('0x2c')][_0xf1ef('0x49')]({'where':{'id':_0x44b414[_0xf1ef('0x48')]['id']}})[_0xf1ef('0x23')](handleEntityNotFound(_0x23034b,null))[_0xf1ef('0x23')](removeEntity(_0x23034b,null))['catch'](handleError(_0x23034b,null));};exports[_0xf1ef('0x4c')]=function(_0x3c5336,_0x5b8df3){var _0x1ac815={'key':_0x3c5336['body']['key']};if(_0x3c5336['body'][_0xf1ef('0x4d')]){_0x1ac815[_0xf1ef('0x4d')]=_0x3c5336[_0xf1ef('0x4b')][_0xf1ef('0x4d')];}else if(_0x3c5336['body']['SmsAccountId']){_0x1ac815['SmsAccountId']=_0x3c5336['body'][_0xf1ef('0x4e')];}else if(_0x3c5336[_0xf1ef('0x4b')]['OpenchannelAccountId']){_0x1ac815[_0xf1ef('0x4f')]=_0x3c5336[_0xf1ef('0x4b')]['OpenchannelAccountId'];}else if(_0x3c5336['body'][_0xf1ef('0x50')]){_0x1ac815[_0xf1ef('0x50')]=_0x3c5336[_0xf1ef('0x4b')][_0xf1ef('0x50')];}return db[_0xf1ef('0x2c')][_0xf1ef('0x49')]({'where':_0x1ac815})[_0xf1ef('0x23')](function(_0x3b6e6f){if(_0x3b6e6f){throw new db['Sequelize']['ValidationError'](_0xf1ef('0x51'));}return db[_0xf1ef('0x2c')][_0xf1ef('0x4c')](_0x3c5336['body']);})['then'](function(_0x4d16ab){var _0x134b72=_0x3c5336[_0xf1ef('0x52')]['get']({'plain':!![]});if(!_0x134b72)throw new Error(_0xf1ef('0x53'));if(_0x134b72[_0xf1ef('0x54')]===_0xf1ef('0x52')){var _0x5584bb=_0x4d16ab['get']({'plain':!![]});return db[_0xf1ef('0x55')][_0xf1ef('0x49')]({'where':{'name':_0xf1ef('0x56'),'userProfileId':_0x134b72['userProfileId']},'raw':!![]})[_0xf1ef('0x23')](function(_0x1555f7){if(_0x1555f7&&_0x1555f7[_0xf1ef('0x57')]===0x0){return db[_0xf1ef('0x58')][_0xf1ef('0x4c')]({'name':_0x5584bb['name'],'resourceId':_0x5584bb['id'],'type':_0x1555f7[_0xf1ef('0x28')],'sectionId':_0x1555f7['id']},{})[_0xf1ef('0x23')](function(){return _0x4d16ab;});}else{return _0x4d16ab;}})[_0xf1ef('0x4a')](function(_0x13d4ec){logger['error'](_0xf1ef('0x59'),_0x13d4ec);throw _0x13d4ec;});}return _0x4d16ab;})[_0xf1ef('0x23')](respondWithResult(_0x5b8df3,0xc9))[_0xf1ef('0x4a')](handleError(_0x5b8df3,null));};
\ No newline at end of file
index d9440ad..baa0931 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a9a=['define','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','./cannedAnswer.attributes','exports'];(function(_0x27104d,_0x321402){var _0x1d70f9=function(_0x6ba16){while(--_0x6ba16){_0x27104d['push'](_0x27104d['shift']());}};_0x1d70f9(++_0x321402);}(_0x8a9a,0x193));var _0xa8a9=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x8a9a[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa8a9('0x0'))(_0xa8a9('0x1'));var moment=require(_0xa8a9('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8a9('0x3'));var fs=require('fs');var path=require(_0xa8a9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8a9('0x5'));module[_0xa8a9('0x6')]=function(_0x16b086,_0x39d1db){return _0x16b086[_0xa8a9('0x7')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa8a9('0x8'),'collate':_0xa8a9('0x9')});};
\ No newline at end of file
+var _0x78c7=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x106a77,_0x47ecbc){var _0x57ae98=function(_0x87b01c){while(--_0x87b01c){_0x106a77['push'](_0x106a77['shift']());}};_0x57ae98(++_0x47ecbc);}(_0x78c7,0x1c1));var _0x778c=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x78c7[_0x556927];return _0x5f1235;};'use strict';var _=require('lodash');var util=require(_0x778c('0x0'));var logger=require(_0x778c('0x1'))(_0x778c('0x2'));var moment=require(_0x778c('0x3'));var BPromise=require(_0x778c('0x4'));var rp=require(_0x778c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x778c('0x6'));var attributes=require(_0x778c('0x7'));module[_0x778c('0x8')]=function(_0x4f4f2e,_0x2fdd0b){return _0x4f4f2e[_0x778c('0x9')](_0x778c('0xa'),attributes,{'tableName':_0x778c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x778c('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index cdf11c7..b810a5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d96=['CannedAnswer,\x20%s,\x20%s','message','info','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9d96,0x190));var _0x69d9=function(_0x49a00c,_0x46f391){_0x49a00c=_0x49a00c-0x0;var _0x1590d3=_0x9d96[_0x49a00c];return _0x1590d3;};'use strict';var _=require('lodash');var util=require(_0x69d9('0x0'));var moment=require(_0x69d9('0x1'));var BPromise=require(_0x69d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69d9('0x3'));var db=require(_0x69d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x69d9('0x5'))(_0x69d9('0x6'));var config=require(_0x69d9('0x7'));var jayson=require(_0x69d9('0x8'));var client=jayson[_0x69d9('0x9')][_0x69d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27a7c5,_0x32b4d3,_0xad592c){return new BPromise(function(_0x16bd96,_0x436051){return client['request'](_0x27a7c5,_0xad592c)[_0x69d9('0xb')](function(_0x532db3){logger['info']('CannedAnswer,\x20%s,\x20%s',_0x32b4d3,_0x69d9('0xc'));logger[_0x69d9('0xd')](_0x69d9('0xe'),_0x32b4d3,_0x69d9('0xc'),JSON[_0x69d9('0xf')](_0x532db3));if(_0x532db3[_0x69d9('0x10')]){if(_0x532db3[_0x69d9('0x10')][_0x69d9('0x11')]===0x1f4){logger[_0x69d9('0x10')](_0x69d9('0x12'),_0x32b4d3,_0x532db3[_0x69d9('0x10')]['message']);return _0x436051(_0x532db3[_0x69d9('0x10')][_0x69d9('0x13')]);}logger['error']('CannedAnswer,\x20%s,\x20%s',_0x32b4d3,_0x532db3['error']['message']);return _0x16bd96(_0x532db3[_0x69d9('0x10')][_0x69d9('0x13')]);}else{logger[_0x69d9('0x14')](_0x69d9('0x12'),_0x32b4d3,'request\x20sent');_0x16bd96(_0x532db3[_0x69d9('0x15')]['message']);}})['catch'](function(_0x1c195b){logger[_0x69d9('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x32b4d3,_0x1c195b);_0x436051(_0x1c195b);});});}
\ No newline at end of file
+var _0xcd7d=['result','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x43d6fc,_0x2cc3f3){var _0x79aec2=function(_0x270dbf){while(--_0x270dbf){_0x43d6fc['push'](_0x43d6fc['shift']());}};_0x79aec2(++_0x2cc3f3);}(_0xcd7d,0x1c1));var _0xdcd7=function(_0x374954,_0x18dc36){_0x374954=_0x374954-0x0;var _0x42073e=_0xcd7d[_0x374954];return _0x42073e;};'use strict';var _=require('lodash');var util=require(_0xdcd7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdcd7('0x1'));var fs=require('fs');var Redis=require(_0xdcd7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcd7('0x3'));var logger=require('../../config/logger')(_0xdcd7('0x4'));var config=require('../../config/environment');var jayson=require(_0xdcd7('0x5'));var client=jayson[_0xdcd7('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19b0b8,_0x33acef,_0x541680){return new BPromise(function(_0x380db1,_0x6c664d){return client[_0xdcd7('0x7')](_0x19b0b8,_0x541680)[_0xdcd7('0x8')](function(_0x580381){logger[_0xdcd7('0x9')](_0xdcd7('0xa'),_0x33acef,'request\x20sent');logger['debug']('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x33acef,_0xdcd7('0xb'),JSON['stringify'](_0x580381));if(_0x580381[_0xdcd7('0xc')]){if(_0x580381['error'][_0xdcd7('0xd')]===0x1f4){logger[_0xdcd7('0xc')](_0xdcd7('0xa'),_0x33acef,_0x580381[_0xdcd7('0xc')]['message']);return _0x6c664d(_0x580381[_0xdcd7('0xc')][_0xdcd7('0xe')]);}logger['error'](_0xdcd7('0xa'),_0x33acef,_0x580381[_0xdcd7('0xc')][_0xdcd7('0xe')]);return _0x380db1(_0x580381['error'][_0xdcd7('0xe')]);}else{logger['info'](_0xdcd7('0xa'),_0x33acef,_0xdcd7('0xb'));_0x380db1(_0x580381[_0xdcd7('0xf')][_0xdcd7('0xe')]);}})['catch'](function(_0x1a4a2a){logger[_0xdcd7('0xc')](_0xdcd7('0xa'),_0x33acef,_0x1a4a2a);_0x6c664d(_0x1a4a2a);});});}
\ No newline at end of file
index 905277d..0ab4250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5339=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x590e74,_0x129694){var _0x54d0ab=function(_0x8dd4c){while(--_0x8dd4c){_0x590e74['push'](_0x590e74['shift']());}};_0x54d0ab(++_0x129694);}(_0x5339,0x75));var _0x9533=function(_0x3df1b3,_0x57b9fe){_0x3df1b3=_0x3df1b3-0x0;var _0x51078d=_0x5339[_0x3df1b3];return _0x51078d;};'use strict';var multer=require(_0x9533('0x0'));var util=require(_0x9533('0x1'));var path=require(_0x9533('0x2'));var timeout=require('connect-timeout');var express=require(_0x9533('0x3'));var router=express['Router']();var auth=require(_0x9533('0x4'));var interaction=require(_0x9533('0x5'));var config=require(_0x9533('0x6'));var controller=require(_0x9533('0x7'));router[_0x9533('0x8')]('/',auth[_0x9533('0x9')](),controller[_0x9533('0xa')]);router[_0x9533('0x8')](_0x9533('0xb'),auth[_0x9533('0x9')](),controller[_0x9533('0xc')]);router[_0x9533('0xd')]('/',auth['isAuthenticated'](),controller[_0x9533('0xe')]);router[_0x9533('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9533('0x10')]);router[_0x9533('0x11')](_0x9533('0xb'),auth[_0x9533('0x9')](),controller[_0x9533('0x12')]);module[_0x9533('0x13')]=router;
\ No newline at end of file
+var _0x85a9=['./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x85a9,0x1a3));var _0x985a=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x85a9[_0x587fb5];return _0x551105;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x985a('0x0'));var express=require(_0x985a('0x1'));var router=express[_0x985a('0x2')]();var auth=require(_0x985a('0x3'));var interaction=require(_0x985a('0x4'));var config=require(_0x985a('0x5'));var controller=require(_0x985a('0x6'));router[_0x985a('0x7')]('/',auth[_0x985a('0x8')](),controller[_0x985a('0x9')]);router[_0x985a('0x7')](_0x985a('0xa'),auth[_0x985a('0x8')](),controller[_0x985a('0xb')]);router[_0x985a('0xc')]('/',auth[_0x985a('0x8')](),controller[_0x985a('0xd')]);router['put']('/:id',auth[_0x985a('0x8')](),controller[_0x985a('0xe')]);router['delete'](_0x985a('0xa'),auth[_0x985a('0x8')](),controller[_0x985a('0xf')]);module[_0x985a('0x10')]=router;
\ No newline at end of file
index eb3b5d0..88fa748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f87=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3e2eb8,_0x40e5c7){var _0x17a2d5=function(_0x4996b0){while(--_0x4996b0){_0x3e2eb8['push'](_0x3e2eb8['shift']());}};_0x17a2d5(++_0x40e5c7);}(_0x4f87,0x19f));var _0x74f8=function(_0x21bfc8,_0x2a67d2){_0x21bfc8=_0x21bfc8-0x0;var _0x2029c0=_0x4f87[_0x21bfc8];return _0x2029c0;};'use strict';var Sequelize=require(_0x74f8('0x0'));module[_0x74f8('0x1')]={'calldate':{'type':Sequelize[_0x74f8('0x2')],'allowNull':![],'defaultValue':_0x74f8('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x74f8('0x4')]},'dcontext':{'type':Sequelize[_0x74f8('0x4')]},'channel':{'type':Sequelize[_0x74f8('0x4')]},'dstchannel':{'type':Sequelize[_0x74f8('0x4')]},'lastapp':{'type':Sequelize[_0x74f8('0x4')]},'lastdata':{'type':Sequelize[_0x74f8('0x4')]},'duration':{'type':Sequelize[_0x74f8('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x74f8('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x74f8('0x4')]},'amaflags':{'type':Sequelize[_0x74f8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x74f8('0x4')]},'userfield':{'type':Sequelize[_0x74f8('0x4')]},'uniqueid':{'type':Sequelize[_0x74f8('0x4')]},'linkedid':{'type':Sequelize[_0x74f8('0x4')]},'sequence':{'type':Sequelize[_0x74f8('0x4')]},'peeraccount':{'type':Sequelize[_0x74f8('0x4')]},'type':{'type':Sequelize[_0x74f8('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc824=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xc824,0xa7));var _0x4c82=function(_0x4f3362,_0xdf87bf){_0x4f3362=_0x4f3362-0x0;var _0x4eeeb6=_0xc824[_0x4f3362];return _0x4eeeb6;};'use strict';var Sequelize=require(_0x4c82('0x0'));module[_0x4c82('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x4c82('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x4c82('0x3')]},'dcontext':{'type':Sequelize[_0x4c82('0x3')]},'channel':{'type':Sequelize[_0x4c82('0x3')]},'dstchannel':{'type':Sequelize[_0x4c82('0x3')]},'lastapp':{'type':Sequelize[_0x4c82('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x4c82('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4c82('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4c82('0x3')]},'amaflags':{'type':Sequelize[_0x4c82('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4c82('0x3')]},'userfield':{'type':Sequelize[_0x4c82('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x4c82('0x3')]},'sequence':{'type':Sequelize[_0x4c82('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4c82('0x3')]},'tag':{'type':Sequelize[_0x4c82('0x3')]}};
\ No newline at end of file
index 1b5cb23..d143ce7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f6=['VIRTUAL','merge','options','Cdr','includeAll','include','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','then','destroy','end','error','stack','name','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type'];(function(_0x143de6,_0x386c48){var _0x37454e=function(_0x206a55){while(--_0x206a55){_0x143de6['push'](_0x143de6['shift']());}};_0x37454e(++_0x386c48);}(_0x13f6,0x11e));var _0x613f=function(_0x1b67bf,_0x278667){_0x1b67bf=_0x1b67bf-0x0;var _0x44df9f=_0x13f6[_0x1b67bf];return _0x44df9f;};'use strict';var pdf=require(_0x613f('0x0'));var emlformat=require(_0x613f('0x1'));var rimraf=require(_0x613f('0x2'));var zipdir=require(_0x613f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x4'));var moment=require(_0x613f('0x5'));var BPromise=require(_0x613f('0x6'));var Mustache=require('mustache');var util=require(_0x613f('0x7'));var path=require('path');var sox=require(_0x613f('0x8'));var csv=require(_0x613f('0x9'));var ejs=require(_0x613f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x613f('0xb'));var crypto=require('crypto');var jsforce=require(_0x613f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x613f('0x9'));var querystring=require(_0x613f('0xd'));var Papa=require('papaparse');var Redis=require(_0x613f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require(_0x613f('0x11'));var logger=require(_0x613f('0x12'))(_0x613f('0x13'));var utils=require(_0x613f('0x14'));var config=require('../../config/environment');var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x5606bb,_0x187f37){_0x187f37=_0x187f37||0xcc;return function(_0x30d8e5){if(_0x30d8e5){return _0x5606bb[_0x613f('0x16')](_0x187f37);}return _0x5606bb[_0x613f('0x17')](_0x187f37)['end']();};}function respondWithResult(_0x25ab5f,_0x452f10){_0x452f10=_0x452f10||0xc8;return function(_0xbc0381){if(_0xbc0381){return _0x25ab5f[_0x613f('0x17')](_0x452f10)[_0x613f('0x18')](_0xbc0381);}};}function respondWithFilteredResult(_0x29a042,_0x10afc5){return function(_0x1e818b){if(_0x1e818b){var _0x4e0679=_0x1e818b[_0x613f('0x19')],_0x1540ea=_0x10afc5[_0x613f('0x1a')],_0x266eee=_0x10afc5[_0x613f('0x1a')]+_0x10afc5[_0x613f('0x1b')],_0xf5ed3a;if(_0x266eee>=_0x4e0679){_0x266eee=_0x4e0679;_0xf5ed3a=0xc8;}else{_0xf5ed3a=0xce;}_0x29a042['status'](_0xf5ed3a);return _0x29a042[_0x613f('0x1c')]('Content-Range',_0x1540ea+'-'+_0x266eee+'/'+_0x4e0679)[_0x613f('0x18')](_0x1e818b);}return null;};}function patchUpdates(_0x25421f){return function(_0x80c9ad){try{jsonpatch[_0x613f('0x1d')](_0x80c9ad,_0x25421f,!![]);}catch(_0x742772){return BPromise[_0x613f('0x1e')](_0x742772);}return _0x80c9ad['save']();};}function saveUpdates(_0x331f69,_0x468a48){return function(_0x3f4345){if(_0x3f4345){return _0x3f4345['update'](_0x331f69)[_0x613f('0x1f')](function(_0x550807){return _0x550807;});}return null;};}function removeEntity(_0x8eb62f,_0x123be5){return function(_0x2572b3){if(_0x2572b3){return _0x2572b3[_0x613f('0x20')]()[_0x613f('0x1f')](function(){_0x8eb62f[_0x613f('0x17')](0xcc)[_0x613f('0x21')]();});}};}function handleEntityNotFound(_0x2b707e,_0x23530e){return function(_0x1dec72){if(!_0x1dec72){_0x2b707e[_0x613f('0x16')](0x194);}return _0x1dec72;};}function handleError(_0x5cb5e2,_0xfba363){_0xfba363=_0xfba363||0x1f4;return function(_0x35dab1){logger[_0x613f('0x22')](_0x35dab1[_0x613f('0x23')]);if(_0x35dab1[_0x613f('0x24')]){delete _0x35dab1[_0x613f('0x24')];}_0x5cb5e2['status'](_0xfba363)['send'](_0x35dab1);};}exports['index']=function(_0x13b884,_0x14b03b){var _0x4b8c7d={},_0x47dcb7={},_0x2ddcf0={'count':0x0,'rows':[]};var _0x12b0f7=_[_0x613f('0x25')](db['Cdr'][_0x613f('0x26')],function(_0x5a69bf){return{'name':_0x5a69bf['fieldName'],'type':_0x5a69bf['type'][_0x613f('0x27')]};});_0x47dcb7[_0x613f('0x28')]=_[_0x613f('0x25')](_0x12b0f7,_0x613f('0x24'));_0x47dcb7['query']=_[_0x613f('0x29')](_0x13b884[_0x613f('0x2a')]);_0x47dcb7[_0x613f('0x2b')]=_[_0x613f('0x2c')](_0x47dcb7[_0x613f('0x28')],_0x47dcb7[_0x613f('0x2a')]);_0x4b8c7d[_0x613f('0x2d')]=_[_0x613f('0x2c')](_0x47dcb7[_0x613f('0x28')],qs['fields'](_0x13b884['query'][_0x613f('0x2e')]));_0x4b8c7d[_0x613f('0x2d')]=_0x4b8c7d[_0x613f('0x2d')][_0x613f('0x2f')]?_0x4b8c7d['attributes']:_0x47dcb7[_0x613f('0x28')];if(!_0x13b884[_0x613f('0x2a')]['hasOwnProperty']('nolimit')){_0x4b8c7d[_0x613f('0x1b')]=qs[_0x613f('0x1b')](_0x13b884[_0x613f('0x2a')][_0x613f('0x1b')]);_0x4b8c7d[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x13b884[_0x613f('0x2a')]['offset']);}_0x4b8c7d[_0x613f('0x30')]=qs[_0x613f('0x31')](_0x13b884[_0x613f('0x2a')][_0x613f('0x31')]);_0x4b8c7d[_0x613f('0x32')]=qs[_0x613f('0x2b')](_[_0x613f('0x33')](_0x13b884[_0x613f('0x2a')],_0x47dcb7[_0x613f('0x2b')]),_0x12b0f7);if(_0x13b884[_0x613f('0x2a')][_0x613f('0x34')]){_0x4b8c7d[_0x613f('0x32')]=_['merge'](_0x4b8c7d[_0x613f('0x32')],{'$or':_[_0x613f('0x25')](_0x12b0f7,function(_0x20b9cf){if(_0x20b9cf[_0x613f('0x35')]!==_0x613f('0x36')){var _0x3dcea6={};_0x3dcea6[_0x20b9cf[_0x613f('0x24')]]={'$like':'%'+_0x13b884[_0x613f('0x2a')]['filter']+'%'};return _0x3dcea6;}})});}_0x4b8c7d=_[_0x613f('0x37')]({},_0x4b8c7d,_0x13b884[_0x613f('0x38')]);var _0x51b7f9={'where':_0x4b8c7d[_0x613f('0x32')]};return db[_0x613f('0x39')][_0x613f('0x19')](_0x51b7f9)[_0x613f('0x1f')](function(_0xf58f58){_0x2ddcf0[_0x613f('0x19')]=_0xf58f58;if(_0x13b884['query'][_0x613f('0x3a')]){_0x4b8c7d[_0x613f('0x3b')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x4b8c7d);})[_0x613f('0x1f')](function(_0x16d458){_0x2ddcf0[_0x613f('0x3c')]=_0x16d458;return _0x2ddcf0;})[_0x613f('0x1f')](respondWithFilteredResult(_0x14b03b,_0x4b8c7d))[_0x613f('0x3d')](handleError(_0x14b03b,null));};exports[_0x613f('0x3e')]=function(_0x135c32,_0x5078b6){var _0x35a433={'raw':!![],'where':{'id':_0x135c32[_0x613f('0x3f')]['id']}},_0x59da0e={};_0x59da0e[_0x613f('0x28')]=_[_0x613f('0x29')](db[_0x613f('0x39')][_0x613f('0x26')]);_0x59da0e[_0x613f('0x2a')]=_[_0x613f('0x29')](_0x135c32[_0x613f('0x2a')]);_0x59da0e['filters']=_[_0x613f('0x2c')](_0x59da0e[_0x613f('0x28')],_0x59da0e[_0x613f('0x2a')]);_0x35a433[_0x613f('0x2d')]=_[_0x613f('0x2c')](_0x59da0e[_0x613f('0x28')],qs[_0x613f('0x2e')](_0x135c32[_0x613f('0x2a')][_0x613f('0x2e')]));_0x35a433[_0x613f('0x2d')]=_0x35a433[_0x613f('0x2d')]['length']?_0x35a433[_0x613f('0x2d')]:_0x59da0e['model'];if(_0x135c32[_0x613f('0x2a')][_0x613f('0x3a')]){_0x35a433[_0x613f('0x3b')]=[{'all':!![]}];}_0x35a433=_[_0x613f('0x37')]({},_0x35a433,_0x135c32[_0x613f('0x38')]);return db[_0x613f('0x39')]['find'](_0x35a433)[_0x613f('0x1f')](handleEntityNotFound(_0x5078b6,null))[_0x613f('0x1f')](respondWithResult(_0x5078b6,null))['catch'](handleError(_0x5078b6,null));};exports[_0x613f('0x40')]=function(_0x4091d7,_0x2194dc){return db[_0x613f('0x39')]['create'](_0x4091d7[_0x613f('0x41')],{})[_0x613f('0x1f')](respondWithResult(_0x2194dc,0xc9))[_0x613f('0x3d')](handleError(_0x2194dc,null));};exports['update']=function(_0x521582,_0x3daea3){if(_0x521582['body']['id']){delete _0x521582[_0x613f('0x41')]['id'];}return db[_0x613f('0x39')][_0x613f('0x42')]({'where':{'id':_0x521582[_0x613f('0x3f')]['id']}})[_0x613f('0x1f')](handleEntityNotFound(_0x3daea3,null))[_0x613f('0x1f')](saveUpdates(_0x521582[_0x613f('0x41')],null))[_0x613f('0x1f')](respondWithResult(_0x3daea3,null))[_0x613f('0x3d')](handleError(_0x3daea3,null));};exports['destroy']=function(_0x1c7763,_0x5acfac){return db[_0x613f('0x39')]['find']({'where':{'id':_0x1c7763[_0x613f('0x3f')]['id']}})[_0x613f('0x1f')](handleEntityNotFound(_0x5acfac,null))[_0x613f('0x1f')](removeEntity(_0x5acfac,null))['catch'](handleError(_0x5acfac,null));};exports[_0x613f('0x43')]=function(_0x5bab83,_0x30b65f){return db[_0x613f('0x39')][_0x613f('0x43')]()[_0x613f('0x1f')](respondWithResult(_0x30b65f,null))[_0x613f('0x3d')](handleError(_0x30b65f,null));};
\ No newline at end of file
+var _0x0418=['stack','name','send','index','map','Cdr','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','then','catch','show','params','include','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','update','destroy','sendStatus','error'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x0418,0x103));var _0x8041=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0418[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x8041('0x0'));var emlformat=require(_0x8041('0x1'));var rimraf=require(_0x8041('0x2'));var zipdir=require(_0x8041('0x3'));var jsonpatch=require(_0x8041('0x4'));var rp=require(_0x8041('0x5'));var moment=require(_0x8041('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8041('0x7'));var path=require(_0x8041('0x8'));var sox=require(_0x8041('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8041('0xa'));var squel=require(_0x8041('0xb'));var crypto=require(_0x8041('0xc'));var jsforce=require(_0x8041('0xd'));var deskjs=require(_0x8041('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8041('0xf'));var Papa=require(_0x8041('0x10'));var Redis=require(_0x8041('0x11'));var authService=require(_0x8041('0x12'));var qs=require(_0x8041('0x13'));var as=require(_0x8041('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8041('0x15'))(_0x8041('0x16'));var utils=require('../../config/utils');var config=require(_0x8041('0x17'));var db=require(_0x8041('0x18'))['db'];function respondWithStatusCode(_0x1b199d,_0x441fc9){_0x441fc9=_0x441fc9||0xcc;return function(_0x3d0207){if(_0x3d0207){return _0x1b199d['sendStatus'](_0x441fc9);}return _0x1b199d[_0x8041('0x19')](_0x441fc9)[_0x8041('0x1a')]();};}function respondWithResult(_0x506865,_0x4d91ff){_0x4d91ff=_0x4d91ff||0xc8;return function(_0x53da96){if(_0x53da96){return _0x506865[_0x8041('0x19')](_0x4d91ff)[_0x8041('0x1b')](_0x53da96);}};}function respondWithFilteredResult(_0x58e044,_0x86ceb3){return function(_0x16bcb7){if(_0x16bcb7){var _0x396edf=_0x16bcb7[_0x8041('0x1c')],_0x30033d=_0x86ceb3[_0x8041('0x1d')],_0x3e3b29=_0x86ceb3[_0x8041('0x1d')]+_0x86ceb3[_0x8041('0x1e')],_0x2e5df5;if(_0x3e3b29>=_0x396edf){_0x3e3b29=_0x396edf;_0x2e5df5=0xc8;}else{_0x2e5df5=0xce;}_0x58e044[_0x8041('0x19')](_0x2e5df5);return _0x58e044['set']('Content-Range',_0x30033d+'-'+_0x3e3b29+'/'+_0x396edf)[_0x8041('0x1b')](_0x16bcb7);}return null;};}function patchUpdates(_0x137575){return function(_0x157734){try{jsonpatch[_0x8041('0x1f')](_0x157734,_0x137575,!![]);}catch(_0x462918){return BPromise[_0x8041('0x20')](_0x462918);}return _0x157734['save']();};}function saveUpdates(_0xc28615,_0xd0fda4){return function(_0x5216a9){if(_0x5216a9){return _0x5216a9[_0x8041('0x21')](_0xc28615)['then'](function(_0x430b73){return _0x430b73;});}return null;};}function removeEntity(_0x4fa05f,_0x3b803d){return function(_0x6b64ba){if(_0x6b64ba){return _0x6b64ba[_0x8041('0x22')]()['then'](function(){_0x4fa05f[_0x8041('0x19')](0xcc)[_0x8041('0x1a')]();});}};}function handleEntityNotFound(_0x4602e9,_0x25f5f6){return function(_0x405ed9){if(!_0x405ed9){_0x4602e9[_0x8041('0x23')](0x194);}return _0x405ed9;};}function handleError(_0x56737b,_0x3f57c5){_0x3f57c5=_0x3f57c5||0x1f4;return function(_0x4c4791){logger[_0x8041('0x24')](_0x4c4791[_0x8041('0x25')]);if(_0x4c4791['name']){delete _0x4c4791[_0x8041('0x26')];}_0x56737b[_0x8041('0x19')](_0x3f57c5)[_0x8041('0x27')](_0x4c4791);};}exports[_0x8041('0x28')]=function(_0x5e811d,_0x36c619){var _0x25b01e={},_0x20cf3c={},_0x1d5c10={'count':0x0,'rows':[]};var _0xebb525=_[_0x8041('0x29')](db[_0x8041('0x2a')][_0x8041('0x2b')],function(_0x2b5425){return{'name':_0x2b5425[_0x8041('0x2c')],'type':_0x2b5425['type'][_0x8041('0x2d')]};});_0x20cf3c['model']=_['map'](_0xebb525,_0x8041('0x26'));_0x20cf3c[_0x8041('0x2e')]=_[_0x8041('0x2f')](_0x5e811d[_0x8041('0x2e')]);_0x20cf3c[_0x8041('0x30')]=_[_0x8041('0x31')](_0x20cf3c[_0x8041('0x32')],_0x20cf3c[_0x8041('0x2e')]);_0x25b01e[_0x8041('0x33')]=_[_0x8041('0x31')](_0x20cf3c[_0x8041('0x32')],qs[_0x8041('0x34')](_0x5e811d[_0x8041('0x2e')][_0x8041('0x34')]));_0x25b01e['attributes']=_0x25b01e[_0x8041('0x33')][_0x8041('0x35')]?_0x25b01e[_0x8041('0x33')]:_0x20cf3c[_0x8041('0x32')];if(!_0x5e811d[_0x8041('0x2e')][_0x8041('0x36')]('nolimit')){_0x25b01e[_0x8041('0x1e')]=qs[_0x8041('0x1e')](_0x5e811d[_0x8041('0x2e')][_0x8041('0x1e')]);_0x25b01e[_0x8041('0x1d')]=qs[_0x8041('0x1d')](_0x5e811d[_0x8041('0x2e')]['offset']);}_0x25b01e[_0x8041('0x37')]=qs[_0x8041('0x38')](_0x5e811d['query'][_0x8041('0x38')]);_0x25b01e[_0x8041('0x39')]=qs[_0x8041('0x30')](_['pick'](_0x5e811d['query'],_0x20cf3c[_0x8041('0x30')]),_0xebb525);if(_0x5e811d['query'][_0x8041('0x3a')]){_0x25b01e['where']=_['merge'](_0x25b01e['where'],{'$or':_[_0x8041('0x29')](_0xebb525,function(_0x6940f2){if(_0x6940f2[_0x8041('0x3b')]!==_0x8041('0x3c')){var _0x21f18c={};_0x21f18c[_0x6940f2['name']]={'$like':'%'+_0x5e811d['query'][_0x8041('0x3a')]+'%'};return _0x21f18c;}})});}_0x25b01e=_[_0x8041('0x3d')]({},_0x25b01e,_0x5e811d[_0x8041('0x3e')]);var _0x4ad2b1={'where':_0x25b01e[_0x8041('0x39')]};return db[_0x8041('0x2a')][_0x8041('0x1c')](_0x4ad2b1)['then'](function(_0x521823){_0x1d5c10[_0x8041('0x1c')]=_0x521823;if(_0x5e811d[_0x8041('0x2e')][_0x8041('0x3f')]){_0x25b01e['include']=[{'all':!![]}];}return db[_0x8041('0x2a')][_0x8041('0x40')](_0x25b01e);})[_0x8041('0x41')](function(_0x1ad0ea){_0x1d5c10['rows']=_0x1ad0ea;return _0x1d5c10;})[_0x8041('0x41')](respondWithFilteredResult(_0x36c619,_0x25b01e))[_0x8041('0x42')](handleError(_0x36c619,null));};exports[_0x8041('0x43')]=function(_0x2a7d06,_0x4f3923){var _0xf54d04={'raw':!![],'where':{'id':_0x2a7d06[_0x8041('0x44')]['id']}},_0x2b869e={};_0x2b869e[_0x8041('0x32')]=_['keys'](db[_0x8041('0x2a')][_0x8041('0x2b')]);_0x2b869e[_0x8041('0x2e')]=_[_0x8041('0x2f')](_0x2a7d06[_0x8041('0x2e')]);_0x2b869e[_0x8041('0x30')]=_[_0x8041('0x31')](_0x2b869e[_0x8041('0x32')],_0x2b869e['query']);_0xf54d04['attributes']=_[_0x8041('0x31')](_0x2b869e[_0x8041('0x32')],qs[_0x8041('0x34')](_0x2a7d06[_0x8041('0x2e')]['fields']));_0xf54d04[_0x8041('0x33')]=_0xf54d04[_0x8041('0x33')][_0x8041('0x35')]?_0xf54d04['attributes']:_0x2b869e[_0x8041('0x32')];if(_0x2a7d06[_0x8041('0x2e')][_0x8041('0x3f')]){_0xf54d04[_0x8041('0x45')]=[{'all':!![]}];}_0xf54d04=_['merge']({},_0xf54d04,_0x2a7d06[_0x8041('0x3e')]);return db[_0x8041('0x2a')]['find'](_0xf54d04)[_0x8041('0x41')](handleEntityNotFound(_0x4f3923,null))['then'](respondWithResult(_0x4f3923,null))[_0x8041('0x42')](handleError(_0x4f3923,null));};exports['create']=function(_0x76ee94,_0x57e23a){return db[_0x8041('0x2a')][_0x8041('0x46')](_0x76ee94[_0x8041('0x47')],{})[_0x8041('0x41')](respondWithResult(_0x57e23a,0xc9))[_0x8041('0x42')](handleError(_0x57e23a,null));};exports[_0x8041('0x21')]=function(_0x39c0a6,_0x4cb2cc){if(_0x39c0a6[_0x8041('0x47')]['id']){delete _0x39c0a6[_0x8041('0x47')]['id'];}return db['Cdr'][_0x8041('0x48')]({'where':{'id':_0x39c0a6[_0x8041('0x44')]['id']}})[_0x8041('0x41')](handleEntityNotFound(_0x4cb2cc,null))[_0x8041('0x41')](saveUpdates(_0x39c0a6[_0x8041('0x47')],null))['then'](respondWithResult(_0x4cb2cc,null))[_0x8041('0x42')](handleError(_0x4cb2cc,null));};exports[_0x8041('0x22')]=function(_0x197085,_0x83b831){return db[_0x8041('0x2a')]['find']({'where':{'id':_0x197085[_0x8041('0x44')]['id']}})['then'](handleEntityNotFound(_0x83b831,null))[_0x8041('0x41')](removeEntity(_0x83b831,null))[_0x8041('0x42')](handleError(_0x83b831,null));};exports[_0x8041('0x49')]=function(_0x4ed36a,_0x5d799d){return db[_0x8041('0x2a')][_0x8041('0x49')]()[_0x8041('0x41')](respondWithResult(_0x5d799d,null))[_0x8041('0x42')](handleError(_0x5d799d,null));};
\ No newline at end of file
index f40a457..3e37649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fb=['api','path','rimraf','./cdr.attributes','exports','Cdr','accountcode','disposition','dst','src','lodash','util','../../config/logger'];(function(_0x483ec4,_0x43d15c){var _0x105b7c=function(_0x1d6ac3){while(--_0x1d6ac3){_0x483ec4['push'](_0x483ec4['shift']());}};_0x105b7c(++_0x43d15c);}(_0xd8fb,0x99));var _0xbd8f=function(_0x951c2c,_0x56c398){_0x951c2c=_0x951c2c-0x0;var _0x9bda3b=_0xd8fb[_0x951c2c];return _0x9bda3b;};'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':'cdr','paranoid':![],'indexes':[{'name':_0xbd8f('0x9'),'fields':[_0xbd8f('0x9')]},{'name':'calldate','fields':['calldate']},{'name':_0xbd8f('0xa'),'fields':[_0xbd8f('0xa')]},{'name':_0xbd8f('0xb'),'fields':['dst']},{'name':_0xbd8f('0xc'),'fields':[_0xbd8f('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
+var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cdr.attributes','define','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash'];(function(_0x1af026,_0x1e5637){var _0x5a0e66=function(_0x2b9ce8){while(--_0x2b9ce8){_0x1af026['push'](_0x1af026['shift']());}};_0x5a0e66(++_0x1e5637);}(_0x5496,0x175));var _0x6549=function(_0x2dca72,_0x3f9327){_0x2dca72=_0x2dca72-0x0;var _0xd089b9=_0x5496[_0x2dca72];return _0xd089b9;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('Cdr',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'calldate','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]},{'name':_0x6549('0xe'),'fields':[_0x6549('0xe')]},{'name':_0x6549('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x6549('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 475dcc5..8544d59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cec=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch'];(function(_0x5f2b13,_0x1a936e){var _0x1dc5f3=function(_0x5dcd16){while(--_0x5dcd16){_0x5f2b13['push'](_0x5f2b13['shift']());}};_0x1dc5f3(++_0x1a936e);}(_0x9cec,0x7e));var _0xc9ce=function(_0x2a96a0,_0x3c7e73){_0x2a96a0=_0x2a96a0-0x0;var _0xbb931f=_0x9cec[_0x2a96a0];return _0xbb931f;};'use strict';var _=require(_0xc9ce('0x0'));var util=require('util');var moment=require(_0xc9ce('0x1'));var BPromise=require(_0xc9ce('0x2'));var rs=require(_0xc9ce('0x3'));var fs=require('fs');var Redis=require(_0xc9ce('0x4'));var db=require(_0xc9ce('0x5'))['db'];var utils=require(_0xc9ce('0x6'));var logger=require(_0xc9ce('0x7'))(_0xc9ce('0x8'));var config=require(_0xc9ce('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc9ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cb36f,_0x279652,_0x1ce708){return new BPromise(function(_0x13b5d4,_0x570f81){return client[_0xc9ce('0xb')](_0x4cb36f,_0x1ce708)[_0xc9ce('0xc')](function(_0x33bd41){logger['info'](_0xc9ce('0xd'),_0x279652,_0xc9ce('0xe'));logger[_0xc9ce('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x279652,_0xc9ce('0xe'),JSON['stringify'](_0x33bd41));if(_0x33bd41[_0xc9ce('0x10')]){if(_0x33bd41[_0xc9ce('0x10')]['code']===0x1f4){logger[_0xc9ce('0x10')](_0xc9ce('0xd'),_0x279652,_0x33bd41[_0xc9ce('0x10')][_0xc9ce('0x11')]);return _0x570f81(_0x33bd41[_0xc9ce('0x10')][_0xc9ce('0x11')]);}logger[_0xc9ce('0x10')](_0xc9ce('0xd'),_0x279652,_0x33bd41[_0xc9ce('0x10')][_0xc9ce('0x11')]);return _0x13b5d4(_0x33bd41[_0xc9ce('0x10')][_0xc9ce('0x11')]);}else{logger[_0xc9ce('0x12')](_0xc9ce('0xd'),_0x279652,_0xc9ce('0xe'));_0x13b5d4(_0x33bd41[_0xc9ce('0x13')]['message']);}})[_0xc9ce('0x14')](function(_0x79799){logger[_0xc9ce('0x10')](_0xc9ce('0xd'),_0x279652,_0x79799);_0x570f81(_0x79799);});});}
\ No newline at end of file
+var _0x1826=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x38bb3e,_0x17f62a){var _0x55fd30=function(_0x55d45c){while(--_0x55d45c){_0x38bb3e['push'](_0x38bb3e['shift']());}};_0x55fd30(++_0x17f62a);}(_0x1826,0x119));var _0x6182=function(_0x385101,_0x396ad1){_0x385101=_0x385101-0x0;var _0x5b836f=_0x1826[_0x385101];return _0x5b836f;};'use strict';var _=require(_0x6182('0x0'));var util=require(_0x6182('0x1'));var moment=require(_0x6182('0x2'));var BPromise=require(_0x6182('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6182('0x4'));var db=require(_0x6182('0x5'))['db'];var utils=require(_0x6182('0x6'));var logger=require('../../config/logger')(_0x6182('0x7'));var config=require(_0x6182('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6182('0x9')][_0x6182('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xebecad,_0x454bcb,_0xa23780){return new BPromise(function(_0x19f155,_0x1a86f9){return client[_0x6182('0xb')](_0xebecad,_0xa23780)['then'](function(_0x307052){logger[_0x6182('0xc')](_0x6182('0xd'),_0x454bcb,'request\x20sent');logger[_0x6182('0xe')](_0x6182('0xf'),_0x454bcb,'request\x20sent',JSON[_0x6182('0x10')](_0x307052));if(_0x307052[_0x6182('0x11')]){if(_0x307052[_0x6182('0x11')][_0x6182('0x12')]===0x1f4){logger[_0x6182('0x11')](_0x6182('0xd'),_0x454bcb,_0x307052['error'][_0x6182('0x13')]);return _0x1a86f9(_0x307052[_0x6182('0x11')]['message']);}logger['error'](_0x6182('0xd'),_0x454bcb,_0x307052[_0x6182('0x11')]['message']);return _0x19f155(_0x307052['error']['message']);}else{logger[_0x6182('0xc')]('Cdr,\x20%s,\x20%s',_0x454bcb,'request\x20sent');_0x19f155(_0x307052[_0x6182('0x14')]['message']);}})[_0x6182('0x15')](function(_0x3fcfc7){logger[_0x6182('0x11')](_0x6182('0xd'),_0x454bcb,_0x3fcfc7);_0x1a86f9(_0x3fcfc7);});});}
\ No newline at end of file
index 20d7bf7..23f8c4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb3e=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','./cdr.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update'];(function(_0xdf1549,_0x479aa8){var _0x177dbf=function(_0x163936){while(--_0x163936){_0xdf1549['push'](_0xdf1549['shift']());}};_0x177dbf(++_0x479aa8);}(_0xdb3e,0xe7));var _0xedb3=function(_0x2a6440,_0x537f37){_0x2a6440=_0x2a6440-0x0;var _0x4f8d4c=_0xdb3e[_0x2a6440];return _0x4f8d4c;};'use strict';var multer=require(_0xedb3('0x0'));var util=require('util');var path=require(_0xedb3('0x1'));var timeout=require('connect-timeout');var express=require(_0xedb3('0x2'));var router=express[_0xedb3('0x3')]();var auth=require(_0xedb3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xedb3('0x5'));router[_0xedb3('0x6')]('/',auth[_0xedb3('0x7')](),controller[_0xedb3('0x8')]);router[_0xedb3('0x6')](_0xedb3('0x9'),auth['isAuthenticated'](),controller[_0xedb3('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xedb3('0xb')]);router[_0xedb3('0xc')]('/',auth['isAuthenticated'](),controller[_0xedb3('0xd')]);router[_0xedb3('0xe')]('/:id',auth[_0xedb3('0x7')](),controller[_0xedb3('0xf')]);router[_0xedb3('0x10')]('/:id',auth[_0xedb3('0x7')](),controller[_0xedb3('0x11')]);module[_0xedb3('0x12')]=router;
\ No newline at end of file
+var _0x4414=['post','create','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cdr.controller','isAuthenticated','index','describe','get','show'];(function(_0x1062ff,_0x189a3f){var _0x5e2d0f=function(_0x24d2ab){while(--_0x24d2ab){_0x1062ff['push'](_0x1062ff['shift']());}};_0x5e2d0f(++_0x189a3f);}(_0x4414,0x15d));var _0x4441=function(_0x11cb1d,_0x4782da){_0x11cb1d=_0x11cb1d-0x0;var _0x353d97=_0x4414[_0x11cb1d];return _0x353d97;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4441('0x0'));var timeout=require(_0x4441('0x1'));var express=require(_0x4441('0x2'));var router=express[_0x4441('0x3')]();var auth=require(_0x4441('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4441('0x5'));var controller=require(_0x4441('0x6'));router['get']('/',auth[_0x4441('0x7')](),controller[_0x4441('0x8')]);router['get']('/describe',auth[_0x4441('0x7')](),controller[_0x4441('0x9')]);router[_0x4441('0xa')]('/:id',auth[_0x4441('0x7')](),controller[_0x4441('0xb')]);router[_0x4441('0xc')]('/',auth[_0x4441('0x7')](),controller[_0x4441('0xd')]);router['put']('/:id',auth[_0x4441('0x7')](),controller[_0x4441('0xe')]);router[_0x4441('0xf')](_0x4441('0x10'),auth[_0x4441('0x7')](),controller[_0x4441('0x11')]);module[_0x4441('0x12')]=router;
\ No newline at end of file
index 6243775..8a40279 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75cd=['STRING','TEXT','*,*,*,*','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75cd,0x83));var _0xd75c=function(_0x3839e7,_0x294773){_0x3839e7=_0x3839e7-0x0;var _0x53f58c=_0x75cd[_0x3839e7];return _0x53f58c;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xd75c('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xd75c('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd75c('0x2')]()},'description':{'type':Sequelize[_0xd75c('0x1')]},'interval':{'type':Sequelize[_0xd75c('0x1')],'defaultValue':_0xd75c('0x3')}};
\ No newline at end of file
+var _0x0a55=['noop','TEXT','sequelize','exports','STRING'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x0a55,0x1ab));var _0x50a5=function(_0x409e6b,_0x3437b3){_0x409e6b=_0x409e6b-0x0;var _0x50c5af=_0x0a55[_0x409e6b];return _0x50c5af;};'use strict';var Sequelize=require(_0x50a5('0x0'));module[_0x50a5('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x50a5('0x2')],'allowNull':![],'defaultValue':_0x50a5('0x3')},'appdata':{'type':Sequelize[_0x50a5('0x4')]()},'description':{'type':Sequelize[_0x50a5('0x2')]},'interval':{'type':Sequelize[_0x50a5('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 0bf12a2..f50c268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa72b=['update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','merge','options','find','then','catch'];(function(_0x289af7,_0x15e15f){var _0x5cc8e6=function(_0x5eaaed){while(--_0x5eaaed){_0x289af7['push'](_0x289af7['shift']());}};_0x5cc8e6(++_0x15e15f);}(_0xa72b,0x1a6));var _0xba72=function(_0x11a5f0,_0x279d5c){_0x11a5f0=_0x11a5f0-0x0;var _0x25fa99=_0xa72b[_0x11a5f0];return _0x25fa99;};'use strict';var pdf=require(_0xba72('0x0'));var emlformat=require(_0xba72('0x1'));var rimraf=require(_0xba72('0x2'));var zipdir=require(_0xba72('0x3'));var jsonpatch=require(_0xba72('0x4'));var rp=require(_0xba72('0x5'));var moment=require(_0xba72('0x6'));var BPromise=require(_0xba72('0x7'));var Mustache=require(_0xba72('0x8'));var util=require(_0xba72('0x9'));var path=require(_0xba72('0xa'));var sox=require('sox');var csv=require(_0xba72('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xba72('0xc'));var crypto=require(_0xba72('0xd'));var jsforce=require(_0xba72('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xba72('0xb'));var querystring=require(_0xba72('0xf'));var Papa=require(_0xba72('0x10'));var Redis=require(_0xba72('0x11'));var authService=require(_0xba72('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xba72('0x13'));var hardwareService=require(_0xba72('0x14'));var logger=require(_0xba72('0x15'))(_0xba72('0x16'));var utils=require(_0xba72('0x17'));var config=require(_0xba72('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x471b21,_0x277517){_0x277517=_0x277517||0xcc;return function(_0x43638e){if(_0x43638e){return _0x471b21[_0xba72('0x19')](_0x277517);}return _0x471b21[_0xba72('0x1a')](_0x277517)[_0xba72('0x1b')]();};}function respondWithResult(_0x4e4619,_0x28313f){_0x28313f=_0x28313f||0xc8;return function(_0x5ebab0){if(_0x5ebab0){return _0x4e4619['status'](_0x28313f)[_0xba72('0x1c')](_0x5ebab0);}};}function respondWithFilteredResult(_0x5fa6bf,_0xbd1f8c){return function(_0x5b594f){if(_0x5b594f){var _0x3b6fbb=_0x5b594f[_0xba72('0x1d')],_0x2d669a=_0xbd1f8c[_0xba72('0x1e')],_0x5d729e=_0xbd1f8c[_0xba72('0x1e')]+_0xbd1f8c[_0xba72('0x1f')],_0x33bb83;if(_0x5d729e>=_0x3b6fbb){_0x5d729e=_0x3b6fbb;_0x33bb83=0xc8;}else{_0x33bb83=0xce;}_0x5fa6bf['status'](_0x33bb83);return _0x5fa6bf[_0xba72('0x20')](_0xba72('0x21'),_0x2d669a+'-'+_0x5d729e+'/'+_0x3b6fbb)['json'](_0x5b594f);}return null;};}function patchUpdates(_0x205335){return function(_0xe52a3c){try{jsonpatch[_0xba72('0x22')](_0xe52a3c,_0x205335,!![]);}catch(_0x49a53f){return BPromise['reject'](_0x49a53f);}return _0xe52a3c[_0xba72('0x23')]();};}function saveUpdates(_0x34dfd6,_0x4f0a50){return function(_0x247b27){if(_0x247b27){return _0x247b27['update'](_0x34dfd6)['then'](function(_0x42c864){return _0x42c864;});}return null;};}function removeEntity(_0x41fbec,_0x13e358){return function(_0x3a7edd){if(_0x3a7edd){return _0x3a7edd[_0xba72('0x24')]()['then'](function(){_0x41fbec[_0xba72('0x1a')](0xcc)[_0xba72('0x1b')]();});}};}function handleEntityNotFound(_0x2e99d8,_0x2ebeea){return function(_0x4a811e){if(!_0x4a811e){_0x2e99d8[_0xba72('0x19')](0x194);}return _0x4a811e;};}function handleError(_0x20cace,_0x143e7d){_0x143e7d=_0x143e7d||0x1f4;return function(_0x10efbd){logger[_0xba72('0x25')](_0x10efbd['stack']);if(_0x10efbd[_0xba72('0x26')]){delete _0x10efbd[_0xba72('0x26')];}_0x20cace[_0xba72('0x1a')](_0x143e7d)[_0xba72('0x27')](_0x10efbd);};}exports[_0xba72('0x28')]=function(_0x3e17b6,_0x1e2e03){var _0x4cda93={'raw':!![],'where':{'id':_0x3e17b6[_0xba72('0x29')]['id']}},_0x5e3fe={};_0x5e3fe[_0xba72('0x2a')]=_[_0xba72('0x2b')](db[_0xba72('0x2c')][_0xba72('0x2d')]);_0x5e3fe[_0xba72('0x2e')]=_[_0xba72('0x2b')](_0x3e17b6['query']);_0x5e3fe[_0xba72('0x2f')]=_[_0xba72('0x30')](_0x5e3fe[_0xba72('0x2a')],_0x5e3fe[_0xba72('0x2e')]);_0x4cda93['attributes']=_['intersection'](_0x5e3fe['model'],qs[_0xba72('0x31')](_0x3e17b6[_0xba72('0x2e')][_0xba72('0x31')]));_0x4cda93[_0xba72('0x32')]=_0x4cda93['attributes'][_0xba72('0x33')]?_0x4cda93['attributes']:_0x5e3fe[_0xba72('0x2a')];if(_0x3e17b6[_0xba72('0x2e')][_0xba72('0x34')]){_0x4cda93['include']=[{'all':!![]}];}_0x4cda93=_[_0xba72('0x35')]({},_0x4cda93,_0x3e17b6[_0xba72('0x36')]);return db['ChatApplication'][_0xba72('0x37')](_0x4cda93)['then'](handleEntityNotFound(_0x1e2e03,null))[_0xba72('0x38')](respondWithResult(_0x1e2e03,null))[_0xba72('0x39')](handleError(_0x1e2e03,null));};exports[_0xba72('0x3a')]=function(_0x40eb54,_0x1d88f0){if(_0x40eb54[_0xba72('0x3b')]['id']){delete _0x40eb54[_0xba72('0x3b')]['id'];}return db[_0xba72('0x2c')][_0xba72('0x37')]({'where':{'id':_0x40eb54[_0xba72('0x29')]['id']}})[_0xba72('0x38')](handleEntityNotFound(_0x1d88f0,null))[_0xba72('0x38')](saveUpdates(_0x40eb54[_0xba72('0x3b')],null))['then'](respondWithResult(_0x1d88f0,null))[_0xba72('0x39')](handleError(_0x1d88f0,null));};exports['destroy']=function(_0x2eb101,_0x3765a7){return db[_0xba72('0x2c')][_0xba72('0x37')]({'where':{'id':_0x2eb101[_0xba72('0x29')]['id']}})[_0xba72('0x38')](handleEntityNotFound(_0x3765a7,null))[_0xba72('0x38')](removeEntity(_0x3765a7,null))[_0xba72('0x39')](handleError(_0x3765a7,null));};
\ No newline at end of file
+var _0x5cec=['fields','length','includeAll','include','merge','find','catch','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','attributes'];(function(_0x1d2706,_0x4db46f){var _0x15448d=function(_0x4b8d33){while(--_0x4b8d33){_0x1d2706['push'](_0x1d2706['shift']());}};_0x15448d(++_0x4db46f);}(_0x5cec,0x83));var _0xc5ce=function(_0x49c7b3,_0x36eca7){_0x49c7b3=_0x49c7b3-0x0;var _0x37b0f3=_0x5cec[_0x49c7b3];return _0x37b0f3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc5ce('0x0'));var rimraf=require(_0xc5ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5ce('0x2'));var rp=require(_0xc5ce('0x3'));var moment=require(_0xc5ce('0x4'));var BPromise=require(_0xc5ce('0x5'));var Mustache=require(_0xc5ce('0x6'));var util=require(_0xc5ce('0x7'));var path=require(_0xc5ce('0x8'));var sox=require(_0xc5ce('0x9'));var csv=require('to-csv');var ejs=require(_0xc5ce('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc5ce('0xb'));var crypto=require(_0xc5ce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc5ce('0xd'));var toCsv=require(_0xc5ce('0xe'));var querystring=require(_0xc5ce('0xf'));var Papa=require(_0xc5ce('0x10'));var Redis=require('ioredis');var authService=require(_0xc5ce('0x11'));var qs=require(_0xc5ce('0x12'));var as=require(_0xc5ce('0x13'));var hardwareService=require(_0xc5ce('0x14'));var logger=require('../../config/logger')(_0xc5ce('0x15'));var utils=require(_0xc5ce('0x16'));var config=require(_0xc5ce('0x17'));var db=require(_0xc5ce('0x18'))['db'];function respondWithStatusCode(_0x4803c6,_0x364b37){_0x364b37=_0x364b37||0xcc;return function(_0x46d6ec){if(_0x46d6ec){return _0x4803c6[_0xc5ce('0x19')](_0x364b37);}return _0x4803c6['status'](_0x364b37)[_0xc5ce('0x1a')]();};}function respondWithResult(_0x48c5f6,_0x23adf9){_0x23adf9=_0x23adf9||0xc8;return function(_0x552d0b){if(_0x552d0b){return _0x48c5f6[_0xc5ce('0x1b')](_0x23adf9)['json'](_0x552d0b);}};}function respondWithFilteredResult(_0x2dc5c1,_0x26d104){return function(_0x171720){if(_0x171720){var _0x51f9e6=_0x171720[_0xc5ce('0x1c')],_0x50246f=_0x26d104[_0xc5ce('0x1d')],_0x491c93=_0x26d104[_0xc5ce('0x1d')]+_0x26d104[_0xc5ce('0x1e')],_0x34b62b;if(_0x491c93>=_0x51f9e6){_0x491c93=_0x51f9e6;_0x34b62b=0xc8;}else{_0x34b62b=0xce;}_0x2dc5c1[_0xc5ce('0x1b')](_0x34b62b);return _0x2dc5c1[_0xc5ce('0x1f')](_0xc5ce('0x20'),_0x50246f+'-'+_0x491c93+'/'+_0x51f9e6)[_0xc5ce('0x21')](_0x171720);}return null;};}function patchUpdates(_0x4c0334){return function(_0x301afd){try{jsonpatch[_0xc5ce('0x22')](_0x301afd,_0x4c0334,!![]);}catch(_0x5ed864){return BPromise[_0xc5ce('0x23')](_0x5ed864);}return _0x301afd[_0xc5ce('0x24')]();};}function saveUpdates(_0x3a53ed,_0x5d54c5){return function(_0x5344de){if(_0x5344de){return _0x5344de['update'](_0x3a53ed)[_0xc5ce('0x25')](function(_0x1e95e5){return _0x1e95e5;});}return null;};}function removeEntity(_0x4a4207,_0x312c1c){return function(_0x2475e5){if(_0x2475e5){return _0x2475e5[_0xc5ce('0x26')]()[_0xc5ce('0x25')](function(){_0x4a4207[_0xc5ce('0x1b')](0xcc)[_0xc5ce('0x1a')]();});}};}function handleEntityNotFound(_0x292fe3,_0x385a07){return function(_0x3248c4){if(!_0x3248c4){_0x292fe3[_0xc5ce('0x19')](0x194);}return _0x3248c4;};}function handleError(_0x54a5d2,_0x50ed7c){_0x50ed7c=_0x50ed7c||0x1f4;return function(_0x522ab8){logger[_0xc5ce('0x27')](_0x522ab8[_0xc5ce('0x28')]);if(_0x522ab8[_0xc5ce('0x29')]){delete _0x522ab8['name'];}_0x54a5d2[_0xc5ce('0x1b')](_0x50ed7c)[_0xc5ce('0x2a')](_0x522ab8);};}exports[_0xc5ce('0x2b')]=function(_0x953868,_0x208266){var _0xe48b1c={'raw':!![],'where':{'id':_0x953868[_0xc5ce('0x2c')]['id']}},_0x5a2b5f={};_0x5a2b5f[_0xc5ce('0x2d')]=_[_0xc5ce('0x2e')](db[_0xc5ce('0x2f')]['rawAttributes']);_0x5a2b5f[_0xc5ce('0x30')]=_[_0xc5ce('0x2e')](_0x953868[_0xc5ce('0x30')]);_0x5a2b5f[_0xc5ce('0x31')]=_[_0xc5ce('0x32')](_0x5a2b5f[_0xc5ce('0x2d')],_0x5a2b5f[_0xc5ce('0x30')]);_0xe48b1c[_0xc5ce('0x33')]=_[_0xc5ce('0x32')](_0x5a2b5f[_0xc5ce('0x2d')],qs[_0xc5ce('0x34')](_0x953868[_0xc5ce('0x30')][_0xc5ce('0x34')]));_0xe48b1c['attributes']=_0xe48b1c[_0xc5ce('0x33')][_0xc5ce('0x35')]?_0xe48b1c[_0xc5ce('0x33')]:_0x5a2b5f[_0xc5ce('0x2d')];if(_0x953868[_0xc5ce('0x30')][_0xc5ce('0x36')]){_0xe48b1c[_0xc5ce('0x37')]=[{'all':!![]}];}_0xe48b1c=_[_0xc5ce('0x38')]({},_0xe48b1c,_0x953868['options']);return db[_0xc5ce('0x2f')][_0xc5ce('0x39')](_0xe48b1c)[_0xc5ce('0x25')](handleEntityNotFound(_0x208266,null))[_0xc5ce('0x25')](respondWithResult(_0x208266,null))[_0xc5ce('0x3a')](handleError(_0x208266,null));};exports[_0xc5ce('0x3b')]=function(_0x4fce4e,_0x37b0e5){if(_0x4fce4e['body']['id']){delete _0x4fce4e[_0xc5ce('0x3c')]['id'];}return db[_0xc5ce('0x2f')][_0xc5ce('0x39')]({'where':{'id':_0x4fce4e['params']['id']}})[_0xc5ce('0x25')](handleEntityNotFound(_0x37b0e5,null))[_0xc5ce('0x25')](saveUpdates(_0x4fce4e[_0xc5ce('0x3c')],null))[_0xc5ce('0x25')](respondWithResult(_0x37b0e5,null))[_0xc5ce('0x3a')](handleError(_0x37b0e5,null));};exports[_0xc5ce('0x26')]=function(_0x3b9004,_0x79bb6f){return db['ChatApplication'][_0xc5ce('0x39')]({'where':{'id':_0x3b9004['params']['id']}})[_0xc5ce('0x25')](handleEntityNotFound(_0x79bb6f,null))['then'](removeEntity(_0x79bb6f,null))[_0xc5ce('0x3a')](handleError(_0x79bb6f,null));};
\ No newline at end of file
index 1ca8cf5..ad3467d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
index 0aa12bc..4fcba76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x993b=['ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x993b,0x1d5));var _0xb993=function(_0x245198,_0x1bad44){_0x245198=_0x245198-0x0;var _0x335918=_0x993b[_0x245198];return _0x335918;};'use strict';var _=require(_0xb993('0x0'));var util=require(_0xb993('0x1'));var moment=require(_0xb993('0x2'));var BPromise=require(_0xb993('0x3'));var rs=require(_0xb993('0x4'));var fs=require('fs');var Redis=require(_0xb993('0x5'));var db=require(_0xb993('0x6'))['db'];var utils=require(_0xb993('0x7'));var logger=require(_0xb993('0x8'))(_0xb993('0x9'));var config=require('../../config/environment');var jayson=require(_0xb993('0xa'));var client=jayson[_0xb993('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xea7356,_0x24b462,_0x305a48){return new BPromise(function(_0x1d032f,_0x3881d6){return client[_0xb993('0xc')](_0xea7356,_0x305a48)[_0xb993('0xd')](function(_0x1e1a3c){logger[_0xb993('0xe')](_0xb993('0xf'),_0x24b462,_0xb993('0x10'));logger['debug'](_0xb993('0x11'),_0x24b462,_0xb993('0x10'),JSON['stringify'](_0x1e1a3c));if(_0x1e1a3c[_0xb993('0x12')]){if(_0x1e1a3c[_0xb993('0x12')][_0xb993('0x13')]===0x1f4){logger[_0xb993('0x12')](_0xb993('0xf'),_0x24b462,_0x1e1a3c[_0xb993('0x12')][_0xb993('0x14')]);return _0x3881d6(_0x1e1a3c[_0xb993('0x12')]['message']);}logger[_0xb993('0x12')](_0xb993('0xf'),_0x24b462,_0x1e1a3c[_0xb993('0x12')][_0xb993('0x14')]);return _0x1d032f(_0x1e1a3c[_0xb993('0x12')][_0xb993('0x14')]);}else{logger[_0xb993('0xe')](_0xb993('0xf'),_0x24b462,'request\x20sent');_0x1d032f(_0x1e1a3c['result'][_0xb993('0x14')]);}})[_0xb993('0x15')](function(_0x4b1080){logger[_0xb993('0x12')](_0xb993('0xf'),_0x24b462,_0x4b1080);_0x3881d6(_0x4b1080);});});}
\ No newline at end of file
+var _0x451f=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x451f,0x11f));var _0xf451=function(_0x555dbf,_0x1041d7){_0x555dbf=_0x555dbf-0x0;var _0x8bd57e=_0x451f[_0x555dbf];return _0x8bd57e;};'use strict';var _=require(_0xf451('0x0'));var util=require(_0xf451('0x1'));var moment=require(_0xf451('0x2'));var BPromise=require('bluebird');var rs=require(_0xf451('0x3'));var fs=require('fs');var Redis=require(_0xf451('0x4'));var db=require(_0xf451('0x5'))['db'];var utils=require(_0xf451('0x6'));var logger=require(_0xf451('0x7'))(_0xf451('0x8'));var config=require('../../config/environment');var jayson=require(_0xf451('0x9'));var client=jayson[_0xf451('0xa')][_0xf451('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17cf85,_0x2a3acb,_0x5c8c53){return new BPromise(function(_0x50a644,_0x2d120a){return client[_0xf451('0xc')](_0x17cf85,_0x5c8c53)[_0xf451('0xd')](function(_0x55d493){logger['info'](_0xf451('0xe'),_0x2a3acb,_0xf451('0xf'));logger[_0xf451('0x10')](_0xf451('0x11'),_0x2a3acb,_0xf451('0xf'),JSON[_0xf451('0x12')](_0x55d493));if(_0x55d493[_0xf451('0x13')]){if(_0x55d493[_0xf451('0x13')][_0xf451('0x14')]===0x1f4){logger['error'](_0xf451('0xe'),_0x2a3acb,_0x55d493['error'][_0xf451('0x15')]);return _0x2d120a(_0x55d493['error'][_0xf451('0x15')]);}logger[_0xf451('0x13')](_0xf451('0xe'),_0x2a3acb,_0x55d493['error'][_0xf451('0x15')]);return _0x50a644(_0x55d493['error'][_0xf451('0x15')]);}else{logger['info'](_0xf451('0xe'),_0x2a3acb,'request\x20sent');_0x50a644(_0x55d493[_0xf451('0x16')][_0xf451('0x15')]);}})[_0xf451('0x17')](function(_0x5026f5){logger[_0xf451('0x13')]('ChatApplication,\x20%s,\x20%s',_0x2a3acb,_0x5026f5);_0x2d120a(_0x5026f5);});});}
\ No newline at end of file
index 6064f53..538e5cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d3a=['exports','util','connect-timeout','express','Router','../../components/interaction/service','get','/:id','show','put','isAuthenticated','update'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7d3a,0xd9));var _0xa7d3=function(_0x4b485b,_0x509ebd){_0x4b485b=_0x4b485b-0x0;var _0xd3281f=_0x7d3a[_0x4b485b];return _0xd3281f;};'use strict';var multer=require('multer');var util=require(_0xa7d3('0x0'));var path=require('path');var timeout=require(_0xa7d3('0x1'));var express=require(_0xa7d3('0x2'));var router=express[_0xa7d3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa7d3('0x4'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xa7d3('0x5')](_0xa7d3('0x6'),auth['isAuthenticated'](),controller[_0xa7d3('0x7')]);router[_0xa7d3('0x8')](_0xa7d3('0x6'),auth[_0xa7d3('0x9')](),controller[_0xa7d3('0xa')]);router['delete'](_0xa7d3('0x6'),auth[_0xa7d3('0x9')](),controller['destroy']);module[_0xa7d3('0xb')]=router;
\ No newline at end of file
+var _0x03e5=['get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x12953d,_0x51b9f2){var _0x21fc78=function(_0x466ce0){while(--_0x466ce0){_0x12953d['push'](_0x12953d['shift']());}};_0x21fc78(++_0x51b9f2);}(_0x03e5,0x128));var _0x503e=function(_0x34b787,_0x288d0a){_0x34b787=_0x34b787-0x0;var _0x19e0e2=_0x03e5[_0x34b787];return _0x19e0e2;};'use strict';var multer=require(_0x503e('0x0'));var util=require(_0x503e('0x1'));var path=require(_0x503e('0x2'));var timeout=require(_0x503e('0x3'));var express=require(_0x503e('0x4'));var router=express[_0x503e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x503e('0x6'));var config=require(_0x503e('0x7'));var controller=require('./chatApplication.controller');router[_0x503e('0x8')](_0x503e('0x9'),auth[_0x503e('0xa')](),controller['show']);router[_0x503e('0xb')](_0x503e('0x9'),auth[_0x503e('0xa')](),controller[_0x503e('0xc')]);router[_0x503e('0xd')](_0x503e('0x9'),auth[_0x503e('0xa')](),controller[_0x503e('0xe')]);module[_0x503e('0xf')]=router;
\ No newline at end of file
index 904154e..a5d734f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6216=['exports','STRING','BOOLEAN'];(function(_0x3392b6,_0x3385f8){var _0xfeb640=function(_0x1277f0){while(--_0x1277f0){_0x3392b6['push'](_0x3392b6['shift']());}};_0xfeb640(++_0x3385f8);}(_0x6216,0x18f));var _0x6621=function(_0x5e4134,_0x1a1c27){_0x5e4134=_0x5e4134-0x0;var _0x529994=_0x6216[_0x5e4134];return _0x529994;};'use strict';var Sequelize=require('sequelize');module[_0x6621('0x0')]={'name':{'type':Sequelize[_0x6621('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6621('0x1')]},'write':{'type':Sequelize[_0x6621('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x19e9=['sequelize','exports','BOOLEAN'];(function(_0xb22623,_0x3a406f){var _0x231de9=function(_0x2817ef){while(--_0x2817ef){_0xb22623['push'](_0xb22623['shift']());}};_0x231de9(++_0x3a406f);}(_0x19e9,0x132));var _0x919e=function(_0x324cfa,_0x1a7165){_0x324cfa=_0x324cfa-0x0;var _0x485c38=_0x19e9[_0x324cfa];return _0x485c38;};'use strict';var Sequelize=require(_0x919e('0x0'));module[_0x919e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x919e('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 97344f2..45a77d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1708=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','localhost','./chatGroup.socket','register','jayson/promise','client','test','ValidationError','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','stack','name','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','length','removeMembers','addMessage','ChatGroupId','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring'];(function(_0x229e62,_0x1dd3b){var _0x5b86b1=function(_0x3df13e){while(--_0x3df13e){_0x229e62['push'](_0x229e62['shift']());}};_0x5b86b1(++_0x1dd3b);}(_0x1708,0xc5));var _0x8170=function(_0x3a8789,_0x5bb70b){_0x3a8789=_0x3a8789-0x0;var _0x19e422=_0x1708[_0x3a8789];return _0x19e422;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8170('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8170('0x1'));var jsonpatch=require(_0x8170('0x2'));var rp=require(_0x8170('0x3'));var moment=require(_0x8170('0x4'));var BPromise=require(_0x8170('0x5'));var Mustache=require(_0x8170('0x6'));var util=require(_0x8170('0x7'));var path=require('path');var sox=require(_0x8170('0x8'));var csv=require(_0x8170('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8170('0xa'));var crypto=require(_0x8170('0xb'));var jsforce=require(_0x8170('0xc'));var deskjs=require(_0x8170('0xd'));var toCsv=require(_0x8170('0x9'));var querystring=require(_0x8170('0xe'));var Papa=require('papaparse');var Redis=require(_0x8170('0xf'));var authService=require(_0x8170('0x10'));var qs=require(_0x8170('0x11'));var as=require(_0x8170('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8170('0x13'))(_0x8170('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8170('0x15'))['db'];config[_0x8170('0x16')]=_['defaults'](config[_0x8170('0x16')],{'host':_0x8170('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8170('0x16')]));require(_0x8170('0x18'))[_0x8170('0x19')](socket);var jayson=require(_0x8170('0x1a'));var client=jayson[_0x8170('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x24875a,_0x4b5f0a,_0x119957){if(_0x119957){var _0x182d2d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x182d2d[_0x8170('0x1c')](_0x4b5f0a)){return _0x24875a;}else{throw new db['Sequelize'][(_0x8170('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x24875a;}}function respondWithRpcPromise(_0x506d0a,_0x3206dc,_0x24b189,_0x1058bc){return new BPromise(function(_0xffafee,_0x39cff9){var _0x4e8a0c=_0x1058bc||client;return _0x4e8a0c[_0x8170('0x1e')](_0x506d0a,_0x24b189)[_0x8170('0x1f')](function(_0xa1098a){logger[_0x8170('0x20')](_0x8170('0x21'),_0x3206dc,'request\x20sent');logger[_0x8170('0x22')](_0x8170('0x23'),_0x3206dc,_0x8170('0x24'),JSON[_0x8170('0x25')](_0xa1098a));if(_0xa1098a['error']){if(_0xa1098a['error'][_0x8170('0x26')]===0x1f4){logger['error'](_0x8170('0x21'),_0x3206dc,_0xa1098a[_0x8170('0x27')][_0x8170('0x28')]);return _0x39cff9(_0xa1098a[_0x8170('0x27')]['message']);}logger[_0x8170('0x27')]('ChatGroup,\x20%s,\x20%s',_0x3206dc,_0xa1098a['error']['message']);return _0xffafee(_0xa1098a[_0x8170('0x27')][_0x8170('0x28')]);}else{logger[_0x8170('0x20')]('ChatGroup,\x20%s,\x20%s',_0x3206dc,_0x8170('0x24'));_0xffafee(_0xa1098a['result']['message']);}})[_0x8170('0x29')](function(_0x5beeb7){logger['error'](_0x8170('0x21'),_0x3206dc,_0x5beeb7);_0x39cff9(_0x5beeb7);});});}function respondWithStatusCode(_0x56e8bc,_0x41d53c){_0x41d53c=_0x41d53c||0xcc;return function(_0x390860){if(_0x390860){return _0x56e8bc[_0x8170('0x2a')](_0x41d53c);}return _0x56e8bc[_0x8170('0x2b')](_0x41d53c)[_0x8170('0x2c')]();};}function respondWithResult(_0x2d5df3,_0x7e346d){_0x7e346d=_0x7e346d||0xc8;return function(_0x22e101){if(_0x22e101){return _0x2d5df3[_0x8170('0x2b')](_0x7e346d)['json'](_0x22e101);}};}function respondWithFilteredResult(_0x26c308,_0xf03c5f){return function(_0x283676){if(_0x283676){var _0x86e442=_0x283676[_0x8170('0x2d')],_0x2d5f12=_0xf03c5f['offset'],_0x67e68c=_0xf03c5f[_0x8170('0x2e')]+_0xf03c5f[_0x8170('0x2f')],_0x347af6;if(_0x67e68c>=_0x86e442){_0x67e68c=_0x86e442;_0x347af6=0xc8;}else{_0x347af6=0xce;}_0x26c308[_0x8170('0x2b')](_0x347af6);return _0x26c308[_0x8170('0x30')](_0x8170('0x31'),_0x2d5f12+'-'+_0x67e68c+'/'+_0x86e442)[_0x8170('0x32')](_0x283676);}return null;};}function patchUpdates(_0x22b0ef){return function(_0xfc11bd){try{jsonpatch[_0x8170('0x33')](_0xfc11bd,_0x22b0ef,!![]);}catch(_0x8ddbab){return BPromise['reject'](_0x8ddbab);}return _0xfc11bd[_0x8170('0x34')]();};}function saveUpdates(_0x21464d,_0x6a7638){return function(_0xca1b7a){if(_0xca1b7a){return _0xca1b7a[_0x8170('0x35')](_0x21464d)[_0x8170('0x1f')](function(_0x53fe4f){return _0x53fe4f;});}return null;};}function removeEntity(_0x2ebc8b,_0x10b971){return function(_0x4a963a){if(_0x4a963a){return _0x4a963a[_0x8170('0x36')]()[_0x8170('0x1f')](function(){_0x2ebc8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x204fcf,_0x4a47e9){return function(_0x5eca57){if(!_0x5eca57){_0x204fcf['sendStatus'](0x194);}return _0x5eca57;};}function handleError(_0x1c6082,_0x21280b){_0x21280b=_0x21280b||0x1f4;return function(_0x2ed6cc){logger['error'](_0x2ed6cc[_0x8170('0x37')]);if(_0x2ed6cc[_0x8170('0x38')]){delete _0x2ed6cc['name'];}_0x1c6082[_0x8170('0x2b')](_0x21280b)['send'](_0x2ed6cc);};}exports[_0x8170('0x39')]=function(_0xb7e881,_0x4094b6){var _0x5beabf={},_0x173095={},_0x49a8d1={'count':0x0,'rows':[]};var _0x54ad22=_['map'](db[_0x8170('0x3a')][_0x8170('0x3b')],function(_0x4277d6){return{'name':_0x4277d6[_0x8170('0x3c')],'type':_0x4277d6[_0x8170('0x3d')][_0x8170('0x3e')]};});_0x173095[_0x8170('0x3f')]=_[_0x8170('0x40')](_0x54ad22,_0x8170('0x38'));_0x173095[_0x8170('0x41')]=_[_0x8170('0x42')](_0xb7e881[_0x8170('0x41')]);_0x173095['filters']=_[_0x8170('0x43')](_0x173095['model'],_0x173095['query']);_0x5beabf[_0x8170('0x44')]=_[_0x8170('0x43')](_0x173095[_0x8170('0x3f')],qs['fields'](_0xb7e881['query'][_0x8170('0x45')]));_0x5beabf[_0x8170('0x44')]=_0x5beabf[_0x8170('0x44')]['length']?_0x5beabf[_0x8170('0x44')]:_0x173095[_0x8170('0x3f')];if(!_0xb7e881[_0x8170('0x41')][_0x8170('0x46')](_0x8170('0x47'))){_0x5beabf[_0x8170('0x2f')]=qs[_0x8170('0x2f')](_0xb7e881['query']['limit']);_0x5beabf['offset']=qs[_0x8170('0x2e')](_0xb7e881['query'][_0x8170('0x2e')]);}_0x5beabf[_0x8170('0x48')]=qs[_0x8170('0x49')](_0xb7e881[_0x8170('0x41')][_0x8170('0x49')]);_0x5beabf[_0x8170('0x4a')]=qs[_0x8170('0x4b')](_[_0x8170('0x4c')](_0xb7e881[_0x8170('0x41')],_0x173095[_0x8170('0x4b')]),_0x54ad22);if(_0xb7e881[_0x8170('0x41')][_0x8170('0x4d')]){_0x5beabf[_0x8170('0x4a')]=_['merge'](_0x5beabf['where'],{'$or':_[_0x8170('0x40')](_0x54ad22,function(_0xf436b9){if(_0xf436b9['type']!==_0x8170('0x4e')){var _0x3ee396={};_0x3ee396[_0xf436b9[_0x8170('0x38')]]={'$like':'%'+_0xb7e881[_0x8170('0x41')]['filter']+'%'};return _0x3ee396;}})});}_0x5beabf=_[_0x8170('0x4f')]({},_0x5beabf,_0xb7e881['options']);var _0x487590={'where':_0x5beabf['where']};return db['ChatGroup']['count'](_0x487590)[_0x8170('0x1f')](function(_0x1f4756){_0x49a8d1[_0x8170('0x2d')]=_0x1f4756;if(_0xb7e881[_0x8170('0x41')][_0x8170('0x50')]){_0x5beabf[_0x8170('0x51')]=[{'all':!![]}];}return db['ChatGroup'][_0x8170('0x52')](_0x5beabf);})['then'](function(_0x3f9a25){_0x49a8d1[_0x8170('0x53')]=_0x3f9a25;return _0x49a8d1;})[_0x8170('0x1f')](respondWithFilteredResult(_0x4094b6,_0x5beabf))[_0x8170('0x29')](handleError(_0x4094b6,null));};exports[_0x8170('0x54')]=function(_0x2b88c7,_0x5a00df){var _0x53cf06={'raw':!![],'where':{'id':_0x2b88c7[_0x8170('0x55')]['id']}},_0x57b62d={};_0x57b62d['model']=_[_0x8170('0x42')](db[_0x8170('0x3a')][_0x8170('0x3b')]);_0x57b62d['query']=_[_0x8170('0x42')](_0x2b88c7[_0x8170('0x41')]);_0x57b62d[_0x8170('0x4b')]=_[_0x8170('0x43')](_0x57b62d[_0x8170('0x3f')],_0x57b62d[_0x8170('0x41')]);_0x53cf06[_0x8170('0x44')]=_['intersection'](_0x57b62d['model'],qs['fields'](_0x2b88c7[_0x8170('0x41')][_0x8170('0x45')]));_0x53cf06['attributes']=_0x53cf06[_0x8170('0x44')]['length']?_0x53cf06[_0x8170('0x44')]:_0x57b62d['model'];if(_0x2b88c7[_0x8170('0x41')]['includeAll']){_0x53cf06[_0x8170('0x51')]=[{'all':!![]}];}_0x53cf06=_['merge']({},_0x53cf06,_0x2b88c7[_0x8170('0x56')]);return db['ChatGroup'][_0x8170('0x57')](_0x53cf06)[_0x8170('0x1f')](handleEntityNotFound(_0x5a00df,null))[_0x8170('0x1f')](respondWithResult(_0x5a00df,null))[_0x8170('0x29')](handleError(_0x5a00df,null));};exports[_0x8170('0x58')]=function(_0x19664b,_0x21f0fc){return db['ChatGroup'][_0x8170('0x58')](_0x19664b[_0x8170('0x59')],{})['then'](respondWithResult(_0x21f0fc,0xc9))[_0x8170('0x29')](handleError(_0x21f0fc,null));};exports['update']=function(_0x9d2528,_0x3cc041){if(_0x9d2528['body']['id']){delete _0x9d2528[_0x8170('0x59')]['id'];}return db[_0x8170('0x3a')][_0x8170('0x57')]({'where':{'id':_0x9d2528['params']['id']}})[_0x8170('0x1f')](handleEntityNotFound(_0x3cc041,null))[_0x8170('0x1f')](saveUpdates(_0x9d2528[_0x8170('0x59')],null))[_0x8170('0x1f')](respondWithResult(_0x3cc041,null))[_0x8170('0x29')](handleError(_0x3cc041,null));};exports[_0x8170('0x36')]=function(_0x44abcf,_0x40e887){return db[_0x8170('0x3a')][_0x8170('0x57')]({'where':{'id':_0x44abcf[_0x8170('0x55')]['id']}})[_0x8170('0x1f')](handleEntityNotFound(_0x40e887,null))[_0x8170('0x1f')](removeEntity(_0x40e887,null))[_0x8170('0x29')](handleError(_0x40e887,null));};exports[_0x8170('0x5a')]=function(_0x3bd39f,_0x140da0){return db[_0x8170('0x3a')][_0x8170('0x5a')]()[_0x8170('0x1f')](respondWithResult(_0x140da0,null))[_0x8170('0x29')](handleError(_0x140da0,null));};exports['getUnread']=function(_0x1ee062,_0x4595d4,_0x35694c){return db[_0x8170('0x5b')][_0x8170('0x2d')]({'where':{'ChatGroupId':_0x1ee062[_0x8170('0x55')]['id'],'ToId':_0x1ee062[_0x8170('0x5c')]['id'],'read':![]}})['then'](function(_0x324041){return{'id':_[_0x8170('0x5d')](_0x1ee062[_0x8170('0x55')]['id']),'count':_0x324041};})[_0x8170('0x1f')](respondWithResult(_0x4595d4,null))['catch'](handleError(_0x4595d4,null));};exports[_0x8170('0x5e')]=function(_0x3e1776,_0x2331e2,_0x599d2f){return db[_0x8170('0x3a')][_0x8170('0x57')]({'where':{'id':_0x3e1776[_0x8170('0x55')]['id']}})[_0x8170('0x1f')](handleEntityNotFound(_0x2331e2,null))[_0x8170('0x1f')](function(_0x1be4b6){if(_0x1be4b6){return _0x1be4b6[_0x8170('0x5e')](_0x3e1776[_0x8170('0x59')][_0x8170('0x5f')],_[_0x8170('0x60')](_0x3e1776[_0x8170('0x59')],[_0x8170('0x5f'),'id'])||{});}})[_0x8170('0x1f')](respondWithResult(_0x2331e2,null))[_0x8170('0x29')](handleError(_0x2331e2,null));};exports[_0x8170('0x61')]=function(_0x2c6f9a,_0x48e536,_0x55a74a){var _0x41b220={};var _0x572687={};var _0x2c703a;var _0x3906f8;return db[_0x8170('0x3a')][_0x8170('0x62')]({'where':{'id':_0x2c6f9a[_0x8170('0x55')]['id']}})[_0x8170('0x1f')](handleEntityNotFound(_0x48e536,null))['then'](function(_0x3b7976){if(_0x3b7976){_0x2c703a=_0x3b7976;_0x572687['model']=_[_0x8170('0x42')](db['User'][_0x8170('0x3b')]);_0x572687[_0x8170('0x41')]=_['keys'](_0x2c6f9a[_0x8170('0x41')]);_0x572687[_0x8170('0x4b')]=_[_0x8170('0x43')](_0x572687['model'],_0x572687[_0x8170('0x41')]);_0x41b220['attributes']=_[_0x8170('0x43')](_0x572687[_0x8170('0x3f')],qs[_0x8170('0x45')](_0x2c6f9a[_0x8170('0x41')][_0x8170('0x45')]));_0x41b220[_0x8170('0x44')]=_0x41b220[_0x8170('0x44')][_0x8170('0x63')]?_0x41b220[_0x8170('0x44')]:_0x572687[_0x8170('0x3f')];_0x41b220['order']=qs[_0x8170('0x49')](_0x2c6f9a[_0x8170('0x41')][_0x8170('0x49')]);_0x41b220['where']=qs[_0x8170('0x4b')](_[_0x8170('0x4c')](_0x2c6f9a[_0x8170('0x41')],_0x572687[_0x8170('0x4b')]));if(_0x2c6f9a[_0x8170('0x41')]['filter']){_0x41b220['where']=_[_0x8170('0x4f')](_0x41b220[_0x8170('0x4a')],{'$or':_['map'](_0x41b220['attributes'],function(_0x72dda5){var _0x4932bb={};_0x4932bb[_0x72dda5]={'$like':'%'+_0x2c6f9a[_0x8170('0x41')][_0x8170('0x4d')]+'%'};return _0x4932bb;})});}_0x41b220=_[_0x8170('0x4f')]({},_0x41b220,_0x2c6f9a[_0x8170('0x56')]);return _0x2c703a[_0x8170('0x61')](_0x41b220);}})[_0x8170('0x1f')](function(_0x3c3cb8){if(_0x3c3cb8){_0x3906f8=_0x3c3cb8[_0x8170('0x63')];if(!_0x2c6f9a[_0x8170('0x41')][_0x8170('0x46')](_0x8170('0x47'))){_0x41b220[_0x8170('0x2f')]=qs[_0x8170('0x2f')](_0x2c6f9a['query'][_0x8170('0x2f')]);_0x41b220[_0x8170('0x2e')]=qs[_0x8170('0x2e')](_0x2c6f9a[_0x8170('0x41')][_0x8170('0x2e')]);}return _0x2c703a[_0x8170('0x61')](_0x41b220);}})[_0x8170('0x1f')](function(_0x547407){if(_0x547407){return _0x547407?{'count':_0x3906f8,'rows':_0x547407}:null;}})[_0x8170('0x1f')](respondWithResult(_0x48e536,null))['catch'](handleError(_0x48e536,null));};exports['removeMembers']=function(_0x49e3fd,_0x3314dd,_0x4977be){return db[_0x8170('0x3a')][_0x8170('0x57')]({'where':{'id':_0x49e3fd['params']['id']}})[_0x8170('0x1f')](handleEntityNotFound(_0x3314dd,null))[_0x8170('0x1f')](function(_0x33b005){if(_0x33b005){return _0x33b005[_0x8170('0x64')](_0x49e3fd[_0x8170('0x41')][_0x8170('0x5f')]);}})[_0x8170('0x1f')](respondWithStatusCode(_0x3314dd,null))['catch'](handleError(_0x3314dd,null));};exports[_0x8170('0x65')]=function(_0x5c3744,_0x21cb8e,_0x13cd77){if(_0x5c3744['body']['id']){delete _0x5c3744['body']['id'];}return db[_0x8170('0x3a')][_0x8170('0x57')]({'where':{'id':_0x5c3744[_0x8170('0x55')]['id']}})[_0x8170('0x1f')](handleEntityNotFound(_0x21cb8e,null))[_0x8170('0x1f')](function(_0x4782f0){if(_0x4782f0){_0x5c3744[_0x8170('0x59')][_0x8170('0x66')]=_0x4782f0['id'];return db[_0x8170('0x5b')][_0x8170('0x58')](_0x5c3744[_0x8170('0x59')]);}})[_0x8170('0x1f')](respondWithResult(_0x21cb8e,null))[_0x8170('0x29')](handleError(_0x21cb8e,null));};exports[_0x8170('0x67')]=function(_0x197a76,_0x38c278,_0x26a89e){var _0x13c392={};var _0xf8b468={};var _0x56ba41;var _0x44f061;return db[_0x8170('0x3a')]['findOne']({'where':{'id':_0x197a76['params']['id']}})[_0x8170('0x1f')](handleEntityNotFound(_0x38c278,null))[_0x8170('0x1f')](function(_0x23380a){if(_0x23380a){_0x56ba41=_0x23380a;_0xf8b468['model']=_[_0x8170('0x42')](db[_0x8170('0x5b')]['rawAttributes']);_0xf8b468[_0x8170('0x41')]=_[_0x8170('0x42')](_0x197a76[_0x8170('0x41')]);_0xf8b468[_0x8170('0x4b')]=_[_0x8170('0x43')](_0xf8b468['model'],_0xf8b468['query']);_0x13c392['attributes']=_[_0x8170('0x43')](_0xf8b468[_0x8170('0x3f')],qs[_0x8170('0x45')](_0x197a76[_0x8170('0x41')][_0x8170('0x45')]));_0x13c392['attributes']=_0x13c392[_0x8170('0x44')][_0x8170('0x63')]?_0x13c392[_0x8170('0x44')]:_0xf8b468['model'];_0x13c392[_0x8170('0x48')]=qs[_0x8170('0x49')](_0x197a76[_0x8170('0x41')][_0x8170('0x49')]);_0x13c392[_0x8170('0x4a')]=qs[_0x8170('0x4b')](_['pick'](_0x197a76[_0x8170('0x41')],_0xf8b468['filters']));if(_0x197a76[_0x8170('0x41')][_0x8170('0x4d')]){_0x13c392['where']=_[_0x8170('0x4f')](_0x13c392[_0x8170('0x4a')],{'$or':_[_0x8170('0x40')](_0x13c392[_0x8170('0x44')],function(_0x12ebdb){var _0xfd0e6e={};_0xfd0e6e[_0x12ebdb]={'$like':'%'+_0x197a76[_0x8170('0x41')][_0x8170('0x4d')]+'%'};return _0xfd0e6e;})});}if(_0x197a76['query']['$gte']){var _0x975d95=_0x197a76[_0x8170('0x41')]['$gte']['split'](',');var _0xf44dae={};_0xf44dae[_0x975d95[0x0]]={'$gte':moment(_0x975d95[0x1])[_0x8170('0x68')](_0x8170('0x69'))};_0x13c392[_0x8170('0x4a')]=_[_0x8170('0x4f')](_0x13c392['where'],_0xf44dae);}_0x13c392=_[_0x8170('0x4f')]({},_0x13c392,_0x197a76[_0x8170('0x56')]);return _0x56ba41['getMessages'](_0x13c392);}})[_0x8170('0x1f')](function(_0x222b12){if(_0x222b12){_0x44f061=_0x222b12[_0x8170('0x63')];if(!_0x197a76['query'][_0x8170('0x46')](_0x8170('0x47'))){_0x13c392[_0x8170('0x2f')]=qs[_0x8170('0x2f')](_0x197a76[_0x8170('0x41')][_0x8170('0x2f')]);_0x13c392[_0x8170('0x2e')]=qs[_0x8170('0x2e')](_0x197a76['query']['offset']);}return _0x56ba41[_0x8170('0x67')](_0x13c392);}})[_0x8170('0x1f')](function(_0x256e69){if(_0x256e69){return _0x256e69?{'count':_0x44f061,'rows':_0x256e69}:null;}})['then'](respondWithResult(_0x38c278,null))['catch'](handleError(_0x38c278,null));};
\ No newline at end of file
+var _0x73cf=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','end','json','count','offset','apply','reject','update','destroy','then','status','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','ChatGroup','includeAll','include','params','options','catch','body','find','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','order','pick','removeMembers','ChatGroupId','create','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x566f5c,_0x483232){var _0x59dcb7=function(_0x4e8b00){while(--_0x4e8b00){_0x566f5c['push'](_0x566f5c['shift']());}};_0x59dcb7(++_0x483232);}(_0x73cf,0x139));var _0xf73c=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x73cf[_0x55e08b];return _0xd1a7ff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf73c('0x0'));var rimraf=require(_0xf73c('0x1'));var zipdir=require(_0xf73c('0x2'));var jsonpatch=require(_0xf73c('0x3'));var rp=require('request-promise');var moment=require(_0xf73c('0x4'));var BPromise=require(_0xf73c('0x5'));var Mustache=require(_0xf73c('0x6'));var util=require(_0xf73c('0x7'));var path=require(_0xf73c('0x8'));var sox=require(_0xf73c('0x9'));var csv=require(_0xf73c('0xa'));var ejs=require(_0xf73c('0xb'));var fs=require('fs');var _=require(_0xf73c('0xc'));var squel=require(_0xf73c('0xd'));var crypto=require(_0xf73c('0xe'));var jsforce=require(_0xf73c('0xf'));var deskjs=require(_0xf73c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf73c('0x11'));var Papa=require(_0xf73c('0x12'));var Redis=require(_0xf73c('0x13'));var authService=require(_0xf73c('0x14'));var qs=require(_0xf73c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf73c('0x16'))(_0xf73c('0x17'));var utils=require(_0xf73c('0x18'));var config=require(_0xf73c('0x19'));var db=require(_0xf73c('0x1a'))['db'];config[_0xf73c('0x1b')]=_[_0xf73c('0x1c')](config[_0xf73c('0x1b')],{'host':_0xf73c('0x1d'),'port':0x18eb});var socket=require(_0xf73c('0x1e'))(new Redis(config[_0xf73c('0x1b')]));require('./chatGroup.socket')[_0xf73c('0x1f')](socket);var jayson=require(_0xf73c('0x20'));var client=jayson[_0xf73c('0x21')]['http']({'port':0x232a});function checkPasswordPattern(_0x2aca89,_0x4975ef,_0x3154d7){if(_0x3154d7){var _0x335524=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x335524[_0xf73c('0x22')](_0x4975ef)){return _0x2aca89;}else{throw new db[(_0xf73c('0x23'))]['ValidationError'](_0xf73c('0x24'));}}else{return _0x2aca89;}}function respondWithRpcPromise(_0x50f8ab,_0xc0866c,_0x353bce,_0x2dd581){return new BPromise(function(_0x42d9f9,_0x49b0f4){var _0x556ce8=_0x2dd581||client;return _0x556ce8[_0xf73c('0x25')](_0x50f8ab,_0x353bce)['then'](function(_0x37b14e){logger['info'](_0xf73c('0x26'),_0xc0866c,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0xc0866c,_0xf73c('0x27'),JSON[_0xf73c('0x28')](_0x37b14e));if(_0x37b14e[_0xf73c('0x29')]){if(_0x37b14e[_0xf73c('0x29')][_0xf73c('0x2a')]===0x1f4){logger[_0xf73c('0x29')]('ChatGroup,\x20%s,\x20%s',_0xc0866c,_0x37b14e['error'][_0xf73c('0x2b')]);return _0x49b0f4(_0x37b14e['error'][_0xf73c('0x2b')]);}logger[_0xf73c('0x29')]('ChatGroup,\x20%s,\x20%s',_0xc0866c,_0x37b14e[_0xf73c('0x29')][_0xf73c('0x2b')]);return _0x42d9f9(_0x37b14e[_0xf73c('0x29')][_0xf73c('0x2b')]);}else{logger['info'](_0xf73c('0x26'),_0xc0866c,'request\x20sent');_0x42d9f9(_0x37b14e[_0xf73c('0x2c')]['message']);}})['catch'](function(_0x223184){logger['error'](_0xf73c('0x26'),_0xc0866c,_0x223184);_0x49b0f4(_0x223184);});});}function respondWithStatusCode(_0x2829e0,_0x106430){_0x106430=_0x106430||0xcc;return function(_0x4e10c7){if(_0x4e10c7){return _0x2829e0['sendStatus'](_0x106430);}return _0x2829e0['status'](_0x106430)[_0xf73c('0x2d')]();};}function respondWithResult(_0x7cf73f,_0x26596b){_0x26596b=_0x26596b||0xc8;return function(_0xd689fe){if(_0xd689fe){return _0x7cf73f['status'](_0x26596b)[_0xf73c('0x2e')](_0xd689fe);}};}function respondWithFilteredResult(_0x4db2e5,_0x293ead){return function(_0x25507c){if(_0x25507c){var _0xbd41a0=_0x25507c[_0xf73c('0x2f')],_0x4c67cf=_0x293ead[_0xf73c('0x30')],_0x1c9ccb=_0x293ead['offset']+_0x293ead['limit'],_0x3760f1;if(_0x1c9ccb>=_0xbd41a0){_0x1c9ccb=_0xbd41a0;_0x3760f1=0xc8;}else{_0x3760f1=0xce;}_0x4db2e5['status'](_0x3760f1);return _0x4db2e5['set']('Content-Range',_0x4c67cf+'-'+_0x1c9ccb+'/'+_0xbd41a0)['json'](_0x25507c);}return null;};}function patchUpdates(_0x181712){return function(_0x57d50c){try{jsonpatch[_0xf73c('0x31')](_0x57d50c,_0x181712,!![]);}catch(_0x3f20c4){return BPromise[_0xf73c('0x32')](_0x3f20c4);}return _0x57d50c['save']();};}function saveUpdates(_0x54bb88,_0x1cb6e9){return function(_0x90b50e){if(_0x90b50e){return _0x90b50e[_0xf73c('0x33')](_0x54bb88)['then'](function(_0x18e1ae){return _0x18e1ae;});}return null;};}function removeEntity(_0xa1c8a5,_0x19dc8d){return function(_0x36a869){if(_0x36a869){return _0x36a869[_0xf73c('0x34')]()[_0xf73c('0x35')](function(){_0xa1c8a5[_0xf73c('0x36')](0xcc)[_0xf73c('0x2d')]();});}};}function handleEntityNotFound(_0xe2b864,_0x459515){return function(_0x2c5b58){if(!_0x2c5b58){_0xe2b864[_0xf73c('0x37')](0x194);}return _0x2c5b58;};}function handleError(_0x50c459,_0x5e3aa0){_0x5e3aa0=_0x5e3aa0||0x1f4;return function(_0x1a518f){logger[_0xf73c('0x29')](_0x1a518f[_0xf73c('0x38')]);if(_0x1a518f[_0xf73c('0x39')]){delete _0x1a518f[_0xf73c('0x39')];}_0x50c459[_0xf73c('0x36')](_0x5e3aa0)[_0xf73c('0x3a')](_0x1a518f);};}exports[_0xf73c('0x3b')]=function(_0x1658c8,_0x215919){var _0x4e4317={},_0x3b9c95={},_0x50622d={'count':0x0,'rows':[]};var _0x4faea2=_[_0xf73c('0x3c')](db['ChatGroup'][_0xf73c('0x3d')],function(_0xe0010b){return{'name':_0xe0010b[_0xf73c('0x3e')],'type':_0xe0010b[_0xf73c('0x3f')][_0xf73c('0x40')]};});_0x3b9c95['model']=_['map'](_0x4faea2,'name');_0x3b9c95[_0xf73c('0x41')]=_[_0xf73c('0x42')](_0x1658c8[_0xf73c('0x41')]);_0x3b9c95[_0xf73c('0x43')]=_[_0xf73c('0x44')](_0x3b9c95[_0xf73c('0x45')],_0x3b9c95[_0xf73c('0x41')]);_0x4e4317[_0xf73c('0x46')]=_['intersection'](_0x3b9c95['model'],qs[_0xf73c('0x47')](_0x1658c8[_0xf73c('0x41')]['fields']));_0x4e4317['attributes']=_0x4e4317[_0xf73c('0x46')][_0xf73c('0x48')]?_0x4e4317[_0xf73c('0x46')]:_0x3b9c95[_0xf73c('0x45')];if(!_0x1658c8[_0xf73c('0x41')][_0xf73c('0x49')](_0xf73c('0x4a'))){_0x4e4317['limit']=qs[_0xf73c('0x4b')](_0x1658c8[_0xf73c('0x41')][_0xf73c('0x4b')]);_0x4e4317[_0xf73c('0x30')]=qs['offset'](_0x1658c8['query']['offset']);}_0x4e4317['order']=qs[_0xf73c('0x4c')](_0x1658c8['query'][_0xf73c('0x4c')]);_0x4e4317[_0xf73c('0x4d')]=qs[_0xf73c('0x43')](_['pick'](_0x1658c8[_0xf73c('0x41')],_0x3b9c95['filters']),_0x4faea2);if(_0x1658c8['query'][_0xf73c('0x4e')]){_0x4e4317[_0xf73c('0x4d')]=_[_0xf73c('0x4f')](_0x4e4317['where'],{'$or':_[_0xf73c('0x3c')](_0x4faea2,function(_0x58c01b){if(_0x58c01b[_0xf73c('0x3f')]!==_0xf73c('0x50')){var _0x19905a={};_0x19905a[_0x58c01b[_0xf73c('0x39')]]={'$like':'%'+_0x1658c8[_0xf73c('0x41')][_0xf73c('0x4e')]+'%'};return _0x19905a;}})});}_0x4e4317=_['merge']({},_0x4e4317,_0x1658c8['options']);var _0xac9a52={'where':_0x4e4317[_0xf73c('0x4d')]};return db[_0xf73c('0x51')][_0xf73c('0x2f')](_0xac9a52)[_0xf73c('0x35')](function(_0x30fad6){_0x50622d[_0xf73c('0x2f')]=_0x30fad6;if(_0x1658c8[_0xf73c('0x41')][_0xf73c('0x52')]){_0x4e4317[_0xf73c('0x53')]=[{'all':!![]}];}return db[_0xf73c('0x51')]['findAll'](_0x4e4317);})[_0xf73c('0x35')](function(_0x571764){_0x50622d['rows']=_0x571764;return _0x50622d;})['then'](respondWithFilteredResult(_0x215919,_0x4e4317))['catch'](handleError(_0x215919,null));};exports['show']=function(_0x42e423,_0x16dc9c){var _0x28868b={'raw':!![],'where':{'id':_0x42e423[_0xf73c('0x54')]['id']}},_0x127184={};_0x127184[_0xf73c('0x45')]=_['keys'](db[_0xf73c('0x51')]['rawAttributes']);_0x127184[_0xf73c('0x41')]=_[_0xf73c('0x42')](_0x42e423[_0xf73c('0x41')]);_0x127184[_0xf73c('0x43')]=_[_0xf73c('0x44')](_0x127184[_0xf73c('0x45')],_0x127184[_0xf73c('0x41')]);_0x28868b[_0xf73c('0x46')]=_[_0xf73c('0x44')](_0x127184[_0xf73c('0x45')],qs[_0xf73c('0x47')](_0x42e423[_0xf73c('0x41')][_0xf73c('0x47')]));_0x28868b[_0xf73c('0x46')]=_0x28868b[_0xf73c('0x46')][_0xf73c('0x48')]?_0x28868b[_0xf73c('0x46')]:_0x127184[_0xf73c('0x45')];if(_0x42e423[_0xf73c('0x41')][_0xf73c('0x52')]){_0x28868b[_0xf73c('0x53')]=[{'all':!![]}];}_0x28868b=_[_0xf73c('0x4f')]({},_0x28868b,_0x42e423[_0xf73c('0x55')]);return db[_0xf73c('0x51')]['find'](_0x28868b)[_0xf73c('0x35')](handleEntityNotFound(_0x16dc9c,null))[_0xf73c('0x35')](respondWithResult(_0x16dc9c,null))[_0xf73c('0x56')](handleError(_0x16dc9c,null));};exports['create']=function(_0x48d1fa,_0x37c1dc){return db[_0xf73c('0x51')]['create'](_0x48d1fa['body'],{})[_0xf73c('0x35')](respondWithResult(_0x37c1dc,0xc9))['catch'](handleError(_0x37c1dc,null));};exports[_0xf73c('0x33')]=function(_0x278184,_0x56697d){if(_0x278184[_0xf73c('0x57')]['id']){delete _0x278184[_0xf73c('0x57')]['id'];}return db[_0xf73c('0x51')][_0xf73c('0x58')]({'where':{'id':_0x278184['params']['id']}})[_0xf73c('0x35')](handleEntityNotFound(_0x56697d,null))[_0xf73c('0x35')](saveUpdates(_0x278184['body'],null))[_0xf73c('0x35')](respondWithResult(_0x56697d,null))[_0xf73c('0x56')](handleError(_0x56697d,null));};exports[_0xf73c('0x34')]=function(_0x3f7fac,_0x419f47){return db[_0xf73c('0x51')]['find']({'where':{'id':_0x3f7fac[_0xf73c('0x54')]['id']}})[_0xf73c('0x35')](handleEntityNotFound(_0x419f47,null))[_0xf73c('0x35')](removeEntity(_0x419f47,null))['catch'](handleError(_0x419f47,null));};exports[_0xf73c('0x59')]=function(_0x50097b,_0x361c3e){return db[_0xf73c('0x51')]['describe']()[_0xf73c('0x35')](respondWithResult(_0x361c3e,null))[_0xf73c('0x56')](handleError(_0x361c3e,null));};exports[_0xf73c('0x5a')]=function(_0x54c895,_0x172be4,_0x40b655){return db[_0xf73c('0x5b')]['count']({'where':{'ChatGroupId':_0x54c895[_0xf73c('0x54')]['id'],'ToId':_0x54c895[_0xf73c('0x5c')]['id'],'read':![]}})[_0xf73c('0x35')](function(_0x1e160e){return{'id':_['toInteger'](_0x54c895['params']['id']),'count':_0x1e160e};})[_0xf73c('0x35')](respondWithResult(_0x172be4,null))[_0xf73c('0x56')](handleError(_0x172be4,null));};exports[_0xf73c('0x5d')]=function(_0x234e9f,_0x32f9ff,_0x1bde3d){return db['ChatGroup']['find']({'where':{'id':_0x234e9f[_0xf73c('0x54')]['id']}})[_0xf73c('0x35')](handleEntityNotFound(_0x32f9ff,null))[_0xf73c('0x35')](function(_0x5356a3){if(_0x5356a3){return _0x5356a3[_0xf73c('0x5d')](_0x234e9f[_0xf73c('0x57')][_0xf73c('0x5e')],_[_0xf73c('0x5f')](_0x234e9f[_0xf73c('0x57')],[_0xf73c('0x5e'),'id'])||{});}})[_0xf73c('0x35')](respondWithResult(_0x32f9ff,null))['catch'](handleError(_0x32f9ff,null));};exports[_0xf73c('0x60')]=function(_0x2bd0e1,_0x16553c,_0x2d0d94){var _0x43a009={};var _0x4e890d={};var _0x37b152;var _0x21518b;return db[_0xf73c('0x51')][_0xf73c('0x61')]({'where':{'id':_0x2bd0e1[_0xf73c('0x54')]['id']}})[_0xf73c('0x35')](handleEntityNotFound(_0x16553c,null))[_0xf73c('0x35')](function(_0x4148e7){if(_0x4148e7){_0x37b152=_0x4148e7;_0x4e890d[_0xf73c('0x45')]=_[_0xf73c('0x42')](db[_0xf73c('0x62')][_0xf73c('0x3d')]);_0x4e890d['query']=_[_0xf73c('0x42')](_0x2bd0e1['query']);_0x4e890d[_0xf73c('0x43')]=_[_0xf73c('0x44')](_0x4e890d[_0xf73c('0x45')],_0x4e890d['query']);_0x43a009[_0xf73c('0x46')]=_['intersection'](_0x4e890d[_0xf73c('0x45')],qs[_0xf73c('0x47')](_0x2bd0e1['query'][_0xf73c('0x47')]));_0x43a009[_0xf73c('0x46')]=_0x43a009[_0xf73c('0x46')]['length']?_0x43a009[_0xf73c('0x46')]:_0x4e890d[_0xf73c('0x45')];_0x43a009[_0xf73c('0x63')]=qs[_0xf73c('0x4c')](_0x2bd0e1['query'][_0xf73c('0x4c')]);_0x43a009['where']=qs[_0xf73c('0x43')](_[_0xf73c('0x64')](_0x2bd0e1[_0xf73c('0x41')],_0x4e890d[_0xf73c('0x43')]));if(_0x2bd0e1['query'][_0xf73c('0x4e')]){_0x43a009['where']=_['merge'](_0x43a009['where'],{'$or':_[_0xf73c('0x3c')](_0x43a009['attributes'],function(_0x17859c){var _0x54d9f6={};_0x54d9f6[_0x17859c]={'$like':'%'+_0x2bd0e1[_0xf73c('0x41')][_0xf73c('0x4e')]+'%'};return _0x54d9f6;})});}_0x43a009=_['merge']({},_0x43a009,_0x2bd0e1[_0xf73c('0x55')]);return _0x37b152[_0xf73c('0x60')](_0x43a009);}})['then'](function(_0x7a921b){if(_0x7a921b){_0x21518b=_0x7a921b[_0xf73c('0x48')];if(!_0x2bd0e1[_0xf73c('0x41')][_0xf73c('0x49')]('nolimit')){_0x43a009[_0xf73c('0x4b')]=qs[_0xf73c('0x4b')](_0x2bd0e1[_0xf73c('0x41')][_0xf73c('0x4b')]);_0x43a009['offset']=qs[_0xf73c('0x30')](_0x2bd0e1[_0xf73c('0x41')][_0xf73c('0x30')]);}return _0x37b152[_0xf73c('0x60')](_0x43a009);}})[_0xf73c('0x35')](function(_0x5bcc4c){if(_0x5bcc4c){return _0x5bcc4c?{'count':_0x21518b,'rows':_0x5bcc4c}:null;}})[_0xf73c('0x35')](respondWithResult(_0x16553c,null))[_0xf73c('0x56')](handleError(_0x16553c,null));};exports[_0xf73c('0x65')]=function(_0x11f44f,_0x4287f2,_0x26a4c8){return db[_0xf73c('0x51')]['find']({'where':{'id':_0x11f44f['params']['id']}})[_0xf73c('0x35')](handleEntityNotFound(_0x4287f2,null))[_0xf73c('0x35')](function(_0x416d7f){if(_0x416d7f){return _0x416d7f[_0xf73c('0x65')](_0x11f44f[_0xf73c('0x41')][_0xf73c('0x5e')]);}})[_0xf73c('0x35')](respondWithStatusCode(_0x4287f2,null))[_0xf73c('0x56')](handleError(_0x4287f2,null));};exports['addMessage']=function(_0x3785f0,_0x4b022e,_0x4a7fa5){if(_0x3785f0[_0xf73c('0x57')]['id']){delete _0x3785f0['body']['id'];}return db['ChatGroup'][_0xf73c('0x58')]({'where':{'id':_0x3785f0[_0xf73c('0x54')]['id']}})[_0xf73c('0x35')](handleEntityNotFound(_0x4b022e,null))[_0xf73c('0x35')](function(_0x4159f2){if(_0x4159f2){_0x3785f0['body'][_0xf73c('0x66')]=_0x4159f2['id'];return db['ChatInternalMessage'][_0xf73c('0x67')](_0x3785f0['body']);}})[_0xf73c('0x35')](respondWithResult(_0x4b022e,null))[_0xf73c('0x56')](handleError(_0x4b022e,null));};exports[_0xf73c('0x68')]=function(_0x22bfb8,_0xdf3a0d,_0x366181){var _0x1d390d={};var _0x195daa={};var _0x507731;var _0x22ca97;return db[_0xf73c('0x51')][_0xf73c('0x61')]({'where':{'id':_0x22bfb8[_0xf73c('0x54')]['id']}})['then'](handleEntityNotFound(_0xdf3a0d,null))[_0xf73c('0x35')](function(_0x31c29a){if(_0x31c29a){_0x507731=_0x31c29a;_0x195daa[_0xf73c('0x45')]=_[_0xf73c('0x42')](db[_0xf73c('0x5b')][_0xf73c('0x3d')]);_0x195daa['query']=_[_0xf73c('0x42')](_0x22bfb8['query']);_0x195daa[_0xf73c('0x43')]=_['intersection'](_0x195daa[_0xf73c('0x45')],_0x195daa['query']);_0x1d390d[_0xf73c('0x46')]=_[_0xf73c('0x44')](_0x195daa[_0xf73c('0x45')],qs[_0xf73c('0x47')](_0x22bfb8[_0xf73c('0x41')]['fields']));_0x1d390d['attributes']=_0x1d390d[_0xf73c('0x46')][_0xf73c('0x48')]?_0x1d390d[_0xf73c('0x46')]:_0x195daa['model'];_0x1d390d['order']=qs[_0xf73c('0x4c')](_0x22bfb8[_0xf73c('0x41')]['sort']);_0x1d390d[_0xf73c('0x4d')]=qs[_0xf73c('0x43')](_[_0xf73c('0x64')](_0x22bfb8['query'],_0x195daa[_0xf73c('0x43')]));if(_0x22bfb8['query'][_0xf73c('0x4e')]){_0x1d390d[_0xf73c('0x4d')]=_['merge'](_0x1d390d[_0xf73c('0x4d')],{'$or':_['map'](_0x1d390d[_0xf73c('0x46')],function(_0x4301c2){var _0x3f548c={};_0x3f548c[_0x4301c2]={'$like':'%'+_0x22bfb8['query'][_0xf73c('0x4e')]+'%'};return _0x3f548c;})});}if(_0x22bfb8[_0xf73c('0x41')][_0xf73c('0x69')]){var _0x447ff9=_0x22bfb8[_0xf73c('0x41')][_0xf73c('0x69')][_0xf73c('0x6a')](',');var _0x4ea22d={};_0x4ea22d[_0x447ff9[0x0]]={'$gte':moment(_0x447ff9[0x1])['format'](_0xf73c('0x6b'))};_0x1d390d['where']=_[_0xf73c('0x4f')](_0x1d390d[_0xf73c('0x4d')],_0x4ea22d);}_0x1d390d=_['merge']({},_0x1d390d,_0x22bfb8[_0xf73c('0x55')]);return _0x507731[_0xf73c('0x68')](_0x1d390d);}})['then'](function(_0x540687){if(_0x540687){_0x22ca97=_0x540687[_0xf73c('0x48')];if(!_0x22bfb8[_0xf73c('0x41')]['hasOwnProperty']('nolimit')){_0x1d390d[_0xf73c('0x4b')]=qs['limit'](_0x22bfb8[_0xf73c('0x41')][_0xf73c('0x4b')]);_0x1d390d[_0xf73c('0x30')]=qs['offset'](_0x22bfb8[_0xf73c('0x41')][_0xf73c('0x30')]);}return _0x507731[_0xf73c('0x68')](_0x1d390d);}})[_0xf73c('0x35')](function(_0x32260e){if(_0x32260e){return _0x32260e?{'count':_0x22ca97,'rows':_0x32260e}:null;}})['then'](respondWithResult(_0xdf3a0d,null))[_0xf73c('0x56')](handleError(_0xdf3a0d,null));};
\ No newline at end of file
index a6893a3..cc1364c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x2cbd35,_0x568616){var _0x285926=function(_0x59a87f){while(--_0x59a87f){_0x2cbd35['push'](_0x2cbd35['shift']());}};_0x285926(++_0x568616);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbc5c0c,_0x330004){_0xbc5c0c=_0xbc5c0c-0x0;var _0x244f6e=_0x5f2f[_0xbc5c0c];return _0x244f6e;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatGroup=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatGroupEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatGroupEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatGroup[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x2032=['exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x2032,0xd9));var _0x2203=function(_0x26f266,_0x9e9b26){_0x26f266=_0x26f266-0x0;var _0x549196=_0x2032[_0x26f266];return _0x549196;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];ChatGroup[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=ChatGroupEvents;
\ No newline at end of file
index 8cdcc64..c91bcde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26cf=['../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','util'];(function(_0x319784,_0x47e6d4){var _0x1917da=function(_0x2cb921){while(--_0x2cb921){_0x319784['push'](_0x319784['shift']());}};_0x1917da(++_0x47e6d4);}(_0x26cf,0x135));var _0xf26c=function(_0x4db025,_0xf06db4){_0x4db025=_0x4db025-0x0;var _0x44f2d5=_0x26cf[_0x4db025];return _0x44f2d5;};'use strict';var _=require('lodash');var util=require(_0xf26c('0x0'));var logger=require(_0xf26c('0x1'))('api');var moment=require(_0xf26c('0x2'));var BPromise=require('bluebird');var rp=require(_0xf26c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf26c('0x4'));var config=require(_0xf26c('0x5'));var attributes=require('./chatGroup.attributes');module[_0xf26c('0x6')]=function(_0x10638a,_0x32d4ef){return _0x10638a[_0xf26c('0x7')](_0xf26c('0x8'),attributes,{'tableName':_0xf26c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5178=['rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0x5178,0x171));var _0x8517=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5178[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var logger=require(_0x8517('0x1'))(_0x8517('0x2'));var moment=require(_0x8517('0x3'));var BPromise=require(_0x8517('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var attributes=require('./chatGroup.attributes');module[_0x8517('0x7')]=function(_0x58ed7e,_0x13ba05){return _0x58ed7e[_0x8517('0x8')](_0x8517('0x9'),attributes,{'tableName':_0x8517('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 11d69d9..714e6ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbd7=['redis','defaults','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e5790,_0x5f000c){var _0x5adac8=function(_0x1d4a3a){while(--_0x1d4a3a){_0x2e5790['push'](_0x2e5790['shift']());}};_0x5adac8(++_0x5f000c);}(_0xbbd7,0xd5));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7bbd('0x0'));var util=require('util');var moment=require(_0x7bbd('0x1'));var BPromise=require(_0x7bbd('0x2'));var rs=require(_0x7bbd('0x3'));var fs=require('fs');var Redis=require(_0x7bbd('0x4'));var db=require(_0x7bbd('0x5'))['db'];var utils=require(_0x7bbd('0x6'));var logger=require(_0x7bbd('0x7'))(_0x7bbd('0x8'));var config=require(_0x7bbd('0x9'));var jayson=require(_0x7bbd('0xa'));var client=jayson[_0x7bbd('0xb')]['http']({'port':0x232a});config[_0x7bbd('0xc')]=_[_0x7bbd('0xd')](config[_0x7bbd('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bbd('0xe'))(new Redis(config[_0x7bbd('0xc')]));require('./chatGroup.socket')[_0x7bbd('0xf')](socket);function respondWithRpcPromise(_0x5849fa,_0x5a2056,_0x1420a7){return new BPromise(function(_0x345233,_0x1e60ff){return client['request'](_0x5849fa,_0x1420a7)[_0x7bbd('0x10')](function(_0x59abe6){logger[_0x7bbd('0x11')](_0x7bbd('0x12'),_0x5a2056,_0x7bbd('0x13'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5a2056,'request\x20sent',JSON[_0x7bbd('0x14')](_0x59abe6));if(_0x59abe6[_0x7bbd('0x15')]){if(_0x59abe6['error'][_0x7bbd('0x16')]===0x1f4){logger['error'](_0x7bbd('0x12'),_0x5a2056,_0x59abe6[_0x7bbd('0x15')][_0x7bbd('0x17')]);return _0x1e60ff(_0x59abe6[_0x7bbd('0x15')]['message']);}logger[_0x7bbd('0x15')](_0x7bbd('0x12'),_0x5a2056,_0x59abe6[_0x7bbd('0x15')]['message']);return _0x345233(_0x59abe6[_0x7bbd('0x15')][_0x7bbd('0x17')]);}else{logger['info'](_0x7bbd('0x12'),_0x5a2056,_0x7bbd('0x13'));_0x345233(_0x59abe6[_0x7bbd('0x18')]['message']);}})['catch'](function(_0x53f744){logger[_0x7bbd('0x15')](_0x7bbd('0x12'),_0x5a2056,_0x53f744);_0x1e60ff(_0x53f744);});});}
\ No newline at end of file
+var _0xdc41=['request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xdc41,0x15a));var _0x1dc4=function(_0x432102,_0x20fe75){_0x432102=_0x432102-0x0;var _0x14a49b=_0xdc41[_0x432102];return _0x14a49b;};'use strict';var _=require(_0x1dc4('0x0'));var util=require(_0x1dc4('0x1'));var moment=require(_0x1dc4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dc4('0x3'));var db=require(_0x1dc4('0x4'))['db'];var utils=require(_0x1dc4('0x5'));var logger=require(_0x1dc4('0x6'))('rpc');var config=require(_0x1dc4('0x7'));var jayson=require(_0x1dc4('0x8'));var client=jayson['client'][_0x1dc4('0x9')]({'port':0x232a});config[_0x1dc4('0xa')]=_[_0x1dc4('0xb')](config[_0x1dc4('0xa')],{'host':_0x1dc4('0xc'),'port':0x18eb});var socket=require(_0x1dc4('0xd'))(new Redis(config[_0x1dc4('0xa')]));require(_0x1dc4('0xe'))[_0x1dc4('0xf')](socket);function respondWithRpcPromise(_0x24c76d,_0x308eb8,_0x228278){return new BPromise(function(_0x2623a7,_0x460d2a){return client['request'](_0x24c76d,_0x228278)['then'](function(_0x2b3cc2){logger[_0x1dc4('0x10')](_0x1dc4('0x11'),_0x308eb8,_0x1dc4('0x12'));logger['debug'](_0x1dc4('0x13'),_0x308eb8,_0x1dc4('0x12'),JSON[_0x1dc4('0x14')](_0x2b3cc2));if(_0x2b3cc2[_0x1dc4('0x15')]){if(_0x2b3cc2[_0x1dc4('0x15')][_0x1dc4('0x16')]===0x1f4){logger['error'](_0x1dc4('0x11'),_0x308eb8,_0x2b3cc2[_0x1dc4('0x15')][_0x1dc4('0x17')]);return _0x460d2a(_0x2b3cc2[_0x1dc4('0x15')]['message']);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x308eb8,_0x2b3cc2[_0x1dc4('0x15')]['message']);return _0x2623a7(_0x2b3cc2[_0x1dc4('0x15')][_0x1dc4('0x17')]);}else{logger['info'](_0x1dc4('0x11'),_0x308eb8,_0x1dc4('0x12'));_0x2623a7(_0x2b3cc2[_0x1dc4('0x18')][_0x1dc4('0x17')]);}})[_0x1dc4('0x19')](function(_0x3339fb){logger['error']('ChatGroup,\x20%s,\x20%s',_0x308eb8,_0x3339fb);_0x460d2a(_0x3339fb);});});}
\ No newline at end of file
index 1e5dfb5..05f7a28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x336f=['save','remove','update','register','length'];(function(_0x11b66f,_0x21cef6){var _0x4bc40d=function(_0x16e269){while(--_0x16e269){_0x11b66f['push'](_0x11b66f['shift']());}};_0x4bc40d(++_0x21cef6);}(_0x336f,0x186));var _0xf336=function(_0x4ec309,_0x83d763){_0x4ec309=_0x4ec309-0x0;var _0x3e1e27=_0x336f[_0x4ec309];return _0x3e1e27;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xf336('0x0'),_0xf336('0x1'),_0xf336('0x2')];function createListener(_0x5975e6,_0x435eed){return function(_0x1293f3){_0x435eed['emit'](_0x5975e6,_0x1293f3);};}function removeListener(_0x32fc54,_0x222f0b){return function(){ChatGroupEvents['removeListener'](_0x32fc54,_0x222f0b);};}exports[_0xf336('0x3')]=function(_0x5b459f){for(var _0x3a67c7=0x0,_0x1eaf88=events[_0xf336('0x4')];_0x3a67c7<_0x1eaf88;_0x3a67c7++){var _0x207102=events[_0x3a67c7];var _0x5d645e=createListener('chatGroup:'+_0x207102,_0x5b459f);ChatGroupEvents['on'](_0x207102,_0x5d645e);}};
\ No newline at end of file
+var _0x2300=['register','length','update','emit'];(function(_0x341a9c,_0x40d4de){var _0x229267=function(_0x33688e){while(--_0x33688e){_0x341a9c['push'](_0x341a9c['shift']());}};_0x229267(++_0x40d4de);}(_0x2300,0x18a));var _0x0230=function(_0x1d02a4,_0x4dd377){_0x1d02a4=_0x1d02a4-0x0;var _0x5c4f38=_0x2300[_0x1d02a4];return _0x5c4f38;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save','remove',_0x0230('0x0')];function createListener(_0x9626d3,_0x50f261){return function(_0xbfe8c6){_0x50f261[_0x0230('0x1')](_0x9626d3,_0xbfe8c6);};}function removeListener(_0x33fc69,_0x6cc04a){return function(){ChatGroupEvents['removeListener'](_0x33fc69,_0x6cc04a);};}exports[_0x0230('0x2')]=function(_0xd08206){for(var _0x216721=0x0,_0x398265=events[_0x0230('0x3')];_0x216721<_0x398265;_0x216721++){var _0x33c560=events[_0x216721];var _0x16ee1b=createListener('chatGroup:'+_0x33c560,_0xd08206);ChatGroupEvents['on'](_0x33c560,_0x16ee1b);}};
\ No newline at end of file
index 6831720..a7859b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd72=['destroy','removeMembers','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','delete'];(function(_0x4bf50f,_0x578e28){var _0x559a54=function(_0x91f49a){while(--_0x91f49a){_0x4bf50f['push'](_0x4bf50f['shift']());}};_0x559a54(++_0x578e28);}(_0xcd72,0x1f1));var _0x2cd7=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xcd72[_0x1b6c6d];return _0x290d9d;};'use strict';var multer=require('multer');var util=require(_0x2cd7('0x0'));var path=require(_0x2cd7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2cd7('0x2')]();var auth=require(_0x2cd7('0x3'));var interaction=require(_0x2cd7('0x4'));var config=require('../../config/environment');var controller=require(_0x2cd7('0x5'));router[_0x2cd7('0x6')]('/',auth[_0x2cd7('0x7')](),controller['index']);router['get'](_0x2cd7('0x8'),auth[_0x2cd7('0x7')](),controller[_0x2cd7('0x9')]);router['get'](_0x2cd7('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2cd7('0xb'),auth[_0x2cd7('0x7')](),controller['getUnread']);router[_0x2cd7('0x6')](_0x2cd7('0xc'),auth[_0x2cd7('0x7')](),controller[_0x2cd7('0xd')]);router['get'](_0x2cd7('0xe'),auth[_0x2cd7('0x7')](),controller[_0x2cd7('0xf')]);router['post']('/',auth[_0x2cd7('0x7')](),controller[_0x2cd7('0x10')]);router[_0x2cd7('0x11')](_0x2cd7('0xc'),auth[_0x2cd7('0x7')](),controller[_0x2cd7('0x12')]);router[_0x2cd7('0x11')](_0x2cd7('0xe'),auth[_0x2cd7('0x7')](),controller[_0x2cd7('0x13')]);router[_0x2cd7('0x14')](_0x2cd7('0xa'),auth['isAuthenticated'](),controller[_0x2cd7('0x15')]);router[_0x2cd7('0x16')](_0x2cd7('0xa'),auth[_0x2cd7('0x7')](),controller[_0x2cd7('0x17')]);router[_0x2cd7('0x16')](_0x2cd7('0xc'),auth[_0x2cd7('0x7')](),controller[_0x2cd7('0x18')]);module[_0x2cd7('0x19')]=router;
\ No newline at end of file
+var _0xb669=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','addMembers','put','/:id','update','delete','removeMembers','exports','util','express','Router'];(function(_0x89bddd,_0x5c50e8){var _0x3a10e6=function(_0x2c887f){while(--_0x2c887f){_0x89bddd['push'](_0x89bddd['shift']());}};_0x3a10e6(++_0x5c50e8);}(_0xb669,0x1c9));var _0x9b66=function(_0x1d5fca,_0x29d0c0){_0x1d5fca=_0x1d5fca-0x0;var _0x11f8b0=_0xb669[_0x1d5fca];return _0x11f8b0;};'use strict';var multer=require('multer');var util=require(_0x9b66('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9b66('0x1'));var router=express[_0x9b66('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9b66('0x3'));var controller=require(_0x9b66('0x4'));router[_0x9b66('0x5')]('/',auth[_0x9b66('0x6')](),controller[_0x9b66('0x7')]);router['get'](_0x9b66('0x8'),auth['isAuthenticated'](),controller[_0x9b66('0x9')]);router['get']('/:id',auth[_0x9b66('0x6')](),controller['show']);router[_0x9b66('0x5')](_0x9b66('0xa'),auth[_0x9b66('0x6')](),controller[_0x9b66('0xb')]);router[_0x9b66('0x5')](_0x9b66('0xc'),auth[_0x9b66('0x6')](),controller['getMembers']);router['get'](_0x9b66('0xd'),auth[_0x9b66('0x6')](),controller[_0x9b66('0xe')]);router[_0x9b66('0xf')]('/',auth[_0x9b66('0x6')](),controller['create']);router[_0x9b66('0xf')](_0x9b66('0xc'),auth[_0x9b66('0x6')](),controller[_0x9b66('0x10')]);router[_0x9b66('0xf')](_0x9b66('0xd'),auth[_0x9b66('0x6')](),controller['addMessage']);router[_0x9b66('0x11')](_0x9b66('0x12'),auth[_0x9b66('0x6')](),controller[_0x9b66('0x13')]);router[_0x9b66('0x14')](_0x9b66('0x12'),auth[_0x9b66('0x6')](),controller['destroy']);router[_0x9b66('0x14')](_0x9b66('0xc'),auth[_0x9b66('0x6')](),controller[_0x9b66('0x15')]);module[_0x9b66('0x16')]=router;
\ No newline at end of file
index 3f9c86b..2ea4377 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7049=['DATE','long','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x7049,0x1d8));var _0x9704=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x7049[_0x710815];return _0x5b3b89;};'use strict';var Sequelize=require(_0x9704('0x0'));module[_0x9704('0x1')]={'closed':{'type':Sequelize[_0x9704('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x9704('0x3')](_0x9704('0x4'),_0x9704('0x5')),'defaultValue':_0x9704('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x9704('0x6')]},'mailTranscript':{'type':Sequelize[_0x9704('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9704('0x8')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9704('0x7')]},'browserName':{'type':Sequelize[_0x9704('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x9704('0x7')]},'osVersion':{'type':Sequelize[_0x9704('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x9704('0x7')]},'deviceType':{'type':Sequelize[_0x9704('0x7')]},'referer':{'type':Sequelize[_0x9704('0x6')]},'customerIp':{'type':Sequelize[_0x9704('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x9704('0x9'))},'read1stAt':{'type':Sequelize[_0x9704('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9704('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9704('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x9704('0x6')]}};
\ No newline at end of file
+var _0xf0fd=['star','thumb','TEXT','STRING','DATE','long','ENUM','out','sequelize','BOOLEAN'];(function(_0x5de967,_0x515918){var _0x5b07a3=function(_0x563020){while(--_0x563020){_0x5de967['push'](_0x5de967['shift']());}};_0x5b07a3(++_0x515918);}(_0xf0fd,0x102));var _0xdf0f=function(_0xe7c9bc,_0x23e87a){_0xe7c9bc=_0xe7c9bc-0x0;var _0x281921=_0xf0fd[_0xe7c9bc];return _0x281921;};'use strict';var Sequelize=require(_0xdf0f('0x0'));module['exports']={'closed':{'type':Sequelize[_0xdf0f('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0xdf0f('0x2'),_0xdf0f('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xdf0f('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xdf0f('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdf0f('0x6')]},'disposition':{'type':Sequelize[_0xdf0f('0x5')]},'note':{'type':Sequelize[_0xdf0f('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xdf0f('0x5')]},'osName':{'type':Sequelize[_0xdf0f('0x5')]},'osVersion':{'type':Sequelize[_0xdf0f('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xdf0f('0x5')]},'deviceType':{'type':Sequelize[_0xdf0f('0x5')]},'referer':{'type':Sequelize[_0xdf0f('0x4')]},'customerIp':{'type':Sequelize[_0xdf0f('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xdf0f('0x7'))},'read1stAt':{'type':Sequelize[_0xdf0f('0x6')]},'lastMsgAt':{'type':Sequelize[_0xdf0f('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xdf0f('0x8')]('in',_0xdf0f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xdf0f('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xdf0f('0x4')]}};
\ No newline at end of file
index 0e1850f..227c9ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['field','color','from','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','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?','buildExpression','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','end','some','compact','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','fields','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.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.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','includeAll','include','merge','create','body','params','describe','createVidaooSession','findOne','vidaooEscalation','vidaooApiKey','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','Unauthorized','Attachment','download','root','server/files/attachments/','mailTranscript','join','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','ChatWebsite','ChatWebsiteId','CmContact','ContactId','agentAlias','System','%s%d','Visitor','agentIdentifier','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','email','Mail\x20Transcript','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','options','count','findAll','getMyMessages','secret','includeAgent','alias','setTags','spread','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','createdAt','Owner','get','mkdirSync','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','30px','<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','%s\x20#%d','Chat','YYYY-MM-DD','Account','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','pipe','firstName','out','renderFile','views','downloadInteraction.html','.pdf','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../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','./chatInteraction.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','debug','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','status','json','offset','set','Content-Range','apply','update','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','push','index','map','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','select'];(function(_0x299e1e,_0x20eab5){var _0x3757dc=function(_0x211535){while(--_0x211535){_0x299e1e['push'](_0x299e1e['shift']());}};_0x3757dc(++_0x20eab5);}(_0x5204,0xdf));var _0x4520=function(_0x584291,_0x24b5b3){_0x584291=_0x584291-0x0;var _0x4e7d08=_0x5204[_0x584291];return _0x4e7d08;};'use strict';var pdf=require(_0x4520('0x0'));var emlformat=require(_0x4520('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4520('0x2'));var jsonpatch=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var moment=require(_0x4520('0x5'));var BPromise=require(_0x4520('0x6'));var Mustache=require('mustache');var util=require(_0x4520('0x7'));var path=require('path');var sox=require(_0x4520('0x8'));var csv=require(_0x4520('0x9'));var ejs=require(_0x4520('0xa'));var fs=require('fs');var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x9'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var hardwareService=require(_0x4520('0x14'));var logger=require(_0x4520('0x15'))(_0x4520('0x16'));var utils=require(_0x4520('0x17'));var config=require(_0x4520('0x18'));var db=require(_0x4520('0x19'))['db'];config[_0x4520('0x1a')]=_[_0x4520('0x1b')](config[_0x4520('0x1a')],{'host':_0x4520('0x1c'),'port':0x18eb});var socket=require(_0x4520('0x1d'))(new Redis(config[_0x4520('0x1a')]));require(_0x4520('0x1e'))[_0x4520('0x1f')](socket);var jayson=require(_0x4520('0x20'));var client=jayson[_0x4520('0x21')]['http']({'port':0x232b});var client9004=jayson[_0x4520('0x21')][_0x4520('0x22')]({'port':0x232c});function checkPasswordPattern(_0x1ab841,_0x15a31f,_0x32d8aa){if(_0x32d8aa){var _0x51d85f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x51d85f[_0x4520('0x23')](_0x15a31f)){return _0x1ab841;}else{throw new db[(_0x4520('0x24'))][(_0x4520('0x25'))](_0x4520('0x26'));}}else{return _0x1ab841;}}function respondWithRpcPromise(_0x1b8b0f,_0x2e00f4,_0x1dcf51,_0x4ba69f){return new BPromise(function(_0x3791b6,_0x11eaea){var _0x398dd2=_0x4ba69f||client;return _0x398dd2[_0x4520('0x27')](_0x1b8b0f,_0x1dcf51)['then'](function(_0xc016a3){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x2e00f4,'request\x20sent');logger[_0x4520('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2e00f4,_0x4520('0x29'),JSON[_0x4520('0x2a')](_0xc016a3));if(_0xc016a3[_0x4520('0x2b')]){if(_0xc016a3['error'][_0x4520('0x2c')]===0x1f4){logger[_0x4520('0x2b')](_0x4520('0x2d'),_0x2e00f4,_0xc016a3['error'][_0x4520('0x2e')]);return _0x11eaea(_0xc016a3[_0x4520('0x2b')][_0x4520('0x2e')]);}logger[_0x4520('0x2b')](_0x4520('0x2d'),_0x2e00f4,_0xc016a3['error'][_0x4520('0x2e')]);return _0x3791b6(_0xc016a3[_0x4520('0x2b')][_0x4520('0x2e')]);}else{logger[_0x4520('0x2f')]('ChatInteraction,\x20%s,\x20%s',_0x2e00f4,_0x4520('0x29'));_0x3791b6(_0xc016a3[_0x4520('0x30')][_0x4520('0x2e')]);}})[_0x4520('0x31')](function(_0xad9f8){logger[_0x4520('0x2b')](_0x4520('0x2d'),_0x2e00f4,_0xad9f8);_0x11eaea(_0xad9f8);});});}function respondWithStatusCode(_0x195c58,_0x180c44){_0x180c44=_0x180c44||0xcc;return function(_0x926ca0){if(_0x926ca0){return _0x195c58['sendStatus'](_0x180c44);}return _0x195c58[_0x4520('0x32')](_0x180c44)['end']();};}function respondWithResult(_0x7ce8d2,_0x14778a){_0x14778a=_0x14778a||0xc8;return function(_0x43b4a2){if(_0x43b4a2){return _0x7ce8d2[_0x4520('0x32')](_0x14778a)[_0x4520('0x33')](_0x43b4a2);}};}function respondWithFilteredResult(_0x4751d1,_0x5bb163){return function(_0x2c32ce){if(_0x2c32ce){var _0x508c05=_0x2c32ce['count'],_0x2585eb=_0x5bb163[_0x4520('0x34')],_0x4a6755=_0x5bb163['offset']+_0x5bb163['limit'],_0xf6caff;if(_0x4a6755>=_0x508c05){_0x4a6755=_0x508c05;_0xf6caff=0xc8;}else{_0xf6caff=0xce;}_0x4751d1[_0x4520('0x32')](_0xf6caff);return _0x4751d1[_0x4520('0x35')](_0x4520('0x36'),_0x2585eb+'-'+_0x4a6755+'/'+_0x508c05)['json'](_0x2c32ce);}return null;};}function patchUpdates(_0x369abb){return function(_0x3556ca){try{jsonpatch[_0x4520('0x37')](_0x3556ca,_0x369abb,!![]);}catch(_0x2ad47f){return BPromise['reject'](_0x2ad47f);}return _0x3556ca['save']();};}function saveUpdates(_0x24ccb9,_0x6d8e01){return function(_0x4a57d3){if(_0x4a57d3){return _0x4a57d3[_0x4520('0x38')](_0x24ccb9)[_0x4520('0x39')](function(_0x1b61d6){return _0x1b61d6;});}return null;};}function removeEntity(_0x345bdc,_0x1eb998){return function(_0x3b0a72){if(_0x3b0a72){return _0x3b0a72['destroy']()[_0x4520('0x39')](function(){_0x345bdc[_0x4520('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3acc82,_0x5ee87d){return function(_0x8bf557){if(!_0x8bf557){_0x3acc82[_0x4520('0x3a')](0x194);}return _0x8bf557;};}function handleError(_0x4f2dc4,_0x582a93){_0x582a93=_0x582a93||0x1f4;return function(_0x5527a6){logger[_0x4520('0x2b')](_0x5527a6[_0x4520('0x3b')]);if(_0x5527a6[_0x4520('0x3c')]){delete _0x5527a6[_0x4520('0x3c')];}_0x4f2dc4[_0x4520('0x32')](_0x582a93)[_0x4520('0x3d')](_0x5527a6);};}function getInteractionUsers(_0x3bfc83,_0x567547){return new BPromise(function(_0x47085e,_0x37fd7a){try{if(_0x567547[_0x3bfc83['id']]){_0x3bfc83[_0x4520('0x3e')]=_['map'](_0x567547[_0x3bfc83['id']],function(_0x16d489){return{'id':_0x16d489['id'],'fullname':_0x16d489[_0x4520('0x3f')]};});}}catch(_0x5c6f84){_0x37fd7a(_0x5c6f84);}_0x47085e(_0x3bfc83);});}function getInteractionTags(_0x57b155,_0x1c4fd2){return new BPromise(function(_0x13e930,_0x2fafb4){try{if(_0x57b155[_0x4520('0x40')]){_0x57b155[_0x4520('0x41')]=[];_0x57b155['TagIds']['split'](',')['forEach'](function(_0x57a165){_0x57b155['Tags'][_0x4520('0x42')](_0x1c4fd2[_0x57a165]);});}delete _0x57b155['TagIds'];}catch(_0x517fcb){_0x2fafb4(_0x517fcb);}_0x13e930(_0x57b155);});}function updateChatInteraction(_0x2ff616,_0x27f3f8,_0x2e005d){return new BPromise(function(_0x214026,_0x21e21c){return getInteractionUsers(_0x2ff616,_0x2e005d)['then'](function(_0x1675e6){return getInteractionTags(_0x1675e6,_0x27f3f8);})[_0x4520('0x39')](function(_0x4a39d4){_0x214026(_0x4a39d4);})['catch'](function(_0x3780e4){_0x21e21c(_0x3780e4);});});}exports[_0x4520('0x43')]=function(_0x500c45,_0x2978d5){var _0x15a83b={},_0x3fc67b={},_0x13b817={'count':0x0,'rows':[]};var _0x489f89=_[_0x4520('0x44')](db[_0x4520('0x45')][_0x4520('0x46')],function(_0xb92e25){return{'name':_0xb92e25[_0x4520('0x47')],'type':_0xb92e25[_0x4520('0x48')][_0x4520('0x49')]};});_0x3fc67b[_0x4520('0x4a')]=_[_0x4520('0x44')](_0x489f89,_0x4520('0x3c'));_0x3fc67b[_0x4520('0x4b')]=_[_0x4520('0x4c')](_0x500c45[_0x4520('0x4b')]);_0x3fc67b[_0x4520('0x4d')]=_[_0x4520('0x4e')](_0x3fc67b[_0x4520('0x4a')],_0x3fc67b[_0x4520('0x4b')]);_0x15a83b['attributes']=_[_0x4520('0x4e')](_0x3fc67b[_0x4520('0x4a')],qs['fields'](_0x500c45['query']['fields']));_0x15a83b['attributes']=_0x15a83b[_0x4520('0x4f')]['length']?_0x15a83b[_0x4520('0x4f')]:_0x3fc67b[_0x4520('0x4a')];if(!_0x500c45[_0x4520('0x4b')][_0x4520('0x50')](_0x4520('0x51'))){_0x15a83b[_0x4520('0x52')]=qs[_0x4520('0x52')](_0x500c45[_0x4520('0x4b')][_0x4520('0x52')]);_0x15a83b[_0x4520('0x34')]=qs[_0x4520('0x34')](_0x500c45[_0x4520('0x4b')][_0x4520('0x34')]);}_0x15a83b[_0x4520('0x53')]=qs[_0x4520('0x54')](_0x500c45[_0x4520('0x4b')][_0x4520('0x54')]);_0x15a83b[_0x4520('0x55')]=qs['filters'](_['pick'](_0x500c45[_0x4520('0x4b')],_0x3fc67b[_0x4520('0x4d')]),_0x489f89);var _0x1bfedb=[];var _0x5523e6=squel[_0x4520('0x56')]()[_0x4520('0x57')]('id')[_0x4520('0x57')]('name')[_0x4520('0x57')](_0x4520('0x58'))[_0x4520('0x59')]('tools_tags');var _0x52a6af=squel[_0x4520('0x56')]()[_0x4520('0x57')](_0x4520('0x5a'))[_0x4520('0x57')](_0x4520('0x5b'))[_0x4520('0x57')](_0x4520('0x5c'))[_0x4520('0x59')]('user_has_chat_interactions','ui')[_0x4520('0x5d')](_0x4520('0x5e'),'u',_0x4520('0x5f'));var _0x8b1c3a=squel[_0x4520('0x56')]()[_0x4520('0x59')](_0x4520('0x60'),'i')[_0x4520('0x5d')](_0x4520('0x61'),'c',_0x4520('0x62'))[_0x4520('0x5d')](_0x4520('0x5e'),'o',_0x4520('0x63'))[_0x4520('0x5d')](_0x4520('0x64'),'a',_0x4520('0x65'))[_0x4520('0x5d')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x4520('0x5d')](_0x4520('0x66'),'it',_0x4520('0x67'))[_0x4520('0x5d')](_0x4520('0x68'),'t',_0x4520('0x69'));var _0x54372b=squel[_0x4520('0x6a')]();var _0x10c0ef=[];var _0x4fafb3=squel[_0x4520('0x6a')]();var _0x37d2ac;if(_0x500c45[_0x4520('0x4b')][_0x4520('0x6b')]){_0x37d2ac=as['parseSearch'](_0x500c45[_0x4520('0x4b')][_0x4520('0x6b')]);var _0x50603e=_0x37d2ac['sqlOperator'];for(var _0x347130=0x0;_0x347130<_0x37d2ac[_0x4520('0x6c')][_0x4520('0x6d')];_0x347130++){var _0x1d9676=_0x37d2ac[_0x4520('0x6c')][_0x347130];var _0xf5d990='i';var _0x4e15f1=_[_0x4520('0x6e')](_0x489f89,[_0x4520('0x3c'),_0x1d9676[_0x4520('0x57')]]);if(!_0x4e15f1){switch(_0x1d9676[_0x4520('0x57')]){case'unreadMessages':if(_0x1d9676[_0x4520('0x6f')]==0x1){_0x8b1c3a[_0x4520('0x70')]('`'+_0x1d9676['field']+_0x4520('0x71'));}else{_0x8b1c3a['having']('`'+_0x1d9676[_0x4520('0x57')]+_0x4520('0x72'));}break;case _0x4520('0x73'):if(_0x1d9676[_0x4520('0x74')]==='$substring'){if(_0x1d9676[_0x4520('0x6f')][_0x4520('0x75')]('\x20')[_0x4520('0x6d')]>0x1){_0x54372b[_0x50603e](_0x4520('0x76'),qs['getFullTextValue'](_0x1d9676[_0x4520('0x6f')]),null);}else{var _0xe7ad2c='%'+_0x1d9676[_0x4520('0x6f')]+'%';_0x54372b[_0x50603e](_0x4520('0x77'),_0xe7ad2c,_0xe7ad2c,_0xe7ad2c);}}else{_0x4e15f1=_[_0x4520('0x6e')](_0x489f89,[_0x4520('0x3c'),'ContactId']);_0x1d9676[_0x4520('0x57')]='ContactId';_0x609b8e=as[_0x4520('0x78')](_0xf5d990,_0x4e15f1[_0x4520('0x48')],_0x1d9676);_0x54372b[_0x50603e](_0x609b8e[_0x4520('0x79')],_0x609b8e[_0x4520('0x6f')][_0x4520('0x7a')],_0x609b8e[_0x4520('0x6f')]['end']);}break;case'Tag':var _0xa7461b=_0x1d9676['value'][_0x4520('0x75')](',')[_0x4520('0x44')](function(_0x7d4b51){return Number(_0x7d4b51);});_0xa7461b[_0x4520('0x7b')](function(_0x1d041f){_0x4fafb3['or'](_0x4520('0x7c'),'%,'+_0x1d041f+',%');});_0x10c0ef=_[_0x4520('0x7d')](_0x10c0ef,_0xa7461b);break;case _0x4520('0x7e'):if(_0x1d9676[_0x4520('0x74')]==='$substring'){_0x54372b[_0x50603e](_0x4520('0x7f'),'%'+_0x1d9676['value']+'%',null);}else{_0x4e15f1=_[_0x4520('0x6e')](_0x489f89,[_0x4520('0x3c'),_0x4520('0x80')]);_0x1d9676[_0x4520('0x57')]=_0x4520('0x80');_0x609b8e=as['buildExpression'](_0xf5d990,_0x4e15f1[_0x4520('0x48')],_0x1d9676);_0x54372b[_0x50603e](_0x609b8e[_0x4520('0x79')],_0x609b8e[_0x4520('0x6f')][_0x4520('0x7a')],_0x609b8e['value']['end']);}break;case'body':_0x609b8e=as[_0x4520('0x78')]('me',null,_0x1d9676);_0x54372b[_0x50603e](_0x609b8e[_0x4520('0x79')],_0x609b8e[_0x4520('0x6f')]['start'],_0x609b8e[_0x4520('0x6f')][_0x4520('0x81')]);break;}}else{var _0x609b8e=as[_0x4520('0x78')](_0xf5d990,_0x4e15f1[_0x4520('0x48')],_0x1d9676);_0x54372b[_0x50603e](_0x609b8e['text'],_0x609b8e[_0x4520('0x6f')][_0x4520('0x7a')],_0x609b8e[_0x4520('0x6f')]['end']);}}}else{var _0x3419bd=_(_0x500c45[_0x4520('0x4b')])[_0x4520('0x4c')]()[_0x4520('0x44')](function(_0x2e8474){return _[_0x4520('0x82')](_0x489f89,[_0x4520('0x3c'),_0x2e8474])?_0x2e8474:undefined;})[_0x4520('0x83')]()['value']();if(!_['isEmpty'](_0x3419bd)){_0x3419bd[_0x4520('0x7b')](function(_0x41020c){if(_0x41020c==='ChatWebsiteId'){_0x8b1c3a[_0x4520('0x55')]('i.ChatWebsiteId\x20IN\x20?',[][_0x4520('0x84')](_0x500c45[_0x4520('0x4b')][_0x41020c]));}else if(_0x41020c==='createdAt'){var _0x112419=JSON[_0x4520('0x85')](_0x500c45['query'][_0x41020c])[_0x4520('0x86')];var _0x164d75=JSON['parse'](_0x500c45[_0x4520('0x4b')][_0x41020c])[_0x4520('0x87')];_0x8b1c3a[_0x4520('0x55')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x112419,_0x164d75);}else{if(_0x500c45[_0x4520('0x4b')][_0x41020c]===_0x4520('0x88')){_0x8b1c3a[_0x4520('0x55')]('i.'+_0x41020c+_0x4520('0x89'));}else{_0x8b1c3a[_0x4520('0x55')]('i.'+_0x41020c+_0x4520('0x8a'),_0x500c45[_0x4520('0x4b')][_0x41020c]);}}});}if(_0x500c45[_0x4520('0x4b')][_0x4520('0x8b')]){if(_0x500c45[_0x4520('0x4b')][_0x4520('0x8b')]==0x1){_0x8b1c3a[_0x4520('0x70')]('`unreadMessages`\x20=\x200');}else{_0x8b1c3a['having'](_0x4520('0x8c'));}}if(_0x500c45['query'][_0x4520('0x8d')]){_0x10c0ef=_[_0x4520('0x8e')](_0x500c45[_0x4520('0x4b')][_0x4520('0x8d')])?_0x500c45[_0x4520('0x4b')]['tag']:new Array(_0x500c45['query'][_0x4520('0x8d')]);_0x10c0ef[_0x4520('0x7b')](function(_0x415d7f){_0x4fafb3['or'](_0x4520('0x7c'),'%,'+_0x415d7f+',%');});}if(_0x500c45[_0x4520('0x4b')][_0x4520('0x8f')]){var _0x4b60e2=_0x500c45[_0x4520('0x4b')][_0x4520('0x8f')]['replace']('\x5c','\x5c\x5c')[_0x4520('0x90')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x4b60e2)){_0x54372b['or']('i.id\x20LIKE\x20?',_0x4b60e2+'%');}else{_0x54372b['or'](_0x4520('0x91'),qs[_0x4520('0x92')](_0x4b60e2))['or'](_0x4520('0x93'),_0x4b60e2+'%');}}}_0x8b1c3a[_0x4520('0x55')](_0x54372b);_0x8b1c3a[_0x4520('0x94')]('i.id');var _0x39f79b={'type':db[_0x4520('0x24')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1fdd7a=_0x8b1c3a[_0x4520('0x95')]();_0x1fdd7a[_0x4520('0x57')]('i.id');_0x1fdd7a[_0x4520('0x57')](_0x4520('0x96'),_0x4520('0x97'));if(_0x15a83b['order']){_0x15a83b[_0x4520('0x53')][_0x4520('0x7b')](function(_0x4b544e){_0x8b1c3a[_0x4520('0x53')]('i.'+_0x4b544e[0x0],_0x4b544e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4520('0x98')](_0x10c0ef)){_0x8b1c3a[_0x4520('0x70')](_0x4fafb3);_0x1fdd7a[_0x4520('0x55')](_0x4520('0x99'),_0x10c0ef);}BPromise[_0x4520('0x9a')]()[_0x4520('0x39')](function(){if(!_0x37d2ac){if(_0x500c45[_0x4520('0x4b')]['ChatWebsiteId']||_0x500c45[_0x4520('0x4b')]['journey'])return;_0x1fdd7a[_0x4520('0x55')](_0x4520('0x9b'));_0x8b1c3a['where'](_0x4520('0x9b'));return;}return _0x500c45[_0x4520('0x9c')][_0x4520('0x9d')]({'attributes':['id'],'raw':!![]})[_0x4520('0x39')](function(_0xb75a75){if(_[_0x4520('0x98')](_0xb75a75)){_0x1fdd7a[_0x4520('0x55')](_0x4520('0x9e'));_0x8b1c3a[_0x4520('0x55')](_0x4520('0x9e'));}else{_0x1fdd7a[_0x4520('0x55')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0xb75a75,'id'));_0x8b1c3a['where']('i.ChatWebsiteId\x20IN\x20?',_['map'](_0xb75a75,'id'));}});})[_0x4520('0x39')](function(){db[_0x4520('0x9f')][_0x4520('0x4b')](_0x1fdd7a[_0x4520('0xa0')](),_0x39f79b)['then'](function(_0x257260){_0x13b817['count']=_0x257260[_0x4520('0x6d')];if(_0x13b817['count']===0x0)return[];return db[_0x4520('0x9f')]['query'](_0x5523e6[_0x4520('0xa0')](),_0x39f79b)[_0x4520('0x39')](function(_0x3aaa00){_0x1bfedb=_[_0x4520('0xa1')](_0x3aaa00,'id');_0x39f79b=_['merge'](_0x39f79b,{'model':db[_0x4520('0x45')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x500c45['query'][_0x4520('0xa2')]){_0x15a83b[_0x4520('0x4f')][_0x4520('0x7b')](function(_0x36e8d0){_0x8b1c3a[_0x4520('0x57')]('i.'+_0x36e8d0);});}else{_0x8b1c3a['field'](_0x4520('0x96'),_0x4520('0x97'));_0x8b1c3a['field'](_0x4520('0xa3'),_0x4520('0xa4'));_0x8b1c3a['field'](_0x4520('0xa5'),'Account.mandatoryDisposition');_0x8b1c3a['field'](_0x4520('0xa6'));_0x8b1c3a[_0x4520('0x57')]('c.firstName',_0x4520('0xa7'));_0x8b1c3a['field'](_0x4520('0xa8'),_0x4520('0xa9'));_0x8b1c3a[_0x4520('0x57')](_0x4520('0xaa'),_0x4520('0xab'));_0x8b1c3a[_0x4520('0x57')](_0x4520('0xac'),_0x4520('0xad'));_0x8b1c3a[_0x4520('0x57')](_0x4520('0xae'),_0x4520('0xaf'));_0x8b1c3a[_0x4520('0x57')](_0x4520('0xb0'),_0x4520('0xb1'));_0x8b1c3a['field'](_0x4520('0xb2'),_0x4520('0xb3'));_0x8b1c3a['field'](_0x4520('0xb4'),_0x4520('0xb5'));_0x8b1c3a['field'](_0x4520('0xb6'),_0x4520('0x40'));}if(_0x15a83b[_0x4520('0x52')])_0x8b1c3a[_0x4520('0x52')](_0x15a83b[_0x4520('0x52')]);if(_0x15a83b[_0x4520('0x34')])_0x8b1c3a['offset'](_0x15a83b[_0x4520('0x34')]);return db[_0x4520('0x9f')][_0x4520('0x4b')](_0x8b1c3a[_0x4520('0xa0')](),_0x39f79b);})[_0x4520('0x39')](function(_0x570302){_0x52a6af['where'](_0x4520('0xb7'),_[_0x4520('0x44')](_0x570302,'id'));return db[_0x4520('0x9f')][_0x4520('0x4b')](_0x52a6af[_0x4520('0xa0')](),_0x39f79b)[_0x4520('0x39')](function(_0x423c7e){var _0x34d2cf=_[_0x4520('0xb8')](_0x423c7e,_0x4520('0xb9'));var _0x480939=[];_0x570302[_0x4520('0x7b')](function(_0xa41824){_0x480939['push'](updateChatInteraction(_0xa41824,_0x1bfedb,_0x34d2cf));});return BPromise[_0x4520('0xba')](_0x480939);});});})[_0x4520('0x39')](function(_0x54d969){_0x13b817[_0x4520('0xbb')]=_0x54d969;return _0x13b817;})[_0x4520('0x39')](respondWithFilteredResult(_0x2978d5,_0x15a83b));})['catch'](handleError(_0x2978d5,null));};exports['show']=function(_0x44de4e,_0x2ada71){var _0x5f0143={'raw':![],'where':{'id':_0x44de4e['params']['id']}},_0xf3ef3f={};_0xf3ef3f[_0x4520('0x4a')]=_[_0x4520('0x4c')](db[_0x4520('0x45')][_0x4520('0x46')]);_0xf3ef3f[_0x4520('0x4b')]=_[_0x4520('0x4c')](_0x44de4e[_0x4520('0x4b')]);_0xf3ef3f[_0x4520('0x4d')]=_[_0x4520('0x4e')](_0xf3ef3f['model'],_0xf3ef3f[_0x4520('0x4b')]);_0x5f0143[_0x4520('0x4f')]=_[_0x4520('0x4e')](_0xf3ef3f['model'],qs['fields'](_0x44de4e[_0x4520('0x4b')]['fields']));_0x5f0143[_0x4520('0x4f')]=_0x5f0143[_0x4520('0x4f')][_0x4520('0x6d')]?_0x5f0143[_0x4520('0x4f')]:_0xf3ef3f[_0x4520('0x4a')];if(_0x44de4e[_0x4520('0x4b')][_0x4520('0xbc')]){_0x5f0143[_0x4520('0xbd')]=[{'all':!![]}];}_0x5f0143=_[_0x4520('0xbe')]({},_0x5f0143,_0x44de4e['options']);return db[_0x4520('0x45')][_0x4520('0x6e')](_0x5f0143)[_0x4520('0x39')](handleEntityNotFound(_0x2ada71,null))[_0x4520('0x39')](respondWithResult(_0x2ada71,null))[_0x4520('0x31')](handleError(_0x2ada71,null));};exports[_0x4520('0xbf')]=function(_0x3d21a1,_0x53acec){return db[_0x4520('0x45')][_0x4520('0xbf')](_0x3d21a1[_0x4520('0xc0')],{})[_0x4520('0x39')](respondWithResult(_0x53acec,0xc9))[_0x4520('0x31')](handleError(_0x53acec,null));};exports['update']=function(_0x51582d,_0x6094d5){if(_0x51582d[_0x4520('0xc0')]['id']){delete _0x51582d[_0x4520('0xc0')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x51582d[_0x4520('0xc1')]['id']}})[_0x4520('0x39')](handleEntityNotFound(_0x6094d5,null))[_0x4520('0x39')](saveUpdates(_0x51582d['body'],null))[_0x4520('0x39')](respondWithResult(_0x6094d5,null))[_0x4520('0x31')](handleError(_0x6094d5,null));};exports['destroy']=function(_0x3a783b,_0x28ea32){return db[_0x4520('0x45')][_0x4520('0x6e')]({'where':{'id':_0x3a783b[_0x4520('0xc1')]['id']}})[_0x4520('0x39')](handleEntityNotFound(_0x28ea32,null))[_0x4520('0x39')](removeEntity(_0x28ea32,null))[_0x4520('0x31')](handleError(_0x28ea32,null));};exports[_0x4520('0xc2')]=function(_0x3eb1fd,_0x5de8f9){return db[_0x4520('0x45')]['describe']()[_0x4520('0x39')](respondWithResult(_0x5de8f9,null))['catch'](handleError(_0x5de8f9,null));};exports[_0x4520('0xc3')]=function(_0x31ab69,_0x245180){var _0x3639f1=_0x31ab69['params']['id'];var _0xfca41c;var _0x43f6c0;var _0x19b076;return db[_0x4520('0x45')][_0x4520('0xc4')]({'where':{'id':_0x3639f1}})[_0x4520('0x39')](function(_0x22a5cd){_0xfca41c=_0x22a5cd;return db['ChatWebsite'][_0x4520('0xc4')]({'where':{'id':_0x22a5cd['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x4520('0xc5')],'raw':!![]});})['then'](function(_0x9cbef9){if(_0x9cbef9&&_0x9cbef9[_0x4520('0xc6')]&&_0x9cbef9[_0x4520('0xc5')]){_0x43f6c0=_0x9cbef9;var _0x66e4da={'rejectUnauthorized':![],'method':_0x4520('0xc7'),'uri':_0x4520('0xc8'),'headers':{'X-APIKEY':_0x9cbef9['vidaooApiKey']},'body':{'name':_0x4520('0xc9')+_0x3639f1},'redirect':_0x4520('0xca'),'json':!![]};return rp(_0x66e4da);}else{throw new db[(_0x4520('0x24'))][(_0x4520('0x25'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x4520('0x39')](function(_0x4e7421){_0x19b076=_0x4e7421;if(_0x19b076['id']){var _0x771feb={'body':_0x19b076[_0x4520('0xcb')],'ChatWebsiteId':_0x43f6c0['id'],'ChatInteractionId':_0xfca41c['id'],'direction':'out','UserId':_0x31ab69[_0x4520('0x9c')]['id']};return db[_0x4520('0xcc')][_0x4520('0xbf')](_0x771feb,{});}else{throw new db['Sequelize'][(_0x4520('0x25'))](_0x4520('0xcd'));}})['then'](function(){return _0xfca41c[_0x4520('0xce')]({'vidaooSessionId':_0x19b076['id']});})[_0x4520('0x39')](respondWithResult(_0x245180,null))[_0x4520('0x31')](handleError(_0x245180,null));};exports[_0x4520('0xcf')]=function(_0x3ebb78,_0x5169ff){if(_0x3ebb78[_0x4520('0xc0')]['id']){delete _0x3ebb78[_0x4520('0xc0')]['id'];}return db[_0x4520('0x45')]['find']({'where':{'id':_0x3ebb78[_0x4520('0xc1')]['id']}})['then'](handleEntityNotFound(_0x5169ff,null))[_0x4520('0x39')](saveUpdates(_0x3ebb78[_0x4520('0xc0')],null))[_0x4520('0x39')](respondWithResult(_0x5169ff,null))[_0x4520('0x31')](handleError(_0x5169ff,null));};exports[_0x4520('0xd0')]=function(_0x356040,_0x2b6918,_0x3992e3){if(_0x356040[_0x4520('0xc0')]['id']){delete _0x356040['body']['id'];}return db[_0x4520('0x45')][_0x4520('0x6e')]({'where':{'id':_0x356040['params']['id']}})['then'](function(_0x35b7df){if(!_0x35b7df){logger[_0x4520('0x2b')](_0x4520('0xd1'),_0x4520('0xd0'),0x194,_0x4520('0xd2'));_0x2b6918[_0x4520('0x3a')](0x194);}else{if(_0x35b7df[_0x4520('0x80')]){throw new db[(_0x4520('0x24'))][(_0x4520('0x25'))](_0x4520('0xd3'));}}return _0x35b7df;})[_0x4520('0x39')](function(_0x4e52bd){if(_0x4e52bd){return _0x4e52bd[_0x4520('0x38')]({'closed':_0x356040[_0x4520('0xc0')][_0x4520('0xd4')],'disposition':_0x356040[_0x4520('0xc0')][_0x4520('0xd5')]})[_0x4520('0x39')](function(_0x2d596d){return _0x2d596d;});}})['then'](function(_0x5d2873){return respondWithRpcPromise('AbandonInteraction',_0x4520('0xd0'),_0x356040[_0x4520('0xc0')],client9004);})[_0x4520('0x39')](respondWithResult(_0x2b6918,null))[_0x4520('0x31')](handleError(_0x2b6918,null));};exports[_0x4520('0xd6')]=function(_0x15c2e2,_0x43de54,_0x725e5){_0x15c2e2[_0x4520('0xc0')][_0x4520('0x3c')]=_0x15c2e2[_0x4520('0xd7')][_0x4520('0xd8')];_0x15c2e2[_0x4520('0xc0')][_0x4520('0xd9')]=_0x15c2e2[_0x4520('0xd7')][_0x4520('0xda')];_0x15c2e2[_0x4520('0xc0')]['type']=_0x15c2e2[_0x4520('0xd7')][_0x4520('0xdb')];return db['Attachment']['create'](_0x15c2e2['body'])['then'](respondWithResult(_0x43de54,0xc9))['catch'](handleError(_0x43de54,null));};exports[_0x4520('0xdc')]=function(_0x398623,_0x136ebb,_0x28506f){return db[_0x4520('0x45')][_0x4520('0xc4')]({'where':{'id':_0x398623[_0x4520('0xc1')]['id']},'raw':!![]})[_0x4520('0x39')](handleEntityNotFound(_0x136ebb,null))[_0x4520('0x39')](function(_0x5ec914){if(_0x5ec914){if(_0x5ec914['closed']){return _0x136ebb[_0x4520('0x32')](0x193)[_0x4520('0x33')]({'status':0x193,'message':_0x4520('0xdd')});}return db[_0x4520('0xde')][_0x4520('0xc4')]({'where':{'id':_0x398623['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x136ebb,null));}})[_0x4520('0x39')](function(_0xfeff3a){if(_0xfeff3a){return _0x136ebb[_0x4520('0xdf')](path['join'](config[_0x4520('0xe0')],_0x4520('0xe1'),_0xfeff3a['basename']));}})[_0x4520('0x31')](handleError(_0x136ebb,null));};exports['close']=function(_0x75a51a,_0x444ecd){var _0x556cde=null;var _0x521f2b=null;var _0x2d1980=null;var _0x536018=null;if(_0x75a51a[_0x4520('0xc0')]['id']){delete _0x75a51a[_0x4520('0xc0')]['id'];}if(_0x75a51a[_0x4520('0xc0')][_0x4520('0xe2')]){_0x536018=path[_0x4520('0xe3')](config[_0x4520('0xe0')],_0x4520('0xe4'),util[_0x4520('0xe5')](_0x4520('0xe6'),Date[_0x4520('0xe7')]()));_0x75a51a[_0x4520('0xc0')]['pathTranscript']=_0x536018;}return db[_0x4520('0x45')][_0x4520('0x6e')]({'where':{'id':_0x75a51a['params']['id']},'include':[{'model':db[_0x4520('0xcc')],'as':_0x4520('0xe8'),'include':[{'model':db[_0x4520('0x7e')],'as':_0x4520('0x7e')}]}]})[_0x4520('0x39')](handleEntityNotFound(_0x444ecd,null))[_0x4520('0x39')](saveUpdates(_0x75a51a[_0x4520('0xc0')],null))['then'](function(_0xb33009){if(_0xb33009){_0x556cde=_0xb33009;return db[_0x4520('0xe9')]['find']({'where':{'id':_0x556cde[_0x4520('0xea')]}});}})[_0x4520('0x39')](function(_0x4ba61c){if(_0x4ba61c){_0x2d1980=_0x4ba61c;return db[_0x4520('0xeb')][_0x4520('0x6e')]({'where':{'id':_0x556cde[_0x4520('0xec')]}});}})[_0x4520('0x39')](function(_0x51f4da){if(_0x51f4da){_0x521f2b=_0x51f4da;if(_0x536018){var _0x215d58=null;for(var _0x5c2339=0x1;_0x5c2339<_0x556cde[_0x4520('0xe8')][_0x4520('0x6d')];++_0x5c2339){_0x215d58=_0x556cde[_0x4520('0xe8')][_0x5c2339];var _0x5d4797=_0x215d58[_0x4520('0x80')]?util['format']('%s%d',_0x2d1980[_0x4520('0xed')],_0x215d58[_0x4520('0x80')]):_0x4520('0xee');var _0x43a5e0=_0x75a51a[_0x4520('0xc0')]['customer']||util[_0x4520('0xe5')](_0x4520('0xef'),_0x4520('0xf0'),_0x215d58[_0x4520('0xec')]);switch(_0x2d1980[_0x4520('0xf1')]){case'website_alias':_0x5d4797=_0x215d58[_0x4520('0x80')]?util[_0x4520('0xe5')](_0x4520('0xef'),_0x2d1980[_0x4520('0xed')],_0x215d58[_0x4520('0x80')]):_0x4520('0xee');break;case'agent_alias':_0x5d4797=_0x215d58[_0x4520('0x80')]?_0x215d58[_0x4520('0x7e')]['alias']||_0x215d58['User'][_0x4520('0x3f')]:_0x4520('0xee');break;case _0x4520('0xf2'):_0x5d4797=_0x215d58['UserId']?_0x215d58['User']['fullname']:'System';break;default:_0x5d4797=_0x215d58[_0x4520('0x80')]?util['format'](_0x4520('0xef'),_0x2d1980[_0x4520('0xed')],_0x215d58['UserId']):_0x4520('0xee');}var _0x5482f7=util['format'](_0x4520('0xf3'),moment(_0x215d58['createdAt'])['format'](_0x4520('0xf4')),_0x215d58[_0x4520('0xf5')]==='in'?_0x43a5e0:_0x5d4797,_0x215d58[_0x4520('0xc0')]);if(!_0x215d58['secret']){fs['appendFileSync'](_0x536018,_0x5482f7);}}return db[_0x4520('0xf6')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4520('0xf7'),'raw':!![]}]});}}})[_0x4520('0x39')](function(_0x5bdd2b){if(_0x5bdd2b&&_0x5bdd2b[_0x4520('0xf7')]&&_0x75a51a['body']){var _0x47e166={'tls':{'rejectUnauthorized':![]}};if(_0x5bdd2b[_0x4520('0xf7')]['service']){_0x47e166[_0x4520('0xf8')]=_0x5bdd2b[_0x4520('0xf7')]['service'];}else{_0x47e166[_0x4520('0xf9')]=_0x5bdd2b['Smtp']['host'];_0x47e166[_0x4520('0xfa')]=_0x5bdd2b[_0x4520('0xf7')][_0x4520('0xfa')];_0x47e166[_0x4520('0xfb')]=_0x5bdd2b[_0x4520('0xf7')][_0x4520('0xfb')];}if(_0x5bdd2b['Smtp'][_0x4520('0xfc')]){_0x47e166[_0x4520('0xfd')]={'user':_0x5bdd2b['Smtp']['user'],'pass':_0x5bdd2b['Smtp']['pass']};}return respondWithRpcPromise(_0x4520('0xfe'),_0x4520('0xff'),{'account':_0x47e166,'message':{'from':util[_0x4520('0xe5')]('\x22%s\x22\x20<%s>',_0x5bdd2b['name'],_0x5bdd2b[_0x4520('0x100')]||_0x5bdd2b[_0x4520('0xf7')][_0x4520('0x9c')]),'to':_0x75a51a['body']['mailTranscript'],'subject':_0x4520('0x101'),'text':util[_0x4520('0xe5')](_0x4520('0x102'),_0x75a51a['body'][_0x4520('0xe2')]),'attachments':[{'path':_0x536018}]}})[_0x4520('0x39')](function(){return _0x556cde;})[_0x4520('0x31')](function(_0x2150dd){console[_0x4520('0x2b')](_0x2150dd);});}else{return _0x556cde;}})[_0x4520('0x39')](respondWithStatusCode(_0x444ecd,0xc8))[_0x4520('0x31')](handleError(_0x444ecd,null));};exports['addMessage']=function(_0xfac206,_0x32d41a,_0x55332c){return db['ChatMessage'][_0x4520('0x6e')]({'where':{'id':_0xfac206['params']['id']}})['then'](handleEntityNotFound(_0x32d41a,null))[_0x4520('0x39')](function(_0x13d892){if(_0x13d892){return _0x13d892[_0x4520('0x103')](_0xfac206[_0x4520('0xc0')][_0x4520('0x104')],_[_0x4520('0x105')](_0xfac206[_0x4520('0xc0')],[_0x4520('0x104'),'id'])||{});}})[_0x4520('0x39')](respondWithResult(_0x32d41a,null))[_0x4520('0x31')](handleError(_0x32d41a,null));};exports[_0x4520('0x106')]=function(_0x492714,_0x42e57c,_0x45dfb7){var _0x8eb95b={'raw':![],'where':{}};var _0x1bb1be={};var _0x4503a9={'count':0x0,'rows':[]};return db[_0x4520('0x45')][_0x4520('0xc4')]({'where':{'id':_0x492714[_0x4520('0xc1')]['id']}})['then'](handleEntityNotFound(_0x42e57c,null))[_0x4520('0x39')](function(_0x3790fe){if(_0x3790fe){_0x1bb1be[_0x4520('0x4a')]=_[_0x4520('0x4c')](db[_0x4520('0xcc')][_0x4520('0x46')]);_0x1bb1be[_0x4520('0x4b')]=_['keys'](_0x492714[_0x4520('0x4b')]);_0x1bb1be[_0x4520('0x4d')]=_[_0x4520('0x4e')](_0x1bb1be[_0x4520('0x4a')],_0x1bb1be[_0x4520('0x4b')]);_0x8eb95b[_0x4520('0x4f')]=_[_0x4520('0x4e')](_0x1bb1be[_0x4520('0x4a')],qs[_0x4520('0xa2')](_0x492714[_0x4520('0x4b')][_0x4520('0xa2')]));_0x8eb95b['attributes']=_0x8eb95b[_0x4520('0x4f')][_0x4520('0x6d')]?_0x8eb95b['attributes']:_0x1bb1be[_0x4520('0x4a')];if(!_0x492714[_0x4520('0x4b')][_0x4520('0x50')](_0x4520('0x51'))){_0x8eb95b[_0x4520('0x52')]=qs['limit'](_0x492714[_0x4520('0x4b')][_0x4520('0x52')]);_0x8eb95b[_0x4520('0x34')]=qs['offset'](_0x492714[_0x4520('0x4b')][_0x4520('0x34')]);}_0x8eb95b[_0x4520('0x53')]=qs['sort'](_0x492714[_0x4520('0x4b')][_0x4520('0x54')]);_0x8eb95b['where']=qs[_0x4520('0x4d')](_[_0x4520('0x107')](_0x492714[_0x4520('0x4b')],_0x1bb1be[_0x4520('0x4d')]));_0x8eb95b[_0x4520('0x55')][_0x4520('0xb9')]=_0x3790fe['id'];if(_0x492714[_0x4520('0x4b')]['filter']){_0x8eb95b['where']=_[_0x4520('0xbe')](_0x8eb95b['where'],{'$or':_[_0x4520('0x44')](_0x8eb95b[_0x4520('0x4f')],function(_0x410432){var _0x33f761={};_0x33f761[_0x410432]={'$like':'%'+_0x492714[_0x4520('0x4b')][_0x4520('0x8f')]+'%'};return _0x33f761;})});}if(_0x492714[_0x4520('0x4b')][_0x4520('0x86')]){var _0x56993d=_0x492714['query']['$gte'][_0x4520('0x75')](',');var _0x16c8bd={};_0x16c8bd[_0x56993d[0x0]]={'$gte':moment(_0x56993d[0x1])[_0x4520('0xe5')](_0x4520('0x108'))};_0x8eb95b['where']=_['merge'](_0x8eb95b['where'],_0x16c8bd);}_0x8eb95b=_[_0x4520('0xbe')]({},_0x8eb95b,_0x492714[_0x4520('0x109')]);return db[_0x4520('0xcc')][_0x4520('0x10a')]({'where':_0x8eb95b[_0x4520('0x55')]})[_0x4520('0x39')](function(_0x2ea323){_0x4503a9['count']=_0x2ea323;if(_0x492714[_0x4520('0x4b')][_0x4520('0xbc')]){_0x8eb95b[_0x4520('0xbd')]=[{'all':!![]}];}return db[_0x4520('0xcc')][_0x4520('0x10b')](_0x8eb95b);})['then'](function(_0x2e62cc){_0x4503a9[_0x4520('0xbb')]=_0x2e62cc;return _0x4503a9;});}})[_0x4520('0x39')](respondWithFilteredResult(_0x42e57c,_0x8eb95b))[_0x4520('0x31')](handleError(_0x42e57c,null));};exports[_0x4520('0x10c')]=function(_0x2a1727,_0x3475d0,_0x25c090){var _0x44c594={'where':{}},_0x5cd9c4={},_0x484523={'count':0x0,'rows':[]};return db[_0x4520('0x45')][_0x4520('0xc4')]({'where':{'id':_0x2a1727['params']['id']}})[_0x4520('0x39')](handleEntityNotFound(_0x3475d0,null))[_0x4520('0x39')](function(_0x4b501e){if(_0x4b501e){_0x5cd9c4['model']=_[_0x4520('0x4c')](db[_0x4520('0xcc')][_0x4520('0x46')]);_0x5cd9c4['query']=_[_0x4520('0x4c')](_0x2a1727[_0x4520('0x4b')]);_0x5cd9c4[_0x4520('0x4d')]=_['intersection'](_0x5cd9c4[_0x4520('0x4a')],_0x5cd9c4['query']);_0x44c594['attributes']=_[_0x4520('0x4e')](_0x5cd9c4['model'],qs[_0x4520('0xa2')](_0x2a1727[_0x4520('0x4b')][_0x4520('0xa2')]));_0x44c594[_0x4520('0x4f')]=_0x44c594[_0x4520('0x4f')]['length']?_0x44c594[_0x4520('0x4f')]:_0x5cd9c4[_0x4520('0x4a')];if(!_0x2a1727[_0x4520('0x4b')][_0x4520('0x50')](_0x4520('0x51'))){_0x44c594['limit']=qs[_0x4520('0x52')](_0x2a1727[_0x4520('0x4b')]['limit']);_0x44c594[_0x4520('0x34')]=qs['offset'](_0x2a1727[_0x4520('0x4b')][_0x4520('0x34')]);}_0x44c594[_0x4520('0x53')]=qs[_0x4520('0x54')](_0x2a1727[_0x4520('0x4b')][_0x4520('0x54')]);_0x44c594[_0x4520('0x55')]=qs[_0x4520('0x4d')](_[_0x4520('0x107')](_0x2a1727[_0x4520('0x4b')],_0x5cd9c4[_0x4520('0x4d')]));_0x44c594[_0x4520('0x55')][_0x4520('0xb9')]=_0x4b501e['id'];if(_0x2a1727['query']['filter']){_0x44c594[_0x4520('0x55')]=_['merge'](_0x44c594[_0x4520('0x55')],{'$or':_[_0x4520('0x44')](_0x44c594[_0x4520('0x4f')],function(_0x544aa8){var _0x22491e={};_0x22491e[_0x544aa8]={'$like':'%'+_0x2a1727['query'][_0x4520('0x8f')]+'%'};return _0x22491e;})});}_0x44c594[_0x4520('0x55')][_0x4520('0x10d')]=![];if(_0x2a1727['query']['id']){_0x44c594[_0x4520('0x55')]['id']={'$gt':_0x2a1727[_0x4520('0x4b')]['id']};}_0x44c594=_[_0x4520('0xbe')]({},_0x44c594,_0x2a1727[_0x4520('0x109')]);return db['ChatMessage']['count']({'where':_0x44c594[_0x4520('0x55')]})[_0x4520('0x39')](function(_0x3a1ef2){_0x484523[_0x4520('0x10a')]=_0x3a1ef2;_0x44c594[_0x4520('0xbd')]=[];if(_0x2a1727[_0x4520('0x4b')][_0x4520('0x10e')]){_0x44c594[_0x4520('0xbd')]['push']({'model':db[_0x4520('0x7e')],'as':_0x4520('0x7e'),'attributes':['id',_0x4520('0x3f'),_0x4520('0x10f')]});}if(_0x2a1727[_0x4520('0x4b')][_0x4520('0xbc')]){_0x44c594[_0x4520('0xbd')]=[{'all':!![]}];}return db[_0x4520('0xcc')][_0x4520('0x10b')](_0x44c594);})[_0x4520('0x39')](function(_0x580d3d){_0x484523[_0x4520('0xbb')]=_0x580d3d;return _0x484523;});}})[_0x4520('0x39')](respondWithFilteredResult(_0x3475d0,_0x44c594))[_0x4520('0x31')](handleError(_0x3475d0,null));};exports['addTags']=function(_0x37dff8,_0x1a9d72,_0x3cff6e){return db[_0x4520('0x45')][_0x4520('0x6e')]({'where':{'id':_0x37dff8[_0x4520('0xc1')]['id']}})[_0x4520('0x39')](handleEntityNotFound(_0x1a9d72,null))[_0x4520('0x39')](function(_0xb24e57){if(_0xb24e57){return _0xb24e57[_0x4520('0x110')](_0x37dff8[_0x4520('0xc0')]['ids'],_[_0x4520('0x105')](_0x37dff8[_0x4520('0xc0')],[_0x4520('0x104'),'id'])||{})[_0x4520('0x111')](function(){return db['Tag'][_0x4520('0x10b')]({'attributes':['id',_0x4520('0x3c'),_0x4520('0x58')],'where':{'id':_0x37dff8['body'][_0x4520('0x104')]}});})[_0x4520('0x39')](function(_0x1ff5f3){socket['emit'](_0x4520('0x112'),{'id':Number(_0x37dff8[_0x4520('0xc1')]['id']),'tags':_0x1ff5f3||[]});return{'id':Number(_0x37dff8['params']['id']),'tags':_0x1ff5f3||[]};});}})[_0x4520('0x39')](respondWithResult(_0x1a9d72,null))[_0x4520('0x31')](handleError(_0x1a9d72,null));};exports[_0x4520('0x113')]=function(_0x2beeb6,_0x45df4c,_0xc2e385){return db[_0x4520('0x45')][_0x4520('0x6e')]({'where':{'id':_0x2beeb6['params']['id']}})[_0x4520('0x39')](handleEntityNotFound(_0x45df4c,null))[_0x4520('0x39')](function(_0x298bc8){if(_0x298bc8){return _0x298bc8[_0x4520('0x113')](_0x2beeb6[_0x4520('0x4b')][_0x4520('0x104')]);}})[_0x4520('0x39')](respondWithStatusCode(_0x45df4c,null))[_0x4520('0x31')](handleError(_0x45df4c,null));};exports[_0x4520('0xdf')]=function(_0x30826f,_0x34751f){var _0x40ba8c=moment()['unix']()[_0x4520('0xa0')]();var _0x125fae=path['join'](config[_0x4520('0xe0')],_0x4520('0x114'),_0x4520('0x115'),_0x4520('0x116'));var _0x34215e=path[_0x4520('0xe3')](config[_0x4520('0xe0')],'server',_0x4520('0x115'),_0x4520('0x117'));var _0x10884f=path[_0x4520('0xe3')](_0x125fae,_0x40ba8c);var _0x223f1d=util['format'](_0x4520('0x118'),_0x30826f[_0x4520('0xc1')]['id'],_0x40ba8c);var _0x516613=path[_0x4520('0xe3')](_0x125fae,_0x223f1d);var _0xcff80=[];_0xcff80[_0x4520('0x42')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0xcff80[_0x4520('0x42')]({'model':db['CmContact'],'as':_0x4520('0x73'),'attributes':['id','firstName',_0x4520('0x119')],'raw':!![]});if(_0x30826f[_0x4520('0x4b')][_0x4520('0x117')]){_0xcff80[_0x4520('0x42')]({'model':db[_0x4520('0xde')],'as':_0x4520('0xde'),'raw':!![]});}var _0x5555cb=[{'model':db[_0x4520('0xcc')],'as':_0x4520('0xe8'),'attributes':['id',_0x4520('0xc0'),_0x4520('0x11a'),'direction',_0x4520('0x10d'),_0x4520('0x8b')],'include':_0xcff80}];_0x5555cb[_0x4520('0x42')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id','name']});_0x5555cb[_0x4520('0x42')]({'model':db[_0x4520('0x7e')],'as':_0x4520('0x11b'),'attributes':['id','fullname']});return db[_0x4520('0x45')][_0x4520('0x6e')]({'where':{'id':_0x30826f[_0x4520('0xc1')]['id']},'include':_0x5555cb})['then'](handleEntityNotFound(_0x34751f,null))[_0x4520('0x39')](function(_0x170730){if(_0x170730){var _0x215405=_0x170730[_0x4520('0x11c')]({'plain':!![]});fs[_0x4520('0x11d')](_0x10884f);var _0x4fd85c={'format':'A4','border':_0x4520('0x11e'),'header':{'height':_0x4520('0x11f'),'contents':{'first':_0x4520('0x120')}},'footer':{'height':_0x4520('0x121'),'contents':{'default':util[_0x4520('0xe5')](_0x4520('0x122'),util['format'](_0x4520('0x123'),_0x4520('0x124'),_0x215405['id']),moment()['format'](_0x4520('0x125'))[_0x4520('0xa0')]())}}};var _0x254fd5={'channel':_0x4520('0x124'),'account':_0x215405[_0x4520('0x126')][_0x4520('0x3c')],'agent':_0x215405[_0x4520('0x11b')]?_0x215405[_0x4520('0x11b')][_0x4520('0x3f')]:_0x4520('0x127'),'createdAt':moment(_0x215405[_0x4520('0x11a')])[_0x4520('0xe5')](_0x4520('0x108'))[_0x4520('0xa0')](),'closedAt':_0x215405['closed']?moment(_0x215405[_0x4520('0x128')])[_0x4520('0xe5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4520('0xa0')]():'','disposition':_0x215405[_0x4520('0xd5')],'chatInfo':{'browser':_0x215405[_0x4520('0x129')],'os':_0x215405[_0x4520('0x12a')],'referer':_0x215405[_0x4520('0x12b')],'customerIp':_0x215405[_0x4520('0x12c')],'customerPort':_0x215405[_0x4520('0x12d')]?_0x215405['customerPort']:_0x4520('0x127')},'messages':_(_0x215405[_0x4520('0xe8')])['tail']()['filter']({'secret':![]})[_0x4520('0x44')](function(_0x3aeab4){if(_0x3aeab4[_0x4520('0xde')]){var _0x49f103=path[_0x4520('0xe3')](_0x34215e,_0x3aeab4[_0x4520('0xde')][_0x4520('0xd9')]);if(fs[_0x4520('0x12e')](_0x49f103)){fs['createReadStream'](_0x49f103)[_0x4520('0x12f')](fs['createWriteStream'](path[_0x4520('0xe3')](_0x10884f,_0x3aeab4[_0x4520('0xde')][_0x4520('0xd9')])));}}return{'date':moment(_0x3aeab4['createdAt'])[_0x4520('0xe5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4520('0xa0')](),'sender':_0x3aeab4[_0x4520('0xf5')]==='out'?_0x3aeab4[_0x4520('0x7e')]?_0x3aeab4[_0x4520('0x7e')]['fullname']:_0x4520('0xee'):_0x3aeab4[_0x4520('0x73')][_0x4520('0x130')]+(_0x3aeab4[_0x4520('0x73')][_0x4520('0x119')]?'\x20'+_0x3aeab4['Contact'][_0x4520('0x119')]:''),'body':_0x3aeab4[_0x4520('0xde')]?_0x3aeab4[_0x4520('0xde')][_0x4520('0xd9')]:_0x3aeab4[_0x4520('0xc0')],'direction':_0x3aeab4['direction']===_0x4520('0x131')?'A':'C','secret':_0x3aeab4[_0x4520('0x10d')],'read':_0x3aeab4[_0x4520('0x8b')],'attachment':_0x3aeab4[_0x4520('0xde')]};})['value']()};return ejs[_0x4520('0x132')](path[_0x4520('0xe3')](config[_0x4520('0xe0')],_0x4520('0x114'),_0x4520('0x133'),_0x4520('0x134')),{'interaction':_0x254fd5})[_0x4520('0x39')](function(_0x55ac02){return new BPromise(function(_0x339373,_0x22bb86){pdf[_0x4520('0xbf')](_0x55ac02,_0x4fd85c)['toFile'](path[_0x4520('0xe3')](_0x10884f,'transcript-'+_0x215405['id']+'-'+_0x40ba8c+_0x4520('0x135')),function(_0x537441,_0x388a45){if(_0x537441)return _0x22bb86(_0x537441);_0x339373(_0x388a45);});});})[_0x4520('0x39')](function(){return new BPromise(function(_0x390081,_0xba6f62){zipdir(_0x10884f,{'saveTo':_0x516613},function(_0x355c83,_0xfbf56b){if(_0x355c83)return _0xba6f62(_0x355c83);return _0x390081(_0xfbf56b);});})[_0x4520('0x39')](function(){return new BPromise(function(_0x422a19,_0x4cdf5b){rimraf(_0x10884f,function(_0x53097f){if(_0x53097f)_0x4cdf5b(_0x53097f);return _0x422a19();});});})[_0x4520('0x39')](function(){return _0x34751f['download'](_0x516613,_0x223f1d,function(_0x5a0e19){if(_0x5a0e19){console['log']('err',_0x5a0e19);}else{fs['unlinkSync'](_0x516613);}});});});}else{return _0x34751f[_0x4520('0x3a')](0xc8);}})['catch'](handleError(_0x34751f,null));};
\ No newline at end of file
+var _0x82c4=['resolve','ChatWebsiteId','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','keyBy','merge','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','sequelize','groupBy','ChatInteractionId','rows','show','params','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','basename','filename','mimetype','Attachment','closed','Unauthorized','attachId','download','root','server/files/attachments/','close','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','%s%d','agentAlias','System','Visitor','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','ids','omit','getMessages','hasOwnProperty','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','includeAll','setTags','spread','color','emit','chatInteractionTags:save','removeTags','unix','join','server','tmp','files','attachments','transcript-%d-%s.zip','push','firstName','lastName','Owner','mkdirSync','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','30px','<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','Chat','Account','N.A.','closedAt','osName','referer','customerIp','tail','existsSync','createReadStream','createWriteStream','read','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','test','Sequelize','ValidationError','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','Users','map','fullname','TagIds','split','forEach','Tags','index','ChatInteraction','rawAttributes','fieldName','model','keys','filters','intersection','query','fields','attributes','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','start','body','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20=\x20?','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?'];(function(_0x28923c,_0x4429bd){var _0x18c26e=function(_0x1a3996){while(--_0x1a3996){_0x28923c['push'](_0x28923c['shift']());}};_0x18c26e(++_0x4429bd);}(_0x82c4,0x1ca));var _0x482c=function(_0x2faa2e,_0x198332){_0x2faa2e=_0x2faa2e-0x0;var _0x4d165d=_0x82c4[_0x2faa2e];return _0x4d165d;};'use strict';var pdf=require(_0x482c('0x0'));var emlformat=require(_0x482c('0x1'));var rimraf=require(_0x482c('0x2'));var zipdir=require(_0x482c('0x3'));var jsonpatch=require(_0x482c('0x4'));var rp=require(_0x482c('0x5'));var moment=require(_0x482c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x482c('0x7'));var util=require('util');var path=require(_0x482c('0x8'));var sox=require('sox');var csv=require(_0x482c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x482c('0xa'));var squel=require(_0x482c('0xb'));var crypto=require(_0x482c('0xc'));var jsforce=require(_0x482c('0xd'));var deskjs=require(_0x482c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x482c('0xf'));var Papa=require(_0x482c('0x10'));var Redis=require(_0x482c('0x11'));var authService=require(_0x482c('0x12'));var qs=require(_0x482c('0x13'));var as=require(_0x482c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x482c('0x15'))(_0x482c('0x16'));var utils=require(_0x482c('0x17'));var config=require('../../config/environment');var db=require(_0x482c('0x18'))['db'];config[_0x482c('0x19')]=_[_0x482c('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x482c('0x1b'))(new Redis(config[_0x482c('0x19')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x482c('0x1c'));var client=jayson[_0x482c('0x1d')][_0x482c('0x1e')]({'port':0x232b});var client9004=jayson[_0x482c('0x1d')][_0x482c('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x119635,_0x3beedb,_0xf65563){if(_0xf65563){var _0x3fc79c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fc79c[_0x482c('0x1f')](_0x3beedb)){return _0x119635;}else{throw new db[(_0x482c('0x20'))][(_0x482c('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x119635;}}function respondWithRpcPromise(_0x244bb9,_0x5b6f7e,_0x3aed45,_0x258148){return new BPromise(function(_0x4af05a,_0x4bd270){var _0x357965=_0x258148||client;return _0x357965['request'](_0x244bb9,_0x3aed45)[_0x482c('0x22')](function(_0x4784a2){logger[_0x482c('0x23')](_0x482c('0x24'),_0x5b6f7e,'request\x20sent');logger[_0x482c('0x25')](_0x482c('0x26'),_0x5b6f7e,_0x482c('0x27'),JSON[_0x482c('0x28')](_0x4784a2));if(_0x4784a2[_0x482c('0x29')]){if(_0x4784a2['error']['code']===0x1f4){logger[_0x482c('0x29')](_0x482c('0x24'),_0x5b6f7e,_0x4784a2[_0x482c('0x29')]['message']);return _0x4bd270(_0x4784a2[_0x482c('0x29')]['message']);}logger[_0x482c('0x29')](_0x482c('0x24'),_0x5b6f7e,_0x4784a2['error'][_0x482c('0x2a')]);return _0x4af05a(_0x4784a2['error']['message']);}else{logger[_0x482c('0x23')](_0x482c('0x24'),_0x5b6f7e,_0x482c('0x27'));_0x4af05a(_0x4784a2[_0x482c('0x2b')][_0x482c('0x2a')]);}})[_0x482c('0x2c')](function(_0x2981d2){logger['error'](_0x482c('0x24'),_0x5b6f7e,_0x2981d2);_0x4bd270(_0x2981d2);});});}function respondWithStatusCode(_0x255417,_0x58da7c){_0x58da7c=_0x58da7c||0xcc;return function(_0xb01bc3){if(_0xb01bc3){return _0x255417['sendStatus'](_0x58da7c);}return _0x255417['status'](_0x58da7c)[_0x482c('0x2d')]();};}function respondWithResult(_0x5af04c,_0x1ac1c4){_0x1ac1c4=_0x1ac1c4||0xc8;return function(_0x2c5121){if(_0x2c5121){return _0x5af04c[_0x482c('0x2e')](_0x1ac1c4)[_0x482c('0x2f')](_0x2c5121);}};}function respondWithFilteredResult(_0x39e8aa,_0x11950f){return function(_0x36b00d){if(_0x36b00d){var _0x3e9b22=_0x36b00d[_0x482c('0x30')],_0x24b4df=_0x11950f[_0x482c('0x31')],_0x2d3800=_0x11950f[_0x482c('0x31')]+_0x11950f[_0x482c('0x32')],_0x3135a7;if(_0x2d3800>=_0x3e9b22){_0x2d3800=_0x3e9b22;_0x3135a7=0xc8;}else{_0x3135a7=0xce;}_0x39e8aa[_0x482c('0x2e')](_0x3135a7);return _0x39e8aa[_0x482c('0x33')](_0x482c('0x34'),_0x24b4df+'-'+_0x2d3800+'/'+_0x3e9b22)['json'](_0x36b00d);}return null;};}function patchUpdates(_0x4bc837){return function(_0x520b6b){try{jsonpatch[_0x482c('0x35')](_0x520b6b,_0x4bc837,!![]);}catch(_0x22e759){return BPromise[_0x482c('0x36')](_0x22e759);}return _0x520b6b[_0x482c('0x37')]();};}function saveUpdates(_0x59905b,_0x12ad47){return function(_0x4adc43){if(_0x4adc43){return _0x4adc43[_0x482c('0x38')](_0x59905b)[_0x482c('0x22')](function(_0xdb7f5a){return _0xdb7f5a;});}return null;};}function removeEntity(_0x28140b,_0x15223b){return function(_0x19cfc8){if(_0x19cfc8){return _0x19cfc8[_0x482c('0x39')]()[_0x482c('0x22')](function(){_0x28140b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x467a70,_0x4a4756){return function(_0xe62a02){if(!_0xe62a02){_0x467a70[_0x482c('0x3a')](0x194);}return _0xe62a02;};}function handleError(_0x3fda48,_0x47e912){_0x47e912=_0x47e912||0x1f4;return function(_0x29cbaa){logger[_0x482c('0x29')](_0x29cbaa[_0x482c('0x3b')]);if(_0x29cbaa[_0x482c('0x3c')]){delete _0x29cbaa['name'];}_0x3fda48[_0x482c('0x2e')](_0x47e912)['send'](_0x29cbaa);};}function getInteractionUsers(_0x1de7f4,_0x4fc994){return new BPromise(function(_0x234bd2,_0x47df5d){try{if(_0x4fc994[_0x1de7f4['id']]){_0x1de7f4[_0x482c('0x3d')]=_[_0x482c('0x3e')](_0x4fc994[_0x1de7f4['id']],function(_0x5942d2){return{'id':_0x5942d2['id'],'fullname':_0x5942d2[_0x482c('0x3f')]};});}}catch(_0x536816){_0x47df5d(_0x536816);}_0x234bd2(_0x1de7f4);});}function getInteractionTags(_0x5cd1b7,_0x1d0080){return new BPromise(function(_0x5ad861,_0x53ba0b){try{if(_0x5cd1b7['TagIds']){_0x5cd1b7['Tags']=[];_0x5cd1b7[_0x482c('0x40')][_0x482c('0x41')](',')[_0x482c('0x42')](function(_0x2fbcec){_0x5cd1b7[_0x482c('0x43')]['push'](_0x1d0080[_0x2fbcec]);});}delete _0x5cd1b7[_0x482c('0x40')];}catch(_0x43b8c8){_0x53ba0b(_0x43b8c8);}_0x5ad861(_0x5cd1b7);});}function updateChatInteraction(_0x45c8c2,_0xddffde,_0x5eb2f5){return new BPromise(function(_0x490641,_0xa41da0){return getInteractionUsers(_0x45c8c2,_0x5eb2f5)[_0x482c('0x22')](function(_0x4e4d91){return getInteractionTags(_0x4e4d91,_0xddffde);})[_0x482c('0x22')](function(_0x26e7f9){_0x490641(_0x26e7f9);})[_0x482c('0x2c')](function(_0x1a7257){_0xa41da0(_0x1a7257);});});}exports[_0x482c('0x44')]=function(_0x1bc15a,_0x15fc22){var _0x79d000={},_0x489131={},_0x1c8eba={'count':0x0,'rows':[]};var _0x147e0b=_[_0x482c('0x3e')](db[_0x482c('0x45')][_0x482c('0x46')],function(_0x3dd8a2){return{'name':_0x3dd8a2[_0x482c('0x47')],'type':_0x3dd8a2['type']['key']};});_0x489131[_0x482c('0x48')]=_[_0x482c('0x3e')](_0x147e0b,_0x482c('0x3c'));_0x489131['query']=_[_0x482c('0x49')](_0x1bc15a['query']);_0x489131[_0x482c('0x4a')]=_[_0x482c('0x4b')](_0x489131[_0x482c('0x48')],_0x489131[_0x482c('0x4c')]);_0x79d000['attributes']=_[_0x482c('0x4b')](_0x489131[_0x482c('0x48')],qs[_0x482c('0x4d')](_0x1bc15a['query'][_0x482c('0x4d')]));_0x79d000[_0x482c('0x4e')]=_0x79d000[_0x482c('0x4e')]['length']?_0x79d000['attributes']:_0x489131['model'];if(!_0x1bc15a['query']['hasOwnProperty']('nolimit')){_0x79d000[_0x482c('0x32')]=qs['limit'](_0x1bc15a[_0x482c('0x4c')][_0x482c('0x32')]);_0x79d000[_0x482c('0x31')]=qs[_0x482c('0x31')](_0x1bc15a[_0x482c('0x4c')][_0x482c('0x31')]);}_0x79d000[_0x482c('0x4f')]=qs[_0x482c('0x50')](_0x1bc15a[_0x482c('0x4c')][_0x482c('0x50')]);_0x79d000[_0x482c('0x51')]=qs[_0x482c('0x4a')](_[_0x482c('0x52')](_0x1bc15a[_0x482c('0x4c')],_0x489131[_0x482c('0x4a')]),_0x147e0b);var _0x3dbf6e=[];var _0x16264c=squel[_0x482c('0x53')]()[_0x482c('0x54')]('id')['field'](_0x482c('0x3c'))[_0x482c('0x54')]('color')[_0x482c('0x55')](_0x482c('0x56'));var _0x1f5e5b=squel[_0x482c('0x53')]()[_0x482c('0x54')]('u.id')['field'](_0x482c('0x57'))[_0x482c('0x54')](_0x482c('0x58'))[_0x482c('0x55')](_0x482c('0x59'),'ui')[_0x482c('0x5a')](_0x482c('0x5b'),'u','u.id\x20=\x20ui.UserId');var _0x508a10=squel['select']()[_0x482c('0x55')](_0x482c('0x5c'),'i')[_0x482c('0x5a')](_0x482c('0x5d'),'c',_0x482c('0x5e'))[_0x482c('0x5a')](_0x482c('0x5b'),'o',_0x482c('0x5f'))[_0x482c('0x5a')](_0x482c('0x60'),'a',_0x482c('0x61'))['left_join'](_0x482c('0x62'),'me',_0x482c('0x63'))[_0x482c('0x5a')](_0x482c('0x64'),'it',_0x482c('0x65'))[_0x482c('0x5a')](_0x482c('0x56'),'t',_0x482c('0x66'));var _0x369e91=squel[_0x482c('0x67')]();var _0x3981cf=[];var _0x1ff536=squel['expr']();var _0x5f579a;if(_0x1bc15a[_0x482c('0x4c')][_0x482c('0x68')]){_0x5f579a=as[_0x482c('0x69')](_0x1bc15a[_0x482c('0x4c')][_0x482c('0x68')]);var _0x313155=_0x5f579a['sqlOperator'];for(var _0x231353=0x0;_0x231353<_0x5f579a[_0x482c('0x6a')][_0x482c('0x6b')];_0x231353++){var _0x1f44f0=_0x5f579a[_0x482c('0x6a')][_0x231353];var _0x4fcc6a='i';var _0x2c517e=_[_0x482c('0x6c')](_0x147e0b,[_0x482c('0x3c'),_0x1f44f0[_0x482c('0x54')]]);if(!_0x2c517e){switch(_0x1f44f0[_0x482c('0x54')]){case _0x482c('0x6d'):if(_0x1f44f0['value']==0x1){_0x508a10[_0x482c('0x6e')]('`'+_0x1f44f0['field']+_0x482c('0x6f'));}else{_0x508a10[_0x482c('0x6e')]('`'+_0x1f44f0[_0x482c('0x54')]+_0x482c('0x70'));}break;case _0x482c('0x71'):if(_0x1f44f0[_0x482c('0x72')]==='$substring'){if(_0x1f44f0[_0x482c('0x73')][_0x482c('0x41')]('\x20')['length']>0x1){_0x369e91[_0x313155]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x482c('0x74')](_0x1f44f0[_0x482c('0x73')]),null);}else{var _0x481241='%'+_0x1f44f0[_0x482c('0x73')]+'%';_0x369e91[_0x313155](_0x482c('0x75'),_0x481241,_0x481241,_0x481241);}}else{_0x2c517e=_[_0x482c('0x6c')](_0x147e0b,[_0x482c('0x3c'),'ContactId']);_0x1f44f0[_0x482c('0x54')]=_0x482c('0x76');_0x243a37=as[_0x482c('0x77')](_0x4fcc6a,_0x2c517e[_0x482c('0x78')],_0x1f44f0);_0x369e91[_0x313155](_0x243a37[_0x482c('0x79')],_0x243a37[_0x482c('0x73')]['start'],_0x243a37['value'][_0x482c('0x2d')]);}break;case _0x482c('0x7a'):var _0x46c199=_0x1f44f0['value'][_0x482c('0x41')](',')[_0x482c('0x3e')](function(_0x48724c){return Number(_0x48724c);});_0x46c199[_0x482c('0x42')](function(_0x314ee9){_0x1ff536['or'](_0x482c('0x7b'),'%,'+_0x314ee9+',%');});_0x3981cf=_[_0x482c('0x7c')](_0x3981cf,_0x46c199);break;case _0x482c('0x7d'):if(_0x1f44f0[_0x482c('0x72')]==='$substring'){_0x369e91[_0x313155]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1f44f0[_0x482c('0x73')]+'%',null);}else{_0x2c517e=_[_0x482c('0x6c')](_0x147e0b,['name','UserId']);_0x1f44f0[_0x482c('0x54')]=_0x482c('0x7e');_0x243a37=as[_0x482c('0x77')](_0x4fcc6a,_0x2c517e['type'],_0x1f44f0);_0x369e91[_0x313155](_0x243a37['text'],_0x243a37['value'][_0x482c('0x7f')],_0x243a37[_0x482c('0x73')][_0x482c('0x2d')]);}break;case _0x482c('0x80'):_0x243a37=as[_0x482c('0x77')]('me',null,_0x1f44f0);_0x369e91[_0x313155](_0x243a37[_0x482c('0x79')],_0x243a37['value']['start'],_0x243a37[_0x482c('0x73')][_0x482c('0x2d')]);break;}}else{var _0x243a37=as[_0x482c('0x77')](_0x4fcc6a,_0x2c517e[_0x482c('0x78')],_0x1f44f0);_0x369e91[_0x313155](_0x243a37[_0x482c('0x79')],_0x243a37[_0x482c('0x73')][_0x482c('0x7f')],_0x243a37[_0x482c('0x73')][_0x482c('0x2d')]);}}}else{var _0x1591e9=_(_0x1bc15a[_0x482c('0x4c')])['keys']()[_0x482c('0x3e')](function(_0x22e18e){return _[_0x482c('0x81')](_0x147e0b,['name',_0x22e18e])?_0x22e18e:undefined;})[_0x482c('0x82')]()[_0x482c('0x73')]();if(!_[_0x482c('0x83')](_0x1591e9)){_0x1591e9['forEach'](function(_0x4751ca){if(_0x4751ca==='ChatWebsiteId'){_0x508a10['where'](_0x482c('0x84'),[][_0x482c('0x85')](_0x1bc15a[_0x482c('0x4c')][_0x4751ca]));}else if(_0x4751ca===_0x482c('0x86')){var _0xcc3fe7=JSON[_0x482c('0x87')](_0x1bc15a[_0x482c('0x4c')][_0x4751ca])['$gte'];var _0x1d497b=JSON[_0x482c('0x87')](_0x1bc15a['query'][_0x4751ca])[_0x482c('0x88')];_0x508a10['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xcc3fe7,_0x1d497b);}else{if(_0x1bc15a['query'][_0x4751ca]===_0x482c('0x89')){_0x508a10['where']('i.'+_0x4751ca+'\x20IS\x20NULL');}else{_0x508a10[_0x482c('0x51')]('i.'+_0x4751ca+_0x482c('0x8a'),_0x1bc15a['query'][_0x4751ca]);}}});}if(_0x1bc15a[_0x482c('0x4c')]['read']){if(_0x1bc15a['query']['read']==0x1){_0x508a10[_0x482c('0x6e')](_0x482c('0x8b'));}else{_0x508a10['having']('`unreadMessages`\x20>\x200');}}if(_0x1bc15a['query'][_0x482c('0x8c')]){_0x3981cf=_[_0x482c('0x8d')](_0x1bc15a[_0x482c('0x4c')]['tag'])?_0x1bc15a['query'][_0x482c('0x8c')]:new Array(_0x1bc15a['query'][_0x482c('0x8c')]);_0x3981cf[_0x482c('0x42')](function(_0x4cb228){_0x1ff536['or'](_0x482c('0x7b'),'%,'+_0x4cb228+',%');});}if(_0x1bc15a['query']['filter']){var _0x2c0056=_0x1bc15a['query'][_0x482c('0x8e')]['replace']('\x5c','\x5c\x5c')[_0x482c('0x8f')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x482c('0x90')](_0x2c0056)){_0x369e91['or'](_0x482c('0x91'),_0x2c0056+'%');}else{_0x369e91['or'](_0x482c('0x92'),qs['getFullTextValue'](_0x2c0056))['or'](_0x482c('0x93'),_0x2c0056+'%');}}}_0x508a10[_0x482c('0x51')](_0x369e91);_0x508a10[_0x482c('0x94')]('i.id');var _0x223e03={'type':db[_0x482c('0x20')][_0x482c('0x95')][_0x482c('0x96')],'raw':!![]};var _0x1bfb6b=_0x508a10[_0x482c('0x97')]();_0x1bfb6b[_0x482c('0x54')]('i.id');_0x1bfb6b[_0x482c('0x54')](_0x482c('0x98'),_0x482c('0x6d'));if(_0x79d000['order']){_0x79d000['order']['forEach'](function(_0x2b6e16){_0x508a10['order']('i.'+_0x2b6e16[0x0],_0x2b6e16[0x1]==='DESC'?![]:!![]);});}if(!_[_0x482c('0x83')](_0x3981cf)){_0x508a10['having'](_0x1ff536);_0x1bfb6b[_0x482c('0x51')](_0x482c('0x99'),_0x3981cf);}BPromise[_0x482c('0x9a')]()[_0x482c('0x22')](function(){if(!_0x5f579a){if(_0x1bc15a['query'][_0x482c('0x9b')]||_0x1bc15a['query'][_0x482c('0x9c')])return;_0x1bfb6b[_0x482c('0x51')](_0x482c('0x9d'));_0x508a10['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x1bc15a[_0x482c('0x9e')][_0x482c('0x9f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4335d7){if(_['isEmpty'](_0x4335d7)){_0x1bfb6b[_0x482c('0x51')](_0x482c('0xa0'));_0x508a10[_0x482c('0x51')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1bfb6b[_0x482c('0x51')](_0x482c('0x84'),_[_0x482c('0x3e')](_0x4335d7,'id'));_0x508a10['where'](_0x482c('0x84'),_[_0x482c('0x3e')](_0x4335d7,'id'));}});})[_0x482c('0x22')](function(){db['sequelize']['query'](_0x1bfb6b[_0x482c('0xa1')](),_0x223e03)[_0x482c('0x22')](function(_0x3f0561){_0x1c8eba['count']=_0x3f0561[_0x482c('0x6b')];if(_0x1c8eba[_0x482c('0x30')]===0x0)return[];return db['sequelize'][_0x482c('0x4c')](_0x16264c['toString'](),_0x223e03)[_0x482c('0x22')](function(_0x363735){_0x3dbf6e=_[_0x482c('0xa2')](_0x363735,'id');_0x223e03=_[_0x482c('0xa3')](_0x223e03,{'model':db[_0x482c('0x45')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1bc15a[_0x482c('0x4c')]['fields']){_0x79d000['attributes'][_0x482c('0x42')](function(_0x233926){_0x508a10[_0x482c('0x54')]('i.'+_0x233926);});}else{_0x508a10[_0x482c('0x54')](_0x482c('0x98'),_0x482c('0x6d'));_0x508a10[_0x482c('0x54')]('a.key',_0x482c('0xa4'));_0x508a10[_0x482c('0x54')](_0x482c('0xa5'),'Account.mandatoryDisposition');_0x508a10[_0x482c('0x54')](_0x482c('0xa6'));_0x508a10[_0x482c('0x54')](_0x482c('0xa7'),_0x482c('0xa8'));_0x508a10[_0x482c('0x54')](_0x482c('0xa9'),'Contact.lastName');_0x508a10[_0x482c('0x54')](_0x482c('0xaa'),_0x482c('0xab'));_0x508a10['field'](_0x482c('0xac'),'Contact.phone');_0x508a10[_0x482c('0x54')](_0x482c('0xad'),_0x482c('0xae'));_0x508a10[_0x482c('0x54')]('c.fax',_0x482c('0xaf'));_0x508a10[_0x482c('0x54')](_0x482c('0xb0'),_0x482c('0xb1'));_0x508a10['field'](_0x482c('0xb2'),_0x482c('0xb3'));_0x508a10[_0x482c('0x54')](_0x482c('0xb4'),_0x482c('0x40'));}if(_0x79d000['limit'])_0x508a10[_0x482c('0x32')](_0x79d000[_0x482c('0x32')]);if(_0x79d000[_0x482c('0x31')])_0x508a10[_0x482c('0x31')](_0x79d000[_0x482c('0x31')]);return db['sequelize'][_0x482c('0x4c')](_0x508a10[_0x482c('0xa1')](),_0x223e03);})[_0x482c('0x22')](function(_0x59d948){_0x1f5e5b[_0x482c('0x51')](_0x482c('0xb5'),_[_0x482c('0x3e')](_0x59d948,'id'));return db[_0x482c('0xb6')]['query'](_0x1f5e5b[_0x482c('0xa1')](),_0x223e03)[_0x482c('0x22')](function(_0x80d460){var _0x5cbf1a=_[_0x482c('0xb7')](_0x80d460,_0x482c('0xb8'));var _0x27101a=[];_0x59d948[_0x482c('0x42')](function(_0x561d86){_0x27101a['push'](updateChatInteraction(_0x561d86,_0x3dbf6e,_0x5cbf1a));});return BPromise['all'](_0x27101a);});});})[_0x482c('0x22')](function(_0x21fe3a){_0x1c8eba[_0x482c('0xb9')]=_0x21fe3a;return _0x1c8eba;})[_0x482c('0x22')](respondWithFilteredResult(_0x15fc22,_0x79d000));})[_0x482c('0x2c')](handleError(_0x15fc22,null));};exports[_0x482c('0xba')]=function(_0x13eb8e,_0x47d5a6){var _0x5889bc={'raw':![],'where':{'id':_0x13eb8e[_0x482c('0xbb')]['id']}},_0x544c63={};_0x544c63[_0x482c('0x48')]=_[_0x482c('0x49')](db[_0x482c('0x45')][_0x482c('0x46')]);_0x544c63[_0x482c('0x4c')]=_[_0x482c('0x49')](_0x13eb8e[_0x482c('0x4c')]);_0x544c63[_0x482c('0x4a')]=_['intersection'](_0x544c63[_0x482c('0x48')],_0x544c63[_0x482c('0x4c')]);_0x5889bc[_0x482c('0x4e')]=_[_0x482c('0x4b')](_0x544c63[_0x482c('0x48')],qs[_0x482c('0x4d')](_0x13eb8e[_0x482c('0x4c')]['fields']));_0x5889bc['attributes']=_0x5889bc['attributes'][_0x482c('0x6b')]?_0x5889bc['attributes']:_0x544c63[_0x482c('0x48')];if(_0x13eb8e[_0x482c('0x4c')]['includeAll']){_0x5889bc[_0x482c('0xbc')]=[{'all':!![]}];}_0x5889bc=_[_0x482c('0xa3')]({},_0x5889bc,_0x13eb8e[_0x482c('0xbd')]);return db[_0x482c('0x45')]['find'](_0x5889bc)[_0x482c('0x22')](handleEntityNotFound(_0x47d5a6,null))[_0x482c('0x22')](respondWithResult(_0x47d5a6,null))[_0x482c('0x2c')](handleError(_0x47d5a6,null));};exports['create']=function(_0x80e00d,_0x1d1d4e){return db[_0x482c('0x45')][_0x482c('0xbe')](_0x80e00d[_0x482c('0x80')],{})[_0x482c('0x22')](respondWithResult(_0x1d1d4e,0xc9))[_0x482c('0x2c')](handleError(_0x1d1d4e,null));};exports[_0x482c('0x38')]=function(_0x4e23a3,_0x4f4a0f){if(_0x4e23a3['body']['id']){delete _0x4e23a3['body']['id'];}return db[_0x482c('0x45')]['find']({'where':{'id':_0x4e23a3[_0x482c('0xbb')]['id']}})[_0x482c('0x22')](handleEntityNotFound(_0x4f4a0f,null))[_0x482c('0x22')](saveUpdates(_0x4e23a3[_0x482c('0x80')],null))[_0x482c('0x22')](respondWithResult(_0x4f4a0f,null))[_0x482c('0x2c')](handleError(_0x4f4a0f,null));};exports[_0x482c('0x39')]=function(_0x12ac9f,_0x315ad4){return db[_0x482c('0x45')][_0x482c('0x6c')]({'where':{'id':_0x12ac9f[_0x482c('0xbb')]['id']}})[_0x482c('0x22')](handleEntityNotFound(_0x315ad4,null))[_0x482c('0x22')](removeEntity(_0x315ad4,null))[_0x482c('0x2c')](handleError(_0x315ad4,null));};exports[_0x482c('0xbf')]=function(_0x23ac93,_0x511375){return db['ChatInteraction'][_0x482c('0xbf')]()[_0x482c('0x22')](respondWithResult(_0x511375,null))[_0x482c('0x2c')](handleError(_0x511375,null));};exports[_0x482c('0xc0')]=function(_0x1efbdc,_0x117bea){var _0x3f7d7a=_0x1efbdc[_0x482c('0xbb')]['id'];var _0x5128a6;var _0x5dffbc;var _0x3d832f;return db['ChatInteraction'][_0x482c('0xc1')]({'where':{'id':_0x3f7d7a}})[_0x482c('0x22')](function(_0x1c4e1c){_0x5128a6=_0x1c4e1c;return db[_0x482c('0xc2')][_0x482c('0xc1')]({'where':{'id':_0x1c4e1c[_0x482c('0x9b')]},'attributes':['id',_0x482c('0xc3'),'vidaooEscalation'],'raw':!![]});})[_0x482c('0x22')](function(_0x37f17e){if(_0x37f17e&&_0x37f17e[_0x482c('0xc3')]&&_0x37f17e[_0x482c('0xc4')]){_0x5dffbc=_0x37f17e;var _0x215b66={'rejectUnauthorized':![],'method':'POST','uri':_0x482c('0xc5'),'headers':{'X-APIKEY':_0x37f17e[_0x482c('0xc3')]},'body':{'name':_0x482c('0xc6')+_0x3f7d7a},'redirect':'follow','json':!![]};return rp(_0x215b66);}else{throw new db[(_0x482c('0x20'))][(_0x482c('0x21'))](_0x482c('0xc7'));}})[_0x482c('0x22')](function(_0x5c29c5){_0x3d832f=_0x5c29c5;if(_0x3d832f['id']){var _0x5335f9={'body':_0x3d832f[_0x482c('0xc8')],'ChatWebsiteId':_0x5dffbc['id'],'ChatInteractionId':_0x5128a6['id'],'direction':_0x482c('0xc9'),'UserId':_0x1efbdc['user']['id']};return db['ChatMessage']['create'](_0x5335f9,{});}else{throw new db['Sequelize'][(_0x482c('0x21'))](_0x482c('0xca'));}})[_0x482c('0x22')](function(){return _0x5128a6[_0x482c('0xcb')]({'vidaooSessionId':_0x3d832f['id']});})[_0x482c('0x22')](respondWithResult(_0x117bea,null))[_0x482c('0x2c')](handleError(_0x117bea,null));};exports['customUpdate']=function(_0x3f40e8,_0x4343b1){if(_0x3f40e8['body']['id']){delete _0x3f40e8[_0x482c('0x80')]['id'];}return db[_0x482c('0x45')][_0x482c('0x6c')]({'where':{'id':_0x3f40e8[_0x482c('0xbb')]['id']}})['then'](handleEntityNotFound(_0x4343b1,null))[_0x482c('0x22')](saveUpdates(_0x3f40e8['body'],null))[_0x482c('0x22')](respondWithResult(_0x4343b1,null))[_0x482c('0x2c')](handleError(_0x4343b1,null));};exports[_0x482c('0xcc')]=function(_0x54f2ea,_0x3bd0dd,_0x2ef4e3){if(_0x54f2ea['body']['id']){delete _0x54f2ea[_0x482c('0x80')]['id'];}return db[_0x482c('0x45')]['find']({'where':{'id':_0x54f2ea[_0x482c('0xbb')]['id']}})[_0x482c('0x22')](function(_0x36d6aa){if(!_0x36d6aa){logger[_0x482c('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x482c('0xcc'),0x194,'entity\x20not\x20found');_0x3bd0dd[_0x482c('0x3a')](0x194);}else{if(_0x36d6aa[_0x482c('0x7e')]){throw new db[(_0x482c('0x20'))][(_0x482c('0x21'))](_0x482c('0xcd'));}}return _0x36d6aa;})['then'](function(_0x50bff4){if(_0x50bff4){return _0x50bff4[_0x482c('0x38')]({'closed':_0x54f2ea[_0x482c('0x80')]['closed'],'disposition':_0x54f2ea[_0x482c('0x80')][_0x482c('0xce')]})['then'](function(_0x5e67f8){return _0x5e67f8;});}})[_0x482c('0x22')](function(_0x558d17){return respondWithRpcPromise(_0x482c('0xcf'),_0x482c('0xcc'),_0x54f2ea[_0x482c('0x80')],client9004);})[_0x482c('0x22')](respondWithResult(_0x3bd0dd,null))[_0x482c('0x2c')](handleError(_0x3bd0dd,null));};exports[_0x482c('0xd0')]=function(_0x454822,_0x2aa5ac,_0x318983){_0x454822['body'][_0x482c('0x3c')]=_0x454822['file']['originalname'];_0x454822[_0x482c('0x80')][_0x482c('0xd1')]=_0x454822['file'][_0x482c('0xd2')];_0x454822[_0x482c('0x80')][_0x482c('0x78')]=_0x454822['file'][_0x482c('0xd3')];return db[_0x482c('0xd4')]['create'](_0x454822['body'])[_0x482c('0x22')](respondWithResult(_0x2aa5ac,0xc9))[_0x482c('0x2c')](handleError(_0x2aa5ac,null));};exports['attachmentDownload']=function(_0x48caaa,_0x458189,_0x5749ae){return db['ChatInteraction'][_0x482c('0xc1')]({'where':{'id':_0x48caaa[_0x482c('0xbb')]['id']},'raw':!![]})[_0x482c('0x22')](handleEntityNotFound(_0x458189,null))[_0x482c('0x22')](function(_0x5d607c){if(_0x5d607c){if(_0x5d607c[_0x482c('0xd5')]){return _0x458189['status'](0x193)[_0x482c('0x2f')]({'status':0x193,'message':_0x482c('0xd6')});}return db[_0x482c('0xd4')][_0x482c('0xc1')]({'where':{'id':_0x48caaa['query'][_0x482c('0xd7')]},'raw':!![]})['then'](handleEntityNotFound(_0x458189,null));}})[_0x482c('0x22')](function(_0x19b08a){if(_0x19b08a){return _0x458189[_0x482c('0xd8')](path['join'](config[_0x482c('0xd9')],_0x482c('0xda'),_0x19b08a[_0x482c('0xd1')]));}})[_0x482c('0x2c')](handleError(_0x458189,null));};exports[_0x482c('0xdb')]=function(_0x4fdad6,_0x1296e6){var _0x43b80b=null;var _0x230119=null;var _0x479728=null;var _0x478c74=null;if(_0x4fdad6['body']['id']){delete _0x4fdad6[_0x482c('0x80')]['id'];}if(_0x4fdad6[_0x482c('0x80')]['mailTranscript']){_0x478c74=path['join'](config[_0x482c('0xd9')],_0x482c('0xdc'),util[_0x482c('0xdd')](_0x482c('0xde'),Date[_0x482c('0xdf')]()));_0x4fdad6[_0x482c('0x80')]['pathTranscript']=_0x478c74;}return db['ChatInteraction'][_0x482c('0x6c')]({'where':{'id':_0x4fdad6[_0x482c('0xbb')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0x482c('0x22')](handleEntityNotFound(_0x1296e6,null))['then'](saveUpdates(_0x4fdad6[_0x482c('0x80')],null))[_0x482c('0x22')](function(_0x1934e5){if(_0x1934e5){_0x43b80b=_0x1934e5;return db[_0x482c('0xc2')][_0x482c('0x6c')]({'where':{'id':_0x43b80b['ChatWebsiteId']}});}})['then'](function(_0x4fdc4d){if(_0x4fdc4d){_0x479728=_0x4fdc4d;return db['CmContact']['find']({'where':{'id':_0x43b80b['ContactId']}});}})[_0x482c('0x22')](function(_0x5eb8c9){if(_0x5eb8c9){_0x230119=_0x5eb8c9;if(_0x478c74){var _0x317558=null;for(var _0xebd616=0x1;_0xebd616<_0x43b80b[_0x482c('0xe0')][_0x482c('0x6b')];++_0xebd616){_0x317558=_0x43b80b['Messages'][_0xebd616];var _0xd67fe1=_0x317558[_0x482c('0x7e')]?util[_0x482c('0xdd')](_0x482c('0xe1'),_0x479728[_0x482c('0xe2')],_0x317558['UserId']):_0x482c('0xe3');var _0x5bdd27=_0x4fdad6['body']['customer']||util[_0x482c('0xdd')](_0x482c('0xe1'),_0x482c('0xe4'),_0x317558[_0x482c('0x76')]);switch(_0x479728['agentIdentifier']){case'website_alias':_0xd67fe1=_0x317558['UserId']?util[_0x482c('0xdd')](_0x482c('0xe1'),_0x479728[_0x482c('0xe2')],_0x317558[_0x482c('0x7e')]):_0x482c('0xe3');break;case _0x482c('0xe5'):_0xd67fe1=_0x317558[_0x482c('0x7e')]?_0x317558['User'][_0x482c('0xe6')]||_0x317558['User'][_0x482c('0x3f')]:_0x482c('0xe3');break;case _0x482c('0xe7'):_0xd67fe1=_0x317558[_0x482c('0x7e')]?_0x317558[_0x482c('0x7d')][_0x482c('0x3f')]:_0x482c('0xe3');break;default:_0xd67fe1=_0x317558[_0x482c('0x7e')]?util['format']('%s%d',_0x479728[_0x482c('0xe2')],_0x317558[_0x482c('0x7e')]):_0x482c('0xe3');}var _0xcec4c4=util[_0x482c('0xdd')](_0x482c('0xe8'),moment(_0x317558[_0x482c('0x86')])[_0x482c('0xdd')](_0x482c('0xe9')),_0x317558[_0x482c('0xea')]==='in'?_0x5bdd27:_0xd67fe1,_0x317558['body']);if(!_0x317558[_0x482c('0xeb')]){fs[_0x482c('0xec')](_0x478c74,_0xcec4c4);}}return db[_0x482c('0xed')][_0x482c('0xc1')]({'where':{'service':!![]},'include':[{'model':db[_0x482c('0xee')],'as':_0x482c('0xef'),'raw':!![]}]});}}})[_0x482c('0x22')](function(_0x236ec2){if(_0x236ec2&&_0x236ec2[_0x482c('0xef')]&&_0x4fdad6['body']){var _0x41f9fe={'tls':{'rejectUnauthorized':![]}};if(_0x236ec2[_0x482c('0xef')][_0x482c('0xf0')]){_0x41f9fe[_0x482c('0xf0')]=_0x236ec2[_0x482c('0xef')]['service'];}else{_0x41f9fe[_0x482c('0xf1')]=_0x236ec2[_0x482c('0xef')][_0x482c('0xf1')];_0x41f9fe[_0x482c('0xf2')]=_0x236ec2[_0x482c('0xef')][_0x482c('0xf2')];_0x41f9fe[_0x482c('0xf3')]=_0x236ec2['Smtp'][_0x482c('0xf3')];}if(_0x236ec2[_0x482c('0xef')][_0x482c('0xf4')]){_0x41f9fe['auth']={'user':_0x236ec2[_0x482c('0xef')][_0x482c('0x9e')],'pass':_0x236ec2[_0x482c('0xef')][_0x482c('0xf5')]};}return respondWithRpcPromise(_0x482c('0xf6'),'sendMail',{'account':_0x41f9fe,'message':{'from':util[_0x482c('0xdd')](_0x482c('0xf7'),_0x236ec2[_0x482c('0x3c')],_0x236ec2[_0x482c('0xf8')]||_0x236ec2[_0x482c('0xef')][_0x482c('0x9e')]),'to':_0x4fdad6[_0x482c('0x80')][_0x482c('0xf9')],'subject':'Mail\x20Transcript','text':util[_0x482c('0xdd')](_0x482c('0xfa'),_0x4fdad6[_0x482c('0x80')][_0x482c('0xf9')]),'attachments':[{'path':_0x478c74}]}})[_0x482c('0x22')](function(){return _0x43b80b;})[_0x482c('0x2c')](function(_0x16be60){console['error'](_0x16be60);});}else{return _0x43b80b;}})[_0x482c('0x22')](respondWithStatusCode(_0x1296e6,0xc8))[_0x482c('0x2c')](handleError(_0x1296e6,null));};exports[_0x482c('0xfb')]=function(_0x25c6ca,_0x1d5b30,_0x197c2b){return db[_0x482c('0xfc')]['find']({'where':{'id':_0x25c6ca[_0x482c('0xbb')]['id']}})[_0x482c('0x22')](handleEntityNotFound(_0x1d5b30,null))[_0x482c('0x22')](function(_0x2229bc){if(_0x2229bc){return _0x2229bc[_0x482c('0xfb')](_0x25c6ca[_0x482c('0x80')][_0x482c('0xfd')],_[_0x482c('0xfe')](_0x25c6ca[_0x482c('0x80')],[_0x482c('0xfd'),'id'])||{});}})[_0x482c('0x22')](respondWithResult(_0x1d5b30,null))[_0x482c('0x2c')](handleError(_0x1d5b30,null));};exports[_0x482c('0xff')]=function(_0x4b6ad0,_0x211956,_0x33b088){var _0x2cb7ee={'raw':![],'where':{}};var _0x48cf63={};var _0x5cfd92={'count':0x0,'rows':[]};return db[_0x482c('0x45')][_0x482c('0xc1')]({'where':{'id':_0x4b6ad0[_0x482c('0xbb')]['id']}})[_0x482c('0x22')](handleEntityNotFound(_0x211956,null))['then'](function(_0x4f77fa){if(_0x4f77fa){_0x48cf63[_0x482c('0x48')]=_['keys'](db[_0x482c('0xfc')][_0x482c('0x46')]);_0x48cf63[_0x482c('0x4c')]=_[_0x482c('0x49')](_0x4b6ad0[_0x482c('0x4c')]);_0x48cf63[_0x482c('0x4a')]=_['intersection'](_0x48cf63['model'],_0x48cf63[_0x482c('0x4c')]);_0x2cb7ee[_0x482c('0x4e')]=_['intersection'](_0x48cf63[_0x482c('0x48')],qs[_0x482c('0x4d')](_0x4b6ad0[_0x482c('0x4c')][_0x482c('0x4d')]));_0x2cb7ee['attributes']=_0x2cb7ee[_0x482c('0x4e')][_0x482c('0x6b')]?_0x2cb7ee[_0x482c('0x4e')]:_0x48cf63[_0x482c('0x48')];if(!_0x4b6ad0['query'][_0x482c('0x100')](_0x482c('0x101'))){_0x2cb7ee[_0x482c('0x32')]=qs[_0x482c('0x32')](_0x4b6ad0[_0x482c('0x4c')][_0x482c('0x32')]);_0x2cb7ee[_0x482c('0x31')]=qs[_0x482c('0x31')](_0x4b6ad0['query'][_0x482c('0x31')]);}_0x2cb7ee[_0x482c('0x4f')]=qs['sort'](_0x4b6ad0[_0x482c('0x4c')][_0x482c('0x50')]);_0x2cb7ee[_0x482c('0x51')]=qs[_0x482c('0x4a')](_['pick'](_0x4b6ad0[_0x482c('0x4c')],_0x48cf63[_0x482c('0x4a')]));_0x2cb7ee[_0x482c('0x51')][_0x482c('0xb8')]=_0x4f77fa['id'];if(_0x4b6ad0[_0x482c('0x4c')][_0x482c('0x8e')]){_0x2cb7ee[_0x482c('0x51')]=_[_0x482c('0xa3')](_0x2cb7ee[_0x482c('0x51')],{'$or':_['map'](_0x2cb7ee[_0x482c('0x4e')],function(_0x1da02b){var _0x24071b={};_0x24071b[_0x1da02b]={'$like':'%'+_0x4b6ad0['query'][_0x482c('0x8e')]+'%'};return _0x24071b;})});}if(_0x4b6ad0[_0x482c('0x4c')]['$gte']){var _0x144688=_0x4b6ad0['query']['$gte'][_0x482c('0x41')](',');var _0x2bfe53={};_0x2bfe53[_0x144688[0x0]]={'$gte':moment(_0x144688[0x1])['format'](_0x482c('0x102'))};_0x2cb7ee[_0x482c('0x51')]=_['merge'](_0x2cb7ee[_0x482c('0x51')],_0x2bfe53);}_0x2cb7ee=_[_0x482c('0xa3')]({},_0x2cb7ee,_0x4b6ad0[_0x482c('0xbd')]);return db['ChatMessage'][_0x482c('0x30')]({'where':_0x2cb7ee['where']})[_0x482c('0x22')](function(_0x5606d8){_0x5cfd92[_0x482c('0x30')]=_0x5606d8;if(_0x4b6ad0[_0x482c('0x4c')]['includeAll']){_0x2cb7ee[_0x482c('0xbc')]=[{'all':!![]}];}return db['ChatMessage'][_0x482c('0x103')](_0x2cb7ee);})[_0x482c('0x22')](function(_0x3ef041){_0x5cfd92['rows']=_0x3ef041;return _0x5cfd92;});}})[_0x482c('0x22')](respondWithFilteredResult(_0x211956,_0x2cb7ee))[_0x482c('0x2c')](handleError(_0x211956,null));};exports[_0x482c('0x104')]=function(_0x4762d8,_0x37f170,_0x34cf23){var _0x479a28={'where':{}},_0x3bb8b7={},_0x2527a6={'count':0x0,'rows':[]};return db[_0x482c('0x45')][_0x482c('0xc1')]({'where':{'id':_0x4762d8[_0x482c('0xbb')]['id']}})[_0x482c('0x22')](handleEntityNotFound(_0x37f170,null))[_0x482c('0x22')](function(_0xc69633){if(_0xc69633){_0x3bb8b7['model']=_[_0x482c('0x49')](db['ChatMessage'][_0x482c('0x46')]);_0x3bb8b7['query']=_[_0x482c('0x49')](_0x4762d8[_0x482c('0x4c')]);_0x3bb8b7[_0x482c('0x4a')]=_[_0x482c('0x4b')](_0x3bb8b7['model'],_0x3bb8b7['query']);_0x479a28['attributes']=_['intersection'](_0x3bb8b7[_0x482c('0x48')],qs[_0x482c('0x4d')](_0x4762d8[_0x482c('0x4c')][_0x482c('0x4d')]));_0x479a28[_0x482c('0x4e')]=_0x479a28['attributes'][_0x482c('0x6b')]?_0x479a28[_0x482c('0x4e')]:_0x3bb8b7[_0x482c('0x48')];if(!_0x4762d8[_0x482c('0x4c')][_0x482c('0x100')]('nolimit')){_0x479a28[_0x482c('0x32')]=qs[_0x482c('0x32')](_0x4762d8[_0x482c('0x4c')][_0x482c('0x32')]);_0x479a28[_0x482c('0x31')]=qs[_0x482c('0x31')](_0x4762d8[_0x482c('0x4c')][_0x482c('0x31')]);}_0x479a28[_0x482c('0x4f')]=qs[_0x482c('0x50')](_0x4762d8[_0x482c('0x4c')]['sort']);_0x479a28[_0x482c('0x51')]=qs[_0x482c('0x4a')](_[_0x482c('0x52')](_0x4762d8[_0x482c('0x4c')],_0x3bb8b7[_0x482c('0x4a')]));_0x479a28[_0x482c('0x51')][_0x482c('0xb8')]=_0xc69633['id'];if(_0x4762d8['query']['filter']){_0x479a28[_0x482c('0x51')]=_['merge'](_0x479a28[_0x482c('0x51')],{'$or':_[_0x482c('0x3e')](_0x479a28['attributes'],function(_0x408818){var _0x6fe46d={};_0x6fe46d[_0x408818]={'$like':'%'+_0x4762d8['query'][_0x482c('0x8e')]+'%'};return _0x6fe46d;})});}_0x479a28[_0x482c('0x51')][_0x482c('0xeb')]=![];if(_0x4762d8[_0x482c('0x4c')]['id']){_0x479a28[_0x482c('0x51')]['id']={'$gt':_0x4762d8[_0x482c('0x4c')]['id']};}_0x479a28=_[_0x482c('0xa3')]({},_0x479a28,_0x4762d8['options']);return db[_0x482c('0xfc')]['count']({'where':_0x479a28['where']})[_0x482c('0x22')](function(_0x1cc958){_0x2527a6[_0x482c('0x30')]=_0x1cc958;_0x479a28[_0x482c('0xbc')]=[];if(_0x4762d8['query'][_0x482c('0x105')]){_0x479a28['include']['push']({'model':db[_0x482c('0x7d')],'as':_0x482c('0x7d'),'attributes':['id',_0x482c('0x3f'),_0x482c('0xe6')]});}if(_0x4762d8[_0x482c('0x4c')][_0x482c('0x106')]){_0x479a28[_0x482c('0xbc')]=[{'all':!![]}];}return db[_0x482c('0xfc')][_0x482c('0x103')](_0x479a28);})['then'](function(_0x28e7c3){_0x2527a6[_0x482c('0xb9')]=_0x28e7c3;return _0x2527a6;});}})['then'](respondWithFilteredResult(_0x37f170,_0x479a28))[_0x482c('0x2c')](handleError(_0x37f170,null));};exports['addTags']=function(_0x36e33f,_0x430e34,_0x5196ed){return db[_0x482c('0x45')][_0x482c('0x6c')]({'where':{'id':_0x36e33f[_0x482c('0xbb')]['id']}})['then'](handleEntityNotFound(_0x430e34,null))['then'](function(_0x404f87){if(_0x404f87){return _0x404f87[_0x482c('0x107')](_0x36e33f[_0x482c('0x80')][_0x482c('0xfd')],_['omit'](_0x36e33f[_0x482c('0x80')],['ids','id'])||{})[_0x482c('0x108')](function(){return db[_0x482c('0x7a')][_0x482c('0x103')]({'attributes':['id',_0x482c('0x3c'),_0x482c('0x109')],'where':{'id':_0x36e33f[_0x482c('0x80')][_0x482c('0xfd')]}});})[_0x482c('0x22')](function(_0x5260a1){socket[_0x482c('0x10a')](_0x482c('0x10b'),{'id':Number(_0x36e33f[_0x482c('0xbb')]['id']),'tags':_0x5260a1||[]});return{'id':Number(_0x36e33f[_0x482c('0xbb')]['id']),'tags':_0x5260a1||[]};});}})['then'](respondWithResult(_0x430e34,null))[_0x482c('0x2c')](handleError(_0x430e34,null));};exports[_0x482c('0x10c')]=function(_0x27cb33,_0x585977,_0x41c326){return db[_0x482c('0x45')][_0x482c('0x6c')]({'where':{'id':_0x27cb33[_0x482c('0xbb')]['id']}})['then'](handleEntityNotFound(_0x585977,null))[_0x482c('0x22')](function(_0x3c99f8){if(_0x3c99f8){return _0x3c99f8[_0x482c('0x10c')](_0x27cb33[_0x482c('0x4c')]['ids']);}})[_0x482c('0x22')](respondWithStatusCode(_0x585977,null))[_0x482c('0x2c')](handleError(_0x585977,null));};exports['download']=function(_0x17d784,_0x2ab8b4){var _0x3e2629=moment()[_0x482c('0x10d')]()[_0x482c('0xa1')]();var _0x5b650d=path[_0x482c('0x10e')](config[_0x482c('0xd9')],_0x482c('0x10f'),'files',_0x482c('0x110'));var _0x566966=path[_0x482c('0x10e')](config[_0x482c('0xd9')],_0x482c('0x10f'),_0x482c('0x111'),_0x482c('0x112'));var _0x35ae33=path['join'](_0x5b650d,_0x3e2629);var _0xd733b1=util[_0x482c('0xdd')](_0x482c('0x113'),_0x17d784['params']['id'],_0x3e2629);var _0xfd6993=path['join'](_0x5b650d,_0xd733b1);var _0x14d2b1=[];_0x14d2b1['push']({'model':db[_0x482c('0x7d')],'as':_0x482c('0x7d'),'attributes':['id',_0x482c('0x3f')],'raw':!![]});_0x14d2b1[_0x482c('0x114')]({'model':db['CmContact'],'as':_0x482c('0x71'),'attributes':['id',_0x482c('0x115'),_0x482c('0x116')],'raw':!![]});if(_0x17d784['query'][_0x482c('0x112')]){_0x14d2b1[_0x482c('0x114')]({'model':db[_0x482c('0xd4')],'as':_0x482c('0xd4'),'raw':!![]});}var _0x744513=[{'model':db[_0x482c('0xfc')],'as':'Messages','attributes':['id',_0x482c('0x80'),_0x482c('0x86'),_0x482c('0xea'),_0x482c('0xeb'),'read'],'include':_0x14d2b1}];_0x744513['push']({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x482c('0x3c')]});_0x744513['push']({'model':db[_0x482c('0x7d')],'as':_0x482c('0x117'),'attributes':['id',_0x482c('0x3f')]});return db[_0x482c('0x45')]['find']({'where':{'id':_0x17d784['params']['id']},'include':_0x744513})['then'](handleEntityNotFound(_0x2ab8b4,null))['then'](function(_0x32ab13){if(_0x32ab13){var _0x316d63=_0x32ab13['get']({'plain':!![]});fs[_0x482c('0x118')](_0x35ae33);var _0x2e69fb={'format':'A4','border':'10px','header':{'height':_0x482c('0x119'),'contents':{'first':_0x482c('0x11a')}},'footer':{'height':_0x482c('0x11b'),'contents':{'default':util['format'](_0x482c('0x11c'),util['format']('%s\x20#%d',_0x482c('0x11d'),_0x316d63['id']),moment()[_0x482c('0xdd')]('YYYY-MM-DD')[_0x482c('0xa1')]())}}};var _0x3fd051={'channel':_0x482c('0x11d'),'account':_0x316d63[_0x482c('0x11e')]['name'],'agent':_0x316d63[_0x482c('0x117')]?_0x316d63[_0x482c('0x117')][_0x482c('0x3f')]:_0x482c('0x11f'),'createdAt':moment(_0x316d63[_0x482c('0x86')])[_0x482c('0xdd')](_0x482c('0x102'))[_0x482c('0xa1')](),'closedAt':_0x316d63[_0x482c('0xd5')]?moment(_0x316d63[_0x482c('0x120')])['format'](_0x482c('0x102'))[_0x482c('0xa1')]():'','disposition':_0x316d63[_0x482c('0xce')],'chatInfo':{'browser':_0x316d63['browserName'],'os':_0x316d63[_0x482c('0x121')],'referer':_0x316d63[_0x482c('0x122')],'customerIp':_0x316d63[_0x482c('0x123')],'customerPort':_0x316d63['customerPort']?_0x316d63['customerPort']:_0x482c('0x11f')},'messages':_(_0x316d63[_0x482c('0xe0')])[_0x482c('0x124')]()[_0x482c('0x8e')]({'secret':![]})[_0x482c('0x3e')](function(_0x3faf40){if(_0x3faf40['Attachment']){var _0xb9756c=path[_0x482c('0x10e')](_0x566966,_0x3faf40[_0x482c('0xd4')][_0x482c('0xd1')]);if(fs[_0x482c('0x125')](_0xb9756c)){fs[_0x482c('0x126')](_0xb9756c)['pipe'](fs[_0x482c('0x127')](path[_0x482c('0x10e')](_0x35ae33,_0x3faf40['Attachment'][_0x482c('0xd1')])));}}return{'date':moment(_0x3faf40[_0x482c('0x86')])[_0x482c('0xdd')](_0x482c('0x102'))[_0x482c('0xa1')](),'sender':_0x3faf40['direction']===_0x482c('0xc9')?_0x3faf40[_0x482c('0x7d')]?_0x3faf40['User'][_0x482c('0x3f')]:_0x482c('0xe3'):_0x3faf40[_0x482c('0x71')]['firstName']+(_0x3faf40['Contact'][_0x482c('0x116')]?'\x20'+_0x3faf40[_0x482c('0x71')][_0x482c('0x116')]:''),'body':_0x3faf40[_0x482c('0xd4')]?_0x3faf40[_0x482c('0xd4')]['basename']:_0x3faf40['body'],'direction':_0x3faf40['direction']===_0x482c('0xc9')?'A':'C','secret':_0x3faf40[_0x482c('0xeb')],'read':_0x3faf40[_0x482c('0x128')],'attachment':_0x3faf40[_0x482c('0xd4')]};})[_0x482c('0x73')]()};return ejs[_0x482c('0x129')](path[_0x482c('0x10e')](config[_0x482c('0xd9')],'server',_0x482c('0x12a'),_0x482c('0x12b')),{'interaction':_0x3fd051})['then'](function(_0x70c1bb){return new BPromise(function(_0x5451e8,_0x2a8e97){pdf['create'](_0x70c1bb,_0x2e69fb)[_0x482c('0x12c')](path[_0x482c('0x10e')](_0x35ae33,_0x482c('0x12d')+_0x316d63['id']+'-'+_0x3e2629+_0x482c('0x12e')),function(_0x346194,_0x4a89ee){if(_0x346194)return _0x2a8e97(_0x346194);_0x5451e8(_0x4a89ee);});});})[_0x482c('0x22')](function(){return new BPromise(function(_0x4f3580,_0x5a941c){zipdir(_0x35ae33,{'saveTo':_0xfd6993},function(_0x22079c,_0x281ea3){if(_0x22079c)return _0x5a941c(_0x22079c);return _0x4f3580(_0x281ea3);});})[_0x482c('0x22')](function(){return new BPromise(function(_0x465a29,_0x2be39e){rimraf(_0x35ae33,function(_0x79c491){if(_0x79c491)_0x2be39e(_0x79c491);return _0x465a29();});});})[_0x482c('0x22')](function(){return _0x2ab8b4[_0x482c('0xd8')](_0xfd6993,_0xd733b1,function(_0x1b3f43){if(_0x1b3f43){console[_0x482c('0x12f')](_0x482c('0x130'),_0x1b3f43);}else{fs[_0x482c('0x131')](_0xfd6993);}});});});}else{return _0x2ab8b4[_0x482c('0x3a')](0xc8);}})[_0x482c('0x2c')](handleError(_0x2ab8b4,null));};
\ No newline at end of file
index 6ab4290..49053dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4343=['ChatMessage','setMaxListeners','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','ChatInteraction'];(function(_0x594f9e,_0x17aa89){var _0x3e82cc=function(_0x464124){while(--_0x464124){_0x594f9e['push'](_0x594f9e['shift']());}};_0x3e82cc(++_0x17aa89);}(_0x4343,0x1ae));var _0x3434=function(_0x4ee863,_0x3a060b){_0x4ee863=_0x4ee863-0x0;var _0x588d9c=_0x4343[_0x4ee863];return _0x588d9c;};'use strict';var EventEmitter=require(_0x3434('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3434('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x3434('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3434('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3434('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd15cf3){return function(_0x3d6712,_0x308d46,_0x4193e9){_0x3d6712[_0x3434('0x5')]({'attributes':['id'],'raw':!![]})[_0x3434('0x6')](function(_0x1e1901){_0x3d6712[_0x3434('0x7')](_0x3434('0x8'),_0x1e1901['map'](function(_0x9d1e6b){return{'id':_0x9d1e6b['id']};}));return ChatMessage[_0x3434('0x9')]({'where':{'ChatInteractionId':_0x3d6712['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3434('0x6')](function(_0x3b7dcd){_0x3d6712[_0x3434('0x7')](_0x3434('0xa'),_0x3b7dcd[_0x3434('0xb')]);ChatInteractionEvents['emit'](_0xd15cf3+':'+_0x3d6712['id'],_0x3d6712);ChatInteractionEvents[_0x3434('0xc')](_0xd15cf3,_0x3d6712);_0x4193e9(null);})[_0x3434('0xd')](_0x4193e9(null));};}for(var e in events){if(events[_0x3434('0xe')](e)){var event=events[e];ChatInteraction[_0x3434('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0xbe52=['hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','remove','setDataValue','Users','map','findAll','then','emit'];(function(_0x8cd627,_0x1bf5ca){var _0x7e454=function(_0x562038){while(--_0x562038){_0x8cd627['push'](_0x8cd627['shift']());}};_0x7e454(++_0x1bf5ca);}(_0xbe52,0x133));var _0x2be5=function(_0x1c9a26,_0x5867dc){_0x1c9a26=_0x1c9a26-0x0;var _0x41a520=_0xbe52[_0x1c9a26];return _0x41a520;};'use strict';var EventEmitter=require(_0x2be5('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x2be5('0x1')];var ChatMessage=require(_0x2be5('0x2'))['db'][_0x2be5('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2be5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2be5('0x5'),'afterDestroy':_0x2be5('0x6')};function emitEvent(_0x1e0db1){return function(_0x438a7d,_0x345695,_0x5df3d4){_0x438a7d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4998d0){_0x438a7d[_0x2be5('0x7')](_0x2be5('0x8'),_0x4998d0[_0x2be5('0x9')](function(_0x4d1794){return{'id':_0x4d1794['id']};}));return ChatMessage[_0x2be5('0xa')]({'where':{'ChatInteractionId':_0x438a7d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2be5('0xb')](function(_0x3e6932){_0x438a7d[_0x2be5('0x7')]('unreadMessages',_0x3e6932['length']);ChatInteractionEvents[_0x2be5('0xc')](_0x1e0db1+':'+_0x438a7d['id'],_0x438a7d);ChatInteractionEvents[_0x2be5('0xc')](_0x1e0db1,_0x438a7d);_0x5df3d4(null);})['catch'](_0x5df3d4(null));};}for(var e in events){if(events[_0x2be5('0xd')](e)){var event=events[e];ChatInteraction[_0x2be5('0xe')](e,emitEvent(event));}}module[_0x2be5('0xf')]=ChatInteractionEvents;
\ No newline at end of file
index fb1f051..7a4f382 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc517=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x293483,_0x2c0bf8){var _0x420590=function(_0x362bdf){while(--_0x362bdf){_0x293483['push'](_0x293483['shift']());}};_0x420590(++_0x2c0bf8);}(_0xc517,0x11c));var _0x7c51=function(_0x501510,_0x3ed20c){_0x501510=_0x501510-0x0;var _0x2eadaf=_0xc517[_0x501510];return _0x2eadaf;};'use strict';var _=require('lodash');var util=require(_0x7c51('0x0'));var logger=require(_0x7c51('0x1'))(_0x7c51('0x2'));var moment=require(_0x7c51('0x3'));var BPromise=require(_0x7c51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c51('0x5'));var config=require(_0x7c51('0x6'));var attributes=require(_0x7c51('0x7'));module[_0x7c51('0x8')]=function(_0x1b3bc8,_0x314d63){return _0x1b3bc8[_0x7c51('0x9')](_0x7c51('0xa'),attributes,{'tableName':_0x7c51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xfd6045,_0x1a0c60,_0x233d73){if(_0xfd6045[_0x7c51('0xc')](_0x7c51('0xd'))){_0xfd6045[_0x7c51('0xe')]=moment()['format'](_0x7c51('0xf'));}_0x233d73(null,_0xfd6045);}},'charset':'utf8mb4','collate':_0x7c51('0x10')});};
\ No newline at end of file
+var _0xd9fd=['lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4b8708,_0x444304){var _0x15170b=function(_0x2da153){while(--_0x2da153){_0x4b8708['push'](_0x4b8708['shift']());}};_0x15170b(++_0x444304);}(_0xd9fd,0x140));var _0xdd9f=function(_0x286003,_0x31d2d4){_0x286003=_0x286003-0x0;var _0x83ffb6=_0xd9fd[_0x286003];return _0x83ffb6;};'use strict';var _=require(_0xdd9f('0x0'));var util=require(_0xdd9f('0x1'));var logger=require('../../config/logger')(_0xdd9f('0x2'));var moment=require('moment');var BPromise=require(_0xdd9f('0x3'));var rp=require(_0xdd9f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd9f('0x5'));var config=require(_0xdd9f('0x6'));var attributes=require('./chatInteraction.attributes');module[_0xdd9f('0x7')]=function(_0x212d17,_0x2261f5){return _0x212d17[_0xdd9f('0x8')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a493c,_0x48a450,_0x9bd6cd){if(_0x4a493c[_0xdd9f('0x9')](_0xdd9f('0xa'))){_0x4a493c[_0xdd9f('0xb')]=moment()[_0xdd9f('0xc')](_0xdd9f('0xd'));}_0x9bd6cd(null,_0x4a493c);}},'charset':_0xdd9f('0xe'),'collate':_0xdd9f('0xf')});};
\ No newline at end of file
index bc2cd13..017c095 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfcd=['http','defaults','redis','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x3357b8,_0xeb406){var _0x50737a=function(_0x43a94b){while(--_0x43a94b){_0x3357b8['push'](_0x3357b8['shift']());}};_0x50737a(++_0xeb406);}(_0xdfcd,0x6f));var _0xddfc=function(_0x573b9e,_0x42fac2){_0x573b9e=_0x573b9e-0x0;var _0x258f02=_0xdfcd[_0x573b9e];return _0x258f02;};'use strict';var _=require(_0xddfc('0x0'));var util=require(_0xddfc('0x1'));var moment=require(_0xddfc('0x2'));var BPromise=require('bluebird');var rs=require(_0xddfc('0x3'));var fs=require('fs');var Redis=require(_0xddfc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xddfc('0x5'))(_0xddfc('0x6'));var config=require('../../config/environment');var jayson=require(_0xddfc('0x7'));var client=jayson[_0xddfc('0x8')][_0xddfc('0x9')]({'port':0x232a});config['redis']=_[_0xddfc('0xa')](config[_0xddfc('0xb')],{'host':_0xddfc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xddfc('0xd'))[_0xddfc('0xe')](socket);function respondWithRpcPromise(_0x5d6b2e,_0x3a5ce2,_0x406fa8){return new BPromise(function(_0x509fa1,_0x4418b0){return client[_0xddfc('0xf')](_0x5d6b2e,_0x406fa8)[_0xddfc('0x10')](function(_0x114991){logger[_0xddfc('0x11')](_0xddfc('0x12'),_0x3a5ce2,_0xddfc('0x13'));logger[_0xddfc('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3a5ce2,_0xddfc('0x13'),JSON['stringify'](_0x114991));if(_0x114991[_0xddfc('0x15')]){if(_0x114991[_0xddfc('0x15')][_0xddfc('0x16')]===0x1f4){logger[_0xddfc('0x15')](_0xddfc('0x12'),_0x3a5ce2,_0x114991[_0xddfc('0x15')][_0xddfc('0x17')]);return _0x4418b0(_0x114991[_0xddfc('0x15')]['message']);}logger[_0xddfc('0x15')](_0xddfc('0x12'),_0x3a5ce2,_0x114991[_0xddfc('0x15')][_0xddfc('0x17')]);return _0x509fa1(_0x114991[_0xddfc('0x15')]['message']);}else{logger[_0xddfc('0x11')](_0xddfc('0x12'),_0x3a5ce2,_0xddfc('0x13'));_0x509fa1(_0x114991[_0xddfc('0x18')][_0xddfc('0x17')]);}})[_0xddfc('0x19')](function(_0x50a7b1){logger[_0xddfc('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3a5ce2,_0x50a7b1);_0x4418b0(_0x50a7b1);});});}exports[_0xddfc('0x1a')]=function(_0x1791aa){var _0x5da954=this;return new Promise(function(_0x46f97a,_0x23ef03){return db[_0xddfc('0x1b')][_0xddfc('0x1c')](_0x1791aa[_0xddfc('0x1d')],{'raw':_0x1791aa[_0xddfc('0x1e')]?_0x1791aa[_0xddfc('0x1e')][_0xddfc('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1791aa[_0xddfc('0x1e')]?_0x1791aa['options'][_0xddfc('0x20')]||null:null,'attributes':_0x1791aa['options']?_0x1791aa[_0xddfc('0x1e')][_0xddfc('0x21')]||null:null,'limit':_0x1791aa[_0xddfc('0x1e')]?_0x1791aa[_0xddfc('0x1e')][_0xddfc('0x22')]||null:null})[_0xddfc('0x10')](function(_0x8b3251){logger[_0xddfc('0x11')](_0xddfc('0x1a'),_0x1791aa);logger[_0xddfc('0x14')](_0xddfc('0x1a'),_0x1791aa,JSON[_0xddfc('0x23')](_0x8b3251));_0x46f97a(_0x8b3251);})[_0xddfc('0x19')](function(_0x1fb93a){logger[_0xddfc('0x15')](_0xddfc('0x1a'),_0x1fb93a[_0xddfc('0x17')],_0x1791aa);_0x23ef03(_0x5da954['error'](0x1f4,_0x1fb93a[_0xddfc('0x17')]));});});};exports[_0xddfc('0x24')]=function(_0x3b7994){return new Promise(function(_0x256622,_0x594acf){return db['ChatInteraction']['find']({'where':_0x3b7994['options']?_0x3b7994[_0xddfc('0x1e')][_0xddfc('0x20')]||null:null})[_0xddfc('0x10')](function(_0x336eae){if(_0x336eae){return _0x336eae['addTags'](_0x3b7994[_0xddfc('0x1d')][_0xddfc('0x25')],_[_0xddfc('0x26')](_0x3b7994[_0xddfc('0x1d')],[_0xddfc('0x25'),'id'])||{});}})['spread'](function(_0x400e23){logger[_0xddfc('0x11')](_0xddfc('0x27'),_0x3b7994);logger['debug']('AddTags',_0x3b7994,JSON[_0xddfc('0x23')](_0x400e23));_0x256622(_0x400e23);})[_0xddfc('0x19')](function(_0x8b914b){logger[_0xddfc('0x15')](_0xddfc('0x27'),_0x8b914b['message'],_0x3b7994);_0x594acf(_this[_0xddfc('0x15')](0x1f4,_0x8b914b['message']));});});};
\ No newline at end of file
+var _0x20d6=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','AddTagsToChatInteraction','find','then','addTags','ids','spread','AddTags','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4656fe,_0xf16c21){var _0x156907=function(_0x455d2a){while(--_0x455d2a){_0x4656fe['push'](_0x4656fe['shift']());}};_0x156907(++_0xf16c21);}(_0x20d6,0xea));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x620d('0x2'))['db'];var utils=require(_0x620d('0x3'));var logger=require(_0x620d('0x4'))('rpc');var config=require(_0x620d('0x5'));var jayson=require(_0x620d('0x6'));var client=jayson[_0x620d('0x7')]['http']({'port':0x232a});config[_0x620d('0x8')]=_[_0x620d('0x9')](config[_0x620d('0x8')],{'host':_0x620d('0xa'),'port':0x18eb});var socket=require(_0x620d('0xb'))(new Redis(config[_0x620d('0x8')]));require(_0x620d('0xc'))[_0x620d('0xd')](socket);function respondWithRpcPromise(_0xfc529,_0xc98470,_0x4e54c0){return new BPromise(function(_0x527585,_0x1ec1b1){return client[_0x620d('0xe')](_0xfc529,_0x4e54c0)['then'](function(_0x11ced6){logger[_0x620d('0xf')](_0x620d('0x10'),_0xc98470,_0x620d('0x11'));logger[_0x620d('0x12')](_0x620d('0x13'),_0xc98470,_0x620d('0x11'),JSON[_0x620d('0x14')](_0x11ced6));if(_0x11ced6[_0x620d('0x15')]){if(_0x11ced6[_0x620d('0x15')]['code']===0x1f4){logger[_0x620d('0x15')](_0x620d('0x10'),_0xc98470,_0x11ced6[_0x620d('0x15')][_0x620d('0x16')]);return _0x1ec1b1(_0x11ced6[_0x620d('0x15')][_0x620d('0x16')]);}logger[_0x620d('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xc98470,_0x11ced6[_0x620d('0x15')][_0x620d('0x16')]);return _0x527585(_0x11ced6['error'][_0x620d('0x16')]);}else{logger[_0x620d('0xf')](_0x620d('0x10'),_0xc98470,'request\x20sent');_0x527585(_0x11ced6[_0x620d('0x17')]['message']);}})[_0x620d('0x18')](function(_0x216a92){logger[_0x620d('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xc98470,_0x216a92);_0x1ec1b1(_0x216a92);});});}exports[_0x620d('0x19')]=function(_0x1590ff){var _0x13ec66=this;return new Promise(function(_0x8c98f5,_0x3ca25f){return db[_0x620d('0x1a')][_0x620d('0x1b')](_0x1590ff[_0x620d('0x1c')],{'raw':_0x1590ff[_0x620d('0x1d')]?_0x1590ff[_0x620d('0x1d')][_0x620d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1590ff['options']?_0x1590ff[_0x620d('0x1d')][_0x620d('0x1f')]||null:null,'attributes':_0x1590ff['options']?_0x1590ff[_0x620d('0x1d')][_0x620d('0x20')]||null:null,'limit':_0x1590ff['options']?_0x1590ff[_0x620d('0x1d')]['limit']||null:null})['then'](function(_0x3505e4){logger[_0x620d('0xf')]('UpdateChatInteraction',_0x1590ff);logger[_0x620d('0x12')](_0x620d('0x19'),_0x1590ff,JSON[_0x620d('0x14')](_0x3505e4));_0x8c98f5(_0x3505e4);})[_0x620d('0x18')](function(_0x54e779){logger[_0x620d('0x15')](_0x620d('0x19'),_0x54e779[_0x620d('0x16')],_0x1590ff);_0x3ca25f(_0x13ec66['error'](0x1f4,_0x54e779[_0x620d('0x16')]));});});};exports[_0x620d('0x21')]=function(_0x7786f7){return new Promise(function(_0x2d6412,_0x4b730d){return db[_0x620d('0x1a')][_0x620d('0x22')]({'where':_0x7786f7[_0x620d('0x1d')]?_0x7786f7[_0x620d('0x1d')][_0x620d('0x1f')]||null:null})[_0x620d('0x23')](function(_0xcc06f4){if(_0xcc06f4){return _0xcc06f4[_0x620d('0x24')](_0x7786f7['body']['ids'],_['omit'](_0x7786f7[_0x620d('0x1c')],[_0x620d('0x25'),'id'])||{});}})[_0x620d('0x26')](function(_0x46a01a){logger[_0x620d('0xf')](_0x620d('0x27'),_0x7786f7);logger[_0x620d('0x12')](_0x620d('0x27'),_0x7786f7,JSON['stringify'](_0x46a01a));_0x2d6412(_0x46a01a);})[_0x620d('0x18')](function(_0xb527a4){logger[_0x620d('0x15')](_0x620d('0x27'),_0xb527a4[_0x620d('0x16')],_0x7786f7);_0x4b730d(_this[_0x620d('0x15')](0x1f4,_0xb527a4['message']));});});};
\ No newline at end of file
index 4c2a09e..d37eca7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7065=['save','update','emit','removeListener','length','./chatInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7065,0xf5));var _0x5706=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7065[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x5706('0x0'));var events=[_0x5706('0x1'),'remove',_0x5706('0x2')];function createListener(_0x32c60d,_0x388c2c){return function(_0xedd419){_0x388c2c[_0x5706('0x3')](_0x32c60d,_0xedd419);};}function removeListener(_0x3a1126,_0x3e687f){return function(){ChatInteractionEvents[_0x5706('0x4')](_0x3a1126,_0x3e687f);};}exports['register']=function(_0x4eea4f){for(var _0x233adb=0x0,_0x29ecd0=events[_0x5706('0x5')];_0x233adb<_0x29ecd0;_0x233adb++){var _0x140e4e=events[_0x233adb];var _0x9708bc=createListener('chatInteraction:'+_0x140e4e,_0x4eea4f);ChatInteractionEvents['on'](_0x140e4e,_0x9708bc);}};
\ No newline at end of file
+var _0xd876=['removeListener','register','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd876,0x11b));var _0x6d87=function(_0x4f55a8,_0x4794c6){_0x4f55a8=_0x4f55a8-0x0;var _0xaf1d53=_0xd876[_0x4f55a8];return _0xaf1d53;};'use strict';var ChatInteractionEvents=require(_0x6d87('0x0'));var events=['save',_0x6d87('0x1'),_0x6d87('0x2')];function createListener(_0x508948,_0x5a48b0){return function(_0x2263fd){_0x5a48b0[_0x6d87('0x3')](_0x508948,_0x2263fd);};}function removeListener(_0x3d239a,_0x3e4359){return function(){ChatInteractionEvents[_0x6d87('0x4')](_0x3d239a,_0x3e4359);};}exports[_0x6d87('0x5')]=function(_0xfafc2c){for(var _0xabcbe6=0x0,_0x444971=events['length'];_0xabcbe6<_0x444971;_0xabcbe6++){var _0x561107=events[_0xabcbe6];var _0x45c084=createListener(_0x6d87('0x6')+_0x561107,_0xfafc2c);ChatInteractionEvents['on'](_0x561107,_0x45c084);}};
\ No newline at end of file
index a079fc8..6210dea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dd8=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/messages','getMessages','getMyMessages','/:id/download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','exports','multer'];(function(_0x28d856,_0x98d739){var _0x1d2341=function(_0x49daf1){while(--_0x49daf1){_0x28d856['push'](_0x28d856['shift']());}};_0x1d2341(++_0x98d739);}(_0x2dd8,0x143));var _0x82dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dd8[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x82dd('0x2'));var router=express[_0x82dd('0x3')]();var auth=require(_0x82dd('0x4'));var interaction=require(_0x82dd('0x5'));var config=require(_0x82dd('0x6'));var controller=require(_0x82dd('0x7'));router[_0x82dd('0x8')]('/',auth['isAuthenticated'](),controller[_0x82dd('0x9')]);router[_0x82dd('0x8')](_0x82dd('0xa'),auth[_0x82dd('0xb')](),controller['describe']);router[_0x82dd('0x8')](_0x82dd('0xc'),auth[_0x82dd('0xd')](),controller[_0x82dd('0xe')]);router['get']('/:id/attachment_download',auth[_0x82dd('0xd')](),controller['attachmentDownload']);router[_0x82dd('0x8')](_0x82dd('0xf'),auth[_0x82dd('0xb')](),controller[_0x82dd('0x10')]);router[_0x82dd('0x8')]('/:id/my_messages',auth[_0x82dd('0xd')](),controller[_0x82dd('0x11')]);router[_0x82dd('0x8')](_0x82dd('0x12'),auth[_0x82dd('0xb')](),controller['download']);router['post']('/',auth[_0x82dd('0xb')](),controller[_0x82dd('0x13')]);router[_0x82dd('0x14')](_0x82dd('0x15'),auth[_0x82dd('0xb')](),controller[_0x82dd('0x16')]);var upload=multer({'storage':multer[_0x82dd('0x17')]({'destination':function(_0x275802,_0x101eb7,_0x1b90e0){_0x1b90e0(null,path[_0x82dd('0x18')](config[_0x82dd('0x19')],_0x82dd('0x1a')));},'filename':function(_0x51d2a9,_0x352400,_0x66f34e){_0x66f34e(null,util[_0x82dd('0x1b')](_0x82dd('0x1c'),Date[_0x82dd('0x1d')](),_0x352400[_0x82dd('0x1e')][_0x82dd('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x82dd('0x14')](_0x82dd('0x20'),upload[_0x82dd('0x21')](_0x82dd('0x22')),controller[_0x82dd('0x23')]);router[_0x82dd('0x14')]('/:id/messages',auth[_0x82dd('0xd')](),controller[_0x82dd('0x24')]);router[_0x82dd('0x14')](_0x82dd('0x25'),auth[_0x82dd('0xb')](),interaction[_0x82dd('0x26')](_0x82dd('0x27'),_0x82dd('0x28')),controller['addTags']);router['put'](_0x82dd('0xc'),auth[_0x82dd('0xb')](),interaction['tracked']('chat',_0x82dd('0x29')),controller[_0x82dd('0x2a')]);router[_0x82dd('0x2b')](_0x82dd('0x2c'),controller[_0x82dd('0x2d')]);router[_0x82dd('0x2b')](_0x82dd('0x2e'),auth[_0x82dd('0xd')](),controller[_0x82dd('0x2f')]);router[_0x82dd('0x2b')](_0x82dd('0x30'),controller[_0x82dd('0x31')]);router[_0x82dd('0x32')](_0x82dd('0xc'),auth['isAuthenticated'](),interaction[_0x82dd('0x26')](_0x82dd('0x27'),_0x82dd('0x33')),controller['destroy']);router[_0x82dd('0x32')]('/:id/tags',auth[_0x82dd('0xb')](),controller[_0x82dd('0x34')]);module[_0x82dd('0x35')]=router;
\ No newline at end of file
+var _0x9a1b=['/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','/:id/download','download','create','post','createVidaooSession','diskStorage','join','server/files/attachments/','format','now','originalname','replace','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','put','/:id/close','close','delete','chatinteraction:destroy','/:id/tags','removeTags','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index'];(function(_0x506623,_0x4cd325){var _0x26ddea=function(_0x3af4ab){while(--_0x3af4ab){_0x506623['push'](_0x506623['shift']());}};_0x26ddea(++_0x4cd325);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x529435,_0x1ef68f){_0x529435=_0x529435-0x0;var _0x563242=_0x9a1b[_0x529435];return _0x563242;};'use strict';var multer=require(_0xb9a1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb9a1('0x1'));var router=express[_0xb9a1('0x2')]();var auth=require(_0xb9a1('0x3'));var interaction=require(_0xb9a1('0x4'));var config=require('../../config/environment');var controller=require(_0xb9a1('0x5'));router[_0xb9a1('0x6')]('/',auth['isAuthenticated'](),controller[_0xb9a1('0x7')]);router[_0xb9a1('0x6')](_0xb9a1('0x8'),auth['isAuthenticated'](),controller[_0xb9a1('0x9')]);router[_0xb9a1('0x6')](_0xb9a1('0xa'),auth[_0xb9a1('0xb')](),controller[_0xb9a1('0xc')]);router['get']('/:id/attachment_download',auth[_0xb9a1('0xb')](),controller[_0xb9a1('0xd')]);router[_0xb9a1('0x6')](_0xb9a1('0xe'),auth[_0xb9a1('0xf')](),controller[_0xb9a1('0x10')]);router[_0xb9a1('0x6')](_0xb9a1('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xb9a1('0x6')](_0xb9a1('0x12'),auth['isAuthenticated'](),controller[_0xb9a1('0x13')]);router['post']('/',auth[_0xb9a1('0xf')](),controller[_0xb9a1('0x14')]);router[_0xb9a1('0x15')]('/:id/vidaoo',auth[_0xb9a1('0xf')](),controller[_0xb9a1('0x16')]);var upload=multer({'storage':multer[_0xb9a1('0x17')]({'destination':function(_0x4de0d8,_0x304c9c,_0x46e3a9){_0x46e3a9(null,path[_0xb9a1('0x18')](config['root'],_0xb9a1('0x19')));},'filename':function(_0x4096fb,_0x4e9037,_0xb95bd3){_0xb95bd3(null,util[_0xb9a1('0x1a')]('%s-%s',Date[_0xb9a1('0x1b')](),_0x4e9037[_0xb9a1('0x1c')][_0xb9a1('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb9a1('0x15')]('/:id/attachment_upload',upload['single']('file'),controller[_0xb9a1('0x1e')]);router[_0xb9a1('0x15')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xb9a1('0x1f')]);router[_0xb9a1('0x15')]('/:id/tags',auth[_0xb9a1('0xf')](),interaction[_0xb9a1('0x20')](_0xb9a1('0x21'),_0xb9a1('0x22')),controller[_0xb9a1('0x23')]);router['put']('/:id',auth[_0xb9a1('0xf')](),interaction[_0xb9a1('0x20')](_0xb9a1('0x21'),_0xb9a1('0x24')),controller[_0xb9a1('0x25')]);router['put'](_0xb9a1('0x26'),controller[_0xb9a1('0x27')]);router['put'](_0xb9a1('0x28'),auth[_0xb9a1('0xb')](),controller[_0xb9a1('0x29')]);router[_0xb9a1('0x2a')](_0xb9a1('0x2b'),controller[_0xb9a1('0x2c')]);router[_0xb9a1('0x2d')](_0xb9a1('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0xb9a1('0x21'),_0xb9a1('0x2e')),controller['destroy']);router[_0xb9a1('0x2d')](_0xb9a1('0x2f'),auth[_0xb9a1('0xf')](),controller[_0xb9a1('0x30')]);module[_0xb9a1('0x31')]=router;
\ No newline at end of file
index e9ac74b..00e4b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['exports','TEXT','BOOLEAN','INTEGER'];(function(_0x1a3592,_0x163584){var _0x3e0636=function(_0x49a270){while(--_0x49a270){_0x1a3592['push'](_0x1a3592['shift']());}};_0x3e0636(++_0x163584);}(_0x57ca,0x108));var _0xa57c=function(_0x5a37e2,_0x425697){_0x5a37e2=_0x5a37e2-0x0;var _0x26bc5b=_0x57ca[_0x5a37e2];return _0x26bc5b;};'use strict';var Sequelize=require('sequelize');module[_0xa57c('0x0')]={'body':{'type':Sequelize[_0xa57c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa57c('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa57c('0x3')]}};
\ No newline at end of file
+var _0x5f66=['exports','medium','BOOLEAN','INTEGER'];(function(_0x51e987,_0x36a435){var _0x284ad7=function(_0x153af7){while(--_0x153af7){_0x51e987['push'](_0x51e987['shift']());}};_0x284ad7(++_0x36a435);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x65f6('0x3')]}};
\ No newline at end of file
index ac13af9..2eff50d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f17=['include','options','find','create','body','update','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','getUsers','User','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','-createdAt','all','html-pdf','eml-format','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','end','status','json','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','ChatInternalMessage','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params'];(function(_0x5ae003,_0x1a4a17){var _0x158412=function(_0x9296b5){while(--_0x9296b5){_0x5ae003['push'](_0x5ae003['shift']());}};_0x158412(++_0x1a4a17);}(_0x3f17,0xf9));var _0x73f1=function(_0x3e28b4,_0x1d3bd9){_0x3e28b4=_0x3e28b4-0x0;var _0x2a4a5c=_0x3f17[_0x3e28b4];return _0x2a4a5c;};'use strict';var pdf=require(_0x73f1('0x0'));var emlformat=require(_0x73f1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x73f1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x73f1('0x3'));var util=require(_0x73f1('0x4'));var path=require(_0x73f1('0x5'));var sox=require(_0x73f1('0x6'));var csv=require(_0x73f1('0x7'));var ejs=require(_0x73f1('0x8'));var fs=require('fs');var _=require(_0x73f1('0x9'));var squel=require(_0x73f1('0xa'));var crypto=require(_0x73f1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x73f1('0xc'));var toCsv=require(_0x73f1('0x7'));var querystring=require('querystring');var Papa=require(_0x73f1('0xd'));var Redis=require(_0x73f1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x73f1('0xf'));var hardwareService=require(_0x73f1('0x10'));var logger=require('../../config/logger')(_0x73f1('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x73f1('0x12'))['db'];config[_0x73f1('0x13')]=_['defaults'](config[_0x73f1('0x13')],{'host':_0x73f1('0x14'),'port':0x18eb});var socket=require(_0x73f1('0x15'))(new Redis(config[_0x73f1('0x13')]));require(_0x73f1('0x16'))[_0x73f1('0x17')](socket);function respondWithStatusCode(_0x4923c4,_0x5715a1){_0x5715a1=_0x5715a1||0xcc;return function(_0x28bb49){if(_0x28bb49){return _0x4923c4['sendStatus'](_0x5715a1);}return _0x4923c4['status'](_0x5715a1)[_0x73f1('0x18')]();};}function respondWithResult(_0x569984,_0x2c1235){_0x2c1235=_0x2c1235||0xc8;return function(_0x2ac799){if(_0x2ac799){return _0x569984[_0x73f1('0x19')](_0x2c1235)[_0x73f1('0x1a')](_0x2ac799);}};}function respondWithFilteredResult(_0x4e83fa,_0x8f42e1){return function(_0xa7c00f){if(_0xa7c00f){var _0x4fac73=_0xa7c00f[_0x73f1('0x1b')],_0x47e502=_0x8f42e1['offset'],_0x4fa5f3=_0x8f42e1['offset']+_0x8f42e1['limit'],_0x411c60;if(_0x4fa5f3>=_0x4fac73){_0x4fa5f3=_0x4fac73;_0x411c60=0xc8;}else{_0x411c60=0xce;}_0x4e83fa[_0x73f1('0x19')](_0x411c60);return _0x4e83fa[_0x73f1('0x1c')](_0x73f1('0x1d'),_0x47e502+'-'+_0x4fa5f3+'/'+_0x4fac73)[_0x73f1('0x1a')](_0xa7c00f);}return null;};}function patchUpdates(_0x3682ed){return function(_0xe11b8e){try{jsonpatch[_0x73f1('0x1e')](_0xe11b8e,_0x3682ed,!![]);}catch(_0x1ce8f5){return BPromise['reject'](_0x1ce8f5);}return _0xe11b8e[_0x73f1('0x1f')]();};}function saveUpdates(_0x5372bf,_0x5309bd){return function(_0x3083c7){if(_0x3083c7){return _0x3083c7['update'](_0x5372bf)[_0x73f1('0x20')](function(_0x301e38){return _0x301e38;});}return null;};}function removeEntity(_0x57aac5,_0x5156a4){return function(_0x2c0633){if(_0x2c0633){return _0x2c0633[_0x73f1('0x21')]()[_0x73f1('0x20')](function(){_0x57aac5[_0x73f1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c2160,_0x4f63a8){return function(_0x39ed7f){if(!_0x39ed7f){_0x2c2160[_0x73f1('0x22')](0x194);}return _0x39ed7f;};}function handleError(_0x49e873,_0x210dbe){_0x210dbe=_0x210dbe||0x1f4;return function(_0x31d44f){logger[_0x73f1('0x23')](_0x31d44f['stack']);if(_0x31d44f[_0x73f1('0x24')]){delete _0x31d44f[_0x73f1('0x24')];}_0x49e873[_0x73f1('0x19')](_0x210dbe)['send'](_0x31d44f);};}exports['index']=function(_0x87bb6a,_0x210d85){var _0x2263fb={},_0x42c04e={},_0x62bfb1={'count':0x0,'rows':[]};var _0x2f8ac9=_['map'](db[_0x73f1('0x25')]['rawAttributes'],function(_0x3a65c8){return{'name':_0x3a65c8[_0x73f1('0x26')],'type':_0x3a65c8[_0x73f1('0x27')][_0x73f1('0x28')]};});_0x42c04e[_0x73f1('0x29')]=_[_0x73f1('0x2a')](_0x2f8ac9,_0x73f1('0x24'));_0x42c04e[_0x73f1('0x2b')]=_[_0x73f1('0x2c')](_0x87bb6a[_0x73f1('0x2b')]);_0x42c04e['filters']=_[_0x73f1('0x2d')](_0x42c04e['model'],_0x42c04e[_0x73f1('0x2b')]);_0x2263fb[_0x73f1('0x2e')]=_[_0x73f1('0x2d')](_0x42c04e[_0x73f1('0x29')],qs[_0x73f1('0x2f')](_0x87bb6a['query'][_0x73f1('0x2f')]));_0x2263fb[_0x73f1('0x2e')]=_0x2263fb[_0x73f1('0x2e')][_0x73f1('0x30')]?_0x2263fb['attributes']:_0x42c04e[_0x73f1('0x29')];if(!_0x87bb6a[_0x73f1('0x2b')][_0x73f1('0x31')](_0x73f1('0x32'))){_0x2263fb['limit']=qs[_0x73f1('0x33')](_0x87bb6a['query'][_0x73f1('0x33')]);_0x2263fb[_0x73f1('0x34')]=qs[_0x73f1('0x34')](_0x87bb6a['query'][_0x73f1('0x34')]);}_0x2263fb[_0x73f1('0x35')]=qs['sort'](_0x87bb6a[_0x73f1('0x2b')][_0x73f1('0x36')]);_0x2263fb[_0x73f1('0x37')]=qs[_0x73f1('0x38')](_[_0x73f1('0x39')](_0x87bb6a[_0x73f1('0x2b')],_0x42c04e['filters']),_0x2f8ac9);if(_0x87bb6a[_0x73f1('0x2b')][_0x73f1('0x3a')]){_0x2263fb['where']=_[_0x73f1('0x3b')](_0x2263fb[_0x73f1('0x37')],{'$or':_[_0x73f1('0x2a')](_0x2f8ac9,function(_0x251f48){if(_0x251f48[_0x73f1('0x27')]!==_0x73f1('0x3c')){var _0x367c32={};_0x367c32[_0x251f48[_0x73f1('0x24')]]={'$like':'%'+_0x87bb6a[_0x73f1('0x2b')][_0x73f1('0x3a')]+'%'};return _0x367c32;}})});}_0x2263fb=_[_0x73f1('0x3b')]({},_0x2263fb,_0x87bb6a['options']);var _0x12d6d0={'where':_0x2263fb[_0x73f1('0x37')]};return db[_0x73f1('0x25')][_0x73f1('0x1b')](_0x12d6d0)[_0x73f1('0x20')](function(_0x45a086){_0x62bfb1[_0x73f1('0x1b')]=_0x45a086;if(_0x87bb6a[_0x73f1('0x2b')][_0x73f1('0x3d')]){_0x2263fb['include']=[{'all':!![]}];}return db[_0x73f1('0x25')]['findAll'](_0x2263fb);})['then'](function(_0x33a983){_0x62bfb1[_0x73f1('0x3e')]=_0x33a983;return _0x62bfb1;})['then'](respondWithFilteredResult(_0x210d85,_0x2263fb))[_0x73f1('0x3f')](handleError(_0x210d85,null));};exports[_0x73f1('0x40')]=function(_0x1de6fa,_0xd511b9){var _0x14674f={'raw':!![],'where':{'id':_0x1de6fa[_0x73f1('0x41')]['id']}},_0x612e55={};_0x612e55['model']=_[_0x73f1('0x2c')](db['ChatInternalMessage']['rawAttributes']);_0x612e55['query']=_['keys'](_0x1de6fa[_0x73f1('0x2b')]);_0x612e55[_0x73f1('0x38')]=_['intersection'](_0x612e55[_0x73f1('0x29')],_0x612e55['query']);_0x14674f['attributes']=_[_0x73f1('0x2d')](_0x612e55[_0x73f1('0x29')],qs['fields'](_0x1de6fa[_0x73f1('0x2b')][_0x73f1('0x2f')]));_0x14674f[_0x73f1('0x2e')]=_0x14674f[_0x73f1('0x2e')][_0x73f1('0x30')]?_0x14674f['attributes']:_0x612e55[_0x73f1('0x29')];if(_0x1de6fa[_0x73f1('0x2b')]['includeAll']){_0x14674f[_0x73f1('0x42')]=[{'all':!![]}];}_0x14674f=_['merge']({},_0x14674f,_0x1de6fa[_0x73f1('0x43')]);return db[_0x73f1('0x25')][_0x73f1('0x44')](_0x14674f)[_0x73f1('0x20')](handleEntityNotFound(_0xd511b9,null))[_0x73f1('0x20')](respondWithResult(_0xd511b9,null))[_0x73f1('0x3f')](handleError(_0xd511b9,null));};exports[_0x73f1('0x45')]=function(_0x36ded,_0x184995){return db[_0x73f1('0x25')][_0x73f1('0x45')](_0x36ded[_0x73f1('0x46')],{})[_0x73f1('0x20')](respondWithResult(_0x184995,0xc9))[_0x73f1('0x3f')](handleError(_0x184995,null));};exports[_0x73f1('0x47')]=function(_0x25d2f1,_0xba2b39){if(_0x25d2f1['body']['id']){delete _0x25d2f1[_0x73f1('0x46')]['id'];}return db[_0x73f1('0x25')][_0x73f1('0x44')]({'where':{'id':_0x25d2f1['params']['id']}})[_0x73f1('0x20')](handleEntityNotFound(_0xba2b39,null))['then'](saveUpdates(_0x25d2f1[_0x73f1('0x46')],null))['then'](respondWithResult(_0xba2b39,null))[_0x73f1('0x3f')](handleError(_0xba2b39,null));};exports['destroy']=function(_0x1b9d60,_0x3b796f){return db['ChatInternalMessage']['find']({'where':{'id':_0x1b9d60[_0x73f1('0x41')]['id']}})[_0x73f1('0x20')](handleEntityNotFound(_0x3b796f,null))[_0x73f1('0x20')](removeEntity(_0x3b796f,null))[_0x73f1('0x3f')](handleError(_0x3b796f,null));};exports['describe']=function(_0x153e64,_0x56b253){return db['ChatInternalMessage'][_0x73f1('0x48')]()['then'](respondWithResult(_0x56b253,null))[_0x73f1('0x3f')](handleError(_0x56b253,null));};function wrapUser(_0x2a2164){return function(_0x19f508){var _0x372fb0=_0x2a2164[_0x73f1('0x49')]({'plain':!![]});_0x372fb0[_0x73f1('0x4a')]=[];if(_0x19f508){_0x372fb0['lastMessageAt']=_0x19f508[_0x73f1('0x4b')];_0x372fb0[_0x73f1('0x4c')]=_0x19f508;}else{_0x372fb0[_0x73f1('0x4d')]=moment(0x0)[_0x73f1('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x372fb0[_0x73f1('0x4c')]={};}return _0x372fb0;};}exports[_0x73f1('0x4f')]=function(_0x224fe8,_0x42d666,_0x4072f3){var _0x51bedc=[];return db[_0x73f1('0x50')][_0x73f1('0x51')]({'where':{'role':[_0x73f1('0x52'),_0x73f1('0x53'),_0x73f1('0x54')]},'attributes':['id',_0x73f1('0x55'),_0x73f1('0x24'),_0x73f1('0x56'),_0x73f1('0x57'),_0x73f1('0x58'),_0x73f1('0x59'),_0x73f1('0x5a'),_0x73f1('0x5b'),'showWebBar'],'order':qs[_0x73f1('0x36')](_0x73f1('0x5c')),'include':[{'model':db[_0x73f1('0x5d')],'as':_0x73f1('0x5e'),'attributes':['id',_0x73f1('0x24'),_0x73f1('0x27')],'through':{'attributes':[]}}]})[_0x73f1('0x20')](function(_0x521342){if(_0x521342){var _0x5ef43d=_0x224fe8['user'][_0x73f1('0x49')]({'plain':!![]});if(!_0x5ef43d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ef43d[_0x73f1('0x56')]===_0x73f1('0x54')){return db[_0x73f1('0x5f')][_0x73f1('0x44')]({'where':{'name':'Agents','userProfileId':_0x5ef43d[_0x73f1('0x60')]},'raw':!![]})[_0x73f1('0x20')](function(_0x4ebf07){if(_0x4ebf07){if(_0x4ebf07[_0x73f1('0x61')]===0x0){return db[_0x73f1('0x62')][_0x73f1('0x51')]({'where':{'sectionId':_0x4ebf07['id']},'raw':!![]})[_0x73f1('0x20')](function(_0x39747b){var _0xf034a4=[];if(_[_0x73f1('0x63')](_0x39747b)){_0xf034a4=_[_0x73f1('0x3a')](_0x521342,function(_0x2f317e){if(_0x2f317e['role']!=='agent'){return _0x2f317e;}});return _0xf034a4;}else{for(var _0x581110=0x0;_0x581110<_0x521342[_0x73f1('0x30')];_0x581110++){var _0x29cb29=_0x521342[_0x581110];if(_0x29cb29[_0x73f1('0x56')]===_0x73f1('0x52')){var _0x4991a0=_['find'](_0x39747b,function(_0x4989bc){return _0x4989bc[_0x73f1('0x64')]===_0x29cb29['id'];});if(_0x4991a0)_0xf034a4[_0x73f1('0x65')](_0x29cb29);}else{_0xf034a4['push'](_0x29cb29);}}return _0xf034a4;}});}else{return _0x521342;}}else{var _0xb14f46=_['filter'](_0x521342,function(_0x1faf65){if(_0x1faf65[_0x73f1('0x56')]!==_0x73f1('0x52')){return _0x1faf65;}});return _0xb14f46;}});}else{return _0x521342;}}})[_0x73f1('0x20')](function(_0x9b93e5){var _0x2d204f=[];if(_0x9b93e5){_0x51bedc=_0x9b93e5;for(var _0x205ca0=0x0;_0x205ca0<_0x9b93e5[_0x73f1('0x30')];_0x205ca0+=0x1){_0x51bedc[_0x205ca0][_0x73f1('0x4a')]=[];_0x2d204f['push'](db[_0x73f1('0x25')]['find']({'where':{'FromId':[_0x224fe8[_0x73f1('0x54')]['id'],_0x9b93e5[_0x205ca0]['id']],'ToId':[_0x224fe8[_0x73f1('0x54')]['id'],_0x9b93e5[_0x205ca0]['id']],'ChatGroupId':null},'attributes':['id',_0x73f1('0x4b'),_0x73f1('0x66'),'ToId','read',_0x73f1('0x46')],'order':qs['sort'](_0x73f1('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x73f1('0x20')](wrapUser(_0x9b93e5[_0x205ca0])));}return BPromise[_0x73f1('0x68')](_0x2d204f);}return[];})[_0x73f1('0x20')](function(_0x2e5383){return{'rows':_0x2e5383,'count':_0x2e5383[_0x73f1('0x30')]};})[_0x73f1('0x20')](respondWithResult(_0x42d666,null))[_0x73f1('0x3f')](handleError(_0x42d666,null));};
\ No newline at end of file
+var _0x9df2=['VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','agent','resourceId','push','messages','read','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','index','map','rawAttributes','type','key','model','name','query','keys','attributes','fields','order','sort','where','filters','filter','VIRTUAL','merge','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','role','internal','online','allowmessenger','-online'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0x9df2,0x140));var _0x29df=function(_0x4169a6,_0x29386e){_0x4169a6=_0x4169a6-0x0;var _0x2a25b4=_0x9df2[_0x4169a6];return _0x2a25b4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29df('0x0'));var rimraf=require(_0x29df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29df('0x2'));var rp=require('request-promise');var moment=require(_0x29df('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x29df('0x4'));var util=require(_0x29df('0x5'));var path=require(_0x29df('0x6'));var sox=require(_0x29df('0x7'));var csv=require(_0x29df('0x8'));var ejs=require(_0x29df('0x9'));var fs=require('fs');var _=require(_0x29df('0xa'));var squel=require(_0x29df('0xb'));var crypto=require(_0x29df('0xc'));var jsforce=require(_0x29df('0xd'));var deskjs=require(_0x29df('0xe'));var toCsv=require(_0x29df('0x8'));var querystring=require(_0x29df('0xf'));var Papa=require(_0x29df('0x10'));var Redis=require(_0x29df('0x11'));var authService=require(_0x29df('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x29df('0x13'));var hardwareService=require(_0x29df('0x14'));var logger=require(_0x29df('0x15'))('api');var utils=require(_0x29df('0x16'));var config=require(_0x29df('0x17'));var db=require(_0x29df('0x18'))['db'];config[_0x29df('0x19')]=_['defaults'](config[_0x29df('0x19')],{'host':_0x29df('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x29df('0x19')]));require('./chatInternalMessage.socket')[_0x29df('0x1b')](socket);function respondWithStatusCode(_0x3578a9,_0x45e809){_0x45e809=_0x45e809||0xcc;return function(_0x3b5e92){if(_0x3b5e92){return _0x3578a9[_0x29df('0x1c')](_0x45e809);}return _0x3578a9['status'](_0x45e809)[_0x29df('0x1d')]();};}function respondWithResult(_0x4188d0,_0x15d3b0){_0x15d3b0=_0x15d3b0||0xc8;return function(_0x26a132){if(_0x26a132){return _0x4188d0[_0x29df('0x1e')](_0x15d3b0)[_0x29df('0x1f')](_0x26a132);}};}function respondWithFilteredResult(_0x49b2b8,_0x129ebc){return function(_0x5ba127){if(_0x5ba127){var _0x53e99f=_0x5ba127[_0x29df('0x20')],_0x6fa1e1=_0x129ebc[_0x29df('0x21')],_0xc955f2=_0x129ebc[_0x29df('0x21')]+_0x129ebc[_0x29df('0x22')],_0x594d31;if(_0xc955f2>=_0x53e99f){_0xc955f2=_0x53e99f;_0x594d31=0xc8;}else{_0x594d31=0xce;}_0x49b2b8[_0x29df('0x1e')](_0x594d31);return _0x49b2b8[_0x29df('0x23')](_0x29df('0x24'),_0x6fa1e1+'-'+_0xc955f2+'/'+_0x53e99f)[_0x29df('0x1f')](_0x5ba127);}return null;};}function patchUpdates(_0x48b92d){return function(_0x5ce6ce){try{jsonpatch['apply'](_0x5ce6ce,_0x48b92d,!![]);}catch(_0x467050){return BPromise[_0x29df('0x25')](_0x467050);}return _0x5ce6ce[_0x29df('0x26')]();};}function saveUpdates(_0x4d5a3e,_0x502177){return function(_0x188c91){if(_0x188c91){return _0x188c91[_0x29df('0x27')](_0x4d5a3e)['then'](function(_0x415027){return _0x415027;});}return null;};}function removeEntity(_0x243178,_0x9e181){return function(_0x120547){if(_0x120547){return _0x120547[_0x29df('0x28')]()[_0x29df('0x29')](function(){_0x243178['status'](0xcc)[_0x29df('0x1d')]();});}};}function handleEntityNotFound(_0xb1a89f,_0x47a31e){return function(_0xd4bddc){if(!_0xd4bddc){_0xb1a89f[_0x29df('0x1c')](0x194);}return _0xd4bddc;};}function handleError(_0x7c15dc,_0x9e6d1b){_0x9e6d1b=_0x9e6d1b||0x1f4;return function(_0x349d19){logger['error'](_0x349d19['stack']);if(_0x349d19['name']){delete _0x349d19['name'];}_0x7c15dc[_0x29df('0x1e')](_0x9e6d1b)['send'](_0x349d19);};}exports[_0x29df('0x2a')]=function(_0x40bf7a,_0x361283){var _0x4d1222={},_0x28bc3f={},_0x31c809={'count':0x0,'rows':[]};var _0x309b89=_[_0x29df('0x2b')](db['ChatInternalMessage'][_0x29df('0x2c')],function(_0x309889){return{'name':_0x309889['fieldName'],'type':_0x309889[_0x29df('0x2d')][_0x29df('0x2e')]};});_0x28bc3f[_0x29df('0x2f')]=_[_0x29df('0x2b')](_0x309b89,_0x29df('0x30'));_0x28bc3f[_0x29df('0x31')]=_[_0x29df('0x32')](_0x40bf7a[_0x29df('0x31')]);_0x28bc3f['filters']=_['intersection'](_0x28bc3f[_0x29df('0x2f')],_0x28bc3f['query']);_0x4d1222[_0x29df('0x33')]=_['intersection'](_0x28bc3f['model'],qs['fields'](_0x40bf7a[_0x29df('0x31')][_0x29df('0x34')]));_0x4d1222[_0x29df('0x33')]=_0x4d1222[_0x29df('0x33')]['length']?_0x4d1222[_0x29df('0x33')]:_0x28bc3f[_0x29df('0x2f')];if(!_0x40bf7a[_0x29df('0x31')]['hasOwnProperty']('nolimit')){_0x4d1222[_0x29df('0x22')]=qs[_0x29df('0x22')](_0x40bf7a['query'][_0x29df('0x22')]);_0x4d1222[_0x29df('0x21')]=qs[_0x29df('0x21')](_0x40bf7a[_0x29df('0x31')]['offset']);}_0x4d1222[_0x29df('0x35')]=qs[_0x29df('0x36')](_0x40bf7a['query'][_0x29df('0x36')]);_0x4d1222[_0x29df('0x37')]=qs[_0x29df('0x38')](_['pick'](_0x40bf7a[_0x29df('0x31')],_0x28bc3f[_0x29df('0x38')]),_0x309b89);if(_0x40bf7a[_0x29df('0x31')][_0x29df('0x39')]){_0x4d1222[_0x29df('0x37')]=_['merge'](_0x4d1222[_0x29df('0x37')],{'$or':_[_0x29df('0x2b')](_0x309b89,function(_0x252ff9){if(_0x252ff9['type']!==_0x29df('0x3a')){var _0x4b1774={};_0x4b1774[_0x252ff9['name']]={'$like':'%'+_0x40bf7a[_0x29df('0x31')][_0x29df('0x39')]+'%'};return _0x4b1774;}})});}_0x4d1222=_[_0x29df('0x3b')]({},_0x4d1222,_0x40bf7a[_0x29df('0x3c')]);var _0x2b3aba={'where':_0x4d1222[_0x29df('0x37')]};return db[_0x29df('0x3d')][_0x29df('0x20')](_0x2b3aba)['then'](function(_0x76c3b){_0x31c809[_0x29df('0x20')]=_0x76c3b;if(_0x40bf7a[_0x29df('0x31')][_0x29df('0x3e')]){_0x4d1222[_0x29df('0x3f')]=[{'all':!![]}];}return db[_0x29df('0x3d')][_0x29df('0x40')](_0x4d1222);})[_0x29df('0x29')](function(_0x2d1acc){_0x31c809[_0x29df('0x41')]=_0x2d1acc;return _0x31c809;})[_0x29df('0x29')](respondWithFilteredResult(_0x361283,_0x4d1222))[_0x29df('0x42')](handleError(_0x361283,null));};exports[_0x29df('0x43')]=function(_0x200842,_0x304577){var _0x22c077={'raw':!![],'where':{'id':_0x200842[_0x29df('0x44')]['id']}},_0x5d16e1={};_0x5d16e1[_0x29df('0x2f')]=_[_0x29df('0x32')](db['ChatInternalMessage']['rawAttributes']);_0x5d16e1[_0x29df('0x31')]=_[_0x29df('0x32')](_0x200842[_0x29df('0x31')]);_0x5d16e1[_0x29df('0x38')]=_[_0x29df('0x45')](_0x5d16e1[_0x29df('0x2f')],_0x5d16e1[_0x29df('0x31')]);_0x22c077[_0x29df('0x33')]=_[_0x29df('0x45')](_0x5d16e1[_0x29df('0x2f')],qs['fields'](_0x200842[_0x29df('0x31')][_0x29df('0x34')]));_0x22c077['attributes']=_0x22c077[_0x29df('0x33')][_0x29df('0x46')]?_0x22c077[_0x29df('0x33')]:_0x5d16e1['model'];if(_0x200842['query']['includeAll']){_0x22c077['include']=[{'all':!![]}];}_0x22c077=_['merge']({},_0x22c077,_0x200842[_0x29df('0x3c')]);return db['ChatInternalMessage'][_0x29df('0x47')](_0x22c077)[_0x29df('0x29')](handleEntityNotFound(_0x304577,null))[_0x29df('0x29')](respondWithResult(_0x304577,null))[_0x29df('0x42')](handleError(_0x304577,null));};exports[_0x29df('0x48')]=function(_0x9b78a3,_0x2deb74){return db[_0x29df('0x3d')][_0x29df('0x48')](_0x9b78a3[_0x29df('0x49')],{})[_0x29df('0x29')](respondWithResult(_0x2deb74,0xc9))[_0x29df('0x42')](handleError(_0x2deb74,null));};exports['update']=function(_0x9ef364,_0x4b7e75){if(_0x9ef364['body']['id']){delete _0x9ef364[_0x29df('0x49')]['id'];}return db[_0x29df('0x3d')][_0x29df('0x47')]({'where':{'id':_0x9ef364[_0x29df('0x44')]['id']}})[_0x29df('0x29')](handleEntityNotFound(_0x4b7e75,null))[_0x29df('0x29')](saveUpdates(_0x9ef364['body'],null))[_0x29df('0x29')](respondWithResult(_0x4b7e75,null))[_0x29df('0x42')](handleError(_0x4b7e75,null));};exports['destroy']=function(_0x12db9d,_0x28a8f0){return db['ChatInternalMessage'][_0x29df('0x47')]({'where':{'id':_0x12db9d['params']['id']}})[_0x29df('0x29')](handleEntityNotFound(_0x28a8f0,null))[_0x29df('0x29')](removeEntity(_0x28a8f0,null))['catch'](handleError(_0x28a8f0,null));};exports['describe']=function(_0x505437,_0x404a83){return db['ChatInternalMessage']['describe']()[_0x29df('0x29')](respondWithResult(_0x404a83,null))[_0x29df('0x42')](handleError(_0x404a83,null));};function wrapUser(_0x3238d1){return function(_0x16bfe4){var _0x554b40=_0x3238d1['get']({'plain':!![]});_0x554b40['messages']=[];if(_0x16bfe4){_0x554b40[_0x29df('0x4a')]=_0x16bfe4[_0x29df('0x4b')];_0x554b40[_0x29df('0x4c')]=_0x16bfe4;}else{_0x554b40[_0x29df('0x4a')]=moment(0x0)[_0x29df('0x4d')](_0x29df('0x4e'));_0x554b40[_0x29df('0x4c')]={};}return _0x554b40;};}exports[_0x29df('0x4f')]=function(_0x5aa4de,_0x358613,_0x1c3605){var _0x2912c3=[];return db[_0x29df('0x50')][_0x29df('0x40')]({'where':{'role':['agent',_0x29df('0x51'),_0x29df('0x52')]},'attributes':['id','fullname','name',_0x29df('0x53'),'userpic',_0x29df('0x54'),_0x29df('0x55'),'lastLoginAt',_0x29df('0x56'),'showWebBar'],'order':qs['sort'](_0x29df('0x57')),'include':[{'model':db['VoiceQueue'],'as':_0x29df('0x58'),'attributes':['id','name',_0x29df('0x2d')],'through':{'attributes':[]}}]})[_0x29df('0x29')](function(_0x33f372){if(_0x33f372){var _0x40d2bf=_0x5aa4de[_0x29df('0x52')][_0x29df('0x59')]({'plain':!![]});if(!_0x40d2bf)throw new Error(_0x29df('0x5a'));if(_0x40d2bf[_0x29df('0x53')]===_0x29df('0x52')){return db['UserProfileSection'][_0x29df('0x47')]({'where':{'name':_0x29df('0x5b'),'userProfileId':_0x40d2bf[_0x29df('0x5c')]},'raw':!![]})['then'](function(_0x73093d){if(_0x73093d){if(_0x73093d[_0x29df('0x5d')]===0x0){return db['UserProfileResource'][_0x29df('0x40')]({'where':{'sectionId':_0x73093d['id']},'raw':!![]})[_0x29df('0x29')](function(_0x2bb87d){var _0x1f1d6f=[];if(_[_0x29df('0x5e')](_0x2bb87d)){_0x1f1d6f=_[_0x29df('0x39')](_0x33f372,function(_0x3adde6){if(_0x3adde6[_0x29df('0x53')]!=='agent'){return _0x3adde6;}});return _0x1f1d6f;}else{for(var _0x1f646a=0x0;_0x1f646a<_0x33f372['length'];_0x1f646a++){var _0xae548a=_0x33f372[_0x1f646a];if(_0xae548a[_0x29df('0x53')]===_0x29df('0x5f')){var _0x374129=_[_0x29df('0x47')](_0x2bb87d,function(_0x543ae2){return _0x543ae2[_0x29df('0x60')]===_0xae548a['id'];});if(_0x374129)_0x1f1d6f[_0x29df('0x61')](_0xae548a);}else{_0x1f1d6f['push'](_0xae548a);}}return _0x1f1d6f;}});}else{return _0x33f372;}}else{var _0x229a2d=_[_0x29df('0x39')](_0x33f372,function(_0x7789ca){if(_0x7789ca[_0x29df('0x53')]!==_0x29df('0x5f')){return _0x7789ca;}});return _0x229a2d;}});}else{return _0x33f372;}}})[_0x29df('0x29')](function(_0x408fe3){var _0x414373=[];if(_0x408fe3){_0x2912c3=_0x408fe3;for(var _0x42bd05=0x0;_0x42bd05<_0x408fe3['length'];_0x42bd05+=0x1){_0x2912c3[_0x42bd05][_0x29df('0x62')]=[];_0x414373['push'](db[_0x29df('0x3d')]['find']({'where':{'FromId':[_0x5aa4de[_0x29df('0x52')]['id'],_0x408fe3[_0x42bd05]['id']],'ToId':[_0x5aa4de[_0x29df('0x52')]['id'],_0x408fe3[_0x42bd05]['id']],'ChatGroupId':null},'attributes':['id',_0x29df('0x4b'),'FromId','ToId',_0x29df('0x63'),_0x29df('0x49')],'order':qs[_0x29df('0x36')](_0x29df('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x29df('0x29')](wrapUser(_0x408fe3[_0x42bd05])));}return BPromise[_0x29df('0x65')](_0x414373);}return[];})['then'](function(_0x16e380){return{'rows':_0x16e380,'count':_0x16e380['length']};})[_0x29df('0x29')](respondWithResult(_0x358613,null))[_0x29df('0x42')](handleError(_0x358613,null));};
\ No newline at end of file
index 41f8a31..9709a0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd2f=['exports','events','../../mysqldb','ChatInternalMessage','save','remove','hook'];(function(_0x58b802,_0x442feb){var _0x38e03e=function(_0x472013){while(--_0x472013){_0x58b802['push'](_0x58b802['shift']());}};_0x38e03e(++_0x442feb);}(_0xfd2f,0x14a));var _0xffd2=function(_0x2e536f,_0x5f1c06){_0x2e536f=_0x2e536f-0x0;var _0x1ab12b=_0xfd2f[_0x2e536f];return _0x1ab12b;};'use strict';var EventEmitter=require(_0xffd2('0x0'));var ChatInternalMessage=require(_0xffd2('0x1'))['db'][_0xffd2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xffd2('0x3'),'afterUpdate':'update','afterDestroy':_0xffd2('0x4')};function emitEvent(_0x407d4b){return function(_0x492c33,_0x983987,_0x22c424){ChatInternalMessageEvents['emit'](_0x407d4b+':'+_0x492c33['id'],_0x492c33);ChatInternalMessageEvents['emit'](_0x407d4b,_0x492c33);_0x22c424(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xffd2('0x5')](e,emitEvent(event));}}module[_0xffd2('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xee39=['events','../../mysqldb','ChatInternalMessage','save','update','remove','emit','hasOwnProperty','exports'];(function(_0xc32bee,_0x123ef6){var _0xf5ccf5=function(_0x2a8438){while(--_0x2a8438){_0xc32bee['push'](_0xc32bee['shift']());}};_0xf5ccf5(++_0x123ef6);}(_0xee39,0x1e6));var _0x9ee3=function(_0x2d37a8,_0x18c29d){_0x2d37a8=_0x2d37a8-0x0;var _0x9f247c=_0xee39[_0x2d37a8];return _0x9f247c;};'use strict';var EventEmitter=require(_0x9ee3('0x0'));var ChatInternalMessage=require(_0x9ee3('0x1'))['db'][_0x9ee3('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9ee3('0x3'),'afterUpdate':_0x9ee3('0x4'),'afterDestroy':_0x9ee3('0x5')};function emitEvent(_0x3cdeaf){return function(_0x2724c7,_0x3a556a,_0x3398c6){ChatInternalMessageEvents[_0x9ee3('0x6')](_0x3cdeaf+':'+_0x2724c7['id'],_0x2724c7);ChatInternalMessageEvents[_0x9ee3('0x6')](_0x3cdeaf,_0x2724c7);_0x3398c6(null);};}for(var e in events){if(events[_0x9ee3('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x9ee3('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
index 063465f..86559d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x22861f,_0x20eaaa){var _0x5d8db8=function(_0xaead53){while(--_0xaead53){_0x22861f['push'](_0x22861f['shift']());}};_0x5d8db8(++_0x20eaaa);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb7e7[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});};
\ No newline at end of file
+var _0xe706=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x48bc67,_0x3b2b80){var _0x5f0651=function(_0x2640ed){while(--_0x2640ed){_0x48bc67['push'](_0x48bc67['shift']());}};_0x5f0651(++_0x3b2b80);}(_0xe706,0xa3));var _0x6e70=function(_0x245a7d,_0x253c2f){_0x245a7d=_0x245a7d-0x0;var _0x24789d=_0xe706[_0x245a7d];return _0x24789d;};'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':[],'timestamps':!![],'charset':_0x6e70('0xe'),'collate':_0x6e70('0xf')});};
\ No newline at end of file
index 0cd2f2d..b841d15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x380f=['debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0x380f,0x1ab));var _0xf380=function(_0x5a2c83,_0x203025){_0x5a2c83=_0x5a2c83-0x0;var _0x53d317=_0x380f[_0x5a2c83];return _0x53d317;};'use strict';var _=require(_0xf380('0x0'));var util=require(_0xf380('0x1'));var moment=require(_0xf380('0x2'));var BPromise=require(_0xf380('0x3'));var rs=require(_0xf380('0x4'));var fs=require('fs');var Redis=require(_0xf380('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf380('0x6'));var logger=require(_0xf380('0x7'))(_0xf380('0x8'));var config=require(_0xf380('0x9'));var jayson=require(_0xf380('0xa'));var client=jayson['client'][_0xf380('0xb')]({'port':0x232a});config['redis']=_[_0xf380('0xc')](config[_0xf380('0xd')],{'host':_0xf380('0xe'),'port':0x18eb});var socket=require(_0xf380('0xf'))(new Redis(config[_0xf380('0xd')]));require(_0xf380('0x10'))[_0xf380('0x11')](socket);function respondWithRpcPromise(_0x1cfc2b,_0x100d88,_0x410371){return new BPromise(function(_0x5e0ae4,_0x1eefe8){return client[_0xf380('0x12')](_0x1cfc2b,_0x410371)[_0xf380('0x13')](function(_0x6ce9b4){logger[_0xf380('0x14')](_0xf380('0x15'),_0x100d88,_0xf380('0x16'));logger[_0xf380('0x17')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x100d88,'request\x20sent',JSON[_0xf380('0x18')](_0x6ce9b4));if(_0x6ce9b4[_0xf380('0x19')]){if(_0x6ce9b4[_0xf380('0x19')][_0xf380('0x1a')]===0x1f4){logger[_0xf380('0x19')](_0xf380('0x15'),_0x100d88,_0x6ce9b4[_0xf380('0x19')][_0xf380('0x1b')]);return _0x1eefe8(_0x6ce9b4[_0xf380('0x19')][_0xf380('0x1b')]);}logger[_0xf380('0x19')](_0xf380('0x15'),_0x100d88,_0x6ce9b4[_0xf380('0x19')][_0xf380('0x1b')]);return _0x5e0ae4(_0x6ce9b4[_0xf380('0x19')][_0xf380('0x1b')]);}else{logger[_0xf380('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x100d88,'request\x20sent');_0x5e0ae4(_0x6ce9b4[_0xf380('0x1c')][_0xf380('0x1b')]);}})[_0xf380('0x1d')](function(_0x126947){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x100d88,_0x126947);_0x1eefe8(_0x126947);});});}
\ No newline at end of file
+var _0xd5fd=['redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x2e871d,_0x540db1){var _0x1fc40d=function(_0x239f23){while(--_0x239f23){_0x2e871d['push'](_0x2e871d['shift']());}};_0x1fc40d(++_0x540db1);}(_0xd5fd,0xc0));var _0xdd5f=function(_0x5426d0,_0x4a4f10){_0x5426d0=_0x5426d0-0x0;var _0x37be89=_0xd5fd[_0x5426d0];return _0x37be89;};'use strict';var _=require(_0xdd5f('0x0'));var util=require(_0xdd5f('0x1'));var moment=require(_0xdd5f('0x2'));var BPromise=require(_0xdd5f('0x3'));var rs=require(_0xdd5f('0x4'));var fs=require('fs');var Redis=require(_0xdd5f('0x5'));var db=require(_0xdd5f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd5f('0x7'));var config=require(_0xdd5f('0x8'));var jayson=require(_0xdd5f('0x9'));var client=jayson['client'][_0xdd5f('0xa')]({'port':0x232a});config[_0xdd5f('0xb')]=_[_0xdd5f('0xc')](config[_0xdd5f('0xb')],{'host':_0xdd5f('0xd'),'port':0x18eb});var socket=require(_0xdd5f('0xe'))(new Redis(config[_0xdd5f('0xb')]));require(_0xdd5f('0xf'))[_0xdd5f('0x10')](socket);function respondWithRpcPromise(_0x400268,_0x267941,_0x5e2858){return new BPromise(function(_0x2636c6,_0x36d5b2){return client['request'](_0x400268,_0x5e2858)[_0xdd5f('0x11')](function(_0x468c55){logger[_0xdd5f('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x267941,_0xdd5f('0x13'));logger[_0xdd5f('0x14')](_0xdd5f('0x15'),_0x267941,_0xdd5f('0x13'),JSON[_0xdd5f('0x16')](_0x468c55));if(_0x468c55[_0xdd5f('0x17')]){if(_0x468c55[_0xdd5f('0x17')][_0xdd5f('0x18')]===0x1f4){logger[_0xdd5f('0x17')](_0xdd5f('0x19'),_0x267941,_0x468c55[_0xdd5f('0x17')]['message']);return _0x36d5b2(_0x468c55[_0xdd5f('0x17')][_0xdd5f('0x1a')]);}logger[_0xdd5f('0x17')](_0xdd5f('0x19'),_0x267941,_0x468c55['error']['message']);return _0x2636c6(_0x468c55[_0xdd5f('0x17')]['message']);}else{logger[_0xdd5f('0x12')](_0xdd5f('0x19'),_0x267941,_0xdd5f('0x13'));_0x2636c6(_0x468c55[_0xdd5f('0x1b')][_0xdd5f('0x1a')]);}})[_0xdd5f('0x1c')](function(_0x4c632a){logger[_0xdd5f('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x267941,_0x4c632a);_0x36d5b2(_0x4c632a);});});}
\ No newline at end of file
index eafc8d4..ff9e568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2060=['update','emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x45c2b8,_0x37696b){var _0x49a69e=function(_0x309f66){while(--_0x309f66){_0x45c2b8['push'](_0x45c2b8['shift']());}};_0x49a69e(++_0x37696b);}(_0x2060,0x1be));var _0x0206=function(_0x44a327,_0x2939ed){_0x44a327=_0x44a327-0x0;var _0x584e51=_0x2060[_0x44a327];return _0x584e51;};'use strict';var ChatInternalMessageEvents=require(_0x0206('0x0'));var events=['save',_0x0206('0x1'),_0x0206('0x2')];function createListener(_0x3bbe73,_0x1df0f){return function(_0x538889){_0x1df0f[_0x0206('0x3')](_0x3bbe73,_0x538889);};}function removeListener(_0x1c9e2d,_0x4f7ab8){return function(){ChatInternalMessageEvents[_0x0206('0x4')](_0x1c9e2d,_0x4f7ab8);};}exports['register']=function(_0x26a2c8){for(var _0x2fb72e=0x0,_0x529d59=events[_0x0206('0x5')];_0x2fb72e<_0x529d59;_0x2fb72e++){var _0x5c8dbb=events[_0x2fb72e];var _0x4ffb51=createListener(_0x0206('0x6')+_0x5c8dbb,_0x26a2c8);ChatInternalMessageEvents['on'](_0x5c8dbb,_0x4ffb51);}};
\ No newline at end of file
+var _0x8ebf=['remove','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x8ebf[_0x261b8a];return _0x3455e8;};'use strict';var ChatInternalMessageEvents=require(_0xf8eb('0x0'));var events=[_0xf8eb('0x1'),_0xf8eb('0x2'),'update'];function createListener(_0x213f91,_0x1aa773){return function(_0x50d234){_0x1aa773[_0xf8eb('0x3')](_0x213f91,_0x50d234);};}function removeListener(_0x59d6a7,_0x41e20b){return function(){ChatInternalMessageEvents['removeListener'](_0x59d6a7,_0x41e20b);};}exports[_0xf8eb('0x4')]=function(_0x36fde3){for(var _0x4cbeaa=0x0,_0x30c91c=events[_0xf8eb('0x5')];_0x4cbeaa<_0x30c91c;_0x4cbeaa++){var _0x2a1fb6=events[_0x4cbeaa];var _0x4c628d=createListener(_0xf8eb('0x6')+_0x2a1fb6,_0x36fde3);ChatInternalMessageEvents['on'](_0x2a1fb6,_0x4c628d);}};
\ No newline at end of file
index 1793708..4399cfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x5d7bb5,_0x2cbaab){var _0x573fa2=function(_0x2e9e16){while(--_0x2e9e16){_0x5d7bb5['push'](_0x5d7bb5['shift']());}};_0x573fa2(++_0x2cbaab);}(_0xb7e7,0x121));var _0x7b7e=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xb7e7[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
+var _0x70e0=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/users','isAuthenticated','getUsers','/:id','post','create','put','update','delete','destroy'];(function(_0x553bb0,_0x52e291){var _0x4cfcad=function(_0x1d37f5){while(--_0x1d37f5){_0x553bb0['push'](_0x553bb0['shift']());}};_0x4cfcad(++_0x52e291);}(_0x70e0,0x17b));var _0x070e=function(_0x166238,_0x481ae1){_0x166238=_0x166238-0x0;var _0x2de832=_0x70e0[_0x166238];return _0x2de832;};'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 auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0x7')](_0x070e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x070e('0xe')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xd'),controller[_0x070e('0x11')]);router[_0x070e('0x12')](_0x070e('0xd'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);module[_0x070e('0x14')]=router;
\ No newline at end of file
index 2a0c391..581430d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x552a=['out','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x28ad71,_0x35bca7){var _0x24df09=function(_0x452c45){while(--_0x452c45){_0x28ad71['push'](_0x28ad71['shift']());}};_0x24df09(++_0x35bca7);}(_0x552a,0x64));var _0xa552=function(_0x3af7b7,_0x208014){_0x3af7b7=_0x3af7b7-0x0;var _0x8408b5=_0x552a[_0x3af7b7];return _0x8408b5;};'use strict';var Sequelize=require(_0xa552('0x0'));module[_0xa552('0x1')]={'body':{'type':Sequelize[_0xa552('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa552('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa552('0x4')]('in','out'),'defaultValue':_0xa552('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa552('0x6')]}};
\ No newline at end of file
+var _0x0e28=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4f73e1,_0x3fa1ec){var _0x45e60b=function(_0x56544e){while(--_0x56544e){_0x4f73e1['push'](_0x4f73e1['shift']());}};_0x45e60b(++_0x3fa1ec);}(_0x0e28,0x101));var _0x80e2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0e28[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x80e2('0x0'));module[_0x80e2('0x1')]={'body':{'type':Sequelize[_0x80e2('0x2')](_0x80e2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x80e2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x80e2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x80e2('0x5')]('in',_0x80e2('0x6')),'defaultValue':_0x80e2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x80e2('0x7')]}};
\ No newline at end of file
index e80605c..55958e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x387c=['sendStatus','end','status','json','count','offset','set','apply','reject','save','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge','options','ChatMessage','includeAll','include','rows','show','params','find','create','body','update','destroy','describe','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','agent','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x54fea7,_0x33e39c){var _0x502ed1=function(_0x2980ed){while(--_0x2980ed){_0x54fea7['push'](_0x54fea7['shift']());}};_0x502ed1(++_0x33e39c);}(_0x387c,0x141));var _0xc387=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x387c[_0x3c4062];return _0x3f5bf3;};'use strict';var pdf=require(_0xc387('0x0'));var emlformat=require(_0xc387('0x1'));var rimraf=require(_0xc387('0x2'));var zipdir=require(_0xc387('0x3'));var jsonpatch=require(_0xc387('0x4'));var rp=require(_0xc387('0x5'));var moment=require(_0xc387('0x6'));var BPromise=require(_0xc387('0x7'));var Mustache=require(_0xc387('0x8'));var util=require(_0xc387('0x9'));var path=require(_0xc387('0xa'));var sox=require(_0xc387('0xb'));var csv=require(_0xc387('0xc'));var ejs=require(_0xc387('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc387('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc387('0xf'));var toCsv=require(_0xc387('0xc'));var querystring=require('querystring');var Papa=require(_0xc387('0x10'));var Redis=require(_0xc387('0x11'));var authService=require(_0xc387('0x12'));var qs=require(_0xc387('0x13'));var as=require(_0xc387('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc387('0x15'))('api');var utils=require(_0xc387('0x16'));var config=require(_0xc387('0x17'));var db=require('../../mysqldb')['db'];config[_0xc387('0x18')]=_['defaults'](config[_0xc387('0x18')],{'host':_0xc387('0x19'),'port':0x18eb});var socket=require(_0xc387('0x1a'))(new Redis(config[_0xc387('0x18')]));require('./chatMessage.socket')[_0xc387('0x1b')](socket);var jayson=require(_0xc387('0x1c'));var client=jayson[_0xc387('0x1d')][_0xc387('0x1e')]({'port':0x232c});var client9002=jayson[_0xc387('0x1d')][_0xc387('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x562ecd,_0x580487,_0x5f0131){if(_0x5f0131){var _0x9ec6ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9ec6ee[_0xc387('0x1f')](_0x580487)){return _0x562ecd;}else{throw new db['Sequelize']['ValidationError'](_0xc387('0x20'));}}else{return _0x562ecd;}}function respondWithRpcPromise(_0xbd96c7,_0x43ea06,_0x5df282,_0x3c169e){return new BPromise(function(_0x16e706,_0x2cd32e){var _0x38f73d=_0x3c169e||client;return _0x38f73d['request'](_0xbd96c7,_0x5df282)[_0xc387('0x21')](function(_0x355526){logger[_0xc387('0x22')](_0xc387('0x23'),_0x43ea06,'request\x20sent');logger[_0xc387('0x24')](_0xc387('0x25'),_0x43ea06,_0xc387('0x26'),JSON[_0xc387('0x27')](_0x355526));if(_0x355526[_0xc387('0x28')]){if(_0x355526[_0xc387('0x28')][_0xc387('0x29')]===0x1f4){logger[_0xc387('0x28')]('ChatMessage,\x20%s,\x20%s',_0x43ea06,_0x355526[_0xc387('0x28')][_0xc387('0x2a')]);return _0x2cd32e(_0x355526[_0xc387('0x28')][_0xc387('0x2a')]);}logger[_0xc387('0x28')]('ChatMessage,\x20%s,\x20%s',_0x43ea06,_0x355526['error'][_0xc387('0x2a')]);return _0x16e706(_0x355526[_0xc387('0x28')][_0xc387('0x2a')]);}else{logger[_0xc387('0x22')](_0xc387('0x23'),_0x43ea06,'request\x20sent');_0x16e706(_0x355526[_0xc387('0x2b')][_0xc387('0x2a')]);}})[_0xc387('0x2c')](function(_0x2e179b){logger[_0xc387('0x28')]('ChatMessage,\x20%s,\x20%s',_0x43ea06,_0x2e179b);_0x2cd32e(_0x2e179b);});});}function respondWithStatusCode(_0xaa0144,_0x36ae5e){_0x36ae5e=_0x36ae5e||0xcc;return function(_0x4e8059){if(_0x4e8059){return _0xaa0144[_0xc387('0x2d')](_0x36ae5e);}return _0xaa0144['status'](_0x36ae5e)[_0xc387('0x2e')]();};}function respondWithResult(_0x473add,_0x26895a){_0x26895a=_0x26895a||0xc8;return function(_0xb76b75){if(_0xb76b75){return _0x473add[_0xc387('0x2f')](_0x26895a)[_0xc387('0x30')](_0xb76b75);}};}function respondWithFilteredResult(_0xcc7942,_0x5237c5){return function(_0x5662f3){if(_0x5662f3){var _0x23dd77=_0x5662f3[_0xc387('0x31')],_0x2d94f5=_0x5237c5[_0xc387('0x32')],_0x1626d5=_0x5237c5['offset']+_0x5237c5['limit'],_0xc4574e;if(_0x1626d5>=_0x23dd77){_0x1626d5=_0x23dd77;_0xc4574e=0xc8;}else{_0xc4574e=0xce;}_0xcc7942[_0xc387('0x2f')](_0xc4574e);return _0xcc7942[_0xc387('0x33')]('Content-Range',_0x2d94f5+'-'+_0x1626d5+'/'+_0x23dd77)[_0xc387('0x30')](_0x5662f3);}return null;};}function patchUpdates(_0x3318e2){return function(_0x570120){try{jsonpatch[_0xc387('0x34')](_0x570120,_0x3318e2,!![]);}catch(_0x21533e){return BPromise[_0xc387('0x35')](_0x21533e);}return _0x570120[_0xc387('0x36')]();};}function saveUpdates(_0x28ca1c,_0x39067){return function(_0x5ea637){if(_0x5ea637){return _0x5ea637['update'](_0x28ca1c)['then'](function(_0x18d175){return _0x18d175;});}return null;};}function removeEntity(_0x135731,_0x182e85){return function(_0x109fa0){if(_0x109fa0){return _0x109fa0['destroy']()[_0xc387('0x21')](function(){_0x135731[_0xc387('0x2f')](0xcc)[_0xc387('0x2e')]();});}};}function handleEntityNotFound(_0x3acc55,_0x512fb7){return function(_0x154542){if(!_0x154542){_0x3acc55[_0xc387('0x2d')](0x194);}return _0x154542;};}function handleError(_0x5d3204,_0x40a222){_0x40a222=_0x40a222||0x1f4;return function(_0xd40c01){logger[_0xc387('0x28')](_0xd40c01[_0xc387('0x37')]);if(_0xd40c01['name']){delete _0xd40c01[_0xc387('0x38')];}_0x5d3204['status'](_0x40a222)[_0xc387('0x39')](_0xd40c01);};}exports[_0xc387('0x3a')]=function(_0x3e3bc9,_0x438925){var _0x156a21={},_0x11c0a1={},_0x24801d={'count':0x0,'rows':[]};var _0x52dd7e=_[_0xc387('0x3b')](db['ChatMessage'][_0xc387('0x3c')],function(_0x428533){return{'name':_0x428533[_0xc387('0x3d')],'type':_0x428533[_0xc387('0x3e')][_0xc387('0x3f')]};});_0x11c0a1[_0xc387('0x40')]=_[_0xc387('0x3b')](_0x52dd7e,_0xc387('0x38'));_0x11c0a1[_0xc387('0x41')]=_[_0xc387('0x42')](_0x3e3bc9[_0xc387('0x41')]);_0x11c0a1[_0xc387('0x43')]=_[_0xc387('0x44')](_0x11c0a1[_0xc387('0x40')],_0x11c0a1['query']);_0x156a21[_0xc387('0x45')]=_[_0xc387('0x44')](_0x11c0a1[_0xc387('0x40')],qs[_0xc387('0x46')](_0x3e3bc9[_0xc387('0x41')][_0xc387('0x46')]));_0x156a21[_0xc387('0x45')]=_0x156a21[_0xc387('0x45')][_0xc387('0x47')]?_0x156a21[_0xc387('0x45')]:_0x11c0a1[_0xc387('0x40')];if(!_0x3e3bc9[_0xc387('0x41')][_0xc387('0x48')](_0xc387('0x49'))){_0x156a21[_0xc387('0x4a')]=qs[_0xc387('0x4a')](_0x3e3bc9[_0xc387('0x41')][_0xc387('0x4a')]);_0x156a21[_0xc387('0x32')]=qs[_0xc387('0x32')](_0x3e3bc9[_0xc387('0x41')][_0xc387('0x32')]);}_0x156a21['order']=qs[_0xc387('0x4b')](_0x3e3bc9[_0xc387('0x41')][_0xc387('0x4b')]);_0x156a21[_0xc387('0x4c')]=qs[_0xc387('0x43')](_['pick'](_0x3e3bc9['query'],_0x11c0a1['filters']),_0x52dd7e);if(_0x3e3bc9[_0xc387('0x41')][_0xc387('0x4d')]){_0x156a21[_0xc387('0x4c')]=_['merge'](_0x156a21[_0xc387('0x4c')],{'$or':_[_0xc387('0x3b')](_0x52dd7e,function(_0x6a639a){if(_0x6a639a[_0xc387('0x3e')]!==_0xc387('0x4e')){var _0x3dcf0f={};_0x3dcf0f[_0x6a639a[_0xc387('0x38')]]={'$like':'%'+_0x3e3bc9[_0xc387('0x41')][_0xc387('0x4d')]+'%'};return _0x3dcf0f;}})});}_0x156a21=_[_0xc387('0x4f')]({},_0x156a21,_0x3e3bc9[_0xc387('0x50')]);var _0x10f3fe={'where':_0x156a21[_0xc387('0x4c')]};return db[_0xc387('0x51')][_0xc387('0x31')](_0x10f3fe)[_0xc387('0x21')](function(_0x5c38d9){_0x24801d[_0xc387('0x31')]=_0x5c38d9;if(_0x3e3bc9[_0xc387('0x41')][_0xc387('0x52')]){_0x156a21[_0xc387('0x53')]=[{'all':!![]}];}return db[_0xc387('0x51')]['findAll'](_0x156a21);})[_0xc387('0x21')](function(_0x15590f){_0x24801d[_0xc387('0x54')]=_0x15590f;return _0x24801d;})['then'](respondWithFilteredResult(_0x438925,_0x156a21))[_0xc387('0x2c')](handleError(_0x438925,null));};exports[_0xc387('0x55')]=function(_0x398bb0,_0x42663b){var _0x575fda={'raw':!![],'where':{'id':_0x398bb0[_0xc387('0x56')]['id']}},_0x2d5610={};_0x2d5610[_0xc387('0x40')]=_[_0xc387('0x42')](db[_0xc387('0x51')][_0xc387('0x3c')]);_0x2d5610[_0xc387('0x41')]=_[_0xc387('0x42')](_0x398bb0[_0xc387('0x41')]);_0x2d5610[_0xc387('0x43')]=_[_0xc387('0x44')](_0x2d5610['model'],_0x2d5610[_0xc387('0x41')]);_0x575fda[_0xc387('0x45')]=_[_0xc387('0x44')](_0x2d5610[_0xc387('0x40')],qs[_0xc387('0x46')](_0x398bb0['query'][_0xc387('0x46')]));_0x575fda[_0xc387('0x45')]=_0x575fda[_0xc387('0x45')][_0xc387('0x47')]?_0x575fda[_0xc387('0x45')]:_0x2d5610[_0xc387('0x40')];if(_0x398bb0[_0xc387('0x41')][_0xc387('0x52')]){_0x575fda['include']=[{'all':!![]}];}_0x575fda=_[_0xc387('0x4f')]({},_0x575fda,_0x398bb0[_0xc387('0x50')]);return db[_0xc387('0x51')][_0xc387('0x57')](_0x575fda)[_0xc387('0x21')](handleEntityNotFound(_0x42663b,null))[_0xc387('0x21')](respondWithResult(_0x42663b,null))['catch'](handleError(_0x42663b,null));};exports[_0xc387('0x58')]=function(_0x22aa68,_0x1fc784){return db[_0xc387('0x51')][_0xc387('0x58')](_0x22aa68[_0xc387('0x59')],{})[_0xc387('0x21')](respondWithResult(_0x1fc784,0xc9))[_0xc387('0x2c')](handleError(_0x1fc784,null));};exports[_0xc387('0x5a')]=function(_0x3c7199,_0x3cabc2){if(_0x3c7199[_0xc387('0x59')]['id']){delete _0x3c7199[_0xc387('0x59')]['id'];}return db[_0xc387('0x51')][_0xc387('0x57')]({'where':{'id':_0x3c7199[_0xc387('0x56')]['id']}})[_0xc387('0x21')](handleEntityNotFound(_0x3cabc2,null))[_0xc387('0x21')](saveUpdates(_0x3c7199[_0xc387('0x59')],null))['then'](respondWithResult(_0x3cabc2,null))[_0xc387('0x2c')](handleError(_0x3cabc2,null));};exports[_0xc387('0x5b')]=function(_0x11724a,_0x1bbc3b){return db['ChatMessage']['find']({'where':{'id':_0x11724a['params']['id']}})[_0xc387('0x21')](handleEntityNotFound(_0x1bbc3b,null))[_0xc387('0x21')](removeEntity(_0x1bbc3b,null))[_0xc387('0x2c')](handleError(_0x1bbc3b,null));};exports[_0xc387('0x5c')]=function(_0x2cef7c,_0x469f5b){return db[_0xc387('0x51')][_0xc387('0x5c')]()['then'](respondWithResult(_0x469f5b,null))['catch'](handleError(_0x469f5b,null));};var interaction_log=require(_0xc387('0x15'))('chat-interactions');exports['accept']=function(_0x283622,_0x1e2e68,_0x18575f){var _0x547f0f={'channel':_0xc387('0x5d')};if(_0x283622[_0xc387('0x59')]['id']){delete _0x283622['body']['id'];}_0x283622[_0xc387('0x59')][_0xc387('0x5e')]=!![];_0x283622[_0xc387('0x59')][_0xc387('0x5f')]=moment()[_0xc387('0x60')](_0xc387('0x61'));_0x283622[_0xc387('0x59')][_0xc387('0x62')]=_0x283622[_0xc387('0x59')]['UserId']||_0x283622[_0xc387('0x63')]['id'];return db[_0xc387('0x51')]['find']({'where':{'id':_0x283622[_0xc387('0x56')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xc387('0x21')](handleEntityNotFound(_0x1e2e68,null))[_0xc387('0x21')](saveUpdates(_0x283622[_0xc387('0x59')],null))['then'](function(_0x18de78){if(_0x18de78){_0x547f0f['message']=_0x18de78[_0xc387('0x64')]({'plain':!![]});return db[_0xc387('0x65')][_0xc387('0x57')]({'where':{'id':_0x18de78['ChatInteractionId']}});}return null;})[_0xc387('0x21')](handleEntityNotFound(_0x1e2e68,null))[_0xc387('0x21')](function(_0x5f2935){if(_0x5f2935){return _0x5f2935[_0xc387('0x5a')]({'UserId':_0x283622[_0xc387('0x59')][_0xc387('0x62')],'read1stAt':_[_0xc387('0x66')](_0x5f2935[_0xc387('0x67')])?moment()[_0xc387('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc387('0x21')](function(_0x1faaa3){if(_0x1faaa3){_0x547f0f[_0xc387('0x68')]=_0x1faaa3['get']({'plain':!![]});interaction_log['info'](_0xc387('0x69'),_0x283622['user']['id'],_0x283622[_0xc387('0x63')][_0xc387('0x38')],_0x283622[_0xc387('0x63')][_0xc387('0x6a')],_0x547f0f[_0xc387('0x68')]['id'],_0x283622[_0xc387('0x59')]?JSON[_0xc387('0x27')](_0x283622['body']):_0xc387('0x6b'));return respondWithRpcPromise(_0xc387('0x6c'),'acceptMessage',_0x547f0f);}return null;})[_0xc387('0x21')](function(_0x50421f){if(_0x50421f){if(_0x283622[_0xc387('0x59')][_0xc387('0x6d')]){_0x547f0f[_0xc387('0x2a')][_0xc387('0x6e')]=util[_0xc387('0x60')](_0xc387('0x6f'),_0x283622[_0xc387('0x63')][_0xc387('0x38')]);_0x547f0f['message'][_0xc387('0x70')]=_0x547f0f['channel'];_0x547f0f[_0xc387('0x2a')][_0xc387('0x71')]='accept';return respondWithRpcPromise(_0xc387('0x72'),_0xc387('0x72'),{'event':_0xc387('0x73'),'message':_[_0xc387('0x4f')](_0x547f0f[_0xc387('0x2a')],JSON[_0xc387('0x74')](_0x547f0f[_0xc387('0x68')][_0xc387('0x75')]))},client9002)[_0xc387('0x21')](function(){return _0x547f0f;});}return _0x547f0f;}return null;})[_0xc387('0x21')](respondWithResult(_0x1e2e68,null))[_0xc387('0x2c')](handleError(_0x1e2e68,null));};var interaction_log=require(_0xc387('0x15'))('chat-interactions');exports['reject']=function(_0x5cc218,_0x487388,_0x36b911){var _0x20a9fa={'agent':{},'channel':_0xc387('0x5d')};if(_0x5cc218[_0xc387('0x59')]['id']){delete _0x5cc218[_0xc387('0x59')]['id'];}_0x5cc218[_0xc387('0x59')]['UserId']=_0x5cc218[_0xc387('0x59')][_0xc387('0x62')]||_0x5cc218['user']['id'];_0x20a9fa[_0xc387('0x76')]['id']=_0x5cc218['body']['UserId'];return db['ChatMessage'][_0xc387('0x57')]({'where':{'id':_0x5cc218[_0xc387('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x487388,null))[_0xc387('0x21')](function(_0x13ed1e){if(_0x13ed1e){_0x20a9fa[_0xc387('0x2a')]=_0x13ed1e[_0xc387('0x64')]({'plain':!![]});return db[_0xc387('0x65')]['find']({'where':{'id':_0x13ed1e[_0xc387('0x77')]}});}return null;})['then'](handleEntityNotFound(_0x487388,null))[_0xc387('0x21')](function(_0x1c2b3b){if(_0x1c2b3b){_0x20a9fa['interaction']=_0x1c2b3b[_0xc387('0x64')]({'plain':!![]});interaction_log[_0xc387('0x22')](_0xc387('0x78'),_0x5cc218[_0xc387('0x63')]['id'],_0x5cc218[_0xc387('0x63')]['name'],_0x5cc218[_0xc387('0x63')][_0xc387('0x6a')],_0x20a9fa[_0xc387('0x68')]['id'],_0x5cc218['body']?JSON[_0xc387('0x27')](_0x5cc218[_0xc387('0x59')]):_0xc387('0x6b'));return respondWithRpcPromise(_0xc387('0x79'),'rejectMessage',_0x20a9fa);}return null;})['then'](function(_0x265d07){if(_0x265d07){_0x265d07['message'][_0xc387('0x6e')]=util[_0xc387('0x60')](_0xc387('0x6f'),_0x5cc218[_0xc387('0x63')][_0xc387('0x38')]);_0x265d07[_0xc387('0x2a')][_0xc387('0x70')]=_0x20a9fa[_0xc387('0x70')];_0x265d07[_0xc387('0x2a')][_0xc387('0x71')]=_0xc387('0x35');respondWithRpcPromise(_0xc387('0x72'),'EventManager',{'event':'rejectmessage','message':_0x265d07['message']},client9002);return _0x20a9fa;}return null;})['then'](respondWithResult(_0x487388,null))[_0xc387('0x2c')](handleError(_0x487388,null));};
\ No newline at end of file
+var _0x488d=['keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','channel','EventManager','acceptmessage','parse','formData','chat','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','SIP/%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','query'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x488d,0x12f));var _0xd488=function(_0x510a4d,_0x1a2b3e){_0x510a4d=_0x510a4d-0x0;var _0x238bbb=_0x488d[_0x510a4d];return _0x238bbb;};'use strict';var pdf=require(_0xd488('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd488('0x1'));var zipdir=require(_0xd488('0x2'));var jsonpatch=require(_0xd488('0x3'));var rp=require(_0xd488('0x4'));var moment=require(_0xd488('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd488('0x6'));var sox=require(_0xd488('0x7'));var csv=require(_0xd488('0x8'));var ejs=require(_0xd488('0x9'));var fs=require('fs');var _=require(_0xd488('0xa'));var squel=require(_0xd488('0xb'));var crypto=require('crypto');var jsforce=require(_0xd488('0xc'));var deskjs=require(_0xd488('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd488('0xe'));var Papa=require(_0xd488('0xf'));var Redis=require(_0xd488('0x10'));var authService=require(_0xd488('0x11'));var qs=require(_0xd488('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd488('0x13'));var logger=require(_0xd488('0x14'))(_0xd488('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd488('0x16')]=_[_0xd488('0x17')](config['redis'],{'host':_0xd488('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd488('0x16')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xd488('0x19'));var client=jayson[_0xd488('0x1a')][_0xd488('0x1b')]({'port':0x232c});var client9002=jayson[_0xd488('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x5294e5,_0x5b462f,_0x485ada){if(_0x485ada){var _0x185c11=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x185c11[_0xd488('0x1c')](_0x5b462f)){return _0x5294e5;}else{throw new db['Sequelize'][(_0xd488('0x1d'))](_0xd488('0x1e'));}}else{return _0x5294e5;}}function respondWithRpcPromise(_0x141544,_0xe9c4be,_0x5620b9,_0x544a47){return new BPromise(function(_0x24996a,_0x3f20d0){var _0x3714a6=_0x544a47||client;return _0x3714a6['request'](_0x141544,_0x5620b9)[_0xd488('0x1f')](function(_0x53e82c){logger[_0xd488('0x20')](_0xd488('0x21'),_0xe9c4be,_0xd488('0x22'));logger[_0xd488('0x23')](_0xd488('0x24'),_0xe9c4be,_0xd488('0x22'),JSON[_0xd488('0x25')](_0x53e82c));if(_0x53e82c[_0xd488('0x26')]){if(_0x53e82c[_0xd488('0x26')][_0xd488('0x27')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0xe9c4be,_0x53e82c[_0xd488('0x26')][_0xd488('0x28')]);return _0x3f20d0(_0x53e82c[_0xd488('0x26')][_0xd488('0x28')]);}logger[_0xd488('0x26')](_0xd488('0x21'),_0xe9c4be,_0x53e82c['error'][_0xd488('0x28')]);return _0x24996a(_0x53e82c[_0xd488('0x26')][_0xd488('0x28')]);}else{logger['info'](_0xd488('0x21'),_0xe9c4be,_0xd488('0x22'));_0x24996a(_0x53e82c[_0xd488('0x29')]['message']);}})[_0xd488('0x2a')](function(_0x5a2d33){logger[_0xd488('0x26')](_0xd488('0x21'),_0xe9c4be,_0x5a2d33);_0x3f20d0(_0x5a2d33);});});}function respondWithStatusCode(_0x5bf03b,_0x524795){_0x524795=_0x524795||0xcc;return function(_0x4898cb){if(_0x4898cb){return _0x5bf03b[_0xd488('0x2b')](_0x524795);}return _0x5bf03b[_0xd488('0x2c')](_0x524795)[_0xd488('0x2d')]();};}function respondWithResult(_0x1123c5,_0x527b45){_0x527b45=_0x527b45||0xc8;return function(_0x4c5347){if(_0x4c5347){return _0x1123c5[_0xd488('0x2c')](_0x527b45)['json'](_0x4c5347);}};}function respondWithFilteredResult(_0xe8d403,_0xc68cca){return function(_0x5cbaef){if(_0x5cbaef){var _0x1a94c0=_0x5cbaef[_0xd488('0x2e')],_0x4b4066=_0xc68cca[_0xd488('0x2f')],_0x816f2c=_0xc68cca[_0xd488('0x2f')]+_0xc68cca['limit'],_0x4cbe3e;if(_0x816f2c>=_0x1a94c0){_0x816f2c=_0x1a94c0;_0x4cbe3e=0xc8;}else{_0x4cbe3e=0xce;}_0xe8d403['status'](_0x4cbe3e);return _0xe8d403[_0xd488('0x30')](_0xd488('0x31'),_0x4b4066+'-'+_0x816f2c+'/'+_0x1a94c0)[_0xd488('0x32')](_0x5cbaef);}return null;};}function patchUpdates(_0x2f22e6){return function(_0x35f6dd){try{jsonpatch['apply'](_0x35f6dd,_0x2f22e6,!![]);}catch(_0x5a14b1){return BPromise[_0xd488('0x33')](_0x5a14b1);}return _0x35f6dd[_0xd488('0x34')]();};}function saveUpdates(_0x2044c0,_0x6cd79c){return function(_0x52b143){if(_0x52b143){return _0x52b143[_0xd488('0x35')](_0x2044c0)[_0xd488('0x1f')](function(_0x4bac5f){return _0x4bac5f;});}return null;};}function removeEntity(_0x11d3da,_0x3a8370){return function(_0x2ec6b8){if(_0x2ec6b8){return _0x2ec6b8[_0xd488('0x36')]()[_0xd488('0x1f')](function(){_0x11d3da[_0xd488('0x2c')](0xcc)[_0xd488('0x2d')]();});}};}function handleEntityNotFound(_0xa62b83,_0x57201c){return function(_0x2c9327){if(!_0x2c9327){_0xa62b83['sendStatus'](0x194);}return _0x2c9327;};}function handleError(_0x1eba35,_0x77541a){_0x77541a=_0x77541a||0x1f4;return function(_0x7bba3f){logger[_0xd488('0x26')](_0x7bba3f[_0xd488('0x37')]);if(_0x7bba3f[_0xd488('0x38')]){delete _0x7bba3f[_0xd488('0x38')];}_0x1eba35['status'](_0x77541a)[_0xd488('0x39')](_0x7bba3f);};}exports[_0xd488('0x3a')]=function(_0x29248b,_0x39574c){var _0x30276c={},_0x4e34f8={},_0x4e6704={'count':0x0,'rows':[]};var _0x24b315=_[_0xd488('0x3b')](db[_0xd488('0x3c')]['rawAttributes'],function(_0x2e2d1d){return{'name':_0x2e2d1d[_0xd488('0x3d')],'type':_0x2e2d1d[_0xd488('0x3e')][_0xd488('0x3f')]};});_0x4e34f8[_0xd488('0x40')]=_[_0xd488('0x3b')](_0x24b315,_0xd488('0x38'));_0x4e34f8[_0xd488('0x41')]=_[_0xd488('0x42')](_0x29248b[_0xd488('0x41')]);_0x4e34f8['filters']=_[_0xd488('0x43')](_0x4e34f8[_0xd488('0x40')],_0x4e34f8['query']);_0x30276c[_0xd488('0x44')]=_['intersection'](_0x4e34f8['model'],qs['fields'](_0x29248b[_0xd488('0x41')][_0xd488('0x45')]));_0x30276c[_0xd488('0x44')]=_0x30276c[_0xd488('0x44')][_0xd488('0x46')]?_0x30276c[_0xd488('0x44')]:_0x4e34f8[_0xd488('0x40')];if(!_0x29248b[_0xd488('0x41')]['hasOwnProperty'](_0xd488('0x47'))){_0x30276c[_0xd488('0x48')]=qs[_0xd488('0x48')](_0x29248b['query'][_0xd488('0x48')]);_0x30276c[_0xd488('0x2f')]=qs['offset'](_0x29248b[_0xd488('0x41')][_0xd488('0x2f')]);}_0x30276c[_0xd488('0x49')]=qs[_0xd488('0x4a')](_0x29248b[_0xd488('0x41')][_0xd488('0x4a')]);_0x30276c[_0xd488('0x4b')]=qs[_0xd488('0x4c')](_[_0xd488('0x4d')](_0x29248b['query'],_0x4e34f8[_0xd488('0x4c')]),_0x24b315);if(_0x29248b[_0xd488('0x41')][_0xd488('0x4e')]){_0x30276c[_0xd488('0x4b')]=_[_0xd488('0x4f')](_0x30276c[_0xd488('0x4b')],{'$or':_[_0xd488('0x3b')](_0x24b315,function(_0x3b96e4){if(_0x3b96e4[_0xd488('0x3e')]!==_0xd488('0x50')){var _0x58b4fe={};_0x58b4fe[_0x3b96e4['name']]={'$like':'%'+_0x29248b['query'][_0xd488('0x4e')]+'%'};return _0x58b4fe;}})});}_0x30276c=_[_0xd488('0x4f')]({},_0x30276c,_0x29248b[_0xd488('0x51')]);var _0x32be3d={'where':_0x30276c['where']};return db[_0xd488('0x3c')][_0xd488('0x2e')](_0x32be3d)[_0xd488('0x1f')](function(_0x3a2565){_0x4e6704[_0xd488('0x2e')]=_0x3a2565;if(_0x29248b[_0xd488('0x41')][_0xd488('0x52')]){_0x30276c[_0xd488('0x53')]=[{'all':!![]}];}return db[_0xd488('0x3c')][_0xd488('0x54')](_0x30276c);})[_0xd488('0x1f')](function(_0x3d4745){_0x4e6704[_0xd488('0x55')]=_0x3d4745;return _0x4e6704;})[_0xd488('0x1f')](respondWithFilteredResult(_0x39574c,_0x30276c))[_0xd488('0x2a')](handleError(_0x39574c,null));};exports['show']=function(_0x23db43,_0xa400b6){var _0x24bf5e={'raw':!![],'where':{'id':_0x23db43[_0xd488('0x56')]['id']}},_0x4e56e5={};_0x4e56e5['model']=_[_0xd488('0x42')](db[_0xd488('0x3c')][_0xd488('0x57')]);_0x4e56e5[_0xd488('0x41')]=_[_0xd488('0x42')](_0x23db43[_0xd488('0x41')]);_0x4e56e5[_0xd488('0x4c')]=_['intersection'](_0x4e56e5[_0xd488('0x40')],_0x4e56e5[_0xd488('0x41')]);_0x24bf5e['attributes']=_[_0xd488('0x43')](_0x4e56e5['model'],qs[_0xd488('0x45')](_0x23db43[_0xd488('0x41')]['fields']));_0x24bf5e['attributes']=_0x24bf5e[_0xd488('0x44')][_0xd488('0x46')]?_0x24bf5e[_0xd488('0x44')]:_0x4e56e5[_0xd488('0x40')];if(_0x23db43[_0xd488('0x41')][_0xd488('0x52')]){_0x24bf5e[_0xd488('0x53')]=[{'all':!![]}];}_0x24bf5e=_[_0xd488('0x4f')]({},_0x24bf5e,_0x23db43[_0xd488('0x51')]);return db[_0xd488('0x3c')][_0xd488('0x58')](_0x24bf5e)['then'](handleEntityNotFound(_0xa400b6,null))[_0xd488('0x1f')](respondWithResult(_0xa400b6,null))['catch'](handleError(_0xa400b6,null));};exports['create']=function(_0x2abb36,_0xd2d5b7){return db[_0xd488('0x3c')][_0xd488('0x59')](_0x2abb36[_0xd488('0x5a')],{})[_0xd488('0x1f')](respondWithResult(_0xd2d5b7,0xc9))[_0xd488('0x2a')](handleError(_0xd2d5b7,null));};exports[_0xd488('0x35')]=function(_0x37401b,_0x4c7462){if(_0x37401b[_0xd488('0x5a')]['id']){delete _0x37401b['body']['id'];}return db[_0xd488('0x3c')][_0xd488('0x58')]({'where':{'id':_0x37401b['params']['id']}})[_0xd488('0x1f')](handleEntityNotFound(_0x4c7462,null))[_0xd488('0x1f')](saveUpdates(_0x37401b['body'],null))[_0xd488('0x1f')](respondWithResult(_0x4c7462,null))[_0xd488('0x2a')](handleError(_0x4c7462,null));};exports[_0xd488('0x36')]=function(_0x4205fe,_0x2395b9){return db[_0xd488('0x3c')][_0xd488('0x58')]({'where':{'id':_0x4205fe[_0xd488('0x56')]['id']}})['then'](handleEntityNotFound(_0x2395b9,null))[_0xd488('0x1f')](removeEntity(_0x2395b9,null))['catch'](handleError(_0x2395b9,null));};exports[_0xd488('0x5b')]=function(_0x50e220,_0x1622b0){return db[_0xd488('0x3c')][_0xd488('0x5b')]()[_0xd488('0x1f')](respondWithResult(_0x1622b0,null))[_0xd488('0x2a')](handleError(_0x1622b0,null));};var interaction_log=require(_0xd488('0x14'))(_0xd488('0x5c'));exports[_0xd488('0x5d')]=function(_0x1cb325,_0x535911,_0x2956ae){var _0x14d4ed={'channel':'chat'};if(_0x1cb325['body']['id']){delete _0x1cb325[_0xd488('0x5a')]['id'];}_0x1cb325[_0xd488('0x5a')]['read']=!![];_0x1cb325[_0xd488('0x5a')][_0xd488('0x5e')]=moment()[_0xd488('0x5f')](_0xd488('0x60'));_0x1cb325[_0xd488('0x5a')][_0xd488('0x61')]=_0x1cb325[_0xd488('0x5a')][_0xd488('0x61')]||_0x1cb325[_0xd488('0x62')]['id'];return db['ChatMessage'][_0xd488('0x58')]({'where':{'id':_0x1cb325['params']['id'],'UserId':null},'include':[{'model':db[_0xd488('0x63')],'as':_0xd488('0x64')}]})['then'](handleEntityNotFound(_0x535911,null))['then'](saveUpdates(_0x1cb325[_0xd488('0x5a')],null))[_0xd488('0x1f')](function(_0x7808f0){if(_0x7808f0){_0x14d4ed[_0xd488('0x28')]=_0x7808f0[_0xd488('0x65')]({'plain':!![]});return db[_0xd488('0x66')]['find']({'where':{'id':_0x7808f0['ChatInteractionId']}});}return null;})[_0xd488('0x1f')](handleEntityNotFound(_0x535911,null))['then'](function(_0x5a08d1){if(_0x5a08d1){return _0x5a08d1[_0xd488('0x35')]({'UserId':_0x1cb325['body'][_0xd488('0x61')],'read1stAt':_[_0xd488('0x67')](_0x5a08d1[_0xd488('0x68')])?moment()[_0xd488('0x5f')](_0xd488('0x60')):undefined});}return null;})['then'](function(_0x46cb0b){if(_0x46cb0b){_0x14d4ed[_0xd488('0x69')]=_0x46cb0b[_0xd488('0x65')]({'plain':!![]});interaction_log[_0xd488('0x20')](_0xd488('0x6a'),_0x1cb325[_0xd488('0x62')]['id'],_0x1cb325['user'][_0xd488('0x38')],_0x1cb325['user'][_0xd488('0x6b')],_0x14d4ed[_0xd488('0x69')]['id'],_0x1cb325[_0xd488('0x5a')]?JSON['stringify'](_0x1cb325[_0xd488('0x5a')]):_0xd488('0x6c'));return respondWithRpcPromise(_0xd488('0x6d'),_0xd488('0x6e'),_0x14d4ed);}return null;})['then'](function(_0x57985c){if(_0x57985c){if(_0x1cb325[_0xd488('0x5a')]['manual']){_0x14d4ed['message']['interface']=util[_0xd488('0x5f')]('SIP/%s',_0x1cb325[_0xd488('0x62')][_0xd488('0x38')]);_0x14d4ed[_0xd488('0x28')][_0xd488('0x6f')]=_0x14d4ed[_0xd488('0x6f')];_0x14d4ed[_0xd488('0x28')]['event']=_0xd488('0x5d');return respondWithRpcPromise(_0xd488('0x70'),'EventManager',{'event':_0xd488('0x71'),'message':_[_0xd488('0x4f')](_0x14d4ed[_0xd488('0x28')],JSON[_0xd488('0x72')](_0x14d4ed['interaction'][_0xd488('0x73')]))},client9002)['then'](function(){return _0x14d4ed;});}return _0x14d4ed;}return null;})[_0xd488('0x1f')](respondWithResult(_0x535911,null))[_0xd488('0x2a')](handleError(_0x535911,null));};var interaction_log=require(_0xd488('0x14'))(_0xd488('0x5c'));exports[_0xd488('0x33')]=function(_0x50eed1,_0x5cb8a1,_0x38d6e3){var _0x1282ab={'agent':{},'channel':_0xd488('0x74')};if(_0x50eed1[_0xd488('0x5a')]['id']){delete _0x50eed1[_0xd488('0x5a')]['id'];}_0x50eed1['body']['UserId']=_0x50eed1[_0xd488('0x5a')][_0xd488('0x61')]||_0x50eed1[_0xd488('0x62')]['id'];_0x1282ab['agent']['id']=_0x50eed1[_0xd488('0x5a')][_0xd488('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x50eed1['params']['id'],'UserId':null}})[_0xd488('0x1f')](handleEntityNotFound(_0x5cb8a1,null))[_0xd488('0x1f')](function(_0x63fc3c){if(_0x63fc3c){_0x1282ab['message']=_0x63fc3c[_0xd488('0x65')]({'plain':!![]});return db[_0xd488('0x66')][_0xd488('0x58')]({'where':{'id':_0x63fc3c[_0xd488('0x75')]}});}return null;})['then'](handleEntityNotFound(_0x5cb8a1,null))[_0xd488('0x1f')](function(_0x1c005b){if(_0x1c005b){_0x1282ab[_0xd488('0x69')]=_0x1c005b['get']({'plain':!![]});interaction_log[_0xd488('0x20')](_0xd488('0x76'),_0x50eed1[_0xd488('0x62')]['id'],_0x50eed1[_0xd488('0x62')][_0xd488('0x38')],_0x50eed1[_0xd488('0x62')][_0xd488('0x6b')],_0x1282ab[_0xd488('0x69')]['id'],_0x50eed1[_0xd488('0x5a')]?JSON['stringify'](_0x50eed1['body']):'null');return respondWithRpcPromise(_0xd488('0x77'),_0xd488('0x78'),_0x1282ab);}return null;})[_0xd488('0x1f')](function(_0xac896f){if(_0xac896f){_0xac896f['message'][_0xd488('0x79')]=util['format'](_0xd488('0x7a'),_0x50eed1[_0xd488('0x62')][_0xd488('0x38')]);_0xac896f[_0xd488('0x28')][_0xd488('0x6f')]=_0x1282ab[_0xd488('0x6f')];_0xac896f[_0xd488('0x28')]['event']='reject';respondWithRpcPromise(_0xd488('0x70'),_0xd488('0x70'),{'event':'rejectmessage','message':_0xac896f[_0xd488('0x28')]},client9002);return _0x1282ab;}return null;})[_0xd488('0x1f')](respondWithResult(_0x5cb8a1,null))['catch'](handleError(_0x5cb8a1,null));};
\ No newline at end of file
index a8af406..b7b5385 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e66=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0x7e66,0xd0));var _0x67e6=function(_0x8c5bbe,_0x5e5829){_0x8c5bbe=_0x8c5bbe-0x0;var _0x30238d=_0x7e66[_0x8c5bbe];return _0x30238d;};'use strict';var EventEmitter=require(_0x67e6('0x0'));var ChatMessage=require(_0x67e6('0x1'))['db'][_0x67e6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x67e6('0x3')](0x0);var events={'afterCreate':_0x67e6('0x4'),'afterUpdate':_0x67e6('0x5'),'afterDestroy':_0x67e6('0x6')};function emitEvent(_0x2f410c){return function(_0x2a957e,_0x5e9306,_0x246a87){ChatMessageEvents[_0x67e6('0x7')](_0x2f410c+':'+_0x2a957e['id'],_0x2a957e);ChatMessageEvents[_0x67e6('0x7')](_0x2f410c,_0x2a957e);_0x246a87(null);};}for(var e in events){if(events[_0x67e6('0x8')](e)){var event=events[e];ChatMessage[_0x67e6('0x9')](e,emitEvent(event));}}module[_0x67e6('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0xfe17=['update','remove','emit','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xfe17,0x151));var _0x7fe1=function(_0x964316,_0x487778){_0x964316=_0x964316-0x0;var _0x29c707=_0xfe17[_0x964316];return _0x29c707;};'use strict';var EventEmitter=require(_0x7fe1('0x0'));var ChatMessage=require(_0x7fe1('0x1'))['db'][_0x7fe1('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7fe1('0x3')](0x0);var events={'afterCreate':_0x7fe1('0x4'),'afterUpdate':_0x7fe1('0x5'),'afterDestroy':_0x7fe1('0x6')};function emitEvent(_0x2ff1e2){return function(_0x1b3e5b,_0x450b3d,_0x418524){ChatMessageEvents[_0x7fe1('0x7')](_0x2ff1e2+':'+_0x1b3e5b['id'],_0x1b3e5b);ChatMessageEvents[_0x7fe1('0x7')](_0x2ff1e2,_0x1b3e5b);_0x418524(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7fe1('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index 1f50164..dcdcb43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb5d=['toLowerCase','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0xfb5d,0x153));var _0xdfb5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfb5d[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdfb5('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfb5('0x1'));var rimraf=require(_0xdfb5('0x2'));var config=require(_0xdfb5('0x3'));var attributes=require(_0xdfb5('0x4'));module[_0xdfb5('0x5')]=function(_0x4ea566,_0x5ad692){return _0x4ea566['define'](_0xdfb5('0x6'),attributes,{'tableName':_0xdfb5('0x7'),'paranoid':![],'indexes':[{'name':_0xdfb5('0x8'),'fields':[_0xdfb5('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc0ae89,_0x557a02,_0x4bcaba){var _0x3e2eeb=_0x4ea566[_0xdfb5('0xa')];var _0x1feb69=_0xc0ae89[_0xdfb5('0xb')]({'plain':!![]});if(_0x1feb69[_0xdfb5('0xc')]['toLowerCase']()==='in'||_0x1feb69[_0xdfb5('0xc')][_0xdfb5('0xd')]()==='out'&&!_0x1feb69['secret']&&!_[_0xdfb5('0xe')](_0x1feb69[_0xdfb5('0xf')])){_0x3e2eeb[_0xdfb5('0x10')][_0xdfb5('0x11')]({'where':{'id':_0x1feb69[_0xdfb5('0x12')]}})['then'](function(_0x15f2ed){if(_0x15f2ed){_0x15f2ed['update']({'lastMsgAt':_0x1feb69['createdAt'],'lastMsgDirection':_0x1feb69[_0xdfb5('0xc')][_0xdfb5('0xd')]()});}})['catch'](function(_0x516df2){console[_0xdfb5('0x13')](_0x516df2);});}_0x4bcaba();}},'charset':_0xdfb5('0x14'),'collate':_0xdfb5('0x15')});};
\ No newline at end of file
+var _0x3488=['isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','direction','toLowerCase','out'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x3488,0x1b2));var _0x8348=function(_0x3f95d2,_0x486845){_0x3f95d2=_0x3f95d2-0x0;var _0xa15508=_0x3488[_0x3f95d2];return _0xa15508;};'use strict';var _=require(_0x8348('0x0'));var util=require(_0x8348('0x1'));var logger=require('../../config/logger')(_0x8348('0x2'));var moment=require(_0x8348('0x3'));var BPromise=require(_0x8348('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8348('0x5'));var rimraf=require('rimraf');var config=require(_0x8348('0x6'));var attributes=require(_0x8348('0x7'));module[_0x8348('0x8')]=function(_0x226856,_0x405f88){return _0x226856['define'](_0x8348('0x9'),attributes,{'tableName':_0x8348('0xa'),'paranoid':![],'indexes':[{'name':_0x8348('0xb'),'fields':[_0x8348('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x90d88a,_0xe8e0c2,_0x59eb87){var _0x151079=_0x226856['models'];var _0x5868a2=_0x90d88a['get']({'plain':!![]});if(_0x5868a2['direction']['toLowerCase']()==='in'||_0x5868a2[_0x8348('0xd')][_0x8348('0xe')]()===_0x8348('0xf')&&!_0x5868a2['secret']&&!_[_0x8348('0x10')](_0x5868a2['UserId'])){_0x151079[_0x8348('0x11')][_0x8348('0x12')]({'where':{'id':_0x5868a2[_0x8348('0x13')]}})[_0x8348('0x14')](function(_0x4d98a4){if(_0x4d98a4){_0x4d98a4['update']({'lastMsgAt':_0x5868a2[_0x8348('0x15')],'lastMsgDirection':_0x5868a2['direction'][_0x8348('0xe')]()});}})['catch'](function(_0x22ec9d){console[_0x8348('0x16')](_0x22ec9d);});}_0x59eb87();}},'charset':_0x8348('0x17'),'collate':_0x8348('0x18')});};
\ No newline at end of file
index cf3217e..4bc2387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb72d=['create','body','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','localhost','socket.io-emitter','redis','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage'];(function(_0xf4add4,_0x5b9cc1){var _0x1c42fb=function(_0x2674c1){while(--_0x2674c1){_0xf4add4['push'](_0xf4add4['shift']());}};_0x1c42fb(++_0x5b9cc1);}(_0xb72d,0xc3));var _0xdb72=function(_0x5be22f,_0x2cf185){_0x5be22f=_0x5be22f-0x0;var _0x4d0eca=_0xb72d[_0x5be22f];return _0x4d0eca;};'use strict';var _=require(_0xdb72('0x0'));var util=require(_0xdb72('0x1'));var moment=require(_0xdb72('0x2'));var BPromise=require(_0xdb72('0x3'));var rs=require(_0xdb72('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb72('0x5'));var logger=require(_0xdb72('0x6'))('rpc');var config=require(_0xdb72('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdb72('0x8')][_0xdb72('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdb72('0xa'),'port':0x18eb});var socket=require(_0xdb72('0xb'))(new Redis(config[_0xdb72('0xc')]));require(_0xdb72('0xd'))[_0xdb72('0xe')](socket);function respondWithRpcPromise(_0x80db3c,_0x369408,_0x41a5fe){return new BPromise(function(_0x59f2bd,_0x181a0d){return client['request'](_0x80db3c,_0x41a5fe)[_0xdb72('0xf')](function(_0x2c855d){logger[_0xdb72('0x10')](_0xdb72('0x11'),_0x369408,_0xdb72('0x12'));logger[_0xdb72('0x13')](_0xdb72('0x14'),_0x369408,_0xdb72('0x12'),JSON[_0xdb72('0x15')](_0x2c855d));if(_0x2c855d[_0xdb72('0x16')]){if(_0x2c855d[_0xdb72('0x16')][_0xdb72('0x17')]===0x1f4){logger['error'](_0xdb72('0x11'),_0x369408,_0x2c855d[_0xdb72('0x16')][_0xdb72('0x18')]);return _0x181a0d(_0x2c855d[_0xdb72('0x16')][_0xdb72('0x18')]);}logger[_0xdb72('0x16')](_0xdb72('0x11'),_0x369408,_0x2c855d[_0xdb72('0x16')][_0xdb72('0x18')]);return _0x59f2bd(_0x2c855d[_0xdb72('0x16')][_0xdb72('0x18')]);}else{logger[_0xdb72('0x10')](_0xdb72('0x11'),_0x369408,'request\x20sent');_0x59f2bd(_0x2c855d[_0xdb72('0x19')][_0xdb72('0x18')]);}})[_0xdb72('0x1a')](function(_0x44b80a){logger[_0xdb72('0x16')](_0xdb72('0x11'),_0x369408,_0x44b80a);_0x181a0d(_0x44b80a);});});}exports[_0xdb72('0x1b')]=function(_0x11773f){var _0x42d5f4=this;return new Promise(function(_0x586bff,_0x3856d6){return db[_0xdb72('0x1c')][_0xdb72('0x1d')](_0x11773f[_0xdb72('0x1e')],{'raw':_0x11773f['options']?_0x11773f['options'][_0xdb72('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x326088){logger['info'](_0xdb72('0x1b'),_0x11773f);logger[_0xdb72('0x13')]('CreateChatMessage',_0x11773f,JSON['stringify'](_0x326088));_0x586bff(_0x326088);})[_0xdb72('0x1a')](function(_0xd436db){logger['error'](_0xdb72('0x1b'),_0xd436db[_0xdb72('0x18')],_0x11773f);_0x3856d6(_0x42d5f4[_0xdb72('0x16')](0x1f4,_0xd436db[_0xdb72('0x18')]));});});};
\ No newline at end of file
+var _0xe2af=['ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','create','options','raw','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info'];(function(_0x533437,_0x4d59d1){var _0x53f4ce=function(_0x483f6b){while(--_0x483f6b){_0x533437['push'](_0x533437['shift']());}};_0x53f4ce(++_0x4d59d1);}(_0xe2af,0x178));var _0xfe2a=function(_0x1b177a,_0x5e5043){_0x1b177a=_0x1b177a-0x0;var _0x557e29=_0xe2af[_0x1b177a];return _0x557e29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe2a('0x0'));var BPromise=require('bluebird');var rs=require(_0xfe2a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfe2a('0x2'));var logger=require(_0xfe2a('0x3'))(_0xfe2a('0x4'));var config=require(_0xfe2a('0x5'));var jayson=require(_0xfe2a('0x6'));var client=jayson[_0xfe2a('0x7')][_0xfe2a('0x8')]({'port':0x232a});config[_0xfe2a('0x9')]=_[_0xfe2a('0xa')](config['redis'],{'host':_0xfe2a('0xb'),'port':0x18eb});var socket=require(_0xfe2a('0xc'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5e00e2,_0x618c88,_0x19d3cd){return new BPromise(function(_0x3c1e2b,_0x5dc510){return client[_0xfe2a('0xd')](_0x5e00e2,_0x19d3cd)[_0xfe2a('0xe')](function(_0x47a080){logger[_0xfe2a('0xf')](_0xfe2a('0x10'),_0x618c88,_0xfe2a('0x11'));logger['debug'](_0xfe2a('0x12'),_0x618c88,_0xfe2a('0x11'),JSON[_0xfe2a('0x13')](_0x47a080));if(_0x47a080[_0xfe2a('0x14')]){if(_0x47a080[_0xfe2a('0x14')]['code']===0x1f4){logger[_0xfe2a('0x14')]('ChatMessage,\x20%s,\x20%s',_0x618c88,_0x47a080[_0xfe2a('0x14')][_0xfe2a('0x15')]);return _0x5dc510(_0x47a080[_0xfe2a('0x14')][_0xfe2a('0x15')]);}logger[_0xfe2a('0x14')](_0xfe2a('0x10'),_0x618c88,_0x47a080['error']['message']);return _0x3c1e2b(_0x47a080[_0xfe2a('0x14')]['message']);}else{logger['info'](_0xfe2a('0x10'),_0x618c88,_0xfe2a('0x11'));_0x3c1e2b(_0x47a080[_0xfe2a('0x16')][_0xfe2a('0x15')]);}})[_0xfe2a('0x17')](function(_0x5966c5){logger[_0xfe2a('0x14')](_0xfe2a('0x10'),_0x618c88,_0x5966c5);_0x5dc510(_0x5966c5);});});}exports[_0xfe2a('0x18')]=function(_0x29bd4f){var _0x34882a=this;return new Promise(function(_0x28dfc0,_0x1892be){return db['ChatMessage'][_0xfe2a('0x19')](_0x29bd4f['body'],{'raw':_0x29bd4f[_0xfe2a('0x1a')]?_0x29bd4f[_0xfe2a('0x1a')][_0xfe2a('0x1b')]===undefined?!![]:![]:!![]})[_0xfe2a('0xe')](function(_0xc3b589){logger[_0xfe2a('0xf')]('CreateChatMessage',_0x29bd4f);logger['debug'](_0xfe2a('0x18'),_0x29bd4f,JSON[_0xfe2a('0x13')](_0xc3b589));_0x28dfc0(_0xc3b589);})['catch'](function(_0x10504e){logger[_0xfe2a('0x14')](_0xfe2a('0x18'),_0x10504e[_0xfe2a('0x15')],_0x29bd4f);_0x1892be(_0x34882a[_0xfe2a('0x14')](0x1f4,_0x10504e[_0xfe2a('0x15')]));});});};
\ No newline at end of file
index 0d34f2c..b6bbc44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9582=['update','emit','removeListener','register','length','./chatMessage.events','save','remove'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x9582,0x95));var _0x2958=function(_0x474bb6,_0x227adb){_0x474bb6=_0x474bb6-0x0;var _0x25d815=_0x9582[_0x474bb6];return _0x25d815;};'use strict';var ChatMessageEvents=require(_0x2958('0x0'));var events=[_0x2958('0x1'),_0x2958('0x2'),_0x2958('0x3')];function createListener(_0x42752c,_0x176287){return function(_0x559a01){_0x176287[_0x2958('0x4')](_0x42752c,_0x559a01);};}function removeListener(_0x3b907e,_0x136c77){return function(){ChatMessageEvents[_0x2958('0x5')](_0x3b907e,_0x136c77);};}exports[_0x2958('0x6')]=function(_0xbde128){for(var _0x88ffaa=0x0,_0x309525=events[_0x2958('0x7')];_0x88ffaa<_0x309525;_0x88ffaa++){var _0x2e571b=events[_0x88ffaa];var _0x56ca85=createListener('chatMessage:'+_0x2e571b,_0xbde128);ChatMessageEvents['on'](_0x2e571b,_0x56ca85);}};
\ No newline at end of file
+var _0xe2fe=['update','emit','register','length','./chatMessage.events'];(function(_0x19181d,_0x430209){var _0x5bf00d=function(_0x159f49){while(--_0x159f49){_0x19181d['push'](_0x19181d['shift']());}};_0x5bf00d(++_0x430209);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var ChatMessageEvents=require(_0xee2f('0x0'));var events=['save','remove',_0xee2f('0x1')];function createListener(_0x5e18ae,_0x169cf9){return function(_0x1b6f4c){_0x169cf9[_0xee2f('0x2')](_0x5e18ae,_0x1b6f4c);};}function removeListener(_0x2d2b03,_0xcb45e6){return function(){ChatMessageEvents['removeListener'](_0x2d2b03,_0xcb45e6);};}exports[_0xee2f('0x3')]=function(_0x2b7e7c){for(var _0x49926b=0x0,_0x1533a0=events[_0xee2f('0x4')];_0x49926b<_0x1533a0;_0x49926b++){var _0x5a7975=events[_0x49926b];var _0x3c4095=createListener('chatMessage:'+_0x5a7975,_0x2b7e7c);ChatMessageEvents['on'](_0x5a7975,_0x3c4095);}};
\ No newline at end of file
index e28eff4..4b8e5d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x074f=['post','tracked','chat','chatmessage:create','create','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','get','describe','/:id','show'];(function(_0x16dc7c,_0x2835a1){var _0x230dfb=function(_0x75ec08){while(--_0x75ec08){_0x16dc7c['push'](_0x16dc7c['shift']());}};_0x230dfb(++_0x2835a1);}(_0x074f,0x9c));var _0xf074=function(_0x1b5fa7,_0x5cb865){_0x1b5fa7=_0x1b5fa7-0x0;var _0x56690b=_0x074f[_0x1b5fa7];return _0x56690b;};'use strict';var multer=require(_0xf074('0x0'));var util=require(_0xf074('0x1'));var path=require('path');var timeout=require(_0xf074('0x2'));var express=require(_0xf074('0x3'));var router=express['Router']();var auth=require(_0xf074('0x4'));var interaction=require(_0xf074('0x5'));var config=require('../../config/environment');var controller=require(_0xf074('0x6'));router['get']('/',auth[_0xf074('0x7')](),controller['index']);router[_0xf074('0x8')]('/describe',auth[_0xf074('0x7')](),controller[_0xf074('0x9')]);router['get'](_0xf074('0xa'),auth[_0xf074('0x7')](),controller[_0xf074('0xb')]);router[_0xf074('0xc')]('/',auth[_0xf074('0x7')](),interaction[_0xf074('0xd')](_0xf074('0xe'),_0xf074('0xf')),controller[_0xf074('0x10')]);router['put']('/:id',controller[_0xf074('0x11')]);router['put'](_0xf074('0x12'),auth['isAuthenticated'](),controller[_0xf074('0x13')]);router['put'](_0xf074('0x14'),auth[_0xf074('0x7')](),controller[_0xf074('0x15')]);router[_0xf074('0x16')]('/:id',auth[_0xf074('0x7')](),controller[_0xf074('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x50d3=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x23022b,_0x1da268){var _0x245f0b=function(_0x4599a6){while(--_0x4599a6){_0x23022b['push'](_0x23022b['shift']());}};_0x245f0b(++_0x1da268);}(_0x50d3,0xdb));var _0x350d=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0x50d3[_0x9729d7];return _0x3c4ac6;};'use strict';var multer=require(_0x350d('0x0'));var util=require(_0x350d('0x1'));var path=require(_0x350d('0x2'));var timeout=require(_0x350d('0x3'));var express=require(_0x350d('0x4'));var router=express[_0x350d('0x5')]();var auth=require(_0x350d('0x6'));var interaction=require(_0x350d('0x7'));var config=require(_0x350d('0x8'));var controller=require(_0x350d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x350d('0xa')]);router[_0x350d('0xb')](_0x350d('0xc'),auth[_0x350d('0xd')](),controller[_0x350d('0xe')]);router[_0x350d('0xb')](_0x350d('0xf'),auth[_0x350d('0xd')](),controller[_0x350d('0x10')]);router[_0x350d('0x11')]('/',auth[_0x350d('0xd')](),interaction[_0x350d('0x12')]('chat',_0x350d('0x13')),controller[_0x350d('0x14')]);router[_0x350d('0x15')](_0x350d('0xf'),controller[_0x350d('0x16')]);router[_0x350d('0x15')](_0x350d('0x17'),auth[_0x350d('0xd')](),controller['accept']);router[_0x350d('0x15')]('/:id/reject',auth[_0x350d('0xd')](),controller[_0x350d('0x18')]);router[_0x350d('0x19')](_0x350d('0xf'),auth['isAuthenticated'](),controller[_0x350d('0x1a')]);module[_0x350d('0x1b')]=router;
\ No newline at end of file
index fd9366e..c32d299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8625=['sequelize','exports','TEXT'];(function(_0x5b0df7,_0x1cbd13){var _0x2ceb04=function(_0xa97e4c){while(--_0xa97e4c){_0x5b0df7['push'](_0x5b0df7['shift']());}};_0x2ceb04(++_0x1cbd13);}(_0x8625,0x15c));var _0x5862=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x8625[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0x5862('0x0'));module[_0x5862('0x1')]={'body':{'type':Sequelize[_0x5862('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x2d1c=['TEXT','medium','sequelize','exports'];(function(_0x1c5d43,_0x319c6c){var _0x508385=function(_0xac81ce){while(--_0xac81ce){_0x1c5d43['push'](_0x1c5d43['shift']());}};_0x508385(++_0x319c6c);}(_0x2d1c,0xaa));var _0xc2d1=function(_0x2a7007,_0x599527){_0x2a7007=_0x2a7007-0x0;var _0x2b6f17=_0x2d1c[_0x2a7007];return _0x2b6f17;};'use strict';var Sequelize=require(_0xc2d1('0x0'));module[_0xc2d1('0x1')]={'body':{'type':Sequelize[_0xc2d1('0x2')](_0xc2d1('0x3')),'allowNull':![]}};
\ No newline at end of file
index 90d8185..45c81bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe015=['key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','keys','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatOfflineMessage'];(function(_0x4c4392,_0x19a612){var _0x3b5fcb=function(_0x2861db){while(--_0x2861db){_0x4c4392['push'](_0x4c4392['shift']());}};_0x3b5fcb(++_0x19a612);}(_0xe015,0x13b));var _0x5e01=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe015[_0x27af45];return _0x18df21;};'use strict';var pdf=require(_0x5e01('0x0'));var emlformat=require(_0x5e01('0x1'));var rimraf=require(_0x5e01('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5e01('0x3'));var moment=require('moment');var BPromise=require(_0x5e01('0x4'));var Mustache=require(_0x5e01('0x5'));var util=require(_0x5e01('0x6'));var path=require(_0x5e01('0x7'));var sox=require('sox');var csv=require(_0x5e01('0x8'));var ejs=require(_0x5e01('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e01('0xa'));var jsforce=require(_0x5e01('0xb'));var deskjs=require(_0x5e01('0xc'));var toCsv=require(_0x5e01('0x8'));var querystring=require(_0x5e01('0xd'));var Papa=require(_0x5e01('0xe'));var Redis=require('ioredis');var authService=require(_0x5e01('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5e01('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e01('0x11'))(_0x5e01('0x12'));var utils=require('../../config/utils');var config=require(_0x5e01('0x13'));var db=require(_0x5e01('0x14'))['db'];function respondWithStatusCode(_0x4a4f01,_0x560ae2){_0x560ae2=_0x560ae2||0xcc;return function(_0x3d0b04){if(_0x3d0b04){return _0x4a4f01[_0x5e01('0x15')](_0x560ae2);}return _0x4a4f01[_0x5e01('0x16')](_0x560ae2)[_0x5e01('0x17')]();};}function respondWithResult(_0x3ecf64,_0x16bc8f){_0x16bc8f=_0x16bc8f||0xc8;return function(_0x4bd426){if(_0x4bd426){return _0x3ecf64[_0x5e01('0x16')](_0x16bc8f)['json'](_0x4bd426);}};}function respondWithFilteredResult(_0x4ab9b2,_0x1df2e0){return function(_0x2dd70c){if(_0x2dd70c){var _0x494b8a=_0x2dd70c['count'],_0x27c6e7=_0x1df2e0[_0x5e01('0x18')],_0x5a532d=_0x1df2e0['offset']+_0x1df2e0[_0x5e01('0x19')],_0x4fb33e;if(_0x5a532d>=_0x494b8a){_0x5a532d=_0x494b8a;_0x4fb33e=0xc8;}else{_0x4fb33e=0xce;}_0x4ab9b2['status'](_0x4fb33e);return _0x4ab9b2['set'](_0x5e01('0x1a'),_0x27c6e7+'-'+_0x5a532d+'/'+_0x494b8a)[_0x5e01('0x1b')](_0x2dd70c);}return null;};}function patchUpdates(_0x4fa1c7){return function(_0xce3f3f){try{jsonpatch[_0x5e01('0x1c')](_0xce3f3f,_0x4fa1c7,!![]);}catch(_0x36b4a7){return BPromise[_0x5e01('0x1d')](_0x36b4a7);}return _0xce3f3f[_0x5e01('0x1e')]();};}function saveUpdates(_0x35eb4e,_0x173410){return function(_0x153eb1){if(_0x153eb1){return _0x153eb1['update'](_0x35eb4e)[_0x5e01('0x1f')](function(_0x208586){return _0x208586;});}return null;};}function removeEntity(_0x4b28ca,_0xf6fe3f){return function(_0x306cff){if(_0x306cff){return _0x306cff[_0x5e01('0x20')]()[_0x5e01('0x1f')](function(){_0x4b28ca[_0x5e01('0x16')](0xcc)[_0x5e01('0x17')]();});}};}function handleEntityNotFound(_0x5efff9,_0x329315){return function(_0x720922){if(!_0x720922){_0x5efff9[_0x5e01('0x15')](0x194);}return _0x720922;};}function handleError(_0x52ccd0,_0x514ade){_0x514ade=_0x514ade||0x1f4;return function(_0x557f06){logger[_0x5e01('0x21')](_0x557f06[_0x5e01('0x22')]);if(_0x557f06['name']){delete _0x557f06[_0x5e01('0x23')];}_0x52ccd0[_0x5e01('0x16')](_0x514ade)[_0x5e01('0x24')](_0x557f06);};}exports[_0x5e01('0x25')]=function(_0x58dc6f,_0x4d0ebe){var _0xca92be={},_0x5f01dd={},_0x14b9f5={'count':0x0,'rows':[]};var _0x1332bb=_[_0x5e01('0x26')](db[_0x5e01('0x27')]['rawAttributes'],function(_0x531f0a){return{'name':_0x531f0a['fieldName'],'type':_0x531f0a['type'][_0x5e01('0x28')]};});_0x5f01dd['model']=_[_0x5e01('0x26')](_0x1332bb,_0x5e01('0x23'));_0x5f01dd[_0x5e01('0x29')]=_['keys'](_0x58dc6f[_0x5e01('0x29')]);_0x5f01dd[_0x5e01('0x2a')]=_[_0x5e01('0x2b')](_0x5f01dd[_0x5e01('0x2c')],_0x5f01dd['query']);_0xca92be['attributes']=_[_0x5e01('0x2b')](_0x5f01dd[_0x5e01('0x2c')],qs[_0x5e01('0x2d')](_0x58dc6f[_0x5e01('0x29')][_0x5e01('0x2d')]));_0xca92be[_0x5e01('0x2e')]=_0xca92be[_0x5e01('0x2e')][_0x5e01('0x2f')]?_0xca92be[_0x5e01('0x2e')]:_0x5f01dd[_0x5e01('0x2c')];if(!_0x58dc6f[_0x5e01('0x29')][_0x5e01('0x30')]('nolimit')){_0xca92be[_0x5e01('0x19')]=qs[_0x5e01('0x19')](_0x58dc6f[_0x5e01('0x29')]['limit']);_0xca92be[_0x5e01('0x18')]=qs[_0x5e01('0x18')](_0x58dc6f['query'][_0x5e01('0x18')]);}_0xca92be[_0x5e01('0x31')]=qs[_0x5e01('0x32')](_0x58dc6f['query'][_0x5e01('0x32')]);_0xca92be[_0x5e01('0x33')]=qs[_0x5e01('0x2a')](_[_0x5e01('0x34')](_0x58dc6f[_0x5e01('0x29')],_0x5f01dd[_0x5e01('0x2a')]),_0x1332bb);if(_0x58dc6f[_0x5e01('0x29')][_0x5e01('0x35')]){_0xca92be[_0x5e01('0x33')]=_[_0x5e01('0x36')](_0xca92be[_0x5e01('0x33')],{'$or':_[_0x5e01('0x26')](_0x1332bb,function(_0x20f3c6){if(_0x20f3c6[_0x5e01('0x37')]!==_0x5e01('0x38')){var _0x578d61={};_0x578d61[_0x20f3c6[_0x5e01('0x23')]]={'$like':'%'+_0x58dc6f['query']['filter']+'%'};return _0x578d61;}})});}_0xca92be=_[_0x5e01('0x36')]({},_0xca92be,_0x58dc6f[_0x5e01('0x39')]);var _0x120b7b={'where':_0xca92be[_0x5e01('0x33')]};return db[_0x5e01('0x27')]['count'](_0x120b7b)[_0x5e01('0x1f')](function(_0x1770e5){_0x14b9f5['count']=_0x1770e5;if(_0x58dc6f[_0x5e01('0x29')][_0x5e01('0x3a')]){_0xca92be[_0x5e01('0x3b')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x5e01('0x3c')](_0xca92be);})[_0x5e01('0x1f')](function(_0x503c8c){_0x14b9f5[_0x5e01('0x3d')]=_0x503c8c;return _0x14b9f5;})[_0x5e01('0x1f')](respondWithFilteredResult(_0x4d0ebe,_0xca92be))['catch'](handleError(_0x4d0ebe,null));};exports['show']=function(_0xce5f1b,_0x4fe865){var _0x2d7423={'raw':!![],'where':{'id':_0xce5f1b[_0x5e01('0x3e')]['id']}},_0x1b1d35={};_0x1b1d35[_0x5e01('0x2c')]=_['keys'](db[_0x5e01('0x27')][_0x5e01('0x3f')]);_0x1b1d35[_0x5e01('0x29')]=_[_0x5e01('0x40')](_0xce5f1b[_0x5e01('0x29')]);_0x1b1d35[_0x5e01('0x2a')]=_[_0x5e01('0x2b')](_0x1b1d35['model'],_0x1b1d35[_0x5e01('0x29')]);_0x2d7423[_0x5e01('0x2e')]=_[_0x5e01('0x2b')](_0x1b1d35[_0x5e01('0x2c')],qs[_0x5e01('0x2d')](_0xce5f1b['query'][_0x5e01('0x2d')]));_0x2d7423[_0x5e01('0x2e')]=_0x2d7423[_0x5e01('0x2e')][_0x5e01('0x2f')]?_0x2d7423[_0x5e01('0x2e')]:_0x1b1d35[_0x5e01('0x2c')];if(_0xce5f1b[_0x5e01('0x29')]['includeAll']){_0x2d7423[_0x5e01('0x3b')]=[{'all':!![]}];}_0x2d7423=_['merge']({},_0x2d7423,_0xce5f1b[_0x5e01('0x39')]);return db[_0x5e01('0x27')][_0x5e01('0x41')](_0x2d7423)[_0x5e01('0x1f')](handleEntityNotFound(_0x4fe865,null))[_0x5e01('0x1f')](respondWithResult(_0x4fe865,null))[_0x5e01('0x42')](handleError(_0x4fe865,null));};exports['create']=function(_0x24541a,_0x4a5f37){return db[_0x5e01('0x27')][_0x5e01('0x43')](_0x24541a[_0x5e01('0x44')],{})[_0x5e01('0x1f')](respondWithResult(_0x4a5f37,0xc9))[_0x5e01('0x42')](handleError(_0x4a5f37,null));};exports[_0x5e01('0x45')]=function(_0x555204,_0x5cf1e4){if(_0x555204[_0x5e01('0x44')]['id']){delete _0x555204[_0x5e01('0x44')]['id'];}return db[_0x5e01('0x27')][_0x5e01('0x41')]({'where':{'id':_0x555204[_0x5e01('0x3e')]['id']}})[_0x5e01('0x1f')](handleEntityNotFound(_0x5cf1e4,null))[_0x5e01('0x1f')](saveUpdates(_0x555204[_0x5e01('0x44')],null))[_0x5e01('0x1f')](respondWithResult(_0x5cf1e4,null))[_0x5e01('0x42')](handleError(_0x5cf1e4,null));};exports[_0x5e01('0x20')]=function(_0x5cd7ec,_0x470cec){return db[_0x5e01('0x27')][_0x5e01('0x41')]({'where':{'id':_0x5cd7ec['params']['id']}})[_0x5e01('0x1f')](handleEntityNotFound(_0x470cec,null))[_0x5e01('0x1f')](removeEntity(_0x470cec,null))[_0x5e01('0x42')](handleError(_0x470cec,null));};exports[_0x5e01('0x46')]=function(_0x3bb6a8,_0x538a39){return db[_0x5e01('0x27')]['describe']()[_0x5e01('0x1f')](respondWithResult(_0x538a39,null))[_0x5e01('0x42')](handleError(_0x538a39,null));};
\ No newline at end of file
+var _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','ChatOfflineMessage','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x20d4e7,_0x5f29f7){var _0x125131=function(_0x10dc57){while(--_0x10dc57){_0x20d4e7['push'](_0x20d4e7['shift']());}};_0x125131(++_0x5f29f7);}(_0x814b,0x1a2));var _0xb814=function(_0x9adcd6,_0x36278b){_0x9adcd6=_0x9adcd6-0x0;var _0xdf8ff2=_0x814b[_0x9adcd6];return _0xdf8ff2;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['ChatOfflineMessage'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['ChatOfflineMessage'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['ChatOfflineMessage'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));};
\ No newline at end of file
index ed89735..4a617ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9a19,0x114));var _0x99a1=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x9a19[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x99a1('0xc')});};
\ No newline at end of file
+var _0x3667=['request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x1ca7d5,_0x230f31){var _0x3292ac=function(_0x48a403){while(--_0x48a403){_0x1ca7d5['push'](_0x1ca7d5['shift']());}};_0x3292ac(++_0x230f31);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var moment=require(_0x7366('0x4'));var BPromise=require('bluebird');var rp=require(_0x7366('0x5'));var fs=require('fs');var path=require(_0x7366('0x6'));var rimraf=require('rimraf');var config=require(_0x7366('0x7'));var attributes=require(_0x7366('0x8'));module[_0x7366('0x9')]=function(_0x1c0cf4,_0x101e3d){return _0x1c0cf4['define'](_0x7366('0xa'),attributes,{'tableName':_0x7366('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7366('0xc'),'collate':_0x7366('0xd')});};
\ No newline at end of file
index b324110..51e593f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c29=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c29,0x11b));var _0x91c2=function(_0x5e9417,_0x3291ef){_0x5e9417=_0x5e9417-0x0;var _0x1070ae=_0x1c29[_0x5e9417];return _0x1070ae;};'use strict';var _=require(_0x91c2('0x0'));var util=require('util');var moment=require(_0x91c2('0x1'));var BPromise=require(_0x91c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91c2('0x3'));var db=require(_0x91c2('0x4'))['db'];var utils=require(_0x91c2('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x91c2('0x6')][_0x91c2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28c884,_0x466967,_0x20d6d1){return new BPromise(function(_0x2cc512,_0x3b34c5){return client[_0x91c2('0x8')](_0x28c884,_0x20d6d1)[_0x91c2('0x9')](function(_0x8456c0){logger[_0x91c2('0xa')](_0x91c2('0xb'),_0x466967,_0x91c2('0xc'));logger[_0x91c2('0xd')](_0x91c2('0xe'),_0x466967,'request\x20sent',JSON[_0x91c2('0xf')](_0x8456c0));if(_0x8456c0[_0x91c2('0x10')]){if(_0x8456c0[_0x91c2('0x10')]['code']===0x1f4){logger[_0x91c2('0x10')](_0x91c2('0xb'),_0x466967,_0x8456c0[_0x91c2('0x10')][_0x91c2('0x11')]);return _0x3b34c5(_0x8456c0[_0x91c2('0x10')][_0x91c2('0x11')]);}logger['error'](_0x91c2('0xb'),_0x466967,_0x8456c0['error'][_0x91c2('0x11')]);return _0x2cc512(_0x8456c0['error'][_0x91c2('0x11')]);}else{logger[_0x91c2('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x466967,_0x91c2('0xc'));_0x2cc512(_0x8456c0[_0x91c2('0x12')][_0x91c2('0x11')]);}})[_0x91c2('0x13')](function(_0x575b80){logger[_0x91c2('0x10')](_0x91c2('0xb'),_0x466967,_0x575b80);_0x3b34c5(_0x575b80);});});}
\ No newline at end of file
+var _0xcbd8=['moment','randomstring','../../mysqldb','../../config/logger','rpc','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0xcbd8,0xd6));var _0x8cbd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcbd8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8cbd('0x0'));var util=require(_0x8cbd('0x1'));var moment=require(_0x8cbd('0x2'));var BPromise=require('bluebird');var rs=require(_0x8cbd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cbd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8cbd('0x5'))(_0x8cbd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8cbd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ce5c1,_0x4e219d,_0x3e0e6f){return new BPromise(function(_0x2c4066,_0x403a4d){return client['request'](_0x2ce5c1,_0x3e0e6f)['then'](function(_0x2a0a47){logger[_0x8cbd('0x8')](_0x8cbd('0x9'),_0x4e219d,_0x8cbd('0xa'));logger['debug'](_0x8cbd('0xb'),_0x4e219d,_0x8cbd('0xa'),JSON[_0x8cbd('0xc')](_0x2a0a47));if(_0x2a0a47[_0x8cbd('0xd')]){if(_0x2a0a47[_0x8cbd('0xd')][_0x8cbd('0xe')]===0x1f4){logger[_0x8cbd('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4e219d,_0x2a0a47['error'][_0x8cbd('0xf')]);return _0x403a4d(_0x2a0a47[_0x8cbd('0xd')][_0x8cbd('0xf')]);}logger[_0x8cbd('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4e219d,_0x2a0a47[_0x8cbd('0xd')][_0x8cbd('0xf')]);return _0x2c4066(_0x2a0a47[_0x8cbd('0xd')]['message']);}else{logger[_0x8cbd('0x8')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4e219d,_0x8cbd('0xa'));_0x2c4066(_0x2a0a47[_0x8cbd('0x10')]['message']);}})[_0x8cbd('0x11')](function(_0x239f63){logger[_0x8cbd('0xd')](_0x8cbd('0x9'),_0x4e219d,_0x239f63);_0x403a4d(_0x239f63);});});}
\ No newline at end of file
index 8d7ee8c..6f056ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d48=['multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','create','put','update','destroy'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x4d48,0x1e0));var _0x84d4=function(_0x36e8e4,_0x213a61){_0x36e8e4=_0x36e8e4-0x0;var _0x491ac7=_0x4d48[_0x36e8e4];return _0x491ac7;};'use strict';var multer=require(_0x84d4('0x0'));var util=require(_0x84d4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x84d4('0x2'));var router=express['Router']();var auth=require(_0x84d4('0x3'));var interaction=require(_0x84d4('0x4'));var config=require(_0x84d4('0x5'));var controller=require(_0x84d4('0x6'));router[_0x84d4('0x7')]('/',auth[_0x84d4('0x8')](),controller[_0x84d4('0x9')]);router['get'](_0x84d4('0xa'),auth[_0x84d4('0x8')](),controller['describe']);router[_0x84d4('0x7')](_0x84d4('0xb'),auth[_0x84d4('0x8')](),controller['show']);router['post']('/',auth[_0x84d4('0x8')](),controller[_0x84d4('0xc')]);router[_0x84d4('0xd')](_0x84d4('0xb'),auth[_0x84d4('0x8')](),controller[_0x84d4('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x84d4('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xf7ba=['Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x358d30,_0x1600cd){var _0x28902d=function(_0x37f21a){while(--_0x37f21a){_0x358d30['push'](_0x358d30['shift']());}};_0x28902d(++_0x1600cd);}(_0xf7ba,0x1ea));var _0xaf7b=function(_0x4e726b,_0x4e540b){_0x4e726b=_0x4e726b-0x0;var _0x220f25=_0xf7ba[_0x4e726b];return _0x220f25;};'use strict';var multer=require(_0xaf7b('0x0'));var util=require(_0xaf7b('0x1'));var path=require(_0xaf7b('0x2'));var timeout=require(_0xaf7b('0x3'));var express=require('express');var router=express[_0xaf7b('0x4')]();var auth=require(_0xaf7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf7b('0x6'));var controller=require(_0xaf7b('0x7'));router[_0xaf7b('0x8')]('/',auth['isAuthenticated'](),controller[_0xaf7b('0x9')]);router[_0xaf7b('0x8')](_0xaf7b('0xa'),auth['isAuthenticated'](),controller[_0xaf7b('0xb')]);router[_0xaf7b('0x8')](_0xaf7b('0xc'),auth[_0xaf7b('0xd')](),controller['show']);router['post']('/',auth[_0xaf7b('0xd')](),controller[_0xaf7b('0xe')]);router['put'](_0xaf7b('0xc'),auth[_0xaf7b('0xd')](),controller[_0xaf7b('0xf')]);router[_0xaf7b('0x10')]('/:id',auth[_0xaf7b('0xd')](),controller[_0xaf7b('0x11')]);module[_0xaf7b('0x12')]=router;
\ No newline at end of file
index 034f322..d3e43a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbfa=['exports','STRING','ENUM','mouseOver','INTEGER','sequelize'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xcbfa,0xb9));var _0xacbf=function(_0x277d61,_0xab8c96){_0x277d61=_0x277d61-0x0;var _0x34f6e1=_0xcbfa[_0x277d61];return _0x34f6e1;};'use strict';var Sequelize=require(_0xacbf('0x0'));module[_0xacbf('0x1')]={'name':{'type':Sequelize[_0xacbf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xacbf('0x3')](_0xacbf('0x4'),'timeout'),'defaultValue':_0xacbf('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xacbf('0x5')]}};
\ No newline at end of file
+var _0x00fa=['mouseOver','timeout','INTEGER','exports','STRING'];(function(_0x40df32,_0x42da36){var _0xb94718=function(_0x3d7f04){while(--_0x3d7f04){_0x40df32['push'](_0x40df32['shift']());}};_0xb94718(++_0x42da36);}(_0x00fa,0xd5));var _0xa00f=function(_0xff3f4a,_0x50f3b4){_0xff3f4a=_0xff3f4a-0x0;var _0x13db8a=_0x00fa[_0xff3f4a];return _0x13db8a;};'use strict';var Sequelize=require('sequelize');module[_0xa00f('0x0')]={'name':{'type':Sequelize[_0xa00f('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa00f('0x2'),_0xa00f('0x3')),'defaultValue':_0xa00f('0x2')},'selector':{'type':Sequelize[_0xa00f('0x1')]},'timeout':{'type':Sequelize[_0xa00f('0x4')]}};
\ No newline at end of file
index 8b7ba54..c072492 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x1783a0,_0x57c3bb){var _0x2c49ad=function(_0x4e6bf9){while(--_0x4e6bf9){_0x1783a0['push'](_0x1783a0['shift']());}};_0x2c49ad(++_0x57c3bb);}(_0x70e0,0x17b));var _0x070e=function(_0x476a29,_0x267b18){_0x476a29=_0x476a29-0x0;var _0x739fb3=_0x70e0[_0x476a29];return _0x739fb3;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={'raw':!![],'where':{'id':_0x1743cc[_0x070e('0x26')]['id']}},_0x374c54={};_0x374c54[_0x070e('0x27')]=_[_0x070e('0x28')](db[_0x070e('0x29')][_0x070e('0x2a')]);_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x28')](_0x1743cc['query']);_0x374c54[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],_0x374c54['query']);_0x497f58['attributes']=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],qs[_0x070e('0x2e')](_0x1743cc['query'][_0x070e('0x2e')]));_0x497f58[_0x070e('0x2f')]=_0x497f58[_0x070e('0x2f')][_0x070e('0x30')]?_0x497f58['attributes']:_0x374c54['model'];if(_0x1743cc['query']['includeAll']){_0x497f58[_0x070e('0x31')]=[{'all':!![]}];}_0x497f58=_['merge']({},_0x497f58,_0x1743cc[_0x070e('0x32')]);return db[_0x070e('0x29')]['find'](_0x497f58)['then'](handleEntityNotFound(_0x4763c6,null))[_0x070e('0x20')](respondWithResult(_0x4763c6,null))[_0x070e('0x33')](handleError(_0x4763c6,null));};exports['create']=function(_0x546a16,_0x41ade4){return db[_0x070e('0x29')][_0x070e('0x34')](_0x546a16[_0x070e('0x35')],{})[_0x070e('0x20')](respondWithResult(_0x41ade4,0xc9))['catch'](handleError(_0x41ade4,null));};exports['update']=function(_0x24d17d,_0x3011c4){if(_0x24d17d[_0x070e('0x35')]['id']){delete _0x24d17d[_0x070e('0x35')]['id'];}return db[_0x070e('0x29')]['find']({'where':{'id':_0x24d17d[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3011c4,null))['then'](saveUpdates(_0x24d17d[_0x070e('0x35')],null))[_0x070e('0x20')](respondWithResult(_0x3011c4,null))['catch'](handleError(_0x3011c4,null));};exports['destroy']=function(_0x5ddbe9,_0x363bff){return db[_0x070e('0x29')][_0x070e('0x36')]({'where':{'id':_0x5ddbe9[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x363bff,null))['then'](removeEntity(_0x363bff,null))[_0x070e('0x33')](handleError(_0x363bff,null));};
\ No newline at end of file
+var _0x9c44=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','catch','create','ChatProactiveAction','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs'];(function(_0x34311c,_0x52a317){var _0x4b8b35=function(_0x16888a){while(--_0x16888a){_0x34311c['push'](_0x34311c['shift']());}};_0x4b8b35(++_0x52a317);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){_0x2197d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2263ae,_0x15581b){return function(_0x26c640){if(!_0x26c640){_0x2263ae[_0x49c4('0x14')](0x194);}return _0x26c640;};}function handleError(_0x4811c4,_0x5850f2){_0x5850f2=_0x5850f2||0x1f4;return function(_0x180276){logger[_0x49c4('0x21')](_0x180276['stack']);if(_0x180276[_0x49c4('0x22')]){delete _0x180276[_0x49c4('0x22')];}_0x4811c4[_0x49c4('0x16')](_0x5850f2)[_0x49c4('0x23')](_0x180276);};}exports['show']=function(_0x543ea2,_0x449960){var _0x53c199={'raw':!![],'where':{'id':_0x543ea2[_0x49c4('0x24')]['id']}},_0x3800b7={};_0x3800b7[_0x49c4('0x25')]=_[_0x49c4('0x26')](db['ChatProactiveAction'][_0x49c4('0x27')]);_0x3800b7[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x543ea2[_0x49c4('0x28')]);_0x3800b7[_0x49c4('0x29')]=_[_0x49c4('0x2a')](_0x3800b7[_0x49c4('0x25')],_0x3800b7[_0x49c4('0x28')]);_0x53c199[_0x49c4('0x2b')]=_[_0x49c4('0x2a')](_0x3800b7[_0x49c4('0x25')],qs['fields'](_0x543ea2['query']['fields']));_0x53c199[_0x49c4('0x2b')]=_0x53c199[_0x49c4('0x2b')][_0x49c4('0x2c')]?_0x53c199[_0x49c4('0x2b')]:_0x3800b7[_0x49c4('0x25')];if(_0x543ea2['query'][_0x49c4('0x2d')]){_0x53c199[_0x49c4('0x2e')]=[{'all':!![]}];}_0x53c199=_[_0x49c4('0x2f')]({},_0x53c199,_0x543ea2[_0x49c4('0x30')]);return db['ChatProactiveAction']['find'](_0x53c199)[_0x49c4('0x20')](handleEntityNotFound(_0x449960,null))[_0x49c4('0x20')](respondWithResult(_0x449960,null))[_0x49c4('0x31')](handleError(_0x449960,null));};exports[_0x49c4('0x32')]=function(_0xd38540,_0x4a0c7a){return db[_0x49c4('0x33')][_0x49c4('0x32')](_0xd38540[_0x49c4('0x34')],{})['then'](respondWithResult(_0x4a0c7a,0xc9))['catch'](handleError(_0x4a0c7a,null));};exports[_0x49c4('0x1f')]=function(_0x1991e9,_0x3bec0a){if(_0x1991e9[_0x49c4('0x34')]['id']){delete _0x1991e9[_0x49c4('0x34')]['id'];}return db[_0x49c4('0x33')][_0x49c4('0x35')]({'where':{'id':_0x1991e9[_0x49c4('0x24')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x3bec0a,null))['then'](saveUpdates(_0x1991e9[_0x49c4('0x34')],null))['then'](respondWithResult(_0x3bec0a,null))[_0x49c4('0x31')](handleError(_0x3bec0a,null));};exports[_0x49c4('0x36')]=function(_0x2625a6,_0x1c2830){return db['ChatProactiveAction'][_0x49c4('0x35')]({'where':{'id':_0x2625a6[_0x49c4('0x24')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x1c2830,null))['then'](removeEntity(_0x1c2830,null))[_0x49c4('0x31')](handleError(_0x1c2830,null));};
\ No newline at end of file
index 314a4b9..a7b895d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e31=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x55baa2,_0x4a43a1){var _0x143bfd=function(_0x2024b2){while(--_0x2024b2){_0x55baa2['push'](_0x55baa2['shift']());}};_0x143bfd(++_0x4a43a1);}(_0x0e31,0x1a6));var _0x10e3=function(_0x5ee0d5,_0x322b07){_0x5ee0d5=_0x5ee0d5-0x0;var _0x1fb343=_0x0e31[_0x5ee0d5];return _0x1fb343;};'use strict';var _=require(_0x10e3('0x0'));var util=require(_0x10e3('0x1'));var logger=require(_0x10e3('0x2'))(_0x10e3('0x3'));var moment=require(_0x10e3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10e3('0x5'));var rimraf=require('rimraf');var config=require(_0x10e3('0x6'));var attributes=require(_0x10e3('0x7'));module['exports']=function(_0x1dcfe2,_0x3bb881){return _0x1dcfe2[_0x10e3('0x8')](_0x10e3('0x9'),attributes,{'tableName':_0x10e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd39e=['define','chat_proactive_actions','lodash','util','moment','bluebird','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd39e,0x110));var _0xed39=function(_0x349b5c,_0x55e5fa){_0x349b5c=_0x349b5c-0x0;var _0x3efcac=_0xd39e[_0x349b5c];return _0x3efcac;};'use strict';var _=require(_0xed39('0x0'));var util=require(_0xed39('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xed39('0x2'));var BPromise=require(_0xed39('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xed39('0x4'));var config=require('../../config/environment');var attributes=require(_0xed39('0x5'));module[_0xed39('0x6')]=function(_0x18cc48,_0x431ed1){return _0x18cc48[_0xed39('0x7')]('ChatProactiveAction',attributes,{'tableName':_0xed39('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5cb957b..d50c276 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67fe=['info','request\x20sent','result','lodash','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x67fe,0x1df));var _0xe67f=function(_0x27e927,_0x1bc4bd){_0x27e927=_0x27e927-0x0;var _0x1a349f=_0x67fe[_0x27e927];return _0x1a349f;};'use strict';var _=require(_0xe67f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe67f('0x1'));var fs=require('fs');var Redis=require(_0xe67f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe67f('0x3'));var logger=require(_0xe67f('0x4'))('rpc');var config=require(_0xe67f('0x5'));var jayson=require(_0xe67f('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11366d,_0x30d9a2,_0x54139c){return new BPromise(function(_0x5bf3d5,_0x40cfee){return client['request'](_0x11366d,_0x54139c)[_0xe67f('0x7')](function(_0x455605){logger['info'](_0xe67f('0x8'),_0x30d9a2,'request\x20sent');logger[_0xe67f('0x9')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x30d9a2,'request\x20sent',JSON[_0xe67f('0xa')](_0x455605));if(_0x455605[_0xe67f('0xb')]){if(_0x455605['error'][_0xe67f('0xc')]===0x1f4){logger['error'](_0xe67f('0x8'),_0x30d9a2,_0x455605[_0xe67f('0xb')][_0xe67f('0xd')]);return _0x40cfee(_0x455605['error'][_0xe67f('0xd')]);}logger['error'](_0xe67f('0x8'),_0x30d9a2,_0x455605[_0xe67f('0xb')][_0xe67f('0xd')]);return _0x5bf3d5(_0x455605[_0xe67f('0xb')]['message']);}else{logger[_0xe67f('0xe')](_0xe67f('0x8'),_0x30d9a2,_0xe67f('0xf'));_0x5bf3d5(_0x455605[_0xe67f('0x10')][_0xe67f('0xd')]);}})['catch'](function(_0x448367){logger[_0xe67f('0xb')](_0xe67f('0x8'),_0x30d9a2,_0x448367);_0x40cfee(_0x448367);});});}
\ No newline at end of file
+var _0x7953=['then','info','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x56431a,_0x52cc35){var _0x592aaf=function(_0x56e36a){while(--_0x56e36a){_0x56431a['push'](_0x56431a['shift']());}};_0x592aaf(++_0x52cc35);}(_0x7953,0x195));var _0x3795=function(_0x469665,_0x394876){_0x469665=_0x469665-0x0;var _0x291ab5=_0x7953[_0x469665];return _0x291ab5;};'use strict';var _=require(_0x3795('0x0'));var util=require(_0x3795('0x1'));var moment=require(_0x3795('0x2'));var BPromise=require(_0x3795('0x3'));var rs=require(_0x3795('0x4'));var fs=require('fs');var Redis=require(_0x3795('0x5'));var db=require(_0x3795('0x6'))['db'];var utils=require(_0x3795('0x7'));var logger=require(_0x3795('0x8'))(_0x3795('0x9'));var config=require(_0x3795('0xa'));var jayson=require(_0x3795('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x362771,_0x3846a6,_0x2100df){return new BPromise(function(_0x42f208,_0x16b483){return client[_0x3795('0xc')](_0x362771,_0x2100df)[_0x3795('0xd')](function(_0x33824d){logger[_0x3795('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x3846a6,'request\x20sent');logger['debug'](_0x3795('0xf'),_0x3846a6,_0x3795('0x10'),JSON['stringify'](_0x33824d));if(_0x33824d[_0x3795('0x11')]){if(_0x33824d[_0x3795('0x11')]['code']===0x1f4){logger['error'](_0x3795('0x12'),_0x3846a6,_0x33824d['error'][_0x3795('0x13')]);return _0x16b483(_0x33824d['error']['message']);}logger['error'](_0x3795('0x12'),_0x3846a6,_0x33824d[_0x3795('0x11')][_0x3795('0x13')]);return _0x42f208(_0x33824d[_0x3795('0x11')][_0x3795('0x13')]);}else{logger[_0x3795('0xe')](_0x3795('0x12'),_0x3846a6,'request\x20sent');_0x42f208(_0x33824d[_0x3795('0x14')][_0x3795('0x13')]);}})[_0x3795('0x15')](function(_0x4c5038){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3846a6,_0x4c5038);_0x16b483(_0x4c5038);});});}
\ No newline at end of file
index 4d15d19..f3a8bc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x685b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','update','exports','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x685b,0x8d));var _0xb685=function(_0x505abd,_0x32d6ea){_0x505abd=_0x505abd-0x0;var _0x25b4de=_0x685b[_0x505abd];return _0x25b4de;};'use strict';var multer=require('multer');var util=require(_0xb685('0x0'));var path=require(_0xb685('0x1'));var timeout=require(_0xb685('0x2'));var express=require(_0xb685('0x3'));var router=express[_0xb685('0x4')]();var auth=require(_0xb685('0x5'));var interaction=require(_0xb685('0x6'));var config=require(_0xb685('0x7'));var controller=require(_0xb685('0x8'));router[_0xb685('0x9')](_0xb685('0xa'),auth['isAuthenticated'](),controller[_0xb685('0xb')]);router[_0xb685('0xc')]('/',auth[_0xb685('0xd')](),controller['create']);router['put']('/:id',auth[_0xb685('0xd')](),controller[_0xb685('0xe')]);router['delete'](_0xb685('0xa'),auth[_0xb685('0xd')](),controller['destroy']);module[_0xb685('0xf')]=router;
\ No newline at end of file
+var _0xb6c8=['multer','path','connect-timeout','express','Router','../../components/auth/service','get','/:id','isAuthenticated','show','post','create','put','update','destroy','exports'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xb6c8,0x180));var _0x8b6c=function(_0x325fa4,_0x1dcf06){_0x325fa4=_0x325fa4-0x0;var _0x5e20a2=_0xb6c8[_0x325fa4];return _0x5e20a2;};'use strict';var multer=require(_0x8b6c('0x0'));var util=require('util');var path=require(_0x8b6c('0x1'));var timeout=require(_0x8b6c('0x2'));var express=require(_0x8b6c('0x3'));var router=express[_0x8b6c('0x4')]();var auth=require(_0x8b6c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x8b6c('0x6')](_0x8b6c('0x7'),auth[_0x8b6c('0x8')](),controller[_0x8b6c('0x9')]);router[_0x8b6c('0xa')]('/',auth[_0x8b6c('0x8')](),controller[_0x8b6c('0xb')]);router[_0x8b6c('0xc')](_0x8b6c('0x7'),auth[_0x8b6c('0x8')](),controller[_0x8b6c('0xd')]);router['delete'](_0x8b6c('0x7'),auth[_0x8b6c('0x8')](),controller[_0x8b6c('0xe')]);module[_0x8b6c('0xf')]=router;
\ No newline at end of file
index 09a552f..4143697 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5015=['exports','name','STRING','ENUM','rrmemory','sequelize'];(function(_0x333663,_0x16d1ef){var _0x36eb4c=function(_0x1a27ab){while(--_0x1a27ab){_0x333663['push'](_0x333663['shift']());}};_0x36eb4c(++_0x16d1ef);}(_0x5015,0x155));var _0x5501=function(_0xfb88ac,_0x2a9325){_0xfb88ac=_0xfb88ac-0x0;var _0x4fbafe=_0x5015[_0xfb88ac];return _0x4fbafe;};'use strict';var Sequelize=require(_0x5501('0x0'));module[_0x5501('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5501('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5501('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5501('0x4')](_0x5501('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0xc1a7=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0xc1a7,0x1a6));var _0x7c1a=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0xc1a7[_0x4b5813];return _0x423465;};'use strict';var Sequelize=require(_0x7c1a('0x0'));module[_0x7c1a('0x1')]={'name':{'type':Sequelize[_0x7c1a('0x2')],'unique':_0x7c1a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7c1a('0x2')]},'timeout':{'type':Sequelize[_0x7c1a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c1a('0x5')](_0x7c1a('0x6'),_0x7c1a('0x7'),_0x7c1a('0x8'))}};
\ No newline at end of file
index d5aa1c0..87da111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5ee=['length','sort','where','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserChatQueue','hasOwnProperty','nolimit','order','pick','ChatQueueId','findAndCountAll','UserId','agent','chatPause','createdAt','rows','format','%s/%s','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','findOrCreate','forEach','emit','userChatQueue:save','User','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','union','compact','value','removeTeams','isEmpty','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatQueue.socket','register','jayson/promise','http','test','request','info','request\x20sent','debug','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','update','then','get','ChatQueues','UserProfileResource','destroy','stack','send','map','ChatQueue','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes'];(function(_0x962edb,_0x5dd356){var _0x359dcf=function(_0x978f40){while(--_0x978f40){_0x962edb['push'](_0x962edb['shift']());}};_0x359dcf(++_0x5dd356);}(_0xb5ee,0xe4));var _0xeb5e=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0xb5ee[_0xc14df7];return _0x34a445;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xeb5e('0x0'));var zipdir=require(_0xeb5e('0x1'));var jsonpatch=require(_0xeb5e('0x2'));var rp=require(_0xeb5e('0x3'));var moment=require(_0xeb5e('0x4'));var BPromise=require(_0xeb5e('0x5'));var Mustache=require(_0xeb5e('0x6'));var util=require('util');var path=require(_0xeb5e('0x7'));var sox=require('sox');var csv=require(_0xeb5e('0x8'));var ejs=require(_0xeb5e('0x9'));var fs=require('fs');var _=require(_0xeb5e('0xa'));var squel=require(_0xeb5e('0xb'));var crypto=require(_0xeb5e('0xc'));var jsforce=require(_0xeb5e('0xd'));var deskjs=require(_0xeb5e('0xe'));var toCsv=require(_0xeb5e('0x8'));var querystring=require(_0xeb5e('0xf'));var Papa=require(_0xeb5e('0x10'));var Redis=require('ioredis');var authService=require(_0xeb5e('0x11'));var qs=require(_0xeb5e('0x12'));var as=require(_0xeb5e('0x13'));var hardwareService=require(_0xeb5e('0x14'));var logger=require(_0xeb5e('0x15'))(_0xeb5e('0x16'));var utils=require(_0xeb5e('0x17'));var config=require(_0xeb5e('0x18'));var db=require(_0xeb5e('0x19'))['db'];config[_0xeb5e('0x1a')]=_[_0xeb5e('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb5e('0x1a')]));require(_0xeb5e('0x1c'))[_0xeb5e('0x1d')](socket);var jayson=require(_0xeb5e('0x1e'));var client=jayson['client'][_0xeb5e('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x4b68a6,_0x52cc8b,_0x20d19b){if(_0x20d19b){var _0x20044d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20044d[_0xeb5e('0x20')](_0x52cc8b)){return _0x4b68a6;}else{throw new db['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~!@#$%^&-_=+[{]}.');}}else{return _0x4b68a6;}}function respondWithRpcPromise(_0x5b5119,_0x2f6140,_0x2e90ad,_0x5b51a8){return new BPromise(function(_0x3525a8,_0x444483){var _0x446473=_0x5b51a8||client;return _0x446473[_0xeb5e('0x21')](_0x5b5119,_0x2e90ad)['then'](function(_0x3adc2d){logger[_0xeb5e('0x22')]('ChatQueue,\x20%s,\x20%s',_0x2f6140,_0xeb5e('0x23'));logger[_0xeb5e('0x24')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2f6140,_0xeb5e('0x23'),JSON[_0xeb5e('0x25')](_0x3adc2d));if(_0x3adc2d[_0xeb5e('0x26')]){if(_0x3adc2d[_0xeb5e('0x26')]['code']===0x1f4){logger[_0xeb5e('0x26')](_0xeb5e('0x27'),_0x2f6140,_0x3adc2d[_0xeb5e('0x26')][_0xeb5e('0x28')]);return _0x444483(_0x3adc2d['error'][_0xeb5e('0x28')]);}logger[_0xeb5e('0x26')](_0xeb5e('0x27'),_0x2f6140,_0x3adc2d[_0xeb5e('0x26')]['message']);return _0x3525a8(_0x3adc2d['error']['message']);}else{logger[_0xeb5e('0x22')]('ChatQueue,\x20%s,\x20%s',_0x2f6140,_0xeb5e('0x23'));_0x3525a8(_0x3adc2d[_0xeb5e('0x29')][_0xeb5e('0x28')]);}})[_0xeb5e('0x2a')](function(_0x4e7b40){logger[_0xeb5e('0x26')](_0xeb5e('0x27'),_0x2f6140,_0x4e7b40);_0x444483(_0x4e7b40);});});}function respondWithStatusCode(_0x2bb4cc,_0x8b8a20){_0x8b8a20=_0x8b8a20||0xcc;return function(_0x502ba7){if(_0x502ba7){return _0x2bb4cc[_0xeb5e('0x2b')](_0x8b8a20);}return _0x2bb4cc['status'](_0x8b8a20)[_0xeb5e('0x2c')]();};}function respondWithResult(_0xc634c7,_0x3fcac5){_0x3fcac5=_0x3fcac5||0xc8;return function(_0x1d67a7){if(_0x1d67a7){return _0xc634c7[_0xeb5e('0x2d')](_0x3fcac5)[_0xeb5e('0x2e')](_0x1d67a7);}};}function respondWithFilteredResult(_0x3a2082,_0x3d1522){return function(_0xfc011f){if(_0xfc011f){var _0x4b256b=_0xfc011f[_0xeb5e('0x2f')],_0x594948=_0x3d1522[_0xeb5e('0x30')],_0x502138=_0x3d1522[_0xeb5e('0x30')]+_0x3d1522[_0xeb5e('0x31')],_0x105b34;if(_0x502138>=_0x4b256b){_0x502138=_0x4b256b;_0x105b34=0xc8;}else{_0x105b34=0xce;}_0x3a2082['status'](_0x105b34);return _0x3a2082['set'](_0xeb5e('0x32'),_0x594948+'-'+_0x502138+'/'+_0x4b256b)[_0xeb5e('0x2e')](_0xfc011f);}return null;};}function patchUpdates(_0x11dde9){return function(_0x329723){try{jsonpatch['apply'](_0x329723,_0x11dde9,!![]);}catch(_0x3ccc38){return BPromise[_0xeb5e('0x33')](_0x3ccc38);}return _0x329723['save']();};}function saveUpdates(_0x5c43bb,_0x205cf8){return function(_0x5ef9d3){if(_0x5ef9d3){return _0x5ef9d3[_0xeb5e('0x34')](_0x5c43bb)[_0xeb5e('0x35')](function(_0x4f648e){return _0x4f648e;});}return null;};}function removeEntity(_0x5ca8a2,_0x4ac1c9){return function(_0x2cbe4c){if(_0x2cbe4c){return _0x2cbe4c['destroy']()['then'](function(){var _0xcf37c9=_0x2cbe4c[_0xeb5e('0x36')]({'plain':!![]});var _0x23b33f=_0xeb5e('0x37');return db[_0xeb5e('0x38')][_0xeb5e('0x39')]({'where':{'type':_0x23b33f,'resourceId':_0xcf37c9['id']}})['then'](function(){return _0x2cbe4c;});})[_0xeb5e('0x35')](function(){_0x5ca8a2['status'](0xcc)[_0xeb5e('0x2c')]();});}};}function handleEntityNotFound(_0x2e3015,_0x441621){return function(_0x4ec389){if(!_0x4ec389){_0x2e3015[_0xeb5e('0x2b')](0x194);}return _0x4ec389;};}function handleError(_0xac9c1b,_0x30bc4e){_0x30bc4e=_0x30bc4e||0x1f4;return function(_0x3ed940){logger[_0xeb5e('0x26')](_0x3ed940[_0xeb5e('0x3a')]);if(_0x3ed940['name']){delete _0x3ed940['name'];}_0xac9c1b[_0xeb5e('0x2d')](_0x30bc4e)[_0xeb5e('0x3b')](_0x3ed940);};}exports['index']=function(_0x5324b9,_0x123fd4){var _0x5845c2={},_0xe52545={},_0x5c6b49={'count':0x0,'rows':[]};var _0x434598=_[_0xeb5e('0x3c')](db[_0xeb5e('0x3d')]['rawAttributes'],function(_0x534af4){return{'name':_0x534af4[_0xeb5e('0x3e')],'type':_0x534af4[_0xeb5e('0x3f')]['key']};});_0xe52545[_0xeb5e('0x40')]=_[_0xeb5e('0x3c')](_0x434598,_0xeb5e('0x41'));_0xe52545[_0xeb5e('0x42')]=_[_0xeb5e('0x43')](_0x5324b9[_0xeb5e('0x42')]);_0xe52545[_0xeb5e('0x44')]=_[_0xeb5e('0x45')](_0xe52545[_0xeb5e('0x40')],_0xe52545[_0xeb5e('0x42')]);_0x5845c2['attributes']=_[_0xeb5e('0x45')](_0xe52545[_0xeb5e('0x40')],qs[_0xeb5e('0x46')](_0x5324b9[_0xeb5e('0x42')][_0xeb5e('0x46')]));_0x5845c2['attributes']=_0x5845c2[_0xeb5e('0x47')][_0xeb5e('0x48')]?_0x5845c2[_0xeb5e('0x47')]:_0xe52545[_0xeb5e('0x40')];if(!_0x5324b9[_0xeb5e('0x42')]['hasOwnProperty']('nolimit')){_0x5845c2[_0xeb5e('0x31')]=qs[_0xeb5e('0x31')](_0x5324b9[_0xeb5e('0x42')]['limit']);_0x5845c2[_0xeb5e('0x30')]=qs['offset'](_0x5324b9[_0xeb5e('0x42')][_0xeb5e('0x30')]);}_0x5845c2['order']=qs['sort'](_0x5324b9[_0xeb5e('0x42')][_0xeb5e('0x49')]);_0x5845c2[_0xeb5e('0x4a')]=qs[_0xeb5e('0x44')](_['pick'](_0x5324b9[_0xeb5e('0x42')],_0xe52545['filters']),_0x434598);if(_0x5324b9[_0xeb5e('0x42')][_0xeb5e('0x4b')]){_0x5845c2['where']=_[_0xeb5e('0x4c')](_0x5845c2[_0xeb5e('0x4a')],{'$or':_[_0xeb5e('0x3c')](_0x434598,function(_0x1f2524){if(_0x1f2524['type']!=='VIRTUAL'){var _0x472008={};_0x472008[_0x1f2524['name']]={'$like':'%'+_0x5324b9[_0xeb5e('0x42')][_0xeb5e('0x4b')]+'%'};return _0x472008;}})});}_0x5845c2=_['merge']({},_0x5845c2,_0x5324b9[_0xeb5e('0x4d')]);var _0x5948ff={'where':_0x5845c2[_0xeb5e('0x4a')]};return db[_0xeb5e('0x3d')][_0xeb5e('0x2f')](_0x5948ff)['then'](function(_0x1189ab){_0x5c6b49['count']=_0x1189ab;if(_0x5324b9[_0xeb5e('0x42')][_0xeb5e('0x4e')]){_0x5845c2[_0xeb5e('0x4f')]=[{'all':!![]}];}return db[_0xeb5e('0x3d')][_0xeb5e('0x50')](_0x5845c2);})[_0xeb5e('0x35')](function(_0x5739ff){_0x5c6b49['rows']=_0x5739ff;return _0x5c6b49;})[_0xeb5e('0x35')](respondWithFilteredResult(_0x123fd4,_0x5845c2))[_0xeb5e('0x2a')](handleError(_0x123fd4,null));};exports[_0xeb5e('0x51')]=function(_0x181364,_0x2d294b){var _0x4215d4={'raw':!![],'where':{'id':_0x181364[_0xeb5e('0x52')]['id']}},_0x2ca0bb={};_0x2ca0bb['model']=_[_0xeb5e('0x43')](db[_0xeb5e('0x3d')][_0xeb5e('0x53')]);_0x2ca0bb[_0xeb5e('0x42')]=_['keys'](_0x181364[_0xeb5e('0x42')]);_0x2ca0bb[_0xeb5e('0x44')]=_[_0xeb5e('0x45')](_0x2ca0bb['model'],_0x2ca0bb[_0xeb5e('0x42')]);_0x4215d4[_0xeb5e('0x47')]=_[_0xeb5e('0x45')](_0x2ca0bb['model'],qs[_0xeb5e('0x46')](_0x181364['query'][_0xeb5e('0x46')]));_0x4215d4[_0xeb5e('0x47')]=_0x4215d4['attributes'][_0xeb5e('0x48')]?_0x4215d4[_0xeb5e('0x47')]:_0x2ca0bb[_0xeb5e('0x40')];if(_0x181364[_0xeb5e('0x42')][_0xeb5e('0x4e')]){_0x4215d4[_0xeb5e('0x4f')]=[{'all':!![]}];}_0x4215d4=_['merge']({},_0x4215d4,_0x181364['options']);return db[_0xeb5e('0x3d')]['find'](_0x4215d4)[_0xeb5e('0x35')](handleEntityNotFound(_0x2d294b,null))['then'](respondWithResult(_0x2d294b,null))[_0xeb5e('0x2a')](handleError(_0x2d294b,null));};exports[_0xeb5e('0x54')]=function(_0xa1a0c4,_0x2c04b7){return db[_0xeb5e('0x3d')][_0xeb5e('0x54')](_0xa1a0c4['body'],{})['then'](function(_0x19d253){var _0x15fe22=_0xa1a0c4[_0xeb5e('0x55')]['get']({'plain':!![]});if(!_0x15fe22)throw new Error(_0xeb5e('0x56'));if(_0x15fe22[_0xeb5e('0x57')]===_0xeb5e('0x55')){var _0x171888=_0x19d253[_0xeb5e('0x36')]({'plain':!![]});var _0x4f384d='ChatQueues';return db['UserProfileSection'][_0xeb5e('0x58')]({'where':{'name':_0x4f384d,'userProfileId':_0x15fe22['userProfileId']},'raw':!![]})[_0xeb5e('0x35')](function(_0x2814c7){if(_0x2814c7&&_0x2814c7[_0xeb5e('0x59')]===0x0){return db[_0xeb5e('0x38')]['create']({'name':_0x171888['name'],'resourceId':_0x171888['id'],'type':_0x2814c7['name'],'sectionId':_0x2814c7['id']},{})[_0xeb5e('0x35')](function(){return _0x19d253;});}else{return _0x19d253;}})[_0xeb5e('0x2a')](function(_0x282788){logger['error'](_0xeb5e('0x5a'),_0x282788);throw _0x282788;});}return _0x19d253;})['then'](respondWithResult(_0x2c04b7,0xc9))['catch'](handleError(_0x2c04b7,null));};exports[_0xeb5e('0x34')]=function(_0x51a990,_0x1acc30){if(_0x51a990[_0xeb5e('0x5b')]['id']){delete _0x51a990[_0xeb5e('0x5b')]['id'];}return db[_0xeb5e('0x3d')][_0xeb5e('0x58')]({'where':{'id':_0x51a990[_0xeb5e('0x52')]['id']}})[_0xeb5e('0x35')](handleEntityNotFound(_0x1acc30,null))['then'](saveUpdates(_0x51a990[_0xeb5e('0x5b')],null))[_0xeb5e('0x35')](respondWithResult(_0x1acc30,null))[_0xeb5e('0x2a')](handleError(_0x1acc30,null));};exports['destroy']=function(_0x5ecef7,_0x1b87ea){return db['ChatQueue'][_0xeb5e('0x58')]({'where':{'id':_0x5ecef7['params']['id']}})[_0xeb5e('0x35')](handleEntityNotFound(_0x1b87ea,null))[_0xeb5e('0x35')](removeEntity(_0x1b87ea,null))[_0xeb5e('0x2a')](handleError(_0x1b87ea,null));};exports[_0xeb5e('0x5c')]=function(_0x4dc720,_0x549608){return db[_0xeb5e('0x3d')][_0xeb5e('0x5c')]()[_0xeb5e('0x35')](respondWithResult(_0x549608,null))[_0xeb5e('0x2a')](handleError(_0x549608,null));};exports[_0xeb5e('0x5d')]=function(_0x16e1b,_0x52edb9,_0x77756f){var _0x119e3e={'raw':!![],'where':{}},_0x371c0d={},_0x2d9a8b;return db[_0xeb5e('0x3d')]['findOne']({'where':{'id':_0x16e1b[_0xeb5e('0x52')]['id']}})[_0xeb5e('0x35')](handleEntityNotFound(_0x52edb9,null))[_0xeb5e('0x35')](function(_0x244283){if(_0x244283){_0x2d9a8b=_0x244283['get']({'plain':!![]});_0x371c0d['model']=_[_0xeb5e('0x43')](db[_0xeb5e('0x5e')][_0xeb5e('0x53')]);_0x371c0d['query']=_[_0xeb5e('0x43')](_0x16e1b[_0xeb5e('0x42')]);_0x371c0d['filters']=_['intersection'](_0x371c0d['model'],_0x371c0d['query']);_0x119e3e[_0xeb5e('0x47')]=_['intersection'](_0x371c0d['model'],qs[_0xeb5e('0x46')](_0x16e1b[_0xeb5e('0x42')][_0xeb5e('0x46')]));_0x119e3e[_0xeb5e('0x47')]=_0x119e3e['attributes']['length']?_0x119e3e['attributes']:_0x371c0d[_0xeb5e('0x40')];if(!_0x16e1b[_0xeb5e('0x42')][_0xeb5e('0x5f')](_0xeb5e('0x60'))){_0x119e3e[_0xeb5e('0x31')]=qs[_0xeb5e('0x31')](_0x16e1b[_0xeb5e('0x42')]['limit']);_0x119e3e['offset']=qs[_0xeb5e('0x30')](_0x16e1b[_0xeb5e('0x42')][_0xeb5e('0x30')]);}_0x119e3e[_0xeb5e('0x61')]=qs[_0xeb5e('0x49')](_0x16e1b[_0xeb5e('0x42')][_0xeb5e('0x49')]);_0x119e3e['where']=qs[_0xeb5e('0x44')](_[_0xeb5e('0x62')](_0x16e1b['query'],_0x371c0d[_0xeb5e('0x44')]));_0x119e3e['where'][_0xeb5e('0x63')]=_0x244283['id'];if(_0x16e1b[_0xeb5e('0x42')][_0xeb5e('0x4b')]){_0x119e3e[_0xeb5e('0x4a')]=_[_0xeb5e('0x4c')](_0x119e3e[_0xeb5e('0x4a')],{'$or':_[_0xeb5e('0x3c')](_0x119e3e[_0xeb5e('0x47')],function(_0x3cdba9){var _0x479ed2={};_0x479ed2[_0x3cdba9]={'$like':'%'+_0x16e1b[_0xeb5e('0x42')][_0xeb5e('0x4b')]+'%'};return _0x479ed2;})});}_0x119e3e=_[_0xeb5e('0x4c')]({},_0x119e3e,_0x16e1b['options']);return db[_0xeb5e('0x5e')][_0xeb5e('0x50')](_0x119e3e);}})['then'](function(_0x298bba){if(_0x298bba){return db['User'][_0xeb5e('0x64')]({'where':{'id':_[_0xeb5e('0x3c')](_0x298bba,_0xeb5e('0x65')),'role':_0xeb5e('0x66')},'attributes':['id',_0xeb5e('0x41'),_0xeb5e('0x67'),'updatedAt',_0xeb5e('0x68')]});}})[_0xeb5e('0x35')](function(_0x1fc842){if(_0x1fc842){return{'count':_0x1fc842[_0xeb5e('0x2f')],'rows':_[_0xeb5e('0x3c')](_0x1fc842[_0xeb5e('0x69')],function(_0x34b85f){return{'membername':_0x34b85f['name'],'UserId':_0x34b85f['id'],'queue_name':_0x2d9a8b[_0xeb5e('0x41')],'ChatQueueId':_0x2d9a8b['id'],'interface':util[_0xeb5e('0x6a')](_0xeb5e('0x6b'),'SIP',_0x34b85f['name']),'penalty':0x0,'paused':_0x34b85f[_0xeb5e('0x67')],'createdAt':_0x34b85f[_0xeb5e('0x68')],'updatedAt':_0x34b85f[_0xeb5e('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeb5e('0x35')](respondWithFilteredResult(_0x52edb9,_0x119e3e))[_0xeb5e('0x2a')](handleError(_0x52edb9,null));};exports[_0xeb5e('0x6d')]=function(_0x132f94,_0x1eaf09,_0x4d72de){var _0x2fe03c={};var _0x59bf25={};var _0x1369eb;var _0x535c57;return db[_0xeb5e('0x3d')][_0xeb5e('0x6e')]({'where':{'id':_0x132f94[_0xeb5e('0x52')]['id']}})[_0xeb5e('0x35')](handleEntityNotFound(_0x1eaf09,null))[_0xeb5e('0x35')](function(_0x5e9886){if(_0x5e9886){_0x1369eb=_0x5e9886;_0x59bf25['model']=_[_0xeb5e('0x43')](db[_0xeb5e('0x6f')][_0xeb5e('0x53')]);_0x59bf25[_0xeb5e('0x42')]=_[_0xeb5e('0x43')](_0x132f94[_0xeb5e('0x42')]);_0x59bf25[_0xeb5e('0x44')]=_['intersection'](_0x59bf25['model'],_0x59bf25[_0xeb5e('0x42')]);_0x2fe03c[_0xeb5e('0x47')]=_[_0xeb5e('0x45')](_0x59bf25[_0xeb5e('0x40')],qs[_0xeb5e('0x46')](_0x132f94['query']['fields']));_0x2fe03c[_0xeb5e('0x47')]=_0x2fe03c[_0xeb5e('0x47')][_0xeb5e('0x48')]?_0x2fe03c[_0xeb5e('0x47')]:_0x59bf25[_0xeb5e('0x40')];_0x2fe03c[_0xeb5e('0x61')]=qs['sort'](_0x132f94[_0xeb5e('0x42')]['sort']);_0x2fe03c[_0xeb5e('0x4a')]=qs[_0xeb5e('0x44')](_[_0xeb5e('0x62')](_0x132f94[_0xeb5e('0x42')],_0x59bf25['filters']));if(_0x132f94['query'][_0xeb5e('0x4b')]){_0x2fe03c[_0xeb5e('0x4a')]=_['merge'](_0x2fe03c['where'],{'$or':_[_0xeb5e('0x3c')](_0x2fe03c[_0xeb5e('0x47')],function(_0x478709){var _0x1c7d01={};_0x1c7d01[_0x478709]={'$like':'%'+_0x132f94[_0xeb5e('0x42')][_0xeb5e('0x4b')]+'%'};return _0x1c7d01;})});}_0x2fe03c=_[_0xeb5e('0x4c')]({},_0x2fe03c,_0x132f94[_0xeb5e('0x4d')]);return _0x1369eb[_0xeb5e('0x6d')](_0x2fe03c);}})[_0xeb5e('0x35')](function(_0x1fe7fa){if(_0x1fe7fa){_0x535c57=_0x1fe7fa[_0xeb5e('0x48')];if(!_0x132f94[_0xeb5e('0x42')][_0xeb5e('0x5f')]('nolimit')){_0x2fe03c[_0xeb5e('0x31')]=qs['limit'](_0x132f94[_0xeb5e('0x42')][_0xeb5e('0x31')]);_0x2fe03c['offset']=qs[_0xeb5e('0x30')](_0x132f94[_0xeb5e('0x42')][_0xeb5e('0x30')]);}return _0x1369eb[_0xeb5e('0x6d')](_0x2fe03c);}})[_0xeb5e('0x35')](function(_0x281ad9){if(_0x281ad9){return _0x281ad9?{'count':_0x535c57,'rows':_0x281ad9}:null;}})[_0xeb5e('0x35')](respondWithResult(_0x1eaf09,null))[_0xeb5e('0x2a')](handleError(_0x1eaf09,null));};exports[_0xeb5e('0x70')]=function(_0xfb503e,_0x4bf44e,_0x7be259){var _0x2cd028=_0xfb503e['body'][_0xeb5e('0x71')];return db[_0xeb5e('0x6f')][_0xeb5e('0x50')]({'where':{'id':_0x2cd028},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb5e('0x72'),'attributes':['id','name',_0xeb5e('0x73'),_0xeb5e('0x74'),_0xeb5e('0x75')],'raw':!![]}]})['then'](function(_0xc3b118){if(_0xc3b118){var _0x19695c=_['flatMap'](_0xc3b118,function(_0x41f99d){var _0x531831=_0x41f99d[_0xeb5e('0x36')]({'plain':!![]});return _0x531831[_0xeb5e('0x72')];});return db[_0xeb5e('0x3d')][_0xeb5e('0x58')]({'where':{'id':_0xfb503e[_0xeb5e('0x52')]['id']}})[_0xeb5e('0x35')](function(_0x309cdc){return db['sequelize'][_0xeb5e('0x76')](function(_0x1541b4){return _0x309cdc[_0xeb5e('0x70')](_0x2cd028,{'transaction':_0x1541b4})[_0xeb5e('0x35')](function(){return BPromise['each'](_0x19695c,function(_0x5e744d){return db[_0xeb5e('0x5e')][_0xeb5e('0x77')]({'where':{'UserId':_0x5e744d['id'],'ChatQueueId':_0xfb503e[_0xeb5e('0x52')]['id']},'transaction':_0x1541b4});});})[_0xeb5e('0x35')](function(){_0x19695c[_0xeb5e('0x78')](function(_0x54eb01){socket[_0xeb5e('0x79')](_0xeb5e('0x7a'),{'UserId':_0x54eb01['id'],'ChatQueueId':_0x309cdc['id']});});});});});}})['then'](respondWithStatusCode(_0x4bf44e,null))['catch'](handleError(_0x4bf44e,null));};exports['removeTeams']=function(_0x44efa9,_0x51be71,_0x5aec41){return db[_0xeb5e('0x6f')][_0xeb5e('0x50')]({'where':{'id':_0x44efa9['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xeb5e('0x7b')],'as':_0xeb5e('0x72'),'attributes':['id'],'raw':!![]}]})[_0xeb5e('0x35')](handleEntityNotFound(_0x51be71,null))[_0xeb5e('0x35')](function(_0x5cc294){var _0x3f0b7f=_['map'](_0x5cc294,'id');var _0x41d3e1=[];var _0x28728b=[];var _0x26efaf=squel['select']();_0x26efaf[_0xeb5e('0x7c')]('tq.TeamId')[_0xeb5e('0x7d')](_0xeb5e('0x7e'),'tq')[_0xeb5e('0x7f')](_0xeb5e('0x80'),'ut',_0xeb5e('0x81'))[_0xeb5e('0x4a')](_0xeb5e('0x82'),_0x44efa9[_0xeb5e('0x52')]['id']);for(var _0x5a8f7f=0x0;_0x5a8f7f<_0x5cc294['length'];_0x5a8f7f+=0x1){let _0x39e0d2=_0x5cc294[_0x5a8f7f];for(var _0xfaa9d5=0x0;_0xfaa9d5<_0x39e0d2[_0xeb5e('0x72')][_0xeb5e('0x48')];_0xfaa9d5+=0x1){let _0x1c9a2c=_0x39e0d2['Agents'][_0xfaa9d5];var _0x14283a=_0x26efaf[_0xeb5e('0x83')]();_0x14283a[_0xeb5e('0x4a')](_0xeb5e('0x84'),_0x1c9a2c['id']);_0x28728b[_0xeb5e('0x85')](db[_0xeb5e('0x86')][_0xeb5e('0x42')](_0x14283a['toString'](),{'type':db[_0xeb5e('0x86')][_0xeb5e('0x87')][_0xeb5e('0x88')]})[_0xeb5e('0x35')](function(_0x319737){if(_0x319737[_0xeb5e('0x48')]===0x1){return _0x1c9a2c['id'];}else{var _0x146dff=_['every'](_['map'](_0x319737,_0xeb5e('0x89')),function(_0x18e6cc){return _[_0xeb5e('0x8a')](_0x3f0b7f,_0x18e6cc);});if(_0x146dff){return _0x1c9a2c['id'];}}}));}}return BPromise['all'](_0x28728b)[_0xeb5e('0x35')](function(_0x3cd380){_0x41d3e1=_(_0x41d3e1)[_0xeb5e('0x8b')](_0x3cd380)[_0xeb5e('0x8c')]()[_0xeb5e('0x8d')]();return db[_0xeb5e('0x3d')][_0xeb5e('0x58')]({'where':{'id':_0x44efa9[_0xeb5e('0x52')]['id']}})[_0xeb5e('0x35')](function(_0x16f3c2){return db[_0xeb5e('0x86')][_0xeb5e('0x76')](function(_0x31ede1){return _0x16f3c2[_0xeb5e('0x8e')](_0x44efa9['query'][_0xeb5e('0x71')],{'transaction':_0x31ede1})[_0xeb5e('0x35')](function(){if(!_[_0xeb5e('0x8f')](_0x41d3e1)){return _0x16f3c2['removeAgents'](_0x41d3e1,{'transaction':_0x31ede1});}})[_0xeb5e('0x35')](function(){_0x41d3e1['forEach'](function(_0x215819){socket['emit'](_0xeb5e('0x90'),{'UserId':_0x215819,'ChatQueueId':_0x16f3c2['id']});});});});});});})[_0xeb5e('0x35')](respondWithStatusCode(_0x51be71,null))[_0xeb5e('0x2a')](handleError(_0x51be71,null));};exports[_0xeb5e('0x91')]=function(_0x5af066,_0x10f67d,_0x429720){return db['ChatQueue'][_0xeb5e('0x58')]({'where':{'id':_0x5af066[_0xeb5e('0x52')]['id']}})[_0xeb5e('0x35')](handleEntityNotFound(_0x10f67d,null))[_0xeb5e('0x35')](function(_0x11c275){if(_0x11c275){return _0x11c275[_0xeb5e('0x91')](_0x5af066[_0xeb5e('0x5b')][_0xeb5e('0x71')],_[_0xeb5e('0x92')](_0x5af066[_0xeb5e('0x5b')],[_0xeb5e('0x71'),'id'])||{})[_0xeb5e('0x93')](function(_0x2800c0){for(var _0x37e70c=0x0;_0x37e70c<_0x5af066['body']['ids'][_0xeb5e('0x48')];_0x37e70c+=0x1){socket['emit']('userChatQueue:save',{'UserId':_0x5af066[_0xeb5e('0x5b')][_0xeb5e('0x71')][_0x37e70c],'ChatQueueId':_0x5af066[_0xeb5e('0x52')]['id']});}return _0x2800c0;});}})['then'](respondWithResult(_0x10f67d,null))[_0xeb5e('0x2a')](handleError(_0x10f67d,null));};exports['removeAgents']=function(_0x50333f,_0x54e892,_0x987028){return db[_0xeb5e('0x3d')][_0xeb5e('0x58')]({'where':{'id':_0x50333f['params']['id']}})[_0xeb5e('0x35')](handleEntityNotFound(_0x54e892,null))[_0xeb5e('0x35')](function(_0xc452c1){if(_0xc452c1){return _0xc452c1['removeAgents'](_0x50333f[_0xeb5e('0x42')][_0xeb5e('0x71')])[_0xeb5e('0x35')](function(){if(_[_0xeb5e('0x94')](_0x50333f[_0xeb5e('0x42')][_0xeb5e('0x71')])){for(var _0x174ecd=0x0;_0x174ecd<_0x50333f[_0xeb5e('0x42')][_0xeb5e('0x71')][_0xeb5e('0x48')];_0x174ecd+=0x1){socket[_0xeb5e('0x79')](_0xeb5e('0x90'),{'UserId':Number(_0x50333f[_0xeb5e('0x42')][_0xeb5e('0x71')][_0x174ecd]),'ChatQueueId':Number(_0x50333f[_0xeb5e('0x52')]['id'])});}}else{socket['emit'](_0xeb5e('0x90'),{'UserId':Number(_0x50333f['query'][_0xeb5e('0x71')]),'ChatQueueId':Number(_0x50333f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x54e892,null))['catch'](handleError(_0x54e892,null));};exports[_0xeb5e('0x95')]=function(_0x2a07b8,_0x1da589,_0xc0472f){var _0x9f1f32={};var _0x2ad765={};var _0x2b624e;var _0x1d725e;return db[_0xeb5e('0x3d')][_0xeb5e('0x6e')]({'where':{'id':_0x2a07b8[_0xeb5e('0x52')]['id']}})[_0xeb5e('0x35')](handleEntityNotFound(_0x1da589,null))[_0xeb5e('0x35')](function(_0x257a36){if(_0x257a36){_0x2b624e=_0x257a36;_0x2ad765['model']=_['keys'](db[_0xeb5e('0x7b')][_0xeb5e('0x53')]);_0x2ad765[_0xeb5e('0x42')]=_[_0xeb5e('0x43')](_0x2a07b8[_0xeb5e('0x42')]);_0x2ad765[_0xeb5e('0x44')]=_['intersection'](_0x2ad765['model'],_0x2ad765['query']);_0x9f1f32[_0xeb5e('0x47')]=_[_0xeb5e('0x45')](_0x2ad765[_0xeb5e('0x40')],qs[_0xeb5e('0x46')](_0x2a07b8[_0xeb5e('0x42')][_0xeb5e('0x46')]));_0x9f1f32['attributes']=_0x9f1f32[_0xeb5e('0x47')]['length']?_0x9f1f32['attributes']:_0x2ad765['model'];_0x9f1f32[_0xeb5e('0x61')]=qs[_0xeb5e('0x49')](_0x2a07b8[_0xeb5e('0x42')][_0xeb5e('0x49')]);_0x9f1f32['where']=qs['filters'](_['pick'](_0x2a07b8[_0xeb5e('0x42')],_0x2ad765['filters']));if(_0x2a07b8[_0xeb5e('0x42')][_0xeb5e('0x4b')]){_0x9f1f32[_0xeb5e('0x4a')]=_[_0xeb5e('0x4c')](_0x9f1f32['where'],{'$or':_[_0xeb5e('0x3c')](_0x9f1f32[_0xeb5e('0x47')],function(_0x4abbf9){var _0x2135af={};_0x2135af[_0x4abbf9]={'$like':'%'+_0x2a07b8[_0xeb5e('0x42')]['filter']+'%'};return _0x2135af;})});}_0x9f1f32=_['merge']({},_0x9f1f32,_0x2a07b8[_0xeb5e('0x4d')]);return _0x2b624e[_0xeb5e('0x95')](_0x9f1f32);}})[_0xeb5e('0x35')](function(_0x5deb80){if(_0x5deb80){_0x1d725e=_0x5deb80[_0xeb5e('0x48')];if(!_0x2a07b8[_0xeb5e('0x42')][_0xeb5e('0x5f')](_0xeb5e('0x60'))){_0x9f1f32[_0xeb5e('0x31')]=qs[_0xeb5e('0x31')](_0x2a07b8[_0xeb5e('0x42')][_0xeb5e('0x31')]);_0x9f1f32['offset']=qs[_0xeb5e('0x30')](_0x2a07b8['query'][_0xeb5e('0x30')]);}return _0x2b624e['getAgents'](_0x9f1f32);}})[_0xeb5e('0x35')](function(_0x499b0c){if(_0x499b0c){return _0x499b0c?{'count':_0x1d725e,'rows':_0x499b0c}:null;}})[_0xeb5e('0x35')](respondWithResult(_0x1da589,null))[_0xeb5e('0x2a')](handleError(_0x1da589,null));};
\ No newline at end of file
+var _0x3666=['localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ChatQueue','includeAll','findAll','rows','show','params','length','include','find','user','role','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','each','forEach','emit','removeTeams','select','field','tq.TeamId','from','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','union','value','transaction','isEmpty','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','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','../../mysqldb','redis'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x3666,0x110));var _0x6366=function(_0x36c7da,_0x38dfa7){_0x36c7da=_0x36c7da-0x0;var _0x3a34f4=_0x3666[_0x36c7da];return _0x3a34f4;};'use strict';var pdf=require(_0x6366('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6366('0x1'));var jsonpatch=require(_0x6366('0x2'));var rp=require(_0x6366('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6366('0x4'));var util=require('util');var path=require('path');var sox=require(_0x6366('0x5'));var csv=require(_0x6366('0x6'));var ejs=require(_0x6366('0x7'));var fs=require('fs');var _=require(_0x6366('0x8'));var squel=require(_0x6366('0x9'));var crypto=require(_0x6366('0xa'));var jsforce=require(_0x6366('0xb'));var deskjs=require(_0x6366('0xc'));var toCsv=require(_0x6366('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6366('0xd'));var authService=require(_0x6366('0xe'));var qs=require(_0x6366('0xf'));var as=require(_0x6366('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6366('0x11'))(_0x6366('0x12'));var utils=require(_0x6366('0x13'));var config=require('../../config/environment');var db=require(_0x6366('0x14'))['db'];config[_0x6366('0x15')]=_['defaults'](config[_0x6366('0x15')],{'host':_0x6366('0x16'),'port':0x18eb});var socket=require(_0x6366('0x17'))(new Redis(config[_0x6366('0x15')]));require(_0x6366('0x18'))[_0x6366('0x19')](socket);var jayson=require(_0x6366('0x1a'));var client=jayson[_0x6366('0x1b')][_0x6366('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x461a54,_0x4e93e8,_0x597f92){if(_0x597f92){var _0x3b3a57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b3a57[_0x6366('0x1d')](_0x4e93e8)){return _0x461a54;}else{throw new db[(_0x6366('0x1e'))][(_0x6366('0x1f'))](_0x6366('0x20'));}}else{return _0x461a54;}}function respondWithRpcPromise(_0x565d9c,_0x35443d,_0x5bee38,_0x436e3c){return new BPromise(function(_0x4980e1,_0x4d1f14){var _0x49809f=_0x436e3c||client;return _0x49809f[_0x6366('0x21')](_0x565d9c,_0x5bee38)['then'](function(_0x4eb93e){logger['info']('ChatQueue,\x20%s,\x20%s',_0x35443d,_0x6366('0x22'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x35443d,_0x6366('0x22'),JSON['stringify'](_0x4eb93e));if(_0x4eb93e['error']){if(_0x4eb93e[_0x6366('0x23')][_0x6366('0x24')]===0x1f4){logger[_0x6366('0x23')]('ChatQueue,\x20%s,\x20%s',_0x35443d,_0x4eb93e[_0x6366('0x23')]['message']);return _0x4d1f14(_0x4eb93e[_0x6366('0x23')][_0x6366('0x25')]);}logger['error'](_0x6366('0x26'),_0x35443d,_0x4eb93e[_0x6366('0x23')][_0x6366('0x25')]);return _0x4980e1(_0x4eb93e[_0x6366('0x23')][_0x6366('0x25')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x35443d,'request\x20sent');_0x4980e1(_0x4eb93e[_0x6366('0x27')][_0x6366('0x25')]);}})[_0x6366('0x28')](function(_0x1357ad){logger[_0x6366('0x23')](_0x6366('0x26'),_0x35443d,_0x1357ad);_0x4d1f14(_0x1357ad);});});}function respondWithStatusCode(_0x35b3e4,_0x5937b2){_0x5937b2=_0x5937b2||0xcc;return function(_0x1d8c47){if(_0x1d8c47){return _0x35b3e4['sendStatus'](_0x5937b2);}return _0x35b3e4[_0x6366('0x29')](_0x5937b2)[_0x6366('0x2a')]();};}function respondWithResult(_0x567cb8,_0x2c65d2){_0x2c65d2=_0x2c65d2||0xc8;return function(_0x589e20){if(_0x589e20){return _0x567cb8[_0x6366('0x29')](_0x2c65d2)['json'](_0x589e20);}};}function respondWithFilteredResult(_0x512e27,_0x304d81){return function(_0x1e7625){if(_0x1e7625){var _0x39521a=_0x1e7625[_0x6366('0x2b')],_0x400faf=_0x304d81[_0x6366('0x2c')],_0x46077b=_0x304d81[_0x6366('0x2c')]+_0x304d81[_0x6366('0x2d')],_0x1d48fb;if(_0x46077b>=_0x39521a){_0x46077b=_0x39521a;_0x1d48fb=0xc8;}else{_0x1d48fb=0xce;}_0x512e27[_0x6366('0x29')](_0x1d48fb);return _0x512e27[_0x6366('0x2e')](_0x6366('0x2f'),_0x400faf+'-'+_0x46077b+'/'+_0x39521a)['json'](_0x1e7625);}return null;};}function patchUpdates(_0x2c6a94){return function(_0x4c1b64){try{jsonpatch[_0x6366('0x30')](_0x4c1b64,_0x2c6a94,!![]);}catch(_0xccbaf1){return BPromise[_0x6366('0x31')](_0xccbaf1);}return _0x4c1b64[_0x6366('0x32')]();};}function saveUpdates(_0x4162e7,_0x29fe67){return function(_0x4937fd){if(_0x4937fd){return _0x4937fd[_0x6366('0x33')](_0x4162e7)[_0x6366('0x34')](function(_0xb29dc2){return _0xb29dc2;});}return null;};}function removeEntity(_0x417ff1,_0x45fe81){return function(_0x18ce35){if(_0x18ce35){return _0x18ce35[_0x6366('0x35')]()[_0x6366('0x34')](function(){var _0x3343e0=_0x18ce35[_0x6366('0x36')]({'plain':!![]});var _0x39bc0a=_0x6366('0x37');return db[_0x6366('0x38')][_0x6366('0x35')]({'where':{'type':_0x39bc0a,'resourceId':_0x3343e0['id']}})[_0x6366('0x34')](function(){return _0x18ce35;});})[_0x6366('0x34')](function(){_0x417ff1['status'](0xcc)[_0x6366('0x2a')]();});}};}function handleEntityNotFound(_0x2a4625,_0xff2d10){return function(_0x282bf3){if(!_0x282bf3){_0x2a4625['sendStatus'](0x194);}return _0x282bf3;};}function handleError(_0x34f282,_0x5e4e09){_0x5e4e09=_0x5e4e09||0x1f4;return function(_0x2a12f8){logger['error'](_0x2a12f8[_0x6366('0x39')]);if(_0x2a12f8['name']){delete _0x2a12f8['name'];}_0x34f282[_0x6366('0x29')](_0x5e4e09)[_0x6366('0x3a')](_0x2a12f8);};}exports[_0x6366('0x3b')]=function(_0x3c4595,_0xe693b4){var _0x2e7cfb={},_0x179d2b={},_0x4dd502={'count':0x0,'rows':[]};var _0x994352=_[_0x6366('0x3c')](db['ChatQueue'][_0x6366('0x3d')],function(_0xc5e432){return{'name':_0xc5e432[_0x6366('0x3e')],'type':_0xc5e432[_0x6366('0x3f')][_0x6366('0x40')]};});_0x179d2b[_0x6366('0x41')]=_[_0x6366('0x3c')](_0x994352,_0x6366('0x42'));_0x179d2b[_0x6366('0x43')]=_[_0x6366('0x44')](_0x3c4595[_0x6366('0x43')]);_0x179d2b[_0x6366('0x45')]=_[_0x6366('0x46')](_0x179d2b[_0x6366('0x41')],_0x179d2b[_0x6366('0x43')]);_0x2e7cfb[_0x6366('0x47')]=_[_0x6366('0x46')](_0x179d2b[_0x6366('0x41')],qs[_0x6366('0x48')](_0x3c4595[_0x6366('0x43')][_0x6366('0x48')]));_0x2e7cfb[_0x6366('0x47')]=_0x2e7cfb[_0x6366('0x47')]['length']?_0x2e7cfb[_0x6366('0x47')]:_0x179d2b[_0x6366('0x41')];if(!_0x3c4595[_0x6366('0x43')][_0x6366('0x49')](_0x6366('0x4a'))){_0x2e7cfb[_0x6366('0x2d')]=qs[_0x6366('0x2d')](_0x3c4595[_0x6366('0x43')][_0x6366('0x2d')]);_0x2e7cfb[_0x6366('0x2c')]=qs['offset'](_0x3c4595['query']['offset']);}_0x2e7cfb[_0x6366('0x4b')]=qs[_0x6366('0x4c')](_0x3c4595[_0x6366('0x43')][_0x6366('0x4c')]);_0x2e7cfb[_0x6366('0x4d')]=qs[_0x6366('0x45')](_[_0x6366('0x4e')](_0x3c4595[_0x6366('0x43')],_0x179d2b[_0x6366('0x45')]),_0x994352);if(_0x3c4595[_0x6366('0x43')][_0x6366('0x4f')]){_0x2e7cfb[_0x6366('0x4d')]=_[_0x6366('0x50')](_0x2e7cfb[_0x6366('0x4d')],{'$or':_[_0x6366('0x3c')](_0x994352,function(_0x2f35b9){if(_0x2f35b9['type']!=='VIRTUAL'){var _0x20fd2a={};_0x20fd2a[_0x2f35b9['name']]={'$like':'%'+_0x3c4595[_0x6366('0x43')][_0x6366('0x4f')]+'%'};return _0x20fd2a;}})});}_0x2e7cfb=_[_0x6366('0x50')]({},_0x2e7cfb,_0x3c4595[_0x6366('0x51')]);var _0x249b11={'where':_0x2e7cfb[_0x6366('0x4d')]};return db[_0x6366('0x52')]['count'](_0x249b11)[_0x6366('0x34')](function(_0x43ecd5){_0x4dd502[_0x6366('0x2b')]=_0x43ecd5;if(_0x3c4595[_0x6366('0x43')][_0x6366('0x53')]){_0x2e7cfb['include']=[{'all':!![]}];}return db['ChatQueue'][_0x6366('0x54')](_0x2e7cfb);})[_0x6366('0x34')](function(_0x314609){_0x4dd502[_0x6366('0x55')]=_0x314609;return _0x4dd502;})['then'](respondWithFilteredResult(_0xe693b4,_0x2e7cfb))[_0x6366('0x28')](handleError(_0xe693b4,null));};exports[_0x6366('0x56')]=function(_0x22f8f0,_0x4bccdf){var _0x6c3b82={'raw':!![],'where':{'id':_0x22f8f0[_0x6366('0x57')]['id']}},_0x134df0={};_0x134df0[_0x6366('0x41')]=_[_0x6366('0x44')](db[_0x6366('0x52')][_0x6366('0x3d')]);_0x134df0['query']=_['keys'](_0x22f8f0[_0x6366('0x43')]);_0x134df0[_0x6366('0x45')]=_[_0x6366('0x46')](_0x134df0[_0x6366('0x41')],_0x134df0['query']);_0x6c3b82[_0x6366('0x47')]=_[_0x6366('0x46')](_0x134df0['model'],qs['fields'](_0x22f8f0[_0x6366('0x43')][_0x6366('0x48')]));_0x6c3b82[_0x6366('0x47')]=_0x6c3b82['attributes'][_0x6366('0x58')]?_0x6c3b82[_0x6366('0x47')]:_0x134df0[_0x6366('0x41')];if(_0x22f8f0[_0x6366('0x43')][_0x6366('0x53')]){_0x6c3b82[_0x6366('0x59')]=[{'all':!![]}];}_0x6c3b82=_[_0x6366('0x50')]({},_0x6c3b82,_0x22f8f0[_0x6366('0x51')]);return db['ChatQueue'][_0x6366('0x5a')](_0x6c3b82)['then'](handleEntityNotFound(_0x4bccdf,null))[_0x6366('0x34')](respondWithResult(_0x4bccdf,null))[_0x6366('0x28')](handleError(_0x4bccdf,null));};exports['create']=function(_0x33cfe6,_0x386183){return db['ChatQueue']['create'](_0x33cfe6['body'],{})[_0x6366('0x34')](function(_0x234edb){var _0x266d1e=_0x33cfe6[_0x6366('0x5b')]['get']({'plain':!![]});if(!_0x266d1e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x266d1e[_0x6366('0x5c')]===_0x6366('0x5b')){var _0x1f10e8=_0x234edb['get']({'plain':!![]});var _0x2ab14b=_0x6366('0x37');return db['UserProfileSection'][_0x6366('0x5a')]({'where':{'name':_0x2ab14b,'userProfileId':_0x266d1e['userProfileId']},'raw':!![]})['then'](function(_0x55a83b){if(_0x55a83b&&_0x55a83b[_0x6366('0x5d')]===0x0){return db[_0x6366('0x38')][_0x6366('0x5e')]({'name':_0x1f10e8[_0x6366('0x42')],'resourceId':_0x1f10e8['id'],'type':_0x55a83b['name'],'sectionId':_0x55a83b['id']},{})['then'](function(){return _0x234edb;});}else{return _0x234edb;}})[_0x6366('0x28')](function(_0x235226){logger[_0x6366('0x23')](_0x6366('0x5f'),_0x235226);throw _0x235226;});}return _0x234edb;})[_0x6366('0x34')](respondWithResult(_0x386183,0xc9))[_0x6366('0x28')](handleError(_0x386183,null));};exports[_0x6366('0x33')]=function(_0x2707ee,_0x52a50e){if(_0x2707ee[_0x6366('0x60')]['id']){delete _0x2707ee[_0x6366('0x60')]['id'];}return db[_0x6366('0x52')][_0x6366('0x5a')]({'where':{'id':_0x2707ee[_0x6366('0x57')]['id']}})['then'](handleEntityNotFound(_0x52a50e,null))['then'](saveUpdates(_0x2707ee[_0x6366('0x60')],null))[_0x6366('0x34')](respondWithResult(_0x52a50e,null))[_0x6366('0x28')](handleError(_0x52a50e,null));};exports[_0x6366('0x35')]=function(_0x3d2fa6,_0x21a9d2){return db[_0x6366('0x52')][_0x6366('0x5a')]({'where':{'id':_0x3d2fa6[_0x6366('0x57')]['id']}})['then'](handleEntityNotFound(_0x21a9d2,null))['then'](removeEntity(_0x21a9d2,null))[_0x6366('0x28')](handleError(_0x21a9d2,null));};exports[_0x6366('0x61')]=function(_0x5c794f,_0x1b424c){return db[_0x6366('0x52')][_0x6366('0x61')]()[_0x6366('0x34')](respondWithResult(_0x1b424c,null))[_0x6366('0x28')](handleError(_0x1b424c,null));};exports[_0x6366('0x62')]=function(_0x5e516a,_0x1dd75b,_0x4e61d5){var _0x622d6d={'raw':!![],'where':{}},_0x51ff20={},_0x30915d;return db['ChatQueue'][_0x6366('0x63')]({'where':{'id':_0x5e516a[_0x6366('0x57')]['id']}})[_0x6366('0x34')](handleEntityNotFound(_0x1dd75b,null))[_0x6366('0x34')](function(_0x2326ec){if(_0x2326ec){_0x30915d=_0x2326ec['get']({'plain':!![]});_0x51ff20['model']=_[_0x6366('0x44')](db['UserChatQueue'][_0x6366('0x3d')]);_0x51ff20[_0x6366('0x43')]=_[_0x6366('0x44')](_0x5e516a[_0x6366('0x43')]);_0x51ff20[_0x6366('0x45')]=_[_0x6366('0x46')](_0x51ff20[_0x6366('0x41')],_0x51ff20[_0x6366('0x43')]);_0x622d6d[_0x6366('0x47')]=_[_0x6366('0x46')](_0x51ff20[_0x6366('0x41')],qs[_0x6366('0x48')](_0x5e516a[_0x6366('0x43')][_0x6366('0x48')]));_0x622d6d[_0x6366('0x47')]=_0x622d6d['attributes'][_0x6366('0x58')]?_0x622d6d['attributes']:_0x51ff20[_0x6366('0x41')];if(!_0x5e516a[_0x6366('0x43')]['hasOwnProperty'](_0x6366('0x4a'))){_0x622d6d[_0x6366('0x2d')]=qs['limit'](_0x5e516a['query'][_0x6366('0x2d')]);_0x622d6d[_0x6366('0x2c')]=qs['offset'](_0x5e516a[_0x6366('0x43')]['offset']);}_0x622d6d['order']=qs['sort'](_0x5e516a['query'][_0x6366('0x4c')]);_0x622d6d[_0x6366('0x4d')]=qs[_0x6366('0x45')](_[_0x6366('0x4e')](_0x5e516a[_0x6366('0x43')],_0x51ff20['filters']));_0x622d6d[_0x6366('0x4d')][_0x6366('0x64')]=_0x2326ec['id'];if(_0x5e516a['query']['filter']){_0x622d6d[_0x6366('0x4d')]=_['merge'](_0x622d6d[_0x6366('0x4d')],{'$or':_[_0x6366('0x3c')](_0x622d6d['attributes'],function(_0x114de9){var _0x4ce98f={};_0x4ce98f[_0x114de9]={'$like':'%'+_0x5e516a['query']['filter']+'%'};return _0x4ce98f;})});}_0x622d6d=_[_0x6366('0x50')]({},_0x622d6d,_0x5e516a[_0x6366('0x51')]);return db[_0x6366('0x65')]['findAll'](_0x622d6d);}})[_0x6366('0x34')](function(_0x38c37d){if(_0x38c37d){return db[_0x6366('0x66')]['findAndCountAll']({'where':{'id':_[_0x6366('0x3c')](_0x38c37d,_0x6366('0x67')),'role':_0x6366('0x68')},'attributes':['id',_0x6366('0x42'),_0x6366('0x69'),_0x6366('0x6a'),_0x6366('0x6b')]});}})[_0x6366('0x34')](function(_0x2a0bb1){if(_0x2a0bb1){return{'count':_0x2a0bb1['count'],'rows':_[_0x6366('0x3c')](_0x2a0bb1[_0x6366('0x55')],function(_0x59e851){return{'membername':_0x59e851[_0x6366('0x42')],'UserId':_0x59e851['id'],'queue_name':_0x30915d['name'],'ChatQueueId':_0x30915d['id'],'interface':util['format'](_0x6366('0x6c'),_0x6366('0x6d'),_0x59e851[_0x6366('0x42')]),'penalty':0x0,'paused':_0x59e851[_0x6366('0x69')],'createdAt':_0x59e851[_0x6366('0x6b')],'updatedAt':_0x59e851[_0x6366('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6366('0x34')](respondWithFilteredResult(_0x1dd75b,_0x622d6d))['catch'](handleError(_0x1dd75b,null));};exports[_0x6366('0x6e')]=function(_0x41baab,_0x1b91a4,_0x17d51b){var _0x2cedeb={};var _0x136f9b={};var _0x499e1a;var _0x5470d0;return db[_0x6366('0x52')]['findOne']({'where':{'id':_0x41baab[_0x6366('0x57')]['id']}})[_0x6366('0x34')](handleEntityNotFound(_0x1b91a4,null))[_0x6366('0x34')](function(_0x4f1dd9){if(_0x4f1dd9){_0x499e1a=_0x4f1dd9;_0x136f9b['model']=_[_0x6366('0x44')](db['Team'][_0x6366('0x3d')]);_0x136f9b[_0x6366('0x43')]=_[_0x6366('0x44')](_0x41baab['query']);_0x136f9b[_0x6366('0x45')]=_[_0x6366('0x46')](_0x136f9b['model'],_0x136f9b[_0x6366('0x43')]);_0x2cedeb[_0x6366('0x47')]=_[_0x6366('0x46')](_0x136f9b[_0x6366('0x41')],qs[_0x6366('0x48')](_0x41baab[_0x6366('0x43')][_0x6366('0x48')]));_0x2cedeb['attributes']=_0x2cedeb[_0x6366('0x47')][_0x6366('0x58')]?_0x2cedeb[_0x6366('0x47')]:_0x136f9b[_0x6366('0x41')];_0x2cedeb[_0x6366('0x4b')]=qs[_0x6366('0x4c')](_0x41baab[_0x6366('0x43')][_0x6366('0x4c')]);_0x2cedeb[_0x6366('0x4d')]=qs['filters'](_['pick'](_0x41baab[_0x6366('0x43')],_0x136f9b['filters']));if(_0x41baab[_0x6366('0x43')][_0x6366('0x4f')]){_0x2cedeb[_0x6366('0x4d')]=_['merge'](_0x2cedeb[_0x6366('0x4d')],{'$or':_['map'](_0x2cedeb[_0x6366('0x47')],function(_0x2c5483){var _0x3b27bb={};_0x3b27bb[_0x2c5483]={'$like':'%'+_0x41baab[_0x6366('0x43')]['filter']+'%'};return _0x3b27bb;})});}_0x2cedeb=_[_0x6366('0x50')]({},_0x2cedeb,_0x41baab[_0x6366('0x51')]);return _0x499e1a['getTeams'](_0x2cedeb);}})['then'](function(_0x1d058d){if(_0x1d058d){_0x5470d0=_0x1d058d['length'];if(!_0x41baab[_0x6366('0x43')][_0x6366('0x49')](_0x6366('0x4a'))){_0x2cedeb['limit']=qs[_0x6366('0x2d')](_0x41baab['query'][_0x6366('0x2d')]);_0x2cedeb['offset']=qs[_0x6366('0x2c')](_0x41baab[_0x6366('0x43')]['offset']);}return _0x499e1a[_0x6366('0x6e')](_0x2cedeb);}})[_0x6366('0x34')](function(_0x11da92){if(_0x11da92){return _0x11da92?{'count':_0x5470d0,'rows':_0x11da92}:null;}})[_0x6366('0x34')](respondWithResult(_0x1b91a4,null))[_0x6366('0x28')](handleError(_0x1b91a4,null));};exports[_0x6366('0x6f')]=function(_0x33206f,_0x331e51,_0x13bf46){var _0xafd222=_0x33206f['body'][_0x6366('0x70')];return db[_0x6366('0x71')][_0x6366('0x54')]({'where':{'id':_0xafd222},'attributes':['id'],'include':[{'model':db[_0x6366('0x66')],'as':_0x6366('0x72'),'attributes':['id',_0x6366('0x42'),'online',_0x6366('0x73'),_0x6366('0x74')],'raw':!![]}]})[_0x6366('0x34')](function(_0x39d4bc){if(_0x39d4bc){var _0xc6a336=_[_0x6366('0x75')](_0x39d4bc,function(_0x6031b4){var _0x3d1833=_0x6031b4[_0x6366('0x36')]({'plain':!![]});return _0x3d1833[_0x6366('0x72')];});return db[_0x6366('0x52')]['find']({'where':{'id':_0x33206f[_0x6366('0x57')]['id']}})[_0x6366('0x34')](function(_0x4e72ae){return db['sequelize']['transaction'](function(_0x18c7ce){return _0x4e72ae[_0x6366('0x6f')](_0xafd222,{'transaction':_0x18c7ce})[_0x6366('0x34')](function(){return BPromise[_0x6366('0x76')](_0xc6a336,function(_0x317564){return db[_0x6366('0x65')]['findOrCreate']({'where':{'UserId':_0x317564['id'],'ChatQueueId':_0x33206f['params']['id']},'transaction':_0x18c7ce});});})[_0x6366('0x34')](function(){_0xc6a336[_0x6366('0x77')](function(_0x5a19ea){socket[_0x6366('0x78')]('userChatQueue:save',{'UserId':_0x5a19ea['id'],'ChatQueueId':_0x4e72ae['id']});});});});});}})[_0x6366('0x34')](respondWithStatusCode(_0x331e51,null))[_0x6366('0x28')](handleError(_0x331e51,null));};exports[_0x6366('0x79')]=function(_0x1f9b10,_0x30e6e5,_0x50c1f1){return db[_0x6366('0x71')][_0x6366('0x54')]({'where':{'id':_0x1f9b10['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x6366('0x66')],'as':_0x6366('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x30e6e5,null))[_0x6366('0x34')](function(_0x1ad875){var _0x68d5af=_[_0x6366('0x3c')](_0x1ad875,'id');var _0x51ad2a=[];var _0x3259c6=[];var _0x145bf4=squel[_0x6366('0x7a')]();_0x145bf4[_0x6366('0x7b')](_0x6366('0x7c'))[_0x6366('0x7d')]('team_has_chat_queues','tq')['join'](_0x6366('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6366('0x4d')](_0x6366('0x7f'),_0x1f9b10[_0x6366('0x57')]['id']);for(var _0x36039d=0x0;_0x36039d<_0x1ad875[_0x6366('0x58')];_0x36039d+=0x1){let _0x512d7c=_0x1ad875[_0x36039d];for(var _0x53ad6e=0x0;_0x53ad6e<_0x512d7c[_0x6366('0x72')]['length'];_0x53ad6e+=0x1){let _0x32f109=_0x512d7c[_0x6366('0x72')][_0x53ad6e];var _0x35d164=_0x145bf4[_0x6366('0x80')]();_0x35d164[_0x6366('0x4d')](_0x6366('0x81'),_0x32f109['id']);_0x3259c6[_0x6366('0x82')](db[_0x6366('0x83')][_0x6366('0x43')](_0x35d164[_0x6366('0x84')](),{'type':db[_0x6366('0x83')]['QueryTypes'][_0x6366('0x85')]})[_0x6366('0x34')](function(_0x4f86){if(_0x4f86[_0x6366('0x58')]===0x1){return _0x32f109['id'];}else{var _0x3e41b4=_[_0x6366('0x86')](_['map'](_0x4f86,_0x6366('0x87')),function(_0x540b73){return _[_0x6366('0x88')](_0x68d5af,_0x540b73);});if(_0x3e41b4){return _0x32f109['id'];}}}));}}return BPromise['all'](_0x3259c6)[_0x6366('0x34')](function(_0x140868){_0x51ad2a=_(_0x51ad2a)[_0x6366('0x89')](_0x140868)['compact']()[_0x6366('0x8a')]();return db[_0x6366('0x52')][_0x6366('0x5a')]({'where':{'id':_0x1f9b10[_0x6366('0x57')]['id']}})['then'](function(_0x142711){return db[_0x6366('0x83')][_0x6366('0x8b')](function(_0x1b0981){return _0x142711['removeTeams'](_0x1f9b10[_0x6366('0x43')]['ids'],{'transaction':_0x1b0981})[_0x6366('0x34')](function(){if(!_[_0x6366('0x8c')](_0x51ad2a)){return _0x142711['removeAgents'](_0x51ad2a,{'transaction':_0x1b0981});}})[_0x6366('0x34')](function(){_0x51ad2a['forEach'](function(_0x309875){socket[_0x6366('0x78')](_0x6366('0x8d'),{'UserId':_0x309875,'ChatQueueId':_0x142711['id']});});});});});});})['then'](respondWithStatusCode(_0x30e6e5,null))['catch'](handleError(_0x30e6e5,null));};exports[_0x6366('0x8e')]=function(_0x5ab4bf,_0x133e2d,_0x4e1451){return db[_0x6366('0x52')]['find']({'where':{'id':_0x5ab4bf['params']['id']}})[_0x6366('0x34')](handleEntityNotFound(_0x133e2d,null))[_0x6366('0x34')](function(_0x25ccd1){if(_0x25ccd1){return _0x25ccd1[_0x6366('0x8e')](_0x5ab4bf[_0x6366('0x60')][_0x6366('0x70')],_[_0x6366('0x8f')](_0x5ab4bf[_0x6366('0x60')],[_0x6366('0x70'),'id'])||{})['spread'](function(_0x2a1087){for(var _0x30c429=0x0;_0x30c429<_0x5ab4bf['body']['ids'][_0x6366('0x58')];_0x30c429+=0x1){socket['emit']('userChatQueue:save',{'UserId':_0x5ab4bf[_0x6366('0x60')][_0x6366('0x70')][_0x30c429],'ChatQueueId':_0x5ab4bf[_0x6366('0x57')]['id']});}return _0x2a1087;});}})[_0x6366('0x34')](respondWithResult(_0x133e2d,null))[_0x6366('0x28')](handleError(_0x133e2d,null));};exports[_0x6366('0x90')]=function(_0x3137b0,_0x348d85,_0x449a25){return db[_0x6366('0x52')]['find']({'where':{'id':_0x3137b0[_0x6366('0x57')]['id']}})[_0x6366('0x34')](handleEntityNotFound(_0x348d85,null))['then'](function(_0x17de79){if(_0x17de79){return _0x17de79['removeAgents'](_0x3137b0[_0x6366('0x43')][_0x6366('0x70')])[_0x6366('0x34')](function(){if(_[_0x6366('0x91')](_0x3137b0['query'][_0x6366('0x70')])){for(var _0x5cad26=0x0;_0x5cad26<_0x3137b0[_0x6366('0x43')][_0x6366('0x70')][_0x6366('0x58')];_0x5cad26+=0x1){socket[_0x6366('0x78')]('userChatQueue:remove',{'UserId':Number(_0x3137b0[_0x6366('0x43')][_0x6366('0x70')][_0x5cad26]),'ChatQueueId':Number(_0x3137b0[_0x6366('0x57')]['id'])});}}else{socket[_0x6366('0x78')](_0x6366('0x8d'),{'UserId':Number(_0x3137b0['query'][_0x6366('0x70')]),'ChatQueueId':Number(_0x3137b0[_0x6366('0x57')]['id'])});}});}})[_0x6366('0x34')](respondWithStatusCode(_0x348d85,null))[_0x6366('0x28')](handleError(_0x348d85,null));};exports['getAgents']=function(_0x21f54d,_0x2e60e8,_0x151995){var _0x7d9dec={};var _0x13ed83={};var _0x323bf5;var _0x50f805;return db[_0x6366('0x52')][_0x6366('0x63')]({'where':{'id':_0x21f54d[_0x6366('0x57')]['id']}})[_0x6366('0x34')](handleEntityNotFound(_0x2e60e8,null))[_0x6366('0x34')](function(_0x47164e){if(_0x47164e){_0x323bf5=_0x47164e;_0x13ed83[_0x6366('0x41')]=_[_0x6366('0x44')](db[_0x6366('0x66')]['rawAttributes']);_0x13ed83[_0x6366('0x43')]=_[_0x6366('0x44')](_0x21f54d[_0x6366('0x43')]);_0x13ed83['filters']=_['intersection'](_0x13ed83['model'],_0x13ed83[_0x6366('0x43')]);_0x7d9dec[_0x6366('0x47')]=_['intersection'](_0x13ed83['model'],qs[_0x6366('0x48')](_0x21f54d[_0x6366('0x43')]['fields']));_0x7d9dec[_0x6366('0x47')]=_0x7d9dec['attributes'][_0x6366('0x58')]?_0x7d9dec[_0x6366('0x47')]:_0x13ed83['model'];_0x7d9dec[_0x6366('0x4b')]=qs[_0x6366('0x4c')](_0x21f54d[_0x6366('0x43')][_0x6366('0x4c')]);_0x7d9dec['where']=qs[_0x6366('0x45')](_[_0x6366('0x4e')](_0x21f54d[_0x6366('0x43')],_0x13ed83[_0x6366('0x45')]));if(_0x21f54d[_0x6366('0x43')][_0x6366('0x4f')]){_0x7d9dec[_0x6366('0x4d')]=_[_0x6366('0x50')](_0x7d9dec[_0x6366('0x4d')],{'$or':_[_0x6366('0x3c')](_0x7d9dec[_0x6366('0x47')],function(_0x1553e2){var _0x1b88ad={};_0x1b88ad[_0x1553e2]={'$like':'%'+_0x21f54d[_0x6366('0x43')]['filter']+'%'};return _0x1b88ad;})});}_0x7d9dec=_[_0x6366('0x50')]({},_0x7d9dec,_0x21f54d[_0x6366('0x51')]);return _0x323bf5[_0x6366('0x92')](_0x7d9dec);}})[_0x6366('0x34')](function(_0x830b){if(_0x830b){_0x50f805=_0x830b['length'];if(!_0x21f54d[_0x6366('0x43')][_0x6366('0x49')](_0x6366('0x4a'))){_0x7d9dec[_0x6366('0x2d')]=qs['limit'](_0x21f54d[_0x6366('0x43')][_0x6366('0x2d')]);_0x7d9dec[_0x6366('0x2c')]=qs['offset'](_0x21f54d[_0x6366('0x43')][_0x6366('0x2c')]);}return _0x323bf5[_0x6366('0x92')](_0x7d9dec);}})[_0x6366('0x34')](function(_0x21dd5f){if(_0x21dd5f){return _0x21dd5f?{'count':_0x50f805,'rows':_0x21dd5f}:null;}})[_0x6366('0x34')](respondWithResult(_0x2e60e8,null))[_0x6366('0x28')](handleError(_0x2e60e8,null));};
\ No newline at end of file
index 4b8ba3e..cd53779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x38580d,_0x9fe31){var _0x4201e7=function(_0x4e7240){while(--_0x4e7240){_0x38580d['push'](_0x38580d['shift']());}};_0x4201e7(++_0x9fe31);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c2407,_0x3c9a47){_0x3c2407=_0x3c2407-0x0;var _0x5d2eac=_0xb10b[_0x3c2407];return _0x5d2eac;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x1b6657,_0x4cfe1c){var _0x3c1bbe=function(_0x3163da){while(--_0x3163da){_0x1b6657['push'](_0x1b6657['shift']());}};_0x3c1bbe(++_0x4cfe1c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x162d33,_0x49b23d){_0x162d33=_0x162d33-0x0;var _0x55fa06=_0x5f2f[_0x162d33];return _0x55fa06;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents;
\ No newline at end of file
index 0136f7a..e7e9379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f0e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x7f0e,0xb3));var _0xe7f0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7f0e[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xe7f0('0x0'));var util=require(_0xe7f0('0x1'));var logger=require(_0xe7f0('0x2'))(_0xe7f0('0x3'));var moment=require(_0xe7f0('0x4'));var BPromise=require(_0xe7f0('0x5'));var rp=require(_0xe7f0('0x6'));var fs=require('fs');var path=require(_0xe7f0('0x7'));var rimraf=require(_0xe7f0('0x8'));var config=require(_0xe7f0('0x9'));var attributes=require(_0xe7f0('0xa'));module[_0xe7f0('0xb')]=function(_0x5af7a8,_0x7ca0eb){return _0x5af7a8[_0xe7f0('0xc')](_0xe7f0('0xd'),attributes,{'tableName':_0xe7f0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x865c=['moment','bluebird','request-promise','./chatQueue.attributes','exports','define','chat_queues','lodash'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x865c,0x1a7));var _0xc865=function(_0x1e26da,_0x4320ff){_0x1e26da=_0x1e26da-0x0;var _0xee354d=_0x865c[_0x1e26da];return _0xee354d;};'use strict';var _=require(_0xc865('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc865('0x1'));var BPromise=require(_0xc865('0x2'));var rp=require(_0xc865('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc865('0x4'));module[_0xc865('0x5')]=function(_0x52d175,_0x31e2b9){return _0x52d175[_0xc865('0x6')]('ChatQueue',attributes,{'tableName':_0xc865('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 00daa6c..ca7b8ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','ChatQueue','findAll','options','raw','where','attributes','include','map','model','GetChatQueue','catch','ShowChatQueue','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1f93fc,_0x21f839){var _0x3b2278=function(_0x46d0e6){while(--_0x46d0e6){_0x1f93fc['push'](_0x1f93fc['shift']());}};_0x3b2278(++_0x21f839);}(_0x0b0e,0x187));var _0xe0b0=function(_0x359377,_0x1a63ef){_0x359377=_0x359377-0x0;var _0x8be18a=_0x0b0e[_0x359377];return _0x8be18a;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('ChatQueue,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('ChatQueue,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('ChatQueue,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['GetChatQueue']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')]({'raw':_0x10cde1[_0xe0b0('0x1d')]?_0x10cde1[_0xe0b0('0x1d')][_0xe0b0('0x1e')]===undefined?!![]:![]:!![],'where':_0x10cde1['options']?_0x10cde1['options'][_0xe0b0('0x1f')]||null:null,'attributes':_0x10cde1['options']?_0x10cde1[_0xe0b0('0x1d')][_0xe0b0('0x20')]||null:null,'limit':_0x10cde1['options']?_0x10cde1[_0xe0b0('0x1d')]['limit']||null:null,'include':_0x10cde1[_0xe0b0('0x1d')]?_0x10cde1['options'][_0xe0b0('0x21')]?_['map'](_0x10cde1[_0xe0b0('0x1d')]['include'],function(_0x4700cc){return{'model':db[_0x4700cc['model']],'as':_0x4700cc['as'],'attributes':_0x4700cc[_0xe0b0('0x20')],'include':_0x4700cc['include']?_[_0xe0b0('0x22')](_0x4700cc[_0xe0b0('0x21')],function(_0x1f1ebd){return{'model':db[_0x1f1ebd[_0xe0b0('0x23')]],'as':_0x1f1ebd['as'],'attributes':_0x1f1ebd[_0xe0b0('0x20')],'include':_0x1f1ebd[_0xe0b0('0x21')]?_['map'](_0x1f1ebd[_0xe0b0('0x21')],function(_0x1b8aa8){return{'model':db[_0x1b8aa8['model']],'as':_0x1b8aa8['as'],'attributes':_0x1b8aa8[_0xe0b0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0x10')](function(_0x36d137){logger[_0xe0b0('0x11')](_0xe0b0('0x24'),_0x10cde1);logger[_0xe0b0('0x13')](_0xe0b0('0x24'),_0x10cde1,JSON['stringify'](_0x36d137));_0x472286(_0x36d137);})[_0xe0b0('0x25')](function(_0x3c0109){logger['error']('GetChatQueue',_0x3c0109[_0xe0b0('0x19')],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x3c0109[_0xe0b0('0x19')]));});});};exports[_0xe0b0('0x26')]=function(_0x2ab1b1){var _0x5866e5=this;return new Promise(function(_0x32acfe,_0x3231fc){return db[_0xe0b0('0x1b')][_0xe0b0('0x27')]({'raw':_0x2ab1b1[_0xe0b0('0x1d')]?_0x2ab1b1['options'][_0xe0b0('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ab1b1[_0xe0b0('0x1d')]?_0x2ab1b1[_0xe0b0('0x1d')][_0xe0b0('0x1f')]||null:null,'attributes':_0x2ab1b1[_0xe0b0('0x1d')]?_0x2ab1b1[_0xe0b0('0x1d')][_0xe0b0('0x20')]||null:null,'include':_0x2ab1b1[_0xe0b0('0x1d')]?_0x2ab1b1[_0xe0b0('0x1d')][_0xe0b0('0x21')]?_[_0xe0b0('0x22')](_0x2ab1b1[_0xe0b0('0x1d')][_0xe0b0('0x21')],function(_0x2a1c44){return{'model':db[_0x2a1c44[_0xe0b0('0x23')]],'as':_0x2a1c44['as'],'attributes':_0x2a1c44['attributes'],'include':_0x2a1c44[_0xe0b0('0x21')]?_[_0xe0b0('0x22')](_0x2a1c44[_0xe0b0('0x21')],function(_0x1eb3f9){return{'model':db[_0x1eb3f9[_0xe0b0('0x23')]],'as':_0x1eb3f9['as'],'attributes':_0x1eb3f9[_0xe0b0('0x20')],'include':_0x1eb3f9[_0xe0b0('0x21')]?_['map'](_0x1eb3f9['include'],function(_0x549d9a){return{'model':db[_0x549d9a['model']],'as':_0x549d9a['as'],'attributes':_0x549d9a[_0xe0b0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0x10')](function(_0xe6f635){logger['info'](_0xe0b0('0x26'),_0x2ab1b1);logger[_0xe0b0('0x13')](_0xe0b0('0x26'),_0x2ab1b1,JSON[_0xe0b0('0x15')](_0xe6f635));_0x32acfe(_0xe6f635);})['catch'](function(_0xed3226){logger[_0xe0b0('0x16')](_0xe0b0('0x26'),_0xed3226[_0xe0b0('0x19')],_0x2ab1b1);_0x3231fc(_0x5866e5[_0xe0b0('0x16')](0x1f4,_0xed3226[_0xe0b0('0x19')]));});});};
\ No newline at end of file
+var _0xdf62=['code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','then','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2cf22d,_0x5e0808){var _0x1f476f=function(_0x4f5a15){while(--_0x4f5a15){_0x2cf22d['push'](_0x2cf22d['shift']());}};_0x1f476f(++_0x5e0808);}(_0xdf62,0x151));var _0x2df6=function(_0x330538,_0x170937){_0x330538=_0x330538-0x0;var _0x41471d=_0xdf62[_0x330538];return _0x41471d;};'use strict';var _=require(_0x2df6('0x0'));var util=require(_0x2df6('0x1'));var moment=require(_0x2df6('0x2'));var BPromise=require(_0x2df6('0x3'));var rs=require(_0x2df6('0x4'));var fs=require('fs');var Redis=require(_0x2df6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2df6('0x6'))(_0x2df6('0x7'));var config=require(_0x2df6('0x8'));var jayson=require(_0x2df6('0x9'));var client=jayson[_0x2df6('0xa')][_0x2df6('0xb')]({'port':0x232a});config[_0x2df6('0xc')]=_['defaults'](config[_0x2df6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2df6('0xd'))(new Redis(config[_0x2df6('0xc')]));require(_0x2df6('0xe'))[_0x2df6('0xf')](socket);function respondWithRpcPromise(_0x4928b0,_0x51072c,_0x1df717){return new BPromise(function(_0x2f9dc8,_0x1377cb){return client[_0x2df6('0x10')](_0x4928b0,_0x1df717)['then'](function(_0x228356){logger[_0x2df6('0x11')]('ChatQueue,\x20%s,\x20%s',_0x51072c,_0x2df6('0x12'));logger[_0x2df6('0x13')](_0x2df6('0x14'),_0x51072c,_0x2df6('0x12'),JSON[_0x2df6('0x15')](_0x228356));if(_0x228356['error']){if(_0x228356[_0x2df6('0x16')][_0x2df6('0x17')]===0x1f4){logger[_0x2df6('0x16')](_0x2df6('0x18'),_0x51072c,_0x228356[_0x2df6('0x16')]['message']);return _0x1377cb(_0x228356[_0x2df6('0x16')][_0x2df6('0x19')]);}logger[_0x2df6('0x16')](_0x2df6('0x18'),_0x51072c,_0x228356[_0x2df6('0x16')]['message']);return _0x2f9dc8(_0x228356[_0x2df6('0x16')][_0x2df6('0x19')]);}else{logger[_0x2df6('0x11')](_0x2df6('0x18'),_0x51072c,_0x2df6('0x12'));_0x2f9dc8(_0x228356['result'][_0x2df6('0x19')]);}})[_0x2df6('0x1a')](function(_0x34324a){logger[_0x2df6('0x16')](_0x2df6('0x18'),_0x51072c,_0x34324a);_0x1377cb(_0x34324a);});});}exports[_0x2df6('0x1b')]=function(_0x24aa14){var _0x4b8636=this;return new Promise(function(_0x41f6c3,_0x18da98){return db[_0x2df6('0x1c')]['findAll']({'raw':_0x24aa14[_0x2df6('0x1d')]?_0x24aa14[_0x2df6('0x1d')][_0x2df6('0x1e')]===undefined?!![]:![]:!![],'where':_0x24aa14['options']?_0x24aa14[_0x2df6('0x1d')][_0x2df6('0x1f')]||null:null,'attributes':_0x24aa14[_0x2df6('0x1d')]?_0x24aa14[_0x2df6('0x1d')][_0x2df6('0x20')]||null:null,'limit':_0x24aa14[_0x2df6('0x1d')]?_0x24aa14[_0x2df6('0x1d')][_0x2df6('0x21')]||null:null,'include':_0x24aa14[_0x2df6('0x1d')]?_0x24aa14[_0x2df6('0x1d')][_0x2df6('0x22')]?_[_0x2df6('0x23')](_0x24aa14['options']['include'],function(_0x19bbc0){return{'model':db[_0x19bbc0[_0x2df6('0x24')]],'as':_0x19bbc0['as'],'attributes':_0x19bbc0[_0x2df6('0x20')],'include':_0x19bbc0['include']?_[_0x2df6('0x23')](_0x19bbc0[_0x2df6('0x22')],function(_0x4abd1a){return{'model':db[_0x4abd1a[_0x2df6('0x24')]],'as':_0x4abd1a['as'],'attributes':_0x4abd1a['attributes'],'include':_0x4abd1a[_0x2df6('0x22')]?_['map'](_0x4abd1a[_0x2df6('0x22')],function(_0x5b0a98){return{'model':db[_0x5b0a98[_0x2df6('0x24')]],'as':_0x5b0a98['as'],'attributes':_0x5b0a98[_0x2df6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2df6('0x25')](function(_0x376998){logger['info'](_0x2df6('0x1b'),_0x24aa14);logger['debug']('GetChatQueue',_0x24aa14,JSON[_0x2df6('0x15')](_0x376998));_0x41f6c3(_0x376998);})[_0x2df6('0x1a')](function(_0x2c298b){logger['error'](_0x2df6('0x1b'),_0x2c298b[_0x2df6('0x19')],_0x24aa14);_0x18da98(_0x4b8636[_0x2df6('0x16')](0x1f4,_0x2c298b[_0x2df6('0x19')]));});});};exports[_0x2df6('0x26')]=function(_0x246505){var _0x23c6da=this;return new Promise(function(_0x56f86a,_0x240045){return db[_0x2df6('0x1c')][_0x2df6('0x27')]({'raw':_0x246505[_0x2df6('0x1d')]?_0x246505['options'][_0x2df6('0x1e')]===undefined?!![]:![]:!![],'where':_0x246505['options']?_0x246505['options'][_0x2df6('0x1f')]||null:null,'attributes':_0x246505[_0x2df6('0x1d')]?_0x246505[_0x2df6('0x1d')][_0x2df6('0x20')]||null:null,'include':_0x246505['options']?_0x246505[_0x2df6('0x1d')][_0x2df6('0x22')]?_[_0x2df6('0x23')](_0x246505[_0x2df6('0x1d')][_0x2df6('0x22')],function(_0x18d63f){return{'model':db[_0x18d63f['model']],'as':_0x18d63f['as'],'attributes':_0x18d63f[_0x2df6('0x20')],'include':_0x18d63f[_0x2df6('0x22')]?_['map'](_0x18d63f[_0x2df6('0x22')],function(_0x3835b3){return{'model':db[_0x3835b3[_0x2df6('0x24')]],'as':_0x3835b3['as'],'attributes':_0x3835b3[_0x2df6('0x20')],'include':_0x3835b3[_0x2df6('0x22')]?_[_0x2df6('0x23')](_0x3835b3['include'],function(_0x3733af){return{'model':db[_0x3733af[_0x2df6('0x24')]],'as':_0x3733af['as'],'attributes':_0x3733af[_0x2df6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2df6('0x25')](function(_0x392d46){logger[_0x2df6('0x11')]('ShowChatQueue',_0x246505);logger['debug'](_0x2df6('0x26'),_0x246505,JSON['stringify'](_0x392d46));_0x56f86a(_0x392d46);})['catch'](function(_0x4b62cc){logger[_0x2df6('0x16')](_0x2df6('0x26'),_0x4b62cc['message'],_0x246505);_0x240045(_0x23c6da[_0x2df6('0x16')](0x1f4,_0x4b62cc[_0x2df6('0x19')]));});});};
\ No newline at end of file
index 56101ac..df59254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x57ff3d,_0x551fbd){var _0xf4ab01=function(_0x82ffcb){while(--_0x82ffcb){_0x57ff3d['push'](_0x57ff3d['shift']());}};_0xf4ab01(++_0x551fbd);}(_0xb10b,0x12a));var _0xbb10=function(_0x385567,_0x40550f){_0x385567=_0x385567-0x0;var _0x49cf95=_0xb10b[_0x385567];return _0x49cf95;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
+var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0xec1b03,_0x1ed76f){var _0x140c51=function(_0x2081cb){while(--_0x2081cb){_0xec1b03['push'](_0xec1b03['shift']());}};_0x140c51(++_0x1ed76f);}(_0xb10b,0x12a));var _0xbb10=function(_0x213721,_0xc41653){_0x213721=_0x213721-0x0;var _0x6435ee=_0xb10b[_0x213721];return _0x6435ee;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
index 14ef9be..a0e5287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8198=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2e0b14,_0x171984){var _0x8ee031=function(_0x36641b){while(--_0x36641b){_0x2e0b14['push'](_0x2e0b14['shift']());}};_0x8ee031(++_0x171984);}(_0x8198,0x9b));var _0x8819=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x8198[_0x12a2a6];return _0x1754ae;};'use strict';var multer=require(_0x8819('0x0'));var util=require('util');var path=require(_0x8819('0x1'));var timeout=require(_0x8819('0x2'));var express=require('express');var router=express[_0x8819('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8819('0x4'));var config=require(_0x8819('0x5'));var controller=require('./chatQueue.controller');router[_0x8819('0x6')]('/',auth[_0x8819('0x7')](),controller[_0x8819('0x8')]);router['get'](_0x8819('0x9'),auth[_0x8819('0x7')](),controller[_0x8819('0xa')]);router[_0x8819('0x6')](_0x8819('0xb'),auth[_0x8819('0x7')](),controller[_0x8819('0xc')]);router['get'](_0x8819('0xd'),auth[_0x8819('0x7')](),controller[_0x8819('0xe')]);router['get'](_0x8819('0xf'),auth[_0x8819('0x7')](),controller[_0x8819('0x10')]);router['get'](_0x8819('0x11'),auth[_0x8819('0x7')](),controller['getAgents']);router['post']('/',auth[_0x8819('0x7')](),controller[_0x8819('0x12')]);router[_0x8819('0x13')](_0x8819('0xf'),auth[_0x8819('0x7')](),controller[_0x8819('0x14')]);router[_0x8819('0x13')](_0x8819('0x11'),auth[_0x8819('0x7')](),controller[_0x8819('0x15')]);router[_0x8819('0x16')](_0x8819('0xb'),auth[_0x8819('0x7')](),controller[_0x8819('0x17')]);router['delete'](_0x8819('0xb'),auth[_0x8819('0x7')](),controller[_0x8819('0x18')]);router[_0x8819('0x19')](_0x8819('0xf'),auth[_0x8819('0x7')](),controller['removeTeams']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x8819('0x1a')]);module[_0x8819('0x1b')]=router;
\ No newline at end of file
+var _0xa16f=['get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller'];(function(_0x2d0b15,_0x315b77){var _0x40f821=function(_0x16e576){while(--_0x16e576){_0x2d0b15['push'](_0x2d0b15['shift']());}};_0x40f821(++_0x315b77);}(_0xa16f,0xd9));var _0xfa16=function(_0x1acc2a,_0x4ce0dc){_0x1acc2a=_0x1acc2a-0x0;var _0x4ef342=_0xa16f[_0x1acc2a];return _0x4ef342;};'use strict';var multer=require(_0xfa16('0x0'));var util=require(_0xfa16('0x1'));var path=require('path');var timeout=require(_0xfa16('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xfa16('0x3'));var interaction=require(_0xfa16('0x4'));var config=require(_0xfa16('0x5'));var controller=require(_0xfa16('0x6'));router[_0xfa16('0x7')]('/',auth[_0xfa16('0x8')](),controller[_0xfa16('0x9')]);router[_0xfa16('0x7')](_0xfa16('0xa'),auth[_0xfa16('0x8')](),controller[_0xfa16('0xb')]);router[_0xfa16('0x7')]('/:id',auth[_0xfa16('0x8')](),controller[_0xfa16('0xc')]);router[_0xfa16('0x7')]('/:id/members',auth[_0xfa16('0x8')](),controller[_0xfa16('0xd')]);router[_0xfa16('0x7')](_0xfa16('0xe'),auth[_0xfa16('0x8')](),controller[_0xfa16('0xf')]);router[_0xfa16('0x7')](_0xfa16('0x10'),auth[_0xfa16('0x8')](),controller[_0xfa16('0x11')]);router[_0xfa16('0x12')]('/',auth['isAuthenticated'](),controller[_0xfa16('0x13')]);router[_0xfa16('0x12')](_0xfa16('0xe'),auth[_0xfa16('0x8')](),controller[_0xfa16('0x14')]);router[_0xfa16('0x12')]('/:id/users',auth[_0xfa16('0x8')](),controller[_0xfa16('0x15')]);router[_0xfa16('0x16')](_0xfa16('0x17'),auth['isAuthenticated'](),controller[_0xfa16('0x18')]);router[_0xfa16('0x19')](_0xfa16('0x17'),auth['isAuthenticated'](),controller[_0xfa16('0x1a')]);router['delete'](_0xfa16('0xe'),auth[_0xfa16('0x8')](),controller[_0xfa16('0x1b')]);router['delete'](_0xfa16('0x10'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 381cc6e..c8a48c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe9f=['sequelize','exports','STRING','DATE','moment'];(function(_0x9b3547,_0x3807c0){var _0x15f2cb=function(_0xc20b49){while(--_0xc20b49){_0x9b3547['push'](_0x9b3547['shift']());}};_0x15f2cb(++_0x3807c0);}(_0xbe9f,0x19e));var _0xfbe9=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xbe9f[_0x49b207];return _0x2dc8fa;};'use strict';var moment=require(_0xfbe9('0x0'));var Sequelize=require(_0xfbe9('0x1'));module[_0xfbe9('0x2')]={'uniqueid':{'type':Sequelize[_0xfbe9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfbe9('0x3')]},'joinAt':{'type':Sequelize[_0xfbe9('0x4')]},'leaveAt':{'type':Sequelize[_0xfbe9('0x4')]},'acceptAt':{'type':Sequelize[_0xfbe9('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfbe9('0x3')]}};
\ No newline at end of file
+var _0xffcc=['DATE','STRING','moment','exports'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xffcc,0x76));var _0xcffc=function(_0x574839,_0x2f3943){_0x574839=_0x574839-0x0;var _0x269d2e=_0xffcc[_0x574839];return _0x269d2e;};'use strict';var moment=require(_0xcffc('0x0'));var Sequelize=require('sequelize');module[_0xcffc('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcffc('0x2')]},'reason':{'type':Sequelize[_0xcffc('0x3')]}};
\ No newline at end of file
index 9295919..968bb78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['count','findAll','rows','catch','params','keys','includeAll','include','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','options','ChatQueueReport'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x757a,0xde));var _0xa757=function(_0x1449fc,_0x5f15ed){_0x1449fc=_0x1449fc-0x0;var _0x4a4a83=_0x757a[_0x1449fc];return _0x4a4a83;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');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('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var as=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))(_0xa757('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56acfb,_0x4db68e){_0x4db68e=_0x4db68e||0xcc;return function(_0x421040){if(_0x421040){return _0x56acfb['sendStatus'](_0x4db68e);}return _0x56acfb['status'](_0x4db68e)[_0xa757('0x16')]();};}function respondWithResult(_0x513b1f,_0x481508){_0x481508=_0x481508||0xc8;return function(_0x32112b){if(_0x32112b){return _0x513b1f[_0xa757('0x17')](_0x481508)[_0xa757('0x18')](_0x32112b);}};}function respondWithFilteredResult(_0x4a0c38,_0x86abd){return function(_0x31cfd2){if(_0x31cfd2){var _0xf12b68=_0x31cfd2['count'],_0x2f7947=_0x86abd[_0xa757('0x19')],_0x185011=_0x86abd[_0xa757('0x19')]+_0x86abd[_0xa757('0x1a')],_0x3df1f9;if(_0x185011>=_0xf12b68){_0x185011=_0xf12b68;_0x3df1f9=0xc8;}else{_0x3df1f9=0xce;}_0x4a0c38['status'](_0x3df1f9);return _0x4a0c38['set'](_0xa757('0x1b'),_0x2f7947+'-'+_0x185011+'/'+_0xf12b68)[_0xa757('0x18')](_0x31cfd2);}return null;};}function patchUpdates(_0x1bd14c){return function(_0x340599){try{jsonpatch[_0xa757('0x1c')](_0x340599,_0x1bd14c,!![]);}catch(_0xe2d567){return BPromise['reject'](_0xe2d567);}return _0x340599[_0xa757('0x1d')]();};}function saveUpdates(_0x4fec52,_0x32c2a1){return function(_0x167640){if(_0x167640){return _0x167640[_0xa757('0x1e')](_0x4fec52)[_0xa757('0x1f')](function(_0x4d598c){return _0x4d598c;});}return null;};}function removeEntity(_0x5638c7,_0x40ec48){return function(_0x2159cf){if(_0x2159cf){return _0x2159cf[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x5638c7[_0xa757('0x17')](0xcc)[_0xa757('0x16')]();});}};}function handleEntityNotFound(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(!_0x2bf276){_0x2ca10d['sendStatus'](0x194);}return _0x2bf276;};}function handleError(_0x3707c1,_0x59e9d4){_0x59e9d4=_0x59e9d4||0x1f4;return function(_0x422e9e){logger['error'](_0x422e9e[_0xa757('0x21')]);if(_0x422e9e[_0xa757('0x22')]){delete _0x422e9e[_0xa757('0x22')];}_0x3707c1['status'](_0x59e9d4)[_0xa757('0x23')](_0x422e9e);};}exports[_0xa757('0x24')]=function(_0x471e84,_0x3bf7f3){var _0x5b4779={},_0x449a7d={},_0x54263b={'count':0x0,'rows':[]};var _0x5a5664=_['map'](db['ChatQueueReport'][_0xa757('0x25')],function(_0x596ae2){return{'name':_0x596ae2[_0xa757('0x26')],'type':_0x596ae2[_0xa757('0x27')]['key']};});_0x449a7d[_0xa757('0x28')]=_['map'](_0x5a5664,_0xa757('0x22'));_0x449a7d[_0xa757('0x29')]=_['keys'](_0x471e84[_0xa757('0x29')]);_0x449a7d['filters']=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],_0x449a7d[_0xa757('0x29')]);_0x5b4779[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x471e84[_0xa757('0x29')][_0xa757('0x2c')]));_0x5b4779[_0xa757('0x2b')]=_0x5b4779[_0xa757('0x2b')][_0xa757('0x2d')]?_0x5b4779[_0xa757('0x2b')]:_0x449a7d[_0xa757('0x28')];if(!_0x471e84[_0xa757('0x29')][_0xa757('0x2e')](_0xa757('0x2f'))){_0x5b4779[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x471e84[_0xa757('0x29')][_0xa757('0x1a')]);_0x5b4779[_0xa757('0x19')]=qs[_0xa757('0x19')](_0x471e84[_0xa757('0x29')]['offset']);}_0x5b4779[_0xa757('0x30')]=qs[_0xa757('0x31')](_0x471e84[_0xa757('0x29')][_0xa757('0x31')]);_0x5b4779[_0xa757('0x32')]=qs['filters'](_[_0xa757('0x33')](_0x471e84[_0xa757('0x29')],_0x449a7d[_0xa757('0x34')]),_0x5a5664);if(_0x471e84[_0xa757('0x29')][_0xa757('0x35')]){_0x5b4779[_0xa757('0x32')]=_['merge'](_0x5b4779[_0xa757('0x32')],{'$or':_[_0xa757('0x36')](_0x5a5664,function(_0x2cade7){if(_0x2cade7[_0xa757('0x27')]!==_0xa757('0x37')){var _0x111cfe={};_0x111cfe[_0x2cade7[_0xa757('0x22')]]={'$like':'%'+_0x471e84[_0xa757('0x29')][_0xa757('0x35')]+'%'};return _0x111cfe;}})});}_0x5b4779=_['merge']({},_0x5b4779,_0x471e84[_0xa757('0x38')]);var _0x34fba8={'where':_0x5b4779[_0xa757('0x32')]};return db[_0xa757('0x39')][_0xa757('0x3a')](_0x34fba8)[_0xa757('0x1f')](function(_0x501e26){_0x54263b[_0xa757('0x3a')]=_0x501e26;if(_0x471e84[_0xa757('0x29')]['includeAll']){_0x5b4779['include']=[{'all':!![]}];}return db[_0xa757('0x39')][_0xa757('0x3b')](_0x5b4779);})['then'](function(_0x51c3d1){_0x54263b[_0xa757('0x3c')]=_0x51c3d1;return _0x54263b;})[_0xa757('0x1f')](respondWithFilteredResult(_0x3bf7f3,_0x5b4779))[_0xa757('0x3d')](handleError(_0x3bf7f3,null));};exports['show']=function(_0x830dc4,_0x13a8f4){var _0x26802c={'raw':!![],'where':{'id':_0x830dc4[_0xa757('0x3e')]['id']}},_0x1ba399={};_0x1ba399['model']=_[_0xa757('0x3f')](db['ChatQueueReport']['rawAttributes']);_0x1ba399[_0xa757('0x29')]=_[_0xa757('0x3f')](_0x830dc4[_0xa757('0x29')]);_0x1ba399[_0xa757('0x34')]=_[_0xa757('0x2a')](_0x1ba399['model'],_0x1ba399['query']);_0x26802c[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x1ba399[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x830dc4[_0xa757('0x29')][_0xa757('0x2c')]));_0x26802c['attributes']=_0x26802c[_0xa757('0x2b')][_0xa757('0x2d')]?_0x26802c['attributes']:_0x1ba399[_0xa757('0x28')];if(_0x830dc4['query'][_0xa757('0x40')]){_0x26802c[_0xa757('0x41')]=[{'all':!![]}];}_0x26802c=_['merge']({},_0x26802c,_0x830dc4[_0xa757('0x38')]);return db[_0xa757('0x39')]['find'](_0x26802c)[_0xa757('0x1f')](handleEntityNotFound(_0x13a8f4,null))[_0xa757('0x1f')](respondWithResult(_0x13a8f4,null))[_0xa757('0x3d')](handleError(_0x13a8f4,null));};exports[_0xa757('0x42')]=function(_0x543b5b,_0x199dc9){return db[_0xa757('0x39')][_0xa757('0x42')](_0x543b5b[_0xa757('0x43')],{})['then'](respondWithResult(_0x199dc9,0xc9))[_0xa757('0x3d')](handleError(_0x199dc9,null));};exports['update']=function(_0x50c131,_0x2acf88){if(_0x50c131[_0xa757('0x43')]['id']){delete _0x50c131[_0xa757('0x43')]['id'];}return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x50c131['params']['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x2acf88,null))[_0xa757('0x1f')](saveUpdates(_0x50c131[_0xa757('0x43')],null))[_0xa757('0x1f')](respondWithResult(_0x2acf88,null))[_0xa757('0x3d')](handleError(_0x2acf88,null));};exports[_0xa757('0x20')]=function(_0x57bf73,_0x505cd){return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x57bf73[_0xa757('0x3e')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x505cd,null))[_0xa757('0x1f')](removeEntity(_0x505cd,null))[_0xa757('0x3d')](handleError(_0x505cd,null));};exports[_0xa757('0x45')]=function(_0x15bad7,_0x2c5b3c){return db[_0xa757('0x39')][_0xa757('0x45')]()[_0xa757('0x1f')](respondWithResult(_0x2c5b3c,null))[_0xa757('0x3d')](handleError(_0x2c5b3c,null));};
\ No newline at end of file
+var _0xbaf0=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x2c4bb5,_0x2d0a38){var _0x5dc002=function(_0x5c11ce){while(--_0x5c11ce){_0x2c4bb5['push'](_0x2c4bb5['shift']());}};_0x5dc002(++_0x2d0a38);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a53e2,_0x465dd7){_0x465dd7=_0x465dd7||0xcc;return function(_0xe4378c){if(_0xe4378c){return _0x5a53e2[_0x0baf('0x1b')](_0x465dd7);}return _0x5a53e2[_0x0baf('0x1c')](_0x465dd7)['end']();};}function respondWithResult(_0x2ab33e,_0x49e44b){_0x49e44b=_0x49e44b||0xc8;return function(_0x1c76a8){if(_0x1c76a8){return _0x2ab33e[_0x0baf('0x1c')](_0x49e44b)[_0x0baf('0x1d')](_0x1c76a8);}};}function respondWithFilteredResult(_0x2bc381,_0xb8339e){return function(_0x469599){if(_0x469599){var _0x4f80a8=_0x469599[_0x0baf('0x1e')],_0x4cd79d=_0xb8339e[_0x0baf('0x1f')],_0x2312c7=_0xb8339e[_0x0baf('0x1f')]+_0xb8339e[_0x0baf('0x20')],_0x38395b;if(_0x2312c7>=_0x4f80a8){_0x2312c7=_0x4f80a8;_0x38395b=0xc8;}else{_0x38395b=0xce;}_0x2bc381['status'](_0x38395b);return _0x2bc381[_0x0baf('0x21')](_0x0baf('0x22'),_0x4cd79d+'-'+_0x2312c7+'/'+_0x4f80a8)[_0x0baf('0x1d')](_0x469599);}return null;};}function patchUpdates(_0x3e9cb4){return function(_0x47070d){try{jsonpatch[_0x0baf('0x23')](_0x47070d,_0x3e9cb4,!![]);}catch(_0x4ff793){return BPromise['reject'](_0x4ff793);}return _0x47070d[_0x0baf('0x24')]();};}function saveUpdates(_0x154f48,_0x32e839){return function(_0x1848e8){if(_0x1848e8){return _0x1848e8[_0x0baf('0x25')](_0x154f48)[_0x0baf('0x26')](function(_0x210cd8){return _0x210cd8;});}return null;};}function removeEntity(_0x636a13,_0x2c42e2){return function(_0x15a2c3){if(_0x15a2c3){return _0x15a2c3['destroy']()[_0x0baf('0x26')](function(){_0x636a13['status'](0xcc)[_0x0baf('0x27')]();});}};}function handleEntityNotFound(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(!_0x2ef0aa){_0x5dbf00['sendStatus'](0x194);}return _0x2ef0aa;};}function handleError(_0x4be1b9,_0x47c4b){_0x47c4b=_0x47c4b||0x1f4;return function(_0x27b59c){logger[_0x0baf('0x28')](_0x27b59c[_0x0baf('0x29')]);if(_0x27b59c[_0x0baf('0x2a')]){delete _0x27b59c['name'];}_0x4be1b9[_0x0baf('0x1c')](_0x47c4b)[_0x0baf('0x2b')](_0x27b59c);};}exports[_0x0baf('0x2c')]=function(_0x366e71,_0x3843b8){var _0x3b9b31={},_0x453525={},_0x549fd0={'count':0x0,'rows':[]};var _0x1590b4=_[_0x0baf('0x2d')](db[_0x0baf('0x2e')][_0x0baf('0x2f')],function(_0x55c715){return{'name':_0x55c715[_0x0baf('0x30')],'type':_0x55c715[_0x0baf('0x31')]['key']};});_0x453525[_0x0baf('0x32')]=_[_0x0baf('0x2d')](_0x1590b4,_0x0baf('0x2a'));_0x453525[_0x0baf('0x33')]=_[_0x0baf('0x34')](_0x366e71[_0x0baf('0x33')]);_0x453525[_0x0baf('0x35')]=_['intersection'](_0x453525[_0x0baf('0x32')],_0x453525[_0x0baf('0x33')]);_0x3b9b31[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x453525[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x38')]));_0x3b9b31[_0x0baf('0x36')]=_0x3b9b31[_0x0baf('0x36')][_0x0baf('0x39')]?_0x3b9b31[_0x0baf('0x36')]:_0x453525[_0x0baf('0x32')];if(!_0x366e71[_0x0baf('0x33')]['hasOwnProperty'](_0x0baf('0x3a'))){_0x3b9b31['limit']=qs[_0x0baf('0x20')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x20')]);_0x3b9b31[_0x0baf('0x1f')]=qs['offset'](_0x366e71[_0x0baf('0x33')][_0x0baf('0x1f')]);}_0x3b9b31['order']=qs[_0x0baf('0x3b')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x3b')]);_0x3b9b31[_0x0baf('0x3c')]=qs[_0x0baf('0x35')](_[_0x0baf('0x3d')](_0x366e71[_0x0baf('0x33')],_0x453525[_0x0baf('0x35')]),_0x1590b4);if(_0x366e71['query'][_0x0baf('0x3e')]){_0x3b9b31[_0x0baf('0x3c')]=_['merge'](_0x3b9b31[_0x0baf('0x3c')],{'$or':_['map'](_0x1590b4,function(_0x5c545f){if(_0x5c545f[_0x0baf('0x31')]!==_0x0baf('0x3f')){var _0x5d3ad1={};_0x5d3ad1[_0x5c545f['name']]={'$like':'%'+_0x366e71[_0x0baf('0x33')][_0x0baf('0x3e')]+'%'};return _0x5d3ad1;}})});}_0x3b9b31=_[_0x0baf('0x40')]({},_0x3b9b31,_0x366e71[_0x0baf('0x41')]);var _0x15eb5c={'where':_0x3b9b31[_0x0baf('0x3c')]};return db[_0x0baf('0x2e')][_0x0baf('0x1e')](_0x15eb5c)[_0x0baf('0x26')](function(_0x36c6d2){_0x549fd0[_0x0baf('0x1e')]=_0x36c6d2;if(_0x366e71[_0x0baf('0x33')][_0x0baf('0x42')]){_0x3b9b31[_0x0baf('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0baf('0x44')](_0x3b9b31);})[_0x0baf('0x26')](function(_0x4f1de9){_0x549fd0[_0x0baf('0x45')]=_0x4f1de9;return _0x549fd0;})[_0x0baf('0x26')](respondWithFilteredResult(_0x3843b8,_0x3b9b31))[_0x0baf('0x46')](handleError(_0x3843b8,null));};exports[_0x0baf('0x47')]=function(_0x2e20c8,_0x456d0b){var _0x57b581={'raw':!![],'where':{'id':_0x2e20c8[_0x0baf('0x48')]['id']}},_0x23ad34={};_0x23ad34['model']=_[_0x0baf('0x34')](db[_0x0baf('0x2e')][_0x0baf('0x2f')]);_0x23ad34[_0x0baf('0x33')]=_['keys'](_0x2e20c8[_0x0baf('0x33')]);_0x23ad34[_0x0baf('0x35')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],_0x23ad34[_0x0baf('0x33')]);_0x57b581[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x2e20c8[_0x0baf('0x33')]['fields']));_0x57b581[_0x0baf('0x36')]=_0x57b581[_0x0baf('0x36')][_0x0baf('0x39')]?_0x57b581[_0x0baf('0x36')]:_0x23ad34[_0x0baf('0x32')];if(_0x2e20c8['query'][_0x0baf('0x42')]){_0x57b581[_0x0baf('0x43')]=[{'all':!![]}];}_0x57b581=_[_0x0baf('0x40')]({},_0x57b581,_0x2e20c8[_0x0baf('0x41')]);return db[_0x0baf('0x2e')]['find'](_0x57b581)[_0x0baf('0x26')](handleEntityNotFound(_0x456d0b,null))[_0x0baf('0x26')](respondWithResult(_0x456d0b,null))[_0x0baf('0x46')](handleError(_0x456d0b,null));};exports[_0x0baf('0x49')]=function(_0x41599f,_0x22d10f){return db[_0x0baf('0x2e')]['create'](_0x41599f[_0x0baf('0x4a')],{})[_0x0baf('0x26')](respondWithResult(_0x22d10f,0xc9))[_0x0baf('0x46')](handleError(_0x22d10f,null));};exports['update']=function(_0x3c9de3,_0x2222b6){if(_0x3c9de3[_0x0baf('0x4a')]['id']){delete _0x3c9de3[_0x0baf('0x4a')]['id'];}return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0x3c9de3[_0x0baf('0x48')]['id']}})['then'](handleEntityNotFound(_0x2222b6,null))[_0x0baf('0x26')](saveUpdates(_0x3c9de3[_0x0baf('0x4a')],null))[_0x0baf('0x26')](respondWithResult(_0x2222b6,null))[_0x0baf('0x46')](handleError(_0x2222b6,null));};exports[_0x0baf('0x4c')]=function(_0xc427b2,_0x40d4a6){return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0xc427b2[_0x0baf('0x48')]['id']}})[_0x0baf('0x26')](handleEntityNotFound(_0x40d4a6,null))['then'](removeEntity(_0x40d4a6,null))['catch'](handleError(_0x40d4a6,null));};exports[_0x0baf('0x4d')]=function(_0x3d6b19,_0x1cd114){return db[_0x0baf('0x2e')][_0x0baf('0x4d')]()[_0x0baf('0x26')](respondWithResult(_0x1cd114,null))[_0x0baf('0x46')](handleError(_0x1cd114,null));};
\ No newline at end of file
index d68af5d..deaae5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dbe=['rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','uniqueid','lodash','util','api','bluebird','request-promise','path'];(function(_0x197043,_0x3ebf47){var _0x233e33=function(_0x17bd0f){while(--_0x17bd0f){_0x197043['push'](_0x197043['shift']());}};_0x233e33(++_0x3ebf47);}(_0x6dbe,0x10b));var _0xe6db=function(_0x1a8699,_0x4028c1){_0x1a8699=_0x1a8699-0x0;var _0x2e6042=_0x6dbe[_0x1a8699];return _0x2e6042;};'use strict';var _=require(_0xe6db('0x0'));var util=require(_0xe6db('0x1'));var logger=require('../../config/logger')(_0xe6db('0x2'));var moment=require('moment');var BPromise=require(_0xe6db('0x3'));var rp=require(_0xe6db('0x4'));var fs=require('fs');var path=require(_0xe6db('0x5'));var rimraf=require(_0xe6db('0x6'));var config=require(_0xe6db('0x7'));var attributes=require(_0xe6db('0x8'));module[_0xe6db('0x9')]=function(_0x393411,_0x10c010){return _0x393411[_0xe6db('0xa')](_0xe6db('0xb'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0xe6db('0xc'),'fields':[_0xe6db('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xafc8=['report_chat_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport'];(function(_0x2e1779,_0x427e29){var _0x485848=function(_0x181ab3){while(--_0x181ab3){_0x2e1779['push'](_0x2e1779['shift']());}};_0x485848(++_0x427e29);}(_0xafc8,0x98));var _0x8afc=function(_0xa941a4,_0x34df49){_0xa941a4=_0xa941a4-0x0;var _0x4f7fee=_0xafc8[_0xa941a4];return _0x4f7fee;};'use strict';var _=require(_0x8afc('0x0'));var util=require(_0x8afc('0x1'));var logger=require(_0x8afc('0x2'))('api');var moment=require(_0x8afc('0x3'));var BPromise=require(_0x8afc('0x4'));var rp=require(_0x8afc('0x5'));var fs=require('fs');var path=require(_0x8afc('0x6'));var rimraf=require(_0x8afc('0x7'));var config=require(_0x8afc('0x8'));var attributes=require(_0x8afc('0x9'));module[_0x8afc('0xa')]=function(_0x259d53,_0x5e4df2){return _0x259d53[_0x8afc('0xb')](_0x8afc('0xc'),attributes,{'tableName':_0x8afc('0xd'),'paranoid':![],'indexes':[{'name':_0x8afc('0xe'),'fields':[_0x8afc('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 15f17dd..d7f73ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e2=['CreateChatQueueReport','ChatQueueReport','options','raw','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','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'];(function(_0x45565e,_0x236281){var _0x45ae7c=function(_0x24038f){while(--_0x24038f){_0x45565e['push'](_0x45565e['shift']());}};_0x45ae7c(++_0x236281);}(_0x46e2,0xb7));var _0x246e=function(_0x2f5bd3,_0x2a4a14){_0x2f5bd3=_0x2f5bd3-0x0;var _0x32eef8=_0x46e2[_0x2f5bd3];return _0x32eef8;};'use strict';var _=require(_0x246e('0x0'));var util=require(_0x246e('0x1'));var moment=require(_0x246e('0x2'));var BPromise=require(_0x246e('0x3'));var rs=require(_0x246e('0x4'));var fs=require('fs');var Redis=require(_0x246e('0x5'));var db=require(_0x246e('0x6'))['db'];var utils=require(_0x246e('0x7'));var logger=require(_0x246e('0x8'))(_0x246e('0x9'));var config=require(_0x246e('0xa'));var jayson=require(_0x246e('0xb'));var client=jayson[_0x246e('0xc')][_0x246e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3d6d2e,_0x17f9fb,_0x41653d){return new BPromise(function(_0x54fdfb,_0x2b67d4){return client[_0x246e('0xe')](_0x3d6d2e,_0x41653d)[_0x246e('0xf')](function(_0x140c6d){logger[_0x246e('0x10')](_0x246e('0x11'),_0x17f9fb,_0x246e('0x12'));logger[_0x246e('0x13')](_0x246e('0x14'),_0x17f9fb,_0x246e('0x12'),JSON[_0x246e('0x15')](_0x140c6d));if(_0x140c6d[_0x246e('0x16')]){if(_0x140c6d[_0x246e('0x16')][_0x246e('0x17')]===0x1f4){logger[_0x246e('0x16')]('ChatQueueReport,\x20%s,\x20%s',_0x17f9fb,_0x140c6d[_0x246e('0x16')][_0x246e('0x18')]);return _0x2b67d4(_0x140c6d[_0x246e('0x16')]['message']);}logger[_0x246e('0x16')]('ChatQueueReport,\x20%s,\x20%s',_0x17f9fb,_0x140c6d[_0x246e('0x16')][_0x246e('0x18')]);return _0x54fdfb(_0x140c6d[_0x246e('0x16')][_0x246e('0x18')]);}else{logger[_0x246e('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x17f9fb,_0x246e('0x12'));_0x54fdfb(_0x140c6d[_0x246e('0x19')][_0x246e('0x18')]);}})[_0x246e('0x1a')](function(_0x2b44fe){logger['error'](_0x246e('0x11'),_0x17f9fb,_0x2b44fe);_0x2b67d4(_0x2b44fe);});});}exports[_0x246e('0x1b')]=function(_0x354855){var _0x50e915=this;return new Promise(function(_0x52f7f0,_0x23f300){return db[_0x246e('0x1c')]['create'](_0x354855['body'],{'raw':_0x354855['options']?_0x354855[_0x246e('0x1d')][_0x246e('0x1e')]===undefined?!![]:![]:!![]})[_0x246e('0xf')](function(_0x371100){logger[_0x246e('0x10')](_0x246e('0x1b'),_0x354855);logger[_0x246e('0x13')](_0x246e('0x1b'),_0x354855,JSON[_0x246e('0x15')](_0x371100));_0x52f7f0(_0x371100);})[_0x246e('0x1a')](function(_0x3c46b7){logger[_0x246e('0x16')](_0x246e('0x1b'),_0x3c46b7[_0x246e('0x18')],_0x354855);_0x23f300(_0x50e915[_0x246e('0x16')](0x1f4,_0x3c46b7['message']));});});};exports[_0x246e('0x1f')]=function(_0x2d8775){var _0xa92fe7=this;return new Promise(function(_0x2795df,_0x5b7695){return db[_0x246e('0x1c')][_0x246e('0x20')](_0x2d8775['body'],{'raw':_0x2d8775['options']?_0x2d8775[_0x246e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d8775[_0x246e('0x1d')]?_0x2d8775[_0x246e('0x1d')]['where']||null:null,'attributes':_0x2d8775[_0x246e('0x1d')]?_0x2d8775[_0x246e('0x1d')][_0x246e('0x21')]||null:null,'limit':_0x2d8775['options']?_0x2d8775[_0x246e('0x1d')][_0x246e('0x22')]||null:null})[_0x246e('0xf')](function(_0x196212){logger[_0x246e('0x10')](_0x246e('0x1f'),_0x2d8775);logger['debug']('UpdateChatQueueReport',_0x2d8775,JSON[_0x246e('0x15')](_0x196212));_0x2795df(_0x196212);})['catch'](function(_0x4bef5f){logger[_0x246e('0x16')]('UpdateChatQueueReport',_0x4bef5f[_0x246e('0x18')],_0x2d8775);_0x5b7695(_0xa92fe7['error'](0x1f4,_0x4bef5f[_0x246e('0x18')]));});});};
\ No newline at end of file
+var _0xcb8a=['result','catch','CreateChatQueueReport','create','options','debug','UpdateChatQueueReport','ChatQueueReport','update','body','raw','where','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xcb8a,0x10d));var _0xacb8=function(_0x45f52f,_0x219ec5){_0x45f52f=_0x45f52f-0x0;var _0x292afb=_0xcb8a[_0x45f52f];return _0x292afb;};'use strict';var _=require('lodash');var util=require(_0xacb8('0x0'));var moment=require(_0xacb8('0x1'));var BPromise=require(_0xacb8('0x2'));var rs=require(_0xacb8('0x3'));var fs=require('fs');var Redis=require(_0xacb8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xacb8('0x5'))(_0xacb8('0x6'));var config=require(_0xacb8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xacb8('0x8')][_0xacb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17c6b1,_0x464156,_0x226b4b){return new BPromise(function(_0x59ab0e,_0x19285d){return client['request'](_0x17c6b1,_0x226b4b)[_0xacb8('0xa')](function(_0x3bed0b){logger[_0xacb8('0xb')](_0xacb8('0xc'),_0x464156,'request\x20sent');logger['debug'](_0xacb8('0xd'),_0x464156,_0xacb8('0xe'),JSON[_0xacb8('0xf')](_0x3bed0b));if(_0x3bed0b[_0xacb8('0x10')]){if(_0x3bed0b[_0xacb8('0x10')][_0xacb8('0x11')]===0x1f4){logger[_0xacb8('0x10')](_0xacb8('0xc'),_0x464156,_0x3bed0b[_0xacb8('0x10')][_0xacb8('0x12')]);return _0x19285d(_0x3bed0b['error'][_0xacb8('0x12')]);}logger[_0xacb8('0x10')](_0xacb8('0xc'),_0x464156,_0x3bed0b['error'][_0xacb8('0x12')]);return _0x59ab0e(_0x3bed0b[_0xacb8('0x10')][_0xacb8('0x12')]);}else{logger[_0xacb8('0xb')](_0xacb8('0xc'),_0x464156,'request\x20sent');_0x59ab0e(_0x3bed0b[_0xacb8('0x13')]['message']);}})[_0xacb8('0x14')](function(_0x5b1739){logger['error'](_0xacb8('0xc'),_0x464156,_0x5b1739);_0x19285d(_0x5b1739);});});}exports[_0xacb8('0x15')]=function(_0x3755db){var _0x1e5969=this;return new Promise(function(_0x380174,_0x26950f){return db['ChatQueueReport'][_0xacb8('0x16')](_0x3755db['body'],{'raw':_0x3755db[_0xacb8('0x17')]?_0x3755db['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x168412){logger[_0xacb8('0xb')](_0xacb8('0x15'),_0x3755db);logger[_0xacb8('0x18')]('CreateChatQueueReport',_0x3755db,JSON['stringify'](_0x168412));_0x380174(_0x168412);})['catch'](function(_0x7a2114){logger[_0xacb8('0x10')](_0xacb8('0x15'),_0x7a2114[_0xacb8('0x12')],_0x3755db);_0x26950f(_0x1e5969['error'](0x1f4,_0x7a2114[_0xacb8('0x12')]));});});};exports[_0xacb8('0x19')]=function(_0x4c0f7a){var _0x142a18=this;return new Promise(function(_0x5102eb,_0x53de31){return db[_0xacb8('0x1a')][_0xacb8('0x1b')](_0x4c0f7a[_0xacb8('0x1c')],{'raw':_0x4c0f7a[_0xacb8('0x17')]?_0x4c0f7a[_0xacb8('0x17')][_0xacb8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c0f7a[_0xacb8('0x17')]?_0x4c0f7a['options'][_0xacb8('0x1e')]||null:null,'attributes':_0x4c0f7a['options']?_0x4c0f7a['options']['attributes']||null:null,'limit':_0x4c0f7a['options']?_0x4c0f7a[_0xacb8('0x17')][_0xacb8('0x1f')]||null:null})[_0xacb8('0xa')](function(_0x8ac6d2){logger['info'](_0xacb8('0x19'),_0x4c0f7a);logger[_0xacb8('0x18')](_0xacb8('0x19'),_0x4c0f7a,JSON[_0xacb8('0xf')](_0x8ac6d2));_0x5102eb(_0x8ac6d2);})[_0xacb8('0x14')](function(_0x91f272){logger[_0xacb8('0x10')]('UpdateChatQueueReport',_0x91f272[_0xacb8('0x12')],_0x4c0f7a);_0x53de31(_0x142a18[_0xacb8('0x10')](0x1f4,_0x91f272[_0xacb8('0x12')]));});});};
\ No newline at end of file
index 7aa4646..59c63c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbf0=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x113cd9,_0x2cd722){var _0x141f73=function(_0x46f523){while(--_0x46f523){_0x113cd9['push'](_0x113cd9['shift']());}};_0x141f73(++_0x2cd722);}(_0xcbf0,0xac));var _0x0cbf=function(_0x1d60cd,_0x34aca4){_0x1d60cd=_0x1d60cd-0x0;var _0x480602=_0xcbf0[_0x1d60cd];return _0x480602;};'use strict';var multer=require(_0x0cbf('0x0'));var util=require(_0x0cbf('0x1'));var path=require(_0x0cbf('0x2'));var timeout=require('connect-timeout');var express=require(_0x0cbf('0x3'));var router=express[_0x0cbf('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0cbf('0x5'));var config=require(_0x0cbf('0x6'));var controller=require('./chatQueueReport.controller');router[_0x0cbf('0x7')]('/',auth[_0x0cbf('0x8')](),controller['index']);router[_0x0cbf('0x7')](_0x0cbf('0x9'),auth[_0x0cbf('0x8')](),controller[_0x0cbf('0xa')]);router[_0x0cbf('0x7')](_0x0cbf('0xb'),auth[_0x0cbf('0x8')](),controller[_0x0cbf('0xc')]);router[_0x0cbf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0cbf('0xe')]);router[_0x0cbf('0xf')](_0x0cbf('0xb'),auth[_0x0cbf('0x8')](),controller[_0x0cbf('0x10')]);router[_0x0cbf('0x11')](_0x0cbf('0xb'),auth[_0x0cbf('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc3c7=['post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','/describe','/:id','isAuthenticated','show'];(function(_0x4f4521,_0x4847ab){var _0x4a8571=function(_0x51cc8f){while(--_0x51cc8f){_0x4f4521['push'](_0x4f4521['shift']());}};_0x4a8571(++_0x4847ab);}(_0xc3c7,0x73));var _0x7c3c=function(_0x520e49,_0x4c4d70){_0x520e49=_0x520e49-0x0;var _0x549d48=_0xc3c7[_0x520e49];return _0x549d48;};'use strict';var multer=require(_0x7c3c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7c3c('0x1'));var express=require('express');var router=express[_0x7c3c('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x7c3c('0x3'));var config=require(_0x7c3c('0x4'));var controller=require(_0x7c3c('0x5'));router[_0x7c3c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7c3c('0x6')](_0x7c3c('0x7'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7c3c('0x8'),auth[_0x7c3c('0x9')](),controller[_0x7c3c('0xa')]);router[_0x7c3c('0xb')]('/',auth['isAuthenticated'](),controller[_0x7c3c('0xc')]);router[_0x7c3c('0xd')](_0x7c3c('0x8'),auth['isAuthenticated'](),controller[_0x7c3c('0xe')]);router[_0x7c3c('0xf')](_0x7c3c('0x8'),auth[_0x7c3c('0x9')](),controller[_0x7c3c('0x10')]);module[_0x7c3c('0x11')]=router;
\ No newline at end of file
index 8a3c3f4..8addacf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f27=['exports','STRING','ENUM','account','agent','queue','sequelize'];(function(_0x6e70ea,_0x2f560c){var _0x12f5c3=function(_0x138bc0){while(--_0x138bc0){_0x6e70ea['push'](_0x6e70ea['shift']());}};_0x12f5c3(++_0x2f560c);}(_0x6f27,0x7d));var _0x76f2=function(_0x3cca7a,_0x109a23){_0x3cca7a=_0x3cca7a-0x0;var _0x34e717=_0x6f27[_0x3cca7a];return _0x34e717;};'use strict';var moment=require('moment');var Sequelize=require(_0x76f2('0x0'));module[_0x76f2('0x1')]={'uniqueid':{'type':Sequelize[_0x76f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x76f2('0x3')](_0x76f2('0x4'),_0x76f2('0x5'),_0x76f2('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xb184=['ENUM','agent','queue','moment','sequelize','exports','STRING'];(function(_0x5cc118,_0x479136){var _0x87ff2b=function(_0x2e3aa7){while(--_0x2e3aa7){_0x5cc118['push'](_0x5cc118['shift']());}};_0x87ff2b(++_0x479136);}(_0xb184,0x199));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x4b18('0x0'));var Sequelize=require(_0x4b18('0x1'));module[_0x4b18('0x2')]={'uniqueid':{'type':Sequelize[_0x4b18('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4b18('0x4')]('account',_0x4b18('0x5'),_0x4b18('0x6')),'allowNull':![],'defaultValue':_0x4b18('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 11d3761..a65d6b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8ad=['squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','update','then','end','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','ChatTransferReport','rows','show','params','find','create','body','catch','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash'];(function(_0x97797b,_0x14b8db){var _0x4dc602=function(_0x6add65){while(--_0x6add65){_0x97797b['push'](_0x97797b['shift']());}};_0x4dc602(++_0x14b8db);}(_0xc8ad,0x1d7));var _0xdc8a=function(_0x5401fe,_0x5c3e80){_0x5401fe=_0x5401fe-0x0;var _0x1ec2f0=_0xc8ad[_0x5401fe];return _0x1ec2f0;};'use strict';var pdf=require(_0xdc8a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdc8a('0x1'));var zipdir=require(_0xdc8a('0x2'));var jsonpatch=require(_0xdc8a('0x3'));var rp=require(_0xdc8a('0x4'));var moment=require(_0xdc8a('0x5'));var BPromise=require(_0xdc8a('0x6'));var Mustache=require('mustache');var util=require(_0xdc8a('0x7'));var path=require(_0xdc8a('0x8'));var sox=require(_0xdc8a('0x9'));var csv=require('to-csv');var ejs=require(_0xdc8a('0xa'));var fs=require('fs');var _=require(_0xdc8a('0xb'));var squel=require(_0xdc8a('0xc'));var crypto=require(_0xdc8a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdc8a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdc8a('0xf'));var Papa=require(_0xdc8a('0x10'));var Redis=require('ioredis');var authService=require(_0xdc8a('0x11'));var qs=require(_0xdc8a('0x12'));var as=require(_0xdc8a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc8a('0x14'))(_0xdc8a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdc8a('0x16'))['db'];function respondWithStatusCode(_0x501012,_0x311038){_0x311038=_0x311038||0xcc;return function(_0x18aef2){if(_0x18aef2){return _0x501012['sendStatus'](_0x311038);}return _0x501012[_0xdc8a('0x17')](_0x311038)['end']();};}function respondWithResult(_0x1883fe,_0x5f1b4a){_0x5f1b4a=_0x5f1b4a||0xc8;return function(_0x94a171){if(_0x94a171){return _0x1883fe[_0xdc8a('0x17')](_0x5f1b4a)[_0xdc8a('0x18')](_0x94a171);}};}function respondWithFilteredResult(_0x1b54e6,_0x23afea){return function(_0x20b473){if(_0x20b473){var _0x4ee474=_0x20b473[_0xdc8a('0x19')],_0x25c44c=_0x23afea[_0xdc8a('0x1a')],_0x561b8c=_0x23afea[_0xdc8a('0x1a')]+_0x23afea[_0xdc8a('0x1b')],_0x53cdf9;if(_0x561b8c>=_0x4ee474){_0x561b8c=_0x4ee474;_0x53cdf9=0xc8;}else{_0x53cdf9=0xce;}_0x1b54e6['status'](_0x53cdf9);return _0x1b54e6[_0xdc8a('0x1c')]('Content-Range',_0x25c44c+'-'+_0x561b8c+'/'+_0x4ee474)[_0xdc8a('0x18')](_0x20b473);}return null;};}function patchUpdates(_0x1c9750){return function(_0xecd099){try{jsonpatch[_0xdc8a('0x1d')](_0xecd099,_0x1c9750,!![]);}catch(_0x3b1821){return BPromise[_0xdc8a('0x1e')](_0x3b1821);}return _0xecd099[_0xdc8a('0x1f')]();};}function saveUpdates(_0x5634c7,_0x75706b){return function(_0x2fd658){if(_0x2fd658){return _0x2fd658[_0xdc8a('0x20')](_0x5634c7)[_0xdc8a('0x21')](function(_0x28564a){return _0x28564a;});}return null;};}function removeEntity(_0x15034c,_0x30f495){return function(_0x394b5e){if(_0x394b5e){return _0x394b5e['destroy']()['then'](function(){_0x15034c[_0xdc8a('0x17')](0xcc)[_0xdc8a('0x22')]();});}};}function handleEntityNotFound(_0x3c78a8,_0x52d272){return function(_0x58d3ce){if(!_0x58d3ce){_0x3c78a8['sendStatus'](0x194);}return _0x58d3ce;};}function handleError(_0x26879c,_0x1f2447){_0x1f2447=_0x1f2447||0x1f4;return function(_0x1f0d82){logger[_0xdc8a('0x23')](_0x1f0d82['stack']);if(_0x1f0d82[_0xdc8a('0x24')]){delete _0x1f0d82['name'];}_0x26879c['status'](_0x1f2447)[_0xdc8a('0x25')](_0x1f0d82);};}exports['index']=function(_0x54ec9d,_0x15b1c8){var _0x3b1b0d={},_0x51e35c={},_0x15d77d={'count':0x0,'rows':[]};var _0x28f6e2=_[_0xdc8a('0x26')](db['ChatTransferReport'][_0xdc8a('0x27')],function(_0x359885){return{'name':_0x359885[_0xdc8a('0x28')],'type':_0x359885[_0xdc8a('0x29')]['key']};});_0x51e35c[_0xdc8a('0x2a')]=_[_0xdc8a('0x26')](_0x28f6e2,'name');_0x51e35c[_0xdc8a('0x2b')]=_[_0xdc8a('0x2c')](_0x54ec9d['query']);_0x51e35c[_0xdc8a('0x2d')]=_[_0xdc8a('0x2e')](_0x51e35c[_0xdc8a('0x2a')],_0x51e35c[_0xdc8a('0x2b')]);_0x3b1b0d[_0xdc8a('0x2f')]=_[_0xdc8a('0x2e')](_0x51e35c[_0xdc8a('0x2a')],qs[_0xdc8a('0x30')](_0x54ec9d[_0xdc8a('0x2b')][_0xdc8a('0x30')]));_0x3b1b0d[_0xdc8a('0x2f')]=_0x3b1b0d[_0xdc8a('0x2f')][_0xdc8a('0x31')]?_0x3b1b0d[_0xdc8a('0x2f')]:_0x51e35c[_0xdc8a('0x2a')];if(!_0x54ec9d['query'][_0xdc8a('0x32')]('nolimit')){_0x3b1b0d['limit']=qs['limit'](_0x54ec9d[_0xdc8a('0x2b')][_0xdc8a('0x1b')]);_0x3b1b0d[_0xdc8a('0x1a')]=qs[_0xdc8a('0x1a')](_0x54ec9d[_0xdc8a('0x2b')]['offset']);}_0x3b1b0d['order']=qs[_0xdc8a('0x33')](_0x54ec9d[_0xdc8a('0x2b')][_0xdc8a('0x33')]);_0x3b1b0d[_0xdc8a('0x34')]=qs[_0xdc8a('0x2d')](_['pick'](_0x54ec9d['query'],_0x51e35c['filters']),_0x28f6e2);if(_0x54ec9d[_0xdc8a('0x2b')][_0xdc8a('0x35')]){_0x3b1b0d['where']=_[_0xdc8a('0x36')](_0x3b1b0d['where'],{'$or':_[_0xdc8a('0x26')](_0x28f6e2,function(_0x32a5e3){if(_0x32a5e3['type']!==_0xdc8a('0x37')){var _0x20242f={};_0x20242f[_0x32a5e3['name']]={'$like':'%'+_0x54ec9d[_0xdc8a('0x2b')][_0xdc8a('0x35')]+'%'};return _0x20242f;}})});}_0x3b1b0d=_['merge']({},_0x3b1b0d,_0x54ec9d[_0xdc8a('0x38')]);var _0x2f33af={'where':_0x3b1b0d[_0xdc8a('0x34')]};return db['ChatTransferReport'][_0xdc8a('0x19')](_0x2f33af)[_0xdc8a('0x21')](function(_0x5196b0){_0x15d77d[_0xdc8a('0x19')]=_0x5196b0;if(_0x54ec9d['query'][_0xdc8a('0x39')]){_0x3b1b0d[_0xdc8a('0x3a')]=[{'all':!![]}];}return db[_0xdc8a('0x3b')]['findAll'](_0x3b1b0d);})[_0xdc8a('0x21')](function(_0x44df79){_0x15d77d[_0xdc8a('0x3c')]=_0x44df79;return _0x15d77d;})[_0xdc8a('0x21')](respondWithFilteredResult(_0x15b1c8,_0x3b1b0d))['catch'](handleError(_0x15b1c8,null));};exports[_0xdc8a('0x3d')]=function(_0x38bc49,_0x61c93d){var _0x374947={'raw':!![],'where':{'id':_0x38bc49[_0xdc8a('0x3e')]['id']}},_0x3ab181={};_0x3ab181['model']=_[_0xdc8a('0x2c')](db['ChatTransferReport'][_0xdc8a('0x27')]);_0x3ab181[_0xdc8a('0x2b')]=_[_0xdc8a('0x2c')](_0x38bc49[_0xdc8a('0x2b')]);_0x3ab181[_0xdc8a('0x2d')]=_[_0xdc8a('0x2e')](_0x3ab181[_0xdc8a('0x2a')],_0x3ab181[_0xdc8a('0x2b')]);_0x374947['attributes']=_[_0xdc8a('0x2e')](_0x3ab181[_0xdc8a('0x2a')],qs[_0xdc8a('0x30')](_0x38bc49[_0xdc8a('0x2b')]['fields']));_0x374947[_0xdc8a('0x2f')]=_0x374947[_0xdc8a('0x2f')][_0xdc8a('0x31')]?_0x374947[_0xdc8a('0x2f')]:_0x3ab181['model'];if(_0x38bc49['query']['includeAll']){_0x374947[_0xdc8a('0x3a')]=[{'all':!![]}];}_0x374947=_[_0xdc8a('0x36')]({},_0x374947,_0x38bc49[_0xdc8a('0x38')]);return db[_0xdc8a('0x3b')][_0xdc8a('0x3f')](_0x374947)[_0xdc8a('0x21')](handleEntityNotFound(_0x61c93d,null))[_0xdc8a('0x21')](respondWithResult(_0x61c93d,null))['catch'](handleError(_0x61c93d,null));};exports[_0xdc8a('0x40')]=function(_0x25217f,_0x268a50){return db[_0xdc8a('0x3b')][_0xdc8a('0x40')](_0x25217f[_0xdc8a('0x41')],{})[_0xdc8a('0x21')](respondWithResult(_0x268a50,0xc9))['catch'](handleError(_0x268a50,null));};exports[_0xdc8a('0x20')]=function(_0x21d2a5,_0x5b0cf4){if(_0x21d2a5[_0xdc8a('0x41')]['id']){delete _0x21d2a5[_0xdc8a('0x41')]['id'];}return db[_0xdc8a('0x3b')][_0xdc8a('0x3f')]({'where':{'id':_0x21d2a5['params']['id']}})[_0xdc8a('0x21')](handleEntityNotFound(_0x5b0cf4,null))['then'](saveUpdates(_0x21d2a5[_0xdc8a('0x41')],null))['then'](respondWithResult(_0x5b0cf4,null))[_0xdc8a('0x42')](handleError(_0x5b0cf4,null));};exports[_0xdc8a('0x43')]=function(_0x4b8abf,_0xb54859){return db['ChatTransferReport'][_0xdc8a('0x3f')]({'where':{'id':_0x4b8abf[_0xdc8a('0x3e')]['id']}})['then'](handleEntityNotFound(_0xb54859,null))['then'](removeEntity(_0xb54859,null))[_0xdc8a('0x42')](handleError(_0xb54859,null));};exports[_0xdc8a('0x44')]=function(_0x4bab64,_0x3cff2e){return db['ChatTransferReport'][_0xdc8a('0x44')]()[_0xdc8a('0x21')](respondWithResult(_0x3cff2e,null))[_0xdc8a('0x42')](handleError(_0x3cff2e,null));};
\ No newline at end of file
+var _0xa910=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','save','update','then','error','stack','name','send','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','ChatTransferReport','count','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service'];(function(_0x246c1d,_0x468add){var _0x4e9c0e=function(_0x2ada29){while(--_0x2ada29){_0x246c1d['push'](_0x246c1d['shift']());}};_0x4e9c0e(++_0x468add);}(_0xa910,0x101));var _0x0a91=function(_0x1c888d,_0x500e40){_0x1c888d=_0x1c888d-0x0;var _0x88d3f8=_0xa910[_0x1c888d];return _0x88d3f8;};'use strict';var pdf=require(_0x0a91('0x0'));var emlformat=require(_0x0a91('0x1'));var rimraf=require(_0x0a91('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a91('0x3'));var rp=require(_0x0a91('0x4'));var moment=require('moment');var BPromise=require(_0x0a91('0x5'));var Mustache=require(_0x0a91('0x6'));var util=require('util');var path=require(_0x0a91('0x7'));var sox=require('sox');var csv=require(_0x0a91('0x8'));var ejs=require(_0x0a91('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0a91('0xa'));var crypto=require(_0x0a91('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0a91('0xc'));var toCsv=require(_0x0a91('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a91('0xd'));var authService=require(_0x0a91('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0a91('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a91('0x10'))(_0x0a91('0x11'));var utils=require('../../config/utils');var config=require(_0x0a91('0x12'));var db=require(_0x0a91('0x13'))['db'];function respondWithStatusCode(_0x5bdaee,_0x4e9217){_0x4e9217=_0x4e9217||0xcc;return function(_0x453db7){if(_0x453db7){return _0x5bdaee[_0x0a91('0x14')](_0x4e9217);}return _0x5bdaee[_0x0a91('0x15')](_0x4e9217)[_0x0a91('0x16')]();};}function respondWithResult(_0x3a5978,_0x222a56){_0x222a56=_0x222a56||0xc8;return function(_0x4b97dd){if(_0x4b97dd){return _0x3a5978[_0x0a91('0x15')](_0x222a56)[_0x0a91('0x17')](_0x4b97dd);}};}function respondWithFilteredResult(_0x2649d3,_0x13cd14){return function(_0x2e247c){if(_0x2e247c){var _0x3add64=_0x2e247c['count'],_0x50a26e=_0x13cd14[_0x0a91('0x18')],_0x49ce35=_0x13cd14[_0x0a91('0x18')]+_0x13cd14['limit'],_0x3d1d81;if(_0x49ce35>=_0x3add64){_0x49ce35=_0x3add64;_0x3d1d81=0xc8;}else{_0x3d1d81=0xce;}_0x2649d3[_0x0a91('0x15')](_0x3d1d81);return _0x2649d3[_0x0a91('0x19')](_0x0a91('0x1a'),_0x50a26e+'-'+_0x49ce35+'/'+_0x3add64)[_0x0a91('0x17')](_0x2e247c);}return null;};}function patchUpdates(_0x38da48){return function(_0xadfd1d){try{jsonpatch['apply'](_0xadfd1d,_0x38da48,!![]);}catch(_0x494bd5){return BPromise['reject'](_0x494bd5);}return _0xadfd1d[_0x0a91('0x1b')]();};}function saveUpdates(_0x478d76,_0x35ae81){return function(_0x35f44f){if(_0x35f44f){return _0x35f44f[_0x0a91('0x1c')](_0x478d76)[_0x0a91('0x1d')](function(_0x54cd00){return _0x54cd00;});}return null;};}function removeEntity(_0x2d9471,_0x5db7b5){return function(_0x160f83){if(_0x160f83){return _0x160f83['destroy']()[_0x0a91('0x1d')](function(){_0x2d9471['status'](0xcc)[_0x0a91('0x16')]();});}};}function handleEntityNotFound(_0x501d52,_0x52c3fd){return function(_0x104970){if(!_0x104970){_0x501d52[_0x0a91('0x14')](0x194);}return _0x104970;};}function handleError(_0x1e3472,_0x5d0077){_0x5d0077=_0x5d0077||0x1f4;return function(_0x27723c){logger[_0x0a91('0x1e')](_0x27723c[_0x0a91('0x1f')]);if(_0x27723c['name']){delete _0x27723c[_0x0a91('0x20')];}_0x1e3472[_0x0a91('0x15')](_0x5d0077)[_0x0a91('0x21')](_0x27723c);};}exports['index']=function(_0x2edb7e,_0x30d3a8){var _0x3c572c={},_0x387a19={},_0x3a4b72={'count':0x0,'rows':[]};var _0x2f98c4=_['map'](db['ChatTransferReport']['rawAttributes'],function(_0x3a1965){return{'name':_0x3a1965[_0x0a91('0x22')],'type':_0x3a1965[_0x0a91('0x23')]['key']};});_0x387a19['model']=_[_0x0a91('0x24')](_0x2f98c4,_0x0a91('0x20'));_0x387a19['query']=_[_0x0a91('0x25')](_0x2edb7e[_0x0a91('0x26')]);_0x387a19[_0x0a91('0x27')]=_[_0x0a91('0x28')](_0x387a19[_0x0a91('0x29')],_0x387a19['query']);_0x3c572c[_0x0a91('0x2a')]=_['intersection'](_0x387a19['model'],qs[_0x0a91('0x2b')](_0x2edb7e[_0x0a91('0x26')][_0x0a91('0x2b')]));_0x3c572c[_0x0a91('0x2a')]=_0x3c572c[_0x0a91('0x2a')][_0x0a91('0x2c')]?_0x3c572c[_0x0a91('0x2a')]:_0x387a19[_0x0a91('0x29')];if(!_0x2edb7e['query']['hasOwnProperty']('nolimit')){_0x3c572c[_0x0a91('0x2d')]=qs[_0x0a91('0x2d')](_0x2edb7e['query'][_0x0a91('0x2d')]);_0x3c572c[_0x0a91('0x18')]=qs['offset'](_0x2edb7e[_0x0a91('0x26')][_0x0a91('0x18')]);}_0x3c572c[_0x0a91('0x2e')]=qs[_0x0a91('0x2f')](_0x2edb7e[_0x0a91('0x26')][_0x0a91('0x2f')]);_0x3c572c[_0x0a91('0x30')]=qs['filters'](_[_0x0a91('0x31')](_0x2edb7e[_0x0a91('0x26')],_0x387a19['filters']),_0x2f98c4);if(_0x2edb7e[_0x0a91('0x26')][_0x0a91('0x32')]){_0x3c572c[_0x0a91('0x30')]=_[_0x0a91('0x33')](_0x3c572c['where'],{'$or':_[_0x0a91('0x24')](_0x2f98c4,function(_0x15ac13){if(_0x15ac13[_0x0a91('0x23')]!==_0x0a91('0x34')){var _0x13f5ac={};_0x13f5ac[_0x15ac13[_0x0a91('0x20')]]={'$like':'%'+_0x2edb7e['query'][_0x0a91('0x32')]+'%'};return _0x13f5ac;}})});}_0x3c572c=_[_0x0a91('0x33')]({},_0x3c572c,_0x2edb7e['options']);var _0xe0327d={'where':_0x3c572c['where']};return db[_0x0a91('0x35')]['count'](_0xe0327d)[_0x0a91('0x1d')](function(_0x5729c7){_0x3a4b72[_0x0a91('0x36')]=_0x5729c7;if(_0x2edb7e[_0x0a91('0x26')]['includeAll']){_0x3c572c[_0x0a91('0x37')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x0a91('0x38')](_0x3c572c);})['then'](function(_0x526a3c){_0x3a4b72[_0x0a91('0x39')]=_0x526a3c;return _0x3a4b72;})[_0x0a91('0x1d')](respondWithFilteredResult(_0x30d3a8,_0x3c572c))[_0x0a91('0x3a')](handleError(_0x30d3a8,null));};exports[_0x0a91('0x3b')]=function(_0x3285aa,_0x35e5e7){var _0x4305e8={'raw':!![],'where':{'id':_0x3285aa[_0x0a91('0x3c')]['id']}},_0x4aed9f={};_0x4aed9f[_0x0a91('0x29')]=_[_0x0a91('0x25')](db['ChatTransferReport'][_0x0a91('0x3d')]);_0x4aed9f[_0x0a91('0x26')]=_['keys'](_0x3285aa[_0x0a91('0x26')]);_0x4aed9f[_0x0a91('0x27')]=_[_0x0a91('0x28')](_0x4aed9f[_0x0a91('0x29')],_0x4aed9f['query']);_0x4305e8['attributes']=_[_0x0a91('0x28')](_0x4aed9f['model'],qs[_0x0a91('0x2b')](_0x3285aa[_0x0a91('0x26')]['fields']));_0x4305e8[_0x0a91('0x2a')]=_0x4305e8[_0x0a91('0x2a')][_0x0a91('0x2c')]?_0x4305e8['attributes']:_0x4aed9f[_0x0a91('0x29')];if(_0x3285aa[_0x0a91('0x26')][_0x0a91('0x3e')]){_0x4305e8[_0x0a91('0x37')]=[{'all':!![]}];}_0x4305e8=_[_0x0a91('0x33')]({},_0x4305e8,_0x3285aa['options']);return db[_0x0a91('0x35')][_0x0a91('0x3f')](_0x4305e8)[_0x0a91('0x1d')](handleEntityNotFound(_0x35e5e7,null))['then'](respondWithResult(_0x35e5e7,null))[_0x0a91('0x3a')](handleError(_0x35e5e7,null));};exports['create']=function(_0x4edc5b,_0x28ce14){return db[_0x0a91('0x35')][_0x0a91('0x40')](_0x4edc5b['body'],{})[_0x0a91('0x1d')](respondWithResult(_0x28ce14,0xc9))['catch'](handleError(_0x28ce14,null));};exports[_0x0a91('0x1c')]=function(_0x360332,_0x1570aa){if(_0x360332[_0x0a91('0x41')]['id']){delete _0x360332[_0x0a91('0x41')]['id'];}return db[_0x0a91('0x35')][_0x0a91('0x3f')]({'where':{'id':_0x360332[_0x0a91('0x3c')]['id']}})[_0x0a91('0x1d')](handleEntityNotFound(_0x1570aa,null))[_0x0a91('0x1d')](saveUpdates(_0x360332['body'],null))['then'](respondWithResult(_0x1570aa,null))['catch'](handleError(_0x1570aa,null));};exports[_0x0a91('0x42')]=function(_0x550fe5,_0xe80841){return db[_0x0a91('0x35')][_0x0a91('0x3f')]({'where':{'id':_0x550fe5[_0x0a91('0x3c')]['id']}})['then'](handleEntityNotFound(_0xe80841,null))[_0x0a91('0x1d')](removeEntity(_0xe80841,null))[_0x0a91('0x3a')](handleError(_0xe80841,null));};exports[_0x0a91('0x43')]=function(_0x2c596a,_0x5b7d91){return db['ChatTransferReport'][_0x0a91('0x43')]()[_0x0a91('0x1d')](respondWithResult(_0x5b7d91,null))[_0x0a91('0x3a')](handleError(_0x5b7d91,null));};
\ No newline at end of file
index 693e7bf..6a955ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30d6=['path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x3b919b,_0x55590c){var _0x222dd7=function(_0x5ecb2c){while(--_0x5ecb2c){_0x3b919b['push'](_0x3b919b['shift']());}};_0x222dd7(++_0x55590c);}(_0x30d6,0x80));var _0x630d=function(_0x3a8d5a,_0xe54840){_0x3a8d5a=_0x3a8d5a-0x0;var _0x308361=_0x30d6[_0x3a8d5a];return _0x308361;};'use strict';var _=require('lodash');var util=require(_0x630d('0x0'));var logger=require(_0x630d('0x1'))(_0x630d('0x2'));var moment=require(_0x630d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x630d('0x4'));var rimraf=require(_0x630d('0x5'));var config=require(_0x630d('0x6'));var attributes=require(_0x630d('0x7'));module['exports']=function(_0x318f72,_0x114b34){return _0x318f72[_0x630d('0x8')](_0x630d('0x9'),attributes,{'tableName':_0x630d('0xa'),'paranoid':![],'indexes':[{'name':_0x630d('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdb0=['uniqueid','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x56e001,_0x1fb14c){var _0x490d6f=function(_0x33888c){while(--_0x33888c){_0x56e001['push'](_0x56e001['shift']());}};_0x490d6f(++_0x1fb14c);}(_0xfdb0,0x6d));var _0x0fdb=function(_0x50f73f,_0x2c4c34){_0x50f73f=_0x50f73f-0x0;var _0x2474a3=_0xfdb0[_0x50f73f];return _0x2474a3;};'use strict';var _=require(_0x0fdb('0x0'));var util=require(_0x0fdb('0x1'));var logger=require(_0x0fdb('0x2'))(_0x0fdb('0x3'));var moment=require('moment');var BPromise=require(_0x0fdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0fdb('0x5'));var config=require(_0x0fdb('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x0fdb('0x7')]=function(_0x199a05,_0x281c8f){return _0x199a05[_0x0fdb('0x8')](_0x0fdb('0x9'),attributes,{'tableName':_0x0fdb('0xa'),'paranoid':![],'indexes':[{'name':_0x0fdb('0xb'),'fields':[_0x0fdb('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 2aba0f1..87693a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcbc=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0xdcbc,0x80));var _0xcdcb=function(_0x4c8416,_0x54e220){_0x4c8416=_0x4c8416-0x0;var _0x2a2324=_0xdcbc[_0x4c8416];return _0x2a2324;};'use strict';var _=require(_0xcdcb('0x0'));var util=require(_0xcdcb('0x1'));var moment=require(_0xcdcb('0x2'));var BPromise=require(_0xcdcb('0x3'));var rs=require(_0xcdcb('0x4'));var fs=require('fs');var Redis=require(_0xcdcb('0x5'));var db=require(_0xcdcb('0x6'))['db'];var utils=require(_0xcdcb('0x7'));var logger=require(_0xcdcb('0x8'))(_0xcdcb('0x9'));var config=require(_0xcdcb('0xa'));var jayson=require(_0xcdcb('0xb'));var client=jayson[_0xcdcb('0xc')][_0xcdcb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x38de32,_0x33a6dc,_0x1e97a3){return new BPromise(function(_0x566592,_0x27d608){return client[_0xcdcb('0xe')](_0x38de32,_0x1e97a3)['then'](function(_0x2dc70a){logger[_0xcdcb('0xf')](_0xcdcb('0x10'),_0x33a6dc,_0xcdcb('0x11'));logger[_0xcdcb('0x12')](_0xcdcb('0x13'),_0x33a6dc,_0xcdcb('0x11'),JSON['stringify'](_0x2dc70a));if(_0x2dc70a['error']){if(_0x2dc70a[_0xcdcb('0x14')][_0xcdcb('0x15')]===0x1f4){logger[_0xcdcb('0x14')](_0xcdcb('0x10'),_0x33a6dc,_0x2dc70a['error'][_0xcdcb('0x16')]);return _0x27d608(_0x2dc70a[_0xcdcb('0x14')][_0xcdcb('0x16')]);}logger[_0xcdcb('0x14')](_0xcdcb('0x10'),_0x33a6dc,_0x2dc70a[_0xcdcb('0x14')][_0xcdcb('0x16')]);return _0x566592(_0x2dc70a[_0xcdcb('0x14')][_0xcdcb('0x16')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x33a6dc,_0xcdcb('0x11'));_0x566592(_0x2dc70a[_0xcdcb('0x17')][_0xcdcb('0x16')]);}})[_0xcdcb('0x18')](function(_0x59e554){logger[_0xcdcb('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x33a6dc,_0x59e554);_0x27d608(_0x59e554);});});}
\ No newline at end of file
+var _0xf8a3=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x23897f,_0x925717){var _0xff8e7e=function(_0x57608b){while(--_0x57608b){_0x23897f['push'](_0x23897f['shift']());}};_0xff8e7e(++_0x925717);}(_0xf8a3,0x1c8));var _0x3f8a=function(_0x1003b1,_0x4382a3){_0x1003b1=_0x1003b1-0x0;var _0x2455e1=_0xf8a3[_0x1003b1];return _0x2455e1;};'use strict';var _=require(_0x3f8a('0x0'));var util=require(_0x3f8a('0x1'));var moment=require(_0x3f8a('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f8a('0x3'));var fs=require('fs');var Redis=require(_0x3f8a('0x4'));var db=require(_0x3f8a('0x5'))['db'];var utils=require(_0x3f8a('0x6'));var logger=require(_0x3f8a('0x7'))(_0x3f8a('0x8'));var config=require(_0x3f8a('0x9'));var jayson=require(_0x3f8a('0xa'));var client=jayson[_0x3f8a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d61f6,_0x3d23bd,_0x1c1f83){return new BPromise(function(_0xa2da08,_0xe23e5f){return client['request'](_0x5d61f6,_0x1c1f83)[_0x3f8a('0xc')](function(_0x467868){logger[_0x3f8a('0xd')](_0x3f8a('0xe'),_0x3d23bd,_0x3f8a('0xf'));logger[_0x3f8a('0x10')](_0x3f8a('0x11'),_0x3d23bd,_0x3f8a('0xf'),JSON[_0x3f8a('0x12')](_0x467868));if(_0x467868[_0x3f8a('0x13')]){if(_0x467868[_0x3f8a('0x13')][_0x3f8a('0x14')]===0x1f4){logger[_0x3f8a('0x13')](_0x3f8a('0xe'),_0x3d23bd,_0x467868[_0x3f8a('0x13')][_0x3f8a('0x15')]);return _0xe23e5f(_0x467868[_0x3f8a('0x13')][_0x3f8a('0x15')]);}logger[_0x3f8a('0x13')](_0x3f8a('0xe'),_0x3d23bd,_0x467868[_0x3f8a('0x13')][_0x3f8a('0x15')]);return _0xa2da08(_0x467868[_0x3f8a('0x13')][_0x3f8a('0x15')]);}else{logger[_0x3f8a('0xd')](_0x3f8a('0xe'),_0x3d23bd,_0x3f8a('0xf'));_0xa2da08(_0x467868[_0x3f8a('0x16')]['message']);}})[_0x3f8a('0x17')](function(_0x50d540){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3d23bd,_0x50d540);_0xe23e5f(_0x50d540);});});}
\ No newline at end of file
index 5fa667f..19550e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3f1311,_0x9430f0){var _0x22a877=function(_0x1bccaf){while(--_0x1bccaf){_0x3f1311['push'](_0x3f1311['shift']());}};_0x22a877(++_0x9430f0);}(_0x2032,0xd9));var _0x2203=function(_0x30e245,_0xb9c9b4){_0x30e245=_0x30e245-0x0;var _0x30b0b8=_0x2032[_0x30e245];return _0x30b0b8;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router;
\ No newline at end of file
+var _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x4bc43d,_0x2e481e){var _0x277b0f=function(_0x1d06b8){while(--_0x1d06b8){_0x4bc43d['push'](_0x4bc43d['shift']());}};_0x277b0f(++_0x2e481e);}(_0x2032,0xd9));var _0x2203=function(_0x3fa975,_0x138ed4){_0x3fa975=_0x3fa975-0x0;var _0x928186=_0x2032[_0x3fa975];return _0x928186;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router;
\ No newline at end of file
index 3d26b98..3a3f87f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ff=['ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','INTEGER'];(function(_0x1148dc,_0xea777a){var _0x696450=function(_0x59f755){while(--_0x59f755){_0x1148dc['push'](_0x1148dc['shift']());}};_0x696450(++_0xea777a);}(_0xd7ff,0x1e1));var _0xfd7f=function(_0x1e5135,_0x4275fa){_0x1e5135=_0x1e5135-0x0;var _0x5aa8e1=_0xd7ff[_0x1e5135];return _0x5aa8e1;};'use strict';var Sequelize=require(_0xfd7f('0x0'));var rs=require(_0xfd7f('0x1'));module[_0xfd7f('0x2')]={'name':{'type':Sequelize[_0xfd7f('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xfd7f('0x3')],'allowNull':![],'unique':_0xfd7f('0x4')},'description':{'type':Sequelize[_0xfd7f('0x3')]},'mapKey':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x5')},'mapKeyOffline':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x5')},'key':{'type':Sequelize[_0xfd7f('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x6')},'customerAlias':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfd7f('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfd7f('0x3')],'allowNull':![],'defaultValue':_0xfd7f('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfd7f('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfd7f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfd7f('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfd7f('0x9')](_0xfd7f('0xa'),_0xfd7f('0xb')),'defaultValue':_0xfd7f('0xa')},'header_online':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0xc')},'start_chat_button':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xfd7f('0xe')},'download_transcript':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xfd7f('0x10')]},'closingQuestion':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xfd7f('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x13')},'noteTitle':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x14')},'placeholderMessage':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x15')},'closingMessage':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x16')},'closingMessageButton':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0xd')},'skipMessageButton':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xfd7f('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0xfd7f('0x19'),_0xfd7f('0x1a')),'defaultValue':_0xfd7f('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xfd7f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xfd7f('0x1b')]({'items':[{'type':_0xfd7f('0x1c'),'variable':null,'config':{'placeholder':'name','type':_0xfd7f('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xfd7f('0x1c'),'props':{'title':_0xfd7f('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfd7f('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfd7f('0x1e')](_0xfd7f('0x1f'))?JSON['parse'](this[_0xfd7f('0x1e')](_0xfd7f('0x1f'))):{};},'set':function(_0x304f82){return this[_0xfd7f('0x20')](_0xfd7f('0x1f'),JSON[_0xfd7f('0x1b')](_0x304f82));}},'offlineForm':{'type':Sequelize[_0xfd7f('0x10')],'defaultValue':function(){return JSON[_0xfd7f('0x1b')]({'items':[{'type':'input','props':{'title':_0xfd7f('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xfd7f('0x5'),'type':'email'},'variable':null},{'type':_0xfd7f('0x21'),'config':{'placeholder':_0xfd7f('0x22')},'props':{'title':_0xfd7f('0x22'),'helpText':_0xfd7f('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xfd7f('0x1e')](_0xfd7f('0x24'))?JSON[_0xfd7f('0x25')](this[_0xfd7f('0x1e')]('offlineForm')):{};},'set':function(_0x5d60a3){return this[_0xfd7f('0x20')](_0xfd7f('0x24'),JSON[_0xfd7f('0x1b')](_0x5d60a3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xfd7f('0x26')]();}},'autoclose':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfd7f('0x3')]},'forwardOffline':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfd7f('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x17')},'sendUnmanaged':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfd7f('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xfd7f('0x3')]},'notificationTemplate':{'type':Sequelize[_0xfd7f('0x10')],'defaultValue':function(){return _0xfd7f('0x29');}},'notificationSound':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xfd7f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xfd7f('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':_0xfd7f('0x2b')},'defaultTitle':{'type':Sequelize[_0xfd7f('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfd7f('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfd7f('0x3')],'allowNull':![],'defaultValue':_0xfd7f('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfd7f('0x8')],'comment':_0xfd7f('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![],'comment':_0xfd7f('0x2e'),'set':function(_0x1e3582){if(!_0x1e3582)this['setDataValue'](_0xfd7f('0x2f'),null);this[_0xfd7f('0x20')](_0xfd7f('0x30'),_0x1e3582);}},'vidaooEscalation':{'type':Sequelize[_0xfd7f('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xfd7f('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9b39=['Skip','Feedback','star','thumb','stringify','name','onlineForm','parse','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x9b39,0x136));var _0x99b3=function(_0x47ee5e,_0x4a8c6c){_0x47ee5e=_0x47ee5e-0x0;var _0x49d689=_0x9b39[_0x47ee5e];return _0x49d689;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x99b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x99b3('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x99b3('0x1')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x99b3('0x1')]},'mapKey':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x2')},'mapKeyOffline':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x2')},'key':{'type':Sequelize[_0x99b3('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x3')},'customerAlias':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x99b3('0x1')],'allowNull':![],'defaultValue':_0x99b3('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x99b3('0x1')],'allowNull':![],'defaultValue':_0x99b3('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x99b3('0x1')],'allowNull':![],'defaultValue':_0x99b3('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x99b3('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x99b3('0x8')](_0x99b3('0x9'),'squared'),'defaultValue':_0x99b3('0x9')},'header_online':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0xa')},'start_chat_button':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0xb')},'header_offline':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0xc')},'download_transcript':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x99b3('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x99b3('0xe')]},'closingQuestion':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x12')},'closingMessageButton':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x13')},'conditionAgreement':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x99b3('0x14')},'ratingType':{'type':Sequelize['ENUM'](_0x99b3('0x15'),_0x99b3('0x16')),'defaultValue':_0x99b3('0x15')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x99b3('0xe')],'defaultValue':function(){return JSON[_0x99b3('0x17')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x99b3('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x99b3('0x2'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x99b3('0x19'))?JSON[_0x99b3('0x1a')](this['getDataValue'](_0x99b3('0x19'))):{};},'set':function(_0x55536f){return this[_0x99b3('0x1b')](_0x99b3('0x19'),JSON[_0x99b3('0x17')](_0x55536f));}},'offlineForm':{'type':Sequelize[_0x99b3('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x99b3('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x99b3('0x2'),'type':_0x99b3('0x2')},'variable':null},{'type':_0x99b3('0x1d'),'config':{'placeholder':_0x99b3('0x1e')},'props':{'title':_0x99b3('0x1e'),'helpText':_0x99b3('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x99b3('0x20')]('offlineForm')?JSON['parse'](this[_0x99b3('0x20')](_0x99b3('0x21'))):{};},'set':function(_0x472051){return this['setDataValue'](_0x99b3('0x21'),JSON[_0x99b3('0x17')](_0x472051));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x99b3('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x99b3('0x1')]},'forwardOffline':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x99b3('0x23')},'offlineMessageBody':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x99b3('0x13')},'sendUnmanaged':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x99b3('0x1')]},'notificationTemplate':{'type':Sequelize[_0x99b3('0xe')],'defaultValue':function(){return _0x99b3('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x99b3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x99b3('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x28')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x99b3('0xe')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x99b3('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x99b3('0x1')],'allowNull':![],'defaultValue':_0x99b3('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x99b3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x99b3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':_0x99b3('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x99b3('0x6')],'comment':_0x99b3('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![],'comment':_0x99b3('0x2c'),'set':function(_0x4b6e10){if(!_0x4b6e10)this[_0x99b3('0x1b')](_0x99b3('0x2d'),null);this[_0x99b3('0x1b')](_0x99b3('0x2e'),_0x4b6e10);}},'vidaooEscalation':{'type':Sequelize[_0x99b3('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x99b3('0x1')],'defaultValue':![]}};
\ No newline at end of file
index 814ea04..ec2d8a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x022e=['code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','ChatWebsites','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','findAll','params','includeAll','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','rows','removeDispositions','ids','CannedAnswer','removeAnswers','addLogo','file','filename','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','sitepic','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','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','List','Contacts','DESC','account','applications','Applications','list','priority','asc','contact','cf-connecting-ip','first','x-forwarded-for','firstName','x-real-port','referer','browser','version','format','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','forcedOwnership','Start','startRouting','EventManager','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','all','x-real-ip','remoteAddress','replace','render','verticalAlignment','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','online','false','offlineForm','fromKey','getOfflineMessages','emit','userChatWebsite:save','removeAgents','isArray','getAgents','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x9ebcef,_0x231f40){var _0x18a9f8=function(_0x19848c){while(--_0x19848c){_0x9ebcef['push'](_0x9ebcef['shift']());}};_0x18a9f8(++_0x231f40);}(_0x022e,0xed));var _0xe022=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x022e[_0x32f7d7];return _0x133d09;};'use strict';var pdf=require(_0xe022('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe022('0x1'));var rp=require(_0xe022('0x2'));var moment=require(_0xe022('0x3'));var BPromise=require(_0xe022('0x4'));var Mustache=require(_0xe022('0x5'));var util=require(_0xe022('0x6'));var path=require('path');var sox=require(_0xe022('0x7'));var csv=require('to-csv');var ejs=require(_0xe022('0x8'));var fs=require('fs');var _=require(_0xe022('0x9'));var squel=require('squel');var crypto=require(_0xe022('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe022('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe022('0xc'));var Papa=require(_0xe022('0xd'));var Redis=require(_0xe022('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe022('0xf'));var as=require(_0xe022('0x10'));var hardwareService=require(_0xe022('0x11'));var logger=require(_0xe022('0x12'))(_0xe022('0x13'));var utils=require(_0xe022('0x14'));var config=require(_0xe022('0x15'));var db=require(_0xe022('0x16'))['db'];config[_0xe022('0x17')]=_[_0xe022('0x18')](config[_0xe022('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe022('0x19'))(new Redis(config[_0xe022('0x17')]));require(_0xe022('0x1a'))[_0xe022('0x1b')](socket);var jayson=require(_0xe022('0x1c'));var client=jayson[_0xe022('0x1d')][_0xe022('0x1e')]({'port':0x232c});var client9002=jayson[_0xe022('0x1d')][_0xe022('0x1e')]({'port':0x232a});var client9003=jayson[_0xe022('0x1d')]['http']({'port':0x232b});function checkPasswordPattern(_0x17be1a,_0x2f5267,_0x17ec91){if(_0x17ec91){var _0x4e7f0b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e7f0b[_0xe022('0x1f')](_0x2f5267)){return _0x17be1a;}else{throw new db[(_0xe022('0x20'))][(_0xe022('0x21'))](_0xe022('0x22'));}}else{return _0x17be1a;}}function respondWithRpcPromise(_0x4f9a83,_0x3e140f,_0x5835c5,_0x46ecc6){return new BPromise(function(_0x3c6b94,_0x5f2d63){var _0x44a5e9=_0x46ecc6||client;return _0x44a5e9[_0xe022('0x23')](_0x4f9a83,_0x5835c5)['then'](function(_0x255f6a){logger[_0xe022('0x24')](_0xe022('0x25'),_0x3e140f,_0xe022('0x26'));logger[_0xe022('0x27')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3e140f,_0xe022('0x26'),JSON[_0xe022('0x28')](_0x255f6a));if(_0x255f6a[_0xe022('0x29')]){if(_0x255f6a[_0xe022('0x29')][_0xe022('0x2a')]===0x1f4){logger[_0xe022('0x29')](_0xe022('0x25'),_0x3e140f,_0x255f6a[_0xe022('0x29')][_0xe022('0x2b')]);return _0x5f2d63(_0x255f6a['error'][_0xe022('0x2b')]);}logger['error'](_0xe022('0x25'),_0x3e140f,_0x255f6a[_0xe022('0x29')][_0xe022('0x2b')]);return _0x3c6b94(_0x255f6a[_0xe022('0x29')][_0xe022('0x2b')]);}else{logger[_0xe022('0x24')](_0xe022('0x25'),_0x3e140f,_0xe022('0x26'));_0x3c6b94(_0x255f6a[_0xe022('0x2c')][_0xe022('0x2b')]);}})[_0xe022('0x2d')](function(_0x1e87fa){logger[_0xe022('0x29')](_0xe022('0x25'),_0x3e140f,_0x1e87fa);_0x5f2d63(_0x1e87fa);});});}function respondWithStatusCode(_0x2f2796,_0x1741e9){_0x1741e9=_0x1741e9||0xcc;return function(_0x2831f3){if(_0x2831f3){return _0x2f2796[_0xe022('0x2e')](_0x1741e9);}return _0x2f2796[_0xe022('0x2f')](_0x1741e9)[_0xe022('0x30')]();};}function respondWithResult(_0x6e6677,_0x1a9dc3){_0x1a9dc3=_0x1a9dc3||0xc8;return function(_0x2d0866){if(_0x2d0866){return _0x6e6677[_0xe022('0x2f')](_0x1a9dc3)[_0xe022('0x31')](_0x2d0866);}};}function respondWithFilteredResult(_0x3965e7,_0x385a1){return function(_0x43e1b3){if(_0x43e1b3){var _0x5402e8=_0x43e1b3[_0xe022('0x32')],_0xa2abfe=_0x385a1[_0xe022('0x33')],_0x17eebf=_0x385a1[_0xe022('0x33')]+_0x385a1[_0xe022('0x34')],_0x2ecd25;if(_0x17eebf>=_0x5402e8){_0x17eebf=_0x5402e8;_0x2ecd25=0xc8;}else{_0x2ecd25=0xce;}_0x3965e7[_0xe022('0x2f')](_0x2ecd25);return _0x3965e7[_0xe022('0x35')](_0xe022('0x36'),_0xa2abfe+'-'+_0x17eebf+'/'+_0x5402e8)[_0xe022('0x31')](_0x43e1b3);}return null;};}function patchUpdates(_0x2bd9bd){return function(_0x10eaff){try{jsonpatch[_0xe022('0x37')](_0x10eaff,_0x2bd9bd,!![]);}catch(_0x4215b7){return BPromise[_0xe022('0x38')](_0x4215b7);}return _0x10eaff[_0xe022('0x39')]();};}function saveUpdates(_0x1e7b70,_0x498c03){return function(_0x6162b7){if(_0x6162b7){return _0x6162b7['update'](_0x1e7b70)[_0xe022('0x3a')](function(_0xf87c97){return _0xf87c97;});}return null;};}function removeEntity(_0x24161f,_0x55ee9e){return function(_0x246e47){if(_0x246e47){return _0x246e47['destroy']()[_0xe022('0x3a')](function(){var _0x1319a3=_0x246e47['get']({'plain':!![]});var _0x3371bc=_0xe022('0x3b');return db[_0xe022('0x3c')][_0xe022('0x3d')]({'where':{'type':_0x3371bc,'resourceId':_0x1319a3['id']}})[_0xe022('0x3a')](function(){return _0x246e47;});})[_0xe022('0x3a')](function(){_0x24161f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x336dbf,_0x19d42d){return function(_0x3b063f){if(!_0x3b063f){_0x336dbf[_0xe022('0x2e')](0x194);}return _0x3b063f;};}function handleError(_0x387d1c,_0x529023){_0x529023=_0x529023||0x1f4;return function(_0x44a59b){logger[_0xe022('0x29')](_0x44a59b[_0xe022('0x3e')]);if(_0x44a59b[_0xe022('0x3f')]){delete _0x44a59b[_0xe022('0x3f')];}_0x387d1c['status'](_0x529023)[_0xe022('0x40')](_0x44a59b);};}exports['index']=function(_0x1e2e63,_0x2a7790){var _0x44b255={'include':[{'model':db[_0xe022('0x41')],'as':_0xe022('0x42')}]},_0x3c60c2={},_0x3fbb1e={'count':0x0,'rows':[]};var _0x548375=_['map'](db[_0xe022('0x43')][_0xe022('0x44')],function(_0x27dd26){return{'name':_0x27dd26[_0xe022('0x45')],'type':_0x27dd26[_0xe022('0x46')][_0xe022('0x47')]};});_0x3c60c2[_0xe022('0x48')]=_[_0xe022('0x49')](_0x548375,'name');_0x3c60c2[_0xe022('0x4a')]=_[_0xe022('0x4b')](_0x1e2e63[_0xe022('0x4a')]);_0x3c60c2[_0xe022('0x4c')]=_[_0xe022('0x4d')](_0x3c60c2[_0xe022('0x48')],_0x3c60c2[_0xe022('0x4a')]);_0x44b255[_0xe022('0x4e')]=_[_0xe022('0x4d')](_0x3c60c2[_0xe022('0x48')],qs[_0xe022('0x4f')](_0x1e2e63['query'][_0xe022('0x4f')]));_0x44b255[_0xe022('0x4e')]=_0x44b255[_0xe022('0x4e')][_0xe022('0x50')]?_0x44b255[_0xe022('0x4e')]:_0x3c60c2[_0xe022('0x48')];if(!_0x1e2e63[_0xe022('0x4a')][_0xe022('0x51')](_0xe022('0x52'))){_0x44b255[_0xe022('0x34')]=qs['limit'](_0x1e2e63['query'][_0xe022('0x34')]);_0x44b255['offset']=qs[_0xe022('0x33')](_0x1e2e63[_0xe022('0x4a')]['offset']);}_0x44b255['order']=qs[_0xe022('0x53')](_0x1e2e63[_0xe022('0x4a')]['sort']);_0x44b255[_0xe022('0x54')]=qs['filters'](_[_0xe022('0x55')](_0x1e2e63[_0xe022('0x4a')],_0x3c60c2['filters']),_0x548375);if(_0x1e2e63[_0xe022('0x4a')]['filter']){_0x44b255[_0xe022('0x54')]=_['merge'](_0x44b255[_0xe022('0x54')],{'$or':_[_0xe022('0x49')](_0x548375,function(_0x384847){if(_0x384847['type']!=='VIRTUAL'){var _0x295999={};_0x295999[_0x384847[_0xe022('0x3f')]]={'$like':'%'+_0x1e2e63[_0xe022('0x4a')][_0xe022('0x56')]+'%'};return _0x295999;}})});}_0x44b255=_[_0xe022('0x57')]({},_0x44b255,_0x1e2e63[_0xe022('0x58')]);var _0x37c8e6={'where':_0x44b255[_0xe022('0x54')]};return db[_0xe022('0x43')][_0xe022('0x32')](_0x37c8e6)['then'](function(_0x27477a){_0x3fbb1e[_0xe022('0x32')]=_0x27477a;if(_0x1e2e63[_0xe022('0x4a')]['includeAll']){_0x44b255['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xe022('0x59')](_0x44b255);})[_0xe022('0x3a')](function(_0x185aed){_0x3fbb1e['rows']=_0x185aed;return _0x3fbb1e;})[_0xe022('0x3a')](respondWithFilteredResult(_0x2a7790,_0x44b255))[_0xe022('0x2d')](handleError(_0x2a7790,null));};exports['show']=function(_0x53ea53,_0x57d9c0){var _0x4abc7f={'raw':![],'where':{'id':_0x53ea53[_0xe022('0x5a')]['id']},'include':[{'model':db[_0xe022('0x41')],'as':_0xe022('0x42')}]},_0xe2c6ce={};_0xe2c6ce[_0xe022('0x48')]=_['keys'](db[_0xe022('0x43')][_0xe022('0x44')]);_0xe2c6ce[_0xe022('0x4a')]=_[_0xe022('0x4b')](_0x53ea53['query']);_0xe2c6ce[_0xe022('0x4c')]=_[_0xe022('0x4d')](_0xe2c6ce[_0xe022('0x48')],_0xe2c6ce[_0xe022('0x4a')]);_0x4abc7f[_0xe022('0x4e')]=_[_0xe022('0x4d')](_0xe2c6ce['model'],qs[_0xe022('0x4f')](_0x53ea53[_0xe022('0x4a')]['fields']));_0x4abc7f[_0xe022('0x4e')]=_0x4abc7f[_0xe022('0x4e')]['length']?_0x4abc7f[_0xe022('0x4e')]:_0xe2c6ce[_0xe022('0x48')];if(_0x53ea53[_0xe022('0x4a')][_0xe022('0x5b')]){_0x4abc7f[_0xe022('0x5c')]=[{'all':!![]}];}_0x4abc7f=_[_0xe022('0x57')]({},_0x4abc7f,_0x53ea53[_0xe022('0x58')]);return db[_0xe022('0x43')][_0xe022('0x5d')](_0x4abc7f)[_0xe022('0x3a')](handleEntityNotFound(_0x57d9c0,null))[_0xe022('0x3a')](respondWithResult(_0x57d9c0,null))['catch'](handleError(_0x57d9c0,null));};exports['create']=function(_0x26d539,_0x502dc3){return db[_0xe022('0x43')][_0xe022('0x5e')](_0x26d539['body'],{})[_0xe022('0x3a')](function(_0x3c0292){var _0x2f318e=_0x26d539[_0xe022('0x5f')][_0xe022('0x60')]({'plain':!![]});if(!_0x2f318e)throw new Error(_0xe022('0x61'));if(_0x2f318e['role']===_0xe022('0x5f')){var _0x35bbc1=_0x3c0292[_0xe022('0x60')]({'plain':!![]});var _0x51c5cb=_0xe022('0x3b');return db[_0xe022('0x62')][_0xe022('0x5d')]({'where':{'name':_0x51c5cb,'userProfileId':_0x2f318e[_0xe022('0x63')]},'raw':!![]})[_0xe022('0x3a')](function(_0x40b300){if(_0x40b300&&_0x40b300['autoAssociation']===0x0){return db[_0xe022('0x3c')][_0xe022('0x5e')]({'name':_0x35bbc1[_0xe022('0x3f')],'resourceId':_0x35bbc1['id'],'type':_0x40b300[_0xe022('0x3f')],'sectionId':_0x40b300['id']},{})[_0xe022('0x3a')](function(){return _0x3c0292;});}else{return _0x3c0292;}})[_0xe022('0x2d')](function(_0x33b485){logger[_0xe022('0x29')](_0xe022('0x64'),_0x33b485);throw _0x33b485;});}return _0x3c0292;})[_0xe022('0x3a')](respondWithResult(_0x502dc3,0xc9))[_0xe022('0x2d')](handleError(_0x502dc3,null));};exports[_0xe022('0x65')]=function(_0x142737,_0x3965d1){if(_0x142737[_0xe022('0x66')]['id']){delete _0x142737[_0xe022('0x66')]['id'];}return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x142737[_0xe022('0x5a')]['id']},'include':[{'model':db[_0xe022('0x41')],'as':_0xe022('0x42')}]})[_0xe022('0x3a')](handleEntityNotFound(_0x3965d1,null))[_0xe022('0x3a')](saveUpdates(_0x142737[_0xe022('0x66')],null))[_0xe022('0x3a')](respondWithResult(_0x3965d1,null))[_0xe022('0x2d')](handleError(_0x3965d1,null));};exports['destroy']=function(_0x45acbd,_0xcdfc5d){return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x45acbd[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0xcdfc5d,null))['then'](removeEntity(_0xcdfc5d,null))[_0xe022('0x2d')](handleError(_0xcdfc5d,null));};exports[_0xe022('0x67')]=function(_0x58066c,_0x478f53){return db[_0xe022('0x43')][_0xe022('0x67')]()[_0xe022('0x3a')](respondWithResult(_0x478f53,null))[_0xe022('0x2d')](handleError(_0x478f53,null));};exports[_0xe022('0x68')]=function(_0xdc1a13,_0x35b410,_0x187fed){if(_0xdc1a13[_0xe022('0x66')]['id']){delete _0xdc1a13[_0xe022('0x66')]['id'];}return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0xdc1a13[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x35b410,null))[_0xe022('0x3a')](function(_0x2237cb){if(_0x2237cb){_0xdc1a13[_0xe022('0x66')][_0xe022('0x69')]=_0x2237cb['id'];return db[_0xe022('0x6a')][_0xe022('0x5e')](_0xdc1a13[_0xe022('0x66')]);}})[_0xe022('0x3a')](respondWithResult(_0x35b410,null))['catch'](handleError(_0x35b410,null));};exports[_0xe022('0x6b')]=function(_0x13492c,_0x1a54a0,_0x42849f){var _0x484eff={'raw':![],'where':{}};var _0x863835={};var _0x45c728={'count':0x0,'rows':[]};return db[_0xe022('0x43')][_0xe022('0x6c')]({'where':{'id':_0x13492c['params']['id']}})['then'](handleEntityNotFound(_0x1a54a0,null))[_0xe022('0x3a')](function(_0x332d46){if(_0x332d46){_0x863835['model']=_[_0xe022('0x4b')](db[_0xe022('0x6a')][_0xe022('0x44')]);_0x863835[_0xe022('0x4a')]=_[_0xe022('0x4b')](_0x13492c[_0xe022('0x4a')]);_0x863835[_0xe022('0x4c')]=_[_0xe022('0x4d')](_0x863835[_0xe022('0x48')],_0x863835[_0xe022('0x4a')]);_0x484eff[_0xe022('0x4e')]=_[_0xe022('0x4d')](_0x863835[_0xe022('0x48')],qs['fields'](_0x13492c[_0xe022('0x4a')][_0xe022('0x4f')]));_0x484eff[_0xe022('0x4e')]=_0x484eff[_0xe022('0x4e')][_0xe022('0x50')]?_0x484eff['attributes']:_0x863835[_0xe022('0x48')];if(!_0x13492c['query'][_0xe022('0x51')](_0xe022('0x52'))){_0x484eff[_0xe022('0x34')]=qs[_0xe022('0x34')](_0x13492c[_0xe022('0x4a')][_0xe022('0x34')]);_0x484eff[_0xe022('0x33')]=qs[_0xe022('0x33')](_0x13492c[_0xe022('0x4a')][_0xe022('0x33')]);}_0x484eff[_0xe022('0x6d')]=qs[_0xe022('0x53')](_0x13492c[_0xe022('0x4a')][_0xe022('0x53')]);_0x484eff[_0xe022('0x54')]=qs[_0xe022('0x4c')](_[_0xe022('0x55')](_0x13492c['query'],_0x863835[_0xe022('0x4c')]));_0x484eff[_0xe022('0x54')][_0xe022('0x69')]=_0x332d46['id'];if(_0x13492c[_0xe022('0x4a')][_0xe022('0x56')]){_0x484eff['where']=_['merge'](_0x484eff[_0xe022('0x54')],{'$or':_['map'](_0x484eff[_0xe022('0x4e')],function(_0x834bf2){var _0x59017f={};_0x59017f[_0x834bf2]={'$like':'%'+_0x13492c[_0xe022('0x4a')][_0xe022('0x56')]+'%'};return _0x59017f;})});}_0x484eff=_[_0xe022('0x57')]({},_0x484eff,_0x13492c[_0xe022('0x58')]);return db[_0xe022('0x6a')][_0xe022('0x32')]({'where':_0x484eff['where']})[_0xe022('0x3a')](function(_0x5c7efe){_0x45c728[_0xe022('0x32')]=_0x5c7efe;if(_0x13492c[_0xe022('0x4a')]['includeAll']){_0x484eff[_0xe022('0x5c')]=[{'all':!![]}];}return db[_0xe022('0x6a')][_0xe022('0x59')](_0x484eff);})[_0xe022('0x3a')](function(_0x2da740){_0x45c728[_0xe022('0x6e')]=_0x2da740;return _0x45c728;});}})['then'](respondWithFilteredResult(_0x1a54a0,_0x484eff))[_0xe022('0x2d')](handleError(_0x1a54a0,null));};exports[_0xe022('0x6f')]=function(_0x451a81,_0xe44437,_0x44c2c4){return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x451a81[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0xe44437,null))[_0xe022('0x3a')](function(_0x167565){if(_0x167565){return _0x167565[_0xe022('0x6f')](_0x451a81['query'][_0xe022('0x70')]);}})[_0xe022('0x3a')](respondWithStatusCode(_0xe44437,null))[_0xe022('0x2d')](handleError(_0xe44437,null));};exports['addAnswer']=function(_0x17b8d3,_0x1a091a,_0x4d0bba){if(_0x17b8d3[_0xe022('0x66')]['id']){delete _0x17b8d3[_0xe022('0x66')]['id'];}return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x17b8d3[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x1a091a,null))[_0xe022('0x3a')](function(_0x8fb0){if(_0x8fb0){_0x17b8d3[_0xe022('0x66')][_0xe022('0x69')]=_0x8fb0['id'];return db[_0xe022('0x71')][_0xe022('0x5e')](_0x17b8d3[_0xe022('0x66')]);}})[_0xe022('0x3a')](respondWithResult(_0x1a091a,null))[_0xe022('0x2d')](handleError(_0x1a091a,null));};exports['getAnswers']=function(_0x1dc01c,_0x3e8d39,_0x32cbb1){var _0x473bcb={'raw':![],'where':{}};var _0x295ea5={};var _0x43f81e={'count':0x0,'rows':[]};return db[_0xe022('0x43')][_0xe022('0x6c')]({'where':{'id':_0x1dc01c['params']['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x3e8d39,null))[_0xe022('0x3a')](function(_0x40f61d){if(_0x40f61d){_0x295ea5[_0xe022('0x48')]=_['keys'](db[_0xe022('0x71')][_0xe022('0x44')]);_0x295ea5[_0xe022('0x4a')]=_[_0xe022('0x4b')](_0x1dc01c[_0xe022('0x4a')]);_0x295ea5[_0xe022('0x4c')]=_[_0xe022('0x4d')](_0x295ea5[_0xe022('0x48')],_0x295ea5[_0xe022('0x4a')]);_0x473bcb['attributes']=_[_0xe022('0x4d')](_0x295ea5[_0xe022('0x48')],qs[_0xe022('0x4f')](_0x1dc01c['query'][_0xe022('0x4f')]));_0x473bcb[_0xe022('0x4e')]=_0x473bcb['attributes'][_0xe022('0x50')]?_0x473bcb['attributes']:_0x295ea5[_0xe022('0x48')];if(!_0x1dc01c[_0xe022('0x4a')][_0xe022('0x51')](_0xe022('0x52'))){_0x473bcb['limit']=qs['limit'](_0x1dc01c['query'][_0xe022('0x34')]);_0x473bcb[_0xe022('0x33')]=qs[_0xe022('0x33')](_0x1dc01c[_0xe022('0x4a')][_0xe022('0x33')]);}_0x473bcb[_0xe022('0x6d')]=qs[_0xe022('0x53')](_0x1dc01c['query'][_0xe022('0x53')]);_0x473bcb[_0xe022('0x54')]=qs[_0xe022('0x4c')](_['pick'](_0x1dc01c['query'],_0x295ea5[_0xe022('0x4c')]));_0x473bcb['where']['ChatWebsiteId']=_0x40f61d['id'];if(_0x1dc01c[_0xe022('0x4a')][_0xe022('0x56')]){_0x473bcb[_0xe022('0x54')]=_[_0xe022('0x57')](_0x473bcb[_0xe022('0x54')],{'$or':_[_0xe022('0x49')](_0x473bcb[_0xe022('0x4e')],function(_0x3a3e67){var _0x36d988={};_0x36d988[_0x3a3e67]={'$like':'%'+_0x1dc01c[_0xe022('0x4a')][_0xe022('0x56')]+'%'};return _0x36d988;})});}_0x473bcb=_[_0xe022('0x57')]({},_0x473bcb,_0x1dc01c['options']);return db[_0xe022('0x71')]['count']({'where':_0x473bcb[_0xe022('0x54')]})['then'](function(_0x266a14){_0x43f81e['count']=_0x266a14;if(_0x1dc01c[_0xe022('0x4a')][_0xe022('0x5b')]){_0x473bcb[_0xe022('0x5c')]=[{'all':!![]}];}return db[_0xe022('0x71')][_0xe022('0x59')](_0x473bcb);})[_0xe022('0x3a')](function(_0x1996ad){_0x43f81e['rows']=_0x1996ad;return _0x43f81e;});}})[_0xe022('0x3a')](respondWithFilteredResult(_0x3e8d39,_0x473bcb))[_0xe022('0x2d')](handleError(_0x3e8d39,null));};exports['removeAnswers']=function(_0x282b88,_0x55fa08,_0x1830ae){return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x282b88['params']['id']}})['then'](handleEntityNotFound(_0x55fa08,null))['then'](function(_0x5d1449){if(_0x5d1449){return _0x5d1449[_0xe022('0x72')](_0x282b88[_0xe022('0x4a')][_0xe022('0x70')]);}})[_0xe022('0x3a')](respondWithStatusCode(_0x55fa08,null))[_0xe022('0x2d')](handleError(_0x55fa08,null));};exports[_0xe022('0x73')]=function(_0x3dc013,_0x48392f,_0x402f10){_0x3dc013[_0xe022('0x66')]['sitepic']=_0x3dc013[_0xe022('0x74')][_0xe022('0x75')];return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x3dc013[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x48392f,null))['then'](saveUpdates(_0x3dc013[_0xe022('0x66')],null))[_0xe022('0x3a')](respondWithResult(_0x48392f,null))[_0xe022('0x2d')](handleError(_0x48392f,null));};exports['addAvatar']=function(_0x2dfbfa,_0x462a27,_0x12f622){_0x2dfbfa['body'][_0xe022('0x76')]=_0x2dfbfa[_0xe022('0x74')][_0xe022('0x75')];return db['ChatWebsite'][_0xe022('0x5d')]({'where':{'id':_0x2dfbfa['params']['id']}})['then'](handleEntityNotFound(_0x462a27,null))[_0xe022('0x3a')](saveUpdates(_0x2dfbfa[_0xe022('0x66')],null))['then'](respondWithResult(_0x462a27,null))[_0xe022('0x2d')](handleError(_0x462a27,null));};exports['addCustomerAvatar']=function(_0x4ef670,_0xae96f2,_0xbf3575){_0x4ef670[_0xe022('0x66')][_0xe022('0x77')]=_0x4ef670[_0xe022('0x74')][_0xe022('0x75')];return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x4ef670[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0xae96f2,null))[_0xe022('0x3a')](saveUpdates(_0x4ef670['body'],null))[_0xe022('0x3a')](respondWithResult(_0xae96f2,null))[_0xe022('0x2d')](handleError(_0xae96f2,null));};exports[_0xe022('0x78')]=function(_0x5d4f59,_0x42d847,_0x3857aa){_0x5d4f59[_0xe022('0x66')][_0xe022('0x79')]=_0x5d4f59['file'][_0xe022('0x75')];return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x5d4f59[_0xe022('0x5a')]['id']}})['then'](handleEntityNotFound(_0x42d847,null))[_0xe022('0x3a')](saveUpdates(_0x5d4f59[_0xe022('0x66')],null))[_0xe022('0x3a')](respondWithResult(_0x42d847,null))['catch'](handleError(_0x42d847,null));};exports[_0xe022('0x7a')]=function(_0x5f1f5a,_0x436e64,_0x28428b){var _0x43e6ae=path['join'](config[_0xe022('0x7b')],_0xe022('0x7c'));var _0x269e38={'where':{'id':_0x5f1f5a[_0xe022('0x5a')]['id']},'attributes':['id',_0xe022('0x7d')],'raw':!![]};var _0x4a3027=![];return require('../../config/license/util')[_0xe022('0x7e')]()[_0xe022('0x3a')](function(_0x478193){if(_0x478193){_0x4a3027=_0x478193[_0xe022('0x7f')];}})[_0xe022('0x3a')](function(){return db[_0xe022('0x43')][_0xe022('0x5d')](_0x269e38);})[_0xe022('0x3a')](handleEntityNotFound(_0x436e64,null))['then'](function(_0xf08a87){if(_0xf08a87){if(!_[_0xe022('0x80')](_0xf08a87[_0xe022('0x7d')])){if(fs[_0xe022('0x81')](path[_0xe022('0x82')](config[_0xe022('0x7b')],_0xe022('0x83'),_0xf08a87[_0xe022('0x7d')]))&&_0x4a3027){_0x43e6ae=path[_0xe022('0x82')](config[_0xe022('0x7b')],_0xe022('0x83'),_0xf08a87[_0xe022('0x7d')]);}}return _0x436e64[_0xe022('0x84')](_0x43e6ae);}})[_0xe022('0x2d')](handleError(_0x436e64,null));};exports[_0xe022('0x85')]=function(_0x3e2dad,_0x2d8634,_0x1cb694){var _0x3190d2=path[_0xe022('0x82')](config[_0xe022('0x7b')],_0xe022('0x86'));var _0x4967a2={'where':{'id':_0x3e2dad[_0xe022('0x5a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe022('0x43')]['find'](_0x4967a2)[_0xe022('0x3a')](handleEntityNotFound(_0x2d8634,null))[_0xe022('0x3a')](function(_0x31bd94){if(_0x31bd94){if(!_['isNil'](_0x31bd94['agentAvatar'])){if(fs[_0xe022('0x81')](path['join'](config[_0xe022('0x7b')],_0xe022('0x87'),_0x31bd94[_0xe022('0x76')]))){_0x3190d2=path['join'](config[_0xe022('0x7b')],_0xe022('0x87'),_0x31bd94['agentAvatar']);}}return _0x2d8634['download'](_0x3190d2);}})[_0xe022('0x2d')](handleError(_0x2d8634,null));};exports[_0xe022('0x88')]=function(_0x5329b2,_0x34a305,_0x1ca1fd){var _0x4995f1=path['join'](config['root'],_0xe022('0x89'));var _0x3ff88c={'where':{'id':_0x5329b2[_0xe022('0x5a')]['id']},'attributes':['id',_0xe022('0x77'),'showCustomerAvatar'],'raw':!![]};return db[_0xe022('0x43')][_0xe022('0x5d')](_0x3ff88c)[_0xe022('0x3a')](handleEntityNotFound(_0x34a305,null))['then'](function(_0x55c43e){if(_0x55c43e){if(!_['isNil'](_0x55c43e[_0xe022('0x77')])){if(fs[_0xe022('0x81')](path[_0xe022('0x82')](config[_0xe022('0x7b')],'server/files/images/avatars/',_0x55c43e[_0xe022('0x77')]))&&_0x55c43e['showCustomerAvatar']){_0x4995f1=path[_0xe022('0x82')](config[_0xe022('0x7b')],_0xe022('0x87'),_0x55c43e[_0xe022('0x77')]);}}return _0x34a305[_0xe022('0x84')](_0x4995f1);}})['catch'](handleError(_0x34a305,null));};exports[_0xe022('0x8a')]=function(_0x395e50,_0x1abef4,_0x304e45){var _0x583ce1=path[_0xe022('0x82')](config[_0xe022('0x7b')],_0xe022('0x8b'));var _0x2bcde2={'where':{'id':_0x395e50[_0xe022('0x5a')]['id']},'attributes':['id',_0xe022('0x79')],'raw':!![]};return db[_0xe022('0x43')]['find'](_0x2bcde2)[_0xe022('0x3a')](handleEntityNotFound(_0x1abef4,null))[_0xe022('0x3a')](function(_0x56a6af){if(_0x56a6af){if(!_[_0xe022('0x80')](_0x56a6af['systemAvatar'])){if(fs['existsSync'](path[_0xe022('0x82')](config[_0xe022('0x7b')],_0xe022('0x87'),_0x56a6af[_0xe022('0x79')]))){_0x583ce1=path[_0xe022('0x82')](config[_0xe022('0x7b')],_0xe022('0x87'),_0x56a6af[_0xe022('0x79')]);}}return _0x1abef4[_0xe022('0x84')](_0x583ce1);}})['catch'](handleError(_0x1abef4,null));};exports[_0xe022('0x8c')]=function(_0x41f5d5,_0x516d70,_0x34d8b9){var _0x2ad1f3=require(_0xe022('0x8d'));var _0x478019=new _0x2ad1f3();var _0x15001e=_0x478019[_0xe022('0x8e')](_0x41f5d5[_0xe022('0x8f')][_0xe022('0x90')])[_0xe022('0x91')]();var _0x39bc63={'body':_0x41f5d5['body'],'channel':_0xe022('0x92')};var _0x44c5c6=[];var _0x4134a6=[];var _0x1bc573={};var _0x3e0880=![];return db[_0xe022('0x93')][_0xe022('0x67')]()[_0xe022('0x3a')](function(_0xf153ff){if(!_0xf153ff){throw new db[(_0xe022('0x20'))][(_0xe022('0x21'))](_0xe022('0x94'));}_0x44c5c6=_[_0xe022('0x95')](_[_0xe022('0x4b')](_0xf153ff),[_0xe022('0x96'),_0xe022('0x97')]);_0x4134a6=_['difference'](_[_0xe022('0x4b')](_0xf153ff),[_0xe022('0x96'),_0xe022('0x97'),_0xe022('0x98'),_0xe022('0x99')]);if(_0x41f5d5['body']['id']){delete _0x41f5d5[_0xe022('0x66')]['id'];}if(_[_0xe022('0x80')](_0x41f5d5[_0xe022('0x66')][_0xe022('0x9a')])){throw new db[(_0xe022('0x20'))][(_0xe022('0x21'))](_0xe022('0x9b'));}if(_['isNil'](_0x41f5d5[_0xe022('0x66')]['body'])||_0x41f5d5[_0xe022('0x66')][_0xe022('0x66')]===''){throw new db[(_0xe022('0x20'))][(_0xe022('0x21'))](_0xe022('0x9c'));}if(_[_0xe022('0x80')](_0x41f5d5['body']['mapKey'])){throw new db[(_0xe022('0x20'))][(_0xe022('0x21'))](_0xe022('0x9d')+_0x4134a6);}if(!_[_0xe022('0x9e')](_0x4134a6,_0x41f5d5[_0xe022('0x66')][_0xe022('0x9f')])){throw new db[(_0xe022('0x20'))]['ValidationError'](_0xe022('0xa0')+_0x4134a6);}_0x1bc573[_0x41f5d5['body'][_0xe022('0x9f')]]=_0x41f5d5[_0xe022('0x66')][_0xe022('0x9a')];})['then'](function(){return db[_0xe022('0x43')]['find']({'where':{'id':_0x41f5d5[_0xe022('0x5a')]['id']},'include':[{'model':db[_0xe022('0xa1')],'as':_0xe022('0xa2'),'include':[{'model':db['CmContact'],'as':_0xe022('0xa3'),'where':_0x1bc573,'limit':0x1,'order':[[_0xe022('0x97'),_0xe022('0xa4')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x516d70,null))[_0xe022('0x3a')](function(_0x1b997b){if(_0x1b997b&&_0x1b997b[_0xe022('0xa2')]){_0x39bc63[_0xe022('0xa5')]=_0x1b997b;_0x39bc63[_0xe022('0xa6')]=_0x1b997b[_0xe022('0xa7')];_0x39bc63[_0xe022('0xa8')]=_0x1b997b['List'];_0x39bc63[_0xe022('0xa6')]=_['orderBy'](_0x39bc63[_0xe022('0xa6')],[_0xe022('0xa9')],[_0xe022('0xaa')]);if(_0x39bc63['account']['Applications']){delete _0x39bc63['account']['Applications'];}if(_0x39bc63[_0xe022('0xa5')][_0xe022('0xa2')]&&_0x39bc63[_0xe022('0xa5')]['List']['Contacts'][_0xe022('0x50')]){return _0x39bc63[_0xe022('0xa5')][_0xe022('0xa2')][_0xe022('0xa3')][0x0];}var _0x1177b3=_['defaults'](_0x41f5d5[_0xe022('0x66')],{'firstName':_0x41f5d5[_0xe022('0x66')]['from'],'ListId':_0x1b997b[_0xe022('0x99')]});_0x1177b3[_0x41f5d5['body'][_0xe022('0x9f')]]=_0x41f5d5[_0xe022('0x66')]['from'];return db[_0xe022('0x93')][_0xe022('0x5e')](_0x1177b3,{'fields':_0x44c5c6,'raw':!![]});}})[_0xe022('0x3a')](handleEntityNotFound(_0x516d70,null))[_0xe022('0x3a')](function(_0x2fa4a9){_0x39bc63[_0xe022('0xab')]=_0x2fa4a9;var _0x2ee651=_0x41f5d5[_0xe022('0x66')]['customerIp'];if(_0x41f5d5[_0xe022('0x8f')]['cf-connecting-ip']){_0x2ee651=_0x41f5d5[_0xe022('0x8f')][_0xe022('0xac')];}else if(_0x41f5d5['headers']['x-forwarded-for']){_0x2ee651=_[_0xe022('0xad')](_0x41f5d5[_0xe022('0x8f')][_0xe022('0xae')]['split'](','));}if(_0x2fa4a9){var _0x692aae={'ContactId':_0x2fa4a9['id'],'ChatWebsiteId':_0x41f5d5[_0xe022('0x5a')]['id'],'from':(_0x2fa4a9[_0xe022('0xaf')]||'')+'\x20'+(_0x2fa4a9['lastName']||''),'customerIp':_0x2ee651,'customerPort':_0x41f5d5['headers'][_0xe022('0xb0')]?_0x41f5d5['headers']['x-real-port']:null,'referer':_0x41f5d5[_0xe022('0x66')][_0xe022('0xb1')],'browserName':_0x15001e[_0xe022('0xb2')]['name']&&_0x15001e[_0xe022('0xb2')][_0xe022('0xb3')]?util[_0xe022('0xb4')](_0xe022('0xb5'),_0x15001e[_0xe022('0xb2')][_0xe022('0x3f')],_0x15001e['browser']['version']):'unknown','browserVersion':_0x15001e[_0xe022('0xb2')][_0xe022('0xb3')]||'unknown','osName':util[_0xe022('0xb4')](_0xe022('0xb5'),_0x15001e['os'][_0xe022('0x3f')],_0x15001e['os']['version']),'osVersion':_0x15001e['os'][_0xe022('0xb3')],'deviceModel':_0x15001e[_0xe022('0xb6')][_0xe022('0x48')]&&_0x15001e[_0xe022('0xb6')]['vendor']?util[_0xe022('0xb4')](_0xe022('0xb7'),_0x15001e[_0xe022('0xb6')][_0xe022('0x48')],_0x15001e[_0xe022('0xb6')][_0xe022('0xb8')],_0x15001e[_0xe022('0xb6')]['type']):null,'deviceVendor':_0x15001e[_0xe022('0xb6')][_0xe022('0xb8')],'deviceType':_0x15001e[_0xe022('0xb6')]['type'],'formData':JSON['stringify'](_0x41f5d5[_0xe022('0x66')])};var _0x1fd69f={'ChatWebsiteId':_0x41f5d5[_0xe022('0x5a')]['id'],'closed':![]};if(_0x41f5d5[_0xe022('0x66')][_0xe022('0xb9')]){_0x1fd69f[_0xe022('0xb9')]=_0x41f5d5['body'][_0xe022('0xb9')];return db['ChatInteraction'][_0xe022('0x5d')]({'where':_0x1fd69f})[_0xe022('0x3a')](function(_0x49965b){if(_0x49965b){return[_0x49965b,![]];}_0x692aae[_0xe022('0xb9')]=_0x41f5d5[_0xe022('0x66')][_0xe022('0xb9')];_0x692aae[_0xe022('0xba')]=_0x41f5d5[_0xe022('0x66')][_0xe022('0xba')];return db[_0xe022('0xbb')][_0xe022('0x5e')](_0x692aae)[_0xe022('0x3a')](function(_0xf81771){return[_0xf81771,!![]];});});}_0x1fd69f[_0xe022('0xbc')]=_0x2fa4a9['id'];if(_0x41f5d5[_0xe022('0x66')][_0xe022('0xbd')]&&_0x41f5d5[_0xe022('0x66')][_0xe022('0xbd')]['id']){_0x1fd69f['id']=_0x41f5d5[_0xe022('0x66')][_0xe022('0xbd')]['id'];return db['ChatInteraction']['find']({'where':_0x1fd69f})[_0xe022('0x3a')](function(_0x486d26){if(_0x486d26){return[_0x486d26,![]];}return db['ChatInteraction'][_0xe022('0x5e')](_0x692aae)[_0xe022('0x3a')](function(_0x18a1b4){return[_0x18a1b4,!![]];});});}return db[_0xe022('0xbb')][_0xe022('0x5e')](_0x692aae)[_0xe022('0x3a')](function(_0x112a3d){return[_0x112a3d,!![]];});}})[_0xe022('0xbe')](function(_0x32c182,_0x3b57e0){if(_0x32c182){_0x3e0880=_0x3b57e0;if(!_0x3b57e0){var _0x159e84={'from':(_0x39bc63['contact']['firstName']||'')+'\x20'+(_0x39bc63[_0xe022('0xab')][_0xe022('0xbf')]||'')};if(_0x41f5d5['body'][_0xe022('0xb9')]&&_0x41f5d5[_0xe022('0x66')][_0xe022('0xc0')]&&_0x41f5d5['body'][_0xe022('0xb9')]!=_0x41f5d5[_0xe022('0x66')][_0xe022('0xc0')]){_0x159e84[_0xe022('0xb9')]=_0x41f5d5['body'][_0xe022('0xc0')];}return _0x32c182[_0xe022('0x65')](_0x159e84);}else{return _0x32c182;}}})[_0xe022('0x3a')](function(_0x4857e8){_0x39bc63[_0xe022('0xbd')]=_0x4857e8[_0xe022('0x60')]({'plain':!![]});_0x39bc63['interaction'][_0xe022('0xc1')]=_0x3e0880;if(_0x39bc63['interaction']['created']){if(_0x39bc63['account'][_0xe022('0xc2')]){_0x39bc63[_0xe022('0xa6')][_0xe022('0xc3')]({'id':0x0,'priority':_0x39bc63['applications']['length']+0x1,'app':_0xe022('0xc4'),'appdata':_0xe022('0xc5'),'interval':_0xe022('0xc6')});}}return db[_0xe022('0xc7')][_0xe022('0x5e')]({'body':_0x41f5d5[_0xe022('0x66')][_0xe022('0x66')],'ChatWebsiteId':_0x41f5d5[_0xe022('0x5a')]['id'],'ChatInteractionId':_0x4857e8['id'],'direction':'in','ContactId':_0x39bc63['contact']['id'],'AttachmentId':_0x41f5d5[_0xe022('0x66')][_0xe022('0xc8')]});})[_0xe022('0x3a')](function(_0x188a45){_0x39bc63[_0xe022('0x2b')]=_0x188a45;if(_0x39bc63[_0xe022('0xbd')]['UserId']){return db[_0xe022('0xc9')][_0xe022('0x5d')]({'attributes':['id',_0xe022('0x3f')],'where':{'id':_0x39bc63[_0xe022('0xbd')][_0xe022('0xca')]}})['then'](function(_0x300f14){if(_0x300f14){_0x39bc63[_0xe022('0xa6')][_0xe022('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x300f14[_0xe022('0x3f')]+','+(_0x39bc63[_0xe022('0xa5')]['waitForTheAssignedAgent']||0xa),'interval':_0xe022('0xc6')});_0x39bc63[_0xe022('0xcc')]=!![];}return respondWithRpcPromise(_0xe022('0xcd'),_0xe022('0xce'),_0x39bc63);});}return respondWithRpcPromise(_0xe022('0xcd'),_0xe022('0xce'),_0x39bc63);})[_0xe022('0x3a')](function(_0xde8553){respondWithRpcPromise(_0xe022('0xcf'),'EventManager',{'event':_0xe022('0x8c'),'message':_0xde8553},client9002);return _0xde8553;})[_0xe022('0x3a')](respondWithResult(_0x516d70,null))[_0xe022('0x2d')](handleError(_0x516d70,null));};exports['offline']=function(_0x2382fc,_0x2fab4a,_0x19f60f){var _0x4e2391,_0x384200,_0x2d3ca6;var _0x5a5ef7=[];var _0x33672d=[];var _0x3c7b62={};return db[_0xe022('0x93')]['describe']()[_0xe022('0x3a')](function(_0x4bba3e){if(!_0x4bba3e){throw new db['Sequelize'][(_0xe022('0x21'))](_0xe022('0x94'));}_0x33672d=_[_0xe022('0x95')](_[_0xe022('0x4b')](_0x4bba3e),[_0xe022('0x96'),_0xe022('0x97')]);_0x5a5ef7=_[_0xe022('0x95')](_[_0xe022('0x4b')](_0x4bba3e),['createdAt',_0xe022('0x97'),_0xe022('0x98'),_0xe022('0x99')]);if(_0x2382fc[_0xe022('0x66')]['id']){delete _0x2382fc['body']['id'];}if(_[_0xe022('0x80')](_0x2382fc[_0xe022('0x66')]['from'])){throw _0x2fab4a[_0xe022('0x2f')](0x1f4)[_0xe022('0x40')](new db[(_0xe022('0x20'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x2382fc['body'][_0xe022('0x66')])||_0x2382fc[_0xe022('0x66')][_0xe022('0x66')]===''){throw _0x2fab4a[_0xe022('0x2f')](0x1f4)[_0xe022('0x40')](new db[(_0xe022('0x20'))][(_0xe022('0x21'))](_0xe022('0x9c')));}if(_[_0xe022('0x80')](_0x2382fc[_0xe022('0x66')][_0xe022('0xd0')])){throw _0x2fab4a[_0xe022('0x2f')](0x1f4)['send'](new db[(_0xe022('0x20'))][(_0xe022('0x21'))](_0xe022('0xd1')+_0x5a5ef7));}if(!_[_0xe022('0x9e')](_0x5a5ef7,_0x2382fc[_0xe022('0x66')][_0xe022('0xd0')])){throw _0x2fab4a['status'](0x1f4)['send'](new db[(_0xe022('0x20'))][(_0xe022('0x21'))](_0xe022('0xd2')+_0x5a5ef7));}_0x3c7b62[_0x2382fc[_0xe022('0x66')][_0xe022('0xd0')]]=_0x2382fc['body'][_0xe022('0x9a')];})[_0xe022('0x3a')](function(){return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x2382fc[_0xe022('0x5a')]['id']},'include':[{'model':db[_0xe022('0xa1')],'as':_0xe022('0xa2')}]});})[_0xe022('0x3a')](handleEntityNotFound(_0x2fab4a,null))[_0xe022('0x3a')](function(_0x3ce91e){if(_0x3ce91e&&_0x3ce91e[_0xe022('0xa2')]){_0x384200=_0x3ce91e;var _0x2ceaa3=_[_0xe022('0x18')](_0x2382fc['body'],{'firstName':_0x2382fc[_0xe022('0x66')][_0xe022('0x9a')],'phone':_0x2382fc[_0xe022('0x66')][_0xe022('0x9a')],'ListId':_0x3ce91e[_0xe022('0x99')]});_0x2ceaa3[_0x2382fc[_0xe022('0x66')]['mapKeyOffline']]=_0x2382fc[_0xe022('0x66')][_0xe022('0x9a')];return db[_0xe022('0x93')][_0xe022('0xd3')]({'where':_0x3c7b62,'defaults':_0x2ceaa3});}})['spread'](function(_0xd4296c){if(_0xd4296c){_0x2d3ca6=_0xd4296c;var _0x70471c=fs[_0xe022('0xd4')](path['join'](config[_0xe022('0x7b')],_0xe022('0xd5')),_0xe022('0xd6'));var _0x5de272=ejs['render'](_0x70471c,{'body':_[_0xe022('0xd7')](_0x2382fc['body'][_0xe022('0x66')]),'bodyTitle':_0x384200[_0xe022('0xd8')]});return db[_0xe022('0xd9')][_0xe022('0x5e')]({'body':_0x5de272,'ContactId':_0xd4296c['id'],'ChatWebsiteId':_0x384200['id']});}})[_0xe022('0x3a')](function(_0x194be0){if(_0x194be0){_0x4e2391=_0x194be0;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe022('0xda')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x12d255){if(_0x12d255&&_0x12d255[_0xe022('0xdb')]&&_0x384200[_0xe022('0xdc')]){var _0x4d8411={'tls':{'rejectUnauthorized':![]}};if(_0x12d255[_0xe022('0xdb')][_0xe022('0xdd')]){_0x4d8411['service']=_0x12d255[_0xe022('0xdb')][_0xe022('0xdd')];}else{_0x4d8411[_0xe022('0xde')]=_0x12d255[_0xe022('0xdb')][_0xe022('0xde')];_0x4d8411[_0xe022('0xdf')]=_0x12d255[_0xe022('0xdb')][_0xe022('0xdf')];_0x4d8411[_0xe022('0xe0')]=_0x12d255['Smtp'][_0xe022('0xe0')];}if(_0x12d255[_0xe022('0xdb')]['authentication']){_0x4d8411['auth']={'user':_0x12d255[_0xe022('0xdb')][_0xe022('0x5f')],'pass':_0x12d255[_0xe022('0xdb')][_0xe022('0xe1')]};}return respondWithRpcPromise('SendMail',_0xe022('0xe2'),{'account':_0x4d8411,'message':{'from':util[_0xe022('0xb4')](_0xe022('0xe3'),_0x12d255[_0xe022('0x3f')],_0x12d255[_0xe022('0xe4')]||_0x12d255[_0xe022('0xdb')]['user']),'to':_0x384200[_0xe022('0xdc')],'subject':_0x384200[_0xe022('0xe5')],'text':_0x4e2391['body']}},client9003)['then'](function(){return _0x4e2391;})[_0xe022('0x2d')](function(_0x77c915){console[_0xe022('0x29')](_0x77c915);});}})['then'](function(){if(_0x4e2391){return _0x4e2391;}})['then'](respondWithResult(_0x2fab4a,null))['catch'](handleError(_0x2fab4a,null));};exports['addInteraction']=function(_0x5030c1,_0x1975aa,_0x4c32b7){return db[_0xe022('0xbb')][_0xe022('0x5d')]({'where':{'id':_0x5030c1['params']['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x1975aa,null))['then'](function(_0x276e1a){if(_0x276e1a){return _0x276e1a['addInteraction'](_0x5030c1[_0xe022('0x66')][_0xe022('0x70')],_['omit'](_0x5030c1[_0xe022('0x66')],[_0xe022('0x70'),'id'])||{});}})['then'](respondWithResult(_0x1975aa,null))[_0xe022('0x2d')](handleError(_0x1975aa,null));};exports['getInteractions']=function(_0xfe407b,_0x1b15d3,_0x4efaa3){var _0x1155ea={'raw':![],'where':{}};var _0x424a97={};var _0x10732d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe022('0x6c')]({'where':{'id':_0xfe407b[_0xe022('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1b15d3,null))[_0xe022('0x3a')](function(_0x58d0a7){if(_0x58d0a7){_0x424a97[_0xe022('0x48')]=_['keys'](db[_0xe022('0xbb')][_0xe022('0x44')]);_0x424a97[_0xe022('0x4a')]=_['keys'](_0xfe407b['query']);_0x424a97['filters']=_[_0xe022('0x4d')](_0x424a97[_0xe022('0x48')],_0x424a97['query']);_0x1155ea[_0xe022('0x4e')]=_['intersection'](_0x424a97[_0xe022('0x48')],qs[_0xe022('0x4f')](_0xfe407b[_0xe022('0x4a')]['fields']));_0x1155ea['attributes']=_0x1155ea[_0xe022('0x4e')][_0xe022('0x50')]?_0x1155ea[_0xe022('0x4e')]:_0x424a97[_0xe022('0x48')];if(!_0xfe407b[_0xe022('0x4a')][_0xe022('0x51')]('nolimit')){_0x1155ea[_0xe022('0x34')]=qs['limit'](_0xfe407b['query'][_0xe022('0x34')]);_0x1155ea[_0xe022('0x33')]=qs[_0xe022('0x33')](_0xfe407b[_0xe022('0x4a')][_0xe022('0x33')]);}_0x1155ea[_0xe022('0x6d')]=qs[_0xe022('0x53')](_0xfe407b['query'][_0xe022('0x53')]);_0x1155ea[_0xe022('0x54')]=qs[_0xe022('0x4c')](_[_0xe022('0x55')](_0xfe407b[_0xe022('0x4a')],_0x424a97[_0xe022('0x4c')]));_0x1155ea[_0xe022('0x54')][_0xe022('0x69')]=_0x58d0a7['id'];if(_0xfe407b[_0xe022('0x4a')][_0xe022('0x56')]){_0x1155ea[_0xe022('0x54')]=_[_0xe022('0x57')](_0x1155ea[_0xe022('0x54')],{'$or':_[_0xe022('0x49')](_0x1155ea['attributes'],function(_0x2084c8){var _0x1b6e8e={};_0x1b6e8e[_0x2084c8]={'$like':'%'+_0xfe407b[_0xe022('0x4a')]['filter']+'%'};return _0x1b6e8e;})});}_0x1155ea=_['merge']({},_0x1155ea,_0xfe407b[_0xe022('0x58')]);return db[_0xe022('0xbb')][_0xe022('0x32')]({'where':_0x1155ea[_0xe022('0x54')]})[_0xe022('0x3a')](function(_0x21d7f9){_0x10732d['count']=_0x21d7f9;if(_0xfe407b['query'][_0xe022('0x5b')]){_0x1155ea[_0xe022('0x5c')]=[{'model':db[_0xe022('0x93')],'as':_0xe022('0xe6'),'required':![]},{'model':db[_0xe022('0xc9')],'as':_0xe022('0xe7'),'attributes':[_0xe022('0x3f'),_0xe022('0xe8'),_0xe022('0xe9')],'required':![]},{'model':db[_0xe022('0xea')],'as':_0xe022('0xeb'),'attributes':['id',_0xe022('0x3f'),_0xe022('0xec')],'where':_0xfe407b[_0xe022('0x4a')][_0xe022('0xed')]?{'id':_0xfe407b[_0xe022('0x4a')][_0xe022('0xed')]}:undefined,'required':_0xfe407b[_0xe022('0x4a')]['tag']?!![]:![]}];}return db[_0xe022('0xbb')][_0xe022('0x59')](_0x1155ea);})[_0xe022('0x3a')](function(_0x31e0cd){_0x10732d[_0xe022('0x6e')]=_0x31e0cd;return _0x10732d;});}})['then'](respondWithFilteredResult(_0x1b15d3,_0x1155ea))[_0xe022('0x2d')](handleError(_0x1b15d3,null));};function iftimePromise(_0x5d1992,_0x2b4d64){return respondWithRpcPromise(_0xe022('0xee'),'getSnippet',{'command':_0x2b4d64['timezone']?util[_0xe022('0xb4')]('iftime\x20%s,%s',_0x5d1992[_0xe022('0xef')],_0x2b4d64['timezone']):util['format']('iftime\x20%s',_0x5d1992[_0xe022('0xef')])},client9002)[_0xe022('0x3a')](function(_0x39e385){var _0x4481e2=_0x39e385&&_0x39e385[_0xe022('0xf0')](_0xe022('0xf1'))>=0x0?!![]:![];logger[_0xe022('0x24')](_0xe022('0xf2'),_0x2b4d64['id'],_0x5d1992['id'],_0x5d1992[_0xe022('0xef')],_0x4481e2?'ONLINE':_0xe022('0xf3'),_0x2b4d64['timezone']?_0x2b4d64['timezone']:_0xe022('0xf4'));return _0x4481e2;})['catch'](function(_0x2f1378){logger[_0xe022('0x29')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2b4d64['id'],_0x5d1992['id'],_0x5d1992[_0xe022('0xef')],util[_0xe022('0xf5')](_0x2f1378,{'showHidden':![],'depth':null}),_0x2b4d64[_0xe022('0xf6')]?_0x2b4d64[_0xe022('0xf6')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x1bb28a,_0x1632c6,_0x37cf42){var _0x7433bf=0x0;var _0x402264=0x0;var _0x127d5d=![];var _0x5117ad;var _0x25c026;return db[_0xe022('0x43')]['find']({'where':{'id':_0x1bb28a['params']['id']},'include':[{'model':db[_0xe022('0xf7')],'as':_0xe022('0xf7'),'include':[{'model':db[_0xe022('0xf7')],'as':_0xe022('0xf8'),'attributes':['id',_0xe022('0xef')],'raw':!![]}]}]})[_0xe022('0x3a')](handleEntityNotFound(_0x1632c6,null))['then'](function(_0x2d28f5){if(_0x2d28f5){_0x5117ad=_0x2d28f5;return _0x2d28f5[_0xe022('0xf9')]({'raw':!![]});}})[_0xe022('0x3a')](function(_0x5211b5){if(_0x5117ad){if(_0x5211b5){_0x25c026=_0x5211b5;}}return require('../../config/license/util')[_0xe022('0x7e')]();})[_0xe022('0x3a')](function(_0x425bbe){if(_0x425bbe){_0x402264=_0x425bbe[_0xe022('0xfa')];_0x127d5d=_0x425bbe['custom'];}})[_0xe022('0x3a')](function(){return db[_0xe022('0xbb')][_0xe022('0x32')]({'where':{'closed':![]}});})[_0xe022('0x3a')](function(_0x2140d4){_0x7433bf=_0x2140d4;if(_0x402264&&_0x2140d4>_0x402264){return db[_0xe022('0xfb')][_0xe022('0x6c')]({'where':{'id':0x1}})[_0xe022('0x3a')](function(_0x51aae3){if(_0x51aae3){_0x51aae3[_0xe022('0xfc')]('chatLicenseExceeded');}});}})[_0xe022('0x3a')](function(){if(_0x5117ad[_0xe022('0xf7')]&&_0x5117ad[_0xe022('0xf7')][_0xe022('0xf8')]){var _0x265af9=[];for(var _0x1133c2=0x0;_0x1133c2<_0x5117ad[_0xe022('0xf7')]['Intervals'][_0xe022('0x50')];_0x1133c2++){var _0x385ff3=_0x5117ad[_0xe022('0xf7')][_0xe022('0xf8')][_0x1133c2][_0xe022('0x60')]({'plain':!![]});_0x265af9['push'](iftimePromise(_0x385ff3,_0x5117ad));}return BPromise[_0xe022('0xfd')](_0x265af9)[_0xe022('0x3a')](function(_0x364f97){return _['some'](_0x364f97);});}else{return!![];}})[_0xe022('0x3a')](function(_0x535d1c){var _0x2706eb=fs[_0xe022('0xd4')](path[_0xe022('0x82')](config[_0xe022('0x7b')],'server/files/chat/iframe.js'),_0xe022('0xd6'));var _0x162420={'remote':_0x5117ad['remote'],'query':querystring['stringify'](_['merge'](_0x5117ad[_0xe022('0x60')]({'plain':!![]}),{'customerIp':_0x1bb28a['headers'][_0xe022('0xae')]||_0x1bb28a[_0xe022('0x8f')][_0xe022('0xfe')]||_0x1bb28a['connection'][_0xe022('0xff')]||_0x1bb28a['ip'],'referer':_0x1bb28a[_0xe022('0x8f')]['referer'],'openedInteractions':_0x7433bf,'maxInteractions':_0x402264,'virtual':_0x127d5d['virtual'],'online':_0x535d1c,'custom':_0x127d5d}))[_0xe022('0x100')](/'/g,'\x5c\x27')};_0x1632c6[_0xe022('0x40')](ejs[_0xe022('0x101')](Mustache['render'](_0x2706eb,_0x162420),{'proactiveActions':_0x25c026,'alignment':_0x5117ad['alignment'],'verticalAlignment':_0x5117ad[_0xe022('0x102')],'div_color':_0x5117ad[_0xe022('0xec')],'text_color':_0x5117ad['textColor']}));})[_0xe022('0x2d')](handleError(_0x1632c6,null));};exports['addApplications']=function(_0x166c45,_0x454698,_0x2d730d){return db['ChatWebsite'][_0xe022('0x6c')]({'where':{'id':_0x166c45['params']['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x454698,null))['then'](function(_0x3f87dc){if(_0x3f87dc){return db[_0xe022('0x103')][_0xe022('0x104')](function(_0x44bdb7){return db[_0xe022('0x105')][_0xe022('0x3d')]({'where':{'ChatWebsiteId':_0x166c45[_0xe022('0x5a')]['id']},'transaction':_0x44bdb7})[_0xe022('0x3a')](function(_0x29fced){var _0x1ab5b0=_[_0xe022('0x49')](_0x166c45[_0xe022('0x66')],function(_0x343fec){_0x343fec[_0xe022('0x69')]=_0x166c45[_0xe022('0x5a')]['id'];return _0x343fec;});return db[_0xe022('0x105')][_0xe022('0x106')](_0x1ab5b0,{'transaction':_0x44bdb7});});})[_0xe022('0x3a')](function(){return db[_0xe022('0x105')][_0xe022('0x107')]({'where':{'ChatWebsiteId':_0x166c45[_0xe022('0x5a')]['id']},'order':_0xe022('0xa9')});});}})[_0xe022('0x3a')](respondWithResult(_0x454698,null))['catch'](handleError(_0x454698,null));};exports[_0xe022('0x108')]=function(_0x3b82ec,_0x457c36,_0x24bff5){var _0x28fce8={};var _0x43f808={};var _0x5ad152;var _0x349268;return db['ChatWebsite'][_0xe022('0x6c')]({'where':{'id':_0x3b82ec[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x457c36,null))[_0xe022('0x3a')](function(_0x5a86dc){if(_0x5a86dc){_0x5ad152=_0x5a86dc;_0x43f808[_0xe022('0x48')]=_[_0xe022('0x4b')](db['ChatApplication'][_0xe022('0x44')]);_0x43f808['query']=_[_0xe022('0x4b')](_0x3b82ec['query']);_0x43f808[_0xe022('0x4c')]=_[_0xe022('0x4d')](_0x43f808['model'],_0x43f808['query']);_0x28fce8[_0xe022('0x4e')]=_[_0xe022('0x4d')](_0x43f808[_0xe022('0x48')],qs['fields'](_0x3b82ec[_0xe022('0x4a')][_0xe022('0x4f')]));_0x28fce8[_0xe022('0x4e')]=_0x28fce8['attributes'][_0xe022('0x50')]?_0x28fce8['attributes']:_0x43f808[_0xe022('0x48')];_0x28fce8[_0xe022('0x6d')]=qs[_0xe022('0x53')](_0x3b82ec[_0xe022('0x4a')]['sort']);_0x28fce8[_0xe022('0x54')]=qs['filters'](_[_0xe022('0x55')](_0x3b82ec['query'],_0x43f808[_0xe022('0x4c')]));if(_0x3b82ec[_0xe022('0x4a')][_0xe022('0x56')]){_0x28fce8[_0xe022('0x54')]=_['merge'](_0x28fce8['where'],{'$or':_[_0xe022('0x49')](_0x28fce8[_0xe022('0x4e')],function(_0x175929){var _0xb5740f={};_0xb5740f[_0x175929]={'$like':'%'+_0x3b82ec['query']['filter']+'%'};return _0xb5740f;})});}_0x28fce8=_[_0xe022('0x57')]({},_0x28fce8,_0x3b82ec[_0xe022('0x58')]);return _0x5ad152[_0xe022('0x108')](_0x28fce8);}})[_0xe022('0x3a')](function(_0x271181){if(_0x271181){_0x349268=_0x271181[_0xe022('0x50')];if(!_0x3b82ec['query'][_0xe022('0x51')]('nolimit')){_0x28fce8[_0xe022('0x34')]=qs[_0xe022('0x34')](_0x3b82ec[_0xe022('0x4a')]['limit']);_0x28fce8[_0xe022('0x33')]=qs[_0xe022('0x33')](_0x3b82ec[_0xe022('0x4a')][_0xe022('0x33')]);}return _0x5ad152[_0xe022('0x108')](_0x28fce8);}})['then'](function(_0x2f55a5){if(_0x2f55a5){return _0x2f55a5?{'count':_0x349268,'rows':_0x2f55a5}:null;}})['then'](respondWithResult(_0x457c36,null))['catch'](handleError(_0x457c36,null));};exports[_0xe022('0x109')]=function(_0x43d70c,_0x3d58c7,_0x393e72){return db[_0xe022('0x10a')][_0xe022('0x5d')]({'where':{'id':_0x43d70c[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x3d58c7,null))[_0xe022('0x3a')](function(_0x3a2621){if(_0x3a2621){return _0x3a2621[_0xe022('0x109')](_0x43d70c['body'][_0xe022('0x70')],_[_0xe022('0x10b')](_0x43d70c[_0xe022('0x66')],[_0xe022('0x70'),'id'])||{});}})[_0xe022('0x3a')](respondWithResult(_0x3d58c7,null))[_0xe022('0x2d')](handleError(_0x3d58c7,null));};exports[_0xe022('0xf9')]=function(_0x204d23,_0x44ac4a,_0x551db3){var _0xa2f8fe={};var _0x11dc59={};var _0xd455b6;var _0x22d7fb;return db[_0xe022('0x43')][_0xe022('0x6c')]({'where':{'id':_0x204d23['params']['id']}})['then'](handleEntityNotFound(_0x44ac4a,null))['then'](function(_0xeb1c86){if(_0xeb1c86){_0xd455b6=_0xeb1c86;_0x11dc59[_0xe022('0x48')]=_[_0xe022('0x4b')](db[_0xe022('0x10c')]['rawAttributes']);_0x11dc59['query']=_[_0xe022('0x4b')](_0x204d23[_0xe022('0x4a')]);_0x11dc59['filters']=_['intersection'](_0x11dc59[_0xe022('0x48')],_0x11dc59['query']);_0xa2f8fe[_0xe022('0x4e')]=_[_0xe022('0x4d')](_0x11dc59[_0xe022('0x48')],qs['fields'](_0x204d23[_0xe022('0x4a')][_0xe022('0x4f')]));_0xa2f8fe[_0xe022('0x4e')]=_0xa2f8fe[_0xe022('0x4e')][_0xe022('0x50')]?_0xa2f8fe[_0xe022('0x4e')]:_0x11dc59[_0xe022('0x48')];_0xa2f8fe[_0xe022('0x6d')]=qs[_0xe022('0x53')](_0x204d23['query'][_0xe022('0x53')]);_0xa2f8fe[_0xe022('0x54')]=qs[_0xe022('0x4c')](_['pick'](_0x204d23[_0xe022('0x4a')],_0x11dc59[_0xe022('0x4c')]));if(_0x204d23[_0xe022('0x4a')]['filter']){_0xa2f8fe[_0xe022('0x54')]=_[_0xe022('0x57')](_0xa2f8fe[_0xe022('0x54')],{'$or':_['map'](_0xa2f8fe[_0xe022('0x4e')],function(_0x149d10){var _0x4e636c={};_0x4e636c[_0x149d10]={'$like':'%'+_0x204d23[_0xe022('0x4a')][_0xe022('0x56')]+'%'};return _0x4e636c;})});}_0xa2f8fe=_[_0xe022('0x57')]({},_0xa2f8fe,_0x204d23[_0xe022('0x58')]);return _0xd455b6['getProactiveActions'](_0xa2f8fe);}})['then'](function(_0x2c09a4){if(_0x2c09a4){_0x22d7fb=_0x2c09a4[_0xe022('0x50')];if(!_0x204d23[_0xe022('0x4a')][_0xe022('0x51')](_0xe022('0x52'))){_0xa2f8fe[_0xe022('0x34')]=qs[_0xe022('0x34')](_0x204d23[_0xe022('0x4a')][_0xe022('0x34')]);_0xa2f8fe[_0xe022('0x33')]=qs['offset'](_0x204d23[_0xe022('0x4a')]['offset']);}return _0xd455b6[_0xe022('0xf9')](_0xa2f8fe);}})[_0xe022('0x3a')](function(_0x4cad52){if(_0x4cad52){return _0x4cad52?{'count':_0x22d7fb,'rows':_0x4cad52}:null;}})[_0xe022('0x3a')](respondWithResult(_0x44ac4a,null))[_0xe022('0x2d')](handleError(_0x44ac4a,null));};exports['getFields']=function(_0x1c9945,_0x384fee,_0x57a86b){var _0x180e57=_0x1c9945[_0xe022('0x4a')][_0xe022('0x10d')]===_0xe022('0x10e')?_0xe022('0x10f'):'onlineForm';return db[_0xe022('0x43')]['find']({'attributes':['id',_0x180e57],'where':{'id':_0x1c9945[_0xe022('0x5a')]['id']}})['then'](handleEntityNotFound(_0x384fee,null))['then'](function(_0x301c47){if(_0x301c47){var _0x173c43=_0x301c47[_0x180e57];var _0x1c0ada=_0x173c43&&_0x173c43['items']?_0x173c43['items']:[];_0x384fee[_0xe022('0x40')]({'fromKey':_[_0xe022('0x80')](_0x173c43[_0xe022('0x110')])?undefined:_0x173c43[_0xe022('0x110')],'count':_0x1c0ada[_0xe022('0x50')],'rows':_0x1c0ada});}})[_0xe022('0x2d')](handleError(_0x384fee,null));};exports[_0xe022('0x111')]=function(_0x582b9a,_0x20ab7b,_0x5f0a77){var _0x348777={'raw':![],'where':{}};var _0x3351d9={};var _0x408496={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x582b9a[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x20ab7b,null))['then'](function(_0x6a6d1f){if(_0x6a6d1f){_0x3351d9['model']=_['keys'](db['ChatOfflineMessage'][_0xe022('0x44')]);_0x3351d9[_0xe022('0x4a')]=_[_0xe022('0x4b')](_0x582b9a[_0xe022('0x4a')]);_0x3351d9[_0xe022('0x4c')]=_[_0xe022('0x4d')](_0x3351d9[_0xe022('0x48')],_0x3351d9['query']);_0x348777['attributes']=_['intersection'](_0x3351d9[_0xe022('0x48')],qs[_0xe022('0x4f')](_0x582b9a[_0xe022('0x4a')][_0xe022('0x4f')]));_0x348777[_0xe022('0x4e')]=_0x348777[_0xe022('0x4e')][_0xe022('0x50')]?_0x348777[_0xe022('0x4e')]:_0x3351d9[_0xe022('0x48')];if(!_0x582b9a[_0xe022('0x4a')][_0xe022('0x51')](_0xe022('0x52'))){_0x348777[_0xe022('0x34')]=qs[_0xe022('0x34')](_0x582b9a[_0xe022('0x4a')][_0xe022('0x34')]);_0x348777['offset']=qs[_0xe022('0x33')](_0x582b9a[_0xe022('0x4a')][_0xe022('0x33')]);}_0x348777[_0xe022('0x6d')]=qs[_0xe022('0x53')](_0x582b9a[_0xe022('0x4a')][_0xe022('0x53')]);_0x348777[_0xe022('0x54')]=qs[_0xe022('0x4c')](_['pick'](_0x582b9a[_0xe022('0x4a')],_0x3351d9['filters']));_0x348777[_0xe022('0x54')][_0xe022('0x69')]=_0x6a6d1f['id'];if(_0x582b9a['query'][_0xe022('0x56')]){_0x348777[_0xe022('0x54')]=_[_0xe022('0x57')](_0x348777[_0xe022('0x54')],{'$or':_[_0xe022('0x49')](_0x348777[_0xe022('0x4e')],function(_0xa8acf5){var _0x5150d1={};_0x5150d1[_0xa8acf5]={'$like':'%'+_0x582b9a[_0xe022('0x4a')][_0xe022('0x56')]+'%'};return _0x5150d1;})});}_0x348777=_[_0xe022('0x57')]({},_0x348777,_0x582b9a[_0xe022('0x58')]);return db[_0xe022('0xd9')]['count']({'where':_0x348777['where']})['then'](function(_0x42ae85){_0x408496[_0xe022('0x32')]=_0x42ae85;if(_0x582b9a['query'][_0xe022('0x5b')]){_0x348777[_0xe022('0x5c')]=[{'all':!![]}];}else{_0x348777['include']=[{'model':db[_0xe022('0x93')],'as':'Contact','required':![]}];}return db['ChatOfflineMessage'][_0xe022('0x59')](_0x348777);})['then'](function(_0x4a91f2){_0x408496[_0xe022('0x6e')]=_0x4a91f2;return _0x408496;});}})[_0xe022('0x3a')](respondWithFilteredResult(_0x20ab7b,_0x348777))[_0xe022('0x2d')](handleError(_0x20ab7b,null));};exports['addAgents']=function(_0x40fb2f,_0x1cda0f,_0x2d2516){return db['ChatWebsite'][_0xe022('0x5d')]({'where':{'id':_0x40fb2f['params']['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x1cda0f,null))[_0xe022('0x3a')](function(_0x5608b2){if(_0x5608b2){return _0x5608b2['addAgents'](_0x40fb2f[_0xe022('0x66')][_0xe022('0x70')],_[_0xe022('0x10b')](_0x40fb2f['body'],[_0xe022('0x70'),'id'])||{})[_0xe022('0xbe')](function(_0x4cd780){for(var _0x1b432a=0x0;_0x1b432a<_0x40fb2f[_0xe022('0x66')][_0xe022('0x70')]['length'];_0x1b432a+=0x1){socket[_0xe022('0x112')](_0xe022('0x113'),{'UserId':_0x40fb2f[_0xe022('0x66')][_0xe022('0x70')][_0x1b432a],'ChatWebsiteId':_0x40fb2f[_0xe022('0x5a')]['id']});}return _0x4cd780;});}})[_0xe022('0x3a')](respondWithResult(_0x1cda0f,null))[_0xe022('0x2d')](handleError(_0x1cda0f,null));};exports[_0xe022('0x114')]=function(_0x297b6d,_0x3e02fa,_0x18e299){return db[_0xe022('0x43')][_0xe022('0x5d')]({'where':{'id':_0x297b6d[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x3e02fa,null))['then'](function(_0x20f6e4){if(_0x20f6e4){return _0x20f6e4[_0xe022('0x114')](_0x297b6d[_0xe022('0x4a')]['ids'])[_0xe022('0x3a')](function(){if(_[_0xe022('0x115')](_0x297b6d[_0xe022('0x4a')][_0xe022('0x70')])){for(var _0x54975d=0x0;_0x54975d<_0x297b6d['query'][_0xe022('0x70')][_0xe022('0x50')];_0x54975d+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x297b6d[_0xe022('0x4a')][_0xe022('0x70')][_0x54975d]),'ChatWebsiteId':Number(_0x297b6d[_0xe022('0x5a')]['id'])});}}else{socket[_0xe022('0x112')]('userChatWebsite:remove',{'UserId':Number(_0x297b6d['query'][_0xe022('0x70')]),'ChatWebsiteId':Number(_0x297b6d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3e02fa,null))[_0xe022('0x2d')](handleError(_0x3e02fa,null));};exports[_0xe022('0x116')]=function(_0x5a3edb,_0x14a9b2,_0x17acdd){var _0x4eabf7={};var _0x5e2f62={};var _0x5ecfce;var _0x201d3f;return db[_0xe022('0x43')]['findOne']({'where':{'id':_0x5a3edb[_0xe022('0x5a')]['id']}})[_0xe022('0x3a')](handleEntityNotFound(_0x14a9b2,null))[_0xe022('0x3a')](function(_0x5c5200){if(_0x5c5200){_0x5ecfce=_0x5c5200;_0x5e2f62['model']=_[_0xe022('0x4b')](db[_0xe022('0xc9')][_0xe022('0x44')]);_0x5e2f62[_0xe022('0x4a')]=_[_0xe022('0x4b')](_0x5a3edb[_0xe022('0x4a')]);_0x5e2f62[_0xe022('0x4c')]=_[_0xe022('0x4d')](_0x5e2f62[_0xe022('0x48')],_0x5e2f62[_0xe022('0x4a')]);_0x4eabf7[_0xe022('0x4e')]=_[_0xe022('0x4d')](_0x5e2f62['model'],qs[_0xe022('0x4f')](_0x5a3edb['query'][_0xe022('0x4f')]));_0x4eabf7[_0xe022('0x4e')]=_0x4eabf7[_0xe022('0x4e')][_0xe022('0x50')]?_0x4eabf7[_0xe022('0x4e')]:_0x5e2f62[_0xe022('0x48')];_0x4eabf7[_0xe022('0x6d')]=qs[_0xe022('0x53')](_0x5a3edb['query'][_0xe022('0x53')]);_0x4eabf7[_0xe022('0x54')]=qs[_0xe022('0x4c')](_[_0xe022('0x55')](_0x5a3edb['query'],_0x5e2f62['filters']));if(_0x5a3edb[_0xe022('0x4a')][_0xe022('0x56')]){_0x4eabf7['where']=_[_0xe022('0x57')](_0x4eabf7[_0xe022('0x54')],{'$or':_['map'](_0x4eabf7[_0xe022('0x4e')],function(_0x553295){var _0x10660e={};_0x10660e[_0x553295]={'$like':'%'+_0x5a3edb[_0xe022('0x4a')][_0xe022('0x56')]+'%'};return _0x10660e;})});}_0x4eabf7=_[_0xe022('0x57')]({},_0x4eabf7,_0x5a3edb[_0xe022('0x58')]);return _0x5ecfce[_0xe022('0x116')](_0x4eabf7);}})[_0xe022('0x3a')](function(_0x32ab9f){if(_0x32ab9f){_0x201d3f=_0x32ab9f['length'];if(!_0x5a3edb[_0xe022('0x4a')][_0xe022('0x51')](_0xe022('0x52'))){_0x4eabf7['limit']=qs['limit'](_0x5a3edb['query'][_0xe022('0x34')]);_0x4eabf7['offset']=qs[_0xe022('0x33')](_0x5a3edb[_0xe022('0x4a')]['offset']);}return _0x5ecfce[_0xe022('0x116')](_0x4eabf7);}})[_0xe022('0x3a')](function(_0x28920b){if(_0x28920b){return _0x28920b?{'count':_0x201d3f,'rows':_0x28920b}:null;}})['then'](respondWithResult(_0x14a9b2,null))[_0xe022('0x2d')](handleError(_0x14a9b2,null));};
\ No newline at end of file
+var _0x9c47=['options','count','include','findAll','rows','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','ids','getAnswers','CannedAnswer','order','pick','removeAnswers','file','filename','addAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','getLicense','custom','isNil','existsSync','server/files/images/logos/','sitepic','download','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','describe','no\x20available\x20attributes','difference','createdAt','updatedAt','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','from','CmList','Contacts','DESC','ChatApplication','Applications','applications','list','List','orderBy','account','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','referer','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','vendor','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','startRouting','Start','EventManager','offline','CompanyId','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','user','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','getInteractions','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','../../config/license/util','virtual','License','chatLicenseExceeded','push','all','server/files/chat/iframe.js','remote','x-real-ip','connection','replace','alignment','verticalAlignment','textColor','addApplications','sequelize','transaction','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','map'];(function(_0x2f1ae9,_0x11ce9a){var _0x2420e7=function(_0x3908ee){while(--_0x3908ee){_0x2f1ae9['push'](_0x2f1ae9['shift']());}};_0x2420e7(++_0x11ce9a);}(_0x9c47,0xcc));var _0x79c4=function(_0x8a71d3,_0x212ca6){_0x8a71d3=_0x8a71d3-0x0;var _0x4b914c=_0x9c47[_0x8a71d3];return _0x4b914c;};'use strict';var pdf=require(_0x79c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x79c4('0x1'));var zipdir=require(_0x79c4('0x2'));var jsonpatch=require(_0x79c4('0x3'));var rp=require(_0x79c4('0x4'));var moment=require(_0x79c4('0x5'));var BPromise=require(_0x79c4('0x6'));var Mustache=require(_0x79c4('0x7'));var util=require('util');var path=require('path');var sox=require(_0x79c4('0x8'));var csv=require(_0x79c4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x79c4('0xa'));var squel=require(_0x79c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x79c4('0xc'));var deskjs=require(_0x79c4('0xd'));var toCsv=require(_0x79c4('0x9'));var querystring=require(_0x79c4('0xe'));var Papa=require('papaparse');var Redis=require(_0x79c4('0xf'));var authService=require(_0x79c4('0x10'));var qs=require(_0x79c4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79c4('0x12'));var logger=require(_0x79c4('0x13'))(_0x79c4('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x79c4('0x15'))['db'];config[_0x79c4('0x16')]=_[_0x79c4('0x17')](config[_0x79c4('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x79c4('0x18'))(new Redis(config[_0x79c4('0x16')]));require(_0x79c4('0x19'))[_0x79c4('0x1a')](socket);var jayson=require(_0x79c4('0x1b'));var client=jayson[_0x79c4('0x1c')][_0x79c4('0x1d')]({'port':0x232c});var client9002=jayson[_0x79c4('0x1c')][_0x79c4('0x1d')]({'port':0x232a});var client9003=jayson[_0x79c4('0x1c')][_0x79c4('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x1f0ec6,_0x2bf677,_0x46cb7e){if(_0x46cb7e){var _0x195c71=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x195c71['test'](_0x2bf677)){return _0x1f0ec6;}else{throw new db[(_0x79c4('0x1e'))][(_0x79c4('0x1f'))](_0x79c4('0x20'));}}else{return _0x1f0ec6;}}function respondWithRpcPromise(_0x26cb1a,_0x5d9bc8,_0x4cf585,_0x3dadfc){return new BPromise(function(_0x36dd7b,_0x90fab5){var _0x54792e=_0x3dadfc||client;return _0x54792e['request'](_0x26cb1a,_0x4cf585)[_0x79c4('0x21')](function(_0x4602b7){logger[_0x79c4('0x22')](_0x79c4('0x23'),_0x5d9bc8,_0x79c4('0x24'));logger[_0x79c4('0x25')](_0x79c4('0x26'),_0x5d9bc8,_0x79c4('0x24'),JSON['stringify'](_0x4602b7));if(_0x4602b7[_0x79c4('0x27')]){if(_0x4602b7['error'][_0x79c4('0x28')]===0x1f4){logger[_0x79c4('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x5d9bc8,_0x4602b7[_0x79c4('0x27')][_0x79c4('0x29')]);return _0x90fab5(_0x4602b7[_0x79c4('0x27')][_0x79c4('0x29')]);}logger[_0x79c4('0x27')](_0x79c4('0x23'),_0x5d9bc8,_0x4602b7[_0x79c4('0x27')][_0x79c4('0x29')]);return _0x36dd7b(_0x4602b7['error'][_0x79c4('0x29')]);}else{logger[_0x79c4('0x22')](_0x79c4('0x23'),_0x5d9bc8,_0x79c4('0x24'));_0x36dd7b(_0x4602b7[_0x79c4('0x2a')]['message']);}})[_0x79c4('0x2b')](function(_0x1ab236){logger[_0x79c4('0x27')](_0x79c4('0x23'),_0x5d9bc8,_0x1ab236);_0x90fab5(_0x1ab236);});});}function respondWithStatusCode(_0x84ae90,_0x31a4cc){_0x31a4cc=_0x31a4cc||0xcc;return function(_0x499320){if(_0x499320){return _0x84ae90[_0x79c4('0x2c')](_0x31a4cc);}return _0x84ae90[_0x79c4('0x2d')](_0x31a4cc)[_0x79c4('0x2e')]();};}function respondWithResult(_0x1c54fb,_0x58ce63){_0x58ce63=_0x58ce63||0xc8;return function(_0x2558ae){if(_0x2558ae){return _0x1c54fb['status'](_0x58ce63)[_0x79c4('0x2f')](_0x2558ae);}};}function respondWithFilteredResult(_0x1e746d,_0x2c31e4){return function(_0x176019){if(_0x176019){var _0x3d03ae=_0x176019['count'],_0x415af9=_0x2c31e4[_0x79c4('0x30')],_0x1fa29c=_0x2c31e4[_0x79c4('0x30')]+_0x2c31e4[_0x79c4('0x31')],_0x48fc9b;if(_0x1fa29c>=_0x3d03ae){_0x1fa29c=_0x3d03ae;_0x48fc9b=0xc8;}else{_0x48fc9b=0xce;}_0x1e746d[_0x79c4('0x2d')](_0x48fc9b);return _0x1e746d[_0x79c4('0x32')]('Content-Range',_0x415af9+'-'+_0x1fa29c+'/'+_0x3d03ae)[_0x79c4('0x2f')](_0x176019);}return null;};}function patchUpdates(_0x42c9d8){return function(_0x1d94b0){try{jsonpatch[_0x79c4('0x33')](_0x1d94b0,_0x42c9d8,!![]);}catch(_0x52e952){return BPromise[_0x79c4('0x34')](_0x52e952);}return _0x1d94b0['save']();};}function saveUpdates(_0x4119fb,_0x5caebe){return function(_0x9cea62){if(_0x9cea62){return _0x9cea62[_0x79c4('0x35')](_0x4119fb)[_0x79c4('0x21')](function(_0x13e7ca){return _0x13e7ca;});}return null;};}function removeEntity(_0xa5456c,_0x597c3e){return function(_0x4db736){if(_0x4db736){return _0x4db736[_0x79c4('0x36')]()['then'](function(){var _0x4e99b9=_0x4db736[_0x79c4('0x37')]({'plain':!![]});var _0x3752d3=_0x79c4('0x38');return db[_0x79c4('0x39')][_0x79c4('0x36')]({'where':{'type':_0x3752d3,'resourceId':_0x4e99b9['id']}})[_0x79c4('0x21')](function(){return _0x4db736;});})[_0x79c4('0x21')](function(){_0xa5456c[_0x79c4('0x2d')](0xcc)[_0x79c4('0x2e')]();});}};}function handleEntityNotFound(_0x38b51a,_0x5c7320){return function(_0x2726f0){if(!_0x2726f0){_0x38b51a['sendStatus'](0x194);}return _0x2726f0;};}function handleError(_0x110b69,_0xef5f5d){_0xef5f5d=_0xef5f5d||0x1f4;return function(_0x1e148f){logger['error'](_0x1e148f[_0x79c4('0x3a')]);if(_0x1e148f['name']){delete _0x1e148f[_0x79c4('0x3b')];}_0x110b69['status'](_0xef5f5d)['send'](_0x1e148f);};}exports[_0x79c4('0x3c')]=function(_0x38a529,_0x184640){var _0x584301={'include':[{'model':db[_0x79c4('0x3d')],'as':_0x79c4('0x3e')}]},_0x3c935a={},_0x41d3d2={'count':0x0,'rows':[]};var _0x3cb4f8=_['map'](db[_0x79c4('0x3f')][_0x79c4('0x40')],function(_0x5e5460){return{'name':_0x5e5460[_0x79c4('0x41')],'type':_0x5e5460[_0x79c4('0x42')][_0x79c4('0x43')]};});_0x3c935a[_0x79c4('0x44')]=_['map'](_0x3cb4f8,'name');_0x3c935a[_0x79c4('0x45')]=_[_0x79c4('0x46')](_0x38a529[_0x79c4('0x45')]);_0x3c935a[_0x79c4('0x47')]=_[_0x79c4('0x48')](_0x3c935a['model'],_0x3c935a['query']);_0x584301[_0x79c4('0x49')]=_[_0x79c4('0x48')](_0x3c935a['model'],qs['fields'](_0x38a529[_0x79c4('0x45')][_0x79c4('0x4a')]));_0x584301[_0x79c4('0x49')]=_0x584301['attributes'][_0x79c4('0x4b')]?_0x584301['attributes']:_0x3c935a[_0x79c4('0x44')];if(!_0x38a529['query'][_0x79c4('0x4c')](_0x79c4('0x4d'))){_0x584301['limit']=qs[_0x79c4('0x31')](_0x38a529[_0x79c4('0x45')]['limit']);_0x584301[_0x79c4('0x30')]=qs[_0x79c4('0x30')](_0x38a529[_0x79c4('0x45')][_0x79c4('0x30')]);}_0x584301['order']=qs['sort'](_0x38a529['query'][_0x79c4('0x4e')]);_0x584301['where']=qs[_0x79c4('0x47')](_['pick'](_0x38a529['query'],_0x3c935a['filters']),_0x3cb4f8);if(_0x38a529[_0x79c4('0x45')][_0x79c4('0x4f')]){_0x584301[_0x79c4('0x50')]=_[_0x79c4('0x51')](_0x584301[_0x79c4('0x50')],{'$or':_[_0x79c4('0x52')](_0x3cb4f8,function(_0x49b323){if(_0x49b323[_0x79c4('0x42')]!=='VIRTUAL'){var _0x45bce9={};_0x45bce9[_0x49b323[_0x79c4('0x3b')]]={'$like':'%'+_0x38a529[_0x79c4('0x45')][_0x79c4('0x4f')]+'%'};return _0x45bce9;}})});}_0x584301=_[_0x79c4('0x51')]({},_0x584301,_0x38a529[_0x79c4('0x53')]);var _0x3d2b17={'where':_0x584301['where']};return db[_0x79c4('0x3f')][_0x79c4('0x54')](_0x3d2b17)[_0x79c4('0x21')](function(_0x5620ed){_0x41d3d2[_0x79c4('0x54')]=_0x5620ed;if(_0x38a529[_0x79c4('0x45')]['includeAll']){_0x584301[_0x79c4('0x55')]=[{'all':!![]}];}return db['ChatWebsite'][_0x79c4('0x56')](_0x584301);})[_0x79c4('0x21')](function(_0x3223d6){_0x41d3d2[_0x79c4('0x57')]=_0x3223d6;return _0x41d3d2;})[_0x79c4('0x21')](respondWithFilteredResult(_0x184640,_0x584301))['catch'](handleError(_0x184640,null));};exports[_0x79c4('0x58')]=function(_0x2e5e1e,_0x1dc8b4){var _0x3abbb1={'raw':![],'where':{'id':_0x2e5e1e[_0x79c4('0x59')]['id']},'include':[{'model':db[_0x79c4('0x3d')],'as':_0x79c4('0x3e')}]},_0x8186ec={};_0x8186ec[_0x79c4('0x44')]=_[_0x79c4('0x46')](db[_0x79c4('0x3f')][_0x79c4('0x40')]);_0x8186ec[_0x79c4('0x45')]=_[_0x79c4('0x46')](_0x2e5e1e[_0x79c4('0x45')]);_0x8186ec[_0x79c4('0x47')]=_[_0x79c4('0x48')](_0x8186ec[_0x79c4('0x44')],_0x8186ec[_0x79c4('0x45')]);_0x3abbb1['attributes']=_[_0x79c4('0x48')](_0x8186ec['model'],qs[_0x79c4('0x4a')](_0x2e5e1e[_0x79c4('0x45')][_0x79c4('0x4a')]));_0x3abbb1[_0x79c4('0x49')]=_0x3abbb1[_0x79c4('0x49')][_0x79c4('0x4b')]?_0x3abbb1[_0x79c4('0x49')]:_0x8186ec[_0x79c4('0x44')];if(_0x2e5e1e[_0x79c4('0x45')][_0x79c4('0x5a')]){_0x3abbb1[_0x79c4('0x55')]=[{'all':!![]}];}_0x3abbb1=_[_0x79c4('0x51')]({},_0x3abbb1,_0x2e5e1e[_0x79c4('0x53')]);return db[_0x79c4('0x3f')]['find'](_0x3abbb1)[_0x79c4('0x21')](handleEntityNotFound(_0x1dc8b4,null))[_0x79c4('0x21')](respondWithResult(_0x1dc8b4,null))['catch'](handleError(_0x1dc8b4,null));};exports['create']=function(_0x871af3,_0x4608da){return db[_0x79c4('0x3f')][_0x79c4('0x5b')](_0x871af3[_0x79c4('0x5c')],{})['then'](function(_0x2232c8){var _0x57effd=_0x871af3['user']['get']({'plain':!![]});if(!_0x57effd)throw new Error(_0x79c4('0x5d'));if(_0x57effd[_0x79c4('0x5e')]==='user'){var _0x539686=_0x2232c8[_0x79c4('0x37')]({'plain':!![]});var _0x48155e=_0x79c4('0x38');return db['UserProfileSection'][_0x79c4('0x5f')]({'where':{'name':_0x48155e,'userProfileId':_0x57effd[_0x79c4('0x60')]},'raw':!![]})[_0x79c4('0x21')](function(_0x2abfac){if(_0x2abfac&&_0x2abfac[_0x79c4('0x61')]===0x0){return db[_0x79c4('0x39')][_0x79c4('0x5b')]({'name':_0x539686[_0x79c4('0x3b')],'resourceId':_0x539686['id'],'type':_0x2abfac[_0x79c4('0x3b')],'sectionId':_0x2abfac['id']},{})['then'](function(){return _0x2232c8;});}else{return _0x2232c8;}})[_0x79c4('0x2b')](function(_0x5a706f){logger[_0x79c4('0x27')](_0x79c4('0x62'),_0x5a706f);throw _0x5a706f;});}return _0x2232c8;})['then'](respondWithResult(_0x4608da,0xc9))[_0x79c4('0x2b')](handleError(_0x4608da,null));};exports[_0x79c4('0x35')]=function(_0x4b2b3d,_0xbf27b){if(_0x4b2b3d[_0x79c4('0x5c')]['id']){delete _0x4b2b3d[_0x79c4('0x5c')]['id'];}return db[_0x79c4('0x3f')][_0x79c4('0x5f')]({'where':{'id':_0x4b2b3d[_0x79c4('0x59')]['id']},'include':[{'model':db[_0x79c4('0x3d')],'as':_0x79c4('0x3e')}]})['then'](handleEntityNotFound(_0xbf27b,null))[_0x79c4('0x21')](saveUpdates(_0x4b2b3d[_0x79c4('0x5c')],null))[_0x79c4('0x21')](respondWithResult(_0xbf27b,null))[_0x79c4('0x2b')](handleError(_0xbf27b,null));};exports[_0x79c4('0x36')]=function(_0x5d8ce6,_0x30e956){return db[_0x79c4('0x3f')][_0x79c4('0x5f')]({'where':{'id':_0x5d8ce6[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x30e956,null))['then'](removeEntity(_0x30e956,null))[_0x79c4('0x2b')](handleError(_0x30e956,null));};exports['describe']=function(_0x23ebb0,_0x30e502){return db[_0x79c4('0x3f')]['describe']()[_0x79c4('0x21')](respondWithResult(_0x30e502,null))['catch'](handleError(_0x30e502,null));};exports[_0x79c4('0x63')]=function(_0x4f5fc9,_0x652113,_0x115e8d){if(_0x4f5fc9[_0x79c4('0x5c')]['id']){delete _0x4f5fc9['body']['id'];}return db[_0x79c4('0x3f')][_0x79c4('0x5f')]({'where':{'id':_0x4f5fc9[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x652113,null))[_0x79c4('0x21')](function(_0x30c356){if(_0x30c356){_0x4f5fc9['body'][_0x79c4('0x64')]=_0x30c356['id'];return db[_0x79c4('0x65')][_0x79c4('0x5b')](_0x4f5fc9['body']);}})[_0x79c4('0x21')](respondWithResult(_0x652113,null))[_0x79c4('0x2b')](handleError(_0x652113,null));};exports['getDispositions']=function(_0x313608,_0x4e7220,_0x596686){var _0x5b1fc3={'raw':![],'where':{}};var _0x2349a1={};var _0x46028e={'count':0x0,'rows':[]};return db[_0x79c4('0x3f')][_0x79c4('0x66')]({'where':{'id':_0x313608[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x4e7220,null))[_0x79c4('0x21')](function(_0x31bb6c){if(_0x31bb6c){_0x2349a1[_0x79c4('0x44')]=_['keys'](db['Disposition'][_0x79c4('0x40')]);_0x2349a1['query']=_['keys'](_0x313608[_0x79c4('0x45')]);_0x2349a1[_0x79c4('0x47')]=_[_0x79c4('0x48')](_0x2349a1['model'],_0x2349a1[_0x79c4('0x45')]);_0x5b1fc3[_0x79c4('0x49')]=_[_0x79c4('0x48')](_0x2349a1['model'],qs[_0x79c4('0x4a')](_0x313608[_0x79c4('0x45')][_0x79c4('0x4a')]));_0x5b1fc3['attributes']=_0x5b1fc3[_0x79c4('0x49')][_0x79c4('0x4b')]?_0x5b1fc3[_0x79c4('0x49')]:_0x2349a1['model'];if(!_0x313608[_0x79c4('0x45')]['hasOwnProperty'](_0x79c4('0x4d'))){_0x5b1fc3[_0x79c4('0x31')]=qs['limit'](_0x313608['query']['limit']);_0x5b1fc3[_0x79c4('0x30')]=qs['offset'](_0x313608[_0x79c4('0x45')][_0x79c4('0x30')]);}_0x5b1fc3['order']=qs['sort'](_0x313608[_0x79c4('0x45')][_0x79c4('0x4e')]);_0x5b1fc3[_0x79c4('0x50')]=qs[_0x79c4('0x47')](_['pick'](_0x313608['query'],_0x2349a1['filters']));_0x5b1fc3[_0x79c4('0x50')]['ChatWebsiteId']=_0x31bb6c['id'];if(_0x313608[_0x79c4('0x45')][_0x79c4('0x4f')]){_0x5b1fc3['where']=_['merge'](_0x5b1fc3[_0x79c4('0x50')],{'$or':_[_0x79c4('0x52')](_0x5b1fc3[_0x79c4('0x49')],function(_0x27b105){var _0x4de8e0={};_0x4de8e0[_0x27b105]={'$like':'%'+_0x313608[_0x79c4('0x45')]['filter']+'%'};return _0x4de8e0;})});}_0x5b1fc3=_[_0x79c4('0x51')]({},_0x5b1fc3,_0x313608[_0x79c4('0x53')]);return db[_0x79c4('0x65')][_0x79c4('0x54')]({'where':_0x5b1fc3[_0x79c4('0x50')]})[_0x79c4('0x21')](function(_0x4e217f){_0x46028e[_0x79c4('0x54')]=_0x4e217f;if(_0x313608[_0x79c4('0x45')]['includeAll']){_0x5b1fc3[_0x79c4('0x55')]=[{'all':!![]}];}return db[_0x79c4('0x65')]['findAll'](_0x5b1fc3);})[_0x79c4('0x21')](function(_0x551040){_0x46028e[_0x79c4('0x57')]=_0x551040;return _0x46028e;});}})['then'](respondWithFilteredResult(_0x4e7220,_0x5b1fc3))[_0x79c4('0x2b')](handleError(_0x4e7220,null));};exports[_0x79c4('0x67')]=function(_0x3fcea0,_0x200493,_0x436e90){return db['ChatWebsite']['find']({'where':{'id':_0x3fcea0[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x200493,null))[_0x79c4('0x21')](function(_0x5cca3c){if(_0x5cca3c){return _0x5cca3c[_0x79c4('0x67')](_0x3fcea0['query'][_0x79c4('0x68')]);}})[_0x79c4('0x21')](respondWithStatusCode(_0x200493,null))[_0x79c4('0x2b')](handleError(_0x200493,null));};exports['addAnswer']=function(_0x4161f0,_0x534718,_0x2beb4c){if(_0x4161f0['body']['id']){delete _0x4161f0['body']['id'];}return db[_0x79c4('0x3f')][_0x79c4('0x5f')]({'where':{'id':_0x4161f0[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x534718,null))[_0x79c4('0x21')](function(_0x2ea5b6){if(_0x2ea5b6){_0x4161f0[_0x79c4('0x5c')][_0x79c4('0x64')]=_0x2ea5b6['id'];return db['CannedAnswer'][_0x79c4('0x5b')](_0x4161f0['body']);}})[_0x79c4('0x21')](respondWithResult(_0x534718,null))[_0x79c4('0x2b')](handleError(_0x534718,null));};exports[_0x79c4('0x69')]=function(_0x1e6bbb,_0x4fe2cc,_0x209a3c){var _0x2d2fe3={'raw':![],'where':{}};var _0x5cd154={};var _0x11847d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x79c4('0x66')]({'where':{'id':_0x1e6bbb['params']['id']}})['then'](handleEntityNotFound(_0x4fe2cc,null))[_0x79c4('0x21')](function(_0x2f136e){if(_0x2f136e){_0x5cd154[_0x79c4('0x44')]=_[_0x79c4('0x46')](db[_0x79c4('0x6a')][_0x79c4('0x40')]);_0x5cd154[_0x79c4('0x45')]=_[_0x79c4('0x46')](_0x1e6bbb[_0x79c4('0x45')]);_0x5cd154[_0x79c4('0x47')]=_[_0x79c4('0x48')](_0x5cd154[_0x79c4('0x44')],_0x5cd154[_0x79c4('0x45')]);_0x2d2fe3[_0x79c4('0x49')]=_[_0x79c4('0x48')](_0x5cd154[_0x79c4('0x44')],qs[_0x79c4('0x4a')](_0x1e6bbb[_0x79c4('0x45')]['fields']));_0x2d2fe3[_0x79c4('0x49')]=_0x2d2fe3[_0x79c4('0x49')]['length']?_0x2d2fe3[_0x79c4('0x49')]:_0x5cd154[_0x79c4('0x44')];if(!_0x1e6bbb['query'][_0x79c4('0x4c')]('nolimit')){_0x2d2fe3[_0x79c4('0x31')]=qs[_0x79c4('0x31')](_0x1e6bbb[_0x79c4('0x45')][_0x79c4('0x31')]);_0x2d2fe3[_0x79c4('0x30')]=qs[_0x79c4('0x30')](_0x1e6bbb[_0x79c4('0x45')][_0x79c4('0x30')]);}_0x2d2fe3[_0x79c4('0x6b')]=qs['sort'](_0x1e6bbb[_0x79c4('0x45')]['sort']);_0x2d2fe3[_0x79c4('0x50')]=qs[_0x79c4('0x47')](_[_0x79c4('0x6c')](_0x1e6bbb[_0x79c4('0x45')],_0x5cd154[_0x79c4('0x47')]));_0x2d2fe3[_0x79c4('0x50')]['ChatWebsiteId']=_0x2f136e['id'];if(_0x1e6bbb['query'][_0x79c4('0x4f')]){_0x2d2fe3[_0x79c4('0x50')]=_[_0x79c4('0x51')](_0x2d2fe3[_0x79c4('0x50')],{'$or':_[_0x79c4('0x52')](_0x2d2fe3[_0x79c4('0x49')],function(_0x3b3924){var _0x21137c={};_0x21137c[_0x3b3924]={'$like':'%'+_0x1e6bbb[_0x79c4('0x45')][_0x79c4('0x4f')]+'%'};return _0x21137c;})});}_0x2d2fe3=_[_0x79c4('0x51')]({},_0x2d2fe3,_0x1e6bbb['options']);return db[_0x79c4('0x6a')]['count']({'where':_0x2d2fe3[_0x79c4('0x50')]})[_0x79c4('0x21')](function(_0x2239f9){_0x11847d[_0x79c4('0x54')]=_0x2239f9;if(_0x1e6bbb['query'][_0x79c4('0x5a')]){_0x2d2fe3['include']=[{'all':!![]}];}return db[_0x79c4('0x6a')][_0x79c4('0x56')](_0x2d2fe3);})[_0x79c4('0x21')](function(_0x3b789d){_0x11847d[_0x79c4('0x57')]=_0x3b789d;return _0x11847d;});}})[_0x79c4('0x21')](respondWithFilteredResult(_0x4fe2cc,_0x2d2fe3))[_0x79c4('0x2b')](handleError(_0x4fe2cc,null));};exports[_0x79c4('0x6d')]=function(_0x118624,_0x267b70,_0x388bab){return db[_0x79c4('0x3f')][_0x79c4('0x5f')]({'where':{'id':_0x118624[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x267b70,null))[_0x79c4('0x21')](function(_0x155760){if(_0x155760){return _0x155760[_0x79c4('0x6d')](_0x118624[_0x79c4('0x45')][_0x79c4('0x68')]);}})[_0x79c4('0x21')](respondWithStatusCode(_0x267b70,null))[_0x79c4('0x2b')](handleError(_0x267b70,null));};exports['addLogo']=function(_0x14269d,_0x1dfd41,_0x5b7816){_0x14269d[_0x79c4('0x5c')]['sitepic']=_0x14269d[_0x79c4('0x6e')][_0x79c4('0x6f')];return db[_0x79c4('0x3f')][_0x79c4('0x5f')]({'where':{'id':_0x14269d[_0x79c4('0x59')]['id']}})['then'](handleEntityNotFound(_0x1dfd41,null))[_0x79c4('0x21')](saveUpdates(_0x14269d[_0x79c4('0x5c')],null))[_0x79c4('0x21')](respondWithResult(_0x1dfd41,null))['catch'](handleError(_0x1dfd41,null));};exports[_0x79c4('0x70')]=function(_0x334284,_0x7ece84,_0x26fefd){_0x334284[_0x79c4('0x5c')]['agentAvatar']=_0x334284[_0x79c4('0x6e')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x334284[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x7ece84,null))['then'](saveUpdates(_0x334284[_0x79c4('0x5c')],null))[_0x79c4('0x21')](respondWithResult(_0x7ece84,null))['catch'](handleError(_0x7ece84,null));};exports['addCustomerAvatar']=function(_0x6c01e8,_0x40af9c,_0x3e278b){_0x6c01e8[_0x79c4('0x5c')][_0x79c4('0x71')]=_0x6c01e8[_0x79c4('0x6e')]['filename'];return db['ChatWebsite'][_0x79c4('0x5f')]({'where':{'id':_0x6c01e8[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x40af9c,null))[_0x79c4('0x21')](saveUpdates(_0x6c01e8[_0x79c4('0x5c')],null))[_0x79c4('0x21')](respondWithResult(_0x40af9c,null))[_0x79c4('0x2b')](handleError(_0x40af9c,null));};exports['addSystemAvatar']=function(_0x2b368c,_0xcd9738,_0x214045){_0x2b368c[_0x79c4('0x5c')]['systemAvatar']=_0x2b368c['file'][_0x79c4('0x6f')];return db[_0x79c4('0x3f')]['find']({'where':{'id':_0x2b368c[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0xcd9738,null))['then'](saveUpdates(_0x2b368c['body'],null))[_0x79c4('0x21')](respondWithResult(_0xcd9738,null))[_0x79c4('0x2b')](handleError(_0xcd9738,null));};exports[_0x79c4('0x72')]=function(_0xd9fa69,_0x282c8e,_0x4d6063){var _0xc8bf60=path[_0x79c4('0x73')](config[_0x79c4('0x74')],_0x79c4('0x75'));var _0x1603ba={'where':{'id':_0xd9fa69[_0x79c4('0x59')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x560de2=![];return require('../../config/license/util')[_0x79c4('0x76')]()[_0x79c4('0x21')](function(_0x184ac5){if(_0x184ac5){_0x560de2=_0x184ac5[_0x79c4('0x77')];}})['then'](function(){return db[_0x79c4('0x3f')][_0x79c4('0x5f')](_0x1603ba);})[_0x79c4('0x21')](handleEntityNotFound(_0x282c8e,null))[_0x79c4('0x21')](function(_0x2a7554){if(_0x2a7554){if(!_[_0x79c4('0x78')](_0x2a7554['sitepic'])){if(fs[_0x79c4('0x79')](path[_0x79c4('0x73')](config[_0x79c4('0x74')],_0x79c4('0x7a'),_0x2a7554[_0x79c4('0x7b')]))&&_0x560de2){_0xc8bf60=path[_0x79c4('0x73')](config[_0x79c4('0x74')],'server/files/images/logos/',_0x2a7554['sitepic']);}}return _0x282c8e[_0x79c4('0x7c')](_0xc8bf60);}})[_0x79c4('0x2b')](handleError(_0x282c8e,null));};exports['getAvatar']=function(_0x5093d6,_0x3cbe7c,_0x4b9998){var _0x2542e0=path[_0x79c4('0x73')](config[_0x79c4('0x74')],'server/files/images/avatars/default_avatar.png');var _0x376874={'where':{'id':_0x5093d6['params']['id']},'attributes':['id',_0x79c4('0x7d')],'raw':!![]};return db[_0x79c4('0x3f')][_0x79c4('0x5f')](_0x376874)[_0x79c4('0x21')](handleEntityNotFound(_0x3cbe7c,null))[_0x79c4('0x21')](function(_0x50d833){if(_0x50d833){if(!_['isNil'](_0x50d833[_0x79c4('0x7d')])){if(fs[_0x79c4('0x79')](path[_0x79c4('0x73')](config[_0x79c4('0x74')],'server/files/images/avatars/',_0x50d833[_0x79c4('0x7d')]))){_0x2542e0=path[_0x79c4('0x73')](config['root'],_0x79c4('0x7e'),_0x50d833[_0x79c4('0x7d')]);}}return _0x3cbe7c[_0x79c4('0x7c')](_0x2542e0);}})['catch'](handleError(_0x3cbe7c,null));};exports[_0x79c4('0x7f')]=function(_0x33bca3,_0x5242bb,_0xf882ad){var _0x1cefcc=path['join'](config[_0x79c4('0x74')],_0x79c4('0x80'));var _0x3fd307={'where':{'id':_0x33bca3[_0x79c4('0x59')]['id']},'attributes':['id','customerAvatar',_0x79c4('0x81')],'raw':!![]};return db['ChatWebsite'][_0x79c4('0x5f')](_0x3fd307)['then'](handleEntityNotFound(_0x5242bb,null))[_0x79c4('0x21')](function(_0x44fa43){if(_0x44fa43){if(!_['isNil'](_0x44fa43[_0x79c4('0x71')])){if(fs['existsSync'](path['join'](config['root'],_0x79c4('0x7e'),_0x44fa43[_0x79c4('0x71')]))&&_0x44fa43[_0x79c4('0x81')]){_0x1cefcc=path['join'](config['root'],_0x79c4('0x7e'),_0x44fa43[_0x79c4('0x71')]);}}return _0x5242bb[_0x79c4('0x7c')](_0x1cefcc);}})[_0x79c4('0x2b')](handleError(_0x5242bb,null));};exports[_0x79c4('0x82')]=function(_0x581b79,_0x436500,_0x438d54){var _0x5acfa1=path[_0x79c4('0x73')](config[_0x79c4('0x74')],'server/files/images/avatars/system_avatar.png');var _0x11e942={'where':{'id':_0x581b79[_0x79c4('0x59')]['id']},'attributes':['id',_0x79c4('0x83')],'raw':!![]};return db[_0x79c4('0x3f')]['find'](_0x11e942)['then'](handleEntityNotFound(_0x436500,null))[_0x79c4('0x21')](function(_0x5a96d7){if(_0x5a96d7){if(!_[_0x79c4('0x78')](_0x5a96d7[_0x79c4('0x83')])){if(fs[_0x79c4('0x79')](path[_0x79c4('0x73')](config[_0x79c4('0x74')],'server/files/images/avatars/',_0x5a96d7['systemAvatar']))){_0x5acfa1=path[_0x79c4('0x73')](config[_0x79c4('0x74')],_0x79c4('0x7e'),_0x5a96d7[_0x79c4('0x83')]);}}return _0x436500['download'](_0x5acfa1);}})[_0x79c4('0x2b')](handleError(_0x436500,null));};exports[_0x79c4('0x84')]=function(_0x5cdccc,_0x400e0b,_0x13ddb3){var _0x397d59=require(_0x79c4('0x85'));var _0x2e04b3=new _0x397d59();var _0x574d25=_0x2e04b3[_0x79c4('0x86')](_0x5cdccc['headers'][_0x79c4('0x87')])[_0x79c4('0x88')]();var _0x52531b={'body':_0x5cdccc[_0x79c4('0x5c')],'channel':_0x79c4('0x89')};var _0x4e3414=[];var _0x4514f0=[];var _0x28d373={};var _0x32b003=![];return db[_0x79c4('0x8a')][_0x79c4('0x8b')]()[_0x79c4('0x21')](function(_0x299dc0){if(!_0x299dc0){throw new db['Sequelize'][(_0x79c4('0x1f'))](_0x79c4('0x8c'));}_0x4e3414=_[_0x79c4('0x8d')](_[_0x79c4('0x46')](_0x299dc0),[_0x79c4('0x8e'),_0x79c4('0x8f')]);_0x4514f0=_[_0x79c4('0x8d')](_[_0x79c4('0x46')](_0x299dc0),[_0x79c4('0x8e'),_0x79c4('0x8f'),'CompanyId','ListId']);if(_0x5cdccc[_0x79c4('0x5c')]['id']){delete _0x5cdccc[_0x79c4('0x5c')]['id'];}if(_[_0x79c4('0x78')](_0x5cdccc[_0x79c4('0x5c')]['from'])){throw new db[(_0x79c4('0x1e'))][(_0x79c4('0x1f'))](_0x79c4('0x90'));}if(_['isNil'](_0x5cdccc[_0x79c4('0x5c')]['body'])||_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x5c')]===''){throw new db[(_0x79c4('0x1e'))][(_0x79c4('0x1f'))](_0x79c4('0x91'));}if(_[_0x79c4('0x78')](_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x92')])){throw new db[(_0x79c4('0x1e'))][(_0x79c4('0x1f'))](_0x79c4('0x93')+_0x4514f0);}if(!_[_0x79c4('0x94')](_0x4514f0,_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x92')])){throw new db[(_0x79c4('0x1e'))][(_0x79c4('0x1f'))](_0x79c4('0x95')+_0x4514f0);}_0x28d373[_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x92')]]=_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x96')];})[_0x79c4('0x21')](function(){return db[_0x79c4('0x3f')]['find']({'where':{'id':_0x5cdccc['params']['id']},'include':[{'model':db[_0x79c4('0x97')],'as':'List','include':[{'model':db[_0x79c4('0x8a')],'as':_0x79c4('0x98'),'where':_0x28d373,'limit':0x1,'order':[[_0x79c4('0x8f'),_0x79c4('0x99')]]}]},{'model':db[_0x79c4('0x9a')],'as':_0x79c4('0x9b')}]});})[_0x79c4('0x21')](handleEntityNotFound(_0x400e0b,null))[_0x79c4('0x21')](function(_0x3faaff){if(_0x3faaff&&_0x3faaff['List']){_0x52531b['account']=_0x3faaff;_0x52531b[_0x79c4('0x9c')]=_0x3faaff['Applications'];_0x52531b[_0x79c4('0x9d')]=_0x3faaff[_0x79c4('0x9e')];_0x52531b['applications']=_[_0x79c4('0x9f')](_0x52531b['applications'],['priority'],['asc']);if(_0x52531b[_0x79c4('0xa0')][_0x79c4('0x9b')]){delete _0x52531b['account'][_0x79c4('0x9b')];}if(_0x52531b[_0x79c4('0xa0')]['List']&&_0x52531b[_0x79c4('0xa0')][_0x79c4('0x9e')][_0x79c4('0x98')][_0x79c4('0x4b')]){return _0x52531b[_0x79c4('0xa0')][_0x79c4('0x9e')][_0x79c4('0x98')][0x0];}var _0x191ee1=_[_0x79c4('0x17')](_0x5cdccc['body'],{'firstName':_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x96')],'ListId':_0x3faaff[_0x79c4('0xa1')]});_0x191ee1[_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x92')]]=_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x96')];return db[_0x79c4('0x8a')][_0x79c4('0x5b')](_0x191ee1,{'fields':_0x4e3414,'raw':!![]});}})[_0x79c4('0x21')](handleEntityNotFound(_0x400e0b,null))[_0x79c4('0x21')](function(_0x2a222b){_0x52531b[_0x79c4('0xa2')]=_0x2a222b;var _0x492fa6=_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xa3')];if(_0x5cdccc[_0x79c4('0xa4')][_0x79c4('0xa5')]){_0x492fa6=_0x5cdccc[_0x79c4('0xa4')]['cf-connecting-ip'];}else if(_0x5cdccc[_0x79c4('0xa4')][_0x79c4('0xa6')]){_0x492fa6=_[_0x79c4('0xa7')](_0x5cdccc[_0x79c4('0xa4')][_0x79c4('0xa6')][_0x79c4('0xa8')](','));}if(_0x2a222b){var _0x4cb459={'ContactId':_0x2a222b['id'],'ChatWebsiteId':_0x5cdccc[_0x79c4('0x59')]['id'],'from':(_0x2a222b[_0x79c4('0xa9')]||'')+'\x20'+(_0x2a222b[_0x79c4('0xaa')]||''),'customerIp':_0x492fa6,'customerPort':_0x5cdccc[_0x79c4('0xa4')]['x-real-port']?_0x5cdccc[_0x79c4('0xa4')]['x-real-port']:null,'referer':_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xab')],'browserName':_0x574d25[_0x79c4('0xac')][_0x79c4('0x3b')]&&_0x574d25['browser']['version']?util[_0x79c4('0xad')](_0x79c4('0xae'),_0x574d25[_0x79c4('0xac')][_0x79c4('0x3b')],_0x574d25[_0x79c4('0xac')][_0x79c4('0xaf')]):_0x79c4('0xb0'),'browserVersion':_0x574d25[_0x79c4('0xac')][_0x79c4('0xaf')]||_0x79c4('0xb0'),'osName':util[_0x79c4('0xad')](_0x79c4('0xae'),_0x574d25['os'][_0x79c4('0x3b')],_0x574d25['os']['version']),'osVersion':_0x574d25['os'][_0x79c4('0xaf')],'deviceModel':_0x574d25[_0x79c4('0xb1')][_0x79c4('0x44')]&&_0x574d25[_0x79c4('0xb1')]['vendor']?util[_0x79c4('0xad')](_0x79c4('0xb2'),_0x574d25[_0x79c4('0xb1')][_0x79c4('0x44')],_0x574d25['device']['vendor'],_0x574d25[_0x79c4('0xb1')][_0x79c4('0x42')]):null,'deviceVendor':_0x574d25['device'][_0x79c4('0xb3')],'deviceType':_0x574d25['device'][_0x79c4('0x42')],'formData':JSON[_0x79c4('0xb4')](_0x5cdccc[_0x79c4('0x5c')])};var _0x5d7fdf={'ChatWebsiteId':_0x5cdccc[_0x79c4('0x59')]['id'],'closed':![]};if(_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xb5')]){_0x5d7fdf[_0x79c4('0xb5')]=_0x5cdccc[_0x79c4('0x5c')]['threadId'];return db['ChatInteraction'][_0x79c4('0x5f')]({'where':_0x5d7fdf})[_0x79c4('0x21')](function(_0x2b05ad){if(_0x2b05ad){return[_0x2b05ad,![]];}_0x4cb459[_0x79c4('0xb5')]=_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xb5')];_0x4cb459[_0x79c4('0xb6')]=_0x5cdccc[_0x79c4('0x5c')]['externalUrl'];return db[_0x79c4('0xb7')][_0x79c4('0x5b')](_0x4cb459)['then'](function(_0x3636d0){return[_0x3636d0,!![]];});});}_0x5d7fdf[_0x79c4('0xb8')]=_0x2a222b['id'];if(_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xb9')]&&_0x5cdccc['body'][_0x79c4('0xb9')]['id']){_0x5d7fdf['id']=_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xb9')]['id'];return db[_0x79c4('0xb7')][_0x79c4('0x5f')]({'where':_0x5d7fdf})[_0x79c4('0x21')](function(_0x5335fc){if(_0x5335fc){return[_0x5335fc,![]];}return db[_0x79c4('0xb7')][_0x79c4('0x5b')](_0x4cb459)[_0x79c4('0x21')](function(_0x311701){return[_0x311701,!![]];});});}return db[_0x79c4('0xb7')][_0x79c4('0x5b')](_0x4cb459)[_0x79c4('0x21')](function(_0x3cb176){return[_0x3cb176,!![]];});}})[_0x79c4('0xba')](function(_0x3cc672,_0x505745){if(_0x3cc672){_0x32b003=_0x505745;if(!_0x505745){var _0x4fb982={'from':(_0x52531b['contact']['firstName']||'')+'\x20'+(_0x52531b['contact'][_0x79c4('0xaa')]||'')};if(_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xb5')]&&_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xbb')]&&_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xb5')]!=_0x5cdccc[_0x79c4('0x5c')]['messageId']){_0x4fb982[_0x79c4('0xb5')]=_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xbb')];}return _0x3cc672[_0x79c4('0x35')](_0x4fb982);}else{return _0x3cc672;}}})['then'](function(_0x51a94b){_0x52531b[_0x79c4('0xb9')]=_0x51a94b[_0x79c4('0x37')]({'plain':!![]});_0x52531b['interaction'][_0x79c4('0xbc')]=_0x32b003;if(_0x52531b[_0x79c4('0xb9')][_0x79c4('0xbc')]){if(_0x52531b[_0x79c4('0xa0')][_0x79c4('0xbd')]){_0x52531b[_0x79c4('0x9c')]['push']({'id':0x0,'priority':_0x52531b['applications']['length']+0x1,'app':'close','appdata':_0x79c4('0xbe'),'interval':_0x79c4('0xbf')});}}return db[_0x79c4('0xc0')][_0x79c4('0x5b')]({'body':_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0x5c')],'ChatWebsiteId':_0x5cdccc[_0x79c4('0x59')]['id'],'ChatInteractionId':_0x51a94b['id'],'direction':'in','ContactId':_0x52531b[_0x79c4('0xa2')]['id'],'AttachmentId':_0x5cdccc[_0x79c4('0x5c')][_0x79c4('0xc1')]});})['then'](function(_0x524179){_0x52531b[_0x79c4('0x29')]=_0x524179;if(_0x52531b[_0x79c4('0xb9')][_0x79c4('0xc2')]){return db[_0x79c4('0xc3')][_0x79c4('0x5f')]({'attributes':['id',_0x79c4('0x3b')],'where':{'id':_0x52531b['interaction']['UserId']}})[_0x79c4('0x21')](function(_0x230365){if(_0x230365){_0x52531b[_0x79c4('0x9c')][_0x79c4('0xc4')]({'id':0x0,'priority':0x0,'app':_0x79c4('0xc5'),'appdata':_0x230365[_0x79c4('0x3b')]+','+(_0x52531b[_0x79c4('0xa0')]['waitForTheAssignedAgent']||0xa),'interval':_0x79c4('0xbf')});_0x52531b[_0x79c4('0xc6')]=!![];}return respondWithRpcPromise('Start',_0x79c4('0xc7'),_0x52531b);});}return respondWithRpcPromise(_0x79c4('0xc8'),_0x79c4('0xc7'),_0x52531b);})['then'](function(_0x1909e6){respondWithRpcPromise(_0x79c4('0xc9'),_0x79c4('0xc9'),{'event':_0x79c4('0x84'),'message':_0x1909e6},client9002);return _0x1909e6;})[_0x79c4('0x21')](respondWithResult(_0x400e0b,null))[_0x79c4('0x2b')](handleError(_0x400e0b,null));};exports[_0x79c4('0xca')]=function(_0xf49adf,_0x4efd6c,_0x4ed2af){var _0x80c84e,_0x38ac44,_0x3d231d;var _0x1dd6d8=[];var _0xa3a477=[];var _0x46ee4c={};return db[_0x79c4('0x8a')][_0x79c4('0x8b')]()[_0x79c4('0x21')](function(_0x197f3f){if(!_0x197f3f){throw new db[(_0x79c4('0x1e'))][(_0x79c4('0x1f'))](_0x79c4('0x8c'));}_0xa3a477=_[_0x79c4('0x8d')](_[_0x79c4('0x46')](_0x197f3f),['createdAt','updatedAt']);_0x1dd6d8=_['difference'](_[_0x79c4('0x46')](_0x197f3f),[_0x79c4('0x8e'),_0x79c4('0x8f'),_0x79c4('0xcb'),_0x79c4('0xa1')]);if(_0xf49adf[_0x79c4('0x5c')]['id']){delete _0xf49adf[_0x79c4('0x5c')]['id'];}if(_[_0x79c4('0x78')](_0xf49adf[_0x79c4('0x5c')]['from'])){throw _0x4efd6c[_0x79c4('0x2d')](0x1f4)[_0x79c4('0xcc')](new db[(_0x79c4('0x1e'))][(_0x79c4('0x1f'))](_0x79c4('0x90')));}if(_[_0x79c4('0x78')](_0xf49adf[_0x79c4('0x5c')][_0x79c4('0x5c')])||_0xf49adf[_0x79c4('0x5c')][_0x79c4('0x5c')]===''){throw _0x4efd6c[_0x79c4('0x2d')](0x1f4)['send'](new db[(_0x79c4('0x1e'))][(_0x79c4('0x1f'))](_0x79c4('0x91')));}if(_[_0x79c4('0x78')](_0xf49adf['body']['mapKeyOffline'])){throw _0x4efd6c['status'](0x1f4)[_0x79c4('0xcc')](new db['Sequelize'][(_0x79c4('0x1f'))](_0x79c4('0xcd')+_0x1dd6d8));}if(!_[_0x79c4('0x94')](_0x1dd6d8,_0xf49adf[_0x79c4('0x5c')]['mapKeyOffline'])){throw _0x4efd6c['status'](0x1f4)[_0x79c4('0xcc')](new db[(_0x79c4('0x1e'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dd6d8));}_0x46ee4c[_0xf49adf[_0x79c4('0x5c')][_0x79c4('0xce')]]=_0xf49adf[_0x79c4('0x5c')][_0x79c4('0x96')];})[_0x79c4('0x21')](function(){return db[_0x79c4('0x3f')][_0x79c4('0x5f')]({'where':{'id':_0xf49adf[_0x79c4('0x59')]['id']},'include':[{'model':db[_0x79c4('0x97')],'as':_0x79c4('0x9e')}]});})[_0x79c4('0x21')](handleEntityNotFound(_0x4efd6c,null))[_0x79c4('0x21')](function(_0x55e1f0){if(_0x55e1f0&&_0x55e1f0[_0x79c4('0x9e')]){_0x38ac44=_0x55e1f0;var _0x1d82b8=_[_0x79c4('0x17')](_0xf49adf[_0x79c4('0x5c')],{'firstName':_0xf49adf[_0x79c4('0x5c')][_0x79c4('0x96')],'phone':_0xf49adf[_0x79c4('0x5c')][_0x79c4('0x96')],'ListId':_0x55e1f0[_0x79c4('0xa1')]});_0x1d82b8[_0xf49adf[_0x79c4('0x5c')][_0x79c4('0xce')]]=_0xf49adf[_0x79c4('0x5c')][_0x79c4('0x96')];return db[_0x79c4('0x8a')]['findOrCreate']({'where':_0x46ee4c,'defaults':_0x1d82b8});}})[_0x79c4('0xba')](function(_0x15ae25){if(_0x15ae25){_0x3d231d=_0x15ae25;var _0x3b7e6e=fs[_0x79c4('0xcf')](path['join'](config[_0x79c4('0x74')],_0x79c4('0xd0')),_0x79c4('0xd1'));var _0x23832d=ejs[_0x79c4('0xd2')](_0x3b7e6e,{'body':_[_0x79c4('0xd3')](_0xf49adf[_0x79c4('0x5c')]['body']),'bodyTitle':_0x38ac44[_0x79c4('0xd4')]});return db[_0x79c4('0xd5')][_0x79c4('0x5b')]({'body':_0x23832d,'ContactId':_0x15ae25['id'],'ChatWebsiteId':_0x38ac44['id']});}})[_0x79c4('0x21')](function(_0x2eed01){if(_0x2eed01){_0x80c84e=_0x2eed01;return db['MailAccount'][_0x79c4('0x66')]({'where':{'service':!![]},'include':[{'model':db[_0x79c4('0xd6')],'as':_0x79c4('0xd7'),'raw':!![]}]});}})[_0x79c4('0x21')](function(_0x2747f0){if(_0x2747f0&&_0x2747f0[_0x79c4('0xd7')]&&_0x38ac44[_0x79c4('0xd8')]){var _0x401fc8={'tls':{'rejectUnauthorized':![]}};if(_0x2747f0[_0x79c4('0xd7')][_0x79c4('0xd9')]){_0x401fc8[_0x79c4('0xd9')]=_0x2747f0[_0x79c4('0xd7')][_0x79c4('0xd9')];}else{_0x401fc8['host']=_0x2747f0[_0x79c4('0xd7')][_0x79c4('0xda')];_0x401fc8[_0x79c4('0xdb')]=_0x2747f0[_0x79c4('0xd7')][_0x79c4('0xdb')];_0x401fc8['secure']=_0x2747f0[_0x79c4('0xd7')]['secure'];}if(_0x2747f0['Smtp']['authentication']){_0x401fc8['auth']={'user':_0x2747f0[_0x79c4('0xd7')][_0x79c4('0xdc')],'pass':_0x2747f0[_0x79c4('0xd7')][_0x79c4('0xdd')]};}return respondWithRpcPromise(_0x79c4('0xde'),'sendMail',{'account':_0x401fc8,'message':{'from':util['format'](_0x79c4('0xdf'),_0x2747f0[_0x79c4('0x3b')],_0x2747f0[_0x79c4('0xe0')]||_0x2747f0[_0x79c4('0xd7')][_0x79c4('0xdc')]),'to':_0x38ac44[_0x79c4('0xd8')],'subject':_0x38ac44[_0x79c4('0xe1')],'text':_0x80c84e[_0x79c4('0x5c')]}},client9003)[_0x79c4('0x21')](function(){return _0x80c84e;})['catch'](function(_0xa5fb29){console['error'](_0xa5fb29);});}})['then'](function(){if(_0x80c84e){return _0x80c84e;}})['then'](respondWithResult(_0x4efd6c,null))[_0x79c4('0x2b')](handleError(_0x4efd6c,null));};exports[_0x79c4('0xe2')]=function(_0x5eabc5,_0xb31c5e,_0x10917e){return db[_0x79c4('0xb7')]['find']({'where':{'id':_0x5eabc5[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0xb31c5e,null))[_0x79c4('0x21')](function(_0x3b25e3){if(_0x3b25e3){return _0x3b25e3['addInteraction'](_0x5eabc5[_0x79c4('0x5c')]['ids'],_['omit'](_0x5eabc5[_0x79c4('0x5c')],[_0x79c4('0x68'),'id'])||{});}})[_0x79c4('0x21')](respondWithResult(_0xb31c5e,null))[_0x79c4('0x2b')](handleError(_0xb31c5e,null));};exports[_0x79c4('0xe3')]=function(_0x22d532,_0x5c53bc,_0x47ec6b){var _0x23d9ab={'raw':![],'where':{}};var _0x58e406={};var _0x818183={'count':0x0,'rows':[]};return db[_0x79c4('0x3f')][_0x79c4('0x66')]({'where':{'id':_0x22d532['params']['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x5c53bc,null))['then'](function(_0x5d296b){if(_0x5d296b){_0x58e406[_0x79c4('0x44')]=_[_0x79c4('0x46')](db[_0x79c4('0xb7')][_0x79c4('0x40')]);_0x58e406[_0x79c4('0x45')]=_[_0x79c4('0x46')](_0x22d532['query']);_0x58e406[_0x79c4('0x47')]=_['intersection'](_0x58e406['model'],_0x58e406['query']);_0x23d9ab[_0x79c4('0x49')]=_[_0x79c4('0x48')](_0x58e406[_0x79c4('0x44')],qs[_0x79c4('0x4a')](_0x22d532[_0x79c4('0x45')][_0x79c4('0x4a')]));_0x23d9ab['attributes']=_0x23d9ab[_0x79c4('0x49')][_0x79c4('0x4b')]?_0x23d9ab[_0x79c4('0x49')]:_0x58e406['model'];if(!_0x22d532[_0x79c4('0x45')][_0x79c4('0x4c')](_0x79c4('0x4d'))){_0x23d9ab[_0x79c4('0x31')]=qs[_0x79c4('0x31')](_0x22d532[_0x79c4('0x45')][_0x79c4('0x31')]);_0x23d9ab[_0x79c4('0x30')]=qs[_0x79c4('0x30')](_0x22d532[_0x79c4('0x45')][_0x79c4('0x30')]);}_0x23d9ab[_0x79c4('0x6b')]=qs[_0x79c4('0x4e')](_0x22d532[_0x79c4('0x45')]['sort']);_0x23d9ab['where']=qs['filters'](_[_0x79c4('0x6c')](_0x22d532[_0x79c4('0x45')],_0x58e406['filters']));_0x23d9ab[_0x79c4('0x50')][_0x79c4('0x64')]=_0x5d296b['id'];if(_0x22d532[_0x79c4('0x45')][_0x79c4('0x4f')]){_0x23d9ab[_0x79c4('0x50')]=_[_0x79c4('0x51')](_0x23d9ab[_0x79c4('0x50')],{'$or':_['map'](_0x23d9ab[_0x79c4('0x49')],function(_0x352cab){var _0x572f13={};_0x572f13[_0x352cab]={'$like':'%'+_0x22d532[_0x79c4('0x45')][_0x79c4('0x4f')]+'%'};return _0x572f13;})});}_0x23d9ab=_[_0x79c4('0x51')]({},_0x23d9ab,_0x22d532[_0x79c4('0x53')]);return db['ChatInteraction']['count']({'where':_0x23d9ab[_0x79c4('0x50')]})[_0x79c4('0x21')](function(_0x384db5){_0x818183[_0x79c4('0x54')]=_0x384db5;if(_0x22d532[_0x79c4('0x45')][_0x79c4('0x5a')]){_0x23d9ab[_0x79c4('0x55')]=[{'model':db[_0x79c4('0x8a')],'as':'Contact','required':![]},{'model':db[_0x79c4('0xc3')],'as':'Owner','attributes':['name',_0x79c4('0xe4'),_0x79c4('0xe5')],'required':![]},{'model':db[_0x79c4('0xe6')],'as':_0x79c4('0xe7'),'attributes':['id',_0x79c4('0x3b'),_0x79c4('0xe8')],'where':_0x22d532[_0x79c4('0x45')]['tag']?{'id':_0x22d532[_0x79c4('0x45')][_0x79c4('0xe9')]}:undefined,'required':_0x22d532[_0x79c4('0x45')][_0x79c4('0xe9')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x23d9ab);})[_0x79c4('0x21')](function(_0x2c2fd4){_0x818183[_0x79c4('0x57')]=_0x2c2fd4;return _0x818183;});}})[_0x79c4('0x21')](respondWithFilteredResult(_0x5c53bc,_0x23d9ab))[_0x79c4('0x2b')](handleError(_0x5c53bc,null));};function iftimePromise(_0x2d54e2,_0x5d6321){return respondWithRpcPromise('Command',_0x79c4('0xea'),{'command':_0x5d6321[_0x79c4('0xeb')]?util['format'](_0x79c4('0xec'),_0x2d54e2[_0x79c4('0xed')],_0x5d6321[_0x79c4('0xeb')]):util[_0x79c4('0xad')](_0x79c4('0xee'),_0x2d54e2['interval'])},client9002)[_0x79c4('0x21')](function(_0x3935b2){var _0xe4e094=_0x3935b2&&_0x3935b2[_0x79c4('0xef')](_0x79c4('0xf0'))>=0x0?!![]:![];logger[_0x79c4('0x22')](_0x79c4('0xf1'),_0x5d6321['id'],_0x2d54e2['id'],_0x2d54e2[_0x79c4('0xed')],_0xe4e094?_0x79c4('0xf2'):_0x79c4('0xf3'),_0x5d6321['timezone']?_0x5d6321[_0x79c4('0xeb')]:_0x79c4('0xf4'));return _0xe4e094;})['catch'](function(_0x43e4f0){logger['error'](_0x79c4('0xf1'),_0x5d6321['id'],_0x2d54e2['id'],_0x2d54e2[_0x79c4('0xed')],util[_0x79c4('0xf5')](_0x43e4f0,{'showHidden':![],'depth':null}),_0x5d6321[_0x79c4('0xeb')]?_0x5d6321[_0x79c4('0xeb')]:_0x79c4('0xf4'));return![];});}exports['getSnippet']=function(_0x446fa8,_0x13615b,_0x18c056){var _0xf99e41=0x0;var _0x1b2876=0x0;var _0x3b7e3a=![];var _0x1d5d19;var _0x232989;return db['ChatWebsite'][_0x79c4('0x5f')]({'where':{'id':_0x446fa8[_0x79c4('0x59')]['id']},'include':[{'model':db[_0x79c4('0xf6')],'as':'Interval','include':[{'model':db[_0x79c4('0xf6')],'as':_0x79c4('0xf7'),'attributes':['id',_0x79c4('0xed')],'raw':!![]}]}]})[_0x79c4('0x21')](handleEntityNotFound(_0x13615b,null))[_0x79c4('0x21')](function(_0x22cc01){if(_0x22cc01){_0x1d5d19=_0x22cc01;return _0x22cc01['getProactiveActions']({'raw':!![]});}})[_0x79c4('0x21')](function(_0x2487f6){if(_0x1d5d19){if(_0x2487f6){_0x232989=_0x2487f6;}}return require(_0x79c4('0xf8'))[_0x79c4('0x76')]();})['then'](function(_0x1169b4){if(_0x1169b4){_0x1b2876=_0x1169b4[_0x79c4('0xf9')];_0x3b7e3a=_0x1169b4[_0x79c4('0x77')];}})[_0x79c4('0x21')](function(){return db['ChatInteraction'][_0x79c4('0x54')]({'where':{'closed':![]}});})['then'](function(_0x4a814f){_0xf99e41=_0x4a814f;if(_0x1b2876&&_0x4a814f>_0x1b2876){return db[_0x79c4('0xfa')][_0x79c4('0x66')]({'where':{'id':0x1}})[_0x79c4('0x21')](function(_0x6cf4ad){if(_0x6cf4ad){_0x6cf4ad['increment'](_0x79c4('0xfb'));}});}})[_0x79c4('0x21')](function(){if(_0x1d5d19[_0x79c4('0xf6')]&&_0x1d5d19[_0x79c4('0xf6')][_0x79c4('0xf7')]){var _0x39c252=[];for(var _0x4b9533=0x0;_0x4b9533<_0x1d5d19[_0x79c4('0xf6')][_0x79c4('0xf7')][_0x79c4('0x4b')];_0x4b9533++){var _0x575da1=_0x1d5d19['Interval'][_0x79c4('0xf7')][_0x4b9533]['get']({'plain':!![]});_0x39c252[_0x79c4('0xfc')](iftimePromise(_0x575da1,_0x1d5d19));}return BPromise[_0x79c4('0xfd')](_0x39c252)[_0x79c4('0x21')](function(_0x57209a){return _['some'](_0x57209a);});}else{return!![];}})['then'](function(_0x1db7ea){var _0x15270d=fs[_0x79c4('0xcf')](path[_0x79c4('0x73')](config[_0x79c4('0x74')],_0x79c4('0xfe')),_0x79c4('0xd1'));var _0xfbb88={'remote':_0x1d5d19[_0x79c4('0xff')],'query':querystring[_0x79c4('0xb4')](_[_0x79c4('0x51')](_0x1d5d19['get']({'plain':!![]}),{'customerIp':_0x446fa8[_0x79c4('0xa4')][_0x79c4('0xa6')]||_0x446fa8[_0x79c4('0xa4')][_0x79c4('0x100')]||_0x446fa8[_0x79c4('0x101')]['remoteAddress']||_0x446fa8['ip'],'referer':_0x446fa8[_0x79c4('0xa4')][_0x79c4('0xab')],'openedInteractions':_0xf99e41,'maxInteractions':_0x1b2876,'virtual':_0x3b7e3a[_0x79c4('0xf9')],'online':_0x1db7ea,'custom':_0x3b7e3a}))[_0x79c4('0x102')](/'/g,'\x5c\x27')};_0x13615b[_0x79c4('0xcc')](ejs[_0x79c4('0xd2')](Mustache[_0x79c4('0xd2')](_0x15270d,_0xfbb88),{'proactiveActions':_0x232989,'alignment':_0x1d5d19[_0x79c4('0x103')],'verticalAlignment':_0x1d5d19[_0x79c4('0x104')],'div_color':_0x1d5d19['color'],'text_color':_0x1d5d19[_0x79c4('0x105')]}));})[_0x79c4('0x2b')](handleError(_0x13615b,null));};exports[_0x79c4('0x106')]=function(_0x406a08,_0x8c2f47,_0x6aaabb){return db[_0x79c4('0x3f')][_0x79c4('0x66')]({'where':{'id':_0x406a08[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x8c2f47,null))[_0x79c4('0x21')](function(_0xf51133){if(_0xf51133){return db[_0x79c4('0x107')][_0x79c4('0x108')](function(_0x4547f2){return db[_0x79c4('0x9a')][_0x79c4('0x36')]({'where':{'ChatWebsiteId':_0x406a08[_0x79c4('0x59')]['id']},'transaction':_0x4547f2})[_0x79c4('0x21')](function(_0x36d635){var _0x3793fe=_['map'](_0x406a08['body'],function(_0x385140){_0x385140[_0x79c4('0x64')]=_0x406a08[_0x79c4('0x59')]['id'];return _0x385140;});return db[_0x79c4('0x9a')]['bulkCreate'](_0x3793fe,{'transaction':_0x4547f2});});})[_0x79c4('0x21')](function(){return db['ChatApplication'][_0x79c4('0x109')]({'where':{'ChatWebsiteId':_0x406a08['params']['id']},'order':_0x79c4('0x10a')});});}})[_0x79c4('0x21')](respondWithResult(_0x8c2f47,null))['catch'](handleError(_0x8c2f47,null));};exports[_0x79c4('0x10b')]=function(_0xd803b6,_0x1558ef,_0x28cca7){var _0x3b07bb={};var _0x325cb5={};var _0xf754e2;var _0x19f81c;return db[_0x79c4('0x3f')][_0x79c4('0x66')]({'where':{'id':_0xd803b6[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x1558ef,null))['then'](function(_0x37c04b){if(_0x37c04b){_0xf754e2=_0x37c04b;_0x325cb5[_0x79c4('0x44')]=_[_0x79c4('0x46')](db[_0x79c4('0x9a')][_0x79c4('0x40')]);_0x325cb5[_0x79c4('0x45')]=_[_0x79c4('0x46')](_0xd803b6[_0x79c4('0x45')]);_0x325cb5['filters']=_[_0x79c4('0x48')](_0x325cb5[_0x79c4('0x44')],_0x325cb5[_0x79c4('0x45')]);_0x3b07bb[_0x79c4('0x49')]=_[_0x79c4('0x48')](_0x325cb5[_0x79c4('0x44')],qs[_0x79c4('0x4a')](_0xd803b6[_0x79c4('0x45')][_0x79c4('0x4a')]));_0x3b07bb[_0x79c4('0x49')]=_0x3b07bb[_0x79c4('0x49')][_0x79c4('0x4b')]?_0x3b07bb[_0x79c4('0x49')]:_0x325cb5[_0x79c4('0x44')];_0x3b07bb[_0x79c4('0x6b')]=qs[_0x79c4('0x4e')](_0xd803b6[_0x79c4('0x45')][_0x79c4('0x4e')]);_0x3b07bb[_0x79c4('0x50')]=qs['filters'](_[_0x79c4('0x6c')](_0xd803b6['query'],_0x325cb5[_0x79c4('0x47')]));if(_0xd803b6[_0x79c4('0x45')]['filter']){_0x3b07bb['where']=_[_0x79c4('0x51')](_0x3b07bb[_0x79c4('0x50')],{'$or':_[_0x79c4('0x52')](_0x3b07bb['attributes'],function(_0x37d44f){var _0x3896c5={};_0x3896c5[_0x37d44f]={'$like':'%'+_0xd803b6[_0x79c4('0x45')][_0x79c4('0x4f')]+'%'};return _0x3896c5;})});}_0x3b07bb=_[_0x79c4('0x51')]({},_0x3b07bb,_0xd803b6['options']);return _0xf754e2['getApplications'](_0x3b07bb);}})[_0x79c4('0x21')](function(_0x1f90c7){if(_0x1f90c7){_0x19f81c=_0x1f90c7[_0x79c4('0x4b')];if(!_0xd803b6[_0x79c4('0x45')]['hasOwnProperty'](_0x79c4('0x4d'))){_0x3b07bb['limit']=qs['limit'](_0xd803b6[_0x79c4('0x45')]['limit']);_0x3b07bb['offset']=qs['offset'](_0xd803b6[_0x79c4('0x45')]['offset']);}return _0xf754e2[_0x79c4('0x10b')](_0x3b07bb);}})[_0x79c4('0x21')](function(_0x452686){if(_0x452686){return _0x452686?{'count':_0x19f81c,'rows':_0x452686}:null;}})['then'](respondWithResult(_0x1558ef,null))[_0x79c4('0x2b')](handleError(_0x1558ef,null));};exports[_0x79c4('0x10c')]=function(_0x1d1eeb,_0x51d04c,_0x1a8ab7){return db[_0x79c4('0x10d')][_0x79c4('0x5f')]({'where':{'id':_0x1d1eeb[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x51d04c,null))[_0x79c4('0x21')](function(_0x285a01){if(_0x285a01){return _0x285a01[_0x79c4('0x10c')](_0x1d1eeb[_0x79c4('0x5c')][_0x79c4('0x68')],_[_0x79c4('0x10e')](_0x1d1eeb[_0x79c4('0x5c')],[_0x79c4('0x68'),'id'])||{});}})[_0x79c4('0x21')](respondWithResult(_0x51d04c,null))[_0x79c4('0x2b')](handleError(_0x51d04c,null));};exports[_0x79c4('0x10f')]=function(_0xd0a3ef,_0x4519fd,_0x284f91){var _0x209643={};var _0x3d9d49={};var _0x5162a7;var _0x139d02;return db[_0x79c4('0x3f')][_0x79c4('0x66')]({'where':{'id':_0xd0a3ef[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x4519fd,null))[_0x79c4('0x21')](function(_0x4ec33b){if(_0x4ec33b){_0x5162a7=_0x4ec33b;_0x3d9d49['model']=_[_0x79c4('0x46')](db[_0x79c4('0x110')][_0x79c4('0x40')]);_0x3d9d49[_0x79c4('0x45')]=_['keys'](_0xd0a3ef[_0x79c4('0x45')]);_0x3d9d49[_0x79c4('0x47')]=_[_0x79c4('0x48')](_0x3d9d49[_0x79c4('0x44')],_0x3d9d49[_0x79c4('0x45')]);_0x209643[_0x79c4('0x49')]=_['intersection'](_0x3d9d49[_0x79c4('0x44')],qs[_0x79c4('0x4a')](_0xd0a3ef[_0x79c4('0x45')][_0x79c4('0x4a')]));_0x209643[_0x79c4('0x49')]=_0x209643['attributes'][_0x79c4('0x4b')]?_0x209643['attributes']:_0x3d9d49[_0x79c4('0x44')];_0x209643[_0x79c4('0x6b')]=qs[_0x79c4('0x4e')](_0xd0a3ef['query'][_0x79c4('0x4e')]);_0x209643[_0x79c4('0x50')]=qs[_0x79c4('0x47')](_[_0x79c4('0x6c')](_0xd0a3ef[_0x79c4('0x45')],_0x3d9d49[_0x79c4('0x47')]));if(_0xd0a3ef[_0x79c4('0x45')][_0x79c4('0x4f')]){_0x209643[_0x79c4('0x50')]=_[_0x79c4('0x51')](_0x209643[_0x79c4('0x50')],{'$or':_['map'](_0x209643[_0x79c4('0x49')],function(_0x55509d){var _0x21e917={};_0x21e917[_0x55509d]={'$like':'%'+_0xd0a3ef[_0x79c4('0x45')][_0x79c4('0x4f')]+'%'};return _0x21e917;})});}_0x209643=_['merge']({},_0x209643,_0xd0a3ef['options']);return _0x5162a7['getProactiveActions'](_0x209643);}})[_0x79c4('0x21')](function(_0x33da11){if(_0x33da11){_0x139d02=_0x33da11[_0x79c4('0x4b')];if(!_0xd0a3ef[_0x79c4('0x45')]['hasOwnProperty']('nolimit')){_0x209643[_0x79c4('0x31')]=qs[_0x79c4('0x31')](_0xd0a3ef['query'][_0x79c4('0x31')]);_0x209643['offset']=qs[_0x79c4('0x30')](_0xd0a3ef[_0x79c4('0x45')][_0x79c4('0x30')]);}return _0x5162a7[_0x79c4('0x10f')](_0x209643);}})['then'](function(_0x3acdc9){if(_0x3acdc9){return _0x3acdc9?{'count':_0x139d02,'rows':_0x3acdc9}:null;}})[_0x79c4('0x21')](respondWithResult(_0x4519fd,null))[_0x79c4('0x2b')](handleError(_0x4519fd,null));};exports[_0x79c4('0x111')]=function(_0x16aeed,_0x382ad2,_0x260c18){var _0x12872b=_0x16aeed[_0x79c4('0x45')][_0x79c4('0x112')]===_0x79c4('0x113')?_0x79c4('0x114'):_0x79c4('0x115');return db[_0x79c4('0x3f')]['find']({'attributes':['id',_0x12872b],'where':{'id':_0x16aeed[_0x79c4('0x59')]['id']}})['then'](handleEntityNotFound(_0x382ad2,null))[_0x79c4('0x21')](function(_0x1bcedc){if(_0x1bcedc){var _0xfac321=_0x1bcedc[_0x12872b];var _0x266827=_0xfac321&&_0xfac321[_0x79c4('0x116')]?_0xfac321['items']:[];_0x382ad2[_0x79c4('0xcc')]({'fromKey':_[_0x79c4('0x78')](_0xfac321['fromKey'])?undefined:_0xfac321['fromKey'],'count':_0x266827[_0x79c4('0x4b')],'rows':_0x266827});}})['catch'](handleError(_0x382ad2,null));};exports[_0x79c4('0x117')]=function(_0x4e3626,_0x1118ea,_0x419750){var _0x30e2db={'raw':![],'where':{}};var _0x2006e7={};var _0x229be7={'count':0x0,'rows':[]};return db[_0x79c4('0x3f')][_0x79c4('0x66')]({'where':{'id':_0x4e3626[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x1118ea,null))[_0x79c4('0x21')](function(_0x348eef){if(_0x348eef){_0x2006e7[_0x79c4('0x44')]=_['keys'](db[_0x79c4('0xd5')][_0x79c4('0x40')]);_0x2006e7[_0x79c4('0x45')]=_[_0x79c4('0x46')](_0x4e3626[_0x79c4('0x45')]);_0x2006e7[_0x79c4('0x47')]=_['intersection'](_0x2006e7[_0x79c4('0x44')],_0x2006e7['query']);_0x30e2db[_0x79c4('0x49')]=_[_0x79c4('0x48')](_0x2006e7[_0x79c4('0x44')],qs[_0x79c4('0x4a')](_0x4e3626[_0x79c4('0x45')][_0x79c4('0x4a')]));_0x30e2db[_0x79c4('0x49')]=_0x30e2db[_0x79c4('0x49')][_0x79c4('0x4b')]?_0x30e2db[_0x79c4('0x49')]:_0x2006e7[_0x79c4('0x44')];if(!_0x4e3626[_0x79c4('0x45')]['hasOwnProperty'](_0x79c4('0x4d'))){_0x30e2db[_0x79c4('0x31')]=qs[_0x79c4('0x31')](_0x4e3626['query'][_0x79c4('0x31')]);_0x30e2db['offset']=qs[_0x79c4('0x30')](_0x4e3626[_0x79c4('0x45')][_0x79c4('0x30')]);}_0x30e2db[_0x79c4('0x6b')]=qs[_0x79c4('0x4e')](_0x4e3626[_0x79c4('0x45')][_0x79c4('0x4e')]);_0x30e2db['where']=qs[_0x79c4('0x47')](_['pick'](_0x4e3626[_0x79c4('0x45')],_0x2006e7[_0x79c4('0x47')]));_0x30e2db['where'][_0x79c4('0x64')]=_0x348eef['id'];if(_0x4e3626[_0x79c4('0x45')][_0x79c4('0x4f')]){_0x30e2db[_0x79c4('0x50')]=_[_0x79c4('0x51')](_0x30e2db['where'],{'$or':_[_0x79c4('0x52')](_0x30e2db[_0x79c4('0x49')],function(_0x533b31){var _0x9e38f7={};_0x9e38f7[_0x533b31]={'$like':'%'+_0x4e3626['query'][_0x79c4('0x4f')]+'%'};return _0x9e38f7;})});}_0x30e2db=_['merge']({},_0x30e2db,_0x4e3626[_0x79c4('0x53')]);return db[_0x79c4('0xd5')]['count']({'where':_0x30e2db['where']})[_0x79c4('0x21')](function(_0x320af5){_0x229be7[_0x79c4('0x54')]=_0x320af5;if(_0x4e3626[_0x79c4('0x45')][_0x79c4('0x5a')]){_0x30e2db[_0x79c4('0x55')]=[{'all':!![]}];}else{_0x30e2db['include']=[{'model':db['CmContact'],'as':_0x79c4('0x118'),'required':![]}];}return db[_0x79c4('0xd5')]['findAll'](_0x30e2db);})['then'](function(_0x4364e1){_0x229be7[_0x79c4('0x57')]=_0x4364e1;return _0x229be7;});}})[_0x79c4('0x21')](respondWithFilteredResult(_0x1118ea,_0x30e2db))[_0x79c4('0x2b')](handleError(_0x1118ea,null));};exports[_0x79c4('0x119')]=function(_0x329ad3,_0x3130fd,_0x37561a){return db['ChatWebsite'][_0x79c4('0x5f')]({'where':{'id':_0x329ad3[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x3130fd,null))[_0x79c4('0x21')](function(_0x152108){if(_0x152108){return _0x152108['addAgents'](_0x329ad3[_0x79c4('0x5c')][_0x79c4('0x68')],_[_0x79c4('0x10e')](_0x329ad3[_0x79c4('0x5c')],['ids','id'])||{})[_0x79c4('0xba')](function(_0x389006){for(var _0x22e079=0x0;_0x22e079<_0x329ad3[_0x79c4('0x5c')][_0x79c4('0x68')][_0x79c4('0x4b')];_0x22e079+=0x1){socket[_0x79c4('0x11a')](_0x79c4('0x11b'),{'UserId':_0x329ad3[_0x79c4('0x5c')][_0x79c4('0x68')][_0x22e079],'ChatWebsiteId':_0x329ad3['params']['id']});}return _0x389006;});}})[_0x79c4('0x21')](respondWithResult(_0x3130fd,null))[_0x79c4('0x2b')](handleError(_0x3130fd,null));};exports[_0x79c4('0x11c')]=function(_0x3820e5,_0x2845e4,_0x2baef0){return db[_0x79c4('0x3f')][_0x79c4('0x5f')]({'where':{'id':_0x3820e5[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x2845e4,null))['then'](function(_0x5a2d31){if(_0x5a2d31){return _0x5a2d31[_0x79c4('0x11c')](_0x3820e5['query']['ids'])[_0x79c4('0x21')](function(){if(_['isArray'](_0x3820e5[_0x79c4('0x45')][_0x79c4('0x68')])){for(var _0x141228=0x0;_0x141228<_0x3820e5[_0x79c4('0x45')][_0x79c4('0x68')][_0x79c4('0x4b')];_0x141228+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3820e5[_0x79c4('0x45')][_0x79c4('0x68')][_0x141228]),'ChatWebsiteId':Number(_0x3820e5[_0x79c4('0x59')]['id'])});}}else{socket[_0x79c4('0x11a')](_0x79c4('0x11d'),{'UserId':Number(_0x3820e5['query'][_0x79c4('0x68')]),'ChatWebsiteId':Number(_0x3820e5[_0x79c4('0x59')]['id'])});}});}})[_0x79c4('0x21')](respondWithStatusCode(_0x2845e4,null))['catch'](handleError(_0x2845e4,null));};exports[_0x79c4('0x11e')]=function(_0x2d210f,_0x228353,_0x383e71){var _0x4d3cfa={};var _0xcbe048={};var _0x32f5b0;var _0x524126;return db[_0x79c4('0x3f')][_0x79c4('0x66')]({'where':{'id':_0x2d210f[_0x79c4('0x59')]['id']}})[_0x79c4('0x21')](handleEntityNotFound(_0x228353,null))['then'](function(_0xfdbace){if(_0xfdbace){_0x32f5b0=_0xfdbace;_0xcbe048['model']=_[_0x79c4('0x46')](db[_0x79c4('0xc3')]['rawAttributes']);_0xcbe048[_0x79c4('0x45')]=_['keys'](_0x2d210f[_0x79c4('0x45')]);_0xcbe048[_0x79c4('0x47')]=_['intersection'](_0xcbe048[_0x79c4('0x44')],_0xcbe048[_0x79c4('0x45')]);_0x4d3cfa['attributes']=_[_0x79c4('0x48')](_0xcbe048[_0x79c4('0x44')],qs['fields'](_0x2d210f[_0x79c4('0x45')][_0x79c4('0x4a')]));_0x4d3cfa[_0x79c4('0x49')]=_0x4d3cfa['attributes'][_0x79c4('0x4b')]?_0x4d3cfa['attributes']:_0xcbe048['model'];_0x4d3cfa[_0x79c4('0x6b')]=qs[_0x79c4('0x4e')](_0x2d210f[_0x79c4('0x45')]['sort']);_0x4d3cfa['where']=qs[_0x79c4('0x47')](_[_0x79c4('0x6c')](_0x2d210f['query'],_0xcbe048[_0x79c4('0x47')]));if(_0x2d210f[_0x79c4('0x45')][_0x79c4('0x4f')]){_0x4d3cfa[_0x79c4('0x50')]=_[_0x79c4('0x51')](_0x4d3cfa[_0x79c4('0x50')],{'$or':_['map'](_0x4d3cfa[_0x79c4('0x49')],function(_0x12d4d4){var _0x2b53ab={};_0x2b53ab[_0x12d4d4]={'$like':'%'+_0x2d210f['query'][_0x79c4('0x4f')]+'%'};return _0x2b53ab;})});}_0x4d3cfa=_[_0x79c4('0x51')]({},_0x4d3cfa,_0x2d210f[_0x79c4('0x53')]);return _0x32f5b0[_0x79c4('0x11e')](_0x4d3cfa);}})['then'](function(_0xc0e3a4){if(_0xc0e3a4){_0x524126=_0xc0e3a4[_0x79c4('0x4b')];if(!_0x2d210f[_0x79c4('0x45')]['hasOwnProperty']('nolimit')){_0x4d3cfa['limit']=qs[_0x79c4('0x31')](_0x2d210f[_0x79c4('0x45')][_0x79c4('0x31')]);_0x4d3cfa['offset']=qs['offset'](_0x2d210f[_0x79c4('0x45')][_0x79c4('0x30')]);}return _0x32f5b0[_0x79c4('0x11e')](_0x4d3cfa);}})[_0x79c4('0x21')](function(_0x27638b){if(_0x27638b){return _0x27638b?{'count':_0x524126,'rows':_0x27638b}:null;}})[_0x79c4('0x21')](respondWithResult(_0x228353,null))[_0x79c4('0x2b')](handleError(_0x228353,null));};
\ No newline at end of file
index 38948c7..b5ce8ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe83=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','ChatWebsite'];(function(_0x2368c1,_0x1e7cc6){var _0x1f1b07=function(_0x88b66){while(--_0x88b66){_0x2368c1['push'](_0x2368c1['shift']());}};_0x1f1b07(++_0x1e7cc6);}(_0xbe83,0xee));var _0x3be8=function(_0x21ed1f,_0x569f69){_0x21ed1f=_0x21ed1f-0x0;var _0x58e2e9=_0xbe83[_0x21ed1f];return _0x58e2e9;};'use strict';var EventEmitter=require(_0x3be8('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x3be8('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3be8('0x2')](0x0);var events={'afterCreate':_0x3be8('0x3'),'afterUpdate':_0x3be8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e591e){return function(_0x3951f5,_0x782e74,_0x325c31){ChatWebsiteEvents['emit'](_0x3e591e+':'+_0x3951f5['id'],_0x3951f5);ChatWebsiteEvents[_0x3be8('0x5')](_0x3e591e,_0x3951f5);_0x325c31(null);};}for(var e in events){if(events[_0x3be8('0x6')](e)){var event=events[e];ChatWebsite[_0x3be8('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x18d6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x435391,_0x4ca10c){var _0x55c7bc=function(_0x4be0d5){while(--_0x4be0d5){_0x435391['push'](_0x435391['shift']());}};_0x55c7bc(++_0x4ca10c);}(_0x18d6,0x166));var _0x618d=function(_0x41a237,_0x2647d7){_0x41a237=_0x41a237-0x0;var _0x276a84=_0x18d6[_0x41a237];return _0x276a84;};'use strict';var EventEmitter=require(_0x618d('0x0'));var ChatWebsite=require(_0x618d('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x618d('0x2')](0x0);var events={'afterCreate':_0x618d('0x3'),'afterUpdate':_0x618d('0x4'),'afterDestroy':_0x618d('0x5')};function emitEvent(_0x5f341a){return function(_0x3151de,_0x1a7716,_0x47d0b3){ChatWebsiteEvents[_0x618d('0x6')](_0x5f341a+':'+_0x3151de['id'],_0x3151de);ChatWebsiteEvents['emit'](_0x5f341a,_0x3151de);_0x47d0b3(null);};}for(var e in events){if(events[_0x618d('0x7')](e)){var event=events[e];ChatWebsite[_0x618d('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
index 715a494..e9c0cd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x235a=['exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x2397a6,_0x70972e){var _0x59b695=function(_0x414f34){while(--_0x414f34){_0x2397a6['push'](_0x2397a6['shift']());}};_0x59b695(++_0x70972e);}(_0x235a,0x1ef));var _0xa235=function(_0x3b8dfc,_0x4a0d72){_0x3b8dfc=_0x3b8dfc-0x0;var _0xab4a3b=_0x235a[_0x3b8dfc];return _0xab4a3b;};'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
+var _0xc36d=['rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xa99c9f,_0x7765eb){var _0x531a95=function(_0x393233){while(--_0x393233){_0xa99c9f['push'](_0xa99c9f['shift']());}};_0x531a95(++_0x7765eb);}(_0xc36d,0x7d));var _0xdc36=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xc36d[_0x3b90ab];return _0x206e92;};'use strict';var _=require(_0xdc36('0x0'));var util=require(_0xdc36('0x1'));var logger=require(_0xdc36('0x2'))(_0xdc36('0x3'));var moment=require(_0xdc36('0x4'));var BPromise=require(_0xdc36('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc36('0x6'));var rimraf=require(_0xdc36('0x7'));var config=require('../../config/environment');var attributes=require(_0xdc36('0x8'));module[_0xdc36('0x9')]=function(_0x186c58,_0x11ad3b){return _0x186c58[_0xdc36('0xa')]('ChatWebsite',attributes,{'tableName':_0xdc36('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0cbb860..03ea72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1bd8d4,_0x831fc7){var _0x26a60c=function(_0x119b24){while(--_0x119b24){_0x1bd8d4['push'](_0x1bd8d4['shift']());}};_0x26a60c(++_0x831fc7);}(_0xef0f,0x168));var _0xfef0=function(_0x141cf3,_0x1ddf57){_0x141cf3=_0x141cf3-0x0;var _0x59c05e=_0xef0f[_0x141cf3];return _0x59c05e;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});config[_0xfef0('0xb')]=_[_0xfef0('0xc')](config['redis'],{'host':_0xfef0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0xb')]));require(_0xfef0('0xe'))[_0xfef0('0xf')](socket);function respondWithRpcPromise(_0x2d42dc,_0x334e74,_0x402dff){return new BPromise(function(_0xc177db,_0x4bd6f2){return client[_0xfef0('0x10')](_0x2d42dc,_0x402dff)[_0xfef0('0x11')](function(_0x410234){logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,_0xfef0('0x14'));logger['debug'](_0xfef0('0x15'),_0x334e74,_0xfef0('0x14'),JSON[_0xfef0('0x16')](_0x410234));if(_0x410234[_0xfef0('0x17')]){if(_0x410234[_0xfef0('0x17')][_0xfef0('0x18')]===0x1f4){logger[_0xfef0('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x334e74,_0x410234[_0xfef0('0x17')]['message']);return _0x4bd6f2(_0x410234['error']['message']);}logger[_0xfef0('0x17')](_0xfef0('0x13'),_0x334e74,_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);return _0xc177db(_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);}else{logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,'request\x20sent');_0xc177db(_0x410234[_0xfef0('0x1a')][_0xfef0('0x19')]);}})[_0xfef0('0x1b')](function(_0x39f9d3){logger[_0xfef0('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x334e74,_0x39f9d3);_0x4bd6f2(_0x39f9d3);});});}
\ No newline at end of file
+var _0x8e3f=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xb1666b,_0x4c269e){var _0x110710=function(_0x25b803){while(--_0x25b803){_0xb1666b['push'](_0xb1666b['shift']());}};_0x110710(++_0x4c269e);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});config[_0xf8e3('0xb')]=_['defaults'](config[_0xf8e3('0xb')],{'host':_0xf8e3('0xc'),'port':0x18eb});var socket=require(_0xf8e3('0xd'))(new Redis(config[_0xf8e3('0xb')]));require(_0xf8e3('0xe'))[_0xf8e3('0xf')](socket);function respondWithRpcPromise(_0x299a7e,_0x2a3b59,_0x2d914d){return new BPromise(function(_0x2bc3cd,_0x28f5f0){return client[_0xf8e3('0x10')](_0x299a7e,_0x2d914d)['then'](function(_0xb7d14f){logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,'request\x20sent');logger[_0xf8e3('0x13')](_0xf8e3('0x14'),_0x2a3b59,_0xf8e3('0x15'),JSON[_0xf8e3('0x16')](_0xb7d14f));if(_0xb7d14f['error']){if(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x18')]===0x1f4){logger[_0xf8e3('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f[_0xf8e3('0x17')]['message']);return _0x28f5f0(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}logger[_0xf8e3('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f['error'][_0xf8e3('0x19')]);return _0x2bc3cd(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}else{logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,_0xf8e3('0x15'));_0x2bc3cd(_0xb7d14f[_0xf8e3('0x1a')][_0xf8e3('0x19')]);}})[_0xf8e3('0x1b')](function(_0x13fb31){logger['error'](_0xf8e3('0x12'),_0x2a3b59,_0x13fb31);_0x28f5f0(_0x13fb31);});});}
\ No newline at end of file
index 9d9b5b3..4990381 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x1a3df6,_0x23cd05){var _0x13c8f6=function(_0x3ffd53){while(--_0x3ffd53){_0x1a3df6['push'](_0x1a3df6['shift']());}};_0x13c8f6(++_0x23cd05);}(_0x7a54,0x106));var _0x47a5=function(_0x222c82,_0xa510b8){_0x222c82=_0x222c82-0x0;var _0x450e8e=_0x7a54[_0x222c82];return _0x450e8e;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
+var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x4d770d,_0x5af4ce){var _0x11dc7a=function(_0x27d3f7){while(--_0x27d3f7){_0x4d770d['push'](_0x4d770d['shift']());}};_0x11dc7a(++_0x5af4ce);}(_0x5f2f,0x73));var _0xf5f2=function(_0x6af105,_0x5cbd36){_0x6af105=_0x6af105-0x0;var _0x1f1d48=_0x5f2f[_0x6af105];return _0x1f1d48;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
index 671f2f6..f281ed7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x613d=['addLogo','server/files/images/avatars/','originalname','single','addAvatar','root','addCustomerAvatar','now','addSystemAvatar','/:id/notify','/:id/offline','/:id/applications','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','file'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x613d,0x17a));var _0xd613=function(_0x5b33be,_0x20b6e7){_0x5b33be=_0x5b33be-0x0;var _0x1497f4=_0x613d[_0x5b33be];return _0x1497f4;};'use strict';var multer=require(_0xd613('0x0'));var util=require('util');var path=require(_0xd613('0x1'));var timeout=require(_0xd613('0x2'));var express=require(_0xd613('0x3'));var router=express[_0xd613('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd613('0x5'));var config=require(_0xd613('0x6'));var controller=require('./chatWebsite.controller');router[_0xd613('0x7')]('/',auth[_0xd613('0x8')](),controller[_0xd613('0x9')]);router[_0xd613('0x7')](_0xd613('0xa'),auth[_0xd613('0x8')](),controller[_0xd613('0xb')]);router[_0xd613('0x7')](_0xd613('0xc'),auth[_0xd613('0x8')](),controller[_0xd613('0xd')]);router[_0xd613('0x7')](_0xd613('0xe'),auth[_0xd613('0x8')](),controller[_0xd613('0xf')]);router[_0xd613('0x7')](_0xd613('0x10'),auth['isAuthenticated'](),controller[_0xd613('0x11')]);router[_0xd613('0x7')](_0xd613('0x12'),controller['getLogo']);router['get'](_0xd613('0x13'),controller['getAvatar']);router[_0xd613('0x7')](_0xd613('0x14'),controller['getCustomerAvatar']);router[_0xd613('0x7')](_0xd613('0x15'),controller[_0xd613('0x16')]);router['get'](_0xd613('0x17'),auth[_0xd613('0x8')](),controller[_0xd613('0x18')]);router[_0xd613('0x7')]('/:id/snippet',controller['getSnippet']);router[_0xd613('0x7')]('/:id/applications',auth[_0xd613('0x8')](),controller[_0xd613('0x19')]);router[_0xd613('0x7')](_0xd613('0x1a'),auth[_0xd613('0x8')](),controller[_0xd613('0x1b')]);router[_0xd613('0x7')](_0xd613('0x1c'),controller[_0xd613('0x1d')]);router[_0xd613('0x7')]('/:id/offline_messages',auth[_0xd613('0x8')](),controller[_0xd613('0x1e')]);router[_0xd613('0x7')](_0xd613('0x1f'),auth['isAuthenticated'](),controller[_0xd613('0x20')]);router[_0xd613('0x21')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xd613('0xe'),auth[_0xd613('0x8')](),controller[_0xd613('0x22')]);router[_0xd613('0x21')](_0xd613('0x10'),auth[_0xd613('0x8')](),controller[_0xd613('0x23')]);var upload=multer({'storage':multer[_0xd613('0x24')]({'destination':function(_0x4bd809,_0x133dd6,_0x3a8469){_0x3a8469(null,path[_0xd613('0x25')](config['root'],_0xd613('0x26')));},'filename':function(_0xece01c,_0x5ec87c,_0x305071){_0x305071(null,util[_0xd613('0x27')](_0xd613('0x28'),Date['now'](),_0x5ec87c['originalname']));}})});router['post'](_0xd613('0x12'),upload['single'](_0xd613('0x29')),controller[_0xd613('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfcad53,_0x47621b,_0xdf8a60){_0xdf8a60(null,path[_0xd613('0x25')](config['root'],_0xd613('0x2b')));},'filename':function(_0x58fdfa,_0x2841bd,_0x1a0d76){_0x1a0d76(null,util[_0xd613('0x27')](_0xd613('0x28'),Date['now'](),_0x2841bd[_0xd613('0x2c')]));}})});router[_0xd613('0x21')](_0xd613('0x13'),upload[_0xd613('0x2d')](_0xd613('0x29')),controller[_0xd613('0x2e')]);var upload=multer({'storage':multer[_0xd613('0x24')]({'destination':function(_0x21ab7c,_0x1e6aa9,_0x4d5c8e){_0x4d5c8e(null,path[_0xd613('0x25')](config[_0xd613('0x2f')],_0xd613('0x2b')));},'filename':function(_0x5bd810,_0x33e3bd,_0x2ac72c){_0x2ac72c(null,util[_0xd613('0x27')](_0xd613('0x28'),Date['now'](),_0x33e3bd[_0xd613('0x2c')]));}})});router[_0xd613('0x21')](_0xd613('0x14'),upload[_0xd613('0x2d')](_0xd613('0x29')),controller[_0xd613('0x30')]);var upload=multer({'storage':multer[_0xd613('0x24')]({'destination':function(_0x1f1510,_0x123f81,_0x31a918){_0x31a918(null,path['join'](config['root'],_0xd613('0x2b')));},'filename':function(_0x433f0d,_0x2bfb25,_0x448742){_0x448742(null,util['format'](_0xd613('0x28'),Date[_0xd613('0x31')](),_0x2bfb25['originalname']));}})});router[_0xd613('0x21')]('/:id/system_avatar',upload[_0xd613('0x2d')](_0xd613('0x29')),controller[_0xd613('0x32')]);router[_0xd613('0x21')](_0xd613('0x33'),controller['notify']);router[_0xd613('0x21')](_0xd613('0x34'),controller['offline']);router['post'](_0xd613('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xd613('0x21')](_0xd613('0x35'),auth[_0xd613('0x8')](),controller['addApplications']);router[_0xd613('0x21')](_0xd613('0x1a'),auth[_0xd613('0x8')](),controller['addProactiveActions']);router[_0xd613('0x21')](_0xd613('0x1f'),auth[_0xd613('0x8')](),controller['addAgents']);router[_0xd613('0x36')](_0xd613('0xc'),auth['isAuthenticated'](),controller[_0xd613('0x37')]);router['delete'](_0xd613('0xc'),auth[_0xd613('0x8')](),controller['destroy']);router[_0xd613('0x38')](_0xd613('0xe'),auth[_0xd613('0x8')](),controller[_0xd613('0x39')]);router[_0xd613('0x38')](_0xd613('0x10'),auth['isAuthenticated'](),controller[_0xd613('0x3a')]);router['delete'](_0xd613('0x1f'),auth[_0xd613('0x8')](),controller[_0xd613('0x3b')]);module['exports']=router;
\ No newline at end of file
+var _0x09e7=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','now','single','addLogo','join','format','originalname','addAvatar','server/files/images/avatars/','notify','/:id/offline','offline','/:id/interactions','addApplications','addProactiveActions','update','delete','/:id','destroy','removeAnswers','removeAgents','exports','multer'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x09e7,0xb6));var _0x709e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x09e7[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x709e('0x0'));var util=require(_0x709e('0x1'));var path=require(_0x709e('0x2'));var timeout=require(_0x709e('0x3'));var express=require(_0x709e('0x4'));var router=express['Router']();var auth=require(_0x709e('0x5'));var interaction=require(_0x709e('0x6'));var config=require(_0x709e('0x7'));var controller=require('./chatWebsite.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x709e('0x8')]('/describe',auth[_0x709e('0x9')](),controller[_0x709e('0xa')]);router['get']('/:id',auth[_0x709e('0x9')](),controller[_0x709e('0xb')]);router[_0x709e('0x8')](_0x709e('0xc'),auth[_0x709e('0x9')](),controller[_0x709e('0xd')]);router[_0x709e('0x8')](_0x709e('0xe'),auth[_0x709e('0x9')](),controller[_0x709e('0xf')]);router['get'](_0x709e('0x10'),controller['getLogo']);router[_0x709e('0x8')]('/:id/avatar',controller[_0x709e('0x11')]);router['get'](_0x709e('0x12'),controller['getCustomerAvatar']);router['get'](_0x709e('0x13'),controller[_0x709e('0x14')]);router[_0x709e('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x709e('0x15')]);router[_0x709e('0x8')](_0x709e('0x16'),controller[_0x709e('0x17')]);router['get'](_0x709e('0x18'),auth[_0x709e('0x9')](),controller['getApplications']);router[_0x709e('0x8')](_0x709e('0x19'),auth[_0x709e('0x9')](),controller[_0x709e('0x1a')]);router[_0x709e('0x8')](_0x709e('0x1b'),controller[_0x709e('0x1c')]);router[_0x709e('0x8')](_0x709e('0x1d'),auth[_0x709e('0x9')](),controller[_0x709e('0x1e')]);router[_0x709e('0x8')](_0x709e('0x1f'),auth[_0x709e('0x9')](),controller[_0x709e('0x20')]);router[_0x709e('0x21')]('/',auth[_0x709e('0x9')](),controller['create']);router['post'](_0x709e('0xc'),auth[_0x709e('0x9')](),controller[_0x709e('0x22')]);router[_0x709e('0x21')](_0x709e('0xe'),auth[_0x709e('0x9')](),controller[_0x709e('0x23')]);var upload=multer({'storage':multer[_0x709e('0x24')]({'destination':function(_0x2cf111,_0x426c64,_0x1be33c){_0x1be33c(null,path['join'](config[_0x709e('0x25')],_0x709e('0x26')));},'filename':function(_0x51431d,_0x4ee369,_0x4d7fc0){_0x4d7fc0(null,util['format'](_0x709e('0x27'),Date[_0x709e('0x28')](),_0x4ee369['originalname']));}})});router[_0x709e('0x21')](_0x709e('0x10'),upload[_0x709e('0x29')]('file'),controller[_0x709e('0x2a')]);var upload=multer({'storage':multer[_0x709e('0x24')]({'destination':function(_0x3cd983,_0x23f65a,_0x505dc3){_0x505dc3(null,path[_0x709e('0x2b')](config[_0x709e('0x25')],'server/files/images/avatars/'));},'filename':function(_0x4a66e7,_0x14aa0c,_0x465108){_0x465108(null,util[_0x709e('0x2c')]('%s-%s',Date['now'](),_0x14aa0c[_0x709e('0x2d')]));}})});router[_0x709e('0x21')]('/:id/avatar',upload[_0x709e('0x29')]('file'),controller[_0x709e('0x2e')]);var upload=multer({'storage':multer[_0x709e('0x24')]({'destination':function(_0x1cf64e,_0x4acd81,_0x3df21c){_0x3df21c(null,path[_0x709e('0x2b')](config['root'],_0x709e('0x2f')));},'filename':function(_0xa51a3d,_0x4a2efb,_0x265626){_0x265626(null,util[_0x709e('0x2c')](_0x709e('0x27'),Date[_0x709e('0x28')](),_0x4a2efb[_0x709e('0x2d')]));}})});router[_0x709e('0x21')](_0x709e('0x12'),upload[_0x709e('0x29')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x709e('0x24')]({'destination':function(_0x548c00,_0x2e2daf,_0x48902f){_0x48902f(null,path['join'](config[_0x709e('0x25')],'server/files/images/avatars/'));},'filename':function(_0x1f54d1,_0x381911,_0x7f33ca){_0x7f33ca(null,util[_0x709e('0x2c')](_0x709e('0x27'),Date[_0x709e('0x28')](),_0x381911[_0x709e('0x2d')]));}})});router['post'](_0x709e('0x13'),upload[_0x709e('0x29')]('file'),controller['addSystemAvatar']);router[_0x709e('0x21')]('/:id/notify',controller[_0x709e('0x30')]);router[_0x709e('0x21')](_0x709e('0x31'),controller[_0x709e('0x32')]);router[_0x709e('0x21')](_0x709e('0x33'),auth[_0x709e('0x9')](),controller['addInteraction']);router[_0x709e('0x21')](_0x709e('0x18'),auth[_0x709e('0x9')](),controller[_0x709e('0x34')]);router[_0x709e('0x21')](_0x709e('0x19'),auth[_0x709e('0x9')](),controller[_0x709e('0x35')]);router['post'](_0x709e('0x1f'),auth[_0x709e('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x709e('0x9')](),controller[_0x709e('0x36')]);router[_0x709e('0x37')](_0x709e('0x38'),auth['isAuthenticated'](),controller[_0x709e('0x39')]);router['delete'](_0x709e('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x709e('0xe'),auth[_0x709e('0x9')](),controller[_0x709e('0x3a')]);router[_0x709e('0x37')](_0x709e('0x1f'),auth[_0x709e('0x9')](),controller[_0x709e('0x3b')]);module[_0x709e('0x3c')]=router;
\ No newline at end of file
index 1522cd9..6ca34dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bfc=['Google','exports','STRING','ENUM'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0x6bfc,0x159));var _0xc6bf=function(_0x1e47cc,_0x5986f2){_0x1e47cc=_0x1e47cc-0x0;var _0x33e097=_0x6bfc[_0x1e47cc];return _0x33e097;};'use strict';var Sequelize=require('sequelize');module[_0xc6bf('0x0')]={'name':{'type':Sequelize[_0xc6bf('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc6bf('0x2')]('AmazonAWS',_0xc6bf('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xc6bf('0x1')]}};
\ No newline at end of file
+var _0xc9b0=['exports','STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc9b0,0x143));var _0x0c9b=function(_0x4b688f,_0x4e0ced){_0x4b688f=_0x4b688f-0x0;var _0xc47c6a=_0xc9b0[_0x4b688f];return _0xc47c6a;};'use strict';var Sequelize=require(_0x0c9b('0x0'));module[_0x0c9b('0x1')]={'name':{'type':Sequelize[_0x0c9b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0c9b('0x3')](_0x0c9b('0x4'),_0x0c9b('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x0c9b('0x2')]},'data2':{'type':Sequelize[_0x0c9b('0x2')]}};
\ No newline at end of file
index 49c7ba1..e8a0950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbdb=['send','index','map','CloudProvider','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','save','update','then','destroy','error','stack','name'];(function(_0x3e3658,_0x4c5b6d){var _0x460321=function(_0x1f3cfa){while(--_0x1f3cfa){_0x3e3658['push'](_0x3e3658['shift']());}};_0x460321(++_0x4c5b6d);}(_0xfbdb,0x17a));var _0xbfbd=function(_0x26997d,_0x5a64f8){_0x26997d=_0x26997d-0x0;var _0x44fe89=_0xfbdb[_0x26997d];return _0x44fe89;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbfbd('0x0'));var jsonpatch=require(_0xbfbd('0x1'));var rp=require(_0xbfbd('0x2'));var moment=require(_0xbfbd('0x3'));var BPromise=require(_0xbfbd('0x4'));var Mustache=require(_0xbfbd('0x5'));var util=require(_0xbfbd('0x6'));var path=require(_0xbfbd('0x7'));var sox=require(_0xbfbd('0x8'));var csv=require(_0xbfbd('0x9'));var ejs=require(_0xbfbd('0xa'));var fs=require('fs');var _=require(_0xbfbd('0xb'));var squel=require(_0xbfbd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbfbd('0xd'));var toCsv=require(_0xbfbd('0x9'));var querystring=require(_0xbfbd('0xe'));var Papa=require('papaparse');var Redis=require(_0xbfbd('0xf'));var authService=require(_0xbfbd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfbd('0x11'))(_0xbfbd('0x12'));var utils=require(_0xbfbd('0x13'));var config=require(_0xbfbd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x277bd2,_0x1cbbb4){_0x1cbbb4=_0x1cbbb4||0xcc;return function(_0x576923){if(_0x576923){return _0x277bd2['sendStatus'](_0x1cbbb4);}return _0x277bd2[_0xbfbd('0x15')](_0x1cbbb4)[_0xbfbd('0x16')]();};}function respondWithResult(_0x1273db,_0xeef137){_0xeef137=_0xeef137||0xc8;return function(_0x5d12d4){if(_0x5d12d4){return _0x1273db[_0xbfbd('0x15')](_0xeef137)['json'](_0x5d12d4);}};}function respondWithFilteredResult(_0x5a1867,_0x1bdb49){return function(_0x300696){if(_0x300696){var _0x22d31e=_0x300696[_0xbfbd('0x17')],_0x2c219c=_0x1bdb49[_0xbfbd('0x18')],_0x4f8b8a=_0x1bdb49[_0xbfbd('0x18')]+_0x1bdb49[_0xbfbd('0x19')],_0x2ca666;if(_0x4f8b8a>=_0x22d31e){_0x4f8b8a=_0x22d31e;_0x2ca666=0xc8;}else{_0x2ca666=0xce;}_0x5a1867[_0xbfbd('0x15')](_0x2ca666);return _0x5a1867[_0xbfbd('0x1a')](_0xbfbd('0x1b'),_0x2c219c+'-'+_0x4f8b8a+'/'+_0x22d31e)[_0xbfbd('0x1c')](_0x300696);}return null;};}function patchUpdates(_0x162d7b){return function(_0x1e4a70){try{jsonpatch['apply'](_0x1e4a70,_0x162d7b,!![]);}catch(_0x146101){return BPromise['reject'](_0x146101);}return _0x1e4a70[_0xbfbd('0x1d')]();};}function saveUpdates(_0x2b788e,_0x129f8e){return function(_0x210f8c){if(_0x210f8c){return _0x210f8c[_0xbfbd('0x1e')](_0x2b788e)[_0xbfbd('0x1f')](function(_0x1fe289){return _0x1fe289;});}return null;};}function removeEntity(_0x3c0e2a,_0x1d9d28){return function(_0x29d5ae){if(_0x29d5ae){return _0x29d5ae[_0xbfbd('0x20')]()[_0xbfbd('0x1f')](function(){_0x3c0e2a['status'](0xcc)[_0xbfbd('0x16')]();});}};}function handleEntityNotFound(_0x2e3965,_0x37d978){return function(_0x2df047){if(!_0x2df047){_0x2e3965['sendStatus'](0x194);}return _0x2df047;};}function handleError(_0x4dec0f,_0x2701f8){_0x2701f8=_0x2701f8||0x1f4;return function(_0x841ddd){logger[_0xbfbd('0x21')](_0x841ddd[_0xbfbd('0x22')]);if(_0x841ddd[_0xbfbd('0x23')]){delete _0x841ddd[_0xbfbd('0x23')];}_0x4dec0f[_0xbfbd('0x15')](_0x2701f8)[_0xbfbd('0x24')](_0x841ddd);};}exports[_0xbfbd('0x25')]=function(_0x318950,_0x2e3911){var _0x4725f1={},_0x1b52c4={},_0x1d11a4={'count':0x0,'rows':[]};var _0x4fd38b=_[_0xbfbd('0x26')](db[_0xbfbd('0x27')][_0xbfbd('0x28')],function(_0x5c7f5d){return{'name':_0x5c7f5d[_0xbfbd('0x29')],'type':_0x5c7f5d['type'][_0xbfbd('0x2a')]};});_0x1b52c4[_0xbfbd('0x2b')]=_[_0xbfbd('0x26')](_0x4fd38b,'name');_0x1b52c4['query']=_[_0xbfbd('0x2c')](_0x318950[_0xbfbd('0x2d')]);_0x1b52c4[_0xbfbd('0x2e')]=_['intersection'](_0x1b52c4[_0xbfbd('0x2b')],_0x1b52c4[_0xbfbd('0x2d')]);_0x4725f1['attributes']=_[_0xbfbd('0x2f')](_0x1b52c4[_0xbfbd('0x2b')],qs[_0xbfbd('0x30')](_0x318950[_0xbfbd('0x2d')][_0xbfbd('0x30')]));_0x4725f1[_0xbfbd('0x31')]=_0x4725f1[_0xbfbd('0x31')][_0xbfbd('0x32')]?_0x4725f1['attributes']:_0x1b52c4[_0xbfbd('0x2b')];if(!_0x318950[_0xbfbd('0x2d')][_0xbfbd('0x33')](_0xbfbd('0x34'))){_0x4725f1[_0xbfbd('0x19')]=qs['limit'](_0x318950['query']['limit']);_0x4725f1['offset']=qs[_0xbfbd('0x18')](_0x318950[_0xbfbd('0x2d')]['offset']);}_0x4725f1['order']=qs[_0xbfbd('0x35')](_0x318950[_0xbfbd('0x2d')]['sort']);_0x4725f1[_0xbfbd('0x36')]=qs['filters'](_[_0xbfbd('0x37')](_0x318950[_0xbfbd('0x2d')],_0x1b52c4[_0xbfbd('0x2e')]),_0x4fd38b);if(_0x318950[_0xbfbd('0x2d')][_0xbfbd('0x38')]){_0x4725f1['where']=_[_0xbfbd('0x39')](_0x4725f1[_0xbfbd('0x36')],{'$or':_[_0xbfbd('0x26')](_0x4fd38b,function(_0x3d816d){if(_0x3d816d['type']!==_0xbfbd('0x3a')){var _0x58c083={};_0x58c083[_0x3d816d['name']]={'$like':'%'+_0x318950[_0xbfbd('0x2d')][_0xbfbd('0x38')]+'%'};return _0x58c083;}})});}_0x4725f1=_[_0xbfbd('0x39')]({},_0x4725f1,_0x318950['options']);var _0x1ebb40={'where':_0x4725f1[_0xbfbd('0x36')]};return db[_0xbfbd('0x27')][_0xbfbd('0x17')](_0x1ebb40)[_0xbfbd('0x1f')](function(_0x43e27a){_0x1d11a4[_0xbfbd('0x17')]=_0x43e27a;if(_0x318950['query'][_0xbfbd('0x3b')]){_0x4725f1[_0xbfbd('0x3c')]=[{'all':!![]}];}return db[_0xbfbd('0x27')]['findAll'](_0x4725f1);})[_0xbfbd('0x1f')](function(_0x2df2f4){_0x1d11a4[_0xbfbd('0x3d')]=_0x2df2f4;return _0x1d11a4;})[_0xbfbd('0x1f')](respondWithFilteredResult(_0x2e3911,_0x4725f1))[_0xbfbd('0x3e')](handleError(_0x2e3911,null));};exports[_0xbfbd('0x3f')]=function(_0x5714e5,_0x5e5462){var _0x159230={'raw':!![],'where':{'id':_0x5714e5[_0xbfbd('0x40')]['id']}},_0x14c573={};_0x14c573[_0xbfbd('0x2b')]=_[_0xbfbd('0x2c')](db[_0xbfbd('0x27')]['rawAttributes']);_0x14c573[_0xbfbd('0x2d')]=_[_0xbfbd('0x2c')](_0x5714e5[_0xbfbd('0x2d')]);_0x14c573[_0xbfbd('0x2e')]=_['intersection'](_0x14c573['model'],_0x14c573[_0xbfbd('0x2d')]);_0x159230[_0xbfbd('0x31')]=_['intersection'](_0x14c573[_0xbfbd('0x2b')],qs[_0xbfbd('0x30')](_0x5714e5[_0xbfbd('0x2d')][_0xbfbd('0x30')]));_0x159230[_0xbfbd('0x31')]=_0x159230[_0xbfbd('0x31')][_0xbfbd('0x32')]?_0x159230[_0xbfbd('0x31')]:_0x14c573[_0xbfbd('0x2b')];if(_0x5714e5[_0xbfbd('0x2d')][_0xbfbd('0x3b')]){_0x159230[_0xbfbd('0x3c')]=[{'all':!![]}];}_0x159230=_[_0xbfbd('0x39')]({},_0x159230,_0x5714e5[_0xbfbd('0x41')]);return db[_0xbfbd('0x27')][_0xbfbd('0x42')](_0x159230)[_0xbfbd('0x1f')](handleEntityNotFound(_0x5e5462,null))[_0xbfbd('0x1f')](respondWithResult(_0x5e5462,null))[_0xbfbd('0x3e')](handleError(_0x5e5462,null));};exports['create']=function(_0x31867d,_0x4dd2bd){return db[_0xbfbd('0x27')][_0xbfbd('0x43')](_0x31867d[_0xbfbd('0x44')],{})[_0xbfbd('0x1f')](respondWithResult(_0x4dd2bd,0xc9))[_0xbfbd('0x3e')](handleError(_0x4dd2bd,null));};exports[_0xbfbd('0x1e')]=function(_0x2f85b3,_0x2acdb2){if(_0x2f85b3[_0xbfbd('0x44')]['id']){delete _0x2f85b3[_0xbfbd('0x44')]['id'];}return db[_0xbfbd('0x27')][_0xbfbd('0x42')]({'where':{'id':_0x2f85b3[_0xbfbd('0x40')]['id']}})[_0xbfbd('0x1f')](handleEntityNotFound(_0x2acdb2,null))[_0xbfbd('0x1f')](saveUpdates(_0x2f85b3['body'],null))['then'](respondWithResult(_0x2acdb2,null))[_0xbfbd('0x3e')](handleError(_0x2acdb2,null));};exports[_0xbfbd('0x20')]=function(_0xeb092a,_0x507f5c){return db[_0xbfbd('0x27')][_0xbfbd('0x42')]({'where':{'id':_0xeb092a[_0xbfbd('0x40')]['id']}})[_0xbfbd('0x1f')](handleEntityNotFound(_0x507f5c,null))['then'](removeEntity(_0x507f5c,null))[_0xbfbd('0x3e')](handleError(_0x507f5c,null));};
\ No newline at end of file
+var _0x495c=['moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise'];(function(_0x2e38e6,_0x459fc2){var _0x1d2089=function(_0x12ffc2){while(--_0x12ffc2){_0x2e38e6['push'](_0x2e38e6['shift']());}};_0x1d2089(++_0x459fc2);}(_0x495c,0x8c));var _0xc495=function(_0xd7efd6,_0x26fffb){_0xd7efd6=_0xd7efd6-0x0;var _0x2a9a1e=_0x495c[_0xd7efd6];return _0x2a9a1e;};'use strict';var pdf=require(_0xc495('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc495('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc495('0x2'));var rp=require(_0xc495('0x3'));var moment=require(_0xc495('0x4'));var BPromise=require(_0xc495('0x5'));var Mustache=require(_0xc495('0x6'));var util=require(_0xc495('0x7'));var path=require('path');var sox=require(_0xc495('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc495('0x9'));var squel=require('squel');var crypto=require(_0xc495('0xa'));var jsforce=require(_0xc495('0xb'));var deskjs=require(_0xc495('0xc'));var toCsv=require(_0xc495('0xd'));var querystring=require(_0xc495('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc495('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc495('0x10'));var logger=require(_0xc495('0x11'))(_0xc495('0x12'));var utils=require(_0xc495('0x13'));var config=require(_0xc495('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fab40,_0x4434ac){_0x4434ac=_0x4434ac||0xcc;return function(_0x30aa86){if(_0x30aa86){return _0x4fab40['sendStatus'](_0x4434ac);}return _0x4fab40[_0xc495('0x15')](_0x4434ac)['end']();};}function respondWithResult(_0x1ea3ff,_0x14ad4b){_0x14ad4b=_0x14ad4b||0xc8;return function(_0x577764){if(_0x577764){return _0x1ea3ff[_0xc495('0x15')](_0x14ad4b)[_0xc495('0x16')](_0x577764);}};}function respondWithFilteredResult(_0xf6b710,_0x39c992){return function(_0x5529e3){if(_0x5529e3){var _0x337a52=_0x5529e3[_0xc495('0x17')],_0x246359=_0x39c992[_0xc495('0x18')],_0x545686=_0x39c992[_0xc495('0x18')]+_0x39c992[_0xc495('0x19')],_0x439117;if(_0x545686>=_0x337a52){_0x545686=_0x337a52;_0x439117=0xc8;}else{_0x439117=0xce;}_0xf6b710[_0xc495('0x15')](_0x439117);return _0xf6b710[_0xc495('0x1a')](_0xc495('0x1b'),_0x246359+'-'+_0x545686+'/'+_0x337a52)[_0xc495('0x16')](_0x5529e3);}return null;};}function patchUpdates(_0x18492e){return function(_0x1ec0d9){try{jsonpatch[_0xc495('0x1c')](_0x1ec0d9,_0x18492e,!![]);}catch(_0x2811dd){return BPromise[_0xc495('0x1d')](_0x2811dd);}return _0x1ec0d9[_0xc495('0x1e')]();};}function saveUpdates(_0x1eb594,_0x1bb5ca){return function(_0x2366c3){if(_0x2366c3){return _0x2366c3[_0xc495('0x1f')](_0x1eb594)[_0xc495('0x20')](function(_0x2b10c1){return _0x2b10c1;});}return null;};}function removeEntity(_0x23aed2,_0x32d1ab){return function(_0x25fe03){if(_0x25fe03){return _0x25fe03[_0xc495('0x21')]()[_0xc495('0x20')](function(){_0x23aed2[_0xc495('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc957,_0x351184){return function(_0x441817){if(!_0x441817){_0x3cc957[_0xc495('0x22')](0x194);}return _0x441817;};}function handleError(_0x5a9dea,_0x52f5dd){_0x52f5dd=_0x52f5dd||0x1f4;return function(_0x384e8c){logger[_0xc495('0x23')](_0x384e8c[_0xc495('0x24')]);if(_0x384e8c[_0xc495('0x25')]){delete _0x384e8c['name'];}_0x5a9dea['status'](_0x52f5dd)['send'](_0x384e8c);};}exports[_0xc495('0x26')]=function(_0x40c30d,_0x5dd94f){var _0xfdc478={},_0x549ee7={},_0x100002={'count':0x0,'rows':[]};var _0x27e8aa=_[_0xc495('0x27')](db[_0xc495('0x28')][_0xc495('0x29')],function(_0x6f5d40){return{'name':_0x6f5d40[_0xc495('0x2a')],'type':_0x6f5d40[_0xc495('0x2b')][_0xc495('0x2c')]};});_0x549ee7['model']=_[_0xc495('0x27')](_0x27e8aa,_0xc495('0x25'));_0x549ee7[_0xc495('0x2d')]=_[_0xc495('0x2e')](_0x40c30d['query']);_0x549ee7['filters']=_['intersection'](_0x549ee7[_0xc495('0x2f')],_0x549ee7[_0xc495('0x2d')]);_0xfdc478[_0xc495('0x30')]=_[_0xc495('0x31')](_0x549ee7[_0xc495('0x2f')],qs[_0xc495('0x32')](_0x40c30d[_0xc495('0x2d')][_0xc495('0x32')]));_0xfdc478[_0xc495('0x30')]=_0xfdc478[_0xc495('0x30')][_0xc495('0x33')]?_0xfdc478[_0xc495('0x30')]:_0x549ee7['model'];if(!_0x40c30d['query']['hasOwnProperty'](_0xc495('0x34'))){_0xfdc478[_0xc495('0x19')]=qs[_0xc495('0x19')](_0x40c30d[_0xc495('0x2d')]['limit']);_0xfdc478[_0xc495('0x18')]=qs[_0xc495('0x18')](_0x40c30d[_0xc495('0x2d')][_0xc495('0x18')]);}_0xfdc478[_0xc495('0x35')]=qs[_0xc495('0x36')](_0x40c30d[_0xc495('0x2d')]['sort']);_0xfdc478[_0xc495('0x37')]=qs[_0xc495('0x38')](_[_0xc495('0x39')](_0x40c30d['query'],_0x549ee7['filters']),_0x27e8aa);if(_0x40c30d[_0xc495('0x2d')][_0xc495('0x3a')]){_0xfdc478[_0xc495('0x37')]=_[_0xc495('0x3b')](_0xfdc478[_0xc495('0x37')],{'$or':_[_0xc495('0x27')](_0x27e8aa,function(_0xfcff3b){if(_0xfcff3b['type']!==_0xc495('0x3c')){var _0x5f0c00={};_0x5f0c00[_0xfcff3b[_0xc495('0x25')]]={'$like':'%'+_0x40c30d[_0xc495('0x2d')][_0xc495('0x3a')]+'%'};return _0x5f0c00;}})});}_0xfdc478=_['merge']({},_0xfdc478,_0x40c30d[_0xc495('0x3d')]);var _0x52d98f={'where':_0xfdc478[_0xc495('0x37')]};return db[_0xc495('0x28')][_0xc495('0x17')](_0x52d98f)[_0xc495('0x20')](function(_0x56972a){_0x100002[_0xc495('0x17')]=_0x56972a;if(_0x40c30d[_0xc495('0x2d')]['includeAll']){_0xfdc478[_0xc495('0x3e')]=[{'all':!![]}];}return db[_0xc495('0x28')][_0xc495('0x3f')](_0xfdc478);})[_0xc495('0x20')](function(_0x4e67d3){_0x100002[_0xc495('0x40')]=_0x4e67d3;return _0x100002;})[_0xc495('0x20')](respondWithFilteredResult(_0x5dd94f,_0xfdc478))[_0xc495('0x41')](handleError(_0x5dd94f,null));};exports[_0xc495('0x42')]=function(_0x154a04,_0xb81735){var _0xefd983={'raw':!![],'where':{'id':_0x154a04[_0xc495('0x43')]['id']}},_0x10b553={};_0x10b553[_0xc495('0x2f')]=_[_0xc495('0x2e')](db[_0xc495('0x28')]['rawAttributes']);_0x10b553[_0xc495('0x2d')]=_['keys'](_0x154a04[_0xc495('0x2d')]);_0x10b553[_0xc495('0x38')]=_[_0xc495('0x31')](_0x10b553[_0xc495('0x2f')],_0x10b553[_0xc495('0x2d')]);_0xefd983[_0xc495('0x30')]=_[_0xc495('0x31')](_0x10b553[_0xc495('0x2f')],qs[_0xc495('0x32')](_0x154a04['query']['fields']));_0xefd983[_0xc495('0x30')]=_0xefd983['attributes'][_0xc495('0x33')]?_0xefd983[_0xc495('0x30')]:_0x10b553[_0xc495('0x2f')];if(_0x154a04[_0xc495('0x2d')][_0xc495('0x44')]){_0xefd983[_0xc495('0x3e')]=[{'all':!![]}];}_0xefd983=_[_0xc495('0x3b')]({},_0xefd983,_0x154a04[_0xc495('0x3d')]);return db[_0xc495('0x28')][_0xc495('0x45')](_0xefd983)[_0xc495('0x20')](handleEntityNotFound(_0xb81735,null))[_0xc495('0x20')](respondWithResult(_0xb81735,null))[_0xc495('0x41')](handleError(_0xb81735,null));};exports[_0xc495('0x46')]=function(_0x159292,_0x5153a4){return db[_0xc495('0x28')][_0xc495('0x46')](_0x159292[_0xc495('0x47')],{})[_0xc495('0x20')](respondWithResult(_0x5153a4,0xc9))['catch'](handleError(_0x5153a4,null));};exports[_0xc495('0x1f')]=function(_0x3280f8,_0x56960f){if(_0x3280f8['body']['id']){delete _0x3280f8['body']['id'];}return db[_0xc495('0x28')][_0xc495('0x45')]({'where':{'id':_0x3280f8[_0xc495('0x43')]['id']}})[_0xc495('0x20')](handleEntityNotFound(_0x56960f,null))[_0xc495('0x20')](saveUpdates(_0x3280f8[_0xc495('0x47')],null))[_0xc495('0x20')](respondWithResult(_0x56960f,null))[_0xc495('0x41')](handleError(_0x56960f,null));};exports[_0xc495('0x21')]=function(_0x543d6b,_0x195d89){return db['CloudProvider']['find']({'where':{'id':_0x543d6b[_0xc495('0x43')]['id']}})['then'](handleEntityNotFound(_0x195d89,null))[_0xc495('0x20')](removeEntity(_0x195d89,null))['catch'](handleError(_0x195d89,null));};
\ No newline at end of file
index baabb1d..fa6eab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98f3=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x3301cb,_0x3eeaf0){var _0x5b1a4a=function(_0x350598){while(--_0x350598){_0x3301cb['push'](_0x3301cb['shift']());}};_0x5b1a4a(++_0x3eeaf0);}(_0x98f3,0xc2));var _0x398f=function(_0x4bb691,_0x37679a){_0x4bb691=_0x4bb691-0x0;var _0x588b53=_0x98f3[_0x4bb691];return _0x588b53;};'use strict';var _=require(_0x398f('0x0'));var util=require(_0x398f('0x1'));var logger=require(_0x398f('0x2'))(_0x398f('0x3'));var moment=require('moment');var BPromise=require(_0x398f('0x4'));var rp=require(_0x398f('0x5'));var fs=require('fs');var path=require(_0x398f('0x6'));var rimraf=require(_0x398f('0x7'));var config=require(_0x398f('0x8'));var attributes=require(_0x398f('0x9'));module[_0x398f('0xa')]=function(_0x33f0e8,_0x93f3a2){return _0x33f0e8[_0x398f('0xb')](_0x398f('0xc'),attributes,{'tableName':_0x398f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d3c=['bluebird','request-promise','path','rimraf','../../config/environment','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x56418c,_0xd90668){var _0x1c838d=function(_0x222bb8){while(--_0x222bb8){_0x56418c['push'](_0x56418c['shift']());}};_0x1c838d(++_0xd90668);}(_0x2d3c,0x128));var _0xc2d3=function(_0x4cc2d5,_0x397ddf){_0x4cc2d5=_0x4cc2d5-0x0;var _0x3c095e=_0x2d3c[_0x4cc2d5];return _0x3c095e;};'use strict';var _=require(_0xc2d3('0x0'));var util=require(_0xc2d3('0x1'));var logger=require(_0xc2d3('0x2'))(_0xc2d3('0x3'));var moment=require('moment');var BPromise=require(_0xc2d3('0x4'));var rp=require(_0xc2d3('0x5'));var fs=require('fs');var path=require(_0xc2d3('0x6'));var rimraf=require(_0xc2d3('0x7'));var config=require(_0xc2d3('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xc2d3('0x9')]=function(_0x3363b9,_0x1b6601){return _0x3363b9['define'](_0xc2d3('0xa'),attributes,{'tableName':_0xc2d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4573953..7be3e12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb2=['http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x383904,_0x1d302){var _0x7615df=function(_0x11a66e){while(--_0x11a66e){_0x383904['push'](_0x383904['shift']());}};_0x7615df(++_0x1d302);}(_0x6cb2,0x114));var _0x26cb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6cb2[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x26cb('0x0'));var util=require(_0x26cb('0x1'));var moment=require(_0x26cb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26cb('0x3'));var db=require(_0x26cb('0x4'))['db'];var utils=require(_0x26cb('0x5'));var logger=require(_0x26cb('0x6'))(_0x26cb('0x7'));var config=require(_0x26cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x26cb('0x9')][_0x26cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51de73,_0x4123ce,_0x3593a5){return new BPromise(function(_0x34de7f,_0x3f07c0){return client[_0x26cb('0xb')](_0x51de73,_0x3593a5)[_0x26cb('0xc')](function(_0x3ada10){logger['info'](_0x26cb('0xd'),_0x4123ce,_0x26cb('0xe'));logger['debug'](_0x26cb('0xf'),_0x4123ce,_0x26cb('0xe'),JSON[_0x26cb('0x10')](_0x3ada10));if(_0x3ada10[_0x26cb('0x11')]){if(_0x3ada10[_0x26cb('0x11')][_0x26cb('0x12')]===0x1f4){logger['error'](_0x26cb('0xd'),_0x4123ce,_0x3ada10['error']['message']);return _0x3f07c0(_0x3ada10[_0x26cb('0x11')][_0x26cb('0x13')]);}logger['error'](_0x26cb('0xd'),_0x4123ce,_0x3ada10[_0x26cb('0x11')]['message']);return _0x34de7f(_0x3ada10['error'][_0x26cb('0x13')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x4123ce,_0x26cb('0xe'));_0x34de7f(_0x3ada10[_0x26cb('0x14')][_0x26cb('0x13')]);}})[_0x26cb('0x15')](function(_0x2d9e24){logger[_0x26cb('0x11')]('CloudProvider,\x20%s,\x20%s',_0x4123ce,_0x2d9e24);_0x3f07c0(_0x2d9e24);});});}
\ No newline at end of file
+var _0x7956=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x595e64,_0x5d2189){var _0x5c13bd=function(_0x486b90){while(--_0x486b90){_0x595e64['push'](_0x595e64['shift']());}};_0x5c13bd(++_0x5d2189);}(_0x7956,0x158));var _0x6795=function(_0x34d19b,_0x11f89a){_0x34d19b=_0x34d19b-0x0;var _0x2595f8=_0x7956[_0x34d19b];return _0x2595f8;};'use strict';var _=require(_0x6795('0x0'));var util=require(_0x6795('0x1'));var moment=require(_0x6795('0x2'));var BPromise=require(_0x6795('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6795('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6795('0x5'));var logger=require(_0x6795('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6795('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b65a2,_0x280877,_0x42c335){return new BPromise(function(_0x3d0848,_0xed3d50){return client['request'](_0x4b65a2,_0x42c335)[_0x6795('0x8')](function(_0x2b54e8){logger[_0x6795('0x9')](_0x6795('0xa'),_0x280877,_0x6795('0xb'));logger[_0x6795('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x280877,_0x6795('0xb'),JSON[_0x6795('0xd')](_0x2b54e8));if(_0x2b54e8['error']){if(_0x2b54e8['error']['code']===0x1f4){logger[_0x6795('0xe')]('CloudProvider,\x20%s,\x20%s',_0x280877,_0x2b54e8['error'][_0x6795('0xf')]);return _0xed3d50(_0x2b54e8[_0x6795('0xe')][_0x6795('0xf')]);}logger['error'](_0x6795('0xa'),_0x280877,_0x2b54e8[_0x6795('0xe')][_0x6795('0xf')]);return _0x3d0848(_0x2b54e8[_0x6795('0xe')][_0x6795('0xf')]);}else{logger[_0x6795('0x9')](_0x6795('0xa'),_0x280877,'request\x20sent');_0x3d0848(_0x2b54e8[_0x6795('0x10')][_0x6795('0xf')]);}})[_0x6795('0x11')](function(_0xfeccb6){logger[_0x6795('0xe')](_0x6795('0xa'),_0x280877,_0xfeccb6);_0xed3d50(_0xfeccb6);});});}
\ No newline at end of file
index e07542e..3caddb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6cc=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x17ee0d,_0x4f5e32){var _0x39278f=function(_0x55069e){while(--_0x55069e){_0x17ee0d['push'](_0x17ee0d['shift']());}};_0x39278f(++_0x4f5e32);}(_0xc6cc,0x1be));var _0xcc6c=function(_0x1c810f,_0x1c540e){_0x1c810f=_0x1c810f-0x0;var _0x37415f=_0xc6cc[_0x1c810f];return _0x37415f;};'use strict';var multer=require(_0xcc6c('0x0'));var util=require(_0xcc6c('0x1'));var path=require(_0xcc6c('0x2'));var timeout=require(_0xcc6c('0x3'));var express=require(_0xcc6c('0x4'));var router=express[_0xcc6c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xcc6c('0x6'));var config=require(_0xcc6c('0x7'));var controller=require('./cloudProvider.controller');router[_0xcc6c('0x8')]('/',auth[_0xcc6c('0x9')](),controller['index']);router[_0xcc6c('0x8')](_0xcc6c('0xa'),auth[_0xcc6c('0x9')](),controller[_0xcc6c('0xb')]);router[_0xcc6c('0xc')]('/',auth[_0xcc6c('0x9')](),controller[_0xcc6c('0xd')]);router[_0xcc6c('0xe')]('/:id',auth[_0xcc6c('0x9')](),controller[_0xcc6c('0xf')]);router[_0xcc6c('0x10')](_0xcc6c('0xa'),auth[_0xcc6c('0x9')](),controller[_0xcc6c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x25cd=['connect-timeout','express','Router','../../components/interaction/service','./cloudProvider.controller','get','isAuthenticated','/:id','post','create','update','delete','destroy','exports','util','path'];(function(_0x13842e,_0x391709){var _0x240941=function(_0x50bc16){while(--_0x50bc16){_0x13842e['push'](_0x13842e['shift']());}};_0x240941(++_0x391709);}(_0x25cd,0x11e));var _0xd25c=function(_0x149a41,_0x3cbb44){_0x149a41=_0x149a41-0x0;var _0x10132c=_0x25cd[_0x149a41];return _0x10132c;};'use strict';var multer=require('multer');var util=require(_0xd25c('0x0'));var path=require(_0xd25c('0x1'));var timeout=require(_0xd25c('0x2'));var express=require(_0xd25c('0x3'));var router=express[_0xd25c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd25c('0x5'));var config=require('../../config/environment');var controller=require(_0xd25c('0x6'));router[_0xd25c('0x7')]('/',auth[_0xd25c('0x8')](),controller['index']);router['get'](_0xd25c('0x9'),auth[_0xd25c('0x8')](),controller['show']);router[_0xd25c('0xa')]('/',auth[_0xd25c('0x8')](),controller[_0xd25c('0xb')]);router['put'](_0xd25c('0x9'),auth[_0xd25c('0x8')](),controller[_0xd25c('0xc')]);router[_0xd25c('0xd')](_0xd25c('0x9'),auth[_0xd25c('0x8')](),controller[_0xd25c('0xe')]);module[_0xd25c('0xf')]=router;
\ No newline at end of file
index 9af1ec0..bc8fa90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb59f=['name','sequelize','STRING'];(function(_0x5a1442,_0x57657d){var _0x2db07b=function(_0x5184de){while(--_0x5184de){_0x5a1442['push'](_0x5a1442['shift']());}};_0x2db07b(++_0x57657d);}(_0xb59f,0x10f));var _0xfb59=function(_0x317f54,_0x5c1f2f){_0x317f54=_0x317f54-0x0;var _0x2c2117=_0xb59f[_0x317f54];return _0x2c2117;};'use strict';var Sequelize=require(_0xfb59('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb59('0x1')],'unique':_0xfb59('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfb59('0x1')]},'companyId':{'type':Sequelize[_0xfb59('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xfb59('0x1')]},'fax':{'type':Sequelize[_0xfb59('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xfb59('0x1')]},'city':{'type':Sequelize[_0xfb59('0x1')]},'country':{'type':Sequelize[_0xfb59('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xfb59('0x1')]},'sPostalCode':{'type':Sequelize[_0xfb59('0x1')]},'sCity':{'type':Sequelize[_0xfb59('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfb59('0x1')]}};
\ No newline at end of file
+var _0x5f81=['sequelize','exports','STRING','name'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x5f81,0x124));var _0x15f8=function(_0x551643,_0x1eb990){_0x551643=_0x551643-0x0;var _0x157d86=_0x5f81[_0x551643];return _0x157d86;};'use strict';var Sequelize=require(_0x15f8('0x0'));module[_0x15f8('0x1')]={'name':{'type':Sequelize[_0x15f8('0x2')],'unique':_0x15f8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x15f8('0x2')]},'companyId':{'type':Sequelize[_0x15f8('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x15f8('0x2')]},'fax':{'type':Sequelize[_0x15f8('0x2')]},'type':{'type':Sequelize[_0x15f8('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x15f8('0x2')]},'city':{'type':Sequelize[_0x15f8('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x15f8('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x15f8('0x2')]},'sCountry':{'type':Sequelize[_0x15f8('0x2')]},'description':{'type':Sequelize[_0x15f8('0x2')]}};
\ No newline at end of file
index 2a35c1d..8724a6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a79=['fast-json-patch','bluebird','path','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','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','addContacts','ids','getContacts','findOne','CmContact','html-pdf','eml-format','zip-dir'];(function(_0x10b23,_0x5629f1){var _0x1f09c3=function(_0x3238af){while(--_0x3238af){_0x10b23['push'](_0x10b23['shift']());}};_0x1f09c3(++_0x5629f1);}(_0x0a79,0x1a6));var _0x90a7=function(_0x281871,_0x5736e4){_0x281871=_0x281871-0x0;var _0x8250cb=_0x0a79[_0x281871];return _0x8250cb;};'use strict';var pdf=require(_0x90a7('0x0'));var emlformat=require(_0x90a7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x90a7('0x2'));var jsonpatch=require(_0x90a7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x90a7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x90a7('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x90a7('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x90a7('0x7'));var crypto=require('crypto');var jsforce=require(_0x90a7('0x8'));var deskjs=require(_0x90a7('0x9'));var toCsv=require(_0x90a7('0xa'));var querystring=require(_0x90a7('0xb'));var Papa=require(_0x90a7('0xc'));var Redis=require('ioredis');var authService=require(_0x90a7('0xd'));var qs=require(_0x90a7('0xe'));var as=require(_0x90a7('0xf'));var hardwareService=require(_0x90a7('0x10'));var logger=require(_0x90a7('0x11'))(_0x90a7('0x12'));var utils=require('../../config/utils');var config=require(_0x90a7('0x13'));var db=require(_0x90a7('0x14'))['db'];function respondWithStatusCode(_0x25e035,_0xcc5e08){_0xcc5e08=_0xcc5e08||0xcc;return function(_0x409d03){if(_0x409d03){return _0x25e035[_0x90a7('0x15')](_0xcc5e08);}return _0x25e035['status'](_0xcc5e08)[_0x90a7('0x16')]();};}function respondWithResult(_0x1ce06c,_0x142859){_0x142859=_0x142859||0xc8;return function(_0x368758){if(_0x368758){return _0x1ce06c[_0x90a7('0x17')](_0x142859)[_0x90a7('0x18')](_0x368758);}};}function respondWithFilteredResult(_0x3273a4,_0xf10e5f){return function(_0x4f391c){if(_0x4f391c){var _0x3fc1c0=_0x4f391c[_0x90a7('0x19')],_0x5f54be=_0xf10e5f[_0x90a7('0x1a')],_0x31e6e4=_0xf10e5f[_0x90a7('0x1a')]+_0xf10e5f[_0x90a7('0x1b')],_0x1c02a7;if(_0x31e6e4>=_0x3fc1c0){_0x31e6e4=_0x3fc1c0;_0x1c02a7=0xc8;}else{_0x1c02a7=0xce;}_0x3273a4[_0x90a7('0x17')](_0x1c02a7);return _0x3273a4[_0x90a7('0x1c')](_0x90a7('0x1d'),_0x5f54be+'-'+_0x31e6e4+'/'+_0x3fc1c0)[_0x90a7('0x18')](_0x4f391c);}return null;};}function patchUpdates(_0x18fdc3){return function(_0x393782){try{jsonpatch[_0x90a7('0x1e')](_0x393782,_0x18fdc3,!![]);}catch(_0x57e9dc){return BPromise['reject'](_0x57e9dc);}return _0x393782[_0x90a7('0x1f')]();};}function saveUpdates(_0x561f74,_0x3c27a7){return function(_0x62dec3){if(_0x62dec3){return _0x62dec3[_0x90a7('0x20')](_0x561f74)[_0x90a7('0x21')](function(_0x48a165){return _0x48a165;});}return null;};}function removeEntity(_0x241d8c,_0x504e83){return function(_0x27d1dd){if(_0x27d1dd){return _0x27d1dd[_0x90a7('0x22')]()[_0x90a7('0x21')](function(){var _0x323c6b=_0x27d1dd[_0x90a7('0x23')]({'plain':!![]});var _0x23dd36=_0x90a7('0x24');return db[_0x90a7('0x25')][_0x90a7('0x22')]({'where':{'type':_0x23dd36,'resourceId':_0x323c6b['id']}})[_0x90a7('0x21')](function(){return _0x27d1dd;});})[_0x90a7('0x21')](function(){_0x241d8c[_0x90a7('0x17')](0xcc)[_0x90a7('0x16')]();});}};}function handleEntityNotFound(_0x6f96af,_0x1fe1a4){return function(_0x47898d){if(!_0x47898d){_0x6f96af[_0x90a7('0x15')](0x194);}return _0x47898d;};}function handleError(_0x5ebf59,_0x1b5f11){_0x1b5f11=_0x1b5f11||0x1f4;return function(_0x2d2f4e){logger[_0x90a7('0x26')](_0x2d2f4e[_0x90a7('0x27')]);if(_0x2d2f4e[_0x90a7('0x28')]){delete _0x2d2f4e[_0x90a7('0x28')];}_0x5ebf59['status'](_0x1b5f11)['send'](_0x2d2f4e);};}exports[_0x90a7('0x29')]=function(_0x2d70fa,_0x28ce28){var _0x1136f7={},_0x4b0c72={},_0xa7b767={'count':0x0,'rows':[]};return db[_0x90a7('0x2a')][_0x90a7('0x2b')]()[_0x90a7('0x21')](function(_0x1fdf35){_0x4b0c72[_0x90a7('0x2c')]=_[_0x90a7('0x2d')](_0x1fdf35);_0x4b0c72[_0x90a7('0x2e')]=_['keys'](_0x2d70fa['query']);_0x4b0c72[_0x90a7('0x2f')]=_[_0x90a7('0x30')](_0x4b0c72[_0x90a7('0x2c')],_0x4b0c72[_0x90a7('0x2e')]);_0x1136f7[_0x90a7('0x31')]=_[_0x90a7('0x30')](_0x4b0c72[_0x90a7('0x2c')],qs[_0x90a7('0x32')](_0x2d70fa[_0x90a7('0x2e')][_0x90a7('0x32')]));_0x1136f7[_0x90a7('0x31')]=_0x1136f7[_0x90a7('0x31')][_0x90a7('0x33')]?_0x1136f7[_0x90a7('0x31')]:_0x4b0c72[_0x90a7('0x2c')];if(!_0x2d70fa['query'][_0x90a7('0x34')](_0x90a7('0x35'))){_0x1136f7[_0x90a7('0x1b')]=qs['limit'](_0x2d70fa[_0x90a7('0x2e')][_0x90a7('0x1b')]);_0x1136f7[_0x90a7('0x1a')]=qs[_0x90a7('0x1a')](_0x2d70fa[_0x90a7('0x2e')][_0x90a7('0x1a')]);}_0x1136f7[_0x90a7('0x36')]=qs['sort'](_0x2d70fa[_0x90a7('0x2e')][_0x90a7('0x37')]);_0x1136f7[_0x90a7('0x38')]=qs[_0x90a7('0x2f')](_[_0x90a7('0x39')](_0x2d70fa[_0x90a7('0x2e')],_0x4b0c72[_0x90a7('0x2f')]),_0x1fdf35);if(_0x2d70fa[_0x90a7('0x2e')][_0x90a7('0x3a')]){_0x1136f7[_0x90a7('0x38')]=_[_0x90a7('0x3b')](_0x1136f7[_0x90a7('0x38')],{'$or':_[_0x90a7('0x3c')](_0x1136f7[_0x90a7('0x31')],function(_0x5713d4){var _0x5e34d2={};_0x5e34d2[_0x5713d4]={'$like':'%'+_0x2d70fa[_0x90a7('0x2e')][_0x90a7('0x3a')]+'%'};return _0x5e34d2;})});}_0x1136f7=_[_0x90a7('0x3b')]({},_0x1136f7,_0x2d70fa[_0x90a7('0x3d')]);var _0x45abf5={'where':_0x1136f7[_0x90a7('0x38')]};return db[_0x90a7('0x2a')][_0x90a7('0x19')](_0x45abf5)['then'](function(_0x50072b){_0xa7b767[_0x90a7('0x19')]=_0x50072b;if(_0x2d70fa[_0x90a7('0x2e')][_0x90a7('0x3e')]){_0x1136f7[_0x90a7('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0x90a7('0x40')](_0x1136f7);})[_0x90a7('0x21')](function(_0x130cd2){_0xa7b767[_0x90a7('0x41')]=_0x130cd2;return _0xa7b767;})['then'](respondWithFilteredResult(_0x28ce28,_0x1136f7))['catch'](handleError(_0x28ce28,null));})[_0x90a7('0x42')](handleError(_0x28ce28,null));};exports[_0x90a7('0x43')]=function(_0x2d54ac,_0x4190b1){var _0x425109={'raw':![],'where':{'id':_0x2d54ac['params']['id']}},_0x27aa20={};_0x27aa20[_0x90a7('0x2c')]=_[_0x90a7('0x2d')](db[_0x90a7('0x2a')][_0x90a7('0x44')]);_0x27aa20[_0x90a7('0x2e')]=_[_0x90a7('0x2d')](_0x2d54ac[_0x90a7('0x2e')]);_0x27aa20['filters']=_[_0x90a7('0x30')](_0x27aa20[_0x90a7('0x2c')],_0x27aa20[_0x90a7('0x2e')]);_0x425109[_0x90a7('0x31')]=_[_0x90a7('0x30')](_0x27aa20[_0x90a7('0x2c')],qs[_0x90a7('0x32')](_0x2d54ac[_0x90a7('0x2e')][_0x90a7('0x32')]));_0x425109['attributes']=_0x425109[_0x90a7('0x31')][_0x90a7('0x33')]?_0x425109['attributes']:_0x27aa20[_0x90a7('0x2c')];if(_0x2d54ac[_0x90a7('0x2e')][_0x90a7('0x3e')]){_0x425109[_0x90a7('0x3f')]=[{'all':!![]}];}_0x425109=_['merge']({},_0x425109,_0x2d54ac[_0x90a7('0x3d')]);return db[_0x90a7('0x2a')][_0x90a7('0x45')](_0x425109)['then'](handleEntityNotFound(_0x4190b1,null))['then'](respondWithResult(_0x4190b1,null))[_0x90a7('0x42')](handleError(_0x4190b1,null));};exports[_0x90a7('0x46')]=function(_0x52de2d,_0x2ba593){return db[_0x90a7('0x2a')][_0x90a7('0x46')](_0x52de2d[_0x90a7('0x47')],{})['then'](function(_0x24349c){var _0x358119=_0x52de2d[_0x90a7('0x48')]['get']({'plain':!![]});if(!_0x358119)throw new Error(_0x90a7('0x49'));if(_0x358119[_0x90a7('0x4a')]===_0x90a7('0x48')){var _0x23b999=_0x24349c[_0x90a7('0x23')]({'plain':!![]});var _0x22a52f='Companies';return db[_0x90a7('0x4b')][_0x90a7('0x45')]({'where':{'name':_0x22a52f,'userProfileId':_0x358119[_0x90a7('0x4c')]},'raw':!![]})[_0x90a7('0x21')](function(_0x5ab908){if(_0x5ab908&&_0x5ab908[_0x90a7('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x23b999['name'],'resourceId':_0x23b999['id'],'type':_0x5ab908[_0x90a7('0x28')],'sectionId':_0x5ab908['id']},{})['then'](function(){return _0x24349c;});}else{return _0x24349c;}})['catch'](function(_0x4bf09d){logger[_0x90a7('0x26')](_0x90a7('0x4e'),_0x4bf09d);throw _0x4bf09d;});}return _0x24349c;})[_0x90a7('0x21')](respondWithResult(_0x2ba593,0xc9))['catch'](handleError(_0x2ba593,null));};exports[_0x90a7('0x20')]=function(_0x29fd94,_0x1448a2){if(_0x29fd94[_0x90a7('0x47')]['id']){delete _0x29fd94['body']['id'];}return db[_0x90a7('0x2a')][_0x90a7('0x45')]({'where':{'id':_0x29fd94[_0x90a7('0x4f')]['id']}})[_0x90a7('0x21')](handleEntityNotFound(_0x1448a2,null))[_0x90a7('0x21')](saveUpdates(_0x29fd94['body'],null))[_0x90a7('0x21')](respondWithResult(_0x1448a2,null))['catch'](handleError(_0x1448a2,null));};exports['destroy']=function(_0x1c3585,_0x360ee7){return db[_0x90a7('0x2a')][_0x90a7('0x45')]({'where':{'id':_0x1c3585[_0x90a7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x360ee7,null))['then'](removeEntity(_0x360ee7,null))[_0x90a7('0x42')](handleError(_0x360ee7,null));};exports['describe']=function(_0x4cfb8e,_0x27df11){return db[_0x90a7('0x2a')]['describe']()['then'](respondWithResult(_0x27df11,null))[_0x90a7('0x42')](handleError(_0x27df11,null));};exports['addContacts']=function(_0x211a6f,_0x2ea205,_0x192939){return db['CmContact'][_0x90a7('0x45')]({'where':{'id':_0x211a6f[_0x90a7('0x4f')]['id']}})[_0x90a7('0x21')](handleEntityNotFound(_0x2ea205,null))[_0x90a7('0x21')](function(_0x4d9bd8){if(_0x4d9bd8){return _0x4d9bd8[_0x90a7('0x50')](_0x211a6f[_0x90a7('0x47')][_0x90a7('0x51')],_['omit'](_0x211a6f['body'],[_0x90a7('0x51'),'id'])||{});}})[_0x90a7('0x21')](respondWithResult(_0x2ea205,null))[_0x90a7('0x42')](handleError(_0x2ea205,null));};exports[_0x90a7('0x52')]=function(_0x3acee6,_0x3844d5,_0x28f14a){var _0x9d1c3f={};var _0x4dc8f7={};var _0x14b6c6;var _0x53d91f;return db[_0x90a7('0x2a')][_0x90a7('0x53')]({'where':{'id':_0x3acee6['params']['id']}})['then'](handleEntityNotFound(_0x3844d5,null))[_0x90a7('0x21')](function(_0x407ee7){if(_0x407ee7){_0x14b6c6=_0x407ee7;_0x4dc8f7['model']=_['keys'](db[_0x90a7('0x54')][_0x90a7('0x44')]);_0x4dc8f7[_0x90a7('0x2e')]=_['keys'](_0x3acee6['query']);_0x4dc8f7[_0x90a7('0x2f')]=_[_0x90a7('0x30')](_0x4dc8f7[_0x90a7('0x2c')],_0x4dc8f7['query']);_0x9d1c3f[_0x90a7('0x31')]=_[_0x90a7('0x30')](_0x4dc8f7[_0x90a7('0x2c')],qs[_0x90a7('0x32')](_0x3acee6[_0x90a7('0x2e')][_0x90a7('0x32')]));_0x9d1c3f[_0x90a7('0x31')]=_0x9d1c3f[_0x90a7('0x31')][_0x90a7('0x33')]?_0x9d1c3f['attributes']:_0x4dc8f7[_0x90a7('0x2c')];_0x9d1c3f[_0x90a7('0x36')]=qs['sort'](_0x3acee6['query'][_0x90a7('0x37')]);_0x9d1c3f['where']=qs[_0x90a7('0x2f')](_[_0x90a7('0x39')](_0x3acee6[_0x90a7('0x2e')],_0x4dc8f7[_0x90a7('0x2f')]));if(_0x3acee6[_0x90a7('0x2e')][_0x90a7('0x3a')]){_0x9d1c3f[_0x90a7('0x38')]=_[_0x90a7('0x3b')](_0x9d1c3f[_0x90a7('0x38')],{'$or':_[_0x90a7('0x3c')](_0x9d1c3f[_0x90a7('0x31')],function(_0x2a21d){var _0x49fd4e={};_0x49fd4e[_0x2a21d]={'$like':'%'+_0x3acee6[_0x90a7('0x2e')][_0x90a7('0x3a')]+'%'};return _0x49fd4e;})});}_0x9d1c3f=_[_0x90a7('0x3b')]({},_0x9d1c3f,_0x3acee6[_0x90a7('0x3d')]);return _0x14b6c6[_0x90a7('0x52')](_0x9d1c3f);}})[_0x90a7('0x21')](function(_0x3f32a8){if(_0x3f32a8){_0x53d91f=_0x3f32a8[_0x90a7('0x33')];if(!_0x3acee6[_0x90a7('0x2e')][_0x90a7('0x34')](_0x90a7('0x35'))){_0x9d1c3f[_0x90a7('0x1b')]=qs[_0x90a7('0x1b')](_0x3acee6[_0x90a7('0x2e')][_0x90a7('0x1b')]);_0x9d1c3f[_0x90a7('0x1a')]=qs['offset'](_0x3acee6[_0x90a7('0x2e')][_0x90a7('0x1a')]);}return _0x14b6c6['getContacts'](_0x9d1c3f);}})[_0x90a7('0x21')](function(_0x2ad241){if(_0x2ad241){return _0x2ad241?{'count':_0x53d91f,'rows':_0x2ad241}:null;}})[_0x90a7('0x21')](respondWithResult(_0x3844d5,null))[_0x90a7('0x42')](handleError(_0x3844d5,null));};
\ No newline at end of file
+var _0xcb91=['status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','merge','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addContacts','CmContact','ids','getContacts','findOne','order','map','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x2dd12a,_0x441a94){var _0x52069c=function(_0x34591e){while(--_0x34591e){_0x2dd12a['push'](_0x2dd12a['shift']());}};_0x52069c(++_0x441a94);}(_0xcb91,0x141));var _0x1cb9=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xcb91[_0x279d37];return _0x530173;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1cb9('0x0'));var rimraf=require(_0x1cb9('0x1'));var zipdir=require(_0x1cb9('0x2'));var jsonpatch=require(_0x1cb9('0x3'));var rp=require(_0x1cb9('0x4'));var moment=require('moment');var BPromise=require(_0x1cb9('0x5'));var Mustache=require(_0x1cb9('0x6'));var util=require(_0x1cb9('0x7'));var path=require(_0x1cb9('0x8'));var sox=require('sox');var csv=require(_0x1cb9('0x9'));var ejs=require(_0x1cb9('0xa'));var fs=require('fs');var _=require(_0x1cb9('0xb'));var squel=require(_0x1cb9('0xc'));var crypto=require(_0x1cb9('0xd'));var jsforce=require(_0x1cb9('0xe'));var deskjs=require(_0x1cb9('0xf'));var toCsv=require(_0x1cb9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0x10'));var authService=require(_0x1cb9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1cb9('0x12'));var hardwareService=require(_0x1cb9('0x13'));var logger=require(_0x1cb9('0x14'))(_0x1cb9('0x15'));var utils=require('../../config/utils');var config=require(_0x1cb9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25140d,_0x1c4866){_0x1c4866=_0x1c4866||0xcc;return function(_0x1da979){if(_0x1da979){return _0x25140d['sendStatus'](_0x1c4866);}return _0x25140d[_0x1cb9('0x17')](_0x1c4866)[_0x1cb9('0x18')]();};}function respondWithResult(_0x4706ef,_0x3e59f3){_0x3e59f3=_0x3e59f3||0xc8;return function(_0x555cfd){if(_0x555cfd){return _0x4706ef[_0x1cb9('0x17')](_0x3e59f3)[_0x1cb9('0x19')](_0x555cfd);}};}function respondWithFilteredResult(_0x573f3,_0x229662){return function(_0x9be84f){if(_0x9be84f){var _0x5966e9=_0x9be84f['count'],_0x16327a=_0x229662['offset'],_0x5a036a=_0x229662[_0x1cb9('0x1a')]+_0x229662[_0x1cb9('0x1b')],_0x4dc15f;if(_0x5a036a>=_0x5966e9){_0x5a036a=_0x5966e9;_0x4dc15f=0xc8;}else{_0x4dc15f=0xce;}_0x573f3[_0x1cb9('0x17')](_0x4dc15f);return _0x573f3[_0x1cb9('0x1c')]('Content-Range',_0x16327a+'-'+_0x5a036a+'/'+_0x5966e9)['json'](_0x9be84f);}return null;};}function patchUpdates(_0x47d891){return function(_0x4974ef){try{jsonpatch[_0x1cb9('0x1d')](_0x4974ef,_0x47d891,!![]);}catch(_0x27a35f){return BPromise[_0x1cb9('0x1e')](_0x27a35f);}return _0x4974ef[_0x1cb9('0x1f')]();};}function saveUpdates(_0xa083f4,_0x17b2ff){return function(_0x15f153){if(_0x15f153){return _0x15f153[_0x1cb9('0x20')](_0xa083f4)[_0x1cb9('0x21')](function(_0x690b86){return _0x690b86;});}return null;};}function removeEntity(_0x224762,_0x250d3a){return function(_0x46fdeb){if(_0x46fdeb){return _0x46fdeb[_0x1cb9('0x22')]()[_0x1cb9('0x21')](function(){var _0x3eabca=_0x46fdeb[_0x1cb9('0x23')]({'plain':!![]});var _0x59e194=_0x1cb9('0x24');return db[_0x1cb9('0x25')][_0x1cb9('0x22')]({'where':{'type':_0x59e194,'resourceId':_0x3eabca['id']}})[_0x1cb9('0x21')](function(){return _0x46fdeb;});})[_0x1cb9('0x21')](function(){_0x224762[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x570276,_0x57e110){return function(_0x21175f){if(!_0x21175f){_0x570276[_0x1cb9('0x26')](0x194);}return _0x21175f;};}function handleError(_0x5f86bb,_0x4e83ca){_0x4e83ca=_0x4e83ca||0x1f4;return function(_0x2c7728){logger[_0x1cb9('0x27')](_0x2c7728[_0x1cb9('0x28')]);if(_0x2c7728['name']){delete _0x2c7728[_0x1cb9('0x29')];}_0x5f86bb[_0x1cb9('0x17')](_0x4e83ca)[_0x1cb9('0x2a')](_0x2c7728);};}exports[_0x1cb9('0x2b')]=function(_0x1c9acf,_0x14b577){var _0x4a63e8={},_0x3eb6ff={},_0x1372b4={'count':0x0,'rows':[]};return db[_0x1cb9('0x2c')]['describe']()[_0x1cb9('0x21')](function(_0x9f2ebf){_0x3eb6ff[_0x1cb9('0x2d')]=_[_0x1cb9('0x2e')](_0x9f2ebf);_0x3eb6ff[_0x1cb9('0x2f')]=_[_0x1cb9('0x2e')](_0x1c9acf[_0x1cb9('0x2f')]);_0x3eb6ff[_0x1cb9('0x30')]=_['intersection'](_0x3eb6ff[_0x1cb9('0x2d')],_0x3eb6ff['query']);_0x4a63e8[_0x1cb9('0x31')]=_[_0x1cb9('0x32')](_0x3eb6ff['model'],qs[_0x1cb9('0x33')](_0x1c9acf['query'][_0x1cb9('0x33')]));_0x4a63e8[_0x1cb9('0x31')]=_0x4a63e8[_0x1cb9('0x31')][_0x1cb9('0x34')]?_0x4a63e8[_0x1cb9('0x31')]:_0x3eb6ff[_0x1cb9('0x2d')];if(!_0x1c9acf[_0x1cb9('0x2f')]['hasOwnProperty'](_0x1cb9('0x35'))){_0x4a63e8[_0x1cb9('0x1b')]=qs[_0x1cb9('0x1b')](_0x1c9acf['query'][_0x1cb9('0x1b')]);_0x4a63e8[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0x1c9acf[_0x1cb9('0x2f')]['offset']);}_0x4a63e8['order']=qs[_0x1cb9('0x36')](_0x1c9acf[_0x1cb9('0x2f')][_0x1cb9('0x36')]);_0x4a63e8[_0x1cb9('0x37')]=qs[_0x1cb9('0x30')](_[_0x1cb9('0x38')](_0x1c9acf[_0x1cb9('0x2f')],_0x3eb6ff[_0x1cb9('0x30')]),_0x9f2ebf);if(_0x1c9acf[_0x1cb9('0x2f')][_0x1cb9('0x39')]){_0x4a63e8[_0x1cb9('0x37')]=_['merge'](_0x4a63e8['where'],{'$or':_['map'](_0x4a63e8[_0x1cb9('0x31')],function(_0x3f15b5){var _0x26795e={};_0x26795e[_0x3f15b5]={'$like':'%'+_0x1c9acf[_0x1cb9('0x2f')]['filter']+'%'};return _0x26795e;})});}_0x4a63e8=_['merge']({},_0x4a63e8,_0x1c9acf[_0x1cb9('0x3a')]);var _0x4ddbde={'where':_0x4a63e8[_0x1cb9('0x37')]};return db[_0x1cb9('0x2c')][_0x1cb9('0x3b')](_0x4ddbde)[_0x1cb9('0x21')](function(_0x214858){_0x1372b4[_0x1cb9('0x3b')]=_0x214858;if(_0x1c9acf[_0x1cb9('0x2f')][_0x1cb9('0x3c')]){_0x4a63e8[_0x1cb9('0x3d')]=[{'all':!![]}];}return db[_0x1cb9('0x2c')][_0x1cb9('0x3e')](_0x4a63e8);})[_0x1cb9('0x21')](function(_0x1162f4){_0x1372b4[_0x1cb9('0x3f')]=_0x1162f4;return _0x1372b4;})[_0x1cb9('0x21')](respondWithFilteredResult(_0x14b577,_0x4a63e8))[_0x1cb9('0x40')](handleError(_0x14b577,null));})[_0x1cb9('0x40')](handleError(_0x14b577,null));};exports[_0x1cb9('0x41')]=function(_0x47c75a,_0x5c4699){var _0x4665aa={'raw':![],'where':{'id':_0x47c75a['params']['id']}},_0x4e0e10={};_0x4e0e10['model']=_[_0x1cb9('0x2e')](db['CmCompany'][_0x1cb9('0x42')]);_0x4e0e10['query']=_[_0x1cb9('0x2e')](_0x47c75a[_0x1cb9('0x2f')]);_0x4e0e10['filters']=_[_0x1cb9('0x32')](_0x4e0e10[_0x1cb9('0x2d')],_0x4e0e10['query']);_0x4665aa[_0x1cb9('0x31')]=_['intersection'](_0x4e0e10[_0x1cb9('0x2d')],qs[_0x1cb9('0x33')](_0x47c75a[_0x1cb9('0x2f')][_0x1cb9('0x33')]));_0x4665aa[_0x1cb9('0x31')]=_0x4665aa[_0x1cb9('0x31')][_0x1cb9('0x34')]?_0x4665aa[_0x1cb9('0x31')]:_0x4e0e10[_0x1cb9('0x2d')];if(_0x47c75a[_0x1cb9('0x2f')][_0x1cb9('0x3c')]){_0x4665aa[_0x1cb9('0x3d')]=[{'all':!![]}];}_0x4665aa=_[_0x1cb9('0x43')]({},_0x4665aa,_0x47c75a['options']);return db['CmCompany'][_0x1cb9('0x44')](_0x4665aa)[_0x1cb9('0x21')](handleEntityNotFound(_0x5c4699,null))['then'](respondWithResult(_0x5c4699,null))[_0x1cb9('0x40')](handleError(_0x5c4699,null));};exports[_0x1cb9('0x45')]=function(_0x11565a,_0x17fff3){return db['CmCompany'][_0x1cb9('0x45')](_0x11565a['body'],{})['then'](function(_0x51d5d9){var _0x58c3a0=_0x11565a[_0x1cb9('0x46')][_0x1cb9('0x23')]({'plain':!![]});if(!_0x58c3a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58c3a0[_0x1cb9('0x47')]===_0x1cb9('0x46')){var _0x4c3699=_0x51d5d9[_0x1cb9('0x23')]({'plain':!![]});var _0x4dbb39=_0x1cb9('0x24');return db[_0x1cb9('0x48')]['find']({'where':{'name':_0x4dbb39,'userProfileId':_0x58c3a0[_0x1cb9('0x49')]},'raw':!![]})[_0x1cb9('0x21')](function(_0x3981b9){if(_0x3981b9&&_0x3981b9['autoAssociation']===0x0){return db[_0x1cb9('0x25')][_0x1cb9('0x45')]({'name':_0x4c3699['name'],'resourceId':_0x4c3699['id'],'type':_0x3981b9[_0x1cb9('0x29')],'sectionId':_0x3981b9['id']},{})['then'](function(){return _0x51d5d9;});}else{return _0x51d5d9;}})[_0x1cb9('0x40')](function(_0x10853c){logger[_0x1cb9('0x27')](_0x1cb9('0x4a'),_0x10853c);throw _0x10853c;});}return _0x51d5d9;})[_0x1cb9('0x21')](respondWithResult(_0x17fff3,0xc9))['catch'](handleError(_0x17fff3,null));};exports[_0x1cb9('0x20')]=function(_0x5e9301,_0x1a9765){if(_0x5e9301['body']['id']){delete _0x5e9301[_0x1cb9('0x4b')]['id'];}return db[_0x1cb9('0x2c')][_0x1cb9('0x44')]({'where':{'id':_0x5e9301[_0x1cb9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a9765,null))[_0x1cb9('0x21')](saveUpdates(_0x5e9301[_0x1cb9('0x4b')],null))['then'](respondWithResult(_0x1a9765,null))[_0x1cb9('0x40')](handleError(_0x1a9765,null));};exports[_0x1cb9('0x22')]=function(_0x4a5255,_0x119ff2){return db[_0x1cb9('0x2c')]['find']({'where':{'id':_0x4a5255[_0x1cb9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x119ff2,null))['then'](removeEntity(_0x119ff2,null))[_0x1cb9('0x40')](handleError(_0x119ff2,null));};exports[_0x1cb9('0x4d')]=function(_0x607ea,_0x1df119){return db[_0x1cb9('0x2c')][_0x1cb9('0x4d')]()[_0x1cb9('0x21')](respondWithResult(_0x1df119,null))[_0x1cb9('0x40')](handleError(_0x1df119,null));};exports[_0x1cb9('0x4e')]=function(_0xa3964a,_0x134bfc,_0x5d3873){return db[_0x1cb9('0x4f')][_0x1cb9('0x44')]({'where':{'id':_0xa3964a[_0x1cb9('0x4c')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x134bfc,null))[_0x1cb9('0x21')](function(_0x50953d){if(_0x50953d){return _0x50953d[_0x1cb9('0x4e')](_0xa3964a['body'][_0x1cb9('0x50')],_['omit'](_0xa3964a[_0x1cb9('0x4b')],[_0x1cb9('0x50'),'id'])||{});}})[_0x1cb9('0x21')](respondWithResult(_0x134bfc,null))[_0x1cb9('0x40')](handleError(_0x134bfc,null));};exports[_0x1cb9('0x51')]=function(_0x4b1ada,_0x22bdb8,_0x51ac63){var _0x30ec9d={};var _0x3fef55={};var _0x14bf1a;var _0x7090b;return db['CmCompany'][_0x1cb9('0x52')]({'where':{'id':_0x4b1ada['params']['id']}})['then'](handleEntityNotFound(_0x22bdb8,null))[_0x1cb9('0x21')](function(_0x2f5bf8){if(_0x2f5bf8){_0x14bf1a=_0x2f5bf8;_0x3fef55[_0x1cb9('0x2d')]=_[_0x1cb9('0x2e')](db[_0x1cb9('0x4f')]['rawAttributes']);_0x3fef55[_0x1cb9('0x2f')]=_[_0x1cb9('0x2e')](_0x4b1ada[_0x1cb9('0x2f')]);_0x3fef55['filters']=_[_0x1cb9('0x32')](_0x3fef55[_0x1cb9('0x2d')],_0x3fef55[_0x1cb9('0x2f')]);_0x30ec9d[_0x1cb9('0x31')]=_[_0x1cb9('0x32')](_0x3fef55['model'],qs[_0x1cb9('0x33')](_0x4b1ada[_0x1cb9('0x2f')][_0x1cb9('0x33')]));_0x30ec9d[_0x1cb9('0x31')]=_0x30ec9d[_0x1cb9('0x31')]['length']?_0x30ec9d['attributes']:_0x3fef55[_0x1cb9('0x2d')];_0x30ec9d[_0x1cb9('0x53')]=qs['sort'](_0x4b1ada[_0x1cb9('0x2f')][_0x1cb9('0x36')]);_0x30ec9d[_0x1cb9('0x37')]=qs['filters'](_['pick'](_0x4b1ada['query'],_0x3fef55[_0x1cb9('0x30')]));if(_0x4b1ada[_0x1cb9('0x2f')][_0x1cb9('0x39')]){_0x30ec9d[_0x1cb9('0x37')]=_['merge'](_0x30ec9d['where'],{'$or':_[_0x1cb9('0x54')](_0x30ec9d[_0x1cb9('0x31')],function(_0x1bbd6b){var _0xd09f12={};_0xd09f12[_0x1bbd6b]={'$like':'%'+_0x4b1ada['query']['filter']+'%'};return _0xd09f12;})});}_0x30ec9d=_[_0x1cb9('0x43')]({},_0x30ec9d,_0x4b1ada[_0x1cb9('0x3a')]);return _0x14bf1a[_0x1cb9('0x51')](_0x30ec9d);}})['then'](function(_0x8bfaaf){if(_0x8bfaaf){_0x7090b=_0x8bfaaf['length'];if(!_0x4b1ada[_0x1cb9('0x2f')][_0x1cb9('0x55')](_0x1cb9('0x35'))){_0x30ec9d[_0x1cb9('0x1b')]=qs['limit'](_0x4b1ada[_0x1cb9('0x2f')][_0x1cb9('0x1b')]);_0x30ec9d[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0x4b1ada[_0x1cb9('0x2f')][_0x1cb9('0x1a')]);}return _0x14bf1a['getContacts'](_0x30ec9d);}})[_0x1cb9('0x21')](function(_0x4449c5){if(_0x4449c5){return _0x4449c5?{'count':_0x7090b,'rows':_0x4449c5}:null;}})[_0x1cb9('0x21')](respondWithResult(_0x22bdb8,null))['catch'](handleError(_0x22bdb8,null));};
\ No newline at end of file
index bf2d0ca..85da320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x291c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','CmCompany','cm_companies','lodash'];(function(_0x18b3a7,_0x2df540){var _0x89e509=function(_0x1baebd){while(--_0x1baebd){_0x18b3a7['push'](_0x18b3a7['shift']());}};_0x89e509(++_0x2df540);}(_0x291c,0x137));var _0xc291=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x291c[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xc291('0x0'));var util=require(_0xc291('0x1'));var logger=require(_0xc291('0x2'))(_0xc291('0x3'));var moment=require(_0xc291('0x4'));var BPromise=require(_0xc291('0x5'));var rp=require(_0xc291('0x6'));var fs=require('fs');var path=require(_0xc291('0x7'));var rimraf=require(_0xc291('0x8'));var config=require(_0xc291('0x9'));var attributes=require(_0xc291('0xa'));module['exports']=function(_0x2c96a8,_0x5f2563){return _0x2c96a8['define'](_0xc291('0xb'),attributes,{'tableName':_0xc291('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6bff=['api','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6bff,0xa6));var _0xf6bf=function(_0x28779f,_0x56a41b){_0x28779f=_0x28779f-0x0;var _0xa4b2f7=_0x6bff[_0x28779f];return _0xa4b2f7;};'use strict';var _=require(_0xf6bf('0x0'));var util=require(_0xf6bf('0x1'));var logger=require('../../config/logger')(_0xf6bf('0x2'));var moment=require('moment');var BPromise=require(_0xf6bf('0x3'));var rp=require(_0xf6bf('0x4'));var fs=require('fs');var path=require(_0xf6bf('0x5'));var rimraf=require(_0xf6bf('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6bf('0x7'));module[_0xf6bf('0x8')]=function(_0x27cdda,_0x239d17){return _0x27cdda[_0xf6bf('0x9')](_0xf6bf('0xa'),attributes,{'tableName':_0xf6bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d84638d..780dd99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79fb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x720e59,_0x5ed677){var _0x950446=function(_0x5807c9){while(--_0x5807c9){_0x720e59['push'](_0x720e59['shift']());}};_0x950446(++_0x5ed677);}(_0x79fb,0xea));var _0xb79f=function(_0x449f2d,_0x38d3cb){_0x449f2d=_0x449f2d-0x0;var _0x3413ec=_0x79fb[_0x449f2d];return _0x3413ec;};'use strict';var _=require(_0xb79f('0x0'));var util=require('util');var moment=require(_0xb79f('0x1'));var BPromise=require(_0xb79f('0x2'));var rs=require(_0xb79f('0x3'));var fs=require('fs');var Redis=require(_0xb79f('0x4'));var db=require(_0xb79f('0x5'))['db'];var utils=require(_0xb79f('0x6'));var logger=require(_0xb79f('0x7'))('rpc');var config=require(_0xb79f('0x8'));var jayson=require(_0xb79f('0x9'));var client=jayson['client'][_0xb79f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x278ca4,_0x3ed431,_0x433305){return new BPromise(function(_0x50cb25,_0xc3ca4a){return client[_0xb79f('0xb')](_0x278ca4,_0x433305)[_0xb79f('0xc')](function(_0x51f316){logger['info']('CmCompany,\x20%s,\x20%s',_0x3ed431,'request\x20sent');logger[_0xb79f('0xd')](_0xb79f('0xe'),_0x3ed431,_0xb79f('0xf'),JSON[_0xb79f('0x10')](_0x51f316));if(_0x51f316[_0xb79f('0x11')]){if(_0x51f316['error'][_0xb79f('0x12')]===0x1f4){logger[_0xb79f('0x11')](_0xb79f('0x13'),_0x3ed431,_0x51f316['error'][_0xb79f('0x14')]);return _0xc3ca4a(_0x51f316[_0xb79f('0x11')][_0xb79f('0x14')]);}logger[_0xb79f('0x11')](_0xb79f('0x13'),_0x3ed431,_0x51f316[_0xb79f('0x11')][_0xb79f('0x14')]);return _0x50cb25(_0x51f316[_0xb79f('0x11')][_0xb79f('0x14')]);}else{logger[_0xb79f('0x15')](_0xb79f('0x13'),_0x3ed431,'request\x20sent');_0x50cb25(_0x51f316[_0xb79f('0x16')][_0xb79f('0x14')]);}})[_0xb79f('0x17')](function(_0x273b5d){logger[_0xb79f('0x11')](_0xb79f('0x13'),_0x3ed431,_0x273b5d);_0xc3ca4a(_0x273b5d);});});}
\ No newline at end of file
+var _0xd419=['http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x53b5b4,_0x5e04b3){var _0x5e325d=function(_0x2cc90b){while(--_0x2cc90b){_0x53b5b4['push'](_0x53b5b4['shift']());}};_0x5e325d(++_0x5e04b3);}(_0xd419,0xac));var _0x9d41=function(_0x547bb6,_0x2d6f27){_0x547bb6=_0x547bb6-0x0;var _0x1a9154=_0xd419[_0x547bb6];return _0x1a9154;};'use strict';var _=require('lodash');var util=require(_0x9d41('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d41('0x1'));var fs=require('fs');var Redis=require(_0x9d41('0x2'));var db=require(_0x9d41('0x3'))['db'];var utils=require(_0x9d41('0x4'));var logger=require(_0x9d41('0x5'))(_0x9d41('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9d41('0x7')][_0x9d41('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58f635,_0x26a50f,_0x33fb8d){return new BPromise(function(_0x38e104,_0x29c3ae){return client['request'](_0x58f635,_0x33fb8d)[_0x9d41('0x9')](function(_0x3bf5ee){logger[_0x9d41('0xa')](_0x9d41('0xb'),_0x26a50f,_0x9d41('0xc'));logger[_0x9d41('0xd')](_0x9d41('0xe'),_0x26a50f,'request\x20sent',JSON[_0x9d41('0xf')](_0x3bf5ee));if(_0x3bf5ee[_0x9d41('0x10')]){if(_0x3bf5ee[_0x9d41('0x10')][_0x9d41('0x11')]===0x1f4){logger['error'](_0x9d41('0xb'),_0x26a50f,_0x3bf5ee[_0x9d41('0x10')][_0x9d41('0x12')]);return _0x29c3ae(_0x3bf5ee[_0x9d41('0x10')][_0x9d41('0x12')]);}logger['error'](_0x9d41('0xb'),_0x26a50f,_0x3bf5ee['error'][_0x9d41('0x12')]);return _0x38e104(_0x3bf5ee[_0x9d41('0x10')][_0x9d41('0x12')]);}else{logger[_0x9d41('0xa')]('CmCompany,\x20%s,\x20%s',_0x26a50f,_0x9d41('0xc'));_0x38e104(_0x3bf5ee['result'][_0x9d41('0x12')]);}})[_0x9d41('0x13')](function(_0x1db63f){logger[_0x9d41('0x10')]('CmCompany,\x20%s,\x20%s',_0x26a50f,_0x1db63f);_0x29c3ae(_0x1db63f);});});}
\ No newline at end of file
index fae0932..31fa575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['/:id','/:id/contacts','getContacts','post','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x2db4d5,_0x2ff676){var _0x567cb7=function(_0x367417){while(--_0x367417){_0x2db4d5['push'](_0x2db4d5['shift']());}};_0x567cb7(++_0x2ff676);}(_0x187d,0x93));var _0xd187=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x187d[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0x8')](_0xd187('0xd'),auth[_0xd187('0xb')](),controller['show']);router[_0xd187('0x8')](_0xd187('0xe'),auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0xb')](),controller['create']);router[_0xd187('0x10')](_0xd187('0xe'),auth[_0xd187('0xb')](),controller['addContacts']);router[_0xd187('0x11')](_0xd187('0xd'),auth[_0xd187('0xb')](),controller['update']);router[_0xd187('0x12')](_0xd187('0xd'),auth[_0xd187('0xb')](),controller[_0xd187('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x32b6=['put','update','destroy','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','/:id/contacts','addContacts'];(function(_0x1d92d4,_0x2448f1){var _0xa1d523=function(_0x317759){while(--_0x317759){_0x1d92d4['push'](_0x1d92d4['shift']());}};_0xa1d523(++_0x2448f1);}(_0x32b6,0x1d1));var _0x632b=function(_0xbb9b48,_0x45e172){_0xbb9b48=_0xbb9b48-0x0;var _0x3e8bf7=_0x32b6[_0xbb9b48];return _0x3e8bf7;};'use strict';var multer=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var path=require('path');var timeout=require(_0x632b('0x2'));var express=require(_0x632b('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x632b('0x4'));var config=require(_0x632b('0x5'));var controller=require(_0x632b('0x6'));router[_0x632b('0x7')]('/',auth[_0x632b('0x8')](),controller[_0x632b('0x9')]);router[_0x632b('0x7')](_0x632b('0xa'),auth[_0x632b('0x8')](),controller[_0x632b('0xb')]);router['get'](_0x632b('0xc'),auth[_0x632b('0x8')](),controller[_0x632b('0xd')]);router[_0x632b('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0x632b('0xe')]('/',auth['isAuthenticated'](),controller[_0x632b('0xf')]);router[_0x632b('0xe')](_0x632b('0x10'),auth[_0x632b('0x8')](),controller[_0x632b('0x11')]);router[_0x632b('0x12')](_0x632b('0xc'),auth[_0x632b('0x8')](),controller[_0x632b('0x13')]);router['delete'](_0x632b('0xc'),auth[_0x632b('0x8')](),controller[_0x632b('0x14')]);module['exports']=router;
\ No newline at end of file
index 02fd5d2..7b32afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x434f=['DATE','NOW','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x3275f6,_0x57930f){var _0x572df2=function(_0x1c47d8){while(--_0x1c47d8){_0x3275f6['push'](_0x3275f6['shift']());}};_0x572df2(++_0x57930f);}(_0x434f,0x9c));var _0xf434=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x434f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var Sequelize=require(_0xf434('0x0'));module[_0xf434('0x1')]={'firstName':{'type':Sequelize[_0xf434('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf434('0x2')]},'street':{'type':Sequelize[_0xf434('0x2')]},'postalCode':{'type':Sequelize[_0xf434('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xf434('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf434('0x2')]},'description':{'type':Sequelize[_0xf434('0x3')]},'phone':{'type':Sequelize[_0xf434('0x2')]},'mobile':{'type':Sequelize[_0xf434('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf434('0x2')]},'url':{'type':Sequelize[_0xf434('0x2')]},'facebook':{'type':Sequelize[_0xf434('0x2')]},'fb_data':{'type':Sequelize[_0xf434('0x2')]},'twitter':{'type':Sequelize[_0xf434('0x2')]},'skype':{'type':Sequelize[_0xf434('0x2')]},'teams':{'type':Sequelize[_0xf434('0x2')]},'viber':{'type':Sequelize[_0xf434('0x2')]},'line':{'type':Sequelize[_0xf434('0x2')]},'wechat':{'type':Sequelize[_0xf434('0x2')]},'telegram':{'type':Sequelize[_0xf434('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xf434('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf434('0x5')],'defaultValue':Sequelize[_0xf434('0x6')]}};
\ No newline at end of file
+var _0xc82f=['lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE','NOW'];(function(_0x5ee748,_0x552a2b){var _0x36da37=function(_0x22cc48){while(--_0x22cc48){_0x5ee748['push'](_0x5ee748['shift']());}};_0x36da37(++_0x552a2b);}(_0xc82f,0xd8));var _0xfc82=function(_0x2b4eb1,_0x1d007a){_0x2b4eb1=_0x2b4eb1-0x0;var _0x2dd440=_0xc82f[_0x2b4eb1];return _0x2dd440;};'use strict';var _=require(_0xfc82('0x0'));var Sequelize=require(_0xfc82('0x1'));module[_0xfc82('0x2')]={'firstName':{'type':Sequelize[_0xfc82('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xfc82('0x3')]},'postalCode':{'type':Sequelize[_0xfc82('0x3')]},'city':{'type':Sequelize[_0xfc82('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xfc82('0x3')]},'description':{'type':Sequelize[_0xfc82('0x4')]},'phone':{'type':Sequelize[_0xfc82('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfc82('0x3')]},'email':{'type':Sequelize[_0xfc82('0x3')]},'url':{'type':Sequelize[_0xfc82('0x3')]},'facebook':{'type':Sequelize[_0xfc82('0x3')]},'fb_data':{'type':Sequelize[_0xfc82('0x3')]},'twitter':{'type':Sequelize[_0xfc82('0x3')]},'skype':{'type':Sequelize[_0xfc82('0x3')]},'teams':{'type':Sequelize[_0xfc82('0x3')]},'viber':{'type':Sequelize[_0xfc82('0x3')]},'line':{'type':Sequelize[_0xfc82('0x3')]},'wechat':{'type':Sequelize[_0xfc82('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xfc82('0x5')]},'priority':{'type':Sequelize[_0xfc82('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfc82('0x6')],'defaultValue':Sequelize[_0xfc82('0x7')]}};
\ No newline at end of file
index c5cedd1..3493741 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ffc=['tag','isArray','replace','\x27\x27\x27\x27','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','QueryTypes','SELECT','clone','c.id','DESC','t.id\x20IN\x20?','resolve','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','CmContact','fields','c.lastName','c.mobile','c.fax','c.deletedAt','TagIds','Tags','rows','destroy','params','catch','tags','columnName','findAll','displayName','alias','custom','values','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','spread','show','$and','omit','format','pickBy','startsWith','cf_%d','table','cm_contacts','id\x20=\x20?','phone','filters','options','getTags','setTags','getHoppers','CmHopper','rawAttributes','ContactId','includeAll','include','getHopperFinals','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','meta','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','send','index','describe','keys','length','push','CmCustomField','findOne','trimStart','cf_','all','fieldType','type','model','query','intersection','attributes','nolimit','order','sort','where','pick','select','field','name','color','from','tools_tags','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','buildExpression','text','start','hasOwnProperty','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x5ffc,0x83));var _0xc5ff=function(_0x1aad88,_0x551794){_0x1aad88=_0x1aad88-0x0;var _0x1bbfe9=_0x5ffc[_0x1aad88];return _0x1bbfe9;};'use strict';var pdf=require(_0xc5ff('0x0'));var emlformat=require(_0xc5ff('0x1'));var rimraf=require(_0xc5ff('0x2'));var zipdir=require(_0xc5ff('0x3'));var jsonpatch=require(_0xc5ff('0x4'));var rp=require(_0xc5ff('0x5'));var moment=require(_0xc5ff('0x6'));var BPromise=require(_0xc5ff('0x7'));var Mustache=require('mustache');var util=require(_0xc5ff('0x8'));var path=require(_0xc5ff('0x9'));var sox=require(_0xc5ff('0xa'));var csv=require('to-csv');var ejs=require(_0xc5ff('0xb'));var fs=require('fs');var _=require(_0xc5ff('0xc'));var squel=require(_0xc5ff('0xd'));var crypto=require('crypto');var jsforce=require(_0xc5ff('0xe'));var deskjs=require(_0xc5ff('0xf'));var toCsv=require(_0xc5ff('0x10'));var querystring=require('querystring');var Papa=require(_0xc5ff('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5ff('0x12'));var as=require(_0xc5ff('0x13'));var hardwareService=require(_0xc5ff('0x14'));var logger=require(_0xc5ff('0x15'))(_0xc5ff('0x16'));var utils=require(_0xc5ff('0x17'));var config=require('../../config/environment');var db=require(_0xc5ff('0x18'))['db'];config[_0xc5ff('0x19')]=_['defaults'](config[_0xc5ff('0x19')],{'host':_0xc5ff('0x1a'),'port':0x18eb});var socket=require(_0xc5ff('0x1b'))(new Redis(config[_0xc5ff('0x19')]));require(_0xc5ff('0x1c'))[_0xc5ff('0x1d')](socket);function respondWithStatusCode(_0x30004d,_0x18a03f){_0x18a03f=_0x18a03f||0xcc;return function(_0x502397){if(_0x502397){return _0x30004d[_0xc5ff('0x1e')](_0x18a03f);}return _0x30004d[_0xc5ff('0x1f')](_0x18a03f)[_0xc5ff('0x20')]();};}function respondWithResult(_0x34801b,_0x48da59){_0x48da59=_0x48da59||0xc8;return function(_0x43a078){if(_0x43a078){return _0x34801b['status'](_0x48da59)[_0xc5ff('0x21')](_0x43a078);}};}function respondWithFilteredResult(_0x27fa7b,_0x167917){return function(_0x2d0919){if(_0x2d0919){var _0x58027e=_0x2d0919[_0xc5ff('0x22')],_0x30b3c5=_0x167917['offset'],_0x4d91bf=_0x167917[_0xc5ff('0x23')]+_0x167917[_0xc5ff('0x24')],_0x438ca3;if(_0x4d91bf>=_0x58027e){_0x4d91bf=_0x58027e;_0x438ca3=0xc8;}else{_0x438ca3=0xce;}_0x27fa7b['status'](_0x438ca3);return _0x27fa7b[_0xc5ff('0x25')](_0xc5ff('0x26'),_0x30b3c5+'-'+_0x4d91bf+'/'+_0x58027e)[_0xc5ff('0x21')](_0x2d0919);}return null;};}function patchUpdates(_0x33cc53){return function(_0x22ad66){try{jsonpatch[_0xc5ff('0x27')](_0x22ad66,_0x33cc53,!![]);}catch(_0xd99f94){return BPromise[_0xc5ff('0x28')](_0xd99f94);}return _0x22ad66[_0xc5ff('0x29')]();};}function saveUpdates(_0x5355d9,_0x598726){return function(_0x21828a){if(_0x21828a){return _0x21828a[_0xc5ff('0x2a')](_0x5355d9)[_0xc5ff('0x2b')](function(_0x4523fa){return _0x4523fa;});}return null;};}function removeEntity(_0x5ee86b,_0x4803af){return function(_0x37cc68){if(_0x37cc68){return _0x37cc68['destroy']()['then'](function(){_0x5ee86b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2863fe,_0x4cef33){return function(_0x51e421){if(!_0x51e421){_0x2863fe[_0xc5ff('0x1e')](0x194);}return _0x51e421;};}function handleError(_0x2c4a38,_0x163ab6){_0x163ab6=_0x163ab6||0x1f4;return function(_0x5606f9){logger[_0xc5ff('0x2c')](_0x5606f9[_0xc5ff('0x2d')]);if(_0x5606f9['name']){delete _0x5606f9['name'];}_0x2c4a38[_0xc5ff('0x1f')](_0x163ab6)[_0xc5ff('0x2e')](_0x5606f9);};}exports[_0xc5ff('0x2f')]=function(_0x529c2c,_0x4ab257){var _0x53448f={},_0x46d078={},_0x87bda5={'count':0x0,'rows':[]};return db['CmContact'][_0xc5ff('0x30')]()[_0xc5ff('0x2b')](function(_0xc339ba){var _0x74c9=[];for(var _0x192558=0x0;_0x192558<Object[_0xc5ff('0x31')](_0xc339ba)[_0xc5ff('0x32')];_0x192558++){var _0x13d114=Object[_0xc5ff('0x31')](_0xc339ba)[_0x192558];if(_['startsWith'](_0x13d114,'cf_')){_0x74c9[_0xc5ff('0x33')](db[_0xc5ff('0x34')][_0xc5ff('0x35')]({'where':{'id':_[_0xc5ff('0x36')](_0x13d114,_0xc5ff('0x37'))},'raw':!![]}));}}return BPromise[_0xc5ff('0x38')](_0x74c9)[_0xc5ff('0x2b')](function(_0x5bbc45){for(var _0x3bd95e=0x0;_0x3bd95e<_0x5bbc45['length'];_0x3bd95e++){if(_0x5bbc45[_0x3bd95e]){var _0x3f0372=_0xc5ff('0x37')+_0x5bbc45[_0x3bd95e]['id'];var _0x5afb04=_0xc339ba[_0x3f0372];_0x5afb04[_0xc5ff('0x39')]=_0x5bbc45[_0x3bd95e][_0xc5ff('0x3a')];}}return _0xc339ba;});})[_0xc5ff('0x2b')](function(_0x2f509e){_0x46d078[_0xc5ff('0x3b')]=_[_0xc5ff('0x31')](_0x2f509e);_0x46d078[_0xc5ff('0x3c')]=_[_0xc5ff('0x31')](_0x529c2c['query']);_0x46d078['filters']=_[_0xc5ff('0x3d')](_0x46d078[_0xc5ff('0x3b')],_0x46d078[_0xc5ff('0x3c')]);_0x53448f[_0xc5ff('0x3e')]=_[_0xc5ff('0x3d')](_0x46d078[_0xc5ff('0x3b')],qs['fields'](_0x529c2c[_0xc5ff('0x3c')]['fields']));_0x53448f[_0xc5ff('0x3e')]=_0x53448f[_0xc5ff('0x3e')][_0xc5ff('0x32')]?_0x53448f[_0xc5ff('0x3e')]:_0x46d078['model'];if(!_0x529c2c[_0xc5ff('0x3c')]['hasOwnProperty'](_0xc5ff('0x3f'))){_0x53448f[_0xc5ff('0x24')]=qs[_0xc5ff('0x24')](_0x529c2c[_0xc5ff('0x3c')][_0xc5ff('0x24')]);_0x53448f[_0xc5ff('0x23')]=qs[_0xc5ff('0x23')](_0x529c2c['query'][_0xc5ff('0x23')]);}_0x53448f[_0xc5ff('0x40')]=qs[_0xc5ff('0x41')](_0x529c2c[_0xc5ff('0x3c')][_0xc5ff('0x41')]);_0x53448f[_0xc5ff('0x42')]=qs['filters'](_[_0xc5ff('0x43')](_0x529c2c[_0xc5ff('0x3c')],_0x46d078['filters']),_0x2f509e);var _0x38523a=[];var _0x2feece=squel[_0xc5ff('0x44')]()[_0xc5ff('0x45')]('id')[_0xc5ff('0x45')](_0xc5ff('0x46'))[_0xc5ff('0x45')](_0xc5ff('0x47'))[_0xc5ff('0x48')](_0xc5ff('0x49'));var _0x8c16ca=squel[_0xc5ff('0x44')]()[_0xc5ff('0x48')]('cm_contacts','c')['left_join']('cm_user_has_contacts','uc',_0xc5ff('0x4a'))[_0xc5ff('0x4b')](_0xc5ff('0x4c'),'ct',_0xc5ff('0x4d'))['left_join'](_0xc5ff('0x49'),'t','t.id\x20=\x20ct.TagId')[_0xc5ff('0x42')](_0xc5ff('0x4e'));var _0x2a7a6d=squel[_0xc5ff('0x4f')]();var _0x45542d=[];var _0x3a6b5e=squel[_0xc5ff('0x4f')]();var _0x3b147f;if(_0x529c2c[_0xc5ff('0x3c')][_0xc5ff('0x50')]){_0x3b147f=as[_0xc5ff('0x51')](_0x529c2c['query'][_0xc5ff('0x50')]);var _0x367a7c=_0x3b147f[_0xc5ff('0x52')];for(var _0x52f060=0x0;_0x52f060<_0x3b147f[_0xc5ff('0x53')][_0xc5ff('0x32')];_0x52f060++){var _0x103493=_0x3b147f[_0xc5ff('0x53')][_0x52f060];var _0x41fa2e='c';var _0x5dba2a=_(_0x2f509e)['keys']()[_0xc5ff('0x54')](function(_0x550e89){return _0x550e89===_0x103493[_0xc5ff('0x45')];});if(_0x5dba2a)_0x5dba2a=_0x2f509e[_0x103493['field']];if(!_0x5dba2a){if(_0x103493[_0xc5ff('0x45')]===_0xc5ff('0x55')){var _0x26555e=_0x103493[_0xc5ff('0x56')][_0xc5ff('0x57')](',')[_0xc5ff('0x58')](function(_0x2a5c4d){return Number(_0x2a5c4d);});_0x26555e[_0xc5ff('0x59')](function(_0xae0b3b){_0x3a6b5e['or'](_0xc5ff('0x5a'),'%,'+_0xae0b3b+',%');});_0x45542d=_[_0xc5ff('0x5b')](_0x45542d,_0x26555e);}else if(_0x103493[_0xc5ff('0x45')]===_0xc5ff('0x5c')){_0x2a7a6d[_0xc5ff('0x5d')](_0xc5ff('0x5e'),_0x103493[_0xc5ff('0x56')]);}}else{if(_0x103493['field']==='dateOfBirth'||_0x5dba2a['fieldType']===_0xc5ff('0x5f'))_0x103493[_0xc5ff('0x60')]=_0xc5ff('0x61');var _0x260ea2=as[_0xc5ff('0x62')](_0x41fa2e,_0x5dba2a[_0xc5ff('0x3a')],_0x103493);_0x2a7a6d[_0x367a7c](_0x260ea2[_0xc5ff('0x63')],_0x260ea2[_0xc5ff('0x56')][_0xc5ff('0x64')],_0x260ea2['value']['end']);}}}else{var _0x28d968=_(Object[_0xc5ff('0x31')](_0x529c2c[_0xc5ff('0x3c')]))[_0xc5ff('0x58')](function(_0x1f9e0b){return _0x2f509e[_0xc5ff('0x65')](_0x1f9e0b)?_0x1f9e0b:undefined;})[_0xc5ff('0x66')](function(_0x5de236){return!_[_0xc5ff('0x67')](_0x5de236);})[_0xc5ff('0x56')]();if(_0x529c2c[_0xc5ff('0x3c')][_0xc5ff('0x68')])_0x28d968[_0xc5ff('0x33')](_0xc5ff('0x68'));if(!_[_0xc5ff('0x69')](_0x28d968)){_0x28d968['forEach'](function(_0x422eef){if(_0x422eef===_0xc5ff('0x6a')){_0x8c16ca[_0xc5ff('0x42')](_0xc5ff('0x6b'),[][_0xc5ff('0x6c')](_0x529c2c[_0xc5ff('0x3c')][_0x422eef]));}else if(_0x422eef===_0xc5ff('0x68')){var _0x41a4e6='%'+_0x529c2c['query'][_0x422eef]+'%';_0x8c16ca[_0xc5ff('0x42')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x41a4e6);}else{_0x8c16ca[_0xc5ff('0x42')]('c.'+_0x422eef+'\x20=\x20?',_0x529c2c[_0xc5ff('0x3c')][_0x422eef]);}});}if(_0x529c2c['query'][_0xc5ff('0x6d')]){_0x45542d=_[_0xc5ff('0x6e')](_0x529c2c['query'][_0xc5ff('0x6d')])?_0x529c2c['query'][_0xc5ff('0x6d')]:new Array(_0x529c2c[_0xc5ff('0x3c')][_0xc5ff('0x6d')]);_0x45542d[_0xc5ff('0x59')](function(_0x78a96c){_0x3a6b5e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x78a96c+',%');});}if(_0x529c2c[_0xc5ff('0x3c')][_0xc5ff('0x66')]){var _0x152e00=_0x529c2c[_0xc5ff('0x3c')]['filter'][_0xc5ff('0x6f')]('\x5c','\x5c\x5c')[_0xc5ff('0x6f')]('\x27\x27',_0xc5ff('0x70'));if(_0x152e00[_0xc5ff('0x57')]('\x20')[_0xc5ff('0x32')]>0x1){_0x2a7a6d['or'](_0xc5ff('0x71'),qs[_0xc5ff('0x72')](_0x152e00),null);}else{if(qs[_0xc5ff('0x73')](_0x152e00)){_0x2a7a6d['or']('c.id\x20LIKE\x20?',_0x152e00+'%');_0x2a7a6d['or'](_0xc5ff('0x74'),_0x152e00+'%');_0x2a7a6d['or'](_0xc5ff('0x75'),_0x152e00+'%');_0x2a7a6d['or']('c.fax\x20LIKE\x20?',_0x152e00+'%');}else if(qs[_0xc5ff('0x76')](_0x152e00)){_0x2a7a6d['or'](_0xc5ff('0x77'),_0x152e00+'%');}else{_0x2a7a6d['or'](_0xc5ff('0x78'),'%'+_0x152e00+'%');_0x2a7a6d['or'](_0xc5ff('0x79'),'%'+_0x152e00+'%');_0x2a7a6d['or'](_0xc5ff('0x77'),'%'+_0x152e00+'%');}}}}_0x8c16ca[_0xc5ff('0x42')](_0x2a7a6d);_0x8c16ca[_0xc5ff('0x7a')]('c.id');var _0x440a68={'type':db['Sequelize'][_0xc5ff('0x7b')][_0xc5ff('0x7c')],'raw':!![]};var _0x2d95a5=_0x8c16ca[_0xc5ff('0x7d')]()[_0xc5ff('0x45')](_0xc5ff('0x7e'));if(_0x53448f['order']){_0x53448f[_0xc5ff('0x40')][_0xc5ff('0x59')](function(_0x5b6678){_0x8c16ca[_0xc5ff('0x40')]('c.'+_0x5b6678[0x0],_0x5b6678[0x1]===_0xc5ff('0x7f')?![]:!![]);});}if(!_[_0xc5ff('0x69')](_0x45542d)){_0x8c16ca['having'](_0x3a6b5e);_0x2d95a5['where'](_0xc5ff('0x80'),_0x45542d);}BPromise[_0xc5ff('0x81')]()['then'](function(){if(_0x3b147f&&!_['some'](_0x3b147f['conditions'],['field','User'])){return _0x529c2c[_0xc5ff('0x82')][_0xc5ff('0x83')]({'attributes':['id'],'raw':!![]})[_0xc5ff('0x2b')](function(_0x3deb1c){if(_[_0xc5ff('0x69')](_0x3deb1c)){_0x2d95a5[_0xc5ff('0x42')](_0xc5ff('0x84'));_0x8c16ca['where'](_0xc5ff('0x84'));}else{_0x2d95a5['where']('c.ListId\x20IN\x20?',_[_0xc5ff('0x58')](_0x3deb1c,'id'));_0x8c16ca[_0xc5ff('0x42')]('c.ListId\x20IN\x20?',_['map'](_0x3deb1c,'id'));}});}else{return;}})['then'](function(){db[_0xc5ff('0x85')]['query'](_0x2d95a5['toString'](),_0x440a68)['then'](function(_0xdcd81d){_0x87bda5[_0xc5ff('0x22')]=_0xdcd81d[_0xc5ff('0x32')];if(_0x87bda5[_0xc5ff('0x22')]===0x0)return[];return db[_0xc5ff('0x85')][_0xc5ff('0x3c')](_0x2feece[_0xc5ff('0x86')](),_0x440a68);})['then'](function(_0x442c7d){_0x38523a=_[_0xc5ff('0x87')](_0x442c7d,'id');_0x440a68=_['merge'](_0x440a68,{'model':db[_0xc5ff('0x88')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x529c2c[_0xc5ff('0x3c')][_0xc5ff('0x89')]){_0x53448f[_0xc5ff('0x3e')][_0xc5ff('0x59')](function(_0x4452ac){_0x8c16ca['field']('c.'+_0x4452ac);});}else{_0x8c16ca[_0xc5ff('0x45')](_0xc5ff('0x7e'));_0x8c16ca[_0xc5ff('0x45')]('c.firstName');_0x8c16ca[_0xc5ff('0x45')](_0xc5ff('0x8a'));_0x8c16ca[_0xc5ff('0x45')]('c.phone');_0x8c16ca[_0xc5ff('0x45')](_0xc5ff('0x8b'));_0x8c16ca[_0xc5ff('0x45')](_0xc5ff('0x8c'));_0x8c16ca[_0xc5ff('0x45')]('c.email');_0x8c16ca[_0xc5ff('0x45')]('c.ListId');_0x8c16ca[_0xc5ff('0x45')](_0xc5ff('0x8d'));_0x8c16ca[_0xc5ff('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xc5ff('0x8e'));}if(_0x53448f[_0xc5ff('0x24')])_0x8c16ca[_0xc5ff('0x24')](_0x53448f[_0xc5ff('0x24')]);if(_0x53448f[_0xc5ff('0x23')])_0x8c16ca[_0xc5ff('0x23')](_0x53448f[_0xc5ff('0x23')]);return db[_0xc5ff('0x85')][_0xc5ff('0x3c')](_0x8c16ca[_0xc5ff('0x86')](),_0x440a68);})[_0xc5ff('0x2b')](function(_0x46d32a){_0x46d32a[_0xc5ff('0x59')](function(_0x5a1a20){if(_0x5a1a20[_0xc5ff('0x8e')]){_0x5a1a20[_0xc5ff('0x8f')]=[];_0x5a1a20[_0xc5ff('0x8e')][_0xc5ff('0x57')](',')[_0xc5ff('0x59')](function(_0x3c7757){_0x5a1a20[_0xc5ff('0x8f')][_0xc5ff('0x33')](_0x38523a[_0x3c7757]);});}delete _0x5a1a20[_0xc5ff('0x8e')];});_0x87bda5[_0xc5ff('0x90')]=_0x46d32a;return _0x87bda5;})['then'](respondWithFilteredResult(_0x4ab257,_0x53448f));});})['catch'](handleError(_0x4ab257,null));};exports[_0xc5ff('0x91')]=function(_0x326ba5,_0x2b5f5e){return db[_0xc5ff('0x88')][_0xc5ff('0x54')]({'where':{'id':_0x326ba5[_0xc5ff('0x92')]['id']}})[_0xc5ff('0x2b')](handleEntityNotFound(_0x2b5f5e,null))[_0xc5ff('0x2b')](removeEntity(_0x2b5f5e,null))[_0xc5ff('0x93')](handleError(_0x2b5f5e,null));};exports['describe']=function(_0x153f0a,_0x4d891d){return db['CmContact']['describe']()[_0xc5ff('0x2b')](function(_0x476dec){delete _0x476dec[_0xc5ff('0x94')];for(var _0x3c5e99=0x0;_0x3c5e99<Object[_0xc5ff('0x31')](_0x476dec)[_0xc5ff('0x32')];_0x3c5e99++){var _0xaee1e9=Object[_0xc5ff('0x31')](_0x476dec)[_0x3c5e99];if(!_['startsWith'](_0xaee1e9,'cf_')){_0x476dec[_0xaee1e9][_0xc5ff('0x95')]=_0xaee1e9;_0x476dec[_0xaee1e9]['displayName']=_0xaee1e9;}}return _0x476dec;})[_0xc5ff('0x2b')](function(_0x73cca6){var _0x41bb22={'where':{'$or':[{'ListId':_0x153f0a['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0xc5ff('0x34')][_0xc5ff('0x96')](_0x41bb22)[_0xc5ff('0x2b')](function(_0x343e55){for(var _0x118fb1=0x0;_0x118fb1<_0x343e55[_0xc5ff('0x32')];_0x118fb1++){var _0x102dc6='cf_'+_0x343e55[_0x118fb1]['id'];_0x73cca6[_0x102dc6][_0xc5ff('0x95')]=_0x102dc6;_0x73cca6[_0x102dc6][_0xc5ff('0x97')]=_0x343e55[_0x118fb1][_0xc5ff('0x98')];_0x73cca6[_0x102dc6][_0xc5ff('0x99')]={'type':_0x343e55[_0x118fb1][_0xc5ff('0x3a')],'values':_0x343e55[_0x118fb1][_0xc5ff('0x9a')]};}Object[_0xc5ff('0x31')](_0x73cca6)[_0xc5ff('0x59')](function(_0x50b38d){if(!_0x73cca6[_0x50b38d][_0xc5ff('0x65')](_0xc5ff('0x95'))){delete _0x73cca6[_0x50b38d];}});return _0x73cca6;});})[_0xc5ff('0x2b')](respondWithResult(_0x4d891d,null))['catch'](handleError(_0x4d891d,null));};exports[_0xc5ff('0x9b')]=function(_0x96ac01,_0x13e649){var _0x5eebee;var _0x54a5cc;var _0x4aeac7;if(_0x96ac01['body']['id']){delete _0x96ac01[_0xc5ff('0x9c')]['id'];}return db[_0xc5ff('0x88')][_0xc5ff('0x96')]({'where':{'id':[_0x96ac01[_0xc5ff('0x9c')]['to'],_0x96ac01[_0xc5ff('0x9c')][_0xc5ff('0x48')]]}})[_0xc5ff('0x2b')](function(_0x53b352){if(_0x53b352){if(_0x53b352['length']!==0x2){return null;}_0x53b352[0x0]=_0x53b352[0x0][_0xc5ff('0x9d')]({'plain':!![]});_0x53b352[0x1]=_0x53b352[0x1][_0xc5ff('0x9d')]({'plain':!![]});delete _0x53b352[0x0]['id'];delete _0x53b352[0x1]['id'];return _[_0xc5ff('0x9e')](_0x53b352[0x0],_0x53b352[0x1],function(_0x5ddac3,_0x4902f6){if(Array[_0xc5ff('0x6e')](_0x4902f6)&&!_0x4902f6[_0xc5ff('0x32')]){return _0x5ddac3;}else if(!_0x4902f6){return _0x5ddac3;}});}})[_0xc5ff('0x2b')](handleEntityNotFound(_0x13e649,null))[_0xc5ff('0x2b')](function(_0x422739){if(_0x422739){if(_0x422739[_0xc5ff('0x94')]&&_[_0xc5ff('0x6e')](_0x422739['tags'])){_0x422739['tags']=_0x422739[_0xc5ff('0x94')][_0xc5ff('0x9f')]();}logger['info'](_0xc5ff('0xa0'),_0x96ac01['body']['to'],_0x96ac01[_0xc5ff('0x9c')]['from']);return db['CmHopper'][_0xc5ff('0x91')]({'where':{'ContactId':[_0x96ac01[_0xc5ff('0x9c')]['to'],_0x96ac01[_0xc5ff('0x9c')][_0xc5ff('0x48')]]}})[_0xc5ff('0x2b')](function(_0x39e862){logger[_0xc5ff('0xa1')](_0xc5ff('0xa2'),_0x39e862);return db[_0xc5ff('0xa3')][_0xc5ff('0x91')]({'where':{'ContactId':[_0x96ac01['body']['to'],_0x96ac01[_0xc5ff('0x9c')][_0xc5ff('0x48')]]}})[_0xc5ff('0x2b')](function(_0x5a3da7){logger[_0xc5ff('0xa1')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x5a3da7);return db[_0xc5ff('0x88')][_0xc5ff('0xa4')](_0x422739);});});}})[_0xc5ff('0x2b')](function(_0x2642f7){if(_0x2642f7){_0x5eebee=_0x2642f7;_0x54a5cc={'ContactId':_0x5eebee['id']};_0x4aeac7={'where':{'ContactId':[_0x96ac01[_0xc5ff('0x9c')]['to'],_0x96ac01[_0xc5ff('0x9c')][_0xc5ff('0x48')]]}};return db[_0xc5ff('0xa5')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})['then'](function(){if(_0x5eebee){return db['ChatMessage']['update'](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xa6')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xa7')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xa8')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db['MailInteraction'][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})['then'](function(){if(_0x5eebee){return db[_0xc5ff('0xa8')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xa9')]['update'](_0x54a5cc,_0x4aeac7);}})['then'](function(){if(_0x5eebee){return db[_0xc5ff('0xaa')]['update'](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xab')]['update'](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xac')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xad')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})['then'](function(){if(_0x5eebee){return db['OpenchannelMessage']['update'](_0x54a5cc,_0x4aeac7);}})['then'](function(){if(_0x5eebee){return db[_0xc5ff('0xae')]['update'](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xaf')]['update'](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db['ReportAgentPreview'][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xb0')]['update'](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xb1')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})['then'](function(){if(_0x5eebee){return db[_0xc5ff('0xb2')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})['then'](function(){if(_0x5eebee){return db['MailQueueReport'][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xb3')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0xb4')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})['then'](function(){if(_0x5eebee){return db[_0xc5ff('0xb5')][_0xc5ff('0x2a')](_0x54a5cc,_0x4aeac7);}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return db[_0xc5ff('0x88')]['destroy']({'where':{'id':[_0x96ac01['body']['to'],_0x96ac01[_0xc5ff('0x9c')]['from']]}});}})[_0xc5ff('0x2b')](function(){if(_0x5eebee){return _0x5eebee;}})[_0xc5ff('0x2b')](respondWithResult(_0x13e649,null))[_0xc5ff('0x93')](handleError(_0x13e649,null));};exports[_0xc5ff('0xa4')]=function(_0x4f660c,_0x54e249){return db[_0xc5ff('0x88')][_0xc5ff('0x30')]()[_0xc5ff('0x2b')](function(_0x1bc453){if(_0x4f660c['body'][_0xc5ff('0x94')]&&_['isArray'](_0x4f660c['body'][_0xc5ff('0x94')])){if(_0x4f660c['body'][_0xc5ff('0x94')][_0xc5ff('0x32')]){_0x4f660c[_0xc5ff('0x9c')][_0xc5ff('0x94')]=_0x4f660c[_0xc5ff('0x9c')]['tags'][_0xc5ff('0x9f')](';')+';';}else{_0x4f660c[_0xc5ff('0x9c')][_0xc5ff('0x94')]=null;}}else{_0x4f660c['body'][_0xc5ff('0x94')]=null;}return db['CmContact']['create'](_0x4f660c[_0xc5ff('0x9c')],{'fields':_[_0xc5ff('0x31')](_0x1bc453),'raw':!![]});})['then'](respondWithResult(_0x54e249,0xc9))[_0xc5ff('0x93')](handleError(_0x54e249,null));};exports[_0xc5ff('0xb6')]=function(_0x8ff970,_0x401300){var _0x7976cf=[];var _0xd3141a=0x0;var _0x449f6b=0x0;var _0xd5a505=0x0;return db[_0xc5ff('0x88')][_0xc5ff('0x30')]()['then'](function(_0x182a0b){return BPromise[_0xc5ff('0xb7')](_0x8ff970[_0xc5ff('0x9c')],function(_0x7f3169){var _0x19bb2e={'where':{'$or':[]},'defaults':_0x7f3169,'fields':_[_0xc5ff('0x31')](_0x182a0b),'raw':!![]};if(_0x7f3169[_0xc5ff('0xb8')]){for(var _0x465fbd=0x0;_0x465fbd<_0x7f3169[_0xc5ff('0xb8')]['length'];_0x465fbd++){var _0x45a2d0={};_0x45a2d0[_0x7f3169[_0xc5ff('0xb8')][_0x465fbd]]=_0x7f3169[_0x7f3169[_0xc5ff('0xb8')][_0x465fbd]];_0x19bb2e['where'][_0xc5ff('0xb9')][_0xc5ff('0x33')](_0x45a2d0);}_0x19bb2e['where'][_0xc5ff('0x6a')]=_0x7f3169[_0xc5ff('0x6a')];}return db[_0xc5ff('0x88')]['findOrCreate'](_0x19bb2e)[_0xc5ff('0xba')](function(_0x2097a1,_0x5ce547){if(_0x5ce547){_0xd3141a++;}else{_0xd5a505++;}})[_0xc5ff('0x93')](function(_0x397686){console[_0xc5ff('0x2c')](_0x397686);_0x449f6b++;});});})['then'](function(_0x27b55f){if(_0x27b55f){return{'success':_0xd3141a,'failure':_0x449f6b,'duplicates':_0xd5a505};}})[_0xc5ff('0x2b')](respondWithResult(_0x401300,0xc9))['catch'](handleError(_0x401300,null));};exports[_0xc5ff('0xbb')]=function(_0x537ad8,_0x4d55d4,_0x1e713c){var _0x12d914;return db[_0xc5ff('0x88')][_0xc5ff('0x30')]()[_0xc5ff('0x2b')](function(_0x1c2b78){return db['CmContact'][_0xc5ff('0x54')]({'where':{'id':_0x537ad8[_0xc5ff('0x92')]['id']},'include':[{'model':db['Tag'],'as':_0xc5ff('0x8f'),'attributes':['id',_0xc5ff('0x46'),_0xc5ff('0x47')],'required':_0x537ad8[_0xc5ff('0x3c')]['tag']?!![]:![]}],'attributes':_[_0xc5ff('0x31')](_0x1c2b78)});})['then'](function(_0x39836b){_0x12d914=_0x39836b[_0xc5ff('0x9d')]({'plain':!![]});var _0x2babf4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x39836b&&_0x39836b[_0xc5ff('0x6a')]){if(_0x39836b[_0xc5ff('0x6a')]){_0x2babf4[_0xc5ff('0x42')][_0xc5ff('0xbc')][_0xc5ff('0x33')]({'ListId':{'$ne':_0x39836b['ListId']}});}}return db[_0xc5ff('0x34')][_0xc5ff('0x96')](_0x2babf4);})['then'](function(_0xc09f){return _[_0xc5ff('0xbd')](_0x12d914,_['map'](_0xc09f,function(_0x415101){return util[_0xc5ff('0xbe')]('cf_%d',_0x415101['id']);}));})[_0xc5ff('0x2b')](handleEntityNotFound(_0x4d55d4,null))[_0xc5ff('0x2b')](respondWithResult(_0x4d55d4,null))[_0xc5ff('0x93')](handleError(_0x4d55d4,null));};exports[_0xc5ff('0x2a')]=function(_0x264264,_0x10203e){var _0x25ba7f;if(_0x264264['body']['id']){delete _0x264264['body']['id'];}return db['CmContact']['find']({'where':{'id':_0x264264[_0xc5ff('0x92')]['id']}})[_0xc5ff('0x2b')](handleEntityNotFound(_0x10203e,null))[_0xc5ff('0x2b')](saveUpdates(_0x264264['body'],null))[_0xc5ff('0x2b')](function(_0x3ed0f1){_0x25ba7f=_0x3ed0f1;var _0x2c5941={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3ed0f1&&_0x3ed0f1['ListId']){if(_0x3ed0f1['ListId']){_0x2c5941[_0xc5ff('0x42')][_0xc5ff('0xbc')][_0xc5ff('0x33')]({'ListId':{'$ne':_0x3ed0f1[_0xc5ff('0x6a')]}});}}return db[_0xc5ff('0x34')][_0xc5ff('0x96')](_0x2c5941);})['then'](function(_0x142279){if(_0x142279){return _[_0xc5ff('0xbd')](_[_0xc5ff('0xbf')](_0x264264['body'],function(_0x33d203,_0x42e04b){return _[_0xc5ff('0xc0')](_0x42e04b,_0xc5ff('0x37'));}),_[_0xc5ff('0x58')](_0x142279,function(_0x41acf1){return util[_0xc5ff('0xbe')](_0xc5ff('0xc1'),_0x41acf1['id']);}));}})[_0xc5ff('0x2b')](function(_0x1c9522){if(_0x1c9522&&!_[_0xc5ff('0x69')](_0x1c9522)){var _0x58b466=squel[_0xc5ff('0x2a')]()[_0xc5ff('0xc2')](_0xc5ff('0xc3'))['setFields'](_0x1c9522)[_0xc5ff('0x42')](_0xc5ff('0xc4'),_0x264264[_0xc5ff('0x92')]['id'])['toParam']();return db[_0xc5ff('0x85')][_0xc5ff('0x3c')](_0x58b466[_0xc5ff('0x63')],{'replacements':_0x58b466['values']});}})['then'](function(){if(_0x264264[_0xc5ff('0x9c')][_0xc5ff('0xc5')]&&_0x25ba7f){return db['CmHopper'][_0xc5ff('0x2a')]({'phone':_0x264264[_0xc5ff('0x9c')][_0xc5ff('0xc5')]},{'where':{'ContactId':_0x25ba7f['id']}});}})[_0xc5ff('0x2b')](function(){return _0x25ba7f;})[_0xc5ff('0x2b')](respondWithResult(_0x10203e,null))['catch'](handleError(_0x10203e,null));};exports['getTags']=function(_0x17036e,_0x51396e,_0x39027a){var _0x4ae159={};var _0x20b22f={};var _0x3282ae;var _0x5953be;return db['CmContact'][_0xc5ff('0x35')]({'where':{'id':_0x17036e[_0xc5ff('0x92')]['id']}})[_0xc5ff('0x2b')](handleEntityNotFound(_0x51396e,null))[_0xc5ff('0x2b')](function(_0x48f887){if(_0x48f887){_0x3282ae=_0x48f887;_0x20b22f[_0xc5ff('0x3b')]=_['keys'](db['Tag']['rawAttributes']);_0x20b22f[_0xc5ff('0x3c')]=_['keys'](_0x17036e[_0xc5ff('0x3c')]);_0x20b22f[_0xc5ff('0xc6')]=_['intersection'](_0x20b22f['model'],_0x20b22f[_0xc5ff('0x3c')]);_0x4ae159[_0xc5ff('0x3e')]=_['intersection'](_0x20b22f[_0xc5ff('0x3b')],qs[_0xc5ff('0x89')](_0x17036e[_0xc5ff('0x3c')][_0xc5ff('0x89')]));_0x4ae159['attributes']=_0x4ae159['attributes'][_0xc5ff('0x32')]?_0x4ae159[_0xc5ff('0x3e')]:_0x20b22f[_0xc5ff('0x3b')];_0x4ae159['order']=qs[_0xc5ff('0x41')](_0x17036e[_0xc5ff('0x3c')][_0xc5ff('0x41')]);_0x4ae159[_0xc5ff('0x42')]=qs[_0xc5ff('0xc6')](_['pick'](_0x17036e[_0xc5ff('0x3c')],_0x20b22f[_0xc5ff('0xc6')]));if(_0x17036e[_0xc5ff('0x3c')]['filter']){_0x4ae159['where']=_[_0xc5ff('0x9b')](_0x4ae159[_0xc5ff('0x42')],{'$or':_[_0xc5ff('0x58')](_0x4ae159[_0xc5ff('0x3e')],function(_0x31ca93){var _0x3ec136={};_0x3ec136[_0x31ca93]={'$like':'%'+_0x17036e[_0xc5ff('0x3c')][_0xc5ff('0x66')]+'%'};return _0x3ec136;})});}_0x4ae159=_['merge']({},_0x4ae159,_0x17036e[_0xc5ff('0xc7')]);return _0x3282ae[_0xc5ff('0xc8')](_0x4ae159);}})[_0xc5ff('0x2b')](function(_0x1ca053){if(_0x1ca053){_0x5953be=_0x1ca053[_0xc5ff('0x32')];if(!_0x17036e[_0xc5ff('0x3c')]['hasOwnProperty'](_0xc5ff('0x3f'))){_0x4ae159[_0xc5ff('0x24')]=qs[_0xc5ff('0x24')](_0x17036e[_0xc5ff('0x3c')]['limit']);_0x4ae159[_0xc5ff('0x23')]=qs[_0xc5ff('0x23')](_0x17036e[_0xc5ff('0x3c')]['offset']);}return _0x3282ae[_0xc5ff('0xc8')](_0x4ae159);}})['then'](function(_0x4ee0cd){if(_0x4ee0cd){return _0x4ee0cd?{'count':_0x5953be,'rows':_0x4ee0cd}:null;}})[_0xc5ff('0x2b')](respondWithResult(_0x51396e,null))['catch'](handleError(_0x51396e,null));};exports[_0xc5ff('0xc9')]=function(_0x4daa96,_0x230e4d,_0x2f75d8){if(_0x4daa96[_0xc5ff('0x9c')]['id']){delete _0x4daa96[_0xc5ff('0x9c')]['id'];}return db[_0xc5ff('0x88')][_0xc5ff('0x35')]({'where':{'id':_0x4daa96['params']['id']}})['then'](handleEntityNotFound(_0x230e4d,null))[_0xc5ff('0x2b')](function(_0x2cce1f){if(_0x2cce1f){return _0x2cce1f['setTags'](_0x4daa96['body']['ids']||[]);}return null;})[_0xc5ff('0x2b')](respondWithResult(_0x230e4d,null))['catch'](handleError(_0x230e4d,null));};exports[_0xc5ff('0xca')]=function(_0x29341c,_0x412587,_0x31b33f){var _0x3d0553={'raw':![],'where':{}};var _0x4e1773={};var _0x504034={'count':0x0,'rows':[]};return db[_0xc5ff('0x88')]['findOne']({'where':{'id':_0x29341c[_0xc5ff('0x92')]['id']}})['then'](handleEntityNotFound(_0x412587,null))['then'](function(_0x13a558){if(_0x13a558){_0x4e1773[_0xc5ff('0x3b')]=_[_0xc5ff('0x31')](db[_0xc5ff('0xcb')][_0xc5ff('0xcc')]);_0x4e1773['query']=_[_0xc5ff('0x31')](_0x29341c[_0xc5ff('0x3c')]);_0x4e1773[_0xc5ff('0xc6')]=_[_0xc5ff('0x3d')](_0x4e1773[_0xc5ff('0x3b')],_0x4e1773[_0xc5ff('0x3c')]);_0x3d0553[_0xc5ff('0x3e')]=_['intersection'](_0x4e1773[_0xc5ff('0x3b')],qs[_0xc5ff('0x89')](_0x29341c[_0xc5ff('0x3c')]['fields']));_0x3d0553[_0xc5ff('0x3e')]=_0x3d0553['attributes'][_0xc5ff('0x32')]?_0x3d0553[_0xc5ff('0x3e')]:_0x4e1773[_0xc5ff('0x3b')];if(!_0x29341c[_0xc5ff('0x3c')]['hasOwnProperty'](_0xc5ff('0x3f'))){_0x3d0553[_0xc5ff('0x24')]=qs[_0xc5ff('0x24')](_0x29341c['query'][_0xc5ff('0x24')]);_0x3d0553[_0xc5ff('0x23')]=qs[_0xc5ff('0x23')](_0x29341c['query']['offset']);}_0x3d0553['order']=qs[_0xc5ff('0x41')](_0x29341c[_0xc5ff('0x3c')][_0xc5ff('0x41')]);_0x3d0553[_0xc5ff('0x42')]=qs['filters'](_[_0xc5ff('0x43')](_0x29341c[_0xc5ff('0x3c')],_0x4e1773['filters']));_0x3d0553[_0xc5ff('0x42')][_0xc5ff('0xcd')]=_0x13a558['id'];if(_0x29341c[_0xc5ff('0x3c')][_0xc5ff('0x66')]){_0x3d0553[_0xc5ff('0x42')]=_[_0xc5ff('0x9b')](_0x3d0553[_0xc5ff('0x42')],{'$or':_[_0xc5ff('0x58')](_0x3d0553[_0xc5ff('0x3e')],function(_0x11ecf8){var _0x5e49e5={};_0x5e49e5[_0x11ecf8]={'$like':'%'+_0x29341c[_0xc5ff('0x3c')][_0xc5ff('0x66')]+'%'};return _0x5e49e5;})});}_0x3d0553=_[_0xc5ff('0x9b')]({},_0x3d0553,_0x29341c['options']);return db[_0xc5ff('0xcb')]['count']({'where':_0x3d0553[_0xc5ff('0x42')]})['then'](function(_0x3323e1){_0x504034[_0xc5ff('0x22')]=_0x3323e1;if(_0x29341c[_0xc5ff('0x3c')][_0xc5ff('0xce')]){_0x3d0553['include']=[{'all':!![]}];}return db[_0xc5ff('0xcb')][_0xc5ff('0x96')](_0x3d0553);})['then'](function(_0x27599e){_0x504034[_0xc5ff('0x90')]=_0x27599e;return _0x504034;});}})['then'](respondWithFilteredResult(_0x412587,_0x3d0553))['catch'](handleError(_0x412587,null));};exports['getHopperHistories']=function(_0x1c15cd,_0x8bcc71,_0x4a78c5){var _0x294941={'raw':!![],'where':{}};var _0x1b9cf6={};var _0x1d4661={'count':0x0,'rows':[]};return db['CmContact'][_0xc5ff('0x35')]({'where':{'id':_0x1c15cd[_0xc5ff('0x92')]['id']}})[_0xc5ff('0x2b')](handleEntityNotFound(_0x8bcc71,null))[_0xc5ff('0x2b')](function(_0x5b916e){if(_0x5b916e){_0x1b9cf6['model']=_[_0xc5ff('0x31')](db[_0xc5ff('0xaf')][_0xc5ff('0xcc')]);_0x1b9cf6[_0xc5ff('0x3c')]=_[_0xc5ff('0x31')](_0x1c15cd[_0xc5ff('0x3c')]);_0x1b9cf6[_0xc5ff('0xc6')]=_[_0xc5ff('0x3d')](_0x1b9cf6[_0xc5ff('0x3b')],_0x1b9cf6[_0xc5ff('0x3c')]);_0x294941[_0xc5ff('0x3e')]=_[_0xc5ff('0x3d')](_0x1b9cf6['model'],qs[_0xc5ff('0x89')](_0x1c15cd['query']['fields']));_0x294941[_0xc5ff('0x3e')]=_0x294941['attributes']['length']?_0x294941[_0xc5ff('0x3e')]:_0x1b9cf6['model'];if(!_0x1c15cd['query'][_0xc5ff('0x65')](_0xc5ff('0x3f'))){_0x294941[_0xc5ff('0x24')]=qs['limit'](_0x1c15cd[_0xc5ff('0x3c')]['limit']);_0x294941[_0xc5ff('0x23')]=qs['offset'](_0x1c15cd['query'][_0xc5ff('0x23')]);}_0x294941['order']=qs[_0xc5ff('0x41')](_0x1c15cd[_0xc5ff('0x3c')][_0xc5ff('0x41')]);_0x294941[_0xc5ff('0x42')]=qs[_0xc5ff('0xc6')](_[_0xc5ff('0x43')](_0x1c15cd['query'],_0x1b9cf6['filters']));_0x294941['where'][_0xc5ff('0xcd')]=_0x5b916e['id'];if(_0x1c15cd[_0xc5ff('0x3c')][_0xc5ff('0x66')]){_0x294941[_0xc5ff('0x42')]=_[_0xc5ff('0x9b')](_0x294941[_0xc5ff('0x42')],{'$or':_[_0xc5ff('0x58')](_0x294941[_0xc5ff('0x3e')],function(_0x1c90b1){var _0x24dd97={};_0x24dd97[_0x1c90b1]={'$like':'%'+_0x1c15cd[_0xc5ff('0x3c')][_0xc5ff('0x66')]+'%'};return _0x24dd97;})});}_0x294941=_[_0xc5ff('0x9b')]({},_0x294941,_0x1c15cd[_0xc5ff('0xc7')]);return db['CmHopperHistory'][_0xc5ff('0x22')]({'where':_0x294941[_0xc5ff('0x42')]})[_0xc5ff('0x2b')](function(_0x23c7e3){_0x1d4661[_0xc5ff('0x22')]=_0x23c7e3;if(_0x1c15cd[_0xc5ff('0x3c')][_0xc5ff('0xce')]){_0x294941[_0xc5ff('0xcf')]=[{'all':!![]}];}return db[_0xc5ff('0xaf')]['findAll'](_0x294941);})['then'](function(_0x235453){_0x1d4661[_0xc5ff('0x90')]=_0x235453;return _0x1d4661;});}})[_0xc5ff('0x2b')](respondWithFilteredResult(_0x8bcc71,_0x294941))[_0xc5ff('0x93')](handleError(_0x8bcc71,null));};exports[_0xc5ff('0xd0')]=function(_0x2276b4,_0x5fc29a,_0x360745){var _0x3c4aef={'raw':!![],'where':{}};var _0x4f94b3={};var _0x2a4390={'count':0x0,'rows':[]};return db[_0xc5ff('0x88')][_0xc5ff('0x35')]({'where':{'id':_0x2276b4[_0xc5ff('0x92')]['id']}})[_0xc5ff('0x2b')](handleEntityNotFound(_0x5fc29a,null))[_0xc5ff('0x2b')](function(_0x1bac71){if(_0x1bac71){_0x4f94b3[_0xc5ff('0x3b')]=_[_0xc5ff('0x31')](db[_0xc5ff('0xae')][_0xc5ff('0xcc')]);_0x4f94b3['query']=_[_0xc5ff('0x31')](_0x2276b4['query']);_0x4f94b3[_0xc5ff('0xc6')]=_[_0xc5ff('0x3d')](_0x4f94b3[_0xc5ff('0x3b')],_0x4f94b3['query']);_0x3c4aef[_0xc5ff('0x3e')]=_[_0xc5ff('0x3d')](_0x4f94b3[_0xc5ff('0x3b')],qs['fields'](_0x2276b4[_0xc5ff('0x3c')][_0xc5ff('0x89')]));_0x3c4aef[_0xc5ff('0x3e')]=_0x3c4aef[_0xc5ff('0x3e')]['length']?_0x3c4aef[_0xc5ff('0x3e')]:_0x4f94b3[_0xc5ff('0x3b')];if(!_0x2276b4[_0xc5ff('0x3c')][_0xc5ff('0x65')](_0xc5ff('0x3f'))){_0x3c4aef[_0xc5ff('0x24')]=qs['limit'](_0x2276b4[_0xc5ff('0x3c')][_0xc5ff('0x24')]);_0x3c4aef['offset']=qs[_0xc5ff('0x23')](_0x2276b4['query'][_0xc5ff('0x23')]);}_0x3c4aef[_0xc5ff('0x40')]=qs['sort'](_0x2276b4[_0xc5ff('0x3c')][_0xc5ff('0x41')]);_0x3c4aef['where']=qs[_0xc5ff('0xc6')](_['pick'](_0x2276b4[_0xc5ff('0x3c')],_0x4f94b3[_0xc5ff('0xc6')]));_0x3c4aef[_0xc5ff('0x42')][_0xc5ff('0xcd')]=_0x1bac71['id'];if(_0x2276b4[_0xc5ff('0x3c')]['filter']){_0x3c4aef[_0xc5ff('0x42')]=_['merge'](_0x3c4aef[_0xc5ff('0x42')],{'$or':_[_0xc5ff('0x58')](_0x3c4aef[_0xc5ff('0x3e')],function(_0x478000){var _0x39c7f1={};_0x39c7f1[_0x478000]={'$like':'%'+_0x2276b4[_0xc5ff('0x3c')]['filter']+'%'};return _0x39c7f1;})});}_0x3c4aef=_['merge']({},_0x3c4aef,_0x2276b4[_0xc5ff('0xc7')]);return db['CmHopperFinal'][_0xc5ff('0x22')]({'where':_0x3c4aef[_0xc5ff('0x42')]})['then'](function(_0x57310c){_0x2a4390[_0xc5ff('0x22')]=_0x57310c;if(_0x2276b4['query'][_0xc5ff('0xce')]){_0x3c4aef[_0xc5ff('0xcf')]=[{'all':!![]}];}return db[_0xc5ff('0xae')][_0xc5ff('0x96')](_0x3c4aef);})[_0xc5ff('0x2b')](function(_0x1e9107){_0x2a4390[_0xc5ff('0x90')]=_0x1e9107;return _0x2a4390;});}})[_0xc5ff('0x2b')](respondWithFilteredResult(_0x5fc29a,_0x3c4aef))[_0xc5ff('0x93')](handleError(_0x5fc29a,null));};exports['getJscriptySessions']=function(_0x173cd3,_0x13afc1,_0x510bd6){var _0x4aeb5b={'raw':!![],'where':{}};var _0x24fbf6={};var _0x1d8fec={'count':0x0,'rows':[]};return db[_0xc5ff('0x88')][_0xc5ff('0x35')]({'where':{'id':_0x173cd3['params']['id']}})['then'](handleEntityNotFound(_0x13afc1,null))['then'](function(_0x3b7a31){if(_0x3b7a31){_0x24fbf6['model']=_['keys'](db[_0xc5ff('0xb5')][_0xc5ff('0xcc')]);_0x24fbf6[_0xc5ff('0x3c')]=_[_0xc5ff('0x31')](_0x173cd3[_0xc5ff('0x3c')]);_0x24fbf6[_0xc5ff('0xc6')]=_['intersection'](_0x24fbf6['model'],_0x24fbf6[_0xc5ff('0x3c')]);_0x4aeb5b['attributes']=_[_0xc5ff('0x3d')](_0x24fbf6[_0xc5ff('0x3b')],qs[_0xc5ff('0x89')](_0x173cd3[_0xc5ff('0x3c')]['fields']));_0x4aeb5b['attributes']=_0x4aeb5b[_0xc5ff('0x3e')][_0xc5ff('0x32')]?_0x4aeb5b[_0xc5ff('0x3e')]:_0x24fbf6[_0xc5ff('0x3b')];if(!_0x173cd3[_0xc5ff('0x3c')][_0xc5ff('0x65')](_0xc5ff('0x3f'))){_0x4aeb5b['limit']=qs[_0xc5ff('0x24')](_0x173cd3[_0xc5ff('0x3c')]['limit']);_0x4aeb5b[_0xc5ff('0x23')]=qs[_0xc5ff('0x23')](_0x173cd3[_0xc5ff('0x3c')]['offset']);}_0x4aeb5b[_0xc5ff('0x40')]=qs['sort'](_0x173cd3['query'][_0xc5ff('0x41')]);_0x4aeb5b['where']=qs[_0xc5ff('0xc6')](_[_0xc5ff('0x43')](_0x173cd3[_0xc5ff('0x3c')],_0x24fbf6[_0xc5ff('0xc6')]));_0x4aeb5b['where'][_0xc5ff('0xcd')]=_0x3b7a31['id'];if(_0x173cd3[_0xc5ff('0x3c')][_0xc5ff('0x66')]){_0x4aeb5b[_0xc5ff('0x42')]=_[_0xc5ff('0x9b')](_0x4aeb5b[_0xc5ff('0x42')],{'$or':_[_0xc5ff('0x58')](_0x4aeb5b[_0xc5ff('0x3e')],function(_0x5c0e56){var _0x5233c1={};_0x5233c1[_0x5c0e56]={'$like':'%'+_0x173cd3[_0xc5ff('0x3c')]['filter']+'%'};return _0x5233c1;})});}_0x4aeb5b=_[_0xc5ff('0x9b')]({},_0x4aeb5b,_0x173cd3[_0xc5ff('0xc7')]);return db['JscriptySessionReport']['count']({'where':_0x4aeb5b[_0xc5ff('0x42')]})[_0xc5ff('0x2b')](function(_0x174ad0){_0x1d8fec['count']=_0x174ad0;if(_0x173cd3[_0xc5ff('0x3c')][_0xc5ff('0xce')]){_0x4aeb5b['include']=[{'all':!![]}];}return db[_0xc5ff('0xb5')][_0xc5ff('0x96')](_0x4aeb5b);})[_0xc5ff('0x2b')](function(_0xd1db35){_0x1d8fec[_0xc5ff('0x90')]=_0xd1db35;return _0x1d8fec;});}})['then'](respondWithFilteredResult(_0x13afc1,_0x4aeb5b))[_0xc5ff('0x93')](handleError(_0x13afc1,null));};exports['uploadCsv']=function(_0x289c89,_0x33acaf,_0x4cf31d){try{if(!_0x289c89[_0xc5ff('0x9c')][_0xc5ff('0x6a')]){throw new Error(_0xc5ff('0xd1'));}if(!_0x289c89[_0xc5ff('0x9c')][_0xc5ff('0xd2')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x289c89[_0xc5ff('0x9c')][_0xc5ff('0xd3')]){throw new Error(_0xc5ff('0xd4'));}if(!_0x289c89[_0xc5ff('0x9c')]['socket_timestamp']){throw new Error(_0xc5ff('0xd5'));}var _0x1cbda4=_0x289c89['body'][_0xc5ff('0xd2')][_0xc5ff('0x57')](',');var _0x327275=_0x289c89['body'][_0xc5ff('0xd3')][_0xc5ff('0x57')](',');if(!_0x1cbda4['length']||!_0x327275[_0xc5ff('0x32')]||_0x1cbda4[_0xc5ff('0x32')]!==_0x327275[_0xc5ff('0x32')]){throw new Error(_0xc5ff('0xd6'));}_0x289c89['body'][_0xc5ff('0x89')]=_[_0xc5ff('0xd7')](_0x1cbda4,_0x327275);if(!_0x289c89[_0xc5ff('0x9c')]['fields'][_0xc5ff('0xc5')]){throw new Error(_0xc5ff('0xd8'));}if(!_0x289c89['body'][_0xc5ff('0x89')][_0xc5ff('0xd9')]){throw new Error(_0xc5ff('0xda'));}var _0x50c134=path[_0xc5ff('0x9f')](config[_0xc5ff('0xdb')],_0xc5ff('0xdc'),_0x289c89[_0xc5ff('0xdd')]['filename']);fs['chmodSync'](_0x50c134,parseInt(_0xc5ff('0xde'),0x8));var _0x2ef344=require(_0xc5ff('0xdf'))[_0xc5ff('0xe0')](path[_0xc5ff('0x9f')](__dirname,_0xc5ff('0xe1')),[_0x50c134,_0x289c89[_0xc5ff('0x9c')]['binding_keys'],_0x289c89[_0xc5ff('0x9c')]['binding_values'],_0x289c89[_0xc5ff('0x9c')]['ListId'],_0x289c89[_0xc5ff('0x9c')][_0xc5ff('0xe2')],_0x289c89[_0xc5ff('0x9c')]['duplicates'],_0x289c89['body'][_0xc5ff('0xe3')]]);return _0x33acaf['status'](0xc8)['json']({'message':_0xc5ff('0xe4'),'pid':_0x2ef344[_0xc5ff('0xe5')]});}catch(_0x55d421){return _0x33acaf[_0xc5ff('0x1f')](0x1f4)[_0xc5ff('0x2e')](_0x55d421);}};exports[_0xc5ff('0xe6')]=function(_0x3d72f2,_0x1774b4,_0x22146d){var _0xf3f1a9=fs['createReadStream'](_0x3d72f2[_0xc5ff('0xdd')][_0xc5ff('0x9')]);Papa['parse'](_0xf3f1a9,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x368691){return _0x1774b4[_0xc5ff('0x1f')](0xc8)[_0xc5ff('0x21')]({'file':_0x3d72f2[_0xc5ff('0xdd')],'fields':_0x368691[_0xc5ff('0xe7')][_0xc5ff('0x89')]});}});};exports['import']=function(_0x1f92a4,_0x54d810,_0x382da2){return db['User'][_0xc5ff('0x96')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc5ff('0xe8')}})[_0xc5ff('0x2b')](function(_0x14a8a5){var _0x26b10f=![];if(!_0x1f92a4[_0xc5ff('0x9c')][_0xc5ff('0x6a')]){throw new Error('No\x20ListId\x20specified');}if(!_0x1f92a4[_0xc5ff('0x9c')][_0xc5ff('0xe9')][_0xc5ff('0xc5')]){throw new Error(_0xc5ff('0xd8'));}if(!_0x1f92a4[_0xc5ff('0x9c')][_0xc5ff('0xe9')][_0xc5ff('0xd9')]){throw new Error(_0xc5ff('0xda'));}if(!_0x1f92a4[_0xc5ff('0x9c')][_0xc5ff('0xe3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x11d0a5=require(_0xc5ff('0xdf'))[_0xc5ff('0xe0')](path['join'](__dirname,_0xc5ff('0xea')),[_0x1f92a4[_0xc5ff('0x92')]['id'],JSON['stringify'](_0x1f92a4[_0xc5ff('0x9c')]),JSON[_0xc5ff('0xeb')](_0x14a8a5)]);_0x11d0a5['on'](_0xc5ff('0xec'),function(_0x57a5e8){_0x26b10f=!![];return _0x54d810[_0xc5ff('0x1f')](0xc8)[_0xc5ff('0x21')]({'message':_0xc5ff('0xed'),'pid':_0x11d0a5[_0xc5ff('0xe5')]});});_0x11d0a5['on'](_0xc5ff('0xee'),function(_0x4dc3ce){if(_0x4dc3ce&&!_0x26b10f){return _0x54d810['status'](0x1f4)['json']({'message':_0xc5ff('0xef'),'pid':_0x11d0a5[_0xc5ff('0xe5')]});}});})[_0xc5ff('0x93')](handleError(_0x54d810,null));};
\ No newline at end of file
+var _0x5f07=['message','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','end','status','json','count','offset','set','Content-Range','reject','save','then','name','send','index','keys','length','startsWith','cf_','push','CmCustomField','findOne','fieldType','query','filters','model','attributes','fields','hasOwnProperty','limit','sort','where','pick','select','field','color','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','conditions','find','split','forEach','union','User','and','value','datetime','castTo','buildExpression','type','text','start','map','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','QueryTypes','SELECT','clone','c.id','order','DESC','having','resolve','some','user','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','catch','destroy','params','describe','CmContact','tags','columnName','displayName','findAll','alias','custom','values','body','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','info','create','ChatInteraction','ChatMessage','update','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','duplicates','$or','findOrCreate','spread','Tags','get','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','Tag','rawAttributes','intersection','nolimit','setTags','ids','getHoppers','ContactId','options','includeAll','include','rows','getHopperHistories','getHopperFinals','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','pid','upload','createReadStream','parse','meta','import','agent','binding','firstName','../../components/import/cm/csv2','stringify'];(function(_0x1621c5,_0x2c944c){var _0x33610a=function(_0x3d7bd0){while(--_0x3d7bd0){_0x1621c5['push'](_0x1621c5['shift']());}};_0x33610a(++_0x2c944c);}(_0x5f07,0x1d4));var _0x75f0=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x5f07[_0x1fc122];return _0xa2cb13;};'use strict';var pdf=require(_0x75f0('0x0'));var emlformat=require(_0x75f0('0x1'));var rimraf=require(_0x75f0('0x2'));var zipdir=require(_0x75f0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75f0('0x4'));var moment=require(_0x75f0('0x5'));var BPromise=require(_0x75f0('0x6'));var Mustache=require('mustache');var util=require(_0x75f0('0x7'));var path=require(_0x75f0('0x8'));var sox=require(_0x75f0('0x9'));var csv=require(_0x75f0('0xa'));var ejs=require(_0x75f0('0xb'));var fs=require('fs');var _=require(_0x75f0('0xc'));var squel=require(_0x75f0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x75f0('0xe'));var Redis=require('ioredis');var authService=require(_0x75f0('0xf'));var qs=require(_0x75f0('0x10'));var as=require(_0x75f0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75f0('0x12'))(_0x75f0('0x13'));var utils=require(_0x75f0('0x14'));var config=require('../../config/environment');var db=require(_0x75f0('0x15'))['db'];config[_0x75f0('0x16')]=_[_0x75f0('0x17')](config['redis'],{'host':_0x75f0('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75f0('0x16')]));require(_0x75f0('0x19'))[_0x75f0('0x1a')](socket);function respondWithStatusCode(_0x6fb61b,_0x519864){_0x519864=_0x519864||0xcc;return function(_0x26376c){if(_0x26376c){return _0x6fb61b['sendStatus'](_0x519864);}return _0x6fb61b['status'](_0x519864)[_0x75f0('0x1b')]();};}function respondWithResult(_0x590646,_0x3a5d1f){_0x3a5d1f=_0x3a5d1f||0xc8;return function(_0x29fe9e){if(_0x29fe9e){return _0x590646[_0x75f0('0x1c')](_0x3a5d1f)[_0x75f0('0x1d')](_0x29fe9e);}};}function respondWithFilteredResult(_0x52ab8b,_0x2443aa){return function(_0x154b2f){if(_0x154b2f){var _0x5f4c7d=_0x154b2f[_0x75f0('0x1e')],_0x303167=_0x2443aa['offset'],_0x3ce7e3=_0x2443aa[_0x75f0('0x1f')]+_0x2443aa['limit'],_0x38e0fe;if(_0x3ce7e3>=_0x5f4c7d){_0x3ce7e3=_0x5f4c7d;_0x38e0fe=0xc8;}else{_0x38e0fe=0xce;}_0x52ab8b[_0x75f0('0x1c')](_0x38e0fe);return _0x52ab8b[_0x75f0('0x20')](_0x75f0('0x21'),_0x303167+'-'+_0x3ce7e3+'/'+_0x5f4c7d)[_0x75f0('0x1d')](_0x154b2f);}return null;};}function patchUpdates(_0xe7e9e8){return function(_0x3046b5){try{jsonpatch['apply'](_0x3046b5,_0xe7e9e8,!![]);}catch(_0x545fe8){return BPromise[_0x75f0('0x22')](_0x545fe8);}return _0x3046b5[_0x75f0('0x23')]();};}function saveUpdates(_0x52b8a9,_0xfbe17b){return function(_0x19da03){if(_0x19da03){return _0x19da03['update'](_0x52b8a9)[_0x75f0('0x24')](function(_0x591681){return _0x591681;});}return null;};}function removeEntity(_0x569b35,_0x50a482){return function(_0x1300f1){if(_0x1300f1){return _0x1300f1['destroy']()[_0x75f0('0x24')](function(){_0x569b35[_0x75f0('0x1c')](0xcc)[_0x75f0('0x1b')]();});}};}function handleEntityNotFound(_0x40f246,_0x3e8eda){return function(_0x34cc45){if(!_0x34cc45){_0x40f246['sendStatus'](0x194);}return _0x34cc45;};}function handleError(_0x456c20,_0x1ece1e){_0x1ece1e=_0x1ece1e||0x1f4;return function(_0x43a146){logger['error'](_0x43a146['stack']);if(_0x43a146[_0x75f0('0x25')]){delete _0x43a146['name'];}_0x456c20[_0x75f0('0x1c')](_0x1ece1e)[_0x75f0('0x26')](_0x43a146);};}exports[_0x75f0('0x27')]=function(_0x1c6e8f,_0x58540b){var _0x1ba863={},_0x564616={},_0x1a3364={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x75f0('0x24')](function(_0x31503c){var _0x2d1b60=[];for(var _0x1094d4=0x0;_0x1094d4<Object[_0x75f0('0x28')](_0x31503c)[_0x75f0('0x29')];_0x1094d4++){var _0x37a6b7=Object['keys'](_0x31503c)[_0x1094d4];if(_[_0x75f0('0x2a')](_0x37a6b7,_0x75f0('0x2b'))){_0x2d1b60[_0x75f0('0x2c')](db[_0x75f0('0x2d')][_0x75f0('0x2e')]({'where':{'id':_['trimStart'](_0x37a6b7,'cf_')},'raw':!![]}));}}return BPromise['all'](_0x2d1b60)[_0x75f0('0x24')](function(_0x5ef3d7){for(var _0x5a8125=0x0;_0x5a8125<_0x5ef3d7['length'];_0x5a8125++){if(_0x5ef3d7[_0x5a8125]){var _0x54cc1f=_0x75f0('0x2b')+_0x5ef3d7[_0x5a8125]['id'];var _0x1b4fc3=_0x31503c[_0x54cc1f];_0x1b4fc3[_0x75f0('0x2f')]=_0x5ef3d7[_0x5a8125]['type'];}}return _0x31503c;});})['then'](function(_0x2aca2d){_0x564616['model']=_['keys'](_0x2aca2d);_0x564616[_0x75f0('0x30')]=_[_0x75f0('0x28')](_0x1c6e8f[_0x75f0('0x30')]);_0x564616[_0x75f0('0x31')]=_['intersection'](_0x564616[_0x75f0('0x32')],_0x564616[_0x75f0('0x30')]);_0x1ba863[_0x75f0('0x33')]=_['intersection'](_0x564616[_0x75f0('0x32')],qs[_0x75f0('0x34')](_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x34')]));_0x1ba863['attributes']=_0x1ba863[_0x75f0('0x33')][_0x75f0('0x29')]?_0x1ba863[_0x75f0('0x33')]:_0x564616[_0x75f0('0x32')];if(!_0x1c6e8f['query'][_0x75f0('0x35')]('nolimit')){_0x1ba863[_0x75f0('0x36')]=qs[_0x75f0('0x36')](_0x1c6e8f['query']['limit']);_0x1ba863[_0x75f0('0x1f')]=qs[_0x75f0('0x1f')](_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x1f')]);}_0x1ba863['order']=qs[_0x75f0('0x37')](_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x37')]);_0x1ba863[_0x75f0('0x38')]=qs[_0x75f0('0x31')](_[_0x75f0('0x39')](_0x1c6e8f[_0x75f0('0x30')],_0x564616[_0x75f0('0x31')]),_0x2aca2d);var _0x1bb565=[];var _0x5cef38=squel[_0x75f0('0x3a')]()[_0x75f0('0x3b')]('id')['field'](_0x75f0('0x25'))[_0x75f0('0x3b')](_0x75f0('0x3c'))[_0x75f0('0x3d')]('tools_tags');var _0x13ab3d=squel[_0x75f0('0x3a')]()[_0x75f0('0x3d')](_0x75f0('0x3e'),'c')[_0x75f0('0x3f')](_0x75f0('0x40'),'uc',_0x75f0('0x41'))[_0x75f0('0x3f')]('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20c.id')[_0x75f0('0x3f')]('tools_tags','t',_0x75f0('0x42'))[_0x75f0('0x38')](_0x75f0('0x43'));var _0x14f0ed=squel['expr']();var _0x11d452=[];var _0xfab2d3=squel[_0x75f0('0x44')]();var _0x4cd3e2;if(_0x1c6e8f[_0x75f0('0x30')]['search']){_0x4cd3e2=as[_0x75f0('0x45')](_0x1c6e8f[_0x75f0('0x30')]['search']);var _0x54c7ba=_0x4cd3e2['sqlOperator'];for(var _0x19392d=0x0;_0x19392d<_0x4cd3e2[_0x75f0('0x46')][_0x75f0('0x29')];_0x19392d++){var _0x3fa1f3=_0x4cd3e2[_0x75f0('0x46')][_0x19392d];var _0x45eeb3='c';var _0xd91edf=_(_0x2aca2d)['keys']()[_0x75f0('0x47')](function(_0x19ddfb){return _0x19ddfb===_0x3fa1f3[_0x75f0('0x3b')];});if(_0xd91edf)_0xd91edf=_0x2aca2d[_0x3fa1f3[_0x75f0('0x3b')]];if(!_0xd91edf){if(_0x3fa1f3['field']==='Tag'){var _0x460552=_0x3fa1f3['value'][_0x75f0('0x48')](',')['map'](function(_0x2e117e){return Number(_0x2e117e);});_0x460552[_0x75f0('0x49')](function(_0xfdfb1){_0xfab2d3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfdfb1+',%');});_0x11d452=_[_0x75f0('0x4a')](_0x11d452,_0x460552);}else if(_0x3fa1f3[_0x75f0('0x3b')]===_0x75f0('0x4b')){_0x14f0ed[_0x75f0('0x4c')]('uc.UserId\x20=\x20?',_0x3fa1f3[_0x75f0('0x4d')]);}}else{if(_0x3fa1f3[_0x75f0('0x3b')]==='dateOfBirth'||_0xd91edf[_0x75f0('0x2f')]===_0x75f0('0x4e'))_0x3fa1f3[_0x75f0('0x4f')]='DATE';var _0x2e541e=as[_0x75f0('0x50')](_0x45eeb3,_0xd91edf[_0x75f0('0x51')],_0x3fa1f3);_0x14f0ed[_0x54c7ba](_0x2e541e[_0x75f0('0x52')],_0x2e541e[_0x75f0('0x4d')][_0x75f0('0x53')],_0x2e541e[_0x75f0('0x4d')][_0x75f0('0x1b')]);}}}else{var _0x111040=_(Object['keys'](_0x1c6e8f[_0x75f0('0x30')]))[_0x75f0('0x54')](function(_0x4ea997){return _0x2aca2d[_0x75f0('0x35')](_0x4ea997)?_0x4ea997:undefined;})['filter'](function(_0x25afbe){return!_[_0x75f0('0x55')](_0x25afbe);})[_0x75f0('0x4d')]();if(_0x1c6e8f['query']['Contact'])_0x111040['push'](_0x75f0('0x56'));if(!_[_0x75f0('0x57')](_0x111040)){_0x111040[_0x75f0('0x49')](function(_0x25e26a){if(_0x25e26a===_0x75f0('0x58')){_0x13ab3d[_0x75f0('0x38')](_0x75f0('0x59'),[][_0x75f0('0x5a')](_0x1c6e8f['query'][_0x25e26a]));}else if(_0x25e26a==='Contact'){var _0x5b441d='%'+_0x1c6e8f[_0x75f0('0x30')][_0x25e26a]+'%';_0x13ab3d[_0x75f0('0x38')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x5b441d);}else{_0x13ab3d[_0x75f0('0x38')]('c.'+_0x25e26a+'\x20=\x20?',_0x1c6e8f[_0x75f0('0x30')][_0x25e26a]);}});}if(_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x5b')]){_0x11d452=_[_0x75f0('0x5c')](_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x5b')])?_0x1c6e8f[_0x75f0('0x30')]['tag']:new Array(_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x5b')]);_0x11d452[_0x75f0('0x49')](function(_0x50bf9e){_0xfab2d3['or'](_0x75f0('0x5d'),'%,'+_0x50bf9e+',%');});}if(_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x5e')]){var _0x5e08c6=_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x5e')]['replace']('\x5c','\x5c\x5c')[_0x75f0('0x5f')]('\x27\x27',_0x75f0('0x60'));if(_0x5e08c6[_0x75f0('0x48')]('\x20')[_0x75f0('0x29')]>0x1){_0x14f0ed['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x75f0('0x61')](_0x5e08c6),null);}else{if(qs[_0x75f0('0x62')](_0x5e08c6)){_0x14f0ed['or'](_0x75f0('0x63'),_0x5e08c6+'%');_0x14f0ed['or'](_0x75f0('0x64'),_0x5e08c6+'%');_0x14f0ed['or'](_0x75f0('0x65'),_0x5e08c6+'%');_0x14f0ed['or'](_0x75f0('0x66'),_0x5e08c6+'%');}else if(qs['isEmail'](_0x5e08c6)){_0x14f0ed['or'](_0x75f0('0x67'),_0x5e08c6+'%');}else{_0x14f0ed['or'](_0x75f0('0x68'),'%'+_0x5e08c6+'%');_0x14f0ed['or'](_0x75f0('0x69'),'%'+_0x5e08c6+'%');_0x14f0ed['or'](_0x75f0('0x67'),'%'+_0x5e08c6+'%');}}}}_0x13ab3d['where'](_0x14f0ed);_0x13ab3d[_0x75f0('0x6a')]('c.id');var _0x4c97fa={'type':db['Sequelize'][_0x75f0('0x6b')][_0x75f0('0x6c')],'raw':!![]};var _0x1382c4=_0x13ab3d[_0x75f0('0x6d')]()['field'](_0x75f0('0x6e'));if(_0x1ba863[_0x75f0('0x6f')]){_0x1ba863[_0x75f0('0x6f')][_0x75f0('0x49')](function(_0x34c003){_0x13ab3d[_0x75f0('0x6f')]('c.'+_0x34c003[0x0],_0x34c003[0x1]===_0x75f0('0x70')?![]:!![]);});}if(!_[_0x75f0('0x57')](_0x11d452)){_0x13ab3d[_0x75f0('0x71')](_0xfab2d3);_0x1382c4[_0x75f0('0x38')]('t.id\x20IN\x20?',_0x11d452);}BPromise[_0x75f0('0x72')]()[_0x75f0('0x24')](function(){if(_0x4cd3e2&&!_[_0x75f0('0x73')](_0x4cd3e2[_0x75f0('0x46')],['field',_0x75f0('0x4b')])){return _0x1c6e8f[_0x75f0('0x74')]['getLists']({'attributes':['id'],'raw':!![]})[_0x75f0('0x24')](function(_0x13f56e){if(_['isEmpty'](_0x13f56e)){_0x1382c4['where']('c.ListId\x20IS\x20NULL');_0x13ab3d[_0x75f0('0x38')](_0x75f0('0x75'));}else{_0x1382c4['where'](_0x75f0('0x59'),_[_0x75f0('0x54')](_0x13f56e,'id'));_0x13ab3d[_0x75f0('0x38')](_0x75f0('0x59'),_['map'](_0x13f56e,'id'));}});}else{return;}})[_0x75f0('0x24')](function(){db[_0x75f0('0x76')][_0x75f0('0x30')](_0x1382c4[_0x75f0('0x77')](),_0x4c97fa)['then'](function(_0x358a7a){_0x1a3364[_0x75f0('0x1e')]=_0x358a7a['length'];if(_0x1a3364[_0x75f0('0x1e')]===0x0)return[];return db[_0x75f0('0x76')][_0x75f0('0x30')](_0x5cef38[_0x75f0('0x77')](),_0x4c97fa);})[_0x75f0('0x24')](function(_0xcdaec9){_0x1bb565=_[_0x75f0('0x78')](_0xcdaec9,'id');_0x4c97fa=_[_0x75f0('0x79')](_0x4c97fa,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c6e8f[_0x75f0('0x30')][_0x75f0('0x34')]){_0x1ba863[_0x75f0('0x33')][_0x75f0('0x49')](function(_0x912acd){_0x13ab3d[_0x75f0('0x3b')]('c.'+_0x912acd);});}else{_0x13ab3d[_0x75f0('0x3b')](_0x75f0('0x6e'));_0x13ab3d[_0x75f0('0x3b')](_0x75f0('0x7a'));_0x13ab3d['field'](_0x75f0('0x7b'));_0x13ab3d[_0x75f0('0x3b')](_0x75f0('0x7c'));_0x13ab3d[_0x75f0('0x3b')](_0x75f0('0x7d'));_0x13ab3d[_0x75f0('0x3b')](_0x75f0('0x7e'));_0x13ab3d[_0x75f0('0x3b')](_0x75f0('0x7f'));_0x13ab3d[_0x75f0('0x3b')](_0x75f0('0x80'));_0x13ab3d[_0x75f0('0x3b')](_0x75f0('0x81'));_0x13ab3d['field'](_0x75f0('0x82'),_0x75f0('0x83'));}if(_0x1ba863[_0x75f0('0x36')])_0x13ab3d[_0x75f0('0x36')](_0x1ba863[_0x75f0('0x36')]);if(_0x1ba863[_0x75f0('0x1f')])_0x13ab3d['offset'](_0x1ba863[_0x75f0('0x1f')]);return db[_0x75f0('0x76')][_0x75f0('0x30')](_0x13ab3d[_0x75f0('0x77')](),_0x4c97fa);})['then'](function(_0x570379){_0x570379[_0x75f0('0x49')](function(_0x22aa40){if(_0x22aa40[_0x75f0('0x83')]){_0x22aa40['Tags']=[];_0x22aa40[_0x75f0('0x83')]['split'](',')['forEach'](function(_0x3ed7be){_0x22aa40['Tags']['push'](_0x1bb565[_0x3ed7be]);});}delete _0x22aa40['TagIds'];});_0x1a3364['rows']=_0x570379;return _0x1a3364;})[_0x75f0('0x24')](respondWithFilteredResult(_0x58540b,_0x1ba863));});})[_0x75f0('0x84')](handleError(_0x58540b,null));};exports[_0x75f0('0x85')]=function(_0xd83b6f,_0x2bce79){return db['CmContact'][_0x75f0('0x47')]({'where':{'id':_0xd83b6f[_0x75f0('0x86')]['id']}})[_0x75f0('0x24')](handleEntityNotFound(_0x2bce79,null))['then'](removeEntity(_0x2bce79,null))[_0x75f0('0x84')](handleError(_0x2bce79,null));};exports[_0x75f0('0x87')]=function(_0x529d0d,_0x2320eb){return db[_0x75f0('0x88')][_0x75f0('0x87')]()[_0x75f0('0x24')](function(_0x2d94f4){delete _0x2d94f4[_0x75f0('0x89')];for(var _0x2badf7=0x0;_0x2badf7<Object[_0x75f0('0x28')](_0x2d94f4)['length'];_0x2badf7++){var _0x18ac9e=Object[_0x75f0('0x28')](_0x2d94f4)[_0x2badf7];if(!_[_0x75f0('0x2a')](_0x18ac9e,'cf_')){_0x2d94f4[_0x18ac9e][_0x75f0('0x8a')]=_0x18ac9e;_0x2d94f4[_0x18ac9e][_0x75f0('0x8b')]=_0x18ac9e;}}return _0x2d94f4;})[_0x75f0('0x24')](function(_0x11de42){var _0x12b15a={'where':{'$or':[{'ListId':_0x529d0d[_0x75f0('0x30')]['id']},{'ListId':null}]},'raw':!![]};return db['CmCustomField'][_0x75f0('0x8c')](_0x12b15a)[_0x75f0('0x24')](function(_0x51e6d8){for(var _0x352841=0x0;_0x352841<_0x51e6d8[_0x75f0('0x29')];_0x352841++){var _0x184e19=_0x75f0('0x2b')+_0x51e6d8[_0x352841]['id'];_0x11de42[_0x184e19]['columnName']=_0x184e19;_0x11de42[_0x184e19]['displayName']=_0x51e6d8[_0x352841][_0x75f0('0x8d')];_0x11de42[_0x184e19][_0x75f0('0x8e')]={'type':_0x51e6d8[_0x352841][_0x75f0('0x51')],'values':_0x51e6d8[_0x352841][_0x75f0('0x8f')]};}Object['keys'](_0x11de42)['forEach'](function(_0x1475bf){if(!_0x11de42[_0x1475bf][_0x75f0('0x35')](_0x75f0('0x8a'))){delete _0x11de42[_0x1475bf];}});return _0x11de42;});})[_0x75f0('0x24')](respondWithResult(_0x2320eb,null))[_0x75f0('0x84')](handleError(_0x2320eb,null));};exports[_0x75f0('0x79')]=function(_0x3eb699,_0x15bc0d){var _0x1cae53;var _0x3fcf75;var _0x3763dc;if(_0x3eb699[_0x75f0('0x90')]['id']){delete _0x3eb699[_0x75f0('0x90')]['id'];}return db[_0x75f0('0x88')][_0x75f0('0x8c')]({'where':{'id':[_0x3eb699[_0x75f0('0x90')]['to'],_0x3eb699['body'][_0x75f0('0x3d')]]}})['then'](function(_0x216174){if(_0x216174){if(_0x216174['length']!==0x2){return null;}_0x216174[0x0]=_0x216174[0x0]['get']({'plain':!![]});_0x216174[0x1]=_0x216174[0x1]['get']({'plain':!![]});delete _0x216174[0x0]['id'];delete _0x216174[0x1]['id'];return _['mergeWith'](_0x216174[0x0],_0x216174[0x1],function(_0x27fc2a,_0x3120b1){if(Array['isArray'](_0x3120b1)&&!_0x3120b1[_0x75f0('0x29')]){return _0x27fc2a;}else if(!_0x3120b1){return _0x27fc2a;}});}})[_0x75f0('0x24')](handleEntityNotFound(_0x15bc0d,null))[_0x75f0('0x24')](function(_0x1d4d04){if(_0x1d4d04){if(_0x1d4d04['tags']&&_['isArray'](_0x1d4d04[_0x75f0('0x89')])){_0x1d4d04['tags']=_0x1d4d04[_0x75f0('0x89')][_0x75f0('0x91')]();}logger['info'](_0x75f0('0x92'),_0x3eb699['body']['to'],_0x3eb699[_0x75f0('0x90')][_0x75f0('0x3d')]);return db[_0x75f0('0x93')][_0x75f0('0x85')]({'where':{'ContactId':[_0x3eb699[_0x75f0('0x90')]['to'],_0x3eb699[_0x75f0('0x90')][_0x75f0('0x3d')]]}})[_0x75f0('0x24')](function(_0x4dd720){logger['info'](_0x75f0('0x94'),_0x4dd720);return db['CmHopperBlack'][_0x75f0('0x85')]({'where':{'ContactId':[_0x3eb699[_0x75f0('0x90')]['to'],_0x3eb699[_0x75f0('0x90')][_0x75f0('0x3d')]]}})[_0x75f0('0x24')](function(_0xabb14a){logger[_0x75f0('0x95')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0xabb14a);return db[_0x75f0('0x88')][_0x75f0('0x96')](_0x1d4d04);});});}})[_0x75f0('0x24')](function(_0x2e06ea){if(_0x2e06ea){_0x1cae53=_0x2e06ea;_0x3fcf75={'ContactId':_0x1cae53['id']};_0x3763dc={'where':{'ContactId':[_0x3eb699[_0x75f0('0x90')]['to'],_0x3eb699[_0x75f0('0x90')][_0x75f0('0x3d')]]}};return db[_0x75f0('0x97')]['update'](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x98')]['update'](_0x3fcf75,_0x3763dc);}})['then'](function(){if(_0x1cae53){return db['ChatOfflineMessage'][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x9a')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x9b')]['update'](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x9a')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x9b')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x9c')]['update'](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x9d')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x9e')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x9f')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db['OpenchannelInteraction']['update'](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0xa0')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})['then'](function(){if(_0x1cae53){return db[_0x75f0('0xa1')]['update'](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0xa2')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0xa3')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})['then'](function(){if(_0x1cae53){return db[_0x75f0('0xa4')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0xa5')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db['FaxQueueReport'][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0xa6')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})['then'](function(){if(_0x1cae53){return db[_0x75f0('0xa7')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0xa8')][_0x75f0('0x99')](_0x3fcf75,_0x3763dc);}})['then'](function(){if(_0x1cae53){return db['JscriptySessionReport']['update'](_0x3fcf75,_0x3763dc);}})[_0x75f0('0x24')](function(){if(_0x1cae53){return db[_0x75f0('0x88')][_0x75f0('0x85')]({'where':{'id':[_0x3eb699[_0x75f0('0x90')]['to'],_0x3eb699[_0x75f0('0x90')][_0x75f0('0x3d')]]}});}})[_0x75f0('0x24')](function(){if(_0x1cae53){return _0x1cae53;}})[_0x75f0('0x24')](respondWithResult(_0x15bc0d,null))[_0x75f0('0x84')](handleError(_0x15bc0d,null));};exports['create']=function(_0x27f606,_0x1785c2){return db[_0x75f0('0x88')]['describe']()[_0x75f0('0x24')](function(_0x4a9fe6){if(_0x27f606[_0x75f0('0x90')][_0x75f0('0x89')]&&_[_0x75f0('0x5c')](_0x27f606[_0x75f0('0x90')]['tags'])){if(_0x27f606[_0x75f0('0x90')]['tags']['length']){_0x27f606[_0x75f0('0x90')][_0x75f0('0x89')]=_0x27f606[_0x75f0('0x90')][_0x75f0('0x89')][_0x75f0('0x91')](';')+';';}else{_0x27f606[_0x75f0('0x90')][_0x75f0('0x89')]=null;}}else{_0x27f606[_0x75f0('0x90')][_0x75f0('0x89')]=null;}return db[_0x75f0('0x88')][_0x75f0('0x96')](_0x27f606[_0x75f0('0x90')],{'fields':_[_0x75f0('0x28')](_0x4a9fe6),'raw':!![]});})[_0x75f0('0x24')](respondWithResult(_0x1785c2,0xc9))['catch'](handleError(_0x1785c2,null));};exports['bulkCreate']=function(_0x2e8684,_0x3198ae){var _0x3ea643=[];var _0xeced0a=0x0;var _0x3c8c61=0x0;var _0x23704e=0x0;return db[_0x75f0('0x88')][_0x75f0('0x87')]()[_0x75f0('0x24')](function(_0x18b1de){return BPromise['each'](_0x2e8684[_0x75f0('0x90')],function(_0x824b8d){var _0x131246={'where':{'$or':[]},'defaults':_0x824b8d,'fields':_[_0x75f0('0x28')](_0x18b1de),'raw':!![]};if(_0x824b8d[_0x75f0('0xa9')]){for(var _0x591583=0x0;_0x591583<_0x824b8d['duplicates']['length'];_0x591583++){var _0xa65ce2={};_0xa65ce2[_0x824b8d[_0x75f0('0xa9')][_0x591583]]=_0x824b8d[_0x824b8d[_0x75f0('0xa9')][_0x591583]];_0x131246[_0x75f0('0x38')][_0x75f0('0xaa')][_0x75f0('0x2c')](_0xa65ce2);}_0x131246[_0x75f0('0x38')][_0x75f0('0x58')]=_0x824b8d[_0x75f0('0x58')];}return db[_0x75f0('0x88')][_0x75f0('0xab')](_0x131246)[_0x75f0('0xac')](function(_0x168dbe,_0x120d70){if(_0x120d70){_0xeced0a++;}else{_0x23704e++;}})[_0x75f0('0x84')](function(_0x1c6614){console['error'](_0x1c6614);_0x3c8c61++;});});})[_0x75f0('0x24')](function(_0x5c74fd){if(_0x5c74fd){return{'success':_0xeced0a,'failure':_0x3c8c61,'duplicates':_0x23704e};}})[_0x75f0('0x24')](respondWithResult(_0x3198ae,0xc9))[_0x75f0('0x84')](handleError(_0x3198ae,null));};exports['show']=function(_0x54f84e,_0x1d6d97,_0x5bdfd4){var _0x22ffbf;return db['CmContact']['describe']()[_0x75f0('0x24')](function(_0x315a9e){return db['CmContact'][_0x75f0('0x47')]({'where':{'id':_0x54f84e[_0x75f0('0x86')]['id']},'include':[{'model':db['Tag'],'as':_0x75f0('0xad'),'attributes':['id',_0x75f0('0x25'),'color'],'required':_0x54f84e[_0x75f0('0x30')][_0x75f0('0x5b')]?!![]:![]}],'attributes':_[_0x75f0('0x28')](_0x315a9e)});})[_0x75f0('0x24')](function(_0x39aa33){_0x22ffbf=_0x39aa33[_0x75f0('0xae')]({'plain':!![]});var _0x18a723={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x39aa33&&_0x39aa33[_0x75f0('0x58')]){if(_0x39aa33[_0x75f0('0x58')]){_0x18a723[_0x75f0('0x38')][_0x75f0('0xaf')]['push']({'ListId':{'$ne':_0x39aa33['ListId']}});}}return db['CmCustomField'][_0x75f0('0x8c')](_0x18a723);})['then'](function(_0x15d48a){return _[_0x75f0('0xb0')](_0x22ffbf,_[_0x75f0('0x54')](_0x15d48a,function(_0x3244dc){return util[_0x75f0('0xb1')](_0x75f0('0xb2'),_0x3244dc['id']);}));})[_0x75f0('0x24')](handleEntityNotFound(_0x1d6d97,null))[_0x75f0('0x24')](respondWithResult(_0x1d6d97,null))['catch'](handleError(_0x1d6d97,null));};exports[_0x75f0('0x99')]=function(_0x4be1b4,_0x1ec006){var _0x36a4ad;if(_0x4be1b4[_0x75f0('0x90')]['id']){delete _0x4be1b4[_0x75f0('0x90')]['id'];}return db[_0x75f0('0x88')][_0x75f0('0x47')]({'where':{'id':_0x4be1b4[_0x75f0('0x86')]['id']}})[_0x75f0('0x24')](handleEntityNotFound(_0x1ec006,null))[_0x75f0('0x24')](saveUpdates(_0x4be1b4[_0x75f0('0x90')],null))[_0x75f0('0x24')](function(_0x1b5833){_0x36a4ad=_0x1b5833;var _0x35e97f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1b5833&&_0x1b5833['ListId']){if(_0x1b5833['ListId']){_0x35e97f['where'][_0x75f0('0xaf')][_0x75f0('0x2c')]({'ListId':{'$ne':_0x1b5833[_0x75f0('0x58')]}});}}return db['CmCustomField'][_0x75f0('0x8c')](_0x35e97f);})[_0x75f0('0x24')](function(_0x33ebc2){if(_0x33ebc2){return _[_0x75f0('0xb0')](_[_0x75f0('0xb3')](_0x4be1b4[_0x75f0('0x90')],function(_0x27a869,_0x554091){return _[_0x75f0('0x2a')](_0x554091,_0x75f0('0x2b'));}),_['map'](_0x33ebc2,function(_0x449e87){return util[_0x75f0('0xb1')](_0x75f0('0xb2'),_0x449e87['id']);}));}})[_0x75f0('0x24')](function(_0x275f61){if(_0x275f61&&!_[_0x75f0('0x57')](_0x275f61)){var _0x2bdc3e=squel[_0x75f0('0x99')]()[_0x75f0('0xb4')](_0x75f0('0x3e'))[_0x75f0('0xb5')](_0x275f61)[_0x75f0('0x38')](_0x75f0('0xb6'),_0x4be1b4[_0x75f0('0x86')]['id'])[_0x75f0('0xb7')]();return db['sequelize'][_0x75f0('0x30')](_0x2bdc3e[_0x75f0('0x52')],{'replacements':_0x2bdc3e[_0x75f0('0x8f')]});}})[_0x75f0('0x24')](function(){if(_0x4be1b4[_0x75f0('0x90')][_0x75f0('0xb8')]&&_0x36a4ad){return db[_0x75f0('0x93')]['update']({'phone':_0x4be1b4[_0x75f0('0x90')][_0x75f0('0xb8')]},{'where':{'ContactId':_0x36a4ad['id']}});}})['then'](function(){return _0x36a4ad;})[_0x75f0('0x24')](respondWithResult(_0x1ec006,null))[_0x75f0('0x84')](handleError(_0x1ec006,null));};exports[_0x75f0('0xb9')]=function(_0x43ebc6,_0x5de142,_0x1b4d87){var _0x27eb2c={};var _0x103ba0={};var _0x542f55;var _0x1da2d2;return db[_0x75f0('0x88')][_0x75f0('0x2e')]({'where':{'id':_0x43ebc6['params']['id']}})['then'](handleEntityNotFound(_0x5de142,null))[_0x75f0('0x24')](function(_0x19750d){if(_0x19750d){_0x542f55=_0x19750d;_0x103ba0['model']=_[_0x75f0('0x28')](db[_0x75f0('0xba')][_0x75f0('0xbb')]);_0x103ba0['query']=_[_0x75f0('0x28')](_0x43ebc6[_0x75f0('0x30')]);_0x103ba0[_0x75f0('0x31')]=_[_0x75f0('0xbc')](_0x103ba0[_0x75f0('0x32')],_0x103ba0['query']);_0x27eb2c[_0x75f0('0x33')]=_[_0x75f0('0xbc')](_0x103ba0[_0x75f0('0x32')],qs[_0x75f0('0x34')](_0x43ebc6[_0x75f0('0x30')][_0x75f0('0x34')]));_0x27eb2c[_0x75f0('0x33')]=_0x27eb2c[_0x75f0('0x33')][_0x75f0('0x29')]?_0x27eb2c[_0x75f0('0x33')]:_0x103ba0[_0x75f0('0x32')];_0x27eb2c[_0x75f0('0x6f')]=qs[_0x75f0('0x37')](_0x43ebc6[_0x75f0('0x30')][_0x75f0('0x37')]);_0x27eb2c['where']=qs['filters'](_[_0x75f0('0x39')](_0x43ebc6[_0x75f0('0x30')],_0x103ba0['filters']));if(_0x43ebc6['query']['filter']){_0x27eb2c[_0x75f0('0x38')]=_[_0x75f0('0x79')](_0x27eb2c[_0x75f0('0x38')],{'$or':_[_0x75f0('0x54')](_0x27eb2c['attributes'],function(_0x36a584){var _0x99cee9={};_0x99cee9[_0x36a584]={'$like':'%'+_0x43ebc6[_0x75f0('0x30')][_0x75f0('0x5e')]+'%'};return _0x99cee9;})});}_0x27eb2c=_[_0x75f0('0x79')]({},_0x27eb2c,_0x43ebc6['options']);return _0x542f55[_0x75f0('0xb9')](_0x27eb2c);}})[_0x75f0('0x24')](function(_0x59b5a3){if(_0x59b5a3){_0x1da2d2=_0x59b5a3['length'];if(!_0x43ebc6[_0x75f0('0x30')]['hasOwnProperty'](_0x75f0('0xbd'))){_0x27eb2c[_0x75f0('0x36')]=qs[_0x75f0('0x36')](_0x43ebc6[_0x75f0('0x30')][_0x75f0('0x36')]);_0x27eb2c[_0x75f0('0x1f')]=qs[_0x75f0('0x1f')](_0x43ebc6['query'][_0x75f0('0x1f')]);}return _0x542f55[_0x75f0('0xb9')](_0x27eb2c);}})[_0x75f0('0x24')](function(_0x14e825){if(_0x14e825){return _0x14e825?{'count':_0x1da2d2,'rows':_0x14e825}:null;}})[_0x75f0('0x24')](respondWithResult(_0x5de142,null))[_0x75f0('0x84')](handleError(_0x5de142,null));};exports[_0x75f0('0xbe')]=function(_0x35cc8f,_0x2a13a0,_0x346948){if(_0x35cc8f[_0x75f0('0x90')]['id']){delete _0x35cc8f[_0x75f0('0x90')]['id'];}return db[_0x75f0('0x88')][_0x75f0('0x2e')]({'where':{'id':_0x35cc8f[_0x75f0('0x86')]['id']}})[_0x75f0('0x24')](handleEntityNotFound(_0x2a13a0,null))['then'](function(_0x3f16f4){if(_0x3f16f4){return _0x3f16f4[_0x75f0('0xbe')](_0x35cc8f[_0x75f0('0x90')][_0x75f0('0xbf')]||[]);}return null;})[_0x75f0('0x24')](respondWithResult(_0x2a13a0,null))[_0x75f0('0x84')](handleError(_0x2a13a0,null));};exports[_0x75f0('0xc0')]=function(_0x310d6b,_0x175604,_0x4d6ab4){var _0x81e8ed={'raw':![],'where':{}};var _0xbc5c04={};var _0x4fb34b={'count':0x0,'rows':[]};return db[_0x75f0('0x88')][_0x75f0('0x2e')]({'where':{'id':_0x310d6b[_0x75f0('0x86')]['id']}})['then'](handleEntityNotFound(_0x175604,null))[_0x75f0('0x24')](function(_0x7c54cc){if(_0x7c54cc){_0xbc5c04[_0x75f0('0x32')]=_[_0x75f0('0x28')](db[_0x75f0('0x93')]['rawAttributes']);_0xbc5c04['query']=_[_0x75f0('0x28')](_0x310d6b['query']);_0xbc5c04[_0x75f0('0x31')]=_[_0x75f0('0xbc')](_0xbc5c04['model'],_0xbc5c04[_0x75f0('0x30')]);_0x81e8ed['attributes']=_[_0x75f0('0xbc')](_0xbc5c04['model'],qs['fields'](_0x310d6b[_0x75f0('0x30')]['fields']));_0x81e8ed[_0x75f0('0x33')]=_0x81e8ed[_0x75f0('0x33')][_0x75f0('0x29')]?_0x81e8ed[_0x75f0('0x33')]:_0xbc5c04[_0x75f0('0x32')];if(!_0x310d6b[_0x75f0('0x30')][_0x75f0('0x35')](_0x75f0('0xbd'))){_0x81e8ed['limit']=qs[_0x75f0('0x36')](_0x310d6b[_0x75f0('0x30')][_0x75f0('0x36')]);_0x81e8ed[_0x75f0('0x1f')]=qs[_0x75f0('0x1f')](_0x310d6b[_0x75f0('0x30')][_0x75f0('0x1f')]);}_0x81e8ed[_0x75f0('0x6f')]=qs[_0x75f0('0x37')](_0x310d6b['query'][_0x75f0('0x37')]);_0x81e8ed[_0x75f0('0x38')]=qs[_0x75f0('0x31')](_[_0x75f0('0x39')](_0x310d6b[_0x75f0('0x30')],_0xbc5c04[_0x75f0('0x31')]));_0x81e8ed[_0x75f0('0x38')][_0x75f0('0xc1')]=_0x7c54cc['id'];if(_0x310d6b[_0x75f0('0x30')]['filter']){_0x81e8ed['where']=_['merge'](_0x81e8ed['where'],{'$or':_[_0x75f0('0x54')](_0x81e8ed[_0x75f0('0x33')],function(_0x2f0885){var _0x1c42fa={};_0x1c42fa[_0x2f0885]={'$like':'%'+_0x310d6b['query'][_0x75f0('0x5e')]+'%'};return _0x1c42fa;})});}_0x81e8ed=_[_0x75f0('0x79')]({},_0x81e8ed,_0x310d6b[_0x75f0('0xc2')]);return db[_0x75f0('0x93')]['count']({'where':_0x81e8ed['where']})[_0x75f0('0x24')](function(_0xbb163b){_0x4fb34b[_0x75f0('0x1e')]=_0xbb163b;if(_0x310d6b[_0x75f0('0x30')][_0x75f0('0xc3')]){_0x81e8ed[_0x75f0('0xc4')]=[{'all':!![]}];}return db[_0x75f0('0x93')][_0x75f0('0x8c')](_0x81e8ed);})[_0x75f0('0x24')](function(_0x181088){_0x4fb34b[_0x75f0('0xc5')]=_0x181088;return _0x4fb34b;});}})['then'](respondWithFilteredResult(_0x175604,_0x81e8ed))[_0x75f0('0x84')](handleError(_0x175604,null));};exports[_0x75f0('0xc6')]=function(_0xeb58c3,_0x3e059e,_0xb69e88){var _0x3c41a3={'raw':!![],'where':{}};var _0xc37d2e={};var _0x2a9fe7={'count':0x0,'rows':[]};return db[_0x75f0('0x88')][_0x75f0('0x2e')]({'where':{'id':_0xeb58c3[_0x75f0('0x86')]['id']}})['then'](handleEntityNotFound(_0x3e059e,null))[_0x75f0('0x24')](function(_0x5c0d36){if(_0x5c0d36){_0xc37d2e[_0x75f0('0x32')]=_[_0x75f0('0x28')](db[_0x75f0('0xa2')][_0x75f0('0xbb')]);_0xc37d2e[_0x75f0('0x30')]=_[_0x75f0('0x28')](_0xeb58c3[_0x75f0('0x30')]);_0xc37d2e['filters']=_[_0x75f0('0xbc')](_0xc37d2e['model'],_0xc37d2e[_0x75f0('0x30')]);_0x3c41a3[_0x75f0('0x33')]=_[_0x75f0('0xbc')](_0xc37d2e[_0x75f0('0x32')],qs[_0x75f0('0x34')](_0xeb58c3[_0x75f0('0x30')][_0x75f0('0x34')]));_0x3c41a3[_0x75f0('0x33')]=_0x3c41a3[_0x75f0('0x33')][_0x75f0('0x29')]?_0x3c41a3['attributes']:_0xc37d2e[_0x75f0('0x32')];if(!_0xeb58c3[_0x75f0('0x30')][_0x75f0('0x35')](_0x75f0('0xbd'))){_0x3c41a3[_0x75f0('0x36')]=qs[_0x75f0('0x36')](_0xeb58c3['query'][_0x75f0('0x36')]);_0x3c41a3[_0x75f0('0x1f')]=qs[_0x75f0('0x1f')](_0xeb58c3[_0x75f0('0x30')][_0x75f0('0x1f')]);}_0x3c41a3[_0x75f0('0x6f')]=qs[_0x75f0('0x37')](_0xeb58c3[_0x75f0('0x30')][_0x75f0('0x37')]);_0x3c41a3[_0x75f0('0x38')]=qs[_0x75f0('0x31')](_[_0x75f0('0x39')](_0xeb58c3['query'],_0xc37d2e[_0x75f0('0x31')]));_0x3c41a3[_0x75f0('0x38')][_0x75f0('0xc1')]=_0x5c0d36['id'];if(_0xeb58c3[_0x75f0('0x30')][_0x75f0('0x5e')]){_0x3c41a3[_0x75f0('0x38')]=_[_0x75f0('0x79')](_0x3c41a3[_0x75f0('0x38')],{'$or':_[_0x75f0('0x54')](_0x3c41a3[_0x75f0('0x33')],function(_0x36ecc6){var _0x259a1c={};_0x259a1c[_0x36ecc6]={'$like':'%'+_0xeb58c3[_0x75f0('0x30')]['filter']+'%'};return _0x259a1c;})});}_0x3c41a3=_[_0x75f0('0x79')]({},_0x3c41a3,_0xeb58c3[_0x75f0('0xc2')]);return db[_0x75f0('0xa2')][_0x75f0('0x1e')]({'where':_0x3c41a3['where']})[_0x75f0('0x24')](function(_0x9a6080){_0x2a9fe7['count']=_0x9a6080;if(_0xeb58c3[_0x75f0('0x30')][_0x75f0('0xc3')]){_0x3c41a3[_0x75f0('0xc4')]=[{'all':!![]}];}return db[_0x75f0('0xa2')][_0x75f0('0x8c')](_0x3c41a3);})[_0x75f0('0x24')](function(_0x4acd69){_0x2a9fe7[_0x75f0('0xc5')]=_0x4acd69;return _0x2a9fe7;});}})[_0x75f0('0x24')](respondWithFilteredResult(_0x3e059e,_0x3c41a3))[_0x75f0('0x84')](handleError(_0x3e059e,null));};exports[_0x75f0('0xc7')]=function(_0x65db9e,_0x1e7e0e,_0x354186){var _0x5d7af0={'raw':!![],'where':{}};var _0x2caf37={};var _0x2b7728={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x65db9e[_0x75f0('0x86')]['id']}})[_0x75f0('0x24')](handleEntityNotFound(_0x1e7e0e,null))[_0x75f0('0x24')](function(_0x5b96c9){if(_0x5b96c9){_0x2caf37['model']=_[_0x75f0('0x28')](db[_0x75f0('0xa1')]['rawAttributes']);_0x2caf37[_0x75f0('0x30')]=_[_0x75f0('0x28')](_0x65db9e[_0x75f0('0x30')]);_0x2caf37[_0x75f0('0x31')]=_['intersection'](_0x2caf37[_0x75f0('0x32')],_0x2caf37['query']);_0x5d7af0[_0x75f0('0x33')]=_[_0x75f0('0xbc')](_0x2caf37['model'],qs[_0x75f0('0x34')](_0x65db9e['query'][_0x75f0('0x34')]));_0x5d7af0[_0x75f0('0x33')]=_0x5d7af0[_0x75f0('0x33')][_0x75f0('0x29')]?_0x5d7af0[_0x75f0('0x33')]:_0x2caf37['model'];if(!_0x65db9e[_0x75f0('0x30')][_0x75f0('0x35')](_0x75f0('0xbd'))){_0x5d7af0[_0x75f0('0x36')]=qs[_0x75f0('0x36')](_0x65db9e['query']['limit']);_0x5d7af0[_0x75f0('0x1f')]=qs[_0x75f0('0x1f')](_0x65db9e[_0x75f0('0x30')][_0x75f0('0x1f')]);}_0x5d7af0[_0x75f0('0x6f')]=qs[_0x75f0('0x37')](_0x65db9e[_0x75f0('0x30')][_0x75f0('0x37')]);_0x5d7af0[_0x75f0('0x38')]=qs[_0x75f0('0x31')](_['pick'](_0x65db9e[_0x75f0('0x30')],_0x2caf37[_0x75f0('0x31')]));_0x5d7af0[_0x75f0('0x38')][_0x75f0('0xc1')]=_0x5b96c9['id'];if(_0x65db9e[_0x75f0('0x30')][_0x75f0('0x5e')]){_0x5d7af0[_0x75f0('0x38')]=_[_0x75f0('0x79')](_0x5d7af0[_0x75f0('0x38')],{'$or':_[_0x75f0('0x54')](_0x5d7af0[_0x75f0('0x33')],function(_0x21f5f2){var _0x1762a8={};_0x1762a8[_0x21f5f2]={'$like':'%'+_0x65db9e['query'][_0x75f0('0x5e')]+'%'};return _0x1762a8;})});}_0x5d7af0=_[_0x75f0('0x79')]({},_0x5d7af0,_0x65db9e[_0x75f0('0xc2')]);return db[_0x75f0('0xa1')][_0x75f0('0x1e')]({'where':_0x5d7af0[_0x75f0('0x38')]})[_0x75f0('0x24')](function(_0x3012be){_0x2b7728['count']=_0x3012be;if(_0x65db9e[_0x75f0('0x30')][_0x75f0('0xc3')]){_0x5d7af0[_0x75f0('0xc4')]=[{'all':!![]}];}return db[_0x75f0('0xa1')]['findAll'](_0x5d7af0);})['then'](function(_0x5db790){_0x2b7728[_0x75f0('0xc5')]=_0x5db790;return _0x2b7728;});}})[_0x75f0('0x24')](respondWithFilteredResult(_0x1e7e0e,_0x5d7af0))['catch'](handleError(_0x1e7e0e,null));};exports['getJscriptySessions']=function(_0x3b094a,_0x5f3bd4,_0x24a434){var _0x23d70c={'raw':!![],'where':{}};var _0x4ac16e={};var _0x18d8a8={'count':0x0,'rows':[]};return db['CmContact'][_0x75f0('0x2e')]({'where':{'id':_0x3b094a[_0x75f0('0x86')]['id']}})[_0x75f0('0x24')](handleEntityNotFound(_0x5f3bd4,null))['then'](function(_0x356fe4){if(_0x356fe4){_0x4ac16e[_0x75f0('0x32')]=_[_0x75f0('0x28')](db[_0x75f0('0xc8')][_0x75f0('0xbb')]);_0x4ac16e[_0x75f0('0x30')]=_[_0x75f0('0x28')](_0x3b094a[_0x75f0('0x30')]);_0x4ac16e[_0x75f0('0x31')]=_[_0x75f0('0xbc')](_0x4ac16e[_0x75f0('0x32')],_0x4ac16e[_0x75f0('0x30')]);_0x23d70c[_0x75f0('0x33')]=_['intersection'](_0x4ac16e[_0x75f0('0x32')],qs[_0x75f0('0x34')](_0x3b094a['query'][_0x75f0('0x34')]));_0x23d70c[_0x75f0('0x33')]=_0x23d70c[_0x75f0('0x33')]['length']?_0x23d70c['attributes']:_0x4ac16e[_0x75f0('0x32')];if(!_0x3b094a[_0x75f0('0x30')][_0x75f0('0x35')]('nolimit')){_0x23d70c[_0x75f0('0x36')]=qs[_0x75f0('0x36')](_0x3b094a[_0x75f0('0x30')][_0x75f0('0x36')]);_0x23d70c[_0x75f0('0x1f')]=qs[_0x75f0('0x1f')](_0x3b094a[_0x75f0('0x30')][_0x75f0('0x1f')]);}_0x23d70c[_0x75f0('0x6f')]=qs[_0x75f0('0x37')](_0x3b094a[_0x75f0('0x30')][_0x75f0('0x37')]);_0x23d70c[_0x75f0('0x38')]=qs['filters'](_['pick'](_0x3b094a[_0x75f0('0x30')],_0x4ac16e['filters']));_0x23d70c[_0x75f0('0x38')][_0x75f0('0xc1')]=_0x356fe4['id'];if(_0x3b094a[_0x75f0('0x30')][_0x75f0('0x5e')]){_0x23d70c[_0x75f0('0x38')]=_[_0x75f0('0x79')](_0x23d70c[_0x75f0('0x38')],{'$or':_[_0x75f0('0x54')](_0x23d70c[_0x75f0('0x33')],function(_0x3bf253){var _0x51f4c3={};_0x51f4c3[_0x3bf253]={'$like':'%'+_0x3b094a['query']['filter']+'%'};return _0x51f4c3;})});}_0x23d70c=_[_0x75f0('0x79')]({},_0x23d70c,_0x3b094a['options']);return db['JscriptySessionReport'][_0x75f0('0x1e')]({'where':_0x23d70c[_0x75f0('0x38')]})['then'](function(_0x5e4334){_0x18d8a8[_0x75f0('0x1e')]=_0x5e4334;if(_0x3b094a[_0x75f0('0x30')][_0x75f0('0xc3')]){_0x23d70c[_0x75f0('0xc4')]=[{'all':!![]}];}return db[_0x75f0('0xc8')][_0x75f0('0x8c')](_0x23d70c);})[_0x75f0('0x24')](function(_0x5ce40f){_0x18d8a8[_0x75f0('0xc5')]=_0x5ce40f;return _0x18d8a8;});}})['then'](respondWithFilteredResult(_0x5f3bd4,_0x23d70c))[_0x75f0('0x84')](handleError(_0x5f3bd4,null));};exports[_0x75f0('0xc9')]=function(_0x1b2fb3,_0xb7fc92,_0x262e3a){try{if(!_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0x58')]){throw new Error(_0x75f0('0xca'));}if(!_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0xcb')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0xcc')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x1b2fb3[_0x75f0('0x90')]['socket_timestamp']){throw new Error(_0x75f0('0xcd'));}var _0x163a0a=_0x1b2fb3[_0x75f0('0x90')]['binding_keys'][_0x75f0('0x48')](',');var _0x446cc8=_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0xcc')][_0x75f0('0x48')](',');if(!_0x163a0a[_0x75f0('0x29')]||!_0x446cc8[_0x75f0('0x29')]||_0x163a0a[_0x75f0('0x29')]!==_0x446cc8[_0x75f0('0x29')]){throw new Error(_0x75f0('0xce'));}_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0x34')]=_[_0x75f0('0xcf')](_0x163a0a,_0x446cc8);if(!_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0x34')][_0x75f0('0xb8')]){throw new Error(_0x75f0('0xd0'));}if(!_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0x34')]['firstName']){throw new Error(_0x75f0('0xd1'));}var _0x27c370=path[_0x75f0('0x91')](config[_0x75f0('0xd2')],'server/files/tmp',_0x1b2fb3[_0x75f0('0xd3')][_0x75f0('0xd4')]);fs[_0x75f0('0xd5')](_0x27c370,parseInt(_0x75f0('0xd6'),0x8));var _0x204080=require(_0x75f0('0xd7'))[_0x75f0('0xd8')](path[_0x75f0('0x91')](__dirname,_0x75f0('0xd9')),[_0x27c370,_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0xcb')],_0x1b2fb3['body'][_0x75f0('0xcc')],_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0x58')],_0x1b2fb3['body'][_0x75f0('0xda')],_0x1b2fb3['body']['duplicates'],_0x1b2fb3[_0x75f0('0x90')][_0x75f0('0xdb')]]);return _0xb7fc92[_0x75f0('0x1c')](0xc8)[_0x75f0('0x1d')]({'message':'File\x20uploaded\x20correctly!','pid':_0x204080[_0x75f0('0xdc')]});}catch(_0x42a600){return _0xb7fc92[_0x75f0('0x1c')](0x1f4)[_0x75f0('0x26')](_0x42a600);}};exports[_0x75f0('0xdd')]=function(_0x40c2db,_0x514812,_0x8eb4f8){var _0x1bff11=fs[_0x75f0('0xde')](_0x40c2db[_0x75f0('0xd3')]['path']);Papa[_0x75f0('0xdf')](_0x1bff11,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3668fc){return _0x514812[_0x75f0('0x1c')](0xc8)[_0x75f0('0x1d')]({'file':_0x40c2db['file'],'fields':_0x3668fc[_0x75f0('0xe0')][_0x75f0('0x34')]});}});};exports[_0x75f0('0xe1')]=function(_0xaf50bb,_0x1bb864,_0x5e24ee){return db[_0x75f0('0x4b')][_0x75f0('0x8c')]({'raw':!![],'attributes':['id'],'where':{'role':_0x75f0('0xe2')}})['then'](function(_0x40c76c){var _0x4cdf6c=![];if(!_0xaf50bb[_0x75f0('0x90')]['ListId']){throw new Error(_0x75f0('0xca'));}if(!_0xaf50bb[_0x75f0('0x90')][_0x75f0('0xe3')][_0x75f0('0xb8')]){throw new Error(_0x75f0('0xd0'));}if(!_0xaf50bb['body'][_0x75f0('0xe3')][_0x75f0('0xe4')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0xaf50bb[_0x75f0('0x90')][_0x75f0('0xdb')]){throw new Error(_0x75f0('0xcd'));}var _0x26b99c=require(_0x75f0('0xd7'))[_0x75f0('0xd8')](path[_0x75f0('0x91')](__dirname,_0x75f0('0xe5')),[_0xaf50bb[_0x75f0('0x86')]['id'],JSON['stringify'](_0xaf50bb[_0x75f0('0x90')]),JSON[_0x75f0('0xe6')](_0x40c76c)]);_0x26b99c['on'](_0x75f0('0xe7'),function(_0x304fd6){_0x4cdf6c=!![];return _0x1bb864['status'](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x26b99c[_0x75f0('0xdc')]});});_0x26b99c['on']('exit',function(_0x1c1320){if(_0x1c1320&&!_0x4cdf6c){return _0x1bb864[_0x75f0('0x1c')](0x1f4)[_0x75f0('0x1d')]({'message':_0x75f0('0xe8'),'pid':_0x26b99c[_0x75f0('0xdc')]});}});})[_0x75f0('0x84')](handleError(_0x1bb864,null));};
\ No newline at end of file
index d9cabbb..25faa0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf858=['../../mysqldb','CmContact','setMaxListeners','update','emit','hasOwnProperty','exports','events'];(function(_0x5328cd,_0x1c3033){var _0xde68a7=function(_0x420f91){while(--_0x420f91){_0x5328cd['push'](_0x5328cd['shift']());}};_0xde68a7(++_0x1c3033);}(_0xf858,0x1bf));var _0x8f85=function(_0x181323,_0xa0af14){_0x181323=_0x181323-0x0;var _0x4dbbfa=_0xf858[_0x181323];return _0x4dbbfa;};'use strict';var EventEmitter=require(_0x8f85('0x0'));var CmContact=require(_0x8f85('0x1'))['db'][_0x8f85('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8f85('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f85('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d2688){return function(_0x1352e4,_0x3f6df8,_0x2645c3){CmContactEvents[_0x8f85('0x5')](_0x5d2688+':'+_0x1352e4['id'],_0x1352e4);CmContactEvents[_0x8f85('0x5')](_0x5d2688,_0x1352e4);_0x2645c3(null);};}for(var e in events){if(events[_0x8f85('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x8f85('0x7')]=CmContactEvents;
\ No newline at end of file
+var _0xf4ed=['update','emit','hook','exports','../../mysqldb'];(function(_0x5652e7,_0x34c2db){var _0x1f0ba6=function(_0x22251f){while(--_0x22251f){_0x5652e7['push'](_0x5652e7['shift']());}};_0x1f0ba6(++_0x34c2db);}(_0xf4ed,0xea));var _0xdf4e=function(_0x56d896,_0x3b4c9c){_0x56d896=_0x56d896-0x0;var _0x293639=_0xf4ed[_0x56d896];return _0x293639;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xdf4e('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf4e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x169fc3){return function(_0x19678c,_0x518e5e,_0x5c557f){CmContactEvents['emit'](_0x169fc3+':'+_0x19678c['id'],_0x19678c);CmContactEvents[_0xdf4e('0x2')](_0x169fc3,_0x19678c);_0x5c557f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xdf4e('0x3')](e,emitEvent(event));}}module[_0xdf4e('0x4')]=CmContactEvents;
\ No newline at end of file
index 78d2ed1..5f68b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6324=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','always','onlyIfOpen','outbound','BlackLists','length','cmContact,\x20%s,\x20%s','message','Campaign','CmHopperBlack','List\x20not\x20found','models','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports','define','cm_contacts','phone','get','error','cmContact','afterCreate','inspect','CmHopper','findOne','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20'];(function(_0x381606,_0x53382c){var _0x31c4ca=function(_0x310493){while(--_0x310493){_0x381606['push'](_0x381606['shift']());}};_0x31c4ca(++_0x53382c);}(_0x6324,0x142));var _0x4632=function(_0xc79556,_0x27b148){_0xc79556=_0xc79556-0x0;var _0x19f18a=_0x6324[_0xc79556];return _0x19f18a;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var moment=require('moment');var BPromise=require(_0x4632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4632('0x5'));var rimraf=require('rimraf');var config=require(_0x4632('0x6'));var attributes=require('./cmContact.attributes');module[_0x4632('0x7')]=function(_0x24aba6,_0x1f3077){return _0x24aba6[_0x4632('0x8')]('CmContact',attributes,{'tableName':_0x4632('0x9'),'paranoid':!![],'indexes':[{'name':_0x4632('0xa'),'fields':[_0x4632('0xa')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a523b,_0xc3bc9e,_0x47824c){var _0x47a518=_0x24aba6['models'];var _0xcdefa2=_0x5a523b[_0x4632('0xb')]({'plain':!![]});function _0x30a7cf(){return function(_0x3e26d9){logger[_0x4632('0xc')](_0x4632('0xd'),_0x4632('0xe'),util[_0x4632('0xf')](_0x3e26d9,{'showHidden':![],'depth':null}));};}var _0x4a4cdd=function(_0x2b3f0f){return new BPromise(function(_0x499d88,_0x4719f7){_0x47a518[_0x4632('0x10')][_0x4632('0x11')]({'where':{'phone':_0xcdefa2[_0x4632('0xa')],'VoiceQueueId':_0x2b3f0f['id']}})['then'](function(_0x3ba361){if(!_[_0x4632('0x12')](_0x3ba361)){throw new Error(_0x4632('0x13')+_0xcdefa2[_0x4632('0xa')]+_0x4632('0x14')+_0x2b3f0f['id']);}return _0x47a518['CmHopper']['create']({'phone':_0xcdefa2[_0x4632('0xa')],'ContactId':_0xcdefa2['id'],'ListId':_0xcdefa2[_0x4632('0x15')],'priority':_0xcdefa2[_0x4632('0x16')]?_0xcdefa2[_0x4632('0x16')]:0x2,'scheduledat':_0xcdefa2['scheduledat']?_0xcdefa2[_0x4632('0x17')]:moment()[_0x4632('0x18')](_0x4632('0x19')),'callback':_0xcdefa2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xcdefa2[_0x4632('0x1a')]?_0xcdefa2[_0x4632('0x1a')]:undefined,'callbackat':_0xcdefa2['callbackUniqueid']?moment()['format'](_0x4632('0x19')):undefined,'VoiceQueueId':_0x2b3f0f['id']});})[_0x4632('0x1b')](function(_0x3bdced){_0x4719f7(_0x3bdced);});});};var _0x3e3766=function(_0x2d63b1){return new BPromise(function(_0x3d2d23,_0x9ab826){_0x47a518[_0x4632('0x10')][_0x4632('0x11')]({'where':{'phone':_0xcdefa2[_0x4632('0xa')],'VoiceQueueId':_0x2d63b1['id']}})[_0x4632('0x1c')](function(_0x2d656a){if(!_[_0x4632('0x12')](_0x2d656a)){throw new Error(_0x4632('0x13')+_0xcdefa2[_0x4632('0xa')]+_0x4632('0x1d')+_0x2d63b1['id']);}return _0x47a518[_0x4632('0x1e')][_0x4632('0x11')]({'where':{'calleridnum':_0xcdefa2[_0x4632('0xa')],'VoiceQueueId':_0x2d63b1['id']}});})[_0x4632('0x1c')](function(_0x38cbbc){if(!_[_0x4632('0x12')](_0x38cbbc)){throw new Error(_0x4632('0x1f')+_0xcdefa2[_0x4632('0xa')]+_0x4632('0x20')+_0x2d63b1['id']);}return _0x47a518[_0x4632('0x10')][_0x4632('0x21')]({'phone':_0xcdefa2[_0x4632('0xa')],'ContactId':_0xcdefa2['id'],'ListId':_0xcdefa2[_0x4632('0x15')],'priority':_0xcdefa2[_0x4632('0x16')]?_0xcdefa2[_0x4632('0x16')]:0x2,'scheduledat':_0xcdefa2[_0x4632('0x17')]?_0xcdefa2[_0x4632('0x17')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xcdefa2[_0x4632('0x1a')]?!![]:![],'callbackuniqueid':_0xcdefa2[_0x4632('0x1a')]?_0xcdefa2[_0x4632('0x1a')]:undefined,'callbackat':_0xcdefa2[_0x4632('0x1a')]?moment()[_0x4632('0x18')](_0x4632('0x19')):undefined,'VoiceQueueId':_0x2d63b1['id']});})[_0x4632('0x1b')](function(_0x5e2ee4){_0x9ab826(_0x5e2ee4);});});};function _0x42d505(){return function(_0x135fd2){logger['error'](_0x4632('0xd'),'afterCreate',util[_0x4632('0xf')](_0x135fd2,{'showHidden':![],'depth':null}));};}var _0x4cb661=function(_0x4fda35){return new BPromise(function(_0x1973eb,_0x1cd26a){_0x47a518[_0x4632('0x10')]['findOne']({'where':{'phone':_0xcdefa2['phone'],'CampaignId':_0x4fda35['id']}})[_0x4632('0x1c')](function(_0x7671ab){if(!_['isNil'](_0x7671ab)){throw new Error('cmContact,\x20afterCreate\x20'+_0xcdefa2[_0x4632('0xa')]+_0x4632('0x22')+_0x4fda35['id']);}return _0x47a518['CmHopper'][_0x4632('0x21')]({'phone':_0xcdefa2[_0x4632('0xa')],'ContactId':_0xcdefa2['id'],'ListId':_0xcdefa2[_0x4632('0x15')],'priority':_0xcdefa2[_0x4632('0x16')]?_0xcdefa2[_0x4632('0x16')]:0x2,'scheduledat':_0xcdefa2['scheduledat']?_0xcdefa2[_0x4632('0x17')]:moment()[_0x4632('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xcdefa2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xcdefa2[_0x4632('0x1a')]?_0xcdefa2['callbackUniqueid']:undefined,'callbackat':_0xcdefa2['callbackUniqueid']?moment()[_0x4632('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4fda35['id']});})[_0x4632('0x1b')](function(_0x468735){_0x1cd26a(_0x468735);});});};var _0x305079=function(_0x52dd7f){return new BPromise(function(_0x4d091b,_0xf37b63){_0x47a518[_0x4632('0x10')][_0x4632('0x11')]({'where':{'phone':_0xcdefa2[_0x4632('0xa')],'CampaignId':_0x52dd7f['id']}})['then'](function(_0x486f6c){if(!_[_0x4632('0x12')](_0x486f6c)){throw new Error(_0x4632('0x13')+_0xcdefa2[_0x4632('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x52dd7f['id']);}return _0x47a518['CmHopperFinal']['findOne']({'where':{'calleridnum':_0xcdefa2[_0x4632('0xa')],'CampaignId':_0x52dd7f['id']}});})[_0x4632('0x1c')](function(_0x5a0096){if(!_[_0x4632('0x12')](_0x5a0096)){throw new Error(_0x4632('0x1f')+_0xcdefa2[_0x4632('0xa')]+_0x4632('0x23')+_0x52dd7f['id']);}return _0x47a518[_0x4632('0x10')][_0x4632('0x21')]({'phone':_0xcdefa2[_0x4632('0xa')],'ContactId':_0xcdefa2['id'],'ListId':_0xcdefa2[_0x4632('0x15')],'priority':_0xcdefa2[_0x4632('0x16')]?_0xcdefa2[_0x4632('0x16')]:0x2,'scheduledat':_0xcdefa2[_0x4632('0x17')]?_0xcdefa2[_0x4632('0x17')]:moment()['format'](_0x4632('0x19')),'callback':_0xcdefa2[_0x4632('0x1a')]?!![]:![],'callbackuniqueid':_0xcdefa2['callbackUniqueid']?_0xcdefa2[_0x4632('0x1a')]:undefined,'callbackat':_0xcdefa2[_0x4632('0x1a')]?moment()['format'](_0x4632('0x19')):undefined,'CampaignId':_0x52dd7f['id']});})['catch'](function(_0x3a1433){_0xf37b63(_0x3a1433);});});};if(_0xcdefa2[_0x4632('0x15')]){_0x47a518[_0x4632('0x24')][_0x4632('0x25')]({'where':{'type':'outbound'},'attributes':['id',_0x4632('0x26')],'include':[{'model':_0x47a518[_0x4632('0x27')],'as':_0x4632('0x28'),'where':{'id':_0xcdefa2[_0x4632('0x15')]}}]})['then'](function(_0x5b3fa9){if(_0x5b3fa9){var _0x319ed4=[];for(var _0x1167b1=0x0,_0x351cb1;_0x1167b1<_0x5b3fa9['length'];_0x1167b1+=0x1){_0x351cb1=_0x5b3fa9[_0x1167b1][_0x4632('0xb')]({'plain':!![]});switch(_0x351cb1[_0x4632('0x26')]){case _0x4632('0x29'):_0x3e3766(_0x351cb1)[_0x4632('0x1b')](_0x30a7cf());break;case _0x4632('0x2a'):_0x4a4cdd(_0x351cb1)[_0x4632('0x1b')](_0x30a7cf());break;default:_0x47a518[_0x4632('0x10')]['create']({'phone':_0xcdefa2[_0x4632('0xa')],'ContactId':_0xcdefa2['id'],'ListId':_0xcdefa2[_0x4632('0x15')],'scheduledat':_0xcdefa2[_0x4632('0x17')]?_0xcdefa2[_0x4632('0x17')]:moment()[_0x4632('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0xcdefa2['priority']?_0xcdefa2[_0x4632('0x16')]:0x2,'callback':_0xcdefa2[_0x4632('0x1a')]?!![]:![],'callbackuniqueid':_0xcdefa2[_0x4632('0x1a')]?_0xcdefa2[_0x4632('0x1a')]:undefined,'callbackat':_0xcdefa2['callbackUniqueid']?moment()[_0x4632('0x18')](_0x4632('0x19')):undefined,'VoiceQueueId':_0x351cb1['id']})[_0x4632('0x1b')](_0x30a7cf());}}}})[_0x4632('0x1c')](function(){return _0x47a518[_0x4632('0x24')]['findAll']({'where':{'type':_0x4632('0x2b')},'attributes':['id'],'include':[{'model':_0x47a518[_0x4632('0x27')],'as':_0x4632('0x2c'),'where':{'id':_0xcdefa2[_0x4632('0x15')]}}]})[_0x4632('0x1c')](function(_0x2eb8b0){if(_0x2eb8b0){var _0x1f72c4=[];for(var _0x1f02d5=0x0,_0x30de73;_0x1f02d5<_0x2eb8b0[_0x4632('0x2d')];_0x1f02d5+=0x1){_0x30de73=_0x2eb8b0[_0x1f02d5][_0x4632('0xb')]({'plain':!![]});_0x47a518['CmHopperBlack'][_0x4632('0x21')]({'phone':_0xcdefa2[_0x4632('0xa')],'ContactId':_0xcdefa2['id'],'ListId':_0xcdefa2[_0x4632('0x15')],'VoiceQueueId':_0x30de73['id']})['catch'](function(_0x7ec070){logger[_0x4632('0xc')](_0x4632('0x2e'),_0x4632('0xe'),_0x7ec070[_0x4632('0x2f')]);});}}});})[_0x4632('0x1c')](function(){return _0x47a518[_0x4632('0x30')][_0x4632('0x25')]({'attributes':['id',_0x4632('0x26')],'include':[{'model':_0x47a518[_0x4632('0x27')],'as':'Lists','where':{'id':_0xcdefa2[_0x4632('0x15')]}}]})[_0x4632('0x1c')](function(_0x5444d8){if(_0x5444d8){var _0x142a26=[];for(var _0x3a21c6=0x0,_0x18cc47;_0x3a21c6<_0x5444d8[_0x4632('0x2d')];_0x3a21c6+=0x1){_0x18cc47=_0x5444d8[_0x3a21c6][_0x4632('0xb')]({'plain':!![]});switch(_0x18cc47[_0x4632('0x26')]){case _0x4632('0x29'):_0x305079(_0x18cc47)[_0x4632('0x1b')](_0x42d505());break;case _0x4632('0x2a'):_0x4cb661(_0x18cc47)[_0x4632('0x1b')](_0x42d505());break;default:_0x47a518[_0x4632('0x10')][_0x4632('0x21')]({'phone':_0xcdefa2[_0x4632('0xa')],'ContactId':_0xcdefa2['id'],'ListId':_0xcdefa2[_0x4632('0x15')],'scheduledat':_0xcdefa2[_0x4632('0x17')]?_0xcdefa2[_0x4632('0x17')]:moment()[_0x4632('0x18')](_0x4632('0x19')),'priority':_0xcdefa2[_0x4632('0x16')]?_0xcdefa2[_0x4632('0x16')]:0x2,'callback':_0xcdefa2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xcdefa2[_0x4632('0x1a')]?_0xcdefa2[_0x4632('0x1a')]:undefined,'callbackat':_0xcdefa2[_0x4632('0x1a')]?moment()[_0x4632('0x18')](_0x4632('0x19')):undefined,'CampaignId':_0x18cc47['id']})[_0x4632('0x1b')](_0x42d505());}}}});})['then'](function(){return _0x47a518[_0x4632('0x30')][_0x4632('0x25')]({'attributes':['id'],'include':[{'model':_0x47a518[_0x4632('0x27')],'as':'BlackLists','where':{'id':_0xcdefa2[_0x4632('0x15')]}}]})[_0x4632('0x1c')](function(_0x57dbe7){if(_0x57dbe7){var _0x17bc91=[];for(var _0x1aa4f0=0x0,_0x3bfebd;_0x1aa4f0<_0x57dbe7['length'];_0x1aa4f0+=0x1){_0x3bfebd=_0x57dbe7[_0x1aa4f0][_0x4632('0xb')]({'plain':!![]});_0x47a518[_0x4632('0x31')][_0x4632('0x21')]({'phone':_0xcdefa2[_0x4632('0xa')],'ContactId':_0xcdefa2['id'],'ListId':_0xcdefa2[_0x4632('0x15')],'CampaignId':_0x3bfebd['id']})[_0x4632('0x1b')](function(_0x180662){logger[_0x4632('0xc')](_0x4632('0x2e'),_0x4632('0xe'),_0x180662['message']);});}}});})[_0x4632('0x1c')](function(){_0x47824c();})[_0x4632('0x1b')](function(_0x556bec){logger[_0x4632('0xc')]('cmContact,\x20%s,\x20%s','afterCreate',_0x556bec[_0x4632('0x2f')]);_0x47824c(_0x556bec);});}else{_0x47824c(new Error(_0x4632('0x32')));}},'afterDestroy':function(_0x2451ba,_0xd89124,_0x3a030b){var _0x433dac=_0x24aba6[_0x4632('0x33')];var _0x3e2849=_0x2451ba[_0x4632('0xb')]({'plain':!![]});return _0x433dac[_0x4632('0x10')][_0x4632('0x25')]({'raw':!![],'where':{'ListId':_0x3e2849[_0x4632('0x15')],'ContactId':_0x3e2849['id']}})[_0x4632('0x1c')](function(_0x265e03){if(!_['isEmpty'](_0x265e03)){var _0x50e02b=[];for(var _0x2e34d9=0x0;_0x2e34d9<_0x265e03[_0x4632('0x2d')];_0x2e34d9+=0x1){var _0x14233e=_0x433dac[_0x4632('0x10')][_0x4632('0x34')]({'where':{'ListId':_0x265e03[_0x2e34d9][_0x4632('0x15')],'ContactId':_0x265e03[_0x2e34d9]['ContactId'],'VoiceQueueId':_0x265e03[_0x2e34d9][_0x4632('0x35')],'CampaignId':_0x265e03[_0x2e34d9][_0x4632('0x36')]}});_0x50e02b[_0x4632('0x37')](_0x14233e);}return BPromise[_0x4632('0x38')](_0x50e02b);}})['then'](function(_0x529be1){logger[_0x4632('0x39')]('[CmContact][afterDestroy][Succesfull]',util[_0x4632('0xf')](_0x529be1,{'showHidden':![],'depth':null}));_0x3a030b();})[_0x4632('0x1b')](function(_0xc86476){logger[_0x4632('0xc')](_0x4632('0x3a'),util['inspect'](_0xc86476,{'showHidden':![],'depth':null}));_0x3a030b(_0xc86476);});}}});};
\ No newline at end of file
+var _0x96cc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','models','error','afterCreate','inspect','CmHopper','findOne','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','then','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','scheduledat','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','always','onlyIfOpen','BlackLists','length','Lists','Campaign','CmHopperBlack','cmContact,\x20%s,\x20%s','message','isEmpty','destroy','ContactId','VoiceQueueId','all','info','[CmContact][afterDestroy][Error]','lodash','../../config/logger'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x96cc,0x16c));var _0xc96c=function(_0x1a2ed5,_0x255d82){_0x1a2ed5=_0x1a2ed5-0x0;var _0x5c9cc1=_0x96cc[_0x1a2ed5];return _0x5c9cc1;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))('api');var moment=require(_0xc96c('0x2'));var BPromise=require(_0xc96c('0x3'));var rp=require(_0xc96c('0x4'));var fs=require('fs');var path=require(_0xc96c('0x5'));var rimraf=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var attributes=require(_0xc96c('0x8'));module[_0xc96c('0x9')]=function(_0x3b7f45,_0x5142cd){return _0x3b7f45[_0xc96c('0xa')](_0xc96c('0xb'),attributes,{'tableName':_0xc96c('0xc'),'paranoid':!![],'indexes':[{'name':_0xc96c('0xd'),'fields':[_0xc96c('0xd')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c9f93,_0x36b2b4,_0x54e765){var _0x29ee7b=_0x3b7f45[_0xc96c('0xe')];var _0x19f599=_0x4c9f93['get']({'plain':!![]});function _0x95ce8e(){return function(_0x4a91dd){logger[_0xc96c('0xf')]('cmContact',_0xc96c('0x10'),util[_0xc96c('0x11')](_0x4a91dd,{'showHidden':![],'depth':null}));};}var _0x3ef47a=function(_0x246a95){return new BPromise(function(_0x5f27f3,_0x3fe3d5){_0x29ee7b[_0xc96c('0x12')][_0xc96c('0x13')]({'where':{'phone':_0x19f599[_0xc96c('0xd')],'VoiceQueueId':_0x246a95['id']}})['then'](function(_0x35da94){if(!_[_0xc96c('0x14')](_0x35da94)){throw new Error(_0xc96c('0x15')+_0x19f599[_0xc96c('0xd')]+_0xc96c('0x16')+_0x246a95['id']);}return _0x29ee7b[_0xc96c('0x12')][_0xc96c('0x17')]({'phone':_0x19f599[_0xc96c('0xd')],'ContactId':_0x19f599['id'],'ListId':_0x19f599[_0xc96c('0x18')],'priority':_0x19f599[_0xc96c('0x19')]?_0x19f599[_0xc96c('0x19')]:0x2,'scheduledat':_0x19f599['scheduledat']?_0x19f599['scheduledat']:moment()[_0xc96c('0x1a')](_0xc96c('0x1b')),'callback':_0x19f599[_0xc96c('0x1c')]?!![]:![],'callbackuniqueid':_0x19f599[_0xc96c('0x1c')]?_0x19f599['callbackUniqueid']:undefined,'callbackat':_0x19f599[_0xc96c('0x1c')]?moment()[_0xc96c('0x1a')](_0xc96c('0x1b')):undefined,'VoiceQueueId':_0x246a95['id']});})[_0xc96c('0x1d')](function(_0x184128){_0x3fe3d5(_0x184128);});});};var _0x335910=function(_0x43cc22){return new BPromise(function(_0x41daba,_0x28d762){_0x29ee7b[_0xc96c('0x12')][_0xc96c('0x13')]({'where':{'phone':_0x19f599[_0xc96c('0xd')],'VoiceQueueId':_0x43cc22['id']}})[_0xc96c('0x1e')](function(_0x45edee){if(!_[_0xc96c('0x14')](_0x45edee)){throw new Error(_0xc96c('0x15')+_0x19f599[_0xc96c('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x43cc22['id']);}return _0x29ee7b[_0xc96c('0x1f')][_0xc96c('0x13')]({'where':{'calleridnum':_0x19f599[_0xc96c('0xd')],'VoiceQueueId':_0x43cc22['id']}});})[_0xc96c('0x1e')](function(_0x2b1df9){if(!_[_0xc96c('0x14')](_0x2b1df9)){throw new Error(_0xc96c('0x20')+_0x19f599[_0xc96c('0xd')]+_0xc96c('0x21')+_0x43cc22['id']);}return _0x29ee7b[_0xc96c('0x12')]['create']({'phone':_0x19f599[_0xc96c('0xd')],'ContactId':_0x19f599['id'],'ListId':_0x19f599[_0xc96c('0x18')],'priority':_0x19f599[_0xc96c('0x19')]?_0x19f599[_0xc96c('0x19')]:0x2,'scheduledat':_0x19f599['scheduledat']?_0x19f599['scheduledat']:moment()[_0xc96c('0x1a')](_0xc96c('0x1b')),'callback':_0x19f599[_0xc96c('0x1c')]?!![]:![],'callbackuniqueid':_0x19f599[_0xc96c('0x1c')]?_0x19f599[_0xc96c('0x1c')]:undefined,'callbackat':_0x19f599[_0xc96c('0x1c')]?moment()[_0xc96c('0x1a')](_0xc96c('0x1b')):undefined,'VoiceQueueId':_0x43cc22['id']});})[_0xc96c('0x1d')](function(_0x27925f){_0x28d762(_0x27925f);});});};function _0x325cda(){return function(_0x40c72b){logger[_0xc96c('0xf')](_0xc96c('0x22'),'afterCreate',util[_0xc96c('0x11')](_0x40c72b,{'showHidden':![],'depth':null}));};}var _0x53c994=function(_0x3f4b0e){return new BPromise(function(_0x442c7f,_0x2c7198){_0x29ee7b['CmHopper'][_0xc96c('0x13')]({'where':{'phone':_0x19f599[_0xc96c('0xd')],'CampaignId':_0x3f4b0e['id']}})[_0xc96c('0x1e')](function(_0x26c5b7){if(!_['isNil'](_0x26c5b7)){throw new Error('cmContact,\x20afterCreate\x20'+_0x19f599[_0xc96c('0xd')]+_0xc96c('0x23')+_0x3f4b0e['id']);}return _0x29ee7b[_0xc96c('0x12')]['create']({'phone':_0x19f599[_0xc96c('0xd')],'ContactId':_0x19f599['id'],'ListId':_0x19f599[_0xc96c('0x18')],'priority':_0x19f599[_0xc96c('0x19')]?_0x19f599[_0xc96c('0x19')]:0x2,'scheduledat':_0x19f599['scheduledat']?_0x19f599[_0xc96c('0x24')]:moment()[_0xc96c('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x19f599[_0xc96c('0x1c')]?!![]:![],'callbackuniqueid':_0x19f599[_0xc96c('0x1c')]?_0x19f599[_0xc96c('0x1c')]:undefined,'callbackat':_0x19f599[_0xc96c('0x1c')]?moment()[_0xc96c('0x1a')](_0xc96c('0x1b')):undefined,'CampaignId':_0x3f4b0e['id']});})['catch'](function(_0x35dfb7){_0x2c7198(_0x35dfb7);});});};var _0xdb1b7d=function(_0x15b68b){return new BPromise(function(_0x215d30,_0x107fa2){_0x29ee7b[_0xc96c('0x12')]['findOne']({'where':{'phone':_0x19f599['phone'],'CampaignId':_0x15b68b['id']}})[_0xc96c('0x1e')](function(_0x156d0f){if(!_['isNil'](_0x156d0f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x19f599[_0xc96c('0xd')]+_0xc96c('0x25')+_0x15b68b['id']);}return _0x29ee7b[_0xc96c('0x1f')][_0xc96c('0x13')]({'where':{'calleridnum':_0x19f599[_0xc96c('0xd')],'CampaignId':_0x15b68b['id']}});})[_0xc96c('0x1e')](function(_0x938476){if(!_[_0xc96c('0x14')](_0x938476)){throw new Error(_0xc96c('0x20')+_0x19f599[_0xc96c('0xd')]+_0xc96c('0x26')+_0x15b68b['id']);}return _0x29ee7b['CmHopper'][_0xc96c('0x17')]({'phone':_0x19f599[_0xc96c('0xd')],'ContactId':_0x19f599['id'],'ListId':_0x19f599[_0xc96c('0x18')],'priority':_0x19f599[_0xc96c('0x19')]?_0x19f599['priority']:0x2,'scheduledat':_0x19f599[_0xc96c('0x24')]?_0x19f599[_0xc96c('0x24')]:moment()[_0xc96c('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x19f599['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x19f599[_0xc96c('0x1c')]?_0x19f599[_0xc96c('0x1c')]:undefined,'callbackat':_0x19f599[_0xc96c('0x1c')]?moment()['format'](_0xc96c('0x1b')):undefined,'CampaignId':_0x15b68b['id']});})[_0xc96c('0x1d')](function(_0x2f301a){_0x107fa2(_0x2f301a);});});};if(_0x19f599[_0xc96c('0x18')]){_0x29ee7b[_0xc96c('0x27')][_0xc96c('0x28')]({'where':{'type':_0xc96c('0x29')},'attributes':['id',_0xc96c('0x2a')],'include':[{'model':_0x29ee7b[_0xc96c('0x2b')],'as':'Lists','where':{'id':_0x19f599['ListId']}}]})[_0xc96c('0x1e')](function(_0x2199c4){if(_0x2199c4){var _0xea463b=[];for(var _0x11431c=0x0,_0x535fd6;_0x11431c<_0x2199c4['length'];_0x11431c+=0x1){_0x535fd6=_0x2199c4[_0x11431c][_0xc96c('0x2c')]({'plain':!![]});switch(_0x535fd6[_0xc96c('0x2a')]){case _0xc96c('0x2d'):_0x335910(_0x535fd6)[_0xc96c('0x1d')](_0x95ce8e());break;case _0xc96c('0x2e'):_0x3ef47a(_0x535fd6)[_0xc96c('0x1d')](_0x95ce8e());break;default:_0x29ee7b[_0xc96c('0x12')]['create']({'phone':_0x19f599[_0xc96c('0xd')],'ContactId':_0x19f599['id'],'ListId':_0x19f599[_0xc96c('0x18')],'scheduledat':_0x19f599[_0xc96c('0x24')]?_0x19f599[_0xc96c('0x24')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x19f599[_0xc96c('0x19')]?_0x19f599[_0xc96c('0x19')]:0x2,'callback':_0x19f599[_0xc96c('0x1c')]?!![]:![],'callbackuniqueid':_0x19f599[_0xc96c('0x1c')]?_0x19f599[_0xc96c('0x1c')]:undefined,'callbackat':_0x19f599[_0xc96c('0x1c')]?moment()[_0xc96c('0x1a')](_0xc96c('0x1b')):undefined,'VoiceQueueId':_0x535fd6['id']})[_0xc96c('0x1d')](_0x95ce8e());}}}})[_0xc96c('0x1e')](function(){return _0x29ee7b[_0xc96c('0x27')][_0xc96c('0x28')]({'where':{'type':_0xc96c('0x29')},'attributes':['id'],'include':[{'model':_0x29ee7b['CmList'],'as':_0xc96c('0x2f'),'where':{'id':_0x19f599[_0xc96c('0x18')]}}]})[_0xc96c('0x1e')](function(_0x305ebd){if(_0x305ebd){var _0x56bce1=[];for(var _0x26f629=0x0,_0x50dc76;_0x26f629<_0x305ebd[_0xc96c('0x30')];_0x26f629+=0x1){_0x50dc76=_0x305ebd[_0x26f629][_0xc96c('0x2c')]({'plain':!![]});_0x29ee7b['CmHopperBlack'][_0xc96c('0x17')]({'phone':_0x19f599[_0xc96c('0xd')],'ContactId':_0x19f599['id'],'ListId':_0x19f599[_0xc96c('0x18')],'VoiceQueueId':_0x50dc76['id']})[_0xc96c('0x1d')](function(_0x1e38e1){logger[_0xc96c('0xf')]('cmContact,\x20%s,\x20%s','afterCreate',_0x1e38e1['message']);});}}});})[_0xc96c('0x1e')](function(){return _0x29ee7b['Campaign'][_0xc96c('0x28')]({'attributes':['id',_0xc96c('0x2a')],'include':[{'model':_0x29ee7b[_0xc96c('0x2b')],'as':_0xc96c('0x31'),'where':{'id':_0x19f599[_0xc96c('0x18')]}}]})[_0xc96c('0x1e')](function(_0x456dbc){if(_0x456dbc){var _0x2a7687=[];for(var _0x79bb3a=0x0,_0xd78e10;_0x79bb3a<_0x456dbc['length'];_0x79bb3a+=0x1){_0xd78e10=_0x456dbc[_0x79bb3a][_0xc96c('0x2c')]({'plain':!![]});switch(_0xd78e10[_0xc96c('0x2a')]){case _0xc96c('0x2d'):_0xdb1b7d(_0xd78e10)[_0xc96c('0x1d')](_0x325cda());break;case _0xc96c('0x2e'):_0x53c994(_0xd78e10)[_0xc96c('0x1d')](_0x325cda());break;default:_0x29ee7b[_0xc96c('0x12')][_0xc96c('0x17')]({'phone':_0x19f599['phone'],'ContactId':_0x19f599['id'],'ListId':_0x19f599['ListId'],'scheduledat':_0x19f599['scheduledat']?_0x19f599['scheduledat']:moment()[_0xc96c('0x1a')](_0xc96c('0x1b')),'priority':_0x19f599[_0xc96c('0x19')]?_0x19f599[_0xc96c('0x19')]:0x2,'callback':_0x19f599[_0xc96c('0x1c')]?!![]:![],'callbackuniqueid':_0x19f599[_0xc96c('0x1c')]?_0x19f599[_0xc96c('0x1c')]:undefined,'callbackat':_0x19f599['callbackUniqueid']?moment()[_0xc96c('0x1a')](_0xc96c('0x1b')):undefined,'CampaignId':_0xd78e10['id']})[_0xc96c('0x1d')](_0x325cda());}}}});})[_0xc96c('0x1e')](function(){return _0x29ee7b[_0xc96c('0x32')][_0xc96c('0x28')]({'attributes':['id'],'include':[{'model':_0x29ee7b[_0xc96c('0x2b')],'as':'BlackLists','where':{'id':_0x19f599[_0xc96c('0x18')]}}]})[_0xc96c('0x1e')](function(_0x18fd05){if(_0x18fd05){var _0x1312db=[];for(var _0x3df6ff=0x0,_0x3c9de9;_0x3df6ff<_0x18fd05[_0xc96c('0x30')];_0x3df6ff+=0x1){_0x3c9de9=_0x18fd05[_0x3df6ff][_0xc96c('0x2c')]({'plain':!![]});_0x29ee7b[_0xc96c('0x33')][_0xc96c('0x17')]({'phone':_0x19f599[_0xc96c('0xd')],'ContactId':_0x19f599['id'],'ListId':_0x19f599[_0xc96c('0x18')],'CampaignId':_0x3c9de9['id']})[_0xc96c('0x1d')](function(_0x177a4b){logger['error'](_0xc96c('0x34'),_0xc96c('0x10'),_0x177a4b[_0xc96c('0x35')]);});}}});})[_0xc96c('0x1e')](function(){_0x54e765();})[_0xc96c('0x1d')](function(_0x55219a){logger[_0xc96c('0xf')](_0xc96c('0x34'),_0xc96c('0x10'),_0x55219a[_0xc96c('0x35')]);_0x54e765(_0x55219a);});}else{_0x54e765(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x302ff2,_0x4629ce,_0x4d9acc){var _0x5e0076=_0x3b7f45['models'];var _0x46de63=_0x302ff2[_0xc96c('0x2c')]({'plain':!![]});return _0x5e0076[_0xc96c('0x12')][_0xc96c('0x28')]({'raw':!![],'where':{'ListId':_0x46de63[_0xc96c('0x18')],'ContactId':_0x46de63['id']}})['then'](function(_0x58e3c1){if(!_[_0xc96c('0x36')](_0x58e3c1)){var _0x2bcf2e=[];for(var _0x402b9a=0x0;_0x402b9a<_0x58e3c1[_0xc96c('0x30')];_0x402b9a+=0x1){var _0x474ae2=_0x5e0076['CmHopper'][_0xc96c('0x37')]({'where':{'ListId':_0x58e3c1[_0x402b9a][_0xc96c('0x18')],'ContactId':_0x58e3c1[_0x402b9a][_0xc96c('0x38')],'VoiceQueueId':_0x58e3c1[_0x402b9a][_0xc96c('0x39')],'CampaignId':_0x58e3c1[_0x402b9a]['CampaignId']}});_0x2bcf2e['push'](_0x474ae2);}return BPromise[_0xc96c('0x3a')](_0x2bcf2e);}})[_0xc96c('0x1e')](function(_0x55bab7){logger[_0xc96c('0x3b')]('[CmContact][afterDestroy][Succesfull]',util[_0xc96c('0x11')](_0x55bab7,{'showHidden':![],'depth':null}));_0x4d9acc();})[_0xc96c('0x1d')](function(_0xb6d346){logger[_0xc96c('0xf')](_0xc96c('0x3c'),util[_0xc96c('0x11')](_0xb6d346,{'showHidden':![],'depth':null}));_0x4d9acc(_0xb6d346);});}}});};
\ No newline at end of file
index 452f807..93f5161 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1d1=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','request','then','info','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContact,\x20%s,\x20%s','message','result','catch','CmContact','find','options','raw','where','attributes','include','model','map','ShowCmContact','CreateCmContact','create','body','lodash','util','moment'];(function(_0x2c4a45,_0x8836e3){var _0x51c36e=function(_0x396db8){while(--_0x396db8){_0x2c4a45['push'](_0x2c4a45['shift']());}};_0x51c36e(++_0x8836e3);}(_0xf1d1,0xa5));var _0x1f1d=function(_0x167384,_0x53ae6f){_0x167384=_0x167384-0x0;var _0x5926a4=_0xf1d1[_0x167384];return _0x5926a4;};'use strict';var _=require(_0x1f1d('0x0'));var util=require(_0x1f1d('0x1'));var moment=require(_0x1f1d('0x2'));var BPromise=require(_0x1f1d('0x3'));var rs=require(_0x1f1d('0x4'));var fs=require('fs');var Redis=require(_0x1f1d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f1d('0x6'));var logger=require(_0x1f1d('0x7'))(_0x1f1d('0x8'));var config=require(_0x1f1d('0x9'));var jayson=require(_0x1f1d('0xa'));var client=jayson[_0x1f1d('0xb')][_0x1f1d('0xc')]({'port':0x232a});config[_0x1f1d('0xd')]=_['defaults'](config[_0x1f1d('0xd')],{'host':_0x1f1d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f1d('0xd')]));require(_0x1f1d('0xf'))['register'](socket);function respondWithRpcPromise(_0x52afda,_0x348f31,_0x4afc31){return new BPromise(function(_0x6a946,_0x1dc937){return client[_0x1f1d('0x10')](_0x52afda,_0x4afc31)[_0x1f1d('0x11')](function(_0x3deca8){logger[_0x1f1d('0x12')]('CmContact,\x20%s,\x20%s',_0x348f31,_0x1f1d('0x13'));logger[_0x1f1d('0x14')](_0x1f1d('0x15'),_0x348f31,_0x1f1d('0x13'),JSON[_0x1f1d('0x16')](_0x3deca8));if(_0x3deca8[_0x1f1d('0x17')]){if(_0x3deca8['error'][_0x1f1d('0x18')]===0x1f4){logger['error'](_0x1f1d('0x19'),_0x348f31,_0x3deca8[_0x1f1d('0x17')][_0x1f1d('0x1a')]);return _0x1dc937(_0x3deca8[_0x1f1d('0x17')][_0x1f1d('0x1a')]);}logger[_0x1f1d('0x17')](_0x1f1d('0x19'),_0x348f31,_0x3deca8[_0x1f1d('0x17')][_0x1f1d('0x1a')]);return _0x6a946(_0x3deca8['error']['message']);}else{logger['info'](_0x1f1d('0x19'),_0x348f31,_0x1f1d('0x13'));_0x6a946(_0x3deca8[_0x1f1d('0x1b')][_0x1f1d('0x1a')]);}})[_0x1f1d('0x1c')](function(_0x192540){logger['error'](_0x1f1d('0x19'),_0x348f31,_0x192540);_0x1dc937(_0x192540);});});}exports['ShowCmContact']=function(_0x49eb30){var _0x4f6512=this;return new Promise(function(_0x3aac88,_0xe04409){return db[_0x1f1d('0x1d')][_0x1f1d('0x1e')]({'raw':_0x49eb30[_0x1f1d('0x1f')]?_0x49eb30[_0x1f1d('0x1f')][_0x1f1d('0x20')]===undefined?!![]:![]:!![],'where':_0x49eb30['options']?_0x49eb30[_0x1f1d('0x1f')][_0x1f1d('0x21')]||null:null,'attributes':_0x49eb30[_0x1f1d('0x1f')]?_0x49eb30['options'][_0x1f1d('0x22')]||null:null,'include':_0x49eb30[_0x1f1d('0x1f')]?_0x49eb30[_0x1f1d('0x1f')][_0x1f1d('0x23')]?_['map'](_0x49eb30[_0x1f1d('0x1f')]['include'],function(_0x2e9a5e){return{'model':db[_0x2e9a5e[_0x1f1d('0x24')]],'as':_0x2e9a5e['as'],'attributes':_0x2e9a5e['attributes'],'include':_0x2e9a5e[_0x1f1d('0x23')]?_[_0x1f1d('0x25')](_0x2e9a5e['include'],function(_0x52d6fc){return{'model':db[_0x52d6fc[_0x1f1d('0x24')]],'as':_0x52d6fc['as'],'attributes':_0x52d6fc['attributes'],'include':_0x52d6fc['include']?_[_0x1f1d('0x25')](_0x52d6fc[_0x1f1d('0x23')],function(_0x56840d){return{'model':db[_0x56840d[_0x1f1d('0x24')]],'as':_0x56840d['as'],'attributes':_0x56840d[_0x1f1d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1f1d('0x11')](function(_0x5b3094){logger['info'](_0x1f1d('0x26'),_0x49eb30);logger['debug']('ShowCmContact',_0x49eb30,JSON[_0x1f1d('0x16')](_0x5b3094));_0x3aac88(_0x5b3094);})[_0x1f1d('0x1c')](function(_0xeadc0a){logger[_0x1f1d('0x17')](_0x1f1d('0x26'),_0xeadc0a[_0x1f1d('0x1a')],_0x49eb30);_0xe04409(_0x4f6512[_0x1f1d('0x17')](0x1f4,_0xeadc0a[_0x1f1d('0x1a')]));});});};exports[_0x1f1d('0x27')]=function(_0x317cb3){var _0x405db0=this;return new Promise(function(_0x1e4882,_0x5862f3){return db['CmContact'][_0x1f1d('0x28')](_0x317cb3[_0x1f1d('0x29')],{'raw':_0x317cb3[_0x1f1d('0x1f')]?_0x317cb3[_0x1f1d('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x1f1d('0x11')](function(_0x21c080){logger[_0x1f1d('0x12')](_0x1f1d('0x27'),_0x317cb3);logger['debug'](_0x1f1d('0x27'),_0x317cb3,JSON[_0x1f1d('0x16')](_0x21c080));_0x1e4882(_0x21c080);})['catch'](function(_0x457a46){logger[_0x1f1d('0x17')](_0x1f1d('0x27'),_0x457a46[_0x1f1d('0x1a')],_0x317cb3);_0x5862f3(_0x405db0[_0x1f1d('0x17')](0x1f4,_0x457a46[_0x1f1d('0x1a')]));});});};
\ No newline at end of file
+var _0x0d0c=['redis','defaults','request','CmContact,\x20%s,\x20%s','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','ShowCmContact','CmContact','find','options','where','include','map','model','attributes','debug','CreateCmContact','create','body','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x47f1bd,_0x2806cc){var _0x4f5684=function(_0x57ffa1){while(--_0x57ffa1){_0x47f1bd['push'](_0x47f1bd['shift']());}};_0x4f5684(++_0x2806cc);}(_0x0d0c,0x171));var _0xc0d0=function(_0x3a72d9,_0xa054d){_0x3a72d9=_0x3a72d9-0x0;var _0x3d3dad=_0x0d0c[_0x3a72d9];return _0x3d3dad;};'use strict';var _=require(_0xc0d0('0x0'));var util=require(_0xc0d0('0x1'));var moment=require(_0xc0d0('0x2'));var BPromise=require(_0xc0d0('0x3'));var rs=require(_0xc0d0('0x4'));var fs=require('fs');var Redis=require(_0xc0d0('0x5'));var db=require(_0xc0d0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0d0('0x7'))('rpc');var config=require(_0xc0d0('0x8'));var jayson=require(_0xc0d0('0x9'));var client=jayson[_0xc0d0('0xa')]['http']({'port':0x232a});config[_0xc0d0('0xb')]=_[_0xc0d0('0xc')](config[_0xc0d0('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc0d0('0xb')]));require('./cmContact.socket')['register'](socket);function respondWithRpcPromise(_0x16013b,_0xdd66f0,_0x591c8e){return new BPromise(function(_0x310c9b,_0x1520cd){return client[_0xc0d0('0xd')](_0x16013b,_0x591c8e)['then'](function(_0x5da8c2){logger['info'](_0xc0d0('0xe'),_0xdd66f0,'request\x20sent');logger['debug'](_0xc0d0('0xf'),_0xdd66f0,_0xc0d0('0x10'),JSON[_0xc0d0('0x11')](_0x5da8c2));if(_0x5da8c2['error']){if(_0x5da8c2['error'][_0xc0d0('0x12')]===0x1f4){logger[_0xc0d0('0x13')](_0xc0d0('0xe'),_0xdd66f0,_0x5da8c2[_0xc0d0('0x13')]['message']);return _0x1520cd(_0x5da8c2[_0xc0d0('0x13')][_0xc0d0('0x14')]);}logger[_0xc0d0('0x13')](_0xc0d0('0xe'),_0xdd66f0,_0x5da8c2[_0xc0d0('0x13')]['message']);return _0x310c9b(_0x5da8c2['error']['message']);}else{logger[_0xc0d0('0x15')](_0xc0d0('0xe'),_0xdd66f0,_0xc0d0('0x10'));_0x310c9b(_0x5da8c2[_0xc0d0('0x16')][_0xc0d0('0x14')]);}})[_0xc0d0('0x17')](function(_0x229114){logger[_0xc0d0('0x13')](_0xc0d0('0xe'),_0xdd66f0,_0x229114);_0x1520cd(_0x229114);});});}exports[_0xc0d0('0x18')]=function(_0x3d4567){var _0x56c518=this;return new Promise(function(_0x480fc1,_0x338d2f){return db[_0xc0d0('0x19')][_0xc0d0('0x1a')]({'raw':_0x3d4567['options']?_0x3d4567['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d4567[_0xc0d0('0x1b')]?_0x3d4567[_0xc0d0('0x1b')][_0xc0d0('0x1c')]||null:null,'attributes':_0x3d4567[_0xc0d0('0x1b')]?_0x3d4567[_0xc0d0('0x1b')]['attributes']||null:null,'include':_0x3d4567[_0xc0d0('0x1b')]?_0x3d4567[_0xc0d0('0x1b')][_0xc0d0('0x1d')]?_[_0xc0d0('0x1e')](_0x3d4567[_0xc0d0('0x1b')][_0xc0d0('0x1d')],function(_0x146dbe){return{'model':db[_0x146dbe[_0xc0d0('0x1f')]],'as':_0x146dbe['as'],'attributes':_0x146dbe[_0xc0d0('0x20')],'include':_0x146dbe[_0xc0d0('0x1d')]?_[_0xc0d0('0x1e')](_0x146dbe[_0xc0d0('0x1d')],function(_0x21db85){return{'model':db[_0x21db85[_0xc0d0('0x1f')]],'as':_0x21db85['as'],'attributes':_0x21db85[_0xc0d0('0x20')],'include':_0x21db85[_0xc0d0('0x1d')]?_[_0xc0d0('0x1e')](_0x21db85['include'],function(_0x2eabe1){return{'model':db[_0x2eabe1[_0xc0d0('0x1f')]],'as':_0x2eabe1['as'],'attributes':_0x2eabe1[_0xc0d0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a7328){logger['info'](_0xc0d0('0x18'),_0x3d4567);logger[_0xc0d0('0x21')]('ShowCmContact',_0x3d4567,JSON[_0xc0d0('0x11')](_0x4a7328));_0x480fc1(_0x4a7328);})[_0xc0d0('0x17')](function(_0x486c94){logger[_0xc0d0('0x13')](_0xc0d0('0x18'),_0x486c94[_0xc0d0('0x14')],_0x3d4567);_0x338d2f(_0x56c518['error'](0x1f4,_0x486c94[_0xc0d0('0x14')]));});});};exports[_0xc0d0('0x22')]=function(_0x2742b3){var _0x458d3a=this;return new Promise(function(_0x5525b3,_0x4573c2){return db[_0xc0d0('0x19')][_0xc0d0('0x23')](_0x2742b3[_0xc0d0('0x24')],{'raw':_0x2742b3['options']?_0x2742b3[_0xc0d0('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xc0d0('0x25')](function(_0x3495fc){logger['info'](_0xc0d0('0x22'),_0x2742b3);logger['debug'](_0xc0d0('0x22'),_0x2742b3,JSON[_0xc0d0('0x11')](_0x3495fc));_0x5525b3(_0x3495fc);})[_0xc0d0('0x17')](function(_0x5c7102){logger[_0xc0d0('0x13')](_0xc0d0('0x22'),_0x5c7102[_0xc0d0('0x14')],_0x2742b3);_0x4573c2(_0x458d3a['error'](0x1f4,_0x5c7102[_0xc0d0('0x14')]));});});};
\ No newline at end of file
index c28d648..1f9cb0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6302=['removeListener','register','length','./cmContact.events','save','remove','emit'];(function(_0x3eb00e,_0x4cd9f2){var _0x17bd5a=function(_0x17bc7a){while(--_0x17bc7a){_0x3eb00e['push'](_0x3eb00e['shift']());}};_0x17bd5a(++_0x4cd9f2);}(_0x6302,0x73));var _0x2630=function(_0x180680,_0x239c8f){_0x180680=_0x180680-0x0;var _0x5995ae=_0x6302[_0x180680];return _0x5995ae;};'use strict';var CmContactEvents=require(_0x2630('0x0'));var events=[_0x2630('0x1'),_0x2630('0x2'),'update'];function createListener(_0x44319e,_0x3bc395){return function(_0x2d19bf){_0x3bc395[_0x2630('0x3')](_0x44319e,_0x2d19bf);};}function removeListener(_0x16f8b8,_0x53d666){return function(){CmContactEvents[_0x2630('0x4')](_0x16f8b8,_0x53d666);};}exports[_0x2630('0x5')]=function(_0x53c86e){for(var _0x4620d9=0x0,_0x1db96e=events[_0x2630('0x6')];_0x4620d9<_0x1db96e;_0x4620d9++){var _0x5c13bb=events[_0x4620d9];var _0x229b17=createListener('cmContact:'+_0x5c13bb,_0x53c86e);CmContactEvents['on'](_0x5c13bb,_0x229b17);}};
\ No newline at end of file
+var _0xe534=['cmContact:','./cmContact.events','remove','update','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe534,0x79));var _0x4e53=function(_0xbd1083,_0x4937ba){_0xbd1083=_0xbd1083-0x0;var _0x3cf7d6=_0xe534[_0xbd1083];return _0x3cf7d6;};'use strict';var CmContactEvents=require(_0x4e53('0x0'));var events=['save',_0x4e53('0x1'),_0x4e53('0x2')];function createListener(_0x21794e,_0x39d262){return function(_0x425976){_0x39d262['emit'](_0x21794e,_0x425976);};}function removeListener(_0x17e04d,_0xfad49a){return function(){CmContactEvents['removeListener'](_0x17e04d,_0xfad49a);};}exports[_0x4e53('0x3')]=function(_0x214534){for(var _0x588dc0=0x0,_0x3d2c9e=events[_0x4e53('0x4')];_0x588dc0<_0x3d2c9e;_0x588dc0++){var _0x2f6acd=events[_0x588dc0];var _0x5ae7ec=createListener(_0x4e53('0x5')+_0x2f6acd,_0x214534);CmContactEvents['on'](_0x2f6acd,_0x5ae7ec);}};
\ No newline at end of file
index 6ec9c15..7544979 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['describe','/:id','isAuthenticated','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','create','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','/csv','single','file','%s-%s%s','basename','extname','/upload','upload','/upload/:id','import','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','/describe'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x31f0,0xb7));var _0x031f=function(_0x49de0b,_0x52eb41){_0x49de0b=_0x49de0b-0x0;var _0x8c3f2b=_0x31f0[_0x49de0b];return _0x8c3f2b;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var auth=require(_0x031f('0x4'));var interaction=require(_0x031f('0x5'));var config=require('../../config/environment');var controller=require(_0x031f('0x6'));router[_0x031f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x031f('0x8'),auth['isAuthenticated'](),controller[_0x031f('0x9')]);router[_0x031f('0x7')](_0x031f('0xa'),auth[_0x031f('0xb')](),controller['show']);router[_0x031f('0x7')](_0x031f('0xc'),auth[_0x031f('0xb')](),controller[_0x031f('0xd')]);router[_0x031f('0x7')](_0x031f('0xe'),auth[_0x031f('0xb')](),controller[_0x031f('0xf')]);router['get'](_0x031f('0x10'),auth[_0x031f('0xb')](),controller[_0x031f('0x11')]);router[_0x031f('0x7')](_0x031f('0x12'),auth[_0x031f('0xb')](),controller[_0x031f('0x13')]);router['get'](_0x031f('0x14'),auth[_0x031f('0xb')](),controller[_0x031f('0x15')]);router[_0x031f('0x16')](_0x031f('0x17'),auth['isAuthenticated'](),controller['merge']);router[_0x031f('0x16')]('/',auth[_0x031f('0xb')](),controller[_0x031f('0x18')]);router[_0x031f('0x16')]('/create_many',auth[_0x031f('0xb')](),controller[_0x031f('0x19')]);router['post'](_0x031f('0xc'),auth['isAuthenticated'](),controller[_0x031f('0x1a')]);var upload=multer({'storage':multer[_0x031f('0x1b')]({'destination':function(_0x563bc8,_0xaa155,_0x1ceddc){_0x1ceddc(null,path[_0x031f('0x1c')](config[_0x031f('0x1d')],_0x031f('0x1e')));},'filename':function(_0xf76f1b,_0x345bde,_0x29dd6e){_0x345bde['originalname']=_0x345bde[_0x031f('0x1f')][_0x031f('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29dd6e(null,util[_0x031f('0x21')]('%s-%s%s',path['basename'](_0x345bde[_0x031f('0x1f')],path['extname'](_0x345bde[_0x031f('0x1f')])),Date['now'](),path['extname'](_0x345bde['originalname'])));}})});router[_0x031f('0x16')](_0x031f('0x22'),upload[_0x031f('0x23')](_0x031f('0x24')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x031f('0x1b')]({'destination':function(_0x5a64c0,_0x40cb1c,_0x1f5a14){_0x1f5a14(null,path[_0x031f('0x1c')](config['root'],_0x031f('0x1e')));},'filename':function(_0x3b2a51,_0x54b44e,_0x3847b2){_0x54b44e[_0x031f('0x1f')]=_0x54b44e[_0x031f('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3847b2(null,util[_0x031f('0x21')](_0x031f('0x25'),path[_0x031f('0x26')](_0x54b44e[_0x031f('0x1f')],path[_0x031f('0x27')](_0x54b44e[_0x031f('0x1f')])),Date['now'](),path[_0x031f('0x27')](_0x54b44e[_0x031f('0x1f')])));}})});router[_0x031f('0x16')](_0x031f('0x28'),upload[_0x031f('0x23')](_0x031f('0x24')),controller[_0x031f('0x29')]);router[_0x031f('0x16')](_0x031f('0x2a'),auth[_0x031f('0xb')](),controller[_0x031f('0x2b')]);router['put'](_0x031f('0xa'),auth[_0x031f('0xb')](),controller[_0x031f('0x2c')]);router[_0x031f('0x2d')](_0x031f('0xa'),auth[_0x031f('0xb')](),controller[_0x031f('0x2e')]);module[_0x031f('0x2f')]=router;
\ No newline at end of file
+var _0xdc97=['%s-%s%s','extname','import','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/describe','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','diskStorage','join','root','server/files/tmp','originalname','replace','basename','now','/csv','file','uploadCsv','format'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xdc97,0x13b));var _0x7dc9=function(_0x19a470,_0x3434d8){_0x19a470=_0x19a470-0x0;var _0x18f693=_0xdc97[_0x19a470];return _0x18f693;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var auth=require(_0x7dc9('0x4'));var interaction=require(_0x7dc9('0x5'));var config=require('../../config/environment');var controller=require(_0x7dc9('0x6'));router[_0x7dc9('0x7')]('/',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x9')]);router['get'](_0x7dc9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7dc9('0x7')](_0x7dc9('0xb'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0xc')]);router[_0x7dc9('0x7')]('/:id/tags',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0xd')]);router[_0x7dc9('0x7')](_0x7dc9('0xe'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0xf')]);router[_0x7dc9('0x7')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0x7dc9('0x10'),auth[_0x7dc9('0x8')](),controller['getHopperFinals']);router[_0x7dc9('0x7')](_0x7dc9('0x11'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x12')]);router[_0x7dc9('0x13')](_0x7dc9('0x14'),auth['isAuthenticated'](),controller[_0x7dc9('0x15')]);router[_0x7dc9('0x13')]('/',auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x16')]);router[_0x7dc9('0x13')](_0x7dc9('0x17'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x18')]);router[_0x7dc9('0x13')]('/:id/tags',auth[_0x7dc9('0x8')](),controller['setTags']);var upload=multer({'storage':multer[_0x7dc9('0x19')]({'destination':function(_0x1cc237,_0x5d61d7,_0x41f66e){_0x41f66e(null,path[_0x7dc9('0x1a')](config[_0x7dc9('0x1b')],_0x7dc9('0x1c')));},'filename':function(_0x43ec33,_0x184bfd,_0x2dad65){_0x184bfd[_0x7dc9('0x1d')]=_0x184bfd[_0x7dc9('0x1d')][_0x7dc9('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2dad65(null,util['format']('%s-%s%s',path[_0x7dc9('0x1f')](_0x184bfd[_0x7dc9('0x1d')],path['extname'](_0x184bfd[_0x7dc9('0x1d')])),Date[_0x7dc9('0x20')](),path['extname'](_0x184bfd[_0x7dc9('0x1d')])));}})});router[_0x7dc9('0x13')](_0x7dc9('0x21'),upload['single'](_0x7dc9('0x22')),controller[_0x7dc9('0x23')]);var upload=multer({'storage':multer[_0x7dc9('0x19')]({'destination':function(_0x55a482,_0x48c6bc,_0x4b9ba6){_0x4b9ba6(null,path[_0x7dc9('0x1a')](config[_0x7dc9('0x1b')],'server/files/tmp'));},'filename':function(_0x585eef,_0x47771b,_0x5afb7d){_0x47771b[_0x7dc9('0x1d')]=_0x47771b[_0x7dc9('0x1d')][_0x7dc9('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5afb7d(null,util[_0x7dc9('0x24')](_0x7dc9('0x25'),path[_0x7dc9('0x1f')](_0x47771b[_0x7dc9('0x1d')],path[_0x7dc9('0x26')](_0x47771b[_0x7dc9('0x1d')])),Date[_0x7dc9('0x20')](),path[_0x7dc9('0x26')](_0x47771b[_0x7dc9('0x1d')])));}})});router['post']('/upload',upload['single']('file'),controller['upload']);router['post']('/upload/:id',auth['isAuthenticated'](),controller[_0x7dc9('0x27')]);router[_0x7dc9('0x28')](_0x7dc9('0xb'),auth[_0x7dc9('0x8')](),controller[_0x7dc9('0x29')]);router[_0x7dc9('0x2a')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7dc9('0x2b')]=router;
\ No newline at end of file
index 2f26d55..f94a931 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d03=['isArray','stringify','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','TEXT','values'];(function(_0x58e4e1,_0x57d93d){var _0xf64251=function(_0x3456c6){while(--_0x3456c6){_0x58e4e1['push'](_0x58e4e1['shift']());}};_0xf64251(++_0x57d93d);}(_0x2d03,0x1be));var _0x32d0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2d03[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x32d0('0x0'));var _=require(_0x32d0('0x1'));module[_0x32d0('0x2')]={'name':{'type':Sequelize[_0x32d0('0x3')],'get':function(_0x3053c6){return this[_0x32d0('0x4')]('alias');}},'alias':{'type':Sequelize[_0x32d0('0x5')],'allowNull':![],'set':function(_0x310602){this[_0x32d0('0x6')](_0x32d0('0x7'),_0x310602?_0x310602:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x32d0('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x32d0('0x8')]('long'),'get':function(){if(this['getDataValue']('type')==='select'){return JSON['parse'](this[_0x32d0('0x4')](_0x32d0('0x9')));}else{return this['getDataValue'](_0x32d0('0x9'));}},'set':function(_0x1973db){if(Array[_0x32d0('0xa')](_0x1973db)){this[_0x32d0('0x6')](_0x32d0('0x9'),JSON[_0x32d0('0xb')](_0x1973db));}else{this[_0x32d0('0x6')](_0x32d0('0x9'),_0x1973db);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x471b=['isArray','stringify','lodash','alias','setDataValue','getDataValue','name','STRING','TEXT','long','type','parse','values'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0x471b,0x12d));var _0xb471=function(_0x12a3c3,_0xfa64cc){_0x12a3c3=_0x12a3c3-0x0;var _0x1f6855=_0x471b[_0x12a3c3];return _0x1f6855;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb471('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xc4ae17){return this['getDataValue'](_0xb471('0x1'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1cb79a){this[_0xb471('0x2')](_0xb471('0x1'),_0x1cb79a?_0x1cb79a:this[_0xb471('0x3')](_0xb471('0x4')));}},'type':{'type':Sequelize[_0xb471('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xb471('0x6')](_0xb471('0x7')),'get':function(){if(this[_0xb471('0x3')](_0xb471('0x8'))==='select'){return JSON[_0xb471('0x9')](this[_0xb471('0x3')]('values'));}else{return this[_0xb471('0x3')](_0xb471('0xa'));}},'set':function(_0x54f379){if(Array[_0xb471('0xb')](_0x54f379)){this[_0xb471('0x2')]('values',JSON[_0xb471('0xc')](_0x54f379));}else{this[_0xb471('0x2')](_0xb471('0xa'),_0x54f379);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 1869526..496f49f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa81=['Content-Range','apply','reject','update','then','destroy','error','stack','name','map','CmCustomField','rawAttributes','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set'];(function(_0x4b2c58,_0x3c2b3d){var _0x234a4e=function(_0x756b02){while(--_0x756b02){_0x4b2c58['push'](_0x4b2c58['shift']());}};_0x234a4e(++_0x3c2b3d);}(_0xfa81,0x195));var _0x1fa8=function(_0x3c0881,_0x486ebc){_0x3c0881=_0x3c0881-0x0;var _0x438389=_0xfa81[_0x3c0881];return _0x438389;};'use strict';var pdf=require(_0x1fa8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1fa8('0x1'));var zipdir=require(_0x1fa8('0x2'));var jsonpatch=require(_0x1fa8('0x3'));var rp=require('request-promise');var moment=require(_0x1fa8('0x4'));var BPromise=require(_0x1fa8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1fa8('0x6'));var sox=require(_0x1fa8('0x7'));var csv=require(_0x1fa8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1fa8('0x9'));var squel=require(_0x1fa8('0xa'));var crypto=require(_0x1fa8('0xb'));var jsforce=require(_0x1fa8('0xc'));var deskjs=require(_0x1fa8('0xd'));var toCsv=require(_0x1fa8('0x8'));var querystring=require(_0x1fa8('0xe'));var Papa=require(_0x1fa8('0xf'));var Redis=require(_0x1fa8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1fa8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fa8('0x12'));var logger=require(_0x1fa8('0x13'))(_0x1fa8('0x14'));var utils=require(_0x1fa8('0x15'));var config=require('../../config/environment');var db=require(_0x1fa8('0x16'))['db'];function respondWithStatusCode(_0x1843fe,_0x12ad91){_0x12ad91=_0x12ad91||0xcc;return function(_0x44d8c3){if(_0x44d8c3){return _0x1843fe[_0x1fa8('0x17')](_0x12ad91);}return _0x1843fe['status'](_0x12ad91)[_0x1fa8('0x18')]();};}function respondWithResult(_0x16beb0,_0x7155ee){_0x7155ee=_0x7155ee||0xc8;return function(_0x667a74){if(_0x667a74){return _0x16beb0[_0x1fa8('0x19')](_0x7155ee)[_0x1fa8('0x1a')](_0x667a74);}};}function respondWithFilteredResult(_0x5c6c7b,_0x493516){return function(_0x147add){if(_0x147add){var _0xf16924=_0x147add[_0x1fa8('0x1b')],_0x5ec778=_0x493516[_0x1fa8('0x1c')],_0x4391e4=_0x493516['offset']+_0x493516['limit'],_0x22f5ab;if(_0x4391e4>=_0xf16924){_0x4391e4=_0xf16924;_0x22f5ab=0xc8;}else{_0x22f5ab=0xce;}_0x5c6c7b['status'](_0x22f5ab);return _0x5c6c7b[_0x1fa8('0x1d')](_0x1fa8('0x1e'),_0x5ec778+'-'+_0x4391e4+'/'+_0xf16924)[_0x1fa8('0x1a')](_0x147add);}return null;};}function patchUpdates(_0x39c4cb){return function(_0x1ad282){try{jsonpatch[_0x1fa8('0x1f')](_0x1ad282,_0x39c4cb,!![]);}catch(_0xce9991){return BPromise[_0x1fa8('0x20')](_0xce9991);}return _0x1ad282['save']();};}function saveUpdates(_0x5b07ba,_0x3fce3b){return function(_0x93f02b){if(_0x93f02b){return _0x93f02b[_0x1fa8('0x21')](_0x5b07ba)[_0x1fa8('0x22')](function(_0x52f6f4){return _0x52f6f4;});}return null;};}function removeEntity(_0x7575f9,_0x5195ad){return function(_0xb295a2){if(_0xb295a2){return _0xb295a2[_0x1fa8('0x23')]()[_0x1fa8('0x22')](function(){_0x7575f9[_0x1fa8('0x19')](0xcc)[_0x1fa8('0x18')]();});}};}function handleEntityNotFound(_0x1215fc,_0x412b66){return function(_0x5eb457){if(!_0x5eb457){_0x1215fc[_0x1fa8('0x17')](0x194);}return _0x5eb457;};}function handleError(_0x2d6dc8,_0x5ae825){_0x5ae825=_0x5ae825||0x1f4;return function(_0x5a7be3){logger[_0x1fa8('0x24')](_0x5a7be3[_0x1fa8('0x25')]);if(_0x5a7be3[_0x1fa8('0x26')]){delete _0x5a7be3[_0x1fa8('0x26')];}_0x2d6dc8[_0x1fa8('0x19')](_0x5ae825)['send'](_0x5a7be3);};}exports['index']=function(_0x5d6472,_0x307d06){var _0x180874={},_0x5dbcd2={},_0x140bff={'count':0x0,'rows':[]};var _0x58645d=_[_0x1fa8('0x27')](db[_0x1fa8('0x28')][_0x1fa8('0x29')],function(_0x530d73){return{'name':_0x530d73['fieldName'],'type':_0x530d73['type'][_0x1fa8('0x2a')]};});_0x5dbcd2[_0x1fa8('0x2b')]=_[_0x1fa8('0x2c')](_['map'](_0x58645d,_0x1fa8('0x26')),['name']);_0x5dbcd2[_0x1fa8('0x2d')]=_[_0x1fa8('0x2e')](_0x5d6472[_0x1fa8('0x2d')]);_0x5dbcd2[_0x1fa8('0x2f')]=_['intersection'](_0x5dbcd2[_0x1fa8('0x2b')],_0x5dbcd2[_0x1fa8('0x2d')]);_0x180874[_0x1fa8('0x30')]=_[_0x1fa8('0x31')](_0x5dbcd2[_0x1fa8('0x2b')],qs[_0x1fa8('0x32')](_0x5d6472[_0x1fa8('0x2d')]['fields']));_0x180874[_0x1fa8('0x30')]=_0x180874['attributes'][_0x1fa8('0x33')]?_0x180874[_0x1fa8('0x30')]:_0x5dbcd2[_0x1fa8('0x2b')];if(!_0x5d6472[_0x1fa8('0x2d')][_0x1fa8('0x34')](_0x1fa8('0x35'))){_0x180874[_0x1fa8('0x36')]=qs[_0x1fa8('0x36')](_0x5d6472[_0x1fa8('0x2d')][_0x1fa8('0x36')]);_0x180874[_0x1fa8('0x1c')]=qs['offset'](_0x5d6472[_0x1fa8('0x2d')][_0x1fa8('0x1c')]);}_0x180874[_0x1fa8('0x37')]=qs[_0x1fa8('0x38')](_0x5d6472['query']['sort']);_0x180874[_0x1fa8('0x39')]=qs[_0x1fa8('0x2f')](_[_0x1fa8('0x3a')](_0x5d6472[_0x1fa8('0x2d')],_0x5dbcd2[_0x1fa8('0x2f')]),_0x58645d);if(_0x5d6472[_0x1fa8('0x2d')][_0x1fa8('0x3b')]){_0x180874[_0x1fa8('0x39')]=_[_0x1fa8('0x3c')](_0x180874[_0x1fa8('0x39')],{'$or':_[_0x1fa8('0x27')](_0x58645d,function(_0x2c5727){if(_0x2c5727[_0x1fa8('0x3d')]!==_0x1fa8('0x3e')){var _0x16aa44={};_0x16aa44[_0x2c5727[_0x1fa8('0x26')]]={'$like':'%'+_0x5d6472[_0x1fa8('0x2d')]['filter']+'%'};return _0x16aa44;}})});}_0x180874=_[_0x1fa8('0x3c')]({},_0x180874,_0x5d6472[_0x1fa8('0x3f')]);var _0x4a8d1f={'where':_0x180874[_0x1fa8('0x39')]};return db['CmCustomField'][_0x1fa8('0x1b')](_0x4a8d1f)[_0x1fa8('0x22')](function(_0x407ad5){_0x140bff[_0x1fa8('0x1b')]=_0x407ad5;if(_0x5d6472[_0x1fa8('0x2d')][_0x1fa8('0x40')]){_0x180874[_0x1fa8('0x41')]=[{'all':!![]}];}return db[_0x1fa8('0x28')]['findAll'](_0x180874);})['then'](function(_0xb3a75e){_0x140bff[_0x1fa8('0x42')]=_0xb3a75e;return _0x140bff;})[_0x1fa8('0x22')](respondWithFilteredResult(_0x307d06,_0x180874))['catch'](handleError(_0x307d06,null));};exports[_0x1fa8('0x43')]=function(_0x2b88ce,_0x4adc93){var _0x346ede={'raw':!![],'where':{'id':_0x2b88ce[_0x1fa8('0x44')]['id']}},_0x336bcf={};_0x336bcf[_0x1fa8('0x2b')]=_[_0x1fa8('0x2e')](db[_0x1fa8('0x28')]['rawAttributes']);_0x336bcf[_0x1fa8('0x2d')]=_[_0x1fa8('0x2e')](_0x2b88ce[_0x1fa8('0x2d')]);_0x336bcf['filters']=_[_0x1fa8('0x31')](_0x336bcf[_0x1fa8('0x2b')],_0x336bcf[_0x1fa8('0x2d')]);_0x346ede[_0x1fa8('0x30')]=_[_0x1fa8('0x31')](_0x336bcf[_0x1fa8('0x2b')],qs[_0x1fa8('0x32')](_0x2b88ce[_0x1fa8('0x2d')][_0x1fa8('0x32')]));_0x346ede['attributes']=_0x346ede[_0x1fa8('0x30')][_0x1fa8('0x33')]?_0x346ede[_0x1fa8('0x30')]:_0x336bcf[_0x1fa8('0x2b')];if(_0x2b88ce[_0x1fa8('0x2d')][_0x1fa8('0x40')]){_0x346ede[_0x1fa8('0x41')]=[{'all':!![]}];}_0x346ede=_[_0x1fa8('0x3c')]({},_0x346ede,_0x2b88ce['options']);return db['CmCustomField'][_0x1fa8('0x45')](_0x346ede)[_0x1fa8('0x22')](handleEntityNotFound(_0x4adc93,null))[_0x1fa8('0x22')](respondWithResult(_0x4adc93,null))[_0x1fa8('0x46')](handleError(_0x4adc93,null));};exports[_0x1fa8('0x21')]=function(_0xfcf311,_0x22ebe2){if(_0xfcf311['body']['id']){delete _0xfcf311['body']['id'];}return db[_0x1fa8('0x28')][_0x1fa8('0x45')]({'where':{'id':_0xfcf311[_0x1fa8('0x44')]['id']}})[_0x1fa8('0x22')](handleEntityNotFound(_0x22ebe2,null))[_0x1fa8('0x22')](saveUpdates(_0xfcf311[_0x1fa8('0x47')],null))[_0x1fa8('0x22')](respondWithResult(_0x22ebe2,null))[_0x1fa8('0x46')](handleError(_0x22ebe2,null));};exports[_0x1fa8('0x23')]=function(_0x1655da,_0x15e9a3){return db[_0x1fa8('0x28')][_0x1fa8('0x45')]({'where':{'id':_0x1655da[_0x1fa8('0x44')]['id']}})['then'](handleEntityNotFound(_0x15e9a3,null))[_0x1fa8('0x22')](removeEntity(_0x15e9a3,null))['catch'](handleError(_0x15e9a3,null));};exports[_0x1fa8('0x48')]=function(_0x57861f,_0x393f57){var _0x52bca4;return db[_0x1fa8('0x49')][_0x1fa8('0x4a')](function(_0x1dfbe5){return db[_0x1fa8('0x28')][_0x1fa8('0x48')](_0x57861f[_0x1fa8('0x47')],{'transaction':_0x1dfbe5})[_0x1fa8('0x22')](function(_0x7c8488){_0x52bca4=_0x7c8488;var _0x1b2f4f={'type':db[_0x1fa8('0x4b')]['TEXT'],'transaction':_0x1dfbe5};switch(_0x57861f[_0x1fa8('0x47')][_0x1fa8('0x3d')]){case _0x1fa8('0x4c'):_0x1b2f4f[_0x1fa8('0x3d')]=db[_0x1fa8('0x4b')][_0x1fa8('0x4d')];break;case _0x1fa8('0x4e'):_0x1b2f4f['type']=db[_0x1fa8('0x4b')][_0x1fa8('0x4f')];break;case _0x1fa8('0x50'):_0x1b2f4f[_0x1fa8('0x3d')]=db['Sequelize']['BOOLEAN'];_0x1b2f4f[_0x1fa8('0x51')]=![];break;default:}return db['sequelize'][_0x1fa8('0x52')][_0x1fa8('0x53')](_0x1fa8('0x54'),util[_0x1fa8('0x55')](_0x1fa8('0x56'),_0x52bca4['id']),_0x1b2f4f);})[_0x1fa8('0x22')](function(){return _0x52bca4;});})['then'](respondWithResult(_0x393f57,0xc9))[_0x1fa8('0x46')](handleError(_0x393f57,null));};
\ No newline at end of file
+var _0x2bb5=['switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','update','then','destroy','error','name','send','map','fieldName','type','model','differenceBy','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','count','CmCustomField','rows','catch','show','params','rawAttributes','fields','includeAll','include','merge','find','body','create','sequelize','Sequelize','TEXT','text','number','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bb5,0x158));var _0x52bb=function(_0x4ef05e,_0x18b00a){_0x4ef05e=_0x4ef05e-0x0;var _0x241f30=_0x2bb5[_0x4ef05e];return _0x241f30;};'use strict';var pdf=require(_0x52bb('0x0'));var emlformat=require(_0x52bb('0x1'));var rimraf=require(_0x52bb('0x2'));var zipdir=require(_0x52bb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52bb('0x4'));var moment=require(_0x52bb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x52bb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x52bb('0x7'));var ejs=require(_0x52bb('0x8'));var fs=require('fs');var _=require(_0x52bb('0x9'));var squel=require(_0x52bb('0xa'));var crypto=require(_0x52bb('0xb'));var jsforce=require(_0x52bb('0xc'));var deskjs=require(_0x52bb('0xd'));var toCsv=require(_0x52bb('0x7'));var querystring=require('querystring');var Papa=require(_0x52bb('0xe'));var Redis=require(_0x52bb('0xf'));var authService=require(_0x52bb('0x10'));var qs=require(_0x52bb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52bb('0x12'));var logger=require(_0x52bb('0x13'))('api');var utils=require(_0x52bb('0x14'));var config=require(_0x52bb('0x15'));var db=require(_0x52bb('0x16'))['db'];function respondWithStatusCode(_0x30e95a,_0x2445c1){_0x2445c1=_0x2445c1||0xcc;return function(_0x304027){if(_0x304027){return _0x30e95a[_0x52bb('0x17')](_0x2445c1);}return _0x30e95a[_0x52bb('0x18')](_0x2445c1)[_0x52bb('0x19')]();};}function respondWithResult(_0x23957c,_0x5a2980){_0x5a2980=_0x5a2980||0xc8;return function(_0xe53fcd){if(_0xe53fcd){return _0x23957c[_0x52bb('0x18')](_0x5a2980)[_0x52bb('0x1a')](_0xe53fcd);}};}function respondWithFilteredResult(_0x5f429c,_0x2331e4){return function(_0x33481b){if(_0x33481b){var _0x2dcdc1=_0x33481b['count'],_0x1c963e=_0x2331e4[_0x52bb('0x1b')],_0x5c2e38=_0x2331e4[_0x52bb('0x1b')]+_0x2331e4[_0x52bb('0x1c')],_0x5f2d1a;if(_0x5c2e38>=_0x2dcdc1){_0x5c2e38=_0x2dcdc1;_0x5f2d1a=0xc8;}else{_0x5f2d1a=0xce;}_0x5f429c[_0x52bb('0x18')](_0x5f2d1a);return _0x5f429c['set']('Content-Range',_0x1c963e+'-'+_0x5c2e38+'/'+_0x2dcdc1)[_0x52bb('0x1a')](_0x33481b);}return null;};}function patchUpdates(_0x1f66cb){return function(_0x5b3c92){try{jsonpatch[_0x52bb('0x1d')](_0x5b3c92,_0x1f66cb,!![]);}catch(_0x29a271){return BPromise[_0x52bb('0x1e')](_0x29a271);}return _0x5b3c92['save']();};}function saveUpdates(_0x1ce5fc,_0x1bfe1b){return function(_0x2653ed){if(_0x2653ed){return _0x2653ed[_0x52bb('0x1f')](_0x1ce5fc)[_0x52bb('0x20')](function(_0x2e09db){return _0x2e09db;});}return null;};}function removeEntity(_0x587c3e,_0x51838c){return function(_0x5a2908){if(_0x5a2908){return _0x5a2908[_0x52bb('0x21')]()[_0x52bb('0x20')](function(){_0x587c3e[_0x52bb('0x18')](0xcc)[_0x52bb('0x19')]();});}};}function handleEntityNotFound(_0x2eba2e,_0x31b521){return function(_0x7f15c8){if(!_0x7f15c8){_0x2eba2e[_0x52bb('0x17')](0x194);}return _0x7f15c8;};}function handleError(_0x438873,_0x2401a7){_0x2401a7=_0x2401a7||0x1f4;return function(_0x49cda2){logger[_0x52bb('0x22')](_0x49cda2['stack']);if(_0x49cda2['name']){delete _0x49cda2[_0x52bb('0x23')];}_0x438873['status'](_0x2401a7)[_0x52bb('0x24')](_0x49cda2);};}exports['index']=function(_0x4e37a7,_0x220638){var _0x21b06c={},_0x48c07f={},_0x175daa={'count':0x0,'rows':[]};var _0x5bfaf5=_[_0x52bb('0x25')](db['CmCustomField']['rawAttributes'],function(_0x1c7f82){return{'name':_0x1c7f82[_0x52bb('0x26')],'type':_0x1c7f82[_0x52bb('0x27')]['key']};});_0x48c07f[_0x52bb('0x28')]=_[_0x52bb('0x29')](_[_0x52bb('0x25')](_0x5bfaf5,_0x52bb('0x23')),['name']);_0x48c07f['query']=_[_0x52bb('0x2a')](_0x4e37a7[_0x52bb('0x2b')]);_0x48c07f[_0x52bb('0x2c')]=_[_0x52bb('0x2d')](_0x48c07f[_0x52bb('0x28')],_0x48c07f['query']);_0x21b06c[_0x52bb('0x2e')]=_['intersection'](_0x48c07f[_0x52bb('0x28')],qs['fields'](_0x4e37a7[_0x52bb('0x2b')]['fields']));_0x21b06c['attributes']=_0x21b06c[_0x52bb('0x2e')][_0x52bb('0x2f')]?_0x21b06c[_0x52bb('0x2e')]:_0x48c07f[_0x52bb('0x28')];if(!_0x4e37a7[_0x52bb('0x2b')][_0x52bb('0x30')]('nolimit')){_0x21b06c[_0x52bb('0x1c')]=qs[_0x52bb('0x1c')](_0x4e37a7[_0x52bb('0x2b')][_0x52bb('0x1c')]);_0x21b06c['offset']=qs[_0x52bb('0x1b')](_0x4e37a7[_0x52bb('0x2b')]['offset']);}_0x21b06c[_0x52bb('0x31')]=qs[_0x52bb('0x32')](_0x4e37a7['query'][_0x52bb('0x32')]);_0x21b06c[_0x52bb('0x33')]=qs[_0x52bb('0x2c')](_[_0x52bb('0x34')](_0x4e37a7['query'],_0x48c07f[_0x52bb('0x2c')]),_0x5bfaf5);if(_0x4e37a7[_0x52bb('0x2b')][_0x52bb('0x35')]){_0x21b06c['where']=_['merge'](_0x21b06c[_0x52bb('0x33')],{'$or':_[_0x52bb('0x25')](_0x5bfaf5,function(_0x2535e4){if(_0x2535e4['type']!==_0x52bb('0x36')){var _0x28e25f={};_0x28e25f[_0x2535e4[_0x52bb('0x23')]]={'$like':'%'+_0x4e37a7[_0x52bb('0x2b')][_0x52bb('0x35')]+'%'};return _0x28e25f;}})});}_0x21b06c=_['merge']({},_0x21b06c,_0x4e37a7[_0x52bb('0x37')]);var _0xcf059d={'where':_0x21b06c[_0x52bb('0x33')]};return db['CmCustomField'][_0x52bb('0x38')](_0xcf059d)['then'](function(_0x1ddd5d){_0x175daa['count']=_0x1ddd5d;if(_0x4e37a7[_0x52bb('0x2b')]['includeAll']){_0x21b06c['include']=[{'all':!![]}];}return db[_0x52bb('0x39')]['findAll'](_0x21b06c);})[_0x52bb('0x20')](function(_0x3754b3){_0x175daa[_0x52bb('0x3a')]=_0x3754b3;return _0x175daa;})['then'](respondWithFilteredResult(_0x220638,_0x21b06c))[_0x52bb('0x3b')](handleError(_0x220638,null));};exports[_0x52bb('0x3c')]=function(_0x22c01f,_0x416914){var _0x5e714a={'raw':!![],'where':{'id':_0x22c01f[_0x52bb('0x3d')]['id']}},_0x4f7f4a={};_0x4f7f4a['model']=_['keys'](db[_0x52bb('0x39')][_0x52bb('0x3e')]);_0x4f7f4a[_0x52bb('0x2b')]=_[_0x52bb('0x2a')](_0x22c01f[_0x52bb('0x2b')]);_0x4f7f4a[_0x52bb('0x2c')]=_[_0x52bb('0x2d')](_0x4f7f4a['model'],_0x4f7f4a[_0x52bb('0x2b')]);_0x5e714a['attributes']=_['intersection'](_0x4f7f4a[_0x52bb('0x28')],qs[_0x52bb('0x3f')](_0x22c01f[_0x52bb('0x2b')][_0x52bb('0x3f')]));_0x5e714a[_0x52bb('0x2e')]=_0x5e714a['attributes']['length']?_0x5e714a['attributes']:_0x4f7f4a[_0x52bb('0x28')];if(_0x22c01f[_0x52bb('0x2b')][_0x52bb('0x40')]){_0x5e714a[_0x52bb('0x41')]=[{'all':!![]}];}_0x5e714a=_[_0x52bb('0x42')]({},_0x5e714a,_0x22c01f[_0x52bb('0x37')]);return db[_0x52bb('0x39')][_0x52bb('0x43')](_0x5e714a)[_0x52bb('0x20')](handleEntityNotFound(_0x416914,null))[_0x52bb('0x20')](respondWithResult(_0x416914,null))[_0x52bb('0x3b')](handleError(_0x416914,null));};exports[_0x52bb('0x1f')]=function(_0x1ce1f5,_0x223c2d){if(_0x1ce1f5['body']['id']){delete _0x1ce1f5[_0x52bb('0x44')]['id'];}return db[_0x52bb('0x39')][_0x52bb('0x43')]({'where':{'id':_0x1ce1f5[_0x52bb('0x3d')]['id']}})[_0x52bb('0x20')](handleEntityNotFound(_0x223c2d,null))[_0x52bb('0x20')](saveUpdates(_0x1ce1f5[_0x52bb('0x44')],null))[_0x52bb('0x20')](respondWithResult(_0x223c2d,null))[_0x52bb('0x3b')](handleError(_0x223c2d,null));};exports[_0x52bb('0x21')]=function(_0x434d33,_0x9f60c0){return db[_0x52bb('0x39')][_0x52bb('0x43')]({'where':{'id':_0x434d33['params']['id']}})['then'](handleEntityNotFound(_0x9f60c0,null))[_0x52bb('0x20')](removeEntity(_0x9f60c0,null))[_0x52bb('0x3b')](handleError(_0x9f60c0,null));};exports[_0x52bb('0x45')]=function(_0x1e949e,_0x2b43ab){var _0x2f6750;return db[_0x52bb('0x46')]['transaction'](function(_0x377355){return db['CmCustomField'][_0x52bb('0x45')](_0x1e949e[_0x52bb('0x44')],{'transaction':_0x377355})[_0x52bb('0x20')](function(_0x466b0a){_0x2f6750=_0x466b0a;var _0x35d4fe={'type':db[_0x52bb('0x47')][_0x52bb('0x48')],'transaction':_0x377355};switch(_0x1e949e[_0x52bb('0x44')][_0x52bb('0x27')]){case _0x52bb('0x49'):_0x35d4fe[_0x52bb('0x27')]=db['Sequelize'][_0x52bb('0x48')];break;case _0x52bb('0x4a'):_0x35d4fe[_0x52bb('0x27')]=db[_0x52bb('0x47')][_0x52bb('0x4b')];break;case _0x52bb('0x4c'):_0x35d4fe[_0x52bb('0x27')]=db[_0x52bb('0x47')][_0x52bb('0x4d')];_0x35d4fe[_0x52bb('0x4e')]=![];break;default:}return db[_0x52bb('0x46')][_0x52bb('0x4f')][_0x52bb('0x50')](_0x52bb('0x51'),util[_0x52bb('0x52')](_0x52bb('0x53'),_0x2f6750['id']),_0x35d4fe);})[_0x52bb('0x20')](function(){return _0x2f6750;});})['then'](respondWithResult(_0x2b43ab,0xc9))[_0x52bb('0x3b')](handleError(_0x2b43ab,null));};
\ No newline at end of file
index 44890be..bac96d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8da8=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0x5a202b,_0x646352){var _0x35c911=function(_0x521008){while(--_0x521008){_0x5a202b['push'](_0x5a202b['shift']());}};_0x35c911(++_0x646352);}(_0x8da8,0x187));var _0x88da=function(_0x237ee6,_0x5782be){_0x237ee6=_0x237ee6-0x0;var _0x1410cc=_0x8da8[_0x237ee6];return _0x1410cc;};'use strict';var _=require(_0x88da('0x0'));var util=require(_0x88da('0x1'));var logger=require(_0x88da('0x2'))(_0x88da('0x3'));var moment=require(_0x88da('0x4'));var BPromise=require(_0x88da('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x88da('0x6'));var rimraf=require(_0x88da('0x7'));var config=require(_0x88da('0x8'));var attributes=require(_0x88da('0x9'));module[_0x88da('0xa')]=function(_0x139b62,_0x532abf){return _0x139b62[_0x88da('0xb')](_0x88da('0xc'),attributes,{'tableName':_0x88da('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4fc=['../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x177d44,_0x2f1574){var _0x26e5e1=function(_0x428a35){while(--_0x428a35){_0x177d44['push'](_0x177d44['shift']());}};_0x26e5e1(++_0x2f1574);}(_0xb4fc,0x198));var _0xcb4f=function(_0x5a9d0e,_0x1f3230){_0x5a9d0e=_0x5a9d0e-0x0;var _0x28f27e=_0xb4fc[_0x5a9d0e];return _0x28f27e;};'use strict';var _=require(_0xcb4f('0x0'));var util=require(_0xcb4f('0x1'));var logger=require(_0xcb4f('0x2'))(_0xcb4f('0x3'));var moment=require(_0xcb4f('0x4'));var BPromise=require(_0xcb4f('0x5'));var rp=require(_0xcb4f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb4f('0x7'));var config=require(_0xcb4f('0x8'));var attributes=require(_0xcb4f('0x9'));module[_0xcb4f('0xa')]=function(_0x18ae57,_0x308b62){return _0x18ae57['define'](_0xcb4f('0xb'),attributes,{'tableName':_0xcb4f('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3950b9d..df8adc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22fb=['CmCustomField,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2fe7cd,_0x4687de){var _0x3c9710=function(_0x5a9e8b){while(--_0x5a9e8b){_0x2fe7cd['push'](_0x2fe7cd['shift']());}};_0x3c9710(++_0x4687de);}(_0x22fb,0x192));var _0xb22f=function(_0x6b7a6b,_0xe5539d){_0x6b7a6b=_0x6b7a6b-0x0;var _0x46da2d=_0x22fb[_0x6b7a6b];return _0x46da2d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('CmCustomField,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});}
\ No newline at end of file
+var _0xadb8=['CmCustomField,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x184b00,_0x5a10c7){var _0x29ba1b=function(_0x58bc37){while(--_0x58bc37){_0x184b00['push'](_0x184b00['shift']());}};_0x29ba1b(++_0x5a10c7);}(_0xadb8,0x1d0));var _0x8adb=function(_0x400b6c,_0x4a6139){_0x400b6c=_0x400b6c-0x0;var _0x4c4e3e=_0xadb8[_0x400b6c];return _0x4c4e3e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8adb('0x0'));var BPromise=require('bluebird');var rs=require(_0x8adb('0x1'));var fs=require('fs');var Redis=require(_0x8adb('0x2'));var db=require(_0x8adb('0x3'))['db'];var utils=require(_0x8adb('0x4'));var logger=require(_0x8adb('0x5'))(_0x8adb('0x6'));var config=require(_0x8adb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8adb('0x8')][_0x8adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f435,_0x2bebfe,_0x271bed){return new BPromise(function(_0x16b932,_0x27d994){return client['request'](_0x9f435,_0x271bed)['then'](function(_0x58ad1a){logger[_0x8adb('0xa')]('CmCustomField,\x20%s,\x20%s',_0x2bebfe,'request\x20sent');logger['debug'](_0x8adb('0xb'),_0x2bebfe,_0x8adb('0xc'),JSON[_0x8adb('0xd')](_0x58ad1a));if(_0x58ad1a[_0x8adb('0xe')]){if(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0xf')]===0x1f4){logger[_0x8adb('0xe')](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);return _0x27d994(_0x58ad1a['error']['message']);}logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a['error'][_0x8adb('0x11')]);return _0x16b932(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);}else{logger['info'](_0x8adb('0x10'),_0x2bebfe,_0x8adb('0xc'));_0x16b932(_0x58ad1a[_0x8adb('0x12')][_0x8adb('0x11')]);}})[_0x8adb('0x13')](function(_0x13659c){logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x13659c);_0x27d994(_0x13659c);});});}
\ No newline at end of file
index 8b92a8c..d5ad5c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e69=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util'];(function(_0x5b2e0d,_0x477978){var _0x34cc82=function(_0x1cfb13){while(--_0x1cfb13){_0x5b2e0d['push'](_0x5b2e0d['shift']());}};_0x34cc82(++_0x477978);}(_0x6e69,0x167));var _0x96e6=function(_0x54e80b,_0x571e98){_0x54e80b=_0x54e80b-0x0;var _0x5ba901=_0x6e69[_0x54e80b];return _0x5ba901;};'use strict';var multer=require('multer');var util=require(_0x96e6('0x0'));var path=require(_0x96e6('0x1'));var timeout=require(_0x96e6('0x2'));var express=require(_0x96e6('0x3'));var router=express[_0x96e6('0x4')]();var auth=require(_0x96e6('0x5'));var interaction=require(_0x96e6('0x6'));var config=require(_0x96e6('0x7'));var controller=require(_0x96e6('0x8'));router[_0x96e6('0x9')]('/',auth[_0x96e6('0xa')](),controller[_0x96e6('0xb')]);router['get'](_0x96e6('0xc'),auth[_0x96e6('0xa')](),controller[_0x96e6('0xd')]);router[_0x96e6('0xe')]('/',auth[_0x96e6('0xa')](),controller[_0x96e6('0xf')]);router[_0x96e6('0x10')](_0x96e6('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x96e6('0x11')](_0x96e6('0xc'),auth[_0x96e6('0xa')](),controller[_0x96e6('0x12')]);module[_0x96e6('0x13')]=router;
\ No newline at end of file
+var _0xedf3=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0xedf3,0x17a));var _0x3edf=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0xedf3[_0x4aa838];return _0x3abff0;};'use strict';var multer=require('multer');var util=require(_0x3edf('0x0'));var path=require(_0x3edf('0x1'));var timeout=require(_0x3edf('0x2'));var express=require(_0x3edf('0x3'));var router=express[_0x3edf('0x4')]();var auth=require(_0x3edf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3edf('0x6'));var controller=require(_0x3edf('0x7'));router[_0x3edf('0x8')]('/',auth[_0x3edf('0x9')](),controller['index']);router[_0x3edf('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3edf('0xa')]);router[_0x3edf('0xb')]('/',auth[_0x3edf('0x9')](),controller[_0x3edf('0xc')]);router[_0x3edf('0xd')](_0x3edf('0xe'),auth[_0x3edf('0x9')](),controller['update']);router[_0x3edf('0xf')](_0x3edf('0xe'),auth[_0x3edf('0x9')](),controller[_0x3edf('0x10')]);module[_0x3edf('0x11')]=router;
\ No newline at end of file
index d866bb1..96df971 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fda=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x644fb4,_0x36adf8){_0x644fb4=_0x644fb4-0x0;var _0x18acc0=_0x0fda[_0x644fb4];return _0x18acc0;};'use strict';var moment=require(_0xa0fd('0x0'));var Sequelize=require('sequelize');module[_0xa0fd('0x1')]={'phone':{'type':Sequelize[_0xa0fd('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xa0fd('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa0fd('0x4')],'defaultValue':moment()[_0xa0fd('0x5')](_0xa0fd('0x6'))},'countbusyretry':{'type':Sequelize[_0xa0fd('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa0fd('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xa0fd('0x7')](0x2)[_0xa0fd('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa0fd('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa0fd('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xa0fd('0x7')],'unique':_0xa0fd('0x9')},'UserId':{'type':Sequelize[_0xa0fd('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xa0fd('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xa0fd('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xa0fd('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa0fd('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa0fd('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa0fd('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x207c=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize','exports'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x207c,0x1e8));var _0xc207=function(_0x316b3e,_0x47b154){_0x316b3e=_0x316b3e-0x0;var _0x45ba95=_0x207c[_0x316b3e];return _0x45ba95;};'use strict';var moment=require('moment');var Sequelize=require(_0xc207('0x0'));module[_0xc207('0x1')]={'phone':{'type':Sequelize[_0xc207('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xc207('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xc207('0x4')],'defaultValue':moment()[_0xc207('0x5')](_0xc207('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc207('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc207('0x4')]},'priority':{'type':Sequelize[_0xc207('0x7')](0x2)[_0xc207('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xc207('0x7')],'unique':_0xc207('0x9')},'ListId':{'type':Sequelize[_0xc207('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xc207('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xc207('0x7')],'unique':_0xc207('0x9')},'CampaignId':{'type':Sequelize[_0xc207('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xc207('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc207('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 78f3a90..92c3d22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8405=['phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','calleridname','firstName','finally','CmHopperFinal','getVoiceQueues','preview','sequelize','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','Contact','Company','List','dialActive','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum'];(function(_0x5a9c2f,_0x52fa1e){var _0x2ea0e4=function(_0x41f250){while(--_0x41f250){_0x5a9c2f['push'](_0x5a9c2f['shift']());}};_0x2ea0e4(++_0x52fa1e);}(_0x8405,0x151));var _0x5840=function(_0x3247ac,_0x4fae7c){_0x3247ac=_0x3247ac-0x0;var _0x1837bb=_0x8405[_0x3247ac];return _0x1837bb;};'use strict';var pdf=require(_0x5840('0x0'));var emlformat=require(_0x5840('0x1'));var rimraf=require(_0x5840('0x2'));var zipdir=require(_0x5840('0x3'));var jsonpatch=require(_0x5840('0x4'));var rp=require(_0x5840('0x5'));var moment=require(_0x5840('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5840('0x7'));var util=require(_0x5840('0x8'));var path=require(_0x5840('0x9'));var sox=require(_0x5840('0xa'));var csv=require('to-csv');var ejs=require(_0x5840('0xb'));var fs=require('fs');var _=require(_0x5840('0xc'));var squel=require('squel');var crypto=require(_0x5840('0xd'));var jsforce=require(_0x5840('0xe'));var deskjs=require(_0x5840('0xf'));var toCsv=require(_0x5840('0x10'));var querystring=require(_0x5840('0x11'));var Papa=require('papaparse');var Redis=require(_0x5840('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5840('0x13'));var logger=require('../../config/logger')(_0x5840('0x14'));var utils=require('../../config/utils');var config=require(_0x5840('0x15'));var db=require(_0x5840('0x16'))['db'];function respondWithStatusCode(_0x1d1190,_0xc1a5c8){_0xc1a5c8=_0xc1a5c8||0xcc;return function(_0x257530){if(_0x257530){return _0x1d1190['sendStatus'](_0xc1a5c8);}return _0x1d1190[_0x5840('0x17')](_0xc1a5c8)[_0x5840('0x18')]();};}function respondWithResult(_0x4ec6e3,_0x6daa5b){_0x6daa5b=_0x6daa5b||0xc8;return function(_0x418928){if(_0x418928){return _0x4ec6e3[_0x5840('0x17')](_0x6daa5b)[_0x5840('0x19')](_0x418928);}};}function respondWithFilteredResult(_0x2833b5,_0x586d17){return function(_0x3a8edf){if(_0x3a8edf){var _0x1f06e2=_0x3a8edf[_0x5840('0x1a')],_0x38bbd2=_0x586d17[_0x5840('0x1b')],_0x298fbd=_0x586d17[_0x5840('0x1b')]+_0x586d17['limit'],_0x5a6410;if(_0x298fbd>=_0x1f06e2){_0x298fbd=_0x1f06e2;_0x5a6410=0xc8;}else{_0x5a6410=0xce;}_0x2833b5[_0x5840('0x17')](_0x5a6410);return _0x2833b5['set'](_0x5840('0x1c'),_0x38bbd2+'-'+_0x298fbd+'/'+_0x1f06e2)[_0x5840('0x19')](_0x3a8edf);}return null;};}function patchUpdates(_0x55251a){return function(_0x4f4a32){try{jsonpatch[_0x5840('0x1d')](_0x4f4a32,_0x55251a,!![]);}catch(_0x597764){return BPromise[_0x5840('0x1e')](_0x597764);}return _0x4f4a32[_0x5840('0x1f')]();};}function saveUpdates(_0x5abf54,_0x45221b){return function(_0x50f3ea){if(_0x50f3ea){return _0x50f3ea[_0x5840('0x20')](_0x5abf54)[_0x5840('0x21')](function(_0x261915){return _0x261915;});}return null;};}function removeEntity(_0x230cce,_0x1d6f3a){return function(_0x57b592){if(_0x57b592){return _0x57b592[_0x5840('0x22')]()[_0x5840('0x21')](function(){_0x230cce[_0x5840('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cd3ef,_0x2b1a68){return function(_0x3f66c8){if(!_0x3f66c8){_0x4cd3ef[_0x5840('0x23')](0x194);}return _0x3f66c8;};}function handleError(_0x206f73,_0x1654bc){_0x1654bc=_0x1654bc||0x1f4;return function(_0x236a62){logger[_0x5840('0x24')](_0x236a62[_0x5840('0x25')]);if(_0x236a62[_0x5840('0x26')]){delete _0x236a62[_0x5840('0x26')];}_0x206f73[_0x5840('0x17')](_0x1654bc)[_0x5840('0x27')](_0x236a62);};}exports[_0x5840('0x28')]=function(_0x5a558d,_0x5d1449){var _0x3432d5={},_0x307980={},_0x1605ce={'count':0x0,'rows':[]};var _0x447f04=_[_0x5840('0x29')](db[_0x5840('0x2a')][_0x5840('0x2b')],function(_0x2f585b){return{'name':_0x2f585b[_0x5840('0x2c')],'type':_0x2f585b[_0x5840('0x2d')][_0x5840('0x2e')]};});_0x307980[_0x5840('0x2f')]=_[_0x5840('0x29')](_0x447f04,_0x5840('0x26'));_0x307980[_0x5840('0x30')]=_[_0x5840('0x31')](_0x5a558d['query']);_0x307980[_0x5840('0x32')]=_[_0x5840('0x33')](_0x307980['model'],_0x307980[_0x5840('0x30')]);_0x307980['filters']=_['concat'](_0x307980[_0x5840('0x32')],[_0x5840('0x34'),_0x5840('0x35'),_0x5840('0x36'),_0x5840('0x37'),_0x5840('0x38'),_0x5840('0x39'),_0x5840('0x3a'),_0x5840('0x3b'),_0x5840('0x3c'),'$between',_0x5840('0x3d'),_0x5840('0x3e'),_0x5840('0x3f'),_0x5840('0x40'),_0x5840('0x41'),_0x5840('0x42'),_0x5840('0x43'),_0x5840('0x40'),_0x5840('0x44'),_0x5840('0x45'),_0x5840('0x46'),_0x5840('0x47')]);_0x3432d5[_0x5840('0x48')]=_[_0x5840('0x33')](_0x307980['model'],qs[_0x5840('0x49')](_0x5a558d[_0x5840('0x30')]['fields']));_0x3432d5['attributes']=_0x3432d5[_0x5840('0x48')][_0x5840('0x4a')]?_0x3432d5[_0x5840('0x48')]:_0x307980[_0x5840('0x2f')];if(!_0x5a558d[_0x5840('0x30')][_0x5840('0x4b')](_0x5840('0x4c'))){_0x3432d5['limit']=qs[_0x5840('0x4d')](_0x5a558d[_0x5840('0x30')][_0x5840('0x4d')]);_0x3432d5[_0x5840('0x1b')]=qs[_0x5840('0x1b')](_0x5a558d['query'][_0x5840('0x1b')]);}_0x3432d5[_0x5840('0x4e')]=qs[_0x5840('0x4f')](_0x5a558d[_0x5840('0x30')][_0x5840('0x4f')]);_0x3432d5['where']=qs['filters'](_[_0x5840('0x50')](_0x5a558d[_0x5840('0x30')],_0x307980[_0x5840('0x32')]),_0x447f04);if(_0x5a558d[_0x5840('0x30')][_0x5840('0x51')]){_0x3432d5[_0x5840('0x52')]=_[_0x5840('0x53')](_0x3432d5[_0x5840('0x52')],{'$or':_[_0x5840('0x29')](_0x447f04,function(_0x1b5985){if(_0x1b5985[_0x5840('0x2d')]!==_0x5840('0x54')){var _0xb81c03={};_0xb81c03[_0x1b5985[_0x5840('0x26')]]={'$like':'%'+_0x5a558d['query'][_0x5840('0x51')]+'%'};return _0xb81c03;}})});}_0x3432d5=_[_0x5840('0x53')]({},_0x3432d5,_0x5a558d['options']);var _0x5cf9cb={'where':_0x3432d5[_0x5840('0x52')]};return db[_0x5840('0x2a')][_0x5840('0x1a')](_0x5cf9cb)['then'](function(_0x28d2ba){_0x1605ce[_0x5840('0x1a')]=_0x28d2ba;if(_0x5a558d[_0x5840('0x30')]['includeAll']){_0x3432d5['include']=[{'all':!![]}];}return db['CmHopper'][_0x5840('0x55')](_0x3432d5);})[_0x5840('0x21')](function(_0x127954){_0x1605ce[_0x5840('0x56')]=_0x127954;return _0x1605ce;})[_0x5840('0x21')](respondWithFilteredResult(_0x5d1449,_0x3432d5))[_0x5840('0x57')](handleError(_0x5d1449,null));};exports[_0x5840('0x58')]=function(_0x8a558a,_0x1d47fd){var _0x441afe={'raw':!![],'where':{'id':_0x8a558a[_0x5840('0x59')]['id']}},_0x1efa9c={};_0x1efa9c[_0x5840('0x2f')]=_['keys'](db[_0x5840('0x2a')][_0x5840('0x2b')]);_0x1efa9c[_0x5840('0x30')]=_[_0x5840('0x31')](_0x8a558a[_0x5840('0x30')]);_0x1efa9c[_0x5840('0x32')]=_[_0x5840('0x33')](_0x1efa9c['model'],_0x1efa9c[_0x5840('0x30')]);_0x441afe[_0x5840('0x48')]=_[_0x5840('0x33')](_0x1efa9c['model'],qs[_0x5840('0x49')](_0x8a558a[_0x5840('0x30')]['fields']));_0x441afe['attributes']=_0x441afe['attributes'][_0x5840('0x4a')]?_0x441afe[_0x5840('0x48')]:_0x1efa9c['model'];if(_0x8a558a['query'][_0x5840('0x5a')]){_0x441afe[_0x5840('0x5b')]=[{'all':!![]}];}_0x441afe=_[_0x5840('0x53')]({},_0x441afe,_0x8a558a[_0x5840('0x5c')]);return db[_0x5840('0x2a')][_0x5840('0x5d')](_0x441afe)[_0x5840('0x21')](handleEntityNotFound(_0x1d47fd,null))[_0x5840('0x21')](respondWithResult(_0x1d47fd,null))[_0x5840('0x57')](handleError(_0x1d47fd,null));};exports[_0x5840('0x5e')]=function(_0x2df677,_0xf71c2){return db['CmHopper'][_0x5840('0x5e')](_0x2df677[_0x5840('0x5f')],{})[_0x5840('0x21')](respondWithResult(_0xf71c2,0xc9))['catch'](handleError(_0xf71c2,null));};exports[_0x5840('0x20')]=function(_0x232c8f,_0x1846df){if(_0x232c8f['body']['id']){delete _0x232c8f[_0x5840('0x5f')]['id'];}return db[_0x5840('0x2a')]['find']({'where':{'id':_0x232c8f['params']['id']}})[_0x5840('0x21')](handleEntityNotFound(_0x1846df,null))[_0x5840('0x21')](saveUpdates(_0x232c8f['body'],null))[_0x5840('0x21')](respondWithResult(_0x1846df,null))[_0x5840('0x57')](handleError(_0x1846df,null));};exports[_0x5840('0x60')]=function(_0x67a9a1,_0x573a05){return db[_0x5840('0x2a')]['describe']()[_0x5840('0x21')](respondWithResult(_0x573a05,null))['catch'](handleError(_0x573a05,null));};exports['destroy']=function(_0x21554a,_0x30c8db){var _0x43b740;return db['CmHopper'][_0x5840('0x5d')]({'where':{'id':_0x21554a['params']['id']}})[_0x5840('0x21')](handleEntityNotFound(_0x30c8db,null))[_0x5840('0x21')](function(_0x1d7cf7){if(_0x1d7cf7){return _0x1d7cf7['destroy']()[_0x5840('0x21')](function(_0x5d60d2){return _0x5d60d2;});}})[_0x5840('0x21')](function(_0x2938cc){_0x43b740=_0x2938cc;if(_0x2938cc){if(_0x2938cc[_0x5840('0x61')]||_0x2938cc[_0x5840('0x62')]){return db[_0x2938cc[_0x5840('0x61')]?_0x5840('0x63'):_0x5840('0x64')][_0x5840('0x5d')]({'where':{'id':_0x2938cc[_0x5840('0x61')]?_0x2938cc['VoiceQueueId']:_0x2938cc[_0x5840('0x62')]},'attributes':['id','name'],'raw':!![]});}}})[_0x5840('0x21')](function(_0x278d24){var _0x338ee3={};if(_0x278d24){_['merge'](_0x338ee3,_['omit'](_0x43b740[_0x5840('0x65')],[_0x5840('0x66'),_0x5840('0x67'),'id']));_0x338ee3[_0x5840('0x68')]=0x15;_0x338ee3[_0x5840('0x69')]='deleted';_0x338ee3[_0x5840('0x6a')]=_0x278d24['name'];_0x338ee3[_0x5840('0x6b')]=_0x21554a[_0x5840('0x6c')][_0x5840('0x26')];_0x338ee3[_0x5840('0x6d')]=_0x21554a[_0x5840('0x6c')]['id'];_0x338ee3['deleted']=!![];_0x338ee3['deletedat']=moment()[_0x5840('0x6e')](_0x5840('0x6f'));_0x338ee3[_0x5840('0x70')]=_0x43b740[_0x5840('0x71')];_0x338ee3[_0x5840('0x72')]=_0x43b740[_0x5840('0x61')]?_0x5840('0x73'):_0x5840('0x74');return db[_0x5840('0x75')][_0x5840('0x5d')]({'where':{'id':_0x338ee3[_0x5840('0x76')]},'attributes':['firstName',_0x5840('0x77')]})[_0x5840('0x21')](function(_0x44fe82){if(!_[_0x5840('0x78')](_0x30c8db)&&!_[_0x5840('0x78')](_0x44fe82['firstName'])){_0x338ee3[_0x5840('0x79')]=_0x44fe82[_0x5840('0x7a')];if(!_[_0x5840('0x78')](_0x44fe82['lastName'])){_0x338ee3['calleridname']+='\x20'+_0x44fe82[_0x5840('0x77')];}}})[_0x5840('0x7b')](function(){return db[_0x5840('0x7c')][_0x5840('0x5e')](_0x338ee3);});}})[_0x5840('0x21')](function(){return _0x30c8db['status'](0xcc)[_0x5840('0x18')]();})['catch'](handleError(_0x30c8db,null));};exports['getPreview']=function(_0x13946f,_0x44fa9c,_0xdd968c){var _0x113899=[];return db['CmContact'][_0x5840('0x60')]()['then'](function(_0x335345){_0x113899=_[_0x5840('0x31')](_0x335345);return _0x13946f['user'][_0x5840('0x7d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x5840('0x7e')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x5840('0x21')](function(_0x5d34ee){if(_0x5d34ee&&_0x5d34ee[_0x5840('0x4a')]){return db[_0x5840('0x7f')]['transaction'](function(_0x107bec){var _0x4f5f53={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5840('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5840('0x29')](_0x5d34ee,'id')},'$or':[{'UserId':null},{'UserId':_0x13946f[_0x5840('0x6c')]['id']}]};var _0x4006b7=[];if(_0x13946f['body'][_0x5840('0x80')]&&_0x13946f[_0x5840('0x5f')][_0x5840('0x80')]==='prev'){if(!_[_0x5840('0x81')](_0x13946f[_0x5840('0x5f')][_0x5840('0x82')])){_0x4f5f53['id']={'$in':_0x13946f[_0x5840('0x5f')][_0x5840('0x82')]};}_0x4006b7=[[_0x5840('0x83'),_0x5840('0x84')],[_0x5840('0x85'),_0x5d34ee[0x0][_0x5840('0x86')]==='ASC'?_0x5840('0x87'):_0x5840('0x84')],db[_0x5840('0x7f')]['literal'](_0x5840('0x88')),['id',_0x5840('0x87')]];}else{if(!_[_0x5840('0x81')](_0x13946f[_0x5840('0x5f')][_0x5840('0x82')])){_0x4f5f53['id']={'$notIn':_0x13946f[_0x5840('0x5f')]['hopperIds']};}_0x4006b7=[[_0x5840('0x83'),_0x5840('0x87')],['scheduledAt',_0x5d34ee[0x0][_0x5840('0x86')]],db['sequelize']['literal'](_0x5840('0x89')),['id',_0x5840('0x84')]];}return db[_0x5840('0x2a')][_0x5840('0x8a')]({'attributes':['id',_0x5840('0x8b')],'where':_0x4f5f53,'order':_0x4006b7,'transaction':_0x107bec,'lock':_0x107bec['LOCK'][_0x5840('0x8c')],'include':[{'model':db[_0x5840('0x75')],'as':_0x5840('0x8d'),'attributes':_0x113899,'include':[{'model':db['CmCompany'],'as':_0x5840('0x8e'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0x5840('0x8f'),'attributes':['id',_0x5840('0x26')]},{'model':db[_0x5840('0x63')],'as':'Queue','attributes':['id','name',_0x5840('0x90')]}]})[_0x5840('0x21')](function(_0x46611f){if(_0x46611f){return _0x46611f[_0x5840('0x20')]({'UserId':_0x13946f['user']['id']},{'transaction':_0x107bec});}});});}})['then'](handleEntityNotFound(_0x44fa9c,null))[_0x5840('0x21')](respondWithResult(_0x44fa9c,null))[_0x5840('0x57')](handleError(_0x44fa9c,null));};exports[_0x5840('0x91')]=function(_0x3515db,_0x5923c7,_0x3ff241){return _0x3515db['user'][_0x5840('0x7d')]({'where':{'type':_0x5840('0x92'),'dialActive':!![],'dialMethod':_0x5840('0x7e')},'attributes':['id'],'raw':!![]})[_0x5840('0x21')](function(_0xffe252){if(_0xffe252&&_0xffe252['length']){return db[_0x5840('0x2a')][_0x5840('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x5840('0x6f'))},'VoiceQueueId':{'$in':_[_0x5840('0x29')](_0xffe252,'id')},'$or':[{'UserId':null},{'UserId':_0x3515db['user']['id']}]}});}return 0x0;})[_0x5840('0x21')](function(_0x5841c7){if(!_['isNil'](_0x5841c7)&&_[_0x5840('0x93')](_0x5841c7)){return _0x5923c7[_0x5840('0x17')](0xc8)[_0x5840('0x19')]({'contacts':_0x5841c7});}else{logger['error'](_0x5840('0x94'),_0x5840('0x91'),0x194,_0x5840('0x95'));_0x5923c7[_0x5840('0x23')](0x194);}})[_0x5840('0x57')](handleError(_0x5923c7,null));};
\ No newline at end of file
+var _0x76d2=['then','destroy','error','stack','name','send','index','map','CmHopper','key','model','query','keys','filters','intersection','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','finally','end','getVoiceQueues','outbound','preview','transaction','format','direction','prev','isEmpty','hopperIds','ASC','dialOrderByScheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','isNumber','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update'];(function(_0x48abf0,_0x22a199){var _0x2b75e6=function(_0x59e940){while(--_0x59e940){_0x48abf0['push'](_0x48abf0['shift']());}};_0x2b75e6(++_0x22a199);}(_0x76d2,0xf3));var _0x276d=function(_0xee54c3,_0x219399){_0xee54c3=_0xee54c3-0x0;var _0x35b8ef=_0x76d2[_0xee54c3];return _0x35b8ef;};'use strict';var pdf=require(_0x276d('0x0'));var emlformat=require(_0x276d('0x1'));var rimraf=require(_0x276d('0x2'));var zipdir=require(_0x276d('0x3'));var jsonpatch=require(_0x276d('0x4'));var rp=require(_0x276d('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x276d('0x6'));var util=require('util');var path=require(_0x276d('0x7'));var sox=require(_0x276d('0x8'));var csv=require(_0x276d('0x9'));var ejs=require(_0x276d('0xa'));var fs=require('fs');var _=require(_0x276d('0xb'));var squel=require(_0x276d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x276d('0xd'));var toCsv=require(_0x276d('0x9'));var querystring=require(_0x276d('0xe'));var Papa=require(_0x276d('0xf'));var Redis=require('ioredis');var authService=require(_0x276d('0x10'));var qs=require(_0x276d('0x11'));var as=require(_0x276d('0x12'));var hardwareService=require(_0x276d('0x13'));var logger=require(_0x276d('0x14'))(_0x276d('0x15'));var utils=require('../../config/utils');var config=require(_0x276d('0x16'));var db=require(_0x276d('0x17'))['db'];function respondWithStatusCode(_0x270ae6,_0x47f366){_0x47f366=_0x47f366||0xcc;return function(_0x1c6a29){if(_0x1c6a29){return _0x270ae6[_0x276d('0x18')](_0x47f366);}return _0x270ae6[_0x276d('0x19')](_0x47f366)['end']();};}function respondWithResult(_0x30cc0c,_0x388504){_0x388504=_0x388504||0xc8;return function(_0x2cee26){if(_0x2cee26){return _0x30cc0c['status'](_0x388504)[_0x276d('0x1a')](_0x2cee26);}};}function respondWithFilteredResult(_0x573e8d,_0x2d3515){return function(_0x3e68bf){if(_0x3e68bf){var _0x3d3ccc=_0x3e68bf[_0x276d('0x1b')],_0x439c8d=_0x2d3515[_0x276d('0x1c')],_0x4831ee=_0x2d3515[_0x276d('0x1c')]+_0x2d3515[_0x276d('0x1d')],_0x74beab;if(_0x4831ee>=_0x3d3ccc){_0x4831ee=_0x3d3ccc;_0x74beab=0xc8;}else{_0x74beab=0xce;}_0x573e8d['status'](_0x74beab);return _0x573e8d[_0x276d('0x1e')]('Content-Range',_0x439c8d+'-'+_0x4831ee+'/'+_0x3d3ccc)[_0x276d('0x1a')](_0x3e68bf);}return null;};}function patchUpdates(_0x478fe5){return function(_0x50e217){try{jsonpatch[_0x276d('0x1f')](_0x50e217,_0x478fe5,!![]);}catch(_0x3f94f7){return BPromise[_0x276d('0x20')](_0x3f94f7);}return _0x50e217[_0x276d('0x21')]();};}function saveUpdates(_0x23ce98,_0x4c8802){return function(_0x587b72){if(_0x587b72){return _0x587b72[_0x276d('0x22')](_0x23ce98)[_0x276d('0x23')](function(_0x3a3ca5){return _0x3a3ca5;});}return null;};}function removeEntity(_0x14b401,_0xbdc4b7){return function(_0x296e9b){if(_0x296e9b){return _0x296e9b[_0x276d('0x24')]()[_0x276d('0x23')](function(){_0x14b401[_0x276d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fd7d,_0x34387a){return function(_0x533bd5){if(!_0x533bd5){_0x55fd7d[_0x276d('0x18')](0x194);}return _0x533bd5;};}function handleError(_0x3cf802,_0x3dfd28){_0x3dfd28=_0x3dfd28||0x1f4;return function(_0x185407){logger[_0x276d('0x25')](_0x185407[_0x276d('0x26')]);if(_0x185407[_0x276d('0x27')]){delete _0x185407['name'];}_0x3cf802[_0x276d('0x19')](_0x3dfd28)[_0x276d('0x28')](_0x185407);};}exports[_0x276d('0x29')]=function(_0x44e4b4,_0x470ae9){var _0xfd26cf={},_0x40b017={},_0x4c9ed9={'count':0x0,'rows':[]};var _0x52d5c9=_[_0x276d('0x2a')](db[_0x276d('0x2b')]['rawAttributes'],function(_0x31fa2d){return{'name':_0x31fa2d['fieldName'],'type':_0x31fa2d['type'][_0x276d('0x2c')]};});_0x40b017[_0x276d('0x2d')]=_[_0x276d('0x2a')](_0x52d5c9,'name');_0x40b017[_0x276d('0x2e')]=_[_0x276d('0x2f')](_0x44e4b4[_0x276d('0x2e')]);_0x40b017[_0x276d('0x30')]=_[_0x276d('0x31')](_0x40b017['model'],_0x40b017[_0x276d('0x2e')]);_0x40b017[_0x276d('0x30')]=_[_0x276d('0x32')](_0x40b017[_0x276d('0x30')],['$and',_0x276d('0x33'),_0x276d('0x34'),_0x276d('0x35'),_0x276d('0x36'),_0x276d('0x37'),_0x276d('0x38'),_0x276d('0x39'),'$not',_0x276d('0x3a'),_0x276d('0x3b'),'$in',_0x276d('0x3c'),_0x276d('0x3d'),_0x276d('0x3e'),_0x276d('0x3f'),_0x276d('0x40'),'$like',_0x276d('0x41'),_0x276d('0x42'),_0x276d('0x43'),'$any']);_0xfd26cf[_0x276d('0x44')]=_[_0x276d('0x31')](_0x40b017['model'],qs[_0x276d('0x45')](_0x44e4b4[_0x276d('0x2e')][_0x276d('0x45')]));_0xfd26cf[_0x276d('0x44')]=_0xfd26cf[_0x276d('0x44')]['length']?_0xfd26cf['attributes']:_0x40b017[_0x276d('0x2d')];if(!_0x44e4b4[_0x276d('0x2e')][_0x276d('0x46')]('nolimit')){_0xfd26cf[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x44e4b4[_0x276d('0x2e')][_0x276d('0x1d')]);_0xfd26cf[_0x276d('0x1c')]=qs['offset'](_0x44e4b4[_0x276d('0x2e')][_0x276d('0x1c')]);}_0xfd26cf['order']=qs[_0x276d('0x47')](_0x44e4b4[_0x276d('0x2e')][_0x276d('0x47')]);_0xfd26cf['where']=qs['filters'](_[_0x276d('0x48')](_0x44e4b4[_0x276d('0x2e')],_0x40b017[_0x276d('0x30')]),_0x52d5c9);if(_0x44e4b4[_0x276d('0x2e')][_0x276d('0x49')]){_0xfd26cf[_0x276d('0x4a')]=_[_0x276d('0x4b')](_0xfd26cf[_0x276d('0x4a')],{'$or':_[_0x276d('0x2a')](_0x52d5c9,function(_0x1ca0ec){if(_0x1ca0ec['type']!==_0x276d('0x4c')){var _0x446ad9={};_0x446ad9[_0x1ca0ec[_0x276d('0x27')]]={'$like':'%'+_0x44e4b4[_0x276d('0x2e')][_0x276d('0x49')]+'%'};return _0x446ad9;}})});}_0xfd26cf=_[_0x276d('0x4b')]({},_0xfd26cf,_0x44e4b4[_0x276d('0x4d')]);var _0x758840={'where':_0xfd26cf[_0x276d('0x4a')]};return db[_0x276d('0x2b')][_0x276d('0x1b')](_0x758840)[_0x276d('0x23')](function(_0x3ba6c3){_0x4c9ed9[_0x276d('0x1b')]=_0x3ba6c3;if(_0x44e4b4[_0x276d('0x2e')][_0x276d('0x4e')]){_0xfd26cf[_0x276d('0x4f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0xfd26cf);})[_0x276d('0x23')](function(_0x213ce7){_0x4c9ed9[_0x276d('0x50')]=_0x213ce7;return _0x4c9ed9;})[_0x276d('0x23')](respondWithFilteredResult(_0x470ae9,_0xfd26cf))[_0x276d('0x51')](handleError(_0x470ae9,null));};exports[_0x276d('0x52')]=function(_0x1baf72,_0x307f82){var _0x20d240={'raw':!![],'where':{'id':_0x1baf72[_0x276d('0x53')]['id']}},_0x55e9dc={};_0x55e9dc[_0x276d('0x2d')]=_['keys'](db[_0x276d('0x2b')][_0x276d('0x54')]);_0x55e9dc[_0x276d('0x2e')]=_[_0x276d('0x2f')](_0x1baf72[_0x276d('0x2e')]);_0x55e9dc[_0x276d('0x30')]=_[_0x276d('0x31')](_0x55e9dc['model'],_0x55e9dc['query']);_0x20d240[_0x276d('0x44')]=_[_0x276d('0x31')](_0x55e9dc[_0x276d('0x2d')],qs['fields'](_0x1baf72[_0x276d('0x2e')]['fields']));_0x20d240[_0x276d('0x44')]=_0x20d240[_0x276d('0x44')][_0x276d('0x55')]?_0x20d240[_0x276d('0x44')]:_0x55e9dc[_0x276d('0x2d')];if(_0x1baf72[_0x276d('0x2e')][_0x276d('0x4e')]){_0x20d240['include']=[{'all':!![]}];}_0x20d240=_[_0x276d('0x4b')]({},_0x20d240,_0x1baf72[_0x276d('0x4d')]);return db['CmHopper'][_0x276d('0x56')](_0x20d240)[_0x276d('0x23')](handleEntityNotFound(_0x307f82,null))[_0x276d('0x23')](respondWithResult(_0x307f82,null))[_0x276d('0x51')](handleError(_0x307f82,null));};exports[_0x276d('0x57')]=function(_0x5094b0,_0x4be23b){return db['CmHopper'][_0x276d('0x57')](_0x5094b0[_0x276d('0x58')],{})[_0x276d('0x23')](respondWithResult(_0x4be23b,0xc9))['catch'](handleError(_0x4be23b,null));};exports[_0x276d('0x22')]=function(_0xa0e0e0,_0x59e1dc){if(_0xa0e0e0[_0x276d('0x58')]['id']){delete _0xa0e0e0[_0x276d('0x58')]['id'];}return db[_0x276d('0x2b')]['find']({'where':{'id':_0xa0e0e0[_0x276d('0x53')]['id']}})[_0x276d('0x23')](handleEntityNotFound(_0x59e1dc,null))['then'](saveUpdates(_0xa0e0e0[_0x276d('0x58')],null))[_0x276d('0x23')](respondWithResult(_0x59e1dc,null))['catch'](handleError(_0x59e1dc,null));};exports['describe']=function(_0x184c4a,_0x546cce){return db[_0x276d('0x2b')][_0x276d('0x59')]()[_0x276d('0x23')](respondWithResult(_0x546cce,null))['catch'](handleError(_0x546cce,null));};exports[_0x276d('0x24')]=function(_0x1138a2,_0x2bc483){var _0x5d077c;return db[_0x276d('0x2b')][_0x276d('0x56')]({'where':{'id':_0x1138a2[_0x276d('0x53')]['id']}})[_0x276d('0x23')](handleEntityNotFound(_0x2bc483,null))['then'](function(_0x5543b0){if(_0x5543b0){return _0x5543b0[_0x276d('0x24')]()[_0x276d('0x23')](function(_0x125cb8){return _0x125cb8;});}})[_0x276d('0x23')](function(_0x67714c){_0x5d077c=_0x67714c;if(_0x67714c){if(_0x67714c[_0x276d('0x5a')]||_0x67714c[_0x276d('0x5b')]){return db[_0x67714c['VoiceQueueId']?_0x276d('0x5c'):'Campaign'][_0x276d('0x56')]({'where':{'id':_0x67714c[_0x276d('0x5a')]?_0x67714c[_0x276d('0x5a')]:_0x67714c[_0x276d('0x5b')]},'attributes':['id',_0x276d('0x27')],'raw':!![]});}}})[_0x276d('0x23')](function(_0x4003b4){var _0x42c964={};if(_0x4003b4){_[_0x276d('0x4b')](_0x42c964,_['omit'](_0x5d077c[_0x276d('0x5d')],['createdAt',_0x276d('0x5e'),'id']));_0x42c964[_0x276d('0x5f')]=0x15;_0x42c964[_0x276d('0x60')]=_0x276d('0x61');_0x42c964[_0x276d('0x62')]=_0x4003b4['name'];_0x42c964[_0x276d('0x63')]=_0x1138a2['user'][_0x276d('0x27')];_0x42c964['UserId']=_0x1138a2[_0x276d('0x64')]['id'];_0x42c964[_0x276d('0x61')]=!![];_0x42c964[_0x276d('0x65')]=moment()['format'](_0x276d('0x66'));_0x42c964['calleridnum']=_0x5d077c[_0x276d('0x67')];_0x42c964[_0x276d('0x68')]=_0x5d077c[_0x276d('0x5a')]?_0x276d('0x69'):_0x276d('0x6a');return db[_0x276d('0x6b')][_0x276d('0x56')]({'where':{'id':_0x42c964[_0x276d('0x6c')]},'attributes':[_0x276d('0x6d'),_0x276d('0x6e')]})[_0x276d('0x23')](function(_0x28e3c7){if(!_[_0x276d('0x6f')](_0x2bc483)&&!_[_0x276d('0x6f')](_0x28e3c7[_0x276d('0x6d')])){_0x42c964['calleridname']=_0x28e3c7[_0x276d('0x6d')];if(!_[_0x276d('0x6f')](_0x28e3c7['lastName'])){_0x42c964['calleridname']+='\x20'+_0x28e3c7[_0x276d('0x6e')];}}})[_0x276d('0x70')](function(){return db['CmHopperFinal']['create'](_0x42c964);});}})['then'](function(){return _0x2bc483[_0x276d('0x19')](0xcc)[_0x276d('0x71')]();})['catch'](handleError(_0x2bc483,null));};exports['getPreview']=function(_0x5c14cc,_0x5e66d8,_0x2a579a){var _0x4f8c5d=[];return db[_0x276d('0x6b')][_0x276d('0x59')]()[_0x276d('0x23')](function(_0x2973f7){_0x4f8c5d=_[_0x276d('0x2f')](_0x2973f7);return _0x5c14cc[_0x276d('0x64')][_0x276d('0x72')]({'where':{'type':_0x276d('0x73'),'dialActive':!![],'dialMethod':_0x276d('0x74')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x59d670){if(_0x59d670&&_0x59d670[_0x276d('0x55')]){return db['sequelize'][_0x276d('0x75')](function(_0x180a34){var _0x4e93cf={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x276d('0x76')](_0x276d('0x66'))},'VoiceQueueId':{'$in':_[_0x276d('0x2a')](_0x59d670,'id')},'$or':[{'UserId':null},{'UserId':_0x5c14cc[_0x276d('0x64')]['id']}]};var _0x5e58c9=[];if(_0x5c14cc[_0x276d('0x58')][_0x276d('0x77')]&&_0x5c14cc[_0x276d('0x58')][_0x276d('0x77')]===_0x276d('0x78')){if(!_[_0x276d('0x79')](_0x5c14cc[_0x276d('0x58')][_0x276d('0x7a')])){_0x4e93cf['id']={'$in':_0x5c14cc[_0x276d('0x58')]['hopperIds']};}_0x5e58c9=[['priority',_0x276d('0x7b')],['scheduledAt',_0x59d670[0x0][_0x276d('0x7c')]===_0x276d('0x7b')?_0x276d('0x7d'):_0x276d('0x7b')],db[_0x276d('0x7e')]['literal'](_0x276d('0x7f')),['id','DESC']];}else{if(!_[_0x276d('0x79')](_0x5c14cc[_0x276d('0x58')][_0x276d('0x7a')])){_0x4e93cf['id']={'$notIn':_0x5c14cc[_0x276d('0x58')][_0x276d('0x7a')]};}_0x5e58c9=[['priority',_0x276d('0x7d')],[_0x276d('0x80'),_0x59d670[0x0][_0x276d('0x7c')]],db[_0x276d('0x7e')][_0x276d('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x276d('0x7b')]];}return db[_0x276d('0x2b')]['findOne']({'attributes':['id','scheduledat'],'where':_0x4e93cf,'order':_0x5e58c9,'transaction':_0x180a34,'lock':_0x180a34['LOCK']['UPDATE'],'include':[{'model':db[_0x276d('0x6b')],'as':_0x276d('0x82'),'attributes':_0x4f8c5d,'include':[{'model':db[_0x276d('0x83')],'as':_0x276d('0x84'),'attributes':['id',_0x276d('0x27')]}]},{'model':db[_0x276d('0x85')],'as':_0x276d('0x86'),'attributes':['id','name']},{'model':db[_0x276d('0x5c')],'as':_0x276d('0x87'),'attributes':['id',_0x276d('0x27'),_0x276d('0x88')]}]})['then'](function(_0xfc1c78){if(_0xfc1c78){return _0xfc1c78[_0x276d('0x22')]({'UserId':_0x5c14cc['user']['id']},{'transaction':_0x180a34});}});});}})['then'](handleEntityNotFound(_0x5e66d8,null))['then'](respondWithResult(_0x5e66d8,null))[_0x276d('0x51')](handleError(_0x5e66d8,null));};exports[_0x276d('0x89')]=function(_0x2726a9,_0x38039c,_0x320db2){return _0x2726a9[_0x276d('0x64')][_0x276d('0x72')]({'where':{'type':_0x276d('0x73'),'dialActive':!![],'dialMethod':_0x276d('0x74')},'attributes':['id'],'raw':!![]})[_0x276d('0x23')](function(_0x37d504){if(_0x37d504&&_0x37d504[_0x276d('0x55')]){return db[_0x276d('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x37d504,'id')},'$or':[{'UserId':null},{'UserId':_0x2726a9[_0x276d('0x64')]['id']}]}});}return 0x0;})[_0x276d('0x23')](function(_0x3754ec){if(!_[_0x276d('0x6f')](_0x3754ec)&&_[_0x276d('0x8a')](_0x3754ec)){return _0x38039c[_0x276d('0x19')](0xc8)[_0x276d('0x1a')]({'contacts':_0x3754ec});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,'entity\x20not\x20found');_0x38039c[_0x276d('0x18')](0x194);}})[_0x276d('0x51')](handleError(_0x38039c,null));};
\ No newline at end of file
index 4d9cd9b..aa09fa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ef2=['moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','define','scheduledat','phone','priority','lodash','util','api'];(function(_0x336ce6,_0x7fd6b){var _0x557559=function(_0x28ee97){while(--_0x28ee97){_0x336ce6['push'](_0x336ce6['shift']());}};_0x557559(++_0x7fd6b);}(_0x3ef2,0x115));var _0x23ef=function(_0x2e23fd,_0xa7571f){_0x2e23fd=_0x2e23fd-0x0;var _0xa04920=_0x3ef2[_0x2e23fd];return _0xa04920;};'use strict';var _=require(_0x23ef('0x0'));var util=require(_0x23ef('0x1'));var logger=require('../../config/logger')(_0x23ef('0x2'));var moment=require(_0x23ef('0x3'));var BPromise=require(_0x23ef('0x4'));var rp=require(_0x23ef('0x5'));var fs=require('fs');var path=require(_0x23ef('0x6'));var rimraf=require('rimraf');var config=require(_0x23ef('0x7'));var attributes=require(_0x23ef('0x8'));module[_0x23ef('0x9')]=function(_0x3bd3d6,_0x400164){return _0x3bd3d6[_0x23ef('0xa')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x23ef('0xb'),'fields':['scheduledat']},{'name':'phone','fields':[_0x23ef('0xc')]},{'name':_0x23ef('0xd'),'fields':[_0x23ef('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc480=['define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xc480,0x139));var _0x0c48=function(_0x2f8da8,_0x5b193f){_0x2f8da8=_0x2f8da8-0x0;var _0x2efad0=_0xc480[_0x2f8da8];return _0x2efad0;};'use strict';var _=require(_0x0c48('0x0'));var util=require(_0x0c48('0x1'));var logger=require(_0x0c48('0x2'))('api');var moment=require(_0x0c48('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c48('0x4'));var rimraf=require(_0x0c48('0x5'));var config=require(_0x0c48('0x6'));var attributes=require(_0x0c48('0x7'));module[_0x0c48('0x8')]=function(_0x54957b,_0x5330ad){return _0x54957b[_0x0c48('0x9')](_0x0c48('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x0c48('0xb')]},{'name':_0x0c48('0xc'),'fields':[_0x0c48('0xc')]},{'name':_0x0c48('0xd'),'fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
index f77e229..f6361f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9534=['keys','User','name','includes','UserId','push','all','MoveContactManagedDialer','transaction','CmHopperFinal','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','contactsRescheduled','CountReScheduled','GetContactRecallMe','LOCK','length','GetCmHopperPreview','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','raw','limit','include','model','attributes','map','debug','ShowCmHopper','find','where','CreateCmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','Contact'];(function(_0x346967,_0x24d4b0){var _0xe2a99a=function(_0x27786e){while(--_0x27786e){_0x346967['push'](_0x346967['shift']());}};_0xe2a99a(++_0x24d4b0);}(_0x9534,0xdd));var _0x4953=function(_0x1fa79a,_0x4931cc){_0x1fa79a=_0x1fa79a-0x0;var _0x40aeaa=_0x9534[_0x1fa79a];return _0x40aeaa;};'use strict';var _=require('lodash');var util=require(_0x4953('0x0'));var moment=require(_0x4953('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4953('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4953('0x3'))(_0x4953('0x4'));var config=require(_0x4953('0x5'));var jayson=require(_0x4953('0x6'));var client=jayson[_0x4953('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x322445,_0x16d35c,_0x1afacd){return new BPromise(function(_0x14e909,_0x42a7a9){return client[_0x4953('0x8')](_0x322445,_0x1afacd)[_0x4953('0x9')](function(_0xf6d2d2){logger[_0x4953('0xa')](_0x4953('0xb'),_0x16d35c,_0x4953('0xc'));logger['debug'](_0x4953('0xd'),_0x16d35c,_0x4953('0xc'),JSON[_0x4953('0xe')](_0xf6d2d2));if(_0xf6d2d2['error']){if(_0xf6d2d2[_0x4953('0xf')][_0x4953('0x10')]===0x1f4){logger['error'](_0x4953('0xb'),_0x16d35c,_0xf6d2d2[_0x4953('0xf')][_0x4953('0x11')]);return _0x42a7a9(_0xf6d2d2[_0x4953('0xf')][_0x4953('0x11')]);}logger[_0x4953('0xf')](_0x4953('0xb'),_0x16d35c,_0xf6d2d2[_0x4953('0xf')][_0x4953('0x11')]);return _0x14e909(_0xf6d2d2[_0x4953('0xf')][_0x4953('0x11')]);}else{logger[_0x4953('0xa')](_0x4953('0xb'),_0x16d35c,_0x4953('0xc'));_0x14e909(_0xf6d2d2['result'][_0x4953('0x11')]);}})[_0x4953('0x12')](function(_0x1198e7){logger[_0x4953('0xf')](_0x4953('0xb'),_0x16d35c,_0x1198e7);_0x42a7a9(_0x1198e7);});});}exports[_0x4953('0x13')]=function(_0x23de4c){var _0x3b69b5=this;return new Promise(function(_0x5ec89f,_0x50d9c6){return db[_0x4953('0x14')][_0x4953('0x15')]({'raw':_0x23de4c[_0x4953('0x16')]?_0x23de4c[_0x4953('0x16')][_0x4953('0x17')]===undefined?!![]:![]:!![],'where':_0x23de4c[_0x4953('0x16')]?_0x23de4c[_0x4953('0x16')]['where']||null:null,'attributes':_0x23de4c[_0x4953('0x16')]?_0x23de4c[_0x4953('0x16')]['attributes']||null:null,'limit':_0x23de4c[_0x4953('0x16')]?_0x23de4c[_0x4953('0x16')][_0x4953('0x18')]||null:null,'include':_0x23de4c[_0x4953('0x16')]?_0x23de4c['options'][_0x4953('0x19')]?_['map'](_0x23de4c[_0x4953('0x16')]['include'],function(_0x4f14b1){return{'model':db[_0x4f14b1[_0x4953('0x1a')]],'as':_0x4f14b1['as'],'attributes':_0x4f14b1[_0x4953('0x1b')],'include':_0x4f14b1[_0x4953('0x19')]?_[_0x4953('0x1c')](_0x4f14b1[_0x4953('0x19')],function(_0x53b3e6){return{'model':db[_0x53b3e6[_0x4953('0x1a')]],'as':_0x53b3e6['as'],'attributes':_0x53b3e6[_0x4953('0x1b')],'include':_0x53b3e6[_0x4953('0x19')]?_[_0x4953('0x1c')](_0x53b3e6[_0x4953('0x19')],function(_0x9e7a00){return{'model':db[_0x9e7a00[_0x4953('0x1a')]],'as':_0x9e7a00['as'],'attributes':_0x9e7a00[_0x4953('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4953('0x9')](function(_0x2095cc){logger[_0x4953('0xa')](_0x4953('0x13'),_0x23de4c);logger[_0x4953('0x1d')](_0x4953('0x13'),_0x23de4c,JSON[_0x4953('0xe')](_0x2095cc));_0x5ec89f(_0x2095cc);})[_0x4953('0x12')](function(_0x27e5fa){logger[_0x4953('0xf')](_0x4953('0x13'),_0x27e5fa['message'],_0x23de4c);_0x50d9c6(_0x3b69b5['error'](0x1f4,_0x27e5fa[_0x4953('0x11')]));});});};exports[_0x4953('0x1e')]=function(_0x35f576){var _0x51d580=this;return new Promise(function(_0x13cbef,_0x583329){return db[_0x4953('0x14')][_0x4953('0x1f')]({'raw':_0x35f576['options']?_0x35f576[_0x4953('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x35f576[_0x4953('0x16')]?_0x35f576[_0x4953('0x16')][_0x4953('0x20')]||null:null,'attributes':_0x35f576[_0x4953('0x16')]?_0x35f576[_0x4953('0x16')]['attributes']||null:null,'include':_0x35f576[_0x4953('0x16')]?_0x35f576[_0x4953('0x16')]['include']?_['map'](_0x35f576[_0x4953('0x16')]['include'],function(_0x55709c){return{'model':db[_0x55709c[_0x4953('0x1a')]],'as':_0x55709c['as'],'attributes':_0x55709c['attributes'],'include':_0x55709c[_0x4953('0x19')]?_[_0x4953('0x1c')](_0x55709c[_0x4953('0x19')],function(_0x2b5845){return{'model':db[_0x2b5845[_0x4953('0x1a')]],'as':_0x2b5845['as'],'attributes':_0x2b5845[_0x4953('0x1b')],'include':_0x2b5845[_0x4953('0x19')]?_[_0x4953('0x1c')](_0x2b5845['include'],function(_0x427742){return{'model':db[_0x427742['model']],'as':_0x427742['as'],'attributes':_0x427742[_0x4953('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4953('0x9')](function(_0xd5aaef){logger[_0x4953('0xa')](_0x4953('0x1e'),_0x35f576);logger[_0x4953('0x1d')]('ShowCmHopper',_0x35f576,JSON['stringify'](_0xd5aaef));_0x13cbef(_0xd5aaef);})[_0x4953('0x12')](function(_0xa737a3){logger[_0x4953('0xf')](_0x4953('0x1e'),_0xa737a3[_0x4953('0x11')],_0x35f576);_0x583329(_0x51d580[_0x4953('0xf')](0x1f4,_0xa737a3[_0x4953('0x11')]));});});};exports[_0x4953('0x21')]=function(_0x4acf14){var _0x30e5c0=this;return new Promise(function(_0x2bd68f,_0xf61a41){return db[_0x4953('0x14')][_0x4953('0x22')](_0x4acf14[_0x4953('0x23')],{'raw':_0x4acf14[_0x4953('0x16')]?_0x4acf14[_0x4953('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x4953('0x9')](function(_0x181dad){logger['info'](_0x4953('0x21'),_0x4acf14);logger[_0x4953('0x1d')]('CreateCmHopper',_0x4acf14,JSON[_0x4953('0xe')](_0x181dad));_0x2bd68f(_0x181dad);})[_0x4953('0x12')](function(_0x983546){logger[_0x4953('0xf')]('CreateCmHopper',_0x983546[_0x4953('0x11')],_0x4acf14);_0xf61a41(_0x30e5c0[_0x4953('0xf')](0x1f4,_0x983546['message']));});});};exports['UpdateCmHopper']=function(_0x480899){var _0x2f9ba5=this;return new Promise(function(_0x834416,_0x2b43d7){return db[_0x4953('0x14')][_0x4953('0x24')](_0x480899[_0x4953('0x23')],{'raw':_0x480899[_0x4953('0x16')]?_0x480899[_0x4953('0x16')][_0x4953('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x480899['options']?_0x480899[_0x4953('0x16')]['where']||null:null,'attributes':_0x480899[_0x4953('0x16')]?_0x480899[_0x4953('0x16')]['attributes']||null:null,'limit':_0x480899[_0x4953('0x16')]?_0x480899[_0x4953('0x16')][_0x4953('0x18')]||null:null})[_0x4953('0x9')](function(_0x1b159d){logger[_0x4953('0xa')](_0x4953('0x25'),_0x480899);logger[_0x4953('0x1d')](_0x4953('0x25'),_0x480899,JSON[_0x4953('0xe')](_0x1b159d));_0x834416(_0x1b159d);})[_0x4953('0x12')](function(_0x3a7805){logger[_0x4953('0xf')](_0x4953('0x25'),_0x3a7805[_0x4953('0x11')],_0x480899);_0x2b43d7(_0x2f9ba5[_0x4953('0xf')](0x1f4,_0x3a7805[_0x4953('0x11')]));});});};exports[_0x4953('0x26')]=function(_0xebad53){var _0x2f7fc7=this;return new Promise(function(_0x551752,_0x5f4ffd){return db[_0x4953('0x14')][_0x4953('0x27')]({'where':_0xebad53[_0x4953('0x16')]?_0xebad53[_0x4953('0x16')][_0x4953('0x20')]||null:null})[_0x4953('0x9')](function(_0x25ce89){logger[_0x4953('0xa')](_0x4953('0x26'),_0xebad53);logger[_0x4953('0x1d')](_0x4953('0x26'),_0xebad53,JSON['stringify'](_0x25ce89));_0x551752(_0x25ce89);})[_0x4953('0x12')](function(_0x1e710b){logger[_0x4953('0xf')](_0x4953('0x26'),_0x1e710b[_0x4953('0x11')],_0xebad53);_0x5f4ffd(_0x2f7fc7[_0x4953('0xf')](0x1f4,_0x1e710b['message']));});});};exports[_0x4953('0x28')]=function(_0xbcc54b){var _0x29dd85=this;return new Promise(function(_0x1d691d,_0x40657d){return db[_0x4953('0x29')][_0x4953('0x2a')]()[_0x4953('0x9')](function(_0x1d14a6){return db[_0x4953('0x2b')]['transaction'](function(_0x392a85){return db[_0x4953('0x14')][_0x4953('0x15')]({'where':_0xbcc54b['options']?_0xbcc54b[_0x4953('0x16')][_0x4953('0x20')]||null:null,'attributes':_0xbcc54b[_0x4953('0x16')]?_0xbcc54b['options']['attributes']||null:null,'limit':_0xbcc54b[_0x4953('0x16')]?_0xbcc54b[_0x4953('0x16')][_0x4953('0x18')]||null:null,'order':_0xbcc54b[_0x4953('0x16')]?_0xbcc54b[_0x4953('0x16')][_0x4953('0x2c')]||null:null,'transaction':_0x392a85,'lock':_0x392a85['LOCK'][_0x4953('0x2d')],'include':[{'model':db[_0x4953('0x29')],'as':_0x4953('0x2e'),'attributes':_[_0x4953('0x2f')](_0x1d14a6)},{'model':db[_0x4953('0x30')],'as':'Agent','attributes':['id',_0x4953('0x31'),'voicePause']}]})[_0x4953('0x9')](function(_0xc41391){var _0x2cc015=[];var _0x2f1440=[];for(var _0xefc65c=0x0;_0xefc65c<_0xc41391['length'];_0xefc65c+=0x1){if(!_0x2f1440[_0x4953('0x32')](_0xc41391[_0xefc65c][_0x4953('0x33')])){_0x2f1440[_0x4953('0x34')](_0xc41391[_0xefc65c]['UserId']);_0x2cc015[_0x4953('0x34')](_0xc41391[_0xefc65c][_0x4953('0x24')](_0xbcc54b[_0x4953('0x23')],{'transaction':_0x392a85}));}}return BPromise[_0x4953('0x35')](_0x2cc015);});})['then'](function(_0x19fb5d){logger['info']('GetContactDialer',_0xbcc54b);logger[_0x4953('0x1d')](_0x4953('0x28'),_0xbcc54b,JSON[_0x4953('0xe')](_0x19fb5d));_0x1d691d(_0x19fb5d);})['catch'](function(_0x443b49){logger['error']('GetContactDialer',_0x443b49[_0x4953('0x11')],_0xbcc54b);_0x40657d(_0x29dd85['error'](0x1f4,_0x443b49[_0x4953('0x11')]));});});});};exports[_0x4953('0x36')]=function(_0x34247e){var _0x1715ca=this;return new Promise(function(_0x579e2f,_0x16faed){return db['sequelize'][_0x4953('0x37')](function(_0x375188){return db[_0x4953('0x38')][_0x4953('0x22')](_0x34247e[_0x4953('0x23')],{'raw':_0x34247e['options']?_0x34247e[_0x4953('0x16')][_0x4953('0x17')]===undefined?!![]:![]:!![],'transaction':_0x375188})['then'](function(){return db[_0x4953('0x14')]['destroy']({'where':_0x34247e[_0x4953('0x16')]?_0x34247e[_0x4953('0x16')]['where']||null:null,'transaction':_0x375188});});})[_0x4953('0x9')](function(_0x3bba97){logger[_0x4953('0xa')](_0x4953('0x36'),_0x34247e);logger[_0x4953('0x1d')](_0x4953('0x36'),_0x34247e,JSON[_0x4953('0xe')](_0x3bba97));_0x579e2f(_0x3bba97);})[_0x4953('0x12')](function(_0x56aaed){logger['error'](_0x4953('0x36'),_0x56aaed['message'],_0x34247e);_0x16faed(_0x1715ca[_0x4953('0xf')](0x1f4,_0x56aaed['message']));});});};exports['CountReScheduled']=function(_0x4bcd4c){var _0x392289=this;return new Promise(function(_0x16cfda,_0x34bb99){return db['CmHopper'][_0x4953('0x15')]({'raw':_0x4bcd4c[_0x4953('0x16')]?_0x4bcd4c[_0x4953('0x16')][_0x4953('0x17')]===undefined?!![]:![]:!![],'where':_0x4bcd4c[_0x4953('0x16')]?_0x4bcd4c[_0x4953('0x16')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x4953('0x39'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4953('0x3a')+util[_0x4953('0x3b')](_0x4953('0x3c'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x4953('0x3d')]]})[_0x4953('0x9')](function(_0x3c9822){logger[_0x4953('0xa')](_0x4953('0x3e'),_0x4bcd4c);logger['debug']('CountReScheduled',_0x4bcd4c,JSON[_0x4953('0xe')](_0x3c9822));_0x16cfda(_0x3c9822);})[_0x4953('0x12')](function(_0x397bd4){logger['error'](_0x4953('0x3e'),_0x397bd4[_0x4953('0x11')],_0x4bcd4c);_0x34bb99(_0x392289[_0x4953('0xf')](0x1f4,_0x397bd4[_0x4953('0x11')]));});});};exports[_0x4953('0x3f')]=function(_0x40b6b5){var _0x2bd92f=this;return new Promise(function(_0x48eb74,_0x2147cb){return db[_0x4953('0x29')]['describe']()[_0x4953('0x9')](function(_0x56c889){return db[_0x4953('0x2b')][_0x4953('0x37')](function(_0x4aaeaf){return db[_0x4953('0x14')][_0x4953('0x15')]({'where':_0x40b6b5[_0x4953('0x16')]?_0x40b6b5[_0x4953('0x16')][_0x4953('0x20')]||null:null,'attributes':_0x40b6b5[_0x4953('0x16')]?_0x40b6b5['options'][_0x4953('0x1b')]||null:null,'limit':0x1,'order':_0x40b6b5['options']?_0x40b6b5[_0x4953('0x16')][_0x4953('0x2c')]||null:null,'group':db[_0x4953('0x14')][_0x4953('0x33')],'transaction':_0x4aaeaf,'lock':_0x4aaeaf[_0x4953('0x40')][_0x4953('0x2d')],'include':_0x40b6b5[_0x4953('0x16')]?_0x40b6b5[_0x4953('0x16')]['include']?_[_0x4953('0x1c')](_0x40b6b5['options']['include'],function(_0x4f84ef){return{'model':db[_0x4f84ef[_0x4953('0x1a')]],'as':_0x4f84ef['as'],'attributes':_0x4f84ef[_0x4953('0x1b')],'include':_0x4f84ef[_0x4953('0x19')]?_[_0x4953('0x1c')](_0x4f84ef[_0x4953('0x19')],function(_0x34c02c){return{'model':db[_0x34c02c['model']],'as':_0x34c02c['as'],'attributes':_0x34c02c['attributes'],'include':_0x34c02c[_0x4953('0x19')]?_['map'](_0x34c02c[_0x4953('0x19')],function(_0x4e8a18){return{'model':db[_0x4e8a18[_0x4953('0x1a')]],'as':_0x4e8a18['as'],'attributes':_0x4e8a18[_0x4953('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x90129d){var _0x432e7f=[];for(var _0x50519a=0x0;_0x50519a<_0x90129d[_0x4953('0x41')];_0x50519a+=0x1){_0x432e7f[_0x4953('0x34')](_0x90129d[_0x50519a][_0x4953('0x24')](_0x40b6b5['body'],{'transaction':_0x4aaeaf}));}return BPromise[_0x4953('0x35')](_0x432e7f);});})[_0x4953('0x9')](function(_0x37a9fa){logger[_0x4953('0xa')]('GetContactRecallMe',_0x40b6b5);logger[_0x4953('0x1d')](_0x4953('0x3f'),_0x40b6b5,JSON[_0x4953('0xe')](_0x37a9fa));_0x48eb74(_0x37a9fa);})[_0x4953('0x12')](function(_0x384675){logger[_0x4953('0xf')](_0x4953('0x3f'),_0x384675[_0x4953('0x11')],_0x40b6b5);_0x2147cb(_0x2bd92f[_0x4953('0xf')](0x1f4,_0x384675[_0x4953('0x11')]));});});});};exports[_0x4953('0x42')]=function(_0x1ee6d0){var _0x3884f4=this;return new Promise(function(_0x3fa808,_0x15f847){db[_0x4953('0x29')][_0x4953('0x2a')]()[_0x4953('0x9')](function(_0x442da0){return db[_0x4953('0x14')]['findAll']({'raw':_0x1ee6d0['options']?_0x1ee6d0[_0x4953('0x16')][_0x4953('0x17')]===undefined?!![]:![]:!![],'where':_0x1ee6d0[_0x4953('0x16')]?_0x1ee6d0['options']['where']||null:null,'attributes':_0x1ee6d0[_0x4953('0x16')]?_0x1ee6d0[_0x4953('0x16')][_0x4953('0x1b')]||null:null,'limit':_0x1ee6d0[_0x4953('0x16')]?_0x1ee6d0[_0x4953('0x16')][_0x4953('0x18')]||null:null,'include':_0x1ee6d0[_0x4953('0x16')]?_0x1ee6d0[_0x4953('0x16')][_0x4953('0x19')]?_['map'](_0x1ee6d0[_0x4953('0x16')][_0x4953('0x19')],function(_0x5b12e7){return{'model':db[_0x5b12e7[_0x4953('0x1a')]],'as':_0x5b12e7['as'],'attributes':_0x5b12e7['as']==='Contact'?_[_0x4953('0x2f')](_0x442da0):_0x5b12e7[_0x4953('0x1b')],'include':_0x5b12e7[_0x4953('0x19')]?_[_0x4953('0x1c')](_0x5b12e7[_0x4953('0x19')],function(_0x186ace){return{'model':db[_0x186ace['model']],'as':_0x186ace['as'],'attributes':_0x186ace['attributes'],'include':_0x186ace[_0x4953('0x19')]?_[_0x4953('0x1c')](_0x186ace[_0x4953('0x19')],function(_0x2bdb0f){return{'model':db[_0x2bdb0f['model']],'as':_0x2bdb0f['as'],'attributes':_0x2bdb0f[_0x4953('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x288c15){logger[_0x4953('0xa')](_0x4953('0x13'),_0x1ee6d0);logger[_0x4953('0x1d')](_0x4953('0x13'),_0x1ee6d0,JSON[_0x4953('0xe')](_0x288c15));_0x3fa808(_0x288c15);})[_0x4953('0x12')](function(_0x706bf4){logger[_0x4953('0xf')]('GetCmHopper',_0x706bf4['message'],_0x1ee6d0);_0x15f847(_0x3884f4['error'](0x1f4,_0x706bf4[_0x4953('0x11')]));});});});};
\ No newline at end of file
+var _0x64cc=['describe','sequelize','order','LOCK','UPDATE','Contact','User','Agent','name','length','UserId','push','MoveContactManagedDialer','transaction','CmHopperFinal','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','keys','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','CmHopper,\x20%s,\x20%s','message','request\x20sent','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact'];(function(_0x39109d,_0x84e5ce){var _0x138412=function(_0x1c0418){while(--_0x1c0418){_0x39109d['push'](_0x39109d['shift']());}};_0x138412(++_0x84e5ce);}(_0x64cc,0x1cb));var _0xc64c=function(_0x190a34,_0x3cd1a2){_0x190a34=_0x190a34-0x0;var _0x1a83f3=_0x64cc[_0x190a34];return _0x1a83f3;};'use strict';var _=require('lodash');var util=require(_0xc64c('0x0'));var moment=require(_0xc64c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc64c('0x2'));var fs=require('fs');var Redis=require(_0xc64c('0x3'));var db=require(_0xc64c('0x4'))['db'];var utils=require(_0xc64c('0x5'));var logger=require(_0xc64c('0x6'))(_0xc64c('0x7'));var config=require(_0xc64c('0x8'));var jayson=require(_0xc64c('0x9'));var client=jayson[_0xc64c('0xa')][_0xc64c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a6925,_0x15e5c6,_0x36723a){return new BPromise(function(_0xd65b63,_0x28ec3f){return client[_0xc64c('0xc')](_0x2a6925,_0x36723a)['then'](function(_0x52a620){logger[_0xc64c('0xd')]('CmHopper,\x20%s,\x20%s',_0x15e5c6,'request\x20sent');logger[_0xc64c('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x15e5c6,'request\x20sent',JSON[_0xc64c('0xf')](_0x52a620));if(_0x52a620[_0xc64c('0x10')]){if(_0x52a620[_0xc64c('0x10')][_0xc64c('0x11')]===0x1f4){logger[_0xc64c('0x10')](_0xc64c('0x12'),_0x15e5c6,_0x52a620[_0xc64c('0x10')]['message']);return _0x28ec3f(_0x52a620[_0xc64c('0x10')][_0xc64c('0x13')]);}logger[_0xc64c('0x10')](_0xc64c('0x12'),_0x15e5c6,_0x52a620[_0xc64c('0x10')][_0xc64c('0x13')]);return _0xd65b63(_0x52a620[_0xc64c('0x10')]['message']);}else{logger[_0xc64c('0xd')](_0xc64c('0x12'),_0x15e5c6,_0xc64c('0x14'));_0xd65b63(_0x52a620['result'][_0xc64c('0x13')]);}})[_0xc64c('0x15')](function(_0x321581){logger[_0xc64c('0x10')](_0xc64c('0x12'),_0x15e5c6,_0x321581);_0x28ec3f(_0x321581);});});}exports[_0xc64c('0x16')]=function(_0x3a59ec){var _0x1ea849=this;return new Promise(function(_0x58cf72,_0x482f13){return db[_0xc64c('0x17')][_0xc64c('0x18')]({'raw':_0x3a59ec[_0xc64c('0x19')]?_0x3a59ec['options'][_0xc64c('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a59ec['options']?_0x3a59ec[_0xc64c('0x19')][_0xc64c('0x1b')]||null:null,'attributes':_0x3a59ec[_0xc64c('0x19')]?_0x3a59ec['options'][_0xc64c('0x1c')]||null:null,'limit':_0x3a59ec['options']?_0x3a59ec[_0xc64c('0x19')][_0xc64c('0x1d')]||null:null,'include':_0x3a59ec[_0xc64c('0x19')]?_0x3a59ec[_0xc64c('0x19')][_0xc64c('0x1e')]?_[_0xc64c('0x1f')](_0x3a59ec[_0xc64c('0x19')][_0xc64c('0x1e')],function(_0x406ced){return{'model':db[_0x406ced['model']],'as':_0x406ced['as'],'attributes':_0x406ced[_0xc64c('0x1c')],'include':_0x406ced['include']?_[_0xc64c('0x1f')](_0x406ced[_0xc64c('0x1e')],function(_0x10a3c5){return{'model':db[_0x10a3c5[_0xc64c('0x20')]],'as':_0x10a3c5['as'],'attributes':_0x10a3c5[_0xc64c('0x1c')],'include':_0x10a3c5[_0xc64c('0x1e')]?_[_0xc64c('0x1f')](_0x10a3c5[_0xc64c('0x1e')],function(_0x121eeb){return{'model':db[_0x121eeb[_0xc64c('0x20')]],'as':_0x121eeb['as'],'attributes':_0x121eeb['attributes']};}):[]};}):[]};}):[]:[]})[_0xc64c('0x21')](function(_0x4d2b06){logger[_0xc64c('0xd')]('GetCmHopper',_0x3a59ec);logger[_0xc64c('0xe')]('GetCmHopper',_0x3a59ec,JSON[_0xc64c('0xf')](_0x4d2b06));_0x58cf72(_0x4d2b06);})[_0xc64c('0x15')](function(_0x452ae3){logger[_0xc64c('0x10')](_0xc64c('0x16'),_0x452ae3[_0xc64c('0x13')],_0x3a59ec);_0x482f13(_0x1ea849[_0xc64c('0x10')](0x1f4,_0x452ae3[_0xc64c('0x13')]));});});};exports[_0xc64c('0x22')]=function(_0x4418f5){var _0x3af6a4=this;return new Promise(function(_0x53d154,_0x3eeb4f){return db[_0xc64c('0x17')][_0xc64c('0x23')]({'raw':_0x4418f5[_0xc64c('0x19')]?_0x4418f5['options'][_0xc64c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4418f5[_0xc64c('0x19')]?_0x4418f5['options'][_0xc64c('0x1b')]||null:null,'attributes':_0x4418f5['options']?_0x4418f5[_0xc64c('0x19')][_0xc64c('0x1c')]||null:null,'include':_0x4418f5['options']?_0x4418f5[_0xc64c('0x19')][_0xc64c('0x1e')]?_['map'](_0x4418f5['options'][_0xc64c('0x1e')],function(_0x557f8e){return{'model':db[_0x557f8e[_0xc64c('0x20')]],'as':_0x557f8e['as'],'attributes':_0x557f8e[_0xc64c('0x1c')],'include':_0x557f8e[_0xc64c('0x1e')]?_[_0xc64c('0x1f')](_0x557f8e[_0xc64c('0x1e')],function(_0x469d6d){return{'model':db[_0x469d6d[_0xc64c('0x20')]],'as':_0x469d6d['as'],'attributes':_0x469d6d['attributes'],'include':_0x469d6d['include']?_[_0xc64c('0x1f')](_0x469d6d[_0xc64c('0x1e')],function(_0x3f5387){return{'model':db[_0x3f5387[_0xc64c('0x20')]],'as':_0x3f5387['as'],'attributes':_0x3f5387[_0xc64c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc64c('0x21')](function(_0x39bf03){logger[_0xc64c('0xd')](_0xc64c('0x22'),_0x4418f5);logger[_0xc64c('0xe')](_0xc64c('0x22'),_0x4418f5,JSON[_0xc64c('0xf')](_0x39bf03));_0x53d154(_0x39bf03);})[_0xc64c('0x15')](function(_0x403ba3){logger[_0xc64c('0x10')]('ShowCmHopper',_0x403ba3['message'],_0x4418f5);_0x3eeb4f(_0x3af6a4[_0xc64c('0x10')](0x1f4,_0x403ba3[_0xc64c('0x13')]));});});};exports[_0xc64c('0x24')]=function(_0x53561a){var _0xa002fb=this;return new Promise(function(_0x2893e0,_0x7fc219){return db['CmHopper'][_0xc64c('0x25')](_0x53561a[_0xc64c('0x26')],{'raw':_0x53561a[_0xc64c('0x19')]?_0x53561a[_0xc64c('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xc64c('0x21')](function(_0x55f1c4){logger['info'](_0xc64c('0x24'),_0x53561a);logger[_0xc64c('0xe')]('CreateCmHopper',_0x53561a,JSON[_0xc64c('0xf')](_0x55f1c4));_0x2893e0(_0x55f1c4);})[_0xc64c('0x15')](function(_0x2d9593){logger[_0xc64c('0x10')]('CreateCmHopper',_0x2d9593[_0xc64c('0x13')],_0x53561a);_0x7fc219(_0xa002fb[_0xc64c('0x10')](0x1f4,_0x2d9593[_0xc64c('0x13')]));});});};exports[_0xc64c('0x27')]=function(_0x50a3e5){var _0x3817fa=this;return new Promise(function(_0x207dd4,_0x4628e3){return db[_0xc64c('0x17')][_0xc64c('0x28')](_0x50a3e5[_0xc64c('0x26')],{'raw':_0x50a3e5[_0xc64c('0x19')]?_0x50a3e5['options'][_0xc64c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50a3e5['options']?_0x50a3e5[_0xc64c('0x19')][_0xc64c('0x1b')]||null:null,'attributes':_0x50a3e5['options']?_0x50a3e5['options']['attributes']||null:null,'limit':_0x50a3e5[_0xc64c('0x19')]?_0x50a3e5[_0xc64c('0x19')][_0xc64c('0x1d')]||null:null})[_0xc64c('0x21')](function(_0x2c1dee){logger[_0xc64c('0xd')](_0xc64c('0x27'),_0x50a3e5);logger[_0xc64c('0xe')]('UpdateCmHopper',_0x50a3e5,JSON['stringify'](_0x2c1dee));_0x207dd4(_0x2c1dee);})[_0xc64c('0x15')](function(_0x22da80){logger[_0xc64c('0x10')](_0xc64c('0x27'),_0x22da80['message'],_0x50a3e5);_0x4628e3(_0x3817fa[_0xc64c('0x10')](0x1f4,_0x22da80[_0xc64c('0x13')]));});});};exports[_0xc64c('0x29')]=function(_0x2f0f26){var _0x491d4d=this;return new Promise(function(_0xfc58dd,_0x1bb656){return db[_0xc64c('0x17')][_0xc64c('0x2a')]({'where':_0x2f0f26[_0xc64c('0x19')]?_0x2f0f26[_0xc64c('0x19')][_0xc64c('0x1b')]||null:null})['then'](function(_0x58e94d){logger[_0xc64c('0xd')](_0xc64c('0x29'),_0x2f0f26);logger[_0xc64c('0xe')](_0xc64c('0x29'),_0x2f0f26,JSON[_0xc64c('0xf')](_0x58e94d));_0xfc58dd(_0x58e94d);})[_0xc64c('0x15')](function(_0x62633f){logger[_0xc64c('0x10')]('DestroyCmHopper',_0x62633f[_0xc64c('0x13')],_0x2f0f26);_0x1bb656(_0x491d4d[_0xc64c('0x10')](0x1f4,_0x62633f[_0xc64c('0x13')]));});});};exports[_0xc64c('0x2b')]=function(_0x3c5d74){var _0x280718=this;return new Promise(function(_0x5f3c22,_0x118cc5){return db[_0xc64c('0x2c')][_0xc64c('0x2d')]()[_0xc64c('0x21')](function(_0x2e2a04){return db[_0xc64c('0x2e')]['transaction'](function(_0x59ef1c){return db[_0xc64c('0x17')][_0xc64c('0x18')]({'where':_0x3c5d74[_0xc64c('0x19')]?_0x3c5d74[_0xc64c('0x19')][_0xc64c('0x1b')]||null:null,'attributes':_0x3c5d74[_0xc64c('0x19')]?_0x3c5d74['options'][_0xc64c('0x1c')]||null:null,'limit':_0x3c5d74[_0xc64c('0x19')]?_0x3c5d74[_0xc64c('0x19')][_0xc64c('0x1d')]||null:null,'order':_0x3c5d74[_0xc64c('0x19')]?_0x3c5d74[_0xc64c('0x19')][_0xc64c('0x2f')]||null:null,'transaction':_0x59ef1c,'lock':_0x59ef1c[_0xc64c('0x30')][_0xc64c('0x31')],'include':[{'model':db[_0xc64c('0x2c')],'as':_0xc64c('0x32'),'attributes':_['keys'](_0x2e2a04)},{'model':db[_0xc64c('0x33')],'as':_0xc64c('0x34'),'attributes':['id',_0xc64c('0x35'),'voicePause']}]})['then'](function(_0x55eaf4){var _0x2a5c8d=[];var _0x26fccd=[];for(var _0x57c30b=0x0;_0x57c30b<_0x55eaf4[_0xc64c('0x36')];_0x57c30b+=0x1){if(!_0x26fccd['includes'](_0x55eaf4[_0x57c30b][_0xc64c('0x37')])){_0x26fccd[_0xc64c('0x38')](_0x55eaf4[_0x57c30b][_0xc64c('0x37')]);_0x2a5c8d['push'](_0x55eaf4[_0x57c30b]['update'](_0x3c5d74[_0xc64c('0x26')],{'transaction':_0x59ef1c}));}}return BPromise['all'](_0x2a5c8d);});})[_0xc64c('0x21')](function(_0x3005e2){logger['info'](_0xc64c('0x2b'),_0x3c5d74);logger[_0xc64c('0xe')](_0xc64c('0x2b'),_0x3c5d74,JSON[_0xc64c('0xf')](_0x3005e2));_0x5f3c22(_0x3005e2);})[_0xc64c('0x15')](function(_0x28ed26){logger[_0xc64c('0x10')]('GetContactDialer',_0x28ed26[_0xc64c('0x13')],_0x3c5d74);_0x118cc5(_0x280718[_0xc64c('0x10')](0x1f4,_0x28ed26[_0xc64c('0x13')]));});});});};exports[_0xc64c('0x39')]=function(_0x2fee28){var _0x3c2cf8=this;return new Promise(function(_0x223f3e,_0x73674a){return db[_0xc64c('0x2e')][_0xc64c('0x3a')](function(_0x49cd1d){return db[_0xc64c('0x3b')][_0xc64c('0x25')](_0x2fee28['body'],{'raw':_0x2fee28[_0xc64c('0x19')]?_0x2fee28[_0xc64c('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x49cd1d})['then'](function(){return db[_0xc64c('0x17')][_0xc64c('0x2a')]({'where':_0x2fee28['options']?_0x2fee28['options'][_0xc64c('0x1b')]||null:null,'transaction':_0x49cd1d});});})[_0xc64c('0x21')](function(_0x7297bf){logger[_0xc64c('0xd')](_0xc64c('0x39'),_0x2fee28);logger['debug']('MoveContactManagedDialer',_0x2fee28,JSON[_0xc64c('0xf')](_0x7297bf));_0x223f3e(_0x7297bf);})[_0xc64c('0x15')](function(_0x2dafcc){logger[_0xc64c('0x10')]('MoveContactManagedDialer',_0x2dafcc[_0xc64c('0x13')],_0x2fee28);_0x73674a(_0x3c2cf8[_0xc64c('0x10')](0x1f4,_0x2dafcc[_0xc64c('0x13')]));});});};exports['CountReScheduled']=function(_0x4da647){var _0x1a3b52=this;return new Promise(function(_0x5df973,_0x49764d){return db[_0xc64c('0x17')][_0xc64c('0x18')]({'raw':_0x4da647[_0xc64c('0x19')]?_0x4da647[_0xc64c('0x19')][_0xc64c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4da647[_0xc64c('0x19')]?_0x4da647[_0xc64c('0x19')][_0xc64c('0x1b')]||null:null,'attributes':[[db[_0xc64c('0x2e')]['fn'](_0xc64c('0x3c'),db[_0xc64c('0x2e')]['fn']('IF',db[_0xc64c('0x2e')][_0xc64c('0x3d')](_0xc64c('0x3e')+util[_0xc64c('0x3f')](_0xc64c('0x40'),moment()[_0xc64c('0x3f')](_0xc64c('0x41')))+_0xc64c('0x42')))),_0xc64c('0x43')]]})[_0xc64c('0x21')](function(_0x1d9a2a){logger['info'](_0xc64c('0x44'),_0x4da647);logger['debug'](_0xc64c('0x44'),_0x4da647,JSON[_0xc64c('0xf')](_0x1d9a2a));_0x5df973(_0x1d9a2a);})[_0xc64c('0x15')](function(_0x51c763){logger[_0xc64c('0x10')]('CountReScheduled',_0x51c763[_0xc64c('0x13')],_0x4da647);_0x49764d(_0x1a3b52[_0xc64c('0x10')](0x1f4,_0x51c763[_0xc64c('0x13')]));});});};exports[_0xc64c('0x45')]=function(_0x26f873){var _0x19c8c1=this;return new Promise(function(_0x53d54e,_0x41350b){return db[_0xc64c('0x2c')]['describe']()[_0xc64c('0x21')](function(_0x5ab43e){return db[_0xc64c('0x2e')][_0xc64c('0x3a')](function(_0x5075e8){return db['CmHopper'][_0xc64c('0x18')]({'where':_0x26f873['options']?_0x26f873['options'][_0xc64c('0x1b')]||null:null,'attributes':_0x26f873[_0xc64c('0x19')]?_0x26f873[_0xc64c('0x19')]['attributes']||null:null,'limit':0x1,'order':_0x26f873['options']?_0x26f873[_0xc64c('0x19')][_0xc64c('0x2f')]||null:null,'group':db[_0xc64c('0x17')][_0xc64c('0x37')],'transaction':_0x5075e8,'lock':_0x5075e8['LOCK']['UPDATE'],'include':_0x26f873[_0xc64c('0x19')]?_0x26f873[_0xc64c('0x19')]['include']?_[_0xc64c('0x1f')](_0x26f873[_0xc64c('0x19')][_0xc64c('0x1e')],function(_0x47b0ec){return{'model':db[_0x47b0ec[_0xc64c('0x20')]],'as':_0x47b0ec['as'],'attributes':_0x47b0ec['attributes'],'include':_0x47b0ec[_0xc64c('0x1e')]?_[_0xc64c('0x1f')](_0x47b0ec[_0xc64c('0x1e')],function(_0x1a77de){return{'model':db[_0x1a77de[_0xc64c('0x20')]],'as':_0x1a77de['as'],'attributes':_0x1a77de[_0xc64c('0x1c')],'include':_0x1a77de[_0xc64c('0x1e')]?_['map'](_0x1a77de[_0xc64c('0x1e')],function(_0x281584){return{'model':db[_0x281584['model']],'as':_0x281584['as'],'attributes':_0x281584[_0xc64c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc64c('0x21')](function(_0x143036){var _0x1b0263=[];for(var _0x2789d7=0x0;_0x2789d7<_0x143036['length'];_0x2789d7+=0x1){_0x1b0263[_0xc64c('0x38')](_0x143036[_0x2789d7][_0xc64c('0x28')](_0x26f873[_0xc64c('0x26')],{'transaction':_0x5075e8}));}return BPromise['all'](_0x1b0263);});})['then'](function(_0x8ee54e){logger[_0xc64c('0xd')](_0xc64c('0x45'),_0x26f873);logger[_0xc64c('0xe')]('GetContactRecallMe',_0x26f873,JSON[_0xc64c('0xf')](_0x8ee54e));_0x53d54e(_0x8ee54e);})[_0xc64c('0x15')](function(_0x3d946a){logger['error']('GetContactRecallMe',_0x3d946a['message'],_0x26f873);_0x41350b(_0x19c8c1['error'](0x1f4,_0x3d946a['message']));});});});};exports[_0xc64c('0x46')]=function(_0x302e49){var _0x369c63=this;return new Promise(function(_0x1d1363,_0x5b8b24){db[_0xc64c('0x2c')][_0xc64c('0x2d')]()[_0xc64c('0x21')](function(_0x506378){return db['CmHopper'][_0xc64c('0x18')]({'raw':_0x302e49[_0xc64c('0x19')]?_0x302e49['options'][_0xc64c('0x1a')]===undefined?!![]:![]:!![],'where':_0x302e49[_0xc64c('0x19')]?_0x302e49[_0xc64c('0x19')]['where']||null:null,'attributes':_0x302e49['options']?_0x302e49['options'][_0xc64c('0x1c')]||null:null,'limit':_0x302e49[_0xc64c('0x19')]?_0x302e49[_0xc64c('0x19')]['limit']||null:null,'include':_0x302e49[_0xc64c('0x19')]?_0x302e49[_0xc64c('0x19')][_0xc64c('0x1e')]?_[_0xc64c('0x1f')](_0x302e49[_0xc64c('0x19')]['include'],function(_0x3029e7){return{'model':db[_0x3029e7[_0xc64c('0x20')]],'as':_0x3029e7['as'],'attributes':_0x3029e7['as']===_0xc64c('0x32')?_[_0xc64c('0x47')](_0x506378):_0x3029e7[_0xc64c('0x1c')],'include':_0x3029e7['include']?_[_0xc64c('0x1f')](_0x3029e7[_0xc64c('0x1e')],function(_0x2c9fb3){return{'model':db[_0x2c9fb3[_0xc64c('0x20')]],'as':_0x2c9fb3['as'],'attributes':_0x2c9fb3[_0xc64c('0x1c')],'include':_0x2c9fb3['include']?_[_0xc64c('0x1f')](_0x2c9fb3['include'],function(_0x44acee){return{'model':db[_0x44acee[_0xc64c('0x20')]],'as':_0x44acee['as'],'attributes':_0x44acee[_0xc64c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc64c('0x21')](function(_0x373706){logger[_0xc64c('0xd')]('GetCmHopper',_0x302e49);logger[_0xc64c('0xe')](_0xc64c('0x16'),_0x302e49,JSON['stringify'](_0x373706));_0x1d1363(_0x373706);})['catch'](function(_0x22c9ec){logger[_0xc64c('0x10')]('GetCmHopper',_0x22c9ec[_0xc64c('0x13')],_0x302e49);_0x5b8b24(_0x369c63[_0xc64c('0x10')](0x1f4,_0x22c9ec[_0xc64c('0x13')]));});});});};
\ No newline at end of file
index bf2794c..f9fb566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a3=['/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','destroy','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','describe'];(function(_0x274b6c,_0x591ade){var _0x303f73=function(_0x452ab5){while(--_0x452ab5){_0x274b6c['push'](_0x274b6c['shift']());}};_0x303f73(++_0x591ade);}(_0x23a3,0x131));var _0x323a=function(_0x459df6,_0x71e21a){_0x459df6=_0x459df6-0x0;var _0x584307=_0x23a3[_0x459df6];return _0x584307;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x323a('0x0'));var express=require('express');var router=express[_0x323a('0x1')]();var auth=require(_0x323a('0x2'));var interaction=require(_0x323a('0x3'));var config=require(_0x323a('0x4'));var controller=require(_0x323a('0x5'));router[_0x323a('0x6')]('/',auth[_0x323a('0x7')](),controller[_0x323a('0x8')]);router[_0x323a('0x6')]('/describe',auth[_0x323a('0x7')](),controller[_0x323a('0x9')]);router['get'](_0x323a('0xa'),auth[_0x323a('0x7')](),controller[_0x323a('0xb')]);router['get'](_0x323a('0xc'),auth[_0x323a('0x7')](),controller[_0x323a('0xd')]);router[_0x323a('0xe')]('/',auth[_0x323a('0x7')](),controller[_0x323a('0xf')]);router[_0x323a('0xe')](_0x323a('0x10'),auth[_0x323a('0x7')](),controller[_0x323a('0x11')]);router[_0x323a('0x12')](_0x323a('0xc'),auth[_0x323a('0x7')](),controller[_0x323a('0x13')]);router['delete'](_0x323a('0xc'),auth['isAuthenticated'](),controller[_0x323a('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xbf13=['create','post','put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','describe','getOpenContacts','/:id','show'];(function(_0x49af86,_0x2cc09f){var _0x276f0f=function(_0x3e5257){while(--_0x3e5257){_0x49af86['push'](_0x49af86['shift']());}};_0x276f0f(++_0x2cc09f);}(_0xbf13,0xe2));var _0x3bf1=function(_0x42589e,_0x95ceae){_0x42589e=_0x42589e-0x0;var _0x23d290=_0xbf13[_0x42589e];return _0x23d290;};'use strict';var multer=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var path=require(_0x3bf1('0x2'));var timeout=require(_0x3bf1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3bf1('0x4'));var interaction=require(_0x3bf1('0x5'));var config=require('../../config/environment');var controller=require(_0x3bf1('0x6'));router[_0x3bf1('0x7')]('/',auth[_0x3bf1('0x8')](),controller[_0x3bf1('0x9')]);router[_0x3bf1('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x3bf1('0xa')]);router[_0x3bf1('0x7')]('/opencontacts',auth[_0x3bf1('0x8')](),controller[_0x3bf1('0xb')]);router[_0x3bf1('0x7')](_0x3bf1('0xc'),auth[_0x3bf1('0x8')](),controller[_0x3bf1('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3bf1('0xe')]);router[_0x3bf1('0xf')]('/preview',auth[_0x3bf1('0x8')](),controller['getPreview']);router[_0x3bf1('0x10')](_0x3bf1('0xc'),auth[_0x3bf1('0x8')](),controller[_0x3bf1('0x11')]);router[_0x3bf1('0x12')](_0x3bf1('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3bf1('0x13')]=router;
\ No newline at end of file
index e267520..2861e4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814f=['sequelize','STRING','INTEGER','contactListQueue'];(function(_0x544c03,_0x558fe4){var _0x5e86ad=function(_0x3b2aaf){while(--_0x3b2aaf){_0x544c03['push'](_0x544c03['shift']());}};_0x5e86ad(++_0x558fe4);}(_0x814f,0x184));var _0xf814=function(_0x1c834d,_0x1ee167){_0x1c834d=_0x1c834d-0x0;var _0x561ccc=_0x814f[_0x1c834d];return _0x561ccc;};'use strict';var moment=require('moment');var Sequelize=require(_0xf814('0x0'));module['exports']={'phone':{'type':Sequelize[_0xf814('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf814('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xf814('0x3')},'VoiceQueueId':{'type':Sequelize[_0xf814('0x2')],'unique':'contactListQueue'}};
\ No newline at end of file
+var _0x0130=['exports','INTEGER','contactListQueue','moment','sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0130,0xc1));var _0x0013=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0x0130[_0xac0de1];return _0x1c1995;};'use strict';var moment=require(_0x0013('0x0'));var Sequelize=require(_0x0013('0x1'));module[_0x0013('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0013('0x3')],'unique':_0x0013('0x4')},'ListId':{'type':Sequelize[_0x0013('0x3')],'unique':_0x0013('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x0013('0x4')}};
\ No newline at end of file
index 8294fb4..b9501a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0xb40f71,_0x2aec55){var _0x56c587=function(_0x4fb411){while(--_0x4fb411){_0xb40f71['push'](_0xb40f71['shift']());}};_0x56c587(++_0x2aec55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x51e7ba,_0x32044f){var _0x21000b=function(_0x51764a){while(--_0x51764a){_0x51e7ba['push'](_0x51e7ba['shift']());}};_0x21000b(++_0x32044f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));};
\ No newline at end of file
index c718807..aa88f95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb855=['moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api'];(function(_0x7df7eb,_0x5e4020){var _0xc337d7=function(_0x479579){while(--_0x479579){_0x7df7eb['push'](_0x7df7eb['shift']());}};_0xc337d7(++_0x5e4020);}(_0xb855,0x189));var _0x5b85=function(_0x1fb7c9,_0xb14ddf){_0x1fb7c9=_0x1fb7c9-0x0;var _0x5f0c3a=_0xb855[_0x1fb7c9];return _0x5f0c3a;};'use strict';var _=require('lodash');var util=require(_0x5b85('0x0'));var logger=require(_0x5b85('0x1'))(_0x5b85('0x2'));var moment=require(_0x5b85('0x3'));var BPromise=require('bluebird');var rp=require(_0x5b85('0x4'));var fs=require('fs');var path=require(_0x5b85('0x5'));var rimraf=require('rimraf');var config=require(_0x5b85('0x6'));var attributes=require(_0x5b85('0x7'));module['exports']=function(_0x3541e0,_0x3f8b79){return _0x3541e0[_0x5b85('0x8')](_0x5b85('0x9'),attributes,{'tableName':_0x5b85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9528=['define','CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x2583b1,_0x1aadda){var _0x43dc5e=function(_0x56882b){while(--_0x56882b){_0x2583b1['push'](_0x2583b1['shift']());}};_0x43dc5e(++_0x1aadda);}(_0x9528,0x1bc));var _0x8952=function(_0x113e23,_0x8dcb5f){_0x113e23=_0x113e23-0x0;var _0x4f858c=_0x9528[_0x113e23];return _0x4f858c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8952('0x0'))(_0x8952('0x1'));var moment=require(_0x8952('0x2'));var BPromise=require(_0x8952('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8952('0x4'));var rimraf=require('rimraf');var config=require(_0x8952('0x5'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x28999f,_0x1d1975){return _0x28999f[_0x8952('0x6')](_0x8952('0x7'),attributes,{'tableName':_0x8952('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5b8686..c22c7d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x409e=['request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetCmHopperBlack','CmHopperBlack','options','where','limit','include','map','model','attributes','catch','body','raw','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0x409e,0x19b));var _0xe409=function(_0x55d911,_0x2b768c){_0x55d911=_0x55d911-0x0;var _0x3104c2=_0x409e[_0x55d911];return _0x3104c2;};'use strict';var _=require(_0xe409('0x0'));var util=require('util');var moment=require(_0xe409('0x1'));var BPromise=require('bluebird');var rs=require(_0xe409('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe409('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe409('0x4'))(_0xe409('0x5'));var config=require(_0xe409('0x6'));var jayson=require(_0xe409('0x7'));var client=jayson[_0xe409('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x162d78,_0x4cf19f,_0x391689){return new BPromise(function(_0x50b345,_0x3f4c92){return client[_0xe409('0x9')](_0x162d78,_0x391689)[_0xe409('0xa')](function(_0x5639e7){logger[_0xe409('0xb')](_0xe409('0xc'),_0x4cf19f,_0xe409('0xd'));logger[_0xe409('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4cf19f,'request\x20sent',JSON[_0xe409('0xf')](_0x5639e7));if(_0x5639e7[_0xe409('0x10')]){if(_0x5639e7['error'][_0xe409('0x11')]===0x1f4){logger[_0xe409('0x10')](_0xe409('0xc'),_0x4cf19f,_0x5639e7[_0xe409('0x10')][_0xe409('0x12')]);return _0x3f4c92(_0x5639e7[_0xe409('0x10')][_0xe409('0x12')]);}logger['error'](_0xe409('0xc'),_0x4cf19f,_0x5639e7[_0xe409('0x10')]['message']);return _0x50b345(_0x5639e7[_0xe409('0x10')][_0xe409('0x12')]);}else{logger['info'](_0xe409('0xc'),_0x4cf19f,_0xe409('0xd'));_0x50b345(_0x5639e7[_0xe409('0x13')][_0xe409('0x12')]);}})['catch'](function(_0x41932a){logger['error'](_0xe409('0xc'),_0x4cf19f,_0x41932a);_0x3f4c92(_0x41932a);});});}exports[_0xe409('0x14')]=function(_0x101d19){var _0x3208bd=this;return new Promise(function(_0x5c84f5,_0x1a105b){return db[_0xe409('0x15')]['findAll']({'raw':_0x101d19['options']?_0x101d19['options']['raw']===undefined?!![]:![]:!![],'where':_0x101d19[_0xe409('0x16')]?_0x101d19[_0xe409('0x16')][_0xe409('0x17')]||null:null,'attributes':_0x101d19[_0xe409('0x16')]?_0x101d19['options']['attributes']||null:null,'limit':_0x101d19[_0xe409('0x16')]?_0x101d19[_0xe409('0x16')][_0xe409('0x18')]||null:null,'include':_0x101d19[_0xe409('0x16')]?_0x101d19['options'][_0xe409('0x19')]?_[_0xe409('0x1a')](_0x101d19['options'][_0xe409('0x19')],function(_0xe46452){return{'model':db[_0xe46452[_0xe409('0x1b')]],'as':_0xe46452['as'],'attributes':_0xe46452[_0xe409('0x1c')],'include':_0xe46452['include']?_[_0xe409('0x1a')](_0xe46452['include'],function(_0x58883a){return{'model':db[_0x58883a[_0xe409('0x1b')]],'as':_0x58883a['as'],'attributes':_0x58883a['attributes'],'include':_0x58883a[_0xe409('0x19')]?_[_0xe409('0x1a')](_0x58883a[_0xe409('0x19')],function(_0x11d8d3){return{'model':db[_0x11d8d3[_0xe409('0x1b')]],'as':_0x11d8d3['as'],'attributes':_0x11d8d3[_0xe409('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f2965){logger[_0xe409('0xb')]('GetCmHopperBlack',_0x101d19);logger[_0xe409('0xe')]('GetCmHopperBlack',_0x101d19,JSON['stringify'](_0x3f2965));_0x5c84f5(_0x3f2965);})[_0xe409('0x1d')](function(_0x47c83a){logger[_0xe409('0x10')](_0xe409('0x14'),_0x47c83a[_0xe409('0x12')],_0x101d19);_0x1a105b(_0x3208bd[_0xe409('0x10')](0x1f4,_0x47c83a['message']));});});};exports['UpdateCmHopperBlack']=function(_0x3cd313){var _0x3191a7=this;return new Promise(function(_0x348541,_0x13b281){return db[_0xe409('0x15')]['update'](_0x3cd313[_0xe409('0x1e')],{'raw':_0x3cd313[_0xe409('0x16')]?_0x3cd313['options'][_0xe409('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cd313[_0xe409('0x16')]?_0x3cd313[_0xe409('0x16')]['where']||null:null,'attributes':_0x3cd313['options']?_0x3cd313[_0xe409('0x16')]['attributes']||null:null,'limit':_0x3cd313['options']?_0x3cd313[_0xe409('0x16')][_0xe409('0x18')]||null:null})[_0xe409('0xa')](function(_0x5d7946){logger['info']('UpdateCmHopperBlack',_0x3cd313);logger[_0xe409('0xe')]('UpdateCmHopperBlack',_0x3cd313,JSON['stringify'](_0x5d7946));_0x348541(_0x5d7946);})[_0xe409('0x1d')](function(_0xed3810){logger['error'](_0xe409('0x20'),_0xed3810[_0xe409('0x12')],_0x3cd313);_0x13b281(_0x3191a7[_0xe409('0x10')](0x1f4,_0xed3810['message']));});});};exports[_0xe409('0x21')]=function(_0x49a370){var _0x4b161c=this;return new Promise(function(_0x25b38c,_0x4227e2){return db[_0xe409('0x15')][_0xe409('0x22')]({'where':_0x49a370['options']?_0x49a370['options'][_0xe409('0x17')]||null:null})[_0xe409('0xa')](function(_0x18d081){logger[_0xe409('0xb')](_0xe409('0x21'),_0x49a370);logger[_0xe409('0xe')]('DestroyCmHopperBlack',_0x49a370,JSON[_0xe409('0xf')](_0x18d081));_0x25b38c(_0x18d081);})[_0xe409('0x1d')](function(_0x18ab54){logger[_0xe409('0x10')](_0xe409('0x21'),_0x18ab54[_0xe409('0x12')],_0x49a370);_0x4227e2(_0x4b161c[_0xe409('0x10')](0x1f4,_0x18ab54[_0xe409('0x12')]));});});};
\ No newline at end of file
+var _0x6f94=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','map','model','attributes','stringify','UpdateCmHopperBlack','body','where','DestroyCmHopperBlack','destroy','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x6f94,0x148));var _0x46f9=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x6f94[_0x42bdad];return _0x122626;};'use strict';var _=require('lodash');var util=require(_0x46f9('0x0'));var moment=require(_0x46f9('0x1'));var BPromise=require(_0x46f9('0x2'));var rs=require(_0x46f9('0x3'));var fs=require('fs');var Redis=require(_0x46f9('0x4'));var db=require(_0x46f9('0x5'))['db'];var utils=require(_0x46f9('0x6'));var logger=require(_0x46f9('0x7'))(_0x46f9('0x8'));var config=require(_0x46f9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46f9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e748d,_0x4b82e0,_0x22ac5b){return new BPromise(function(_0x59bc2c,_0x109405){return client['request'](_0x1e748d,_0x22ac5b)[_0x46f9('0xb')](function(_0x1ee8c6){logger[_0x46f9('0xc')](_0x46f9('0xd'),_0x4b82e0,_0x46f9('0xe'));logger[_0x46f9('0xf')](_0x46f9('0x10'),_0x4b82e0,_0x46f9('0xe'),JSON['stringify'](_0x1ee8c6));if(_0x1ee8c6['error']){if(_0x1ee8c6['error']['code']===0x1f4){logger[_0x46f9('0x11')](_0x46f9('0xd'),_0x4b82e0,_0x1ee8c6[_0x46f9('0x11')]['message']);return _0x109405(_0x1ee8c6[_0x46f9('0x11')][_0x46f9('0x12')]);}logger[_0x46f9('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4b82e0,_0x1ee8c6[_0x46f9('0x11')][_0x46f9('0x12')]);return _0x59bc2c(_0x1ee8c6[_0x46f9('0x11')][_0x46f9('0x12')]);}else{logger['info'](_0x46f9('0xd'),_0x4b82e0,_0x46f9('0xe'));_0x59bc2c(_0x1ee8c6[_0x46f9('0x13')][_0x46f9('0x12')]);}})['catch'](function(_0x4391c6){logger[_0x46f9('0x11')](_0x46f9('0xd'),_0x4b82e0,_0x4391c6);_0x109405(_0x4391c6);});});}exports[_0x46f9('0x14')]=function(_0x1d9392){var _0x381287=this;return new Promise(function(_0x242def,_0x6cebf5){return db[_0x46f9('0x15')][_0x46f9('0x16')]({'raw':_0x1d9392[_0x46f9('0x17')]?_0x1d9392[_0x46f9('0x17')][_0x46f9('0x18')]===undefined?!![]:![]:!![],'where':_0x1d9392[_0x46f9('0x17')]?_0x1d9392[_0x46f9('0x17')]['where']||null:null,'attributes':_0x1d9392['options']?_0x1d9392[_0x46f9('0x17')]['attributes']||null:null,'limit':_0x1d9392[_0x46f9('0x17')]?_0x1d9392['options'][_0x46f9('0x19')]||null:null,'include':_0x1d9392['options']?_0x1d9392['options'][_0x46f9('0x1a')]?_[_0x46f9('0x1b')](_0x1d9392[_0x46f9('0x17')]['include'],function(_0x3635e9){return{'model':db[_0x3635e9[_0x46f9('0x1c')]],'as':_0x3635e9['as'],'attributes':_0x3635e9['attributes'],'include':_0x3635e9[_0x46f9('0x1a')]?_['map'](_0x3635e9[_0x46f9('0x1a')],function(_0x3502b3){return{'model':db[_0x3502b3[_0x46f9('0x1c')]],'as':_0x3502b3['as'],'attributes':_0x3502b3[_0x46f9('0x1d')],'include':_0x3502b3['include']?_[_0x46f9('0x1b')](_0x3502b3[_0x46f9('0x1a')],function(_0x1ff62f){return{'model':db[_0x1ff62f[_0x46f9('0x1c')]],'as':_0x1ff62f['as'],'attributes':_0x1ff62f[_0x46f9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x46f9('0xb')](function(_0x158927){logger[_0x46f9('0xc')](_0x46f9('0x14'),_0x1d9392);logger['debug'](_0x46f9('0x14'),_0x1d9392,JSON[_0x46f9('0x1e')](_0x158927));_0x242def(_0x158927);})['catch'](function(_0x3882f8){logger[_0x46f9('0x11')](_0x46f9('0x14'),_0x3882f8[_0x46f9('0x12')],_0x1d9392);_0x6cebf5(_0x381287['error'](0x1f4,_0x3882f8[_0x46f9('0x12')]));});});};exports[_0x46f9('0x1f')]=function(_0x406c12){var _0x3f06ea=this;return new Promise(function(_0x104a77,_0x20281b){return db[_0x46f9('0x15')]['update'](_0x406c12[_0x46f9('0x20')],{'raw':_0x406c12[_0x46f9('0x17')]?_0x406c12[_0x46f9('0x17')][_0x46f9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x406c12[_0x46f9('0x17')]?_0x406c12[_0x46f9('0x17')][_0x46f9('0x21')]||null:null,'attributes':_0x406c12[_0x46f9('0x17')]?_0x406c12['options'][_0x46f9('0x1d')]||null:null,'limit':_0x406c12[_0x46f9('0x17')]?_0x406c12[_0x46f9('0x17')][_0x46f9('0x19')]||null:null})[_0x46f9('0xb')](function(_0x1ec1bb){logger['info'](_0x46f9('0x1f'),_0x406c12);logger['debug'](_0x46f9('0x1f'),_0x406c12,JSON[_0x46f9('0x1e')](_0x1ec1bb));_0x104a77(_0x1ec1bb);})['catch'](function(_0x4b0c21){logger[_0x46f9('0x11')](_0x46f9('0x1f'),_0x4b0c21[_0x46f9('0x12')],_0x406c12);_0x20281b(_0x3f06ea['error'](0x1f4,_0x4b0c21['message']));});});};exports[_0x46f9('0x22')]=function(_0x27327b){var _0x38984d=this;return new Promise(function(_0x5d9777,_0x29f2be){return db[_0x46f9('0x15')][_0x46f9('0x23')]({'where':_0x27327b[_0x46f9('0x17')]?_0x27327b[_0x46f9('0x17')][_0x46f9('0x21')]||null:null})[_0x46f9('0xb')](function(_0x4a84be){logger['info'](_0x46f9('0x22'),_0x27327b);logger[_0x46f9('0xf')](_0x46f9('0x22'),_0x27327b,JSON['stringify'](_0x4a84be));_0x5d9777(_0x4a84be);})[_0x46f9('0x24')](function(_0x3686f3){logger[_0x46f9('0x11')](_0x46f9('0x22'),_0x3686f3[_0x46f9('0x12')],_0x27327b);_0x29f2be(_0x38984d['error'](0x1f4,_0x3686f3[_0x46f9('0x12')]));});});};
\ No newline at end of file
index 0a759d7..7540d9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac31=['./cmHopperBlack.controller','index','get','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xac31,0xca));var _0x1ac3=function(_0x21b97d,_0x4cf5a6){_0x21b97d=_0x21b97d-0x0;var _0x39558f=_0xac31[_0x21b97d];return _0x39558f;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0x11')]);router[_0x1ac3('0x12')](_0x1ac3('0xe'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x13')]);module[_0x1ac3('0x14')]=router;
\ No newline at end of file
+var _0xa41a=['../../config/environment','./cmHopperBlack.controller','get','index','describe','isAuthenticated','show','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x102e02,_0x57bd65){var _0x4dc653=function(_0x2f04ab){while(--_0x2f04ab){_0x102e02['push'](_0x102e02['shift']());}};_0x4dc653(++_0x57bd65);}(_0xa41a,0x6b));var _0xaa41=function(_0x164367,_0x2f212e){_0x164367=_0x164367-0x0;var _0x3e3e7e=_0xa41a[_0x164367];return _0x3e3e7e;};'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 auth=require(_0xaa41('0x5'));var interaction=require(_0xaa41('0x6'));var config=require(_0xaa41('0x7'));var controller=require(_0xaa41('0x8'));router[_0xaa41('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa41('0xa')]);router[_0xaa41('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xaa41('0xb')]);router[_0xaa41('0x9')]('/:id',auth[_0xaa41('0xc')](),controller[_0xaa41('0xd')]);router[_0xaa41('0xe')](_0xaa41('0xf'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x10')]);router[_0xaa41('0x11')](_0xaa41('0xf'),auth[_0xaa41('0xc')](),controller['destroy']);module[_0xaa41('0x12')]=router;
\ No newline at end of file
index 098c6ae..7016842 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcce9=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xcce9,0x114));var _0x9cce=function(_0x582f8b,_0x49ebe1){_0x582f8b=_0x582f8b-0x0;var _0x5c5ed3=_0xcce9[_0x582f8b];return _0x5c5ed3;};'use strict';var Sequelize=require(_0x9cce('0x0'));var moment=require(_0x9cce('0x1'));module[_0x9cce('0x2')]={'state':{'type':Sequelize[_0x9cce('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x9cce('0x4')]},'scheduledat':{'type':Sequelize[_0x9cce('0x5')]},'countbusyretry':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9cce('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9cce('0x4')]},'calleridname':{'type':Sequelize[_0x9cce('0x4')]},'starttime':{'type':Sequelize[_0x9cce('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9cce('0x5')]},'droptime':{'type':Sequelize[_0x9cce('0x5')]},'endtime':{'type':Sequelize[_0x9cce('0x5')]},'ringtime':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9cce('0x4')]},'campaign':{'type':Sequelize[_0x9cce('0x4')]},'campaigntype':{'type':Sequelize[_0x9cce('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9cce('0x4')]},'dispositionat':{'type':Sequelize[_0x9cce('0x5')],'set':function(_0x599fa1){var _0x2f3b6c=this[_0x9cce('0x6')](_0x9cce('0x7'));if(_0x2f3b6c&&_0x599fa1){this[_0x9cce('0x8')](_0x9cce('0x9'),moment(_0x599fa1)[_0x9cce('0xa')](moment(_0x2f3b6c),_0x9cce('0xb')));}return this[_0x9cce('0x8')](_0x9cce('0xc'),_0x599fa1);}},'amd':{'type':Sequelize[_0x9cce('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9cce('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9cce('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9cce('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9cce('0x5')]},'callback':{'type':Sequelize[_0x9cce('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x9cce('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9cce('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9cce('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5f21=['exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN','sequelize','moment'];(function(_0x390dad,_0x3a3e5a){var _0x490148=function(_0x4a2c87){while(--_0x4a2c87){_0x390dad['push'](_0x390dad['shift']());}};_0x490148(++_0x3a3e5a);}(_0x5f21,0x1c5));var _0x15f2=function(_0x3340c8,_0x3d67d7){_0x3340c8=_0x3340c8-0x0;var _0x30ca8a=_0x5f21[_0x3340c8];return _0x30ca8a;};'use strict';var Sequelize=require(_0x15f2('0x0'));var moment=require(_0x15f2('0x1'));module[_0x15f2('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x15f2('0x4')]},'originatecalleridname':{'type':Sequelize[_0x15f2('0x4')]},'calleridnum':{'type':Sequelize[_0x15f2('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x15f2('0x5')]},'responsetime':{'type':Sequelize[_0x15f2('0x5')]},'answertime':{'type':Sequelize[_0x15f2('0x5')]},'droptime':{'type':Sequelize[_0x15f2('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x15f2('0x4')]},'campaign':{'type':Sequelize[_0x15f2('0x4')]},'campaigntype':{'type':Sequelize[_0x15f2('0x4')]},'membername':{'type':Sequelize[_0x15f2('0x4')]},'reason':{'type':Sequelize[_0x15f2('0x4')]},'disposition':{'type':Sequelize[_0x15f2('0x4')]},'dispositionat':{'type':Sequelize[_0x15f2('0x5')],'set':function(_0x3521c5){var _0x3e7cde=this[_0x15f2('0x6')](_0x15f2('0x7'));if(_0x3e7cde&&_0x3521c5){this[_0x15f2('0x8')](_0x15f2('0x9'),moment(_0x3521c5)[_0x15f2('0xa')](moment(_0x3e7cde),'seconds'));}return this[_0x15f2('0x8')](_0x15f2('0xb'),_0x3521c5);}},'amd':{'type':Sequelize[_0x15f2('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x15f2('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x15f2('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x15f2('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x15f2('0x5')]},'callback':{'type':Sequelize[_0x15f2('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x15f2('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x15f2('0x5')]},'deleted':{'type':Sequelize[_0x15f2('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x15f2('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x15f2('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x15f2('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 7b4b99f..c76f631 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf963=['reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','ContactId','ListId','VoiceQueueId','select','field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','cm_hopper','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','group','moveContactsIvrCampaignHopperFinal','CampaignId','createdAt','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','checkContactHopper','findOne','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','error','name','send','CmHopperFinal','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','then','show','length','include','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','COUNT','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null'];(function(_0x4d7fb3,_0x4abee8){var _0x3db26c=function(_0x2bbddb){while(--_0x2bbddb){_0x4d7fb3['push'](_0x4d7fb3['shift']());}};_0x3db26c(++_0x4abee8);}(_0xf963,0x11d));var _0x3f96=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xf963[_0x56482c];return _0x5aae7a;};'use strict';var pdf=require(_0x3f96('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3f96('0x1'));var jsonpatch=require(_0x3f96('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3f96('0x3'));var Mustache=require(_0x3f96('0x4'));var util=require(_0x3f96('0x5'));var path=require(_0x3f96('0x6'));var sox=require('sox');var csv=require(_0x3f96('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3f96('0x8'));var squel=require(_0x3f96('0x9'));var crypto=require(_0x3f96('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3f96('0xb'));var toCsv=require(_0x3f96('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f96('0xc'));var as=require(_0x3f96('0xd'));var hardwareService=require(_0x3f96('0xe'));var logger=require(_0x3f96('0xf'))(_0x3f96('0x10'));var utils=require('../../config/utils');var config=require(_0x3f96('0x11'));var db=require(_0x3f96('0x12'))['db'];function respondWithStatusCode(_0x37432a,_0x1a7999){_0x1a7999=_0x1a7999||0xcc;return function(_0x53522e){if(_0x53522e){return _0x37432a[_0x3f96('0x13')](_0x1a7999);}return _0x37432a['status'](_0x1a7999)[_0x3f96('0x14')]();};}function respondWithResult(_0x319b57,_0xdf9325){_0xdf9325=_0xdf9325||0xc8;return function(_0x4c5236){if(_0x4c5236){return _0x319b57[_0x3f96('0x15')](_0xdf9325)['json'](_0x4c5236);}};}function respondWithFilteredResult(_0x11aa28,_0x591ded){return function(_0x524f2a){if(_0x524f2a){var _0x575fdd=_0x524f2a[_0x3f96('0x16')],_0x39a994=_0x591ded['offset'],_0x333dc0=_0x591ded[_0x3f96('0x17')]+_0x591ded[_0x3f96('0x18')],_0x446973;if(_0x333dc0>=_0x575fdd){_0x333dc0=_0x575fdd;_0x446973=0xc8;}else{_0x446973=0xce;}_0x11aa28[_0x3f96('0x15')](_0x446973);return _0x11aa28['set'](_0x3f96('0x19'),_0x39a994+'-'+_0x333dc0+'/'+_0x575fdd)[_0x3f96('0x1a')](_0x524f2a);}return null;};}function patchUpdates(_0x184724){return function(_0x5644fe){try{jsonpatch[_0x3f96('0x1b')](_0x5644fe,_0x184724,!![]);}catch(_0x189278){return BPromise[_0x3f96('0x1c')](_0x189278);}return _0x5644fe[_0x3f96('0x1d')]();};}function saveUpdates(_0x378e84,_0xb60019){return function(_0x5da09e){if(_0x5da09e){return _0x5da09e[_0x3f96('0x1e')](_0x378e84)['then'](function(_0x422885){return _0x422885;});}return null;};}function removeEntity(_0x1771e9,_0x590cf2){return function(_0xd6ddf){if(_0xd6ddf){return _0xd6ddf[_0x3f96('0x1f')]()['then'](function(){_0x1771e9[_0x3f96('0x15')](0xcc)[_0x3f96('0x14')]();});}};}function handleEntityNotFound(_0x46c99a,_0x2e6f30){return function(_0x348e6f){if(!_0x348e6f){_0x46c99a[_0x3f96('0x13')](0x194);}return _0x348e6f;};}function handleError(_0x286cdf,_0x4fbcd9){_0x4fbcd9=_0x4fbcd9||0x1f4;return function(_0x4c1b42){logger[_0x3f96('0x20')](_0x4c1b42['stack']);if(_0x4c1b42['name']){delete _0x4c1b42[_0x3f96('0x21')];}_0x286cdf['status'](_0x4fbcd9)[_0x3f96('0x22')](_0x4c1b42);};}exports['index']=function(_0x4391f5,_0x3a392e){var _0x29afd5={},_0x3cba14={},_0x3a46ee={'count':0x0,'rows':[]};var _0x2d91fc=_['map'](db[_0x3f96('0x23')][_0x3f96('0x24')],function(_0x4cbd33){return{'name':_0x4cbd33[_0x3f96('0x25')],'type':_0x4cbd33[_0x3f96('0x26')]['key']};});_0x3cba14[_0x3f96('0x27')]=_['map'](_0x2d91fc,_0x3f96('0x21'));_0x3cba14['query']=_[_0x3f96('0x28')](_0x4391f5[_0x3f96('0x29')]);_0x3cba14[_0x3f96('0x2a')]=_[_0x3f96('0x2b')](_0x3cba14[_0x3f96('0x27')],_0x3cba14[_0x3f96('0x29')]);_0x29afd5[_0x3f96('0x2c')]=_[_0x3f96('0x2b')](_0x3cba14[_0x3f96('0x27')],qs[_0x3f96('0x2d')](_0x4391f5[_0x3f96('0x29')][_0x3f96('0x2d')]));_0x29afd5[_0x3f96('0x2c')]=_0x29afd5['attributes']['length']?_0x29afd5[_0x3f96('0x2c')]:_0x3cba14['model'];if(!_0x4391f5[_0x3f96('0x29')][_0x3f96('0x2e')]('nolimit')){_0x29afd5[_0x3f96('0x18')]=qs['limit'](_0x4391f5[_0x3f96('0x29')]['limit']);_0x29afd5[_0x3f96('0x17')]=qs[_0x3f96('0x17')](_0x4391f5['query'][_0x3f96('0x17')]);}_0x29afd5['order']=qs[_0x3f96('0x2f')](_0x4391f5['query'][_0x3f96('0x2f')]);_0x29afd5[_0x3f96('0x30')]=qs[_0x3f96('0x2a')](_[_0x3f96('0x31')](_0x4391f5[_0x3f96('0x29')],_0x3cba14['filters']),_0x2d91fc);if(_0x4391f5[_0x3f96('0x29')][_0x3f96('0x32')]){_0x29afd5[_0x3f96('0x30')]=_[_0x3f96('0x33')](_0x29afd5[_0x3f96('0x30')],{'$or':_[_0x3f96('0x34')](_0x2d91fc,function(_0x53dc5f){if(_0x53dc5f[_0x3f96('0x26')]!==_0x3f96('0x35')){var _0x516dac={};_0x516dac[_0x53dc5f[_0x3f96('0x21')]]={'$like':'%'+_0x4391f5[_0x3f96('0x29')][_0x3f96('0x32')]+'%'};return _0x516dac;}})});}_0x29afd5=_[_0x3f96('0x33')]({},_0x29afd5,_0x4391f5['options']);var _0x2bddab={'where':_0x29afd5[_0x3f96('0x30')]};return db['CmHopperFinal'][_0x3f96('0x16')](_0x2bddab)['then'](function(_0x47af98){_0x3a46ee[_0x3f96('0x16')]=_0x47af98;if(_0x4391f5[_0x3f96('0x29')][_0x3f96('0x36')]){_0x29afd5['include']=[{'all':!![]}];}return db[_0x3f96('0x23')][_0x3f96('0x37')](_0x29afd5);})['then'](function(_0xf0859c){_0x3a46ee[_0x3f96('0x38')]=_0xf0859c;return _0x3a46ee;})[_0x3f96('0x39')](respondWithFilteredResult(_0x3a392e,_0x29afd5))['catch'](handleError(_0x3a392e,null));};exports[_0x3f96('0x3a')]=function(_0x2c8a5b,_0x241627){var _0x3fc338={'raw':!![],'where':{'id':_0x2c8a5b['params']['id']}},_0x3aac89={};_0x3aac89[_0x3f96('0x27')]=_[_0x3f96('0x28')](db[_0x3f96('0x23')]['rawAttributes']);_0x3aac89['query']=_['keys'](_0x2c8a5b[_0x3f96('0x29')]);_0x3aac89[_0x3f96('0x2a')]=_[_0x3f96('0x2b')](_0x3aac89['model'],_0x3aac89[_0x3f96('0x29')]);_0x3fc338['attributes']=_[_0x3f96('0x2b')](_0x3aac89[_0x3f96('0x27')],qs[_0x3f96('0x2d')](_0x2c8a5b[_0x3f96('0x29')][_0x3f96('0x2d')]));_0x3fc338[_0x3f96('0x2c')]=_0x3fc338[_0x3f96('0x2c')][_0x3f96('0x3b')]?_0x3fc338[_0x3f96('0x2c')]:_0x3aac89[_0x3f96('0x27')];if(_0x2c8a5b[_0x3f96('0x29')][_0x3f96('0x36')]){_0x3fc338[_0x3f96('0x3c')]=[{'all':!![]}];}_0x3fc338=_[_0x3f96('0x33')]({},_0x3fc338,_0x2c8a5b['options']);return db[_0x3f96('0x23')][_0x3f96('0x3d')](_0x3fc338)[_0x3f96('0x39')](handleEntityNotFound(_0x241627,null))['then'](respondWithResult(_0x241627,null))[_0x3f96('0x3e')](handleError(_0x241627,null));};exports[_0x3f96('0x3f')]=function(_0x904be4,_0x5c470a){return db[_0x3f96('0x23')][_0x3f96('0x3f')]()[_0x3f96('0x39')](respondWithResult(_0x5c470a,null))[_0x3f96('0x3e')](handleError(_0x5c470a,null));};exports[_0x3f96('0x1e')]=function(_0x206ce9,_0x24d610){if(_0x206ce9[_0x3f96('0x40')][_0x3f96('0x41')]){delete _0x206ce9[_0x3f96('0x40')]['uniqueid'];}return db['CmHopperFinal'][_0x3f96('0x3d')]({'where':{'uniqueid':_0x206ce9[_0x3f96('0x42')]['id']}})[_0x3f96('0x39')](handleEntityNotFound(_0x24d610,null))[_0x3f96('0x39')](saveUpdates(_0x206ce9['body'],null))[_0x3f96('0x39')](respondWithResult(_0x24d610,null))[_0x3f96('0x3e')](handleError(_0x24d610,null));};exports[_0x3f96('0x43')]=function(_0x16a6f5,_0x245099,_0x53abaa){return db[_0x3f96('0x23')][_0x3f96('0x37')]({'raw':![],'where':{'VoiceQueueId':_0x16a6f5[_0x3f96('0x42')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')](_0x3f96('0x46')))),'noSuchContacts'],[db[_0x3f96('0x44')]['fn']('COUNT',db[_0x3f96('0x44')]['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')](_0x3f96('0x47')))),'noAnswerContacts'],[db[_0x3f96('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3f96('0x44')]['literal'](_0x3f96('0x48')))),_0x3f96('0x49')],[db[_0x3f96('0x44')]['fn']('COUNT',db[_0x3f96('0x44')]['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')](_0x3f96('0x4a')))),_0x3f96('0x4b')],[db[_0x3f96('0x44')]['fn'](_0x3f96('0x4c'),db[_0x3f96('0x44')]['fn']('IF',db[_0x3f96('0x44')]['literal'](_0x3f96('0x4d')))),_0x3f96('0x4e')],[db[_0x3f96('0x44')]['fn']('COUNT',db[_0x3f96('0x44')]['fn']('IF',db['sequelize'][_0x3f96('0x45')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x3f96('0x4f')],[db['sequelize']['fn'](_0x3f96('0x4c'),db['sequelize']['fn']('IF',db[_0x3f96('0x44')]['literal'](_0x3f96('0x50')))),_0x3f96('0x51')],[db[_0x3f96('0x44')]['fn'](_0x3f96('0x4c'),db[_0x3f96('0x44')]['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')](_0x3f96('0x52')))),_0x3f96('0x53')]]})[_0x3f96('0x39')](handleEntityNotFound(_0x245099,null))['then'](respondWithResult(_0x245099,null))[_0x3f96('0x3e')](handleError(_0x245099,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x38b39c,_0x5d6abc,_0x5cfd4a){return db[_0x3f96('0x23')][_0x3f96('0x37')]({'raw':![],'where':{'CampaignId':_0x38b39c[_0x3f96('0x42')]['id']},'attributes':[[db[_0x3f96('0x44')]['fn'](_0x3f96('0x4c'),db[_0x3f96('0x44')]['fn']('IF',db['sequelize'][_0x3f96('0x45')]('`state`\x20=\x200,\x201,\x20null'))),_0x3f96('0x54')],[db[_0x3f96('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3f96('0x47')))),'noAnswerContacts'],[db[_0x3f96('0x44')]['fn']('COUNT',db[_0x3f96('0x44')]['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')](_0x3f96('0x48')))),_0x3f96('0x49')],[db[_0x3f96('0x44')]['fn'](_0x3f96('0x4c'),db[_0x3f96('0x44')]['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')](_0x3f96('0x4a')))),_0x3f96('0x4b')],[db[_0x3f96('0x44')]['fn']('COUNT',db[_0x3f96('0x44')]['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0x3f96('0x44')]['fn'](_0x3f96('0x4c'),db[_0x3f96('0x44')]['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')](_0x3f96('0x55')))),_0x3f96('0x4f')],[db[_0x3f96('0x44')]['fn'](_0x3f96('0x4c'),db[_0x3f96('0x44')]['fn']('IF',db['sequelize'][_0x3f96('0x45')](_0x3f96('0x50')))),_0x3f96('0x51')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3f96('0x44')][_0x3f96('0x45')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x5d6abc,null))['then'](respondWithResult(_0x5d6abc,null))[_0x3f96('0x3e')](handleError(_0x5d6abc,null));};exports[_0x3f96('0x56')]=function(_0x3a065c,_0x503ab6,_0x53aca0){return db[_0x3f96('0x57')][_0x3f96('0x3d')]({'where':{'id':_0x3a065c[_0x3f96('0x42')]['id']}})[_0x3f96('0x39')](handleEntityNotFound(_0x503ab6,null))[_0x3f96('0x39')](function(_0x282dac){var _0x3408a6;if(_0x282dac){_0x3408a6=squel[_0x3f96('0x58')]()[_0x3f96('0x59')]('cm_hopper')[_0x3f96('0x5a')](['phone','scheduledAt',_0x3f96('0x5b'),_0x3f96('0x5c'),_0x3f96('0x5d'),'createdAt','updatedAt'],squel[_0x3f96('0x5e')]()[_0x3f96('0x5f')]('ANY_VALUE(calleridnum)',_0x3f96('0x60'))[_0x3f96('0x5f')](_0x3f96('0x61'),'scheduledAt')[_0x3f96('0x5f')](_0x3f96('0x62'),_0x3f96('0x5b'))[_0x3f96('0x5f')](_0x3f96('0x63'),'ListId')[_0x3f96('0x5f')](_0x3f96('0x64'),'VoiceQueueId')[_0x3f96('0x5f')]('NOW()','createdAt')['field'](_0x3f96('0x61'),_0x3f96('0x65'))[_0x3f96('0x66')](_0x3f96('0x67'))[_0x3f96('0x30')](_0x3f96('0x68'),_0x3a065c[_0x3f96('0x42')]['id'][_0x3f96('0x69')]())[_0x3f96('0x30')](_0x3f96('0x6a'),_0x3a065c['body'][_0x3f96('0x6b')]['toString']())[_0x3f96('0x30')](_0x3f96('0x6c'))[_0x3f96('0x30')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3f96('0x5e')]()[_0x3f96('0x5f')](_0x3f96('0x60'))[_0x3f96('0x66')](_0x3f96('0x6d'))['where'](_0x3f96('0x68'),_0x3a065c['params']['id'][_0x3f96('0x69')]()))[_0x3f96('0x30')](_0x3f96('0x6e'),squel[_0x3f96('0x5e')]()[_0x3f96('0x5f')](_0x3f96('0x6f'))[_0x3f96('0x66')](_0x3f96('0x67'))[_0x3f96('0x30')]('VoiceQueueId\x20=\x20?',_0x3a065c[_0x3f96('0x42')]['id'][_0x3f96('0x69')]())[_0x3f96('0x30')]('state\x20=\x204'))[_0x3f96('0x70')](_0x3f96('0x5b')))[_0x3f96('0x69')]();return db['sequelize']['query'](_0x3408a6);}return[];})['then'](respondWithResult(_0x503ab6,null))['catch'](handleError(_0x503ab6,null));};exports[_0x3f96('0x71')]=function(_0xb5ece1,_0x3d2e2d,_0x49d41d){return db['Campaign'][_0x3f96('0x3d')]({'where':{'id':_0xb5ece1[_0x3f96('0x42')]['id']}})[_0x3f96('0x39')](handleEntityNotFound(_0x3d2e2d,null))['then'](function(_0x20e771){var _0x304fe5;if(_0x20e771){_0x304fe5=squel['insert']()[_0x3f96('0x59')]('cm_hopper')[_0x3f96('0x5a')]([_0x3f96('0x60'),'scheduledAt','ContactId',_0x3f96('0x5c'),_0x3f96('0x72'),_0x3f96('0x73'),_0x3f96('0x65')],squel[_0x3f96('0x5e')]()['field'](_0x3f96('0x74'),_0x3f96('0x60'))[_0x3f96('0x5f')](_0x3f96('0x61'),'scheduledAt')[_0x3f96('0x5f')](_0x3f96('0x62'),_0x3f96('0x5b'))[_0x3f96('0x5f')]('ANY_VALUE(ListId)','ListId')['field'](_0x3f96('0x75'),_0x3f96('0x72'))[_0x3f96('0x5f')](_0x3f96('0x61'),_0x3f96('0x73'))[_0x3f96('0x5f')](_0x3f96('0x61'),'updatedAt')['from'](_0x3f96('0x67'))[_0x3f96('0x30')](_0x3f96('0x76'),_0xb5ece1[_0x3f96('0x42')]['id'][_0x3f96('0x69')]())[_0x3f96('0x30')](_0x3f96('0x6a'),_0xb5ece1[_0x3f96('0x40')][_0x3f96('0x6b')][_0x3f96('0x69')]())[_0x3f96('0x30')](_0x3f96('0x6c'))[_0x3f96('0x30')](_0x3f96('0x6e'),squel['select']()[_0x3f96('0x5f')](_0x3f96('0x60'))[_0x3f96('0x66')](_0x3f96('0x6d'))['where']('CampaignId\x20=\x20?',_0xb5ece1['params']['id'][_0x3f96('0x69')]()))[_0x3f96('0x30')](_0x3f96('0x6e'),squel[_0x3f96('0x5e')]()[_0x3f96('0x5f')](_0x3f96('0x6f'))[_0x3f96('0x66')](_0x3f96('0x67'))[_0x3f96('0x30')](_0x3f96('0x76'),_0xb5ece1[_0x3f96('0x42')]['id']['toString']())[_0x3f96('0x30')](_0x3f96('0x77')))[_0x3f96('0x70')](_0x3f96('0x5b')))[_0x3f96('0x69')]();return db[_0x3f96('0x44')][_0x3f96('0x29')](_0x304fe5);}return[];})[_0x3f96('0x39')](respondWithResult(_0x3d2e2d,null))[_0x3f96('0x3e')](handleError(_0x3d2e2d,null));};exports[_0x3f96('0x78')]=function(_0xd64b9a,_0x40ef9b,_0x42ba6f){return db['CmHopper'][_0x3f96('0x79')]({'where':{'VoiceQueueId':_0xd64b9a[_0x3f96('0x40')][_0x3f96('0x5d')],'CampaignId':_0xd64b9a['body'][_0x3f96('0x72')],'ContactId':_0xd64b9a['body'][_0x3f96('0x5b')]}})[_0x3f96('0x39')](handleEntityNotFound(_0x40ef9b,null))[_0x3f96('0x39')](function(_0x4b7523){if(_0x4b7523){return _0x4b7523;}return null;})['then'](respondWithResult(_0x40ef9b,null))[_0x3f96('0x3e')](handleError(_0x40ef9b,null));};
\ No newline at end of file
+var _0x11f3=['COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','body','calleridnum','CmHopper','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','CmHopperFinal','fieldName','type','key','map','query','keys','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','find','describe','uniqueid','countContactsQueueCampaignHopperFinal','params','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x11f3,0x149));var _0x311f=function(_0x46c952,_0x2b1b3f){_0x46c952=_0x46c952-0x0;var _0x3e98b4=_0x11f3[_0x46c952];return _0x3e98b4;};'use strict';var pdf=require(_0x311f('0x0'));var emlformat=require(_0x311f('0x1'));var rimraf=require(_0x311f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x311f('0x3'));var rp=require('request-promise');var moment=require(_0x311f('0x4'));var BPromise=require(_0x311f('0x5'));var Mustache=require(_0x311f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x311f('0x7'));var csv=require('to-csv');var ejs=require(_0x311f('0x8'));var fs=require('fs');var _=require(_0x311f('0x9'));var squel=require(_0x311f('0xa'));var crypto=require(_0x311f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x311f('0xc'));var toCsv=require(_0x311f('0xd'));var querystring=require(_0x311f('0xe'));var Papa=require(_0x311f('0xf'));var Redis=require(_0x311f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x311f('0x11'));var as=require(_0x311f('0x12'));var hardwareService=require(_0x311f('0x13'));var logger=require(_0x311f('0x14'))(_0x311f('0x15'));var utils=require(_0x311f('0x16'));var config=require(_0x311f('0x17'));var db=require(_0x311f('0x18'))['db'];function respondWithStatusCode(_0x833528,_0xe68c1e){_0xe68c1e=_0xe68c1e||0xcc;return function(_0x3a73dd){if(_0x3a73dd){return _0x833528[_0x311f('0x19')](_0xe68c1e);}return _0x833528[_0x311f('0x1a')](_0xe68c1e)[_0x311f('0x1b')]();};}function respondWithResult(_0x3e809b,_0x25eb90){_0x25eb90=_0x25eb90||0xc8;return function(_0xeea2a8){if(_0xeea2a8){return _0x3e809b[_0x311f('0x1a')](_0x25eb90)[_0x311f('0x1c')](_0xeea2a8);}};}function respondWithFilteredResult(_0x5f09fb,_0x4e0362){return function(_0x5013f9){if(_0x5013f9){var _0x114ad7=_0x5013f9[_0x311f('0x1d')],_0x38f876=_0x4e0362[_0x311f('0x1e')],_0x248fca=_0x4e0362[_0x311f('0x1e')]+_0x4e0362[_0x311f('0x1f')],_0x7ff544;if(_0x248fca>=_0x114ad7){_0x248fca=_0x114ad7;_0x7ff544=0xc8;}else{_0x7ff544=0xce;}_0x5f09fb[_0x311f('0x1a')](_0x7ff544);return _0x5f09fb['set'](_0x311f('0x20'),_0x38f876+'-'+_0x248fca+'/'+_0x114ad7)[_0x311f('0x1c')](_0x5013f9);}return null;};}function patchUpdates(_0x3b9ca8){return function(_0x451467){try{jsonpatch[_0x311f('0x21')](_0x451467,_0x3b9ca8,!![]);}catch(_0x2e243f){return BPromise[_0x311f('0x22')](_0x2e243f);}return _0x451467[_0x311f('0x23')]();};}function saveUpdates(_0x3fc713,_0x67ea17){return function(_0x4c2b78){if(_0x4c2b78){return _0x4c2b78[_0x311f('0x24')](_0x3fc713)['then'](function(_0x82fdde){return _0x82fdde;});}return null;};}function removeEntity(_0x4ddf62,_0x29227e){return function(_0x32d9bf){if(_0x32d9bf){return _0x32d9bf[_0x311f('0x25')]()[_0x311f('0x26')](function(){_0x4ddf62[_0x311f('0x1a')](0xcc)[_0x311f('0x1b')]();});}};}function handleEntityNotFound(_0x59023e,_0x5a3319){return function(_0x5dd17d){if(!_0x5dd17d){_0x59023e[_0x311f('0x19')](0x194);}return _0x5dd17d;};}function handleError(_0x4429d3,_0x5ece19){_0x5ece19=_0x5ece19||0x1f4;return function(_0x10da88){logger[_0x311f('0x27')](_0x10da88[_0x311f('0x28')]);if(_0x10da88['name']){delete _0x10da88[_0x311f('0x29')];}_0x4429d3['status'](_0x5ece19)[_0x311f('0x2a')](_0x10da88);};}exports[_0x311f('0x2b')]=function(_0x12d14e,_0x583353){var _0x3a4ca5={},_0x1b1b88={},_0x22341e={'count':0x0,'rows':[]};var _0x536b4b=_['map'](db[_0x311f('0x2c')]['rawAttributes'],function(_0x9b611f){return{'name':_0x9b611f[_0x311f('0x2d')],'type':_0x9b611f[_0x311f('0x2e')][_0x311f('0x2f')]};});_0x1b1b88['model']=_[_0x311f('0x30')](_0x536b4b,'name');_0x1b1b88[_0x311f('0x31')]=_[_0x311f('0x32')](_0x12d14e[_0x311f('0x31')]);_0x1b1b88['filters']=_[_0x311f('0x33')](_0x1b1b88['model'],_0x1b1b88[_0x311f('0x31')]);_0x3a4ca5[_0x311f('0x34')]=_[_0x311f('0x33')](_0x1b1b88[_0x311f('0x35')],qs['fields'](_0x12d14e[_0x311f('0x31')]['fields']));_0x3a4ca5[_0x311f('0x34')]=_0x3a4ca5[_0x311f('0x34')][_0x311f('0x36')]?_0x3a4ca5['attributes']:_0x1b1b88[_0x311f('0x35')];if(!_0x12d14e[_0x311f('0x31')][_0x311f('0x37')](_0x311f('0x38'))){_0x3a4ca5[_0x311f('0x1f')]=qs['limit'](_0x12d14e[_0x311f('0x31')][_0x311f('0x1f')]);_0x3a4ca5[_0x311f('0x1e')]=qs[_0x311f('0x1e')](_0x12d14e[_0x311f('0x31')][_0x311f('0x1e')]);}_0x3a4ca5[_0x311f('0x39')]=qs[_0x311f('0x3a')](_0x12d14e['query'][_0x311f('0x3a')]);_0x3a4ca5[_0x311f('0x3b')]=qs['filters'](_['pick'](_0x12d14e[_0x311f('0x31')],_0x1b1b88[_0x311f('0x3c')]),_0x536b4b);if(_0x12d14e[_0x311f('0x31')][_0x311f('0x3d')]){_0x3a4ca5['where']=_[_0x311f('0x3e')](_0x3a4ca5[_0x311f('0x3b')],{'$or':_[_0x311f('0x30')](_0x536b4b,function(_0x1a58a8){if(_0x1a58a8[_0x311f('0x2e')]!==_0x311f('0x3f')){var _0x3c4f46={};_0x3c4f46[_0x1a58a8['name']]={'$like':'%'+_0x12d14e[_0x311f('0x31')][_0x311f('0x3d')]+'%'};return _0x3c4f46;}})});}_0x3a4ca5=_[_0x311f('0x3e')]({},_0x3a4ca5,_0x12d14e[_0x311f('0x40')]);var _0x2a4982={'where':_0x3a4ca5[_0x311f('0x3b')]};return db[_0x311f('0x2c')][_0x311f('0x1d')](_0x2a4982)[_0x311f('0x26')](function(_0x3a57ce){_0x22341e[_0x311f('0x1d')]=_0x3a57ce;if(_0x12d14e[_0x311f('0x31')][_0x311f('0x41')]){_0x3a4ca5[_0x311f('0x42')]=[{'all':!![]}];}return db[_0x311f('0x2c')][_0x311f('0x43')](_0x3a4ca5);})[_0x311f('0x26')](function(_0xb01961){_0x22341e[_0x311f('0x44')]=_0xb01961;return _0x22341e;})[_0x311f('0x26')](respondWithFilteredResult(_0x583353,_0x3a4ca5))[_0x311f('0x45')](handleError(_0x583353,null));};exports[_0x311f('0x46')]=function(_0x1c2e5f,_0x599ad8){var _0x206660={'raw':!![],'where':{'id':_0x1c2e5f['params']['id']}},_0x3ee59b={};_0x3ee59b['model']=_[_0x311f('0x32')](db[_0x311f('0x2c')][_0x311f('0x47')]);_0x3ee59b[_0x311f('0x31')]=_[_0x311f('0x32')](_0x1c2e5f[_0x311f('0x31')]);_0x3ee59b['filters']=_['intersection'](_0x3ee59b[_0x311f('0x35')],_0x3ee59b[_0x311f('0x31')]);_0x206660[_0x311f('0x34')]=_[_0x311f('0x33')](_0x3ee59b[_0x311f('0x35')],qs[_0x311f('0x48')](_0x1c2e5f['query'][_0x311f('0x48')]));_0x206660[_0x311f('0x34')]=_0x206660['attributes'][_0x311f('0x36')]?_0x206660['attributes']:_0x3ee59b[_0x311f('0x35')];if(_0x1c2e5f['query'][_0x311f('0x41')]){_0x206660[_0x311f('0x42')]=[{'all':!![]}];}_0x206660=_[_0x311f('0x3e')]({},_0x206660,_0x1c2e5f['options']);return db['CmHopperFinal'][_0x311f('0x49')](_0x206660)[_0x311f('0x26')](handleEntityNotFound(_0x599ad8,null))[_0x311f('0x26')](respondWithResult(_0x599ad8,null))['catch'](handleError(_0x599ad8,null));};exports['describe']=function(_0x349c79,_0x305b66){return db[_0x311f('0x2c')][_0x311f('0x4a')]()[_0x311f('0x26')](respondWithResult(_0x305b66,null))[_0x311f('0x45')](handleError(_0x305b66,null));};exports[_0x311f('0x24')]=function(_0x4992a3,_0x52cea4){if(_0x4992a3['body'][_0x311f('0x4b')]){delete _0x4992a3['body'][_0x311f('0x4b')];}return db[_0x311f('0x2c')]['find']({'where':{'uniqueid':_0x4992a3['params']['id']}})['then'](handleEntityNotFound(_0x52cea4,null))[_0x311f('0x26')](saveUpdates(_0x4992a3['body'],null))[_0x311f('0x26')](respondWithResult(_0x52cea4,null))[_0x311f('0x45')](handleError(_0x52cea4,null));};exports[_0x311f('0x4c')]=function(_0x49f2c0,_0x1e10b0,_0x13c6eb){return db[_0x311f('0x2c')][_0x311f('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x49f2c0[_0x311f('0x4d')]['id']},'attributes':[[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')]['literal'](_0x311f('0x50')))),_0x311f('0x51')],[db[_0x311f('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')](_0x311f('0x53')))),_0x311f('0x54')],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')]('`state`\x20=\x205,\x201,\x20null'))),_0x311f('0x55')],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db['sequelize']['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')](_0x311f('0x56')))),'congestionContacts'],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db['sequelize']['fn']('IF',db[_0x311f('0x4e')]['literal'](_0x311f('0x57')))),_0x311f('0x58')],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')]['literal'](_0x311f('0x59')))),_0x311f('0x5a')],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')]('`state`\x20=\x2022,\x201,\x20null'))),_0x311f('0x5b')],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')](_0x311f('0x5c')))),'answeringMachine']]})[_0x311f('0x26')](handleEntityNotFound(_0x1e10b0,null))['then'](respondWithResult(_0x1e10b0,null))[_0x311f('0x45')](handleError(_0x1e10b0,null));};exports[_0x311f('0x5d')]=function(_0x188929,_0x19dd16,_0x41aeee){return db[_0x311f('0x2c')][_0x311f('0x43')]({'raw':![],'where':{'CampaignId':_0x188929['params']['id']},'attributes':[[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')](_0x311f('0x50')))),_0x311f('0x51')],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db['sequelize'][_0x311f('0x52')]('`state`\x20=\x203,\x201,\x20null'))),_0x311f('0x54')],[db[_0x311f('0x4e')]['fn']('COUNT',db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')](_0x311f('0x5e')))),_0x311f('0x55')],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db['sequelize']['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')]('`state`\x20=\x208,\x201,\x20null'))),_0x311f('0x5f')],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db['sequelize']['fn']('IF',db[_0x311f('0x4e')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0x311f('0x4e')]['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db['sequelize'][_0x311f('0x52')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x311f('0x5a')],[db['sequelize']['fn'](_0x311f('0x4f'),db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')](_0x311f('0x60')))),_0x311f('0x5b')],[db[_0x311f('0x4e')]['fn']('COUNT',db[_0x311f('0x4e')]['fn']('IF',db[_0x311f('0x4e')][_0x311f('0x52')](_0x311f('0x5c')))),_0x311f('0x61')]]})[_0x311f('0x26')](handleEntityNotFound(_0x19dd16,null))[_0x311f('0x26')](respondWithResult(_0x19dd16,null))['catch'](handleError(_0x19dd16,null));};exports[_0x311f('0x62')]=function(_0x1ebf8b,_0x280dbe,_0x5efbae){return db[_0x311f('0x63')][_0x311f('0x49')]({'where':{'id':_0x1ebf8b['params']['id']}})[_0x311f('0x26')](handleEntityNotFound(_0x280dbe,null))[_0x311f('0x26')](function(_0x5608b7){var _0x5049ae;if(_0x5608b7){_0x5049ae=squel[_0x311f('0x64')]()[_0x311f('0x65')](_0x311f('0x66'))['fromQuery']([_0x311f('0x67'),_0x311f('0x68'),_0x311f('0x69'),'ListId',_0x311f('0x6a'),_0x311f('0x6b'),_0x311f('0x6c')],squel['select']()[_0x311f('0x6d')](_0x311f('0x6e'),_0x311f('0x67'))['field'](_0x311f('0x6f'),_0x311f('0x68'))['field'](_0x311f('0x70'),_0x311f('0x69'))['field'](_0x311f('0x71'),_0x311f('0x72'))[_0x311f('0x6d')](_0x311f('0x73'),_0x311f('0x6a'))[_0x311f('0x6d')]('NOW()',_0x311f('0x6b'))[_0x311f('0x6d')]('NOW()',_0x311f('0x6c'))[_0x311f('0x74')](_0x311f('0x75'))['where'](_0x311f('0x76'),_0x1ebf8b['params']['id']['toString']())['where'](_0x311f('0x77'),_0x1ebf8b['body'][_0x311f('0x78')][_0x311f('0x79')]())[_0x311f('0x3b')](_0x311f('0x7a'))[_0x311f('0x3b')](_0x311f('0x7b'),squel[_0x311f('0x7c')]()[_0x311f('0x6d')](_0x311f('0x67'))[_0x311f('0x74')](_0x311f('0x66'))[_0x311f('0x3b')]('VoiceQueueId\x20=\x20?',_0x1ebf8b[_0x311f('0x4d')]['id'][_0x311f('0x79')]()))[_0x311f('0x3b')](_0x311f('0x7b'),squel[_0x311f('0x7c')]()[_0x311f('0x6d')]('calleridnum')[_0x311f('0x74')](_0x311f('0x75'))[_0x311f('0x3b')](_0x311f('0x76'),_0x1ebf8b['params']['id'][_0x311f('0x79')]())['where'](_0x311f('0x7d')))[_0x311f('0x7e')](_0x311f('0x69')))[_0x311f('0x79')]();return db[_0x311f('0x4e')][_0x311f('0x31')](_0x5049ae);}return[];})['then'](respondWithResult(_0x280dbe,null))[_0x311f('0x45')](handleError(_0x280dbe,null));};exports[_0x311f('0x7f')]=function(_0x468ebe,_0xa8b99f,_0x504884){return db[_0x311f('0x80')][_0x311f('0x49')]({'where':{'id':_0x468ebe[_0x311f('0x4d')]['id']}})[_0x311f('0x26')](handleEntityNotFound(_0xa8b99f,null))['then'](function(_0x1cf024){var _0x40fd27;if(_0x1cf024){_0x40fd27=squel['insert']()['into'](_0x311f('0x66'))[_0x311f('0x81')]([_0x311f('0x67'),'scheduledAt','ContactId',_0x311f('0x72'),'CampaignId',_0x311f('0x6b'),_0x311f('0x6c')],squel[_0x311f('0x7c')]()[_0x311f('0x6d')]('ANY_VALUE(calleridnum)','phone')[_0x311f('0x6d')](_0x311f('0x6f'),_0x311f('0x68'))[_0x311f('0x6d')](_0x311f('0x70'),_0x311f('0x69'))[_0x311f('0x6d')](_0x311f('0x71'),'ListId')[_0x311f('0x6d')](_0x311f('0x82'),_0x311f('0x83'))['field'](_0x311f('0x6f'),_0x311f('0x6b'))[_0x311f('0x6d')](_0x311f('0x6f'),_0x311f('0x6c'))[_0x311f('0x74')]('cm_hopper_final')['where'](_0x311f('0x84'),_0x468ebe[_0x311f('0x4d')]['id']['toString']())[_0x311f('0x3b')](_0x311f('0x77'),_0x468ebe[_0x311f('0x85')][_0x311f('0x78')][_0x311f('0x79')]())[_0x311f('0x3b')](_0x311f('0x7a'))[_0x311f('0x3b')](_0x311f('0x7b'),squel[_0x311f('0x7c')]()[_0x311f('0x6d')](_0x311f('0x67'))['from'](_0x311f('0x66'))['where'](_0x311f('0x84'),_0x468ebe[_0x311f('0x4d')]['id'][_0x311f('0x79')]()))['where'](_0x311f('0x7b'),squel[_0x311f('0x7c')]()[_0x311f('0x6d')](_0x311f('0x86'))[_0x311f('0x74')](_0x311f('0x75'))[_0x311f('0x3b')](_0x311f('0x84'),_0x468ebe[_0x311f('0x4d')]['id']['toString']())[_0x311f('0x3b')]('state\x20=\x204'))[_0x311f('0x7e')](_0x311f('0x69')))[_0x311f('0x79')]();return db[_0x311f('0x4e')]['query'](_0x40fd27);}return[];})[_0x311f('0x26')](respondWithResult(_0xa8b99f,null))[_0x311f('0x45')](handleError(_0xa8b99f,null));};exports['checkContactHopper']=function(_0x58a4de,_0x2a3527,_0x5a5694){return db[_0x311f('0x87')]['findOne']({'where':{'VoiceQueueId':_0x58a4de['body'][_0x311f('0x6a')],'CampaignId':_0x58a4de[_0x311f('0x85')][_0x311f('0x83')],'ContactId':_0x58a4de[_0x311f('0x85')][_0x311f('0x69')]}})['then'](handleEntityNotFound(_0x2a3527,null))[_0x311f('0x26')](function(_0x2acbbe){if(_0x2acbbe){return _0x2acbbe;}return null;})[_0x311f('0x26')](respondWithResult(_0x2a3527,null))[_0x311f('0x45')](handleError(_0x2a3527,null));};
\ No newline at end of file
index 4bd119b..64ddbb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f4a=['bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api'];(function(_0x5eecf0,_0x4748c8){var _0x4f25b8=function(_0x4391fb){while(--_0x4391fb){_0x5eecf0['push'](_0x5eecf0['shift']());}};_0x4f25b8(++_0x4748c8);}(_0x2f4a,0xce));var _0xa2f4=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2f4a[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xa2f4('0x0'));var util=require(_0xa2f4('0x1'));var logger=require(_0xa2f4('0x2'))(_0xa2f4('0x3'));var moment=require('moment');var BPromise=require(_0xa2f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2f4('0x5'));var rimraf=require(_0xa2f4('0x6'));var config=require(_0xa2f4('0x7'));var attributes=require(_0xa2f4('0x8'));module[_0xa2f4('0x9')]=function(_0x4d9118,_0x34fe82){return _0x4d9118['define'](_0xa2f4('0xa'),attributes,{'tableName':_0xa2f4('0xb'),'paranoid':![],'indexes':[{'name':_0xa2f4('0xc'),'fields':[_0xa2f4('0xc')]},{'name':'uniqueid','fields':[_0xa2f4('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb60=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x5d679f,_0x15aaa8){var _0x226594=function(_0x242183){while(--_0x242183){_0x5d679f['push'](_0x5d679f['shift']());}};_0x226594(++_0x15aaa8);}(_0xcb60,0x1c5));var _0x0cb6=function(_0x1d7037,_0x57dd95){_0x1d7037=_0x1d7037-0x0;var _0x4d6568=_0xcb60[_0x1d7037];return _0x4d6568;};'use strict';var _=require(_0x0cb6('0x0'));var util=require('util');var logger=require(_0x0cb6('0x1'))(_0x0cb6('0x2'));var moment=require('moment');var BPromise=require(_0x0cb6('0x3'));var rp=require(_0x0cb6('0x4'));var fs=require('fs');var path=require(_0x0cb6('0x5'));var rimraf=require(_0x0cb6('0x6'));var config=require(_0x0cb6('0x7'));var attributes=require(_0x0cb6('0x8'));module[_0x0cb6('0x9')]=function(_0x4c1556,_0x5628fb){return _0x4c1556[_0x0cb6('0xa')](_0x0cb6('0xb'),attributes,{'tableName':_0x0cb6('0xc'),'paranoid':![],'indexes':[{'name':_0x0cb6('0xd'),'fields':[_0x0cb6('0xd')]},{'name':_0x0cb6('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index a8f9dcb..8897f3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6b8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateCmHopperFinal','CmHopperFinal','body','options','raw','debug','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0xe6b8,0x124));var _0x8e6b=function(_0x451d75,_0x10520a){_0x451d75=_0x451d75-0x0;var _0x40a6e4=_0xe6b8[_0x451d75];return _0x40a6e4;};'use strict';var _=require(_0x8e6b('0x0'));var util=require(_0x8e6b('0x1'));var moment=require('moment');var BPromise=require(_0x8e6b('0x2'));var rs=require(_0x8e6b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e6b('0x4'))['db'];var utils=require(_0x8e6b('0x5'));var logger=require(_0x8e6b('0x6'))(_0x8e6b('0x7'));var config=require(_0x8e6b('0x8'));var jayson=require(_0x8e6b('0x9'));var client=jayson[_0x8e6b('0xa')][_0x8e6b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dfa33,_0x24d5f6,_0x13069a){return new BPromise(function(_0x59d4ee,_0x42b668){return client['request'](_0x4dfa33,_0x13069a)[_0x8e6b('0xc')](function(_0x133e82){logger[_0x8e6b('0xd')](_0x8e6b('0xe'),_0x24d5f6,_0x8e6b('0xf'));logger['debug']('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x24d5f6,_0x8e6b('0xf'),JSON[_0x8e6b('0x10')](_0x133e82));if(_0x133e82['error']){if(_0x133e82[_0x8e6b('0x11')][_0x8e6b('0x12')]===0x1f4){logger[_0x8e6b('0x11')](_0x8e6b('0xe'),_0x24d5f6,_0x133e82[_0x8e6b('0x11')][_0x8e6b('0x13')]);return _0x42b668(_0x133e82[_0x8e6b('0x11')][_0x8e6b('0x13')]);}logger['error'](_0x8e6b('0xe'),_0x24d5f6,_0x133e82[_0x8e6b('0x11')][_0x8e6b('0x13')]);return _0x59d4ee(_0x133e82[_0x8e6b('0x11')][_0x8e6b('0x13')]);}else{logger[_0x8e6b('0xd')](_0x8e6b('0xe'),_0x24d5f6,'request\x20sent');_0x59d4ee(_0x133e82['result']['message']);}})['catch'](function(_0x540b6a){logger[_0x8e6b('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x24d5f6,_0x540b6a);_0x42b668(_0x540b6a);});});}exports[_0x8e6b('0x14')]=function(_0xe4ab3d){var _0x5a0a13=this;return new Promise(function(_0x28743e,_0x4122d3){return db[_0x8e6b('0x15')]['create'](_0xe4ab3d[_0x8e6b('0x16')],{'raw':_0xe4ab3d[_0x8e6b('0x17')]?_0xe4ab3d['options'][_0x8e6b('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4b7715){logger[_0x8e6b('0xd')](_0x8e6b('0x14'),_0xe4ab3d);logger[_0x8e6b('0x19')](_0x8e6b('0x14'),_0xe4ab3d,JSON[_0x8e6b('0x10')](_0x4b7715));_0x28743e(_0x4b7715);})[_0x8e6b('0x1a')](function(_0x4bc0a2){logger[_0x8e6b('0x11')](_0x8e6b('0x14'),_0x4bc0a2[_0x8e6b('0x13')],_0xe4ab3d);_0x4122d3(_0x5a0a13[_0x8e6b('0x11')](0x1f4,_0x4bc0a2[_0x8e6b('0x13')]));});});};
\ No newline at end of file
+var _0x1873=['CmHopperFinal,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','create','body','options','then','CreateCmHopperFinal','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4bf520,_0x5457ce){var _0x3d9889=function(_0x5b40e5){while(--_0x5b40e5){_0x4bf520['push'](_0x4bf520['shift']());}};_0x3d9889(++_0x5457ce);}(_0x1873,0x135));var _0x3187=function(_0x2ae967,_0x561ca7){_0x2ae967=_0x2ae967-0x0;var _0xa99ce9=_0x1873[_0x2ae967];return _0xa99ce9;};'use strict';var _=require('lodash');var util=require(_0x3187('0x0'));var moment=require('moment');var BPromise=require(_0x3187('0x1'));var rs=require(_0x3187('0x2'));var fs=require('fs');var Redis=require(_0x3187('0x3'));var db=require(_0x3187('0x4'))['db'];var utils=require(_0x3187('0x5'));var logger=require(_0x3187('0x6'))(_0x3187('0x7'));var config=require(_0x3187('0x8'));var jayson=require(_0x3187('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x116a6d,_0x5c6524,_0xee6538){return new BPromise(function(_0x4f3785,_0x5ba6a3){return client[_0x3187('0xa')](_0x116a6d,_0xee6538)['then'](function(_0x5ac0d4){logger[_0x3187('0xb')](_0x3187('0xc'),_0x5c6524,_0x3187('0xd'));logger[_0x3187('0xe')](_0x3187('0xf'),_0x5c6524,_0x3187('0xd'),JSON['stringify'](_0x5ac0d4));if(_0x5ac0d4['error']){if(_0x5ac0d4['error'][_0x3187('0x10')]===0x1f4){logger[_0x3187('0x11')](_0x3187('0xc'),_0x5c6524,_0x5ac0d4[_0x3187('0x11')][_0x3187('0x12')]);return _0x5ba6a3(_0x5ac0d4['error'][_0x3187('0x12')]);}logger[_0x3187('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x5c6524,_0x5ac0d4[_0x3187('0x11')][_0x3187('0x12')]);return _0x4f3785(_0x5ac0d4[_0x3187('0x11')][_0x3187('0x12')]);}else{logger['info'](_0x3187('0xc'),_0x5c6524,_0x3187('0xd'));_0x4f3785(_0x5ac0d4[_0x3187('0x13')][_0x3187('0x12')]);}})[_0x3187('0x14')](function(_0xbbc41d){logger['error'](_0x3187('0xc'),_0x5c6524,_0xbbc41d);_0x5ba6a3(_0xbbc41d);});});}exports['CreateCmHopperFinal']=function(_0x2321d6){var _0x3e4924=this;return new Promise(function(_0x1f31eb,_0x39b0f3){return db['CmHopperFinal'][_0x3187('0x15')](_0x2321d6[_0x3187('0x16')],{'raw':_0x2321d6['options']?_0x2321d6[_0x3187('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3187('0x18')](function(_0x1b131f){logger[_0x3187('0xb')](_0x3187('0x19'),_0x2321d6);logger['debug']('CreateCmHopperFinal',_0x2321d6,JSON[_0x3187('0x1a')](_0x1b131f));_0x1f31eb(_0x1b131f);})[_0x3187('0x14')](function(_0x4dbf29){logger['error']('CreateCmHopperFinal',_0x4dbf29[_0x3187('0x12')],_0x2321d6);_0x39b0f3(_0x3e4924[_0x3187('0x11')](0x1f4,_0x4dbf29[_0x3187('0x12')]));});});};
\ No newline at end of file
index 748e5da..42592b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1fb=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','post'];(function(_0x31479c,_0x40f551){var _0x38dab9=function(_0x1892b5){while(--_0x1892b5){_0x31479c['push'](_0x31479c['shift']());}};_0x38dab9(++_0x40f551);}(_0xc1fb,0x11c));var _0xbc1f=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xc1fb[_0xa8883];return _0x479426;};'use strict';var multer=require('multer');var util=require(_0xbc1f('0x0'));var path=require(_0xbc1f('0x1'));var timeout=require(_0xbc1f('0x2'));var express=require('express');var router=express[_0xbc1f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbc1f('0x4'));var config=require(_0xbc1f('0x5'));var controller=require(_0xbc1f('0x6'));router[_0xbc1f('0x7')]('/',auth[_0xbc1f('0x8')](),controller['index']);router[_0xbc1f('0x7')](_0xbc1f('0x9'),auth['isAuthenticated'](),controller[_0xbc1f('0xa')]);router[_0xbc1f('0x7')](_0xbc1f('0xb'),auth[_0xbc1f('0x8')](),controller[_0xbc1f('0xc')]);router[_0xbc1f('0x7')](_0xbc1f('0xd'),auth[_0xbc1f('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xbc1f('0x7')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0xbc1f('0xe')](_0xbc1f('0xf'),auth[_0xbc1f('0x8')](),controller[_0xbc1f('0x10')]);router[_0xbc1f('0xe')](_0xbc1f('0x11'),auth[_0xbc1f('0x8')](),controller[_0xbc1f('0x12')]);router[_0xbc1f('0xe')](_0xbc1f('0x13'),auth[_0xbc1f('0x8')](),controller[_0xbc1f('0x14')]);router[_0xbc1f('0x15')](_0xbc1f('0xb'),auth[_0xbc1f('0x8')](),controller[_0xbc1f('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xc85b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','multer','path'];(function(_0x456a6c,_0x47b35a){var _0x272575=function(_0x3e6af3){while(--_0x3e6af3){_0x456a6c['push'](_0x456a6c['shift']());}};_0x272575(++_0x47b35a);}(_0xc85b,0xb4));var _0xbc85=function(_0x77a6e7,_0x1d61b4){_0x77a6e7=_0x77a6e7-0x0;var _0x41e83a=_0xc85b[_0x77a6e7];return _0x41e83a;};'use strict';var multer=require(_0xbc85('0x0'));var util=require('util');var path=require(_0xbc85('0x1'));var timeout=require(_0xbc85('0x2'));var express=require(_0xbc85('0x3'));var router=express[_0xbc85('0x4')]();var auth=require(_0xbc85('0x5'));var interaction=require(_0xbc85('0x6'));var config=require('../../config/environment');var controller=require(_0xbc85('0x7'));router[_0xbc85('0x8')]('/',auth[_0xbc85('0x9')](),controller[_0xbc85('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xbc85('0xb')]);router[_0xbc85('0x8')](_0xbc85('0xc'),auth['isAuthenticated'](),controller[_0xbc85('0xd')]);router[_0xbc85('0x8')](_0xbc85('0xe'),auth[_0xbc85('0x9')](),controller[_0xbc85('0xf')]);router['get'](_0xbc85('0x10'),auth['isAuthenticated'](),controller[_0xbc85('0x11')]);router[_0xbc85('0x12')]('/voice/queue/moveContacts/:id',auth[_0xbc85('0x9')](),controller[_0xbc85('0x13')]);router[_0xbc85('0x12')](_0xbc85('0x14'),auth[_0xbc85('0x9')](),controller[_0xbc85('0x15')]);router[_0xbc85('0x12')](_0xbc85('0x16'),auth[_0xbc85('0x9')](),controller['checkContactHopper']);router[_0xbc85('0x17')](_0xbc85('0xc'),auth[_0xbc85('0x9')](),controller[_0xbc85('0x18')]);module[_0xbc85('0x19')]=router;
\ No newline at end of file
index 622ce7c..10e3cf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda7b=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x55d092,_0x204e82){var _0x5aa802=function(_0x88cb93){while(--_0x88cb93){_0x55d092['push'](_0x55d092['shift']());}};_0x5aa802(++_0x204e82);}(_0xda7b,0x8a));var _0xbda7=function(_0x44d6d2,_0x125080){_0x44d6d2=_0x44d6d2-0x0;var _0x52703f=_0xda7b[_0x44d6d2];return _0x52703f;};'use strict';var Sequelize=require('sequelize');module[_0xbda7('0x0')]={'state':{'type':Sequelize[_0xbda7('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xbda7('0x2')]},'scheduledat':{'type':Sequelize[_0xbda7('0x3')]},'countbusyretry':{'type':Sequelize[_0xbda7('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbda7('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xbda7('0x2')]},'originatecalleridname':{'type':Sequelize[_0xbda7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbda7('0x2')]},'starttime':{'type':Sequelize[_0xbda7('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xbda7('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xbda7('0x3')]},'ringtime':{'type':Sequelize[_0xbda7('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbda7('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbda7('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xbda7('0x2')]},'membername':{'type':Sequelize[_0xbda7('0x2')]},'reason':{'type':Sequelize[_0xbda7('0x2')]},'amd':{'type':Sequelize[_0xbda7('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xbda7('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xbda7('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbda7('0x3')]},'recallme':{'type':Sequelize[_0xbda7('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xbda7('0x3')]},'edited':{'type':Sequelize[_0xbda7('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbda7('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbda7('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbda7('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xfe02=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x4357da,_0x2e8f55){var _0x5da8de=function(_0x17cc66){while(--_0x17cc66){_0x4357da['push'](_0x4357da['shift']());}};_0x5da8de(++_0x2e8f55);}(_0xfe02,0xb8));var _0x2fe0=function(_0x526406,_0x549226){_0x526406=_0x526406-0x0;var _0xdd3e6d=_0xfe02[_0x526406];return _0xdd3e6d;};'use strict';var Sequelize=require(_0x2fe0('0x0'));module[_0x2fe0('0x1')]={'state':{'type':Sequelize[_0x2fe0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x2fe0('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2fe0('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x2fe0('0x3')]},'originatecalleridname':{'type':Sequelize[_0x2fe0('0x3')]},'calleridnum':{'type':Sequelize[_0x2fe0('0x3')]},'calleridname':{'type':Sequelize[_0x2fe0('0x3')]},'starttime':{'type':Sequelize[_0x2fe0('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x2fe0('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2fe0('0x4')]},'ringtime':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x2fe0('0x3')]},'campaigntype':{'type':Sequelize[_0x2fe0('0x3')]},'membername':{'type':Sequelize[_0x2fe0('0x3')]},'reason':{'type':Sequelize[_0x2fe0('0x3')]},'amd':{'type':Sequelize[_0x2fe0('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x2fe0('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2fe0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2fe0('0x4')]},'recallme':{'type':Sequelize[_0x2fe0('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2fe0('0x4')]},'edited':{'type':Sequelize[_0x2fe0('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2fe0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index a8e1680..2cca733 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2008=['uniqueid','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','describe','body'];(function(_0x48a1d3,_0x25b0eb){var _0x44b2c2=function(_0x162e60){while(--_0x162e60){_0x48a1d3['push'](_0x48a1d3['shift']());}};_0x44b2c2(++_0x25b0eb);}(_0x2008,0x191));var _0x8200=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x2008[_0x179e11];return _0x549f04;};'use strict';var pdf=require(_0x8200('0x0'));var emlformat=require(_0x8200('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8200('0x2'));var jsonpatch=require(_0x8200('0x3'));var rp=require(_0x8200('0x4'));var moment=require('moment');var BPromise=require(_0x8200('0x5'));var Mustache=require('mustache');var util=require(_0x8200('0x6'));var path=require(_0x8200('0x7'));var sox=require(_0x8200('0x8'));var csv=require(_0x8200('0x9'));var ejs=require(_0x8200('0xa'));var fs=require('fs');var _=require(_0x8200('0xb'));var squel=require(_0x8200('0xc'));var crypto=require(_0x8200('0xd'));var jsforce=require(_0x8200('0xe'));var deskjs=require(_0x8200('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8200('0x10'));var Papa=require(_0x8200('0x11'));var Redis=require(_0x8200('0x12'));var authService=require(_0x8200('0x13'));var qs=require(_0x8200('0x14'));var as=require(_0x8200('0x15'));var hardwareService=require(_0x8200('0x16'));var logger=require('../../config/logger')(_0x8200('0x17'));var utils=require(_0x8200('0x18'));var config=require(_0x8200('0x19'));var db=require(_0x8200('0x1a'))['db'];function respondWithStatusCode(_0x389b72,_0x43c5e2){_0x43c5e2=_0x43c5e2||0xcc;return function(_0x543622){if(_0x543622){return _0x389b72[_0x8200('0x1b')](_0x43c5e2);}return _0x389b72['status'](_0x43c5e2)[_0x8200('0x1c')]();};}function respondWithResult(_0x1a42bf,_0x46ec7f){_0x46ec7f=_0x46ec7f||0xc8;return function(_0x381a19){if(_0x381a19){return _0x1a42bf[_0x8200('0x1d')](_0x46ec7f)[_0x8200('0x1e')](_0x381a19);}};}function respondWithFilteredResult(_0x6a7975,_0x4f0528){return function(_0x440279){if(_0x440279){var _0x4e57db=_0x440279[_0x8200('0x1f')],_0x1fb447=_0x4f0528[_0x8200('0x20')],_0x43ea78=_0x4f0528[_0x8200('0x20')]+_0x4f0528['limit'],_0x5cd84d;if(_0x43ea78>=_0x4e57db){_0x43ea78=_0x4e57db;_0x5cd84d=0xc8;}else{_0x5cd84d=0xce;}_0x6a7975[_0x8200('0x1d')](_0x5cd84d);return _0x6a7975[_0x8200('0x21')](_0x8200('0x22'),_0x1fb447+'-'+_0x43ea78+'/'+_0x4e57db)[_0x8200('0x1e')](_0x440279);}return null;};}function patchUpdates(_0x361041){return function(_0x44f085){try{jsonpatch[_0x8200('0x23')](_0x44f085,_0x361041,!![]);}catch(_0x169879){return BPromise[_0x8200('0x24')](_0x169879);}return _0x44f085[_0x8200('0x25')]();};}function saveUpdates(_0x425a1e,_0x17e69d){return function(_0xf84dd7){if(_0xf84dd7){return _0xf84dd7[_0x8200('0x26')](_0x425a1e)[_0x8200('0x27')](function(_0x4c5e52){return _0x4c5e52;});}return null;};}function removeEntity(_0x3d0468,_0x1cfac4){return function(_0xa2feb){if(_0xa2feb){return _0xa2feb[_0x8200('0x28')]()[_0x8200('0x27')](function(){_0x3d0468[_0x8200('0x1d')](0xcc)[_0x8200('0x1c')]();});}};}function handleEntityNotFound(_0x33c411,_0x46b6e5){return function(_0x120466){if(!_0x120466){_0x33c411['sendStatus'](0x194);}return _0x120466;};}function handleError(_0x1128cd,_0x460ba4){_0x460ba4=_0x460ba4||0x1f4;return function(_0x2c864f){logger[_0x8200('0x29')](_0x2c864f[_0x8200('0x2a')]);if(_0x2c864f[_0x8200('0x2b')]){delete _0x2c864f[_0x8200('0x2b')];}_0x1128cd['status'](_0x460ba4)[_0x8200('0x2c')](_0x2c864f);};}exports[_0x8200('0x2d')]=function(_0x2f18b8,_0x20a4b9){var _0x25c9cf={},_0x133cbb={},_0x4d081a={'count':0x0,'rows':[]};var _0x31f35c=_[_0x8200('0x2e')](db[_0x8200('0x2f')][_0x8200('0x30')],function(_0x1f520a){return{'name':_0x1f520a[_0x8200('0x31')],'type':_0x1f520a['type']['key']};});_0x133cbb[_0x8200('0x32')]=_[_0x8200('0x2e')](_0x31f35c,'name');_0x133cbb[_0x8200('0x33')]=_['keys'](_0x2f18b8[_0x8200('0x33')]);_0x133cbb[_0x8200('0x34')]=_[_0x8200('0x35')](_0x133cbb[_0x8200('0x32')],_0x133cbb[_0x8200('0x33')]);_0x25c9cf[_0x8200('0x36')]=_[_0x8200('0x35')](_0x133cbb[_0x8200('0x32')],qs[_0x8200('0x37')](_0x2f18b8[_0x8200('0x33')]['fields']));_0x25c9cf[_0x8200('0x36')]=_0x25c9cf['attributes'][_0x8200('0x38')]?_0x25c9cf[_0x8200('0x36')]:_0x133cbb[_0x8200('0x32')];if(!_0x2f18b8[_0x8200('0x33')]['hasOwnProperty'](_0x8200('0x39'))){_0x25c9cf['limit']=qs[_0x8200('0x3a')](_0x2f18b8[_0x8200('0x33')][_0x8200('0x3a')]);_0x25c9cf[_0x8200('0x20')]=qs[_0x8200('0x20')](_0x2f18b8[_0x8200('0x33')][_0x8200('0x20')]);}_0x25c9cf[_0x8200('0x3b')]=qs[_0x8200('0x3c')](_0x2f18b8[_0x8200('0x33')][_0x8200('0x3c')]);_0x25c9cf['where']=qs[_0x8200('0x34')](_[_0x8200('0x3d')](_0x2f18b8[_0x8200('0x33')],_0x133cbb[_0x8200('0x34')]),_0x31f35c);if(_0x2f18b8['query'][_0x8200('0x3e')]){_0x25c9cf[_0x8200('0x3f')]=_['merge'](_0x25c9cf[_0x8200('0x3f')],{'$or':_[_0x8200('0x2e')](_0x31f35c,function(_0x3e4880){if(_0x3e4880['type']!==_0x8200('0x40')){var _0x116674={};_0x116674[_0x3e4880[_0x8200('0x2b')]]={'$like':'%'+_0x2f18b8[_0x8200('0x33')][_0x8200('0x3e')]+'%'};return _0x116674;}})});}_0x25c9cf=_[_0x8200('0x41')]({},_0x25c9cf,_0x2f18b8[_0x8200('0x42')]);var _0x34b613={'where':_0x25c9cf[_0x8200('0x3f')]};return db[_0x8200('0x2f')][_0x8200('0x1f')](_0x34b613)[_0x8200('0x27')](function(_0x21a25d){_0x4d081a['count']=_0x21a25d;if(_0x2f18b8[_0x8200('0x33')][_0x8200('0x43')]){_0x25c9cf[_0x8200('0x44')]=[{'all':!![]}];}return db[_0x8200('0x2f')][_0x8200('0x45')](_0x25c9cf);})[_0x8200('0x27')](function(_0x69a99e){_0x4d081a[_0x8200('0x46')]=_0x69a99e;return _0x4d081a;})['then'](respondWithFilteredResult(_0x20a4b9,_0x25c9cf))['catch'](handleError(_0x20a4b9,null));};exports[_0x8200('0x47')]=function(_0x37b622,_0x27843b){var _0xab288f={'raw':!![],'where':{'id':_0x37b622[_0x8200('0x48')]['id']}},_0x743218={};_0x743218['model']=_[_0x8200('0x49')](db[_0x8200('0x2f')][_0x8200('0x30')]);_0x743218[_0x8200('0x33')]=_[_0x8200('0x49')](_0x37b622['query']);_0x743218[_0x8200('0x34')]=_['intersection'](_0x743218[_0x8200('0x32')],_0x743218[_0x8200('0x33')]);_0xab288f['attributes']=_[_0x8200('0x35')](_0x743218[_0x8200('0x32')],qs[_0x8200('0x37')](_0x37b622[_0x8200('0x33')][_0x8200('0x37')]));_0xab288f['attributes']=_0xab288f[_0x8200('0x36')]['length']?_0xab288f[_0x8200('0x36')]:_0x743218[_0x8200('0x32')];if(_0x37b622[_0x8200('0x33')][_0x8200('0x43')]){_0xab288f[_0x8200('0x44')]=[{'all':!![]}];}_0xab288f=_['merge']({},_0xab288f,_0x37b622[_0x8200('0x42')]);return db['CmHopperHistory'][_0x8200('0x4a')](_0xab288f)[_0x8200('0x27')](handleEntityNotFound(_0x27843b,null))[_0x8200('0x27')](respondWithResult(_0x27843b,null))[_0x8200('0x4b')](handleError(_0x27843b,null));};exports[_0x8200('0x4c')]=function(_0x332e3e,_0x2df698){return db[_0x8200('0x2f')][_0x8200('0x4c')](_0x332e3e['body'],{})['then'](respondWithResult(_0x2df698,0xc9))[_0x8200('0x4b')](handleError(_0x2df698,null));};exports['describe']=function(_0x25b229,_0x595ebe){return db['CmHopperHistory'][_0x8200('0x4d')]()[_0x8200('0x27')](respondWithResult(_0x595ebe,null))[_0x8200('0x4b')](handleError(_0x595ebe,null));};exports['update']=function(_0x3a1188,_0xc868cb){if(_0x3a1188[_0x8200('0x4e')][_0x8200('0x4f')]){delete _0x3a1188['body'][_0x8200('0x4f')];}return db[_0x8200('0x2f')][_0x8200('0x4a')]({'where':{'uniqueid':_0x3a1188[_0x8200('0x48')]['id']}})[_0x8200('0x27')](handleEntityNotFound(_0xc868cb,null))['then'](saveUpdates(_0x3a1188['body'],null))[_0x8200('0x27')](respondWithResult(_0xc868cb,null))[_0x8200('0x4b')](handleError(_0xc868cb,null));};
\ No newline at end of file
+var _0x0d49=['offset','limit','set','Content-Range','apply','update','then','destroy','end','stack','name','send','index','map','CmHopperHistory','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','describe','uniqueid','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','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','json','count'];(function(_0x4bb435,_0x23c5f8){var _0xcf7fa6=function(_0x1ec510){while(--_0x1ec510){_0x4bb435['push'](_0x4bb435['shift']());}};_0xcf7fa6(++_0x23c5f8);}(_0x0d49,0x7b));var _0x90d4=function(_0x97e409,_0x16eebb){_0x97e409=_0x97e409-0x0;var _0x3b5541=_0x0d49[_0x97e409];return _0x3b5541;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x90d4('0x0'));var rimraf=require(_0x90d4('0x1'));var zipdir=require(_0x90d4('0x2'));var jsonpatch=require(_0x90d4('0x3'));var rp=require(_0x90d4('0x4'));var moment=require('moment');var BPromise=require(_0x90d4('0x5'));var Mustache=require(_0x90d4('0x6'));var util=require('util');var path=require(_0x90d4('0x7'));var sox=require(_0x90d4('0x8'));var csv=require(_0x90d4('0x9'));var ejs=require(_0x90d4('0xa'));var fs=require('fs');var _=require(_0x90d4('0xb'));var squel=require('squel');var crypto=require(_0x90d4('0xc'));var jsforce=require(_0x90d4('0xd'));var deskjs=require(_0x90d4('0xe'));var toCsv=require(_0x90d4('0x9'));var querystring=require(_0x90d4('0xf'));var Papa=require(_0x90d4('0x10'));var Redis=require(_0x90d4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x90d4('0x12'));var as=require(_0x90d4('0x13'));var hardwareService=require(_0x90d4('0x14'));var logger=require(_0x90d4('0x15'))('api');var utils=require(_0x90d4('0x16'));var config=require(_0x90d4('0x17'));var db=require(_0x90d4('0x18'))['db'];function respondWithStatusCode(_0x433706,_0x399549){_0x399549=_0x399549||0xcc;return function(_0x385477){if(_0x385477){return _0x433706[_0x90d4('0x19')](_0x399549);}return _0x433706[_0x90d4('0x1a')](_0x399549)['end']();};}function respondWithResult(_0x4a0e29,_0x5621ab){_0x5621ab=_0x5621ab||0xc8;return function(_0x5a57b7){if(_0x5a57b7){return _0x4a0e29[_0x90d4('0x1a')](_0x5621ab)[_0x90d4('0x1b')](_0x5a57b7);}};}function respondWithFilteredResult(_0x42f5f6,_0x365211){return function(_0x353f71){if(_0x353f71){var _0xb1b9e2=_0x353f71[_0x90d4('0x1c')],_0x398ea2=_0x365211['offset'],_0x5c827f=_0x365211[_0x90d4('0x1d')]+_0x365211[_0x90d4('0x1e')],_0x1eb07c;if(_0x5c827f>=_0xb1b9e2){_0x5c827f=_0xb1b9e2;_0x1eb07c=0xc8;}else{_0x1eb07c=0xce;}_0x42f5f6[_0x90d4('0x1a')](_0x1eb07c);return _0x42f5f6[_0x90d4('0x1f')](_0x90d4('0x20'),_0x398ea2+'-'+_0x5c827f+'/'+_0xb1b9e2)[_0x90d4('0x1b')](_0x353f71);}return null;};}function patchUpdates(_0x2530df){return function(_0x3ff296){try{jsonpatch[_0x90d4('0x21')](_0x3ff296,_0x2530df,!![]);}catch(_0x290d39){return BPromise['reject'](_0x290d39);}return _0x3ff296['save']();};}function saveUpdates(_0x11d739,_0x29e238){return function(_0x159829){if(_0x159829){return _0x159829[_0x90d4('0x22')](_0x11d739)[_0x90d4('0x23')](function(_0x57249b){return _0x57249b;});}return null;};}function removeEntity(_0x4b9258,_0x5dd7de){return function(_0x5a55f7){if(_0x5a55f7){return _0x5a55f7[_0x90d4('0x24')]()[_0x90d4('0x23')](function(){_0x4b9258[_0x90d4('0x1a')](0xcc)[_0x90d4('0x25')]();});}};}function handleEntityNotFound(_0x23ed81,_0x1cdf04){return function(_0xc2562f){if(!_0xc2562f){_0x23ed81['sendStatus'](0x194);}return _0xc2562f;};}function handleError(_0x272033,_0x51c988){_0x51c988=_0x51c988||0x1f4;return function(_0x222f98){logger['error'](_0x222f98[_0x90d4('0x26')]);if(_0x222f98[_0x90d4('0x27')]){delete _0x222f98[_0x90d4('0x27')];}_0x272033['status'](_0x51c988)[_0x90d4('0x28')](_0x222f98);};}exports[_0x90d4('0x29')]=function(_0x17b3fa,_0xb844f1){var _0x5f3fb8={},_0x4af8b1={},_0x3ad3db={'count':0x0,'rows':[]};var _0x530755=_[_0x90d4('0x2a')](db[_0x90d4('0x2b')]['rawAttributes'],function(_0x34a2ce){return{'name':_0x34a2ce[_0x90d4('0x2c')],'type':_0x34a2ce[_0x90d4('0x2d')][_0x90d4('0x2e')]};});_0x4af8b1[_0x90d4('0x2f')]=_[_0x90d4('0x2a')](_0x530755,_0x90d4('0x27'));_0x4af8b1[_0x90d4('0x30')]=_['keys'](_0x17b3fa[_0x90d4('0x30')]);_0x4af8b1[_0x90d4('0x31')]=_[_0x90d4('0x32')](_0x4af8b1['model'],_0x4af8b1[_0x90d4('0x30')]);_0x5f3fb8[_0x90d4('0x33')]=_[_0x90d4('0x32')](_0x4af8b1[_0x90d4('0x2f')],qs[_0x90d4('0x34')](_0x17b3fa[_0x90d4('0x30')][_0x90d4('0x34')]));_0x5f3fb8[_0x90d4('0x33')]=_0x5f3fb8[_0x90d4('0x33')][_0x90d4('0x35')]?_0x5f3fb8[_0x90d4('0x33')]:_0x4af8b1[_0x90d4('0x2f')];if(!_0x17b3fa[_0x90d4('0x30')][_0x90d4('0x36')]('nolimit')){_0x5f3fb8[_0x90d4('0x1e')]=qs[_0x90d4('0x1e')](_0x17b3fa['query'][_0x90d4('0x1e')]);_0x5f3fb8[_0x90d4('0x1d')]=qs['offset'](_0x17b3fa[_0x90d4('0x30')][_0x90d4('0x1d')]);}_0x5f3fb8[_0x90d4('0x37')]=qs[_0x90d4('0x38')](_0x17b3fa['query'][_0x90d4('0x38')]);_0x5f3fb8[_0x90d4('0x39')]=qs[_0x90d4('0x31')](_[_0x90d4('0x3a')](_0x17b3fa[_0x90d4('0x30')],_0x4af8b1[_0x90d4('0x31')]),_0x530755);if(_0x17b3fa[_0x90d4('0x30')][_0x90d4('0x3b')]){_0x5f3fb8[_0x90d4('0x39')]=_[_0x90d4('0x3c')](_0x5f3fb8['where'],{'$or':_[_0x90d4('0x2a')](_0x530755,function(_0xed0e57){if(_0xed0e57[_0x90d4('0x2d')]!=='VIRTUAL'){var _0x3fb473={};_0x3fb473[_0xed0e57[_0x90d4('0x27')]]={'$like':'%'+_0x17b3fa[_0x90d4('0x30')][_0x90d4('0x3b')]+'%'};return _0x3fb473;}})});}_0x5f3fb8=_[_0x90d4('0x3c')]({},_0x5f3fb8,_0x17b3fa[_0x90d4('0x3d')]);var _0x26882e={'where':_0x5f3fb8[_0x90d4('0x39')]};return db[_0x90d4('0x2b')][_0x90d4('0x1c')](_0x26882e)[_0x90d4('0x23')](function(_0x34d9ef){_0x3ad3db[_0x90d4('0x1c')]=_0x34d9ef;if(_0x17b3fa['query'][_0x90d4('0x3e')]){_0x5f3fb8[_0x90d4('0x3f')]=[{'all':!![]}];}return db[_0x90d4('0x2b')][_0x90d4('0x40')](_0x5f3fb8);})['then'](function(_0x50aa25){_0x3ad3db[_0x90d4('0x41')]=_0x50aa25;return _0x3ad3db;})[_0x90d4('0x23')](respondWithFilteredResult(_0xb844f1,_0x5f3fb8))[_0x90d4('0x42')](handleError(_0xb844f1,null));};exports[_0x90d4('0x43')]=function(_0x13ea92,_0xea064){var _0x1d738f={'raw':!![],'where':{'id':_0x13ea92[_0x90d4('0x44')]['id']}},_0x44549d={};_0x44549d['model']=_[_0x90d4('0x45')](db[_0x90d4('0x2b')][_0x90d4('0x46')]);_0x44549d['query']=_['keys'](_0x13ea92['query']);_0x44549d[_0x90d4('0x31')]=_[_0x90d4('0x32')](_0x44549d[_0x90d4('0x2f')],_0x44549d['query']);_0x1d738f[_0x90d4('0x33')]=_[_0x90d4('0x32')](_0x44549d[_0x90d4('0x2f')],qs['fields'](_0x13ea92[_0x90d4('0x30')][_0x90d4('0x34')]));_0x1d738f[_0x90d4('0x33')]=_0x1d738f[_0x90d4('0x33')]['length']?_0x1d738f[_0x90d4('0x33')]:_0x44549d[_0x90d4('0x2f')];if(_0x13ea92['query']['includeAll']){_0x1d738f[_0x90d4('0x3f')]=[{'all':!![]}];}_0x1d738f=_['merge']({},_0x1d738f,_0x13ea92[_0x90d4('0x3d')]);return db[_0x90d4('0x2b')][_0x90d4('0x47')](_0x1d738f)[_0x90d4('0x23')](handleEntityNotFound(_0xea064,null))[_0x90d4('0x23')](respondWithResult(_0xea064,null))['catch'](handleError(_0xea064,null));};exports[_0x90d4('0x48')]=function(_0x36b9a2,_0x2a7be3){return db[_0x90d4('0x2b')][_0x90d4('0x48')](_0x36b9a2['body'],{})['then'](respondWithResult(_0x2a7be3,0xc9))['catch'](handleError(_0x2a7be3,null));};exports[_0x90d4('0x49')]=function(_0x4960be,_0x4bf090){return db[_0x90d4('0x2b')][_0x90d4('0x49')]()[_0x90d4('0x23')](respondWithResult(_0x4bf090,null))[_0x90d4('0x42')](handleError(_0x4bf090,null));};exports['update']=function(_0x49b2ac,_0x587b87){if(_0x49b2ac['body'][_0x90d4('0x4a')]){delete _0x49b2ac[_0x90d4('0x4b')][_0x90d4('0x4a')];}return db[_0x90d4('0x2b')][_0x90d4('0x47')]({'where':{'uniqueid':_0x49b2ac[_0x90d4('0x44')]['id']}})[_0x90d4('0x23')](handleEntityNotFound(_0x587b87,null))[_0x90d4('0x23')](saveUpdates(_0x49b2ac[_0x90d4('0x4b')],null))[_0x90d4('0x23')](respondWithResult(_0x587b87,null))[_0x90d4('0x42')](handleError(_0x587b87,null));};
\ No newline at end of file
index 71690f5..a2273dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f08=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','bluebird','path','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0x4f08,0x17f));var _0x84f0=function(_0x105629,_0x904094){_0x105629=_0x105629-0x0;var _0x3f9cc7=_0x4f08[_0x105629];return _0x3f9cc7;};'use strict';var _=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var logger=require('../../config/logger')(_0x84f0('0x2'));var moment=require(_0x84f0('0x3'));var BPromise=require(_0x84f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84f0('0x5'));var rimraf=require('rimraf');var config=require(_0x84f0('0x6'));var attributes=require(_0x84f0('0x7'));module[_0x84f0('0x8')]=function(_0x426ee6,_0x38531d){return _0x426ee6[_0x84f0('0x9')](_0x84f0('0xa'),attributes,{'tableName':_0x84f0('0xb'),'paranoid':![],'indexes':[{'name':_0x84f0('0xc'),'fields':[_0x84f0('0xc')]},{'name':'uniqueid','fields':[_0x84f0('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fe8=['util','api','moment','bluebird','rimraf','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x40b898,_0x2fd575){var _0x2ff0bb=function(_0x5a37ae){while(--_0x5a37ae){_0x40b898['push'](_0x40b898['shift']());}};_0x2ff0bb(++_0x2fd575);}(_0x3fe8,0x6e));var _0x83fe=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x3fe8[_0x175a55];return _0x167adf;};'use strict';var _=require('lodash');var util=require(_0x83fe('0x0'));var logger=require('../../config/logger')(_0x83fe('0x1'));var moment=require(_0x83fe('0x2'));var BPromise=require(_0x83fe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x83fe('0x4'));var config=require('../../config/environment');var attributes=require(_0x83fe('0x5'));module[_0x83fe('0x6')]=function(_0x20d8cd,_0x4c22e1){return _0x20d8cd['define'](_0x83fe('0x7'),attributes,{'tableName':_0x83fe('0x8'),'paranoid':![],'indexes':[{'name':_0x83fe('0x9'),'fields':[_0x83fe('0x9')]},{'name':_0x83fe('0xa'),'fields':[_0x83fe('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 3dd3dbb..ca2f81b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['ivrTotalCallsDays','GetCampaignHopperHistory','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','raw','findAll','options','where','sequelize','COUNT','col','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`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','AvgHandleTime','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory'];(function(_0x753d63,_0x4454ec){var _0x4d9cfc=function(_0x40d767){while(--_0x40d767){_0x753d63['push'](_0x753d63['shift']());}};_0x4d9cfc(++_0x4454ec);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'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')]('CmHopperHistory,\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);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')](_0x53c338[_0x0baf('0x19')],{'raw':_0x53c338['options']?_0x53c338['options'][_0x0baf('0x1a')]===undefined?!![]:![]:!![]})[_0x0baf('0xc')](function(_0x32e839){logger[_0x0baf('0xd')](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x32e839));_0xfbecec(_0x32e839);})[_0x0baf('0x15')](function(_0x15a2c3){logger['error'](_0x0baf('0x16'),_0x15a2c3['message'],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x15a2c3['message']));});});};exports['AvgHandleTime']=function(_0x2ef0aa){var _0x48a0e9=this;return new Promise(function(_0x4be1b9,_0x47c4b){return db[_0x0baf('0x17')][_0x0baf('0x1b')]({'raw':_0x2ef0aa[_0x0baf('0x1c')]?_0x2ef0aa[_0x0baf('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ef0aa[_0x0baf('0x1c')]?_0x2ef0aa[_0x0baf('0x1c')][_0x0baf('0x1d')]||null:null,'attributes':[[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')][_0x0baf('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')]['literal'](_0x0baf('0x21')))),_0x0baf('0x22')],[db['sequelize']['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x24')))),_0x0baf('0x25')],[db[_0x0baf('0x1e')]['fn']('COUNT',db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x26')))),_0x0baf('0x27')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x28'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x29')))),_0x0baf('0x2a')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x28'),db['sequelize']['fn']('IF',db[_0x0baf('0x1e')]['literal'](_0x0baf('0x2b')))),_0x0baf('0x2c')]]})[_0x0baf('0xc')](function(_0x3d65f2){logger['info'](_0x0baf('0x2d'),_0x2ef0aa);logger[_0x0baf('0x10')]('AvgHandleTime',_0x2ef0aa,JSON[_0x0baf('0x12')](_0x3d65f2));_0x4be1b9(_0x3d65f2);})[_0x0baf('0x15')](function(_0x62a2ed){logger[_0x0baf('0x13')](_0x0baf('0x2d'),_0x62a2ed[_0x0baf('0x14')],_0x2ef0aa);_0x47c4b(_0x48a0e9[_0x0baf('0x13')](0x1f4,_0x62a2ed[_0x0baf('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x7e765b){var _0x2ab8fa=this;return new Promise(function(_0x5b991f,_0x32c022){return db['CmHopperHistory']['findAll']({'raw':_0x7e765b[_0x0baf('0x1c')]?_0x7e765b[_0x0baf('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x7e765b['options']?_0x7e765b[_0x0baf('0x1c')][_0x0baf('0x1d')]||null:null,'attributes':[[_0x0baf('0x2e'),_0x0baf('0x2f')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x30')))),_0x0baf('0x31')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db['sequelize'][_0x0baf('0x23')](_0x0baf('0x32')))),'outboundNoAnswerCallsDay'],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x21')))),'outboundAnswerCallsDay'],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db['sequelize']['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x33')))),_0x0baf('0x34')],[db['sequelize']['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x35')))),_0x0baf('0x36')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')]['literal'](_0x0baf('0x37')))),_0x0baf('0x38')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db['sequelize'][_0x0baf('0x23')](_0x0baf('0x39')))),_0x0baf('0x3a')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db['sequelize']['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x3b')))),_0x0baf('0x3c')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db['sequelize'][_0x0baf('0x23')](_0x0baf('0x3d')))),_0x0baf('0x3e')],[db['sequelize']['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x3f')))),_0x0baf('0x40')],[db[_0x0baf('0x1e')]['fn']('COUNT',db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x41')))),_0x0baf('0x42')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x43')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x44')))),_0x0baf('0x42')],[db[_0x0baf('0x1e')]['fn']('COUNT',db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x45')))),_0x0baf('0x46')]],'group':[_0x0baf('0x2e')]})['then'](function(_0x3eebe5){logger['info'](_0x0baf('0x47'),_0x7e765b);logger['debug'](_0x0baf('0x47'),_0x7e765b,JSON['stringify'](_0x3eebe5));_0x5b991f(_0x3eebe5);})[_0x0baf('0x15')](function(_0x4c035b){logger[_0x0baf('0x13')](_0x0baf('0x47'),_0x4c035b[_0x0baf('0x14')],_0x7e765b);_0x32c022(_0x2ab8fa[_0x0baf('0x13')](0x1f4,_0x4c035b[_0x0baf('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x21f179){var _0x36b7d2=this;return new Promise(function(_0x16cbf1,_0xb45360){return db[_0x0baf('0x17')][_0x0baf('0x1b')]({'raw':_0x21f179['options']?_0x21f179[_0x0baf('0x1c')][_0x0baf('0x1a')]===undefined?!![]:![]:!![],'where':_0x21f179[_0x0baf('0x1c')]?_0x21f179[_0x0baf('0x1c')][_0x0baf('0x1d')]||null:null,'attributes':[[_0x0baf('0x2e'),_0x0baf('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x0baf('0x1e')][_0x0baf('0x20')]('id')),_0x0baf('0x48')],[db[_0x0baf('0x1e')]['fn'](_0x0baf('0x1f'),db[_0x0baf('0x1e')]['fn']('IF',db[_0x0baf('0x1e')][_0x0baf('0x23')](_0x0baf('0x21')))),'ivrAnswerCallsDay']],'group':[_0x0baf('0x2e')]})[_0x0baf('0xc')](function(_0x3c2d03){logger[_0x0baf('0xd')](_0x0baf('0x49'),_0x21f179);logger[_0x0baf('0x10')](_0x0baf('0x49'),_0x21f179,JSON['stringify'](_0x3c2d03));_0x16cbf1(_0x3c2d03);})[_0x0baf('0x15')](function(_0x27f580){logger[_0x0baf('0x13')](_0x0baf('0x49'),_0x27f580[_0x0baf('0x14')],_0x21f179);_0xb45360(_0x36b7d2[_0x0baf('0x13')](0x1f4,_0x27f580[_0x0baf('0x14')]));});});};
\ No newline at end of file
+var _0x5eb8=['raw','then','CreateCmHopperHistory','stringify','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperHistory','create','body','options'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x5eb8,0xb0));var _0x85eb=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x5eb8[_0x507ac5];return _0x12c1bc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateCmHopperHistory']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateCmHopperHistory',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});};exports[_0x85eb('0x1d')]=function(_0x1426c8){var _0x3f7a4d=this;return new Promise(function(_0x28b87d,_0x312b3e){return db[_0x85eb('0x15')]['findAll']({'raw':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')]['where']||null:null,'attributes':[[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')][_0x85eb('0x20')]('id')),_0x85eb('0x21')],[db[_0x85eb('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x24')))),_0x85eb('0x25')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x27')))),_0x85eb('0x28')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x29')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x340745){logger[_0x85eb('0xd')](_0x85eb('0x1d'),_0x1426c8);logger[_0x85eb('0x10')](_0x85eb('0x1d'),_0x1426c8,JSON[_0x85eb('0x1c')](_0x340745));_0x28b87d(_0x340745);})[_0x85eb('0x14')](function(_0x35f092){logger[_0x85eb('0x12')](_0x85eb('0x1d'),_0x35f092[_0x85eb('0x13')],_0x1426c8);_0x312b3e(_0x3f7a4d[_0x85eb('0x12')](0x1f4,_0x35f092[_0x85eb('0x13')]));});});};exports[_0x85eb('0x2a')]=function(_0x4b69a7){var _0x4361e2=this;return new Promise(function(_0x3dfe74,_0x58f091){return db['CmHopperHistory'][_0x85eb('0x2b')]({'raw':_0x4b69a7[_0x85eb('0x18')]?_0x4b69a7['options'][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x4b69a7['options']?_0x4b69a7[_0x85eb('0x18')]['where']||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x85eb('0x2e')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x85eb('0x22')))),_0x85eb('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x30')))),_0x85eb('0x31')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x32')))),_0x85eb('0x33')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x36')))),_0x85eb('0x37')],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x38')))),_0x85eb('0x39')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x3a')))),_0x85eb('0x3b')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x3c')))),_0x85eb('0x3d')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x3e')))),_0x85eb('0x3f')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x85eb('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x40')))),'outboundReCallsDay']],'group':['campaign']})[_0x85eb('0x1a')](function(_0x249511){logger[_0x85eb('0xd')](_0x85eb('0x2a'),_0x4b69a7);logger[_0x85eb('0x10')]('GetVoiceQueueHopperHistory',_0x4b69a7,JSON[_0x85eb('0x1c')](_0x249511));_0x3dfe74(_0x249511);})[_0x85eb('0x14')](function(_0x270bb2){logger[_0x85eb('0x12')](_0x85eb('0x2a'),_0x270bb2['message'],_0x4b69a7);_0x58f091(_0x4361e2[_0x85eb('0x12')](0x1f4,_0x270bb2['message']));});});};exports[_0x85eb('0x41')]=function(_0x40d846){var _0x4ee529=this;return new Promise(function(_0x341ddb,_0xd04f24){return db[_0x85eb('0x15')][_0x85eb('0x2b')]({'raw':_0x40d846[_0x85eb('0x18')]?_0x40d846[_0x85eb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x40d846[_0x85eb('0x18')]?_0x40d846['options'][_0x85eb('0x42')]||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize'][_0x85eb('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x22')))),'ivrAnswerCallsDay']],'group':[_0x85eb('0x2c')]})[_0x85eb('0x1a')](function(_0x1d3204){logger[_0x85eb('0xd')](_0x85eb('0x41'),_0x40d846);logger[_0x85eb('0x10')](_0x85eb('0x41'),_0x40d846,JSON[_0x85eb('0x1c')](_0x1d3204));_0x341ddb(_0x1d3204);})[_0x85eb('0x14')](function(_0x13cc2a){logger[_0x85eb('0x12')]('GetCampaignHopperHistory',_0x13cc2a[_0x85eb('0x13')],_0x40d846);_0xd04f24(_0x4ee529[_0x85eb('0x12')](0x1f4,_0x13cc2a[_0x85eb('0x13')]));});});};
\ No newline at end of file
index a483389..b1addf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe070=['util','path','connect-timeout','express','Router','../../components/auth/service','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','multer'];(function(_0xf01241,_0x3c8bfd){var _0x5364b7=function(_0x59e9a5){while(--_0x59e9a5){_0xf01241['push'](_0xf01241['shift']());}};_0x5364b7(++_0x3c8bfd);}(_0xe070,0x167));var _0x0e07=function(_0x44654c,_0x926d31){_0x44654c=_0x44654c-0x0;var _0x2ecdea=_0xe070[_0x44654c];return _0x2ecdea;};'use strict';var multer=require(_0x0e07('0x0'));var util=require(_0x0e07('0x1'));var path=require(_0x0e07('0x2'));var timeout=require(_0x0e07('0x3'));var express=require(_0x0e07('0x4'));var router=express[_0x0e07('0x5')]();var auth=require(_0x0e07('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0e07('0x7'));router['get']('/',auth[_0x0e07('0x8')](),controller[_0x0e07('0x9')]);router[_0x0e07('0xa')](_0x0e07('0xb'),auth[_0x0e07('0x8')](),controller[_0x0e07('0xc')]);router[_0x0e07('0xa')](_0x0e07('0xd'),auth['isAuthenticated'](),controller[_0x0e07('0xe')]);router['post']('/',auth[_0x0e07('0x8')](),controller[_0x0e07('0xf')]);router[_0x0e07('0x10')](_0x0e07('0xd'),auth[_0x0e07('0x8')](),controller[_0x0e07('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x9ee9=['show','create','put','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x48e413,_0x141611){var _0x13eb86=function(_0x5a85a9){while(--_0x5a85a9){_0x48e413['push'](_0x48e413['shift']());}};_0x13eb86(++_0x141611);}(_0x9ee9,0x144));var _0x99ee=function(_0x99e044,_0x69b4ca){_0x99e044=_0x99e044-0x0;var _0x5e1557=_0x9ee9[_0x99e044];return _0x5e1557;};'use strict';var multer=require(_0x99ee('0x0'));var util=require('util');var path=require(_0x99ee('0x1'));var timeout=require('connect-timeout');var express=require(_0x99ee('0x2'));var router=express['Router']();var auth=require(_0x99ee('0x3'));var interaction=require(_0x99ee('0x4'));var config=require(_0x99ee('0x5'));var controller=require(_0x99ee('0x6'));router[_0x99ee('0x7')]('/',auth[_0x99ee('0x8')](),controller['index']);router[_0x99ee('0x7')](_0x99ee('0x9'),auth[_0x99ee('0x8')](),controller[_0x99ee('0xa')]);router[_0x99ee('0x7')](_0x99ee('0xb'),auth[_0x99ee('0x8')](),controller[_0x99ee('0xc')]);router['post']('/',auth[_0x99ee('0x8')](),controller[_0x99ee('0xd')]);router[_0x99ee('0xe')]('/:id',auth[_0x99ee('0x8')](),controller['update']);module[_0x99ee('0xf')]=router;
\ No newline at end of file
index b30e5b7..45e1f99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6210=['STRING','sequelize','exports','name'];(function(_0x2b6bd2,_0x1e5f2f){var _0x568d49=function(_0x4b844b){while(--_0x4b844b){_0x2b6bd2['push'](_0x2b6bd2['shift']());}};_0x568d49(++_0x1e5f2f);}(_0x6210,0xc1));var _0x0621=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x6210[_0xda464c];return _0x19e222;};'use strict';var Sequelize=require(_0x0621('0x0'));module[_0x0621('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0621('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0621('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2715=['STRING','name','sequelize','exports'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0x2715,0x152));var _0x5271=function(_0x516cbd,_0x36dcb5){_0x516cbd=_0x516cbd-0x0;var _0x1498c6=_0x2715[_0x516cbd];return _0x1498c6;};'use strict';var Sequelize=require(_0x5271('0x0'));module[_0x5271('0x1')]={'name':{'type':Sequelize[_0x5271('0x2')],'unique':_0x5271('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5271('0x2')]},'dialPrefix':{'type':Sequelize[_0x5271('0x2')]}};
\ No newline at end of file
index 5ed9105..d39f583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1efa=['../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','get','Lists','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','show','length','find','catch','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','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','each','omit','ids','success','push','dataValues','errors','message','CmCustomField','CustomFields','cf_%d','nolimit','raw','getContacts','concat','format','now','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','User','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x1efa,0x1aa));var _0xa1ef=function(_0x2bd7ef,_0x279212){_0x2bd7ef=_0x2bd7ef-0x0;var _0x42e78a=_0x1efa[_0x2bd7ef];return _0x42e78a;};'use strict';var pdf=require(_0xa1ef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa1ef('0x1'));var zipdir=require(_0xa1ef('0x2'));var jsonpatch=require(_0xa1ef('0x3'));var rp=require(_0xa1ef('0x4'));var moment=require(_0xa1ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa1ef('0x6'));var util=require(_0xa1ef('0x7'));var path=require(_0xa1ef('0x8'));var sox=require('sox');var csv=require(_0xa1ef('0x9'));var ejs=require(_0xa1ef('0xa'));var fs=require('fs');var _=require(_0xa1ef('0xb'));var squel=require(_0xa1ef('0xc'));var crypto=require(_0xa1ef('0xd'));var jsforce=require(_0xa1ef('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa1ef('0x9'));var querystring=require(_0xa1ef('0xf'));var Papa=require('papaparse');var Redis=require(_0xa1ef('0x10'));var authService=require(_0xa1ef('0x11'));var qs=require(_0xa1ef('0x12'));var as=require(_0xa1ef('0x13'));var hardwareService=require(_0xa1ef('0x14'));var logger=require(_0xa1ef('0x15'))(_0xa1ef('0x16'));var utils=require(_0xa1ef('0x17'));var config=require(_0xa1ef('0x18'));var db=require(_0xa1ef('0x19'))['db'];config['redis']=_[_0xa1ef('0x1a')](config[_0xa1ef('0x1b')],{'host':_0xa1ef('0x1c'),'port':0x18eb});var socket=require(_0xa1ef('0x1d'))(new Redis(config['redis']));require('./cmList.socket')[_0xa1ef('0x1e')](socket);function respondWithStatusCode(_0x395a62,_0x2cf9af){_0x2cf9af=_0x2cf9af||0xcc;return function(_0x4a82ae){if(_0x4a82ae){return _0x395a62['sendStatus'](_0x2cf9af);}return _0x395a62[_0xa1ef('0x1f')](_0x2cf9af)[_0xa1ef('0x20')]();};}function respondWithResult(_0x39cd02,_0x1693da){_0x1693da=_0x1693da||0xc8;return function(_0xc5f018){if(_0xc5f018){return _0x39cd02[_0xa1ef('0x1f')](_0x1693da)[_0xa1ef('0x21')](_0xc5f018);}};}function respondWithFilteredResult(_0x3be46c,_0x12dd87){return function(_0x419256){if(_0x419256){var _0x39481a=_0x419256[_0xa1ef('0x22')],_0x5a68a8=_0x12dd87[_0xa1ef('0x23')],_0x341e6e=_0x12dd87[_0xa1ef('0x23')]+_0x12dd87[_0xa1ef('0x24')],_0x1dc5ee;if(_0x341e6e>=_0x39481a){_0x341e6e=_0x39481a;_0x1dc5ee=0xc8;}else{_0x1dc5ee=0xce;}_0x3be46c[_0xa1ef('0x1f')](_0x1dc5ee);return _0x3be46c[_0xa1ef('0x25')](_0xa1ef('0x26'),_0x5a68a8+'-'+_0x341e6e+'/'+_0x39481a)[_0xa1ef('0x21')](_0x419256);}return null;};}function patchUpdates(_0x290bf6){return function(_0x5d266a){try{jsonpatch[_0xa1ef('0x27')](_0x5d266a,_0x290bf6,!![]);}catch(_0x4b2a70){return BPromise['reject'](_0x4b2a70);}return _0x5d266a[_0xa1ef('0x28')]();};}function saveUpdates(_0xdfe70,_0x151f8b){return function(_0x50a2e4){if(_0x50a2e4){return _0x50a2e4['update'](_0xdfe70)['then'](function(_0x476948){return _0x476948;});}return null;};}function removeEntity(_0x3c6f4f,_0x28fa59){return function(_0x21808e){if(_0x21808e){return _0x21808e[_0xa1ef('0x29')]()[_0xa1ef('0x2a')](function(){var _0xeee756=_0x21808e[_0xa1ef('0x2b')]({'plain':!![]});var _0x2f858d=_0xa1ef('0x2c');return db['UserProfileResource'][_0xa1ef('0x29')]({'where':{'type':_0x2f858d,'resourceId':_0xeee756['id']}})[_0xa1ef('0x2a')](function(){return _0x21808e;});})[_0xa1ef('0x2a')](function(){_0x3c6f4f['status'](0xcc)[_0xa1ef('0x20')]();});}};}function handleEntityNotFound(_0x12ca4b,_0x539852){return function(_0x157c05){if(!_0x157c05){_0x12ca4b['sendStatus'](0x194);}return _0x157c05;};}function handleError(_0x95b8ae,_0x1fa6a2){_0x1fa6a2=_0x1fa6a2||0x1f4;return function(_0x6e8dc0){logger[_0xa1ef('0x2d')](_0x6e8dc0[_0xa1ef('0x2e')]);if(_0x6e8dc0['name']){delete _0x6e8dc0[_0xa1ef('0x2f')];}_0x95b8ae[_0xa1ef('0x1f')](_0x1fa6a2)[_0xa1ef('0x30')](_0x6e8dc0);};}exports[_0xa1ef('0x31')]=function(_0x4385a7,_0x3e9a58){var _0x5dd746={},_0x198bd9={},_0x2094cf={'count':0x0,'rows':[]};var _0x3b3702=_[_0xa1ef('0x32')](db[_0xa1ef('0x33')][_0xa1ef('0x34')],function(_0x55ead8){return{'name':_0x55ead8[_0xa1ef('0x35')],'type':_0x55ead8[_0xa1ef('0x36')][_0xa1ef('0x37')]};});_0x198bd9[_0xa1ef('0x38')]=_['map'](_0x3b3702,'name');_0x198bd9[_0xa1ef('0x39')]=_[_0xa1ef('0x3a')](_0x4385a7[_0xa1ef('0x39')]);_0x198bd9[_0xa1ef('0x3b')]=_['intersection'](_0x198bd9['model'],_0x198bd9[_0xa1ef('0x39')]);_0x5dd746[_0xa1ef('0x3c')]=_[_0xa1ef('0x3d')](_0x198bd9[_0xa1ef('0x38')],qs[_0xa1ef('0x3e')](_0x4385a7['query'][_0xa1ef('0x3e')]));_0x5dd746[_0xa1ef('0x3c')]=_0x5dd746[_0xa1ef('0x3c')]['length']?_0x5dd746[_0xa1ef('0x3c')]:_0x198bd9[_0xa1ef('0x38')];if(!_0x4385a7[_0xa1ef('0x39')][_0xa1ef('0x3f')]('nolimit')){_0x5dd746[_0xa1ef('0x24')]=qs[_0xa1ef('0x24')](_0x4385a7[_0xa1ef('0x39')][_0xa1ef('0x24')]);_0x5dd746[_0xa1ef('0x23')]=qs[_0xa1ef('0x23')](_0x4385a7[_0xa1ef('0x39')]['offset']);}_0x5dd746[_0xa1ef('0x40')]=qs[_0xa1ef('0x41')](_0x4385a7[_0xa1ef('0x39')]['sort']);_0x5dd746['where']=qs[_0xa1ef('0x3b')](_[_0xa1ef('0x42')](_0x4385a7[_0xa1ef('0x39')],_0x198bd9['filters']),_0x3b3702);if(_0x4385a7[_0xa1ef('0x39')]['filter']){_0x5dd746[_0xa1ef('0x43')]=_['merge'](_0x5dd746[_0xa1ef('0x43')],{'$or':_[_0xa1ef('0x32')](_0x3b3702,function(_0x20e27d){if(_0x20e27d[_0xa1ef('0x36')]!==_0xa1ef('0x44')){var _0x458901={};_0x458901[_0x20e27d['name']]={'$like':'%'+_0x4385a7[_0xa1ef('0x39')][_0xa1ef('0x45')]+'%'};return _0x458901;}})});}_0x5dd746=_[_0xa1ef('0x46')]({},_0x5dd746,_0x4385a7[_0xa1ef('0x47')]);var _0x515d4a={'where':_0x5dd746['where']};return db[_0xa1ef('0x33')][_0xa1ef('0x22')](_0x515d4a)['then'](function(_0x40164f){_0x2094cf[_0xa1ef('0x22')]=_0x40164f;if(_0x4385a7['query'][_0xa1ef('0x48')]){_0x5dd746[_0xa1ef('0x49')]=[{'all':!![]}];}return db[_0xa1ef('0x33')]['findAll'](_0x5dd746);})[_0xa1ef('0x2a')](function(_0x3f9bfc){_0x2094cf['rows']=_0x3f9bfc;return _0x2094cf;})[_0xa1ef('0x2a')](respondWithFilteredResult(_0x3e9a58,_0x5dd746))['catch'](handleError(_0x3e9a58,null));};exports[_0xa1ef('0x4a')]=function(_0x202a85,_0x51be77){var _0x438624={'raw':![],'where':{'id':_0x202a85['params']['id']}},_0x26bc5e={};_0x26bc5e[_0xa1ef('0x38')]=_[_0xa1ef('0x3a')](db[_0xa1ef('0x33')][_0xa1ef('0x34')]);_0x26bc5e[_0xa1ef('0x39')]=_['keys'](_0x202a85['query']);_0x26bc5e[_0xa1ef('0x3b')]=_['intersection'](_0x26bc5e[_0xa1ef('0x38')],_0x26bc5e['query']);_0x438624[_0xa1ef('0x3c')]=_[_0xa1ef('0x3d')](_0x26bc5e['model'],qs[_0xa1ef('0x3e')](_0x202a85['query'][_0xa1ef('0x3e')]));_0x438624['attributes']=_0x438624['attributes'][_0xa1ef('0x4b')]?_0x438624[_0xa1ef('0x3c')]:_0x26bc5e['model'];if(_0x202a85[_0xa1ef('0x39')][_0xa1ef('0x48')]){_0x438624[_0xa1ef('0x49')]=[{'all':!![]}];}_0x438624=_[_0xa1ef('0x46')]({},_0x438624,_0x202a85[_0xa1ef('0x47')]);return db['CmList'][_0xa1ef('0x4c')](_0x438624)[_0xa1ef('0x2a')](handleEntityNotFound(_0x51be77,null))[_0xa1ef('0x2a')](respondWithResult(_0x51be77,null))[_0xa1ef('0x4d')](handleError(_0x51be77,null));};exports['create']=function(_0x1da61c,_0x1f3980){return db[_0xa1ef('0x33')][_0xa1ef('0x4e')](_0x1da61c[_0xa1ef('0x4f')],{})[_0xa1ef('0x2a')](function(_0x8e51ed){var _0x3bfb6a=_0x1da61c[_0xa1ef('0x50')][_0xa1ef('0x2b')]({'plain':!![]});if(!_0x3bfb6a)throw new Error(_0xa1ef('0x51'));if(_0x3bfb6a[_0xa1ef('0x52')]==='user'){var _0x2bc7fd=_0x8e51ed[_0xa1ef('0x2b')]({'plain':!![]});var _0x4f5efd=_0xa1ef('0x2c');return db[_0xa1ef('0x53')][_0xa1ef('0x4c')]({'where':{'name':_0x4f5efd,'userProfileId':_0x3bfb6a[_0xa1ef('0x54')]},'raw':!![]})['then'](function(_0x76e9e3){if(_0x76e9e3&&_0x76e9e3[_0xa1ef('0x55')]===0x0){return db['UserProfileResource'][_0xa1ef('0x4e')]({'name':_0x2bc7fd[_0xa1ef('0x2f')],'resourceId':_0x2bc7fd['id'],'type':_0x76e9e3[_0xa1ef('0x2f')],'sectionId':_0x76e9e3['id']},{})[_0xa1ef('0x2a')](function(){return _0x8e51ed;});}else{return _0x8e51ed;}})[_0xa1ef('0x4d')](function(_0x14c1d1){logger[_0xa1ef('0x2d')](_0xa1ef('0x56'),_0x14c1d1);throw _0x14c1d1;});}return _0x8e51ed;})['then'](respondWithResult(_0x1f3980,0xc9))[_0xa1ef('0x4d')](handleError(_0x1f3980,null));};exports[_0xa1ef('0x57')]=function(_0x22f6ad,_0x4812b4){if(_0x22f6ad[_0xa1ef('0x4f')]['id']){delete _0x22f6ad[_0xa1ef('0x4f')]['id'];}return db['CmList'][_0xa1ef('0x4c')]({'where':{'id':_0x22f6ad[_0xa1ef('0x58')]['id']}})['then'](handleEntityNotFound(_0x4812b4,null))[_0xa1ef('0x2a')](saveUpdates(_0x22f6ad[_0xa1ef('0x4f')],null))[_0xa1ef('0x2a')](respondWithResult(_0x4812b4,null))[_0xa1ef('0x4d')](handleError(_0x4812b4,null));};exports[_0xa1ef('0x29')]=function(_0x5bd51b,_0x1d350d){return db['CmList'][_0xa1ef('0x4c')]({'where':{'id':_0x5bd51b[_0xa1ef('0x58')]['id']}})[_0xa1ef('0x2a')](handleEntityNotFound(_0x1d350d,null))[_0xa1ef('0x2a')](removeEntity(_0x1d350d,null))[_0xa1ef('0x4d')](handleError(_0x1d350d,null));};exports[_0xa1ef('0x59')]=function(_0x5088f9,_0x145817){return db[_0xa1ef('0x33')][_0xa1ef('0x59')]()[_0xa1ef('0x2a')](respondWithResult(_0x145817,null))[_0xa1ef('0x4d')](handleError(_0x145817,null));};exports[_0xa1ef('0x5a')]=function(_0x434ffa,_0x29f588,_0x13df48){if(_0x434ffa[_0xa1ef('0x4f')]['id']){delete _0x434ffa[_0xa1ef('0x4f')]['id'];}return db[_0xa1ef('0x33')][_0xa1ef('0x4c')]({'where':{'id':_0x434ffa[_0xa1ef('0x58')]['id']}})[_0xa1ef('0x2a')](handleEntityNotFound(_0x29f588,null))[_0xa1ef('0x2a')](function(_0x2c25e6){if(_0x2c25e6){_0x434ffa[_0xa1ef('0x4f')][_0xa1ef('0x5b')]=_0x2c25e6['id'];return db[_0xa1ef('0x5c')][_0xa1ef('0x4e')](_0x434ffa['body']);}})[_0xa1ef('0x2a')](respondWithResult(_0x29f588,null))['catch'](handleError(_0x29f588,null));};exports[_0xa1ef('0x5d')]=function(_0x1d8dfd,_0x31cbe7,_0x59fd67){var _0x514f00={'raw':![],'where':{}};var _0x23a073={};var _0x52ba80={'count':0x0,'rows':[]};return db[_0xa1ef('0x33')][_0xa1ef('0x5e')]({'where':{'id':_0x1d8dfd['params']['id']}})['then'](handleEntityNotFound(_0x31cbe7,null))[_0xa1ef('0x2a')](function(_0x45d717){if(_0x45d717){_0x23a073['model']=_[_0xa1ef('0x3a')](db[_0xa1ef('0x5c')]['rawAttributes']);_0x23a073[_0xa1ef('0x39')]=_[_0xa1ef('0x3a')](_0x1d8dfd['query']);_0x23a073[_0xa1ef('0x3b')]=_[_0xa1ef('0x3d')](_0x23a073[_0xa1ef('0x38')],_0x23a073[_0xa1ef('0x39')]);_0x514f00[_0xa1ef('0x3c')]=_[_0xa1ef('0x3d')](_0x23a073[_0xa1ef('0x38')],qs['fields'](_0x1d8dfd[_0xa1ef('0x39')][_0xa1ef('0x3e')]));_0x514f00[_0xa1ef('0x3c')]=_0x514f00[_0xa1ef('0x3c')]['length']?_0x514f00[_0xa1ef('0x3c')]:_0x23a073[_0xa1ef('0x38')];if(!_0x1d8dfd[_0xa1ef('0x39')][_0xa1ef('0x3f')]('nolimit')){_0x514f00[_0xa1ef('0x24')]=qs[_0xa1ef('0x24')](_0x1d8dfd['query'][_0xa1ef('0x24')]);_0x514f00['offset']=qs['offset'](_0x1d8dfd[_0xa1ef('0x39')][_0xa1ef('0x23')]);}_0x514f00[_0xa1ef('0x40')]=qs[_0xa1ef('0x41')](_0x1d8dfd[_0xa1ef('0x39')][_0xa1ef('0x41')]);_0x514f00[_0xa1ef('0x43')]=qs[_0xa1ef('0x3b')](_['pick'](_0x1d8dfd[_0xa1ef('0x39')],_0x23a073[_0xa1ef('0x3b')]));_0x514f00['where'][_0xa1ef('0x5b')]=_0x45d717['id'];if(_0x1d8dfd[_0xa1ef('0x39')][_0xa1ef('0x45')]){_0x514f00['where']=_[_0xa1ef('0x46')](_0x514f00[_0xa1ef('0x43')],{'$or':_[_0xa1ef('0x32')](_0x514f00[_0xa1ef('0x3c')],function(_0xdb28cc){var _0x510c62={};_0x510c62[_0xdb28cc]={'$like':'%'+_0x1d8dfd['query'][_0xa1ef('0x45')]+'%'};return _0x510c62;})});}_0x514f00=_[_0xa1ef('0x46')]({},_0x514f00,_0x1d8dfd[_0xa1ef('0x47')]);return db[_0xa1ef('0x5c')][_0xa1ef('0x22')]({'where':_0x514f00[_0xa1ef('0x43')]})[_0xa1ef('0x2a')](function(_0x2213f6){_0x52ba80['count']=_0x2213f6;if(_0x1d8dfd[_0xa1ef('0x39')][_0xa1ef('0x48')]){_0x514f00[_0xa1ef('0x49')]=[{'all':!![]}];}return db[_0xa1ef('0x5c')][_0xa1ef('0x5f')](_0x514f00);})['then'](function(_0x5c3549){_0x52ba80[_0xa1ef('0x60')]=_0x5c3549;return _0x52ba80;});}})['then'](respondWithFilteredResult(_0x31cbe7,_0x514f00))[_0xa1ef('0x4d')](handleError(_0x31cbe7,null));};exports[_0xa1ef('0x61')]=function(_0x1387bb,_0x4b5181,_0x16b19d){return db[_0xa1ef('0x33')][_0xa1ef('0x4c')]({'where':{'id':_0x1387bb['params']['id']}})[_0xa1ef('0x2a')](handleEntityNotFound(_0x4b5181,null))['then'](function(_0x1f8060){if(_0x1f8060){return _0x1f8060[_0xa1ef('0x61')](_0x1387bb[_0xa1ef('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x4b5181,null))[_0xa1ef('0x4d')](handleError(_0x4b5181,null));};exports[_0xa1ef('0x62')]=function(_0x30179f,_0x4a289b,_0xd6a78e){return db[_0xa1ef('0x33')][_0xa1ef('0x4c')]({'where':{'id':_0x30179f[_0xa1ef('0x58')]['id']}})[_0xa1ef('0x2a')](handleEntityNotFound(_0x4a289b,null))['then'](function(_0x397d08){if(_0x397d08){var _0x5ab479=[];var _0x53e1ae={'success':[],'errors':[]};return db[_0xa1ef('0x63')][_0xa1ef('0x59')]()[_0xa1ef('0x2a')](function(_0x278161){if(_0x30179f[_0xa1ef('0x4f')][_0xa1ef('0x64')]&&_[_0xa1ef('0x65')](_0x30179f['body'][_0xa1ef('0x64')])){if(_0x30179f[_0xa1ef('0x4f')][_0xa1ef('0x64')][_0xa1ef('0x4b')]){_0x30179f[_0xa1ef('0x4f')][_0xa1ef('0x64')]=_0x30179f[_0xa1ef('0x4f')][_0xa1ef('0x64')][_0xa1ef('0x66')](';')+';';}else{_0x30179f[_0xa1ef('0x4f')][_0xa1ef('0x64')]=null;}}else{_0x30179f['body'][_0xa1ef('0x64')]=null;}if(_0x30179f[_0xa1ef('0x4f')]&&_[_0xa1ef('0x65')](_0x30179f[_0xa1ef('0x4f')])){for(var _0x17ac36=0x0;_0x17ac36<_0x30179f[_0xa1ef('0x4f')][_0xa1ef('0x4b')];_0x17ac36+=0x1){_0x30179f[_0xa1ef('0x4f')][_0x17ac36]['ListId']=_0x30179f[_0xa1ef('0x58')]['id'];_0x5ab479['push'](_0x30179f['body'][_0x17ac36]);}return BPromise[_0xa1ef('0x67')](_0x5ab479,function(_0x44aa3e){return db[_0xa1ef('0x63')][_0xa1ef('0x4e')](_[_0xa1ef('0x68')](_0x44aa3e,[_0xa1ef('0x69'),'id'])||{},{'fields':_[_0xa1ef('0x3a')](_0x278161),'raw':!![]})['then'](function(_0x3585d2){_0x53e1ae[_0xa1ef('0x6a')][_0xa1ef('0x6b')](_0x3585d2[_0xa1ef('0x6c')]);})[_0xa1ef('0x4d')](function(_0x3e98aa){_0x53e1ae[_0xa1ef('0x6d')][_0xa1ef('0x6b')]({'data':_0x44aa3e,'error':_0x3e98aa[_0xa1ef('0x6e')]});});})[_0xa1ef('0x2a')](function(_0x1c5651){return _0x53e1ae;})[_0xa1ef('0x4d')](function(_0x5e5309){return _0x5e5309;});}else{_0x4a289b['status'](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0xa1ef('0x2a')](respondWithResult(_0x4a289b,null))['catch'](handleError(_0x4a289b,null));};exports['getContacts']=function(_0x45397c,_0x328428,_0x5c8f53){var _0x5d5241;return db[_0xa1ef('0x33')][_0xa1ef('0x4c')]({'where':{'id':_0x45397c[_0xa1ef('0x58')]['id']},'include':[{'model':db[_0xa1ef('0x6f')],'as':_0xa1ef('0x70')}]})['then'](handleEntityNotFound(_0x328428,null))[_0xa1ef('0x2a')](function(_0x1c3815){if(_0x1c3815){_0x5d5241=_0x1c3815;return db[_0xa1ef('0x63')][_0xa1ef('0x34')];}})['then'](function(_0x13c205){if(_0x13c205){var _0x3f3447={};var _0x3d3106={};_0x3d3106[_0xa1ef('0x38')]=_['concat'](_[_0xa1ef('0x3a')](_0x13c205),_['map'](_0x5d5241['CustomFields'],function(_0x2d9c31){return util['format'](_0xa1ef('0x71'),_0x2d9c31['id']);}));_0x3d3106[_0xa1ef('0x39')]=_['keys'](_0x45397c[_0xa1ef('0x39')]);_0x3d3106[_0xa1ef('0x3b')]=_[_0xa1ef('0x3d')](_0x3d3106['model'],_0x3d3106[_0xa1ef('0x39')]);_0x3f3447['attributes']=_['intersection'](_0x3d3106[_0xa1ef('0x38')],qs['fields'](_0x45397c[_0xa1ef('0x39')][_0xa1ef('0x3e')]));_0x3f3447[_0xa1ef('0x3c')]=_0x3f3447[_0xa1ef('0x3c')][_0xa1ef('0x4b')]?_0x3f3447[_0xa1ef('0x3c')]:_0x3d3106[_0xa1ef('0x38')];if(!_0x45397c[_0xa1ef('0x39')][_0xa1ef('0x3f')](_0xa1ef('0x72'))){_0x3f3447[_0xa1ef('0x24')]=qs[_0xa1ef('0x24')](_0x45397c['query']['limit']);_0x3f3447[_0xa1ef('0x23')]=qs[_0xa1ef('0x23')](_0x45397c['query'][_0xa1ef('0x23')]);}_0x3f3447[_0xa1ef('0x40')]=qs[_0xa1ef('0x41')](_0x45397c[_0xa1ef('0x39')][_0xa1ef('0x41')]);_0x3f3447[_0xa1ef('0x43')]=qs[_0xa1ef('0x3b')](_[_0xa1ef('0x42')](_0x45397c[_0xa1ef('0x39')],_0x3d3106[_0xa1ef('0x3b')]));_0x3f3447[_0xa1ef('0x73')]=!![];if(_0x45397c[_0xa1ef('0x39')][_0xa1ef('0x45')]){_0x3f3447[_0xa1ef('0x43')]=_[_0xa1ef('0x46')](_0x3f3447[_0xa1ef('0x43')],{'$or':_[_0xa1ef('0x32')](_0x3f3447[_0xa1ef('0x3c')],function(_0x4aad78){var _0x2833e9={};_0x2833e9[_0x4aad78]={'$like':'%'+_0x45397c['query'][_0xa1ef('0x45')]+'%'};return _0x2833e9;})});}_0x3f3447=_[_0xa1ef('0x46')]({},_0x3f3447,_0x45397c[_0xa1ef('0x47')]);return _0x5d5241[_0xa1ef('0x74')](_0x3f3447);}})[_0xa1ef('0x2a')](respondWithResult(_0x328428,null))['catch'](handleError(_0x328428,null));};exports['getContactsCsv']=function(_0x444deb,_0x4b75c3,_0x173f54){var _0x5a31a0;return db[_0xa1ef('0x33')]['find']({'where':{'id':_0x444deb[_0xa1ef('0x58')]['id']},'include':[{'model':db[_0xa1ef('0x6f')],'as':_0xa1ef('0x70')}]})[_0xa1ef('0x2a')](handleEntityNotFound(_0x4b75c3,null))[_0xa1ef('0x2a')](function(_0x4a8ffe){if(_0x4a8ffe){_0x5a31a0=_0x4a8ffe;return db['CmContact'][_0xa1ef('0x34')];}})[_0xa1ef('0x2a')](function(_0x67ce78){if(_0x67ce78){var _0x2ef8e9={};var _0x1f5ec7={};_0x1f5ec7[_0xa1ef('0x38')]=_[_0xa1ef('0x75')](_[_0xa1ef('0x3a')](_0x67ce78),_[_0xa1ef('0x32')](_0x5a31a0[_0xa1ef('0x70')],function(_0xfd2ea2){return util[_0xa1ef('0x76')](_0xa1ef('0x71'),_0xfd2ea2['id']);}));_0x1f5ec7['query']=_[_0xa1ef('0x3a')](_0x444deb[_0xa1ef('0x39')]);_0x1f5ec7[_0xa1ef('0x3b')]=_['intersection'](_0x1f5ec7['model'],_0x1f5ec7[_0xa1ef('0x39')]);_0x2ef8e9['attributes']=_['intersection'](_0x1f5ec7['model'],qs['fields'](_0x444deb[_0xa1ef('0x39')][_0xa1ef('0x3e')]));_0x2ef8e9[_0xa1ef('0x3c')]=_0x2ef8e9[_0xa1ef('0x3c')]['length']?_0x2ef8e9[_0xa1ef('0x3c')]:_0x1f5ec7['model'];if(!_0x444deb[_0xa1ef('0x39')]['hasOwnProperty'](_0xa1ef('0x72'))){_0x2ef8e9['limit']=qs[_0xa1ef('0x24')](_0x444deb[_0xa1ef('0x39')]['limit']);_0x2ef8e9[_0xa1ef('0x23')]=qs[_0xa1ef('0x23')](_0x444deb['query'][_0xa1ef('0x23')]);}_0x2ef8e9[_0xa1ef('0x40')]=qs[_0xa1ef('0x41')](_0x444deb[_0xa1ef('0x39')]['sort']);_0x2ef8e9[_0xa1ef('0x43')]=qs['filters'](_[_0xa1ef('0x42')](_0x444deb['query'],_0x1f5ec7[_0xa1ef('0x3b')]));_0x2ef8e9[_0xa1ef('0x73')]=!![];if(_0x444deb[_0xa1ef('0x39')][_0xa1ef('0x45')]){_0x2ef8e9[_0xa1ef('0x43')]=_[_0xa1ef('0x46')](_0x2ef8e9['where'],{'$or':_[_0xa1ef('0x32')](_0x2ef8e9[_0xa1ef('0x3c')],function(_0x4289a6){var _0x5dc231={};_0x5dc231[_0x4289a6]={'$like':'%'+_0x444deb[_0xa1ef('0x39')]['filter']+'%'};return _0x5dc231;})});}_0x2ef8e9=_['merge']({},_0x2ef8e9,_0x444deb[_0xa1ef('0x47')]);return _0x5a31a0[_0xa1ef('0x74')](_0x2ef8e9);}})[_0xa1ef('0x2a')](function(_0xc897){if(!_['isEmpty'](_0xc897)){var _0x5437b7=toCsv(_0xc897);var _0x82706e=Date[_0xa1ef('0x77')]();fs[_0xa1ef('0x78')](util['format'](_0xa1ef('0x79'),_0x5a31a0['id'],_0x82706e),_0x5437b7);_0x4b75c3['setHeader']('Content-disposition',_0xa1ef('0x7a')+util['format'](_0xa1ef('0x7b'),_0x5a31a0['id'],_0x82706e));_0x4b75c3[_0xa1ef('0x7c')](_0xa1ef('0x7d'),_0xa1ef('0x7e'));return _0x4b75c3[_0xa1ef('0x7f')](util['format']('/tmp/list_%d_%s.csv',_0x5a31a0['id'],_0x82706e));}else{return _0x4b75c3[_0xa1ef('0x80')](0xcc);}})[_0xa1ef('0x4d')](handleError(_0x4b75c3,null));};exports[_0xa1ef('0x81')]=function(_0x86945f,_0x7d3fee,_0x28d442){var _0x1f3793;delete _0x86945f[_0xa1ef('0x4f')]['id'];return db[_0xa1ef('0x33')][_0xa1ef('0x5e')]({'where':{'id':_0x86945f[_0xa1ef('0x58')]['id']}})['then'](handleEntityNotFound(_0x7d3fee,null))[_0xa1ef('0x2a')](function(_0x58e289){if(_0x58e289){return db[_0xa1ef('0x82')]['transaction'](function(_0x52450b){return db[_0xa1ef('0x6f')]['create'](_0x86945f[_0xa1ef('0x4f')],{'transaction':_0x52450b})['then'](function(_0x9ed5ed){_0x1f3793=_0x9ed5ed;return _0x58e289[_0xa1ef('0x83')](_0x9ed5ed,{'transaction':_0x52450b});})['then'](function(){var _0x1ccb40={'type':db['Sequelize'][_0xa1ef('0x84')],'transaction':_0x52450b};switch(_0x86945f[_0xa1ef('0x4f')][_0xa1ef('0x36')]){case _0xa1ef('0x85'):_0x1ccb40[_0xa1ef('0x36')]=db[_0xa1ef('0x86')][_0xa1ef('0x84')];break;case'number':_0x1ccb40[_0xa1ef('0x36')]=db['Sequelize'][_0xa1ef('0x87')];break;case _0xa1ef('0x88'):_0x1ccb40['type']=db[_0xa1ef('0x86')][_0xa1ef('0x89')];_0x1ccb40[_0xa1ef('0x8a')]=![];break;default:}return db['sequelize'][_0xa1ef('0x8b')]['addColumn'](_0xa1ef('0x8c'),util['format'](_0xa1ef('0x8d'),_0x1f3793['id']),_0x1ccb40);})[_0xa1ef('0x2a')](function(){return _0x1f3793;});});}})[_0xa1ef('0x2a')](respondWithResult(_0x7d3fee,null))['catch'](handleError(_0x7d3fee,null));};exports[_0xa1ef('0x8e')]=function(_0xd0c030,_0x3a6f59,_0x2b3a29){var _0x55d8b5={};var _0x226fee={};var _0x54f03b;var _0x423cc2;return db['CmList'][_0xa1ef('0x5e')]({'where':{'id':_0xd0c030[_0xa1ef('0x58')]['id']}})[_0xa1ef('0x2a')](handleEntityNotFound(_0x3a6f59,null))[_0xa1ef('0x2a')](function(_0x525253){if(_0x525253){_0x54f03b=_0x525253;_0x226fee[_0xa1ef('0x38')]=_[_0xa1ef('0x3a')](db[_0xa1ef('0x6f')][_0xa1ef('0x34')]);_0x226fee['query']=_[_0xa1ef('0x3a')](_0xd0c030[_0xa1ef('0x39')]);_0x226fee['filters']=_[_0xa1ef('0x3d')](_0x226fee['model'],_0x226fee[_0xa1ef('0x39')]);_0x55d8b5[_0xa1ef('0x3c')]=_[_0xa1ef('0x3d')](_0x226fee['model'],qs['fields'](_0xd0c030[_0xa1ef('0x39')][_0xa1ef('0x3e')]));_0x55d8b5[_0xa1ef('0x3c')]=_0x55d8b5[_0xa1ef('0x3c')]['length']?_0x55d8b5[_0xa1ef('0x3c')]:_0x226fee[_0xa1ef('0x38')];_0x55d8b5[_0xa1ef('0x40')]=qs[_0xa1ef('0x41')](_0xd0c030[_0xa1ef('0x39')]['sort']);_0x55d8b5[_0xa1ef('0x43')]=qs[_0xa1ef('0x3b')](_['pick'](_0xd0c030[_0xa1ef('0x39')],_0x226fee[_0xa1ef('0x3b')]));_0x55d8b5[_0xa1ef('0x43')]=_['merge'](_0x55d8b5[_0xa1ef('0x43')],{'$or':[{'ListId':_0x525253['id']},{'ListId':null}]});if(_0xd0c030['query'][_0xa1ef('0x45')]){_0x55d8b5[_0xa1ef('0x43')]=_['merge'](_0x55d8b5[_0xa1ef('0x43')],{'$or':_[_0xa1ef('0x32')](_0x55d8b5['attributes'],function(_0xbb5c3a){var _0x15e4b9={};_0x15e4b9[_0xbb5c3a]={'$like':'%'+_0xd0c030[_0xa1ef('0x39')][_0xa1ef('0x45')]+'%'};return _0x15e4b9;})});}_0x55d8b5=_[_0xa1ef('0x46')]({},_0x55d8b5,_0xd0c030[_0xa1ef('0x47')]);return db['CmCustomField']['findAndCountAll'](_0x55d8b5);}})[_0xa1ef('0x2a')](respondWithResult(_0x3a6f59,null))['catch'](handleError(_0x3a6f59,null));};exports[_0xa1ef('0x8f')]=function(_0x41b4cf,_0x38c648,_0x2a45ea){return db[_0xa1ef('0x33')][_0xa1ef('0x4c')]({'where':{'id':_0x41b4cf['params']['id']}})[_0xa1ef('0x2a')](handleEntityNotFound(_0x38c648,null))[_0xa1ef('0x2a')](function(_0x54d24a){if(_0x54d24a){return _0x54d24a[_0xa1ef('0x8f')](_0x41b4cf[_0xa1ef('0x4f')][_0xa1ef('0x69')],_['omit'](_0x41b4cf[_0xa1ef('0x4f')],[_0xa1ef('0x69'),'id'])||{})[_0xa1ef('0x90')](function(_0x2503bf){for(var _0x4f5c24=0x0;_0x4f5c24<_0x41b4cf['body'][_0xa1ef('0x69')]['length'];_0x4f5c24+=0x1){socket[_0xa1ef('0x91')]('userCmList:save',{'UserId':_0x41b4cf[_0xa1ef('0x4f')]['ids'][_0x4f5c24],'CmListId':_0x41b4cf[_0xa1ef('0x58')]['id']});}return _0x2503bf;});}})[_0xa1ef('0x2a')](respondWithResult(_0x38c648,null))[_0xa1ef('0x4d')](handleError(_0x38c648,null));};exports[_0xa1ef('0x92')]=function(_0x194c8a,_0xe0e86d,_0x42ff4a){return db[_0xa1ef('0x33')][_0xa1ef('0x4c')]({'where':{'id':_0x194c8a[_0xa1ef('0x58')]['id']}})[_0xa1ef('0x2a')](handleEntityNotFound(_0xe0e86d,null))[_0xa1ef('0x2a')](function(_0x551050){if(_0x551050){return _0x551050[_0xa1ef('0x92')](_0x194c8a[_0xa1ef('0x39')]['ids'])[_0xa1ef('0x2a')](function(){if(_[_0xa1ef('0x65')](_0x194c8a[_0xa1ef('0x39')][_0xa1ef('0x69')])){for(var _0xa56e5=0x0;_0xa56e5<_0x194c8a[_0xa1ef('0x39')][_0xa1ef('0x69')]['length'];_0xa56e5+=0x1){socket[_0xa1ef('0x91')]('userCmList:remove',{'UserId':Number(_0x194c8a['query'][_0xa1ef('0x69')][_0xa56e5]),'CmListId':Number(_0x194c8a[_0xa1ef('0x58')]['id'])});}}else{socket[_0xa1ef('0x91')](_0xa1ef('0x93'),{'UserId':Number(_0x194c8a[_0xa1ef('0x39')][_0xa1ef('0x69')]),'CmListId':Number(_0x194c8a[_0xa1ef('0x58')]['id'])});}});}})[_0xa1ef('0x2a')](respondWithStatusCode(_0xe0e86d,null))[_0xa1ef('0x4d')](handleError(_0xe0e86d,null));};exports['getAgents']=function(_0x26736b,_0x471808,_0x3e4c54){var _0x2b5437={};var _0x30c9e0={};var _0x2f2cae;var _0x1faa54;return db[_0xa1ef('0x33')][_0xa1ef('0x5e')]({'where':{'id':_0x26736b[_0xa1ef('0x58')]['id']}})[_0xa1ef('0x2a')](handleEntityNotFound(_0x471808,null))['then'](function(_0x5f5d74){if(_0x5f5d74){_0x2f2cae=_0x5f5d74;_0x30c9e0[_0xa1ef('0x38')]=_[_0xa1ef('0x3a')](db[_0xa1ef('0x94')][_0xa1ef('0x34')]);_0x30c9e0[_0xa1ef('0x39')]=_[_0xa1ef('0x3a')](_0x26736b[_0xa1ef('0x39')]);_0x30c9e0[_0xa1ef('0x3b')]=_[_0xa1ef('0x3d')](_0x30c9e0[_0xa1ef('0x38')],_0x30c9e0[_0xa1ef('0x39')]);_0x2b5437[_0xa1ef('0x3c')]=_[_0xa1ef('0x3d')](_0x30c9e0[_0xa1ef('0x38')],qs[_0xa1ef('0x3e')](_0x26736b['query'][_0xa1ef('0x3e')]));_0x2b5437['attributes']=_0x2b5437[_0xa1ef('0x3c')][_0xa1ef('0x4b')]?_0x2b5437[_0xa1ef('0x3c')]:_0x30c9e0[_0xa1ef('0x38')];_0x2b5437[_0xa1ef('0x40')]=qs[_0xa1ef('0x41')](_0x26736b['query'][_0xa1ef('0x41')]);_0x2b5437[_0xa1ef('0x43')]=qs[_0xa1ef('0x3b')](_['pick'](_0x26736b[_0xa1ef('0x39')],_0x30c9e0['filters']));if(_0x26736b['query']['filter']){_0x2b5437[_0xa1ef('0x43')]=_[_0xa1ef('0x46')](_0x2b5437[_0xa1ef('0x43')],{'$or':_[_0xa1ef('0x32')](_0x2b5437['attributes'],function(_0x25f488){var _0x2ed494={};_0x2ed494[_0x25f488]={'$like':'%'+_0x26736b['query'][_0xa1ef('0x45')]+'%'};return _0x2ed494;})});}_0x2b5437=_[_0xa1ef('0x46')]({},_0x2b5437,_0x26736b['options']);return _0x2f2cae[_0xa1ef('0x95')](_0x2b5437);}})[_0xa1ef('0x2a')](function(_0x52865e){if(_0x52865e){_0x1faa54=_0x52865e[_0xa1ef('0x4b')];if(!_0x26736b[_0xa1ef('0x39')]['hasOwnProperty'](_0xa1ef('0x72'))){_0x2b5437[_0xa1ef('0x24')]=qs[_0xa1ef('0x24')](_0x26736b[_0xa1ef('0x39')][_0xa1ef('0x24')]);_0x2b5437[_0xa1ef('0x23')]=qs[_0xa1ef('0x23')](_0x26736b['query'][_0xa1ef('0x23')]);}return _0x2f2cae['getAgents'](_0x2b5437);}})[_0xa1ef('0x2a')](function(_0x37c27e){if(_0x37c27e){return _0x37c27e?{'count':_0x1faa54,'rows':_0x37c27e}:null;}})['then'](respondWithResult(_0x471808,null))['catch'](handleError(_0x471808,null));};
\ No newline at end of file
+var _0xc17d=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','save','update','destroy','then','Lists','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','CmList','includeAll','findAll','rows','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','filter','removeDispositions','CmContact','tags','isArray','push','each','omit','ids','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CustomFields','rawAttributes','concat','format','raw','CmCustomField','isEmpty','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','text/csv','download','/tmp/list_%d_%s.csv','sequelize','addCustomFields','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash'];(function(_0x25e7de,_0x24b676){var _0x5cd6b8=function(_0x38526c){while(--_0x38526c){_0x25e7de['push'](_0x25e7de['shift']());}};_0x5cd6b8(++_0x24b676);}(_0xc17d,0x83));var _0xdc17=function(_0x5d39e9,_0x4c7216){_0x5d39e9=_0x5d39e9-0x0;var _0x3e6c81=_0xc17d[_0x5d39e9];return _0x3e6c81;};'use strict';var pdf=require(_0xdc17('0x0'));var emlformat=require(_0xdc17('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdc17('0x2'));var jsonpatch=require(_0xdc17('0x3'));var rp=require(_0xdc17('0x4'));var moment=require(_0xdc17('0x5'));var BPromise=require(_0xdc17('0x6'));var Mustache=require(_0xdc17('0x7'));var util=require('util');var path=require(_0xdc17('0x8'));var sox=require(_0xdc17('0x9'));var csv=require('to-csv');var ejs=require(_0xdc17('0xa'));var fs=require('fs');var _=require(_0xdc17('0xb'));var squel=require(_0xdc17('0xc'));var crypto=require(_0xdc17('0xd'));var jsforce=require(_0xdc17('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdc17('0xf'));var Papa=require(_0xdc17('0x10'));var Redis=require(_0xdc17('0x11'));var authService=require(_0xdc17('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdc17('0x13'));var hardwareService=require(_0xdc17('0x14'));var logger=require(_0xdc17('0x15'))('api');var utils=require(_0xdc17('0x16'));var config=require(_0xdc17('0x17'));var db=require(_0xdc17('0x18'))['db'];config[_0xdc17('0x19')]=_[_0xdc17('0x1a')](config[_0xdc17('0x19')],{'host':_0xdc17('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdc17('0x1c'))[_0xdc17('0x1d')](socket);function respondWithStatusCode(_0x156bd0,_0x534f32){_0x534f32=_0x534f32||0xcc;return function(_0xf0bef9){if(_0xf0bef9){return _0x156bd0[_0xdc17('0x1e')](_0x534f32);}return _0x156bd0['status'](_0x534f32)[_0xdc17('0x1f')]();};}function respondWithResult(_0x4edf23,_0x49e214){_0x49e214=_0x49e214||0xc8;return function(_0x1a1c93){if(_0x1a1c93){return _0x4edf23[_0xdc17('0x20')](_0x49e214)['json'](_0x1a1c93);}};}function respondWithFilteredResult(_0x58b9bb,_0x4bf5c0){return function(_0x28561e){if(_0x28561e){var _0xfd192d=_0x28561e[_0xdc17('0x21')],_0x81ed6b=_0x4bf5c0[_0xdc17('0x22')],_0x341609=_0x4bf5c0[_0xdc17('0x22')]+_0x4bf5c0[_0xdc17('0x23')],_0x182140;if(_0x341609>=_0xfd192d){_0x341609=_0xfd192d;_0x182140=0xc8;}else{_0x182140=0xce;}_0x58b9bb[_0xdc17('0x20')](_0x182140);return _0x58b9bb[_0xdc17('0x24')]('Content-Range',_0x81ed6b+'-'+_0x341609+'/'+_0xfd192d)[_0xdc17('0x25')](_0x28561e);}return null;};}function patchUpdates(_0x56c399){return function(_0x5dc4f6){try{jsonpatch[_0xdc17('0x26')](_0x5dc4f6,_0x56c399,!![]);}catch(_0x548fc7){return BPromise[_0xdc17('0x27')](_0x548fc7);}return _0x5dc4f6[_0xdc17('0x28')]();};}function saveUpdates(_0x253913,_0x490ddf){return function(_0x407cdd){if(_0x407cdd){return _0x407cdd[_0xdc17('0x29')](_0x253913)['then'](function(_0xef2663){return _0xef2663;});}return null;};}function removeEntity(_0x43f12d,_0x1a0474){return function(_0xc8594b){if(_0xc8594b){return _0xc8594b[_0xdc17('0x2a')]()[_0xdc17('0x2b')](function(){var _0x522895=_0xc8594b['get']({'plain':!![]});var _0x3a96bb=_0xdc17('0x2c');return db['UserProfileResource'][_0xdc17('0x2a')]({'where':{'type':_0x3a96bb,'resourceId':_0x522895['id']}})[_0xdc17('0x2b')](function(){return _0xc8594b;});})[_0xdc17('0x2b')](function(){_0x43f12d['status'](0xcc)[_0xdc17('0x1f')]();});}};}function handleEntityNotFound(_0x503d9c,_0x36a8b4){return function(_0x391108){if(!_0x391108){_0x503d9c['sendStatus'](0x194);}return _0x391108;};}function handleError(_0xf60cf5,_0x567af0){_0x567af0=_0x567af0||0x1f4;return function(_0x2a80b1){logger['error'](_0x2a80b1[_0xdc17('0x2d')]);if(_0x2a80b1[_0xdc17('0x2e')]){delete _0x2a80b1[_0xdc17('0x2e')];}_0xf60cf5['status'](_0x567af0)[_0xdc17('0x2f')](_0x2a80b1);};}exports[_0xdc17('0x30')]=function(_0x518065,_0x25f1f7){var _0x10b21a={},_0x1853f0={},_0x515825={'count':0x0,'rows':[]};var _0x2c1407=_[_0xdc17('0x31')](db['CmList']['rawAttributes'],function(_0x1a596c){return{'name':_0x1a596c[_0xdc17('0x32')],'type':_0x1a596c[_0xdc17('0x33')]['key']};});_0x1853f0['model']=_['map'](_0x2c1407,'name');_0x1853f0[_0xdc17('0x34')]=_[_0xdc17('0x35')](_0x518065[_0xdc17('0x34')]);_0x1853f0[_0xdc17('0x36')]=_[_0xdc17('0x37')](_0x1853f0[_0xdc17('0x38')],_0x1853f0[_0xdc17('0x34')]);_0x10b21a[_0xdc17('0x39')]=_[_0xdc17('0x37')](_0x1853f0['model'],qs[_0xdc17('0x3a')](_0x518065[_0xdc17('0x34')][_0xdc17('0x3a')]));_0x10b21a[_0xdc17('0x39')]=_0x10b21a['attributes'][_0xdc17('0x3b')]?_0x10b21a['attributes']:_0x1853f0[_0xdc17('0x38')];if(!_0x518065[_0xdc17('0x34')][_0xdc17('0x3c')](_0xdc17('0x3d'))){_0x10b21a[_0xdc17('0x23')]=qs[_0xdc17('0x23')](_0x518065[_0xdc17('0x34')][_0xdc17('0x23')]);_0x10b21a[_0xdc17('0x22')]=qs[_0xdc17('0x22')](_0x518065[_0xdc17('0x34')][_0xdc17('0x22')]);}_0x10b21a[_0xdc17('0x3e')]=qs[_0xdc17('0x3f')](_0x518065[_0xdc17('0x34')]['sort']);_0x10b21a[_0xdc17('0x40')]=qs[_0xdc17('0x36')](_[_0xdc17('0x41')](_0x518065[_0xdc17('0x34')],_0x1853f0[_0xdc17('0x36')]),_0x2c1407);if(_0x518065[_0xdc17('0x34')]['filter']){_0x10b21a[_0xdc17('0x40')]=_[_0xdc17('0x42')](_0x10b21a[_0xdc17('0x40')],{'$or':_[_0xdc17('0x31')](_0x2c1407,function(_0x23cc7d){if(_0x23cc7d[_0xdc17('0x33')]!==_0xdc17('0x43')){var _0x3b9a95={};_0x3b9a95[_0x23cc7d['name']]={'$like':'%'+_0x518065['query']['filter']+'%'};return _0x3b9a95;}})});}_0x10b21a=_[_0xdc17('0x42')]({},_0x10b21a,_0x518065[_0xdc17('0x44')]);var _0x315200={'where':_0x10b21a[_0xdc17('0x40')]};return db[_0xdc17('0x45')]['count'](_0x315200)[_0xdc17('0x2b')](function(_0x3dd67b){_0x515825['count']=_0x3dd67b;if(_0x518065['query'][_0xdc17('0x46')]){_0x10b21a['include']=[{'all':!![]}];}return db[_0xdc17('0x45')][_0xdc17('0x47')](_0x10b21a);})[_0xdc17('0x2b')](function(_0x5867cb){_0x515825[_0xdc17('0x48')]=_0x5867cb;return _0x515825;})[_0xdc17('0x2b')](respondWithFilteredResult(_0x25f1f7,_0x10b21a))['catch'](handleError(_0x25f1f7,null));};exports[_0xdc17('0x49')]=function(_0x1b1bc5,_0xa08c58){var _0x5714c7={'raw':![],'where':{'id':_0x1b1bc5[_0xdc17('0x4a')]['id']}},_0x1bf85f={};_0x1bf85f[_0xdc17('0x38')]=_[_0xdc17('0x35')](db[_0xdc17('0x45')]['rawAttributes']);_0x1bf85f['query']=_[_0xdc17('0x35')](_0x1b1bc5['query']);_0x1bf85f[_0xdc17('0x36')]=_[_0xdc17('0x37')](_0x1bf85f[_0xdc17('0x38')],_0x1bf85f[_0xdc17('0x34')]);_0x5714c7[_0xdc17('0x39')]=_[_0xdc17('0x37')](_0x1bf85f[_0xdc17('0x38')],qs['fields'](_0x1b1bc5[_0xdc17('0x34')]['fields']));_0x5714c7[_0xdc17('0x39')]=_0x5714c7[_0xdc17('0x39')]['length']?_0x5714c7[_0xdc17('0x39')]:_0x1bf85f[_0xdc17('0x38')];if(_0x1b1bc5['query'][_0xdc17('0x46')]){_0x5714c7[_0xdc17('0x4b')]=[{'all':!![]}];}_0x5714c7=_[_0xdc17('0x42')]({},_0x5714c7,_0x1b1bc5['options']);return db[_0xdc17('0x45')][_0xdc17('0x4c')](_0x5714c7)[_0xdc17('0x2b')](handleEntityNotFound(_0xa08c58,null))[_0xdc17('0x2b')](respondWithResult(_0xa08c58,null))['catch'](handleError(_0xa08c58,null));};exports[_0xdc17('0x4d')]=function(_0x5abd7d,_0x19468c){return db[_0xdc17('0x45')][_0xdc17('0x4d')](_0x5abd7d[_0xdc17('0x4e')],{})[_0xdc17('0x2b')](function(_0x2a09b4){var _0x458a47=_0x5abd7d[_0xdc17('0x4f')][_0xdc17('0x50')]({'plain':!![]});if(!_0x458a47)throw new Error(_0xdc17('0x51'));if(_0x458a47[_0xdc17('0x52')]==='user'){var _0x2ffcb8=_0x2a09b4['get']({'plain':!![]});var _0x53a2ba=_0xdc17('0x2c');return db[_0xdc17('0x53')][_0xdc17('0x4c')]({'where':{'name':_0x53a2ba,'userProfileId':_0x458a47[_0xdc17('0x54')]},'raw':!![]})[_0xdc17('0x2b')](function(_0x5cd7b6){if(_0x5cd7b6&&_0x5cd7b6[_0xdc17('0x55')]===0x0){return db[_0xdc17('0x56')][_0xdc17('0x4d')]({'name':_0x2ffcb8['name'],'resourceId':_0x2ffcb8['id'],'type':_0x5cd7b6[_0xdc17('0x2e')],'sectionId':_0x5cd7b6['id']},{})[_0xdc17('0x2b')](function(){return _0x2a09b4;});}else{return _0x2a09b4;}})[_0xdc17('0x57')](function(_0x297c82){logger[_0xdc17('0x58')](_0xdc17('0x59'),_0x297c82);throw _0x297c82;});}return _0x2a09b4;})[_0xdc17('0x2b')](respondWithResult(_0x19468c,0xc9))[_0xdc17('0x57')](handleError(_0x19468c,null));};exports[_0xdc17('0x29')]=function(_0xbb2ffe,_0x54dc9d){if(_0xbb2ffe[_0xdc17('0x4e')]['id']){delete _0xbb2ffe['body']['id'];}return db[_0xdc17('0x45')][_0xdc17('0x4c')]({'where':{'id':_0xbb2ffe['params']['id']}})[_0xdc17('0x2b')](handleEntityNotFound(_0x54dc9d,null))['then'](saveUpdates(_0xbb2ffe[_0xdc17('0x4e')],null))['then'](respondWithResult(_0x54dc9d,null))[_0xdc17('0x57')](handleError(_0x54dc9d,null));};exports['destroy']=function(_0x56ba96,_0x2ca421){return db[_0xdc17('0x45')][_0xdc17('0x4c')]({'where':{'id':_0x56ba96['params']['id']}})[_0xdc17('0x2b')](handleEntityNotFound(_0x2ca421,null))['then'](removeEntity(_0x2ca421,null))[_0xdc17('0x57')](handleError(_0x2ca421,null));};exports['describe']=function(_0x4d8ed1,_0x48b952){return db['CmList'][_0xdc17('0x5a')]()['then'](respondWithResult(_0x48b952,null))['catch'](handleError(_0x48b952,null));};exports[_0xdc17('0x5b')]=function(_0x7ac4f1,_0x2b4fa2,_0x18518a){if(_0x7ac4f1[_0xdc17('0x4e')]['id']){delete _0x7ac4f1['body']['id'];}return db[_0xdc17('0x45')][_0xdc17('0x4c')]({'where':{'id':_0x7ac4f1['params']['id']}})['then'](handleEntityNotFound(_0x2b4fa2,null))[_0xdc17('0x2b')](function(_0x21e7dc){if(_0x21e7dc){_0x7ac4f1[_0xdc17('0x4e')][_0xdc17('0x5c')]=_0x21e7dc['id'];return db[_0xdc17('0x5d')]['create'](_0x7ac4f1['body']);}})[_0xdc17('0x2b')](respondWithResult(_0x2b4fa2,null))[_0xdc17('0x57')](handleError(_0x2b4fa2,null));};exports[_0xdc17('0x5e')]=function(_0x2e3e4c,_0x3d25e9,_0x4cf64c){var _0x59ddc4={'raw':![],'where':{}};var _0x2e5049={};var _0x4202ee={'count':0x0,'rows':[]};return db['CmList'][_0xdc17('0x5f')]({'where':{'id':_0x2e3e4c[_0xdc17('0x4a')]['id']}})[_0xdc17('0x2b')](handleEntityNotFound(_0x3d25e9,null))['then'](function(_0x29406b){if(_0x29406b){_0x2e5049[_0xdc17('0x38')]=_[_0xdc17('0x35')](db['Disposition']['rawAttributes']);_0x2e5049[_0xdc17('0x34')]=_[_0xdc17('0x35')](_0x2e3e4c[_0xdc17('0x34')]);_0x2e5049[_0xdc17('0x36')]=_['intersection'](_0x2e5049[_0xdc17('0x38')],_0x2e5049[_0xdc17('0x34')]);_0x59ddc4[_0xdc17('0x39')]=_[_0xdc17('0x37')](_0x2e5049['model'],qs[_0xdc17('0x3a')](_0x2e3e4c['query'][_0xdc17('0x3a')]));_0x59ddc4[_0xdc17('0x39')]=_0x59ddc4[_0xdc17('0x39')][_0xdc17('0x3b')]?_0x59ddc4[_0xdc17('0x39')]:_0x2e5049[_0xdc17('0x38')];if(!_0x2e3e4c['query'][_0xdc17('0x3c')](_0xdc17('0x3d'))){_0x59ddc4[_0xdc17('0x23')]=qs[_0xdc17('0x23')](_0x2e3e4c[_0xdc17('0x34')][_0xdc17('0x23')]);_0x59ddc4['offset']=qs[_0xdc17('0x22')](_0x2e3e4c[_0xdc17('0x34')][_0xdc17('0x22')]);}_0x59ddc4['order']=qs[_0xdc17('0x3f')](_0x2e3e4c[_0xdc17('0x34')][_0xdc17('0x3f')]);_0x59ddc4[_0xdc17('0x40')]=qs[_0xdc17('0x36')](_[_0xdc17('0x41')](_0x2e3e4c[_0xdc17('0x34')],_0x2e5049[_0xdc17('0x36')]));_0x59ddc4[_0xdc17('0x40')][_0xdc17('0x5c')]=_0x29406b['id'];if(_0x2e3e4c[_0xdc17('0x34')]['filter']){_0x59ddc4[_0xdc17('0x40')]=_[_0xdc17('0x42')](_0x59ddc4[_0xdc17('0x40')],{'$or':_[_0xdc17('0x31')](_0x59ddc4[_0xdc17('0x39')],function(_0x2733bb){var _0x397452={};_0x397452[_0x2733bb]={'$like':'%'+_0x2e3e4c[_0xdc17('0x34')][_0xdc17('0x60')]+'%'};return _0x397452;})});}_0x59ddc4=_[_0xdc17('0x42')]({},_0x59ddc4,_0x2e3e4c[_0xdc17('0x44')]);return db['Disposition']['count']({'where':_0x59ddc4['where']})[_0xdc17('0x2b')](function(_0x520291){_0x4202ee['count']=_0x520291;if(_0x2e3e4c[_0xdc17('0x34')][_0xdc17('0x46')]){_0x59ddc4['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x59ddc4);})[_0xdc17('0x2b')](function(_0x57e2ea){_0x4202ee[_0xdc17('0x48')]=_0x57e2ea;return _0x4202ee;});}})['then'](respondWithFilteredResult(_0x3d25e9,_0x59ddc4))['catch'](handleError(_0x3d25e9,null));};exports[_0xdc17('0x61')]=function(_0x5d614f,_0x593ecd,_0xd99fc1){return db[_0xdc17('0x45')][_0xdc17('0x4c')]({'where':{'id':_0x5d614f['params']['id']}})[_0xdc17('0x2b')](handleEntityNotFound(_0x593ecd,null))[_0xdc17('0x2b')](function(_0x4a7363){if(_0x4a7363){return _0x4a7363[_0xdc17('0x61')](_0x5d614f['query']['ids']);}})[_0xdc17('0x2b')](respondWithStatusCode(_0x593ecd,null))[_0xdc17('0x57')](handleError(_0x593ecd,null));};exports['addContacts']=function(_0x19f38a,_0x4d5bcf,_0x17490c){return db[_0xdc17('0x45')][_0xdc17('0x4c')]({'where':{'id':_0x19f38a[_0xdc17('0x4a')]['id']}})[_0xdc17('0x2b')](handleEntityNotFound(_0x4d5bcf,null))[_0xdc17('0x2b')](function(_0x3042f3){if(_0x3042f3){var _0x4b801f=[];var _0x56efe9={'success':[],'errors':[]};return db[_0xdc17('0x62')][_0xdc17('0x5a')]()['then'](function(_0x48e220){if(_0x19f38a['body'][_0xdc17('0x63')]&&_['isArray'](_0x19f38a[_0xdc17('0x4e')][_0xdc17('0x63')])){if(_0x19f38a[_0xdc17('0x4e')]['tags'][_0xdc17('0x3b')]){_0x19f38a[_0xdc17('0x4e')][_0xdc17('0x63')]=_0x19f38a[_0xdc17('0x4e')][_0xdc17('0x63')]['join'](';')+';';}else{_0x19f38a['body']['tags']=null;}}else{_0x19f38a['body'][_0xdc17('0x63')]=null;}if(_0x19f38a[_0xdc17('0x4e')]&&_[_0xdc17('0x64')](_0x19f38a[_0xdc17('0x4e')])){for(var _0x7d0c29=0x0;_0x7d0c29<_0x19f38a[_0xdc17('0x4e')]['length'];_0x7d0c29+=0x1){_0x19f38a[_0xdc17('0x4e')][_0x7d0c29][_0xdc17('0x5c')]=_0x19f38a[_0xdc17('0x4a')]['id'];_0x4b801f[_0xdc17('0x65')](_0x19f38a[_0xdc17('0x4e')][_0x7d0c29]);}return BPromise[_0xdc17('0x66')](_0x4b801f,function(_0x21252b){return db['CmContact'][_0xdc17('0x4d')](_[_0xdc17('0x67')](_0x21252b,[_0xdc17('0x68'),'id'])||{},{'fields':_[_0xdc17('0x35')](_0x48e220),'raw':!![]})[_0xdc17('0x2b')](function(_0x3e2fd1){_0x56efe9[_0xdc17('0x69')][_0xdc17('0x65')](_0x3e2fd1[_0xdc17('0x6a')]);})[_0xdc17('0x57')](function(_0x7d07fe){_0x56efe9['errors']['push']({'data':_0x21252b,'error':_0x7d07fe[_0xdc17('0x6b')]});});})[_0xdc17('0x2b')](function(_0x534df7){return _0x56efe9;})['catch'](function(_0x3b3733){return _0x3b3733;});}else{_0x4d5bcf[_0xdc17('0x20')](0x190)['json']({'message':_0xdc17('0x6c')});}});}})[_0xdc17('0x2b')](respondWithResult(_0x4d5bcf,null))[_0xdc17('0x57')](handleError(_0x4d5bcf,null));};exports[_0xdc17('0x6d')]=function(_0x43e076,_0x483914,_0x1680c3){var _0x30febf;return db[_0xdc17('0x45')][_0xdc17('0x4c')]({'where':{'id':_0x43e076[_0xdc17('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xdc17('0x6e')}]})[_0xdc17('0x2b')](handleEntityNotFound(_0x483914,null))[_0xdc17('0x2b')](function(_0x249713){if(_0x249713){_0x30febf=_0x249713;return db[_0xdc17('0x62')][_0xdc17('0x6f')];}})[_0xdc17('0x2b')](function(_0x45ea5a){if(_0x45ea5a){var _0x1b6918={};var _0x5bb1a9={};_0x5bb1a9[_0xdc17('0x38')]=_[_0xdc17('0x70')](_['keys'](_0x45ea5a),_['map'](_0x30febf[_0xdc17('0x6e')],function(_0x425f51){return util[_0xdc17('0x71')]('cf_%d',_0x425f51['id']);}));_0x5bb1a9['query']=_['keys'](_0x43e076['query']);_0x5bb1a9['filters']=_[_0xdc17('0x37')](_0x5bb1a9[_0xdc17('0x38')],_0x5bb1a9[_0xdc17('0x34')]);_0x1b6918[_0xdc17('0x39')]=_[_0xdc17('0x37')](_0x5bb1a9[_0xdc17('0x38')],qs[_0xdc17('0x3a')](_0x43e076[_0xdc17('0x34')][_0xdc17('0x3a')]));_0x1b6918[_0xdc17('0x39')]=_0x1b6918[_0xdc17('0x39')]['length']?_0x1b6918[_0xdc17('0x39')]:_0x5bb1a9[_0xdc17('0x38')];if(!_0x43e076[_0xdc17('0x34')][_0xdc17('0x3c')](_0xdc17('0x3d'))){_0x1b6918[_0xdc17('0x23')]=qs[_0xdc17('0x23')](_0x43e076[_0xdc17('0x34')][_0xdc17('0x23')]);_0x1b6918[_0xdc17('0x22')]=qs['offset'](_0x43e076[_0xdc17('0x34')]['offset']);}_0x1b6918[_0xdc17('0x3e')]=qs['sort'](_0x43e076['query'][_0xdc17('0x3f')]);_0x1b6918[_0xdc17('0x40')]=qs[_0xdc17('0x36')](_[_0xdc17('0x41')](_0x43e076[_0xdc17('0x34')],_0x5bb1a9[_0xdc17('0x36')]));_0x1b6918[_0xdc17('0x72')]=!![];if(_0x43e076['query']['filter']){_0x1b6918[_0xdc17('0x40')]=_[_0xdc17('0x42')](_0x1b6918[_0xdc17('0x40')],{'$or':_['map'](_0x1b6918[_0xdc17('0x39')],function(_0x4f3f2e){var _0x2c1d5d={};_0x2c1d5d[_0x4f3f2e]={'$like':'%'+_0x43e076[_0xdc17('0x34')][_0xdc17('0x60')]+'%'};return _0x2c1d5d;})});}_0x1b6918=_['merge']({},_0x1b6918,_0x43e076[_0xdc17('0x44')]);return _0x30febf[_0xdc17('0x6d')](_0x1b6918);}})['then'](respondWithResult(_0x483914,null))['catch'](handleError(_0x483914,null));};exports['getContactsCsv']=function(_0x21044a,_0x6e0795,_0x53d392){var _0x4e32bd;return db[_0xdc17('0x45')][_0xdc17('0x4c')]({'where':{'id':_0x21044a['params']['id']},'include':[{'model':db[_0xdc17('0x73')],'as':'CustomFields'}]})[_0xdc17('0x2b')](handleEntityNotFound(_0x6e0795,null))[_0xdc17('0x2b')](function(_0x1df317){if(_0x1df317){_0x4e32bd=_0x1df317;return db['CmContact'][_0xdc17('0x6f')];}})[_0xdc17('0x2b')](function(_0x50e7e8){if(_0x50e7e8){var _0x4a8a6b={};var _0x1ed294={};_0x1ed294[_0xdc17('0x38')]=_[_0xdc17('0x70')](_[_0xdc17('0x35')](_0x50e7e8),_[_0xdc17('0x31')](_0x4e32bd[_0xdc17('0x6e')],function(_0x2df9d8){return util[_0xdc17('0x71')]('cf_%d',_0x2df9d8['id']);}));_0x1ed294[_0xdc17('0x34')]=_[_0xdc17('0x35')](_0x21044a[_0xdc17('0x34')]);_0x1ed294[_0xdc17('0x36')]=_[_0xdc17('0x37')](_0x1ed294['model'],_0x1ed294['query']);_0x4a8a6b[_0xdc17('0x39')]=_[_0xdc17('0x37')](_0x1ed294[_0xdc17('0x38')],qs[_0xdc17('0x3a')](_0x21044a['query'][_0xdc17('0x3a')]));_0x4a8a6b['attributes']=_0x4a8a6b[_0xdc17('0x39')][_0xdc17('0x3b')]?_0x4a8a6b['attributes']:_0x1ed294['model'];if(!_0x21044a[_0xdc17('0x34')][_0xdc17('0x3c')](_0xdc17('0x3d'))){_0x4a8a6b[_0xdc17('0x23')]=qs['limit'](_0x21044a['query'][_0xdc17('0x23')]);_0x4a8a6b[_0xdc17('0x22')]=qs[_0xdc17('0x22')](_0x21044a[_0xdc17('0x34')][_0xdc17('0x22')]);}_0x4a8a6b['order']=qs[_0xdc17('0x3f')](_0x21044a['query'][_0xdc17('0x3f')]);_0x4a8a6b[_0xdc17('0x40')]=qs['filters'](_[_0xdc17('0x41')](_0x21044a['query'],_0x1ed294[_0xdc17('0x36')]));_0x4a8a6b[_0xdc17('0x72')]=!![];if(_0x21044a[_0xdc17('0x34')][_0xdc17('0x60')]){_0x4a8a6b[_0xdc17('0x40')]=_[_0xdc17('0x42')](_0x4a8a6b[_0xdc17('0x40')],{'$or':_['map'](_0x4a8a6b['attributes'],function(_0x2868a6){var _0x2ee830={};_0x2ee830[_0x2868a6]={'$like':'%'+_0x21044a[_0xdc17('0x34')]['filter']+'%'};return _0x2ee830;})});}_0x4a8a6b=_[_0xdc17('0x42')]({},_0x4a8a6b,_0x21044a[_0xdc17('0x44')]);return _0x4e32bd['getContacts'](_0x4a8a6b);}})[_0xdc17('0x2b')](function(_0x2d3897){if(!_[_0xdc17('0x74')](_0x2d3897)){var _0x3631ae=toCsv(_0x2d3897);var _0x1eeef2=Date['now']();fs[_0xdc17('0x75')](util[_0xdc17('0x71')]('/tmp/list_%d_%s.csv',_0x4e32bd['id'],_0x1eeef2),_0x3631ae);_0x6e0795[_0xdc17('0x76')](_0xdc17('0x77'),'attachment;\x20filename='+util[_0xdc17('0x71')](_0xdc17('0x78'),_0x4e32bd['id'],_0x1eeef2));_0x6e0795[_0xdc17('0x76')]('Content-type',_0xdc17('0x79'));return _0x6e0795[_0xdc17('0x7a')](util[_0xdc17('0x71')](_0xdc17('0x7b'),_0x4e32bd['id'],_0x1eeef2));}else{return _0x6e0795[_0xdc17('0x1e')](0xcc);}})[_0xdc17('0x57')](handleError(_0x6e0795,null));};exports['addCustomField']=function(_0x49bf20,_0x1c2b74,_0x24fb19){var _0x4fabd4;delete _0x49bf20[_0xdc17('0x4e')]['id'];return db['CmList'][_0xdc17('0x5f')]({'where':{'id':_0x49bf20['params']['id']}})['then'](handleEntityNotFound(_0x1c2b74,null))[_0xdc17('0x2b')](function(_0x414e40){if(_0x414e40){return db[_0xdc17('0x7c')]['transaction'](function(_0x592b82){return db['CmCustomField'][_0xdc17('0x4d')](_0x49bf20[_0xdc17('0x4e')],{'transaction':_0x592b82})[_0xdc17('0x2b')](function(_0x5f037d){_0x4fabd4=_0x5f037d;return _0x414e40[_0xdc17('0x7d')](_0x5f037d,{'transaction':_0x592b82});})['then'](function(){var _0x3f6507={'type':db[_0xdc17('0x7e')]['TEXT'],'transaction':_0x592b82};switch(_0x49bf20[_0xdc17('0x4e')][_0xdc17('0x33')]){case'text':_0x3f6507[_0xdc17('0x33')]=db['Sequelize'][_0xdc17('0x7f')];break;case _0xdc17('0x80'):_0x3f6507[_0xdc17('0x33')]=db['Sequelize'][_0xdc17('0x81')];break;case'switch':_0x3f6507[_0xdc17('0x33')]=db[_0xdc17('0x7e')][_0xdc17('0x82')];_0x3f6507[_0xdc17('0x83')]=![];break;default:}return db['sequelize'][_0xdc17('0x84')]['addColumn'](_0xdc17('0x85'),util[_0xdc17('0x71')](_0xdc17('0x86'),_0x4fabd4['id']),_0x3f6507);})[_0xdc17('0x2b')](function(){return _0x4fabd4;});});}})[_0xdc17('0x2b')](respondWithResult(_0x1c2b74,null))['catch'](handleError(_0x1c2b74,null));};exports[_0xdc17('0x87')]=function(_0x5d674e,_0x582e88,_0x490fcd){var _0x56ce33={};var _0x1ecf19={};var _0x5ce9a6;var _0x4b7803;return db[_0xdc17('0x45')][_0xdc17('0x5f')]({'where':{'id':_0x5d674e[_0xdc17('0x4a')]['id']}})[_0xdc17('0x2b')](handleEntityNotFound(_0x582e88,null))['then'](function(_0x4f4d37){if(_0x4f4d37){_0x5ce9a6=_0x4f4d37;_0x1ecf19[_0xdc17('0x38')]=_['keys'](db[_0xdc17('0x73')]['rawAttributes']);_0x1ecf19[_0xdc17('0x34')]=_[_0xdc17('0x35')](_0x5d674e[_0xdc17('0x34')]);_0x1ecf19[_0xdc17('0x36')]=_['intersection'](_0x1ecf19['model'],_0x1ecf19['query']);_0x56ce33[_0xdc17('0x39')]=_[_0xdc17('0x37')](_0x1ecf19[_0xdc17('0x38')],qs[_0xdc17('0x3a')](_0x5d674e[_0xdc17('0x34')][_0xdc17('0x3a')]));_0x56ce33['attributes']=_0x56ce33['attributes'][_0xdc17('0x3b')]?_0x56ce33[_0xdc17('0x39')]:_0x1ecf19[_0xdc17('0x38')];_0x56ce33[_0xdc17('0x3e')]=qs['sort'](_0x5d674e[_0xdc17('0x34')][_0xdc17('0x3f')]);_0x56ce33[_0xdc17('0x40')]=qs[_0xdc17('0x36')](_['pick'](_0x5d674e[_0xdc17('0x34')],_0x1ecf19[_0xdc17('0x36')]));_0x56ce33[_0xdc17('0x40')]=_[_0xdc17('0x42')](_0x56ce33[_0xdc17('0x40')],{'$or':[{'ListId':_0x4f4d37['id']},{'ListId':null}]});if(_0x5d674e[_0xdc17('0x34')]['filter']){_0x56ce33[_0xdc17('0x40')]=_[_0xdc17('0x42')](_0x56ce33['where'],{'$or':_[_0xdc17('0x31')](_0x56ce33[_0xdc17('0x39')],function(_0x3fcf8b){var _0x281c46={};_0x281c46[_0x3fcf8b]={'$like':'%'+_0x5d674e[_0xdc17('0x34')][_0xdc17('0x60')]+'%'};return _0x281c46;})});}_0x56ce33=_['merge']({},_0x56ce33,_0x5d674e[_0xdc17('0x44')]);return db[_0xdc17('0x73')]['findAndCountAll'](_0x56ce33);}})[_0xdc17('0x2b')](respondWithResult(_0x582e88,null))['catch'](handleError(_0x582e88,null));};exports['addAgents']=function(_0x245e07,_0x313c5c,_0x246b4f){return db[_0xdc17('0x45')][_0xdc17('0x4c')]({'where':{'id':_0x245e07[_0xdc17('0x4a')]['id']}})['then'](handleEntityNotFound(_0x313c5c,null))[_0xdc17('0x2b')](function(_0xf58efd){if(_0xf58efd){return _0xf58efd['addAgents'](_0x245e07[_0xdc17('0x4e')]['ids'],_[_0xdc17('0x67')](_0x245e07['body'],[_0xdc17('0x68'),'id'])||{})[_0xdc17('0x88')](function(_0xcfb3e8){for(var _0x3971f4=0x0;_0x3971f4<_0x245e07[_0xdc17('0x4e')][_0xdc17('0x68')][_0xdc17('0x3b')];_0x3971f4+=0x1){socket[_0xdc17('0x89')](_0xdc17('0x8a'),{'UserId':_0x245e07[_0xdc17('0x4e')][_0xdc17('0x68')][_0x3971f4],'CmListId':_0x245e07[_0xdc17('0x4a')]['id']});}return _0xcfb3e8;});}})[_0xdc17('0x2b')](respondWithResult(_0x313c5c,null))[_0xdc17('0x57')](handleError(_0x313c5c,null));};exports[_0xdc17('0x8b')]=function(_0x328e6e,_0x10df27,_0xcd3994){return db['CmList'][_0xdc17('0x4c')]({'where':{'id':_0x328e6e[_0xdc17('0x4a')]['id']}})[_0xdc17('0x2b')](handleEntityNotFound(_0x10df27,null))[_0xdc17('0x2b')](function(_0x237b37){if(_0x237b37){return _0x237b37['removeAgents'](_0x328e6e['query'][_0xdc17('0x68')])['then'](function(){if(_[_0xdc17('0x64')](_0x328e6e['query'][_0xdc17('0x68')])){for(var _0x1aaaef=0x0;_0x1aaaef<_0x328e6e[_0xdc17('0x34')]['ids'][_0xdc17('0x3b')];_0x1aaaef+=0x1){socket[_0xdc17('0x89')](_0xdc17('0x8c'),{'UserId':Number(_0x328e6e[_0xdc17('0x34')][_0xdc17('0x68')][_0x1aaaef]),'CmListId':Number(_0x328e6e['params']['id'])});}}else{socket[_0xdc17('0x89')](_0xdc17('0x8c'),{'UserId':Number(_0x328e6e[_0xdc17('0x34')][_0xdc17('0x68')]),'CmListId':Number(_0x328e6e[_0xdc17('0x4a')]['id'])});}});}})[_0xdc17('0x2b')](respondWithStatusCode(_0x10df27,null))[_0xdc17('0x57')](handleError(_0x10df27,null));};exports[_0xdc17('0x8d')]=function(_0x4eff9e,_0x32325a,_0xc9e854){var _0x42cc91={};var _0x4f8c91={};var _0x1598f;var _0x140fd0;return db[_0xdc17('0x45')][_0xdc17('0x5f')]({'where':{'id':_0x4eff9e[_0xdc17('0x4a')]['id']}})[_0xdc17('0x2b')](handleEntityNotFound(_0x32325a,null))['then'](function(_0x7e1a77){if(_0x7e1a77){_0x1598f=_0x7e1a77;_0x4f8c91[_0xdc17('0x38')]=_[_0xdc17('0x35')](db[_0xdc17('0x8e')][_0xdc17('0x6f')]);_0x4f8c91[_0xdc17('0x34')]=_[_0xdc17('0x35')](_0x4eff9e[_0xdc17('0x34')]);_0x4f8c91[_0xdc17('0x36')]=_[_0xdc17('0x37')](_0x4f8c91[_0xdc17('0x38')],_0x4f8c91[_0xdc17('0x34')]);_0x42cc91[_0xdc17('0x39')]=_[_0xdc17('0x37')](_0x4f8c91[_0xdc17('0x38')],qs[_0xdc17('0x3a')](_0x4eff9e['query'][_0xdc17('0x3a')]));_0x42cc91[_0xdc17('0x39')]=_0x42cc91[_0xdc17('0x39')]['length']?_0x42cc91['attributes']:_0x4f8c91[_0xdc17('0x38')];_0x42cc91[_0xdc17('0x3e')]=qs[_0xdc17('0x3f')](_0x4eff9e['query'][_0xdc17('0x3f')]);_0x42cc91['where']=qs['filters'](_[_0xdc17('0x41')](_0x4eff9e[_0xdc17('0x34')],_0x4f8c91[_0xdc17('0x36')]));if(_0x4eff9e[_0xdc17('0x34')]['filter']){_0x42cc91[_0xdc17('0x40')]=_[_0xdc17('0x42')](_0x42cc91['where'],{'$or':_[_0xdc17('0x31')](_0x42cc91[_0xdc17('0x39')],function(_0x2e518e){var _0xd70918={};_0xd70918[_0x2e518e]={'$like':'%'+_0x4eff9e[_0xdc17('0x34')][_0xdc17('0x60')]+'%'};return _0xd70918;})});}_0x42cc91=_[_0xdc17('0x42')]({},_0x42cc91,_0x4eff9e['options']);return _0x1598f[_0xdc17('0x8d')](_0x42cc91);}})[_0xdc17('0x2b')](function(_0x2bfcd4){if(_0x2bfcd4){_0x140fd0=_0x2bfcd4[_0xdc17('0x3b')];if(!_0x4eff9e[_0xdc17('0x34')][_0xdc17('0x3c')](_0xdc17('0x3d'))){_0x42cc91[_0xdc17('0x23')]=qs[_0xdc17('0x23')](_0x4eff9e['query'][_0xdc17('0x23')]);_0x42cc91[_0xdc17('0x22')]=qs['offset'](_0x4eff9e[_0xdc17('0x34')][_0xdc17('0x22')]);}return _0x1598f[_0xdc17('0x8d')](_0x42cc91);}})[_0xdc17('0x2b')](function(_0x23d106){if(_0x23d106){return _0x23d106?{'count':_0x140fd0,'rows':_0x23d106}:null;}})[_0xdc17('0x2b')](respondWithResult(_0x32325a,null))[_0xdc17('0x57')](handleError(_0x32325a,null));};
\ No newline at end of file
index e595b01..4aa14cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebfb=['setMaxListeners','save','update','emit','hook','events'];(function(_0x32ec72,_0x4f6648){var _0x35bff9=function(_0x348cd4){while(--_0x348cd4){_0x32ec72['push'](_0x32ec72['shift']());}};_0x35bff9(++_0x4f6648);}(_0xebfb,0x143));var _0xbebf=function(_0x3253d8,_0x193063){_0x3253d8=_0x3253d8-0x0;var _0x2c4713=_0xebfb[_0x3253d8];return _0x2c4713;};'use strict';var EventEmitter=require(_0xbebf('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xbebf('0x1')](0x0);var events={'afterCreate':_0xbebf('0x2'),'afterUpdate':_0xbebf('0x3'),'afterDestroy':'remove'};function emitEvent(_0x234c49){return function(_0xfe8734,_0x35c3ed,_0x29104f){CmListEvents[_0xbebf('0x4')](_0x234c49+':'+_0xfe8734['id'],_0xfe8734);CmListEvents[_0xbebf('0x4')](_0x234c49,_0xfe8734);_0x29104f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xbebf('0x5')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0x9bb2=['exports','events','../../mysqldb','CmList','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x27919c,_0x16ba72){var _0x5e610a=function(_0x418a8c){while(--_0x418a8c){_0x27919c['push'](_0x27919c['shift']());}};_0x5e610a(++_0x16ba72);}(_0x9bb2,0xd2));var _0x29bb=function(_0x1b63b6,_0xe7db19){_0x1b63b6=_0x1b63b6-0x0;var _0x11e2e5=_0x9bb2[_0x1b63b6];return _0x11e2e5;};'use strict';var EventEmitter=require(_0x29bb('0x0'));var CmList=require(_0x29bb('0x1'))['db'][_0x29bb('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x29bb('0x3')](0x0);var events={'afterCreate':_0x29bb('0x4'),'afterUpdate':_0x29bb('0x5'),'afterDestroy':_0x29bb('0x6')};function emitEvent(_0x2b0113){return function(_0x23b8c5,_0x3e6fd3,_0x480fc9){CmListEvents['emit'](_0x2b0113+':'+_0x23b8c5['id'],_0x23b8c5);CmListEvents[_0x29bb('0x7')](_0x2b0113,_0x23b8c5);_0x480fc9(null);};}for(var e in events){if(events[_0x29bb('0x8')](e)){var event=events[e];CmList[_0x29bb('0x9')](e,emitEvent(event));}}module[_0x29bb('0xa')]=CmListEvents;
\ No newline at end of file
index 71dfe4c..addd551 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53b6=['./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x378d18,_0x17362b){var _0x52d233=function(_0x24949a){while(--_0x24949a){_0x378d18['push'](_0x378d18['shift']());}};_0x52d233(++_0x17362b);}(_0x53b6,0x9b));var _0x653b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x53b6[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x653b('0x0'));var util=require(_0x653b('0x1'));var logger=require(_0x653b('0x2'))(_0x653b('0x3'));var moment=require(_0x653b('0x4'));var BPromise=require(_0x653b('0x5'));var rp=require(_0x653b('0x6'));var fs=require('fs');var path=require(_0x653b('0x7'));var rimraf=require(_0x653b('0x8'));var config=require(_0x653b('0x9'));var attributes=require(_0x653b('0xa'));module[_0x653b('0xb')]=function(_0x5906bf,_0x57f65d){return _0x5906bf[_0x653b('0xc')](_0x653b('0xd'),attributes,{'tableName':_0x653b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdcaa=['path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x48f180,_0x113fe4){var _0x5bc645=function(_0x4d5bb7){while(--_0x4d5bb7){_0x48f180['push'](_0x48f180['shift']());}};_0x5bc645(++_0x113fe4);}(_0xdcaa,0x1db));var _0xadca=function(_0x39806e,_0x2452e2){_0x39806e=_0x39806e-0x0;var _0x4c927e=_0xdcaa[_0x39806e];return _0x4c927e;};'use strict';var _=require(_0xadca('0x0'));var util=require(_0xadca('0x1'));var logger=require(_0xadca('0x2'))(_0xadca('0x3'));var moment=require(_0xadca('0x4'));var BPromise=require(_0xadca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadca('0x6'));var rimraf=require('rimraf');var config=require(_0xadca('0x7'));var attributes=require(_0xadca('0x8'));module[_0xadca('0x9')]=function(_0x12a99c,_0x42b5c2){return _0x12a99c[_0xadca('0xa')](_0xadca('0xb'),attributes,{'tableName':_0xadca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 64f8e34..32cc315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4716=['info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','socket.io-emitter','register','request','then','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message'];(function(_0x26ecfb,_0x5955e7){var _0xe18a62=function(_0x2f782d){while(--_0x2f782d){_0x26ecfb['push'](_0x26ecfb['shift']());}};_0xe18a62(++_0x5955e7);}(_0x4716,0x79));var _0x6471=function(_0x261602,_0x4d3f4c){_0x261602=_0x261602-0x0;var _0x3cd0d7=_0x4716[_0x261602];return _0x3cd0d7;};'use strict';var _=require(_0x6471('0x0'));var util=require(_0x6471('0x1'));var moment=require('moment');var BPromise=require(_0x6471('0x2'));var rs=require(_0x6471('0x3'));var fs=require('fs');var Redis=require(_0x6471('0x4'));var db=require(_0x6471('0x5'))['db'];var utils=require(_0x6471('0x6'));var logger=require('../../config/logger')(_0x6471('0x7'));var config=require('../../config/environment');var jayson=require(_0x6471('0x8'));var client=jayson['client'][_0x6471('0x9')]({'port':0x232a});config[_0x6471('0xa')]=_['defaults'](config[_0x6471('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6471('0xb'))(new Redis(config[_0x6471('0xa')]));require('./cmList.socket')[_0x6471('0xc')](socket);function respondWithRpcPromise(_0x190439,_0x1dc49c,_0x466163){return new BPromise(function(_0x46c924,_0x1ff1d2){return client[_0x6471('0xd')](_0x190439,_0x466163)[_0x6471('0xe')](function(_0x4cbcc5){logger['info']('CmList,\x20%s,\x20%s',_0x1dc49c,_0x6471('0xf'));logger[_0x6471('0x10')](_0x6471('0x11'),_0x1dc49c,'request\x20sent',JSON[_0x6471('0x12')](_0x4cbcc5));if(_0x4cbcc5['error']){if(_0x4cbcc5[_0x6471('0x13')][_0x6471('0x14')]===0x1f4){logger['error'](_0x6471('0x15'),_0x1dc49c,_0x4cbcc5['error'][_0x6471('0x16')]);return _0x1ff1d2(_0x4cbcc5['error'][_0x6471('0x16')]);}logger['error'](_0x6471('0x15'),_0x1dc49c,_0x4cbcc5[_0x6471('0x13')][_0x6471('0x16')]);return _0x46c924(_0x4cbcc5['error'][_0x6471('0x16')]);}else{logger[_0x6471('0x17')]('CmList,\x20%s,\x20%s',_0x1dc49c,_0x6471('0xf'));_0x46c924(_0x4cbcc5['result'][_0x6471('0x16')]);}})['catch'](function(_0x2efe97){logger['error'](_0x6471('0x15'),_0x1dc49c,_0x2efe97);_0x1ff1d2(_0x2efe97);});});}
\ No newline at end of file
+var _0xb89d=['localhost','socket.io-emitter','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2183ca,_0x3778a9){var _0x21d00e=function(_0x2fb048){while(--_0x2fb048){_0x2183ca['push'](_0x2183ca['shift']());}};_0x21d00e(++_0x3778a9);}(_0xb89d,0xd3));var _0xdb89=function(_0x1af19c,_0x513aa2){_0x1af19c=_0x1af19c-0x0;var _0x5b94be=_0xb89d[_0x1af19c];return _0x5b94be;};'use strict';var _=require('lodash');var util=require(_0xdb89('0x0'));var moment=require(_0xdb89('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb89('0x2'));var fs=require('fs');var Redis=require(_0xdb89('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdb89('0x4'));var jayson=require(_0xdb89('0x5'));var client=jayson[_0xdb89('0x6')][_0xdb89('0x7')]({'port':0x232a});config[_0xdb89('0x8')]=_['defaults'](config[_0xdb89('0x8')],{'host':_0xdb89('0x9'),'port':0x18eb});var socket=require(_0xdb89('0xa'))(new Redis(config[_0xdb89('0x8')]));require('./cmList.socket')[_0xdb89('0xb')](socket);function respondWithRpcPromise(_0x50c3e9,_0x3969c0,_0x1064f1){return new BPromise(function(_0x51dc3a,_0x5abca9){return client[_0xdb89('0xc')](_0x50c3e9,_0x1064f1)['then'](function(_0x35b5e4){logger[_0xdb89('0xd')](_0xdb89('0xe'),_0x3969c0,_0xdb89('0xf'));logger[_0xdb89('0x10')](_0xdb89('0x11'),_0x3969c0,_0xdb89('0xf'),JSON[_0xdb89('0x12')](_0x35b5e4));if(_0x35b5e4[_0xdb89('0x13')]){if(_0x35b5e4[_0xdb89('0x13')][_0xdb89('0x14')]===0x1f4){logger[_0xdb89('0x13')](_0xdb89('0xe'),_0x3969c0,_0x35b5e4[_0xdb89('0x13')][_0xdb89('0x15')]);return _0x5abca9(_0x35b5e4[_0xdb89('0x13')]['message']);}logger[_0xdb89('0x13')]('CmList,\x20%s,\x20%s',_0x3969c0,_0x35b5e4['error'][_0xdb89('0x15')]);return _0x51dc3a(_0x35b5e4[_0xdb89('0x13')][_0xdb89('0x15')]);}else{logger[_0xdb89('0xd')](_0xdb89('0xe'),_0x3969c0,'request\x20sent');_0x51dc3a(_0x35b5e4['result'][_0xdb89('0x15')]);}})['catch'](function(_0x814ee4){logger[_0xdb89('0x13')](_0xdb89('0xe'),_0x3969c0,_0x814ee4);_0x5abca9(_0x814ee4);});});}
\ No newline at end of file
index 48ad084..2a7a5cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d61=['register','length','cmList:','./cmList.events','save','remove','update','emit','removeListener'];(function(_0xe4920b,_0x56579e){var _0x15f20a=function(_0x427025){while(--_0x427025){_0xe4920b['push'](_0xe4920b['shift']());}};_0x15f20a(++_0x56579e);}(_0x4d61,0x147));var _0x14d6=function(_0x4d9100,_0x5d39ff){_0x4d9100=_0x4d9100-0x0;var _0x4ffd43=_0x4d61[_0x4d9100];return _0x4ffd43;};'use strict';var CmListEvents=require(_0x14d6('0x0'));var events=[_0x14d6('0x1'),_0x14d6('0x2'),_0x14d6('0x3')];function createListener(_0x128a58,_0x1f3eb8){return function(_0x1f4d14){_0x1f3eb8[_0x14d6('0x4')](_0x128a58,_0x1f4d14);};}function removeListener(_0x2950b7,_0x5da268){return function(){CmListEvents[_0x14d6('0x5')](_0x2950b7,_0x5da268);};}exports[_0x14d6('0x6')]=function(_0x2920fe){for(var _0x11b2c0=0x0,_0x349eac=events[_0x14d6('0x7')];_0x11b2c0<_0x349eac;_0x11b2c0++){var _0x344fb8=events[_0x11b2c0];var _0x52eb2d=createListener(_0x14d6('0x8')+_0x344fb8,_0x2920fe);CmListEvents['on'](_0x344fb8,_0x52eb2d);}};
\ No newline at end of file
+var _0xfa45=['register','length','cmList:','./cmList.events','save','remove','update','removeListener'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0xfa45,0x11b));var _0x5fa4=function(_0x4af3bb,_0x4cff2e){_0x4af3bb=_0x4af3bb-0x0;var _0x449d75=_0xfa45[_0x4af3bb];return _0x449d75;};'use strict';var CmListEvents=require(_0x5fa4('0x0'));var events=[_0x5fa4('0x1'),_0x5fa4('0x2'),_0x5fa4('0x3')];function createListener(_0x46c739,_0x2d966c){return function(_0x1e88c8){_0x2d966c['emit'](_0x46c739,_0x1e88c8);};}function removeListener(_0x2b3824,_0x4b7365){return function(){CmListEvents[_0x5fa4('0x4')](_0x2b3824,_0x4b7365);};}exports[_0x5fa4('0x5')]=function(_0x1121f8){for(var _0x260b0d=0x0,_0x28a266=events[_0x5fa4('0x6')];_0x260b0d<_0x28a266;_0x260b0d++){var _0x298dce=events[_0x260b0d];var _0x108de1=createListener(_0x5fa4('0x7')+_0x298dce,_0x1121f8);CmListEvents['on'](_0x298dce,_0x108de1);}};
\ No newline at end of file
index e40381e..8dd7a11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2507=['isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','getCustomFields','/:id/users','post','create','addDisposition','/:id/fields','addCustomField','addAgents','put','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','index','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2507,0x1b7));var _0x7250=function(_0x4999e9,_0x75c021){_0x4999e9=_0x4999e9-0x0;var _0x171498=_0x2507[_0x4999e9];return _0x171498;};'use strict';var multer=require(_0x7250('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7250('0x1'));var express=require('express');var router=express[_0x7250('0x2')]();var auth=require(_0x7250('0x3'));var interaction=require(_0x7250('0x4'));var config=require('../../config/environment');var controller=require(_0x7250('0x5'));router[_0x7250('0x6')]('/',auth['isAuthenticated'](),controller[_0x7250('0x7')]);router[_0x7250('0x6')](_0x7250('0x8'),auth[_0x7250('0x9')](),controller['describe']);router[_0x7250('0x6')](_0x7250('0xa'),auth[_0x7250('0x9')](),controller['show']);router[_0x7250('0x6')](_0x7250('0xb'),auth[_0x7250('0x9')](),controller[_0x7250('0xc')]);router['get'](_0x7250('0xd'),auth[_0x7250('0x9')](),controller[_0x7250('0xe')]);router['get']('/:id/contacts/csv',auth[_0x7250('0x9')](),controller[_0x7250('0xf')]);router[_0x7250('0x6')]('/:id/fields',auth[_0x7250('0x9')](),controller[_0x7250('0x10')]);router[_0x7250('0x6')](_0x7250('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0x7250('0x12')]('/',auth[_0x7250('0x9')](),controller[_0x7250('0x13')]);router[_0x7250('0x12')](_0x7250('0xb'),auth[_0x7250('0x9')](),controller[_0x7250('0x14')]);router[_0x7250('0x12')](_0x7250('0xd'),auth[_0x7250('0x9')](),controller['addContacts']);router['post'](_0x7250('0x15'),auth[_0x7250('0x9')](),controller[_0x7250('0x16')]);router[_0x7250('0x12')](_0x7250('0x11'),auth[_0x7250('0x9')](),controller[_0x7250('0x17')]);router[_0x7250('0x18')]('/:id',auth[_0x7250('0x9')](),controller['update']);router[_0x7250('0x19')](_0x7250('0xa'),auth['isAuthenticated'](),controller[_0x7250('0x1a')]);router[_0x7250('0x19')]('/:id/dispositions',auth[_0x7250('0x9')](),controller['removeDispositions']);router[_0x7250('0x19')](_0x7250('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7250('0x1b')]=router;
\ No newline at end of file
+var _0xd86b=['/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd86b,0x126));var _0xbd86=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xd86b[_0x38b14f];return _0x22a324;};'use strict';var multer=require(_0xbd86('0x0'));var util=require(_0xbd86('0x1'));var path=require(_0xbd86('0x2'));var timeout=require(_0xbd86('0x3'));var express=require(_0xbd86('0x4'));var router=express[_0xbd86('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbd86('0x6'));var config=require(_0xbd86('0x7'));var controller=require(_0xbd86('0x8'));router[_0xbd86('0x9')]('/',auth[_0xbd86('0xa')](),controller[_0xbd86('0xb')]);router['get'](_0xbd86('0xc'),auth[_0xbd86('0xa')](),controller[_0xbd86('0xd')]);router[_0xbd86('0x9')](_0xbd86('0xe'),auth[_0xbd86('0xa')](),controller[_0xbd86('0xf')]);router['get'](_0xbd86('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbd86('0x9')](_0xbd86('0x11'),auth['isAuthenticated'](),controller[_0xbd86('0x12')]);router[_0xbd86('0x9')](_0xbd86('0x13'),auth[_0xbd86('0xa')](),controller[_0xbd86('0x14')]);router[_0xbd86('0x9')](_0xbd86('0x15'),auth[_0xbd86('0xa')](),controller[_0xbd86('0x16')]);router[_0xbd86('0x9')](_0xbd86('0x17'),auth['isAuthenticated'](),controller[_0xbd86('0x18')]);router['post']('/',auth[_0xbd86('0xa')](),controller['create']);router[_0xbd86('0x19')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xbd86('0x1a')]);router[_0xbd86('0x19')]('/:id/contacts',auth[_0xbd86('0xa')](),controller[_0xbd86('0x1b')]);router['post'](_0xbd86('0x15'),auth[_0xbd86('0xa')](),controller[_0xbd86('0x1c')]);router[_0xbd86('0x19')](_0xbd86('0x17'),auth[_0xbd86('0xa')](),controller['addAgents']);router[_0xbd86('0x1d')](_0xbd86('0xe'),auth[_0xbd86('0xa')](),controller[_0xbd86('0x1e')]);router[_0xbd86('0x1f')]('/:id',auth[_0xbd86('0xa')](),controller[_0xbd86('0x20')]);router[_0xbd86('0x1f')](_0xbd86('0x10'),auth[_0xbd86('0xa')](),controller['removeDispositions']);router[_0xbd86('0x1f')](_0xbd86('0x17'),auth[_0xbd86('0xa')](),controller[_0xbd86('0x21')]);module[_0xbd86('0x22')]=router;
\ No newline at end of file
index fe397ac..88f3062 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x59725e,_0x3961a4){var _0x44e9b8=function(_0x3a9b98){while(--_0x3a9b98){_0x59725e['push'](_0x59725e['shift']());}};_0x44e9b8(++_0x3961a4);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x404e97,_0x271132){var _0x527da1=function(_0x44c965){while(--_0x44c965){_0x404e97['push'](_0x404e97['shift']());}};_0x527da1(++_0x271132);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}};
\ No newline at end of file
index 3ef8cf7..dc4abe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b68=['moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','update','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x360ed3,_0x2da88a){var _0x1bd153=function(_0x4a8dc7){while(--_0x4a8dc7){_0x360ed3['push'](_0x360ed3['shift']());}};_0x1bd153(++_0x2da88a);}(_0x6b68,0x1be));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x86b6('0x0'));var emlformat=require(_0x86b6('0x1'));var rimraf=require(_0x86b6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86b6('0x3'));var rp=require('request-promise');var moment=require(_0x86b6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x86b6('0x5'));var util=require(_0x86b6('0x6'));var path=require('path');var sox=require(_0x86b6('0x7'));var csv=require(_0x86b6('0x8'));var ejs=require(_0x86b6('0x9'));var fs=require('fs');var _=require(_0x86b6('0xa'));var squel=require('squel');var crypto=require(_0x86b6('0xb'));var jsforce=require(_0x86b6('0xc'));var deskjs=require(_0x86b6('0xd'));var toCsv=require(_0x86b6('0x8'));var querystring=require(_0x86b6('0xe'));var Papa=require(_0x86b6('0xf'));var Redis=require(_0x86b6('0x10'));var authService=require(_0x86b6('0x11'));var qs=require(_0x86b6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86b6('0x13'))(_0x86b6('0x14'));var utils=require(_0x86b6('0x15'));var config=require(_0x86b6('0x16'));var db=require(_0x86b6('0x17'))['db'];function respondWithStatusCode(_0x1d7f45,_0x4573a2){_0x4573a2=_0x4573a2||0xcc;return function(_0x781929){if(_0x781929){return _0x1d7f45['sendStatus'](_0x4573a2);}return _0x1d7f45[_0x86b6('0x18')](_0x4573a2)[_0x86b6('0x19')]();};}function respondWithResult(_0x4f3cbf,_0x21d286){_0x21d286=_0x21d286||0xc8;return function(_0x54fac2){if(_0x54fac2){return _0x4f3cbf['status'](_0x21d286)[_0x86b6('0x1a')](_0x54fac2);}};}function respondWithFilteredResult(_0x117e25,_0x2c9dca){return function(_0x53a7cf){if(_0x53a7cf){var _0x38e12e=_0x53a7cf['count'],_0x47492d=_0x2c9dca[_0x86b6('0x1b')],_0x41b8ef=_0x2c9dca[_0x86b6('0x1b')]+_0x2c9dca[_0x86b6('0x1c')],_0x4053e8;if(_0x41b8ef>=_0x38e12e){_0x41b8ef=_0x38e12e;_0x4053e8=0xc8;}else{_0x4053e8=0xce;}_0x117e25[_0x86b6('0x18')](_0x4053e8);return _0x117e25['set'](_0x86b6('0x1d'),_0x47492d+'-'+_0x41b8ef+'/'+_0x38e12e)[_0x86b6('0x1a')](_0x53a7cf);}return null;};}function patchUpdates(_0x4baa61){return function(_0x12e704){try{jsonpatch[_0x86b6('0x1e')](_0x12e704,_0x4baa61,!![]);}catch(_0x4286a9){return BPromise[_0x86b6('0x1f')](_0x4286a9);}return _0x12e704[_0x86b6('0x20')]();};}function saveUpdates(_0x355df9,_0x54c178){return function(_0x4a3970){if(_0x4a3970){return _0x4a3970['update'](_0x355df9)[_0x86b6('0x21')](function(_0x1a6f0f){return _0x1a6f0f;});}return null;};}function removeEntity(_0x55d578,_0x4f0ee1){return function(_0x1870d9){if(_0x1870d9){return _0x1870d9[_0x86b6('0x22')]()['then'](function(){_0x55d578[_0x86b6('0x18')](0xcc)[_0x86b6('0x19')]();});}};}function handleEntityNotFound(_0x4706c1,_0x1bfa63){return function(_0x1fb6ba){if(!_0x1fb6ba){_0x4706c1[_0x86b6('0x23')](0x194);}return _0x1fb6ba;};}function handleError(_0x460431,_0x31b9b9){_0x31b9b9=_0x31b9b9||0x1f4;return function(_0x655971){logger['error'](_0x655971[_0x86b6('0x24')]);if(_0x655971[_0x86b6('0x25')]){delete _0x655971[_0x86b6('0x25')];}_0x460431[_0x86b6('0x18')](_0x31b9b9)[_0x86b6('0x26')](_0x655971);};}exports[_0x86b6('0x27')]=function(_0x1ebab6,_0x4181c5){if(_0x1ebab6[_0x86b6('0x28')]['id']){delete _0x1ebab6[_0x86b6('0x28')]['id'];}return db[_0x86b6('0x29')][_0x86b6('0x2a')]({'where':{'id':_0x1ebab6[_0x86b6('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4181c5,null))[_0x86b6('0x21')](saveUpdates(_0x1ebab6[_0x86b6('0x28')],null))[_0x86b6('0x21')](respondWithResult(_0x4181c5,null))[_0x86b6('0x2c')](handleError(_0x4181c5,null));};exports[_0x86b6('0x22')]=function(_0x348450,_0x5e74b5){return db[_0x86b6('0x29')][_0x86b6('0x2a')]({'where':{'id':_0x348450['params']['id']}})[_0x86b6('0x21')](handleEntityNotFound(_0x5e74b5,null))[_0x86b6('0x21')](removeEntity(_0x5e74b5,null))[_0x86b6('0x2c')](handleError(_0x5e74b5,null));};
\ No newline at end of file
+var _0xf79e=['sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','save','update','then','error','stack','name','body','Condition','find','params','destroy','catch','eml-format','rimraf','zip-dir','request-promise','moment','util','path'];(function(_0x4326d4,_0x29a654){var _0x3bfad1=function(_0x559216){while(--_0x559216){_0x4326d4['push'](_0x4326d4['shift']());}};_0x3bfad1(++_0x29a654);}(_0xf79e,0x185));var _0xef79=function(_0x2000c2,_0x5ea419){_0x2000c2=_0x2000c2-0x0;var _0x2c7711=_0xf79e[_0x2000c2];return _0x2c7711;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xef79('0x0'));var rimraf=require(_0xef79('0x1'));var zipdir=require(_0xef79('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef79('0x3'));var moment=require(_0xef79('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xef79('0x5'));var path=require(_0xef79('0x6'));var sox=require(_0xef79('0x7'));var csv=require(_0xef79('0x8'));var ejs=require(_0xef79('0x9'));var fs=require('fs');var _=require(_0xef79('0xa'));var squel=require('squel');var crypto=require(_0xef79('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xef79('0xc'));var toCsv=require(_0xef79('0x8'));var querystring=require('querystring');var Papa=require(_0xef79('0xd'));var Redis=require(_0xef79('0xe'));var authService=require(_0xef79('0xf'));var qs=require(_0xef79('0x10'));var as=require(_0xef79('0x11'));var hardwareService=require(_0xef79('0x12'));var logger=require(_0xef79('0x13'))(_0xef79('0x14'));var utils=require('../../config/utils');var config=require(_0xef79('0x15'));var db=require(_0xef79('0x16'))['db'];function respondWithStatusCode(_0x1694a5,_0x29ef3d){_0x29ef3d=_0x29ef3d||0xcc;return function(_0x10f122){if(_0x10f122){return _0x1694a5[_0xef79('0x17')](_0x29ef3d);}return _0x1694a5[_0xef79('0x18')](_0x29ef3d)[_0xef79('0x19')]();};}function respondWithResult(_0x1d0dbf,_0x353e76){_0x353e76=_0x353e76||0xc8;return function(_0x4bc3ac){if(_0x4bc3ac){return _0x1d0dbf['status'](_0x353e76)['json'](_0x4bc3ac);}};}function respondWithFilteredResult(_0x499738,_0xe3dbe7){return function(_0x2b42bc){if(_0x2b42bc){var _0xfbbcfe=_0x2b42bc[_0xef79('0x1a')],_0x7a40d5=_0xe3dbe7['offset'],_0x548bf3=_0xe3dbe7[_0xef79('0x1b')]+_0xe3dbe7[_0xef79('0x1c')],_0x205a93;if(_0x548bf3>=_0xfbbcfe){_0x548bf3=_0xfbbcfe;_0x205a93=0xc8;}else{_0x205a93=0xce;}_0x499738[_0xef79('0x18')](_0x205a93);return _0x499738[_0xef79('0x1d')]('Content-Range',_0x7a40d5+'-'+_0x548bf3+'/'+_0xfbbcfe)[_0xef79('0x1e')](_0x2b42bc);}return null;};}function patchUpdates(_0x540f87){return function(_0xfed08b){try{jsonpatch[_0xef79('0x1f')](_0xfed08b,_0x540f87,!![]);}catch(_0xdba057){return BPromise['reject'](_0xdba057);}return _0xfed08b[_0xef79('0x20')]();};}function saveUpdates(_0x3902f9,_0x48e6e6){return function(_0x4a37e9){if(_0x4a37e9){return _0x4a37e9[_0xef79('0x21')](_0x3902f9)[_0xef79('0x22')](function(_0x5e14e2){return _0x5e14e2;});}return null;};}function removeEntity(_0x40cea7,_0x154bff){return function(_0x3ce762){if(_0x3ce762){return _0x3ce762['destroy']()[_0xef79('0x22')](function(){_0x40cea7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a125f,_0x196672){return function(_0x48b3f3){if(!_0x48b3f3){_0x1a125f[_0xef79('0x17')](0x194);}return _0x48b3f3;};}function handleError(_0x518be0,_0x285d4e){_0x285d4e=_0x285d4e||0x1f4;return function(_0x1393c4){logger[_0xef79('0x23')](_0x1393c4[_0xef79('0x24')]);if(_0x1393c4[_0xef79('0x25')]){delete _0x1393c4[_0xef79('0x25')];}_0x518be0[_0xef79('0x18')](_0x285d4e)['send'](_0x1393c4);};}exports[_0xef79('0x21')]=function(_0x52c241,_0x395674){if(_0x52c241['body']['id']){delete _0x52c241[_0xef79('0x26')]['id'];}return db[_0xef79('0x27')][_0xef79('0x28')]({'where':{'id':_0x52c241[_0xef79('0x29')]['id']}})[_0xef79('0x22')](handleEntityNotFound(_0x395674,null))[_0xef79('0x22')](saveUpdates(_0x52c241[_0xef79('0x26')],null))[_0xef79('0x22')](respondWithResult(_0x395674,null))['catch'](handleError(_0x395674,null));};exports[_0xef79('0x2a')]=function(_0x4b0d0d,_0x174eeb){return db[_0xef79('0x27')][_0xef79('0x28')]({'where':{'id':_0x4b0d0d[_0xef79('0x29')]['id']}})[_0xef79('0x22')](handleEntityNotFound(_0x174eeb,null))[_0xef79('0x22')](removeEntity(_0x174eeb,null))[_0xef79('0x2b')](handleError(_0x174eeb,null));};
\ No newline at end of file
index 47ebd2d..d405995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0143=['moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','tools_conditions','util','../../config/logger','api'];(function(_0x3c21b5,_0x4a3d3d){var _0x52a549=function(_0x1fff85){while(--_0x1fff85){_0x3c21b5['push'](_0x3c21b5['shift']());}};_0x52a549(++_0x4a3d3d);}(_0x0143,0x1ad));var _0x3014=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0143[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x3014('0x0'));var logger=require(_0x3014('0x1'))(_0x3014('0x2'));var moment=require(_0x3014('0x3'));var BPromise=require(_0x3014('0x4'));var rp=require(_0x3014('0x5'));var fs=require('fs');var path=require(_0x3014('0x6'));var rimraf=require(_0x3014('0x7'));var config=require('../../config/environment');var attributes=require(_0x3014('0x8'));module[_0x3014('0x9')]=function(_0x357acf,_0x5a098a){return _0x357acf[_0x3014('0xa')]('Condition',attributes,{'tableName':_0x3014('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5733=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash'];(function(_0x3ba927,_0x1a4b2c){var _0x2c88f5=function(_0x2fb08b){while(--_0x2fb08b){_0x3ba927['push'](_0x3ba927['shift']());}};_0x2c88f5(++_0x1a4b2c);}(_0x5733,0xa7));var _0x3573=function(_0x8dbed9,_0x19c180){_0x8dbed9=_0x8dbed9-0x0;var _0x4c49e9=_0x5733[_0x8dbed9];return _0x4c49e9;};'use strict';var _=require(_0x3573('0x0'));var util=require(_0x3573('0x1'));var logger=require(_0x3573('0x2'))(_0x3573('0x3'));var moment=require('moment');var BPromise=require(_0x3573('0x4'));var rp=require(_0x3573('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3573('0x6'));var config=require(_0x3573('0x7'));var attributes=require(_0x3573('0x8'));module[_0x3573('0x9')]=function(_0x2b47cc,_0x4f6971){return _0x2b47cc['define'](_0x3573('0xa'),attributes,{'tableName':_0x3573('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c0747c5..33ae1c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf02d=['jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3c92d8,_0x300d39){var _0x1a69d7=function(_0x2ecead){while(--_0x2ecead){_0x3c92d8['push'](_0x3c92d8['shift']());}};_0x1a69d7(++_0x300d39);}(_0xf02d,0x17e));var _0xdf02=function(_0xdb4b3c,_0x4eac7a){_0xdb4b3c=_0xdb4b3c-0x0;var _0xb21d2d=_0xf02d[_0xdb4b3c];return _0xb21d2d;};'use strict';var _=require(_0xdf02('0x0'));var util=require(_0xdf02('0x1'));var moment=require(_0xdf02('0x2'));var BPromise=require(_0xdf02('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf02('0x4'));var db=require(_0xdf02('0x5'))['db'];var utils=require(_0xdf02('0x6'));var logger=require(_0xdf02('0x7'))('rpc');var config=require(_0xdf02('0x8'));var jayson=require(_0xdf02('0x9'));var client=jayson['client'][_0xdf02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dd693,_0x22b4b7,_0x1b901c){return new BPromise(function(_0x425f5e,_0x1d9e76){return client[_0xdf02('0xb')](_0x1dd693,_0x1b901c)[_0xdf02('0xc')](function(_0x18ae74){logger[_0xdf02('0xd')](_0xdf02('0xe'),_0x22b4b7,_0xdf02('0xf'));logger[_0xdf02('0x10')](_0xdf02('0x11'),_0x22b4b7,_0xdf02('0xf'),JSON['stringify'](_0x18ae74));if(_0x18ae74[_0xdf02('0x12')]){if(_0x18ae74[_0xdf02('0x12')][_0xdf02('0x13')]===0x1f4){logger[_0xdf02('0x12')](_0xdf02('0xe'),_0x22b4b7,_0x18ae74[_0xdf02('0x12')][_0xdf02('0x14')]);return _0x1d9e76(_0x18ae74[_0xdf02('0x12')]['message']);}logger[_0xdf02('0x12')](_0xdf02('0xe'),_0x22b4b7,_0x18ae74[_0xdf02('0x12')][_0xdf02('0x14')]);return _0x425f5e(_0x18ae74[_0xdf02('0x12')][_0xdf02('0x14')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x22b4b7,_0xdf02('0xf'));_0x425f5e(_0x18ae74[_0xdf02('0x15')][_0xdf02('0x14')]);}})[_0xdf02('0x16')](function(_0x243a4d){logger[_0xdf02('0x12')](_0xdf02('0xe'),_0x22b4b7,_0x243a4d);_0x1d9e76(_0x243a4d);});});}
\ No newline at end of file
+var _0xa0e4=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','Condition,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x43e5ab,_0x4975a0){var _0x58ea0a=function(_0x35b921){while(--_0x35b921){_0x43e5ab['push'](_0x43e5ab['shift']());}};_0x58ea0a(++_0x4975a0);}(_0xa0e4,0x191));var _0x4a0e=function(_0x586642,_0x3b2e5d){_0x586642=_0x586642-0x0;var _0xef997a=_0xa0e4[_0x586642];return _0xef997a;};'use strict';var _=require(_0x4a0e('0x0'));var util=require(_0x4a0e('0x1'));var moment=require(_0x4a0e('0x2'));var BPromise=require(_0x4a0e('0x3'));var rs=require(_0x4a0e('0x4'));var fs=require('fs');var Redis=require(_0x4a0e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a0e('0x6'));var logger=require(_0x4a0e('0x7'))('rpc');var config=require(_0x4a0e('0x8'));var jayson=require(_0x4a0e('0x9'));var client=jayson[_0x4a0e('0xa')][_0x4a0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c65b3,_0x126899,_0x1d77e9){return new BPromise(function(_0xad9bb5,_0x3fda13){return client[_0x4a0e('0xc')](_0x2c65b3,_0x1d77e9)[_0x4a0e('0xd')](function(_0x3389cb){logger[_0x4a0e('0xe')]('Condition,\x20%s,\x20%s',_0x126899,_0x4a0e('0xf'));logger[_0x4a0e('0x10')](_0x4a0e('0x11'),_0x126899,_0x4a0e('0xf'),JSON[_0x4a0e('0x12')](_0x3389cb));if(_0x3389cb['error']){if(_0x3389cb[_0x4a0e('0x13')]['code']===0x1f4){logger[_0x4a0e('0x13')]('Condition,\x20%s,\x20%s',_0x126899,_0x3389cb[_0x4a0e('0x13')][_0x4a0e('0x14')]);return _0x3fda13(_0x3389cb[_0x4a0e('0x13')][_0x4a0e('0x14')]);}logger[_0x4a0e('0x13')]('Condition,\x20%s,\x20%s',_0x126899,_0x3389cb[_0x4a0e('0x13')]['message']);return _0xad9bb5(_0x3389cb[_0x4a0e('0x13')][_0x4a0e('0x14')]);}else{logger['info'](_0x4a0e('0x15'),_0x126899,_0x4a0e('0xf'));_0xad9bb5(_0x3389cb[_0x4a0e('0x16')][_0x4a0e('0x14')]);}})[_0x4a0e('0x17')](function(_0xb7d675){logger[_0x4a0e('0x13')](_0x4a0e('0x15'),_0x126899,_0xb7d675);_0x3fda13(_0xb7d675);});});}
\ No newline at end of file
index b2902ec..d09adfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19b3=['isAuthenticated','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','./condition.controller','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x19b3,0xca));var _0x319b=function(_0x2023e1,_0xeca985){_0x2023e1=_0x2023e1-0x0;var _0x1fe133=_0x19b3[_0x2023e1];return _0x1fe133;};'use strict';var multer=require(_0x319b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x319b('0x1'));var express=require(_0x319b('0x2'));var router=express[_0x319b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x319b('0x4'));var config=require('../../config/environment');var controller=require(_0x319b('0x5'));router['put'](_0x319b('0x6'),auth[_0x319b('0x7')](),controller['update']);router[_0x319b('0x8')](_0x319b('0x6'),auth[_0x319b('0x7')](),controller[_0x319b('0x9')]);module[_0x319b('0xa')]=router;
\ No newline at end of file
+var _0xe1b1=['./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe1b1,0x19d));var _0x1e1b=function(_0x162690,_0x3aa229){_0x162690=_0x162690-0x0;var _0x4df615=_0xe1b1[_0x162690];return _0x4df615;};'use strict';var multer=require(_0x1e1b('0x0'));var util=require('util');var path=require(_0x1e1b('0x1'));var timeout=require(_0x1e1b('0x2'));var express=require(_0x1e1b('0x3'));var router=express[_0x1e1b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1e1b('0x5'));var config=require(_0x1e1b('0x6'));var controller=require(_0x1e1b('0x7'));router[_0x1e1b('0x8')](_0x1e1b('0x9'),auth[_0x1e1b('0xa')](),controller[_0x1e1b('0xb')]);router[_0x1e1b('0xc')](_0x1e1b('0x9'),auth[_0x1e1b('0xa')](),controller[_0x1e1b('0xd')]);module[_0x1e1b('0xe')]=router;
\ No newline at end of file
index 7252b0c..4e2e883 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec6=['STRING','name','sequelize','exports'];(function(_0x89aedf,_0x3f9fe3){var _0x53e5cb=function(_0x5230bb){while(--_0x5230bb){_0x89aedf['push'](_0x89aedf['shift']());}};_0x53e5cb(++_0x3f9fe3);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0xeec6[_0x3b76f7];return _0x43984e;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![],'unique':_0x6eec('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaa96=['name','exports','STRING'];(function(_0x2c0c61,_0x147ede){var _0x23adbc=function(_0x55e9df){while(--_0x55e9df){_0x2c0c61['push'](_0x2c0c61['shift']());}};_0x23adbc(++_0x147ede);}(_0xaa96,0x145));var _0x6aa9=function(_0x13e115,_0x35835f){_0x13e115=_0x13e115-0x0;var _0x311265=_0xaa96[_0x13e115];return _0x311265;};'use strict';var Sequelize=require('sequelize');module[_0x6aa9('0x0')]={'name':{'type':Sequelize[_0x6aa9('0x1')],'allowNull':![],'unique':_0x6aa9('0x2')},'description':{'type':Sequelize[_0x6aa9('0x1')]}};
\ No newline at end of file
index 82ad72f..6da6c00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cff=['user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body'];(function(_0x20e3be,_0x60d119){var _0x13c527=function(_0x1d91fa){while(--_0x1d91fa){_0x20e3be['push'](_0x20e3be['shift']());}};_0x13c527(++_0x60d119);}(_0x9cff,0xa1));var _0xf9cf=function(_0x3fc0f5,_0x3c5c91){_0x3fc0f5=_0x3fc0f5-0x0;var _0x3468aa=_0x9cff[_0x3fc0f5];return _0x3468aa;};'use strict';var pdf=require(_0xf9cf('0x0'));var emlformat=require(_0xf9cf('0x1'));var rimraf=require(_0xf9cf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf9cf('0x3'));var rp=require(_0xf9cf('0x4'));var moment=require(_0xf9cf('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf9cf('0x6'));var csv=require(_0xf9cf('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf9cf('0x8'));var jsforce=require(_0xf9cf('0x9'));var deskjs=require(_0xf9cf('0xa'));var toCsv=require(_0xf9cf('0x7'));var querystring=require(_0xf9cf('0xb'));var Papa=require(_0xf9cf('0xc'));var Redis=require('ioredis');var authService=require(_0xf9cf('0xd'));var qs=require(_0xf9cf('0xe'));var as=require(_0xf9cf('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9cf('0x10'))(_0xf9cf('0x11'));var utils=require(_0xf9cf('0x12'));var config=require(_0xf9cf('0x13'));var db=require(_0xf9cf('0x14'))['db'];config[_0xf9cf('0x15')]=_['defaults'](config[_0xf9cf('0x15')],{'host':_0xf9cf('0x16'),'port':0x18eb});var socket=require(_0xf9cf('0x17'))(new Redis(config[_0xf9cf('0x15')]));require(_0xf9cf('0x18'))[_0xf9cf('0x19')](socket);function respondWithStatusCode(_0x3478ca,_0x554aee){_0x554aee=_0x554aee||0xcc;return function(_0x2dd1b5){if(_0x2dd1b5){return _0x3478ca[_0xf9cf('0x1a')](_0x554aee);}return _0x3478ca['status'](_0x554aee)['end']();};}function respondWithResult(_0x4752df,_0x525454){_0x525454=_0x525454||0xc8;return function(_0x56f209){if(_0x56f209){return _0x4752df[_0xf9cf('0x1b')](_0x525454)[_0xf9cf('0x1c')](_0x56f209);}};}function respondWithFilteredResult(_0x3e5940,_0x40b1b3){return function(_0x258a1a){if(_0x258a1a){var _0x380e90=_0x258a1a[_0xf9cf('0x1d')],_0x368116=_0x40b1b3['offset'],_0x5c14f6=_0x40b1b3['offset']+_0x40b1b3[_0xf9cf('0x1e')],_0x2ac5d2;if(_0x5c14f6>=_0x380e90){_0x5c14f6=_0x380e90;_0x2ac5d2=0xc8;}else{_0x2ac5d2=0xce;}_0x3e5940['status'](_0x2ac5d2);return _0x3e5940[_0xf9cf('0x1f')](_0xf9cf('0x20'),_0x368116+'-'+_0x5c14f6+'/'+_0x380e90)[_0xf9cf('0x1c')](_0x258a1a);}return null;};}function patchUpdates(_0xc7777){return function(_0x4c337a){try{jsonpatch[_0xf9cf('0x21')](_0x4c337a,_0xc7777,!![]);}catch(_0x3061f6){return BPromise['reject'](_0x3061f6);}return _0x4c337a[_0xf9cf('0x22')]();};}function saveUpdates(_0x4d9521,_0x1e6243){return function(_0xa9dc1f){if(_0xa9dc1f){return _0xa9dc1f[_0xf9cf('0x23')](_0x4d9521)[_0xf9cf('0x24')](function(_0xa15400){return _0xa15400;});}return null;};}function removeEntity(_0x51814b,_0x3556ae){return function(_0x2120e8){if(_0x2120e8){return _0x2120e8[_0xf9cf('0x25')]()[_0xf9cf('0x24')](function(){var _0x4874a7=_0x2120e8[_0xf9cf('0x26')]({'plain':!![]});var _0x375eba='CustomDashboards';return db[_0xf9cf('0x27')][_0xf9cf('0x25')]({'where':{'type':_0x375eba,'resourceId':_0x4874a7['id']}})[_0xf9cf('0x24')](function(){return _0x2120e8;});})[_0xf9cf('0x24')](function(){_0x51814b[_0xf9cf('0x1b')](0xcc)[_0xf9cf('0x28')]();});}};}function handleEntityNotFound(_0x239876,_0x4e6db4){return function(_0x3cdf6e){if(!_0x3cdf6e){_0x239876[_0xf9cf('0x1a')](0x194);}return _0x3cdf6e;};}function handleError(_0x306106,_0x1c5178){_0x1c5178=_0x1c5178||0x1f4;return function(_0x260be4){logger[_0xf9cf('0x29')](_0x260be4[_0xf9cf('0x2a')]);if(_0x260be4[_0xf9cf('0x2b')]){delete _0x260be4[_0xf9cf('0x2b')];}_0x306106[_0xf9cf('0x1b')](_0x1c5178)[_0xf9cf('0x2c')](_0x260be4);};}exports[_0xf9cf('0x2d')]=function(_0x129f15,_0xe78164){var _0x2d25a2={},_0xa6a619={},_0xc06401={'count':0x0,'rows':[]};var _0xb0ca63=_['map'](db[_0xf9cf('0x2e')][_0xf9cf('0x2f')],function(_0x447f08){return{'name':_0x447f08[_0xf9cf('0x30')],'type':_0x447f08[_0xf9cf('0x31')][_0xf9cf('0x32')]};});_0xa6a619[_0xf9cf('0x33')]=_[_0xf9cf('0x34')](_0xb0ca63,'name');_0xa6a619[_0xf9cf('0x35')]=_[_0xf9cf('0x36')](_0x129f15['query']);_0xa6a619[_0xf9cf('0x37')]=_[_0xf9cf('0x38')](_0xa6a619[_0xf9cf('0x33')],_0xa6a619[_0xf9cf('0x35')]);_0x2d25a2[_0xf9cf('0x39')]=_['intersection'](_0xa6a619[_0xf9cf('0x33')],qs[_0xf9cf('0x3a')](_0x129f15[_0xf9cf('0x35')][_0xf9cf('0x3a')]));_0x2d25a2[_0xf9cf('0x39')]=_0x2d25a2[_0xf9cf('0x39')]['length']?_0x2d25a2[_0xf9cf('0x39')]:_0xa6a619['model'];if(!_0x129f15[_0xf9cf('0x35')][_0xf9cf('0x3b')](_0xf9cf('0x3c'))){_0x2d25a2['limit']=qs[_0xf9cf('0x1e')](_0x129f15[_0xf9cf('0x35')][_0xf9cf('0x1e')]);_0x2d25a2['offset']=qs[_0xf9cf('0x3d')](_0x129f15[_0xf9cf('0x35')][_0xf9cf('0x3d')]);}_0x2d25a2[_0xf9cf('0x3e')]=qs['sort'](_0x129f15[_0xf9cf('0x35')][_0xf9cf('0x3f')]);_0x2d25a2[_0xf9cf('0x40')]=qs[_0xf9cf('0x37')](_[_0xf9cf('0x41')](_0x129f15[_0xf9cf('0x35')],_0xa6a619[_0xf9cf('0x37')]),_0xb0ca63);if(_0x129f15[_0xf9cf('0x35')][_0xf9cf('0x42')]){_0x2d25a2[_0xf9cf('0x40')]=_[_0xf9cf('0x43')](_0x2d25a2[_0xf9cf('0x40')],{'$or':_[_0xf9cf('0x34')](_0xb0ca63,function(_0x1d921f){if(_0x1d921f[_0xf9cf('0x31')]!==_0xf9cf('0x44')){var _0x3beec1={};_0x3beec1[_0x1d921f['name']]={'$like':'%'+_0x129f15['query'][_0xf9cf('0x42')]+'%'};return _0x3beec1;}})});}_0x2d25a2=_[_0xf9cf('0x43')]({},_0x2d25a2,_0x129f15[_0xf9cf('0x45')]);var _0x193e5a={'where':_0x2d25a2[_0xf9cf('0x40')]};return db[_0xf9cf('0x2e')]['count'](_0x193e5a)[_0xf9cf('0x24')](function(_0x4b51c6){_0xc06401[_0xf9cf('0x1d')]=_0x4b51c6;if(_0x129f15[_0xf9cf('0x35')][_0xf9cf('0x46')]){_0x2d25a2[_0xf9cf('0x47')]=[{'all':!![]}];}return db[_0xf9cf('0x2e')][_0xf9cf('0x48')](_0x2d25a2);})['then'](function(_0x2e8e28){_0xc06401[_0xf9cf('0x49')]=_0x2e8e28;return _0xc06401;})[_0xf9cf('0x24')](respondWithFilteredResult(_0xe78164,_0x2d25a2))[_0xf9cf('0x4a')](handleError(_0xe78164,null));};exports[_0xf9cf('0x4b')]=function(_0x147afe,_0x5c9033){var _0x2bd6cb={'raw':![],'where':{'id':_0x147afe[_0xf9cf('0x4c')]['id']}},_0x40f608={};_0x40f608[_0xf9cf('0x33')]=_['keys'](db[_0xf9cf('0x2e')][_0xf9cf('0x2f')]);_0x40f608[_0xf9cf('0x35')]=_[_0xf9cf('0x36')](_0x147afe[_0xf9cf('0x35')]);_0x40f608[_0xf9cf('0x37')]=_[_0xf9cf('0x38')](_0x40f608[_0xf9cf('0x33')],_0x40f608[_0xf9cf('0x35')]);_0x2bd6cb[_0xf9cf('0x39')]=_[_0xf9cf('0x38')](_0x40f608[_0xf9cf('0x33')],qs[_0xf9cf('0x3a')](_0x147afe[_0xf9cf('0x35')][_0xf9cf('0x3a')]));_0x2bd6cb['attributes']=_0x2bd6cb['attributes'][_0xf9cf('0x4d')]?_0x2bd6cb[_0xf9cf('0x39')]:_0x40f608[_0xf9cf('0x33')];if(_0x147afe[_0xf9cf('0x35')][_0xf9cf('0x46')]){_0x2bd6cb[_0xf9cf('0x47')]=[{'all':!![]}];}_0x2bd6cb=_[_0xf9cf('0x43')]({},_0x2bd6cb,_0x147afe[_0xf9cf('0x45')]);return db[_0xf9cf('0x2e')][_0xf9cf('0x4e')](_0x2bd6cb)[_0xf9cf('0x24')](handleEntityNotFound(_0x5c9033,null))[_0xf9cf('0x24')](respondWithResult(_0x5c9033,null))[_0xf9cf('0x4a')](handleError(_0x5c9033,null));};exports[_0xf9cf('0x4f')]=function(_0xf30116,_0x5317ab){return db[_0xf9cf('0x2e')][_0xf9cf('0x4f')](_0xf30116[_0xf9cf('0x50')],{})[_0xf9cf('0x24')](function(_0x48f1f2){var _0x305f9c=_0xf30116['user'][_0xf9cf('0x26')]({'plain':!![]});if(!_0x305f9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x305f9c['role']===_0xf9cf('0x51')){var _0x5c238c=_0x48f1f2['get']({'plain':!![]});var _0x5953e1=_0xf9cf('0x52');return db[_0xf9cf('0x53')][_0xf9cf('0x4e')]({'where':{'name':_0x5953e1,'userProfileId':_0x305f9c[_0xf9cf('0x54')]},'raw':!![]})[_0xf9cf('0x24')](function(_0x341600){if(_0x341600&&_0x341600[_0xf9cf('0x55')]===0x0){return db[_0xf9cf('0x27')]['create']({'name':_0x5c238c[_0xf9cf('0x2b')],'resourceId':_0x5c238c['id'],'type':_0x341600[_0xf9cf('0x2b')],'sectionId':_0x341600['id']},{})[_0xf9cf('0x24')](function(){return _0x48f1f2;});}else{return _0x48f1f2;}})[_0xf9cf('0x4a')](function(_0x561c54){logger[_0xf9cf('0x29')](_0xf9cf('0x56'),_0x561c54);throw _0x561c54;});}return _0x48f1f2;})[_0xf9cf('0x24')](respondWithResult(_0x5317ab,0xc9))[_0xf9cf('0x4a')](handleError(_0x5317ab,null));};exports[_0xf9cf('0x57')]=function(_0x351466,_0x33fa5a){var _0x36d1e9={'where':{'id':_0x351466[_0xf9cf('0x4c')]['id']}},_0x4a6723={};_0x4a6723[_0xf9cf('0x33')]=_['keys'](db[_0xf9cf('0x2e')]['rawAttributes']);_0x36d1e9[_0xf9cf('0x39')]=_['intersection'](_0x4a6723[_0xf9cf('0x33')],qs[_0xf9cf('0x3a')](_0x351466[_0xf9cf('0x35')][_0xf9cf('0x3a')]));_0x36d1e9[_0xf9cf('0x39')]=_0x36d1e9['attributes'][_0xf9cf('0x4d')]?_0x36d1e9[_0xf9cf('0x39')]:_0x4a6723[_0xf9cf('0x33')];if(_0x351466[_0xf9cf('0x35')][_0xf9cf('0x46')]){_0x36d1e9[_0xf9cf('0x47')]=[{'all':!![]}];}_0x36d1e9=_[_0xf9cf('0x43')]({},_0x36d1e9,_0x351466[_0xf9cf('0x45')]);return db[_0xf9cf('0x2e')][_0xf9cf('0x4e')](_0x36d1e9)[_0xf9cf('0x24')](handleEntityNotFound(_0x33fa5a,null))[_0xf9cf('0x24')](function(_0x3af2a9){if(_0x3af2a9){var _0x7ef143=_0x3af2a9['get']({'plain':!![]});_0x7ef143=qs[_0xf9cf('0x58')](_0x7ef143,['id',_0xf9cf('0x59'),_0xf9cf('0x5a')]);_0x351466[_0xf9cf('0x50')]=_[_0xf9cf('0x58')](_0x351466['body'],['id',_0xf9cf('0x59'),_0xf9cf('0x5a')]);return db[_0xf9cf('0x2e')][_0xf9cf('0x4f')](_[_0xf9cf('0x43')](_0x7ef143,_0x351466['body']),{'include':_0x351466[_0xf9cf('0x35')][_0xf9cf('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x32801c){var _0x2faeb8=_0x351466[_0xf9cf('0x51')][_0xf9cf('0x26')]({'plain':!![]});if(!_0x2faeb8)throw new Error(_0xf9cf('0x5b'));if(_0x2faeb8['role']==='user'){var _0xb1ec40=_0x32801c[_0xf9cf('0x26')]({'plain':!![]});var _0x54db45=_0xf9cf('0x52');return db[_0xf9cf('0x53')][_0xf9cf('0x4e')]({'where':{'name':_0x54db45,'userProfileId':_0x2faeb8[_0xf9cf('0x54')]},'raw':!![]})[_0xf9cf('0x24')](function(_0x1e7c70){if(_0x1e7c70&&_0x1e7c70['autoAssociation']===0x0){return db[_0xf9cf('0x27')][_0xf9cf('0x4f')]({'name':_0xb1ec40[_0xf9cf('0x2b')],'resourceId':_0xb1ec40['id'],'type':_0x1e7c70[_0xf9cf('0x2b')],'sectionId':_0x1e7c70['id']},{})['then'](function(){return _0x32801c;});}else{return _0x32801c;}})['catch'](function(_0x17ad8e){logger[_0xf9cf('0x29')](_0xf9cf('0x56'),_0x17ad8e);throw _0x17ad8e;});}return _0x32801c;});}})[_0xf9cf('0x24')](respondWithResult(_0x33fa5a,0xc9))[_0xf9cf('0x4a')](handleError(_0x33fa5a,null));};exports[_0xf9cf('0x23')]=function(_0x305f00,_0x6e5833){if(_0x305f00[_0xf9cf('0x50')]['id']){delete _0x305f00[_0xf9cf('0x50')]['id'];}return db[_0xf9cf('0x2e')][_0xf9cf('0x4e')]({'where':{'id':_0x305f00[_0xf9cf('0x4c')]['id']}})[_0xf9cf('0x24')](handleEntityNotFound(_0x6e5833,null))['then'](saveUpdates(_0x305f00['body'],null))['then'](respondWithResult(_0x6e5833,null))['catch'](handleError(_0x6e5833,null));};exports[_0xf9cf('0x25')]=function(_0x3d6dd1,_0x35b58b){return db['Dashboard']['find']({'where':{'id':_0x3d6dd1[_0xf9cf('0x4c')]['id']}})[_0xf9cf('0x24')](handleEntityNotFound(_0x35b58b,null))['then'](removeEntity(_0x35b58b,null))[_0xf9cf('0x4a')](handleError(_0x35b58b,null));};function widgetAttributes(_0x201d3c){try{switch(_0x201d3c[_0xf9cf('0x31')]){case _0xf9cf('0x5c'):return[{'name':_0xf9cf('0x5d'),'value':_0x201d3c[_0xf9cf('0x5d')]||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c[_0xf9cf('0x5e')][0x0]?_0x201d3c[_0xf9cf('0x5e')][0x0][_0xf9cf('0x5f')]:undefined)||_0xf9cf('0x60')}];case'custom':return[{'name':'attrPath','value':_0x201d3c[_0xf9cf('0x61')]||(_0x201d3c['attrs']&&_0x201d3c[_0xf9cf('0x5e')][0x0]?_0x201d3c[_0xf9cf('0x5e')][0x0]['value']:undefined)||''}];case _0xf9cf('0x62'):return[{'name':_0xf9cf('0x63'),'value':_0x201d3c['attrHourFormat']||(_0x201d3c['attrs']&&_0x201d3c[_0xf9cf('0x5e')][0x0]?_0x201d3c[_0xf9cf('0x5e')][0x0][_0xf9cf('0x5f')]:undefined)||'HH:mm:ss'},{'name':_0xf9cf('0x64'),'value':_0x201d3c[_0xf9cf('0x64')]||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c[_0xf9cf('0x5e')][0x1]?_0x201d3c[_0xf9cf('0x5e')][0x1]['value']:undefined)||_0xf9cf('0x65')},{'name':_0xf9cf('0x66'),'value':_0x201d3c[_0xf9cf('0x66')]||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c[_0xf9cf('0x5e')][0x2]?_0x201d3c[_0xf9cf('0x5e')][0x2][_0xf9cf('0x5f')]:undefined)||0xc}];case'counter':return[{'name':_0xf9cf('0x67'),'value':_0x201d3c[_0xf9cf('0x67')]||(_0x201d3c['attrs']&&_0x201d3c[_0xf9cf('0x5e')][0x0]?_0x201d3c['attrs'][0x0][_0xf9cf('0x5f')]:undefined)||_0xf9cf('0x68')},{'name':_0xf9cf('0x69'),'value':_0x201d3c[_0xf9cf('0x69')]||(_0x201d3c['attrs']&&_0x201d3c[_0xf9cf('0x5e')][0x1]?_0x201d3c[_0xf9cf('0x5e')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x201d3c['attrFontSize']||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c['attrs'][0x2]?_0x201d3c[_0xf9cf('0x5e')][0x2]['value']:undefined)||0x14}];case _0xf9cf('0x6a'):case _0xf9cf('0x6b'):return[{'name':_0xf9cf('0x6c'),'value':_0x201d3c[_0xf9cf('0x6c')]||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c['attrs'][0x0]?_0x201d3c[_0xf9cf('0x5e')][0x0][_0xf9cf('0x5f')]:undefined)||_0xf9cf('0x68')},{'name':_0xf9cf('0x6d'),'value':_0x201d3c['attrSerie2']||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c[_0xf9cf('0x5e')][0x1]?_0x201d3c[_0xf9cf('0x5e')][0x1][_0xf9cf('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x201d3c[_0xf9cf('0x6e')]||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c[_0xf9cf('0x5e')][0x2]?_0x201d3c[_0xf9cf('0x5e')][0x2][_0xf9cf('0x5f')]:undefined)||null},{'name':_0xf9cf('0x69'),'value':_0x201d3c[_0xf9cf('0x69')]||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c[_0xf9cf('0x5e')][0x3]?_0x201d3c[_0xf9cf('0x5e')][0x3][_0xf9cf('0x5f')]:undefined)||[]}];case _0xf9cf('0x6f'):return[{'name':_0xf9cf('0x70'),'type':_0x201d3c[_0xf9cf('0x71')]||(_0x201d3c['attrs']&&_0x201d3c['attrs'][0x0]?_0x201d3c[_0xf9cf('0x5e')][0x0][_0xf9cf('0x31')]:undefined)||null,'value':_0x201d3c[_0xf9cf('0x70')]||(_0x201d3c['attrs']&&_0x201d3c[_0xf9cf('0x5e')][0x0]?_0x201d3c[_0xf9cf('0x5e')][0x0][_0xf9cf('0x5f')]:undefined)||null},{'name':_0xf9cf('0x72'),'value':_0x201d3c['attrRefresh']||(_0x201d3c[_0xf9cf('0x5e')]&&_0x201d3c['attrs'][0x1]?_0x201d3c[_0xf9cf('0x5e')][0x1][_0xf9cf('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x234735){logger[_0xf9cf('0x29')](_0xf9cf('0x73'),JSON[_0xf9cf('0x74')](_0x234735));return[];}}exports[_0xf9cf('0x75')]=function(_0x37c16b,_0x39ab1d,_0x1efb70){if(_0x37c16b[_0xf9cf('0x50')]['id']){delete _0x37c16b['body']['id'];}return db[_0xf9cf('0x2e')][_0xf9cf('0x4e')]({'where':{'id':_0x37c16b[_0xf9cf('0x4c')]['id']}})[_0xf9cf('0x24')](handleEntityNotFound(_0x39ab1d,null))[_0xf9cf('0x24')](function(_0x53cd48){if(_0x53cd48){_0x37c16b[_0xf9cf('0x50')]['DashboardId']=_0x53cd48['id'];_0x37c16b[_0xf9cf('0x50')]['attrs']=widgetAttributes(_0x37c16b[_0xf9cf('0x50')]);return db[_0xf9cf('0x76')][_0xf9cf('0x4f')](_0x37c16b[_0xf9cf('0x50')]);}})[_0xf9cf('0x24')](respondWithResult(_0x39ab1d,null))[_0xf9cf('0x4a')](handleError(_0x39ab1d,null));};exports[_0xf9cf('0x77')]=function(_0x427dfb,_0x28b4a1,_0x3c18e4){var _0x366534={};var _0x19e4a0={};var _0x156113;var _0x6769df;return db['Dashboard'][_0xf9cf('0x78')]({'where':{'id':_0x427dfb[_0xf9cf('0x4c')]['id']}})[_0xf9cf('0x24')](handleEntityNotFound(_0x28b4a1,null))[_0xf9cf('0x24')](function(_0x201faa){if(_0x201faa){_0x156113=_0x201faa;_0x19e4a0[_0xf9cf('0x33')]=_[_0xf9cf('0x36')](db[_0xf9cf('0x76')]['rawAttributes']);_0x19e4a0['query']=_[_0xf9cf('0x36')](_0x427dfb[_0xf9cf('0x35')]);_0x19e4a0['filters']=_[_0xf9cf('0x38')](_0x19e4a0['model'],_0x19e4a0['query']);_0x366534[_0xf9cf('0x39')]=_[_0xf9cf('0x38')](_0x19e4a0[_0xf9cf('0x33')],qs[_0xf9cf('0x3a')](_0x427dfb[_0xf9cf('0x35')][_0xf9cf('0x3a')]));_0x366534[_0xf9cf('0x39')]=_0x366534[_0xf9cf('0x39')][_0xf9cf('0x4d')]?_0x366534[_0xf9cf('0x39')]:_0x19e4a0[_0xf9cf('0x33')];_0x366534[_0xf9cf('0x3e')]=qs['sort'](_0x427dfb[_0xf9cf('0x35')][_0xf9cf('0x3f')]);_0x366534[_0xf9cf('0x40')]=qs[_0xf9cf('0x37')](_[_0xf9cf('0x41')](_0x427dfb[_0xf9cf('0x35')],_0x19e4a0[_0xf9cf('0x37')]));if(_0x427dfb['query']['filter']){_0x366534[_0xf9cf('0x40')]=_[_0xf9cf('0x43')](_0x366534[_0xf9cf('0x40')],{'$or':_[_0xf9cf('0x34')](_0x366534[_0xf9cf('0x39')],function(_0x1752d3){var _0x2ffe14={};_0x2ffe14[_0x1752d3]={'$like':'%'+_0x427dfb['query'][_0xf9cf('0x42')]+'%'};return _0x2ffe14;})});}_0x366534=_[_0xf9cf('0x43')]({},_0x366534,_0x427dfb[_0xf9cf('0x45')]);return _0x156113[_0xf9cf('0x77')](_0x366534);}})[_0xf9cf('0x24')](function(_0x37465d){if(_0x37465d){_0x6769df=_0x37465d[_0xf9cf('0x4d')];if(!_0x427dfb['query']['hasOwnProperty'](_0xf9cf('0x3c'))){_0x366534['limit']=qs[_0xf9cf('0x1e')](_0x427dfb[_0xf9cf('0x35')][_0xf9cf('0x1e')]);_0x366534['offset']=qs[_0xf9cf('0x3d')](_0x427dfb[_0xf9cf('0x35')][_0xf9cf('0x3d')]);}return _0x156113[_0xf9cf('0x77')](_0x366534);}})[_0xf9cf('0x24')](function(_0x4cd63f){if(_0x4cd63f){return _0x4cd63f?{'count':_0x6769df,'rows':_0x4cd63f}:null;}})[_0xf9cf('0x24')](respondWithResult(_0x28b4a1,null))[_0xf9cf('0x4a')](handleError(_0x28b4a1,null));};
\ No newline at end of file
+var _0xaf92=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','keys','fields','include','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x3a13ab,_0x114561){var _0x12d5c7=function(_0x54f0be){while(--_0x54f0be){_0x3a13ab['push'](_0x3a13ab['shift']());}};_0x12d5c7(++_0x114561);}(_0xaf92,0x67));var _0x2af9=function(_0x5cab26,_0x40d7bf){_0x5cab26=_0x5cab26-0x0;var _0x23e642=_0xaf92[_0x5cab26];return _0x23e642;};'use strict';var pdf=require(_0x2af9('0x0'));var emlformat=require(_0x2af9('0x1'));var rimraf=require(_0x2af9('0x2'));var zipdir=require(_0x2af9('0x3'));var jsonpatch=require(_0x2af9('0x4'));var rp=require(_0x2af9('0x5'));var moment=require(_0x2af9('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x2af9('0x7'));var util=require(_0x2af9('0x8'));var path=require(_0x2af9('0x9'));var sox=require('sox');var csv=require(_0x2af9('0xa'));var ejs=require(_0x2af9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2af9('0xc'));var crypto=require(_0x2af9('0xd'));var jsforce=require(_0x2af9('0xe'));var deskjs=require(_0x2af9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2af9('0x10'));var Papa=require(_0x2af9('0x11'));var Redis=require(_0x2af9('0x12'));var authService=require(_0x2af9('0x13'));var qs=require(_0x2af9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2af9('0x15'));var logger=require(_0x2af9('0x16'))(_0x2af9('0x17'));var utils=require(_0x2af9('0x18'));var config=require(_0x2af9('0x19'));var db=require(_0x2af9('0x1a'))['db'];config[_0x2af9('0x1b')]=_[_0x2af9('0x1c')](config[_0x2af9('0x1b')],{'host':_0x2af9('0x1d'),'port':0x18eb});var socket=require(_0x2af9('0x1e'))(new Redis(config[_0x2af9('0x1b')]));require(_0x2af9('0x1f'))[_0x2af9('0x20')](socket);function respondWithStatusCode(_0x24b58f,_0x26b86c){_0x26b86c=_0x26b86c||0xcc;return function(_0x38cc87){if(_0x38cc87){return _0x24b58f[_0x2af9('0x21')](_0x26b86c);}return _0x24b58f['status'](_0x26b86c)[_0x2af9('0x22')]();};}function respondWithResult(_0x5f3316,_0x23a950){_0x23a950=_0x23a950||0xc8;return function(_0x53af25){if(_0x53af25){return _0x5f3316[_0x2af9('0x23')](_0x23a950)[_0x2af9('0x24')](_0x53af25);}};}function respondWithFilteredResult(_0x53bb19,_0x2ff658){return function(_0x46fa23){if(_0x46fa23){var _0xe5e4c1=_0x46fa23[_0x2af9('0x25')],_0x5c459c=_0x2ff658[_0x2af9('0x26')],_0x3698ae=_0x2ff658['offset']+_0x2ff658[_0x2af9('0x27')],_0x1eb9f1;if(_0x3698ae>=_0xe5e4c1){_0x3698ae=_0xe5e4c1;_0x1eb9f1=0xc8;}else{_0x1eb9f1=0xce;}_0x53bb19[_0x2af9('0x23')](_0x1eb9f1);return _0x53bb19[_0x2af9('0x28')](_0x2af9('0x29'),_0x5c459c+'-'+_0x3698ae+'/'+_0xe5e4c1)[_0x2af9('0x24')](_0x46fa23);}return null;};}function patchUpdates(_0x4f7a20){return function(_0x54b194){try{jsonpatch[_0x2af9('0x2a')](_0x54b194,_0x4f7a20,!![]);}catch(_0x34f5e1){return BPromise[_0x2af9('0x2b')](_0x34f5e1);}return _0x54b194[_0x2af9('0x2c')]();};}function saveUpdates(_0x517979,_0x403469){return function(_0x308a68){if(_0x308a68){return _0x308a68[_0x2af9('0x2d')](_0x517979)[_0x2af9('0x2e')](function(_0x6923b3){return _0x6923b3;});}return null;};}function removeEntity(_0x73d26d,_0x528be7){return function(_0x4058b5){if(_0x4058b5){return _0x4058b5[_0x2af9('0x2f')]()['then'](function(){var _0x521b67=_0x4058b5[_0x2af9('0x30')]({'plain':!![]});var _0x24eba2=_0x2af9('0x31');return db[_0x2af9('0x32')][_0x2af9('0x2f')]({'where':{'type':_0x24eba2,'resourceId':_0x521b67['id']}})['then'](function(){return _0x4058b5;});})['then'](function(){_0x73d26d[_0x2af9('0x23')](0xcc)[_0x2af9('0x22')]();});}};}function handleEntityNotFound(_0x2c1eec,_0x304dba){return function(_0x24b60e){if(!_0x24b60e){_0x2c1eec[_0x2af9('0x21')](0x194);}return _0x24b60e;};}function handleError(_0x5abf6b,_0x5d789c){_0x5d789c=_0x5d789c||0x1f4;return function(_0x3d7588){logger[_0x2af9('0x33')](_0x3d7588['stack']);if(_0x3d7588[_0x2af9('0x34')]){delete _0x3d7588[_0x2af9('0x34')];}_0x5abf6b[_0x2af9('0x23')](_0x5d789c)[_0x2af9('0x35')](_0x3d7588);};}exports[_0x2af9('0x36')]=function(_0x4f148d,_0x333295){var _0x48aae8={},_0x48a93f={},_0x370f2f={'count':0x0,'rows':[]};var _0x10c901=_[_0x2af9('0x37')](db[_0x2af9('0x38')][_0x2af9('0x39')],function(_0x19305){return{'name':_0x19305[_0x2af9('0x3a')],'type':_0x19305[_0x2af9('0x3b')][_0x2af9('0x3c')]};});_0x48a93f['model']=_[_0x2af9('0x37')](_0x10c901,'name');_0x48a93f['query']=_['keys'](_0x4f148d[_0x2af9('0x3d')]);_0x48a93f['filters']=_['intersection'](_0x48a93f[_0x2af9('0x3e')],_0x48a93f[_0x2af9('0x3d')]);_0x48aae8[_0x2af9('0x3f')]=_[_0x2af9('0x40')](_0x48a93f['model'],qs['fields'](_0x4f148d['query']['fields']));_0x48aae8['attributes']=_0x48aae8['attributes'][_0x2af9('0x41')]?_0x48aae8[_0x2af9('0x3f')]:_0x48a93f[_0x2af9('0x3e')];if(!_0x4f148d[_0x2af9('0x3d')][_0x2af9('0x42')](_0x2af9('0x43'))){_0x48aae8[_0x2af9('0x27')]=qs['limit'](_0x4f148d[_0x2af9('0x3d')][_0x2af9('0x27')]);_0x48aae8[_0x2af9('0x26')]=qs['offset'](_0x4f148d[_0x2af9('0x3d')]['offset']);}_0x48aae8[_0x2af9('0x44')]=qs[_0x2af9('0x45')](_0x4f148d['query'][_0x2af9('0x45')]);_0x48aae8['where']=qs[_0x2af9('0x46')](_[_0x2af9('0x47')](_0x4f148d[_0x2af9('0x3d')],_0x48a93f[_0x2af9('0x46')]),_0x10c901);if(_0x4f148d[_0x2af9('0x3d')][_0x2af9('0x48')]){_0x48aae8[_0x2af9('0x49')]=_[_0x2af9('0x4a')](_0x48aae8['where'],{'$or':_[_0x2af9('0x37')](_0x10c901,function(_0xe721d5){if(_0xe721d5[_0x2af9('0x3b')]!=='VIRTUAL'){var _0x3dd1e1={};_0x3dd1e1[_0xe721d5[_0x2af9('0x34')]]={'$like':'%'+_0x4f148d[_0x2af9('0x3d')][_0x2af9('0x48')]+'%'};return _0x3dd1e1;}})});}_0x48aae8=_['merge']({},_0x48aae8,_0x4f148d[_0x2af9('0x4b')]);var _0x1f9c41={'where':_0x48aae8[_0x2af9('0x49')]};return db[_0x2af9('0x38')]['count'](_0x1f9c41)[_0x2af9('0x2e')](function(_0x48a99a){_0x370f2f[_0x2af9('0x25')]=_0x48a99a;if(_0x4f148d[_0x2af9('0x3d')][_0x2af9('0x4c')]){_0x48aae8['include']=[{'all':!![]}];}return db['Dashboard'][_0x2af9('0x4d')](_0x48aae8);})[_0x2af9('0x2e')](function(_0x3f914f){_0x370f2f[_0x2af9('0x4e')]=_0x3f914f;return _0x370f2f;})[_0x2af9('0x2e')](respondWithFilteredResult(_0x333295,_0x48aae8))[_0x2af9('0x4f')](handleError(_0x333295,null));};exports[_0x2af9('0x50')]=function(_0x2ebab2,_0x37bc50){var _0x5e9f7d={'raw':![],'where':{'id':_0x2ebab2[_0x2af9('0x51')]['id']}},_0x107761={};_0x107761[_0x2af9('0x3e')]=_['keys'](db[_0x2af9('0x38')][_0x2af9('0x39')]);_0x107761['query']=_[_0x2af9('0x52')](_0x2ebab2[_0x2af9('0x3d')]);_0x107761[_0x2af9('0x46')]=_[_0x2af9('0x40')](_0x107761[_0x2af9('0x3e')],_0x107761[_0x2af9('0x3d')]);_0x5e9f7d[_0x2af9('0x3f')]=_[_0x2af9('0x40')](_0x107761[_0x2af9('0x3e')],qs[_0x2af9('0x53')](_0x2ebab2['query'][_0x2af9('0x53')]));_0x5e9f7d[_0x2af9('0x3f')]=_0x5e9f7d['attributes'][_0x2af9('0x41')]?_0x5e9f7d[_0x2af9('0x3f')]:_0x107761['model'];if(_0x2ebab2[_0x2af9('0x3d')][_0x2af9('0x4c')]){_0x5e9f7d[_0x2af9('0x54')]=[{'all':!![]}];}_0x5e9f7d=_[_0x2af9('0x4a')]({},_0x5e9f7d,_0x2ebab2['options']);return db[_0x2af9('0x38')]['find'](_0x5e9f7d)[_0x2af9('0x2e')](handleEntityNotFound(_0x37bc50,null))[_0x2af9('0x2e')](respondWithResult(_0x37bc50,null))[_0x2af9('0x4f')](handleError(_0x37bc50,null));};exports['create']=function(_0x59dbbb,_0x17ff2c){return db[_0x2af9('0x38')][_0x2af9('0x55')](_0x59dbbb[_0x2af9('0x56')],{})['then'](function(_0x5b25e4){var _0x377853=_0x59dbbb[_0x2af9('0x57')][_0x2af9('0x30')]({'plain':!![]});if(!_0x377853)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x377853[_0x2af9('0x58')]===_0x2af9('0x57')){var _0x5c1e91=_0x5b25e4[_0x2af9('0x30')]({'plain':!![]});var _0x27c399=_0x2af9('0x31');return db['UserProfileSection']['find']({'where':{'name':_0x27c399,'userProfileId':_0x377853[_0x2af9('0x59')]},'raw':!![]})[_0x2af9('0x2e')](function(_0x1bef27){if(_0x1bef27&&_0x1bef27[_0x2af9('0x5a')]===0x0){return db[_0x2af9('0x32')]['create']({'name':_0x5c1e91['name'],'resourceId':_0x5c1e91['id'],'type':_0x1bef27[_0x2af9('0x34')],'sectionId':_0x1bef27['id']},{})['then'](function(){return _0x5b25e4;});}else{return _0x5b25e4;}})[_0x2af9('0x4f')](function(_0x576bd8){logger['error'](_0x2af9('0x5b'),_0x576bd8);throw _0x576bd8;});}return _0x5b25e4;})[_0x2af9('0x2e')](respondWithResult(_0x17ff2c,0xc9))['catch'](handleError(_0x17ff2c,null));};exports[_0x2af9('0x5c')]=function(_0x94c7d2,_0xc3bbd8){var _0x5d9a55={'where':{'id':_0x94c7d2['params']['id']}},_0x357abe={};_0x357abe[_0x2af9('0x3e')]=_['keys'](db[_0x2af9('0x38')][_0x2af9('0x39')]);_0x5d9a55['attributes']=_[_0x2af9('0x40')](_0x357abe[_0x2af9('0x3e')],qs[_0x2af9('0x53')](_0x94c7d2[_0x2af9('0x3d')][_0x2af9('0x53')]));_0x5d9a55[_0x2af9('0x3f')]=_0x5d9a55[_0x2af9('0x3f')][_0x2af9('0x41')]?_0x5d9a55['attributes']:_0x357abe['model'];if(_0x94c7d2['query'][_0x2af9('0x4c')]){_0x5d9a55[_0x2af9('0x54')]=[{'all':!![]}];}_0x5d9a55=_[_0x2af9('0x4a')]({},_0x5d9a55,_0x94c7d2[_0x2af9('0x4b')]);return db[_0x2af9('0x38')][_0x2af9('0x5d')](_0x5d9a55)[_0x2af9('0x2e')](handleEntityNotFound(_0xc3bbd8,null))['then'](function(_0x3fda86){if(_0x3fda86){var _0x216421=_0x3fda86[_0x2af9('0x30')]({'plain':!![]});_0x216421=qs[_0x2af9('0x5e')](_0x216421,['id',_0x2af9('0x5f'),'updatedAt']);_0x94c7d2[_0x2af9('0x56')]=_[_0x2af9('0x5e')](_0x94c7d2[_0x2af9('0x56')],['id','createdAt',_0x2af9('0x60')]);return db[_0x2af9('0x38')]['create'](_[_0x2af9('0x4a')](_0x216421,_0x94c7d2[_0x2af9('0x56')]),{'include':_0x94c7d2[_0x2af9('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0x2af9('0x2e')](function(_0x58bf88){var _0x120527=_0x94c7d2[_0x2af9('0x57')][_0x2af9('0x30')]({'plain':!![]});if(!_0x120527)throw new Error(_0x2af9('0x61'));if(_0x120527[_0x2af9('0x58')]===_0x2af9('0x57')){var _0xabe691=_0x58bf88['get']({'plain':!![]});var _0x4789c6=_0x2af9('0x31');return db['UserProfileSection'][_0x2af9('0x5d')]({'where':{'name':_0x4789c6,'userProfileId':_0x120527[_0x2af9('0x59')]},'raw':!![]})['then'](function(_0x2856a3){if(_0x2856a3&&_0x2856a3[_0x2af9('0x5a')]===0x0){return db[_0x2af9('0x32')][_0x2af9('0x55')]({'name':_0xabe691[_0x2af9('0x34')],'resourceId':_0xabe691['id'],'type':_0x2856a3[_0x2af9('0x34')],'sectionId':_0x2856a3['id']},{})['then'](function(){return _0x58bf88;});}else{return _0x58bf88;}})[_0x2af9('0x4f')](function(_0x524066){logger[_0x2af9('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x524066);throw _0x524066;});}return _0x58bf88;});}})[_0x2af9('0x2e')](respondWithResult(_0xc3bbd8,0xc9))[_0x2af9('0x4f')](handleError(_0xc3bbd8,null));};exports['update']=function(_0x2f187c,_0x3efbc9){if(_0x2f187c[_0x2af9('0x56')]['id']){delete _0x2f187c[_0x2af9('0x56')]['id'];}return db['Dashboard'][_0x2af9('0x5d')]({'where':{'id':_0x2f187c['params']['id']}})['then'](handleEntityNotFound(_0x3efbc9,null))[_0x2af9('0x2e')](saveUpdates(_0x2f187c[_0x2af9('0x56')],null))[_0x2af9('0x2e')](respondWithResult(_0x3efbc9,null))[_0x2af9('0x4f')](handleError(_0x3efbc9,null));};exports[_0x2af9('0x2f')]=function(_0x2ffe45,_0x4c2d08){return db[_0x2af9('0x38')][_0x2af9('0x5d')]({'where':{'id':_0x2ffe45[_0x2af9('0x51')]['id']}})[_0x2af9('0x2e')](handleEntityNotFound(_0x4c2d08,null))[_0x2af9('0x2e')](removeEntity(_0x4c2d08,null))[_0x2af9('0x4f')](handleError(_0x4c2d08,null));};function widgetAttributes(_0x4915cc){try{switch(_0x4915cc[_0x2af9('0x3b')]){case _0x2af9('0x62'):return[{'name':_0x2af9('0x63'),'value':_0x4915cc[_0x2af9('0x63')]||(_0x4915cc['attrs']&&_0x4915cc['attrs'][0x0]?_0x4915cc[_0x2af9('0x64')][0x0][_0x2af9('0x65')]:undefined)||'https://'}];case _0x2af9('0x66'):return[{'name':_0x2af9('0x67'),'value':_0x4915cc['attrPath']||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc['attrs'][0x0]?_0x4915cc[_0x2af9('0x64')][0x0][_0x2af9('0x65')]:undefined)||''}];case _0x2af9('0x68'):return[{'name':'attrHourFormat','value':_0x4915cc[_0x2af9('0x69')]||(_0x4915cc['attrs']&&_0x4915cc[_0x2af9('0x64')][0x0]?_0x4915cc[_0x2af9('0x64')][0x0]['value']:undefined)||_0x2af9('0x6a')},{'name':_0x2af9('0x6b'),'value':_0x4915cc[_0x2af9('0x6b')]||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x1]?_0x4915cc[_0x2af9('0x64')][0x1][_0x2af9('0x65')]:undefined)||_0x2af9('0x6c')},{'name':_0x2af9('0x6d'),'value':_0x4915cc['attrFontSize']||(_0x4915cc['attrs']&&_0x4915cc[_0x2af9('0x64')][0x2]?_0x4915cc[_0x2af9('0x64')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x2af9('0x6e'),'value':_0x4915cc[_0x2af9('0x6e')]||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x0]?_0x4915cc[_0x2af9('0x64')][0x0][_0x2af9('0x65')]:undefined)||'total'},{'name':_0x2af9('0x6f'),'value':_0x4915cc['attrVoiceQueues']||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x1]?_0x4915cc[_0x2af9('0x64')][0x1][_0x2af9('0x65')]:undefined)||[]},{'name':_0x2af9('0x6d'),'value':_0x4915cc[_0x2af9('0x6d')]||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x2]?_0x4915cc[_0x2af9('0x64')][0x2][_0x2af9('0x65')]:undefined)||0x14}];case'multibar-chart':case _0x2af9('0x70'):return[{'name':_0x2af9('0x71'),'value':_0x4915cc['attrSerie1']||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc['attrs'][0x0]?_0x4915cc['attrs'][0x0]['value']:undefined)||_0x2af9('0x72')},{'name':'attrSerie2','value':_0x4915cc[_0x2af9('0x73')]||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x1]?_0x4915cc[_0x2af9('0x64')][0x1][_0x2af9('0x65')]:undefined)||null},{'name':_0x2af9('0x74'),'value':_0x4915cc[_0x2af9('0x74')]||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x2]?_0x4915cc['attrs'][0x2][_0x2af9('0x65')]:undefined)||null},{'name':_0x2af9('0x6f'),'value':_0x4915cc['attrVoiceQueues']||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x3]?_0x4915cc[_0x2af9('0x64')][0x3][_0x2af9('0x65')]:undefined)||[]}];case _0x2af9('0x75'):return[{'name':_0x2af9('0x76'),'type':_0x4915cc[_0x2af9('0x77')]||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x0]?_0x4915cc[_0x2af9('0x64')][0x0][_0x2af9('0x3b')]:undefined)||null,'value':_0x4915cc[_0x2af9('0x76')]||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x0]?_0x4915cc[_0x2af9('0x64')][0x0]['value']:undefined)||null},{'name':_0x2af9('0x78'),'value':_0x4915cc[_0x2af9('0x78')]||(_0x4915cc[_0x2af9('0x64')]&&_0x4915cc[_0x2af9('0x64')][0x1]?_0x4915cc[_0x2af9('0x64')][0x1][_0x2af9('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x330904){logger[_0x2af9('0x33')](_0x2af9('0x79'),JSON[_0x2af9('0x7a')](_0x330904));return[];}}exports[_0x2af9('0x7b')]=function(_0x4d6a9b,_0x473c7f,_0x258786){if(_0x4d6a9b[_0x2af9('0x56')]['id']){delete _0x4d6a9b[_0x2af9('0x56')]['id'];}return db[_0x2af9('0x38')][_0x2af9('0x5d')]({'where':{'id':_0x4d6a9b[_0x2af9('0x51')]['id']}})[_0x2af9('0x2e')](handleEntityNotFound(_0x473c7f,null))[_0x2af9('0x2e')](function(_0x49c756){if(_0x49c756){_0x4d6a9b['body']['DashboardId']=_0x49c756['id'];_0x4d6a9b[_0x2af9('0x56')][_0x2af9('0x64')]=widgetAttributes(_0x4d6a9b['body']);return db[_0x2af9('0x7c')][_0x2af9('0x55')](_0x4d6a9b['body']);}})[_0x2af9('0x2e')](respondWithResult(_0x473c7f,null))[_0x2af9('0x4f')](handleError(_0x473c7f,null));};exports[_0x2af9('0x7d')]=function(_0x43685f,_0x4bd7a3,_0x38ad54){var _0x3e2417={};var _0x46831f={};var _0xbdc47e;var _0x5dd88c;return db[_0x2af9('0x38')]['findOne']({'where':{'id':_0x43685f['params']['id']}})['then'](handleEntityNotFound(_0x4bd7a3,null))[_0x2af9('0x2e')](function(_0x23572d){if(_0x23572d){_0xbdc47e=_0x23572d;_0x46831f[_0x2af9('0x3e')]=_[_0x2af9('0x52')](db[_0x2af9('0x7c')][_0x2af9('0x39')]);_0x46831f[_0x2af9('0x3d')]=_[_0x2af9('0x52')](_0x43685f[_0x2af9('0x3d')]);_0x46831f[_0x2af9('0x46')]=_[_0x2af9('0x40')](_0x46831f[_0x2af9('0x3e')],_0x46831f[_0x2af9('0x3d')]);_0x3e2417['attributes']=_[_0x2af9('0x40')](_0x46831f[_0x2af9('0x3e')],qs['fields'](_0x43685f['query'][_0x2af9('0x53')]));_0x3e2417[_0x2af9('0x3f')]=_0x3e2417['attributes']['length']?_0x3e2417['attributes']:_0x46831f[_0x2af9('0x3e')];_0x3e2417[_0x2af9('0x44')]=qs['sort'](_0x43685f[_0x2af9('0x3d')][_0x2af9('0x45')]);_0x3e2417[_0x2af9('0x49')]=qs[_0x2af9('0x46')](_[_0x2af9('0x47')](_0x43685f[_0x2af9('0x3d')],_0x46831f['filters']));if(_0x43685f[_0x2af9('0x3d')][_0x2af9('0x48')]){_0x3e2417['where']=_[_0x2af9('0x4a')](_0x3e2417['where'],{'$or':_[_0x2af9('0x37')](_0x3e2417[_0x2af9('0x3f')],function(_0xcaf9d9){var _0x36bea2={};_0x36bea2[_0xcaf9d9]={'$like':'%'+_0x43685f[_0x2af9('0x3d')][_0x2af9('0x48')]+'%'};return _0x36bea2;})});}_0x3e2417=_[_0x2af9('0x4a')]({},_0x3e2417,_0x43685f['options']);return _0xbdc47e[_0x2af9('0x7d')](_0x3e2417);}})['then'](function(_0x269f92){if(_0x269f92){_0x5dd88c=_0x269f92[_0x2af9('0x41')];if(!_0x43685f['query'][_0x2af9('0x42')](_0x2af9('0x43'))){_0x3e2417[_0x2af9('0x27')]=qs[_0x2af9('0x27')](_0x43685f[_0x2af9('0x3d')][_0x2af9('0x27')]);_0x3e2417[_0x2af9('0x26')]=qs[_0x2af9('0x26')](_0x43685f[_0x2af9('0x3d')][_0x2af9('0x26')]);}return _0xbdc47e[_0x2af9('0x7d')](_0x3e2417);}})['then'](function(_0x218e79){if(_0x218e79){return _0x218e79?{'count':_0x5dd88c,'rows':_0x218e79}:null;}})[_0x2af9('0x2e')](respondWithResult(_0x4bd7a3,null))[_0x2af9('0x4f')](handleError(_0x4bd7a3,null));};
\ No newline at end of file
index c1c511f..8534d09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0da=['events','Dashboard','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x1fb2f6,_0x3e5f87){var _0x229fd8=function(_0x462d42){while(--_0x462d42){_0x1fb2f6['push'](_0x1fb2f6['shift']());}};_0x229fd8(++_0x3e5f87);}(_0xa0da,0x1d8));var _0xaa0d=function(_0x4975f8,_0x3a226c){_0x4975f8=_0x4975f8-0x0;var _0x86d59f=_0xa0da[_0x4975f8];return _0x86d59f;};'use strict';var EventEmitter=require(_0xaa0d('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xaa0d('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaa0d('0x2'),'afterUpdate':_0xaa0d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x477dd4){return function(_0x2ec240,_0x2aed58,_0x13ca82){DashboardEvents[_0xaa0d('0x4')](_0x477dd4+':'+_0x2ec240['id'],_0x2ec240);DashboardEvents[_0xaa0d('0x4')](_0x477dd4,_0x2ec240);_0x13ca82(null);};}for(var e in events){if(events[_0xaa0d('0x5')](e)){var event=events[e];Dashboard[_0xaa0d('0x6')](e,emitEvent(event));}}module[_0xaa0d('0x7')]=DashboardEvents;
\ No newline at end of file
+var _0x9560=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5e7164,_0x504bc5){var _0xa0d06e=function(_0x45fc6a){while(--_0x45fc6a){_0x5e7164['push'](_0x5e7164['shift']());}};_0xa0d06e(++_0x504bc5);}(_0x9560,0x1b9));var _0x0956=function(_0x3d7fb5,_0x16eb5c){_0x3d7fb5=_0x3d7fb5-0x0;var _0x3a9642=_0x9560[_0x3d7fb5];return _0x3a9642;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x0956('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x0956('0x1')](0x0);var events={'afterCreate':_0x0956('0x2'),'afterUpdate':_0x0956('0x3'),'afterDestroy':_0x0956('0x4')};function emitEvent(_0x3fa3c3){return function(_0x5f3a66,_0x5343ec,_0x3165fd){DashboardEvents[_0x0956('0x5')](_0x3fa3c3+':'+_0x5f3a66['id'],_0x5f3a66);DashboardEvents[_0x0956('0x5')](_0x3fa3c3,_0x5f3a66);_0x3165fd(null);};}for(var e in events){if(events[_0x0956('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x0956('0x7')]=DashboardEvents;
\ No newline at end of file
index 3737bbe..75bfecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf21e=['exports','define','dashboards','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x464878,_0x4e8aa2){var _0x10b6ac=function(_0xb57696){while(--_0xb57696){_0x464878['push'](_0x464878['shift']());}};_0x10b6ac(++_0x4e8aa2);}(_0xf21e,0xa3));var _0xef21=function(_0x2c7092,_0x862a2f){_0x2c7092=_0x2c7092-0x0;var _0x4fa921=_0xf21e[_0x2c7092];return _0x4fa921;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xef21('0x0'))(_0xef21('0x1'));var moment=require(_0xef21('0x2'));var BPromise=require(_0xef21('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef21('0x4'));var rimraf=require(_0xef21('0x5'));var config=require(_0xef21('0x6'));var attributes=require('./dashboard.attributes');module[_0xef21('0x7')]=function(_0x3783de,_0x3f8f6e){return _0x3783de[_0xef21('0x8')]('Dashboard',attributes,{'tableName':_0xef21('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2e97=['moment','bluebird','request-promise','path','exports','define','Dashboard','dashboards','lodash','api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2e97,0x198));var _0x72e9=function(_0x97801c,_0xe28a34){_0x97801c=_0x97801c-0x0;var _0x27388c=_0x2e97[_0x97801c];return _0x27388c;};'use strict';var _=require(_0x72e9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x72e9('0x1'));var moment=require(_0x72e9('0x2'));var BPromise=require(_0x72e9('0x3'));var rp=require(_0x72e9('0x4'));var fs=require('fs');var path=require(_0x72e9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x72e9('0x6')]=function(_0x1ee38b,_0x5c537e){return _0x1ee38b[_0x72e9('0x7')](_0x72e9('0x8'),attributes,{'tableName':_0x72e9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e2f7169..e4a700c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99a3=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./dashboard.socket','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x1b34b3,_0x1a2616){var _0x261837=function(_0x389dd7){while(--_0x389dd7){_0x1b34b3['push'](_0x1b34b3['shift']());}};_0x261837(++_0x1a2616);}(_0x99a3,0x14b));var _0x399a=function(_0x51219c,_0x34f627){_0x51219c=_0x51219c-0x0;var _0x32e126=_0x99a3[_0x51219c];return _0x32e126;};'use strict';var _=require(_0x399a('0x0'));var util=require(_0x399a('0x1'));var moment=require(_0x399a('0x2'));var BPromise=require(_0x399a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x399a('0x4'));var db=require(_0x399a('0x5'))['db'];var utils=require(_0x399a('0x6'));var logger=require('../../config/logger')(_0x399a('0x7'));var config=require('../../config/environment');var jayson=require(_0x399a('0x8'));var client=jayson[_0x399a('0x9')][_0x399a('0xa')]({'port':0x232a});config[_0x399a('0xb')]=_[_0x399a('0xc')](config['redis'],{'host':_0x399a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x399a('0xb')]));require(_0x399a('0xe'))['register'](socket);function respondWithRpcPromise(_0x441686,_0x28fcfb,_0x55bd1e){return new BPromise(function(_0x3efdfb,_0x2b9716){return client['request'](_0x441686,_0x55bd1e)['then'](function(_0x103ff0){logger[_0x399a('0xf')](_0x399a('0x10'),_0x28fcfb,_0x399a('0x11'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x28fcfb,'request\x20sent',JSON[_0x399a('0x12')](_0x103ff0));if(_0x103ff0[_0x399a('0x13')]){if(_0x103ff0[_0x399a('0x13')][_0x399a('0x14')]===0x1f4){logger[_0x399a('0x13')]('Dashboard,\x20%s,\x20%s',_0x28fcfb,_0x103ff0[_0x399a('0x13')][_0x399a('0x15')]);return _0x2b9716(_0x103ff0['error'][_0x399a('0x15')]);}logger[_0x399a('0x13')]('Dashboard,\x20%s,\x20%s',_0x28fcfb,_0x103ff0[_0x399a('0x13')][_0x399a('0x15')]);return _0x3efdfb(_0x103ff0[_0x399a('0x13')][_0x399a('0x15')]);}else{logger[_0x399a('0xf')](_0x399a('0x10'),_0x28fcfb,_0x399a('0x11'));_0x3efdfb(_0x103ff0[_0x399a('0x16')][_0x399a('0x15')]);}})[_0x399a('0x17')](function(_0x2a4338){logger[_0x399a('0x13')](_0x399a('0x10'),_0x28fcfb,_0x2a4338);_0x2b9716(_0x2a4338);});});}
\ No newline at end of file
+var _0xa04f=['http','redis','defaults','localhost','./dashboard.socket','register','request','then','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','info','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5c3724,_0x4f1f25){var _0x52bc38=function(_0x114287){while(--_0x114287){_0x5c3724['push'](_0x5c3724['shift']());}};_0x52bc38(++_0x4f1f25);}(_0xa04f,0x9a));var _0xfa04=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xa04f[_0x1e7b16];return _0x37fadc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa04('0x0'));var BPromise=require(_0xfa04('0x1'));var rs=require(_0xfa04('0x2'));var fs=require('fs');var Redis=require(_0xfa04('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa04('0x4'));var logger=require(_0xfa04('0x5'))('rpc');var config=require(_0xfa04('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa04('0x7')]({'port':0x232a});config[_0xfa04('0x8')]=_[_0xfa04('0x9')](config['redis'],{'host':_0xfa04('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa04('0x8')]));require(_0xfa04('0xb'))[_0xfa04('0xc')](socket);function respondWithRpcPromise(_0x362568,_0x505454,_0x2000a7){return new BPromise(function(_0x5215e5,_0x1f5fba){return client[_0xfa04('0xd')](_0x362568,_0x2000a7)[_0xfa04('0xe')](function(_0x40c86f){logger['info']('Dashboard,\x20%s,\x20%s',_0x505454,_0xfa04('0xf'));logger['debug'](_0xfa04('0x10'),_0x505454,_0xfa04('0xf'),JSON[_0xfa04('0x11')](_0x40c86f));if(_0x40c86f[_0xfa04('0x12')]){if(_0x40c86f[_0xfa04('0x12')][_0xfa04('0x13')]===0x1f4){logger['error'](_0xfa04('0x14'),_0x505454,_0x40c86f[_0xfa04('0x12')][_0xfa04('0x15')]);return _0x1f5fba(_0x40c86f[_0xfa04('0x12')][_0xfa04('0x15')]);}logger['error'](_0xfa04('0x14'),_0x505454,_0x40c86f[_0xfa04('0x12')][_0xfa04('0x15')]);return _0x5215e5(_0x40c86f[_0xfa04('0x12')][_0xfa04('0x15')]);}else{logger[_0xfa04('0x16')]('Dashboard,\x20%s,\x20%s',_0x505454,_0xfa04('0xf'));_0x5215e5(_0x40c86f['result'][_0xfa04('0x15')]);}})['catch'](function(_0x5cc591){logger[_0xfa04('0x12')](_0xfa04('0x14'),_0x505454,_0x5cc591);_0x1f5fba(_0x5cc591);});});}
\ No newline at end of file
index 7c0dad3..bde4d33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe60e=['emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove','update'];(function(_0x4f7380,_0x1655a2){var _0x8e4637=function(_0x33c920){while(--_0x33c920){_0x4f7380['push'](_0x4f7380['shift']());}};_0x8e4637(++_0x1655a2);}(_0xe60e,0x1f4));var _0xee60=function(_0x121c57,_0x37d536){_0x121c57=_0x121c57-0x0;var _0x1d8eae=_0xe60e[_0x121c57];return _0x1d8eae;};'use strict';var DashboardEvents=require(_0xee60('0x0'));var events=[_0xee60('0x1'),_0xee60('0x2'),_0xee60('0x3')];function createListener(_0x321385,_0x17937a){return function(_0x106e05){_0x17937a[_0xee60('0x4')](_0x321385,_0x106e05);};}function removeListener(_0x53791c,_0x5066de){return function(){DashboardEvents[_0xee60('0x5')](_0x53791c,_0x5066de);};}exports[_0xee60('0x6')]=function(_0x32ed71){for(var _0xd7bc4b=0x0,_0x26b604=events[_0xee60('0x7')];_0xd7bc4b<_0x26b604;_0xd7bc4b++){var _0x5e97c6=events[_0xd7bc4b];var _0x4172bc=createListener(_0xee60('0x8')+_0x5e97c6,_0x32ed71);DashboardEvents['on'](_0x5e97c6,_0x4172bc);}};
\ No newline at end of file
+var _0xbbd2=['update','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0xbbd2,0xbf));var _0x2bbd=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0xbbd2[_0xef4ef0];return _0x39b60b;};'use strict';var DashboardEvents=require(_0x2bbd('0x0'));var events=['save','remove',_0x2bbd('0x1')];function createListener(_0xecb4d6,_0x2b65b1){return function(_0x36ea02){_0x2b65b1['emit'](_0xecb4d6,_0x36ea02);};}function removeListener(_0x33c7bb,_0x4b8879){return function(){DashboardEvents[_0x2bbd('0x2')](_0x33c7bb,_0x4b8879);};}exports[_0x2bbd('0x3')]=function(_0x3ac425){for(var _0x10671e=0x0,_0xa2481d=events[_0x2bbd('0x4')];_0x10671e<_0xa2481d;_0x10671e++){var _0x3c0904=events[_0x10671e];var _0x3692d9=createListener(_0x2bbd('0x5')+_0x3c0904,_0x3ac425);DashboardEvents['on'](_0x3c0904,_0x3692d9);}};
\ No newline at end of file
index 24092f7..47422ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['/:id','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x3311a6,_0x82474c){var _0x5e8c41=function(_0x3c28b7){while(--_0x3c28b7){_0x3311a6['push'](_0x3311a6['shift']());}};_0x5e8c41(++_0x82474c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xb')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller['clone']);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);module[_0x0a9e('0x13')]=router;
\ No newline at end of file
+var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update'];(function(_0x30562a,_0x16f80d){var _0x453a7e=function(_0x92baa4){while(--_0x92baa4){_0x30562a['push'](_0x30562a['shift']());}};_0x453a7e(++_0x16f80d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['clone']);router[_0x3071('0xf')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x14')]=router;
\ No newline at end of file
index fd4a9cb..6e45597 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb609=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x37d1dd,_0x328b44){var _0x49539d=function(_0x381aa5){while(--_0x381aa5){_0x37d1dd['push'](_0x37d1dd['shift']());}};_0x49539d(++_0x328b44);}(_0xb609,0x95));var _0x9b60=function(_0x286429,_0xb7f89){_0x286429=_0x286429-0x0;var _0x37b120=_0xb609[_0x286429];return _0x37b120;};'use strict';var Sequelize=require(_0x9b60('0x0'));var squel=require(_0x9b60('0x1'));var _=require(_0x9b60('0x2'));module[_0x9b60('0x3')]={'title':{'type':Sequelize[_0x9b60('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x9b60('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9b60('0x5')](_0x9b60('0x6')),'get':function(){try{return JSON[_0x9b60('0x7')](this[_0x9b60('0x8')](_0x9b60('0x9')));}catch(_0x3588ff){return[];}},'set':function(_0x505098){try{this[_0x9b60('0xa')](_0x9b60('0x9'),JSON['stringify'](_0x505098));}catch(_0x1b799c){this[_0x9b60('0xa')]('attrs',JSON[_0x9b60('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9b60('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x9b60('0xc')]},'col':{'type':Sequelize[_0x9b60('0xc')]},'background':{'type':Sequelize[_0x9b60('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9b60('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9b60('0x4')]}};
\ No newline at end of file
+var _0x851a=['stringify','attrs','INTEGER','#ffffff','#2196f3','sequelize','STRING','TEXT','parse','getDataValue','setDataValue'];(function(_0x2f22ee,_0x55cafa){var _0xd74ff2=function(_0x282529){while(--_0x282529){_0x2f22ee['push'](_0x2f22ee['shift']());}};_0xd74ff2(++_0x55cafa);}(_0x851a,0x12e));var _0xa851=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x851a[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0xa851('0x0'));var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0xa851('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa851('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xa851('0x2')]('long'),'get':function(){try{return JSON[_0xa851('0x3')](this[_0xa851('0x4')]('attrs'));}catch(_0xe4f138){return[];}},'set':function(_0x4922b9){try{this[_0xa851('0x5')]('attrs',JSON[_0xa851('0x6')](_0x4922b9));}catch(_0xa8609c){this[_0xa851('0x5')](_0xa851('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xa851('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xa851('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xa851('0x8')]},'col':{'type':Sequelize[_0xa851('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa851('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xa851('0x1')],'allowNull':![],'defaultValue':_0xa851('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 7effee9..31c5836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa49a=['destroy','then','error','stack','name','send','show','params','model','keys','DashboardItem','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa49a,0x1e2));var _0xaa49=function(_0x297335,_0x576860){_0x297335=_0x297335-0x0;var _0x21815f=_0xa49a[_0x297335];return _0x21815f;};'use strict';var pdf=require(_0xaa49('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaa49('0x1'));var zipdir=require(_0xaa49('0x2'));var jsonpatch=require(_0xaa49('0x3'));var rp=require(_0xaa49('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaa49('0x5'));var util=require(_0xaa49('0x6'));var path=require('path');var sox=require(_0xaa49('0x7'));var csv=require(_0xaa49('0x8'));var ejs=require(_0xaa49('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa49('0xa'));var jsforce=require(_0xaa49('0xb'));var deskjs=require(_0xaa49('0xc'));var toCsv=require(_0xaa49('0x8'));var querystring=require(_0xaa49('0xd'));var Papa=require(_0xaa49('0xe'));var Redis=require(_0xaa49('0xf'));var authService=require(_0xaa49('0x10'));var qs=require(_0xaa49('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa49('0x12'));var utils=require(_0xaa49('0x13'));var config=require(_0xaa49('0x14'));var db=require('../../mysqldb')['db'];config[_0xaa49('0x15')]=_[_0xaa49('0x16')](config[_0xaa49('0x15')],{'host':_0xaa49('0x17'),'port':0x18eb});var socket=require(_0xaa49('0x18'))(new Redis(config['redis']));require(_0xaa49('0x19'))[_0xaa49('0x1a')](socket);function respondWithStatusCode(_0x204b8a,_0x5e2944){_0x5e2944=_0x5e2944||0xcc;return function(_0x460fd2){if(_0x460fd2){return _0x204b8a[_0xaa49('0x1b')](_0x5e2944);}return _0x204b8a[_0xaa49('0x1c')](_0x5e2944)[_0xaa49('0x1d')]();};}function respondWithResult(_0x1b86de,_0x1ab152){_0x1ab152=_0x1ab152||0xc8;return function(_0x2d82f0){if(_0x2d82f0){return _0x1b86de[_0xaa49('0x1c')](_0x1ab152)[_0xaa49('0x1e')](_0x2d82f0);}};}function respondWithFilteredResult(_0x150060,_0x12ce6b){return function(_0x4721a2){if(_0x4721a2){var _0x9bf7c=_0x4721a2[_0xaa49('0x1f')],_0x5b7406=_0x12ce6b[_0xaa49('0x20')],_0x46ab28=_0x12ce6b['offset']+_0x12ce6b[_0xaa49('0x21')],_0x29ca03;if(_0x46ab28>=_0x9bf7c){_0x46ab28=_0x9bf7c;_0x29ca03=0xc8;}else{_0x29ca03=0xce;}_0x150060['status'](_0x29ca03);return _0x150060[_0xaa49('0x22')](_0xaa49('0x23'),_0x5b7406+'-'+_0x46ab28+'/'+_0x9bf7c)[_0xaa49('0x1e')](_0x4721a2);}return null;};}function patchUpdates(_0xa442ce){return function(_0x4851da){try{jsonpatch[_0xaa49('0x24')](_0x4851da,_0xa442ce,!![]);}catch(_0x8964c){return BPromise[_0xaa49('0x25')](_0x8964c);}return _0x4851da[_0xaa49('0x26')]();};}function saveUpdates(_0x54c2e6,_0x3da163){return function(_0x4e97af){if(_0x4e97af){return _0x4e97af[_0xaa49('0x27')](_0x54c2e6)['then'](function(_0x4250e0){return _0x4250e0;});}return null;};}function removeEntity(_0x40cfcc,_0x364a9e){return function(_0x555775){if(_0x555775){return _0x555775[_0xaa49('0x28')]()[_0xaa49('0x29')](function(){_0x40cfcc[_0xaa49('0x1c')](0xcc)[_0xaa49('0x1d')]();});}};}function handleEntityNotFound(_0x41a9ff,_0x93e611){return function(_0x4e2e8c){if(!_0x4e2e8c){_0x41a9ff[_0xaa49('0x1b')](0x194);}return _0x4e2e8c;};}function handleError(_0x390dc7,_0x2b9d53){_0x2b9d53=_0x2b9d53||0x1f4;return function(_0x307b13){logger[_0xaa49('0x2a')](_0x307b13[_0xaa49('0x2b')]);if(_0x307b13['name']){delete _0x307b13[_0xaa49('0x2c')];}_0x390dc7[_0xaa49('0x1c')](_0x2b9d53)[_0xaa49('0x2d')](_0x307b13);};}exports[_0xaa49('0x2e')]=function(_0x233371,_0x525cca){var _0x613168={'raw':![],'where':{'id':_0x233371[_0xaa49('0x2f')]['id']}},_0x4f7d57={};_0x4f7d57[_0xaa49('0x30')]=_[_0xaa49('0x31')](db[_0xaa49('0x32')]['rawAttributes']);_0x4f7d57[_0xaa49('0x33')]=_['keys'](_0x233371[_0xaa49('0x33')]);_0x4f7d57[_0xaa49('0x34')]=_[_0xaa49('0x35')](_0x4f7d57['model'],_0x4f7d57[_0xaa49('0x33')]);_0x613168[_0xaa49('0x36')]=_[_0xaa49('0x35')](_0x4f7d57[_0xaa49('0x30')],qs[_0xaa49('0x37')](_0x233371[_0xaa49('0x33')]['fields']));_0x613168['attributes']=_0x613168[_0xaa49('0x36')][_0xaa49('0x38')]?_0x613168[_0xaa49('0x36')]:_0x4f7d57[_0xaa49('0x30')];if(_0x233371[_0xaa49('0x33')][_0xaa49('0x39')]){_0x613168[_0xaa49('0x3a')]=[{'all':!![]}];}_0x613168=_['merge']({},_0x613168,_0x233371[_0xaa49('0x3b')]);return db[_0xaa49('0x32')][_0xaa49('0x3c')](_0x613168)['then'](handleEntityNotFound(_0x525cca,null))[_0xaa49('0x29')](respondWithResult(_0x525cca,null))[_0xaa49('0x3d')](handleError(_0x525cca,null));};exports['destroy']=function(_0x121fff,_0x47fbc2){return db['DashboardItem'][_0xaa49('0x3c')]({'where':{'id':_0x121fff['params']['id']}})[_0xaa49('0x29')](handleEntityNotFound(_0x47fbc2,null))[_0xaa49('0x29')](removeEntity(_0x47fbc2,null))[_0xaa49('0x3d')](handleError(_0x47fbc2,null));};function widgetAttributes(_0x5e4a8a){try{switch(_0x5e4a8a[_0xaa49('0x3e')]){case _0xaa49('0x3f'):return[{'name':_0xaa49('0x40'),'value':_0x5e4a8a[_0xaa49('0x40')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x0]?_0x5e4a8a[_0xaa49('0x41')][0x0][_0xaa49('0x42')]:undefined)||_0xaa49('0x43')}];case _0xaa49('0x44'):return[{'name':_0xaa49('0x45'),'value':_0x5e4a8a[_0xaa49('0x45')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x0]?_0x5e4a8a[_0xaa49('0x41')][0x0]['value']:undefined)||''}];case _0xaa49('0x46'):return[{'name':_0xaa49('0x47'),'value':_0x5e4a8a[_0xaa49('0x47')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x0]?_0x5e4a8a['attrs'][0x0][_0xaa49('0x42')]:undefined)||'HH:mm:ss'},{'name':_0xaa49('0x48'),'value':_0x5e4a8a[_0xaa49('0x48')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x1]?_0x5e4a8a[_0xaa49('0x41')][0x1]['value']:undefined)||'0.00'},{'name':'attrFontSize','value':_0x5e4a8a[_0xaa49('0x49')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a['attrs'][0x2]?_0x5e4a8a[_0xaa49('0x41')][0x2][_0xaa49('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0xaa49('0x4a'),'value':_0x5e4a8a[_0xaa49('0x4a')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a['attrs'][0x0]?_0x5e4a8a['attrs'][0x0][_0xaa49('0x42')]:undefined)||_0xaa49('0x4b')},{'name':_0xaa49('0x4c'),'value':_0x5e4a8a[_0xaa49('0x4c')]||(_0x5e4a8a['attrs']&&_0x5e4a8a[_0xaa49('0x41')][0x1]?_0x5e4a8a[_0xaa49('0x41')][0x1]['value']:undefined)||[]},{'name':_0xaa49('0x49'),'value':_0x5e4a8a[_0xaa49('0x49')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x2]?_0x5e4a8a['attrs'][0x2][_0xaa49('0x42')]:undefined)||0x14}];case _0xaa49('0x4d'):case'pie-chart':return[{'name':_0xaa49('0x4e'),'value':_0x5e4a8a[_0xaa49('0x4e')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x0]?_0x5e4a8a[_0xaa49('0x41')][0x0][_0xaa49('0x42')]:undefined)||'total'},{'name':_0xaa49('0x4f'),'value':_0x5e4a8a[_0xaa49('0x4f')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x1]?_0x5e4a8a[_0xaa49('0x41')][0x1][_0xaa49('0x42')]:undefined)||null},{'name':_0xaa49('0x50'),'value':_0x5e4a8a[_0xaa49('0x50')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x2]?_0x5e4a8a[_0xaa49('0x41')][0x2][_0xaa49('0x42')]:undefined)||null},{'name':_0xaa49('0x4c'),'value':_0x5e4a8a[_0xaa49('0x4c')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a['attrs'][0x3]?_0x5e4a8a[_0xaa49('0x41')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0xaa49('0x51'),'type':_0x5e4a8a['reportType']||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a['attrs'][0x0]?_0x5e4a8a[_0xaa49('0x41')][0x0][_0xaa49('0x3e')]:undefined)||null,'value':_0x5e4a8a[_0xaa49('0x51')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x0]?_0x5e4a8a[_0xaa49('0x41')][0x0][_0xaa49('0x42')]:undefined)||null},{'name':'attrRefresh','value':_0x5e4a8a[_0xaa49('0x52')]||(_0x5e4a8a[_0xaa49('0x41')]&&_0x5e4a8a[_0xaa49('0x41')][0x1]?_0x5e4a8a[_0xaa49('0x41')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1626a5){logger['error'](_0xaa49('0x53'),JSON[_0xaa49('0x54')](_0x1626a5));return[];}}exports['create']=function(_0x3f506a,_0x178f35){if(_0x3f506a[_0xaa49('0x55')]){_0x3f506a['body'][_0xaa49('0x41')]=widgetAttributes(_0x3f506a[_0xaa49('0x55')]);}return db[_0xaa49('0x32')][_0xaa49('0x56')](_0x3f506a[_0xaa49('0x55')],{})[_0xaa49('0x29')](respondWithResult(_0x178f35,0xc9))['catch'](handleError(_0x178f35,null));};exports[_0xaa49('0x27')]=function(_0x32776e,_0x126549){if(_0x32776e[_0xaa49('0x55')]['id']){delete _0x32776e[_0xaa49('0x55')]['id'];}_0x32776e[_0xaa49('0x55')][_0xaa49('0x41')]=widgetAttributes(_0x32776e[_0xaa49('0x55')]);return db[_0xaa49('0x32')][_0xaa49('0x3c')]({'where':{'id':_0x32776e[_0xaa49('0x2f')]['id']}})[_0xaa49('0x29')](handleEntityNotFound(_0x126549,null))[_0xaa49('0x29')](saveUpdates(_0x32776e[_0xaa49('0x55')],null))[_0xaa49('0x29')](respondWithResult(_0x126549,null))[_0xaa49('0x3d')](handleError(_0x126549,null));};
\ No newline at end of file
+var _0xf282=['filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','then','destroy','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','counter','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','error','stringify','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','model','keys','DashboardItem','query'];(function(_0x210710,_0x19ba10){var _0x1cd961=function(_0x2dcbe7){while(--_0x2dcbe7){_0x210710['push'](_0x210710['shift']());}};_0x1cd961(++_0x19ba10);}(_0xf282,0xdf));var _0x2f28=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xf282[_0x422905];return _0x33dc6c;};'use strict';var pdf=require(_0x2f28('0x0'));var emlformat=require(_0x2f28('0x1'));var rimraf=require(_0x2f28('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f28('0x3'));var rp=require(_0x2f28('0x4'));var moment=require(_0x2f28('0x5'));var BPromise=require(_0x2f28('0x6'));var Mustache=require(_0x2f28('0x7'));var util=require(_0x2f28('0x8'));var path=require(_0x2f28('0x9'));var sox=require(_0x2f28('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2f28('0xb'));var squel=require(_0x2f28('0xc'));var crypto=require(_0x2f28('0xd'));var jsforce=require(_0x2f28('0xe'));var deskjs=require(_0x2f28('0xf'));var toCsv=require(_0x2f28('0x10'));var querystring=require(_0x2f28('0x11'));var Papa=require(_0x2f28('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2f28('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f28('0x14'));var logger=require(_0x2f28('0x15'))('api');var utils=require(_0x2f28('0x16'));var config=require(_0x2f28('0x17'));var db=require(_0x2f28('0x18'))['db'];config[_0x2f28('0x19')]=_['defaults'](config[_0x2f28('0x19')],{'host':_0x2f28('0x1a'),'port':0x18eb});var socket=require(_0x2f28('0x1b'))(new Redis(config[_0x2f28('0x19')]));require(_0x2f28('0x1c'))[_0x2f28('0x1d')](socket);function respondWithStatusCode(_0x41d0a7,_0x4c79ce){_0x4c79ce=_0x4c79ce||0xcc;return function(_0x5f1c0e){if(_0x5f1c0e){return _0x41d0a7[_0x2f28('0x1e')](_0x4c79ce);}return _0x41d0a7['status'](_0x4c79ce)[_0x2f28('0x1f')]();};}function respondWithResult(_0x585ce6,_0x376897){_0x376897=_0x376897||0xc8;return function(_0x18d2fd){if(_0x18d2fd){return _0x585ce6[_0x2f28('0x20')](_0x376897)[_0x2f28('0x21')](_0x18d2fd);}};}function respondWithFilteredResult(_0x2bbaf9,_0x4a470c){return function(_0x452ac7){if(_0x452ac7){var _0x2910ca=_0x452ac7[_0x2f28('0x22')],_0x561002=_0x4a470c[_0x2f28('0x23')],_0xd75a8d=_0x4a470c[_0x2f28('0x23')]+_0x4a470c[_0x2f28('0x24')],_0x4bf41a;if(_0xd75a8d>=_0x2910ca){_0xd75a8d=_0x2910ca;_0x4bf41a=0xc8;}else{_0x4bf41a=0xce;}_0x2bbaf9[_0x2f28('0x20')](_0x4bf41a);return _0x2bbaf9[_0x2f28('0x25')](_0x2f28('0x26'),_0x561002+'-'+_0xd75a8d+'/'+_0x2910ca)[_0x2f28('0x21')](_0x452ac7);}return null;};}function patchUpdates(_0x30c0d1){return function(_0xa7b7bb){try{jsonpatch[_0x2f28('0x27')](_0xa7b7bb,_0x30c0d1,!![]);}catch(_0x4c6145){return BPromise[_0x2f28('0x28')](_0x4c6145);}return _0xa7b7bb[_0x2f28('0x29')]();};}function saveUpdates(_0x57d504,_0x1583df){return function(_0xedbf39){if(_0xedbf39){return _0xedbf39[_0x2f28('0x2a')](_0x57d504)['then'](function(_0x43be95){return _0x43be95;});}return null;};}function removeEntity(_0x3c7c84,_0x2f7c12){return function(_0x8d9fce){if(_0x8d9fce){return _0x8d9fce['destroy']()['then'](function(){_0x3c7c84[_0x2f28('0x20')](0xcc)[_0x2f28('0x1f')]();});}};}function handleEntityNotFound(_0x4681e4,_0x5c3647){return function(_0x419596){if(!_0x419596){_0x4681e4[_0x2f28('0x1e')](0x194);}return _0x419596;};}function handleError(_0x1c3d6e,_0x1d186f){_0x1d186f=_0x1d186f||0x1f4;return function(_0x1584c0){logger['error'](_0x1584c0[_0x2f28('0x2b')]);if(_0x1584c0[_0x2f28('0x2c')]){delete _0x1584c0[_0x2f28('0x2c')];}_0x1c3d6e['status'](_0x1d186f)[_0x2f28('0x2d')](_0x1584c0);};}exports['show']=function(_0x373bea,_0x1e0335){var _0x9caf98={'raw':![],'where':{'id':_0x373bea['params']['id']}},_0x1f512c={};_0x1f512c[_0x2f28('0x2e')]=_[_0x2f28('0x2f')](db[_0x2f28('0x30')]['rawAttributes']);_0x1f512c['query']=_['keys'](_0x373bea[_0x2f28('0x31')]);_0x1f512c[_0x2f28('0x32')]=_[_0x2f28('0x33')](_0x1f512c[_0x2f28('0x2e')],_0x1f512c[_0x2f28('0x31')]);_0x9caf98[_0x2f28('0x34')]=_[_0x2f28('0x33')](_0x1f512c['model'],qs[_0x2f28('0x35')](_0x373bea['query']['fields']));_0x9caf98['attributes']=_0x9caf98[_0x2f28('0x34')][_0x2f28('0x36')]?_0x9caf98[_0x2f28('0x34')]:_0x1f512c[_0x2f28('0x2e')];if(_0x373bea['query'][_0x2f28('0x37')]){_0x9caf98[_0x2f28('0x38')]=[{'all':!![]}];}_0x9caf98=_[_0x2f28('0x39')]({},_0x9caf98,_0x373bea[_0x2f28('0x3a')]);return db[_0x2f28('0x30')][_0x2f28('0x3b')](_0x9caf98)[_0x2f28('0x3c')](handleEntityNotFound(_0x1e0335,null))['then'](respondWithResult(_0x1e0335,null))['catch'](handleError(_0x1e0335,null));};exports[_0x2f28('0x3d')]=function(_0x25de9c,_0x1e21cd){return db[_0x2f28('0x30')][_0x2f28('0x3b')]({'where':{'id':_0x25de9c['params']['id']}})['then'](handleEntityNotFound(_0x1e21cd,null))[_0x2f28('0x3c')](removeEntity(_0x1e21cd,null))[_0x2f28('0x3e')](handleError(_0x1e21cd,null));};function widgetAttributes(_0x18a658){try{switch(_0x18a658[_0x2f28('0x3f')]){case _0x2f28('0x40'):return[{'name':_0x2f28('0x41'),'value':_0x18a658['attrUrl']||(_0x18a658[_0x2f28('0x42')]&&_0x18a658[_0x2f28('0x42')][0x0]?_0x18a658[_0x2f28('0x42')][0x0][_0x2f28('0x43')]:undefined)||_0x2f28('0x44')}];case _0x2f28('0x45'):return[{'name':_0x2f28('0x46'),'value':_0x18a658[_0x2f28('0x46')]||(_0x18a658[_0x2f28('0x42')]&&_0x18a658['attrs'][0x0]?_0x18a658[_0x2f28('0x42')][0x0][_0x2f28('0x43')]:undefined)||''}];case'clock':return[{'name':_0x2f28('0x47'),'value':_0x18a658[_0x2f28('0x47')]||(_0x18a658[_0x2f28('0x42')]&&_0x18a658['attrs'][0x0]?_0x18a658['attrs'][0x0]['value']:undefined)||_0x2f28('0x48')},{'name':_0x2f28('0x49'),'value':_0x18a658[_0x2f28('0x49')]||(_0x18a658['attrs']&&_0x18a658[_0x2f28('0x42')][0x1]?_0x18a658['attrs'][0x1][_0x2f28('0x43')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x18a658['attrFontSize']||(_0x18a658[_0x2f28('0x42')]&&_0x18a658[_0x2f28('0x42')][0x2]?_0x18a658[_0x2f28('0x42')][0x2][_0x2f28('0x43')]:undefined)||0xc}];case _0x2f28('0x4a'):return[{'name':_0x2f28('0x4b'),'value':_0x18a658[_0x2f28('0x4b')]||(_0x18a658[_0x2f28('0x42')]&&_0x18a658[_0x2f28('0x42')][0x0]?_0x18a658[_0x2f28('0x42')][0x0][_0x2f28('0x43')]:undefined)||_0x2f28('0x4c')},{'name':_0x2f28('0x4d'),'value':_0x18a658['attrVoiceQueues']||(_0x18a658['attrs']&&_0x18a658['attrs'][0x1]?_0x18a658[_0x2f28('0x42')][0x1]['value']:undefined)||[]},{'name':_0x2f28('0x4e'),'value':_0x18a658[_0x2f28('0x4e')]||(_0x18a658['attrs']&&_0x18a658[_0x2f28('0x42')][0x2]?_0x18a658[_0x2f28('0x42')][0x2][_0x2f28('0x43')]:undefined)||0x14}];case _0x2f28('0x4f'):case'pie-chart':return[{'name':_0x2f28('0x50'),'value':_0x18a658['attrSerie1']||(_0x18a658[_0x2f28('0x42')]&&_0x18a658[_0x2f28('0x42')][0x0]?_0x18a658[_0x2f28('0x42')][0x0]['value']:undefined)||'total'},{'name':_0x2f28('0x51'),'value':_0x18a658[_0x2f28('0x51')]||(_0x18a658[_0x2f28('0x42')]&&_0x18a658['attrs'][0x1]?_0x18a658['attrs'][0x1][_0x2f28('0x43')]:undefined)||null},{'name':_0x2f28('0x52'),'value':_0x18a658[_0x2f28('0x52')]||(_0x18a658[_0x2f28('0x42')]&&_0x18a658['attrs'][0x2]?_0x18a658[_0x2f28('0x42')][0x2][_0x2f28('0x43')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x18a658['attrVoiceQueues']||(_0x18a658[_0x2f28('0x42')]&&_0x18a658[_0x2f28('0x42')][0x3]?_0x18a658[_0x2f28('0x42')][0x3][_0x2f28('0x43')]:undefined)||[]}];case'web-report':return[{'name':_0x2f28('0x53'),'type':_0x18a658[_0x2f28('0x54')]||(_0x18a658[_0x2f28('0x42')]&&_0x18a658[_0x2f28('0x42')][0x0]?_0x18a658[_0x2f28('0x42')][0x0][_0x2f28('0x3f')]:undefined)||null,'value':_0x18a658['attrReport']||(_0x18a658['attrs']&&_0x18a658[_0x2f28('0x42')][0x0]?_0x18a658[_0x2f28('0x42')][0x0][_0x2f28('0x43')]:undefined)||null},{'name':_0x2f28('0x55'),'value':_0x18a658[_0x2f28('0x55')]||(_0x18a658['attrs']&&_0x18a658[_0x2f28('0x42')][0x1]?_0x18a658[_0x2f28('0x42')][0x1][_0x2f28('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x5e5834){logger[_0x2f28('0x56')]('widgetAttributes:\x20%s',JSON[_0x2f28('0x57')](_0x5e5834));return[];}}exports[_0x2f28('0x58')]=function(_0x159294,_0x29ca00){if(_0x159294[_0x2f28('0x59')]){_0x159294[_0x2f28('0x59')][_0x2f28('0x42')]=widgetAttributes(_0x159294[_0x2f28('0x59')]);}return db['DashboardItem'][_0x2f28('0x58')](_0x159294[_0x2f28('0x59')],{})[_0x2f28('0x3c')](respondWithResult(_0x29ca00,0xc9))[_0x2f28('0x3e')](handleError(_0x29ca00,null));};exports[_0x2f28('0x2a')]=function(_0x2bffff,_0x356ba6){if(_0x2bffff['body']['id']){delete _0x2bffff[_0x2f28('0x59')]['id'];}_0x2bffff[_0x2f28('0x59')][_0x2f28('0x42')]=widgetAttributes(_0x2bffff['body']);return db[_0x2f28('0x30')][_0x2f28('0x3b')]({'where':{'id':_0x2bffff[_0x2f28('0x5a')]['id']}})[_0x2f28('0x3c')](handleEntityNotFound(_0x356ba6,null))[_0x2f28('0x3c')](saveUpdates(_0x2bffff[_0x2f28('0x59')],null))[_0x2f28('0x3c')](respondWithResult(_0x356ba6,null))['catch'](handleError(_0x356ba6,null));};
\ No newline at end of file
index 75b00c9..8e3f0bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6f3=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x187499,_0x5e416a){var _0x2965fe=function(_0xc6645e){while(--_0xc6645e){_0x187499['push'](_0x187499['shift']());}};_0x2965fe(++_0x5e416a);}(_0xf6f3,0xb4));var _0x3f6f=function(_0x26bb3f,_0x25cd1f){_0x26bb3f=_0x26bb3f-0x0;var _0x2cbd3f=_0xf6f3[_0x26bb3f];return _0x2cbd3f;};'use strict';var EventEmitter=require(_0x3f6f('0x0'));var DashboardItem=require(_0x3f6f('0x1'))['db'][_0x3f6f('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3f6f('0x3')](0x0);var events={'afterCreate':_0x3f6f('0x4'),'afterUpdate':_0x3f6f('0x5'),'afterDestroy':_0x3f6f('0x6')};function emitEvent(_0x642756){return function(_0x4cb554,_0x5c5dc3,_0x2af82f){DashboardItemEvents['emit'](_0x642756+':'+_0x4cb554['id'],_0x4cb554);DashboardItemEvents[_0x3f6f('0x7')](_0x642756,_0x4cb554);_0x2af82f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x3f6f('0x8')](e,emitEvent(event));}}module[_0x3f6f('0x9')]=DashboardItemEvents;
\ No newline at end of file
+var _0x8c04=['remove','emit','hasOwnProperty','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x45ef80,_0x3065f3){var _0x3ff300=function(_0x520452){while(--_0x520452){_0x45ef80['push'](_0x45ef80['shift']());}};_0x3ff300(++_0x3065f3);}(_0x8c04,0x1a7));var _0x48c0=function(_0x1b21ad,_0x491ee8){_0x1b21ad=_0x1b21ad-0x0;var _0x4624d3=_0x8c04[_0x1b21ad];return _0x4624d3;};'use strict';var EventEmitter=require(_0x48c0('0x0'));var DashboardItem=require(_0x48c0('0x1'))['db'][_0x48c0('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x48c0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x48c0('0x4')};function emitEvent(_0x47fe5c){return function(_0x43c89d,_0x42abe1,_0x2bb46d){DashboardItemEvents[_0x48c0('0x5')](_0x47fe5c+':'+_0x43c89d['id'],_0x43c89d);DashboardItemEvents[_0x48c0('0x5')](_0x47fe5c,_0x43c89d);_0x2bb46d(null);};}for(var e in events){if(events[_0x48c0('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 680be0c..81ed14d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76c7=['../../config/logger','api','moment','bluebird','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','util'];(function(_0x59ae54,_0x171977){var _0x16b30b=function(_0x20737b){while(--_0x20737b){_0x59ae54['push'](_0x59ae54['shift']());}};_0x16b30b(++_0x171977);}(_0x76c7,0x136));var _0x776c=function(_0x3bfab4,_0x1eeb2a){_0x3bfab4=_0x3bfab4-0x0;var _0x3febd8=_0x76c7[_0x3bfab4];return _0x3febd8;};'use strict';var _=require(_0x776c('0x0'));var util=require(_0x776c('0x1'));var logger=require(_0x776c('0x2'))(_0x776c('0x3'));var moment=require(_0x776c('0x4'));var BPromise=require(_0x776c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x776c('0x6'));var rimraf=require('rimraf');var config=require(_0x776c('0x7'));var attributes=require(_0x776c('0x8'));module[_0x776c('0x9')]=function(_0x396540,_0x57491b){return _0x396540[_0x776c('0xa')](_0x776c('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5dfc=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','DashboardItem','lodash'];(function(_0x10f877,_0x55e4d1){var _0x4c9ba1=function(_0x95507f){while(--_0x95507f){_0x10f877['push'](_0x10f877['shift']());}};_0x4c9ba1(++_0x55e4d1);}(_0x5dfc,0xa4));var _0xc5df=function(_0x1196b0,_0x36c47a){_0x1196b0=_0x1196b0-0x0;var _0x111c52=_0x5dfc[_0x1196b0];return _0x111c52;};'use strict';var _=require(_0xc5df('0x0'));var util=require('util');var logger=require(_0xc5df('0x1'))(_0xc5df('0x2'));var moment=require(_0xc5df('0x3'));var BPromise=require(_0xc5df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5df('0x5'));var rimraf=require(_0xc5df('0x6'));var config=require(_0xc5df('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xc5df('0x8')]=function(_0x414d0e,_0x94bd94){return _0x414d0e[_0xc5df('0x9')](_0xc5df('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5df92c0..2627059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4922=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring'];(function(_0x4c5b69,_0x2e7bea){var _0x25c6ba=function(_0x1b8342){while(--_0x1b8342){_0x4c5b69['push'](_0x4c5b69['shift']());}};_0x25c6ba(++_0x2e7bea);}(_0x4922,0x169));var _0x2492=function(_0x2494f2,_0x5af128){_0x2494f2=_0x2494f2-0x0;var _0x42993a=_0x4922[_0x2494f2];return _0x42993a;};'use strict';var _=require('lodash');var util=require(_0x2492('0x0'));var moment=require('moment');var BPromise=require(_0x2492('0x1'));var rs=require(_0x2492('0x2'));var fs=require('fs');var Redis=require(_0x2492('0x3'));var db=require(_0x2492('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2492('0x5'))(_0x2492('0x6'));var config=require(_0x2492('0x7'));var jayson=require(_0x2492('0x8'));var client=jayson[_0x2492('0x9')][_0x2492('0xa')]({'port':0x232a});config[_0x2492('0xb')]=_['defaults'](config['redis'],{'host':_0x2492('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2492('0xb')]));require(_0x2492('0xd'))[_0x2492('0xe')](socket);function respondWithRpcPromise(_0x57bd1a,_0x5135f2,_0x250b82){return new BPromise(function(_0x56b644,_0x36cdcd){return client[_0x2492('0xf')](_0x57bd1a,_0x250b82)[_0x2492('0x10')](function(_0x5a21b9){logger[_0x2492('0x11')](_0x2492('0x12'),_0x5135f2,_0x2492('0x13'));logger['debug'](_0x2492('0x14'),_0x5135f2,_0x2492('0x13'),JSON[_0x2492('0x15')](_0x5a21b9));if(_0x5a21b9[_0x2492('0x16')]){if(_0x5a21b9[_0x2492('0x16')]['code']===0x1f4){logger[_0x2492('0x16')]('DashboardItem,\x20%s,\x20%s',_0x5135f2,_0x5a21b9[_0x2492('0x16')][_0x2492('0x17')]);return _0x36cdcd(_0x5a21b9[_0x2492('0x16')][_0x2492('0x17')]);}logger[_0x2492('0x16')](_0x2492('0x12'),_0x5135f2,_0x5a21b9[_0x2492('0x16')][_0x2492('0x17')]);return _0x56b644(_0x5a21b9[_0x2492('0x16')][_0x2492('0x17')]);}else{logger[_0x2492('0x11')](_0x2492('0x12'),_0x5135f2,_0x2492('0x13'));_0x56b644(_0x5a21b9[_0x2492('0x18')][_0x2492('0x17')]);}})[_0x2492('0x19')](function(_0x1501af){logger[_0x2492('0x16')]('DashboardItem,\x20%s,\x20%s',_0x5135f2,_0x1501af);_0x36cdcd(_0x1501af);});});}
\ No newline at end of file
+var _0xe8b0=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x196416,_0x14f3bf){var _0x9284=function(_0x254ee6){while(--_0x254ee6){_0x196416['push'](_0x196416['shift']());}};_0x9284(++_0x14f3bf);}(_0xe8b0,0x104));var _0x0e8b=function(_0x1c89ad,_0x1fd275){_0x1c89ad=_0x1c89ad-0x0;var _0x31d39f=_0xe8b0[_0x1c89ad];return _0x31d39f;};'use strict';var _=require(_0x0e8b('0x0'));var util=require(_0x0e8b('0x1'));var moment=require('moment');var BPromise=require(_0x0e8b('0x2'));var rs=require(_0x0e8b('0x3'));var fs=require('fs');var Redis=require(_0x0e8b('0x4'));var db=require(_0x0e8b('0x5'))['db'];var utils=require(_0x0e8b('0x6'));var logger=require(_0x0e8b('0x7'))(_0x0e8b('0x8'));var config=require(_0x0e8b('0x9'));var jayson=require(_0x0e8b('0xa'));var client=jayson[_0x0e8b('0xb')]['http']({'port':0x232a});config[_0x0e8b('0xc')]=_[_0x0e8b('0xd')](config[_0x0e8b('0xc')],{'host':_0x0e8b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e8b('0xc')]));require(_0x0e8b('0xf'))[_0x0e8b('0x10')](socket);function respondWithRpcPromise(_0x522ae7,_0x3edde1,_0x583dd6){return new BPromise(function(_0x41dbdf,_0x16fe21){return client[_0x0e8b('0x11')](_0x522ae7,_0x583dd6)['then'](function(_0x4e5ae7){logger[_0x0e8b('0x12')](_0x0e8b('0x13'),_0x3edde1,'request\x20sent');logger[_0x0e8b('0x14')](_0x0e8b('0x15'),_0x3edde1,_0x0e8b('0x16'),JSON[_0x0e8b('0x17')](_0x4e5ae7));if(_0x4e5ae7['error']){if(_0x4e5ae7[_0x0e8b('0x18')][_0x0e8b('0x19')]===0x1f4){logger[_0x0e8b('0x18')](_0x0e8b('0x13'),_0x3edde1,_0x4e5ae7[_0x0e8b('0x18')][_0x0e8b('0x1a')]);return _0x16fe21(_0x4e5ae7[_0x0e8b('0x18')]['message']);}logger[_0x0e8b('0x18')]('DashboardItem,\x20%s,\x20%s',_0x3edde1,_0x4e5ae7[_0x0e8b('0x18')][_0x0e8b('0x1a')]);return _0x41dbdf(_0x4e5ae7[_0x0e8b('0x18')][_0x0e8b('0x1a')]);}else{logger['info'](_0x0e8b('0x13'),_0x3edde1,_0x0e8b('0x16'));_0x41dbdf(_0x4e5ae7[_0x0e8b('0x1b')][_0x0e8b('0x1a')]);}})[_0x0e8b('0x1c')](function(_0x42be61){logger[_0x0e8b('0x18')](_0x0e8b('0x13'),_0x3edde1,_0x42be61);_0x16fe21(_0x42be61);});});}
\ No newline at end of file
index 570274e..de9ce27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51e1=['./dashboardItem.events','save','remove','removeListener','length','dashboardItem:'];(function(_0x141908,_0x4e61dc){var _0x37e9c9=function(_0x3a557e){while(--_0x3a557e){_0x141908['push'](_0x141908['shift']());}};_0x37e9c9(++_0x4e61dc);}(_0x51e1,0x1e6));var _0x151e=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x51e1[_0xf26d40];return _0x50b68c;};'use strict';var DashboardItemEvents=require(_0x151e('0x0'));var events=[_0x151e('0x1'),_0x151e('0x2'),'update'];function createListener(_0x4bddc5,_0x3a2ba2){return function(_0x62e003){_0x3a2ba2['emit'](_0x4bddc5,_0x62e003);};}function removeListener(_0x509b68,_0x30925c){return function(){DashboardItemEvents[_0x151e('0x3')](_0x509b68,_0x30925c);};}exports['register']=function(_0x24d327){for(var _0x22064d=0x0,_0xe32234=events[_0x151e('0x4')];_0x22064d<_0xe32234;_0x22064d++){var _0x319ea9=events[_0x22064d];var _0x555dd4=createListener(_0x151e('0x5')+_0x319ea9,_0x24d327);DashboardItemEvents['on'](_0x319ea9,_0x555dd4);}};
\ No newline at end of file
+var _0x83ec=['update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','remove'];(function(_0x5cfa6c,_0x200774){var _0x44e16d=function(_0x42d9c8){while(--_0x42d9c8){_0x5cfa6c['push'](_0x5cfa6c['shift']());}};_0x44e16d(++_0x200774);}(_0x83ec,0xde));var _0xc83e=function(_0x1d61a4,_0x55d3da){_0x1d61a4=_0x1d61a4-0x0;var _0x4b2a86=_0x83ec[_0x1d61a4];return _0x4b2a86;};'use strict';var DashboardItemEvents=require(_0xc83e('0x0'));var events=['save',_0xc83e('0x1'),_0xc83e('0x2')];function createListener(_0x1987a8,_0x3d55f4){return function(_0x4da0c0){_0x3d55f4[_0xc83e('0x3')](_0x1987a8,_0x4da0c0);};}function removeListener(_0xda0b82,_0x222096){return function(){DashboardItemEvents[_0xc83e('0x4')](_0xda0b82,_0x222096);};}exports[_0xc83e('0x5')]=function(_0x54422d){for(var _0x544230=0x0,_0x4e8bc5=events[_0xc83e('0x6')];_0x544230<_0x4e8bc5;_0x544230++){var _0x2785bd=events[_0x544230];var _0x53f055=createListener(_0xc83e('0x7')+_0x2785bd,_0x54422d);DashboardItemEvents['on'](_0x2785bd,_0x53f055);}};
\ No newline at end of file
index ed91702..435b21e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ca=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x9b7a64,_0x38d4a8){_0x9b7a64=_0x9b7a64-0x0;var _0x33fd98=_0xf2ca[_0x9b7a64];return _0x33fd98;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var auth=require(_0xaf2c('0x5'));var interaction=require(_0xaf2c('0x6'));var config=require(_0xaf2c('0x7'));var controller=require(_0xaf2c('0x8'));router['get'](_0xaf2c('0x9'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0xc')]('/',auth['isAuthenticated'](),controller[_0xaf2c('0xd')]);router[_0xaf2c('0xe')]('/:id',auth[_0xaf2c('0xa')](),controller['update']);router[_0xaf2c('0xf')]('/:id',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x10')]);module[_0xaf2c('0x11')]=router;
\ No newline at end of file
+var _0x5fab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x5fab,0x177));var _0xb5fa=function(_0x344128,_0x9b9e88){_0x344128=_0x344128-0x0;var _0x693fae=_0x5fab[_0x344128];return _0x693fae;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')](_0xb5fa('0xa'),auth[_0xb5fa('0xb')](),controller['show']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0xd')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);module[_0xb5fa('0x11')]=router;
\ No newline at end of file
index c29f042..2cad0d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f24=['STRING','sequelize'];(function(_0x4ef05e,_0x18b00a){var _0x241f30=function(_0x5440db){while(--_0x5440db){_0x4ef05e['push'](_0x4ef05e['shift']());}};_0x241f30(++_0x18b00a);}(_0x0f24,0x113));var _0x40f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0f24[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x40f2('0x0'));module['exports']={'name':{'type':Sequelize[_0x40f2('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x5dbe=['exports','STRING','sequelize'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x5dbe,0xf5));var _0xe5db=function(_0x2e16d8,_0x1110ff){_0x2e16d8=_0x2e16d8-0x0;var _0xbb0a07=_0x5dbe[_0x2e16d8];return _0xbb0a07;};'use strict';var Sequelize=require(_0xe5db('0x0'));module[_0xe5db('0x1')]={'name':{'type':Sequelize[_0xe5db('0x2')],'allowNull':![]}};
\ No newline at end of file
index e771a6e..f16f689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65d4=['merge','count','includeAll','include','findAll','show','keys','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','Dispositions','UserProfileResource','then','sendStatus','stack','name','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x424bd3,_0x8760d8){var _0x1fdade=function(_0x510862){while(--_0x510862){_0x424bd3['push'](_0x424bd3['shift']());}};_0x1fdade(++_0x8760d8);}(_0x65d4,0x161));var _0x465d=function(_0x518119,_0x43a125){_0x518119=_0x518119-0x0;var _0x2ba4d7=_0x65d4[_0x518119];return _0x2ba4d7;};'use strict';var pdf=require(_0x465d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x465d('0x1'));var zipdir=require(_0x465d('0x2'));var jsonpatch=require(_0x465d('0x3'));var rp=require(_0x465d('0x4'));var moment=require(_0x465d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x465d('0x6'));var util=require(_0x465d('0x7'));var path=require(_0x465d('0x8'));var sox=require(_0x465d('0x9'));var csv=require('to-csv');var ejs=require(_0x465d('0xa'));var fs=require('fs');var _=require(_0x465d('0xb'));var squel=require(_0x465d('0xc'));var crypto=require(_0x465d('0xd'));var jsforce=require(_0x465d('0xe'));var deskjs=require(_0x465d('0xf'));var toCsv=require(_0x465d('0x10'));var querystring=require(_0x465d('0x11'));var Papa=require('papaparse');var Redis=require(_0x465d('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x465d('0x13'));var hardwareService=require(_0x465d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x465d('0x15'));var config=require(_0x465d('0x16'));var db=require(_0x465d('0x17'))['db'];function respondWithStatusCode(_0x57a098,_0x326bd4){_0x326bd4=_0x326bd4||0xcc;return function(_0x1bca71){if(_0x1bca71){return _0x57a098['sendStatus'](_0x326bd4);}return _0x57a098[_0x465d('0x18')](_0x326bd4)[_0x465d('0x19')]();};}function respondWithResult(_0x3ca95f,_0x370705){_0x370705=_0x370705||0xc8;return function(_0x457de7){if(_0x457de7){return _0x3ca95f[_0x465d('0x18')](_0x370705)[_0x465d('0x1a')](_0x457de7);}};}function respondWithFilteredResult(_0x3a0818,_0x534eb0){return function(_0x10363b){if(_0x10363b){var _0x1cae8f=_0x10363b['count'],_0x1b70cb=_0x534eb0['offset'],_0x27cc2f=_0x534eb0[_0x465d('0x1b')]+_0x534eb0[_0x465d('0x1c')],_0x466806;if(_0x27cc2f>=_0x1cae8f){_0x27cc2f=_0x1cae8f;_0x466806=0xc8;}else{_0x466806=0xce;}_0x3a0818[_0x465d('0x18')](_0x466806);return _0x3a0818[_0x465d('0x1d')](_0x465d('0x1e'),_0x1b70cb+'-'+_0x27cc2f+'/'+_0x1cae8f)['json'](_0x10363b);}return null;};}function patchUpdates(_0x2e2a61){return function(_0x5c89df){try{jsonpatch[_0x465d('0x1f')](_0x5c89df,_0x2e2a61,!![]);}catch(_0x3cc9e7){return BPromise['reject'](_0x3cc9e7);}return _0x5c89df[_0x465d('0x20')]();};}function saveUpdates(_0xabd99b,_0x424acf){return function(_0x3d1e04){if(_0x3d1e04){return _0x3d1e04[_0x465d('0x21')](_0xabd99b)['then'](function(_0x31adeb){return _0x31adeb;});}return null;};}function removeEntity(_0x168965,_0x1290a4){return function(_0x4f4c1){if(_0x4f4c1){return _0x4f4c1[_0x465d('0x22')]()['then'](function(){var _0x3b956b=_0x4f4c1['get']({'plain':!![]});var _0x4702ae=_0x465d('0x23');return db[_0x465d('0x24')][_0x465d('0x22')]({'where':{'type':_0x4702ae,'resourceId':_0x3b956b['id']}})[_0x465d('0x25')](function(){return _0x4f4c1;});})['then'](function(){_0x168965[_0x465d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b90ba,_0x1f8b4f){return function(_0x45f4ff){if(!_0x45f4ff){_0x2b90ba[_0x465d('0x26')](0x194);}return _0x45f4ff;};}function handleError(_0xff158d,_0x378b73){_0x378b73=_0x378b73||0x1f4;return function(_0x2b5a70){logger['error'](_0x2b5a70[_0x465d('0x27')]);if(_0x2b5a70[_0x465d('0x28')]){delete _0x2b5a70[_0x465d('0x28')];}_0xff158d[_0x465d('0x18')](_0x378b73)['send'](_0x2b5a70);};}exports[_0x465d('0x29')]=function(_0x1952d7,_0xd092b2){var _0xf0cf1f={},_0x2ad40e={},_0x25f645={'count':0x0,'rows':[]};var _0x34b87e=_[_0x465d('0x2a')](db[_0x465d('0x2b')][_0x465d('0x2c')],function(_0x23545a){return{'name':_0x23545a[_0x465d('0x2d')],'type':_0x23545a[_0x465d('0x2e')][_0x465d('0x2f')]};});_0x2ad40e[_0x465d('0x30')]=_[_0x465d('0x2a')](_0x34b87e,_0x465d('0x28'));_0x2ad40e[_0x465d('0x31')]=_['keys'](_0x1952d7[_0x465d('0x31')]);_0x2ad40e[_0x465d('0x32')]=_[_0x465d('0x33')](_0x2ad40e[_0x465d('0x30')],_0x2ad40e[_0x465d('0x31')]);_0xf0cf1f[_0x465d('0x34')]=_[_0x465d('0x33')](_0x2ad40e[_0x465d('0x30')],qs[_0x465d('0x35')](_0x1952d7[_0x465d('0x31')][_0x465d('0x35')]));_0xf0cf1f[_0x465d('0x34')]=_0xf0cf1f[_0x465d('0x34')][_0x465d('0x36')]?_0xf0cf1f[_0x465d('0x34')]:_0x2ad40e['model'];if(!_0x1952d7[_0x465d('0x31')][_0x465d('0x37')](_0x465d('0x38'))){_0xf0cf1f['limit']=qs[_0x465d('0x1c')](_0x1952d7[_0x465d('0x31')]['limit']);_0xf0cf1f[_0x465d('0x1b')]=qs[_0x465d('0x1b')](_0x1952d7[_0x465d('0x31')][_0x465d('0x1b')]);}_0xf0cf1f[_0x465d('0x39')]=qs[_0x465d('0x3a')](_0x1952d7[_0x465d('0x31')][_0x465d('0x3a')]);_0xf0cf1f[_0x465d('0x3b')]=qs['filters'](_[_0x465d('0x3c')](_0x1952d7['query'],_0x2ad40e['filters']),_0x34b87e);if(_0x1952d7['query'][_0x465d('0x3d')]){_0xf0cf1f[_0x465d('0x3b')]=_[_0x465d('0x3e')](_0xf0cf1f[_0x465d('0x3b')],{'$or':_[_0x465d('0x2a')](_0x34b87e,function(_0x50bfa6){if(_0x50bfa6[_0x465d('0x2e')]!=='VIRTUAL'){var _0x16972d={};_0x16972d[_0x50bfa6[_0x465d('0x28')]]={'$like':'%'+_0x1952d7[_0x465d('0x31')]['filter']+'%'};return _0x16972d;}})});}_0xf0cf1f=_['merge']({},_0xf0cf1f,_0x1952d7['options']);var _0x277208={'where':_0xf0cf1f['where']};return db['Disposition'][_0x465d('0x3f')](_0x277208)[_0x465d('0x25')](function(_0x4f8705){_0x25f645[_0x465d('0x3f')]=_0x4f8705;if(_0x1952d7[_0x465d('0x31')][_0x465d('0x40')]){_0xf0cf1f[_0x465d('0x41')]=[{'all':!![]}];}return db['Disposition'][_0x465d('0x42')](_0xf0cf1f);})[_0x465d('0x25')](function(_0x57609d){_0x25f645['rows']=_0x57609d;return _0x25f645;})[_0x465d('0x25')](respondWithFilteredResult(_0xd092b2,_0xf0cf1f))['catch'](handleError(_0xd092b2,null));};exports[_0x465d('0x43')]=function(_0x16a24e,_0x1c144e){var _0x1cbfe1={'raw':!![],'where':{'id':_0x16a24e['params']['id']}},_0x350220={};_0x350220[_0x465d('0x30')]=_[_0x465d('0x44')](db[_0x465d('0x2b')][_0x465d('0x2c')]);_0x350220[_0x465d('0x31')]=_['keys'](_0x16a24e['query']);_0x350220['filters']=_[_0x465d('0x33')](_0x350220['model'],_0x350220[_0x465d('0x31')]);_0x1cbfe1['attributes']=_[_0x465d('0x33')](_0x350220[_0x465d('0x30')],qs[_0x465d('0x35')](_0x16a24e[_0x465d('0x31')][_0x465d('0x35')]));_0x1cbfe1[_0x465d('0x34')]=_0x1cbfe1['attributes'][_0x465d('0x36')]?_0x1cbfe1['attributes']:_0x350220[_0x465d('0x30')];if(_0x16a24e[_0x465d('0x31')][_0x465d('0x40')]){_0x1cbfe1[_0x465d('0x41')]=[{'all':!![]}];}_0x1cbfe1=_[_0x465d('0x3e')]({},_0x1cbfe1,_0x16a24e[_0x465d('0x45')]);return db['Disposition'][_0x465d('0x46')](_0x1cbfe1)[_0x465d('0x25')](handleEntityNotFound(_0x1c144e,null))[_0x465d('0x25')](respondWithResult(_0x1c144e,null))['catch'](handleError(_0x1c144e,null));};exports[_0x465d('0x47')]=function(_0x616c8b,_0xfc2d16){return db[_0x465d('0x2b')][_0x465d('0x47')](_0x616c8b[_0x465d('0x48')],{})[_0x465d('0x25')](function(_0x58df18){var _0x522835=_0x616c8b[_0x465d('0x49')][_0x465d('0x4a')]({'plain':!![]});if(!_0x522835)throw new Error(_0x465d('0x4b'));if(_0x522835[_0x465d('0x4c')]===_0x465d('0x49')){var _0x166555=_0x58df18[_0x465d('0x4a')]({'plain':!![]});var _0x33554e=_0x465d('0x23');return db[_0x465d('0x4d')]['find']({'where':{'name':_0x33554e,'userProfileId':_0x522835['userProfileId']},'raw':!![]})[_0x465d('0x25')](function(_0x320fa2){if(_0x320fa2&&_0x320fa2[_0x465d('0x4e')]===0x0){return db[_0x465d('0x24')][_0x465d('0x47')]({'name':_0x166555['name'],'resourceId':_0x166555['id'],'type':_0x320fa2[_0x465d('0x28')],'sectionId':_0x320fa2['id']},{})[_0x465d('0x25')](function(){return _0x58df18;});}else{return _0x58df18;}})['catch'](function(_0x426ec7){logger[_0x465d('0x4f')](_0x465d('0x50'),_0x426ec7);throw _0x426ec7;});}return _0x58df18;})[_0x465d('0x25')](respondWithResult(_0xfc2d16,0xc9))[_0x465d('0x51')](handleError(_0xfc2d16,null));};exports['update']=function(_0x4644f3,_0x45d8db){if(_0x4644f3['body']['id']){delete _0x4644f3[_0x465d('0x48')]['id'];}return db[_0x465d('0x2b')][_0x465d('0x46')]({'where':{'id':_0x4644f3['params']['id']}})[_0x465d('0x25')](handleEntityNotFound(_0x45d8db,null))[_0x465d('0x25')](saveUpdates(_0x4644f3[_0x465d('0x48')],null))[_0x465d('0x25')](respondWithResult(_0x45d8db,null))['catch'](handleError(_0x45d8db,null));};exports[_0x465d('0x22')]=function(_0x4c17a2,_0x2b1676){return db['Disposition'][_0x465d('0x46')]({'where':{'id':_0x4c17a2[_0x465d('0x52')]['id']}})[_0x465d('0x25')](handleEntityNotFound(_0x2b1676,null))[_0x465d('0x25')](removeEntity(_0x2b1676,null))[_0x465d('0x51')](handleError(_0x2b1676,null));};
\ No newline at end of file
+var _0xac79=['merge','filter','includeAll','include','findAll','rows','catch','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','params','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','Dispositions','end','error','stack','name','index','map','Disposition','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xac79,0x106));var _0x9ac7=function(_0x2b51fc,_0x40687d){_0x2b51fc=_0x2b51fc-0x0;var _0x8bb319=_0xac79[_0x2b51fc];return _0x8bb319;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9ac7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ac7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ac7('0x2'));var moment=require(_0x9ac7('0x3'));var BPromise=require(_0x9ac7('0x4'));var Mustache=require('mustache');var util=require(_0x9ac7('0x5'));var path=require(_0x9ac7('0x6'));var sox=require(_0x9ac7('0x7'));var csv=require(_0x9ac7('0x8'));var ejs=require(_0x9ac7('0x9'));var fs=require('fs');var _=require(_0x9ac7('0xa'));var squel=require('squel');var crypto=require(_0x9ac7('0xb'));var jsforce=require(_0x9ac7('0xc'));var deskjs=require(_0x9ac7('0xd'));var toCsv=require(_0x9ac7('0x8'));var querystring=require(_0x9ac7('0xe'));var Papa=require(_0x9ac7('0xf'));var Redis=require('ioredis');var authService=require(_0x9ac7('0x10'));var qs=require(_0x9ac7('0x11'));var as=require(_0x9ac7('0x12'));var hardwareService=require(_0x9ac7('0x13'));var logger=require(_0x9ac7('0x14'))('api');var utils=require(_0x9ac7('0x15'));var config=require(_0x9ac7('0x16'));var db=require(_0x9ac7('0x17'))['db'];function respondWithStatusCode(_0x5d17b4,_0x48f53e){_0x48f53e=_0x48f53e||0xcc;return function(_0x2f9700){if(_0x2f9700){return _0x5d17b4[_0x9ac7('0x18')](_0x48f53e);}return _0x5d17b4[_0x9ac7('0x19')](_0x48f53e)['end']();};}function respondWithResult(_0x2cf640,_0x21cb88){_0x21cb88=_0x21cb88||0xc8;return function(_0x186271){if(_0x186271){return _0x2cf640['status'](_0x21cb88)[_0x9ac7('0x1a')](_0x186271);}};}function respondWithFilteredResult(_0x3f184c,_0x26b4e3){return function(_0x11bcd6){if(_0x11bcd6){var _0x31aaf1=_0x11bcd6[_0x9ac7('0x1b')],_0x300bde=_0x26b4e3[_0x9ac7('0x1c')],_0x1dfcc3=_0x26b4e3[_0x9ac7('0x1c')]+_0x26b4e3[_0x9ac7('0x1d')],_0x2cbe30;if(_0x1dfcc3>=_0x31aaf1){_0x1dfcc3=_0x31aaf1;_0x2cbe30=0xc8;}else{_0x2cbe30=0xce;}_0x3f184c[_0x9ac7('0x19')](_0x2cbe30);return _0x3f184c['set'](_0x9ac7('0x1e'),_0x300bde+'-'+_0x1dfcc3+'/'+_0x31aaf1)['json'](_0x11bcd6);}return null;};}function patchUpdates(_0x40058b){return function(_0x4be623){try{jsonpatch[_0x9ac7('0x1f')](_0x4be623,_0x40058b,!![]);}catch(_0x45cb34){return BPromise['reject'](_0x45cb34);}return _0x4be623[_0x9ac7('0x20')]();};}function saveUpdates(_0x3f9913,_0x35738e){return function(_0x56d17c){if(_0x56d17c){return _0x56d17c[_0x9ac7('0x21')](_0x3f9913)[_0x9ac7('0x22')](function(_0x3d98c7){return _0x3d98c7;});}return null;};}function removeEntity(_0x1be713,_0x32bdc6){return function(_0x227c77){if(_0x227c77){return _0x227c77[_0x9ac7('0x23')]()[_0x9ac7('0x22')](function(){var _0x192d2e=_0x227c77[_0x9ac7('0x24')]({'plain':!![]});var _0x4f5ea9=_0x9ac7('0x25');return db['UserProfileResource'][_0x9ac7('0x23')]({'where':{'type':_0x4f5ea9,'resourceId':_0x192d2e['id']}})[_0x9ac7('0x22')](function(){return _0x227c77;});})[_0x9ac7('0x22')](function(){_0x1be713[_0x9ac7('0x19')](0xcc)[_0x9ac7('0x26')]();});}};}function handleEntityNotFound(_0xa0b766,_0x336a42){return function(_0x27d596){if(!_0x27d596){_0xa0b766[_0x9ac7('0x18')](0x194);}return _0x27d596;};}function handleError(_0x954c66,_0x2e97b6){_0x2e97b6=_0x2e97b6||0x1f4;return function(_0x1d1d4c){logger[_0x9ac7('0x27')](_0x1d1d4c[_0x9ac7('0x28')]);if(_0x1d1d4c[_0x9ac7('0x29')]){delete _0x1d1d4c[_0x9ac7('0x29')];}_0x954c66[_0x9ac7('0x19')](_0x2e97b6)['send'](_0x1d1d4c);};}exports[_0x9ac7('0x2a')]=function(_0x288270,_0x3804a3){var _0x2ad04e={},_0x3884d4={},_0x41e0d7={'count':0x0,'rows':[]};var _0x47e2d6=_[_0x9ac7('0x2b')](db[_0x9ac7('0x2c')]['rawAttributes'],function(_0x973e46){return{'name':_0x973e46[_0x9ac7('0x2d')],'type':_0x973e46[_0x9ac7('0x2e')][_0x9ac7('0x2f')]};});_0x3884d4[_0x9ac7('0x30')]=_[_0x9ac7('0x2b')](_0x47e2d6,_0x9ac7('0x29'));_0x3884d4[_0x9ac7('0x31')]=_[_0x9ac7('0x32')](_0x288270['query']);_0x3884d4['filters']=_[_0x9ac7('0x33')](_0x3884d4[_0x9ac7('0x30')],_0x3884d4[_0x9ac7('0x31')]);_0x2ad04e['attributes']=_[_0x9ac7('0x33')](_0x3884d4[_0x9ac7('0x30')],qs[_0x9ac7('0x34')](_0x288270[_0x9ac7('0x31')][_0x9ac7('0x34')]));_0x2ad04e[_0x9ac7('0x35')]=_0x2ad04e[_0x9ac7('0x35')][_0x9ac7('0x36')]?_0x2ad04e[_0x9ac7('0x35')]:_0x3884d4[_0x9ac7('0x30')];if(!_0x288270[_0x9ac7('0x31')][_0x9ac7('0x37')](_0x9ac7('0x38'))){_0x2ad04e[_0x9ac7('0x1d')]=qs[_0x9ac7('0x1d')](_0x288270['query'][_0x9ac7('0x1d')]);_0x2ad04e[_0x9ac7('0x1c')]=qs[_0x9ac7('0x1c')](_0x288270[_0x9ac7('0x31')][_0x9ac7('0x1c')]);}_0x2ad04e[_0x9ac7('0x39')]=qs[_0x9ac7('0x3a')](_0x288270[_0x9ac7('0x31')][_0x9ac7('0x3a')]);_0x2ad04e[_0x9ac7('0x3b')]=qs[_0x9ac7('0x3c')](_[_0x9ac7('0x3d')](_0x288270[_0x9ac7('0x31')],_0x3884d4[_0x9ac7('0x3c')]),_0x47e2d6);if(_0x288270[_0x9ac7('0x31')]['filter']){_0x2ad04e['where']=_[_0x9ac7('0x3e')](_0x2ad04e[_0x9ac7('0x3b')],{'$or':_[_0x9ac7('0x2b')](_0x47e2d6,function(_0x1da1d2){if(_0x1da1d2[_0x9ac7('0x2e')]!=='VIRTUAL'){var _0x4728f6={};_0x4728f6[_0x1da1d2[_0x9ac7('0x29')]]={'$like':'%'+_0x288270[_0x9ac7('0x31')][_0x9ac7('0x3f')]+'%'};return _0x4728f6;}})});}_0x2ad04e=_[_0x9ac7('0x3e')]({},_0x2ad04e,_0x288270['options']);var _0x7d230e={'where':_0x2ad04e['where']};return db[_0x9ac7('0x2c')]['count'](_0x7d230e)[_0x9ac7('0x22')](function(_0x5364e3){_0x41e0d7[_0x9ac7('0x1b')]=_0x5364e3;if(_0x288270[_0x9ac7('0x31')][_0x9ac7('0x40')]){_0x2ad04e[_0x9ac7('0x41')]=[{'all':!![]}];}return db['Disposition'][_0x9ac7('0x42')](_0x2ad04e);})['then'](function(_0x543449){_0x41e0d7[_0x9ac7('0x43')]=_0x543449;return _0x41e0d7;})[_0x9ac7('0x22')](respondWithFilteredResult(_0x3804a3,_0x2ad04e))[_0x9ac7('0x44')](handleError(_0x3804a3,null));};exports['show']=function(_0x195042,_0x3c5ff8){var _0x1e653c={'raw':!![],'where':{'id':_0x195042['params']['id']}},_0x540a88={};_0x540a88[_0x9ac7('0x30')]=_['keys'](db[_0x9ac7('0x2c')][_0x9ac7('0x45')]);_0x540a88[_0x9ac7('0x31')]=_[_0x9ac7('0x32')](_0x195042['query']);_0x540a88[_0x9ac7('0x3c')]=_['intersection'](_0x540a88[_0x9ac7('0x30')],_0x540a88[_0x9ac7('0x31')]);_0x1e653c[_0x9ac7('0x35')]=_[_0x9ac7('0x33')](_0x540a88[_0x9ac7('0x30')],qs[_0x9ac7('0x34')](_0x195042[_0x9ac7('0x31')]['fields']));_0x1e653c['attributes']=_0x1e653c[_0x9ac7('0x35')][_0x9ac7('0x36')]?_0x1e653c[_0x9ac7('0x35')]:_0x540a88['model'];if(_0x195042['query'][_0x9ac7('0x40')]){_0x1e653c[_0x9ac7('0x41')]=[{'all':!![]}];}_0x1e653c=_['merge']({},_0x1e653c,_0x195042['options']);return db[_0x9ac7('0x2c')][_0x9ac7('0x46')](_0x1e653c)[_0x9ac7('0x22')](handleEntityNotFound(_0x3c5ff8,null))[_0x9ac7('0x22')](respondWithResult(_0x3c5ff8,null))[_0x9ac7('0x44')](handleError(_0x3c5ff8,null));};exports[_0x9ac7('0x47')]=function(_0x586a21,_0x53af2e){return db['Disposition'][_0x9ac7('0x47')](_0x586a21['body'],{})[_0x9ac7('0x22')](function(_0x2313a0){var _0x5196b7=_0x586a21[_0x9ac7('0x48')][_0x9ac7('0x24')]({'plain':!![]});if(!_0x5196b7)throw new Error(_0x9ac7('0x49'));if(_0x5196b7[_0x9ac7('0x4a')]===_0x9ac7('0x48')){var _0x4e06a6=_0x2313a0[_0x9ac7('0x24')]({'plain':!![]});var _0x27f112=_0x9ac7('0x25');return db[_0x9ac7('0x4b')]['find']({'where':{'name':_0x27f112,'userProfileId':_0x5196b7[_0x9ac7('0x4c')]},'raw':!![]})['then'](function(_0x24f021){if(_0x24f021&&_0x24f021[_0x9ac7('0x4d')]===0x0){return db[_0x9ac7('0x4e')][_0x9ac7('0x47')]({'name':_0x4e06a6['name'],'resourceId':_0x4e06a6['id'],'type':_0x24f021[_0x9ac7('0x29')],'sectionId':_0x24f021['id']},{})[_0x9ac7('0x22')](function(){return _0x2313a0;});}else{return _0x2313a0;}})['catch'](function(_0x3aaa84){logger[_0x9ac7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3aaa84);throw _0x3aaa84;});}return _0x2313a0;})[_0x9ac7('0x22')](respondWithResult(_0x53af2e,0xc9))[_0x9ac7('0x44')](handleError(_0x53af2e,null));};exports[_0x9ac7('0x21')]=function(_0x440b42,_0x3e102e){if(_0x440b42[_0x9ac7('0x4f')]['id']){delete _0x440b42[_0x9ac7('0x4f')]['id'];}return db[_0x9ac7('0x2c')]['find']({'where':{'id':_0x440b42['params']['id']}})[_0x9ac7('0x22')](handleEntityNotFound(_0x3e102e,null))[_0x9ac7('0x22')](saveUpdates(_0x440b42[_0x9ac7('0x4f')],null))[_0x9ac7('0x22')](respondWithResult(_0x3e102e,null))[_0x9ac7('0x44')](handleError(_0x3e102e,null));};exports[_0x9ac7('0x23')]=function(_0x29f18a,_0x494273){return db[_0x9ac7('0x2c')][_0x9ac7('0x46')]({'where':{'id':_0x29f18a[_0x9ac7('0x50')]['id']}})['then'](handleEntityNotFound(_0x494273,null))[_0x9ac7('0x22')](removeEntity(_0x494273,null))['catch'](handleError(_0x494273,null));};
\ No newline at end of file
index ed4d2b7..235ba49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5292=['path','rimraf','./disposition.attributes','define','Disposition','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','bluebird','request-promise'];(function(_0x4dc775,_0x10b681){var _0x3486e1=function(_0x6b560a){while(--_0x6b560a){_0x4dc775['push'](_0x4dc775['shift']());}};_0x3486e1(++_0x10b681);}(_0x5292,0xf7));var _0x2529=function(_0x37a4cc,_0x1531a8){_0x37a4cc=_0x37a4cc-0x0;var _0x4ffbbf=_0x5292[_0x37a4cc];return _0x4ffbbf;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var fs=require('fs');var path=require(_0x2529('0x5'));var rimraf=require(_0x2529('0x6'));var config=require('../../config/environment');var attributes=require(_0x2529('0x7'));module['exports']=function(_0x4c9b4c,_0x4e7a9e){return _0x4c9b4c[_0x2529('0x8')](_0x2529('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x2529('0xa'),_0x2529('0xb')]},{'unique':!![],'name':'name_chat','fields':[_0x2529('0xa'),_0x2529('0xc')]},{'unique':!![],'name':_0x2529('0xd'),'fields':[_0x2529('0xa'),_0x2529('0xe')]},{'unique':!![],'name':_0x2529('0xf'),'fields':[_0x2529('0xa'),_0x2529('0x10')]},{'unique':!![],'name':'name_fax','fields':[_0x2529('0xa'),_0x2529('0x11')]},{'unique':!![],'name':'name_openchannel','fields':[_0x2529('0xa'),_0x2529('0x12')]},{'unique':!![],'name':_0x2529('0x13'),'fields':[_0x2529('0xa'),_0x2529('0x14')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9ce=['ChatWebsiteId','name_mail','name','MailAccountId','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name_chat'];(function(_0x3357c6,_0x502d41){var _0x11ab3b=function(_0x4d24dc){while(--_0x4d24dc){_0x3357c6['push'](_0x3357c6['shift']());}};_0x11ab3b(++_0x502d41);}(_0xd9ce,0xeb));var _0xed9c=function(_0x5c325f,_0x3968b1){_0x5c325f=_0x5c325f-0x0;var _0x12cb72=_0xd9ce[_0x5c325f];return _0x12cb72;};'use strict';var _=require(_0xed9c('0x0'));var util=require(_0xed9c('0x1'));var logger=require(_0xed9c('0x2'))(_0xed9c('0x3'));var moment=require(_0xed9c('0x4'));var BPromise=require(_0xed9c('0x5'));var rp=require(_0xed9c('0x6'));var fs=require('fs');var path=require(_0xed9c('0x7'));var rimraf=require('rimraf');var config=require(_0xed9c('0x8'));var attributes=require(_0xed9c('0x9'));module[_0xed9c('0xa')]=function(_0x154e9d,_0x3043a6){return _0x154e9d[_0xed9c('0xb')]('Disposition',attributes,{'tableName':_0xed9c('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xed9c('0xd'),'fields':['name','ListId']},{'unique':!![],'name':_0xed9c('0xe'),'fields':['name',_0xed9c('0xf')]},{'unique':!![],'name':_0xed9c('0x10'),'fields':[_0xed9c('0x11'),_0xed9c('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0xed9c('0x11'),_0xed9c('0x13')]},{'unique':!![],'name':_0xed9c('0x14'),'fields':[_0xed9c('0x11'),_0xed9c('0x15')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0xed9c('0x16')]},{'unique':!![],'name':_0xed9c('0x17'),'fields':[_0xed9c('0x11'),_0xed9c('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
index 0d6665c..3b20d35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b8a=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x9b8a,0x17c));var _0xa9b8=function(_0x5eed57,_0x224dc5){_0x5eed57=_0x5eed57-0x0;var _0x1ca877=_0x9b8a[_0x5eed57];return _0x1ca877;};'use strict';var _=require(_0xa9b8('0x0'));var util=require(_0xa9b8('0x1'));var moment=require(_0xa9b8('0x2'));var BPromise=require('bluebird');var rs=require(_0xa9b8('0x3'));var fs=require('fs');var Redis=require(_0xa9b8('0x4'));var db=require(_0xa9b8('0x5'))['db'];var utils=require(_0xa9b8('0x6'));var logger=require(_0xa9b8('0x7'))(_0xa9b8('0x8'));var config=require(_0xa9b8('0x9'));var jayson=require(_0xa9b8('0xa'));var client=jayson[_0xa9b8('0xb')][_0xa9b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ec709,_0x1dfa78,_0x38178f){return new BPromise(function(_0x249101,_0x7d6e22){return client['request'](_0x1ec709,_0x38178f)[_0xa9b8('0xd')](function(_0x186ddf){logger[_0xa9b8('0xe')](_0xa9b8('0xf'),_0x1dfa78,_0xa9b8('0x10'));logger[_0xa9b8('0x11')](_0xa9b8('0x12'),_0x1dfa78,'request\x20sent',JSON[_0xa9b8('0x13')](_0x186ddf));if(_0x186ddf[_0xa9b8('0x14')]){if(_0x186ddf[_0xa9b8('0x14')][_0xa9b8('0x15')]===0x1f4){logger[_0xa9b8('0x14')](_0xa9b8('0xf'),_0x1dfa78,_0x186ddf[_0xa9b8('0x14')]['message']);return _0x7d6e22(_0x186ddf[_0xa9b8('0x14')][_0xa9b8('0x16')]);}logger['error']('Disposition,\x20%s,\x20%s',_0x1dfa78,_0x186ddf[_0xa9b8('0x14')][_0xa9b8('0x16')]);return _0x249101(_0x186ddf[_0xa9b8('0x14')][_0xa9b8('0x16')]);}else{logger[_0xa9b8('0xe')](_0xa9b8('0xf'),_0x1dfa78,_0xa9b8('0x10'));_0x249101(_0x186ddf[_0xa9b8('0x17')]['message']);}})[_0xa9b8('0x18')](function(_0x12caa5){logger[_0xa9b8('0x14')](_0xa9b8('0xf'),_0x1dfa78,_0x12caa5);_0x7d6e22(_0x12caa5);});});}
\ No newline at end of file
+var _0xb26e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5593e8,_0x2d805d){var _0x556bc6=function(_0x31da01){while(--_0x31da01){_0x5593e8['push'](_0x5593e8['shift']());}};_0x556bc6(++_0x2d805d);}(_0xb26e,0x8a));var _0xeb26=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0xb26e[_0x155c64];return _0x1f154a;};'use strict';var _=require(_0xeb26('0x0'));var util=require('util');var moment=require(_0xeb26('0x1'));var BPromise=require(_0xeb26('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb26('0x3'));var db=require(_0xeb26('0x4'))['db'];var utils=require(_0xeb26('0x5'));var logger=require(_0xeb26('0x6'))(_0xeb26('0x7'));var config=require(_0xeb26('0x8'));var jayson=require(_0xeb26('0x9'));var client=jayson[_0xeb26('0xa')][_0xeb26('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3647c6,_0x2ef758,_0x56226c){return new BPromise(function(_0x36027a,_0x384151){return client['request'](_0x3647c6,_0x56226c)[_0xeb26('0xc')](function(_0x299478){logger[_0xeb26('0xd')](_0xeb26('0xe'),_0x2ef758,_0xeb26('0xf'));logger[_0xeb26('0x10')](_0xeb26('0x11'),_0x2ef758,'request\x20sent',JSON[_0xeb26('0x12')](_0x299478));if(_0x299478[_0xeb26('0x13')]){if(_0x299478[_0xeb26('0x13')][_0xeb26('0x14')]===0x1f4){logger[_0xeb26('0x13')]('Disposition,\x20%s,\x20%s',_0x2ef758,_0x299478[_0xeb26('0x13')][_0xeb26('0x15')]);return _0x384151(_0x299478[_0xeb26('0x13')][_0xeb26('0x15')]);}logger[_0xeb26('0x13')](_0xeb26('0xe'),_0x2ef758,_0x299478[_0xeb26('0x13')][_0xeb26('0x15')]);return _0x36027a(_0x299478[_0xeb26('0x13')][_0xeb26('0x15')]);}else{logger['info']('Disposition,\x20%s,\x20%s',_0x2ef758,_0xeb26('0xf'));_0x36027a(_0x299478[_0xeb26('0x16')][_0xeb26('0x15')]);}})[_0xeb26('0x17')](function(_0x389473){logger[_0xeb26('0x13')]('Disposition,\x20%s,\x20%s',_0x2ef758,_0x389473);_0x384151(_0x389473);});});}
\ No newline at end of file
index 2afe00d..f84d8e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a2=['update','delete','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','put'];(function(_0x25da9f,_0x47d72c){var _0x447588=function(_0x212fa5){while(--_0x212fa5){_0x25da9f['push'](_0x25da9f['shift']());}};_0x447588(++_0x47d72c);}(_0xc2a2,0x84));var _0x2c2a=function(_0x5ec027,_0x10e15d){_0x5ec027=_0x5ec027-0x0;var _0xd83081=_0xc2a2[_0x5ec027];return _0xd83081;};'use strict';var multer=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var path=require(_0x2c2a('0x2'));var timeout=require(_0x2c2a('0x3'));var express=require('express');var router=express[_0x2c2a('0x4')]();var auth=require(_0x2c2a('0x5'));var interaction=require(_0x2c2a('0x6'));var config=require('../../config/environment');var controller=require(_0x2c2a('0x7'));router[_0x2c2a('0x8')]('/',auth[_0x2c2a('0x9')](),controller[_0x2c2a('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2c2a('0x9')](),controller['create']);router[_0x2c2a('0xb')]('/:id',auth[_0x2c2a('0x9')](),controller[_0x2c2a('0xc')]);router[_0x2c2a('0xd')](_0x2c2a('0xe'),auth[_0x2c2a('0x9')](),controller[_0x2c2a('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x0120=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','show','post','create','/:id','update','delete','exports','multer','util','path'];(function(_0x3e5b0d,_0x4f14f4){var _0x42eb8c=function(_0x400258){while(--_0x400258){_0x3e5b0d['push'](_0x3e5b0d['shift']());}};_0x42eb8c(++_0x4f14f4);}(_0x0120,0x6f));var _0x0012=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0120[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var path=require(_0x0012('0x2'));var timeout=require(_0x0012('0x3'));var express=require(_0x0012('0x4'));var router=express[_0x0012('0x5')]();var auth=require(_0x0012('0x6'));var interaction=require(_0x0012('0x7'));var config=require(_0x0012('0x8'));var controller=require(_0x0012('0x9'));router[_0x0012('0xa')]('/',auth[_0x0012('0xb')](),controller['index']);router['get']('/:id',auth[_0x0012('0xb')](),controller[_0x0012('0xc')]);router[_0x0012('0xd')]('/',auth[_0x0012('0xb')](),controller[_0x0012('0xe')]);router['put'](_0x0012('0xf'),auth[_0x0012('0xb')](),controller[_0x0012('0x10')]);router[_0x0012('0x11')]('/:id',auth[_0x0012('0xb')](),controller['destroy']);module[_0x0012('0x12')]=router;
\ No newline at end of file
index 28261c2..4253dff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11db=['setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x326a7a,_0x5d77e9){var _0x50273c=function(_0x928933){while(--_0x928933){_0x326a7a['push'](_0x326a7a['shift']());}};_0x50273c(++_0x5d77e9);}(_0x11db,0x15b));var _0xb11d=function(_0x522c6d,_0x4d250d){_0x522c6d=_0x522c6d-0x0;var _0x26300d=_0x11db[_0x522c6d];return _0x26300d;};'use strict';var Sequelize=require(_0xb11d('0x0'));module[_0xb11d('0x1')]={'name':{'type':Sequelize[_0xb11d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb11d('0x2')]},'ecm':{'type':Sequelize[_0xb11d('0x3')](_0xb11d('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xb11d('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xb11d('0x2')],'unique':_0xb11d('0x5')},'minrate':{'type':Sequelize[_0xb11d('0x3')]('2400',_0xb11d('0x6'),_0xb11d('0x7'),_0xb11d('0x8'),_0xb11d('0x9'),'14400'),'defaultValue':_0xb11d('0x6')},'maxrate':{'type':Sequelize[_0xb11d('0x3')]('2400',_0xb11d('0x6'),'7200','9600',_0xb11d('0x9'),_0xb11d('0xa')),'defaultValue':_0xb11d('0xa')},'modem':{'type':Sequelize[_0xb11d('0x2')],'defaultValue':_0xb11d('0xb')},'gateway':{'type':Sequelize[_0xb11d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb11d('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb11d('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb11d('0x3')]('SIP',_0xb11d('0xd'),_0xb11d('0xe'),_0xb11d('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xb11d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb11d('0x10')],'defaultValue':function(){return _0xb11d('0x11');}},'notificationSound':{'type':Sequelize[_0xb11d('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb11d('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb11d('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb11d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb11d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb11d('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xb11d('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb11d('0x14'),'set':function(_0x2ea68c){if(!_0x2ea68c)this[_0xb11d('0x15')]('mandatoryDispositionPauseId',null);this[_0xb11d('0x15')](_0xb11d('0x16'),_0x2ea68c);}}};
\ No newline at end of file
+var _0x933a=['4800','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','7200','9600','12000'];(function(_0x44b91b,_0x182042){var _0xfeb56b=function(_0x3db83f){while(--_0x3db83f){_0x44b91b['push'](_0x44b91b['shift']());}};_0xfeb56b(++_0x182042);}(_0x933a,0xae));var _0xa933=function(_0x5a0d2c,_0x37abcf){_0x5a0d2c=_0x5a0d2c-0x0;var _0x4ff288=_0x933a[_0x5a0d2c];return _0x4ff288;};'use strict';var Sequelize=require(_0xa933('0x0'));module['exports']={'name':{'type':Sequelize[_0xa933('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa933('0x1')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xa933('0x2')},'headerinfo':{'type':Sequelize[_0xa933('0x1')],'defaultValue':_0xa933('0x3')},'localstationid':{'type':Sequelize[_0xa933('0x1')],'unique':_0xa933('0x4')},'minrate':{'type':Sequelize[_0xa933('0x5')](_0xa933('0x6'),'4800',_0xa933('0x7'),_0xa933('0x8'),_0xa933('0x9'),'14400'),'defaultValue':_0xa933('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0xa933('0x6'),_0xa933('0xa'),_0xa933('0x7'),_0xa933('0x8'),_0xa933('0x9'),_0xa933('0xb')),'defaultValue':_0xa933('0xb')},'modem':{'type':Sequelize[_0xa933('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa933('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xa933('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xa933('0x5')](_0xa933('0xd'),_0xa933('0xe'),_0xa933('0xf'),_0xa933('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xa933('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa933('0x11')],'defaultValue':function(){return _0xa933('0x12');}},'notificationSound':{'type':Sequelize[_0xa933('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa933('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa933('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa933('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa933('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa933('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa933('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa933('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa933('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5854a7){if(!_0x5854a7)this[_0xa933('0x14')](_0xa933('0x15'),null);this[_0xa933('0x14')](_0xa933('0x16'),_0x5854a7);}}};
\ No newline at end of file
index ed6f5aa..da491c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f9d=['createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','CmList','CmContact','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','spread','ContactId','dataValues','Messages','SendFax','addAgents','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','limit','set','Content-Range','reject','save','update','FaxAccounts','destroy','end','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','count','includeAll','show','params','keys','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','findOne','pick','filter','rows','removeDispositions','addAnswer','CannedAnswer','findAll','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','priority','getApplications','context','app','Fax\x20Extension','appdata','push','Answer','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','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','get','VoiceExtension','tech','key'];(function(_0x59e2a3,_0x4b0e39){var _0xad8489=function(_0x597d2a){while(--_0x597d2a){_0x59e2a3['push'](_0x59e2a3['shift']());}};_0xad8489(++_0x4b0e39);}(_0x2f9d,0x1a6));var _0xd2f9=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x2f9d[_0x36dfbd];return _0x4ecad9;};'use strict';var pdf=require(_0xd2f9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd2f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd2f9('0x2'));var rp=require(_0xd2f9('0x3'));var moment=require(_0xd2f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd2f9('0x5'));var util=require(_0xd2f9('0x6'));var path=require(_0xd2f9('0x7'));var sox=require(_0xd2f9('0x8'));var csv=require(_0xd2f9('0x9'));var ejs=require(_0xd2f9('0xa'));var fs=require('fs');var _=require(_0xd2f9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd2f9('0xc'));var deskjs=require(_0xd2f9('0xd'));var toCsv=require(_0xd2f9('0x9'));var querystring=require(_0xd2f9('0xe'));var Papa=require(_0xd2f9('0xf'));var Redis=require('ioredis');var authService=require(_0xd2f9('0x10'));var qs=require(_0xd2f9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd2f9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xd2f9('0x13'));var config=require(_0xd2f9('0x14'));var db=require(_0xd2f9('0x15'))['db'];config[_0xd2f9('0x16')]=_[_0xd2f9('0x17')](config['redis'],{'host':_0xd2f9('0x18'),'port':0x18eb});var socket=require(_0xd2f9('0x19'))(new Redis(config[_0xd2f9('0x16')]));require(_0xd2f9('0x1a'))[_0xd2f9('0x1b')](socket);var jayson=require(_0xd2f9('0x1c'));var client=jayson[_0xd2f9('0x1d')][_0xd2f9('0x1e')]({'port':0x232c});var client9002=jayson[_0xd2f9('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x3736b3,_0x8dc00b,_0x2348f3){if(_0x2348f3){var _0x2a8d66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a8d66[_0xd2f9('0x1f')](_0x8dc00b)){return _0x3736b3;}else{throw new db[(_0xd2f9('0x20'))][(_0xd2f9('0x21'))](_0xd2f9('0x22'));}}else{return _0x3736b3;}}function respondWithRpcPromise(_0x556152,_0x56631a,_0x240b7c,_0x367251){return new BPromise(function(_0x144c8a,_0x83ccd6){var _0xb6b04a=_0x367251||client;return _0xb6b04a[_0xd2f9('0x23')](_0x556152,_0x240b7c)[_0xd2f9('0x24')](function(_0x563ddb){logger[_0xd2f9('0x25')](_0xd2f9('0x26'),_0x56631a,_0xd2f9('0x27'));logger[_0xd2f9('0x28')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x56631a,_0xd2f9('0x27'),JSON[_0xd2f9('0x29')](_0x563ddb));if(_0x563ddb[_0xd2f9('0x2a')]){if(_0x563ddb[_0xd2f9('0x2a')][_0xd2f9('0x2b')]===0x1f4){logger[_0xd2f9('0x2a')](_0xd2f9('0x26'),_0x56631a,_0x563ddb[_0xd2f9('0x2a')]['message']);return _0x83ccd6(_0x563ddb[_0xd2f9('0x2a')]['message']);}logger[_0xd2f9('0x2a')](_0xd2f9('0x26'),_0x56631a,_0x563ddb[_0xd2f9('0x2a')][_0xd2f9('0x2c')]);return _0x144c8a(_0x563ddb[_0xd2f9('0x2a')][_0xd2f9('0x2c')]);}else{logger[_0xd2f9('0x25')](_0xd2f9('0x26'),_0x56631a,_0xd2f9('0x27'));_0x144c8a(_0x563ddb[_0xd2f9('0x2d')][_0xd2f9('0x2c')]);}})[_0xd2f9('0x2e')](function(_0x2754a8){logger[_0xd2f9('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x56631a,_0x2754a8);_0x83ccd6(_0x2754a8);});});}function respondWithStatusCode(_0x2f20df,_0x1d9035){_0x1d9035=_0x1d9035||0xcc;return function(_0x2b62df){if(_0x2b62df){return _0x2f20df['sendStatus'](_0x1d9035);}return _0x2f20df[_0xd2f9('0x2f')](_0x1d9035)['end']();};}function respondWithResult(_0xca4e1c,_0x15de37){_0x15de37=_0x15de37||0xc8;return function(_0x4766ff){if(_0x4766ff){return _0xca4e1c[_0xd2f9('0x2f')](_0x15de37)[_0xd2f9('0x30')](_0x4766ff);}};}function respondWithFilteredResult(_0xd70c38,_0x391ed1){return function(_0x3df018){if(_0x3df018){var _0x47b083=_0x3df018['count'],_0x5c201e=_0x391ed1[_0xd2f9('0x31')],_0x2a92cc=_0x391ed1[_0xd2f9('0x31')]+_0x391ed1[_0xd2f9('0x32')],_0x1a8be4;if(_0x2a92cc>=_0x47b083){_0x2a92cc=_0x47b083;_0x1a8be4=0xc8;}else{_0x1a8be4=0xce;}_0xd70c38[_0xd2f9('0x2f')](_0x1a8be4);return _0xd70c38[_0xd2f9('0x33')](_0xd2f9('0x34'),_0x5c201e+'-'+_0x2a92cc+'/'+_0x47b083)[_0xd2f9('0x30')](_0x3df018);}return null;};}function patchUpdates(_0x341ceb){return function(_0x3c5368){try{jsonpatch['apply'](_0x3c5368,_0x341ceb,!![]);}catch(_0x550401){return BPromise[_0xd2f9('0x35')](_0x550401);}return _0x3c5368[_0xd2f9('0x36')]();};}function saveUpdates(_0x2d1f52,_0x2a9a97){return function(_0x581add){if(_0x581add){return _0x581add[_0xd2f9('0x37')](_0x2d1f52)[_0xd2f9('0x24')](function(_0x37a285){return _0x37a285;});}return null;};}function removeEntity(_0x3aac0c,_0x5d2c1c){return function(_0x3f337a){if(_0x3f337a){return _0x3f337a['destroy']()[_0xd2f9('0x24')](function(){var _0x260b6b=_0x3f337a['get']({'plain':!![]});var _0x491f62=_0xd2f9('0x38');return db['UserProfileResource'][_0xd2f9('0x39')]({'where':{'type':_0x491f62,'resourceId':_0x260b6b['id']}})[_0xd2f9('0x24')](function(){return _0x3f337a;});})[_0xd2f9('0x24')](function(){_0x3aac0c[_0xd2f9('0x2f')](0xcc)[_0xd2f9('0x3a')]();});}};}function handleEntityNotFound(_0x477678,_0xd3a085){return function(_0x609282){if(!_0x609282){_0x477678[_0xd2f9('0x3b')](0x194);}return _0x609282;};}function handleError(_0x392a61,_0x54dbeb){_0x54dbeb=_0x54dbeb||0x1f4;return function(_0x21187d){logger[_0xd2f9('0x2a')](_0x21187d[_0xd2f9('0x3c')]);if(_0x21187d['name']){delete _0x21187d[_0xd2f9('0x3d')];}_0x392a61[_0xd2f9('0x2f')](_0x54dbeb)['send'](_0x21187d);};}exports[_0xd2f9('0x3e')]=function(_0x18f789,_0x2c80cb){var _0x86dde8={'include':[{'model':db[_0xd2f9('0x3f')],'as':_0xd2f9('0x40')}]},_0x189a86={},_0xf3e5ae={'count':0x0,'rows':[]};var _0x291725=_[_0xd2f9('0x41')](db[_0xd2f9('0x42')][_0xd2f9('0x43')],function(_0x510017){return{'name':_0x510017[_0xd2f9('0x44')],'type':_0x510017[_0xd2f9('0x45')]['key']};});_0x189a86[_0xd2f9('0x46')]=_['map'](_0x291725,'name');_0x189a86[_0xd2f9('0x47')]=_['keys'](_0x18f789[_0xd2f9('0x47')]);_0x189a86[_0xd2f9('0x48')]=_[_0xd2f9('0x49')](_0x189a86['model'],_0x189a86[_0xd2f9('0x47')]);_0x86dde8[_0xd2f9('0x4a')]=_['intersection'](_0x189a86[_0xd2f9('0x46')],qs[_0xd2f9('0x4b')](_0x18f789['query'][_0xd2f9('0x4b')]));_0x86dde8[_0xd2f9('0x4a')]=_0x86dde8[_0xd2f9('0x4a')][_0xd2f9('0x4c')]?_0x86dde8[_0xd2f9('0x4a')]:_0x189a86['model'];if(!_0x18f789[_0xd2f9('0x47')][_0xd2f9('0x4d')](_0xd2f9('0x4e'))){_0x86dde8[_0xd2f9('0x32')]=qs[_0xd2f9('0x32')](_0x18f789['query'][_0xd2f9('0x32')]);_0x86dde8[_0xd2f9('0x31')]=qs[_0xd2f9('0x31')](_0x18f789['query'][_0xd2f9('0x31')]);}_0x86dde8[_0xd2f9('0x4f')]=qs[_0xd2f9('0x50')](_0x18f789[_0xd2f9('0x47')][_0xd2f9('0x50')]);_0x86dde8[_0xd2f9('0x51')]=qs[_0xd2f9('0x48')](_['pick'](_0x18f789[_0xd2f9('0x47')],_0x189a86['filters']),_0x291725);if(_0x18f789[_0xd2f9('0x47')]['filter']){_0x86dde8[_0xd2f9('0x51')]=_[_0xd2f9('0x52')](_0x86dde8[_0xd2f9('0x51')],{'$or':_['map'](_0x291725,function(_0x242a01){if(_0x242a01[_0xd2f9('0x45')]!==_0xd2f9('0x53')){var _0x1d67de={};_0x1d67de[_0x242a01[_0xd2f9('0x3d')]]={'$like':'%'+_0x18f789[_0xd2f9('0x47')]['filter']+'%'};return _0x1d67de;}})});}_0x86dde8=_[_0xd2f9('0x52')]({},_0x86dde8,_0x18f789['options']);var _0x14fcea={'where':_0x86dde8[_0xd2f9('0x51')]};return db[_0xd2f9('0x42')][_0xd2f9('0x54')](_0x14fcea)[_0xd2f9('0x24')](function(_0x59d3ba){_0xf3e5ae[_0xd2f9('0x54')]=_0x59d3ba;if(_0x18f789[_0xd2f9('0x47')][_0xd2f9('0x55')]){_0x86dde8['include']=[{'all':!![]}];}return db[_0xd2f9('0x42')]['findAll'](_0x86dde8);})[_0xd2f9('0x24')](function(_0x12c081){_0xf3e5ae['rows']=_0x12c081;return _0xf3e5ae;})[_0xd2f9('0x24')](respondWithFilteredResult(_0x2c80cb,_0x86dde8))['catch'](handleError(_0x2c80cb,null));};exports[_0xd2f9('0x56')]=function(_0x41f733,_0x2c91b6){var _0x484051={'raw':![],'where':{'id':_0x41f733[_0xd2f9('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xd2f9('0x40')}]},_0x38f7c5={};_0x38f7c5[_0xd2f9('0x46')]=_[_0xd2f9('0x58')](db[_0xd2f9('0x42')][_0xd2f9('0x43')]);_0x38f7c5[_0xd2f9('0x47')]=_[_0xd2f9('0x58')](_0x41f733['query']);_0x38f7c5['filters']=_[_0xd2f9('0x49')](_0x38f7c5[_0xd2f9('0x46')],_0x38f7c5[_0xd2f9('0x47')]);_0x484051[_0xd2f9('0x4a')]=_['intersection'](_0x38f7c5['model'],qs['fields'](_0x41f733[_0xd2f9('0x47')][_0xd2f9('0x4b')]));_0x484051[_0xd2f9('0x4a')]=_0x484051[_0xd2f9('0x4a')][_0xd2f9('0x4c')]?_0x484051[_0xd2f9('0x4a')]:_0x38f7c5[_0xd2f9('0x46')];if(_0x41f733[_0xd2f9('0x47')][_0xd2f9('0x55')]){_0x484051[_0xd2f9('0x59')]=[{'all':!![]}];}_0x484051=_[_0xd2f9('0x52')]({},_0x484051,_0x41f733[_0xd2f9('0x5a')]);return db[_0xd2f9('0x42')][_0xd2f9('0x5b')](_0x484051)[_0xd2f9('0x24')](handleEntityNotFound(_0x2c91b6,null))[_0xd2f9('0x24')](respondWithResult(_0x2c91b6,null))['catch'](handleError(_0x2c91b6,null));};exports['create']=function(_0x4018b7,_0xfe5822){return db[_0xd2f9('0x42')][_0xd2f9('0x5c')](_0x4018b7[_0xd2f9('0x5d')],{})[_0xd2f9('0x24')](function(_0x1df1e5){var _0x67e08=_0x4018b7[_0xd2f9('0x5e')]['get']({'plain':!![]});if(!_0x67e08)throw new Error(_0xd2f9('0x5f'));if(_0x67e08['role']===_0xd2f9('0x5e')){var _0x2fa62b=_0x1df1e5['get']({'plain':!![]});var _0x4554b3=_0xd2f9('0x38');return db['UserProfileSection']['find']({'where':{'name':_0x4554b3,'userProfileId':_0x67e08['userProfileId']},'raw':!![]})[_0xd2f9('0x24')](function(_0x517a71){if(_0x517a71&&_0x517a71['autoAssociation']===0x0){return db['UserProfileResource'][_0xd2f9('0x5c')]({'name':_0x2fa62b[_0xd2f9('0x3d')],'resourceId':_0x2fa62b['id'],'type':_0x517a71['name'],'sectionId':_0x517a71['id']},{})[_0xd2f9('0x24')](function(){return _0x1df1e5;});}else{return _0x1df1e5;}})[_0xd2f9('0x2e')](function(_0x1533c5){logger[_0xd2f9('0x2a')](_0xd2f9('0x60'),_0x1533c5);throw _0x1533c5;});}return _0x1df1e5;})['then'](respondWithResult(_0xfe5822,0xc9))[_0xd2f9('0x2e')](handleError(_0xfe5822,null));};exports[_0xd2f9('0x37')]=function(_0x3228fc,_0x426131){if(_0x3228fc[_0xd2f9('0x5d')]['id']){delete _0x3228fc['body']['id'];}return db[_0xd2f9('0x42')][_0xd2f9('0x5b')]({'where':{'id':_0x3228fc[_0xd2f9('0x57')]['id']},'include':[{'model':db[_0xd2f9('0x3f')],'as':_0xd2f9('0x40')}]})['then'](handleEntityNotFound(_0x426131,null))[_0xd2f9('0x24')](saveUpdates(_0x3228fc[_0xd2f9('0x5d')],null))[_0xd2f9('0x24')](respondWithResult(_0x426131,null))['catch'](handleError(_0x426131,null));};exports[_0xd2f9('0x39')]=function(_0x717d25,_0x53af21){return db['FaxAccount'][_0xd2f9('0x5b')]({'where':{'id':_0x717d25[_0xd2f9('0x57')]['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x53af21,null))[_0xd2f9('0x24')](removeEntity(_0x53af21,null))[_0xd2f9('0x2e')](handleError(_0x53af21,null));};exports[_0xd2f9('0x61')]=function(_0x113943,_0x419db2){return db[_0xd2f9('0x42')][_0xd2f9('0x61')]()[_0xd2f9('0x24')](respondWithResult(_0x419db2,null))[_0xd2f9('0x2e')](handleError(_0x419db2,null));};exports['addDisposition']=function(_0x1d97b4,_0x36a6a4,_0x5b9682){if(_0x1d97b4[_0xd2f9('0x5d')]['id']){delete _0x1d97b4['body']['id'];}return db[_0xd2f9('0x42')]['find']({'where':{'id':_0x1d97b4[_0xd2f9('0x57')]['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x36a6a4,null))['then'](function(_0x6ee517){if(_0x6ee517){_0x1d97b4[_0xd2f9('0x5d')][_0xd2f9('0x62')]=_0x6ee517['id'];return db[_0xd2f9('0x63')]['create'](_0x1d97b4[_0xd2f9('0x5d')]);}})[_0xd2f9('0x24')](respondWithResult(_0x36a6a4,null))[_0xd2f9('0x2e')](handleError(_0x36a6a4,null));};exports[_0xd2f9('0x64')]=function(_0x206cb2,_0xcb3177,_0x13db38){var _0x2081b8={'raw':![],'where':{}};var _0x34d2b3={};var _0x455796={'count':0x0,'rows':[]};return db[_0xd2f9('0x42')][_0xd2f9('0x65')]({'where':{'id':_0x206cb2['params']['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0xcb3177,null))['then'](function(_0x523f59){if(_0x523f59){_0x34d2b3[_0xd2f9('0x46')]=_[_0xd2f9('0x58')](db[_0xd2f9('0x63')]['rawAttributes']);_0x34d2b3[_0xd2f9('0x47')]=_['keys'](_0x206cb2[_0xd2f9('0x47')]);_0x34d2b3['filters']=_[_0xd2f9('0x49')](_0x34d2b3['model'],_0x34d2b3[_0xd2f9('0x47')]);_0x2081b8[_0xd2f9('0x4a')]=_[_0xd2f9('0x49')](_0x34d2b3[_0xd2f9('0x46')],qs[_0xd2f9('0x4b')](_0x206cb2[_0xd2f9('0x47')][_0xd2f9('0x4b')]));_0x2081b8[_0xd2f9('0x4a')]=_0x2081b8[_0xd2f9('0x4a')][_0xd2f9('0x4c')]?_0x2081b8[_0xd2f9('0x4a')]:_0x34d2b3[_0xd2f9('0x46')];if(!_0x206cb2[_0xd2f9('0x47')][_0xd2f9('0x4d')](_0xd2f9('0x4e'))){_0x2081b8[_0xd2f9('0x32')]=qs[_0xd2f9('0x32')](_0x206cb2['query']['limit']);_0x2081b8['offset']=qs[_0xd2f9('0x31')](_0x206cb2['query']['offset']);}_0x2081b8[_0xd2f9('0x4f')]=qs['sort'](_0x206cb2[_0xd2f9('0x47')][_0xd2f9('0x50')]);_0x2081b8['where']=qs[_0xd2f9('0x48')](_[_0xd2f9('0x66')](_0x206cb2[_0xd2f9('0x47')],_0x34d2b3[_0xd2f9('0x48')]));_0x2081b8[_0xd2f9('0x51')]['FaxAccountId']=_0x523f59['id'];if(_0x206cb2[_0xd2f9('0x47')][_0xd2f9('0x67')]){_0x2081b8[_0xd2f9('0x51')]=_[_0xd2f9('0x52')](_0x2081b8[_0xd2f9('0x51')],{'$or':_[_0xd2f9('0x41')](_0x2081b8['attributes'],function(_0x5b2834){var _0x447b3b={};_0x447b3b[_0x5b2834]={'$like':'%'+_0x206cb2[_0xd2f9('0x47')]['filter']+'%'};return _0x447b3b;})});}_0x2081b8=_[_0xd2f9('0x52')]({},_0x2081b8,_0x206cb2[_0xd2f9('0x5a')]);return db['Disposition'][_0xd2f9('0x54')]({'where':_0x2081b8[_0xd2f9('0x51')]})['then'](function(_0x5e553c){_0x455796[_0xd2f9('0x54')]=_0x5e553c;if(_0x206cb2[_0xd2f9('0x47')]['includeAll']){_0x2081b8[_0xd2f9('0x59')]=[{'all':!![]}];}return db[_0xd2f9('0x63')]['findAll'](_0x2081b8);})[_0xd2f9('0x24')](function(_0x2c4ac5){_0x455796[_0xd2f9('0x68')]=_0x2c4ac5;return _0x455796;});}})['then'](respondWithFilteredResult(_0xcb3177,_0x2081b8))['catch'](handleError(_0xcb3177,null));};exports[_0xd2f9('0x69')]=function(_0x4be941,_0x33700f,_0x34a517){return db[_0xd2f9('0x42')]['find']({'where':{'id':_0x4be941[_0xd2f9('0x57')]['id']}})['then'](handleEntityNotFound(_0x33700f,null))['then'](function(_0x26d105){if(_0x26d105){return _0x26d105[_0xd2f9('0x69')](_0x4be941['query']['ids']);}})[_0xd2f9('0x24')](respondWithStatusCode(_0x33700f,null))[_0xd2f9('0x2e')](handleError(_0x33700f,null));};exports[_0xd2f9('0x6a')]=function(_0x56ee42,_0x19f9d1,_0x912924){if(_0x56ee42['body']['id']){delete _0x56ee42[_0xd2f9('0x5d')]['id'];}return db[_0xd2f9('0x42')][_0xd2f9('0x5b')]({'where':{'id':_0x56ee42[_0xd2f9('0x57')]['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x19f9d1,null))[_0xd2f9('0x24')](function(_0x17762c){if(_0x17762c){_0x56ee42[_0xd2f9('0x5d')][_0xd2f9('0x62')]=_0x17762c['id'];return db['CannedAnswer'][_0xd2f9('0x5c')](_0x56ee42[_0xd2f9('0x5d')]);}})['then'](respondWithResult(_0x19f9d1,null))[_0xd2f9('0x2e')](handleError(_0x19f9d1,null));};exports['getAnswers']=function(_0x13206e,_0x46af2c,_0x498721){var _0x48cb7f={'raw':![],'where':{}};var _0x508f46={};var _0x3a7b98={'count':0x0,'rows':[]};return db[_0xd2f9('0x42')][_0xd2f9('0x65')]({'where':{'id':_0x13206e['params']['id']}})['then'](handleEntityNotFound(_0x46af2c,null))[_0xd2f9('0x24')](function(_0x1185cd){if(_0x1185cd){_0x508f46['model']=_[_0xd2f9('0x58')](db['CannedAnswer']['rawAttributes']);_0x508f46['query']=_[_0xd2f9('0x58')](_0x13206e[_0xd2f9('0x47')]);_0x508f46[_0xd2f9('0x48')]=_[_0xd2f9('0x49')](_0x508f46[_0xd2f9('0x46')],_0x508f46[_0xd2f9('0x47')]);_0x48cb7f[_0xd2f9('0x4a')]=_['intersection'](_0x508f46[_0xd2f9('0x46')],qs[_0xd2f9('0x4b')](_0x13206e['query'][_0xd2f9('0x4b')]));_0x48cb7f[_0xd2f9('0x4a')]=_0x48cb7f[_0xd2f9('0x4a')][_0xd2f9('0x4c')]?_0x48cb7f[_0xd2f9('0x4a')]:_0x508f46[_0xd2f9('0x46')];if(!_0x13206e[_0xd2f9('0x47')]['hasOwnProperty']('nolimit')){_0x48cb7f[_0xd2f9('0x32')]=qs['limit'](_0x13206e[_0xd2f9('0x47')]['limit']);_0x48cb7f[_0xd2f9('0x31')]=qs[_0xd2f9('0x31')](_0x13206e['query']['offset']);}_0x48cb7f[_0xd2f9('0x4f')]=qs['sort'](_0x13206e[_0xd2f9('0x47')]['sort']);_0x48cb7f[_0xd2f9('0x51')]=qs['filters'](_[_0xd2f9('0x66')](_0x13206e[_0xd2f9('0x47')],_0x508f46[_0xd2f9('0x48')]));_0x48cb7f['where'][_0xd2f9('0x62')]=_0x1185cd['id'];if(_0x13206e['query'][_0xd2f9('0x67')]){_0x48cb7f[_0xd2f9('0x51')]=_[_0xd2f9('0x52')](_0x48cb7f[_0xd2f9('0x51')],{'$or':_[_0xd2f9('0x41')](_0x48cb7f[_0xd2f9('0x4a')],function(_0x22d97d){var _0xd48c27={};_0xd48c27[_0x22d97d]={'$like':'%'+_0x13206e[_0xd2f9('0x47')]['filter']+'%'};return _0xd48c27;})});}_0x48cb7f=_['merge']({},_0x48cb7f,_0x13206e['options']);return db[_0xd2f9('0x6b')]['count']({'where':_0x48cb7f['where']})[_0xd2f9('0x24')](function(_0x1d9ffc){_0x3a7b98[_0xd2f9('0x54')]=_0x1d9ffc;if(_0x13206e['query'][_0xd2f9('0x55')]){_0x48cb7f['include']=[{'all':!![]}];}return db[_0xd2f9('0x6b')][_0xd2f9('0x6c')](_0x48cb7f);})[_0xd2f9('0x24')](function(_0x557085){_0x3a7b98[_0xd2f9('0x68')]=_0x557085;return _0x3a7b98;});}})[_0xd2f9('0x24')](respondWithFilteredResult(_0x46af2c,_0x48cb7f))[_0xd2f9('0x2e')](handleError(_0x46af2c,null));};exports[_0xd2f9('0x6d')]=function(_0x1fe6f0,_0x2bdf1b,_0x4917e9){return db['FaxAccount'][_0xd2f9('0x5b')]({'where':{'id':_0x1fe6f0['params']['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x2bdf1b,null))[_0xd2f9('0x24')](function(_0x5af2b8){if(_0x5af2b8){return _0x5af2b8['removeAnswers'](_0x1fe6f0[_0xd2f9('0x47')][_0xd2f9('0x6e')]);}})[_0xd2f9('0x24')](respondWithStatusCode(_0x2bdf1b,null))['catch'](handleError(_0x2bdf1b,null));};exports[_0xd2f9('0x6f')]=function(_0x3de83b,_0xfd6310,_0x2902dc){return db[_0xd2f9('0x70')]['find']({'where':{'id':_0x3de83b['params']['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0xfd6310,null))[_0xd2f9('0x24')](function(_0x5416e7){if(_0x5416e7){return _0x5416e7['addInteraction'](_0x3de83b[_0xd2f9('0x5d')][_0xd2f9('0x6e')],_[_0xd2f9('0x71')](_0x3de83b[_0xd2f9('0x5d')],[_0xd2f9('0x6e'),'id'])||{});}})[_0xd2f9('0x24')](respondWithResult(_0xfd6310,null))['catch'](handleError(_0xfd6310,null));};exports[_0xd2f9('0x72')]=function(_0x2db968,_0x4c67c6,_0x2ffb6b){var _0x34c4c7={'raw':![],'where':{}};var _0x56cf9e={};var _0x53fe04={'count':0x0,'rows':[]};return db[_0xd2f9('0x42')][_0xd2f9('0x65')]({'where':{'id':_0x2db968['params']['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x4c67c6,null))[_0xd2f9('0x24')](function(_0x120f59){if(_0x120f59){_0x56cf9e[_0xd2f9('0x46')]=_['keys'](db[_0xd2f9('0x70')][_0xd2f9('0x43')]);_0x56cf9e[_0xd2f9('0x47')]=_[_0xd2f9('0x58')](_0x2db968[_0xd2f9('0x47')]);_0x56cf9e[_0xd2f9('0x48')]=_[_0xd2f9('0x49')](_0x56cf9e['model'],_0x56cf9e['query']);_0x34c4c7[_0xd2f9('0x4a')]=_[_0xd2f9('0x49')](_0x56cf9e[_0xd2f9('0x46')],qs[_0xd2f9('0x4b')](_0x2db968[_0xd2f9('0x47')][_0xd2f9('0x4b')]));_0x34c4c7[_0xd2f9('0x4a')]=_0x34c4c7['attributes'][_0xd2f9('0x4c')]?_0x34c4c7['attributes']:_0x56cf9e[_0xd2f9('0x46')];if(!_0x2db968[_0xd2f9('0x47')][_0xd2f9('0x4d')](_0xd2f9('0x4e'))){_0x34c4c7[_0xd2f9('0x32')]=qs[_0xd2f9('0x32')](_0x2db968[_0xd2f9('0x47')][_0xd2f9('0x32')]);_0x34c4c7['offset']=qs[_0xd2f9('0x31')](_0x2db968[_0xd2f9('0x47')][_0xd2f9('0x31')]);}_0x34c4c7[_0xd2f9('0x4f')]=qs['sort'](_0x2db968[_0xd2f9('0x47')][_0xd2f9('0x50')]);_0x34c4c7[_0xd2f9('0x51')]=qs['filters'](_[_0xd2f9('0x66')](_0x2db968[_0xd2f9('0x47')],_0x56cf9e[_0xd2f9('0x48')]));_0x34c4c7['where']['FaxAccountId']=_0x120f59['id'];if(_0x2db968[_0xd2f9('0x47')]['filter']){_0x34c4c7[_0xd2f9('0x51')]=_[_0xd2f9('0x52')](_0x34c4c7[_0xd2f9('0x51')],{'$or':_[_0xd2f9('0x41')](_0x34c4c7[_0xd2f9('0x4a')],function(_0x1fdec4){var _0x81db98={};_0x81db98[_0x1fdec4]={'$like':'%'+_0x2db968[_0xd2f9('0x47')][_0xd2f9('0x67')]+'%'};return _0x81db98;})});}_0x34c4c7=_['merge']({},_0x34c4c7,_0x2db968[_0xd2f9('0x5a')]);return db[_0xd2f9('0x70')][_0xd2f9('0x54')]({'where':_0x34c4c7[_0xd2f9('0x51')]})[_0xd2f9('0x24')](function(_0xf41ec3){_0x53fe04[_0xd2f9('0x54')]=_0xf41ec3;if(_0x2db968['query'][_0xd2f9('0x55')]){_0x34c4c7[_0xd2f9('0x59')]=[{'model':db['CmContact'],'as':_0xd2f9('0x73'),'required':![]},{'model':db[_0xd2f9('0x74')],'as':_0xd2f9('0x75'),'attributes':[_0xd2f9('0x3d'),_0xd2f9('0x76'),_0xd2f9('0x77')],'required':![]},{'model':db[_0xd2f9('0x78')],'as':'Tags','attributes':['id','name',_0xd2f9('0x79')],'where':_0x2db968[_0xd2f9('0x47')][_0xd2f9('0x7a')]?{'id':_0x2db968[_0xd2f9('0x47')][_0xd2f9('0x7a')]}:undefined,'required':_0x2db968['query']['tag']?!![]:![]}];}return db[_0xd2f9('0x70')][_0xd2f9('0x6c')](_0x34c4c7);})[_0xd2f9('0x24')](function(_0x13ed88){_0x53fe04[_0xd2f9('0x68')]=_0x13ed88;return _0x53fe04;});}})[_0xd2f9('0x24')](respondWithFilteredResult(_0x4c67c6,_0x34c4c7))[_0xd2f9('0x2e')](handleError(_0x4c67c6,null));};exports[_0xd2f9('0x7b')]=function(_0x4c4347,_0x250dab,_0x71127a){return db['FaxAccount'][_0xd2f9('0x65')]({'where':{'id':_0x4c4347['params']['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x250dab,null))[_0xd2f9('0x24')](function(_0x2f1d64){if(_0x2f1d64){return db[_0xd2f9('0x7c')][_0xd2f9('0x7d')](function(_0x516b90){return db[_0xd2f9('0x7e')]['destroy']({'where':{'FaxAccountId':_0x4c4347[_0xd2f9('0x57')]['id']},'transaction':_0x516b90})[_0xd2f9('0x24')](function(_0x55d0be){var _0x1ecb95=_['map'](_0x4c4347['body'],function(_0x3ac096){_0x3ac096[_0xd2f9('0x62')]=_0x4c4347[_0xd2f9('0x57')]['id'];return _0x3ac096;});return db[_0xd2f9('0x7e')][_0xd2f9('0x7f')](_0x1ecb95,{'transaction':_0x516b90});});})[_0xd2f9('0x24')](function(){return db[_0xd2f9('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x4c4347[_0xd2f9('0x57')]['id']},'order':_0xd2f9('0x80')});});}})[_0xd2f9('0x24')](respondWithResult(_0x250dab,null))[_0xd2f9('0x2e')](handleError(_0x250dab,null));};exports[_0xd2f9('0x81')]=function(_0xd04783,_0xd7fb0e,_0x16f164){var _0x53dd6d={};var _0x5600f8={};var _0x23ca66;var _0x529f19;return db['FaxAccount'][_0xd2f9('0x65')]({'where':{'id':_0xd04783[_0xd2f9('0x57')]['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0xd7fb0e,null))[_0xd2f9('0x24')](function(_0x3a8279){if(_0x3a8279){_0x23ca66=_0x3a8279;_0x5600f8[_0xd2f9('0x46')]=_[_0xd2f9('0x58')](db['FaxApplication'][_0xd2f9('0x43')]);_0x5600f8[_0xd2f9('0x47')]=_[_0xd2f9('0x58')](_0xd04783[_0xd2f9('0x47')]);_0x5600f8[_0xd2f9('0x48')]=_[_0xd2f9('0x49')](_0x5600f8['model'],_0x5600f8[_0xd2f9('0x47')]);_0x53dd6d[_0xd2f9('0x4a')]=_[_0xd2f9('0x49')](_0x5600f8['model'],qs['fields'](_0xd04783[_0xd2f9('0x47')]['fields']));_0x53dd6d[_0xd2f9('0x4a')]=_0x53dd6d[_0xd2f9('0x4a')][_0xd2f9('0x4c')]?_0x53dd6d[_0xd2f9('0x4a')]:_0x5600f8[_0xd2f9('0x46')];_0x53dd6d['order']=qs[_0xd2f9('0x50')](_0xd04783[_0xd2f9('0x47')]['sort']);_0x53dd6d[_0xd2f9('0x51')]=qs[_0xd2f9('0x48')](_[_0xd2f9('0x66')](_0xd04783[_0xd2f9('0x47')],_0x5600f8[_0xd2f9('0x48')]));if(_0xd04783['query'][_0xd2f9('0x67')]){_0x53dd6d[_0xd2f9('0x51')]=_[_0xd2f9('0x52')](_0x53dd6d[_0xd2f9('0x51')],{'$or':_[_0xd2f9('0x41')](_0x53dd6d[_0xd2f9('0x4a')],function(_0x180a67){var _0x4abe5a={};_0x4abe5a[_0x180a67]={'$like':'%'+_0xd04783[_0xd2f9('0x47')]['filter']+'%'};return _0x4abe5a;})});}_0x53dd6d=_[_0xd2f9('0x52')]({},_0x53dd6d,_0xd04783[_0xd2f9('0x5a')]);return _0x23ca66[_0xd2f9('0x81')](_0x53dd6d);}})[_0xd2f9('0x24')](function(_0x281c7e){if(_0x281c7e){_0x529f19=_0x281c7e[_0xd2f9('0x4c')];if(!_0xd04783[_0xd2f9('0x47')][_0xd2f9('0x4d')](_0xd2f9('0x4e'))){_0x53dd6d[_0xd2f9('0x32')]=qs[_0xd2f9('0x32')](_0xd04783[_0xd2f9('0x47')][_0xd2f9('0x32')]);_0x53dd6d['offset']=qs[_0xd2f9('0x31')](_0xd04783[_0xd2f9('0x47')]['offset']);}return _0x23ca66[_0xd2f9('0x81')](_0x53dd6d);}})[_0xd2f9('0x24')](function(_0x1b6575){if(_0x1b6575){return _0x1b6575?{'count':_0x529f19,'rows':_0x1b6575}:null;}})[_0xd2f9('0x24')](respondWithResult(_0xd7fb0e,null))[_0xd2f9('0x2e')](handleError(_0xd7fb0e,null));};function Extension(_0xac0b28,_0xcf1f88,_0x186f64,_0x28613f){this[_0xd2f9('0x82')]='from-voip-provider';this['exten']=_0xac0b28['localstationid'];this[_0xd2f9('0x83')]=_0x28613f;this[_0xd2f9('0x45')]='system';this['description']=_0xd2f9('0x84');this[_0xd2f9('0x62')]=_0xac0b28['id'];this[_0xd2f9('0x80')]=_0xcf1f88;this[_0xd2f9('0x85')]=_0x186f64;}function createExtensionsReciveFax(_0x37d82f){var _0x535b4c=0x1;var _0x55c1a1=[];_0x55c1a1[_0xd2f9('0x86')](new Extension(_0x37d82f,_0x535b4c,'',_0xd2f9('0x87')));_0x535b4c+=0x1;_0x55c1a1[_0xd2f9('0x86')](new Extension(_0x37d82f,_0x535b4c,'CDR(type)=inbound-fax',_0xd2f9('0x88')));_0x535b4c+=0x1;for(var _0x4468f5 in _0x37d82f){if(_0x37d82f['hasOwnProperty'](_0x4468f5)&&(_0x4468f5===_0xd2f9('0x89')||_0x4468f5===_0xd2f9('0x8a')||_0x4468f5===_0xd2f9('0x8b')||_0x4468f5===_0xd2f9('0x8c')||_0x4468f5===_0xd2f9('0x8d')||_0x4468f5===_0xd2f9('0x8e')||_0x4468f5===_0xd2f9('0x8f')||_0x4468f5===_0xd2f9('0x90')||_0x4468f5===_0xd2f9('0x91'))){_0x55c1a1['push'](new Extension(_0x37d82f,_0x535b4c,_0xd2f9('0x92')+_0x4468f5+')='+_0x37d82f[_0x4468f5],_0xd2f9('0x88')));_0x535b4c+=0x1;}}_0x55c1a1[_0xd2f9('0x86')](new Extension(_0x37d82f,_0x535b4c,'6',_0xd2f9('0x93')));_0x535b4c+=0x1;_0x55c1a1['push'](new Extension(_0x37d82f,_0x535b4c,_0xd2f9('0x94'),_0xd2f9('0x95')));_0x535b4c=0x0;return _0x55c1a1;}exports['addAccountApplications']=function(_0xed5a1e,_0x74c7d5,_0x45efe5){var _0x10f6e5;return db[_0xd2f9('0x7c')][_0xd2f9('0x7d')](function(_0x441c4e){return db[_0xd2f9('0x42')][_0xd2f9('0x5c')](_0xed5a1e[_0xd2f9('0x5d')],{'transaction':_0x441c4e})[_0xd2f9('0x24')](function(_0x4c51b0){_0x10f6e5=_0x4c51b0[_0xd2f9('0x96')]({'plain':!![]});return db[_0xd2f9('0x97')][_0xd2f9('0x7f')](createExtensionsReciveFax(_0x10f6e5),{'transaction':_0x441c4e});});})['then'](function(){return _0x10f6e5;})[_0xd2f9('0x24')](respondWithResult(_0x74c7d5,null))[_0xd2f9('0x2e')](handleError(_0x74c7d5,null));};exports['updateAccountApplications']=function(_0x1fd3bb,_0x2ead39,_0x1bb1cc){var _0xe6a75;return db['sequelize'][_0xd2f9('0x7d')](function(_0x43e341){return db['FaxAccount'][_0xd2f9('0x37')](_0x1fd3bb[_0xd2f9('0x5d')],{'where':{'id':_0x1fd3bb[_0xd2f9('0x5d')]['id']},'transaction':_0x43e341})[_0xd2f9('0x24')](function(_0x3e7d37){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x1fd3bb[_0xd2f9('0x5d')]['id']},'transaction':_0x43e341})[_0xd2f9('0x24')](function(_0x4a3bd0){return db[_0xd2f9('0x97')][_0xd2f9('0x7f')](createExtensionsReciveFax(_[_0xd2f9('0x71')](_0x1fd3bb[_0xd2f9('0x5d')],[_0xd2f9('0x98'),_0xd2f9('0x99'),_0xd2f9('0x9a'),'updatedAt',_0xd2f9('0x9b'),_0xd2f9('0x9c')])),{'transaction':_0x43e341});});});})['then'](function(){return db[_0xd2f9('0x42')][_0xd2f9('0x9d')](_0x1fd3bb[_0xd2f9('0x5d')]['id']);})[_0xd2f9('0x24')](respondWithResult(_0x2ead39,null))['catch'](handleError(_0x2ead39,null));};exports[_0xd2f9('0x9e')]=function(_0x113a6f,_0x5baff2,_0x5362fa){var _0x4db530={'raw':!![],'where':{}};var _0x251122={};var _0x4abd59={'count':0x0,'rows':[]};return db[_0xd2f9('0x42')][_0xd2f9('0x65')]({'where':{'id':_0x113a6f[_0xd2f9('0x57')]['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x5baff2,null))['then'](function(_0x316b11){if(_0x316b11){_0x251122[_0xd2f9('0x46')]=_[_0xd2f9('0x58')](db[_0xd2f9('0x9f')][_0xd2f9('0x43')]);_0x251122[_0xd2f9('0x47')]=_[_0xd2f9('0x58')](_0x113a6f['query']);_0x251122[_0xd2f9('0x48')]=_[_0xd2f9('0x49')](_0x251122[_0xd2f9('0x46')],_0x251122['query']);_0x4db530[_0xd2f9('0x4a')]=_['intersection'](_0x251122[_0xd2f9('0x46')],qs[_0xd2f9('0x4b')](_0x113a6f[_0xd2f9('0x47')]['fields']));_0x4db530[_0xd2f9('0x4a')]=_0x4db530[_0xd2f9('0x4a')]['length']?_0x4db530[_0xd2f9('0x4a')]:_0x251122[_0xd2f9('0x46')];if(!_0x113a6f['query'][_0xd2f9('0x4d')](_0xd2f9('0x4e'))){_0x4db530['limit']=qs['limit'](_0x113a6f[_0xd2f9('0x47')][_0xd2f9('0x32')]);_0x4db530[_0xd2f9('0x31')]=qs['offset'](_0x113a6f[_0xd2f9('0x47')][_0xd2f9('0x31')]);}_0x4db530[_0xd2f9('0x4f')]=qs['sort'](_0x113a6f[_0xd2f9('0x47')][_0xd2f9('0x50')]);_0x4db530[_0xd2f9('0x51')]=qs[_0xd2f9('0x48')](_['pick'](_0x113a6f[_0xd2f9('0x47')],_0x251122['filters']));_0x4db530['where']['FaxAccountId']=_0x316b11['id'];if(_0x113a6f['query'][_0xd2f9('0x67')]){_0x4db530[_0xd2f9('0x51')]=_[_0xd2f9('0x52')](_0x4db530[_0xd2f9('0x51')],{'$or':_['map'](_0x4db530[_0xd2f9('0x4a')],function(_0x7b2184){var _0x508075={};_0x508075[_0x7b2184]={'$like':'%'+_0x113a6f[_0xd2f9('0x47')][_0xd2f9('0x67')]+'%'};return _0x508075;})});}if(_0x113a6f[_0xd2f9('0x47')][_0xd2f9('0xa0')]){var _0x266333=_0x113a6f[_0xd2f9('0x47')]['$gte'][_0xd2f9('0xa1')](',');var _0x466adc={};_0x466adc[_0x266333[0x0]]={'$gte':moment(_0x266333[0x1])[_0xd2f9('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4db530[_0xd2f9('0x51')]=_[_0xd2f9('0x52')](_0x4db530[_0xd2f9('0x51')],_0x466adc);}_0x4db530=_[_0xd2f9('0x52')]({},_0x4db530,_0x113a6f[_0xd2f9('0x5a')]);return db['FaxMessage'][_0xd2f9('0x54')]({'where':_0x4db530[_0xd2f9('0x51')]})['then'](function(_0x2fdefd){_0x4abd59[_0xd2f9('0x54')]=_0x2fdefd;if(_0x113a6f['query'][_0xd2f9('0x55')]){_0x4db530[_0xd2f9('0x59')]=[{'all':!![]}];}return db[_0xd2f9('0x9f')][_0xd2f9('0x6c')](_0x4db530);})[_0xd2f9('0x24')](function(_0x47234b){_0x4abd59['rows']=_0x47234b;return _0x4abd59;});}})[_0xd2f9('0x24')](respondWithFilteredResult(_0x5baff2,_0x4db530))[_0xd2f9('0x2e')](handleError(_0x5baff2,null));};exports['send']=function(_0x5dd070,_0xa134fc,_0x5c267b){var _0x3d048a,_0x2ddb0e={},_0x2b0558;if(_0x5dd070[_0xd2f9('0x5d')]['to']){_0x2b0558=_0x5dd070['body']['to'][0x0];}return db['FaxAccount'][_0xd2f9('0x5b')]({'where':{'id':_0x5dd070['params']['id']},'include':[{'model':db[_0xd2f9('0xa3')],'as':'List','include':[{'model':db[_0xd2f9('0xa4')],'as':_0xd2f9('0xa5'),'where':{'fax':_0x2b0558},'limit':0x1,'order':[[_0xd2f9('0xa6'),_0xd2f9('0xa7')]]}]}]})[_0xd2f9('0x24')](handleEntityNotFound(_0xa134fc,null))['then'](function(_0x2e3ebb){_0x3d048a=_0x2e3ebb;if(_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')]&&_0x5dd070['body'][_0xd2f9('0xa8')][_0xd2f9('0x4c')]){for(var _0x549f0f=0x0;_0x549f0f<_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')][_0xd2f9('0x4c')];_0x549f0f+=0x1){_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')][_0x549f0f]={'filename':_0x5dd070[_0xd2f9('0x5d')]['attachments'][_0x549f0f][_0xd2f9('0x3d')],'id':_0x5dd070['body']['attachments'][_0x549f0f]['id'],'path':path[_0xd2f9('0xa9')](config['root'],_0xd2f9('0xaa'),_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')][_0x549f0f][_0xd2f9('0xab')])};}}return respondWithRpcPromise(_0xd2f9('0xac'),_0xd2f9('0xac'),{'FaxAccountId':_[_0xd2f9('0xad')](_0x5dd070['params']['id'])?undefined:_0x5dd070[_0xd2f9('0x57')]['id'],'path':_[_0xd2f9('0xad')](_0x5dd070[_0xd2f9('0x5d')]['attachments'][0x0]['path'])?undefined:_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')][0x0][_0xd2f9('0x7')],'fax':_['isNil'](_0x5dd070[_0xd2f9('0x5d')]['to'][0x0])?undefined:_0x5dd070[_0xd2f9('0x5d')]['to'][0x0]},client9002);})['then'](function(){if(_0x3d048a){if(_[_0xd2f9('0xad')](_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xae')])){_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xae')]=util[_0xd2f9('0xa2')]('\x22%s\x22\x20<%s>',_0x3d048a['name'],_0x3d048a[_0xd2f9('0xaf')]);}if(_0x3d048a['List']){if(_0x3d048a[_0xd2f9('0xb0')][_0xd2f9('0xa5')][_0xd2f9('0x4c')]){return _0x3d048a[_0xd2f9('0xb0')][_0xd2f9('0xa5')][0x0];}else{return db[_0xd2f9('0xa4')][_0xd2f9('0x5c')](_['defaults'](_0x5dd070['body'],{'firstName':_0x5dd070['body']['to'][0x0],'phone':_0x5dd070[_0xd2f9('0x5d')]['to'][0x0],'fax':_0x5dd070['body']['to'][0x0],'ListId':_0x3d048a['ListId']}));}}else{throw new Error(_0xd2f9('0xb1'));}}else{throw new Error(_0xd2f9('0xb2'));}})[_0xd2f9('0x24')](function(_0x336e87){if(_0x336e87){return db['FaxInteraction']['find']({'where':{'ContactId':_0x336e87['id'],'closed':![],'FaxAccountId':_0x3d048a['id']}})['then'](function(_0x31232a){if(_0x31232a){return[_0x31232a,![]];}return db[_0xd2f9('0x70')][_0xd2f9('0x5c')]({'UserId':_0x5dd070['user']['id'],'ContactId':_0x336e87['id'],'FaxAccountId':_0x3d048a['id'],'fax':_0x5dd070[_0xd2f9('0x5d')]['to'][0x0],'firstMsgDirection':_0xd2f9('0xb3'),'Messages':[_[_0xd2f9('0x52')](_0x5dd070[_0xd2f9('0x5d')],{'read':![],'body':_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')][0x0][_0xd2f9('0xb4')],'FaxAccountId':_0x3d048a['id'],'UserId':_0x5dd070[_0xd2f9('0x5e')]['id'],'ContactId':_0x336e87['id'],'AttachmentId':_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xd2f9('0x24')](function(_0xe030c2){return[_0xe030c2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd2f9('0xb5')](function(_0x22394d,_0x50570e){if(_0x50570e){return _0x22394d;}return db[_0xd2f9('0x9f')]['create']({'direction':_0xd2f9('0xb3'),'read':![],'body':_0x5dd070[_0xd2f9('0x5d')]['attachments'][0x0][_0xd2f9('0xb4')],'FaxAccountId':_0x3d048a['id'],'FaxInteractionId':_0x22394d['id'],'UserId':_0x5dd070[_0xd2f9('0x5e')]['id'],'ContactId':_0x22394d[_0xd2f9('0xb6')],'AttachmentId':_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')][0x0]['id']})[_0xd2f9('0x24')](function(_0x5c1929){_0x22394d['dataValues']['Messages']=[];_0x22394d[_0xd2f9('0xb7')][_0xd2f9('0xb8')][_0xd2f9('0x86')](_0x5c1929['dataValues']);return _0x22394d;});})[_0xd2f9('0x24')](function(_0xea393b){respondWithRpcPromise(_0xd2f9('0xb9'),_0xd2f9('0xb9'),{'FaxAccountId':_[_0xd2f9('0xad')](_0x5dd070[_0xd2f9('0x57')]['id'])?undefined:_0x5dd070['params']['id'],'path':_[_0xd2f9('0xad')](_0x5dd070['body'][_0xd2f9('0xa8')][0x0][_0xd2f9('0x7')])?undefined:_0x5dd070['body']['attachments'][0x0]['path'],'fax':_[_0xd2f9('0xad')](_0x5dd070['body']['to'][0x0])?undefined:_0x5dd070[_0xd2f9('0x5d')]['to'][0x0],'AttachmentId':_0x5dd070[_0xd2f9('0x5d')][_0xd2f9('0xa8')][0x0]['id']},client9002)[_0xd2f9('0x24')](function(_0x57eb3e){logger[_0xd2f9('0x25')]('SendFaxRpc,\x20%s',_0x57eb3e);})[_0xd2f9('0x2e')](function(_0x2fecb0){logger['info']('SendFaxRpc,\x20%s',_0x2fecb0);});return _0xea393b;})['then'](respondWithResult(_0xa134fc,null))[_0xd2f9('0x2e')](handleError(_0xa134fc,null));};exports['addAgents']=function(_0x5f2314,_0x2bae41,_0xdf8912){return db['FaxAccount']['find']({'where':{'id':_0x5f2314['params']['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x2bae41,null))[_0xd2f9('0x24')](function(_0x3048be){if(_0x3048be){return _0x3048be[_0xd2f9('0xba')](_0x5f2314[_0xd2f9('0x5d')][_0xd2f9('0x6e')],_[_0xd2f9('0x71')](_0x5f2314[_0xd2f9('0x5d')],['ids','id'])||{})[_0xd2f9('0xb5')](function(_0xa777cc){for(var _0x4db70f=0x0;_0x4db70f<_0x5f2314[_0xd2f9('0x5d')][_0xd2f9('0x6e')][_0xd2f9('0x4c')];_0x4db70f+=0x1){socket['emit']('userFaxAccount:save',{'UserId':_0x5f2314['body'][_0xd2f9('0x6e')][_0x4db70f],'FaxAccountId':_0x5f2314[_0xd2f9('0x57')]['id']});}return _0xa777cc;});}})[_0xd2f9('0x24')](respondWithResult(_0x2bae41,null))[_0xd2f9('0x2e')](handleError(_0x2bae41,null));};exports[_0xd2f9('0xbb')]=function(_0x3ec865,_0x5ad28a,_0x4916ad){return db[_0xd2f9('0x42')][_0xd2f9('0x5b')]({'where':{'id':_0x3ec865[_0xd2f9('0x57')]['id']}})['then'](handleEntityNotFound(_0x5ad28a,null))['then'](function(_0x2f1fc0){if(_0x2f1fc0){return _0x2f1fc0[_0xd2f9('0xbb')](_0x3ec865[_0xd2f9('0x47')]['ids'])[_0xd2f9('0x24')](function(){if(_[_0xd2f9('0xbc')](_0x3ec865[_0xd2f9('0x47')]['ids'])){for(var _0x482d6e=0x0;_0x482d6e<_0x3ec865[_0xd2f9('0x47')]['ids'][_0xd2f9('0x4c')];_0x482d6e+=0x1){socket['emit'](_0xd2f9('0xbd'),{'UserId':Number(_0x3ec865[_0xd2f9('0x47')][_0xd2f9('0x6e')][_0x482d6e]),'FaxAccountId':Number(_0x3ec865['params']['id'])});}}else{socket[_0xd2f9('0xbe')](_0xd2f9('0xbd'),{'UserId':Number(_0x3ec865['query']['ids']),'FaxAccountId':Number(_0x3ec865['params']['id'])});}});}})[_0xd2f9('0x24')](respondWithStatusCode(_0x5ad28a,null))['catch'](handleError(_0x5ad28a,null));};exports[_0xd2f9('0xbf')]=function(_0x30ef8e,_0x54828a,_0x2f5404){var _0x2ea4d8={};var _0x3698a6={};var _0x573b64;var _0x5b9a26;return db[_0xd2f9('0x42')][_0xd2f9('0x65')]({'where':{'id':_0x30ef8e[_0xd2f9('0x57')]['id']}})[_0xd2f9('0x24')](handleEntityNotFound(_0x54828a,null))[_0xd2f9('0x24')](function(_0x52df3f){if(_0x52df3f){_0x573b64=_0x52df3f;_0x3698a6[_0xd2f9('0x46')]=_[_0xd2f9('0x58')](db[_0xd2f9('0x74')]['rawAttributes']);_0x3698a6['query']=_[_0xd2f9('0x58')](_0x30ef8e[_0xd2f9('0x47')]);_0x3698a6[_0xd2f9('0x48')]=_[_0xd2f9('0x49')](_0x3698a6[_0xd2f9('0x46')],_0x3698a6[_0xd2f9('0x47')]);_0x2ea4d8[_0xd2f9('0x4a')]=_[_0xd2f9('0x49')](_0x3698a6[_0xd2f9('0x46')],qs['fields'](_0x30ef8e[_0xd2f9('0x47')][_0xd2f9('0x4b')]));_0x2ea4d8[_0xd2f9('0x4a')]=_0x2ea4d8[_0xd2f9('0x4a')][_0xd2f9('0x4c')]?_0x2ea4d8[_0xd2f9('0x4a')]:_0x3698a6[_0xd2f9('0x46')];_0x2ea4d8[_0xd2f9('0x4f')]=qs['sort'](_0x30ef8e['query'][_0xd2f9('0x50')]);_0x2ea4d8[_0xd2f9('0x51')]=qs[_0xd2f9('0x48')](_[_0xd2f9('0x66')](_0x30ef8e[_0xd2f9('0x47')],_0x3698a6[_0xd2f9('0x48')]));if(_0x30ef8e[_0xd2f9('0x47')][_0xd2f9('0x67')]){_0x2ea4d8['where']=_[_0xd2f9('0x52')](_0x2ea4d8[_0xd2f9('0x51')],{'$or':_[_0xd2f9('0x41')](_0x2ea4d8[_0xd2f9('0x4a')],function(_0x6def70){var _0x4a409a={};_0x4a409a[_0x6def70]={'$like':'%'+_0x30ef8e[_0xd2f9('0x47')][_0xd2f9('0x67')]+'%'};return _0x4a409a;})});}_0x2ea4d8=_[_0xd2f9('0x52')]({},_0x2ea4d8,_0x30ef8e[_0xd2f9('0x5a')]);return _0x573b64[_0xd2f9('0xbf')](_0x2ea4d8);}})[_0xd2f9('0x24')](function(_0x2327b7){if(_0x2327b7){_0x5b9a26=_0x2327b7[_0xd2f9('0x4c')];if(!_0x30ef8e['query'][_0xd2f9('0x4d')](_0xd2f9('0x4e'))){_0x2ea4d8['limit']=qs[_0xd2f9('0x32')](_0x30ef8e['query']['limit']);_0x2ea4d8[_0xd2f9('0x31')]=qs[_0xd2f9('0x31')](_0x30ef8e[_0xd2f9('0x47')]['offset']);}return _0x573b64[_0xd2f9('0xbf')](_0x2ea4d8);}})[_0xd2f9('0x24')](function(_0x37afe6){if(_0x37afe6){return _0x37afe6?{'count':_0x5b9a26,'rows':_0x37afe6}:null;}})['then'](respondWithResult(_0x54828a,null))['catch'](handleError(_0x54828a,null));};
\ No newline at end of file
+var _0xed17=['defaults','redis','localhost','./faxAccount.socket','jayson/promise','http','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','FaxAccount','include','findAll','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','includeAll','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','transaction','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','ecm','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Set','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','User','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x27422a,_0x2a182c){var _0x4dfb9e=function(_0x18334f){while(--_0x18334f){_0x27422a['push'](_0x27422a['shift']());}};_0x4dfb9e(++_0x2a182c);}(_0xed17,0x17e));var _0x7ed1=function(_0x2a318a,_0x3f8006){_0x2a318a=_0x2a318a-0x0;var _0x346cf3=_0xed17[_0x2a318a];return _0x346cf3;};'use strict';var pdf=require(_0x7ed1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7ed1('0x1'));var zipdir=require(_0x7ed1('0x2'));var jsonpatch=require(_0x7ed1('0x3'));var rp=require(_0x7ed1('0x4'));var moment=require(_0x7ed1('0x5'));var BPromise=require(_0x7ed1('0x6'));var Mustache=require(_0x7ed1('0x7'));var util=require('util');var path=require(_0x7ed1('0x8'));var sox=require(_0x7ed1('0x9'));var csv=require(_0x7ed1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7ed1('0xb'));var squel=require(_0x7ed1('0xc'));var crypto=require('crypto');var jsforce=require(_0x7ed1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7ed1('0xa'));var querystring=require('querystring');var Papa=require(_0x7ed1('0xe'));var Redis=require(_0x7ed1('0xf'));var authService=require(_0x7ed1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7ed1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7ed1('0x12'));var utils=require(_0x7ed1('0x13'));var config=require(_0x7ed1('0x14'));var db=require(_0x7ed1('0x15'))['db'];config['redis']=_[_0x7ed1('0x16')](config[_0x7ed1('0x17')],{'host':_0x7ed1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7ed1('0x19'))['register'](socket);var jayson=require(_0x7ed1('0x1a'));var client=jayson['client'][_0x7ed1('0x1b')]({'port':0x232c});var client9002=jayson[_0x7ed1('0x1c')][_0x7ed1('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3fb353,_0x131d82,_0x400bc7){if(_0x400bc7){var _0x24f2a2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24f2a2['test'](_0x131d82)){return _0x3fb353;}else{throw new db[(_0x7ed1('0x1d'))][(_0x7ed1('0x1e'))](_0x7ed1('0x1f'));}}else{return _0x3fb353;}}function respondWithRpcPromise(_0x2ec1a7,_0x27479f,_0xaf7fb,_0x56f009){return new BPromise(function(_0x50f2fd,_0x581cec){var _0x5ad3f2=_0x56f009||client;return _0x5ad3f2[_0x7ed1('0x20')](_0x2ec1a7,_0xaf7fb)[_0x7ed1('0x21')](function(_0x36e221){logger['info'](_0x7ed1('0x22'),_0x27479f,_0x7ed1('0x23'));logger[_0x7ed1('0x24')](_0x7ed1('0x25'),_0x27479f,_0x7ed1('0x23'),JSON[_0x7ed1('0x26')](_0x36e221));if(_0x36e221[_0x7ed1('0x27')]){if(_0x36e221['error'][_0x7ed1('0x28')]===0x1f4){logger[_0x7ed1('0x27')](_0x7ed1('0x22'),_0x27479f,_0x36e221[_0x7ed1('0x27')][_0x7ed1('0x29')]);return _0x581cec(_0x36e221[_0x7ed1('0x27')][_0x7ed1('0x29')]);}logger[_0x7ed1('0x27')]('FaxAccount,\x20%s,\x20%s',_0x27479f,_0x36e221[_0x7ed1('0x27')]['message']);return _0x50f2fd(_0x36e221[_0x7ed1('0x27')][_0x7ed1('0x29')]);}else{logger['info'](_0x7ed1('0x22'),_0x27479f,_0x7ed1('0x23'));_0x50f2fd(_0x36e221[_0x7ed1('0x2a')][_0x7ed1('0x29')]);}})[_0x7ed1('0x2b')](function(_0x5101c4){logger['error'](_0x7ed1('0x22'),_0x27479f,_0x5101c4);_0x581cec(_0x5101c4);});});}function respondWithStatusCode(_0x9730c4,_0x135422){_0x135422=_0x135422||0xcc;return function(_0x1989eb){if(_0x1989eb){return _0x9730c4[_0x7ed1('0x2c')](_0x135422);}return _0x9730c4['status'](_0x135422)[_0x7ed1('0x2d')]();};}function respondWithResult(_0x17742e,_0x3664fe){_0x3664fe=_0x3664fe||0xc8;return function(_0x3f9123){if(_0x3f9123){return _0x17742e[_0x7ed1('0x2e')](_0x3664fe)[_0x7ed1('0x2f')](_0x3f9123);}};}function respondWithFilteredResult(_0x532a33,_0x466773){return function(_0x4892d2){if(_0x4892d2){var _0x40a605=_0x4892d2[_0x7ed1('0x30')],_0x44f3f8=_0x466773[_0x7ed1('0x31')],_0x3655dd=_0x466773[_0x7ed1('0x31')]+_0x466773[_0x7ed1('0x32')],_0x5c9f18;if(_0x3655dd>=_0x40a605){_0x3655dd=_0x40a605;_0x5c9f18=0xc8;}else{_0x5c9f18=0xce;}_0x532a33['status'](_0x5c9f18);return _0x532a33['set'](_0x7ed1('0x33'),_0x44f3f8+'-'+_0x3655dd+'/'+_0x40a605)[_0x7ed1('0x2f')](_0x4892d2);}return null;};}function patchUpdates(_0x1f87a6){return function(_0x44a60f){try{jsonpatch[_0x7ed1('0x34')](_0x44a60f,_0x1f87a6,!![]);}catch(_0x126937){return BPromise[_0x7ed1('0x35')](_0x126937);}return _0x44a60f[_0x7ed1('0x36')]();};}function saveUpdates(_0x5e9f1b,_0x4d2f25){return function(_0x285eb6){if(_0x285eb6){return _0x285eb6[_0x7ed1('0x37')](_0x5e9f1b)[_0x7ed1('0x21')](function(_0x292085){return _0x292085;});}return null;};}function removeEntity(_0x5bcd14,_0x313f3a){return function(_0x8c755a){if(_0x8c755a){return _0x8c755a[_0x7ed1('0x38')]()[_0x7ed1('0x21')](function(){var _0x4bd5d1=_0x8c755a[_0x7ed1('0x39')]({'plain':!![]});var _0x2185ac=_0x7ed1('0x3a');return db[_0x7ed1('0x3b')][_0x7ed1('0x38')]({'where':{'type':_0x2185ac,'resourceId':_0x4bd5d1['id']}})[_0x7ed1('0x21')](function(){return _0x8c755a;});})[_0x7ed1('0x21')](function(){_0x5bcd14[_0x7ed1('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cf5f6,_0x2e0d00){return function(_0x20fbfb){if(!_0x20fbfb){_0x4cf5f6[_0x7ed1('0x2c')](0x194);}return _0x20fbfb;};}function handleError(_0x51dacb,_0x18cf4e){_0x18cf4e=_0x18cf4e||0x1f4;return function(_0x43353d){logger[_0x7ed1('0x27')](_0x43353d['stack']);if(_0x43353d[_0x7ed1('0x3c')]){delete _0x43353d[_0x7ed1('0x3c')];}_0x51dacb['status'](_0x18cf4e)[_0x7ed1('0x3d')](_0x43353d);};}exports[_0x7ed1('0x3e')]=function(_0x2005a9,_0x456697){var _0x46930c={'include':[{'model':db[_0x7ed1('0x3f')],'as':_0x7ed1('0x40')}]},_0x52f949={},_0x198022={'count':0x0,'rows':[]};var _0x2cd299=_['map'](db['FaxAccount'][_0x7ed1('0x41')],function(_0xc3d7d9){return{'name':_0xc3d7d9[_0x7ed1('0x42')],'type':_0xc3d7d9[_0x7ed1('0x43')][_0x7ed1('0x44')]};});_0x52f949[_0x7ed1('0x45')]=_[_0x7ed1('0x46')](_0x2cd299,_0x7ed1('0x3c'));_0x52f949[_0x7ed1('0x47')]=_['keys'](_0x2005a9[_0x7ed1('0x47')]);_0x52f949[_0x7ed1('0x48')]=_['intersection'](_0x52f949[_0x7ed1('0x45')],_0x52f949[_0x7ed1('0x47')]);_0x46930c[_0x7ed1('0x49')]=_[_0x7ed1('0x4a')](_0x52f949['model'],qs[_0x7ed1('0x4b')](_0x2005a9['query'][_0x7ed1('0x4b')]));_0x46930c[_0x7ed1('0x49')]=_0x46930c[_0x7ed1('0x49')][_0x7ed1('0x4c')]?_0x46930c[_0x7ed1('0x49')]:_0x52f949[_0x7ed1('0x45')];if(!_0x2005a9[_0x7ed1('0x47')][_0x7ed1('0x4d')](_0x7ed1('0x4e'))){_0x46930c[_0x7ed1('0x32')]=qs['limit'](_0x2005a9['query']['limit']);_0x46930c['offset']=qs[_0x7ed1('0x31')](_0x2005a9['query'][_0x7ed1('0x31')]);}_0x46930c['order']=qs[_0x7ed1('0x4f')](_0x2005a9[_0x7ed1('0x47')][_0x7ed1('0x4f')]);_0x46930c[_0x7ed1('0x50')]=qs['filters'](_[_0x7ed1('0x51')](_0x2005a9['query'],_0x52f949['filters']),_0x2cd299);if(_0x2005a9[_0x7ed1('0x47')][_0x7ed1('0x52')]){_0x46930c[_0x7ed1('0x50')]=_[_0x7ed1('0x53')](_0x46930c[_0x7ed1('0x50')],{'$or':_[_0x7ed1('0x46')](_0x2cd299,function(_0x807e25){if(_0x807e25[_0x7ed1('0x43')]!==_0x7ed1('0x54')){var _0x616208={};_0x616208[_0x807e25[_0x7ed1('0x3c')]]={'$like':'%'+_0x2005a9['query'][_0x7ed1('0x52')]+'%'};return _0x616208;}})});}_0x46930c=_[_0x7ed1('0x53')]({},_0x46930c,_0x2005a9[_0x7ed1('0x55')]);var _0x2c7f49={'where':_0x46930c['where']};return db[_0x7ed1('0x56')]['count'](_0x2c7f49)[_0x7ed1('0x21')](function(_0x15d0ce){_0x198022[_0x7ed1('0x30')]=_0x15d0ce;if(_0x2005a9[_0x7ed1('0x47')]['includeAll']){_0x46930c[_0x7ed1('0x57')]=[{'all':!![]}];}return db[_0x7ed1('0x56')][_0x7ed1('0x58')](_0x46930c);})[_0x7ed1('0x21')](function(_0x4a50a2){_0x198022['rows']=_0x4a50a2;return _0x198022;})[_0x7ed1('0x21')](respondWithFilteredResult(_0x456697,_0x46930c))[_0x7ed1('0x2b')](handleError(_0x456697,null));};exports[_0x7ed1('0x59')]=function(_0x4d9b5f,_0x20016b){var _0x50ca45={'raw':![],'where':{'id':_0x4d9b5f[_0x7ed1('0x5a')]['id']},'include':[{'model':db[_0x7ed1('0x3f')],'as':_0x7ed1('0x40')}]},_0x170513={};_0x170513[_0x7ed1('0x45')]=_['keys'](db[_0x7ed1('0x56')][_0x7ed1('0x41')]);_0x170513['query']=_[_0x7ed1('0x5b')](_0x4d9b5f[_0x7ed1('0x47')]);_0x170513['filters']=_[_0x7ed1('0x4a')](_0x170513[_0x7ed1('0x45')],_0x170513[_0x7ed1('0x47')]);_0x50ca45[_0x7ed1('0x49')]=_['intersection'](_0x170513['model'],qs['fields'](_0x4d9b5f[_0x7ed1('0x47')][_0x7ed1('0x4b')]));_0x50ca45[_0x7ed1('0x49')]=_0x50ca45[_0x7ed1('0x49')]['length']?_0x50ca45[_0x7ed1('0x49')]:_0x170513[_0x7ed1('0x45')];if(_0x4d9b5f[_0x7ed1('0x47')]['includeAll']){_0x50ca45[_0x7ed1('0x57')]=[{'all':!![]}];}_0x50ca45=_[_0x7ed1('0x53')]({},_0x50ca45,_0x4d9b5f[_0x7ed1('0x55')]);return db[_0x7ed1('0x56')][_0x7ed1('0x5c')](_0x50ca45)[_0x7ed1('0x21')](handleEntityNotFound(_0x20016b,null))['then'](respondWithResult(_0x20016b,null))[_0x7ed1('0x2b')](handleError(_0x20016b,null));};exports[_0x7ed1('0x5d')]=function(_0xca961b,_0x43403c){return db['FaxAccount'][_0x7ed1('0x5d')](_0xca961b[_0x7ed1('0x5e')],{})[_0x7ed1('0x21')](function(_0x43b173){var _0x1dec41=_0xca961b[_0x7ed1('0x5f')][_0x7ed1('0x39')]({'plain':!![]});if(!_0x1dec41)throw new Error(_0x7ed1('0x60'));if(_0x1dec41[_0x7ed1('0x61')]===_0x7ed1('0x5f')){var _0xd39ac6=_0x43b173[_0x7ed1('0x39')]({'plain':!![]});var _0x122fc7=_0x7ed1('0x3a');return db['UserProfileSection'][_0x7ed1('0x5c')]({'where':{'name':_0x122fc7,'userProfileId':_0x1dec41[_0x7ed1('0x62')]},'raw':!![]})['then'](function(_0x2058db){if(_0x2058db&&_0x2058db[_0x7ed1('0x63')]===0x0){return db[_0x7ed1('0x3b')][_0x7ed1('0x5d')]({'name':_0xd39ac6['name'],'resourceId':_0xd39ac6['id'],'type':_0x2058db[_0x7ed1('0x3c')],'sectionId':_0x2058db['id']},{})[_0x7ed1('0x21')](function(){return _0x43b173;});}else{return _0x43b173;}})[_0x7ed1('0x2b')](function(_0x14ecb5){logger[_0x7ed1('0x27')](_0x7ed1('0x64'),_0x14ecb5);throw _0x14ecb5;});}return _0x43b173;})[_0x7ed1('0x21')](respondWithResult(_0x43403c,0xc9))[_0x7ed1('0x2b')](handleError(_0x43403c,null));};exports[_0x7ed1('0x37')]=function(_0x76b66,_0x1bc3f8){if(_0x76b66[_0x7ed1('0x5e')]['id']){delete _0x76b66[_0x7ed1('0x5e')]['id'];}return db[_0x7ed1('0x56')][_0x7ed1('0x5c')]({'where':{'id':_0x76b66[_0x7ed1('0x5a')]['id']},'include':[{'model':db[_0x7ed1('0x3f')],'as':_0x7ed1('0x40')}]})[_0x7ed1('0x21')](handleEntityNotFound(_0x1bc3f8,null))[_0x7ed1('0x21')](saveUpdates(_0x76b66[_0x7ed1('0x5e')],null))['then'](respondWithResult(_0x1bc3f8,null))[_0x7ed1('0x2b')](handleError(_0x1bc3f8,null));};exports[_0x7ed1('0x38')]=function(_0x48f97a,_0x4ed2cf){return db['FaxAccount'][_0x7ed1('0x5c')]({'where':{'id':_0x48f97a[_0x7ed1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ed2cf,null))['then'](removeEntity(_0x4ed2cf,null))[_0x7ed1('0x2b')](handleError(_0x4ed2cf,null));};exports['describe']=function(_0x5838cd,_0x5c8074){return db['FaxAccount'][_0x7ed1('0x65')]()[_0x7ed1('0x21')](respondWithResult(_0x5c8074,null))[_0x7ed1('0x2b')](handleError(_0x5c8074,null));};exports[_0x7ed1('0x66')]=function(_0x2bcb03,_0x4ac6a4,_0x4ef2a7){if(_0x2bcb03[_0x7ed1('0x5e')]['id']){delete _0x2bcb03[_0x7ed1('0x5e')]['id'];}return db[_0x7ed1('0x56')][_0x7ed1('0x5c')]({'where':{'id':_0x2bcb03[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x4ac6a4,null))['then'](function(_0x3c2de0){if(_0x3c2de0){_0x2bcb03[_0x7ed1('0x5e')][_0x7ed1('0x67')]=_0x3c2de0['id'];return db[_0x7ed1('0x68')][_0x7ed1('0x5d')](_0x2bcb03[_0x7ed1('0x5e')]);}})[_0x7ed1('0x21')](respondWithResult(_0x4ac6a4,null))[_0x7ed1('0x2b')](handleError(_0x4ac6a4,null));};exports[_0x7ed1('0x69')]=function(_0x156445,_0x1e00e3,_0x2d784c){var _0x33db32={'raw':![],'where':{}};var _0x272778={};var _0x133b3c={'count':0x0,'rows':[]};return db[_0x7ed1('0x56')][_0x7ed1('0x6a')]({'where':{'id':_0x156445[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x1e00e3,null))[_0x7ed1('0x21')](function(_0x4ffcbe){if(_0x4ffcbe){_0x272778[_0x7ed1('0x45')]=_[_0x7ed1('0x5b')](db['Disposition'][_0x7ed1('0x41')]);_0x272778['query']=_['keys'](_0x156445[_0x7ed1('0x47')]);_0x272778[_0x7ed1('0x48')]=_[_0x7ed1('0x4a')](_0x272778[_0x7ed1('0x45')],_0x272778[_0x7ed1('0x47')]);_0x33db32[_0x7ed1('0x49')]=_[_0x7ed1('0x4a')](_0x272778[_0x7ed1('0x45')],qs['fields'](_0x156445[_0x7ed1('0x47')]['fields']));_0x33db32[_0x7ed1('0x49')]=_0x33db32[_0x7ed1('0x49')]['length']?_0x33db32[_0x7ed1('0x49')]:_0x272778[_0x7ed1('0x45')];if(!_0x156445[_0x7ed1('0x47')][_0x7ed1('0x4d')](_0x7ed1('0x4e'))){_0x33db32[_0x7ed1('0x32')]=qs[_0x7ed1('0x32')](_0x156445[_0x7ed1('0x47')][_0x7ed1('0x32')]);_0x33db32[_0x7ed1('0x31')]=qs[_0x7ed1('0x31')](_0x156445[_0x7ed1('0x47')]['offset']);}_0x33db32['order']=qs[_0x7ed1('0x4f')](_0x156445[_0x7ed1('0x47')][_0x7ed1('0x4f')]);_0x33db32['where']=qs[_0x7ed1('0x48')](_[_0x7ed1('0x51')](_0x156445[_0x7ed1('0x47')],_0x272778[_0x7ed1('0x48')]));_0x33db32[_0x7ed1('0x50')]['FaxAccountId']=_0x4ffcbe['id'];if(_0x156445[_0x7ed1('0x47')]['filter']){_0x33db32[_0x7ed1('0x50')]=_[_0x7ed1('0x53')](_0x33db32[_0x7ed1('0x50')],{'$or':_[_0x7ed1('0x46')](_0x33db32['attributes'],function(_0x40627f){var _0x318d31={};_0x318d31[_0x40627f]={'$like':'%'+_0x156445[_0x7ed1('0x47')][_0x7ed1('0x52')]+'%'};return _0x318d31;})});}_0x33db32=_[_0x7ed1('0x53')]({},_0x33db32,_0x156445[_0x7ed1('0x55')]);return db[_0x7ed1('0x68')][_0x7ed1('0x30')]({'where':_0x33db32[_0x7ed1('0x50')]})[_0x7ed1('0x21')](function(_0x297489){_0x133b3c[_0x7ed1('0x30')]=_0x297489;if(_0x156445[_0x7ed1('0x47')][_0x7ed1('0x6b')]){_0x33db32[_0x7ed1('0x57')]=[{'all':!![]}];}return db[_0x7ed1('0x68')]['findAll'](_0x33db32);})[_0x7ed1('0x21')](function(_0x205db1){_0x133b3c[_0x7ed1('0x6c')]=_0x205db1;return _0x133b3c;});}})[_0x7ed1('0x21')](respondWithFilteredResult(_0x1e00e3,_0x33db32))['catch'](handleError(_0x1e00e3,null));};exports[_0x7ed1('0x6d')]=function(_0x4fd836,_0x4025ef,_0x18c877){return db[_0x7ed1('0x56')][_0x7ed1('0x5c')]({'where':{'id':_0x4fd836[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x4025ef,null))[_0x7ed1('0x21')](function(_0x5068fb){if(_0x5068fb){return _0x5068fb['removeDispositions'](_0x4fd836['query'][_0x7ed1('0x6e')]);}})['then'](respondWithStatusCode(_0x4025ef,null))[_0x7ed1('0x2b')](handleError(_0x4025ef,null));};exports[_0x7ed1('0x6f')]=function(_0x347a5f,_0x324dea,_0x438769){if(_0x347a5f[_0x7ed1('0x5e')]['id']){delete _0x347a5f[_0x7ed1('0x5e')]['id'];}return db[_0x7ed1('0x56')][_0x7ed1('0x5c')]({'where':{'id':_0x347a5f[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x324dea,null))['then'](function(_0x216799){if(_0x216799){_0x347a5f[_0x7ed1('0x5e')][_0x7ed1('0x67')]=_0x216799['id'];return db['CannedAnswer'][_0x7ed1('0x5d')](_0x347a5f[_0x7ed1('0x5e')]);}})[_0x7ed1('0x21')](respondWithResult(_0x324dea,null))[_0x7ed1('0x2b')](handleError(_0x324dea,null));};exports[_0x7ed1('0x70')]=function(_0x3cc1d4,_0x27ebf0,_0xec4932){var _0x1e5ea4={'raw':![],'where':{}};var _0x221781={};var _0x5208={'count':0x0,'rows':[]};return db[_0x7ed1('0x56')][_0x7ed1('0x6a')]({'where':{'id':_0x3cc1d4['params']['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x27ebf0,null))[_0x7ed1('0x21')](function(_0x43dbaf){if(_0x43dbaf){_0x221781[_0x7ed1('0x45')]=_[_0x7ed1('0x5b')](db[_0x7ed1('0x71')][_0x7ed1('0x41')]);_0x221781[_0x7ed1('0x47')]=_[_0x7ed1('0x5b')](_0x3cc1d4[_0x7ed1('0x47')]);_0x221781[_0x7ed1('0x48')]=_['intersection'](_0x221781[_0x7ed1('0x45')],_0x221781[_0x7ed1('0x47')]);_0x1e5ea4['attributes']=_[_0x7ed1('0x4a')](_0x221781[_0x7ed1('0x45')],qs[_0x7ed1('0x4b')](_0x3cc1d4['query'][_0x7ed1('0x4b')]));_0x1e5ea4[_0x7ed1('0x49')]=_0x1e5ea4['attributes'][_0x7ed1('0x4c')]?_0x1e5ea4[_0x7ed1('0x49')]:_0x221781[_0x7ed1('0x45')];if(!_0x3cc1d4[_0x7ed1('0x47')][_0x7ed1('0x4d')](_0x7ed1('0x4e'))){_0x1e5ea4[_0x7ed1('0x32')]=qs[_0x7ed1('0x32')](_0x3cc1d4[_0x7ed1('0x47')][_0x7ed1('0x32')]);_0x1e5ea4[_0x7ed1('0x31')]=qs[_0x7ed1('0x31')](_0x3cc1d4[_0x7ed1('0x47')][_0x7ed1('0x31')]);}_0x1e5ea4[_0x7ed1('0x72')]=qs[_0x7ed1('0x4f')](_0x3cc1d4[_0x7ed1('0x47')][_0x7ed1('0x4f')]);_0x1e5ea4['where']=qs[_0x7ed1('0x48')](_[_0x7ed1('0x51')](_0x3cc1d4[_0x7ed1('0x47')],_0x221781[_0x7ed1('0x48')]));_0x1e5ea4[_0x7ed1('0x50')][_0x7ed1('0x67')]=_0x43dbaf['id'];if(_0x3cc1d4['query'][_0x7ed1('0x52')]){_0x1e5ea4[_0x7ed1('0x50')]=_[_0x7ed1('0x53')](_0x1e5ea4['where'],{'$or':_['map'](_0x1e5ea4[_0x7ed1('0x49')],function(_0x185e7c){var _0x4292b7={};_0x4292b7[_0x185e7c]={'$like':'%'+_0x3cc1d4[_0x7ed1('0x47')][_0x7ed1('0x52')]+'%'};return _0x4292b7;})});}_0x1e5ea4=_[_0x7ed1('0x53')]({},_0x1e5ea4,_0x3cc1d4[_0x7ed1('0x55')]);return db['CannedAnswer'][_0x7ed1('0x30')]({'where':_0x1e5ea4[_0x7ed1('0x50')]})[_0x7ed1('0x21')](function(_0x58289e){_0x5208[_0x7ed1('0x30')]=_0x58289e;if(_0x3cc1d4['query'][_0x7ed1('0x6b')]){_0x1e5ea4['include']=[{'all':!![]}];}return db[_0x7ed1('0x71')][_0x7ed1('0x58')](_0x1e5ea4);})['then'](function(_0x2b1579){_0x5208[_0x7ed1('0x6c')]=_0x2b1579;return _0x5208;});}})[_0x7ed1('0x21')](respondWithFilteredResult(_0x27ebf0,_0x1e5ea4))[_0x7ed1('0x2b')](handleError(_0x27ebf0,null));};exports[_0x7ed1('0x73')]=function(_0x4a751e,_0x2c3b5e,_0x57d4a2){return db[_0x7ed1('0x56')]['find']({'where':{'id':_0x4a751e[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x2c3b5e,null))[_0x7ed1('0x21')](function(_0x348991){if(_0x348991){return _0x348991['removeAnswers'](_0x4a751e[_0x7ed1('0x47')][_0x7ed1('0x6e')]);}})[_0x7ed1('0x21')](respondWithStatusCode(_0x2c3b5e,null))[_0x7ed1('0x2b')](handleError(_0x2c3b5e,null));};exports[_0x7ed1('0x74')]=function(_0x48b6fc,_0xfeff4b,_0x30a9ad){return db[_0x7ed1('0x75')]['find']({'where':{'id':_0x48b6fc['params']['id']}})['then'](handleEntityNotFound(_0xfeff4b,null))['then'](function(_0x1a027f){if(_0x1a027f){return _0x1a027f[_0x7ed1('0x74')](_0x48b6fc['body'][_0x7ed1('0x6e')],_[_0x7ed1('0x76')](_0x48b6fc[_0x7ed1('0x5e')],[_0x7ed1('0x6e'),'id'])||{});}})[_0x7ed1('0x21')](respondWithResult(_0xfeff4b,null))[_0x7ed1('0x2b')](handleError(_0xfeff4b,null));};exports[_0x7ed1('0x77')]=function(_0x2eb117,_0x453264,_0x4d5216){var _0x5094b8={'raw':![],'where':{}};var _0x482aa7={};var _0x576bc1={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7ed1('0x6a')]({'where':{'id':_0x2eb117[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x453264,null))[_0x7ed1('0x21')](function(_0x37b01a){if(_0x37b01a){_0x482aa7['model']=_['keys'](db['FaxInteraction'][_0x7ed1('0x41')]);_0x482aa7[_0x7ed1('0x47')]=_[_0x7ed1('0x5b')](_0x2eb117[_0x7ed1('0x47')]);_0x482aa7[_0x7ed1('0x48')]=_[_0x7ed1('0x4a')](_0x482aa7[_0x7ed1('0x45')],_0x482aa7[_0x7ed1('0x47')]);_0x5094b8[_0x7ed1('0x49')]=_[_0x7ed1('0x4a')](_0x482aa7['model'],qs['fields'](_0x2eb117['query'][_0x7ed1('0x4b')]));_0x5094b8[_0x7ed1('0x49')]=_0x5094b8['attributes'][_0x7ed1('0x4c')]?_0x5094b8['attributes']:_0x482aa7[_0x7ed1('0x45')];if(!_0x2eb117[_0x7ed1('0x47')]['hasOwnProperty']('nolimit')){_0x5094b8[_0x7ed1('0x32')]=qs[_0x7ed1('0x32')](_0x2eb117['query'][_0x7ed1('0x32')]);_0x5094b8[_0x7ed1('0x31')]=qs[_0x7ed1('0x31')](_0x2eb117[_0x7ed1('0x47')][_0x7ed1('0x31')]);}_0x5094b8[_0x7ed1('0x72')]=qs[_0x7ed1('0x4f')](_0x2eb117[_0x7ed1('0x47')][_0x7ed1('0x4f')]);_0x5094b8[_0x7ed1('0x50')]=qs[_0x7ed1('0x48')](_['pick'](_0x2eb117['query'],_0x482aa7[_0x7ed1('0x48')]));_0x5094b8[_0x7ed1('0x50')][_0x7ed1('0x67')]=_0x37b01a['id'];if(_0x2eb117[_0x7ed1('0x47')]['filter']){_0x5094b8[_0x7ed1('0x50')]=_['merge'](_0x5094b8['where'],{'$or':_['map'](_0x5094b8['attributes'],function(_0x2085a9){var _0x3b6449={};_0x3b6449[_0x2085a9]={'$like':'%'+_0x2eb117[_0x7ed1('0x47')][_0x7ed1('0x52')]+'%'};return _0x3b6449;})});}_0x5094b8=_[_0x7ed1('0x53')]({},_0x5094b8,_0x2eb117[_0x7ed1('0x55')]);return db['FaxInteraction'][_0x7ed1('0x30')]({'where':_0x5094b8[_0x7ed1('0x50')]})['then'](function(_0x4637ae){_0x576bc1[_0x7ed1('0x30')]=_0x4637ae;if(_0x2eb117[_0x7ed1('0x47')][_0x7ed1('0x6b')]){_0x5094b8[_0x7ed1('0x57')]=[{'model':db[_0x7ed1('0x78')],'as':_0x7ed1('0x79'),'required':![]},{'model':db['User'],'as':_0x7ed1('0x7a'),'attributes':[_0x7ed1('0x3c'),_0x7ed1('0x7b'),_0x7ed1('0x7c')],'required':![]},{'model':db[_0x7ed1('0x7d')],'as':_0x7ed1('0x7e'),'attributes':['id',_0x7ed1('0x3c'),_0x7ed1('0x7f')],'where':_0x2eb117[_0x7ed1('0x47')][_0x7ed1('0x80')]?{'id':_0x2eb117['query'][_0x7ed1('0x80')]}:undefined,'required':_0x2eb117[_0x7ed1('0x47')][_0x7ed1('0x80')]?!![]:![]}];}return db[_0x7ed1('0x75')]['findAll'](_0x5094b8);})['then'](function(_0x4abacf){_0x576bc1['rows']=_0x4abacf;return _0x576bc1;});}})[_0x7ed1('0x21')](respondWithFilteredResult(_0x453264,_0x5094b8))[_0x7ed1('0x2b')](handleError(_0x453264,null));};exports['addApplications']=function(_0x136209,_0x1586b4,_0x112d7e){return db[_0x7ed1('0x56')][_0x7ed1('0x6a')]({'where':{'id':_0x136209[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x1586b4,null))[_0x7ed1('0x21')](function(_0x4d069b){if(_0x4d069b){return db['sequelize'][_0x7ed1('0x81')](function(_0x1f51c4){return db[_0x7ed1('0x82')][_0x7ed1('0x38')]({'where':{'FaxAccountId':_0x136209[_0x7ed1('0x5a')]['id']},'transaction':_0x1f51c4})[_0x7ed1('0x21')](function(_0x46cf4c){var _0x15fac6=_[_0x7ed1('0x46')](_0x136209[_0x7ed1('0x5e')],function(_0x28a324){_0x28a324[_0x7ed1('0x67')]=_0x136209['params']['id'];return _0x28a324;});return db[_0x7ed1('0x82')][_0x7ed1('0x83')](_0x15fac6,{'transaction':_0x1f51c4});});})[_0x7ed1('0x21')](function(){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x136209[_0x7ed1('0x5a')]['id']},'order':_0x7ed1('0x84')});});}})[_0x7ed1('0x21')](respondWithResult(_0x1586b4,null))[_0x7ed1('0x2b')](handleError(_0x1586b4,null));};exports[_0x7ed1('0x85')]=function(_0x5d88a2,_0x210497,_0x5de610){var _0x47d671={};var _0x426c7f={};var _0x17b331;var _0x51d1ff;return db[_0x7ed1('0x56')]['findOne']({'where':{'id':_0x5d88a2[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x210497,null))[_0x7ed1('0x21')](function(_0x3b3a75){if(_0x3b3a75){_0x17b331=_0x3b3a75;_0x426c7f[_0x7ed1('0x45')]=_[_0x7ed1('0x5b')](db[_0x7ed1('0x82')][_0x7ed1('0x41')]);_0x426c7f[_0x7ed1('0x47')]=_['keys'](_0x5d88a2[_0x7ed1('0x47')]);_0x426c7f[_0x7ed1('0x48')]=_[_0x7ed1('0x4a')](_0x426c7f['model'],_0x426c7f[_0x7ed1('0x47')]);_0x47d671[_0x7ed1('0x49')]=_[_0x7ed1('0x4a')](_0x426c7f[_0x7ed1('0x45')],qs[_0x7ed1('0x4b')](_0x5d88a2[_0x7ed1('0x47')][_0x7ed1('0x4b')]));_0x47d671['attributes']=_0x47d671[_0x7ed1('0x49')][_0x7ed1('0x4c')]?_0x47d671[_0x7ed1('0x49')]:_0x426c7f[_0x7ed1('0x45')];_0x47d671['order']=qs[_0x7ed1('0x4f')](_0x5d88a2[_0x7ed1('0x47')][_0x7ed1('0x4f')]);_0x47d671['where']=qs[_0x7ed1('0x48')](_[_0x7ed1('0x51')](_0x5d88a2[_0x7ed1('0x47')],_0x426c7f[_0x7ed1('0x48')]));if(_0x5d88a2[_0x7ed1('0x47')][_0x7ed1('0x52')]){_0x47d671[_0x7ed1('0x50')]=_[_0x7ed1('0x53')](_0x47d671[_0x7ed1('0x50')],{'$or':_[_0x7ed1('0x46')](_0x47d671[_0x7ed1('0x49')],function(_0x53918e){var _0x62d705={};_0x62d705[_0x53918e]={'$like':'%'+_0x5d88a2[_0x7ed1('0x47')][_0x7ed1('0x52')]+'%'};return _0x62d705;})});}_0x47d671=_[_0x7ed1('0x53')]({},_0x47d671,_0x5d88a2[_0x7ed1('0x55')]);return _0x17b331['getApplications'](_0x47d671);}})[_0x7ed1('0x21')](function(_0x2697a3){if(_0x2697a3){_0x51d1ff=_0x2697a3[_0x7ed1('0x4c')];if(!_0x5d88a2[_0x7ed1('0x47')][_0x7ed1('0x4d')]('nolimit')){_0x47d671[_0x7ed1('0x32')]=qs[_0x7ed1('0x32')](_0x5d88a2[_0x7ed1('0x47')]['limit']);_0x47d671[_0x7ed1('0x31')]=qs[_0x7ed1('0x31')](_0x5d88a2['query']['offset']);}return _0x17b331[_0x7ed1('0x85')](_0x47d671);}})['then'](function(_0x44078f){if(_0x44078f){return _0x44078f?{'count':_0x51d1ff,'rows':_0x44078f}:null;}})[_0x7ed1('0x21')](respondWithResult(_0x210497,null))[_0x7ed1('0x2b')](handleError(_0x210497,null));};function Extension(_0x5b346c,_0x5c509f,_0xc460e5,_0x59b7d4){this[_0x7ed1('0x86')]=_0x7ed1('0x87');this[_0x7ed1('0x88')]=_0x5b346c[_0x7ed1('0x89')];this['app']=_0x59b7d4;this[_0x7ed1('0x43')]=_0x7ed1('0x8a');this['description']=_0x7ed1('0x8b');this['FaxAccountId']=_0x5b346c['id'];this[_0x7ed1('0x84')]=_0x5c509f;this[_0x7ed1('0x8c')]=_0xc460e5;}function createExtensionsReciveFax(_0x238099){var _0x5501b8=0x1;var _0x358916=[];_0x358916[_0x7ed1('0x8d')](new Extension(_0x238099,_0x5501b8,'',_0x7ed1('0x8e')));_0x5501b8+=0x1;_0x358916[_0x7ed1('0x8d')](new Extension(_0x238099,_0x5501b8,_0x7ed1('0x8f'),'Set'));_0x5501b8+=0x1;for(var _0xa74fda in _0x238099){if(_0x238099[_0x7ed1('0x4d')](_0xa74fda)&&(_0xa74fda===_0x7ed1('0x90')||_0xa74fda===_0x7ed1('0x89')||_0xa74fda===_0x7ed1('0x91')||_0xa74fda==='faxdetect'||_0xa74fda===_0x7ed1('0x92')||_0xa74fda===_0x7ed1('0x93')||_0xa74fda===_0x7ed1('0x94')||_0xa74fda==='modem'||_0xa74fda===_0x7ed1('0x95'))){_0x358916[_0x7ed1('0x8d')](new Extension(_0x238099,_0x5501b8,_0x7ed1('0x96')+_0xa74fda+')='+_0x238099[_0xa74fda],_0x7ed1('0x97')));_0x5501b8+=0x1;}}_0x358916[_0x7ed1('0x8d')](new Extension(_0x238099,_0x5501b8,'6','Wait'));_0x5501b8+=0x1;_0x358916[_0x7ed1('0x8d')](new Extension(_0x238099,_0x5501b8,'/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'));_0x5501b8=0x0;return _0x358916;}exports[_0x7ed1('0x98')]=function(_0x10a9a0,_0x1c9e96,_0x12fe13){var _0x21c7bc;return db[_0x7ed1('0x99')]['transaction'](function(_0x53286f){return db['FaxAccount']['create'](_0x10a9a0[_0x7ed1('0x5e')],{'transaction':_0x53286f})['then'](function(_0x453624){_0x21c7bc=_0x453624['get']({'plain':!![]});return db[_0x7ed1('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x21c7bc),{'transaction':_0x53286f});});})['then'](function(){return _0x21c7bc;})[_0x7ed1('0x21')](respondWithResult(_0x1c9e96,null))['catch'](handleError(_0x1c9e96,null));};exports[_0x7ed1('0x9b')]=function(_0x43c3cb,_0x498990,_0x196bb2){var _0x6fa068;return db[_0x7ed1('0x99')][_0x7ed1('0x81')](function(_0x1c893f){return db['FaxAccount'][_0x7ed1('0x37')](_0x43c3cb[_0x7ed1('0x5e')],{'where':{'id':_0x43c3cb[_0x7ed1('0x5e')]['id']},'transaction':_0x1c893f})[_0x7ed1('0x21')](function(_0x198e4b){return db[_0x7ed1('0x9a')][_0x7ed1('0x38')]({'where':{'FaxAccountId':_0x43c3cb[_0x7ed1('0x5e')]['id']},'transaction':_0x1c893f})[_0x7ed1('0x21')](function(_0x4edb38){return db[_0x7ed1('0x9a')]['bulkCreate'](createExtensionsReciveFax(_[_0x7ed1('0x76')](_0x43c3cb[_0x7ed1('0x5e')],[_0x7ed1('0x9c'),_0x7ed1('0x44'),_0x7ed1('0x9d'),_0x7ed1('0x9e'),_0x7ed1('0x9f'),_0x7ed1('0xa0')])),{'transaction':_0x1c893f});});});})['then'](function(){return db[_0x7ed1('0x56')][_0x7ed1('0xa1')](_0x43c3cb[_0x7ed1('0x5e')]['id']);})[_0x7ed1('0x21')](respondWithResult(_0x498990,null))[_0x7ed1('0x2b')](handleError(_0x498990,null));};exports[_0x7ed1('0xa2')]=function(_0x7e8eaa,_0x1e924b,_0x1c39df){var _0x271ced={'raw':!![],'where':{}};var _0x5d0f76={};var _0x2ca414={'count':0x0,'rows':[]};return db[_0x7ed1('0x56')][_0x7ed1('0x6a')]({'where':{'id':_0x7e8eaa[_0x7ed1('0x5a')]['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x1e924b,null))[_0x7ed1('0x21')](function(_0x4d22cb){if(_0x4d22cb){_0x5d0f76[_0x7ed1('0x45')]=_['keys'](db[_0x7ed1('0xa3')][_0x7ed1('0x41')]);_0x5d0f76[_0x7ed1('0x47')]=_[_0x7ed1('0x5b')](_0x7e8eaa[_0x7ed1('0x47')]);_0x5d0f76['filters']=_[_0x7ed1('0x4a')](_0x5d0f76[_0x7ed1('0x45')],_0x5d0f76['query']);_0x271ced['attributes']=_[_0x7ed1('0x4a')](_0x5d0f76[_0x7ed1('0x45')],qs[_0x7ed1('0x4b')](_0x7e8eaa[_0x7ed1('0x47')][_0x7ed1('0x4b')]));_0x271ced[_0x7ed1('0x49')]=_0x271ced[_0x7ed1('0x49')]['length']?_0x271ced[_0x7ed1('0x49')]:_0x5d0f76[_0x7ed1('0x45')];if(!_0x7e8eaa['query'][_0x7ed1('0x4d')]('nolimit')){_0x271ced[_0x7ed1('0x32')]=qs[_0x7ed1('0x32')](_0x7e8eaa[_0x7ed1('0x47')][_0x7ed1('0x32')]);_0x271ced[_0x7ed1('0x31')]=qs[_0x7ed1('0x31')](_0x7e8eaa[_0x7ed1('0x47')][_0x7ed1('0x31')]);}_0x271ced[_0x7ed1('0x72')]=qs[_0x7ed1('0x4f')](_0x7e8eaa[_0x7ed1('0x47')][_0x7ed1('0x4f')]);_0x271ced[_0x7ed1('0x50')]=qs[_0x7ed1('0x48')](_[_0x7ed1('0x51')](_0x7e8eaa[_0x7ed1('0x47')],_0x5d0f76[_0x7ed1('0x48')]));_0x271ced[_0x7ed1('0x50')][_0x7ed1('0x67')]=_0x4d22cb['id'];if(_0x7e8eaa[_0x7ed1('0x47')][_0x7ed1('0x52')]){_0x271ced[_0x7ed1('0x50')]=_['merge'](_0x271ced[_0x7ed1('0x50')],{'$or':_[_0x7ed1('0x46')](_0x271ced[_0x7ed1('0x49')],function(_0x1def07){var _0x2f80f9={};_0x2f80f9[_0x1def07]={'$like':'%'+_0x7e8eaa[_0x7ed1('0x47')]['filter']+'%'};return _0x2f80f9;})});}if(_0x7e8eaa[_0x7ed1('0x47')][_0x7ed1('0xa4')]){var _0xeebef5=_0x7e8eaa[_0x7ed1('0x47')][_0x7ed1('0xa4')][_0x7ed1('0xa5')](',');var _0x168330={};_0x168330[_0xeebef5[0x0]]={'$gte':moment(_0xeebef5[0x1])[_0x7ed1('0xa6')](_0x7ed1('0xa7'))};_0x271ced[_0x7ed1('0x50')]=_[_0x7ed1('0x53')](_0x271ced['where'],_0x168330);}_0x271ced=_[_0x7ed1('0x53')]({},_0x271ced,_0x7e8eaa[_0x7ed1('0x55')]);return db['FaxMessage'][_0x7ed1('0x30')]({'where':_0x271ced[_0x7ed1('0x50')]})[_0x7ed1('0x21')](function(_0xf89103){_0x2ca414['count']=_0xf89103;if(_0x7e8eaa[_0x7ed1('0x47')][_0x7ed1('0x6b')]){_0x271ced[_0x7ed1('0x57')]=[{'all':!![]}];}return db[_0x7ed1('0xa3')][_0x7ed1('0x58')](_0x271ced);})['then'](function(_0x50f4d4){_0x2ca414[_0x7ed1('0x6c')]=_0x50f4d4;return _0x2ca414;});}})['then'](respondWithFilteredResult(_0x1e924b,_0x271ced))[_0x7ed1('0x2b')](handleError(_0x1e924b,null));};exports[_0x7ed1('0x3d')]=function(_0x51e181,_0x57f114,_0x586220){var _0x158ea4,_0x46cbea={},_0x3b2217;if(_0x51e181[_0x7ed1('0x5e')]['to']){_0x3b2217=_0x51e181[_0x7ed1('0x5e')]['to'][0x0];}return db[_0x7ed1('0x56')][_0x7ed1('0x5c')]({'where':{'id':_0x51e181['params']['id']},'include':[{'model':db[_0x7ed1('0xa8')],'as':'List','include':[{'model':db[_0x7ed1('0x78')],'as':_0x7ed1('0xa9'),'where':{'fax':_0x3b2217},'limit':0x1,'order':[[_0x7ed1('0x9e'),_0x7ed1('0xaa')]]}]}]})[_0x7ed1('0x21')](handleEntityNotFound(_0x57f114,null))[_0x7ed1('0x21')](function(_0x3f4c47){_0x158ea4=_0x3f4c47;if(_0x51e181[_0x7ed1('0x5e')]['attachments']&&_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][_0x7ed1('0x4c')]){for(var _0x1c7548=0x0;_0x1c7548<_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][_0x7ed1('0x4c')];_0x1c7548+=0x1){_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][_0x1c7548]={'filename':_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][_0x1c7548][_0x7ed1('0x3c')],'id':_0x51e181[_0x7ed1('0x5e')]['attachments'][_0x1c7548]['id'],'path':path[_0x7ed1('0xac')](config[_0x7ed1('0xad')],_0x7ed1('0xae'),_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][_0x1c7548][_0x7ed1('0xaf')])};}}return respondWithRpcPromise(_0x7ed1('0xb0'),_0x7ed1('0xb0'),{'FaxAccountId':_[_0x7ed1('0xb1')](_0x51e181[_0x7ed1('0x5a')]['id'])?undefined:_0x51e181['params']['id'],'path':_[_0x7ed1('0xb1')](_0x51e181[_0x7ed1('0x5e')]['attachments'][0x0][_0x7ed1('0x8')])?undefined:_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][0x0]['path'],'fax':_['isNil'](_0x51e181['body']['to'][0x0])?undefined:_0x51e181[_0x7ed1('0x5e')]['to'][0x0]},client9002);})[_0x7ed1('0x21')](function(){if(_0x158ea4){if(_['isNil'](_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xb2')])){_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xb2')]=util[_0x7ed1('0xa6')](_0x7ed1('0xb3'),_0x158ea4['name'],_0x158ea4[_0x7ed1('0xb4')]);}if(_0x158ea4[_0x7ed1('0xb5')]){if(_0x158ea4[_0x7ed1('0xb5')][_0x7ed1('0xa9')][_0x7ed1('0x4c')]){return _0x158ea4[_0x7ed1('0xb5')][_0x7ed1('0xa9')][0x0];}else{return db[_0x7ed1('0x78')][_0x7ed1('0x5d')](_[_0x7ed1('0x16')](_0x51e181[_0x7ed1('0x5e')],{'firstName':_0x51e181[_0x7ed1('0x5e')]['to'][0x0],'phone':_0x51e181[_0x7ed1('0x5e')]['to'][0x0],'fax':_0x51e181[_0x7ed1('0x5e')]['to'][0x0],'ListId':_0x158ea4['ListId']}));}}else{throw new Error(_0x7ed1('0xb6'));}}else{throw new Error(_0x7ed1('0xb7'));}})[_0x7ed1('0x21')](function(_0x2134f2){if(_0x2134f2){return db['FaxInteraction'][_0x7ed1('0x5c')]({'where':{'ContactId':_0x2134f2['id'],'closed':![],'FaxAccountId':_0x158ea4['id']}})['then'](function(_0x19bd0e){if(_0x19bd0e){return[_0x19bd0e,![]];}return db[_0x7ed1('0x75')][_0x7ed1('0x5d')]({'UserId':_0x51e181[_0x7ed1('0x5f')]['id'],'ContactId':_0x2134f2['id'],'FaxAccountId':_0x158ea4['id'],'fax':_0x51e181[_0x7ed1('0x5e')]['to'][0x0],'firstMsgDirection':_0x7ed1('0xb8'),'Messages':[_[_0x7ed1('0x53')](_0x51e181[_0x7ed1('0x5e')],{'read':![],'body':_0x51e181['body']['attachments'][0x0]['filename'],'FaxAccountId':_0x158ea4['id'],'UserId':_0x51e181[_0x7ed1('0x5f')]['id'],'ContactId':_0x2134f2['id'],'AttachmentId':_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x7ed1('0xa3')],'as':_0x7ed1('0xb9')}]})['then'](function(_0x1e0bd8){return[_0x1e0bd8,!![]];});});}else{throw new Error(_0x7ed1('0xba'));}})[_0x7ed1('0xbb')](function(_0x338028,_0x3e6c02){if(_0x3e6c02){return _0x338028;}return db[_0x7ed1('0xa3')]['create']({'direction':_0x7ed1('0xb8'),'read':![],'body':_0x51e181[_0x7ed1('0x5e')]['attachments'][0x0][_0x7ed1('0xbc')],'FaxAccountId':_0x158ea4['id'],'FaxInteractionId':_0x338028['id'],'UserId':_0x51e181[_0x7ed1('0x5f')]['id'],'ContactId':_0x338028[_0x7ed1('0xbd')],'AttachmentId':_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][0x0]['id']})[_0x7ed1('0x21')](function(_0x22b3d3){_0x338028[_0x7ed1('0xbe')][_0x7ed1('0xb9')]=[];_0x338028[_0x7ed1('0xbe')][_0x7ed1('0xb9')][_0x7ed1('0x8d')](_0x22b3d3[_0x7ed1('0xbe')]);return _0x338028;});})[_0x7ed1('0x21')](function(_0x3e2bf5){respondWithRpcPromise(_0x7ed1('0xbf'),'SendFax',{'FaxAccountId':_[_0x7ed1('0xb1')](_0x51e181[_0x7ed1('0x5a')]['id'])?undefined:_0x51e181[_0x7ed1('0x5a')]['id'],'path':_[_0x7ed1('0xb1')](_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][0x0][_0x7ed1('0x8')])?undefined:_0x51e181['body'][_0x7ed1('0xab')][0x0][_0x7ed1('0x8')],'fax':_[_0x7ed1('0xb1')](_0x51e181[_0x7ed1('0x5e')]['to'][0x0])?undefined:_0x51e181['body']['to'][0x0],'AttachmentId':_0x51e181[_0x7ed1('0x5e')][_0x7ed1('0xab')][0x0]['id']},client9002)[_0x7ed1('0x21')](function(_0x1c3007){logger[_0x7ed1('0xc0')](_0x7ed1('0xc1'),_0x1c3007);})[_0x7ed1('0x2b')](function(_0x3222a6){logger['info'](_0x7ed1('0xc1'),_0x3222a6);});return _0x3e2bf5;})[_0x7ed1('0x21')](respondWithResult(_0x57f114,null))[_0x7ed1('0x2b')](handleError(_0x57f114,null));};exports[_0x7ed1('0xc2')]=function(_0x2280dc,_0x56bbbd,_0x524d91){return db['FaxAccount']['find']({'where':{'id':_0x2280dc['params']['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x56bbbd,null))[_0x7ed1('0x21')](function(_0x5ef47b){if(_0x5ef47b){return _0x5ef47b[_0x7ed1('0xc2')](_0x2280dc[_0x7ed1('0x5e')]['ids'],_['omit'](_0x2280dc[_0x7ed1('0x5e')],[_0x7ed1('0x6e'),'id'])||{})['spread'](function(_0x4f3a64){for(var _0x1a9405=0x0;_0x1a9405<_0x2280dc[_0x7ed1('0x5e')][_0x7ed1('0x6e')][_0x7ed1('0x4c')];_0x1a9405+=0x1){socket[_0x7ed1('0xc3')](_0x7ed1('0xc4'),{'UserId':_0x2280dc[_0x7ed1('0x5e')][_0x7ed1('0x6e')][_0x1a9405],'FaxAccountId':_0x2280dc[_0x7ed1('0x5a')]['id']});}return _0x4f3a64;});}})[_0x7ed1('0x21')](respondWithResult(_0x56bbbd,null))['catch'](handleError(_0x56bbbd,null));};exports[_0x7ed1('0xc5')]=function(_0x5b8031,_0x1e6776,_0x18ffc7){return db[_0x7ed1('0x56')][_0x7ed1('0x5c')]({'where':{'id':_0x5b8031[_0x7ed1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1e6776,null))[_0x7ed1('0x21')](function(_0x2bcdab){if(_0x2bcdab){return _0x2bcdab['removeAgents'](_0x5b8031[_0x7ed1('0x47')]['ids'])[_0x7ed1('0x21')](function(){if(_[_0x7ed1('0xc6')](_0x5b8031[_0x7ed1('0x47')][_0x7ed1('0x6e')])){for(var _0x30c43c=0x0;_0x30c43c<_0x5b8031[_0x7ed1('0x47')][_0x7ed1('0x6e')][_0x7ed1('0x4c')];_0x30c43c+=0x1){socket['emit'](_0x7ed1('0xc7'),{'UserId':Number(_0x5b8031[_0x7ed1('0x47')][_0x7ed1('0x6e')][_0x30c43c]),'FaxAccountId':Number(_0x5b8031['params']['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x5b8031[_0x7ed1('0x47')][_0x7ed1('0x6e')]),'FaxAccountId':Number(_0x5b8031[_0x7ed1('0x5a')]['id'])});}});}})[_0x7ed1('0x21')](respondWithStatusCode(_0x1e6776,null))[_0x7ed1('0x2b')](handleError(_0x1e6776,null));};exports['getAgents']=function(_0x479350,_0x52d414,_0x506d77){var _0x82f1b={};var _0x33f413={};var _0x1f0096;var _0x14f8fe;return db[_0x7ed1('0x56')][_0x7ed1('0x6a')]({'where':{'id':_0x479350['params']['id']}})[_0x7ed1('0x21')](handleEntityNotFound(_0x52d414,null))['then'](function(_0x1146ec){if(_0x1146ec){_0x1f0096=_0x1146ec;_0x33f413[_0x7ed1('0x45')]=_[_0x7ed1('0x5b')](db[_0x7ed1('0xc8')][_0x7ed1('0x41')]);_0x33f413[_0x7ed1('0x47')]=_[_0x7ed1('0x5b')](_0x479350['query']);_0x33f413[_0x7ed1('0x48')]=_['intersection'](_0x33f413['model'],_0x33f413[_0x7ed1('0x47')]);_0x82f1b[_0x7ed1('0x49')]=_[_0x7ed1('0x4a')](_0x33f413[_0x7ed1('0x45')],qs[_0x7ed1('0x4b')](_0x479350[_0x7ed1('0x47')][_0x7ed1('0x4b')]));_0x82f1b[_0x7ed1('0x49')]=_0x82f1b[_0x7ed1('0x49')][_0x7ed1('0x4c')]?_0x82f1b['attributes']:_0x33f413[_0x7ed1('0x45')];_0x82f1b['order']=qs[_0x7ed1('0x4f')](_0x479350[_0x7ed1('0x47')]['sort']);_0x82f1b[_0x7ed1('0x50')]=qs[_0x7ed1('0x48')](_[_0x7ed1('0x51')](_0x479350[_0x7ed1('0x47')],_0x33f413[_0x7ed1('0x48')]));if(_0x479350[_0x7ed1('0x47')][_0x7ed1('0x52')]){_0x82f1b[_0x7ed1('0x50')]=_[_0x7ed1('0x53')](_0x82f1b[_0x7ed1('0x50')],{'$or':_[_0x7ed1('0x46')](_0x82f1b[_0x7ed1('0x49')],function(_0x286b6a){var _0x5c317d={};_0x5c317d[_0x286b6a]={'$like':'%'+_0x479350[_0x7ed1('0x47')][_0x7ed1('0x52')]+'%'};return _0x5c317d;})});}_0x82f1b=_[_0x7ed1('0x53')]({},_0x82f1b,_0x479350[_0x7ed1('0x55')]);return _0x1f0096[_0x7ed1('0xc9')](_0x82f1b);}})[_0x7ed1('0x21')](function(_0x14d9b5){if(_0x14d9b5){_0x14f8fe=_0x14d9b5['length'];if(!_0x479350[_0x7ed1('0x47')][_0x7ed1('0x4d')](_0x7ed1('0x4e'))){_0x82f1b[_0x7ed1('0x32')]=qs[_0x7ed1('0x32')](_0x479350['query']['limit']);_0x82f1b[_0x7ed1('0x31')]=qs[_0x7ed1('0x31')](_0x479350[_0x7ed1('0x47')][_0x7ed1('0x31')]);}return _0x1f0096[_0x7ed1('0xc9')](_0x82f1b);}})[_0x7ed1('0x21')](function(_0x477975){if(_0x477975){return _0x477975?{'count':_0x14f8fe,'rows':_0x477975}:null;}})[_0x7ed1('0x21')](respondWithResult(_0x52d414,null))[_0x7ed1('0x2b')](handleError(_0x52d414,null));};
\ No newline at end of file
index f319f9d..3bade09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd396=['update','remove','emit','hasOwnProperty','exports','setMaxListeners','save'];(function(_0x2779ba,_0x17be97){var _0x699303=function(_0x46906f){while(--_0x46906f){_0x2779ba['push'](_0x2779ba['shift']());}};_0x699303(++_0x17be97);}(_0xd396,0x1a2));var _0x6d39=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0xd396[_0x4dab14];return _0xf41aa;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6d39('0x0')](0x0);var events={'afterCreate':_0x6d39('0x1'),'afterUpdate':_0x6d39('0x2'),'afterDestroy':_0x6d39('0x3')};function emitEvent(_0x134e99){return function(_0x34e7c9,_0x190a93,_0x23d139){FaxAccountEvents['emit'](_0x134e99+':'+_0x34e7c9['id'],_0x34e7c9);FaxAccountEvents[_0x6d39('0x4')](_0x134e99,_0x34e7c9);_0x23d139(null);};}for(var e in events){if(events[_0x6d39('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x6d39('0x6')]=FaxAccountEvents;
\ No newline at end of file
+var _0x374f=['../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x3d591e,_0x26c163){var _0xa7f7d7=function(_0x537881){while(--_0x537881){_0x3d591e['push'](_0x3d591e['shift']());}};_0xa7f7d7(++_0x26c163);}(_0x374f,0xdb));var _0xf374=function(_0x22bd37,_0x5ec397){_0x22bd37=_0x22bd37-0x0;var _0x442981=_0x374f[_0x22bd37];return _0x442981;};'use strict';var EventEmitter=require(_0xf374('0x0'));var FaxAccount=require(_0xf374('0x1'))['db'][_0xf374('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf374('0x3')](0x0);var events={'afterCreate':_0xf374('0x4'),'afterUpdate':_0xf374('0x5'),'afterDestroy':_0xf374('0x6')};function emitEvent(_0x1165c1){return function(_0x4e7457,_0xa53531,_0x54f072){FaxAccountEvents['emit'](_0x1165c1+':'+_0x4e7457['id'],_0x4e7457);FaxAccountEvents[_0xf374('0x7')](_0x1165c1,_0x4e7457);_0x54f072(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xf374('0x8')](e,emitEvent(event));}}module[_0xf374('0x9')]=FaxAccountEvents;
\ No newline at end of file
index e347dd6..dde950b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a5b=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','../../config/logger','moment','bluebird','path'];(function(_0x41847f,_0x5cf7e5){var _0x3a265f=function(_0xc56124){while(--_0xc56124){_0x41847f['push'](_0x41847f['shift']());}};_0x3a265f(++_0x5cf7e5);}(_0x2a5b,0xf6));var _0xb2a5=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x2a5b[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb2a5('0x0'))('api');var moment=require(_0xb2a5('0x1'));var BPromise=require(_0xb2a5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2a5('0x3'));var rimraf=require('rimraf');var config=require(_0xb2a5('0x4'));var attributes=require(_0xb2a5('0x5'));module[_0xb2a5('0x6')]=function(_0x6696a4,_0xec68c1){return _0x6696a4[_0xb2a5('0x7')](_0xb2a5('0x8'),attributes,{'tableName':_0xb2a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7688=['rimraf','../../config/environment','./faxAccount.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xb8ad63,_0x1fc5a5){var _0x2ec669=function(_0x5dd5c7){while(--_0x5dd5c7){_0xb8ad63['push'](_0xb8ad63['shift']());}};_0x2ec669(++_0x1fc5a5);}(_0x7688,0xe2));var _0x8768=function(_0x5614b8,_0x34963e){_0x5614b8=_0x5614b8-0x0;var _0x3d6acb=_0x7688[_0x5614b8];return _0x3d6acb;};'use strict';var _=require(_0x8768('0x0'));var util=require(_0x8768('0x1'));var logger=require(_0x8768('0x2'))(_0x8768('0x3'));var moment=require(_0x8768('0x4'));var BPromise=require(_0x8768('0x5'));var rp=require(_0x8768('0x6'));var fs=require('fs');var path=require(_0x8768('0x7'));var rimraf=require(_0x8768('0x8'));var config=require(_0x8768('0x9'));var attributes=require(_0x8768('0xa'));module[_0x8768('0xb')]=function(_0x15bd36,_0x4b83ed){return _0x15bd36[_0x8768('0xc')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc9f024..9080734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x223d=['CmList','List','Contacts','DESC','FaxApplication','Applications','get','account','applications','orderBy','priority','asc','length','ListId','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','*,*,*,*','created','interaction','FaxMessage','create','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','isNil','ValidationError','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','from','find'];(function(_0x5586a6,_0x28bce5){var _0x9711ab=function(_0x5b1970){while(--_0x5b1970){_0x5586a6['push'](_0x5586a6['shift']());}};_0x9711ab(++_0x28bce5);}(_0x223d,0x128));var _0xd223=function(_0x2b0ae7,_0x2f9405){_0x2b0ae7=_0x2b0ae7-0x0;var _0x92a676=_0x223d[_0x2b0ae7];return _0x92a676;};'use strict';var _=require(_0xd223('0x0'));var util=require('util');var moment=require(_0xd223('0x1'));var BPromise=require(_0xd223('0x2'));var rs=require(_0xd223('0x3'));var fs=require('fs');var Redis=require(_0xd223('0x4'));var db=require(_0xd223('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd223('0x6'));var config=require(_0xd223('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd223('0x8')][_0xd223('0x9')]({'port':0x232c});config[_0xd223('0xa')]=_[_0xd223('0xb')](config[_0xd223('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd223('0xc'))(new Redis(config[_0xd223('0xa')]));require(_0xd223('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f6541,_0x55702a,_0x72cc69){return new BPromise(function(_0xd1354a,_0x5b41d4){return client[_0xd223('0xe')](_0x2f6541,_0x72cc69)[_0xd223('0xf')](function(_0x2ce813){logger[_0xd223('0x10')](_0xd223('0x11'),_0x55702a,_0xd223('0x12'));logger['debug'](_0xd223('0x13'),_0x55702a,'request\x20sent',JSON[_0xd223('0x14')](_0x2ce813));if(_0x2ce813[_0xd223('0x15')]){if(_0x2ce813[_0xd223('0x15')]['code']===0x1f4){logger[_0xd223('0x15')](_0xd223('0x11'),_0x55702a,_0x2ce813['error']['message']);return _0x5b41d4(_0x2ce813[_0xd223('0x15')][_0xd223('0x16')]);}logger[_0xd223('0x15')](_0xd223('0x11'),_0x55702a,_0x2ce813['error'][_0xd223('0x16')]);return _0xd1354a(_0x2ce813['error']['message']);}else{logger[_0xd223('0x10')](_0xd223('0x11'),_0x55702a,_0xd223('0x12'));_0xd1354a(_0x2ce813['result'][_0xd223('0x16')]);}})[_0xd223('0x17')](function(_0x2f9dc9){logger[_0xd223('0x15')](_0xd223('0x11'),_0x55702a,_0x2f9dc9);_0x5b41d4(_0x2f9dc9);});});}exports[_0xd223('0x18')]=function(_0x5ca78b){var _0xe9f2b4=this;return new Promise(function(_0x4467b3,_0xd877dc){return db[_0xd223('0x19')][_0xd223('0x1a')]({'raw':_0x5ca78b[_0xd223('0x1b')]?_0x5ca78b[_0xd223('0x1b')][_0xd223('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ca78b['options']?_0x5ca78b[_0xd223('0x1b')][_0xd223('0x1d')]||null:null,'attributes':_0x5ca78b[_0xd223('0x1b')]?_0x5ca78b[_0xd223('0x1b')]['attributes']||null:null,'limit':_0x5ca78b[_0xd223('0x1b')]?_0x5ca78b[_0xd223('0x1b')][_0xd223('0x1e')]||null:null,'include':_0x5ca78b[_0xd223('0x1b')]?_0x5ca78b[_0xd223('0x1b')][_0xd223('0x1f')]?_[_0xd223('0x20')](_0x5ca78b['options'][_0xd223('0x1f')],function(_0x1c7416){return{'model':db[_0x1c7416[_0xd223('0x21')]],'as':_0x1c7416['as'],'attributes':_0x1c7416[_0xd223('0x22')],'include':_0x1c7416[_0xd223('0x1f')]?_[_0xd223('0x20')](_0x1c7416[_0xd223('0x1f')],function(_0x51c976){return{'model':db[_0x51c976['model']],'as':_0x51c976['as'],'attributes':_0x51c976[_0xd223('0x22')],'include':_0x51c976[_0xd223('0x1f')]?_[_0xd223('0x20')](_0x51c976['include'],function(_0x3e77ba){return{'model':db[_0x3e77ba[_0xd223('0x21')]],'as':_0x3e77ba['as'],'attributes':_0x3e77ba[_0xd223('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd223('0xf')](function(_0x134f48){logger[_0xd223('0x10')](_0xd223('0x18'),_0x5ca78b);logger[_0xd223('0x23')]('GetFaxAccount',_0x5ca78b,JSON['stringify'](_0x134f48));_0x4467b3(_0x134f48);})['catch'](function(_0x3170e7){logger[_0xd223('0x15')](_0xd223('0x18'),_0x3170e7[_0xd223('0x16')],_0x5ca78b);_0xd877dc(_0xe9f2b4[_0xd223('0x15')](0x1f4,_0x3170e7['message']));});});};exports['NotifyFaxAccount']=function(_0x276054,_0x1283ec,_0x28cc44){var _0x25cdc2=this;return new Promise(function(_0x15c490,_0x410091){var _0x2b6bdb={'body':_0x276054[_0xd223('0x24')],'channel':_0xd223('0x25')};var _0x442faf=[];var _0x38dc5d=[];var _0x2a12b2={};return db[_0xd223('0x26')][_0xd223('0x27')]()['then'](function(_0x2caaea){if(!_0x2caaea){throw new db[(_0xd223('0x28'))]['ValidationError'](_0xd223('0x29'));}_0x442faf=_[_0xd223('0x2a')](_['keys'](_0x2caaea),['createdAt',_0xd223('0x2b')]);_0x38dc5d=_['difference'](_['keys'](_0x2caaea),[_0xd223('0x2c'),'updatedAt',_0xd223('0x2d'),'ListId']);if(_0x276054[_0xd223('0x24')]['id']){delete _0x276054[_0xd223('0x24')]['id'];}if(_[_0xd223('0x2e')](_0x276054[_0xd223('0x24')]['from'])){throw new db[(_0xd223('0x28'))][(_0xd223('0x2f'))](_0xd223('0x30'));}if(_[_0xd223('0x2e')](_0x276054['body'][_0xd223('0x24')])||_0x276054['body']['body']===''){throw new db[(_0xd223('0x28'))]['ValidationError'](_0xd223('0x31'));}if(_[_0xd223('0x2e')](_0x276054[_0xd223('0x24')][_0xd223('0x32')])){throw new db[(_0xd223('0x28'))]['ValidationError'](_0xd223('0x33')+_0x38dc5d);}if(!_[_0xd223('0x34')](_0x38dc5d,_0x276054[_0xd223('0x24')][_0xd223('0x32')])){throw new db[(_0xd223('0x28'))]['ValidationError'](_0xd223('0x35')+_0x38dc5d);}_0x2a12b2[_0x276054[_0xd223('0x24')][_0xd223('0x32')]]=_0x276054[_0xd223('0x24')][_0xd223('0x36')];})[_0xd223('0xf')](function(){return db[_0xd223('0x19')][_0xd223('0x37')]({'where':{'id':_0x276054['account']['id']},'include':[{'model':db[_0xd223('0x38')],'as':_0xd223('0x39'),'include':[{'model':db['CmContact'],'as':_0xd223('0x3a'),'where':_0x2a12b2,'limit':0x1,'order':[[_0xd223('0x2b'),_0xd223('0x3b')]]}]},{'model':db[_0xd223('0x3c')],'as':_0xd223('0x3d')}]});})[_0xd223('0xf')](function(_0x563130){if(_0x563130&&_0x563130[_0xd223('0x39')]){var _0x8eda1e=_0x563130[_0xd223('0x3e')]({'plain':!![]});_0x2b6bdb[_0xd223('0x3f')]=_0x8eda1e;_0x2b6bdb[_0xd223('0x40')]=_0x8eda1e['Applications'];_0x2b6bdb['list']=_0x8eda1e['List'];_0x2b6bdb[_0xd223('0x40')]=_[_0xd223('0x41')](_0x2b6bdb[_0xd223('0x40')],[_0xd223('0x42')],[_0xd223('0x43')]);if(_0x2b6bdb[_0xd223('0x3f')][_0xd223('0x3d')]){delete _0x2b6bdb[_0xd223('0x3f')]['Applications'];}if(_0x2b6bdb[_0xd223('0x3f')][_0xd223('0x39')]&&_0x2b6bdb[_0xd223('0x3f')][_0xd223('0x39')][_0xd223('0x3a')][_0xd223('0x44')]){return _0x2b6bdb['account'][_0xd223('0x39')][_0xd223('0x3a')][0x0];}var _0x3af721=_['defaults'](_0x276054[_0xd223('0x24')],{'firstName':_0x276054['body']['from'],'ListId':_0x8eda1e[_0xd223('0x45')]});_0x3af721[_0x276054[_0xd223('0x24')][_0xd223('0x32')]]=_0x276054[_0xd223('0x24')][_0xd223('0x36')];return db[_0xd223('0x26')]['create'](_0x3af721,{'fields':_0x442faf,'raw':!![]});}})[_0xd223('0xf')](function(_0x141dda){_0x2b6bdb[_0xd223('0x46')]=_0x141dda;if(_0x141dda){var _0x4eda53={'ContactId':_0x141dda['id'],'FaxAccountId':_0x276054[_0xd223('0x3f')]['id'],'fax':_0x141dda[_0xd223('0x25')]};return db[_0xd223('0x47')][_0xd223('0x37')]({'where':{'ContactId':_0x141dda['id'],'closed':![],'FaxAccountId':_0x276054[_0xd223('0x3f')]['id']}})[_0xd223('0xf')](function(_0x44c02b){if(_0x44c02b){return[_0x44c02b,![]];}return db[_0xd223('0x47')]['create'](_0x4eda53)[_0xd223('0xf')](function(_0x3dfa64){return[_0x3dfa64,!![]];});});}else{throw new Error(_0xd223('0x48'));}})[_0xd223('0x49')](function(_0x4b9914,_0xac6d0c){var _0x18b570=_0x4b9914['get']({'plain':!![]});if(_0xac6d0c){if(_0x2b6bdb[_0xd223('0x3f')]['autoclose']){_0x2b6bdb['applications'][_0xd223('0x4a')]({'id':0x0,'priority':_0x2b6bdb[_0xd223('0x40')]['length']+0x1,'app':_0xd223('0x4b'),'appdata':'unmanaged','interval':_0xd223('0x4c')});}_0x18b570[_0xd223('0x4d')]=!![];}else{_0x18b570[_0xd223('0x4d')]=![];}_0x2b6bdb[_0xd223('0x4e')]=_0x18b570;return db[_0xd223('0x4f')][_0xd223('0x50')]({'body':_0x276054[_0xd223('0x24')][_0xd223('0x24')],'FaxAccountId':_0x276054[_0xd223('0x3f')]['id'],'FaxInteractionId':_0x4b9914['id'],'direction':'in','ContactId':_0x4b9914['ContactId'],'AttachmentId':_0x276054[_0xd223('0x24')][_0xd223('0x51')]});})[_0xd223('0xf')](function(_0x178d57){_0x2b6bdb[_0xd223('0x16')]=_0x178d57;if(_0x2b6bdb[_0xd223('0x4e')][_0xd223('0x52')]){return db[_0xd223('0x53')]['find']({'attributes':['id',_0xd223('0x54')],'where':{'id':_0x2b6bdb['interaction']['UserId']}})[_0xd223('0xf')](function(_0x47a727){if(_0x47a727){_0x2b6bdb[_0xd223('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd223('0x55'),'appdata':_0x47a727[_0xd223('0x54')]+','+(_0x2b6bdb[_0xd223('0x3f')][_0xd223('0x56')]||0xa),'interval':_0xd223('0x4c')});}return respondWithRpcPromise('Start',_0xd223('0x57'),_0x2b6bdb);});}return respondWithRpcPromise('Start',_0xd223('0x57'),_0x2b6bdb);})[_0xd223('0xf')](function(_0x100a0f){_0x15c490(_0x100a0f);})['catch'](function(_0x46b665){_0x410091(_0x25cdc2[_0xd223('0x15')](0x1f4,_0x46b665[_0xd223('0x16')]));});});};
\ No newline at end of file
+var _0xdcf6=['error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','map','include','model','then','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','defaults','from','mapKey','create','contact','FaxInteraction','Contact\x20not\x20found','spread','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','agent','Start','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','localhost','redis','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x24fa88,_0x4007b2){var _0x2a7377=function(_0x32b955){while(--_0x32b955){_0x24fa88['push'](_0x24fa88['shift']());}};_0x2a7377(++_0x4007b2);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x18fe54,_0xff789){_0x18fe54=_0x18fe54-0x0;var _0xccb1ee=_0xdcf6[_0x18fe54];return _0xccb1ee;};'use strict';var _=require('lodash');var util=require(_0x6dcf('0x0'));var moment=require(_0x6dcf('0x1'));var BPromise=require(_0x6dcf('0x2'));var rs=require(_0x6dcf('0x3'));var fs=require('fs');var Redis=require(_0x6dcf('0x4'));var db=require(_0x6dcf('0x5'))['db'];var utils=require(_0x6dcf('0x6'));var logger=require('../../config/logger')(_0x6dcf('0x7'));var config=require(_0x6dcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6dcf('0x9')][_0x6dcf('0xa')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':_0x6dcf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dcf('0xc')]));require(_0x6dcf('0xd'))[_0x6dcf('0xe')](socket);function respondWithRpcPromise(_0x4eda69,_0x527a65,_0x5b65a7){return new BPromise(function(_0x443c93,_0x23f052){return client[_0x6dcf('0xf')](_0x4eda69,_0x5b65a7)['then'](function(_0x23fce1){logger[_0x6dcf('0x10')](_0x6dcf('0x11'),_0x527a65,_0x6dcf('0x12'));logger[_0x6dcf('0x13')](_0x6dcf('0x14'),_0x527a65,_0x6dcf('0x12'),JSON[_0x6dcf('0x15')](_0x23fce1));if(_0x23fce1[_0x6dcf('0x16')]){if(_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x17')]===0x1f4){logger[_0x6dcf('0x16')](_0x6dcf('0x11'),_0x527a65,_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);return _0x23f052(_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);}logger['error'](_0x6dcf('0x11'),_0x527a65,_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);return _0x443c93(_0x23fce1['error'][_0x6dcf('0x18')]);}else{logger[_0x6dcf('0x10')](_0x6dcf('0x11'),_0x527a65,_0x6dcf('0x12'));_0x443c93(_0x23fce1[_0x6dcf('0x19')][_0x6dcf('0x18')]);}})[_0x6dcf('0x1a')](function(_0x2b5cd4){logger['error'](_0x6dcf('0x11'),_0x527a65,_0x2b5cd4);_0x23f052(_0x2b5cd4);});});}exports[_0x6dcf('0x1b')]=function(_0x35c30b){var _0x2d2169=this;return new Promise(function(_0x3c9cbb,_0x200994){return db[_0x6dcf('0x1c')]['findAll']({'raw':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b['options'][_0x6dcf('0x1e')]===undefined?!![]:![]:!![],'where':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x1f')]||null:null,'attributes':_0x35c30b['options']?_0x35c30b['options'][_0x6dcf('0x20')]||null:null,'limit':_0x35c30b['options']?_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x21')]||null:null,'include':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b[_0x6dcf('0x1d')]['include']?_[_0x6dcf('0x22')](_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x23')],function(_0x124853){return{'model':db[_0x124853['model']],'as':_0x124853['as'],'attributes':_0x124853[_0x6dcf('0x20')],'include':_0x124853[_0x6dcf('0x23')]?_[_0x6dcf('0x22')](_0x124853[_0x6dcf('0x23')],function(_0x16e8c4){return{'model':db[_0x16e8c4[_0x6dcf('0x24')]],'as':_0x16e8c4['as'],'attributes':_0x16e8c4[_0x6dcf('0x20')],'include':_0x16e8c4[_0x6dcf('0x23')]?_[_0x6dcf('0x22')](_0x16e8c4[_0x6dcf('0x23')],function(_0x2f9558){return{'model':db[_0x2f9558[_0x6dcf('0x24')]],'as':_0x2f9558['as'],'attributes':_0x2f9558['attributes']};}):[]};}):[]};}):[]:[]})[_0x6dcf('0x25')](function(_0x1d3b73){logger['info']('GetFaxAccount',_0x35c30b);logger['debug']('GetFaxAccount',_0x35c30b,JSON[_0x6dcf('0x15')](_0x1d3b73));_0x3c9cbb(_0x1d3b73);})[_0x6dcf('0x1a')](function(_0x4c106c){logger[_0x6dcf('0x16')](_0x6dcf('0x1b'),_0x4c106c[_0x6dcf('0x18')],_0x35c30b);_0x200994(_0x2d2169[_0x6dcf('0x16')](0x1f4,_0x4c106c['message']));});});};exports[_0x6dcf('0x26')]=function(_0x7730b0,_0x1031d5,_0x24a56e){var _0x1dd58c=this;return new Promise(function(_0x1c78d4,_0x7f01d4){var _0x18dc28={'body':_0x7730b0[_0x6dcf('0x27')],'channel':_0x6dcf('0x28')};var _0x3ef3c8=[];var _0x20f59d=[];var _0x1591cf={};return db['CmContact'][_0x6dcf('0x29')]()[_0x6dcf('0x25')](function(_0x4f8dd1){if(!_0x4f8dd1){throw new db[(_0x6dcf('0x2a'))][(_0x6dcf('0x2b'))](_0x6dcf('0x2c'));}_0x3ef3c8=_[_0x6dcf('0x2d')](_[_0x6dcf('0x2e')](_0x4f8dd1),[_0x6dcf('0x2f'),_0x6dcf('0x30')]);_0x20f59d=_[_0x6dcf('0x2d')](_['keys'](_0x4f8dd1),[_0x6dcf('0x2f'),'updatedAt',_0x6dcf('0x31'),_0x6dcf('0x32')]);if(_0x7730b0[_0x6dcf('0x27')]['id']){delete _0x7730b0[_0x6dcf('0x27')]['id'];}if(_[_0x6dcf('0x33')](_0x7730b0[_0x6dcf('0x27')]['from'])){throw new db[(_0x6dcf('0x2a'))]['ValidationError'](_0x6dcf('0x34'));}if(_['isNil'](_0x7730b0[_0x6dcf('0x27')][_0x6dcf('0x27')])||_0x7730b0[_0x6dcf('0x27')]['body']===''){throw new db[(_0x6dcf('0x2a'))]['ValidationError'](_0x6dcf('0x35'));}if(_['isNil'](_0x7730b0[_0x6dcf('0x27')]['mapKey'])){throw new db[(_0x6dcf('0x2a'))][(_0x6dcf('0x2b'))](_0x6dcf('0x36')+_0x20f59d);}if(!_['includes'](_0x20f59d,_0x7730b0[_0x6dcf('0x27')]['mapKey'])){throw new db[(_0x6dcf('0x2a'))][(_0x6dcf('0x2b'))](_0x6dcf('0x37')+_0x20f59d);}_0x1591cf[_0x7730b0[_0x6dcf('0x27')]['mapKey']]=_0x7730b0[_0x6dcf('0x27')]['from'];})[_0x6dcf('0x25')](function(){return db[_0x6dcf('0x1c')][_0x6dcf('0x38')]({'where':{'id':_0x7730b0[_0x6dcf('0x39')]['id']},'include':[{'model':db[_0x6dcf('0x3a')],'as':_0x6dcf('0x3b'),'include':[{'model':db[_0x6dcf('0x3c')],'as':_0x6dcf('0x3d'),'where':_0x1591cf,'limit':0x1,'order':[[_0x6dcf('0x30'),_0x6dcf('0x3e')]]}]},{'model':db[_0x6dcf('0x3f')],'as':_0x6dcf('0x40')}]});})[_0x6dcf('0x25')](function(_0x2dba6b){if(_0x2dba6b&&_0x2dba6b[_0x6dcf('0x3b')]){var _0x1a9d07=_0x2dba6b[_0x6dcf('0x41')]({'plain':!![]});_0x18dc28[_0x6dcf('0x39')]=_0x1a9d07;_0x18dc28[_0x6dcf('0x42')]=_0x1a9d07[_0x6dcf('0x40')];_0x18dc28[_0x6dcf('0x43')]=_0x1a9d07[_0x6dcf('0x3b')];_0x18dc28[_0x6dcf('0x42')]=_[_0x6dcf('0x44')](_0x18dc28[_0x6dcf('0x42')],[_0x6dcf('0x45')],['asc']);if(_0x18dc28['account'][_0x6dcf('0x40')]){delete _0x18dc28[_0x6dcf('0x39')][_0x6dcf('0x40')];}if(_0x18dc28['account'][_0x6dcf('0x3b')]&&_0x18dc28[_0x6dcf('0x39')]['List'][_0x6dcf('0x3d')]['length']){return _0x18dc28[_0x6dcf('0x39')][_0x6dcf('0x3b')][_0x6dcf('0x3d')][0x0];}var _0x39b3f8=_[_0x6dcf('0x46')](_0x7730b0[_0x6dcf('0x27')],{'firstName':_0x7730b0[_0x6dcf('0x27')][_0x6dcf('0x47')],'ListId':_0x1a9d07[_0x6dcf('0x32')]});_0x39b3f8[_0x7730b0[_0x6dcf('0x27')][_0x6dcf('0x48')]]=_0x7730b0[_0x6dcf('0x27')]['from'];return db[_0x6dcf('0x3c')][_0x6dcf('0x49')](_0x39b3f8,{'fields':_0x3ef3c8,'raw':!![]});}})[_0x6dcf('0x25')](function(_0x114d13){_0x18dc28[_0x6dcf('0x4a')]=_0x114d13;if(_0x114d13){var _0x27debd={'ContactId':_0x114d13['id'],'FaxAccountId':_0x7730b0[_0x6dcf('0x39')]['id'],'fax':_0x114d13[_0x6dcf('0x28')]};return db[_0x6dcf('0x4b')][_0x6dcf('0x38')]({'where':{'ContactId':_0x114d13['id'],'closed':![],'FaxAccountId':_0x7730b0[_0x6dcf('0x39')]['id']}})[_0x6dcf('0x25')](function(_0x324a41){if(_0x324a41){return[_0x324a41,![]];}return db[_0x6dcf('0x4b')]['create'](_0x27debd)['then'](function(_0x220047){return[_0x220047,!![]];});});}else{throw new Error(_0x6dcf('0x4c'));}})[_0x6dcf('0x4d')](function(_0x5aa12f,_0x3918b4){var _0x2d4534=_0x5aa12f[_0x6dcf('0x41')]({'plain':!![]});if(_0x3918b4){if(_0x18dc28['account']['autoclose']){_0x18dc28[_0x6dcf('0x42')]['push']({'id':0x0,'priority':_0x18dc28['applications'][_0x6dcf('0x4e')]+0x1,'app':_0x6dcf('0x4f'),'appdata':_0x6dcf('0x50'),'interval':_0x6dcf('0x51')});}_0x2d4534['created']=!![];}else{_0x2d4534[_0x6dcf('0x52')]=![];}_0x18dc28[_0x6dcf('0x53')]=_0x2d4534;return db[_0x6dcf('0x54')][_0x6dcf('0x49')]({'body':_0x7730b0[_0x6dcf('0x27')][_0x6dcf('0x27')],'FaxAccountId':_0x7730b0['account']['id'],'FaxInteractionId':_0x5aa12f['id'],'direction':'in','ContactId':_0x5aa12f['ContactId'],'AttachmentId':_0x7730b0[_0x6dcf('0x27')][_0x6dcf('0x55')]});})[_0x6dcf('0x25')](function(_0x458fd1){_0x18dc28['message']=_0x458fd1;if(_0x18dc28['interaction'][_0x6dcf('0x56')]){return db[_0x6dcf('0x57')]['find']({'attributes':['id',_0x6dcf('0x58')],'where':{'id':_0x18dc28[_0x6dcf('0x53')][_0x6dcf('0x56')]}})['then'](function(_0x4dd9a7){if(_0x4dd9a7){_0x18dc28[_0x6dcf('0x42')][_0x6dcf('0x59')]({'id':0x0,'priority':0x0,'app':_0x6dcf('0x5a'),'appdata':_0x4dd9a7['name']+','+(_0x18dc28[_0x6dcf('0x39')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6dcf('0x5b'),'startRouting',_0x18dc28);});}return respondWithRpcPromise(_0x6dcf('0x5b'),'startRouting',_0x18dc28);})[_0x6dcf('0x25')](function(_0x47978d){_0x1c78d4(_0x47978d);})[_0x6dcf('0x1a')](function(_0x136d0c){_0x7f01d4(_0x1dd58c[_0x6dcf('0x16')](0x1f4,_0x136d0c['message']));});});};
\ No newline at end of file
index db892ad..718a72d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['remove','update','emit','register','length','./faxAccount.events','save'];(function(_0x5a8511,_0xe7bc45){var _0x245d1b=function(_0x3dfca5){while(--_0x3dfca5){_0x5a8511['push'](_0x5a8511['shift']());}};_0x245d1b(++_0xe7bc45);}(_0x1a37,0xb4));var _0x71a3=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1a37[_0x1035c1];return _0x308d67;};'use strict';var FaxAccountEvents=require(_0x71a3('0x0'));var events=[_0x71a3('0x1'),_0x71a3('0x2'),_0x71a3('0x3')];function createListener(_0x353cf0,_0x20d8a7){return function(_0x348395){_0x20d8a7[_0x71a3('0x4')](_0x353cf0,_0x348395);};}function removeListener(_0x29c54f,_0x100181){return function(){FaxAccountEvents['removeListener'](_0x29c54f,_0x100181);};}exports[_0x71a3('0x5')]=function(_0x4f6b7a){for(var _0xd09f7=0x0,_0x45050a=events[_0x71a3('0x6')];_0xd09f7<_0x45050a;_0xd09f7++){var _0x2bb6a2=events[_0xd09f7];var _0x4a9ab2=createListener('faxAccount:'+_0x2bb6a2,_0x4f6b7a);FaxAccountEvents['on'](_0x2bb6a2,_0x4a9ab2);}};
\ No newline at end of file
+var _0xfb11=['length','faxAccount:','./faxAccount.events','remove','update','emit','removeListener'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xfb11[_0x24237f];return _0x48298e;};'use strict';var FaxAccountEvents=require(_0x1fb1('0x0'));var events=['save',_0x1fb1('0x1'),_0x1fb1('0x2')];function createListener(_0x51c055,_0x1461ad){return function(_0x5af9cc){_0x1461ad[_0x1fb1('0x3')](_0x51c055,_0x5af9cc);};}function removeListener(_0x5a830e,_0x190f74){return function(){FaxAccountEvents[_0x1fb1('0x4')](_0x5a830e,_0x190f74);};}exports['register']=function(_0x25d44f){for(var _0x133727=0x0,_0x4c098d=events[_0x1fb1('0x5')];_0x133727<_0x4c098d;_0x133727++){var _0x2596c2=events[_0x133727];var _0x34e61a=createListener(_0x1fb1('0x6')+_0x2596c2,_0x25d44f);FaxAccountEvents['on'](_0x2596c2,_0x34e61a);}};
\ No newline at end of file
index 355e464..201aaea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc20b=['update','destroy','delete','removeDispositions','removeAnswers','exports','multer','path','connect-timeout','express','./faxAccount.controller','isAuthenticated','index','get','/describe','describe','/:id/dispositions','getDispositions','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','create','/:id/canned_answers','/addaccountapplications','updateAccountApplications','send','addAgents','put','/:id'];(function(_0x3167be,_0x448792){var _0x43a1ba=function(_0x3f5976){while(--_0x3f5976){_0x3167be['push'](_0x3167be['shift']());}};_0x43a1ba(++_0x448792);}(_0xc20b,0xb0));var _0xbc20=function(_0x10c573,_0x30e44d){_0x10c573=_0x10c573-0x0;var _0x3c3243=_0xc20b[_0x10c573];return _0x3c3243;};'use strict';var multer=require(_0xbc20('0x0'));var util=require('util');var path=require(_0xbc20('0x1'));var timeout=require(_0xbc20('0x2'));var express=require(_0xbc20('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbc20('0x4'));router['get']('/',auth[_0xbc20('0x5')](),controller[_0xbc20('0x6')]);router[_0xbc20('0x7')](_0xbc20('0x8'),auth[_0xbc20('0x5')](),controller[_0xbc20('0x9')]);router['get']('/:id',auth[_0xbc20('0x5')](),controller['show']);router[_0xbc20('0x7')](_0xbc20('0xa'),auth[_0xbc20('0x5')](),controller[_0xbc20('0xb')]);router[_0xbc20('0x7')]('/:id/canned_answers',auth[_0xbc20('0x5')](),controller['getAnswers']);router['get'](_0xbc20('0xc'),auth[_0xbc20('0x5')](),controller[_0xbc20('0xd')]);router[_0xbc20('0x7')](_0xbc20('0xe'),auth[_0xbc20('0x5')](),controller[_0xbc20('0xf')]);router[_0xbc20('0x7')](_0xbc20('0x10'),auth[_0xbc20('0x5')](),controller[_0xbc20('0x11')]);router[_0xbc20('0x7')](_0xbc20('0x12'),auth[_0xbc20('0x5')](),controller['getAgents']);router[_0xbc20('0x13')]('/',auth[_0xbc20('0x5')](),controller[_0xbc20('0x14')]);router[_0xbc20('0x13')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xbc20('0x13')](_0xbc20('0x15'),auth[_0xbc20('0x5')](),controller['addAnswer']);router[_0xbc20('0x13')]('/:id/interactions',auth[_0xbc20('0x5')](),controller['addInteraction']);router[_0xbc20('0x13')](_0xbc20('0xe'),auth[_0xbc20('0x5')](),controller['addApplications']);router[_0xbc20('0x13')](_0xbc20('0x16'),auth[_0xbc20('0x5')](),controller['addAccountApplications']);router[_0xbc20('0x13')]('/updateaccountapplications',auth[_0xbc20('0x5')](),controller[_0xbc20('0x17')]);router[_0xbc20('0x13')]('/:id/send',auth[_0xbc20('0x5')](),controller[_0xbc20('0x18')]);router['post']('/:id/users',auth[_0xbc20('0x5')](),controller[_0xbc20('0x19')]);router[_0xbc20('0x1a')](_0xbc20('0x1b'),auth['isAuthenticated'](),controller[_0xbc20('0x1c')]);router['delete']('/:id',auth[_0xbc20('0x5')](),controller[_0xbc20('0x1d')]);router[_0xbc20('0x1e')]('/:id/dispositions',auth[_0xbc20('0x5')](),controller[_0xbc20('0x1f')]);router[_0xbc20('0x1e')](_0xbc20('0x15'),auth[_0xbc20('0x5')](),controller[_0xbc20('0x20')]);router[_0xbc20('0x1e')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xbc20('0x21')]=router;
\ No newline at end of file
+var _0x9705=['addInteraction','/addaccountapplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','create','post','/:id/dispositions','addAnswer','/:id/interactions'];(function(_0x4054fe,_0x18f33e){var _0x4f9bee=function(_0x3c304d){while(--_0x3c304d){_0x4054fe['push'](_0x4054fe['shift']());}};_0x4f9bee(++_0x18f33e);}(_0x9705,0x8f));var _0x5970=function(_0xd23a84,_0x90743f){_0xd23a84=_0xd23a84-0x0;var _0x3ab724=_0x9705[_0xd23a84];return _0x3ab724;};'use strict';var multer=require(_0x5970('0x0'));var util=require(_0x5970('0x1'));var path=require(_0x5970('0x2'));var timeout=require(_0x5970('0x3'));var express=require(_0x5970('0x4'));var router=express[_0x5970('0x5')]();var auth=require(_0x5970('0x6'));var interaction=require(_0x5970('0x7'));var config=require(_0x5970('0x8'));var controller=require(_0x5970('0x9'));router[_0x5970('0xa')]('/',auth['isAuthenticated'](),controller[_0x5970('0xb')]);router['get'](_0x5970('0xc'),auth['isAuthenticated'](),controller[_0x5970('0xd')]);router[_0x5970('0xa')](_0x5970('0xe'),auth[_0x5970('0xf')](),controller[_0x5970('0x10')]);router[_0x5970('0xa')]('/:id/dispositions',auth[_0x5970('0xf')](),controller[_0x5970('0x11')]);router[_0x5970('0xa')](_0x5970('0x12'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x5970('0xa')]('/:id/interactions',auth[_0x5970('0xf')](),controller['getInteractions']);router[_0x5970('0xa')](_0x5970('0x13'),auth[_0x5970('0xf')](),controller[_0x5970('0x14')]);router[_0x5970('0xa')](_0x5970('0x15'),auth[_0x5970('0xf')](),controller['getMessages']);router[_0x5970('0xa')](_0x5970('0x16'),auth[_0x5970('0xf')](),controller[_0x5970('0x17')]);router['post']('/',auth[_0x5970('0xf')](),controller[_0x5970('0x18')]);router[_0x5970('0x19')](_0x5970('0x1a'),auth[_0x5970('0xf')](),controller['addDisposition']);router[_0x5970('0x19')]('/:id/canned_answers',auth[_0x5970('0xf')](),controller[_0x5970('0x1b')]);router[_0x5970('0x19')](_0x5970('0x1c'),auth[_0x5970('0xf')](),controller[_0x5970('0x1d')]);router['post'](_0x5970('0x13'),auth[_0x5970('0xf')](),controller['addApplications']);router[_0x5970('0x19')](_0x5970('0x1e'),auth[_0x5970('0xf')](),controller['addAccountApplications']);router['post'](_0x5970('0x1f'),auth[_0x5970('0xf')](),controller[_0x5970('0x20')]);router[_0x5970('0x19')]('/:id/send',auth['isAuthenticated'](),controller[_0x5970('0x21')]);router[_0x5970('0x19')](_0x5970('0x16'),auth[_0x5970('0xf')](),controller[_0x5970('0x22')]);router[_0x5970('0x23')]('/:id',auth['isAuthenticated'](),controller[_0x5970('0x24')]);router[_0x5970('0x25')](_0x5970('0xe'),auth['isAuthenticated'](),controller[_0x5970('0x26')]);router[_0x5970('0x25')](_0x5970('0x1a'),auth[_0x5970('0xf')](),controller[_0x5970('0x27')]);router[_0x5970('0x25')](_0x5970('0x12'),auth[_0x5970('0xf')](),controller[_0x5970('0x28')]);router[_0x5970('0x25')](_0x5970('0x16'),auth['isAuthenticated'](),controller[_0x5970('0x29')]);module[_0x5970('0x2a')]=router;
\ No newline at end of file
index a0b1b53..d7b8926 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa868=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa868,0x1b8));var _0x8a86=function(_0x1c12bd,_0x348360){_0x1c12bd=_0x1c12bd-0x0;var _0x1de620=_0xa868[_0x1c12bd];return _0x1de620;};'use strict';var Sequelize=require(_0x8a86('0x0'));module[_0x8a86('0x1')]={'priority':{'type':Sequelize[_0x8a86('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8a86('0x3')],'allowNull':![],'defaultValue':_0x8a86('0x4')},'appdata':{'type':Sequelize[_0x8a86('0x5')]()},'description':{'type':Sequelize[_0x8a86('0x3')]},'interval':{'type':Sequelize[_0x8a86('0x3')],'defaultValue':_0x8a86('0x6')}};
\ No newline at end of file
+var _0x014c=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x327c00,_0x5d43a3){var _0xc2ec69=function(_0x4dfbeb){while(--_0x4dfbeb){_0x327c00['push'](_0x327c00['shift']());}};_0xc2ec69(++_0x5d43a3);}(_0x014c,0x17b));var _0xc014=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x014c[_0x18d631];return _0x50d708;};'use strict';var Sequelize=require('sequelize');module[_0xc014('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc014('0x1')],'allowNull':![],'defaultValue':_0xc014('0x2')},'appdata':{'type':Sequelize[_0xc014('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc014('0x4')}};
\ No newline at end of file
index dcf46c2..5dbbe1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','FaxApplication','options','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update'];(function(_0x3d5a8c,_0x3b7651){var _0x208a6f=function(_0xbc565f){while(--_0xbc565f){_0x3d5a8c['push'](_0x3d5a8c['shift']());}};_0x208a6f(++_0x3b7651);}(_0x814b,0x1a2));var _0xb814=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0x814b[_0x55754e];return _0x2e9948;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['FaxApplication'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['FaxApplication'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};
\ No newline at end of file
+var _0x4975=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','FaxApplication','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x4975,0x86));var _0x5497=function(_0xcba418,_0x1807f3){_0xcba418=_0xcba418-0x0;var _0x596908=_0x4975[_0xcba418];return _0x596908;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc250bb,_0x1b23df){_0x1b23df=_0x1b23df||0xcc;return function(_0x1bb794){if(_0x1bb794){return _0xc250bb[_0x5497('0x18')](_0x1b23df);}return _0xc250bb[_0x5497('0x19')](_0x1b23df)[_0x5497('0x1a')]();};}function respondWithResult(_0x1f7169,_0xaca97d){_0xaca97d=_0xaca97d||0xc8;return function(_0x363a5b){if(_0x363a5b){return _0x1f7169[_0x5497('0x19')](_0xaca97d)['json'](_0x363a5b);}};}function respondWithFilteredResult(_0x11b0a9,_0x4fb8e9){return function(_0x4237a9){if(_0x4237a9){var _0x2bfd8a=_0x4237a9[_0x5497('0x1b')],_0x19e5f3=_0x4fb8e9[_0x5497('0x1c')],_0x3ce50b=_0x4fb8e9['offset']+_0x4fb8e9['limit'],_0x37c18e;if(_0x3ce50b>=_0x2bfd8a){_0x3ce50b=_0x2bfd8a;_0x37c18e=0xc8;}else{_0x37c18e=0xce;}_0x11b0a9[_0x5497('0x19')](_0x37c18e);return _0x11b0a9[_0x5497('0x1d')](_0x5497('0x1e'),_0x19e5f3+'-'+_0x3ce50b+'/'+_0x2bfd8a)['json'](_0x4237a9);}return null;};}function patchUpdates(_0xbf1ba7){return function(_0xcbd71d){try{jsonpatch[_0x5497('0x1f')](_0xcbd71d,_0xbf1ba7,!![]);}catch(_0x43da2c){return BPromise[_0x5497('0x20')](_0x43da2c);}return _0xcbd71d[_0x5497('0x21')]();};}function saveUpdates(_0x16d378,_0x10226f){return function(_0x2e3960){if(_0x2e3960){return _0x2e3960[_0x5497('0x22')](_0x16d378)[_0x5497('0x23')](function(_0x52c049){return _0x52c049;});}return null;};}function removeEntity(_0x720767,_0x4d1b27){return function(_0x19200a){if(_0x19200a){return _0x19200a[_0x5497('0x24')]()[_0x5497('0x23')](function(){_0x720767[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(!_0x54043a){_0x3b2fbc[_0x5497('0x18')](0x194);}return _0x54043a;};}function handleError(_0x34b97f,_0x24482a){_0x24482a=_0x24482a||0x1f4;return function(_0x281155){logger['error'](_0x281155[_0x5497('0x25')]);if(_0x281155['name']){delete _0x281155[_0x5497('0x26')];}_0x34b97f[_0x5497('0x19')](_0x24482a)[_0x5497('0x27')](_0x281155);};}exports[_0x5497('0x28')]=function(_0x163a30,_0x31cd01){var _0x48b835={},_0x4af5f4={},_0x5406e2={'count':0x0,'rows':[]};var _0x583d06=_['map'](db[_0x5497('0x29')]['rawAttributes'],function(_0x5e9356){return{'name':_0x5e9356[_0x5497('0x2a')],'type':_0x5e9356[_0x5497('0x2b')][_0x5497('0x2c')]};});_0x4af5f4['model']=_['map'](_0x583d06,'name');_0x4af5f4[_0x5497('0x2d')]=_[_0x5497('0x2e')](_0x163a30[_0x5497('0x2d')]);_0x4af5f4['filters']=_['intersection'](_0x4af5f4['model'],_0x4af5f4[_0x5497('0x2d')]);_0x48b835['attributes']=_[_0x5497('0x2f')](_0x4af5f4[_0x5497('0x30')],qs[_0x5497('0x31')](_0x163a30['query'][_0x5497('0x31')]));_0x48b835[_0x5497('0x32')]=_0x48b835['attributes'][_0x5497('0x33')]?_0x48b835[_0x5497('0x32')]:_0x4af5f4[_0x5497('0x30')];if(!_0x163a30['query'][_0x5497('0x34')](_0x5497('0x35'))){_0x48b835[_0x5497('0x36')]=qs[_0x5497('0x36')](_0x163a30[_0x5497('0x2d')]['limit']);_0x48b835[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x163a30['query'][_0x5497('0x1c')]);}_0x48b835[_0x5497('0x37')]=qs[_0x5497('0x38')](_0x163a30[_0x5497('0x2d')][_0x5497('0x38')]);_0x48b835[_0x5497('0x39')]=qs['filters'](_[_0x5497('0x3a')](_0x163a30['query'],_0x4af5f4[_0x5497('0x3b')]),_0x583d06);if(_0x163a30[_0x5497('0x2d')][_0x5497('0x3c')]){_0x48b835['where']=_['merge'](_0x48b835[_0x5497('0x39')],{'$or':_[_0x5497('0x3d')](_0x583d06,function(_0x326d48){if(_0x326d48[_0x5497('0x2b')]!==_0x5497('0x3e')){var _0xc8a689={};_0xc8a689[_0x326d48['name']]={'$like':'%'+_0x163a30[_0x5497('0x2d')][_0x5497('0x3c')]+'%'};return _0xc8a689;}})});}_0x48b835=_[_0x5497('0x3f')]({},_0x48b835,_0x163a30[_0x5497('0x40')]);var _0x275aa7={'where':_0x48b835[_0x5497('0x39')]};return db[_0x5497('0x29')][_0x5497('0x1b')](_0x275aa7)[_0x5497('0x23')](function(_0x544065){_0x5406e2[_0x5497('0x1b')]=_0x544065;if(_0x163a30[_0x5497('0x2d')][_0x5497('0x41')]){_0x48b835[_0x5497('0x42')]=[{'all':!![]}];}return db[_0x5497('0x29')][_0x5497('0x43')](_0x48b835);})[_0x5497('0x23')](function(_0x59ed13){_0x5406e2[_0x5497('0x44')]=_0x59ed13;return _0x5406e2;})[_0x5497('0x23')](respondWithFilteredResult(_0x31cd01,_0x48b835))[_0x5497('0x45')](handleError(_0x31cd01,null));};exports[_0x5497('0x46')]=function(_0x1b251b,_0x125526){var _0x114471={'raw':!![],'where':{'id':_0x1b251b[_0x5497('0x47')]['id']}},_0x547437={};_0x547437[_0x5497('0x30')]=_[_0x5497('0x2e')](db[_0x5497('0x29')][_0x5497('0x48')]);_0x547437[_0x5497('0x2d')]=_[_0x5497('0x2e')](_0x1b251b[_0x5497('0x2d')]);_0x547437[_0x5497('0x3b')]=_[_0x5497('0x2f')](_0x547437['model'],_0x547437[_0x5497('0x2d')]);_0x114471['attributes']=_[_0x5497('0x2f')](_0x547437[_0x5497('0x30')],qs[_0x5497('0x31')](_0x1b251b[_0x5497('0x2d')][_0x5497('0x31')]));_0x114471['attributes']=_0x114471[_0x5497('0x32')][_0x5497('0x33')]?_0x114471['attributes']:_0x547437[_0x5497('0x30')];if(_0x1b251b['query'][_0x5497('0x41')]){_0x114471['include']=[{'all':!![]}];}_0x114471=_[_0x5497('0x3f')]({},_0x114471,_0x1b251b[_0x5497('0x40')]);return db[_0x5497('0x29')][_0x5497('0x49')](_0x114471)[_0x5497('0x23')](handleEntityNotFound(_0x125526,null))['then'](respondWithResult(_0x125526,null))['catch'](handleError(_0x125526,null));};exports['create']=function(_0x55f654,_0x3cbe4b){return db[_0x5497('0x29')][_0x5497('0x4a')](_0x55f654[_0x5497('0x4b')],{})[_0x5497('0x23')](respondWithResult(_0x3cbe4b,0xc9))[_0x5497('0x45')](handleError(_0x3cbe4b,null));};exports[_0x5497('0x22')]=function(_0x466287,_0x2626bf){if(_0x466287['body']['id']){delete _0x466287[_0x5497('0x4b')]['id'];}return db[_0x5497('0x29')][_0x5497('0x49')]({'where':{'id':_0x466287['params']['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x2626bf,null))['then'](saveUpdates(_0x466287[_0x5497('0x4b')],null))[_0x5497('0x23')](respondWithResult(_0x2626bf,null))[_0x5497('0x45')](handleError(_0x2626bf,null));};exports['destroy']=function(_0x43bebe,_0x356d61){return db['FaxApplication'][_0x5497('0x49')]({'where':{'id':_0x43bebe['params']['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x356d61,null))['then'](removeEntity(_0x356d61,null))[_0x5497('0x45')](handleError(_0x356d61,null));};
\ No newline at end of file
index 1d5221f..dda7a9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd49=['fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','../../config/environment','exports'];(function(_0x1a1f2e,_0x2fb1e6){var _0x5ce8bd=function(_0x1f2971){while(--_0x1f2971){_0x1a1f2e['push'](_0x1a1f2e['shift']());}};_0x5ce8bd(++_0x2fb1e6);}(_0xfd49,0x175));var _0x9fd4=function(_0x233dbf,_0x53f1f9){_0x233dbf=_0x233dbf-0x0;var _0x34106d=_0xfd49[_0x233dbf];return _0x34106d;};'use strict';var _=require('lodash');var util=require(_0x9fd4('0x0'));var logger=require(_0x9fd4('0x1'))('api');var moment=require(_0x9fd4('0x2'));var BPromise=require(_0x9fd4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fd4('0x4'));var rimraf=require('rimraf');var config=require(_0x9fd4('0x5'));var attributes=require('./faxApplication.attributes');module[_0x9fd4('0x6')]=function(_0x38090b,_0x2f1598){return _0x38090b['define']('FaxApplication',attributes,{'tableName':_0x9fd4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9fd4('0x8'),'collate':_0x9fd4('0x9')});};
\ No newline at end of file
+var _0xe743=['fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','FaxApplication'];(function(_0x4c4d07,_0x48512b){var _0x278851=function(_0x507727){while(--_0x507727){_0x4c4d07['push'](_0x4c4d07['shift']());}};_0x278851(++_0x48512b);}(_0xe743,0x137));var _0x3e74=function(_0x114322,_0x4ea7e6){_0x114322=_0x114322-0x0;var _0x3b8fc1=_0xe743[_0x114322];return _0x3b8fc1;};'use strict';var _=require(_0x3e74('0x0'));var util=require(_0x3e74('0x1'));var logger=require(_0x3e74('0x2'))('api');var moment=require(_0x3e74('0x3'));var BPromise=require(_0x3e74('0x4'));var rp=require(_0x3e74('0x5'));var fs=require('fs');var path=require(_0x3e74('0x6'));var rimraf=require(_0x3e74('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x3e74('0x8')]=function(_0x56cda3,_0x2c796c){return _0x56cda3[_0x3e74('0x9')](_0x3e74('0xa'),attributes,{'tableName':_0x3e74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e74('0xc'),'collate':_0x3e74('0xd')});};
\ No newline at end of file
index 47fc2d0..89beb22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4796=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2637f7,_0x429ed7){var _0x46a002=function(_0x52765d){while(--_0x52765d){_0x2637f7['push'](_0x2637f7['shift']());}};_0x46a002(++_0x429ed7);}(_0x4796,0x15a));var _0x6479=function(_0x1641f0,_0x57eb7c){_0x1641f0=_0x1641f0-0x0;var _0x534625=_0x4796[_0x1641f0];return _0x534625;};'use strict';var _=require(_0x6479('0x0'));var util=require(_0x6479('0x1'));var moment=require(_0x6479('0x2'));var BPromise=require(_0x6479('0x3'));var rs=require(_0x6479('0x4'));var fs=require('fs');var Redis=require(_0x6479('0x5'));var db=require(_0x6479('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6479('0x7'));var config=require(_0x6479('0x8'));var jayson=require(_0x6479('0x9'));var client=jayson[_0x6479('0xa')][_0x6479('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e8950,_0x22e694,_0x3dbf89){return new BPromise(function(_0x1bc5bd,_0x5a04c0){return client[_0x6479('0xc')](_0x4e8950,_0x3dbf89)[_0x6479('0xd')](function(_0x301b4c){logger[_0x6479('0xe')](_0x6479('0xf'),_0x22e694,_0x6479('0x10'));logger['debug'](_0x6479('0x11'),_0x22e694,_0x6479('0x10'),JSON[_0x6479('0x12')](_0x301b4c));if(_0x301b4c[_0x6479('0x13')]){if(_0x301b4c[_0x6479('0x13')][_0x6479('0x14')]===0x1f4){logger[_0x6479('0x13')](_0x6479('0xf'),_0x22e694,_0x301b4c[_0x6479('0x13')][_0x6479('0x15')]);return _0x5a04c0(_0x301b4c['error'][_0x6479('0x15')]);}logger['error'](_0x6479('0xf'),_0x22e694,_0x301b4c[_0x6479('0x13')][_0x6479('0x15')]);return _0x1bc5bd(_0x301b4c[_0x6479('0x13')][_0x6479('0x15')]);}else{logger['info'](_0x6479('0xf'),_0x22e694,_0x6479('0x10'));_0x1bc5bd(_0x301b4c[_0x6479('0x16')][_0x6479('0x15')]);}})[_0x6479('0x17')](function(_0x5408fc){logger[_0x6479('0x13')](_0x6479('0xf'),_0x22e694,_0x5408fc);_0x5a04c0(_0x5408fc);});});}exports[_0x6479('0x18')]=function(_0x4d1408){var _0x49e48e=this;return new Promise(function(_0x304788,_0x1dfa56){return db['FaxApplication'][_0x6479('0x19')](_0x4d1408[_0x6479('0x1a')],{'raw':_0x4d1408[_0x6479('0x1b')]?_0x4d1408['options'][_0x6479('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d1408[_0x6479('0x1b')]?_0x4d1408[_0x6479('0x1b')][_0x6479('0x1d')]||null:null,'attributes':_0x4d1408[_0x6479('0x1b')]?_0x4d1408[_0x6479('0x1b')]['attributes']||null:null,'limit':_0x4d1408[_0x6479('0x1b')]?_0x4d1408[_0x6479('0x1b')][_0x6479('0x1e')]||null:null})[_0x6479('0xd')](function(_0x2abef2){logger['info']('UpdateFaxApplication',_0x4d1408);logger[_0x6479('0x1f')]('UpdateFaxApplication',_0x4d1408,JSON[_0x6479('0x12')](_0x2abef2));_0x304788(_0x2abef2);})['catch'](function(_0x518706){logger[_0x6479('0x13')](_0x6479('0x18'),_0x518706[_0x6479('0x15')],_0x4d1408);_0x1dfa56(_0x49e48e[_0x6479('0x13')](0x1f4,_0x518706[_0x6479('0x15')]));});});};
\ No newline at end of file
+var _0x4372=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x4372,0x17a));var _0x2437=function(_0xe13e13,_0x402131){_0xe13e13=_0xe13e13-0x0;var _0x3b3d61=_0x4372[_0xe13e13];return _0x3b3d61;};'use strict';var _=require(_0x2437('0x0'));var util=require('util');var moment=require(_0x2437('0x1'));var BPromise=require(_0x2437('0x2'));var rs=require(_0x2437('0x3'));var fs=require('fs');var Redis=require(_0x2437('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2437('0x5'))(_0x2437('0x6'));var config=require(_0x2437('0x7'));var jayson=require(_0x2437('0x8'));var client=jayson[_0x2437('0x9')][_0x2437('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ba888,_0x34f559,_0x5a4e57){return new BPromise(function(_0x57bfe1,_0x1d44d8){return client[_0x2437('0xb')](_0x4ba888,_0x5a4e57)[_0x2437('0xc')](function(_0x39ac05){logger[_0x2437('0xd')](_0x2437('0xe'),_0x34f559,_0x2437('0xf'));logger[_0x2437('0x10')](_0x2437('0x11'),_0x34f559,_0x2437('0xf'),JSON[_0x2437('0x12')](_0x39ac05));if(_0x39ac05[_0x2437('0x13')]){if(_0x39ac05[_0x2437('0x13')][_0x2437('0x14')]===0x1f4){logger['error'](_0x2437('0xe'),_0x34f559,_0x39ac05[_0x2437('0x13')][_0x2437('0x15')]);return _0x1d44d8(_0x39ac05[_0x2437('0x13')][_0x2437('0x15')]);}logger[_0x2437('0x13')](_0x2437('0xe'),_0x34f559,_0x39ac05[_0x2437('0x13')][_0x2437('0x15')]);return _0x57bfe1(_0x39ac05[_0x2437('0x13')][_0x2437('0x15')]);}else{logger[_0x2437('0xd')]('FaxApplication,\x20%s,\x20%s',_0x34f559,'request\x20sent');_0x57bfe1(_0x39ac05[_0x2437('0x16')][_0x2437('0x15')]);}})[_0x2437('0x17')](function(_0x29c5a6){logger[_0x2437('0x13')](_0x2437('0xe'),_0x34f559,_0x29c5a6);_0x1d44d8(_0x29c5a6);});});}exports[_0x2437('0x18')]=function(_0x49d22b){var _0x366146=this;return new Promise(function(_0x22b8b2,_0x888222){return db[_0x2437('0x19')][_0x2437('0x1a')](_0x49d22b[_0x2437('0x1b')],{'raw':_0x49d22b[_0x2437('0x1c')]?_0x49d22b[_0x2437('0x1c')][_0x2437('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49d22b[_0x2437('0x1c')]?_0x49d22b[_0x2437('0x1c')]['where']||null:null,'attributes':_0x49d22b[_0x2437('0x1c')]?_0x49d22b[_0x2437('0x1c')][_0x2437('0x1e')]||null:null,'limit':_0x49d22b[_0x2437('0x1c')]?_0x49d22b[_0x2437('0x1c')][_0x2437('0x1f')]||null:null})[_0x2437('0xc')](function(_0x5c3b36){logger[_0x2437('0xd')]('UpdateFaxApplication',_0x49d22b);logger[_0x2437('0x10')]('UpdateFaxApplication',_0x49d22b,JSON[_0x2437('0x12')](_0x5c3b36));_0x22b8b2(_0x5c3b36);})[_0x2437('0x17')](function(_0x2938fe){logger[_0x2437('0x13')](_0x2437('0x18'),_0x2938fe[_0x2437('0x15')],_0x49d22b);_0x888222(_0x366146['error'](0x1f4,_0x2938fe[_0x2437('0x15')]));});});};
\ No newline at end of file
index d6f37a9..890dcb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x173dc7,_0x563a6a){var _0x1d7bd8=function(_0x331331){while(--_0x331331){_0x173dc7['push'](_0x173dc7['shift']());}};_0x1d7bd8(++_0x563a6a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./faxApplication.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router;
\ No newline at end of file
+var _0x9c5a=['isAuthenticated','get','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxApplication.controller'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1e1cb3,_0x67a267){_0x1e1cb3=_0x1e1cb3-0x0;var _0x53537a=_0x9c5a[_0x1e1cb3];return _0x53537a;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa9c5('0xb')]('/',auth[_0xa9c5('0x8')](),controller['create']);router[_0xa9c5('0xc')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller[_0xa9c5('0xd')]);router[_0xa9c5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa9c5('0xf')]);module[_0xa9c5('0x10')]=router;
\ No newline at end of file
index f5b8db9..1e839e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe63f=['exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x111c50,_0x38344a){var _0x3166fb=function(_0x389258){while(--_0x389258){_0x111c50['push'](_0x111c50['shift']());}};_0x3166fb(++_0x38344a);}(_0xe63f,0x83));var _0xfe63=function(_0x38adc8,_0x103cce){_0x38adc8=_0x38adc8-0x0;var _0xdd71d4=_0xe63f[_0x38adc8];return _0xdd71d4;};'use strict';var Sequelize=require(_0xfe63('0x0'));module[_0xfe63('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfe63('0x2')]},'disposition':{'type':Sequelize[_0xfe63('0x3')]},'note':{'type':Sequelize[_0xfe63('0x3')]},'read1stAt':{'type':Sequelize[_0xfe63('0x2')]},'fax':{'type':Sequelize[_0xfe63('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xfe63('0x4')]('in',_0xfe63('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfe63('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfe63('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xb011=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x347334,_0x170cb5){var _0x5e4769=function(_0xd92fd5){while(--_0xd92fd5){_0x347334['push'](_0x347334['shift']());}};_0x5e4769(++_0x170cb5);}(_0xb011,0xb4));var _0x1b01=function(_0x5a9f38,_0x24856e){_0x5a9f38=_0x5a9f38-0x0;var _0x2bbde4=_0xb011[_0x5a9f38];return _0x2bbde4;};'use strict';var Sequelize=require(_0x1b01('0x0'));module[_0x1b01('0x1')]={'closed':{'type':Sequelize[_0x1b01('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1b01('0x3')]},'disposition':{'type':Sequelize[_0x1b01('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x1b01('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1b01('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1b01('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1b01('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 6f3d18b..5131efa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83e1=['merge','options','include','findAll','setTags','spread','Tag','emit','faxInteractionTags:save','unix','join','root','server','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','createReadStream','pipe','download','err','html-pdf','eml-format','zip-dir','request-promise','mustache','util','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','update','then','destroy','error','name','send','map','fullname','TagIds','split','forEach','Tags','push','index','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','select','field','from','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_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','fax_accounts','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','text','body','compact','isEmpty','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\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)','order','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','FaxInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','params','keys','includeAll','catch','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x344a43,_0x34bead){var _0x41bfb7=function(_0x2ad561){while(--_0x2ad561){_0x344a43['push'](_0x344a43['shift']());}};_0x41bfb7(++_0x34bead);}(_0x83e1,0x1ad));var _0x183e=function(_0x24c22a,_0x3c534b){_0x24c22a=_0x24c22a-0x0;var _0x3b56b2=_0x83e1[_0x24c22a];return _0x3b56b2;};'use strict';var pdf=require(_0x183e('0x0'));var emlformat=require(_0x183e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x183e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x183e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x183e('0x4'));var util=require(_0x183e('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x183e('0x6'));var fs=require('fs');var _=require(_0x183e('0x7'));var squel=require(_0x183e('0x8'));var crypto=require('crypto');var jsforce=require(_0x183e('0x9'));var deskjs=require(_0x183e('0xa'));var toCsv=require(_0x183e('0xb'));var querystring=require('querystring');var Papa=require(_0x183e('0xc'));var Redis=require(_0x183e('0xd'));var authService=require(_0x183e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x183e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x183e('0x10'))(_0x183e('0x11'));var utils=require(_0x183e('0x12'));var config=require(_0x183e('0x13'));var db=require(_0x183e('0x14'))['db'];config[_0x183e('0x15')]=_[_0x183e('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x183e('0x15')]));require(_0x183e('0x17'))[_0x183e('0x18')](socket);function respondWithStatusCode(_0x5d4941,_0x140a70){_0x140a70=_0x140a70||0xcc;return function(_0x17d890){if(_0x17d890){return _0x5d4941[_0x183e('0x19')](_0x140a70);}return _0x5d4941['status'](_0x140a70)[_0x183e('0x1a')]();};}function respondWithResult(_0x35badd,_0x3faadf){_0x3faadf=_0x3faadf||0xc8;return function(_0xdbea2c){if(_0xdbea2c){return _0x35badd[_0x183e('0x1b')](_0x3faadf)[_0x183e('0x1c')](_0xdbea2c);}};}function respondWithFilteredResult(_0x42fdf0,_0x271d11){return function(_0x56df78){if(_0x56df78){var _0x27d487=_0x56df78[_0x183e('0x1d')],_0x3adea4=_0x271d11[_0x183e('0x1e')],_0x322f56=_0x271d11['offset']+_0x271d11[_0x183e('0x1f')],_0x480ce8;if(_0x322f56>=_0x27d487){_0x322f56=_0x27d487;_0x480ce8=0xc8;}else{_0x480ce8=0xce;}_0x42fdf0[_0x183e('0x1b')](_0x480ce8);return _0x42fdf0[_0x183e('0x20')](_0x183e('0x21'),_0x3adea4+'-'+_0x322f56+'/'+_0x27d487)['json'](_0x56df78);}return null;};}function patchUpdates(_0x4d8102){return function(_0x4a49cc){try{jsonpatch['apply'](_0x4a49cc,_0x4d8102,!![]);}catch(_0x26d29f){return BPromise['reject'](_0x26d29f);}return _0x4a49cc['save']();};}function saveUpdates(_0xc96e61,_0x34a128){return function(_0x455dab){if(_0x455dab){return _0x455dab[_0x183e('0x22')](_0xc96e61)[_0x183e('0x23')](function(_0x4ea291){return _0x4ea291;});}return null;};}function removeEntity(_0x223351,_0x5d6b29){return function(_0x41f74f){if(_0x41f74f){return _0x41f74f[_0x183e('0x24')]()[_0x183e('0x23')](function(){_0x223351[_0x183e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eda06,_0x7b9a98){return function(_0x11aace){if(!_0x11aace){_0x5eda06['sendStatus'](0x194);}return _0x11aace;};}function handleError(_0x5457ed,_0x14522f){_0x14522f=_0x14522f||0x1f4;return function(_0x267fff){logger[_0x183e('0x25')](_0x267fff['stack']);if(_0x267fff[_0x183e('0x26')]){delete _0x267fff[_0x183e('0x26')];}_0x5457ed[_0x183e('0x1b')](_0x14522f)[_0x183e('0x27')](_0x267fff);};}function getInteractionUsers(_0x26de99,_0x1f8603){return new BPromise(function(_0x2f9657,_0x1bc636){try{if(_0x1f8603[_0x26de99['id']]){_0x26de99['Users']=_[_0x183e('0x28')](_0x1f8603[_0x26de99['id']],function(_0x57fef0){return{'id':_0x57fef0['id'],'fullname':_0x57fef0[_0x183e('0x29')]};});}}catch(_0x41948a){_0x1bc636(_0x41948a);}_0x2f9657(_0x26de99);});}function getInteractionTags(_0x5d76eb,_0x21db26){return new BPromise(function(_0x4c6aa4,_0x4ee2ac){try{if(_0x5d76eb[_0x183e('0x2a')]){_0x5d76eb['Tags']=[];_0x5d76eb['TagIds'][_0x183e('0x2b')](',')[_0x183e('0x2c')](function(_0x2fb176){_0x5d76eb[_0x183e('0x2d')][_0x183e('0x2e')](_0x21db26[_0x2fb176]);});}delete _0x5d76eb[_0x183e('0x2a')];}catch(_0x2d22b0){_0x4ee2ac(_0x2d22b0);}_0x4c6aa4(_0x5d76eb);});}function updateFaxInteraction(_0x506cd3,_0xd5ad4c,_0x5e5325){return new BPromise(function(_0xe282a,_0x10843c){return getInteractionUsers(_0x506cd3,_0x5e5325)['then'](function(_0x193cf5){return getInteractionTags(_0x193cf5,_0xd5ad4c);})[_0x183e('0x23')](function(_0x4a521d){_0xe282a(_0x4a521d);})['catch'](function(_0x40f94e){_0x10843c(_0x40f94e);});});}exports[_0x183e('0x2f')]=function(_0x2d291a,_0x68bb5d){var _0x34141a={},_0x3f2ddb={},_0x4fbaff={'count':0x0,'rows':[]};var _0xeefc77=_['map'](db['FaxInteraction'][_0x183e('0x30')],function(_0x1bab79){return{'name':_0x1bab79[_0x183e('0x31')],'type':_0x1bab79['type']['key']};});_0x3f2ddb[_0x183e('0x32')]=_['map'](_0xeefc77,_0x183e('0x26'));_0x3f2ddb[_0x183e('0x33')]=_['keys'](_0x2d291a[_0x183e('0x33')]);_0x3f2ddb[_0x183e('0x34')]=_[_0x183e('0x35')](_0x3f2ddb[_0x183e('0x32')],_0x3f2ddb[_0x183e('0x33')]);_0x34141a[_0x183e('0x36')]=_[_0x183e('0x35')](_0x3f2ddb[_0x183e('0x32')],qs['fields'](_0x2d291a[_0x183e('0x33')][_0x183e('0x37')]));_0x34141a['attributes']=_0x34141a['attributes'][_0x183e('0x38')]?_0x34141a[_0x183e('0x36')]:_0x3f2ddb[_0x183e('0x32')];if(!_0x2d291a['query'][_0x183e('0x39')](_0x183e('0x3a'))){_0x34141a['limit']=qs[_0x183e('0x1f')](_0x2d291a[_0x183e('0x33')][_0x183e('0x1f')]);_0x34141a[_0x183e('0x1e')]=qs[_0x183e('0x1e')](_0x2d291a['query'][_0x183e('0x1e')]);}_0x34141a['order']=qs['sort'](_0x2d291a[_0x183e('0x33')][_0x183e('0x3b')]);_0x34141a[_0x183e('0x3c')]=qs['filters'](_['pick'](_0x2d291a['query'],_0x3f2ddb[_0x183e('0x34')]),_0xeefc77);var _0x347ba4=[];var _0x503c61=squel[_0x183e('0x3d')]()[_0x183e('0x3e')]('id')[_0x183e('0x3e')](_0x183e('0x26'))[_0x183e('0x3e')]('color')[_0x183e('0x3f')]('tools_tags');var _0x1ca1cc=squel[_0x183e('0x3d')]()[_0x183e('0x3e')](_0x183e('0x40'))[_0x183e('0x3e')](_0x183e('0x41'))[_0x183e('0x3e')](_0x183e('0x42'))[_0x183e('0x3f')](_0x183e('0x43'),'ui')[_0x183e('0x44')](_0x183e('0x45'),'u',_0x183e('0x46'));var _0x6e99d2=squel[_0x183e('0x3d')]()['from']('fax_interactions','i')[_0x183e('0x44')](_0x183e('0x47'),'c',_0x183e('0x48'))[_0x183e('0x44')](_0x183e('0x45'),'o',_0x183e('0x49'))[_0x183e('0x44')](_0x183e('0x4a'),'a','a.id\x20=\x20i.FaxAccountId')[_0x183e('0x44')]('fax_messages','me',_0x183e('0x4b'))['left_join']('fax_interaction_has_tags','it',_0x183e('0x4c'))[_0x183e('0x44')](_0x183e('0x4d'),'t',_0x183e('0x4e'));var _0x12e072=squel[_0x183e('0x4f')]();var _0x282eae=[];var _0x22cbd3=squel[_0x183e('0x4f')]();var _0x2fb6ac;if(_0x2d291a[_0x183e('0x33')][_0x183e('0x50')]){_0x2fb6ac=as[_0x183e('0x51')](_0x2d291a[_0x183e('0x33')][_0x183e('0x50')]);var _0x1cdb1d=_0x2fb6ac[_0x183e('0x52')];for(var _0x4fb219=0x0;_0x4fb219<_0x2fb6ac['conditions']['length'];_0x4fb219++){var _0x2bbc46=_0x2fb6ac['conditions'][_0x4fb219];var _0x40c208='i';var _0x5715ce=_[_0x183e('0x53')](_0xeefc77,['name',_0x2bbc46[_0x183e('0x3e')]]);if(!_0x5715ce){switch(_0x2bbc46[_0x183e('0x3e')]){case _0x183e('0x54'):if(_0x2bbc46[_0x183e('0x55')]==0x1){_0x6e99d2[_0x183e('0x56')]('`'+_0x2bbc46['field']+_0x183e('0x57'));}else{_0x6e99d2[_0x183e('0x56')]('`'+_0x2bbc46[_0x183e('0x3e')]+_0x183e('0x58'));}break;case _0x183e('0x59'):if(_0x2bbc46[_0x183e('0x5a')]===_0x183e('0x5b')){if(_0x2bbc46[_0x183e('0x55')]['split']('\x20')[_0x183e('0x38')]>0x1){_0x12e072[_0x1cdb1d](_0x183e('0x5c'),qs[_0x183e('0x5d')](_0x2bbc46[_0x183e('0x55')]),null);}else{var _0xdfeb44='%'+_0x2bbc46[_0x183e('0x55')]+'%';_0x12e072[_0x1cdb1d](_0x183e('0x5e'),_0xdfeb44,_0xdfeb44,_0xdfeb44);}}else{_0x5715ce=_[_0x183e('0x53')](_0xeefc77,[_0x183e('0x26'),'ContactId']);_0x2bbc46[_0x183e('0x3e')]=_0x183e('0x5f');_0x555774=as[_0x183e('0x60')](_0x40c208,_0x5715ce['type'],_0x2bbc46);_0x12e072[_0x1cdb1d](_0x555774['text'],_0x555774['value'][_0x183e('0x61')],_0x555774[_0x183e('0x55')][_0x183e('0x1a')]);}break;case'Tag':var _0x5d8edd=_0x2bbc46[_0x183e('0x55')][_0x183e('0x2b')](',')[_0x183e('0x28')](function(_0x37cffa){return Number(_0x37cffa);});_0x5d8edd['forEach'](function(_0xadc029){_0x22cbd3['or'](_0x183e('0x62'),'%,'+_0xadc029+',%');});_0x282eae=_[_0x183e('0x63')](_0x282eae,_0x5d8edd);break;case _0x183e('0x64'):if(_0x2bbc46['operator']===_0x183e('0x5b')){_0x12e072[_0x1cdb1d](_0x183e('0x65'),'%'+_0x2bbc46[_0x183e('0x55')]+'%',null);}else{_0x5715ce=_[_0x183e('0x53')](_0xeefc77,[_0x183e('0x26'),_0x183e('0x66')]);_0x2bbc46[_0x183e('0x3e')]=_0x183e('0x66');_0x555774=as[_0x183e('0x60')](_0x40c208,_0x5715ce[_0x183e('0x67')],_0x2bbc46);_0x12e072[_0x1cdb1d](_0x555774[_0x183e('0x68')],_0x555774[_0x183e('0x55')][_0x183e('0x61')],_0x555774[_0x183e('0x55')][_0x183e('0x1a')]);}break;case _0x183e('0x69'):_0x555774=as['buildExpression']('me',null,_0x2bbc46);_0x12e072[_0x1cdb1d](_0x555774[_0x183e('0x68')],_0x555774[_0x183e('0x55')]['start'],_0x555774['value'][_0x183e('0x1a')]);break;}}else{var _0x555774=as[_0x183e('0x60')](_0x40c208,_0x5715ce[_0x183e('0x67')],_0x2bbc46);_0x12e072[_0x1cdb1d](_0x555774[_0x183e('0x68')],_0x555774[_0x183e('0x55')][_0x183e('0x61')],_0x555774[_0x183e('0x55')][_0x183e('0x1a')]);}}}else{var _0x7a4a43=_(_0x2d291a[_0x183e('0x33')])['keys']()[_0x183e('0x28')](function(_0x503b0a){return _['some'](_0xeefc77,[_0x183e('0x26'),_0x503b0a])?_0x503b0a:undefined;})[_0x183e('0x6a')]()[_0x183e('0x55')]();if(!_[_0x183e('0x6b')](_0x7a4a43)){_0x7a4a43[_0x183e('0x2c')](function(_0x3d112e){if(_0x3d112e==='FaxAccountId'){_0x6e99d2[_0x183e('0x3c')]('i.FaxAccountId\x20IN\x20?',[][_0x183e('0x6c')](_0x2d291a[_0x183e('0x33')][_0x3d112e]));}else if(_0x3d112e===_0x183e('0x6d')){var _0xcc7e28=JSON[_0x183e('0x6e')](_0x2d291a['query'][_0x3d112e])[_0x183e('0x6f')];var _0x12502b=JSON['parse'](_0x2d291a[_0x183e('0x33')][_0x3d112e])[_0x183e('0x70')];_0x6e99d2[_0x183e('0x3c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xcc7e28,_0x12502b);}else{if(_0x2d291a[_0x183e('0x33')][_0x3d112e]===_0x183e('0x71')){_0x6e99d2[_0x183e('0x3c')]('i.'+_0x3d112e+_0x183e('0x72'));}else{_0x6e99d2[_0x183e('0x3c')]('i.'+_0x3d112e+_0x183e('0x73'),_0x2d291a[_0x183e('0x33')][_0x3d112e]);}}});}if(_0x2d291a[_0x183e('0x33')][_0x183e('0x74')]){if(_0x2d291a[_0x183e('0x33')][_0x183e('0x74')]==0x1){_0x6e99d2[_0x183e('0x56')]('`unreadMessages`\x20=\x200');}else{_0x6e99d2[_0x183e('0x56')]('`unreadMessages`\x20>\x200');}}if(_0x2d291a[_0x183e('0x33')][_0x183e('0x75')]){_0x282eae=_[_0x183e('0x76')](_0x2d291a[_0x183e('0x33')]['tag'])?_0x2d291a[_0x183e('0x33')][_0x183e('0x75')]:new Array(_0x2d291a[_0x183e('0x33')][_0x183e('0x75')]);_0x282eae[_0x183e('0x2c')](function(_0x3245d5){_0x22cbd3['or'](_0x183e('0x62'),'%,'+_0x3245d5+',%');});}if(_0x2d291a[_0x183e('0x33')][_0x183e('0x77')]){var _0x10a36d=_0x2d291a[_0x183e('0x33')][_0x183e('0x77')][_0x183e('0x78')]('\x5c','\x5c\x5c')[_0x183e('0x78')]('\x27\x27',_0x183e('0x79'));if(qs['isNumeric'](_0x10a36d)){_0x12e072['or'](_0x183e('0x7a'),_0x10a36d+'%')['or']('i.fax\x20LIKE\x20?',_0x10a36d+'%');}_0x12e072['or'](_0x183e('0x7b'),_0x10a36d+'%');}}_0x6e99d2[_0x183e('0x3c')](_0x12e072);_0x6e99d2[_0x183e('0x7c')](_0x183e('0x7d'));var _0x54c8c0={'type':db[_0x183e('0x7e')][_0x183e('0x7f')][_0x183e('0x80')],'raw':!![]};var _0xa68d91=_0x6e99d2[_0x183e('0x81')]();_0xa68d91[_0x183e('0x3e')](_0x183e('0x7d'));_0xa68d91['field'](_0x183e('0x82'),_0x183e('0x54'));if(_0x34141a[_0x183e('0x83')]){_0x34141a[_0x183e('0x83')][_0x183e('0x2c')](function(_0x2f158e){_0x6e99d2[_0x183e('0x83')]('i.'+_0x2f158e[0x0],_0x2f158e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x183e('0x6b')](_0x282eae)){_0x6e99d2[_0x183e('0x56')](_0x22cbd3);_0xa68d91['where']('t.id\x20IN\x20?',_0x282eae);}BPromise[_0x183e('0x84')]()[_0x183e('0x23')](function(){if(!_0x2fb6ac){if(_0x2d291a[_0x183e('0x33')][_0x183e('0x85')]||_0x2d291a[_0x183e('0x33')]['journey'])return;_0xa68d91['where'](_0x183e('0x86'));_0x6e99d2[_0x183e('0x3c')](_0x183e('0x86'));return;}return _0x2d291a[_0x183e('0x87')][_0x183e('0x88')]({'attributes':['id'],'raw':!![]})[_0x183e('0x23')](function(_0x2d7d1e){if(_['isEmpty'](_0x2d7d1e)){_0xa68d91[_0x183e('0x3c')](_0x183e('0x89'));_0x6e99d2['where'](_0x183e('0x89'));}else{_0xa68d91[_0x183e('0x3c')](_0x183e('0x8a'),_[_0x183e('0x28')](_0x2d7d1e,'id'));_0x6e99d2[_0x183e('0x3c')]('i.FaxAccountId\x20IN\x20?',_[_0x183e('0x28')](_0x2d7d1e,'id'));}});})[_0x183e('0x23')](function(){db['sequelize'][_0x183e('0x33')](_0xa68d91['toString'](),_0x54c8c0)[_0x183e('0x23')](function(_0x177ccc){_0x4fbaff[_0x183e('0x1d')]=_0x177ccc[_0x183e('0x38')];if(_0x4fbaff[_0x183e('0x1d')]===0x0)return[];return db[_0x183e('0x8b')][_0x183e('0x33')](_0x503c61[_0x183e('0x8c')](),_0x54c8c0)[_0x183e('0x23')](function(_0x328993){_0x347ba4=_[_0x183e('0x8d')](_0x328993,'id');_0x54c8c0=_['merge'](_0x54c8c0,{'model':db[_0x183e('0x8e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2d291a[_0x183e('0x33')]['fields']){_0x34141a['attributes'][_0x183e('0x2c')](function(_0x5adbf8){_0x6e99d2[_0x183e('0x3e')]('i.'+_0x5adbf8);});}else{_0x6e99d2[_0x183e('0x3e')](_0x183e('0x82'),_0x183e('0x54'));_0x6e99d2[_0x183e('0x3e')](_0x183e('0x8f'),'Account.key');_0x6e99d2[_0x183e('0x3e')](_0x183e('0x90'),_0x183e('0x91'));_0x6e99d2[_0x183e('0x3e')](_0x183e('0x92'));_0x6e99d2['field'](_0x183e('0x93'),_0x183e('0x94'));_0x6e99d2[_0x183e('0x3e')]('c.lastName',_0x183e('0x95'));_0x6e99d2[_0x183e('0x3e')]('c.email',_0x183e('0x96'));_0x6e99d2[_0x183e('0x3e')](_0x183e('0x97'),_0x183e('0x98'));_0x6e99d2[_0x183e('0x3e')](_0x183e('0x99'),_0x183e('0x9a'));_0x6e99d2[_0x183e('0x3e')](_0x183e('0x9b'),_0x183e('0x9c'));_0x6e99d2[_0x183e('0x3e')](_0x183e('0x9d'),'Owner.fullname');_0x6e99d2[_0x183e('0x3e')](_0x183e('0x9e'),_0x183e('0x9f'));_0x6e99d2[_0x183e('0x3e')](_0x183e('0xa0'),_0x183e('0x2a'));}if(_0x34141a[_0x183e('0x1f')])_0x6e99d2[_0x183e('0x1f')](_0x34141a[_0x183e('0x1f')]);if(_0x34141a[_0x183e('0x1e')])_0x6e99d2[_0x183e('0x1e')](_0x34141a[_0x183e('0x1e')]);return db[_0x183e('0x8b')][_0x183e('0x33')](_0x6e99d2[_0x183e('0x8c')](),_0x54c8c0);})[_0x183e('0x23')](function(_0x4fd468){_0x1ca1cc[_0x183e('0x3c')](_0x183e('0xa1'),_['map'](_0x4fd468,'id'));return db[_0x183e('0x8b')][_0x183e('0x33')](_0x1ca1cc['toString'](),_0x54c8c0)[_0x183e('0x23')](function(_0x102329){var _0x18209c=_[_0x183e('0xa2')](_0x102329,_0x183e('0xa3'));var _0x26fac5=[];_0x4fd468['forEach'](function(_0x10247d){_0x26fac5[_0x183e('0x2e')](updateFaxInteraction(_0x10247d,_0x347ba4,_0x18209c));});return BPromise['all'](_0x26fac5);});});})['then'](function(_0x298a21){_0x4fbaff[_0x183e('0xa4')]=_0x298a21;return _0x4fbaff;})[_0x183e('0x23')](respondWithFilteredResult(_0x68bb5d,_0x34141a));})['catch'](handleError(_0x68bb5d,null));};exports['show']=function(_0x26f855,_0x50761b){var _0x5eea0e={'raw':![],'where':{'id':_0x26f855[_0x183e('0xa5')]['id']}},_0x27fb28={};_0x27fb28[_0x183e('0x32')]=_[_0x183e('0xa6')](db[_0x183e('0x8e')][_0x183e('0x30')]);_0x27fb28[_0x183e('0x33')]=_['keys'](_0x26f855['query']);_0x27fb28['filters']=_[_0x183e('0x35')](_0x27fb28[_0x183e('0x32')],_0x27fb28['query']);_0x5eea0e[_0x183e('0x36')]=_[_0x183e('0x35')](_0x27fb28['model'],qs[_0x183e('0x37')](_0x26f855[_0x183e('0x33')][_0x183e('0x37')]));_0x5eea0e[_0x183e('0x36')]=_0x5eea0e[_0x183e('0x36')][_0x183e('0x38')]?_0x5eea0e[_0x183e('0x36')]:_0x27fb28[_0x183e('0x32')];if(_0x26f855[_0x183e('0x33')][_0x183e('0xa7')]){_0x5eea0e['include']=[{'all':!![]}];}_0x5eea0e=_['merge']({},_0x5eea0e,_0x26f855['options']);return db[_0x183e('0x8e')][_0x183e('0x53')](_0x5eea0e)[_0x183e('0x23')](handleEntityNotFound(_0x50761b,null))['then'](respondWithResult(_0x50761b,null))[_0x183e('0xa8')](handleError(_0x50761b,null));};exports[_0x183e('0xa9')]=function(_0xdc022c,_0x41d090){return db[_0x183e('0x8e')][_0x183e('0xa9')](_0xdc022c[_0x183e('0x69')],{})['then'](respondWithResult(_0x41d090,0xc9))[_0x183e('0xa8')](handleError(_0x41d090,null));};exports['update']=function(_0x485aa6,_0x44ec22){if(_0x485aa6[_0x183e('0x69')]['id']){delete _0x485aa6[_0x183e('0x69')]['id'];}return db[_0x183e('0x8e')]['find']({'where':{'id':_0x485aa6[_0x183e('0xa5')]['id']}})[_0x183e('0x23')](handleEntityNotFound(_0x44ec22,null))['then'](saveUpdates(_0x485aa6[_0x183e('0x69')],null))[_0x183e('0x23')](respondWithResult(_0x44ec22,null))[_0x183e('0xa8')](handleError(_0x44ec22,null));};exports[_0x183e('0x24')]=function(_0x33faad,_0x663440){return db[_0x183e('0x8e')][_0x183e('0x53')]({'where':{'id':_0x33faad[_0x183e('0xa5')]['id']}})['then'](handleEntityNotFound(_0x663440,null))[_0x183e('0x23')](removeEntity(_0x663440,null))[_0x183e('0xa8')](handleError(_0x663440,null));};exports[_0x183e('0xaa')]=function(_0x43f9bd,_0x8d5d83){return db[_0x183e('0x8e')][_0x183e('0xaa')]()['then'](respondWithResult(_0x8d5d83,null))[_0x183e('0xa8')](handleError(_0x8d5d83,null));};exports[_0x183e('0xab')]=function(_0x530c3,_0x4eacdf,_0x5c4596){return db[_0x183e('0xac')][_0x183e('0x53')]({'where':{'id':_0x530c3[_0x183e('0xa5')]['id']}})[_0x183e('0x23')](handleEntityNotFound(_0x4eacdf,null))[_0x183e('0x23')](function(_0x4fdf48){if(_0x4fdf48){return _0x4fdf48['addMessage'](_0x530c3[_0x183e('0x69')][_0x183e('0xad')],_[_0x183e('0xae')](_0x530c3[_0x183e('0x69')],[_0x183e('0xad'),'id'])||{});}})[_0x183e('0x23')](respondWithResult(_0x4eacdf,null))[_0x183e('0xa8')](handleError(_0x4eacdf,null));};exports[_0x183e('0xaf')]=function(_0x2e433e,_0x5a08de,_0x5da02a){var _0x35f727={'raw':![],'where':{}};var _0x4456c3={};var _0xc474d6={'count':0x0,'rows':[]};return db[_0x183e('0x8e')][_0x183e('0xb0')]({'where':{'id':_0x2e433e[_0x183e('0xa5')]['id']}})[_0x183e('0x23')](handleEntityNotFound(_0x5a08de,null))[_0x183e('0x23')](function(_0x558671){if(_0x558671){_0x4456c3[_0x183e('0x32')]=_['keys'](db[_0x183e('0xac')][_0x183e('0x30')]);_0x4456c3['query']=_[_0x183e('0xa6')](_0x2e433e['query']);_0x4456c3[_0x183e('0x34')]=_[_0x183e('0x35')](_0x4456c3[_0x183e('0x32')],_0x4456c3[_0x183e('0x33')]);_0x35f727['attributes']=_[_0x183e('0x35')](_0x4456c3[_0x183e('0x32')],qs[_0x183e('0x37')](_0x2e433e['query'][_0x183e('0x37')]));_0x35f727[_0x183e('0x36')]=_0x35f727[_0x183e('0x36')][_0x183e('0x38')]?_0x35f727[_0x183e('0x36')]:_0x4456c3['model'];if(!_0x2e433e[_0x183e('0x33')]['hasOwnProperty'](_0x183e('0x3a'))){_0x35f727[_0x183e('0x1f')]=qs[_0x183e('0x1f')](_0x2e433e[_0x183e('0x33')][_0x183e('0x1f')]);_0x35f727[_0x183e('0x1e')]=qs[_0x183e('0x1e')](_0x2e433e[_0x183e('0x33')][_0x183e('0x1e')]);}_0x35f727[_0x183e('0x83')]=qs[_0x183e('0x3b')](_0x2e433e['query'][_0x183e('0x3b')]);_0x35f727[_0x183e('0x3c')]=qs[_0x183e('0x34')](_[_0x183e('0xb1')](_0x2e433e['query'],_0x4456c3[_0x183e('0x34')]));_0x35f727[_0x183e('0x3c')]['FaxInteractionId']=_0x558671['id'];if(_0x2e433e[_0x183e('0x33')][_0x183e('0x77')]){_0x35f727[_0x183e('0x3c')]=_['merge'](_0x35f727[_0x183e('0x3c')],{'$or':_[_0x183e('0x28')](_0x35f727[_0x183e('0x36')],function(_0x1d4526){var _0x5ea391={};_0x5ea391[_0x1d4526]={'$like':'%'+_0x2e433e[_0x183e('0x33')]['filter']+'%'};return _0x5ea391;})});}if(_0x2e433e['query'][_0x183e('0x6f')]){var _0x2e01cd=_0x2e433e[_0x183e('0x33')]['$gte']['split'](',');var _0x3f6033={};_0x3f6033[_0x2e01cd[0x0]]={'$gte':moment(_0x2e01cd[0x1])[_0x183e('0xb2')](_0x183e('0xb3'))};_0x35f727[_0x183e('0x3c')]=_[_0x183e('0xb4')](_0x35f727[_0x183e('0x3c')],_0x3f6033);}_0x35f727=_[_0x183e('0xb4')]({},_0x35f727,_0x2e433e[_0x183e('0xb5')]);return db[_0x183e('0xac')][_0x183e('0x1d')]({'where':_0x35f727['where']})[_0x183e('0x23')](function(_0x512b95){_0xc474d6[_0x183e('0x1d')]=_0x512b95;if(_0x2e433e[_0x183e('0x33')][_0x183e('0xa7')]){_0x35f727[_0x183e('0xb6')]=[{'all':!![]}];}return db[_0x183e('0xac')][_0x183e('0xb7')](_0x35f727);})[_0x183e('0x23')](function(_0x168e0b){_0xc474d6[_0x183e('0xa4')]=_0x168e0b;return _0xc474d6;});}})['then'](respondWithFilteredResult(_0x5a08de,_0x35f727))[_0x183e('0xa8')](handleError(_0x5a08de,null));};exports['addTags']=function(_0x5f0fc1,_0x1fcc8f,_0x6a7b1b){return db['FaxInteraction'][_0x183e('0x53')]({'where':{'id':_0x5f0fc1[_0x183e('0xa5')]['id']}})[_0x183e('0x23')](handleEntityNotFound(_0x1fcc8f,null))[_0x183e('0x23')](function(_0x4b8780){if(_0x4b8780){return _0x4b8780[_0x183e('0xb8')](_0x5f0fc1[_0x183e('0x69')][_0x183e('0xad')],_[_0x183e('0xae')](_0x5f0fc1[_0x183e('0x69')],['ids','id'])||{})[_0x183e('0xb9')](function(){return db[_0x183e('0xba')][_0x183e('0xb7')]({'attributes':['id',_0x183e('0x26'),'color'],'where':{'id':_0x5f0fc1[_0x183e('0x69')][_0x183e('0xad')]}});})[_0x183e('0x23')](function(_0x286693){socket[_0x183e('0xbb')](_0x183e('0xbc'),{'id':Number(_0x5f0fc1[_0x183e('0xa5')]['id']),'tags':_0x286693||[]});return{'id':Number(_0x5f0fc1[_0x183e('0xa5')]['id']),'tags':_0x286693||[]};});}})[_0x183e('0x23')](respondWithResult(_0x1fcc8f,null))['catch'](handleError(_0x1fcc8f,null));};exports['removeTags']=function(_0x4fbcc3,_0x5a8bf3,_0x30867f){return db['FaxInteraction'][_0x183e('0x53')]({'where':{'id':_0x4fbcc3[_0x183e('0xa5')]['id']}})[_0x183e('0x23')](handleEntityNotFound(_0x5a8bf3,null))[_0x183e('0x23')](function(_0x2b1767){if(_0x2b1767){return _0x2b1767['removeTags'](_0x4fbcc3[_0x183e('0x33')][_0x183e('0xad')]);}})[_0x183e('0x23')](respondWithStatusCode(_0x5a8bf3,null))[_0x183e('0xa8')](handleError(_0x5a8bf3,null));};exports['download']=function(_0x3d0f56,_0x416afc){var _0x2f4c9d=moment()[_0x183e('0xbd')]()[_0x183e('0x8c')]();var _0x583c6d=path[_0x183e('0xbe')](config['root'],'server','files','tmp');var _0x33814e=path[_0x183e('0xbe')](config[_0x183e('0xbf')],_0x183e('0xc0'),'files',_0x183e('0xc1'));var _0x1076a1=path[_0x183e('0xbe')](_0x583c6d,_0x2f4c9d);var _0x4c2815=util[_0x183e('0xb2')](_0x183e('0xc2'),_0x3d0f56[_0x183e('0xa5')]['id'],_0x2f4c9d);var _0x4d37af=path[_0x183e('0xbe')](_0x583c6d,_0x4c2815);var _0x1a09ad=[];_0x1a09ad['push']({'model':db[_0x183e('0xc3')],'as':_0x183e('0xc3'),'raw':!![]});var _0x4e381a=[{'model':db[_0x183e('0xac')],'as':_0x183e('0xc4'),'attributes':['id',_0x183e('0x69'),_0x183e('0x6d')],'include':_0x1a09ad}];return db['FaxInteraction'][_0x183e('0x53')]({'where':{'id':_0x3d0f56[_0x183e('0xa5')]['id']},'include':_0x4e381a})[_0x183e('0x23')](handleEntityNotFound(_0x416afc,null))[_0x183e('0x23')](function(_0x56a0bd){if(_0x56a0bd&&_0x56a0bd[_0x183e('0xc4')]){var _0x305380=_0x56a0bd['get']({'plain':!![]});fs[_0x183e('0xc5')](_0x1076a1);for(var _0x2ae87f=0x0;_0x2ae87f<_0x305380[_0x183e('0xc4')][_0x183e('0x38')];_0x2ae87f++){var _0x5dc4d5=_0x305380['Messages'][_0x2ae87f][_0x183e('0xc3')];if(_0x5dc4d5){var _0xb9f5be=path['join'](_0x33814e,_0x5dc4d5[_0x183e('0xc6')]);if(fs['existsSync'](_0xb9f5be)){fs[_0x183e('0xc7')](_0xb9f5be)[_0x183e('0xc8')](fs['createWriteStream'](path[_0x183e('0xbe')](_0x1076a1,_0x5dc4d5[_0x183e('0xc6')])));}}}return BPromise[_0x183e('0x84')]()[_0x183e('0x23')](function(){return new BPromise(function(_0x1bac67,_0x3c66cc){zipdir(_0x1076a1,{'saveTo':_0x4d37af},function(_0x1c4e9c,_0x3cdb72){if(_0x1c4e9c)return _0x3c66cc(_0x1c4e9c);return _0x1bac67(_0x3cdb72);});})[_0x183e('0x23')](function(){return new BPromise(function(_0x3f7463,_0x3b2816){rimraf(_0x1076a1,function(_0x340a33){if(_0x340a33)_0x3b2816(_0x340a33);return _0x3f7463();});});})[_0x183e('0x23')](function(){return _0x416afc[_0x183e('0xc9')](_0x4d37af,_0x4c2815,function(_0x1c71a3){if(_0x1c71a3){console['log'](_0x183e('0xca'),_0x1c71a3);}else{fs['unlinkSync'](_0x4d37af);}});});});}else{return _0x416afc['sendStatus'](0xc8);}})[_0x183e('0xa8')](handleError(_0x416afc,null));};
\ No newline at end of file
+var _0x6ea9=['nolimit','limit','order','sort','where','pick','select','field','color','u.fullname','from','user_has_fax_interactions','left_join','users','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','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.fax\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','i.FaxAccountId\x20IS\x20NULL','sequelize','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','rows','show','params','includeAll','include','options','create','destroy','describe','addMessage','FaxMessage','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','omit','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','Attachment','Messages','createdAt','mkdirSync','basename','pipe','createWriteStream','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','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','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty'];(function(_0x32a254,_0x14e1d0){var _0x799afb=function(_0x47e462){while(--_0x47e462){_0x32a254['push'](_0x32a254['shift']());}};_0x799afb(++_0x14e1d0);}(_0x6ea9,0x89));var _0x96ea=function(_0x4ecdb7,_0x5ef62a){_0x4ecdb7=_0x4ecdb7-0x0;var _0x1dae76=_0x6ea9[_0x4ecdb7];return _0x1dae76;};'use strict';var pdf=require(_0x96ea('0x0'));var emlformat=require(_0x96ea('0x1'));var rimraf=require(_0x96ea('0x2'));var zipdir=require(_0x96ea('0x3'));var jsonpatch=require(_0x96ea('0x4'));var rp=require('request-promise');var moment=require(_0x96ea('0x5'));var BPromise=require(_0x96ea('0x6'));var Mustache=require(_0x96ea('0x7'));var util=require('util');var path=require(_0x96ea('0x8'));var sox=require('sox');var csv=require(_0x96ea('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x96ea('0xa'));var squel=require('squel');var crypto=require(_0x96ea('0xb'));var jsforce=require(_0x96ea('0xc'));var deskjs=require(_0x96ea('0xd'));var toCsv=require(_0x96ea('0x9'));var querystring=require(_0x96ea('0xe'));var Papa=require(_0x96ea('0xf'));var Redis=require('ioredis');var authService=require(_0x96ea('0x10'));var qs=require(_0x96ea('0x11'));var as=require(_0x96ea('0x12'));var hardwareService=require(_0x96ea('0x13'));var logger=require(_0x96ea('0x14'))(_0x96ea('0x15'));var utils=require(_0x96ea('0x16'));var config=require(_0x96ea('0x17'));var db=require(_0x96ea('0x18'))['db'];config[_0x96ea('0x19')]=_['defaults'](config[_0x96ea('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x96ea('0x1a'))(new Redis(config[_0x96ea('0x19')]));require('./faxInteraction.socket')[_0x96ea('0x1b')](socket);function respondWithStatusCode(_0x1ce6e9,_0xc1059e){_0xc1059e=_0xc1059e||0xcc;return function(_0x328c5a){if(_0x328c5a){return _0x1ce6e9[_0x96ea('0x1c')](_0xc1059e);}return _0x1ce6e9[_0x96ea('0x1d')](_0xc1059e)[_0x96ea('0x1e')]();};}function respondWithResult(_0x237f2c,_0x4a847d){_0x4a847d=_0x4a847d||0xc8;return function(_0x3ce6ad){if(_0x3ce6ad){return _0x237f2c['status'](_0x4a847d)['json'](_0x3ce6ad);}};}function respondWithFilteredResult(_0xadf4fb,_0x3cb1e0){return function(_0x4d61aa){if(_0x4d61aa){var _0x47444c=_0x4d61aa[_0x96ea('0x1f')],_0x4476da=_0x3cb1e0[_0x96ea('0x20')],_0x24c940=_0x3cb1e0[_0x96ea('0x20')]+_0x3cb1e0['limit'],_0x3b7811;if(_0x24c940>=_0x47444c){_0x24c940=_0x47444c;_0x3b7811=0xc8;}else{_0x3b7811=0xce;}_0xadf4fb['status'](_0x3b7811);return _0xadf4fb[_0x96ea('0x21')](_0x96ea('0x22'),_0x4476da+'-'+_0x24c940+'/'+_0x47444c)[_0x96ea('0x23')](_0x4d61aa);}return null;};}function patchUpdates(_0x1e1bcd){return function(_0x26c4b5){try{jsonpatch[_0x96ea('0x24')](_0x26c4b5,_0x1e1bcd,!![]);}catch(_0x26df9b){return BPromise[_0x96ea('0x25')](_0x26df9b);}return _0x26c4b5[_0x96ea('0x26')]();};}function saveUpdates(_0x3a618c,_0x3a99f6){return function(_0x4a53a6){if(_0x4a53a6){return _0x4a53a6[_0x96ea('0x27')](_0x3a618c)[_0x96ea('0x28')](function(_0x3dc8bd){return _0x3dc8bd;});}return null;};}function removeEntity(_0x3634e7,_0x396117){return function(_0x1676e7){if(_0x1676e7){return _0x1676e7['destroy']()[_0x96ea('0x28')](function(){_0x3634e7['status'](0xcc)[_0x96ea('0x1e')]();});}};}function handleEntityNotFound(_0x29580d,_0x5e7734){return function(_0x592b4f){if(!_0x592b4f){_0x29580d[_0x96ea('0x1c')](0x194);}return _0x592b4f;};}function handleError(_0x105733,_0x15c3e6){_0x15c3e6=_0x15c3e6||0x1f4;return function(_0x21995c){logger[_0x96ea('0x29')](_0x21995c['stack']);if(_0x21995c[_0x96ea('0x2a')]){delete _0x21995c[_0x96ea('0x2a')];}_0x105733[_0x96ea('0x1d')](_0x15c3e6)[_0x96ea('0x2b')](_0x21995c);};}function getInteractionUsers(_0x2aa9e9,_0x1b5ca7){return new BPromise(function(_0x45cca7,_0x13d1c5){try{if(_0x1b5ca7[_0x2aa9e9['id']]){_0x2aa9e9[_0x96ea('0x2c')]=_[_0x96ea('0x2d')](_0x1b5ca7[_0x2aa9e9['id']],function(_0x2469ae){return{'id':_0x2469ae['id'],'fullname':_0x2469ae[_0x96ea('0x2e')]};});}}catch(_0x91a2a2){_0x13d1c5(_0x91a2a2);}_0x45cca7(_0x2aa9e9);});}function getInteractionTags(_0x30ec3f,_0x1c6f08){return new BPromise(function(_0x5a73a2,_0x114450){try{if(_0x30ec3f[_0x96ea('0x2f')]){_0x30ec3f[_0x96ea('0x30')]=[];_0x30ec3f['TagIds'][_0x96ea('0x31')](',')['forEach'](function(_0x4be49e){_0x30ec3f[_0x96ea('0x30')][_0x96ea('0x32')](_0x1c6f08[_0x4be49e]);});}delete _0x30ec3f['TagIds'];}catch(_0x7fc185){_0x114450(_0x7fc185);}_0x5a73a2(_0x30ec3f);});}function updateFaxInteraction(_0x260b4c,_0xa73379,_0x1798fd){return new BPromise(function(_0xf5b90a,_0x2e020f){return getInteractionUsers(_0x260b4c,_0x1798fd)[_0x96ea('0x28')](function(_0x231ff1){return getInteractionTags(_0x231ff1,_0xa73379);})['then'](function(_0xbb61e5){_0xf5b90a(_0xbb61e5);})[_0x96ea('0x33')](function(_0x5c8361){_0x2e020f(_0x5c8361);});});}exports[_0x96ea('0x34')]=function(_0xbeb8d0,_0x334ba1){var _0x1ac94b={},_0x830686={},_0x3a1b61={'count':0x0,'rows':[]};var _0x17dbd0=_['map'](db[_0x96ea('0x35')][_0x96ea('0x36')],function(_0x327c85){return{'name':_0x327c85[_0x96ea('0x37')],'type':_0x327c85[_0x96ea('0x38')][_0x96ea('0x39')]};});_0x830686[_0x96ea('0x3a')]=_[_0x96ea('0x2d')](_0x17dbd0,_0x96ea('0x2a'));_0x830686[_0x96ea('0x3b')]=_[_0x96ea('0x3c')](_0xbeb8d0[_0x96ea('0x3b')]);_0x830686[_0x96ea('0x3d')]=_[_0x96ea('0x3e')](_0x830686[_0x96ea('0x3a')],_0x830686[_0x96ea('0x3b')]);_0x1ac94b[_0x96ea('0x3f')]=_[_0x96ea('0x3e')](_0x830686[_0x96ea('0x3a')],qs['fields'](_0xbeb8d0[_0x96ea('0x3b')]['fields']));_0x1ac94b[_0x96ea('0x3f')]=_0x1ac94b[_0x96ea('0x3f')][_0x96ea('0x40')]?_0x1ac94b[_0x96ea('0x3f')]:_0x830686[_0x96ea('0x3a')];if(!_0xbeb8d0['query'][_0x96ea('0x41')](_0x96ea('0x42'))){_0x1ac94b[_0x96ea('0x43')]=qs['limit'](_0xbeb8d0[_0x96ea('0x3b')]['limit']);_0x1ac94b[_0x96ea('0x20')]=qs['offset'](_0xbeb8d0['query'][_0x96ea('0x20')]);}_0x1ac94b[_0x96ea('0x44')]=qs[_0x96ea('0x45')](_0xbeb8d0[_0x96ea('0x3b')]['sort']);_0x1ac94b[_0x96ea('0x46')]=qs[_0x96ea('0x3d')](_[_0x96ea('0x47')](_0xbeb8d0[_0x96ea('0x3b')],_0x830686[_0x96ea('0x3d')]),_0x17dbd0);var _0x4b387a=[];var _0x5a346a=squel[_0x96ea('0x48')]()[_0x96ea('0x49')]('id')[_0x96ea('0x49')]('name')[_0x96ea('0x49')](_0x96ea('0x4a'))['from']('tools_tags');var _0x46ff36=squel[_0x96ea('0x48')]()['field']('u.id')[_0x96ea('0x49')](_0x96ea('0x4b'))[_0x96ea('0x49')]('ui.FaxInteractionId')[_0x96ea('0x4c')](_0x96ea('0x4d'),'ui')[_0x96ea('0x4e')](_0x96ea('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x149f62=squel[_0x96ea('0x48')]()[_0x96ea('0x4c')]('fax_interactions','i')[_0x96ea('0x4e')](_0x96ea('0x50'),'c',_0x96ea('0x51'))['left_join'](_0x96ea('0x4f'),'o',_0x96ea('0x52'))[_0x96ea('0x4e')](_0x96ea('0x53'),'a',_0x96ea('0x54'))[_0x96ea('0x4e')](_0x96ea('0x55'),'me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x96ea('0x56'),'it',_0x96ea('0x57'))[_0x96ea('0x4e')](_0x96ea('0x58'),'t',_0x96ea('0x59'));var _0xf921c5=squel[_0x96ea('0x5a')]();var _0x5eb358=[];var _0x4d7c06=squel[_0x96ea('0x5a')]();var _0x131395;if(_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x5b')]){_0x131395=as[_0x96ea('0x5c')](_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x5b')]);var _0x4b83c4=_0x131395[_0x96ea('0x5d')];for(var _0x12f409=0x0;_0x12f409<_0x131395['conditions'][_0x96ea('0x40')];_0x12f409++){var _0x2f0a2a=_0x131395[_0x96ea('0x5e')][_0x12f409];var _0x516692='i';var _0x501f5b=_['find'](_0x17dbd0,[_0x96ea('0x2a'),_0x2f0a2a[_0x96ea('0x49')]]);if(!_0x501f5b){switch(_0x2f0a2a[_0x96ea('0x49')]){case _0x96ea('0x5f'):if(_0x2f0a2a[_0x96ea('0x60')]==0x1){_0x149f62[_0x96ea('0x61')]('`'+_0x2f0a2a['field']+_0x96ea('0x62'));}else{_0x149f62[_0x96ea('0x61')]('`'+_0x2f0a2a[_0x96ea('0x49')]+'`\x20>\x200');}break;case _0x96ea('0x63'):if(_0x2f0a2a[_0x96ea('0x64')]===_0x96ea('0x65')){if(_0x2f0a2a[_0x96ea('0x60')][_0x96ea('0x31')]('\x20')[_0x96ea('0x40')]>0x1){_0xf921c5[_0x4b83c4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2f0a2a['value']),null);}else{var _0x1e2ba5='%'+_0x2f0a2a['value']+'%';_0xf921c5[_0x4b83c4](_0x96ea('0x66'),_0x1e2ba5,_0x1e2ba5,_0x1e2ba5);}}else{_0x501f5b=_[_0x96ea('0x67')](_0x17dbd0,[_0x96ea('0x2a'),_0x96ea('0x68')]);_0x2f0a2a[_0x96ea('0x49')]='ContactId';_0x73a0f6=as[_0x96ea('0x69')](_0x516692,_0x501f5b['type'],_0x2f0a2a);_0xf921c5[_0x4b83c4](_0x73a0f6[_0x96ea('0x6a')],_0x73a0f6['value'][_0x96ea('0x6b')],_0x73a0f6[_0x96ea('0x60')][_0x96ea('0x1e')]);}break;case _0x96ea('0x6c'):var _0x33cb52=_0x2f0a2a[_0x96ea('0x60')]['split'](',')[_0x96ea('0x2d')](function(_0x2c2944){return Number(_0x2c2944);});_0x33cb52[_0x96ea('0x6d')](function(_0x31a532){_0x4d7c06['or'](_0x96ea('0x6e'),'%,'+_0x31a532+',%');});_0x5eb358=_[_0x96ea('0x6f')](_0x5eb358,_0x33cb52);break;case'User':if(_0x2f0a2a[_0x96ea('0x64')]===_0x96ea('0x65')){_0xf921c5[_0x4b83c4](_0x96ea('0x70'),'%'+_0x2f0a2a[_0x96ea('0x60')]+'%',null);}else{_0x501f5b=_['find'](_0x17dbd0,[_0x96ea('0x2a'),_0x96ea('0x71')]);_0x2f0a2a[_0x96ea('0x49')]=_0x96ea('0x71');_0x73a0f6=as[_0x96ea('0x69')](_0x516692,_0x501f5b[_0x96ea('0x38')],_0x2f0a2a);_0xf921c5[_0x4b83c4](_0x73a0f6[_0x96ea('0x6a')],_0x73a0f6[_0x96ea('0x60')]['start'],_0x73a0f6['value'][_0x96ea('0x1e')]);}break;case _0x96ea('0x72'):_0x73a0f6=as['buildExpression']('me',null,_0x2f0a2a);_0xf921c5[_0x4b83c4](_0x73a0f6[_0x96ea('0x6a')],_0x73a0f6[_0x96ea('0x60')][_0x96ea('0x6b')],_0x73a0f6[_0x96ea('0x60')]['end']);break;}}else{var _0x73a0f6=as[_0x96ea('0x69')](_0x516692,_0x501f5b['type'],_0x2f0a2a);_0xf921c5[_0x4b83c4](_0x73a0f6[_0x96ea('0x6a')],_0x73a0f6[_0x96ea('0x60')]['start'],_0x73a0f6[_0x96ea('0x60')]['end']);}}}else{var _0x8e9633=_(_0xbeb8d0[_0x96ea('0x3b')])[_0x96ea('0x3c')]()[_0x96ea('0x2d')](function(_0x12028b){return _[_0x96ea('0x73')](_0x17dbd0,[_0x96ea('0x2a'),_0x12028b])?_0x12028b:undefined;})[_0x96ea('0x74')]()[_0x96ea('0x60')]();if(!_[_0x96ea('0x75')](_0x8e9633)){_0x8e9633['forEach'](function(_0x2a8f91){if(_0x2a8f91===_0x96ea('0x76')){_0x149f62[_0x96ea('0x46')](_0x96ea('0x77'),[]['concat'](_0xbeb8d0['query'][_0x2a8f91]));}else if(_0x2a8f91==='createdAt'){var _0x34002e=JSON[_0x96ea('0x78')](_0xbeb8d0['query'][_0x2a8f91])[_0x96ea('0x79')];var _0x5bc708=JSON['parse'](_0xbeb8d0[_0x96ea('0x3b')][_0x2a8f91])[_0x96ea('0x7a')];_0x149f62[_0x96ea('0x46')](_0x96ea('0x7b'),_0x34002e,_0x5bc708);}else{if(_0xbeb8d0[_0x96ea('0x3b')][_0x2a8f91]===_0x96ea('0x7c')){_0x149f62[_0x96ea('0x46')]('i.'+_0x2a8f91+'\x20IS\x20NULL');}else{_0x149f62[_0x96ea('0x46')]('i.'+_0x2a8f91+_0x96ea('0x7d'),_0xbeb8d0[_0x96ea('0x3b')][_0x2a8f91]);}}});}if(_0xbeb8d0['query']['read']){if(_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x7e')]==0x1){_0x149f62[_0x96ea('0x61')](_0x96ea('0x7f'));}else{_0x149f62[_0x96ea('0x61')](_0x96ea('0x80'));}}if(_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x81')]){_0x5eb358=_[_0x96ea('0x82')](_0xbeb8d0['query'][_0x96ea('0x81')])?_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x81')]:new Array(_0xbeb8d0['query'][_0x96ea('0x81')]);_0x5eb358['forEach'](function(_0x1ccf95){_0x4d7c06['or'](_0x96ea('0x6e'),'%,'+_0x1ccf95+',%');});}if(_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x83')]){var _0x40370f=_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x83')]['replace']('\x5c','\x5c\x5c')[_0x96ea('0x84')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x96ea('0x85')](_0x40370f)){_0xf921c5['or']('i.id\x20LIKE\x20?',_0x40370f+'%')['or'](_0x96ea('0x86'),_0x40370f+'%');}_0xf921c5['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x40370f+'%');}}_0x149f62['where'](_0xf921c5);_0x149f62[_0x96ea('0x87')]('i.id');var _0x44e59e={'type':db[_0x96ea('0x88')][_0x96ea('0x89')][_0x96ea('0x8a')],'raw':!![]};var _0x2acd08=_0x149f62['clone']();_0x2acd08['field']('i.id');_0x2acd08['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x96ea('0x5f'));if(_0x1ac94b['order']){_0x1ac94b[_0x96ea('0x44')][_0x96ea('0x6d')](function(_0x3b2944){_0x149f62['order']('i.'+_0x3b2944[0x0],_0x3b2944[0x1]===_0x96ea('0x8b')?![]:!![]);});}if(!_[_0x96ea('0x75')](_0x5eb358)){_0x149f62[_0x96ea('0x61')](_0x4d7c06);_0x2acd08['where']('t.id\x20IN\x20?',_0x5eb358);}BPromise[_0x96ea('0x8c')]()[_0x96ea('0x28')](function(){if(!_0x131395){if(_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x76')]||_0xbeb8d0[_0x96ea('0x3b')]['journey'])return;_0x2acd08[_0x96ea('0x46')](_0x96ea('0x8d'));_0x149f62['where'](_0x96ea('0x8d'));return;}return _0xbeb8d0['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x96ea('0x28')](function(_0x4f881c){if(_[_0x96ea('0x75')](_0x4f881c)){_0x2acd08[_0x96ea('0x46')](_0x96ea('0x8e'));_0x149f62[_0x96ea('0x46')](_0x96ea('0x8e'));}else{_0x2acd08[_0x96ea('0x46')](_0x96ea('0x77'),_[_0x96ea('0x2d')](_0x4f881c,'id'));_0x149f62[_0x96ea('0x46')]('i.FaxAccountId\x20IN\x20?',_[_0x96ea('0x2d')](_0x4f881c,'id'));}});})['then'](function(){db[_0x96ea('0x8f')][_0x96ea('0x3b')](_0x2acd08['toString'](),_0x44e59e)[_0x96ea('0x28')](function(_0x53ab95){_0x3a1b61[_0x96ea('0x1f')]=_0x53ab95[_0x96ea('0x40')];if(_0x3a1b61[_0x96ea('0x1f')]===0x0)return[];return db[_0x96ea('0x8f')][_0x96ea('0x3b')](_0x5a346a['toString'](),_0x44e59e)[_0x96ea('0x28')](function(_0x1a28f1){_0x4b387a=_[_0x96ea('0x90')](_0x1a28f1,'id');_0x44e59e=_[_0x96ea('0x91')](_0x44e59e,{'model':db[_0x96ea('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbeb8d0[_0x96ea('0x3b')][_0x96ea('0x92')]){_0x1ac94b[_0x96ea('0x3f')][_0x96ea('0x6d')](function(_0x571b7c){_0x149f62[_0x96ea('0x49')]('i.'+_0x571b7c);});}else{_0x149f62[_0x96ea('0x49')](_0x96ea('0x93'),'unreadMessages');_0x149f62[_0x96ea('0x49')](_0x96ea('0x94'),_0x96ea('0x95'));_0x149f62[_0x96ea('0x49')](_0x96ea('0x96'),'Account.mandatoryDisposition');_0x149f62[_0x96ea('0x49')](_0x96ea('0x97'));_0x149f62['field'](_0x96ea('0x98'),'Contact.firstName');_0x149f62['field']('c.lastName','Contact.lastName');_0x149f62[_0x96ea('0x49')](_0x96ea('0x99'),_0x96ea('0x9a'));_0x149f62['field'](_0x96ea('0x9b'),'Contact.phone');_0x149f62['field'](_0x96ea('0x9c'),'Contact.mobile');_0x149f62[_0x96ea('0x49')](_0x96ea('0x9d'),_0x96ea('0x9e'));_0x149f62[_0x96ea('0x49')](_0x96ea('0x9f'),_0x96ea('0xa0'));_0x149f62[_0x96ea('0x49')](_0x96ea('0xa1'),_0x96ea('0xa2'));_0x149f62['field'](_0x96ea('0xa3'),_0x96ea('0x2f'));}if(_0x1ac94b['limit'])_0x149f62[_0x96ea('0x43')](_0x1ac94b['limit']);if(_0x1ac94b[_0x96ea('0x20')])_0x149f62[_0x96ea('0x20')](_0x1ac94b[_0x96ea('0x20')]);return db[_0x96ea('0x8f')][_0x96ea('0x3b')](_0x149f62[_0x96ea('0xa4')](),_0x44e59e);})['then'](function(_0x2da8b1){_0x46ff36[_0x96ea('0x46')](_0x96ea('0xa5'),_[_0x96ea('0x2d')](_0x2da8b1,'id'));return db[_0x96ea('0x8f')][_0x96ea('0x3b')](_0x46ff36[_0x96ea('0xa4')](),_0x44e59e)['then'](function(_0x175ad5){var _0x5931cd=_['groupBy'](_0x175ad5,_0x96ea('0xa6'));var _0x1d8453=[];_0x2da8b1[_0x96ea('0x6d')](function(_0x53833a){_0x1d8453[_0x96ea('0x32')](updateFaxInteraction(_0x53833a,_0x4b387a,_0x5931cd));});return BPromise['all'](_0x1d8453);});});})[_0x96ea('0x28')](function(_0x171e94){_0x3a1b61[_0x96ea('0xa7')]=_0x171e94;return _0x3a1b61;})[_0x96ea('0x28')](respondWithFilteredResult(_0x334ba1,_0x1ac94b));})[_0x96ea('0x33')](handleError(_0x334ba1,null));};exports[_0x96ea('0xa8')]=function(_0x9049e9,_0x13f92a){var _0x5ee8af={'raw':![],'where':{'id':_0x9049e9[_0x96ea('0xa9')]['id']}},_0x3b531c={};_0x3b531c[_0x96ea('0x3a')]=_['keys'](db['FaxInteraction'][_0x96ea('0x36')]);_0x3b531c[_0x96ea('0x3b')]=_['keys'](_0x9049e9[_0x96ea('0x3b')]);_0x3b531c[_0x96ea('0x3d')]=_[_0x96ea('0x3e')](_0x3b531c['model'],_0x3b531c[_0x96ea('0x3b')]);_0x5ee8af[_0x96ea('0x3f')]=_[_0x96ea('0x3e')](_0x3b531c[_0x96ea('0x3a')],qs[_0x96ea('0x92')](_0x9049e9[_0x96ea('0x3b')][_0x96ea('0x92')]));_0x5ee8af['attributes']=_0x5ee8af[_0x96ea('0x3f')][_0x96ea('0x40')]?_0x5ee8af[_0x96ea('0x3f')]:_0x3b531c[_0x96ea('0x3a')];if(_0x9049e9[_0x96ea('0x3b')][_0x96ea('0xaa')]){_0x5ee8af[_0x96ea('0xab')]=[{'all':!![]}];}_0x5ee8af=_[_0x96ea('0x91')]({},_0x5ee8af,_0x9049e9[_0x96ea('0xac')]);return db[_0x96ea('0x35')][_0x96ea('0x67')](_0x5ee8af)['then'](handleEntityNotFound(_0x13f92a,null))[_0x96ea('0x28')](respondWithResult(_0x13f92a,null))['catch'](handleError(_0x13f92a,null));};exports['create']=function(_0x25beee,_0x516b54){return db[_0x96ea('0x35')][_0x96ea('0xad')](_0x25beee[_0x96ea('0x72')],{})[_0x96ea('0x28')](respondWithResult(_0x516b54,0xc9))[_0x96ea('0x33')](handleError(_0x516b54,null));};exports['update']=function(_0x342a92,_0x3c132b){if(_0x342a92[_0x96ea('0x72')]['id']){delete _0x342a92[_0x96ea('0x72')]['id'];}return db[_0x96ea('0x35')][_0x96ea('0x67')]({'where':{'id':_0x342a92[_0x96ea('0xa9')]['id']}})[_0x96ea('0x28')](handleEntityNotFound(_0x3c132b,null))['then'](saveUpdates(_0x342a92[_0x96ea('0x72')],null))[_0x96ea('0x28')](respondWithResult(_0x3c132b,null))[_0x96ea('0x33')](handleError(_0x3c132b,null));};exports[_0x96ea('0xae')]=function(_0x5bf426,_0x23cde4){return db[_0x96ea('0x35')][_0x96ea('0x67')]({'where':{'id':_0x5bf426['params']['id']}})[_0x96ea('0x28')](handleEntityNotFound(_0x23cde4,null))[_0x96ea('0x28')](removeEntity(_0x23cde4,null))[_0x96ea('0x33')](handleError(_0x23cde4,null));};exports[_0x96ea('0xaf')]=function(_0x38f42d,_0x5ecf7f){return db[_0x96ea('0x35')][_0x96ea('0xaf')]()['then'](respondWithResult(_0x5ecf7f,null))[_0x96ea('0x33')](handleError(_0x5ecf7f,null));};exports[_0x96ea('0xb0')]=function(_0x5ef086,_0x370cbe,_0x1e4586){return db[_0x96ea('0xb1')][_0x96ea('0x67')]({'where':{'id':_0x5ef086['params']['id']}})[_0x96ea('0x28')](handleEntityNotFound(_0x370cbe,null))[_0x96ea('0x28')](function(_0x34b07e){if(_0x34b07e){return _0x34b07e[_0x96ea('0xb0')](_0x5ef086[_0x96ea('0x72')][_0x96ea('0xb2')],_['omit'](_0x5ef086[_0x96ea('0x72')],['ids','id'])||{});}})['then'](respondWithResult(_0x370cbe,null))[_0x96ea('0x33')](handleError(_0x370cbe,null));};exports[_0x96ea('0xb3')]=function(_0x76dab4,_0xd20963,_0x56b8f1){var _0x48ca92={'raw':![],'where':{}};var _0x263425={};var _0x3126ce={'count':0x0,'rows':[]};return db[_0x96ea('0x35')][_0x96ea('0xb4')]({'where':{'id':_0x76dab4['params']['id']}})[_0x96ea('0x28')](handleEntityNotFound(_0xd20963,null))[_0x96ea('0x28')](function(_0x4669f1){if(_0x4669f1){_0x263425[_0x96ea('0x3a')]=_[_0x96ea('0x3c')](db[_0x96ea('0xb1')][_0x96ea('0x36')]);_0x263425['query']=_['keys'](_0x76dab4['query']);_0x263425['filters']=_[_0x96ea('0x3e')](_0x263425['model'],_0x263425['query']);_0x48ca92[_0x96ea('0x3f')]=_[_0x96ea('0x3e')](_0x263425[_0x96ea('0x3a')],qs[_0x96ea('0x92')](_0x76dab4['query'][_0x96ea('0x92')]));_0x48ca92[_0x96ea('0x3f')]=_0x48ca92[_0x96ea('0x3f')][_0x96ea('0x40')]?_0x48ca92[_0x96ea('0x3f')]:_0x263425['model'];if(!_0x76dab4[_0x96ea('0x3b')][_0x96ea('0x41')]('nolimit')){_0x48ca92[_0x96ea('0x43')]=qs[_0x96ea('0x43')](_0x76dab4['query']['limit']);_0x48ca92[_0x96ea('0x20')]=qs[_0x96ea('0x20')](_0x76dab4[_0x96ea('0x3b')][_0x96ea('0x20')]);}_0x48ca92[_0x96ea('0x44')]=qs[_0x96ea('0x45')](_0x76dab4[_0x96ea('0x3b')][_0x96ea('0x45')]);_0x48ca92[_0x96ea('0x46')]=qs[_0x96ea('0x3d')](_[_0x96ea('0x47')](_0x76dab4[_0x96ea('0x3b')],_0x263425[_0x96ea('0x3d')]));_0x48ca92[_0x96ea('0x46')]['FaxInteractionId']=_0x4669f1['id'];if(_0x76dab4['query'][_0x96ea('0x83')]){_0x48ca92[_0x96ea('0x46')]=_[_0x96ea('0x91')](_0x48ca92[_0x96ea('0x46')],{'$or':_['map'](_0x48ca92[_0x96ea('0x3f')],function(_0x4bdc56){var _0x80c333={};_0x80c333[_0x4bdc56]={'$like':'%'+_0x76dab4[_0x96ea('0x3b')][_0x96ea('0x83')]+'%'};return _0x80c333;})});}if(_0x76dab4[_0x96ea('0x3b')]['$gte']){var _0x50aee6=_0x76dab4[_0x96ea('0x3b')][_0x96ea('0x79')][_0x96ea('0x31')](',');var _0x435671={};_0x435671[_0x50aee6[0x0]]={'$gte':moment(_0x50aee6[0x1])['format'](_0x96ea('0xb5'))};_0x48ca92['where']=_[_0x96ea('0x91')](_0x48ca92[_0x96ea('0x46')],_0x435671);}_0x48ca92=_[_0x96ea('0x91')]({},_0x48ca92,_0x76dab4[_0x96ea('0xac')]);return db[_0x96ea('0xb1')][_0x96ea('0x1f')]({'where':_0x48ca92['where']})[_0x96ea('0x28')](function(_0x52c3b4){_0x3126ce[_0x96ea('0x1f')]=_0x52c3b4;if(_0x76dab4[_0x96ea('0x3b')][_0x96ea('0xaa')]){_0x48ca92[_0x96ea('0xab')]=[{'all':!![]}];}return db[_0x96ea('0xb1')][_0x96ea('0xb6')](_0x48ca92);})[_0x96ea('0x28')](function(_0x535d9c){_0x3126ce[_0x96ea('0xa7')]=_0x535d9c;return _0x3126ce;});}})[_0x96ea('0x28')](respondWithFilteredResult(_0xd20963,_0x48ca92))[_0x96ea('0x33')](handleError(_0xd20963,null));};exports[_0x96ea('0xb7')]=function(_0x12b37d,_0x2260f0,_0x15dd44){return db[_0x96ea('0x35')]['find']({'where':{'id':_0x12b37d['params']['id']}})[_0x96ea('0x28')](handleEntityNotFound(_0x2260f0,null))[_0x96ea('0x28')](function(_0x1c2c0c){if(_0x1c2c0c){return _0x1c2c0c['setTags'](_0x12b37d[_0x96ea('0x72')][_0x96ea('0xb2')],_[_0x96ea('0xb8')](_0x12b37d[_0x96ea('0x72')],['ids','id'])||{})['spread'](function(){return db[_0x96ea('0x6c')][_0x96ea('0xb6')]({'attributes':['id',_0x96ea('0x2a'),_0x96ea('0x4a')],'where':{'id':_0x12b37d[_0x96ea('0x72')][_0x96ea('0xb2')]}});})['then'](function(_0x18468f){socket[_0x96ea('0xb9')](_0x96ea('0xba'),{'id':Number(_0x12b37d[_0x96ea('0xa9')]['id']),'tags':_0x18468f||[]});return{'id':Number(_0x12b37d[_0x96ea('0xa9')]['id']),'tags':_0x18468f||[]};});}})[_0x96ea('0x28')](respondWithResult(_0x2260f0,null))[_0x96ea('0x33')](handleError(_0x2260f0,null));};exports['removeTags']=function(_0x4cc346,_0x3adc27,_0x1e3071){return db[_0x96ea('0x35')][_0x96ea('0x67')]({'where':{'id':_0x4cc346[_0x96ea('0xa9')]['id']}})[_0x96ea('0x28')](handleEntityNotFound(_0x3adc27,null))[_0x96ea('0x28')](function(_0x33410f){if(_0x33410f){return _0x33410f[_0x96ea('0xbb')](_0x4cc346['query']['ids']);}})[_0x96ea('0x28')](respondWithStatusCode(_0x3adc27,null))[_0x96ea('0x33')](handleError(_0x3adc27,null));};exports[_0x96ea('0xbc')]=function(_0x3a9838,_0x3ff477){var _0x438a96=moment()[_0x96ea('0xbd')]()[_0x96ea('0xa4')]();var _0x26e153=path['join'](config[_0x96ea('0xbe')],_0x96ea('0xbf'),_0x96ea('0xc0'),_0x96ea('0xc1'));var _0x4bd69e=path['join'](config['root'],_0x96ea('0xbf'),'files','attachments');var _0x33896e=path[_0x96ea('0xc2')](_0x26e153,_0x438a96);var _0x491e22=util['format'](_0x96ea('0xc3'),_0x3a9838[_0x96ea('0xa9')]['id'],_0x438a96);var _0x3a2a31=path[_0x96ea('0xc2')](_0x26e153,_0x491e22);var _0x1e5ee8=[];_0x1e5ee8['push']({'model':db[_0x96ea('0xc4')],'as':_0x96ea('0xc4'),'raw':!![]});var _0xc9fe8c=[{'model':db['FaxMessage'],'as':_0x96ea('0xc5'),'attributes':['id',_0x96ea('0x72'),_0x96ea('0xc6')],'include':_0x1e5ee8}];return db[_0x96ea('0x35')][_0x96ea('0x67')]({'where':{'id':_0x3a9838[_0x96ea('0xa9')]['id']},'include':_0xc9fe8c})[_0x96ea('0x28')](handleEntityNotFound(_0x3ff477,null))[_0x96ea('0x28')](function(_0x2a1257){if(_0x2a1257&&_0x2a1257['Messages']){var _0x3fca2f=_0x2a1257['get']({'plain':!![]});fs[_0x96ea('0xc7')](_0x33896e);for(var _0xa101d0=0x0;_0xa101d0<_0x3fca2f[_0x96ea('0xc5')][_0x96ea('0x40')];_0xa101d0++){var _0x11638b=_0x3fca2f[_0x96ea('0xc5')][_0xa101d0][_0x96ea('0xc4')];if(_0x11638b){var _0x446c93=path[_0x96ea('0xc2')](_0x4bd69e,_0x11638b[_0x96ea('0xc8')]);if(fs['existsSync'](_0x446c93)){fs['createReadStream'](_0x446c93)[_0x96ea('0xc9')](fs[_0x96ea('0xca')](path[_0x96ea('0xc2')](_0x33896e,_0x11638b[_0x96ea('0xc8')])));}}}return BPromise['resolve']()[_0x96ea('0x28')](function(){return new BPromise(function(_0x24810d,_0x4ce75d){zipdir(_0x33896e,{'saveTo':_0x3a2a31},function(_0x563c9a,_0x4ff8d3){if(_0x563c9a)return _0x4ce75d(_0x563c9a);return _0x24810d(_0x4ff8d3);});})[_0x96ea('0x28')](function(){return new BPromise(function(_0x2f801f,_0x3c526b){rimraf(_0x33896e,function(_0x6589cd){if(_0x6589cd)_0x3c526b(_0x6589cd);return _0x2f801f();});});})['then'](function(){return _0x3ff477['download'](_0x3a2a31,_0x491e22,function(_0x24f88d){if(_0x24f88d){console['log']('err',_0x24f88d);}else{fs['unlinkSync'](_0x3a2a31);}});});});}else{return _0x3ff477[_0x96ea('0x1c')](0xc8);}})[_0x96ea('0x33')](handleError(_0x3ff477,null));};
\ No newline at end of file
index 73d379a..19908f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x206f1e,_0x5f5c8b){var _0x2a4708=function(_0x42221e){while(--_0x42221e){_0x206f1e['push'](_0x206f1e['shift']());}};_0x2a4708(++_0x5f5c8b);}(_0x7a54,0x106));var _0x47a5=function(_0x2ba0bc,_0x56e570){_0x2ba0bc=_0x2ba0bc-0x0;var _0x2ecd4e=_0x7a54[_0x2ba0bc];return _0x2ecd4e;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var FaxInteraction=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x47a5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x47a5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47a5('0x5'),'afterDestroy':_0x47a5('0x6')};function emitEvent(_0x2a1a7e){return function(_0x3717e1,_0xfdf934,_0x545a97){_0x3717e1[_0x47a5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x343372){_0x3717e1[_0x47a5('0x8')]('Users',_0x343372[_0x47a5('0x9')](function(_0x5077f3){return{'id':_0x5077f3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3717e1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0e98){_0x3717e1[_0x47a5('0x8')]('unreadMessages',_0x2a0e98[_0x47a5('0xa')]);FaxInteractionEvents['emit'](_0x2a1a7e+':'+_0x3717e1['id'],_0x3717e1);FaxInteractionEvents['emit'](_0x2a1a7e,_0x3717e1);_0x545a97(null);})[_0x47a5('0xb')](_0x545a97(null));};}for(var e in events){if(events[_0x47a5('0xc')](e)){var event=events[e];FaxInteraction[_0x47a5('0xd')](e,emitEvent(event));}}module[_0x47a5('0xe')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x1261=['exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty'];(function(_0x39ee2c,_0x7074a9){var _0x207751=function(_0x1cebc4){while(--_0x1cebc4){_0x39ee2c['push'](_0x39ee2c['shift']());}};_0x207751(++_0x7074a9);}(_0x1261,0x144));var _0x1126=function(_0x21aafd,_0x1f0fa6){_0x21aafd=_0x21aafd-0x0;var _0x9f2800=_0x1261[_0x21aafd];return _0x9f2800;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var FaxMessage=require(_0x1126('0x0'))['db'][_0x1126('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1126('0x3')](0x0);var events={'afterCreate':_0x1126('0x4'),'afterUpdate':_0x1126('0x5'),'afterDestroy':_0x1126('0x6')};function emitEvent(_0x21a480){return function(_0x75a851,_0x5a2189,_0x5c68c8){_0x75a851[_0x1126('0x7')]({'attributes':['id'],'raw':!![]})[_0x1126('0x8')](function(_0x4f239c){_0x75a851[_0x1126('0x9')](_0x1126('0xa'),_0x4f239c[_0x1126('0xb')](function(_0x3abb0b){return{'id':_0x3abb0b['id']};}));return FaxMessage[_0x1126('0xc')]({'where':{'FaxInteractionId':_0x75a851['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f09ac){_0x75a851[_0x1126('0x9')](_0x1126('0xd'),_0x3f09ac['length']);FaxInteractionEvents[_0x1126('0xe')](_0x21a480+':'+_0x75a851['id'],_0x75a851);FaxInteractionEvents['emit'](_0x21a480,_0x75a851);_0x5c68c8(null);})['catch'](_0x5c68c8(null));};}for(var e in events){if(events[_0x1126('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1126('0x10')]=FaxInteractionEvents;
\ No newline at end of file
index e45c3e6..bd13b6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b5d=['FaxInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x379a70,_0x367de6){var _0x3ddaa4=function(_0x5a2582){while(--_0x5a2582){_0x379a70['push'](_0x379a70['shift']());}};_0x3ddaa4(++_0x367de6);}(_0x3b5d,0x1d5));var _0xd3b5=function(_0x1af7c3,_0x5cd4b5){_0x1af7c3=_0x1af7c3-0x0;var _0x302dd3=_0x3b5d[_0x1af7c3];return _0x302dd3;};'use strict';var _=require('lodash');var util=require(_0xd3b5('0x0'));var logger=require(_0xd3b5('0x1'))(_0xd3b5('0x2'));var moment=require('moment');var BPromise=require(_0xd3b5('0x3'));var rp=require(_0xd3b5('0x4'));var fs=require('fs');var path=require(_0xd3b5('0x5'));var rimraf=require(_0xd3b5('0x6'));var config=require(_0xd3b5('0x7'));var attributes=require(_0xd3b5('0x8'));module[_0xd3b5('0x9')]=function(_0x4e6d73,_0x297be6){return _0x4e6d73[_0xd3b5('0xa')](_0xd3b5('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x777826,_0xe3b05,_0xa20207){if(_0x777826[_0xd3b5('0xc')]('closed')){_0x777826[_0xd3b5('0xd')]=moment()[_0xd3b5('0xe')](_0xd3b5('0xf'));}_0xa20207(null,_0x777826);}}});};
\ No newline at end of file
+var _0x1d17=['api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger'];(function(_0x47dac5,_0x3edb97){var _0x2049ae=function(_0x31f815){while(--_0x31f815){_0x47dac5['push'](_0x47dac5['shift']());}};_0x2049ae(++_0x3edb97);}(_0x1d17,0x140));var _0x71d1=function(_0x3deb2e,_0x22319b){_0x3deb2e=_0x3deb2e-0x0;var _0x8a1956=_0x1d17[_0x3deb2e];return _0x8a1956;};'use strict';var _=require(_0x71d1('0x0'));var util=require(_0x71d1('0x1'));var logger=require(_0x71d1('0x2'))(_0x71d1('0x3'));var moment=require(_0x71d1('0x4'));var BPromise=require(_0x71d1('0x5'));var rp=require(_0x71d1('0x6'));var fs=require('fs');var path=require(_0x71d1('0x7'));var rimraf=require('rimraf');var config=require(_0x71d1('0x8'));var attributes=require(_0x71d1('0x9'));module[_0x71d1('0xa')]=function(_0x55b2b1,_0x34476e){return _0x55b2b1['define'](_0x71d1('0xb'),attributes,{'tableName':_0x71d1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ab9aa,_0x1a270d,_0x1d9290){if(_0x4ab9aa[_0x71d1('0xd')](_0x71d1('0xe'))){_0x4ab9aa[_0x71d1('0xf')]=moment()[_0x71d1('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1d9290(null,_0x4ab9aa);}}});};
\ No newline at end of file
index c039475..661f8ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee9b=['where','attributes','limit','AddTagsToFaxInteraction','find','addTags','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','raw','options'];(function(_0x100dea,_0x2ca828){var _0x785cb5=function(_0x1827ec){while(--_0x1827ec){_0x100dea['push'](_0x100dea['shift']());}};_0x785cb5(++_0x2ca828);}(_0xee9b,0x170));var _0xbee9=function(_0xac0da4,_0x7c0b26){_0xac0da4=_0xac0da4-0x0;var _0x833496=_0xee9b[_0xac0da4];return _0x833496;};'use strict';var _=require(_0xbee9('0x0'));var util=require(_0xbee9('0x1'));var moment=require(_0xbee9('0x2'));var BPromise=require('bluebird');var rs=require(_0xbee9('0x3'));var fs=require('fs');var Redis=require(_0xbee9('0x4'));var db=require(_0xbee9('0x5'))['db'];var utils=require(_0xbee9('0x6'));var logger=require('../../config/logger')(_0xbee9('0x7'));var config=require(_0xbee9('0x8'));var jayson=require(_0xbee9('0x9'));var client=jayson[_0xbee9('0xa')]['http']({'port':0x232a});config[_0xbee9('0xb')]=_[_0xbee9('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbee9('0xd'))(new Redis(config[_0xbee9('0xb')]));require('./faxInteraction.socket')[_0xbee9('0xe')](socket);function respondWithRpcPromise(_0x16cc37,_0x26e749,_0x5a7802){return new BPromise(function(_0x7dbc10,_0x2bfd61){return client['request'](_0x16cc37,_0x5a7802)[_0xbee9('0xf')](function(_0x5709f3){logger[_0xbee9('0x10')](_0xbee9('0x11'),_0x26e749,'request\x20sent');logger[_0xbee9('0x12')](_0xbee9('0x13'),_0x26e749,'request\x20sent',JSON[_0xbee9('0x14')](_0x5709f3));if(_0x5709f3['error']){if(_0x5709f3['error'][_0xbee9('0x15')]===0x1f4){logger[_0xbee9('0x16')](_0xbee9('0x11'),_0x26e749,_0x5709f3[_0xbee9('0x16')][_0xbee9('0x17')]);return _0x2bfd61(_0x5709f3[_0xbee9('0x16')][_0xbee9('0x17')]);}logger[_0xbee9('0x16')](_0xbee9('0x11'),_0x26e749,_0x5709f3[_0xbee9('0x16')][_0xbee9('0x17')]);return _0x7dbc10(_0x5709f3[_0xbee9('0x16')][_0xbee9('0x17')]);}else{logger[_0xbee9('0x10')](_0xbee9('0x11'),_0x26e749,'request\x20sent');_0x7dbc10(_0x5709f3[_0xbee9('0x18')][_0xbee9('0x17')]);}})[_0xbee9('0x19')](function(_0x407a0d){logger[_0xbee9('0x16')](_0xbee9('0x11'),_0x26e749,_0x407a0d);_0x2bfd61(_0x407a0d);});});}exports[_0xbee9('0x1a')]=function(_0x3e822e){var _0xd00612=this;return new Promise(function(_0x314a16,_0xfb6b2f){return db[_0xbee9('0x1b')][_0xbee9('0x1c')](_0x3e822e[_0xbee9('0x1d')],{'raw':_0x3e822e['options']?_0x3e822e['options'][_0xbee9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e822e['options']?_0x3e822e[_0xbee9('0x1f')][_0xbee9('0x20')]||null:null,'attributes':_0x3e822e[_0xbee9('0x1f')]?_0x3e822e[_0xbee9('0x1f')][_0xbee9('0x21')]||null:null,'limit':_0x3e822e[_0xbee9('0x1f')]?_0x3e822e[_0xbee9('0x1f')][_0xbee9('0x22')]||null:null})[_0xbee9('0xf')](function(_0x41b81d){logger['info'](_0xbee9('0x1a'),_0x3e822e);logger['debug']('UpdateFaxInteraction',_0x3e822e,JSON[_0xbee9('0x14')](_0x41b81d));_0x314a16(_0x41b81d);})['catch'](function(_0x64b53e){logger[_0xbee9('0x16')]('UpdateFaxInteraction',_0x64b53e[_0xbee9('0x17')],_0x3e822e);_0xfb6b2f(_0xd00612[_0xbee9('0x16')](0x1f4,_0x64b53e[_0xbee9('0x17')]));});});};exports[_0xbee9('0x23')]=function(_0x105b53){return new Promise(function(_0x2e49a3,_0x120db8){return db[_0xbee9('0x1b')][_0xbee9('0x24')]({'where':_0x105b53[_0xbee9('0x1f')]?_0x105b53[_0xbee9('0x1f')][_0xbee9('0x20')]||null:null})[_0xbee9('0xf')](function(_0xd82c87){if(_0xd82c87){return _0xd82c87[_0xbee9('0x25')](_0x105b53['body']['ids'],_['omit'](_0x105b53['body'],['ids','id'])||{});}})[_0xbee9('0x26')](function(_0xe49cac){logger[_0xbee9('0x10')](_0xbee9('0x27'),_0x105b53);logger['debug'](_0xbee9('0x27'),_0x105b53,JSON[_0xbee9('0x14')](_0xe49cac));_0x2e49a3(_0xe49cac);})[_0xbee9('0x19')](function(_0x32bd24){logger[_0xbee9('0x16')](_0xbee9('0x27'),_0x32bd24['message'],_0x105b53);_0x120db8(_this[_0xbee9('0x16')](0x1f4,_0x32bd24[_0xbee9('0x17')]));});});};
\ No newline at end of file
+var _0xff04=['../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','FaxInteraction','options','raw','attributes','UpdateFaxInteraction','catch','find','addTags','omit','body','ids','AddTags','util','bluebird','randomstring','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff04,0xce));var _0x4ff0=function(_0x7a17c2,_0xd56995){_0x7a17c2=_0x7a17c2-0x0;var _0x13e2f6=_0xff04[_0x7a17c2];return _0x13e2f6;};'use strict';var _=require('lodash');var util=require(_0x4ff0('0x0'));var moment=require('moment');var BPromise=require(_0x4ff0('0x1'));var rs=require(_0x4ff0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4ff0('0x3'));var logger=require(_0x4ff0('0x4'))(_0x4ff0('0x5'));var config=require(_0x4ff0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x4ff0('0x7')],{'host':_0x4ff0('0x8'),'port':0x18eb});var socket=require(_0x4ff0('0x9'))(new Redis(config[_0x4ff0('0x7')]));require('./faxInteraction.socket')[_0x4ff0('0xa')](socket);function respondWithRpcPromise(_0x5af6c5,_0x1b6934,_0x4924c4){return new BPromise(function(_0x43f1e6,_0x2fcbaa){return client[_0x4ff0('0xb')](_0x5af6c5,_0x4924c4)[_0x4ff0('0xc')](function(_0x289486){logger[_0x4ff0('0xd')](_0x4ff0('0xe'),_0x1b6934,'request\x20sent');logger[_0x4ff0('0xf')](_0x4ff0('0x10'),_0x1b6934,_0x4ff0('0x11'),JSON[_0x4ff0('0x12')](_0x289486));if(_0x289486[_0x4ff0('0x13')]){if(_0x289486['error'][_0x4ff0('0x14')]===0x1f4){logger[_0x4ff0('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x1b6934,_0x289486[_0x4ff0('0x13')][_0x4ff0('0x15')]);return _0x2fcbaa(_0x289486[_0x4ff0('0x13')][_0x4ff0('0x15')]);}logger[_0x4ff0('0x13')](_0x4ff0('0xe'),_0x1b6934,_0x289486[_0x4ff0('0x13')][_0x4ff0('0x15')]);return _0x43f1e6(_0x289486[_0x4ff0('0x13')][_0x4ff0('0x15')]);}else{logger[_0x4ff0('0xd')](_0x4ff0('0xe'),_0x1b6934,_0x4ff0('0x11'));_0x43f1e6(_0x289486[_0x4ff0('0x16')][_0x4ff0('0x15')]);}})['catch'](function(_0x3c06cb){logger[_0x4ff0('0x13')](_0x4ff0('0xe'),_0x1b6934,_0x3c06cb);_0x2fcbaa(_0x3c06cb);});});}exports['UpdateFaxInteraction']=function(_0x311ae5){var _0x3a8775=this;return new Promise(function(_0x497c2d,_0x56f4a9){return db[_0x4ff0('0x17')]['update'](_0x311ae5['body'],{'raw':_0x311ae5[_0x4ff0('0x18')]?_0x311ae5[_0x4ff0('0x18')][_0x4ff0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x311ae5[_0x4ff0('0x18')]?_0x311ae5[_0x4ff0('0x18')]['where']||null:null,'attributes':_0x311ae5['options']?_0x311ae5[_0x4ff0('0x18')][_0x4ff0('0x1a')]||null:null,'limit':_0x311ae5[_0x4ff0('0x18')]?_0x311ae5[_0x4ff0('0x18')]['limit']||null:null})[_0x4ff0('0xc')](function(_0x1a0615){logger[_0x4ff0('0xd')](_0x4ff0('0x1b'),_0x311ae5);logger[_0x4ff0('0xf')](_0x4ff0('0x1b'),_0x311ae5,JSON['stringify'](_0x1a0615));_0x497c2d(_0x1a0615);})[_0x4ff0('0x1c')](function(_0x46e8d9){logger[_0x4ff0('0x13')]('UpdateFaxInteraction',_0x46e8d9[_0x4ff0('0x15')],_0x311ae5);_0x56f4a9(_0x3a8775[_0x4ff0('0x13')](0x1f4,_0x46e8d9[_0x4ff0('0x15')]));});});};exports['AddTagsToFaxInteraction']=function(_0x306685){return new Promise(function(_0x8d0787,_0x5d3cbb){return db['FaxInteraction'][_0x4ff0('0x1d')]({'where':_0x306685['options']?_0x306685['options']['where']||null:null})['then'](function(_0x5ae23c){if(_0x5ae23c){return _0x5ae23c[_0x4ff0('0x1e')](_0x306685['body']['ids'],_[_0x4ff0('0x1f')](_0x306685[_0x4ff0('0x20')],[_0x4ff0('0x21'),'id'])||{});}})['spread'](function(_0x569a38){logger[_0x4ff0('0xd')](_0x4ff0('0x22'),_0x306685);logger[_0x4ff0('0xf')]('AddTags',_0x306685,JSON[_0x4ff0('0x12')](_0x569a38));_0x8d0787(_0x569a38);})[_0x4ff0('0x1c')](function(_0x2d26e2){logger[_0x4ff0('0x13')]('AddTags',_0x2d26e2[_0x4ff0('0x15')],_0x306685);_0x5d3cbb(_this['error'](0x1f4,_0x2d26e2[_0x4ff0('0x15')]));});});};
\ No newline at end of file
index f43f846..5e59bf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa168=['update','emit','register','faxInteraction:','./faxInteraction.events','save'];(function(_0x3c85a4,_0xc9c6c){var _0x2cc92a=function(_0x5d2f7c){while(--_0x5d2f7c){_0x3c85a4['push'](_0x3c85a4['shift']());}};_0x2cc92a(++_0xc9c6c);}(_0xa168,0x136));var _0x8a16=function(_0x46b7c4,_0x119ebc){_0x46b7c4=_0x46b7c4-0x0;var _0x7ab83=_0xa168[_0x46b7c4];return _0x7ab83;};'use strict';var FaxInteractionEvents=require(_0x8a16('0x0'));var events=[_0x8a16('0x1'),'remove',_0x8a16('0x2')];function createListener(_0x102347,_0x5bb5b0){return function(_0x2e5356){_0x5bb5b0[_0x8a16('0x3')](_0x102347,_0x2e5356);};}function removeListener(_0x5ae8f1,_0x3e9cc8){return function(){FaxInteractionEvents['removeListener'](_0x5ae8f1,_0x3e9cc8);};}exports[_0x8a16('0x4')]=function(_0x110480){for(var _0x15e208=0x0,_0x44df57=events['length'];_0x15e208<_0x44df57;_0x15e208++){var _0x4159b6=events[_0x15e208];var _0x2e30f9=createListener(_0x8a16('0x5')+_0x4159b6,_0x110480);FaxInteractionEvents['on'](_0x4159b6,_0x2e30f9);}};
\ No newline at end of file
+var _0x66a5=['faxInteraction:','./faxInteraction.events','save','remove','update','emit','register','length'];(function(_0x11aaf9,_0x276a82){var _0x6bcddc=function(_0x37cc8b){while(--_0x37cc8b){_0x11aaf9['push'](_0x11aaf9['shift']());}};_0x6bcddc(++_0x276a82);}(_0x66a5,0x1b1));var _0x566a=function(_0x25e934,_0x4757dd){_0x25e934=_0x25e934-0x0;var _0x162c25=_0x66a5[_0x25e934];return _0x162c25;};'use strict';var FaxInteractionEvents=require(_0x566a('0x0'));var events=[_0x566a('0x1'),_0x566a('0x2'),_0x566a('0x3')];function createListener(_0x137a79,_0x25ffa8){return function(_0xfbc7d0){_0x25ffa8[_0x566a('0x4')](_0x137a79,_0xfbc7d0);};}function removeListener(_0x1662ee,_0x807fcb){return function(){FaxInteractionEvents['removeListener'](_0x1662ee,_0x807fcb);};}exports[_0x566a('0x5')]=function(_0x1c4f07){for(var _0x2080fc=0x0,_0x4cba49=events[_0x566a('0x6')];_0x2080fc<_0x4cba49;_0x2080fc++){var _0x56c752=events[_0x2080fc];var _0x590fdc=createListener(_0x566a('0x7')+_0x56c752,_0x1c4f07);FaxInteractionEvents['on'](_0x56c752,_0x590fdc);}};
\ No newline at end of file
index 22e78fc..c228ecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4422=['destroy','removeTags','exports','multer','connect-timeout','Router','../../components/auth/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','tracked','fax','faxinteraction:addtags','put','update','delete','faxinteraction:destroy'];(function(_0x2bc30d,_0x2c30e7){var _0xa39891=function(_0x28707d){while(--_0x28707d){_0x2bc30d['push'](_0x2bc30d['shift']());}};_0xa39891(++_0x2c30e7);}(_0x4422,0xab));var _0x2442=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4422[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x2442('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2442('0x1'));var express=require('express');var router=express[_0x2442('0x2')]();var auth=require(_0x2442('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2442('0x4'));router[_0x2442('0x5')]('/',auth[_0x2442('0x6')](),controller[_0x2442('0x7')]);router['get'](_0x2442('0x8'),auth[_0x2442('0x6')](),controller[_0x2442('0x9')]);router[_0x2442('0x5')](_0x2442('0xa'),auth[_0x2442('0x6')](),controller['show']);router[_0x2442('0x5')](_0x2442('0xb'),auth[_0x2442('0x6')](),controller[_0x2442('0xc')]);router[_0x2442('0x5')](_0x2442('0xd'),auth[_0x2442('0x6')](),controller[_0x2442('0xe')]);router['post']('/',auth[_0x2442('0x6')](),controller[_0x2442('0xf')]);router[_0x2442('0x10')](_0x2442('0xb'),auth[_0x2442('0x6')](),controller[_0x2442('0x11')]);router[_0x2442('0x10')]('/:id/tags',auth[_0x2442('0x6')](),interaction[_0x2442('0x12')](_0x2442('0x13'),_0x2442('0x14')),controller['addTags']);router[_0x2442('0x15')](_0x2442('0xa'),auth['isAuthenticated'](),interaction[_0x2442('0x12')](_0x2442('0x13'),'faxinteraction:update'),controller[_0x2442('0x16')]);router[_0x2442('0x17')](_0x2442('0xa'),auth[_0x2442('0x6')](),interaction[_0x2442('0x12')]('fax',_0x2442('0x18')),controller[_0x2442('0x19')]);router[_0x2442('0x17')]('/:id/tags',auth[_0x2442('0x6')](),controller[_0x2442('0x1a')]);module[_0x2442('0x1b')]=router;
\ No newline at end of file
+var _0xfb3f=['put','faxinteraction:update','update','delete','destroy','removeTags','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags'];(function(_0x262081,_0x40ab09){var _0x1826ba=function(_0x164b27){while(--_0x164b27){_0x262081['push'](_0x262081['shift']());}};_0x1826ba(++_0x40ab09);}(_0xfb3f,0xd9));var _0xffb3=function(_0x4c3b5c,_0x1da01e){_0x4c3b5c=_0x4c3b5c-0x0;var _0xa08c3=_0xfb3f[_0x4c3b5c];return _0xa08c3;};'use strict';var multer=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var path=require('path');var timeout=require(_0xffb3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xffb3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xffb3('0x4'));var controller=require(_0xffb3('0x5'));router[_0xffb3('0x6')]('/',auth[_0xffb3('0x7')](),controller[_0xffb3('0x8')]);router[_0xffb3('0x6')](_0xffb3('0x9'),auth[_0xffb3('0x7')](),controller['describe']);router[_0xffb3('0x6')](_0xffb3('0xa'),auth[_0xffb3('0x7')](),controller[_0xffb3('0xb')]);router[_0xffb3('0x6')]('/:id/messages',auth[_0xffb3('0x7')](),controller[_0xffb3('0xc')]);router[_0xffb3('0x6')](_0xffb3('0xd'),auth[_0xffb3('0x7')](),controller[_0xffb3('0xe')]);router[_0xffb3('0xf')]('/',auth[_0xffb3('0x7')](),controller['create']);router[_0xffb3('0xf')](_0xffb3('0x10'),auth['isAuthenticated'](),controller[_0xffb3('0x11')]);router[_0xffb3('0xf')](_0xffb3('0x12'),auth[_0xffb3('0x7')](),interaction[_0xffb3('0x13')](_0xffb3('0x14'),_0xffb3('0x15')),controller[_0xffb3('0x16')]);router[_0xffb3('0x17')](_0xffb3('0xa'),auth[_0xffb3('0x7')](),interaction[_0xffb3('0x13')]('fax',_0xffb3('0x18')),controller[_0xffb3('0x19')]);router[_0xffb3('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0xffb3('0x13')](_0xffb3('0x14'),'faxinteraction:destroy'),controller[_0xffb3('0x1b')]);router[_0xffb3('0x1a')](_0xffb3('0x12'),auth['isAuthenticated'](),controller[_0xffb3('0x1c')]);module[_0xffb3('0x1d')]=router;
\ No newline at end of file
index 8263a30..bb14ba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2cf=['sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x5de446,_0x1f888d){var _0x36ebb0=function(_0xac263e){while(--_0xac263e){_0x5de446['push'](_0x5de446['shift']());}};_0x36ebb0(++_0x1f888d);}(_0xf2cf,0xcc));var _0xff2c=function(_0x39c7e1,_0x511861){_0x39c7e1=_0x39c7e1-0x0;var _0x3e1929=_0xf2cf[_0x39c7e1];return _0x3e1929;};'use strict';var Sequelize=require(_0xff2c('0x0'));module[_0xff2c('0x1')]={'body':{'type':Sequelize[_0xff2c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xff2c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xff2c('0x4')]('in',_0xff2c('0x5')),'defaultValue':_0xff2c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xff2c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x5486=['out','DATE','exports','TEXT','BOOLEAN'];(function(_0x2012f2,_0x2c92c9){var _0x10973a=function(_0xdf474d){while(--_0xdf474d){_0x2012f2['push'](_0x2012f2['shift']());}};_0x10973a(++_0x2c92c9);}(_0x5486,0x129));var _0x6548=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5486[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6548('0x0')]={'body':{'type':Sequelize[_0x6548('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6548('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6548('0x3')),'defaultValue':_0x6548('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6548('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6548('0x4')]}};
\ No newline at end of file
index 9134348..e808add 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63b5=['null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','EventManager','acceptmessage','reject','FaxInteractionId','role','RejectMessage','rejectMessage','event','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','attachments','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','include','findAll','rows','show','params','FaxMessage','fields','includeAll','options','update','body','find','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt','interaction','get'];(function(_0x32a2f5,_0x4eae7c){var _0x849480=function(_0x2ebe45){while(--_0x2ebe45){_0x32a2f5['push'](_0x32a2f5['shift']());}};_0x849480(++_0x4eae7c);}(_0x63b5,0x12f));var _0x563b=function(_0x54ca36,_0x246e11){_0x54ca36=_0x54ca36-0x0;var _0x22e652=_0x63b5[_0x54ca36];return _0x22e652;};'use strict';var pdf=require(_0x563b('0x0'));var emlformat=require(_0x563b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x563b('0x2'));var jsonpatch=require(_0x563b('0x3'));var rp=require(_0x563b('0x4'));var moment=require(_0x563b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x563b('0x6'));var path=require(_0x563b('0x7'));var sox=require(_0x563b('0x8'));var csv=require('to-csv');var ejs=require(_0x563b('0x9'));var fs=require('fs');var _=require(_0x563b('0xa'));var squel=require(_0x563b('0xb'));var crypto=require('crypto');var jsforce=require(_0x563b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x563b('0xd'));var querystring=require('querystring');var Papa=require(_0x563b('0xe'));var Redis=require(_0x563b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x563b('0x10'));var logger=require(_0x563b('0x11'))(_0x563b('0x12'));var utils=require(_0x563b('0x13'));var config=require('../../config/environment');var db=require(_0x563b('0x14'))['db'];config[_0x563b('0x15')]=_[_0x563b('0x16')](config[_0x563b('0x15')],{'host':_0x563b('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0x563b('0x18')](socket);var jayson=require(_0x563b('0x19'));var client=jayson['client'][_0x563b('0x1a')]({'port':0x232c});var client9002=jayson[_0x563b('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x47a885,_0x4d94fd,_0x40f813){if(_0x40f813){var _0x419efb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x419efb[_0x563b('0x1c')](_0x4d94fd)){return _0x47a885;}else{throw new db[(_0x563b('0x1d'))][(_0x563b('0x1e'))](_0x563b('0x1f'));}}else{return _0x47a885;}}function respondWithRpcPromise(_0x86b1a6,_0x2236cd,_0x542af7,_0x265f2b){return new BPromise(function(_0x52a189,_0x41834c){var _0x1a9aa9=_0x265f2b||client;return _0x1a9aa9[_0x563b('0x20')](_0x86b1a6,_0x542af7)[_0x563b('0x21')](function(_0x2b12bf){logger[_0x563b('0x22')](_0x563b('0x23'),_0x2236cd,_0x563b('0x24'));logger['debug'](_0x563b('0x25'),_0x2236cd,_0x563b('0x24'),JSON[_0x563b('0x26')](_0x2b12bf));if(_0x2b12bf[_0x563b('0x27')]){if(_0x2b12bf[_0x563b('0x27')][_0x563b('0x28')]===0x1f4){logger[_0x563b('0x27')]('FaxMessage,\x20%s,\x20%s',_0x2236cd,_0x2b12bf['error'][_0x563b('0x29')]);return _0x41834c(_0x2b12bf['error'][_0x563b('0x29')]);}logger[_0x563b('0x27')](_0x563b('0x23'),_0x2236cd,_0x2b12bf[_0x563b('0x27')][_0x563b('0x29')]);return _0x52a189(_0x2b12bf['error'][_0x563b('0x29')]);}else{logger[_0x563b('0x22')](_0x563b('0x23'),_0x2236cd,_0x563b('0x24'));_0x52a189(_0x2b12bf[_0x563b('0x2a')][_0x563b('0x29')]);}})[_0x563b('0x2b')](function(_0x4e3fa5){logger[_0x563b('0x27')](_0x563b('0x23'),_0x2236cd,_0x4e3fa5);_0x41834c(_0x4e3fa5);});});}function respondWithStatusCode(_0x461d6f,_0x949cbc){_0x949cbc=_0x949cbc||0xcc;return function(_0x13a8c1){if(_0x13a8c1){return _0x461d6f[_0x563b('0x2c')](_0x949cbc);}return _0x461d6f[_0x563b('0x2d')](_0x949cbc)[_0x563b('0x2e')]();};}function respondWithResult(_0x277724,_0x5c6f3f){_0x5c6f3f=_0x5c6f3f||0xc8;return function(_0x576c76){if(_0x576c76){return _0x277724[_0x563b('0x2d')](_0x5c6f3f)[_0x563b('0x2f')](_0x576c76);}};}function respondWithFilteredResult(_0x4bef5d,_0x5c592a){return function(_0x25a0ba){if(_0x25a0ba){var _0x1ec610=_0x25a0ba[_0x563b('0x30')],_0x542308=_0x5c592a['offset'],_0xefc464=_0x5c592a[_0x563b('0x31')]+_0x5c592a[_0x563b('0x32')],_0x347166;if(_0xefc464>=_0x1ec610){_0xefc464=_0x1ec610;_0x347166=0xc8;}else{_0x347166=0xce;}_0x4bef5d[_0x563b('0x2d')](_0x347166);return _0x4bef5d[_0x563b('0x33')](_0x563b('0x34'),_0x542308+'-'+_0xefc464+'/'+_0x1ec610)[_0x563b('0x2f')](_0x25a0ba);}return null;};}function patchUpdates(_0xe163f6){return function(_0x4aea8d){try{jsonpatch[_0x563b('0x35')](_0x4aea8d,_0xe163f6,!![]);}catch(_0x29170c){return BPromise['reject'](_0x29170c);}return _0x4aea8d[_0x563b('0x36')]();};}function saveUpdates(_0x3404a0,_0x407785){return function(_0x3e1210){if(_0x3e1210){return _0x3e1210['update'](_0x3404a0)['then'](function(_0x23ae19){return _0x23ae19;});}return null;};}function removeEntity(_0x4cbf75,_0x36b497){return function(_0x700c3b){if(_0x700c3b){return _0x700c3b[_0x563b('0x37')]()[_0x563b('0x21')](function(){_0x4cbf75[_0x563b('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f262,_0x245810){return function(_0x1bc239){if(!_0x1bc239){_0x58f262[_0x563b('0x2c')](0x194);}return _0x1bc239;};}function handleError(_0x18278c,_0x2ffa9a){_0x2ffa9a=_0x2ffa9a||0x1f4;return function(_0x47c4b9){logger[_0x563b('0x27')](_0x47c4b9[_0x563b('0x38')]);if(_0x47c4b9[_0x563b('0x39')]){delete _0x47c4b9[_0x563b('0x39')];}_0x18278c[_0x563b('0x2d')](_0x2ffa9a)[_0x563b('0x3a')](_0x47c4b9);};}exports[_0x563b('0x3b')]=function(_0xa5a7a2,_0x3a6e74){var _0x305603={},_0x2e87fc={},_0x534274={'count':0x0,'rows':[]};var _0x1d726f=_['map'](db['FaxMessage'][_0x563b('0x3c')],function(_0x6b00d2){return{'name':_0x6b00d2[_0x563b('0x3d')],'type':_0x6b00d2[_0x563b('0x3e')][_0x563b('0x3f')]};});_0x2e87fc[_0x563b('0x40')]=_[_0x563b('0x41')](_0x1d726f,'name');_0x2e87fc[_0x563b('0x42')]=_[_0x563b('0x43')](_0xa5a7a2[_0x563b('0x42')]);_0x2e87fc[_0x563b('0x44')]=_['intersection'](_0x2e87fc[_0x563b('0x40')],_0x2e87fc[_0x563b('0x42')]);_0x305603[_0x563b('0x45')]=_[_0x563b('0x46')](_0x2e87fc['model'],qs['fields'](_0xa5a7a2[_0x563b('0x42')]['fields']));_0x305603['attributes']=_0x305603[_0x563b('0x45')][_0x563b('0x47')]?_0x305603['attributes']:_0x2e87fc[_0x563b('0x40')];if(!_0xa5a7a2['query'][_0x563b('0x48')](_0x563b('0x49'))){_0x305603['limit']=qs[_0x563b('0x32')](_0xa5a7a2['query'][_0x563b('0x32')]);_0x305603[_0x563b('0x31')]=qs[_0x563b('0x31')](_0xa5a7a2['query'][_0x563b('0x31')]);}_0x305603[_0x563b('0x4a')]=qs[_0x563b('0x4b')](_0xa5a7a2[_0x563b('0x42')][_0x563b('0x4b')]);_0x305603['where']=qs[_0x563b('0x44')](_[_0x563b('0x4c')](_0xa5a7a2[_0x563b('0x42')],_0x2e87fc[_0x563b('0x44')]),_0x1d726f);if(_0xa5a7a2[_0x563b('0x42')]['filter']){_0x305603[_0x563b('0x4d')]=_[_0x563b('0x4e')](_0x305603[_0x563b('0x4d')],{'$or':_[_0x563b('0x41')](_0x1d726f,function(_0x4a722b){if(_0x4a722b[_0x563b('0x3e')]!==_0x563b('0x4f')){var _0x33197b={};_0x33197b[_0x4a722b[_0x563b('0x39')]]={'$like':'%'+_0xa5a7a2[_0x563b('0x42')]['filter']+'%'};return _0x33197b;}})});}_0x305603=_['merge']({},_0x305603,_0xa5a7a2['options']);var _0x1e0d45={'where':_0x305603[_0x563b('0x4d')]};return db['FaxMessage'][_0x563b('0x30')](_0x1e0d45)['then'](function(_0x2dd82d){_0x534274[_0x563b('0x30')]=_0x2dd82d;if(_0xa5a7a2['query']['includeAll']){_0x305603[_0x563b('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x563b('0x51')](_0x305603);})[_0x563b('0x21')](function(_0x101443){_0x534274[_0x563b('0x52')]=_0x101443;return _0x534274;})[_0x563b('0x21')](respondWithFilteredResult(_0x3a6e74,_0x305603))[_0x563b('0x2b')](handleError(_0x3a6e74,null));};exports[_0x563b('0x53')]=function(_0x3b425,_0x1f676a){var _0x577e1c={'raw':!![],'where':{'id':_0x3b425[_0x563b('0x54')]['id']}},_0x409b76={};_0x409b76['model']=_[_0x563b('0x43')](db[_0x563b('0x55')][_0x563b('0x3c')]);_0x409b76[_0x563b('0x42')]=_['keys'](_0x3b425[_0x563b('0x42')]);_0x409b76[_0x563b('0x44')]=_[_0x563b('0x46')](_0x409b76['model'],_0x409b76[_0x563b('0x42')]);_0x577e1c[_0x563b('0x45')]=_[_0x563b('0x46')](_0x409b76[_0x563b('0x40')],qs[_0x563b('0x56')](_0x3b425[_0x563b('0x42')]['fields']));_0x577e1c['attributes']=_0x577e1c['attributes'][_0x563b('0x47')]?_0x577e1c[_0x563b('0x45')]:_0x409b76[_0x563b('0x40')];if(_0x3b425[_0x563b('0x42')][_0x563b('0x57')]){_0x577e1c[_0x563b('0x50')]=[{'all':!![]}];}_0x577e1c=_[_0x563b('0x4e')]({},_0x577e1c,_0x3b425[_0x563b('0x58')]);return db[_0x563b('0x55')]['find'](_0x577e1c)['then'](handleEntityNotFound(_0x1f676a,null))[_0x563b('0x21')](respondWithResult(_0x1f676a,null))[_0x563b('0x2b')](handleError(_0x1f676a,null));};exports[_0x563b('0x59')]=function(_0x27c37e,_0x51cec6){if(_0x27c37e['body']['id']){delete _0x27c37e[_0x563b('0x5a')]['id'];}return db['FaxMessage'][_0x563b('0x5b')]({'where':{'id':_0x27c37e[_0x563b('0x54')]['id']}})['then'](handleEntityNotFound(_0x51cec6,null))[_0x563b('0x21')](saveUpdates(_0x27c37e['body'],null))[_0x563b('0x21')](respondWithResult(_0x51cec6,null))[_0x563b('0x2b')](handleError(_0x51cec6,null));};exports['destroy']=function(_0x45eea1,_0x331b0f){return db[_0x563b('0x55')][_0x563b('0x5b')]({'where':{'id':_0x45eea1[_0x563b('0x54')]['id']}})['then'](handleEntityNotFound(_0x331b0f,null))['then'](removeEntity(_0x331b0f,null))[_0x563b('0x2b')](handleError(_0x331b0f,null));};exports[_0x563b('0x5c')]=function(_0xd6c6ef,_0x3955ab){return db[_0x563b('0x55')][_0x563b('0x5c')]()[_0x563b('0x21')](respondWithResult(_0x3955ab,null))[_0x563b('0x2b')](handleError(_0x3955ab,null));};var interaction_log=require(_0x563b('0x11'))(_0x563b('0x5d'));exports[_0x563b('0x5e')]=function(_0x190ec7,_0x26577a,_0x55c43a){var _0x210297={'channel':_0x563b('0x5f')};if(_0x190ec7['body']['id']){delete _0x190ec7[_0x563b('0x5a')]['id'];}_0x190ec7[_0x563b('0x5a')]['read']=!![];_0x190ec7[_0x563b('0x5a')][_0x563b('0x60')]=moment()[_0x563b('0x61')](_0x563b('0x62'));_0x190ec7[_0x563b('0x5a')][_0x563b('0x63')]=_0x190ec7[_0x563b('0x5a')][_0x563b('0x63')]||_0x190ec7[_0x563b('0x64')]['id'];return db['FaxMessage']['find']({'where':{'id':_0x190ec7[_0x563b('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x563b('0x65')],'as':_0x563b('0x66')}]})[_0x563b('0x21')](handleEntityNotFound(_0x26577a,null))[_0x563b('0x21')](saveUpdates(_0x190ec7[_0x563b('0x5a')],null))['then'](function(_0x3b3aaf){if(_0x3b3aaf){_0x210297[_0x563b('0x29')]=_0x3b3aaf['get']({'plain':!![]});return db[_0x563b('0x67')][_0x563b('0x5b')]({'where':{'id':_0x3b3aaf['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x26577a,null))[_0x563b('0x21')](function(_0x36d3fe){if(_0x36d3fe){return _0x36d3fe[_0x563b('0x59')]({'UserId':_0x190ec7[_0x563b('0x5a')][_0x563b('0x63')],'read1stAt':_[_0x563b('0x68')](_0x36d3fe[_0x563b('0x69')])?moment()[_0x563b('0x61')](_0x563b('0x62')):undefined});}return null;})['then'](function(_0x2f9ee1){if(_0x2f9ee1){_0x210297[_0x563b('0x6a')]=_0x2f9ee1[_0x563b('0x6b')]({'plain':!![]});interaction_log[_0x563b('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x190ec7['user']['id'],_0x190ec7[_0x563b('0x64')][_0x563b('0x39')],_0x190ec7[_0x563b('0x64')]['role'],_0x210297['interaction']['id'],_0x190ec7[_0x563b('0x5a')]?JSON['stringify'](_0x190ec7[_0x563b('0x5a')]):_0x563b('0x6c'));return respondWithRpcPromise(_0x563b('0x6d'),_0x563b('0x6e'),_0x210297);}return null;})['then'](function(_0x15ce50){if(_0x15ce50){if(_0x190ec7[_0x563b('0x5a')]['manual']){_0x210297['message'][_0x563b('0x6f')]=util['format'](_0x563b('0x70'),_0x190ec7[_0x563b('0x64')][_0x563b('0x39')]);_0x210297[_0x563b('0x29')][_0x563b('0x71')]=_0x210297[_0x563b('0x71')];_0x210297[_0x563b('0x29')]['event']='accept';return respondWithRpcPromise('EventManager',_0x563b('0x72'),{'event':_0x563b('0x73'),'message':_0x210297['message']},client9002)[_0x563b('0x21')](function(){return _0x210297;});}return _0x210297;}return null;})[_0x563b('0x21')](respondWithResult(_0x26577a,null))[_0x563b('0x2b')](handleError(_0x26577a,null));};var interaction_log=require(_0x563b('0x11'))(_0x563b('0x5d'));exports[_0x563b('0x74')]=function(_0x287758,_0x5698c1,_0x4d7e10){var _0xb0dfa8={'agent':{},'channel':_0x563b('0x5f')};if(_0x287758[_0x563b('0x5a')]['id']){delete _0x287758[_0x563b('0x5a')]['id'];}_0x287758[_0x563b('0x5a')][_0x563b('0x63')]=_0x287758[_0x563b('0x5a')][_0x563b('0x63')]||_0x287758[_0x563b('0x64')]['id'];_0xb0dfa8['agent']['id']=_0x287758[_0x563b('0x5a')][_0x563b('0x63')];return db['FaxMessage']['find']({'where':{'id':_0x287758[_0x563b('0x54')]['id'],'UserId':null}})[_0x563b('0x21')](handleEntityNotFound(_0x5698c1,null))['then'](function(_0xd65bb0){if(_0xd65bb0){_0xb0dfa8[_0x563b('0x29')]=_0xd65bb0[_0x563b('0x6b')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0xd65bb0[_0x563b('0x75')]}});}return null;})[_0x563b('0x21')](handleEntityNotFound(_0x5698c1,null))[_0x563b('0x21')](function(_0x405eaa){if(_0x405eaa){_0xb0dfa8[_0x563b('0x6a')]=_0x405eaa[_0x563b('0x6b')]({'plain':!![]});interaction_log[_0x563b('0x22')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x287758[_0x563b('0x64')]['id'],_0x287758[_0x563b('0x64')][_0x563b('0x39')],_0x287758[_0x563b('0x64')][_0x563b('0x76')],_0xb0dfa8[_0x563b('0x6a')]['id'],_0x287758[_0x563b('0x5a')]?JSON[_0x563b('0x26')](_0x287758[_0x563b('0x5a')]):'null');return respondWithRpcPromise(_0x563b('0x77'),_0x563b('0x78'),_0xb0dfa8);}return null;})['then'](function(_0x2a1f56){if(_0x2a1f56){_0x2a1f56[_0x563b('0x29')][_0x563b('0x6f')]=util['format'](_0x563b('0x70'),_0x287758[_0x563b('0x64')][_0x563b('0x39')]);_0x2a1f56[_0x563b('0x29')][_0x563b('0x71')]=_0xb0dfa8[_0x563b('0x71')];_0x2a1f56[_0x563b('0x29')][_0x563b('0x79')]=_0x563b('0x74');respondWithRpcPromise(_0x563b('0x72'),'EventManager',{'event':_0x563b('0x7a'),'message':_0x2a1f56[_0x563b('0x29')]},client9002);return _0xb0dfa8;}return null;})[_0x563b('0x21')](respondWithResult(_0x5698c1,null))[_0x563b('0x2b')](handleError(_0x5698c1,null));};exports[_0x563b('0x7b')]=function(_0x515878,_0x2c7aa5){var _0x11f3e9;return db[_0x563b('0x55')][_0x563b('0x7b')](_0x515878[_0x563b('0x5a')],{})[_0x563b('0x21')](function(_0x410866){_0x11f3e9=_0x410866;return db[_0x563b('0x65')][_0x563b('0x7c')]({'where':{'id':_0x11f3e9[_0x563b('0x7d')]}});})[_0x563b('0x21')](function(_0x19a5cd){if(_[_0x563b('0x68')](_0x19a5cd)){return;}else{_0x11f3e9[_0x563b('0x5f')]=_0x19a5cd[_0x563b('0x5f')];return db[_0x563b('0x7e')]['findOne']({'where':{'id':_0x11f3e9[_0x563b('0x7f')]}});}})[_0x563b('0x21')](function(_0x28d981){return respondWithRpcPromise(_0x563b('0x80'),'SendFax',{'FaxAccountId':_[_0x563b('0x68')](_0x515878[_0x563b('0x5a')])?undefined:_0x515878['body'][_0x563b('0x81')],'path':_[_0x563b('0x68')](_0x28d981)?undefined:util[_0x563b('0x61')](_0x563b('0x82'),_0x28d981[_0x563b('0x83')]),'fax':_['isNil'](_0x11f3e9[_0x563b('0x5f')])?undefined:_0x11f3e9[_0x563b('0x5f')],'AttachmentId':_0x11f3e9[_0x563b('0x7f')]},client9002);})[_0x563b('0x21')](respondWithResult(_0x2c7aa5,0xc9))[_0x563b('0x2b')](handleError(_0x2c7aa5,null));};exports[_0x563b('0x84')]=function(_0xadb2f9,_0x10698b){var _0x3f56cf=path[_0x563b('0x85')](config[_0x563b('0x86')],'server',_0x563b('0x87'),_0x563b('0x88'));return db['FaxMessage']['find']({'where':{'id':_0xadb2f9[_0x563b('0x54')]['id']},'include':[{'model':db[_0x563b('0x7e')],'as':_0x563b('0x7e')}]})[_0x563b('0x21')](handleEntityNotFound(_0x10698b,null))[_0x563b('0x21')](function(_0x4ec151){if(_0x4ec151){return _0x10698b[_0x563b('0x84')](path[_0x563b('0x85')](_0x3f56cf,_0x4ec151[_0x563b('0x7e')][_0x563b('0x83')]));}})[_0x563b('0x2b')](handleError(_0x10698b,null));};
\ No newline at end of file
+var _0x500e=['../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','index','FaxMessage','rawAttributes','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','Contact','FaxInteraction','FaxInteractionId','update','UserId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','create','CmContact','findOne','ContactId','Attachment','AttachmentId','SendFax','basename','download','root','files','attachments','join','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5e690b,_0x5ed4b7){var _0x15681e=function(_0xe60d3d){while(--_0xe60d3d){_0x5e690b['push'](_0x5e690b['shift']());}};_0x15681e(++_0x5ed4b7);}(_0x500e,0x1ec));var _0xe500=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x500e[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0xe500('0x0'));var emlformat=require(_0xe500('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe500('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe500('0x3'));var Mustache=require(_0xe500('0x4'));var util=require(_0xe500('0x5'));var path=require(_0xe500('0x6'));var sox=require(_0xe500('0x7'));var csv=require(_0xe500('0x8'));var ejs=require(_0xe500('0x9'));var fs=require('fs');var _=require(_0xe500('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe500('0xb'));var deskjs=require(_0xe500('0xc'));var toCsv=require(_0xe500('0x8'));var querystring=require(_0xe500('0xd'));var Papa=require(_0xe500('0xe'));var Redis=require('ioredis');var authService=require(_0xe500('0xf'));var qs=require(_0xe500('0x10'));var as=require(_0xe500('0x11'));var hardwareService=require(_0xe500('0x12'));var logger=require(_0xe500('0x13'))('api');var utils=require(_0xe500('0x14'));var config=require(_0xe500('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe500('0x16')](config[_0xe500('0x17')],{'host':_0xe500('0x18'),'port':0x18eb});var socket=require(_0xe500('0x19'))(new Redis(config[_0xe500('0x17')]));require('./faxMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe500('0x1a')][_0xe500('0x1b')]({'port':0x232c});var client9002=jayson[_0xe500('0x1a')][_0xe500('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3ae75d,_0x2fa300,_0x2b37bc){if(_0x2b37bc){var _0xb123f3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb123f3[_0xe500('0x1c')](_0x2fa300)){return _0x3ae75d;}else{throw new db[(_0xe500('0x1d'))]['ValidationError'](_0xe500('0x1e'));}}else{return _0x3ae75d;}}function respondWithRpcPromise(_0xddbc17,_0x2f7397,_0x1baacd,_0x29bbd0){return new BPromise(function(_0x39c1de,_0x4634b1){var _0x1cf2cc=_0x29bbd0||client;return _0x1cf2cc['request'](_0xddbc17,_0x1baacd)[_0xe500('0x1f')](function(_0x5b4472){logger[_0xe500('0x20')](_0xe500('0x21'),_0x2f7397,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2f7397,_0xe500('0x22'),JSON[_0xe500('0x23')](_0x5b4472));if(_0x5b4472['error']){if(_0x5b4472[_0xe500('0x24')]['code']===0x1f4){logger[_0xe500('0x24')](_0xe500('0x21'),_0x2f7397,_0x5b4472[_0xe500('0x24')][_0xe500('0x25')]);return _0x4634b1(_0x5b4472[_0xe500('0x24')]['message']);}logger[_0xe500('0x24')](_0xe500('0x21'),_0x2f7397,_0x5b4472['error'][_0xe500('0x25')]);return _0x39c1de(_0x5b4472[_0xe500('0x24')]['message']);}else{logger[_0xe500('0x20')](_0xe500('0x21'),_0x2f7397,_0xe500('0x22'));_0x39c1de(_0x5b4472[_0xe500('0x26')]['message']);}})[_0xe500('0x27')](function(_0x49c6a8){logger[_0xe500('0x24')](_0xe500('0x21'),_0x2f7397,_0x49c6a8);_0x4634b1(_0x49c6a8);});});}function respondWithStatusCode(_0x2e8ab6,_0x17fb23){_0x17fb23=_0x17fb23||0xcc;return function(_0x9741d5){if(_0x9741d5){return _0x2e8ab6[_0xe500('0x28')](_0x17fb23);}return _0x2e8ab6['status'](_0x17fb23)[_0xe500('0x29')]();};}function respondWithResult(_0x14d65d,_0x5a38ef){_0x5a38ef=_0x5a38ef||0xc8;return function(_0x30d5c5){if(_0x30d5c5){return _0x14d65d[_0xe500('0x2a')](_0x5a38ef)['json'](_0x30d5c5);}};}function respondWithFilteredResult(_0x3ada29,_0x562323){return function(_0x4044db){if(_0x4044db){var _0x2c5ffe=_0x4044db[_0xe500('0x2b')],_0x42e2d1=_0x562323[_0xe500('0x2c')],_0x17cd5a=_0x562323['offset']+_0x562323[_0xe500('0x2d')],_0x227c28;if(_0x17cd5a>=_0x2c5ffe){_0x17cd5a=_0x2c5ffe;_0x227c28=0xc8;}else{_0x227c28=0xce;}_0x3ada29[_0xe500('0x2a')](_0x227c28);return _0x3ada29[_0xe500('0x2e')](_0xe500('0x2f'),_0x42e2d1+'-'+_0x17cd5a+'/'+_0x2c5ffe)[_0xe500('0x30')](_0x4044db);}return null;};}function patchUpdates(_0x25cbaa){return function(_0x25f31c){try{jsonpatch[_0xe500('0x31')](_0x25f31c,_0x25cbaa,!![]);}catch(_0x2e9658){return BPromise[_0xe500('0x32')](_0x2e9658);}return _0x25f31c[_0xe500('0x33')]();};}function saveUpdates(_0x34b69d,_0x49816c){return function(_0x1629d3){if(_0x1629d3){return _0x1629d3['update'](_0x34b69d)[_0xe500('0x1f')](function(_0x2c8456){return _0x2c8456;});}return null;};}function removeEntity(_0x488e26,_0x4427c0){return function(_0x137719){if(_0x137719){return _0x137719[_0xe500('0x34')]()[_0xe500('0x1f')](function(){_0x488e26[_0xe500('0x2a')](0xcc)[_0xe500('0x29')]();});}};}function handleEntityNotFound(_0x3234f8,_0x1cab8d){return function(_0x37b107){if(!_0x37b107){_0x3234f8[_0xe500('0x28')](0x194);}return _0x37b107;};}function handleError(_0x5e2342,_0x237fa6){_0x237fa6=_0x237fa6||0x1f4;return function(_0x56ae53){logger[_0xe500('0x24')](_0x56ae53[_0xe500('0x35')]);if(_0x56ae53[_0xe500('0x36')]){delete _0x56ae53[_0xe500('0x36')];}_0x5e2342[_0xe500('0x2a')](_0x237fa6)[_0xe500('0x37')](_0x56ae53);};}exports[_0xe500('0x38')]=function(_0x182050,_0x159e42){var _0x184368={},_0x2934a9={},_0xcbcd0e={'count':0x0,'rows':[]};var _0x5bf3ac=_['map'](db[_0xe500('0x39')][_0xe500('0x3a')],function(_0x52b584){return{'name':_0x52b584['fieldName'],'type':_0x52b584['type'][_0xe500('0x3b')]};});_0x2934a9['model']=_[_0xe500('0x3c')](_0x5bf3ac,'name');_0x2934a9['query']=_[_0xe500('0x3d')](_0x182050[_0xe500('0x3e')]);_0x2934a9[_0xe500('0x3f')]=_[_0xe500('0x40')](_0x2934a9[_0xe500('0x41')],_0x2934a9['query']);_0x184368[_0xe500('0x42')]=_[_0xe500('0x40')](_0x2934a9[_0xe500('0x41')],qs[_0xe500('0x43')](_0x182050[_0xe500('0x3e')]['fields']));_0x184368['attributes']=_0x184368[_0xe500('0x42')][_0xe500('0x44')]?_0x184368[_0xe500('0x42')]:_0x2934a9[_0xe500('0x41')];if(!_0x182050[_0xe500('0x3e')]['hasOwnProperty'](_0xe500('0x45'))){_0x184368[_0xe500('0x2d')]=qs[_0xe500('0x2d')](_0x182050['query']['limit']);_0x184368[_0xe500('0x2c')]=qs['offset'](_0x182050[_0xe500('0x3e')][_0xe500('0x2c')]);}_0x184368[_0xe500('0x46')]=qs[_0xe500('0x47')](_0x182050['query'][_0xe500('0x47')]);_0x184368[_0xe500('0x48')]=qs[_0xe500('0x3f')](_[_0xe500('0x49')](_0x182050[_0xe500('0x3e')],_0x2934a9[_0xe500('0x3f')]),_0x5bf3ac);if(_0x182050['query'][_0xe500('0x4a')]){_0x184368['where']=_[_0xe500('0x4b')](_0x184368['where'],{'$or':_['map'](_0x5bf3ac,function(_0x3b8fa0){if(_0x3b8fa0[_0xe500('0x4c')]!=='VIRTUAL'){var _0x45984d={};_0x45984d[_0x3b8fa0[_0xe500('0x36')]]={'$like':'%'+_0x182050[_0xe500('0x3e')]['filter']+'%'};return _0x45984d;}})});}_0x184368=_[_0xe500('0x4b')]({},_0x184368,_0x182050[_0xe500('0x4d')]);var _0x545802={'where':_0x184368[_0xe500('0x48')]};return db[_0xe500('0x39')][_0xe500('0x2b')](_0x545802)[_0xe500('0x1f')](function(_0x5ba81a){_0xcbcd0e[_0xe500('0x2b')]=_0x5ba81a;if(_0x182050[_0xe500('0x3e')][_0xe500('0x4e')]){_0x184368['include']=[{'all':!![]}];}return db[_0xe500('0x39')][_0xe500('0x4f')](_0x184368);})[_0xe500('0x1f')](function(_0x33e056){_0xcbcd0e[_0xe500('0x50')]=_0x33e056;return _0xcbcd0e;})[_0xe500('0x1f')](respondWithFilteredResult(_0x159e42,_0x184368))[_0xe500('0x27')](handleError(_0x159e42,null));};exports[_0xe500('0x51')]=function(_0x4883f8,_0x215407){var _0x2a973c={'raw':!![],'where':{'id':_0x4883f8[_0xe500('0x52')]['id']}},_0x386946={};_0x386946[_0xe500('0x41')]=_[_0xe500('0x3d')](db[_0xe500('0x39')][_0xe500('0x3a')]);_0x386946[_0xe500('0x3e')]=_[_0xe500('0x3d')](_0x4883f8[_0xe500('0x3e')]);_0x386946['filters']=_[_0xe500('0x40')](_0x386946[_0xe500('0x41')],_0x386946[_0xe500('0x3e')]);_0x2a973c[_0xe500('0x42')]=_['intersection'](_0x386946[_0xe500('0x41')],qs[_0xe500('0x43')](_0x4883f8['query'][_0xe500('0x43')]));_0x2a973c[_0xe500('0x42')]=_0x2a973c[_0xe500('0x42')][_0xe500('0x44')]?_0x2a973c[_0xe500('0x42')]:_0x386946['model'];if(_0x4883f8[_0xe500('0x3e')][_0xe500('0x4e')]){_0x2a973c['include']=[{'all':!![]}];}_0x2a973c=_[_0xe500('0x4b')]({},_0x2a973c,_0x4883f8[_0xe500('0x4d')]);return db[_0xe500('0x39')][_0xe500('0x53')](_0x2a973c)[_0xe500('0x1f')](handleEntityNotFound(_0x215407,null))[_0xe500('0x1f')](respondWithResult(_0x215407,null))[_0xe500('0x27')](handleError(_0x215407,null));};exports['update']=function(_0x4f5958,_0x4eb683){if(_0x4f5958['body']['id']){delete _0x4f5958['body']['id'];}return db[_0xe500('0x39')][_0xe500('0x53')]({'where':{'id':_0x4f5958[_0xe500('0x52')]['id']}})[_0xe500('0x1f')](handleEntityNotFound(_0x4eb683,null))[_0xe500('0x1f')](saveUpdates(_0x4f5958[_0xe500('0x54')],null))[_0xe500('0x1f')](respondWithResult(_0x4eb683,null))[_0xe500('0x27')](handleError(_0x4eb683,null));};exports[_0xe500('0x34')]=function(_0x184a97,_0x3caf9f){return db[_0xe500('0x39')]['find']({'where':{'id':_0x184a97[_0xe500('0x52')]['id']}})[_0xe500('0x1f')](handleEntityNotFound(_0x3caf9f,null))[_0xe500('0x1f')](removeEntity(_0x3caf9f,null))[_0xe500('0x27')](handleError(_0x3caf9f,null));};exports[_0xe500('0x55')]=function(_0x451a06,_0x3d3521){return db[_0xe500('0x39')][_0xe500('0x55')]()[_0xe500('0x1f')](respondWithResult(_0x3d3521,null))['catch'](handleError(_0x3d3521,null));};var interaction_log=require('../../config/logger')(_0xe500('0x56'));exports[_0xe500('0x57')]=function(_0xa4f5c,_0x2dc73e,_0x3be969){var _0x4e6919={'channel':_0xe500('0x58')};if(_0xa4f5c[_0xe500('0x54')]['id']){delete _0xa4f5c[_0xe500('0x54')]['id'];}_0xa4f5c[_0xe500('0x54')][_0xe500('0x59')]=!![];_0xa4f5c[_0xe500('0x54')][_0xe500('0x5a')]=moment()[_0xe500('0x5b')](_0xe500('0x5c'));_0xa4f5c[_0xe500('0x54')]['UserId']=_0xa4f5c[_0xe500('0x54')]['UserId']||_0xa4f5c[_0xe500('0x5d')]['id'];return db[_0xe500('0x39')][_0xe500('0x53')]({'where':{'id':_0xa4f5c[_0xe500('0x52')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xe500('0x5e')}]})[_0xe500('0x1f')](handleEntityNotFound(_0x2dc73e,null))['then'](saveUpdates(_0xa4f5c[_0xe500('0x54')],null))['then'](function(_0x53fcea){if(_0x53fcea){_0x4e6919['message']=_0x53fcea['get']({'plain':!![]});return db[_0xe500('0x5f')]['find']({'where':{'id':_0x53fcea[_0xe500('0x60')]}});}return null;})[_0xe500('0x1f')](handleEntityNotFound(_0x2dc73e,null))[_0xe500('0x1f')](function(_0x497b83){if(_0x497b83){return _0x497b83[_0xe500('0x61')]({'UserId':_0xa4f5c[_0xe500('0x54')][_0xe500('0x62')],'read1stAt':_[_0xe500('0x63')](_0x497b83['read1stAt'])?moment()[_0xe500('0x5b')](_0xe500('0x5c')):undefined});}return null;})[_0xe500('0x1f')](function(_0x3aa5c5){if(_0x3aa5c5){_0x4e6919[_0xe500('0x64')]=_0x3aa5c5['get']({'plain':!![]});interaction_log[_0xe500('0x20')](_0xe500('0x65'),_0xa4f5c[_0xe500('0x5d')]['id'],_0xa4f5c[_0xe500('0x5d')][_0xe500('0x36')],_0xa4f5c[_0xe500('0x5d')][_0xe500('0x66')],_0x4e6919[_0xe500('0x64')]['id'],_0xa4f5c['body']?JSON[_0xe500('0x23')](_0xa4f5c['body']):_0xe500('0x67'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4e6919);}return null;})[_0xe500('0x1f')](function(_0x35d9d5){if(_0x35d9d5){if(_0xa4f5c['body']['manual']){_0x4e6919[_0xe500('0x25')][_0xe500('0x68')]=util['format'](_0xe500('0x69'),_0xa4f5c['user'][_0xe500('0x36')]);_0x4e6919[_0xe500('0x25')][_0xe500('0x6a')]=_0x4e6919['channel'];_0x4e6919[_0xe500('0x25')][_0xe500('0x6b')]=_0xe500('0x57');return respondWithRpcPromise(_0xe500('0x6c'),'EventManager',{'event':_0xe500('0x6d'),'message':_0x4e6919[_0xe500('0x25')]},client9002)['then'](function(){return _0x4e6919;});}return _0x4e6919;}return null;})[_0xe500('0x1f')](respondWithResult(_0x2dc73e,null))[_0xe500('0x27')](handleError(_0x2dc73e,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xe500('0x32')]=function(_0x22a9f,_0x1e8152,_0x15ad38){var _0x3e7886={'agent':{},'channel':'fax'};if(_0x22a9f[_0xe500('0x54')]['id']){delete _0x22a9f['body']['id'];}_0x22a9f[_0xe500('0x54')][_0xe500('0x62')]=_0x22a9f['body']['UserId']||_0x22a9f[_0xe500('0x5d')]['id'];_0x3e7886[_0xe500('0x6e')]['id']=_0x22a9f[_0xe500('0x54')]['UserId'];return db[_0xe500('0x39')]['find']({'where':{'id':_0x22a9f[_0xe500('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1e8152,null))[_0xe500('0x1f')](function(_0x5e9576){if(_0x5e9576){_0x3e7886['message']=_0x5e9576[_0xe500('0x6f')]({'plain':!![]});return db[_0xe500('0x5f')]['find']({'where':{'id':_0x5e9576[_0xe500('0x60')]}});}return null;})[_0xe500('0x1f')](handleEntityNotFound(_0x1e8152,null))[_0xe500('0x1f')](function(_0x51c07c){if(_0x51c07c){_0x3e7886[_0xe500('0x64')]=_0x51c07c[_0xe500('0x6f')]({'plain':!![]});interaction_log[_0xe500('0x20')](_0xe500('0x70'),_0x22a9f[_0xe500('0x5d')]['id'],_0x22a9f['user'][_0xe500('0x36')],_0x22a9f['user'][_0xe500('0x66')],_0x3e7886['interaction']['id'],_0x22a9f['body']?JSON[_0xe500('0x23')](_0x22a9f[_0xe500('0x54')]):'null');return respondWithRpcPromise(_0xe500('0x71'),'rejectMessage',_0x3e7886);}return null;})[_0xe500('0x1f')](function(_0x5a566b){if(_0x5a566b){_0x5a566b[_0xe500('0x25')][_0xe500('0x68')]=util[_0xe500('0x5b')](_0xe500('0x69'),_0x22a9f[_0xe500('0x5d')]['name']);_0x5a566b[_0xe500('0x25')][_0xe500('0x6a')]=_0x3e7886[_0xe500('0x6a')];_0x5a566b[_0xe500('0x25')][_0xe500('0x6b')]=_0xe500('0x32');respondWithRpcPromise(_0xe500('0x6c'),'EventManager',{'event':_0xe500('0x72'),'message':_0x5a566b[_0xe500('0x25')]},client9002);return _0x3e7886;}return null;})['then'](respondWithResult(_0x1e8152,null))[_0xe500('0x27')](handleError(_0x1e8152,null));};exports[_0xe500('0x73')]=function(_0x40c061,_0x246eb3){var _0x50224d;return db[_0xe500('0x39')]['create'](_0x40c061[_0xe500('0x54')],{})[_0xe500('0x1f')](function(_0x1c8e97){_0x50224d=_0x1c8e97;return db[_0xe500('0x74')][_0xe500('0x75')]({'where':{'id':_0x50224d[_0xe500('0x76')]}});})['then'](function(_0x27ee84){if(_[_0xe500('0x63')](_0x27ee84)){return;}else{_0x50224d['fax']=_0x27ee84[_0xe500('0x58')];return db[_0xe500('0x77')][_0xe500('0x75')]({'where':{'id':_0x50224d[_0xe500('0x78')]}});}})[_0xe500('0x1f')](function(_0x4d27a9){return respondWithRpcPromise(_0xe500('0x79'),'SendFax',{'FaxAccountId':_[_0xe500('0x63')](_0x40c061[_0xe500('0x54')])?undefined:_0x40c061[_0xe500('0x54')]['FaxAccountId'],'path':_[_0xe500('0x63')](_0x4d27a9)?undefined:util[_0xe500('0x5b')]('/var/opt/motion2/server/files/attachments/%s',_0x4d27a9[_0xe500('0x7a')]),'fax':_[_0xe500('0x63')](_0x50224d[_0xe500('0x58')])?undefined:_0x50224d[_0xe500('0x58')],'AttachmentId':_0x50224d[_0xe500('0x78')]},client9002);})[_0xe500('0x1f')](respondWithResult(_0x246eb3,0xc9))[_0xe500('0x27')](handleError(_0x246eb3,null));};exports[_0xe500('0x7b')]=function(_0x21ae4e,_0x4c8bf3){var _0x4be786=path['join'](config[_0xe500('0x7c')],'server',_0xe500('0x7d'),_0xe500('0x7e'));return db[_0xe500('0x39')][_0xe500('0x53')]({'where':{'id':_0x21ae4e['params']['id']},'include':[{'model':db[_0xe500('0x77')],'as':_0xe500('0x77')}]})[_0xe500('0x1f')](handleEntityNotFound(_0x4c8bf3,null))[_0xe500('0x1f')](function(_0x57cb51){if(_0x57cb51){return _0x4c8bf3[_0xe500('0x7b')](path[_0xe500('0x7f')](_0x4be786,_0x57cb51[_0xe500('0x77')]['basename']));}})[_0xe500('0x27')](handleError(_0x4c8bf3,null));};
\ No newline at end of file
index 83dbc8c..4526984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe14b,0x93));var _0xbe14=function(_0x1ec9a7,_0x5f57da){_0x1ec9a7=_0x1ec9a7-0x0;var _0x3c4905=_0xe14b[_0x1ec9a7];return _0x3c4905;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var FaxMessage=require(_0xbe14('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){FaxMessageEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);FaxMessageEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];FaxMessage[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=FaxMessageEvents;
\ No newline at end of file
+var _0x7217=['emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x13ec2b,_0x40b664){var _0x1fb3f4=function(_0x3e91e9){while(--_0x3e91e9){_0x13ec2b['push'](_0x13ec2b['shift']());}};_0x1fb3f4(++_0x40b664);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7721('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7721('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){FaxMessageEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);FaxMessageEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];FaxMessage[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=FaxMessageEvents;
\ No newline at end of file
index 3c8ce9f..160e94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e12=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','error','utf8mb4'];(function(_0x4d0f4a,_0x439b45){var _0xe98a82=function(_0x5dac1a){while(--_0x5dac1a){_0x4d0f4a['push'](_0x4d0f4a['shift']());}};_0xe98a82(++_0x439b45);}(_0x2e12,0x106));var _0x22e1=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x2e12[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0x22e1('0x0'));var logger=require(_0x22e1('0x1'))(_0x22e1('0x2'));var moment=require(_0x22e1('0x3'));var BPromise=require(_0x22e1('0x4'));var rp=require(_0x22e1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22e1('0x6'));var config=require(_0x22e1('0x7'));var attributes=require('./faxMessage.attributes');module[_0x22e1('0x8')]=function(_0x2d97c5,_0x1badd5){return _0x2d97c5[_0x22e1('0x9')](_0x22e1('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x22e1('0xb'),'fields':[_0x22e1('0xc')],'type':_0x22e1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ad246,_0x41447b,_0x73ce4c){var _0x5e6808=_0x2d97c5[_0x22e1('0xe')];var _0x58719f=_0x4ad246[_0x22e1('0xf')]({'plain':!![]});if(_0x58719f[_0x22e1('0x10')][_0x22e1('0x11')]()==='in'||_0x58719f[_0x22e1('0x10')][_0x22e1('0x11')]()===_0x22e1('0x12')&&!_0x58719f['secret']&&!_[_0x22e1('0x13')](_0x58719f['UserId'])){_0x5e6808[_0x22e1('0x14')][_0x22e1('0x15')]({'where':{'id':_0x58719f[_0x22e1('0x16')]}})[_0x22e1('0x17')](function(_0x2e22d5){if(_0x2e22d5){_0x2e22d5[_0x22e1('0x18')]({'lastMsgAt':_0x58719f[_0x22e1('0x19')],'lastMsgDirection':_0x58719f['direction'][_0x22e1('0x11')]()});}})['catch'](function(_0x44ebfd){console[_0x22e1('0x1a')](_0x44ebfd);});}_0x73ce4c();}},'charset':_0x22e1('0x1b'),'collate':_0x22e1('0x1c')});};
\ No newline at end of file
+var _0x7662=['findOne','then','update','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7662,0x114));var _0x2766=function(_0x240efa,_0x100e2e){_0x240efa=_0x240efa-0x0;var _0x12f31e=_0x7662[_0x240efa];return _0x12f31e;};'use strict';var _=require(_0x2766('0x0'));var util=require(_0x2766('0x1'));var logger=require(_0x2766('0x2'))(_0x2766('0x3'));var moment=require(_0x2766('0x4'));var BPromise=require(_0x2766('0x5'));var rp=require(_0x2766('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2766('0x7'));var config=require(_0x2766('0x8'));var attributes=require(_0x2766('0x9'));module[_0x2766('0xa')]=function(_0x3c819e,_0x1608cf){return _0x3c819e[_0x2766('0xb')](_0x2766('0xc'),attributes,{'tableName':_0x2766('0xd'),'paranoid':![],'indexes':[{'name':_0x2766('0xe'),'fields':[_0x2766('0xf')],'type':_0x2766('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x23caa0,_0x22b35e,_0x210b7a){var _0x3b7997=_0x3c819e['models'];var _0x44b0da=_0x23caa0[_0x2766('0x11')]({'plain':!![]});if(_0x44b0da['direction'][_0x2766('0x12')]()==='in'||_0x44b0da[_0x2766('0x13')][_0x2766('0x12')]()==='out'&&!_0x44b0da[_0x2766('0x14')]&&!_[_0x2766('0x15')](_0x44b0da[_0x2766('0x16')])){_0x3b7997[_0x2766('0x17')][_0x2766('0x18')]({'where':{'id':_0x44b0da['FaxInteractionId']}})[_0x2766('0x19')](function(_0x538f06){if(_0x538f06){_0x538f06[_0x2766('0x1a')]({'lastMsgAt':_0x44b0da['createdAt'],'lastMsgDirection':_0x44b0da[_0x2766('0x13')][_0x2766('0x12')]()});}})[_0x2766('0x1b')](function(_0x1bc50e){console[_0x2766('0x1c')](_0x1bc50e);});}_0x210b7a();}},'charset':_0x2766('0x1d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d33f5e0..a66ecd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x500f=['limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','body','options','debug','UpdateFaxMessage','raw','where','attributes'];(function(_0x27eb13,_0x302586){var _0x163e96=function(_0x50a828){while(--_0x50a828){_0x27eb13['push'](_0x27eb13['shift']());}};_0x163e96(++_0x302586);}(_0x500f,0x1d5));var _0xf500=function(_0xc55d64,_0x133f2d){_0xc55d64=_0xc55d64-0x0;var _0x4194f6=_0x500f[_0xc55d64];return _0x4194f6;};'use strict';var _=require(_0xf500('0x0'));var util=require(_0xf500('0x1'));var moment=require('moment');var BPromise=require(_0xf500('0x2'));var rs=require(_0xf500('0x3'));var fs=require('fs');var Redis=require(_0xf500('0x4'));var db=require(_0xf500('0x5'))['db'];var utils=require(_0xf500('0x6'));var logger=require(_0xf500('0x7'))('rpc');var config=require(_0xf500('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf500('0x9')]({'port':0x232a});config[_0xf500('0xa')]=_[_0xf500('0xb')](config[_0xf500('0xa')],{'host':_0xf500('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf500('0xd'))[_0xf500('0xe')](socket);function respondWithRpcPromise(_0x3d98ce,_0x5f1f8f,_0x131ec0){return new BPromise(function(_0x8eb565,_0x31f701){return client[_0xf500('0xf')](_0x3d98ce,_0x131ec0)[_0xf500('0x10')](function(_0x40acac){logger[_0xf500('0x11')](_0xf500('0x12'),_0x5f1f8f,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5f1f8f,_0xf500('0x13'),JSON[_0xf500('0x14')](_0x40acac));if(_0x40acac[_0xf500('0x15')]){if(_0x40acac[_0xf500('0x15')][_0xf500('0x16')]===0x1f4){logger[_0xf500('0x15')](_0xf500('0x12'),_0x5f1f8f,_0x40acac[_0xf500('0x15')]['message']);return _0x31f701(_0x40acac[_0xf500('0x15')][_0xf500('0x17')]);}logger[_0xf500('0x15')](_0xf500('0x12'),_0x5f1f8f,_0x40acac['error'][_0xf500('0x17')]);return _0x8eb565(_0x40acac[_0xf500('0x15')][_0xf500('0x17')]);}else{logger['info'](_0xf500('0x12'),_0x5f1f8f,_0xf500('0x13'));_0x8eb565(_0x40acac[_0xf500('0x18')]['message']);}})[_0xf500('0x19')](function(_0x3b155f){logger[_0xf500('0x15')](_0xf500('0x12'),_0x5f1f8f,_0x3b155f);_0x31f701(_0x3b155f);});});}exports[_0xf500('0x1a')]=function(_0x5dfe4f){var _0x3f00a2=this;return new Promise(function(_0x5bc84c,_0x309453){return db[_0xf500('0x1b')]['create'](_0x5dfe4f[_0xf500('0x1c')],{'raw':_0x5dfe4f['options']?_0x5dfe4f[_0xf500('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x437e96){logger[_0xf500('0x11')](_0xf500('0x1a'),_0x5dfe4f);logger[_0xf500('0x1e')](_0xf500('0x1a'),_0x5dfe4f,JSON['stringify'](_0x437e96));_0x5bc84c(_0x437e96);})[_0xf500('0x19')](function(_0x4728aa){logger[_0xf500('0x15')](_0xf500('0x1a'),_0x4728aa['message'],_0x5dfe4f);_0x309453(_0x3f00a2[_0xf500('0x15')](0x1f4,_0x4728aa[_0xf500('0x17')]));});});};exports[_0xf500('0x1f')]=function(_0x1311dc){var _0x46310d=this;return new Promise(function(_0x4a8fe8,_0x5e4240){return db[_0xf500('0x1b')]['update'](_0x1311dc['body'],{'raw':_0x1311dc['options']?_0x1311dc[_0xf500('0x1d')][_0xf500('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1311dc[_0xf500('0x1d')]?_0x1311dc[_0xf500('0x1d')][_0xf500('0x21')]||null:null,'attributes':_0x1311dc[_0xf500('0x1d')]?_0x1311dc[_0xf500('0x1d')][_0xf500('0x22')]||null:null,'limit':_0x1311dc[_0xf500('0x1d')]?_0x1311dc[_0xf500('0x1d')][_0xf500('0x23')]||null:null})[_0xf500('0x10')](function(_0x756d22){logger[_0xf500('0x11')](_0xf500('0x1f'),_0x1311dc);logger['debug'](_0xf500('0x1f'),_0x1311dc,JSON[_0xf500('0x14')](_0x756d22));_0x4a8fe8(_0x756d22);})[_0xf500('0x19')](function(_0x50551f){logger[_0xf500('0x15')](_0xf500('0x1f'),_0x50551f[_0xf500('0x17')],_0x1311dc);_0x5e4240(_0x46310d[_0xf500('0x15')](0x1f4,_0x50551f[_0xf500('0x17')]));});});};
\ No newline at end of file
+var _0xda03=['create','body','options','raw','update','where','attributes','limit','UpdateFaxMessage','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','stringify','error','message','FaxMessage,\x20%s,\x20%s','result','catch','CreateFaxMessage','FaxMessage'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xda03,0x79));var _0x3da0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda03[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3da0('0x0'));var util=require('util');var moment=require(_0x3da0('0x1'));var BPromise=require(_0x3da0('0x2'));var rs=require(_0x3da0('0x3'));var fs=require('fs');var Redis=require(_0x3da0('0x4'));var db=require(_0x3da0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3da0('0x6'))(_0x3da0('0x7'));var config=require(_0x3da0('0x8'));var jayson=require(_0x3da0('0x9'));var client=jayson['client'][_0x3da0('0xa')]({'port':0x232a});config[_0x3da0('0xb')]=_[_0x3da0('0xc')](config['redis'],{'host':_0x3da0('0xd'),'port':0x18eb});var socket=require(_0x3da0('0xe'))(new Redis(config[_0x3da0('0xb')]));require('./faxMessage.socket')[_0x3da0('0xf')](socket);function respondWithRpcPromise(_0x4ea55b,_0x36e592,_0xa0b02){return new BPromise(function(_0x1b6b39,_0x52e95f){return client['request'](_0x4ea55b,_0xa0b02)[_0x3da0('0x10')](function(_0x4b2575){logger[_0x3da0('0x11')]('FaxMessage,\x20%s,\x20%s',_0x36e592,_0x3da0('0x12'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x36e592,_0x3da0('0x12'),JSON[_0x3da0('0x13')](_0x4b2575));if(_0x4b2575[_0x3da0('0x14')]){if(_0x4b2575[_0x3da0('0x14')]['code']===0x1f4){logger[_0x3da0('0x14')]('FaxMessage,\x20%s,\x20%s',_0x36e592,_0x4b2575['error'][_0x3da0('0x15')]);return _0x52e95f(_0x4b2575['error'][_0x3da0('0x15')]);}logger['error'](_0x3da0('0x16'),_0x36e592,_0x4b2575[_0x3da0('0x14')][_0x3da0('0x15')]);return _0x1b6b39(_0x4b2575['error'][_0x3da0('0x15')]);}else{logger[_0x3da0('0x11')](_0x3da0('0x16'),_0x36e592,'request\x20sent');_0x1b6b39(_0x4b2575[_0x3da0('0x17')][_0x3da0('0x15')]);}})[_0x3da0('0x18')](function(_0x968a95){logger[_0x3da0('0x14')](_0x3da0('0x16'),_0x36e592,_0x968a95);_0x52e95f(_0x968a95);});});}exports[_0x3da0('0x19')]=function(_0x49bd99){var _0x4e3c2b=this;return new Promise(function(_0x246ba1,_0x190627){return db[_0x3da0('0x1a')][_0x3da0('0x1b')](_0x49bd99[_0x3da0('0x1c')],{'raw':_0x49bd99[_0x3da0('0x1d')]?_0x49bd99[_0x3da0('0x1d')][_0x3da0('0x1e')]===undefined?!![]:![]:!![]})[_0x3da0('0x10')](function(_0x25194a){logger[_0x3da0('0x11')](_0x3da0('0x19'),_0x49bd99);logger['debug'](_0x3da0('0x19'),_0x49bd99,JSON['stringify'](_0x25194a));_0x246ba1(_0x25194a);})[_0x3da0('0x18')](function(_0x4e73fc){logger[_0x3da0('0x14')](_0x3da0('0x19'),_0x4e73fc[_0x3da0('0x15')],_0x49bd99);_0x190627(_0x4e3c2b['error'](0x1f4,_0x4e73fc[_0x3da0('0x15')]));});});};exports['UpdateFaxMessage']=function(_0x11fb70){var _0x1932e8=this;return new Promise(function(_0x1ebd28,_0x320784){return db[_0x3da0('0x1a')][_0x3da0('0x1f')](_0x11fb70[_0x3da0('0x1c')],{'raw':_0x11fb70[_0x3da0('0x1d')]?_0x11fb70[_0x3da0('0x1d')][_0x3da0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11fb70[_0x3da0('0x1d')]?_0x11fb70[_0x3da0('0x1d')][_0x3da0('0x20')]||null:null,'attributes':_0x11fb70[_0x3da0('0x1d')]?_0x11fb70[_0x3da0('0x1d')][_0x3da0('0x21')]||null:null,'limit':_0x11fb70['options']?_0x11fb70[_0x3da0('0x1d')][_0x3da0('0x22')]||null:null})[_0x3da0('0x10')](function(_0x53cd50){logger[_0x3da0('0x11')](_0x3da0('0x23'),_0x11fb70);logger[_0x3da0('0x24')]('UpdateFaxMessage',_0x11fb70,JSON[_0x3da0('0x13')](_0x53cd50));_0x1ebd28(_0x53cd50);})['catch'](function(_0x78b2d9){logger[_0x3da0('0x14')](_0x3da0('0x23'),_0x78b2d9['message'],_0x11fb70);_0x320784(_0x1932e8[_0x3da0('0x14')](0x1f4,_0x78b2d9[_0x3da0('0x15')]));});});};
\ No newline at end of file
index 168431a..3fe8922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}};
\ No newline at end of file
index fb18973..011a65e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6080=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','isAuthenticated','describe','/:id/download','post','tracked','faxmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0x6080,0x110));var _0x0608=function(_0x524dc0,_0x29bc86){_0x524dc0=_0x524dc0-0x0;var _0x352e27=_0x6080[_0x524dc0];return _0x352e27;};'use strict';var multer=require(_0x0608('0x0'));var util=require(_0x0608('0x1'));var path=require(_0x0608('0x2'));var timeout=require(_0x0608('0x3'));var express=require('express');var router=express[_0x0608('0x4')]();var auth=require(_0x0608('0x5'));var interaction=require(_0x0608('0x6'));var config=require(_0x0608('0x7'));var controller=require(_0x0608('0x8'));router[_0x0608('0x9')]('/',auth['isAuthenticated'](),controller[_0x0608('0xa')]);router[_0x0608('0x9')]('/describe',auth[_0x0608('0xb')](),controller[_0x0608('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x0608('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x0608('0xe')]('/',auth[_0x0608('0xb')](),interaction[_0x0608('0xf')]('fax',_0x0608('0x10')),controller[_0x0608('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0608('0x12')]);router[_0x0608('0x13')](_0x0608('0x14'),auth[_0x0608('0xb')](),controller[_0x0608('0x15')]);router['put'](_0x0608('0x16'),auth['isAuthenticated'](),controller[_0x0608('0x17')]);router[_0x0608('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x0608('0x19')]);module[_0x0608('0x1a')]=router;
\ No newline at end of file
+var _0x1491=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','faxmessage:create','update','put','/:id/accept','accept'];(function(_0x34fab5,_0x2625aa){var _0x49a686=function(_0x9537f2){while(--_0x9537f2){_0x34fab5['push'](_0x34fab5['shift']());}};_0x49a686(++_0x2625aa);}(_0x1491,0x1b1));var _0x1149=function(_0x241f06,_0x3c7ef8){_0x241f06=_0x241f06-0x0;var _0x2ec3a1=_0x1491[_0x241f06];return _0x2ec3a1;};'use strict';var multer=require(_0x1149('0x0'));var util=require(_0x1149('0x1'));var path=require(_0x1149('0x2'));var timeout=require(_0x1149('0x3'));var express=require('express');var router=express[_0x1149('0x4')]();var auth=require(_0x1149('0x5'));var interaction=require(_0x1149('0x6'));var config=require(_0x1149('0x7'));var controller=require(_0x1149('0x8'));router[_0x1149('0x9')]('/',auth[_0x1149('0xa')](),controller[_0x1149('0xb')]);router[_0x1149('0x9')](_0x1149('0xc'),auth[_0x1149('0xa')](),controller[_0x1149('0xd')]);router[_0x1149('0x9')](_0x1149('0xe'),auth[_0x1149('0xa')](),controller[_0x1149('0xf')]);router[_0x1149('0x9')](_0x1149('0x10'),auth[_0x1149('0xa')](),controller['download']);router[_0x1149('0x11')]('/',auth['isAuthenticated'](),interaction['tracked']('fax',_0x1149('0x12')),controller['create']);router['put'](_0x1149('0xe'),auth['isAuthenticated'](),controller[_0x1149('0x13')]);router[_0x1149('0x14')](_0x1149('0x15'),auth[_0x1149('0xa')](),controller[_0x1149('0x16')]);router[_0x1149('0x14')]('/:id/reject',auth[_0x1149('0xa')](),controller['reject']);router['delete'](_0x1149('0xe'),auth[_0x1149('0xa')](),controller['destroy']);module[_0x1149('0x17')]=router;
\ No newline at end of file
index a360550..9149bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdafd=['rrmemory','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x4e6453,_0xf1e371){var _0x30c32b=function(_0x450c8c){while(--_0x450c8c){_0x4e6453['push'](_0x4e6453['shift']());}};_0x30c32b(++_0xf1e371);}(_0xdafd,0x146));var _0xddaf=function(_0x3db876,_0x30b5ec){_0x3db876=_0x3db876-0x0;var _0x443c97=_0xdafd[_0x3db876];return _0x443c97;};'use strict';var Sequelize=require(_0xddaf('0x0'));module[_0xddaf('0x1')]={'name':{'type':Sequelize[_0xddaf('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xddaf('0x2')]},'timeout':{'type':Sequelize[_0xddaf('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xddaf('0x4'),'beepall',_0xddaf('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7f97=['rrmemory','sequelize','name','STRING','INTEGER','ENUM'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x7f97,0x7f));var _0x77f9=function(_0x315939,_0x27d804){_0x315939=_0x315939-0x0;var _0x388ebe=_0x7f97[_0x315939];return _0x388ebe;};'use strict';var Sequelize=require(_0x77f9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x77f9('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x77f9('0x2')]},'timeout':{'type':Sequelize[_0x77f9('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x77f9('0x4')](_0x77f9('0x5'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x77f9('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 844c406..9f299f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc9c=['query','filters','intersection','model','attributes','fields','length','order','sort','where','type','VIRTUAL','merge','FaxQueue','include','findAll','rows','catch','show','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','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','FaxQueueId','filter','findAndCountAll','agent','updatedAt','createdAt','faxPause','getTeams','Team','pick','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','key','keys'];(function(_0x1c6a51,_0x1b6732){var _0x197196=function(_0x18ec56){while(--_0x18ec56){_0x1c6a51['push'](_0x1c6a51['shift']());}};_0x197196(++_0x1b6732);}(_0xdc9c,0xe2));var _0xcdc9=function(_0x3e0812,_0x5af48e){_0x3e0812=_0x3e0812-0x0;var _0x5ed135=_0xdc9c[_0x3e0812];return _0x5ed135;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcdc9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcdc9('0x1'));var moment=require(_0xcdc9('0x2'));var BPromise=require(_0xcdc9('0x3'));var Mustache=require(_0xcdc9('0x4'));var util=require('util');var path=require(_0xcdc9('0x5'));var sox=require('sox');var csv=require(_0xcdc9('0x6'));var ejs=require(_0xcdc9('0x7'));var fs=require('fs');var _=require(_0xcdc9('0x8'));var squel=require(_0xcdc9('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcdc9('0xa'));var Papa=require(_0xcdc9('0xb'));var Redis=require(_0xcdc9('0xc'));var authService=require(_0xcdc9('0xd'));var qs=require(_0xcdc9('0xe'));var as=require(_0xcdc9('0xf'));var hardwareService=require(_0xcdc9('0x10'));var logger=require(_0xcdc9('0x11'))(_0xcdc9('0x12'));var utils=require('../../config/utils');var config=require(_0xcdc9('0x13'));var db=require(_0xcdc9('0x14'))['db'];config[_0xcdc9('0x15')]=_['defaults'](config[_0xcdc9('0x15')],{'host':_0xcdc9('0x16'),'port':0x18eb});var socket=require(_0xcdc9('0x17'))(new Redis(config[_0xcdc9('0x15')]));require(_0xcdc9('0x18'))[_0xcdc9('0x19')](socket);function respondWithStatusCode(_0x2559dd,_0x397d1e){_0x397d1e=_0x397d1e||0xcc;return function(_0x2da00b){if(_0x2da00b){return _0x2559dd[_0xcdc9('0x1a')](_0x397d1e);}return _0x2559dd[_0xcdc9('0x1b')](_0x397d1e)[_0xcdc9('0x1c')]();};}function respondWithResult(_0x100f89,_0x385770){_0x385770=_0x385770||0xc8;return function(_0x1a5932){if(_0x1a5932){return _0x100f89['status'](_0x385770)[_0xcdc9('0x1d')](_0x1a5932);}};}function respondWithFilteredResult(_0x176e5a,_0x5683c4){return function(_0xec4dd3){if(_0xec4dd3){var _0x19d34c=_0xec4dd3[_0xcdc9('0x1e')],_0x295b6c=_0x5683c4[_0xcdc9('0x1f')],_0x4ff036=_0x5683c4[_0xcdc9('0x1f')]+_0x5683c4[_0xcdc9('0x20')],_0x3ccea4;if(_0x4ff036>=_0x19d34c){_0x4ff036=_0x19d34c;_0x3ccea4=0xc8;}else{_0x3ccea4=0xce;}_0x176e5a[_0xcdc9('0x1b')](_0x3ccea4);return _0x176e5a[_0xcdc9('0x21')](_0xcdc9('0x22'),_0x295b6c+'-'+_0x4ff036+'/'+_0x19d34c)[_0xcdc9('0x1d')](_0xec4dd3);}return null;};}function patchUpdates(_0x1809a1){return function(_0xf8c1b9){try{jsonpatch[_0xcdc9('0x23')](_0xf8c1b9,_0x1809a1,!![]);}catch(_0x7380f2){return BPromise[_0xcdc9('0x24')](_0x7380f2);}return _0xf8c1b9[_0xcdc9('0x25')]();};}function saveUpdates(_0x1c718a,_0x59cd18){return function(_0x1ce3ab){if(_0x1ce3ab){return _0x1ce3ab['update'](_0x1c718a)[_0xcdc9('0x26')](function(_0x2cb3d0){return _0x2cb3d0;});}return null;};}function removeEntity(_0x2938cc,_0x23b771){return function(_0x2ea5d9){if(_0x2ea5d9){return _0x2ea5d9['destroy']()[_0xcdc9('0x26')](function(){var _0x109a79=_0x2ea5d9[_0xcdc9('0x27')]({'plain':!![]});var _0x47b226=_0xcdc9('0x28');return db[_0xcdc9('0x29')][_0xcdc9('0x2a')]({'where':{'type':_0x47b226,'resourceId':_0x109a79['id']}})[_0xcdc9('0x26')](function(){return _0x2ea5d9;});})[_0xcdc9('0x26')](function(){_0x2938cc['status'](0xcc)[_0xcdc9('0x1c')]();});}};}function handleEntityNotFound(_0x4eeadc,_0x71f62f){return function(_0x44360c){if(!_0x44360c){_0x4eeadc[_0xcdc9('0x1a')](0x194);}return _0x44360c;};}function handleError(_0x1cd8ce,_0x2d8c91){_0x2d8c91=_0x2d8c91||0x1f4;return function(_0x1c75e5){logger[_0xcdc9('0x2b')](_0x1c75e5[_0xcdc9('0x2c')]);if(_0x1c75e5[_0xcdc9('0x2d')]){delete _0x1c75e5['name'];}_0x1cd8ce[_0xcdc9('0x1b')](_0x2d8c91)[_0xcdc9('0x2e')](_0x1c75e5);};}exports[_0xcdc9('0x2f')]=function(_0x1c834d,_0x4affc0){var _0x1fb964={},_0x193ac5={},_0x3fac2e={'count':0x0,'rows':[]};var _0x7c9470=_[_0xcdc9('0x30')](db['FaxQueue'][_0xcdc9('0x31')],function(_0x2a30da){return{'name':_0x2a30da['fieldName'],'type':_0x2a30da['type'][_0xcdc9('0x32')]};});_0x193ac5['model']=_[_0xcdc9('0x30')](_0x7c9470,_0xcdc9('0x2d'));_0x193ac5['query']=_[_0xcdc9('0x33')](_0x1c834d[_0xcdc9('0x34')]);_0x193ac5[_0xcdc9('0x35')]=_[_0xcdc9('0x36')](_0x193ac5[_0xcdc9('0x37')],_0x193ac5[_0xcdc9('0x34')]);_0x1fb964[_0xcdc9('0x38')]=_[_0xcdc9('0x36')](_0x193ac5[_0xcdc9('0x37')],qs[_0xcdc9('0x39')](_0x1c834d['query'][_0xcdc9('0x39')]));_0x1fb964[_0xcdc9('0x38')]=_0x1fb964[_0xcdc9('0x38')][_0xcdc9('0x3a')]?_0x1fb964['attributes']:_0x193ac5[_0xcdc9('0x37')];if(!_0x1c834d['query']['hasOwnProperty']('nolimit')){_0x1fb964['limit']=qs[_0xcdc9('0x20')](_0x1c834d['query'][_0xcdc9('0x20')]);_0x1fb964[_0xcdc9('0x1f')]=qs[_0xcdc9('0x1f')](_0x1c834d[_0xcdc9('0x34')][_0xcdc9('0x1f')]);}_0x1fb964[_0xcdc9('0x3b')]=qs['sort'](_0x1c834d['query'][_0xcdc9('0x3c')]);_0x1fb964[_0xcdc9('0x3d')]=qs[_0xcdc9('0x35')](_['pick'](_0x1c834d[_0xcdc9('0x34')],_0x193ac5[_0xcdc9('0x35')]),_0x7c9470);if(_0x1c834d[_0xcdc9('0x34')]['filter']){_0x1fb964[_0xcdc9('0x3d')]=_['merge'](_0x1fb964[_0xcdc9('0x3d')],{'$or':_[_0xcdc9('0x30')](_0x7c9470,function(_0x426c72){if(_0x426c72[_0xcdc9('0x3e')]!==_0xcdc9('0x3f')){var _0x2f7ae4={};_0x2f7ae4[_0x426c72[_0xcdc9('0x2d')]]={'$like':'%'+_0x1c834d[_0xcdc9('0x34')]['filter']+'%'};return _0x2f7ae4;}})});}_0x1fb964=_[_0xcdc9('0x40')]({},_0x1fb964,_0x1c834d['options']);var _0x91ed5b={'where':_0x1fb964[_0xcdc9('0x3d')]};return db[_0xcdc9('0x41')]['count'](_0x91ed5b)[_0xcdc9('0x26')](function(_0x33aa16){_0x3fac2e[_0xcdc9('0x1e')]=_0x33aa16;if(_0x1c834d[_0xcdc9('0x34')]['includeAll']){_0x1fb964[_0xcdc9('0x42')]=[{'all':!![]}];}return db[_0xcdc9('0x41')][_0xcdc9('0x43')](_0x1fb964);})['then'](function(_0x2b9f05){_0x3fac2e[_0xcdc9('0x44')]=_0x2b9f05;return _0x3fac2e;})[_0xcdc9('0x26')](respondWithFilteredResult(_0x4affc0,_0x1fb964))[_0xcdc9('0x45')](handleError(_0x4affc0,null));};exports[_0xcdc9('0x46')]=function(_0x4e8e08,_0x34cac1){var _0x50e742={'raw':!![],'where':{'id':_0x4e8e08[_0xcdc9('0x47')]['id']}},_0x4fe351={};_0x4fe351['model']=_[_0xcdc9('0x33')](db[_0xcdc9('0x41')][_0xcdc9('0x31')]);_0x4fe351[_0xcdc9('0x34')]=_[_0xcdc9('0x33')](_0x4e8e08[_0xcdc9('0x34')]);_0x4fe351[_0xcdc9('0x35')]=_['intersection'](_0x4fe351[_0xcdc9('0x37')],_0x4fe351[_0xcdc9('0x34')]);_0x50e742[_0xcdc9('0x38')]=_[_0xcdc9('0x36')](_0x4fe351[_0xcdc9('0x37')],qs['fields'](_0x4e8e08[_0xcdc9('0x34')]['fields']));_0x50e742[_0xcdc9('0x38')]=_0x50e742[_0xcdc9('0x38')]['length']?_0x50e742[_0xcdc9('0x38')]:_0x4fe351[_0xcdc9('0x37')];if(_0x4e8e08[_0xcdc9('0x34')][_0xcdc9('0x48')]){_0x50e742[_0xcdc9('0x42')]=[{'all':!![]}];}_0x50e742=_[_0xcdc9('0x40')]({},_0x50e742,_0x4e8e08[_0xcdc9('0x49')]);return db['FaxQueue'][_0xcdc9('0x4a')](_0x50e742)[_0xcdc9('0x26')](handleEntityNotFound(_0x34cac1,null))['then'](respondWithResult(_0x34cac1,null))[_0xcdc9('0x45')](handleError(_0x34cac1,null));};exports[_0xcdc9('0x4b')]=function(_0x14b274,_0x13a4ea){return db[_0xcdc9('0x41')]['create'](_0x14b274[_0xcdc9('0x4c')],{})[_0xcdc9('0x26')](function(_0x364457){var _0x4658c5=_0x14b274[_0xcdc9('0x4d')][_0xcdc9('0x27')]({'plain':!![]});if(!_0x4658c5)throw new Error(_0xcdc9('0x4e'));if(_0x4658c5[_0xcdc9('0x4f')]==='user'){var _0x341c99=_0x364457[_0xcdc9('0x27')]({'plain':!![]});var _0x28dce8=_0xcdc9('0x28');return db[_0xcdc9('0x50')]['find']({'where':{'name':_0x28dce8,'userProfileId':_0x4658c5[_0xcdc9('0x51')]},'raw':!![]})['then'](function(_0xb0a080){if(_0xb0a080&&_0xb0a080[_0xcdc9('0x52')]===0x0){return db['UserProfileResource'][_0xcdc9('0x4b')]({'name':_0x341c99[_0xcdc9('0x2d')],'resourceId':_0x341c99['id'],'type':_0xb0a080[_0xcdc9('0x2d')],'sectionId':_0xb0a080['id']},{})[_0xcdc9('0x26')](function(){return _0x364457;});}else{return _0x364457;}})[_0xcdc9('0x45')](function(_0x257987){logger[_0xcdc9('0x2b')](_0xcdc9('0x53'),_0x257987);throw _0x257987;});}return _0x364457;})[_0xcdc9('0x26')](respondWithResult(_0x13a4ea,0xc9))['catch'](handleError(_0x13a4ea,null));};exports['update']=function(_0x566f72,_0x47e415){if(_0x566f72['body']['id']){delete _0x566f72[_0xcdc9('0x4c')]['id'];}return db[_0xcdc9('0x41')]['find']({'where':{'id':_0x566f72[_0xcdc9('0x47')]['id']}})[_0xcdc9('0x26')](handleEntityNotFound(_0x47e415,null))[_0xcdc9('0x26')](saveUpdates(_0x566f72[_0xcdc9('0x4c')],null))[_0xcdc9('0x26')](respondWithResult(_0x47e415,null))[_0xcdc9('0x45')](handleError(_0x47e415,null));};exports[_0xcdc9('0x2a')]=function(_0x13158e,_0x5e218f){return db['FaxQueue']['find']({'where':{'id':_0x13158e[_0xcdc9('0x47')]['id']}})[_0xcdc9('0x26')](handleEntityNotFound(_0x5e218f,null))['then'](removeEntity(_0x5e218f,null))[_0xcdc9('0x45')](handleError(_0x5e218f,null));};exports[_0xcdc9('0x54')]=function(_0x44d2f7,_0x389565){return db[_0xcdc9('0x41')][_0xcdc9('0x54')]()[_0xcdc9('0x26')](respondWithResult(_0x389565,null))[_0xcdc9('0x45')](handleError(_0x389565,null));};exports[_0xcdc9('0x55')]=function(_0x2211b7,_0x52642a,_0x565ca9){var _0x3d28ed={'raw':!![],'where':{}},_0x42d611={},_0x9db93e;return db['FaxQueue'][_0xcdc9('0x56')]({'where':{'id':_0x2211b7[_0xcdc9('0x47')]['id']}})[_0xcdc9('0x26')](handleEntityNotFound(_0x52642a,null))[_0xcdc9('0x26')](function(_0x579de9){if(_0x579de9){_0x9db93e=_0x579de9[_0xcdc9('0x27')]({'plain':!![]});_0x42d611[_0xcdc9('0x37')]=_[_0xcdc9('0x33')](db[_0xcdc9('0x57')][_0xcdc9('0x31')]);_0x42d611['query']=_[_0xcdc9('0x33')](_0x2211b7[_0xcdc9('0x34')]);_0x42d611['filters']=_[_0xcdc9('0x36')](_0x42d611[_0xcdc9('0x37')],_0x42d611[_0xcdc9('0x34')]);_0x3d28ed['attributes']=_['intersection'](_0x42d611[_0xcdc9('0x37')],qs[_0xcdc9('0x39')](_0x2211b7[_0xcdc9('0x34')]['fields']));_0x3d28ed[_0xcdc9('0x38')]=_0x3d28ed['attributes'][_0xcdc9('0x3a')]?_0x3d28ed['attributes']:_0x42d611['model'];if(!_0x2211b7[_0xcdc9('0x34')][_0xcdc9('0x58')](_0xcdc9('0x59'))){_0x3d28ed[_0xcdc9('0x20')]=qs[_0xcdc9('0x20')](_0x2211b7['query'][_0xcdc9('0x20')]);_0x3d28ed[_0xcdc9('0x1f')]=qs[_0xcdc9('0x1f')](_0x2211b7[_0xcdc9('0x34')][_0xcdc9('0x1f')]);}_0x3d28ed['order']=qs[_0xcdc9('0x3c')](_0x2211b7[_0xcdc9('0x34')]['sort']);_0x3d28ed[_0xcdc9('0x3d')]=qs[_0xcdc9('0x35')](_['pick'](_0x2211b7['query'],_0x42d611[_0xcdc9('0x35')]));_0x3d28ed[_0xcdc9('0x3d')][_0xcdc9('0x5a')]=_0x579de9['id'];if(_0x2211b7[_0xcdc9('0x34')][_0xcdc9('0x5b')]){_0x3d28ed[_0xcdc9('0x3d')]=_[_0xcdc9('0x40')](_0x3d28ed[_0xcdc9('0x3d')],{'$or':_['map'](_0x3d28ed['attributes'],function(_0x1cebe1){var _0x2355e8={};_0x2355e8[_0x1cebe1]={'$like':'%'+_0x2211b7[_0xcdc9('0x34')][_0xcdc9('0x5b')]+'%'};return _0x2355e8;})});}_0x3d28ed=_[_0xcdc9('0x40')]({},_0x3d28ed,_0x2211b7['options']);return db['UserFaxQueue'][_0xcdc9('0x43')](_0x3d28ed);}})[_0xcdc9('0x26')](function(_0x45301d){if(_0x45301d){return db['User'][_0xcdc9('0x5c')]({'where':{'id':_[_0xcdc9('0x30')](_0x45301d,'UserId'),'role':_0xcdc9('0x5d')},'attributes':['id',_0xcdc9('0x2d'),'faxPause',_0xcdc9('0x5e'),_0xcdc9('0x5f')]});}})['then'](function(_0x243e08){if(_0x243e08){return{'count':_0x243e08[_0xcdc9('0x1e')],'rows':_['map'](_0x243e08[_0xcdc9('0x44')],function(_0x226c53){return{'membername':_0x226c53[_0xcdc9('0x2d')],'UserId':_0x226c53['id'],'queue_name':_0x9db93e[_0xcdc9('0x2d')],'FaxQueueId':_0x9db93e['id'],'interface':util['format']('%s/%s','SIP',_0x226c53[_0xcdc9('0x2d')]),'penalty':0x0,'paused':_0x226c53[_0xcdc9('0x60')],'createdAt':_0x226c53[_0xcdc9('0x5f')],'updatedAt':_0x226c53[_0xcdc9('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x52642a,_0x3d28ed))[_0xcdc9('0x45')](handleError(_0x52642a,null));};exports[_0xcdc9('0x61')]=function(_0x661d19,_0x2859ca,_0x58e8eb){var _0x496e2a={};var _0x110f05={};var _0x136508;var _0xf8de8c;return db[_0xcdc9('0x41')][_0xcdc9('0x56')]({'where':{'id':_0x661d19['params']['id']}})[_0xcdc9('0x26')](handleEntityNotFound(_0x2859ca,null))[_0xcdc9('0x26')](function(_0x4d1726){if(_0x4d1726){_0x136508=_0x4d1726;_0x110f05[_0xcdc9('0x37')]=_[_0xcdc9('0x33')](db[_0xcdc9('0x62')][_0xcdc9('0x31')]);_0x110f05[_0xcdc9('0x34')]=_[_0xcdc9('0x33')](_0x661d19[_0xcdc9('0x34')]);_0x110f05['filters']=_['intersection'](_0x110f05[_0xcdc9('0x37')],_0x110f05['query']);_0x496e2a[_0xcdc9('0x38')]=_[_0xcdc9('0x36')](_0x110f05[_0xcdc9('0x37')],qs[_0xcdc9('0x39')](_0x661d19[_0xcdc9('0x34')][_0xcdc9('0x39')]));_0x496e2a[_0xcdc9('0x38')]=_0x496e2a[_0xcdc9('0x38')]['length']?_0x496e2a['attributes']:_0x110f05[_0xcdc9('0x37')];_0x496e2a[_0xcdc9('0x3b')]=qs[_0xcdc9('0x3c')](_0x661d19[_0xcdc9('0x34')][_0xcdc9('0x3c')]);_0x496e2a[_0xcdc9('0x3d')]=qs['filters'](_[_0xcdc9('0x63')](_0x661d19[_0xcdc9('0x34')],_0x110f05[_0xcdc9('0x35')]));if(_0x661d19[_0xcdc9('0x34')][_0xcdc9('0x5b')]){_0x496e2a['where']=_[_0xcdc9('0x40')](_0x496e2a['where'],{'$or':_[_0xcdc9('0x30')](_0x496e2a['attributes'],function(_0xc38d5){var _0x1eba0f={};_0x1eba0f[_0xc38d5]={'$like':'%'+_0x661d19[_0xcdc9('0x34')][_0xcdc9('0x5b')]+'%'};return _0x1eba0f;})});}_0x496e2a=_[_0xcdc9('0x40')]({},_0x496e2a,_0x661d19[_0xcdc9('0x49')]);return _0x136508['getTeams'](_0x496e2a);}})['then'](function(_0x5e1a0a){if(_0x5e1a0a){_0xf8de8c=_0x5e1a0a['length'];if(!_0x661d19[_0xcdc9('0x34')]['hasOwnProperty'](_0xcdc9('0x59'))){_0x496e2a[_0xcdc9('0x20')]=qs[_0xcdc9('0x20')](_0x661d19[_0xcdc9('0x34')]['limit']);_0x496e2a[_0xcdc9('0x1f')]=qs[_0xcdc9('0x1f')](_0x661d19[_0xcdc9('0x34')][_0xcdc9('0x1f')]);}return _0x136508['getTeams'](_0x496e2a);}})['then'](function(_0x428a83){if(_0x428a83){return _0x428a83?{'count':_0xf8de8c,'rows':_0x428a83}:null;}})[_0xcdc9('0x26')](respondWithResult(_0x2859ca,null))[_0xcdc9('0x45')](handleError(_0x2859ca,null));};exports['addTeams']=function(_0x3e07dd,_0x10406d,_0x23455a){var _0x2a65d1=_0x3e07dd['body'][_0xcdc9('0x64')];return db[_0xcdc9('0x62')][_0xcdc9('0x43')]({'where':{'id':_0x2a65d1},'attributes':['id'],'include':[{'model':db[_0xcdc9('0x65')],'as':_0xcdc9('0x66'),'attributes':['id',_0xcdc9('0x2d'),_0xcdc9('0x67'),_0xcdc9('0x68'),_0xcdc9('0x69')],'raw':!![]}]})['then'](function(_0x3c1f1d){if(_0x3c1f1d){var _0x20ad70=_[_0xcdc9('0x6a')](_0x3c1f1d,function(_0x2b67cb){var _0xf96ca5=_0x2b67cb['get']({'plain':!![]});return _0xf96ca5[_0xcdc9('0x66')];});return db['FaxQueue'][_0xcdc9('0x4a')]({'where':{'id':_0x3e07dd[_0xcdc9('0x47')]['id']}})['then'](function(_0x456e65){return db[_0xcdc9('0x6b')][_0xcdc9('0x6c')](function(_0xf83738){return _0x456e65['addTeams'](_0x2a65d1,{'transaction':_0xf83738})[_0xcdc9('0x26')](function(){return BPromise['each'](_0x20ad70,function(_0x52692c){return db[_0xcdc9('0x57')][_0xcdc9('0x6d')]({'where':{'UserId':_0x52692c['id'],'FaxQueueId':_0x3e07dd[_0xcdc9('0x47')]['id']},'transaction':_0xf83738});});})[_0xcdc9('0x26')](function(){_0x20ad70[_0xcdc9('0x6e')](function(_0x34d8cf){socket[_0xcdc9('0x6f')](_0xcdc9('0x70'),{'UserId':_0x34d8cf['id'],'FaxQueueId':_0x456e65['id']});});});});});}})[_0xcdc9('0x26')](respondWithStatusCode(_0x10406d,null))[_0xcdc9('0x45')](handleError(_0x10406d,null));};exports[_0xcdc9('0x71')]=function(_0x437de2,_0x2ceeeb,_0x590acd){return db[_0xcdc9('0x62')][_0xcdc9('0x43')]({'where':{'id':_0x437de2[_0xcdc9('0x34')][_0xcdc9('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcdc9('0x66'),'attributes':['id'],'raw':!![]}]})[_0xcdc9('0x26')](handleEntityNotFound(_0x2ceeeb,null))[_0xcdc9('0x26')](function(_0x115272){var _0x9a2769=_[_0xcdc9('0x30')](_0x115272,'id');var _0x5bf337=[];var _0xa2f855=[];var _0x4f2f3b=squel[_0xcdc9('0x72')]();_0x4f2f3b[_0xcdc9('0x73')]('tq.TeamId')['from'](_0xcdc9('0x74'),'tq')[_0xcdc9('0x75')](_0xcdc9('0x76'),'ut',_0xcdc9('0x77'))[_0xcdc9('0x3d')](_0xcdc9('0x78'),_0x437de2['params']['id']);for(var _0x3c696e=0x0;_0x3c696e<_0x115272[_0xcdc9('0x3a')];_0x3c696e+=0x1){let _0x1cdb87=_0x115272[_0x3c696e];for(var _0x39ec4c=0x0;_0x39ec4c<_0x1cdb87['Agents'][_0xcdc9('0x3a')];_0x39ec4c+=0x1){let _0x5e3734=_0x1cdb87[_0xcdc9('0x66')][_0x39ec4c];var _0x4843f8=_0x4f2f3b[_0xcdc9('0x79')]();_0x4843f8[_0xcdc9('0x3d')](_0xcdc9('0x7a'),_0x5e3734['id']);_0xa2f855[_0xcdc9('0x7b')](db[_0xcdc9('0x6b')][_0xcdc9('0x34')](_0x4843f8[_0xcdc9('0x7c')](),{'type':db[_0xcdc9('0x6b')][_0xcdc9('0x7d')][_0xcdc9('0x7e')]})[_0xcdc9('0x26')](function(_0x26c934){if(_0x26c934[_0xcdc9('0x3a')]===0x1){return _0x5e3734['id'];}else{var _0x30a1ee=_[_0xcdc9('0x7f')](_[_0xcdc9('0x30')](_0x26c934,_0xcdc9('0x80')),function(_0x7cbc37){return _['includes'](_0x9a2769,_0x7cbc37);});if(_0x30a1ee){return _0x5e3734['id'];}}}));}}return BPromise['all'](_0xa2f855)[_0xcdc9('0x26')](function(_0x3e8a6e){_0x5bf337=_(_0x5bf337)['union'](_0x3e8a6e)[_0xcdc9('0x81')]()[_0xcdc9('0x82')]();return db['FaxQueue'][_0xcdc9('0x4a')]({'where':{'id':_0x437de2['params']['id']}})[_0xcdc9('0x26')](function(_0x4f89ef){return db['sequelize'][_0xcdc9('0x6c')](function(_0x458ddf){return _0x4f89ef[_0xcdc9('0x71')](_0x437de2['query'][_0xcdc9('0x64')],{'transaction':_0x458ddf})[_0xcdc9('0x26')](function(){if(!_[_0xcdc9('0x83')](_0x5bf337)){return _0x4f89ef[_0xcdc9('0x84')](_0x5bf337,{'transaction':_0x458ddf});}})[_0xcdc9('0x26')](function(){_0x5bf337[_0xcdc9('0x6e')](function(_0x5d4705){socket['emit'](_0xcdc9('0x85'),{'UserId':_0x5d4705,'FaxQueueId':_0x4f89ef['id']});});});});});});})[_0xcdc9('0x26')](respondWithStatusCode(_0x2ceeeb,null))[_0xcdc9('0x45')](handleError(_0x2ceeeb,null));};exports[_0xcdc9('0x86')]=function(_0x50bbc7,_0x471bcc,_0x496945){return db[_0xcdc9('0x41')][_0xcdc9('0x4a')]({'where':{'id':_0x50bbc7[_0xcdc9('0x47')]['id']}})[_0xcdc9('0x26')](handleEntityNotFound(_0x471bcc,null))['then'](function(_0x1b5df1){if(_0x1b5df1){return _0x1b5df1[_0xcdc9('0x86')](_0x50bbc7[_0xcdc9('0x4c')][_0xcdc9('0x64')],_[_0xcdc9('0x87')](_0x50bbc7[_0xcdc9('0x4c')],[_0xcdc9('0x64'),'id'])||{})[_0xcdc9('0x88')](function(_0x5a1146){for(var _0xa1aa21=0x0;_0xa1aa21<_0x50bbc7[_0xcdc9('0x4c')][_0xcdc9('0x64')][_0xcdc9('0x3a')];_0xa1aa21+=0x1){socket[_0xcdc9('0x6f')](_0xcdc9('0x70'),{'UserId':_0x50bbc7[_0xcdc9('0x4c')][_0xcdc9('0x64')][_0xa1aa21],'FaxQueueId':_0x50bbc7[_0xcdc9('0x47')]['id']});}return _0x5a1146;});}})[_0xcdc9('0x26')](respondWithResult(_0x471bcc,null))[_0xcdc9('0x45')](handleError(_0x471bcc,null));};exports[_0xcdc9('0x84')]=function(_0x5f4650,_0x5033f6,_0x44810a){return db[_0xcdc9('0x41')][_0xcdc9('0x4a')]({'where':{'id':_0x5f4650[_0xcdc9('0x47')]['id']}})['then'](handleEntityNotFound(_0x5033f6,null))[_0xcdc9('0x26')](function(_0x52f188){if(_0x52f188){return _0x52f188['removeAgents'](_0x5f4650[_0xcdc9('0x34')][_0xcdc9('0x64')])[_0xcdc9('0x26')](function(){if(_[_0xcdc9('0x89')](_0x5f4650['query'][_0xcdc9('0x64')])){for(var _0x4e073b=0x0;_0x4e073b<_0x5f4650['query'][_0xcdc9('0x64')][_0xcdc9('0x3a')];_0x4e073b+=0x1){socket[_0xcdc9('0x6f')](_0xcdc9('0x85'),{'UserId':Number(_0x5f4650[_0xcdc9('0x34')]['ids'][_0x4e073b]),'FaxQueueId':Number(_0x5f4650[_0xcdc9('0x47')]['id'])});}}else{socket['emit'](_0xcdc9('0x85'),{'UserId':Number(_0x5f4650['query']['ids']),'FaxQueueId':Number(_0x5f4650[_0xcdc9('0x47')]['id'])});}});}})[_0xcdc9('0x26')](respondWithStatusCode(_0x5033f6,null))['catch'](handleError(_0x5033f6,null));};exports['getAgents']=function(_0x344b93,_0x1acb76,_0x1e57a6){var _0x2ac1b6={};var _0x888f1d={};var _0x118804;var _0x212d62;return db[_0xcdc9('0x41')][_0xcdc9('0x56')]({'where':{'id':_0x344b93[_0xcdc9('0x47')]['id']}})[_0xcdc9('0x26')](handleEntityNotFound(_0x1acb76,null))[_0xcdc9('0x26')](function(_0x2acfce){if(_0x2acfce){_0x118804=_0x2acfce;_0x888f1d[_0xcdc9('0x37')]=_[_0xcdc9('0x33')](db[_0xcdc9('0x65')][_0xcdc9('0x31')]);_0x888f1d['query']=_[_0xcdc9('0x33')](_0x344b93[_0xcdc9('0x34')]);_0x888f1d['filters']=_[_0xcdc9('0x36')](_0x888f1d[_0xcdc9('0x37')],_0x888f1d[_0xcdc9('0x34')]);_0x2ac1b6[_0xcdc9('0x38')]=_['intersection'](_0x888f1d[_0xcdc9('0x37')],qs[_0xcdc9('0x39')](_0x344b93[_0xcdc9('0x34')][_0xcdc9('0x39')]));_0x2ac1b6[_0xcdc9('0x38')]=_0x2ac1b6[_0xcdc9('0x38')][_0xcdc9('0x3a')]?_0x2ac1b6['attributes']:_0x888f1d[_0xcdc9('0x37')];_0x2ac1b6[_0xcdc9('0x3b')]=qs['sort'](_0x344b93['query'][_0xcdc9('0x3c')]);_0x2ac1b6[_0xcdc9('0x3d')]=qs['filters'](_[_0xcdc9('0x63')](_0x344b93['query'],_0x888f1d[_0xcdc9('0x35')]));if(_0x344b93[_0xcdc9('0x34')]['filter']){_0x2ac1b6['where']=_[_0xcdc9('0x40')](_0x2ac1b6[_0xcdc9('0x3d')],{'$or':_[_0xcdc9('0x30')](_0x2ac1b6[_0xcdc9('0x38')],function(_0x69ba2a){var _0x59b2f7={};_0x59b2f7[_0x69ba2a]={'$like':'%'+_0x344b93[_0xcdc9('0x34')]['filter']+'%'};return _0x59b2f7;})});}_0x2ac1b6=_[_0xcdc9('0x40')]({},_0x2ac1b6,_0x344b93['options']);return _0x118804[_0xcdc9('0x8a')](_0x2ac1b6);}})[_0xcdc9('0x26')](function(_0x56a22d){if(_0x56a22d){_0x212d62=_0x56a22d['length'];if(!_0x344b93[_0xcdc9('0x34')][_0xcdc9('0x58')](_0xcdc9('0x59'))){_0x2ac1b6[_0xcdc9('0x20')]=qs['limit'](_0x344b93[_0xcdc9('0x34')][_0xcdc9('0x20')]);_0x2ac1b6['offset']=qs['offset'](_0x344b93[_0xcdc9('0x34')][_0xcdc9('0x1f')]);}return _0x118804[_0xcdc9('0x8a')](_0x2ac1b6);}})[_0xcdc9('0x26')](function(_0x57dc16){if(_0x57dc16){return _0x57dc16?{'count':_0x212d62,'rows':_0x57dc16}:null;}})[_0xcdc9('0x26')](respondWithResult(_0x1acb76,null))[_0xcdc9('0x45')](handleError(_0x1acb76,null));};
\ No newline at end of file
+var _0x52fd=['FaxQueueId','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','rows','format','getTeams','findOne','addTeams','ids','Agents','online','voicePause','interface','each','emit','userFaxQueue:save','removeTeams','Team','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','FaxQueues','UserProfileResource','error','stack','name','index','map','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueue','include','findAll','catch','show','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserFaxQueue','rawAttributes','nolimit'];(function(_0x351f2f,_0x533e88){var _0x3acc1a=function(_0x5c1297){while(--_0x5c1297){_0x351f2f['push'](_0x351f2f['shift']());}};_0x3acc1a(++_0x533e88);}(_0x52fd,0x1df));var _0xd52f=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x52fd[_0x13b02f];return _0x12e9a6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd52f('0x0'));var rimraf=require(_0xd52f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd52f('0x2'));var rp=require(_0xd52f('0x3'));var moment=require(_0xd52f('0x4'));var BPromise=require(_0xd52f('0x5'));var Mustache=require('mustache');var util=require(_0xd52f('0x6'));var path=require(_0xd52f('0x7'));var sox=require('sox');var csv=require(_0xd52f('0x8'));var ejs=require(_0xd52f('0x9'));var fs=require('fs');var _=require(_0xd52f('0xa'));var squel=require(_0xd52f('0xb'));var crypto=require(_0xd52f('0xc'));var jsforce=require(_0xd52f('0xd'));var deskjs=require(_0xd52f('0xe'));var toCsv=require(_0xd52f('0x8'));var querystring=require(_0xd52f('0xf'));var Papa=require(_0xd52f('0x10'));var Redis=require(_0xd52f('0x11'));var authService=require(_0xd52f('0x12'));var qs=require(_0xd52f('0x13'));var as=require(_0xd52f('0x14'));var hardwareService=require(_0xd52f('0x15'));var logger=require(_0xd52f('0x16'))(_0xd52f('0x17'));var utils=require(_0xd52f('0x18'));var config=require(_0xd52f('0x19'));var db=require(_0xd52f('0x1a'))['db'];config['redis']=_['defaults'](config[_0xd52f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xd52f('0x1c'))(new Redis(config['redis']));require(_0xd52f('0x1d'))[_0xd52f('0x1e')](socket);function respondWithStatusCode(_0x4b37fe,_0x2bcafa){_0x2bcafa=_0x2bcafa||0xcc;return function(_0x1a71c2){if(_0x1a71c2){return _0x4b37fe[_0xd52f('0x1f')](_0x2bcafa);}return _0x4b37fe[_0xd52f('0x20')](_0x2bcafa)[_0xd52f('0x21')]();};}function respondWithResult(_0x23ae22,_0x106873){_0x106873=_0x106873||0xc8;return function(_0x3a27b8){if(_0x3a27b8){return _0x23ae22[_0xd52f('0x20')](_0x106873)[_0xd52f('0x22')](_0x3a27b8);}};}function respondWithFilteredResult(_0x6cf77a,_0x150d95){return function(_0x3a22fd){if(_0x3a22fd){var _0x24409c=_0x3a22fd[_0xd52f('0x23')],_0x597ab1=_0x150d95['offset'],_0x4deaa3=_0x150d95[_0xd52f('0x24')]+_0x150d95[_0xd52f('0x25')],_0x1cbf1d;if(_0x4deaa3>=_0x24409c){_0x4deaa3=_0x24409c;_0x1cbf1d=0xc8;}else{_0x1cbf1d=0xce;}_0x6cf77a['status'](_0x1cbf1d);return _0x6cf77a[_0xd52f('0x26')](_0xd52f('0x27'),_0x597ab1+'-'+_0x4deaa3+'/'+_0x24409c)['json'](_0x3a22fd);}return null;};}function patchUpdates(_0x1196c5){return function(_0xadc295){try{jsonpatch[_0xd52f('0x28')](_0xadc295,_0x1196c5,!![]);}catch(_0x46d868){return BPromise[_0xd52f('0x29')](_0x46d868);}return _0xadc295[_0xd52f('0x2a')]();};}function saveUpdates(_0x54875d,_0x416f57){return function(_0x43eb92){if(_0x43eb92){return _0x43eb92[_0xd52f('0x2b')](_0x54875d)['then'](function(_0x1db722){return _0x1db722;});}return null;};}function removeEntity(_0x56dd34,_0x4702ee){return function(_0x439fd1){if(_0x439fd1){return _0x439fd1[_0xd52f('0x2c')]()[_0xd52f('0x2d')](function(){var _0x19cd33=_0x439fd1['get']({'plain':!![]});var _0x36b77c=_0xd52f('0x2e');return db[_0xd52f('0x2f')][_0xd52f('0x2c')]({'where':{'type':_0x36b77c,'resourceId':_0x19cd33['id']}})[_0xd52f('0x2d')](function(){return _0x439fd1;});})[_0xd52f('0x2d')](function(){_0x56dd34[_0xd52f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd567,_0x62ec32){return function(_0x399fe8){if(!_0x399fe8){_0x2fd567[_0xd52f('0x1f')](0x194);}return _0x399fe8;};}function handleError(_0x489b6b,_0x4966c4){_0x4966c4=_0x4966c4||0x1f4;return function(_0x56abdc){logger[_0xd52f('0x30')](_0x56abdc[_0xd52f('0x31')]);if(_0x56abdc[_0xd52f('0x32')]){delete _0x56abdc[_0xd52f('0x32')];}_0x489b6b[_0xd52f('0x20')](_0x4966c4)['send'](_0x56abdc);};}exports[_0xd52f('0x33')]=function(_0x574338,_0x473c34){var _0x8bd454={},_0x45e967={},_0x3fa35e={'count':0x0,'rows':[]};var _0x355b73=_[_0xd52f('0x34')](db['FaxQueue']['rawAttributes'],function(_0x1625e8){return{'name':_0x1625e8[_0xd52f('0x35')],'type':_0x1625e8[_0xd52f('0x36')]['key']};});_0x45e967[_0xd52f('0x37')]=_[_0xd52f('0x34')](_0x355b73,'name');_0x45e967['query']=_[_0xd52f('0x38')](_0x574338[_0xd52f('0x39')]);_0x45e967[_0xd52f('0x3a')]=_[_0xd52f('0x3b')](_0x45e967[_0xd52f('0x37')],_0x45e967['query']);_0x8bd454['attributes']=_[_0xd52f('0x3b')](_0x45e967[_0xd52f('0x37')],qs['fields'](_0x574338[_0xd52f('0x39')][_0xd52f('0x3c')]));_0x8bd454[_0xd52f('0x3d')]=_0x8bd454['attributes'][_0xd52f('0x3e')]?_0x8bd454[_0xd52f('0x3d')]:_0x45e967['model'];if(!_0x574338[_0xd52f('0x39')][_0xd52f('0x3f')]('nolimit')){_0x8bd454[_0xd52f('0x25')]=qs[_0xd52f('0x25')](_0x574338[_0xd52f('0x39')][_0xd52f('0x25')]);_0x8bd454[_0xd52f('0x24')]=qs['offset'](_0x574338[_0xd52f('0x39')]['offset']);}_0x8bd454[_0xd52f('0x40')]=qs['sort'](_0x574338[_0xd52f('0x39')][_0xd52f('0x41')]);_0x8bd454[_0xd52f('0x42')]=qs[_0xd52f('0x3a')](_[_0xd52f('0x43')](_0x574338[_0xd52f('0x39')],_0x45e967[_0xd52f('0x3a')]),_0x355b73);if(_0x574338[_0xd52f('0x39')][_0xd52f('0x44')]){_0x8bd454[_0xd52f('0x42')]=_[_0xd52f('0x45')](_0x8bd454[_0xd52f('0x42')],{'$or':_[_0xd52f('0x34')](_0x355b73,function(_0x3f069f){if(_0x3f069f[_0xd52f('0x36')]!==_0xd52f('0x46')){var _0x5f2c65={};_0x5f2c65[_0x3f069f[_0xd52f('0x32')]]={'$like':'%'+_0x574338[_0xd52f('0x39')]['filter']+'%'};return _0x5f2c65;}})});}_0x8bd454=_[_0xd52f('0x45')]({},_0x8bd454,_0x574338[_0xd52f('0x47')]);var _0x2db0ed={'where':_0x8bd454[_0xd52f('0x42')]};return db[_0xd52f('0x48')]['count'](_0x2db0ed)[_0xd52f('0x2d')](function(_0x2d57a2){_0x3fa35e[_0xd52f('0x23')]=_0x2d57a2;if(_0x574338[_0xd52f('0x39')]['includeAll']){_0x8bd454[_0xd52f('0x49')]=[{'all':!![]}];}return db[_0xd52f('0x48')][_0xd52f('0x4a')](_0x8bd454);})['then'](function(_0x1db2e9){_0x3fa35e['rows']=_0x1db2e9;return _0x3fa35e;})[_0xd52f('0x2d')](respondWithFilteredResult(_0x473c34,_0x8bd454))[_0xd52f('0x4b')](handleError(_0x473c34,null));};exports[_0xd52f('0x4c')]=function(_0x55f7d2,_0x23279c){var _0x490f84={'raw':!![],'where':{'id':_0x55f7d2['params']['id']}},_0x2348f6={};_0x2348f6[_0xd52f('0x37')]=_[_0xd52f('0x38')](db[_0xd52f('0x48')]['rawAttributes']);_0x2348f6[_0xd52f('0x39')]=_[_0xd52f('0x38')](_0x55f7d2[_0xd52f('0x39')]);_0x2348f6[_0xd52f('0x3a')]=_[_0xd52f('0x3b')](_0x2348f6[_0xd52f('0x37')],_0x2348f6['query']);_0x490f84[_0xd52f('0x3d')]=_['intersection'](_0x2348f6[_0xd52f('0x37')],qs[_0xd52f('0x3c')](_0x55f7d2[_0xd52f('0x39')][_0xd52f('0x3c')]));_0x490f84[_0xd52f('0x3d')]=_0x490f84[_0xd52f('0x3d')][_0xd52f('0x3e')]?_0x490f84['attributes']:_0x2348f6['model'];if(_0x55f7d2[_0xd52f('0x39')][_0xd52f('0x4d')]){_0x490f84['include']=[{'all':!![]}];}_0x490f84=_['merge']({},_0x490f84,_0x55f7d2[_0xd52f('0x47')]);return db[_0xd52f('0x48')][_0xd52f('0x4e')](_0x490f84)[_0xd52f('0x2d')](handleEntityNotFound(_0x23279c,null))['then'](respondWithResult(_0x23279c,null))[_0xd52f('0x4b')](handleError(_0x23279c,null));};exports[_0xd52f('0x4f')]=function(_0xd154dd,_0x37f13a){return db[_0xd52f('0x48')][_0xd52f('0x4f')](_0xd154dd[_0xd52f('0x50')],{})['then'](function(_0x547a9e){var _0x35ed0d=_0xd154dd[_0xd52f('0x51')][_0xd52f('0x52')]({'plain':!![]});if(!_0x35ed0d)throw new Error(_0xd52f('0x53'));if(_0x35ed0d[_0xd52f('0x54')]===_0xd52f('0x51')){var _0x2d41ea=_0x547a9e[_0xd52f('0x52')]({'plain':!![]});var _0x540737=_0xd52f('0x2e');return db[_0xd52f('0x55')][_0xd52f('0x4e')]({'where':{'name':_0x540737,'userProfileId':_0x35ed0d['userProfileId']},'raw':!![]})[_0xd52f('0x2d')](function(_0x37cb45){if(_0x37cb45&&_0x37cb45[_0xd52f('0x56')]===0x0){return db[_0xd52f('0x2f')]['create']({'name':_0x2d41ea['name'],'resourceId':_0x2d41ea['id'],'type':_0x37cb45[_0xd52f('0x32')],'sectionId':_0x37cb45['id']},{})[_0xd52f('0x2d')](function(){return _0x547a9e;});}else{return _0x547a9e;}})['catch'](function(_0x561b5d){logger[_0xd52f('0x30')](_0xd52f('0x57'),_0x561b5d);throw _0x561b5d;});}return _0x547a9e;})[_0xd52f('0x2d')](respondWithResult(_0x37f13a,0xc9))['catch'](handleError(_0x37f13a,null));};exports['update']=function(_0x3052e6,_0x3585e0){if(_0x3052e6[_0xd52f('0x50')]['id']){delete _0x3052e6[_0xd52f('0x50')]['id'];}return db[_0xd52f('0x48')]['find']({'where':{'id':_0x3052e6['params']['id']}})[_0xd52f('0x2d')](handleEntityNotFound(_0x3585e0,null))['then'](saveUpdates(_0x3052e6['body'],null))[_0xd52f('0x2d')](respondWithResult(_0x3585e0,null))[_0xd52f('0x4b')](handleError(_0x3585e0,null));};exports['destroy']=function(_0x206601,_0x1d7e04){return db[_0xd52f('0x48')][_0xd52f('0x4e')]({'where':{'id':_0x206601[_0xd52f('0x58')]['id']}})[_0xd52f('0x2d')](handleEntityNotFound(_0x1d7e04,null))[_0xd52f('0x2d')](removeEntity(_0x1d7e04,null))[_0xd52f('0x4b')](handleError(_0x1d7e04,null));};exports[_0xd52f('0x59')]=function(_0x38d25d,_0x158e17){return db[_0xd52f('0x48')][_0xd52f('0x59')]()[_0xd52f('0x2d')](respondWithResult(_0x158e17,null))[_0xd52f('0x4b')](handleError(_0x158e17,null));};exports['getMembers']=function(_0x403c31,_0x4a2296,_0x5011fe){var _0x264c6b={'raw':!![],'where':{}},_0x27bacd={},_0x2bcb85;return db[_0xd52f('0x48')]['findOne']({'where':{'id':_0x403c31[_0xd52f('0x58')]['id']}})[_0xd52f('0x2d')](handleEntityNotFound(_0x4a2296,null))[_0xd52f('0x2d')](function(_0xf529de){if(_0xf529de){_0x2bcb85=_0xf529de[_0xd52f('0x52')]({'plain':!![]});_0x27bacd[_0xd52f('0x37')]=_[_0xd52f('0x38')](db[_0xd52f('0x5a')][_0xd52f('0x5b')]);_0x27bacd[_0xd52f('0x39')]=_['keys'](_0x403c31['query']);_0x27bacd[_0xd52f('0x3a')]=_[_0xd52f('0x3b')](_0x27bacd[_0xd52f('0x37')],_0x27bacd[_0xd52f('0x39')]);_0x264c6b['attributes']=_[_0xd52f('0x3b')](_0x27bacd['model'],qs[_0xd52f('0x3c')](_0x403c31[_0xd52f('0x39')][_0xd52f('0x3c')]));_0x264c6b['attributes']=_0x264c6b[_0xd52f('0x3d')]['length']?_0x264c6b['attributes']:_0x27bacd[_0xd52f('0x37')];if(!_0x403c31[_0xd52f('0x39')][_0xd52f('0x3f')](_0xd52f('0x5c'))){_0x264c6b[_0xd52f('0x25')]=qs[_0xd52f('0x25')](_0x403c31[_0xd52f('0x39')][_0xd52f('0x25')]);_0x264c6b[_0xd52f('0x24')]=qs[_0xd52f('0x24')](_0x403c31['query'][_0xd52f('0x24')]);}_0x264c6b[_0xd52f('0x40')]=qs['sort'](_0x403c31['query'][_0xd52f('0x41')]);_0x264c6b[_0xd52f('0x42')]=qs[_0xd52f('0x3a')](_[_0xd52f('0x43')](_0x403c31['query'],_0x27bacd['filters']));_0x264c6b['where'][_0xd52f('0x5d')]=_0xf529de['id'];if(_0x403c31['query']['filter']){_0x264c6b[_0xd52f('0x42')]=_[_0xd52f('0x45')](_0x264c6b['where'],{'$or':_[_0xd52f('0x34')](_0x264c6b[_0xd52f('0x3d')],function(_0x59aec6){var _0x4c11b5={};_0x4c11b5[_0x59aec6]={'$like':'%'+_0x403c31[_0xd52f('0x39')]['filter']+'%'};return _0x4c11b5;})});}_0x264c6b=_[_0xd52f('0x45')]({},_0x264c6b,_0x403c31[_0xd52f('0x47')]);return db[_0xd52f('0x5a')][_0xd52f('0x4a')](_0x264c6b);}})[_0xd52f('0x2d')](function(_0x248caf){if(_0x248caf){return db[_0xd52f('0x5e')][_0xd52f('0x5f')]({'where':{'id':_[_0xd52f('0x34')](_0x248caf,'UserId'),'role':_0xd52f('0x60')},'attributes':['id',_0xd52f('0x32'),_0xd52f('0x61'),_0xd52f('0x62'),_0xd52f('0x63')]});}})[_0xd52f('0x2d')](function(_0x164de3){if(_0x164de3){return{'count':_0x164de3[_0xd52f('0x23')],'rows':_[_0xd52f('0x34')](_0x164de3[_0xd52f('0x64')],function(_0x46dca6){return{'membername':_0x46dca6[_0xd52f('0x32')],'UserId':_0x46dca6['id'],'queue_name':_0x2bcb85[_0xd52f('0x32')],'FaxQueueId':_0x2bcb85['id'],'interface':util[_0xd52f('0x65')]('%s/%s','SIP',_0x46dca6[_0xd52f('0x32')]),'penalty':0x0,'paused':_0x46dca6[_0xd52f('0x61')],'createdAt':_0x46dca6['createdAt'],'updatedAt':_0x46dca6[_0xd52f('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a2296,_0x264c6b))['catch'](handleError(_0x4a2296,null));};exports[_0xd52f('0x66')]=function(_0x4cdd7f,_0x230874,_0xfcb66a){var _0x4a6e19={};var _0x21e6bd={};var _0x3daa43;var _0x592bfa;return db[_0xd52f('0x48')][_0xd52f('0x67')]({'where':{'id':_0x4cdd7f['params']['id']}})[_0xd52f('0x2d')](handleEntityNotFound(_0x230874,null))[_0xd52f('0x2d')](function(_0x1b08a0){if(_0x1b08a0){_0x3daa43=_0x1b08a0;_0x21e6bd[_0xd52f('0x37')]=_[_0xd52f('0x38')](db['Team'][_0xd52f('0x5b')]);_0x21e6bd[_0xd52f('0x39')]=_[_0xd52f('0x38')](_0x4cdd7f['query']);_0x21e6bd[_0xd52f('0x3a')]=_[_0xd52f('0x3b')](_0x21e6bd[_0xd52f('0x37')],_0x21e6bd['query']);_0x4a6e19[_0xd52f('0x3d')]=_['intersection'](_0x21e6bd[_0xd52f('0x37')],qs['fields'](_0x4cdd7f[_0xd52f('0x39')][_0xd52f('0x3c')]));_0x4a6e19[_0xd52f('0x3d')]=_0x4a6e19[_0xd52f('0x3d')]['length']?_0x4a6e19['attributes']:_0x21e6bd[_0xd52f('0x37')];_0x4a6e19[_0xd52f('0x40')]=qs[_0xd52f('0x41')](_0x4cdd7f[_0xd52f('0x39')][_0xd52f('0x41')]);_0x4a6e19[_0xd52f('0x42')]=qs['filters'](_[_0xd52f('0x43')](_0x4cdd7f[_0xd52f('0x39')],_0x21e6bd['filters']));if(_0x4cdd7f[_0xd52f('0x39')][_0xd52f('0x44')]){_0x4a6e19[_0xd52f('0x42')]=_[_0xd52f('0x45')](_0x4a6e19[_0xd52f('0x42')],{'$or':_[_0xd52f('0x34')](_0x4a6e19[_0xd52f('0x3d')],function(_0x86a6ed){var _0x48923a={};_0x48923a[_0x86a6ed]={'$like':'%'+_0x4cdd7f[_0xd52f('0x39')][_0xd52f('0x44')]+'%'};return _0x48923a;})});}_0x4a6e19=_[_0xd52f('0x45')]({},_0x4a6e19,_0x4cdd7f[_0xd52f('0x47')]);return _0x3daa43[_0xd52f('0x66')](_0x4a6e19);}})[_0xd52f('0x2d')](function(_0x23c01e){if(_0x23c01e){_0x592bfa=_0x23c01e[_0xd52f('0x3e')];if(!_0x4cdd7f[_0xd52f('0x39')]['hasOwnProperty'](_0xd52f('0x5c'))){_0x4a6e19[_0xd52f('0x25')]=qs[_0xd52f('0x25')](_0x4cdd7f[_0xd52f('0x39')][_0xd52f('0x25')]);_0x4a6e19['offset']=qs[_0xd52f('0x24')](_0x4cdd7f[_0xd52f('0x39')][_0xd52f('0x24')]);}return _0x3daa43[_0xd52f('0x66')](_0x4a6e19);}})[_0xd52f('0x2d')](function(_0x4e3813){if(_0x4e3813){return _0x4e3813?{'count':_0x592bfa,'rows':_0x4e3813}:null;}})[_0xd52f('0x2d')](respondWithResult(_0x230874,null))[_0xd52f('0x4b')](handleError(_0x230874,null));};exports[_0xd52f('0x68')]=function(_0x1603ce,_0x46737f,_0x153666){var _0x2b0055=_0x1603ce[_0xd52f('0x50')][_0xd52f('0x69')];return db['Team'][_0xd52f('0x4a')]({'where':{'id':_0x2b0055},'attributes':['id'],'include':[{'model':db[_0xd52f('0x5e')],'as':_0xd52f('0x6a'),'attributes':['id',_0xd52f('0x32'),_0xd52f('0x6b'),_0xd52f('0x6c'),_0xd52f('0x6d')],'raw':!![]}]})['then'](function(_0x23898a){if(_0x23898a){var _0x172ad0=_['flatMap'](_0x23898a,function(_0x2de10e){var _0x459682=_0x2de10e[_0xd52f('0x52')]({'plain':!![]});return _0x459682[_0xd52f('0x6a')];});return db[_0xd52f('0x48')][_0xd52f('0x4e')]({'where':{'id':_0x1603ce['params']['id']}})['then'](function(_0x227a6a){return db['sequelize']['transaction'](function(_0x431f8f){return _0x227a6a[_0xd52f('0x68')](_0x2b0055,{'transaction':_0x431f8f})[_0xd52f('0x2d')](function(){return BPromise[_0xd52f('0x6e')](_0x172ad0,function(_0x4afbde){return db[_0xd52f('0x5a')]['findOrCreate']({'where':{'UserId':_0x4afbde['id'],'FaxQueueId':_0x1603ce[_0xd52f('0x58')]['id']},'transaction':_0x431f8f});});})[_0xd52f('0x2d')](function(){_0x172ad0['forEach'](function(_0x18b5c8){socket[_0xd52f('0x6f')](_0xd52f('0x70'),{'UserId':_0x18b5c8['id'],'FaxQueueId':_0x227a6a['id']});});});});});}})[_0xd52f('0x2d')](respondWithStatusCode(_0x46737f,null))[_0xd52f('0x4b')](handleError(_0x46737f,null));};exports[_0xd52f('0x71')]=function(_0x12bcbf,_0x572a89,_0x5d9884){return db[_0xd52f('0x72')][_0xd52f('0x4a')]({'where':{'id':_0x12bcbf['query'][_0xd52f('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd52f('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xd52f('0x2d')](handleEntityNotFound(_0x572a89,null))[_0xd52f('0x2d')](function(_0x343306){var _0x4a6259=_[_0xd52f('0x34')](_0x343306,'id');var _0x4cfb4e=[];var _0x1c6d2d=[];var _0x6b9592=squel[_0xd52f('0x73')]();_0x6b9592['field'](_0xd52f('0x74'))[_0xd52f('0x75')](_0xd52f('0x76'),'tq')[_0xd52f('0x77')](_0xd52f('0x78'),'ut',_0xd52f('0x79'))[_0xd52f('0x42')](_0xd52f('0x7a'),_0x12bcbf[_0xd52f('0x58')]['id']);for(var _0x388970=0x0;_0x388970<_0x343306[_0xd52f('0x3e')];_0x388970+=0x1){let _0x2298a4=_0x343306[_0x388970];for(var _0x31e2d7=0x0;_0x31e2d7<_0x2298a4[_0xd52f('0x6a')][_0xd52f('0x3e')];_0x31e2d7+=0x1){let _0x40a2f8=_0x2298a4['Agents'][_0x31e2d7];var _0x36a51c=_0x6b9592['clone']();_0x36a51c['where'](_0xd52f('0x7b'),_0x40a2f8['id']);_0x1c6d2d[_0xd52f('0x7c')](db['sequelize']['query'](_0x36a51c['toString'](),{'type':db[_0xd52f('0x7d')][_0xd52f('0x7e')][_0xd52f('0x7f')]})[_0xd52f('0x2d')](function(_0xda1827){if(_0xda1827[_0xd52f('0x3e')]===0x1){return _0x40a2f8['id'];}else{var _0x40c204=_[_0xd52f('0x80')](_[_0xd52f('0x34')](_0xda1827,_0xd52f('0x81')),function(_0x2fee4b){return _[_0xd52f('0x82')](_0x4a6259,_0x2fee4b);});if(_0x40c204){return _0x40a2f8['id'];}}}));}}return BPromise[_0xd52f('0x83')](_0x1c6d2d)['then'](function(_0x115159){_0x4cfb4e=_(_0x4cfb4e)[_0xd52f('0x84')](_0x115159)[_0xd52f('0x85')]()['value']();return db[_0xd52f('0x48')][_0xd52f('0x4e')]({'where':{'id':_0x12bcbf[_0xd52f('0x58')]['id']}})['then'](function(_0x461bf5){return db[_0xd52f('0x7d')][_0xd52f('0x86')](function(_0x10be6e){return _0x461bf5[_0xd52f('0x71')](_0x12bcbf[_0xd52f('0x39')][_0xd52f('0x69')],{'transaction':_0x10be6e})[_0xd52f('0x2d')](function(){if(!_[_0xd52f('0x87')](_0x4cfb4e)){return _0x461bf5[_0xd52f('0x88')](_0x4cfb4e,{'transaction':_0x10be6e});}})['then'](function(){_0x4cfb4e['forEach'](function(_0x5dcb18){socket['emit'](_0xd52f('0x89'),{'UserId':_0x5dcb18,'FaxQueueId':_0x461bf5['id']});});});});});});})[_0xd52f('0x2d')](respondWithStatusCode(_0x572a89,null))[_0xd52f('0x4b')](handleError(_0x572a89,null));};exports[_0xd52f('0x8a')]=function(_0x357c64,_0xffca92,_0x401983){return db['FaxQueue'][_0xd52f('0x4e')]({'where':{'id':_0x357c64[_0xd52f('0x58')]['id']}})[_0xd52f('0x2d')](handleEntityNotFound(_0xffca92,null))['then'](function(_0x572f09){if(_0x572f09){return _0x572f09[_0xd52f('0x8a')](_0x357c64['body'][_0xd52f('0x69')],_[_0xd52f('0x8b')](_0x357c64['body'],[_0xd52f('0x69'),'id'])||{})[_0xd52f('0x8c')](function(_0x42adff){for(var _0x2901da=0x0;_0x2901da<_0x357c64[_0xd52f('0x50')][_0xd52f('0x69')]['length'];_0x2901da+=0x1){socket[_0xd52f('0x6f')](_0xd52f('0x70'),{'UserId':_0x357c64[_0xd52f('0x50')][_0xd52f('0x69')][_0x2901da],'FaxQueueId':_0x357c64[_0xd52f('0x58')]['id']});}return _0x42adff;});}})[_0xd52f('0x2d')](respondWithResult(_0xffca92,null))[_0xd52f('0x4b')](handleError(_0xffca92,null));};exports[_0xd52f('0x88')]=function(_0x44a8fe,_0x75e02b,_0x52a01a){return db[_0xd52f('0x48')][_0xd52f('0x4e')]({'where':{'id':_0x44a8fe[_0xd52f('0x58')]['id']}})[_0xd52f('0x2d')](handleEntityNotFound(_0x75e02b,null))[_0xd52f('0x2d')](function(_0x555050){if(_0x555050){return _0x555050[_0xd52f('0x88')](_0x44a8fe[_0xd52f('0x39')][_0xd52f('0x69')])[_0xd52f('0x2d')](function(){if(_[_0xd52f('0x8d')](_0x44a8fe[_0xd52f('0x39')][_0xd52f('0x69')])){for(var _0x13ae5e=0x0;_0x13ae5e<_0x44a8fe[_0xd52f('0x39')][_0xd52f('0x69')][_0xd52f('0x3e')];_0x13ae5e+=0x1){socket[_0xd52f('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x44a8fe[_0xd52f('0x39')]['ids'][_0x13ae5e]),'FaxQueueId':Number(_0x44a8fe[_0xd52f('0x58')]['id'])});}}else{socket[_0xd52f('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x44a8fe['query'][_0xd52f('0x69')]),'FaxQueueId':Number(_0x44a8fe[_0xd52f('0x58')]['id'])});}});}})[_0xd52f('0x2d')](respondWithStatusCode(_0x75e02b,null))[_0xd52f('0x4b')](handleError(_0x75e02b,null));};exports[_0xd52f('0x8e')]=function(_0x3d3633,_0x19f066,_0x587031){var _0x3dae55={};var _0x4804e2={};var _0x3450de;var _0x2d5cf2;return db[_0xd52f('0x48')][_0xd52f('0x67')]({'where':{'id':_0x3d3633[_0xd52f('0x58')]['id']}})[_0xd52f('0x2d')](handleEntityNotFound(_0x19f066,null))[_0xd52f('0x2d')](function(_0x66cdd){if(_0x66cdd){_0x3450de=_0x66cdd;_0x4804e2[_0xd52f('0x37')]=_[_0xd52f('0x38')](db[_0xd52f('0x5e')][_0xd52f('0x5b')]);_0x4804e2[_0xd52f('0x39')]=_[_0xd52f('0x38')](_0x3d3633[_0xd52f('0x39')]);_0x4804e2[_0xd52f('0x3a')]=_['intersection'](_0x4804e2[_0xd52f('0x37')],_0x4804e2[_0xd52f('0x39')]);_0x3dae55['attributes']=_[_0xd52f('0x3b')](_0x4804e2['model'],qs[_0xd52f('0x3c')](_0x3d3633[_0xd52f('0x39')][_0xd52f('0x3c')]));_0x3dae55['attributes']=_0x3dae55[_0xd52f('0x3d')][_0xd52f('0x3e')]?_0x3dae55[_0xd52f('0x3d')]:_0x4804e2[_0xd52f('0x37')];_0x3dae55[_0xd52f('0x40')]=qs['sort'](_0x3d3633[_0xd52f('0x39')]['sort']);_0x3dae55[_0xd52f('0x42')]=qs['filters'](_[_0xd52f('0x43')](_0x3d3633[_0xd52f('0x39')],_0x4804e2['filters']));if(_0x3d3633[_0xd52f('0x39')][_0xd52f('0x44')]){_0x3dae55[_0xd52f('0x42')]=_[_0xd52f('0x45')](_0x3dae55['where'],{'$or':_[_0xd52f('0x34')](_0x3dae55[_0xd52f('0x3d')],function(_0x4c5616){var _0x54e809={};_0x54e809[_0x4c5616]={'$like':'%'+_0x3d3633[_0xd52f('0x39')][_0xd52f('0x44')]+'%'};return _0x54e809;})});}_0x3dae55=_[_0xd52f('0x45')]({},_0x3dae55,_0x3d3633[_0xd52f('0x47')]);return _0x3450de[_0xd52f('0x8e')](_0x3dae55);}})[_0xd52f('0x2d')](function(_0x1d37ab){if(_0x1d37ab){_0x2d5cf2=_0x1d37ab[_0xd52f('0x3e')];if(!_0x3d3633[_0xd52f('0x39')][_0xd52f('0x3f')](_0xd52f('0x5c'))){_0x3dae55[_0xd52f('0x25')]=qs[_0xd52f('0x25')](_0x3d3633[_0xd52f('0x39')]['limit']);_0x3dae55[_0xd52f('0x24')]=qs[_0xd52f('0x24')](_0x3d3633[_0xd52f('0x39')][_0xd52f('0x24')]);}return _0x3450de['getAgents'](_0x3dae55);}})[_0xd52f('0x2d')](function(_0x30662c){if(_0x30662c){return _0x30662c?{'count':_0x2d5cf2,'rows':_0x30662c}:null;}})[_0xd52f('0x2d')](respondWithResult(_0x19f066,null))[_0xd52f('0x4b')](handleError(_0x19f066,null));};
\ No newline at end of file
index c4a8527..fa991d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71fc=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue'];(function(_0x50e7c0,_0x433edc){var _0x14c0ef=function(_0x97f05){while(--_0x97f05){_0x50e7c0['push'](_0x50e7c0['shift']());}};_0x14c0ef(++_0x433edc);}(_0x71fc,0xba));var _0xc71f=function(_0xa5f158,_0x38728e){_0xa5f158=_0xa5f158-0x0;var _0x5d7654=_0x71fc[_0xa5f158];return _0x5d7654;};'use strict';var EventEmitter=require(_0xc71f('0x0'));var FaxQueue=require(_0xc71f('0x1'))['db'][_0xc71f('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc71f('0x3')](0x0);var events={'afterCreate':_0xc71f('0x4'),'afterUpdate':_0xc71f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2c4c81){return function(_0xf6946,_0x169891,_0x118d41){FaxQueueEvents[_0xc71f('0x6')](_0x2c4c81+':'+_0xf6946['id'],_0xf6946);FaxQueueEvents[_0xc71f('0x6')](_0x2c4c81,_0xf6946);_0x118d41(null);};}for(var e in events){if(events[_0xc71f('0x7')](e)){var event=events[e];FaxQueue[_0xc71f('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0xc736=['events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x176b3c,_0x3016ca){var _0x459e58=function(_0x49dd1b){while(--_0x49dd1b){_0x176b3c['push'](_0x176b3c['shift']());}};_0x459e58(++_0x3016ca);}(_0xc736,0xf2));var _0x6c73=function(_0x4b01c0,_0x199466){_0x4b01c0=_0x4b01c0-0x0;var _0x33c771=_0xc736[_0x4b01c0];return _0x33c771;};'use strict';var EventEmitter=require(_0x6c73('0x0'));var FaxQueue=require(_0x6c73('0x1'))['db'][_0x6c73('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6c73('0x3')](0x0);var events={'afterCreate':_0x6c73('0x4'),'afterUpdate':_0x6c73('0x5'),'afterDestroy':_0x6c73('0x6')};function emitEvent(_0x4414ad){return function(_0x1652bf,_0x21980c,_0x2a885d){FaxQueueEvents[_0x6c73('0x7')](_0x4414ad+':'+_0x1652bf['id'],_0x1652bf);FaxQueueEvents[_0x6c73('0x7')](_0x4414ad,_0x1652bf);_0x2a885d(null);};}for(var e in events){if(events[_0x6c73('0x8')](e)){var event=events[e];FaxQueue[_0x6c73('0x9')](e,emitEvent(event));}}module[_0x6c73('0xa')]=FaxQueueEvents;
\ No newline at end of file
index 19cd936..4c82448 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a67=['path','rimraf','../../config/environment','./faxQueue.attributes','util','../../config/logger','api','bluebird','request-promise'];(function(_0xd43829,_0x5dba5e){var _0x3b7d74=function(_0x138953){while(--_0x138953){_0xd43829['push'](_0xd43829['shift']());}};_0x3b7d74(++_0x5dba5e);}(_0x8a67,0xf7));var _0x78a6=function(_0x16bbc2,_0x5318af){_0x16bbc2=_0x16bbc2-0x0;var _0x147dd4=_0x8a67[_0x16bbc2];return _0x147dd4;};'use strict';var _=require('lodash');var util=require(_0x78a6('0x0'));var logger=require(_0x78a6('0x1'))(_0x78a6('0x2'));var moment=require('moment');var BPromise=require(_0x78a6('0x3'));var rp=require(_0x78a6('0x4'));var fs=require('fs');var path=require(_0x78a6('0x5'));var rimraf=require(_0x78a6('0x6'));var config=require(_0x78a6('0x7'));var attributes=require(_0x78a6('0x8'));module['exports']=function(_0x1ca17c,_0x23446c){return _0x1ca17c['define']('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7551=['fax_queues','lodash','util','api','moment','../../config/environment','exports','define','FaxQueue'];(function(_0x24a6bb,_0x50032e){var _0x2b2f66=function(_0x5b8739){while(--_0x5b8739){_0x24a6bb['push'](_0x24a6bb['shift']());}};_0x2b2f66(++_0x50032e);}(_0x7551,0x64));var _0x1755=function(_0x317eec,_0x3ee146){_0x317eec=_0x317eec-0x0;var _0x35a465=_0x7551[_0x317eec];return _0x35a465;};'use strict';var _=require(_0x1755('0x0'));var util=require(_0x1755('0x1'));var logger=require('../../config/logger')(_0x1755('0x2'));var moment=require(_0x1755('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1755('0x4'));var attributes=require('./faxQueue.attributes');module[_0x1755('0x5')]=function(_0x3832cd,_0x1fceb7){return _0x3832cd[_0x1755('0x6')](_0x1755('0x7'),attributes,{'tableName':_0x1755('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 70d3b9e..f4a9a6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb06=['FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','include','model','map','ShowFaxQueue','find','raw','then','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x545041,_0x50fed5){var _0x2691fa=function(_0x5226e1){while(--_0x5226e1){_0x545041['push'](_0x545041['shift']());}};_0x2691fa(++_0x50fed5);}(_0xeb06,0x147));var _0x6eb0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xeb06[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x6eb0('0x0'));var util=require(_0x6eb0('0x1'));var moment=require(_0x6eb0('0x2'));var BPromise=require(_0x6eb0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6eb0('0x4'))['db'];var utils=require(_0x6eb0('0x5'));var logger=require(_0x6eb0('0x6'))('rpc');var config=require(_0x6eb0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6eb0('0x8')]['http']({'port':0x232a});config[_0x6eb0('0x9')]=_[_0x6eb0('0xa')](config[_0x6eb0('0x9')],{'host':_0x6eb0('0xb'),'port':0x18eb});var socket=require(_0x6eb0('0xc'))(new Redis(config[_0x6eb0('0x9')]));require('./faxQueue.socket')[_0x6eb0('0xd')](socket);function respondWithRpcPromise(_0x35b0da,_0x1d024c,_0x30e3eb){return new BPromise(function(_0x23e7cf,_0x57e733){return client[_0x6eb0('0xe')](_0x35b0da,_0x30e3eb)['then'](function(_0x1e2812){logger['info'](_0x6eb0('0xf'),_0x1d024c,'request\x20sent');logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x1d024c,_0x6eb0('0x10'),JSON[_0x6eb0('0x11')](_0x1e2812));if(_0x1e2812[_0x6eb0('0x12')]){if(_0x1e2812[_0x6eb0('0x12')][_0x6eb0('0x13')]===0x1f4){logger[_0x6eb0('0x12')](_0x6eb0('0xf'),_0x1d024c,_0x1e2812[_0x6eb0('0x12')][_0x6eb0('0x14')]);return _0x57e733(_0x1e2812[_0x6eb0('0x12')]['message']);}logger[_0x6eb0('0x12')](_0x6eb0('0xf'),_0x1d024c,_0x1e2812[_0x6eb0('0x12')][_0x6eb0('0x14')]);return _0x23e7cf(_0x1e2812[_0x6eb0('0x12')][_0x6eb0('0x14')]);}else{logger[_0x6eb0('0x15')](_0x6eb0('0xf'),_0x1d024c,_0x6eb0('0x10'));_0x23e7cf(_0x1e2812[_0x6eb0('0x16')][_0x6eb0('0x14')]);}})[_0x6eb0('0x17')](function(_0xa71fb){logger['error'](_0x6eb0('0xf'),_0x1d024c,_0xa71fb);_0x57e733(_0xa71fb);});});}exports[_0x6eb0('0x18')]=function(_0x19bf58){var _0x3244c9=this;return new Promise(function(_0x198063,_0xe9c9b3){return db[_0x6eb0('0x19')][_0x6eb0('0x1a')]({'raw':_0x19bf58['options']?_0x19bf58[_0x6eb0('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x19bf58[_0x6eb0('0x1b')]?_0x19bf58['options'][_0x6eb0('0x1c')]||null:null,'attributes':_0x19bf58['options']?_0x19bf58[_0x6eb0('0x1b')][_0x6eb0('0x1d')]||null:null,'limit':_0x19bf58[_0x6eb0('0x1b')]?_0x19bf58[_0x6eb0('0x1b')]['limit']||null:null,'include':_0x19bf58[_0x6eb0('0x1b')]?_0x19bf58[_0x6eb0('0x1b')]['include']?_['map'](_0x19bf58[_0x6eb0('0x1b')][_0x6eb0('0x1e')],function(_0x8a1cf5){return{'model':db[_0x8a1cf5[_0x6eb0('0x1f')]],'as':_0x8a1cf5['as'],'attributes':_0x8a1cf5[_0x6eb0('0x1d')],'include':_0x8a1cf5[_0x6eb0('0x1e')]?_[_0x6eb0('0x20')](_0x8a1cf5[_0x6eb0('0x1e')],function(_0x20582a){return{'model':db[_0x20582a[_0x6eb0('0x1f')]],'as':_0x20582a['as'],'attributes':_0x20582a[_0x6eb0('0x1d')],'include':_0x20582a[_0x6eb0('0x1e')]?_['map'](_0x20582a['include'],function(_0x2adc89){return{'model':db[_0x2adc89[_0x6eb0('0x1f')]],'as':_0x2adc89['as'],'attributes':_0x2adc89['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1617eb){logger[_0x6eb0('0x15')](_0x6eb0('0x18'),_0x19bf58);logger['debug'](_0x6eb0('0x18'),_0x19bf58,JSON[_0x6eb0('0x11')](_0x1617eb));_0x198063(_0x1617eb);})[_0x6eb0('0x17')](function(_0xe032d8){logger[_0x6eb0('0x12')](_0x6eb0('0x18'),_0xe032d8['message'],_0x19bf58);_0xe9c9b3(_0x3244c9[_0x6eb0('0x12')](0x1f4,_0xe032d8['message']));});});};exports[_0x6eb0('0x21')]=function(_0x70a217){var _0xbb1131=this;return new Promise(function(_0x21e47a,_0x3c782c){return db[_0x6eb0('0x19')][_0x6eb0('0x22')]({'raw':_0x70a217['options']?_0x70a217[_0x6eb0('0x1b')][_0x6eb0('0x23')]===undefined?!![]:![]:!![],'where':_0x70a217['options']?_0x70a217[_0x6eb0('0x1b')][_0x6eb0('0x1c')]||null:null,'attributes':_0x70a217[_0x6eb0('0x1b')]?_0x70a217[_0x6eb0('0x1b')][_0x6eb0('0x1d')]||null:null,'include':_0x70a217['options']?_0x70a217[_0x6eb0('0x1b')][_0x6eb0('0x1e')]?_[_0x6eb0('0x20')](_0x70a217['options'][_0x6eb0('0x1e')],function(_0x449121){return{'model':db[_0x449121[_0x6eb0('0x1f')]],'as':_0x449121['as'],'attributes':_0x449121[_0x6eb0('0x1d')],'include':_0x449121[_0x6eb0('0x1e')]?_[_0x6eb0('0x20')](_0x449121[_0x6eb0('0x1e')],function(_0x43ac5f){return{'model':db[_0x43ac5f[_0x6eb0('0x1f')]],'as':_0x43ac5f['as'],'attributes':_0x43ac5f[_0x6eb0('0x1d')],'include':_0x43ac5f[_0x6eb0('0x1e')]?_[_0x6eb0('0x20')](_0x43ac5f[_0x6eb0('0x1e')],function(_0x65e436){return{'model':db[_0x65e436['model']],'as':_0x65e436['as'],'attributes':_0x65e436[_0x6eb0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6eb0('0x24')](function(_0x370c96){logger[_0x6eb0('0x15')]('ShowFaxQueue',_0x70a217);logger[_0x6eb0('0x25')]('ShowFaxQueue',_0x70a217,JSON[_0x6eb0('0x11')](_0x370c96));_0x21e47a(_0x370c96);})[_0x6eb0('0x17')](function(_0xbd829e){logger[_0x6eb0('0x12')]('ShowFaxQueue',_0xbd829e[_0x6eb0('0x14')],_0x70a217);_0x3c782c(_0xbb1131[_0x6eb0('0x12')](0x1f4,_0xbd829e[_0x6eb0('0x14')]));});});};
\ No newline at end of file
+var _0xf9b4=['ShowFaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueue,\x20%s,\x20%s','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','GetFaxQueue'];(function(_0x45bb9c,_0x3a1bf0){var _0x510cfc=function(_0x190ac6){while(--_0x190ac6){_0x45bb9c['push'](_0x45bb9c['shift']());}};_0x510cfc(++_0x3a1bf0);}(_0xf9b4,0x161));var _0x4f9b=function(_0xf73390,_0x14c109){_0xf73390=_0xf73390-0x0;var _0x4b212f=_0xf9b4[_0xf73390];return _0x4b212f;};'use strict';var _=require('lodash');var util=require(_0x4f9b('0x0'));var moment=require(_0x4f9b('0x1'));var BPromise=require(_0x4f9b('0x2'));var rs=require(_0x4f9b('0x3'));var fs=require('fs');var Redis=require(_0x4f9b('0x4'));var db=require(_0x4f9b('0x5'))['db'];var utils=require(_0x4f9b('0x6'));var logger=require('../../config/logger')(_0x4f9b('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f9b('0x8'));var client=jayson[_0x4f9b('0x9')]['http']({'port':0x232a});config[_0x4f9b('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4f9b('0xb'))(new Redis(config[_0x4f9b('0xa')]));require(_0x4f9b('0xc'))[_0x4f9b('0xd')](socket);function respondWithRpcPromise(_0x20ba59,_0x2773ac,_0x539636){return new BPromise(function(_0x40bb6d,_0x427cd6){return client[_0x4f9b('0xe')](_0x20ba59,_0x539636)[_0x4f9b('0xf')](function(_0x5ee327){logger[_0x4f9b('0x10')]('FaxQueue,\x20%s,\x20%s',_0x2773ac,_0x4f9b('0x11'));logger['debug'](_0x4f9b('0x12'),_0x2773ac,_0x4f9b('0x11'),JSON[_0x4f9b('0x13')](_0x5ee327));if(_0x5ee327['error']){if(_0x5ee327[_0x4f9b('0x14')]['code']===0x1f4){logger[_0x4f9b('0x14')](_0x4f9b('0x15'),_0x2773ac,_0x5ee327[_0x4f9b('0x14')]['message']);return _0x427cd6(_0x5ee327['error'][_0x4f9b('0x16')]);}logger[_0x4f9b('0x14')](_0x4f9b('0x15'),_0x2773ac,_0x5ee327[_0x4f9b('0x14')][_0x4f9b('0x16')]);return _0x40bb6d(_0x5ee327['error'][_0x4f9b('0x16')]);}else{logger[_0x4f9b('0x10')](_0x4f9b('0x15'),_0x2773ac,'request\x20sent');_0x40bb6d(_0x5ee327[_0x4f9b('0x17')][_0x4f9b('0x16')]);}})[_0x4f9b('0x18')](function(_0x2af3f1){logger[_0x4f9b('0x14')](_0x4f9b('0x15'),_0x2773ac,_0x2af3f1);_0x427cd6(_0x2af3f1);});});}exports['GetFaxQueue']=function(_0x55f6e4){var _0x3cea39=this;return new Promise(function(_0xd1adce,_0x18c888){return db[_0x4f9b('0x19')][_0x4f9b('0x1a')]({'raw':_0x55f6e4[_0x4f9b('0x1b')]?_0x55f6e4[_0x4f9b('0x1b')][_0x4f9b('0x1c')]===undefined?!![]:![]:!![],'where':_0x55f6e4[_0x4f9b('0x1b')]?_0x55f6e4[_0x4f9b('0x1b')][_0x4f9b('0x1d')]||null:null,'attributes':_0x55f6e4[_0x4f9b('0x1b')]?_0x55f6e4[_0x4f9b('0x1b')][_0x4f9b('0x1e')]||null:null,'limit':_0x55f6e4[_0x4f9b('0x1b')]?_0x55f6e4[_0x4f9b('0x1b')][_0x4f9b('0x1f')]||null:null,'include':_0x55f6e4[_0x4f9b('0x1b')]?_0x55f6e4[_0x4f9b('0x1b')][_0x4f9b('0x20')]?_['map'](_0x55f6e4[_0x4f9b('0x1b')]['include'],function(_0x34c159){return{'model':db[_0x34c159[_0x4f9b('0x21')]],'as':_0x34c159['as'],'attributes':_0x34c159[_0x4f9b('0x1e')],'include':_0x34c159[_0x4f9b('0x20')]?_['map'](_0x34c159[_0x4f9b('0x20')],function(_0x4925d1){return{'model':db[_0x4925d1['model']],'as':_0x4925d1['as'],'attributes':_0x4925d1['attributes'],'include':_0x4925d1[_0x4f9b('0x20')]?_[_0x4f9b('0x22')](_0x4925d1[_0x4f9b('0x20')],function(_0xcd28f7){return{'model':db[_0xcd28f7[_0x4f9b('0x21')]],'as':_0xcd28f7['as'],'attributes':_0xcd28f7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f9b('0xf')](function(_0x301049){logger['info']('GetFaxQueue',_0x55f6e4);logger[_0x4f9b('0x23')](_0x4f9b('0x24'),_0x55f6e4,JSON[_0x4f9b('0x13')](_0x301049));_0xd1adce(_0x301049);})[_0x4f9b('0x18')](function(_0xf89649){logger[_0x4f9b('0x14')](_0x4f9b('0x24'),_0xf89649[_0x4f9b('0x16')],_0x55f6e4);_0x18c888(_0x3cea39['error'](0x1f4,_0xf89649['message']));});});};exports[_0x4f9b('0x25')]=function(_0x456a23){var _0x442d07=this;return new Promise(function(_0x236fe8,_0x1a7a4a){return db['FaxQueue'][_0x4f9b('0x26')]({'raw':_0x456a23[_0x4f9b('0x1b')]?_0x456a23[_0x4f9b('0x1b')][_0x4f9b('0x1c')]===undefined?!![]:![]:!![],'where':_0x456a23[_0x4f9b('0x1b')]?_0x456a23[_0x4f9b('0x1b')][_0x4f9b('0x1d')]||null:null,'attributes':_0x456a23['options']?_0x456a23['options'][_0x4f9b('0x1e')]||null:null,'include':_0x456a23[_0x4f9b('0x1b')]?_0x456a23[_0x4f9b('0x1b')]['include']?_['map'](_0x456a23[_0x4f9b('0x1b')][_0x4f9b('0x20')],function(_0x3eb111){return{'model':db[_0x3eb111['model']],'as':_0x3eb111['as'],'attributes':_0x3eb111[_0x4f9b('0x1e')],'include':_0x3eb111[_0x4f9b('0x20')]?_[_0x4f9b('0x22')](_0x3eb111['include'],function(_0xa451e0){return{'model':db[_0xa451e0[_0x4f9b('0x21')]],'as':_0xa451e0['as'],'attributes':_0xa451e0[_0x4f9b('0x1e')],'include':_0xa451e0[_0x4f9b('0x20')]?_[_0x4f9b('0x22')](_0xa451e0[_0x4f9b('0x20')],function(_0x12981){return{'model':db[_0x12981[_0x4f9b('0x21')]],'as':_0x12981['as'],'attributes':_0x12981[_0x4f9b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3545bb){logger[_0x4f9b('0x10')](_0x4f9b('0x25'),_0x456a23);logger['debug'](_0x4f9b('0x25'),_0x456a23,JSON[_0x4f9b('0x13')](_0x3545bb));_0x236fe8(_0x3545bb);})[_0x4f9b('0x18')](function(_0x112fd3){logger['error'](_0x4f9b('0x25'),_0x112fd3[_0x4f9b('0x16')],_0x456a23);_0x1a7a4a(_0x442d07['error'](0x1f4,_0x112fd3[_0x4f9b('0x16')]));});});};
\ No newline at end of file
index dd086c1..e405c46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefbf=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0xefbf,0x1f0));var _0xfefb=function(_0x59aac5,_0x3c3af3){_0x59aac5=_0x59aac5-0x0;var _0x2e80a4=_0xefbf[_0x59aac5];return _0x2e80a4;};'use strict';var FaxQueueEvents=require(_0xfefb('0x0'));var events=[_0xfefb('0x1'),_0xfefb('0x2'),_0xfefb('0x3')];function createListener(_0x4aa05d,_0x13e468){return function(_0x125fe6){_0x13e468[_0xfefb('0x4')](_0x4aa05d,_0x125fe6);};}function removeListener(_0x412a4e,_0x4eff4e){return function(){FaxQueueEvents[_0xfefb('0x5')](_0x412a4e,_0x4eff4e);};}exports[_0xfefb('0x6')]=function(_0x3ffbf2){for(var _0x49c3d3=0x0,_0x551b9a=events[_0xfefb('0x7')];_0x49c3d3<_0x551b9a;_0x49c3d3++){var _0x3cc790=events[_0x49c3d3];var _0x589c40=createListener(_0xfefb('0x8')+_0x3cc790,_0x3ffbf2);FaxQueueEvents['on'](_0x3cc790,_0x589c40);}};
\ No newline at end of file
+var _0xdf80=['./faxQueue.events','emit','register','length'];(function(_0x59ca71,_0x5a0cc1){var _0x5bc869=function(_0x4ed78f){while(--_0x4ed78f){_0x59ca71['push'](_0x59ca71['shift']());}};_0x5bc869(++_0x5a0cc1);}(_0xdf80,0x84));var _0x0df8=function(_0x17ca23,_0x11c7d3){_0x17ca23=_0x17ca23-0x0;var _0x385e5c=_0xdf80[_0x17ca23];return _0x385e5c;};'use strict';var FaxQueueEvents=require(_0x0df8('0x0'));var events=['save','remove','update'];function createListener(_0x21f364,_0x2c4e4e){return function(_0x573df1){_0x2c4e4e[_0x0df8('0x1')](_0x21f364,_0x573df1);};}function removeListener(_0x2ccb0a,_0x27f5b9){return function(){FaxQueueEvents['removeListener'](_0x2ccb0a,_0x27f5b9);};}exports[_0x0df8('0x2')]=function(_0xec8161){for(var _0x34b025=0x0,_0x2707bc=events[_0x0df8('0x3')];_0x34b025<_0x2707bc;_0x34b025++){var _0x5dd10f=events[_0x34b025];var _0x3d5a76=createListener('faxQueue:'+_0x5dd10f,_0xec8161);FaxQueueEvents['on'](_0x5dd10f,_0x3d5a76);}};
\ No newline at end of file
index e136821..e4d3ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ee6bc,_0x4025bb){_0x3ee6bc=_0x3ee6bc-0x0;var _0x5bda78=_0xb10b[_0x3ee6bc];return _0x5bda78;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x48845d,_0x4338c2){var _0x5bad7d=function(_0x1bf3f4){while(--_0x1bf3f4){_0x48845d['push'](_0x48845d['shift']());}};_0x5bad7d(++_0x4338c2);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router;
\ No newline at end of file
index a2fdfa8..38f6b67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1830=['exports','STRING','DATE','sequelize'];(function(_0xb795ef,_0x3ac5a4){var _0x15f84e=function(_0x1f24d7){while(--_0x1f24d7){_0xb795ef['push'](_0xb795ef['shift']());}};_0x15f84e(++_0x3ac5a4);}(_0x1830,0x10f));var _0x0183=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0x1830[_0x9d639c];return _0x1671de;};'use strict';var moment=require('moment');var Sequelize=require(_0x0183('0x0'));module[_0x0183('0x1')]={'uniqueid':{'type':Sequelize[_0x0183('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0183('0x2')]},'joinAt':{'type':Sequelize[_0x0183('0x3')]},'leaveAt':{'type':Sequelize[_0x0183('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0183('0x3')]},'reason':{'type':Sequelize[_0x0183('0x2')]}};
\ No newline at end of file
+var _0x66fd=['exports','STRING','DATE','moment','sequelize'];(function(_0x5e3880,_0x1ad106){var _0x3b52cc=function(_0x528578){while(--_0x528578){_0x5e3880['push'](_0x5e3880['shift']());}};_0x3b52cc(++_0x1ad106);}(_0x66fd,0x7b));var _0xd66f=function(_0x1dfbdf,_0x459d58){_0x1dfbdf=_0x1dfbdf-0x0;var _0x2893a6=_0x66fd[_0x1dfbdf];return _0x2893a6;};'use strict';var moment=require(_0xd66f('0x0'));var Sequelize=require(_0xd66f('0x1'));module[_0xd66f('0x2')]={'uniqueid':{'type':Sequelize[_0xd66f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd66f('0x3')]},'joinAt':{'type':Sequelize[_0xd66f('0x4')]},'leaveAt':{'type':Sequelize[_0xd66f('0x4')]},'acceptAt':{'type':Sequelize[_0xd66f('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6b66005..906f64c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e88=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','end','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','query','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','create','body','find','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x54f81a,_0x3aeafc){var _0x20f7d3=function(_0x26e6ab){while(--_0x26e6ab){_0x54f81a['push'](_0x54f81a['shift']());}};_0x20f7d3(++_0x3aeafc);}(_0x1e88,0x7a));var _0x81e8=function(_0x40b209,_0x303d28){_0x40b209=_0x40b209-0x0;var _0x240344=_0x1e88[_0x40b209];return _0x240344;};'use strict';var pdf=require(_0x81e8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x81e8('0x1'));var zipdir=require(_0x81e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81e8('0x3'));var moment=require(_0x81e8('0x4'));var BPromise=require(_0x81e8('0x5'));var Mustache=require(_0x81e8('0x6'));var util=require(_0x81e8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x81e8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x81e8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x81e8('0xa'));var deskjs=require(_0x81e8('0xb'));var toCsv=require(_0x81e8('0x8'));var querystring=require(_0x81e8('0xc'));var Papa=require(_0x81e8('0xd'));var Redis=require(_0x81e8('0xe'));var authService=require(_0x81e8('0xf'));var qs=require(_0x81e8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81e8('0x11'));var logger=require(_0x81e8('0x12'))(_0x81e8('0x13'));var utils=require(_0x81e8('0x14'));var config=require('../../config/environment');var db=require(_0x81e8('0x15'))['db'];function respondWithStatusCode(_0x40f8fb,_0x525f02){_0x525f02=_0x525f02||0xcc;return function(_0x1d3ead){if(_0x1d3ead){return _0x40f8fb[_0x81e8('0x16')](_0x525f02);}return _0x40f8fb['status'](_0x525f02)['end']();};}function respondWithResult(_0x2556fc,_0x330e46){_0x330e46=_0x330e46||0xc8;return function(_0x3a00a6){if(_0x3a00a6){return _0x2556fc[_0x81e8('0x17')](_0x330e46)[_0x81e8('0x18')](_0x3a00a6);}};}function respondWithFilteredResult(_0x3c05ae,_0x3eacc8){return function(_0x8596e1){if(_0x8596e1){var _0x1b82fd=_0x8596e1[_0x81e8('0x19')],_0x57ecb4=_0x3eacc8['offset'],_0x3c5dbf=_0x3eacc8[_0x81e8('0x1a')]+_0x3eacc8[_0x81e8('0x1b')],_0x35453a;if(_0x3c5dbf>=_0x1b82fd){_0x3c5dbf=_0x1b82fd;_0x35453a=0xc8;}else{_0x35453a=0xce;}_0x3c05ae[_0x81e8('0x17')](_0x35453a);return _0x3c05ae[_0x81e8('0x1c')](_0x81e8('0x1d'),_0x57ecb4+'-'+_0x3c5dbf+'/'+_0x1b82fd)['json'](_0x8596e1);}return null;};}function patchUpdates(_0xefa1b2){return function(_0x49cf5f){try{jsonpatch['apply'](_0x49cf5f,_0xefa1b2,!![]);}catch(_0x394dc5){return BPromise[_0x81e8('0x1e')](_0x394dc5);}return _0x49cf5f['save']();};}function saveUpdates(_0x54f4a3,_0x1256a3){return function(_0x30ceb8){if(_0x30ceb8){return _0x30ceb8[_0x81e8('0x1f')](_0x54f4a3)[_0x81e8('0x20')](function(_0x403683){return _0x403683;});}return null;};}function removeEntity(_0x576804,_0x4cf28c){return function(_0x4770dc){if(_0x4770dc){return _0x4770dc['destroy']()['then'](function(){_0x576804[_0x81e8('0x17')](0xcc)[_0x81e8('0x21')]();});}};}function handleEntityNotFound(_0x4b36da,_0x3728f9){return function(_0x2a5d73){if(!_0x2a5d73){_0x4b36da['sendStatus'](0x194);}return _0x2a5d73;};}function handleError(_0x405402,_0x2c4406){_0x2c4406=_0x2c4406||0x1f4;return function(_0x1a82fc){logger['error'](_0x1a82fc[_0x81e8('0x22')]);if(_0x1a82fc[_0x81e8('0x23')]){delete _0x1a82fc['name'];}_0x405402[_0x81e8('0x17')](_0x2c4406)[_0x81e8('0x24')](_0x1a82fc);};}exports[_0x81e8('0x25')]=function(_0x552db1,_0x19d5d6){var _0x1adae0={},_0x17e085={},_0x1a6b1b={'count':0x0,'rows':[]};var _0xf5035b=_[_0x81e8('0x26')](db[_0x81e8('0x27')][_0x81e8('0x28')],function(_0x23bdf6){return{'name':_0x23bdf6[_0x81e8('0x29')],'type':_0x23bdf6[_0x81e8('0x2a')]['key']};});_0x17e085[_0x81e8('0x2b')]=_[_0x81e8('0x26')](_0xf5035b,_0x81e8('0x23'));_0x17e085['query']=_[_0x81e8('0x2c')](_0x552db1['query']);_0x17e085[_0x81e8('0x2d')]=_[_0x81e8('0x2e')](_0x17e085[_0x81e8('0x2b')],_0x17e085['query']);_0x1adae0[_0x81e8('0x2f')]=_[_0x81e8('0x2e')](_0x17e085[_0x81e8('0x2b')],qs['fields'](_0x552db1[_0x81e8('0x30')][_0x81e8('0x31')]));_0x1adae0[_0x81e8('0x2f')]=_0x1adae0['attributes'][_0x81e8('0x32')]?_0x1adae0['attributes']:_0x17e085[_0x81e8('0x2b')];if(!_0x552db1[_0x81e8('0x30')]['hasOwnProperty'](_0x81e8('0x33'))){_0x1adae0[_0x81e8('0x1b')]=qs[_0x81e8('0x1b')](_0x552db1[_0x81e8('0x30')]['limit']);_0x1adae0[_0x81e8('0x1a')]=qs[_0x81e8('0x1a')](_0x552db1[_0x81e8('0x30')][_0x81e8('0x1a')]);}_0x1adae0['order']=qs[_0x81e8('0x34')](_0x552db1['query'][_0x81e8('0x34')]);_0x1adae0[_0x81e8('0x35')]=qs[_0x81e8('0x2d')](_[_0x81e8('0x36')](_0x552db1[_0x81e8('0x30')],_0x17e085[_0x81e8('0x2d')]),_0xf5035b);if(_0x552db1[_0x81e8('0x30')]['filter']){_0x1adae0[_0x81e8('0x35')]=_[_0x81e8('0x37')](_0x1adae0[_0x81e8('0x35')],{'$or':_[_0x81e8('0x26')](_0xf5035b,function(_0x35b4a8){if(_0x35b4a8['type']!==_0x81e8('0x38')){var _0x161808={};_0x161808[_0x35b4a8[_0x81e8('0x23')]]={'$like':'%'+_0x552db1['query'][_0x81e8('0x39')]+'%'};return _0x161808;}})});}_0x1adae0=_[_0x81e8('0x37')]({},_0x1adae0,_0x552db1[_0x81e8('0x3a')]);var _0x3d37c6={'where':_0x1adae0[_0x81e8('0x35')]};return db['FaxQueueReport'][_0x81e8('0x19')](_0x3d37c6)[_0x81e8('0x20')](function(_0x20cd9b){_0x1a6b1b['count']=_0x20cd9b;if(_0x552db1[_0x81e8('0x30')][_0x81e8('0x3b')]){_0x1adae0[_0x81e8('0x3c')]=[{'all':!![]}];}return db[_0x81e8('0x27')]['findAll'](_0x1adae0);})[_0x81e8('0x20')](function(_0x4204f6){_0x1a6b1b[_0x81e8('0x3d')]=_0x4204f6;return _0x1a6b1b;})[_0x81e8('0x20')](respondWithFilteredResult(_0x19d5d6,_0x1adae0))[_0x81e8('0x3e')](handleError(_0x19d5d6,null));};exports['show']=function(_0xd6814f,_0x116972){var _0x597b59={'raw':!![],'where':{'id':_0xd6814f[_0x81e8('0x3f')]['id']}},_0x1adc4e={};_0x1adc4e[_0x81e8('0x2b')]=_[_0x81e8('0x2c')](db['FaxQueueReport']['rawAttributes']);_0x1adc4e[_0x81e8('0x30')]=_[_0x81e8('0x2c')](_0xd6814f[_0x81e8('0x30')]);_0x1adc4e[_0x81e8('0x2d')]=_[_0x81e8('0x2e')](_0x1adc4e[_0x81e8('0x2b')],_0x1adc4e['query']);_0x597b59['attributes']=_['intersection'](_0x1adc4e['model'],qs[_0x81e8('0x31')](_0xd6814f[_0x81e8('0x30')][_0x81e8('0x31')]));_0x597b59[_0x81e8('0x2f')]=_0x597b59['attributes'][_0x81e8('0x32')]?_0x597b59[_0x81e8('0x2f')]:_0x1adc4e[_0x81e8('0x2b')];if(_0xd6814f[_0x81e8('0x30')][_0x81e8('0x3b')]){_0x597b59[_0x81e8('0x3c')]=[{'all':!![]}];}_0x597b59=_[_0x81e8('0x37')]({},_0x597b59,_0xd6814f[_0x81e8('0x3a')]);return db[_0x81e8('0x27')]['find'](_0x597b59)[_0x81e8('0x20')](handleEntityNotFound(_0x116972,null))[_0x81e8('0x20')](respondWithResult(_0x116972,null))[_0x81e8('0x3e')](handleError(_0x116972,null));};exports[_0x81e8('0x40')]=function(_0x4d5340,_0x11d236){return db[_0x81e8('0x27')][_0x81e8('0x40')](_0x4d5340[_0x81e8('0x41')],{})[_0x81e8('0x20')](respondWithResult(_0x11d236,0xc9))[_0x81e8('0x3e')](handleError(_0x11d236,null));};exports[_0x81e8('0x1f')]=function(_0x15d5d7,_0x3ff4a4){if(_0x15d5d7[_0x81e8('0x41')]['id']){delete _0x15d5d7[_0x81e8('0x41')]['id'];}return db['FaxQueueReport'][_0x81e8('0x42')]({'where':{'id':_0x15d5d7[_0x81e8('0x3f')]['id']}})[_0x81e8('0x20')](handleEntityNotFound(_0x3ff4a4,null))[_0x81e8('0x20')](saveUpdates(_0x15d5d7['body'],null))[_0x81e8('0x20')](respondWithResult(_0x3ff4a4,null))[_0x81e8('0x3e')](handleError(_0x3ff4a4,null));};exports['destroy']=function(_0x2b8188,_0x3cf753){return db['FaxQueueReport']['find']({'where':{'id':_0x2b8188[_0x81e8('0x3f')]['id']}})[_0x81e8('0x20')](handleEntityNotFound(_0x3cf753,null))[_0x81e8('0x20')](removeEntity(_0x3cf753,null))[_0x81e8('0x3e')](handleError(_0x3cf753,null));};exports[_0x81e8('0x43')]=function(_0x38bcf3,_0x3398c8){return db[_0x81e8('0x27')][_0x81e8('0x43')]()[_0x81e8('0x20')](respondWithResult(_0x3398c8,null))[_0x81e8('0x3e')](handleError(_0x3398c8,null));};
\ No newline at end of file
+var _0x0b21=['rows','catch','show','params','keys','includeAll','merge','create','body','find','describe','rimraf','fast-json-patch','request-promise','mustache','path','sox','ejs','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','../../config/environment','../../mysqldb','status','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','count','include','findAll'];(function(_0x568039,_0x570f8e){var _0x1595fc=function(_0x50ac8f){while(--_0x50ac8f){_0x568039['push'](_0x568039['shift']());}};_0x1595fc(++_0x570f8e);}(_0x0b21,0x182));var _0x10b2=function(_0x13eea8,_0x1edfc5){_0x13eea8=_0x13eea8-0x0;var _0x3e84d0=_0x0b21[_0x13eea8];return _0x3e84d0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x10b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x10b2('0x1'));var rp=require(_0x10b2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x10b2('0x3'));var util=require('util');var path=require(_0x10b2('0x4'));var sox=require(_0x10b2('0x5'));var csv=require('to-csv');var ejs=require(_0x10b2('0x6'));var fs=require('fs');var _=require(_0x10b2('0x7'));var squel=require(_0x10b2('0x8'));var crypto=require(_0x10b2('0x9'));var jsforce=require(_0x10b2('0xa'));var deskjs=require(_0x10b2('0xb'));var toCsv=require(_0x10b2('0xc'));var querystring=require(_0x10b2('0xd'));var Papa=require(_0x10b2('0xe'));var Redis=require(_0x10b2('0xf'));var authService=require(_0x10b2('0x10'));var qs=require(_0x10b2('0x11'));var as=require(_0x10b2('0x12'));var hardwareService=require(_0x10b2('0x13'));var logger=require(_0x10b2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x10b2('0x15'));var db=require(_0x10b2('0x16'))['db'];function respondWithStatusCode(_0x4b779b,_0x5bc655){_0x5bc655=_0x5bc655||0xcc;return function(_0x3f43b9){if(_0x3f43b9){return _0x4b779b['sendStatus'](_0x5bc655);}return _0x4b779b[_0x10b2('0x17')](_0x5bc655)['end']();};}function respondWithResult(_0x1652c8,_0x2c8ef7){_0x2c8ef7=_0x2c8ef7||0xc8;return function(_0x455d34){if(_0x455d34){return _0x1652c8[_0x10b2('0x17')](_0x2c8ef7)['json'](_0x455d34);}};}function respondWithFilteredResult(_0x46104f,_0x38b95a){return function(_0x343f48){if(_0x343f48){var _0x5814b0=_0x343f48['count'],_0x2b92d0=_0x38b95a[_0x10b2('0x18')],_0x35ee60=_0x38b95a[_0x10b2('0x18')]+_0x38b95a[_0x10b2('0x19')],_0x3e6853;if(_0x35ee60>=_0x5814b0){_0x35ee60=_0x5814b0;_0x3e6853=0xc8;}else{_0x3e6853=0xce;}_0x46104f[_0x10b2('0x17')](_0x3e6853);return _0x46104f[_0x10b2('0x1a')](_0x10b2('0x1b'),_0x2b92d0+'-'+_0x35ee60+'/'+_0x5814b0)['json'](_0x343f48);}return null;};}function patchUpdates(_0x1a94e8){return function(_0x49b304){try{jsonpatch[_0x10b2('0x1c')](_0x49b304,_0x1a94e8,!![]);}catch(_0x5ac7b6){return BPromise[_0x10b2('0x1d')](_0x5ac7b6);}return _0x49b304[_0x10b2('0x1e')]();};}function saveUpdates(_0x2ddfad,_0x10df29){return function(_0xd8145f){if(_0xd8145f){return _0xd8145f[_0x10b2('0x1f')](_0x2ddfad)[_0x10b2('0x20')](function(_0x4db063){return _0x4db063;});}return null;};}function removeEntity(_0x137b6b,_0x138b93){return function(_0xa02384){if(_0xa02384){return _0xa02384[_0x10b2('0x21')]()['then'](function(){_0x137b6b[_0x10b2('0x17')](0xcc)[_0x10b2('0x22')]();});}};}function handleEntityNotFound(_0x2530c3,_0x3bc567){return function(_0x31a013){if(!_0x31a013){_0x2530c3[_0x10b2('0x23')](0x194);}return _0x31a013;};}function handleError(_0x4e846c,_0x118782){_0x118782=_0x118782||0x1f4;return function(_0x306fbc){logger[_0x10b2('0x24')](_0x306fbc[_0x10b2('0x25')]);if(_0x306fbc[_0x10b2('0x26')]){delete _0x306fbc[_0x10b2('0x26')];}_0x4e846c[_0x10b2('0x17')](_0x118782)[_0x10b2('0x27')](_0x306fbc);};}exports[_0x10b2('0x28')]=function(_0x5ce25a,_0x185397){var _0x15d049={},_0x1c2011={},_0x15409f={'count':0x0,'rows':[]};var _0xe1958=_[_0x10b2('0x29')](db[_0x10b2('0x2a')][_0x10b2('0x2b')],function(_0x859b05){return{'name':_0x859b05['fieldName'],'type':_0x859b05[_0x10b2('0x2c')][_0x10b2('0x2d')]};});_0x1c2011[_0x10b2('0x2e')]=_['map'](_0xe1958,_0x10b2('0x26'));_0x1c2011['query']=_['keys'](_0x5ce25a[_0x10b2('0x2f')]);_0x1c2011[_0x10b2('0x30')]=_[_0x10b2('0x31')](_0x1c2011[_0x10b2('0x2e')],_0x1c2011[_0x10b2('0x2f')]);_0x15d049[_0x10b2('0x32')]=_['intersection'](_0x1c2011[_0x10b2('0x2e')],qs[_0x10b2('0x33')](_0x5ce25a['query'][_0x10b2('0x33')]));_0x15d049[_0x10b2('0x32')]=_0x15d049[_0x10b2('0x32')][_0x10b2('0x34')]?_0x15d049[_0x10b2('0x32')]:_0x1c2011[_0x10b2('0x2e')];if(!_0x5ce25a[_0x10b2('0x2f')][_0x10b2('0x35')](_0x10b2('0x36'))){_0x15d049['limit']=qs[_0x10b2('0x19')](_0x5ce25a[_0x10b2('0x2f')][_0x10b2('0x19')]);_0x15d049['offset']=qs[_0x10b2('0x18')](_0x5ce25a[_0x10b2('0x2f')]['offset']);}_0x15d049[_0x10b2('0x37')]=qs[_0x10b2('0x38')](_0x5ce25a[_0x10b2('0x2f')][_0x10b2('0x38')]);_0x15d049[_0x10b2('0x39')]=qs[_0x10b2('0x30')](_['pick'](_0x5ce25a['query'],_0x1c2011[_0x10b2('0x30')]),_0xe1958);if(_0x5ce25a[_0x10b2('0x2f')][_0x10b2('0x3a')]){_0x15d049[_0x10b2('0x39')]=_['merge'](_0x15d049[_0x10b2('0x39')],{'$or':_[_0x10b2('0x29')](_0xe1958,function(_0x16d91d){if(_0x16d91d[_0x10b2('0x2c')]!==_0x10b2('0x3b')){var _0x4332b8={};_0x4332b8[_0x16d91d[_0x10b2('0x26')]]={'$like':'%'+_0x5ce25a[_0x10b2('0x2f')][_0x10b2('0x3a')]+'%'};return _0x4332b8;}})});}_0x15d049=_['merge']({},_0x15d049,_0x5ce25a[_0x10b2('0x3c')]);var _0x4088db={'where':_0x15d049[_0x10b2('0x39')]};return db[_0x10b2('0x2a')][_0x10b2('0x3d')](_0x4088db)[_0x10b2('0x20')](function(_0x408d4a){_0x15409f['count']=_0x408d4a;if(_0x5ce25a[_0x10b2('0x2f')]['includeAll']){_0x15d049[_0x10b2('0x3e')]=[{'all':!![]}];}return db[_0x10b2('0x2a')][_0x10b2('0x3f')](_0x15d049);})['then'](function(_0x4d524c){_0x15409f[_0x10b2('0x40')]=_0x4d524c;return _0x15409f;})[_0x10b2('0x20')](respondWithFilteredResult(_0x185397,_0x15d049))[_0x10b2('0x41')](handleError(_0x185397,null));};exports[_0x10b2('0x42')]=function(_0x2289a3,_0xc4415){var _0x5ce17b={'raw':!![],'where':{'id':_0x2289a3[_0x10b2('0x43')]['id']}},_0x367e21={};_0x367e21[_0x10b2('0x2e')]=_[_0x10b2('0x44')](db[_0x10b2('0x2a')][_0x10b2('0x2b')]);_0x367e21[_0x10b2('0x2f')]=_[_0x10b2('0x44')](_0x2289a3['query']);_0x367e21[_0x10b2('0x30')]=_[_0x10b2('0x31')](_0x367e21[_0x10b2('0x2e')],_0x367e21[_0x10b2('0x2f')]);_0x5ce17b['attributes']=_[_0x10b2('0x31')](_0x367e21[_0x10b2('0x2e')],qs['fields'](_0x2289a3[_0x10b2('0x2f')]['fields']));_0x5ce17b[_0x10b2('0x32')]=_0x5ce17b[_0x10b2('0x32')]['length']?_0x5ce17b['attributes']:_0x367e21['model'];if(_0x2289a3[_0x10b2('0x2f')][_0x10b2('0x45')]){_0x5ce17b[_0x10b2('0x3e')]=[{'all':!![]}];}_0x5ce17b=_[_0x10b2('0x46')]({},_0x5ce17b,_0x2289a3['options']);return db[_0x10b2('0x2a')]['find'](_0x5ce17b)['then'](handleEntityNotFound(_0xc4415,null))['then'](respondWithResult(_0xc4415,null))[_0x10b2('0x41')](handleError(_0xc4415,null));};exports[_0x10b2('0x47')]=function(_0x53ea39,_0x5aa49f){return db['FaxQueueReport']['create'](_0x53ea39['body'],{})[_0x10b2('0x20')](respondWithResult(_0x5aa49f,0xc9))[_0x10b2('0x41')](handleError(_0x5aa49f,null));};exports[_0x10b2('0x1f')]=function(_0x584f70,_0x13ebfc){if(_0x584f70['body']['id']){delete _0x584f70[_0x10b2('0x48')]['id'];}return db[_0x10b2('0x2a')][_0x10b2('0x49')]({'where':{'id':_0x584f70[_0x10b2('0x43')]['id']}})['then'](handleEntityNotFound(_0x13ebfc,null))[_0x10b2('0x20')](saveUpdates(_0x584f70[_0x10b2('0x48')],null))[_0x10b2('0x20')](respondWithResult(_0x13ebfc,null))[_0x10b2('0x41')](handleError(_0x13ebfc,null));};exports[_0x10b2('0x21')]=function(_0x3e6dfc,_0x592eb6){return db[_0x10b2('0x2a')][_0x10b2('0x49')]({'where':{'id':_0x3e6dfc[_0x10b2('0x43')]['id']}})[_0x10b2('0x20')](handleEntityNotFound(_0x592eb6,null))['then'](removeEntity(_0x592eb6,null))[_0x10b2('0x41')](handleError(_0x592eb6,null));};exports[_0x10b2('0x4a')]=function(_0x370524,_0x25499e){return db[_0x10b2('0x2a')][_0x10b2('0x4a')]()[_0x10b2('0x20')](respondWithResult(_0x25499e,null))['catch'](handleError(_0x25499e,null));};
\ No newline at end of file
index 975e24b..cb7bc4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x920c=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x362abb,_0x12504a){var _0x398e13=function(_0x287a95){while(--_0x287a95){_0x362abb['push'](_0x362abb['shift']());}};_0x398e13(++_0x12504a);}(_0x920c,0x149));var _0xc920=function(_0xc079f,_0x4b6451){_0xc079f=_0xc079f-0x0;var _0x3eb4eb=_0x920c[_0xc079f];return _0x3eb4eb;};'use strict';var _=require(_0xc920('0x0'));var util=require(_0xc920('0x1'));var logger=require(_0xc920('0x2'))(_0xc920('0x3'));var moment=require('moment');var BPromise=require(_0xc920('0x4'));var rp=require(_0xc920('0x5'));var fs=require('fs');var path=require(_0xc920('0x6'));var rimraf=require(_0xc920('0x7'));var config=require(_0xc920('0x8'));var attributes=require(_0xc920('0x9'));module[_0xc920('0xa')]=function(_0xde5e9d,_0x53643b){return _0xde5e9d[_0xc920('0xb')](_0xc920('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc920('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b87=['define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x5b87,0x1a8));var _0x75b8=function(_0x518f2e,_0x75134f){_0x518f2e=_0x518f2e-0x0;var _0x1edff0=_0x5b87[_0x518f2e];return _0x1edff0;};'use strict';var _=require(_0x75b8('0x0'));var util=require(_0x75b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75b8('0x2'));var BPromise=require(_0x75b8('0x3'));var rp=require(_0x75b8('0x4'));var fs=require('fs');var path=require(_0x75b8('0x5'));var rimraf=require(_0x75b8('0x6'));var config=require(_0x75b8('0x7'));var attributes=require(_0x75b8('0x8'));module[_0x75b8('0x9')]=function(_0x59726b,_0xcd9861){return _0x59726b[_0x75b8('0xa')](_0x75b8('0xb'),attributes,{'tableName':_0x75b8('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x75b8('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index cfdfe8b..89b7817 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d06=['CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport','where','attributes','limit','lodash','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d06,0xe9));var _0x68d0=function(_0x206510,_0x170973){_0x206510=_0x206510-0x0;var _0x87aba=_0x8d06[_0x206510];return _0x87aba;};'use strict';var _=require(_0x68d0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x68d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x68d0('0x2'));var logger=require(_0x68d0('0x3'))('rpc');var config=require(_0x68d0('0x4'));var jayson=require(_0x68d0('0x5'));var client=jayson['client'][_0x68d0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4cdaaf,_0x456534,_0xb0931b){return new BPromise(function(_0x1e85ae,_0x558d20){return client[_0x68d0('0x7')](_0x4cdaaf,_0xb0931b)[_0x68d0('0x8')](function(_0x3c62c7){logger[_0x68d0('0x9')](_0x68d0('0xa'),_0x456534,'request\x20sent');logger[_0x68d0('0xb')](_0x68d0('0xc'),_0x456534,_0x68d0('0xd'),JSON['stringify'](_0x3c62c7));if(_0x3c62c7[_0x68d0('0xe')]){if(_0x3c62c7['error'][_0x68d0('0xf')]===0x1f4){logger[_0x68d0('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x456534,_0x3c62c7[_0x68d0('0xe')][_0x68d0('0x10')]);return _0x558d20(_0x3c62c7['error'][_0x68d0('0x10')]);}logger[_0x68d0('0xe')](_0x68d0('0xa'),_0x456534,_0x3c62c7['error'][_0x68d0('0x10')]);return _0x1e85ae(_0x3c62c7[_0x68d0('0xe')][_0x68d0('0x10')]);}else{logger[_0x68d0('0x9')]('FaxQueueReport,\x20%s,\x20%s',_0x456534,_0x68d0('0xd'));_0x1e85ae(_0x3c62c7[_0x68d0('0x11')][_0x68d0('0x10')]);}})[_0x68d0('0x12')](function(_0x1deab8){logger[_0x68d0('0xe')](_0x68d0('0xa'),_0x456534,_0x1deab8);_0x558d20(_0x1deab8);});});}exports[_0x68d0('0x13')]=function(_0x2e7aec){var _0x2ac137=this;return new Promise(function(_0x36e966,_0x514ecb){return db[_0x68d0('0x14')]['create'](_0x2e7aec[_0x68d0('0x15')],{'raw':_0x2e7aec[_0x68d0('0x16')]?_0x2e7aec[_0x68d0('0x16')][_0x68d0('0x17')]===undefined?!![]:![]:!![]})[_0x68d0('0x8')](function(_0x263aeb){logger['info'](_0x68d0('0x13'),_0x2e7aec);logger[_0x68d0('0xb')](_0x68d0('0x13'),_0x2e7aec,JSON['stringify'](_0x263aeb));_0x36e966(_0x263aeb);})[_0x68d0('0x12')](function(_0x511b0f){logger[_0x68d0('0xe')](_0x68d0('0x13'),_0x511b0f['message'],_0x2e7aec);_0x514ecb(_0x2ac137['error'](0x1f4,_0x511b0f['message']));});});};exports[_0x68d0('0x18')]=function(_0x347462){var _0x3a2dd1=this;return new Promise(function(_0x3739a1,_0xda747c){return db[_0x68d0('0x14')]['update'](_0x347462[_0x68d0('0x15')],{'raw':_0x347462[_0x68d0('0x16')]?_0x347462[_0x68d0('0x16')][_0x68d0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x347462['options']?_0x347462[_0x68d0('0x16')][_0x68d0('0x19')]||null:null,'attributes':_0x347462[_0x68d0('0x16')]?_0x347462[_0x68d0('0x16')][_0x68d0('0x1a')]||null:null,'limit':_0x347462['options']?_0x347462['options'][_0x68d0('0x1b')]||null:null})[_0x68d0('0x8')](function(_0x3beadf){logger['info'](_0x68d0('0x18'),_0x347462);logger[_0x68d0('0xb')](_0x68d0('0x18'),_0x347462,JSON['stringify'](_0x3beadf));_0x3739a1(_0x3beadf);})[_0x68d0('0x12')](function(_0x2c70a5){logger['error']('UpdateFaxQueueReport',_0x2c70a5[_0x68d0('0x10')],_0x347462);_0xda747c(_0x3a2dd1[_0x68d0('0xe')](0x1f4,_0x2c70a5[_0x68d0('0x10')]));});});};
\ No newline at end of file
+var _0xc33a=['then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','update','where','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x57477c,_0x24a185){var _0x38b4e3=function(_0x2d9f16){while(--_0x2d9f16){_0x57477c['push'](_0x57477c['shift']());}};_0x38b4e3(++_0x24a185);}(_0xc33a,0x7e));var _0xac33=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xc33a[_0x4bacb6];return _0x58c029;};'use strict';var _=require(_0xac33('0x0'));var util=require(_0xac33('0x1'));var moment=require(_0xac33('0x2'));var BPromise=require(_0xac33('0x3'));var rs=require(_0xac33('0x4'));var fs=require('fs');var Redis=require(_0xac33('0x5'));var db=require(_0xac33('0x6'))['db'];var utils=require(_0xac33('0x7'));var logger=require(_0xac33('0x8'))(_0xac33('0x9'));var config=require('../../config/environment');var jayson=require(_0xac33('0xa'));var client=jayson[_0xac33('0xb')][_0xac33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc057a4,_0x38ce21,_0x581925){return new BPromise(function(_0x2eb481,_0x4d85a7){return client[_0xac33('0xd')](_0xc057a4,_0x581925)[_0xac33('0xe')](function(_0x1cf61c){logger[_0xac33('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x38ce21,_0xac33('0x10'));logger[_0xac33('0x11')](_0xac33('0x12'),_0x38ce21,_0xac33('0x10'),JSON[_0xac33('0x13')](_0x1cf61c));if(_0x1cf61c[_0xac33('0x14')]){if(_0x1cf61c['error'][_0xac33('0x15')]===0x1f4){logger[_0xac33('0x14')](_0xac33('0x16'),_0x38ce21,_0x1cf61c['error']['message']);return _0x4d85a7(_0x1cf61c[_0xac33('0x14')][_0xac33('0x17')]);}logger['error'](_0xac33('0x16'),_0x38ce21,_0x1cf61c['error'][_0xac33('0x17')]);return _0x2eb481(_0x1cf61c[_0xac33('0x14')][_0xac33('0x17')]);}else{logger[_0xac33('0xf')](_0xac33('0x16'),_0x38ce21,_0xac33('0x10'));_0x2eb481(_0x1cf61c[_0xac33('0x18')][_0xac33('0x17')]);}})[_0xac33('0x19')](function(_0x47cefb){logger[_0xac33('0x14')](_0xac33('0x16'),_0x38ce21,_0x47cefb);_0x4d85a7(_0x47cefb);});});}exports[_0xac33('0x1a')]=function(_0xa8ae86){var _0x3c0502=this;return new Promise(function(_0x107c88,_0x4bdc9a){return db[_0xac33('0x1b')]['create'](_0xa8ae86[_0xac33('0x1c')],{'raw':_0xa8ae86['options']?_0xa8ae86[_0xac33('0x1d')][_0xac33('0x1e')]===undefined?!![]:![]:!![]})[_0xac33('0xe')](function(_0x3757ae){logger[_0xac33('0xf')](_0xac33('0x1a'),_0xa8ae86);logger[_0xac33('0x11')](_0xac33('0x1a'),_0xa8ae86,JSON[_0xac33('0x13')](_0x3757ae));_0x107c88(_0x3757ae);})[_0xac33('0x19')](function(_0xc87c31){logger['error'](_0xac33('0x1a'),_0xc87c31[_0xac33('0x17')],_0xa8ae86);_0x4bdc9a(_0x3c0502[_0xac33('0x14')](0x1f4,_0xc87c31[_0xac33('0x17')]));});});};exports['UpdateFaxQueueReport']=function(_0x2d53a2){var _0x35eda0=this;return new Promise(function(_0x2a9a6d,_0x39e374){return db[_0xac33('0x1b')][_0xac33('0x1f')](_0x2d53a2['body'],{'raw':_0x2d53a2['options']?_0x2d53a2[_0xac33('0x1d')][_0xac33('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d53a2['options']?_0x2d53a2['options'][_0xac33('0x20')]||null:null,'attributes':_0x2d53a2[_0xac33('0x1d')]?_0x2d53a2[_0xac33('0x1d')]['attributes']||null:null,'limit':_0x2d53a2['options']?_0x2d53a2[_0xac33('0x1d')][_0xac33('0x21')]||null:null})[_0xac33('0xe')](function(_0x53d674){logger[_0xac33('0xf')](_0xac33('0x22'),_0x2d53a2);logger['debug'](_0xac33('0x22'),_0x2d53a2,JSON[_0xac33('0x13')](_0x53d674));_0x2a9a6d(_0x53d674);})['catch'](function(_0x4b51b2){logger[_0xac33('0x14')]('UpdateFaxQueueReport',_0x4b51b2[_0xac33('0x17')],_0x2d53a2);_0x39e374(_0x35eda0['error'](0x1f4,_0x4b51b2[_0xac33('0x17')]));});});};
\ No newline at end of file
index 5d54cdb..087c256 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ea6=['./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0xebc2cb,_0x3dae2b){var _0x34ae49=function(_0x56888a){while(--_0x56888a){_0xebc2cb['push'](_0xebc2cb['shift']());}};_0x34ae49(++_0x3dae2b);}(_0x3ea6,0xe4));var _0x63ea=function(_0x56f2a9,_0x25a7ef){_0x56f2a9=_0x56f2a9-0x0;var _0x45992c=_0x3ea6[_0x56f2a9];return _0x45992c;};'use strict';var multer=require(_0x63ea('0x0'));var util=require(_0x63ea('0x1'));var path=require('path');var timeout=require(_0x63ea('0x2'));var express=require(_0x63ea('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x63ea('0x4'));var config=require(_0x63ea('0x5'));var controller=require(_0x63ea('0x6'));router[_0x63ea('0x7')]('/',auth['isAuthenticated'](),controller[_0x63ea('0x8')]);router[_0x63ea('0x7')](_0x63ea('0x9'),auth[_0x63ea('0xa')](),controller[_0x63ea('0xb')]);router[_0x63ea('0x7')](_0x63ea('0xc'),auth[_0x63ea('0xa')](),controller[_0x63ea('0xd')]);router[_0x63ea('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x63ea('0xf')]('/:id',auth[_0x63ea('0xa')](),controller[_0x63ea('0x10')]);router[_0x63ea('0x11')](_0x63ea('0xc'),auth[_0x63ea('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbe85=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','show','create'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xbe85,0xc4));var _0x5be8=function(_0x223613,_0x5f2714){_0x223613=_0x223613-0x0;var _0x17ef63=_0xbe85[_0x223613];return _0x17ef63;};'use strict';var multer=require(_0x5be8('0x0'));var util=require(_0x5be8('0x1'));var path=require(_0x5be8('0x2'));var timeout=require(_0x5be8('0x3'));var express=require(_0x5be8('0x4'));var router=express[_0x5be8('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5be8('0x6'));var controller=require(_0x5be8('0x7'));router[_0x5be8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5be8('0x8')](_0x5be8('0x9'),auth[_0x5be8('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5be8('0xb')]);router['post']('/',auth[_0x5be8('0xa')](),controller[_0x5be8('0xc')]);router[_0x5be8('0xd')](_0x5be8('0xe'),auth[_0x5be8('0xa')](),controller[_0x5be8('0xf')]);router[_0x5be8('0x10')](_0x5be8('0xe'),auth['isAuthenticated'](),controller[_0x5be8('0x11')]);module[_0x5be8('0x12')]=router;
\ No newline at end of file
index 16f3939..b709dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64d7=['moment','sequelize','exports','account','agent','queue','NOW'];(function(_0x125a8a,_0x490d31){var _0xe767a5=function(_0x2a505c){while(--_0x2a505c){_0x125a8a['push'](_0x125a8a['shift']());}};_0xe767a5(++_0x490d31);}(_0x64d7,0x12d));var _0x764d=function(_0x25d4b1,_0x4e896d){_0x25d4b1=_0x25d4b1-0x0;var _0x2d51a5=_0x64d7[_0x25d4b1];return _0x2d51a5;};'use strict';var moment=require(_0x764d('0x0'));var Sequelize=require(_0x764d('0x1'));module[_0x764d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x764d('0x3'),_0x764d('0x4'),'queue'),'allowNull':![],'defaultValue':_0x764d('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x764d('0x6')]}};
\ No newline at end of file
+var _0xd850=['queue','DATE','exports','STRING','ENUM','agent'];(function(_0x3183f3,_0x56ea53){var _0x28e684=function(_0x360c66){while(--_0x360c66){_0x3183f3['push'](_0x3183f3['shift']());}};_0x28e684(++_0x56ea53);}(_0xd850,0x1c4));var _0x0d85=function(_0x32313f,_0x26ffa0){_0x32313f=_0x32313f-0x0;var _0x1726d6=_0xd850[_0x32313f];return _0x1726d6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x0d85('0x0')]={'uniqueid':{'type':Sequelize[_0x0d85('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0d85('0x2')]('account',_0x0d85('0x3'),_0x0d85('0x4')),'allowNull':![],'defaultValue':_0x0d85('0x4')},'transferredAt':{'type':Sequelize[_0x0d85('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 1240c23..8120e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','show','params','includeAll','options','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','FaxTransferReport','include','rows'];(function(_0x2d2778,_0x31ed0c){var _0x44ef2f=function(_0x330680){while(--_0x330680){_0x2d2778['push'](_0x2d2778['shift']());}};_0x44ef2f(++_0x31ed0c);}(_0xb10b,0x12a));var _0xbb10=function(_0xabe145,_0x2ef96d){_0xabe145=_0xabe145-0x0;var _0x433e19=_0xb10b[_0xabe145];return _0x433e19;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['FaxTransferReport'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));};exports[_0xbb10('0x47')]=function(_0x36ab7d,_0xb014b0){return db[_0xbb10('0x3b')][_0xbb10('0x47')]()[_0xbb10('0x23')](respondWithResult(_0xb014b0,null))[_0xbb10('0x3e')](handleError(_0xb014b0,null));};
\ No newline at end of file
+var _0xdb28=['Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','limit','set'];(function(_0x5226c3,_0x5b006f){var _0x355991=function(_0x5953c3){while(--_0x5953c3){_0x5226c3['push'](_0x5226c3['shift']());}};_0x355991(++_0x5b006f);}(_0xdb28,0x106));var _0x8db2=function(_0x457a89,_0x2065b1){_0x457a89=_0x457a89-0x0;var _0x245ee0=_0xdb28[_0x457a89];return _0x245ee0;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];function respondWithStatusCode(_0x1349f6,_0x204f49){_0x204f49=_0x204f49||0xcc;return function(_0x37d017){if(_0x37d017){return _0x1349f6['sendStatus'](_0x204f49);}return _0x1349f6['status'](_0x204f49)[_0x8db2('0x18')]();};}function respondWithResult(_0x15e87c,_0x350d61){_0x350d61=_0x350d61||0xc8;return function(_0x1d6a15){if(_0x1d6a15){return _0x15e87c[_0x8db2('0x19')](_0x350d61)[_0x8db2('0x1a')](_0x1d6a15);}};}function respondWithFilteredResult(_0x2f177a,_0x3c96a7){return function(_0x131252){if(_0x131252){var _0x16c8c2=_0x131252['count'],_0x5489a9=_0x3c96a7[_0x8db2('0x1b')],_0x13b0f5=_0x3c96a7[_0x8db2('0x1b')]+_0x3c96a7[_0x8db2('0x1c')],_0x24da1b;if(_0x13b0f5>=_0x16c8c2){_0x13b0f5=_0x16c8c2;_0x24da1b=0xc8;}else{_0x24da1b=0xce;}_0x2f177a[_0x8db2('0x19')](_0x24da1b);return _0x2f177a[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x5489a9+'-'+_0x13b0f5+'/'+_0x16c8c2)['json'](_0x131252);}return null;};}function patchUpdates(_0x5df464){return function(_0x77789){try{jsonpatch[_0x8db2('0x1f')](_0x77789,_0x5df464,!![]);}catch(_0x1310d3){return BPromise[_0x8db2('0x20')](_0x1310d3);}return _0x77789['save']();};}function saveUpdates(_0x431d60,_0x36a9ff){return function(_0x260940){if(_0x260940){return _0x260940[_0x8db2('0x21')](_0x431d60)[_0x8db2('0x22')](function(_0x597260){return _0x597260;});}return null;};}function removeEntity(_0x124467,_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x23')]()[_0x8db2('0x22')](function(){_0x124467[_0x8db2('0x19')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x5c6614,_0x256202){return function(_0x4f6516){if(!_0x4f6516){_0x5c6614['sendStatus'](0x194);}return _0x4f6516;};}function handleError(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0x1f4;return function(_0xec8cd2){logger[_0x8db2('0x24')](_0xec8cd2[_0x8db2('0x25')]);if(_0xec8cd2[_0x8db2('0x26')]){delete _0xec8cd2[_0x8db2('0x26')];}_0x52a9ca[_0x8db2('0x19')](_0x4d923c)['send'](_0xec8cd2);};}exports[_0x8db2('0x27')]=function(_0x372311,_0x430dd5){var _0x8b7cec={},_0x483aee={},_0x2e0691={'count':0x0,'rows':[]};var _0x11f398=_[_0x8db2('0x28')](db[_0x8db2('0x29')][_0x8db2('0x2a')],function(_0x21bae5){return{'name':_0x21bae5[_0x8db2('0x2b')],'type':_0x21bae5[_0x8db2('0x2c')][_0x8db2('0x2d')]};});_0x483aee['model']=_[_0x8db2('0x28')](_0x11f398,'name');_0x483aee['query']=_[_0x8db2('0x2e')](_0x372311[_0x8db2('0x2f')]);_0x483aee[_0x8db2('0x30')]=_['intersection'](_0x483aee[_0x8db2('0x31')],_0x483aee['query']);_0x8b7cec[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x483aee[_0x8db2('0x31')],qs['fields'](_0x372311['query'][_0x8db2('0x34')]));_0x8b7cec[_0x8db2('0x32')]=_0x8b7cec['attributes']['length']?_0x8b7cec[_0x8db2('0x32')]:_0x483aee[_0x8db2('0x31')];if(!_0x372311[_0x8db2('0x2f')][_0x8db2('0x35')](_0x8db2('0x36'))){_0x8b7cec[_0x8db2('0x1c')]=qs[_0x8db2('0x1c')](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1c')]);_0x8b7cec[_0x8db2('0x1b')]=qs['offset'](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1b')]);}_0x8b7cec['order']=qs[_0x8db2('0x37')](_0x372311[_0x8db2('0x2f')]['sort']);_0x8b7cec['where']=qs[_0x8db2('0x30')](_['pick'](_0x372311[_0x8db2('0x2f')],_0x483aee[_0x8db2('0x30')]),_0x11f398);if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]){_0x8b7cec['where']=_[_0x8db2('0x39')](_0x8b7cec['where'],{'$or':_[_0x8db2('0x28')](_0x11f398,function(_0xd550ae){if(_0xd550ae[_0x8db2('0x2c')]!==_0x8db2('0x3a')){var _0x50e88a={};_0x50e88a[_0xd550ae['name']]={'$like':'%'+_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]+'%'};return _0x50e88a;}})});}_0x8b7cec=_['merge']({},_0x8b7cec,_0x372311[_0x8db2('0x3b')]);var _0x24bcfe={'where':_0x8b7cec[_0x8db2('0x3c')]};return db['FaxTransferReport'][_0x8db2('0x3d')](_0x24bcfe)[_0x8db2('0x22')](function(_0x953349){_0x2e0691[_0x8db2('0x3d')]=_0x953349;if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x3e')]){_0x8b7cec[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x29')][_0x8db2('0x40')](_0x8b7cec);})[_0x8db2('0x22')](function(_0x21cf7c){_0x2e0691[_0x8db2('0x41')]=_0x21cf7c;return _0x2e0691;})[_0x8db2('0x22')](respondWithFilteredResult(_0x430dd5,_0x8b7cec))['catch'](handleError(_0x430dd5,null));};exports[_0x8db2('0x42')]=function(_0x2b2472,_0x5e0382){var _0x49a7ae={'raw':!![],'where':{'id':_0x2b2472['params']['id']}},_0x249c73={};_0x249c73[_0x8db2('0x31')]=_[_0x8db2('0x2e')](db[_0x8db2('0x29')][_0x8db2('0x2a')]);_0x249c73[_0x8db2('0x2f')]=_[_0x8db2('0x2e')](_0x2b2472[_0x8db2('0x2f')]);_0x249c73['filters']=_[_0x8db2('0x33')](_0x249c73[_0x8db2('0x31')],_0x249c73[_0x8db2('0x2f')]);_0x49a7ae[_0x8db2('0x32')]=_['intersection'](_0x249c73[_0x8db2('0x31')],qs[_0x8db2('0x34')](_0x2b2472[_0x8db2('0x2f')][_0x8db2('0x34')]));_0x49a7ae['attributes']=_0x49a7ae[_0x8db2('0x32')]['length']?_0x49a7ae[_0x8db2('0x32')]:_0x249c73[_0x8db2('0x31')];if(_0x2b2472[_0x8db2('0x2f')]['includeAll']){_0x49a7ae['include']=[{'all':!![]}];}_0x49a7ae=_[_0x8db2('0x39')]({},_0x49a7ae,_0x2b2472['options']);return db[_0x8db2('0x29')][_0x8db2('0x43')](_0x49a7ae)[_0x8db2('0x22')](handleEntityNotFound(_0x5e0382,null))[_0x8db2('0x22')](respondWithResult(_0x5e0382,null))[_0x8db2('0x44')](handleError(_0x5e0382,null));};exports[_0x8db2('0x45')]=function(_0x4355e2,_0xab6bdd){return db[_0x8db2('0x29')][_0x8db2('0x45')](_0x4355e2[_0x8db2('0x46')],{})[_0x8db2('0x22')](respondWithResult(_0xab6bdd,0xc9))['catch'](handleError(_0xab6bdd,null));};exports[_0x8db2('0x21')]=function(_0x2ada52,_0xdbba64){if(_0x2ada52[_0x8db2('0x46')]['id']){delete _0x2ada52['body']['id'];}return db['FaxTransferReport'][_0x8db2('0x43')]({'where':{'id':_0x2ada52[_0x8db2('0x47')]['id']}})[_0x8db2('0x22')](handleEntityNotFound(_0xdbba64,null))['then'](saveUpdates(_0x2ada52['body'],null))['then'](respondWithResult(_0xdbba64,null))[_0x8db2('0x44')](handleError(_0xdbba64,null));};exports[_0x8db2('0x23')]=function(_0x55c7dd,_0x383fa1){return db[_0x8db2('0x29')][_0x8db2('0x43')]({'where':{'id':_0x55c7dd[_0x8db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x383fa1,null))['then'](removeEntity(_0x383fa1,null))[_0x8db2('0x44')](handleError(_0x383fa1,null));};exports[_0x8db2('0x48')]=function(_0x2908e4,_0x2f0bd0){return db[_0x8db2('0x29')][_0x8db2('0x48')]()[_0x8db2('0x22')](respondWithResult(_0x2f0bd0,null))[_0x8db2('0x44')](handleError(_0x2f0bd0,null));};
\ No newline at end of file
index 40f45d1..bfd7374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f9d=['../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x3f9d,0x179));var _0xd3f9=function(_0x12e13a,_0x3f8461){_0x12e13a=_0x12e13a-0x0;var _0xf4cf3c=_0x3f9d[_0x12e13a];return _0xf4cf3c;};'use strict';var _=require('lodash');var util=require(_0xd3f9('0x0'));var logger=require(_0xd3f9('0x1'))(_0xd3f9('0x2'));var moment=require(_0xd3f9('0x3'));var BPromise=require(_0xd3f9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3f9('0x5'));var rimraf=require(_0xd3f9('0x6'));var config=require(_0xd3f9('0x7'));var attributes=require(_0xd3f9('0x8'));module[_0xd3f9('0x9')]=function(_0x59575f,_0x2522b9){return _0x59575f['define']('FaxTransferReport',attributes,{'tableName':_0xd3f9('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd3f9('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4db=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x13524d,_0x505b49){var _0x9918b4=function(_0xef1f0a){while(--_0xef1f0a){_0x13524d['push'](_0x13524d['shift']());}};_0x9918b4(++_0x505b49);}(_0xf4db,0x19e));var _0xbf4d=function(_0x32874f,_0x2b45c6){_0x32874f=_0x32874f-0x0;var _0x5a89c6=_0xf4db[_0x32874f];return _0x5a89c6;};'use strict';var _=require(_0xbf4d('0x0'));var util=require(_0xbf4d('0x1'));var logger=require(_0xbf4d('0x2'))(_0xbf4d('0x3'));var moment=require(_0xbf4d('0x4'));var BPromise=require(_0xbf4d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf4d('0x6'));var rimraf=require(_0xbf4d('0x7'));var config=require(_0xbf4d('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0xbf4d('0x9')]=function(_0x40689c,_0x400377){return _0x40689c['define'](_0xbf4d('0xa'),attributes,{'tableName':_0xbf4d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbf4d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index a17300a..4f95994 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x389c=['then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x1b8560,_0x928bbf){var _0x2d0032=function(_0x4d2c30){while(--_0x4d2c30){_0x1b8560['push'](_0x1b8560['shift']());}};_0x2d0032(++_0x928bbf);}(_0x389c,0x169));var _0xc389=function(_0x3bf146,_0x526a48){_0x3bf146=_0x3bf146-0x0;var _0x42a9f9=_0x389c[_0x3bf146];return _0x42a9f9;};'use strict';var _=require(_0xc389('0x0'));var util=require(_0xc389('0x1'));var moment=require(_0xc389('0x2'));var BPromise=require(_0xc389('0x3'));var rs=require(_0xc389('0x4'));var fs=require('fs');var Redis=require(_0xc389('0x5'));var db=require(_0xc389('0x6'))['db'];var utils=require(_0xc389('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc389('0x8'));var jayson=require(_0xc389('0x9'));var client=jayson[_0xc389('0xa')][_0xc389('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e1dd,_0x51bb2f,_0x2169eb){return new BPromise(function(_0x879e3e,_0x37f585){return client[_0xc389('0xc')](_0x12e1dd,_0x2169eb)[_0xc389('0xd')](function(_0x62e0aa){logger[_0xc389('0xe')](_0xc389('0xf'),_0x51bb2f,_0xc389('0x10'));logger[_0xc389('0x11')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x51bb2f,_0xc389('0x10'),JSON[_0xc389('0x12')](_0x62e0aa));if(_0x62e0aa[_0xc389('0x13')]){if(_0x62e0aa[_0xc389('0x13')][_0xc389('0x14')]===0x1f4){logger[_0xc389('0x13')](_0xc389('0xf'),_0x51bb2f,_0x62e0aa[_0xc389('0x13')][_0xc389('0x15')]);return _0x37f585(_0x62e0aa[_0xc389('0x13')]['message']);}logger[_0xc389('0x13')](_0xc389('0xf'),_0x51bb2f,_0x62e0aa[_0xc389('0x13')][_0xc389('0x15')]);return _0x879e3e(_0x62e0aa[_0xc389('0x13')][_0xc389('0x15')]);}else{logger[_0xc389('0xe')](_0xc389('0xf'),_0x51bb2f,_0xc389('0x10'));_0x879e3e(_0x62e0aa['result'][_0xc389('0x15')]);}})['catch'](function(_0x11b6f6){logger[_0xc389('0x13')](_0xc389('0xf'),_0x51bb2f,_0x11b6f6);_0x37f585(_0x11b6f6);});});}
\ No newline at end of file
+var _0x31bc=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x31bc,0x10e));var _0xc31b=function(_0x329611,_0x44a854){_0x329611=_0x329611-0x0;var _0x3e0fb3=_0x31bc[_0x329611];return _0x3e0fb3;};'use strict';var _=require(_0xc31b('0x0'));var util=require(_0xc31b('0x1'));var moment=require(_0xc31b('0x2'));var BPromise=require(_0xc31b('0x3'));var rs=require(_0xc31b('0x4'));var fs=require('fs');var Redis=require(_0xc31b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc31b('0x6'));var logger=require(_0xc31b('0x7'))(_0xc31b('0x8'));var config=require(_0xc31b('0x9'));var jayson=require(_0xc31b('0xa'));var client=jayson[_0xc31b('0xb')][_0xc31b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b04b,_0x5a6bb3,_0x5dd7c2){return new BPromise(function(_0x535a29,_0x275318){return client[_0xc31b('0xd')](_0x42b04b,_0x5dd7c2)[_0xc31b('0xe')](function(_0x261b81){logger[_0xc31b('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x5a6bb3,_0xc31b('0x10'));logger[_0xc31b('0x11')](_0xc31b('0x12'),_0x5a6bb3,_0xc31b('0x10'),JSON[_0xc31b('0x13')](_0x261b81));if(_0x261b81['error']){if(_0x261b81['error']['code']===0x1f4){logger[_0xc31b('0x14')](_0xc31b('0x15'),_0x5a6bb3,_0x261b81['error']['message']);return _0x275318(_0x261b81['error'][_0xc31b('0x16')]);}logger[_0xc31b('0x14')](_0xc31b('0x15'),_0x5a6bb3,_0x261b81['error']['message']);return _0x535a29(_0x261b81[_0xc31b('0x14')][_0xc31b('0x16')]);}else{logger['info'](_0xc31b('0x15'),_0x5a6bb3,_0xc31b('0x10'));_0x535a29(_0x261b81[_0xc31b('0x17')][_0xc31b('0x16')]);}})[_0xc31b('0x18')](function(_0x588898){logger[_0xc31b('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x5a6bb3,_0x588898);_0x275318(_0x588898);});});}
\ No newline at end of file
index 99a4f41..113d9ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a7=['/:id','put','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x541c7d,_0x28406e){var _0xd9ba86=function(_0x12b348){while(--_0x12b348){_0x541c7d['push'](_0x541c7d['shift']());}};_0xd9ba86(++_0x28406e);}(_0x73a7,0xcb));var _0x773a=function(_0x202699,_0x512a22){_0x202699=_0x202699-0x0;var _0x4e1415=_0x73a7[_0x202699];return _0x4e1415;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x773a('0x0'));var timeout=require(_0x773a('0x1'));var express=require(_0x773a('0x2'));var router=express[_0x773a('0x3')]();var auth=require(_0x773a('0x4'));var interaction=require(_0x773a('0x5'));var config=require(_0x773a('0x6'));var controller=require(_0x773a('0x7'));router[_0x773a('0x8')]('/',auth[_0x773a('0x9')](),controller[_0x773a('0xa')]);router['get'](_0x773a('0xb'),auth[_0x773a('0x9')](),controller[_0x773a('0xc')]);router['get'](_0x773a('0xd'),auth[_0x773a('0x9')](),controller['show']);router['post']('/',auth[_0x773a('0x9')](),controller['create']);router[_0x773a('0xe')](_0x773a('0xd'),auth[_0x773a('0x9')](),controller[_0x773a('0xf')]);router['delete'](_0x773a('0xd'),auth[_0x773a('0x9')](),controller[_0x773a('0x10')]);module[_0x773a('0x11')]=router;
\ No newline at end of file
+var _0xad66=['destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','/:id','show','isAuthenticated','update','delete'];(function(_0x11b05b,_0x2c94ba){var _0x2ba447=function(_0x43a29c){while(--_0x43a29c){_0x11b05b['push'](_0x11b05b['shift']());}};_0x2ba447(++_0x2c94ba);}(_0xad66,0x167));var _0x6ad6=function(_0x1c7db8,_0x11d16f){_0x1c7db8=_0x1c7db8-0x0;var _0x32af18=_0xad66[_0x1c7db8];return _0x32af18;};'use strict';var multer=require('multer');var util=require(_0x6ad6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6ad6('0x1'));var router=express[_0x6ad6('0x2')]();var auth=require(_0x6ad6('0x3'));var interaction=require(_0x6ad6('0x4'));var config=require(_0x6ad6('0x5'));var controller=require(_0x6ad6('0x6'));router[_0x6ad6('0x7')]('/',auth['isAuthenticated'](),controller[_0x6ad6('0x8')]);router[_0x6ad6('0x7')](_0x6ad6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x6ad6('0x7')](_0x6ad6('0xa'),auth['isAuthenticated'](),controller[_0x6ad6('0xb')]);router['post']('/',auth[_0x6ad6('0xc')](),controller['create']);router['put'](_0x6ad6('0xa'),auth[_0x6ad6('0xc')](),controller[_0x6ad6('0xd')]);router[_0x6ad6('0xe')]('/:id',auth[_0x6ad6('0xc')](),controller[_0x6ad6('0xf')]);module[_0x6ad6('0x10')]=router;
\ No newline at end of file
index ded1f98..fb18476 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8819=['put','/:id','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id/configurations','getFields','post','create'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x8819,0x94));var _0x9881=function(_0x4f2efd,_0x81ad8a){_0x4f2efd=_0x4f2efd-0x0;var _0x2737ff=_0x8819[_0x4f2efd];return _0x2737ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9881('0x0'));var timeout=require(_0x9881('0x1'));var express=require(_0x9881('0x2'));var router=express[_0x9881('0x3')]();var auth=require(_0x9881('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9881('0x5'));var controller=require(_0x9881('0x6'));router[_0x9881('0x7')]('/',auth[_0x9881('0x8')](),controller[_0x9881('0x9')]);router[_0x9881('0x7')]('/:id',auth[_0x9881('0x8')](),controller['show']);router['get'](_0x9881('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x9881('0x7')]('/:id/fields',auth[_0x9881('0x8')](),controller[_0x9881('0xb')]);router[_0x9881('0xc')]('/',auth['isAuthenticated'](),controller[_0x9881('0xd')]);router[_0x9881('0xc')](_0x9881('0xa'),auth[_0x9881('0x8')](),controller['addConfiguration']);router[_0x9881('0xe')](_0x9881('0xf'),auth['isAuthenticated'](),controller[_0x9881('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9881('0x11')]=router;
\ No newline at end of file
+var _0xd8b1=['getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','show','/:id/configurations'];(function(_0x42c7d1,_0x43778a){var _0x21bce5=function(_0x2d3050){while(--_0x2d3050){_0x42c7d1['push'](_0x42c7d1['shift']());}};_0x21bce5(++_0x43778a);}(_0xd8b1,0x105));var _0x1d8b=function(_0x280f2e,_0x116cca){_0x280f2e=_0x280f2e-0x0;var _0x140302=_0xd8b1[_0x280f2e];return _0x140302;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var auth=require(_0x1d8b('0x5'));var interaction=require(_0x1d8b('0x6'));var config=require('../../config/environment');var controller=require(_0x1d8b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1d8b('0x8')]('/:id',auth[_0x1d8b('0x9')](),controller[_0x1d8b('0xa')]);router[_0x1d8b('0x8')](_0x1d8b('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x1d8b('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1d8b('0xc')]);router['post']('/',auth[_0x1d8b('0x9')](),controller['create']);router[_0x1d8b('0xd')](_0x1d8b('0xb'),auth[_0x1d8b('0x9')](),controller[_0x1d8b('0xe')]);router[_0x1d8b('0xf')](_0x1d8b('0x10'),auth['isAuthenticated'](),controller[_0x1d8b('0x11')]);router[_0x1d8b('0x12')](_0x1d8b('0x10'),auth[_0x1d8b('0x9')](),controller[_0x1d8b('0x13')]);module[_0x1d8b('0x14')]=router;
\ No newline at end of file
index 89d4fec..44534fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab1=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x134117,_0x48511c){var _0x48fa91=function(_0xb14da3){while(--_0xb14da3){_0x134117['push'](_0x134117['shift']());}};_0x48fa91(++_0x48511c);}(_0x1ab1,0x147));var _0x11ab=function(_0x502eff,_0x55a5e2){_0x502eff=_0x502eff-0x0;var _0xd0ef40=_0x1ab1[_0x502eff];return _0xd0ef40;};'use strict';var Sequelize=require(_0x11ab('0x0'));module[_0x11ab('0x1')]={'name':{'type':Sequelize[_0x11ab('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x11ab('0x2')]},'remoteUri':{'type':Sequelize[_0x11ab('0x2')]},'authType':{'type':Sequelize[_0x11ab('0x3')](_0x11ab('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x11ab('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x11ab('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x11ab('0x2')]},'serverUrl':{'type':Sequelize[_0x11ab('0x2')]},'type':{'type':Sequelize['ENUM'](_0x11ab('0x5'),_0x11ab('0x6')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0xc3c3=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x131890,_0x1f8b7e){var _0x461f8f=function(_0x384752){while(--_0x384752){_0x131890['push'](_0x131890['shift']());}};_0x461f8f(++_0x1f8b7e);}(_0xc3c3,0xfb));var _0x3c3c=function(_0x273bbd,_0x2724b5){_0x273bbd=_0x273bbd-0x0;var _0x37c0b1=_0xc3c3[_0x273bbd];return _0x37c0b1;};'use strict';var Sequelize=require(_0x3c3c('0x0'));module[_0x3c3c('0x1')]={'name':{'type':Sequelize[_0x3c3c('0x2')]},'description':{'type':Sequelize[_0x3c3c('0x2')]},'username':{'type':Sequelize[_0x3c3c('0x2')]},'remoteUri':{'type':Sequelize[_0x3c3c('0x2')]},'authType':{'type':Sequelize[_0x3c3c('0x3')](_0x3c3c('0x4')),'defaultValue':_0x3c3c('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x3c3c('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x3c3c('0x2')]},'serverUrl':{'type':Sequelize[_0x3c3c('0x2')]},'type':{'type':Sequelize[_0x3c3c('0x3')](_0x3c3c('0x5'),_0x3c3c('0x6')),'defaultValue':_0x3c3c('0x5')}};
\ No newline at end of file
index 6cd9c73..6bae37e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc94f=['fields','hasOwnProperty','limit','sort','where','pick','filter','merge','map','type','options','includeAll','include','rows','show','params','length','find','body','findOne','DeskConfiguration','order','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','Authorization','Basic\x20%s','username','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','name','send','index','DeskAccount','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection'];(function(_0xb954d5,_0x331f78){var _0x2bdd19=function(_0x416f4c){while(--_0x416f4c){_0xb954d5['push'](_0xb954d5['shift']());}};_0x2bdd19(++_0x331f78);}(_0xc94f,0x12a));var _0xfc94=function(_0x5a4ebb,_0x5459d6){_0x5a4ebb=_0x5a4ebb-0x0;var _0xbb2a27=_0xc94f[_0x5a4ebb];return _0xbb2a27;};'use strict';var pdf=require(_0xfc94('0x0'));var emlformat=require(_0xfc94('0x1'));var rimraf=require(_0xfc94('0x2'));var zipdir=require(_0xfc94('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc94('0x4'));var moment=require('moment');var BPromise=require(_0xfc94('0x5'));var Mustache=require(_0xfc94('0x6'));var util=require('util');var path=require(_0xfc94('0x7'));var sox=require(_0xfc94('0x8'));var csv=require(_0xfc94('0x9'));var ejs=require(_0xfc94('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfc94('0xb'));var jsforce=require(_0xfc94('0xc'));var deskjs=require(_0xfc94('0xd'));var toCsv=require(_0xfc94('0x9'));var querystring=require('querystring');var Papa=require(_0xfc94('0xe'));var Redis=require('ioredis');var authService=require(_0xfc94('0xf'));var qs=require(_0xfc94('0x10'));var as=require(_0xfc94('0x11'));var hardwareService=require(_0xfc94('0x12'));var logger=require(_0xfc94('0x13'))(_0xfc94('0x14'));var utils=require('../../config/utils');var config=require(_0xfc94('0x15'));var db=require(_0xfc94('0x16'))['db'];var integrations=require(_0xfc94('0x17'));var jayson=require('jayson/promise');var client=jayson[_0xfc94('0x18')][_0xfc94('0x19')]({'port':0x232a});function checkPasswordPattern(_0x544355,_0x5bac3b,_0x3260cd){if(_0x3260cd){var _0x17bae0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17bae0[_0xfc94('0x1a')](_0x5bac3b)){return _0x544355;}else{throw new db[(_0xfc94('0x1b'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x544355;}}function respondWithRpcPromise(_0x1fde0e,_0x140cce,_0x2b0d04,_0xc628b5){return new BPromise(function(_0x520de5,_0x14fff2){var _0xa3fb11=_0xc628b5||client;return _0xa3fb11[_0xfc94('0x1c')](_0x1fde0e,_0x2b0d04)[_0xfc94('0x1d')](function(_0x4cf809){logger[_0xfc94('0x1e')](_0xfc94('0x1f'),_0x140cce,_0xfc94('0x20'));logger['debug'](_0xfc94('0x21'),_0x140cce,_0xfc94('0x20'),JSON[_0xfc94('0x22')](_0x4cf809));if(_0x4cf809['error']){if(_0x4cf809[_0xfc94('0x23')]['code']===0x1f4){logger[_0xfc94('0x23')]('DeskAccount,\x20%s,\x20%s',_0x140cce,_0x4cf809[_0xfc94('0x23')]['message']);return _0x14fff2(_0x4cf809['error']['message']);}logger[_0xfc94('0x23')](_0xfc94('0x1f'),_0x140cce,_0x4cf809[_0xfc94('0x23')][_0xfc94('0x24')]);return _0x520de5(_0x4cf809['error'][_0xfc94('0x24')]);}else{logger[_0xfc94('0x1e')](_0xfc94('0x1f'),_0x140cce,'request\x20sent');_0x520de5(_0x4cf809['result']['message']);}})[_0xfc94('0x25')](function(_0x4c9f7b){logger[_0xfc94('0x23')](_0xfc94('0x1f'),_0x140cce,_0x4c9f7b);_0x14fff2(_0x4c9f7b);});});}function respondWithStatusCode(_0x192608,_0x224ca7){_0x224ca7=_0x224ca7||0xcc;return function(_0x531ce9){if(_0x531ce9){return _0x192608[_0xfc94('0x26')](_0x224ca7);}return _0x192608[_0xfc94('0x27')](_0x224ca7)[_0xfc94('0x28')]();};}function respondWithResult(_0x3f35fa,_0xaf371c){_0xaf371c=_0xaf371c||0xc8;return function(_0xa24c66){if(_0xa24c66){return _0x3f35fa[_0xfc94('0x27')](_0xaf371c)['json'](_0xa24c66);}};}function respondWithFilteredResult(_0x3b0d06,_0x40fa7b){return function(_0x302204){if(_0x302204){var _0x29a562=_0x302204[_0xfc94('0x29')],_0x159025=_0x40fa7b[_0xfc94('0x2a')],_0x1ddb98=_0x40fa7b[_0xfc94('0x2a')]+_0x40fa7b['limit'],_0x10ad80;if(_0x1ddb98>=_0x29a562){_0x1ddb98=_0x29a562;_0x10ad80=0xc8;}else{_0x10ad80=0xce;}_0x3b0d06[_0xfc94('0x27')](_0x10ad80);return _0x3b0d06[_0xfc94('0x2b')](_0xfc94('0x2c'),_0x159025+'-'+_0x1ddb98+'/'+_0x29a562)['json'](_0x302204);}return null;};}function patchUpdates(_0x124a72){return function(_0x5b039b){try{jsonpatch[_0xfc94('0x2d')](_0x5b039b,_0x124a72,!![]);}catch(_0x5bacae){return BPromise[_0xfc94('0x2e')](_0x5bacae);}return _0x5b039b[_0xfc94('0x2f')]();};}function saveUpdates(_0x3a8221,_0x41da94){return function(_0x4bc92a){if(_0x4bc92a){return _0x4bc92a[_0xfc94('0x30')](_0x3a8221)['then'](function(_0x47a4f4){return _0x47a4f4;});}return null;};}function removeEntity(_0x271539,_0x4716b8){return function(_0x208047){if(_0x208047){return _0x208047['destroy']()[_0xfc94('0x1d')](function(){_0x271539[_0xfc94('0x27')](0xcc)[_0xfc94('0x28')]();});}};}function handleEntityNotFound(_0x5e671c,_0x484744){return function(_0x279d25){if(!_0x279d25){_0x5e671c['sendStatus'](0x194);}return _0x279d25;};}function handleError(_0x30c618,_0x129f73){_0x129f73=_0x129f73||0x1f4;return function(_0x1927a4){logger[_0xfc94('0x23')](_0x1927a4['stack']);if(_0x1927a4[_0xfc94('0x31')]){delete _0x1927a4[_0xfc94('0x31')];}_0x30c618['status'](_0x129f73)[_0xfc94('0x32')](_0x1927a4);};}exports[_0xfc94('0x33')]=function(_0xe9b5fe,_0x2ada27){var _0x474114={},_0x4f1b56={},_0x184564={'count':0x0,'rows':[]};var _0x4c6fcb=_['map'](db[_0xfc94('0x34')][_0xfc94('0x35')],function(_0x4f3ab5){return{'name':_0x4f3ab5[_0xfc94('0x36')],'type':_0x4f3ab5['type'][_0xfc94('0x37')]};});_0x4f1b56[_0xfc94('0x38')]=_['map'](_0x4c6fcb,_0xfc94('0x31'));_0x4f1b56['query']=_[_0xfc94('0x39')](_0xe9b5fe[_0xfc94('0x3a')]);_0x4f1b56[_0xfc94('0x3b')]=_['intersection'](_0x4f1b56['model'],_0x4f1b56[_0xfc94('0x3a')]);_0x474114[_0xfc94('0x3c')]=_[_0xfc94('0x3d')](_0x4f1b56[_0xfc94('0x38')],qs[_0xfc94('0x3e')](_0xe9b5fe[_0xfc94('0x3a')][_0xfc94('0x3e')]));_0x474114['attributes']=_0x474114[_0xfc94('0x3c')]['length']?_0x474114['attributes']:_0x4f1b56[_0xfc94('0x38')];if(!_0xe9b5fe[_0xfc94('0x3a')][_0xfc94('0x3f')]('nolimit')){_0x474114[_0xfc94('0x40')]=qs[_0xfc94('0x40')](_0xe9b5fe['query'][_0xfc94('0x40')]);_0x474114[_0xfc94('0x2a')]=qs[_0xfc94('0x2a')](_0xe9b5fe[_0xfc94('0x3a')][_0xfc94('0x2a')]);}_0x474114['order']=qs[_0xfc94('0x41')](_0xe9b5fe[_0xfc94('0x3a')]['sort']);_0x474114[_0xfc94('0x42')]=qs[_0xfc94('0x3b')](_[_0xfc94('0x43')](_0xe9b5fe[_0xfc94('0x3a')],_0x4f1b56['filters']),_0x4c6fcb);if(_0xe9b5fe['query'][_0xfc94('0x44')]){_0x474114[_0xfc94('0x42')]=_[_0xfc94('0x45')](_0x474114[_0xfc94('0x42')],{'$or':_[_0xfc94('0x46')](_0x4c6fcb,function(_0x1267e7){if(_0x1267e7[_0xfc94('0x47')]!=='VIRTUAL'){var _0x58e797={};_0x58e797[_0x1267e7['name']]={'$like':'%'+_0xe9b5fe['query'][_0xfc94('0x44')]+'%'};return _0x58e797;}})});}_0x474114=_[_0xfc94('0x45')]({},_0x474114,_0xe9b5fe[_0xfc94('0x48')]);var _0x569a7c={'where':_0x474114[_0xfc94('0x42')]};return db[_0xfc94('0x34')][_0xfc94('0x29')](_0x569a7c)[_0xfc94('0x1d')](function(_0x380ef4){_0x184564['count']=_0x380ef4;if(_0xe9b5fe[_0xfc94('0x3a')][_0xfc94('0x49')]){_0x474114[_0xfc94('0x4a')]=[{'all':!![]}];}return db[_0xfc94('0x34')]['findAll'](_0x474114);})[_0xfc94('0x1d')](function(_0x34591a){_0x184564[_0xfc94('0x4b')]=_0x34591a;return _0x184564;})[_0xfc94('0x1d')](respondWithFilteredResult(_0x2ada27,_0x474114))[_0xfc94('0x25')](handleError(_0x2ada27,null));};exports[_0xfc94('0x4c')]=function(_0x45a64a,_0x575161){var _0x4b9648={'raw':![],'where':{'id':_0x45a64a[_0xfc94('0x4d')]['id']}},_0x4d544c={};_0x4d544c['model']=_[_0xfc94('0x39')](db['DeskAccount'][_0xfc94('0x35')]);_0x4d544c[_0xfc94('0x3a')]=_[_0xfc94('0x39')](_0x45a64a['query']);_0x4d544c[_0xfc94('0x3b')]=_[_0xfc94('0x3d')](_0x4d544c[_0xfc94('0x38')],_0x4d544c[_0xfc94('0x3a')]);_0x4b9648[_0xfc94('0x3c')]=_['intersection'](_0x4d544c['model'],qs['fields'](_0x45a64a[_0xfc94('0x3a')][_0xfc94('0x3e')]));_0x4b9648[_0xfc94('0x3c')]=_0x4b9648[_0xfc94('0x3c')][_0xfc94('0x4e')]?_0x4b9648[_0xfc94('0x3c')]:_0x4d544c['model'];if(_0x45a64a[_0xfc94('0x3a')][_0xfc94('0x49')]){_0x4b9648['include']=[{'all':!![]}];}_0x4b9648=_[_0xfc94('0x45')]({},_0x4b9648,_0x45a64a[_0xfc94('0x48')]);return db[_0xfc94('0x34')][_0xfc94('0x4f')](_0x4b9648)[_0xfc94('0x1d')](handleEntityNotFound(_0x575161,null))[_0xfc94('0x1d')](respondWithResult(_0x575161,null))[_0xfc94('0x25')](handleError(_0x575161,null));};exports['create']=function(_0x4ba425,_0x1f225b){return db['DeskAccount']['create'](_0x4ba425[_0xfc94('0x50')],{})[_0xfc94('0x1d')](respondWithResult(_0x1f225b,0xc9))[_0xfc94('0x25')](handleError(_0x1f225b,null));};exports[_0xfc94('0x30')]=function(_0x570694,_0x5e4560){if(_0x570694[_0xfc94('0x50')]['id']){delete _0x570694[_0xfc94('0x50')]['id'];}return db['DeskAccount'][_0xfc94('0x4f')]({'where':{'id':_0x570694[_0xfc94('0x4d')]['id']}})[_0xfc94('0x1d')](handleEntityNotFound(_0x5e4560,null))[_0xfc94('0x1d')](saveUpdates(_0x570694[_0xfc94('0x50')],null))[_0xfc94('0x1d')](respondWithResult(_0x5e4560,null))['catch'](handleError(_0x5e4560,null));};exports['destroy']=function(_0x343f45,_0x54ca95){return db['DeskAccount']['find']({'where':{'id':_0x343f45['params']['id']}})['then'](handleEntityNotFound(_0x54ca95,null))[_0xfc94('0x1d')](removeEntity(_0x54ca95,null))[_0xfc94('0x25')](handleError(_0x54ca95,null));};exports['getConfigurations']=function(_0x240917,_0x1fba3b,_0x4dd27a){var _0x452804={};var _0x5412c6={};var _0x2b27a8;var _0x54f151;return db[_0xfc94('0x34')][_0xfc94('0x51')]({'where':{'id':_0x240917[_0xfc94('0x4d')]['id']}})[_0xfc94('0x1d')](handleEntityNotFound(_0x1fba3b,null))['then'](function(_0x5461df){if(_0x5461df){_0x2b27a8=_0x5461df;_0x5412c6[_0xfc94('0x38')]=_[_0xfc94('0x39')](db[_0xfc94('0x52')]['rawAttributes']);_0x5412c6['query']=_[_0xfc94('0x39')](_0x240917[_0xfc94('0x3a')]);_0x5412c6[_0xfc94('0x3b')]=_[_0xfc94('0x3d')](_0x5412c6[_0xfc94('0x38')],_0x5412c6[_0xfc94('0x3a')]);_0x452804[_0xfc94('0x3c')]=_[_0xfc94('0x3d')](_0x5412c6[_0xfc94('0x38')],qs['fields'](_0x240917[_0xfc94('0x3a')]['fields']));_0x452804[_0xfc94('0x3c')]=_0x452804['attributes'][_0xfc94('0x4e')]?_0x452804['attributes']:_0x5412c6[_0xfc94('0x38')];_0x452804[_0xfc94('0x53')]=qs[_0xfc94('0x41')](_0x240917[_0xfc94('0x3a')][_0xfc94('0x41')]);_0x452804[_0xfc94('0x42')]=qs[_0xfc94('0x3b')](_[_0xfc94('0x43')](_0x240917['query'],_0x5412c6[_0xfc94('0x3b')]));if(_0x240917[_0xfc94('0x3a')][_0xfc94('0x44')]){_0x452804[_0xfc94('0x42')]=_[_0xfc94('0x45')](_0x452804[_0xfc94('0x42')],{'$or':_[_0xfc94('0x46')](_0x452804[_0xfc94('0x3c')],function(_0x5585cf){var _0x2e64d1={};_0x2e64d1[_0x5585cf]={'$like':'%'+_0x240917[_0xfc94('0x3a')][_0xfc94('0x44')]+'%'};return _0x2e64d1;})});}_0x452804=_[_0xfc94('0x45')]({},_0x452804,_0x240917[_0xfc94('0x48')]);return _0x2b27a8['getConfigurations'](_0x452804);}})[_0xfc94('0x1d')](function(_0x7ca4e1){if(_0x7ca4e1){_0x54f151=_0x7ca4e1[_0xfc94('0x4e')];if(!_0x240917[_0xfc94('0x3a')][_0xfc94('0x3f')](_0xfc94('0x54'))){_0x452804[_0xfc94('0x40')]=qs[_0xfc94('0x40')](_0x240917['query']['limit']);_0x452804[_0xfc94('0x2a')]=qs['offset'](_0x240917[_0xfc94('0x3a')][_0xfc94('0x2a')]);}return _0x2b27a8[_0xfc94('0x55')](_0x452804);}})[_0xfc94('0x1d')](function(_0x5b6161){if(_0x5b6161){return _0x5b6161?{'count':_0x54f151,'rows':_0x5b6161}:null;}})[_0xfc94('0x1d')](respondWithResult(_0x1fba3b,null))[_0xfc94('0x25')](handleError(_0x1fba3b,null));};exports[_0xfc94('0x56')]=function(_0x57342c,_0x34adcb,_0x1e0252){if(_0x57342c['body']['id']){delete _0x57342c[_0xfc94('0x50')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x57342c[_0xfc94('0x4d')]['id']}})[_0xfc94('0x1d')](handleEntityNotFound(_0x34adcb,null))[_0xfc94('0x1d')](function(_0x198103){if(_0x198103){_0x57342c['body'][_0xfc94('0x57')]=_0x198103['id'];_0x57342c[_0xfc94('0x50')][_0xfc94('0x58')]=integrations[_0xfc94('0x59')](_0x57342c[_0xfc94('0x50')][_0xfc94('0x5a')],_0x57342c[_0xfc94('0x50')][_0xfc94('0x47')]);_0x57342c['body'][_0xfc94('0x5b')]=integrations[_0xfc94('0x5c')](_0x57342c[_0xfc94('0x50')][_0xfc94('0x5a')],_0x57342c[_0xfc94('0x50')]['type']);return db[_0xfc94('0x52')][_0xfc94('0x5d')](_0x57342c['body'],{'include':[{'model':db['DeskField'],'as':_0xfc94('0x58')},{'model':db[_0xfc94('0x5e')],'as':_0xfc94('0x5b')}]});}return null;})['then'](respondWithResult(_0x34adcb,null))[_0xfc94('0x25')](handleError(_0x34adcb,null));};exports[_0xfc94('0x5f')]=function(_0x1aa9ac,_0x57b212,_0xaba2db){var _0x26c0c5=[{'name':_0xfc94('0x60'),'label':_0xfc94('0x60'),'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 _0x53a35a='';return db['DeskAccount'][_0xfc94('0x51')]({'where':{'id':_0x1aa9ac[_0xfc94('0x4d')]['id']},'attributes':['id',_0xfc94('0x61'),_0xfc94('0x62'),'username',_0xfc94('0x63'),_0xfc94('0x64'),_0xfc94('0x65'),_0xfc94('0x66'),_0xfc94('0x67')]})[_0xfc94('0x1d')](handleEntityNotFound(_0x57b212,null))['then'](function(_0x5b30bb){if(_0x5b30bb){_0x53a35a=_0x5b30bb['remoteUri'];var _0x59f325=_0x53a35a['slice'](-0x1);if(_0x59f325==='/'){_0x53a35a=_0x53a35a[_0xfc94('0x68')](0x0,_0x53a35a['lastIndexOf'](_0x59f325));}var _0x2d3838={'method':_0xfc94('0x69'),'uri':util[_0xfc94('0x6a')](_0xfc94('0x6b'),_0x53a35a),'headers':{'Content-Type':_0xfc94('0x6c'),'Accept':_0xfc94('0x6c')},'json':!![]};if(_0x5b30bb[_0xfc94('0x62')]==='basic'){_0x2d3838['headers'][_0xfc94('0x6d')]=util[_0xfc94('0x6a')](_0xfc94('0x6e'),new Buffer(util['format']('%s:%s',_0x5b30bb[_0xfc94('0x6f')],_0x5b30bb[_0xfc94('0x63')]))[_0xfc94('0x70')]('base64'));}return rp(_0x2d3838)[_0xfc94('0x1d')](function(_0x18ffca){return _0x26c0c5[_0xfc94('0x71')](_[_0xfc94('0x46')](_0x18ffca['_embedded'][_0xfc94('0x72')],function(_0x5a133c){return{'id':_0x5a133c[_0xfc94('0x31')],'name':_0x5a133c[_0xfc94('0x31')],'type':_0x5a133c[_0xfc94('0x47')],'active':_0x5a133c[_0xfc94('0x73')],'label':_0x5a133c[_0xfc94('0x74')],'custom':!![]};}));});}})[_0xfc94('0x1d')](function(_0x28aa6b){return{'count':_0x28aa6b[_0xfc94('0x4e')],'rows':_0x28aa6b};})['then'](respondWithResult(_0x57b212,null))[_0xfc94('0x25')](function(_0x36e8d2){var _0x474648=_0x1aa9ac[_0xfc94('0x3a')][_0xfc94('0x1a')]?0x1f4:_0x36e8d2[_0xfc94('0x75')]||0x1f4;logger[_0xfc94('0x23')](_0xfc94('0x76'),_0xfc94('0x5f'),_0x474648,JSON['stringify'](_0x36e8d2));delete _0x36e8d2[_0xfc94('0x31')];if(_0x474648===0x191){_0x474648=0x190;}_0x57b212[_0xfc94('0x27')](_0x474648)['send'](_0x1aa9ac[_0xfc94('0x3a')][_0xfc94('0x1a')]?{'message':_0xfc94('0x77'),'statusCode':_0x36e8d2[_0xfc94('0x75')]}:_0x36e8d2);});};
\ No newline at end of file
+var _0xf5d6=['eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','DeskAccount,\x20%s,\x20%s','message','catch','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','options','include','rows','show','params','keys','includeAll','merge','find','create','body','getConfigurations','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskConfiguration','DeskField','getFields','priority','remoteUri','username','password','consumerSecret','token','substring','lastIndexOf','format','%s/custom_fields','authType','headers','Authorization','toString','base64','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf'];(function(_0x1c5d08,_0x63120c){var _0xe2681d=function(_0x21166c){while(--_0x21166c){_0x1c5d08['push'](_0x1c5d08['shift']());}};_0xe2681d(++_0x63120c);}(_0xf5d6,0x79));var _0x6f5d=function(_0x4abb0b,_0x23e4ac){_0x4abb0b=_0x4abb0b-0x0;var _0x343fc1=_0xf5d6[_0x4abb0b];return _0x343fc1;};'use strict';var pdf=require(_0x6f5d('0x0'));var emlformat=require(_0x6f5d('0x1'));var rimraf=require(_0x6f5d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f5d('0x3'));var rp=require('request-promise');var moment=require(_0x6f5d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6f5d('0x5'));var sox=require(_0x6f5d('0x6'));var csv=require(_0x6f5d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f5d('0x8'));var squel=require(_0x6f5d('0x9'));var crypto=require(_0x6f5d('0xa'));var jsforce=require(_0x6f5d('0xb'));var deskjs=require(_0x6f5d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6f5d('0xd'));var Papa=require(_0x6f5d('0xe'));var Redis=require('ioredis');var authService=require(_0x6f5d('0xf'));var qs=require(_0x6f5d('0x10'));var as=require(_0x6f5d('0x11'));var hardwareService=require(_0x6f5d('0x12'));var logger=require(_0x6f5d('0x13'))(_0x6f5d('0x14'));var utils=require('../../config/utils');var config=require(_0x6f5d('0x15'));var db=require(_0x6f5d('0x16'))['db'];var integrations=require(_0x6f5d('0x17'));var jayson=require(_0x6f5d('0x18'));var client=jayson[_0x6f5d('0x19')][_0x6f5d('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x107d1e,_0xbca5a3,_0x1cc1c8){if(_0x1cc1c8){var _0x12eb0a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12eb0a[_0x6f5d('0x1b')](_0xbca5a3)){return _0x107d1e;}else{throw new db[(_0x6f5d('0x1c'))]['ValidationError'](_0x6f5d('0x1d'));}}else{return _0x107d1e;}}function respondWithRpcPromise(_0x95ac0,_0x3d958a,_0x495269,_0x5d2b82){return new BPromise(function(_0xcecde0,_0x3dd6c5){var _0x575009=_0x5d2b82||client;return _0x575009['request'](_0x95ac0,_0x495269)['then'](function(_0x5bf4c6){logger[_0x6f5d('0x1e')]('DeskAccount,\x20%s,\x20%s',_0x3d958a,_0x6f5d('0x1f'));logger[_0x6f5d('0x20')](_0x6f5d('0x21'),_0x3d958a,'request\x20sent',JSON[_0x6f5d('0x22')](_0x5bf4c6));if(_0x5bf4c6['error']){if(_0x5bf4c6['error'][_0x6f5d('0x23')]===0x1f4){logger[_0x6f5d('0x24')](_0x6f5d('0x25'),_0x3d958a,_0x5bf4c6[_0x6f5d('0x24')][_0x6f5d('0x26')]);return _0x3dd6c5(_0x5bf4c6[_0x6f5d('0x24')]['message']);}logger['error'](_0x6f5d('0x25'),_0x3d958a,_0x5bf4c6[_0x6f5d('0x24')][_0x6f5d('0x26')]);return _0xcecde0(_0x5bf4c6[_0x6f5d('0x24')][_0x6f5d('0x26')]);}else{logger[_0x6f5d('0x1e')](_0x6f5d('0x25'),_0x3d958a,_0x6f5d('0x1f'));_0xcecde0(_0x5bf4c6['result'][_0x6f5d('0x26')]);}})[_0x6f5d('0x27')](function(_0x5da669){logger[_0x6f5d('0x24')]('DeskAccount,\x20%s,\x20%s',_0x3d958a,_0x5da669);_0x3dd6c5(_0x5da669);});});}function respondWithStatusCode(_0x7b9b2f,_0x5b96c0){_0x5b96c0=_0x5b96c0||0xcc;return function(_0x12f213){if(_0x12f213){return _0x7b9b2f['sendStatus'](_0x5b96c0);}return _0x7b9b2f[_0x6f5d('0x28')](_0x5b96c0)[_0x6f5d('0x29')]();};}function respondWithResult(_0x1c30cc,_0x43e4af){_0x43e4af=_0x43e4af||0xc8;return function(_0x5bd27d){if(_0x5bd27d){return _0x1c30cc[_0x6f5d('0x28')](_0x43e4af)[_0x6f5d('0x2a')](_0x5bd27d);}};}function respondWithFilteredResult(_0x2060ad,_0x332299){return function(_0x2c143a){if(_0x2c143a){var _0x295a25=_0x2c143a[_0x6f5d('0x2b')],_0x4c18b8=_0x332299['offset'],_0x5ae5ca=_0x332299[_0x6f5d('0x2c')]+_0x332299['limit'],_0x33bc0a;if(_0x5ae5ca>=_0x295a25){_0x5ae5ca=_0x295a25;_0x33bc0a=0xc8;}else{_0x33bc0a=0xce;}_0x2060ad[_0x6f5d('0x28')](_0x33bc0a);return _0x2060ad[_0x6f5d('0x2d')]('Content-Range',_0x4c18b8+'-'+_0x5ae5ca+'/'+_0x295a25)['json'](_0x2c143a);}return null;};}function patchUpdates(_0x4926d4){return function(_0x29b1df){try{jsonpatch[_0x6f5d('0x2e')](_0x29b1df,_0x4926d4,!![]);}catch(_0x5b6a6c){return BPromise[_0x6f5d('0x2f')](_0x5b6a6c);}return _0x29b1df[_0x6f5d('0x30')]();};}function saveUpdates(_0x2e8c88,_0x16be7d){return function(_0x157658){if(_0x157658){return _0x157658[_0x6f5d('0x31')](_0x2e8c88)[_0x6f5d('0x32')](function(_0x221911){return _0x221911;});}return null;};}function removeEntity(_0x9f85d1,_0x4393d7){return function(_0x1db184){if(_0x1db184){return _0x1db184[_0x6f5d('0x33')]()[_0x6f5d('0x32')](function(){_0x9f85d1[_0x6f5d('0x28')](0xcc)[_0x6f5d('0x29')]();});}};}function handleEntityNotFound(_0x8d5b60,_0x40a373){return function(_0x1dee6e){if(!_0x1dee6e){_0x8d5b60[_0x6f5d('0x34')](0x194);}return _0x1dee6e;};}function handleError(_0x1ae09d,_0x186f9c){_0x186f9c=_0x186f9c||0x1f4;return function(_0x3f99b9){logger[_0x6f5d('0x24')](_0x3f99b9['stack']);if(_0x3f99b9[_0x6f5d('0x35')]){delete _0x3f99b9[_0x6f5d('0x35')];}_0x1ae09d['status'](_0x186f9c)[_0x6f5d('0x36')](_0x3f99b9);};}exports[_0x6f5d('0x37')]=function(_0x569f8f,_0x2ab4f5){var _0x61c16a={},_0xdf85f7={},_0x2bb720={'count':0x0,'rows':[]};var _0x5c711b=_[_0x6f5d('0x38')](db[_0x6f5d('0x39')][_0x6f5d('0x3a')],function(_0x337131){return{'name':_0x337131[_0x6f5d('0x3b')],'type':_0x337131[_0x6f5d('0x3c')]['key']};});_0xdf85f7[_0x6f5d('0x3d')]=_[_0x6f5d('0x38')](_0x5c711b,_0x6f5d('0x35'));_0xdf85f7[_0x6f5d('0x3e')]=_['keys'](_0x569f8f[_0x6f5d('0x3e')]);_0xdf85f7[_0x6f5d('0x3f')]=_[_0x6f5d('0x40')](_0xdf85f7[_0x6f5d('0x3d')],_0xdf85f7[_0x6f5d('0x3e')]);_0x61c16a['attributes']=_['intersection'](_0xdf85f7[_0x6f5d('0x3d')],qs[_0x6f5d('0x41')](_0x569f8f['query'][_0x6f5d('0x41')]));_0x61c16a[_0x6f5d('0x42')]=_0x61c16a[_0x6f5d('0x42')][_0x6f5d('0x43')]?_0x61c16a[_0x6f5d('0x42')]:_0xdf85f7[_0x6f5d('0x3d')];if(!_0x569f8f[_0x6f5d('0x3e')][_0x6f5d('0x44')](_0x6f5d('0x45'))){_0x61c16a[_0x6f5d('0x46')]=qs[_0x6f5d('0x46')](_0x569f8f[_0x6f5d('0x3e')][_0x6f5d('0x46')]);_0x61c16a[_0x6f5d('0x2c')]=qs[_0x6f5d('0x2c')](_0x569f8f[_0x6f5d('0x3e')][_0x6f5d('0x2c')]);}_0x61c16a['order']=qs[_0x6f5d('0x47')](_0x569f8f['query']['sort']);_0x61c16a[_0x6f5d('0x48')]=qs[_0x6f5d('0x3f')](_[_0x6f5d('0x49')](_0x569f8f[_0x6f5d('0x3e')],_0xdf85f7[_0x6f5d('0x3f')]),_0x5c711b);if(_0x569f8f[_0x6f5d('0x3e')][_0x6f5d('0x4a')]){_0x61c16a[_0x6f5d('0x48')]=_['merge'](_0x61c16a[_0x6f5d('0x48')],{'$or':_[_0x6f5d('0x38')](_0x5c711b,function(_0x421fc8){if(_0x421fc8[_0x6f5d('0x3c')]!==_0x6f5d('0x4b')){var _0x51de12={};_0x51de12[_0x421fc8[_0x6f5d('0x35')]]={'$like':'%'+_0x569f8f['query'][_0x6f5d('0x4a')]+'%'};return _0x51de12;}})});}_0x61c16a=_['merge']({},_0x61c16a,_0x569f8f[_0x6f5d('0x4c')]);var _0x78f008={'where':_0x61c16a[_0x6f5d('0x48')]};return db[_0x6f5d('0x39')][_0x6f5d('0x2b')](_0x78f008)['then'](function(_0x4d4edf){_0x2bb720[_0x6f5d('0x2b')]=_0x4d4edf;if(_0x569f8f[_0x6f5d('0x3e')]['includeAll']){_0x61c16a[_0x6f5d('0x4d')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x61c16a);})[_0x6f5d('0x32')](function(_0x15538b){_0x2bb720[_0x6f5d('0x4e')]=_0x15538b;return _0x2bb720;})[_0x6f5d('0x32')](respondWithFilteredResult(_0x2ab4f5,_0x61c16a))['catch'](handleError(_0x2ab4f5,null));};exports[_0x6f5d('0x4f')]=function(_0x2be51b,_0x5eca1c){var _0x236a71={'raw':![],'where':{'id':_0x2be51b[_0x6f5d('0x50')]['id']}},_0x462248={};_0x462248[_0x6f5d('0x3d')]=_['keys'](db['DeskAccount'][_0x6f5d('0x3a')]);_0x462248[_0x6f5d('0x3e')]=_[_0x6f5d('0x51')](_0x2be51b['query']);_0x462248[_0x6f5d('0x3f')]=_[_0x6f5d('0x40')](_0x462248[_0x6f5d('0x3d')],_0x462248['query']);_0x236a71[_0x6f5d('0x42')]=_[_0x6f5d('0x40')](_0x462248['model'],qs['fields'](_0x2be51b[_0x6f5d('0x3e')][_0x6f5d('0x41')]));_0x236a71['attributes']=_0x236a71['attributes']['length']?_0x236a71[_0x6f5d('0x42')]:_0x462248['model'];if(_0x2be51b[_0x6f5d('0x3e')][_0x6f5d('0x52')]){_0x236a71[_0x6f5d('0x4d')]=[{'all':!![]}];}_0x236a71=_[_0x6f5d('0x53')]({},_0x236a71,_0x2be51b['options']);return db[_0x6f5d('0x39')][_0x6f5d('0x54')](_0x236a71)[_0x6f5d('0x32')](handleEntityNotFound(_0x5eca1c,null))['then'](respondWithResult(_0x5eca1c,null))['catch'](handleError(_0x5eca1c,null));};exports['create']=function(_0x2cd822,_0x5863b4){return db[_0x6f5d('0x39')][_0x6f5d('0x55')](_0x2cd822[_0x6f5d('0x56')],{})[_0x6f5d('0x32')](respondWithResult(_0x5863b4,0xc9))[_0x6f5d('0x27')](handleError(_0x5863b4,null));};exports[_0x6f5d('0x31')]=function(_0x537397,_0x595c47){if(_0x537397['body']['id']){delete _0x537397[_0x6f5d('0x56')]['id'];}return db[_0x6f5d('0x39')][_0x6f5d('0x54')]({'where':{'id':_0x537397['params']['id']}})[_0x6f5d('0x32')](handleEntityNotFound(_0x595c47,null))[_0x6f5d('0x32')](saveUpdates(_0x537397['body'],null))[_0x6f5d('0x32')](respondWithResult(_0x595c47,null))[_0x6f5d('0x27')](handleError(_0x595c47,null));};exports['destroy']=function(_0x56ce2e,_0x299a62){return db['DeskAccount'][_0x6f5d('0x54')]({'where':{'id':_0x56ce2e[_0x6f5d('0x50')]['id']}})[_0x6f5d('0x32')](handleEntityNotFound(_0x299a62,null))[_0x6f5d('0x32')](removeEntity(_0x299a62,null))[_0x6f5d('0x27')](handleError(_0x299a62,null));};exports[_0x6f5d('0x57')]=function(_0xcad2ab,_0x263a62,_0x54bd45){var _0x473460={};var _0x49de64={};var _0x422c9a;var _0x2566e0;return db[_0x6f5d('0x39')]['findOne']({'where':{'id':_0xcad2ab['params']['id']}})[_0x6f5d('0x32')](handleEntityNotFound(_0x263a62,null))[_0x6f5d('0x32')](function(_0x1cfe1c){if(_0x1cfe1c){_0x422c9a=_0x1cfe1c;_0x49de64[_0x6f5d('0x3d')]=_[_0x6f5d('0x51')](db['DeskConfiguration'][_0x6f5d('0x3a')]);_0x49de64['query']=_[_0x6f5d('0x51')](_0xcad2ab[_0x6f5d('0x3e')]);_0x49de64[_0x6f5d('0x3f')]=_[_0x6f5d('0x40')](_0x49de64[_0x6f5d('0x3d')],_0x49de64[_0x6f5d('0x3e')]);_0x473460[_0x6f5d('0x42')]=_['intersection'](_0x49de64[_0x6f5d('0x3d')],qs[_0x6f5d('0x41')](_0xcad2ab[_0x6f5d('0x3e')][_0x6f5d('0x41')]));_0x473460[_0x6f5d('0x42')]=_0x473460['attributes'][_0x6f5d('0x43')]?_0x473460['attributes']:_0x49de64['model'];_0x473460[_0x6f5d('0x58')]=qs['sort'](_0xcad2ab[_0x6f5d('0x3e')]['sort']);_0x473460[_0x6f5d('0x48')]=qs[_0x6f5d('0x3f')](_['pick'](_0xcad2ab['query'],_0x49de64[_0x6f5d('0x3f')]));if(_0xcad2ab['query']['filter']){_0x473460[_0x6f5d('0x48')]=_[_0x6f5d('0x53')](_0x473460[_0x6f5d('0x48')],{'$or':_[_0x6f5d('0x38')](_0x473460['attributes'],function(_0x232afa){var _0x435031={};_0x435031[_0x232afa]={'$like':'%'+_0xcad2ab[_0x6f5d('0x3e')][_0x6f5d('0x4a')]+'%'};return _0x435031;})});}_0x473460=_[_0x6f5d('0x53')]({},_0x473460,_0xcad2ab[_0x6f5d('0x4c')]);return _0x422c9a[_0x6f5d('0x57')](_0x473460);}})[_0x6f5d('0x32')](function(_0x5687f5){if(_0x5687f5){_0x2566e0=_0x5687f5[_0x6f5d('0x43')];if(!_0xcad2ab[_0x6f5d('0x3e')][_0x6f5d('0x44')](_0x6f5d('0x45'))){_0x473460[_0x6f5d('0x46')]=qs['limit'](_0xcad2ab[_0x6f5d('0x3e')]['limit']);_0x473460[_0x6f5d('0x2c')]=qs[_0x6f5d('0x2c')](_0xcad2ab[_0x6f5d('0x3e')][_0x6f5d('0x2c')]);}return _0x422c9a['getConfigurations'](_0x473460);}})[_0x6f5d('0x32')](function(_0x170885){if(_0x170885){return _0x170885?{'count':_0x2566e0,'rows':_0x170885}:null;}})['then'](respondWithResult(_0x263a62,null))[_0x6f5d('0x27')](handleError(_0x263a62,null));};exports[_0x6f5d('0x59')]=function(_0x17b2e1,_0x39e72a,_0x249eea){if(_0x17b2e1['body']['id']){delete _0x17b2e1[_0x6f5d('0x56')]['id'];}return db[_0x6f5d('0x39')][_0x6f5d('0x5a')]({'where':{'id':_0x17b2e1[_0x6f5d('0x50')]['id']}})[_0x6f5d('0x32')](handleEntityNotFound(_0x39e72a,null))[_0x6f5d('0x32')](function(_0x356ce7){if(_0x356ce7){_0x17b2e1[_0x6f5d('0x56')][_0x6f5d('0x5b')]=_0x356ce7['id'];_0x17b2e1[_0x6f5d('0x56')][_0x6f5d('0x5c')]=integrations[_0x6f5d('0x5d')](_0x17b2e1['body']['channel'],_0x17b2e1[_0x6f5d('0x56')]['type']);_0x17b2e1[_0x6f5d('0x56')][_0x6f5d('0x5e')]=integrations[_0x6f5d('0x5f')](_0x17b2e1[_0x6f5d('0x56')][_0x6f5d('0x60')],_0x17b2e1[_0x6f5d('0x56')][_0x6f5d('0x3c')]);return db[_0x6f5d('0x61')][_0x6f5d('0x55')](_0x17b2e1[_0x6f5d('0x56')],{'include':[{'model':db[_0x6f5d('0x62')],'as':_0x6f5d('0x5c')},{'model':db[_0x6f5d('0x62')],'as':'Descriptions'}]});}return null;})[_0x6f5d('0x32')](respondWithResult(_0x39e72a,null))[_0x6f5d('0x27')](handleError(_0x39e72a,null));};exports[_0x6f5d('0x63')]=function(_0x7dd6be,_0x5815d0,_0x160551){var _0x272ac7=[{'name':_0x6f5d('0x64'),'label':_0x6f5d('0x64'),'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 _0x4c82c5='';return db[_0x6f5d('0x39')][_0x6f5d('0x5a')]({'where':{'id':_0x7dd6be[_0x6f5d('0x50')]['id']},'attributes':['id',_0x6f5d('0x65'),'authType',_0x6f5d('0x66'),_0x6f5d('0x67'),'consumerKey',_0x6f5d('0x68'),_0x6f5d('0x69'),'tokenSecret']})[_0x6f5d('0x32')](handleEntityNotFound(_0x5815d0,null))[_0x6f5d('0x32')](function(_0x4d7f46){if(_0x4d7f46){_0x4c82c5=_0x4d7f46[_0x6f5d('0x65')];var _0x3b96df=_0x4c82c5['slice'](-0x1);if(_0x3b96df==='/'){_0x4c82c5=_0x4c82c5[_0x6f5d('0x6a')](0x0,_0x4c82c5[_0x6f5d('0x6b')](_0x3b96df));}var _0x5b2d1f={'method':'GET','uri':util[_0x6f5d('0x6c')](_0x6f5d('0x6d'),_0x4c82c5),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x4d7f46[_0x6f5d('0x6e')]==='basic'){_0x5b2d1f[_0x6f5d('0x6f')][_0x6f5d('0x70')]=util[_0x6f5d('0x6c')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x4d7f46[_0x6f5d('0x66')],_0x4d7f46[_0x6f5d('0x67')]))[_0x6f5d('0x71')](_0x6f5d('0x72')));}return rp(_0x5b2d1f)['then'](function(_0x46bbf5){return _0x272ac7['concat'](_[_0x6f5d('0x38')](_0x46bbf5[_0x6f5d('0x73')][_0x6f5d('0x74')],function(_0xe0a2d0){return{'id':_0xe0a2d0[_0x6f5d('0x35')],'name':_0xe0a2d0[_0x6f5d('0x35')],'type':_0xe0a2d0[_0x6f5d('0x3c')],'active':_0xe0a2d0[_0x6f5d('0x75')],'label':_0xe0a2d0[_0x6f5d('0x76')],'custom':!![]};}));});}})['then'](function(_0x7e56d7){return{'count':_0x7e56d7[_0x6f5d('0x43')],'rows':_0x7e56d7};})[_0x6f5d('0x32')](respondWithResult(_0x5815d0,null))[_0x6f5d('0x27')](function(_0x121ba7){var _0x5cf129=_0x7dd6be[_0x6f5d('0x3e')]['test']?0x1f4:_0x121ba7[_0x6f5d('0x77')]||0x1f4;logger[_0x6f5d('0x24')](_0x6f5d('0x78'),_0x6f5d('0x63'),_0x5cf129,JSON['stringify'](_0x121ba7));delete _0x121ba7[_0x6f5d('0x35')];if(_0x5cf129===0x191){_0x5cf129=0x190;}_0x5815d0[_0x6f5d('0x28')](_0x5cf129)['send'](_0x7dd6be[_0x6f5d('0x3e')][_0x6f5d('0x1b')]?{'message':_0x6f5d('0x79'),'statusCode':_0x121ba7[_0x6f5d('0x77')]}:_0x121ba7);});};
\ No newline at end of file
index 5019729..65e9b94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd218=['path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','bluebird','request-promise'];(function(_0x38e653,_0x5be30f){var _0x1bddc8=function(_0x312d6e){while(--_0x312d6e){_0x38e653['push'](_0x38e653['shift']());}};_0x1bddc8(++_0x5be30f);}(_0xd218,0xcb));var _0x8d21=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd218[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x8d21('0x0'));var util=require(_0x8d21('0x1'));var logger=require('../../config/logger')(_0x8d21('0x2'));var moment=require('moment');var BPromise=require(_0x8d21('0x3'));var rp=require(_0x8d21('0x4'));var fs=require('fs');var path=require(_0x8d21('0x5'));var rimraf=require(_0x8d21('0x6'));var config=require(_0x8d21('0x7'));var attributes=require(_0x8d21('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8d21('0x9')]=function(_0x46c78c,_0x429e4f){return _0x46c78c[_0x8d21('0xa')](_0x8d21('0xb'),attributes,{'tableName':_0x8d21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x738d=['api','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','DeskAccount','lodash','../../config/logger'];(function(_0x20a88e,_0x389e6d){var _0x579f34=function(_0x197cc4){while(--_0x197cc4){_0x20a88e['push'](_0x20a88e['shift']());}};_0x579f34(++_0x389e6d);}(_0x738d,0x9e));var _0xd738=function(_0x52c0ad,_0x566464){_0x52c0ad=_0x52c0ad-0x0;var _0x1d6a79=_0x738d[_0x52c0ad];return _0x1d6a79;};'use strict';var _=require(_0xd738('0x0'));var util=require('util');var logger=require(_0xd738('0x1'))(_0xd738('0x2'));var moment=require('moment');var BPromise=require(_0xd738('0x3'));var rp=require(_0xd738('0x4'));var fs=require('fs');var path=require(_0xd738('0x5'));var rimraf=require(_0xd738('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xd738('0x7'));module[_0xd738('0x8')]=function(_0x441ed7,_0x335b9d){return _0x441ed7['define'](_0xd738('0x9'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index adfa7d3..ef7bac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd517=['findAll','options','raw','where','attributes','limit','include','model','map','GetDeskAccount','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','DeskAccount'];(function(_0x3241e1,_0x1e26aa){var _0x1ed908=function(_0x1e5698){while(--_0x1e5698){_0x3241e1['push'](_0x3241e1['shift']());}};_0x1ed908(++_0x1e26aa);}(_0xd517,0xa3));var _0x7d51=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0xd517[_0x284506];return _0x1e9ee5;};'use strict';var _=require(_0x7d51('0x0'));var util=require(_0x7d51('0x1'));var moment=require(_0x7d51('0x2'));var BPromise=require(_0x7d51('0x3'));var rs=require(_0x7d51('0x4'));var fs=require('fs');var Redis=require(_0x7d51('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d51('0x6'));var logger=require(_0x7d51('0x7'))(_0x7d51('0x8'));var config=require(_0x7d51('0x9'));var jayson=require(_0x7d51('0xa'));var client=jayson[_0x7d51('0xb')][_0x7d51('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x372eee,_0x23cb28,_0x4f6202){return new BPromise(function(_0x3b7286,_0x4e8064){return client[_0x7d51('0xd')](_0x372eee,_0x4f6202)[_0x7d51('0xe')](function(_0x3cc5d1){logger['info'](_0x7d51('0xf'),_0x23cb28,_0x7d51('0x10'));logger[_0x7d51('0x11')](_0x7d51('0x12'),_0x23cb28,_0x7d51('0x10'),JSON[_0x7d51('0x13')](_0x3cc5d1));if(_0x3cc5d1[_0x7d51('0x14')]){if(_0x3cc5d1[_0x7d51('0x14')][_0x7d51('0x15')]===0x1f4){logger[_0x7d51('0x14')](_0x7d51('0xf'),_0x23cb28,_0x3cc5d1[_0x7d51('0x14')][_0x7d51('0x16')]);return _0x4e8064(_0x3cc5d1[_0x7d51('0x14')][_0x7d51('0x16')]);}logger[_0x7d51('0x14')]('DeskAccount,\x20%s,\x20%s',_0x23cb28,_0x3cc5d1[_0x7d51('0x14')]['message']);return _0x3b7286(_0x3cc5d1[_0x7d51('0x14')][_0x7d51('0x16')]);}else{logger[_0x7d51('0x17')](_0x7d51('0xf'),_0x23cb28,'request\x20sent');_0x3b7286(_0x3cc5d1[_0x7d51('0x18')][_0x7d51('0x16')]);}})[_0x7d51('0x19')](function(_0x198497){logger[_0x7d51('0x14')]('DeskAccount,\x20%s,\x20%s',_0x23cb28,_0x198497);_0x4e8064(_0x198497);});});}exports['GetDeskAccount']=function(_0x910bd5){var _0xc9189d=this;return new Promise(function(_0x8c4834,_0x4ecbd6){return db[_0x7d51('0x1a')][_0x7d51('0x1b')]({'raw':_0x910bd5[_0x7d51('0x1c')]?_0x910bd5[_0x7d51('0x1c')][_0x7d51('0x1d')]===undefined?!![]:![]:!![],'where':_0x910bd5[_0x7d51('0x1c')]?_0x910bd5[_0x7d51('0x1c')][_0x7d51('0x1e')]||null:null,'attributes':_0x910bd5[_0x7d51('0x1c')]?_0x910bd5[_0x7d51('0x1c')][_0x7d51('0x1f')]||null:null,'limit':_0x910bd5['options']?_0x910bd5['options'][_0x7d51('0x20')]||null:null,'include':_0x910bd5[_0x7d51('0x1c')]?_0x910bd5[_0x7d51('0x1c')][_0x7d51('0x21')]?_['map'](_0x910bd5[_0x7d51('0x1c')]['include'],function(_0x2550c3){return{'model':db[_0x2550c3[_0x7d51('0x22')]],'as':_0x2550c3['as'],'attributes':_0x2550c3[_0x7d51('0x1f')],'include':_0x2550c3[_0x7d51('0x21')]?_['map'](_0x2550c3[_0x7d51('0x21')],function(_0x2d6d22){return{'model':db[_0x2d6d22['model']],'as':_0x2d6d22['as'],'attributes':_0x2d6d22['attributes'],'include':_0x2d6d22[_0x7d51('0x21')]?_[_0x7d51('0x23')](_0x2d6d22[_0x7d51('0x21')],function(_0x16c9e1){return{'model':db[_0x16c9e1['model']],'as':_0x16c9e1['as'],'attributes':_0x16c9e1[_0x7d51('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7d51('0xe')](function(_0x59827f){logger['info'](_0x7d51('0x24'),_0x910bd5);logger[_0x7d51('0x11')](_0x7d51('0x24'),_0x910bd5,JSON[_0x7d51('0x13')](_0x59827f));_0x8c4834(_0x59827f);})[_0x7d51('0x19')](function(_0x1c1b3d){logger['error']('GetDeskAccount',_0x1c1b3d['message'],_0x910bd5);_0x4ecbd6(_0xc9189d[_0x7d51('0x14')](0x1f4,_0x1c1b3d[_0x7d51('0x16')]));});});};exports['ShowDeskAccount']=function(_0x4e9ce7){var _0x3e667e=this;return new Promise(function(_0x509c96,_0x478bd9){return db[_0x7d51('0x1a')]['find']({'raw':_0x4e9ce7[_0x7d51('0x1c')]?_0x4e9ce7[_0x7d51('0x1c')][_0x7d51('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e9ce7[_0x7d51('0x1c')]?_0x4e9ce7['options'][_0x7d51('0x1e')]||null:null,'attributes':_0x4e9ce7[_0x7d51('0x1c')]?_0x4e9ce7[_0x7d51('0x1c')][_0x7d51('0x1f')]||null:null,'include':_0x4e9ce7[_0x7d51('0x1c')]?_0x4e9ce7[_0x7d51('0x1c')]['include']?_[_0x7d51('0x23')](_0x4e9ce7[_0x7d51('0x1c')]['include'],function(_0x496b8d){return{'model':db[_0x496b8d[_0x7d51('0x22')]],'as':_0x496b8d['as'],'attributes':_0x496b8d[_0x7d51('0x1f')],'include':_0x496b8d[_0x7d51('0x21')]?_[_0x7d51('0x23')](_0x496b8d[_0x7d51('0x21')],function(_0x2ac773){return{'model':db[_0x2ac773[_0x7d51('0x22')]],'as':_0x2ac773['as'],'attributes':_0x2ac773[_0x7d51('0x1f')],'include':_0x2ac773[_0x7d51('0x21')]?_[_0x7d51('0x23')](_0x2ac773[_0x7d51('0x21')],function(_0x10a64b){return{'model':db[_0x10a64b[_0x7d51('0x22')]],'as':_0x10a64b['as'],'attributes':_0x10a64b[_0x7d51('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7d51('0xe')](function(_0x1af4ca){logger[_0x7d51('0x17')](_0x7d51('0x25'),_0x4e9ce7);logger[_0x7d51('0x11')](_0x7d51('0x25'),_0x4e9ce7,JSON['stringify'](_0x1af4ca));_0x509c96(_0x1af4ca);})[_0x7d51('0x19')](function(_0x51b28e){logger['error']('ShowDeskAccount',_0x51b28e[_0x7d51('0x16')],_0x4e9ce7);_0x478bd9(_0x3e667e[_0x7d51('0x14')](0x1f4,_0x51b28e[_0x7d51('0x16')]));});});};
\ No newline at end of file
+var _0x9bd9=['find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','map','model','include','then','ShowDeskAccount'];(function(_0xf7058b,_0x22c9b7){var _0x24cbf0=function(_0x2997ac){while(--_0x2997ac){_0xf7058b['push'](_0xf7058b['shift']());}};_0x24cbf0(++_0x22c9b7);}(_0x9bd9,0x92));var _0x99bd=function(_0x407a3e,_0x15acb0){_0x407a3e=_0x407a3e-0x0;var _0x129fe3=_0x9bd9[_0x407a3e];return _0x129fe3;};'use strict';var _=require('lodash');var util=require(_0x99bd('0x0'));var moment=require(_0x99bd('0x1'));var BPromise=require('bluebird');var rs=require(_0x99bd('0x2'));var fs=require('fs');var Redis=require(_0x99bd('0x3'));var db=require(_0x99bd('0x4'))['db'];var utils=require(_0x99bd('0x5'));var logger=require('../../config/logger')(_0x99bd('0x6'));var config=require(_0x99bd('0x7'));var jayson=require(_0x99bd('0x8'));var client=jayson[_0x99bd('0x9')][_0x99bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x166af9,_0x41bdff,_0x4add39){return new BPromise(function(_0x519656,_0x1075b){return client[_0x99bd('0xb')](_0x166af9,_0x4add39)['then'](function(_0x1dc954){logger['info'](_0x99bd('0xc'),_0x41bdff,_0x99bd('0xd'));logger[_0x99bd('0xe')](_0x99bd('0xf'),_0x41bdff,_0x99bd('0xd'),JSON[_0x99bd('0x10')](_0x1dc954));if(_0x1dc954['error']){if(_0x1dc954[_0x99bd('0x11')]['code']===0x1f4){logger['error'](_0x99bd('0xc'),_0x41bdff,_0x1dc954[_0x99bd('0x11')][_0x99bd('0x12')]);return _0x1075b(_0x1dc954['error'][_0x99bd('0x12')]);}logger[_0x99bd('0x11')]('DeskAccount,\x20%s,\x20%s',_0x41bdff,_0x1dc954['error'][_0x99bd('0x12')]);return _0x519656(_0x1dc954[_0x99bd('0x11')]['message']);}else{logger[_0x99bd('0x13')](_0x99bd('0xc'),_0x41bdff,_0x99bd('0xd'));_0x519656(_0x1dc954[_0x99bd('0x14')][_0x99bd('0x12')]);}})[_0x99bd('0x15')](function(_0x3ecaf8){logger[_0x99bd('0x11')]('DeskAccount,\x20%s,\x20%s',_0x41bdff,_0x3ecaf8);_0x1075b(_0x3ecaf8);});});}exports[_0x99bd('0x16')]=function(_0x28c36a){var _0x380080=this;return new Promise(function(_0x10ddc4,_0x5912c2){return db[_0x99bd('0x17')][_0x99bd('0x18')]({'raw':_0x28c36a[_0x99bd('0x19')]?_0x28c36a[_0x99bd('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x28c36a[_0x99bd('0x19')]?_0x28c36a[_0x99bd('0x19')][_0x99bd('0x1a')]||null:null,'attributes':_0x28c36a[_0x99bd('0x19')]?_0x28c36a[_0x99bd('0x19')][_0x99bd('0x1b')]||null:null,'limit':_0x28c36a['options']?_0x28c36a[_0x99bd('0x19')][_0x99bd('0x1c')]||null:null,'include':_0x28c36a['options']?_0x28c36a[_0x99bd('0x19')]['include']?_[_0x99bd('0x1d')](_0x28c36a[_0x99bd('0x19')]['include'],function(_0x597779){return{'model':db[_0x597779[_0x99bd('0x1e')]],'as':_0x597779['as'],'attributes':_0x597779[_0x99bd('0x1b')],'include':_0x597779[_0x99bd('0x1f')]?_[_0x99bd('0x1d')](_0x597779['include'],function(_0x18a7c2){return{'model':db[_0x18a7c2[_0x99bd('0x1e')]],'as':_0x18a7c2['as'],'attributes':_0x18a7c2[_0x99bd('0x1b')],'include':_0x18a7c2[_0x99bd('0x1f')]?_[_0x99bd('0x1d')](_0x18a7c2[_0x99bd('0x1f')],function(_0x580ec5){return{'model':db[_0x580ec5['model']],'as':_0x580ec5['as'],'attributes':_0x580ec5[_0x99bd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x99bd('0x20')](function(_0x1f5538){logger[_0x99bd('0x13')](_0x99bd('0x16'),_0x28c36a);logger[_0x99bd('0xe')](_0x99bd('0x16'),_0x28c36a,JSON['stringify'](_0x1f5538));_0x10ddc4(_0x1f5538);})[_0x99bd('0x15')](function(_0xb2e95c){logger[_0x99bd('0x11')](_0x99bd('0x16'),_0xb2e95c['message'],_0x28c36a);_0x5912c2(_0x380080[_0x99bd('0x11')](0x1f4,_0xb2e95c['message']));});});};exports[_0x99bd('0x21')]=function(_0x1c5da7){var _0x455049=this;return new Promise(function(_0x149666,_0x1c0a7c){return db[_0x99bd('0x17')][_0x99bd('0x22')]({'raw':_0x1c5da7[_0x99bd('0x19')]?_0x1c5da7[_0x99bd('0x19')][_0x99bd('0x23')]===undefined?!![]:![]:!![],'where':_0x1c5da7[_0x99bd('0x19')]?_0x1c5da7[_0x99bd('0x19')][_0x99bd('0x1a')]||null:null,'attributes':_0x1c5da7[_0x99bd('0x19')]?_0x1c5da7[_0x99bd('0x19')]['attributes']||null:null,'include':_0x1c5da7[_0x99bd('0x19')]?_0x1c5da7[_0x99bd('0x19')]['include']?_[_0x99bd('0x1d')](_0x1c5da7[_0x99bd('0x19')]['include'],function(_0x8532b2){return{'model':db[_0x8532b2[_0x99bd('0x1e')]],'as':_0x8532b2['as'],'attributes':_0x8532b2[_0x99bd('0x1b')],'include':_0x8532b2['include']?_[_0x99bd('0x1d')](_0x8532b2[_0x99bd('0x1f')],function(_0x592d1b){return{'model':db[_0x592d1b['model']],'as':_0x592d1b['as'],'attributes':_0x592d1b[_0x99bd('0x1b')],'include':_0x592d1b[_0x99bd('0x1f')]?_[_0x99bd('0x1d')](_0x592d1b[_0x99bd('0x1f')],function(_0x466475){return{'model':db[_0x466475[_0x99bd('0x1e')]],'as':_0x466475['as'],'attributes':_0x466475['attributes']};}):[]};}):[]};}):[]:[]})[_0x99bd('0x20')](function(_0x199dea){logger[_0x99bd('0x13')](_0x99bd('0x21'),_0x1c5da7);logger[_0x99bd('0xe')](_0x99bd('0x21'),_0x1c5da7,JSON[_0x99bd('0x10')](_0x199dea));_0x149666(_0x199dea);})[_0x99bd('0x15')](function(_0x5468cc){logger[_0x99bd('0x11')]('ShowDeskAccount',_0x5468cc[_0x99bd('0x12')],_0x1c5da7);_0x1c0a7c(_0x455049[_0x99bd('0x11')](0x1f4,_0x5468cc[_0x99bd('0x12')]));});});};
\ No newline at end of file
index 95ca944..c68b328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c23=['/:id/tags','setTags','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x579d60,_0x26c7d1){var _0x2dfab2=function(_0xa20cd7){while(--_0xa20cd7){_0x579d60['push'](_0x579d60['shift']());}};_0x2dfab2(++_0x26c7d1);}(_0x0c23,0x13e));var _0x30c2=function(_0x5b3aee,_0x18f70b){_0x5b3aee=_0x5b3aee-0x0;var _0x331a25=_0x0c23[_0x5b3aee];return _0x331a25;};'use strict';var multer=require(_0x30c2('0x0'));var util=require(_0x30c2('0x1'));var path=require(_0x30c2('0x2'));var timeout=require(_0x30c2('0x3'));var express=require(_0x30c2('0x4'));var router=express[_0x30c2('0x5')]();var auth=require(_0x30c2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x30c2('0x7'));var controller=require(_0x30c2('0x8'));router[_0x30c2('0x9')]('/',auth[_0x30c2('0xa')](),controller[_0x30c2('0xb')]);router[_0x30c2('0x9')]('/:id',auth[_0x30c2('0xa')](),controller[_0x30c2('0xc')]);router[_0x30c2('0x9')](_0x30c2('0xd'),auth[_0x30c2('0xa')](),controller['getFields']);router[_0x30c2('0x9')](_0x30c2('0xe'),auth['isAuthenticated'](),controller[_0x30c2('0xf')]);router[_0x30c2('0x9')](_0x30c2('0x10'),auth[_0x30c2('0xa')](),controller[_0x30c2('0x11')]);router[_0x30c2('0x9')]('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0x30c2('0x12')]('/',auth[_0x30c2('0xa')](),controller[_0x30c2('0x13')]);router[_0x30c2('0x12')](_0x30c2('0x14'),auth[_0x30c2('0xa')](),controller[_0x30c2('0x15')]);router['put'](_0x30c2('0x16'),auth[_0x30c2('0xa')](),controller['update']);router[_0x30c2('0x17')](_0x30c2('0x16'),auth[_0x30c2('0xa')](),controller[_0x30c2('0x18')]);module[_0x30c2('0x19')]=router;
\ No newline at end of file
+var _0x5d4e=['getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','show','get','/:id/fields'];(function(_0x404d3e,_0x1027db){var _0x3a3acd=function(_0x3d07b3){while(--_0x3d07b3){_0x404d3e['push'](_0x404d3e['shift']());}};_0x3a3acd(++_0x1027db);}(_0x5d4e,0x138));var _0xe5d4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5d4e[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0xe5d4('0x0'));var path=require(_0xe5d4('0x1'));var timeout=require(_0xe5d4('0x2'));var express=require(_0xe5d4('0x3'));var router=express[_0xe5d4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe5d4('0x5'));var config=require(_0xe5d4('0x6'));var controller=require(_0xe5d4('0x7'));router['get']('/',auth[_0xe5d4('0x8')](),controller['index']);router['get']('/:id',auth[_0xe5d4('0x8')](),controller[_0xe5d4('0x9')]);router[_0xe5d4('0xa')](_0xe5d4('0xb'),auth[_0xe5d4('0x8')](),controller[_0xe5d4('0xc')]);router[_0xe5d4('0xa')](_0xe5d4('0xd'),auth[_0xe5d4('0x8')](),controller[_0xe5d4('0xe')]);router[_0xe5d4('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe5d4('0xf')]);router[_0xe5d4('0xa')](_0xe5d4('0x10'),auth[_0xe5d4('0x8')](),controller[_0xe5d4('0x11')]);router[_0xe5d4('0x12')]('/',auth[_0xe5d4('0x8')](),controller[_0xe5d4('0x13')]);router[_0xe5d4('0x12')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe5d4('0x14')]);router[_0xe5d4('0x15')]('/:id',auth[_0xe5d4('0x8')](),controller[_0xe5d4('0x16')]);router[_0xe5d4('0x17')](_0xe5d4('0x18'),auth[_0xe5d4('0x8')](),controller[_0xe5d4('0x19')]);module[_0xe5d4('0x1a')]=router;
\ No newline at end of file
index fc093c4..609dd54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c85=['sequelize','exports','STRING'];(function(_0x3da37c,_0x3b2466){var _0x2c2972=function(_0x41f863){while(--_0x41f863){_0x3da37c['push'](_0x3da37c['shift']());}};_0x2c2972(++_0x3b2466);}(_0x6c85,0x8a));var _0x56c8=function(_0x44fca2,_0x86201){_0x44fca2=_0x44fca2-0x0;var _0x5ce526=_0x6c85[_0x44fca2];return _0x5ce526;};'use strict';var Sequelize=require(_0x56c8('0x0'));module[_0x56c8('0x1')]={'name':{'type':Sequelize[_0x56c8('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x657f=['exports','STRING'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x657f,0x94));var _0xf657=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0x657f[_0x54da5b];return _0x285d3b;};'use strict';var Sequelize=require('sequelize');module[_0xf657('0x0')]={'name':{'type':Sequelize[_0xf657('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8501a14..c9a09f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e69=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','create','body','find','getFields','findOne','getSubjects','DeskField','getDescriptions','rawAttributes','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','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/environment','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','name','index','map','DeskConfiguration','fieldName','type','key','model','query'];(function(_0x377fb1,_0x5ee538){var _0x3248e9=function(_0x4e6ed5){while(--_0x4e6ed5){_0x377fb1['push'](_0x377fb1['shift']());}};_0x3248e9(++_0x5ee538);}(_0x1e69,0x85));var _0x91e6=function(_0x3a194f,_0x4964bf){_0x3a194f=_0x3a194f-0x0;var _0x43c8de=_0x1e69[_0x3a194f];return _0x43c8de;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x91e6('0x0'));var rimraf=require(_0x91e6('0x1'));var zipdir=require(_0x91e6('0x2'));var jsonpatch=require(_0x91e6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x91e6('0x4'));var Mustache=require(_0x91e6('0x5'));var util=require(_0x91e6('0x6'));var path=require(_0x91e6('0x7'));var sox=require(_0x91e6('0x8'));var csv=require(_0x91e6('0x9'));var ejs=require(_0x91e6('0xa'));var fs=require('fs');var _=require(_0x91e6('0xb'));var squel=require(_0x91e6('0xc'));var crypto=require(_0x91e6('0xd'));var jsforce=require(_0x91e6('0xe'));var deskjs=require(_0x91e6('0xf'));var toCsv=require(_0x91e6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x91e6('0x10'));var authService=require(_0x91e6('0x11'));var qs=require(_0x91e6('0x12'));var as=require(_0x91e6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91e6('0x14'))(_0x91e6('0x15'));var utils=require(_0x91e6('0x16'));var config=require(_0x91e6('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x91e6('0x18'));var client=jayson[_0x91e6('0x19')][_0x91e6('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x35d81a,_0xf665a4,_0x782f0e){if(_0x782f0e){var _0x4dbce2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4dbce2['test'](_0xf665a4)){return _0x35d81a;}else{throw new db[(_0x91e6('0x1b'))][(_0x91e6('0x1c'))](_0x91e6('0x1d'));}}else{return _0x35d81a;}}function respondWithRpcPromise(_0x1af659,_0x5df579,_0xdc8f22,_0x195cf9){return new BPromise(function(_0x521502,_0xf214f9){var _0x4a7219=_0x195cf9||client;return _0x4a7219['request'](_0x1af659,_0xdc8f22)['then'](function(_0x4add09){logger[_0x91e6('0x1e')](_0x91e6('0x1f'),_0x5df579,'request\x20sent');logger['debug'](_0x91e6('0x20'),_0x5df579,_0x91e6('0x21'),JSON[_0x91e6('0x22')](_0x4add09));if(_0x4add09[_0x91e6('0x23')]){if(_0x4add09[_0x91e6('0x23')][_0x91e6('0x24')]===0x1f4){logger[_0x91e6('0x23')](_0x91e6('0x1f'),_0x5df579,_0x4add09[_0x91e6('0x23')][_0x91e6('0x25')]);return _0xf214f9(_0x4add09['error'][_0x91e6('0x25')]);}logger[_0x91e6('0x23')](_0x91e6('0x1f'),_0x5df579,_0x4add09[_0x91e6('0x23')][_0x91e6('0x25')]);return _0x521502(_0x4add09[_0x91e6('0x23')]['message']);}else{logger['info'](_0x91e6('0x1f'),_0x5df579,_0x91e6('0x21'));_0x521502(_0x4add09[_0x91e6('0x26')][_0x91e6('0x25')]);}})['catch'](function(_0x125880){logger[_0x91e6('0x23')](_0x91e6('0x1f'),_0x5df579,_0x125880);_0xf214f9(_0x125880);});});}function respondWithStatusCode(_0x1024a5,_0x3f46f7){_0x3f46f7=_0x3f46f7||0xcc;return function(_0x3f9c9f){if(_0x3f9c9f){return _0x1024a5[_0x91e6('0x27')](_0x3f46f7);}return _0x1024a5[_0x91e6('0x28')](_0x3f46f7)[_0x91e6('0x29')]();};}function respondWithResult(_0x18c614,_0x117f2b){_0x117f2b=_0x117f2b||0xc8;return function(_0x597ed5){if(_0x597ed5){return _0x18c614[_0x91e6('0x28')](_0x117f2b)[_0x91e6('0x2a')](_0x597ed5);}};}function respondWithFilteredResult(_0x3c0f65,_0x38c6af){return function(_0x3dcb03){if(_0x3dcb03){var _0x5e2d0d=_0x3dcb03[_0x91e6('0x2b')],_0x468e67=_0x38c6af[_0x91e6('0x2c')],_0x151e84=_0x38c6af[_0x91e6('0x2c')]+_0x38c6af['limit'],_0x4ca580;if(_0x151e84>=_0x5e2d0d){_0x151e84=_0x5e2d0d;_0x4ca580=0xc8;}else{_0x4ca580=0xce;}_0x3c0f65[_0x91e6('0x28')](_0x4ca580);return _0x3c0f65[_0x91e6('0x2d')]('Content-Range',_0x468e67+'-'+_0x151e84+'/'+_0x5e2d0d)[_0x91e6('0x2a')](_0x3dcb03);}return null;};}function patchUpdates(_0x3a0b3c){return function(_0x5772f0){try{jsonpatch[_0x91e6('0x2e')](_0x5772f0,_0x3a0b3c,!![]);}catch(_0x519e5a){return BPromise[_0x91e6('0x2f')](_0x519e5a);}return _0x5772f0[_0x91e6('0x30')]();};}function saveUpdates(_0x4aec86,_0x24414f){return function(_0x4b534c){if(_0x4b534c){return _0x4b534c[_0x91e6('0x31')](_0x4aec86)[_0x91e6('0x32')](function(_0x159839){return _0x159839;});}return null;};}function removeEntity(_0xcbd3c7,_0x1f6f9b){return function(_0x17c57d){if(_0x17c57d){return _0x17c57d[_0x91e6('0x33')]()['then'](function(){_0xcbd3c7[_0x91e6('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d3dc5,_0x2762a7){return function(_0x469b43){if(!_0x469b43){_0x1d3dc5[_0x91e6('0x27')](0x194);}return _0x469b43;};}function handleError(_0x23f263,_0x5d1419){_0x5d1419=_0x5d1419||0x1f4;return function(_0xa22bf8){logger[_0x91e6('0x23')](_0xa22bf8['stack']);if(_0xa22bf8[_0x91e6('0x34')]){delete _0xa22bf8['name'];}_0x23f263[_0x91e6('0x28')](_0x5d1419)['send'](_0xa22bf8);};}exports[_0x91e6('0x35')]=function(_0x47a129,_0x543a65){var _0x5976cc={},_0x308ea7={},_0xceacdb={'count':0x0,'rows':[]};var _0x3ded60=_[_0x91e6('0x36')](db[_0x91e6('0x37')]['rawAttributes'],function(_0x5198bb){return{'name':_0x5198bb[_0x91e6('0x38')],'type':_0x5198bb[_0x91e6('0x39')][_0x91e6('0x3a')]};});_0x308ea7[_0x91e6('0x3b')]=_['map'](_0x3ded60,_0x91e6('0x34'));_0x308ea7[_0x91e6('0x3c')]=_['keys'](_0x47a129['query']);_0x308ea7[_0x91e6('0x3d')]=_[_0x91e6('0x3e')](_0x308ea7['model'],_0x308ea7[_0x91e6('0x3c')]);_0x5976cc[_0x91e6('0x3f')]=_[_0x91e6('0x3e')](_0x308ea7[_0x91e6('0x3b')],qs[_0x91e6('0x40')](_0x47a129[_0x91e6('0x3c')][_0x91e6('0x40')]));_0x5976cc[_0x91e6('0x3f')]=_0x5976cc[_0x91e6('0x3f')][_0x91e6('0x41')]?_0x5976cc['attributes']:_0x308ea7[_0x91e6('0x3b')];if(!_0x47a129[_0x91e6('0x3c')][_0x91e6('0x42')](_0x91e6('0x43'))){_0x5976cc[_0x91e6('0x44')]=qs[_0x91e6('0x44')](_0x47a129['query'][_0x91e6('0x44')]);_0x5976cc[_0x91e6('0x2c')]=qs['offset'](_0x47a129[_0x91e6('0x3c')]['offset']);}_0x5976cc[_0x91e6('0x45')]=qs[_0x91e6('0x46')](_0x47a129[_0x91e6('0x3c')][_0x91e6('0x46')]);_0x5976cc[_0x91e6('0x47')]=qs['filters'](_[_0x91e6('0x48')](_0x47a129['query'],_0x308ea7[_0x91e6('0x3d')]),_0x3ded60);if(_0x47a129[_0x91e6('0x3c')][_0x91e6('0x49')]){_0x5976cc[_0x91e6('0x47')]=_[_0x91e6('0x4a')](_0x5976cc[_0x91e6('0x47')],{'$or':_[_0x91e6('0x36')](_0x3ded60,function(_0x261111){if(_0x261111['type']!==_0x91e6('0x4b')){var _0x14cb5b={};_0x14cb5b[_0x261111[_0x91e6('0x34')]]={'$like':'%'+_0x47a129[_0x91e6('0x3c')][_0x91e6('0x49')]+'%'};return _0x14cb5b;}})});}_0x5976cc=_[_0x91e6('0x4a')]({},_0x5976cc,_0x47a129[_0x91e6('0x4c')]);var _0x1f909b={'where':_0x5976cc['where']};return db[_0x91e6('0x37')][_0x91e6('0x2b')](_0x1f909b)[_0x91e6('0x32')](function(_0x57e5d0){_0xceacdb['count']=_0x57e5d0;if(_0x47a129['query']['includeAll']){_0x5976cc[_0x91e6('0x4d')]=[{'all':!![]}];}return db[_0x91e6('0x37')][_0x91e6('0x4e')](_0x5976cc);})[_0x91e6('0x32')](function(_0x13ba8d){_0xceacdb[_0x91e6('0x4f')]=_0x13ba8d;return _0xceacdb;})[_0x91e6('0x32')](respondWithFilteredResult(_0x543a65,_0x5976cc))[_0x91e6('0x50')](handleError(_0x543a65,null));};exports['show']=function(_0x360f3f,_0x645285){var _0x103cd4={'raw':![],'where':{'id':_0x360f3f[_0x91e6('0x51')]['id']}},_0x3dff69={};_0x3dff69[_0x91e6('0x3b')]=_[_0x91e6('0x52')](db[_0x91e6('0x37')]['rawAttributes']);_0x3dff69['query']=_[_0x91e6('0x52')](_0x360f3f[_0x91e6('0x3c')]);_0x3dff69['filters']=_[_0x91e6('0x3e')](_0x3dff69[_0x91e6('0x3b')],_0x3dff69['query']);_0x103cd4[_0x91e6('0x3f')]=_[_0x91e6('0x3e')](_0x3dff69[_0x91e6('0x3b')],qs['fields'](_0x360f3f[_0x91e6('0x3c')]['fields']));_0x103cd4[_0x91e6('0x3f')]=_0x103cd4[_0x91e6('0x3f')][_0x91e6('0x41')]?_0x103cd4[_0x91e6('0x3f')]:_0x3dff69[_0x91e6('0x3b')];if(_0x360f3f[_0x91e6('0x3c')][_0x91e6('0x53')]){_0x103cd4[_0x91e6('0x4d')]=[{'all':!![]}];}_0x103cd4=_[_0x91e6('0x4a')]({},_0x103cd4,_0x360f3f['options']);return db[_0x91e6('0x37')]['find'](_0x103cd4)[_0x91e6('0x32')](handleEntityNotFound(_0x645285,null))[_0x91e6('0x32')](respondWithResult(_0x645285,null))['catch'](handleError(_0x645285,null));};exports['create']=function(_0x828496,_0x3d1514){return db[_0x91e6('0x37')][_0x91e6('0x54')](_0x828496[_0x91e6('0x55')],{})[_0x91e6('0x32')](respondWithResult(_0x3d1514,0xc9))[_0x91e6('0x50')](handleError(_0x3d1514,null));};exports[_0x91e6('0x31')]=function(_0x56ea6f,_0x49e6e1){if(_0x56ea6f['body']['id']){delete _0x56ea6f[_0x91e6('0x55')]['id'];}return db[_0x91e6('0x37')][_0x91e6('0x56')]({'where':{'id':_0x56ea6f['params']['id']}})[_0x91e6('0x32')](handleEntityNotFound(_0x49e6e1,null))[_0x91e6('0x32')](saveUpdates(_0x56ea6f['body'],null))[_0x91e6('0x32')](respondWithResult(_0x49e6e1,null))[_0x91e6('0x50')](handleError(_0x49e6e1,null));};exports['destroy']=function(_0x2cc774,_0x41b03a){return db['DeskConfiguration'][_0x91e6('0x56')]({'where':{'id':_0x2cc774['params']['id']}})[_0x91e6('0x32')](handleEntityNotFound(_0x41b03a,null))['then'](removeEntity(_0x41b03a,null))[_0x91e6('0x50')](handleError(_0x41b03a,null));};exports[_0x91e6('0x57')]=function(_0x44f8db,_0x4e087b,_0x1788ca){var _0x145e8f={};var _0x5bf8c1={};var _0x3bc789;var _0x17da93;return db[_0x91e6('0x37')][_0x91e6('0x58')]({'where':{'id':_0x44f8db[_0x91e6('0x51')]['id']}})[_0x91e6('0x32')](handleEntityNotFound(_0x4e087b,null))[_0x91e6('0x32')](function(_0x1860b5){if(_0x1860b5){_0x3bc789=_0x1860b5;_0x5bf8c1[_0x91e6('0x3b')]=_['keys'](db['DeskField']['rawAttributes']);_0x5bf8c1[_0x91e6('0x3c')]=_[_0x91e6('0x52')](_0x44f8db[_0x91e6('0x3c')]);_0x5bf8c1[_0x91e6('0x3d')]=_[_0x91e6('0x3e')](_0x5bf8c1[_0x91e6('0x3b')],_0x5bf8c1[_0x91e6('0x3c')]);_0x145e8f[_0x91e6('0x3f')]=_[_0x91e6('0x3e')](_0x5bf8c1[_0x91e6('0x3b')],qs['fields'](_0x44f8db[_0x91e6('0x3c')][_0x91e6('0x40')]));_0x145e8f[_0x91e6('0x3f')]=_0x145e8f[_0x91e6('0x3f')][_0x91e6('0x41')]?_0x145e8f['attributes']:_0x5bf8c1['model'];_0x145e8f[_0x91e6('0x45')]=qs['sort'](_0x44f8db[_0x91e6('0x3c')][_0x91e6('0x46')]);_0x145e8f['where']=qs['filters'](_['pick'](_0x44f8db[_0x91e6('0x3c')],_0x5bf8c1[_0x91e6('0x3d')]));if(_0x44f8db[_0x91e6('0x3c')][_0x91e6('0x49')]){_0x145e8f[_0x91e6('0x47')]=_[_0x91e6('0x4a')](_0x145e8f[_0x91e6('0x47')],{'$or':_['map'](_0x145e8f[_0x91e6('0x3f')],function(_0x4f85fe){var _0x238861={};_0x238861[_0x4f85fe]={'$like':'%'+_0x44f8db[_0x91e6('0x3c')][_0x91e6('0x49')]+'%'};return _0x238861;})});}_0x145e8f=_[_0x91e6('0x4a')]({},_0x145e8f,_0x44f8db[_0x91e6('0x4c')]);return _0x3bc789[_0x91e6('0x57')](_0x145e8f);}})[_0x91e6('0x32')](function(_0x3ab148){if(_0x3ab148){_0x17da93=_0x3ab148[_0x91e6('0x41')];if(!_0x44f8db[_0x91e6('0x3c')][_0x91e6('0x42')](_0x91e6('0x43'))){_0x145e8f[_0x91e6('0x44')]=qs[_0x91e6('0x44')](_0x44f8db[_0x91e6('0x3c')][_0x91e6('0x44')]);_0x145e8f[_0x91e6('0x2c')]=qs[_0x91e6('0x2c')](_0x44f8db[_0x91e6('0x3c')][_0x91e6('0x2c')]);}return _0x3bc789[_0x91e6('0x57')](_0x145e8f);}})[_0x91e6('0x32')](function(_0x4c052f){if(_0x4c052f){return _0x4c052f?{'count':_0x17da93,'rows':_0x4c052f}:null;}})[_0x91e6('0x32')](respondWithResult(_0x4e087b,null))[_0x91e6('0x50')](handleError(_0x4e087b,null));};exports[_0x91e6('0x59')]=function(_0x439350,_0x1bca6c,_0x4c1653){var _0x3282ed={};var _0x327a22={};var _0x5247e8;var _0x372a0c;return db[_0x91e6('0x37')]['findOne']({'where':{'id':_0x439350[_0x91e6('0x51')]['id']}})[_0x91e6('0x32')](handleEntityNotFound(_0x1bca6c,null))['then'](function(_0x519b77){if(_0x519b77){_0x5247e8=_0x519b77;_0x327a22[_0x91e6('0x3b')]=_[_0x91e6('0x52')](db[_0x91e6('0x5a')]['rawAttributes']);_0x327a22[_0x91e6('0x3c')]=_[_0x91e6('0x52')](_0x439350['query']);_0x327a22['filters']=_['intersection'](_0x327a22[_0x91e6('0x3b')],_0x327a22['query']);_0x3282ed['attributes']=_[_0x91e6('0x3e')](_0x327a22['model'],qs[_0x91e6('0x40')](_0x439350[_0x91e6('0x3c')][_0x91e6('0x40')]));_0x3282ed[_0x91e6('0x3f')]=_0x3282ed[_0x91e6('0x3f')]['length']?_0x3282ed[_0x91e6('0x3f')]:_0x327a22[_0x91e6('0x3b')];_0x3282ed[_0x91e6('0x45')]=qs['sort'](_0x439350[_0x91e6('0x3c')][_0x91e6('0x46')]);_0x3282ed[_0x91e6('0x47')]=qs[_0x91e6('0x3d')](_[_0x91e6('0x48')](_0x439350[_0x91e6('0x3c')],_0x327a22[_0x91e6('0x3d')]));if(_0x439350[_0x91e6('0x3c')]['filter']){_0x3282ed[_0x91e6('0x47')]=_[_0x91e6('0x4a')](_0x3282ed[_0x91e6('0x47')],{'$or':_[_0x91e6('0x36')](_0x3282ed[_0x91e6('0x3f')],function(_0x5dc1f9){var _0x48a20f={};_0x48a20f[_0x5dc1f9]={'$like':'%'+_0x439350['query'][_0x91e6('0x49')]+'%'};return _0x48a20f;})});}_0x3282ed=_[_0x91e6('0x4a')]({},_0x3282ed,_0x439350[_0x91e6('0x4c')]);return _0x5247e8[_0x91e6('0x59')](_0x3282ed);}})[_0x91e6('0x32')](function(_0x253f9c){if(_0x253f9c){_0x372a0c=_0x253f9c[_0x91e6('0x41')];if(!_0x439350['query'][_0x91e6('0x42')](_0x91e6('0x43'))){_0x3282ed[_0x91e6('0x44')]=qs[_0x91e6('0x44')](_0x439350[_0x91e6('0x3c')][_0x91e6('0x44')]);_0x3282ed[_0x91e6('0x2c')]=qs['offset'](_0x439350[_0x91e6('0x3c')][_0x91e6('0x2c')]);}return _0x5247e8[_0x91e6('0x59')](_0x3282ed);}})['then'](function(_0xabb62a){if(_0xabb62a){return _0xabb62a?{'count':_0x372a0c,'rows':_0xabb62a}:null;}})['then'](respondWithResult(_0x1bca6c,null))[_0x91e6('0x50')](handleError(_0x1bca6c,null));};exports[_0x91e6('0x5b')]=function(_0x244455,_0xfc255c,_0x25d2e7){var _0xe530d7={};var _0x3b5c8f={};var _0x3e57a7;var _0x268f5b;return db[_0x91e6('0x37')]['findOne']({'where':{'id':_0x244455[_0x91e6('0x51')]['id']}})[_0x91e6('0x32')](handleEntityNotFound(_0xfc255c,null))[_0x91e6('0x32')](function(_0x16732e){if(_0x16732e){_0x3e57a7=_0x16732e;_0x3b5c8f[_0x91e6('0x3b')]=_[_0x91e6('0x52')](db['DeskField'][_0x91e6('0x5c')]);_0x3b5c8f[_0x91e6('0x3c')]=_[_0x91e6('0x52')](_0x244455[_0x91e6('0x3c')]);_0x3b5c8f[_0x91e6('0x3d')]=_[_0x91e6('0x3e')](_0x3b5c8f['model'],_0x3b5c8f['query']);_0xe530d7[_0x91e6('0x3f')]=_['intersection'](_0x3b5c8f[_0x91e6('0x3b')],qs['fields'](_0x244455['query'][_0x91e6('0x40')]));_0xe530d7[_0x91e6('0x3f')]=_0xe530d7[_0x91e6('0x3f')][_0x91e6('0x41')]?_0xe530d7[_0x91e6('0x3f')]:_0x3b5c8f[_0x91e6('0x3b')];_0xe530d7[_0x91e6('0x45')]=qs[_0x91e6('0x46')](_0x244455[_0x91e6('0x3c')][_0x91e6('0x46')]);_0xe530d7[_0x91e6('0x47')]=qs['filters'](_[_0x91e6('0x48')](_0x244455[_0x91e6('0x3c')],_0x3b5c8f['filters']));if(_0x244455[_0x91e6('0x3c')][_0x91e6('0x49')]){_0xe530d7[_0x91e6('0x47')]=_[_0x91e6('0x4a')](_0xe530d7[_0x91e6('0x47')],{'$or':_['map'](_0xe530d7[_0x91e6('0x3f')],function(_0x2104c5){var _0x8691b0={};_0x8691b0[_0x2104c5]={'$like':'%'+_0x244455[_0x91e6('0x3c')][_0x91e6('0x49')]+'%'};return _0x8691b0;})});}_0xe530d7=_[_0x91e6('0x4a')]({},_0xe530d7,_0x244455[_0x91e6('0x4c')]);return _0x3e57a7['getDescriptions'](_0xe530d7);}})[_0x91e6('0x32')](function(_0x103375){if(_0x103375){_0x268f5b=_0x103375[_0x91e6('0x41')];if(!_0x244455[_0x91e6('0x3c')]['hasOwnProperty'](_0x91e6('0x43'))){_0xe530d7[_0x91e6('0x44')]=qs[_0x91e6('0x44')](_0x244455['query'][_0x91e6('0x44')]);_0xe530d7['offset']=qs[_0x91e6('0x2c')](_0x244455[_0x91e6('0x3c')][_0x91e6('0x2c')]);}return _0x3e57a7[_0x91e6('0x5b')](_0xe530d7);}})[_0x91e6('0x32')](function(_0x2b3f35){if(_0x2b3f35){return _0x2b3f35?{'count':_0x268f5b,'rows':_0x2b3f35}:null;}})['then'](respondWithResult(_0xfc255c,null))[_0x91e6('0x50')](handleError(_0xfc255c,null));};exports[_0x91e6('0x5d')]=function(_0x4b4a02,_0x48da55,_0x5a789d){var _0x99d459={};var _0x4e3730={};var _0x239bb5;var _0x3302a1;return db[_0x91e6('0x37')]['findOne']({'where':{'id':_0x4b4a02[_0x91e6('0x51')]['id']}})[_0x91e6('0x32')](handleEntityNotFound(_0x48da55,null))['then'](function(_0x3a8793){if(_0x3a8793){_0x239bb5=_0x3a8793;_0x4e3730[_0x91e6('0x3b')]=_[_0x91e6('0x52')](db[_0x91e6('0x5e')][_0x91e6('0x5c')]);_0x4e3730[_0x91e6('0x3c')]=_['keys'](_0x4b4a02[_0x91e6('0x3c')]);_0x4e3730['filters']=_['intersection'](_0x4e3730[_0x91e6('0x3b')],_0x4e3730['query']);_0x99d459['attributes']=_[_0x91e6('0x3e')](_0x4e3730[_0x91e6('0x3b')],qs['fields'](_0x4b4a02[_0x91e6('0x3c')]['fields']));_0x99d459[_0x91e6('0x3f')]=_0x99d459[_0x91e6('0x3f')][_0x91e6('0x41')]?_0x99d459[_0x91e6('0x3f')]:_0x4e3730['model'];_0x99d459[_0x91e6('0x45')]=qs[_0x91e6('0x46')](_0x4b4a02[_0x91e6('0x3c')][_0x91e6('0x46')]);_0x99d459['where']=qs[_0x91e6('0x3d')](_[_0x91e6('0x48')](_0x4b4a02['query'],_0x4e3730['filters']));if(_0x4b4a02[_0x91e6('0x3c')]['filter']){_0x99d459['where']=_[_0x91e6('0x4a')](_0x99d459['where'],{'$or':_[_0x91e6('0x36')](_0x99d459[_0x91e6('0x3f')],function(_0x9ba2c4){var _0x1fbf6d={};_0x1fbf6d[_0x9ba2c4]={'$like':'%'+_0x4b4a02[_0x91e6('0x3c')][_0x91e6('0x49')]+'%'};return _0x1fbf6d;})});}_0x99d459=_[_0x91e6('0x4a')]({},_0x99d459,_0x4b4a02[_0x91e6('0x4c')]);return _0x239bb5['getTags'](_0x99d459);}})[_0x91e6('0x32')](function(_0x12c7ae){if(_0x12c7ae){_0x3302a1=_0x12c7ae[_0x91e6('0x41')];if(!_0x4b4a02[_0x91e6('0x3c')][_0x91e6('0x42')](_0x91e6('0x43'))){_0x99d459[_0x91e6('0x44')]=qs[_0x91e6('0x44')](_0x4b4a02[_0x91e6('0x3c')][_0x91e6('0x44')]);_0x99d459[_0x91e6('0x2c')]=qs[_0x91e6('0x2c')](_0x4b4a02[_0x91e6('0x3c')][_0x91e6('0x2c')]);}return _0x239bb5[_0x91e6('0x5d')](_0x99d459);}})['then'](function(_0x516a7a){if(_0x516a7a){return _0x516a7a?{'count':_0x3302a1,'rows':_0x516a7a}:null;}})['then'](respondWithResult(_0x48da55,null))['catch'](handleError(_0x48da55,null));};exports[_0x91e6('0x5f')]=function(_0x3f1013,_0x15806e,_0x2425db){if(_0x3f1013[_0x91e6('0x55')]['id']){delete _0x3f1013[_0x91e6('0x55')]['id'];}return db[_0x91e6('0x37')][_0x91e6('0x58')]({'where':{'id':_0x3f1013[_0x91e6('0x51')]['id']}})[_0x91e6('0x32')](handleEntityNotFound(_0x15806e,null))[_0x91e6('0x32')](function(_0x3a1c6b){if(_0x3a1c6b){return _0x3a1c6b['setTags'](_0x3f1013[_0x91e6('0x55')][_0x91e6('0x60')]||[]);}return null;})[_0x91e6('0x32')](respondWithResult(_0x15806e,null))[_0x91e6('0x50')](handleError(_0x15806e,null));};
\ No newline at end of file
+var _0x899a=['offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','DeskConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','create','body','find','findOne','DeskField','order','getFields','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','status','end','json','count'];(function(_0x1e09a1,_0x1c14f9){var _0x24ac77=function(_0x272fa1){while(--_0x272fa1){_0x1e09a1['push'](_0x1e09a1['shift']());}};_0x24ac77(++_0x1c14f9);}(_0x899a,0x1b6));var _0xa899=function(_0x2db2f5,_0x2dafa1){_0x2db2f5=_0x2db2f5-0x0;var _0x48cb99=_0x899a[_0x2db2f5];return _0x48cb99;};'use strict';var pdf=require(_0xa899('0x0'));var emlformat=require(_0xa899('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa899('0x2'));var jsonpatch=require(_0xa899('0x3'));var rp=require('request-promise');var moment=require(_0xa899('0x4'));var BPromise=require(_0xa899('0x5'));var Mustache=require(_0xa899('0x6'));var util=require(_0xa899('0x7'));var path=require('path');var sox=require(_0xa899('0x8'));var csv=require(_0xa899('0x9'));var ejs=require(_0xa899('0xa'));var fs=require('fs');var _=require(_0xa899('0xb'));var squel=require('squel');var crypto=require(_0xa899('0xc'));var jsforce=require(_0xa899('0xd'));var deskjs=require(_0xa899('0xe'));var toCsv=require(_0xa899('0x9'));var querystring=require(_0xa899('0xf'));var Papa=require(_0xa899('0x10'));var Redis=require(_0xa899('0x11'));var authService=require(_0xa899('0x12'));var qs=require(_0xa899('0x13'));var as=require(_0xa899('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa899('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xa899('0x16'));var client=jayson[_0xa899('0x17')][_0xa899('0x18')]({'port':0x232a});function checkPasswordPattern(_0x52b4ac,_0x19a08c,_0x198c32){if(_0x198c32){var _0x56d838=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56d838[_0xa899('0x19')](_0x19a08c)){return _0x52b4ac;}else{throw new db[(_0xa899('0x1a'))][(_0xa899('0x1b'))](_0xa899('0x1c'));}}else{return _0x52b4ac;}}function respondWithRpcPromise(_0x5cb055,_0x7a13b2,_0x205601,_0x4c08cc){return new BPromise(function(_0xf809a7,_0x252611){var _0x152d42=_0x4c08cc||client;return _0x152d42['request'](_0x5cb055,_0x205601)['then'](function(_0x72e6b7){logger[_0xa899('0x1d')](_0xa899('0x1e'),_0x7a13b2,_0xa899('0x1f'));logger[_0xa899('0x20')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x7a13b2,_0xa899('0x1f'),JSON['stringify'](_0x72e6b7));if(_0x72e6b7[_0xa899('0x21')]){if(_0x72e6b7[_0xa899('0x21')]['code']===0x1f4){logger[_0xa899('0x21')](_0xa899('0x1e'),_0x7a13b2,_0x72e6b7[_0xa899('0x21')][_0xa899('0x22')]);return _0x252611(_0x72e6b7[_0xa899('0x21')]['message']);}logger[_0xa899('0x21')](_0xa899('0x1e'),_0x7a13b2,_0x72e6b7['error'][_0xa899('0x22')]);return _0xf809a7(_0x72e6b7[_0xa899('0x21')][_0xa899('0x22')]);}else{logger[_0xa899('0x1d')](_0xa899('0x1e'),_0x7a13b2,'request\x20sent');_0xf809a7(_0x72e6b7[_0xa899('0x23')][_0xa899('0x22')]);}})[_0xa899('0x24')](function(_0x5100b3){logger[_0xa899('0x21')](_0xa899('0x1e'),_0x7a13b2,_0x5100b3);_0x252611(_0x5100b3);});});}function respondWithStatusCode(_0xdacfa4,_0x5ae02f){_0x5ae02f=_0x5ae02f||0xcc;return function(_0x306fc8){if(_0x306fc8){return _0xdacfa4[_0xa899('0x25')](_0x5ae02f);}return _0xdacfa4[_0xa899('0x26')](_0x5ae02f)[_0xa899('0x27')]();};}function respondWithResult(_0x3d108c,_0x3a1abb){_0x3a1abb=_0x3a1abb||0xc8;return function(_0x3cecb3){if(_0x3cecb3){return _0x3d108c[_0xa899('0x26')](_0x3a1abb)[_0xa899('0x28')](_0x3cecb3);}};}function respondWithFilteredResult(_0x31b7e4,_0x5a261a){return function(_0x49312a){if(_0x49312a){var _0x103777=_0x49312a[_0xa899('0x29')],_0x7ac8e2=_0x5a261a[_0xa899('0x2a')],_0x4cd259=_0x5a261a['offset']+_0x5a261a[_0xa899('0x2b')],_0x5d0362;if(_0x4cd259>=_0x103777){_0x4cd259=_0x103777;_0x5d0362=0xc8;}else{_0x5d0362=0xce;}_0x31b7e4[_0xa899('0x26')](_0x5d0362);return _0x31b7e4[_0xa899('0x2c')](_0xa899('0x2d'),_0x7ac8e2+'-'+_0x4cd259+'/'+_0x103777)[_0xa899('0x28')](_0x49312a);}return null;};}function patchUpdates(_0x8ae6ee){return function(_0x4bee1a){try{jsonpatch['apply'](_0x4bee1a,_0x8ae6ee,!![]);}catch(_0x47eac8){return BPromise[_0xa899('0x2e')](_0x47eac8);}return _0x4bee1a[_0xa899('0x2f')]();};}function saveUpdates(_0x35d25f,_0x3421cc){return function(_0x575e6a){if(_0x575e6a){return _0x575e6a[_0xa899('0x30')](_0x35d25f)[_0xa899('0x31')](function(_0x4d14d4){return _0x4d14d4;});}return null;};}function removeEntity(_0x2b5838,_0x4faaea){return function(_0x11ee48){if(_0x11ee48){return _0x11ee48[_0xa899('0x32')]()['then'](function(){_0x2b5838[_0xa899('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3acc,_0x86232){return function(_0x1ab1a8){if(!_0x1ab1a8){_0x2f3acc[_0xa899('0x25')](0x194);}return _0x1ab1a8;};}function handleError(_0x46c75d,_0x1346a1){_0x1346a1=_0x1346a1||0x1f4;return function(_0x3c0e49){logger[_0xa899('0x21')](_0x3c0e49[_0xa899('0x33')]);if(_0x3c0e49[_0xa899('0x34')]){delete _0x3c0e49['name'];}_0x46c75d[_0xa899('0x26')](_0x1346a1)[_0xa899('0x35')](_0x3c0e49);};}exports[_0xa899('0x36')]=function(_0x5b5fb2,_0x43bff2){var _0x1ba5a8={},_0x22ca27={},_0x4e94d2={'count':0x0,'rows':[]};var _0xd385c6=_[_0xa899('0x37')](db[_0xa899('0x38')]['rawAttributes'],function(_0xa1f29c){return{'name':_0xa1f29c[_0xa899('0x39')],'type':_0xa1f29c[_0xa899('0x3a')][_0xa899('0x3b')]};});_0x22ca27[_0xa899('0x3c')]=_[_0xa899('0x37')](_0xd385c6,_0xa899('0x34'));_0x22ca27[_0xa899('0x3d')]=_[_0xa899('0x3e')](_0x5b5fb2[_0xa899('0x3d')]);_0x22ca27[_0xa899('0x3f')]=_['intersection'](_0x22ca27['model'],_0x22ca27[_0xa899('0x3d')]);_0x1ba5a8[_0xa899('0x40')]=_[_0xa899('0x41')](_0x22ca27[_0xa899('0x3c')],qs['fields'](_0x5b5fb2[_0xa899('0x3d')][_0xa899('0x42')]));_0x1ba5a8[_0xa899('0x40')]=_0x1ba5a8[_0xa899('0x40')][_0xa899('0x43')]?_0x1ba5a8[_0xa899('0x40')]:_0x22ca27['model'];if(!_0x5b5fb2['query']['hasOwnProperty'](_0xa899('0x44'))){_0x1ba5a8[_0xa899('0x2b')]=qs[_0xa899('0x2b')](_0x5b5fb2[_0xa899('0x3d')][_0xa899('0x2b')]);_0x1ba5a8['offset']=qs['offset'](_0x5b5fb2[_0xa899('0x3d')][_0xa899('0x2a')]);}_0x1ba5a8['order']=qs[_0xa899('0x45')](_0x5b5fb2[_0xa899('0x3d')][_0xa899('0x45')]);_0x1ba5a8['where']=qs[_0xa899('0x3f')](_[_0xa899('0x46')](_0x5b5fb2[_0xa899('0x3d')],_0x22ca27['filters']),_0xd385c6);if(_0x5b5fb2[_0xa899('0x3d')]['filter']){_0x1ba5a8[_0xa899('0x47')]=_[_0xa899('0x48')](_0x1ba5a8[_0xa899('0x47')],{'$or':_[_0xa899('0x37')](_0xd385c6,function(_0x766bcc){if(_0x766bcc[_0xa899('0x3a')]!==_0xa899('0x49')){var _0x41dd32={};_0x41dd32[_0x766bcc[_0xa899('0x34')]]={'$like':'%'+_0x5b5fb2[_0xa899('0x3d')][_0xa899('0x4a')]+'%'};return _0x41dd32;}})});}_0x1ba5a8=_[_0xa899('0x48')]({},_0x1ba5a8,_0x5b5fb2[_0xa899('0x4b')]);var _0x547d1b={'where':_0x1ba5a8[_0xa899('0x47')]};return db[_0xa899('0x38')][_0xa899('0x29')](_0x547d1b)['then'](function(_0x4b8e16){_0x4e94d2[_0xa899('0x29')]=_0x4b8e16;if(_0x5b5fb2[_0xa899('0x3d')][_0xa899('0x4c')]){_0x1ba5a8[_0xa899('0x4d')]=[{'all':!![]}];}return db[_0xa899('0x38')][_0xa899('0x4e')](_0x1ba5a8);})[_0xa899('0x31')](function(_0x20d57f){_0x4e94d2['rows']=_0x20d57f;return _0x4e94d2;})[_0xa899('0x31')](respondWithFilteredResult(_0x43bff2,_0x1ba5a8))[_0xa899('0x24')](handleError(_0x43bff2,null));};exports[_0xa899('0x4f')]=function(_0x536fe1,_0x16ec9e){var _0x695f94={'raw':![],'where':{'id':_0x536fe1[_0xa899('0x50')]['id']}},_0x1ccc34={};_0x1ccc34[_0xa899('0x3c')]=_['keys'](db[_0xa899('0x38')][_0xa899('0x51')]);_0x1ccc34[_0xa899('0x3d')]=_['keys'](_0x536fe1['query']);_0x1ccc34[_0xa899('0x3f')]=_[_0xa899('0x41')](_0x1ccc34[_0xa899('0x3c')],_0x1ccc34[_0xa899('0x3d')]);_0x695f94[_0xa899('0x40')]=_['intersection'](_0x1ccc34[_0xa899('0x3c')],qs[_0xa899('0x42')](_0x536fe1[_0xa899('0x3d')]['fields']));_0x695f94['attributes']=_0x695f94[_0xa899('0x40')][_0xa899('0x43')]?_0x695f94[_0xa899('0x40')]:_0x1ccc34['model'];if(_0x536fe1[_0xa899('0x3d')][_0xa899('0x4c')]){_0x695f94[_0xa899('0x4d')]=[{'all':!![]}];}_0x695f94=_['merge']({},_0x695f94,_0x536fe1['options']);return db[_0xa899('0x38')]['find'](_0x695f94)[_0xa899('0x31')](handleEntityNotFound(_0x16ec9e,null))[_0xa899('0x31')](respondWithResult(_0x16ec9e,null))['catch'](handleError(_0x16ec9e,null));};exports[_0xa899('0x52')]=function(_0x1a8b1b,_0x404038){return db[_0xa899('0x38')][_0xa899('0x52')](_0x1a8b1b[_0xa899('0x53')],{})[_0xa899('0x31')](respondWithResult(_0x404038,0xc9))[_0xa899('0x24')](handleError(_0x404038,null));};exports[_0xa899('0x30')]=function(_0x2eea43,_0xd4f2ca){if(_0x2eea43[_0xa899('0x53')]['id']){delete _0x2eea43[_0xa899('0x53')]['id'];}return db[_0xa899('0x38')][_0xa899('0x54')]({'where':{'id':_0x2eea43[_0xa899('0x50')]['id']}})[_0xa899('0x31')](handleEntityNotFound(_0xd4f2ca,null))[_0xa899('0x31')](saveUpdates(_0x2eea43[_0xa899('0x53')],null))[_0xa899('0x31')](respondWithResult(_0xd4f2ca,null))[_0xa899('0x24')](handleError(_0xd4f2ca,null));};exports[_0xa899('0x32')]=function(_0x1d9893,_0x1607b9){return db[_0xa899('0x38')][_0xa899('0x54')]({'where':{'id':_0x1d9893['params']['id']}})['then'](handleEntityNotFound(_0x1607b9,null))[_0xa899('0x31')](removeEntity(_0x1607b9,null))[_0xa899('0x24')](handleError(_0x1607b9,null));};exports['getFields']=function(_0x22b8f3,_0x412a69,_0x21a1a1){var _0xbbca13={};var _0x1f0e71={};var _0x1478bd;var _0x201d6c;return db[_0xa899('0x38')][_0xa899('0x55')]({'where':{'id':_0x22b8f3[_0xa899('0x50')]['id']}})[_0xa899('0x31')](handleEntityNotFound(_0x412a69,null))[_0xa899('0x31')](function(_0x4994d7){if(_0x4994d7){_0x1478bd=_0x4994d7;_0x1f0e71[_0xa899('0x3c')]=_[_0xa899('0x3e')](db[_0xa899('0x56')][_0xa899('0x51')]);_0x1f0e71[_0xa899('0x3d')]=_[_0xa899('0x3e')](_0x22b8f3[_0xa899('0x3d')]);_0x1f0e71[_0xa899('0x3f')]=_['intersection'](_0x1f0e71[_0xa899('0x3c')],_0x1f0e71['query']);_0xbbca13[_0xa899('0x40')]=_[_0xa899('0x41')](_0x1f0e71['model'],qs[_0xa899('0x42')](_0x22b8f3[_0xa899('0x3d')]['fields']));_0xbbca13[_0xa899('0x40')]=_0xbbca13[_0xa899('0x40')][_0xa899('0x43')]?_0xbbca13[_0xa899('0x40')]:_0x1f0e71[_0xa899('0x3c')];_0xbbca13[_0xa899('0x57')]=qs[_0xa899('0x45')](_0x22b8f3[_0xa899('0x3d')][_0xa899('0x45')]);_0xbbca13[_0xa899('0x47')]=qs['filters'](_[_0xa899('0x46')](_0x22b8f3[_0xa899('0x3d')],_0x1f0e71[_0xa899('0x3f')]));if(_0x22b8f3[_0xa899('0x3d')][_0xa899('0x4a')]){_0xbbca13['where']=_['merge'](_0xbbca13['where'],{'$or':_[_0xa899('0x37')](_0xbbca13['attributes'],function(_0x3d9f28){var _0x265ecf={};_0x265ecf[_0x3d9f28]={'$like':'%'+_0x22b8f3['query'][_0xa899('0x4a')]+'%'};return _0x265ecf;})});}_0xbbca13=_[_0xa899('0x48')]({},_0xbbca13,_0x22b8f3[_0xa899('0x4b')]);return _0x1478bd[_0xa899('0x58')](_0xbbca13);}})[_0xa899('0x31')](function(_0x189f0c){if(_0x189f0c){_0x201d6c=_0x189f0c[_0xa899('0x43')];if(!_0x22b8f3[_0xa899('0x3d')][_0xa899('0x59')](_0xa899('0x44'))){_0xbbca13[_0xa899('0x2b')]=qs[_0xa899('0x2b')](_0x22b8f3[_0xa899('0x3d')][_0xa899('0x2b')]);_0xbbca13[_0xa899('0x2a')]=qs[_0xa899('0x2a')](_0x22b8f3[_0xa899('0x3d')][_0xa899('0x2a')]);}return _0x1478bd[_0xa899('0x58')](_0xbbca13);}})['then'](function(_0x3ae54b){if(_0x3ae54b){return _0x3ae54b?{'count':_0x201d6c,'rows':_0x3ae54b}:null;}})[_0xa899('0x31')](respondWithResult(_0x412a69,null))[_0xa899('0x24')](handleError(_0x412a69,null));};exports[_0xa899('0x5a')]=function(_0x5851c8,_0x226ec9,_0x602ba8){var _0x380b3c={};var _0x3d7d7a={};var _0x3a56be;var _0x56acbe;return db['DeskConfiguration'][_0xa899('0x55')]({'where':{'id':_0x5851c8[_0xa899('0x50')]['id']}})[_0xa899('0x31')](handleEntityNotFound(_0x226ec9,null))[_0xa899('0x31')](function(_0x3e4bac){if(_0x3e4bac){_0x3a56be=_0x3e4bac;_0x3d7d7a[_0xa899('0x3c')]=_[_0xa899('0x3e')](db[_0xa899('0x56')][_0xa899('0x51')]);_0x3d7d7a[_0xa899('0x3d')]=_[_0xa899('0x3e')](_0x5851c8[_0xa899('0x3d')]);_0x3d7d7a[_0xa899('0x3f')]=_['intersection'](_0x3d7d7a[_0xa899('0x3c')],_0x3d7d7a['query']);_0x380b3c[_0xa899('0x40')]=_[_0xa899('0x41')](_0x3d7d7a['model'],qs[_0xa899('0x42')](_0x5851c8[_0xa899('0x3d')][_0xa899('0x42')]));_0x380b3c[_0xa899('0x40')]=_0x380b3c['attributes']['length']?_0x380b3c['attributes']:_0x3d7d7a[_0xa899('0x3c')];_0x380b3c[_0xa899('0x57')]=qs[_0xa899('0x45')](_0x5851c8[_0xa899('0x3d')][_0xa899('0x45')]);_0x380b3c[_0xa899('0x47')]=qs[_0xa899('0x3f')](_[_0xa899('0x46')](_0x5851c8[_0xa899('0x3d')],_0x3d7d7a['filters']));if(_0x5851c8[_0xa899('0x3d')]['filter']){_0x380b3c[_0xa899('0x47')]=_[_0xa899('0x48')](_0x380b3c[_0xa899('0x47')],{'$or':_[_0xa899('0x37')](_0x380b3c['attributes'],function(_0x36803e){var _0x19e6d7={};_0x19e6d7[_0x36803e]={'$like':'%'+_0x5851c8['query']['filter']+'%'};return _0x19e6d7;})});}_0x380b3c=_[_0xa899('0x48')]({},_0x380b3c,_0x5851c8[_0xa899('0x4b')]);return _0x3a56be['getSubjects'](_0x380b3c);}})[_0xa899('0x31')](function(_0x50dec0){if(_0x50dec0){_0x56acbe=_0x50dec0['length'];if(!_0x5851c8['query'][_0xa899('0x59')](_0xa899('0x44'))){_0x380b3c[_0xa899('0x2b')]=qs[_0xa899('0x2b')](_0x5851c8[_0xa899('0x3d')][_0xa899('0x2b')]);_0x380b3c[_0xa899('0x2a')]=qs[_0xa899('0x2a')](_0x5851c8[_0xa899('0x3d')][_0xa899('0x2a')]);}return _0x3a56be[_0xa899('0x5a')](_0x380b3c);}})['then'](function(_0xeed329){if(_0xeed329){return _0xeed329?{'count':_0x56acbe,'rows':_0xeed329}:null;}})[_0xa899('0x31')](respondWithResult(_0x226ec9,null))[_0xa899('0x24')](handleError(_0x226ec9,null));};exports['getDescriptions']=function(_0x173b89,_0xfc797b,_0x4b2506){var _0x398df5={};var _0x31c04d={};var _0x4aef54;var _0xb2665d;return db['DeskConfiguration'][_0xa899('0x55')]({'where':{'id':_0x173b89[_0xa899('0x50')]['id']}})[_0xa899('0x31')](handleEntityNotFound(_0xfc797b,null))[_0xa899('0x31')](function(_0x2632fb){if(_0x2632fb){_0x4aef54=_0x2632fb;_0x31c04d[_0xa899('0x3c')]=_['keys'](db[_0xa899('0x56')][_0xa899('0x51')]);_0x31c04d[_0xa899('0x3d')]=_['keys'](_0x173b89[_0xa899('0x3d')]);_0x31c04d[_0xa899('0x3f')]=_[_0xa899('0x41')](_0x31c04d['model'],_0x31c04d[_0xa899('0x3d')]);_0x398df5['attributes']=_[_0xa899('0x41')](_0x31c04d[_0xa899('0x3c')],qs[_0xa899('0x42')](_0x173b89['query'][_0xa899('0x42')]));_0x398df5[_0xa899('0x40')]=_0x398df5[_0xa899('0x40')][_0xa899('0x43')]?_0x398df5['attributes']:_0x31c04d['model'];_0x398df5[_0xa899('0x57')]=qs[_0xa899('0x45')](_0x173b89[_0xa899('0x3d')][_0xa899('0x45')]);_0x398df5[_0xa899('0x47')]=qs[_0xa899('0x3f')](_['pick'](_0x173b89[_0xa899('0x3d')],_0x31c04d[_0xa899('0x3f')]));if(_0x173b89[_0xa899('0x3d')][_0xa899('0x4a')]){_0x398df5['where']=_[_0xa899('0x48')](_0x398df5[_0xa899('0x47')],{'$or':_[_0xa899('0x37')](_0x398df5[_0xa899('0x40')],function(_0x3f53a8){var _0x3045d2={};_0x3045d2[_0x3f53a8]={'$like':'%'+_0x173b89['query'][_0xa899('0x4a')]+'%'};return _0x3045d2;})});}_0x398df5=_[_0xa899('0x48')]({},_0x398df5,_0x173b89[_0xa899('0x4b')]);return _0x4aef54['getDescriptions'](_0x398df5);}})[_0xa899('0x31')](function(_0x5d3a36){if(_0x5d3a36){_0xb2665d=_0x5d3a36['length'];if(!_0x173b89[_0xa899('0x3d')][_0xa899('0x59')]('nolimit')){_0x398df5['limit']=qs[_0xa899('0x2b')](_0x173b89[_0xa899('0x3d')][_0xa899('0x2b')]);_0x398df5[_0xa899('0x2a')]=qs[_0xa899('0x2a')](_0x173b89['query'][_0xa899('0x2a')]);}return _0x4aef54[_0xa899('0x5b')](_0x398df5);}})[_0xa899('0x31')](function(_0x51f8d7){if(_0x51f8d7){return _0x51f8d7?{'count':_0xb2665d,'rows':_0x51f8d7}:null;}})[_0xa899('0x31')](respondWithResult(_0xfc797b,null))[_0xa899('0x24')](handleError(_0xfc797b,null));};exports['getTags']=function(_0xa8a878,_0x665754,_0x590ce6){var _0x1889f0={};var _0x5c39ca={};var _0xbe99cb;var _0x523af7;return db[_0xa899('0x38')]['findOne']({'where':{'id':_0xa8a878[_0xa899('0x50')]['id']}})[_0xa899('0x31')](handleEntityNotFound(_0x665754,null))[_0xa899('0x31')](function(_0x2a39fd){if(_0x2a39fd){_0xbe99cb=_0x2a39fd;_0x5c39ca['model']=_['keys'](db[_0xa899('0x5c')][_0xa899('0x51')]);_0x5c39ca[_0xa899('0x3d')]=_['keys'](_0xa8a878[_0xa899('0x3d')]);_0x5c39ca[_0xa899('0x3f')]=_[_0xa899('0x41')](_0x5c39ca['model'],_0x5c39ca[_0xa899('0x3d')]);_0x1889f0['attributes']=_[_0xa899('0x41')](_0x5c39ca[_0xa899('0x3c')],qs[_0xa899('0x42')](_0xa8a878['query'][_0xa899('0x42')]));_0x1889f0[_0xa899('0x40')]=_0x1889f0[_0xa899('0x40')]['length']?_0x1889f0[_0xa899('0x40')]:_0x5c39ca[_0xa899('0x3c')];_0x1889f0[_0xa899('0x57')]=qs[_0xa899('0x45')](_0xa8a878['query'][_0xa899('0x45')]);_0x1889f0[_0xa899('0x47')]=qs[_0xa899('0x3f')](_['pick'](_0xa8a878['query'],_0x5c39ca[_0xa899('0x3f')]));if(_0xa8a878[_0xa899('0x3d')][_0xa899('0x4a')]){_0x1889f0[_0xa899('0x47')]=_[_0xa899('0x48')](_0x1889f0[_0xa899('0x47')],{'$or':_[_0xa899('0x37')](_0x1889f0[_0xa899('0x40')],function(_0x39183c){var _0x39cb42={};_0x39cb42[_0x39183c]={'$like':'%'+_0xa8a878['query'][_0xa899('0x4a')]+'%'};return _0x39cb42;})});}_0x1889f0=_['merge']({},_0x1889f0,_0xa8a878['options']);return _0xbe99cb[_0xa899('0x5d')](_0x1889f0);}})[_0xa899('0x31')](function(_0x23e9f7){if(_0x23e9f7){_0x523af7=_0x23e9f7[_0xa899('0x43')];if(!_0xa8a878[_0xa899('0x3d')][_0xa899('0x59')]('nolimit')){_0x1889f0[_0xa899('0x2b')]=qs['limit'](_0xa8a878[_0xa899('0x3d')][_0xa899('0x2b')]);_0x1889f0['offset']=qs['offset'](_0xa8a878[_0xa899('0x3d')][_0xa899('0x2a')]);}return _0xbe99cb[_0xa899('0x5d')](_0x1889f0);}})['then'](function(_0x1e785e){if(_0x1e785e){return _0x1e785e?{'count':_0x523af7,'rows':_0x1e785e}:null;}})[_0xa899('0x31')](respondWithResult(_0x665754,null))[_0xa899('0x24')](handleError(_0x665754,null));};exports[_0xa899('0x5e')]=function(_0x4fcea2,_0x44bf53,_0x372e11){if(_0x4fcea2[_0xa899('0x53')]['id']){delete _0x4fcea2['body']['id'];}return db[_0xa899('0x38')][_0xa899('0x55')]({'where':{'id':_0x4fcea2[_0xa899('0x50')]['id']}})[_0xa899('0x31')](handleEntityNotFound(_0x44bf53,null))[_0xa899('0x31')](function(_0x589569){if(_0x589569){return _0x589569['setTags'](_0x4fcea2[_0xa899('0x53')][_0xa899('0x5f')]||[]);}return null;})['then'](respondWithResult(_0x44bf53,null))[_0xa899('0x24')](handleError(_0x44bf53,null));};
\ No newline at end of file
index addee3f..1f1ae9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dcb=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x93dc1c,_0x423000){var _0x4c3e89=function(_0x1e1c7e){while(--_0x1e1c7e){_0x93dc1c['push'](_0x93dc1c['shift']());}};_0x4c3e89(++_0x423000);}(_0x3dcb,0x89));var _0xb3dc=function(_0x165cfe,_0x59284b){_0x165cfe=_0x165cfe-0x0;var _0xbeee1a=_0x3dcb[_0x165cfe];return _0xbeee1a;};'use strict';var _=require(_0xb3dc('0x0'));var util=require('util');var logger=require(_0xb3dc('0x1'))(_0xb3dc('0x2'));var moment=require('moment');var BPromise=require(_0xb3dc('0x3'));var rp=require(_0xb3dc('0x4'));var fs=require('fs');var path=require(_0xb3dc('0x5'));var rimraf=require(_0xb3dc('0x6'));var config=require('../../config/environment');var attributes=require(_0xb3dc('0x7'));module[_0xb3dc('0x8')]=function(_0x426a09,_0x463626){return _0x426a09[_0xb3dc('0x9')](_0xb3dc('0xa'),attributes,{'tableName':_0xb3dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7533=['define','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x386c9d,_0x1cf2ef){var _0x2f74d2=function(_0x5c96aa){while(--_0x5c96aa){_0x386c9d['push'](_0x386c9d['shift']());}};_0x2f74d2(++_0x1cf2ef);}(_0x7533,0x188));var _0x3753=function(_0x2733fd,_0x180bcb){_0x2733fd=_0x2733fd-0x0;var _0x2f4e9a=_0x7533[_0x2733fd];return _0x2f4e9a;};'use strict';var _=require(_0x3753('0x0'));var util=require(_0x3753('0x1'));var logger=require(_0x3753('0x2'))(_0x3753('0x3'));var moment=require(_0x3753('0x4'));var BPromise=require(_0x3753('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3753('0x6'));var rimraf=require(_0x3753('0x7'));var config=require(_0x3753('0x8'));var attributes=require(_0x3753('0x9'));module[_0x3753('0xa')]=function(_0x3412b7,_0x4a2a0c){return _0x3412b7[_0x3753('0xb')]('DeskConfiguration',attributes,{'tableName':_0x3753('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4515cf..48d44e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcffe=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1ef217,_0x172963){var _0x348c3d=function(_0x37bdd7){while(--_0x37bdd7){_0x1ef217['push'](_0x1ef217['shift']());}};_0x348c3d(++_0x172963);}(_0xcffe,0x1a1));var _0xecff=function(_0x34bbd5,_0x3c810a){_0x34bbd5=_0x34bbd5-0x0;var _0x46244f=_0xcffe[_0x34bbd5];return _0x46244f;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var moment=require(_0xecff('0x2'));var BPromise=require(_0xecff('0x3'));var rs=require(_0xecff('0x4'));var fs=require('fs');var Redis=require(_0xecff('0x5'));var db=require(_0xecff('0x6'))['db'];var utils=require(_0xecff('0x7'));var logger=require(_0xecff('0x8'))(_0xecff('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xecff('0xa')][_0xecff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2fa9,_0x38a8f6,_0x50c98b){return new BPromise(function(_0x298c19,_0x1f7386){return client['request'](_0x2e2fa9,_0x50c98b)[_0xecff('0xc')](function(_0x3eefb9){logger[_0xecff('0xd')](_0xecff('0xe'),_0x38a8f6,_0xecff('0xf'));logger['debug'](_0xecff('0x10'),_0x38a8f6,_0xecff('0xf'),JSON[_0xecff('0x11')](_0x3eefb9));if(_0x3eefb9[_0xecff('0x12')]){if(_0x3eefb9[_0xecff('0x12')][_0xecff('0x13')]===0x1f4){logger[_0xecff('0x12')](_0xecff('0xe'),_0x38a8f6,_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);return _0x1f7386(_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);}logger[_0xecff('0x12')](_0xecff('0xe'),_0x38a8f6,_0x3eefb9['error']['message']);return _0x298c19(_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);}else{logger['info'](_0xecff('0xe'),_0x38a8f6,_0xecff('0xf'));_0x298c19(_0x3eefb9[_0xecff('0x15')]['message']);}})['catch'](function(_0x24abef){logger[_0xecff('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x38a8f6,_0x24abef);_0x1f7386(_0x24abef);});});}
\ No newline at end of file
+var _0x902b=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x2a5dcf,_0x44cb37){var _0x4e3618=function(_0x9ef66d){while(--_0x9ef66d){_0x2a5dcf['push'](_0x2a5dcf['shift']());}};_0x4e3618(++_0x44cb37);}(_0x902b,0x6a));var _0xb902=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x902b[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xb902('0x0'));var util=require('util');var moment=require(_0xb902('0x1'));var BPromise=require(_0xb902('0x2'));var rs=require(_0xb902('0x3'));var fs=require('fs');var Redis=require(_0xb902('0x4'));var db=require(_0xb902('0x5'))['db'];var utils=require(_0xb902('0x6'));var logger=require('../../config/logger')(_0xb902('0x7'));var config=require('../../config/environment');var jayson=require(_0xb902('0x8'));var client=jayson['client'][_0xb902('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e7240,_0x49f60d,_0x5b0b74){return new BPromise(function(_0x55331d,_0x534c79){return client[_0xb902('0xa')](_0x5e7240,_0x5b0b74)[_0xb902('0xb')](function(_0x573fa5){logger['info'](_0xb902('0xc'),_0x49f60d,_0xb902('0xd'));logger[_0xb902('0xe')](_0xb902('0xf'),_0x49f60d,_0xb902('0xd'),JSON[_0xb902('0x10')](_0x573fa5));if(_0x573fa5[_0xb902('0x11')]){if(_0x573fa5[_0xb902('0x11')]['code']===0x1f4){logger[_0xb902('0x11')](_0xb902('0xc'),_0x49f60d,_0x573fa5[_0xb902('0x11')][_0xb902('0x12')]);return _0x534c79(_0x573fa5['error']['message']);}logger[_0xb902('0x11')](_0xb902('0xc'),_0x49f60d,_0x573fa5['error'][_0xb902('0x12')]);return _0x55331d(_0x573fa5[_0xb902('0x11')][_0xb902('0x12')]);}else{logger[_0xb902('0x13')](_0xb902('0xc'),_0x49f60d,_0xb902('0xd'));_0x55331d(_0x573fa5['result'][_0xb902('0x12')]);}})[_0xb902('0x14')](function(_0x32d4c1){logger[_0xb902('0x11')](_0xb902('0xc'),_0x49f60d,_0x32d4c1);_0x534c79(_0x32d4c1);});});}
\ No newline at end of file
index f997852..88c372c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f89=['../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x3b675e,_0x30109e){var _0x51b498=function(_0x1a916d){while(--_0x1a916d){_0x3b675e['push'](_0x3b675e['shift']());}};_0x51b498(++_0x30109e);}(_0x8f89,0x79));var _0x98f8=function(_0x5a5250,_0xa907c1){_0x5a5250=_0x5a5250-0x0;var _0x5eb8d2=_0x8f89[_0x5a5250];return _0x5eb8d2;};'use strict';var multer=require(_0x98f8('0x0'));var util=require(_0x98f8('0x1'));var path=require('path');var timeout=require(_0x98f8('0x2'));var express=require(_0x98f8('0x3'));var router=express['Router']();var auth=require(_0x98f8('0x4'));var interaction=require(_0x98f8('0x5'));var config=require(_0x98f8('0x6'));var controller=require(_0x98f8('0x7'));router['get']('/',auth[_0x98f8('0x8')](),controller[_0x98f8('0x9')]);router[_0x98f8('0xa')](_0x98f8('0xb'),auth[_0x98f8('0x8')](),controller[_0x98f8('0xc')]);router[_0x98f8('0xd')]('/',auth[_0x98f8('0x8')](),controller[_0x98f8('0xe')]);router[_0x98f8('0xf')](_0x98f8('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x98f8('0xb'),auth[_0x98f8('0x8')](),controller[_0x98f8('0x10')]);module[_0x98f8('0x11')]=router;
\ No newline at end of file
+var _0xd405=['show','post','isAuthenticated','create','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id'];(function(_0x13ef98,_0xc30b23){var _0xe3b7a7=function(_0x1ac5d6){while(--_0x1ac5d6){_0x13ef98['push'](_0x13ef98['shift']());}};_0xe3b7a7(++_0xc30b23);}(_0xd405,0xc2));var _0x5d40=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xd405[_0x2e50a2];return _0x47e5de;};'use strict';var multer=require(_0x5d40('0x0'));var util=require(_0x5d40('0x1'));var path=require(_0x5d40('0x2'));var timeout=require(_0x5d40('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x5d40('0x4'));var interaction=require(_0x5d40('0x5'));var config=require(_0x5d40('0x6'));var controller=require(_0x5d40('0x7'));router[_0x5d40('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5d40('0x9'),auth['isAuthenticated'](),controller[_0x5d40('0xa')]);router[_0x5d40('0xb')]('/',auth[_0x5d40('0xc')](),controller[_0x5d40('0xd')]);router['put'](_0x5d40('0x9'),auth['isAuthenticated'](),controller[_0x5d40('0xe')]);router['delete'](_0x5d40('0x9'),auth[_0x5d40('0xc')](),controller[_0x5d40('0xf')]);module[_0x5d40('0x10')]=router;
\ No newline at end of file
index 26d6ecb..1cc5dd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab39=['keyValue','string','STRING','ENUM','variable','exports'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0xab39,0x101));var _0x9ab3=function(_0x44421b,_0x4c743f){_0x44421b=_0x44421b-0x0;var _0x66e600=_0xab39[_0x44421b];return _0x66e600;};'use strict';var Sequelize=require('sequelize');module[_0x9ab3('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0x9ab3('0x1')),'defaultValue':_0x9ab3('0x2')},'content':{'type':Sequelize[_0x9ab3('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9ab3('0x4')]('string',_0x9ab3('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0x9ab3('0x3')]},'idField':{'type':Sequelize[_0x9ab3('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x306a=['STRING','string','variable','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x57f659,_0x38baba){var _0x373059=function(_0x471c91){while(--_0x471c91){_0x57f659['push'](_0x57f659['shift']());}};_0x373059(++_0x38baba);}(_0x306a,0x174));var _0xa306=function(_0x22cbcb,_0x413899){_0x22cbcb=_0x22cbcb-0x0;var _0x484301=_0x306a[_0x22cbcb];return _0x484301;};'use strict';var Sequelize=require(_0xa306('0x0'));module[_0xa306('0x1')]={'type':{'type':Sequelize[_0xa306('0x2')]('string','variable',_0xa306('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa306('0x4')]},'keyType':{'type':Sequelize[_0xa306('0x2')](_0xa306('0x5'),_0xa306('0x6'),_0xa306('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa306('0x4')]},'nameField':{'type':Sequelize[_0xa306('0x4')]},'customField':{'type':Sequelize[_0xa306('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ae5dcf1..4c6d074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec83=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','query'];(function(_0x4940a6,_0x448570){var _0x101ffe=function(_0x39c461){while(--_0x39c461){_0x4940a6['push'](_0x4940a6['shift']());}};_0x101ffe(++_0x448570);}(_0xec83,0x14c));var _0x3ec8=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0xec83[_0x5a6de2];return _0x2c0525;};'use strict';var pdf=require(_0x3ec8('0x0'));var emlformat=require(_0x3ec8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3ec8('0x2'));var jsonpatch=require(_0x3ec8('0x3'));var rp=require(_0x3ec8('0x4'));var moment=require(_0x3ec8('0x5'));var BPromise=require(_0x3ec8('0x6'));var Mustache=require(_0x3ec8('0x7'));var util=require(_0x3ec8('0x8'));var path=require(_0x3ec8('0x9'));var sox=require('sox');var csv=require(_0x3ec8('0xa'));var ejs=require(_0x3ec8('0xb'));var fs=require('fs');var _=require(_0x3ec8('0xc'));var squel=require('squel');var crypto=require(_0x3ec8('0xd'));var jsforce=require(_0x3ec8('0xe'));var deskjs=require(_0x3ec8('0xf'));var toCsv=require(_0x3ec8('0xa'));var querystring=require(_0x3ec8('0x10'));var Papa=require(_0x3ec8('0x11'));var Redis=require(_0x3ec8('0x12'));var authService=require(_0x3ec8('0x13'));var qs=require(_0x3ec8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ec8('0x15'))(_0x3ec8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3ec8('0x17'))['db'];function respondWithStatusCode(_0x4b2327,_0x28340c){_0x28340c=_0x28340c||0xcc;return function(_0x512421){if(_0x512421){return _0x4b2327[_0x3ec8('0x18')](_0x28340c);}return _0x4b2327[_0x3ec8('0x19')](_0x28340c)[_0x3ec8('0x1a')]();};}function respondWithResult(_0x147eb0,_0x3bbb2d){_0x3bbb2d=_0x3bbb2d||0xc8;return function(_0x4491b0){if(_0x4491b0){return _0x147eb0[_0x3ec8('0x19')](_0x3bbb2d)[_0x3ec8('0x1b')](_0x4491b0);}};}function respondWithFilteredResult(_0x5aa322,_0x256058){return function(_0x35745b){if(_0x35745b){var _0x1e9971=_0x35745b[_0x3ec8('0x1c')],_0x1f1cd7=_0x256058['offset'],_0x18a6b8=_0x256058['offset']+_0x256058[_0x3ec8('0x1d')],_0x273199;if(_0x18a6b8>=_0x1e9971){_0x18a6b8=_0x1e9971;_0x273199=0xc8;}else{_0x273199=0xce;}_0x5aa322['status'](_0x273199);return _0x5aa322[_0x3ec8('0x1e')](_0x3ec8('0x1f'),_0x1f1cd7+'-'+_0x18a6b8+'/'+_0x1e9971)[_0x3ec8('0x1b')](_0x35745b);}return null;};}function patchUpdates(_0x366a43){return function(_0x165764){try{jsonpatch[_0x3ec8('0x20')](_0x165764,_0x366a43,!![]);}catch(_0x2b631f){return BPromise[_0x3ec8('0x21')](_0x2b631f);}return _0x165764[_0x3ec8('0x22')]();};}function saveUpdates(_0x59f903,_0x3dc65b){return function(_0x34d69b){if(_0x34d69b){return _0x34d69b[_0x3ec8('0x23')](_0x59f903)['then'](function(_0xda5248){return _0xda5248;});}return null;};}function removeEntity(_0x3d5e60,_0x2bd2a8){return function(_0x2e7596){if(_0x2e7596){return _0x2e7596['destroy']()[_0x3ec8('0x24')](function(){_0x3d5e60[_0x3ec8('0x19')](0xcc)[_0x3ec8('0x1a')]();});}};}function handleEntityNotFound(_0x495c79,_0x10d456){return function(_0x178f7c){if(!_0x178f7c){_0x495c79[_0x3ec8('0x18')](0x194);}return _0x178f7c;};}function handleError(_0x3926a3,_0x6c185){_0x6c185=_0x6c185||0x1f4;return function(_0x139270){logger[_0x3ec8('0x25')](_0x139270[_0x3ec8('0x26')]);if(_0x139270[_0x3ec8('0x27')]){delete _0x139270[_0x3ec8('0x27')];}_0x3926a3[_0x3ec8('0x19')](_0x6c185)[_0x3ec8('0x28')](_0x139270);};}exports[_0x3ec8('0x29')]=function(_0x6ac6bc,_0x3d7c35){var _0x54ddd6={},_0x16df1f={},_0x3f4280={'count':0x0,'rows':[]};var _0x3fec5e=_[_0x3ec8('0x2a')](db[_0x3ec8('0x2b')][_0x3ec8('0x2c')],function(_0x4522ec){return{'name':_0x4522ec['fieldName'],'type':_0x4522ec[_0x3ec8('0x2d')][_0x3ec8('0x2e')]};});_0x16df1f['model']=_['map'](_0x3fec5e,'name');_0x16df1f[_0x3ec8('0x2f')]=_[_0x3ec8('0x30')](_0x6ac6bc[_0x3ec8('0x2f')]);_0x16df1f[_0x3ec8('0x31')]=_[_0x3ec8('0x32')](_0x16df1f[_0x3ec8('0x33')],_0x16df1f[_0x3ec8('0x2f')]);_0x54ddd6[_0x3ec8('0x34')]=_['intersection'](_0x16df1f[_0x3ec8('0x33')],qs[_0x3ec8('0x35')](_0x6ac6bc[_0x3ec8('0x2f')][_0x3ec8('0x35')]));_0x54ddd6[_0x3ec8('0x34')]=_0x54ddd6[_0x3ec8('0x34')][_0x3ec8('0x36')]?_0x54ddd6[_0x3ec8('0x34')]:_0x16df1f[_0x3ec8('0x33')];if(!_0x6ac6bc[_0x3ec8('0x2f')][_0x3ec8('0x37')]('nolimit')){_0x54ddd6[_0x3ec8('0x1d')]=qs['limit'](_0x6ac6bc[_0x3ec8('0x2f')][_0x3ec8('0x1d')]);_0x54ddd6[_0x3ec8('0x38')]=qs['offset'](_0x6ac6bc[_0x3ec8('0x2f')][_0x3ec8('0x38')]);}_0x54ddd6[_0x3ec8('0x39')]=qs[_0x3ec8('0x3a')](_0x6ac6bc[_0x3ec8('0x2f')][_0x3ec8('0x3a')]);_0x54ddd6['where']=qs[_0x3ec8('0x31')](_[_0x3ec8('0x3b')](_0x6ac6bc['query'],_0x16df1f[_0x3ec8('0x31')]),_0x3fec5e);if(_0x6ac6bc[_0x3ec8('0x2f')][_0x3ec8('0x3c')]){_0x54ddd6[_0x3ec8('0x3d')]=_[_0x3ec8('0x3e')](_0x54ddd6['where'],{'$or':_['map'](_0x3fec5e,function(_0x2e8a9c){if(_0x2e8a9c['type']!==_0x3ec8('0x3f')){var _0xd77a0e={};_0xd77a0e[_0x2e8a9c[_0x3ec8('0x27')]]={'$like':'%'+_0x6ac6bc[_0x3ec8('0x2f')][_0x3ec8('0x3c')]+'%'};return _0xd77a0e;}})});}_0x54ddd6=_[_0x3ec8('0x3e')]({},_0x54ddd6,_0x6ac6bc[_0x3ec8('0x40')]);var _0x5eb77f={'where':_0x54ddd6[_0x3ec8('0x3d')]};return db[_0x3ec8('0x2b')]['count'](_0x5eb77f)[_0x3ec8('0x24')](function(_0x22b8bf){_0x3f4280[_0x3ec8('0x1c')]=_0x22b8bf;if(_0x6ac6bc[_0x3ec8('0x2f')]['includeAll']){_0x54ddd6['include']=[{'all':!![]}];}return db[_0x3ec8('0x2b')][_0x3ec8('0x41')](_0x54ddd6);})[_0x3ec8('0x24')](function(_0x19c639){_0x3f4280[_0x3ec8('0x42')]=_0x19c639;return _0x3f4280;})[_0x3ec8('0x24')](respondWithFilteredResult(_0x3d7c35,_0x54ddd6))['catch'](handleError(_0x3d7c35,null));};exports[_0x3ec8('0x43')]=function(_0x44276e,_0x166dc4){var _0x3f677b={'raw':!![],'where':{'id':_0x44276e[_0x3ec8('0x44')]['id']}},_0x585b31={};_0x585b31[_0x3ec8('0x33')]=_[_0x3ec8('0x30')](db[_0x3ec8('0x2b')][_0x3ec8('0x2c')]);_0x585b31[_0x3ec8('0x2f')]=_[_0x3ec8('0x30')](_0x44276e[_0x3ec8('0x2f')]);_0x585b31[_0x3ec8('0x31')]=_[_0x3ec8('0x32')](_0x585b31['model'],_0x585b31[_0x3ec8('0x2f')]);_0x3f677b[_0x3ec8('0x34')]=_['intersection'](_0x585b31[_0x3ec8('0x33')],qs['fields'](_0x44276e['query'][_0x3ec8('0x35')]));_0x3f677b[_0x3ec8('0x34')]=_0x3f677b['attributes'][_0x3ec8('0x36')]?_0x3f677b[_0x3ec8('0x34')]:_0x585b31[_0x3ec8('0x33')];if(_0x44276e[_0x3ec8('0x2f')][_0x3ec8('0x45')]){_0x3f677b[_0x3ec8('0x46')]=[{'all':!![]}];}_0x3f677b=_[_0x3ec8('0x3e')]({},_0x3f677b,_0x44276e['options']);return db[_0x3ec8('0x2b')][_0x3ec8('0x47')](_0x3f677b)[_0x3ec8('0x24')](handleEntityNotFound(_0x166dc4,null))[_0x3ec8('0x24')](respondWithResult(_0x166dc4,null))[_0x3ec8('0x48')](handleError(_0x166dc4,null));};exports[_0x3ec8('0x49')]=function(_0x5cd7c3,_0x126bfc){return db[_0x3ec8('0x2b')][_0x3ec8('0x49')](_0x5cd7c3[_0x3ec8('0x4a')],{})[_0x3ec8('0x24')](respondWithResult(_0x126bfc,0xc9))['catch'](handleError(_0x126bfc,null));};exports['update']=function(_0x1994a6,_0x45484d){if(_0x1994a6[_0x3ec8('0x4a')]['id']){delete _0x1994a6[_0x3ec8('0x4a')]['id'];}return db['DeskField'][_0x3ec8('0x47')]({'where':{'id':_0x1994a6[_0x3ec8('0x44')]['id']}})[_0x3ec8('0x24')](handleEntityNotFound(_0x45484d,null))[_0x3ec8('0x24')](saveUpdates(_0x1994a6['body'],null))[_0x3ec8('0x24')](respondWithResult(_0x45484d,null))[_0x3ec8('0x48')](handleError(_0x45484d,null));};exports[_0x3ec8('0x4b')]=function(_0x468db4,_0x4067ea){return db[_0x3ec8('0x2b')][_0x3ec8('0x47')]({'where':{'id':_0x468db4[_0x3ec8('0x44')]['id']}})[_0x3ec8('0x24')](handleEntityNotFound(_0x4067ea,null))[_0x3ec8('0x24')](removeEntity(_0x4067ea,null))[_0x3ec8('0x48')](handleError(_0x4067ea,null));};
\ No newline at end of file
+var _0xf2e4=['filter','VIRTUAL','merge','options','count','includeAll','DeskField','findAll','rows','show','keys','include','find','catch','create','body','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','apply','save','update','then','stack','name','send','index','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick'];(function(_0x322ee0,_0x2e2f29){var _0x4f519a=function(_0x64d2d2){while(--_0x64d2d2){_0x322ee0['push'](_0x322ee0['shift']());}};_0x4f519a(++_0x2e2f29);}(_0xf2e4,0x9e));var _0x4f2e=function(_0x1d099e,_0x4249cc){_0x1d099e=_0x1d099e-0x0;var _0x3cf24c=_0xf2e4[_0x1d099e];return _0x3cf24c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4f2e('0x0'));var zipdir=require(_0x4f2e('0x1'));var jsonpatch=require(_0x4f2e('0x2'));var rp=require(_0x4f2e('0x3'));var moment=require(_0x4f2e('0x4'));var BPromise=require(_0x4f2e('0x5'));var Mustache=require('mustache');var util=require(_0x4f2e('0x6'));var path=require(_0x4f2e('0x7'));var sox=require(_0x4f2e('0x8'));var csv=require(_0x4f2e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f2e('0xa'));var squel=require(_0x4f2e('0xb'));var crypto=require('crypto');var jsforce=require(_0x4f2e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4f2e('0xd'));var Redis=require(_0x4f2e('0xe'));var authService=require(_0x4f2e('0xf'));var qs=require(_0x4f2e('0x10'));var as=require(_0x4f2e('0x11'));var hardwareService=require(_0x4f2e('0x12'));var logger=require(_0x4f2e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4f2e('0x14'));var db=require(_0x4f2e('0x15'))['db'];function respondWithStatusCode(_0xa2b864,_0x21010b){_0x21010b=_0x21010b||0xcc;return function(_0x927f94){if(_0x927f94){return _0xa2b864[_0x4f2e('0x16')](_0x21010b);}return _0xa2b864[_0x4f2e('0x17')](_0x21010b)[_0x4f2e('0x18')]();};}function respondWithResult(_0x4b1d31,_0x39c2da){_0x39c2da=_0x39c2da||0xc8;return function(_0x35c2e1){if(_0x35c2e1){return _0x4b1d31[_0x4f2e('0x17')](_0x39c2da)['json'](_0x35c2e1);}};}function respondWithFilteredResult(_0x129512,_0x3e00d7){return function(_0x3b3973){if(_0x3b3973){var _0x58258e=_0x3b3973['count'],_0x413f6e=_0x3e00d7[_0x4f2e('0x19')],_0x475502=_0x3e00d7['offset']+_0x3e00d7[_0x4f2e('0x1a')],_0x34b58b;if(_0x475502>=_0x58258e){_0x475502=_0x58258e;_0x34b58b=0xc8;}else{_0x34b58b=0xce;}_0x129512[_0x4f2e('0x17')](_0x34b58b);return _0x129512[_0x4f2e('0x1b')](_0x4f2e('0x1c'),_0x413f6e+'-'+_0x475502+'/'+_0x58258e)['json'](_0x3b3973);}return null;};}function patchUpdates(_0x41999f){return function(_0x2b0000){try{jsonpatch[_0x4f2e('0x1d')](_0x2b0000,_0x41999f,!![]);}catch(_0x2323ad){return BPromise['reject'](_0x2323ad);}return _0x2b0000[_0x4f2e('0x1e')]();};}function saveUpdates(_0xc5c369,_0x44b734){return function(_0x1c4d7d){if(_0x1c4d7d){return _0x1c4d7d[_0x4f2e('0x1f')](_0xc5c369)[_0x4f2e('0x20')](function(_0x3f8811){return _0x3f8811;});}return null;};}function removeEntity(_0x3ac7ff,_0x55d03b){return function(_0x5618ba){if(_0x5618ba){return _0x5618ba['destroy']()[_0x4f2e('0x20')](function(){_0x3ac7ff[_0x4f2e('0x17')](0xcc)[_0x4f2e('0x18')]();});}};}function handleEntityNotFound(_0x2b8bd0,_0x568e30){return function(_0x18ca6c){if(!_0x18ca6c){_0x2b8bd0['sendStatus'](0x194);}return _0x18ca6c;};}function handleError(_0x9de0fa,_0x401295){_0x401295=_0x401295||0x1f4;return function(_0x24d438){logger['error'](_0x24d438[_0x4f2e('0x21')]);if(_0x24d438[_0x4f2e('0x22')]){delete _0x24d438[_0x4f2e('0x22')];}_0x9de0fa['status'](_0x401295)[_0x4f2e('0x23')](_0x24d438);};}exports[_0x4f2e('0x24')]=function(_0x19e9d0,_0x58f760){var _0x16262c={},_0x3fd4a8={},_0x393041={'count':0x0,'rows':[]};var _0x1b965c=_['map'](db['DeskField'][_0x4f2e('0x25')],function(_0x5d9eb4){return{'name':_0x5d9eb4[_0x4f2e('0x26')],'type':_0x5d9eb4[_0x4f2e('0x27')]['key']};});_0x3fd4a8[_0x4f2e('0x28')]=_['map'](_0x1b965c,_0x4f2e('0x22'));_0x3fd4a8[_0x4f2e('0x29')]=_['keys'](_0x19e9d0[_0x4f2e('0x29')]);_0x3fd4a8['filters']=_[_0x4f2e('0x2a')](_0x3fd4a8[_0x4f2e('0x28')],_0x3fd4a8['query']);_0x16262c[_0x4f2e('0x2b')]=_[_0x4f2e('0x2a')](_0x3fd4a8[_0x4f2e('0x28')],qs[_0x4f2e('0x2c')](_0x19e9d0['query'][_0x4f2e('0x2c')]));_0x16262c['attributes']=_0x16262c[_0x4f2e('0x2b')][_0x4f2e('0x2d')]?_0x16262c['attributes']:_0x3fd4a8[_0x4f2e('0x28')];if(!_0x19e9d0[_0x4f2e('0x29')]['hasOwnProperty'](_0x4f2e('0x2e'))){_0x16262c[_0x4f2e('0x1a')]=qs[_0x4f2e('0x1a')](_0x19e9d0['query']['limit']);_0x16262c[_0x4f2e('0x19')]=qs[_0x4f2e('0x19')](_0x19e9d0['query'][_0x4f2e('0x19')]);}_0x16262c[_0x4f2e('0x2f')]=qs[_0x4f2e('0x30')](_0x19e9d0[_0x4f2e('0x29')]['sort']);_0x16262c[_0x4f2e('0x31')]=qs[_0x4f2e('0x32')](_[_0x4f2e('0x33')](_0x19e9d0[_0x4f2e('0x29')],_0x3fd4a8[_0x4f2e('0x32')]),_0x1b965c);if(_0x19e9d0[_0x4f2e('0x29')][_0x4f2e('0x34')]){_0x16262c[_0x4f2e('0x31')]=_['merge'](_0x16262c['where'],{'$or':_['map'](_0x1b965c,function(_0x6067d2){if(_0x6067d2[_0x4f2e('0x27')]!==_0x4f2e('0x35')){var _0x22af68={};_0x22af68[_0x6067d2[_0x4f2e('0x22')]]={'$like':'%'+_0x19e9d0[_0x4f2e('0x29')]['filter']+'%'};return _0x22af68;}})});}_0x16262c=_[_0x4f2e('0x36')]({},_0x16262c,_0x19e9d0[_0x4f2e('0x37')]);var _0x11f7e8={'where':_0x16262c[_0x4f2e('0x31')]};return db['DeskField'][_0x4f2e('0x38')](_0x11f7e8)[_0x4f2e('0x20')](function(_0x752999){_0x393041[_0x4f2e('0x38')]=_0x752999;if(_0x19e9d0[_0x4f2e('0x29')][_0x4f2e('0x39')]){_0x16262c['include']=[{'all':!![]}];}return db[_0x4f2e('0x3a')][_0x4f2e('0x3b')](_0x16262c);})[_0x4f2e('0x20')](function(_0x509ac2){_0x393041[_0x4f2e('0x3c')]=_0x509ac2;return _0x393041;})[_0x4f2e('0x20')](respondWithFilteredResult(_0x58f760,_0x16262c))['catch'](handleError(_0x58f760,null));};exports[_0x4f2e('0x3d')]=function(_0x55ef5f,_0x315c59){var _0xdb1a47={'raw':!![],'where':{'id':_0x55ef5f['params']['id']}},_0x8e76e5={};_0x8e76e5[_0x4f2e('0x28')]=_[_0x4f2e('0x3e')](db[_0x4f2e('0x3a')][_0x4f2e('0x25')]);_0x8e76e5['query']=_[_0x4f2e('0x3e')](_0x55ef5f[_0x4f2e('0x29')]);_0x8e76e5[_0x4f2e('0x32')]=_[_0x4f2e('0x2a')](_0x8e76e5[_0x4f2e('0x28')],_0x8e76e5[_0x4f2e('0x29')]);_0xdb1a47[_0x4f2e('0x2b')]=_[_0x4f2e('0x2a')](_0x8e76e5[_0x4f2e('0x28')],qs[_0x4f2e('0x2c')](_0x55ef5f[_0x4f2e('0x29')]['fields']));_0xdb1a47[_0x4f2e('0x2b')]=_0xdb1a47[_0x4f2e('0x2b')]['length']?_0xdb1a47[_0x4f2e('0x2b')]:_0x8e76e5[_0x4f2e('0x28')];if(_0x55ef5f[_0x4f2e('0x29')][_0x4f2e('0x39')]){_0xdb1a47[_0x4f2e('0x3f')]=[{'all':!![]}];}_0xdb1a47=_['merge']({},_0xdb1a47,_0x55ef5f['options']);return db[_0x4f2e('0x3a')][_0x4f2e('0x40')](_0xdb1a47)['then'](handleEntityNotFound(_0x315c59,null))[_0x4f2e('0x20')](respondWithResult(_0x315c59,null))[_0x4f2e('0x41')](handleError(_0x315c59,null));};exports[_0x4f2e('0x42')]=function(_0x1fc622,_0x454b51){return db['DeskField'][_0x4f2e('0x42')](_0x1fc622['body'],{})[_0x4f2e('0x20')](respondWithResult(_0x454b51,0xc9))['catch'](handleError(_0x454b51,null));};exports[_0x4f2e('0x1f')]=function(_0x16ff36,_0x57b05b){if(_0x16ff36[_0x4f2e('0x43')]['id']){delete _0x16ff36[_0x4f2e('0x43')]['id'];}return db[_0x4f2e('0x3a')][_0x4f2e('0x40')]({'where':{'id':_0x16ff36['params']['id']}})[_0x4f2e('0x20')](handleEntityNotFound(_0x57b05b,null))[_0x4f2e('0x20')](saveUpdates(_0x16ff36[_0x4f2e('0x43')],null))['then'](respondWithResult(_0x57b05b,null))[_0x4f2e('0x41')](handleError(_0x57b05b,null));};exports[_0x4f2e('0x44')]=function(_0x235915,_0x1fa961){return db[_0x4f2e('0x3a')][_0x4f2e('0x40')]({'where':{'id':_0x235915[_0x4f2e('0x45')]['id']}})[_0x4f2e('0x20')](handleEntityNotFound(_0x1fa961,null))[_0x4f2e('0x20')](removeEntity(_0x1fa961,null))[_0x4f2e('0x41')](handleError(_0x1fa961,null));};
\ No newline at end of file
index 5171639..e3cf99e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52b5=['define','DeskField','int_desk_fields','desk_unique_index','idField','api','request-promise','path','../../config/environment','./intDeskField.attributes','exports'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x52b5,0x10d));var _0x552b=function(_0x59cb48,_0x3e9b50){_0x59cb48=_0x59cb48-0x0;var _0x45b4d5=_0x52b5[_0x59cb48];return _0x45b4d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x552b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x552b('0x1'));var fs=require('fs');var path=require(_0x552b('0x2'));var rimraf=require('rimraf');var config=require(_0x552b('0x3'));var attributes=require(_0x552b('0x4'));module[_0x552b('0x5')]=function(_0x5a9250,_0x91e09f){return _0x5a9250[_0x552b('0x6')](_0x552b('0x7'),attributes,{'tableName':_0x552b('0x8'),'paranoid':![],'indexes':[{'name':_0x552b('0x9'),'fields':[_0x552b('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1775=['FieldId','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1775,0xa9));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5177('0x0'));var util=require('util');var logger=require(_0x5177('0x1'))('api');var moment=require(_0x5177('0x2'));var BPromise=require('bluebird');var rp=require(_0x5177('0x3'));var fs=require('fs');var path=require(_0x5177('0x4'));var rimraf=require(_0x5177('0x5'));var config=require(_0x5177('0x6'));var attributes=require(_0x5177('0x7'));module[_0x5177('0x8')]=function(_0x4796f8,_0x454120){return _0x4796f8[_0x5177('0x9')]('DeskField',attributes,{'tableName':_0x5177('0xa'),'paranoid':![],'indexes':[{'name':_0x5177('0xb'),'fields':[_0x5177('0xc'),_0x5177('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 831bd0a..9a4aead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6922=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x26f965,_0xfa379f){var _0x135618=function(_0x6c35a){while(--_0x6c35a){_0x26f965['push'](_0x26f965['shift']());}};_0x135618(++_0xfa379f);}(_0x6922,0x87));var _0x2692=function(_0x433d85,_0x445dea){_0x433d85=_0x433d85-0x0;var _0x11fad7=_0x6922[_0x433d85];return _0x11fad7;};'use strict';var _=require(_0x2692('0x0'));var util=require(_0x2692('0x1'));var moment=require(_0x2692('0x2'));var BPromise=require(_0x2692('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2692('0x4'));var db=require(_0x2692('0x5'))['db'];var utils=require(_0x2692('0x6'));var logger=require(_0x2692('0x7'))('rpc');var config=require(_0x2692('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2692('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb56238,_0x15e9de,_0x585522){return new BPromise(function(_0x33da19,_0x193745){return client['request'](_0xb56238,_0x585522)['then'](function(_0x29eda3){logger['info'](_0x2692('0xa'),_0x15e9de,_0x2692('0xb'));logger[_0x2692('0xc')](_0x2692('0xd'),_0x15e9de,_0x2692('0xb'),JSON['stringify'](_0x29eda3));if(_0x29eda3[_0x2692('0xe')]){if(_0x29eda3[_0x2692('0xe')][_0x2692('0xf')]===0x1f4){logger['error'](_0x2692('0xa'),_0x15e9de,_0x29eda3['error'][_0x2692('0x10')]);return _0x193745(_0x29eda3['error'][_0x2692('0x10')]);}logger[_0x2692('0xe')](_0x2692('0xa'),_0x15e9de,_0x29eda3[_0x2692('0xe')][_0x2692('0x10')]);return _0x33da19(_0x29eda3[_0x2692('0xe')][_0x2692('0x10')]);}else{logger['info'](_0x2692('0xa'),_0x15e9de,_0x2692('0xb'));_0x33da19(_0x29eda3[_0x2692('0x11')][_0x2692('0x10')]);}})[_0x2692('0x12')](function(_0x327d78){logger[_0x2692('0xe')](_0x2692('0xa'),_0x15e9de,_0x327d78);_0x193745(_0x327d78);});});}
\ No newline at end of file
+var _0xab36=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','DeskField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1d5fa9,_0xe54e51){var _0x30587d=function(_0x3bf93f){while(--_0x3bf93f){_0x1d5fa9['push'](_0x1d5fa9['shift']());}};_0x30587d(++_0xe54e51);}(_0xab36,0x1f4));var _0x6ab3=function(_0x534b70,_0x673fc0){_0x534b70=_0x534b70-0x0;var _0x386aef=_0xab36[_0x534b70];return _0x386aef;};'use strict';var _=require(_0x6ab3('0x0'));var util=require('util');var moment=require(_0x6ab3('0x1'));var BPromise=require(_0x6ab3('0x2'));var rs=require(_0x6ab3('0x3'));var fs=require('fs');var Redis=require(_0x6ab3('0x4'));var db=require(_0x6ab3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ab3('0x6'))(_0x6ab3('0x7'));var config=require(_0x6ab3('0x8'));var jayson=require(_0x6ab3('0x9'));var client=jayson[_0x6ab3('0xa')][_0x6ab3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e47a7,_0x42cfef,_0x57319d){return new BPromise(function(_0x5b4d9b,_0x18bdbf){return client[_0x6ab3('0xc')](_0x4e47a7,_0x57319d)['then'](function(_0x2c225c){logger[_0x6ab3('0xd')]('DeskField,\x20%s,\x20%s',_0x42cfef,'request\x20sent');logger[_0x6ab3('0xe')](_0x6ab3('0xf'),_0x42cfef,'request\x20sent',JSON['stringify'](_0x2c225c));if(_0x2c225c[_0x6ab3('0x10')]){if(_0x2c225c['error'][_0x6ab3('0x11')]===0x1f4){logger[_0x6ab3('0x10')](_0x6ab3('0x12'),_0x42cfef,_0x2c225c[_0x6ab3('0x10')]['message']);return _0x18bdbf(_0x2c225c['error'][_0x6ab3('0x13')]);}logger[_0x6ab3('0x10')]('DeskField,\x20%s,\x20%s',_0x42cfef,_0x2c225c['error'][_0x6ab3('0x13')]);return _0x5b4d9b(_0x2c225c[_0x6ab3('0x10')]['message']);}else{logger[_0x6ab3('0xd')]('DeskField,\x20%s,\x20%s',_0x42cfef,_0x6ab3('0x14'));_0x5b4d9b(_0x2c225c[_0x6ab3('0x15')][_0x6ab3('0x13')]);}})[_0x6ab3('0x16')](function(_0x378267){logger['error'](_0x6ab3('0x12'),_0x42cfef,_0x378267);_0x18bdbf(_0x378267);});});}
\ No newline at end of file
index 8f10926..6545121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4940=['update','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','./intDynamics365Account.controller','get','index','/:id','/:id/configurations','isAuthenticated','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x5df235,_0x5804c0){var _0xe3202d=function(_0x3d5a3e){while(--_0x3d5a3e){_0x5df235['push'](_0x5df235['shift']());}};_0xe3202d(++_0x5804c0);}(_0x4940,0x67));var _0x0494=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4940[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x0494('0x0'));var util=require(_0x0494('0x1'));var path=require('path');var timeout=require(_0x0494('0x2'));var express=require('express');var router=express[_0x0494('0x3')]();var auth=require(_0x0494('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0494('0x5'));router[_0x0494('0x6')]('/',auth['isAuthenticated'](),controller[_0x0494('0x7')]);router[_0x0494('0x6')](_0x0494('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0494('0x6')](_0x0494('0x9'),auth[_0x0494('0xa')](),controller['getConfigurations']);router[_0x0494('0x6')](_0x0494('0xb'),auth[_0x0494('0xa')](),controller[_0x0494('0xc')]);router[_0x0494('0xd')]('/',auth['isAuthenticated'](),controller[_0x0494('0xe')]);router[_0x0494('0xd')](_0x0494('0x9'),auth[_0x0494('0xa')](),controller[_0x0494('0xf')]);router[_0x0494('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0494('0x11')]);router['delete'](_0x0494('0x8'),auth[_0x0494('0xa')](),controller[_0x0494('0x12')]);module[_0x0494('0x13')]=router;
\ No newline at end of file
+var _0x62c5=['create','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','getConfigurations','getFields','post'];(function(_0x52aba5,_0x467f8f){var _0x3c7fd6=function(_0x4bafe9){while(--_0x4bafe9){_0x52aba5['push'](_0x52aba5['shift']());}};_0x3c7fd6(++_0x467f8f);}(_0x62c5,0xd4));var _0x562c=function(_0x3ce4a5,_0x50bc4b){_0x3ce4a5=_0x3ce4a5-0x0;var _0x3f5809=_0x62c5[_0x3ce4a5];return _0x3f5809;};'use strict';var multer=require(_0x562c('0x0'));var util=require(_0x562c('0x1'));var path=require(_0x562c('0x2'));var timeout=require(_0x562c('0x3'));var express=require(_0x562c('0x4'));var router=express[_0x562c('0x5')]();var auth=require(_0x562c('0x6'));var interaction=require(_0x562c('0x7'));var config=require(_0x562c('0x8'));var controller=require(_0x562c('0x9'));router['get']('/',auth[_0x562c('0xa')](),controller[_0x562c('0xb')]);router[_0x562c('0xc')](_0x562c('0xd'),auth[_0x562c('0xa')](),controller[_0x562c('0xe')]);router[_0x562c('0xc')]('/:id/configurations',auth[_0x562c('0xa')](),controller[_0x562c('0xf')]);router[_0x562c('0xc')]('/:id/fields',auth[_0x562c('0xa')](),controller[_0x562c('0x10')]);router[_0x562c('0x11')]('/',auth[_0x562c('0xa')](),controller[_0x562c('0x12')]);router[_0x562c('0x11')]('/:id/configurations',auth[_0x562c('0xa')](),controller[_0x562c('0x13')]);router[_0x562c('0x14')](_0x562c('0xd'),auth[_0x562c('0xa')](),controller[_0x562c('0x15')]);router['delete'](_0x562c('0xd'),auth['isAuthenticated'](),controller[_0x562c('0x16')]);module['exports']=router;
\ No newline at end of file
index 458de99..4814828 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2010=['sequelize','exports','STRING'];(function(_0x28e6bb,_0x195e82){var _0x1ac4ed=function(_0x467f83){while(--_0x467f83){_0x28e6bb['push'](_0x28e6bb['shift']());}};_0x1ac4ed(++_0x195e82);}(_0x2010,0x16b));var _0x0201=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2010[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0201('0x0'));module[_0x0201('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0201('0x2')]},'remoteUri':{'type':Sequelize[_0x0201('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x0201('0x2')]},'clientSecret':{'type':Sequelize[_0x0201('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0201('0x2')]}};
\ No newline at end of file
+var _0x6cab=['STRING','sequelize','exports'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0x6cab,0x1c6));var _0xb6ca=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x6cab[_0x3e6729];return _0x535bcd;};'use strict';var Sequelize=require(_0xb6ca('0x0'));module[_0xb6ca('0x1')]={'name':{'type':Sequelize[_0xb6ca('0x2')]},'username':{'type':Sequelize[_0xb6ca('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb6ca('0x2')]},'tenantId':{'type':Sequelize[_0xb6ca('0x2')]},'clientId':{'type':Sequelize[_0xb6ca('0x2')]},'clientSecret':{'type':Sequelize[_0xb6ca('0x2')]},'serverUrl':{'type':Sequelize[_0xb6ca('0x2')]},'description':{'type':Sequelize[_0xb6ca('0x2')]}};
\ No newline at end of file
index f24f497..8c5d5c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e56=['../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','ValidationError','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','destroy','stack','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','Dynamics365Account','rows','show','include','options','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','slice','substring','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','clientId','password','clientSecret','access_token','GET','Bearer\x20','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','MetadataId','isNil','lastIndexOf','BooleanAttributeMetadata','all','forEach','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Wrong\x20credentials','statusCode','OptionSet','push','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0x4e56,0x19f));var _0x64e5=function(_0x3a708c,_0x4dca8e){_0x3a708c=_0x3a708c-0x0;var _0x4c4eee=_0x4e56[_0x3a708c];return _0x4c4eee;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x64e5('0x0'));var rimraf=require(_0x64e5('0x1'));var zipdir=require(_0x64e5('0x2'));var jsonpatch=require(_0x64e5('0x3'));var rp=require(_0x64e5('0x4'));var moment=require(_0x64e5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x64e5('0x6'));var util=require(_0x64e5('0x7'));var path=require(_0x64e5('0x8'));var sox=require(_0x64e5('0x9'));var csv=require(_0x64e5('0xa'));var ejs=require(_0x64e5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x64e5('0xc'));var deskjs=require(_0x64e5('0xd'));var toCsv=require(_0x64e5('0xa'));var querystring=require(_0x64e5('0xe'));var Papa=require(_0x64e5('0xf'));var Redis=require(_0x64e5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x64e5('0x11'));var hardwareService=require(_0x64e5('0x12'));var logger=require(_0x64e5('0x13'))(_0x64e5('0x14'));var utils=require(_0x64e5('0x15'));var config=require('../../config/environment');var db=require(_0x64e5('0x16'))['db'];var integrations=require(_0x64e5('0x17'));var jayson=require(_0x64e5('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x48e060,_0x3c39fd,_0x209f03){if(_0x209f03){var _0x4e9205=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e9205[_0x64e5('0x19')](_0x3c39fd)){return _0x48e060;}else{throw new db['Sequelize'][(_0x64e5('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x48e060;}}function respondWithRpcPromise(_0x33a355,_0x71b519,_0x52a1ac,_0x39f0be){return new BPromise(function(_0x2fadfb,_0x21046f){var _0x4974d7=_0x39f0be||client;return _0x4974d7[_0x64e5('0x1b')](_0x33a355,_0x52a1ac)[_0x64e5('0x1c')](function(_0x46afb2){logger[_0x64e5('0x1d')](_0x64e5('0x1e'),_0x71b519,'request\x20sent');logger[_0x64e5('0x1f')](_0x64e5('0x20'),_0x71b519,_0x64e5('0x21'),JSON[_0x64e5('0x22')](_0x46afb2));if(_0x46afb2[_0x64e5('0x23')]){if(_0x46afb2[_0x64e5('0x23')]['code']===0x1f4){logger[_0x64e5('0x23')](_0x64e5('0x1e'),_0x71b519,_0x46afb2[_0x64e5('0x23')][_0x64e5('0x24')]);return _0x21046f(_0x46afb2['error'][_0x64e5('0x24')]);}logger[_0x64e5('0x23')]('Dynamics365Account,\x20%s,\x20%s',_0x71b519,_0x46afb2[_0x64e5('0x23')]['message']);return _0x2fadfb(_0x46afb2[_0x64e5('0x23')]['message']);}else{logger[_0x64e5('0x1d')](_0x64e5('0x1e'),_0x71b519,_0x64e5('0x21'));_0x2fadfb(_0x46afb2[_0x64e5('0x25')][_0x64e5('0x24')]);}})[_0x64e5('0x26')](function(_0x1826d8){logger[_0x64e5('0x23')](_0x64e5('0x1e'),_0x71b519,_0x1826d8);_0x21046f(_0x1826d8);});});}function respondWithStatusCode(_0x3b5e52,_0x5369d4){_0x5369d4=_0x5369d4||0xcc;return function(_0x4172b5){if(_0x4172b5){return _0x3b5e52[_0x64e5('0x27')](_0x5369d4);}return _0x3b5e52[_0x64e5('0x28')](_0x5369d4)[_0x64e5('0x29')]();};}function respondWithResult(_0x5e309d,_0x4bf279){_0x4bf279=_0x4bf279||0xc8;return function(_0x1d1eeb){if(_0x1d1eeb){return _0x5e309d['status'](_0x4bf279)[_0x64e5('0x2a')](_0x1d1eeb);}};}function respondWithFilteredResult(_0x1ed6a0,_0x53a361){return function(_0x377775){if(_0x377775){var _0x37013d=_0x377775[_0x64e5('0x2b')],_0x386381=_0x53a361[_0x64e5('0x2c')],_0x36f359=_0x53a361['offset']+_0x53a361[_0x64e5('0x2d')],_0x18571d;if(_0x36f359>=_0x37013d){_0x36f359=_0x37013d;_0x18571d=0xc8;}else{_0x18571d=0xce;}_0x1ed6a0[_0x64e5('0x28')](_0x18571d);return _0x1ed6a0['set'](_0x64e5('0x2e'),_0x386381+'-'+_0x36f359+'/'+_0x37013d)[_0x64e5('0x2a')](_0x377775);}return null;};}function patchUpdates(_0x2baffb){return function(_0x5b2bf9){try{jsonpatch[_0x64e5('0x2f')](_0x5b2bf9,_0x2baffb,!![]);}catch(_0x1554c0){return BPromise[_0x64e5('0x30')](_0x1554c0);}return _0x5b2bf9['save']();};}function saveUpdates(_0x1448fb,_0x53297a){return function(_0xca2b7d){if(_0xca2b7d){return _0xca2b7d['update'](_0x1448fb)[_0x64e5('0x1c')](function(_0x55a214){return _0x55a214;});}return null;};}function removeEntity(_0x1fcdeb,_0x3a01de){return function(_0x4a74f9){if(_0x4a74f9){return _0x4a74f9[_0x64e5('0x31')]()[_0x64e5('0x1c')](function(){_0x1fcdeb[_0x64e5('0x28')](0xcc)[_0x64e5('0x29')]();});}};}function handleEntityNotFound(_0x2e3ae0,_0x365da5){return function(_0xa2150f){if(!_0xa2150f){_0x2e3ae0[_0x64e5('0x27')](0x194);}return _0xa2150f;};}function handleError(_0x21e979,_0x2d9781){_0x2d9781=_0x2d9781||0x1f4;return function(_0x5f3d1c){logger[_0x64e5('0x23')](_0x5f3d1c[_0x64e5('0x32')]);if(_0x5f3d1c[_0x64e5('0x33')]){delete _0x5f3d1c[_0x64e5('0x33')];}_0x21e979[_0x64e5('0x28')](_0x2d9781)[_0x64e5('0x34')](_0x5f3d1c);};}exports['index']=function(_0x49fd14,_0x5d87f4){var _0x2d207e={},_0xd2741f={},_0x36d1a6={'count':0x0,'rows':[]};var _0x515f9c=_[_0x64e5('0x35')](db['Dynamics365Account']['rawAttributes'],function(_0xccf2f1){return{'name':_0xccf2f1[_0x64e5('0x36')],'type':_0xccf2f1[_0x64e5('0x37')][_0x64e5('0x38')]};});_0xd2741f[_0x64e5('0x39')]=_[_0x64e5('0x35')](_0x515f9c,_0x64e5('0x33'));_0xd2741f[_0x64e5('0x3a')]=_[_0x64e5('0x3b')](_0x49fd14[_0x64e5('0x3a')]);_0xd2741f[_0x64e5('0x3c')]=_['intersection'](_0xd2741f[_0x64e5('0x39')],_0xd2741f[_0x64e5('0x3a')]);_0x2d207e[_0x64e5('0x3d')]=_[_0x64e5('0x3e')](_0xd2741f[_0x64e5('0x39')],qs['fields'](_0x49fd14[_0x64e5('0x3a')][_0x64e5('0x3f')]));_0x2d207e['attributes']=_0x2d207e[_0x64e5('0x3d')][_0x64e5('0x40')]?_0x2d207e[_0x64e5('0x3d')]:_0xd2741f['model'];if(!_0x49fd14[_0x64e5('0x3a')]['hasOwnProperty'](_0x64e5('0x41'))){_0x2d207e[_0x64e5('0x2d')]=qs['limit'](_0x49fd14[_0x64e5('0x3a')]['limit']);_0x2d207e['offset']=qs[_0x64e5('0x2c')](_0x49fd14['query'][_0x64e5('0x2c')]);}_0x2d207e['order']=qs[_0x64e5('0x42')](_0x49fd14[_0x64e5('0x3a')][_0x64e5('0x42')]);_0x2d207e[_0x64e5('0x43')]=qs[_0x64e5('0x3c')](_[_0x64e5('0x44')](_0x49fd14[_0x64e5('0x3a')],_0xd2741f['filters']),_0x515f9c);if(_0x49fd14[_0x64e5('0x3a')][_0x64e5('0x45')]){_0x2d207e[_0x64e5('0x43')]=_[_0x64e5('0x46')](_0x2d207e[_0x64e5('0x43')],{'$or':_[_0x64e5('0x35')](_0x515f9c,function(_0xa28c9f){if(_0xa28c9f[_0x64e5('0x37')]!==_0x64e5('0x47')){var _0x5e6659={};_0x5e6659[_0xa28c9f['name']]={'$like':'%'+_0x49fd14[_0x64e5('0x3a')][_0x64e5('0x45')]+'%'};return _0x5e6659;}})});}_0x2d207e=_['merge']({},_0x2d207e,_0x49fd14['options']);var _0x52c9e2={'where':_0x2d207e[_0x64e5('0x43')]};return db['Dynamics365Account'][_0x64e5('0x2b')](_0x52c9e2)[_0x64e5('0x1c')](function(_0x1efabd){_0x36d1a6['count']=_0x1efabd;if(_0x49fd14[_0x64e5('0x3a')][_0x64e5('0x48')]){_0x2d207e['include']=[{'all':!![]}];}return db[_0x64e5('0x49')]['findAll'](_0x2d207e);})['then'](function(_0x502d6b){_0x36d1a6[_0x64e5('0x4a')]=_0x502d6b;return _0x36d1a6;})[_0x64e5('0x1c')](respondWithFilteredResult(_0x5d87f4,_0x2d207e))['catch'](handleError(_0x5d87f4,null));};exports[_0x64e5('0x4b')]=function(_0x170707,_0x5d0bca){var _0x2d6eb1={'raw':![],'where':{'id':_0x170707['params']['id']}},_0x2aa51b={};_0x2aa51b[_0x64e5('0x39')]=_['keys'](db[_0x64e5('0x49')]['rawAttributes']);_0x2aa51b[_0x64e5('0x3a')]=_[_0x64e5('0x3b')](_0x170707['query']);_0x2aa51b[_0x64e5('0x3c')]=_[_0x64e5('0x3e')](_0x2aa51b[_0x64e5('0x39')],_0x2aa51b[_0x64e5('0x3a')]);_0x2d6eb1[_0x64e5('0x3d')]=_[_0x64e5('0x3e')](_0x2aa51b[_0x64e5('0x39')],qs[_0x64e5('0x3f')](_0x170707['query'][_0x64e5('0x3f')]));_0x2d6eb1[_0x64e5('0x3d')]=_0x2d6eb1[_0x64e5('0x3d')]['length']?_0x2d6eb1[_0x64e5('0x3d')]:_0x2aa51b[_0x64e5('0x39')];if(_0x170707[_0x64e5('0x3a')][_0x64e5('0x48')]){_0x2d6eb1[_0x64e5('0x4c')]=[{'all':!![]}];}_0x2d6eb1=_[_0x64e5('0x46')]({},_0x2d6eb1,_0x170707[_0x64e5('0x4d')]);return db[_0x64e5('0x49')][_0x64e5('0x4e')](_0x2d6eb1)[_0x64e5('0x1c')](handleEntityNotFound(_0x5d0bca,null))[_0x64e5('0x1c')](respondWithResult(_0x5d0bca,null))['catch'](handleError(_0x5d0bca,null));};exports[_0x64e5('0x4f')]=function(_0x4d256c,_0x417009){return db['Dynamics365Account'][_0x64e5('0x4f')](_0x4d256c[_0x64e5('0x50')],{})['then'](respondWithResult(_0x417009,0xc9))[_0x64e5('0x26')](handleError(_0x417009,null));};exports['update']=function(_0x455e8d,_0x275f67){if(_0x455e8d[_0x64e5('0x50')]['id']){delete _0x455e8d[_0x64e5('0x50')]['id'];}return db[_0x64e5('0x49')]['find']({'where':{'id':_0x455e8d[_0x64e5('0x51')]['id']}})[_0x64e5('0x1c')](handleEntityNotFound(_0x275f67,null))[_0x64e5('0x1c')](saveUpdates(_0x455e8d[_0x64e5('0x50')],null))[_0x64e5('0x1c')](respondWithResult(_0x275f67,null))['catch'](handleError(_0x275f67,null));};exports[_0x64e5('0x31')]=function(_0x2b5f2c,_0x4502ea){return db[_0x64e5('0x49')][_0x64e5('0x4e')]({'where':{'id':_0x2b5f2c['params']['id']}})[_0x64e5('0x1c')](handleEntityNotFound(_0x4502ea,null))[_0x64e5('0x1c')](removeEntity(_0x4502ea,null))[_0x64e5('0x26')](handleError(_0x4502ea,null));};exports[_0x64e5('0x52')]=function(_0xd756af,_0x5beb73,_0x21efc6){var _0x452f61={};var _0x1a2afe={};var _0x11e2a7;var _0x2eaa0e;return db[_0x64e5('0x49')][_0x64e5('0x53')]({'where':{'id':_0xd756af[_0x64e5('0x51')]['id']}})[_0x64e5('0x1c')](handleEntityNotFound(_0x5beb73,null))[_0x64e5('0x1c')](function(_0x2c19e8){if(_0x2c19e8){_0x11e2a7=_0x2c19e8;_0x1a2afe[_0x64e5('0x39')]=_['keys'](db[_0x64e5('0x54')][_0x64e5('0x55')]);_0x1a2afe[_0x64e5('0x3a')]=_['keys'](_0xd756af[_0x64e5('0x3a')]);_0x1a2afe[_0x64e5('0x3c')]=_['intersection'](_0x1a2afe[_0x64e5('0x39')],_0x1a2afe[_0x64e5('0x3a')]);_0x452f61[_0x64e5('0x3d')]=_['intersection'](_0x1a2afe[_0x64e5('0x39')],qs[_0x64e5('0x3f')](_0xd756af[_0x64e5('0x3a')]['fields']));_0x452f61['attributes']=_0x452f61[_0x64e5('0x3d')]['length']?_0x452f61[_0x64e5('0x3d')]:_0x1a2afe[_0x64e5('0x39')];_0x452f61[_0x64e5('0x56')]=qs[_0x64e5('0x42')](_0xd756af[_0x64e5('0x3a')][_0x64e5('0x42')]);_0x452f61[_0x64e5('0x43')]=qs[_0x64e5('0x3c')](_[_0x64e5('0x44')](_0xd756af[_0x64e5('0x3a')],_0x1a2afe[_0x64e5('0x3c')]));if(_0xd756af[_0x64e5('0x3a')][_0x64e5('0x45')]){_0x452f61[_0x64e5('0x43')]=_[_0x64e5('0x46')](_0x452f61[_0x64e5('0x43')],{'$or':_[_0x64e5('0x35')](_0x452f61[_0x64e5('0x3d')],function(_0x3550f2){var _0x409869={};_0x409869[_0x3550f2]={'$like':'%'+_0xd756af[_0x64e5('0x3a')][_0x64e5('0x45')]+'%'};return _0x409869;})});}_0x452f61=_[_0x64e5('0x46')]({},_0x452f61,_0xd756af[_0x64e5('0x4d')]);return _0x11e2a7[_0x64e5('0x52')](_0x452f61);}})[_0x64e5('0x1c')](function(_0x1a5e7b){if(_0x1a5e7b){_0x2eaa0e=_0x1a5e7b[_0x64e5('0x40')];if(!_0xd756af[_0x64e5('0x3a')][_0x64e5('0x57')](_0x64e5('0x41'))){_0x452f61[_0x64e5('0x2d')]=qs[_0x64e5('0x2d')](_0xd756af['query'][_0x64e5('0x2d')]);_0x452f61['offset']=qs[_0x64e5('0x2c')](_0xd756af['query'][_0x64e5('0x2c')]);}return _0x11e2a7[_0x64e5('0x52')](_0x452f61);}})[_0x64e5('0x1c')](function(_0x5c62f5){if(_0x5c62f5){return _0x5c62f5?{'count':_0x2eaa0e,'rows':_0x5c62f5}:null;}})['then'](respondWithResult(_0x5beb73,null))[_0x64e5('0x26')](handleError(_0x5beb73,null));};exports[_0x64e5('0x58')]=function(_0x2a99dc,_0x1e6abd,_0x1d7325){if(_0x2a99dc[_0x64e5('0x50')]['id']){delete _0x2a99dc[_0x64e5('0x50')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x2a99dc[_0x64e5('0x51')]['id']}})[_0x64e5('0x1c')](handleEntityNotFound(_0x1e6abd,null))['then'](function(_0x122c8a){if(_0x122c8a){_0x2a99dc['body'][_0x64e5('0x59')]=_0x122c8a['id'];_0x2a99dc[_0x64e5('0x50')][_0x64e5('0x5a')]=integrations[_0x64e5('0x5b')](_0x2a99dc[_0x64e5('0x50')][_0x64e5('0x5c')],_0x2a99dc[_0x64e5('0x50')]['type']);_0x2a99dc[_0x64e5('0x50')]['Descriptions']=integrations[_0x64e5('0x5d')](_0x2a99dc[_0x64e5('0x50')][_0x64e5('0x5c')],_0x2a99dc[_0x64e5('0x50')][_0x64e5('0x37')]);return db[_0x64e5('0x54')]['create'](_0x2a99dc[_0x64e5('0x50')],{'include':[{'model':db['Dynamics365Field'],'as':_0x64e5('0x5a')},{'model':db[_0x64e5('0x5e')],'as':_0x64e5('0x5f')}]});}return null;})['then'](respondWithResult(_0x1e6abd,null))[_0x64e5('0x26')](handleError(_0x1e6abd,null));};exports['getFields']=function(_0x237d03,_0x28ec8b,_0x3afb13){var _0x3caf14=_0x237d03[_0x64e5('0x3a')][_0x64e5('0x60')];var _0x432af8=_0x3caf14===_0x64e5('0x61')?_0x64e5('0x62'):_0x64e5('0x63');var _0x247642='';var _0x114469='';var _0x5479d0='';var _0x5728ea='';var _0x927726='';var _0x439448='';var _0x42a9ee='';var _0x2748d1='';var _0x486c7b=[_0x64e5('0x64'),_0x64e5('0x65'),_0x64e5('0x66'),_0x64e5('0x67'),_0x64e5('0x68'),_0x64e5('0x69'),_0x64e5('0x6a'),_0x64e5('0x6b'),'directioncode',_0x64e5('0x6c')];var _0x554e4c=['accountidname',_0x64e5('0x6d'),_0x64e5('0x6e'),_0x64e5('0x6f'),_0x64e5('0x70'),_0x64e5('0x71'),_0x64e5('0x72'),'contractidname',_0x64e5('0x73'),_0x64e5('0x74'),_0x64e5('0x75'),_0x64e5('0x76'),_0x64e5('0x77'),_0x64e5('0x78'),_0x64e5('0x79'),_0x64e5('0x7a'),_0x64e5('0x7b'),_0x64e5('0x7c'),_0x64e5('0x7d'),_0x64e5('0x7e'),'entityimage_timestamp',_0x64e5('0x7f'),_0x64e5('0x80'),'exchangerate',_0x64e5('0x81'),_0x64e5('0x82'),_0x64e5('0x83'),_0x64e5('0x84'),'kbarticleidname',_0x64e5('0x85'),_0x64e5('0x86'),'modifiedbyexternalpartyname',_0x64e5('0x87'),_0x64e5('0x88'),'modifiedbyyominame',_0x64e5('0x89'),_0x64e5('0x8a'),_0x64e5('0x8b'),_0x64e5('0x8c'),_0x64e5('0x8d'),'numberofchildincidents',_0x64e5('0x8e'),_0x64e5('0x8f'),_0x64e5('0x90'),'owneridtype',_0x64e5('0x91'),_0x64e5('0x92'),_0x64e5('0x93'),_0x64e5('0x94'),_0x64e5('0x95'),_0x64e5('0x96'),_0x64e5('0x97'),'resolveby',_0x64e5('0x98'),_0x64e5('0x99'),_0x64e5('0x9a'),_0x64e5('0x9b'),'sentimentvalue',_0x64e5('0x9c'),_0x64e5('0x9d'),_0x64e5('0x9e'),_0x64e5('0x9f'),'statuscode','subjectidname','ticketnumber',_0x64e5('0xa0'),'transactioncurrencyidname','traversedpath',_0x64e5('0xa1'),_0x64e5('0xa2')];var _0x59c92a=_0x486c7b[_0x64e5('0xa3')](_0x554e4c);return db[_0x64e5('0x49')][_0x64e5('0x53')]({'where':{'id':_0x237d03[_0x64e5('0x51')]['id']},'attributes':['id',_0x64e5('0xa4'),'password','remoteUri','tenantId','clientId','clientSecret']})['then'](handleEntityNotFound(_0x28ec8b,null))[_0x64e5('0x1c')](function(_0x58b865){if(_0x58b865){_0x2748d1=_0x58b865[_0x64e5('0xa5')];var _0x2b2fc5=_0x2748d1[_0x64e5('0xa6')](-0x1);if(_0x2b2fc5==='/'){_0x2748d1=_0x2748d1[_0x64e5('0xa7')](0x0,_0x2748d1['lastIndexOf'](_0x2b2fc5));}_0x42a9ee=util['format'](_0x64e5('0xa8'),_0x2748d1);var _0x5996ff={'method':_0x64e5('0xa9'),'uri':_0x64e5('0xaa')+_0x58b865[_0x64e5('0xab')]+'/oauth2/token','form':{'client_id':_0x58b865[_0x64e5('0xac')],'resource':_0x2748d1,'username':_0x58b865['username'],'password':_0x58b865[_0x64e5('0xad')],'grant_type':'password','client_secret':_0x58b865[_0x64e5('0xae')]},'json':!![]};return rp(_0x5996ff);}})[_0x64e5('0x1c')](function(_0x3ebd98){_0x439448=_0x3ebd98[_0x64e5('0xaf')];var _0x242472={'method':_0x64e5('0xb0'),'uri':encodeURI(_0x42a9ee+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x432af8+'\x27'),'headers':{'Authorization':_0x64e5('0xb1')+_0x439448,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x242472);})[_0x64e5('0x1c')](function(_0x4fa291){var _0xc64bff=_0x4fa291[_0x64e5('0xb2')][0x0];var _0xca325a=_0xc64bff['MetadataId'];var _0x181fe6={'method':'GET','uri':_0x42a9ee+_0x64e5('0xb3')+_0xca325a+_0x64e5('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x439448,'If-None-Match':null,'OData-Version':_0x64e5('0xb5')},'json':!![]};return rp(_0x181fe6);})['then'](function(_0x1cc8d6){_0x247642=_0x1cc8d6;_0x114469=_0x247642[_0x64e5('0xb6')];_0x114469=_[_0x64e5('0xb7')](_0x114469,function(_0x1900ee){return!_0x59c92a[_0x64e5('0xb8')](_0x1900ee[_0x64e5('0xb9')]);});var _0x4d9069=[];var _0x1f42ad=[];_0x114469['forEach'](function(_0x2742f6){if(_0x2742f6['@odata.type']){var _0x4d0f4d=_0x2742f6[_0x64e5('0xba')]['substring'](_0x2742f6[_0x64e5('0xba')]['lastIndexOf']('.')+0x1);if(_0x4d0f4d===_0x64e5('0xbb')){_0x4d9069['push'](getSelectList(_0x42a9ee,_0x3caf14,_0x1f42ad,_0x247642[_0x64e5('0xbc')],_0x2742f6[_0x64e5('0xbc')],_0x439448));}}});return Promise['all'](_0x4d9069);})[_0x64e5('0x1c')](function(_0x1c5a3f){_0x5479d0=_0x1c5a3f[0x0];var _0x250b4c=[];var _0x34b443=[];_0x114469['forEach'](function(_0x57a6cc){if(!_[_0x64e5('0xbd')](_0x57a6cc[_0x64e5('0xba')])){var _0x3508f3=_0x57a6cc[_0x64e5('0xba')][_0x64e5('0xa7')](_0x57a6cc[_0x64e5('0xba')][_0x64e5('0xbe')]('.')+0x1);if(_0x3508f3===_0x64e5('0xbf')){_0x250b4c['push'](getBooleanList(_0x42a9ee,_0x3caf14,_0x34b443,_0x247642['MetadataId'],_0x57a6cc[_0x64e5('0xbc')],_0x439448));}}});return Promise[_0x64e5('0xc0')](_0x250b4c);})['then'](function(_0x402a4b){_0x5728ea=_0x402a4b[0x0];var _0x1dd054=[];var _0x1d7b32=[];_0x114469[_0x64e5('0xc1')](function(_0x143b80){if(_0x143b80[_0x64e5('0xba')]){var _0x2930c6=_0x143b80[_0x64e5('0xba')][_0x64e5('0xa7')](_0x143b80[_0x64e5('0xba')][_0x64e5('0xbe')]('.')+0x1);if(_0x2930c6===_0x64e5('0xc2')||_0x2930c6===_0x64e5('0xc3')||_0x2930c6===_0x64e5('0xc4')||_0x2930c6==='IntegerAttributeMetadata'||_0x2930c6==='MemoAttributeMetadata'||_0x2930c6===_0x64e5('0xc5')||_0x2930c6===_0x64e5('0xc6')||_0x2930c6===_0x64e5('0xc7')||_0x2930c6===_0x64e5('0xc8')||_0x2930c6===_0x64e5('0xc9')){_0x1dd054['push'](getInputList(_0x42a9ee,_0x3caf14,_0x2930c6,_0x1d7b32,_0x247642[_0x64e5('0xbc')],_0x143b80['MetadataId'],_0x439448));}}});return Promise[_0x64e5('0xc0')](_0x1dd054);})[_0x64e5('0x1c')](function(_0x5bec9e){_0x927726=_0x5bec9e[0x0];var _0x5abea1=_0x5479d0[_0x64e5('0xa3')](_0x5728ea)[_0x64e5('0xa3')](_0x927726);var _0x558d32={'count':_0x5abea1[_0x64e5('0x40')],'rows':_0x5abea1};return _0x558d32;})[_0x64e5('0x1c')](respondWithResult(_0x28ec8b,null))[_0x64e5('0x26')](function(_0x4bb3fe){var _0x3f3f32=_0x237d03[_0x64e5('0x3a')][_0x64e5('0x19')]?0x1f4:_0x4bb3fe['statusCode']||0x1f4;logger['error'](_0x4bb3fe[_0x64e5('0x32')]);delete _0x4bb3fe[_0x64e5('0x33')];if(_0x3f3f32===0x191){_0x3f3f32=0x190;}_0x28ec8b['status'](_0x3f3f32)[_0x64e5('0x34')](_0x237d03[_0x64e5('0x3a')][_0x64e5('0x19')]?{'message':_0x64e5('0xca'),'statusCode':_0x4bb3fe[_0x64e5('0xcb')]}:_0x4bb3fe);});};function getSelectList(_0x27f60a,_0x3f11e5,_0x495ed6,_0x2efc0b,_0x5978f3,_0x3b7c6b){var _0x55b11d={'method':_0x64e5('0xb0'),'uri':_0x27f60a+_0x64e5('0xb3')+_0x2efc0b+')/Attributes('+_0x5978f3+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x64e5('0xb1')+_0x3b7c6b,'If-None-Match':null,'OData-Version':_0x64e5('0xb5')},'json':!![]};return rp(_0x55b11d)[_0x64e5('0x1c')](function(_0x55f5c5){var _0x4b079d=[];var _0xf1eb49=_0x55f5c5[_0x64e5('0xcc')]['Options'];_0xf1eb49[_0x64e5('0xc1')](function(_0x3acf5e){_0x4b079d[_0x64e5('0xcd')]({'name':_0x3acf5e[_0x64e5('0xce')][_0x64e5('0xcf')][_0x64e5('0xce')],'value':String(_0x3acf5e[_0x64e5('0xd0')])});});var _0x480c5f={'id':_0x3f11e5+'_'+_0x55f5c5['LogicalName'],'name':_0x55f5c5[_0x64e5('0xd1')]['UserLocalizedLabel'][_0x64e5('0xce')],'custom':![],'options':_0x4b079d};_0x495ed6['push'](_0x480c5f);return _0x495ed6;});}function getBooleanList(_0x1f0915,_0x567be1,_0x5f00a1,_0xedd544,_0x3297c8,_0xa13b8){var _0x27dbd8={'method':_0x64e5('0xb0'),'uri':_0x1f0915+'EntityDefinitions('+_0xedd544+_0x64e5('0xd2')+_0x3297c8+_0x64e5('0xd3'),'headers':{'Authorization':_0x64e5('0xb1')+_0xa13b8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x27dbd8)[_0x64e5('0x1c')](function(_0x35b9e7){var _0x5dfbd9=[];_0x5dfbd9[_0x64e5('0xcd')]({'name':_0x35b9e7[_0x64e5('0xcc')][_0x64e5('0xd4')][_0x64e5('0xce')]['UserLocalizedLabel'][_0x64e5('0xce')],'value':_0x64e5('0xd5')},{'name':_0x35b9e7[_0x64e5('0xcc')]['FalseOption'][_0x64e5('0xce')][_0x64e5('0xcf')][_0x64e5('0xce')],'value':_0x64e5('0xd6')});var _0x8340c5={'id':_0x567be1+'_'+_0x35b9e7[_0x64e5('0xb9')],'name':_0x35b9e7['DisplayName'][_0x64e5('0xcf')]['Label'],'custom':![],'options':_0x5dfbd9};_0x5f00a1[_0x64e5('0xcd')](_0x8340c5);return _0x5f00a1;});}function getInputList(_0x146c61,_0x12dd71,_0x301f5c,_0xe144dd,_0x3bb7c3,_0x4e8059,_0x3b6e89){var _0xb635ca={'method':_0x64e5('0xb0'),'uri':_0x146c61+_0x64e5('0xb3')+_0x3bb7c3+_0x64e5('0xd2')+_0x4e8059+_0x64e5('0xd7')+_0x301f5c+_0x64e5('0xd8'),'headers':{'Authorization':_0x64e5('0xb1')+_0x3b6e89,'If-None-Match':null,'OData-Version':_0x64e5('0xb5')},'json':!![]};return rp(_0xb635ca)[_0x64e5('0x1c')](function(_0x389b7a){var _0x3f7e3b={'id':_0x12dd71+'_'+_0x389b7a[_0x64e5('0xb9')],'name':_0x389b7a['DisplayName'][_0x64e5('0xcf')]?_0x389b7a[_0x64e5('0xd1')][_0x64e5('0xcf')]['Label']:_0x389b7a['LogicalName'],'custom':![],'options':[]};_0xe144dd[_0x64e5('0xcd')](_0x3f7e3b);return _0xe144dd;});}
\ No newline at end of file
+var _0xdfef=['order','sort','filters','pick','filter','where','type','VIRTUAL','merge','count','includeAll','include','findAll','show','params','length','options','catch','create','body','find','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridname','owneridtype','owneridyominame','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','tenantId','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','EntityDefinitions(','4.0','Attributes','remove','includes','@odata.type','PicklistAttributeMetadata','push','MetadataId','isNil','substring','BooleanAttributeMetadata','all','forEach','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','send','Wrong\x20credentials','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Bearer\x20','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','destroy','stack','name','index','Dynamics365Account','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x54442f,_0x58012f){var _0x4b7517=function(_0x362cf5){while(--_0x362cf5){_0x54442f['push'](_0x54442f['shift']());}};_0x4b7517(++_0x58012f);}(_0xdfef,0x95));var _0xfdfe=function(_0x30acaa,_0x3972b8){_0x30acaa=_0x30acaa-0x0;var _0x4ec91b=_0xdfef[_0x30acaa];return _0x4ec91b;};'use strict';var pdf=require(_0xfdfe('0x0'));var emlformat=require(_0xfdfe('0x1'));var rimraf=require(_0xfdfe('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdfe('0x3'));var rp=require(_0xfdfe('0x4'));var moment=require(_0xfdfe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfdfe('0x6'));var util=require(_0xfdfe('0x7'));var path=require(_0xfdfe('0x8'));var sox=require(_0xfdfe('0x9'));var csv=require(_0xfdfe('0xa'));var ejs=require(_0xfdfe('0xb'));var fs=require('fs');var _=require(_0xfdfe('0xc'));var squel=require(_0xfdfe('0xd'));var crypto=require(_0xfdfe('0xe'));var jsforce=require(_0xfdfe('0xf'));var deskjs=require(_0xfdfe('0x10'));var toCsv=require(_0xfdfe('0xa'));var querystring=require(_0xfdfe('0x11'));var Papa=require(_0xfdfe('0x12'));var Redis=require(_0xfdfe('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xfdfe('0x14'));var as=require(_0xfdfe('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfdfe('0x16'))(_0xfdfe('0x17'));var utils=require('../../config/utils');var config=require(_0xfdfe('0x18'));var db=require(_0xfdfe('0x19'))['db'];var integrations=require(_0xfdfe('0x1a'));var jayson=require(_0xfdfe('0x1b'));var client=jayson[_0xfdfe('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x1f97ef,_0x3c24ce,_0x94ce85){if(_0x94ce85){var _0xf40e8f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf40e8f[_0xfdfe('0x1d')](_0x3c24ce)){return _0x1f97ef;}else{throw new db['Sequelize']['ValidationError'](_0xfdfe('0x1e'));}}else{return _0x1f97ef;}}function respondWithRpcPromise(_0x479afb,_0x41a355,_0x35a8bd,_0x4f228d){return new BPromise(function(_0x30d0be,_0x14f14f){var _0x21868a=_0x4f228d||client;return _0x21868a[_0xfdfe('0x1f')](_0x479afb,_0x35a8bd)[_0xfdfe('0x20')](function(_0x41d322){logger[_0xfdfe('0x21')](_0xfdfe('0x22'),_0x41a355,_0xfdfe('0x23'));logger[_0xfdfe('0x24')](_0xfdfe('0x25'),_0x41a355,_0xfdfe('0x23'),JSON[_0xfdfe('0x26')](_0x41d322));if(_0x41d322[_0xfdfe('0x27')]){if(_0x41d322[_0xfdfe('0x27')]['code']===0x1f4){logger[_0xfdfe('0x27')](_0xfdfe('0x22'),_0x41a355,_0x41d322[_0xfdfe('0x27')]['message']);return _0x14f14f(_0x41d322[_0xfdfe('0x27')][_0xfdfe('0x28')]);}logger['error'](_0xfdfe('0x22'),_0x41a355,_0x41d322[_0xfdfe('0x27')]['message']);return _0x30d0be(_0x41d322['error'][_0xfdfe('0x28')]);}else{logger['info'](_0xfdfe('0x22'),_0x41a355,_0xfdfe('0x23'));_0x30d0be(_0x41d322[_0xfdfe('0x29')][_0xfdfe('0x28')]);}})['catch'](function(_0x29e56b){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x41a355,_0x29e56b);_0x14f14f(_0x29e56b);});});}function respondWithStatusCode(_0x1a462,_0x241cb7){_0x241cb7=_0x241cb7||0xcc;return function(_0x43576a){if(_0x43576a){return _0x1a462[_0xfdfe('0x2a')](_0x241cb7);}return _0x1a462[_0xfdfe('0x2b')](_0x241cb7)[_0xfdfe('0x2c')]();};}function respondWithResult(_0x2f7266,_0xd2ae34){_0xd2ae34=_0xd2ae34||0xc8;return function(_0x13765f){if(_0x13765f){return _0x2f7266[_0xfdfe('0x2b')](_0xd2ae34)[_0xfdfe('0x2d')](_0x13765f);}};}function respondWithFilteredResult(_0x294875,_0x22896a){return function(_0x1df4f6){if(_0x1df4f6){var _0x86be90=_0x1df4f6['count'],_0x3dc3c1=_0x22896a[_0xfdfe('0x2e')],_0x56ace6=_0x22896a['offset']+_0x22896a[_0xfdfe('0x2f')],_0x480d2e;if(_0x56ace6>=_0x86be90){_0x56ace6=_0x86be90;_0x480d2e=0xc8;}else{_0x480d2e=0xce;}_0x294875[_0xfdfe('0x2b')](_0x480d2e);return _0x294875[_0xfdfe('0x30')](_0xfdfe('0x31'),_0x3dc3c1+'-'+_0x56ace6+'/'+_0x86be90)[_0xfdfe('0x2d')](_0x1df4f6);}return null;};}function patchUpdates(_0xdd4514){return function(_0x5b57c1){try{jsonpatch['apply'](_0x5b57c1,_0xdd4514,!![]);}catch(_0x1c8c07){return BPromise['reject'](_0x1c8c07);}return _0x5b57c1['save']();};}function saveUpdates(_0x54564c,_0x5b3e94){return function(_0x2d0829){if(_0x2d0829){return _0x2d0829['update'](_0x54564c)[_0xfdfe('0x20')](function(_0x1e6eb8){return _0x1e6eb8;});}return null;};}function removeEntity(_0x4e1c0c,_0x11dda0){return function(_0x5a0759){if(_0x5a0759){return _0x5a0759[_0xfdfe('0x32')]()[_0xfdfe('0x20')](function(){_0x4e1c0c[_0xfdfe('0x2b')](0xcc)[_0xfdfe('0x2c')]();});}};}function handleEntityNotFound(_0x29e0d1,_0x3fa3f0){return function(_0x3ec196){if(!_0x3ec196){_0x29e0d1[_0xfdfe('0x2a')](0x194);}return _0x3ec196;};}function handleError(_0x28e460,_0x5573ed){_0x5573ed=_0x5573ed||0x1f4;return function(_0x1005c2){logger['error'](_0x1005c2[_0xfdfe('0x33')]);if(_0x1005c2[_0xfdfe('0x34')]){delete _0x1005c2[_0xfdfe('0x34')];}_0x28e460['status'](_0x5573ed)['send'](_0x1005c2);};}exports[_0xfdfe('0x35')]=function(_0x48c9dc,_0x32fe55){var _0x1140f1={},_0x970be3={},_0xd16694={'count':0x0,'rows':[]};var _0x381ca7=_['map'](db[_0xfdfe('0x36')][_0xfdfe('0x37')],function(_0x408186){return{'name':_0x408186[_0xfdfe('0x38')],'type':_0x408186['type'][_0xfdfe('0x39')]};});_0x970be3[_0xfdfe('0x3a')]=_[_0xfdfe('0x3b')](_0x381ca7,_0xfdfe('0x34'));_0x970be3[_0xfdfe('0x3c')]=_[_0xfdfe('0x3d')](_0x48c9dc[_0xfdfe('0x3c')]);_0x970be3['filters']=_[_0xfdfe('0x3e')](_0x970be3['model'],_0x970be3[_0xfdfe('0x3c')]);_0x1140f1['attributes']=_['intersection'](_0x970be3[_0xfdfe('0x3a')],qs[_0xfdfe('0x3f')](_0x48c9dc[_0xfdfe('0x3c')][_0xfdfe('0x3f')]));_0x1140f1[_0xfdfe('0x40')]=_0x1140f1[_0xfdfe('0x40')]['length']?_0x1140f1[_0xfdfe('0x40')]:_0x970be3[_0xfdfe('0x3a')];if(!_0x48c9dc[_0xfdfe('0x3c')][_0xfdfe('0x41')](_0xfdfe('0x42'))){_0x1140f1['limit']=qs[_0xfdfe('0x2f')](_0x48c9dc['query'][_0xfdfe('0x2f')]);_0x1140f1[_0xfdfe('0x2e')]=qs['offset'](_0x48c9dc[_0xfdfe('0x3c')][_0xfdfe('0x2e')]);}_0x1140f1[_0xfdfe('0x43')]=qs[_0xfdfe('0x44')](_0x48c9dc[_0xfdfe('0x3c')][_0xfdfe('0x44')]);_0x1140f1['where']=qs[_0xfdfe('0x45')](_[_0xfdfe('0x46')](_0x48c9dc[_0xfdfe('0x3c')],_0x970be3['filters']),_0x381ca7);if(_0x48c9dc[_0xfdfe('0x3c')][_0xfdfe('0x47')]){_0x1140f1[_0xfdfe('0x48')]=_['merge'](_0x1140f1['where'],{'$or':_[_0xfdfe('0x3b')](_0x381ca7,function(_0x4eb0c4){if(_0x4eb0c4[_0xfdfe('0x49')]!==_0xfdfe('0x4a')){var _0x1ffe52={};_0x1ffe52[_0x4eb0c4['name']]={'$like':'%'+_0x48c9dc[_0xfdfe('0x3c')][_0xfdfe('0x47')]+'%'};return _0x1ffe52;}})});}_0x1140f1=_[_0xfdfe('0x4b')]({},_0x1140f1,_0x48c9dc['options']);var _0x20a578={'where':_0x1140f1[_0xfdfe('0x48')]};return db['Dynamics365Account'][_0xfdfe('0x4c')](_0x20a578)[_0xfdfe('0x20')](function(_0x4c3ac0){_0xd16694['count']=_0x4c3ac0;if(_0x48c9dc[_0xfdfe('0x3c')][_0xfdfe('0x4d')]){_0x1140f1[_0xfdfe('0x4e')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xfdfe('0x4f')](_0x1140f1);})[_0xfdfe('0x20')](function(_0x5c8ec7){_0xd16694['rows']=_0x5c8ec7;return _0xd16694;})[_0xfdfe('0x20')](respondWithFilteredResult(_0x32fe55,_0x1140f1))['catch'](handleError(_0x32fe55,null));};exports[_0xfdfe('0x50')]=function(_0x4c1a3b,_0x599408){var _0x2adfd={'raw':![],'where':{'id':_0x4c1a3b[_0xfdfe('0x51')]['id']}},_0x23ac06={};_0x23ac06[_0xfdfe('0x3a')]=_[_0xfdfe('0x3d')](db[_0xfdfe('0x36')]['rawAttributes']);_0x23ac06[_0xfdfe('0x3c')]=_['keys'](_0x4c1a3b['query']);_0x23ac06[_0xfdfe('0x45')]=_[_0xfdfe('0x3e')](_0x23ac06[_0xfdfe('0x3a')],_0x23ac06[_0xfdfe('0x3c')]);_0x2adfd['attributes']=_[_0xfdfe('0x3e')](_0x23ac06[_0xfdfe('0x3a')],qs[_0xfdfe('0x3f')](_0x4c1a3b[_0xfdfe('0x3c')]['fields']));_0x2adfd[_0xfdfe('0x40')]=_0x2adfd[_0xfdfe('0x40')][_0xfdfe('0x52')]?_0x2adfd[_0xfdfe('0x40')]:_0x23ac06[_0xfdfe('0x3a')];if(_0x4c1a3b[_0xfdfe('0x3c')]['includeAll']){_0x2adfd[_0xfdfe('0x4e')]=[{'all':!![]}];}_0x2adfd=_['merge']({},_0x2adfd,_0x4c1a3b[_0xfdfe('0x53')]);return db[_0xfdfe('0x36')]['find'](_0x2adfd)[_0xfdfe('0x20')](handleEntityNotFound(_0x599408,null))['then'](respondWithResult(_0x599408,null))[_0xfdfe('0x54')](handleError(_0x599408,null));};exports['create']=function(_0x17c42c,_0x1aed67){return db['Dynamics365Account'][_0xfdfe('0x55')](_0x17c42c[_0xfdfe('0x56')],{})[_0xfdfe('0x20')](respondWithResult(_0x1aed67,0xc9))[_0xfdfe('0x54')](handleError(_0x1aed67,null));};exports['update']=function(_0x5a254f,_0x30df07){if(_0x5a254f[_0xfdfe('0x56')]['id']){delete _0x5a254f[_0xfdfe('0x56')]['id'];}return db['Dynamics365Account'][_0xfdfe('0x57')]({'where':{'id':_0x5a254f['params']['id']}})[_0xfdfe('0x20')](handleEntityNotFound(_0x30df07,null))[_0xfdfe('0x20')](saveUpdates(_0x5a254f[_0xfdfe('0x56')],null))['then'](respondWithResult(_0x30df07,null))[_0xfdfe('0x54')](handleError(_0x30df07,null));};exports[_0xfdfe('0x32')]=function(_0xcbe6fd,_0x2dc2d4){return db[_0xfdfe('0x36')]['find']({'where':{'id':_0xcbe6fd[_0xfdfe('0x51')]['id']}})[_0xfdfe('0x20')](handleEntityNotFound(_0x2dc2d4,null))[_0xfdfe('0x20')](removeEntity(_0x2dc2d4,null))[_0xfdfe('0x54')](handleError(_0x2dc2d4,null));};exports['getConfigurations']=function(_0x491c7e,_0x8fa2c0,_0x3fbafc){var _0x48d590={};var _0x3acd73={};var _0x121dc1;var _0x1833c0;return db['Dynamics365Account'][_0xfdfe('0x58')]({'where':{'id':_0x491c7e['params']['id']}})[_0xfdfe('0x20')](handleEntityNotFound(_0x8fa2c0,null))[_0xfdfe('0x20')](function(_0x3a70d7){if(_0x3a70d7){_0x121dc1=_0x3a70d7;_0x3acd73['model']=_[_0xfdfe('0x3d')](db[_0xfdfe('0x59')][_0xfdfe('0x37')]);_0x3acd73[_0xfdfe('0x3c')]=_[_0xfdfe('0x3d')](_0x491c7e[_0xfdfe('0x3c')]);_0x3acd73[_0xfdfe('0x45')]=_[_0xfdfe('0x3e')](_0x3acd73[_0xfdfe('0x3a')],_0x3acd73[_0xfdfe('0x3c')]);_0x48d590[_0xfdfe('0x40')]=_['intersection'](_0x3acd73[_0xfdfe('0x3a')],qs[_0xfdfe('0x3f')](_0x491c7e['query'][_0xfdfe('0x3f')]));_0x48d590[_0xfdfe('0x40')]=_0x48d590[_0xfdfe('0x40')][_0xfdfe('0x52')]?_0x48d590[_0xfdfe('0x40')]:_0x3acd73[_0xfdfe('0x3a')];_0x48d590['order']=qs[_0xfdfe('0x44')](_0x491c7e[_0xfdfe('0x3c')][_0xfdfe('0x44')]);_0x48d590[_0xfdfe('0x48')]=qs[_0xfdfe('0x45')](_[_0xfdfe('0x46')](_0x491c7e[_0xfdfe('0x3c')],_0x3acd73[_0xfdfe('0x45')]));if(_0x491c7e[_0xfdfe('0x3c')][_0xfdfe('0x47')]){_0x48d590[_0xfdfe('0x48')]=_[_0xfdfe('0x4b')](_0x48d590[_0xfdfe('0x48')],{'$or':_[_0xfdfe('0x3b')](_0x48d590[_0xfdfe('0x40')],function(_0x91714b){var _0x453e78={};_0x453e78[_0x91714b]={'$like':'%'+_0x491c7e[_0xfdfe('0x3c')]['filter']+'%'};return _0x453e78;})});}_0x48d590=_[_0xfdfe('0x4b')]({},_0x48d590,_0x491c7e[_0xfdfe('0x53')]);return _0x121dc1['getConfigurations'](_0x48d590);}})[_0xfdfe('0x20')](function(_0x2a21ff){if(_0x2a21ff){_0x1833c0=_0x2a21ff['length'];if(!_0x491c7e[_0xfdfe('0x3c')]['hasOwnProperty'](_0xfdfe('0x42'))){_0x48d590[_0xfdfe('0x2f')]=qs[_0xfdfe('0x2f')](_0x491c7e[_0xfdfe('0x3c')]['limit']);_0x48d590['offset']=qs[_0xfdfe('0x2e')](_0x491c7e[_0xfdfe('0x3c')][_0xfdfe('0x2e')]);}return _0x121dc1[_0xfdfe('0x5a')](_0x48d590);}})['then'](function(_0x54297a){if(_0x54297a){return _0x54297a?{'count':_0x1833c0,'rows':_0x54297a}:null;}})[_0xfdfe('0x20')](respondWithResult(_0x8fa2c0,null))[_0xfdfe('0x54')](handleError(_0x8fa2c0,null));};exports[_0xfdfe('0x5b')]=function(_0x317c3e,_0x5f1e25,_0x1a7293){if(_0x317c3e[_0xfdfe('0x56')]['id']){delete _0x317c3e['body']['id'];}return db[_0xfdfe('0x36')][_0xfdfe('0x58')]({'where':{'id':_0x317c3e[_0xfdfe('0x51')]['id']}})[_0xfdfe('0x20')](handleEntityNotFound(_0x5f1e25,null))[_0xfdfe('0x20')](function(_0x395689){if(_0x395689){_0x317c3e[_0xfdfe('0x56')]['AccountId']=_0x395689['id'];_0x317c3e[_0xfdfe('0x56')][_0xfdfe('0x5c')]=integrations[_0xfdfe('0x5d')](_0x317c3e['body'][_0xfdfe('0x5e')],_0x317c3e[_0xfdfe('0x56')][_0xfdfe('0x49')]);_0x317c3e[_0xfdfe('0x56')][_0xfdfe('0x5f')]=integrations[_0xfdfe('0x60')](_0x317c3e['body']['channel'],_0x317c3e['body']['type']);return db[_0xfdfe('0x59')][_0xfdfe('0x55')](_0x317c3e['body'],{'include':[{'model':db[_0xfdfe('0x61')],'as':_0xfdfe('0x5c')},{'model':db[_0xfdfe('0x61')],'as':_0xfdfe('0x5f')}]});}return null;})['then'](respondWithResult(_0x5f1e25,null))['catch'](handleError(_0x5f1e25,null));};exports[_0xfdfe('0x62')]=function(_0x1d83a8,_0x467942,_0x1db17b){var _0x41a62e=_0x1d83a8[_0xfdfe('0x3c')][_0xfdfe('0x63')];var _0x5a3233=_0x41a62e===_0xfdfe('0x64')?_0xfdfe('0x65'):'PhoneCall';var _0x4106ee='';var _0x2a7be2='';var _0x5b06c8='';var _0x4e8aea='';var _0x1adc32='';var _0x435112='';var _0xd64aa3='';var _0x26e36b='';var _0x168d8c=[_0xfdfe('0x66'),_0xfdfe('0x67'),_0xfdfe('0x68'),_0xfdfe('0x69'),'caseorigincode','subject',_0xfdfe('0x6a'),'regardingobjectid',_0xfdfe('0x6b'),'phonecall_activity_parties'];var _0x1dce0f=[_0xfdfe('0x6c'),_0xfdfe('0x6d'),_0xfdfe('0x6e'),_0xfdfe('0x6f'),_0xfdfe('0x70'),_0xfdfe('0x71'),_0xfdfe('0x72'),_0xfdfe('0x73'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0xfdfe('0x74'),_0xfdfe('0x75'),_0xfdfe('0x76'),_0xfdfe('0x77'),_0xfdfe('0x78'),'customeridname',_0xfdfe('0x79'),_0xfdfe('0x7a'),_0xfdfe('0x7b'),'entitlementidname',_0xfdfe('0x7c'),_0xfdfe('0x7d'),_0xfdfe('0x7e'),_0xfdfe('0x7f'),_0xfdfe('0x80'),_0xfdfe('0x81'),_0xfdfe('0x82'),_0xfdfe('0x83'),'kbarticleidname',_0xfdfe('0x84'),'masteridname',_0xfdfe('0x85'),_0xfdfe('0x86'),_0xfdfe('0x87'),'modifiedbyyominame',_0xfdfe('0x88'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0xfdfe('0x89'),_0xfdfe('0x8a'),'numberofchildincidents',_0xfdfe('0x8b'),'overriddencreatedon',_0xfdfe('0x8c'),_0xfdfe('0x8d'),_0xfdfe('0x8e'),'parentcaseidname','primarycontactidname','primarycontactidyominame',_0xfdfe('0x8f'),'productidname',_0xfdfe('0x90'),'resolveby',_0xfdfe('0x91'),_0xfdfe('0x92'),_0xfdfe('0x93'),_0xfdfe('0x94'),'sentimentvalue',_0xfdfe('0x95'),_0xfdfe('0x96'),_0xfdfe('0x97'),_0xfdfe('0x98'),'statuscode',_0xfdfe('0x99'),_0xfdfe('0x9a'),'timezoneruleversionnumber',_0xfdfe('0x9b'),_0xfdfe('0x9c'),_0xfdfe('0x9d'),_0xfdfe('0x9e')];var _0x93915c=_0x168d8c[_0xfdfe('0x9f')](_0x1dce0f);return db[_0xfdfe('0x36')][_0xfdfe('0x58')]({'where':{'id':_0x1d83a8[_0xfdfe('0x51')]['id']},'attributes':['id',_0xfdfe('0xa0'),'password',_0xfdfe('0xa1'),'tenantId',_0xfdfe('0xa2'),_0xfdfe('0xa3')]})[_0xfdfe('0x20')](handleEntityNotFound(_0x467942,null))[_0xfdfe('0x20')](function(_0x4d980e){if(_0x4d980e){_0x26e36b=_0x4d980e[_0xfdfe('0xa1')];var _0x2cc65b=_0x26e36b[_0xfdfe('0xa4')](-0x1);if(_0x2cc65b==='/'){_0x26e36b=_0x26e36b['substring'](0x0,_0x26e36b[_0xfdfe('0xa5')](_0x2cc65b));}_0xd64aa3=util[_0xfdfe('0xa6')](_0xfdfe('0xa7'),_0x26e36b);var _0x7091c1={'method':_0xfdfe('0xa8'),'uri':'https://login.microsoftonline.com/'+_0x4d980e[_0xfdfe('0xa9')]+_0xfdfe('0xaa'),'form':{'client_id':_0x4d980e[_0xfdfe('0xa2')],'resource':_0x26e36b,'username':_0x4d980e[_0xfdfe('0xa0')],'password':_0x4d980e['password'],'grant_type':_0xfdfe('0xab'),'client_secret':_0x4d980e[_0xfdfe('0xa3')]},'json':!![]};return rp(_0x7091c1);}})[_0xfdfe('0x20')](function(_0x192807){_0x435112=_0x192807[_0xfdfe('0xac')];var _0x3ead41={'method':_0xfdfe('0xad'),'uri':encodeURI(_0xd64aa3+_0xfdfe('0xae')+_0x5a3233+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x435112,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3ead41);})[_0xfdfe('0x20')](function(_0x5f57a7){var _0x56266b=_0x5f57a7['value'][0x0];var _0x285664=_0x56266b['MetadataId'];var _0x1ba88b={'method':_0xfdfe('0xad'),'uri':_0xd64aa3+_0xfdfe('0xaf')+_0x285664+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x435112,'If-None-Match':null,'OData-Version':_0xfdfe('0xb0')},'json':!![]};return rp(_0x1ba88b);})[_0xfdfe('0x20')](function(_0x227320){_0x4106ee=_0x227320;_0x2a7be2=_0x4106ee[_0xfdfe('0xb1')];_0x2a7be2=_[_0xfdfe('0xb2')](_0x2a7be2,function(_0x25cf50){return!_0x93915c[_0xfdfe('0xb3')](_0x25cf50['LogicalName']);});var _0x3a8eb3=[];var _0x41e750=[];_0x2a7be2['forEach'](function(_0x5bf418){if(_0x5bf418[_0xfdfe('0xb4')]){var _0x3773b3=_0x5bf418[_0xfdfe('0xb4')]['substring'](_0x5bf418['@odata.type'][_0xfdfe('0xa5')]('.')+0x1);if(_0x3773b3===_0xfdfe('0xb5')){_0x3a8eb3[_0xfdfe('0xb6')](getSelectList(_0xd64aa3,_0x41a62e,_0x41e750,_0x4106ee[_0xfdfe('0xb7')],_0x5bf418[_0xfdfe('0xb7')],_0x435112));}}});return Promise['all'](_0x3a8eb3);})[_0xfdfe('0x20')](function(_0x1a71b9){_0x5b06c8=_0x1a71b9[0x0];var _0x55fba1=[];var _0x459c68=[];_0x2a7be2['forEach'](function(_0x180f17){if(!_[_0xfdfe('0xb8')](_0x180f17[_0xfdfe('0xb4')])){var _0x398f5d=_0x180f17[_0xfdfe('0xb4')][_0xfdfe('0xb9')](_0x180f17['@odata.type']['lastIndexOf']('.')+0x1);if(_0x398f5d===_0xfdfe('0xba')){_0x55fba1['push'](getBooleanList(_0xd64aa3,_0x41a62e,_0x459c68,_0x4106ee['MetadataId'],_0x180f17[_0xfdfe('0xb7')],_0x435112));}}});return Promise[_0xfdfe('0xbb')](_0x55fba1);})[_0xfdfe('0x20')](function(_0x4f64b6){_0x4e8aea=_0x4f64b6[0x0];var _0x597720=[];var _0x53b87b=[];_0x2a7be2[_0xfdfe('0xbc')](function(_0x5c9083){if(_0x5c9083[_0xfdfe('0xb4')]){var _0x7b9fee=_0x5c9083['@odata.type']['substring'](_0x5c9083[_0xfdfe('0xb4')][_0xfdfe('0xa5')]('.')+0x1);if(_0x7b9fee===_0xfdfe('0xbd')||_0x7b9fee===_0xfdfe('0xbe')||_0x7b9fee===_0xfdfe('0xbf')||_0x7b9fee===_0xfdfe('0xc0')||_0x7b9fee==='MemoAttributeMetadata'||_0x7b9fee===_0xfdfe('0xc1')||_0x7b9fee==='StatusAttributeMetadata'||_0x7b9fee===_0xfdfe('0xc2')||_0x7b9fee===_0xfdfe('0xc3')||_0x7b9fee===_0xfdfe('0xc4')){_0x597720[_0xfdfe('0xb6')](getInputList(_0xd64aa3,_0x41a62e,_0x7b9fee,_0x53b87b,_0x4106ee['MetadataId'],_0x5c9083['MetadataId'],_0x435112));}}});return Promise[_0xfdfe('0xbb')](_0x597720);})[_0xfdfe('0x20')](function(_0x22c94a){_0x1adc32=_0x22c94a[0x0];var _0x2ee53c=_0x5b06c8['concat'](_0x4e8aea)[_0xfdfe('0x9f')](_0x1adc32);var _0x225b12={'count':_0x2ee53c['length'],'rows':_0x2ee53c};return _0x225b12;})[_0xfdfe('0x20')](respondWithResult(_0x467942,null))[_0xfdfe('0x54')](function(_0x56ea86){var _0x3b00cd=_0x1d83a8['query'][_0xfdfe('0x1d')]?0x1f4:_0x56ea86['statusCode']||0x1f4;logger[_0xfdfe('0x27')](_0x56ea86[_0xfdfe('0x33')]);delete _0x56ea86[_0xfdfe('0x34')];if(_0x3b00cd===0x191){_0x3b00cd=0x190;}_0x467942['status'](_0x3b00cd)[_0xfdfe('0xc5')](_0x1d83a8['query'][_0xfdfe('0x1d')]?{'message':_0xfdfe('0xc6'),'statusCode':_0x56ea86[_0xfdfe('0xc7')]}:_0x56ea86);});};function getSelectList(_0xb4d435,_0x5f1556,_0xd064b4,_0x1ee46b,_0xd88b11,_0x3e421a){var _0x1b1727={'method':_0xfdfe('0xad'),'uri':_0xb4d435+_0xfdfe('0xaf')+_0x1ee46b+')/Attributes('+_0xd88b11+_0xfdfe('0xc8')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xfdfe('0xc9')+_0x3e421a,'If-None-Match':null,'OData-Version':_0xfdfe('0xb0')},'json':!![]};return rp(_0x1b1727)['then'](function(_0xb994f6){var _0x45768e=[];var _0x453014=_0xb994f6[_0xfdfe('0xca')][_0xfdfe('0xcb')];_0x453014[_0xfdfe('0xbc')](function(_0x463b89){_0x45768e['push']({'name':_0x463b89[_0xfdfe('0xcc')][_0xfdfe('0xcd')][_0xfdfe('0xcc')],'value':String(_0x463b89[_0xfdfe('0xce')])});});var _0x4a78d5={'id':_0x5f1556+'_'+_0xb994f6[_0xfdfe('0xcf')],'name':_0xb994f6['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x45768e};_0xd064b4[_0xfdfe('0xb6')](_0x4a78d5);return _0xd064b4;});}function getBooleanList(_0x320b80,_0x979bd1,_0x128730,_0x3994a4,_0x4f9499,_0x499b20){var _0x597faf={'method':_0xfdfe('0xad'),'uri':_0x320b80+_0xfdfe('0xaf')+_0x3994a4+_0xfdfe('0xd0')+_0x4f9499+_0xfdfe('0xd1'),'headers':{'Authorization':_0xfdfe('0xc9')+_0x499b20,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x597faf)['then'](function(_0x5a23b3){var _0x38389a=[];_0x38389a[_0xfdfe('0xb6')]({'name':_0x5a23b3[_0xfdfe('0xca')][_0xfdfe('0xd2')][_0xfdfe('0xcc')][_0xfdfe('0xcd')][_0xfdfe('0xcc')],'value':_0xfdfe('0xd3')},{'name':_0x5a23b3[_0xfdfe('0xca')][_0xfdfe('0xd4')][_0xfdfe('0xcc')][_0xfdfe('0xcd')][_0xfdfe('0xcc')],'value':_0xfdfe('0xd5')});var _0x762612={'id':_0x979bd1+'_'+_0x5a23b3[_0xfdfe('0xcf')],'name':_0x5a23b3[_0xfdfe('0xd6')][_0xfdfe('0xcd')][_0xfdfe('0xcc')],'custom':![],'options':_0x38389a};_0x128730[_0xfdfe('0xb6')](_0x762612);return _0x128730;});}function getInputList(_0x1b9e9c,_0x2e06e8,_0x3212d1,_0x2f961b,_0x7b3eda,_0xba4044,_0x4dd1b6){var _0x5a7d5f={'method':_0xfdfe('0xad'),'uri':_0x1b9e9c+_0xfdfe('0xaf')+_0x7b3eda+_0xfdfe('0xd0')+_0xba4044+')/Microsoft.Dynamics.CRM.'+_0x3212d1+_0xfdfe('0xd7'),'headers':{'Authorization':_0xfdfe('0xc9')+_0x4dd1b6,'If-None-Match':null,'OData-Version':_0xfdfe('0xb0')},'json':!![]};return rp(_0x5a7d5f)[_0xfdfe('0x20')](function(_0x473d1d){var _0x29b6c1={'id':_0x2e06e8+'_'+_0x473d1d[_0xfdfe('0xcf')],'name':_0x473d1d[_0xfdfe('0xd6')][_0xfdfe('0xcd')]?_0x473d1d[_0xfdfe('0xd6')][_0xfdfe('0xcd')][_0xfdfe('0xcc')]:_0x473d1d[_0xfdfe('0xcf')],'custom':![],'options':[]};_0x2f961b[_0xfdfe('0xb6')](_0x29b6c1);return _0x2f961b;});}
\ No newline at end of file
index 5b8b909..caaf4d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf53a=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Dynamics365Account','int_dynamics365_accounts','util','../../config/logger'];(function(_0x2dba92,_0x3866cf){var _0x531f44=function(_0x2dc925){while(--_0x2dc925){_0x2dba92['push'](_0x2dba92['shift']());}};_0x531f44(++_0x3866cf);}(_0xf53a,0xa3));var _0xaf53=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xf53a[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0xaf53('0x0'));var logger=require(_0xaf53('0x1'))(_0xaf53('0x2'));var moment=require(_0xaf53('0x3'));var BPromise=require(_0xaf53('0x4'));var rp=require(_0xaf53('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf53('0x6'));var config=require(_0xaf53('0x7'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x57a24d,_0x4337c4){return _0x57a24d[_0xaf53('0x8')](_0xaf53('0x9'),attributes,{'tableName':_0xaf53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e78=['../../components/integrations/configuration','exports','Dynamics365Account','util','../../config/logger','api','bluebird','request-promise','rimraf','./intDynamics365Account.attributes'];(function(_0x22f658,_0x3fbe14){var _0x5ac5db=function(_0x4870be){while(--_0x4870be){_0x22f658['push'](_0x22f658['shift']());}};_0x5ac5db(++_0x3fbe14);}(_0x6e78,0x143));var _0x86e7=function(_0x11128e,_0x2799a3){_0x11128e=_0x11128e-0x0;var _0x509ca2=_0x6e78[_0x11128e];return _0x509ca2;};'use strict';var _=require('lodash');var util=require(_0x86e7('0x0'));var logger=require(_0x86e7('0x1'))(_0x86e7('0x2'));var moment=require('moment');var BPromise=require(_0x86e7('0x3'));var rp=require(_0x86e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86e7('0x5'));var config=require('../../config/environment');var attributes=require(_0x86e7('0x6'));var integrations=require(_0x86e7('0x7'));module[_0x86e7('0x8')]=function(_0x5be236,_0x5950aa){return _0x5be236['define'](_0x86e7('0x9'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 205093e..3918673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9300=['debug','stringify','error','message','request\x20sent','result','Dynamics365Account','options','where','attributes','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account','find','raw','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0xa4e1d2,_0x54c864){var _0x50dc8c=function(_0x5eab1a){while(--_0x5eab1a){_0xa4e1d2['push'](_0xa4e1d2['shift']());}};_0x50dc8c(++_0x54c864);}(_0x9300,0x153));var _0x0930=function(_0x12d79d,_0x3c4f12){_0x12d79d=_0x12d79d-0x0;var _0x5cbe01=_0x9300[_0x12d79d];return _0x5cbe01;};'use strict';var _=require(_0x0930('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0930('0x1'));var rs=require(_0x0930('0x2'));var fs=require('fs');var Redis=require(_0x0930('0x3'));var db=require(_0x0930('0x4'))['db'];var utils=require(_0x0930('0x5'));var logger=require('../../config/logger')(_0x0930('0x6'));var config=require(_0x0930('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0930('0x8')][_0x0930('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45705a,_0x34c693,_0x2c0f94){return new BPromise(function(_0x1ec24f,_0x5bc3df){return client['request'](_0x45705a,_0x2c0f94)[_0x0930('0xa')](function(_0x4b1994){logger[_0x0930('0xb')](_0x0930('0xc'),_0x34c693,'request\x20sent');logger[_0x0930('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x34c693,'request\x20sent',JSON[_0x0930('0xe')](_0x4b1994));if(_0x4b1994[_0x0930('0xf')]){if(_0x4b1994['error']['code']===0x1f4){logger[_0x0930('0xf')](_0x0930('0xc'),_0x34c693,_0x4b1994[_0x0930('0xf')][_0x0930('0x10')]);return _0x5bc3df(_0x4b1994[_0x0930('0xf')][_0x0930('0x10')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x34c693,_0x4b1994['error'][_0x0930('0x10')]);return _0x1ec24f(_0x4b1994['error'][_0x0930('0x10')]);}else{logger[_0x0930('0xb')](_0x0930('0xc'),_0x34c693,_0x0930('0x11'));_0x1ec24f(_0x4b1994[_0x0930('0x12')][_0x0930('0x10')]);}})['catch'](function(_0x3ec27b){logger[_0x0930('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x34c693,_0x3ec27b);_0x5bc3df(_0x3ec27b);});});}exports['GetDynamics365Account']=function(_0x87318c){var _0xc7059=this;return new Promise(function(_0x469be7,_0x231a4c){return db[_0x0930('0x13')]['findAll']({'raw':_0x87318c[_0x0930('0x14')]?_0x87318c[_0x0930('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x87318c[_0x0930('0x14')]?_0x87318c[_0x0930('0x14')][_0x0930('0x15')]||null:null,'attributes':_0x87318c[_0x0930('0x14')]?_0x87318c[_0x0930('0x14')][_0x0930('0x16')]||null:null,'limit':_0x87318c['options']?_0x87318c['options'][_0x0930('0x17')]||null:null,'include':_0x87318c['options']?_0x87318c[_0x0930('0x14')][_0x0930('0x18')]?_[_0x0930('0x19')](_0x87318c[_0x0930('0x14')][_0x0930('0x18')],function(_0x48bdf5){return{'model':db[_0x48bdf5[_0x0930('0x1a')]],'as':_0x48bdf5['as'],'attributes':_0x48bdf5[_0x0930('0x16')],'include':_0x48bdf5['include']?_['map'](_0x48bdf5[_0x0930('0x18')],function(_0x8f676a){return{'model':db[_0x8f676a[_0x0930('0x1a')]],'as':_0x8f676a['as'],'attributes':_0x8f676a[_0x0930('0x16')],'include':_0x8f676a[_0x0930('0x18')]?_[_0x0930('0x19')](_0x8f676a['include'],function(_0x191333){return{'model':db[_0x191333[_0x0930('0x1a')]],'as':_0x191333['as'],'attributes':_0x191333[_0x0930('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0930('0xa')](function(_0x367064){logger[_0x0930('0xb')](_0x0930('0x1b'),_0x87318c);logger[_0x0930('0xd')](_0x0930('0x1b'),_0x87318c,JSON[_0x0930('0xe')](_0x367064));_0x469be7(_0x367064);})['catch'](function(_0x2a47f2){logger['error'](_0x0930('0x1b'),_0x2a47f2[_0x0930('0x10')],_0x87318c);_0x231a4c(_0xc7059[_0x0930('0xf')](0x1f4,_0x2a47f2['message']));});});};exports[_0x0930('0x1c')]=function(_0x4cee01){var _0x4f3475=this;return new Promise(function(_0x2bf0bb,_0x5b0bfb){return db[_0x0930('0x13')][_0x0930('0x1d')]({'raw':_0x4cee01[_0x0930('0x14')]?_0x4cee01[_0x0930('0x14')][_0x0930('0x1e')]===undefined?!![]:![]:!![],'where':_0x4cee01[_0x0930('0x14')]?_0x4cee01['options']['where']||null:null,'attributes':_0x4cee01[_0x0930('0x14')]?_0x4cee01[_0x0930('0x14')][_0x0930('0x16')]||null:null,'include':_0x4cee01[_0x0930('0x14')]?_0x4cee01[_0x0930('0x14')][_0x0930('0x18')]?_[_0x0930('0x19')](_0x4cee01[_0x0930('0x14')]['include'],function(_0x336f87){return{'model':db[_0x336f87[_0x0930('0x1a')]],'as':_0x336f87['as'],'attributes':_0x336f87[_0x0930('0x16')],'include':_0x336f87[_0x0930('0x18')]?_['map'](_0x336f87[_0x0930('0x18')],function(_0x1d0788){return{'model':db[_0x1d0788[_0x0930('0x1a')]],'as':_0x1d0788['as'],'attributes':_0x1d0788[_0x0930('0x16')],'include':_0x1d0788[_0x0930('0x18')]?_['map'](_0x1d0788['include'],function(_0xc121e5){return{'model':db[_0xc121e5[_0x0930('0x1a')]],'as':_0xc121e5['as'],'attributes':_0xc121e5[_0x0930('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0930('0xa')](function(_0x39ee2a){logger[_0x0930('0xb')](_0x0930('0x1c'),_0x4cee01);logger[_0x0930('0xd')](_0x0930('0x1c'),_0x4cee01,JSON['stringify'](_0x39ee2a));_0x2bf0bb(_0x39ee2a);})[_0x0930('0x1f')](function(_0x46b884){logger[_0x0930('0xf')](_0x0930('0x1c'),_0x46b884[_0x0930('0x10')],_0x4cee01);_0x5b0bfb(_0x4f3475[_0x0930('0xf')](0x1f4,_0x46b884[_0x0930('0x10')]));});});};
\ No newline at end of file
+var _0x9576=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','GetDynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowDynamics365Account'];(function(_0x18c6ec,_0x27f083){var _0x3c2367=function(_0x8f3201){while(--_0x8f3201){_0x18c6ec['push'](_0x18c6ec['shift']());}};_0x3c2367(++_0x27f083);}(_0x9576,0x182));var _0x6957=function(_0x53fd4d,_0x53226d){_0x53fd4d=_0x53fd4d-0x0;var _0x14a43d=_0x9576[_0x53fd4d];return _0x14a43d;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var moment=require(_0x6957('0x2'));var BPromise=require(_0x6957('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6957('0x4'))['db'];var utils=require(_0x6957('0x5'));var logger=require(_0x6957('0x6'))(_0x6957('0x7'));var config=require(_0x6957('0x8'));var jayson=require(_0x6957('0x9'));var client=jayson[_0x6957('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6d8af8,_0x3425fe,_0x70b8c4){return new BPromise(function(_0x2e5727,_0x6397fe){return client[_0x6957('0xb')](_0x6d8af8,_0x70b8c4)['then'](function(_0x28a4c6){logger[_0x6957('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x3425fe,'request\x20sent');logger[_0x6957('0xd')](_0x6957('0xe'),_0x3425fe,_0x6957('0xf'),JSON[_0x6957('0x10')](_0x28a4c6));if(_0x28a4c6[_0x6957('0x11')]){if(_0x28a4c6[_0x6957('0x11')][_0x6957('0x12')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x3425fe,_0x28a4c6['error'][_0x6957('0x13')]);return _0x6397fe(_0x28a4c6[_0x6957('0x11')][_0x6957('0x13')]);}logger[_0x6957('0x11')](_0x6957('0x14'),_0x3425fe,_0x28a4c6[_0x6957('0x11')][_0x6957('0x13')]);return _0x2e5727(_0x28a4c6['error']['message']);}else{logger['info'](_0x6957('0x14'),_0x3425fe,_0x6957('0xf'));_0x2e5727(_0x28a4c6[_0x6957('0x15')][_0x6957('0x13')]);}})['catch'](function(_0x14422d){logger['error'](_0x6957('0x14'),_0x3425fe,_0x14422d);_0x6397fe(_0x14422d);});});}exports[_0x6957('0x16')]=function(_0x49aa31){var _0x2ccd8e=this;return new Promise(function(_0x448ff6,_0x26b577){return db['Dynamics365Account'][_0x6957('0x17')]({'raw':_0x49aa31[_0x6957('0x18')]?_0x49aa31[_0x6957('0x18')][_0x6957('0x19')]===undefined?!![]:![]:!![],'where':_0x49aa31[_0x6957('0x18')]?_0x49aa31[_0x6957('0x18')][_0x6957('0x1a')]||null:null,'attributes':_0x49aa31[_0x6957('0x18')]?_0x49aa31['options']['attributes']||null:null,'limit':_0x49aa31[_0x6957('0x18')]?_0x49aa31[_0x6957('0x18')][_0x6957('0x1b')]||null:null,'include':_0x49aa31[_0x6957('0x18')]?_0x49aa31[_0x6957('0x18')][_0x6957('0x1c')]?_[_0x6957('0x1d')](_0x49aa31[_0x6957('0x18')]['include'],function(_0x2b2dcd){return{'model':db[_0x2b2dcd[_0x6957('0x1e')]],'as':_0x2b2dcd['as'],'attributes':_0x2b2dcd[_0x6957('0x1f')],'include':_0x2b2dcd[_0x6957('0x1c')]?_['map'](_0x2b2dcd['include'],function(_0xa1e6af){return{'model':db[_0xa1e6af[_0x6957('0x1e')]],'as':_0xa1e6af['as'],'attributes':_0xa1e6af['attributes'],'include':_0xa1e6af['include']?_[_0x6957('0x1d')](_0xa1e6af[_0x6957('0x1c')],function(_0x3bc22f){return{'model':db[_0x3bc22f['model']],'as':_0x3bc22f['as'],'attributes':_0x3bc22f[_0x6957('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6957('0x20')](function(_0x35ba67){logger[_0x6957('0xc')](_0x6957('0x16'),_0x49aa31);logger[_0x6957('0xd')](_0x6957('0x16'),_0x49aa31,JSON[_0x6957('0x10')](_0x35ba67));_0x448ff6(_0x35ba67);})['catch'](function(_0x2e7fe1){logger[_0x6957('0x11')](_0x6957('0x16'),_0x2e7fe1[_0x6957('0x13')],_0x49aa31);_0x26b577(_0x2ccd8e[_0x6957('0x11')](0x1f4,_0x2e7fe1[_0x6957('0x13')]));});});};exports[_0x6957('0x21')]=function(_0xef7f63){var _0x1300b1=this;return new Promise(function(_0x28994a,_0x3de770){return db['Dynamics365Account']['find']({'raw':_0xef7f63[_0x6957('0x18')]?_0xef7f63[_0x6957('0x18')][_0x6957('0x19')]===undefined?!![]:![]:!![],'where':_0xef7f63[_0x6957('0x18')]?_0xef7f63['options'][_0x6957('0x1a')]||null:null,'attributes':_0xef7f63[_0x6957('0x18')]?_0xef7f63[_0x6957('0x18')]['attributes']||null:null,'include':_0xef7f63['options']?_0xef7f63[_0x6957('0x18')][_0x6957('0x1c')]?_[_0x6957('0x1d')](_0xef7f63['options'][_0x6957('0x1c')],function(_0x1d40a7){return{'model':db[_0x1d40a7[_0x6957('0x1e')]],'as':_0x1d40a7['as'],'attributes':_0x1d40a7[_0x6957('0x1f')],'include':_0x1d40a7[_0x6957('0x1c')]?_[_0x6957('0x1d')](_0x1d40a7[_0x6957('0x1c')],function(_0xcbfba9){return{'model':db[_0xcbfba9[_0x6957('0x1e')]],'as':_0xcbfba9['as'],'attributes':_0xcbfba9['attributes'],'include':_0xcbfba9[_0x6957('0x1c')]?_[_0x6957('0x1d')](_0xcbfba9[_0x6957('0x1c')],function(_0x5edcae){return{'model':db[_0x5edcae['model']],'as':_0x5edcae['as'],'attributes':_0x5edcae['attributes']};}):[]};}):[]};}):[]:[]})[_0x6957('0x20')](function(_0x59a58e){logger['info'](_0x6957('0x21'),_0xef7f63);logger[_0x6957('0xd')]('ShowDynamics365Account',_0xef7f63,JSON['stringify'](_0x59a58e));_0x28994a(_0x59a58e);})[_0x6957('0x22')](function(_0x1fa233){logger[_0x6957('0x11')](_0x6957('0x21'),_0x1fa233[_0x6957('0x13')],_0xef7f63);_0x3de770(_0x1300b1['error'](0x1f4,_0x1fa233[_0x6957('0x13')]));});});};
\ No newline at end of file
index d93a988..93ae31f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62ae=['put','/:id','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x243f5d,_0x258d5f){var _0x286038=function(_0x5d818a){while(--_0x5d818a){_0x243f5d['push'](_0x243f5d['shift']());}};_0x286038(++_0x258d5f);}(_0x62ae,0x1b6));var _0xe62a=function(_0x264855,_0x8022d0){_0x264855=_0x264855-0x0;var _0x4d7102=_0x62ae[_0x264855];return _0x4d7102;};'use strict';var multer=require('multer');var util=require(_0xe62a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe62a('0x1'));var router=express[_0xe62a('0x2')]();var auth=require(_0xe62a('0x3'));var interaction=require(_0xe62a('0x4'));var config=require(_0xe62a('0x5'));var controller=require(_0xe62a('0x6'));router[_0xe62a('0x7')]('/',auth[_0xe62a('0x8')](),controller[_0xe62a('0x9')]);router[_0xe62a('0x7')]('/:id',auth[_0xe62a('0x8')](),controller[_0xe62a('0xa')]);router['get'](_0xe62a('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0xe62a('0x7')](_0xe62a('0xc'),auth[_0xe62a('0x8')](),controller[_0xe62a('0xd')]);router[_0xe62a('0x7')](_0xe62a('0xe'),auth[_0xe62a('0x8')](),controller[_0xe62a('0xf')]);router[_0xe62a('0x10')]('/',auth[_0xe62a('0x8')](),controller[_0xe62a('0x11')]);router[_0xe62a('0x12')](_0xe62a('0x13'),auth[_0xe62a('0x8')](),controller[_0xe62a('0x14')]);router[_0xe62a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xe62a('0x16')]);module[_0xe62a('0x17')]=router;
\ No newline at end of file
+var _0x8b38=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x1badc1,_0x19fd91){var _0x37e23d=function(_0x2a4983){while(--_0x2a4983){_0x1badc1['push'](_0x1badc1['shift']());}};_0x37e23d(++_0x19fd91);}(_0x8b38,0xf8));var _0x88b3=function(_0x18b2a3,_0x2a639b){_0x18b2a3=_0x18b2a3-0x0;var _0x50659f=_0x8b38[_0x18b2a3];return _0x50659f;};'use strict';var multer=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var path=require('path');var timeout=require(_0x88b3('0x2'));var express=require(_0x88b3('0x3'));var router=express[_0x88b3('0x4')]();var auth=require(_0x88b3('0x5'));var interaction=require(_0x88b3('0x6'));var config=require(_0x88b3('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0x88b3('0x8')]('/',auth[_0x88b3('0x9')](),controller[_0x88b3('0xa')]);router['get'](_0x88b3('0xb'),auth[_0x88b3('0x9')](),controller['show']);router[_0x88b3('0x8')](_0x88b3('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x88b3('0x8')](_0x88b3('0xd'),auth[_0x88b3('0x9')](),controller[_0x88b3('0xe')]);router[_0x88b3('0x8')](_0x88b3('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x88b3('0x9')](),controller['create']);router['put'](_0x88b3('0xb'),auth[_0x88b3('0x9')](),controller[_0x88b3('0x10')]);router[_0x88b3('0x11')](_0x88b3('0xb'),auth[_0x88b3('0x9')](),controller[_0x88b3('0x12')]);module[_0x88b3('0x13')]=router;
\ No newline at end of file
index d09e793..d8a2be0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01fe=['sequelize','exports','STRING','incident'];(function(_0x2ed345,_0x59c3c2){var _0x1e812c=function(_0xdb7f76){while(--_0xdb7f76){_0x2ed345['push'](_0x2ed345['shift']());}};_0x1e812c(++_0x59c3c2);}(_0x01fe,0x124));var _0xe01f=function(_0x4b8e79,_0x49bd5d){_0x4b8e79=_0x4b8e79-0x0;var _0x198b11=_0x01fe[_0x4b8e79];return _0x198b11;};'use strict';var Sequelize=require(_0xe01f('0x0'));module[_0xe01f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe01f('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident','phonecall'),'defaultValue':_0xe01f('0x3')}};
\ No newline at end of file
+var _0x295b=['STRING','ENUM','incident','phonecall','exports'];(function(_0x557079,_0x4adad5){var _0x39d8fa=function(_0x4e04c8){while(--_0x4e04c8){_0x557079['push'](_0x557079['shift']());}};_0x39d8fa(++_0x4adad5);}(_0x295b,0xcc));var _0xb295=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x295b[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require('sequelize');module[_0xb295('0x0')]={'name':{'type':Sequelize[_0xb295('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xb295('0x2')](_0xb295('0x3'),_0xb295('0x4')),'defaultValue':_0xb295('0x3')}};
\ No newline at end of file
index d7c57f9..492e2a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x164f=['filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','include','rows','params','keys','includeAll','find','create','body','update','getFields','findOne','Dynamics365Field','getSubjects','pick','options','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','destroy','end','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query'];(function(_0x1973a7,_0x2516c2){var _0x49370f=function(_0x4b53ab){while(--_0x4b53ab){_0x1973a7['push'](_0x1973a7['shift']());}};_0x49370f(++_0x2516c2);}(_0x164f,0xd0));var _0xf164=function(_0x491f50,_0x4e8b53){_0x491f50=_0x491f50-0x0;var _0x38b8cb=_0x164f[_0x491f50];return _0x38b8cb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf164('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf164('0x1'));var rp=require(_0xf164('0x2'));var moment=require(_0xf164('0x3'));var BPromise=require(_0xf164('0x4'));var Mustache=require(_0xf164('0x5'));var util=require(_0xf164('0x6'));var path=require('path');var sox=require(_0xf164('0x7'));var csv=require(_0xf164('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf164('0x9'));var squel=require(_0xf164('0xa'));var crypto=require(_0xf164('0xb'));var jsforce=require(_0xf164('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf164('0x8'));var querystring=require('querystring');var Papa=require(_0xf164('0xd'));var Redis=require(_0xf164('0xe'));var authService=require(_0xf164('0xf'));var qs=require(_0xf164('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf164('0x11'));var logger=require(_0xf164('0x12'))(_0xf164('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf164('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf164('0x15')]({'port':0x232a});function checkPasswordPattern(_0x4e89de,_0x4b60be,_0x123ab5){if(_0x123ab5){var _0x4858b8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4858b8[_0xf164('0x16')](_0x4b60be)){return _0x4e89de;}else{throw new db['Sequelize'][(_0xf164('0x17'))](_0xf164('0x18'));}}else{return _0x4e89de;}}function respondWithRpcPromise(_0x5e254d,_0xaf7c23,_0x1cc09c,_0x2a08be){return new BPromise(function(_0x1b6b0d,_0x26ec59){var _0x51f1ba=_0x2a08be||client;return _0x51f1ba['request'](_0x5e254d,_0x1cc09c)[_0xf164('0x19')](function(_0x3804d5){logger[_0xf164('0x1a')](_0xf164('0x1b'),_0xaf7c23,_0xf164('0x1c'));logger[_0xf164('0x1d')](_0xf164('0x1e'),_0xaf7c23,_0xf164('0x1c'),JSON[_0xf164('0x1f')](_0x3804d5));if(_0x3804d5[_0xf164('0x20')]){if(_0x3804d5[_0xf164('0x20')][_0xf164('0x21')]===0x1f4){logger['error'](_0xf164('0x1b'),_0xaf7c23,_0x3804d5[_0xf164('0x20')][_0xf164('0x22')]);return _0x26ec59(_0x3804d5[_0xf164('0x20')][_0xf164('0x22')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xaf7c23,_0x3804d5[_0xf164('0x20')][_0xf164('0x22')]);return _0x1b6b0d(_0x3804d5[_0xf164('0x20')][_0xf164('0x22')]);}else{logger['info'](_0xf164('0x1b'),_0xaf7c23,_0xf164('0x1c'));_0x1b6b0d(_0x3804d5['result']['message']);}})[_0xf164('0x23')](function(_0x45c4f1){logger[_0xf164('0x20')](_0xf164('0x1b'),_0xaf7c23,_0x45c4f1);_0x26ec59(_0x45c4f1);});});}function respondWithStatusCode(_0xbe7e1f,_0x5a3529){_0x5a3529=_0x5a3529||0xcc;return function(_0x2853e1){if(_0x2853e1){return _0xbe7e1f[_0xf164('0x24')](_0x5a3529);}return _0xbe7e1f['status'](_0x5a3529)['end']();};}function respondWithResult(_0xc12eb0,_0x587d63){_0x587d63=_0x587d63||0xc8;return function(_0x104a6c){if(_0x104a6c){return _0xc12eb0['status'](_0x587d63)[_0xf164('0x25')](_0x104a6c);}};}function respondWithFilteredResult(_0x40f6ae,_0x4bef1e){return function(_0x263383){if(_0x263383){var _0x55b634=_0x263383[_0xf164('0x26')],_0x28acdb=_0x4bef1e[_0xf164('0x27')],_0x230dc5=_0x4bef1e[_0xf164('0x27')]+_0x4bef1e[_0xf164('0x28')],_0x655a9d;if(_0x230dc5>=_0x55b634){_0x230dc5=_0x55b634;_0x655a9d=0xc8;}else{_0x655a9d=0xce;}_0x40f6ae[_0xf164('0x29')](_0x655a9d);return _0x40f6ae[_0xf164('0x2a')](_0xf164('0x2b'),_0x28acdb+'-'+_0x230dc5+'/'+_0x55b634)[_0xf164('0x25')](_0x263383);}return null;};}function patchUpdates(_0x37d235){return function(_0x4efdd6){try{jsonpatch[_0xf164('0x2c')](_0x4efdd6,_0x37d235,!![]);}catch(_0x18009b){return BPromise[_0xf164('0x2d')](_0x18009b);}return _0x4efdd6['save']();};}function saveUpdates(_0x100d19,_0x406374){return function(_0xeea558){if(_0xeea558){return _0xeea558['update'](_0x100d19)[_0xf164('0x19')](function(_0x459670){return _0x459670;});}return null;};}function removeEntity(_0x3140a1,_0x58ed7e){return function(_0x4ea636){if(_0x4ea636){return _0x4ea636[_0xf164('0x2e')]()[_0xf164('0x19')](function(){_0x3140a1[_0xf164('0x29')](0xcc)[_0xf164('0x2f')]();});}};}function handleEntityNotFound(_0x3c7409,_0x18e628){return function(_0x15fe47){if(!_0x15fe47){_0x3c7409[_0xf164('0x24')](0x194);}return _0x15fe47;};}function handleError(_0x264d63,_0x37f364){_0x37f364=_0x37f364||0x1f4;return function(_0x1cfd1f){logger[_0xf164('0x20')](_0x1cfd1f[_0xf164('0x30')]);if(_0x1cfd1f['name']){delete _0x1cfd1f[_0xf164('0x31')];}_0x264d63[_0xf164('0x29')](_0x37f364)[_0xf164('0x32')](_0x1cfd1f);};}exports[_0xf164('0x33')]=function(_0x50e523,_0x4fc62c){var _0x325a4a={},_0x14be5a={},_0x48b4cd={'count':0x0,'rows':[]};var _0x5cdba3=_[_0xf164('0x34')](db[_0xf164('0x35')][_0xf164('0x36')],function(_0x5b7dc1){return{'name':_0x5b7dc1[_0xf164('0x37')],'type':_0x5b7dc1[_0xf164('0x38')][_0xf164('0x39')]};});_0x14be5a['model']=_[_0xf164('0x34')](_0x5cdba3,_0xf164('0x31'));_0x14be5a[_0xf164('0x3a')]=_['keys'](_0x50e523[_0xf164('0x3a')]);_0x14be5a[_0xf164('0x3b')]=_['intersection'](_0x14be5a[_0xf164('0x3c')],_0x14be5a[_0xf164('0x3a')]);_0x325a4a[_0xf164('0x3d')]=_[_0xf164('0x3e')](_0x14be5a['model'],qs[_0xf164('0x3f')](_0x50e523[_0xf164('0x3a')]['fields']));_0x325a4a['attributes']=_0x325a4a[_0xf164('0x3d')][_0xf164('0x40')]?_0x325a4a['attributes']:_0x14be5a['model'];if(!_0x50e523['query'][_0xf164('0x41')](_0xf164('0x42'))){_0x325a4a[_0xf164('0x28')]=qs[_0xf164('0x28')](_0x50e523[_0xf164('0x3a')][_0xf164('0x28')]);_0x325a4a[_0xf164('0x27')]=qs['offset'](_0x50e523[_0xf164('0x3a')][_0xf164('0x27')]);}_0x325a4a[_0xf164('0x43')]=qs[_0xf164('0x44')](_0x50e523[_0xf164('0x3a')][_0xf164('0x44')]);_0x325a4a['where']=qs[_0xf164('0x3b')](_['pick'](_0x50e523[_0xf164('0x3a')],_0x14be5a[_0xf164('0x3b')]),_0x5cdba3);if(_0x50e523[_0xf164('0x3a')][_0xf164('0x45')]){_0x325a4a['where']=_[_0xf164('0x46')](_0x325a4a[_0xf164('0x47')],{'$or':_['map'](_0x5cdba3,function(_0x1ca07b){if(_0x1ca07b['type']!==_0xf164('0x48')){var _0x4a6745={};_0x4a6745[_0x1ca07b['name']]={'$like':'%'+_0x50e523[_0xf164('0x3a')][_0xf164('0x45')]+'%'};return _0x4a6745;}})});}_0x325a4a=_[_0xf164('0x46')]({},_0x325a4a,_0x50e523['options']);var _0x23b68a={'where':_0x325a4a['where']};return db['Dynamics365Configuration']['count'](_0x23b68a)['then'](function(_0x2f1602){_0x48b4cd[_0xf164('0x26')]=_0x2f1602;if(_0x50e523[_0xf164('0x3a')]['includeAll']){_0x325a4a[_0xf164('0x49')]=[{'all':!![]}];}return db[_0xf164('0x35')]['findAll'](_0x325a4a);})[_0xf164('0x19')](function(_0xf57750){_0x48b4cd[_0xf164('0x4a')]=_0xf57750;return _0x48b4cd;})[_0xf164('0x19')](respondWithFilteredResult(_0x4fc62c,_0x325a4a))[_0xf164('0x23')](handleError(_0x4fc62c,null));};exports['show']=function(_0x18e022,_0x16097b){var _0xea18cd={'raw':![],'where':{'id':_0x18e022[_0xf164('0x4b')]['id']}},_0x110fb0={};_0x110fb0[_0xf164('0x3c')]=_[_0xf164('0x4c')](db[_0xf164('0x35')][_0xf164('0x36')]);_0x110fb0[_0xf164('0x3a')]=_['keys'](_0x18e022['query']);_0x110fb0['filters']=_['intersection'](_0x110fb0[_0xf164('0x3c')],_0x110fb0[_0xf164('0x3a')]);_0xea18cd[_0xf164('0x3d')]=_[_0xf164('0x3e')](_0x110fb0[_0xf164('0x3c')],qs['fields'](_0x18e022[_0xf164('0x3a')][_0xf164('0x3f')]));_0xea18cd['attributes']=_0xea18cd['attributes'][_0xf164('0x40')]?_0xea18cd[_0xf164('0x3d')]:_0x110fb0[_0xf164('0x3c')];if(_0x18e022[_0xf164('0x3a')][_0xf164('0x4d')]){_0xea18cd[_0xf164('0x49')]=[{'all':!![]}];}_0xea18cd=_[_0xf164('0x46')]({},_0xea18cd,_0x18e022['options']);return db['Dynamics365Configuration'][_0xf164('0x4e')](_0xea18cd)[_0xf164('0x19')](handleEntityNotFound(_0x16097b,null))['then'](respondWithResult(_0x16097b,null))[_0xf164('0x23')](handleError(_0x16097b,null));};exports[_0xf164('0x4f')]=function(_0x53b3fa,_0x5ac252){return db['Dynamics365Configuration']['create'](_0x53b3fa[_0xf164('0x50')],{})['then'](respondWithResult(_0x5ac252,0xc9))['catch'](handleError(_0x5ac252,null));};exports[_0xf164('0x51')]=function(_0xe826df,_0x2b50d3){if(_0xe826df['body']['id']){delete _0xe826df[_0xf164('0x50')]['id'];}return db[_0xf164('0x35')][_0xf164('0x4e')]({'where':{'id':_0xe826df[_0xf164('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2b50d3,null))['then'](saveUpdates(_0xe826df[_0xf164('0x50')],null))[_0xf164('0x19')](respondWithResult(_0x2b50d3,null))[_0xf164('0x23')](handleError(_0x2b50d3,null));};exports[_0xf164('0x2e')]=function(_0x1e42ce,_0x3536d1){return db[_0xf164('0x35')][_0xf164('0x4e')]({'where':{'id':_0x1e42ce['params']['id']}})['then'](handleEntityNotFound(_0x3536d1,null))[_0xf164('0x19')](removeEntity(_0x3536d1,null))['catch'](handleError(_0x3536d1,null));};exports[_0xf164('0x52')]=function(_0x35b923,_0x168ac8,_0x23867c){var _0x1d6520={};var _0x1e188e={};var _0x515278;var _0xb02c2;return db[_0xf164('0x35')][_0xf164('0x53')]({'where':{'id':_0x35b923[_0xf164('0x4b')]['id']}})[_0xf164('0x19')](handleEntityNotFound(_0x168ac8,null))[_0xf164('0x19')](function(_0x2c38b){if(_0x2c38b){_0x515278=_0x2c38b;_0x1e188e[_0xf164('0x3c')]=_['keys'](db[_0xf164('0x54')][_0xf164('0x36')]);_0x1e188e[_0xf164('0x3a')]=_[_0xf164('0x4c')](_0x35b923[_0xf164('0x3a')]);_0x1e188e[_0xf164('0x3b')]=_['intersection'](_0x1e188e['model'],_0x1e188e['query']);_0x1d6520[_0xf164('0x3d')]=_[_0xf164('0x3e')](_0x1e188e['model'],qs[_0xf164('0x3f')](_0x35b923['query'][_0xf164('0x3f')]));_0x1d6520[_0xf164('0x3d')]=_0x1d6520[_0xf164('0x3d')][_0xf164('0x40')]?_0x1d6520[_0xf164('0x3d')]:_0x1e188e[_0xf164('0x3c')];_0x1d6520['order']=qs['sort'](_0x35b923['query'][_0xf164('0x44')]);_0x1d6520[_0xf164('0x47')]=qs[_0xf164('0x3b')](_['pick'](_0x35b923[_0xf164('0x3a')],_0x1e188e[_0xf164('0x3b')]));if(_0x35b923[_0xf164('0x3a')][_0xf164('0x45')]){_0x1d6520[_0xf164('0x47')]=_[_0xf164('0x46')](_0x1d6520[_0xf164('0x47')],{'$or':_['map'](_0x1d6520[_0xf164('0x3d')],function(_0x162c6d){var _0x43dfe9={};_0x43dfe9[_0x162c6d]={'$like':'%'+_0x35b923['query'][_0xf164('0x45')]+'%'};return _0x43dfe9;})});}_0x1d6520=_[_0xf164('0x46')]({},_0x1d6520,_0x35b923['options']);return _0x515278[_0xf164('0x52')](_0x1d6520);}})[_0xf164('0x19')](function(_0x30cceb){if(_0x30cceb){_0xb02c2=_0x30cceb['length'];if(!_0x35b923['query'][_0xf164('0x41')](_0xf164('0x42'))){_0x1d6520[_0xf164('0x28')]=qs[_0xf164('0x28')](_0x35b923[_0xf164('0x3a')][_0xf164('0x28')]);_0x1d6520[_0xf164('0x27')]=qs[_0xf164('0x27')](_0x35b923[_0xf164('0x3a')]['offset']);}return _0x515278[_0xf164('0x52')](_0x1d6520);}})['then'](function(_0x9ca1fa){if(_0x9ca1fa){return _0x9ca1fa?{'count':_0xb02c2,'rows':_0x9ca1fa}:null;}})[_0xf164('0x19')](respondWithResult(_0x168ac8,null))[_0xf164('0x23')](handleError(_0x168ac8,null));};exports[_0xf164('0x55')]=function(_0x5bbfa3,_0x3e4b25,_0x17fc0c){var _0xd08798={};var _0x19b7d6={};var _0x58716d;var _0x55ea61;return db['Dynamics365Configuration'][_0xf164('0x53')]({'where':{'id':_0x5bbfa3[_0xf164('0x4b')]['id']}})[_0xf164('0x19')](handleEntityNotFound(_0x3e4b25,null))[_0xf164('0x19')](function(_0x3ed8a8){if(_0x3ed8a8){_0x58716d=_0x3ed8a8;_0x19b7d6[_0xf164('0x3c')]=_['keys'](db[_0xf164('0x54')][_0xf164('0x36')]);_0x19b7d6[_0xf164('0x3a')]=_[_0xf164('0x4c')](_0x5bbfa3['query']);_0x19b7d6[_0xf164('0x3b')]=_[_0xf164('0x3e')](_0x19b7d6[_0xf164('0x3c')],_0x19b7d6[_0xf164('0x3a')]);_0xd08798[_0xf164('0x3d')]=_[_0xf164('0x3e')](_0x19b7d6['model'],qs[_0xf164('0x3f')](_0x5bbfa3['query'][_0xf164('0x3f')]));_0xd08798[_0xf164('0x3d')]=_0xd08798[_0xf164('0x3d')][_0xf164('0x40')]?_0xd08798[_0xf164('0x3d')]:_0x19b7d6[_0xf164('0x3c')];_0xd08798['order']=qs['sort'](_0x5bbfa3[_0xf164('0x3a')]['sort']);_0xd08798['where']=qs['filters'](_[_0xf164('0x56')](_0x5bbfa3[_0xf164('0x3a')],_0x19b7d6['filters']));if(_0x5bbfa3['query'][_0xf164('0x45')]){_0xd08798[_0xf164('0x47')]=_['merge'](_0xd08798[_0xf164('0x47')],{'$or':_[_0xf164('0x34')](_0xd08798['attributes'],function(_0x27b981){var _0x61fbb={};_0x61fbb[_0x27b981]={'$like':'%'+_0x5bbfa3['query'][_0xf164('0x45')]+'%'};return _0x61fbb;})});}_0xd08798=_[_0xf164('0x46')]({},_0xd08798,_0x5bbfa3[_0xf164('0x57')]);return _0x58716d['getSubjects'](_0xd08798);}})[_0xf164('0x19')](function(_0x3adbed){if(_0x3adbed){_0x55ea61=_0x3adbed[_0xf164('0x40')];if(!_0x5bbfa3[_0xf164('0x3a')][_0xf164('0x41')](_0xf164('0x42'))){_0xd08798[_0xf164('0x28')]=qs['limit'](_0x5bbfa3[_0xf164('0x3a')][_0xf164('0x28')]);_0xd08798[_0xf164('0x27')]=qs[_0xf164('0x27')](_0x5bbfa3[_0xf164('0x3a')]['offset']);}return _0x58716d[_0xf164('0x55')](_0xd08798);}})[_0xf164('0x19')](function(_0x4bfe2f){if(_0x4bfe2f){return _0x4bfe2f?{'count':_0x55ea61,'rows':_0x4bfe2f}:null;}})['then'](respondWithResult(_0x3e4b25,null))[_0xf164('0x23')](handleError(_0x3e4b25,null));};exports[_0xf164('0x58')]=function(_0x4c0c9b,_0x411bac,_0x437d58){var _0x45757d={};var _0x3ac73a={};var _0x8cfa57;var _0x30d1dd;return db[_0xf164('0x35')][_0xf164('0x53')]({'where':{'id':_0x4c0c9b[_0xf164('0x4b')]['id']}})['then'](handleEntityNotFound(_0x411bac,null))[_0xf164('0x19')](function(_0x5cd7f7){if(_0x5cd7f7){_0x8cfa57=_0x5cd7f7;_0x3ac73a['model']=_['keys'](db[_0xf164('0x54')]['rawAttributes']);_0x3ac73a[_0xf164('0x3a')]=_[_0xf164('0x4c')](_0x4c0c9b[_0xf164('0x3a')]);_0x3ac73a[_0xf164('0x3b')]=_[_0xf164('0x3e')](_0x3ac73a[_0xf164('0x3c')],_0x3ac73a[_0xf164('0x3a')]);_0x45757d[_0xf164('0x3d')]=_[_0xf164('0x3e')](_0x3ac73a[_0xf164('0x3c')],qs[_0xf164('0x3f')](_0x4c0c9b[_0xf164('0x3a')][_0xf164('0x3f')]));_0x45757d[_0xf164('0x3d')]=_0x45757d[_0xf164('0x3d')][_0xf164('0x40')]?_0x45757d[_0xf164('0x3d')]:_0x3ac73a[_0xf164('0x3c')];_0x45757d[_0xf164('0x43')]=qs[_0xf164('0x44')](_0x4c0c9b[_0xf164('0x3a')][_0xf164('0x44')]);_0x45757d[_0xf164('0x47')]=qs[_0xf164('0x3b')](_[_0xf164('0x56')](_0x4c0c9b[_0xf164('0x3a')],_0x3ac73a[_0xf164('0x3b')]));if(_0x4c0c9b[_0xf164('0x3a')][_0xf164('0x45')]){_0x45757d[_0xf164('0x47')]=_[_0xf164('0x46')](_0x45757d[_0xf164('0x47')],{'$or':_['map'](_0x45757d[_0xf164('0x3d')],function(_0x14cb9c){var _0xb0b270={};_0xb0b270[_0x14cb9c]={'$like':'%'+_0x4c0c9b[_0xf164('0x3a')][_0xf164('0x45')]+'%'};return _0xb0b270;})});}_0x45757d=_['merge']({},_0x45757d,_0x4c0c9b[_0xf164('0x57')]);return _0x8cfa57[_0xf164('0x58')](_0x45757d);}})[_0xf164('0x19')](function(_0xc190fb){if(_0xc190fb){_0x30d1dd=_0xc190fb[_0xf164('0x40')];if(!_0x4c0c9b['query'][_0xf164('0x41')](_0xf164('0x42'))){_0x45757d[_0xf164('0x28')]=qs['limit'](_0x4c0c9b[_0xf164('0x3a')]['limit']);_0x45757d[_0xf164('0x27')]=qs[_0xf164('0x27')](_0x4c0c9b['query'][_0xf164('0x27')]);}return _0x8cfa57[_0xf164('0x58')](_0x45757d);}})[_0xf164('0x19')](function(_0x2e8e68){if(_0x2e8e68){return _0x2e8e68?{'count':_0x30d1dd,'rows':_0x2e8e68}:null;}})[_0xf164('0x19')](respondWithResult(_0x411bac,null))[_0xf164('0x23')](handleError(_0x411bac,null));};
\ No newline at end of file
+var _0x74e2=['offset','limit','Content-Range','json','apply','reject','destroy','stack','name','send','map','Dynamics365Configuration','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','length','find','create','body','update','getFields','findOne','Dynamics365Field','rawAttributes','hasOwnProperty','getSubjects','order','getDescriptions','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','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','../../config/utils','../../mysqldb','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','count'];(function(_0x1849c0,_0x43d6f5){var _0x569897=function(_0x1361a0){while(--_0x1361a0){_0x1849c0['push'](_0x1849c0['shift']());}};_0x569897(++_0x43d6f5);}(_0x74e2,0x142));var _0x274e=function(_0x18f8c2,_0x7834c9){_0x18f8c2=_0x18f8c2-0x0;var _0x1f3f47=_0x74e2[_0x18f8c2];return _0x1f3f47;};'use strict';var pdf=require(_0x274e('0x0'));var emlformat=require(_0x274e('0x1'));var rimraf=require(_0x274e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x274e('0x3'));var moment=require(_0x274e('0x4'));var BPromise=require(_0x274e('0x5'));var Mustache=require(_0x274e('0x6'));var util=require('util');var path=require(_0x274e('0x7'));var sox=require(_0x274e('0x8'));var csv=require(_0x274e('0x9'));var ejs=require(_0x274e('0xa'));var fs=require('fs');var _=require(_0x274e('0xb'));var squel=require('squel');var crypto=require(_0x274e('0xc'));var jsforce=require(_0x274e('0xd'));var deskjs=require(_0x274e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x274e('0xf'));var Papa=require(_0x274e('0x10'));var Redis=require(_0x274e('0x11'));var authService=require(_0x274e('0x12'));var qs=require(_0x274e('0x13'));var as=require(_0x274e('0x14'));var hardwareService=require(_0x274e('0x15'));var logger=require(_0x274e('0x16'))('api');var utils=require(_0x274e('0x17'));var config=require('../../config/environment');var db=require(_0x274e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x274e('0x19')][_0x274e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5e3bd4,_0x4c6bc0,_0x5c31cd){if(_0x5c31cd){var _0x4bb300=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bb300[_0x274e('0x1b')](_0x4c6bc0)){return _0x5e3bd4;}else{throw new db[(_0x274e('0x1c'))]['ValidationError'](_0x274e('0x1d'));}}else{return _0x5e3bd4;}}function respondWithRpcPromise(_0x4d7b7a,_0x2ac007,_0x43db0f,_0x200991){return new BPromise(function(_0x33dce6,_0x6b0f8c){var _0x2c522a=_0x200991||client;return _0x2c522a[_0x274e('0x1e')](_0x4d7b7a,_0x43db0f)[_0x274e('0x1f')](function(_0x5964d7){logger['info'](_0x274e('0x20'),_0x2ac007,'request\x20sent');logger[_0x274e('0x21')](_0x274e('0x22'),_0x2ac007,_0x274e('0x23'),JSON['stringify'](_0x5964d7));if(_0x5964d7[_0x274e('0x24')]){if(_0x5964d7[_0x274e('0x24')][_0x274e('0x25')]===0x1f4){logger['error'](_0x274e('0x20'),_0x2ac007,_0x5964d7[_0x274e('0x24')][_0x274e('0x26')]);return _0x6b0f8c(_0x5964d7[_0x274e('0x24')][_0x274e('0x26')]);}logger[_0x274e('0x24')](_0x274e('0x20'),_0x2ac007,_0x5964d7[_0x274e('0x24')]['message']);return _0x33dce6(_0x5964d7['error'][_0x274e('0x26')]);}else{logger[_0x274e('0x27')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2ac007,_0x274e('0x23'));_0x33dce6(_0x5964d7[_0x274e('0x28')][_0x274e('0x26')]);}})[_0x274e('0x29')](function(_0x317334){logger[_0x274e('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2ac007,_0x317334);_0x6b0f8c(_0x317334);});});}function respondWithStatusCode(_0x4d8131,_0x2d974f){_0x2d974f=_0x2d974f||0xcc;return function(_0x35ce86){if(_0x35ce86){return _0x4d8131[_0x274e('0x2a')](_0x2d974f);}return _0x4d8131[_0x274e('0x2b')](_0x2d974f)[_0x274e('0x2c')]();};}function respondWithResult(_0x21bc34,_0x511e32){_0x511e32=_0x511e32||0xc8;return function(_0x18065e){if(_0x18065e){return _0x21bc34['status'](_0x511e32)['json'](_0x18065e);}};}function respondWithFilteredResult(_0x2a9f65,_0x5a2ba7){return function(_0x52cad5){if(_0x52cad5){var _0x5c8db0=_0x52cad5[_0x274e('0x2d')],_0x371ab5=_0x5a2ba7[_0x274e('0x2e')],_0x34fb81=_0x5a2ba7['offset']+_0x5a2ba7[_0x274e('0x2f')],_0x1c1f6c;if(_0x34fb81>=_0x5c8db0){_0x34fb81=_0x5c8db0;_0x1c1f6c=0xc8;}else{_0x1c1f6c=0xce;}_0x2a9f65[_0x274e('0x2b')](_0x1c1f6c);return _0x2a9f65['set'](_0x274e('0x30'),_0x371ab5+'-'+_0x34fb81+'/'+_0x5c8db0)[_0x274e('0x31')](_0x52cad5);}return null;};}function patchUpdates(_0x3971c1){return function(_0x1523b8){try{jsonpatch[_0x274e('0x32')](_0x1523b8,_0x3971c1,!![]);}catch(_0x2cd1e4){return BPromise[_0x274e('0x33')](_0x2cd1e4);}return _0x1523b8['save']();};}function saveUpdates(_0x1dc685,_0x3b46f2){return function(_0x3c3c18){if(_0x3c3c18){return _0x3c3c18['update'](_0x1dc685)[_0x274e('0x1f')](function(_0x34e81d){return _0x34e81d;});}return null;};}function removeEntity(_0x505dce,_0x25783d){return function(_0x5c0d45){if(_0x5c0d45){return _0x5c0d45[_0x274e('0x34')]()[_0x274e('0x1f')](function(){_0x505dce[_0x274e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9410,_0x2f0eb3){return function(_0x26d815){if(!_0x26d815){_0x4a9410[_0x274e('0x2a')](0x194);}return _0x26d815;};}function handleError(_0x291a3d,_0x9e1d30){_0x9e1d30=_0x9e1d30||0x1f4;return function(_0x3305f8){logger[_0x274e('0x24')](_0x3305f8[_0x274e('0x35')]);if(_0x3305f8[_0x274e('0x36')]){delete _0x3305f8[_0x274e('0x36')];}_0x291a3d['status'](_0x9e1d30)[_0x274e('0x37')](_0x3305f8);};}exports['index']=function(_0x2cd870,_0x2b89ba){var _0x9525={},_0x4da0f7={},_0x4dad4c={'count':0x0,'rows':[]};var _0x5eb61d=_[_0x274e('0x38')](db[_0x274e('0x39')]['rawAttributes'],function(_0x18fdca){return{'name':_0x18fdca['fieldName'],'type':_0x18fdca[_0x274e('0x3a')][_0x274e('0x3b')]};});_0x4da0f7['model']=_[_0x274e('0x38')](_0x5eb61d,_0x274e('0x36'));_0x4da0f7[_0x274e('0x3c')]=_[_0x274e('0x3d')](_0x2cd870['query']);_0x4da0f7[_0x274e('0x3e')]=_[_0x274e('0x3f')](_0x4da0f7['model'],_0x4da0f7[_0x274e('0x3c')]);_0x9525[_0x274e('0x40')]=_[_0x274e('0x3f')](_0x4da0f7[_0x274e('0x41')],qs['fields'](_0x2cd870[_0x274e('0x3c')][_0x274e('0x42')]));_0x9525[_0x274e('0x40')]=_0x9525[_0x274e('0x40')]['length']?_0x9525[_0x274e('0x40')]:_0x4da0f7[_0x274e('0x41')];if(!_0x2cd870[_0x274e('0x3c')]['hasOwnProperty'](_0x274e('0x43'))){_0x9525['limit']=qs[_0x274e('0x2f')](_0x2cd870[_0x274e('0x3c')]['limit']);_0x9525[_0x274e('0x2e')]=qs[_0x274e('0x2e')](_0x2cd870['query'][_0x274e('0x2e')]);}_0x9525['order']=qs[_0x274e('0x44')](_0x2cd870[_0x274e('0x3c')][_0x274e('0x44')]);_0x9525[_0x274e('0x45')]=qs[_0x274e('0x3e')](_[_0x274e('0x46')](_0x2cd870[_0x274e('0x3c')],_0x4da0f7[_0x274e('0x3e')]),_0x5eb61d);if(_0x2cd870['query'][_0x274e('0x47')]){_0x9525[_0x274e('0x45')]=_[_0x274e('0x48')](_0x9525[_0x274e('0x45')],{'$or':_['map'](_0x5eb61d,function(_0x2e0be4){if(_0x2e0be4[_0x274e('0x3a')]!==_0x274e('0x49')){var _0x3753c6={};_0x3753c6[_0x2e0be4['name']]={'$like':'%'+_0x2cd870[_0x274e('0x3c')][_0x274e('0x47')]+'%'};return _0x3753c6;}})});}_0x9525=_[_0x274e('0x48')]({},_0x9525,_0x2cd870[_0x274e('0x4a')]);var _0x547e9b={'where':_0x9525[_0x274e('0x45')]};return db[_0x274e('0x39')][_0x274e('0x2d')](_0x547e9b)[_0x274e('0x1f')](function(_0x4b2c1a){_0x4dad4c['count']=_0x4b2c1a;if(_0x2cd870[_0x274e('0x3c')][_0x274e('0x4b')]){_0x9525[_0x274e('0x4c')]=[{'all':!![]}];}return db[_0x274e('0x39')]['findAll'](_0x9525);})[_0x274e('0x1f')](function(_0x34131b){_0x4dad4c['rows']=_0x34131b;return _0x4dad4c;})[_0x274e('0x1f')](respondWithFilteredResult(_0x2b89ba,_0x9525))[_0x274e('0x29')](handleError(_0x2b89ba,null));};exports[_0x274e('0x4d')]=function(_0x5e0d14,_0x124b8d){var _0x366811={'raw':![],'where':{'id':_0x5e0d14[_0x274e('0x4e')]['id']}},_0x241554={};_0x241554[_0x274e('0x41')]=_[_0x274e('0x3d')](db[_0x274e('0x39')]['rawAttributes']);_0x241554['query']=_[_0x274e('0x3d')](_0x5e0d14[_0x274e('0x3c')]);_0x241554[_0x274e('0x3e')]=_['intersection'](_0x241554['model'],_0x241554[_0x274e('0x3c')]);_0x366811[_0x274e('0x40')]=_[_0x274e('0x3f')](_0x241554[_0x274e('0x41')],qs[_0x274e('0x42')](_0x5e0d14['query'][_0x274e('0x42')]));_0x366811['attributes']=_0x366811['attributes'][_0x274e('0x4f')]?_0x366811['attributes']:_0x241554[_0x274e('0x41')];if(_0x5e0d14['query'][_0x274e('0x4b')]){_0x366811['include']=[{'all':!![]}];}_0x366811=_[_0x274e('0x48')]({},_0x366811,_0x5e0d14['options']);return db[_0x274e('0x39')][_0x274e('0x50')](_0x366811)[_0x274e('0x1f')](handleEntityNotFound(_0x124b8d,null))[_0x274e('0x1f')](respondWithResult(_0x124b8d,null))['catch'](handleError(_0x124b8d,null));};exports[_0x274e('0x51')]=function(_0x17b3db,_0x456b42){return db[_0x274e('0x39')][_0x274e('0x51')](_0x17b3db[_0x274e('0x52')],{})[_0x274e('0x1f')](respondWithResult(_0x456b42,0xc9))[_0x274e('0x29')](handleError(_0x456b42,null));};exports[_0x274e('0x53')]=function(_0x4d7a3b,_0x30d984){if(_0x4d7a3b[_0x274e('0x52')]['id']){delete _0x4d7a3b[_0x274e('0x52')]['id'];}return db['Dynamics365Configuration'][_0x274e('0x50')]({'where':{'id':_0x4d7a3b['params']['id']}})[_0x274e('0x1f')](handleEntityNotFound(_0x30d984,null))[_0x274e('0x1f')](saveUpdates(_0x4d7a3b['body'],null))[_0x274e('0x1f')](respondWithResult(_0x30d984,null))['catch'](handleError(_0x30d984,null));};exports['destroy']=function(_0x244726,_0x16c5d1){return db[_0x274e('0x39')][_0x274e('0x50')]({'where':{'id':_0x244726[_0x274e('0x4e')]['id']}})[_0x274e('0x1f')](handleEntityNotFound(_0x16c5d1,null))[_0x274e('0x1f')](removeEntity(_0x16c5d1,null))[_0x274e('0x29')](handleError(_0x16c5d1,null));};exports[_0x274e('0x54')]=function(_0x1ae10e,_0xfb6779,_0x3df288){var _0x2ca2c2={};var _0x4054c9={};var _0x3180cf;var _0x80472f;return db[_0x274e('0x39')][_0x274e('0x55')]({'where':{'id':_0x1ae10e[_0x274e('0x4e')]['id']}})[_0x274e('0x1f')](handleEntityNotFound(_0xfb6779,null))[_0x274e('0x1f')](function(_0x2eca43){if(_0x2eca43){_0x3180cf=_0x2eca43;_0x4054c9[_0x274e('0x41')]=_['keys'](db[_0x274e('0x56')][_0x274e('0x57')]);_0x4054c9['query']=_[_0x274e('0x3d')](_0x1ae10e[_0x274e('0x3c')]);_0x4054c9[_0x274e('0x3e')]=_[_0x274e('0x3f')](_0x4054c9[_0x274e('0x41')],_0x4054c9[_0x274e('0x3c')]);_0x2ca2c2['attributes']=_[_0x274e('0x3f')](_0x4054c9[_0x274e('0x41')],qs[_0x274e('0x42')](_0x1ae10e[_0x274e('0x3c')][_0x274e('0x42')]));_0x2ca2c2[_0x274e('0x40')]=_0x2ca2c2['attributes']['length']?_0x2ca2c2['attributes']:_0x4054c9[_0x274e('0x41')];_0x2ca2c2['order']=qs[_0x274e('0x44')](_0x1ae10e['query'][_0x274e('0x44')]);_0x2ca2c2['where']=qs[_0x274e('0x3e')](_[_0x274e('0x46')](_0x1ae10e['query'],_0x4054c9[_0x274e('0x3e')]));if(_0x1ae10e[_0x274e('0x3c')][_0x274e('0x47')]){_0x2ca2c2[_0x274e('0x45')]=_[_0x274e('0x48')](_0x2ca2c2[_0x274e('0x45')],{'$or':_[_0x274e('0x38')](_0x2ca2c2[_0x274e('0x40')],function(_0x1aeb78){var _0x36b110={};_0x36b110[_0x1aeb78]={'$like':'%'+_0x1ae10e[_0x274e('0x3c')][_0x274e('0x47')]+'%'};return _0x36b110;})});}_0x2ca2c2=_[_0x274e('0x48')]({},_0x2ca2c2,_0x1ae10e['options']);return _0x3180cf[_0x274e('0x54')](_0x2ca2c2);}})['then'](function(_0x21315a){if(_0x21315a){_0x80472f=_0x21315a[_0x274e('0x4f')];if(!_0x1ae10e[_0x274e('0x3c')][_0x274e('0x58')](_0x274e('0x43'))){_0x2ca2c2[_0x274e('0x2f')]=qs[_0x274e('0x2f')](_0x1ae10e[_0x274e('0x3c')][_0x274e('0x2f')]);_0x2ca2c2[_0x274e('0x2e')]=qs[_0x274e('0x2e')](_0x1ae10e[_0x274e('0x3c')][_0x274e('0x2e')]);}return _0x3180cf[_0x274e('0x54')](_0x2ca2c2);}})[_0x274e('0x1f')](function(_0xe2da9d){if(_0xe2da9d){return _0xe2da9d?{'count':_0x80472f,'rows':_0xe2da9d}:null;}})[_0x274e('0x1f')](respondWithResult(_0xfb6779,null))[_0x274e('0x29')](handleError(_0xfb6779,null));};exports[_0x274e('0x59')]=function(_0x114672,_0xfb96c8,_0x1642f5){var _0x3ab7eb={};var _0x427073={};var _0x281bef;var _0x50dadf;return db['Dynamics365Configuration'][_0x274e('0x55')]({'where':{'id':_0x114672[_0x274e('0x4e')]['id']}})['then'](handleEntityNotFound(_0xfb96c8,null))['then'](function(_0x2c128f){if(_0x2c128f){_0x281bef=_0x2c128f;_0x427073[_0x274e('0x41')]=_[_0x274e('0x3d')](db[_0x274e('0x56')][_0x274e('0x57')]);_0x427073[_0x274e('0x3c')]=_[_0x274e('0x3d')](_0x114672[_0x274e('0x3c')]);_0x427073[_0x274e('0x3e')]=_[_0x274e('0x3f')](_0x427073[_0x274e('0x41')],_0x427073[_0x274e('0x3c')]);_0x3ab7eb[_0x274e('0x40')]=_[_0x274e('0x3f')](_0x427073['model'],qs[_0x274e('0x42')](_0x114672['query'][_0x274e('0x42')]));_0x3ab7eb[_0x274e('0x40')]=_0x3ab7eb[_0x274e('0x40')][_0x274e('0x4f')]?_0x3ab7eb['attributes']:_0x427073['model'];_0x3ab7eb[_0x274e('0x5a')]=qs[_0x274e('0x44')](_0x114672[_0x274e('0x3c')][_0x274e('0x44')]);_0x3ab7eb[_0x274e('0x45')]=qs[_0x274e('0x3e')](_[_0x274e('0x46')](_0x114672[_0x274e('0x3c')],_0x427073['filters']));if(_0x114672['query']['filter']){_0x3ab7eb['where']=_[_0x274e('0x48')](_0x3ab7eb['where'],{'$or':_[_0x274e('0x38')](_0x3ab7eb['attributes'],function(_0x39d12f){var _0x826688={};_0x826688[_0x39d12f]={'$like':'%'+_0x114672[_0x274e('0x3c')][_0x274e('0x47')]+'%'};return _0x826688;})});}_0x3ab7eb=_[_0x274e('0x48')]({},_0x3ab7eb,_0x114672['options']);return _0x281bef[_0x274e('0x59')](_0x3ab7eb);}})[_0x274e('0x1f')](function(_0x41ad15){if(_0x41ad15){_0x50dadf=_0x41ad15[_0x274e('0x4f')];if(!_0x114672[_0x274e('0x3c')]['hasOwnProperty'](_0x274e('0x43'))){_0x3ab7eb['limit']=qs[_0x274e('0x2f')](_0x114672['query'][_0x274e('0x2f')]);_0x3ab7eb['offset']=qs[_0x274e('0x2e')](_0x114672[_0x274e('0x3c')]['offset']);}return _0x281bef[_0x274e('0x59')](_0x3ab7eb);}})[_0x274e('0x1f')](function(_0x23df44){if(_0x23df44){return _0x23df44?{'count':_0x50dadf,'rows':_0x23df44}:null;}})[_0x274e('0x1f')](respondWithResult(_0xfb96c8,null))[_0x274e('0x29')](handleError(_0xfb96c8,null));};exports[_0x274e('0x5b')]=function(_0x114bed,_0x245b8e,_0x3097bf){var _0x4ac1cd={};var _0x42d804={};var _0x89a0a6;var _0x46db49;return db[_0x274e('0x39')][_0x274e('0x55')]({'where':{'id':_0x114bed['params']['id']}})[_0x274e('0x1f')](handleEntityNotFound(_0x245b8e,null))[_0x274e('0x1f')](function(_0x330740){if(_0x330740){_0x89a0a6=_0x330740;_0x42d804['model']=_[_0x274e('0x3d')](db[_0x274e('0x56')][_0x274e('0x57')]);_0x42d804[_0x274e('0x3c')]=_['keys'](_0x114bed[_0x274e('0x3c')]);_0x42d804[_0x274e('0x3e')]=_[_0x274e('0x3f')](_0x42d804['model'],_0x42d804[_0x274e('0x3c')]);_0x4ac1cd[_0x274e('0x40')]=_[_0x274e('0x3f')](_0x42d804[_0x274e('0x41')],qs['fields'](_0x114bed['query'][_0x274e('0x42')]));_0x4ac1cd['attributes']=_0x4ac1cd[_0x274e('0x40')]['length']?_0x4ac1cd[_0x274e('0x40')]:_0x42d804[_0x274e('0x41')];_0x4ac1cd[_0x274e('0x5a')]=qs[_0x274e('0x44')](_0x114bed['query']['sort']);_0x4ac1cd[_0x274e('0x45')]=qs[_0x274e('0x3e')](_[_0x274e('0x46')](_0x114bed[_0x274e('0x3c')],_0x42d804['filters']));if(_0x114bed[_0x274e('0x3c')][_0x274e('0x47')]){_0x4ac1cd['where']=_[_0x274e('0x48')](_0x4ac1cd[_0x274e('0x45')],{'$or':_[_0x274e('0x38')](_0x4ac1cd[_0x274e('0x40')],function(_0x307a91){var _0x15b97d={};_0x15b97d[_0x307a91]={'$like':'%'+_0x114bed[_0x274e('0x3c')][_0x274e('0x47')]+'%'};return _0x15b97d;})});}_0x4ac1cd=_[_0x274e('0x48')]({},_0x4ac1cd,_0x114bed[_0x274e('0x4a')]);return _0x89a0a6['getDescriptions'](_0x4ac1cd);}})[_0x274e('0x1f')](function(_0x51a96b){if(_0x51a96b){_0x46db49=_0x51a96b[_0x274e('0x4f')];if(!_0x114bed['query'][_0x274e('0x58')]('nolimit')){_0x4ac1cd[_0x274e('0x2f')]=qs[_0x274e('0x2f')](_0x114bed[_0x274e('0x3c')][_0x274e('0x2f')]);_0x4ac1cd[_0x274e('0x2e')]=qs[_0x274e('0x2e')](_0x114bed['query']['offset']);}return _0x89a0a6[_0x274e('0x5b')](_0x4ac1cd);}})[_0x274e('0x1f')](function(_0xbdca87){if(_0xbdca87){return _0xbdca87?{'count':_0x46db49,'rows':_0xbdca87}:null;}})['then'](respondWithResult(_0x245b8e,null))[_0x274e('0x29')](handleError(_0x245b8e,null));};
\ No newline at end of file
index 1f6d98e..7877890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8abb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x8abb,0x104));var _0xb8ab=function(_0x22fda2,_0x47c180){_0x22fda2=_0x22fda2-0x0;var _0x1553e9=_0x8abb[_0x22fda2];return _0x1553e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb8ab('0x0'));var moment=require(_0xb8ab('0x1'));var BPromise=require(_0xb8ab('0x2'));var rp=require(_0xb8ab('0x3'));var fs=require('fs');var path=require(_0xb8ab('0x4'));var rimraf=require(_0xb8ab('0x5'));var config=require(_0xb8ab('0x6'));var attributes=require(_0xb8ab('0x7'));module[_0xb8ab('0x8')]=function(_0x1eb1bc,_0x6d5615){return _0x1eb1bc['define'](_0xb8ab('0x9'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bee=['exports','define','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x21b038,_0xed8de6){var _0x2e8af3=function(_0x4da8b8){while(--_0x4da8b8){_0x21b038['push'](_0x21b038['shift']());}};_0x2e8af3(++_0xed8de6);}(_0x9bee,0xf4));var _0xe9be=function(_0xb953a,_0x3d230e){_0xb953a=_0xb953a-0x0;var _0x27ea69=_0x9bee[_0xb953a];return _0x27ea69;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe9be('0x0'))(_0xe9be('0x1'));var moment=require('moment');var BPromise=require(_0xe9be('0x2'));var rp=require(_0xe9be('0x3'));var fs=require('fs');var path=require(_0xe9be('0x4'));var rimraf=require(_0xe9be('0x5'));var config=require(_0xe9be('0x6'));var attributes=require(_0xe9be('0x7'));module[_0xe9be('0x8')]=function(_0x1d5c7a,_0x5bbaad){return _0x1d5c7a[_0xe9be('0x9')](_0xe9be('0xa'),attributes,{'tableName':_0xe9be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 79c6082..18a8267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb535=['request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0xb535,0x13a));var _0x5b53=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0xb535[_0x54b062];return _0x255e41;};'use strict';var _=require(_0x5b53('0x0'));var util=require(_0x5b53('0x1'));var moment=require(_0x5b53('0x2'));var BPromise=require(_0x5b53('0x3'));var rs=require(_0x5b53('0x4'));var fs=require('fs');var Redis=require(_0x5b53('0x5'));var db=require(_0x5b53('0x6'))['db'];var utils=require(_0x5b53('0x7'));var logger=require(_0x5b53('0x8'))('rpc');var config=require(_0x5b53('0x9'));var jayson=require(_0x5b53('0xa'));var client=jayson[_0x5b53('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30b931,_0x1f49ad,_0x18f187){return new BPromise(function(_0xcada12,_0x7c2a19){return client[_0x5b53('0xc')](_0x30b931,_0x18f187)[_0x5b53('0xd')](function(_0x59479d){logger[_0x5b53('0xe')](_0x5b53('0xf'),_0x1f49ad,_0x5b53('0x10'));logger[_0x5b53('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1f49ad,_0x5b53('0x10'),JSON[_0x5b53('0x12')](_0x59479d));if(_0x59479d[_0x5b53('0x13')]){if(_0x59479d[_0x5b53('0x13')][_0x5b53('0x14')]===0x1f4){logger[_0x5b53('0x13')](_0x5b53('0xf'),_0x1f49ad,_0x59479d['error'][_0x5b53('0x15')]);return _0x7c2a19(_0x59479d['error']['message']);}logger[_0x5b53('0x13')](_0x5b53('0xf'),_0x1f49ad,_0x59479d['error'][_0x5b53('0x15')]);return _0xcada12(_0x59479d[_0x5b53('0x13')]['message']);}else{logger[_0x5b53('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1f49ad,_0x5b53('0x10'));_0xcada12(_0x59479d['result'][_0x5b53('0x15')]);}})['catch'](function(_0x284dee){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1f49ad,_0x284dee);_0x7c2a19(_0x284dee);});});}
\ No newline at end of file
+var _0xff43=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3728d4,_0x4a170e){var _0x3ef589=function(_0xe780d9){while(--_0xe780d9){_0x3728d4['push'](_0x3728d4['shift']());}};_0x3ef589(++_0x4a170e);}(_0xff43,0x83));var _0x3ff4=function(_0x25a94a,_0xf765e3){_0x25a94a=_0x25a94a-0x0;var _0x2d16b2=_0xff43[_0x25a94a];return _0x2d16b2;};'use strict';var _=require(_0x3ff4('0x0'));var util=require(_0x3ff4('0x1'));var moment=require(_0x3ff4('0x2'));var BPromise=require(_0x3ff4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ff4('0x4'));var db=require(_0x3ff4('0x5'))['db'];var utils=require(_0x3ff4('0x6'));var logger=require(_0x3ff4('0x7'))(_0x3ff4('0x8'));var config=require(_0x3ff4('0x9'));var jayson=require(_0x3ff4('0xa'));var client=jayson[_0x3ff4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dbed9,_0x2a32f7,_0x9f2b20){return new BPromise(function(_0x5a6fd3,_0x3dc3cd){return client[_0x3ff4('0xc')](_0x1dbed9,_0x9f2b20)[_0x3ff4('0xd')](function(_0x1bcb5c){logger[_0x3ff4('0xe')](_0x3ff4('0xf'),_0x2a32f7,_0x3ff4('0x10'));logger[_0x3ff4('0x11')](_0x3ff4('0x12'),_0x2a32f7,_0x3ff4('0x10'),JSON[_0x3ff4('0x13')](_0x1bcb5c));if(_0x1bcb5c[_0x3ff4('0x14')]){if(_0x1bcb5c['error'][_0x3ff4('0x15')]===0x1f4){logger[_0x3ff4('0x14')](_0x3ff4('0xf'),_0x2a32f7,_0x1bcb5c[_0x3ff4('0x14')][_0x3ff4('0x16')]);return _0x3dc3cd(_0x1bcb5c[_0x3ff4('0x14')][_0x3ff4('0x16')]);}logger[_0x3ff4('0x14')](_0x3ff4('0xf'),_0x2a32f7,_0x1bcb5c['error']['message']);return _0x5a6fd3(_0x1bcb5c[_0x3ff4('0x14')]['message']);}else{logger[_0x3ff4('0xe')](_0x3ff4('0xf'),_0x2a32f7,_0x3ff4('0x10'));_0x5a6fd3(_0x1bcb5c['result'][_0x3ff4('0x16')]);}})[_0x3ff4('0x17')](function(_0x227c95){logger[_0x3ff4('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2a32f7,_0x227c95);_0x3dc3cd(_0x227c95);});});}
\ No newline at end of file
index 922e2fa..edb6193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7980=['get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0xc4e51f,_0x4e974b){var _0xf8d977=function(_0x515499){while(--_0x515499){_0xc4e51f['push'](_0xc4e51f['shift']());}};_0xf8d977(++_0x4e974b);}(_0x7980,0xab));var _0x0798=function(_0x276eda,_0x45d940){_0x276eda=_0x276eda-0x0;var _0x357584=_0x7980[_0x276eda];return _0x357584;};'use strict';var multer=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var path=require(_0x0798('0x2'));var timeout=require(_0x0798('0x3'));var express=require(_0x0798('0x4'));var router=express['Router']();var auth=require(_0x0798('0x5'));var interaction=require(_0x0798('0x6'));var config=require(_0x0798('0x7'));var controller=require(_0x0798('0x8'));router[_0x0798('0x9')]('/',auth['isAuthenticated'](),controller[_0x0798('0xa')]);router['get'](_0x0798('0xb'),auth[_0x0798('0xc')](),controller[_0x0798('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0798('0xe')]);router[_0x0798('0xf')](_0x0798('0xb'),auth[_0x0798('0xc')](),controller[_0x0798('0x10')]);router[_0x0798('0x11')](_0x0798('0xb'),auth[_0x0798('0xc')](),controller[_0x0798('0x12')]);module[_0x0798('0x13')]=router;
\ No newline at end of file
+var _0x2121=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x2121,0x1b4));var _0x1212=function(_0x14b29c,_0x38d9ce){_0x14b29c=_0x14b29c-0x0;var _0x2aa8c0=_0x2121[_0x14b29c];return _0x2aa8c0;};'use strict';var multer=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1212('0x2'));var router=express[_0x1212('0x3')]();var auth=require(_0x1212('0x4'));var interaction=require(_0x1212('0x5'));var config=require(_0x1212('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x1212('0x7')]('/',auth['isAuthenticated'](),controller[_0x1212('0x8')]);router[_0x1212('0x7')](_0x1212('0x9'),auth[_0x1212('0xa')](),controller[_0x1212('0xb')]);router[_0x1212('0xc')]('/',auth['isAuthenticated'](),controller[_0x1212('0xd')]);router[_0x1212('0xe')](_0x1212('0x9'),auth[_0x1212('0xa')](),controller[_0x1212('0xf')]);router[_0x1212('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1212('0x11')]);module[_0x1212('0x12')]=router;
\ No newline at end of file
index 0ae1528..33cc5f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa12=['ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xfa12,0x1b2));var _0x2fa1=function(_0xd13d87,_0x3ca500){_0xd13d87=_0xd13d87-0x0;var _0x3a2004=_0xfa12[_0xd13d87];return _0x3a2004;};'use strict';var Sequelize=require(_0x2fa1('0x0'));module[_0x2fa1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2fa1('0x2'),_0x2fa1('0x3'),_0x2fa1('0x4'),_0x2fa1('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2fa1('0x6')]},'key':{'type':Sequelize[_0x2fa1('0x6')]},'keyType':{'type':Sequelize[_0x2fa1('0x7')](_0x2fa1('0x2'),'variable',_0x2fa1('0x4'))},'keyContent':{'type':Sequelize[_0x2fa1('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2fa1('0x6')]},'customField':{'type':Sequelize[_0x2fa1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2fa1('0x6')]}};
\ No newline at end of file
+var _0x710e=['variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','string'];(function(_0x5a11ad,_0x3323b1){var _0x5cf950=function(_0x3c0974){while(--_0x3c0974){_0x5a11ad['push'](_0x5a11ad['shift']());}};_0x5cf950(++_0x3323b1);}(_0x710e,0xb6));var _0xe710=function(_0x9c1a55,_0x40be09){_0x9c1a55=_0x9c1a55-0x0;var _0x5a13bb=_0x710e[_0x9c1a55];return _0x5a13bb;};'use strict';var Sequelize=require(_0xe710('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xe710('0x1'),_0xe710('0x2'),_0xe710('0x3'),_0xe710('0x4')),'defaultValue':_0xe710('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe710('0x5')]},'keyType':{'type':Sequelize[_0xe710('0x6')]('string','variable',_0xe710('0x3'))},'keyContent':{'type':Sequelize[_0xe710('0x5')]},'idField':{'type':Sequelize[_0xe710('0x5')]},'nameField':{'type':Sequelize[_0xe710('0x5')]},'customField':{'type':Sequelize[_0xe710('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe710('0x5')]}};
\ No newline at end of file
index 4b117eb..eb9b6d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c65=['moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x1b3f6c,_0x14c8c9){var _0x21ad08=function(_0x5347b2){while(--_0x5347b2){_0x1b3f6c['push'](_0x1b3f6c['shift']());}};_0x21ad08(++_0x14c8c9);}(_0x6c65,0x8f));var _0x56c6=function(_0x5a56cc,_0x29650c){_0x5a56cc=_0x5a56cc-0x0;var _0x589caa=_0x6c65[_0x5a56cc];return _0x589caa;};'use strict';var pdf=require(_0x56c6('0x0'));var emlformat=require(_0x56c6('0x1'));var rimraf=require(_0x56c6('0x2'));var zipdir=require(_0x56c6('0x3'));var jsonpatch=require(_0x56c6('0x4'));var rp=require('request-promise');var moment=require(_0x56c6('0x5'));var BPromise=require(_0x56c6('0x6'));var Mustache=require('mustache');var util=require(_0x56c6('0x7'));var path=require(_0x56c6('0x8'));var sox=require(_0x56c6('0x9'));var csv=require(_0x56c6('0xa'));var ejs=require(_0x56c6('0xb'));var fs=require('fs');var _=require(_0x56c6('0xc'));var squel=require(_0x56c6('0xd'));var crypto=require(_0x56c6('0xe'));var jsforce=require(_0x56c6('0xf'));var deskjs=require(_0x56c6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x56c6('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x56c6('0x12'));var as=require(_0x56c6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x56c6('0x14'));var utils=require(_0x56c6('0x15'));var config=require('../../config/environment');var db=require(_0x56c6('0x16'))['db'];function respondWithStatusCode(_0x107d7b,_0xff25f){_0xff25f=_0xff25f||0xcc;return function(_0x1ca968){if(_0x1ca968){return _0x107d7b[_0x56c6('0x17')](_0xff25f);}return _0x107d7b[_0x56c6('0x18')](_0xff25f)[_0x56c6('0x19')]();};}function respondWithResult(_0x474a1f,_0x57f9c0){_0x57f9c0=_0x57f9c0||0xc8;return function(_0x3172a5){if(_0x3172a5){return _0x474a1f['status'](_0x57f9c0)['json'](_0x3172a5);}};}function respondWithFilteredResult(_0x1efc76,_0x473c14){return function(_0x4c14c0){if(_0x4c14c0){var _0x6ba6c0=_0x4c14c0[_0x56c6('0x1a')],_0x75c358=_0x473c14[_0x56c6('0x1b')],_0x5c292d=_0x473c14[_0x56c6('0x1b')]+_0x473c14[_0x56c6('0x1c')],_0x38e90d;if(_0x5c292d>=_0x6ba6c0){_0x5c292d=_0x6ba6c0;_0x38e90d=0xc8;}else{_0x38e90d=0xce;}_0x1efc76[_0x56c6('0x18')](_0x38e90d);return _0x1efc76[_0x56c6('0x1d')](_0x56c6('0x1e'),_0x75c358+'-'+_0x5c292d+'/'+_0x6ba6c0)['json'](_0x4c14c0);}return null;};}function patchUpdates(_0xe34577){return function(_0x26a6f8){try{jsonpatch['apply'](_0x26a6f8,_0xe34577,!![]);}catch(_0x30eaf5){return BPromise[_0x56c6('0x1f')](_0x30eaf5);}return _0x26a6f8[_0x56c6('0x20')]();};}function saveUpdates(_0x28d4c8,_0x3bd4ac){return function(_0x2a8513){if(_0x2a8513){return _0x2a8513[_0x56c6('0x21')](_0x28d4c8)[_0x56c6('0x22')](function(_0x1e6a6d){return _0x1e6a6d;});}return null;};}function removeEntity(_0x1d351e,_0x2a595a){return function(_0x5e8818){if(_0x5e8818){return _0x5e8818[_0x56c6('0x23')]()[_0x56c6('0x22')](function(){_0x1d351e[_0x56c6('0x18')](0xcc)[_0x56c6('0x19')]();});}};}function handleEntityNotFound(_0x299e1c,_0x16e04d){return function(_0x1794aa){if(!_0x1794aa){_0x299e1c['sendStatus'](0x194);}return _0x1794aa;};}function handleError(_0x5e7253,_0x592f29){_0x592f29=_0x592f29||0x1f4;return function(_0x2b3a43){logger[_0x56c6('0x24')](_0x2b3a43[_0x56c6('0x25')]);if(_0x2b3a43[_0x56c6('0x26')]){delete _0x2b3a43[_0x56c6('0x26')];}_0x5e7253['status'](_0x592f29)['send'](_0x2b3a43);};}exports[_0x56c6('0x27')]=function(_0xc2c50f,_0x5805c3){var _0x5ea3a3={},_0x257c95={},_0xfd619b={'count':0x0,'rows':[]};var _0x5aa8fe=_[_0x56c6('0x28')](db[_0x56c6('0x29')][_0x56c6('0x2a')],function(_0xddad63){return{'name':_0xddad63[_0x56c6('0x2b')],'type':_0xddad63['type'][_0x56c6('0x2c')]};});_0x257c95[_0x56c6('0x2d')]=_['map'](_0x5aa8fe,_0x56c6('0x26'));_0x257c95[_0x56c6('0x2e')]=_[_0x56c6('0x2f')](_0xc2c50f[_0x56c6('0x2e')]);_0x257c95[_0x56c6('0x30')]=_[_0x56c6('0x31')](_0x257c95[_0x56c6('0x2d')],_0x257c95[_0x56c6('0x2e')]);_0x5ea3a3['attributes']=_[_0x56c6('0x31')](_0x257c95[_0x56c6('0x2d')],qs['fields'](_0xc2c50f['query'][_0x56c6('0x32')]));_0x5ea3a3[_0x56c6('0x33')]=_0x5ea3a3[_0x56c6('0x33')]['length']?_0x5ea3a3[_0x56c6('0x33')]:_0x257c95['model'];if(!_0xc2c50f[_0x56c6('0x2e')][_0x56c6('0x34')](_0x56c6('0x35'))){_0x5ea3a3[_0x56c6('0x1c')]=qs[_0x56c6('0x1c')](_0xc2c50f['query'][_0x56c6('0x1c')]);_0x5ea3a3[_0x56c6('0x1b')]=qs[_0x56c6('0x1b')](_0xc2c50f[_0x56c6('0x2e')][_0x56c6('0x1b')]);}_0x5ea3a3[_0x56c6('0x36')]=qs['sort'](_0xc2c50f[_0x56c6('0x2e')][_0x56c6('0x37')]);_0x5ea3a3[_0x56c6('0x38')]=qs[_0x56c6('0x30')](_[_0x56c6('0x39')](_0xc2c50f['query'],_0x257c95[_0x56c6('0x30')]),_0x5aa8fe);if(_0xc2c50f[_0x56c6('0x2e')][_0x56c6('0x3a')]){_0x5ea3a3['where']=_[_0x56c6('0x3b')](_0x5ea3a3[_0x56c6('0x38')],{'$or':_[_0x56c6('0x28')](_0x5aa8fe,function(_0x32bfd3){if(_0x32bfd3[_0x56c6('0x3c')]!==_0x56c6('0x3d')){var _0xacd06b={};_0xacd06b[_0x32bfd3[_0x56c6('0x26')]]={'$like':'%'+_0xc2c50f[_0x56c6('0x2e')][_0x56c6('0x3a')]+'%'};return _0xacd06b;}})});}_0x5ea3a3=_[_0x56c6('0x3b')]({},_0x5ea3a3,_0xc2c50f[_0x56c6('0x3e')]);var _0xb184dc={'where':_0x5ea3a3[_0x56c6('0x38')]};return db[_0x56c6('0x29')][_0x56c6('0x1a')](_0xb184dc)[_0x56c6('0x22')](function(_0x551139){_0xfd619b[_0x56c6('0x1a')]=_0x551139;if(_0xc2c50f[_0x56c6('0x2e')]['includeAll']){_0x5ea3a3[_0x56c6('0x3f')]=[{'all':!![]}];}return db[_0x56c6('0x29')][_0x56c6('0x40')](_0x5ea3a3);})[_0x56c6('0x22')](function(_0x6fe023){_0xfd619b[_0x56c6('0x41')]=_0x6fe023;return _0xfd619b;})[_0x56c6('0x22')](respondWithFilteredResult(_0x5805c3,_0x5ea3a3))[_0x56c6('0x42')](handleError(_0x5805c3,null));};exports[_0x56c6('0x43')]=function(_0x2d512c,_0x449b1f){var _0x476c8b={'raw':!![],'where':{'id':_0x2d512c[_0x56c6('0x44')]['id']}},_0x4d3ea0={};_0x4d3ea0[_0x56c6('0x2d')]=_['keys'](db['Dynamics365Field'][_0x56c6('0x2a')]);_0x4d3ea0[_0x56c6('0x2e')]=_[_0x56c6('0x2f')](_0x2d512c[_0x56c6('0x2e')]);_0x4d3ea0[_0x56c6('0x30')]=_['intersection'](_0x4d3ea0[_0x56c6('0x2d')],_0x4d3ea0['query']);_0x476c8b[_0x56c6('0x33')]=_[_0x56c6('0x31')](_0x4d3ea0[_0x56c6('0x2d')],qs[_0x56c6('0x32')](_0x2d512c['query']['fields']));_0x476c8b[_0x56c6('0x33')]=_0x476c8b[_0x56c6('0x33')][_0x56c6('0x45')]?_0x476c8b['attributes']:_0x4d3ea0['model'];if(_0x2d512c['query'][_0x56c6('0x46')]){_0x476c8b[_0x56c6('0x3f')]=[{'all':!![]}];}_0x476c8b=_[_0x56c6('0x3b')]({},_0x476c8b,_0x2d512c[_0x56c6('0x3e')]);return db[_0x56c6('0x29')][_0x56c6('0x47')](_0x476c8b)[_0x56c6('0x22')](handleEntityNotFound(_0x449b1f,null))['then'](respondWithResult(_0x449b1f,null))[_0x56c6('0x42')](handleError(_0x449b1f,null));};exports[_0x56c6('0x48')]=function(_0x2f458a,_0x49cd2c){return db[_0x56c6('0x29')][_0x56c6('0x48')](_0x2f458a[_0x56c6('0x49')],{})['then'](respondWithResult(_0x49cd2c,0xc9))['catch'](handleError(_0x49cd2c,null));};exports['update']=function(_0x953a76,_0x5f060d){if(_0x953a76[_0x56c6('0x49')]['id']){delete _0x953a76[_0x56c6('0x49')]['id'];}return db['Dynamics365Field'][_0x56c6('0x47')]({'where':{'id':_0x953a76[_0x56c6('0x44')]['id']}})[_0x56c6('0x22')](handleEntityNotFound(_0x5f060d,null))['then'](saveUpdates(_0x953a76[_0x56c6('0x49')],null))[_0x56c6('0x22')](respondWithResult(_0x5f060d,null))[_0x56c6('0x42')](handleError(_0x5f060d,null));};exports[_0x56c6('0x23')]=function(_0x5b45e0,_0x5eb3e0){return db[_0x56c6('0x29')]['find']({'where':{'id':_0x5b45e0[_0x56c6('0x44')]['id']}})[_0x56c6('0x22')](handleEntityNotFound(_0x5eb3e0,null))[_0x56c6('0x22')](removeEntity(_0x5eb3e0,null))['catch'](handleError(_0x5eb3e0,null));};
\ No newline at end of file
+var _0xba35=['desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','name','map','Dynamics365Field','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0xba35,0x190));var _0x5ba3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xba35[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0x5ba3('0x0'));var emlformat=require(_0x5ba3('0x1'));var rimraf=require(_0x5ba3('0x2'));var zipdir=require(_0x5ba3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ba3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5ba3('0x5'));var path=require(_0x5ba3('0x6'));var sox=require(_0x5ba3('0x7'));var csv=require(_0x5ba3('0x8'));var ejs=require(_0x5ba3('0x9'));var fs=require('fs');var _=require(_0x5ba3('0xa'));var squel=require(_0x5ba3('0xb'));var crypto=require(_0x5ba3('0xc'));var jsforce=require(_0x5ba3('0xd'));var deskjs=require(_0x5ba3('0xe'));var toCsv=require(_0x5ba3('0x8'));var querystring=require(_0x5ba3('0xf'));var Papa=require(_0x5ba3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ba3('0x11'));var as=require(_0x5ba3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ba3('0x13'))(_0x5ba3('0x14'));var utils=require(_0x5ba3('0x15'));var config=require(_0x5ba3('0x16'));var db=require(_0x5ba3('0x17'))['db'];function respondWithStatusCode(_0x3f8f38,_0x3c988a){_0x3c988a=_0x3c988a||0xcc;return function(_0x3306da){if(_0x3306da){return _0x3f8f38['sendStatus'](_0x3c988a);}return _0x3f8f38['status'](_0x3c988a)[_0x5ba3('0x18')]();};}function respondWithResult(_0x6d6703,_0x3a7491){_0x3a7491=_0x3a7491||0xc8;return function(_0x339932){if(_0x339932){return _0x6d6703[_0x5ba3('0x19')](_0x3a7491)[_0x5ba3('0x1a')](_0x339932);}};}function respondWithFilteredResult(_0xdc5314,_0x9abfb0){return function(_0x33ccd9){if(_0x33ccd9){var _0x33be06=_0x33ccd9[_0x5ba3('0x1b')],_0x171532=_0x9abfb0[_0x5ba3('0x1c')],_0x5d3850=_0x9abfb0[_0x5ba3('0x1c')]+_0x9abfb0[_0x5ba3('0x1d')],_0x2a8f89;if(_0x5d3850>=_0x33be06){_0x5d3850=_0x33be06;_0x2a8f89=0xc8;}else{_0x2a8f89=0xce;}_0xdc5314[_0x5ba3('0x19')](_0x2a8f89);return _0xdc5314[_0x5ba3('0x1e')]('Content-Range',_0x171532+'-'+_0x5d3850+'/'+_0x33be06)[_0x5ba3('0x1a')](_0x33ccd9);}return null;};}function patchUpdates(_0x4bc7f2){return function(_0x47c76b){try{jsonpatch[_0x5ba3('0x1f')](_0x47c76b,_0x4bc7f2,!![]);}catch(_0x2b5406){return BPromise[_0x5ba3('0x20')](_0x2b5406);}return _0x47c76b[_0x5ba3('0x21')]();};}function saveUpdates(_0x2a0d6b,_0x5781e3){return function(_0x25fb4a){if(_0x25fb4a){return _0x25fb4a[_0x5ba3('0x22')](_0x2a0d6b)['then'](function(_0x24ff38){return _0x24ff38;});}return null;};}function removeEntity(_0x1a2646,_0x134ccb){return function(_0xe2f84){if(_0xe2f84){return _0xe2f84[_0x5ba3('0x23')]()[_0x5ba3('0x24')](function(){_0x1a2646['status'](0xcc)[_0x5ba3('0x18')]();});}};}function handleEntityNotFound(_0x13cbd4,_0x4f97e5){return function(_0x137915){if(!_0x137915){_0x13cbd4['sendStatus'](0x194);}return _0x137915;};}function handleError(_0x16e1b3,_0x547708){_0x547708=_0x547708||0x1f4;return function(_0x5549e2){logger[_0x5ba3('0x25')](_0x5549e2['stack']);if(_0x5549e2[_0x5ba3('0x26')]){delete _0x5549e2[_0x5ba3('0x26')];}_0x16e1b3[_0x5ba3('0x19')](_0x547708)['send'](_0x5549e2);};}exports['index']=function(_0x214f1d,_0x286cbf){var _0x198a0e={},_0x4e5a33={},_0x116f12={'count':0x0,'rows':[]};var _0x33530f=_[_0x5ba3('0x27')](db[_0x5ba3('0x28')][_0x5ba3('0x29')],function(_0x56d89f){return{'name':_0x56d89f[_0x5ba3('0x2a')],'type':_0x56d89f[_0x5ba3('0x2b')]['key']};});_0x4e5a33[_0x5ba3('0x2c')]=_['map'](_0x33530f,'name');_0x4e5a33[_0x5ba3('0x2d')]=_['keys'](_0x214f1d[_0x5ba3('0x2d')]);_0x4e5a33[_0x5ba3('0x2e')]=_[_0x5ba3('0x2f')](_0x4e5a33['model'],_0x4e5a33[_0x5ba3('0x2d')]);_0x198a0e[_0x5ba3('0x30')]=_['intersection'](_0x4e5a33[_0x5ba3('0x2c')],qs[_0x5ba3('0x31')](_0x214f1d['query'][_0x5ba3('0x31')]));_0x198a0e['attributes']=_0x198a0e[_0x5ba3('0x30')][_0x5ba3('0x32')]?_0x198a0e[_0x5ba3('0x30')]:_0x4e5a33[_0x5ba3('0x2c')];if(!_0x214f1d[_0x5ba3('0x2d')]['hasOwnProperty'](_0x5ba3('0x33'))){_0x198a0e['limit']=qs[_0x5ba3('0x1d')](_0x214f1d[_0x5ba3('0x2d')][_0x5ba3('0x1d')]);_0x198a0e['offset']=qs['offset'](_0x214f1d[_0x5ba3('0x2d')][_0x5ba3('0x1c')]);}_0x198a0e['order']=qs[_0x5ba3('0x34')](_0x214f1d[_0x5ba3('0x2d')][_0x5ba3('0x34')]);_0x198a0e[_0x5ba3('0x35')]=qs['filters'](_[_0x5ba3('0x36')](_0x214f1d[_0x5ba3('0x2d')],_0x4e5a33[_0x5ba3('0x2e')]),_0x33530f);if(_0x214f1d[_0x5ba3('0x2d')]['filter']){_0x198a0e[_0x5ba3('0x35')]=_[_0x5ba3('0x37')](_0x198a0e[_0x5ba3('0x35')],{'$or':_['map'](_0x33530f,function(_0x4206f0){if(_0x4206f0['type']!==_0x5ba3('0x38')){var _0x45177c={};_0x45177c[_0x4206f0['name']]={'$like':'%'+_0x214f1d[_0x5ba3('0x2d')][_0x5ba3('0x39')]+'%'};return _0x45177c;}})});}_0x198a0e=_[_0x5ba3('0x37')]({},_0x198a0e,_0x214f1d[_0x5ba3('0x3a')]);var _0x3dce1d={'where':_0x198a0e['where']};return db[_0x5ba3('0x28')][_0x5ba3('0x1b')](_0x3dce1d)[_0x5ba3('0x24')](function(_0x15bc65){_0x116f12[_0x5ba3('0x1b')]=_0x15bc65;if(_0x214f1d[_0x5ba3('0x2d')][_0x5ba3('0x3b')]){_0x198a0e[_0x5ba3('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x5ba3('0x3d')](_0x198a0e);})[_0x5ba3('0x24')](function(_0x58cf24){_0x116f12['rows']=_0x58cf24;return _0x116f12;})['then'](respondWithFilteredResult(_0x286cbf,_0x198a0e))[_0x5ba3('0x3e')](handleError(_0x286cbf,null));};exports[_0x5ba3('0x3f')]=function(_0x3f4b71,_0x27b8f3){var _0x5c7b5a={'raw':!![],'where':{'id':_0x3f4b71[_0x5ba3('0x40')]['id']}},_0x5da2c8={};_0x5da2c8['model']=_['keys'](db['Dynamics365Field'][_0x5ba3('0x29')]);_0x5da2c8[_0x5ba3('0x2d')]=_[_0x5ba3('0x41')](_0x3f4b71[_0x5ba3('0x2d')]);_0x5da2c8[_0x5ba3('0x2e')]=_[_0x5ba3('0x2f')](_0x5da2c8[_0x5ba3('0x2c')],_0x5da2c8[_0x5ba3('0x2d')]);_0x5c7b5a[_0x5ba3('0x30')]=_['intersection'](_0x5da2c8[_0x5ba3('0x2c')],qs[_0x5ba3('0x31')](_0x3f4b71[_0x5ba3('0x2d')]['fields']));_0x5c7b5a['attributes']=_0x5c7b5a['attributes']['length']?_0x5c7b5a[_0x5ba3('0x30')]:_0x5da2c8['model'];if(_0x3f4b71['query'][_0x5ba3('0x3b')]){_0x5c7b5a[_0x5ba3('0x3c')]=[{'all':!![]}];}_0x5c7b5a=_[_0x5ba3('0x37')]({},_0x5c7b5a,_0x3f4b71['options']);return db[_0x5ba3('0x28')][_0x5ba3('0x42')](_0x5c7b5a)[_0x5ba3('0x24')](handleEntityNotFound(_0x27b8f3,null))[_0x5ba3('0x24')](respondWithResult(_0x27b8f3,null))[_0x5ba3('0x3e')](handleError(_0x27b8f3,null));};exports[_0x5ba3('0x43')]=function(_0x3bd761,_0x452487){return db[_0x5ba3('0x28')][_0x5ba3('0x43')](_0x3bd761[_0x5ba3('0x44')],{})['then'](respondWithResult(_0x452487,0xc9))['catch'](handleError(_0x452487,null));};exports[_0x5ba3('0x22')]=function(_0x24d164,_0x3f98bf){if(_0x24d164[_0x5ba3('0x44')]['id']){delete _0x24d164[_0x5ba3('0x44')]['id'];}return db[_0x5ba3('0x28')][_0x5ba3('0x42')]({'where':{'id':_0x24d164[_0x5ba3('0x40')]['id']}})[_0x5ba3('0x24')](handleEntityNotFound(_0x3f98bf,null))[_0x5ba3('0x24')](saveUpdates(_0x24d164[_0x5ba3('0x44')],null))[_0x5ba3('0x24')](respondWithResult(_0x3f98bf,null))['catch'](handleError(_0x3f98bf,null));};exports['destroy']=function(_0x80c229,_0x180893){return db['Dynamics365Field'][_0x5ba3('0x42')]({'where':{'id':_0x80c229[_0x5ba3('0x40')]['id']}})['then'](handleEntityNotFound(_0x180893,null))[_0x5ba3('0x24')](removeEntity(_0x180893,null))[_0x5ba3('0x3e')](handleError(_0x180893,null));};
\ No newline at end of file
index 7760d50..fcb68a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17f6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0xe035b9,_0x3f56be){var _0x326975=function(_0x3cbcf3){while(--_0x3cbcf3){_0xe035b9['push'](_0xe035b9['shift']());}};_0x326975(++_0x3f56be);}(_0x17f6,0xf7));var _0x617f=function(_0x4288a5,_0x35fca2){_0x4288a5=_0x4288a5-0x0;var _0x1fc50e=_0x17f6[_0x4288a5];return _0x1fc50e;};'use strict';var _=require('lodash');var util=require(_0x617f('0x0'));var logger=require(_0x617f('0x1'))(_0x617f('0x2'));var moment=require(_0x617f('0x3'));var BPromise=require(_0x617f('0x4'));var rp=require(_0x617f('0x5'));var fs=require('fs');var path=require(_0x617f('0x6'));var rimraf=require(_0x617f('0x7'));var config=require(_0x617f('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0x617f('0x9')]=function(_0x49273d,_0x4a6f46){return _0x49273d[_0x617f('0xa')](_0x617f('0xb'),attributes,{'tableName':_0x617f('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaddd=['define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x1d8820,_0x1851f7){var _0x191963=function(_0x5bae4e){while(--_0x5bae4e){_0x1d8820['push'](_0x1d8820['shift']());}};_0x191963(++_0x1851f7);}(_0xaddd,0x1f0));var _0xdadd=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xaddd[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xdadd('0x0'));var util=require('util');var logger=require(_0xdadd('0x1'))('api');var moment=require(_0xdadd('0x2'));var BPromise=require(_0xdadd('0x3'));var rp=require(_0xdadd('0x4'));var fs=require('fs');var path=require(_0xdadd('0x5'));var rimraf=require(_0xdadd('0x6'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0xdadd('0x7')]=function(_0x5fc773,_0xb6f73a){return _0x5fc773[_0xdadd('0x8')](_0xdadd('0x9'),attributes,{'tableName':_0xdadd('0xa'),'paranoid':![],'indexes':[{'name':_0xdadd('0xb'),'fields':[_0xdadd('0xc'),_0xdadd('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 3c4b12f..e895115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee87=['error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xee87,0x10d));var _0x7ee8=function(_0x39db07,_0x151ea5){_0x39db07=_0x39db07-0x0;var _0xa16a63=_0xee87[_0x39db07];return _0xa16a63;};'use strict';var _=require('lodash');var util=require(_0x7ee8('0x0'));var moment=require(_0x7ee8('0x1'));var BPromise=require(_0x7ee8('0x2'));var rs=require(_0x7ee8('0x3'));var fs=require('fs');var Redis=require(_0x7ee8('0x4'));var db=require(_0x7ee8('0x5'))['db'];var utils=require(_0x7ee8('0x6'));var logger=require(_0x7ee8('0x7'))(_0x7ee8('0x8'));var config=require(_0x7ee8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ee8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dfed7,_0x4241bf,_0x2a9ea3){return new BPromise(function(_0x4275fc,_0x287224){return client['request'](_0x2dfed7,_0x2a9ea3)['then'](function(_0x3d984c){logger['info'](_0x7ee8('0xb'),_0x4241bf,_0x7ee8('0xc'));logger[_0x7ee8('0xd')](_0x7ee8('0xe'),_0x4241bf,_0x7ee8('0xc'),JSON[_0x7ee8('0xf')](_0x3d984c));if(_0x3d984c['error']){if(_0x3d984c['error'][_0x7ee8('0x10')]===0x1f4){logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);return _0x287224(_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);}logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);return _0x4275fc(_0x3d984c[_0x7ee8('0x11')][_0x7ee8('0x12')]);}else{logger[_0x7ee8('0x13')](_0x7ee8('0xb'),_0x4241bf,_0x7ee8('0xc'));_0x4275fc(_0x3d984c[_0x7ee8('0x14')][_0x7ee8('0x12')]);}})[_0x7ee8('0x15')](function(_0x3de0b8){logger[_0x7ee8('0x11')](_0x7ee8('0xb'),_0x4241bf,_0x3de0b8);_0x287224(_0x3de0b8);});});}
\ No newline at end of file
+var _0xe0c1=['then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','http','request'];(function(_0x13e453,_0x4ab30c){var _0x26aad2=function(_0x3387a1){while(--_0x3387a1){_0x13e453['push'](_0x13e453['shift']());}};_0x26aad2(++_0x4ab30c);}(_0xe0c1,0x10f));var _0x1e0c=function(_0xde4490,_0x3a7e5e){_0xde4490=_0xde4490-0x0;var _0xc951c9=_0xe0c1[_0xde4490];return _0xc951c9;};'use strict';var _=require(_0x1e0c('0x0'));var util=require(_0x1e0c('0x1'));var moment=require(_0x1e0c('0x2'));var BPromise=require(_0x1e0c('0x3'));var rs=require(_0x1e0c('0x4'));var fs=require('fs');var Redis=require(_0x1e0c('0x5'));var db=require(_0x1e0c('0x6'))['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'][_0x1e0c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ccad8,_0x876ada,_0x3d4bf5){return new BPromise(function(_0x21f9d0,_0x2241a2){return client[_0x1e0c('0x8')](_0x3ccad8,_0x3d4bf5)[_0x1e0c('0x9')](function(_0x5182bb){logger[_0x1e0c('0xa')](_0x1e0c('0xb'),_0x876ada,_0x1e0c('0xc'));logger[_0x1e0c('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x876ada,_0x1e0c('0xc'),JSON[_0x1e0c('0xe')](_0x5182bb));if(_0x5182bb[_0x1e0c('0xf')]){if(_0x5182bb['error'][_0x1e0c('0x10')]===0x1f4){logger['error'](_0x1e0c('0xb'),_0x876ada,_0x5182bb[_0x1e0c('0xf')][_0x1e0c('0x11')]);return _0x2241a2(_0x5182bb[_0x1e0c('0xf')][_0x1e0c('0x11')]);}logger[_0x1e0c('0xf')](_0x1e0c('0xb'),_0x876ada,_0x5182bb[_0x1e0c('0xf')][_0x1e0c('0x11')]);return _0x21f9d0(_0x5182bb[_0x1e0c('0xf')]['message']);}else{logger[_0x1e0c('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x876ada,_0x1e0c('0xc'));_0x21f9d0(_0x5182bb[_0x1e0c('0x12')][_0x1e0c('0x11')]);}})[_0x1e0c('0x13')](function(_0x3dfe8e){logger[_0x1e0c('0xf')](_0x1e0c('0xb'),_0x876ada,_0x3dfe8e);_0x2241a2(_0x3dfe8e);});});}
\ No newline at end of file
index 2a2b969..df4a625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4258=['create','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4258,0x7d));var _0x8425=function(_0x45d716,_0x2a2972){_0x45d716=_0x45d716-0x0;var _0x10aebe=_0x4258[_0x45d716];return _0x10aebe;};'use strict';var multer=require(_0x8425('0x0'));var util=require('util');var path=require(_0x8425('0x1'));var timeout=require('connect-timeout');var express=require(_0x8425('0x2'));var router=express['Router']();var auth=require(_0x8425('0x3'));var interaction=require(_0x8425('0x4'));var config=require(_0x8425('0x5'));var controller=require('./intFreshdeskAccount.controller');router[_0x8425('0x6')]('/',auth[_0x8425('0x7')](),controller[_0x8425('0x8')]);router[_0x8425('0x6')](_0x8425('0x9'),auth['isAuthenticated'](),controller[_0x8425('0xa')]);router[_0x8425('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8425('0xb')]);router[_0x8425('0x6')](_0x8425('0xc'),auth['isAuthenticated'](),controller[_0x8425('0xd')]);router[_0x8425('0xe')]('/',auth[_0x8425('0x7')](),controller[_0x8425('0xf')]);router[_0x8425('0xe')]('/:id/configurations',auth[_0x8425('0x7')](),controller['addConfiguration']);router['put'](_0x8425('0x9'),auth[_0x8425('0x7')](),controller[_0x8425('0x10')]);router[_0x8425('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8425('0x12')]);module[_0x8425('0x13')]=router;
\ No newline at end of file
+var _0xdf33=['destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete'];(function(_0x46b2f0,_0x52ad70){var _0x423fb3=function(_0x2b9799){while(--_0x2b9799){_0x46b2f0['push'](_0x46b2f0['shift']());}};_0x423fb3(++_0x52ad70);}(_0xdf33,0x1a4));var _0x3df3=function(_0x194511,_0x352b46){_0x194511=_0x194511-0x0;var _0x4877b5=_0xdf33[_0x194511];return _0x4877b5;};'use strict';var multer=require(_0x3df3('0x0'));var util=require(_0x3df3('0x1'));var path=require(_0x3df3('0x2'));var timeout=require(_0x3df3('0x3'));var express=require(_0x3df3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3df3('0x5'));var config=require(_0x3df3('0x6'));var controller=require(_0x3df3('0x7'));router[_0x3df3('0x8')]('/',auth[_0x3df3('0x9')](),controller[_0x3df3('0xa')]);router[_0x3df3('0x8')](_0x3df3('0xb'),auth[_0x3df3('0x9')](),controller[_0x3df3('0xc')]);router[_0x3df3('0x8')](_0x3df3('0xd'),auth['isAuthenticated'](),controller[_0x3df3('0xe')]);router[_0x3df3('0x8')](_0x3df3('0xf'),auth[_0x3df3('0x9')](),controller[_0x3df3('0x10')]);router[_0x3df3('0x11')]('/',auth[_0x3df3('0x9')](),controller['create']);router[_0x3df3('0x11')](_0x3df3('0xd'),auth[_0x3df3('0x9')](),controller['addConfiguration']);router['put'](_0x3df3('0xb'),auth[_0x3df3('0x9')](),controller[_0x3df3('0x12')]);router[_0x3df3('0x13')](_0x3df3('0xb'),auth['isAuthenticated'](),controller[_0x3df3('0x14')]);module[_0x3df3('0x15')]=router;
\ No newline at end of file
index b2b01a0..bd1188e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x078f=['username','exports','STRING'];(function(_0x4c6a8c,_0x10539c){var _0x23149e=function(_0x2ecf76){while(--_0x2ecf76){_0x4c6a8c['push'](_0x4c6a8c['shift']());}};_0x23149e(++_0x10539c);}(_0x078f,0x1b4));var _0xf078=function(_0x147925,_0x51e81b){_0x147925=_0x147925-0x0;var _0x596381=_0x078f[_0x147925];return _0x596381;};'use strict';var Sequelize=require('sequelize');module[_0xf078('0x0')]={'name':{'type':Sequelize[_0xf078('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf078('0x1')],'unique':_0xf078('0x2')},'apiKey':{'type':Sequelize[_0xf078('0x1')]},'remoteUri':{'type':Sequelize[_0xf078('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf078('0x1')]}};
\ No newline at end of file
+var _0x2c16=['sequelize','exports','STRING','username','remoteUri'];(function(_0xb6160,_0x206fdb){var _0xce706e=function(_0x581daa){while(--_0x581daa){_0xb6160['push'](_0xb6160['shift']());}};_0xce706e(++_0x206fdb);}(_0x2c16,0xf0));var _0x62c1=function(_0x506e0c,_0x4c1ad2){_0x506e0c=_0x506e0c-0x0;var _0x26bc22=_0x2c16[_0x506e0c];return _0x26bc22;};'use strict';var Sequelize=require(_0x62c1('0x0'));module[_0x62c1('0x1')]={'name':{'type':Sequelize[_0x62c1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x62c1('0x2')],'unique':_0x62c1('0x3')},'apiKey':{'type':Sequelize[_0x62c1('0x2')]},'remoteUri':{'type':Sequelize[_0x62c1('0x2')],'unique':_0x62c1('0x4')},'serverUrl':{'type':Sequelize[_0x62c1('0x2')]}};
\ No newline at end of file
index 1a0e262..32fbc5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['%s/%s','api/v2/ticket_fields','base64','requester','agent','priority','source','company','remove','includes','custom_text','custom_dropdown','label','default','choices','test','stringify','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','lodash','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','../../components/integrations/configuration','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','stack','name','send','FreshdeskAccount','map','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','rows','show','params','rawAttributes','fields','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','getSubjects','channel','getDescriptions','type','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','slice','substring','GET','format'];(function(_0x564699,_0x1d752a){var _0x3f0e15=function(_0x1ad015){while(--_0x1ad015){_0x564699['push'](_0x564699['shift']());}};_0x3f0e15(++_0x1d752a);}(_0xabce,0x103));var _0xeabc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xabce[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var db=require(_0xeabc('0x18'))['db'];var integrations=require(_0xeabc('0x19'));var jayson=require(_0xeabc('0x1a'));var client=jayson[_0xeabc('0x1b')][_0xeabc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x53df9c,_0x235c2d,_0x1319f3){if(_0x1319f3){var _0x3251c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3251c6['test'](_0x235c2d)){return _0x53df9c;}else{throw new db['Sequelize'][(_0xeabc('0x1d'))](_0xeabc('0x1e'));}}else{return _0x53df9c;}}function respondWithRpcPromise(_0x326bac,_0x53d5cb,_0xf913d7,_0x638976){return new BPromise(function(_0x49f2d8,_0x53fe28){var _0x10fa8e=_0x638976||client;return _0x10fa8e['request'](_0x326bac,_0xf913d7)[_0xeabc('0x1f')](function(_0x1b64b9){logger[_0xeabc('0x20')](_0xeabc('0x21'),_0x53d5cb,_0xeabc('0x22'));logger[_0xeabc('0x23')](_0xeabc('0x24'),_0x53d5cb,_0xeabc('0x22'),JSON['stringify'](_0x1b64b9));if(_0x1b64b9[_0xeabc('0x25')]){if(_0x1b64b9['error'][_0xeabc('0x26')]===0x1f4){logger[_0xeabc('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x53d5cb,_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);return _0x53fe28(_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);}logger[_0xeabc('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x53d5cb,_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);return _0x49f2d8(_0x1b64b9[_0xeabc('0x25')]['message']);}else{logger[_0xeabc('0x20')](_0xeabc('0x21'),_0x53d5cb,_0xeabc('0x22'));_0x49f2d8(_0x1b64b9[_0xeabc('0x28')]['message']);}})[_0xeabc('0x29')](function(_0x480440){logger[_0xeabc('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x53d5cb,_0x480440);_0x53fe28(_0x480440);});});}function respondWithStatusCode(_0x811f0d,_0x12acbd){_0x12acbd=_0x12acbd||0xcc;return function(_0x269621){if(_0x269621){return _0x811f0d[_0xeabc('0x2a')](_0x12acbd);}return _0x811f0d[_0xeabc('0x2b')](_0x12acbd)[_0xeabc('0x2c')]();};}function respondWithResult(_0x131722,_0x4c2693){_0x4c2693=_0x4c2693||0xc8;return function(_0x5b2934){if(_0x5b2934){return _0x131722[_0xeabc('0x2b')](_0x4c2693)['json'](_0x5b2934);}};}function respondWithFilteredResult(_0x3c1b5b,_0x2b342c){return function(_0x48fb52){if(_0x48fb52){var _0x2163e6=_0x48fb52[_0xeabc('0x2d')],_0x38572d=_0x2b342c[_0xeabc('0x2e')],_0x2b568f=_0x2b342c[_0xeabc('0x2e')]+_0x2b342c[_0xeabc('0x2f')],_0x2f8633;if(_0x2b568f>=_0x2163e6){_0x2b568f=_0x2163e6;_0x2f8633=0xc8;}else{_0x2f8633=0xce;}_0x3c1b5b[_0xeabc('0x2b')](_0x2f8633);return _0x3c1b5b['set'](_0xeabc('0x30'),_0x38572d+'-'+_0x2b568f+'/'+_0x2163e6)['json'](_0x48fb52);}return null;};}function patchUpdates(_0x2f03e8){return function(_0x2d027e){try{jsonpatch[_0xeabc('0x31')](_0x2d027e,_0x2f03e8,!![]);}catch(_0x3c606a){return BPromise[_0xeabc('0x32')](_0x3c606a);}return _0x2d027e[_0xeabc('0x33')]();};}function saveUpdates(_0x61c0af,_0x545d7f){return function(_0x78510a){if(_0x78510a){return _0x78510a[_0xeabc('0x34')](_0x61c0af)[_0xeabc('0x1f')](function(_0x4918e2){return _0x4918e2;});}return null;};}function removeEntity(_0x1e74ca,_0x3777c1){return function(_0x4492fd){if(_0x4492fd){return _0x4492fd['destroy']()[_0xeabc('0x1f')](function(){_0x1e74ca[_0xeabc('0x2b')](0xcc)[_0xeabc('0x2c')]();});}};}function handleEntityNotFound(_0x521091,_0xf98c7c){return function(_0x286203){if(!_0x286203){_0x521091['sendStatus'](0x194);}return _0x286203;};}function handleError(_0x50cca2,_0x254568){_0x254568=_0x254568||0x1f4;return function(_0x3829a9){logger['error'](_0x3829a9[_0xeabc('0x35')]);if(_0x3829a9[_0xeabc('0x36')]){delete _0x3829a9[_0xeabc('0x36')];}_0x50cca2[_0xeabc('0x2b')](_0x254568)[_0xeabc('0x37')](_0x3829a9);};}exports['index']=function(_0x353e48,_0x5b61fa){var _0x31ee7a={},_0x2bda29={},_0x311291={'count':0x0,'rows':[]};var _0x5b52c4=_['map'](db[_0xeabc('0x38')]['rawAttributes'],function(_0x113d5a){return{'name':_0x113d5a['fieldName'],'type':_0x113d5a['type']['key']};});_0x2bda29['model']=_[_0xeabc('0x39')](_0x5b52c4,'name');_0x2bda29[_0xeabc('0x3a')]=_[_0xeabc('0x3b')](_0x353e48['query']);_0x2bda29[_0xeabc('0x3c')]=_['intersection'](_0x2bda29[_0xeabc('0x3d')],_0x2bda29['query']);_0x31ee7a[_0xeabc('0x3e')]=_[_0xeabc('0x3f')](_0x2bda29[_0xeabc('0x3d')],qs['fields'](_0x353e48['query']['fields']));_0x31ee7a[_0xeabc('0x3e')]=_0x31ee7a[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x31ee7a['attributes']:_0x2bda29['model'];if(!_0x353e48[_0xeabc('0x3a')][_0xeabc('0x41')]('nolimit')){_0x31ee7a[_0xeabc('0x2f')]=qs['limit'](_0x353e48[_0xeabc('0x3a')]['limit']);_0x31ee7a['offset']=qs['offset'](_0x353e48[_0xeabc('0x3a')][_0xeabc('0x2e')]);}_0x31ee7a[_0xeabc('0x42')]=qs[_0xeabc('0x43')](_0x353e48['query'][_0xeabc('0x43')]);_0x31ee7a['where']=qs[_0xeabc('0x3c')](_[_0xeabc('0x44')](_0x353e48[_0xeabc('0x3a')],_0x2bda29[_0xeabc('0x3c')]),_0x5b52c4);if(_0x353e48[_0xeabc('0x3a')]['filter']){_0x31ee7a['where']=_[_0xeabc('0x45')](_0x31ee7a['where'],{'$or':_[_0xeabc('0x39')](_0x5b52c4,function(_0x2cdf59){if(_0x2cdf59['type']!==_0xeabc('0x46')){var _0x2b3c28={};_0x2b3c28[_0x2cdf59[_0xeabc('0x36')]]={'$like':'%'+_0x353e48[_0xeabc('0x3a')][_0xeabc('0x47')]+'%'};return _0x2b3c28;}})});}_0x31ee7a=_[_0xeabc('0x45')]({},_0x31ee7a,_0x353e48[_0xeabc('0x48')]);var _0x4b2fb6={'where':_0x31ee7a[_0xeabc('0x49')]};return db[_0xeabc('0x38')][_0xeabc('0x2d')](_0x4b2fb6)[_0xeabc('0x1f')](function(_0x271f8c){_0x311291[_0xeabc('0x2d')]=_0x271f8c;if(_0x353e48[_0xeabc('0x3a')][_0xeabc('0x4a')]){_0x31ee7a[_0xeabc('0x4b')]=[{'all':!![]}];}return db[_0xeabc('0x38')]['findAll'](_0x31ee7a);})[_0xeabc('0x1f')](function(_0x2e6efb){_0x311291[_0xeabc('0x4c')]=_0x2e6efb;return _0x311291;})[_0xeabc('0x1f')](respondWithFilteredResult(_0x5b61fa,_0x31ee7a))[_0xeabc('0x29')](handleError(_0x5b61fa,null));};exports[_0xeabc('0x4d')]=function(_0x268d95,_0x48df43){var _0x766743={'raw':![],'where':{'id':_0x268d95[_0xeabc('0x4e')]['id']}},_0x32e09b={};_0x32e09b[_0xeabc('0x3d')]=_[_0xeabc('0x3b')](db['FreshdeskAccount'][_0xeabc('0x4f')]);_0x32e09b[_0xeabc('0x3a')]=_[_0xeabc('0x3b')](_0x268d95[_0xeabc('0x3a')]);_0x32e09b['filters']=_[_0xeabc('0x3f')](_0x32e09b[_0xeabc('0x3d')],_0x32e09b['query']);_0x766743[_0xeabc('0x3e')]=_['intersection'](_0x32e09b[_0xeabc('0x3d')],qs['fields'](_0x268d95[_0xeabc('0x3a')][_0xeabc('0x50')]));_0x766743[_0xeabc('0x3e')]=_0x766743[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x766743[_0xeabc('0x3e')]:_0x32e09b[_0xeabc('0x3d')];if(_0x268d95[_0xeabc('0x3a')][_0xeabc('0x4a')]){_0x766743[_0xeabc('0x4b')]=[{'all':!![]}];}_0x766743=_['merge']({},_0x766743,_0x268d95[_0xeabc('0x48')]);return db[_0xeabc('0x38')][_0xeabc('0x51')](_0x766743)[_0xeabc('0x1f')](handleEntityNotFound(_0x48df43,null))['then'](respondWithResult(_0x48df43,null))[_0xeabc('0x29')](handleError(_0x48df43,null));};exports[_0xeabc('0x52')]=function(_0x10d56f,_0x21f972){return db['FreshdeskAccount'][_0xeabc('0x52')](_0x10d56f[_0xeabc('0x53')],{})[_0xeabc('0x1f')](respondWithResult(_0x21f972,0xc9))[_0xeabc('0x29')](handleError(_0x21f972,null));};exports[_0xeabc('0x34')]=function(_0x3b5e94,_0x14c322){if(_0x3b5e94[_0xeabc('0x53')]['id']){delete _0x3b5e94[_0xeabc('0x53')]['id'];}return db['FreshdeskAccount'][_0xeabc('0x51')]({'where':{'id':_0x3b5e94['params']['id']}})['then'](handleEntityNotFound(_0x14c322,null))['then'](saveUpdates(_0x3b5e94[_0xeabc('0x53')],null))[_0xeabc('0x1f')](respondWithResult(_0x14c322,null))[_0xeabc('0x29')](handleError(_0x14c322,null));};exports[_0xeabc('0x54')]=function(_0xe89728,_0x2f78f3){return db['FreshdeskAccount'][_0xeabc('0x51')]({'where':{'id':_0xe89728[_0xeabc('0x4e')]['id']}})[_0xeabc('0x1f')](handleEntityNotFound(_0x2f78f3,null))[_0xeabc('0x1f')](removeEntity(_0x2f78f3,null))[_0xeabc('0x29')](handleError(_0x2f78f3,null));};exports[_0xeabc('0x55')]=function(_0x1750e9,_0x25c728,_0x5820ca){var _0x5b8370={};var _0x180e62={};var _0x340520;var _0x2c0894;return db['FreshdeskAccount'][_0xeabc('0x56')]({'where':{'id':_0x1750e9['params']['id']}})['then'](handleEntityNotFound(_0x25c728,null))[_0xeabc('0x1f')](function(_0x1fca99){if(_0x1fca99){_0x340520=_0x1fca99;_0x180e62[_0xeabc('0x3d')]=_[_0xeabc('0x3b')](db[_0xeabc('0x57')][_0xeabc('0x4f')]);_0x180e62['query']=_[_0xeabc('0x3b')](_0x1750e9[_0xeabc('0x3a')]);_0x180e62[_0xeabc('0x3c')]=_[_0xeabc('0x3f')](_0x180e62[_0xeabc('0x3d')],_0x180e62[_0xeabc('0x3a')]);_0x5b8370['attributes']=_[_0xeabc('0x3f')](_0x180e62[_0xeabc('0x3d')],qs[_0xeabc('0x50')](_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x50')]));_0x5b8370[_0xeabc('0x3e')]=_0x5b8370[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x5b8370[_0xeabc('0x3e')]:_0x180e62['model'];_0x5b8370[_0xeabc('0x42')]=qs['sort'](_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x43')]);_0x5b8370[_0xeabc('0x49')]=qs[_0xeabc('0x3c')](_[_0xeabc('0x44')](_0x1750e9[_0xeabc('0x3a')],_0x180e62[_0xeabc('0x3c')]));if(_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x47')]){_0x5b8370[_0xeabc('0x49')]=_['merge'](_0x5b8370[_0xeabc('0x49')],{'$or':_[_0xeabc('0x39')](_0x5b8370[_0xeabc('0x3e')],function(_0x41cad5){var _0x5b4430={};_0x5b4430[_0x41cad5]={'$like':'%'+_0x1750e9[_0xeabc('0x3a')]['filter']+'%'};return _0x5b4430;})});}_0x5b8370=_['merge']({},_0x5b8370,_0x1750e9[_0xeabc('0x48')]);return _0x340520[_0xeabc('0x55')](_0x5b8370);}})[_0xeabc('0x1f')](function(_0x1c91e4){if(_0x1c91e4){_0x2c0894=_0x1c91e4['length'];if(!_0x1750e9['query'][_0xeabc('0x41')]('nolimit')){_0x5b8370['limit']=qs[_0xeabc('0x2f')](_0x1750e9['query']['limit']);_0x5b8370[_0xeabc('0x2e')]=qs[_0xeabc('0x2e')](_0x1750e9['query']['offset']);}return _0x340520[_0xeabc('0x55')](_0x5b8370);}})['then'](function(_0x238e2d){if(_0x238e2d){return _0x238e2d?{'count':_0x2c0894,'rows':_0x238e2d}:null;}})[_0xeabc('0x1f')](respondWithResult(_0x25c728,null))['catch'](handleError(_0x25c728,null));};exports['addConfiguration']=function(_0x24365a,_0x74f5ac,_0xd86ea7){if(_0x24365a[_0xeabc('0x53')]['id']){delete _0x24365a[_0xeabc('0x53')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x24365a[_0xeabc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x74f5ac,null))[_0xeabc('0x1f')](function(_0x5086c6){if(_0x5086c6){_0x24365a[_0xeabc('0x53')]['AccountId']=_0x5086c6['id'];_0x24365a[_0xeabc('0x53')]['Subjects']=integrations[_0xeabc('0x58')](_0x24365a[_0xeabc('0x53')][_0xeabc('0x59')],_0x24365a[_0xeabc('0x53')]['type']);_0x24365a[_0xeabc('0x53')]['Descriptions']=integrations[_0xeabc('0x5a')](_0x24365a[_0xeabc('0x53')][_0xeabc('0x59')],_0x24365a[_0xeabc('0x53')][_0xeabc('0x5b')]);return db['FreshdeskConfiguration'][_0xeabc('0x52')](_0x24365a[_0xeabc('0x53')],{'include':[{'model':db[_0xeabc('0x5c')],'as':_0xeabc('0x5d')},{'model':db['FreshdeskField'],'as':_0xeabc('0x5e')}]});}return null;})[_0xeabc('0x1f')](respondWithResult(_0x74f5ac,null))[_0xeabc('0x29')](handleError(_0x74f5ac,null));};exports[_0xeabc('0x5f')]=function(_0x5bacbb,_0xb9b460,_0x368cd4){var _0x287f88='';return db[_0xeabc('0x38')]['findOne']({'where':{'id':_0x5bacbb['params']['id']},'attributes':['id',_0xeabc('0x60'),'apiKey']})['then'](handleEntityNotFound(_0xb9b460,null))[_0xeabc('0x1f')](function(_0x460f07){if(_0x460f07){_0x287f88=_0x460f07[_0xeabc('0x60')];var _0x49679d=_0x287f88[_0xeabc('0x61')](-0x1);if(_0x49679d==='/'){_0x287f88=_0x287f88[_0xeabc('0x62')](0x0,_0x287f88['lastIndexOf'](_0x49679d));}return rp({'method':_0xeabc('0x63'),'uri':util[_0xeabc('0x64')](_0xeabc('0x65'),_0x287f88,_0xeabc('0x66')),'headers':{'Authorization':util[_0xeabc('0x64')]('Basic\x20%s',new Buffer(util[_0xeabc('0x64')]('%s:X',_0x460f07['apiKey']))['toString'](_0xeabc('0x67')))},'json':!![]});}})[_0xeabc('0x1f')](function(_0x1b6e9e){if(_0x1b6e9e){var _0x4424ce=[_0xeabc('0x68'),'subject',_0xeabc('0x69'),'description',_0xeabc('0x2b'),_0xeabc('0x6a'),'group',_0xeabc('0x6b'),'ticket_type','group',_0xeabc('0x6c')];_[_0xeabc('0x6d')](_0x1b6e9e,function(_0x439a48){return _0x4424ce[_0xeabc('0x6e')](_0x439a48[_0xeabc('0x36')])||!_0x439a48['default']&&_0x439a48[_0xeabc('0x5b')]!==_0xeabc('0x6f')&&_0x439a48[_0xeabc('0x5b')]!==_0xeabc('0x70');});return{'count':_0x1b6e9e[_0xeabc('0x40')],'rows':_[_0xeabc('0x39')](_0x1b6e9e,function(_0x2d05b4){return{'id':_0x2d05b4[_0xeabc('0x36')],'name':_0x2d05b4[_0xeabc('0x71')],'custom':!_0x2d05b4[_0xeabc('0x72')],'options':_0x2d05b4['choices']?_[_0xeabc('0x39')](_0x2d05b4[_0xeabc('0x73')],function(_0xba29f){return{'name':_['capitalize'](_0xba29f),'value':_0xba29f};}):[]};})};}})['then'](respondWithResult(_0xb9b460,null))[_0xeabc('0x29')](function(_0x273ca5){var _0xe90200=_0x5bacbb[_0xeabc('0x3a')][_0xeabc('0x74')]?0x1f4:_0x273ca5['statusCode']||0x1f4;logger[_0xeabc('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xe90200,JSON[_0xeabc('0x75')](_0x273ca5));delete _0x273ca5[_0xeabc('0x36')];if(_0xe90200===0x191){_0xe90200=0x190;}_0xb9b460['status'](_0xe90200)[_0xeabc('0x37')](_0x5bacbb[_0xeabc('0x3a')][_0xeabc('0x74')]?{'message':_0xeabc('0x76'),'statusCode':_0x273ca5[_0xeabc('0x77')]}:_0x273ca5);});};
\ No newline at end of file
+var _0x9957=['requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','custom_text','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','count','set','Content-Range','reject','update','end','stack','send','map','FreshdeskAccount','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','limit','offset','sort','where','pick','filter','merge','VIRTUAL','include','findAll','params','keys','length','options','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','order','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X'];(function(_0x107b75,_0x34e51a){var _0x4a94fb=function(_0x562f39){while(--_0x562f39){_0x107b75['push'](_0x107b75['shift']());}};_0x4a94fb(++_0x34e51a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var integrations=require(_0x7995('0x1a'));var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x23999f,_0x2bbe7a,_0x4cc004){if(_0x4cc004){var _0x58f5ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58f5ad[_0x7995('0x1e')](_0x2bbe7a)){return _0x23999f;}else{throw new db[(_0x7995('0x1f'))][(_0x7995('0x20'))](_0x7995('0x21'));}}else{return _0x23999f;}}function respondWithRpcPromise(_0x3f1d3e,_0x1a5310,_0x2202ce,_0x41cbf0){return new BPromise(function(_0x5377e5,_0x2eeacc){var _0x565d97=_0x41cbf0||client;return _0x565d97[_0x7995('0x22')](_0x3f1d3e,_0x2202ce)[_0x7995('0x23')](function(_0x43d4b8){logger[_0x7995('0x24')](_0x7995('0x25'),_0x1a5310,_0x7995('0x26'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1a5310,_0x7995('0x26'),JSON['stringify'](_0x43d4b8));if(_0x43d4b8['error']){if(_0x43d4b8[_0x7995('0x27')][_0x7995('0x28')]===0x1f4){logger['error'](_0x7995('0x25'),_0x1a5310,_0x43d4b8['error']['message']);return _0x2eeacc(_0x43d4b8[_0x7995('0x27')][_0x7995('0x29')]);}logger[_0x7995('0x27')](_0x7995('0x25'),_0x1a5310,_0x43d4b8[_0x7995('0x27')][_0x7995('0x29')]);return _0x5377e5(_0x43d4b8['error'][_0x7995('0x29')]);}else{logger[_0x7995('0x24')](_0x7995('0x25'),_0x1a5310,_0x7995('0x26'));_0x5377e5(_0x43d4b8[_0x7995('0x2a')][_0x7995('0x29')]);}})[_0x7995('0x2b')](function(_0x472195){logger['error'](_0x7995('0x25'),_0x1a5310,_0x472195);_0x2eeacc(_0x472195);});});}function respondWithStatusCode(_0x34e70c,_0x401dc3){_0x401dc3=_0x401dc3||0xcc;return function(_0x268ce7){if(_0x268ce7){return _0x34e70c[_0x7995('0x2c')](_0x401dc3);}return _0x34e70c[_0x7995('0x2d')](_0x401dc3)['end']();};}function respondWithResult(_0x47625f,_0x5911c3){_0x5911c3=_0x5911c3||0xc8;return function(_0x229742){if(_0x229742){return _0x47625f[_0x7995('0x2d')](_0x5911c3)[_0x7995('0x2e')](_0x229742);}};}function respondWithFilteredResult(_0x132a42,_0x11c1eb){return function(_0x4b6f99){if(_0x4b6f99){var _0x9b2a15=_0x4b6f99[_0x7995('0x2f')],_0x514445=_0x11c1eb['offset'],_0x456a28=_0x11c1eb['offset']+_0x11c1eb['limit'],_0x3250e0;if(_0x456a28>=_0x9b2a15){_0x456a28=_0x9b2a15;_0x3250e0=0xc8;}else{_0x3250e0=0xce;}_0x132a42[_0x7995('0x2d')](_0x3250e0);return _0x132a42[_0x7995('0x30')](_0x7995('0x31'),_0x514445+'-'+_0x456a28+'/'+_0x9b2a15)[_0x7995('0x2e')](_0x4b6f99);}return null;};}function patchUpdates(_0x2e3493){return function(_0x1ca460){try{jsonpatch['apply'](_0x1ca460,_0x2e3493,!![]);}catch(_0x481c74){return BPromise[_0x7995('0x32')](_0x481c74);}return _0x1ca460['save']();};}function saveUpdates(_0x553671,_0x3eb566){return function(_0x29fac5){if(_0x29fac5){return _0x29fac5[_0x7995('0x33')](_0x553671)[_0x7995('0x23')](function(_0x510841){return _0x510841;});}return null;};}function removeEntity(_0x44309d,_0x33e24e){return function(_0x5dd802){if(_0x5dd802){return _0x5dd802['destroy']()['then'](function(){_0x44309d[_0x7995('0x2d')](0xcc)[_0x7995('0x34')]();});}};}function handleEntityNotFound(_0x4a176f,_0x3e7020){return function(_0x51b95d){if(!_0x51b95d){_0x4a176f[_0x7995('0x2c')](0x194);}return _0x51b95d;};}function handleError(_0x1cb058,_0x177cb4){_0x177cb4=_0x177cb4||0x1f4;return function(_0x5014d2){logger['error'](_0x5014d2[_0x7995('0x35')]);if(_0x5014d2['name']){delete _0x5014d2['name'];}_0x1cb058[_0x7995('0x2d')](_0x177cb4)[_0x7995('0x36')](_0x5014d2);};}exports['index']=function(_0x1baa15,_0x1922b4){var _0x2b772f={},_0x18667c={},_0x1e3dbf={'count':0x0,'rows':[]};var _0x53002a=_[_0x7995('0x37')](db[_0x7995('0x38')][_0x7995('0x39')],function(_0x1d60b8){return{'name':_0x1d60b8['fieldName'],'type':_0x1d60b8[_0x7995('0x3a')][_0x7995('0x3b')]};});_0x18667c[_0x7995('0x3c')]=_[_0x7995('0x37')](_0x53002a,_0x7995('0x3d'));_0x18667c[_0x7995('0x3e')]=_['keys'](_0x1baa15[_0x7995('0x3e')]);_0x18667c[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x18667c[_0x7995('0x3c')],_0x18667c[_0x7995('0x3e')]);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x40')](_0x18667c[_0x7995('0x3c')],qs[_0x7995('0x42')](_0x1baa15[_0x7995('0x3e')][_0x7995('0x42')]));_0x2b772f[_0x7995('0x41')]=_0x2b772f[_0x7995('0x41')]['length']?_0x2b772f['attributes']:_0x18667c[_0x7995('0x3c')];if(!_0x1baa15[_0x7995('0x3e')]['hasOwnProperty']('nolimit')){_0x2b772f[_0x7995('0x43')]=qs['limit'](_0x1baa15['query'][_0x7995('0x43')]);_0x2b772f[_0x7995('0x44')]=qs[_0x7995('0x44')](_0x1baa15['query'][_0x7995('0x44')]);}_0x2b772f['order']=qs[_0x7995('0x45')](_0x1baa15['query']['sort']);_0x2b772f[_0x7995('0x46')]=qs[_0x7995('0x3f')](_[_0x7995('0x47')](_0x1baa15[_0x7995('0x3e')],_0x18667c['filters']),_0x53002a);if(_0x1baa15[_0x7995('0x3e')][_0x7995('0x48')]){_0x2b772f[_0x7995('0x46')]=_[_0x7995('0x49')](_0x2b772f['where'],{'$or':_['map'](_0x53002a,function(_0x1c37c6){if(_0x1c37c6['type']!==_0x7995('0x4a')){var _0x59c153={};_0x59c153[_0x1c37c6[_0x7995('0x3d')]]={'$like':'%'+_0x1baa15['query'][_0x7995('0x48')]+'%'};return _0x59c153;}})});}_0x2b772f=_[_0x7995('0x49')]({},_0x2b772f,_0x1baa15['options']);var _0x3e9e62={'where':_0x2b772f[_0x7995('0x46')]};return db[_0x7995('0x38')][_0x7995('0x2f')](_0x3e9e62)['then'](function(_0x2458cb){_0x1e3dbf[_0x7995('0x2f')]=_0x2458cb;if(_0x1baa15[_0x7995('0x3e')]['includeAll']){_0x2b772f[_0x7995('0x4b')]=[{'all':!![]}];}return db[_0x7995('0x38')][_0x7995('0x4c')](_0x2b772f);})[_0x7995('0x23')](function(_0x255313){_0x1e3dbf['rows']=_0x255313;return _0x1e3dbf;})[_0x7995('0x23')](respondWithFilteredResult(_0x1922b4,_0x2b772f))[_0x7995('0x2b')](handleError(_0x1922b4,null));};exports['show']=function(_0x3d1dbb,_0x5843ba){var _0x1d87f9={'raw':![],'where':{'id':_0x3d1dbb[_0x7995('0x4d')]['id']}},_0x187735={};_0x187735[_0x7995('0x3c')]=_[_0x7995('0x4e')](db[_0x7995('0x38')][_0x7995('0x39')]);_0x187735['query']=_[_0x7995('0x4e')](_0x3d1dbb[_0x7995('0x3e')]);_0x187735[_0x7995('0x3f')]=_['intersection'](_0x187735[_0x7995('0x3c')],_0x187735[_0x7995('0x3e')]);_0x1d87f9[_0x7995('0x41')]=_['intersection'](_0x187735['model'],qs['fields'](_0x3d1dbb[_0x7995('0x3e')][_0x7995('0x42')]));_0x1d87f9['attributes']=_0x1d87f9[_0x7995('0x41')][_0x7995('0x4f')]?_0x1d87f9[_0x7995('0x41')]:_0x187735[_0x7995('0x3c')];if(_0x3d1dbb[_0x7995('0x3e')]['includeAll']){_0x1d87f9[_0x7995('0x4b')]=[{'all':!![]}];}_0x1d87f9=_['merge']({},_0x1d87f9,_0x3d1dbb[_0x7995('0x50')]);return db[_0x7995('0x38')][_0x7995('0x51')](_0x1d87f9)['then'](handleEntityNotFound(_0x5843ba,null))['then'](respondWithResult(_0x5843ba,null))['catch'](handleError(_0x5843ba,null));};exports['create']=function(_0x2e13b0,_0x3709de){return db[_0x7995('0x38')][_0x7995('0x52')](_0x2e13b0[_0x7995('0x53')],{})[_0x7995('0x23')](respondWithResult(_0x3709de,0xc9))[_0x7995('0x2b')](handleError(_0x3709de,null));};exports[_0x7995('0x33')]=function(_0x328671,_0x17ecd3){if(_0x328671[_0x7995('0x53')]['id']){delete _0x328671[_0x7995('0x53')]['id'];}return db[_0x7995('0x38')][_0x7995('0x51')]({'where':{'id':_0x328671[_0x7995('0x4d')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x17ecd3,null))[_0x7995('0x23')](saveUpdates(_0x328671[_0x7995('0x53')],null))[_0x7995('0x23')](respondWithResult(_0x17ecd3,null))['catch'](handleError(_0x17ecd3,null));};exports[_0x7995('0x54')]=function(_0x630737,_0x3b8a54){return db[_0x7995('0x38')]['find']({'where':{'id':_0x630737['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3b8a54,null))[_0x7995('0x23')](removeEntity(_0x3b8a54,null))[_0x7995('0x2b')](handleError(_0x3b8a54,null));};exports[_0x7995('0x55')]=function(_0x51c50b,_0x13cd7b,_0x74ff38){var _0xef5044={};var _0x33c49c={};var _0x502d43;var _0x5e2d97;return db[_0x7995('0x38')][_0x7995('0x56')]({'where':{'id':_0x51c50b[_0x7995('0x4d')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x13cd7b,null))[_0x7995('0x23')](function(_0x27c5cd){if(_0x27c5cd){_0x502d43=_0x27c5cd;_0x33c49c[_0x7995('0x3c')]=_[_0x7995('0x4e')](db[_0x7995('0x57')]['rawAttributes']);_0x33c49c[_0x7995('0x3e')]=_[_0x7995('0x4e')](_0x51c50b[_0x7995('0x3e')]);_0x33c49c[_0x7995('0x3f')]=_['intersection'](_0x33c49c['model'],_0x33c49c[_0x7995('0x3e')]);_0xef5044[_0x7995('0x41')]=_['intersection'](_0x33c49c[_0x7995('0x3c')],qs[_0x7995('0x42')](_0x51c50b[_0x7995('0x3e')][_0x7995('0x42')]));_0xef5044[_0x7995('0x41')]=_0xef5044['attributes'][_0x7995('0x4f')]?_0xef5044['attributes']:_0x33c49c[_0x7995('0x3c')];_0xef5044[_0x7995('0x58')]=qs[_0x7995('0x45')](_0x51c50b[_0x7995('0x3e')][_0x7995('0x45')]);_0xef5044[_0x7995('0x46')]=qs[_0x7995('0x3f')](_[_0x7995('0x47')](_0x51c50b[_0x7995('0x3e')],_0x33c49c[_0x7995('0x3f')]));if(_0x51c50b[_0x7995('0x3e')][_0x7995('0x48')]){_0xef5044['where']=_[_0x7995('0x49')](_0xef5044[_0x7995('0x46')],{'$or':_[_0x7995('0x37')](_0xef5044[_0x7995('0x41')],function(_0x2c6548){var _0x54a2e0={};_0x54a2e0[_0x2c6548]={'$like':'%'+_0x51c50b['query'][_0x7995('0x48')]+'%'};return _0x54a2e0;})});}_0xef5044=_[_0x7995('0x49')]({},_0xef5044,_0x51c50b[_0x7995('0x50')]);return _0x502d43[_0x7995('0x55')](_0xef5044);}})['then'](function(_0x22d317){if(_0x22d317){_0x5e2d97=_0x22d317['length'];if(!_0x51c50b['query'][_0x7995('0x59')](_0x7995('0x5a'))){_0xef5044[_0x7995('0x43')]=qs[_0x7995('0x43')](_0x51c50b[_0x7995('0x3e')][_0x7995('0x43')]);_0xef5044[_0x7995('0x44')]=qs[_0x7995('0x44')](_0x51c50b[_0x7995('0x3e')][_0x7995('0x44')]);}return _0x502d43['getConfigurations'](_0xef5044);}})[_0x7995('0x23')](function(_0x8908cd){if(_0x8908cd){return _0x8908cd?{'count':_0x5e2d97,'rows':_0x8908cd}:null;}})[_0x7995('0x23')](respondWithResult(_0x13cd7b,null))['catch'](handleError(_0x13cd7b,null));};exports[_0x7995('0x5b')]=function(_0x1d2f9d,_0x705f0,_0x3a7d9d){if(_0x1d2f9d[_0x7995('0x53')]['id']){delete _0x1d2f9d[_0x7995('0x53')]['id'];}return db[_0x7995('0x38')][_0x7995('0x56')]({'where':{'id':_0x1d2f9d[_0x7995('0x4d')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x705f0,null))[_0x7995('0x23')](function(_0x535131){if(_0x535131){_0x1d2f9d['body'][_0x7995('0x5c')]=_0x535131['id'];_0x1d2f9d[_0x7995('0x53')][_0x7995('0x5d')]=integrations[_0x7995('0x5e')](_0x1d2f9d['body'][_0x7995('0x5f')],_0x1d2f9d[_0x7995('0x53')]['type']);_0x1d2f9d['body'][_0x7995('0x60')]=integrations[_0x7995('0x61')](_0x1d2f9d['body'][_0x7995('0x5f')],_0x1d2f9d['body'][_0x7995('0x3a')]);return db[_0x7995('0x57')]['create'](_0x1d2f9d['body'],{'include':[{'model':db[_0x7995('0x62')],'as':'Subjects'},{'model':db[_0x7995('0x62')],'as':_0x7995('0x60')}]});}return null;})[_0x7995('0x23')](respondWithResult(_0x705f0,null))[_0x7995('0x2b')](handleError(_0x705f0,null));};exports[_0x7995('0x63')]=function(_0x18cff7,_0x8af865,_0x14cb17){var _0x29e0ee='';return db[_0x7995('0x38')][_0x7995('0x56')]({'where':{'id':_0x18cff7[_0x7995('0x4d')]['id']},'attributes':['id',_0x7995('0x64'),_0x7995('0x65')]})[_0x7995('0x23')](handleEntityNotFound(_0x8af865,null))[_0x7995('0x23')](function(_0x6ad274){if(_0x6ad274){_0x29e0ee=_0x6ad274[_0x7995('0x64')];var _0x2ff7ba=_0x29e0ee[_0x7995('0x66')](-0x1);if(_0x2ff7ba==='/'){_0x29e0ee=_0x29e0ee[_0x7995('0x67')](0x0,_0x29e0ee[_0x7995('0x68')](_0x2ff7ba));}return rp({'method':_0x7995('0x69'),'uri':util[_0x7995('0x6a')](_0x7995('0x6b'),_0x29e0ee,_0x7995('0x6c')),'headers':{'Authorization':util[_0x7995('0x6a')](_0x7995('0x6d'),new Buffer(util['format'](_0x7995('0x6e'),_0x6ad274[_0x7995('0x65')]))['toString']('base64'))},'json':!![]});}})[_0x7995('0x23')](function(_0x3fe8fc){if(_0x3fe8fc){var _0x2d45d5=[_0x7995('0x6f'),_0x7995('0x70'),_0x7995('0x71'),'description',_0x7995('0x2d'),_0x7995('0x72'),_0x7995('0x73'),_0x7995('0x74'),_0x7995('0x75'),_0x7995('0x73'),_0x7995('0x76')];_[_0x7995('0x77')](_0x3fe8fc,function(_0x560095){return _0x2d45d5[_0x7995('0x78')](_0x560095[_0x7995('0x3d')])||!_0x560095['default']&&_0x560095['type']!==_0x7995('0x79')&&_0x560095[_0x7995('0x3a')]!==_0x7995('0x7a');});return{'count':_0x3fe8fc[_0x7995('0x4f')],'rows':_[_0x7995('0x37')](_0x3fe8fc,function(_0x4a02ea){return{'id':_0x4a02ea[_0x7995('0x3d')],'name':_0x4a02ea[_0x7995('0x7b')],'custom':!_0x4a02ea['default'],'options':_0x4a02ea[_0x7995('0x7c')]?_[_0x7995('0x37')](_0x4a02ea['choices'],function(_0x1535a3){return{'name':_['capitalize'](_0x1535a3),'value':_0x1535a3};}):[]};})};}})[_0x7995('0x23')](respondWithResult(_0x8af865,null))[_0x7995('0x2b')](function(_0x3ab421){var _0x428a1b=_0x18cff7[_0x7995('0x3e')]['test']?0x1f4:_0x3ab421[_0x7995('0x7d')]||0x1f4;logger[_0x7995('0x27')](_0x7995('0x7e'),'getFields',_0x428a1b,JSON[_0x7995('0x7f')](_0x3ab421));delete _0x3ab421[_0x7995('0x3d')];if(_0x428a1b===0x191){_0x428a1b=0x190;}_0x8af865[_0x7995('0x2d')](_0x428a1b)[_0x7995('0x36')](_0x18cff7['query'][_0x7995('0x1e')]?{'message':_0x7995('0x80'),'statusCode':_0x3ab421[_0x7995('0x7d')]}:_0x3ab421);});};
\ No newline at end of file
index 31c2d81..7f823b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd819=['../../config/logger','api','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define','int_freshdesk_accounts','util'];(function(_0x347b96,_0x18ba98){var _0x19c17e=function(_0x48d37f){while(--_0x48d37f){_0x347b96['push'](_0x347b96['shift']());}};_0x19c17e(++_0x18ba98);}(_0xd819,0x170));var _0x9d81=function(_0x50e703,_0x127370){_0x50e703=_0x50e703-0x0;var _0xf1840c=_0xd819[_0x50e703];return _0xf1840c;};'use strict';var _=require('lodash');var util=require(_0x9d81('0x0'));var logger=require(_0x9d81('0x1'))(_0x9d81('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d81('0x3'));var rimraf=require(_0x9d81('0x4'));var config=require(_0x9d81('0x5'));var attributes=require(_0x9d81('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x13f2c6,_0x403d03){return _0x13f2c6[_0x9d81('0x7')]('FreshdeskAccount',attributes,{'tableName':_0x9d81('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd001=['FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x39cb9c,_0x45e494){var _0x29e2d1=function(_0x3a6318){while(--_0x3a6318){_0x39cb9c['push'](_0x39cb9c['shift']());}};_0x29e2d1(++_0x45e494);}(_0xd001,0x152));var _0x1d00=function(_0x4f6d32,_0x20eb17){_0x4f6d32=_0x4f6d32-0x0;var _0x2bd505=_0xd001[_0x4f6d32];return _0x2bd505;};'use strict';var _=require('lodash');var util=require(_0x1d00('0x0'));var logger=require(_0x1d00('0x1'))(_0x1d00('0x2'));var moment=require('moment');var BPromise=require(_0x1d00('0x3'));var rp=require(_0x1d00('0x4'));var fs=require('fs');var path=require(_0x1d00('0x5'));var rimraf=require(_0x1d00('0x6'));var config=require(_0x1d00('0x7'));var attributes=require(_0x1d00('0x8'));var integrations=require(_0x1d00('0x9'));module[_0x1d00('0xa')]=function(_0x1dddbb,_0x3a79c1){return _0x1dddbb[_0x1d00('0xb')](_0x1d00('0xc'),attributes,{'tableName':_0x1d00('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7fe25ef..a59c539 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd5a=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','include','model','attributes','map','GetFreshdeskAccount','find','where','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','request\x20sent','debug'];(function(_0x5d136f,_0x4e28f1){var _0x4f2c38=function(_0x20451c){while(--_0x20451c){_0x5d136f['push'](_0x5d136f['shift']());}};_0x4f2c38(++_0x4e28f1);}(_0xdd5a,0x7d));var _0xadd5=function(_0x471938,_0x44ca57){_0x471938=_0x471938-0x0;var _0x3402e9=_0xdd5a[_0x471938];return _0x3402e9;};'use strict';var _=require(_0xadd5('0x0'));var util=require(_0xadd5('0x1'));var moment=require(_0xadd5('0x2'));var BPromise=require(_0xadd5('0x3'));var rs=require(_0xadd5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadd5('0x5'))['db'];var utils=require(_0xadd5('0x6'));var logger=require('../../config/logger')(_0xadd5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xadd5('0x8')][_0xadd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ba929,_0x48ee7a,_0x1c4ebb){return new BPromise(function(_0x107a19,_0x5eb4a6){return client[_0xadd5('0xa')](_0x3ba929,_0x1c4ebb)[_0xadd5('0xb')](function(_0x324691){logger[_0xadd5('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x48ee7a,_0xadd5('0xd'));logger[_0xadd5('0xe')](_0xadd5('0xf'),_0x48ee7a,'request\x20sent',JSON[_0xadd5('0x10')](_0x324691));if(_0x324691['error']){if(_0x324691[_0xadd5('0x11')][_0xadd5('0x12')]===0x1f4){logger[_0xadd5('0x11')](_0xadd5('0x13'),_0x48ee7a,_0x324691[_0xadd5('0x11')]['message']);return _0x5eb4a6(_0x324691[_0xadd5('0x11')][_0xadd5('0x14')]);}logger['error'](_0xadd5('0x13'),_0x48ee7a,_0x324691['error']['message']);return _0x107a19(_0x324691['error'][_0xadd5('0x14')]);}else{logger[_0xadd5('0xc')](_0xadd5('0x13'),_0x48ee7a,_0xadd5('0xd'));_0x107a19(_0x324691[_0xadd5('0x15')][_0xadd5('0x14')]);}})[_0xadd5('0x16')](function(_0x5f1840){logger[_0xadd5('0x11')](_0xadd5('0x13'),_0x48ee7a,_0x5f1840);_0x5eb4a6(_0x5f1840);});});}exports['GetFreshdeskAccount']=function(_0x4c95fa){var _0x35dcbf=this;return new Promise(function(_0xe539b3,_0x525795){return db[_0xadd5('0x17')][_0xadd5('0x18')]({'raw':_0x4c95fa[_0xadd5('0x19')]?_0x4c95fa[_0xadd5('0x19')][_0xadd5('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c95fa[_0xadd5('0x19')]?_0x4c95fa[_0xadd5('0x19')]['where']||null:null,'attributes':_0x4c95fa[_0xadd5('0x19')]?_0x4c95fa['options']['attributes']||null:null,'limit':_0x4c95fa['options']?_0x4c95fa['options']['limit']||null:null,'include':_0x4c95fa[_0xadd5('0x19')]?_0x4c95fa[_0xadd5('0x19')][_0xadd5('0x1b')]?_['map'](_0x4c95fa[_0xadd5('0x19')][_0xadd5('0x1b')],function(_0x3d5117){return{'model':db[_0x3d5117[_0xadd5('0x1c')]],'as':_0x3d5117['as'],'attributes':_0x3d5117[_0xadd5('0x1d')],'include':_0x3d5117[_0xadd5('0x1b')]?_[_0xadd5('0x1e')](_0x3d5117[_0xadd5('0x1b')],function(_0x23c1ab){return{'model':db[_0x23c1ab[_0xadd5('0x1c')]],'as':_0x23c1ab['as'],'attributes':_0x23c1ab['attributes'],'include':_0x23c1ab[_0xadd5('0x1b')]?_[_0xadd5('0x1e')](_0x23c1ab[_0xadd5('0x1b')],function(_0x49cdd0){return{'model':db[_0x49cdd0['model']],'as':_0x49cdd0['as'],'attributes':_0x49cdd0[_0xadd5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xadd5('0xb')](function(_0x232824){logger['info'](_0xadd5('0x1f'),_0x4c95fa);logger[_0xadd5('0xe')](_0xadd5('0x1f'),_0x4c95fa,JSON[_0xadd5('0x10')](_0x232824));_0xe539b3(_0x232824);})['catch'](function(_0x2e012f){logger['error'](_0xadd5('0x1f'),_0x2e012f[_0xadd5('0x14')],_0x4c95fa);_0x525795(_0x35dcbf[_0xadd5('0x11')](0x1f4,_0x2e012f[_0xadd5('0x14')]));});});};exports['ShowFreshdeskAccount']=function(_0x5f04c9){var _0x78da73=this;return new Promise(function(_0xdd4075,_0x27520c){return db[_0xadd5('0x17')][_0xadd5('0x20')]({'raw':_0x5f04c9[_0xadd5('0x19')]?_0x5f04c9[_0xadd5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5f04c9[_0xadd5('0x19')]?_0x5f04c9[_0xadd5('0x19')][_0xadd5('0x21')]||null:null,'attributes':_0x5f04c9[_0xadd5('0x19')]?_0x5f04c9[_0xadd5('0x19')][_0xadd5('0x1d')]||null:null,'include':_0x5f04c9['options']?_0x5f04c9[_0xadd5('0x19')][_0xadd5('0x1b')]?_[_0xadd5('0x1e')](_0x5f04c9['options']['include'],function(_0x29774c){return{'model':db[_0x29774c['model']],'as':_0x29774c['as'],'attributes':_0x29774c['attributes'],'include':_0x29774c['include']?_[_0xadd5('0x1e')](_0x29774c[_0xadd5('0x1b')],function(_0x1d5f3b){return{'model':db[_0x1d5f3b[_0xadd5('0x1c')]],'as':_0x1d5f3b['as'],'attributes':_0x1d5f3b[_0xadd5('0x1d')],'include':_0x1d5f3b[_0xadd5('0x1b')]?_['map'](_0x1d5f3b[_0xadd5('0x1b')],function(_0x29cbc3){return{'model':db[_0x29cbc3['model']],'as':_0x29cbc3['as'],'attributes':_0x29cbc3['attributes']};}):[]};}):[]};}):[]:[]})[_0xadd5('0xb')](function(_0x22980a){logger[_0xadd5('0xc')](_0xadd5('0x22'),_0x5f04c9);logger[_0xadd5('0xe')](_0xadd5('0x22'),_0x5f04c9,JSON[_0xadd5('0x10')](_0x22980a));_0xdd4075(_0x22980a);})[_0xadd5('0x16')](function(_0x501c80){logger['error']('ShowFreshdeskAccount',_0x501c80['message'],_0x5f04c9);_0x27520c(_0x78da73[_0xadd5('0x11')](0x1f4,_0x501c80[_0xadd5('0x14')]));});});};
\ No newline at end of file
+var _0x5214=['GetFreshdeskAccount','debug','ShowFreshdeskAccount','find','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5214,0x10c));var _0x4521=function(_0x2fbedc,_0x25d163){_0x2fbedc=_0x2fbedc-0x0;var _0x56b33e=_0x5214[_0x2fbedc];return _0x56b33e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4521('0x0'));var rs=require(_0x4521('0x1'));var fs=require('fs');var Redis=require(_0x4521('0x2'));var db=require(_0x4521('0x3'))['db'];var utils=require(_0x4521('0x4'));var logger=require('../../config/logger')(_0x4521('0x5'));var config=require(_0x4521('0x6'));var jayson=require(_0x4521('0x7'));var client=jayson[_0x4521('0x8')][_0x4521('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42fb2d,_0x2fe603,_0x31e60c){return new BPromise(function(_0x5e0e21,_0xd3091f){return client['request'](_0x42fb2d,_0x31e60c)[_0x4521('0xa')](function(_0x9364c8){logger[_0x4521('0xb')](_0x4521('0xc'),_0x2fe603,_0x4521('0xd'));logger['debug'](_0x4521('0xe'),_0x2fe603,_0x4521('0xd'),JSON[_0x4521('0xf')](_0x9364c8));if(_0x9364c8['error']){if(_0x9364c8[_0x4521('0x10')]['code']===0x1f4){logger[_0x4521('0x10')](_0x4521('0xc'),_0x2fe603,_0x9364c8[_0x4521('0x10')][_0x4521('0x11')]);return _0xd3091f(_0x9364c8[_0x4521('0x10')]['message']);}logger[_0x4521('0x10')](_0x4521('0xc'),_0x2fe603,_0x9364c8[_0x4521('0x10')]['message']);return _0x5e0e21(_0x9364c8[_0x4521('0x10')][_0x4521('0x11')]);}else{logger[_0x4521('0xb')](_0x4521('0xc'),_0x2fe603,_0x4521('0xd'));_0x5e0e21(_0x9364c8[_0x4521('0x12')][_0x4521('0x11')]);}})[_0x4521('0x13')](function(_0x49847c){logger[_0x4521('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x2fe603,_0x49847c);_0xd3091f(_0x49847c);});});}exports['GetFreshdeskAccount']=function(_0x1e53d3){var _0x5c3c16=this;return new Promise(function(_0x59f039,_0x2de530){return db[_0x4521('0x14')][_0x4521('0x15')]({'raw':_0x1e53d3[_0x4521('0x16')]?_0x1e53d3[_0x4521('0x16')][_0x4521('0x17')]===undefined?!![]:![]:!![],'where':_0x1e53d3[_0x4521('0x16')]?_0x1e53d3[_0x4521('0x16')]['where']||null:null,'attributes':_0x1e53d3['options']?_0x1e53d3[_0x4521('0x16')][_0x4521('0x18')]||null:null,'limit':_0x1e53d3[_0x4521('0x16')]?_0x1e53d3[_0x4521('0x16')][_0x4521('0x19')]||null:null,'include':_0x1e53d3[_0x4521('0x16')]?_0x1e53d3['options'][_0x4521('0x1a')]?_[_0x4521('0x1b')](_0x1e53d3[_0x4521('0x16')]['include'],function(_0xbfb50d){return{'model':db[_0xbfb50d[_0x4521('0x1c')]],'as':_0xbfb50d['as'],'attributes':_0xbfb50d[_0x4521('0x18')],'include':_0xbfb50d[_0x4521('0x1a')]?_['map'](_0xbfb50d['include'],function(_0x46847d){return{'model':db[_0x46847d[_0x4521('0x1c')]],'as':_0x46847d['as'],'attributes':_0x46847d[_0x4521('0x18')],'include':_0x46847d['include']?_[_0x4521('0x1b')](_0x46847d[_0x4521('0x1a')],function(_0x1b4492){return{'model':db[_0x1b4492[_0x4521('0x1c')]],'as':_0x1b4492['as'],'attributes':_0x1b4492['attributes']};}):[]};}):[]};}):[]:[]})[_0x4521('0xa')](function(_0x28005e){logger['info'](_0x4521('0x1d'),_0x1e53d3);logger[_0x4521('0x1e')](_0x4521('0x1d'),_0x1e53d3,JSON['stringify'](_0x28005e));_0x59f039(_0x28005e);})[_0x4521('0x13')](function(_0x1fe93a){logger['error'](_0x4521('0x1d'),_0x1fe93a[_0x4521('0x11')],_0x1e53d3);_0x2de530(_0x5c3c16[_0x4521('0x10')](0x1f4,_0x1fe93a[_0x4521('0x11')]));});});};exports[_0x4521('0x1f')]=function(_0x2a3eff){var _0x57a18b=this;return new Promise(function(_0x392082,_0x46cebc){return db['FreshdeskAccount'][_0x4521('0x20')]({'raw':_0x2a3eff[_0x4521('0x16')]?_0x2a3eff['options'][_0x4521('0x17')]===undefined?!![]:![]:!![],'where':_0x2a3eff['options']?_0x2a3eff[_0x4521('0x16')]['where']||null:null,'attributes':_0x2a3eff[_0x4521('0x16')]?_0x2a3eff[_0x4521('0x16')][_0x4521('0x18')]||null:null,'include':_0x2a3eff['options']?_0x2a3eff[_0x4521('0x16')][_0x4521('0x1a')]?_[_0x4521('0x1b')](_0x2a3eff[_0x4521('0x16')][_0x4521('0x1a')],function(_0x31c5cc){return{'model':db[_0x31c5cc[_0x4521('0x1c')]],'as':_0x31c5cc['as'],'attributes':_0x31c5cc['attributes'],'include':_0x31c5cc[_0x4521('0x1a')]?_[_0x4521('0x1b')](_0x31c5cc['include'],function(_0x352f2b){return{'model':db[_0x352f2b[_0x4521('0x1c')]],'as':_0x352f2b['as'],'attributes':_0x352f2b['attributes'],'include':_0x352f2b[_0x4521('0x1a')]?_['map'](_0x352f2b[_0x4521('0x1a')],function(_0x1cf097){return{'model':db[_0x1cf097[_0x4521('0x1c')]],'as':_0x1cf097['as'],'attributes':_0x1cf097[_0x4521('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a4c8b){logger[_0x4521('0xb')](_0x4521('0x1f'),_0x2a3eff);logger[_0x4521('0x1e')](_0x4521('0x1f'),_0x2a3eff,JSON[_0x4521('0xf')](_0x1a4c8b));_0x392082(_0x1a4c8b);})['catch'](function(_0x21f98d){logger[_0x4521('0x10')](_0x4521('0x1f'),_0x21f98d['message'],_0x2a3eff);_0x46cebc(_0x57a18b[_0x4521('0x10')](0x1f4,_0x21f98d[_0x4521('0x11')]));});});};
\ No newline at end of file
index 176638d..3e60df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb66c=['getSubjects','/:id/descriptions','/:id/tags','getTags','setTags','put','update','/:id','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0xfb2691,_0x58450c){var _0x315701=function(_0x589ba4){while(--_0x589ba4){_0xfb2691['push'](_0xfb2691['shift']());}};_0x315701(++_0x58450c);}(_0xb66c,0x163));var _0xcb66=function(_0x4db9db,_0x31c710){_0x4db9db=_0x4db9db-0x0;var _0x24159b=_0xb66c[_0x4db9db];return _0x24159b;};'use strict';var multer=require(_0xcb66('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcb66('0x1'));var express=require(_0xcb66('0x2'));var router=express[_0xcb66('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcb66('0x4'));var config=require(_0xcb66('0x5'));var controller=require(_0xcb66('0x6'));router[_0xcb66('0x7')]('/',auth[_0xcb66('0x8')](),controller['index']);router['get']('/:id',auth[_0xcb66('0x8')](),controller[_0xcb66('0x9')]);router[_0xcb66('0x7')](_0xcb66('0xa'),auth[_0xcb66('0x8')](),controller[_0xcb66('0xb')]);router[_0xcb66('0x7')](_0xcb66('0xc'),auth[_0xcb66('0x8')](),controller[_0xcb66('0xd')]);router[_0xcb66('0x7')](_0xcb66('0xe'),auth[_0xcb66('0x8')](),controller['getDescriptions']);router[_0xcb66('0x7')](_0xcb66('0xf'),auth[_0xcb66('0x8')](),controller[_0xcb66('0x10')]);router['post']('/',auth[_0xcb66('0x8')](),controller['create']);router['post'](_0xcb66('0xf'),auth[_0xcb66('0x8')](),controller[_0xcb66('0x11')]);router[_0xcb66('0x12')]('/:id',auth[_0xcb66('0x8')](),controller[_0xcb66('0x13')]);router['delete'](_0xcb66('0x14'),auth['isAuthenticated'](),controller[_0xcb66('0x15')]);module[_0xcb66('0x16')]=router;
\ No newline at end of file
+var _0xc073=['../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','post','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x284ad3,_0x4c239f){var _0x579e38=function(_0x707415){while(--_0x707415){_0x284ad3['push'](_0x284ad3['shift']());}};_0x579e38(++_0x4c239f);}(_0xc073,0xdd));var _0x3c07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc073[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x3c07('0x0'));var path=require(_0x3c07('0x1'));var timeout=require(_0x3c07('0x2'));var express=require(_0x3c07('0x3'));var router=express['Router']();var auth=require(_0x3c07('0x4'));var interaction=require(_0x3c07('0x5'));var config=require('../../config/environment');var controller=require(_0x3c07('0x6'));router['get']('/',auth[_0x3c07('0x7')](),controller[_0x3c07('0x8')]);router[_0x3c07('0x9')](_0x3c07('0xa'),auth[_0x3c07('0x7')](),controller['show']);router['get'](_0x3c07('0xb'),auth[_0x3c07('0x7')](),controller[_0x3c07('0xc')]);router['get'](_0x3c07('0xd'),auth[_0x3c07('0x7')](),controller['getSubjects']);router[_0x3c07('0x9')](_0x3c07('0xe'),auth[_0x3c07('0x7')](),controller[_0x3c07('0xf')]);router[_0x3c07('0x9')]('/:id/tags',auth[_0x3c07('0x7')](),controller['getTags']);router['post']('/',auth[_0x3c07('0x7')](),controller[_0x3c07('0x10')]);router[_0x3c07('0x11')](_0x3c07('0x12'),auth['isAuthenticated'](),controller[_0x3c07('0x13')]);router[_0x3c07('0x14')](_0x3c07('0xa'),auth[_0x3c07('0x7')](),controller[_0x3c07('0x15')]);router[_0x3c07('0x16')](_0x3c07('0xa'),auth[_0x3c07('0x7')](),controller[_0x3c07('0x17')]);module[_0x3c07('0x18')]=router;
\ No newline at end of file
index 83a2abc..f5f2ebc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b46=['sequelize','STRING'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x9b46,0x1d2));var _0x69b4=function(_0x5d043c,_0xff15e4){_0x5d043c=_0x5d043c-0x0;var _0x422b57=_0x9b46[_0x5d043c];return _0x422b57;};'use strict';var Sequelize=require(_0x69b4('0x0'));module['exports']={'name':{'type':Sequelize[_0x69b4('0x1')]},'description':{'type':Sequelize[_0x69b4('0x1')]}};
\ No newline at end of file
+var _0x0334=['STRING','sequelize','exports'];(function(_0xa3fadc,_0xd1e16){var _0x23ecb8=function(_0x2c71f7){while(--_0x2c71f7){_0xa3fadc['push'](_0xa3fadc['shift']());}};_0x23ecb8(++_0xd1e16);}(_0x0334,0xb2));var _0x4033=function(_0x189636,_0x4987a9){_0x189636=_0x189636-0x0;var _0x177ccd=_0x0334[_0x189636];return _0x177ccd;};'use strict';var Sequelize=require(_0x4033('0x0'));module[_0x4033('0x1')]={'name':{'type':Sequelize[_0x4033('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e992531..730d4fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99fb=['set','apply','save','update','then','stack','name','send','index','map','FreshdeskConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','destroy','findOne','FreshdeskField','rawAttributes','pick','getFields','options','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x99fb,0x92));var _0xb99f=function(_0x2d1bdf,_0x269db5){_0x2d1bdf=_0x2d1bdf-0x0;var _0x5ac8ba=_0x99fb[_0x2d1bdf];return _0x5ac8ba;};'use strict';var pdf=require(_0xb99f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb99f('0x1'));var zipdir=require(_0xb99f('0x2'));var jsonpatch=require(_0xb99f('0x3'));var rp=require(_0xb99f('0x4'));var moment=require(_0xb99f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb99f('0x6'));var util=require(_0xb99f('0x7'));var path=require('path');var sox=require(_0xb99f('0x8'));var csv=require(_0xb99f('0x9'));var ejs=require(_0xb99f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb99f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb99f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb99f('0x9'));var querystring=require(_0xb99f('0xd'));var Papa=require('papaparse');var Redis=require(_0xb99f('0xe'));var authService=require(_0xb99f('0xf'));var qs=require(_0xb99f('0x10'));var as=require(_0xb99f('0x11'));var hardwareService=require(_0xb99f('0x12'));var logger=require(_0xb99f('0x13'))(_0xb99f('0x14'));var utils=require('../../config/utils');var config=require(_0xb99f('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xb99f('0x16')][_0xb99f('0x17')]({'port':0x232a});function checkPasswordPattern(_0x2ede66,_0x87b4aa,_0xaeed9){if(_0xaeed9){var _0x581e70=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x581e70[_0xb99f('0x18')](_0x87b4aa)){return _0x2ede66;}else{throw new db['Sequelize'][(_0xb99f('0x19'))](_0xb99f('0x1a'));}}else{return _0x2ede66;}}function respondWithRpcPromise(_0x4a63b1,_0x3743bf,_0x4b5b61,_0x1504de){return new BPromise(function(_0x58db95,_0x383d9d){var _0x56f0b9=_0x1504de||client;return _0x56f0b9[_0xb99f('0x1b')](_0x4a63b1,_0x4b5b61)['then'](function(_0x15d562){logger[_0xb99f('0x1c')](_0xb99f('0x1d'),_0x3743bf,_0xb99f('0x1e'));logger[_0xb99f('0x1f')](_0xb99f('0x20'),_0x3743bf,_0xb99f('0x1e'),JSON[_0xb99f('0x21')](_0x15d562));if(_0x15d562[_0xb99f('0x22')]){if(_0x15d562[_0xb99f('0x22')][_0xb99f('0x23')]===0x1f4){logger[_0xb99f('0x22')](_0xb99f('0x1d'),_0x3743bf,_0x15d562[_0xb99f('0x22')]['message']);return _0x383d9d(_0x15d562['error'][_0xb99f('0x24')]);}logger[_0xb99f('0x22')](_0xb99f('0x1d'),_0x3743bf,_0x15d562[_0xb99f('0x22')][_0xb99f('0x24')]);return _0x58db95(_0x15d562[_0xb99f('0x22')][_0xb99f('0x24')]);}else{logger[_0xb99f('0x1c')](_0xb99f('0x1d'),_0x3743bf,_0xb99f('0x1e'));_0x58db95(_0x15d562[_0xb99f('0x25')]['message']);}})[_0xb99f('0x26')](function(_0x59df54){logger[_0xb99f('0x22')](_0xb99f('0x1d'),_0x3743bf,_0x59df54);_0x383d9d(_0x59df54);});});}function respondWithStatusCode(_0x480f00,_0x5617da){_0x5617da=_0x5617da||0xcc;return function(_0x5c2b1a){if(_0x5c2b1a){return _0x480f00[_0xb99f('0x27')](_0x5617da);}return _0x480f00['status'](_0x5617da)[_0xb99f('0x28')]();};}function respondWithResult(_0x3f77cb,_0x1369ac){_0x1369ac=_0x1369ac||0xc8;return function(_0x3c4f27){if(_0x3c4f27){return _0x3f77cb[_0xb99f('0x29')](_0x1369ac)[_0xb99f('0x2a')](_0x3c4f27);}};}function respondWithFilteredResult(_0x362842,_0x2c8dc2){return function(_0x4f0434){if(_0x4f0434){var _0x342cb0=_0x4f0434[_0xb99f('0x2b')],_0x5e9412=_0x2c8dc2[_0xb99f('0x2c')],_0x311456=_0x2c8dc2[_0xb99f('0x2c')]+_0x2c8dc2[_0xb99f('0x2d')],_0x154acb;if(_0x311456>=_0x342cb0){_0x311456=_0x342cb0;_0x154acb=0xc8;}else{_0x154acb=0xce;}_0x362842[_0xb99f('0x29')](_0x154acb);return _0x362842[_0xb99f('0x2e')]('Content-Range',_0x5e9412+'-'+_0x311456+'/'+_0x342cb0)['json'](_0x4f0434);}return null;};}function patchUpdates(_0x1a5b8a){return function(_0x3db95d){try{jsonpatch[_0xb99f('0x2f')](_0x3db95d,_0x1a5b8a,!![]);}catch(_0x15e185){return BPromise['reject'](_0x15e185);}return _0x3db95d[_0xb99f('0x30')]();};}function saveUpdates(_0x2eb578,_0x778e58){return function(_0x525a15){if(_0x525a15){return _0x525a15[_0xb99f('0x31')](_0x2eb578)[_0xb99f('0x32')](function(_0x362a8f){return _0x362a8f;});}return null;};}function removeEntity(_0x22a0c4,_0x2c78ce){return function(_0x329907){if(_0x329907){return _0x329907['destroy']()[_0xb99f('0x32')](function(){_0x22a0c4[_0xb99f('0x29')](0xcc)[_0xb99f('0x28')]();});}};}function handleEntityNotFound(_0x2e2a90,_0x86e2f8){return function(_0x5169f1){if(!_0x5169f1){_0x2e2a90[_0xb99f('0x27')](0x194);}return _0x5169f1;};}function handleError(_0x5ca55d,_0x125e46){_0x125e46=_0x125e46||0x1f4;return function(_0x1271fc){logger['error'](_0x1271fc[_0xb99f('0x33')]);if(_0x1271fc[_0xb99f('0x34')]){delete _0x1271fc[_0xb99f('0x34')];}_0x5ca55d[_0xb99f('0x29')](_0x125e46)[_0xb99f('0x35')](_0x1271fc);};}exports[_0xb99f('0x36')]=function(_0x306245,_0x5ac497){var _0x56e892={},_0x4c91e2={},_0x4ab4b1={'count':0x0,'rows':[]};var _0x146940=_[_0xb99f('0x37')](db[_0xb99f('0x38')]['rawAttributes'],function(_0x26b41b){return{'name':_0x26b41b['fieldName'],'type':_0x26b41b[_0xb99f('0x39')][_0xb99f('0x3a')]};});_0x4c91e2[_0xb99f('0x3b')]=_['map'](_0x146940,_0xb99f('0x34'));_0x4c91e2[_0xb99f('0x3c')]=_[_0xb99f('0x3d')](_0x306245[_0xb99f('0x3c')]);_0x4c91e2[_0xb99f('0x3e')]=_[_0xb99f('0x3f')](_0x4c91e2[_0xb99f('0x3b')],_0x4c91e2[_0xb99f('0x3c')]);_0x56e892[_0xb99f('0x40')]=_['intersection'](_0x4c91e2[_0xb99f('0x3b')],qs[_0xb99f('0x41')](_0x306245[_0xb99f('0x3c')][_0xb99f('0x41')]));_0x56e892[_0xb99f('0x40')]=_0x56e892[_0xb99f('0x40')][_0xb99f('0x42')]?_0x56e892[_0xb99f('0x40')]:_0x4c91e2[_0xb99f('0x3b')];if(!_0x306245[_0xb99f('0x3c')][_0xb99f('0x43')](_0xb99f('0x44'))){_0x56e892[_0xb99f('0x2d')]=qs[_0xb99f('0x2d')](_0x306245['query']['limit']);_0x56e892[_0xb99f('0x2c')]=qs[_0xb99f('0x2c')](_0x306245['query'][_0xb99f('0x2c')]);}_0x56e892[_0xb99f('0x45')]=qs['sort'](_0x306245[_0xb99f('0x3c')][_0xb99f('0x46')]);_0x56e892[_0xb99f('0x47')]=qs[_0xb99f('0x3e')](_['pick'](_0x306245[_0xb99f('0x3c')],_0x4c91e2[_0xb99f('0x3e')]),_0x146940);if(_0x306245['query'][_0xb99f('0x48')]){_0x56e892[_0xb99f('0x47')]=_[_0xb99f('0x49')](_0x56e892[_0xb99f('0x47')],{'$or':_[_0xb99f('0x37')](_0x146940,function(_0x546ef1){if(_0x546ef1[_0xb99f('0x39')]!==_0xb99f('0x4a')){var _0x395ff0={};_0x395ff0[_0x546ef1[_0xb99f('0x34')]]={'$like':'%'+_0x306245[_0xb99f('0x3c')][_0xb99f('0x48')]+'%'};return _0x395ff0;}})});}_0x56e892=_[_0xb99f('0x49')]({},_0x56e892,_0x306245['options']);var _0x539c68={'where':_0x56e892[_0xb99f('0x47')]};return db[_0xb99f('0x38')][_0xb99f('0x2b')](_0x539c68)['then'](function(_0x169ba4){_0x4ab4b1['count']=_0x169ba4;if(_0x306245[_0xb99f('0x3c')][_0xb99f('0x4b')]){_0x56e892[_0xb99f('0x4c')]=[{'all':!![]}];}return db[_0xb99f('0x38')][_0xb99f('0x4d')](_0x56e892);})[_0xb99f('0x32')](function(_0x50e339){_0x4ab4b1[_0xb99f('0x4e')]=_0x50e339;return _0x4ab4b1;})[_0xb99f('0x32')](respondWithFilteredResult(_0x5ac497,_0x56e892))[_0xb99f('0x26')](handleError(_0x5ac497,null));};exports[_0xb99f('0x4f')]=function(_0x3e875c,_0x1025be){var _0x5eda52={'raw':![],'where':{'id':_0x3e875c[_0xb99f('0x50')]['id']}},_0xe7f402={};_0xe7f402[_0xb99f('0x3b')]=_[_0xb99f('0x3d')](db['FreshdeskConfiguration']['rawAttributes']);_0xe7f402[_0xb99f('0x3c')]=_[_0xb99f('0x3d')](_0x3e875c[_0xb99f('0x3c')]);_0xe7f402['filters']=_['intersection'](_0xe7f402[_0xb99f('0x3b')],_0xe7f402[_0xb99f('0x3c')]);_0x5eda52[_0xb99f('0x40')]=_['intersection'](_0xe7f402[_0xb99f('0x3b')],qs[_0xb99f('0x41')](_0x3e875c['query'][_0xb99f('0x41')]));_0x5eda52[_0xb99f('0x40')]=_0x5eda52['attributes'][_0xb99f('0x42')]?_0x5eda52[_0xb99f('0x40')]:_0xe7f402[_0xb99f('0x3b')];if(_0x3e875c['query']['includeAll']){_0x5eda52[_0xb99f('0x4c')]=[{'all':!![]}];}_0x5eda52=_[_0xb99f('0x49')]({},_0x5eda52,_0x3e875c['options']);return db[_0xb99f('0x38')][_0xb99f('0x51')](_0x5eda52)[_0xb99f('0x32')](handleEntityNotFound(_0x1025be,null))[_0xb99f('0x32')](respondWithResult(_0x1025be,null))[_0xb99f('0x26')](handleError(_0x1025be,null));};exports[_0xb99f('0x52')]=function(_0x2438b0,_0x5d1649){return db['FreshdeskConfiguration'][_0xb99f('0x52')](_0x2438b0['body'],{})['then'](respondWithResult(_0x5d1649,0xc9))[_0xb99f('0x26')](handleError(_0x5d1649,null));};exports[_0xb99f('0x31')]=function(_0x1bd99b,_0x45d6c9){if(_0x1bd99b[_0xb99f('0x53')]['id']){delete _0x1bd99b[_0xb99f('0x53')]['id'];}return db['FreshdeskConfiguration'][_0xb99f('0x51')]({'where':{'id':_0x1bd99b[_0xb99f('0x50')]['id']}})[_0xb99f('0x32')](handleEntityNotFound(_0x45d6c9,null))['then'](saveUpdates(_0x1bd99b[_0xb99f('0x53')],null))[_0xb99f('0x32')](respondWithResult(_0x45d6c9,null))[_0xb99f('0x26')](handleError(_0x45d6c9,null));};exports[_0xb99f('0x54')]=function(_0x2d2dce,_0x68a5a7){return db[_0xb99f('0x38')][_0xb99f('0x51')]({'where':{'id':_0x2d2dce[_0xb99f('0x50')]['id']}})[_0xb99f('0x32')](handleEntityNotFound(_0x68a5a7,null))[_0xb99f('0x32')](removeEntity(_0x68a5a7,null))[_0xb99f('0x26')](handleError(_0x68a5a7,null));};exports['getFields']=function(_0x35e3aa,_0x49ce4e,_0x44b4fe){var _0x3bf89e={};var _0x425664={};var _0x48335a;var _0x20c039;return db['FreshdeskConfiguration'][_0xb99f('0x55')]({'where':{'id':_0x35e3aa[_0xb99f('0x50')]['id']}})[_0xb99f('0x32')](handleEntityNotFound(_0x49ce4e,null))[_0xb99f('0x32')](function(_0x568223){if(_0x568223){_0x48335a=_0x568223;_0x425664['model']=_[_0xb99f('0x3d')](db[_0xb99f('0x56')][_0xb99f('0x57')]);_0x425664[_0xb99f('0x3c')]=_[_0xb99f('0x3d')](_0x35e3aa[_0xb99f('0x3c')]);_0x425664['filters']=_[_0xb99f('0x3f')](_0x425664[_0xb99f('0x3b')],_0x425664[_0xb99f('0x3c')]);_0x3bf89e[_0xb99f('0x40')]=_[_0xb99f('0x3f')](_0x425664[_0xb99f('0x3b')],qs[_0xb99f('0x41')](_0x35e3aa[_0xb99f('0x3c')][_0xb99f('0x41')]));_0x3bf89e[_0xb99f('0x40')]=_0x3bf89e['attributes'][_0xb99f('0x42')]?_0x3bf89e[_0xb99f('0x40')]:_0x425664['model'];_0x3bf89e[_0xb99f('0x45')]=qs[_0xb99f('0x46')](_0x35e3aa[_0xb99f('0x3c')]['sort']);_0x3bf89e[_0xb99f('0x47')]=qs[_0xb99f('0x3e')](_[_0xb99f('0x58')](_0x35e3aa[_0xb99f('0x3c')],_0x425664['filters']));if(_0x35e3aa['query'][_0xb99f('0x48')]){_0x3bf89e['where']=_[_0xb99f('0x49')](_0x3bf89e['where'],{'$or':_['map'](_0x3bf89e[_0xb99f('0x40')],function(_0xe0cafd){var _0x4c76b4={};_0x4c76b4[_0xe0cafd]={'$like':'%'+_0x35e3aa[_0xb99f('0x3c')][_0xb99f('0x48')]+'%'};return _0x4c76b4;})});}_0x3bf89e=_[_0xb99f('0x49')]({},_0x3bf89e,_0x35e3aa['options']);return _0x48335a[_0xb99f('0x59')](_0x3bf89e);}})[_0xb99f('0x32')](function(_0x226f75){if(_0x226f75){_0x20c039=_0x226f75[_0xb99f('0x42')];if(!_0x35e3aa[_0xb99f('0x3c')]['hasOwnProperty']('nolimit')){_0x3bf89e['limit']=qs[_0xb99f('0x2d')](_0x35e3aa[_0xb99f('0x3c')]['limit']);_0x3bf89e[_0xb99f('0x2c')]=qs[_0xb99f('0x2c')](_0x35e3aa[_0xb99f('0x3c')][_0xb99f('0x2c')]);}return _0x48335a[_0xb99f('0x59')](_0x3bf89e);}})['then'](function(_0x308b8c){if(_0x308b8c){return _0x308b8c?{'count':_0x20c039,'rows':_0x308b8c}:null;}})['then'](respondWithResult(_0x49ce4e,null))['catch'](handleError(_0x49ce4e,null));};exports['getSubjects']=function(_0x1fbd5a,_0x2955f0,_0x1dec70){var _0x440469={};var _0x4c42f3={};var _0x5061c5;var _0x4a4df0;return db['FreshdeskConfiguration'][_0xb99f('0x55')]({'where':{'id':_0x1fbd5a[_0xb99f('0x50')]['id']}})[_0xb99f('0x32')](handleEntityNotFound(_0x2955f0,null))[_0xb99f('0x32')](function(_0x337b33){if(_0x337b33){_0x5061c5=_0x337b33;_0x4c42f3['model']=_[_0xb99f('0x3d')](db[_0xb99f('0x56')][_0xb99f('0x57')]);_0x4c42f3[_0xb99f('0x3c')]=_[_0xb99f('0x3d')](_0x1fbd5a['query']);_0x4c42f3['filters']=_['intersection'](_0x4c42f3[_0xb99f('0x3b')],_0x4c42f3[_0xb99f('0x3c')]);_0x440469[_0xb99f('0x40')]=_[_0xb99f('0x3f')](_0x4c42f3[_0xb99f('0x3b')],qs['fields'](_0x1fbd5a['query']['fields']));_0x440469[_0xb99f('0x40')]=_0x440469['attributes'][_0xb99f('0x42')]?_0x440469[_0xb99f('0x40')]:_0x4c42f3[_0xb99f('0x3b')];_0x440469['order']=qs[_0xb99f('0x46')](_0x1fbd5a[_0xb99f('0x3c')][_0xb99f('0x46')]);_0x440469['where']=qs[_0xb99f('0x3e')](_[_0xb99f('0x58')](_0x1fbd5a[_0xb99f('0x3c')],_0x4c42f3[_0xb99f('0x3e')]));if(_0x1fbd5a[_0xb99f('0x3c')]['filter']){_0x440469[_0xb99f('0x47')]=_[_0xb99f('0x49')](_0x440469[_0xb99f('0x47')],{'$or':_[_0xb99f('0x37')](_0x440469['attributes'],function(_0x225dd2){var _0x4b3424={};_0x4b3424[_0x225dd2]={'$like':'%'+_0x1fbd5a[_0xb99f('0x3c')][_0xb99f('0x48')]+'%'};return _0x4b3424;})});}_0x440469=_['merge']({},_0x440469,_0x1fbd5a[_0xb99f('0x5a')]);return _0x5061c5['getSubjects'](_0x440469);}})[_0xb99f('0x32')](function(_0xb0ec5a){if(_0xb0ec5a){_0x4a4df0=_0xb0ec5a['length'];if(!_0x1fbd5a['query']['hasOwnProperty'](_0xb99f('0x44'))){_0x440469['limit']=qs['limit'](_0x1fbd5a[_0xb99f('0x3c')][_0xb99f('0x2d')]);_0x440469[_0xb99f('0x2c')]=qs[_0xb99f('0x2c')](_0x1fbd5a[_0xb99f('0x3c')][_0xb99f('0x2c')]);}return _0x5061c5['getSubjects'](_0x440469);}})[_0xb99f('0x32')](function(_0x41f128){if(_0x41f128){return _0x41f128?{'count':_0x4a4df0,'rows':_0x41f128}:null;}})['then'](respondWithResult(_0x2955f0,null))[_0xb99f('0x26')](handleError(_0x2955f0,null));};exports[_0xb99f('0x5b')]=function(_0x2a0bd5,_0x1593c6,_0x3bcd36){var _0x3b9bab={};var _0xd87ad2={};var _0x22d7e1;var _0x825365;return db[_0xb99f('0x38')]['findOne']({'where':{'id':_0x2a0bd5[_0xb99f('0x50')]['id']}})[_0xb99f('0x32')](handleEntityNotFound(_0x1593c6,null))[_0xb99f('0x32')](function(_0x551081){if(_0x551081){_0x22d7e1=_0x551081;_0xd87ad2[_0xb99f('0x3b')]=_[_0xb99f('0x3d')](db[_0xb99f('0x56')][_0xb99f('0x57')]);_0xd87ad2['query']=_[_0xb99f('0x3d')](_0x2a0bd5[_0xb99f('0x3c')]);_0xd87ad2[_0xb99f('0x3e')]=_[_0xb99f('0x3f')](_0xd87ad2['model'],_0xd87ad2['query']);_0x3b9bab['attributes']=_['intersection'](_0xd87ad2[_0xb99f('0x3b')],qs[_0xb99f('0x41')](_0x2a0bd5[_0xb99f('0x3c')][_0xb99f('0x41')]));_0x3b9bab[_0xb99f('0x40')]=_0x3b9bab[_0xb99f('0x40')][_0xb99f('0x42')]?_0x3b9bab[_0xb99f('0x40')]:_0xd87ad2[_0xb99f('0x3b')];_0x3b9bab[_0xb99f('0x45')]=qs['sort'](_0x2a0bd5[_0xb99f('0x3c')][_0xb99f('0x46')]);_0x3b9bab[_0xb99f('0x47')]=qs[_0xb99f('0x3e')](_[_0xb99f('0x58')](_0x2a0bd5[_0xb99f('0x3c')],_0xd87ad2['filters']));if(_0x2a0bd5[_0xb99f('0x3c')][_0xb99f('0x48')]){_0x3b9bab[_0xb99f('0x47')]=_[_0xb99f('0x49')](_0x3b9bab[_0xb99f('0x47')],{'$or':_['map'](_0x3b9bab[_0xb99f('0x40')],function(_0x241a1d){var _0x262f6b={};_0x262f6b[_0x241a1d]={'$like':'%'+_0x2a0bd5[_0xb99f('0x3c')][_0xb99f('0x48')]+'%'};return _0x262f6b;})});}_0x3b9bab=_[_0xb99f('0x49')]({},_0x3b9bab,_0x2a0bd5[_0xb99f('0x5a')]);return _0x22d7e1[_0xb99f('0x5b')](_0x3b9bab);}})[_0xb99f('0x32')](function(_0x478323){if(_0x478323){_0x825365=_0x478323['length'];if(!_0x2a0bd5[_0xb99f('0x3c')][_0xb99f('0x43')](_0xb99f('0x44'))){_0x3b9bab['limit']=qs[_0xb99f('0x2d')](_0x2a0bd5[_0xb99f('0x3c')][_0xb99f('0x2d')]);_0x3b9bab[_0xb99f('0x2c')]=qs['offset'](_0x2a0bd5[_0xb99f('0x3c')][_0xb99f('0x2c')]);}return _0x22d7e1[_0xb99f('0x5b')](_0x3b9bab);}})[_0xb99f('0x32')](function(_0x2f53dd){if(_0x2f53dd){return _0x2f53dd?{'count':_0x825365,'rows':_0x2f53dd}:null;}})[_0xb99f('0x32')](respondWithResult(_0x1593c6,null))['catch'](handleError(_0x1593c6,null));};exports[_0xb99f('0x5c')]=function(_0x847ed6,_0x529742,_0x4c5fca){var _0x4b22e8={};var _0x5e4153={};var _0x394c6e;var _0x1e6a5d;return db[_0xb99f('0x38')]['findOne']({'where':{'id':_0x847ed6['params']['id']}})[_0xb99f('0x32')](handleEntityNotFound(_0x529742,null))[_0xb99f('0x32')](function(_0x4b2ddc){if(_0x4b2ddc){_0x394c6e=_0x4b2ddc;_0x5e4153[_0xb99f('0x3b')]=_[_0xb99f('0x3d')](db[_0xb99f('0x5d')]['rawAttributes']);_0x5e4153[_0xb99f('0x3c')]=_[_0xb99f('0x3d')](_0x847ed6[_0xb99f('0x3c')]);_0x5e4153['filters']=_[_0xb99f('0x3f')](_0x5e4153[_0xb99f('0x3b')],_0x5e4153[_0xb99f('0x3c')]);_0x4b22e8[_0xb99f('0x40')]=_[_0xb99f('0x3f')](_0x5e4153[_0xb99f('0x3b')],qs[_0xb99f('0x41')](_0x847ed6[_0xb99f('0x3c')][_0xb99f('0x41')]));_0x4b22e8[_0xb99f('0x40')]=_0x4b22e8['attributes'][_0xb99f('0x42')]?_0x4b22e8[_0xb99f('0x40')]:_0x5e4153['model'];_0x4b22e8[_0xb99f('0x45')]=qs['sort'](_0x847ed6[_0xb99f('0x3c')][_0xb99f('0x46')]);_0x4b22e8['where']=qs['filters'](_[_0xb99f('0x58')](_0x847ed6['query'],_0x5e4153[_0xb99f('0x3e')]));if(_0x847ed6[_0xb99f('0x3c')][_0xb99f('0x48')]){_0x4b22e8['where']=_[_0xb99f('0x49')](_0x4b22e8['where'],{'$or':_[_0xb99f('0x37')](_0x4b22e8['attributes'],function(_0x1ddefe){var _0x39ca78={};_0x39ca78[_0x1ddefe]={'$like':'%'+_0x847ed6[_0xb99f('0x3c')]['filter']+'%'};return _0x39ca78;})});}_0x4b22e8=_['merge']({},_0x4b22e8,_0x847ed6['options']);return _0x394c6e[_0xb99f('0x5c')](_0x4b22e8);}})[_0xb99f('0x32')](function(_0x2c0929){if(_0x2c0929){_0x1e6a5d=_0x2c0929[_0xb99f('0x42')];if(!_0x847ed6['query']['hasOwnProperty']('nolimit')){_0x4b22e8[_0xb99f('0x2d')]=qs[_0xb99f('0x2d')](_0x847ed6[_0xb99f('0x3c')]['limit']);_0x4b22e8[_0xb99f('0x2c')]=qs['offset'](_0x847ed6[_0xb99f('0x3c')][_0xb99f('0x2c')]);}return _0x394c6e[_0xb99f('0x5c')](_0x4b22e8);}})[_0xb99f('0x32')](function(_0x570e7f){if(_0x570e7f){return _0x570e7f?{'count':_0x1e6a5d,'rows':_0x570e7f}:null;}})[_0xb99f('0x32')](respondWithResult(_0x529742,null))['catch'](handleError(_0x529742,null));};exports[_0xb99f('0x5e')]=function(_0x4784bc,_0x13ea2d,_0x5d90dd){if(_0x4784bc[_0xb99f('0x53')]['id']){delete _0x4784bc[_0xb99f('0x53')]['id'];}return db[_0xb99f('0x38')]['findOne']({'where':{'id':_0x4784bc['params']['id']}})[_0xb99f('0x32')](handleEntityNotFound(_0x13ea2d,null))[_0xb99f('0x32')](function(_0x119e14){if(_0x119e14){return _0x119e14[_0xb99f('0x5e')](_0x4784bc[_0xb99f('0x53')][_0xb99f('0x5f')]||[]);}return null;})[_0xb99f('0x32')](respondWithResult(_0x13ea2d,null))[_0xb99f('0x26')](handleError(_0x13ea2d,null));};
\ No newline at end of file
+var _0x394e=['fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','nolimit','sort','where','pick','filter','merge','count','includeAll','findAll','include','create','body','find','params','getFields','findOne','FreshdeskField','order','getSubjects','options','hasOwnProperty','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','update','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes'];(function(_0x336df4,_0x52c1dc){var _0x580d8c=function(_0x2febf1){while(--_0x2febf1){_0x336df4['push'](_0x336df4['shift']());}};_0x580d8c(++_0x52c1dc);}(_0x394e,0x88));var _0xe394=function(_0x51a13a,_0x9b9ee5){_0x51a13a=_0x51a13a-0x0;var _0x579f61=_0x394e[_0x51a13a];return _0x579f61;};'use strict';var pdf=require(_0xe394('0x0'));var emlformat=require(_0xe394('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe394('0x2'));var jsonpatch=require(_0xe394('0x3'));var rp=require(_0xe394('0x4'));var moment=require(_0xe394('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe394('0x6'));var util=require(_0xe394('0x7'));var path=require(_0xe394('0x8'));var sox=require(_0xe394('0x9'));var csv=require(_0xe394('0xa'));var ejs=require(_0xe394('0xb'));var fs=require('fs');var _=require(_0xe394('0xc'));var squel=require(_0xe394('0xd'));var crypto=require(_0xe394('0xe'));var jsforce=require(_0xe394('0xf'));var deskjs=require(_0xe394('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe394('0x11'));var authService=require(_0xe394('0x12'));var qs=require(_0xe394('0x13'));var as=require(_0xe394('0x14'));var hardwareService=require(_0xe394('0x15'));var logger=require(_0xe394('0x16'))(_0xe394('0x17'));var utils=require(_0xe394('0x18'));var config=require(_0xe394('0x19'));var db=require(_0xe394('0x1a'))['db'];var jayson=require(_0xe394('0x1b'));var client=jayson[_0xe394('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x5730b5,_0x4c2357,_0x227017){if(_0x227017){var _0x40b7e1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40b7e1['test'](_0x4c2357)){return _0x5730b5;}else{throw new db[(_0xe394('0x1d'))][(_0xe394('0x1e'))](_0xe394('0x1f'));}}else{return _0x5730b5;}}function respondWithRpcPromise(_0xb0a8c,_0x1f4f71,_0x1c26db,_0x56aafa){return new BPromise(function(_0x47afc4,_0x1b8777){var _0x3196d0=_0x56aafa||client;return _0x3196d0[_0xe394('0x20')](_0xb0a8c,_0x1c26db)[_0xe394('0x21')](function(_0x4a7a5b){logger[_0xe394('0x22')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1f4f71,_0xe394('0x23'));logger[_0xe394('0x24')](_0xe394('0x25'),_0x1f4f71,'request\x20sent',JSON[_0xe394('0x26')](_0x4a7a5b));if(_0x4a7a5b[_0xe394('0x27')]){if(_0x4a7a5b[_0xe394('0x27')]['code']===0x1f4){logger[_0xe394('0x27')](_0xe394('0x28'),_0x1f4f71,_0x4a7a5b[_0xe394('0x27')][_0xe394('0x29')]);return _0x1b8777(_0x4a7a5b[_0xe394('0x27')][_0xe394('0x29')]);}logger[_0xe394('0x27')](_0xe394('0x28'),_0x1f4f71,_0x4a7a5b[_0xe394('0x27')][_0xe394('0x29')]);return _0x47afc4(_0x4a7a5b[_0xe394('0x27')][_0xe394('0x29')]);}else{logger['info'](_0xe394('0x28'),_0x1f4f71,_0xe394('0x23'));_0x47afc4(_0x4a7a5b[_0xe394('0x2a')][_0xe394('0x29')]);}})[_0xe394('0x2b')](function(_0x5ecdc6){logger[_0xe394('0x27')](_0xe394('0x28'),_0x1f4f71,_0x5ecdc6);_0x1b8777(_0x5ecdc6);});});}function respondWithStatusCode(_0x156f6b,_0x44c3e7){_0x44c3e7=_0x44c3e7||0xcc;return function(_0x4ebf7d){if(_0x4ebf7d){return _0x156f6b[_0xe394('0x2c')](_0x44c3e7);}return _0x156f6b[_0xe394('0x2d')](_0x44c3e7)[_0xe394('0x2e')]();};}function respondWithResult(_0xc6cb2d,_0x3b713c){_0x3b713c=_0x3b713c||0xc8;return function(_0x4a8683){if(_0x4a8683){return _0xc6cb2d[_0xe394('0x2d')](_0x3b713c)[_0xe394('0x2f')](_0x4a8683);}};}function respondWithFilteredResult(_0x1ca899,_0x1bd85c){return function(_0x2a7a82){if(_0x2a7a82){var _0x24146d=_0x2a7a82['count'],_0x3d7693=_0x1bd85c[_0xe394('0x30')],_0xdd67a6=_0x1bd85c[_0xe394('0x30')]+_0x1bd85c[_0xe394('0x31')],_0x1abc74;if(_0xdd67a6>=_0x24146d){_0xdd67a6=_0x24146d;_0x1abc74=0xc8;}else{_0x1abc74=0xce;}_0x1ca899[_0xe394('0x2d')](_0x1abc74);return _0x1ca899[_0xe394('0x32')]('Content-Range',_0x3d7693+'-'+_0xdd67a6+'/'+_0x24146d)['json'](_0x2a7a82);}return null;};}function patchUpdates(_0x382308){return function(_0x3ecc7f){try{jsonpatch[_0xe394('0x33')](_0x3ecc7f,_0x382308,!![]);}catch(_0x538820){return BPromise[_0xe394('0x34')](_0x538820);}return _0x3ecc7f['save']();};}function saveUpdates(_0x5edf7f,_0x3e0f66){return function(_0x406380){if(_0x406380){return _0x406380[_0xe394('0x35')](_0x5edf7f)[_0xe394('0x21')](function(_0x296ba4){return _0x296ba4;});}return null;};}function removeEntity(_0x1b21c2,_0x8f7605){return function(_0x9c783){if(_0x9c783){return _0x9c783[_0xe394('0x36')]()[_0xe394('0x21')](function(){_0x1b21c2[_0xe394('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b7b85,_0x3c7d79){return function(_0x42a3b6){if(!_0x42a3b6){_0x2b7b85[_0xe394('0x2c')](0x194);}return _0x42a3b6;};}function handleError(_0xee4b4,_0xa16b5a){_0xa16b5a=_0xa16b5a||0x1f4;return function(_0x48381a){logger['error'](_0x48381a[_0xe394('0x37')]);if(_0x48381a[_0xe394('0x38')]){delete _0x48381a[_0xe394('0x38')];}_0xee4b4[_0xe394('0x2d')](_0xa16b5a)[_0xe394('0x39')](_0x48381a);};}exports[_0xe394('0x3a')]=function(_0x376dee,_0x36c37f){var _0x2e3a1e={},_0x1fa755={},_0x42a38e={'count':0x0,'rows':[]};var _0x45ac13=_[_0xe394('0x3b')](db[_0xe394('0x3c')][_0xe394('0x3d')],function(_0x4ef2bf){return{'name':_0x4ef2bf[_0xe394('0x3e')],'type':_0x4ef2bf[_0xe394('0x3f')][_0xe394('0x40')]};});_0x1fa755[_0xe394('0x41')]=_[_0xe394('0x3b')](_0x45ac13,'name');_0x1fa755['query']=_[_0xe394('0x42')](_0x376dee['query']);_0x1fa755[_0xe394('0x43')]=_[_0xe394('0x44')](_0x1fa755[_0xe394('0x41')],_0x1fa755['query']);_0x2e3a1e[_0xe394('0x45')]=_['intersection'](_0x1fa755['model'],qs[_0xe394('0x46')](_0x376dee[_0xe394('0x47')][_0xe394('0x46')]));_0x2e3a1e['attributes']=_0x2e3a1e[_0xe394('0x45')][_0xe394('0x48')]?_0x2e3a1e['attributes']:_0x1fa755[_0xe394('0x41')];if(!_0x376dee[_0xe394('0x47')]['hasOwnProperty'](_0xe394('0x49'))){_0x2e3a1e[_0xe394('0x31')]=qs[_0xe394('0x31')](_0x376dee[_0xe394('0x47')][_0xe394('0x31')]);_0x2e3a1e['offset']=qs[_0xe394('0x30')](_0x376dee[_0xe394('0x47')]['offset']);}_0x2e3a1e['order']=qs[_0xe394('0x4a')](_0x376dee[_0xe394('0x47')][_0xe394('0x4a')]);_0x2e3a1e[_0xe394('0x4b')]=qs[_0xe394('0x43')](_[_0xe394('0x4c')](_0x376dee[_0xe394('0x47')],_0x1fa755[_0xe394('0x43')]),_0x45ac13);if(_0x376dee[_0xe394('0x47')][_0xe394('0x4d')]){_0x2e3a1e['where']=_[_0xe394('0x4e')](_0x2e3a1e[_0xe394('0x4b')],{'$or':_[_0xe394('0x3b')](_0x45ac13,function(_0xaecf99){if(_0xaecf99['type']!=='VIRTUAL'){var _0x29daea={};_0x29daea[_0xaecf99[_0xe394('0x38')]]={'$like':'%'+_0x376dee['query'][_0xe394('0x4d')]+'%'};return _0x29daea;}})});}_0x2e3a1e=_[_0xe394('0x4e')]({},_0x2e3a1e,_0x376dee['options']);var _0x14debc={'where':_0x2e3a1e[_0xe394('0x4b')]};return db[_0xe394('0x3c')][_0xe394('0x4f')](_0x14debc)[_0xe394('0x21')](function(_0x1a9e66){_0x42a38e[_0xe394('0x4f')]=_0x1a9e66;if(_0x376dee[_0xe394('0x47')][_0xe394('0x50')]){_0x2e3a1e['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xe394('0x51')](_0x2e3a1e);})[_0xe394('0x21')](function(_0x1bf28c){_0x42a38e['rows']=_0x1bf28c;return _0x42a38e;})[_0xe394('0x21')](respondWithFilteredResult(_0x36c37f,_0x2e3a1e))['catch'](handleError(_0x36c37f,null));};exports['show']=function(_0x2b45a0,_0x3a1974){var _0x4a5550={'raw':![],'where':{'id':_0x2b45a0['params']['id']}},_0x2e8cd2={};_0x2e8cd2['model']=_['keys'](db[_0xe394('0x3c')][_0xe394('0x3d')]);_0x2e8cd2['query']=_[_0xe394('0x42')](_0x2b45a0['query']);_0x2e8cd2[_0xe394('0x43')]=_[_0xe394('0x44')](_0x2e8cd2[_0xe394('0x41')],_0x2e8cd2[_0xe394('0x47')]);_0x4a5550[_0xe394('0x45')]=_[_0xe394('0x44')](_0x2e8cd2[_0xe394('0x41')],qs[_0xe394('0x46')](_0x2b45a0[_0xe394('0x47')][_0xe394('0x46')]));_0x4a5550[_0xe394('0x45')]=_0x4a5550[_0xe394('0x45')][_0xe394('0x48')]?_0x4a5550[_0xe394('0x45')]:_0x2e8cd2['model'];if(_0x2b45a0['query'][_0xe394('0x50')]){_0x4a5550[_0xe394('0x52')]=[{'all':!![]}];}_0x4a5550=_[_0xe394('0x4e')]({},_0x4a5550,_0x2b45a0['options']);return db['FreshdeskConfiguration']['find'](_0x4a5550)[_0xe394('0x21')](handleEntityNotFound(_0x3a1974,null))['then'](respondWithResult(_0x3a1974,null))[_0xe394('0x2b')](handleError(_0x3a1974,null));};exports['create']=function(_0x318135,_0x27f67f){return db[_0xe394('0x3c')][_0xe394('0x53')](_0x318135[_0xe394('0x54')],{})[_0xe394('0x21')](respondWithResult(_0x27f67f,0xc9))[_0xe394('0x2b')](handleError(_0x27f67f,null));};exports[_0xe394('0x35')]=function(_0x214636,_0x45c8d1){if(_0x214636[_0xe394('0x54')]['id']){delete _0x214636[_0xe394('0x54')]['id'];}return db['FreshdeskConfiguration'][_0xe394('0x55')]({'where':{'id':_0x214636[_0xe394('0x56')]['id']}})[_0xe394('0x21')](handleEntityNotFound(_0x45c8d1,null))[_0xe394('0x21')](saveUpdates(_0x214636['body'],null))[_0xe394('0x21')](respondWithResult(_0x45c8d1,null))[_0xe394('0x2b')](handleError(_0x45c8d1,null));};exports[_0xe394('0x36')]=function(_0x4f2a7e,_0x4044d5){return db[_0xe394('0x3c')]['find']({'where':{'id':_0x4f2a7e[_0xe394('0x56')]['id']}})[_0xe394('0x21')](handleEntityNotFound(_0x4044d5,null))[_0xe394('0x21')](removeEntity(_0x4044d5,null))[_0xe394('0x2b')](handleError(_0x4044d5,null));};exports[_0xe394('0x57')]=function(_0x22a171,_0x2be2c9,_0x241042){var _0xd0ddad={};var _0x513de0={};var _0x1d3d2e;var _0x8f289d;return db['FreshdeskConfiguration'][_0xe394('0x58')]({'where':{'id':_0x22a171['params']['id']}})['then'](handleEntityNotFound(_0x2be2c9,null))['then'](function(_0x364fe0){if(_0x364fe0){_0x1d3d2e=_0x364fe0;_0x513de0['model']=_['keys'](db[_0xe394('0x59')]['rawAttributes']);_0x513de0[_0xe394('0x47')]=_[_0xe394('0x42')](_0x22a171[_0xe394('0x47')]);_0x513de0['filters']=_[_0xe394('0x44')](_0x513de0['model'],_0x513de0[_0xe394('0x47')]);_0xd0ddad['attributes']=_[_0xe394('0x44')](_0x513de0[_0xe394('0x41')],qs[_0xe394('0x46')](_0x22a171[_0xe394('0x47')]['fields']));_0xd0ddad['attributes']=_0xd0ddad['attributes'][_0xe394('0x48')]?_0xd0ddad[_0xe394('0x45')]:_0x513de0[_0xe394('0x41')];_0xd0ddad[_0xe394('0x5a')]=qs[_0xe394('0x4a')](_0x22a171[_0xe394('0x47')][_0xe394('0x4a')]);_0xd0ddad[_0xe394('0x4b')]=qs['filters'](_[_0xe394('0x4c')](_0x22a171[_0xe394('0x47')],_0x513de0[_0xe394('0x43')]));if(_0x22a171[_0xe394('0x47')]['filter']){_0xd0ddad[_0xe394('0x4b')]=_[_0xe394('0x4e')](_0xd0ddad[_0xe394('0x4b')],{'$or':_['map'](_0xd0ddad['attributes'],function(_0x2f8698){var _0x3ddfa8={};_0x3ddfa8[_0x2f8698]={'$like':'%'+_0x22a171[_0xe394('0x47')][_0xe394('0x4d')]+'%'};return _0x3ddfa8;})});}_0xd0ddad=_[_0xe394('0x4e')]({},_0xd0ddad,_0x22a171['options']);return _0x1d3d2e[_0xe394('0x57')](_0xd0ddad);}})['then'](function(_0x2a7c7b){if(_0x2a7c7b){_0x8f289d=_0x2a7c7b[_0xe394('0x48')];if(!_0x22a171[_0xe394('0x47')]['hasOwnProperty'](_0xe394('0x49'))){_0xd0ddad[_0xe394('0x31')]=qs[_0xe394('0x31')](_0x22a171[_0xe394('0x47')][_0xe394('0x31')]);_0xd0ddad['offset']=qs['offset'](_0x22a171[_0xe394('0x47')][_0xe394('0x30')]);}return _0x1d3d2e['getFields'](_0xd0ddad);}})[_0xe394('0x21')](function(_0x25ae46){if(_0x25ae46){return _0x25ae46?{'count':_0x8f289d,'rows':_0x25ae46}:null;}})['then'](respondWithResult(_0x2be2c9,null))[_0xe394('0x2b')](handleError(_0x2be2c9,null));};exports[_0xe394('0x5b')]=function(_0x27074b,_0x32e868,_0x562aae){var _0xab747a={};var _0x2fee95={};var _0x2338b6;var _0x543c1e;return db[_0xe394('0x3c')][_0xe394('0x58')]({'where':{'id':_0x27074b['params']['id']}})[_0xe394('0x21')](handleEntityNotFound(_0x32e868,null))[_0xe394('0x21')](function(_0x1c5ea4){if(_0x1c5ea4){_0x2338b6=_0x1c5ea4;_0x2fee95[_0xe394('0x41')]=_[_0xe394('0x42')](db[_0xe394('0x59')][_0xe394('0x3d')]);_0x2fee95[_0xe394('0x47')]=_[_0xe394('0x42')](_0x27074b[_0xe394('0x47')]);_0x2fee95[_0xe394('0x43')]=_[_0xe394('0x44')](_0x2fee95[_0xe394('0x41')],_0x2fee95[_0xe394('0x47')]);_0xab747a[_0xe394('0x45')]=_[_0xe394('0x44')](_0x2fee95[_0xe394('0x41')],qs['fields'](_0x27074b[_0xe394('0x47')]['fields']));_0xab747a['attributes']=_0xab747a[_0xe394('0x45')][_0xe394('0x48')]?_0xab747a[_0xe394('0x45')]:_0x2fee95['model'];_0xab747a[_0xe394('0x5a')]=qs[_0xe394('0x4a')](_0x27074b[_0xe394('0x47')][_0xe394('0x4a')]);_0xab747a[_0xe394('0x4b')]=qs[_0xe394('0x43')](_['pick'](_0x27074b[_0xe394('0x47')],_0x2fee95[_0xe394('0x43')]));if(_0x27074b[_0xe394('0x47')]['filter']){_0xab747a[_0xe394('0x4b')]=_[_0xe394('0x4e')](_0xab747a[_0xe394('0x4b')],{'$or':_[_0xe394('0x3b')](_0xab747a[_0xe394('0x45')],function(_0x1e90ef){var _0x5c7105={};_0x5c7105[_0x1e90ef]={'$like':'%'+_0x27074b['query'][_0xe394('0x4d')]+'%'};return _0x5c7105;})});}_0xab747a=_['merge']({},_0xab747a,_0x27074b[_0xe394('0x5c')]);return _0x2338b6[_0xe394('0x5b')](_0xab747a);}})['then'](function(_0x3fe1bd){if(_0x3fe1bd){_0x543c1e=_0x3fe1bd[_0xe394('0x48')];if(!_0x27074b[_0xe394('0x47')][_0xe394('0x5d')]('nolimit')){_0xab747a[_0xe394('0x31')]=qs[_0xe394('0x31')](_0x27074b[_0xe394('0x47')]['limit']);_0xab747a[_0xe394('0x30')]=qs['offset'](_0x27074b['query'][_0xe394('0x30')]);}return _0x2338b6[_0xe394('0x5b')](_0xab747a);}})[_0xe394('0x21')](function(_0x32ef02){if(_0x32ef02){return _0x32ef02?{'count':_0x543c1e,'rows':_0x32ef02}:null;}})[_0xe394('0x21')](respondWithResult(_0x32e868,null))['catch'](handleError(_0x32e868,null));};exports[_0xe394('0x5e')]=function(_0x29d694,_0x4df442,_0x3c9c11){var _0x16e6f1={};var _0x3f72a0={};var _0x5c0c74;var _0x1fc8c3;return db[_0xe394('0x3c')][_0xe394('0x58')]({'where':{'id':_0x29d694['params']['id']}})[_0xe394('0x21')](handleEntityNotFound(_0x4df442,null))[_0xe394('0x21')](function(_0x579b7b){if(_0x579b7b){_0x5c0c74=_0x579b7b;_0x3f72a0[_0xe394('0x41')]=_[_0xe394('0x42')](db[_0xe394('0x59')][_0xe394('0x3d')]);_0x3f72a0[_0xe394('0x47')]=_['keys'](_0x29d694['query']);_0x3f72a0[_0xe394('0x43')]=_['intersection'](_0x3f72a0[_0xe394('0x41')],_0x3f72a0[_0xe394('0x47')]);_0x16e6f1[_0xe394('0x45')]=_[_0xe394('0x44')](_0x3f72a0[_0xe394('0x41')],qs[_0xe394('0x46')](_0x29d694[_0xe394('0x47')][_0xe394('0x46')]));_0x16e6f1[_0xe394('0x45')]=_0x16e6f1[_0xe394('0x45')][_0xe394('0x48')]?_0x16e6f1[_0xe394('0x45')]:_0x3f72a0['model'];_0x16e6f1['order']=qs['sort'](_0x29d694['query'][_0xe394('0x4a')]);_0x16e6f1['where']=qs[_0xe394('0x43')](_['pick'](_0x29d694['query'],_0x3f72a0[_0xe394('0x43')]));if(_0x29d694[_0xe394('0x47')][_0xe394('0x4d')]){_0x16e6f1['where']=_['merge'](_0x16e6f1['where'],{'$or':_[_0xe394('0x3b')](_0x16e6f1[_0xe394('0x45')],function(_0x10820b){var _0x1d230b={};_0x1d230b[_0x10820b]={'$like':'%'+_0x29d694[_0xe394('0x47')][_0xe394('0x4d')]+'%'};return _0x1d230b;})});}_0x16e6f1=_['merge']({},_0x16e6f1,_0x29d694[_0xe394('0x5c')]);return _0x5c0c74[_0xe394('0x5e')](_0x16e6f1);}})['then'](function(_0x5355dd){if(_0x5355dd){_0x1fc8c3=_0x5355dd[_0xe394('0x48')];if(!_0x29d694['query'][_0xe394('0x5d')]('nolimit')){_0x16e6f1[_0xe394('0x31')]=qs[_0xe394('0x31')](_0x29d694['query'][_0xe394('0x31')]);_0x16e6f1[_0xe394('0x30')]=qs[_0xe394('0x30')](_0x29d694[_0xe394('0x47')]['offset']);}return _0x5c0c74[_0xe394('0x5e')](_0x16e6f1);}})['then'](function(_0x13ef50){if(_0x13ef50){return _0x13ef50?{'count':_0x1fc8c3,'rows':_0x13ef50}:null;}})[_0xe394('0x21')](respondWithResult(_0x4df442,null))[_0xe394('0x2b')](handleError(_0x4df442,null));};exports['getTags']=function(_0x3ffe73,_0x5db0ae,_0x350d82){var _0x38e004={};var _0x230018={};var _0x501ce7;var _0x427063;return db[_0xe394('0x3c')][_0xe394('0x58')]({'where':{'id':_0x3ffe73[_0xe394('0x56')]['id']}})[_0xe394('0x21')](handleEntityNotFound(_0x5db0ae,null))[_0xe394('0x21')](function(_0x145f4f){if(_0x145f4f){_0x501ce7=_0x145f4f;_0x230018[_0xe394('0x41')]=_[_0xe394('0x42')](db[_0xe394('0x5f')][_0xe394('0x3d')]);_0x230018[_0xe394('0x47')]=_['keys'](_0x3ffe73['query']);_0x230018[_0xe394('0x43')]=_[_0xe394('0x44')](_0x230018['model'],_0x230018[_0xe394('0x47')]);_0x38e004['attributes']=_[_0xe394('0x44')](_0x230018[_0xe394('0x41')],qs[_0xe394('0x46')](_0x3ffe73[_0xe394('0x47')][_0xe394('0x46')]));_0x38e004['attributes']=_0x38e004[_0xe394('0x45')]['length']?_0x38e004[_0xe394('0x45')]:_0x230018[_0xe394('0x41')];_0x38e004['order']=qs[_0xe394('0x4a')](_0x3ffe73[_0xe394('0x47')]['sort']);_0x38e004[_0xe394('0x4b')]=qs[_0xe394('0x43')](_[_0xe394('0x4c')](_0x3ffe73[_0xe394('0x47')],_0x230018['filters']));if(_0x3ffe73[_0xe394('0x47')][_0xe394('0x4d')]){_0x38e004[_0xe394('0x4b')]=_['merge'](_0x38e004[_0xe394('0x4b')],{'$or':_['map'](_0x38e004['attributes'],function(_0xaaf49){var _0x54a83e={};_0x54a83e[_0xaaf49]={'$like':'%'+_0x3ffe73[_0xe394('0x47')][_0xe394('0x4d')]+'%'};return _0x54a83e;})});}_0x38e004=_[_0xe394('0x4e')]({},_0x38e004,_0x3ffe73['options']);return _0x501ce7['getTags'](_0x38e004);}})[_0xe394('0x21')](function(_0xf93088){if(_0xf93088){_0x427063=_0xf93088[_0xe394('0x48')];if(!_0x3ffe73[_0xe394('0x47')][_0xe394('0x5d')](_0xe394('0x49'))){_0x38e004[_0xe394('0x31')]=qs[_0xe394('0x31')](_0x3ffe73[_0xe394('0x47')][_0xe394('0x31')]);_0x38e004[_0xe394('0x30')]=qs['offset'](_0x3ffe73['query']['offset']);}return _0x501ce7[_0xe394('0x60')](_0x38e004);}})[_0xe394('0x21')](function(_0x581ddc){if(_0x581ddc){return _0x581ddc?{'count':_0x427063,'rows':_0x581ddc}:null;}})[_0xe394('0x21')](respondWithResult(_0x5db0ae,null))[_0xe394('0x2b')](handleError(_0x5db0ae,null));};exports[_0xe394('0x61')]=function(_0x2968a7,_0x4a04d3,_0x3583c5){if(_0x2968a7[_0xe394('0x54')]['id']){delete _0x2968a7[_0xe394('0x54')]['id'];}return db['FreshdeskConfiguration'][_0xe394('0x58')]({'where':{'id':_0x2968a7[_0xe394('0x56')]['id']}})['then'](handleEntityNotFound(_0x4a04d3,null))[_0xe394('0x21')](function(_0x52ad84){if(_0x52ad84){return _0x52ad84[_0xe394('0x61')](_0x2968a7['body'][_0xe394('0x62')]||[]);}return null;})[_0xe394('0x21')](respondWithResult(_0x4a04d3,null))[_0xe394('0x2b')](handleError(_0x4a04d3,null));};
\ No newline at end of file
index 5d66da4..376f99c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1ae=['api','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','int_freshdesk_configurations','lodash'];(function(_0x5422ec,_0x553384){var _0x45370c=function(_0x48125a){while(--_0x48125a){_0x5422ec['push'](_0x5422ec['shift']());}};_0x45370c(++_0x553384);}(_0xe1ae,0xaf));var _0xee1a=function(_0x16f39a,_0x233f55){_0x16f39a=_0x16f39a-0x0;var _0xd6a5da=_0xe1ae[_0x16f39a];return _0xd6a5da;};'use strict';var _=require(_0xee1a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee1a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xee1a('0x2'));var fs=require('fs');var path=require(_0xee1a('0x3'));var rimraf=require('rimraf');var config=require(_0xee1a('0x4'));var attributes=require(_0xee1a('0x5'));module[_0xee1a('0x6')]=function(_0x53051a,_0x4d746f){return _0x53051a['define']('FreshdeskConfiguration',attributes,{'tableName':_0xee1a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0e5=['define','FreshdeskConfiguration','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x581537,_0x69d09e){var _0x5d64e0=function(_0x2c320c){while(--_0x2c320c){_0x581537['push'](_0x581537['shift']());}};_0x5d64e0(++_0x69d09e);}(_0xa0e5,0x182));var _0x5a0e=function(_0x54d7b7,_0x363165){_0x54d7b7=_0x54d7b7-0x0;var _0x436a72=_0xa0e5[_0x54d7b7];return _0x436a72;};'use strict';var _=require(_0x5a0e('0x0'));var util=require(_0x5a0e('0x1'));var logger=require('../../config/logger')(_0x5a0e('0x2'));var moment=require(_0x5a0e('0x3'));var BPromise=require(_0x5a0e('0x4'));var rp=require(_0x5a0e('0x5'));var fs=require('fs');var path=require(_0x5a0e('0x6'));var rimraf=require(_0x5a0e('0x7'));var config=require(_0x5a0e('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x5a0e('0x9')]=function(_0x8f3ec6,_0x28114b){return _0x8f3ec6[_0x5a0e('0xa')](_0x5a0e('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ee1a36..ed21756 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eb8=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','request\x20sent'];(function(_0x2baf1b,_0x3919ee){var _0x1b92ac=function(_0x2a2070){while(--_0x2a2070){_0x2baf1b['push'](_0x2baf1b['shift']());}};_0x1b92ac(++_0x3919ee);}(_0x9eb8,0xaa));var _0x89eb=function(_0x1c1c79,_0x342525){_0x1c1c79=_0x1c1c79-0x0;var _0x2144c2=_0x9eb8[_0x1c1c79];return _0x2144c2;};'use strict';var _=require(_0x89eb('0x0'));var util=require(_0x89eb('0x1'));var moment=require(_0x89eb('0x2'));var BPromise=require(_0x89eb('0x3'));var rs=require(_0x89eb('0x4'));var fs=require('fs');var Redis=require(_0x89eb('0x5'));var db=require(_0x89eb('0x6'))['db'];var utils=require(_0x89eb('0x7'));var logger=require('../../config/logger')(_0x89eb('0x8'));var config=require(_0x89eb('0x9'));var jayson=require(_0x89eb('0xa'));var client=jayson[_0x89eb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32406b,_0x43f494,_0x3f0d3a){return new BPromise(function(_0x1fdeb0,_0x108593){return client['request'](_0x32406b,_0x3f0d3a)[_0x89eb('0xc')](function(_0x170e1d){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x43f494,_0x89eb('0xd'));logger[_0x89eb('0xe')](_0x89eb('0xf'),_0x43f494,_0x89eb('0xd'),JSON[_0x89eb('0x10')](_0x170e1d));if(_0x170e1d['error']){if(_0x170e1d['error']['code']===0x1f4){logger[_0x89eb('0x11')](_0x89eb('0x12'),_0x43f494,_0x170e1d[_0x89eb('0x11')][_0x89eb('0x13')]);return _0x108593(_0x170e1d[_0x89eb('0x11')]['message']);}logger[_0x89eb('0x11')](_0x89eb('0x12'),_0x43f494,_0x170e1d[_0x89eb('0x11')]['message']);return _0x1fdeb0(_0x170e1d[_0x89eb('0x11')][_0x89eb('0x13')]);}else{logger[_0x89eb('0x14')](_0x89eb('0x12'),_0x43f494,_0x89eb('0xd'));_0x1fdeb0(_0x170e1d[_0x89eb('0x15')]['message']);}})[_0x89eb('0x16')](function(_0x3bab76){logger[_0x89eb('0x11')](_0x89eb('0x12'),_0x43f494,_0x3bab76);_0x108593(_0x3bab76);});});}
\ No newline at end of file
+var _0xcf34=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xcf34,0x13b));var _0x4cf3=function(_0x180ac2,_0x219d65){_0x180ac2=_0x180ac2-0x0;var _0xfcaede=_0xcf34[_0x180ac2];return _0xfcaede;};'use strict';var _=require('lodash');var util=require(_0x4cf3('0x0'));var moment=require(_0x4cf3('0x1'));var BPromise=require('bluebird');var rs=require(_0x4cf3('0x2'));var fs=require('fs');var Redis=require(_0x4cf3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4cf3('0x4'));var logger=require(_0x4cf3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4cf3('0x6'));var client=jayson[_0x4cf3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x134053,_0x3a1468,_0x1ae566){return new BPromise(function(_0x1fbfff,_0x5c4101){return client[_0x4cf3('0x8')](_0x134053,_0x1ae566)[_0x4cf3('0x9')](function(_0x53c206){logger[_0x4cf3('0xa')](_0x4cf3('0xb'),_0x3a1468,_0x4cf3('0xc'));logger[_0x4cf3('0xd')](_0x4cf3('0xe'),_0x3a1468,_0x4cf3('0xc'),JSON[_0x4cf3('0xf')](_0x53c206));if(_0x53c206['error']){if(_0x53c206[_0x4cf3('0x10')][_0x4cf3('0x11')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a1468,_0x53c206[_0x4cf3('0x10')]['message']);return _0x5c4101(_0x53c206['error'][_0x4cf3('0x12')]);}logger[_0x4cf3('0x10')](_0x4cf3('0xb'),_0x3a1468,_0x53c206['error'][_0x4cf3('0x12')]);return _0x1fbfff(_0x53c206[_0x4cf3('0x10')][_0x4cf3('0x12')]);}else{logger[_0x4cf3('0xa')](_0x4cf3('0xb'),_0x3a1468,_0x4cf3('0xc'));_0x1fbfff(_0x53c206[_0x4cf3('0x13')][_0x4cf3('0x12')]);}})[_0x4cf3('0x14')](function(_0x14fdb7){logger[_0x4cf3('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a1468,_0x14fdb7);_0x5c4101(_0x14fdb7);});});}
\ No newline at end of file
index 0ceb2d0..943f2fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated'];(function(_0x3a634e,_0x273db2){var _0x2ecddb=function(_0x3a9d2d){while(--_0x3a9d2d){_0x3a634e['push'](_0x3a634e['shift']());}};_0x2ecddb(++_0x273db2);}(_0x70e0,0x17b));var _0x070e=function(_0xc38bb9,_0x1f2ea2){_0xc38bb9=_0xc38bb9-0x0;var _0x500e06=_0x70e0[_0xc38bb9];return _0x500e06;};'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 auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0xa')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')](_0x070e('0xe'),auth[_0x070e('0xb')](),controller['update']);router['delete'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);module[_0x070e('0x10')]=router;
\ No newline at end of file
+var _0x3e74=['connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','multer','path'];(function(_0x43b029,_0x12bba0){var _0x386682=function(_0x16c405){while(--_0x16c405){_0x43b029['push'](_0x43b029['shift']());}};_0x386682(++_0x12bba0);}(_0x3e74,0x175));var _0x43e7=function(_0x54ec54,_0x5970bb){_0x54ec54=_0x54ec54-0x0;var _0x2a55fc=_0x3e74[_0x54ec54];return _0x2a55fc;};'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 auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['put'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0xd')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);module['exports']=router;
\ No newline at end of file
index f70116d..5324729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb91=['ENUM','variable','customVariable','keyValue','string','STRING','sequelize','exports'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0xbb91,0xce));var _0x1bb9=function(_0x3e85a4,_0x18c3a9){_0x3e85a4=_0x3e85a4-0x0;var _0x21e7d1=_0xbb91[_0x3e85a4];return _0x21e7d1;};'use strict';var Sequelize=require(_0x1bb9('0x0'));module[_0x1bb9('0x1')]={'type':{'type':Sequelize[_0x1bb9('0x2')]('string',_0x1bb9('0x3'),_0x1bb9('0x4'),_0x1bb9('0x5')),'defaultValue':_0x1bb9('0x6')},'content':{'type':Sequelize[_0x1bb9('0x7')]},'key':{'type':Sequelize[_0x1bb9('0x7')]},'keyType':{'type':Sequelize[_0x1bb9('0x2')]('string',_0x1bb9('0x3'),_0x1bb9('0x4'))},'keyContent':{'type':Sequelize[_0x1bb9('0x7')]},'idField':{'type':Sequelize[_0x1bb9('0x7')]},'nameField':{'type':Sequelize[_0x1bb9('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0689=['BOOLEAN','exports','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x5bbd71,_0x33d9e8){var _0x3a3da9=function(_0x51226a){while(--_0x51226a){_0x5bbd71['push'](_0x5bbd71['shift']());}};_0x3a3da9(++_0x33d9e8);}(_0x0689,0x161));var _0x9068=function(_0x4435c2,_0x3c12f2){_0x4435c2=_0x4435c2-0x0;var _0x160402=_0x0689[_0x4435c2];return _0x160402;};'use strict';var Sequelize=require('sequelize');module[_0x9068('0x0')]={'type':{'type':Sequelize['ENUM'](_0x9068('0x1'),_0x9068('0x2'),_0x9068('0x3'),_0x9068('0x4')),'defaultValue':_0x9068('0x1')},'content':{'type':Sequelize[_0x9068('0x5')]},'key':{'type':Sequelize[_0x9068('0x5')]},'keyType':{'type':Sequelize[_0x9068('0x6')](_0x9068('0x1'),_0x9068('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x9068('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9068('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9068('0x5')]}};
\ No newline at end of file
index bc55831..b92bc0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde4f=['hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','findAll','rows','show','params','fields','includeAll','include','find','create','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','length'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xde4f,0x1c0));var _0xfde4=function(_0xf9596d,_0x3b5541){_0xf9596d=_0xf9596d-0x0;var _0x42c7db=_0xde4f[_0xf9596d];return _0x42c7db;};'use strict';var pdf=require(_0xfde4('0x0'));var emlformat=require(_0xfde4('0x1'));var rimraf=require(_0xfde4('0x2'));var zipdir=require(_0xfde4('0x3'));var jsonpatch=require(_0xfde4('0x4'));var rp=require(_0xfde4('0x5'));var moment=require(_0xfde4('0x6'));var BPromise=require(_0xfde4('0x7'));var Mustache=require('mustache');var util=require(_0xfde4('0x8'));var path=require(_0xfde4('0x9'));var sox=require('sox');var csv=require(_0xfde4('0xa'));var ejs=require(_0xfde4('0xb'));var fs=require('fs');var _=require(_0xfde4('0xc'));var squel=require(_0xfde4('0xd'));var crypto=require('crypto');var jsforce=require(_0xfde4('0xe'));var deskjs=require(_0xfde4('0xf'));var toCsv=require(_0xfde4('0xa'));var querystring=require(_0xfde4('0x10'));var Papa=require(_0xfde4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfde4('0x12'));var hardwareService=require(_0xfde4('0x13'));var logger=require('../../config/logger')(_0xfde4('0x14'));var utils=require(_0xfde4('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x124b3a,_0x553b31){_0x553b31=_0x553b31||0xcc;return function(_0x30c1fc){if(_0x30c1fc){return _0x124b3a[_0xfde4('0x16')](_0x553b31);}return _0x124b3a[_0xfde4('0x17')](_0x553b31)[_0xfde4('0x18')]();};}function respondWithResult(_0x25efe4,_0x2e7d3f){_0x2e7d3f=_0x2e7d3f||0xc8;return function(_0x3fece6){if(_0x3fece6){return _0x25efe4[_0xfde4('0x17')](_0x2e7d3f)[_0xfde4('0x19')](_0x3fece6);}};}function respondWithFilteredResult(_0x4734b9,_0x2ebb81){return function(_0x57fe65){if(_0x57fe65){var _0x406c0c=_0x57fe65[_0xfde4('0x1a')],_0x4ee31c=_0x2ebb81['offset'],_0x4b40a1=_0x2ebb81[_0xfde4('0x1b')]+_0x2ebb81[_0xfde4('0x1c')],_0x5d8cc5;if(_0x4b40a1>=_0x406c0c){_0x4b40a1=_0x406c0c;_0x5d8cc5=0xc8;}else{_0x5d8cc5=0xce;}_0x4734b9[_0xfde4('0x17')](_0x5d8cc5);return _0x4734b9[_0xfde4('0x1d')](_0xfde4('0x1e'),_0x4ee31c+'-'+_0x4b40a1+'/'+_0x406c0c)['json'](_0x57fe65);}return null;};}function patchUpdates(_0x44fe6e){return function(_0x274fb3){try{jsonpatch['apply'](_0x274fb3,_0x44fe6e,!![]);}catch(_0x1f43e6){return BPromise['reject'](_0x1f43e6);}return _0x274fb3[_0xfde4('0x1f')]();};}function saveUpdates(_0x45fd61,_0x31e15b){return function(_0x574ace){if(_0x574ace){return _0x574ace[_0xfde4('0x20')](_0x45fd61)[_0xfde4('0x21')](function(_0x3e3226){return _0x3e3226;});}return null;};}function removeEntity(_0x284e7b,_0x10ff50){return function(_0x1ea416){if(_0x1ea416){return _0x1ea416[_0xfde4('0x22')]()[_0xfde4('0x21')](function(){_0x284e7b[_0xfde4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f20e3,_0x13dd72){return function(_0xa9218d){if(!_0xa9218d){_0x1f20e3[_0xfde4('0x16')](0x194);}return _0xa9218d;};}function handleError(_0x287b0c,_0x14a4aa){_0x14a4aa=_0x14a4aa||0x1f4;return function(_0x38b3c1){logger['error'](_0x38b3c1[_0xfde4('0x23')]);if(_0x38b3c1[_0xfde4('0x24')]){delete _0x38b3c1[_0xfde4('0x24')];}_0x287b0c[_0xfde4('0x17')](_0x14a4aa)[_0xfde4('0x25')](_0x38b3c1);};}exports['index']=function(_0x2e4fc7,_0x411331){var _0x17bd0f={},_0x3d7428={},_0x32025f={'count':0x0,'rows':[]};var _0x43f526=_[_0xfde4('0x26')](db[_0xfde4('0x27')][_0xfde4('0x28')],function(_0x2a0275){return{'name':_0x2a0275[_0xfde4('0x29')],'type':_0x2a0275['type'][_0xfde4('0x2a')]};});_0x3d7428[_0xfde4('0x2b')]=_[_0xfde4('0x26')](_0x43f526,_0xfde4('0x24'));_0x3d7428[_0xfde4('0x2c')]=_[_0xfde4('0x2d')](_0x2e4fc7['query']);_0x3d7428['filters']=_['intersection'](_0x3d7428[_0xfde4('0x2b')],_0x3d7428['query']);_0x17bd0f[_0xfde4('0x2e')]=_[_0xfde4('0x2f')](_0x3d7428['model'],qs['fields'](_0x2e4fc7[_0xfde4('0x2c')]['fields']));_0x17bd0f[_0xfde4('0x2e')]=_0x17bd0f[_0xfde4('0x2e')][_0xfde4('0x30')]?_0x17bd0f[_0xfde4('0x2e')]:_0x3d7428['model'];if(!_0x2e4fc7['query'][_0xfde4('0x31')](_0xfde4('0x32'))){_0x17bd0f['limit']=qs['limit'](_0x2e4fc7[_0xfde4('0x2c')]['limit']);_0x17bd0f[_0xfde4('0x1b')]=qs[_0xfde4('0x1b')](_0x2e4fc7[_0xfde4('0x2c')]['offset']);}_0x17bd0f[_0xfde4('0x33')]=qs[_0xfde4('0x34')](_0x2e4fc7[_0xfde4('0x2c')][_0xfde4('0x34')]);_0x17bd0f['where']=qs[_0xfde4('0x35')](_[_0xfde4('0x36')](_0x2e4fc7['query'],_0x3d7428[_0xfde4('0x35')]),_0x43f526);if(_0x2e4fc7[_0xfde4('0x2c')][_0xfde4('0x37')]){_0x17bd0f[_0xfde4('0x38')]=_['merge'](_0x17bd0f[_0xfde4('0x38')],{'$or':_[_0xfde4('0x26')](_0x43f526,function(_0x4074cd){if(_0x4074cd[_0xfde4('0x39')]!==_0xfde4('0x3a')){var _0x1c1674={};_0x1c1674[_0x4074cd[_0xfde4('0x24')]]={'$like':'%'+_0x2e4fc7['query']['filter']+'%'};return _0x1c1674;}})});}_0x17bd0f=_[_0xfde4('0x3b')]({},_0x17bd0f,_0x2e4fc7[_0xfde4('0x3c')]);var _0x35bb3a={'where':_0x17bd0f[_0xfde4('0x38')]};return db[_0xfde4('0x27')]['count'](_0x35bb3a)[_0xfde4('0x21')](function(_0x147851){_0x32025f[_0xfde4('0x1a')]=_0x147851;if(_0x2e4fc7['query']['includeAll']){_0x17bd0f['include']=[{'all':!![]}];}return db[_0xfde4('0x27')][_0xfde4('0x3d')](_0x17bd0f);})[_0xfde4('0x21')](function(_0x18ccc0){_0x32025f[_0xfde4('0x3e')]=_0x18ccc0;return _0x32025f;})[_0xfde4('0x21')](respondWithFilteredResult(_0x411331,_0x17bd0f))['catch'](handleError(_0x411331,null));};exports[_0xfde4('0x3f')]=function(_0x17334a,_0x2ad9c6){var _0x5dcf41={'raw':!![],'where':{'id':_0x17334a[_0xfde4('0x40')]['id']}},_0x78794f={};_0x78794f[_0xfde4('0x2b')]=_[_0xfde4('0x2d')](db[_0xfde4('0x27')]['rawAttributes']);_0x78794f[_0xfde4('0x2c')]=_[_0xfde4('0x2d')](_0x17334a[_0xfde4('0x2c')]);_0x78794f[_0xfde4('0x35')]=_[_0xfde4('0x2f')](_0x78794f[_0xfde4('0x2b')],_0x78794f[_0xfde4('0x2c')]);_0x5dcf41[_0xfde4('0x2e')]=_[_0xfde4('0x2f')](_0x78794f[_0xfde4('0x2b')],qs[_0xfde4('0x41')](_0x17334a[_0xfde4('0x2c')][_0xfde4('0x41')]));_0x5dcf41[_0xfde4('0x2e')]=_0x5dcf41[_0xfde4('0x2e')]['length']?_0x5dcf41[_0xfde4('0x2e')]:_0x78794f[_0xfde4('0x2b')];if(_0x17334a['query'][_0xfde4('0x42')]){_0x5dcf41[_0xfde4('0x43')]=[{'all':!![]}];}_0x5dcf41=_['merge']({},_0x5dcf41,_0x17334a[_0xfde4('0x3c')]);return db['FreshdeskField'][_0xfde4('0x44')](_0x5dcf41)[_0xfde4('0x21')](handleEntityNotFound(_0x2ad9c6,null))[_0xfde4('0x21')](respondWithResult(_0x2ad9c6,null))['catch'](handleError(_0x2ad9c6,null));};exports[_0xfde4('0x45')]=function(_0x5eb7b4,_0x431217){return db[_0xfde4('0x27')][_0xfde4('0x45')](_0x5eb7b4['body'],{})['then'](respondWithResult(_0x431217,0xc9))['catch'](handleError(_0x431217,null));};exports['update']=function(_0x270e58,_0x41a894){if(_0x270e58['body']['id']){delete _0x270e58['body']['id'];}return db[_0xfde4('0x27')][_0xfde4('0x44')]({'where':{'id':_0x270e58[_0xfde4('0x40')]['id']}})[_0xfde4('0x21')](handleEntityNotFound(_0x41a894,null))[_0xfde4('0x21')](saveUpdates(_0x270e58['body'],null))[_0xfde4('0x21')](respondWithResult(_0x41a894,null))[_0xfde4('0x46')](handleError(_0x41a894,null));};exports[_0xfde4('0x22')]=function(_0x4423d5,_0x6050ce){return db[_0xfde4('0x27')][_0xfde4('0x44')]({'where':{'id':_0x4423d5['params']['id']}})[_0xfde4('0x21')](handleEntityNotFound(_0x6050ce,null))[_0xfde4('0x21')](removeEntity(_0x6050ce,null))[_0xfde4('0x46')](handleError(_0x6050ce,null));};
\ No newline at end of file
+var _0xbfc4=['pick','merge','VIRTUAL','filter','options','FreshdeskField','includeAll','include','rows','show','params','length','find','catch','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','keys','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x5205d4,_0xf78d10){var _0x4f2b78=function(_0x55d177){while(--_0x55d177){_0x5205d4['push'](_0x5205d4['shift']());}};_0x4f2b78(++_0xf78d10);}(_0xbfc4,0x1ba));var _0x4bfc=function(_0x4b2d01,_0x358bf4){_0x4b2d01=_0x4b2d01-0x0;var _0x4d586b=_0xbfc4[_0x4b2d01];return _0x4d586b;};'use strict';var pdf=require(_0x4bfc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4bfc('0x1'));var zipdir=require(_0x4bfc('0x2'));var jsonpatch=require(_0x4bfc('0x3'));var rp=require(_0x4bfc('0x4'));var moment=require(_0x4bfc('0x5'));var BPromise=require(_0x4bfc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4bfc('0x7'));var sox=require(_0x4bfc('0x8'));var csv=require(_0x4bfc('0x9'));var ejs=require(_0x4bfc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4bfc('0xb'));var crypto=require(_0x4bfc('0xc'));var jsforce=require(_0x4bfc('0xd'));var deskjs=require(_0x4bfc('0xe'));var toCsv=require(_0x4bfc('0x9'));var querystring=require(_0x4bfc('0xf'));var Papa=require(_0x4bfc('0x10'));var Redis=require(_0x4bfc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4bfc('0x12'));var hardwareService=require(_0x4bfc('0x13'));var logger=require(_0x4bfc('0x14'))('api');var utils=require(_0x4bfc('0x15'));var config=require('../../config/environment');var db=require(_0x4bfc('0x16'))['db'];function respondWithStatusCode(_0x46ecab,_0x2333bf){_0x2333bf=_0x2333bf||0xcc;return function(_0x16034d){if(_0x16034d){return _0x46ecab[_0x4bfc('0x17')](_0x2333bf);}return _0x46ecab['status'](_0x2333bf)[_0x4bfc('0x18')]();};}function respondWithResult(_0x5ee8b3,_0x4297f5){_0x4297f5=_0x4297f5||0xc8;return function(_0x45df70){if(_0x45df70){return _0x5ee8b3[_0x4bfc('0x19')](_0x4297f5)[_0x4bfc('0x1a')](_0x45df70);}};}function respondWithFilteredResult(_0x1bd177,_0x24eb0d){return function(_0x5afd85){if(_0x5afd85){var _0x38c025=_0x5afd85[_0x4bfc('0x1b')],_0x5b7b73=_0x24eb0d[_0x4bfc('0x1c')],_0x191cfc=_0x24eb0d[_0x4bfc('0x1c')]+_0x24eb0d[_0x4bfc('0x1d')],_0x2fbcf3;if(_0x191cfc>=_0x38c025){_0x191cfc=_0x38c025;_0x2fbcf3=0xc8;}else{_0x2fbcf3=0xce;}_0x1bd177['status'](_0x2fbcf3);return _0x1bd177[_0x4bfc('0x1e')]('Content-Range',_0x5b7b73+'-'+_0x191cfc+'/'+_0x38c025)[_0x4bfc('0x1a')](_0x5afd85);}return null;};}function patchUpdates(_0x6c84b6){return function(_0x415da3){try{jsonpatch['apply'](_0x415da3,_0x6c84b6,!![]);}catch(_0x5b0cb0){return BPromise[_0x4bfc('0x1f')](_0x5b0cb0);}return _0x415da3[_0x4bfc('0x20')]();};}function saveUpdates(_0x32bb22,_0x3ee199){return function(_0x2a6e01){if(_0x2a6e01){return _0x2a6e01[_0x4bfc('0x21')](_0x32bb22)[_0x4bfc('0x22')](function(_0x198fe5){return _0x198fe5;});}return null;};}function removeEntity(_0x159845,_0x593da5){return function(_0x30d677){if(_0x30d677){return _0x30d677[_0x4bfc('0x23')]()[_0x4bfc('0x22')](function(){_0x159845[_0x4bfc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d773e,_0x14741c){return function(_0x31d05c){if(!_0x31d05c){_0x5d773e[_0x4bfc('0x17')](0x194);}return _0x31d05c;};}function handleError(_0xf0fb07,_0x2f34eb){_0x2f34eb=_0x2f34eb||0x1f4;return function(_0x1175ee){logger[_0x4bfc('0x24')](_0x1175ee[_0x4bfc('0x25')]);if(_0x1175ee[_0x4bfc('0x26')]){delete _0x1175ee[_0x4bfc('0x26')];}_0xf0fb07['status'](_0x2f34eb)[_0x4bfc('0x27')](_0x1175ee);};}exports['index']=function(_0x248bb0,_0x353a0a){var _0x42065b={},_0x42d198={},_0x3cb6d3={'count':0x0,'rows':[]};var _0x3d3950=_[_0x4bfc('0x28')](db['FreshdeskField'][_0x4bfc('0x29')],function(_0x4c9746){return{'name':_0x4c9746['fieldName'],'type':_0x4c9746[_0x4bfc('0x2a')]['key']};});_0x42d198['model']=_[_0x4bfc('0x28')](_0x3d3950,_0x4bfc('0x26'));_0x42d198['query']=_[_0x4bfc('0x2b')](_0x248bb0['query']);_0x42d198['filters']=_[_0x4bfc('0x2c')](_0x42d198[_0x4bfc('0x2d')],_0x42d198[_0x4bfc('0x2e')]);_0x42065b[_0x4bfc('0x2f')]=_['intersection'](_0x42d198['model'],qs[_0x4bfc('0x30')](_0x248bb0['query'][_0x4bfc('0x30')]));_0x42065b[_0x4bfc('0x2f')]=_0x42065b[_0x4bfc('0x2f')]['length']?_0x42065b[_0x4bfc('0x2f')]:_0x42d198[_0x4bfc('0x2d')];if(!_0x248bb0[_0x4bfc('0x2e')][_0x4bfc('0x31')](_0x4bfc('0x32'))){_0x42065b[_0x4bfc('0x1d')]=qs['limit'](_0x248bb0[_0x4bfc('0x2e')][_0x4bfc('0x1d')]);_0x42065b[_0x4bfc('0x1c')]=qs[_0x4bfc('0x1c')](_0x248bb0[_0x4bfc('0x2e')][_0x4bfc('0x1c')]);}_0x42065b[_0x4bfc('0x33')]=qs[_0x4bfc('0x34')](_0x248bb0['query']['sort']);_0x42065b[_0x4bfc('0x35')]=qs[_0x4bfc('0x36')](_[_0x4bfc('0x37')](_0x248bb0['query'],_0x42d198['filters']),_0x3d3950);if(_0x248bb0[_0x4bfc('0x2e')]['filter']){_0x42065b[_0x4bfc('0x35')]=_[_0x4bfc('0x38')](_0x42065b[_0x4bfc('0x35')],{'$or':_[_0x4bfc('0x28')](_0x3d3950,function(_0x379239){if(_0x379239[_0x4bfc('0x2a')]!==_0x4bfc('0x39')){var _0x4e4a7c={};_0x4e4a7c[_0x379239[_0x4bfc('0x26')]]={'$like':'%'+_0x248bb0[_0x4bfc('0x2e')][_0x4bfc('0x3a')]+'%'};return _0x4e4a7c;}})});}_0x42065b=_[_0x4bfc('0x38')]({},_0x42065b,_0x248bb0[_0x4bfc('0x3b')]);var _0x5609e5={'where':_0x42065b[_0x4bfc('0x35')]};return db[_0x4bfc('0x3c')][_0x4bfc('0x1b')](_0x5609e5)[_0x4bfc('0x22')](function(_0x3e1f06){_0x3cb6d3[_0x4bfc('0x1b')]=_0x3e1f06;if(_0x248bb0['query'][_0x4bfc('0x3d')]){_0x42065b[_0x4bfc('0x3e')]=[{'all':!![]}];}return db[_0x4bfc('0x3c')]['findAll'](_0x42065b);})[_0x4bfc('0x22')](function(_0x1d793a){_0x3cb6d3[_0x4bfc('0x3f')]=_0x1d793a;return _0x3cb6d3;})['then'](respondWithFilteredResult(_0x353a0a,_0x42065b))['catch'](handleError(_0x353a0a,null));};exports[_0x4bfc('0x40')]=function(_0x246989,_0x5ebdf1){var _0x525f18={'raw':!![],'where':{'id':_0x246989[_0x4bfc('0x41')]['id']}},_0x176c75={};_0x176c75[_0x4bfc('0x2d')]=_['keys'](db[_0x4bfc('0x3c')][_0x4bfc('0x29')]);_0x176c75[_0x4bfc('0x2e')]=_[_0x4bfc('0x2b')](_0x246989['query']);_0x176c75[_0x4bfc('0x36')]=_[_0x4bfc('0x2c')](_0x176c75[_0x4bfc('0x2d')],_0x176c75[_0x4bfc('0x2e')]);_0x525f18[_0x4bfc('0x2f')]=_[_0x4bfc('0x2c')](_0x176c75['model'],qs[_0x4bfc('0x30')](_0x246989[_0x4bfc('0x2e')][_0x4bfc('0x30')]));_0x525f18['attributes']=_0x525f18['attributes'][_0x4bfc('0x42')]?_0x525f18[_0x4bfc('0x2f')]:_0x176c75[_0x4bfc('0x2d')];if(_0x246989['query'][_0x4bfc('0x3d')]){_0x525f18[_0x4bfc('0x3e')]=[{'all':!![]}];}_0x525f18=_[_0x4bfc('0x38')]({},_0x525f18,_0x246989[_0x4bfc('0x3b')]);return db[_0x4bfc('0x3c')][_0x4bfc('0x43')](_0x525f18)[_0x4bfc('0x22')](handleEntityNotFound(_0x5ebdf1,null))[_0x4bfc('0x22')](respondWithResult(_0x5ebdf1,null))[_0x4bfc('0x44')](handleError(_0x5ebdf1,null));};exports[_0x4bfc('0x45')]=function(_0x910a5a,_0x17f0c3){return db['FreshdeskField'][_0x4bfc('0x45')](_0x910a5a[_0x4bfc('0x46')],{})['then'](respondWithResult(_0x17f0c3,0xc9))[_0x4bfc('0x44')](handleError(_0x17f0c3,null));};exports[_0x4bfc('0x21')]=function(_0x42db3e,_0x33aa95){if(_0x42db3e[_0x4bfc('0x46')]['id']){delete _0x42db3e['body']['id'];}return db[_0x4bfc('0x3c')][_0x4bfc('0x43')]({'where':{'id':_0x42db3e[_0x4bfc('0x41')]['id']}})[_0x4bfc('0x22')](handleEntityNotFound(_0x33aa95,null))['then'](saveUpdates(_0x42db3e[_0x4bfc('0x46')],null))['then'](respondWithResult(_0x33aa95,null))[_0x4bfc('0x44')](handleError(_0x33aa95,null));};exports[_0x4bfc('0x23')]=function(_0x10409f,_0x171965){return db[_0x4bfc('0x3c')][_0x4bfc('0x43')]({'where':{'id':_0x10409f['params']['id']}})['then'](handleEntityNotFound(_0x171965,null))['then'](removeEntity(_0x171965,null))[_0x4bfc('0x44')](handleError(_0x171965,null));};
\ No newline at end of file
index a2a6c09..fe9fb4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaae8=['define','FreshdeskField','idField','FieldId','lodash','api','moment','request-promise','../../config/environment','exports'];(function(_0x4ddfe1,_0x35939d){var _0x4aaf51=function(_0x1e99a0){while(--_0x1e99a0){_0x4ddfe1['push'](_0x4ddfe1['shift']());}};_0x4aaf51(++_0x35939d);}(_0xaae8,0x158));var _0x8aae=function(_0x4022c5,_0x533be3){_0x4022c5=_0x4022c5-0x0;var _0xeba832=_0xaae8[_0x4022c5];return _0xeba832;};'use strict';var _=require(_0x8aae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8aae('0x1'));var moment=require(_0x8aae('0x2'));var BPromise=require('bluebird');var rp=require(_0x8aae('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8aae('0x4'));var attributes=require('./intFreshdeskField.attributes');module[_0x8aae('0x5')]=function(_0x45957c,_0x35fa93){return _0x45957c[_0x8aae('0x6')](_0x8aae('0x7'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x8aae('0x8'),_0x8aae('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x02cc=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','freshdesk_unique_index','FieldId'];(function(_0x1c64ad,_0x3646f1){var _0x344bf3=function(_0x321441){while(--_0x321441){_0x1c64ad['push'](_0x1c64ad['shift']());}};_0x344bf3(++_0x3646f1);}(_0x02cc,0xd8));var _0xc02c=function(_0x51352f,_0x3f8caa){_0x51352f=_0x51352f-0x0;var _0x21db5c=_0x02cc[_0x51352f];return _0x21db5c;};'use strict';var _=require('lodash');var util=require(_0xc02c('0x0'));var logger=require(_0xc02c('0x1'))('api');var moment=require(_0xc02c('0x2'));var BPromise=require('bluebird');var rp=require(_0xc02c('0x3'));var fs=require('fs');var path=require(_0xc02c('0x4'));var rimraf=require(_0xc02c('0x5'));var config=require(_0xc02c('0x6'));var attributes=require(_0xc02c('0x7'));module[_0xc02c('0x8')]=function(_0x3fc504,_0x6ba5a6){return _0x3fc504[_0xc02c('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xc02c('0xa'),'fields':['idField',_0xc02c('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4eb9401..868fbc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5726d5,_0x56d749){var _0x269a4c=function(_0x5e2a8f){while(--_0x5e2a8f){_0x5726d5['push'](_0x5726d5['shift']());}};_0x269a4c(++_0x56d749);}(_0xb10b,0x12a));var _0xbb10=function(_0xd2dd48,_0x1a985){_0xd2dd48=_0xd2dd48-0x0;var _0x3853db=_0xb10b[_0xd2dd48];return _0x3853db;};'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);});});}
\ No newline at end of file
+var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3432c1,_0x3c0025){var _0x35f215=function(_0x4cc24c){while(--_0x4cc24c){_0x3432c1['push'](_0x3432c1['shift']());}};_0x35f215(++_0x3c0025);}(_0xb10b,0x12a));var _0xbb10=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0xb10b[_0x1979d8];return _0x1d5bb3;};'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);});});}
\ No newline at end of file
index 7b1ce71..7a4850e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8728=['getConfigurations','getFields','post','create','addConfiguration','put','update','destroy','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0xa69122,_0x3c1c3c){var _0x582a21=function(_0x514021){while(--_0x514021){_0xa69122['push'](_0xa69122['shift']());}};_0x582a21(++_0x3c1c3c);}(_0x8728,0x171));var _0x8872=function(_0x2d4d54,_0x530069){_0x2d4d54=_0x2d4d54-0x0;var _0x3cc775=_0x8728[_0x2d4d54];return _0x3cc775;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8872('0x0'));var timeout=require('connect-timeout');var express=require(_0x8872('0x1'));var router=express['Router']();var auth=require(_0x8872('0x2'));var interaction=require(_0x8872('0x3'));var config=require(_0x8872('0x4'));var controller=require(_0x8872('0x5'));router[_0x8872('0x6')]('/',auth[_0x8872('0x7')](),controller[_0x8872('0x8')]);router[_0x8872('0x6')](_0x8872('0x9'),auth[_0x8872('0x7')](),controller[_0x8872('0xa')]);router[_0x8872('0x6')]('/:id/configurations',auth[_0x8872('0x7')](),controller[_0x8872('0xb')]);router[_0x8872('0x6')]('/:id/fields',auth[_0x8872('0x7')](),controller[_0x8872('0xc')]);router[_0x8872('0xd')]('/',auth['isAuthenticated'](),controller[_0x8872('0xe')]);router[_0x8872('0xd')]('/:id/configurations',auth[_0x8872('0x7')](),controller[_0x8872('0xf')]);router[_0x8872('0x10')](_0x8872('0x9'),auth[_0x8872('0x7')](),controller[_0x8872('0x11')]);router['delete'](_0x8872('0x9'),auth['isAuthenticated'](),controller[_0x8872('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xb92b=['delete','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x2128ae,_0x190a65){var _0x90694f=function(_0x547304){while(--_0x547304){_0x2128ae['push'](_0x2128ae['shift']());}};_0x90694f(++_0x190a65);}(_0xb92b,0xdd));var _0xbb92=function(_0x28df27,_0x32db76){_0x28df27=_0x28df27-0x0;var _0x414251=_0xb92b[_0x28df27];return _0x414251;};'use strict';var multer=require(_0xbb92('0x0'));var util=require(_0xbb92('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbb92('0x2'));var router=express[_0xbb92('0x3')]();var auth=require(_0xbb92('0x4'));var interaction=require(_0xbb92('0x5'));var config=require(_0xbb92('0x6'));var controller=require(_0xbb92('0x7'));router[_0xbb92('0x8')]('/',auth['isAuthenticated'](),controller[_0xbb92('0x9')]);router[_0xbb92('0x8')](_0xbb92('0xa'),auth[_0xbb92('0xb')](),controller[_0xbb92('0xc')]);router[_0xbb92('0x8')](_0xbb92('0xd'),auth[_0xbb92('0xb')](),controller[_0xbb92('0xe')]);router[_0xbb92('0x8')](_0xbb92('0xf'),auth[_0xbb92('0xb')](),controller[_0xbb92('0x10')]);router[_0xbb92('0x11')]('/',auth[_0xbb92('0xb')](),controller[_0xbb92('0x12')]);router[_0xbb92('0x11')](_0xbb92('0xd'),auth[_0xbb92('0xb')](),controller[_0xbb92('0x13')]);router[_0xbb92('0x14')](_0xbb92('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xbb92('0x15')]('/:id',auth[_0xbb92('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 823cc92..5c2773a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf08c=['username','sequelize','exports','STRING'];(function(_0x29aa79,_0x55392d){var _0x4e27b9=function(_0x67cc1b){while(--_0x67cc1b){_0x29aa79['push'](_0x29aa79['shift']());}};_0x4e27b9(++_0x55392d);}(_0xf08c,0xb5));var _0xcf08=function(_0x5eae6c,_0x5855c0){_0x5eae6c=_0x5eae6c-0x0;var _0x12b731=_0xf08c[_0x5eae6c];return _0x12b731;};'use strict';var Sequelize=require(_0xcf08('0x0'));module[_0xcf08('0x1')]={'name':{'type':Sequelize[_0xcf08('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcf08('0x2')],'unique':_0xcf08('0x3')},'apiKey':{'type':Sequelize[_0xcf08('0x2')]},'remoteUri':{'type':Sequelize[_0xcf08('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb94c=['STRING','remoteUri','sequelize','exports'];(function(_0x2172c6,_0xb03756){var _0x1ea290=function(_0x5698af){while(--_0x5698af){_0x2172c6['push'](_0x2172c6['shift']());}};_0x1ea290(++_0xb03756);}(_0xb94c,0x176));var _0xcb94=function(_0x4b38c2,_0x54550d){_0x4b38c2=_0x4b38c2-0x0;var _0x3081fe=_0xb94c[_0x4b38c2];return _0x3081fe;};'use strict';var Sequelize=require(_0xcb94('0x0'));module[_0xcb94('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcb94('0x2')]},'username':{'type':Sequelize[_0xcb94('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xcb94('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xcb94('0x3')},'serverUrl':{'type':Sequelize[_0xcb94('0x2')]}};
\ No newline at end of file
index 29a353b..2336204 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a1=['request','then','info','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','keys','include','options','find','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshsalesField','Descriptions','username','apiKey','remoteUri','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x34cc52,_0x5214e7){var _0x3c6ec3=function(_0x27f372){while(--_0x27f372){_0x34cc52['push'](_0x34cc52['shift']());}};_0x3c6ec3(++_0x5214e7);}(_0x73a1,0xc6));var _0x173a=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x73a1[_0x22431e];return _0xd978e9;};'use strict';var pdf=require(_0x173a('0x0'));var emlformat=require(_0x173a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x173a('0x2'));var jsonpatch=require(_0x173a('0x3'));var rp=require('request-promise');var moment=require(_0x173a('0x4'));var BPromise=require(_0x173a('0x5'));var Mustache=require(_0x173a('0x6'));var util=require(_0x173a('0x7'));var path=require(_0x173a('0x8'));var sox=require('sox');var csv=require(_0x173a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x173a('0xa'));var squel=require(_0x173a('0xb'));var crypto=require(_0x173a('0xc'));var jsforce=require(_0x173a('0xd'));var deskjs=require(_0x173a('0xe'));var toCsv=require(_0x173a('0x9'));var querystring=require(_0x173a('0xf'));var Papa=require('papaparse');var Redis=require(_0x173a('0x10'));var authService=require(_0x173a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x173a('0x12'));var logger=require(_0x173a('0x13'))('api');var utils=require(_0x173a('0x14'));var config=require(_0x173a('0x15'));var db=require(_0x173a('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x173a('0x17'));var client=jayson[_0x173a('0x18')][_0x173a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x26175e,_0xc57568,_0xa15f84){if(_0xa15f84){var _0x5eacc4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5eacc4[_0x173a('0x1a')](_0xc57568)){return _0x26175e;}else{throw new db[(_0x173a('0x1b'))][(_0x173a('0x1c'))](_0x173a('0x1d'));}}else{return _0x26175e;}}function respondWithRpcPromise(_0x1e1d50,_0xe400db,_0x5405ea,_0x3f8abc){return new BPromise(function(_0x36992d,_0x31432d){var _0xbbf4f3=_0x3f8abc||client;return _0xbbf4f3[_0x173a('0x1e')](_0x1e1d50,_0x5405ea)[_0x173a('0x1f')](function(_0x1bfc71){logger[_0x173a('0x20')]('FreshsalesAccount,\x20%s,\x20%s',_0xe400db,_0x173a('0x21'));logger[_0x173a('0x22')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0xe400db,_0x173a('0x21'),JSON[_0x173a('0x23')](_0x1bfc71));if(_0x1bfc71[_0x173a('0x24')]){if(_0x1bfc71[_0x173a('0x24')][_0x173a('0x25')]===0x1f4){logger['error'](_0x173a('0x26'),_0xe400db,_0x1bfc71[_0x173a('0x24')][_0x173a('0x27')]);return _0x31432d(_0x1bfc71[_0x173a('0x24')][_0x173a('0x27')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0xe400db,_0x1bfc71['error'][_0x173a('0x27')]);return _0x36992d(_0x1bfc71['error'][_0x173a('0x27')]);}else{logger[_0x173a('0x20')]('FreshsalesAccount,\x20%s,\x20%s',_0xe400db,_0x173a('0x21'));_0x36992d(_0x1bfc71[_0x173a('0x28')]['message']);}})[_0x173a('0x29')](function(_0x32990b){logger['error'](_0x173a('0x26'),_0xe400db,_0x32990b);_0x31432d(_0x32990b);});});}function respondWithStatusCode(_0x548eb1,_0x5f4376){_0x5f4376=_0x5f4376||0xcc;return function(_0x1ad8b4){if(_0x1ad8b4){return _0x548eb1[_0x173a('0x2a')](_0x5f4376);}return _0x548eb1[_0x173a('0x2b')](_0x5f4376)[_0x173a('0x2c')]();};}function respondWithResult(_0x1405bb,_0xd8d4ad){_0xd8d4ad=_0xd8d4ad||0xc8;return function(_0x266919){if(_0x266919){return _0x1405bb[_0x173a('0x2b')](_0xd8d4ad)['json'](_0x266919);}};}function respondWithFilteredResult(_0x3791e3,_0x368fd5){return function(_0x5e4027){if(_0x5e4027){var _0xb24cdb=_0x5e4027[_0x173a('0x2d')],_0x498b7b=_0x368fd5['offset'],_0x47ad58=_0x368fd5[_0x173a('0x2e')]+_0x368fd5[_0x173a('0x2f')],_0x4f681e;if(_0x47ad58>=_0xb24cdb){_0x47ad58=_0xb24cdb;_0x4f681e=0xc8;}else{_0x4f681e=0xce;}_0x3791e3['status'](_0x4f681e);return _0x3791e3[_0x173a('0x30')](_0x173a('0x31'),_0x498b7b+'-'+_0x47ad58+'/'+_0xb24cdb)['json'](_0x5e4027);}return null;};}function patchUpdates(_0x6cdd2f){return function(_0x307b35){try{jsonpatch[_0x173a('0x32')](_0x307b35,_0x6cdd2f,!![]);}catch(_0x470cda){return BPromise[_0x173a('0x33')](_0x470cda);}return _0x307b35[_0x173a('0x34')]();};}function saveUpdates(_0x4f99ed,_0x2df998){return function(_0x29b02a){if(_0x29b02a){return _0x29b02a[_0x173a('0x35')](_0x4f99ed)[_0x173a('0x1f')](function(_0xfcf6c6){return _0xfcf6c6;});}return null;};}function removeEntity(_0x10d10b,_0x2f46ad){return function(_0x99f9fd){if(_0x99f9fd){return _0x99f9fd['destroy']()['then'](function(){_0x10d10b[_0x173a('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x205d24,_0x5ecf24){return function(_0x3ae2b2){if(!_0x3ae2b2){_0x205d24['sendStatus'](0x194);}return _0x3ae2b2;};}function handleError(_0x6bf6d6,_0x50b564){_0x50b564=_0x50b564||0x1f4;return function(_0x12d65f){logger['error'](_0x12d65f[_0x173a('0x36')]);if(_0x12d65f[_0x173a('0x37')]){delete _0x12d65f[_0x173a('0x37')];}_0x6bf6d6[_0x173a('0x2b')](_0x50b564)[_0x173a('0x38')](_0x12d65f);};}exports['index']=function(_0x23e9f1,_0x4b442a){var _0x574918={},_0x3fd5b3={},_0x1ce6ce={'count':0x0,'rows':[]};var _0x18b8bb=_[_0x173a('0x39')](db[_0x173a('0x3a')][_0x173a('0x3b')],function(_0x558514){return{'name':_0x558514[_0x173a('0x3c')],'type':_0x558514['type'][_0x173a('0x3d')]};});_0x3fd5b3[_0x173a('0x3e')]=_[_0x173a('0x39')](_0x18b8bb,_0x173a('0x37'));_0x3fd5b3['query']=_['keys'](_0x23e9f1[_0x173a('0x3f')]);_0x3fd5b3[_0x173a('0x40')]=_[_0x173a('0x41')](_0x3fd5b3[_0x173a('0x3e')],_0x3fd5b3[_0x173a('0x3f')]);_0x574918[_0x173a('0x42')]=_['intersection'](_0x3fd5b3[_0x173a('0x3e')],qs[_0x173a('0x43')](_0x23e9f1[_0x173a('0x3f')][_0x173a('0x43')]));_0x574918['attributes']=_0x574918[_0x173a('0x42')][_0x173a('0x44')]?_0x574918[_0x173a('0x42')]:_0x3fd5b3[_0x173a('0x3e')];if(!_0x23e9f1[_0x173a('0x3f')]['hasOwnProperty'](_0x173a('0x45'))){_0x574918[_0x173a('0x2f')]=qs['limit'](_0x23e9f1[_0x173a('0x3f')][_0x173a('0x2f')]);_0x574918[_0x173a('0x2e')]=qs[_0x173a('0x2e')](_0x23e9f1[_0x173a('0x3f')][_0x173a('0x2e')]);}_0x574918[_0x173a('0x46')]=qs[_0x173a('0x47')](_0x23e9f1[_0x173a('0x3f')]['sort']);_0x574918[_0x173a('0x48')]=qs[_0x173a('0x40')](_[_0x173a('0x49')](_0x23e9f1[_0x173a('0x3f')],_0x3fd5b3[_0x173a('0x40')]),_0x18b8bb);if(_0x23e9f1['query'][_0x173a('0x4a')]){_0x574918[_0x173a('0x48')]=_[_0x173a('0x4b')](_0x574918[_0x173a('0x48')],{'$or':_[_0x173a('0x39')](_0x18b8bb,function(_0x52dc07){if(_0x52dc07[_0x173a('0x4c')]!==_0x173a('0x4d')){var _0x28030a={};_0x28030a[_0x52dc07[_0x173a('0x37')]]={'$like':'%'+_0x23e9f1[_0x173a('0x3f')][_0x173a('0x4a')]+'%'};return _0x28030a;}})});}_0x574918=_[_0x173a('0x4b')]({},_0x574918,_0x23e9f1['options']);var _0x4ad788={'where':_0x574918['where']};return db[_0x173a('0x3a')][_0x173a('0x2d')](_0x4ad788)['then'](function(_0x41ee72){_0x1ce6ce[_0x173a('0x2d')]=_0x41ee72;if(_0x23e9f1[_0x173a('0x3f')][_0x173a('0x4e')]){_0x574918['include']=[{'all':!![]}];}return db[_0x173a('0x3a')][_0x173a('0x4f')](_0x574918);})[_0x173a('0x1f')](function(_0x428f72){_0x1ce6ce[_0x173a('0x50')]=_0x428f72;return _0x1ce6ce;})[_0x173a('0x1f')](respondWithFilteredResult(_0x4b442a,_0x574918))['catch'](handleError(_0x4b442a,null));};exports[_0x173a('0x51')]=function(_0x6a92b,_0x3f6305){var _0xeec37d={'raw':![],'where':{'id':_0x6a92b[_0x173a('0x52')]['id']}},_0x5b0bed={};_0x5b0bed['model']=_[_0x173a('0x53')](db[_0x173a('0x3a')][_0x173a('0x3b')]);_0x5b0bed[_0x173a('0x3f')]=_[_0x173a('0x53')](_0x6a92b['query']);_0x5b0bed[_0x173a('0x40')]=_['intersection'](_0x5b0bed['model'],_0x5b0bed[_0x173a('0x3f')]);_0xeec37d[_0x173a('0x42')]=_[_0x173a('0x41')](_0x5b0bed[_0x173a('0x3e')],qs[_0x173a('0x43')](_0x6a92b[_0x173a('0x3f')]['fields']));_0xeec37d[_0x173a('0x42')]=_0xeec37d[_0x173a('0x42')][_0x173a('0x44')]?_0xeec37d[_0x173a('0x42')]:_0x5b0bed[_0x173a('0x3e')];if(_0x6a92b[_0x173a('0x3f')][_0x173a('0x4e')]){_0xeec37d[_0x173a('0x54')]=[{'all':!![]}];}_0xeec37d=_['merge']({},_0xeec37d,_0x6a92b[_0x173a('0x55')]);return db[_0x173a('0x3a')][_0x173a('0x56')](_0xeec37d)[_0x173a('0x1f')](handleEntityNotFound(_0x3f6305,null))[_0x173a('0x1f')](respondWithResult(_0x3f6305,null))[_0x173a('0x29')](handleError(_0x3f6305,null));};exports[_0x173a('0x57')]=function(_0x2834cc,_0xec20c5){return db[_0x173a('0x3a')][_0x173a('0x57')](_0x2834cc['body'],{})['then'](respondWithResult(_0xec20c5,0xc9))[_0x173a('0x29')](handleError(_0xec20c5,null));};exports['update']=function(_0xb0a877,_0x9fe4bf){if(_0xb0a877[_0x173a('0x58')]['id']){delete _0xb0a877[_0x173a('0x58')]['id'];}return db['FreshsalesAccount'][_0x173a('0x56')]({'where':{'id':_0xb0a877['params']['id']}})[_0x173a('0x1f')](handleEntityNotFound(_0x9fe4bf,null))[_0x173a('0x1f')](saveUpdates(_0xb0a877[_0x173a('0x58')],null))[_0x173a('0x1f')](respondWithResult(_0x9fe4bf,null))[_0x173a('0x29')](handleError(_0x9fe4bf,null));};exports[_0x173a('0x59')]=function(_0x273d61,_0x3d9bde){return db['FreshsalesAccount'][_0x173a('0x56')]({'where':{'id':_0x273d61['params']['id']}})[_0x173a('0x1f')](handleEntityNotFound(_0x3d9bde,null))[_0x173a('0x1f')](removeEntity(_0x3d9bde,null))[_0x173a('0x29')](handleError(_0x3d9bde,null));};exports[_0x173a('0x5a')]=function(_0x18e0da,_0x229089,_0x3a402a){var _0x1420c3={};var _0x596472={};var _0x448181;var _0x364744;return db['FreshsalesAccount'][_0x173a('0x5b')]({'where':{'id':_0x18e0da[_0x173a('0x52')]['id']}})[_0x173a('0x1f')](handleEntityNotFound(_0x229089,null))['then'](function(_0x3c478d){if(_0x3c478d){_0x448181=_0x3c478d;_0x596472[_0x173a('0x3e')]=_[_0x173a('0x53')](db[_0x173a('0x5c')]['rawAttributes']);_0x596472[_0x173a('0x3f')]=_[_0x173a('0x53')](_0x18e0da[_0x173a('0x3f')]);_0x596472[_0x173a('0x40')]=_[_0x173a('0x41')](_0x596472[_0x173a('0x3e')],_0x596472[_0x173a('0x3f')]);_0x1420c3[_0x173a('0x42')]=_[_0x173a('0x41')](_0x596472['model'],qs[_0x173a('0x43')](_0x18e0da['query'][_0x173a('0x43')]));_0x1420c3['attributes']=_0x1420c3[_0x173a('0x42')][_0x173a('0x44')]?_0x1420c3[_0x173a('0x42')]:_0x596472[_0x173a('0x3e')];_0x1420c3[_0x173a('0x46')]=qs[_0x173a('0x47')](_0x18e0da[_0x173a('0x3f')][_0x173a('0x47')]);_0x1420c3['where']=qs['filters'](_[_0x173a('0x49')](_0x18e0da[_0x173a('0x3f')],_0x596472[_0x173a('0x40')]));if(_0x18e0da[_0x173a('0x3f')][_0x173a('0x4a')]){_0x1420c3['where']=_[_0x173a('0x4b')](_0x1420c3[_0x173a('0x48')],{'$or':_['map'](_0x1420c3['attributes'],function(_0x92146d){var _0x5ee557={};_0x5ee557[_0x92146d]={'$like':'%'+_0x18e0da[_0x173a('0x3f')]['filter']+'%'};return _0x5ee557;})});}_0x1420c3=_['merge']({},_0x1420c3,_0x18e0da[_0x173a('0x55')]);return _0x448181[_0x173a('0x5a')](_0x1420c3);}})[_0x173a('0x1f')](function(_0x575428){if(_0x575428){_0x364744=_0x575428['length'];if(!_0x18e0da[_0x173a('0x3f')][_0x173a('0x5d')](_0x173a('0x45'))){_0x1420c3[_0x173a('0x2f')]=qs[_0x173a('0x2f')](_0x18e0da[_0x173a('0x3f')][_0x173a('0x2f')]);_0x1420c3['offset']=qs[_0x173a('0x2e')](_0x18e0da[_0x173a('0x3f')]['offset']);}return _0x448181['getConfigurations'](_0x1420c3);}})[_0x173a('0x1f')](function(_0x1fe034){if(_0x1fe034){return _0x1fe034?{'count':_0x364744,'rows':_0x1fe034}:null;}})[_0x173a('0x1f')](respondWithResult(_0x229089,null))[_0x173a('0x29')](handleError(_0x229089,null));};exports[_0x173a('0x5e')]=function(_0x42f99c,_0xefb5eb,_0x4d313a){if(_0x42f99c[_0x173a('0x58')]['id']){delete _0x42f99c[_0x173a('0x58')]['id'];}return db['FreshsalesAccount'][_0x173a('0x5b')]({'where':{'id':_0x42f99c[_0x173a('0x52')]['id']}})[_0x173a('0x1f')](handleEntityNotFound(_0xefb5eb,null))['then'](function(_0x2c2f83){if(_0x2c2f83){_0x42f99c[_0x173a('0x58')][_0x173a('0x5f')]=_0x2c2f83['id'];_0x42f99c[_0x173a('0x58')][_0x173a('0x60')]=integrations[_0x173a('0x61')](_0x42f99c[_0x173a('0x58')][_0x173a('0x62')],_0x42f99c['body'][_0x173a('0x4c')]);_0x42f99c[_0x173a('0x58')]['Descriptions']=integrations['getDescriptions'](_0x42f99c[_0x173a('0x58')][_0x173a('0x62')],_0x42f99c['body']['type']);return db['FreshsalesConfiguration'][_0x173a('0x57')](_0x42f99c['body'],{'include':[{'model':db[_0x173a('0x63')],'as':_0x173a('0x60')},{'model':db[_0x173a('0x63')],'as':_0x173a('0x64')}]});}return null;})[_0x173a('0x1f')](respondWithResult(_0xefb5eb,null))['catch'](handleError(_0xefb5eb,null));};exports['getFields']=function(_0x39d45f,_0xe8fd1e,_0x3712c3){var _0x4696ae='';var _0x36284e='';return db[_0x173a('0x3a')]['findOne']({'where':{'id':_0x39d45f[_0x173a('0x52')]['id']},'attributes':['id',_0x173a('0x65'),'remoteUri',_0x173a('0x66')]})['then'](handleEntityNotFound(_0xe8fd1e,null))[_0x173a('0x1f')](function(_0xe4786){if(_0xe4786){_0x36284e=_0xe4786['username'];_0x4696ae=_0xe4786['remoteUri'];var _0x50d8fa=_0xe4786[_0x173a('0x67')]['slice'](-0x1);if(_0x50d8fa==='/'){_0x4696ae=_0x4696ae[_0x173a('0x68')](0x0,_0x4696ae['lastIndexOf'](_0x50d8fa));}return rp({'method':_0x173a('0x69'),'uri':util[_0x173a('0x6a')](_0x173a('0x6b'),_0x4696ae,_0x173a('0x6c')),'headers':{'Authorization':_0x173a('0x6d')+_0xe4786['apiKey']},'json':!![]});}})[_0x173a('0x1f')](function(_0x319d1f){if(_0x319d1f){var _0x47efb8=_0x319d1f[_0x173a('0x6e')];var _0x2d26cf=![];var _0x34cb75=null;for(_0x34cb75=0x0;_0x34cb75<_0x47efb8[_0x173a('0x44')];_0x34cb75++){if(_0x47efb8[_0x34cb75][_0x173a('0x6f')]===_0x36284e){_0x2d26cf=!![];}}if(_0x2d26cf){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x173a('0x70')});}}})[_0x173a('0x1f')](respondWithResult(_0xe8fd1e,null))[_0x173a('0x29')](function(_0x5af466){var _0x3724ad=_0x39d45f[_0x173a('0x3f')]['test']?0x1f4:_0x5af466[_0x173a('0x71')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3724ad,JSON[_0x173a('0x23')](_0x5af466));delete _0x5af466['name'];if(_0x3724ad===0x191){_0x3724ad=0x190;}_0xe8fd1e[_0x173a('0x2b')](_0x3724ad)['send'](_0x39d45f[_0x173a('0x3f')][_0x173a('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x5af466[_0x173a('0x71')]}:_0x5af466);});};
\ No newline at end of file
+var _0x78ba=['attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','params','find','catch','create','body','getConfigurations','pick','hasOwnProperty','findOne','getSubjects','channel','FreshsalesField','Subjects','Descriptions','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','jayson/promise','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','info','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','sendStatus','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x78ba,0x16e));var _0xa78b=function(_0x332d45,_0x1090fa){_0x332d45=_0x332d45-0x0;var _0x1a0506=_0x78ba[_0x332d45];return _0x1a0506;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa78b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa78b('0x1'));var moment=require('moment');var BPromise=require(_0xa78b('0x2'));var Mustache=require(_0xa78b('0x3'));var util=require(_0xa78b('0x4'));var path=require(_0xa78b('0x5'));var sox=require(_0xa78b('0x6'));var csv=require(_0xa78b('0x7'));var ejs=require(_0xa78b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa78b('0x9'));var jsforce=require(_0xa78b('0xa'));var deskjs=require(_0xa78b('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa78b('0xc'));var Papa=require(_0xa78b('0xd'));var Redis=require(_0xa78b('0xe'));var authService=require(_0xa78b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa78b('0x10'));var logger=require(_0xa78b('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xa78b('0x12'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa78b('0x13'));var client=jayson[_0xa78b('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x5f3017,_0x1ba2cc,_0x48344e){if(_0x48344e){var _0x49f325=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49f325[_0xa78b('0x15')](_0x1ba2cc)){return _0x5f3017;}else{throw new db['Sequelize'][(_0xa78b('0x16'))](_0xa78b('0x17'));}}else{return _0x5f3017;}}function respondWithRpcPromise(_0x416239,_0x15e5be,_0x42afd4,_0x2774b0){return new BPromise(function(_0x3ccc4f,_0xfacf3d){var _0x56cc2c=_0x2774b0||client;return _0x56cc2c[_0xa78b('0x18')](_0x416239,_0x42afd4)['then'](function(_0x252a22){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x15e5be,_0xa78b('0x19'));logger[_0xa78b('0x1a')](_0xa78b('0x1b'),_0x15e5be,_0xa78b('0x19'),JSON[_0xa78b('0x1c')](_0x252a22));if(_0x252a22['error']){if(_0x252a22[_0xa78b('0x1d')][_0xa78b('0x1e')]===0x1f4){logger[_0xa78b('0x1d')](_0xa78b('0x1f'),_0x15e5be,_0x252a22[_0xa78b('0x1d')][_0xa78b('0x20')]);return _0xfacf3d(_0x252a22[_0xa78b('0x1d')]['message']);}logger[_0xa78b('0x1d')](_0xa78b('0x1f'),_0x15e5be,_0x252a22['error'][_0xa78b('0x20')]);return _0x3ccc4f(_0x252a22['error'][_0xa78b('0x20')]);}else{logger[_0xa78b('0x21')](_0xa78b('0x1f'),_0x15e5be,'request\x20sent');_0x3ccc4f(_0x252a22['result']['message']);}})['catch'](function(_0x5e201e){logger[_0xa78b('0x1d')](_0xa78b('0x1f'),_0x15e5be,_0x5e201e);_0xfacf3d(_0x5e201e);});});}function respondWithStatusCode(_0x26a5b1,_0x563a83){_0x563a83=_0x563a83||0xcc;return function(_0x548ed6){if(_0x548ed6){return _0x26a5b1['sendStatus'](_0x563a83);}return _0x26a5b1[_0xa78b('0x22')](_0x563a83)[_0xa78b('0x23')]();};}function respondWithResult(_0x6b02e0,_0x1c95eb){_0x1c95eb=_0x1c95eb||0xc8;return function(_0x28456d){if(_0x28456d){return _0x6b02e0['status'](_0x1c95eb)[_0xa78b('0x24')](_0x28456d);}};}function respondWithFilteredResult(_0x2e7a82,_0xc10b2f){return function(_0xcb4270){if(_0xcb4270){var _0x5ede7e=_0xcb4270[_0xa78b('0x25')],_0x54e710=_0xc10b2f[_0xa78b('0x26')],_0x57cdae=_0xc10b2f['offset']+_0xc10b2f[_0xa78b('0x27')],_0x5b9a52;if(_0x57cdae>=_0x5ede7e){_0x57cdae=_0x5ede7e;_0x5b9a52=0xc8;}else{_0x5b9a52=0xce;}_0x2e7a82[_0xa78b('0x22')](_0x5b9a52);return _0x2e7a82[_0xa78b('0x28')](_0xa78b('0x29'),_0x54e710+'-'+_0x57cdae+'/'+_0x5ede7e)[_0xa78b('0x24')](_0xcb4270);}return null;};}function patchUpdates(_0x1b22b1){return function(_0x42f7bb){try{jsonpatch[_0xa78b('0x2a')](_0x42f7bb,_0x1b22b1,!![]);}catch(_0x447172){return BPromise['reject'](_0x447172);}return _0x42f7bb[_0xa78b('0x2b')]();};}function saveUpdates(_0x477775,_0x2f3b33){return function(_0x3a27a0){if(_0x3a27a0){return _0x3a27a0[_0xa78b('0x2c')](_0x477775)['then'](function(_0x2ec8a5){return _0x2ec8a5;});}return null;};}function removeEntity(_0x11d772,_0xd626f9){return function(_0x551842){if(_0x551842){return _0x551842['destroy']()[_0xa78b('0x2d')](function(){_0x11d772['status'](0xcc)[_0xa78b('0x23')]();});}};}function handleEntityNotFound(_0x225fe0,_0x26bc6f){return function(_0x5dbb1b){if(!_0x5dbb1b){_0x225fe0[_0xa78b('0x2e')](0x194);}return _0x5dbb1b;};}function handleError(_0x2b05d9,_0xd20c96){_0xd20c96=_0xd20c96||0x1f4;return function(_0x5c5a1f){logger['error'](_0x5c5a1f[_0xa78b('0x2f')]);if(_0x5c5a1f[_0xa78b('0x30')]){delete _0x5c5a1f[_0xa78b('0x30')];}_0x2b05d9['status'](_0xd20c96)[_0xa78b('0x31')](_0x5c5a1f);};}exports[_0xa78b('0x32')]=function(_0x3f1b00,_0x238811){var _0x429e0a={},_0x59f1aa={},_0x23d454={'count':0x0,'rows':[]};var _0x431da5=_[_0xa78b('0x33')](db[_0xa78b('0x34')][_0xa78b('0x35')],function(_0x18d975){return{'name':_0x18d975[_0xa78b('0x36')],'type':_0x18d975[_0xa78b('0x37')][_0xa78b('0x38')]};});_0x59f1aa[_0xa78b('0x39')]=_['map'](_0x431da5,_0xa78b('0x30'));_0x59f1aa[_0xa78b('0x3a')]=_[_0xa78b('0x3b')](_0x3f1b00[_0xa78b('0x3a')]);_0x59f1aa[_0xa78b('0x3c')]=_[_0xa78b('0x3d')](_0x59f1aa[_0xa78b('0x39')],_0x59f1aa['query']);_0x429e0a[_0xa78b('0x3e')]=_['intersection'](_0x59f1aa[_0xa78b('0x39')],qs[_0xa78b('0x3f')](_0x3f1b00[_0xa78b('0x3a')]['fields']));_0x429e0a[_0xa78b('0x3e')]=_0x429e0a[_0xa78b('0x3e')][_0xa78b('0x40')]?_0x429e0a[_0xa78b('0x3e')]:_0x59f1aa['model'];if(!_0x3f1b00['query']['hasOwnProperty'](_0xa78b('0x41'))){_0x429e0a['limit']=qs[_0xa78b('0x27')](_0x3f1b00[_0xa78b('0x3a')][_0xa78b('0x27')]);_0x429e0a['offset']=qs[_0xa78b('0x26')](_0x3f1b00[_0xa78b('0x3a')][_0xa78b('0x26')]);}_0x429e0a[_0xa78b('0x42')]=qs[_0xa78b('0x43')](_0x3f1b00[_0xa78b('0x3a')][_0xa78b('0x43')]);_0x429e0a[_0xa78b('0x44')]=qs[_0xa78b('0x3c')](_['pick'](_0x3f1b00[_0xa78b('0x3a')],_0x59f1aa[_0xa78b('0x3c')]),_0x431da5);if(_0x3f1b00[_0xa78b('0x3a')][_0xa78b('0x45')]){_0x429e0a['where']=_[_0xa78b('0x46')](_0x429e0a[_0xa78b('0x44')],{'$or':_[_0xa78b('0x33')](_0x431da5,function(_0x3c2845){if(_0x3c2845[_0xa78b('0x37')]!==_0xa78b('0x47')){var _0x2038ce={};_0x2038ce[_0x3c2845['name']]={'$like':'%'+_0x3f1b00[_0xa78b('0x3a')]['filter']+'%'};return _0x2038ce;}})});}_0x429e0a=_['merge']({},_0x429e0a,_0x3f1b00[_0xa78b('0x48')]);var _0x418106={'where':_0x429e0a[_0xa78b('0x44')]};return db[_0xa78b('0x34')][_0xa78b('0x25')](_0x418106)[_0xa78b('0x2d')](function(_0x3f7fd0){_0x23d454[_0xa78b('0x25')]=_0x3f7fd0;if(_0x3f1b00['query'][_0xa78b('0x49')]){_0x429e0a[_0xa78b('0x4a')]=[{'all':!![]}];}return db[_0xa78b('0x34')]['findAll'](_0x429e0a);})[_0xa78b('0x2d')](function(_0x48ac3c){_0x23d454[_0xa78b('0x4b')]=_0x48ac3c;return _0x23d454;})[_0xa78b('0x2d')](respondWithFilteredResult(_0x238811,_0x429e0a))['catch'](handleError(_0x238811,null));};exports['show']=function(_0x533ab8,_0xa64111){var _0x5a37c7={'raw':![],'where':{'id':_0x533ab8[_0xa78b('0x4c')]['id']}},_0x308e59={};_0x308e59[_0xa78b('0x39')]=_[_0xa78b('0x3b')](db[_0xa78b('0x34')]['rawAttributes']);_0x308e59[_0xa78b('0x3a')]=_[_0xa78b('0x3b')](_0x533ab8[_0xa78b('0x3a')]);_0x308e59[_0xa78b('0x3c')]=_[_0xa78b('0x3d')](_0x308e59['model'],_0x308e59[_0xa78b('0x3a')]);_0x5a37c7[_0xa78b('0x3e')]=_[_0xa78b('0x3d')](_0x308e59['model'],qs['fields'](_0x533ab8[_0xa78b('0x3a')][_0xa78b('0x3f')]));_0x5a37c7['attributes']=_0x5a37c7[_0xa78b('0x3e')][_0xa78b('0x40')]?_0x5a37c7[_0xa78b('0x3e')]:_0x308e59['model'];if(_0x533ab8['query'][_0xa78b('0x49')]){_0x5a37c7[_0xa78b('0x4a')]=[{'all':!![]}];}_0x5a37c7=_[_0xa78b('0x46')]({},_0x5a37c7,_0x533ab8[_0xa78b('0x48')]);return db[_0xa78b('0x34')][_0xa78b('0x4d')](_0x5a37c7)[_0xa78b('0x2d')](handleEntityNotFound(_0xa64111,null))['then'](respondWithResult(_0xa64111,null))[_0xa78b('0x4e')](handleError(_0xa64111,null));};exports['create']=function(_0x2736e3,_0x247a24){return db[_0xa78b('0x34')][_0xa78b('0x4f')](_0x2736e3[_0xa78b('0x50')],{})[_0xa78b('0x2d')](respondWithResult(_0x247a24,0xc9))[_0xa78b('0x4e')](handleError(_0x247a24,null));};exports[_0xa78b('0x2c')]=function(_0x6f0fcd,_0x4bf53b){if(_0x6f0fcd[_0xa78b('0x50')]['id']){delete _0x6f0fcd[_0xa78b('0x50')]['id'];}return db[_0xa78b('0x34')]['find']({'where':{'id':_0x6f0fcd[_0xa78b('0x4c')]['id']}})[_0xa78b('0x2d')](handleEntityNotFound(_0x4bf53b,null))[_0xa78b('0x2d')](saveUpdates(_0x6f0fcd['body'],null))[_0xa78b('0x2d')](respondWithResult(_0x4bf53b,null))[_0xa78b('0x4e')](handleError(_0x4bf53b,null));};exports['destroy']=function(_0xc185b,_0x327588){return db[_0xa78b('0x34')]['find']({'where':{'id':_0xc185b[_0xa78b('0x4c')]['id']}})[_0xa78b('0x2d')](handleEntityNotFound(_0x327588,null))['then'](removeEntity(_0x327588,null))[_0xa78b('0x4e')](handleError(_0x327588,null));};exports[_0xa78b('0x51')]=function(_0x31f8a1,_0x15021f,_0x3ae3e2){var _0x481c69={};var _0x1a66f={};var _0x3e74c6;var _0x45da8a;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x31f8a1[_0xa78b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x15021f,null))[_0xa78b('0x2d')](function(_0x3edfb6){if(_0x3edfb6){_0x3e74c6=_0x3edfb6;_0x1a66f[_0xa78b('0x39')]=_[_0xa78b('0x3b')](db['FreshsalesConfiguration'][_0xa78b('0x35')]);_0x1a66f[_0xa78b('0x3a')]=_[_0xa78b('0x3b')](_0x31f8a1[_0xa78b('0x3a')]);_0x1a66f['filters']=_['intersection'](_0x1a66f[_0xa78b('0x39')],_0x1a66f[_0xa78b('0x3a')]);_0x481c69[_0xa78b('0x3e')]=_[_0xa78b('0x3d')](_0x1a66f[_0xa78b('0x39')],qs[_0xa78b('0x3f')](_0x31f8a1[_0xa78b('0x3a')][_0xa78b('0x3f')]));_0x481c69['attributes']=_0x481c69[_0xa78b('0x3e')][_0xa78b('0x40')]?_0x481c69[_0xa78b('0x3e')]:_0x1a66f[_0xa78b('0x39')];_0x481c69[_0xa78b('0x42')]=qs['sort'](_0x31f8a1['query'][_0xa78b('0x43')]);_0x481c69[_0xa78b('0x44')]=qs['filters'](_[_0xa78b('0x52')](_0x31f8a1[_0xa78b('0x3a')],_0x1a66f[_0xa78b('0x3c')]));if(_0x31f8a1[_0xa78b('0x3a')][_0xa78b('0x45')]){_0x481c69[_0xa78b('0x44')]=_[_0xa78b('0x46')](_0x481c69['where'],{'$or':_[_0xa78b('0x33')](_0x481c69[_0xa78b('0x3e')],function(_0xeb73bc){var _0xdda11c={};_0xdda11c[_0xeb73bc]={'$like':'%'+_0x31f8a1[_0xa78b('0x3a')][_0xa78b('0x45')]+'%'};return _0xdda11c;})});}_0x481c69=_['merge']({},_0x481c69,_0x31f8a1[_0xa78b('0x48')]);return _0x3e74c6[_0xa78b('0x51')](_0x481c69);}})['then'](function(_0xe2a8b7){if(_0xe2a8b7){_0x45da8a=_0xe2a8b7['length'];if(!_0x31f8a1[_0xa78b('0x3a')][_0xa78b('0x53')](_0xa78b('0x41'))){_0x481c69[_0xa78b('0x27')]=qs[_0xa78b('0x27')](_0x31f8a1['query']['limit']);_0x481c69[_0xa78b('0x26')]=qs[_0xa78b('0x26')](_0x31f8a1[_0xa78b('0x3a')][_0xa78b('0x26')]);}return _0x3e74c6[_0xa78b('0x51')](_0x481c69);}})[_0xa78b('0x2d')](function(_0x4e446d){if(_0x4e446d){return _0x4e446d?{'count':_0x45da8a,'rows':_0x4e446d}:null;}})[_0xa78b('0x2d')](respondWithResult(_0x15021f,null))['catch'](handleError(_0x15021f,null));};exports['addConfiguration']=function(_0x5ad3af,_0x39ee47,_0x2dae84){if(_0x5ad3af[_0xa78b('0x50')]['id']){delete _0x5ad3af[_0xa78b('0x50')]['id'];}return db['FreshsalesAccount'][_0xa78b('0x54')]({'where':{'id':_0x5ad3af[_0xa78b('0x4c')]['id']}})[_0xa78b('0x2d')](handleEntityNotFound(_0x39ee47,null))[_0xa78b('0x2d')](function(_0x909a44){if(_0x909a44){_0x5ad3af[_0xa78b('0x50')]['AccountId']=_0x909a44['id'];_0x5ad3af[_0xa78b('0x50')]['Subjects']=integrations[_0xa78b('0x55')](_0x5ad3af[_0xa78b('0x50')][_0xa78b('0x56')],_0x5ad3af[_0xa78b('0x50')][_0xa78b('0x37')]);_0x5ad3af['body']['Descriptions']=integrations['getDescriptions'](_0x5ad3af[_0xa78b('0x50')][_0xa78b('0x56')],_0x5ad3af['body'][_0xa78b('0x37')]);return db['FreshsalesConfiguration']['create'](_0x5ad3af[_0xa78b('0x50')],{'include':[{'model':db[_0xa78b('0x57')],'as':_0xa78b('0x58')},{'model':db['FreshsalesField'],'as':_0xa78b('0x59')}]});}return null;})[_0xa78b('0x2d')](respondWithResult(_0x39ee47,null))[_0xa78b('0x4e')](handleError(_0x39ee47,null));};exports['getFields']=function(_0x24fb05,_0x22affd,_0x3cbe9e){var _0x5b2fb7='';var _0x302375='';return db[_0xa78b('0x34')][_0xa78b('0x54')]({'where':{'id':_0x24fb05[_0xa78b('0x4c')]['id']},'attributes':['id',_0xa78b('0x5a'),_0xa78b('0x5b'),_0xa78b('0x5c')]})[_0xa78b('0x2d')](handleEntityNotFound(_0x22affd,null))[_0xa78b('0x2d')](function(_0x55e7cd){if(_0x55e7cd){_0x302375=_0x55e7cd[_0xa78b('0x5a')];_0x5b2fb7=_0x55e7cd[_0xa78b('0x5b')];var _0x466a11=_0x55e7cd[_0xa78b('0x5b')][_0xa78b('0x5d')](-0x1);if(_0x466a11==='/'){_0x5b2fb7=_0x5b2fb7[_0xa78b('0x5e')](0x0,_0x5b2fb7[_0xa78b('0x5f')](_0x466a11));}return rp({'method':_0xa78b('0x60'),'uri':util[_0xa78b('0x61')](_0xa78b('0x62'),_0x5b2fb7,_0xa78b('0x63')),'headers':{'Authorization':_0xa78b('0x64')+_0x55e7cd[_0xa78b('0x5c')]},'json':!![]});}})[_0xa78b('0x2d')](function(_0x2bfae0){if(_0x2bfae0){var _0x1411b4=_0x2bfae0['users'];var _0x4e4773=![];var _0x55d1c1=null;for(_0x55d1c1=0x0;_0x55d1c1<_0x1411b4[_0xa78b('0x40')];_0x55d1c1++){if(_0x1411b4[_0x55d1c1][_0xa78b('0x65')]===_0x302375){_0x4e4773=!![];}}if(_0x4e4773){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa78b('0x66')});}}})[_0xa78b('0x2d')](respondWithResult(_0x22affd,null))[_0xa78b('0x4e')](function(_0x32871c){var _0x186b3a=_0x24fb05[_0xa78b('0x3a')][_0xa78b('0x15')]?0x1f4:_0x32871c[_0xa78b('0x67')]||0x1f4;logger[_0xa78b('0x1d')](_0xa78b('0x68'),_0xa78b('0x69'),_0x186b3a,JSON['stringify'](_0x32871c));delete _0x32871c['name'];if(_0x186b3a===0x191){_0x186b3a=0x190;}_0x22affd[_0xa78b('0x22')](_0x186b3a)[_0xa78b('0x31')](_0x24fb05['query'][_0xa78b('0x15')]?{'message':_0xa78b('0x6a'),'statusCode':_0x32871c[_0xa78b('0x67')]}:_0x32871c);});};
\ No newline at end of file
index 87f2de3..a8b257e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0979=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','api'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0979,0x1a1));var _0x9097=function(_0x3bb859,_0x589816){_0x3bb859=_0x3bb859-0x0;var _0x3bf534=_0x0979[_0x3bb859];return _0x3bf534;};'use strict';var _=require(_0x9097('0x0'));var util=require(_0x9097('0x1'));var logger=require('../../config/logger')(_0x9097('0x2'));var moment=require('moment');var BPromise=require(_0x9097('0x3'));var rp=require(_0x9097('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9097('0x5'));var config=require(_0x9097('0x6'));var attributes=require(_0x9097('0x7'));var integrations=require(_0x9097('0x8'));module[_0x9097('0x9')]=function(_0x5789ab,_0x36c0d8){return _0x5789ab['define'](_0x9097('0xa'),attributes,{'tableName':_0x9097('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9fd=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','int_freshsales_accounts','util','../../config/logger','api','moment','path'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf9fd,0x14f));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xdf9f('0x0'));var logger=require(_0xdf9f('0x1'))(_0xdf9f('0x2'));var moment=require(_0xdf9f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf9f('0x4'));var rimraf=require(_0xdf9f('0x5'));var config=require(_0xdf9f('0x6'));var attributes=require(_0xdf9f('0x7'));var integrations=require(_0xdf9f('0x8'));module['exports']=function(_0x4734df,_0x41d712){return _0x4734df['define']('FreshsalesAccount',attributes,{'tableName':_0xdf9f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe79b73..5cffd76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c99=['findAll','options','attributes','limit','include','map','model','ShowFreshsalesAccount','find','raw','where','catch','lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount'];(function(_0x4a490b,_0x31483d){var _0x5a3fc9=function(_0x4b8ebf){while(--_0x4b8ebf){_0x4a490b['push'](_0x4a490b['shift']());}};_0x5a3fc9(++_0x31483d);}(_0x4c99,0x1ec));var _0x94c9=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x4c99[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var moment=require(_0x94c9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94c9('0x2'))['db'];var utils=require(_0x94c9('0x3'));var logger=require('../../config/logger')(_0x94c9('0x4'));var config=require(_0x94c9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x94c9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ebd2b,_0x49b85b,_0x23d961){return new BPromise(function(_0x4403ba,_0x3a1743){return client[_0x94c9('0x7')](_0x4ebd2b,_0x23d961)[_0x94c9('0x8')](function(_0x1c0983){logger[_0x94c9('0x9')](_0x94c9('0xa'),_0x49b85b,_0x94c9('0xb'));logger[_0x94c9('0xc')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x49b85b,_0x94c9('0xb'),JSON[_0x94c9('0xd')](_0x1c0983));if(_0x1c0983[_0x94c9('0xe')]){if(_0x1c0983['error'][_0x94c9('0xf')]===0x1f4){logger[_0x94c9('0xe')](_0x94c9('0xa'),_0x49b85b,_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);return _0x3a1743(_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);}logger[_0x94c9('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x49b85b,_0x1c0983['error']['message']);return _0x4403ba(_0x1c0983[_0x94c9('0xe')][_0x94c9('0x10')]);}else{logger['info'](_0x94c9('0xa'),_0x49b85b,_0x94c9('0xb'));_0x4403ba(_0x1c0983[_0x94c9('0x11')]['message']);}})['catch'](function(_0x447937){logger[_0x94c9('0xe')](_0x94c9('0xa'),_0x49b85b,_0x447937);_0x3a1743(_0x447937);});});}exports[_0x94c9('0x12')]=function(_0x5ab49f){var _0xb3d5d6=this;return new Promise(function(_0x2bca02,_0x3a38cc){return db[_0x94c9('0x13')][_0x94c9('0x14')]({'raw':_0x5ab49f[_0x94c9('0x15')]?_0x5ab49f[_0x94c9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5ab49f[_0x94c9('0x15')]?_0x5ab49f[_0x94c9('0x15')]['where']||null:null,'attributes':_0x5ab49f[_0x94c9('0x15')]?_0x5ab49f[_0x94c9('0x15')][_0x94c9('0x16')]||null:null,'limit':_0x5ab49f[_0x94c9('0x15')]?_0x5ab49f[_0x94c9('0x15')][_0x94c9('0x17')]||null:null,'include':_0x5ab49f[_0x94c9('0x15')]?_0x5ab49f[_0x94c9('0x15')][_0x94c9('0x18')]?_[_0x94c9('0x19')](_0x5ab49f['options'][_0x94c9('0x18')],function(_0x50ee41){return{'model':db[_0x50ee41[_0x94c9('0x1a')]],'as':_0x50ee41['as'],'attributes':_0x50ee41['attributes'],'include':_0x50ee41[_0x94c9('0x18')]?_[_0x94c9('0x19')](_0x50ee41[_0x94c9('0x18')],function(_0xf73058){return{'model':db[_0xf73058[_0x94c9('0x1a')]],'as':_0xf73058['as'],'attributes':_0xf73058[_0x94c9('0x16')],'include':_0xf73058['include']?_[_0x94c9('0x19')](_0xf73058[_0x94c9('0x18')],function(_0x15718d){return{'model':db[_0x15718d['model']],'as':_0x15718d['as'],'attributes':_0x15718d[_0x94c9('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x586b40){logger[_0x94c9('0x9')](_0x94c9('0x12'),_0x5ab49f);logger[_0x94c9('0xc')](_0x94c9('0x12'),_0x5ab49f,JSON[_0x94c9('0xd')](_0x586b40));_0x2bca02(_0x586b40);})['catch'](function(_0x3ab136){logger[_0x94c9('0xe')](_0x94c9('0x12'),_0x3ab136['message'],_0x5ab49f);_0x3a38cc(_0xb3d5d6[_0x94c9('0xe')](0x1f4,_0x3ab136[_0x94c9('0x10')]));});});};exports[_0x94c9('0x1b')]=function(_0x942832){var _0x569977=this;return new Promise(function(_0x9e09c4,_0x15efd6){return db['FreshsalesAccount'][_0x94c9('0x1c')]({'raw':_0x942832[_0x94c9('0x15')]?_0x942832[_0x94c9('0x15')][_0x94c9('0x1d')]===undefined?!![]:![]:!![],'where':_0x942832[_0x94c9('0x15')]?_0x942832[_0x94c9('0x15')][_0x94c9('0x1e')]||null:null,'attributes':_0x942832['options']?_0x942832[_0x94c9('0x15')][_0x94c9('0x16')]||null:null,'include':_0x942832[_0x94c9('0x15')]?_0x942832[_0x94c9('0x15')]['include']?_[_0x94c9('0x19')](_0x942832[_0x94c9('0x15')]['include'],function(_0x122a62){return{'model':db[_0x122a62[_0x94c9('0x1a')]],'as':_0x122a62['as'],'attributes':_0x122a62[_0x94c9('0x16')],'include':_0x122a62['include']?_[_0x94c9('0x19')](_0x122a62[_0x94c9('0x18')],function(_0x54a5ce){return{'model':db[_0x54a5ce[_0x94c9('0x1a')]],'as':_0x54a5ce['as'],'attributes':_0x54a5ce['attributes'],'include':_0x54a5ce['include']?_[_0x94c9('0x19')](_0x54a5ce['include'],function(_0x353e0f){return{'model':db[_0x353e0f[_0x94c9('0x1a')]],'as':_0x353e0f['as'],'attributes':_0x353e0f[_0x94c9('0x16')]};}):[]};}):[]};}):[]:[]})[_0x94c9('0x8')](function(_0x2a2db3){logger[_0x94c9('0x9')]('ShowFreshsalesAccount',_0x942832);logger[_0x94c9('0xc')](_0x94c9('0x1b'),_0x942832,JSON[_0x94c9('0xd')](_0x2a2db3));_0x9e09c4(_0x2a2db3);})[_0x94c9('0x1f')](function(_0x56e8e9){logger[_0x94c9('0xe')](_0x94c9('0x1b'),_0x56e8e9[_0x94c9('0x10')],_0x942832);_0x15efd6(_0x569977[_0x94c9('0xe')](0x1f4,_0x56e8e9['message']));});});};
\ No newline at end of file
+var _0x8f25=['find','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshsalesAccount','findAll','options','raw','include','map','model','attributes','ShowFreshsalesAccount','FreshsalesAccount'];(function(_0x4ca485,_0xdd7c1d){var _0x31d7a8=function(_0xf2029){while(--_0xf2029){_0x4ca485['push'](_0x4ca485['shift']());}};_0x31d7a8(++_0xdd7c1d);}(_0x8f25,0x14b));var _0x58f2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x8f25[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x58f2('0x0'));var util=require(_0x58f2('0x1'));var moment=require(_0x58f2('0x2'));var BPromise=require(_0x58f2('0x3'));var rs=require(_0x58f2('0x4'));var fs=require('fs');var Redis=require(_0x58f2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x58f2('0x6'));var config=require(_0x58f2('0x7'));var jayson=require(_0x58f2('0x8'));var client=jayson['client'][_0x58f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f94f,_0x3d5efe,_0x107b61){return new BPromise(function(_0xf47f9,_0x1209e2){return client[_0x58f2('0xa')](_0x26f94f,_0x107b61)[_0x58f2('0xb')](function(_0x4b56c1){logger[_0x58f2('0xc')](_0x58f2('0xd'),_0x3d5efe,_0x58f2('0xe'));logger[_0x58f2('0xf')](_0x58f2('0x10'),_0x3d5efe,'request\x20sent',JSON[_0x58f2('0x11')](_0x4b56c1));if(_0x4b56c1[_0x58f2('0x12')]){if(_0x4b56c1[_0x58f2('0x12')]['code']===0x1f4){logger[_0x58f2('0x12')](_0x58f2('0xd'),_0x3d5efe,_0x4b56c1['error'][_0x58f2('0x13')]);return _0x1209e2(_0x4b56c1[_0x58f2('0x12')]['message']);}logger[_0x58f2('0x12')](_0x58f2('0xd'),_0x3d5efe,_0x4b56c1[_0x58f2('0x12')][_0x58f2('0x13')]);return _0xf47f9(_0x4b56c1[_0x58f2('0x12')][_0x58f2('0x13')]);}else{logger[_0x58f2('0xc')](_0x58f2('0xd'),_0x3d5efe,_0x58f2('0xe'));_0xf47f9(_0x4b56c1[_0x58f2('0x14')][_0x58f2('0x13')]);}})[_0x58f2('0x15')](function(_0x4af52c){logger[_0x58f2('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x3d5efe,_0x4af52c);_0x1209e2(_0x4af52c);});});}exports[_0x58f2('0x16')]=function(_0x1db4ad){var _0x4e66a4=this;return new Promise(function(_0x5f0b9c,_0x5e0393){return db['FreshsalesAccount'][_0x58f2('0x17')]({'raw':_0x1db4ad[_0x58f2('0x18')]?_0x1db4ad[_0x58f2('0x18')][_0x58f2('0x19')]===undefined?!![]:![]:!![],'where':_0x1db4ad[_0x58f2('0x18')]?_0x1db4ad[_0x58f2('0x18')]['where']||null:null,'attributes':_0x1db4ad[_0x58f2('0x18')]?_0x1db4ad[_0x58f2('0x18')]['attributes']||null:null,'limit':_0x1db4ad[_0x58f2('0x18')]?_0x1db4ad[_0x58f2('0x18')]['limit']||null:null,'include':_0x1db4ad[_0x58f2('0x18')]?_0x1db4ad[_0x58f2('0x18')][_0x58f2('0x1a')]?_[_0x58f2('0x1b')](_0x1db4ad[_0x58f2('0x18')][_0x58f2('0x1a')],function(_0x2e83cf){return{'model':db[_0x2e83cf[_0x58f2('0x1c')]],'as':_0x2e83cf['as'],'attributes':_0x2e83cf[_0x58f2('0x1d')],'include':_0x2e83cf[_0x58f2('0x1a')]?_[_0x58f2('0x1b')](_0x2e83cf[_0x58f2('0x1a')],function(_0x34a2e2){return{'model':db[_0x34a2e2[_0x58f2('0x1c')]],'as':_0x34a2e2['as'],'attributes':_0x34a2e2[_0x58f2('0x1d')],'include':_0x34a2e2[_0x58f2('0x1a')]?_['map'](_0x34a2e2[_0x58f2('0x1a')],function(_0x50c4c1){return{'model':db[_0x50c4c1[_0x58f2('0x1c')]],'as':_0x50c4c1['as'],'attributes':_0x50c4c1[_0x58f2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x58f2('0xb')](function(_0x55e50a){logger[_0x58f2('0xc')](_0x58f2('0x16'),_0x1db4ad);logger[_0x58f2('0xf')]('GetFreshsalesAccount',_0x1db4ad,JSON[_0x58f2('0x11')](_0x55e50a));_0x5f0b9c(_0x55e50a);})[_0x58f2('0x15')](function(_0x4b2b78){logger[_0x58f2('0x12')](_0x58f2('0x16'),_0x4b2b78[_0x58f2('0x13')],_0x1db4ad);_0x5e0393(_0x4e66a4[_0x58f2('0x12')](0x1f4,_0x4b2b78['message']));});});};exports[_0x58f2('0x1e')]=function(_0x492db5){var _0x2633f8=this;return new Promise(function(_0x128af8,_0x8f339d){return db[_0x58f2('0x1f')][_0x58f2('0x20')]({'raw':_0x492db5[_0x58f2('0x18')]?_0x492db5['options'][_0x58f2('0x19')]===undefined?!![]:![]:!![],'where':_0x492db5[_0x58f2('0x18')]?_0x492db5[_0x58f2('0x18')]['where']||null:null,'attributes':_0x492db5[_0x58f2('0x18')]?_0x492db5[_0x58f2('0x18')]['attributes']||null:null,'include':_0x492db5[_0x58f2('0x18')]?_0x492db5[_0x58f2('0x18')][_0x58f2('0x1a')]?_[_0x58f2('0x1b')](_0x492db5[_0x58f2('0x18')]['include'],function(_0x2cd36a){return{'model':db[_0x2cd36a[_0x58f2('0x1c')]],'as':_0x2cd36a['as'],'attributes':_0x2cd36a[_0x58f2('0x1d')],'include':_0x2cd36a[_0x58f2('0x1a')]?_[_0x58f2('0x1b')](_0x2cd36a[_0x58f2('0x1a')],function(_0x3bede5){return{'model':db[_0x3bede5['model']],'as':_0x3bede5['as'],'attributes':_0x3bede5['attributes'],'include':_0x3bede5[_0x58f2('0x1a')]?_[_0x58f2('0x1b')](_0x3bede5[_0x58f2('0x1a')],function(_0x91f87c){return{'model':db[_0x91f87c['model']],'as':_0x91f87c['as'],'attributes':_0x91f87c[_0x58f2('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x595078){logger[_0x58f2('0xc')](_0x58f2('0x1e'),_0x492db5);logger['debug'](_0x58f2('0x1e'),_0x492db5,JSON[_0x58f2('0x11')](_0x595078));_0x128af8(_0x595078);})[_0x58f2('0x15')](function(_0x2a3120){logger[_0x58f2('0x12')](_0x58f2('0x1e'),_0x2a3120[_0x58f2('0x13')],_0x492db5);_0x8f339d(_0x2633f8['error'](0x1f4,_0x2a3120[_0x58f2('0x13')]));});});};
\ No newline at end of file
index 7f58270..3b8be05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffb2=['getFields','post','create','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x479ebc,_0x3b20ac){var _0x3ee24e=function(_0x292bcd){while(--_0x292bcd){_0x479ebc['push'](_0x479ebc['shift']());}};_0x3ee24e(++_0x3b20ac);}(_0xffb2,0x7b));var _0x2ffb=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0xffb2[_0x3a8db5];return _0x2c03cd;};'use strict';var multer=require('multer');var util=require(_0x2ffb('0x0'));var path=require(_0x2ffb('0x1'));var timeout=require('connect-timeout');var express=require(_0x2ffb('0x2'));var router=express['Router']();var auth=require(_0x2ffb('0x3'));var interaction=require(_0x2ffb('0x4'));var config=require(_0x2ffb('0x5'));var controller=require(_0x2ffb('0x6'));router[_0x2ffb('0x7')]('/',auth[_0x2ffb('0x8')](),controller[_0x2ffb('0x9')]);router[_0x2ffb('0x7')](_0x2ffb('0xa'),auth[_0x2ffb('0x8')](),controller[_0x2ffb('0xb')]);router[_0x2ffb('0x7')](_0x2ffb('0xc'),auth[_0x2ffb('0x8')](),controller[_0x2ffb('0xd')]);router[_0x2ffb('0x7')](_0x2ffb('0xe'),auth[_0x2ffb('0x8')](),controller['getDescriptions']);router[_0x2ffb('0x7')]('/:id/fields',auth[_0x2ffb('0x8')](),controller[_0x2ffb('0xf')]);router[_0x2ffb('0x10')]('/',auth[_0x2ffb('0x8')](),controller[_0x2ffb('0x11')]);router[_0x2ffb('0x12')](_0x2ffb('0xa'),auth[_0x2ffb('0x8')](),controller[_0x2ffb('0x13')]);router[_0x2ffb('0x14')](_0x2ffb('0xa'),auth[_0x2ffb('0x8')](),controller[_0x2ffb('0x15')]);module[_0x2ffb('0x16')]=router;
\ No newline at end of file
+var _0x4ac1=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','create','put','update','delete','destroy'];(function(_0x835e03,_0x3ee527){var _0x23d63=function(_0x169ef9){while(--_0x169ef9){_0x835e03['push'](_0x835e03['shift']());}};_0x23d63(++_0x3ee527);}(_0x4ac1,0xf1));var _0x14ac=function(_0x51f9a6,_0x3bd1aa){_0x51f9a6=_0x51f9a6-0x0;var _0x59edae=_0x4ac1[_0x51f9a6];return _0x59edae;};'use strict';var multer=require(_0x14ac('0x0'));var util=require(_0x14ac('0x1'));var path=require(_0x14ac('0x2'));var timeout=require('connect-timeout');var express=require(_0x14ac('0x3'));var router=express[_0x14ac('0x4')]();var auth=require(_0x14ac('0x5'));var interaction=require(_0x14ac('0x6'));var config=require(_0x14ac('0x7'));var controller=require(_0x14ac('0x8'));router[_0x14ac('0x9')]('/',auth[_0x14ac('0xa')](),controller[_0x14ac('0xb')]);router[_0x14ac('0x9')](_0x14ac('0xc'),auth[_0x14ac('0xa')](),controller['show']);router[_0x14ac('0x9')](_0x14ac('0xd'),auth['isAuthenticated'](),controller[_0x14ac('0xe')]);router[_0x14ac('0x9')](_0x14ac('0xf'),auth[_0x14ac('0xa')](),controller['getDescriptions']);router[_0x14ac('0x9')](_0x14ac('0x10'),auth[_0x14ac('0xa')](),controller[_0x14ac('0x11')]);router['post']('/',auth[_0x14ac('0xa')](),controller[_0x14ac('0x12')]);router[_0x14ac('0x13')]('/:id',auth[_0x14ac('0xa')](),controller[_0x14ac('0x14')]);router[_0x14ac('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x14ac('0x16')]);module[_0x14ac('0x17')]=router;
\ No newline at end of file
index d6041c8..fa03174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9db4=['sequelize','exports','STRING'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x9db4,0x16b));var _0x49db=function(_0x1d8944,_0x4791c7){_0x1d8944=_0x1d8944-0x0;var _0x34c66f=_0x9db4[_0x1d8944];return _0x34c66f;};'use strict';var Sequelize=require(_0x49db('0x0'));module[_0x49db('0x1')]={'name':{'type':Sequelize[_0x49db('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6cd3=['sequelize','STRING'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0x6cd3,0x15c));var _0x36cd=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x6cd3[_0x2a0738];return _0x159679;};'use strict';var Sequelize=require(_0x36cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x36cd('0x1')]},'description':{'type':Sequelize[_0x36cd('0x1')]}};
\ No newline at end of file
index e39f161..36b7bce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9caf=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','sendStatus','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','rows','show','params','length','create','body','find','destroy','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9caf,0x1b6));var _0xf9ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9caf[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xf9ca('0x0'));var emlformat=require(_0xf9ca('0x1'));var rimraf=require(_0xf9ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf9ca('0x3'));var moment=require(_0xf9ca('0x4'));var BPromise=require(_0xf9ca('0x5'));var Mustache=require(_0xf9ca('0x6'));var util=require('util');var path=require(_0xf9ca('0x7'));var sox=require(_0xf9ca('0x8'));var csv=require(_0xf9ca('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf9ca('0xa'));var squel=require(_0xf9ca('0xb'));var crypto=require(_0xf9ca('0xc'));var jsforce=require(_0xf9ca('0xd'));var deskjs=require(_0xf9ca('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf9ca('0xf'));var Papa=require('papaparse');var Redis=require(_0xf9ca('0x10'));var authService=require(_0xf9ca('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9ca('0x12'));var logger=require(_0xf9ca('0x13'))('api');var utils=require(_0xf9ca('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xf9ca('0x15'));var client=jayson[_0xf9ca('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x18fe93,_0x4e74a1,_0x36de33){if(_0x36de33){var _0x37b914=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37b914[_0xf9ca('0x17')](_0x4e74a1)){return _0x18fe93;}else{throw new db[(_0xf9ca('0x18'))][(_0xf9ca('0x19'))](_0xf9ca('0x1a'));}}else{return _0x18fe93;}}function respondWithRpcPromise(_0x371671,_0x55116f,_0x25f500,_0x35be1c){return new BPromise(function(_0x104d38,_0x59f7d5){var _0x1cd2ab=_0x35be1c||client;return _0x1cd2ab[_0xf9ca('0x1b')](_0x371671,_0x25f500)[_0xf9ca('0x1c')](function(_0x2063a0){logger[_0xf9ca('0x1d')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x55116f,_0xf9ca('0x1e'));logger[_0xf9ca('0x1f')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x55116f,_0xf9ca('0x1e'),JSON['stringify'](_0x2063a0));if(_0x2063a0[_0xf9ca('0x20')]){if(_0x2063a0[_0xf9ca('0x20')][_0xf9ca('0x21')]===0x1f4){logger[_0xf9ca('0x20')](_0xf9ca('0x22'),_0x55116f,_0x2063a0[_0xf9ca('0x20')][_0xf9ca('0x23')]);return _0x59f7d5(_0x2063a0[_0xf9ca('0x20')]['message']);}logger[_0xf9ca('0x20')](_0xf9ca('0x22'),_0x55116f,_0x2063a0[_0xf9ca('0x20')][_0xf9ca('0x23')]);return _0x104d38(_0x2063a0[_0xf9ca('0x20')][_0xf9ca('0x23')]);}else{logger[_0xf9ca('0x1d')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x55116f,_0xf9ca('0x1e'));_0x104d38(_0x2063a0[_0xf9ca('0x24')][_0xf9ca('0x23')]);}})[_0xf9ca('0x25')](function(_0x4a315a){logger['error'](_0xf9ca('0x22'),_0x55116f,_0x4a315a);_0x59f7d5(_0x4a315a);});});}function respondWithStatusCode(_0x229bf4,_0x11a4ed){_0x11a4ed=_0x11a4ed||0xcc;return function(_0x583ba3){if(_0x583ba3){return _0x229bf4['sendStatus'](_0x11a4ed);}return _0x229bf4['status'](_0x11a4ed)[_0xf9ca('0x26')]();};}function respondWithResult(_0x29e1ff,_0x3b37e4){_0x3b37e4=_0x3b37e4||0xc8;return function(_0x4c9c2d){if(_0x4c9c2d){return _0x29e1ff[_0xf9ca('0x27')](_0x3b37e4)[_0xf9ca('0x28')](_0x4c9c2d);}};}function respondWithFilteredResult(_0x1bc2c3,_0x201539){return function(_0x116c98){if(_0x116c98){var _0x23f102=_0x116c98[_0xf9ca('0x29')],_0x37340e=_0x201539[_0xf9ca('0x2a')],_0x4a76a8=_0x201539[_0xf9ca('0x2a')]+_0x201539[_0xf9ca('0x2b')],_0x2c31e0;if(_0x4a76a8>=_0x23f102){_0x4a76a8=_0x23f102;_0x2c31e0=0xc8;}else{_0x2c31e0=0xce;}_0x1bc2c3[_0xf9ca('0x27')](_0x2c31e0);return _0x1bc2c3[_0xf9ca('0x2c')](_0xf9ca('0x2d'),_0x37340e+'-'+_0x4a76a8+'/'+_0x23f102)[_0xf9ca('0x28')](_0x116c98);}return null;};}function patchUpdates(_0x389eae){return function(_0x27426d){try{jsonpatch[_0xf9ca('0x2e')](_0x27426d,_0x389eae,!![]);}catch(_0x261a6c){return BPromise['reject'](_0x261a6c);}return _0x27426d[_0xf9ca('0x2f')]();};}function saveUpdates(_0x472cde,_0x53fdbe){return function(_0x5499ca){if(_0x5499ca){return _0x5499ca[_0xf9ca('0x30')](_0x472cde)[_0xf9ca('0x1c')](function(_0x4a241e){return _0x4a241e;});}return null;};}function removeEntity(_0x59c444,_0x12f2e8){return function(_0x14fc38){if(_0x14fc38){return _0x14fc38['destroy']()['then'](function(){_0x59c444['status'](0xcc)[_0xf9ca('0x26')]();});}};}function handleEntityNotFound(_0x5cc2d6,_0x124c59){return function(_0x3ab062){if(!_0x3ab062){_0x5cc2d6[_0xf9ca('0x31')](0x194);}return _0x3ab062;};}function handleError(_0xa5bf2a,_0x1069cb){_0x1069cb=_0x1069cb||0x1f4;return function(_0x2af370){logger['error'](_0x2af370[_0xf9ca('0x32')]);if(_0x2af370[_0xf9ca('0x33')]){delete _0x2af370['name'];}_0xa5bf2a['status'](_0x1069cb)['send'](_0x2af370);};}exports[_0xf9ca('0x34')]=function(_0x396a41,_0x4ddb5b){var _0x3335a7={},_0x55ad98={},_0x5ef6ac={'count':0x0,'rows':[]};var _0x4f4f20=_[_0xf9ca('0x35')](db[_0xf9ca('0x36')][_0xf9ca('0x37')],function(_0x41fb7e){return{'name':_0x41fb7e[_0xf9ca('0x38')],'type':_0x41fb7e[_0xf9ca('0x39')][_0xf9ca('0x3a')]};});_0x55ad98[_0xf9ca('0x3b')]=_['map'](_0x4f4f20,_0xf9ca('0x33'));_0x55ad98[_0xf9ca('0x3c')]=_[_0xf9ca('0x3d')](_0x396a41[_0xf9ca('0x3c')]);_0x55ad98[_0xf9ca('0x3e')]=_[_0xf9ca('0x3f')](_0x55ad98[_0xf9ca('0x3b')],_0x55ad98[_0xf9ca('0x3c')]);_0x3335a7[_0xf9ca('0x40')]=_[_0xf9ca('0x3f')](_0x55ad98['model'],qs[_0xf9ca('0x41')](_0x396a41[_0xf9ca('0x3c')][_0xf9ca('0x41')]));_0x3335a7[_0xf9ca('0x40')]=_0x3335a7[_0xf9ca('0x40')]['length']?_0x3335a7[_0xf9ca('0x40')]:_0x55ad98[_0xf9ca('0x3b')];if(!_0x396a41[_0xf9ca('0x3c')][_0xf9ca('0x42')](_0xf9ca('0x43'))){_0x3335a7[_0xf9ca('0x2b')]=qs['limit'](_0x396a41[_0xf9ca('0x3c')]['limit']);_0x3335a7[_0xf9ca('0x2a')]=qs[_0xf9ca('0x2a')](_0x396a41[_0xf9ca('0x3c')][_0xf9ca('0x2a')]);}_0x3335a7[_0xf9ca('0x44')]=qs[_0xf9ca('0x45')](_0x396a41['query'][_0xf9ca('0x45')]);_0x3335a7['where']=qs[_0xf9ca('0x3e')](_['pick'](_0x396a41['query'],_0x55ad98[_0xf9ca('0x3e')]),_0x4f4f20);if(_0x396a41['query'][_0xf9ca('0x46')]){_0x3335a7[_0xf9ca('0x47')]=_[_0xf9ca('0x48')](_0x3335a7['where'],{'$or':_['map'](_0x4f4f20,function(_0x10edc0){if(_0x10edc0['type']!=='VIRTUAL'){var _0x2484ca={};_0x2484ca[_0x10edc0[_0xf9ca('0x33')]]={'$like':'%'+_0x396a41[_0xf9ca('0x3c')][_0xf9ca('0x46')]+'%'};return _0x2484ca;}})});}_0x3335a7=_[_0xf9ca('0x48')]({},_0x3335a7,_0x396a41[_0xf9ca('0x49')]);var _0x4e587f={'where':_0x3335a7['where']};return db['FreshsalesConfiguration']['count'](_0x4e587f)[_0xf9ca('0x1c')](function(_0x3448c7){_0x5ef6ac['count']=_0x3448c7;if(_0x396a41[_0xf9ca('0x3c')][_0xf9ca('0x4a')]){_0x3335a7[_0xf9ca('0x4b')]=[{'all':!![]}];}return db[_0xf9ca('0x36')]['findAll'](_0x3335a7);})['then'](function(_0x550806){_0x5ef6ac[_0xf9ca('0x4c')]=_0x550806;return _0x5ef6ac;})[_0xf9ca('0x1c')](respondWithFilteredResult(_0x4ddb5b,_0x3335a7))[_0xf9ca('0x25')](handleError(_0x4ddb5b,null));};exports[_0xf9ca('0x4d')]=function(_0x2ba51c,_0x33e640){var _0x3ab08e={'raw':![],'where':{'id':_0x2ba51c[_0xf9ca('0x4e')]['id']}},_0x582eab={};_0x582eab[_0xf9ca('0x3b')]=_['keys'](db[_0xf9ca('0x36')][_0xf9ca('0x37')]);_0x582eab[_0xf9ca('0x3c')]=_[_0xf9ca('0x3d')](_0x2ba51c[_0xf9ca('0x3c')]);_0x582eab[_0xf9ca('0x3e')]=_[_0xf9ca('0x3f')](_0x582eab['model'],_0x582eab[_0xf9ca('0x3c')]);_0x3ab08e[_0xf9ca('0x40')]=_['intersection'](_0x582eab['model'],qs[_0xf9ca('0x41')](_0x2ba51c['query'][_0xf9ca('0x41')]));_0x3ab08e[_0xf9ca('0x40')]=_0x3ab08e[_0xf9ca('0x40')][_0xf9ca('0x4f')]?_0x3ab08e[_0xf9ca('0x40')]:_0x582eab[_0xf9ca('0x3b')];if(_0x2ba51c['query'][_0xf9ca('0x4a')]){_0x3ab08e[_0xf9ca('0x4b')]=[{'all':!![]}];}_0x3ab08e=_[_0xf9ca('0x48')]({},_0x3ab08e,_0x2ba51c[_0xf9ca('0x49')]);return db['FreshsalesConfiguration']['find'](_0x3ab08e)[_0xf9ca('0x1c')](handleEntityNotFound(_0x33e640,null))[_0xf9ca('0x1c')](respondWithResult(_0x33e640,null))['catch'](handleError(_0x33e640,null));};exports[_0xf9ca('0x50')]=function(_0x3e3355,_0x1cd9cf){return db[_0xf9ca('0x36')][_0xf9ca('0x50')](_0x3e3355[_0xf9ca('0x51')],{})[_0xf9ca('0x1c')](respondWithResult(_0x1cd9cf,0xc9))[_0xf9ca('0x25')](handleError(_0x1cd9cf,null));};exports[_0xf9ca('0x30')]=function(_0x186087,_0x4e6a3b){if(_0x186087[_0xf9ca('0x51')]['id']){delete _0x186087['body']['id'];}return db[_0xf9ca('0x36')][_0xf9ca('0x52')]({'where':{'id':_0x186087[_0xf9ca('0x4e')]['id']}})[_0xf9ca('0x1c')](handleEntityNotFound(_0x4e6a3b,null))['then'](saveUpdates(_0x186087[_0xf9ca('0x51')],null))[_0xf9ca('0x1c')](respondWithResult(_0x4e6a3b,null))[_0xf9ca('0x25')](handleError(_0x4e6a3b,null));};exports[_0xf9ca('0x53')]=function(_0x5e5d08,_0x9cdc8){return db[_0xf9ca('0x36')]['find']({'where':{'id':_0x5e5d08['params']['id']}})['then'](handleEntityNotFound(_0x9cdc8,null))[_0xf9ca('0x1c')](removeEntity(_0x9cdc8,null))['catch'](handleError(_0x9cdc8,null));};exports[_0xf9ca('0x54')]=function(_0x1e9406,_0x3a9b78,_0x419b9c){var _0x1109b3={};var _0x505fc4={};var _0xd8e8cb;var _0xda846c;return db[_0xf9ca('0x36')][_0xf9ca('0x55')]({'where':{'id':_0x1e9406[_0xf9ca('0x4e')]['id']}})[_0xf9ca('0x1c')](handleEntityNotFound(_0x3a9b78,null))[_0xf9ca('0x1c')](function(_0x466491){if(_0x466491){_0xd8e8cb=_0x466491;_0x505fc4[_0xf9ca('0x3b')]=_[_0xf9ca('0x3d')](db[_0xf9ca('0x56')][_0xf9ca('0x37')]);_0x505fc4[_0xf9ca('0x3c')]=_[_0xf9ca('0x3d')](_0x1e9406[_0xf9ca('0x3c')]);_0x505fc4[_0xf9ca('0x3e')]=_[_0xf9ca('0x3f')](_0x505fc4[_0xf9ca('0x3b')],_0x505fc4[_0xf9ca('0x3c')]);_0x1109b3[_0xf9ca('0x40')]=_['intersection'](_0x505fc4['model'],qs[_0xf9ca('0x41')](_0x1e9406[_0xf9ca('0x3c')]['fields']));_0x1109b3[_0xf9ca('0x40')]=_0x1109b3[_0xf9ca('0x40')][_0xf9ca('0x4f')]?_0x1109b3['attributes']:_0x505fc4[_0xf9ca('0x3b')];_0x1109b3['order']=qs[_0xf9ca('0x45')](_0x1e9406[_0xf9ca('0x3c')][_0xf9ca('0x45')]);_0x1109b3[_0xf9ca('0x47')]=qs[_0xf9ca('0x3e')](_[_0xf9ca('0x57')](_0x1e9406[_0xf9ca('0x3c')],_0x505fc4[_0xf9ca('0x3e')]));if(_0x1e9406[_0xf9ca('0x3c')][_0xf9ca('0x46')]){_0x1109b3['where']=_[_0xf9ca('0x48')](_0x1109b3[_0xf9ca('0x47')],{'$or':_[_0xf9ca('0x35')](_0x1109b3['attributes'],function(_0x52101e){var _0x36bb80={};_0x36bb80[_0x52101e]={'$like':'%'+_0x1e9406['query'][_0xf9ca('0x46')]+'%'};return _0x36bb80;})});}_0x1109b3=_[_0xf9ca('0x48')]({},_0x1109b3,_0x1e9406[_0xf9ca('0x49')]);return _0xd8e8cb[_0xf9ca('0x54')](_0x1109b3);}})[_0xf9ca('0x1c')](function(_0xe23de0){if(_0xe23de0){_0xda846c=_0xe23de0[_0xf9ca('0x4f')];if(!_0x1e9406[_0xf9ca('0x3c')][_0xf9ca('0x42')](_0xf9ca('0x43'))){_0x1109b3[_0xf9ca('0x2b')]=qs[_0xf9ca('0x2b')](_0x1e9406[_0xf9ca('0x3c')][_0xf9ca('0x2b')]);_0x1109b3[_0xf9ca('0x2a')]=qs[_0xf9ca('0x2a')](_0x1e9406['query'][_0xf9ca('0x2a')]);}return _0xd8e8cb[_0xf9ca('0x54')](_0x1109b3);}})[_0xf9ca('0x1c')](function(_0x5c1a84){if(_0x5c1a84){return _0x5c1a84?{'count':_0xda846c,'rows':_0x5c1a84}:null;}})[_0xf9ca('0x1c')](respondWithResult(_0x3a9b78,null))[_0xf9ca('0x25')](handleError(_0x3a9b78,null));};exports['getDescriptions']=function(_0x200d0c,_0x2531c3,_0x588690){var _0x455e6d={};var _0x2b61cc={};var _0x43b84a;var _0x387783;return db[_0xf9ca('0x36')]['findOne']({'where':{'id':_0x200d0c[_0xf9ca('0x4e')]['id']}})[_0xf9ca('0x1c')](handleEntityNotFound(_0x2531c3,null))[_0xf9ca('0x1c')](function(_0x443acb){if(_0x443acb){_0x43b84a=_0x443acb;_0x2b61cc['model']=_['keys'](db[_0xf9ca('0x56')][_0xf9ca('0x37')]);_0x2b61cc[_0xf9ca('0x3c')]=_[_0xf9ca('0x3d')](_0x200d0c[_0xf9ca('0x3c')]);_0x2b61cc[_0xf9ca('0x3e')]=_['intersection'](_0x2b61cc[_0xf9ca('0x3b')],_0x2b61cc[_0xf9ca('0x3c')]);_0x455e6d['attributes']=_['intersection'](_0x2b61cc[_0xf9ca('0x3b')],qs[_0xf9ca('0x41')](_0x200d0c[_0xf9ca('0x3c')][_0xf9ca('0x41')]));_0x455e6d[_0xf9ca('0x40')]=_0x455e6d['attributes']['length']?_0x455e6d[_0xf9ca('0x40')]:_0x2b61cc[_0xf9ca('0x3b')];_0x455e6d['order']=qs[_0xf9ca('0x45')](_0x200d0c['query']['sort']);_0x455e6d[_0xf9ca('0x47')]=qs[_0xf9ca('0x3e')](_['pick'](_0x200d0c[_0xf9ca('0x3c')],_0x2b61cc[_0xf9ca('0x3e')]));if(_0x200d0c['query'][_0xf9ca('0x46')]){_0x455e6d[_0xf9ca('0x47')]=_[_0xf9ca('0x48')](_0x455e6d[_0xf9ca('0x47')],{'$or':_['map'](_0x455e6d[_0xf9ca('0x40')],function(_0x1acd67){var _0x458ce8={};_0x458ce8[_0x1acd67]={'$like':'%'+_0x200d0c[_0xf9ca('0x3c')][_0xf9ca('0x46')]+'%'};return _0x458ce8;})});}_0x455e6d=_[_0xf9ca('0x48')]({},_0x455e6d,_0x200d0c[_0xf9ca('0x49')]);return _0x43b84a[_0xf9ca('0x58')](_0x455e6d);}})[_0xf9ca('0x1c')](function(_0x2c83f8){if(_0x2c83f8){_0x387783=_0x2c83f8[_0xf9ca('0x4f')];if(!_0x200d0c[_0xf9ca('0x3c')][_0xf9ca('0x42')](_0xf9ca('0x43'))){_0x455e6d[_0xf9ca('0x2b')]=qs[_0xf9ca('0x2b')](_0x200d0c[_0xf9ca('0x3c')]['limit']);_0x455e6d[_0xf9ca('0x2a')]=qs[_0xf9ca('0x2a')](_0x200d0c[_0xf9ca('0x3c')]['offset']);}return _0x43b84a[_0xf9ca('0x58')](_0x455e6d);}})['then'](function(_0x3ad7b9){if(_0x3ad7b9){return _0x3ad7b9?{'count':_0x387783,'rows':_0x3ad7b9}:null;}})[_0xf9ca('0x1c')](respondWithResult(_0x2531c3,null))[_0xf9ca('0x25')](handleError(_0x2531c3,null));};exports[_0xf9ca('0x59')]=function(_0x23ba2a,_0x1cd92f,_0x24a3db){var _0x4ab065={};var _0xa2ed41={};var _0x3ffd85;var _0x208cc6;return db['FreshsalesConfiguration'][_0xf9ca('0x55')]({'where':{'id':_0x23ba2a[_0xf9ca('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1cd92f,null))[_0xf9ca('0x1c')](function(_0x26ded4){if(_0x26ded4){_0x3ffd85=_0x26ded4;_0xa2ed41['model']=_[_0xf9ca('0x3d')](db['FreshsalesField']['rawAttributes']);_0xa2ed41['query']=_[_0xf9ca('0x3d')](_0x23ba2a['query']);_0xa2ed41[_0xf9ca('0x3e')]=_[_0xf9ca('0x3f')](_0xa2ed41['model'],_0xa2ed41[_0xf9ca('0x3c')]);_0x4ab065['attributes']=_[_0xf9ca('0x3f')](_0xa2ed41[_0xf9ca('0x3b')],qs[_0xf9ca('0x41')](_0x23ba2a[_0xf9ca('0x3c')]['fields']));_0x4ab065['attributes']=_0x4ab065['attributes'][_0xf9ca('0x4f')]?_0x4ab065[_0xf9ca('0x40')]:_0xa2ed41[_0xf9ca('0x3b')];_0x4ab065[_0xf9ca('0x44')]=qs[_0xf9ca('0x45')](_0x23ba2a[_0xf9ca('0x3c')][_0xf9ca('0x45')]);_0x4ab065[_0xf9ca('0x47')]=qs[_0xf9ca('0x3e')](_[_0xf9ca('0x57')](_0x23ba2a[_0xf9ca('0x3c')],_0xa2ed41[_0xf9ca('0x3e')]));if(_0x23ba2a['query'][_0xf9ca('0x46')]){_0x4ab065[_0xf9ca('0x47')]=_['merge'](_0x4ab065['where'],{'$or':_[_0xf9ca('0x35')](_0x4ab065[_0xf9ca('0x40')],function(_0x4b14a1){var _0x1071ea={};_0x1071ea[_0x4b14a1]={'$like':'%'+_0x23ba2a['query'][_0xf9ca('0x46')]+'%'};return _0x1071ea;})});}_0x4ab065=_[_0xf9ca('0x48')]({},_0x4ab065,_0x23ba2a[_0xf9ca('0x49')]);return _0x3ffd85[_0xf9ca('0x59')](_0x4ab065);}})['then'](function(_0xc3e12c){if(_0xc3e12c){_0x208cc6=_0xc3e12c[_0xf9ca('0x4f')];if(!_0x23ba2a[_0xf9ca('0x3c')][_0xf9ca('0x42')](_0xf9ca('0x43'))){_0x4ab065['limit']=qs[_0xf9ca('0x2b')](_0x23ba2a['query'][_0xf9ca('0x2b')]);_0x4ab065[_0xf9ca('0x2a')]=qs[_0xf9ca('0x2a')](_0x23ba2a[_0xf9ca('0x3c')][_0xf9ca('0x2a')]);}return _0x3ffd85['getFields'](_0x4ab065);}})[_0xf9ca('0x1c')](function(_0x38e4c0){if(_0x38e4c0){return _0x38e4c0?{'count':_0x208cc6,'rows':_0x38e4c0}:null;}})[_0xf9ca('0x1c')](respondWithResult(_0x1cd92f,null))[_0xf9ca('0x25')](handleError(_0x1cd92f,null));};
\ No newline at end of file
+var _0x04a4=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','VIRTUAL','options','include','findAll','rows','show','params','merge','create','body','find','getSubjects','findOne','FreshsalesField','order','nolimit','getDescriptions','getFields','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0x04a4,0x1bc));var _0x404a=function(_0xe934d0,_0x107c20){_0xe934d0=_0xe934d0-0x0;var _0x304707=_0x04a4[_0xe934d0];return _0x304707;};'use strict';var pdf=require(_0x404a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x404a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x404a('0x2'));var rp=require(_0x404a('0x3'));var moment=require(_0x404a('0x4'));var BPromise=require(_0x404a('0x5'));var Mustache=require('mustache');var util=require(_0x404a('0x6'));var path=require(_0x404a('0x7'));var sox=require(_0x404a('0x8'));var csv=require(_0x404a('0x9'));var ejs=require(_0x404a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x404a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x404a('0xc'));var toCsv=require(_0x404a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x404a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x404a('0xe'));var as=require(_0x404a('0xf'));var hardwareService=require(_0x404a('0x10'));var logger=require(_0x404a('0x11'))(_0x404a('0x12'));var utils=require(_0x404a('0x13'));var config=require(_0x404a('0x14'));var db=require(_0x404a('0x15'))['db'];var jayson=require(_0x404a('0x16'));var client=jayson[_0x404a('0x17')][_0x404a('0x18')]({'port':0x232a});function checkPasswordPattern(_0x38ddb3,_0x576797,_0x5d135){if(_0x5d135){var _0x412565=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x412565['test'](_0x576797)){return _0x38ddb3;}else{throw new db[(_0x404a('0x19'))]['ValidationError'](_0x404a('0x1a'));}}else{return _0x38ddb3;}}function respondWithRpcPromise(_0x143672,_0x476e90,_0xf13f0,_0x440b7e){return new BPromise(function(_0x484587,_0x21d322){var _0x9f7c72=_0x440b7e||client;return _0x9f7c72[_0x404a('0x1b')](_0x143672,_0xf13f0)[_0x404a('0x1c')](function(_0x124317){logger[_0x404a('0x1d')](_0x404a('0x1e'),_0x476e90,_0x404a('0x1f'));logger[_0x404a('0x20')](_0x404a('0x21'),_0x476e90,_0x404a('0x1f'),JSON[_0x404a('0x22')](_0x124317));if(_0x124317['error']){if(_0x124317[_0x404a('0x23')][_0x404a('0x24')]===0x1f4){logger[_0x404a('0x23')](_0x404a('0x1e'),_0x476e90,_0x124317[_0x404a('0x23')][_0x404a('0x25')]);return _0x21d322(_0x124317[_0x404a('0x23')][_0x404a('0x25')]);}logger[_0x404a('0x23')](_0x404a('0x1e'),_0x476e90,_0x124317[_0x404a('0x23')][_0x404a('0x25')]);return _0x484587(_0x124317[_0x404a('0x23')][_0x404a('0x25')]);}else{logger[_0x404a('0x1d')](_0x404a('0x1e'),_0x476e90,_0x404a('0x1f'));_0x484587(_0x124317[_0x404a('0x26')][_0x404a('0x25')]);}})[_0x404a('0x27')](function(_0x485e68){logger[_0x404a('0x23')](_0x404a('0x1e'),_0x476e90,_0x485e68);_0x21d322(_0x485e68);});});}function respondWithStatusCode(_0x582f34,_0x52e9da){_0x52e9da=_0x52e9da||0xcc;return function(_0x4b3cbd){if(_0x4b3cbd){return _0x582f34[_0x404a('0x28')](_0x52e9da);}return _0x582f34['status'](_0x52e9da)[_0x404a('0x29')]();};}function respondWithResult(_0x597fea,_0x25f719){_0x25f719=_0x25f719||0xc8;return function(_0x1ccf79){if(_0x1ccf79){return _0x597fea[_0x404a('0x2a')](_0x25f719)['json'](_0x1ccf79);}};}function respondWithFilteredResult(_0x3e97e0,_0x2eb6e6){return function(_0xe05f66){if(_0xe05f66){var _0x6bcb93=_0xe05f66[_0x404a('0x2b')],_0x4d7036=_0x2eb6e6['offset'],_0x434a21=_0x2eb6e6[_0x404a('0x2c')]+_0x2eb6e6[_0x404a('0x2d')],_0x4005bc;if(_0x434a21>=_0x6bcb93){_0x434a21=_0x6bcb93;_0x4005bc=0xc8;}else{_0x4005bc=0xce;}_0x3e97e0[_0x404a('0x2a')](_0x4005bc);return _0x3e97e0[_0x404a('0x2e')](_0x404a('0x2f'),_0x4d7036+'-'+_0x434a21+'/'+_0x6bcb93)[_0x404a('0x30')](_0xe05f66);}return null;};}function patchUpdates(_0x53c7d4){return function(_0x297d64){try{jsonpatch['apply'](_0x297d64,_0x53c7d4,!![]);}catch(_0x5a6b55){return BPromise[_0x404a('0x31')](_0x5a6b55);}return _0x297d64[_0x404a('0x32')]();};}function saveUpdates(_0x212b8b,_0x44a4f1){return function(_0x25f3ad){if(_0x25f3ad){return _0x25f3ad[_0x404a('0x33')](_0x212b8b)[_0x404a('0x1c')](function(_0x5247f4){return _0x5247f4;});}return null;};}function removeEntity(_0x5020a3,_0x991272){return function(_0x20e263){if(_0x20e263){return _0x20e263[_0x404a('0x34')]()[_0x404a('0x1c')](function(){_0x5020a3[_0x404a('0x2a')](0xcc)[_0x404a('0x29')]();});}};}function handleEntityNotFound(_0x115bde,_0x427a55){return function(_0x76dc9b){if(!_0x76dc9b){_0x115bde['sendStatus'](0x194);}return _0x76dc9b;};}function handleError(_0x455da4,_0x12a13f){_0x12a13f=_0x12a13f||0x1f4;return function(_0x364f22){logger[_0x404a('0x23')](_0x364f22[_0x404a('0x35')]);if(_0x364f22[_0x404a('0x36')]){delete _0x364f22[_0x404a('0x36')];}_0x455da4['status'](_0x12a13f)[_0x404a('0x37')](_0x364f22);};}exports[_0x404a('0x38')]=function(_0x314d94,_0x43ddac){var _0x3a2139={},_0x2e4f32={},_0x19f17b={'count':0x0,'rows':[]};var _0x4c1e47=_[_0x404a('0x39')](db[_0x404a('0x3a')][_0x404a('0x3b')],function(_0x10708c){return{'name':_0x10708c['fieldName'],'type':_0x10708c[_0x404a('0x3c')]['key']};});_0x2e4f32[_0x404a('0x3d')]=_[_0x404a('0x39')](_0x4c1e47,_0x404a('0x36'));_0x2e4f32[_0x404a('0x3e')]=_[_0x404a('0x3f')](_0x314d94[_0x404a('0x3e')]);_0x2e4f32['filters']=_[_0x404a('0x40')](_0x2e4f32[_0x404a('0x3d')],_0x2e4f32[_0x404a('0x3e')]);_0x3a2139[_0x404a('0x41')]=_['intersection'](_0x2e4f32['model'],qs[_0x404a('0x42')](_0x314d94[_0x404a('0x3e')][_0x404a('0x42')]));_0x3a2139[_0x404a('0x41')]=_0x3a2139[_0x404a('0x41')][_0x404a('0x43')]?_0x3a2139['attributes']:_0x2e4f32[_0x404a('0x3d')];if(!_0x314d94['query'][_0x404a('0x44')]('nolimit')){_0x3a2139[_0x404a('0x2d')]=qs[_0x404a('0x2d')](_0x314d94['query'][_0x404a('0x2d')]);_0x3a2139[_0x404a('0x2c')]=qs['offset'](_0x314d94[_0x404a('0x3e')]['offset']);}_0x3a2139['order']=qs[_0x404a('0x45')](_0x314d94[_0x404a('0x3e')][_0x404a('0x45')]);_0x3a2139[_0x404a('0x46')]=qs['filters'](_[_0x404a('0x47')](_0x314d94['query'],_0x2e4f32[_0x404a('0x48')]),_0x4c1e47);if(_0x314d94[_0x404a('0x3e')][_0x404a('0x49')]){_0x3a2139[_0x404a('0x46')]=_['merge'](_0x3a2139['where'],{'$or':_['map'](_0x4c1e47,function(_0x3bf4f5){if(_0x3bf4f5['type']!==_0x404a('0x4a')){var _0x3394b5={};_0x3394b5[_0x3bf4f5['name']]={'$like':'%'+_0x314d94[_0x404a('0x3e')][_0x404a('0x49')]+'%'};return _0x3394b5;}})});}_0x3a2139=_['merge']({},_0x3a2139,_0x314d94[_0x404a('0x4b')]);var _0x319858={'where':_0x3a2139[_0x404a('0x46')]};return db[_0x404a('0x3a')][_0x404a('0x2b')](_0x319858)[_0x404a('0x1c')](function(_0x5ca51a){_0x19f17b[_0x404a('0x2b')]=_0x5ca51a;if(_0x314d94[_0x404a('0x3e')]['includeAll']){_0x3a2139[_0x404a('0x4c')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x404a('0x4d')](_0x3a2139);})[_0x404a('0x1c')](function(_0x5cdf43){_0x19f17b[_0x404a('0x4e')]=_0x5cdf43;return _0x19f17b;})[_0x404a('0x1c')](respondWithFilteredResult(_0x43ddac,_0x3a2139))['catch'](handleError(_0x43ddac,null));};exports[_0x404a('0x4f')]=function(_0x18a24c,_0x4d77b7){var _0x14ab27={'raw':![],'where':{'id':_0x18a24c[_0x404a('0x50')]['id']}},_0x578d05={};_0x578d05['model']=_['keys'](db[_0x404a('0x3a')]['rawAttributes']);_0x578d05[_0x404a('0x3e')]=_['keys'](_0x18a24c[_0x404a('0x3e')]);_0x578d05[_0x404a('0x48')]=_[_0x404a('0x40')](_0x578d05[_0x404a('0x3d')],_0x578d05['query']);_0x14ab27[_0x404a('0x41')]=_[_0x404a('0x40')](_0x578d05[_0x404a('0x3d')],qs[_0x404a('0x42')](_0x18a24c[_0x404a('0x3e')][_0x404a('0x42')]));_0x14ab27[_0x404a('0x41')]=_0x14ab27[_0x404a('0x41')]['length']?_0x14ab27[_0x404a('0x41')]:_0x578d05[_0x404a('0x3d')];if(_0x18a24c['query']['includeAll']){_0x14ab27['include']=[{'all':!![]}];}_0x14ab27=_[_0x404a('0x51')]({},_0x14ab27,_0x18a24c[_0x404a('0x4b')]);return db[_0x404a('0x3a')]['find'](_0x14ab27)['then'](handleEntityNotFound(_0x4d77b7,null))[_0x404a('0x1c')](respondWithResult(_0x4d77b7,null))[_0x404a('0x27')](handleError(_0x4d77b7,null));};exports[_0x404a('0x52')]=function(_0x514087,_0x41c882){return db[_0x404a('0x3a')][_0x404a('0x52')](_0x514087[_0x404a('0x53')],{})[_0x404a('0x1c')](respondWithResult(_0x41c882,0xc9))[_0x404a('0x27')](handleError(_0x41c882,null));};exports['update']=function(_0x312ba7,_0x1e2b45){if(_0x312ba7[_0x404a('0x53')]['id']){delete _0x312ba7[_0x404a('0x53')]['id'];}return db[_0x404a('0x3a')][_0x404a('0x54')]({'where':{'id':_0x312ba7['params']['id']}})[_0x404a('0x1c')](handleEntityNotFound(_0x1e2b45,null))[_0x404a('0x1c')](saveUpdates(_0x312ba7['body'],null))[_0x404a('0x1c')](respondWithResult(_0x1e2b45,null))['catch'](handleError(_0x1e2b45,null));};exports[_0x404a('0x34')]=function(_0x570aa6,_0x4d1d29){return db['FreshsalesConfiguration'][_0x404a('0x54')]({'where':{'id':_0x570aa6[_0x404a('0x50')]['id']}})['then'](handleEntityNotFound(_0x4d1d29,null))[_0x404a('0x1c')](removeEntity(_0x4d1d29,null))[_0x404a('0x27')](handleError(_0x4d1d29,null));};exports[_0x404a('0x55')]=function(_0x540609,_0x70b737,_0x52d629){var _0x3f2ba1={};var _0x42ea4c={};var _0x332d0d;var _0x3958c3;return db['FreshsalesConfiguration'][_0x404a('0x56')]({'where':{'id':_0x540609[_0x404a('0x50')]['id']}})[_0x404a('0x1c')](handleEntityNotFound(_0x70b737,null))[_0x404a('0x1c')](function(_0x25323a){if(_0x25323a){_0x332d0d=_0x25323a;_0x42ea4c[_0x404a('0x3d')]=_[_0x404a('0x3f')](db[_0x404a('0x57')][_0x404a('0x3b')]);_0x42ea4c[_0x404a('0x3e')]=_[_0x404a('0x3f')](_0x540609['query']);_0x42ea4c['filters']=_[_0x404a('0x40')](_0x42ea4c[_0x404a('0x3d')],_0x42ea4c[_0x404a('0x3e')]);_0x3f2ba1['attributes']=_[_0x404a('0x40')](_0x42ea4c[_0x404a('0x3d')],qs['fields'](_0x540609[_0x404a('0x3e')]['fields']));_0x3f2ba1[_0x404a('0x41')]=_0x3f2ba1[_0x404a('0x41')][_0x404a('0x43')]?_0x3f2ba1[_0x404a('0x41')]:_0x42ea4c['model'];_0x3f2ba1[_0x404a('0x58')]=qs[_0x404a('0x45')](_0x540609[_0x404a('0x3e')][_0x404a('0x45')]);_0x3f2ba1[_0x404a('0x46')]=qs[_0x404a('0x48')](_[_0x404a('0x47')](_0x540609['query'],_0x42ea4c[_0x404a('0x48')]));if(_0x540609[_0x404a('0x3e')][_0x404a('0x49')]){_0x3f2ba1[_0x404a('0x46')]=_['merge'](_0x3f2ba1[_0x404a('0x46')],{'$or':_[_0x404a('0x39')](_0x3f2ba1[_0x404a('0x41')],function(_0x2b8428){var _0x23887e={};_0x23887e[_0x2b8428]={'$like':'%'+_0x540609[_0x404a('0x3e')]['filter']+'%'};return _0x23887e;})});}_0x3f2ba1=_[_0x404a('0x51')]({},_0x3f2ba1,_0x540609[_0x404a('0x4b')]);return _0x332d0d['getSubjects'](_0x3f2ba1);}})[_0x404a('0x1c')](function(_0x5aab21){if(_0x5aab21){_0x3958c3=_0x5aab21['length'];if(!_0x540609[_0x404a('0x3e')][_0x404a('0x44')]('nolimit')){_0x3f2ba1[_0x404a('0x2d')]=qs['limit'](_0x540609['query'][_0x404a('0x2d')]);_0x3f2ba1[_0x404a('0x2c')]=qs[_0x404a('0x2c')](_0x540609[_0x404a('0x3e')][_0x404a('0x2c')]);}return _0x332d0d[_0x404a('0x55')](_0x3f2ba1);}})[_0x404a('0x1c')](function(_0xb159fa){if(_0xb159fa){return _0xb159fa?{'count':_0x3958c3,'rows':_0xb159fa}:null;}})[_0x404a('0x1c')](respondWithResult(_0x70b737,null))[_0x404a('0x27')](handleError(_0x70b737,null));};exports['getDescriptions']=function(_0x4012ed,_0x1016f9,_0x39a963){var _0x132c70={};var _0x5466c9={};var _0xe099c4;var _0x3a2e14;return db[_0x404a('0x3a')][_0x404a('0x56')]({'where':{'id':_0x4012ed[_0x404a('0x50')]['id']}})[_0x404a('0x1c')](handleEntityNotFound(_0x1016f9,null))['then'](function(_0x103497){if(_0x103497){_0xe099c4=_0x103497;_0x5466c9[_0x404a('0x3d')]=_[_0x404a('0x3f')](db[_0x404a('0x57')]['rawAttributes']);_0x5466c9[_0x404a('0x3e')]=_[_0x404a('0x3f')](_0x4012ed['query']);_0x5466c9[_0x404a('0x48')]=_['intersection'](_0x5466c9[_0x404a('0x3d')],_0x5466c9[_0x404a('0x3e')]);_0x132c70[_0x404a('0x41')]=_['intersection'](_0x5466c9[_0x404a('0x3d')],qs[_0x404a('0x42')](_0x4012ed[_0x404a('0x3e')][_0x404a('0x42')]));_0x132c70[_0x404a('0x41')]=_0x132c70[_0x404a('0x41')][_0x404a('0x43')]?_0x132c70['attributes']:_0x5466c9['model'];_0x132c70[_0x404a('0x58')]=qs[_0x404a('0x45')](_0x4012ed[_0x404a('0x3e')]['sort']);_0x132c70[_0x404a('0x46')]=qs[_0x404a('0x48')](_[_0x404a('0x47')](_0x4012ed[_0x404a('0x3e')],_0x5466c9[_0x404a('0x48')]));if(_0x4012ed[_0x404a('0x3e')][_0x404a('0x49')]){_0x132c70['where']=_['merge'](_0x132c70[_0x404a('0x46')],{'$or':_[_0x404a('0x39')](_0x132c70[_0x404a('0x41')],function(_0x17a4d6){var _0x199a6a={};_0x199a6a[_0x17a4d6]={'$like':'%'+_0x4012ed['query'][_0x404a('0x49')]+'%'};return _0x199a6a;})});}_0x132c70=_['merge']({},_0x132c70,_0x4012ed[_0x404a('0x4b')]);return _0xe099c4['getDescriptions'](_0x132c70);}})[_0x404a('0x1c')](function(_0xfdc1d8){if(_0xfdc1d8){_0x3a2e14=_0xfdc1d8[_0x404a('0x43')];if(!_0x4012ed[_0x404a('0x3e')][_0x404a('0x44')](_0x404a('0x59'))){_0x132c70[_0x404a('0x2d')]=qs[_0x404a('0x2d')](_0x4012ed[_0x404a('0x3e')][_0x404a('0x2d')]);_0x132c70[_0x404a('0x2c')]=qs[_0x404a('0x2c')](_0x4012ed[_0x404a('0x3e')]['offset']);}return _0xe099c4[_0x404a('0x5a')](_0x132c70);}})[_0x404a('0x1c')](function(_0x30a7ff){if(_0x30a7ff){return _0x30a7ff?{'count':_0x3a2e14,'rows':_0x30a7ff}:null;}})[_0x404a('0x1c')](respondWithResult(_0x1016f9,null))[_0x404a('0x27')](handleError(_0x1016f9,null));};exports[_0x404a('0x5b')]=function(_0x6a7e16,_0x17eb8d,_0x2b39df){var _0x4c0101={};var _0x41fbef={};var _0x1a58f6;var _0x19afad;return db[_0x404a('0x3a')][_0x404a('0x56')]({'where':{'id':_0x6a7e16[_0x404a('0x50')]['id']}})[_0x404a('0x1c')](handleEntityNotFound(_0x17eb8d,null))['then'](function(_0x49f7fb){if(_0x49f7fb){_0x1a58f6=_0x49f7fb;_0x41fbef['model']=_[_0x404a('0x3f')](db[_0x404a('0x57')][_0x404a('0x3b')]);_0x41fbef['query']=_['keys'](_0x6a7e16[_0x404a('0x3e')]);_0x41fbef['filters']=_[_0x404a('0x40')](_0x41fbef[_0x404a('0x3d')],_0x41fbef[_0x404a('0x3e')]);_0x4c0101['attributes']=_[_0x404a('0x40')](_0x41fbef['model'],qs[_0x404a('0x42')](_0x6a7e16['query'][_0x404a('0x42')]));_0x4c0101[_0x404a('0x41')]=_0x4c0101[_0x404a('0x41')]['length']?_0x4c0101[_0x404a('0x41')]:_0x41fbef[_0x404a('0x3d')];_0x4c0101[_0x404a('0x58')]=qs['sort'](_0x6a7e16[_0x404a('0x3e')][_0x404a('0x45')]);_0x4c0101['where']=qs['filters'](_[_0x404a('0x47')](_0x6a7e16[_0x404a('0x3e')],_0x41fbef[_0x404a('0x48')]));if(_0x6a7e16[_0x404a('0x3e')][_0x404a('0x49')]){_0x4c0101[_0x404a('0x46')]=_['merge'](_0x4c0101[_0x404a('0x46')],{'$or':_[_0x404a('0x39')](_0x4c0101[_0x404a('0x41')],function(_0x1124de){var _0x3242f0={};_0x3242f0[_0x1124de]={'$like':'%'+_0x6a7e16['query'][_0x404a('0x49')]+'%'};return _0x3242f0;})});}_0x4c0101=_[_0x404a('0x51')]({},_0x4c0101,_0x6a7e16[_0x404a('0x4b')]);return _0x1a58f6[_0x404a('0x5b')](_0x4c0101);}})['then'](function(_0x3e8f69){if(_0x3e8f69){_0x19afad=_0x3e8f69['length'];if(!_0x6a7e16['query'][_0x404a('0x44')](_0x404a('0x59'))){_0x4c0101[_0x404a('0x2d')]=qs[_0x404a('0x2d')](_0x6a7e16[_0x404a('0x3e')][_0x404a('0x2d')]);_0x4c0101[_0x404a('0x2c')]=qs[_0x404a('0x2c')](_0x6a7e16['query'][_0x404a('0x2c')]);}return _0x1a58f6[_0x404a('0x5b')](_0x4c0101);}})['then'](function(_0x14de6b){if(_0x14de6b){return _0x14de6b?{'count':_0x19afad,'rows':_0x14de6b}:null;}})['then'](respondWithResult(_0x17eb8d,null))[_0x404a('0x27')](handleError(_0x17eb8d,null));};
\ No newline at end of file
index 6c4bba5..de9706d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3db=['../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x523798,_0x35e2c1){var _0x45bdd8=function(_0x42f6c8){while(--_0x42f6c8){_0x523798['push'](_0x523798['shift']());}};_0x45bdd8(++_0x35e2c1);}(_0xe3db,0xc8));var _0xbe3d=function(_0x30a613,_0x5698fa){_0x30a613=_0x30a613-0x0;var _0x19cb8b=_0xe3db[_0x30a613];return _0x19cb8b;};'use strict';var _=require(_0xbe3d('0x0'));var util=require(_0xbe3d('0x1'));var logger=require('../../config/logger')(_0xbe3d('0x2'));var moment=require(_0xbe3d('0x3'));var BPromise=require(_0xbe3d('0x4'));var rp=require(_0xbe3d('0x5'));var fs=require('fs');var path=require(_0xbe3d('0x6'));var rimraf=require(_0xbe3d('0x7'));var config=require(_0xbe3d('0x8'));var attributes=require(_0xbe3d('0x9'));module[_0xbe3d('0xa')]=function(_0xd5a81,_0x2b4c19){return _0xd5a81['define'](_0xbe3d('0xb'),attributes,{'tableName':_0xbe3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b46=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations'];(function(_0x17f80f,_0x15e0c7){var _0x2ddd72=function(_0xcf477d){while(--_0xcf477d){_0x17f80f['push'](_0x17f80f['shift']());}};_0x2ddd72(++_0x15e0c7);}(_0x3b46,0x1a2));var _0x63b4=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x3b46[_0x5959c9];return _0x4ffcbc;};'use strict';var _=require(_0x63b4('0x0'));var util=require(_0x63b4('0x1'));var logger=require(_0x63b4('0x2'))(_0x63b4('0x3'));var moment=require('moment');var BPromise=require(_0x63b4('0x4'));var rp=require(_0x63b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63b4('0x6'));var config=require(_0x63b4('0x7'));var attributes=require(_0x63b4('0x8'));module[_0x63b4('0x9')]=function(_0xeab6e8,_0x3a7607){return _0xeab6e8['define']('FreshsalesConfiguration',attributes,{'tableName':_0x63b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5bbde22..7d9eafc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5867=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x1de43c,_0xaa29de){var _0x296d3e=function(_0x50b76f){while(--_0x50b76f){_0x1de43c['push'](_0x1de43c['shift']());}};_0x296d3e(++_0xaa29de);}(_0x5867,0x1e2));var _0x7586=function(_0x3dbf0a,_0x54530a){_0x3dbf0a=_0x3dbf0a-0x0;var _0x4ec977=_0x5867[_0x3dbf0a];return _0x4ec977;};'use strict';var _=require(_0x7586('0x0'));var util=require(_0x7586('0x1'));var moment=require(_0x7586('0x2'));var BPromise=require(_0x7586('0x3'));var rs=require(_0x7586('0x4'));var fs=require('fs');var Redis=require(_0x7586('0x5'));var db=require(_0x7586('0x6'))['db'];var utils=require(_0x7586('0x7'));var logger=require(_0x7586('0x8'))('rpc');var config=require(_0x7586('0x9'));var jayson=require(_0x7586('0xa'));var client=jayson[_0x7586('0xb')][_0x7586('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54a035,_0x36f2ce,_0x28da7d){return new BPromise(function(_0x12c3ed,_0x516079){return client[_0x7586('0xd')](_0x54a035,_0x28da7d)['then'](function(_0x57449d){logger['info'](_0x7586('0xe'),_0x36f2ce,_0x7586('0xf'));logger[_0x7586('0x10')](_0x7586('0x11'),_0x36f2ce,_0x7586('0xf'),JSON['stringify'](_0x57449d));if(_0x57449d[_0x7586('0x12')]){if(_0x57449d['error'][_0x7586('0x13')]===0x1f4){logger[_0x7586('0x12')](_0x7586('0xe'),_0x36f2ce,_0x57449d[_0x7586('0x12')][_0x7586('0x14')]);return _0x516079(_0x57449d[_0x7586('0x12')][_0x7586('0x14')]);}logger[_0x7586('0x12')](_0x7586('0xe'),_0x36f2ce,_0x57449d[_0x7586('0x12')][_0x7586('0x14')]);return _0x12c3ed(_0x57449d['error'][_0x7586('0x14')]);}else{logger[_0x7586('0x15')](_0x7586('0xe'),_0x36f2ce,_0x7586('0xf'));_0x12c3ed(_0x57449d[_0x7586('0x16')][_0x7586('0x14')]);}})[_0x7586('0x17')](function(_0x5b7e81){logger[_0x7586('0x12')](_0x7586('0xe'),_0x36f2ce,_0x5b7e81);_0x516079(_0x5b7e81);});});}
\ No newline at end of file
+var _0x5c00=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5c00,0x17e));var _0x05c0=function(_0x24ae93,_0x364bd5){_0x24ae93=_0x24ae93-0x0;var _0x2fc1f3=_0x5c00[_0x24ae93];return _0x2fc1f3;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});}
\ No newline at end of file
index 751a30e..a162e22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe757=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer'];(function(_0x30b6bf,_0xc8217b){var _0x1554ae=function(_0xb5936d){while(--_0xb5936d){_0x30b6bf['push'](_0x30b6bf['shift']());}};_0x1554ae(++_0xc8217b);}(_0xe757,0xe9));var _0x7e75=function(_0x3fd203,_0x2f78ab){_0x3fd203=_0x3fd203-0x0;var _0x5e6d58=_0xe757[_0x3fd203];return _0x5e6d58;};'use strict';var multer=require(_0x7e75('0x0'));var util=require(_0x7e75('0x1'));var path=require('path');var timeout=require(_0x7e75('0x2'));var express=require(_0x7e75('0x3'));var router=express[_0x7e75('0x4')]();var auth=require(_0x7e75('0x5'));var interaction=require(_0x7e75('0x6'));var config=require(_0x7e75('0x7'));var controller=require(_0x7e75('0x8'));router[_0x7e75('0x9')]('/',auth[_0x7e75('0xa')](),controller['index']);router[_0x7e75('0x9')](_0x7e75('0xb'),auth['isAuthenticated'](),controller[_0x7e75('0xc')]);router[_0x7e75('0xd')]('/',auth['isAuthenticated'](),controller[_0x7e75('0xe')]);router[_0x7e75('0xf')](_0x7e75('0xb'),auth['isAuthenticated'](),controller[_0x7e75('0x10')]);router[_0x7e75('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3f90=['show','post','create','put','update','delete','exports','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id'];(function(_0x354016,_0x318b0e){var _0x5ded38=function(_0xb55790){while(--_0xb55790){_0x354016['push'](_0x354016['shift']());}};_0x5ded38(++_0x318b0e);}(_0x3f90,0xb7));var _0x03f9=function(_0xc4555f,_0x3f45a2){_0xc4555f=_0xc4555f-0x0;var _0x2121ab=_0x3f90[_0xc4555f];return _0x2121ab;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x03f9('0x0'));var express=require(_0x03f9('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x03f9('0x2'));var config=require(_0x03f9('0x3'));var controller=require(_0x03f9('0x4'));router[_0x03f9('0x5')]('/',auth[_0x03f9('0x6')](),controller[_0x03f9('0x7')]);router[_0x03f9('0x5')](_0x03f9('0x8'),auth[_0x03f9('0x6')](),controller[_0x03f9('0x9')]);router[_0x03f9('0xa')]('/',auth['isAuthenticated'](),controller[_0x03f9('0xb')]);router[_0x03f9('0xc')](_0x03f9('0x8'),auth[_0x03f9('0x6')](),controller[_0x03f9('0xd')]);router[_0x03f9('0xe')](_0x03f9('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x03f9('0xf')]=router;
\ No newline at end of file
index 3e1728f..8b2114b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d56=['sequelize','exports','customVariable','keyValue','string','STRING','ENUM','variable','BOOLEAN'];(function(_0x178fd6,_0xe8e26b){var _0x5b1302=function(_0x5a5028){while(--_0x5a5028){_0x178fd6['push'](_0x178fd6['shift']());}};_0x5b1302(++_0xe8e26b);}(_0x7d56,0x156));var _0x67d5=function(_0x3b3bec,_0x1cac7b){_0x3b3bec=_0x3b3bec-0x0;var _0x594af2=_0x7d56[_0x3b3bec];return _0x594af2;};'use strict';var Sequelize=require(_0x67d5('0x0'));module[_0x67d5('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x67d5('0x2'),_0x67d5('0x3')),'defaultValue':_0x67d5('0x4')},'content':{'type':Sequelize[_0x67d5('0x5')]},'key':{'type':Sequelize[_0x67d5('0x5')]},'keyType':{'type':Sequelize[_0x67d5('0x6')](_0x67d5('0x4'),_0x67d5('0x7'),_0x67d5('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x67d5('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x67d5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9a47=['customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9a47,0x14c));var _0x79a4=function(_0x10736f,_0x33c07a){_0x10736f=_0x10736f-0x0;var _0x16fa36=_0x9a47[_0x10736f];return _0x16fa36;};'use strict';var Sequelize=require(_0x79a4('0x0'));module['exports']={'type':{'type':Sequelize[_0x79a4('0x1')](_0x79a4('0x2'),_0x79a4('0x3'),_0x79a4('0x4'),_0x79a4('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x79a4('0x6')]},'key':{'type':Sequelize[_0x79a4('0x6')]},'keyType':{'type':Sequelize[_0x79a4('0x1')](_0x79a4('0x2'),_0x79a4('0x3'),_0x79a4('0x4'))},'keyContent':{'type':Sequelize[_0x79a4('0x6')]},'idField':{'type':Sequelize[_0x79a4('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x79a4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x79a4('0x6')]}};
\ No newline at end of file
index 9d4a788..5cbff2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d45=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','params','length','includeAll','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x1d45,0xec));var _0x51d4=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x1d45[_0x4792c8];return _0x35edb1;};'use strict';var pdf=require(_0x51d4('0x0'));var emlformat=require(_0x51d4('0x1'));var rimraf=require(_0x51d4('0x2'));var zipdir=require(_0x51d4('0x3'));var jsonpatch=require(_0x51d4('0x4'));var rp=require(_0x51d4('0x5'));var moment=require(_0x51d4('0x6'));var BPromise=require(_0x51d4('0x7'));var Mustache=require(_0x51d4('0x8'));var util=require(_0x51d4('0x9'));var path=require(_0x51d4('0xa'));var sox=require(_0x51d4('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x51d4('0xc'));var squel=require('squel');var crypto=require(_0x51d4('0xd'));var jsforce=require(_0x51d4('0xe'));var deskjs=require(_0x51d4('0xf'));var toCsv=require(_0x51d4('0x10'));var querystring=require(_0x51d4('0x11'));var Papa=require(_0x51d4('0x12'));var Redis=require('ioredis');var authService=require(_0x51d4('0x13'));var qs=require(_0x51d4('0x14'));var as=require(_0x51d4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51d4('0x16'))(_0x51d4('0x17'));var utils=require(_0x51d4('0x18'));var config=require(_0x51d4('0x19'));var db=require(_0x51d4('0x1a'))['db'];function respondWithStatusCode(_0x140fa2,_0x3ecb26){_0x3ecb26=_0x3ecb26||0xcc;return function(_0x110308){if(_0x110308){return _0x140fa2[_0x51d4('0x1b')](_0x3ecb26);}return _0x140fa2[_0x51d4('0x1c')](_0x3ecb26)['end']();};}function respondWithResult(_0x7675b,_0x2fb3b1){_0x2fb3b1=_0x2fb3b1||0xc8;return function(_0x4e1c79){if(_0x4e1c79){return _0x7675b[_0x51d4('0x1c')](_0x2fb3b1)[_0x51d4('0x1d')](_0x4e1c79);}};}function respondWithFilteredResult(_0x3d0933,_0x3e42f0){return function(_0x58602b){if(_0x58602b){var _0x4add04=_0x58602b[_0x51d4('0x1e')],_0x521a42=_0x3e42f0['offset'],_0x2bca2f=_0x3e42f0[_0x51d4('0x1f')]+_0x3e42f0[_0x51d4('0x20')],_0x52b554;if(_0x2bca2f>=_0x4add04){_0x2bca2f=_0x4add04;_0x52b554=0xc8;}else{_0x52b554=0xce;}_0x3d0933['status'](_0x52b554);return _0x3d0933[_0x51d4('0x21')](_0x51d4('0x22'),_0x521a42+'-'+_0x2bca2f+'/'+_0x4add04)[_0x51d4('0x1d')](_0x58602b);}return null;};}function patchUpdates(_0x4730c9){return function(_0x22c343){try{jsonpatch[_0x51d4('0x23')](_0x22c343,_0x4730c9,!![]);}catch(_0x5f4cc8){return BPromise[_0x51d4('0x24')](_0x5f4cc8);}return _0x22c343[_0x51d4('0x25')]();};}function saveUpdates(_0x5b3bf8,_0x80d913){return function(_0xaa3662){if(_0xaa3662){return _0xaa3662[_0x51d4('0x26')](_0x5b3bf8)[_0x51d4('0x27')](function(_0x1ec2e0){return _0x1ec2e0;});}return null;};}function removeEntity(_0x54556b,_0x27cb76){return function(_0x120976){if(_0x120976){return _0x120976[_0x51d4('0x28')]()[_0x51d4('0x27')](function(){_0x54556b[_0x51d4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35869a,_0x302e5d){return function(_0x24f2a9){if(!_0x24f2a9){_0x35869a[_0x51d4('0x1b')](0x194);}return _0x24f2a9;};}function handleError(_0x2ee2ca,_0x49fa8a){_0x49fa8a=_0x49fa8a||0x1f4;return function(_0x3ebac6){logger[_0x51d4('0x29')](_0x3ebac6[_0x51d4('0x2a')]);if(_0x3ebac6[_0x51d4('0x2b')]){delete _0x3ebac6[_0x51d4('0x2b')];}_0x2ee2ca[_0x51d4('0x1c')](_0x49fa8a)[_0x51d4('0x2c')](_0x3ebac6);};}exports[_0x51d4('0x2d')]=function(_0x1df2c8,_0x142589){var _0x2894bf={},_0x2e7a48={},_0x577e27={'count':0x0,'rows':[]};var _0x124079=_[_0x51d4('0x2e')](db[_0x51d4('0x2f')][_0x51d4('0x30')],function(_0x3120f3){return{'name':_0x3120f3[_0x51d4('0x31')],'type':_0x3120f3[_0x51d4('0x32')][_0x51d4('0x33')]};});_0x2e7a48['model']=_[_0x51d4('0x2e')](_0x124079,_0x51d4('0x2b'));_0x2e7a48[_0x51d4('0x34')]=_[_0x51d4('0x35')](_0x1df2c8[_0x51d4('0x34')]);_0x2e7a48[_0x51d4('0x36')]=_[_0x51d4('0x37')](_0x2e7a48[_0x51d4('0x38')],_0x2e7a48[_0x51d4('0x34')]);_0x2894bf[_0x51d4('0x39')]=_['intersection'](_0x2e7a48['model'],qs[_0x51d4('0x3a')](_0x1df2c8[_0x51d4('0x34')][_0x51d4('0x3a')]));_0x2894bf[_0x51d4('0x39')]=_0x2894bf['attributes']['length']?_0x2894bf['attributes']:_0x2e7a48[_0x51d4('0x38')];if(!_0x1df2c8['query'][_0x51d4('0x3b')](_0x51d4('0x3c'))){_0x2894bf[_0x51d4('0x20')]=qs[_0x51d4('0x20')](_0x1df2c8['query'][_0x51d4('0x20')]);_0x2894bf[_0x51d4('0x1f')]=qs[_0x51d4('0x1f')](_0x1df2c8[_0x51d4('0x34')][_0x51d4('0x1f')]);}_0x2894bf[_0x51d4('0x3d')]=qs[_0x51d4('0x3e')](_0x1df2c8[_0x51d4('0x34')][_0x51d4('0x3e')]);_0x2894bf['where']=qs[_0x51d4('0x36')](_[_0x51d4('0x3f')](_0x1df2c8[_0x51d4('0x34')],_0x2e7a48[_0x51d4('0x36')]),_0x124079);if(_0x1df2c8[_0x51d4('0x34')][_0x51d4('0x40')]){_0x2894bf['where']=_['merge'](_0x2894bf[_0x51d4('0x41')],{'$or':_[_0x51d4('0x2e')](_0x124079,function(_0xc47db9){if(_0xc47db9['type']!==_0x51d4('0x42')){var _0x31b092={};_0x31b092[_0xc47db9[_0x51d4('0x2b')]]={'$like':'%'+_0x1df2c8['query'][_0x51d4('0x40')]+'%'};return _0x31b092;}})});}_0x2894bf=_[_0x51d4('0x43')]({},_0x2894bf,_0x1df2c8[_0x51d4('0x44')]);var _0x5babbc={'where':_0x2894bf[_0x51d4('0x41')]};return db[_0x51d4('0x2f')][_0x51d4('0x1e')](_0x5babbc)[_0x51d4('0x27')](function(_0x2eaa4d){_0x577e27[_0x51d4('0x1e')]=_0x2eaa4d;if(_0x1df2c8[_0x51d4('0x34')]['includeAll']){_0x2894bf[_0x51d4('0x45')]=[{'all':!![]}];}return db[_0x51d4('0x2f')][_0x51d4('0x46')](_0x2894bf);})[_0x51d4('0x27')](function(_0x292c74){_0x577e27[_0x51d4('0x47')]=_0x292c74;return _0x577e27;})[_0x51d4('0x27')](respondWithFilteredResult(_0x142589,_0x2894bf))['catch'](handleError(_0x142589,null));};exports[_0x51d4('0x48')]=function(_0x33bb3e,_0x1a88ac){var _0x16d2d4={'raw':!![],'where':{'id':_0x33bb3e[_0x51d4('0x49')]['id']}},_0xfb643a={};_0xfb643a[_0x51d4('0x38')]=_[_0x51d4('0x35')](db[_0x51d4('0x2f')]['rawAttributes']);_0xfb643a['query']=_['keys'](_0x33bb3e[_0x51d4('0x34')]);_0xfb643a[_0x51d4('0x36')]=_[_0x51d4('0x37')](_0xfb643a[_0x51d4('0x38')],_0xfb643a['query']);_0x16d2d4[_0x51d4('0x39')]=_[_0x51d4('0x37')](_0xfb643a['model'],qs['fields'](_0x33bb3e[_0x51d4('0x34')][_0x51d4('0x3a')]));_0x16d2d4[_0x51d4('0x39')]=_0x16d2d4[_0x51d4('0x39')][_0x51d4('0x4a')]?_0x16d2d4[_0x51d4('0x39')]:_0xfb643a[_0x51d4('0x38')];if(_0x33bb3e['query'][_0x51d4('0x4b')]){_0x16d2d4[_0x51d4('0x45')]=[{'all':!![]}];}_0x16d2d4=_[_0x51d4('0x43')]({},_0x16d2d4,_0x33bb3e['options']);return db[_0x51d4('0x2f')][_0x51d4('0x4c')](_0x16d2d4)['then'](handleEntityNotFound(_0x1a88ac,null))['then'](respondWithResult(_0x1a88ac,null))[_0x51d4('0x4d')](handleError(_0x1a88ac,null));};exports[_0x51d4('0x4e')]=function(_0x2a65fb,_0x54e125){return db[_0x51d4('0x2f')][_0x51d4('0x4e')](_0x2a65fb[_0x51d4('0x4f')],{})[_0x51d4('0x27')](respondWithResult(_0x54e125,0xc9))[_0x51d4('0x4d')](handleError(_0x54e125,null));};exports[_0x51d4('0x26')]=function(_0x20df31,_0xaadbb1){if(_0x20df31[_0x51d4('0x4f')]['id']){delete _0x20df31[_0x51d4('0x4f')]['id'];}return db[_0x51d4('0x2f')][_0x51d4('0x4c')]({'where':{'id':_0x20df31[_0x51d4('0x49')]['id']}})[_0x51d4('0x27')](handleEntityNotFound(_0xaadbb1,null))['then'](saveUpdates(_0x20df31[_0x51d4('0x4f')],null))[_0x51d4('0x27')](respondWithResult(_0xaadbb1,null))[_0x51d4('0x4d')](handleError(_0xaadbb1,null));};exports[_0x51d4('0x28')]=function(_0x364ad2,_0xbab389){return db[_0x51d4('0x2f')][_0x51d4('0x4c')]({'where':{'id':_0x364ad2['params']['id']}})[_0x51d4('0x27')](handleEntityNotFound(_0xbab389,null))[_0x51d4('0x27')](removeEntity(_0xbab389,null))['catch'](handleError(_0xbab389,null));};
\ No newline at end of file
+var _0x6e72=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','reject','save','then','destroy','end','stack','name','send','FreshsalesField','rawAttributes'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6e72,0x68));var _0x26e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e72[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x26e7('0x0'));var emlformat=require(_0x26e7('0x1'));var rimraf=require(_0x26e7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26e7('0x3'));var rp=require(_0x26e7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x26e7('0x5'));var util=require(_0x26e7('0x6'));var path=require(_0x26e7('0x7'));var sox=require(_0x26e7('0x8'));var csv=require(_0x26e7('0x9'));var ejs=require(_0x26e7('0xa'));var fs=require('fs');var _=require(_0x26e7('0xb'));var squel=require(_0x26e7('0xc'));var crypto=require(_0x26e7('0xd'));var jsforce=require(_0x26e7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x26e7('0x9'));var querystring=require(_0x26e7('0xf'));var Papa=require('papaparse');var Redis=require(_0x26e7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x26e7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26e7('0x12'));var logger=require(_0x26e7('0x13'))(_0x26e7('0x14'));var utils=require('../../config/utils');var config=require(_0x26e7('0x15'));var db=require(_0x26e7('0x16'))['db'];function respondWithStatusCode(_0x5e3abf,_0x43a733){_0x43a733=_0x43a733||0xcc;return function(_0x5dc7ad){if(_0x5dc7ad){return _0x5e3abf[_0x26e7('0x17')](_0x43a733);}return _0x5e3abf[_0x26e7('0x18')](_0x43a733)['end']();};}function respondWithResult(_0xd11f18,_0x54d06a){_0x54d06a=_0x54d06a||0xc8;return function(_0x408e2d){if(_0x408e2d){return _0xd11f18['status'](_0x54d06a)['json'](_0x408e2d);}};}function respondWithFilteredResult(_0x44fed4,_0x35c67c){return function(_0x1e16c9){if(_0x1e16c9){var _0x2231a3=_0x1e16c9[_0x26e7('0x19')],_0x539a0b=_0x35c67c['offset'],_0x4732f1=_0x35c67c[_0x26e7('0x1a')]+_0x35c67c[_0x26e7('0x1b')],_0x2026a6;if(_0x4732f1>=_0x2231a3){_0x4732f1=_0x2231a3;_0x2026a6=0xc8;}else{_0x2026a6=0xce;}_0x44fed4[_0x26e7('0x18')](_0x2026a6);return _0x44fed4[_0x26e7('0x1c')]('Content-Range',_0x539a0b+'-'+_0x4732f1+'/'+_0x2231a3)[_0x26e7('0x1d')](_0x1e16c9);}return null;};}function patchUpdates(_0x186cdf){return function(_0x576bb1){try{jsonpatch['apply'](_0x576bb1,_0x186cdf,!![]);}catch(_0x3eaf23){return BPromise[_0x26e7('0x1e')](_0x3eaf23);}return _0x576bb1[_0x26e7('0x1f')]();};}function saveUpdates(_0xe83b4f,_0x35f6c9){return function(_0x351951){if(_0x351951){return _0x351951['update'](_0xe83b4f)[_0x26e7('0x20')](function(_0x6a70ba){return _0x6a70ba;});}return null;};}function removeEntity(_0xb4c41d,_0x183745){return function(_0x18f3ad){if(_0x18f3ad){return _0x18f3ad[_0x26e7('0x21')]()[_0x26e7('0x20')](function(){_0xb4c41d[_0x26e7('0x18')](0xcc)[_0x26e7('0x22')]();});}};}function handleEntityNotFound(_0x2b1bbb,_0x55919f){return function(_0x36c6e5){if(!_0x36c6e5){_0x2b1bbb[_0x26e7('0x17')](0x194);}return _0x36c6e5;};}function handleError(_0x410f18,_0x4a94c4){_0x4a94c4=_0x4a94c4||0x1f4;return function(_0x2e3bad){logger['error'](_0x2e3bad[_0x26e7('0x23')]);if(_0x2e3bad[_0x26e7('0x24')]){delete _0x2e3bad[_0x26e7('0x24')];}_0x410f18[_0x26e7('0x18')](_0x4a94c4)[_0x26e7('0x25')](_0x2e3bad);};}exports['index']=function(_0x21cd90,_0x1921e5){var _0x5ddeef={},_0x4ff7f2={},_0x192458={'count':0x0,'rows':[]};var _0x9a8bf7=_['map'](db[_0x26e7('0x26')][_0x26e7('0x27')],function(_0x2d74f2){return{'name':_0x2d74f2[_0x26e7('0x28')],'type':_0x2d74f2[_0x26e7('0x29')][_0x26e7('0x2a')]};});_0x4ff7f2[_0x26e7('0x2b')]=_[_0x26e7('0x2c')](_0x9a8bf7,_0x26e7('0x24'));_0x4ff7f2[_0x26e7('0x2d')]=_[_0x26e7('0x2e')](_0x21cd90[_0x26e7('0x2d')]);_0x4ff7f2[_0x26e7('0x2f')]=_[_0x26e7('0x30')](_0x4ff7f2['model'],_0x4ff7f2[_0x26e7('0x2d')]);_0x5ddeef[_0x26e7('0x31')]=_[_0x26e7('0x30')](_0x4ff7f2[_0x26e7('0x2b')],qs[_0x26e7('0x32')](_0x21cd90[_0x26e7('0x2d')][_0x26e7('0x32')]));_0x5ddeef[_0x26e7('0x31')]=_0x5ddeef[_0x26e7('0x31')][_0x26e7('0x33')]?_0x5ddeef[_0x26e7('0x31')]:_0x4ff7f2[_0x26e7('0x2b')];if(!_0x21cd90[_0x26e7('0x2d')][_0x26e7('0x34')](_0x26e7('0x35'))){_0x5ddeef[_0x26e7('0x1b')]=qs['limit'](_0x21cd90[_0x26e7('0x2d')]['limit']);_0x5ddeef[_0x26e7('0x1a')]=qs[_0x26e7('0x1a')](_0x21cd90[_0x26e7('0x2d')][_0x26e7('0x1a')]);}_0x5ddeef[_0x26e7('0x36')]=qs[_0x26e7('0x37')](_0x21cd90[_0x26e7('0x2d')]['sort']);_0x5ddeef[_0x26e7('0x38')]=qs[_0x26e7('0x2f')](_[_0x26e7('0x39')](_0x21cd90[_0x26e7('0x2d')],_0x4ff7f2[_0x26e7('0x2f')]),_0x9a8bf7);if(_0x21cd90[_0x26e7('0x2d')][_0x26e7('0x3a')]){_0x5ddeef['where']=_[_0x26e7('0x3b')](_0x5ddeef['where'],{'$or':_[_0x26e7('0x2c')](_0x9a8bf7,function(_0x39f2b7){if(_0x39f2b7[_0x26e7('0x29')]!==_0x26e7('0x3c')){var _0x1ee171={};_0x1ee171[_0x39f2b7['name']]={'$like':'%'+_0x21cd90[_0x26e7('0x2d')]['filter']+'%'};return _0x1ee171;}})});}_0x5ddeef=_[_0x26e7('0x3b')]({},_0x5ddeef,_0x21cd90[_0x26e7('0x3d')]);var _0x4604eb={'where':_0x5ddeef['where']};return db['FreshsalesField'][_0x26e7('0x19')](_0x4604eb)[_0x26e7('0x20')](function(_0x48cabe){_0x192458[_0x26e7('0x19')]=_0x48cabe;if(_0x21cd90[_0x26e7('0x2d')][_0x26e7('0x3e')]){_0x5ddeef[_0x26e7('0x3f')]=[{'all':!![]}];}return db[_0x26e7('0x26')][_0x26e7('0x40')](_0x5ddeef);})[_0x26e7('0x20')](function(_0x4e46c0){_0x192458[_0x26e7('0x41')]=_0x4e46c0;return _0x192458;})[_0x26e7('0x20')](respondWithFilteredResult(_0x1921e5,_0x5ddeef))['catch'](handleError(_0x1921e5,null));};exports[_0x26e7('0x42')]=function(_0x3ffe7e,_0x53613a){var _0x303edb={'raw':!![],'where':{'id':_0x3ffe7e['params']['id']}},_0xfbb263={};_0xfbb263[_0x26e7('0x2b')]=_[_0x26e7('0x2e')](db[_0x26e7('0x26')]['rawAttributes']);_0xfbb263[_0x26e7('0x2d')]=_[_0x26e7('0x2e')](_0x3ffe7e[_0x26e7('0x2d')]);_0xfbb263[_0x26e7('0x2f')]=_[_0x26e7('0x30')](_0xfbb263[_0x26e7('0x2b')],_0xfbb263[_0x26e7('0x2d')]);_0x303edb['attributes']=_[_0x26e7('0x30')](_0xfbb263[_0x26e7('0x2b')],qs[_0x26e7('0x32')](_0x3ffe7e['query'][_0x26e7('0x32')]));_0x303edb['attributes']=_0x303edb[_0x26e7('0x31')][_0x26e7('0x33')]?_0x303edb[_0x26e7('0x31')]:_0xfbb263[_0x26e7('0x2b')];if(_0x3ffe7e[_0x26e7('0x2d')][_0x26e7('0x3e')]){_0x303edb[_0x26e7('0x3f')]=[{'all':!![]}];}_0x303edb=_[_0x26e7('0x3b')]({},_0x303edb,_0x3ffe7e[_0x26e7('0x3d')]);return db[_0x26e7('0x26')][_0x26e7('0x43')](_0x303edb)[_0x26e7('0x20')](handleEntityNotFound(_0x53613a,null))[_0x26e7('0x20')](respondWithResult(_0x53613a,null))['catch'](handleError(_0x53613a,null));};exports['create']=function(_0x569aae,_0x304958){return db[_0x26e7('0x26')][_0x26e7('0x44')](_0x569aae[_0x26e7('0x45')],{})[_0x26e7('0x20')](respondWithResult(_0x304958,0xc9))[_0x26e7('0x46')](handleError(_0x304958,null));};exports['update']=function(_0x3ad5f8,_0x550368){if(_0x3ad5f8[_0x26e7('0x45')]['id']){delete _0x3ad5f8['body']['id'];}return db[_0x26e7('0x26')][_0x26e7('0x43')]({'where':{'id':_0x3ad5f8['params']['id']}})['then'](handleEntityNotFound(_0x550368,null))[_0x26e7('0x20')](saveUpdates(_0x3ad5f8[_0x26e7('0x45')],null))[_0x26e7('0x20')](respondWithResult(_0x550368,null))[_0x26e7('0x46')](handleError(_0x550368,null));};exports['destroy']=function(_0x245555,_0x2d9d2d){return db['FreshsalesField'][_0x26e7('0x43')]({'where':{'id':_0x245555[_0x26e7('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d9d2d,null))['then'](removeEntity(_0x2d9d2d,null))[_0x26e7('0x46')](handleError(_0x2d9d2d,null));};
\ No newline at end of file
index 4a58069..6e86e1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9968=['api','moment','bluebird','request-promise','path','rimraf','exports','define','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x3203cc,_0x744dda){var _0x156a19=function(_0x1f10f8){while(--_0x1f10f8){_0x3203cc['push'](_0x3203cc['shift']());}};_0x156a19(++_0x744dda);}(_0x9968,0x1a1));var _0x8996=function(_0x489bf8,_0x3c85c3){_0x489bf8=_0x489bf8-0x0;var _0x2e1b14=_0x9968[_0x489bf8];return _0x2e1b14;};'use strict';var _=require(_0x8996('0x0'));var util=require(_0x8996('0x1'));var logger=require(_0x8996('0x2'))(_0x8996('0x3'));var moment=require(_0x8996('0x4'));var BPromise=require(_0x8996('0x5'));var rp=require(_0x8996('0x6'));var fs=require('fs');var path=require(_0x8996('0x7'));var rimraf=require(_0x8996('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module[_0x8996('0x9')]=function(_0x49b4ae,_0xda48cf){return _0x49b4ae[_0x8996('0xa')]('FreshsalesField',attributes,{'tableName':_0x8996('0xb'),'paranoid':![],'indexes':[{'name':_0x8996('0xc'),'fields':['idField',_0x8996('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf48d=['request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf48d,0xeb));var _0xdf48=function(_0x25f334,_0x44aab9){_0x25f334=_0x25f334-0x0;var _0x11fb6e=_0xf48d[_0x25f334];return _0x11fb6e;};'use strict';var _=require(_0xdf48('0x0'));var util=require(_0xdf48('0x1'));var logger=require(_0xdf48('0x2'))(_0xdf48('0x3'));var moment=require('moment');var BPromise=require(_0xdf48('0x4'));var rp=require(_0xdf48('0x5'));var fs=require('fs');var path=require(_0xdf48('0x6'));var rimraf=require(_0xdf48('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf48('0x8'));module[_0xdf48('0x9')]=function(_0x51428e,_0x234565){return _0x51428e[_0xdf48('0xa')](_0xdf48('0xb'),attributes,{'tableName':_0xdf48('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xdf48('0xd'),_0xdf48('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7d482dd..1dd4cfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd71a=['jayson/promise','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x574e21,_0x5a5fa2){var _0x33a6dd=function(_0x58ab82){while(--_0x58ab82){_0x574e21['push'](_0x574e21['shift']());}};_0x33a6dd(++_0x5a5fa2);}(_0xd71a,0x1f2));var _0xad71=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd71a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xad71('0x0'));var util=require('util');var moment=require(_0xad71('0x1'));var BPromise=require(_0xad71('0x2'));var rs=require(_0xad71('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad71('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xad71('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad71('0x6'));var client=jayson['client'][_0xad71('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ec49d,_0x5da797,_0x153c14){return new BPromise(function(_0x2075b2,_0x28dff3){return client[_0xad71('0x8')](_0x2ec49d,_0x153c14)[_0xad71('0x9')](function(_0x2c39d3){logger['info'](_0xad71('0xa'),_0x5da797,_0xad71('0xb'));logger[_0xad71('0xc')](_0xad71('0xd'),_0x5da797,_0xad71('0xb'),JSON[_0xad71('0xe')](_0x2c39d3));if(_0x2c39d3[_0xad71('0xf')]){if(_0x2c39d3[_0xad71('0xf')][_0xad71('0x10')]===0x1f4){logger['error'](_0xad71('0xa'),_0x5da797,_0x2c39d3[_0xad71('0xf')][_0xad71('0x11')]);return _0x28dff3(_0x2c39d3[_0xad71('0xf')][_0xad71('0x11')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x5da797,_0x2c39d3[_0xad71('0xf')][_0xad71('0x11')]);return _0x2075b2(_0x2c39d3['error'][_0xad71('0x11')]);}else{logger[_0xad71('0x12')](_0xad71('0xa'),_0x5da797,'request\x20sent');_0x2075b2(_0x2c39d3[_0xad71('0x13')][_0xad71('0x11')]);}})[_0xad71('0x14')](function(_0x2c125c){logger['error'](_0xad71('0xa'),_0x5da797,_0x2c125c);_0x28dff3(_0x2c125c);});});}
\ No newline at end of file
+var _0xf687=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xf687,0x1cf));var _0x7f68=function(_0x431970,_0x3d390b){_0x431970=_0x431970-0x0;var _0x3a347a=_0xf687[_0x431970];return _0x3a347a;};'use strict';var _=require(_0x7f68('0x0'));var util=require(_0x7f68('0x1'));var moment=require(_0x7f68('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f68('0x3'));var fs=require('fs');var Redis=require(_0x7f68('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f68('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7f68('0x6'));var jayson=require(_0x7f68('0x7'));var client=jayson[_0x7f68('0x8')][_0x7f68('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4af3ac,_0x33294c,_0x10ad14){return new BPromise(function(_0x159091,_0x4f135c){return client[_0x7f68('0xa')](_0x4af3ac,_0x10ad14)['then'](function(_0x14e878){logger[_0x7f68('0xb')](_0x7f68('0xc'),_0x33294c,_0x7f68('0xd'));logger[_0x7f68('0xe')](_0x7f68('0xf'),_0x33294c,_0x7f68('0xd'),JSON['stringify'](_0x14e878));if(_0x14e878[_0x7f68('0x10')]){if(_0x14e878[_0x7f68('0x10')][_0x7f68('0x11')]===0x1f4){logger[_0x7f68('0x10')](_0x7f68('0xc'),_0x33294c,_0x14e878['error']['message']);return _0x4f135c(_0x14e878['error'][_0x7f68('0x12')]);}logger[_0x7f68('0x10')](_0x7f68('0xc'),_0x33294c,_0x14e878[_0x7f68('0x10')]['message']);return _0x159091(_0x14e878[_0x7f68('0x10')][_0x7f68('0x12')]);}else{logger[_0x7f68('0xb')](_0x7f68('0xc'),_0x33294c,_0x7f68('0xd'));_0x159091(_0x14e878[_0x7f68('0x13')][_0x7f68('0x12')]);}})[_0x7f68('0x14')](function(_0x7ea0b4){logger[_0x7f68('0x10')](_0x7f68('0xc'),_0x33294c,_0x7ea0b4);_0x4f135c(_0x7ea0b4);});});}
\ No newline at end of file
index b64ac4d..5e51b45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x155e=['getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x2f3449,_0x18d658){var _0x4dd3f0=function(_0x3039a3){while(--_0x3039a3){_0x2f3449['push'](_0x2f3449['shift']());}};_0x4dd3f0(++_0x18d658);}(_0x155e,0x9c));var _0xe155=function(_0x2c47e6,_0x5aba0){_0x2c47e6=_0x2c47e6-0x0;var _0x4022b3=_0x155e[_0x2c47e6];return _0x4022b3;};'use strict';var multer=require(_0xe155('0x0'));var util=require(_0xe155('0x1'));var path=require(_0xe155('0x2'));var timeout=require('connect-timeout');var express=require(_0xe155('0x3'));var router=express[_0xe155('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe155('0x5'));var config=require(_0xe155('0x6'));var controller=require('./intSalesforceAccount.controller');router[_0xe155('0x7')]('/',auth[_0xe155('0x8')](),controller['index']);router[_0xe155('0x7')](_0xe155('0x9'),auth[_0xe155('0x8')](),controller[_0xe155('0xa')]);router['get'](_0xe155('0xb'),auth['isAuthenticated'](),controller[_0xe155('0xc')]);router[_0xe155('0x7')](_0xe155('0xd'),auth[_0xe155('0x8')](),controller['getFields']);router[_0xe155('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe155('0xe')](_0xe155('0xb'),auth[_0xe155('0x8')](),controller[_0xe155('0xf')]);router[_0xe155('0x10')](_0xe155('0x9'),auth[_0xe155('0x8')](),controller[_0xe155('0x11')]);router[_0xe155('0x12')]('/:id',auth[_0xe155('0x8')](),controller[_0xe155('0x13')]);module[_0xe155('0x14')]=router;
\ No newline at end of file
+var _0x7fec=['index','show','/:id/fields','getFields','post','/:id/configurations','put','update','delete','/:id','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x7fec,0x6e));var _0xc7fe=function(_0xe786c6,_0x3ebef3){_0xe786c6=_0xe786c6-0x0;var _0x10ef03=_0x7fec[_0xe786c6];return _0x10ef03;};'use strict';var multer=require(_0xc7fe('0x0'));var util=require(_0xc7fe('0x1'));var path=require(_0xc7fe('0x2'));var timeout=require(_0xc7fe('0x3'));var express=require(_0xc7fe('0x4'));var router=express[_0xc7fe('0x5')]();var auth=require(_0xc7fe('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc7fe('0x7'));var controller=require('./intSalesforceAccount.controller');router[_0xc7fe('0x8')]('/',auth[_0xc7fe('0x9')](),controller[_0xc7fe('0xa')]);router['get']('/:id',auth[_0xc7fe('0x9')](),controller[_0xc7fe('0xb')]);router[_0xc7fe('0x8')]('/:id/configurations',auth[_0xc7fe('0x9')](),controller['getConfigurations']);router['get'](_0xc7fe('0xc'),auth[_0xc7fe('0x9')](),controller[_0xc7fe('0xd')]);router['post']('/',auth[_0xc7fe('0x9')](),controller['create']);router[_0xc7fe('0xe')](_0xc7fe('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xc7fe('0x10')]('/:id',auth[_0xc7fe('0x9')](),controller[_0xc7fe('0x11')]);router[_0xc7fe('0x12')](_0xc7fe('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1d92c87..880e84f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0xdcaf4e,_0x55114c){var _0x24750d=function(_0x4c1275){while(--_0x4c1275){_0xdcaf4e['push'](_0xdcaf4e['shift']());}};_0x24750d(++_0x55114c);}(_0xf494,0x1c6));var _0x4f49=function(_0x3dc0b6,_0x3f3ea5){_0x3dc0b6=_0x3dc0b6-0x0;var _0x367c4e=_0xf494[_0x3dc0b6];return _0x367c4e;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4f49('0x2')],'unique':_0x4f49('0x3')},'remoteUri':{'type':Sequelize[_0x4f49('0x2')]},'password':{'type':Sequelize[_0x4f49('0x2')]},'clientId':{'type':Sequelize[_0x4f49('0x2')]},'clientSecret':{'type':Sequelize[_0x4f49('0x2')]},'securityToken':{'type':Sequelize[_0x4f49('0x2')]},'serverUrl':{'type':Sequelize[_0x4f49('0x2')]},'type':{'type':Sequelize[_0x4f49('0x4')](_0x4f49('0x5'),_0x4f49('0x6')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x23e2bb,_0xd82b6d){var _0x2dd8ed=function(_0x4af0ce){while(--_0x4af0ce){_0x23e2bb['push'](_0x23e2bb['shift']());}};_0x2dd8ed(++_0xd82b6d);}(_0x7217,0x19e));var _0x7721=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x7217[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')]},'description':{'type':Sequelize[_0x7721('0x1')]},'username':{'type':Sequelize[_0x7721('0x1')],'unique':_0x7721('0x2')},'remoteUri':{'type':Sequelize[_0x7721('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x7721('0x1')]},'securityToken':{'type':Sequelize[_0x7721('0x1')]},'serverUrl':{'type':Sequelize[_0x7721('0x1')]},'type':{'type':Sequelize[_0x7721('0x3')](_0x7721('0x4'),_0x7721('0x5')),'defaultValue':_0x7721('0x4')}};
\ No newline at end of file
index 12a6e09..7574c12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb457=['jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','sendStatus','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','SalesforceAccount','findAll','rows','show','params','keys','rawAttributes','create','body','update','find','destroy','getConfigurations','findOne','SalesforceConfiguration','order','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','clientId','username','password','slice','substring','lastIndexOf','clientSecret','login','concat','securityToken','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','Origin','IsEscalated','SuppliedName','SuppliedCompany','custom','includes','label','picklistValues','boolean','True','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0xb457,0xff));var _0x7b45=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0xb457[_0x622035];return _0x326cf2;};'use strict';var pdf=require(_0x7b45('0x0'));var emlformat=require(_0x7b45('0x1'));var rimraf=require(_0x7b45('0x2'));var zipdir=require(_0x7b45('0x3'));var jsonpatch=require(_0x7b45('0x4'));var rp=require('request-promise');var moment=require(_0x7b45('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7b45('0x6'));var util=require('util');var path=require(_0x7b45('0x7'));var sox=require('sox');var csv=require(_0x7b45('0x8'));var ejs=require(_0x7b45('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7b45('0xa'));var crypto=require(_0x7b45('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b45('0xc'));var toCsv=require(_0x7b45('0x8'));var querystring=require(_0x7b45('0xd'));var Papa=require(_0x7b45('0xe'));var Redis=require(_0x7b45('0xf'));var authService=require(_0x7b45('0x10'));var qs=require(_0x7b45('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b45('0x12'));var logger=require(_0x7b45('0x13'))(_0x7b45('0x14'));var utils=require('../../config/utils');var config=require(_0x7b45('0x15'));var db=require(_0x7b45('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x7b45('0x17'));var client=jayson[_0x7b45('0x18')][_0x7b45('0x19')]({'port':0x232a});function checkPasswordPattern(_0x45320a,_0x28cac0,_0x29127b){if(_0x29127b){var _0x1c61d6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c61d6[_0x7b45('0x1a')](_0x28cac0)){return _0x45320a;}else{throw new db[(_0x7b45('0x1b'))][(_0x7b45('0x1c'))](_0x7b45('0x1d'));}}else{return _0x45320a;}}function respondWithRpcPromise(_0x2e3dc1,_0x1d30c5,_0x4a9b47,_0x2ec750){return new BPromise(function(_0x2e07bb,_0x15815a){var _0x48cf7a=_0x2ec750||client;return _0x48cf7a[_0x7b45('0x1e')](_0x2e3dc1,_0x4a9b47)[_0x7b45('0x1f')](function(_0x4ed719){logger[_0x7b45('0x20')](_0x7b45('0x21'),_0x1d30c5,_0x7b45('0x22'));logger[_0x7b45('0x23')](_0x7b45('0x24'),_0x1d30c5,_0x7b45('0x22'),JSON[_0x7b45('0x25')](_0x4ed719));if(_0x4ed719['error']){if(_0x4ed719[_0x7b45('0x26')][_0x7b45('0x27')]===0x1f4){logger[_0x7b45('0x26')](_0x7b45('0x21'),_0x1d30c5,_0x4ed719[_0x7b45('0x26')][_0x7b45('0x28')]);return _0x15815a(_0x4ed719[_0x7b45('0x26')][_0x7b45('0x28')]);}logger[_0x7b45('0x26')]('SalesforceAccount,\x20%s,\x20%s',_0x1d30c5,_0x4ed719[_0x7b45('0x26')]['message']);return _0x2e07bb(_0x4ed719['error']['message']);}else{logger[_0x7b45('0x20')](_0x7b45('0x21'),_0x1d30c5,_0x7b45('0x22'));_0x2e07bb(_0x4ed719['result'][_0x7b45('0x28')]);}})[_0x7b45('0x29')](function(_0x4ea705){logger['error'](_0x7b45('0x21'),_0x1d30c5,_0x4ea705);_0x15815a(_0x4ea705);});});}function respondWithStatusCode(_0x2192a0,_0x100d81){_0x100d81=_0x100d81||0xcc;return function(_0xb984e5){if(_0xb984e5){return _0x2192a0['sendStatus'](_0x100d81);}return _0x2192a0[_0x7b45('0x2a')](_0x100d81)[_0x7b45('0x2b')]();};}function respondWithResult(_0x2cb204,_0x2e38bf){_0x2e38bf=_0x2e38bf||0xc8;return function(_0x2af924){if(_0x2af924){return _0x2cb204[_0x7b45('0x2a')](_0x2e38bf)[_0x7b45('0x2c')](_0x2af924);}};}function respondWithFilteredResult(_0x3e95e2,_0x123b80){return function(_0x2d478b){if(_0x2d478b){var _0x5aa612=_0x2d478b[_0x7b45('0x2d')],_0x19820e=_0x123b80[_0x7b45('0x2e')],_0x482494=_0x123b80[_0x7b45('0x2e')]+_0x123b80[_0x7b45('0x2f')],_0x1a7945;if(_0x482494>=_0x5aa612){_0x482494=_0x5aa612;_0x1a7945=0xc8;}else{_0x1a7945=0xce;}_0x3e95e2['status'](_0x1a7945);return _0x3e95e2[_0x7b45('0x30')](_0x7b45('0x31'),_0x19820e+'-'+_0x482494+'/'+_0x5aa612)[_0x7b45('0x2c')](_0x2d478b);}return null;};}function patchUpdates(_0x4f6f7f){return function(_0x288fd1){try{jsonpatch[_0x7b45('0x32')](_0x288fd1,_0x4f6f7f,!![]);}catch(_0x1e2522){return BPromise[_0x7b45('0x33')](_0x1e2522);}return _0x288fd1[_0x7b45('0x34')]();};}function saveUpdates(_0x50ad91,_0x998712){return function(_0xdfb5a6){if(_0xdfb5a6){return _0xdfb5a6['update'](_0x50ad91)[_0x7b45('0x1f')](function(_0x3a59fc){return _0x3a59fc;});}return null;};}function removeEntity(_0x17b534,_0x1e7f41){return function(_0x59f05a){if(_0x59f05a){return _0x59f05a['destroy']()[_0x7b45('0x1f')](function(){_0x17b534[_0x7b45('0x2a')](0xcc)[_0x7b45('0x2b')]();});}};}function handleEntityNotFound(_0xa2bd1f,_0xb9fe8e){return function(_0x1a2719){if(!_0x1a2719){_0xa2bd1f[_0x7b45('0x35')](0x194);}return _0x1a2719;};}function handleError(_0x613ded,_0x48c8e0){_0x48c8e0=_0x48c8e0||0x1f4;return function(_0x19e19b){logger[_0x7b45('0x26')](_0x19e19b[_0x7b45('0x36')]);if(_0x19e19b[_0x7b45('0x37')]){delete _0x19e19b[_0x7b45('0x37')];}_0x613ded['status'](_0x48c8e0)[_0x7b45('0x38')](_0x19e19b);};}exports[_0x7b45('0x39')]=function(_0x1ccb79,_0x10800b){var _0x41be1c={},_0x4c66ee={},_0x6b148={'count':0x0,'rows':[]};var _0x3cd1e9=_[_0x7b45('0x3a')](db['SalesforceAccount']['rawAttributes'],function(_0x508a6d){return{'name':_0x508a6d[_0x7b45('0x3b')],'type':_0x508a6d['type'][_0x7b45('0x3c')]};});_0x4c66ee[_0x7b45('0x3d')]=_['map'](_0x3cd1e9,_0x7b45('0x37'));_0x4c66ee[_0x7b45('0x3e')]=_['keys'](_0x1ccb79[_0x7b45('0x3e')]);_0x4c66ee[_0x7b45('0x3f')]=_[_0x7b45('0x40')](_0x4c66ee[_0x7b45('0x3d')],_0x4c66ee[_0x7b45('0x3e')]);_0x41be1c[_0x7b45('0x41')]=_[_0x7b45('0x40')](_0x4c66ee['model'],qs[_0x7b45('0x42')](_0x1ccb79[_0x7b45('0x3e')][_0x7b45('0x42')]));_0x41be1c[_0x7b45('0x41')]=_0x41be1c[_0x7b45('0x41')][_0x7b45('0x43')]?_0x41be1c[_0x7b45('0x41')]:_0x4c66ee[_0x7b45('0x3d')];if(!_0x1ccb79['query'][_0x7b45('0x44')](_0x7b45('0x45'))){_0x41be1c[_0x7b45('0x2f')]=qs[_0x7b45('0x2f')](_0x1ccb79[_0x7b45('0x3e')][_0x7b45('0x2f')]);_0x41be1c[_0x7b45('0x2e')]=qs[_0x7b45('0x2e')](_0x1ccb79[_0x7b45('0x3e')][_0x7b45('0x2e')]);}_0x41be1c['order']=qs[_0x7b45('0x46')](_0x1ccb79[_0x7b45('0x3e')]['sort']);_0x41be1c[_0x7b45('0x47')]=qs[_0x7b45('0x3f')](_[_0x7b45('0x48')](_0x1ccb79['query'],_0x4c66ee[_0x7b45('0x3f')]),_0x3cd1e9);if(_0x1ccb79[_0x7b45('0x3e')]['filter']){_0x41be1c['where']=_['merge'](_0x41be1c['where'],{'$or':_[_0x7b45('0x3a')](_0x3cd1e9,function(_0x2508c1){if(_0x2508c1[_0x7b45('0x49')]!==_0x7b45('0x4a')){var _0x16efb3={};_0x16efb3[_0x2508c1[_0x7b45('0x37')]]={'$like':'%'+_0x1ccb79[_0x7b45('0x3e')][_0x7b45('0x4b')]+'%'};return _0x16efb3;}})});}_0x41be1c=_[_0x7b45('0x4c')]({},_0x41be1c,_0x1ccb79[_0x7b45('0x4d')]);var _0xf3cec8={'where':_0x41be1c[_0x7b45('0x47')]};return db['SalesforceAccount'][_0x7b45('0x2d')](_0xf3cec8)[_0x7b45('0x1f')](function(_0x272300){_0x6b148['count']=_0x272300;if(_0x1ccb79[_0x7b45('0x3e')][_0x7b45('0x4e')]){_0x41be1c[_0x7b45('0x4f')]=[{'all':!![]}];}return db[_0x7b45('0x50')][_0x7b45('0x51')](_0x41be1c);})[_0x7b45('0x1f')](function(_0xe7fe5c){_0x6b148[_0x7b45('0x52')]=_0xe7fe5c;return _0x6b148;})[_0x7b45('0x1f')](respondWithFilteredResult(_0x10800b,_0x41be1c))['catch'](handleError(_0x10800b,null));};exports[_0x7b45('0x53')]=function(_0x12c7a5,_0x61669){var _0x5e71fa={'raw':![],'where':{'id':_0x12c7a5[_0x7b45('0x54')]['id']}},_0x4b1a0b={};_0x4b1a0b[_0x7b45('0x3d')]=_[_0x7b45('0x55')](db[_0x7b45('0x50')][_0x7b45('0x56')]);_0x4b1a0b['query']=_[_0x7b45('0x55')](_0x12c7a5['query']);_0x4b1a0b['filters']=_['intersection'](_0x4b1a0b[_0x7b45('0x3d')],_0x4b1a0b[_0x7b45('0x3e')]);_0x5e71fa[_0x7b45('0x41')]=_[_0x7b45('0x40')](_0x4b1a0b[_0x7b45('0x3d')],qs[_0x7b45('0x42')](_0x12c7a5[_0x7b45('0x3e')][_0x7b45('0x42')]));_0x5e71fa[_0x7b45('0x41')]=_0x5e71fa['attributes']['length']?_0x5e71fa['attributes']:_0x4b1a0b['model'];if(_0x12c7a5[_0x7b45('0x3e')][_0x7b45('0x4e')]){_0x5e71fa[_0x7b45('0x4f')]=[{'all':!![]}];}_0x5e71fa=_[_0x7b45('0x4c')]({},_0x5e71fa,_0x12c7a5[_0x7b45('0x4d')]);return db['SalesforceAccount']['find'](_0x5e71fa)[_0x7b45('0x1f')](handleEntityNotFound(_0x61669,null))[_0x7b45('0x1f')](respondWithResult(_0x61669,null))[_0x7b45('0x29')](handleError(_0x61669,null));};exports['create']=function(_0xbc4dc2,_0xa28cf6){return db['SalesforceAccount'][_0x7b45('0x57')](_0xbc4dc2[_0x7b45('0x58')],{})[_0x7b45('0x1f')](respondWithResult(_0xa28cf6,0xc9))['catch'](handleError(_0xa28cf6,null));};exports[_0x7b45('0x59')]=function(_0x2603db,_0x23f40f){if(_0x2603db[_0x7b45('0x58')]['id']){delete _0x2603db[_0x7b45('0x58')]['id'];}return db[_0x7b45('0x50')][_0x7b45('0x5a')]({'where':{'id':_0x2603db[_0x7b45('0x54')]['id']}})[_0x7b45('0x1f')](handleEntityNotFound(_0x23f40f,null))[_0x7b45('0x1f')](saveUpdates(_0x2603db['body'],null))[_0x7b45('0x1f')](respondWithResult(_0x23f40f,null))[_0x7b45('0x29')](handleError(_0x23f40f,null));};exports[_0x7b45('0x5b')]=function(_0x15041f,_0x3e63d5){return db[_0x7b45('0x50')][_0x7b45('0x5a')]({'where':{'id':_0x15041f['params']['id']}})[_0x7b45('0x1f')](handleEntityNotFound(_0x3e63d5,null))[_0x7b45('0x1f')](removeEntity(_0x3e63d5,null))['catch'](handleError(_0x3e63d5,null));};exports[_0x7b45('0x5c')]=function(_0x246634,_0x65ea5a,_0x1a9063){var _0x51fdff={};var _0x205225={};var _0x10493c;var _0x1b6aa4;return db['SalesforceAccount'][_0x7b45('0x5d')]({'where':{'id':_0x246634['params']['id']}})[_0x7b45('0x1f')](handleEntityNotFound(_0x65ea5a,null))['then'](function(_0x501cbc){if(_0x501cbc){_0x10493c=_0x501cbc;_0x205225['model']=_[_0x7b45('0x55')](db[_0x7b45('0x5e')][_0x7b45('0x56')]);_0x205225['query']=_[_0x7b45('0x55')](_0x246634[_0x7b45('0x3e')]);_0x205225['filters']=_[_0x7b45('0x40')](_0x205225['model'],_0x205225[_0x7b45('0x3e')]);_0x51fdff[_0x7b45('0x41')]=_[_0x7b45('0x40')](_0x205225[_0x7b45('0x3d')],qs[_0x7b45('0x42')](_0x246634[_0x7b45('0x3e')][_0x7b45('0x42')]));_0x51fdff[_0x7b45('0x41')]=_0x51fdff[_0x7b45('0x41')][_0x7b45('0x43')]?_0x51fdff[_0x7b45('0x41')]:_0x205225[_0x7b45('0x3d')];_0x51fdff[_0x7b45('0x5f')]=qs[_0x7b45('0x46')](_0x246634[_0x7b45('0x3e')][_0x7b45('0x46')]);_0x51fdff[_0x7b45('0x47')]=qs[_0x7b45('0x3f')](_[_0x7b45('0x48')](_0x246634[_0x7b45('0x3e')],_0x205225[_0x7b45('0x3f')]));if(_0x246634['query'][_0x7b45('0x4b')]){_0x51fdff['where']=_[_0x7b45('0x4c')](_0x51fdff[_0x7b45('0x47')],{'$or':_[_0x7b45('0x3a')](_0x51fdff[_0x7b45('0x41')],function(_0x565e3f){var _0x38d023={};_0x38d023[_0x565e3f]={'$like':'%'+_0x246634[_0x7b45('0x3e')][_0x7b45('0x4b')]+'%'};return _0x38d023;})});}_0x51fdff=_[_0x7b45('0x4c')]({},_0x51fdff,_0x246634[_0x7b45('0x4d')]);return _0x10493c['getConfigurations'](_0x51fdff);}})[_0x7b45('0x1f')](function(_0x4c081d){if(_0x4c081d){_0x1b6aa4=_0x4c081d[_0x7b45('0x43')];if(!_0x246634[_0x7b45('0x3e')]['hasOwnProperty'](_0x7b45('0x45'))){_0x51fdff['limit']=qs['limit'](_0x246634[_0x7b45('0x3e')][_0x7b45('0x2f')]);_0x51fdff[_0x7b45('0x2e')]=qs[_0x7b45('0x2e')](_0x246634[_0x7b45('0x3e')][_0x7b45('0x2e')]);}return _0x10493c['getConfigurations'](_0x51fdff);}})[_0x7b45('0x1f')](function(_0x5da7ff){if(_0x5da7ff){return _0x5da7ff?{'count':_0x1b6aa4,'rows':_0x5da7ff}:null;}})[_0x7b45('0x1f')](respondWithResult(_0x65ea5a,null))['catch'](handleError(_0x65ea5a,null));};exports[_0x7b45('0x60')]=function(_0x379784,_0x41e347,_0x28eeb2){if(_0x379784['body']['id']){delete _0x379784[_0x7b45('0x58')]['id'];}return db[_0x7b45('0x50')][_0x7b45('0x5d')]({'where':{'id':_0x379784[_0x7b45('0x54')]['id']}})[_0x7b45('0x1f')](handleEntityNotFound(_0x41e347,null))[_0x7b45('0x1f')](function(_0x1253a2){if(_0x1253a2){_0x379784[_0x7b45('0x58')][_0x7b45('0x61')]=_0x1253a2['id'];_0x379784['body'][_0x7b45('0x62')]=integrations['getSubjects'](_0x379784[_0x7b45('0x58')][_0x7b45('0x63')],_0x379784[_0x7b45('0x58')]['type']);_0x379784[_0x7b45('0x58')][_0x7b45('0x64')]=integrations[_0x7b45('0x65')](_0x379784[_0x7b45('0x58')][_0x7b45('0x63')],_0x379784[_0x7b45('0x58')][_0x7b45('0x49')]);return db[_0x7b45('0x5e')]['create'](_0x379784[_0x7b45('0x58')],{'include':[{'model':db['SalesforceField'],'as':_0x7b45('0x62')},{'model':db[_0x7b45('0x66')],'as':_0x7b45('0x64')}]});}return null;})['then'](respondWithResult(_0x41e347,null))[_0x7b45('0x29')](handleError(_0x41e347,null));};exports[_0x7b45('0x67')]=function(_0x802e7e,_0x3dee83,_0x365515){var _0x3f177c;var _0x378fbb='';var _0x1a0e48='Task';return db[_0x7b45('0x50')][_0x7b45('0x5d')]({'where':{'id':_0x802e7e[_0x7b45('0x54')]['id']},'attributes':['id','remoteUri',_0x7b45('0x68'),'clientSecret',_0x7b45('0x69'),_0x7b45('0x6a'),'securityToken']})[_0x7b45('0x1f')](handleEntityNotFound(_0x3dee83,null))[_0x7b45('0x1f')](function(_0x1e83e0){if(_0x1e83e0){_0x378fbb=_0x1e83e0['remoteUri'];var _0x15e816=_0x378fbb[_0x7b45('0x6b')](-0x1);if(_0x15e816==='/'){_0x378fbb=_0x378fbb[_0x7b45('0x6c')](0x0,_0x378fbb[_0x7b45('0x6d')](_0x15e816));}_0x3f177c=new jsforce['Connection']({'oauth2':{'loginUrl':_0x378fbb,'clientId':_0x1e83e0['clientId'],'clientSecret':_0x1e83e0[_0x7b45('0x6e')]}});return _0x3f177c[_0x7b45('0x6f')](_0x1e83e0['username'],_0x1e83e0['password'][_0x7b45('0x70')](_0x1e83e0[_0x7b45('0x71')]));}})[_0x7b45('0x1f')](function(_0x7e3b7b){if(_0x7e3b7b){if(!_[_0x7b45('0x72')](_0x802e7e[_0x7b45('0x3e')][_0x7b45('0x73')])){_0x1a0e48=_0x802e7e[_0x7b45('0x3e')]['ticketType'];}return _0x3f177c[_0x7b45('0x74')](_0x1a0e48)['describe']();}})[_0x7b45('0x1f')](function(_0x59e227){var _0x3c4387=[_0x7b45('0x75'),_0x7b45('0x76'),_0x7b45('0x77'),_0x7b45('0x78'),_0x7b45('0x79'),_0x7b45('0x7a'),_0x7b45('0x7b'),_0x7b45('0x7c')];if(!_[_0x7b45('0x72')](_0x802e7e[_0x7b45('0x3e')]['ticketType'])&&_0x802e7e[_0x7b45('0x3e')][_0x7b45('0x73')]==='Case'){_0x3c4387=[_0x7b45('0x7c'),_0x7b45('0x7d'),'Reason',_0x7b45('0x7b'),_0x7b45('0x7a'),_0x7b45('0x7e'),_0x7b45('0x7f'),_0x7b45('0x80')];}if(_0x59e227){_['remove'](_0x59e227['fields'],function(_0xd50cbf){return _0xd50cbf[_0x7b45('0x81')]===![]&&!_0x3c4387[_0x7b45('0x82')](_0xd50cbf[_0x7b45('0x37')]);});return{'count':_0x59e227['fields'][_0x7b45('0x43')],'rows':_[_0x7b45('0x3a')](_0x59e227[_0x7b45('0x42')],function(_0x307a58){return{'id':_0x307a58[_0x7b45('0x37')],'name':_0x307a58[_0x7b45('0x83')],'custom':_0x307a58[_0x7b45('0x81')],'options':_0x307a58[_0x7b45('0x84')][_0x7b45('0x43')]>0x0?_[_0x7b45('0x3a')](_0x307a58[_0x7b45('0x84')],function(_0x4f8f96){return{'name':_0x4f8f96[_0x7b45('0x83')],'value':_0x4f8f96['value']};}):_0x307a58[_0x7b45('0x49')]==_0x7b45('0x85')?[{'name':_0x7b45('0x86'),'value':'true'},{'name':'False','value':_0x7b45('0x87')}]:[]};})};}})[_0x7b45('0x1f')](respondWithResult(_0x3dee83,null))[_0x7b45('0x29')](function(_0xde4936){var _0x367c60=_0x802e7e[_0x7b45('0x3e')]['test']?0x1f4:_0xde4936[_0x7b45('0x88')]||0x1f4;logger[_0x7b45('0x26')](_0x7b45('0x89'),_0x7b45('0x67'),_0x367c60,JSON[_0x7b45('0x25')](_0xde4936));delete _0xde4936[_0x7b45('0x37')];if(_0x367c60===0x191){_0x367c60=0x190;}_0x3dee83['status'](_0x367c60)[_0x7b45('0x38')](_0x802e7e[_0x7b45('0x3e')][_0x7b45('0x1a')]?{'message':_0x7b45('0x8a'),'statusCode':_0xde4936[_0x7b45('0x88')]}:_0xde4936);});};
\ No newline at end of file
+var _0x2987=['findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','clientId','clientSecret','password','securityToken','remoteUri','slice','substring','Connection','login','concat','ticketType','sobject','describe','CallDisposition','CallObject','CallType','IsArchived','Priority','Status','Type','isNil','Case','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','boolean','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SalesforceAccount','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','create','body','destroy','getConfigurations','SalesforceConfiguration','addConfiguration'];(function(_0x38a7e7,_0x3fd3ad){var _0x5c6a2c=function(_0x48cc68){while(--_0x48cc68){_0x38a7e7['push'](_0x38a7e7['shift']());}};_0x5c6a2c(++_0x3fd3ad);}(_0x2987,0xbf));var _0x7298=function(_0xdff763,_0x477c10){_0xdff763=_0xdff763-0x0;var _0x99390e=_0x2987[_0xdff763];return _0x99390e;};'use strict';var pdf=require(_0x7298('0x0'));var emlformat=require(_0x7298('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7298('0x2'));var jsonpatch=require(_0x7298('0x3'));var rp=require(_0x7298('0x4'));var moment=require(_0x7298('0x5'));var BPromise=require(_0x7298('0x6'));var Mustache=require('mustache');var util=require(_0x7298('0x7'));var path=require(_0x7298('0x8'));var sox=require('sox');var csv=require(_0x7298('0x9'));var ejs=require(_0x7298('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7298('0xb'));var crypto=require(_0x7298('0xc'));var jsforce=require(_0x7298('0xd'));var deskjs=require(_0x7298('0xe'));var toCsv=require(_0x7298('0x9'));var querystring=require(_0x7298('0xf'));var Papa=require(_0x7298('0x10'));var Redis=require(_0x7298('0x11'));var authService=require(_0x7298('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7298('0x13'));var hardwareService=require(_0x7298('0x14'));var logger=require('../../config/logger')(_0x7298('0x15'));var utils=require(_0x7298('0x16'));var config=require(_0x7298('0x17'));var db=require(_0x7298('0x18'))['db'];var integrations=require(_0x7298('0x19'));var jayson=require(_0x7298('0x1a'));var client=jayson['client'][_0x7298('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4e5c1f,_0x45c74f,_0x1996b8){if(_0x1996b8){var _0x157fed=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x157fed[_0x7298('0x1c')](_0x45c74f)){return _0x4e5c1f;}else{throw new db[(_0x7298('0x1d'))][(_0x7298('0x1e'))](_0x7298('0x1f'));}}else{return _0x4e5c1f;}}function respondWithRpcPromise(_0x564d0e,_0x40ac01,_0x35d002,_0x3aa799){return new BPromise(function(_0x1fb771,_0x1a07bb){var _0x21b0bb=_0x3aa799||client;return _0x21b0bb[_0x7298('0x20')](_0x564d0e,_0x35d002)['then'](function(_0x2b4f2d){logger[_0x7298('0x21')](_0x7298('0x22'),_0x40ac01,_0x7298('0x23'));logger['debug'](_0x7298('0x24'),_0x40ac01,_0x7298('0x23'),JSON[_0x7298('0x25')](_0x2b4f2d));if(_0x2b4f2d[_0x7298('0x26')]){if(_0x2b4f2d['error'][_0x7298('0x27')]===0x1f4){logger[_0x7298('0x26')](_0x7298('0x22'),_0x40ac01,_0x2b4f2d[_0x7298('0x26')][_0x7298('0x28')]);return _0x1a07bb(_0x2b4f2d['error'][_0x7298('0x28')]);}logger[_0x7298('0x26')](_0x7298('0x22'),_0x40ac01,_0x2b4f2d[_0x7298('0x26')][_0x7298('0x28')]);return _0x1fb771(_0x2b4f2d[_0x7298('0x26')][_0x7298('0x28')]);}else{logger[_0x7298('0x21')](_0x7298('0x22'),_0x40ac01,'request\x20sent');_0x1fb771(_0x2b4f2d['result'][_0x7298('0x28')]);}})[_0x7298('0x29')](function(_0x3d249b){logger[_0x7298('0x26')](_0x7298('0x22'),_0x40ac01,_0x3d249b);_0x1a07bb(_0x3d249b);});});}function respondWithStatusCode(_0x163eb6,_0x3a64d0){_0x3a64d0=_0x3a64d0||0xcc;return function(_0x42887e){if(_0x42887e){return _0x163eb6[_0x7298('0x2a')](_0x3a64d0);}return _0x163eb6[_0x7298('0x2b')](_0x3a64d0)[_0x7298('0x2c')]();};}function respondWithResult(_0xf2104b,_0x1df152){_0x1df152=_0x1df152||0xc8;return function(_0x2dfef3){if(_0x2dfef3){return _0xf2104b[_0x7298('0x2b')](_0x1df152)[_0x7298('0x2d')](_0x2dfef3);}};}function respondWithFilteredResult(_0x8dec6a,_0x24b163){return function(_0x392a43){if(_0x392a43){var _0x2af10a=_0x392a43[_0x7298('0x2e')],_0x2c9e4d=_0x24b163[_0x7298('0x2f')],_0x9e7971=_0x24b163[_0x7298('0x2f')]+_0x24b163[_0x7298('0x30')],_0x3ccb99;if(_0x9e7971>=_0x2af10a){_0x9e7971=_0x2af10a;_0x3ccb99=0xc8;}else{_0x3ccb99=0xce;}_0x8dec6a['status'](_0x3ccb99);return _0x8dec6a['set'](_0x7298('0x31'),_0x2c9e4d+'-'+_0x9e7971+'/'+_0x2af10a)[_0x7298('0x2d')](_0x392a43);}return null;};}function patchUpdates(_0x226534){return function(_0x188fd6){try{jsonpatch[_0x7298('0x32')](_0x188fd6,_0x226534,!![]);}catch(_0x15887c){return BPromise[_0x7298('0x33')](_0x15887c);}return _0x188fd6[_0x7298('0x34')]();};}function saveUpdates(_0x1116aa,_0x4f91aa){return function(_0x282fdc){if(_0x282fdc){return _0x282fdc['update'](_0x1116aa)['then'](function(_0x34428a){return _0x34428a;});}return null;};}function removeEntity(_0x4ed628,_0x3e967b){return function(_0x4c543b){if(_0x4c543b){return _0x4c543b['destroy']()[_0x7298('0x35')](function(){_0x4ed628[_0x7298('0x2b')](0xcc)[_0x7298('0x2c')]();});}};}function handleEntityNotFound(_0x23f01f,_0x3121b9){return function(_0x369446){if(!_0x369446){_0x23f01f[_0x7298('0x2a')](0x194);}return _0x369446;};}function handleError(_0x2519b,_0xa83cd4){_0xa83cd4=_0xa83cd4||0x1f4;return function(_0x35cfc2){logger['error'](_0x35cfc2[_0x7298('0x36')]);if(_0x35cfc2[_0x7298('0x37')]){delete _0x35cfc2[_0x7298('0x37')];}_0x2519b[_0x7298('0x2b')](_0xa83cd4)[_0x7298('0x38')](_0x35cfc2);};}exports['index']=function(_0x506ea4,_0x311c94){var _0x47c0a9={},_0x33f012={},_0x1fdc34={'count':0x0,'rows':[]};var _0x1fc23c=_[_0x7298('0x39')](db['SalesforceAccount']['rawAttributes'],function(_0x336859){return{'name':_0x336859[_0x7298('0x3a')],'type':_0x336859[_0x7298('0x3b')][_0x7298('0x3c')]};});_0x33f012[_0x7298('0x3d')]=_['map'](_0x1fc23c,_0x7298('0x37'));_0x33f012[_0x7298('0x3e')]=_['keys'](_0x506ea4['query']);_0x33f012[_0x7298('0x3f')]=_[_0x7298('0x40')](_0x33f012[_0x7298('0x3d')],_0x33f012[_0x7298('0x3e')]);_0x47c0a9['attributes']=_[_0x7298('0x40')](_0x33f012[_0x7298('0x3d')],qs[_0x7298('0x41')](_0x506ea4[_0x7298('0x3e')][_0x7298('0x41')]));_0x47c0a9[_0x7298('0x42')]=_0x47c0a9['attributes'][_0x7298('0x43')]?_0x47c0a9[_0x7298('0x42')]:_0x33f012['model'];if(!_0x506ea4['query'][_0x7298('0x44')](_0x7298('0x45'))){_0x47c0a9['limit']=qs[_0x7298('0x30')](_0x506ea4[_0x7298('0x3e')][_0x7298('0x30')]);_0x47c0a9['offset']=qs[_0x7298('0x2f')](_0x506ea4[_0x7298('0x3e')]['offset']);}_0x47c0a9[_0x7298('0x46')]=qs[_0x7298('0x47')](_0x506ea4['query'][_0x7298('0x47')]);_0x47c0a9[_0x7298('0x48')]=qs[_0x7298('0x3f')](_[_0x7298('0x49')](_0x506ea4[_0x7298('0x3e')],_0x33f012[_0x7298('0x3f')]),_0x1fc23c);if(_0x506ea4[_0x7298('0x3e')][_0x7298('0x4a')]){_0x47c0a9[_0x7298('0x48')]=_['merge'](_0x47c0a9[_0x7298('0x48')],{'$or':_[_0x7298('0x39')](_0x1fc23c,function(_0x4b5c07){if(_0x4b5c07[_0x7298('0x3b')]!=='VIRTUAL'){var _0x22ce41={};_0x22ce41[_0x4b5c07[_0x7298('0x37')]]={'$like':'%'+_0x506ea4[_0x7298('0x3e')][_0x7298('0x4a')]+'%'};return _0x22ce41;}})});}_0x47c0a9=_[_0x7298('0x4b')]({},_0x47c0a9,_0x506ea4[_0x7298('0x4c')]);var _0x4e8c1b={'where':_0x47c0a9[_0x7298('0x48')]};return db[_0x7298('0x4d')][_0x7298('0x2e')](_0x4e8c1b)[_0x7298('0x35')](function(_0x52a23d){_0x1fdc34[_0x7298('0x2e')]=_0x52a23d;if(_0x506ea4[_0x7298('0x3e')][_0x7298('0x4e')]){_0x47c0a9['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x7298('0x4f')](_0x47c0a9);})['then'](function(_0x194e37){_0x1fdc34[_0x7298('0x50')]=_0x194e37;return _0x1fdc34;})[_0x7298('0x35')](respondWithFilteredResult(_0x311c94,_0x47c0a9))[_0x7298('0x29')](handleError(_0x311c94,null));};exports[_0x7298('0x51')]=function(_0x566f70,_0x1872c9){var _0x347d96={'raw':![],'where':{'id':_0x566f70[_0x7298('0x52')]['id']}},_0x22d0e8={};_0x22d0e8[_0x7298('0x3d')]=_[_0x7298('0x53')](db[_0x7298('0x4d')][_0x7298('0x54')]);_0x22d0e8[_0x7298('0x3e')]=_[_0x7298('0x53')](_0x566f70[_0x7298('0x3e')]);_0x22d0e8[_0x7298('0x3f')]=_['intersection'](_0x22d0e8[_0x7298('0x3d')],_0x22d0e8[_0x7298('0x3e')]);_0x347d96[_0x7298('0x42')]=_[_0x7298('0x40')](_0x22d0e8[_0x7298('0x3d')],qs[_0x7298('0x41')](_0x566f70[_0x7298('0x3e')][_0x7298('0x41')]));_0x347d96['attributes']=_0x347d96[_0x7298('0x42')][_0x7298('0x43')]?_0x347d96[_0x7298('0x42')]:_0x22d0e8[_0x7298('0x3d')];if(_0x566f70[_0x7298('0x3e')][_0x7298('0x4e')]){_0x347d96[_0x7298('0x55')]=[{'all':!![]}];}_0x347d96=_[_0x7298('0x4b')]({},_0x347d96,_0x566f70[_0x7298('0x4c')]);return db[_0x7298('0x4d')][_0x7298('0x56')](_0x347d96)[_0x7298('0x35')](handleEntityNotFound(_0x1872c9,null))['then'](respondWithResult(_0x1872c9,null))[_0x7298('0x29')](handleError(_0x1872c9,null));};exports[_0x7298('0x57')]=function(_0x44c00f,_0x1d66bb){return db[_0x7298('0x4d')][_0x7298('0x57')](_0x44c00f[_0x7298('0x58')],{})[_0x7298('0x35')](respondWithResult(_0x1d66bb,0xc9))[_0x7298('0x29')](handleError(_0x1d66bb,null));};exports['update']=function(_0x442984,_0x22b262){if(_0x442984['body']['id']){delete _0x442984[_0x7298('0x58')]['id'];}return db[_0x7298('0x4d')][_0x7298('0x56')]({'where':{'id':_0x442984[_0x7298('0x52')]['id']}})[_0x7298('0x35')](handleEntityNotFound(_0x22b262,null))['then'](saveUpdates(_0x442984['body'],null))[_0x7298('0x35')](respondWithResult(_0x22b262,null))['catch'](handleError(_0x22b262,null));};exports[_0x7298('0x59')]=function(_0x49e2bd,_0x273831){return db[_0x7298('0x4d')][_0x7298('0x56')]({'where':{'id':_0x49e2bd[_0x7298('0x52')]['id']}})['then'](handleEntityNotFound(_0x273831,null))['then'](removeEntity(_0x273831,null))[_0x7298('0x29')](handleError(_0x273831,null));};exports[_0x7298('0x5a')]=function(_0x53f91b,_0x320212,_0x4cb863){var _0xf3b0eb={};var _0x42697e={};var _0x461731;var _0x18fec0;return db['SalesforceAccount']['findOne']({'where':{'id':_0x53f91b['params']['id']}})[_0x7298('0x35')](handleEntityNotFound(_0x320212,null))[_0x7298('0x35')](function(_0x294e6e){if(_0x294e6e){_0x461731=_0x294e6e;_0x42697e[_0x7298('0x3d')]=_['keys'](db[_0x7298('0x5b')][_0x7298('0x54')]);_0x42697e[_0x7298('0x3e')]=_[_0x7298('0x53')](_0x53f91b['query']);_0x42697e['filters']=_[_0x7298('0x40')](_0x42697e['model'],_0x42697e[_0x7298('0x3e')]);_0xf3b0eb['attributes']=_[_0x7298('0x40')](_0x42697e[_0x7298('0x3d')],qs[_0x7298('0x41')](_0x53f91b['query']['fields']));_0xf3b0eb[_0x7298('0x42')]=_0xf3b0eb[_0x7298('0x42')][_0x7298('0x43')]?_0xf3b0eb[_0x7298('0x42')]:_0x42697e['model'];_0xf3b0eb['order']=qs[_0x7298('0x47')](_0x53f91b['query']['sort']);_0xf3b0eb['where']=qs[_0x7298('0x3f')](_[_0x7298('0x49')](_0x53f91b[_0x7298('0x3e')],_0x42697e[_0x7298('0x3f')]));if(_0x53f91b['query']['filter']){_0xf3b0eb[_0x7298('0x48')]=_[_0x7298('0x4b')](_0xf3b0eb[_0x7298('0x48')],{'$or':_[_0x7298('0x39')](_0xf3b0eb[_0x7298('0x42')],function(_0x3f9502){var _0x346228={};_0x346228[_0x3f9502]={'$like':'%'+_0x53f91b['query']['filter']+'%'};return _0x346228;})});}_0xf3b0eb=_[_0x7298('0x4b')]({},_0xf3b0eb,_0x53f91b['options']);return _0x461731['getConfigurations'](_0xf3b0eb);}})[_0x7298('0x35')](function(_0x37dd60){if(_0x37dd60){_0x18fec0=_0x37dd60['length'];if(!_0x53f91b[_0x7298('0x3e')][_0x7298('0x44')]('nolimit')){_0xf3b0eb['limit']=qs[_0x7298('0x30')](_0x53f91b['query'][_0x7298('0x30')]);_0xf3b0eb['offset']=qs['offset'](_0x53f91b[_0x7298('0x3e')][_0x7298('0x2f')]);}return _0x461731[_0x7298('0x5a')](_0xf3b0eb);}})[_0x7298('0x35')](function(_0x1701b7){if(_0x1701b7){return _0x1701b7?{'count':_0x18fec0,'rows':_0x1701b7}:null;}})[_0x7298('0x35')](respondWithResult(_0x320212,null))[_0x7298('0x29')](handleError(_0x320212,null));};exports[_0x7298('0x5c')]=function(_0xbffb02,_0x552116,_0x55d2a7){if(_0xbffb02['body']['id']){delete _0xbffb02['body']['id'];}return db[_0x7298('0x4d')][_0x7298('0x5d')]({'where':{'id':_0xbffb02[_0x7298('0x52')]['id']}})[_0x7298('0x35')](handleEntityNotFound(_0x552116,null))['then'](function(_0x38279f){if(_0x38279f){_0xbffb02[_0x7298('0x58')][_0x7298('0x5e')]=_0x38279f['id'];_0xbffb02[_0x7298('0x58')][_0x7298('0x5f')]=integrations['getSubjects'](_0xbffb02[_0x7298('0x58')][_0x7298('0x60')],_0xbffb02[_0x7298('0x58')][_0x7298('0x3b')]);_0xbffb02[_0x7298('0x58')][_0x7298('0x61')]=integrations[_0x7298('0x62')](_0xbffb02[_0x7298('0x58')]['channel'],_0xbffb02[_0x7298('0x58')][_0x7298('0x3b')]);return db['SalesforceConfiguration']['create'](_0xbffb02[_0x7298('0x58')],{'include':[{'model':db[_0x7298('0x63')],'as':_0x7298('0x5f')},{'model':db['SalesforceField'],'as':_0x7298('0x61')}]});}return null;})[_0x7298('0x35')](respondWithResult(_0x552116,null))[_0x7298('0x29')](handleError(_0x552116,null));};exports[_0x7298('0x64')]=function(_0x4a6e9a,_0xe4a2e9,_0x16a939){var _0x81e8e0;var _0x41699f='';var _0x24706d=_0x7298('0x65');return db[_0x7298('0x4d')][_0x7298('0x5d')]({'where':{'id':_0x4a6e9a[_0x7298('0x52')]['id']},'attributes':['id','remoteUri',_0x7298('0x66'),_0x7298('0x67'),'username',_0x7298('0x68'),_0x7298('0x69')]})[_0x7298('0x35')](handleEntityNotFound(_0xe4a2e9,null))[_0x7298('0x35')](function(_0xd009b1){if(_0xd009b1){_0x41699f=_0xd009b1[_0x7298('0x6a')];var _0x5533fd=_0x41699f[_0x7298('0x6b')](-0x1);if(_0x5533fd==='/'){_0x41699f=_0x41699f[_0x7298('0x6c')](0x0,_0x41699f['lastIndexOf'](_0x5533fd));}_0x81e8e0=new jsforce[(_0x7298('0x6d'))]({'oauth2':{'loginUrl':_0x41699f,'clientId':_0xd009b1['clientId'],'clientSecret':_0xd009b1[_0x7298('0x67')]}});return _0x81e8e0[_0x7298('0x6e')](_0xd009b1['username'],_0xd009b1['password'][_0x7298('0x6f')](_0xd009b1['securityToken']));}})[_0x7298('0x35')](function(_0x9e63cb){if(_0x9e63cb){if(!_['isNil'](_0x4a6e9a[_0x7298('0x3e')]['ticketType'])){_0x24706d=_0x4a6e9a['query'][_0x7298('0x70')];}return _0x81e8e0[_0x7298('0x71')](_0x24706d)[_0x7298('0x72')]();}})['then'](function(_0x9a4566){var _0x5b916d=[_0x7298('0x73'),'CallDurationInSeconds',_0x7298('0x74'),_0x7298('0x75'),_0x7298('0x76'),_0x7298('0x77'),_0x7298('0x78'),_0x7298('0x79')];if(!_[_0x7298('0x7a')](_0x4a6e9a[_0x7298('0x3e')]['ticketType'])&&_0x4a6e9a[_0x7298('0x3e')][_0x7298('0x70')]===_0x7298('0x7b')){_0x5b916d=['Type','Origin',_0x7298('0x7c'),_0x7298('0x78'),_0x7298('0x77'),_0x7298('0x7d'),_0x7298('0x7e'),_0x7298('0x7f')];}if(_0x9a4566){_[_0x7298('0x80')](_0x9a4566[_0x7298('0x41')],function(_0x664ad8){return _0x664ad8[_0x7298('0x81')]===![]&&!_0x5b916d[_0x7298('0x82')](_0x664ad8[_0x7298('0x37')]);});return{'count':_0x9a4566['fields'][_0x7298('0x43')],'rows':_[_0x7298('0x39')](_0x9a4566[_0x7298('0x41')],function(_0x4e6e9f){return{'id':_0x4e6e9f[_0x7298('0x37')],'name':_0x4e6e9f[_0x7298('0x83')],'custom':_0x4e6e9f[_0x7298('0x81')],'options':_0x4e6e9f[_0x7298('0x84')][_0x7298('0x43')]>0x0?_[_0x7298('0x39')](_0x4e6e9f[_0x7298('0x84')],function(_0x372968){return{'name':_0x372968['label'],'value':_0x372968[_0x7298('0x85')]};}):_0x4e6e9f[_0x7298('0x3b')]==_0x7298('0x86')?[{'name':_0x7298('0x87'),'value':_0x7298('0x88')},{'name':_0x7298('0x89'),'value':_0x7298('0x8a')}]:[]};})};}})[_0x7298('0x35')](respondWithResult(_0xe4a2e9,null))[_0x7298('0x29')](function(_0x37f4c6){var _0x2565c8=_0x4a6e9a[_0x7298('0x3e')][_0x7298('0x1c')]?0x1f4:_0x37f4c6[_0x7298('0x8b')]||0x1f4;logger[_0x7298('0x26')](_0x7298('0x8c'),_0x7298('0x64'),_0x2565c8,JSON[_0x7298('0x25')](_0x37f4c6));delete _0x37f4c6[_0x7298('0x37')];if(_0x2565c8===0x191){_0x2565c8=0x190;}_0xe4a2e9[_0x7298('0x2b')](_0x2565c8)[_0x7298('0x38')](_0x4a6e9a[_0x7298('0x3e')]['test']?{'message':_0x7298('0x8d'),'statusCode':_0x37f4c6['statusCode']}:_0x37f4c6);});};
\ No newline at end of file
index 32e999e..395505c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6858=['int_salesforce_accounts','lodash','../../config/logger','api','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount'];(function(_0x541bda,_0x6766fa){var _0x5354cd=function(_0x2d9c1d){while(--_0x2d9c1d){_0x541bda['push'](_0x541bda['shift']());}};_0x5354cd(++_0x6766fa);}(_0x6858,0x1a3));var _0x8685=function(_0x4a9936,_0x27a14a){_0x4a9936=_0x4a9936-0x0;var _0x38902a=_0x6858[_0x4a9936];return _0x38902a;};'use strict';var _=require(_0x8685('0x0'));var util=require('util');var logger=require(_0x8685('0x1'))(_0x8685('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8685('0x3'));var rimraf=require(_0x8685('0x4'));var config=require(_0x8685('0x5'));var attributes=require(_0x8685('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x8685('0x7')]=function(_0x2a0279,_0x2282f4){return _0x2a0279[_0x8685('0x8')](_0x8685('0x9'),attributes,{'tableName':_0x8685('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdde=['../../config/logger','api','moment','bluebird','request-promise','path','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts','lodash','util'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xfdde,0x12a));var _0xefdd=function(_0x1c6c5c,_0xba1097){_0x1c6c5c=_0x1c6c5c-0x0;var _0x17d772=_0xfdde[_0x1c6c5c];return _0x17d772;};'use strict';var _=require(_0xefdd('0x0'));var util=require(_0xefdd('0x1'));var logger=require(_0xefdd('0x2'))(_0xefdd('0x3'));var moment=require(_0xefdd('0x4'));var BPromise=require(_0xefdd('0x5'));var rp=require(_0xefdd('0x6'));var fs=require('fs');var path=require(_0xefdd('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xefdd('0x8'));var integrations=require(_0xefdd('0x9'));module[_0xefdd('0xa')]=function(_0x298427,_0x2d4ca9){return _0x298427['define']('SalesforceAccount',attributes,{'tableName':_0xefdd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e9d1e3f..0e5a682 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde2c=['findAll','options','raw','where','limit','include','model','attributes','GetSalesforceAccount','stringify','find','map','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','SalesforceAccount'];(function(_0x562fc8,_0x2ff988){var _0x4b42d8=function(_0x4dde26){while(--_0x4dde26){_0x562fc8['push'](_0x562fc8['shift']());}};_0x4b42d8(++_0x2ff988);}(_0xde2c,0x7f));var _0xcde2=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0xde2c[_0x308213];return _0x2e1619;};'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});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});}exports['GetSalesforceAccount']=function(_0x4fd5aa){var _0x4fe586=this;return new Promise(function(_0x2b4468,_0x582e84){return db[_0xcde2('0x18')][_0xcde2('0x19')]({'raw':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options'][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1c')]||null:null,'attributes':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options']['attributes']||null:null,'limit':_0x4fd5aa['options']?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1d')]||null:null,'include':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1e')]?_['map'](_0x4fd5aa[_0xcde2('0x1a')]['include'],function(_0x280d8c){return{'model':db[_0x280d8c[_0xcde2('0x1f')]],'as':_0x280d8c['as'],'attributes':_0x280d8c[_0xcde2('0x20')],'include':_0x280d8c['include']?_['map'](_0x280d8c[_0xcde2('0x1e')],function(_0x207a12){return{'model':db[_0x207a12[_0xcde2('0x1f')]],'as':_0x207a12['as'],'attributes':_0x207a12[_0xcde2('0x20')],'include':_0x207a12[_0xcde2('0x1e')]?_['map'](_0x207a12[_0xcde2('0x1e')],function(_0x45275a){return{'model':db[_0x45275a[_0xcde2('0x1f')]],'as':_0x45275a['as'],'attributes':_0x45275a['attributes']};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x348ca1){logger[_0xcde2('0x15')](_0xcde2('0x21'),_0x4fd5aa);logger[_0xcde2('0x10')](_0xcde2('0x21'),_0x4fd5aa,JSON[_0xcde2('0x22')](_0x348ca1));_0x2b4468(_0x348ca1);})[_0xcde2('0x17')](function(_0x5bf1e6){logger[_0xcde2('0x12')]('GetSalesforceAccount',_0x5bf1e6[_0xcde2('0x14')],_0x4fd5aa);_0x582e84(_0x4fe586[_0xcde2('0x12')](0x1f4,_0x5bf1e6[_0xcde2('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0xae46dc){var _0x28fedd=this;return new Promise(function(_0x58afb1,_0x26ec42){return db[_0xcde2('0x18')][_0xcde2('0x23')]({'raw':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')]['where']||null:null,'attributes':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x20')]||null:null,'include':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc['options'][_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1e')],function(_0x498339){return{'model':db[_0x498339[_0xcde2('0x1f')]],'as':_0x498339['as'],'attributes':_0x498339[_0xcde2('0x20')],'include':_0x498339[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0x498339['include'],function(_0xb9c8d2){return{'model':db[_0xb9c8d2[_0xcde2('0x1f')]],'as':_0xb9c8d2['as'],'attributes':_0xb9c8d2[_0xcde2('0x20')],'include':_0xb9c8d2[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xb9c8d2['include'],function(_0x2cd313){return{'model':db[_0x2cd313[_0xcde2('0x1f')]],'as':_0x2cd313['as'],'attributes':_0x2cd313[_0xcde2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x4a64c1){logger['info'](_0xcde2('0x25'),_0xae46dc);logger[_0xcde2('0x10')](_0xcde2('0x25'),_0xae46dc,JSON[_0xcde2('0x22')](_0x4a64c1));_0x58afb1(_0x4a64c1);})[_0xcde2('0x17')](function(_0x45af6e){logger[_0xcde2('0x12')](_0xcde2('0x25'),_0x45af6e[_0xcde2('0x14')],_0xae46dc);_0x26ec42(_0x28fedd['error'](0x1f4,_0x45af6e[_0xcde2('0x14')]));});});};
\ No newline at end of file
+var _0xcea2=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','SalesforceAccount','findAll','options','where','attributes','limit','map','include','model','then','GetSalesforceAccount','ShowSalesforceAccount','find','raw','lodash','moment','randomstring','ioredis'];(function(_0x32f120,_0x114c35){var _0x19b8f7=function(_0x4c489a){while(--_0x4c489a){_0x32f120['push'](_0x32f120['shift']());}};_0x19b8f7(++_0x114c35);}(_0xcea2,0x15a));var _0x2cea=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xcea2[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var moment=require(_0x2cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cea('0x2'));var fs=require('fs');var Redis=require(_0x2cea('0x3'));var db=require(_0x2cea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cea('0x5'))(_0x2cea('0x6'));var config=require(_0x2cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d69ff,_0xc04963,_0x805a1b){return new BPromise(function(_0x160cca,_0x11c5c0){return client[_0x2cea('0x9')](_0x2d69ff,_0x805a1b)['then'](function(_0x1f4d90){logger[_0x2cea('0xa')](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));logger[_0x2cea('0xd')](_0x2cea('0xe'),_0xc04963,_0x2cea('0xc'),JSON[_0x2cea('0xf')](_0x1f4d90));if(_0x1f4d90['error']){if(_0x1f4d90['error'][_0x2cea('0x10')]===0x1f4){logger[_0x2cea('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0xc04963,_0x1f4d90['error'][_0x2cea('0x12')]);return _0x11c5c0(_0x1f4d90['error'][_0x2cea('0x12')]);}logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1f4d90['error']['message']);return _0x160cca(_0x1f4d90['error'][_0x2cea('0x12')]);}else{logger['info'](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));_0x160cca(_0x1f4d90[_0x2cea('0x13')][_0x2cea('0x12')]);}})[_0x2cea('0x14')](function(_0x1bbfdb){logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1bbfdb);_0x11c5c0(_0x1bbfdb);});});}exports['GetSalesforceAccount']=function(_0x19927a){var _0x464f7d=this;return new Promise(function(_0x20c46c,_0x43ae15){return db[_0x2cea('0x15')][_0x2cea('0x16')]({'raw':_0x19927a['options']?_0x19927a[_0x2cea('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')][_0x2cea('0x18')]||null:null,'attributes':_0x19927a['options']?_0x19927a[_0x2cea('0x17')][_0x2cea('0x19')]||null:null,'limit':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')][_0x2cea('0x1a')]||null:null,'include':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')]['include']?_[_0x2cea('0x1b')](_0x19927a['options'][_0x2cea('0x1c')],function(_0x4926ff){return{'model':db[_0x4926ff[_0x2cea('0x1d')]],'as':_0x4926ff['as'],'attributes':_0x4926ff[_0x2cea('0x19')],'include':_0x4926ff['include']?_[_0x2cea('0x1b')](_0x4926ff[_0x2cea('0x1c')],function(_0x101314){return{'model':db[_0x101314[_0x2cea('0x1d')]],'as':_0x101314['as'],'attributes':_0x101314[_0x2cea('0x19')],'include':_0x101314[_0x2cea('0x1c')]?_['map'](_0x101314[_0x2cea('0x1c')],function(_0x32b6a3){return{'model':db[_0x32b6a3[_0x2cea('0x1d')]],'as':_0x32b6a3['as'],'attributes':_0x32b6a3[_0x2cea('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2cea('0x1e')](function(_0x3ea40c){logger[_0x2cea('0xa')](_0x2cea('0x1f'),_0x19927a);logger['debug'](_0x2cea('0x1f'),_0x19927a,JSON[_0x2cea('0xf')](_0x3ea40c));_0x20c46c(_0x3ea40c);})['catch'](function(_0xfeb8bd){logger[_0x2cea('0x11')](_0x2cea('0x1f'),_0xfeb8bd[_0x2cea('0x12')],_0x19927a);_0x43ae15(_0x464f7d['error'](0x1f4,_0xfeb8bd[_0x2cea('0x12')]));});});};exports[_0x2cea('0x20')]=function(_0x4a51e5){var _0x2bf4e9=this;return new Promise(function(_0x2e3d44,_0xa8f660){return db[_0x2cea('0x15')][_0x2cea('0x21')]({'raw':_0x4a51e5[_0x2cea('0x17')]?_0x4a51e5[_0x2cea('0x17')][_0x2cea('0x22')]===undefined?!![]:![]:!![],'where':_0x4a51e5[_0x2cea('0x17')]?_0x4a51e5[_0x2cea('0x17')][_0x2cea('0x18')]||null:null,'attributes':_0x4a51e5['options']?_0x4a51e5[_0x2cea('0x17')][_0x2cea('0x19')]||null:null,'include':_0x4a51e5[_0x2cea('0x17')]?_0x4a51e5[_0x2cea('0x17')]['include']?_['map'](_0x4a51e5[_0x2cea('0x17')][_0x2cea('0x1c')],function(_0x5eefbf){return{'model':db[_0x5eefbf[_0x2cea('0x1d')]],'as':_0x5eefbf['as'],'attributes':_0x5eefbf['attributes'],'include':_0x5eefbf[_0x2cea('0x1c')]?_['map'](_0x5eefbf[_0x2cea('0x1c')],function(_0x5bd36b){return{'model':db[_0x5bd36b[_0x2cea('0x1d')]],'as':_0x5bd36b['as'],'attributes':_0x5bd36b[_0x2cea('0x19')],'include':_0x5bd36b['include']?_[_0x2cea('0x1b')](_0x5bd36b[_0x2cea('0x1c')],function(_0x55b4d1){return{'model':db[_0x55b4d1[_0x2cea('0x1d')]],'as':_0x55b4d1['as'],'attributes':_0x55b4d1[_0x2cea('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2cea('0x1e')](function(_0x3c9f6e){logger[_0x2cea('0xa')]('ShowSalesforceAccount',_0x4a51e5);logger[_0x2cea('0xd')](_0x2cea('0x20'),_0x4a51e5,JSON['stringify'](_0x3c9f6e));_0x2e3d44(_0x3c9f6e);})['catch'](function(_0x1913a2){logger['error']('ShowSalesforceAccount',_0x1913a2['message'],_0x4a51e5);_0xa8f660(_0x2bf4e9['error'](0x1f4,_0x1913a2[_0x2cea('0x12')]));});});};
\ No newline at end of file
index 544ad0a..9a6d23a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd35d=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x6a734c,_0x1b2d9f){var _0x494d0d=function(_0x36fd39){while(--_0x36fd39){_0x6a734c['push'](_0x6a734c['shift']());}};_0x494d0d(++_0x1b2d9f);}(_0xd35d,0xb2));var _0xdd35=function(_0x4fb1b8,_0x32d98d){_0x4fb1b8=_0x4fb1b8-0x0;var _0x146c71=_0xd35d[_0x4fb1b8];return _0x146c71;};'use strict';var multer=require(_0xdd35('0x0'));var util=require('util');var path=require(_0xdd35('0x1'));var timeout=require(_0xdd35('0x2'));var express=require(_0xdd35('0x3'));var router=express[_0xdd35('0x4')]();var auth=require(_0xdd35('0x5'));var interaction=require(_0xdd35('0x6'));var config=require('../../config/environment');var controller=require(_0xdd35('0x7'));router['get']('/',auth[_0xdd35('0x8')](),controller[_0xdd35('0x9')]);router[_0xdd35('0xa')](_0xdd35('0xb'),auth[_0xdd35('0x8')](),controller[_0xdd35('0xc')]);router['get'](_0xdd35('0xd'),auth[_0xdd35('0x8')](),controller[_0xdd35('0xe')]);router[_0xdd35('0xa')](_0xdd35('0xf'),auth[_0xdd35('0x8')](),controller['getSubjects']);router[_0xdd35('0xa')](_0xdd35('0x10'),auth[_0xdd35('0x8')](),controller[_0xdd35('0x11')]);router[_0xdd35('0x12')]('/',auth[_0xdd35('0x8')](),controller[_0xdd35('0x13')]);router[_0xdd35('0x14')](_0xdd35('0xb'),auth[_0xdd35('0x8')](),controller[_0xdd35('0x15')]);router[_0xdd35('0x16')](_0xdd35('0xb'),auth[_0xdd35('0x8')](),controller[_0xdd35('0x17')]);module[_0xdd35('0x18')]=router;
\ No newline at end of file
+var _0x7a35=['./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x7a35,0x173));var _0x57a3=function(_0x3dee92,_0x55e1eb){_0x3dee92=_0x3dee92-0x0;var _0x44d36e=_0x7a35[_0x3dee92];return _0x44d36e;};'use strict';var multer=require('multer');var util=require(_0x57a3('0x0'));var path=require(_0x57a3('0x1'));var timeout=require(_0x57a3('0x2'));var express=require(_0x57a3('0x3'));var router=express[_0x57a3('0x4')]();var auth=require(_0x57a3('0x5'));var interaction=require(_0x57a3('0x6'));var config=require('../../config/environment');var controller=require(_0x57a3('0x7'));router[_0x57a3('0x8')]('/',auth[_0x57a3('0x9')](),controller[_0x57a3('0xa')]);router[_0x57a3('0x8')]('/:id',auth[_0x57a3('0x9')](),controller['show']);router[_0x57a3('0x8')](_0x57a3('0xb'),auth[_0x57a3('0x9')](),controller[_0x57a3('0xc')]);router[_0x57a3('0x8')]('/:id/subjects',auth[_0x57a3('0x9')](),controller[_0x57a3('0xd')]);router[_0x57a3('0x8')](_0x57a3('0xe'),auth[_0x57a3('0x9')](),controller[_0x57a3('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x57a3('0x10')]);router[_0x57a3('0x11')](_0x57a3('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x57a3('0x12'),auth[_0x57a3('0x9')](),controller[_0x57a3('0x13')]);module[_0x57a3('0x14')]=router;
\ No newline at end of file
index 6ab956f..e8c56ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e4c=['Task','Case','contact_lead','contact','lead','sequelize','exports','STRING','ENUM'];(function(_0x34d54b,_0x7f385b){var _0x358b89=function(_0x2b1f97){while(--_0x2b1f97){_0x34d54b['push'](_0x34d54b['shift']());}};_0x358b89(++_0x7f385b);}(_0x9e4c,0x83));var _0xc9e4=function(_0x1341ed,_0x299ddd){_0x1341ed=_0x1341ed-0x0;var _0x56365d=_0x9e4c[_0x1341ed];return _0x56365d;};'use strict';var Sequelize=require(_0xc9e4('0x0'));module[_0xc9e4('0x1')]={'name':{'type':Sequelize[_0xc9e4('0x2')]},'description':{'type':Sequelize[_0xc9e4('0x2')]},'ticketType':{'type':Sequelize[_0xc9e4('0x3')](_0xc9e4('0x4'),_0xc9e4('0x5')),'defaultValue':_0xc9e4('0x4')},'moduleSearch':{'type':Sequelize[_0xc9e4('0x3')](_0xc9e4('0x6'),_0xc9e4('0x7'),_0xc9e4('0x8')),'defaultValue':_0xc9e4('0x6')},'moduleCreate':{'type':Sequelize[_0xc9e4('0x3')]('nothing','contact','lead'),'defaultValue':_0xc9e4('0x8')}};
\ No newline at end of file
+var _0x7de2=['Task','ENUM','contact_lead','contact','lead','nothing','sequelize','exports'];(function(_0x47dd33,_0x4d77dc){var _0x56ef95=function(_0x51726a){while(--_0x51726a){_0x47dd33['push'](_0x47dd33['shift']());}};_0x56ef95(++_0x4d77dc);}(_0x7de2,0x126));var _0x27de=function(_0x5a84af,_0x1639ea){_0x5a84af=_0x5a84af-0x0;var _0x490774=_0x7de2[_0x5a84af];return _0x490774;};'use strict';var Sequelize=require(_0x27de('0x0'));module[_0x27de('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x27de('0x2'),'Case'),'defaultValue':_0x27de('0x2')},'moduleSearch':{'type':Sequelize[_0x27de('0x3')](_0x27de('0x4'),_0x27de('0x5'),_0x27de('0x6')),'defaultValue':_0x27de('0x4')},'moduleCreate':{'type':Sequelize[_0x27de('0x3')](_0x27de('0x7'),_0x27de('0x5'),_0x27de('0x6')),'defaultValue':_0x27de('0x6')}};
\ No newline at end of file
index 0b0e6d7..a1d6b9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ebb=['findAll','show','params','rawAttributes','intersection','create','body','update','find','getFields','hasOwnProperty','findOne','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','status','end','json','offset','limit','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','map','SalesforceConfiguration','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x6ebb,0xcc));var _0xb6eb=function(_0x16cb60,_0x4b17d2){_0x16cb60=_0x16cb60-0x0;var _0x474035=_0x6ebb[_0x16cb60];return _0x474035;};'use strict';var pdf=require(_0xb6eb('0x0'));var emlformat=require(_0xb6eb('0x1'));var rimraf=require(_0xb6eb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb6eb('0x3'));var rp=require(_0xb6eb('0x4'));var moment=require(_0xb6eb('0x5'));var BPromise=require(_0xb6eb('0x6'));var Mustache=require(_0xb6eb('0x7'));var util=require('util');var path=require(_0xb6eb('0x8'));var sox=require(_0xb6eb('0x9'));var csv=require(_0xb6eb('0xa'));var ejs=require(_0xb6eb('0xb'));var fs=require('fs');var _=require(_0xb6eb('0xc'));var squel=require('squel');var crypto=require(_0xb6eb('0xd'));var jsforce=require(_0xb6eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb6eb('0xa'));var querystring=require(_0xb6eb('0xf'));var Papa=require(_0xb6eb('0x10'));var Redis=require(_0xb6eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb6eb('0x12'));var as=require(_0xb6eb('0x13'));var hardwareService=require(_0xb6eb('0x14'));var logger=require(_0xb6eb('0x15'))(_0xb6eb('0x16'));var utils=require(_0xb6eb('0x17'));var config=require(_0xb6eb('0x18'));var db=require(_0xb6eb('0x19'))['db'];var jayson=require(_0xb6eb('0x1a'));var client=jayson[_0xb6eb('0x1b')][_0xb6eb('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x566fa4,_0x2c9cd1,_0x564d26){if(_0x564d26){var _0x2ae78d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ae78d['test'](_0x2c9cd1)){return _0x566fa4;}else{throw new db[(_0xb6eb('0x1d'))][(_0xb6eb('0x1e'))](_0xb6eb('0x1f'));}}else{return _0x566fa4;}}function respondWithRpcPromise(_0x1a1904,_0x23ee66,_0x530ec7,_0x6872dc){return new BPromise(function(_0x505e30,_0xb8b7b1){var _0x83c9dc=_0x6872dc||client;return _0x83c9dc[_0xb6eb('0x20')](_0x1a1904,_0x530ec7)[_0xb6eb('0x21')](function(_0x2a2208){logger['info'](_0xb6eb('0x22'),_0x23ee66,_0xb6eb('0x23'));logger[_0xb6eb('0x24')](_0xb6eb('0x25'),_0x23ee66,_0xb6eb('0x23'),JSON['stringify'](_0x2a2208));if(_0x2a2208[_0xb6eb('0x26')]){if(_0x2a2208[_0xb6eb('0x26')][_0xb6eb('0x27')]===0x1f4){logger[_0xb6eb('0x26')](_0xb6eb('0x22'),_0x23ee66,_0x2a2208[_0xb6eb('0x26')]['message']);return _0xb8b7b1(_0x2a2208['error'][_0xb6eb('0x28')]);}logger['error'](_0xb6eb('0x22'),_0x23ee66,_0x2a2208['error']['message']);return _0x505e30(_0x2a2208[_0xb6eb('0x26')][_0xb6eb('0x28')]);}else{logger[_0xb6eb('0x29')](_0xb6eb('0x22'),_0x23ee66,_0xb6eb('0x23'));_0x505e30(_0x2a2208['result'][_0xb6eb('0x28')]);}})[_0xb6eb('0x2a')](function(_0x42c35a){logger[_0xb6eb('0x26')](_0xb6eb('0x22'),_0x23ee66,_0x42c35a);_0xb8b7b1(_0x42c35a);});});}function respondWithStatusCode(_0x344d4e,_0x49f691){_0x49f691=_0x49f691||0xcc;return function(_0x609f67){if(_0x609f67){return _0x344d4e['sendStatus'](_0x49f691);}return _0x344d4e[_0xb6eb('0x2b')](_0x49f691)[_0xb6eb('0x2c')]();};}function respondWithResult(_0x2d0254,_0x57f154){_0x57f154=_0x57f154||0xc8;return function(_0x3379bb){if(_0x3379bb){return _0x2d0254[_0xb6eb('0x2b')](_0x57f154)[_0xb6eb('0x2d')](_0x3379bb);}};}function respondWithFilteredResult(_0x22f957,_0x12bff3){return function(_0x30929d){if(_0x30929d){var _0x2d210a=_0x30929d['count'],_0x1698bd=_0x12bff3[_0xb6eb('0x2e')],_0x58107a=_0x12bff3[_0xb6eb('0x2e')]+_0x12bff3[_0xb6eb('0x2f')],_0x5cd338;if(_0x58107a>=_0x2d210a){_0x58107a=_0x2d210a;_0x5cd338=0xc8;}else{_0x5cd338=0xce;}_0x22f957['status'](_0x5cd338);return _0x22f957['set'](_0xb6eb('0x30'),_0x1698bd+'-'+_0x58107a+'/'+_0x2d210a)['json'](_0x30929d);}return null;};}function patchUpdates(_0x1f6d81){return function(_0xc32450){try{jsonpatch[_0xb6eb('0x31')](_0xc32450,_0x1f6d81,!![]);}catch(_0x72326d){return BPromise[_0xb6eb('0x32')](_0x72326d);}return _0xc32450[_0xb6eb('0x33')]();};}function saveUpdates(_0xbc85da,_0x750ac2){return function(_0x103ddd){if(_0x103ddd){return _0x103ddd['update'](_0xbc85da)[_0xb6eb('0x21')](function(_0x940980){return _0x940980;});}return null;};}function removeEntity(_0x1accd6,_0x15c04a){return function(_0x1c72fc){if(_0x1c72fc){return _0x1c72fc[_0xb6eb('0x34')]()[_0xb6eb('0x21')](function(){_0x1accd6[_0xb6eb('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25afd1,_0x346a54){return function(_0x51d536){if(!_0x51d536){_0x25afd1[_0xb6eb('0x35')](0x194);}return _0x51d536;};}function handleError(_0x2dee1c,_0x5a08d6){_0x5a08d6=_0x5a08d6||0x1f4;return function(_0x555b4c){logger[_0xb6eb('0x26')](_0x555b4c[_0xb6eb('0x36')]);if(_0x555b4c['name']){delete _0x555b4c[_0xb6eb('0x37')];}_0x2dee1c[_0xb6eb('0x2b')](_0x5a08d6)[_0xb6eb('0x38')](_0x555b4c);};}exports['index']=function(_0x4243c8,_0x436a02){var _0x2f3cab={},_0x410535={},_0x324ca1={'count':0x0,'rows':[]};var _0x39283a=_[_0xb6eb('0x39')](db[_0xb6eb('0x3a')]['rawAttributes'],function(_0x3741ad){return{'name':_0x3741ad[_0xb6eb('0x3b')],'type':_0x3741ad['type'][_0xb6eb('0x3c')]};});_0x410535[_0xb6eb('0x3d')]=_[_0xb6eb('0x39')](_0x39283a,_0xb6eb('0x37'));_0x410535[_0xb6eb('0x3e')]=_[_0xb6eb('0x3f')](_0x4243c8[_0xb6eb('0x3e')]);_0x410535[_0xb6eb('0x40')]=_['intersection'](_0x410535[_0xb6eb('0x3d')],_0x410535[_0xb6eb('0x3e')]);_0x2f3cab[_0xb6eb('0x41')]=_['intersection'](_0x410535[_0xb6eb('0x3d')],qs[_0xb6eb('0x42')](_0x4243c8[_0xb6eb('0x3e')][_0xb6eb('0x42')]));_0x2f3cab[_0xb6eb('0x41')]=_0x2f3cab['attributes'][_0xb6eb('0x43')]?_0x2f3cab[_0xb6eb('0x41')]:_0x410535[_0xb6eb('0x3d')];if(!_0x4243c8[_0xb6eb('0x3e')]['hasOwnProperty'](_0xb6eb('0x44'))){_0x2f3cab['limit']=qs[_0xb6eb('0x2f')](_0x4243c8[_0xb6eb('0x3e')]['limit']);_0x2f3cab[_0xb6eb('0x2e')]=qs['offset'](_0x4243c8[_0xb6eb('0x3e')][_0xb6eb('0x2e')]);}_0x2f3cab[_0xb6eb('0x45')]=qs[_0xb6eb('0x46')](_0x4243c8[_0xb6eb('0x3e')]['sort']);_0x2f3cab[_0xb6eb('0x47')]=qs['filters'](_[_0xb6eb('0x48')](_0x4243c8['query'],_0x410535[_0xb6eb('0x40')]),_0x39283a);if(_0x4243c8[_0xb6eb('0x3e')][_0xb6eb('0x49')]){_0x2f3cab['where']=_[_0xb6eb('0x4a')](_0x2f3cab[_0xb6eb('0x47')],{'$or':_[_0xb6eb('0x39')](_0x39283a,function(_0x595328){if(_0x595328[_0xb6eb('0x4b')]!==_0xb6eb('0x4c')){var _0x20d79c={};_0x20d79c[_0x595328[_0xb6eb('0x37')]]={'$like':'%'+_0x4243c8[_0xb6eb('0x3e')]['filter']+'%'};return _0x20d79c;}})});}_0x2f3cab=_[_0xb6eb('0x4a')]({},_0x2f3cab,_0x4243c8[_0xb6eb('0x4d')]);var _0x40c89a={'where':_0x2f3cab[_0xb6eb('0x47')]};return db[_0xb6eb('0x3a')]['count'](_0x40c89a)[_0xb6eb('0x21')](function(_0x105a22){_0x324ca1[_0xb6eb('0x4e')]=_0x105a22;if(_0x4243c8[_0xb6eb('0x3e')][_0xb6eb('0x4f')]){_0x2f3cab[_0xb6eb('0x50')]=[{'all':!![]}];}return db[_0xb6eb('0x3a')][_0xb6eb('0x51')](_0x2f3cab);})[_0xb6eb('0x21')](function(_0x4ddb96){_0x324ca1['rows']=_0x4ddb96;return _0x324ca1;})['then'](respondWithFilteredResult(_0x436a02,_0x2f3cab))['catch'](handleError(_0x436a02,null));};exports[_0xb6eb('0x52')]=function(_0x481ec8,_0x1ee7a9){var _0xdbd7c={'raw':![],'where':{'id':_0x481ec8[_0xb6eb('0x53')]['id']}},_0x28905a={};_0x28905a['model']=_[_0xb6eb('0x3f')](db[_0xb6eb('0x3a')][_0xb6eb('0x54')]);_0x28905a[_0xb6eb('0x3e')]=_[_0xb6eb('0x3f')](_0x481ec8['query']);_0x28905a[_0xb6eb('0x40')]=_[_0xb6eb('0x55')](_0x28905a[_0xb6eb('0x3d')],_0x28905a[_0xb6eb('0x3e')]);_0xdbd7c[_0xb6eb('0x41')]=_['intersection'](_0x28905a['model'],qs['fields'](_0x481ec8[_0xb6eb('0x3e')][_0xb6eb('0x42')]));_0xdbd7c['attributes']=_0xdbd7c['attributes'][_0xb6eb('0x43')]?_0xdbd7c[_0xb6eb('0x41')]:_0x28905a[_0xb6eb('0x3d')];if(_0x481ec8[_0xb6eb('0x3e')]['includeAll']){_0xdbd7c[_0xb6eb('0x50')]=[{'all':!![]}];}_0xdbd7c=_['merge']({},_0xdbd7c,_0x481ec8[_0xb6eb('0x4d')]);return db[_0xb6eb('0x3a')]['find'](_0xdbd7c)[_0xb6eb('0x21')](handleEntityNotFound(_0x1ee7a9,null))[_0xb6eb('0x21')](respondWithResult(_0x1ee7a9,null))[_0xb6eb('0x2a')](handleError(_0x1ee7a9,null));};exports[_0xb6eb('0x56')]=function(_0x93e72c,_0x3bae81){return db[_0xb6eb('0x3a')][_0xb6eb('0x56')](_0x93e72c[_0xb6eb('0x57')],{})[_0xb6eb('0x21')](respondWithResult(_0x3bae81,0xc9))['catch'](handleError(_0x3bae81,null));};exports[_0xb6eb('0x58')]=function(_0x2b8173,_0x1c91b0){if(_0x2b8173[_0xb6eb('0x57')]['id']){delete _0x2b8173[_0xb6eb('0x57')]['id'];}return db[_0xb6eb('0x3a')][_0xb6eb('0x59')]({'where':{'id':_0x2b8173[_0xb6eb('0x53')]['id']}})[_0xb6eb('0x21')](handleEntityNotFound(_0x1c91b0,null))[_0xb6eb('0x21')](saveUpdates(_0x2b8173['body'],null))['then'](respondWithResult(_0x1c91b0,null))[_0xb6eb('0x2a')](handleError(_0x1c91b0,null));};exports['destroy']=function(_0x46b198,_0x36f953){return db[_0xb6eb('0x3a')][_0xb6eb('0x59')]({'where':{'id':_0x46b198['params']['id']}})[_0xb6eb('0x21')](handleEntityNotFound(_0x36f953,null))[_0xb6eb('0x21')](removeEntity(_0x36f953,null))[_0xb6eb('0x2a')](handleError(_0x36f953,null));};exports[_0xb6eb('0x5a')]=function(_0x122034,_0x5b80a7,_0x273f0a){var _0x1d7fd9={};var _0x1fae05={};var _0x35dd31;var _0x1f339f;return db[_0xb6eb('0x3a')]['findOne']({'where':{'id':_0x122034[_0xb6eb('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b80a7,null))[_0xb6eb('0x21')](function(_0x568b01){if(_0x568b01){_0x35dd31=_0x568b01;_0x1fae05[_0xb6eb('0x3d')]=_[_0xb6eb('0x3f')](db['SalesforceField']['rawAttributes']);_0x1fae05[_0xb6eb('0x3e')]=_['keys'](_0x122034[_0xb6eb('0x3e')]);_0x1fae05[_0xb6eb('0x40')]=_[_0xb6eb('0x55')](_0x1fae05[_0xb6eb('0x3d')],_0x1fae05['query']);_0x1d7fd9['attributes']=_[_0xb6eb('0x55')](_0x1fae05['model'],qs['fields'](_0x122034[_0xb6eb('0x3e')]['fields']));_0x1d7fd9['attributes']=_0x1d7fd9[_0xb6eb('0x41')]['length']?_0x1d7fd9[_0xb6eb('0x41')]:_0x1fae05[_0xb6eb('0x3d')];_0x1d7fd9['order']=qs[_0xb6eb('0x46')](_0x122034[_0xb6eb('0x3e')]['sort']);_0x1d7fd9['where']=qs['filters'](_[_0xb6eb('0x48')](_0x122034[_0xb6eb('0x3e')],_0x1fae05[_0xb6eb('0x40')]));if(_0x122034[_0xb6eb('0x3e')]['filter']){_0x1d7fd9['where']=_[_0xb6eb('0x4a')](_0x1d7fd9[_0xb6eb('0x47')],{'$or':_['map'](_0x1d7fd9[_0xb6eb('0x41')],function(_0x45b996){var _0x1fdd01={};_0x1fdd01[_0x45b996]={'$like':'%'+_0x122034[_0xb6eb('0x3e')][_0xb6eb('0x49')]+'%'};return _0x1fdd01;})});}_0x1d7fd9=_[_0xb6eb('0x4a')]({},_0x1d7fd9,_0x122034[_0xb6eb('0x4d')]);return _0x35dd31[_0xb6eb('0x5a')](_0x1d7fd9);}})['then'](function(_0x3f43cb){if(_0x3f43cb){_0x1f339f=_0x3f43cb[_0xb6eb('0x43')];if(!_0x122034[_0xb6eb('0x3e')][_0xb6eb('0x5b')](_0xb6eb('0x44'))){_0x1d7fd9[_0xb6eb('0x2f')]=qs[_0xb6eb('0x2f')](_0x122034['query'][_0xb6eb('0x2f')]);_0x1d7fd9['offset']=qs[_0xb6eb('0x2e')](_0x122034[_0xb6eb('0x3e')]['offset']);}return _0x35dd31[_0xb6eb('0x5a')](_0x1d7fd9);}})[_0xb6eb('0x21')](function(_0x344eb8){if(_0x344eb8){return _0x344eb8?{'count':_0x1f339f,'rows':_0x344eb8}:null;}})[_0xb6eb('0x21')](respondWithResult(_0x5b80a7,null))[_0xb6eb('0x2a')](handleError(_0x5b80a7,null));};exports['getSubjects']=function(_0x4ed841,_0x4ed047,_0x76bde7){var _0x534d8e={};var _0x54df25={};var _0x19bc58;var _0x32f12b;return db['SalesforceConfiguration'][_0xb6eb('0x5c')]({'where':{'id':_0x4ed841['params']['id']}})[_0xb6eb('0x21')](handleEntityNotFound(_0x4ed047,null))[_0xb6eb('0x21')](function(_0x1278eb){if(_0x1278eb){_0x19bc58=_0x1278eb;_0x54df25[_0xb6eb('0x3d')]=_[_0xb6eb('0x3f')](db['SalesforceField'][_0xb6eb('0x54')]);_0x54df25[_0xb6eb('0x3e')]=_[_0xb6eb('0x3f')](_0x4ed841[_0xb6eb('0x3e')]);_0x54df25[_0xb6eb('0x40')]=_[_0xb6eb('0x55')](_0x54df25[_0xb6eb('0x3d')],_0x54df25['query']);_0x534d8e[_0xb6eb('0x41')]=_[_0xb6eb('0x55')](_0x54df25['model'],qs['fields'](_0x4ed841[_0xb6eb('0x3e')][_0xb6eb('0x42')]));_0x534d8e[_0xb6eb('0x41')]=_0x534d8e['attributes']['length']?_0x534d8e[_0xb6eb('0x41')]:_0x54df25[_0xb6eb('0x3d')];_0x534d8e[_0xb6eb('0x45')]=qs['sort'](_0x4ed841[_0xb6eb('0x3e')][_0xb6eb('0x46')]);_0x534d8e[_0xb6eb('0x47')]=qs[_0xb6eb('0x40')](_[_0xb6eb('0x48')](_0x4ed841[_0xb6eb('0x3e')],_0x54df25[_0xb6eb('0x40')]));if(_0x4ed841[_0xb6eb('0x3e')]['filter']){_0x534d8e[_0xb6eb('0x47')]=_[_0xb6eb('0x4a')](_0x534d8e[_0xb6eb('0x47')],{'$or':_[_0xb6eb('0x39')](_0x534d8e[_0xb6eb('0x41')],function(_0x43dec4){var _0x1ba658={};_0x1ba658[_0x43dec4]={'$like':'%'+_0x4ed841[_0xb6eb('0x3e')][_0xb6eb('0x49')]+'%'};return _0x1ba658;})});}_0x534d8e=_[_0xb6eb('0x4a')]({},_0x534d8e,_0x4ed841[_0xb6eb('0x4d')]);return _0x19bc58[_0xb6eb('0x5d')](_0x534d8e);}})[_0xb6eb('0x21')](function(_0xedb2bc){if(_0xedb2bc){_0x32f12b=_0xedb2bc[_0xb6eb('0x43')];if(!_0x4ed841[_0xb6eb('0x3e')]['hasOwnProperty'](_0xb6eb('0x44'))){_0x534d8e[_0xb6eb('0x2f')]=qs['limit'](_0x4ed841[_0xb6eb('0x3e')][_0xb6eb('0x2f')]);_0x534d8e['offset']=qs['offset'](_0x4ed841['query'][_0xb6eb('0x2e')]);}return _0x19bc58[_0xb6eb('0x5d')](_0x534d8e);}})[_0xb6eb('0x21')](function(_0x1ba519){if(_0x1ba519){return _0x1ba519?{'count':_0x32f12b,'rows':_0x1ba519}:null;}})['then'](respondWithResult(_0x4ed047,null))[_0xb6eb('0x2a')](handleError(_0x4ed047,null));};exports[_0xb6eb('0x5e')]=function(_0x59f7f5,_0x456fbe,_0x3348fe){var _0x51da5d={};var _0xd4dab0={};var _0x4967b4;var _0x4cfe53;return db[_0xb6eb('0x3a')]['findOne']({'where':{'id':_0x59f7f5[_0xb6eb('0x53')]['id']}})[_0xb6eb('0x21')](handleEntityNotFound(_0x456fbe,null))[_0xb6eb('0x21')](function(_0x596ace){if(_0x596ace){_0x4967b4=_0x596ace;_0xd4dab0[_0xb6eb('0x3d')]=_[_0xb6eb('0x3f')](db['SalesforceField']['rawAttributes']);_0xd4dab0[_0xb6eb('0x3e')]=_[_0xb6eb('0x3f')](_0x59f7f5[_0xb6eb('0x3e')]);_0xd4dab0[_0xb6eb('0x40')]=_[_0xb6eb('0x55')](_0xd4dab0[_0xb6eb('0x3d')],_0xd4dab0[_0xb6eb('0x3e')]);_0x51da5d[_0xb6eb('0x41')]=_[_0xb6eb('0x55')](_0xd4dab0[_0xb6eb('0x3d')],qs[_0xb6eb('0x42')](_0x59f7f5[_0xb6eb('0x3e')][_0xb6eb('0x42')]));_0x51da5d[_0xb6eb('0x41')]=_0x51da5d['attributes']['length']?_0x51da5d[_0xb6eb('0x41')]:_0xd4dab0['model'];_0x51da5d[_0xb6eb('0x45')]=qs[_0xb6eb('0x46')](_0x59f7f5['query'][_0xb6eb('0x46')]);_0x51da5d[_0xb6eb('0x47')]=qs['filters'](_['pick'](_0x59f7f5[_0xb6eb('0x3e')],_0xd4dab0['filters']));if(_0x59f7f5[_0xb6eb('0x3e')][_0xb6eb('0x49')]){_0x51da5d[_0xb6eb('0x47')]=_[_0xb6eb('0x4a')](_0x51da5d['where'],{'$or':_[_0xb6eb('0x39')](_0x51da5d['attributes'],function(_0x37e97e){var _0x16b164={};_0x16b164[_0x37e97e]={'$like':'%'+_0x59f7f5[_0xb6eb('0x3e')][_0xb6eb('0x49')]+'%'};return _0x16b164;})});}_0x51da5d=_[_0xb6eb('0x4a')]({},_0x51da5d,_0x59f7f5[_0xb6eb('0x4d')]);return _0x4967b4[_0xb6eb('0x5e')](_0x51da5d);}})['then'](function(_0x454a85){if(_0x454a85){_0x4cfe53=_0x454a85['length'];if(!_0x59f7f5[_0xb6eb('0x3e')][_0xb6eb('0x5b')](_0xb6eb('0x44'))){_0x51da5d[_0xb6eb('0x2f')]=qs[_0xb6eb('0x2f')](_0x59f7f5[_0xb6eb('0x3e')][_0xb6eb('0x2f')]);_0x51da5d[_0xb6eb('0x2e')]=qs[_0xb6eb('0x2e')](_0x59f7f5[_0xb6eb('0x3e')][_0xb6eb('0x2e')]);}return _0x4967b4['getDescriptions'](_0x51da5d);}})[_0xb6eb('0x21')](function(_0xe6bce){if(_0xe6bce){return _0xe6bce?{'count':_0x4cfe53,'rows':_0xe6bce}:null;}})['then'](respondWithResult(_0x456fbe,null))[_0xb6eb('0x2a')](handleError(_0x456fbe,null));};
\ No newline at end of file
+var _0x4e1c=['sox','to-csv','ejs','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','test','Sequelize','ValidationError','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','json','offset','Content-Range','save','update','destroy','end','stack','name','send','map','rawAttributes','model','keys','query','filters','intersection','fields','attributes','limit','order','sort','where','filter','merge','type','options','SalesforceConfiguration','count','include','findAll','rows','catch','show','params','find','create','body','findOne','SalesforceField','getFields','length','hasOwnProperty','nolimit','getSubjects','getDescriptions','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x37d573,_0x4678d4){var _0x459238=function(_0x5a291e){while(--_0x5a291e){_0x37d573['push'](_0x37d573['shift']());}};_0x459238(++_0x4678d4);}(_0x4e1c,0x140));var _0xc4e1=function(_0x4855a7,_0x133b87){_0x4855a7=_0x4855a7-0x0;var _0x2d3855=_0x4e1c[_0x4855a7];return _0x2d3855;};'use strict';var pdf=require(_0xc4e1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc4e1('0x1'));var rp=require(_0xc4e1('0x2'));var moment=require(_0xc4e1('0x3'));var BPromise=require(_0xc4e1('0x4'));var Mustache=require(_0xc4e1('0x5'));var util=require(_0xc4e1('0x6'));var path=require(_0xc4e1('0x7'));var sox=require(_0xc4e1('0x8'));var csv=require(_0xc4e1('0x9'));var ejs=require(_0xc4e1('0xa'));var fs=require('fs');var _=require(_0xc4e1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc4e1('0x9'));var querystring=require(_0xc4e1('0xc'));var Papa=require('papaparse');var Redis=require(_0xc4e1('0xd'));var authService=require(_0xc4e1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc4e1('0xf'));var hardwareService=require(_0xc4e1('0x10'));var logger=require('../../config/logger')(_0xc4e1('0x11'));var utils=require(_0xc4e1('0x12'));var config=require('../../config/environment');var db=require(_0xc4e1('0x13'))['db'];var jayson=require(_0xc4e1('0x14'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x250b15,_0x3cd461,_0x1b594d){if(_0x1b594d){var _0x5899ae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5899ae[_0xc4e1('0x15')](_0x3cd461)){return _0x250b15;}else{throw new db[(_0xc4e1('0x16'))][(_0xc4e1('0x17'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x250b15;}}function respondWithRpcPromise(_0xbe3646,_0x304a1,_0x5d23e,_0x30ce3a){return new BPromise(function(_0xd4c068,_0x324d26){var _0x407b1c=_0x30ce3a||client;return _0x407b1c[_0xc4e1('0x18')](_0xbe3646,_0x5d23e)[_0xc4e1('0x19')](function(_0x4095a7){logger[_0xc4e1('0x1a')](_0xc4e1('0x1b'),_0x304a1,_0xc4e1('0x1c'));logger[_0xc4e1('0x1d')](_0xc4e1('0x1e'),_0x304a1,'request\x20sent',JSON['stringify'](_0x4095a7));if(_0x4095a7[_0xc4e1('0x1f')]){if(_0x4095a7['error'][_0xc4e1('0x20')]===0x1f4){logger['error'](_0xc4e1('0x1b'),_0x304a1,_0x4095a7[_0xc4e1('0x1f')][_0xc4e1('0x21')]);return _0x324d26(_0x4095a7[_0xc4e1('0x1f')][_0xc4e1('0x21')]);}logger[_0xc4e1('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x304a1,_0x4095a7['error'][_0xc4e1('0x21')]);return _0xd4c068(_0x4095a7[_0xc4e1('0x1f')][_0xc4e1('0x21')]);}else{logger[_0xc4e1('0x1a')](_0xc4e1('0x1b'),_0x304a1,_0xc4e1('0x1c'));_0xd4c068(_0x4095a7['result'][_0xc4e1('0x21')]);}})['catch'](function(_0x4ab20c){logger[_0xc4e1('0x1f')](_0xc4e1('0x1b'),_0x304a1,_0x4ab20c);_0x324d26(_0x4ab20c);});});}function respondWithStatusCode(_0x41efa9,_0x5b8719){_0x5b8719=_0x5b8719||0xcc;return function(_0x31d7f7){if(_0x31d7f7){return _0x41efa9[_0xc4e1('0x22')](_0x5b8719);}return _0x41efa9[_0xc4e1('0x23')](_0x5b8719)['end']();};}function respondWithResult(_0x5487a0,_0xe6acb3){_0xe6acb3=_0xe6acb3||0xc8;return function(_0x4cccb5){if(_0x4cccb5){return _0x5487a0[_0xc4e1('0x23')](_0xe6acb3)[_0xc4e1('0x24')](_0x4cccb5);}};}function respondWithFilteredResult(_0x2c5994,_0xe4dd9f){return function(_0x4ef123){if(_0x4ef123){var _0x5a4965=_0x4ef123['count'],_0x2d5fbb=_0xe4dd9f[_0xc4e1('0x25')],_0x1d29bd=_0xe4dd9f[_0xc4e1('0x25')]+_0xe4dd9f['limit'],_0xe5047c;if(_0x1d29bd>=_0x5a4965){_0x1d29bd=_0x5a4965;_0xe5047c=0xc8;}else{_0xe5047c=0xce;}_0x2c5994[_0xc4e1('0x23')](_0xe5047c);return _0x2c5994['set'](_0xc4e1('0x26'),_0x2d5fbb+'-'+_0x1d29bd+'/'+_0x5a4965)[_0xc4e1('0x24')](_0x4ef123);}return null;};}function patchUpdates(_0x112ef4){return function(_0xc33568){try{jsonpatch['apply'](_0xc33568,_0x112ef4,!![]);}catch(_0x5db10e){return BPromise['reject'](_0x5db10e);}return _0xc33568[_0xc4e1('0x27')]();};}function saveUpdates(_0x4adb5b,_0x2022b6){return function(_0x2061a1){if(_0x2061a1){return _0x2061a1[_0xc4e1('0x28')](_0x4adb5b)[_0xc4e1('0x19')](function(_0xfc8813){return _0xfc8813;});}return null;};}function removeEntity(_0x3e6b06,_0x48326c){return function(_0x2c43d3){if(_0x2c43d3){return _0x2c43d3[_0xc4e1('0x29')]()[_0xc4e1('0x19')](function(){_0x3e6b06[_0xc4e1('0x23')](0xcc)[_0xc4e1('0x2a')]();});}};}function handleEntityNotFound(_0xb12f14,_0x3d0aef){return function(_0x2fe065){if(!_0x2fe065){_0xb12f14[_0xc4e1('0x22')](0x194);}return _0x2fe065;};}function handleError(_0x45c801,_0xcac7b0){_0xcac7b0=_0xcac7b0||0x1f4;return function(_0xb996a3){logger[_0xc4e1('0x1f')](_0xb996a3[_0xc4e1('0x2b')]);if(_0xb996a3[_0xc4e1('0x2c')]){delete _0xb996a3['name'];}_0x45c801[_0xc4e1('0x23')](_0xcac7b0)[_0xc4e1('0x2d')](_0xb996a3);};}exports['index']=function(_0x307b4a,_0x29eb99){var _0x2057ef={},_0x1d2b8a={},_0x32bb23={'count':0x0,'rows':[]};var _0x5c6f7c=_[_0xc4e1('0x2e')](db['SalesforceConfiguration'][_0xc4e1('0x2f')],function(_0x3c3cdc){return{'name':_0x3c3cdc['fieldName'],'type':_0x3c3cdc['type']['key']};});_0x1d2b8a[_0xc4e1('0x30')]=_[_0xc4e1('0x2e')](_0x5c6f7c,_0xc4e1('0x2c'));_0x1d2b8a['query']=_[_0xc4e1('0x31')](_0x307b4a[_0xc4e1('0x32')]);_0x1d2b8a[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0x1d2b8a[_0xc4e1('0x30')],_0x1d2b8a[_0xc4e1('0x32')]);_0x2057ef['attributes']=_[_0xc4e1('0x34')](_0x1d2b8a[_0xc4e1('0x30')],qs[_0xc4e1('0x35')](_0x307b4a[_0xc4e1('0x32')][_0xc4e1('0x35')]));_0x2057ef[_0xc4e1('0x36')]=_0x2057ef[_0xc4e1('0x36')]['length']?_0x2057ef[_0xc4e1('0x36')]:_0x1d2b8a['model'];if(!_0x307b4a['query']['hasOwnProperty']('nolimit')){_0x2057ef[_0xc4e1('0x37')]=qs[_0xc4e1('0x37')](_0x307b4a[_0xc4e1('0x32')][_0xc4e1('0x37')]);_0x2057ef[_0xc4e1('0x25')]=qs[_0xc4e1('0x25')](_0x307b4a[_0xc4e1('0x32')][_0xc4e1('0x25')]);}_0x2057ef[_0xc4e1('0x38')]=qs[_0xc4e1('0x39')](_0x307b4a[_0xc4e1('0x32')][_0xc4e1('0x39')]);_0x2057ef[_0xc4e1('0x3a')]=qs[_0xc4e1('0x33')](_['pick'](_0x307b4a['query'],_0x1d2b8a[_0xc4e1('0x33')]),_0x5c6f7c);if(_0x307b4a[_0xc4e1('0x32')][_0xc4e1('0x3b')]){_0x2057ef[_0xc4e1('0x3a')]=_[_0xc4e1('0x3c')](_0x2057ef[_0xc4e1('0x3a')],{'$or':_[_0xc4e1('0x2e')](_0x5c6f7c,function(_0x401b5c){if(_0x401b5c[_0xc4e1('0x3d')]!=='VIRTUAL'){var _0xe32110={};_0xe32110[_0x401b5c[_0xc4e1('0x2c')]]={'$like':'%'+_0x307b4a[_0xc4e1('0x32')]['filter']+'%'};return _0xe32110;}})});}_0x2057ef=_[_0xc4e1('0x3c')]({},_0x2057ef,_0x307b4a[_0xc4e1('0x3e')]);var _0x4edfc0={'where':_0x2057ef[_0xc4e1('0x3a')]};return db[_0xc4e1('0x3f')][_0xc4e1('0x40')](_0x4edfc0)[_0xc4e1('0x19')](function(_0x3c6780){_0x32bb23['count']=_0x3c6780;if(_0x307b4a[_0xc4e1('0x32')]['includeAll']){_0x2057ef[_0xc4e1('0x41')]=[{'all':!![]}];}return db[_0xc4e1('0x3f')][_0xc4e1('0x42')](_0x2057ef);})[_0xc4e1('0x19')](function(_0x4547cb){_0x32bb23[_0xc4e1('0x43')]=_0x4547cb;return _0x32bb23;})[_0xc4e1('0x19')](respondWithFilteredResult(_0x29eb99,_0x2057ef))[_0xc4e1('0x44')](handleError(_0x29eb99,null));};exports[_0xc4e1('0x45')]=function(_0x3ae703,_0x1deeed){var _0x876d0c={'raw':![],'where':{'id':_0x3ae703[_0xc4e1('0x46')]['id']}},_0x426fc9={};_0x426fc9[_0xc4e1('0x30')]=_['keys'](db[_0xc4e1('0x3f')]['rawAttributes']);_0x426fc9[_0xc4e1('0x32')]=_[_0xc4e1('0x31')](_0x3ae703[_0xc4e1('0x32')]);_0x426fc9[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0x426fc9[_0xc4e1('0x30')],_0x426fc9[_0xc4e1('0x32')]);_0x876d0c[_0xc4e1('0x36')]=_[_0xc4e1('0x34')](_0x426fc9['model'],qs[_0xc4e1('0x35')](_0x3ae703[_0xc4e1('0x32')][_0xc4e1('0x35')]));_0x876d0c[_0xc4e1('0x36')]=_0x876d0c['attributes']['length']?_0x876d0c[_0xc4e1('0x36')]:_0x426fc9['model'];if(_0x3ae703['query']['includeAll']){_0x876d0c[_0xc4e1('0x41')]=[{'all':!![]}];}_0x876d0c=_[_0xc4e1('0x3c')]({},_0x876d0c,_0x3ae703[_0xc4e1('0x3e')]);return db[_0xc4e1('0x3f')][_0xc4e1('0x47')](_0x876d0c)[_0xc4e1('0x19')](handleEntityNotFound(_0x1deeed,null))[_0xc4e1('0x19')](respondWithResult(_0x1deeed,null))[_0xc4e1('0x44')](handleError(_0x1deeed,null));};exports[_0xc4e1('0x48')]=function(_0x11868b,_0x52262e){return db[_0xc4e1('0x3f')][_0xc4e1('0x48')](_0x11868b['body'],{})['then'](respondWithResult(_0x52262e,0xc9))[_0xc4e1('0x44')](handleError(_0x52262e,null));};exports['update']=function(_0x91f081,_0x16a776){if(_0x91f081['body']['id']){delete _0x91f081['body']['id'];}return db[_0xc4e1('0x3f')][_0xc4e1('0x47')]({'where':{'id':_0x91f081[_0xc4e1('0x46')]['id']}})[_0xc4e1('0x19')](handleEntityNotFound(_0x16a776,null))[_0xc4e1('0x19')](saveUpdates(_0x91f081[_0xc4e1('0x49')],null))[_0xc4e1('0x19')](respondWithResult(_0x16a776,null))['catch'](handleError(_0x16a776,null));};exports[_0xc4e1('0x29')]=function(_0x16be51,_0x469ac5){return db[_0xc4e1('0x3f')][_0xc4e1('0x47')]({'where':{'id':_0x16be51[_0xc4e1('0x46')]['id']}})[_0xc4e1('0x19')](handleEntityNotFound(_0x469ac5,null))[_0xc4e1('0x19')](removeEntity(_0x469ac5,null))[_0xc4e1('0x44')](handleError(_0x469ac5,null));};exports['getFields']=function(_0x47e6e1,_0x220466,_0x26b948){var _0x5beabf={};var _0x1c618e={};var _0xeb8be5;var _0x9514fd;return db[_0xc4e1('0x3f')][_0xc4e1('0x4a')]({'where':{'id':_0x47e6e1[_0xc4e1('0x46')]['id']}})[_0xc4e1('0x19')](handleEntityNotFound(_0x220466,null))[_0xc4e1('0x19')](function(_0x29a994){if(_0x29a994){_0xeb8be5=_0x29a994;_0x1c618e['model']=_[_0xc4e1('0x31')](db[_0xc4e1('0x4b')][_0xc4e1('0x2f')]);_0x1c618e[_0xc4e1('0x32')]=_['keys'](_0x47e6e1[_0xc4e1('0x32')]);_0x1c618e[_0xc4e1('0x33')]=_[_0xc4e1('0x34')](_0x1c618e[_0xc4e1('0x30')],_0x1c618e['query']);_0x5beabf['attributes']=_[_0xc4e1('0x34')](_0x1c618e[_0xc4e1('0x30')],qs[_0xc4e1('0x35')](_0x47e6e1[_0xc4e1('0x32')][_0xc4e1('0x35')]));_0x5beabf['attributes']=_0x5beabf[_0xc4e1('0x36')]['length']?_0x5beabf['attributes']:_0x1c618e['model'];_0x5beabf[_0xc4e1('0x38')]=qs[_0xc4e1('0x39')](_0x47e6e1[_0xc4e1('0x32')][_0xc4e1('0x39')]);_0x5beabf[_0xc4e1('0x3a')]=qs[_0xc4e1('0x33')](_['pick'](_0x47e6e1[_0xc4e1('0x32')],_0x1c618e[_0xc4e1('0x33')]));if(_0x47e6e1[_0xc4e1('0x32')][_0xc4e1('0x3b')]){_0x5beabf['where']=_[_0xc4e1('0x3c')](_0x5beabf[_0xc4e1('0x3a')],{'$or':_[_0xc4e1('0x2e')](_0x5beabf[_0xc4e1('0x36')],function(_0x1a5c03){var _0x7d7bea={};_0x7d7bea[_0x1a5c03]={'$like':'%'+_0x47e6e1['query'][_0xc4e1('0x3b')]+'%'};return _0x7d7bea;})});}_0x5beabf=_[_0xc4e1('0x3c')]({},_0x5beabf,_0x47e6e1[_0xc4e1('0x3e')]);return _0xeb8be5[_0xc4e1('0x4c')](_0x5beabf);}})['then'](function(_0x15b663){if(_0x15b663){_0x9514fd=_0x15b663[_0xc4e1('0x4d')];if(!_0x47e6e1[_0xc4e1('0x32')][_0xc4e1('0x4e')](_0xc4e1('0x4f'))){_0x5beabf[_0xc4e1('0x37')]=qs[_0xc4e1('0x37')](_0x47e6e1['query'][_0xc4e1('0x37')]);_0x5beabf[_0xc4e1('0x25')]=qs['offset'](_0x47e6e1['query'][_0xc4e1('0x25')]);}return _0xeb8be5[_0xc4e1('0x4c')](_0x5beabf);}})[_0xc4e1('0x19')](function(_0x317d04){if(_0x317d04){return _0x317d04?{'count':_0x9514fd,'rows':_0x317d04}:null;}})[_0xc4e1('0x19')](respondWithResult(_0x220466,null))[_0xc4e1('0x44')](handleError(_0x220466,null));};exports[_0xc4e1('0x50')]=function(_0x53b8f3,_0x37a824,_0x514d9f){var _0x305aa9={};var _0x39c46b={};var _0x27cc40;var _0x3e3d7f;return db[_0xc4e1('0x3f')][_0xc4e1('0x4a')]({'where':{'id':_0x53b8f3[_0xc4e1('0x46')]['id']}})['then'](handleEntityNotFound(_0x37a824,null))[_0xc4e1('0x19')](function(_0x27532a){if(_0x27532a){_0x27cc40=_0x27532a;_0x39c46b[_0xc4e1('0x30')]=_[_0xc4e1('0x31')](db['SalesforceField'][_0xc4e1('0x2f')]);_0x39c46b[_0xc4e1('0x32')]=_[_0xc4e1('0x31')](_0x53b8f3['query']);_0x39c46b[_0xc4e1('0x33')]=_['intersection'](_0x39c46b[_0xc4e1('0x30')],_0x39c46b['query']);_0x305aa9['attributes']=_[_0xc4e1('0x34')](_0x39c46b[_0xc4e1('0x30')],qs[_0xc4e1('0x35')](_0x53b8f3[_0xc4e1('0x32')][_0xc4e1('0x35')]));_0x305aa9[_0xc4e1('0x36')]=_0x305aa9[_0xc4e1('0x36')]['length']?_0x305aa9[_0xc4e1('0x36')]:_0x39c46b[_0xc4e1('0x30')];_0x305aa9[_0xc4e1('0x38')]=qs['sort'](_0x53b8f3[_0xc4e1('0x32')][_0xc4e1('0x39')]);_0x305aa9[_0xc4e1('0x3a')]=qs['filters'](_['pick'](_0x53b8f3['query'],_0x39c46b['filters']));if(_0x53b8f3[_0xc4e1('0x32')][_0xc4e1('0x3b')]){_0x305aa9[_0xc4e1('0x3a')]=_[_0xc4e1('0x3c')](_0x305aa9[_0xc4e1('0x3a')],{'$or':_[_0xc4e1('0x2e')](_0x305aa9[_0xc4e1('0x36')],function(_0x5aad12){var _0x47b4d6={};_0x47b4d6[_0x5aad12]={'$like':'%'+_0x53b8f3[_0xc4e1('0x32')][_0xc4e1('0x3b')]+'%'};return _0x47b4d6;})});}_0x305aa9=_[_0xc4e1('0x3c')]({},_0x305aa9,_0x53b8f3['options']);return _0x27cc40[_0xc4e1('0x50')](_0x305aa9);}})['then'](function(_0x15c0bd){if(_0x15c0bd){_0x3e3d7f=_0x15c0bd[_0xc4e1('0x4d')];if(!_0x53b8f3[_0xc4e1('0x32')][_0xc4e1('0x4e')]('nolimit')){_0x305aa9[_0xc4e1('0x37')]=qs[_0xc4e1('0x37')](_0x53b8f3[_0xc4e1('0x32')]['limit']);_0x305aa9['offset']=qs[_0xc4e1('0x25')](_0x53b8f3[_0xc4e1('0x32')][_0xc4e1('0x25')]);}return _0x27cc40['getSubjects'](_0x305aa9);}})[_0xc4e1('0x19')](function(_0x177cbe){if(_0x177cbe){return _0x177cbe?{'count':_0x3e3d7f,'rows':_0x177cbe}:null;}})[_0xc4e1('0x19')](respondWithResult(_0x37a824,null))[_0xc4e1('0x44')](handleError(_0x37a824,null));};exports['getDescriptions']=function(_0x46a327,_0x4caade,_0x14bba3){var _0xc87716={};var _0x5e508e={};var _0x583dc9;var _0x45feb6;return db[_0xc4e1('0x3f')][_0xc4e1('0x4a')]({'where':{'id':_0x46a327[_0xc4e1('0x46')]['id']}})[_0xc4e1('0x19')](handleEntityNotFound(_0x4caade,null))[_0xc4e1('0x19')](function(_0x4e1391){if(_0x4e1391){_0x583dc9=_0x4e1391;_0x5e508e[_0xc4e1('0x30')]=_['keys'](db[_0xc4e1('0x4b')]['rawAttributes']);_0x5e508e[_0xc4e1('0x32')]=_[_0xc4e1('0x31')](_0x46a327[_0xc4e1('0x32')]);_0x5e508e['filters']=_['intersection'](_0x5e508e['model'],_0x5e508e[_0xc4e1('0x32')]);_0xc87716[_0xc4e1('0x36')]=_['intersection'](_0x5e508e[_0xc4e1('0x30')],qs['fields'](_0x46a327['query'][_0xc4e1('0x35')]));_0xc87716[_0xc4e1('0x36')]=_0xc87716[_0xc4e1('0x36')][_0xc4e1('0x4d')]?_0xc87716[_0xc4e1('0x36')]:_0x5e508e[_0xc4e1('0x30')];_0xc87716[_0xc4e1('0x38')]=qs['sort'](_0x46a327[_0xc4e1('0x32')][_0xc4e1('0x39')]);_0xc87716[_0xc4e1('0x3a')]=qs[_0xc4e1('0x33')](_['pick'](_0x46a327[_0xc4e1('0x32')],_0x5e508e[_0xc4e1('0x33')]));if(_0x46a327['query']['filter']){_0xc87716[_0xc4e1('0x3a')]=_['merge'](_0xc87716[_0xc4e1('0x3a')],{'$or':_['map'](_0xc87716['attributes'],function(_0x4180c5){var _0x164532={};_0x164532[_0x4180c5]={'$like':'%'+_0x46a327[_0xc4e1('0x32')][_0xc4e1('0x3b')]+'%'};return _0x164532;})});}_0xc87716=_['merge']({},_0xc87716,_0x46a327[_0xc4e1('0x3e')]);return _0x583dc9[_0xc4e1('0x51')](_0xc87716);}})['then'](function(_0x2404d1){if(_0x2404d1){_0x45feb6=_0x2404d1[_0xc4e1('0x4d')];if(!_0x46a327[_0xc4e1('0x32')][_0xc4e1('0x4e')]('nolimit')){_0xc87716[_0xc4e1('0x37')]=qs[_0xc4e1('0x37')](_0x46a327['query'][_0xc4e1('0x37')]);_0xc87716[_0xc4e1('0x25')]=qs['offset'](_0x46a327[_0xc4e1('0x32')][_0xc4e1('0x25')]);}return _0x583dc9['getDescriptions'](_0xc87716);}})[_0xc4e1('0x19')](function(_0x18804f){if(_0x18804f){return _0x18804f?{'count':_0x45feb6,'rows':_0x18804f}:null;}})[_0xc4e1('0x19')](respondWithResult(_0x4caade,null))['catch'](handleError(_0x4caade,null));};
\ No newline at end of file
index 11325fc..78d31dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13db=['path','../../config/environment','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x13db,0xb8));var _0xb13d=function(_0x407085,_0x2c7593){_0x407085=_0x407085-0x0;var _0x488faf=_0x13db[_0x407085];return _0x488faf;};'use strict';var _=require(_0xb13d('0x0'));var util=require('util');var logger=require(_0xb13d('0x1'))(_0xb13d('0x2'));var moment=require(_0xb13d('0x3'));var BPromise=require(_0xb13d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb13d('0x5'));var rimraf=require('rimraf');var config=require(_0xb13d('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x315b62,_0x2b1ed1){return _0x315b62['define'](_0xb13d('0x7'),attributes,{'tableName':_0xb13d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf86c=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment'];(function(_0x2e32d7,_0x591a19){var _0x1d1bc9=function(_0x41d83b){while(--_0x41d83b){_0x2e32d7['push'](_0x2e32d7['shift']());}};_0x1d1bc9(++_0x591a19);}(_0xf86c,0x128));var _0xcf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf86('0x0'));var util=require(_0xcf86('0x1'));var logger=require(_0xcf86('0x2'))('api');var moment=require(_0xcf86('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf86('0x4'));var fs=require('fs');var path=require(_0xcf86('0x5'));var rimraf=require(_0xcf86('0x6'));var config=require(_0xcf86('0x7'));var attributes=require(_0xcf86('0x8'));module[_0xcf86('0x9')]=function(_0x5e6335,_0x2977e8){return _0x5e6335['define'](_0xcf86('0xa'),attributes,{'tableName':_0xcf86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9580e58..b88062d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0194=['client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x0194,0x85));var _0x4019=function(_0x3f16d4,_0x31338b){_0x3f16d4=_0x3f16d4-0x0;var _0x5087a7=_0x0194[_0x3f16d4];return _0x5087a7;};'use strict';var _=require(_0x4019('0x0'));var util=require('util');var moment=require(_0x4019('0x1'));var BPromise=require('bluebird');var rs=require(_0x4019('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4019('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4019('0x4'))('rpc');var config=require(_0x4019('0x5'));var jayson=require(_0x4019('0x6'));var client=jayson[_0x4019('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x194bf6,_0x49673d,_0x2d2015){return new BPromise(function(_0x1ad2c1,_0xb02afa){return client[_0x4019('0x8')](_0x194bf6,_0x2d2015)[_0x4019('0x9')](function(_0x5b6726){logger[_0x4019('0xa')](_0x4019('0xb'),_0x49673d,_0x4019('0xc'));logger[_0x4019('0xd')](_0x4019('0xe'),_0x49673d,_0x4019('0xc'),JSON[_0x4019('0xf')](_0x5b6726));if(_0x5b6726[_0x4019('0x10')]){if(_0x5b6726[_0x4019('0x10')][_0x4019('0x11')]===0x1f4){logger[_0x4019('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x49673d,_0x5b6726[_0x4019('0x10')][_0x4019('0x12')]);return _0xb02afa(_0x5b6726[_0x4019('0x10')][_0x4019('0x12')]);}logger[_0x4019('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x49673d,_0x5b6726[_0x4019('0x10')][_0x4019('0x12')]);return _0x1ad2c1(_0x5b6726[_0x4019('0x10')][_0x4019('0x12')]);}else{logger['info'](_0x4019('0xb'),_0x49673d,'request\x20sent');_0x1ad2c1(_0x5b6726['result'][_0x4019('0x12')]);}})[_0x4019('0x13')](function(_0x2f95d7){logger[_0x4019('0x10')](_0x4019('0xb'),_0x49673d,_0x2f95d7);_0xb02afa(_0x2f95d7);});});}
\ No newline at end of file
+var _0x9346=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9346,0x1c0));var _0x6934=function(_0xd662d,_0x5b52ea){_0xd662d=_0xd662d-0x0;var _0x336d4d=_0x9346[_0xd662d];return _0x336d4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6934('0x0'));var BPromise=require(_0x6934('0x1'));var rs=require(_0x6934('0x2'));var fs=require('fs');var Redis=require(_0x6934('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6934('0x4'));var logger=require('../../config/logger')(_0x6934('0x5'));var config=require(_0x6934('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6934('0x7')][_0x6934('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45f153,_0x3ce91c,_0x4d087a){return new BPromise(function(_0x2691af,_0x54f4f7){return client[_0x6934('0x9')](_0x45f153,_0x4d087a)[_0x6934('0xa')](function(_0x53366b){logger[_0x6934('0xb')](_0x6934('0xc'),_0x3ce91c,_0x6934('0xd'));logger['debug'](_0x6934('0xe'),_0x3ce91c,_0x6934('0xd'),JSON[_0x6934('0xf')](_0x53366b));if(_0x53366b[_0x6934('0x10')]){if(_0x53366b[_0x6934('0x10')]['code']===0x1f4){logger[_0x6934('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3ce91c,_0x53366b[_0x6934('0x10')][_0x6934('0x11')]);return _0x54f4f7(_0x53366b[_0x6934('0x10')][_0x6934('0x11')]);}logger['error'](_0x6934('0xc'),_0x3ce91c,_0x53366b[_0x6934('0x10')][_0x6934('0x11')]);return _0x2691af(_0x53366b[_0x6934('0x10')][_0x6934('0x11')]);}else{logger[_0x6934('0xb')](_0x6934('0xc'),_0x3ce91c,_0x6934('0xd'));_0x2691af(_0x53366b[_0x6934('0x12')][_0x6934('0x11')]);}})[_0x6934('0x13')](function(_0x500a69){logger[_0x6934('0x10')](_0x6934('0xc'),_0x3ce91c,_0x500a69);_0x54f4f7(_0x500a69);});});}
\ No newline at end of file
index 0cb4d53..d0eac6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x1d9cec,_0x3364f4){var _0x16c576=function(_0x25c726){while(--_0x25c726){_0x1d9cec['push'](_0x1d9cec['shift']());}};_0x16c576(++_0x3364f4);}(_0x2ef3,0xba));var _0x32ef=function(_0x262a89,_0x306327){_0x262a89=_0x262a89-0x0;var _0xbae3ea=_0x2ef3[_0x262a89];return _0xbae3ea;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./intSalesforceField.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0xc')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0xe')](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router['delete']('/:id',auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);module[_0x32ef('0x11')]=router;
\ No newline at end of file
+var _0x5162=['put','/:id','update','delete','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','show','post','create'];(function(_0x3aef0f,_0x4dd6b9){var _0x2fdade=function(_0x58096a){while(--_0x58096a){_0x3aef0f['push'](_0x3aef0f['shift']());}};_0x2fdade(++_0x4dd6b9);}(_0x5162,0x103));var _0x2516=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x5162[_0x3ba924];return _0x4cc1df;};'use strict';var multer=require(_0x2516('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2516('0x1')]();var auth=require(_0x2516('0x2'));var interaction=require(_0x2516('0x3'));var config=require(_0x2516('0x4'));var controller=require(_0x2516('0x5'));router[_0x2516('0x6')]('/',auth[_0x2516('0x7')](),controller['index']);router['get']('/:id',auth[_0x2516('0x7')](),controller[_0x2516('0x8')]);router[_0x2516('0x9')]('/',auth[_0x2516('0x7')](),controller[_0x2516('0xa')]);router[_0x2516('0xb')](_0x2516('0xc'),auth['isAuthenticated'](),controller[_0x2516('0xd')]);router[_0x2516('0xe')](_0x2516('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 5ce8045..afc80c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6206=['string','variable','keyValue','STRING','sequelize','ENUM'];(function(_0x1c79a7,_0x38220e){var _0x4de69f=function(_0x569582){while(--_0x569582){_0x1c79a7['push'](_0x1c79a7['shift']());}};_0x4de69f(++_0x38220e);}(_0x6206,0x70));var _0x6620=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x6206[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require(_0x6620('0x0'));module['exports']={'type':{'type':Sequelize[_0x6620('0x1')](_0x6620('0x2'),_0x6620('0x3'),'customVariable',_0x6620('0x4')),'defaultValue':_0x6620('0x2')},'content':{'type':Sequelize[_0x6620('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6620('0x1')]('string',_0x6620('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x6620('0x5')]},'idField':{'type':Sequelize[_0x6620('0x5')]},'variableName':{'type':Sequelize[_0x6620('0x5')]}};
\ No newline at end of file
+var _0x8c14=['variable','customVariable','keyValue','STRING','ENUM','sequelize','exports','string'];(function(_0x382f26,_0x4742f8){var _0x4a25fd=function(_0xd47b90){while(--_0xd47b90){_0x382f26['push'](_0x382f26['shift']());}};_0x4a25fd(++_0x4742f8);}(_0x8c14,0x13d));var _0x48c1=function(_0x580883,_0x3b1a50){_0x580883=_0x580883-0x0;var _0x57fc71=_0x8c14[_0x580883];return _0x57fc71;};'use strict';var Sequelize=require(_0x48c1('0x0'));module[_0x48c1('0x1')]={'type':{'type':Sequelize['ENUM'](_0x48c1('0x2'),_0x48c1('0x3'),_0x48c1('0x4'),_0x48c1('0x5')),'defaultValue':_0x48c1('0x2')},'content':{'type':Sequelize[_0x48c1('0x6')]},'key':{'type':Sequelize[_0x48c1('0x6')]},'keyType':{'type':Sequelize[_0x48c1('0x7')](_0x48c1('0x2'),'variable',_0x48c1('0x4'))},'keyContent':{'type':Sequelize[_0x48c1('0x6')]},'idField':{'type':Sequelize[_0x48c1('0x6')]},'variableName':{'type':Sequelize[_0x48c1('0x6')]}};
\ No newline at end of file
index 4afaaf7..5d6bcf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0756=['then','error','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','SalesforceField','includeAll','include','rows','catch','show','params','length','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x0756,0x107));var _0x6075=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x0756[_0x3ab9ee];return _0x82ee88;};'use strict';var pdf=require(_0x6075('0x0'));var emlformat=require(_0x6075('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6075('0x2'));var jsonpatch=require(_0x6075('0x3'));var rp=require(_0x6075('0x4'));var moment=require('moment');var BPromise=require(_0x6075('0x5'));var Mustache=require(_0x6075('0x6'));var util=require('util');var path=require(_0x6075('0x7'));var sox=require(_0x6075('0x8'));var csv=require(_0x6075('0x9'));var ejs=require(_0x6075('0xa'));var fs=require('fs');var _=require(_0x6075('0xb'));var squel=require(_0x6075('0xc'));var crypto=require(_0x6075('0xd'));var jsforce=require(_0x6075('0xe'));var deskjs=require(_0x6075('0xf'));var toCsv=require(_0x6075('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6075('0x10'));var authService=require(_0x6075('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6075('0x12'));var logger=require(_0x6075('0x13'))(_0x6075('0x14'));var utils=require(_0x6075('0x15'));var config=require(_0x6075('0x16'));var db=require(_0x6075('0x17'))['db'];function respondWithStatusCode(_0xe4d000,_0x2adf13){_0x2adf13=_0x2adf13||0xcc;return function(_0x2cd1d7){if(_0x2cd1d7){return _0xe4d000[_0x6075('0x18')](_0x2adf13);}return _0xe4d000['status'](_0x2adf13)[_0x6075('0x19')]();};}function respondWithResult(_0x5f320c,_0x132231){_0x132231=_0x132231||0xc8;return function(_0x37cdab){if(_0x37cdab){return _0x5f320c[_0x6075('0x1a')](_0x132231)[_0x6075('0x1b')](_0x37cdab);}};}function respondWithFilteredResult(_0xa9aec8,_0x1cc8ad){return function(_0x49432c){if(_0x49432c){var _0x5ba108=_0x49432c[_0x6075('0x1c')],_0x3a3f27=_0x1cc8ad[_0x6075('0x1d')],_0x3ddc8f=_0x1cc8ad[_0x6075('0x1d')]+_0x1cc8ad[_0x6075('0x1e')],_0x430ee0;if(_0x3ddc8f>=_0x5ba108){_0x3ddc8f=_0x5ba108;_0x430ee0=0xc8;}else{_0x430ee0=0xce;}_0xa9aec8[_0x6075('0x1a')](_0x430ee0);return _0xa9aec8[_0x6075('0x1f')](_0x6075('0x20'),_0x3a3f27+'-'+_0x3ddc8f+'/'+_0x5ba108)[_0x6075('0x1b')](_0x49432c);}return null;};}function patchUpdates(_0x237fdb){return function(_0x4ef90c){try{jsonpatch['apply'](_0x4ef90c,_0x237fdb,!![]);}catch(_0x32dcf1){return BPromise[_0x6075('0x21')](_0x32dcf1);}return _0x4ef90c[_0x6075('0x22')]();};}function saveUpdates(_0x1d408e,_0x537946){return function(_0x3bd44f){if(_0x3bd44f){return _0x3bd44f[_0x6075('0x23')](_0x1d408e)['then'](function(_0x27bc9a){return _0x27bc9a;});}return null;};}function removeEntity(_0x229728,_0x56daa2){return function(_0x589036){if(_0x589036){return _0x589036[_0x6075('0x24')]()[_0x6075('0x25')](function(){_0x229728[_0x6075('0x1a')](0xcc)[_0x6075('0x19')]();});}};}function handleEntityNotFound(_0x9b3195,_0x7f60ac){return function(_0x2bc24c){if(!_0x2bc24c){_0x9b3195[_0x6075('0x18')](0x194);}return _0x2bc24c;};}function handleError(_0x360bcd,_0x499726){_0x499726=_0x499726||0x1f4;return function(_0x2779e2){logger[_0x6075('0x26')](_0x2779e2['stack']);if(_0x2779e2['name']){delete _0x2779e2[_0x6075('0x27')];}_0x360bcd[_0x6075('0x1a')](_0x499726)[_0x6075('0x28')](_0x2779e2);};}exports[_0x6075('0x29')]=function(_0x2129d1,_0x5989c8){var _0x407944={},_0x5b7f5a={},_0x25fa1a={'count':0x0,'rows':[]};var _0xd9a9ca=_['map'](db['SalesforceField'][_0x6075('0x2a')],function(_0x4317e2){return{'name':_0x4317e2[_0x6075('0x2b')],'type':_0x4317e2[_0x6075('0x2c')][_0x6075('0x2d')]};});_0x5b7f5a[_0x6075('0x2e')]=_['map'](_0xd9a9ca,_0x6075('0x27'));_0x5b7f5a[_0x6075('0x2f')]=_[_0x6075('0x30')](_0x2129d1['query']);_0x5b7f5a[_0x6075('0x31')]=_[_0x6075('0x32')](_0x5b7f5a[_0x6075('0x2e')],_0x5b7f5a[_0x6075('0x2f')]);_0x407944[_0x6075('0x33')]=_[_0x6075('0x32')](_0x5b7f5a['model'],qs['fields'](_0x2129d1[_0x6075('0x2f')][_0x6075('0x34')]));_0x407944[_0x6075('0x33')]=_0x407944[_0x6075('0x33')]['length']?_0x407944['attributes']:_0x5b7f5a[_0x6075('0x2e')];if(!_0x2129d1[_0x6075('0x2f')][_0x6075('0x35')](_0x6075('0x36'))){_0x407944['limit']=qs['limit'](_0x2129d1[_0x6075('0x2f')]['limit']);_0x407944[_0x6075('0x1d')]=qs[_0x6075('0x1d')](_0x2129d1[_0x6075('0x2f')][_0x6075('0x1d')]);}_0x407944[_0x6075('0x37')]=qs[_0x6075('0x38')](_0x2129d1[_0x6075('0x2f')]['sort']);_0x407944[_0x6075('0x39')]=qs['filters'](_[_0x6075('0x3a')](_0x2129d1[_0x6075('0x2f')],_0x5b7f5a[_0x6075('0x31')]),_0xd9a9ca);if(_0x2129d1[_0x6075('0x2f')][_0x6075('0x3b')]){_0x407944[_0x6075('0x39')]=_[_0x6075('0x3c')](_0x407944[_0x6075('0x39')],{'$or':_[_0x6075('0x3d')](_0xd9a9ca,function(_0x3df956){if(_0x3df956[_0x6075('0x2c')]!==_0x6075('0x3e')){var _0x207a1f={};_0x207a1f[_0x3df956[_0x6075('0x27')]]={'$like':'%'+_0x2129d1['query']['filter']+'%'};return _0x207a1f;}})});}_0x407944=_[_0x6075('0x3c')]({},_0x407944,_0x2129d1[_0x6075('0x3f')]);var _0x1e730f={'where':_0x407944[_0x6075('0x39')]};return db[_0x6075('0x40')]['count'](_0x1e730f)[_0x6075('0x25')](function(_0x33e246){_0x25fa1a[_0x6075('0x1c')]=_0x33e246;if(_0x2129d1[_0x6075('0x2f')][_0x6075('0x41')]){_0x407944[_0x6075('0x42')]=[{'all':!![]}];}return db[_0x6075('0x40')]['findAll'](_0x407944);})[_0x6075('0x25')](function(_0x5dc9c0){_0x25fa1a[_0x6075('0x43')]=_0x5dc9c0;return _0x25fa1a;})[_0x6075('0x25')](respondWithFilteredResult(_0x5989c8,_0x407944))[_0x6075('0x44')](handleError(_0x5989c8,null));};exports[_0x6075('0x45')]=function(_0xd71054,_0x4d0021){var _0x2b801a={'raw':!![],'where':{'id':_0xd71054[_0x6075('0x46')]['id']}},_0x24e08a={};_0x24e08a[_0x6075('0x2e')]=_['keys'](db[_0x6075('0x40')][_0x6075('0x2a')]);_0x24e08a['query']=_['keys'](_0xd71054[_0x6075('0x2f')]);_0x24e08a[_0x6075('0x31')]=_[_0x6075('0x32')](_0x24e08a['model'],_0x24e08a['query']);_0x2b801a[_0x6075('0x33')]=_[_0x6075('0x32')](_0x24e08a['model'],qs['fields'](_0xd71054['query'][_0x6075('0x34')]));_0x2b801a[_0x6075('0x33')]=_0x2b801a[_0x6075('0x33')][_0x6075('0x47')]?_0x2b801a[_0x6075('0x33')]:_0x24e08a[_0x6075('0x2e')];if(_0xd71054[_0x6075('0x2f')][_0x6075('0x41')]){_0x2b801a[_0x6075('0x42')]=[{'all':!![]}];}_0x2b801a=_['merge']({},_0x2b801a,_0xd71054['options']);return db[_0x6075('0x40')][_0x6075('0x48')](_0x2b801a)[_0x6075('0x25')](handleEntityNotFound(_0x4d0021,null))['then'](respondWithResult(_0x4d0021,null))[_0x6075('0x44')](handleError(_0x4d0021,null));};exports[_0x6075('0x49')]=function(_0x330aa3,_0x504eee){return db[_0x6075('0x40')][_0x6075('0x49')](_0x330aa3[_0x6075('0x4a')],{})[_0x6075('0x25')](respondWithResult(_0x504eee,0xc9))[_0x6075('0x44')](handleError(_0x504eee,null));};exports['update']=function(_0x29d2eb,_0x54d266){if(_0x29d2eb[_0x6075('0x4a')]['id']){delete _0x29d2eb[_0x6075('0x4a')]['id'];}return db[_0x6075('0x40')]['find']({'where':{'id':_0x29d2eb[_0x6075('0x46')]['id']}})[_0x6075('0x25')](handleEntityNotFound(_0x54d266,null))[_0x6075('0x25')](saveUpdates(_0x29d2eb[_0x6075('0x4a')],null))[_0x6075('0x25')](respondWithResult(_0x54d266,null))[_0x6075('0x44')](handleError(_0x54d266,null));};exports[_0x6075('0x24')]=function(_0xd0c2a,_0xaf878a){return db['SalesforceField']['find']({'where':{'id':_0xd0c2a[_0x6075('0x46')]['id']}})[_0x6075('0x25')](handleEntityNotFound(_0xaf878a,null))[_0x6075('0x25')](removeEntity(_0xaf878a,null))['catch'](handleError(_0xaf878a,null));};
\ No newline at end of file
+var _0xc486=['html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','SalesforceField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','destroy'];(function(_0x5a1587,_0x57010){var _0xac74a7=function(_0x508371){while(--_0x508371){_0x5a1587['push'](_0x5a1587['shift']());}};_0xac74a7(++_0x57010);}(_0xc486,0x90));var _0x6c48=function(_0x5ea60d,_0xf1b6f3){_0x5ea60d=_0x5ea60d-0x0;var _0x1d14eb=_0xc486[_0x5ea60d];return _0x1d14eb;};'use strict';var pdf=require(_0x6c48('0x0'));var emlformat=require(_0x6c48('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6c48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c48('0x3'));var moment=require(_0x6c48('0x4'));var BPromise=require(_0x6c48('0x5'));var Mustache=require(_0x6c48('0x6'));var util=require(_0x6c48('0x7'));var path=require(_0x6c48('0x8'));var sox=require(_0x6c48('0x9'));var csv=require(_0x6c48('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6c48('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6c48('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6c48('0xd'));var Papa=require(_0x6c48('0xe'));var Redis=require(_0x6c48('0xf'));var authService=require(_0x6c48('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6c48('0x11'));var hardwareService=require(_0x6c48('0x12'));var logger=require('../../config/logger')(_0x6c48('0x13'));var utils=require('../../config/utils');var config=require(_0x6c48('0x14'));var db=require(_0x6c48('0x15'))['db'];function respondWithStatusCode(_0x38a418,_0x185e13){_0x185e13=_0x185e13||0xcc;return function(_0x52218b){if(_0x52218b){return _0x38a418['sendStatus'](_0x185e13);}return _0x38a418[_0x6c48('0x16')](_0x185e13)['end']();};}function respondWithResult(_0x2de8e5,_0x28f1e9){_0x28f1e9=_0x28f1e9||0xc8;return function(_0x23a482){if(_0x23a482){return _0x2de8e5[_0x6c48('0x16')](_0x28f1e9)[_0x6c48('0x17')](_0x23a482);}};}function respondWithFilteredResult(_0x32b69c,_0x158490){return function(_0x5deb13){if(_0x5deb13){var _0x1398a8=_0x5deb13['count'],_0x5c47cd=_0x158490[_0x6c48('0x18')],_0x449656=_0x158490[_0x6c48('0x18')]+_0x158490['limit'],_0x1c5098;if(_0x449656>=_0x1398a8){_0x449656=_0x1398a8;_0x1c5098=0xc8;}else{_0x1c5098=0xce;}_0x32b69c[_0x6c48('0x16')](_0x1c5098);return _0x32b69c[_0x6c48('0x19')](_0x6c48('0x1a'),_0x5c47cd+'-'+_0x449656+'/'+_0x1398a8)[_0x6c48('0x17')](_0x5deb13);}return null;};}function patchUpdates(_0x3cfa1d){return function(_0x4d970e){try{jsonpatch[_0x6c48('0x1b')](_0x4d970e,_0x3cfa1d,!![]);}catch(_0x514c32){return BPromise[_0x6c48('0x1c')](_0x514c32);}return _0x4d970e[_0x6c48('0x1d')]();};}function saveUpdates(_0x439f64,_0x3ae41a){return function(_0x4e63dc){if(_0x4e63dc){return _0x4e63dc[_0x6c48('0x1e')](_0x439f64)[_0x6c48('0x1f')](function(_0xa6add7){return _0xa6add7;});}return null;};}function removeEntity(_0x481e21,_0x5b5e97){return function(_0x2c64a2){if(_0x2c64a2){return _0x2c64a2['destroy']()[_0x6c48('0x1f')](function(){_0x481e21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5edfcd,_0x232bc3){return function(_0x49987b){if(!_0x49987b){_0x5edfcd['sendStatus'](0x194);}return _0x49987b;};}function handleError(_0x157f89,_0x57dd11){_0x57dd11=_0x57dd11||0x1f4;return function(_0x98aa00){logger[_0x6c48('0x20')](_0x98aa00['stack']);if(_0x98aa00[_0x6c48('0x21')]){delete _0x98aa00[_0x6c48('0x21')];}_0x157f89[_0x6c48('0x16')](_0x57dd11)[_0x6c48('0x22')](_0x98aa00);};}exports[_0x6c48('0x23')]=function(_0x22f7d3,_0x3633ff){var _0x4a5035={},_0x20b06b={},_0x146c3a={'count':0x0,'rows':[]};var _0x51872e=_['map'](db[_0x6c48('0x24')][_0x6c48('0x25')],function(_0x27eb80){return{'name':_0x27eb80[_0x6c48('0x26')],'type':_0x27eb80['type'][_0x6c48('0x27')]};});_0x20b06b[_0x6c48('0x28')]=_[_0x6c48('0x29')](_0x51872e,_0x6c48('0x21'));_0x20b06b[_0x6c48('0x2a')]=_[_0x6c48('0x2b')](_0x22f7d3[_0x6c48('0x2a')]);_0x20b06b[_0x6c48('0x2c')]=_[_0x6c48('0x2d')](_0x20b06b[_0x6c48('0x28')],_0x20b06b['query']);_0x4a5035[_0x6c48('0x2e')]=_[_0x6c48('0x2d')](_0x20b06b[_0x6c48('0x28')],qs[_0x6c48('0x2f')](_0x22f7d3[_0x6c48('0x2a')][_0x6c48('0x2f')]));_0x4a5035[_0x6c48('0x2e')]=_0x4a5035[_0x6c48('0x2e')]['length']?_0x4a5035[_0x6c48('0x2e')]:_0x20b06b[_0x6c48('0x28')];if(!_0x22f7d3[_0x6c48('0x2a')][_0x6c48('0x30')](_0x6c48('0x31'))){_0x4a5035[_0x6c48('0x32')]=qs[_0x6c48('0x32')](_0x22f7d3[_0x6c48('0x2a')]['limit']);_0x4a5035[_0x6c48('0x18')]=qs[_0x6c48('0x18')](_0x22f7d3[_0x6c48('0x2a')][_0x6c48('0x18')]);}_0x4a5035[_0x6c48('0x33')]=qs[_0x6c48('0x34')](_0x22f7d3[_0x6c48('0x2a')][_0x6c48('0x34')]);_0x4a5035[_0x6c48('0x35')]=qs['filters'](_[_0x6c48('0x36')](_0x22f7d3[_0x6c48('0x2a')],_0x20b06b[_0x6c48('0x2c')]),_0x51872e);if(_0x22f7d3[_0x6c48('0x2a')][_0x6c48('0x37')]){_0x4a5035[_0x6c48('0x35')]=_[_0x6c48('0x38')](_0x4a5035[_0x6c48('0x35')],{'$or':_[_0x6c48('0x29')](_0x51872e,function(_0x445817){if(_0x445817['type']!==_0x6c48('0x39')){var _0x3ff6b1={};_0x3ff6b1[_0x445817[_0x6c48('0x21')]]={'$like':'%'+_0x22f7d3['query'][_0x6c48('0x37')]+'%'};return _0x3ff6b1;}})});}_0x4a5035=_['merge']({},_0x4a5035,_0x22f7d3[_0x6c48('0x3a')]);var _0xfef8e4={'where':_0x4a5035[_0x6c48('0x35')]};return db[_0x6c48('0x24')]['count'](_0xfef8e4)['then'](function(_0x427aae){_0x146c3a[_0x6c48('0x3b')]=_0x427aae;if(_0x22f7d3[_0x6c48('0x2a')][_0x6c48('0x3c')]){_0x4a5035['include']=[{'all':!![]}];}return db[_0x6c48('0x24')][_0x6c48('0x3d')](_0x4a5035);})[_0x6c48('0x1f')](function(_0x441640){_0x146c3a[_0x6c48('0x3e')]=_0x441640;return _0x146c3a;})[_0x6c48('0x1f')](respondWithFilteredResult(_0x3633ff,_0x4a5035))[_0x6c48('0x3f')](handleError(_0x3633ff,null));};exports[_0x6c48('0x40')]=function(_0x5858f7,_0x5eb4fc){var _0x3de9db={'raw':!![],'where':{'id':_0x5858f7[_0x6c48('0x41')]['id']}},_0x54ac88={};_0x54ac88['model']=_[_0x6c48('0x2b')](db['SalesforceField'][_0x6c48('0x25')]);_0x54ac88['query']=_[_0x6c48('0x2b')](_0x5858f7[_0x6c48('0x2a')]);_0x54ac88[_0x6c48('0x2c')]=_[_0x6c48('0x2d')](_0x54ac88[_0x6c48('0x28')],_0x54ac88[_0x6c48('0x2a')]);_0x3de9db[_0x6c48('0x2e')]=_[_0x6c48('0x2d')](_0x54ac88[_0x6c48('0x28')],qs[_0x6c48('0x2f')](_0x5858f7[_0x6c48('0x2a')][_0x6c48('0x2f')]));_0x3de9db[_0x6c48('0x2e')]=_0x3de9db['attributes'][_0x6c48('0x42')]?_0x3de9db[_0x6c48('0x2e')]:_0x54ac88[_0x6c48('0x28')];if(_0x5858f7[_0x6c48('0x2a')][_0x6c48('0x3c')]){_0x3de9db[_0x6c48('0x43')]=[{'all':!![]}];}_0x3de9db=_[_0x6c48('0x38')]({},_0x3de9db,_0x5858f7[_0x6c48('0x3a')]);return db[_0x6c48('0x24')]['find'](_0x3de9db)[_0x6c48('0x1f')](handleEntityNotFound(_0x5eb4fc,null))['then'](respondWithResult(_0x5eb4fc,null))[_0x6c48('0x3f')](handleError(_0x5eb4fc,null));};exports[_0x6c48('0x44')]=function(_0x45ddc0,_0x2d3894){return db['SalesforceField'][_0x6c48('0x44')](_0x45ddc0['body'],{})[_0x6c48('0x1f')](respondWithResult(_0x2d3894,0xc9))[_0x6c48('0x3f')](handleError(_0x2d3894,null));};exports[_0x6c48('0x1e')]=function(_0x2860af,_0x51c596){if(_0x2860af[_0x6c48('0x45')]['id']){delete _0x2860af[_0x6c48('0x45')]['id'];}return db[_0x6c48('0x24')][_0x6c48('0x46')]({'where':{'id':_0x2860af[_0x6c48('0x41')]['id']}})[_0x6c48('0x1f')](handleEntityNotFound(_0x51c596,null))[_0x6c48('0x1f')](saveUpdates(_0x2860af[_0x6c48('0x45')],null))[_0x6c48('0x1f')](respondWithResult(_0x51c596,null))[_0x6c48('0x3f')](handleError(_0x51c596,null));};exports[_0x6c48('0x47')]=function(_0x290805,_0x2da04e){return db[_0x6c48('0x24')]['find']({'where':{'id':_0x290805[_0x6c48('0x41')]['id']}})['then'](handleEntityNotFound(_0x2da04e,null))[_0x6c48('0x1f')](removeEntity(_0x2da04e,null))[_0x6c48('0x3f')](handleError(_0x2da04e,null));};
\ No newline at end of file
index ed8ad50..7d93e40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe444=['request-promise','path','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','lodash','util','moment','bluebird'];(function(_0xfb58a,_0x586f3b){var _0x30636e=function(_0x31da08){while(--_0x31da08){_0xfb58a['push'](_0xfb58a['shift']());}};_0x30636e(++_0x586f3b);}(_0xe444,0xe0));var _0x4e44=function(_0x48155e,_0x1aff04){_0x48155e=_0x48155e-0x0;var _0xac4c77=_0xe444[_0x48155e];return _0xac4c77;};'use strict';var _=require(_0x4e44('0x0'));var util=require(_0x4e44('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4e44('0x2'));var BPromise=require(_0x4e44('0x3'));var rp=require(_0x4e44('0x4'));var fs=require('fs');var path=require(_0x4e44('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4e44('0x6'));module[_0x4e44('0x7')]=function(_0x31b783,_0x59c7d1){return _0x31b783[_0x4e44('0x8')](_0x4e44('0x9'),attributes,{'tableName':_0x4e44('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x4e44('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c39=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','SalesforceField','salesforce_unique_index','idField','lodash'];(function(_0x46489e,_0x21b63f){var _0x145e7b=function(_0x47f35f){while(--_0x47f35f){_0x46489e['push'](_0x46489e['shift']());}};_0x145e7b(++_0x21b63f);}(_0x8c39,0x1df));var _0x98c3=function(_0xb2b3a8,_0x44b68d){_0xb2b3a8=_0xb2b3a8-0x0;var _0x1a2865=_0x8c39[_0xb2b3a8];return _0x1a2865;};'use strict';var _=require(_0x98c3('0x0'));var util=require('util');var logger=require(_0x98c3('0x1'))(_0x98c3('0x2'));var moment=require(_0x98c3('0x3'));var BPromise=require(_0x98c3('0x4'));var rp=require(_0x98c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98c3('0x6'));var config=require(_0x98c3('0x7'));var attributes=require(_0x98c3('0x8'));module['exports']=function(_0x1bee5c,_0xfc9011){return _0x1bee5c['define'](_0x98c3('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x98c3('0xa'),'fields':[_0x98c3('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 49b7ff5..c704e74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['rpc','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0xda3f,0xec));var _0xfda3=function(_0x124d86,_0x19bd83){_0x124d86=_0x124d86-0x0;var _0x1b4f2d=_0xda3f[_0x124d86];return _0x1b4f2d;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('SalesforceField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
+var _0x5b02=['client','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0x5b02,0xe9));var _0x25b0=function(_0x23abc4,_0x3e2bed){_0x23abc4=_0x23abc4-0x0;var _0x40c953=_0x5b02[_0x23abc4];return _0x40c953;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var BPromise=require(_0x25b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x25b0('0x5'))(_0x25b0('0x6'));var config=require(_0x25b0('0x7'));var jayson=require(_0x25b0('0x8'));var client=jayson[_0x25b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d82c6,_0xd8276d,_0x49ef3a){return new BPromise(function(_0x412954,_0x4d3e71){return client['request'](_0x1d82c6,_0x49ef3a)[_0x25b0('0xa')](function(_0x45429b){logger[_0x25b0('0xb')]('SalesforceField,\x20%s,\x20%s',_0xd8276d,_0x25b0('0xc'));logger[_0x25b0('0xd')](_0x25b0('0xe'),_0xd8276d,_0x25b0('0xc'),JSON[_0x25b0('0xf')](_0x45429b));if(_0x45429b[_0x25b0('0x10')]){if(_0x45429b[_0x25b0('0x10')][_0x25b0('0x11')]===0x1f4){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x4d3e71(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x412954(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}else{logger[_0x25b0('0xb')]('SalesforceField,\x20%s,\x20%s',_0xd8276d,'request\x20sent');_0x412954(_0x45429b[_0x25b0('0x14')]['message']);}})[_0x25b0('0x15')](function(_0x1d009f){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x1d009f);_0x4d3e71(_0x1d009f);});});}
\ No newline at end of file
index 638b137..9ecbb7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3c6=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x3c28e7,_0x169024){var _0x557b3a=function(_0x42bf71){while(--_0x42bf71){_0x3c28e7['push'](_0x3c28e7['shift']());}};_0x557b3a(++_0x169024);}(_0xd3c6,0x121));var _0x6d3c=function(_0x364804,_0x11dbae){_0x364804=_0x364804-0x0;var _0x49a28=_0xd3c6[_0x364804];return _0x49a28;};'use strict';var multer=require(_0x6d3c('0x0'));var util=require(_0x6d3c('0x1'));var path=require(_0x6d3c('0x2'));var timeout=require(_0x6d3c('0x3'));var express=require(_0x6d3c('0x4'));var router=express[_0x6d3c('0x5')]();var auth=require(_0x6d3c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d3c('0x7'));var controller=require(_0x6d3c('0x8'));router['get']('/',auth[_0x6d3c('0x9')](),controller[_0x6d3c('0xa')]);router[_0x6d3c('0xb')](_0x6d3c('0xc'),auth[_0x6d3c('0x9')](),controller[_0x6d3c('0xd')]);router[_0x6d3c('0xb')](_0x6d3c('0xe'),auth[_0x6d3c('0x9')](),controller[_0x6d3c('0xf')]);router[_0x6d3c('0xb')](_0x6d3c('0x10'),auth[_0x6d3c('0x9')](),controller[_0x6d3c('0x11')]);router[_0x6d3c('0x12')]('/',auth['isAuthenticated'](),controller[_0x6d3c('0x13')]);router[_0x6d3c('0x12')](_0x6d3c('0xe'),auth[_0x6d3c('0x9')](),controller[_0x6d3c('0x14')]);router[_0x6d3c('0x15')](_0x6d3c('0xc'),auth[_0x6d3c('0x9')](),controller[_0x6d3c('0x16')]);router[_0x6d3c('0x17')](_0x6d3c('0xc'),auth[_0x6d3c('0x9')](),controller[_0x6d3c('0x18')]);module[_0x6d3c('0x19')]=router;
\ No newline at end of file
+var _0xac47=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x32ac3c,_0x5e79c4){var _0x1ba6ca=function(_0x2808d2){while(--_0x2808d2){_0x32ac3c['push'](_0x32ac3c['shift']());}};_0x1ba6ca(++_0x5e79c4);}(_0xac47,0x1af));var _0x7ac4=function(_0x4d0bca,_0x4711aa){_0x4d0bca=_0x4d0bca-0x0;var _0x3a1dbd=_0xac47[_0x4d0bca];return _0x3a1dbd;};'use strict';var multer=require(_0x7ac4('0x0'));var util=require(_0x7ac4('0x1'));var path=require(_0x7ac4('0x2'));var timeout=require(_0x7ac4('0x3'));var express=require(_0x7ac4('0x4'));var router=express[_0x7ac4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7ac4('0x6'));var config=require(_0x7ac4('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x7ac4('0x8')]('/',auth[_0x7ac4('0x9')](),controller[_0x7ac4('0xa')]);router[_0x7ac4('0x8')](_0x7ac4('0xb'),auth['isAuthenticated'](),controller[_0x7ac4('0xc')]);router[_0x7ac4('0x8')](_0x7ac4('0xd'),auth[_0x7ac4('0x9')](),controller[_0x7ac4('0xe')]);router[_0x7ac4('0x8')](_0x7ac4('0xf'),auth[_0x7ac4('0x9')](),controller[_0x7ac4('0x10')]);router[_0x7ac4('0x11')]('/',auth[_0x7ac4('0x9')](),controller['create']);router[_0x7ac4('0x11')](_0x7ac4('0xd'),auth[_0x7ac4('0x9')](),controller['addConfiguration']);router[_0x7ac4('0x12')](_0x7ac4('0xb'),auth[_0x7ac4('0x9')](),controller['update']);router['delete'](_0x7ac4('0xb'),auth[_0x7ac4('0x9')](),controller['destroy']);module[_0x7ac4('0x13')]=router;
\ No newline at end of file
index 7c21b6a..cead01c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe448=['STRING','remoteUri','sequelize','exports'];(function(_0x17a232,_0x1569c9){var _0xc333f6=function(_0x23ad18){while(--_0x23ad18){_0x17a232['push'](_0x17a232['shift']());}};_0xc333f6(++_0x1569c9);}(_0xe448,0xe2));var _0x8e44=function(_0x4971bf,_0x2c0bcb){_0x4971bf=_0x4971bf-0x0;var _0x772b5f=_0xe448[_0x4971bf];return _0x772b5f;};'use strict';var Sequelize=require(_0x8e44('0x0'));module[_0x8e44('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e44('0x2')]},'username':{'type':Sequelize[_0x8e44('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x8e44('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8e44('0x3')},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x029e=['remoteUri','username','STRING'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x029e,0x16c));var _0xe029=function(_0x3aee94,_0xe799e5){_0x3aee94=_0x3aee94-0x0;var _0x7019df=_0x029e[_0x3aee94];return _0x7019df;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xe029('0x0')},'password':{'type':Sequelize[_0xe029('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe029('0x1')],'unique':_0xe029('0x2')},'serverUrl':{'type':Sequelize[_0xe029('0x1')]}};
\ No newline at end of file
index 50aa761..933a1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf22=['subcategory','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','knowledge','closed_at','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','close_code','correlation_display','work_start','assignment_group','business_stc','description','calendar_duration','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','severity','comments','comments_and_work_notes','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','substring','%s/api/now/doc/table/schema/','%s/api/now/table/','password','includes','internalType','label','push','all','assign','log','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','statusCode','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','limit','Content-Range','json','reject','save','update','destroy','stack','name','send','index','map','ServicenowAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','type','count','includeAll','include','rows','show','params','options','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason'];(function(_0x5bbcdf,_0x4ad358){var _0x4ef5c7=function(_0x473cfe){while(--_0x473cfe){_0x5bbcdf['push'](_0x5bbcdf['shift']());}};_0x4ef5c7(++_0x4ad358);}(_0xbf22,0x11c));var _0x2bf2=function(_0x237140,_0x5c3792){_0x237140=_0x237140-0x0;var _0x4bffea=_0xbf22[_0x237140];return _0x4bffea;};'use strict';var pdf=require(_0x2bf2('0x0'));var emlformat=require(_0x2bf2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2bf2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2bf2('0x3'));var moment=require(_0x2bf2('0x4'));var BPromise=require(_0x2bf2('0x5'));var Mustache=require('mustache');var util=require(_0x2bf2('0x6'));var path=require(_0x2bf2('0x7'));var sox=require(_0x2bf2('0x8'));var csv=require(_0x2bf2('0x9'));var ejs=require(_0x2bf2('0xa'));var fs=require('fs');var _=require(_0x2bf2('0xb'));var squel=require('squel');var crypto=require(_0x2bf2('0xc'));var jsforce=require(_0x2bf2('0xd'));var deskjs=require(_0x2bf2('0xe'));var toCsv=require(_0x2bf2('0x9'));var querystring=require(_0x2bf2('0xf'));var Papa=require(_0x2bf2('0x10'));var Redis=require('ioredis');var authService=require(_0x2bf2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2bf2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bf2('0x13'))(_0x2bf2('0x14'));var utils=require(_0x2bf2('0x15'));var config=require(_0x2bf2('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2bf2('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x2bf2('0x18')][_0x2bf2('0x19')]({'port':0x232a});function checkPasswordPattern(_0x32ff0a,_0x590636,_0x53cce0){if(_0x53cce0){var _0x814231=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x814231[_0x2bf2('0x1a')](_0x590636)){return _0x32ff0a;}else{throw new db[(_0x2bf2('0x1b'))][(_0x2bf2('0x1c'))](_0x2bf2('0x1d'));}}else{return _0x32ff0a;}}function respondWithRpcPromise(_0x5ecdb2,_0x5e863c,_0x1f7e42,_0x56570d){return new BPromise(function(_0x269702,_0x49eee3){var _0x5dae46=_0x56570d||client;return _0x5dae46[_0x2bf2('0x1e')](_0x5ecdb2,_0x1f7e42)[_0x2bf2('0x1f')](function(_0x15a66e){logger[_0x2bf2('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x5e863c,_0x2bf2('0x21'));logger[_0x2bf2('0x22')](_0x2bf2('0x23'),_0x5e863c,_0x2bf2('0x21'),JSON[_0x2bf2('0x24')](_0x15a66e));if(_0x15a66e[_0x2bf2('0x25')]){if(_0x15a66e[_0x2bf2('0x25')][_0x2bf2('0x26')]===0x1f4){logger['error'](_0x2bf2('0x27'),_0x5e863c,_0x15a66e[_0x2bf2('0x25')][_0x2bf2('0x28')]);return _0x49eee3(_0x15a66e['error'][_0x2bf2('0x28')]);}logger['error'](_0x2bf2('0x27'),_0x5e863c,_0x15a66e[_0x2bf2('0x25')][_0x2bf2('0x28')]);return _0x269702(_0x15a66e[_0x2bf2('0x25')][_0x2bf2('0x28')]);}else{logger['info'](_0x2bf2('0x27'),_0x5e863c,_0x2bf2('0x21'));_0x269702(_0x15a66e[_0x2bf2('0x29')][_0x2bf2('0x28')]);}})[_0x2bf2('0x2a')](function(_0x1b1792){logger['error'](_0x2bf2('0x27'),_0x5e863c,_0x1b1792);_0x49eee3(_0x1b1792);});});}function respondWithStatusCode(_0x649003,_0x3f47db){_0x3f47db=_0x3f47db||0xcc;return function(_0x4f53df){if(_0x4f53df){return _0x649003[_0x2bf2('0x2b')](_0x3f47db);}return _0x649003[_0x2bf2('0x2c')](_0x3f47db)[_0x2bf2('0x2d')]();};}function respondWithResult(_0x1ade12,_0x4d6102){_0x4d6102=_0x4d6102||0xc8;return function(_0x147b0c){if(_0x147b0c){return _0x1ade12[_0x2bf2('0x2c')](_0x4d6102)['json'](_0x147b0c);}};}function respondWithFilteredResult(_0x418885,_0x42d2d9){return function(_0x7f4d4c){if(_0x7f4d4c){var _0x28de39=_0x7f4d4c['count'],_0x328d50=_0x42d2d9['offset'],_0x11b010=_0x42d2d9['offset']+_0x42d2d9[_0x2bf2('0x2e')],_0xc5ea12;if(_0x11b010>=_0x28de39){_0x11b010=_0x28de39;_0xc5ea12=0xc8;}else{_0xc5ea12=0xce;}_0x418885[_0x2bf2('0x2c')](_0xc5ea12);return _0x418885['set'](_0x2bf2('0x2f'),_0x328d50+'-'+_0x11b010+'/'+_0x28de39)[_0x2bf2('0x30')](_0x7f4d4c);}return null;};}function patchUpdates(_0x5546ba){return function(_0x230d9d){try{jsonpatch['apply'](_0x230d9d,_0x5546ba,!![]);}catch(_0xe53ccd){return BPromise[_0x2bf2('0x31')](_0xe53ccd);}return _0x230d9d[_0x2bf2('0x32')]();};}function saveUpdates(_0x2d69c9,_0x167d04){return function(_0xb01ca1){if(_0xb01ca1){return _0xb01ca1[_0x2bf2('0x33')](_0x2d69c9)['then'](function(_0x15e97d){return _0x15e97d;});}return null;};}function removeEntity(_0x46e099,_0xa0b892){return function(_0x40ff4a){if(_0x40ff4a){return _0x40ff4a[_0x2bf2('0x34')]()['then'](function(){_0x46e099[_0x2bf2('0x2c')](0xcc)[_0x2bf2('0x2d')]();});}};}function handleEntityNotFound(_0x1f0c5d,_0x4c168f){return function(_0x18cdd7){if(!_0x18cdd7){_0x1f0c5d[_0x2bf2('0x2b')](0x194);}return _0x18cdd7;};}function handleError(_0x2ad64e,_0x44719c){_0x44719c=_0x44719c||0x1f4;return function(_0x3e8f75){logger[_0x2bf2('0x25')](_0x3e8f75[_0x2bf2('0x35')]);if(_0x3e8f75['name']){delete _0x3e8f75[_0x2bf2('0x36')];}_0x2ad64e[_0x2bf2('0x2c')](_0x44719c)[_0x2bf2('0x37')](_0x3e8f75);};}exports[_0x2bf2('0x38')]=function(_0xf4a045,_0x14d98d){var _0x5eb795={},_0x66d61f={},_0x11ef30={'count':0x0,'rows':[]};var _0x571616=_[_0x2bf2('0x39')](db[_0x2bf2('0x3a')][_0x2bf2('0x3b')],function(_0x4c346a){return{'name':_0x4c346a['fieldName'],'type':_0x4c346a['type'][_0x2bf2('0x3c')]};});_0x66d61f[_0x2bf2('0x3d')]=_[_0x2bf2('0x39')](_0x571616,_0x2bf2('0x36'));_0x66d61f[_0x2bf2('0x3e')]=_[_0x2bf2('0x3f')](_0xf4a045[_0x2bf2('0x3e')]);_0x66d61f[_0x2bf2('0x40')]=_[_0x2bf2('0x41')](_0x66d61f[_0x2bf2('0x3d')],_0x66d61f[_0x2bf2('0x3e')]);_0x5eb795[_0x2bf2('0x42')]=_[_0x2bf2('0x41')](_0x66d61f['model'],qs[_0x2bf2('0x43')](_0xf4a045[_0x2bf2('0x3e')]['fields']));_0x5eb795['attributes']=_0x5eb795['attributes'][_0x2bf2('0x44')]?_0x5eb795[_0x2bf2('0x42')]:_0x66d61f[_0x2bf2('0x3d')];if(!_0xf4a045[_0x2bf2('0x3e')][_0x2bf2('0x45')](_0x2bf2('0x46'))){_0x5eb795['limit']=qs[_0x2bf2('0x2e')](_0xf4a045['query'][_0x2bf2('0x2e')]);_0x5eb795[_0x2bf2('0x47')]=qs['offset'](_0xf4a045['query']['offset']);}_0x5eb795[_0x2bf2('0x48')]=qs[_0x2bf2('0x49')](_0xf4a045[_0x2bf2('0x3e')][_0x2bf2('0x49')]);_0x5eb795['where']=qs[_0x2bf2('0x40')](_[_0x2bf2('0x4a')](_0xf4a045[_0x2bf2('0x3e')],_0x66d61f[_0x2bf2('0x40')]),_0x571616);if(_0xf4a045[_0x2bf2('0x3e')][_0x2bf2('0x4b')]){_0x5eb795[_0x2bf2('0x4c')]=_[_0x2bf2('0x4d')](_0x5eb795[_0x2bf2('0x4c')],{'$or':_[_0x2bf2('0x39')](_0x571616,function(_0x17e831){if(_0x17e831[_0x2bf2('0x4e')]!=='VIRTUAL'){var _0x655936={};_0x655936[_0x17e831[_0x2bf2('0x36')]]={'$like':'%'+_0xf4a045[_0x2bf2('0x3e')][_0x2bf2('0x4b')]+'%'};return _0x655936;}})});}_0x5eb795=_[_0x2bf2('0x4d')]({},_0x5eb795,_0xf4a045['options']);var _0x22b065={'where':_0x5eb795['where']};return db[_0x2bf2('0x3a')][_0x2bf2('0x4f')](_0x22b065)[_0x2bf2('0x1f')](function(_0x31c53d){_0x11ef30[_0x2bf2('0x4f')]=_0x31c53d;if(_0xf4a045['query'][_0x2bf2('0x50')]){_0x5eb795[_0x2bf2('0x51')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x5eb795);})[_0x2bf2('0x1f')](function(_0x5ce309){_0x11ef30[_0x2bf2('0x52')]=_0x5ce309;return _0x11ef30;})[_0x2bf2('0x1f')](respondWithFilteredResult(_0x14d98d,_0x5eb795))[_0x2bf2('0x2a')](handleError(_0x14d98d,null));};exports[_0x2bf2('0x53')]=function(_0x3002a8,_0xebc5a4){var _0x5dc900={'raw':![],'where':{'id':_0x3002a8[_0x2bf2('0x54')]['id']}},_0x4cb40c={};_0x4cb40c[_0x2bf2('0x3d')]=_[_0x2bf2('0x3f')](db[_0x2bf2('0x3a')][_0x2bf2('0x3b')]);_0x4cb40c[_0x2bf2('0x3e')]=_[_0x2bf2('0x3f')](_0x3002a8[_0x2bf2('0x3e')]);_0x4cb40c[_0x2bf2('0x40')]=_['intersection'](_0x4cb40c[_0x2bf2('0x3d')],_0x4cb40c[_0x2bf2('0x3e')]);_0x5dc900[_0x2bf2('0x42')]=_[_0x2bf2('0x41')](_0x4cb40c['model'],qs['fields'](_0x3002a8[_0x2bf2('0x3e')]['fields']));_0x5dc900[_0x2bf2('0x42')]=_0x5dc900[_0x2bf2('0x42')][_0x2bf2('0x44')]?_0x5dc900[_0x2bf2('0x42')]:_0x4cb40c['model'];if(_0x3002a8['query'][_0x2bf2('0x50')]){_0x5dc900[_0x2bf2('0x51')]=[{'all':!![]}];}_0x5dc900=_[_0x2bf2('0x4d')]({},_0x5dc900,_0x3002a8[_0x2bf2('0x55')]);return db[_0x2bf2('0x3a')][_0x2bf2('0x56')](_0x5dc900)[_0x2bf2('0x1f')](handleEntityNotFound(_0xebc5a4,null))[_0x2bf2('0x1f')](respondWithResult(_0xebc5a4,null))[_0x2bf2('0x2a')](handleError(_0xebc5a4,null));};exports[_0x2bf2('0x57')]=function(_0x4e83c2,_0x3813e7){return db[_0x2bf2('0x3a')][_0x2bf2('0x57')](_0x4e83c2[_0x2bf2('0x58')],{})[_0x2bf2('0x1f')](respondWithResult(_0x3813e7,0xc9))['catch'](handleError(_0x3813e7,null));};exports[_0x2bf2('0x33')]=function(_0x3d4727,_0x5dfbdf){if(_0x3d4727[_0x2bf2('0x58')]['id']){delete _0x3d4727['body']['id'];}return db[_0x2bf2('0x3a')][_0x2bf2('0x56')]({'where':{'id':_0x3d4727[_0x2bf2('0x54')]['id']}})[_0x2bf2('0x1f')](handleEntityNotFound(_0x5dfbdf,null))['then'](saveUpdates(_0x3d4727[_0x2bf2('0x58')],null))['then'](respondWithResult(_0x5dfbdf,null))[_0x2bf2('0x2a')](handleError(_0x5dfbdf,null));};exports[_0x2bf2('0x34')]=function(_0x4abe5e,_0x25226e){return db[_0x2bf2('0x3a')][_0x2bf2('0x56')]({'where':{'id':_0x4abe5e['params']['id']}})[_0x2bf2('0x1f')](handleEntityNotFound(_0x25226e,null))['then'](removeEntity(_0x25226e,null))[_0x2bf2('0x2a')](handleError(_0x25226e,null));};exports[_0x2bf2('0x59')]=function(_0x352313,_0x353b00,_0x58f158){var _0x2b2ce6={};var _0x44e39c={};var _0x51dac4;var _0x2d0089;return db[_0x2bf2('0x3a')][_0x2bf2('0x5a')]({'where':{'id':_0x352313[_0x2bf2('0x54')]['id']}})['then'](handleEntityNotFound(_0x353b00,null))[_0x2bf2('0x1f')](function(_0x3ad6b9){if(_0x3ad6b9){_0x51dac4=_0x3ad6b9;_0x44e39c[_0x2bf2('0x3d')]=_[_0x2bf2('0x3f')](db[_0x2bf2('0x5b')][_0x2bf2('0x3b')]);_0x44e39c['query']=_[_0x2bf2('0x3f')](_0x352313[_0x2bf2('0x3e')]);_0x44e39c[_0x2bf2('0x40')]=_[_0x2bf2('0x41')](_0x44e39c[_0x2bf2('0x3d')],_0x44e39c[_0x2bf2('0x3e')]);_0x2b2ce6['attributes']=_[_0x2bf2('0x41')](_0x44e39c[_0x2bf2('0x3d')],qs[_0x2bf2('0x43')](_0x352313[_0x2bf2('0x3e')][_0x2bf2('0x43')]));_0x2b2ce6['attributes']=_0x2b2ce6[_0x2bf2('0x42')][_0x2bf2('0x44')]?_0x2b2ce6[_0x2bf2('0x42')]:_0x44e39c[_0x2bf2('0x3d')];_0x2b2ce6['order']=qs[_0x2bf2('0x49')](_0x352313[_0x2bf2('0x3e')][_0x2bf2('0x49')]);_0x2b2ce6[_0x2bf2('0x4c')]=qs[_0x2bf2('0x40')](_['pick'](_0x352313[_0x2bf2('0x3e')],_0x44e39c[_0x2bf2('0x40')]));if(_0x352313[_0x2bf2('0x3e')][_0x2bf2('0x4b')]){_0x2b2ce6[_0x2bf2('0x4c')]=_[_0x2bf2('0x4d')](_0x2b2ce6[_0x2bf2('0x4c')],{'$or':_['map'](_0x2b2ce6[_0x2bf2('0x42')],function(_0x4282ca){var _0x5d6acf={};_0x5d6acf[_0x4282ca]={'$like':'%'+_0x352313[_0x2bf2('0x3e')]['filter']+'%'};return _0x5d6acf;})});}_0x2b2ce6=_[_0x2bf2('0x4d')]({},_0x2b2ce6,_0x352313['options']);return _0x51dac4[_0x2bf2('0x59')](_0x2b2ce6);}})[_0x2bf2('0x1f')](function(_0x5571c9){if(_0x5571c9){_0x2d0089=_0x5571c9['length'];if(!_0x352313[_0x2bf2('0x3e')][_0x2bf2('0x45')](_0x2bf2('0x46'))){_0x2b2ce6[_0x2bf2('0x2e')]=qs['limit'](_0x352313[_0x2bf2('0x3e')][_0x2bf2('0x2e')]);_0x2b2ce6['offset']=qs[_0x2bf2('0x47')](_0x352313[_0x2bf2('0x3e')][_0x2bf2('0x47')]);}return _0x51dac4[_0x2bf2('0x59')](_0x2b2ce6);}})[_0x2bf2('0x1f')](function(_0x159ed7){if(_0x159ed7){return _0x159ed7?{'count':_0x2d0089,'rows':_0x159ed7}:null;}})[_0x2bf2('0x1f')](respondWithResult(_0x353b00,null))[_0x2bf2('0x2a')](handleError(_0x353b00,null));};exports[_0x2bf2('0x5c')]=function(_0x3f1580,_0x18cc21,_0x472bab){if(_0x3f1580['body']['id']){delete _0x3f1580[_0x2bf2('0x58')]['id'];}return db[_0x2bf2('0x3a')][_0x2bf2('0x5a')]({'where':{'id':_0x3f1580['params']['id']}})[_0x2bf2('0x1f')](handleEntityNotFound(_0x18cc21,null))[_0x2bf2('0x1f')](function(_0x5dcc02){if(_0x5dcc02){_0x3f1580[_0x2bf2('0x58')][_0x2bf2('0x5d')]=_0x5dcc02['id'];_0x3f1580[_0x2bf2('0x58')][_0x2bf2('0x5e')]=integrations['getSubjects'](_0x3f1580['body'][_0x2bf2('0x5f')],_0x3f1580['body']['type']);_0x3f1580[_0x2bf2('0x58')][_0x2bf2('0x60')]=integrations[_0x2bf2('0x61')](_0x3f1580[_0x2bf2('0x58')][_0x2bf2('0x5f')],_0x3f1580[_0x2bf2('0x58')][_0x2bf2('0x4e')]);return db[_0x2bf2('0x5b')][_0x2bf2('0x57')](_0x3f1580['body'],{'include':[{'model':db[_0x2bf2('0x62')],'as':_0x2bf2('0x5e')},{'model':db[_0x2bf2('0x62')],'as':'Descriptions'}]});}return null;})[_0x2bf2('0x1f')](respondWithResult(_0x18cc21,null))[_0x2bf2('0x2a')](handleError(_0x18cc21,null));};exports[_0x2bf2('0x63')]=function(_0x48cc23,_0xa7a14c,_0x48b80a){var _0x38e75e=[_0x2bf2('0x64'),_0x2bf2('0x65'),'knowledge',_0x2bf2('0x66'),'close_code',_0x2bf2('0x67'),_0x2bf2('0x68'),'severity',_0x2bf2('0x69')];var _0x20066e=[_0x2bf2('0x6a'),_0x2bf2('0x64'),_0x2bf2('0x6b'),_0x2bf2('0x6c'),_0x2bf2('0x6d'),_0x2bf2('0x6e'),'child_incidents',_0x2bf2('0x65'),_0x2bf2('0x6f'),_0x2bf2('0x70'),_0x2bf2('0x71'),_0x2bf2('0x72'),_0x2bf2('0x73'),_0x2bf2('0x74'),_0x2bf2('0x75'),_0x2bf2('0x76'),'state','sys_created_by',_0x2bf2('0x77'),_0x2bf2('0x48'),'calendar_stc',_0x2bf2('0x78'),'cmdb_ci',_0x2bf2('0x79'),'impact',_0x2bf2('0x7a'),_0x2bf2('0x7b'),_0x2bf2('0x7c'),_0x2bf2('0x7d'),_0x2bf2('0x7e'),_0x2bf2('0x7f'),'time_worked',_0x2bf2('0x80'),_0x2bf2('0x81'),_0x2bf2('0x82'),_0x2bf2('0x83'),_0x2bf2('0x84'),'reopened_time',_0x2bf2('0x85'),_0x2bf2('0x86'),_0x2bf2('0x87'),_0x2bf2('0x66'),'work_notes','short_description',_0x2bf2('0x88'),_0x2bf2('0x89'),'delivery_task',_0x2bf2('0x8a'),_0x2bf2('0x8b'),_0x2bf2('0x8c'),'additional_assignee_list',_0x2bf2('0x8d'),_0x2bf2('0x8e'),'notify','sys_class_name','close_notes','closed_by',_0x2bf2('0x8f'),_0x2bf2('0x90'),_0x2bf2('0x91'),_0x2bf2('0x92'),_0x2bf2('0x93'),_0x2bf2('0x68'),_0x2bf2('0x94'),'problem_id',_0x2bf2('0x95'),_0x2bf2('0x96'),_0x2bf2('0x97'),_0x2bf2('0x98'),_0x2bf2('0x99'),_0x2bf2('0x9a'),'sla_due','approval',_0x2bf2('0x9b'),'due_date',_0x2bf2('0x9c'),'reopen_count',_0x2bf2('0x9d'),_0x2bf2('0x9e'),_0x2bf2('0x9f'),_0x2bf2('0xa0'),_0x2bf2('0xa1'),_0x2bf2('0x69')];var _0x3d7a07='';var _0x46562b='';var _0x4896ac=[];var _0x1fd243='';var _0x52d141='';var _0x2a8a1b=[];var _0x108e99='';var _0x497e7f='';var _0x4d12ca={};var _0x4cc01c='';return db[_0x2bf2('0x3a')][_0x2bf2('0x5a')]({'where':{'id':_0x48cc23[_0x2bf2('0x54')]['id']},'attributes':['id',_0x2bf2('0xa2'),'password',_0x2bf2('0xa3'),_0x2bf2('0xa4'),_0x2bf2('0xa5')]})[_0x2bf2('0x1f')](handleEntityNotFound(_0xa7a14c,null))[_0x2bf2('0x1f')](function(_0x177901){if(_0x177901){_0x4cc01c=_0x177901['remoteUri'];var _0x389465=_0x4cc01c[_0x2bf2('0xa6')](-0x1);if(_0x389465==='/'){_0x4cc01c=_0x4cc01c[_0x2bf2('0xa7')](0x0,_0x4cc01c['lastIndexOf'](_0x389465));}_0x497e7f=util['format'](_0x2bf2('0xa8'),_0x4cc01c);_0x108e99=util['format'](_0x2bf2('0xa9'),_0x4cc01c);_0x4d12ca={'user':_0x177901[_0x2bf2('0xa2')],'pass':_0x177901[_0x2bf2('0xaa')]};var _0x1f55fc={'method':'GET','uri':_0x497e7f+'incident?sysparm_display_value=all','auth':_0x4d12ca,'json':!![]};return rp(_0x1f55fc);}})[_0x2bf2('0x1f')](function(_0xd68f3d){if(_0xd68f3d[_0x2bf2('0x29')][_0x2bf2('0x44')]>0x0){_0x3d7a07=_0xd68f3d[_0x2bf2('0x29')];}console['log']('incident\x20table\x20objects',_0x3d7a07);_0x2a8a1b=[];_0x46562b=Object['assign']([],_0x3d7a07);_['remove'](_0x46562b,function(_0x526642){return!_0x38e75e[_0x2bf2('0xab')](_0x526642[_0x2bf2('0x36')]);});_0x46562b['forEach'](function(_0x3c2d09){var _0x30b47c=createFieldObject(_0x108e99,_0x4d12ca,_0x3c2d09[_0x2bf2('0xac')],_0x3c2d09[_0x2bf2('0x36')],_0x3c2d09[_0x2bf2('0xad')],![]);_0x2a8a1b[_0x2bf2('0xae')](_0x30b47c);});return Promise[_0x2bf2('0xaf')](_0x2a8a1b);})[_0x2bf2('0x1f')](function(_0x590b6a){_0x4896ac=_0x590b6a;_0x1fd243=Object[_0x2bf2('0xb0')]([],_0x3d7a07);console[_0x2bf2('0xb1')](_0x2bf2('0xb2'),_0x3d7a07);_[_0x2bf2('0xb3')](_0x1fd243,function(_0x1a6cce){return _0x20066e['includes'](_0x1a6cce['name']);});console[_0x2bf2('0xb1')](_0x2bf2('0xb4'),_0x1fd243);_0x2a8a1b=[];_0x1fd243[_0x2bf2('0xb5')](function(_0x4ad31c){var _0x2dc427=createFieldObject(_0x108e99,_0x4d12ca,_0x4ad31c[_0x2bf2('0xac')],_0x4ad31c[_0x2bf2('0x36')],_0x4ad31c[_0x2bf2('0xad')],!![]);_0x2a8a1b['push'](_0x2dc427);});return Promise[_0x2bf2('0xaf')](_0x2a8a1b);})[_0x2bf2('0x1f')](function(_0x359f8a){_0x52d141=_0x359f8a;var _0x3832c3=_0x4896ac[_0x2bf2('0xb6')](_0x52d141);return{'count':_0x3832c3['length'],'rows':_0x3832c3};})[_0x2bf2('0x1f')](respondWithResult(_0xa7a14c,null))[_0x2bf2('0x2a')](function(_0x4d35c0){console['log']('ServiceNow\x20error:\x20'+_0x4d35c0);var _0x4a7e88=_0x48cc23['query']['test']?0x1f4:_0x4d35c0[_0x2bf2('0xb7')]||0x1f4;logger[_0x2bf2('0x25')](_0x4d35c0['stack']);delete _0x4d35c0['name'];if(_0x4a7e88===0x191){_0x4a7e88=0x190;}_0xa7a14c['status'](_0x4a7e88)[_0x2bf2('0x37')](_0x48cc23[_0x2bf2('0x3e')][_0x2bf2('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x4d35c0[_0x2bf2('0xb7')]}:_0x4d35c0);});};function createFieldObject(_0x221dba,_0x685d8f,_0x513592,_0x3826b3,_0x4eb37c,_0xbcdc9b){return new Promise(function(_0x496ede,_0x30152b){var _0x55c4d3={'id':_0x3826b3,'name':_0x4eb37c,'custom':_0xbcdc9b};if(_0x513592===_0x2bf2('0xb8')){_0x55c4d3[_0x2bf2('0x55')]=[{'name':_0x2bf2('0xb9'),'value':_0x2bf2('0xba')},{'name':_0x2bf2('0xbb'),'value':_0x2bf2('0xbc')}];_0x496ede(_0x55c4d3);}else{var _0x266a79={'method':_0x2bf2('0xbd'),'uri':_0x221dba+_0x2bf2('0xbe')+_0x3826b3,'auth':_0x685d8f,'json':!![]};return rp(_0x266a79)[_0x2bf2('0x1f')](function(_0x13694a){var _0x5211b0=[];if(_0x13694a[_0x2bf2('0x29')][_0x2bf2('0x44')]>0x0){_0x13694a[_0x2bf2('0x29')][_0x2bf2('0xb5')](function(_0xd4567f){if(_0xd4567f[_0x2bf2('0xbf')]==='false'){var _0x3498c0={'name':_0xd4567f[_0x2bf2('0xad')],'value':_0xd4567f[_0x2bf2('0xc0')]};_0x5211b0[_0x2bf2('0xae')](_0x3498c0);}});}_0x55c4d3[_0x2bf2('0x55')]=_0x5211b0;if(_0x55c4d3['options'][_0x2bf2('0x44')]>0x0){_0x496ede(_0x55c4d3);}else{if(_0xbcdc9b==![]){_0x496ede();}else{_0x496ede(_0x55c4d3);}}});}});}
\ No newline at end of file
+var _0xd4f0=['../../config/logger','api','../../config/environment','../../components/integrations/configuration','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','name','send','index','ServicenowAccount','fieldName','type','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','create','body','find','getConfigurations','length','pick','filter','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','parent','watch_list','child_incidents','approval_history','number','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','work_start','assignment_group','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','problem_id','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','findOne','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','statusCode','stack','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x466aa2,_0x27b9c1){var _0x1a3bff=function(_0x450148){while(--_0x450148){_0x466aa2['push'](_0x466aa2['shift']());}};_0x1a3bff(++_0x27b9c1);}(_0xd4f0,0xa8));var _0x0d4f=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0xd4f0[_0x15dbca];return _0x326533;};'use strict';var pdf=require(_0x0d4f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0d4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d4f('0x2'));var rp=require(_0x0d4f('0x3'));var moment=require(_0x0d4f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0d4f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0d4f('0x6'));var crypto=require(_0x0d4f('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x0d4f('0x8'));var toCsv=require('to-csv');var querystring=require(_0x0d4f('0x9'));var Papa=require(_0x0d4f('0xa'));var Redis=require('ioredis');var authService=require(_0x0d4f('0xb'));var qs=require(_0x0d4f('0xc'));var as=require(_0x0d4f('0xd'));var hardwareService=require(_0x0d4f('0xe'));var logger=require(_0x0d4f('0xf'))(_0x0d4f('0x10'));var utils=require('../../config/utils');var config=require(_0x0d4f('0x11'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0d4f('0x12'));var jayson=require('jayson/promise');var client=jayson[_0x0d4f('0x13')][_0x0d4f('0x14')]({'port':0x232a});function checkPasswordPattern(_0x28710a,_0x1d021c,_0x118842){if(_0x118842){var _0x44ca73=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44ca73[_0x0d4f('0x15')](_0x1d021c)){return _0x28710a;}else{throw new db['Sequelize'][(_0x0d4f('0x16'))](_0x0d4f('0x17'));}}else{return _0x28710a;}}function respondWithRpcPromise(_0x5529d1,_0x3512f6,_0x8a8eb8,_0x202dd1){return new BPromise(function(_0x984c9e,_0x5ec31a){var _0x27e1ad=_0x202dd1||client;return _0x27e1ad[_0x0d4f('0x18')](_0x5529d1,_0x8a8eb8)[_0x0d4f('0x19')](function(_0x226a44){logger[_0x0d4f('0x1a')](_0x0d4f('0x1b'),_0x3512f6,_0x0d4f('0x1c'));logger[_0x0d4f('0x1d')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3512f6,_0x0d4f('0x1c'),JSON[_0x0d4f('0x1e')](_0x226a44));if(_0x226a44['error']){if(_0x226a44[_0x0d4f('0x1f')][_0x0d4f('0x20')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x3512f6,_0x226a44[_0x0d4f('0x1f')]['message']);return _0x5ec31a(_0x226a44[_0x0d4f('0x1f')]['message']);}logger[_0x0d4f('0x1f')](_0x0d4f('0x1b'),_0x3512f6,_0x226a44['error'][_0x0d4f('0x21')]);return _0x984c9e(_0x226a44['error'][_0x0d4f('0x21')]);}else{logger['info'](_0x0d4f('0x1b'),_0x3512f6,_0x0d4f('0x1c'));_0x984c9e(_0x226a44[_0x0d4f('0x22')][_0x0d4f('0x21')]);}})['catch'](function(_0x9bc993){logger['error'](_0x0d4f('0x1b'),_0x3512f6,_0x9bc993);_0x5ec31a(_0x9bc993);});});}function respondWithStatusCode(_0x4300f7,_0x327382){_0x327382=_0x327382||0xcc;return function(_0x2cdf83){if(_0x2cdf83){return _0x4300f7[_0x0d4f('0x23')](_0x327382);}return _0x4300f7[_0x0d4f('0x24')](_0x327382)[_0x0d4f('0x25')]();};}function respondWithResult(_0x30a8bf,_0x2cfb75){_0x2cfb75=_0x2cfb75||0xc8;return function(_0x76a648){if(_0x76a648){return _0x30a8bf[_0x0d4f('0x24')](_0x2cfb75)[_0x0d4f('0x26')](_0x76a648);}};}function respondWithFilteredResult(_0x1f527d,_0xed6d0c){return function(_0x37a51a){if(_0x37a51a){var _0x27321e=_0x37a51a[_0x0d4f('0x27')],_0x1008b4=_0xed6d0c[_0x0d4f('0x28')],_0x3f9e75=_0xed6d0c['offset']+_0xed6d0c[_0x0d4f('0x29')],_0xdb4d03;if(_0x3f9e75>=_0x27321e){_0x3f9e75=_0x27321e;_0xdb4d03=0xc8;}else{_0xdb4d03=0xce;}_0x1f527d[_0x0d4f('0x24')](_0xdb4d03);return _0x1f527d[_0x0d4f('0x2a')]('Content-Range',_0x1008b4+'-'+_0x3f9e75+'/'+_0x27321e)[_0x0d4f('0x26')](_0x37a51a);}return null;};}function patchUpdates(_0x31f5ec){return function(_0x3183be){try{jsonpatch[_0x0d4f('0x2b')](_0x3183be,_0x31f5ec,!![]);}catch(_0x258036){return BPromise[_0x0d4f('0x2c')](_0x258036);}return _0x3183be[_0x0d4f('0x2d')]();};}function saveUpdates(_0x21fe0a,_0x55fa4a){return function(_0x24c31b){if(_0x24c31b){return _0x24c31b[_0x0d4f('0x2e')](_0x21fe0a)[_0x0d4f('0x19')](function(_0x3cc849){return _0x3cc849;});}return null;};}function removeEntity(_0x5bd101,_0x4628dc){return function(_0x549050){if(_0x549050){return _0x549050[_0x0d4f('0x2f')]()[_0x0d4f('0x19')](function(){_0x5bd101['status'](0xcc)[_0x0d4f('0x25')]();});}};}function handleEntityNotFound(_0x59c5a9,_0x40b3f8){return function(_0x2c31b6){if(!_0x2c31b6){_0x59c5a9[_0x0d4f('0x23')](0x194);}return _0x2c31b6;};}function handleError(_0x1f5f1e,_0x5f0ac8){_0x5f0ac8=_0x5f0ac8||0x1f4;return function(_0x489f41){logger[_0x0d4f('0x1f')](_0x489f41['stack']);if(_0x489f41['name']){delete _0x489f41[_0x0d4f('0x30')];}_0x1f5f1e[_0x0d4f('0x24')](_0x5f0ac8)[_0x0d4f('0x31')](_0x489f41);};}exports[_0x0d4f('0x32')]=function(_0x405817,_0xcc072b){var _0x442635={},_0x3d0f1c={},_0x5e0a59={'count':0x0,'rows':[]};var _0x3ee73d=_['map'](db[_0x0d4f('0x33')]['rawAttributes'],function(_0x4b4845){return{'name':_0x4b4845[_0x0d4f('0x34')],'type':_0x4b4845[_0x0d4f('0x35')]['key']};});_0x3d0f1c['model']=_[_0x0d4f('0x36')](_0x3ee73d,'name');_0x3d0f1c[_0x0d4f('0x37')]=_[_0x0d4f('0x38')](_0x405817['query']);_0x3d0f1c[_0x0d4f('0x39')]=_[_0x0d4f('0x3a')](_0x3d0f1c[_0x0d4f('0x3b')],_0x3d0f1c['query']);_0x442635['attributes']=_['intersection'](_0x3d0f1c['model'],qs['fields'](_0x405817[_0x0d4f('0x37')]['fields']));_0x442635[_0x0d4f('0x3c')]=_0x442635[_0x0d4f('0x3c')]['length']?_0x442635[_0x0d4f('0x3c')]:_0x3d0f1c[_0x0d4f('0x3b')];if(!_0x405817[_0x0d4f('0x37')][_0x0d4f('0x3d')](_0x0d4f('0x3e'))){_0x442635[_0x0d4f('0x29')]=qs['limit'](_0x405817[_0x0d4f('0x37')]['limit']);_0x442635[_0x0d4f('0x28')]=qs[_0x0d4f('0x28')](_0x405817[_0x0d4f('0x37')]['offset']);}_0x442635[_0x0d4f('0x3f')]=qs[_0x0d4f('0x40')](_0x405817['query'][_0x0d4f('0x40')]);_0x442635['where']=qs[_0x0d4f('0x39')](_['pick'](_0x405817[_0x0d4f('0x37')],_0x3d0f1c[_0x0d4f('0x39')]),_0x3ee73d);if(_0x405817[_0x0d4f('0x37')]['filter']){_0x442635[_0x0d4f('0x41')]=_[_0x0d4f('0x42')](_0x442635[_0x0d4f('0x41')],{'$or':_[_0x0d4f('0x36')](_0x3ee73d,function(_0x20fe99){if(_0x20fe99[_0x0d4f('0x35')]!==_0x0d4f('0x43')){var _0x97ccca={};_0x97ccca[_0x20fe99['name']]={'$like':'%'+_0x405817[_0x0d4f('0x37')]['filter']+'%'};return _0x97ccca;}})});}_0x442635=_[_0x0d4f('0x42')]({},_0x442635,_0x405817[_0x0d4f('0x44')]);var _0x248394={'where':_0x442635[_0x0d4f('0x41')]};return db[_0x0d4f('0x33')][_0x0d4f('0x27')](_0x248394)[_0x0d4f('0x19')](function(_0x57ccaa){_0x5e0a59[_0x0d4f('0x27')]=_0x57ccaa;if(_0x405817[_0x0d4f('0x37')][_0x0d4f('0x45')]){_0x442635[_0x0d4f('0x46')]=[{'all':!![]}];}return db[_0x0d4f('0x33')][_0x0d4f('0x47')](_0x442635);})[_0x0d4f('0x19')](function(_0x467ecf){_0x5e0a59[_0x0d4f('0x48')]=_0x467ecf;return _0x5e0a59;})[_0x0d4f('0x19')](respondWithFilteredResult(_0xcc072b,_0x442635))[_0x0d4f('0x49')](handleError(_0xcc072b,null));};exports[_0x0d4f('0x4a')]=function(_0x285afd,_0x64503b){var _0xaac05a={'raw':![],'where':{'id':_0x285afd[_0x0d4f('0x4b')]['id']}},_0x226866={};_0x226866['model']=_['keys'](db[_0x0d4f('0x33')][_0x0d4f('0x4c')]);_0x226866[_0x0d4f('0x37')]=_[_0x0d4f('0x38')](_0x285afd[_0x0d4f('0x37')]);_0x226866[_0x0d4f('0x39')]=_[_0x0d4f('0x3a')](_0x226866[_0x0d4f('0x3b')],_0x226866[_0x0d4f('0x37')]);_0xaac05a[_0x0d4f('0x3c')]=_[_0x0d4f('0x3a')](_0x226866[_0x0d4f('0x3b')],qs[_0x0d4f('0x4d')](_0x285afd[_0x0d4f('0x37')][_0x0d4f('0x4d')]));_0xaac05a['attributes']=_0xaac05a[_0x0d4f('0x3c')]['length']?_0xaac05a[_0x0d4f('0x3c')]:_0x226866['model'];if(_0x285afd[_0x0d4f('0x37')][_0x0d4f('0x45')]){_0xaac05a[_0x0d4f('0x46')]=[{'all':!![]}];}_0xaac05a=_[_0x0d4f('0x42')]({},_0xaac05a,_0x285afd['options']);return db['ServicenowAccount']['find'](_0xaac05a)[_0x0d4f('0x19')](handleEntityNotFound(_0x64503b,null))[_0x0d4f('0x19')](respondWithResult(_0x64503b,null))[_0x0d4f('0x49')](handleError(_0x64503b,null));};exports[_0x0d4f('0x4e')]=function(_0x1e69b7,_0x44c835){return db[_0x0d4f('0x33')][_0x0d4f('0x4e')](_0x1e69b7[_0x0d4f('0x4f')],{})[_0x0d4f('0x19')](respondWithResult(_0x44c835,0xc9))['catch'](handleError(_0x44c835,null));};exports[_0x0d4f('0x2e')]=function(_0x1a79e4,_0x2befcf){if(_0x1a79e4[_0x0d4f('0x4f')]['id']){delete _0x1a79e4[_0x0d4f('0x4f')]['id'];}return db[_0x0d4f('0x33')][_0x0d4f('0x50')]({'where':{'id':_0x1a79e4[_0x0d4f('0x4b')]['id']}})[_0x0d4f('0x19')](handleEntityNotFound(_0x2befcf,null))[_0x0d4f('0x19')](saveUpdates(_0x1a79e4['body'],null))[_0x0d4f('0x19')](respondWithResult(_0x2befcf,null))['catch'](handleError(_0x2befcf,null));};exports[_0x0d4f('0x2f')]=function(_0x388d07,_0x27ad62){return db[_0x0d4f('0x33')]['find']({'where':{'id':_0x388d07[_0x0d4f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27ad62,null))[_0x0d4f('0x19')](removeEntity(_0x27ad62,null))['catch'](handleError(_0x27ad62,null));};exports[_0x0d4f('0x51')]=function(_0x16d742,_0x51a567,_0x2e0caa){var _0x590cee={};var _0x1cf033={};var _0x3b4491;var _0x3a86cf;return db[_0x0d4f('0x33')]['findOne']({'where':{'id':_0x16d742[_0x0d4f('0x4b')]['id']}})[_0x0d4f('0x19')](handleEntityNotFound(_0x51a567,null))[_0x0d4f('0x19')](function(_0x2ebf1a){if(_0x2ebf1a){_0x3b4491=_0x2ebf1a;_0x1cf033[_0x0d4f('0x3b')]=_[_0x0d4f('0x38')](db['ServicenowConfiguration'][_0x0d4f('0x4c')]);_0x1cf033[_0x0d4f('0x37')]=_['keys'](_0x16d742[_0x0d4f('0x37')]);_0x1cf033[_0x0d4f('0x39')]=_[_0x0d4f('0x3a')](_0x1cf033[_0x0d4f('0x3b')],_0x1cf033[_0x0d4f('0x37')]);_0x590cee[_0x0d4f('0x3c')]=_[_0x0d4f('0x3a')](_0x1cf033[_0x0d4f('0x3b')],qs['fields'](_0x16d742['query']['fields']));_0x590cee[_0x0d4f('0x3c')]=_0x590cee[_0x0d4f('0x3c')][_0x0d4f('0x52')]?_0x590cee[_0x0d4f('0x3c')]:_0x1cf033[_0x0d4f('0x3b')];_0x590cee['order']=qs['sort'](_0x16d742['query'][_0x0d4f('0x40')]);_0x590cee[_0x0d4f('0x41')]=qs[_0x0d4f('0x39')](_[_0x0d4f('0x53')](_0x16d742['query'],_0x1cf033[_0x0d4f('0x39')]));if(_0x16d742[_0x0d4f('0x37')][_0x0d4f('0x54')]){_0x590cee[_0x0d4f('0x41')]=_[_0x0d4f('0x42')](_0x590cee[_0x0d4f('0x41')],{'$or':_['map'](_0x590cee[_0x0d4f('0x3c')],function(_0x5db7d6){var _0x5cc6ad={};_0x5cc6ad[_0x5db7d6]={'$like':'%'+_0x16d742[_0x0d4f('0x37')]['filter']+'%'};return _0x5cc6ad;})});}_0x590cee=_[_0x0d4f('0x42')]({},_0x590cee,_0x16d742[_0x0d4f('0x44')]);return _0x3b4491[_0x0d4f('0x51')](_0x590cee);}})[_0x0d4f('0x19')](function(_0x1d9a15){if(_0x1d9a15){_0x3a86cf=_0x1d9a15[_0x0d4f('0x52')];if(!_0x16d742[_0x0d4f('0x37')][_0x0d4f('0x3d')]('nolimit')){_0x590cee[_0x0d4f('0x29')]=qs[_0x0d4f('0x29')](_0x16d742[_0x0d4f('0x37')]['limit']);_0x590cee[_0x0d4f('0x28')]=qs[_0x0d4f('0x28')](_0x16d742[_0x0d4f('0x37')][_0x0d4f('0x28')]);}return _0x3b4491[_0x0d4f('0x51')](_0x590cee);}})[_0x0d4f('0x19')](function(_0xcd794b){if(_0xcd794b){return _0xcd794b?{'count':_0x3a86cf,'rows':_0xcd794b}:null;}})[_0x0d4f('0x19')](respondWithResult(_0x51a567,null))['catch'](handleError(_0x51a567,null));};exports[_0x0d4f('0x55')]=function(_0x13d59c,_0x225bf9,_0x458bf9){if(_0x13d59c[_0x0d4f('0x4f')]['id']){delete _0x13d59c[_0x0d4f('0x4f')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x13d59c[_0x0d4f('0x4b')]['id']}})[_0x0d4f('0x19')](handleEntityNotFound(_0x225bf9,null))[_0x0d4f('0x19')](function(_0x297498){if(_0x297498){_0x13d59c[_0x0d4f('0x4f')][_0x0d4f('0x56')]=_0x297498['id'];_0x13d59c[_0x0d4f('0x4f')][_0x0d4f('0x57')]=integrations['getSubjects'](_0x13d59c[_0x0d4f('0x4f')][_0x0d4f('0x58')],_0x13d59c[_0x0d4f('0x4f')]['type']);_0x13d59c[_0x0d4f('0x4f')][_0x0d4f('0x59')]=integrations[_0x0d4f('0x5a')](_0x13d59c[_0x0d4f('0x4f')]['channel'],_0x13d59c['body']['type']);return db[_0x0d4f('0x5b')][_0x0d4f('0x4e')](_0x13d59c['body'],{'include':[{'model':db[_0x0d4f('0x5c')],'as':_0x0d4f('0x57')},{'model':db[_0x0d4f('0x5c')],'as':'Descriptions'}]});}return null;})[_0x0d4f('0x19')](respondWithResult(_0x225bf9,null))[_0x0d4f('0x49')](handleError(_0x225bf9,null));};exports['getFields']=function(_0xe72ddf,_0x14d1e1,_0x52305f){var _0xb501df=[_0x0d4f('0x5d'),'hold_reason',_0x0d4f('0x5e'),_0x0d4f('0x5f'),_0x0d4f('0x60'),_0x0d4f('0x61'),_0x0d4f('0x62'),_0x0d4f('0x63'),'category'];var _0x49afeb=[_0x0d4f('0x64'),_0x0d4f('0x5d'),'caused_by',_0x0d4f('0x65'),'upon_reject','sys_updated_on',_0x0d4f('0x66'),'hold_reason',_0x0d4f('0x67'),_0x0d4f('0x68'),'resolved_by',_0x0d4f('0x69'),'opened_by',_0x0d4f('0x6a'),_0x0d4f('0x6b'),_0x0d4f('0x6c'),_0x0d4f('0x6d'),_0x0d4f('0x6e'),_0x0d4f('0x5e'),_0x0d4f('0x3f'),_0x0d4f('0x6f'),'closed_at',_0x0d4f('0x70'),_0x0d4f('0x71'),'impact',_0x0d4f('0x72'),_0x0d4f('0x73'),_0x0d4f('0x74'),_0x0d4f('0x75'),'sys_domain_path','rfc',_0x0d4f('0x76'),'expected_start',_0x0d4f('0x77'),_0x0d4f('0x78'),_0x0d4f('0x79'),_0x0d4f('0x7a'),_0x0d4f('0x7b'),_0x0d4f('0x7c'),'caller_id','approval_set',_0x0d4f('0x5f'),'work_notes','short_description',_0x0d4f('0x60'),'correlation_display','delivery_task',_0x0d4f('0x7d'),_0x0d4f('0x7e'),'business_stc','additional_assignee_list',_0x0d4f('0x7f'),'calendar_duration',_0x0d4f('0x61'),_0x0d4f('0x80'),_0x0d4f('0x81'),_0x0d4f('0x82'),_0x0d4f('0x83'),_0x0d4f('0x84'),_0x0d4f('0x85'),_0x0d4f('0x86'),'reopened_by',_0x0d4f('0x62'),'urgency',_0x0d4f('0x87'),_0x0d4f('0x88'),_0x0d4f('0x89'),_0x0d4f('0x8a'),_0x0d4f('0x8b'),_0x0d4f('0x63'),_0x0d4f('0x8c'),'sla_due',_0x0d4f('0x8d'),_0x0d4f('0x8e'),'due_date',_0x0d4f('0x8f'),_0x0d4f('0x90'),_0x0d4f('0x91'),_0x0d4f('0x92'),_0x0d4f('0x93'),_0x0d4f('0x94'),_0x0d4f('0x95'),'category'];var _0x112004='';var _0x94061a='';var _0x5132cb=[];var _0x4ea441='';var _0x5d22f8='';var _0x576a6e=[];var _0x6a8e6b='';var _0x2a14a3='';var _0x2f9b61={};var _0x36391b='';return db[_0x0d4f('0x33')][_0x0d4f('0x96')]({'where':{'id':_0xe72ddf[_0x0d4f('0x4b')]['id']},'attributes':['id',_0x0d4f('0x97'),_0x0d4f('0x98'),'email',_0x0d4f('0x99'),_0x0d4f('0x9a')]})[_0x0d4f('0x19')](handleEntityNotFound(_0x14d1e1,null))[_0x0d4f('0x19')](function(_0x130284){if(_0x130284){_0x36391b=_0x130284[_0x0d4f('0x99')];var _0x19b022=_0x36391b[_0x0d4f('0x9b')](-0x1);if(_0x19b022==='/'){_0x36391b=_0x36391b[_0x0d4f('0x9c')](0x0,_0x36391b[_0x0d4f('0x9d')](_0x19b022));}_0x2a14a3=util['format'](_0x0d4f('0x9e'),_0x36391b);_0x6a8e6b=util[_0x0d4f('0x9f')](_0x0d4f('0xa0'),_0x36391b);_0x2f9b61={'user':_0x130284[_0x0d4f('0x97')],'pass':_0x130284['password']};var _0x55b767={'method':_0x0d4f('0xa1'),'uri':_0x2a14a3+'incident?sysparm_display_value=all','auth':_0x2f9b61,'json':!![]};return rp(_0x55b767);}})['then'](function(_0x5230c0){if(_0x5230c0[_0x0d4f('0x22')][_0x0d4f('0x52')]>0x0){_0x112004=_0x5230c0[_0x0d4f('0x22')];}console['log'](_0x0d4f('0xa2'),_0x112004);_0x576a6e=[];_0x94061a=Object[_0x0d4f('0xa3')]([],_0x112004);_[_0x0d4f('0xa4')](_0x94061a,function(_0x593fa5){return!_0xb501df[_0x0d4f('0xa5')](_0x593fa5['name']);});_0x94061a[_0x0d4f('0xa6')](function(_0x4dc167){var _0x5b0d0f=createFieldObject(_0x6a8e6b,_0x2f9b61,_0x4dc167[_0x0d4f('0xa7')],_0x4dc167[_0x0d4f('0x30')],_0x4dc167[_0x0d4f('0xa8')],![]);_0x576a6e[_0x0d4f('0xa9')](_0x5b0d0f);});return Promise['all'](_0x576a6e);})[_0x0d4f('0x19')](function(_0x112524){_0x5132cb=_0x112524;_0x4ea441=Object[_0x0d4f('0xa3')]([],_0x112004);console[_0x0d4f('0xaa')]('TCL:\x20_object',_0x112004);_[_0x0d4f('0xa4')](_0x4ea441,function(_0x277a0d){return _0x49afeb[_0x0d4f('0xa5')](_0x277a0d[_0x0d4f('0x30')]);});console[_0x0d4f('0xaa')](_0x0d4f('0xab'),_0x4ea441);_0x576a6e=[];_0x4ea441[_0x0d4f('0xa6')](function(_0x98db64){var _0x52b754=createFieldObject(_0x6a8e6b,_0x2f9b61,_0x98db64['internalType'],_0x98db64['name'],_0x98db64[_0x0d4f('0xa8')],!![]);_0x576a6e['push'](_0x52b754);});return Promise['all'](_0x576a6e);})['then'](function(_0x372dac){_0x5d22f8=_0x372dac;var _0x538243=_0x5132cb['concat'](_0x5d22f8);return{'count':_0x538243[_0x0d4f('0x52')],'rows':_0x538243};})[_0x0d4f('0x19')](respondWithResult(_0x14d1e1,null))[_0x0d4f('0x49')](function(_0x5da675){console[_0x0d4f('0xaa')](_0x0d4f('0xac')+_0x5da675);var _0x35db9d=_0xe72ddf['query'][_0x0d4f('0x15')]?0x1f4:_0x5da675[_0x0d4f('0xad')]||0x1f4;logger[_0x0d4f('0x1f')](_0x5da675[_0x0d4f('0xae')]);delete _0x5da675[_0x0d4f('0x30')];if(_0x35db9d===0x191){_0x35db9d=0x190;}_0x14d1e1[_0x0d4f('0x24')](_0x35db9d)[_0x0d4f('0x31')](_0xe72ddf[_0x0d4f('0x37')][_0x0d4f('0x15')]?{'message':_0x0d4f('0xaf'),'statusCode':_0x5da675[_0x0d4f('0xad')]}:_0x5da675);});};function createFieldObject(_0x221524,_0x53b66d,_0x40c226,_0x219729,_0x4f2772,_0x406d33){return new Promise(function(_0x5081f9,_0xd04920){var _0x45b5ed={'id':_0x219729,'name':_0x4f2772,'custom':_0x406d33};if(_0x40c226==='boolean'){_0x45b5ed[_0x0d4f('0x44')]=[{'name':_0x0d4f('0xb0'),'value':_0x0d4f('0xb1')},{'name':_0x0d4f('0xb2'),'value':_0x0d4f('0xb3')}];_0x5081f9(_0x45b5ed);}else{var _0x12cc36={'method':_0x0d4f('0xa1'),'uri':_0x221524+_0x0d4f('0xb4')+_0x219729,'auth':_0x53b66d,'json':!![]};return rp(_0x12cc36)[_0x0d4f('0x19')](function(_0x45e01d){var _0x1064d4=[];if(_0x45e01d[_0x0d4f('0x22')][_0x0d4f('0x52')]>0x0){_0x45e01d[_0x0d4f('0x22')]['forEach'](function(_0x2d207d){if(_0x2d207d[_0x0d4f('0xb5')]===_0x0d4f('0xb3')){var _0x403452={'name':_0x2d207d['label'],'value':_0x2d207d[_0x0d4f('0xb6')]};_0x1064d4[_0x0d4f('0xa9')](_0x403452);}});}_0x45b5ed[_0x0d4f('0x44')]=_0x1064d4;if(_0x45b5ed[_0x0d4f('0x44')][_0x0d4f('0x52')]>0x0){_0x5081f9(_0x45b5ed);}else{if(_0x406d33==![]){_0x5081f9();}else{_0x5081f9(_0x45b5ed);}}});}});}
\ No newline at end of file
index a5bddb4..6163663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b67=['path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x9b67,0xf6));var _0x79b6=function(_0x2493eb,_0xf4280f){_0x2493eb=_0x2493eb-0x0;var _0x297832=_0x9b67[_0x2493eb];return _0x297832;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var moment=require(_0x79b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x79b6('0x5'));var fs=require('fs');var path=require(_0x79b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79b6('0x7'));var integrations=require(_0x79b6('0x8'));module[_0x79b6('0x9')]=function(_0xec367e,_0xfa6a05){return _0xec367e[_0x79b6('0xa')](_0x79b6('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount'];(function(_0x3248bd,_0x1958d6){var _0x4cd15d=function(_0x2605aa){while(--_0x2605aa){_0x3248bd['push'](_0x3248bd['shift']());}};_0x4cd15d(++_0x1958d6);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));var integrations=require(_0xd7df('0xb'));module[_0xd7df('0xc')]=function(_0x39ce98,_0x354ea7){return _0x39ce98[_0xd7df('0xd')](_0xd7df('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c3272fb..a84f419 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4802=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','stringify','raw','ShowServicenowAccount','lodash','moment','bluebird','randomstring'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x4802,0xf1));var _0x2480=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x4802[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x2480('0x0'));var util=require('util');var moment=require(_0x2480('0x1'));var BPromise=require(_0x2480('0x2'));var rs=require(_0x2480('0x3'));var fs=require('fs');var Redis=require(_0x2480('0x4'));var db=require(_0x2480('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2480('0x6'))('rpc');var config=require(_0x2480('0x7'));var jayson=require(_0x2480('0x8'));var client=jayson[_0x2480('0x9')][_0x2480('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x568dc9,_0x4d18cf,_0x15e563){return new BPromise(function(_0x3df0d8,_0x1de2f8){return client[_0x2480('0xb')](_0x568dc9,_0x15e563)[_0x2480('0xc')](function(_0x291930){logger[_0x2480('0xd')](_0x2480('0xe'),_0x4d18cf,_0x2480('0xf'));logger[_0x2480('0x10')](_0x2480('0x11'),_0x4d18cf,'request\x20sent',JSON['stringify'](_0x291930));if(_0x291930[_0x2480('0x12')]){if(_0x291930[_0x2480('0x12')]['code']===0x1f4){logger['error'](_0x2480('0xe'),_0x4d18cf,_0x291930[_0x2480('0x12')][_0x2480('0x13')]);return _0x1de2f8(_0x291930[_0x2480('0x12')][_0x2480('0x13')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x4d18cf,_0x291930[_0x2480('0x12')][_0x2480('0x13')]);return _0x3df0d8(_0x291930[_0x2480('0x12')][_0x2480('0x13')]);}else{logger[_0x2480('0xd')](_0x2480('0xe'),_0x4d18cf,_0x2480('0xf'));_0x3df0d8(_0x291930[_0x2480('0x14')][_0x2480('0x13')]);}})[_0x2480('0x15')](function(_0x6deda4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x4d18cf,_0x6deda4);_0x1de2f8(_0x6deda4);});});}exports[_0x2480('0x16')]=function(_0x4796d3){var _0x5201b4=this;return new Promise(function(_0xb05781,_0x5d0f57){return db[_0x2480('0x17')][_0x2480('0x18')]({'raw':_0x4796d3['options']?_0x4796d3['options']['raw']===undefined?!![]:![]:!![],'where':_0x4796d3[_0x2480('0x19')]?_0x4796d3[_0x2480('0x19')][_0x2480('0x1a')]||null:null,'attributes':_0x4796d3['options']?_0x4796d3[_0x2480('0x19')][_0x2480('0x1b')]||null:null,'limit':_0x4796d3['options']?_0x4796d3[_0x2480('0x19')][_0x2480('0x1c')]||null:null,'include':_0x4796d3[_0x2480('0x19')]?_0x4796d3[_0x2480('0x19')][_0x2480('0x1d')]?_[_0x2480('0x1e')](_0x4796d3[_0x2480('0x19')]['include'],function(_0x4711fe){return{'model':db[_0x4711fe[_0x2480('0x1f')]],'as':_0x4711fe['as'],'attributes':_0x4711fe['attributes'],'include':_0x4711fe['include']?_[_0x2480('0x1e')](_0x4711fe[_0x2480('0x1d')],function(_0x62def6){return{'model':db[_0x62def6[_0x2480('0x1f')]],'as':_0x62def6['as'],'attributes':_0x62def6[_0x2480('0x1b')],'include':_0x62def6[_0x2480('0x1d')]?_[_0x2480('0x1e')](_0x62def6[_0x2480('0x1d')],function(_0x2fc9f9){return{'model':db[_0x2fc9f9[_0x2480('0x1f')]],'as':_0x2fc9f9['as'],'attributes':_0x2fc9f9[_0x2480('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2480('0xc')](function(_0x7645c3){logger[_0x2480('0xd')](_0x2480('0x16'),_0x4796d3);logger[_0x2480('0x10')](_0x2480('0x16'),_0x4796d3,JSON[_0x2480('0x20')](_0x7645c3));_0xb05781(_0x7645c3);})['catch'](function(_0xcb224f){logger[_0x2480('0x12')](_0x2480('0x16'),_0xcb224f[_0x2480('0x13')],_0x4796d3);_0x5d0f57(_0x5201b4[_0x2480('0x12')](0x1f4,_0xcb224f[_0x2480('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x1aa0c5){var _0x5c22b1=this;return new Promise(function(_0x51b038,_0x22faf0){return db[_0x2480('0x17')]['find']({'raw':_0x1aa0c5[_0x2480('0x19')]?_0x1aa0c5[_0x2480('0x19')][_0x2480('0x21')]===undefined?!![]:![]:!![],'where':_0x1aa0c5[_0x2480('0x19')]?_0x1aa0c5[_0x2480('0x19')]['where']||null:null,'attributes':_0x1aa0c5[_0x2480('0x19')]?_0x1aa0c5[_0x2480('0x19')][_0x2480('0x1b')]||null:null,'include':_0x1aa0c5[_0x2480('0x19')]?_0x1aa0c5[_0x2480('0x19')][_0x2480('0x1d')]?_[_0x2480('0x1e')](_0x1aa0c5[_0x2480('0x19')][_0x2480('0x1d')],function(_0x45438c){return{'model':db[_0x45438c['model']],'as':_0x45438c['as'],'attributes':_0x45438c[_0x2480('0x1b')],'include':_0x45438c['include']?_['map'](_0x45438c['include'],function(_0x15b8ca){return{'model':db[_0x15b8ca[_0x2480('0x1f')]],'as':_0x15b8ca['as'],'attributes':_0x15b8ca['attributes'],'include':_0x15b8ca['include']?_[_0x2480('0x1e')](_0x15b8ca[_0x2480('0x1d')],function(_0x205a7f){return{'model':db[_0x205a7f[_0x2480('0x1f')]],'as':_0x205a7f['as'],'attributes':_0x205a7f[_0x2480('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2480('0xc')](function(_0xbd9eaf){logger['info']('ShowServicenowAccount',_0x1aa0c5);logger[_0x2480('0x10')](_0x2480('0x22'),_0x1aa0c5,JSON[_0x2480('0x20')](_0xbd9eaf));_0x51b038(_0xbd9eaf);})[_0x2480('0x15')](function(_0x90c6eb){logger['error'](_0x2480('0x22'),_0x90c6eb[_0x2480('0x13')],_0x1aa0c5);_0x22faf0(_0x5c22b1[_0x2480('0x12')](0x1f4,_0x90c6eb['message']));});});};
\ No newline at end of file
+var _0xdcb2=['include','model','attributes','debug','ShowServicenowAccount','find','map','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetServicenowAccount','findAll','options','raw','where','limit'];(function(_0xa013a4,_0x2ff249){var _0x27f4a2=function(_0x1a5a6f){while(--_0x1a5a6f){_0xa013a4['push'](_0xa013a4['shift']());}};_0x27f4a2(++_0x2ff249);}(_0xdcb2,0x17e));var _0x2dcb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdcb2[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2dcb('0x0'));var util=require(_0x2dcb('0x1'));var moment=require('moment');var BPromise=require(_0x2dcb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2dcb('0x3'));var db=require(_0x2dcb('0x4'))['db'];var utils=require(_0x2dcb('0x5'));var logger=require(_0x2dcb('0x6'))(_0x2dcb('0x7'));var config=require(_0x2dcb('0x8'));var jayson=require(_0x2dcb('0x9'));var client=jayson[_0x2dcb('0xa')][_0x2dcb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18dcff,_0x367ddb,_0xa0ebac){return new BPromise(function(_0x4949d9,_0x38451c){return client['request'](_0x18dcff,_0xa0ebac)[_0x2dcb('0xc')](function(_0x4b29fa){logger[_0x2dcb('0xd')](_0x2dcb('0xe'),_0x367ddb,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x367ddb,_0x2dcb('0xf'),JSON[_0x2dcb('0x10')](_0x4b29fa));if(_0x4b29fa[_0x2dcb('0x11')]){if(_0x4b29fa['error'][_0x2dcb('0x12')]===0x1f4){logger['error'](_0x2dcb('0xe'),_0x367ddb,_0x4b29fa[_0x2dcb('0x11')]['message']);return _0x38451c(_0x4b29fa['error'][_0x2dcb('0x13')]);}logger[_0x2dcb('0x11')](_0x2dcb('0xe'),_0x367ddb,_0x4b29fa[_0x2dcb('0x11')]['message']);return _0x4949d9(_0x4b29fa[_0x2dcb('0x11')][_0x2dcb('0x13')]);}else{logger[_0x2dcb('0xd')](_0x2dcb('0xe'),_0x367ddb,_0x2dcb('0xf'));_0x4949d9(_0x4b29fa['result'][_0x2dcb('0x13')]);}})['catch'](function(_0x364e37){logger['error'](_0x2dcb('0xe'),_0x367ddb,_0x364e37);_0x38451c(_0x364e37);});});}exports[_0x2dcb('0x14')]=function(_0x248998){var _0x10f126=this;return new Promise(function(_0x5d481f,_0x4dd879){return db['ServicenowAccount'][_0x2dcb('0x15')]({'raw':_0x248998[_0x2dcb('0x16')]?_0x248998[_0x2dcb('0x16')][_0x2dcb('0x17')]===undefined?!![]:![]:!![],'where':_0x248998[_0x2dcb('0x16')]?_0x248998[_0x2dcb('0x16')][_0x2dcb('0x18')]||null:null,'attributes':_0x248998[_0x2dcb('0x16')]?_0x248998[_0x2dcb('0x16')]['attributes']||null:null,'limit':_0x248998['options']?_0x248998[_0x2dcb('0x16')][_0x2dcb('0x19')]||null:null,'include':_0x248998[_0x2dcb('0x16')]?_0x248998[_0x2dcb('0x16')][_0x2dcb('0x1a')]?_['map'](_0x248998[_0x2dcb('0x16')][_0x2dcb('0x1a')],function(_0x28eab3){return{'model':db[_0x28eab3[_0x2dcb('0x1b')]],'as':_0x28eab3['as'],'attributes':_0x28eab3[_0x2dcb('0x1c')],'include':_0x28eab3[_0x2dcb('0x1a')]?_['map'](_0x28eab3[_0x2dcb('0x1a')],function(_0xce7a4a){return{'model':db[_0xce7a4a[_0x2dcb('0x1b')]],'as':_0xce7a4a['as'],'attributes':_0xce7a4a[_0x2dcb('0x1c')],'include':_0xce7a4a['include']?_['map'](_0xce7a4a[_0x2dcb('0x1a')],function(_0x569210){return{'model':db[_0x569210[_0x2dcb('0x1b')]],'as':_0x569210['as'],'attributes':_0x569210[_0x2dcb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b2b1b){logger[_0x2dcb('0xd')](_0x2dcb('0x14'),_0x248998);logger[_0x2dcb('0x1d')](_0x2dcb('0x14'),_0x248998,JSON['stringify'](_0x4b2b1b));_0x5d481f(_0x4b2b1b);})['catch'](function(_0x3890c3){logger[_0x2dcb('0x11')](_0x2dcb('0x14'),_0x3890c3['message'],_0x248998);_0x4dd879(_0x10f126[_0x2dcb('0x11')](0x1f4,_0x3890c3['message']));});});};exports[_0x2dcb('0x1e')]=function(_0x4c1c74){var _0x4a5ded=this;return new Promise(function(_0x18590a,_0x4ca9e8){return db['ServicenowAccount'][_0x2dcb('0x1f')]({'raw':_0x4c1c74[_0x2dcb('0x16')]?_0x4c1c74[_0x2dcb('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4c1c74[_0x2dcb('0x16')]?_0x4c1c74[_0x2dcb('0x16')]['where']||null:null,'attributes':_0x4c1c74[_0x2dcb('0x16')]?_0x4c1c74[_0x2dcb('0x16')][_0x2dcb('0x1c')]||null:null,'include':_0x4c1c74['options']?_0x4c1c74[_0x2dcb('0x16')][_0x2dcb('0x1a')]?_[_0x2dcb('0x20')](_0x4c1c74[_0x2dcb('0x16')][_0x2dcb('0x1a')],function(_0x306743){return{'model':db[_0x306743[_0x2dcb('0x1b')]],'as':_0x306743['as'],'attributes':_0x306743[_0x2dcb('0x1c')],'include':_0x306743[_0x2dcb('0x1a')]?_[_0x2dcb('0x20')](_0x306743[_0x2dcb('0x1a')],function(_0x565260){return{'model':db[_0x565260['model']],'as':_0x565260['as'],'attributes':_0x565260[_0x2dcb('0x1c')],'include':_0x565260['include']?_[_0x2dcb('0x20')](_0x565260[_0x2dcb('0x1a')],function(_0x51c69d){return{'model':db[_0x51c69d[_0x2dcb('0x1b')]],'as':_0x51c69d['as'],'attributes':_0x51c69d[_0x2dcb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2dcb('0xc')](function(_0x3bc80b){logger[_0x2dcb('0xd')]('ShowServicenowAccount',_0x4c1c74);logger[_0x2dcb('0x1d')](_0x2dcb('0x1e'),_0x4c1c74,JSON['stringify'](_0x3bc80b));_0x18590a(_0x3bc80b);})[_0x2dcb('0x21')](function(_0x408a2c){logger[_0x2dcb('0x11')](_0x2dcb('0x1e'),_0x408a2c[_0x2dcb('0x13')],_0x4c1c74);_0x4ca9e8(_0x4a5ded[_0x2dcb('0x11')](0x1f4,_0x408a2c[_0x2dcb('0x13')]));});});};
\ No newline at end of file
index 8dfabca..ef8d3b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c3d=['../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4070f7,_0x642c2f){var _0x1ffb56=function(_0x15d079){while(--_0x15d079){_0x4070f7['push'](_0x4070f7['shift']());}};_0x1ffb56(++_0x642c2f);}(_0x0c3d,0x12f));var _0xd0c3=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x0c3d[_0x29d623];return _0x242e59;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd0c3('0x0'));var timeout=require(_0xd0c3('0x1'));var express=require(_0xd0c3('0x2'));var router=express[_0xd0c3('0x3')]();var auth=require(_0xd0c3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd0c3('0x5'));var controller=require(_0xd0c3('0x6'));router[_0xd0c3('0x7')]('/',auth['isAuthenticated'](),controller[_0xd0c3('0x8')]);router[_0xd0c3('0x7')](_0xd0c3('0x9'),auth[_0xd0c3('0xa')](),controller['show']);router[_0xd0c3('0x7')](_0xd0c3('0xb'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0xc')]);router['get'](_0xd0c3('0xd'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0xe')]);router['get'](_0xd0c3('0xf'),auth['isAuthenticated'](),controller[_0xd0c3('0x10')]);router[_0xd0c3('0x11')]('/',auth[_0xd0c3('0xa')](),controller['create']);router[_0xd0c3('0x12')](_0xd0c3('0x9'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0x13')]);router[_0xd0c3('0x14')](_0xd0c3('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xd0c3('0x15')]=router;
\ No newline at end of file
+var _0x56a0=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x56a0,0x19d));var _0x056a=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0x56a0[_0x51beba];return _0x167ee0;};'use strict';var multer=require(_0x056a('0x0'));var util=require(_0x056a('0x1'));var path=require(_0x056a('0x2'));var timeout=require(_0x056a('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x056a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x056a('0x5'));var controller=require('./intServicenowConfiguration.controller');router[_0x056a('0x6')]('/',auth[_0x056a('0x7')](),controller[_0x056a('0x8')]);router[_0x056a('0x6')](_0x056a('0x9'),auth[_0x056a('0x7')](),controller['show']);router[_0x056a('0x6')]('/:id/fields',auth[_0x056a('0x7')](),controller[_0x056a('0xa')]);router[_0x056a('0x6')](_0x056a('0xb'),auth['isAuthenticated'](),controller[_0x056a('0xc')]);router[_0x056a('0x6')](_0x056a('0xd'),auth['isAuthenticated'](),controller[_0x056a('0xe')]);router['post']('/',auth[_0x056a('0x7')](),controller[_0x056a('0xf')]);router[_0x056a('0x10')](_0x056a('0x9'),auth[_0x056a('0x7')](),controller[_0x056a('0x11')]);router[_0x056a('0x12')](_0x056a('0x9'),auth[_0x056a('0x7')](),controller[_0x056a('0x13')]);module[_0x056a('0x14')]=router;
\ No newline at end of file
index d3ab910..b5376a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f4f=['sequelize','exports','STRING'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x2f4f,0x75));var _0xf2f4=function(_0x5700a2,_0x19ffed){_0x5700a2=_0x5700a2-0x0;var _0x1a424d=_0x2f4f[_0x5700a2];return _0x1a424d;};'use strict';var Sequelize=require(_0xf2f4('0x0'));module[_0xf2f4('0x1')]={'name':{'type':Sequelize[_0xf2f4('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe62e=['exports','STRING','sequelize'];(function(_0x1befd5,_0x4abdc0){var _0x477b13=function(_0x44e7ea){while(--_0x44e7ea){_0x1befd5['push'](_0x1befd5['shift']());}};_0x477b13(++_0x4abdc0);}(_0xe62e,0x11c));var _0xee62=function(_0x576cd5,_0x48085b){_0x576cd5=_0x576cd5-0x0;var _0x1b1bb1=_0xe62e[_0x576cd5];return _0x1b1bb1;};'use strict';var Sequelize=require(_0xee62('0x0'));module[_0xee62('0x1')]={'name':{'type':Sequelize[_0xee62('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e165a66..6776936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c00=['ServicenowConfiguration','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','update','getFields','findOne','pick','ServicenowField','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','destroy','stack','name','send','index','map'];(function(_0x4cdef6,_0x37cd62){var _0x4bdba2=function(_0xf4d56a){while(--_0xf4d56a){_0x4cdef6['push'](_0x4cdef6['shift']());}};_0x4bdba2(++_0x37cd62);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5206a7,_0x3c7975){_0x5206a7=_0x5206a7-0x0;var _0x4cd7ee=_0x9c00[_0x5206a7];return _0x4cd7ee;};'use strict';var pdf=require(_0x09c0('0x0'));var emlformat=require(_0x09c0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x09c0('0x2'));var rp=require(_0x09c0('0x3'));var moment=require('moment');var BPromise=require(_0x09c0('0x4'));var Mustache=require(_0x09c0('0x5'));var util=require(_0x09c0('0x6'));var path=require(_0x09c0('0x7'));var sox=require(_0x09c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var db=require(_0x09c0('0x19'))['db'];var jayson=require(_0x09c0('0x1a'));var client=jayson[_0x09c0('0x1b')][_0x09c0('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x331905,_0x6149a8,_0x2a86da){if(_0x2a86da){var _0x342ceb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x342ceb[_0x09c0('0x1d')](_0x6149a8)){return _0x331905;}else{throw new db[(_0x09c0('0x1e'))][(_0x09c0('0x1f'))](_0x09c0('0x20'));}}else{return _0x331905;}}function respondWithRpcPromise(_0x45a265,_0x33c3d6,_0x2fdf11,_0x4ff6b7){return new BPromise(function(_0x590129,_0x558b4f){var _0x42030d=_0x4ff6b7||client;return _0x42030d[_0x09c0('0x21')](_0x45a265,_0x2fdf11)[_0x09c0('0x22')](function(_0x628272){logger['info'](_0x09c0('0x23'),_0x33c3d6,'request\x20sent');logger['debug'](_0x09c0('0x24'),_0x33c3d6,'request\x20sent',JSON[_0x09c0('0x25')](_0x628272));if(_0x628272[_0x09c0('0x26')]){if(_0x628272[_0x09c0('0x26')]['code']===0x1f4){logger[_0x09c0('0x26')](_0x09c0('0x23'),_0x33c3d6,_0x628272[_0x09c0('0x26')][_0x09c0('0x27')]);return _0x558b4f(_0x628272[_0x09c0('0x26')][_0x09c0('0x27')]);}logger[_0x09c0('0x26')]('ServicenowConfiguration,\x20%s,\x20%s',_0x33c3d6,_0x628272[_0x09c0('0x26')][_0x09c0('0x27')]);return _0x590129(_0x628272[_0x09c0('0x26')][_0x09c0('0x27')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x33c3d6,_0x09c0('0x28'));_0x590129(_0x628272[_0x09c0('0x29')][_0x09c0('0x27')]);}})[_0x09c0('0x2a')](function(_0x491e6f){logger[_0x09c0('0x26')](_0x09c0('0x23'),_0x33c3d6,_0x491e6f);_0x558b4f(_0x491e6f);});});}function respondWithStatusCode(_0x56d883,_0x2c7202){_0x2c7202=_0x2c7202||0xcc;return function(_0x163a59){if(_0x163a59){return _0x56d883[_0x09c0('0x2b')](_0x2c7202);}return _0x56d883[_0x09c0('0x2c')](_0x2c7202)[_0x09c0('0x2d')]();};}function respondWithResult(_0x1d2d9d,_0x45cc64){_0x45cc64=_0x45cc64||0xc8;return function(_0x35b61c){if(_0x35b61c){return _0x1d2d9d[_0x09c0('0x2c')](_0x45cc64)[_0x09c0('0x2e')](_0x35b61c);}};}function respondWithFilteredResult(_0x46a36a,_0x5e53ac){return function(_0x15a667){if(_0x15a667){var _0x1bdde9=_0x15a667[_0x09c0('0x2f')],_0x53a7b8=_0x5e53ac['offset'],_0x1d09e0=_0x5e53ac[_0x09c0('0x30')]+_0x5e53ac[_0x09c0('0x31')],_0x5aa0b9;if(_0x1d09e0>=_0x1bdde9){_0x1d09e0=_0x1bdde9;_0x5aa0b9=0xc8;}else{_0x5aa0b9=0xce;}_0x46a36a[_0x09c0('0x2c')](_0x5aa0b9);return _0x46a36a[_0x09c0('0x32')]('Content-Range',_0x53a7b8+'-'+_0x1d09e0+'/'+_0x1bdde9)['json'](_0x15a667);}return null;};}function patchUpdates(_0x17c374){return function(_0x38a315){try{jsonpatch[_0x09c0('0x33')](_0x38a315,_0x17c374,!![]);}catch(_0x5c93ca){return BPromise[_0x09c0('0x34')](_0x5c93ca);}return _0x38a315['save']();};}function saveUpdates(_0x350cd3,_0x21755d){return function(_0x16cf08){if(_0x16cf08){return _0x16cf08['update'](_0x350cd3)[_0x09c0('0x22')](function(_0x4574f7){return _0x4574f7;});}return null;};}function removeEntity(_0xbb7685,_0x184c0b){return function(_0x234f07){if(_0x234f07){return _0x234f07[_0x09c0('0x35')]()[_0x09c0('0x22')](function(){_0xbb7685['status'](0xcc)[_0x09c0('0x2d')]();});}};}function handleEntityNotFound(_0x2c19be,_0x2f136c){return function(_0x132f6c){if(!_0x132f6c){_0x2c19be[_0x09c0('0x2b')](0x194);}return _0x132f6c;};}function handleError(_0x50a37e,_0x920e2c){_0x920e2c=_0x920e2c||0x1f4;return function(_0x20349e){logger[_0x09c0('0x26')](_0x20349e[_0x09c0('0x36')]);if(_0x20349e[_0x09c0('0x37')]){delete _0x20349e['name'];}_0x50a37e[_0x09c0('0x2c')](_0x920e2c)[_0x09c0('0x38')](_0x20349e);};}exports[_0x09c0('0x39')]=function(_0x16f81e,_0x419d1c){var _0x3e8b74={},_0x21c48c={},_0x5f50fe={'count':0x0,'rows':[]};var _0x363b5c=_[_0x09c0('0x3a')](db[_0x09c0('0x3b')][_0x09c0('0x3c')],function(_0x453c23){return{'name':_0x453c23['fieldName'],'type':_0x453c23['type']['key']};});_0x21c48c['model']=_[_0x09c0('0x3a')](_0x363b5c,_0x09c0('0x37'));_0x21c48c[_0x09c0('0x3d')]=_[_0x09c0('0x3e')](_0x16f81e[_0x09c0('0x3d')]);_0x21c48c['filters']=_[_0x09c0('0x3f')](_0x21c48c[_0x09c0('0x40')],_0x21c48c['query']);_0x3e8b74[_0x09c0('0x41')]=_['intersection'](_0x21c48c[_0x09c0('0x40')],qs['fields'](_0x16f81e[_0x09c0('0x3d')][_0x09c0('0x42')]));_0x3e8b74['attributes']=_0x3e8b74[_0x09c0('0x41')][_0x09c0('0x43')]?_0x3e8b74['attributes']:_0x21c48c[_0x09c0('0x40')];if(!_0x16f81e[_0x09c0('0x3d')][_0x09c0('0x44')](_0x09c0('0x45'))){_0x3e8b74[_0x09c0('0x31')]=qs[_0x09c0('0x31')](_0x16f81e['query'][_0x09c0('0x31')]);_0x3e8b74[_0x09c0('0x30')]=qs[_0x09c0('0x30')](_0x16f81e['query'][_0x09c0('0x30')]);}_0x3e8b74[_0x09c0('0x46')]=qs[_0x09c0('0x47')](_0x16f81e['query'][_0x09c0('0x47')]);_0x3e8b74[_0x09c0('0x48')]=qs['filters'](_['pick'](_0x16f81e[_0x09c0('0x3d')],_0x21c48c[_0x09c0('0x49')]),_0x363b5c);if(_0x16f81e['query'][_0x09c0('0x4a')]){_0x3e8b74[_0x09c0('0x48')]=_['merge'](_0x3e8b74[_0x09c0('0x48')],{'$or':_[_0x09c0('0x3a')](_0x363b5c,function(_0x2e7d4f){if(_0x2e7d4f[_0x09c0('0x4b')]!==_0x09c0('0x4c')){var _0x569e02={};_0x569e02[_0x2e7d4f[_0x09c0('0x37')]]={'$like':'%'+_0x16f81e['query']['filter']+'%'};return _0x569e02;}})});}_0x3e8b74=_[_0x09c0('0x4d')]({},_0x3e8b74,_0x16f81e[_0x09c0('0x4e')]);var _0x17876c={'where':_0x3e8b74[_0x09c0('0x48')]};return db[_0x09c0('0x3b')][_0x09c0('0x2f')](_0x17876c)['then'](function(_0x5e239a){_0x5f50fe['count']=_0x5e239a;if(_0x16f81e[_0x09c0('0x3d')][_0x09c0('0x4f')]){_0x3e8b74[_0x09c0('0x50')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x09c0('0x51')](_0x3e8b74);})[_0x09c0('0x22')](function(_0x2016f1){_0x5f50fe[_0x09c0('0x52')]=_0x2016f1;return _0x5f50fe;})[_0x09c0('0x22')](respondWithFilteredResult(_0x419d1c,_0x3e8b74))[_0x09c0('0x2a')](handleError(_0x419d1c,null));};exports[_0x09c0('0x53')]=function(_0x2b3c56,_0x3f6d14){var _0x38085c={'raw':![],'where':{'id':_0x2b3c56[_0x09c0('0x54')]['id']}},_0x1b0198={};_0x1b0198[_0x09c0('0x40')]=_[_0x09c0('0x3e')](db[_0x09c0('0x3b')][_0x09c0('0x3c')]);_0x1b0198[_0x09c0('0x3d')]=_[_0x09c0('0x3e')](_0x2b3c56[_0x09c0('0x3d')]);_0x1b0198[_0x09c0('0x49')]=_['intersection'](_0x1b0198[_0x09c0('0x40')],_0x1b0198[_0x09c0('0x3d')]);_0x38085c[_0x09c0('0x41')]=_[_0x09c0('0x3f')](_0x1b0198[_0x09c0('0x40')],qs['fields'](_0x2b3c56[_0x09c0('0x3d')][_0x09c0('0x42')]));_0x38085c[_0x09c0('0x41')]=_0x38085c['attributes'][_0x09c0('0x43')]?_0x38085c[_0x09c0('0x41')]:_0x1b0198[_0x09c0('0x40')];if(_0x2b3c56[_0x09c0('0x3d')][_0x09c0('0x4f')]){_0x38085c[_0x09c0('0x50')]=[{'all':!![]}];}_0x38085c=_[_0x09c0('0x4d')]({},_0x38085c,_0x2b3c56['options']);return db[_0x09c0('0x3b')][_0x09c0('0x55')](_0x38085c)[_0x09c0('0x22')](handleEntityNotFound(_0x3f6d14,null))[_0x09c0('0x22')](respondWithResult(_0x3f6d14,null))[_0x09c0('0x2a')](handleError(_0x3f6d14,null));};exports[_0x09c0('0x56')]=function(_0x3ebabb,_0x4987cf){return db['ServicenowConfiguration'][_0x09c0('0x56')](_0x3ebabb[_0x09c0('0x57')],{})[_0x09c0('0x22')](respondWithResult(_0x4987cf,0xc9))['catch'](handleError(_0x4987cf,null));};exports[_0x09c0('0x58')]=function(_0x5b8e7f,_0x2fecec){if(_0x5b8e7f[_0x09c0('0x57')]['id']){delete _0x5b8e7f[_0x09c0('0x57')]['id'];}return db[_0x09c0('0x3b')][_0x09c0('0x55')]({'where':{'id':_0x5b8e7f[_0x09c0('0x54')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x2fecec,null))['then'](saveUpdates(_0x5b8e7f[_0x09c0('0x57')],null))[_0x09c0('0x22')](respondWithResult(_0x2fecec,null))[_0x09c0('0x2a')](handleError(_0x2fecec,null));};exports[_0x09c0('0x35')]=function(_0x3a6845,_0x219195){return db[_0x09c0('0x3b')][_0x09c0('0x55')]({'where':{'id':_0x3a6845[_0x09c0('0x54')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x219195,null))[_0x09c0('0x22')](removeEntity(_0x219195,null))['catch'](handleError(_0x219195,null));};exports[_0x09c0('0x59')]=function(_0x3564e6,_0x26dc22,_0x6894c1){var _0x4f3457={};var _0x157520={};var _0x48dae0;var _0x29205f;return db[_0x09c0('0x3b')][_0x09c0('0x5a')]({'where':{'id':_0x3564e6['params']['id']}})['then'](handleEntityNotFound(_0x26dc22,null))[_0x09c0('0x22')](function(_0x36e3b0){if(_0x36e3b0){_0x48dae0=_0x36e3b0;_0x157520[_0x09c0('0x40')]=_[_0x09c0('0x3e')](db['ServicenowField'][_0x09c0('0x3c')]);_0x157520[_0x09c0('0x3d')]=_['keys'](_0x3564e6[_0x09c0('0x3d')]);_0x157520[_0x09c0('0x49')]=_[_0x09c0('0x3f')](_0x157520[_0x09c0('0x40')],_0x157520['query']);_0x4f3457[_0x09c0('0x41')]=_[_0x09c0('0x3f')](_0x157520[_0x09c0('0x40')],qs[_0x09c0('0x42')](_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x42')]));_0x4f3457[_0x09c0('0x41')]=_0x4f3457[_0x09c0('0x41')][_0x09c0('0x43')]?_0x4f3457[_0x09c0('0x41')]:_0x157520[_0x09c0('0x40')];_0x4f3457[_0x09c0('0x46')]=qs[_0x09c0('0x47')](_0x3564e6['query'][_0x09c0('0x47')]);_0x4f3457[_0x09c0('0x48')]=qs[_0x09c0('0x49')](_[_0x09c0('0x5b')](_0x3564e6[_0x09c0('0x3d')],_0x157520['filters']));if(_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x4a')]){_0x4f3457[_0x09c0('0x48')]=_[_0x09c0('0x4d')](_0x4f3457['where'],{'$or':_[_0x09c0('0x3a')](_0x4f3457[_0x09c0('0x41')],function(_0x569462){var _0x325013={};_0x325013[_0x569462]={'$like':'%'+_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x4a')]+'%'};return _0x325013;})});}_0x4f3457=_[_0x09c0('0x4d')]({},_0x4f3457,_0x3564e6[_0x09c0('0x4e')]);return _0x48dae0['getFields'](_0x4f3457);}})[_0x09c0('0x22')](function(_0x302c81){if(_0x302c81){_0x29205f=_0x302c81[_0x09c0('0x43')];if(!_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x44')]('nolimit')){_0x4f3457[_0x09c0('0x31')]=qs[_0x09c0('0x31')](_0x3564e6[_0x09c0('0x3d')][_0x09c0('0x31')]);_0x4f3457[_0x09c0('0x30')]=qs[_0x09c0('0x30')](_0x3564e6['query']['offset']);}return _0x48dae0['getFields'](_0x4f3457);}})['then'](function(_0x7c1cb8){if(_0x7c1cb8){return _0x7c1cb8?{'count':_0x29205f,'rows':_0x7c1cb8}:null;}})[_0x09c0('0x22')](respondWithResult(_0x26dc22,null))[_0x09c0('0x2a')](handleError(_0x26dc22,null));};exports['getSubjects']=function(_0x3306b9,_0x595b73,_0x368108){var _0x14872e={};var _0x5732ae={};var _0x3998ec;var _0x48d41f;return db['ServicenowConfiguration'][_0x09c0('0x5a')]({'where':{'id':_0x3306b9[_0x09c0('0x54')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x595b73,null))[_0x09c0('0x22')](function(_0x2c34e6){if(_0x2c34e6){_0x3998ec=_0x2c34e6;_0x5732ae[_0x09c0('0x40')]=_[_0x09c0('0x3e')](db[_0x09c0('0x5c')][_0x09c0('0x3c')]);_0x5732ae[_0x09c0('0x3d')]=_['keys'](_0x3306b9[_0x09c0('0x3d')]);_0x5732ae[_0x09c0('0x49')]=_['intersection'](_0x5732ae['model'],_0x5732ae[_0x09c0('0x3d')]);_0x14872e[_0x09c0('0x41')]=_[_0x09c0('0x3f')](_0x5732ae[_0x09c0('0x40')],qs[_0x09c0('0x42')](_0x3306b9[_0x09c0('0x3d')][_0x09c0('0x42')]));_0x14872e['attributes']=_0x14872e[_0x09c0('0x41')]['length']?_0x14872e[_0x09c0('0x41')]:_0x5732ae[_0x09c0('0x40')];_0x14872e[_0x09c0('0x46')]=qs[_0x09c0('0x47')](_0x3306b9[_0x09c0('0x3d')]['sort']);_0x14872e[_0x09c0('0x48')]=qs['filters'](_[_0x09c0('0x5b')](_0x3306b9['query'],_0x5732ae[_0x09c0('0x49')]));if(_0x3306b9[_0x09c0('0x3d')][_0x09c0('0x4a')]){_0x14872e[_0x09c0('0x48')]=_[_0x09c0('0x4d')](_0x14872e[_0x09c0('0x48')],{'$or':_[_0x09c0('0x3a')](_0x14872e['attributes'],function(_0x4ab50d){var _0x2c29c2={};_0x2c29c2[_0x4ab50d]={'$like':'%'+_0x3306b9[_0x09c0('0x3d')][_0x09c0('0x4a')]+'%'};return _0x2c29c2;})});}_0x14872e=_[_0x09c0('0x4d')]({},_0x14872e,_0x3306b9[_0x09c0('0x4e')]);return _0x3998ec[_0x09c0('0x5d')](_0x14872e);}})[_0x09c0('0x22')](function(_0x139c05){if(_0x139c05){_0x48d41f=_0x139c05[_0x09c0('0x43')];if(!_0x3306b9[_0x09c0('0x3d')]['hasOwnProperty']('nolimit')){_0x14872e['limit']=qs[_0x09c0('0x31')](_0x3306b9[_0x09c0('0x3d')][_0x09c0('0x31')]);_0x14872e['offset']=qs['offset'](_0x3306b9[_0x09c0('0x3d')]['offset']);}return _0x3998ec[_0x09c0('0x5d')](_0x14872e);}})[_0x09c0('0x22')](function(_0x5c3d6a){if(_0x5c3d6a){return _0x5c3d6a?{'count':_0x48d41f,'rows':_0x5c3d6a}:null;}})[_0x09c0('0x22')](respondWithResult(_0x595b73,null))['catch'](handleError(_0x595b73,null));};exports[_0x09c0('0x5e')]=function(_0x1fd9ce,_0x15a0fe,_0x55dcf1){var _0x2ea30f={};var _0x456adf={};var _0x2a637e;var _0x27012f;return db[_0x09c0('0x3b')][_0x09c0('0x5a')]({'where':{'id':_0x1fd9ce[_0x09c0('0x54')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x15a0fe,null))[_0x09c0('0x22')](function(_0x26cb1d){if(_0x26cb1d){_0x2a637e=_0x26cb1d;_0x456adf[_0x09c0('0x40')]=_[_0x09c0('0x3e')](db['ServicenowField'][_0x09c0('0x3c')]);_0x456adf[_0x09c0('0x3d')]=_[_0x09c0('0x3e')](_0x1fd9ce[_0x09c0('0x3d')]);_0x456adf[_0x09c0('0x49')]=_['intersection'](_0x456adf[_0x09c0('0x40')],_0x456adf['query']);_0x2ea30f['attributes']=_[_0x09c0('0x3f')](_0x456adf[_0x09c0('0x40')],qs[_0x09c0('0x42')](_0x1fd9ce['query'][_0x09c0('0x42')]));_0x2ea30f[_0x09c0('0x41')]=_0x2ea30f[_0x09c0('0x41')][_0x09c0('0x43')]?_0x2ea30f[_0x09c0('0x41')]:_0x456adf[_0x09c0('0x40')];_0x2ea30f['order']=qs[_0x09c0('0x47')](_0x1fd9ce[_0x09c0('0x3d')]['sort']);_0x2ea30f[_0x09c0('0x48')]=qs[_0x09c0('0x49')](_['pick'](_0x1fd9ce[_0x09c0('0x3d')],_0x456adf[_0x09c0('0x49')]));if(_0x1fd9ce[_0x09c0('0x3d')]['filter']){_0x2ea30f[_0x09c0('0x48')]=_[_0x09c0('0x4d')](_0x2ea30f['where'],{'$or':_[_0x09c0('0x3a')](_0x2ea30f[_0x09c0('0x41')],function(_0x5aa1b6){var _0x42a643={};_0x42a643[_0x5aa1b6]={'$like':'%'+_0x1fd9ce[_0x09c0('0x3d')][_0x09c0('0x4a')]+'%'};return _0x42a643;})});}_0x2ea30f=_[_0x09c0('0x4d')]({},_0x2ea30f,_0x1fd9ce[_0x09c0('0x4e')]);return _0x2a637e['getDescriptions'](_0x2ea30f);}})[_0x09c0('0x22')](function(_0x2bf080){if(_0x2bf080){_0x27012f=_0x2bf080[_0x09c0('0x43')];if(!_0x1fd9ce['query'][_0x09c0('0x44')](_0x09c0('0x45'))){_0x2ea30f[_0x09c0('0x31')]=qs['limit'](_0x1fd9ce[_0x09c0('0x3d')][_0x09c0('0x31')]);_0x2ea30f[_0x09c0('0x30')]=qs[_0x09c0('0x30')](_0x1fd9ce[_0x09c0('0x3d')][_0x09c0('0x30')]);}return _0x2a637e[_0x09c0('0x5e')](_0x2ea30f);}})['then'](function(_0x22a245){if(_0x22a245){return _0x22a245?{'count':_0x27012f,'rows':_0x22a245}:null;}})[_0x09c0('0x22')](respondWithResult(_0x15a0fe,null))[_0x09c0('0x2a')](handleError(_0x15a0fe,null));};
\ No newline at end of file
+var _0x1339=['sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','ServicenowConfiguration','length','find','create','update','body','getFields','findOne','nolimit','getSubjects','getDescriptions','ServicenowField','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order'];(function(_0x7dfd37,_0x6a8efc){var _0x4cf35b=function(_0x584ede){while(--_0x584ede){_0x7dfd37['push'](_0x7dfd37['shift']());}};_0x4cf35b(++_0x6a8efc);}(_0x1339,0x1ed));var _0x9133=function(_0x4498ff,_0x2cc0b4){_0x4498ff=_0x4498ff-0x0;var _0x2bd56e=_0x1339[_0x4498ff];return _0x2bd56e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9133('0x0'));var zipdir=require(_0x9133('0x1'));var jsonpatch=require(_0x9133('0x2'));var rp=require(_0x9133('0x3'));var moment=require(_0x9133('0x4'));var BPromise=require(_0x9133('0x5'));var Mustache=require(_0x9133('0x6'));var util=require(_0x9133('0x7'));var path=require('path');var sox=require(_0x9133('0x8'));var csv=require(_0x9133('0x9'));var ejs=require(_0x9133('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x9'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var db=require(_0x9133('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9133('0x1a')][_0x9133('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4bbfdc,_0x5283a3,_0x10475c){if(_0x10475c){var _0x4bf947=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bf947[_0x9133('0x1c')](_0x5283a3)){return _0x4bbfdc;}else{throw new db[(_0x9133('0x1d'))][(_0x9133('0x1e'))](_0x9133('0x1f'));}}else{return _0x4bbfdc;}}function respondWithRpcPromise(_0x31847a,_0x4327b3,_0x49cc5d,_0x13f8fc){return new BPromise(function(_0x1e23ce,_0x4f4f14){var _0x28ffcb=_0x13f8fc||client;return _0x28ffcb[_0x9133('0x20')](_0x31847a,_0x49cc5d)[_0x9133('0x21')](function(_0x427663){logger['info'](_0x9133('0x22'),_0x4327b3,'request\x20sent');logger[_0x9133('0x23')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x4327b3,_0x9133('0x24'),JSON[_0x9133('0x25')](_0x427663));if(_0x427663['error']){if(_0x427663[_0x9133('0x26')]['code']===0x1f4){logger[_0x9133('0x26')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4327b3,_0x427663['error'][_0x9133('0x27')]);return _0x4f4f14(_0x427663['error'][_0x9133('0x27')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x4327b3,_0x427663['error'][_0x9133('0x27')]);return _0x1e23ce(_0x427663[_0x9133('0x26')]['message']);}else{logger[_0x9133('0x28')](_0x9133('0x22'),_0x4327b3,_0x9133('0x24'));_0x1e23ce(_0x427663[_0x9133('0x29')]['message']);}})[_0x9133('0x2a')](function(_0x5c4614){logger[_0x9133('0x26')](_0x9133('0x22'),_0x4327b3,_0x5c4614);_0x4f4f14(_0x5c4614);});});}function respondWithStatusCode(_0x3f278d,_0x14c1cb){_0x14c1cb=_0x14c1cb||0xcc;return function(_0x4483ef){if(_0x4483ef){return _0x3f278d[_0x9133('0x2b')](_0x14c1cb);}return _0x3f278d[_0x9133('0x2c')](_0x14c1cb)[_0x9133('0x2d')]();};}function respondWithResult(_0x1b6b3e,_0x46050b){_0x46050b=_0x46050b||0xc8;return function(_0x51de62){if(_0x51de62){return _0x1b6b3e['status'](_0x46050b)[_0x9133('0x2e')](_0x51de62);}};}function respondWithFilteredResult(_0x3dfdc2,_0x428e18){return function(_0x348486){if(_0x348486){var _0x4de894=_0x348486[_0x9133('0x2f')],_0x4ecd9e=_0x428e18[_0x9133('0x30')],_0x3e2404=_0x428e18[_0x9133('0x30')]+_0x428e18[_0x9133('0x31')],_0x45966d;if(_0x3e2404>=_0x4de894){_0x3e2404=_0x4de894;_0x45966d=0xc8;}else{_0x45966d=0xce;}_0x3dfdc2['status'](_0x45966d);return _0x3dfdc2['set']('Content-Range',_0x4ecd9e+'-'+_0x3e2404+'/'+_0x4de894)[_0x9133('0x2e')](_0x348486);}return null;};}function patchUpdates(_0x4a4a8e){return function(_0x43b5f3){try{jsonpatch[_0x9133('0x32')](_0x43b5f3,_0x4a4a8e,!![]);}catch(_0x540c79){return BPromise[_0x9133('0x33')](_0x540c79);}return _0x43b5f3['save']();};}function saveUpdates(_0xf0aec4,_0x26ca56){return function(_0x4020d1){if(_0x4020d1){return _0x4020d1['update'](_0xf0aec4)[_0x9133('0x21')](function(_0x41cfbe){return _0x41cfbe;});}return null;};}function removeEntity(_0x3f189c,_0x5f12b9){return function(_0x10cea6){if(_0x10cea6){return _0x10cea6[_0x9133('0x34')]()[_0x9133('0x21')](function(){_0x3f189c['status'](0xcc)[_0x9133('0x2d')]();});}};}function handleEntityNotFound(_0x20da68,_0x1b5700){return function(_0x1471bb){if(!_0x1471bb){_0x20da68['sendStatus'](0x194);}return _0x1471bb;};}function handleError(_0x3ccd89,_0xea26a3){_0xea26a3=_0xea26a3||0x1f4;return function(_0x56719e){logger[_0x9133('0x26')](_0x56719e[_0x9133('0x35')]);if(_0x56719e[_0x9133('0x36')]){delete _0x56719e[_0x9133('0x36')];}_0x3ccd89[_0x9133('0x2c')](_0xea26a3)[_0x9133('0x37')](_0x56719e);};}exports[_0x9133('0x38')]=function(_0x167e45,_0x4172e3){var _0x335217={},_0x40d92f={},_0x4f3fa6={'count':0x0,'rows':[]};var _0x17bb4c=_[_0x9133('0x39')](db['ServicenowConfiguration'][_0x9133('0x3a')],function(_0x3a2d1f){return{'name':_0x3a2d1f[_0x9133('0x3b')],'type':_0x3a2d1f[_0x9133('0x3c')][_0x9133('0x3d')]};});_0x40d92f[_0x9133('0x3e')]=_['map'](_0x17bb4c,'name');_0x40d92f[_0x9133('0x3f')]=_[_0x9133('0x40')](_0x167e45[_0x9133('0x3f')]);_0x40d92f[_0x9133('0x41')]=_[_0x9133('0x42')](_0x40d92f[_0x9133('0x3e')],_0x40d92f[_0x9133('0x3f')]);_0x335217[_0x9133('0x43')]=_[_0x9133('0x42')](_0x40d92f['model'],qs[_0x9133('0x44')](_0x167e45[_0x9133('0x3f')][_0x9133('0x44')]));_0x335217[_0x9133('0x43')]=_0x335217[_0x9133('0x43')]['length']?_0x335217[_0x9133('0x43')]:_0x40d92f[_0x9133('0x3e')];if(!_0x167e45[_0x9133('0x3f')][_0x9133('0x45')]('nolimit')){_0x335217[_0x9133('0x31')]=qs[_0x9133('0x31')](_0x167e45[_0x9133('0x3f')][_0x9133('0x31')]);_0x335217[_0x9133('0x30')]=qs[_0x9133('0x30')](_0x167e45[_0x9133('0x3f')]['offset']);}_0x335217[_0x9133('0x46')]=qs['sort'](_0x167e45['query'][_0x9133('0x47')]);_0x335217[_0x9133('0x48')]=qs[_0x9133('0x41')](_[_0x9133('0x49')](_0x167e45[_0x9133('0x3f')],_0x40d92f[_0x9133('0x41')]),_0x17bb4c);if(_0x167e45[_0x9133('0x3f')][_0x9133('0x4a')]){_0x335217[_0x9133('0x48')]=_['merge'](_0x335217[_0x9133('0x48')],{'$or':_[_0x9133('0x39')](_0x17bb4c,function(_0x2928bd){if(_0x2928bd['type']!=='VIRTUAL'){var _0x4fae70={};_0x4fae70[_0x2928bd[_0x9133('0x36')]]={'$like':'%'+_0x167e45['query'][_0x9133('0x4a')]+'%'};return _0x4fae70;}})});}_0x335217=_[_0x9133('0x4b')]({},_0x335217,_0x167e45[_0x9133('0x4c')]);var _0x1a71f0={'where':_0x335217[_0x9133('0x48')]};return db['ServicenowConfiguration'][_0x9133('0x2f')](_0x1a71f0)[_0x9133('0x21')](function(_0x1acf51){_0x4f3fa6['count']=_0x1acf51;if(_0x167e45[_0x9133('0x3f')][_0x9133('0x4d')]){_0x335217['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x9133('0x4e')](_0x335217);})[_0x9133('0x21')](function(_0x4446fe){_0x4f3fa6[_0x9133('0x4f')]=_0x4446fe;return _0x4f3fa6;})[_0x9133('0x21')](respondWithFilteredResult(_0x4172e3,_0x335217))[_0x9133('0x2a')](handleError(_0x4172e3,null));};exports[_0x9133('0x50')]=function(_0x21177a,_0x23f134){var _0xf07fbb={'raw':![],'where':{'id':_0x21177a[_0x9133('0x51')]['id']}},_0x3d6a49={};_0x3d6a49['model']=_['keys'](db[_0x9133('0x52')]['rawAttributes']);_0x3d6a49[_0x9133('0x3f')]=_[_0x9133('0x40')](_0x21177a[_0x9133('0x3f')]);_0x3d6a49[_0x9133('0x41')]=_['intersection'](_0x3d6a49[_0x9133('0x3e')],_0x3d6a49[_0x9133('0x3f')]);_0xf07fbb[_0x9133('0x43')]=_['intersection'](_0x3d6a49[_0x9133('0x3e')],qs[_0x9133('0x44')](_0x21177a[_0x9133('0x3f')]['fields']));_0xf07fbb[_0x9133('0x43')]=_0xf07fbb['attributes'][_0x9133('0x53')]?_0xf07fbb[_0x9133('0x43')]:_0x3d6a49[_0x9133('0x3e')];if(_0x21177a[_0x9133('0x3f')]['includeAll']){_0xf07fbb['include']=[{'all':!![]}];}_0xf07fbb=_[_0x9133('0x4b')]({},_0xf07fbb,_0x21177a[_0x9133('0x4c')]);return db[_0x9133('0x52')][_0x9133('0x54')](_0xf07fbb)[_0x9133('0x21')](handleEntityNotFound(_0x23f134,null))['then'](respondWithResult(_0x23f134,null))['catch'](handleError(_0x23f134,null));};exports[_0x9133('0x55')]=function(_0x16f889,_0x4abefd){return db[_0x9133('0x52')][_0x9133('0x55')](_0x16f889['body'],{})['then'](respondWithResult(_0x4abefd,0xc9))['catch'](handleError(_0x4abefd,null));};exports[_0x9133('0x56')]=function(_0x537046,_0x12d9e1){if(_0x537046[_0x9133('0x57')]['id']){delete _0x537046[_0x9133('0x57')]['id'];}return db[_0x9133('0x52')]['find']({'where':{'id':_0x537046[_0x9133('0x51')]['id']}})['then'](handleEntityNotFound(_0x12d9e1,null))[_0x9133('0x21')](saveUpdates(_0x537046[_0x9133('0x57')],null))[_0x9133('0x21')](respondWithResult(_0x12d9e1,null))[_0x9133('0x2a')](handleError(_0x12d9e1,null));};exports[_0x9133('0x34')]=function(_0x3534bf,_0x56861c){return db['ServicenowConfiguration']['find']({'where':{'id':_0x3534bf[_0x9133('0x51')]['id']}})[_0x9133('0x21')](handleEntityNotFound(_0x56861c,null))[_0x9133('0x21')](removeEntity(_0x56861c,null))['catch'](handleError(_0x56861c,null));};exports[_0x9133('0x58')]=function(_0x1f6684,_0x415d55,_0x240dbf){var _0x4430dc={};var _0x356103={};var _0x43dd0a;var _0x218d8e;return db['ServicenowConfiguration'][_0x9133('0x59')]({'where':{'id':_0x1f6684['params']['id']}})[_0x9133('0x21')](handleEntityNotFound(_0x415d55,null))['then'](function(_0x3a77be){if(_0x3a77be){_0x43dd0a=_0x3a77be;_0x356103[_0x9133('0x3e')]=_['keys'](db['ServicenowField'][_0x9133('0x3a')]);_0x356103[_0x9133('0x3f')]=_[_0x9133('0x40')](_0x1f6684[_0x9133('0x3f')]);_0x356103[_0x9133('0x41')]=_[_0x9133('0x42')](_0x356103[_0x9133('0x3e')],_0x356103[_0x9133('0x3f')]);_0x4430dc[_0x9133('0x43')]=_[_0x9133('0x42')](_0x356103[_0x9133('0x3e')],qs['fields'](_0x1f6684[_0x9133('0x3f')]['fields']));_0x4430dc[_0x9133('0x43')]=_0x4430dc[_0x9133('0x43')][_0x9133('0x53')]?_0x4430dc[_0x9133('0x43')]:_0x356103[_0x9133('0x3e')];_0x4430dc['order']=qs[_0x9133('0x47')](_0x1f6684[_0x9133('0x3f')][_0x9133('0x47')]);_0x4430dc[_0x9133('0x48')]=qs['filters'](_[_0x9133('0x49')](_0x1f6684[_0x9133('0x3f')],_0x356103[_0x9133('0x41')]));if(_0x1f6684[_0x9133('0x3f')]['filter']){_0x4430dc['where']=_[_0x9133('0x4b')](_0x4430dc[_0x9133('0x48')],{'$or':_[_0x9133('0x39')](_0x4430dc[_0x9133('0x43')],function(_0x28cc46){var _0x2cfaf8={};_0x2cfaf8[_0x28cc46]={'$like':'%'+_0x1f6684['query'][_0x9133('0x4a')]+'%'};return _0x2cfaf8;})});}_0x4430dc=_[_0x9133('0x4b')]({},_0x4430dc,_0x1f6684[_0x9133('0x4c')]);return _0x43dd0a[_0x9133('0x58')](_0x4430dc);}})['then'](function(_0x47342a){if(_0x47342a){_0x218d8e=_0x47342a['length'];if(!_0x1f6684[_0x9133('0x3f')][_0x9133('0x45')](_0x9133('0x5a'))){_0x4430dc[_0x9133('0x31')]=qs[_0x9133('0x31')](_0x1f6684[_0x9133('0x3f')][_0x9133('0x31')]);_0x4430dc[_0x9133('0x30')]=qs['offset'](_0x1f6684[_0x9133('0x3f')][_0x9133('0x30')]);}return _0x43dd0a[_0x9133('0x58')](_0x4430dc);}})[_0x9133('0x21')](function(_0x406861){if(_0x406861){return _0x406861?{'count':_0x218d8e,'rows':_0x406861}:null;}})['then'](respondWithResult(_0x415d55,null))['catch'](handleError(_0x415d55,null));};exports['getSubjects']=function(_0x7e0f3c,_0x1ea18c,_0x3d7a07){var _0x4c0225={};var _0xcbc942={};var _0x3bf109;var _0x36aa57;return db[_0x9133('0x52')][_0x9133('0x59')]({'where':{'id':_0x7e0f3c[_0x9133('0x51')]['id']}})[_0x9133('0x21')](handleEntityNotFound(_0x1ea18c,null))[_0x9133('0x21')](function(_0x50c174){if(_0x50c174){_0x3bf109=_0x50c174;_0xcbc942[_0x9133('0x3e')]=_[_0x9133('0x40')](db['ServicenowField'][_0x9133('0x3a')]);_0xcbc942['query']=_[_0x9133('0x40')](_0x7e0f3c[_0x9133('0x3f')]);_0xcbc942[_0x9133('0x41')]=_[_0x9133('0x42')](_0xcbc942[_0x9133('0x3e')],_0xcbc942['query']);_0x4c0225[_0x9133('0x43')]=_[_0x9133('0x42')](_0xcbc942[_0x9133('0x3e')],qs[_0x9133('0x44')](_0x7e0f3c['query'][_0x9133('0x44')]));_0x4c0225[_0x9133('0x43')]=_0x4c0225[_0x9133('0x43')][_0x9133('0x53')]?_0x4c0225[_0x9133('0x43')]:_0xcbc942[_0x9133('0x3e')];_0x4c0225[_0x9133('0x46')]=qs[_0x9133('0x47')](_0x7e0f3c[_0x9133('0x3f')][_0x9133('0x47')]);_0x4c0225[_0x9133('0x48')]=qs['filters'](_[_0x9133('0x49')](_0x7e0f3c[_0x9133('0x3f')],_0xcbc942[_0x9133('0x41')]));if(_0x7e0f3c[_0x9133('0x3f')]['filter']){_0x4c0225[_0x9133('0x48')]=_['merge'](_0x4c0225[_0x9133('0x48')],{'$or':_[_0x9133('0x39')](_0x4c0225[_0x9133('0x43')],function(_0x530984){var _0x183298={};_0x183298[_0x530984]={'$like':'%'+_0x7e0f3c[_0x9133('0x3f')][_0x9133('0x4a')]+'%'};return _0x183298;})});}_0x4c0225=_['merge']({},_0x4c0225,_0x7e0f3c[_0x9133('0x4c')]);return _0x3bf109[_0x9133('0x5b')](_0x4c0225);}})['then'](function(_0x255bcd){if(_0x255bcd){_0x36aa57=_0x255bcd[_0x9133('0x53')];if(!_0x7e0f3c[_0x9133('0x3f')]['hasOwnProperty'](_0x9133('0x5a'))){_0x4c0225['limit']=qs[_0x9133('0x31')](_0x7e0f3c[_0x9133('0x3f')][_0x9133('0x31')]);_0x4c0225['offset']=qs[_0x9133('0x30')](_0x7e0f3c['query'][_0x9133('0x30')]);}return _0x3bf109[_0x9133('0x5b')](_0x4c0225);}})[_0x9133('0x21')](function(_0x3f11a7){if(_0x3f11a7){return _0x3f11a7?{'count':_0x36aa57,'rows':_0x3f11a7}:null;}})[_0x9133('0x21')](respondWithResult(_0x1ea18c,null))[_0x9133('0x2a')](handleError(_0x1ea18c,null));};exports[_0x9133('0x5c')]=function(_0x3b854d,_0x47edda,_0x6e98a2){var _0xa616b0={};var _0x1e507e={};var _0x29262f;var _0x12b9c0;return db['ServicenowConfiguration'][_0x9133('0x59')]({'where':{'id':_0x3b854d[_0x9133('0x51')]['id']}})[_0x9133('0x21')](handleEntityNotFound(_0x47edda,null))[_0x9133('0x21')](function(_0x5ad5db){if(_0x5ad5db){_0x29262f=_0x5ad5db;_0x1e507e[_0x9133('0x3e')]=_['keys'](db[_0x9133('0x5d')][_0x9133('0x3a')]);_0x1e507e[_0x9133('0x3f')]=_[_0x9133('0x40')](_0x3b854d['query']);_0x1e507e[_0x9133('0x41')]=_[_0x9133('0x42')](_0x1e507e[_0x9133('0x3e')],_0x1e507e[_0x9133('0x3f')]);_0xa616b0[_0x9133('0x43')]=_['intersection'](_0x1e507e['model'],qs['fields'](_0x3b854d['query'][_0x9133('0x44')]));_0xa616b0[_0x9133('0x43')]=_0xa616b0[_0x9133('0x43')]['length']?_0xa616b0[_0x9133('0x43')]:_0x1e507e[_0x9133('0x3e')];_0xa616b0[_0x9133('0x46')]=qs[_0x9133('0x47')](_0x3b854d[_0x9133('0x3f')]['sort']);_0xa616b0[_0x9133('0x48')]=qs['filters'](_[_0x9133('0x49')](_0x3b854d[_0x9133('0x3f')],_0x1e507e[_0x9133('0x41')]));if(_0x3b854d[_0x9133('0x3f')][_0x9133('0x4a')]){_0xa616b0['where']=_[_0x9133('0x4b')](_0xa616b0[_0x9133('0x48')],{'$or':_[_0x9133('0x39')](_0xa616b0['attributes'],function(_0x311728){var _0x4b5eb0={};_0x4b5eb0[_0x311728]={'$like':'%'+_0x3b854d[_0x9133('0x3f')][_0x9133('0x4a')]+'%'};return _0x4b5eb0;})});}_0xa616b0=_[_0x9133('0x4b')]({},_0xa616b0,_0x3b854d[_0x9133('0x4c')]);return _0x29262f[_0x9133('0x5c')](_0xa616b0);}})[_0x9133('0x21')](function(_0x4b7615){if(_0x4b7615){_0x12b9c0=_0x4b7615[_0x9133('0x53')];if(!_0x3b854d[_0x9133('0x3f')][_0x9133('0x45')](_0x9133('0x5a'))){_0xa616b0[_0x9133('0x31')]=qs[_0x9133('0x31')](_0x3b854d['query']['limit']);_0xa616b0[_0x9133('0x30')]=qs[_0x9133('0x30')](_0x3b854d['query'][_0x9133('0x30')]);}return _0x29262f['getDescriptions'](_0xa616b0);}})[_0x9133('0x21')](function(_0x4418a8){if(_0x4418a8){return _0x4418a8?{'count':_0x12b9c0,'rows':_0x4418a8}:null;}})['then'](respondWithResult(_0x47edda,null))[_0x9133('0x2a')](handleError(_0x47edda,null));};
\ No newline at end of file
index 4389476..66e34a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3a=['api','moment','bluebird','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','lodash','util','../../config/logger'];(function(_0x3922e9,_0x336370){var _0x112214=function(_0x20e651){while(--_0x20e651){_0x3922e9['push'](_0x3922e9['shift']());}};_0x112214(++_0x336370);}(_0xeb3a,0x17e));var _0xaeb3=function(_0x141ebf,_0x5eb269){_0x141ebf=_0x141ebf-0x0;var _0x2a000f=_0xeb3a[_0x141ebf];return _0x2a000f;};'use strict';var _=require(_0xaeb3('0x0'));var util=require(_0xaeb3('0x1'));var logger=require(_0xaeb3('0x2'))(_0xaeb3('0x3'));var moment=require(_0xaeb3('0x4'));var BPromise=require(_0xaeb3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaeb3('0x6'));var config=require(_0xaeb3('0x7'));var attributes=require(_0xaeb3('0x8'));module[_0xaeb3('0x9')]=function(_0x1546b7,_0x54f361){return _0x1546b7['define'](_0xaeb3('0xa'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b31=['int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x38a9cb,_0xfd8b2b){var _0xfa7687=function(_0x8b1b6){while(--_0x8b1b6){_0x38a9cb['push'](_0x38a9cb['shift']());}};_0xfa7687(++_0xfd8b2b);}(_0x9b31,0x1c4));var _0x19b3=function(_0x21342a,_0x4cf68f){_0x21342a=_0x21342a-0x0;var _0x22a117=_0x9b31[_0x21342a];return _0x22a117;};'use strict';var _=require(_0x19b3('0x0'));var util=require(_0x19b3('0x1'));var logger=require(_0x19b3('0x2'))('api');var moment=require(_0x19b3('0x3'));var BPromise=require(_0x19b3('0x4'));var rp=require(_0x19b3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19b3('0x6'));var config=require(_0x19b3('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x19b3('0x8')]=function(_0x5d379d,_0x2f7b2e){return _0x5d379d[_0x19b3('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0x19b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a7a73e..febc370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9712=['request','then','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x201e1f,_0x172558){var _0x3f08f0=function(_0x4b5e3d){while(--_0x4b5e3d){_0x201e1f['push'](_0x201e1f['shift']());}};_0x3f08f0(++_0x172558);}(_0x9712,0x9e));var _0x2971=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0x9712[_0x5e848d];return _0x3785e5;};'use strict';var _=require(_0x2971('0x0'));var util=require('util');var moment=require(_0x2971('0x1'));var BPromise=require(_0x2971('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2971('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2971('0x4'))(_0x2971('0x5'));var config=require(_0x2971('0x6'));var jayson=require(_0x2971('0x7'));var client=jayson[_0x2971('0x8')][_0x2971('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5beba7,_0x4aedd0,_0x52419f){return new BPromise(function(_0x3ed75d,_0x526482){return client[_0x2971('0xa')](_0x5beba7,_0x52419f)[_0x2971('0xb')](function(_0x9403a9){logger['info'](_0x2971('0xc'),_0x4aedd0,'request\x20sent');logger['debug'](_0x2971('0xd'),_0x4aedd0,_0x2971('0xe'),JSON[_0x2971('0xf')](_0x9403a9));if(_0x9403a9[_0x2971('0x10')]){if(_0x9403a9[_0x2971('0x10')][_0x2971('0x11')]===0x1f4){logger[_0x2971('0x10')](_0x2971('0xc'),_0x4aedd0,_0x9403a9[_0x2971('0x10')][_0x2971('0x12')]);return _0x526482(_0x9403a9[_0x2971('0x10')]['message']);}logger[_0x2971('0x10')](_0x2971('0xc'),_0x4aedd0,_0x9403a9[_0x2971('0x10')]['message']);return _0x3ed75d(_0x9403a9['error'][_0x2971('0x12')]);}else{logger[_0x2971('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4aedd0,_0x2971('0xe'));_0x3ed75d(_0x9403a9[_0x2971('0x14')][_0x2971('0x12')]);}})['catch'](function(_0x128eae){logger[_0x2971('0x10')](_0x2971('0xc'),_0x4aedd0,_0x128eae);_0x526482(_0x128eae);});});}
\ No newline at end of file
+var _0xc5fd=['debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x5c7812,_0x50d92d){var _0x2ed4a4=function(_0xf2cfe5){while(--_0xf2cfe5){_0x5c7812['push'](_0x5c7812['shift']());}};_0x2ed4a4(++_0x50d92d);}(_0xc5fd,0x160));var _0xdc5f=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0xc5fd[_0x301dab];return _0x2500a2;};'use strict';var _=require(_0xdc5f('0x0'));var util=require(_0xdc5f('0x1'));var moment=require(_0xdc5f('0x2'));var BPromise=require(_0xdc5f('0x3'));var rs=require(_0xdc5f('0x4'));var fs=require('fs');var Redis=require(_0xdc5f('0x5'));var db=require(_0xdc5f('0x6'))['db'];var utils=require(_0xdc5f('0x7'));var logger=require('../../config/logger')(_0xdc5f('0x8'));var config=require(_0xdc5f('0x9'));var jayson=require(_0xdc5f('0xa'));var client=jayson[_0xdc5f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d2649,_0x59854e,_0x5b5014){return new BPromise(function(_0x183cf4,_0xdeb8dd){return client[_0xdc5f('0xc')](_0x5d2649,_0x5b5014)[_0xdc5f('0xd')](function(_0x494aa){logger['info'](_0xdc5f('0xe'),_0x59854e,_0xdc5f('0xf'));logger[_0xdc5f('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x59854e,'request\x20sent',JSON[_0xdc5f('0x11')](_0x494aa));if(_0x494aa['error']){if(_0x494aa[_0xdc5f('0x12')][_0xdc5f('0x13')]===0x1f4){logger['error'](_0xdc5f('0xe'),_0x59854e,_0x494aa[_0xdc5f('0x12')][_0xdc5f('0x14')]);return _0xdeb8dd(_0x494aa[_0xdc5f('0x12')][_0xdc5f('0x14')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x59854e,_0x494aa[_0xdc5f('0x12')]['message']);return _0x183cf4(_0x494aa[_0xdc5f('0x12')]['message']);}else{logger[_0xdc5f('0x15')](_0xdc5f('0xe'),_0x59854e,_0xdc5f('0xf'));_0x183cf4(_0x494aa[_0xdc5f('0x16')][_0xdc5f('0x14')]);}})['catch'](function(_0x51a4a4){logger[_0xdc5f('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x59854e,_0x51a4a4);_0xdeb8dd(_0x51a4a4);});});}
\ No newline at end of file
index 026b30b..8629d27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ba=['isAuthenticated','/:id','show','post','put','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32ba,0x137));var _0xa32b=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0x32ba[_0x74745d];return _0x174ab3;};'use strict';var multer=require(_0xa32b('0x0'));var util=require(_0xa32b('0x1'));var path=require(_0xa32b('0x2'));var timeout=require('connect-timeout');var express=require(_0xa32b('0x3'));var router=express[_0xa32b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa32b('0x5'));var config=require(_0xa32b('0x6'));var controller=require(_0xa32b('0x7'));router[_0xa32b('0x8')]('/',auth[_0xa32b('0x9')](),controller['index']);router[_0xa32b('0x8')](_0xa32b('0xa'),auth[_0xa32b('0x9')](),controller[_0xa32b('0xb')]);router[_0xa32b('0xc')]('/',auth[_0xa32b('0x9')](),controller['create']);router[_0xa32b('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa32b('0xe')](_0xa32b('0xa'),auth[_0xa32b('0x9')](),controller['destroy']);module[_0xa32b('0xf')]=router;
\ No newline at end of file
+var _0x1d87=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x1d87,0x11c));var _0x71d8=function(_0x146a85,_0x529b52){_0x146a85=_0x146a85-0x0;var _0x1b59bf=_0x1d87[_0x146a85];return _0x1b59bf;};'use strict';var multer=require(_0x71d8('0x0'));var util=require(_0x71d8('0x1'));var path=require(_0x71d8('0x2'));var timeout=require(_0x71d8('0x3'));var express=require(_0x71d8('0x4'));var router=express[_0x71d8('0x5')]();var auth=require(_0x71d8('0x6'));var interaction=require(_0x71d8('0x7'));var config=require(_0x71d8('0x8'));var controller=require('./intServicenowField.controller');router[_0x71d8('0x9')]('/',auth[_0x71d8('0xa')](),controller[_0x71d8('0xb')]);router[_0x71d8('0x9')](_0x71d8('0xc'),auth[_0x71d8('0xa')](),controller[_0x71d8('0xd')]);router[_0x71d8('0xe')]('/',auth['isAuthenticated'](),controller[_0x71d8('0xf')]);router[_0x71d8('0x10')](_0x71d8('0xc'),auth['isAuthenticated'](),controller[_0x71d8('0x11')]);router['delete'](_0x71d8('0xc'),auth[_0x71d8('0xa')](),controller[_0x71d8('0x12')]);module[_0x71d8('0x13')]=router;
\ No newline at end of file
index 0ce521a..51d701f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac55=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x561bc7,_0x4b87e3){var _0x2986f0=function(_0x2563b7){while(--_0x2563b7){_0x561bc7['push'](_0x561bc7['shift']());}};_0x2986f0(++_0x4b87e3);}(_0xac55,0x1c8));var _0x5ac5=function(_0x43d9f0,_0x19434a){_0x43d9f0=_0x43d9f0-0x0;var _0x588e1c=_0xac55[_0x43d9f0];return _0x588e1c;};'use strict';var Sequelize=require(_0x5ac5('0x0'));module[_0x5ac5('0x1')]={'type':{'type':Sequelize[_0x5ac5('0x2')](_0x5ac5('0x3'),'variable',_0x5ac5('0x4'),_0x5ac5('0x5')),'defaultValue':_0x5ac5('0x3')},'content':{'type':Sequelize[_0x5ac5('0x6')]},'key':{'type':Sequelize[_0x5ac5('0x6')]},'keyType':{'type':Sequelize[_0x5ac5('0x2')](_0x5ac5('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x5ac5('0x6')]},'idField':{'type':Sequelize[_0x5ac5('0x6')]},'nameField':{'type':Sequelize[_0x5ac5('0x6')]},'customField':{'type':Sequelize[_0x5ac5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5ac5('0x6')]}};
\ No newline at end of file
+var _0x5fcd=['BOOLEAN','sequelize','exports','string','keyValue','STRING','ENUM'];(function(_0x915908,_0x333bc8){var _0x26a3ea=function(_0x4def06){while(--_0x4def06){_0x915908['push'](_0x915908['shift']());}};_0x26a3ea(++_0x333bc8);}(_0x5fcd,0x189));var _0xd5fc=function(_0x517a09,_0x38885c){_0x517a09=_0x517a09-0x0;var _0x3eed15=_0x5fcd[_0x517a09];return _0x3eed15;};'use strict';var Sequelize=require(_0xd5fc('0x0'));module[_0xd5fc('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd5fc('0x2'),'variable','customVariable',_0xd5fc('0x3')),'defaultValue':_0xd5fc('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd5fc('0x4')]},'keyType':{'type':Sequelize[_0xd5fc('0x5')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xd5fc('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd5fc('0x4')]},'customField':{'type':Sequelize[_0xd5fc('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd5fc('0x4')]}};
\ No newline at end of file
index bc1a6e9..b873a73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x532b5b,_0xce6ec8){var _0x169ff9=function(_0x4d2804){while(--_0x4d2804){_0x532b5b['push'](_0x532b5b['shift']());}};_0x169ff9(++_0xce6ec8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x4d8f3b,_0x56480c){var _0x5535d6=function(_0x21480e){while(--_0x21480e){_0x4d8f3b['push'](_0x4d8f3b['shift']());}};_0x5535d6(++_0x56480c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
index 5ac1637..fe6e85a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3397=['util','moment','bluebird','path','rimraf','../../config/environment','exports','define','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x2c1ac1,_0x3dfb07){var _0x240e2d=function(_0x5e6afd){while(--_0x5e6afd){_0x2c1ac1['push'](_0x2c1ac1['shift']());}};_0x240e2d(++_0x3dfb07);}(_0x3397,0x1a3));var _0x7339=function(_0x62b58e,_0x46fe1e){_0x62b58e=_0x62b58e-0x0;var _0x37fe84=_0x3397[_0x62b58e];return _0x37fe84;};'use strict';var _=require(_0x7339('0x0'));var util=require(_0x7339('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7339('0x2'));var BPromise=require(_0x7339('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7339('0x4'));var rimraf=require(_0x7339('0x5'));var config=require(_0x7339('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x7339('0x7')]=function(_0x25df02,_0x1e42c4){return _0x25df02[_0x7339('0x8')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x7339('0x9'),'fields':[_0x7339('0xa'),_0x7339('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf440=['../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','idField','FieldId','util','../../config/logger','api','bluebird','path'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xf440,0x11b));var _0x0f44=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf440[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x0f44('0x0'));var logger=require(_0x0f44('0x1'))(_0x0f44('0x2'));var moment=require('moment');var BPromise=require(_0x0f44('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f44('0x4'));var rimraf=require('rimraf');var config=require(_0x0f44('0x5'));var attributes=require(_0x0f44('0x6'));module[_0x0f44('0x7')]=function(_0x398723,_0x162152){return _0x398723[_0x0f44('0x8')]('ServicenowField',attributes,{'tableName':_0x0f44('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x0f44('0xa'),_0x0f44('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5fac280..f6e051e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ac=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc4ac,0xdf));var _0xcc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcc4a('0x0'));var util=require(_0xcc4a('0x1'));var moment=require(_0xcc4a('0x2'));var BPromise=require(_0xcc4a('0x3'));var rs=require(_0xcc4a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc4a('0x5'));var logger=require(_0xcc4a('0x6'))(_0xcc4a('0x7'));var config=require(_0xcc4a('0x8'));var jayson=require(_0xcc4a('0x9'));var client=jayson['client'][_0xcc4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a20f7,_0x4999c6,_0x5297fe){return new BPromise(function(_0x226707,_0x242e6e){return client[_0xcc4a('0xb')](_0x5a20f7,_0x5297fe)['then'](function(_0x5354b8){logger['info'](_0xcc4a('0xc'),_0x4999c6,_0xcc4a('0xd'));logger['debug'](_0xcc4a('0xe'),_0x4999c6,_0xcc4a('0xd'),JSON[_0xcc4a('0xf')](_0x5354b8));if(_0x5354b8['error']){if(_0x5354b8[_0xcc4a('0x10')][_0xcc4a('0x11')]===0x1f4){logger['error'](_0xcc4a('0xc'),_0x4999c6,_0x5354b8['error'][_0xcc4a('0x12')]);return _0x242e6e(_0x5354b8[_0xcc4a('0x10')]['message']);}logger[_0xcc4a('0x10')](_0xcc4a('0xc'),_0x4999c6,_0x5354b8[_0xcc4a('0x10')][_0xcc4a('0x12')]);return _0x226707(_0x5354b8[_0xcc4a('0x10')]['message']);}else{logger[_0xcc4a('0x13')]('ServicenowField,\x20%s,\x20%s',_0x4999c6,'request\x20sent');_0x226707(_0x5354b8[_0xcc4a('0x14')]['message']);}})[_0xcc4a('0x15')](function(_0x13ad24){logger['error']('ServicenowField,\x20%s,\x20%s',_0x4999c6,_0x13ad24);_0x242e6e(_0x13ad24);});});}
\ No newline at end of file
+var _0x88c0=['then','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x589dd5,_0xbfebb7){var _0x978d4a=function(_0x1f1428){while(--_0x1f1428){_0x589dd5['push'](_0x589dd5['shift']());}};_0x978d4a(++_0xbfebb7);}(_0x88c0,0xd0));var _0x088c=function(_0x22947d,_0x2177ca){_0x22947d=_0x22947d-0x0;var _0x489b7b=_0x88c0[_0x22947d];return _0x489b7b;};'use strict';var _=require(_0x088c('0x0'));var util=require(_0x088c('0x1'));var moment=require(_0x088c('0x2'));var BPromise=require(_0x088c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x088c('0x4'));var db=require(_0x088c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x088c('0x6'))(_0x088c('0x7'));var config=require(_0x088c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x088c('0x9')][_0x088c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14a452,_0x1cda65,_0x51f2da){return new BPromise(function(_0x4462c2,_0x5d069c){return client[_0x088c('0xb')](_0x14a452,_0x51f2da)[_0x088c('0xc')](function(_0x29c36a){logger['info']('ServicenowField,\x20%s,\x20%s',_0x1cda65,'request\x20sent');logger['debug'](_0x088c('0xd'),_0x1cda65,_0x088c('0xe'),JSON['stringify'](_0x29c36a));if(_0x29c36a[_0x088c('0xf')]){if(_0x29c36a[_0x088c('0xf')][_0x088c('0x10')]===0x1f4){logger[_0x088c('0xf')]('ServicenowField,\x20%s,\x20%s',_0x1cda65,_0x29c36a['error'][_0x088c('0x11')]);return _0x5d069c(_0x29c36a['error']['message']);}logger[_0x088c('0xf')](_0x088c('0x12'),_0x1cda65,_0x29c36a[_0x088c('0xf')][_0x088c('0x11')]);return _0x4462c2(_0x29c36a[_0x088c('0xf')][_0x088c('0x11')]);}else{logger['info'](_0x088c('0x12'),_0x1cda65,_0x088c('0xe'));_0x4462c2(_0x29c36a['result'][_0x088c('0x11')]);}})[_0x088c('0x13')](function(_0x144d01){logger[_0x088c('0xf')](_0x088c('0x12'),_0x1cda65,_0x144d01);_0x5d069c(_0x144d01);});});}
\ No newline at end of file
index 932635c..ede095b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78d3=['./intSugarcrmAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x3b2397,_0x4d52e8){var _0x4a81ea=function(_0xf92c9e){while(--_0xf92c9e){_0x3b2397['push'](_0x3b2397['shift']());}};_0x4a81ea(++_0x4d52e8);}(_0x78d3,0xca));var _0x378d=function(_0x4842bc,_0x5034a0){_0x4842bc=_0x4842bc-0x0;var _0x3624d7=_0x78d3[_0x4842bc];return _0x3624d7;};'use strict';var multer=require(_0x378d('0x0'));var util=require(_0x378d('0x1'));var path=require(_0x378d('0x2'));var timeout=require(_0x378d('0x3'));var express=require(_0x378d('0x4'));var router=express[_0x378d('0x5')]();var auth=require(_0x378d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x378d('0x7'));var controller=require(_0x378d('0x8'));router[_0x378d('0x9')]('/',auth['isAuthenticated'](),controller[_0x378d('0xa')]);router[_0x378d('0x9')](_0x378d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x378d('0x9')](_0x378d('0xc'),auth[_0x378d('0xd')](),controller[_0x378d('0xe')]);router[_0x378d('0x9')](_0x378d('0xf'),auth[_0x378d('0xd')](),controller[_0x378d('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x378d('0xc'),auth[_0x378d('0xd')](),controller[_0x378d('0x11')]);router[_0x378d('0x12')](_0x378d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x378d('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x378d('0x14')]=router;
\ No newline at end of file
+var _0x7811=['isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get'];(function(_0x29d74f,_0x524926){var _0x49e8f2=function(_0x3a9abd){while(--_0x3a9abd){_0x29d74f['push'](_0x29d74f['shift']());}};_0x49e8f2(++_0x524926);}(_0x7811,0x15f));var _0x1781=function(_0x16fdeb,_0x46d28e){_0x16fdeb=_0x16fdeb-0x0;var _0x1ea06f=_0x7811[_0x16fdeb];return _0x1ea06f;};'use strict';var multer=require(_0x1781('0x0'));var util=require('util');var path=require(_0x1781('0x1'));var timeout=require(_0x1781('0x2'));var express=require(_0x1781('0x3'));var router=express[_0x1781('0x4')]();var auth=require(_0x1781('0x5'));var interaction=require(_0x1781('0x6'));var config=require(_0x1781('0x7'));var controller=require(_0x1781('0x8'));router[_0x1781('0x9')]('/',auth[_0x1781('0xa')](),controller['index']);router['get'](_0x1781('0xb'),auth[_0x1781('0xa')](),controller[_0x1781('0xc')]);router['get'](_0x1781('0xd'),auth[_0x1781('0xa')](),controller[_0x1781('0xe')]);router[_0x1781('0x9')](_0x1781('0xf'),auth[_0x1781('0xa')](),controller['getFields']);router[_0x1781('0x10')]('/',auth[_0x1781('0xa')](),controller['create']);router[_0x1781('0x10')](_0x1781('0xd'),auth['isAuthenticated'](),controller[_0x1781('0x11')]);router['put'](_0x1781('0xb'),auth[_0x1781('0xa')](),controller['update']);router[_0x1781('0x12')](_0x1781('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index db6be8e..2d2f5c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ba8=['STRING','username','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1ba8,0x10d));var _0x81ba=function(_0x4bf92f,_0x45d987){_0x4bf92f=_0x4bf92f-0x0;var _0x57ebf4=_0x1ba8[_0x4bf92f];return _0x57ebf4;};'use strict';var Sequelize=require(_0x81ba('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x81ba('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x81ba('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x81ba('0x1')]}};
\ No newline at end of file
+var _0x8d93=['exports','STRING','remoteUri'];(function(_0x403916,_0x374658){var _0x5baf40=function(_0x2b5d0b){while(--_0x2b5d0b){_0x403916['push'](_0x403916['shift']());}};_0x5baf40(++_0x374658);}(_0x8d93,0x96));var _0x38d9=function(_0x266098,_0x10fbbb){_0x266098=_0x266098-0x0;var _0x492415=_0x8d93[_0x266098];return _0x492415;};'use strict';var Sequelize=require('sequelize');module[_0x38d9('0x0')]={'name':{'type':Sequelize[_0x38d9('0x1')]},'description':{'type':Sequelize[_0x38d9('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x38d9('0x1')]},'remoteUri':{'type':Sequelize[_0x38d9('0x1')],'unique':_0x38d9('0x2')},'serverUrl':{'type':Sequelize[_0x38d9('0x1')]}};
\ No newline at end of file
index b12f637..867e822 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b4a=['result','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','SugarcrmAccount','count','includeAll','include','rows','show','params','options','find','catch','create','body','getConfigurations','SugarcrmConfiguration','order','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','direction','username','password','remoteUri','substring','lastIndexOf','POST','%s%s','login','JSON','Invalid\x20Login','format','get_module_fields','Calls','values','module_fields','remove','endsWith','value','send','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x58ca0a,_0x44d274){var _0x1280eb=function(_0x62c74c){while(--_0x62c74c){_0x58ca0a['push'](_0x58ca0a['shift']());}};_0x1280eb(++_0x44d274);}(_0x9b4a,0x1d0));var _0xa9b4=function(_0x201387,_0x1a879e){_0x201387=_0x201387-0x0;var _0x41c1d4=_0x9b4a[_0x201387];return _0x41c1d4;};'use strict';var pdf=require(_0xa9b4('0x0'));var emlformat=require(_0xa9b4('0x1'));var rimraf=require(_0xa9b4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9b4('0x3'));var rp=require(_0xa9b4('0x4'));var moment=require(_0xa9b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa9b4('0x6'));var util=require('util');var path=require(_0xa9b4('0x7'));var sox=require('sox');var csv=require(_0xa9b4('0x8'));var ejs=require(_0xa9b4('0x9'));var fs=require('fs');var _=require(_0xa9b4('0xa'));var squel=require('squel');var crypto=require(_0xa9b4('0xb'));var jsforce=require(_0xa9b4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa9b4('0x8'));var querystring=require(_0xa9b4('0xd'));var Papa=require('papaparse');var Redis=require(_0xa9b4('0xe'));var authService=require(_0xa9b4('0xf'));var qs=require(_0xa9b4('0x10'));var as=require(_0xa9b4('0x11'));var hardwareService=require(_0xa9b4('0x12'));var logger=require('../../config/logger')(_0xa9b4('0x13'));var utils=require(_0xa9b4('0x14'));var config=require(_0xa9b4('0x15'));var db=require(_0xa9b4('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa9b4('0x17'));var client=jayson[_0xa9b4('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x3f3eb2,_0xab3b3f,_0x4900ae){if(_0x4900ae){var _0x4dbc3a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4dbc3a[_0xa9b4('0x19')](_0xab3b3f)){return _0x3f3eb2;}else{throw new db['Sequelize']['ValidationError'](_0xa9b4('0x1a'));}}else{return _0x3f3eb2;}}function respondWithRpcPromise(_0x2b6d7a,_0x49f030,_0x59dc80,_0x25af61){return new BPromise(function(_0x38967e,_0x36d3cb){var _0x43d16f=_0x25af61||client;return _0x43d16f[_0xa9b4('0x1b')](_0x2b6d7a,_0x59dc80)['then'](function(_0x5ab15d){logger[_0xa9b4('0x1c')]('SugarcrmAccount,\x20%s,\x20%s',_0x49f030,_0xa9b4('0x1d'));logger['debug'](_0xa9b4('0x1e'),_0x49f030,_0xa9b4('0x1d'),JSON[_0xa9b4('0x1f')](_0x5ab15d));if(_0x5ab15d[_0xa9b4('0x20')]){if(_0x5ab15d[_0xa9b4('0x20')][_0xa9b4('0x21')]===0x1f4){logger[_0xa9b4('0x20')]('SugarcrmAccount,\x20%s,\x20%s',_0x49f030,_0x5ab15d[_0xa9b4('0x20')][_0xa9b4('0x22')]);return _0x36d3cb(_0x5ab15d[_0xa9b4('0x20')][_0xa9b4('0x22')]);}logger[_0xa9b4('0x20')]('SugarcrmAccount,\x20%s,\x20%s',_0x49f030,_0x5ab15d[_0xa9b4('0x20')][_0xa9b4('0x22')]);return _0x38967e(_0x5ab15d['error'][_0xa9b4('0x22')]);}else{logger['info'](_0xa9b4('0x23'),_0x49f030,_0xa9b4('0x1d'));_0x38967e(_0x5ab15d[_0xa9b4('0x24')][_0xa9b4('0x22')]);}})['catch'](function(_0x594b76){logger[_0xa9b4('0x20')](_0xa9b4('0x23'),_0x49f030,_0x594b76);_0x36d3cb(_0x594b76);});});}function respondWithStatusCode(_0x48f950,_0x375548){_0x375548=_0x375548||0xcc;return function(_0xa74b79){if(_0xa74b79){return _0x48f950[_0xa9b4('0x25')](_0x375548);}return _0x48f950['status'](_0x375548)[_0xa9b4('0x26')]();};}function respondWithResult(_0x35ba81,_0x112dc4){_0x112dc4=_0x112dc4||0xc8;return function(_0x37daf5){if(_0x37daf5){return _0x35ba81['status'](_0x112dc4)[_0xa9b4('0x27')](_0x37daf5);}};}function respondWithFilteredResult(_0x4f7a96,_0x2f3d6e){return function(_0x1eea9e){if(_0x1eea9e){var _0x305b82=_0x1eea9e['count'],_0x500c7f=_0x2f3d6e[_0xa9b4('0x28')],_0x3e0b4b=_0x2f3d6e[_0xa9b4('0x28')]+_0x2f3d6e[_0xa9b4('0x29')],_0x4bf5f2;if(_0x3e0b4b>=_0x305b82){_0x3e0b4b=_0x305b82;_0x4bf5f2=0xc8;}else{_0x4bf5f2=0xce;}_0x4f7a96[_0xa9b4('0x2a')](_0x4bf5f2);return _0x4f7a96[_0xa9b4('0x2b')](_0xa9b4('0x2c'),_0x500c7f+'-'+_0x3e0b4b+'/'+_0x305b82)['json'](_0x1eea9e);}return null;};}function patchUpdates(_0x5afd72){return function(_0x17cb85){try{jsonpatch[_0xa9b4('0x2d')](_0x17cb85,_0x5afd72,!![]);}catch(_0x3f0b53){return BPromise[_0xa9b4('0x2e')](_0x3f0b53);}return _0x17cb85[_0xa9b4('0x2f')]();};}function saveUpdates(_0x2f1d9f,_0x5b6064){return function(_0xa9c5d5){if(_0xa9c5d5){return _0xa9c5d5[_0xa9b4('0x30')](_0x2f1d9f)[_0xa9b4('0x31')](function(_0x2a1d1d){return _0x2a1d1d;});}return null;};}function removeEntity(_0x46189c,_0x4e6eab){return function(_0x4414b5){if(_0x4414b5){return _0x4414b5[_0xa9b4('0x32')]()[_0xa9b4('0x31')](function(){_0x46189c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28f10f,_0x6fa8ae){return function(_0xfa65c1){if(!_0xfa65c1){_0x28f10f[_0xa9b4('0x25')](0x194);}return _0xfa65c1;};}function handleError(_0x2822f3,_0x1fc030){_0x1fc030=_0x1fc030||0x1f4;return function(_0x8d842e){logger['error'](_0x8d842e['stack']);if(_0x8d842e['name']){delete _0x8d842e[_0xa9b4('0x33')];}_0x2822f3[_0xa9b4('0x2a')](_0x1fc030)['send'](_0x8d842e);};}exports[_0xa9b4('0x34')]=function(_0x4c2ba5,_0x4f499d){var _0x4a4032={},_0x4a0ece={},_0x3961e8={'count':0x0,'rows':[]};var _0x4ee9e6=_[_0xa9b4('0x35')](db['SugarcrmAccount'][_0xa9b4('0x36')],function(_0x3345f0){return{'name':_0x3345f0[_0xa9b4('0x37')],'type':_0x3345f0[_0xa9b4('0x38')][_0xa9b4('0x39')]};});_0x4a0ece[_0xa9b4('0x3a')]=_[_0xa9b4('0x35')](_0x4ee9e6,_0xa9b4('0x33'));_0x4a0ece[_0xa9b4('0x3b')]=_[_0xa9b4('0x3c')](_0x4c2ba5[_0xa9b4('0x3b')]);_0x4a0ece[_0xa9b4('0x3d')]=_[_0xa9b4('0x3e')](_0x4a0ece['model'],_0x4a0ece[_0xa9b4('0x3b')]);_0x4a4032[_0xa9b4('0x3f')]=_['intersection'](_0x4a0ece['model'],qs[_0xa9b4('0x40')](_0x4c2ba5[_0xa9b4('0x3b')]['fields']));_0x4a4032[_0xa9b4('0x3f')]=_0x4a4032[_0xa9b4('0x3f')][_0xa9b4('0x41')]?_0x4a4032['attributes']:_0x4a0ece['model'];if(!_0x4c2ba5[_0xa9b4('0x3b')][_0xa9b4('0x42')](_0xa9b4('0x43'))){_0x4a4032[_0xa9b4('0x29')]=qs[_0xa9b4('0x29')](_0x4c2ba5[_0xa9b4('0x3b')][_0xa9b4('0x29')]);_0x4a4032['offset']=qs[_0xa9b4('0x28')](_0x4c2ba5[_0xa9b4('0x3b')][_0xa9b4('0x28')]);}_0x4a4032['order']=qs[_0xa9b4('0x44')](_0x4c2ba5['query'][_0xa9b4('0x44')]);_0x4a4032[_0xa9b4('0x45')]=qs[_0xa9b4('0x3d')](_[_0xa9b4('0x46')](_0x4c2ba5[_0xa9b4('0x3b')],_0x4a0ece[_0xa9b4('0x3d')]),_0x4ee9e6);if(_0x4c2ba5['query']['filter']){_0x4a4032[_0xa9b4('0x45')]=_[_0xa9b4('0x47')](_0x4a4032[_0xa9b4('0x45')],{'$or':_[_0xa9b4('0x35')](_0x4ee9e6,function(_0x363264){if(_0x363264['type']!==_0xa9b4('0x48')){var _0x58e226={};_0x58e226[_0x363264[_0xa9b4('0x33')]]={'$like':'%'+_0x4c2ba5[_0xa9b4('0x3b')][_0xa9b4('0x49')]+'%'};return _0x58e226;}})});}_0x4a4032=_[_0xa9b4('0x47')]({},_0x4a4032,_0x4c2ba5['options']);var _0x50dd1b={'where':_0x4a4032[_0xa9b4('0x45')]};return db[_0xa9b4('0x4a')][_0xa9b4('0x4b')](_0x50dd1b)['then'](function(_0x1b1585){_0x3961e8[_0xa9b4('0x4b')]=_0x1b1585;if(_0x4c2ba5['query'][_0xa9b4('0x4c')]){_0x4a4032[_0xa9b4('0x4d')]=[{'all':!![]}];}return db[_0xa9b4('0x4a')]['findAll'](_0x4a4032);})[_0xa9b4('0x31')](function(_0x12ac14){_0x3961e8[_0xa9b4('0x4e')]=_0x12ac14;return _0x3961e8;})[_0xa9b4('0x31')](respondWithFilteredResult(_0x4f499d,_0x4a4032))['catch'](handleError(_0x4f499d,null));};exports[_0xa9b4('0x4f')]=function(_0x915d64,_0x4b082f){var _0x6ab664={'raw':![],'where':{'id':_0x915d64[_0xa9b4('0x50')]['id']}},_0x2be293={};_0x2be293[_0xa9b4('0x3a')]=_['keys'](db[_0xa9b4('0x4a')][_0xa9b4('0x36')]);_0x2be293['query']=_['keys'](_0x915d64['query']);_0x2be293[_0xa9b4('0x3d')]=_[_0xa9b4('0x3e')](_0x2be293[_0xa9b4('0x3a')],_0x2be293[_0xa9b4('0x3b')]);_0x6ab664[_0xa9b4('0x3f')]=_['intersection'](_0x2be293['model'],qs['fields'](_0x915d64[_0xa9b4('0x3b')][_0xa9b4('0x40')]));_0x6ab664['attributes']=_0x6ab664[_0xa9b4('0x3f')][_0xa9b4('0x41')]?_0x6ab664[_0xa9b4('0x3f')]:_0x2be293[_0xa9b4('0x3a')];if(_0x915d64[_0xa9b4('0x3b')][_0xa9b4('0x4c')]){_0x6ab664[_0xa9b4('0x4d')]=[{'all':!![]}];}_0x6ab664=_[_0xa9b4('0x47')]({},_0x6ab664,_0x915d64[_0xa9b4('0x51')]);return db[_0xa9b4('0x4a')][_0xa9b4('0x52')](_0x6ab664)[_0xa9b4('0x31')](handleEntityNotFound(_0x4b082f,null))[_0xa9b4('0x31')](respondWithResult(_0x4b082f,null))[_0xa9b4('0x53')](handleError(_0x4b082f,null));};exports[_0xa9b4('0x54')]=function(_0xc13934,_0x25fa2e){return db['SugarcrmAccount']['create'](_0xc13934['body'],{})[_0xa9b4('0x31')](respondWithResult(_0x25fa2e,0xc9))[_0xa9b4('0x53')](handleError(_0x25fa2e,null));};exports[_0xa9b4('0x30')]=function(_0x1e7248,_0x26f233){if(_0x1e7248[_0xa9b4('0x55')]['id']){delete _0x1e7248[_0xa9b4('0x55')]['id'];}return db[_0xa9b4('0x4a')][_0xa9b4('0x52')]({'where':{'id':_0x1e7248[_0xa9b4('0x50')]['id']}})[_0xa9b4('0x31')](handleEntityNotFound(_0x26f233,null))[_0xa9b4('0x31')](saveUpdates(_0x1e7248[_0xa9b4('0x55')],null))[_0xa9b4('0x31')](respondWithResult(_0x26f233,null))[_0xa9b4('0x53')](handleError(_0x26f233,null));};exports[_0xa9b4('0x32')]=function(_0x2307d4,_0x3adecc){return db[_0xa9b4('0x4a')][_0xa9b4('0x52')]({'where':{'id':_0x2307d4[_0xa9b4('0x50')]['id']}})[_0xa9b4('0x31')](handleEntityNotFound(_0x3adecc,null))[_0xa9b4('0x31')](removeEntity(_0x3adecc,null))[_0xa9b4('0x53')](handleError(_0x3adecc,null));};exports[_0xa9b4('0x56')]=function(_0x2fe02d,_0x2058d0,_0x3c0cc2){var _0x88f3ea={};var _0x5b6eb4={};var _0x1af522;var _0x5bf5e2;return db[_0xa9b4('0x4a')]['findOne']({'where':{'id':_0x2fe02d['params']['id']}})[_0xa9b4('0x31')](handleEntityNotFound(_0x2058d0,null))[_0xa9b4('0x31')](function(_0x477d5e){if(_0x477d5e){_0x1af522=_0x477d5e;_0x5b6eb4['model']=_['keys'](db[_0xa9b4('0x57')]['rawAttributes']);_0x5b6eb4['query']=_[_0xa9b4('0x3c')](_0x2fe02d[_0xa9b4('0x3b')]);_0x5b6eb4[_0xa9b4('0x3d')]=_[_0xa9b4('0x3e')](_0x5b6eb4[_0xa9b4('0x3a')],_0x5b6eb4['query']);_0x88f3ea['attributes']=_[_0xa9b4('0x3e')](_0x5b6eb4['model'],qs[_0xa9b4('0x40')](_0x2fe02d[_0xa9b4('0x3b')][_0xa9b4('0x40')]));_0x88f3ea['attributes']=_0x88f3ea[_0xa9b4('0x3f')][_0xa9b4('0x41')]?_0x88f3ea[_0xa9b4('0x3f')]:_0x5b6eb4[_0xa9b4('0x3a')];_0x88f3ea[_0xa9b4('0x58')]=qs[_0xa9b4('0x44')](_0x2fe02d[_0xa9b4('0x3b')][_0xa9b4('0x44')]);_0x88f3ea[_0xa9b4('0x45')]=qs[_0xa9b4('0x3d')](_[_0xa9b4('0x46')](_0x2fe02d[_0xa9b4('0x3b')],_0x5b6eb4[_0xa9b4('0x3d')]));if(_0x2fe02d[_0xa9b4('0x3b')][_0xa9b4('0x49')]){_0x88f3ea[_0xa9b4('0x45')]=_['merge'](_0x88f3ea[_0xa9b4('0x45')],{'$or':_[_0xa9b4('0x35')](_0x88f3ea[_0xa9b4('0x3f')],function(_0x48a046){var _0x4d981d={};_0x4d981d[_0x48a046]={'$like':'%'+_0x2fe02d['query'][_0xa9b4('0x49')]+'%'};return _0x4d981d;})});}_0x88f3ea=_[_0xa9b4('0x47')]({},_0x88f3ea,_0x2fe02d[_0xa9b4('0x51')]);return _0x1af522['getConfigurations'](_0x88f3ea);}})['then'](function(_0x297826){if(_0x297826){_0x5bf5e2=_0x297826['length'];if(!_0x2fe02d[_0xa9b4('0x3b')]['hasOwnProperty'](_0xa9b4('0x43'))){_0x88f3ea[_0xa9b4('0x29')]=qs[_0xa9b4('0x29')](_0x2fe02d[_0xa9b4('0x3b')][_0xa9b4('0x29')]);_0x88f3ea[_0xa9b4('0x28')]=qs[_0xa9b4('0x28')](_0x2fe02d[_0xa9b4('0x3b')]['offset']);}return _0x1af522['getConfigurations'](_0x88f3ea);}})[_0xa9b4('0x31')](function(_0x60a1e){if(_0x60a1e){return _0x60a1e?{'count':_0x5bf5e2,'rows':_0x60a1e}:null;}})[_0xa9b4('0x31')](respondWithResult(_0x2058d0,null))[_0xa9b4('0x53')](handleError(_0x2058d0,null));};exports[_0xa9b4('0x59')]=function(_0x4a4a6c,_0x4648f6,_0x100723){if(_0x4a4a6c[_0xa9b4('0x55')]['id']){delete _0x4a4a6c['body']['id'];}return db['SugarcrmAccount'][_0xa9b4('0x5a')]({'where':{'id':_0x4a4a6c[_0xa9b4('0x50')]['id']}})[_0xa9b4('0x31')](handleEntityNotFound(_0x4648f6,null))[_0xa9b4('0x31')](function(_0x5e4f85){if(_0x5e4f85){_0x4a4a6c['body'][_0xa9b4('0x5b')]=_0x5e4f85['id'];_0x4a4a6c[_0xa9b4('0x55')][_0xa9b4('0x5c')]=integrations['getSubjects'](_0x4a4a6c[_0xa9b4('0x55')][_0xa9b4('0x5d')],_0x4a4a6c[_0xa9b4('0x55')][_0xa9b4('0x38')]);_0x4a4a6c[_0xa9b4('0x55')][_0xa9b4('0x5e')]=integrations[_0xa9b4('0x5f')](_0x4a4a6c[_0xa9b4('0x55')]['channel'],_0x4a4a6c[_0xa9b4('0x55')]['type']);return db[_0xa9b4('0x57')][_0xa9b4('0x54')](_0x4a4a6c['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xa9b4('0x5c')},{'model':db[_0xa9b4('0x60')],'as':_0xa9b4('0x5e')}]});}return null;})[_0xa9b4('0x31')](respondWithResult(_0x4648f6,null))[_0xa9b4('0x53')](handleError(_0x4648f6,null));};exports['getFields']=function(_0x5b29f4,_0x550915,_0x54af28){var _0x1c68a5='';var _0x4beb59=['id',_0xa9b4('0x33'),_0xa9b4('0x61'),_0xa9b4('0x62'),_0xa9b4('0x63'),_0xa9b4('0x64'),_0xa9b4('0x65'),_0xa9b4('0x66'),_0xa9b4('0x67'),'parent_type','parent_name',_0xa9b4('0x68')];return db['SugarcrmAccount'][_0xa9b4('0x5a')]({'where':{'id':_0x5b29f4['params']['id']},'attributes':['id',_0xa9b4('0x69'),_0xa9b4('0x6a'),_0xa9b4('0x6b')]})[_0xa9b4('0x31')](handleEntityNotFound(_0x550915,null))['then'](function(_0x359203){if(_0x359203){_0x1c68a5=_0x359203['remoteUri'];var _0x124b60=_0x1c68a5['slice'](-0x1);if(_0x124b60==='/'){_0x1c68a5=_0x1c68a5[_0xa9b4('0x6c')](0x0,_0x1c68a5[_0xa9b4('0x6d')](_0x124b60));}return rp({'method':_0xa9b4('0x6e'),'uri':util['format'](_0xa9b4('0x6f'),_0x1c68a5,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa9b4('0x70'),'input_type':_0xa9b4('0x71'),'response_type':'JSON','rest_data':JSON[_0xa9b4('0x1f')]({'user_auth':{'user_name':_0x359203[_0xa9b4('0x69')],'password':_0x359203[_0xa9b4('0x6a')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xa9b4('0x31')](function(_0x59c67c){if(_0x59c67c&&_0x59c67c[_0xa9b4('0x33')]!==_0xa9b4('0x72')&&_0x59c67c[_0xa9b4('0x33')]!=='Password\x20Expired'){return rp({'method':_0xa9b4('0x6e'),'uri':util[_0xa9b4('0x73')](_0xa9b4('0x6f'),_0x1c68a5,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa9b4('0x74'),'input_type':_0xa9b4('0x71'),'response_type':'JSON','rest_data':JSON[_0xa9b4('0x1f')]({'session':_0x59c67c['id'],'module_name':_0xa9b4('0x75')})}})[_0xa9b4('0x31')](function(_0x30a03e){if(_0x30a03e){var _0x2cd5b6=_[_0xa9b4('0x76')](_0x30a03e[_0xa9b4('0x77')]);_[_0xa9b4('0x78')](_0x2cd5b6,function(_0x3875e4){return _0x4beb59['includes'](_0x3875e4['name']);});return{'count':_0x2cd5b6['length'],'rows':_[_0xa9b4('0x35')](_0x2cd5b6,function(_0x67f040){return{'id':_0x67f040[_0xa9b4('0x33')],'name':_0x67f040['label'],'custom':_[_0xa9b4('0x79')](_0x67f040[_0xa9b4('0x33')],'_c')?!![]:![],'options':_0x67f040[_0xa9b4('0x51')]?_['map'](_[_0xa9b4('0x76')](_0x67f040[_0xa9b4('0x51')]),function(_0x26db38){return{'name':_0x26db38[_0xa9b4('0x7a')],'value':_0x26db38[_0xa9b4('0x33')]};}):[]};})};}})[_0xa9b4('0x31')](respondWithResult(_0x550915,null))[_0xa9b4('0x53')](function(_0x24eb00){var _0x4149ed=_0x5b29f4[_0xa9b4('0x3b')][_0xa9b4('0x19')]?0x1f4:_0x24eb00['statusCode']||0x1f4;logger[_0xa9b4('0x20')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4149ed,JSON[_0xa9b4('0x1f')](_0x24eb00));delete _0x24eb00[_0xa9b4('0x33')];if(_0x4149ed===0x191){_0x4149ed=0x190;}_0x550915[_0xa9b4('0x2a')](_0x4149ed)[_0xa9b4('0x7b')](_0x5b29f4['query'][_0xa9b4('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x24eb00[_0xa9b4('0x7c')]}:_0x24eb00);});}else{var _0x39756c=0x1f4;_0x550915[_0xa9b4('0x2a')](_0x39756c)[_0xa9b4('0x7b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x26d6=['username','password','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','destroy','stack','name','index','map','SugarcrmAccount','rawAttributes','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','fields','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction'];(function(_0x481e9c,_0x500606){var _0x2c4ff0=function(_0x6cbed9){while(--_0x6cbed9){_0x481e9c['push'](_0x481e9c['shift']());}};_0x2c4ff0(++_0x500606);}(_0x26d6,0x1ac));var _0x626d=function(_0x5c609f,_0x121078){_0x5c609f=_0x5c609f-0x0;var _0x3e934d=_0x26d6[_0x5c609f];return _0x3e934d;};'use strict';var pdf=require(_0x626d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x626d('0x1'));var zipdir=require(_0x626d('0x2'));var jsonpatch=require(_0x626d('0x3'));var rp=require(_0x626d('0x4'));var moment=require('moment');var BPromise=require(_0x626d('0x5'));var Mustache=require(_0x626d('0x6'));var util=require(_0x626d('0x7'));var path=require(_0x626d('0x8'));var sox=require(_0x626d('0x9'));var csv=require('to-csv');var ejs=require(_0x626d('0xa'));var fs=require('fs');var _=require(_0x626d('0xb'));var squel=require(_0x626d('0xc'));var crypto=require(_0x626d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x626d('0xe'));var toCsv=require(_0x626d('0xf'));var querystring=require(_0x626d('0x10'));var Papa=require(_0x626d('0x11'));var Redis=require(_0x626d('0x12'));var authService=require(_0x626d('0x13'));var qs=require(_0x626d('0x14'));var as=require(_0x626d('0x15'));var hardwareService=require(_0x626d('0x16'));var logger=require(_0x626d('0x17'))(_0x626d('0x18'));var utils=require(_0x626d('0x19'));var config=require('../../config/environment');var db=require(_0x626d('0x1a'))['db'];var integrations=require(_0x626d('0x1b'));var jayson=require(_0x626d('0x1c'));var client=jayson[_0x626d('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x177a8d,_0x1eeff0,_0x45626a){if(_0x45626a){var _0x371681=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x371681[_0x626d('0x1e')](_0x1eeff0)){return _0x177a8d;}else{throw new db[(_0x626d('0x1f'))][(_0x626d('0x20'))](_0x626d('0x21'));}}else{return _0x177a8d;}}function respondWithRpcPromise(_0x5a099b,_0x2ab5db,_0x299c62,_0x2fcacb){return new BPromise(function(_0x161794,_0x222e03){var _0x3ea5cb=_0x2fcacb||client;return _0x3ea5cb[_0x626d('0x22')](_0x5a099b,_0x299c62)[_0x626d('0x23')](function(_0x492c09){logger[_0x626d('0x24')](_0x626d('0x25'),_0x2ab5db,_0x626d('0x26'));logger[_0x626d('0x27')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x2ab5db,_0x626d('0x26'),JSON['stringify'](_0x492c09));if(_0x492c09[_0x626d('0x28')]){if(_0x492c09[_0x626d('0x28')][_0x626d('0x29')]===0x1f4){logger[_0x626d('0x28')](_0x626d('0x25'),_0x2ab5db,_0x492c09[_0x626d('0x28')][_0x626d('0x2a')]);return _0x222e03(_0x492c09[_0x626d('0x28')][_0x626d('0x2a')]);}logger[_0x626d('0x28')]('SugarcrmAccount,\x20%s,\x20%s',_0x2ab5db,_0x492c09[_0x626d('0x28')][_0x626d('0x2a')]);return _0x161794(_0x492c09[_0x626d('0x28')][_0x626d('0x2a')]);}else{logger['info'](_0x626d('0x25'),_0x2ab5db,_0x626d('0x26'));_0x161794(_0x492c09[_0x626d('0x2b')][_0x626d('0x2a')]);}})[_0x626d('0x2c')](function(_0xbaecd5){logger[_0x626d('0x28')]('SugarcrmAccount,\x20%s,\x20%s',_0x2ab5db,_0xbaecd5);_0x222e03(_0xbaecd5);});});}function respondWithStatusCode(_0x519b69,_0xd21ea1){_0xd21ea1=_0xd21ea1||0xcc;return function(_0x319eab){if(_0x319eab){return _0x519b69[_0x626d('0x2d')](_0xd21ea1);}return _0x519b69[_0x626d('0x2e')](_0xd21ea1)[_0x626d('0x2f')]();};}function respondWithResult(_0x4cd4ab,_0x23e97a){_0x23e97a=_0x23e97a||0xc8;return function(_0x3fd58b){if(_0x3fd58b){return _0x4cd4ab['status'](_0x23e97a)[_0x626d('0x30')](_0x3fd58b);}};}function respondWithFilteredResult(_0x3d5369,_0x51d261){return function(_0x283853){if(_0x283853){var _0x46f2ba=_0x283853[_0x626d('0x31')],_0x484804=_0x51d261[_0x626d('0x32')],_0x571441=_0x51d261['offset']+_0x51d261[_0x626d('0x33')],_0x1568c5;if(_0x571441>=_0x46f2ba){_0x571441=_0x46f2ba;_0x1568c5=0xc8;}else{_0x1568c5=0xce;}_0x3d5369[_0x626d('0x2e')](_0x1568c5);return _0x3d5369[_0x626d('0x34')](_0x626d('0x35'),_0x484804+'-'+_0x571441+'/'+_0x46f2ba)['json'](_0x283853);}return null;};}function patchUpdates(_0x16764e){return function(_0x394e3d){try{jsonpatch['apply'](_0x394e3d,_0x16764e,!![]);}catch(_0x49ad21){return BPromise['reject'](_0x49ad21);}return _0x394e3d['save']();};}function saveUpdates(_0x4154b0,_0x2ba358){return function(_0x1e693c){if(_0x1e693c){return _0x1e693c[_0x626d('0x36')](_0x4154b0)['then'](function(_0x53fcc9){return _0x53fcc9;});}return null;};}function removeEntity(_0x40f93d,_0xd18b32){return function(_0x1801bf){if(_0x1801bf){return _0x1801bf[_0x626d('0x37')]()[_0x626d('0x23')](function(){_0x40f93d[_0x626d('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc66fdc,_0xe92395){return function(_0x2077cd){if(!_0x2077cd){_0xc66fdc[_0x626d('0x2d')](0x194);}return _0x2077cd;};}function handleError(_0x2aa87b,_0x3f3794){_0x3f3794=_0x3f3794||0x1f4;return function(_0x12ea7a){logger['error'](_0x12ea7a[_0x626d('0x38')]);if(_0x12ea7a[_0x626d('0x39')]){delete _0x12ea7a[_0x626d('0x39')];}_0x2aa87b[_0x626d('0x2e')](_0x3f3794)['send'](_0x12ea7a);};}exports[_0x626d('0x3a')]=function(_0x4e9b50,_0x572b62){var _0x337585={},_0x3c6774={},_0x234f2b={'count':0x0,'rows':[]};var _0x4724b2=_[_0x626d('0x3b')](db[_0x626d('0x3c')][_0x626d('0x3d')],function(_0x4aa992){return{'name':_0x4aa992['fieldName'],'type':_0x4aa992[_0x626d('0x3e')]['key']};});_0x3c6774[_0x626d('0x3f')]=_['map'](_0x4724b2,_0x626d('0x39'));_0x3c6774[_0x626d('0x40')]=_[_0x626d('0x41')](_0x4e9b50[_0x626d('0x40')]);_0x3c6774[_0x626d('0x42')]=_['intersection'](_0x3c6774['model'],_0x3c6774['query']);_0x337585[_0x626d('0x43')]=_[_0x626d('0x44')](_0x3c6774[_0x626d('0x3f')],qs['fields'](_0x4e9b50[_0x626d('0x40')]['fields']));_0x337585[_0x626d('0x43')]=_0x337585[_0x626d('0x43')][_0x626d('0x45')]?_0x337585[_0x626d('0x43')]:_0x3c6774[_0x626d('0x3f')];if(!_0x4e9b50[_0x626d('0x40')][_0x626d('0x46')]('nolimit')){_0x337585[_0x626d('0x33')]=qs[_0x626d('0x33')](_0x4e9b50[_0x626d('0x40')][_0x626d('0x33')]);_0x337585[_0x626d('0x32')]=qs[_0x626d('0x32')](_0x4e9b50['query'][_0x626d('0x32')]);}_0x337585[_0x626d('0x47')]=qs[_0x626d('0x48')](_0x4e9b50[_0x626d('0x40')][_0x626d('0x48')]);_0x337585[_0x626d('0x49')]=qs[_0x626d('0x42')](_[_0x626d('0x4a')](_0x4e9b50[_0x626d('0x40')],_0x3c6774[_0x626d('0x42')]),_0x4724b2);if(_0x4e9b50['query'][_0x626d('0x4b')]){_0x337585[_0x626d('0x49')]=_[_0x626d('0x4c')](_0x337585[_0x626d('0x49')],{'$or':_[_0x626d('0x3b')](_0x4724b2,function(_0x21028b){if(_0x21028b[_0x626d('0x3e')]!=='VIRTUAL'){var _0xf7fd22={};_0xf7fd22[_0x21028b[_0x626d('0x39')]]={'$like':'%'+_0x4e9b50[_0x626d('0x40')][_0x626d('0x4b')]+'%'};return _0xf7fd22;}})});}_0x337585=_['merge']({},_0x337585,_0x4e9b50[_0x626d('0x4d')]);var _0x1a8c84={'where':_0x337585[_0x626d('0x49')]};return db['SugarcrmAccount']['count'](_0x1a8c84)[_0x626d('0x23')](function(_0x474474){_0x234f2b[_0x626d('0x31')]=_0x474474;if(_0x4e9b50['query'][_0x626d('0x4e')]){_0x337585[_0x626d('0x4f')]=[{'all':!![]}];}return db[_0x626d('0x3c')][_0x626d('0x50')](_0x337585);})['then'](function(_0x1fdf71){_0x234f2b[_0x626d('0x51')]=_0x1fdf71;return _0x234f2b;})[_0x626d('0x23')](respondWithFilteredResult(_0x572b62,_0x337585))['catch'](handleError(_0x572b62,null));};exports['show']=function(_0x15d6ff,_0x250e7d){var _0x2321bc={'raw':![],'where':{'id':_0x15d6ff[_0x626d('0x52')]['id']}},_0x167dd1={};_0x167dd1[_0x626d('0x3f')]=_[_0x626d('0x41')](db[_0x626d('0x3c')][_0x626d('0x3d')]);_0x167dd1[_0x626d('0x40')]=_[_0x626d('0x41')](_0x15d6ff[_0x626d('0x40')]);_0x167dd1['filters']=_['intersection'](_0x167dd1[_0x626d('0x3f')],_0x167dd1[_0x626d('0x40')]);_0x2321bc['attributes']=_[_0x626d('0x44')](_0x167dd1[_0x626d('0x3f')],qs[_0x626d('0x53')](_0x15d6ff[_0x626d('0x40')][_0x626d('0x53')]));_0x2321bc[_0x626d('0x43')]=_0x2321bc[_0x626d('0x43')]['length']?_0x2321bc[_0x626d('0x43')]:_0x167dd1['model'];if(_0x15d6ff[_0x626d('0x40')][_0x626d('0x4e')]){_0x2321bc[_0x626d('0x4f')]=[{'all':!![]}];}_0x2321bc=_[_0x626d('0x4c')]({},_0x2321bc,_0x15d6ff[_0x626d('0x4d')]);return db[_0x626d('0x3c')][_0x626d('0x54')](_0x2321bc)[_0x626d('0x23')](handleEntityNotFound(_0x250e7d,null))[_0x626d('0x23')](respondWithResult(_0x250e7d,null))[_0x626d('0x2c')](handleError(_0x250e7d,null));};exports[_0x626d('0x55')]=function(_0x295dc8,_0x338fc6){return db[_0x626d('0x3c')][_0x626d('0x55')](_0x295dc8[_0x626d('0x56')],{})['then'](respondWithResult(_0x338fc6,0xc9))[_0x626d('0x2c')](handleError(_0x338fc6,null));};exports[_0x626d('0x36')]=function(_0x23613f,_0x3f2384){if(_0x23613f[_0x626d('0x56')]['id']){delete _0x23613f[_0x626d('0x56')]['id'];}return db[_0x626d('0x3c')][_0x626d('0x54')]({'where':{'id':_0x23613f[_0x626d('0x52')]['id']}})[_0x626d('0x23')](handleEntityNotFound(_0x3f2384,null))[_0x626d('0x23')](saveUpdates(_0x23613f[_0x626d('0x56')],null))[_0x626d('0x23')](respondWithResult(_0x3f2384,null))[_0x626d('0x2c')](handleError(_0x3f2384,null));};exports[_0x626d('0x37')]=function(_0x5d9805,_0x25c111){return db[_0x626d('0x3c')][_0x626d('0x54')]({'where':{'id':_0x5d9805['params']['id']}})[_0x626d('0x23')](handleEntityNotFound(_0x25c111,null))[_0x626d('0x23')](removeEntity(_0x25c111,null))[_0x626d('0x2c')](handleError(_0x25c111,null));};exports[_0x626d('0x57')]=function(_0x55006e,_0x4b5eda,_0x8c8973){var _0x327828={};var _0x4e7e23={};var _0x23da98;var _0x25e27d;return db['SugarcrmAccount'][_0x626d('0x58')]({'where':{'id':_0x55006e[_0x626d('0x52')]['id']}})[_0x626d('0x23')](handleEntityNotFound(_0x4b5eda,null))[_0x626d('0x23')](function(_0x206fff){if(_0x206fff){_0x23da98=_0x206fff;_0x4e7e23['model']=_[_0x626d('0x41')](db[_0x626d('0x59')][_0x626d('0x3d')]);_0x4e7e23[_0x626d('0x40')]=_[_0x626d('0x41')](_0x55006e[_0x626d('0x40')]);_0x4e7e23[_0x626d('0x42')]=_[_0x626d('0x44')](_0x4e7e23['model'],_0x4e7e23['query']);_0x327828[_0x626d('0x43')]=_[_0x626d('0x44')](_0x4e7e23[_0x626d('0x3f')],qs['fields'](_0x55006e[_0x626d('0x40')][_0x626d('0x53')]));_0x327828[_0x626d('0x43')]=_0x327828[_0x626d('0x43')][_0x626d('0x45')]?_0x327828[_0x626d('0x43')]:_0x4e7e23[_0x626d('0x3f')];_0x327828[_0x626d('0x47')]=qs[_0x626d('0x48')](_0x55006e[_0x626d('0x40')][_0x626d('0x48')]);_0x327828[_0x626d('0x49')]=qs[_0x626d('0x42')](_[_0x626d('0x4a')](_0x55006e['query'],_0x4e7e23['filters']));if(_0x55006e[_0x626d('0x40')][_0x626d('0x4b')]){_0x327828['where']=_['merge'](_0x327828[_0x626d('0x49')],{'$or':_[_0x626d('0x3b')](_0x327828[_0x626d('0x43')],function(_0x38adf3){var _0x11236a={};_0x11236a[_0x38adf3]={'$like':'%'+_0x55006e[_0x626d('0x40')][_0x626d('0x4b')]+'%'};return _0x11236a;})});}_0x327828=_['merge']({},_0x327828,_0x55006e['options']);return _0x23da98[_0x626d('0x57')](_0x327828);}})['then'](function(_0x3087e6){if(_0x3087e6){_0x25e27d=_0x3087e6['length'];if(!_0x55006e[_0x626d('0x40')][_0x626d('0x46')](_0x626d('0x5a'))){_0x327828[_0x626d('0x33')]=qs[_0x626d('0x33')](_0x55006e[_0x626d('0x40')][_0x626d('0x33')]);_0x327828[_0x626d('0x32')]=qs[_0x626d('0x32')](_0x55006e[_0x626d('0x40')][_0x626d('0x32')]);}return _0x23da98[_0x626d('0x57')](_0x327828);}})['then'](function(_0x5d1403){if(_0x5d1403){return _0x5d1403?{'count':_0x25e27d,'rows':_0x5d1403}:null;}})[_0x626d('0x23')](respondWithResult(_0x4b5eda,null))[_0x626d('0x2c')](handleError(_0x4b5eda,null));};exports[_0x626d('0x5b')]=function(_0x5ed773,_0x562f0a,_0x28f333){if(_0x5ed773[_0x626d('0x56')]['id']){delete _0x5ed773[_0x626d('0x56')]['id'];}return db[_0x626d('0x3c')][_0x626d('0x58')]({'where':{'id':_0x5ed773[_0x626d('0x52')]['id']}})['then'](handleEntityNotFound(_0x562f0a,null))[_0x626d('0x23')](function(_0x310de3){if(_0x310de3){_0x5ed773[_0x626d('0x56')]['AccountId']=_0x310de3['id'];_0x5ed773['body']['Subjects']=integrations[_0x626d('0x5c')](_0x5ed773[_0x626d('0x56')]['channel'],_0x5ed773[_0x626d('0x56')][_0x626d('0x3e')]);_0x5ed773[_0x626d('0x56')][_0x626d('0x5d')]=integrations[_0x626d('0x5e')](_0x5ed773['body'][_0x626d('0x5f')],_0x5ed773[_0x626d('0x56')][_0x626d('0x3e')]);return db['SugarcrmConfiguration'][_0x626d('0x55')](_0x5ed773[_0x626d('0x56')],{'include':[{'model':db['SugarcrmField'],'as':_0x626d('0x60')},{'model':db[_0x626d('0x61')],'as':_0x626d('0x5d')}]});}return null;})[_0x626d('0x23')](respondWithResult(_0x562f0a,null))['catch'](handleError(_0x562f0a,null));};exports[_0x626d('0x62')]=function(_0x1aa853,_0x5c1485,_0x30b2d6){var _0x53184b='';var _0xb68080=['id','name',_0x626d('0x63'),_0x626d('0x64'),_0x626d('0x65'),_0x626d('0x66'),_0x626d('0x67'),_0x626d('0x68'),_0x626d('0x69'),_0x626d('0x6a'),'parent_name',_0x626d('0x6b')];return db[_0x626d('0x3c')][_0x626d('0x58')]({'where':{'id':_0x1aa853['params']['id']},'attributes':['id',_0x626d('0x6c'),_0x626d('0x6d'),_0x626d('0x6e')]})['then'](handleEntityNotFound(_0x5c1485,null))[_0x626d('0x23')](function(_0x498e20){if(_0x498e20){_0x53184b=_0x498e20[_0x626d('0x6e')];var _0x561442=_0x53184b['slice'](-0x1);if(_0x561442==='/'){_0x53184b=_0x53184b[_0x626d('0x6f')](0x0,_0x53184b['lastIndexOf'](_0x561442));}return rp({'method':_0x626d('0x70'),'uri':util[_0x626d('0x71')](_0x626d('0x72'),_0x53184b,_0x626d('0x73')),'json':!![],'form':{'method':_0x626d('0x74'),'input_type':_0x626d('0x75'),'response_type':_0x626d('0x75'),'rest_data':JSON[_0x626d('0x76')]({'user_auth':{'user_name':_0x498e20['username'],'password':_0x498e20[_0x626d('0x6d')],'encryption':_0x626d('0x77')},'application':_0x626d('0x78')})}});}})[_0x626d('0x23')](function(_0x31c958){if(_0x31c958&&_0x31c958[_0x626d('0x39')]!==_0x626d('0x79')&&_0x31c958['name']!==_0x626d('0x7a')){return rp({'method':_0x626d('0x70'),'uri':util[_0x626d('0x71')](_0x626d('0x72'),_0x53184b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x626d('0x75'),'response_type':_0x626d('0x75'),'rest_data':JSON['stringify']({'session':_0x31c958['id'],'module_name':_0x626d('0x7b')})}})[_0x626d('0x23')](function(_0x23ce14){if(_0x23ce14){var _0xf9f2ae=_[_0x626d('0x7c')](_0x23ce14['module_fields']);_[_0x626d('0x7d')](_0xf9f2ae,function(_0x2943bc){return _0xb68080[_0x626d('0x7e')](_0x2943bc[_0x626d('0x39')]);});return{'count':_0xf9f2ae[_0x626d('0x45')],'rows':_[_0x626d('0x3b')](_0xf9f2ae,function(_0x3c7c5f){return{'id':_0x3c7c5f['name'],'name':_0x3c7c5f[_0x626d('0x7f')],'custom':_[_0x626d('0x80')](_0x3c7c5f[_0x626d('0x39')],'_c')?!![]:![],'options':_0x3c7c5f[_0x626d('0x4d')]?_[_0x626d('0x3b')](_[_0x626d('0x7c')](_0x3c7c5f[_0x626d('0x4d')]),function(_0xbe806d){return{'name':_0xbe806d[_0x626d('0x81')],'value':_0xbe806d[_0x626d('0x39')]};}):[]};})};}})[_0x626d('0x23')](respondWithResult(_0x5c1485,null))[_0x626d('0x2c')](function(_0x3ec836){var _0x213e9b=_0x1aa853[_0x626d('0x40')][_0x626d('0x1e')]?0x1f4:_0x3ec836[_0x626d('0x82')]||0x1f4;logger[_0x626d('0x28')](_0x626d('0x83'),_0x626d('0x62'),_0x213e9b,JSON['stringify'](_0x3ec836));delete _0x3ec836[_0x626d('0x39')];if(_0x213e9b===0x191){_0x213e9b=0x190;}_0x5c1485[_0x626d('0x2e')](_0x213e9b)[_0x626d('0x84')](_0x1aa853[_0x626d('0x40')][_0x626d('0x1e')]?{'message':_0x626d('0x85'),'statusCode':_0x3ec836['statusCode']}:_0x3ec836);});}else{var _0x7087ce=0x1f4;_0x5c1485['status'](_0x7087ce)[_0x626d('0x84')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
index 49e4922..1865e16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecab=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xecab,0x16b));var _0xbeca=function(_0x2e613e,_0x467297){_0x2e613e=_0x2e613e-0x0;var _0x4672c2=_0xecab[_0x2e613e];return _0x4672c2;};'use strict';var _=require(_0xbeca('0x0'));var util=require(_0xbeca('0x1'));var logger=require(_0xbeca('0x2'))('api');var moment=require(_0xbeca('0x3'));var BPromise=require(_0xbeca('0x4'));var rp=require(_0xbeca('0x5'));var fs=require('fs');var path=require(_0xbeca('0x6'));var rimraf=require(_0xbeca('0x7'));var config=require(_0xbeca('0x8'));var attributes=require(_0xbeca('0x9'));var integrations=require(_0xbeca('0xa'));module['exports']=function(_0x9f772f,_0x3b3cf6){return _0x9f772f[_0xbeca('0xb')](_0xbeca('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1edd=['../../config/logger','api','bluebird','request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','lodash','util'];(function(_0x27e29c,_0x58529a){var _0x55aa56=function(_0x1d9e81){while(--_0x1d9e81){_0x27e29c['push'](_0x27e29c['shift']());}};_0x55aa56(++_0x58529a);}(_0x1edd,0x111));var _0xd1ed=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0x1edd[_0x43d701];return _0x2ec4c6;};'use strict';var _=require(_0xd1ed('0x0'));var util=require(_0xd1ed('0x1'));var logger=require(_0xd1ed('0x2'))(_0xd1ed('0x3'));var moment=require('moment');var BPromise=require(_0xd1ed('0x4'));var rp=require(_0xd1ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1ed('0x6'));var attributes=require(_0xd1ed('0x7'));var integrations=require(_0xd1ed('0x8'));module['exports']=function(_0x150321,_0x14d081){return _0x150321[_0xd1ed('0x9')](_0xd1ed('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 22683b8..e510799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36b7=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','model','include','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','bluebird','randomstring','ioredis'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x36b7,0x1e6));var _0x736b=function(_0x52c820,_0x81c4e2){_0x52c820=_0x52c820-0x0;var _0x1e9d87=_0x36b7[_0x52c820];return _0x1e9d87;};'use strict';var _=require(_0x736b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x736b('0x1'));var rs=require(_0x736b('0x2'));var fs=require('fs');var Redis=require(_0x736b('0x3'));var db=require(_0x736b('0x4'))['db'];var utils=require(_0x736b('0x5'));var logger=require(_0x736b('0x6'))('rpc');var config=require(_0x736b('0x7'));var jayson=require(_0x736b('0x8'));var client=jayson[_0x736b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cf665,_0x7227c8,_0x158089){return new BPromise(function(_0x53e3a9,_0x219c45){return client[_0x736b('0xa')](_0x5cf665,_0x158089)[_0x736b('0xb')](function(_0x51fe0a){logger['info'](_0x736b('0xc'),_0x7227c8,_0x736b('0xd'));logger[_0x736b('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x7227c8,'request\x20sent',JSON[_0x736b('0xf')](_0x51fe0a));if(_0x51fe0a[_0x736b('0x10')]){if(_0x51fe0a['error'][_0x736b('0x11')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x7227c8,_0x51fe0a[_0x736b('0x10')][_0x736b('0x12')]);return _0x219c45(_0x51fe0a['error'][_0x736b('0x12')]);}logger['error'](_0x736b('0xc'),_0x7227c8,_0x51fe0a[_0x736b('0x10')][_0x736b('0x12')]);return _0x53e3a9(_0x51fe0a['error'][_0x736b('0x12')]);}else{logger[_0x736b('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x7227c8,_0x736b('0xd'));_0x53e3a9(_0x51fe0a[_0x736b('0x14')][_0x736b('0x12')]);}})[_0x736b('0x15')](function(_0x463846){logger['error'](_0x736b('0xc'),_0x7227c8,_0x463846);_0x219c45(_0x463846);});});}exports['GetSugarcrmAccount']=function(_0x2cf007){var _0x3fa644=this;return new Promise(function(_0x10c8ff,_0xfab2cd){return db[_0x736b('0x16')][_0x736b('0x17')]({'raw':_0x2cf007['options']?_0x2cf007[_0x736b('0x18')][_0x736b('0x19')]===undefined?!![]:![]:!![],'where':_0x2cf007[_0x736b('0x18')]?_0x2cf007[_0x736b('0x18')][_0x736b('0x1a')]||null:null,'attributes':_0x2cf007['options']?_0x2cf007[_0x736b('0x18')][_0x736b('0x1b')]||null:null,'limit':_0x2cf007[_0x736b('0x18')]?_0x2cf007[_0x736b('0x18')][_0x736b('0x1c')]||null:null,'include':_0x2cf007[_0x736b('0x18')]?_0x2cf007[_0x736b('0x18')]['include']?_[_0x736b('0x1d')](_0x2cf007[_0x736b('0x18')]['include'],function(_0x20945b){return{'model':db[_0x20945b[_0x736b('0x1e')]],'as':_0x20945b['as'],'attributes':_0x20945b[_0x736b('0x1b')],'include':_0x20945b[_0x736b('0x1f')]?_[_0x736b('0x1d')](_0x20945b[_0x736b('0x1f')],function(_0x469e2c){return{'model':db[_0x469e2c['model']],'as':_0x469e2c['as'],'attributes':_0x469e2c['attributes'],'include':_0x469e2c['include']?_[_0x736b('0x1d')](_0x469e2c['include'],function(_0x416066){return{'model':db[_0x416066[_0x736b('0x1e')]],'as':_0x416066['as'],'attributes':_0x416066['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51ca83){logger[_0x736b('0x13')](_0x736b('0x20'),_0x2cf007);logger['debug'](_0x736b('0x20'),_0x2cf007,JSON[_0x736b('0xf')](_0x51ca83));_0x10c8ff(_0x51ca83);})[_0x736b('0x15')](function(_0x2659eb){logger['error'](_0x736b('0x20'),_0x2659eb[_0x736b('0x12')],_0x2cf007);_0xfab2cd(_0x3fa644[_0x736b('0x10')](0x1f4,_0x2659eb[_0x736b('0x12')]));});});};exports[_0x736b('0x21')]=function(_0x25f0a9){var _0x117fea=this;return new Promise(function(_0x5c4c35,_0x5302f8){return db['SugarcrmAccount'][_0x736b('0x22')]({'raw':_0x25f0a9[_0x736b('0x18')]?_0x25f0a9['options']['raw']===undefined?!![]:![]:!![],'where':_0x25f0a9[_0x736b('0x18')]?_0x25f0a9[_0x736b('0x18')]['where']||null:null,'attributes':_0x25f0a9['options']?_0x25f0a9[_0x736b('0x18')]['attributes']||null:null,'include':_0x25f0a9['options']?_0x25f0a9[_0x736b('0x18')][_0x736b('0x1f')]?_[_0x736b('0x1d')](_0x25f0a9['options'][_0x736b('0x1f')],function(_0x1ea7f0){return{'model':db[_0x1ea7f0[_0x736b('0x1e')]],'as':_0x1ea7f0['as'],'attributes':_0x1ea7f0['attributes'],'include':_0x1ea7f0[_0x736b('0x1f')]?_[_0x736b('0x1d')](_0x1ea7f0[_0x736b('0x1f')],function(_0x5aa178){return{'model':db[_0x5aa178[_0x736b('0x1e')]],'as':_0x5aa178['as'],'attributes':_0x5aa178['attributes'],'include':_0x5aa178[_0x736b('0x1f')]?_[_0x736b('0x1d')](_0x5aa178[_0x736b('0x1f')],function(_0x57f945){return{'model':db[_0x57f945[_0x736b('0x1e')]],'as':_0x57f945['as'],'attributes':_0x57f945['attributes']};}):[]};}):[]};}):[]:[]})[_0x736b('0xb')](function(_0x2fce77){logger[_0x736b('0x13')]('ShowSugarcrmAccount',_0x25f0a9);logger[_0x736b('0xe')](_0x736b('0x21'),_0x25f0a9,JSON[_0x736b('0xf')](_0x2fce77));_0x5c4c35(_0x2fce77);})[_0x736b('0x15')](function(_0x555751){logger[_0x736b('0x10')](_0x736b('0x21'),_0x555751[_0x736b('0x12')],_0x25f0a9);_0x5302f8(_0x117fea['error'](0x1f4,_0x555751[_0x736b('0x12')]));});});};
\ No newline at end of file
+var _0x9c49=['../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','map','model','include','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c15d0,_0x37d203){var _0x4a701c=function(_0x5c4e7d){while(--_0x5c4e7d){_0x5c15d0['push'](_0x5c15d0['shift']());}};_0x4a701c(++_0x37d203);}(_0x9c49,0x65));var _0x99c4=function(_0x136d61,_0x15999f){_0x136d61=_0x136d61-0x0;var _0x2e8dfb=_0x9c49[_0x136d61];return _0x2e8dfb;};'use strict';var _=require(_0x99c4('0x0'));var util=require(_0x99c4('0x1'));var moment=require(_0x99c4('0x2'));var BPromise=require(_0x99c4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99c4('0x4'));var db=require(_0x99c4('0x5'))['db'];var utils=require(_0x99c4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x99c4('0x7'));var jayson=require(_0x99c4('0x8'));var client=jayson[_0x99c4('0x9')][_0x99c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a8c72,_0x1d8066,_0x523221){return new BPromise(function(_0x1c4efc,_0x2606f2){return client[_0x99c4('0xb')](_0x3a8c72,_0x523221)[_0x99c4('0xc')](function(_0x9dc207){logger[_0x99c4('0xd')](_0x99c4('0xe'),_0x1d8066,_0x99c4('0xf'));logger[_0x99c4('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1d8066,_0x99c4('0xf'),JSON['stringify'](_0x9dc207));if(_0x9dc207[_0x99c4('0x11')]){if(_0x9dc207[_0x99c4('0x11')][_0x99c4('0x12')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1d8066,_0x9dc207[_0x99c4('0x11')]['message']);return _0x2606f2(_0x9dc207[_0x99c4('0x11')][_0x99c4('0x13')]);}logger[_0x99c4('0x11')](_0x99c4('0xe'),_0x1d8066,_0x9dc207[_0x99c4('0x11')][_0x99c4('0x13')]);return _0x1c4efc(_0x9dc207[_0x99c4('0x11')][_0x99c4('0x13')]);}else{logger['info'](_0x99c4('0xe'),_0x1d8066,_0x99c4('0xf'));_0x1c4efc(_0x9dc207[_0x99c4('0x14')]['message']);}})[_0x99c4('0x15')](function(_0x24c478){logger['error'](_0x99c4('0xe'),_0x1d8066,_0x24c478);_0x2606f2(_0x24c478);});});}exports[_0x99c4('0x16')]=function(_0x16aac2){var _0x4597b5=this;return new Promise(function(_0x1f627e,_0x1ae91a){return db['SugarcrmAccount'][_0x99c4('0x17')]({'raw':_0x16aac2[_0x99c4('0x18')]?_0x16aac2[_0x99c4('0x18')][_0x99c4('0x19')]===undefined?!![]:![]:!![],'where':_0x16aac2[_0x99c4('0x18')]?_0x16aac2['options'][_0x99c4('0x1a')]||null:null,'attributes':_0x16aac2[_0x99c4('0x18')]?_0x16aac2['options'][_0x99c4('0x1b')]||null:null,'limit':_0x16aac2['options']?_0x16aac2['options'][_0x99c4('0x1c')]||null:null,'include':_0x16aac2[_0x99c4('0x18')]?_0x16aac2[_0x99c4('0x18')]['include']?_[_0x99c4('0x1d')](_0x16aac2[_0x99c4('0x18')]['include'],function(_0x279c9d){return{'model':db[_0x279c9d[_0x99c4('0x1e')]],'as':_0x279c9d['as'],'attributes':_0x279c9d[_0x99c4('0x1b')],'include':_0x279c9d[_0x99c4('0x1f')]?_[_0x99c4('0x1d')](_0x279c9d[_0x99c4('0x1f')],function(_0x44d052){return{'model':db[_0x44d052[_0x99c4('0x1e')]],'as':_0x44d052['as'],'attributes':_0x44d052[_0x99c4('0x1b')],'include':_0x44d052[_0x99c4('0x1f')]?_['map'](_0x44d052['include'],function(_0x218f38){return{'model':db[_0x218f38[_0x99c4('0x1e')]],'as':_0x218f38['as'],'attributes':_0x218f38[_0x99c4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21c47b){logger['info'](_0x99c4('0x16'),_0x16aac2);logger[_0x99c4('0x10')](_0x99c4('0x16'),_0x16aac2,JSON[_0x99c4('0x20')](_0x21c47b));_0x1f627e(_0x21c47b);})[_0x99c4('0x15')](function(_0x8587b4){logger[_0x99c4('0x11')](_0x99c4('0x16'),_0x8587b4[_0x99c4('0x13')],_0x16aac2);_0x1ae91a(_0x4597b5[_0x99c4('0x11')](0x1f4,_0x8587b4['message']));});});};exports[_0x99c4('0x21')]=function(_0x511e1c){var _0x401f0a=this;return new Promise(function(_0x47eef4,_0x4b9f33){return db[_0x99c4('0x22')][_0x99c4('0x23')]({'raw':_0x511e1c['options']?_0x511e1c[_0x99c4('0x18')][_0x99c4('0x19')]===undefined?!![]:![]:!![],'where':_0x511e1c['options']?_0x511e1c[_0x99c4('0x18')][_0x99c4('0x1a')]||null:null,'attributes':_0x511e1c[_0x99c4('0x18')]?_0x511e1c[_0x99c4('0x18')][_0x99c4('0x1b')]||null:null,'include':_0x511e1c[_0x99c4('0x18')]?_0x511e1c[_0x99c4('0x18')][_0x99c4('0x1f')]?_['map'](_0x511e1c[_0x99c4('0x18')][_0x99c4('0x1f')],function(_0x8016a2){return{'model':db[_0x8016a2[_0x99c4('0x1e')]],'as':_0x8016a2['as'],'attributes':_0x8016a2[_0x99c4('0x1b')],'include':_0x8016a2[_0x99c4('0x1f')]?_[_0x99c4('0x1d')](_0x8016a2['include'],function(_0x152639){return{'model':db[_0x152639[_0x99c4('0x1e')]],'as':_0x152639['as'],'attributes':_0x152639[_0x99c4('0x1b')],'include':_0x152639[_0x99c4('0x1f')]?_['map'](_0x152639['include'],function(_0x2f6a12){return{'model':db[_0x2f6a12[_0x99c4('0x1e')]],'as':_0x2f6a12['as'],'attributes':_0x2f6a12[_0x99c4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x131cfd){logger[_0x99c4('0xd')](_0x99c4('0x21'),_0x511e1c);logger[_0x99c4('0x10')](_0x99c4('0x21'),_0x511e1c,JSON[_0x99c4('0x20')](_0x131cfd));_0x47eef4(_0x131cfd);})[_0x99c4('0x15')](function(_0x3423eb){logger[_0x99c4('0x11')]('ShowSugarcrmAccount',_0x3423eb[_0x99c4('0x13')],_0x511e1c);_0x4b9f33(_0x401f0a[_0x99c4('0x11')](0x1f4,_0x3423eb['message']));});});};
\ No newline at end of file
index 208a0fb..8de16a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a31=['create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','post'];(function(_0x55fdb7,_0x3fd4c3){var _0x5840c2=function(_0x510272){while(--_0x510272){_0x55fdb7['push'](_0x55fdb7['shift']());}};_0x5840c2(++_0x3fd4c3);}(_0x1a31,0x11a));var _0x11a3=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x1a31[_0x172747];return _0x509692;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11a3('0x0'));var timeout=require(_0x11a3('0x1'));var express=require(_0x11a3('0x2'));var router=express[_0x11a3('0x3')]();var auth=require(_0x11a3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x11a3('0x5'));var controller=require(_0x11a3('0x6'));router[_0x11a3('0x7')]('/',auth[_0x11a3('0x8')](),controller[_0x11a3('0x9')]);router[_0x11a3('0x7')](_0x11a3('0xa'),auth['isAuthenticated'](),controller[_0x11a3('0xb')]);router[_0x11a3('0x7')](_0x11a3('0xc'),auth['isAuthenticated'](),controller[_0x11a3('0xd')]);router[_0x11a3('0x7')](_0x11a3('0xe'),auth['isAuthenticated'](),controller[_0x11a3('0xf')]);router[_0x11a3('0x7')]('/:id/descriptions',auth[_0x11a3('0x8')](),controller['getDescriptions']);router[_0x11a3('0x10')]('/',auth[_0x11a3('0x8')](),controller[_0x11a3('0x11')]);router[_0x11a3('0x12')](_0x11a3('0xa'),auth[_0x11a3('0x8')](),controller[_0x11a3('0x13')]);router[_0x11a3('0x14')](_0x11a3('0xa'),auth[_0x11a3('0x8')](),controller[_0x11a3('0x15')]);module[_0x11a3('0x16')]=router;
\ No newline at end of file
+var _0x1de5=['put','update','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x1de5,0xf4));var _0x51de=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x1de5[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require('multer');var util=require(_0x51de('0x0'));var path=require(_0x51de('0x1'));var timeout=require(_0x51de('0x2'));var express=require(_0x51de('0x3'));var router=express[_0x51de('0x4')]();var auth=require(_0x51de('0x5'));var interaction=require(_0x51de('0x6'));var config=require(_0x51de('0x7'));var controller=require(_0x51de('0x8'));router[_0x51de('0x9')]('/',auth['isAuthenticated'](),controller[_0x51de('0xa')]);router[_0x51de('0x9')](_0x51de('0xb'),auth[_0x51de('0xc')](),controller['show']);router[_0x51de('0x9')](_0x51de('0xd'),auth[_0x51de('0xc')](),controller[_0x51de('0xe')]);router['get'](_0x51de('0xf'),auth[_0x51de('0xc')](),controller[_0x51de('0x10')]);router[_0x51de('0x9')](_0x51de('0x11'),auth[_0x51de('0xc')](),controller[_0x51de('0x12')]);router[_0x51de('0x13')]('/',auth[_0x51de('0xc')](),controller['create']);router[_0x51de('0x14')](_0x51de('0xb'),auth[_0x51de('0xc')](),controller[_0x51de('0x15')]);router['delete'](_0x51de('0xb'),auth[_0x51de('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 7cd7a6a..0bf6e5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe53a=['STRING','exports'];(function(_0x22644c,_0x931630){var _0x36c060=function(_0x3803e3){while(--_0x3803e3){_0x22644c['push'](_0x22644c['shift']());}};_0x36c060(++_0x931630);}(_0xe53a,0xb7));var _0xae53=function(_0x506735,_0x388fc3){_0x506735=_0x506735-0x0;var _0x52f210=_0xe53a[_0x506735];return _0x52f210;};'use strict';var Sequelize=require('sequelize');module[_0xae53('0x0')]={'name':{'type':Sequelize[_0xae53('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x82bf=['STRING','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x82bf,0x17b));var _0xf82b=function(_0x344e09,_0x4307fb){_0x344e09=_0x344e09-0x0;var _0x43032b=_0x82bf[_0x344e09];return _0x43032b;};'use strict';var Sequelize=require(_0xf82b('0x0'));module[_0xf82b('0x1')]={'name':{'type':Sequelize[_0xf82b('0x2')]},'description':{'type':Sequelize[_0xf82b('0x2')]}};
\ No newline at end of file
index bd0f959..b658913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x200e=['key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','params','find','create','body','update','findOne','SugarcrmField','order','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','then','destroy','name','send','index','map','SugarcrmConfiguration','rawAttributes','type'];(function(_0x2ab65f,_0x1c6b22){var _0x153004=function(_0x25e0c7){while(--_0x25e0c7){_0x2ab65f['push'](_0x2ab65f['shift']());}};_0x153004(++_0x1c6b22);}(_0x200e,0x7a));var _0xe200=function(_0x4f7233,_0x19c3eb){_0x4f7233=_0x4f7233-0x0;var _0x354773=_0x200e[_0x4f7233];return _0x354773;};'use strict';var pdf=require(_0xe200('0x0'));var emlformat=require(_0xe200('0x1'));var rimraf=require(_0xe200('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe200('0x3'));var rp=require('request-promise');var moment=require(_0xe200('0x4'));var BPromise=require(_0xe200('0x5'));var Mustache=require(_0xe200('0x6'));var util=require(_0xe200('0x7'));var path=require(_0xe200('0x8'));var sox=require(_0xe200('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe200('0xa'));var squel=require(_0xe200('0xb'));var crypto=require(_0xe200('0xc'));var jsforce=require(_0xe200('0xd'));var deskjs=require(_0xe200('0xe'));var toCsv=require(_0xe200('0xf'));var querystring=require(_0xe200('0x10'));var Papa=require(_0xe200('0x11'));var Redis=require(_0xe200('0x12'));var authService=require(_0xe200('0x13'));var qs=require(_0xe200('0x14'));var as=require(_0xe200('0x15'));var hardwareService=require(_0xe200('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe200('0x17'));var config=require(_0xe200('0x18'));var db=require(_0xe200('0x19'))['db'];var jayson=require(_0xe200('0x1a'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3f6d0d,_0x16122c,_0x3b9db8){if(_0x3b9db8){var _0x31f7f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31f7f5[_0xe200('0x1b')](_0x16122c)){return _0x3f6d0d;}else{throw new db['Sequelize'][(_0xe200('0x1c'))](_0xe200('0x1d'));}}else{return _0x3f6d0d;}}function respondWithRpcPromise(_0x118fd0,_0x4031d0,_0x5f318c,_0x4f4046){return new BPromise(function(_0x6c5a5b,_0x3a5b59){var _0x5e1629=_0x4f4046||client;return _0x5e1629['request'](_0x118fd0,_0x5f318c)['then'](function(_0xe649b5){logger[_0xe200('0x1e')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4031d0,_0xe200('0x1f'));logger[_0xe200('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4031d0,'request\x20sent',JSON[_0xe200('0x21')](_0xe649b5));if(_0xe649b5[_0xe200('0x22')]){if(_0xe649b5['error']['code']===0x1f4){logger[_0xe200('0x22')](_0xe200('0x23'),_0x4031d0,_0xe649b5[_0xe200('0x22')][_0xe200('0x24')]);return _0x3a5b59(_0xe649b5[_0xe200('0x22')][_0xe200('0x24')]);}logger[_0xe200('0x22')](_0xe200('0x23'),_0x4031d0,_0xe649b5[_0xe200('0x22')][_0xe200('0x24')]);return _0x6c5a5b(_0xe649b5[_0xe200('0x22')][_0xe200('0x24')]);}else{logger[_0xe200('0x1e')](_0xe200('0x23'),_0x4031d0,_0xe200('0x1f'));_0x6c5a5b(_0xe649b5[_0xe200('0x25')][_0xe200('0x24')]);}})[_0xe200('0x26')](function(_0x21d7cf){logger[_0xe200('0x22')](_0xe200('0x23'),_0x4031d0,_0x21d7cf);_0x3a5b59(_0x21d7cf);});});}function respondWithStatusCode(_0x3e7b22,_0x3d84d1){_0x3d84d1=_0x3d84d1||0xcc;return function(_0x550531){if(_0x550531){return _0x3e7b22[_0xe200('0x27')](_0x3d84d1);}return _0x3e7b22[_0xe200('0x28')](_0x3d84d1)[_0xe200('0x29')]();};}function respondWithResult(_0x3fa734,_0xc13d8a){_0xc13d8a=_0xc13d8a||0xc8;return function(_0x1843a9){if(_0x1843a9){return _0x3fa734[_0xe200('0x28')](_0xc13d8a)['json'](_0x1843a9);}};}function respondWithFilteredResult(_0x47d8ad,_0x10beb6){return function(_0x2d9879){if(_0x2d9879){var _0x2093b1=_0x2d9879[_0xe200('0x2a')],_0x4b00e3=_0x10beb6[_0xe200('0x2b')],_0x4ab124=_0x10beb6[_0xe200('0x2b')]+_0x10beb6['limit'],_0x1e3847;if(_0x4ab124>=_0x2093b1){_0x4ab124=_0x2093b1;_0x1e3847=0xc8;}else{_0x1e3847=0xce;}_0x47d8ad[_0xe200('0x28')](_0x1e3847);return _0x47d8ad['set'](_0xe200('0x2c'),_0x4b00e3+'-'+_0x4ab124+'/'+_0x2093b1)[_0xe200('0x2d')](_0x2d9879);}return null;};}function patchUpdates(_0x22109f){return function(_0x53c87f){try{jsonpatch[_0xe200('0x2e')](_0x53c87f,_0x22109f,!![]);}catch(_0x388c8f){return BPromise[_0xe200('0x2f')](_0x388c8f);}return _0x53c87f[_0xe200('0x30')]();};}function saveUpdates(_0x5cef10,_0x44fb1b){return function(_0x24eb3){if(_0x24eb3){return _0x24eb3['update'](_0x5cef10)[_0xe200('0x31')](function(_0x439bf0){return _0x439bf0;});}return null;};}function removeEntity(_0x2b3717,_0x4d1dfb){return function(_0x280a29){if(_0x280a29){return _0x280a29[_0xe200('0x32')]()[_0xe200('0x31')](function(){_0x2b3717[_0xe200('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53101b,_0x127e8a){return function(_0x258eab){if(!_0x258eab){_0x53101b['sendStatus'](0x194);}return _0x258eab;};}function handleError(_0x38561b,_0xf8d3c4){_0xf8d3c4=_0xf8d3c4||0x1f4;return function(_0x391439){logger['error'](_0x391439['stack']);if(_0x391439[_0xe200('0x33')]){delete _0x391439['name'];}_0x38561b[_0xe200('0x28')](_0xf8d3c4)[_0xe200('0x34')](_0x391439);};}exports[_0xe200('0x35')]=function(_0x5a2e1e,_0x2b94df){var _0x2f6b1b={},_0x98226e={},_0x41ba40={'count':0x0,'rows':[]};var _0x15943c=_[_0xe200('0x36')](db[_0xe200('0x37')][_0xe200('0x38')],function(_0x5e265b){return{'name':_0x5e265b['fieldName'],'type':_0x5e265b[_0xe200('0x39')][_0xe200('0x3a')]};});_0x98226e[_0xe200('0x3b')]=_['map'](_0x15943c,_0xe200('0x33'));_0x98226e[_0xe200('0x3c')]=_[_0xe200('0x3d')](_0x5a2e1e['query']);_0x98226e['filters']=_['intersection'](_0x98226e[_0xe200('0x3b')],_0x98226e[_0xe200('0x3c')]);_0x2f6b1b[_0xe200('0x3e')]=_[_0xe200('0x3f')](_0x98226e[_0xe200('0x3b')],qs[_0xe200('0x40')](_0x5a2e1e[_0xe200('0x3c')][_0xe200('0x40')]));_0x2f6b1b[_0xe200('0x3e')]=_0x2f6b1b[_0xe200('0x3e')][_0xe200('0x41')]?_0x2f6b1b['attributes']:_0x98226e[_0xe200('0x3b')];if(!_0x5a2e1e[_0xe200('0x3c')][_0xe200('0x42')](_0xe200('0x43'))){_0x2f6b1b[_0xe200('0x44')]=qs[_0xe200('0x44')](_0x5a2e1e[_0xe200('0x3c')][_0xe200('0x44')]);_0x2f6b1b[_0xe200('0x2b')]=qs[_0xe200('0x2b')](_0x5a2e1e['query'][_0xe200('0x2b')]);}_0x2f6b1b['order']=qs[_0xe200('0x45')](_0x5a2e1e['query'][_0xe200('0x45')]);_0x2f6b1b[_0xe200('0x46')]=qs[_0xe200('0x47')](_[_0xe200('0x48')](_0x5a2e1e[_0xe200('0x3c')],_0x98226e['filters']),_0x15943c);if(_0x5a2e1e[_0xe200('0x3c')][_0xe200('0x49')]){_0x2f6b1b['where']=_[_0xe200('0x4a')](_0x2f6b1b[_0xe200('0x46')],{'$or':_[_0xe200('0x36')](_0x15943c,function(_0x33bf92){if(_0x33bf92[_0xe200('0x39')]!=='VIRTUAL'){var _0x55f2b7={};_0x55f2b7[_0x33bf92['name']]={'$like':'%'+_0x5a2e1e['query']['filter']+'%'};return _0x55f2b7;}})});}_0x2f6b1b=_[_0xe200('0x4a')]({},_0x2f6b1b,_0x5a2e1e[_0xe200('0x4b')]);var _0x37c944={'where':_0x2f6b1b['where']};return db[_0xe200('0x37')][_0xe200('0x2a')](_0x37c944)[_0xe200('0x31')](function(_0x5e3026){_0x41ba40[_0xe200('0x2a')]=_0x5e3026;if(_0x5a2e1e[_0xe200('0x3c')][_0xe200('0x4c')]){_0x2f6b1b[_0xe200('0x4d')]=[{'all':!![]}];}return db[_0xe200('0x37')][_0xe200('0x4e')](_0x2f6b1b);})[_0xe200('0x31')](function(_0x9ecafa){_0x41ba40['rows']=_0x9ecafa;return _0x41ba40;})['then'](respondWithFilteredResult(_0x2b94df,_0x2f6b1b))[_0xe200('0x26')](handleError(_0x2b94df,null));};exports['show']=function(_0x3a92be,_0x3b3645){var _0x4023ee={'raw':![],'where':{'id':_0x3a92be[_0xe200('0x4f')]['id']}},_0x24eb12={};_0x24eb12[_0xe200('0x3b')]=_[_0xe200('0x3d')](db[_0xe200('0x37')][_0xe200('0x38')]);_0x24eb12[_0xe200('0x3c')]=_['keys'](_0x3a92be[_0xe200('0x3c')]);_0x24eb12['filters']=_['intersection'](_0x24eb12[_0xe200('0x3b')],_0x24eb12[_0xe200('0x3c')]);_0x4023ee['attributes']=_[_0xe200('0x3f')](_0x24eb12[_0xe200('0x3b')],qs[_0xe200('0x40')](_0x3a92be[_0xe200('0x3c')][_0xe200('0x40')]));_0x4023ee[_0xe200('0x3e')]=_0x4023ee[_0xe200('0x3e')][_0xe200('0x41')]?_0x4023ee['attributes']:_0x24eb12[_0xe200('0x3b')];if(_0x3a92be[_0xe200('0x3c')][_0xe200('0x4c')]){_0x4023ee[_0xe200('0x4d')]=[{'all':!![]}];}_0x4023ee=_[_0xe200('0x4a')]({},_0x4023ee,_0x3a92be['options']);return db[_0xe200('0x37')][_0xe200('0x50')](_0x4023ee)['then'](handleEntityNotFound(_0x3b3645,null))[_0xe200('0x31')](respondWithResult(_0x3b3645,null))[_0xe200('0x26')](handleError(_0x3b3645,null));};exports[_0xe200('0x51')]=function(_0x94b47f,_0x16f448){return db[_0xe200('0x37')]['create'](_0x94b47f[_0xe200('0x52')],{})[_0xe200('0x31')](respondWithResult(_0x16f448,0xc9))['catch'](handleError(_0x16f448,null));};exports[_0xe200('0x53')]=function(_0x2e3e61,_0x155cc0){if(_0x2e3e61[_0xe200('0x52')]['id']){delete _0x2e3e61['body']['id'];}return db[_0xe200('0x37')][_0xe200('0x50')]({'where':{'id':_0x2e3e61[_0xe200('0x4f')]['id']}})[_0xe200('0x31')](handleEntityNotFound(_0x155cc0,null))[_0xe200('0x31')](saveUpdates(_0x2e3e61[_0xe200('0x52')],null))['then'](respondWithResult(_0x155cc0,null))['catch'](handleError(_0x155cc0,null));};exports['destroy']=function(_0xec2ebd,_0x4b615f){return db[_0xe200('0x37')][_0xe200('0x50')]({'where':{'id':_0xec2ebd[_0xe200('0x4f')]['id']}})[_0xe200('0x31')](handleEntityNotFound(_0x4b615f,null))[_0xe200('0x31')](removeEntity(_0x4b615f,null))[_0xe200('0x26')](handleError(_0x4b615f,null));};exports['getFields']=function(_0x2e1016,_0x508a04,_0x28af47){var _0x14cf0e={};var _0x16fcb8={};var _0x4ca23f;var _0x548418;return db[_0xe200('0x37')][_0xe200('0x54')]({'where':{'id':_0x2e1016[_0xe200('0x4f')]['id']}})[_0xe200('0x31')](handleEntityNotFound(_0x508a04,null))['then'](function(_0x3da494){if(_0x3da494){_0x4ca23f=_0x3da494;_0x16fcb8[_0xe200('0x3b')]=_[_0xe200('0x3d')](db[_0xe200('0x55')][_0xe200('0x38')]);_0x16fcb8['query']=_[_0xe200('0x3d')](_0x2e1016['query']);_0x16fcb8['filters']=_['intersection'](_0x16fcb8[_0xe200('0x3b')],_0x16fcb8[_0xe200('0x3c')]);_0x14cf0e[_0xe200('0x3e')]=_[_0xe200('0x3f')](_0x16fcb8['model'],qs[_0xe200('0x40')](_0x2e1016[_0xe200('0x3c')][_0xe200('0x40')]));_0x14cf0e[_0xe200('0x3e')]=_0x14cf0e['attributes'][_0xe200('0x41')]?_0x14cf0e['attributes']:_0x16fcb8[_0xe200('0x3b')];_0x14cf0e[_0xe200('0x56')]=qs[_0xe200('0x45')](_0x2e1016[_0xe200('0x3c')][_0xe200('0x45')]);_0x14cf0e[_0xe200('0x46')]=qs[_0xe200('0x47')](_[_0xe200('0x48')](_0x2e1016['query'],_0x16fcb8[_0xe200('0x47')]));if(_0x2e1016[_0xe200('0x3c')]['filter']){_0x14cf0e[_0xe200('0x46')]=_[_0xe200('0x4a')](_0x14cf0e[_0xe200('0x46')],{'$or':_['map'](_0x14cf0e[_0xe200('0x3e')],function(_0x25d74b){var _0x3bbb80={};_0x3bbb80[_0x25d74b]={'$like':'%'+_0x2e1016[_0xe200('0x3c')][_0xe200('0x49')]+'%'};return _0x3bbb80;})});}_0x14cf0e=_[_0xe200('0x4a')]({},_0x14cf0e,_0x2e1016[_0xe200('0x4b')]);return _0x4ca23f[_0xe200('0x57')](_0x14cf0e);}})[_0xe200('0x31')](function(_0x428f34){if(_0x428f34){_0x548418=_0x428f34[_0xe200('0x41')];if(!_0x2e1016[_0xe200('0x3c')][_0xe200('0x42')](_0xe200('0x43'))){_0x14cf0e[_0xe200('0x44')]=qs[_0xe200('0x44')](_0x2e1016[_0xe200('0x3c')]['limit']);_0x14cf0e[_0xe200('0x2b')]=qs[_0xe200('0x2b')](_0x2e1016[_0xe200('0x3c')]['offset']);}return _0x4ca23f[_0xe200('0x57')](_0x14cf0e);}})['then'](function(_0x5c0950){if(_0x5c0950){return _0x5c0950?{'count':_0x548418,'rows':_0x5c0950}:null;}})[_0xe200('0x31')](respondWithResult(_0x508a04,null))['catch'](handleError(_0x508a04,null));};exports['getSubjects']=function(_0x37236f,_0x29204f,_0x5be694){var _0x1c96f1={};var _0x423a58={};var _0x2b09a1;var _0x567105;return db[_0xe200('0x37')]['findOne']({'where':{'id':_0x37236f[_0xe200('0x4f')]['id']}})[_0xe200('0x31')](handleEntityNotFound(_0x29204f,null))[_0xe200('0x31')](function(_0x1b7dd2){if(_0x1b7dd2){_0x2b09a1=_0x1b7dd2;_0x423a58['model']=_['keys'](db[_0xe200('0x55')][_0xe200('0x38')]);_0x423a58['query']=_[_0xe200('0x3d')](_0x37236f['query']);_0x423a58['filters']=_[_0xe200('0x3f')](_0x423a58[_0xe200('0x3b')],_0x423a58[_0xe200('0x3c')]);_0x1c96f1[_0xe200('0x3e')]=_[_0xe200('0x3f')](_0x423a58[_0xe200('0x3b')],qs[_0xe200('0x40')](_0x37236f['query'][_0xe200('0x40')]));_0x1c96f1[_0xe200('0x3e')]=_0x1c96f1[_0xe200('0x3e')][_0xe200('0x41')]?_0x1c96f1['attributes']:_0x423a58['model'];_0x1c96f1[_0xe200('0x56')]=qs[_0xe200('0x45')](_0x37236f[_0xe200('0x3c')]['sort']);_0x1c96f1[_0xe200('0x46')]=qs[_0xe200('0x47')](_['pick'](_0x37236f[_0xe200('0x3c')],_0x423a58[_0xe200('0x47')]));if(_0x37236f[_0xe200('0x3c')]['filter']){_0x1c96f1[_0xe200('0x46')]=_['merge'](_0x1c96f1[_0xe200('0x46')],{'$or':_[_0xe200('0x36')](_0x1c96f1[_0xe200('0x3e')],function(_0x1691c8){var _0x333a37={};_0x333a37[_0x1691c8]={'$like':'%'+_0x37236f[_0xe200('0x3c')][_0xe200('0x49')]+'%'};return _0x333a37;})});}_0x1c96f1=_[_0xe200('0x4a')]({},_0x1c96f1,_0x37236f[_0xe200('0x4b')]);return _0x2b09a1[_0xe200('0x58')](_0x1c96f1);}})[_0xe200('0x31')](function(_0x2eba89){if(_0x2eba89){_0x567105=_0x2eba89[_0xe200('0x41')];if(!_0x37236f[_0xe200('0x3c')][_0xe200('0x42')](_0xe200('0x43'))){_0x1c96f1[_0xe200('0x44')]=qs['limit'](_0x37236f[_0xe200('0x3c')]['limit']);_0x1c96f1[_0xe200('0x2b')]=qs[_0xe200('0x2b')](_0x37236f[_0xe200('0x3c')]['offset']);}return _0x2b09a1[_0xe200('0x58')](_0x1c96f1);}})[_0xe200('0x31')](function(_0xd1b910){if(_0xd1b910){return _0xd1b910?{'count':_0x567105,'rows':_0xd1b910}:null;}})[_0xe200('0x31')](respondWithResult(_0x29204f,null))[_0xe200('0x26')](handleError(_0x29204f,null));};exports[_0xe200('0x59')]=function(_0x5f3006,_0x1e2a11,_0xfd790c){var _0x28ab6b={};var _0x528419={};var _0x34b9b8;var _0x4bf850;return db[_0xe200('0x37')][_0xe200('0x54')]({'where':{'id':_0x5f3006[_0xe200('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1e2a11,null))[_0xe200('0x31')](function(_0x5a0fd6){if(_0x5a0fd6){_0x34b9b8=_0x5a0fd6;_0x528419[_0xe200('0x3b')]=_[_0xe200('0x3d')](db[_0xe200('0x55')]['rawAttributes']);_0x528419[_0xe200('0x3c')]=_[_0xe200('0x3d')](_0x5f3006['query']);_0x528419[_0xe200('0x47')]=_['intersection'](_0x528419[_0xe200('0x3b')],_0x528419[_0xe200('0x3c')]);_0x28ab6b[_0xe200('0x3e')]=_[_0xe200('0x3f')](_0x528419[_0xe200('0x3b')],qs[_0xe200('0x40')](_0x5f3006['query']['fields']));_0x28ab6b['attributes']=_0x28ab6b[_0xe200('0x3e')][_0xe200('0x41')]?_0x28ab6b[_0xe200('0x3e')]:_0x528419['model'];_0x28ab6b[_0xe200('0x56')]=qs[_0xe200('0x45')](_0x5f3006[_0xe200('0x3c')][_0xe200('0x45')]);_0x28ab6b[_0xe200('0x46')]=qs[_0xe200('0x47')](_['pick'](_0x5f3006['query'],_0x528419[_0xe200('0x47')]));if(_0x5f3006['query'][_0xe200('0x49')]){_0x28ab6b['where']=_[_0xe200('0x4a')](_0x28ab6b[_0xe200('0x46')],{'$or':_['map'](_0x28ab6b[_0xe200('0x3e')],function(_0x5d8a6f){var _0x42b1da={};_0x42b1da[_0x5d8a6f]={'$like':'%'+_0x5f3006[_0xe200('0x3c')][_0xe200('0x49')]+'%'};return _0x42b1da;})});}_0x28ab6b=_[_0xe200('0x4a')]({},_0x28ab6b,_0x5f3006[_0xe200('0x4b')]);return _0x34b9b8[_0xe200('0x59')](_0x28ab6b);}})[_0xe200('0x31')](function(_0x5e4006){if(_0x5e4006){_0x4bf850=_0x5e4006['length'];if(!_0x5f3006['query']['hasOwnProperty'](_0xe200('0x43'))){_0x28ab6b[_0xe200('0x44')]=qs[_0xe200('0x44')](_0x5f3006[_0xe200('0x3c')][_0xe200('0x44')]);_0x28ab6b[_0xe200('0x2b')]=qs[_0xe200('0x2b')](_0x5f3006[_0xe200('0x3c')][_0xe200('0x2b')]);}return _0x34b9b8['getDescriptions'](_0x28ab6b);}})[_0xe200('0x31')](function(_0x332745){if(_0x332745){return _0x332745?{'count':_0x4bf850,'rows':_0x332745}:null;}})[_0xe200('0x31')](respondWithResult(_0x1e2a11,null))[_0xe200('0x26')](handleError(_0x1e2a11,null));};
\ No newline at end of file
+var _0x8c1f=['zip-dir','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','include','SugarcrmConfiguration','findAll','rows','show','rawAttributes','find','create','body','params','getFields','findOne','SugarcrmField','order','pick','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8c1f,0x17d));var _0xf8c1=function(_0x377203,_0x258c59){_0x377203=_0x377203-0x0;var _0x4328e5=_0x8c1f[_0x377203];return _0x4328e5;};'use strict';var pdf=require(_0xf8c1('0x0'));var emlformat=require(_0xf8c1('0x1'));var rimraf=require(_0xf8c1('0x2'));var zipdir=require(_0xf8c1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8c1('0x4'));var moment=require(_0xf8c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf8c1('0x6'));var util=require(_0xf8c1('0x7'));var path=require(_0xf8c1('0x8'));var sox=require(_0xf8c1('0x9'));var csv=require('to-csv');var ejs=require(_0xf8c1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf8c1('0xb'));var crypto=require(_0xf8c1('0xc'));var jsforce=require(_0xf8c1('0xd'));var deskjs=require(_0xf8c1('0xe'));var toCsv=require(_0xf8c1('0xf'));var querystring=require('querystring');var Papa=require(_0xf8c1('0x10'));var Redis=require(_0xf8c1('0x11'));var authService=require(_0xf8c1('0x12'));var qs=require(_0xf8c1('0x13'));var as=require(_0xf8c1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8c1('0x15'))(_0xf8c1('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf8c1('0x17'))['db'];var jayson=require(_0xf8c1('0x18'));var client=jayson['client'][_0xf8c1('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4fe03f,_0x45c099,_0x478b99){if(_0x478b99){var _0x4ff447=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ff447[_0xf8c1('0x1a')](_0x45c099)){return _0x4fe03f;}else{throw new db[(_0xf8c1('0x1b'))]['ValidationError'](_0xf8c1('0x1c'));}}else{return _0x4fe03f;}}function respondWithRpcPromise(_0x20da98,_0x1f7135,_0x3286a9,_0x486ff4){return new BPromise(function(_0x3f8f33,_0x460dd3){var _0x43c615=_0x486ff4||client;return _0x43c615[_0xf8c1('0x1d')](_0x20da98,_0x3286a9)[_0xf8c1('0x1e')](function(_0x25fc3a){logger[_0xf8c1('0x1f')](_0xf8c1('0x20'),_0x1f7135,_0xf8c1('0x21'));logger[_0xf8c1('0x22')](_0xf8c1('0x23'),_0x1f7135,_0xf8c1('0x21'),JSON[_0xf8c1('0x24')](_0x25fc3a));if(_0x25fc3a['error']){if(_0x25fc3a[_0xf8c1('0x25')][_0xf8c1('0x26')]===0x1f4){logger['error'](_0xf8c1('0x20'),_0x1f7135,_0x25fc3a[_0xf8c1('0x25')][_0xf8c1('0x27')]);return _0x460dd3(_0x25fc3a[_0xf8c1('0x25')][_0xf8c1('0x27')]);}logger['error'](_0xf8c1('0x20'),_0x1f7135,_0x25fc3a[_0xf8c1('0x25')]['message']);return _0x3f8f33(_0x25fc3a['error'][_0xf8c1('0x27')]);}else{logger[_0xf8c1('0x1f')](_0xf8c1('0x20'),_0x1f7135,_0xf8c1('0x21'));_0x3f8f33(_0x25fc3a[_0xf8c1('0x28')][_0xf8c1('0x27')]);}})[_0xf8c1('0x29')](function(_0x357433){logger['error'](_0xf8c1('0x20'),_0x1f7135,_0x357433);_0x460dd3(_0x357433);});});}function respondWithStatusCode(_0x467371,_0x24715a){_0x24715a=_0x24715a||0xcc;return function(_0xd50f48){if(_0xd50f48){return _0x467371['sendStatus'](_0x24715a);}return _0x467371[_0xf8c1('0x2a')](_0x24715a)[_0xf8c1('0x2b')]();};}function respondWithResult(_0x3da6ad,_0x47703b){_0x47703b=_0x47703b||0xc8;return function(_0x45ab8a){if(_0x45ab8a){return _0x3da6ad['status'](_0x47703b)[_0xf8c1('0x2c')](_0x45ab8a);}};}function respondWithFilteredResult(_0x399184,_0x3b5511){return function(_0x23f9e5){if(_0x23f9e5){var _0x244d7f=_0x23f9e5[_0xf8c1('0x2d')],_0x4a1401=_0x3b5511['offset'],_0x5b7787=_0x3b5511[_0xf8c1('0x2e')]+_0x3b5511[_0xf8c1('0x2f')],_0x118bd1;if(_0x5b7787>=_0x244d7f){_0x5b7787=_0x244d7f;_0x118bd1=0xc8;}else{_0x118bd1=0xce;}_0x399184[_0xf8c1('0x2a')](_0x118bd1);return _0x399184['set'](_0xf8c1('0x30'),_0x4a1401+'-'+_0x5b7787+'/'+_0x244d7f)[_0xf8c1('0x2c')](_0x23f9e5);}return null;};}function patchUpdates(_0x5837ad){return function(_0x5d1900){try{jsonpatch[_0xf8c1('0x31')](_0x5d1900,_0x5837ad,!![]);}catch(_0x429d82){return BPromise[_0xf8c1('0x32')](_0x429d82);}return _0x5d1900[_0xf8c1('0x33')]();};}function saveUpdates(_0x7ab527,_0x8f6b51){return function(_0x5cdecd){if(_0x5cdecd){return _0x5cdecd[_0xf8c1('0x34')](_0x7ab527)[_0xf8c1('0x1e')](function(_0x61dbd9){return _0x61dbd9;});}return null;};}function removeEntity(_0x32d1a2,_0x15d42f){return function(_0x70a4ee){if(_0x70a4ee){return _0x70a4ee[_0xf8c1('0x35')]()[_0xf8c1('0x1e')](function(){_0x32d1a2['status'](0xcc)[_0xf8c1('0x2b')]();});}};}function handleEntityNotFound(_0x226207,_0x2dc4ff){return function(_0x4495b1){if(!_0x4495b1){_0x226207[_0xf8c1('0x36')](0x194);}return _0x4495b1;};}function handleError(_0x38e83e,_0x2bb1bf){_0x2bb1bf=_0x2bb1bf||0x1f4;return function(_0x2b4d85){logger[_0xf8c1('0x25')](_0x2b4d85[_0xf8c1('0x37')]);if(_0x2b4d85['name']){delete _0x2b4d85[_0xf8c1('0x38')];}_0x38e83e[_0xf8c1('0x2a')](_0x2bb1bf)[_0xf8c1('0x39')](_0x2b4d85);};}exports[_0xf8c1('0x3a')]=function(_0x5b9e02,_0x3ccb05){var _0x38c231={},_0x582dd9={},_0x2f2389={'count':0x0,'rows':[]};var _0x25bcff=_[_0xf8c1('0x3b')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x39c480){return{'name':_0x39c480[_0xf8c1('0x3c')],'type':_0x39c480[_0xf8c1('0x3d')][_0xf8c1('0x3e')]};});_0x582dd9[_0xf8c1('0x3f')]=_[_0xf8c1('0x3b')](_0x25bcff,'name');_0x582dd9[_0xf8c1('0x40')]=_[_0xf8c1('0x41')](_0x5b9e02[_0xf8c1('0x40')]);_0x582dd9[_0xf8c1('0x42')]=_['intersection'](_0x582dd9[_0xf8c1('0x3f')],_0x582dd9[_0xf8c1('0x40')]);_0x38c231[_0xf8c1('0x43')]=_[_0xf8c1('0x44')](_0x582dd9[_0xf8c1('0x3f')],qs[_0xf8c1('0x45')](_0x5b9e02[_0xf8c1('0x40')][_0xf8c1('0x45')]));_0x38c231[_0xf8c1('0x43')]=_0x38c231['attributes'][_0xf8c1('0x46')]?_0x38c231['attributes']:_0x582dd9[_0xf8c1('0x3f')];if(!_0x5b9e02['query']['hasOwnProperty'](_0xf8c1('0x47'))){_0x38c231['limit']=qs['limit'](_0x5b9e02[_0xf8c1('0x40')][_0xf8c1('0x2f')]);_0x38c231[_0xf8c1('0x2e')]=qs[_0xf8c1('0x2e')](_0x5b9e02['query'][_0xf8c1('0x2e')]);}_0x38c231['order']=qs[_0xf8c1('0x48')](_0x5b9e02[_0xf8c1('0x40')]['sort']);_0x38c231['where']=qs['filters'](_['pick'](_0x5b9e02[_0xf8c1('0x40')],_0x582dd9[_0xf8c1('0x42')]),_0x25bcff);if(_0x5b9e02['query'][_0xf8c1('0x49')]){_0x38c231[_0xf8c1('0x4a')]=_[_0xf8c1('0x4b')](_0x38c231['where'],{'$or':_[_0xf8c1('0x3b')](_0x25bcff,function(_0x5bc7c8){if(_0x5bc7c8[_0xf8c1('0x3d')]!==_0xf8c1('0x4c')){var _0x39a698={};_0x39a698[_0x5bc7c8[_0xf8c1('0x38')]]={'$like':'%'+_0x5b9e02[_0xf8c1('0x40')][_0xf8c1('0x49')]+'%'};return _0x39a698;}})});}_0x38c231=_[_0xf8c1('0x4b')]({},_0x38c231,_0x5b9e02[_0xf8c1('0x4d')]);var _0x264ae2={'where':_0x38c231[_0xf8c1('0x4a')]};return db['SugarcrmConfiguration'][_0xf8c1('0x2d')](_0x264ae2)['then'](function(_0x40516f){_0x2f2389[_0xf8c1('0x2d')]=_0x40516f;if(_0x5b9e02['query']['includeAll']){_0x38c231[_0xf8c1('0x4e')]=[{'all':!![]}];}return db[_0xf8c1('0x4f')][_0xf8c1('0x50')](_0x38c231);})[_0xf8c1('0x1e')](function(_0xa74c50){_0x2f2389[_0xf8c1('0x51')]=_0xa74c50;return _0x2f2389;})[_0xf8c1('0x1e')](respondWithFilteredResult(_0x3ccb05,_0x38c231))[_0xf8c1('0x29')](handleError(_0x3ccb05,null));};exports[_0xf8c1('0x52')]=function(_0x14d02d,_0x32fa5d){var _0x34dd54={'raw':![],'where':{'id':_0x14d02d['params']['id']}},_0x6cd588={};_0x6cd588[_0xf8c1('0x3f')]=_[_0xf8c1('0x41')](db[_0xf8c1('0x4f')][_0xf8c1('0x53')]);_0x6cd588[_0xf8c1('0x40')]=_['keys'](_0x14d02d[_0xf8c1('0x40')]);_0x6cd588[_0xf8c1('0x42')]=_[_0xf8c1('0x44')](_0x6cd588['model'],_0x6cd588[_0xf8c1('0x40')]);_0x34dd54[_0xf8c1('0x43')]=_['intersection'](_0x6cd588[_0xf8c1('0x3f')],qs[_0xf8c1('0x45')](_0x14d02d[_0xf8c1('0x40')]['fields']));_0x34dd54[_0xf8c1('0x43')]=_0x34dd54[_0xf8c1('0x43')][_0xf8c1('0x46')]?_0x34dd54[_0xf8c1('0x43')]:_0x6cd588[_0xf8c1('0x3f')];if(_0x14d02d[_0xf8c1('0x40')]['includeAll']){_0x34dd54[_0xf8c1('0x4e')]=[{'all':!![]}];}_0x34dd54=_['merge']({},_0x34dd54,_0x14d02d['options']);return db[_0xf8c1('0x4f')][_0xf8c1('0x54')](_0x34dd54)[_0xf8c1('0x1e')](handleEntityNotFound(_0x32fa5d,null))[_0xf8c1('0x1e')](respondWithResult(_0x32fa5d,null))[_0xf8c1('0x29')](handleError(_0x32fa5d,null));};exports[_0xf8c1('0x55')]=function(_0x3d3274,_0x55b72c){return db['SugarcrmConfiguration']['create'](_0x3d3274[_0xf8c1('0x56')],{})[_0xf8c1('0x1e')](respondWithResult(_0x55b72c,0xc9))['catch'](handleError(_0x55b72c,null));};exports[_0xf8c1('0x34')]=function(_0x24df80,_0x450058){if(_0x24df80[_0xf8c1('0x56')]['id']){delete _0x24df80['body']['id'];}return db[_0xf8c1('0x4f')][_0xf8c1('0x54')]({'where':{'id':_0x24df80[_0xf8c1('0x57')]['id']}})[_0xf8c1('0x1e')](handleEntityNotFound(_0x450058,null))[_0xf8c1('0x1e')](saveUpdates(_0x24df80[_0xf8c1('0x56')],null))[_0xf8c1('0x1e')](respondWithResult(_0x450058,null))[_0xf8c1('0x29')](handleError(_0x450058,null));};exports[_0xf8c1('0x35')]=function(_0x201b5b,_0x281a52){return db['SugarcrmConfiguration'][_0xf8c1('0x54')]({'where':{'id':_0x201b5b[_0xf8c1('0x57')]['id']}})[_0xf8c1('0x1e')](handleEntityNotFound(_0x281a52,null))[_0xf8c1('0x1e')](removeEntity(_0x281a52,null))[_0xf8c1('0x29')](handleError(_0x281a52,null));};exports[_0xf8c1('0x58')]=function(_0x47540d,_0x16322d,_0xb1c00a){var _0x2328cd={};var _0x11bc3f={};var _0x179e28;var _0x1d3bfc;return db[_0xf8c1('0x4f')][_0xf8c1('0x59')]({'where':{'id':_0x47540d[_0xf8c1('0x57')]['id']}})['then'](handleEntityNotFound(_0x16322d,null))['then'](function(_0x1c5c51){if(_0x1c5c51){_0x179e28=_0x1c5c51;_0x11bc3f['model']=_['keys'](db[_0xf8c1('0x5a')]['rawAttributes']);_0x11bc3f[_0xf8c1('0x40')]=_['keys'](_0x47540d[_0xf8c1('0x40')]);_0x11bc3f[_0xf8c1('0x42')]=_[_0xf8c1('0x44')](_0x11bc3f[_0xf8c1('0x3f')],_0x11bc3f[_0xf8c1('0x40')]);_0x2328cd[_0xf8c1('0x43')]=_[_0xf8c1('0x44')](_0x11bc3f[_0xf8c1('0x3f')],qs['fields'](_0x47540d[_0xf8c1('0x40')][_0xf8c1('0x45')]));_0x2328cd[_0xf8c1('0x43')]=_0x2328cd[_0xf8c1('0x43')][_0xf8c1('0x46')]?_0x2328cd[_0xf8c1('0x43')]:_0x11bc3f[_0xf8c1('0x3f')];_0x2328cd[_0xf8c1('0x5b')]=qs[_0xf8c1('0x48')](_0x47540d['query']['sort']);_0x2328cd[_0xf8c1('0x4a')]=qs[_0xf8c1('0x42')](_[_0xf8c1('0x5c')](_0x47540d[_0xf8c1('0x40')],_0x11bc3f[_0xf8c1('0x42')]));if(_0x47540d['query'][_0xf8c1('0x49')]){_0x2328cd[_0xf8c1('0x4a')]=_[_0xf8c1('0x4b')](_0x2328cd[_0xf8c1('0x4a')],{'$or':_[_0xf8c1('0x3b')](_0x2328cd['attributes'],function(_0x362e0f){var _0x5e3066={};_0x5e3066[_0x362e0f]={'$like':'%'+_0x47540d[_0xf8c1('0x40')]['filter']+'%'};return _0x5e3066;})});}_0x2328cd=_[_0xf8c1('0x4b')]({},_0x2328cd,_0x47540d[_0xf8c1('0x4d')]);return _0x179e28[_0xf8c1('0x58')](_0x2328cd);}})['then'](function(_0x383439){if(_0x383439){_0x1d3bfc=_0x383439[_0xf8c1('0x46')];if(!_0x47540d[_0xf8c1('0x40')][_0xf8c1('0x5d')](_0xf8c1('0x47'))){_0x2328cd[_0xf8c1('0x2f')]=qs[_0xf8c1('0x2f')](_0x47540d[_0xf8c1('0x40')][_0xf8c1('0x2f')]);_0x2328cd['offset']=qs[_0xf8c1('0x2e')](_0x47540d[_0xf8c1('0x40')][_0xf8c1('0x2e')]);}return _0x179e28[_0xf8c1('0x58')](_0x2328cd);}})[_0xf8c1('0x1e')](function(_0x3ed6d7){if(_0x3ed6d7){return _0x3ed6d7?{'count':_0x1d3bfc,'rows':_0x3ed6d7}:null;}})[_0xf8c1('0x1e')](respondWithResult(_0x16322d,null))[_0xf8c1('0x29')](handleError(_0x16322d,null));};exports[_0xf8c1('0x5e')]=function(_0xe97e22,_0x232739,_0x32c13e){var _0x3564a3={};var _0x157e67={};var _0x14dab9;var _0xb284c1;return db[_0xf8c1('0x4f')][_0xf8c1('0x59')]({'where':{'id':_0xe97e22[_0xf8c1('0x57')]['id']}})['then'](handleEntityNotFound(_0x232739,null))[_0xf8c1('0x1e')](function(_0x3ab2b4){if(_0x3ab2b4){_0x14dab9=_0x3ab2b4;_0x157e67['model']=_[_0xf8c1('0x41')](db[_0xf8c1('0x5a')][_0xf8c1('0x53')]);_0x157e67[_0xf8c1('0x40')]=_[_0xf8c1('0x41')](_0xe97e22[_0xf8c1('0x40')]);_0x157e67[_0xf8c1('0x42')]=_[_0xf8c1('0x44')](_0x157e67[_0xf8c1('0x3f')],_0x157e67[_0xf8c1('0x40')]);_0x3564a3['attributes']=_[_0xf8c1('0x44')](_0x157e67[_0xf8c1('0x3f')],qs['fields'](_0xe97e22['query'][_0xf8c1('0x45')]));_0x3564a3[_0xf8c1('0x43')]=_0x3564a3[_0xf8c1('0x43')]['length']?_0x3564a3[_0xf8c1('0x43')]:_0x157e67[_0xf8c1('0x3f')];_0x3564a3[_0xf8c1('0x5b')]=qs[_0xf8c1('0x48')](_0xe97e22['query']['sort']);_0x3564a3[_0xf8c1('0x4a')]=qs['filters'](_['pick'](_0xe97e22[_0xf8c1('0x40')],_0x157e67[_0xf8c1('0x42')]));if(_0xe97e22[_0xf8c1('0x40')][_0xf8c1('0x49')]){_0x3564a3[_0xf8c1('0x4a')]=_['merge'](_0x3564a3[_0xf8c1('0x4a')],{'$or':_[_0xf8c1('0x3b')](_0x3564a3[_0xf8c1('0x43')],function(_0xf035b6){var _0x14981e={};_0x14981e[_0xf035b6]={'$like':'%'+_0xe97e22[_0xf8c1('0x40')][_0xf8c1('0x49')]+'%'};return _0x14981e;})});}_0x3564a3=_['merge']({},_0x3564a3,_0xe97e22[_0xf8c1('0x4d')]);return _0x14dab9[_0xf8c1('0x5e')](_0x3564a3);}})['then'](function(_0x12e24f){if(_0x12e24f){_0xb284c1=_0x12e24f[_0xf8c1('0x46')];if(!_0xe97e22[_0xf8c1('0x40')][_0xf8c1('0x5d')](_0xf8c1('0x47'))){_0x3564a3[_0xf8c1('0x2f')]=qs[_0xf8c1('0x2f')](_0xe97e22['query']['limit']);_0x3564a3['offset']=qs[_0xf8c1('0x2e')](_0xe97e22['query'][_0xf8c1('0x2e')]);}return _0x14dab9[_0xf8c1('0x5e')](_0x3564a3);}})[_0xf8c1('0x1e')](function(_0x4ecf42){if(_0x4ecf42){return _0x4ecf42?{'count':_0xb284c1,'rows':_0x4ecf42}:null;}})[_0xf8c1('0x1e')](respondWithResult(_0x232739,null))[_0xf8c1('0x29')](handleError(_0x232739,null));};exports[_0xf8c1('0x5f')]=function(_0x440d73,_0x11ec55,_0x569b03){var _0x204d9a={};var _0x419918={};var _0x4a88c4;var _0x26ca39;return db[_0xf8c1('0x4f')]['findOne']({'where':{'id':_0x440d73['params']['id']}})['then'](handleEntityNotFound(_0x11ec55,null))[_0xf8c1('0x1e')](function(_0x49a2fb){if(_0x49a2fb){_0x4a88c4=_0x49a2fb;_0x419918['model']=_[_0xf8c1('0x41')](db[_0xf8c1('0x5a')][_0xf8c1('0x53')]);_0x419918[_0xf8c1('0x40')]=_[_0xf8c1('0x41')](_0x440d73[_0xf8c1('0x40')]);_0x419918[_0xf8c1('0x42')]=_['intersection'](_0x419918['model'],_0x419918[_0xf8c1('0x40')]);_0x204d9a[_0xf8c1('0x43')]=_[_0xf8c1('0x44')](_0x419918[_0xf8c1('0x3f')],qs[_0xf8c1('0x45')](_0x440d73[_0xf8c1('0x40')][_0xf8c1('0x45')]));_0x204d9a[_0xf8c1('0x43')]=_0x204d9a[_0xf8c1('0x43')][_0xf8c1('0x46')]?_0x204d9a['attributes']:_0x419918['model'];_0x204d9a[_0xf8c1('0x5b')]=qs[_0xf8c1('0x48')](_0x440d73['query'][_0xf8c1('0x48')]);_0x204d9a[_0xf8c1('0x4a')]=qs[_0xf8c1('0x42')](_[_0xf8c1('0x5c')](_0x440d73['query'],_0x419918[_0xf8c1('0x42')]));if(_0x440d73[_0xf8c1('0x40')]['filter']){_0x204d9a['where']=_[_0xf8c1('0x4b')](_0x204d9a[_0xf8c1('0x4a')],{'$or':_[_0xf8c1('0x3b')](_0x204d9a['attributes'],function(_0x414bd7){var _0x2ce5cc={};_0x2ce5cc[_0x414bd7]={'$like':'%'+_0x440d73['query']['filter']+'%'};return _0x2ce5cc;})});}_0x204d9a=_[_0xf8c1('0x4b')]({},_0x204d9a,_0x440d73[_0xf8c1('0x4d')]);return _0x4a88c4['getDescriptions'](_0x204d9a);}})[_0xf8c1('0x1e')](function(_0x3e5746){if(_0x3e5746){_0x26ca39=_0x3e5746['length'];if(!_0x440d73[_0xf8c1('0x40')][_0xf8c1('0x5d')](_0xf8c1('0x47'))){_0x204d9a[_0xf8c1('0x2f')]=qs[_0xf8c1('0x2f')](_0x440d73['query'][_0xf8c1('0x2f')]);_0x204d9a['offset']=qs[_0xf8c1('0x2e')](_0x440d73[_0xf8c1('0x40')][_0xf8c1('0x2e')]);}return _0x4a88c4[_0xf8c1('0x5f')](_0x204d9a);}})[_0xf8c1('0x1e')](function(_0x4bc9bd){if(_0x4bc9bd){return _0x4bc9bd?{'count':_0x26ca39,'rows':_0x4bc9bd}:null;}})[_0xf8c1('0x1e')](respondWithResult(_0x11ec55,null))[_0xf8c1('0x29')](handleError(_0x11ec55,null));};
\ No newline at end of file
index a805eb7..0dea4c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f19=['request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x151144,_0xa664db){var _0x2526ef=function(_0x99baa6){while(--_0x99baa6){_0x151144['push'](_0x151144['shift']());}};_0x2526ef(++_0xa664db);}(_0x4f19,0x1a8));var _0x94f1=function(_0x1e50a4,_0x5bdfc2){_0x1e50a4=_0x1e50a4-0x0;var _0x1e13c5=_0x4f19[_0x1e50a4];return _0x1e13c5;};'use strict';var _=require(_0x94f1('0x0'));var util=require(_0x94f1('0x1'));var logger=require(_0x94f1('0x2'))(_0x94f1('0x3'));var moment=require(_0x94f1('0x4'));var BPromise=require('bluebird');var rp=require(_0x94f1('0x5'));var fs=require('fs');var path=require(_0x94f1('0x6'));var rimraf=require(_0x94f1('0x7'));var config=require(_0x94f1('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x94f1('0x9')]=function(_0x15f48e,_0x54f38c){return _0x15f48e[_0x94f1('0xa')](_0x94f1('0xb'),attributes,{'tableName':_0x94f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x46d9=['int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x19a90e,_0xe14b0b){var _0xa49b11=function(_0x560f76){while(--_0x560f76){_0x19a90e['push'](_0x19a90e['shift']());}};_0xa49b11(++_0xe14b0b);}(_0x46d9,0x16d));var _0x946d=function(_0x3d65ff,_0x33d4ce){_0x3d65ff=_0x3d65ff-0x0;var _0x439740=_0x46d9[_0x3d65ff];return _0x439740;};'use strict';var _=require(_0x946d('0x0'));var util=require(_0x946d('0x1'));var logger=require(_0x946d('0x2'))(_0x946d('0x3'));var moment=require('moment');var BPromise=require(_0x946d('0x4'));var rp=require(_0x946d('0x5'));var fs=require('fs');var path=require(_0x946d('0x6'));var rimraf=require(_0x946d('0x7'));var config=require('../../config/environment');var attributes=require(_0x946d('0x8'));module[_0x946d('0x9')]=function(_0x583c91,_0x21b6e7){return _0x583c91[_0x946d('0xa')](_0x946d('0xb'),attributes,{'tableName':_0x946d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e0a2349..dd38052 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x870b=['jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x870b,0xf3));var _0xb870=function(_0x1b30b1,_0x4358ff){_0x1b30b1=_0x1b30b1-0x0;var _0x22b071=_0x870b[_0x1b30b1];return _0x22b071;};'use strict';var _=require(_0xb870('0x0'));var util=require(_0xb870('0x1'));var moment=require(_0xb870('0x2'));var BPromise=require(_0xb870('0x3'));var rs=require(_0xb870('0x4'));var fs=require('fs');var Redis=require(_0xb870('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb870('0x6'));var logger=require(_0xb870('0x7'))(_0xb870('0x8'));var config=require(_0xb870('0x9'));var jayson=require(_0xb870('0xa'));var client=jayson[_0xb870('0xb')][_0xb870('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47f64d,_0x3c45d8,_0x4b68cc){return new BPromise(function(_0x51d147,_0x6f0fd4){return client[_0xb870('0xd')](_0x47f64d,_0x4b68cc)[_0xb870('0xe')](function(_0x23edcf){logger[_0xb870('0xf')](_0xb870('0x10'),_0x3c45d8,'request\x20sent');logger[_0xb870('0x11')](_0xb870('0x12'),_0x3c45d8,'request\x20sent',JSON['stringify'](_0x23edcf));if(_0x23edcf[_0xb870('0x13')]){if(_0x23edcf[_0xb870('0x13')][_0xb870('0x14')]===0x1f4){logger[_0xb870('0x13')](_0xb870('0x10'),_0x3c45d8,_0x23edcf['error']['message']);return _0x6f0fd4(_0x23edcf['error'][_0xb870('0x15')]);}logger[_0xb870('0x13')](_0xb870('0x10'),_0x3c45d8,_0x23edcf[_0xb870('0x13')][_0xb870('0x15')]);return _0x51d147(_0x23edcf['error'][_0xb870('0x15')]);}else{logger[_0xb870('0xf')](_0xb870('0x10'),_0x3c45d8,_0xb870('0x16'));_0x51d147(_0x23edcf['result']['message']);}})['catch'](function(_0x206919){logger[_0xb870('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3c45d8,_0x206919);_0x6f0fd4(_0x206919);});});}
\ No newline at end of file
+var _0x61b6=['jayson/promise','client','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1300b6,_0x1b4efe){var _0x23a0e3=function(_0x22ae84){while(--_0x22ae84){_0x1300b6['push'](_0x1300b6['shift']());}};_0x23a0e3(++_0x1b4efe);}(_0x61b6,0xfa));var _0x661b=function(_0x2e3554,_0x32a66d){_0x2e3554=_0x2e3554-0x0;var _0x3870d2=_0x61b6[_0x2e3554];return _0x3870d2;};'use strict';var _=require(_0x661b('0x0'));var util=require(_0x661b('0x1'));var moment=require(_0x661b('0x2'));var BPromise=require(_0x661b('0x3'));var rs=require(_0x661b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x661b('0x5'))['db'];var utils=require(_0x661b('0x6'));var logger=require(_0x661b('0x7'))(_0x661b('0x8'));var config=require(_0x661b('0x9'));var jayson=require(_0x661b('0xa'));var client=jayson[_0x661b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2913a0,_0x405d96,_0x548c29){return new BPromise(function(_0x3e959f,_0x129041){return client['request'](_0x2913a0,_0x548c29)[_0x661b('0xc')](function(_0x1f2a8a){logger['info'](_0x661b('0xd'),_0x405d96,_0x661b('0xe'));logger[_0x661b('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x405d96,_0x661b('0xe'),JSON['stringify'](_0x1f2a8a));if(_0x1f2a8a[_0x661b('0x10')]){if(_0x1f2a8a[_0x661b('0x10')][_0x661b('0x11')]===0x1f4){logger[_0x661b('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x405d96,_0x1f2a8a['error'][_0x661b('0x12')]);return _0x129041(_0x1f2a8a[_0x661b('0x10')]['message']);}logger[_0x661b('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x405d96,_0x1f2a8a[_0x661b('0x10')]['message']);return _0x3e959f(_0x1f2a8a[_0x661b('0x10')][_0x661b('0x12')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x405d96,'request\x20sent');_0x3e959f(_0x1f2a8a[_0x661b('0x13')][_0x661b('0x12')]);}})['catch'](function(_0x29ee53){logger['error'](_0x661b('0xd'),_0x405d96,_0x29ee53);_0x129041(_0x29ee53);});});}
\ No newline at end of file
index e41e11c..49a6af9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec3f=['/:id','destroy','exports','multer','util','path','connect-timeout','get','isAuthenticated','index','post','create','put'];(function(_0x2c2120,_0x2ecc75){var _0x180af1=function(_0x29d167){while(--_0x29d167){_0x2c2120['push'](_0x2c2120['shift']());}};_0x180af1(++_0x2ecc75);}(_0xec3f,0x16f));var _0xfec3=function(_0x3d5656,_0x25f158){_0x3d5656=_0x3d5656-0x0;var _0x3a936b=_0xec3f[_0x3d5656];return _0x3a936b;};'use strict';var multer=require(_0xfec3('0x0'));var util=require(_0xfec3('0x1'));var path=require(_0xfec3('0x2'));var timeout=require(_0xfec3('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0xfec3('0x4')]('/',auth[_0xfec3('0x5')](),controller[_0xfec3('0x6')]);router[_0xfec3('0x4')]('/:id',auth[_0xfec3('0x5')](),controller['show']);router[_0xfec3('0x7')]('/',auth[_0xfec3('0x5')](),controller[_0xfec3('0x8')]);router[_0xfec3('0x9')](_0xfec3('0xa'),auth[_0xfec3('0x5')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfec3('0xb')]);module[_0xfec3('0xc')]=router;
\ No newline at end of file
+var _0x7d8b=['../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','create','update','delete','destroy','multer','path','express'];(function(_0x31b8e4,_0x4613a8){var _0x53ffd0=function(_0x31b8e7){while(--_0x31b8e7){_0x31b8e4['push'](_0x31b8e4['shift']());}};_0x53ffd0(++_0x4613a8);}(_0x7d8b,0x10e));var _0xb7d8=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0x7d8b[_0x403c8d];return _0x4ca60d;};'use strict';var multer=require(_0xb7d8('0x0'));var util=require('util');var path=require(_0xb7d8('0x1'));var timeout=require('connect-timeout');var express=require(_0xb7d8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb7d8('0x3'));var controller=require(_0xb7d8('0x4'));router[_0xb7d8('0x5')]('/',auth[_0xb7d8('0x6')](),controller['index']);router[_0xb7d8('0x5')](_0xb7d8('0x7'),auth[_0xb7d8('0x6')](),controller[_0xb7d8('0x8')]);router['post']('/',auth[_0xb7d8('0x6')](),controller[_0xb7d8('0x9')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb7d8('0xa')]);router[_0xb7d8('0xb')](_0xb7d8('0x7'),auth['isAuthenticated'](),controller[_0xb7d8('0xc')]);module['exports']=router;
\ No newline at end of file
index 760ef29..30db68f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadae=['sequelize','exports','ENUM','STRING','string','variable','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadae,0x134));var _0xeada=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xadae[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0xeada('0x0'));module[_0xeada('0x1')]={'type':{'type':Sequelize[_0xeada('0x2')]('string','variable','customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xeada('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0xeada('0x4'),_0xeada('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xeada('0x3')]},'nameField':{'type':Sequelize[_0xeada('0x3')]},'customField':{'type':Sequelize[_0xeada('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeada('0x3')]}};
\ No newline at end of file
+var _0x1c5b=['variable','STRING','BOOLEAN','ENUM','string'];(function(_0x36f4b4,_0x260f17){var _0x46b4a8=function(_0x516a65){while(--_0x516a65){_0x36f4b4['push'](_0x36f4b4['shift']());}};_0x46b4a8(++_0x260f17);}(_0x1c5b,0x184));var _0xb1c5=function(_0x54aee5,_0x3bf93e){_0x54aee5=_0x54aee5-0x0;var _0xb9d998=_0x1c5b[_0x54aee5];return _0xb9d998;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb1c5('0x0')](_0xb1c5('0x1'),_0xb1c5('0x2'),'customVariable','keyValue'),'defaultValue':_0xb1c5('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb1c5('0x3')]},'keyType':{'type':Sequelize[_0xb1c5('0x0')](_0xb1c5('0x1'),_0xb1c5('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xb1c5('0x3')]},'idField':{'type':Sequelize[_0xb1c5('0x3')]},'nameField':{'type':Sequelize[_0xb1c5('0x3')]},'customField':{'type':Sequelize[_0xb1c5('0x4')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb1c5('0x3')]}};
\ No newline at end of file
index c6214eb..3b41db7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6861=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SugarcrmField','includeAll','include','findAll','rows','options','find','create','body','catch','update','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger'];(function(_0x3e4ac6,_0xee2ec6){var _0x12fb8a=function(_0x2bb18d){while(--_0x2bb18d){_0x3e4ac6['push'](_0x3e4ac6['shift']());}};_0x12fb8a(++_0xee2ec6);}(_0x6861,0x109));var _0x1686=function(_0x4f24ca,_0x27c3b5){_0x4f24ca=_0x4f24ca-0x0;var _0x1cb93b=_0x6861[_0x4f24ca];return _0x1cb93b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1686('0x0'));var rimraf=require(_0x1686('0x1'));var zipdir=require(_0x1686('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1686('0x3'));var BPromise=require(_0x1686('0x4'));var Mustache=require(_0x1686('0x5'));var util=require(_0x1686('0x6'));var path=require(_0x1686('0x7'));var sox=require(_0x1686('0x8'));var csv=require(_0x1686('0x9'));var ejs=require(_0x1686('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1686('0xb'));var crypto=require(_0x1686('0xc'));var jsforce=require(_0x1686('0xd'));var deskjs=require(_0x1686('0xe'));var toCsv=require(_0x1686('0x9'));var querystring=require(_0x1686('0xf'));var Papa=require('papaparse');var Redis=require(_0x1686('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1686('0x11'));var logger=require(_0x1686('0x12'))(_0x1686('0x13'));var utils=require(_0x1686('0x14'));var config=require(_0x1686('0x15'));var db=require(_0x1686('0x16'))['db'];function respondWithStatusCode(_0x48ab43,_0x7a12b2){_0x7a12b2=_0x7a12b2||0xcc;return function(_0x5a5bd1){if(_0x5a5bd1){return _0x48ab43[_0x1686('0x17')](_0x7a12b2);}return _0x48ab43[_0x1686('0x18')](_0x7a12b2)[_0x1686('0x19')]();};}function respondWithResult(_0x16fd7b,_0x507ab0){_0x507ab0=_0x507ab0||0xc8;return function(_0x473e29){if(_0x473e29){return _0x16fd7b[_0x1686('0x18')](_0x507ab0)[_0x1686('0x1a')](_0x473e29);}};}function respondWithFilteredResult(_0x33c5f6,_0x52f143){return function(_0x2c82b0){if(_0x2c82b0){var _0xc0f5d8=_0x2c82b0[_0x1686('0x1b')],_0x4b7259=_0x52f143[_0x1686('0x1c')],_0x37b007=_0x52f143[_0x1686('0x1c')]+_0x52f143['limit'],_0x152ab6;if(_0x37b007>=_0xc0f5d8){_0x37b007=_0xc0f5d8;_0x152ab6=0xc8;}else{_0x152ab6=0xce;}_0x33c5f6['status'](_0x152ab6);return _0x33c5f6['set']('Content-Range',_0x4b7259+'-'+_0x37b007+'/'+_0xc0f5d8)['json'](_0x2c82b0);}return null;};}function patchUpdates(_0x1db729){return function(_0xd94eaf){try{jsonpatch[_0x1686('0x1d')](_0xd94eaf,_0x1db729,!![]);}catch(_0x20cfd4){return BPromise[_0x1686('0x1e')](_0x20cfd4);}return _0xd94eaf[_0x1686('0x1f')]();};}function saveUpdates(_0x179307,_0x4d8b91){return function(_0x30f1b0){if(_0x30f1b0){return _0x30f1b0['update'](_0x179307)[_0x1686('0x20')](function(_0x23fd32){return _0x23fd32;});}return null;};}function removeEntity(_0x66e6ad,_0x2386a2){return function(_0x1701d6){if(_0x1701d6){return _0x1701d6[_0x1686('0x21')]()[_0x1686('0x20')](function(){_0x66e6ad[_0x1686('0x18')](0xcc)[_0x1686('0x19')]();});}};}function handleEntityNotFound(_0x3dc697,_0x93950b){return function(_0x3b5dbd){if(!_0x3b5dbd){_0x3dc697[_0x1686('0x17')](0x194);}return _0x3b5dbd;};}function handleError(_0x2b9067,_0x2e0978){_0x2e0978=_0x2e0978||0x1f4;return function(_0x42456f){logger[_0x1686('0x22')](_0x42456f[_0x1686('0x23')]);if(_0x42456f[_0x1686('0x24')]){delete _0x42456f[_0x1686('0x24')];}_0x2b9067[_0x1686('0x18')](_0x2e0978)['send'](_0x42456f);};}exports[_0x1686('0x25')]=function(_0x1bdffb,_0x3a4706){var _0x5769c5={},_0x4e9b1f={},_0x362445={'count':0x0,'rows':[]};var _0xf37857=_['map'](db['SugarcrmField'][_0x1686('0x26')],function(_0x31c485){return{'name':_0x31c485[_0x1686('0x27')],'type':_0x31c485[_0x1686('0x28')]['key']};});_0x4e9b1f[_0x1686('0x29')]=_[_0x1686('0x2a')](_0xf37857,_0x1686('0x24'));_0x4e9b1f[_0x1686('0x2b')]=_[_0x1686('0x2c')](_0x1bdffb['query']);_0x4e9b1f[_0x1686('0x2d')]=_['intersection'](_0x4e9b1f[_0x1686('0x29')],_0x4e9b1f['query']);_0x5769c5[_0x1686('0x2e')]=_[_0x1686('0x2f')](_0x4e9b1f[_0x1686('0x29')],qs[_0x1686('0x30')](_0x1bdffb[_0x1686('0x2b')]['fields']));_0x5769c5[_0x1686('0x2e')]=_0x5769c5['attributes'][_0x1686('0x31')]?_0x5769c5['attributes']:_0x4e9b1f['model'];if(!_0x1bdffb[_0x1686('0x2b')]['hasOwnProperty'](_0x1686('0x32'))){_0x5769c5[_0x1686('0x33')]=qs[_0x1686('0x33')](_0x1bdffb[_0x1686('0x2b')][_0x1686('0x33')]);_0x5769c5[_0x1686('0x1c')]=qs[_0x1686('0x1c')](_0x1bdffb[_0x1686('0x2b')][_0x1686('0x1c')]);}_0x5769c5[_0x1686('0x34')]=qs['sort'](_0x1bdffb[_0x1686('0x2b')][_0x1686('0x35')]);_0x5769c5[_0x1686('0x36')]=qs[_0x1686('0x2d')](_[_0x1686('0x37')](_0x1bdffb[_0x1686('0x2b')],_0x4e9b1f[_0x1686('0x2d')]),_0xf37857);if(_0x1bdffb[_0x1686('0x2b')][_0x1686('0x38')]){_0x5769c5[_0x1686('0x36')]=_[_0x1686('0x39')](_0x5769c5[_0x1686('0x36')],{'$or':_[_0x1686('0x2a')](_0xf37857,function(_0xd49501){if(_0xd49501[_0x1686('0x28')]!==_0x1686('0x3a')){var _0x1d33d5={};_0x1d33d5[_0xd49501[_0x1686('0x24')]]={'$like':'%'+_0x1bdffb[_0x1686('0x2b')][_0x1686('0x38')]+'%'};return _0x1d33d5;}})});}_0x5769c5=_[_0x1686('0x39')]({},_0x5769c5,_0x1bdffb['options']);var _0x1b6003={'where':_0x5769c5[_0x1686('0x36')]};return db[_0x1686('0x3b')][_0x1686('0x1b')](_0x1b6003)['then'](function(_0x4166a5){_0x362445[_0x1686('0x1b')]=_0x4166a5;if(_0x1bdffb[_0x1686('0x2b')][_0x1686('0x3c')]){_0x5769c5[_0x1686('0x3d')]=[{'all':!![]}];}return db[_0x1686('0x3b')][_0x1686('0x3e')](_0x5769c5);})['then'](function(_0x5dff8b){_0x362445[_0x1686('0x3f')]=_0x5dff8b;return _0x362445;})['then'](respondWithFilteredResult(_0x3a4706,_0x5769c5))['catch'](handleError(_0x3a4706,null));};exports['show']=function(_0x21b8d0,_0x3065de){var _0x310521={'raw':!![],'where':{'id':_0x21b8d0['params']['id']}},_0x6893d4={};_0x6893d4[_0x1686('0x29')]=_['keys'](db['SugarcrmField'][_0x1686('0x26')]);_0x6893d4[_0x1686('0x2b')]=_[_0x1686('0x2c')](_0x21b8d0['query']);_0x6893d4[_0x1686('0x2d')]=_[_0x1686('0x2f')](_0x6893d4['model'],_0x6893d4[_0x1686('0x2b')]);_0x310521[_0x1686('0x2e')]=_[_0x1686('0x2f')](_0x6893d4[_0x1686('0x29')],qs[_0x1686('0x30')](_0x21b8d0[_0x1686('0x2b')][_0x1686('0x30')]));_0x310521['attributes']=_0x310521[_0x1686('0x2e')][_0x1686('0x31')]?_0x310521[_0x1686('0x2e')]:_0x6893d4[_0x1686('0x29')];if(_0x21b8d0[_0x1686('0x2b')]['includeAll']){_0x310521[_0x1686('0x3d')]=[{'all':!![]}];}_0x310521=_[_0x1686('0x39')]({},_0x310521,_0x21b8d0[_0x1686('0x40')]);return db['SugarcrmField'][_0x1686('0x41')](_0x310521)[_0x1686('0x20')](handleEntityNotFound(_0x3065de,null))[_0x1686('0x20')](respondWithResult(_0x3065de,null))['catch'](handleError(_0x3065de,null));};exports[_0x1686('0x42')]=function(_0x451af6,_0x3ef7ef){return db[_0x1686('0x3b')][_0x1686('0x42')](_0x451af6[_0x1686('0x43')],{})[_0x1686('0x20')](respondWithResult(_0x3ef7ef,0xc9))[_0x1686('0x44')](handleError(_0x3ef7ef,null));};exports[_0x1686('0x45')]=function(_0x44a29d,_0x65bb9){if(_0x44a29d['body']['id']){delete _0x44a29d[_0x1686('0x43')]['id'];}return db[_0x1686('0x3b')][_0x1686('0x41')]({'where':{'id':_0x44a29d[_0x1686('0x46')]['id']}})[_0x1686('0x20')](handleEntityNotFound(_0x65bb9,null))[_0x1686('0x20')](saveUpdates(_0x44a29d['body'],null))[_0x1686('0x20')](respondWithResult(_0x65bb9,null))[_0x1686('0x44')](handleError(_0x65bb9,null));};exports[_0x1686('0x21')]=function(_0x3b1af8,_0x592ba6){return db['SugarcrmField'][_0x1686('0x41')]({'where':{'id':_0x3b1af8[_0x1686('0x46')]['id']}})['then'](handleEntityNotFound(_0x592ba6,null))['then'](removeEntity(_0x592ba6,null))[_0x1686('0x44')](handleError(_0x592ba6,null));};
\ No newline at end of file
+var _0xabc8=['bluebird','util','path','to-csv','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','map','SugarcrmField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xabc8,0x117));var _0x8abc=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0xabc8[_0x37a7c6];return _0x539905;};'use strict';var pdf=require(_0x8abc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8abc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8abc('0x2'));var rp=require(_0x8abc('0x3'));var moment=require(_0x8abc('0x4'));var BPromise=require(_0x8abc('0x5'));var Mustache=require('mustache');var util=require(_0x8abc('0x6'));var path=require(_0x8abc('0x7'));var sox=require('sox');var csv=require(_0x8abc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8abc('0x9'));var deskjs=require(_0x8abc('0xa'));var toCsv=require(_0x8abc('0x8'));var querystring=require(_0x8abc('0xb'));var Papa=require('papaparse');var Redis=require(_0x8abc('0xc'));var authService=require(_0x8abc('0xd'));var qs=require(_0x8abc('0xe'));var as=require(_0x8abc('0xf'));var hardwareService=require(_0x8abc('0x10'));var logger=require(_0x8abc('0x11'))(_0x8abc('0x12'));var utils=require(_0x8abc('0x13'));var config=require(_0x8abc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x569c7a,_0x47af3e){_0x47af3e=_0x47af3e||0xcc;return function(_0xa17c2e){if(_0xa17c2e){return _0x569c7a['sendStatus'](_0x47af3e);}return _0x569c7a[_0x8abc('0x15')](_0x47af3e)['end']();};}function respondWithResult(_0x3e3354,_0x5c4402){_0x5c4402=_0x5c4402||0xc8;return function(_0x4bd87a){if(_0x4bd87a){return _0x3e3354[_0x8abc('0x15')](_0x5c4402)[_0x8abc('0x16')](_0x4bd87a);}};}function respondWithFilteredResult(_0x18459a,_0x531638){return function(_0x316ef5){if(_0x316ef5){var _0x409874=_0x316ef5[_0x8abc('0x17')],_0x1a384c=_0x531638[_0x8abc('0x18')],_0x249b43=_0x531638[_0x8abc('0x18')]+_0x531638[_0x8abc('0x19')],_0x14922c;if(_0x249b43>=_0x409874){_0x249b43=_0x409874;_0x14922c=0xc8;}else{_0x14922c=0xce;}_0x18459a['status'](_0x14922c);return _0x18459a[_0x8abc('0x1a')](_0x8abc('0x1b'),_0x1a384c+'-'+_0x249b43+'/'+_0x409874)[_0x8abc('0x16')](_0x316ef5);}return null;};}function patchUpdates(_0x499702){return function(_0xd91d85){try{jsonpatch[_0x8abc('0x1c')](_0xd91d85,_0x499702,!![]);}catch(_0x56a87c){return BPromise[_0x8abc('0x1d')](_0x56a87c);}return _0xd91d85[_0x8abc('0x1e')]();};}function saveUpdates(_0xa03d3f,_0x53a8bb){return function(_0x502913){if(_0x502913){return _0x502913[_0x8abc('0x1f')](_0xa03d3f)[_0x8abc('0x20')](function(_0x40ec60){return _0x40ec60;});}return null;};}function removeEntity(_0x1f1984,_0xcd3afe){return function(_0x14b990){if(_0x14b990){return _0x14b990[_0x8abc('0x21')]()[_0x8abc('0x20')](function(){_0x1f1984[_0x8abc('0x15')](0xcc)[_0x8abc('0x22')]();});}};}function handleEntityNotFound(_0x2d67a3,_0x248c5c){return function(_0x58f5a6){if(!_0x58f5a6){_0x2d67a3[_0x8abc('0x23')](0x194);}return _0x58f5a6;};}function handleError(_0x49c4c1,_0x137536){_0x137536=_0x137536||0x1f4;return function(_0x48743b){logger[_0x8abc('0x24')](_0x48743b[_0x8abc('0x25')]);if(_0x48743b[_0x8abc('0x26')]){delete _0x48743b[_0x8abc('0x26')];}_0x49c4c1[_0x8abc('0x15')](_0x137536)['send'](_0x48743b);};}exports['index']=function(_0x7a79b,_0x46eb8f){var _0x219e0b={},_0x5ca550={},_0x81bc01={'count':0x0,'rows':[]};var _0x473f46=_[_0x8abc('0x27')](db[_0x8abc('0x28')][_0x8abc('0x29')],function(_0x414e7c){return{'name':_0x414e7c[_0x8abc('0x2a')],'type':_0x414e7c[_0x8abc('0x2b')]['key']};});_0x5ca550[_0x8abc('0x2c')]=_['map'](_0x473f46,_0x8abc('0x26'));_0x5ca550['query']=_[_0x8abc('0x2d')](_0x7a79b[_0x8abc('0x2e')]);_0x5ca550[_0x8abc('0x2f')]=_[_0x8abc('0x30')](_0x5ca550[_0x8abc('0x2c')],_0x5ca550[_0x8abc('0x2e')]);_0x219e0b[_0x8abc('0x31')]=_['intersection'](_0x5ca550['model'],qs[_0x8abc('0x32')](_0x7a79b[_0x8abc('0x2e')]['fields']));_0x219e0b['attributes']=_0x219e0b['attributes'][_0x8abc('0x33')]?_0x219e0b[_0x8abc('0x31')]:_0x5ca550[_0x8abc('0x2c')];if(!_0x7a79b[_0x8abc('0x2e')][_0x8abc('0x34')]('nolimit')){_0x219e0b[_0x8abc('0x19')]=qs['limit'](_0x7a79b[_0x8abc('0x2e')][_0x8abc('0x19')]);_0x219e0b[_0x8abc('0x18')]=qs['offset'](_0x7a79b[_0x8abc('0x2e')][_0x8abc('0x18')]);}_0x219e0b[_0x8abc('0x35')]=qs[_0x8abc('0x36')](_0x7a79b[_0x8abc('0x2e')][_0x8abc('0x36')]);_0x219e0b['where']=qs[_0x8abc('0x2f')](_[_0x8abc('0x37')](_0x7a79b['query'],_0x5ca550[_0x8abc('0x2f')]),_0x473f46);if(_0x7a79b['query'][_0x8abc('0x38')]){_0x219e0b[_0x8abc('0x39')]=_[_0x8abc('0x3a')](_0x219e0b['where'],{'$or':_[_0x8abc('0x27')](_0x473f46,function(_0x1c07d4){if(_0x1c07d4['type']!==_0x8abc('0x3b')){var _0x4e7fe5={};_0x4e7fe5[_0x1c07d4[_0x8abc('0x26')]]={'$like':'%'+_0x7a79b[_0x8abc('0x2e')][_0x8abc('0x38')]+'%'};return _0x4e7fe5;}})});}_0x219e0b=_[_0x8abc('0x3a')]({},_0x219e0b,_0x7a79b[_0x8abc('0x3c')]);var _0x5e77a8={'where':_0x219e0b[_0x8abc('0x39')]};return db[_0x8abc('0x28')][_0x8abc('0x17')](_0x5e77a8)[_0x8abc('0x20')](function(_0x50ff62){_0x81bc01[_0x8abc('0x17')]=_0x50ff62;if(_0x7a79b[_0x8abc('0x2e')][_0x8abc('0x3d')]){_0x219e0b['include']=[{'all':!![]}];}return db[_0x8abc('0x28')][_0x8abc('0x3e')](_0x219e0b);})[_0x8abc('0x20')](function(_0x44272c){_0x81bc01[_0x8abc('0x3f')]=_0x44272c;return _0x81bc01;})[_0x8abc('0x20')](respondWithFilteredResult(_0x46eb8f,_0x219e0b))[_0x8abc('0x40')](handleError(_0x46eb8f,null));};exports[_0x8abc('0x41')]=function(_0x11a09e,_0xc0ead3){var _0xe10830={'raw':!![],'where':{'id':_0x11a09e[_0x8abc('0x42')]['id']}},_0x880e1={};_0x880e1['model']=_[_0x8abc('0x2d')](db[_0x8abc('0x28')][_0x8abc('0x29')]);_0x880e1[_0x8abc('0x2e')]=_[_0x8abc('0x2d')](_0x11a09e['query']);_0x880e1[_0x8abc('0x2f')]=_[_0x8abc('0x30')](_0x880e1[_0x8abc('0x2c')],_0x880e1[_0x8abc('0x2e')]);_0xe10830[_0x8abc('0x31')]=_[_0x8abc('0x30')](_0x880e1[_0x8abc('0x2c')],qs[_0x8abc('0x32')](_0x11a09e[_0x8abc('0x2e')][_0x8abc('0x32')]));_0xe10830[_0x8abc('0x31')]=_0xe10830['attributes'][_0x8abc('0x33')]?_0xe10830[_0x8abc('0x31')]:_0x880e1[_0x8abc('0x2c')];if(_0x11a09e[_0x8abc('0x2e')][_0x8abc('0x3d')]){_0xe10830[_0x8abc('0x43')]=[{'all':!![]}];}_0xe10830=_[_0x8abc('0x3a')]({},_0xe10830,_0x11a09e['options']);return db[_0x8abc('0x28')][_0x8abc('0x44')](_0xe10830)[_0x8abc('0x20')](handleEntityNotFound(_0xc0ead3,null))['then'](respondWithResult(_0xc0ead3,null))[_0x8abc('0x40')](handleError(_0xc0ead3,null));};exports[_0x8abc('0x45')]=function(_0x440887,_0x26f70a){return db['SugarcrmField'][_0x8abc('0x45')](_0x440887[_0x8abc('0x46')],{})[_0x8abc('0x20')](respondWithResult(_0x26f70a,0xc9))[_0x8abc('0x40')](handleError(_0x26f70a,null));};exports['update']=function(_0x86654a,_0x128a1f){if(_0x86654a[_0x8abc('0x46')]['id']){delete _0x86654a[_0x8abc('0x46')]['id'];}return db[_0x8abc('0x28')]['find']({'where':{'id':_0x86654a[_0x8abc('0x42')]['id']}})[_0x8abc('0x20')](handleEntityNotFound(_0x128a1f,null))['then'](saveUpdates(_0x86654a[_0x8abc('0x46')],null))[_0x8abc('0x20')](respondWithResult(_0x128a1f,null))['catch'](handleError(_0x128a1f,null));};exports['destroy']=function(_0x2f0608,_0x449fd6){return db['SugarcrmField'][_0x8abc('0x44')]({'where':{'id':_0x2f0608[_0x8abc('0x42')]['id']}})['then'](handleEntityNotFound(_0x449fd6,null))[_0x8abc('0x20')](removeEntity(_0x449fd6,null))[_0x8abc('0x40')](handleError(_0x449fd6,null));};
\ No newline at end of file
index bca45e2..7d7f248 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x073a=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x4ceb3f,_0xffbb4){var _0x79aae2=function(_0x5d42f1){while(--_0x5d42f1){_0x4ceb3f['push'](_0x4ceb3f['shift']());}};_0x79aae2(++_0xffbb4);}(_0x073a,0x8d));var _0xa073=function(_0x3a184d,_0x4217d5){_0x3a184d=_0x3a184d-0x0;var _0xaf5095=_0x073a[_0x3a184d];return _0xaf5095;};'use strict';var _=require(_0xa073('0x0'));var util=require(_0xa073('0x1'));var logger=require('../../config/logger')(_0xa073('0x2'));var moment=require(_0xa073('0x3'));var BPromise=require(_0xa073('0x4'));var rp=require(_0xa073('0x5'));var fs=require('fs');var path=require(_0xa073('0x6'));var rimraf=require(_0xa073('0x7'));var config=require(_0xa073('0x8'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x21fc87,_0x4c1f69){return _0x21fc87['define'](_0xa073('0x9'),attributes,{'tableName':_0xa073('0xa'),'paranoid':![],'indexes':[{'name':_0xa073('0xb'),'fields':[_0xa073('0xc'),_0xa073('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x128c=['./intSugarcrmField.attributes','exports','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5573e6,_0x48b98c){var _0x43dfb3=function(_0x98fd17){while(--_0x98fd17){_0x5573e6['push'](_0x5573e6['shift']());}};_0x43dfb3(++_0x48b98c);}(_0x128c,0x6f));var _0xc128=function(_0x5db667,_0x4e2cc5){_0x5db667=_0x5db667-0x0;var _0x51e38b=_0x128c[_0x5db667];return _0x51e38b;};'use strict';var _=require(_0xc128('0x0'));var util=require(_0xc128('0x1'));var logger=require(_0xc128('0x2'))(_0xc128('0x3'));var moment=require(_0xc128('0x4'));var BPromise=require(_0xc128('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc128('0x6'));var rimraf=require(_0xc128('0x7'));var config=require(_0xc128('0x8'));var attributes=require(_0xc128('0x9'));module[_0xc128('0xa')]=function(_0x41660b,_0x13401b){return _0x41660b['define']('SugarcrmField',attributes,{'tableName':_0xc128('0xb'),'paranoid':![],'indexes':[{'name':_0xc128('0xc'),'fields':[_0xc128('0xd'),_0xc128('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8d17d3a..696dcd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1b2cf0,_0x3e1559){_0x1b2cf0=_0x1b2cf0-0x0;var _0x566935=_0x0b0e[_0x1b2cf0];return _0x566935;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}
\ No newline at end of file
+var _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x50b5f6,_0x461121){var _0xdd3512=function(_0x4e3655){while(--_0x4e3655){_0x50b5f6['push'](_0x50b5f6['shift']());}};_0xdd3512(++_0x461121);}(_0x1a85,0x178));var _0x51a8=function(_0x843880,_0x1516d1){_0x843880=_0x843880-0x0;var _0x49943f=_0x1a85[_0x843880];return _0x49943f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}
\ No newline at end of file
index 8333cd4..6b4986f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbfa=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','exports','multer'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdbfa,0x18b));var _0xadbf=function(_0x386975,_0x17aa68){_0x386975=_0x386975-0x0;var _0x3d6288=_0xdbfa[_0x386975];return _0x3d6288;};'use strict';var multer=require(_0xadbf('0x0'));var util=require('util');var path=require(_0xadbf('0x1'));var timeout=require(_0xadbf('0x2'));var express=require(_0xadbf('0x3'));var router=express[_0xadbf('0x4')]();var auth=require(_0xadbf('0x5'));var interaction=require(_0xadbf('0x6'));var config=require(_0xadbf('0x7'));var controller=require(_0xadbf('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xadbf('0x9')]);router[_0xadbf('0xa')](_0xadbf('0xb'),auth[_0xadbf('0xc')](),controller['show']);router[_0xadbf('0xa')](_0xadbf('0xd'),auth[_0xadbf('0xc')](),controller[_0xadbf('0xe')]);router[_0xadbf('0xa')]('/:id/fields',auth[_0xadbf('0xc')](),controller[_0xadbf('0xf')]);router[_0xadbf('0x10')]('/',auth['isAuthenticated'](),controller[_0xadbf('0x11')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xadbf('0x12')]);router[_0xadbf('0x13')]('/:id',auth[_0xadbf('0xc')](),controller['update']);router[_0xadbf('0x14')](_0xadbf('0xb'),auth[_0xadbf('0xc')](),controller['destroy']);module[_0xadbf('0x15')]=router;
\ No newline at end of file
+var _0x3000=['index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x96a742,_0x5dfcf9){var _0x2ed181=function(_0x539206){while(--_0x539206){_0x96a742['push'](_0x96a742['shift']());}};_0x2ed181(++_0x5dfcf9);}(_0x3000,0x9e));var _0x0300=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3000[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x0300('0x0'));var util=require(_0x0300('0x1'));var path=require('path');var timeout=require(_0x0300('0x2'));var express=require(_0x0300('0x3'));var router=express[_0x0300('0x4')]();var auth=require(_0x0300('0x5'));var interaction=require(_0x0300('0x6'));var config=require('../../config/environment');var controller=require(_0x0300('0x7'));router[_0x0300('0x8')]('/',auth[_0x0300('0x9')](),controller[_0x0300('0xa')]);router[_0x0300('0x8')]('/:id',auth[_0x0300('0x9')](),controller['show']);router['get'](_0x0300('0xb'),auth[_0x0300('0x9')](),controller[_0x0300('0xc')]);router[_0x0300('0x8')](_0x0300('0xd'),auth[_0x0300('0x9')](),controller[_0x0300('0xe')]);router[_0x0300('0xf')]('/',auth[_0x0300('0x9')](),controller[_0x0300('0x10')]);router[_0x0300('0xf')]('/:id/configurations',auth[_0x0300('0x9')](),controller[_0x0300('0x11')]);router[_0x0300('0x12')](_0x0300('0x13'),auth['isAuthenticated'](),controller[_0x0300('0x14')]);router[_0x0300('0x15')](_0x0300('0x13'),auth['isAuthenticated'](),controller[_0x0300('0x16')]);module[_0x0300('0x17')]=router;
\ No newline at end of file
index 1b7eaf0..40b098c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1a5=['HelpDesk','STRING'];(function(_0x57c5c0,_0x3c271f){var _0x297ebe=function(_0x93f133){while(--_0x93f133){_0x57c5c0['push'](_0x57c5c0['shift']());}};_0x297ebe(++_0x3c271f);}(_0xa1a5,0x173));var _0x5a1a=function(_0x1ae130,_0x3d5003){_0x1ae130=_0x1ae130-0x0;var _0x267ff5=_0xa1a5[_0x1ae130];return _0x267ff5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5a1a('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x5a1a('0x0')]},'username':{'type':Sequelize[_0x5a1a('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5a1a('0x0')],'allowNull':![],'defaultValue':_0x5a1a('0x1')},'remoteUri':{'type':Sequelize[_0x5a1a('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5a1a('0x0')]},'accessKey':{'type':Sequelize[_0x5a1a('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x14f5=['exports','STRING','sequelize'];(function(_0x46dc29,_0x51130b){var _0x14725b=function(_0x1d34ba){while(--_0x1d34ba){_0x46dc29['push'](_0x46dc29['shift']());}};_0x14725b(++_0x51130b);}(_0x14f5,0x1a6));var _0x514f=function(_0x560589,_0x3889f0){_0x560589=_0x560589-0x0;var _0x386054=_0x14f5[_0x560589];return _0x386054;};'use strict';var Sequelize=require(_0x514f('0x0'));module[_0x514f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x514f('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x514f('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0x514f('0x2')],'allowNull':![]}};
\ No newline at end of file
index 1bc4aa0..5aee456 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6c8=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','reject','update','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','type','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','length','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','VtigerField','Descriptions','md5','username','description','moduleName','remoteUri','accessKey','slice','lastIndexOf','%s/webservice.php','GET','success','token','autogenerated','owner','includes','remove','editable','false','label','startsWith','picklist','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0x529e27,_0x3f556e){var _0x34e0d1=function(_0x51da47){while(--_0x51da47){_0x529e27['push'](_0x529e27['shift']());}};_0x34e0d1(++_0x3f556e);}(_0xa6c8,0x15a));var _0x8a6c=function(_0xc125f5,_0x538bf8){_0xc125f5=_0xc125f5-0x0;var _0x49cc1d=_0xa6c8[_0xc125f5];return _0x49cc1d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8a6c('0x0'));var rimraf=require(_0x8a6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a6c('0x2'));var rp=require(_0x8a6c('0x3'));var moment=require(_0x8a6c('0x4'));var BPromise=require(_0x8a6c('0x5'));var Mustache=require(_0x8a6c('0x6'));var util=require(_0x8a6c('0x7'));var path=require(_0x8a6c('0x8'));var sox=require(_0x8a6c('0x9'));var csv=require(_0x8a6c('0xa'));var ejs=require(_0x8a6c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8a6c('0xc'));var crypto=require(_0x8a6c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8a6c('0xa'));var querystring=require(_0x8a6c('0xe'));var Papa=require(_0x8a6c('0xf'));var Redis=require(_0x8a6c('0x10'));var authService=require(_0x8a6c('0x11'));var qs=require(_0x8a6c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a6c('0x13'));var logger=require(_0x8a6c('0x14'))(_0x8a6c('0x15'));var utils=require(_0x8a6c('0x16'));var config=require(_0x8a6c('0x17'));var db=require(_0x8a6c('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x8a6c('0x19'));var client=jayson[_0x8a6c('0x1a')][_0x8a6c('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x204774,_0x23f94d,_0x4e4a0d){if(_0x4e4a0d){var _0x3a39ae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a39ae[_0x8a6c('0x1c')](_0x23f94d)){return _0x204774;}else{throw new db['Sequelize']['ValidationError'](_0x8a6c('0x1d'));}}else{return _0x204774;}}function respondWithRpcPromise(_0x4ee85d,_0x3d4b71,_0x23745f,_0x590bfc){return new BPromise(function(_0x281554,_0x3311cd){var _0x4bb8f2=_0x590bfc||client;return _0x4bb8f2['request'](_0x4ee85d,_0x23745f)[_0x8a6c('0x1e')](function(_0x5f01bc){logger[_0x8a6c('0x1f')](_0x8a6c('0x20'),_0x3d4b71,_0x8a6c('0x21'));logger[_0x8a6c('0x22')](_0x8a6c('0x23'),_0x3d4b71,_0x8a6c('0x21'),JSON[_0x8a6c('0x24')](_0x5f01bc));if(_0x5f01bc[_0x8a6c('0x25')]){if(_0x5f01bc['error'][_0x8a6c('0x26')]===0x1f4){logger[_0x8a6c('0x25')](_0x8a6c('0x20'),_0x3d4b71,_0x5f01bc[_0x8a6c('0x25')][_0x8a6c('0x27')]);return _0x3311cd(_0x5f01bc[_0x8a6c('0x25')][_0x8a6c('0x27')]);}logger['error'](_0x8a6c('0x20'),_0x3d4b71,_0x5f01bc[_0x8a6c('0x25')][_0x8a6c('0x27')]);return _0x281554(_0x5f01bc[_0x8a6c('0x25')][_0x8a6c('0x27')]);}else{logger[_0x8a6c('0x1f')](_0x8a6c('0x20'),_0x3d4b71,_0x8a6c('0x21'));_0x281554(_0x5f01bc[_0x8a6c('0x28')][_0x8a6c('0x27')]);}})[_0x8a6c('0x29')](function(_0x46ec78){logger[_0x8a6c('0x25')](_0x8a6c('0x20'),_0x3d4b71,_0x46ec78);_0x3311cd(_0x46ec78);});});}function respondWithStatusCode(_0x17ffa5,_0x4f8ae1){_0x4f8ae1=_0x4f8ae1||0xcc;return function(_0x46e2be){if(_0x46e2be){return _0x17ffa5[_0x8a6c('0x2a')](_0x4f8ae1);}return _0x17ffa5[_0x8a6c('0x2b')](_0x4f8ae1)[_0x8a6c('0x2c')]();};}function respondWithResult(_0x37b3d1,_0x136495){_0x136495=_0x136495||0xc8;return function(_0x4cd40d){if(_0x4cd40d){return _0x37b3d1[_0x8a6c('0x2b')](_0x136495)[_0x8a6c('0x2d')](_0x4cd40d);}};}function respondWithFilteredResult(_0x702998,_0x4fea3b){return function(_0x3ad56f){if(_0x3ad56f){var _0x2a8571=_0x3ad56f[_0x8a6c('0x2e')],_0x58555f=_0x4fea3b['offset'],_0x286cf7=_0x4fea3b[_0x8a6c('0x2f')]+_0x4fea3b['limit'],_0x28e925;if(_0x286cf7>=_0x2a8571){_0x286cf7=_0x2a8571;_0x28e925=0xc8;}else{_0x28e925=0xce;}_0x702998[_0x8a6c('0x2b')](_0x28e925);return _0x702998[_0x8a6c('0x30')]('Content-Range',_0x58555f+'-'+_0x286cf7+'/'+_0x2a8571)['json'](_0x3ad56f);}return null;};}function patchUpdates(_0x3c48ea){return function(_0x351918){try{jsonpatch['apply'](_0x351918,_0x3c48ea,!![]);}catch(_0x38505b){return BPromise[_0x8a6c('0x31')](_0x38505b);}return _0x351918['save']();};}function saveUpdates(_0xad47b1,_0xe19a03){return function(_0x3e074d){if(_0x3e074d){return _0x3e074d[_0x8a6c('0x32')](_0xad47b1)[_0x8a6c('0x1e')](function(_0x1bd6b8){return _0x1bd6b8;});}return null;};}function removeEntity(_0x369b9f,_0x3fd3fa){return function(_0x3967fb){if(_0x3967fb){return _0x3967fb[_0x8a6c('0x33')]()[_0x8a6c('0x1e')](function(){_0x369b9f[_0x8a6c('0x2b')](0xcc)[_0x8a6c('0x2c')]();});}};}function handleEntityNotFound(_0x5b420a,_0x450774){return function(_0x447634){if(!_0x447634){_0x5b420a[_0x8a6c('0x2a')](0x194);}return _0x447634;};}function handleError(_0x129500,_0xcea608){_0xcea608=_0xcea608||0x1f4;return function(_0x5f0c7e){logger[_0x8a6c('0x25')](_0x5f0c7e[_0x8a6c('0x34')]);if(_0x5f0c7e[_0x8a6c('0x35')]){delete _0x5f0c7e[_0x8a6c('0x35')];}_0x129500['status'](_0xcea608)[_0x8a6c('0x36')](_0x5f0c7e);};}exports[_0x8a6c('0x37')]=function(_0x89362b,_0x52f4dd){var _0x55268f={},_0x1756f9={},_0x505378={'count':0x0,'rows':[]};var _0x674476=_[_0x8a6c('0x38')](db[_0x8a6c('0x39')][_0x8a6c('0x3a')],function(_0x131ecc){return{'name':_0x131ecc['fieldName'],'type':_0x131ecc[_0x8a6c('0x3b')]['key']};});_0x1756f9['model']=_[_0x8a6c('0x38')](_0x674476,'name');_0x1756f9['query']=_[_0x8a6c('0x3c')](_0x89362b['query']);_0x1756f9[_0x8a6c('0x3d')]=_[_0x8a6c('0x3e')](_0x1756f9[_0x8a6c('0x3f')],_0x1756f9[_0x8a6c('0x40')]);_0x55268f[_0x8a6c('0x41')]=_['intersection'](_0x1756f9[_0x8a6c('0x3f')],qs[_0x8a6c('0x42')](_0x89362b['query'][_0x8a6c('0x42')]));_0x55268f[_0x8a6c('0x41')]=_0x55268f[_0x8a6c('0x41')]['length']?_0x55268f[_0x8a6c('0x41')]:_0x1756f9['model'];if(!_0x89362b[_0x8a6c('0x40')][_0x8a6c('0x43')](_0x8a6c('0x44'))){_0x55268f[_0x8a6c('0x45')]=qs[_0x8a6c('0x45')](_0x89362b[_0x8a6c('0x40')][_0x8a6c('0x45')]);_0x55268f[_0x8a6c('0x2f')]=qs[_0x8a6c('0x2f')](_0x89362b[_0x8a6c('0x40')][_0x8a6c('0x2f')]);}_0x55268f['order']=qs[_0x8a6c('0x46')](_0x89362b[_0x8a6c('0x40')][_0x8a6c('0x46')]);_0x55268f['where']=qs[_0x8a6c('0x3d')](_[_0x8a6c('0x47')](_0x89362b[_0x8a6c('0x40')],_0x1756f9[_0x8a6c('0x3d')]),_0x674476);if(_0x89362b[_0x8a6c('0x40')]['filter']){_0x55268f[_0x8a6c('0x48')]=_[_0x8a6c('0x49')](_0x55268f[_0x8a6c('0x48')],{'$or':_[_0x8a6c('0x38')](_0x674476,function(_0x2eb53d){if(_0x2eb53d[_0x8a6c('0x3b')]!==_0x8a6c('0x4a')){var _0x529eb2={};_0x529eb2[_0x2eb53d[_0x8a6c('0x35')]]={'$like':'%'+_0x89362b[_0x8a6c('0x40')][_0x8a6c('0x4b')]+'%'};return _0x529eb2;}})});}_0x55268f=_[_0x8a6c('0x49')]({},_0x55268f,_0x89362b[_0x8a6c('0x4c')]);var _0x119432={'where':_0x55268f[_0x8a6c('0x48')]};return db[_0x8a6c('0x39')][_0x8a6c('0x2e')](_0x119432)['then'](function(_0x37a145){_0x505378[_0x8a6c('0x2e')]=_0x37a145;if(_0x89362b[_0x8a6c('0x40')][_0x8a6c('0x4d')]){_0x55268f[_0x8a6c('0x4e')]=[{'all':!![]}];}return db[_0x8a6c('0x39')][_0x8a6c('0x4f')](_0x55268f);})['then'](function(_0x31f2f1){_0x505378['rows']=_0x31f2f1;return _0x505378;})[_0x8a6c('0x1e')](respondWithFilteredResult(_0x52f4dd,_0x55268f))[_0x8a6c('0x29')](handleError(_0x52f4dd,null));};exports[_0x8a6c('0x50')]=function(_0x11d12f,_0x307b73){var _0x27de0c={'raw':![],'where':{'id':_0x11d12f['params']['id']}},_0x572428={};_0x572428[_0x8a6c('0x3f')]=_[_0x8a6c('0x3c')](db[_0x8a6c('0x39')][_0x8a6c('0x3a')]);_0x572428['query']=_[_0x8a6c('0x3c')](_0x11d12f[_0x8a6c('0x40')]);_0x572428[_0x8a6c('0x3d')]=_[_0x8a6c('0x3e')](_0x572428['model'],_0x572428[_0x8a6c('0x40')]);_0x27de0c['attributes']=_[_0x8a6c('0x3e')](_0x572428[_0x8a6c('0x3f')],qs[_0x8a6c('0x42')](_0x11d12f[_0x8a6c('0x40')][_0x8a6c('0x42')]));_0x27de0c[_0x8a6c('0x41')]=_0x27de0c[_0x8a6c('0x41')][_0x8a6c('0x51')]?_0x27de0c['attributes']:_0x572428['model'];if(_0x11d12f[_0x8a6c('0x40')][_0x8a6c('0x4d')]){_0x27de0c['include']=[{'all':!![]}];}_0x27de0c=_[_0x8a6c('0x49')]({},_0x27de0c,_0x11d12f[_0x8a6c('0x4c')]);return db[_0x8a6c('0x39')][_0x8a6c('0x52')](_0x27de0c)['then'](handleEntityNotFound(_0x307b73,null))[_0x8a6c('0x1e')](respondWithResult(_0x307b73,null))['catch'](handleError(_0x307b73,null));};exports[_0x8a6c('0x53')]=function(_0x34eba6,_0x1f0648){return db[_0x8a6c('0x39')]['create'](_0x34eba6['body'],{})[_0x8a6c('0x1e')](respondWithResult(_0x1f0648,0xc9))[_0x8a6c('0x29')](handleError(_0x1f0648,null));};exports[_0x8a6c('0x32')]=function(_0x4b7d4b,_0x21936e){if(_0x4b7d4b[_0x8a6c('0x54')]['id']){delete _0x4b7d4b[_0x8a6c('0x54')]['id'];}return db[_0x8a6c('0x39')]['find']({'where':{'id':_0x4b7d4b[_0x8a6c('0x55')]['id']}})['then'](handleEntityNotFound(_0x21936e,null))[_0x8a6c('0x1e')](saveUpdates(_0x4b7d4b[_0x8a6c('0x54')],null))[_0x8a6c('0x1e')](respondWithResult(_0x21936e,null))[_0x8a6c('0x29')](handleError(_0x21936e,null));};exports[_0x8a6c('0x33')]=function(_0xb4a0d1,_0x5df9a6){return db['VtigerAccount'][_0x8a6c('0x52')]({'where':{'id':_0xb4a0d1[_0x8a6c('0x55')]['id']}})[_0x8a6c('0x1e')](handleEntityNotFound(_0x5df9a6,null))[_0x8a6c('0x1e')](removeEntity(_0x5df9a6,null))[_0x8a6c('0x29')](handleError(_0x5df9a6,null));};exports[_0x8a6c('0x56')]=function(_0x144afe,_0x46efe9,_0x139121){var _0x1b6b3f={};var _0x2b24b0={};var _0x27c4aa;var _0x3b9b7c;return db[_0x8a6c('0x39')][_0x8a6c('0x57')]({'where':{'id':_0x144afe[_0x8a6c('0x55')]['id']}})[_0x8a6c('0x1e')](handleEntityNotFound(_0x46efe9,null))[_0x8a6c('0x1e')](function(_0x33f8b6){if(_0x33f8b6){_0x27c4aa=_0x33f8b6;_0x2b24b0[_0x8a6c('0x3f')]=_[_0x8a6c('0x3c')](db['VtigerConfiguration'][_0x8a6c('0x3a')]);_0x2b24b0[_0x8a6c('0x40')]=_[_0x8a6c('0x3c')](_0x144afe['query']);_0x2b24b0['filters']=_[_0x8a6c('0x3e')](_0x2b24b0['model'],_0x2b24b0['query']);_0x1b6b3f['attributes']=_[_0x8a6c('0x3e')](_0x2b24b0[_0x8a6c('0x3f')],qs[_0x8a6c('0x42')](_0x144afe[_0x8a6c('0x40')][_0x8a6c('0x42')]));_0x1b6b3f[_0x8a6c('0x41')]=_0x1b6b3f[_0x8a6c('0x41')][_0x8a6c('0x51')]?_0x1b6b3f[_0x8a6c('0x41')]:_0x2b24b0[_0x8a6c('0x3f')];_0x1b6b3f['order']=qs[_0x8a6c('0x46')](_0x144afe[_0x8a6c('0x40')][_0x8a6c('0x46')]);_0x1b6b3f[_0x8a6c('0x48')]=qs[_0x8a6c('0x3d')](_[_0x8a6c('0x47')](_0x144afe[_0x8a6c('0x40')],_0x2b24b0[_0x8a6c('0x3d')]));if(_0x144afe[_0x8a6c('0x40')][_0x8a6c('0x4b')]){_0x1b6b3f[_0x8a6c('0x48')]=_[_0x8a6c('0x49')](_0x1b6b3f['where'],{'$or':_[_0x8a6c('0x38')](_0x1b6b3f[_0x8a6c('0x41')],function(_0x3e9a42){var _0x35e965={};_0x35e965[_0x3e9a42]={'$like':'%'+_0x144afe[_0x8a6c('0x40')][_0x8a6c('0x4b')]+'%'};return _0x35e965;})});}_0x1b6b3f=_[_0x8a6c('0x49')]({},_0x1b6b3f,_0x144afe['options']);return _0x27c4aa[_0x8a6c('0x56')](_0x1b6b3f);}})['then'](function(_0x306ba4){if(_0x306ba4){_0x3b9b7c=_0x306ba4[_0x8a6c('0x51')];if(!_0x144afe['query'][_0x8a6c('0x43')]('nolimit')){_0x1b6b3f['limit']=qs['limit'](_0x144afe[_0x8a6c('0x40')][_0x8a6c('0x45')]);_0x1b6b3f[_0x8a6c('0x2f')]=qs[_0x8a6c('0x2f')](_0x144afe[_0x8a6c('0x40')][_0x8a6c('0x2f')]);}return _0x27c4aa[_0x8a6c('0x56')](_0x1b6b3f);}})[_0x8a6c('0x1e')](function(_0x127e5a){if(_0x127e5a){return _0x127e5a?{'count':_0x3b9b7c,'rows':_0x127e5a}:null;}})['then'](respondWithResult(_0x46efe9,null))[_0x8a6c('0x29')](handleError(_0x46efe9,null));};exports[_0x8a6c('0x58')]=function(_0x9686fd,_0x155cf0,_0x58343b){if(_0x9686fd['body']['id']){delete _0x9686fd[_0x8a6c('0x54')]['id'];}return db['VtigerAccount'][_0x8a6c('0x57')]({'where':{'id':_0x9686fd[_0x8a6c('0x55')]['id']}})['then'](handleEntityNotFound(_0x155cf0,null))['then'](function(_0x325484){if(_0x325484){_0x9686fd[_0x8a6c('0x54')][_0x8a6c('0x59')]=_0x325484['id'];_0x9686fd[_0x8a6c('0x54')][_0x8a6c('0x5a')]=integrations[_0x8a6c('0x5b')](_0x9686fd[_0x8a6c('0x54')]['channel'],_0x9686fd[_0x8a6c('0x54')]['type']);_0x9686fd[_0x8a6c('0x54')]['Descriptions']=integrations[_0x8a6c('0x5c')](_0x9686fd['body']['channel'],_0x9686fd[_0x8a6c('0x54')][_0x8a6c('0x3b')]);return db['VtigerConfiguration']['create'](_0x9686fd[_0x8a6c('0x54')],{'include':[{'model':db[_0x8a6c('0x5d')],'as':_0x8a6c('0x5a')},{'model':db[_0x8a6c('0x5d')],'as':_0x8a6c('0x5e')}]});}return null;})[_0x8a6c('0x1e')](respondWithResult(_0x155cf0,null))[_0x8a6c('0x29')](handleError(_0x155cf0,null));};var md5=require(_0x8a6c('0x5f'));exports['getFields']=function(_0x35f261,_0x574548,_0x6d39c9){var _0x38ba40=null;var _0x32d932=null;var _0x48d6bf=null;var _0x1de62a=null;var _0x1bb078='';return db[_0x8a6c('0x39')][_0x8a6c('0x57')]({'where':{'id':_0x35f261[_0x8a6c('0x55')]['id']},'attributes':['id',_0x8a6c('0x35'),_0x8a6c('0x60'),_0x8a6c('0x61'),_0x8a6c('0x62'),_0x8a6c('0x63'),'serverUrl',_0x8a6c('0x64')]})[_0x8a6c('0x1e')](handleEntityNotFound(_0x574548,null))[_0x8a6c('0x1e')](function(_0x5442f3){if(_0x5442f3){_0x38ba40=_0x5442f3[_0x8a6c('0x60')];_0x32d932=_0x5442f3[_0x8a6c('0x64')];_0x48d6bf=_0x5442f3[_0x8a6c('0x62')];_0x1bb078=_0x5442f3[_0x8a6c('0x63')];var _0x518dd4=_0x1bb078[_0x8a6c('0x65')](-0x1);if(_0x518dd4==='/'){_0x1bb078=_0x1bb078['substring'](0x0,_0x1bb078[_0x8a6c('0x66')](_0x518dd4));}_0x1de62a=util['format'](_0x8a6c('0x67'),_0x1bb078);var _0x401afd={'method':_0x8a6c('0x68'),'uri':_0x1de62a,'qs':{'operation':'getchallenge','username':_0x5442f3[_0x8a6c('0x60')]},'json':!![]};return rp(_0x401afd);}})[_0x8a6c('0x1e')](function(_0x1febcf){if(_0x1febcf[_0x8a6c('0x69')]){var _0x3f7eec={'method':'POST','uri':_0x1de62a,'form':{'operation':'login','username':_0x38ba40,'accessKey':md5(_0x1febcf['result'][_0x8a6c('0x6a')]+_0x32d932)},'json':!![]};return rp(_0x3f7eec);}})['then'](function(_0x80f9fa){if(_0x80f9fa[_0x8a6c('0x69')]){var _0x50d4f6={'method':_0x8a6c('0x68'),'uri':_0x1de62a,'qs':{'operation':'describe','username':_0x38ba40,'sessionName':_0x80f9fa[_0x8a6c('0x28')]['sessionName'],'elementType':_0x48d6bf},'json':!![]};return rp(_0x50d4f6);}})['then'](function(_0x298128){if(_0x298128['success']){var _0x2e161f=[_0x8a6c('0x6b'),'reference',_0x8a6c('0x6c')];_['remove'](_0x298128['result'][_0x8a6c('0x42')],function(_0x25f0c5){return _0x2e161f[_0x8a6c('0x6d')](_0x25f0c5[_0x8a6c('0x3b')][_0x8a6c('0x35')]);});_[_0x8a6c('0x6e')](_0x298128[_0x8a6c('0x28')]['fields'],function(_0x4a9131){return _0x4a9131[_0x8a6c('0x6f')]===_0x8a6c('0x70');});return{'count':_0x298128[_0x8a6c('0x28')][_0x8a6c('0x42')]['length'],'rows':_[_0x8a6c('0x38')](_0x298128[_0x8a6c('0x28')][_0x8a6c('0x42')],function(_0x1ad4fd){return{'id':_0x1ad4fd[_0x8a6c('0x35')],'name':_0x1ad4fd[_0x8a6c('0x71')],'custom':_[_0x8a6c('0x72')](_0x1ad4fd[_0x8a6c('0x35')],'cf_')?!![]:![],'options':_0x1ad4fd[_0x8a6c('0x3b')][_0x8a6c('0x35')]===_0x8a6c('0x73')&&_0x1ad4fd[_0x8a6c('0x3b')]['picklistValues']['length']>0x0?_[_0x8a6c('0x38')](_0x1ad4fd['type']['picklistValues'],function(_0x495ea4){return{'name':_0x495ea4[_0x8a6c('0x71')],'value':_0x495ea4['value']};}):[]};})};}})[_0x8a6c('0x1e')](respondWithResult(_0x574548,null))['catch'](function(_0x5a8c95){console[_0x8a6c('0x74')](_0x8a6c('0x75')+_0x5a8c95);var _0x35cb71=_0x35f261[_0x8a6c('0x40')]['test']?0x1f4:_0x5a8c95['statusCode']||0x1f4;logger[_0x8a6c('0x25')](_0x8a6c('0x76'),'getFields',_0x35cb71,JSON['stringify'](_0x5a8c95));delete _0x5a8c95[_0x8a6c('0x35')];if(_0x35cb71===0x191){_0x35cb71=0x190;}_0x574548['status'](_0x35cb71)[_0x8a6c('0x36')](_0x35f261['query']['test']?{'message':_0x8a6c('0x77'),'statusCode':_0x5a8c95['statusCode']}:_0x5a8c95);});};
\ No newline at end of file
+var _0xe7d7=['count','offset','limit','Content-Range','update','destroy','sendStatus','stack','send','map','VtigerAccount','rawAttributes','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','then','includeAll','findAll','rows','show','params','include','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','AccountId','Subjects','getSubjects','channel','VtigerField','Descriptions','md5','getFields','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','username','success','POST','login','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xe7d7,0x153));var _0x7e7d=function(_0x48897b,_0x2ccea9){_0x48897b=_0x48897b-0x0;var _0x2ede58=_0xe7d7[_0x48897b];return _0x2ede58;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7e7d('0x0'));var zipdir=require(_0x7e7d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e7d('0x2'));var moment=require(_0x7e7d('0x3'));var BPromise=require(_0x7e7d('0x4'));var Mustache=require(_0x7e7d('0x5'));var util=require(_0x7e7d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7e7d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7e7d('0x8'));var crypto=require(_0x7e7d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e7d('0x7'));var querystring=require(_0x7e7d('0xa'));var Papa=require(_0x7e7d('0xb'));var Redis=require('ioredis');var authService=require(_0x7e7d('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x7e7d('0xd'));var hardwareService=require(_0x7e7d('0xe'));var logger=require('../../config/logger')(_0x7e7d('0xf'));var utils=require(_0x7e7d('0x10'));var config=require(_0x7e7d('0x11'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7e7d('0x12'));var jayson=require(_0x7e7d('0x13'));var client=jayson[_0x7e7d('0x14')][_0x7e7d('0x15')]({'port':0x232a});function checkPasswordPattern(_0x4c2fc6,_0x28e5f6,_0x6264a9){if(_0x6264a9){var _0xaf8ee7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xaf8ee7[_0x7e7d('0x16')](_0x28e5f6)){return _0x4c2fc6;}else{throw new db['Sequelize'][(_0x7e7d('0x17'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4c2fc6;}}function respondWithRpcPromise(_0x23a4c7,_0xcf4e67,_0x5db844,_0x43df61){return new BPromise(function(_0x1f1031,_0x15f820){var _0x1dcdeb=_0x43df61||client;return _0x1dcdeb[_0x7e7d('0x18')](_0x23a4c7,_0x5db844)['then'](function(_0x3e6335){logger[_0x7e7d('0x19')](_0x7e7d('0x1a'),_0xcf4e67,_0x7e7d('0x1b'));logger[_0x7e7d('0x1c')](_0x7e7d('0x1d'),_0xcf4e67,_0x7e7d('0x1b'),JSON[_0x7e7d('0x1e')](_0x3e6335));if(_0x3e6335[_0x7e7d('0x1f')]){if(_0x3e6335['error'][_0x7e7d('0x20')]===0x1f4){logger[_0x7e7d('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0xcf4e67,_0x3e6335[_0x7e7d('0x1f')][_0x7e7d('0x21')]);return _0x15f820(_0x3e6335[_0x7e7d('0x1f')][_0x7e7d('0x21')]);}logger[_0x7e7d('0x1f')](_0x7e7d('0x1a'),_0xcf4e67,_0x3e6335[_0x7e7d('0x1f')][_0x7e7d('0x21')]);return _0x1f1031(_0x3e6335[_0x7e7d('0x1f')][_0x7e7d('0x21')]);}else{logger[_0x7e7d('0x19')](_0x7e7d('0x1a'),_0xcf4e67,_0x7e7d('0x1b'));_0x1f1031(_0x3e6335[_0x7e7d('0x22')][_0x7e7d('0x21')]);}})[_0x7e7d('0x23')](function(_0x3d5db6){logger[_0x7e7d('0x1f')](_0x7e7d('0x1a'),_0xcf4e67,_0x3d5db6);_0x15f820(_0x3d5db6);});});}function respondWithStatusCode(_0x52bada,_0x1b5066){_0x1b5066=_0x1b5066||0xcc;return function(_0x5ada94){if(_0x5ada94){return _0x52bada['sendStatus'](_0x1b5066);}return _0x52bada[_0x7e7d('0x24')](_0x1b5066)[_0x7e7d('0x25')]();};}function respondWithResult(_0x30c679,_0x35f010){_0x35f010=_0x35f010||0xc8;return function(_0x1ac740){if(_0x1ac740){return _0x30c679[_0x7e7d('0x24')](_0x35f010)[_0x7e7d('0x26')](_0x1ac740);}};}function respondWithFilteredResult(_0x5e1472,_0x1d5de4){return function(_0x2e4026){if(_0x2e4026){var _0x407bd3=_0x2e4026[_0x7e7d('0x27')],_0x589184=_0x1d5de4['offset'],_0xdf535c=_0x1d5de4[_0x7e7d('0x28')]+_0x1d5de4[_0x7e7d('0x29')],_0x5c96ba;if(_0xdf535c>=_0x407bd3){_0xdf535c=_0x407bd3;_0x5c96ba=0xc8;}else{_0x5c96ba=0xce;}_0x5e1472[_0x7e7d('0x24')](_0x5c96ba);return _0x5e1472['set'](_0x7e7d('0x2a'),_0x589184+'-'+_0xdf535c+'/'+_0x407bd3)[_0x7e7d('0x26')](_0x2e4026);}return null;};}function patchUpdates(_0x107041){return function(_0x5ad8c8){try{jsonpatch['apply'](_0x5ad8c8,_0x107041,!![]);}catch(_0x4f009f){return BPromise['reject'](_0x4f009f);}return _0x5ad8c8['save']();};}function saveUpdates(_0x27ab5a,_0x537e4d){return function(_0x367511){if(_0x367511){return _0x367511[_0x7e7d('0x2b')](_0x27ab5a)['then'](function(_0x27788c){return _0x27788c;});}return null;};}function removeEntity(_0x298d3c,_0x183d85){return function(_0x542f8b){if(_0x542f8b){return _0x542f8b[_0x7e7d('0x2c')]()['then'](function(){_0x298d3c['status'](0xcc)[_0x7e7d('0x25')]();});}};}function handleEntityNotFound(_0x5a528b,_0x4a26d7){return function(_0x115b27){if(!_0x115b27){_0x5a528b[_0x7e7d('0x2d')](0x194);}return _0x115b27;};}function handleError(_0x106fa9,_0x17d469){_0x17d469=_0x17d469||0x1f4;return function(_0x37a4d3){logger[_0x7e7d('0x1f')](_0x37a4d3[_0x7e7d('0x2e')]);if(_0x37a4d3['name']){delete _0x37a4d3['name'];}_0x106fa9[_0x7e7d('0x24')](_0x17d469)[_0x7e7d('0x2f')](_0x37a4d3);};}exports['index']=function(_0x316058,_0x4a9a99){var _0x1e4bfd={},_0x28ca8f={},_0x52119c={'count':0x0,'rows':[]};var _0x38df37=_[_0x7e7d('0x30')](db[_0x7e7d('0x31')][_0x7e7d('0x32')],function(_0x2d55e0){return{'name':_0x2d55e0['fieldName'],'type':_0x2d55e0['type']['key']};});_0x28ca8f[_0x7e7d('0x33')]=_['map'](_0x38df37,_0x7e7d('0x34'));_0x28ca8f['query']=_[_0x7e7d('0x35')](_0x316058[_0x7e7d('0x36')]);_0x28ca8f[_0x7e7d('0x37')]=_[_0x7e7d('0x38')](_0x28ca8f[_0x7e7d('0x33')],_0x28ca8f['query']);_0x1e4bfd[_0x7e7d('0x39')]=_[_0x7e7d('0x38')](_0x28ca8f[_0x7e7d('0x33')],qs[_0x7e7d('0x3a')](_0x316058['query'][_0x7e7d('0x3a')]));_0x1e4bfd[_0x7e7d('0x39')]=_0x1e4bfd[_0x7e7d('0x39')][_0x7e7d('0x3b')]?_0x1e4bfd[_0x7e7d('0x39')]:_0x28ca8f[_0x7e7d('0x33')];if(!_0x316058[_0x7e7d('0x36')][_0x7e7d('0x3c')](_0x7e7d('0x3d'))){_0x1e4bfd[_0x7e7d('0x29')]=qs['limit'](_0x316058[_0x7e7d('0x36')][_0x7e7d('0x29')]);_0x1e4bfd[_0x7e7d('0x28')]=qs[_0x7e7d('0x28')](_0x316058['query'][_0x7e7d('0x28')]);}_0x1e4bfd[_0x7e7d('0x3e')]=qs[_0x7e7d('0x3f')](_0x316058[_0x7e7d('0x36')][_0x7e7d('0x3f')]);_0x1e4bfd[_0x7e7d('0x40')]=qs['filters'](_['pick'](_0x316058[_0x7e7d('0x36')],_0x28ca8f[_0x7e7d('0x37')]),_0x38df37);if(_0x316058[_0x7e7d('0x36')][_0x7e7d('0x41')]){_0x1e4bfd[_0x7e7d('0x40')]=_['merge'](_0x1e4bfd[_0x7e7d('0x40')],{'$or':_[_0x7e7d('0x30')](_0x38df37,function(_0x317b85){if(_0x317b85[_0x7e7d('0x42')]!=='VIRTUAL'){var _0x50885e={};_0x50885e[_0x317b85[_0x7e7d('0x34')]]={'$like':'%'+_0x316058[_0x7e7d('0x36')][_0x7e7d('0x41')]+'%'};return _0x50885e;}})});}_0x1e4bfd=_[_0x7e7d('0x43')]({},_0x1e4bfd,_0x316058['options']);var _0x313a30={'where':_0x1e4bfd[_0x7e7d('0x40')]};return db[_0x7e7d('0x31')][_0x7e7d('0x27')](_0x313a30)[_0x7e7d('0x44')](function(_0x108e71){_0x52119c[_0x7e7d('0x27')]=_0x108e71;if(_0x316058['query'][_0x7e7d('0x45')]){_0x1e4bfd['include']=[{'all':!![]}];}return db[_0x7e7d('0x31')][_0x7e7d('0x46')](_0x1e4bfd);})[_0x7e7d('0x44')](function(_0xbd8ba5){_0x52119c[_0x7e7d('0x47')]=_0xbd8ba5;return _0x52119c;})[_0x7e7d('0x44')](respondWithFilteredResult(_0x4a9a99,_0x1e4bfd))[_0x7e7d('0x23')](handleError(_0x4a9a99,null));};exports[_0x7e7d('0x48')]=function(_0x4793fe,_0x5dd579){var _0x2ef50b={'raw':![],'where':{'id':_0x4793fe[_0x7e7d('0x49')]['id']}},_0x3c9cdf={};_0x3c9cdf[_0x7e7d('0x33')]=_[_0x7e7d('0x35')](db[_0x7e7d('0x31')][_0x7e7d('0x32')]);_0x3c9cdf[_0x7e7d('0x36')]=_[_0x7e7d('0x35')](_0x4793fe[_0x7e7d('0x36')]);_0x3c9cdf[_0x7e7d('0x37')]=_[_0x7e7d('0x38')](_0x3c9cdf[_0x7e7d('0x33')],_0x3c9cdf[_0x7e7d('0x36')]);_0x2ef50b[_0x7e7d('0x39')]=_[_0x7e7d('0x38')](_0x3c9cdf[_0x7e7d('0x33')],qs[_0x7e7d('0x3a')](_0x4793fe[_0x7e7d('0x36')][_0x7e7d('0x3a')]));_0x2ef50b['attributes']=_0x2ef50b['attributes'][_0x7e7d('0x3b')]?_0x2ef50b[_0x7e7d('0x39')]:_0x3c9cdf['model'];if(_0x4793fe['query'][_0x7e7d('0x45')]){_0x2ef50b[_0x7e7d('0x4a')]=[{'all':!![]}];}_0x2ef50b=_[_0x7e7d('0x43')]({},_0x2ef50b,_0x4793fe[_0x7e7d('0x4b')]);return db[_0x7e7d('0x31')][_0x7e7d('0x4c')](_0x2ef50b)['then'](handleEntityNotFound(_0x5dd579,null))[_0x7e7d('0x44')](respondWithResult(_0x5dd579,null))[_0x7e7d('0x23')](handleError(_0x5dd579,null));};exports[_0x7e7d('0x4d')]=function(_0x73da62,_0x3bd34a){return db[_0x7e7d('0x31')][_0x7e7d('0x4d')](_0x73da62[_0x7e7d('0x4e')],{})[_0x7e7d('0x44')](respondWithResult(_0x3bd34a,0xc9))[_0x7e7d('0x23')](handleError(_0x3bd34a,null));};exports[_0x7e7d('0x2b')]=function(_0x4e8c8e,_0x23f23a){if(_0x4e8c8e[_0x7e7d('0x4e')]['id']){delete _0x4e8c8e[_0x7e7d('0x4e')]['id'];}return db[_0x7e7d('0x31')][_0x7e7d('0x4c')]({'where':{'id':_0x4e8c8e['params']['id']}})[_0x7e7d('0x44')](handleEntityNotFound(_0x23f23a,null))['then'](saveUpdates(_0x4e8c8e[_0x7e7d('0x4e')],null))[_0x7e7d('0x44')](respondWithResult(_0x23f23a,null))['catch'](handleError(_0x23f23a,null));};exports['destroy']=function(_0x45ecca,_0xfeabeb){return db[_0x7e7d('0x31')][_0x7e7d('0x4c')]({'where':{'id':_0x45ecca[_0x7e7d('0x49')]['id']}})[_0x7e7d('0x44')](handleEntityNotFound(_0xfeabeb,null))[_0x7e7d('0x44')](removeEntity(_0xfeabeb,null))[_0x7e7d('0x23')](handleError(_0xfeabeb,null));};exports[_0x7e7d('0x4f')]=function(_0x12cbd,_0xbf6216,_0x5f05c3){var _0x5160d8={};var _0x41ff83={};var _0x3fe488;var _0x2bbb4b;return db['VtigerAccount'][_0x7e7d('0x50')]({'where':{'id':_0x12cbd[_0x7e7d('0x49')]['id']}})['then'](handleEntityNotFound(_0xbf6216,null))[_0x7e7d('0x44')](function(_0x164eac){if(_0x164eac){_0x3fe488=_0x164eac;_0x41ff83[_0x7e7d('0x33')]=_[_0x7e7d('0x35')](db[_0x7e7d('0x51')]['rawAttributes']);_0x41ff83[_0x7e7d('0x36')]=_[_0x7e7d('0x35')](_0x12cbd[_0x7e7d('0x36')]);_0x41ff83[_0x7e7d('0x37')]=_[_0x7e7d('0x38')](_0x41ff83[_0x7e7d('0x33')],_0x41ff83[_0x7e7d('0x36')]);_0x5160d8[_0x7e7d('0x39')]=_[_0x7e7d('0x38')](_0x41ff83['model'],qs[_0x7e7d('0x3a')](_0x12cbd[_0x7e7d('0x36')]['fields']));_0x5160d8[_0x7e7d('0x39')]=_0x5160d8[_0x7e7d('0x39')][_0x7e7d('0x3b')]?_0x5160d8[_0x7e7d('0x39')]:_0x41ff83[_0x7e7d('0x33')];_0x5160d8[_0x7e7d('0x3e')]=qs[_0x7e7d('0x3f')](_0x12cbd[_0x7e7d('0x36')][_0x7e7d('0x3f')]);_0x5160d8[_0x7e7d('0x40')]=qs[_0x7e7d('0x37')](_['pick'](_0x12cbd[_0x7e7d('0x36')],_0x41ff83[_0x7e7d('0x37')]));if(_0x12cbd[_0x7e7d('0x36')][_0x7e7d('0x41')]){_0x5160d8[_0x7e7d('0x40')]=_[_0x7e7d('0x43')](_0x5160d8[_0x7e7d('0x40')],{'$or':_[_0x7e7d('0x30')](_0x5160d8[_0x7e7d('0x39')],function(_0x49e1e0){var _0x14e8cb={};_0x14e8cb[_0x49e1e0]={'$like':'%'+_0x12cbd[_0x7e7d('0x36')][_0x7e7d('0x41')]+'%'};return _0x14e8cb;})});}_0x5160d8=_['merge']({},_0x5160d8,_0x12cbd['options']);return _0x3fe488[_0x7e7d('0x4f')](_0x5160d8);}})['then'](function(_0x1d411b){if(_0x1d411b){_0x2bbb4b=_0x1d411b[_0x7e7d('0x3b')];if(!_0x12cbd[_0x7e7d('0x36')][_0x7e7d('0x3c')](_0x7e7d('0x3d'))){_0x5160d8['limit']=qs[_0x7e7d('0x29')](_0x12cbd[_0x7e7d('0x36')][_0x7e7d('0x29')]);_0x5160d8[_0x7e7d('0x28')]=qs['offset'](_0x12cbd[_0x7e7d('0x36')][_0x7e7d('0x28')]);}return _0x3fe488[_0x7e7d('0x4f')](_0x5160d8);}})[_0x7e7d('0x44')](function(_0x2e58d9){if(_0x2e58d9){return _0x2e58d9?{'count':_0x2bbb4b,'rows':_0x2e58d9}:null;}})['then'](respondWithResult(_0xbf6216,null))[_0x7e7d('0x23')](handleError(_0xbf6216,null));};exports['addConfiguration']=function(_0x31dbda,_0x6cb3e7,_0x10a717){if(_0x31dbda['body']['id']){delete _0x31dbda[_0x7e7d('0x4e')]['id'];}return db[_0x7e7d('0x31')][_0x7e7d('0x50')]({'where':{'id':_0x31dbda[_0x7e7d('0x49')]['id']}})[_0x7e7d('0x44')](handleEntityNotFound(_0x6cb3e7,null))[_0x7e7d('0x44')](function(_0x39436a){if(_0x39436a){_0x31dbda[_0x7e7d('0x4e')][_0x7e7d('0x52')]=_0x39436a['id'];_0x31dbda[_0x7e7d('0x4e')][_0x7e7d('0x53')]=integrations[_0x7e7d('0x54')](_0x31dbda[_0x7e7d('0x4e')]['channel'],_0x31dbda['body']['type']);_0x31dbda[_0x7e7d('0x4e')]['Descriptions']=integrations['getDescriptions'](_0x31dbda['body'][_0x7e7d('0x55')],_0x31dbda[_0x7e7d('0x4e')]['type']);return db['VtigerConfiguration']['create'](_0x31dbda[_0x7e7d('0x4e')],{'include':[{'model':db[_0x7e7d('0x56')],'as':_0x7e7d('0x53')},{'model':db[_0x7e7d('0x56')],'as':_0x7e7d('0x57')}]});}return null;})[_0x7e7d('0x44')](respondWithResult(_0x6cb3e7,null))['catch'](handleError(_0x6cb3e7,null));};var md5=require(_0x7e7d('0x58'));exports[_0x7e7d('0x59')]=function(_0x66ffec,_0x45fd84,_0x1e1763){var _0x3241b4=null;var _0x38eb48=null;var _0x225673=null;var _0x529c09=null;var _0x5eacee='';return db['VtigerAccount'][_0x7e7d('0x50')]({'where':{'id':_0x66ffec[_0x7e7d('0x49')]['id']},'attributes':['id',_0x7e7d('0x34'),'username','description',_0x7e7d('0x5a'),_0x7e7d('0x5b'),_0x7e7d('0x5c'),_0x7e7d('0x5d')]})[_0x7e7d('0x44')](handleEntityNotFound(_0x45fd84,null))['then'](function(_0x466a98){if(_0x466a98){_0x3241b4=_0x466a98['username'];_0x38eb48=_0x466a98[_0x7e7d('0x5d')];_0x225673=_0x466a98['moduleName'];_0x5eacee=_0x466a98[_0x7e7d('0x5b')];var _0x59a939=_0x5eacee[_0x7e7d('0x5e')](-0x1);if(_0x59a939==='/'){_0x5eacee=_0x5eacee[_0x7e7d('0x5f')](0x0,_0x5eacee[_0x7e7d('0x60')](_0x59a939));}_0x529c09=util[_0x7e7d('0x61')](_0x7e7d('0x62'),_0x5eacee);var _0x42e0e5={'method':_0x7e7d('0x63'),'uri':_0x529c09,'qs':{'operation':_0x7e7d('0x64'),'username':_0x466a98[_0x7e7d('0x65')]},'json':!![]};return rp(_0x42e0e5);}})[_0x7e7d('0x44')](function(_0xda3fa8){if(_0xda3fa8[_0x7e7d('0x66')]){var _0x1ff17b={'method':_0x7e7d('0x67'),'uri':_0x529c09,'form':{'operation':_0x7e7d('0x68'),'username':_0x3241b4,'accessKey':md5(_0xda3fa8[_0x7e7d('0x22')][_0x7e7d('0x69')]+_0x38eb48)},'json':!![]};return rp(_0x1ff17b);}})[_0x7e7d('0x44')](function(_0x57cc6c){if(_0x57cc6c[_0x7e7d('0x66')]){var _0x19940d={'method':'GET','uri':_0x529c09,'qs':{'operation':_0x7e7d('0x6a'),'username':_0x3241b4,'sessionName':_0x57cc6c[_0x7e7d('0x22')][_0x7e7d('0x6b')],'elementType':_0x225673},'json':!![]};return rp(_0x19940d);}})[_0x7e7d('0x44')](function(_0x5370c0){if(_0x5370c0[_0x7e7d('0x66')]){var _0x1cc4e3=[_0x7e7d('0x6c'),_0x7e7d('0x6d'),_0x7e7d('0x6e')];_[_0x7e7d('0x6f')](_0x5370c0['result']['fields'],function(_0x16c276){return _0x1cc4e3[_0x7e7d('0x70')](_0x16c276[_0x7e7d('0x42')]['name']);});_[_0x7e7d('0x6f')](_0x5370c0['result'][_0x7e7d('0x3a')],function(_0x4ca1aa){return _0x4ca1aa[_0x7e7d('0x71')]===_0x7e7d('0x72');});return{'count':_0x5370c0[_0x7e7d('0x22')]['fields'][_0x7e7d('0x3b')],'rows':_['map'](_0x5370c0[_0x7e7d('0x22')][_0x7e7d('0x3a')],function(_0x4a1864){return{'id':_0x4a1864[_0x7e7d('0x34')],'name':_0x4a1864[_0x7e7d('0x73')],'custom':_[_0x7e7d('0x74')](_0x4a1864[_0x7e7d('0x34')],_0x7e7d('0x75'))?!![]:![],'options':_0x4a1864[_0x7e7d('0x42')][_0x7e7d('0x34')]===_0x7e7d('0x76')&&_0x4a1864[_0x7e7d('0x42')]['picklistValues'][_0x7e7d('0x3b')]>0x0?_[_0x7e7d('0x30')](_0x4a1864[_0x7e7d('0x42')][_0x7e7d('0x77')],function(_0xb278b2){return{'name':_0xb278b2[_0x7e7d('0x73')],'value':_0xb278b2[_0x7e7d('0x78')]};}):[]};})};}})[_0x7e7d('0x44')](respondWithResult(_0x45fd84,null))[_0x7e7d('0x23')](function(_0x304e86){console[_0x7e7d('0x79')](_0x7e7d('0x7a')+_0x304e86);var _0x13e360=_0x66ffec['query'][_0x7e7d('0x16')]?0x1f4:_0x304e86[_0x7e7d('0x7b')]||0x1f4;logger[_0x7e7d('0x1f')](_0x7e7d('0x7c'),'getFields',_0x13e360,JSON[_0x7e7d('0x1e')](_0x304e86));delete _0x304e86[_0x7e7d('0x34')];if(_0x13e360===0x191){_0x13e360=0x190;}_0x45fd84['status'](_0x13e360)[_0x7e7d('0x2f')](_0x66ffec[_0x7e7d('0x36')][_0x7e7d('0x16')]?{'message':_0x7e7d('0x7d'),'statusCode':_0x304e86[_0x7e7d('0x7b')]}:_0x304e86);});};
\ No newline at end of file
index 7313d28..790b638 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bd9=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x4a2511,_0x2fc49f){var _0x91763e=function(_0x40e3c6){while(--_0x40e3c6){_0x4a2511['push'](_0x4a2511['shift']());}};_0x91763e(++_0x2fc49f);}(_0x8bd9,0x1da));var _0x98bd=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x8bd9[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x98bd('0x0'));var util=require(_0x98bd('0x1'));var logger=require(_0x98bd('0x2'))('api');var moment=require(_0x98bd('0x3'));var BPromise=require('bluebird');var rp=require(_0x98bd('0x4'));var fs=require('fs');var path=require(_0x98bd('0x5'));var rimraf=require(_0x98bd('0x6'));var config=require(_0x98bd('0x7'));var attributes=require(_0x98bd('0x8'));var integrations=require(_0x98bd('0x9'));module[_0x98bd('0xa')]=function(_0x280e5b,_0x166578){return _0x280e5b[_0x98bd('0xb')](_0x98bd('0xc'),attributes,{'tableName':_0x98bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc438=['../../config/logger','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x473645,_0x587f2d){var _0x67c89e=function(_0x512178){while(--_0x512178){_0x473645['push'](_0x473645['shift']());}};_0x67c89e(++_0x587f2d);}(_0xc438,0x177));var _0x8c43=function(_0x488e64,_0x2a71ac){_0x488e64=_0x488e64-0x0;var _0x1e66ca=_0xc438[_0x488e64];return _0x1e66ca;};'use strict';var _=require(_0x8c43('0x0'));var util=require(_0x8c43('0x1'));var logger=require(_0x8c43('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8c43('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c43('0x4'));var rimraf=require(_0x8c43('0x5'));var config=require(_0x8c43('0x6'));var attributes=require(_0x8c43('0x7'));var integrations=require(_0x8c43('0x8'));module[_0x8c43('0x9')]=function(_0x2e17a9,_0x2f2883){return _0x2e17a9[_0x8c43('0xa')](_0x8c43('0xb'),attributes,{'tableName':_0x8c43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f74a1d..0d6d194 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06d5=['VtigerAccount','findAll','options','raw','attributes','include','map','model','GetVtigerAccount','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x06d5,0xf8));var _0x506d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x06d5[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x506d('0x0'));var util=require(_0x506d('0x1'));var moment=require(_0x506d('0x2'));var BPromise=require(_0x506d('0x3'));var rs=require(_0x506d('0x4'));var fs=require('fs');var Redis=require(_0x506d('0x5'));var db=require(_0x506d('0x6'))['db'];var utils=require(_0x506d('0x7'));var logger=require(_0x506d('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x506d('0x9'));var client=jayson[_0x506d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3033f1,_0x21b3cb,_0x3f6e64){return new BPromise(function(_0x1882e9,_0x50b231){return client[_0x506d('0xb')](_0x3033f1,_0x3f6e64)[_0x506d('0xc')](function(_0x2c6427){logger[_0x506d('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x21b3cb,_0x506d('0xe'));logger[_0x506d('0xf')](_0x506d('0x10'),_0x21b3cb,_0x506d('0xe'),JSON[_0x506d('0x11')](_0x2c6427));if(_0x2c6427['error']){if(_0x2c6427[_0x506d('0x12')][_0x506d('0x13')]===0x1f4){logger[_0x506d('0x12')](_0x506d('0x14'),_0x21b3cb,_0x2c6427[_0x506d('0x12')][_0x506d('0x15')]);return _0x50b231(_0x2c6427[_0x506d('0x12')][_0x506d('0x15')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x21b3cb,_0x2c6427[_0x506d('0x12')]['message']);return _0x1882e9(_0x2c6427[_0x506d('0x12')][_0x506d('0x15')]);}else{logger[_0x506d('0xd')](_0x506d('0x14'),_0x21b3cb,_0x506d('0xe'));_0x1882e9(_0x2c6427[_0x506d('0x16')]['message']);}})[_0x506d('0x17')](function(_0x3f4e1b){logger[_0x506d('0x12')](_0x506d('0x14'),_0x21b3cb,_0x3f4e1b);_0x50b231(_0x3f4e1b);});});}exports['GetVtigerAccount']=function(_0x92b7a8){var _0x45386b=this;return new Promise(function(_0xdb20f,_0xc626be){return db[_0x506d('0x18')][_0x506d('0x19')]({'raw':_0x92b7a8[_0x506d('0x1a')]?_0x92b7a8[_0x506d('0x1a')][_0x506d('0x1b')]===undefined?!![]:![]:!![],'where':_0x92b7a8['options']?_0x92b7a8['options']['where']||null:null,'attributes':_0x92b7a8[_0x506d('0x1a')]?_0x92b7a8['options'][_0x506d('0x1c')]||null:null,'limit':_0x92b7a8[_0x506d('0x1a')]?_0x92b7a8[_0x506d('0x1a')]['limit']||null:null,'include':_0x92b7a8[_0x506d('0x1a')]?_0x92b7a8[_0x506d('0x1a')][_0x506d('0x1d')]?_[_0x506d('0x1e')](_0x92b7a8[_0x506d('0x1a')]['include'],function(_0x16343f){return{'model':db[_0x16343f[_0x506d('0x1f')]],'as':_0x16343f['as'],'attributes':_0x16343f[_0x506d('0x1c')],'include':_0x16343f['include']?_[_0x506d('0x1e')](_0x16343f[_0x506d('0x1d')],function(_0x1eb963){return{'model':db[_0x1eb963['model']],'as':_0x1eb963['as'],'attributes':_0x1eb963[_0x506d('0x1c')],'include':_0x1eb963[_0x506d('0x1d')]?_[_0x506d('0x1e')](_0x1eb963[_0x506d('0x1d')],function(_0x2ad145){return{'model':db[_0x2ad145['model']],'as':_0x2ad145['as'],'attributes':_0x2ad145['attributes']};}):[]};}):[]};}):[]:[]})[_0x506d('0xc')](function(_0x141d76){logger['info'](_0x506d('0x20'),_0x92b7a8);logger[_0x506d('0xf')](_0x506d('0x20'),_0x92b7a8,JSON['stringify'](_0x141d76));_0xdb20f(_0x141d76);})['catch'](function(_0x3e72c2){logger[_0x506d('0x12')](_0x506d('0x20'),_0x3e72c2['message'],_0x92b7a8);_0xc626be(_0x45386b[_0x506d('0x12')](0x1f4,_0x3e72c2[_0x506d('0x15')]));});});};exports[_0x506d('0x21')]=function(_0x42544b){var _0x5e3e0b=this;return new Promise(function(_0x272cb0,_0x3dd7b0){return db[_0x506d('0x18')]['find']({'raw':_0x42544b[_0x506d('0x1a')]?_0x42544b[_0x506d('0x1a')][_0x506d('0x1b')]===undefined?!![]:![]:!![],'where':_0x42544b[_0x506d('0x1a')]?_0x42544b[_0x506d('0x1a')]['where']||null:null,'attributes':_0x42544b[_0x506d('0x1a')]?_0x42544b[_0x506d('0x1a')][_0x506d('0x1c')]||null:null,'include':_0x42544b[_0x506d('0x1a')]?_0x42544b[_0x506d('0x1a')][_0x506d('0x1d')]?_[_0x506d('0x1e')](_0x42544b['options'][_0x506d('0x1d')],function(_0x362157){return{'model':db[_0x362157[_0x506d('0x1f')]],'as':_0x362157['as'],'attributes':_0x362157['attributes'],'include':_0x362157[_0x506d('0x1d')]?_[_0x506d('0x1e')](_0x362157['include'],function(_0x21b1e){return{'model':db[_0x21b1e['model']],'as':_0x21b1e['as'],'attributes':_0x21b1e['attributes'],'include':_0x21b1e['include']?_['map'](_0x21b1e[_0x506d('0x1d')],function(_0x34e65f){return{'model':db[_0x34e65f['model']],'as':_0x34e65f['as'],'attributes':_0x34e65f[_0x506d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2121d7){logger[_0x506d('0xd')](_0x506d('0x21'),_0x42544b);logger['debug'](_0x506d('0x21'),_0x42544b,JSON['stringify'](_0x2121d7));_0x272cb0(_0x2121d7);})['catch'](function(_0x3abd04){logger[_0x506d('0x12')](_0x506d('0x21'),_0x3abd04[_0x506d('0x15')],_0x42544b);_0x3dd7b0(_0x5e3e0b['error'](0x1f4,_0x3abd04[_0x506d('0x15')]));});});};
\ No newline at end of file
+var _0x861c=['http','request','then','info','request\x20sent','debug','stringify','code','error','VtigerAccount,\x20%s,\x20%s','message','GetVtigerAccount','findAll','raw','options','where','attributes','limit','include','map','model','catch','ShowVtigerAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x2a2011,_0x4877bb){var _0x209df8=function(_0x768eac){while(--_0x768eac){_0x2a2011['push'](_0x2a2011['shift']());}};_0x209df8(++_0x4877bb);}(_0x861c,0x77));var _0xc861=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x861c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var moment=require('moment');var BPromise=require(_0xc861('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc861('0x3'));var db=require(_0xc861('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc861('0x5'))(_0xc861('0x6'));var config=require('../../config/environment');var jayson=require(_0xc861('0x7'));var client=jayson[_0xc861('0x8')][_0xc861('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40aa71,_0x10d52f,_0x183820){return new BPromise(function(_0x11869a,_0x5399f7){return client[_0xc861('0xa')](_0x40aa71,_0x183820)[_0xc861('0xb')](function(_0x2957a9){logger[_0xc861('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x10d52f,_0xc861('0xd'));logger[_0xc861('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x10d52f,_0xc861('0xd'),JSON[_0xc861('0xf')](_0x2957a9));if(_0x2957a9['error']){if(_0x2957a9['error'][_0xc861('0x10')]===0x1f4){logger[_0xc861('0x11')](_0xc861('0x12'),_0x10d52f,_0x2957a9['error'][_0xc861('0x13')]);return _0x5399f7(_0x2957a9[_0xc861('0x11')][_0xc861('0x13')]);}logger[_0xc861('0x11')](_0xc861('0x12'),_0x10d52f,_0x2957a9[_0xc861('0x11')][_0xc861('0x13')]);return _0x11869a(_0x2957a9[_0xc861('0x11')][_0xc861('0x13')]);}else{logger[_0xc861('0xc')](_0xc861('0x12'),_0x10d52f,_0xc861('0xd'));_0x11869a(_0x2957a9['result'][_0xc861('0x13')]);}})['catch'](function(_0x23ee58){logger[_0xc861('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x10d52f,_0x23ee58);_0x5399f7(_0x23ee58);});});}exports[_0xc861('0x14')]=function(_0x154103){var _0x489525=this;return new Promise(function(_0x21eae9,_0x262b16){return db['VtigerAccount'][_0xc861('0x15')]({'raw':_0x154103['options']?_0x154103['options'][_0xc861('0x16')]===undefined?!![]:![]:!![],'where':_0x154103[_0xc861('0x17')]?_0x154103['options'][_0xc861('0x18')]||null:null,'attributes':_0x154103['options']?_0x154103[_0xc861('0x17')][_0xc861('0x19')]||null:null,'limit':_0x154103[_0xc861('0x17')]?_0x154103['options'][_0xc861('0x1a')]||null:null,'include':_0x154103[_0xc861('0x17')]?_0x154103[_0xc861('0x17')]['include']?_['map'](_0x154103[_0xc861('0x17')][_0xc861('0x1b')],function(_0x2b9730){return{'model':db[_0x2b9730['model']],'as':_0x2b9730['as'],'attributes':_0x2b9730['attributes'],'include':_0x2b9730[_0xc861('0x1b')]?_[_0xc861('0x1c')](_0x2b9730[_0xc861('0x1b')],function(_0x5db521){return{'model':db[_0x5db521[_0xc861('0x1d')]],'as':_0x5db521['as'],'attributes':_0x5db521[_0xc861('0x19')],'include':_0x5db521['include']?_[_0xc861('0x1c')](_0x5db521[_0xc861('0x1b')],function(_0x4b10c6){return{'model':db[_0x4b10c6[_0xc861('0x1d')]],'as':_0x4b10c6['as'],'attributes':_0x4b10c6[_0xc861('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc861('0xb')](function(_0x3083fa){logger[_0xc861('0xc')](_0xc861('0x14'),_0x154103);logger['debug'](_0xc861('0x14'),_0x154103,JSON[_0xc861('0xf')](_0x3083fa));_0x21eae9(_0x3083fa);})[_0xc861('0x1e')](function(_0x4614f5){logger['error']('GetVtigerAccount',_0x4614f5[_0xc861('0x13')],_0x154103);_0x262b16(_0x489525[_0xc861('0x11')](0x1f4,_0x4614f5['message']));});});};exports['ShowVtigerAccount']=function(_0x27d7bd){var _0x43e691=this;return new Promise(function(_0xf2fe70,_0x4f4730){return db['VtigerAccount']['find']({'raw':_0x27d7bd[_0xc861('0x17')]?_0x27d7bd['options'][_0xc861('0x16')]===undefined?!![]:![]:!![],'where':_0x27d7bd[_0xc861('0x17')]?_0x27d7bd['options'][_0xc861('0x18')]||null:null,'attributes':_0x27d7bd[_0xc861('0x17')]?_0x27d7bd['options']['attributes']||null:null,'include':_0x27d7bd[_0xc861('0x17')]?_0x27d7bd[_0xc861('0x17')][_0xc861('0x1b')]?_[_0xc861('0x1c')](_0x27d7bd[_0xc861('0x17')][_0xc861('0x1b')],function(_0x4fd211){return{'model':db[_0x4fd211[_0xc861('0x1d')]],'as':_0x4fd211['as'],'attributes':_0x4fd211['attributes'],'include':_0x4fd211[_0xc861('0x1b')]?_[_0xc861('0x1c')](_0x4fd211[_0xc861('0x1b')],function(_0x1a1604){return{'model':db[_0x1a1604[_0xc861('0x1d')]],'as':_0x1a1604['as'],'attributes':_0x1a1604[_0xc861('0x19')],'include':_0x1a1604[_0xc861('0x1b')]?_[_0xc861('0x1c')](_0x1a1604[_0xc861('0x1b')],function(_0x51d781){return{'model':db[_0x51d781[_0xc861('0x1d')]],'as':_0x51d781['as'],'attributes':_0x51d781[_0xc861('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc861('0xb')](function(_0x57d680){logger[_0xc861('0xc')](_0xc861('0x1f'),_0x27d7bd);logger['debug'](_0xc861('0x1f'),_0x27d7bd,JSON['stringify'](_0x57d680));_0xf2fe70(_0x57d680);})[_0xc861('0x1e')](function(_0x2617d5){logger[_0xc861('0x11')](_0xc861('0x1f'),_0x2617d5[_0xc861('0x13')],_0x27d7bd);_0x4f4730(_0x43e691[_0xc861('0x11')](0x1f4,_0x2617d5[_0xc861('0x13')]));});});};
\ No newline at end of file
index 6369714..83aa307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x4f6412,_0x4c06fa){var _0x23a4b5=function(_0x394537){while(--_0x394537){_0x4f6412['push'](_0x4f6412['shift']());}};_0x23a4b5(++_0x4c06fa);}(_0xb10b,0x12a));var _0xbb10=function(_0xb4fe2c,_0x3d2be6){_0xb4fe2c=_0xb4fe2c-0x0;var _0x460a1a=_0xb10b[_0xb4fe2c];return _0x460a1a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router;
\ No newline at end of file
+var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router;
\ No newline at end of file
index 6b140a1..5236110 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dde=['STRING','sequelize'];(function(_0x23fbc6,_0x8a1f98){var _0x3df42e=function(_0x2abaa3){while(--_0x2abaa3){_0x23fbc6['push'](_0x23fbc6['shift']());}};_0x3df42e(++_0x8a1f98);}(_0x2dde,0xbb));var _0xe2dd=function(_0x62d0f,_0x4f2247){_0x62d0f=_0x62d0f-0x0;var _0x516f45=_0x2dde[_0x62d0f];return _0x516f45;};'use strict';var Sequelize=require(_0xe2dd('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe2dd('0x1')]}};
\ No newline at end of file
+var _0x9505=['sequelize','exports','STRING'];(function(_0x153e07,_0x407706){var _0x29cbc7=function(_0x3b4c58){while(--_0x3b4c58){_0x153e07['push'](_0x153e07['shift']());}};_0x29cbc7(++_0x407706);}(_0x9505,0x1b9));var _0x5950=function(_0x2c6c4f,_0x2344fb){_0x2c6c4f=_0x2c6c4f-0x0;var _0x3d9847=_0x9505[_0x2c6c4f];return _0x3d9847;};'use strict';var Sequelize=require(_0x5950('0x0'));module[_0x5950('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5950('0x2')]}};
\ No newline at end of file
index ee4c46d..7f11338 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35d4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','count','offset','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','fields','attributes','length','hasOwnProperty','limit','sort','pick','where','VIRTUAL','filter','merge','options','VtigerConfiguration','includeAll','include','findAll','show','params','keys','intersection','create','body','find','getFields','findOne','VtigerField','getSubjects','order','nolimit','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x35d4,0x170));var _0x435d=function(_0x67125f,_0x5aa43c){_0x67125f=_0x67125f-0x0;var _0x413840=_0x35d4[_0x67125f];return _0x413840;};'use strict';var pdf=require(_0x435d('0x0'));var emlformat=require(_0x435d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x435d('0x2'));var jsonpatch=require(_0x435d('0x3'));var rp=require(_0x435d('0x4'));var moment=require(_0x435d('0x5'));var BPromise=require(_0x435d('0x6'));var Mustache=require(_0x435d('0x7'));var util=require(_0x435d('0x8'));var path=require(_0x435d('0x9'));var sox=require(_0x435d('0xa'));var csv=require(_0x435d('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x435d('0xc'));var squel=require(_0x435d('0xd'));var crypto=require(_0x435d('0xe'));var jsforce=require(_0x435d('0xf'));var deskjs=require(_0x435d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x435d('0x11'));var Redis=require(_0x435d('0x12'));var authService=require(_0x435d('0x13'));var qs=require(_0x435d('0x14'));var as=require(_0x435d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x435d('0x16'))(_0x435d('0x17'));var utils=require(_0x435d('0x18'));var config=require(_0x435d('0x19'));var db=require(_0x435d('0x1a'))['db'];var jayson=require(_0x435d('0x1b'));var client=jayson[_0x435d('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x1a59b7,_0x523fcc,_0x1e4234){if(_0x1e4234){var _0x516f1a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x516f1a[_0x435d('0x1d')](_0x523fcc)){return _0x1a59b7;}else{throw new db['Sequelize'][(_0x435d('0x1e'))](_0x435d('0x1f'));}}else{return _0x1a59b7;}}function respondWithRpcPromise(_0x3502a5,_0x42cdf3,_0xd4843,_0x585755){return new BPromise(function(_0x22c1a4,_0x24c893){var _0x4097c5=_0x585755||client;return _0x4097c5[_0x435d('0x20')](_0x3502a5,_0xd4843)[_0x435d('0x21')](function(_0x40acec){logger[_0x435d('0x22')](_0x435d('0x23'),_0x42cdf3,_0x435d('0x24'));logger[_0x435d('0x25')](_0x435d('0x26'),_0x42cdf3,_0x435d('0x24'),JSON[_0x435d('0x27')](_0x40acec));if(_0x40acec[_0x435d('0x28')]){if(_0x40acec[_0x435d('0x28')][_0x435d('0x29')]===0x1f4){logger['error'](_0x435d('0x23'),_0x42cdf3,_0x40acec[_0x435d('0x28')][_0x435d('0x2a')]);return _0x24c893(_0x40acec[_0x435d('0x28')][_0x435d('0x2a')]);}logger[_0x435d('0x28')]('VtigerConfiguration,\x20%s,\x20%s',_0x42cdf3,_0x40acec[_0x435d('0x28')][_0x435d('0x2a')]);return _0x22c1a4(_0x40acec[_0x435d('0x28')][_0x435d('0x2a')]);}else{logger['info'](_0x435d('0x23'),_0x42cdf3,_0x435d('0x24'));_0x22c1a4(_0x40acec['result'][_0x435d('0x2a')]);}})[_0x435d('0x2b')](function(_0x38a7e4){logger[_0x435d('0x28')](_0x435d('0x23'),_0x42cdf3,_0x38a7e4);_0x24c893(_0x38a7e4);});});}function respondWithStatusCode(_0x1f5138,_0x217d80){_0x217d80=_0x217d80||0xcc;return function(_0x4d89b1){if(_0x4d89b1){return _0x1f5138['sendStatus'](_0x217d80);}return _0x1f5138['status'](_0x217d80)[_0x435d('0x2c')]();};}function respondWithResult(_0x1266d0,_0x59e80b){_0x59e80b=_0x59e80b||0xc8;return function(_0x4237a2){if(_0x4237a2){return _0x1266d0[_0x435d('0x2d')](_0x59e80b)['json'](_0x4237a2);}};}function respondWithFilteredResult(_0x3cf2cc,_0x40e960){return function(_0x51785a){if(_0x51785a){var _0x154832=_0x51785a[_0x435d('0x2e')],_0x4a2a3a=_0x40e960[_0x435d('0x2f')],_0x7d3acf=_0x40e960['offset']+_0x40e960['limit'],_0x341e5b;if(_0x7d3acf>=_0x154832){_0x7d3acf=_0x154832;_0x341e5b=0xc8;}else{_0x341e5b=0xce;}_0x3cf2cc[_0x435d('0x2d')](_0x341e5b);return _0x3cf2cc[_0x435d('0x30')](_0x435d('0x31'),_0x4a2a3a+'-'+_0x7d3acf+'/'+_0x154832)[_0x435d('0x32')](_0x51785a);}return null;};}function patchUpdates(_0x108d71){return function(_0x5cec41){try{jsonpatch['apply'](_0x5cec41,_0x108d71,!![]);}catch(_0x763b9d){return BPromise[_0x435d('0x33')](_0x763b9d);}return _0x5cec41[_0x435d('0x34')]();};}function saveUpdates(_0x4bf1de,_0x2753a1){return function(_0x13a791){if(_0x13a791){return _0x13a791[_0x435d('0x35')](_0x4bf1de)[_0x435d('0x21')](function(_0x2d870b){return _0x2d870b;});}return null;};}function removeEntity(_0x203964,_0x3a794d){return function(_0x488636){if(_0x488636){return _0x488636[_0x435d('0x36')]()[_0x435d('0x21')](function(){_0x203964[_0x435d('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47590d,_0x1ac5b6){return function(_0x923086){if(!_0x923086){_0x47590d[_0x435d('0x37')](0x194);}return _0x923086;};}function handleError(_0x5d7589,_0x32080c){_0x32080c=_0x32080c||0x1f4;return function(_0x139b60){logger[_0x435d('0x28')](_0x139b60[_0x435d('0x38')]);if(_0x139b60[_0x435d('0x39')]){delete _0x139b60[_0x435d('0x39')];}_0x5d7589[_0x435d('0x2d')](_0x32080c)[_0x435d('0x3a')](_0x139b60);};}exports['index']=function(_0x3ef83f,_0x46a105){var _0x4f8882={},_0xd1c3c={},_0x3a1f05={'count':0x0,'rows':[]};var _0x51caef=_['map'](db['VtigerConfiguration'][_0x435d('0x3b')],function(_0x6749b7){return{'name':_0x6749b7[_0x435d('0x3c')],'type':_0x6749b7[_0x435d('0x3d')][_0x435d('0x3e')]};});_0xd1c3c[_0x435d('0x3f')]=_[_0x435d('0x40')](_0x51caef,_0x435d('0x39'));_0xd1c3c[_0x435d('0x41')]=_['keys'](_0x3ef83f[_0x435d('0x41')]);_0xd1c3c[_0x435d('0x42')]=_['intersection'](_0xd1c3c[_0x435d('0x3f')],_0xd1c3c[_0x435d('0x41')]);_0x4f8882['attributes']=_['intersection'](_0xd1c3c['model'],qs[_0x435d('0x43')](_0x3ef83f['query'][_0x435d('0x43')]));_0x4f8882[_0x435d('0x44')]=_0x4f8882[_0x435d('0x44')][_0x435d('0x45')]?_0x4f8882[_0x435d('0x44')]:_0xd1c3c[_0x435d('0x3f')];if(!_0x3ef83f['query'][_0x435d('0x46')]('nolimit')){_0x4f8882[_0x435d('0x47')]=qs['limit'](_0x3ef83f[_0x435d('0x41')]['limit']);_0x4f8882[_0x435d('0x2f')]=qs[_0x435d('0x2f')](_0x3ef83f[_0x435d('0x41')][_0x435d('0x2f')]);}_0x4f8882['order']=qs['sort'](_0x3ef83f['query'][_0x435d('0x48')]);_0x4f8882['where']=qs[_0x435d('0x42')](_[_0x435d('0x49')](_0x3ef83f[_0x435d('0x41')],_0xd1c3c[_0x435d('0x42')]),_0x51caef);if(_0x3ef83f[_0x435d('0x41')]['filter']){_0x4f8882[_0x435d('0x4a')]=_['merge'](_0x4f8882['where'],{'$or':_[_0x435d('0x40')](_0x51caef,function(_0x5898f1){if(_0x5898f1[_0x435d('0x3d')]!==_0x435d('0x4b')){var _0x191500={};_0x191500[_0x5898f1[_0x435d('0x39')]]={'$like':'%'+_0x3ef83f[_0x435d('0x41')][_0x435d('0x4c')]+'%'};return _0x191500;}})});}_0x4f8882=_[_0x435d('0x4d')]({},_0x4f8882,_0x3ef83f[_0x435d('0x4e')]);var _0x337edc={'where':_0x4f8882[_0x435d('0x4a')]};return db[_0x435d('0x4f')][_0x435d('0x2e')](_0x337edc)[_0x435d('0x21')](function(_0x1cb090){_0x3a1f05['count']=_0x1cb090;if(_0x3ef83f[_0x435d('0x41')][_0x435d('0x50')]){_0x4f8882[_0x435d('0x51')]=[{'all':!![]}];}return db[_0x435d('0x4f')][_0x435d('0x52')](_0x4f8882);})[_0x435d('0x21')](function(_0x337d8d){_0x3a1f05['rows']=_0x337d8d;return _0x3a1f05;})[_0x435d('0x21')](respondWithFilteredResult(_0x46a105,_0x4f8882))['catch'](handleError(_0x46a105,null));};exports[_0x435d('0x53')]=function(_0x3b6349,_0x26acf1){var _0x359d0b={'raw':![],'where':{'id':_0x3b6349[_0x435d('0x54')]['id']}},_0x4344e5={};_0x4344e5['model']=_[_0x435d('0x55')](db[_0x435d('0x4f')]['rawAttributes']);_0x4344e5[_0x435d('0x41')]=_[_0x435d('0x55')](_0x3b6349[_0x435d('0x41')]);_0x4344e5[_0x435d('0x42')]=_[_0x435d('0x56')](_0x4344e5[_0x435d('0x3f')],_0x4344e5[_0x435d('0x41')]);_0x359d0b[_0x435d('0x44')]=_[_0x435d('0x56')](_0x4344e5[_0x435d('0x3f')],qs['fields'](_0x3b6349['query'][_0x435d('0x43')]));_0x359d0b[_0x435d('0x44')]=_0x359d0b[_0x435d('0x44')][_0x435d('0x45')]?_0x359d0b[_0x435d('0x44')]:_0x4344e5[_0x435d('0x3f')];if(_0x3b6349['query'][_0x435d('0x50')]){_0x359d0b[_0x435d('0x51')]=[{'all':!![]}];}_0x359d0b=_['merge']({},_0x359d0b,_0x3b6349[_0x435d('0x4e')]);return db[_0x435d('0x4f')]['find'](_0x359d0b)['then'](handleEntityNotFound(_0x26acf1,null))[_0x435d('0x21')](respondWithResult(_0x26acf1,null))[_0x435d('0x2b')](handleError(_0x26acf1,null));};exports[_0x435d('0x57')]=function(_0x10b703,_0x647216){return db[_0x435d('0x4f')]['create'](_0x10b703[_0x435d('0x58')],{})[_0x435d('0x21')](respondWithResult(_0x647216,0xc9))[_0x435d('0x2b')](handleError(_0x647216,null));};exports[_0x435d('0x35')]=function(_0x355c48,_0x32b566){if(_0x355c48['body']['id']){delete _0x355c48[_0x435d('0x58')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x355c48[_0x435d('0x54')]['id']}})['then'](handleEntityNotFound(_0x32b566,null))[_0x435d('0x21')](saveUpdates(_0x355c48[_0x435d('0x58')],null))[_0x435d('0x21')](respondWithResult(_0x32b566,null))[_0x435d('0x2b')](handleError(_0x32b566,null));};exports['destroy']=function(_0x2c1d13,_0x5099ea){return db[_0x435d('0x4f')][_0x435d('0x59')]({'where':{'id':_0x2c1d13[_0x435d('0x54')]['id']}})['then'](handleEntityNotFound(_0x5099ea,null))['then'](removeEntity(_0x5099ea,null))[_0x435d('0x2b')](handleError(_0x5099ea,null));};exports[_0x435d('0x5a')]=function(_0x54ae13,_0x4cb33d,_0x1f050f){var _0x30f668={};var _0x58e9da={};var _0xb9765a;var _0x57c64d;return db['VtigerConfiguration'][_0x435d('0x5b')]({'where':{'id':_0x54ae13[_0x435d('0x54')]['id']}})[_0x435d('0x21')](handleEntityNotFound(_0x4cb33d,null))[_0x435d('0x21')](function(_0x141a0a){if(_0x141a0a){_0xb9765a=_0x141a0a;_0x58e9da['model']=_[_0x435d('0x55')](db[_0x435d('0x5c')][_0x435d('0x3b')]);_0x58e9da[_0x435d('0x41')]=_[_0x435d('0x55')](_0x54ae13[_0x435d('0x41')]);_0x58e9da[_0x435d('0x42')]=_[_0x435d('0x56')](_0x58e9da['model'],_0x58e9da[_0x435d('0x41')]);_0x30f668['attributes']=_[_0x435d('0x56')](_0x58e9da['model'],qs[_0x435d('0x43')](_0x54ae13[_0x435d('0x41')][_0x435d('0x43')]));_0x30f668['attributes']=_0x30f668[_0x435d('0x44')][_0x435d('0x45')]?_0x30f668['attributes']:_0x58e9da['model'];_0x30f668['order']=qs[_0x435d('0x48')](_0x54ae13['query']['sort']);_0x30f668[_0x435d('0x4a')]=qs[_0x435d('0x42')](_[_0x435d('0x49')](_0x54ae13[_0x435d('0x41')],_0x58e9da['filters']));if(_0x54ae13['query']['filter']){_0x30f668[_0x435d('0x4a')]=_['merge'](_0x30f668[_0x435d('0x4a')],{'$or':_[_0x435d('0x40')](_0x30f668[_0x435d('0x44')],function(_0x13f7c5){var _0x25c8dc={};_0x25c8dc[_0x13f7c5]={'$like':'%'+_0x54ae13[_0x435d('0x41')][_0x435d('0x4c')]+'%'};return _0x25c8dc;})});}_0x30f668=_[_0x435d('0x4d')]({},_0x30f668,_0x54ae13[_0x435d('0x4e')]);return _0xb9765a[_0x435d('0x5a')](_0x30f668);}})[_0x435d('0x21')](function(_0x8e8ae8){if(_0x8e8ae8){_0x57c64d=_0x8e8ae8[_0x435d('0x45')];if(!_0x54ae13['query'][_0x435d('0x46')]('nolimit')){_0x30f668[_0x435d('0x47')]=qs[_0x435d('0x47')](_0x54ae13[_0x435d('0x41')][_0x435d('0x47')]);_0x30f668[_0x435d('0x2f')]=qs['offset'](_0x54ae13[_0x435d('0x41')][_0x435d('0x2f')]);}return _0xb9765a['getFields'](_0x30f668);}})[_0x435d('0x21')](function(_0x2a2b77){if(_0x2a2b77){return _0x2a2b77?{'count':_0x57c64d,'rows':_0x2a2b77}:null;}})[_0x435d('0x21')](respondWithResult(_0x4cb33d,null))['catch'](handleError(_0x4cb33d,null));};exports[_0x435d('0x5d')]=function(_0x377616,_0x2cc828,_0x27a0d8){var _0xdcef06={};var _0x1fe5ea={};var _0x168b92;var _0x15fbd8;return db['VtigerConfiguration'][_0x435d('0x5b')]({'where':{'id':_0x377616[_0x435d('0x54')]['id']}})[_0x435d('0x21')](handleEntityNotFound(_0x2cc828,null))['then'](function(_0xaf240a){if(_0xaf240a){_0x168b92=_0xaf240a;_0x1fe5ea[_0x435d('0x3f')]=_['keys'](db[_0x435d('0x5c')][_0x435d('0x3b')]);_0x1fe5ea['query']=_[_0x435d('0x55')](_0x377616[_0x435d('0x41')]);_0x1fe5ea[_0x435d('0x42')]=_[_0x435d('0x56')](_0x1fe5ea[_0x435d('0x3f')],_0x1fe5ea[_0x435d('0x41')]);_0xdcef06['attributes']=_[_0x435d('0x56')](_0x1fe5ea[_0x435d('0x3f')],qs['fields'](_0x377616[_0x435d('0x41')][_0x435d('0x43')]));_0xdcef06[_0x435d('0x44')]=_0xdcef06[_0x435d('0x44')][_0x435d('0x45')]?_0xdcef06[_0x435d('0x44')]:_0x1fe5ea[_0x435d('0x3f')];_0xdcef06[_0x435d('0x5e')]=qs[_0x435d('0x48')](_0x377616[_0x435d('0x41')][_0x435d('0x48')]);_0xdcef06[_0x435d('0x4a')]=qs[_0x435d('0x42')](_[_0x435d('0x49')](_0x377616['query'],_0x1fe5ea[_0x435d('0x42')]));if(_0x377616[_0x435d('0x41')][_0x435d('0x4c')]){_0xdcef06[_0x435d('0x4a')]=_[_0x435d('0x4d')](_0xdcef06[_0x435d('0x4a')],{'$or':_[_0x435d('0x40')](_0xdcef06[_0x435d('0x44')],function(_0x639202){var _0x2d187f={};_0x2d187f[_0x639202]={'$like':'%'+_0x377616[_0x435d('0x41')][_0x435d('0x4c')]+'%'};return _0x2d187f;})});}_0xdcef06=_[_0x435d('0x4d')]({},_0xdcef06,_0x377616[_0x435d('0x4e')]);return _0x168b92[_0x435d('0x5d')](_0xdcef06);}})[_0x435d('0x21')](function(_0x4255cf){if(_0x4255cf){_0x15fbd8=_0x4255cf[_0x435d('0x45')];if(!_0x377616[_0x435d('0x41')][_0x435d('0x46')](_0x435d('0x5f'))){_0xdcef06[_0x435d('0x47')]=qs[_0x435d('0x47')](_0x377616[_0x435d('0x41')][_0x435d('0x47')]);_0xdcef06[_0x435d('0x2f')]=qs[_0x435d('0x2f')](_0x377616[_0x435d('0x41')][_0x435d('0x2f')]);}return _0x168b92[_0x435d('0x5d')](_0xdcef06);}})[_0x435d('0x21')](function(_0x6a11a7){if(_0x6a11a7){return _0x6a11a7?{'count':_0x15fbd8,'rows':_0x6a11a7}:null;}})[_0x435d('0x21')](respondWithResult(_0x2cc828,null))['catch'](handleError(_0x2cc828,null));};exports['getDescriptions']=function(_0x21f580,_0x3e9782,_0x4048c7){var _0x1fed49={};var _0x139cfc={};var _0x44b3d8;var _0x3f0931;return db[_0x435d('0x4f')][_0x435d('0x5b')]({'where':{'id':_0x21f580[_0x435d('0x54')]['id']}})[_0x435d('0x21')](handleEntityNotFound(_0x3e9782,null))[_0x435d('0x21')](function(_0x21ff9f){if(_0x21ff9f){_0x44b3d8=_0x21ff9f;_0x139cfc[_0x435d('0x3f')]=_['keys'](db['VtigerField'][_0x435d('0x3b')]);_0x139cfc[_0x435d('0x41')]=_['keys'](_0x21f580[_0x435d('0x41')]);_0x139cfc[_0x435d('0x42')]=_[_0x435d('0x56')](_0x139cfc[_0x435d('0x3f')],_0x139cfc[_0x435d('0x41')]);_0x1fed49[_0x435d('0x44')]=_['intersection'](_0x139cfc[_0x435d('0x3f')],qs[_0x435d('0x43')](_0x21f580[_0x435d('0x41')][_0x435d('0x43')]));_0x1fed49[_0x435d('0x44')]=_0x1fed49[_0x435d('0x44')][_0x435d('0x45')]?_0x1fed49['attributes']:_0x139cfc[_0x435d('0x3f')];_0x1fed49[_0x435d('0x5e')]=qs[_0x435d('0x48')](_0x21f580[_0x435d('0x41')][_0x435d('0x48')]);_0x1fed49['where']=qs[_0x435d('0x42')](_[_0x435d('0x49')](_0x21f580[_0x435d('0x41')],_0x139cfc[_0x435d('0x42')]));if(_0x21f580[_0x435d('0x41')]['filter']){_0x1fed49[_0x435d('0x4a')]=_[_0x435d('0x4d')](_0x1fed49[_0x435d('0x4a')],{'$or':_[_0x435d('0x40')](_0x1fed49[_0x435d('0x44')],function(_0x18d17a){var _0x348eb9={};_0x348eb9[_0x18d17a]={'$like':'%'+_0x21f580[_0x435d('0x41')][_0x435d('0x4c')]+'%'};return _0x348eb9;})});}_0x1fed49=_[_0x435d('0x4d')]({},_0x1fed49,_0x21f580[_0x435d('0x4e')]);return _0x44b3d8[_0x435d('0x60')](_0x1fed49);}})['then'](function(_0x4b0a22){if(_0x4b0a22){_0x3f0931=_0x4b0a22['length'];if(!_0x21f580[_0x435d('0x41')][_0x435d('0x46')]('nolimit')){_0x1fed49[_0x435d('0x47')]=qs[_0x435d('0x47')](_0x21f580['query'][_0x435d('0x47')]);_0x1fed49[_0x435d('0x2f')]=qs[_0x435d('0x2f')](_0x21f580[_0x435d('0x41')][_0x435d('0x2f')]);}return _0x44b3d8['getDescriptions'](_0x1fed49);}})[_0x435d('0x21')](function(_0x4965c2){if(_0x4965c2){return _0x4965c2?{'count':_0x3f0931,'rows':_0x4965c2}:null;}})['then'](respondWithResult(_0x3e9782,null))['catch'](handleError(_0x3e9782,null));};
\ No newline at end of file
+var _0x5e5b=['create','body','findOne','VtigerField','getFields','getSubjects','getDescriptions','merge','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','name','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','VtigerConfiguration','include','params','includeAll','find'];(function(_0x3f86d7,_0x37a9c9){var _0x1afc5f=function(_0x148610){while(--_0x148610){_0x3f86d7['push'](_0x3f86d7['shift']());}};_0x1afc5f(++_0x37a9c9);}(_0x5e5b,0x113));var _0xb5e5=function(_0x372ca0,_0x598311){_0x372ca0=_0x372ca0-0x0;var _0x332594=_0x5e5b[_0x372ca0];return _0x332594;};'use strict';var pdf=require(_0xb5e5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb5e5('0x1'));var jsonpatch=require(_0xb5e5('0x2'));var rp=require(_0xb5e5('0x3'));var moment=require(_0xb5e5('0x4'));var BPromise=require(_0xb5e5('0x5'));var Mustache=require(_0xb5e5('0x6'));var util=require(_0xb5e5('0x7'));var path=require(_0xb5e5('0x8'));var sox=require(_0xb5e5('0x9'));var csv=require(_0xb5e5('0xa'));var ejs=require(_0xb5e5('0xb'));var fs=require('fs');var _=require(_0xb5e5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb5e5('0xd'));var deskjs=require(_0xb5e5('0xe'));var toCsv=require(_0xb5e5('0xa'));var querystring=require(_0xb5e5('0xf'));var Papa=require('papaparse');var Redis=require(_0xb5e5('0x10'));var authService=require(_0xb5e5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5e5('0x12'));var logger=require(_0xb5e5('0x13'))(_0xb5e5('0x14'));var utils=require(_0xb5e5('0x15'));var config=require(_0xb5e5('0x16'));var db=require(_0xb5e5('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xb5e5('0x18')]({'port':0x232a});function checkPasswordPattern(_0x447ec4,_0x3d5aac,_0x5eaa26){if(_0x5eaa26){var _0x3333c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3333c3[_0xb5e5('0x19')](_0x3d5aac)){return _0x447ec4;}else{throw new db[(_0xb5e5('0x1a'))]['ValidationError'](_0xb5e5('0x1b'));}}else{return _0x447ec4;}}function respondWithRpcPromise(_0x36ce71,_0x176b22,_0x4fef32,_0x33086d){return new BPromise(function(_0x236b38,_0x2dc667){var _0x111dc8=_0x33086d||client;return _0x111dc8[_0xb5e5('0x1c')](_0x36ce71,_0x4fef32)[_0xb5e5('0x1d')](function(_0x34e821){logger[_0xb5e5('0x1e')](_0xb5e5('0x1f'),_0x176b22,_0xb5e5('0x20'));logger[_0xb5e5('0x21')](_0xb5e5('0x22'),_0x176b22,_0xb5e5('0x20'),JSON[_0xb5e5('0x23')](_0x34e821));if(_0x34e821[_0xb5e5('0x24')]){if(_0x34e821['error'][_0xb5e5('0x25')]===0x1f4){logger[_0xb5e5('0x24')](_0xb5e5('0x1f'),_0x176b22,_0x34e821['error'][_0xb5e5('0x26')]);return _0x2dc667(_0x34e821[_0xb5e5('0x24')][_0xb5e5('0x26')]);}logger[_0xb5e5('0x24')](_0xb5e5('0x1f'),_0x176b22,_0x34e821[_0xb5e5('0x24')][_0xb5e5('0x26')]);return _0x236b38(_0x34e821[_0xb5e5('0x24')][_0xb5e5('0x26')]);}else{logger[_0xb5e5('0x1e')](_0xb5e5('0x1f'),_0x176b22,_0xb5e5('0x20'));_0x236b38(_0x34e821[_0xb5e5('0x27')]['message']);}})[_0xb5e5('0x28')](function(_0xf52f0){logger[_0xb5e5('0x24')](_0xb5e5('0x1f'),_0x176b22,_0xf52f0);_0x2dc667(_0xf52f0);});});}function respondWithStatusCode(_0x2d9c30,_0x358226){_0x358226=_0x358226||0xcc;return function(_0x2c4fbe){if(_0x2c4fbe){return _0x2d9c30[_0xb5e5('0x29')](_0x358226);}return _0x2d9c30[_0xb5e5('0x2a')](_0x358226)[_0xb5e5('0x2b')]();};}function respondWithResult(_0xa414d3,_0x39d21b){_0x39d21b=_0x39d21b||0xc8;return function(_0x348165){if(_0x348165){return _0xa414d3['status'](_0x39d21b)[_0xb5e5('0x2c')](_0x348165);}};}function respondWithFilteredResult(_0xcdbca5,_0x50f7d6){return function(_0x2b47a4){if(_0x2b47a4){var _0x5e73c1=_0x2b47a4[_0xb5e5('0x2d')],_0x131e88=_0x50f7d6[_0xb5e5('0x2e')],_0x5d665a=_0x50f7d6[_0xb5e5('0x2e')]+_0x50f7d6[_0xb5e5('0x2f')],_0x569c64;if(_0x5d665a>=_0x5e73c1){_0x5d665a=_0x5e73c1;_0x569c64=0xc8;}else{_0x569c64=0xce;}_0xcdbca5['status'](_0x569c64);return _0xcdbca5['set'](_0xb5e5('0x30'),_0x131e88+'-'+_0x5d665a+'/'+_0x5e73c1)[_0xb5e5('0x2c')](_0x2b47a4);}return null;};}function patchUpdates(_0x57f1b2){return function(_0x11da82){try{jsonpatch[_0xb5e5('0x31')](_0x11da82,_0x57f1b2,!![]);}catch(_0x3e38fe){return BPromise[_0xb5e5('0x32')](_0x3e38fe);}return _0x11da82[_0xb5e5('0x33')]();};}function saveUpdates(_0x4981c3,_0x37836a){return function(_0x542278){if(_0x542278){return _0x542278[_0xb5e5('0x34')](_0x4981c3)[_0xb5e5('0x1d')](function(_0x29095c){return _0x29095c;});}return null;};}function removeEntity(_0x1d1885,_0x29181b){return function(_0x1e2dc8){if(_0x1e2dc8){return _0x1e2dc8[_0xb5e5('0x35')]()[_0xb5e5('0x1d')](function(){_0x1d1885[_0xb5e5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x236249,_0x23d83d){return function(_0x39eb5d){if(!_0x39eb5d){_0x236249[_0xb5e5('0x29')](0x194);}return _0x39eb5d;};}function handleError(_0xf98c8d,_0x51f36a){_0x51f36a=_0x51f36a||0x1f4;return function(_0x4dba0){logger['error'](_0x4dba0['stack']);if(_0x4dba0[_0xb5e5('0x36')]){delete _0x4dba0['name'];}_0xf98c8d[_0xb5e5('0x2a')](_0x51f36a)['send'](_0x4dba0);};}exports[_0xb5e5('0x37')]=function(_0x3b027e,_0x1f9690){var _0x2b61fa={},_0x55ebe5={},_0x5c85b1={'count':0x0,'rows':[]};var _0x2a40d6=_[_0xb5e5('0x38')](db['VtigerConfiguration'][_0xb5e5('0x39')],function(_0x413403){return{'name':_0x413403[_0xb5e5('0x3a')],'type':_0x413403['type']['key']};});_0x55ebe5['model']=_['map'](_0x2a40d6,'name');_0x55ebe5[_0xb5e5('0x3b')]=_[_0xb5e5('0x3c')](_0x3b027e[_0xb5e5('0x3b')]);_0x55ebe5[_0xb5e5('0x3d')]=_[_0xb5e5('0x3e')](_0x55ebe5[_0xb5e5('0x3f')],_0x55ebe5[_0xb5e5('0x3b')]);_0x2b61fa['attributes']=_['intersection'](_0x55ebe5[_0xb5e5('0x3f')],qs[_0xb5e5('0x40')](_0x3b027e[_0xb5e5('0x3b')]['fields']));_0x2b61fa[_0xb5e5('0x41')]=_0x2b61fa[_0xb5e5('0x41')][_0xb5e5('0x42')]?_0x2b61fa['attributes']:_0x55ebe5['model'];if(!_0x3b027e['query'][_0xb5e5('0x43')](_0xb5e5('0x44'))){_0x2b61fa[_0xb5e5('0x2f')]=qs[_0xb5e5('0x2f')](_0x3b027e['query'][_0xb5e5('0x2f')]);_0x2b61fa['offset']=qs[_0xb5e5('0x2e')](_0x3b027e[_0xb5e5('0x3b')]['offset']);}_0x2b61fa[_0xb5e5('0x45')]=qs[_0xb5e5('0x46')](_0x3b027e['query'][_0xb5e5('0x46')]);_0x2b61fa[_0xb5e5('0x47')]=qs['filters'](_[_0xb5e5('0x48')](_0x3b027e[_0xb5e5('0x3b')],_0x55ebe5[_0xb5e5('0x3d')]),_0x2a40d6);if(_0x3b027e['query'][_0xb5e5('0x49')]){_0x2b61fa[_0xb5e5('0x47')]=_['merge'](_0x2b61fa[_0xb5e5('0x47')],{'$or':_['map'](_0x2a40d6,function(_0x18bffc){if(_0x18bffc['type']!==_0xb5e5('0x4a')){var _0x29671e={};_0x29671e[_0x18bffc[_0xb5e5('0x36')]]={'$like':'%'+_0x3b027e[_0xb5e5('0x3b')][_0xb5e5('0x49')]+'%'};return _0x29671e;}})});}_0x2b61fa=_['merge']({},_0x2b61fa,_0x3b027e[_0xb5e5('0x4b')]);var _0x266ab1={'where':_0x2b61fa[_0xb5e5('0x47')]};return db[_0xb5e5('0x4c')][_0xb5e5('0x2d')](_0x266ab1)['then'](function(_0x3c161f){_0x5c85b1[_0xb5e5('0x2d')]=_0x3c161f;if(_0x3b027e[_0xb5e5('0x3b')]['includeAll']){_0x2b61fa[_0xb5e5('0x4d')]=[{'all':!![]}];}return db[_0xb5e5('0x4c')]['findAll'](_0x2b61fa);})[_0xb5e5('0x1d')](function(_0x310a10){_0x5c85b1['rows']=_0x310a10;return _0x5c85b1;})['then'](respondWithFilteredResult(_0x1f9690,_0x2b61fa))['catch'](handleError(_0x1f9690,null));};exports['show']=function(_0x2204f1,_0x1d7390){var _0x18b6ec={'raw':![],'where':{'id':_0x2204f1[_0xb5e5('0x4e')]['id']}},_0x54e127={};_0x54e127[_0xb5e5('0x3f')]=_[_0xb5e5('0x3c')](db[_0xb5e5('0x4c')][_0xb5e5('0x39')]);_0x54e127[_0xb5e5('0x3b')]=_[_0xb5e5('0x3c')](_0x2204f1[_0xb5e5('0x3b')]);_0x54e127[_0xb5e5('0x3d')]=_['intersection'](_0x54e127[_0xb5e5('0x3f')],_0x54e127[_0xb5e5('0x3b')]);_0x18b6ec[_0xb5e5('0x41')]=_[_0xb5e5('0x3e')](_0x54e127[_0xb5e5('0x3f')],qs[_0xb5e5('0x40')](_0x2204f1[_0xb5e5('0x3b')][_0xb5e5('0x40')]));_0x18b6ec[_0xb5e5('0x41')]=_0x18b6ec[_0xb5e5('0x41')]['length']?_0x18b6ec[_0xb5e5('0x41')]:_0x54e127[_0xb5e5('0x3f')];if(_0x2204f1['query'][_0xb5e5('0x4f')]){_0x18b6ec['include']=[{'all':!![]}];}_0x18b6ec=_['merge']({},_0x18b6ec,_0x2204f1[_0xb5e5('0x4b')]);return db[_0xb5e5('0x4c')][_0xb5e5('0x50')](_0x18b6ec)[_0xb5e5('0x1d')](handleEntityNotFound(_0x1d7390,null))[_0xb5e5('0x1d')](respondWithResult(_0x1d7390,null))[_0xb5e5('0x28')](handleError(_0x1d7390,null));};exports[_0xb5e5('0x51')]=function(_0x341307,_0x51c8e2){return db[_0xb5e5('0x4c')]['create'](_0x341307['body'],{})[_0xb5e5('0x1d')](respondWithResult(_0x51c8e2,0xc9))[_0xb5e5('0x28')](handleError(_0x51c8e2,null));};exports[_0xb5e5('0x34')]=function(_0x3eb2cd,_0x4ee207){if(_0x3eb2cd[_0xb5e5('0x52')]['id']){delete _0x3eb2cd['body']['id'];}return db['VtigerConfiguration'][_0xb5e5('0x50')]({'where':{'id':_0x3eb2cd['params']['id']}})[_0xb5e5('0x1d')](handleEntityNotFound(_0x4ee207,null))[_0xb5e5('0x1d')](saveUpdates(_0x3eb2cd[_0xb5e5('0x52')],null))[_0xb5e5('0x1d')](respondWithResult(_0x4ee207,null))[_0xb5e5('0x28')](handleError(_0x4ee207,null));};exports[_0xb5e5('0x35')]=function(_0x231f9e,_0x5dc190){return db[_0xb5e5('0x4c')][_0xb5e5('0x50')]({'where':{'id':_0x231f9e[_0xb5e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5dc190,null))[_0xb5e5('0x1d')](removeEntity(_0x5dc190,null))['catch'](handleError(_0x5dc190,null));};exports['getFields']=function(_0xb07f17,_0x5c3df5,_0x2e7e5c){var _0x8e9ae9={};var _0x1dccb9={};var _0x2d8df6;var _0x3b5e81;return db[_0xb5e5('0x4c')][_0xb5e5('0x53')]({'where':{'id':_0xb07f17[_0xb5e5('0x4e')]['id']}})[_0xb5e5('0x1d')](handleEntityNotFound(_0x5c3df5,null))[_0xb5e5('0x1d')](function(_0x35a707){if(_0x35a707){_0x2d8df6=_0x35a707;_0x1dccb9[_0xb5e5('0x3f')]=_[_0xb5e5('0x3c')](db[_0xb5e5('0x54')][_0xb5e5('0x39')]);_0x1dccb9[_0xb5e5('0x3b')]=_['keys'](_0xb07f17[_0xb5e5('0x3b')]);_0x1dccb9[_0xb5e5('0x3d')]=_[_0xb5e5('0x3e')](_0x1dccb9[_0xb5e5('0x3f')],_0x1dccb9[_0xb5e5('0x3b')]);_0x8e9ae9[_0xb5e5('0x41')]=_[_0xb5e5('0x3e')](_0x1dccb9[_0xb5e5('0x3f')],qs[_0xb5e5('0x40')](_0xb07f17[_0xb5e5('0x3b')]['fields']));_0x8e9ae9[_0xb5e5('0x41')]=_0x8e9ae9[_0xb5e5('0x41')][_0xb5e5('0x42')]?_0x8e9ae9['attributes']:_0x1dccb9[_0xb5e5('0x3f')];_0x8e9ae9[_0xb5e5('0x45')]=qs[_0xb5e5('0x46')](_0xb07f17[_0xb5e5('0x3b')][_0xb5e5('0x46')]);_0x8e9ae9[_0xb5e5('0x47')]=qs[_0xb5e5('0x3d')](_[_0xb5e5('0x48')](_0xb07f17['query'],_0x1dccb9[_0xb5e5('0x3d')]));if(_0xb07f17[_0xb5e5('0x3b')]['filter']){_0x8e9ae9[_0xb5e5('0x47')]=_['merge'](_0x8e9ae9[_0xb5e5('0x47')],{'$or':_[_0xb5e5('0x38')](_0x8e9ae9['attributes'],function(_0x1a3af6){var _0x54ab6b={};_0x54ab6b[_0x1a3af6]={'$like':'%'+_0xb07f17[_0xb5e5('0x3b')][_0xb5e5('0x49')]+'%'};return _0x54ab6b;})});}_0x8e9ae9=_['merge']({},_0x8e9ae9,_0xb07f17[_0xb5e5('0x4b')]);return _0x2d8df6[_0xb5e5('0x55')](_0x8e9ae9);}})[_0xb5e5('0x1d')](function(_0x49ccfc){if(_0x49ccfc){_0x3b5e81=_0x49ccfc['length'];if(!_0xb07f17['query'][_0xb5e5('0x43')](_0xb5e5('0x44'))){_0x8e9ae9[_0xb5e5('0x2f')]=qs[_0xb5e5('0x2f')](_0xb07f17['query'][_0xb5e5('0x2f')]);_0x8e9ae9[_0xb5e5('0x2e')]=qs['offset'](_0xb07f17['query'][_0xb5e5('0x2e')]);}return _0x2d8df6['getFields'](_0x8e9ae9);}})['then'](function(_0x4bf127){if(_0x4bf127){return _0x4bf127?{'count':_0x3b5e81,'rows':_0x4bf127}:null;}})[_0xb5e5('0x1d')](respondWithResult(_0x5c3df5,null))[_0xb5e5('0x28')](handleError(_0x5c3df5,null));};exports[_0xb5e5('0x56')]=function(_0x1c8456,_0x3bdf93,_0x5e21e3){var _0x279284={};var _0x113cb0={};var _0x560a16;var _0x7e708a;return db[_0xb5e5('0x4c')][_0xb5e5('0x53')]({'where':{'id':_0x1c8456[_0xb5e5('0x4e')]['id']}})[_0xb5e5('0x1d')](handleEntityNotFound(_0x3bdf93,null))[_0xb5e5('0x1d')](function(_0x5e8471){if(_0x5e8471){_0x560a16=_0x5e8471;_0x113cb0[_0xb5e5('0x3f')]=_['keys'](db[_0xb5e5('0x54')][_0xb5e5('0x39')]);_0x113cb0[_0xb5e5('0x3b')]=_[_0xb5e5('0x3c')](_0x1c8456[_0xb5e5('0x3b')]);_0x113cb0['filters']=_[_0xb5e5('0x3e')](_0x113cb0['model'],_0x113cb0['query']);_0x279284[_0xb5e5('0x41')]=_[_0xb5e5('0x3e')](_0x113cb0[_0xb5e5('0x3f')],qs[_0xb5e5('0x40')](_0x1c8456[_0xb5e5('0x3b')][_0xb5e5('0x40')]));_0x279284[_0xb5e5('0x41')]=_0x279284[_0xb5e5('0x41')][_0xb5e5('0x42')]?_0x279284[_0xb5e5('0x41')]:_0x113cb0[_0xb5e5('0x3f')];_0x279284['order']=qs[_0xb5e5('0x46')](_0x1c8456['query'][_0xb5e5('0x46')]);_0x279284[_0xb5e5('0x47')]=qs[_0xb5e5('0x3d')](_[_0xb5e5('0x48')](_0x1c8456[_0xb5e5('0x3b')],_0x113cb0[_0xb5e5('0x3d')]));if(_0x1c8456['query']['filter']){_0x279284[_0xb5e5('0x47')]=_['merge'](_0x279284[_0xb5e5('0x47')],{'$or':_[_0xb5e5('0x38')](_0x279284[_0xb5e5('0x41')],function(_0x239be5){var _0xbfeeec={};_0xbfeeec[_0x239be5]={'$like':'%'+_0x1c8456[_0xb5e5('0x3b')][_0xb5e5('0x49')]+'%'};return _0xbfeeec;})});}_0x279284=_['merge']({},_0x279284,_0x1c8456['options']);return _0x560a16[_0xb5e5('0x56')](_0x279284);}})[_0xb5e5('0x1d')](function(_0x33f519){if(_0x33f519){_0x7e708a=_0x33f519[_0xb5e5('0x42')];if(!_0x1c8456['query']['hasOwnProperty'](_0xb5e5('0x44'))){_0x279284[_0xb5e5('0x2f')]=qs[_0xb5e5('0x2f')](_0x1c8456[_0xb5e5('0x3b')][_0xb5e5('0x2f')]);_0x279284[_0xb5e5('0x2e')]=qs[_0xb5e5('0x2e')](_0x1c8456[_0xb5e5('0x3b')][_0xb5e5('0x2e')]);}return _0x560a16[_0xb5e5('0x56')](_0x279284);}})['then'](function(_0x508ab6){if(_0x508ab6){return _0x508ab6?{'count':_0x7e708a,'rows':_0x508ab6}:null;}})['then'](respondWithResult(_0x3bdf93,null))[_0xb5e5('0x28')](handleError(_0x3bdf93,null));};exports[_0xb5e5('0x57')]=function(_0x1a4390,_0x4d16ed,_0x3c9e65){var _0x373353={};var _0x3346bc={};var _0x417ca8;var _0x30462e;return db[_0xb5e5('0x4c')][_0xb5e5('0x53')]({'where':{'id':_0x1a4390[_0xb5e5('0x4e')]['id']}})[_0xb5e5('0x1d')](handleEntityNotFound(_0x4d16ed,null))['then'](function(_0x4a46e6){if(_0x4a46e6){_0x417ca8=_0x4a46e6;_0x3346bc[_0xb5e5('0x3f')]=_[_0xb5e5('0x3c')](db[_0xb5e5('0x54')][_0xb5e5('0x39')]);_0x3346bc[_0xb5e5('0x3b')]=_['keys'](_0x1a4390['query']);_0x3346bc[_0xb5e5('0x3d')]=_[_0xb5e5('0x3e')](_0x3346bc['model'],_0x3346bc[_0xb5e5('0x3b')]);_0x373353[_0xb5e5('0x41')]=_[_0xb5e5('0x3e')](_0x3346bc[_0xb5e5('0x3f')],qs[_0xb5e5('0x40')](_0x1a4390['query'][_0xb5e5('0x40')]));_0x373353[_0xb5e5('0x41')]=_0x373353[_0xb5e5('0x41')]['length']?_0x373353[_0xb5e5('0x41')]:_0x3346bc[_0xb5e5('0x3f')];_0x373353[_0xb5e5('0x45')]=qs[_0xb5e5('0x46')](_0x1a4390[_0xb5e5('0x3b')][_0xb5e5('0x46')]);_0x373353[_0xb5e5('0x47')]=qs[_0xb5e5('0x3d')](_[_0xb5e5('0x48')](_0x1a4390[_0xb5e5('0x3b')],_0x3346bc[_0xb5e5('0x3d')]));if(_0x1a4390[_0xb5e5('0x3b')][_0xb5e5('0x49')]){_0x373353[_0xb5e5('0x47')]=_[_0xb5e5('0x58')](_0x373353['where'],{'$or':_[_0xb5e5('0x38')](_0x373353['attributes'],function(_0x515561){var _0x4dae2f={};_0x4dae2f[_0x515561]={'$like':'%'+_0x1a4390[_0xb5e5('0x3b')][_0xb5e5('0x49')]+'%'};return _0x4dae2f;})});}_0x373353=_[_0xb5e5('0x58')]({},_0x373353,_0x1a4390[_0xb5e5('0x4b')]);return _0x417ca8[_0xb5e5('0x57')](_0x373353);}})[_0xb5e5('0x1d')](function(_0x4c4ca7){if(_0x4c4ca7){_0x30462e=_0x4c4ca7[_0xb5e5('0x42')];if(!_0x1a4390[_0xb5e5('0x3b')]['hasOwnProperty'](_0xb5e5('0x44'))){_0x373353[_0xb5e5('0x2f')]=qs[_0xb5e5('0x2f')](_0x1a4390['query'][_0xb5e5('0x2f')]);_0x373353[_0xb5e5('0x2e')]=qs[_0xb5e5('0x2e')](_0x1a4390[_0xb5e5('0x3b')][_0xb5e5('0x2e')]);}return _0x417ca8[_0xb5e5('0x57')](_0x373353);}})['then'](function(_0x3a46b0){if(_0x3a46b0){return _0x3a46b0?{'count':_0x30462e,'rows':_0x3a46b0}:null;}})[_0xb5e5('0x1d')](respondWithResult(_0x4d16ed,null))[_0xb5e5('0x28')](handleError(_0x4d16ed,null));};
\ No newline at end of file
index cee5c0f..3e80b39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06e9=['define','VtigerConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1b58fa,_0x20d68f){var _0x3e8c9a=function(_0x475007){while(--_0x475007){_0x1b58fa['push'](_0x1b58fa['shift']());}};_0x3e8c9a(++_0x20d68f);}(_0x06e9,0x1ba));var _0x906e=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x06e9[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x906e('0x0'));var util=require(_0x906e('0x1'));var logger=require(_0x906e('0x2'))('api');var moment=require(_0x906e('0x3'));var BPromise=require(_0x906e('0x4'));var rp=require(_0x906e('0x5'));var fs=require('fs');var path=require(_0x906e('0x6'));var rimraf=require('rimraf');var config=require(_0x906e('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x3e8b79,_0xe276f9){return _0x3e8b79[_0x906e('0x8')](_0x906e('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0bb1=['rimraf','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','moment','request-promise','path'];(function(_0x47dd05,_0x4aa69a){var _0x1ac7c7=function(_0x5dbca1){while(--_0x5dbca1){_0x47dd05['push'](_0x47dd05['shift']());}};_0x1ac7c7(++_0x4aa69a);}(_0x0bb1,0x1db));var _0x10bb=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x0bb1[_0x490be3];return _0x3f5140;};'use strict';var _=require('lodash');var util=require(_0x10bb('0x0'));var logger=require(_0x10bb('0x1'))('api');var moment=require(_0x10bb('0x2'));var BPromise=require('bluebird');var rp=require(_0x10bb('0x3'));var fs=require('fs');var path=require(_0x10bb('0x4'));var rimraf=require(_0x10bb('0x5'));var config=require('../../config/environment');var attributes=require(_0x10bb('0x6'));module['exports']=function(_0x22af16,_0x7c70ff){return _0x22af16[_0x10bb('0x7')](_0x10bb('0x8'),attributes,{'tableName':_0x10bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eea3490..1077d47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3cb=['error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xdce78a,_0x507cad){var _0x47c31c=function(_0x4238b5){while(--_0x4238b5){_0xdce78a['push'](_0xdce78a['shift']());}};_0x47c31c(++_0x507cad);}(_0xe3cb,0x15f));var _0xbe3c=function(_0x5b7cc2,_0x2b4334){_0x5b7cc2=_0x5b7cc2-0x0;var _0x56573e=_0xe3cb[_0x5b7cc2];return _0x56573e;};'use strict';var _=require(_0xbe3c('0x0'));var util=require(_0xbe3c('0x1'));var moment=require(_0xbe3c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe3c('0x3'));var db=require(_0xbe3c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe3c('0x5'))('rpc');var config=require(_0xbe3c('0x6'));var jayson=require(_0xbe3c('0x7'));var client=jayson[_0xbe3c('0x8')][_0xbe3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54cc49,_0x2c32ee,_0x3a09c0){return new BPromise(function(_0x1e4e54,_0x2b2bcc){return client[_0xbe3c('0xa')](_0x54cc49,_0x3a09c0)[_0xbe3c('0xb')](function(_0x2e7328){logger[_0xbe3c('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x2c32ee,'request\x20sent');logger[_0xbe3c('0xd')](_0xbe3c('0xe'),_0x2c32ee,_0xbe3c('0xf'),JSON[_0xbe3c('0x10')](_0x2e7328));if(_0x2e7328[_0xbe3c('0x11')]){if(_0x2e7328[_0xbe3c('0x11')][_0xbe3c('0x12')]===0x1f4){logger[_0xbe3c('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x2c32ee,_0x2e7328[_0xbe3c('0x11')][_0xbe3c('0x13')]);return _0x2b2bcc(_0x2e7328[_0xbe3c('0x11')]['message']);}logger[_0xbe3c('0x11')](_0xbe3c('0x14'),_0x2c32ee,_0x2e7328[_0xbe3c('0x11')][_0xbe3c('0x13')]);return _0x1e4e54(_0x2e7328[_0xbe3c('0x11')][_0xbe3c('0x13')]);}else{logger[_0xbe3c('0xc')](_0xbe3c('0x14'),_0x2c32ee,_0xbe3c('0xf'));_0x1e4e54(_0x2e7328[_0xbe3c('0x15')]['message']);}})[_0xbe3c('0x16')](function(_0x57a15c){logger[_0xbe3c('0x11')](_0xbe3c('0x14'),_0x2c32ee,_0x57a15c);_0x2b2bcc(_0x57a15c);});});}
\ No newline at end of file
+var _0x940f=['../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x48f969,_0x72e01d){var _0x470dfc=function(_0x5ea75b){while(--_0x5ea75b){_0x48f969['push'](_0x48f969['shift']());}};_0x470dfc(++_0x72e01d);}(_0x940f,0xd6));var _0xf940=function(_0x27934a,_0x198480){_0x27934a=_0x27934a-0x0;var _0x80e180=_0x940f[_0x27934a];return _0x80e180;};'use strict';var _=require(_0xf940('0x0'));var util=require(_0xf940('0x1'));var moment=require('moment');var BPromise=require(_0xf940('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf940('0x3'));var logger=require(_0xf940('0x4'))(_0xf940('0x5'));var config=require(_0xf940('0x6'));var jayson=require(_0xf940('0x7'));var client=jayson[_0xf940('0x8')][_0xf940('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193ddc,_0x1b20ff,_0x3875ab){return new BPromise(function(_0x48910c,_0xb6fb29){return client[_0xf940('0xa')](_0x193ddc,_0x3875ab)[_0xf940('0xb')](function(_0x11b11e){logger[_0xf940('0xc')](_0xf940('0xd'),_0x1b20ff,_0xf940('0xe'));logger[_0xf940('0xf')](_0xf940('0x10'),_0x1b20ff,_0xf940('0xe'),JSON[_0xf940('0x11')](_0x11b11e));if(_0x11b11e['error']){if(_0x11b11e['error'][_0xf940('0x12')]===0x1f4){logger[_0xf940('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x1b20ff,_0x11b11e[_0xf940('0x13')][_0xf940('0x14')]);return _0xb6fb29(_0x11b11e[_0xf940('0x13')][_0xf940('0x14')]);}logger[_0xf940('0x13')](_0xf940('0xd'),_0x1b20ff,_0x11b11e[_0xf940('0x13')][_0xf940('0x14')]);return _0x48910c(_0x11b11e['error'][_0xf940('0x14')]);}else{logger['info'](_0xf940('0xd'),_0x1b20ff,_0xf940('0xe'));_0x48910c(_0x11b11e['result'][_0xf940('0x14')]);}})[_0xf940('0x15')](function(_0x488c2c){logger[_0xf940('0x13')](_0xf940('0xd'),_0x1b20ff,_0x488c2c);_0xb6fb29(_0x488c2c);});});}
\ No newline at end of file
index 98438c3..341e7bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bad=['multer','path','connect-timeout','express','Router','../../components/auth/service','./intVtigerField.controller','get','isAuthenticated','put','/:id','update','delete','destroy','exports'];(function(_0x290e56,_0x1254dc){var _0x2d2342=function(_0x4d4af7){while(--_0x4d4af7){_0x290e56['push'](_0x290e56['shift']());}};_0x2d2342(++_0x1254dc);}(_0x1bad,0x14a));var _0xd1ba=function(_0x50fbdb,_0x223260){_0x50fbdb=_0x50fbdb-0x0;var _0x290cbd=_0x1bad[_0x50fbdb];return _0x290cbd;};'use strict';var multer=require(_0xd1ba('0x0'));var util=require('util');var path=require(_0xd1ba('0x1'));var timeout=require(_0xd1ba('0x2'));var express=require(_0xd1ba('0x3'));var router=express[_0xd1ba('0x4')]();var auth=require(_0xd1ba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd1ba('0x6'));router[_0xd1ba('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd1ba('0x7')]('/:id',auth[_0xd1ba('0x8')](),controller['show']);router['post']('/',auth[_0xd1ba('0x8')](),controller['create']);router[_0xd1ba('0x9')](_0xd1ba('0xa'),auth[_0xd1ba('0x8')](),controller[_0xd1ba('0xb')]);router[_0xd1ba('0xc')](_0xd1ba('0xa'),auth['isAuthenticated'](),controller[_0xd1ba('0xd')]);module[_0xd1ba('0xe')]=router;
\ No newline at end of file
+var _0x5b06=['create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','get','/:id','isAuthenticated','post'];(function(_0x5b3725,_0x3803ad){var _0x3f5531=function(_0x6d2e4f){while(--_0x6d2e4f){_0x5b3725['push'](_0x5b3725['shift']());}};_0x3f5531(++_0x3803ad);}(_0x5b06,0xf3));var _0x65b0=function(_0x5b8a9e,_0x5f3281){_0x5b8a9e=_0x5b8a9e-0x0;var _0x319514=_0x5b06[_0x5b8a9e];return _0x319514;};'use strict';var multer=require(_0x65b0('0x0'));var util=require(_0x65b0('0x1'));var path=require('path');var timeout=require(_0x65b0('0x2'));var express=require(_0x65b0('0x3'));var router=express['Router']();var auth=require(_0x65b0('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x65b0('0x5')](_0x65b0('0x6'),auth[_0x65b0('0x7')](),controller['show']);router[_0x65b0('0x8')]('/',auth[_0x65b0('0x7')](),controller[_0x65b0('0x9')]);router[_0x65b0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x65b0('0xb')]);router[_0x65b0('0xc')]('/:id',auth[_0x65b0('0x7')](),controller['destroy']);module[_0x65b0('0xd')]=router;
\ No newline at end of file
index 1de63af..91e337d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c29=['BOOLEAN','ENUM','variable','customVariable','keyValue','STRING','string'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x0c29,0xb7));var _0x90c2=function(_0x55969b,_0x1ebe62){_0x55969b=_0x55969b-0x0;var _0x3d7fc1=_0x0c29[_0x55969b];return _0x3d7fc1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x90c2('0x0')]('string',_0x90c2('0x1'),_0x90c2('0x2'),_0x90c2('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x90c2('0x4')]},'keyType':{'type':Sequelize[_0x90c2('0x0')](_0x90c2('0x5'),_0x90c2('0x1'),_0x90c2('0x2'))},'keyContent':{'type':Sequelize[_0x90c2('0x4')]},'idField':{'type':Sequelize[_0x90c2('0x4')]},'nameField':{'type':Sequelize[_0x90c2('0x4')]},'customField':{'type':Sequelize[_0x90c2('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x90c2('0x4')]}};
\ No newline at end of file
+var _0x8456=['BOOLEAN','sequelize','exports','ENUM','variable','keyValue','string','STRING','customVariable'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x8456,0xfd));var _0x6845=function(_0x296e39,_0x16cf58){_0x296e39=_0x296e39-0x0;var _0x423f73=_0x8456[_0x296e39];return _0x423f73;};'use strict';var Sequelize=require(_0x6845('0x0'));module[_0x6845('0x1')]={'type':{'type':Sequelize[_0x6845('0x2')]('string',_0x6845('0x3'),'customVariable',_0x6845('0x4')),'defaultValue':_0x6845('0x5')},'content':{'type':Sequelize[_0x6845('0x6')]},'key':{'type':Sequelize[_0x6845('0x6')]},'keyType':{'type':Sequelize[_0x6845('0x2')](_0x6845('0x5'),_0x6845('0x3'),_0x6845('0x7'))},'keyContent':{'type':Sequelize[_0x6845('0x6')]},'idField':{'type':Sequelize[_0x6845('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6845('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b36cb27..1793223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5795=['create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','update','destroy','then','name','send','map','VtigerField','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','hasOwnProperty','offset','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find'];(function(_0x3544da,_0x1cf178){var _0x48738a=function(_0x5043ea){while(--_0x5043ea){_0x3544da['push'](_0x3544da['shift']());}};_0x48738a(++_0x1cf178);}(_0x5795,0xd1));var _0x5579=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5795[_0x1d1779];return _0x2377e9;};'use strict';var pdf=require(_0x5579('0x0'));var emlformat=require(_0x5579('0x1'));var rimraf=require(_0x5579('0x2'));var zipdir=require(_0x5579('0x3'));var jsonpatch=require(_0x5579('0x4'));var rp=require(_0x5579('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5579('0x6'));var path=require(_0x5579('0x7'));var sox=require('sox');var csv=require(_0x5579('0x8'));var ejs=require(_0x5579('0x9'));var fs=require('fs');var _=require(_0x5579('0xa'));var squel=require(_0x5579('0xb'));var crypto=require(_0x5579('0xc'));var jsforce=require(_0x5579('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5579('0x8'));var querystring=require(_0x5579('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5579('0xf'));var qs=require(_0x5579('0x10'));var as=require(_0x5579('0x11'));var hardwareService=require(_0x5579('0x12'));var logger=require('../../config/logger')(_0x5579('0x13'));var utils=require('../../config/utils');var config=require(_0x5579('0x14'));var db=require(_0x5579('0x15'))['db'];function respondWithStatusCode(_0x30910,_0x575439){_0x575439=_0x575439||0xcc;return function(_0x43628b){if(_0x43628b){return _0x30910[_0x5579('0x16')](_0x575439);}return _0x30910['status'](_0x575439)['end']();};}function respondWithResult(_0x31cdbd,_0x13b4c0){_0x13b4c0=_0x13b4c0||0xc8;return function(_0x17325a){if(_0x17325a){return _0x31cdbd[_0x5579('0x17')](_0x13b4c0)[_0x5579('0x18')](_0x17325a);}};}function respondWithFilteredResult(_0x69fbab,_0x284f9d){return function(_0x945bdc){if(_0x945bdc){var _0x406bf9=_0x945bdc[_0x5579('0x19')],_0x202344=_0x284f9d['offset'],_0x39bf6e=_0x284f9d['offset']+_0x284f9d[_0x5579('0x1a')],_0xc0ccbb;if(_0x39bf6e>=_0x406bf9){_0x39bf6e=_0x406bf9;_0xc0ccbb=0xc8;}else{_0xc0ccbb=0xce;}_0x69fbab[_0x5579('0x17')](_0xc0ccbb);return _0x69fbab[_0x5579('0x1b')](_0x5579('0x1c'),_0x202344+'-'+_0x39bf6e+'/'+_0x406bf9)[_0x5579('0x18')](_0x945bdc);}return null;};}function patchUpdates(_0x5860bf){return function(_0x3ca528){try{jsonpatch[_0x5579('0x1d')](_0x3ca528,_0x5860bf,!![]);}catch(_0x732dd3){return BPromise[_0x5579('0x1e')](_0x732dd3);}return _0x3ca528['save']();};}function saveUpdates(_0x10741f,_0x4151d7){return function(_0x5124a7){if(_0x5124a7){return _0x5124a7[_0x5579('0x1f')](_0x10741f)['then'](function(_0x40ee8f){return _0x40ee8f;});}return null;};}function removeEntity(_0x17ae02,_0x28126d){return function(_0x31578e){if(_0x31578e){return _0x31578e[_0x5579('0x20')]()[_0x5579('0x21')](function(){_0x17ae02[_0x5579('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36a725,_0x5827b9){return function(_0x304c50){if(!_0x304c50){_0x36a725[_0x5579('0x16')](0x194);}return _0x304c50;};}function handleError(_0x5d90ce,_0x4dab56){_0x4dab56=_0x4dab56||0x1f4;return function(_0x5754c6){logger['error'](_0x5754c6['stack']);if(_0x5754c6[_0x5579('0x22')]){delete _0x5754c6['name'];}_0x5d90ce['status'](_0x4dab56)[_0x5579('0x23')](_0x5754c6);};}exports['index']=function(_0x261ac0,_0x11f8bc){var _0x96da9a={},_0x103e0c={},_0x55a2ed={'count':0x0,'rows':[]};var _0x3701a6=_[_0x5579('0x24')](db[_0x5579('0x25')][_0x5579('0x26')],function(_0x4ac34b){return{'name':_0x4ac34b[_0x5579('0x27')],'type':_0x4ac34b[_0x5579('0x28')][_0x5579('0x29')]};});_0x103e0c['model']=_[_0x5579('0x24')](_0x3701a6,_0x5579('0x22'));_0x103e0c[_0x5579('0x2a')]=_['keys'](_0x261ac0[_0x5579('0x2a')]);_0x103e0c['filters']=_[_0x5579('0x2b')](_0x103e0c['model'],_0x103e0c[_0x5579('0x2a')]);_0x96da9a[_0x5579('0x2c')]=_['intersection'](_0x103e0c[_0x5579('0x2d')],qs[_0x5579('0x2e')](_0x261ac0[_0x5579('0x2a')]['fields']));_0x96da9a[_0x5579('0x2c')]=_0x96da9a[_0x5579('0x2c')]['length']?_0x96da9a[_0x5579('0x2c')]:_0x103e0c['model'];if(!_0x261ac0['query'][_0x5579('0x2f')]('nolimit')){_0x96da9a[_0x5579('0x1a')]=qs[_0x5579('0x1a')](_0x261ac0[_0x5579('0x2a')]['limit']);_0x96da9a[_0x5579('0x30')]=qs[_0x5579('0x30')](_0x261ac0['query'][_0x5579('0x30')]);}_0x96da9a[_0x5579('0x31')]=qs[_0x5579('0x32')](_0x261ac0['query'][_0x5579('0x32')]);_0x96da9a[_0x5579('0x33')]=qs['filters'](_[_0x5579('0x34')](_0x261ac0[_0x5579('0x2a')],_0x103e0c[_0x5579('0x35')]),_0x3701a6);if(_0x261ac0[_0x5579('0x2a')][_0x5579('0x36')]){_0x96da9a[_0x5579('0x33')]=_['merge'](_0x96da9a[_0x5579('0x33')],{'$or':_[_0x5579('0x24')](_0x3701a6,function(_0x13a806){if(_0x13a806['type']!==_0x5579('0x37')){var _0x157f19={};_0x157f19[_0x13a806[_0x5579('0x22')]]={'$like':'%'+_0x261ac0[_0x5579('0x2a')][_0x5579('0x36')]+'%'};return _0x157f19;}})});}_0x96da9a=_[_0x5579('0x38')]({},_0x96da9a,_0x261ac0[_0x5579('0x39')]);var _0x264b7d={'where':_0x96da9a[_0x5579('0x33')]};return db[_0x5579('0x25')]['count'](_0x264b7d)['then'](function(_0x2e6dfe){_0x55a2ed[_0x5579('0x19')]=_0x2e6dfe;if(_0x261ac0[_0x5579('0x2a')][_0x5579('0x3a')]){_0x96da9a['include']=[{'all':!![]}];}return db[_0x5579('0x25')][_0x5579('0x3b')](_0x96da9a);})[_0x5579('0x21')](function(_0x503063){_0x55a2ed[_0x5579('0x3c')]=_0x503063;return _0x55a2ed;})[_0x5579('0x21')](respondWithFilteredResult(_0x11f8bc,_0x96da9a))[_0x5579('0x3d')](handleError(_0x11f8bc,null));};exports[_0x5579('0x3e')]=function(_0x2f4b25,_0x481f2c){var _0xe15f11={'raw':!![],'where':{'id':_0x2f4b25[_0x5579('0x3f')]['id']}},_0x1a3fe1={};_0x1a3fe1['model']=_[_0x5579('0x40')](db[_0x5579('0x25')][_0x5579('0x26')]);_0x1a3fe1[_0x5579('0x2a')]=_[_0x5579('0x40')](_0x2f4b25[_0x5579('0x2a')]);_0x1a3fe1['filters']=_[_0x5579('0x2b')](_0x1a3fe1[_0x5579('0x2d')],_0x1a3fe1['query']);_0xe15f11[_0x5579('0x2c')]=_[_0x5579('0x2b')](_0x1a3fe1[_0x5579('0x2d')],qs[_0x5579('0x2e')](_0x2f4b25[_0x5579('0x2a')][_0x5579('0x2e')]));_0xe15f11['attributes']=_0xe15f11[_0x5579('0x2c')]['length']?_0xe15f11['attributes']:_0x1a3fe1[_0x5579('0x2d')];if(_0x2f4b25[_0x5579('0x2a')][_0x5579('0x3a')]){_0xe15f11[_0x5579('0x41')]=[{'all':!![]}];}_0xe15f11=_[_0x5579('0x38')]({},_0xe15f11,_0x2f4b25[_0x5579('0x39')]);return db[_0x5579('0x25')][_0x5579('0x42')](_0xe15f11)['then'](handleEntityNotFound(_0x481f2c,null))['then'](respondWithResult(_0x481f2c,null))[_0x5579('0x3d')](handleError(_0x481f2c,null));};exports['create']=function(_0x58bbd3,_0x69ec2d){return db[_0x5579('0x25')][_0x5579('0x43')](_0x58bbd3['body'],{})[_0x5579('0x21')](respondWithResult(_0x69ec2d,0xc9))['catch'](handleError(_0x69ec2d,null));};exports[_0x5579('0x1f')]=function(_0x1dec0e,_0x3fcd79){if(_0x1dec0e[_0x5579('0x44')]['id']){delete _0x1dec0e[_0x5579('0x44')]['id'];}return db[_0x5579('0x25')]['find']({'where':{'id':_0x1dec0e[_0x5579('0x3f')]['id']}})[_0x5579('0x21')](handleEntityNotFound(_0x3fcd79,null))[_0x5579('0x21')](saveUpdates(_0x1dec0e['body'],null))[_0x5579('0x21')](respondWithResult(_0x3fcd79,null))[_0x5579('0x3d')](handleError(_0x3fcd79,null));};exports[_0x5579('0x20')]=function(_0x5885c4,_0x149b23){return db[_0x5579('0x25')]['find']({'where':{'id':_0x5885c4[_0x5579('0x3f')]['id']}})[_0x5579('0x21')](handleEntityNotFound(_0x149b23,null))[_0x5579('0x21')](removeEntity(_0x149b23,null))['catch'](handleError(_0x149b23,null));};
\ No newline at end of file
+var _0x195e=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','length','options','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','update','then','destroy','error','stack','name','map','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4910b1,_0x11b0a3){var _0x2b8d1d=function(_0x4a0891){while(--_0x4a0891){_0x4910b1['push'](_0x4910b1['shift']());}};_0x2b8d1d(++_0x11b0a3);}(_0x195e,0xa1));var _0xe195=function(_0x437c49,_0x3bb4ac){_0x437c49=_0x437c49-0x0;var _0x12cc63=_0x195e[_0x437c49];return _0x12cc63;};'use strict';var pdf=require(_0xe195('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe195('0x1'));var jsonpatch=require(_0xe195('0x2'));var rp=require(_0xe195('0x3'));var moment=require(_0xe195('0x4'));var BPromise=require(_0xe195('0x5'));var Mustache=require('mustache');var util=require(_0xe195('0x6'));var path=require(_0xe195('0x7'));var sox=require(_0xe195('0x8'));var csv=require(_0xe195('0x9'));var ejs=require(_0xe195('0xa'));var fs=require('fs');var _=require(_0xe195('0xb'));var squel=require(_0xe195('0xc'));var crypto=require(_0xe195('0xd'));var jsforce=require(_0xe195('0xe'));var deskjs=require(_0xe195('0xf'));var toCsv=require(_0xe195('0x9'));var querystring=require(_0xe195('0x10'));var Papa=require(_0xe195('0x11'));var Redis=require(_0xe195('0x12'));var authService=require(_0xe195('0x13'));var qs=require(_0xe195('0x14'));var as=require(_0xe195('0x15'));var hardwareService=require(_0xe195('0x16'));var logger=require(_0xe195('0x17'))(_0xe195('0x18'));var utils=require(_0xe195('0x19'));var config=require('../../config/environment');var db=require(_0xe195('0x1a'))['db'];function respondWithStatusCode(_0xc83ffe,_0x6e7a23){_0x6e7a23=_0x6e7a23||0xcc;return function(_0x14afac){if(_0x14afac){return _0xc83ffe[_0xe195('0x1b')](_0x6e7a23);}return _0xc83ffe[_0xe195('0x1c')](_0x6e7a23)[_0xe195('0x1d')]();};}function respondWithResult(_0x53c31e,_0x3ee6ab){_0x3ee6ab=_0x3ee6ab||0xc8;return function(_0x3ecd51){if(_0x3ecd51){return _0x53c31e[_0xe195('0x1c')](_0x3ee6ab)[_0xe195('0x1e')](_0x3ecd51);}};}function respondWithFilteredResult(_0x3d6c0a,_0x4c129d){return function(_0x45c293){if(_0x45c293){var _0xf92100=_0x45c293[_0xe195('0x1f')],_0x35176e=_0x4c129d['offset'],_0x10d228=_0x4c129d[_0xe195('0x20')]+_0x4c129d[_0xe195('0x21')],_0x1e8b85;if(_0x10d228>=_0xf92100){_0x10d228=_0xf92100;_0x1e8b85=0xc8;}else{_0x1e8b85=0xce;}_0x3d6c0a[_0xe195('0x1c')](_0x1e8b85);return _0x3d6c0a[_0xe195('0x22')]('Content-Range',_0x35176e+'-'+_0x10d228+'/'+_0xf92100)['json'](_0x45c293);}return null;};}function patchUpdates(_0x3d4074){return function(_0x4768f3){try{jsonpatch['apply'](_0x4768f3,_0x3d4074,!![]);}catch(_0x5a9c52){return BPromise[_0xe195('0x23')](_0x5a9c52);}return _0x4768f3['save']();};}function saveUpdates(_0x1249f8,_0x1774aa){return function(_0x11a403){if(_0x11a403){return _0x11a403[_0xe195('0x24')](_0x1249f8)[_0xe195('0x25')](function(_0x9c6bac){return _0x9c6bac;});}return null;};}function removeEntity(_0x2ff544,_0x2a5181){return function(_0x4b91ee){if(_0x4b91ee){return _0x4b91ee[_0xe195('0x26')]()['then'](function(){_0x2ff544[_0xe195('0x1c')](0xcc)[_0xe195('0x1d')]();});}};}function handleEntityNotFound(_0x45f56f,_0x5ba444){return function(_0x44fec6){if(!_0x44fec6){_0x45f56f[_0xe195('0x1b')](0x194);}return _0x44fec6;};}function handleError(_0x306069,_0x2cf211){_0x2cf211=_0x2cf211||0x1f4;return function(_0x5e0419){logger[_0xe195('0x27')](_0x5e0419[_0xe195('0x28')]);if(_0x5e0419[_0xe195('0x29')]){delete _0x5e0419['name'];}_0x306069[_0xe195('0x1c')](_0x2cf211)['send'](_0x5e0419);};}exports['index']=function(_0x415484,_0x422e35){var _0x1f6144={},_0x41981c={},_0x338713={'count':0x0,'rows':[]};var _0x56016b=_[_0xe195('0x2a')](db[_0xe195('0x2b')][_0xe195('0x2c')],function(_0x4a105f){return{'name':_0x4a105f[_0xe195('0x2d')],'type':_0x4a105f[_0xe195('0x2e')][_0xe195('0x2f')]};});_0x41981c[_0xe195('0x30')]=_['map'](_0x56016b,_0xe195('0x29'));_0x41981c[_0xe195('0x31')]=_['keys'](_0x415484['query']);_0x41981c[_0xe195('0x32')]=_[_0xe195('0x33')](_0x41981c[_0xe195('0x30')],_0x41981c[_0xe195('0x31')]);_0x1f6144[_0xe195('0x34')]=_[_0xe195('0x33')](_0x41981c[_0xe195('0x30')],qs['fields'](_0x415484[_0xe195('0x31')]['fields']));_0x1f6144[_0xe195('0x34')]=_0x1f6144[_0xe195('0x34')]['length']?_0x1f6144[_0xe195('0x34')]:_0x41981c[_0xe195('0x30')];if(!_0x415484[_0xe195('0x31')][_0xe195('0x35')](_0xe195('0x36'))){_0x1f6144[_0xe195('0x21')]=qs[_0xe195('0x21')](_0x415484[_0xe195('0x31')][_0xe195('0x21')]);_0x1f6144[_0xe195('0x20')]=qs[_0xe195('0x20')](_0x415484[_0xe195('0x31')][_0xe195('0x20')]);}_0x1f6144[_0xe195('0x37')]=qs[_0xe195('0x38')](_0x415484[_0xe195('0x31')][_0xe195('0x38')]);_0x1f6144[_0xe195('0x39')]=qs[_0xe195('0x32')](_[_0xe195('0x3a')](_0x415484[_0xe195('0x31')],_0x41981c[_0xe195('0x32')]),_0x56016b);if(_0x415484[_0xe195('0x31')][_0xe195('0x3b')]){_0x1f6144['where']=_[_0xe195('0x3c')](_0x1f6144[_0xe195('0x39')],{'$or':_['map'](_0x56016b,function(_0x430f6e){if(_0x430f6e['type']!==_0xe195('0x3d')){var _0xeef9ce={};_0xeef9ce[_0x430f6e['name']]={'$like':'%'+_0x415484[_0xe195('0x31')][_0xe195('0x3b')]+'%'};return _0xeef9ce;}})});}_0x1f6144=_[_0xe195('0x3c')]({},_0x1f6144,_0x415484['options']);var _0x4ff07d={'where':_0x1f6144[_0xe195('0x39')]};return db['VtigerField'][_0xe195('0x1f')](_0x4ff07d)[_0xe195('0x25')](function(_0x175d88){_0x338713[_0xe195('0x1f')]=_0x175d88;if(_0x415484[_0xe195('0x31')][_0xe195('0x3e')]){_0x1f6144[_0xe195('0x3f')]=[{'all':!![]}];}return db[_0xe195('0x2b')][_0xe195('0x40')](_0x1f6144);})[_0xe195('0x25')](function(_0x1d3281){_0x338713['rows']=_0x1d3281;return _0x338713;})[_0xe195('0x25')](respondWithFilteredResult(_0x422e35,_0x1f6144))[_0xe195('0x41')](handleError(_0x422e35,null));};exports[_0xe195('0x42')]=function(_0x4b0f11,_0x3ad19c){var _0xe315d={'raw':!![],'where':{'id':_0x4b0f11['params']['id']}},_0x1e37e1={};_0x1e37e1[_0xe195('0x30')]=_['keys'](db[_0xe195('0x2b')][_0xe195('0x2c')]);_0x1e37e1[_0xe195('0x31')]=_[_0xe195('0x43')](_0x4b0f11[_0xe195('0x31')]);_0x1e37e1['filters']=_[_0xe195('0x33')](_0x1e37e1['model'],_0x1e37e1[_0xe195('0x31')]);_0xe315d[_0xe195('0x34')]=_['intersection'](_0x1e37e1[_0xe195('0x30')],qs['fields'](_0x4b0f11['query']['fields']));_0xe315d[_0xe195('0x34')]=_0xe315d['attributes'][_0xe195('0x44')]?_0xe315d[_0xe195('0x34')]:_0x1e37e1[_0xe195('0x30')];if(_0x4b0f11[_0xe195('0x31')]['includeAll']){_0xe315d[_0xe195('0x3f')]=[{'all':!![]}];}_0xe315d=_[_0xe195('0x3c')]({},_0xe315d,_0x4b0f11[_0xe195('0x45')]);return db[_0xe195('0x2b')][_0xe195('0x46')](_0xe315d)[_0xe195('0x25')](handleEntityNotFound(_0x3ad19c,null))['then'](respondWithResult(_0x3ad19c,null))[_0xe195('0x41')](handleError(_0x3ad19c,null));};exports[_0xe195('0x47')]=function(_0x3e390d,_0x156185){return db[_0xe195('0x2b')][_0xe195('0x47')](_0x3e390d[_0xe195('0x48')],{})['then'](respondWithResult(_0x156185,0xc9))[_0xe195('0x41')](handleError(_0x156185,null));};exports[_0xe195('0x24')]=function(_0x33d53c,_0x5caea3){if(_0x33d53c[_0xe195('0x48')]['id']){delete _0x33d53c[_0xe195('0x48')]['id'];}return db['VtigerField'][_0xe195('0x46')]({'where':{'id':_0x33d53c['params']['id']}})[_0xe195('0x25')](handleEntityNotFound(_0x5caea3,null))[_0xe195('0x25')](saveUpdates(_0x33d53c[_0xe195('0x48')],null))['then'](respondWithResult(_0x5caea3,null))['catch'](handleError(_0x5caea3,null));};exports[_0xe195('0x26')]=function(_0x24786e,_0x599ac5){return db['VtigerField']['find']({'where':{'id':_0x24786e['params']['id']}})[_0xe195('0x25')](handleEntityNotFound(_0x599ac5,null))[_0xe195('0x25')](removeEntity(_0x599ac5,null))[_0xe195('0x41')](handleError(_0x599ac5,null));};
\ No newline at end of file
index fce289e..2f80cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x1af19e,_0x94225c){var _0x2325eb=function(_0x379eb2){while(--_0x379eb2){_0x1af19e['push'](_0x1af19e['shift']());}};_0x2325eb(++_0x94225c);}(_0x7a54,0x106));var _0x47a5=function(_0x1756a9,_0xed5e3c){_0x1756a9=_0x1756a9-0x0;var _0x2b6147=_0x7a54[_0x1756a9];return _0x2b6147;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_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':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 2ad4fb7..10133d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa71a=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','info','catch','lodash'];(function(_0x54550c,_0x2ec029){var _0x2f80b4=function(_0x4fbee8){while(--_0x4fbee8){_0x54550c['push'](_0x54550c['shift']());}};_0x2f80b4(++_0x2ec029);}(_0xa71a,0xf1));var _0xaa71=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa71a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xaa71('0x0'));var util=require(_0xaa71('0x1'));var moment=require(_0xaa71('0x2'));var BPromise=require(_0xaa71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa71('0x4'));var db=require(_0xaa71('0x5'))['db'];var utils=require(_0xaa71('0x6'));var logger=require('../../config/logger')(_0xaa71('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa71('0x8'));var client=jayson[_0xaa71('0x9')][_0xaa71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5893aa,_0x274dce,_0x35b8cf){return new BPromise(function(_0x5a0dca,_0x50ad8f){return client[_0xaa71('0xb')](_0x5893aa,_0x35b8cf)[_0xaa71('0xc')](function(_0xc26148){logger['info']('VtigerField,\x20%s,\x20%s',_0x274dce,_0xaa71('0xd'));logger[_0xaa71('0xe')](_0xaa71('0xf'),_0x274dce,_0xaa71('0xd'),JSON[_0xaa71('0x10')](_0xc26148));if(_0xc26148[_0xaa71('0x11')]){if(_0xc26148['error']['code']===0x1f4){logger['error'](_0xaa71('0x12'),_0x274dce,_0xc26148[_0xaa71('0x11')][_0xaa71('0x13')]);return _0x50ad8f(_0xc26148['error'][_0xaa71('0x13')]);}logger[_0xaa71('0x11')](_0xaa71('0x12'),_0x274dce,_0xc26148[_0xaa71('0x11')][_0xaa71('0x13')]);return _0x5a0dca(_0xc26148[_0xaa71('0x11')]['message']);}else{logger[_0xaa71('0x14')](_0xaa71('0x12'),_0x274dce,_0xaa71('0xd'));_0x5a0dca(_0xc26148['result'][_0xaa71('0x13')]);}})[_0xaa71('0x15')](function(_0x25a7ac){logger[_0xaa71('0x11')](_0xaa71('0x12'),_0x274dce,_0x25a7ac);_0x50ad8f(_0x25a7ac);});});}
\ No newline at end of file
+var _0xdc91=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1a227b,_0x1534bb){var _0x1819f7=function(_0x38197f){while(--_0x38197f){_0x1a227b['push'](_0x1a227b['shift']());}};_0x1819f7(++_0x1534bb);}(_0xdc91,0x8b));var _0x1dc9=function(_0x5360b9,_0xaa2c02){_0x5360b9=_0x5360b9-0x0;var _0x1b8e7f=_0xdc91[_0x5360b9];return _0x1b8e7f;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});}
\ No newline at end of file
index 00f7d76..a2e32ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb30f=['/:id/configurations','post','create','addConfiguration','/:id','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','get','show'];(function(_0x5ab7b4,_0x63259c){var _0x3a80ec=function(_0x1310d4){while(--_0x1310d4){_0x5ab7b4['push'](_0x5ab7b4['shift']());}};_0x3a80ec(++_0x63259c);}(_0xb30f,0xfe));var _0xfb30=function(_0x30cb69,_0x1de97d){_0x30cb69=_0x30cb69-0x0;var _0x12ff2f=_0xb30f[_0x30cb69];return _0x12ff2f;};'use strict';var multer=require(_0xfb30('0x0'));var util=require(_0xfb30('0x1'));var path=require('path');var timeout=require(_0xfb30('0x2'));var express=require(_0xfb30('0x3'));var router=express[_0xfb30('0x4')]();var auth=require(_0xfb30('0x5'));var interaction=require(_0xfb30('0x6'));var config=require(_0xfb30('0x7'));var controller=require(_0xfb30('0x8'));router['get']('/',auth[_0xfb30('0x9')](),controller['index']);router[_0xfb30('0xa')]('/:id',auth[_0xfb30('0x9')](),controller[_0xfb30('0xb')]);router[_0xfb30('0xa')](_0xfb30('0xc'),auth[_0xfb30('0x9')](),controller['getConfigurations']);router[_0xfb30('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xfb30('0xd')]('/',auth[_0xfb30('0x9')](),controller[_0xfb30('0xe')]);router[_0xfb30('0xd')]('/:id/configurations',auth[_0xfb30('0x9')](),controller[_0xfb30('0xf')]);router['put'](_0xfb30('0x10'),auth[_0xfb30('0x9')](),controller['update']);router[_0xfb30('0x11')](_0xfb30('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xfb30('0x12')]=router;
\ No newline at end of file
+var _0x1df3=['express','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','index','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x50b2da,_0x9f4363){var _0x9f30d9=function(_0x1b3e37){while(--_0x1b3e37){_0x50b2da['push'](_0x50b2da['shift']());}};_0x9f30d9(++_0x9f4363);}(_0x1df3,0x134));var _0x31df=function(_0x174d3f,_0x35b95a){_0x174d3f=_0x174d3f-0x0;var _0x33daf8=_0x1df3[_0x174d3f];return _0x33daf8;};'use strict';var multer=require(_0x31df('0x0'));var util=require(_0x31df('0x1'));var path=require(_0x31df('0x2'));var timeout=require(_0x31df('0x3'));var express=require(_0x31df('0x4'));var router=express['Router']();var auth=require(_0x31df('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x31df('0x6'));var controller=require(_0x31df('0x7'));router[_0x31df('0x8')]('/',auth['isAuthenticated'](),controller[_0x31df('0x9')]);router[_0x31df('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x31df('0xa')]);router[_0x31df('0x8')](_0x31df('0xb'),auth['isAuthenticated'](),controller[_0x31df('0xc')]);router[_0x31df('0x8')](_0x31df('0xd'),auth[_0x31df('0xe')](),controller[_0x31df('0xf')]);router[_0x31df('0x10')]('/',auth['isAuthenticated'](),controller[_0x31df('0x11')]);router['post'](_0x31df('0xb'),auth[_0x31df('0xe')](),controller['addConfiguration']);router[_0x31df('0x12')]('/:id',auth[_0x31df('0xe')](),controller[_0x31df('0x13')]);router[_0x31df('0x14')](_0x31df('0x15'),auth[_0x31df('0xe')](),controller[_0x31df('0x16')]);module[_0x31df('0x17')]=router;
\ No newline at end of file
index 586fcdf..9e2f83c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66b2=['newTab','sequelize','exports','STRING','remoteUri','password','token','ENUM','integrationTab'];(function(_0x5de8bf,_0x24e115){var _0x2be3e3=function(_0x385e2c){while(--_0x385e2c){_0x5de8bf['push'](_0x5de8bf['shift']());}};_0x2be3e3(++_0x24e115);}(_0x66b2,0xa3));var _0x266b=function(_0x2050aa,_0x2e48ea){_0x2050aa=_0x2050aa-0x0;var _0x5b03bd=_0x66b2[_0x2050aa];return _0x5b03bd;};'use strict';var Sequelize=require(_0x266b('0x0'));module[_0x266b('0x1')]={'name':{'type':Sequelize[_0x266b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x266b('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x266b('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x266b('0x3')},'authType':{'type':Sequelize['ENUM'](_0x266b('0x4'),_0x266b('0x5')),'defaultValue':_0x266b('0x4')},'serverUrl':{'type':Sequelize[_0x266b('0x2')]},'type':{'type':Sequelize[_0x266b('0x6')](_0x266b('0x7'),_0x266b('0x8')),'defaultValue':_0x266b('0x7')}};
\ No newline at end of file
+var _0x0978=['remoteUri','ENUM','password','newTab','sequelize','exports','STRING','username'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x0978,0x12c));var _0x8097=function(_0x4d75c3,_0x22bddb){_0x4d75c3=_0x4d75c3-0x0;var _0xac4115=_0x0978[_0x4d75c3];return _0xac4115;};'use strict';var Sequelize=require(_0x8097('0x0'));module[_0x8097('0x1')]={'name':{'type':Sequelize[_0x8097('0x2')]},'description':{'type':Sequelize[_0x8097('0x2')]},'username':{'type':Sequelize[_0x8097('0x2')],'unique':_0x8097('0x3')},'password':{'type':Sequelize[_0x8097('0x2')]},'token':{'type':Sequelize[_0x8097('0x2')]},'remoteUri':{'type':Sequelize[_0x8097('0x2')],'unique':_0x8097('0x4')},'authType':{'type':Sequelize[_0x8097('0x5')]('password','token'),'defaultValue':_0x8097('0x6')},'serverUrl':{'type':Sequelize[_0x8097('0x2')]},'type':{'type':Sequelize[_0x8097('0x5')]('integrationTab',_0x8097('0x7')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index e672668..abbcbe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08ef=['index','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','includeAll','include','create','body','find','getConfigurations','findOne','params','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','type','channel','ZendeskField','Descriptions','getFields','username','password','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','headers','%s:%s','base64','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','title','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send'];(function(_0x3bdee2,_0x2bbb29){var _0x5d54df=function(_0x101b9f){while(--_0x101b9f){_0x3bdee2['push'](_0x3bdee2['shift']());}};_0x5d54df(++_0x2bbb29);}(_0x08ef,0xc9));var _0xf08e=function(_0x106441,_0x19d8df){_0x106441=_0x106441-0x0;var _0x2cc410=_0x08ef[_0x106441];return _0x2cc410;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf08e('0x0'));var rimraf=require(_0xf08e('0x1'));var zipdir=require(_0xf08e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf08e('0x3'));var moment=require(_0xf08e('0x4'));var BPromise=require(_0xf08e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf08e('0x6'));var sox=require(_0xf08e('0x7'));var csv=require(_0xf08e('0x8'));var ejs=require(_0xf08e('0x9'));var fs=require('fs');var _=require(_0xf08e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf08e('0xb'));var deskjs=require(_0xf08e('0xc'));var toCsv=require(_0xf08e('0x8'));var querystring=require(_0xf08e('0xd'));var Papa=require(_0xf08e('0xe'));var Redis=require(_0xf08e('0xf'));var authService=require(_0xf08e('0x10'));var qs=require(_0xf08e('0x11'));var as=require(_0xf08e('0x12'));var hardwareService=require(_0xf08e('0x13'));var logger=require(_0xf08e('0x14'))(_0xf08e('0x15'));var utils=require(_0xf08e('0x16'));var config=require('../../config/environment');var db=require(_0xf08e('0x17'))['db'];var integrations=require(_0xf08e('0x18'));var jayson=require(_0xf08e('0x19'));var client=jayson['client'][_0xf08e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x109213,_0x5de737,_0x37299c){if(_0x37299c){var _0x101d3f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x101d3f[_0xf08e('0x1b')](_0x5de737)){return _0x109213;}else{throw new db[(_0xf08e('0x1c'))][(_0xf08e('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x109213;}}function respondWithRpcPromise(_0x41e946,_0x9d6a79,_0x1b93bc,_0x3cdd77){return new BPromise(function(_0x2b26de,_0x5b2b6d){var _0x34a428=_0x3cdd77||client;return _0x34a428[_0xf08e('0x1e')](_0x41e946,_0x1b93bc)['then'](function(_0x1cb5b7){logger[_0xf08e('0x1f')](_0xf08e('0x20'),_0x9d6a79,_0xf08e('0x21'));logger['debug'](_0xf08e('0x22'),_0x9d6a79,'request\x20sent',JSON[_0xf08e('0x23')](_0x1cb5b7));if(_0x1cb5b7[_0xf08e('0x24')]){if(_0x1cb5b7['error'][_0xf08e('0x25')]===0x1f4){logger[_0xf08e('0x24')](_0xf08e('0x20'),_0x9d6a79,_0x1cb5b7['error'][_0xf08e('0x26')]);return _0x5b2b6d(_0x1cb5b7[_0xf08e('0x24')][_0xf08e('0x26')]);}logger[_0xf08e('0x24')](_0xf08e('0x20'),_0x9d6a79,_0x1cb5b7[_0xf08e('0x24')]['message']);return _0x2b26de(_0x1cb5b7['error'][_0xf08e('0x26')]);}else{logger[_0xf08e('0x1f')](_0xf08e('0x20'),_0x9d6a79,_0xf08e('0x21'));_0x2b26de(_0x1cb5b7[_0xf08e('0x27')]['message']);}})[_0xf08e('0x28')](function(_0x2f41ce){logger[_0xf08e('0x24')]('ZendeskAccount,\x20%s,\x20%s',_0x9d6a79,_0x2f41ce);_0x5b2b6d(_0x2f41ce);});});}function respondWithStatusCode(_0x477b9d,_0x294385){_0x294385=_0x294385||0xcc;return function(_0x52998d){if(_0x52998d){return _0x477b9d[_0xf08e('0x29')](_0x294385);}return _0x477b9d[_0xf08e('0x2a')](_0x294385)[_0xf08e('0x2b')]();};}function respondWithResult(_0x27bb2f,_0x3fb4f4){_0x3fb4f4=_0x3fb4f4||0xc8;return function(_0x6dd30){if(_0x6dd30){return _0x27bb2f[_0xf08e('0x2a')](_0x3fb4f4)[_0xf08e('0x2c')](_0x6dd30);}};}function respondWithFilteredResult(_0x11f6e4,_0x26a3d1){return function(_0x3cee7a){if(_0x3cee7a){var _0x4e8286=_0x3cee7a[_0xf08e('0x2d')],_0x167f67=_0x26a3d1['offset'],_0x246da6=_0x26a3d1[_0xf08e('0x2e')]+_0x26a3d1['limit'],_0x48fb23;if(_0x246da6>=_0x4e8286){_0x246da6=_0x4e8286;_0x48fb23=0xc8;}else{_0x48fb23=0xce;}_0x11f6e4[_0xf08e('0x2a')](_0x48fb23);return _0x11f6e4[_0xf08e('0x2f')](_0xf08e('0x30'),_0x167f67+'-'+_0x246da6+'/'+_0x4e8286)[_0xf08e('0x2c')](_0x3cee7a);}return null;};}function patchUpdates(_0x567d9d){return function(_0x5838b7){try{jsonpatch[_0xf08e('0x31')](_0x5838b7,_0x567d9d,!![]);}catch(_0x31b676){return BPromise[_0xf08e('0x32')](_0x31b676);}return _0x5838b7[_0xf08e('0x33')]();};}function saveUpdates(_0x397858,_0x2f369f){return function(_0x167c57){if(_0x167c57){return _0x167c57[_0xf08e('0x34')](_0x397858)[_0xf08e('0x35')](function(_0x3518a9){return _0x3518a9;});}return null;};}function removeEntity(_0x1befd6,_0x54b7cc){return function(_0x2cc245){if(_0x2cc245){return _0x2cc245[_0xf08e('0x36')]()['then'](function(){_0x1befd6[_0xf08e('0x2a')](0xcc)[_0xf08e('0x2b')]();});}};}function handleEntityNotFound(_0x663d23,_0x198be5){return function(_0x1c8d34){if(!_0x1c8d34){_0x663d23[_0xf08e('0x29')](0x194);}return _0x1c8d34;};}function handleError(_0x3c068b,_0x3d1a44){_0x3d1a44=_0x3d1a44||0x1f4;return function(_0x4cf642){logger[_0xf08e('0x24')](_0x4cf642['stack']);if(_0x4cf642['name']){delete _0x4cf642[_0xf08e('0x37')];}_0x3c068b[_0xf08e('0x2a')](_0x3d1a44)[_0xf08e('0x38')](_0x4cf642);};}exports[_0xf08e('0x39')]=function(_0x2ebbc9,_0x48bc4c){var _0x39f076={},_0x5c899c={},_0x34e7b1={'count':0x0,'rows':[]};var _0xec5ee9=_[_0xf08e('0x3a')](db[_0xf08e('0x3b')][_0xf08e('0x3c')],function(_0x2c119c){return{'name':_0x2c119c[_0xf08e('0x3d')],'type':_0x2c119c['type'][_0xf08e('0x3e')]};});_0x5c899c[_0xf08e('0x3f')]=_[_0xf08e('0x3a')](_0xec5ee9,_0xf08e('0x37'));_0x5c899c[_0xf08e('0x40')]=_[_0xf08e('0x41')](_0x2ebbc9['query']);_0x5c899c[_0xf08e('0x42')]=_['intersection'](_0x5c899c['model'],_0x5c899c['query']);_0x39f076[_0xf08e('0x43')]=_[_0xf08e('0x44')](_0x5c899c[_0xf08e('0x3f')],qs[_0xf08e('0x45')](_0x2ebbc9[_0xf08e('0x40')][_0xf08e('0x45')]));_0x39f076[_0xf08e('0x43')]=_0x39f076[_0xf08e('0x43')][_0xf08e('0x46')]?_0x39f076['attributes']:_0x5c899c[_0xf08e('0x3f')];if(!_0x2ebbc9[_0xf08e('0x40')][_0xf08e('0x47')](_0xf08e('0x48'))){_0x39f076['limit']=qs[_0xf08e('0x49')](_0x2ebbc9[_0xf08e('0x40')][_0xf08e('0x49')]);_0x39f076[_0xf08e('0x2e')]=qs[_0xf08e('0x2e')](_0x2ebbc9[_0xf08e('0x40')][_0xf08e('0x2e')]);}_0x39f076[_0xf08e('0x4a')]=qs[_0xf08e('0x4b')](_0x2ebbc9['query'][_0xf08e('0x4b')]);_0x39f076[_0xf08e('0x4c')]=qs[_0xf08e('0x42')](_[_0xf08e('0x4d')](_0x2ebbc9[_0xf08e('0x40')],_0x5c899c['filters']),_0xec5ee9);if(_0x2ebbc9[_0xf08e('0x40')][_0xf08e('0x4e')]){_0x39f076[_0xf08e('0x4c')]=_['merge'](_0x39f076[_0xf08e('0x4c')],{'$or':_['map'](_0xec5ee9,function(_0x47173f){if(_0x47173f['type']!==_0xf08e('0x4f')){var _0x23992a={};_0x23992a[_0x47173f[_0xf08e('0x37')]]={'$like':'%'+_0x2ebbc9[_0xf08e('0x40')][_0xf08e('0x4e')]+'%'};return _0x23992a;}})});}_0x39f076=_[_0xf08e('0x50')]({},_0x39f076,_0x2ebbc9[_0xf08e('0x51')]);var _0x27732f={'where':_0x39f076['where']};return db['ZendeskAccount'][_0xf08e('0x2d')](_0x27732f)[_0xf08e('0x35')](function(_0x5eab3b){_0x34e7b1[_0xf08e('0x2d')]=_0x5eab3b;if(_0x2ebbc9[_0xf08e('0x40')]['includeAll']){_0x39f076['include']=[{'all':!![]}];}return db[_0xf08e('0x3b')][_0xf08e('0x52')](_0x39f076);})[_0xf08e('0x35')](function(_0x5d605c){_0x34e7b1[_0xf08e('0x53')]=_0x5d605c;return _0x34e7b1;})[_0xf08e('0x35')](respondWithFilteredResult(_0x48bc4c,_0x39f076))['catch'](handleError(_0x48bc4c,null));};exports['show']=function(_0x4b7296,_0x296ba5){var _0x5caef7={'raw':![],'where':{'id':_0x4b7296['params']['id']}},_0x343a82={};_0x343a82[_0xf08e('0x3f')]=_['keys'](db['ZendeskAccount'][_0xf08e('0x3c')]);_0x343a82[_0xf08e('0x40')]=_[_0xf08e('0x41')](_0x4b7296['query']);_0x343a82[_0xf08e('0x42')]=_[_0xf08e('0x44')](_0x343a82[_0xf08e('0x3f')],_0x343a82[_0xf08e('0x40')]);_0x5caef7[_0xf08e('0x43')]=_[_0xf08e('0x44')](_0x343a82['model'],qs['fields'](_0x4b7296[_0xf08e('0x40')]['fields']));_0x5caef7[_0xf08e('0x43')]=_0x5caef7[_0xf08e('0x43')][_0xf08e('0x46')]?_0x5caef7[_0xf08e('0x43')]:_0x343a82['model'];if(_0x4b7296['query'][_0xf08e('0x54')]){_0x5caef7[_0xf08e('0x55')]=[{'all':!![]}];}_0x5caef7=_['merge']({},_0x5caef7,_0x4b7296[_0xf08e('0x51')]);return db[_0xf08e('0x3b')]['find'](_0x5caef7)[_0xf08e('0x35')](handleEntityNotFound(_0x296ba5,null))['then'](respondWithResult(_0x296ba5,null))['catch'](handleError(_0x296ba5,null));};exports[_0xf08e('0x56')]=function(_0x269bc9,_0x63c085){return db['ZendeskAccount']['create'](_0x269bc9[_0xf08e('0x57')],{})['then'](respondWithResult(_0x63c085,0xc9))['catch'](handleError(_0x63c085,null));};exports['update']=function(_0x4f8e9e,_0x49fd67){if(_0x4f8e9e[_0xf08e('0x57')]['id']){delete _0x4f8e9e[_0xf08e('0x57')]['id'];}return db[_0xf08e('0x3b')][_0xf08e('0x58')]({'where':{'id':_0x4f8e9e['params']['id']}})['then'](handleEntityNotFound(_0x49fd67,null))['then'](saveUpdates(_0x4f8e9e[_0xf08e('0x57')],null))[_0xf08e('0x35')](respondWithResult(_0x49fd67,null))[_0xf08e('0x28')](handleError(_0x49fd67,null));};exports[_0xf08e('0x36')]=function(_0x226195,_0x2fb174){return db[_0xf08e('0x3b')][_0xf08e('0x58')]({'where':{'id':_0x226195['params']['id']}})[_0xf08e('0x35')](handleEntityNotFound(_0x2fb174,null))[_0xf08e('0x35')](removeEntity(_0x2fb174,null))[_0xf08e('0x28')](handleError(_0x2fb174,null));};exports[_0xf08e('0x59')]=function(_0x5e957a,_0x1bc2d8,_0x3fad88){var _0x7354d={};var _0x4c24a3={};var _0x462ac6;var _0x52ce1e;return db[_0xf08e('0x3b')][_0xf08e('0x5a')]({'where':{'id':_0x5e957a[_0xf08e('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1bc2d8,null))[_0xf08e('0x35')](function(_0x44f140){if(_0x44f140){_0x462ac6=_0x44f140;_0x4c24a3['model']=_[_0xf08e('0x41')](db[_0xf08e('0x5c')][_0xf08e('0x3c')]);_0x4c24a3['query']=_['keys'](_0x5e957a[_0xf08e('0x40')]);_0x4c24a3[_0xf08e('0x42')]=_[_0xf08e('0x44')](_0x4c24a3['model'],_0x4c24a3['query']);_0x7354d[_0xf08e('0x43')]=_[_0xf08e('0x44')](_0x4c24a3['model'],qs[_0xf08e('0x45')](_0x5e957a[_0xf08e('0x40')][_0xf08e('0x45')]));_0x7354d['attributes']=_0x7354d[_0xf08e('0x43')][_0xf08e('0x46')]?_0x7354d['attributes']:_0x4c24a3[_0xf08e('0x3f')];_0x7354d[_0xf08e('0x4a')]=qs[_0xf08e('0x4b')](_0x5e957a[_0xf08e('0x40')][_0xf08e('0x4b')]);_0x7354d['where']=qs['filters'](_[_0xf08e('0x4d')](_0x5e957a[_0xf08e('0x40')],_0x4c24a3['filters']));if(_0x5e957a['query']['filter']){_0x7354d[_0xf08e('0x4c')]=_[_0xf08e('0x50')](_0x7354d['where'],{'$or':_['map'](_0x7354d[_0xf08e('0x43')],function(_0x17b3cf){var _0x182f01={};_0x182f01[_0x17b3cf]={'$like':'%'+_0x5e957a[_0xf08e('0x40')][_0xf08e('0x4e')]+'%'};return _0x182f01;})});}_0x7354d=_[_0xf08e('0x50')]({},_0x7354d,_0x5e957a['options']);return _0x462ac6[_0xf08e('0x59')](_0x7354d);}})[_0xf08e('0x35')](function(_0x55291e){if(_0x55291e){_0x52ce1e=_0x55291e[_0xf08e('0x46')];if(!_0x5e957a[_0xf08e('0x40')][_0xf08e('0x47')](_0xf08e('0x48'))){_0x7354d[_0xf08e('0x49')]=qs[_0xf08e('0x49')](_0x5e957a[_0xf08e('0x40')][_0xf08e('0x49')]);_0x7354d[_0xf08e('0x2e')]=qs[_0xf08e('0x2e')](_0x5e957a['query'][_0xf08e('0x2e')]);}return _0x462ac6[_0xf08e('0x59')](_0x7354d);}})[_0xf08e('0x35')](function(_0x4d3097){if(_0x4d3097){return _0x4d3097?{'count':_0x52ce1e,'rows':_0x4d3097}:null;}})['then'](respondWithResult(_0x1bc2d8,null))['catch'](handleError(_0x1bc2d8,null));};exports[_0xf08e('0x5d')]=function(_0x28968d,_0x1b7f1f,_0x182d1b){if(_0x28968d[_0xf08e('0x57')]['id']){delete _0x28968d[_0xf08e('0x57')]['id'];}return db[_0xf08e('0x3b')][_0xf08e('0x5a')]({'where':{'id':_0x28968d[_0xf08e('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1b7f1f,null))['then'](function(_0x5abadf){if(_0x5abadf){_0x28968d[_0xf08e('0x57')][_0xf08e('0x5e')]=_0x5abadf['id'];_0x28968d[_0xf08e('0x57')][_0xf08e('0x5f')]=integrations[_0xf08e('0x60')](_0x28968d['body']['channel'],_0x28968d['body'][_0xf08e('0x61')]);_0x28968d[_0xf08e('0x57')]['Descriptions']=integrations['getDescriptions'](_0x28968d[_0xf08e('0x57')][_0xf08e('0x62')],_0x28968d[_0xf08e('0x57')]['type']);return db[_0xf08e('0x5c')]['create'](_0x28968d[_0xf08e('0x57')],{'include':[{'model':db[_0xf08e('0x63')],'as':_0xf08e('0x5f')},{'model':db[_0xf08e('0x63')],'as':_0xf08e('0x64')}]});}return null;})[_0xf08e('0x35')](respondWithResult(_0x1b7f1f,null))['catch'](handleError(_0x1b7f1f,null));};exports[_0xf08e('0x65')]=function(_0x3c6aa5,_0x476cb2,_0x5059ab){var _0x219bb0='';return db[_0xf08e('0x3b')][_0xf08e('0x5a')]({'where':{'id':_0x3c6aa5[_0xf08e('0x5b')]['id']},'attributes':['id',_0xf08e('0x66'),_0xf08e('0x67'),_0xf08e('0x68'),_0xf08e('0x69'),_0xf08e('0x6a')]})[_0xf08e('0x35')](handleEntityNotFound(_0x476cb2,null))['then'](function(_0x5c7634){if(_0x5c7634){_0x219bb0=_0x5c7634['remoteUri'];var _0x4832a2=_0x219bb0[_0xf08e('0x6b')](-0x1);if(_0x4832a2==='/'){_0x219bb0=_0x219bb0[_0xf08e('0x6c')](0x0,_0x219bb0['lastIndexOf'](_0x4832a2));}var _0x19c154={'method':_0xf08e('0x6d'),'uri':util[_0xf08e('0x6e')](_0xf08e('0x6f'),_0x219bb0,_0xf08e('0x70')),'json':!![]};switch(_0x5c7634[_0xf08e('0x69')]){case _0xf08e('0x67'):_0x19c154[_0xf08e('0x71')]={'Authorization':util[_0xf08e('0x6e')]('Basic\x20%s',new Buffer(util[_0xf08e('0x6e')](_0xf08e('0x72'),_0x5c7634[_0xf08e('0x66')],_0x5c7634['password']))['toString'](_0xf08e('0x73')))};break;case _0xf08e('0x68'):_0x19c154['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xf08e('0x6e')]('%s/token:%s',_0x5c7634['username'],_0x5c7634[_0xf08e('0x68')]))['toString'](_0xf08e('0x73')))};break;default:throw new db[(_0xf08e('0x1c'))][(_0xf08e('0x1d'))](_0xf08e('0x74'));}return rp(_0x19c154);}})[_0xf08e('0x35')](function(_0x13284d){if(_0x13284d){var _0x3689f7=[_0xf08e('0x75'),_0xf08e('0x76'),_0xf08e('0x77'),_0xf08e('0x78')];_[_0xf08e('0x79')](_0x13284d[_0xf08e('0x70')],function(_0x1c7cb8){return _0x3689f7['includes'](_0x1c7cb8[_0xf08e('0x61')]);});return{'count':_0x13284d[_0xf08e('0x70')][_0xf08e('0x46')],'rows':_[_0xf08e('0x3a')](_0x13284d[_0xf08e('0x70')],function(_0x1819e5){return{'id':_0x1819e5['id'],'name':_0x1819e5['position']>0x7?_0x1819e5[_0xf08e('0x7a')]:_0x1819e5[_0xf08e('0x61')],'custom':_0x1819e5[_0xf08e('0x7b')]>0x7?!![]:![],'options':_0x1819e5[_0xf08e('0x7c')]?_0x1819e5[_0xf08e('0x7c')]:_0x1819e5['custom_field_options']?_0x1819e5[_0xf08e('0x7d')]:[]};})};}})[_0xf08e('0x35')](respondWithResult(_0x476cb2,null))['catch'](function(_0x7e891c){var _0x1cffdf=_0x3c6aa5[_0xf08e('0x40')]['test']?0x1f4:_0x7e891c['statusCode']||0x1f4;logger[_0xf08e('0x24')](_0xf08e('0x7e'),_0xf08e('0x65'),_0x1cffdf,JSON[_0xf08e('0x23')](_0x7e891c));delete _0x7e891c[_0xf08e('0x37')];if(_0x1cffdf===0x191){_0x1cffdf=0x190;}_0x476cb2[_0xf08e('0x2a')](_0x1cffdf)[_0xf08e('0x38')](_0x3c6aa5[_0xf08e('0x40')][_0xf08e('0x1b')]?{'message':_0xf08e('0x7f'),'statusCode':_0x7e891c[_0xf08e('0x80')]}:_0x7e891c);});};
\ No newline at end of file
+var _0x86a5=['../../mysqldb','../../components/integrations/configuration','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body','params','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','GET','%s/%s','ticket_fields','password','format','headers','Basic\x20%s','%s/token:%s','base64','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0xf913b7,_0x25885f){var _0x3d489d=function(_0x5dff3c){while(--_0x5dff3c){_0xf913b7['push'](_0xf913b7['shift']());}};_0x3d489d(++_0x25885f);}(_0x86a5,0x69));var _0x586a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x86a5[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x586a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x586a('0x1'));var jsonpatch=require(_0x586a('0x2'));var rp=require(_0x586a('0x3'));var moment=require(_0x586a('0x4'));var BPromise=require(_0x586a('0x5'));var Mustache=require('mustache');var util=require(_0x586a('0x6'));var path=require(_0x586a('0x7'));var sox=require(_0x586a('0x8'));var csv=require(_0x586a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x586a('0xa'));var squel=require(_0x586a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x586a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x586a('0xd'));var Redis=require('ioredis');var authService=require(_0x586a('0xe'));var qs=require(_0x586a('0xf'));var as=require(_0x586a('0x10'));var hardwareService=require(_0x586a('0x11'));var logger=require('../../config/logger')(_0x586a('0x12'));var utils=require('../../config/utils');var config=require(_0x586a('0x13'));var db=require(_0x586a('0x14'))['db'];var integrations=require(_0x586a('0x15'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x4de2af,_0x51a176,_0x235103){if(_0x235103){var _0x4fba68=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fba68[_0x586a('0x16')](_0x51a176)){return _0x4de2af;}else{throw new db[(_0x586a('0x17'))][(_0x586a('0x18'))](_0x586a('0x19'));}}else{return _0x4de2af;}}function respondWithRpcPromise(_0x21bc59,_0x2a75a7,_0x16ec5f,_0x57b9d9){return new BPromise(function(_0x4b7e86,_0x56d23a){var _0x27698b=_0x57b9d9||client;return _0x27698b[_0x586a('0x1a')](_0x21bc59,_0x16ec5f)['then'](function(_0x295a75){logger[_0x586a('0x1b')](_0x586a('0x1c'),_0x2a75a7,_0x586a('0x1d'));logger[_0x586a('0x1e')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x2a75a7,_0x586a('0x1d'),JSON[_0x586a('0x1f')](_0x295a75));if(_0x295a75[_0x586a('0x20')]){if(_0x295a75[_0x586a('0x20')][_0x586a('0x21')]===0x1f4){logger[_0x586a('0x20')](_0x586a('0x1c'),_0x2a75a7,_0x295a75[_0x586a('0x20')]['message']);return _0x56d23a(_0x295a75['error']['message']);}logger[_0x586a('0x20')](_0x586a('0x1c'),_0x2a75a7,_0x295a75[_0x586a('0x20')][_0x586a('0x22')]);return _0x4b7e86(_0x295a75[_0x586a('0x20')][_0x586a('0x22')]);}else{logger['info'](_0x586a('0x1c'),_0x2a75a7,_0x586a('0x1d'));_0x4b7e86(_0x295a75[_0x586a('0x23')][_0x586a('0x22')]);}})['catch'](function(_0x50ebc3){logger[_0x586a('0x20')](_0x586a('0x1c'),_0x2a75a7,_0x50ebc3);_0x56d23a(_0x50ebc3);});});}function respondWithStatusCode(_0x2173b3,_0xa90d81){_0xa90d81=_0xa90d81||0xcc;return function(_0x1cc1e2){if(_0x1cc1e2){return _0x2173b3[_0x586a('0x24')](_0xa90d81);}return _0x2173b3[_0x586a('0x25')](_0xa90d81)[_0x586a('0x26')]();};}function respondWithResult(_0x135794,_0x2acb03){_0x2acb03=_0x2acb03||0xc8;return function(_0x39aa3d){if(_0x39aa3d){return _0x135794[_0x586a('0x25')](_0x2acb03)[_0x586a('0x27')](_0x39aa3d);}};}function respondWithFilteredResult(_0x2a2ad5,_0x3b7c50){return function(_0x107d95){if(_0x107d95){var _0x258726=_0x107d95[_0x586a('0x28')],_0x4848b0=_0x3b7c50[_0x586a('0x29')],_0x1fa7c3=_0x3b7c50['offset']+_0x3b7c50[_0x586a('0x2a')],_0x5d0be2;if(_0x1fa7c3>=_0x258726){_0x1fa7c3=_0x258726;_0x5d0be2=0xc8;}else{_0x5d0be2=0xce;}_0x2a2ad5[_0x586a('0x25')](_0x5d0be2);return _0x2a2ad5[_0x586a('0x2b')]('Content-Range',_0x4848b0+'-'+_0x1fa7c3+'/'+_0x258726)[_0x586a('0x27')](_0x107d95);}return null;};}function patchUpdates(_0x5f5aa4){return function(_0x54b110){try{jsonpatch[_0x586a('0x2c')](_0x54b110,_0x5f5aa4,!![]);}catch(_0x4b6eaa){return BPromise[_0x586a('0x2d')](_0x4b6eaa);}return _0x54b110[_0x586a('0x2e')]();};}function saveUpdates(_0x38f41b,_0x492320){return function(_0x2d1505){if(_0x2d1505){return _0x2d1505[_0x586a('0x2f')](_0x38f41b)[_0x586a('0x30')](function(_0x234511){return _0x234511;});}return null;};}function removeEntity(_0x23ae75,_0x3ef4db){return function(_0x460d79){if(_0x460d79){return _0x460d79[_0x586a('0x31')]()[_0x586a('0x30')](function(){_0x23ae75[_0x586a('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a8afc,_0x2f183e){return function(_0xc7dfdc){if(!_0xc7dfdc){_0x2a8afc[_0x586a('0x24')](0x194);}return _0xc7dfdc;};}function handleError(_0x1c90fa,_0x45b9b5){_0x45b9b5=_0x45b9b5||0x1f4;return function(_0x4faf04){logger[_0x586a('0x20')](_0x4faf04[_0x586a('0x32')]);if(_0x4faf04[_0x586a('0x33')]){delete _0x4faf04['name'];}_0x1c90fa[_0x586a('0x25')](_0x45b9b5)[_0x586a('0x34')](_0x4faf04);};}exports[_0x586a('0x35')]=function(_0xb519ff,_0x1d11d7){var _0x241002={},_0x11f36b={},_0x179d02={'count':0x0,'rows':[]};var _0x22bfbb=_[_0x586a('0x36')](db[_0x586a('0x37')][_0x586a('0x38')],function(_0x38bf4e){return{'name':_0x38bf4e['fieldName'],'type':_0x38bf4e['type'][_0x586a('0x39')]};});_0x11f36b[_0x586a('0x3a')]=_[_0x586a('0x36')](_0x22bfbb,_0x586a('0x33'));_0x11f36b[_0x586a('0x3b')]=_[_0x586a('0x3c')](_0xb519ff[_0x586a('0x3b')]);_0x11f36b['filters']=_[_0x586a('0x3d')](_0x11f36b[_0x586a('0x3a')],_0x11f36b['query']);_0x241002[_0x586a('0x3e')]=_[_0x586a('0x3d')](_0x11f36b[_0x586a('0x3a')],qs[_0x586a('0x3f')](_0xb519ff[_0x586a('0x3b')]['fields']));_0x241002[_0x586a('0x3e')]=_0x241002[_0x586a('0x3e')][_0x586a('0x40')]?_0x241002[_0x586a('0x3e')]:_0x11f36b[_0x586a('0x3a')];if(!_0xb519ff['query'][_0x586a('0x41')](_0x586a('0x42'))){_0x241002[_0x586a('0x2a')]=qs[_0x586a('0x2a')](_0xb519ff['query']['limit']);_0x241002[_0x586a('0x29')]=qs[_0x586a('0x29')](_0xb519ff[_0x586a('0x3b')][_0x586a('0x29')]);}_0x241002[_0x586a('0x43')]=qs[_0x586a('0x44')](_0xb519ff['query']['sort']);_0x241002[_0x586a('0x45')]=qs[_0x586a('0x46')](_['pick'](_0xb519ff[_0x586a('0x3b')],_0x11f36b[_0x586a('0x46')]),_0x22bfbb);if(_0xb519ff[_0x586a('0x3b')][_0x586a('0x47')]){_0x241002['where']=_[_0x586a('0x48')](_0x241002[_0x586a('0x45')],{'$or':_[_0x586a('0x36')](_0x22bfbb,function(_0x381ce8){if(_0x381ce8[_0x586a('0x49')]!==_0x586a('0x4a')){var _0x4d7a59={};_0x4d7a59[_0x381ce8[_0x586a('0x33')]]={'$like':'%'+_0xb519ff['query'][_0x586a('0x47')]+'%'};return _0x4d7a59;}})});}_0x241002=_['merge']({},_0x241002,_0xb519ff[_0x586a('0x4b')]);var _0x13a8a4={'where':_0x241002[_0x586a('0x45')]};return db[_0x586a('0x37')][_0x586a('0x28')](_0x13a8a4)[_0x586a('0x30')](function(_0x3c757b){_0x179d02[_0x586a('0x28')]=_0x3c757b;if(_0xb519ff[_0x586a('0x3b')][_0x586a('0x4c')]){_0x241002['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x586a('0x4d')](_0x241002);})[_0x586a('0x30')](function(_0xbd992b){_0x179d02['rows']=_0xbd992b;return _0x179d02;})[_0x586a('0x30')](respondWithFilteredResult(_0x1d11d7,_0x241002))[_0x586a('0x4e')](handleError(_0x1d11d7,null));};exports[_0x586a('0x4f')]=function(_0x15ec1c,_0x2185f1){var _0x3367c0={'raw':![],'where':{'id':_0x15ec1c['params']['id']}},_0x4d371d={};_0x4d371d[_0x586a('0x3a')]=_[_0x586a('0x3c')](db['ZendeskAccount'][_0x586a('0x38')]);_0x4d371d['query']=_['keys'](_0x15ec1c[_0x586a('0x3b')]);_0x4d371d[_0x586a('0x46')]=_[_0x586a('0x3d')](_0x4d371d[_0x586a('0x3a')],_0x4d371d[_0x586a('0x3b')]);_0x3367c0[_0x586a('0x3e')]=_[_0x586a('0x3d')](_0x4d371d['model'],qs['fields'](_0x15ec1c[_0x586a('0x3b')][_0x586a('0x3f')]));_0x3367c0[_0x586a('0x3e')]=_0x3367c0[_0x586a('0x3e')][_0x586a('0x40')]?_0x3367c0[_0x586a('0x3e')]:_0x4d371d[_0x586a('0x3a')];if(_0x15ec1c[_0x586a('0x3b')][_0x586a('0x4c')]){_0x3367c0[_0x586a('0x50')]=[{'all':!![]}];}_0x3367c0=_['merge']({},_0x3367c0,_0x15ec1c[_0x586a('0x4b')]);return db[_0x586a('0x37')][_0x586a('0x51')](_0x3367c0)[_0x586a('0x30')](handleEntityNotFound(_0x2185f1,null))['then'](respondWithResult(_0x2185f1,null))['catch'](handleError(_0x2185f1,null));};exports[_0x586a('0x52')]=function(_0x3f6792,_0x46500a){return db[_0x586a('0x37')]['create'](_0x3f6792[_0x586a('0x53')],{})[_0x586a('0x30')](respondWithResult(_0x46500a,0xc9))['catch'](handleError(_0x46500a,null));};exports[_0x586a('0x2f')]=function(_0x5b3fbb,_0x248459){if(_0x5b3fbb[_0x586a('0x53')]['id']){delete _0x5b3fbb[_0x586a('0x53')]['id'];}return db[_0x586a('0x37')][_0x586a('0x51')]({'where':{'id':_0x5b3fbb[_0x586a('0x54')]['id']}})[_0x586a('0x30')](handleEntityNotFound(_0x248459,null))[_0x586a('0x30')](saveUpdates(_0x5b3fbb[_0x586a('0x53')],null))[_0x586a('0x30')](respondWithResult(_0x248459,null))[_0x586a('0x4e')](handleError(_0x248459,null));};exports['destroy']=function(_0x128aa8,_0x29b1b5){return db[_0x586a('0x37')][_0x586a('0x51')]({'where':{'id':_0x128aa8[_0x586a('0x54')]['id']}})['then'](handleEntityNotFound(_0x29b1b5,null))[_0x586a('0x30')](removeEntity(_0x29b1b5,null))[_0x586a('0x4e')](handleError(_0x29b1b5,null));};exports['getConfigurations']=function(_0x4e88d6,_0x34a777,_0x476245){var _0x3357a7={};var _0x4ac814={};var _0x7b4498;var _0x47b0bc;return db[_0x586a('0x37')][_0x586a('0x55')]({'where':{'id':_0x4e88d6[_0x586a('0x54')]['id']}})[_0x586a('0x30')](handleEntityNotFound(_0x34a777,null))['then'](function(_0x59e580){if(_0x59e580){_0x7b4498=_0x59e580;_0x4ac814[_0x586a('0x3a')]=_['keys'](db[_0x586a('0x56')][_0x586a('0x38')]);_0x4ac814[_0x586a('0x3b')]=_[_0x586a('0x3c')](_0x4e88d6[_0x586a('0x3b')]);_0x4ac814[_0x586a('0x46')]=_[_0x586a('0x3d')](_0x4ac814[_0x586a('0x3a')],_0x4ac814[_0x586a('0x3b')]);_0x3357a7[_0x586a('0x3e')]=_[_0x586a('0x3d')](_0x4ac814['model'],qs['fields'](_0x4e88d6[_0x586a('0x3b')][_0x586a('0x3f')]));_0x3357a7[_0x586a('0x3e')]=_0x3357a7[_0x586a('0x3e')][_0x586a('0x40')]?_0x3357a7[_0x586a('0x3e')]:_0x4ac814[_0x586a('0x3a')];_0x3357a7[_0x586a('0x43')]=qs[_0x586a('0x44')](_0x4e88d6[_0x586a('0x3b')][_0x586a('0x44')]);_0x3357a7[_0x586a('0x45')]=qs[_0x586a('0x46')](_['pick'](_0x4e88d6[_0x586a('0x3b')],_0x4ac814[_0x586a('0x46')]));if(_0x4e88d6['query'][_0x586a('0x47')]){_0x3357a7['where']=_[_0x586a('0x48')](_0x3357a7[_0x586a('0x45')],{'$or':_['map'](_0x3357a7['attributes'],function(_0x1b99d6){var _0x1b7d95={};_0x1b7d95[_0x1b99d6]={'$like':'%'+_0x4e88d6['query']['filter']+'%'};return _0x1b7d95;})});}_0x3357a7=_['merge']({},_0x3357a7,_0x4e88d6[_0x586a('0x4b')]);return _0x7b4498[_0x586a('0x57')](_0x3357a7);}})[_0x586a('0x30')](function(_0x40f7f3){if(_0x40f7f3){_0x47b0bc=_0x40f7f3[_0x586a('0x40')];if(!_0x4e88d6[_0x586a('0x3b')][_0x586a('0x41')](_0x586a('0x42'))){_0x3357a7[_0x586a('0x2a')]=qs[_0x586a('0x2a')](_0x4e88d6[_0x586a('0x3b')][_0x586a('0x2a')]);_0x3357a7[_0x586a('0x29')]=qs[_0x586a('0x29')](_0x4e88d6[_0x586a('0x3b')][_0x586a('0x29')]);}return _0x7b4498['getConfigurations'](_0x3357a7);}})[_0x586a('0x30')](function(_0x399d5f){if(_0x399d5f){return _0x399d5f?{'count':_0x47b0bc,'rows':_0x399d5f}:null;}})['then'](respondWithResult(_0x34a777,null))[_0x586a('0x4e')](handleError(_0x34a777,null));};exports[_0x586a('0x58')]=function(_0x424d96,_0x4f3cf6,_0xf66c2b){if(_0x424d96[_0x586a('0x53')]['id']){delete _0x424d96[_0x586a('0x53')]['id'];}return db[_0x586a('0x37')]['findOne']({'where':{'id':_0x424d96[_0x586a('0x54')]['id']}})[_0x586a('0x30')](handleEntityNotFound(_0x4f3cf6,null))[_0x586a('0x30')](function(_0x3e4ce8){if(_0x3e4ce8){_0x424d96[_0x586a('0x53')][_0x586a('0x59')]=_0x3e4ce8['id'];_0x424d96[_0x586a('0x53')][_0x586a('0x5a')]=integrations[_0x586a('0x5b')](_0x424d96[_0x586a('0x53')][_0x586a('0x5c')],_0x424d96['body'][_0x586a('0x49')]);_0x424d96[_0x586a('0x53')][_0x586a('0x5d')]=integrations[_0x586a('0x5e')](_0x424d96[_0x586a('0x53')][_0x586a('0x5c')],_0x424d96[_0x586a('0x53')]['type']);return db['ZendeskConfiguration'][_0x586a('0x52')](_0x424d96['body'],{'include':[{'model':db[_0x586a('0x5f')],'as':_0x586a('0x5a')},{'model':db['ZendeskField'],'as':_0x586a('0x5d')}]});}return null;})[_0x586a('0x30')](respondWithResult(_0x4f3cf6,null))[_0x586a('0x4e')](handleError(_0x4f3cf6,null));};exports[_0x586a('0x60')]=function(_0x1d23c5,_0x3cc389,_0x3ae97a){var _0x545e10='';return db['ZendeskAccount'][_0x586a('0x55')]({'where':{'id':_0x1d23c5[_0x586a('0x54')]['id']},'attributes':['id',_0x586a('0x61'),'password',_0x586a('0x62'),_0x586a('0x63'),_0x586a('0x64')]})[_0x586a('0x30')](handleEntityNotFound(_0x3cc389,null))[_0x586a('0x30')](function(_0x1363b8){if(_0x1363b8){_0x545e10=_0x1363b8[_0x586a('0x64')];var _0x237312=_0x545e10[_0x586a('0x65')](-0x1);if(_0x237312==='/'){_0x545e10=_0x545e10[_0x586a('0x66')](0x0,_0x545e10['lastIndexOf'](_0x237312));}var _0x3c6dc9={'method':_0x586a('0x67'),'uri':util['format'](_0x586a('0x68'),_0x545e10,_0x586a('0x69')),'json':!![]};switch(_0x1363b8[_0x586a('0x63')]){case _0x586a('0x6a'):_0x3c6dc9['headers']={'Authorization':util[_0x586a('0x6b')]('Basic\x20%s',new Buffer(util[_0x586a('0x6b')]('%s:%s',_0x1363b8[_0x586a('0x61')],_0x1363b8['password']))['toString']('base64'))};break;case _0x586a('0x62'):_0x3c6dc9[_0x586a('0x6c')]={'Authorization':util['format'](_0x586a('0x6d'),new Buffer(util[_0x586a('0x6b')](_0x586a('0x6e'),_0x1363b8[_0x586a('0x61')],_0x1363b8[_0x586a('0x62')]))['toString'](_0x586a('0x6f')))};break;default:throw new db[(_0x586a('0x17'))][(_0x586a('0x18'))](_0x586a('0x70'));}return rp(_0x3c6dc9);}})[_0x586a('0x30')](function(_0x56eaac){if(_0x56eaac){var _0xcd931c=['subject',_0x586a('0x71'),_0x586a('0x72'),_0x586a('0x73')];_[_0x586a('0x74')](_0x56eaac[_0x586a('0x69')],function(_0x3097bb){return _0xcd931c[_0x586a('0x75')](_0x3097bb['type']);});return{'count':_0x56eaac[_0x586a('0x69')]['length'],'rows':_[_0x586a('0x36')](_0x56eaac[_0x586a('0x69')],function(_0x2ab938){return{'id':_0x2ab938['id'],'name':_0x2ab938[_0x586a('0x76')]>0x7?_0x2ab938[_0x586a('0x77')]:_0x2ab938[_0x586a('0x49')],'custom':_0x2ab938[_0x586a('0x76')]>0x7?!![]:![],'options':_0x2ab938[_0x586a('0x78')]?_0x2ab938[_0x586a('0x78')]:_0x2ab938['custom_field_options']?_0x2ab938[_0x586a('0x79')]:[]};})};}})[_0x586a('0x30')](respondWithResult(_0x3cc389,null))['catch'](function(_0x1077f6){var _0x3e0fb7=_0x1d23c5['query']['test']?0x1f4:_0x1077f6['statusCode']||0x1f4;logger[_0x586a('0x20')](_0x586a('0x7a'),_0x586a('0x60'),_0x3e0fb7,JSON[_0x586a('0x1f')](_0x1077f6));delete _0x1077f6['name'];if(_0x3e0fb7===0x191){_0x3e0fb7=0x190;}_0x3cc389[_0x586a('0x25')](_0x3e0fb7)['send'](_0x1d23c5['query'][_0x586a('0x16')]?{'message':_0x586a('0x7b'),'statusCode':_0x1077f6[_0x586a('0x7c')]}:_0x1077f6);});};
\ No newline at end of file
index 16bbbb9..ac8183c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7472=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x171906,_0x548e8a){var _0x213bb7=function(_0x3a27be){while(--_0x3a27be){_0x171906['push'](_0x171906['shift']());}};_0x213bb7(++_0x548e8a);}(_0x7472,0xa8));var _0x2747=function(_0x19374b,_0x26167a){_0x19374b=_0x19374b-0x0;var _0x8ee0fa=_0x7472[_0x19374b];return _0x8ee0fa;};'use strict';var _=require(_0x2747('0x0'));var util=require('util');var logger=require(_0x2747('0x1'))(_0x2747('0x2'));var moment=require(_0x2747('0x3'));var BPromise=require(_0x2747('0x4'));var rp=require(_0x2747('0x5'));var fs=require('fs');var path=require(_0x2747('0x6'));var rimraf=require(_0x2747('0x7'));var config=require(_0x2747('0x8'));var attributes=require(_0x2747('0x9'));var integrations=require(_0x2747('0xa'));module[_0x2747('0xb')]=function(_0x2c1715,_0x15ad36){return _0x2c1715['define']('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9b9=['int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount'];(function(_0x368587,_0x1b6554){var _0x42d33c=function(_0xfdccf){while(--_0xfdccf){_0x368587['push'](_0x368587['shift']());}};_0x42d33c(++_0x1b6554);}(_0xe9b9,0x83));var _0x9e9b=function(_0x4a0174,_0x527af9){_0x4a0174=_0x4a0174-0x0;var _0x116e55=_0xe9b9[_0x4a0174];return _0x116e55;};'use strict';var _=require('lodash');var util=require(_0x9e9b('0x0'));var logger=require(_0x9e9b('0x1'))(_0x9e9b('0x2'));var moment=require(_0x9e9b('0x3'));var BPromise=require(_0x9e9b('0x4'));var rp=require(_0x9e9b('0x5'));var fs=require('fs');var path=require(_0x9e9b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e9b('0x7'));var integrations=require(_0x9e9b('0x8'));module[_0x9e9b('0x9')]=function(_0x349592,_0x2b42cb){return _0x349592[_0x9e9b('0xa')](_0x9e9b('0xb'),attributes,{'tableName':_0x9e9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fffe509..6a57a85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','ZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','findAll'];(function(_0x55e839,_0x3b5345){var _0x39c61a=function(_0x5bd269){while(--_0x5bd269){_0x55e839['push'](_0x55e839['shift']());}};_0x39c61a(++_0x3b5345);}(_0xe706,0xa3));var _0x6e70=function(_0x1843b2,_0x15cfd4){_0x1843b2=_0x1843b2-0x0;var _0x2d070d=_0xe706[_0x1843b2];return _0x2d070d;};'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']('ZendeskAccount,\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']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['ZendeskAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetZendeskAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});};
\ No newline at end of file
+var _0xa9e0=['code','error','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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['GetZendeskAccount']=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']('ShowZendeskAccount',_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
index 2b104cf..67616b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba04=['isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x22f11d,_0x11a683){var _0x3319bf=function(_0x2fbbf1){while(--_0x2fbbf1){_0x22f11d['push'](_0x22f11d['shift']());}};_0x3319bf(++_0x11a683);}(_0xba04,0x156));var _0x4ba0=function(_0x182385,_0x107b84){_0x182385=_0x182385-0x0;var _0x3f2788=_0xba04[_0x182385];return _0x3f2788;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ba0('0x0'));var timeout=require(_0x4ba0('0x1'));var express=require(_0x4ba0('0x2'));var router=express[_0x4ba0('0x3')]();var auth=require(_0x4ba0('0x4'));var interaction=require(_0x4ba0('0x5'));var config=require(_0x4ba0('0x6'));var controller=require(_0x4ba0('0x7'));router[_0x4ba0('0x8')]('/',auth[_0x4ba0('0x9')](),controller[_0x4ba0('0xa')]);router['get']('/:id',auth[_0x4ba0('0x9')](),controller[_0x4ba0('0xb')]);router['get'](_0x4ba0('0xc'),auth[_0x4ba0('0x9')](),controller[_0x4ba0('0xd')]);router[_0x4ba0('0x8')](_0x4ba0('0xe'),auth[_0x4ba0('0x9')](),controller[_0x4ba0('0xf')]);router[_0x4ba0('0x8')](_0x4ba0('0x10'),auth[_0x4ba0('0x9')](),controller[_0x4ba0('0x11')]);router[_0x4ba0('0x8')](_0x4ba0('0x12'),auth[_0x4ba0('0x9')](),controller['getTags']);router[_0x4ba0('0x13')]('/',auth['isAuthenticated'](),controller[_0x4ba0('0x14')]);router[_0x4ba0('0x13')](_0x4ba0('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x4ba0('0x15')](_0x4ba0('0x16'),auth['isAuthenticated'](),controller[_0x4ba0('0x17')]);router[_0x4ba0('0x18')](_0x4ba0('0x16'),auth['isAuthenticated'](),controller[_0x4ba0('0x19')]);module[_0x4ba0('0x1a')]=router;
\ No newline at end of file
+var _0x574e=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags'];(function(_0xc59496,_0x50364c){var _0x19917d=function(_0x534b19){while(--_0x534b19){_0xc59496['push'](_0xc59496['shift']());}};_0x19917d(++_0x50364c);}(_0x574e,0x130));var _0xe574=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x574e[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0xe574('0x0'));var util=require(_0xe574('0x1'));var path=require(_0xe574('0x2'));var timeout=require(_0xe574('0x3'));var express=require(_0xe574('0x4'));var router=express[_0xe574('0x5')]();var auth=require(_0xe574('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe574('0x7'));var controller=require(_0xe574('0x8'));router[_0xe574('0x9')]('/',auth[_0xe574('0xa')](),controller[_0xe574('0xb')]);router[_0xe574('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe574('0xc')]);router[_0xe574('0x9')]('/:id/fields',auth[_0xe574('0xa')](),controller[_0xe574('0xd')]);router['get'](_0xe574('0xe'),auth[_0xe574('0xa')](),controller['getSubjects']);router[_0xe574('0x9')](_0xe574('0xf'),auth[_0xe574('0xa')](),controller[_0xe574('0x10')]);router['get']('/:id/tags',auth[_0xe574('0xa')](),controller['getTags']);router[_0xe574('0x11')]('/',auth[_0xe574('0xa')](),controller[_0xe574('0x12')]);router[_0xe574('0x11')](_0xe574('0x13'),auth[_0xe574('0xa')](),controller[_0xe574('0x14')]);router['put'](_0xe574('0x15'),auth[_0xe574('0xa')](),controller[_0xe574('0x16')]);router['delete'](_0xe574('0x15'),auth[_0xe574('0xa')](),controller[_0xe574('0x17')]);module[_0xe574('0x18')]=router;
\ No newline at end of file
index ee05869..db27753 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ad0=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ad0,0x195));var _0x03ad=function(_0x3cc596,_0x3b2807){_0x3cc596=_0x3cc596-0x0;var _0x55b4b4=_0x3ad0[_0x3cc596];return _0x55b4b4;};'use strict';var Sequelize=require(_0x03ad('0x0'));module[_0x03ad('0x1')]={'name':{'type':Sequelize[_0x03ad('0x2')]},'description':{'type':Sequelize[_0x03ad('0x2')]}};
\ No newline at end of file
+var _0xc5a8=['STRING','exports'];(function(_0x3742bb,_0x2ab08c){var _0x5d91e1=function(_0x84c06b){while(--_0x84c06b){_0x3742bb['push'](_0x3742bb['shift']());}};_0x5d91e1(++_0x2ab08c);}(_0xc5a8,0x12f));var _0x8c5a=function(_0x23ad5d,_0x3047c5){_0x23ad5d=_0x23ad5d-0x0;var _0x51eda1=_0xc5a8[_0x23ad5d];return _0x51eda1;};'use strict';var Sequelize=require('sequelize');module[_0x8c5a('0x0')]={'name':{'type':Sequelize[_0x8c5a('0x1')]},'description':{'type':Sequelize[_0x8c5a('0x1')]}};
\ No newline at end of file
index 42cd220..a7ebbbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcb0=['count','offset','set','apply','reject','save','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','limit','order','sort','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','update','getFields','findOne','ZendeskField','pick','hasOwnProperty','getSubjects','filter','nolimit','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json'];(function(_0x3ece3f,_0x51a601){var _0x4bab5c=function(_0x1bf1ab){while(--_0x1bf1ab){_0x3ece3f['push'](_0x3ece3f['shift']());}};_0x4bab5c(++_0x51a601);}(_0xbcb0,0x160));var _0x0bcb=function(_0x11252a,_0x1be40f){_0x11252a=_0x11252a-0x0;var _0x12b0de=_0xbcb0[_0x11252a];return _0x12b0de;};'use strict';var pdf=require(_0x0bcb('0x0'));var emlformat=require(_0x0bcb('0x1'));var rimraf=require(_0x0bcb('0x2'));var zipdir=require(_0x0bcb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bcb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0bcb('0x5'));var util=require(_0x0bcb('0x6'));var path=require(_0x0bcb('0x7'));var sox=require(_0x0bcb('0x8'));var csv=require(_0x0bcb('0x9'));var ejs=require(_0x0bcb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0bcb('0xb'));var crypto=require(_0x0bcb('0xc'));var jsforce=require(_0x0bcb('0xd'));var deskjs=require(_0x0bcb('0xe'));var toCsv=require(_0x0bcb('0x9'));var querystring=require(_0x0bcb('0xf'));var Papa=require(_0x0bcb('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0bcb('0x11'));var as=require(_0x0bcb('0x12'));var hardwareService=require(_0x0bcb('0x13'));var logger=require(_0x0bcb('0x14'))(_0x0bcb('0x15'));var utils=require(_0x0bcb('0x16'));var config=require(_0x0bcb('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x0bcb('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4e4828,_0x29955a,_0x1a66f9){if(_0x1a66f9){var _0x2b05bc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b05bc['test'](_0x29955a)){return _0x4e4828;}else{throw new db[(_0x0bcb('0x19'))][(_0x0bcb('0x1a'))](_0x0bcb('0x1b'));}}else{return _0x4e4828;}}function respondWithRpcPromise(_0x1d23c0,_0x4d04e3,_0x3b4c5b,_0x1b913f){return new BPromise(function(_0x16fbc5,_0x2828d5){var _0x54c3c7=_0x1b913f||client;return _0x54c3c7[_0x0bcb('0x1c')](_0x1d23c0,_0x3b4c5b)[_0x0bcb('0x1d')](function(_0x41e239){logger[_0x0bcb('0x1e')](_0x0bcb('0x1f'),_0x4d04e3,'request\x20sent');logger[_0x0bcb('0x20')](_0x0bcb('0x21'),_0x4d04e3,_0x0bcb('0x22'),JSON[_0x0bcb('0x23')](_0x41e239));if(_0x41e239[_0x0bcb('0x24')]){if(_0x41e239[_0x0bcb('0x24')][_0x0bcb('0x25')]===0x1f4){logger[_0x0bcb('0x24')](_0x0bcb('0x1f'),_0x4d04e3,_0x41e239[_0x0bcb('0x24')][_0x0bcb('0x26')]);return _0x2828d5(_0x41e239[_0x0bcb('0x24')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4d04e3,_0x41e239[_0x0bcb('0x24')][_0x0bcb('0x26')]);return _0x16fbc5(_0x41e239[_0x0bcb('0x24')]['message']);}else{logger[_0x0bcb('0x1e')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4d04e3,_0x0bcb('0x22'));_0x16fbc5(_0x41e239[_0x0bcb('0x27')]['message']);}})[_0x0bcb('0x28')](function(_0x3cb920){logger[_0x0bcb('0x24')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4d04e3,_0x3cb920);_0x2828d5(_0x3cb920);});});}function respondWithStatusCode(_0x430f22,_0x311a50){_0x311a50=_0x311a50||0xcc;return function(_0x143538){if(_0x143538){return _0x430f22[_0x0bcb('0x29')](_0x311a50);}return _0x430f22[_0x0bcb('0x2a')](_0x311a50)['end']();};}function respondWithResult(_0x550f58,_0x2fe436){_0x2fe436=_0x2fe436||0xc8;return function(_0x2de486){if(_0x2de486){return _0x550f58[_0x0bcb('0x2a')](_0x2fe436)[_0x0bcb('0x2b')](_0x2de486);}};}function respondWithFilteredResult(_0x3c5c29,_0x3ecf7d){return function(_0x42decc){if(_0x42decc){var _0x1bd458=_0x42decc[_0x0bcb('0x2c')],_0x4eedd7=_0x3ecf7d[_0x0bcb('0x2d')],_0x128b8e=_0x3ecf7d[_0x0bcb('0x2d')]+_0x3ecf7d['limit'],_0x2c8753;if(_0x128b8e>=_0x1bd458){_0x128b8e=_0x1bd458;_0x2c8753=0xc8;}else{_0x2c8753=0xce;}_0x3c5c29['status'](_0x2c8753);return _0x3c5c29[_0x0bcb('0x2e')]('Content-Range',_0x4eedd7+'-'+_0x128b8e+'/'+_0x1bd458)[_0x0bcb('0x2b')](_0x42decc);}return null;};}function patchUpdates(_0x523680){return function(_0x4f23b2){try{jsonpatch[_0x0bcb('0x2f')](_0x4f23b2,_0x523680,!![]);}catch(_0x5334ac){return BPromise[_0x0bcb('0x30')](_0x5334ac);}return _0x4f23b2[_0x0bcb('0x31')]();};}function saveUpdates(_0x223cbe,_0x592802){return function(_0x15ac28){if(_0x15ac28){return _0x15ac28['update'](_0x223cbe)[_0x0bcb('0x1d')](function(_0x1754ef){return _0x1754ef;});}return null;};}function removeEntity(_0x7c0405,_0x35e862){return function(_0xc4216f){if(_0xc4216f){return _0xc4216f[_0x0bcb('0x32')]()[_0x0bcb('0x1d')](function(){_0x7c0405[_0x0bcb('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31ea56,_0x14128d){return function(_0x41106c){if(!_0x41106c){_0x31ea56['sendStatus'](0x194);}return _0x41106c;};}function handleError(_0x412f31,_0x44c244){_0x44c244=_0x44c244||0x1f4;return function(_0x38a7d0){logger[_0x0bcb('0x24')](_0x38a7d0[_0x0bcb('0x33')]);if(_0x38a7d0[_0x0bcb('0x34')]){delete _0x38a7d0[_0x0bcb('0x34')];}_0x412f31[_0x0bcb('0x2a')](_0x44c244)[_0x0bcb('0x35')](_0x38a7d0);};}exports[_0x0bcb('0x36')]=function(_0x13b470,_0xd72e9d){var _0x31b2ec={},_0x3c0bf3={},_0x57c1e2={'count':0x0,'rows':[]};var _0x5b02aa=_[_0x0bcb('0x37')](db[_0x0bcb('0x38')][_0x0bcb('0x39')],function(_0x4268b0){return{'name':_0x4268b0[_0x0bcb('0x3a')],'type':_0x4268b0[_0x0bcb('0x3b')][_0x0bcb('0x3c')]};});_0x3c0bf3['model']=_[_0x0bcb('0x37')](_0x5b02aa,_0x0bcb('0x34'));_0x3c0bf3['query']=_[_0x0bcb('0x3d')](_0x13b470[_0x0bcb('0x3e')]);_0x3c0bf3[_0x0bcb('0x3f')]=_['intersection'](_0x3c0bf3[_0x0bcb('0x40')],_0x3c0bf3[_0x0bcb('0x3e')]);_0x31b2ec[_0x0bcb('0x41')]=_[_0x0bcb('0x42')](_0x3c0bf3[_0x0bcb('0x40')],qs[_0x0bcb('0x43')](_0x13b470[_0x0bcb('0x3e')][_0x0bcb('0x43')]));_0x31b2ec[_0x0bcb('0x41')]=_0x31b2ec[_0x0bcb('0x41')]['length']?_0x31b2ec[_0x0bcb('0x41')]:_0x3c0bf3['model'];if(!_0x13b470[_0x0bcb('0x3e')]['hasOwnProperty']('nolimit')){_0x31b2ec[_0x0bcb('0x44')]=qs[_0x0bcb('0x44')](_0x13b470['query']['limit']);_0x31b2ec[_0x0bcb('0x2d')]=qs[_0x0bcb('0x2d')](_0x13b470[_0x0bcb('0x3e')][_0x0bcb('0x2d')]);}_0x31b2ec[_0x0bcb('0x45')]=qs[_0x0bcb('0x46')](_0x13b470['query'][_0x0bcb('0x46')]);_0x31b2ec['where']=qs[_0x0bcb('0x3f')](_['pick'](_0x13b470[_0x0bcb('0x3e')],_0x3c0bf3[_0x0bcb('0x3f')]),_0x5b02aa);if(_0x13b470[_0x0bcb('0x3e')]['filter']){_0x31b2ec['where']=_[_0x0bcb('0x47')](_0x31b2ec[_0x0bcb('0x48')],{'$or':_[_0x0bcb('0x37')](_0x5b02aa,function(_0x2c2f03){if(_0x2c2f03[_0x0bcb('0x3b')]!==_0x0bcb('0x49')){var _0xf64792={};_0xf64792[_0x2c2f03[_0x0bcb('0x34')]]={'$like':'%'+_0x13b470['query']['filter']+'%'};return _0xf64792;}})});}_0x31b2ec=_[_0x0bcb('0x47')]({},_0x31b2ec,_0x13b470[_0x0bcb('0x4a')]);var _0x13ee11={'where':_0x31b2ec[_0x0bcb('0x48')]};return db[_0x0bcb('0x38')]['count'](_0x13ee11)['then'](function(_0x12d3d3){_0x57c1e2[_0x0bcb('0x2c')]=_0x12d3d3;if(_0x13b470[_0x0bcb('0x3e')][_0x0bcb('0x4b')]){_0x31b2ec[_0x0bcb('0x4c')]=[{'all':!![]}];}return db[_0x0bcb('0x38')][_0x0bcb('0x4d')](_0x31b2ec);})[_0x0bcb('0x1d')](function(_0x2c6b1b){_0x57c1e2[_0x0bcb('0x4e')]=_0x2c6b1b;return _0x57c1e2;})['then'](respondWithFilteredResult(_0xd72e9d,_0x31b2ec))[_0x0bcb('0x28')](handleError(_0xd72e9d,null));};exports[_0x0bcb('0x4f')]=function(_0x194c5c,_0x28b1f9){var _0x2f605e={'raw':![],'where':{'id':_0x194c5c[_0x0bcb('0x50')]['id']}},_0x417577={};_0x417577['model']=_[_0x0bcb('0x3d')](db[_0x0bcb('0x38')][_0x0bcb('0x39')]);_0x417577[_0x0bcb('0x3e')]=_['keys'](_0x194c5c[_0x0bcb('0x3e')]);_0x417577[_0x0bcb('0x3f')]=_[_0x0bcb('0x42')](_0x417577[_0x0bcb('0x40')],_0x417577['query']);_0x2f605e['attributes']=_['intersection'](_0x417577[_0x0bcb('0x40')],qs[_0x0bcb('0x43')](_0x194c5c[_0x0bcb('0x3e')][_0x0bcb('0x43')]));_0x2f605e[_0x0bcb('0x41')]=_0x2f605e['attributes'][_0x0bcb('0x51')]?_0x2f605e[_0x0bcb('0x41')]:_0x417577['model'];if(_0x194c5c[_0x0bcb('0x3e')]['includeAll']){_0x2f605e[_0x0bcb('0x4c')]=[{'all':!![]}];}_0x2f605e=_[_0x0bcb('0x47')]({},_0x2f605e,_0x194c5c[_0x0bcb('0x4a')]);return db['ZendeskConfiguration'][_0x0bcb('0x52')](_0x2f605e)[_0x0bcb('0x1d')](handleEntityNotFound(_0x28b1f9,null))[_0x0bcb('0x1d')](respondWithResult(_0x28b1f9,null))[_0x0bcb('0x28')](handleError(_0x28b1f9,null));};exports['create']=function(_0x138e2c,_0x1a69aa){return db[_0x0bcb('0x38')][_0x0bcb('0x53')](_0x138e2c[_0x0bcb('0x54')],{})[_0x0bcb('0x1d')](respondWithResult(_0x1a69aa,0xc9))[_0x0bcb('0x28')](handleError(_0x1a69aa,null));};exports[_0x0bcb('0x55')]=function(_0x3973dd,_0x29c66e){if(_0x3973dd[_0x0bcb('0x54')]['id']){delete _0x3973dd[_0x0bcb('0x54')]['id'];}return db[_0x0bcb('0x38')][_0x0bcb('0x52')]({'where':{'id':_0x3973dd[_0x0bcb('0x50')]['id']}})[_0x0bcb('0x1d')](handleEntityNotFound(_0x29c66e,null))['then'](saveUpdates(_0x3973dd['body'],null))['then'](respondWithResult(_0x29c66e,null))[_0x0bcb('0x28')](handleError(_0x29c66e,null));};exports[_0x0bcb('0x32')]=function(_0x53fac7,_0x169c4a){return db[_0x0bcb('0x38')]['find']({'where':{'id':_0x53fac7[_0x0bcb('0x50')]['id']}})['then'](handleEntityNotFound(_0x169c4a,null))[_0x0bcb('0x1d')](removeEntity(_0x169c4a,null))[_0x0bcb('0x28')](handleError(_0x169c4a,null));};exports[_0x0bcb('0x56')]=function(_0xfc33b,_0x16d60e,_0x43626f){var _0xa04aa1={};var _0x4bcdff={};var _0x1fed1c;var _0x286d79;return db[_0x0bcb('0x38')][_0x0bcb('0x57')]({'where':{'id':_0xfc33b['params']['id']}})[_0x0bcb('0x1d')](handleEntityNotFound(_0x16d60e,null))['then'](function(_0x43af16){if(_0x43af16){_0x1fed1c=_0x43af16;_0x4bcdff['model']=_[_0x0bcb('0x3d')](db[_0x0bcb('0x58')][_0x0bcb('0x39')]);_0x4bcdff[_0x0bcb('0x3e')]=_[_0x0bcb('0x3d')](_0xfc33b[_0x0bcb('0x3e')]);_0x4bcdff['filters']=_[_0x0bcb('0x42')](_0x4bcdff[_0x0bcb('0x40')],_0x4bcdff[_0x0bcb('0x3e')]);_0xa04aa1[_0x0bcb('0x41')]=_[_0x0bcb('0x42')](_0x4bcdff[_0x0bcb('0x40')],qs[_0x0bcb('0x43')](_0xfc33b[_0x0bcb('0x3e')][_0x0bcb('0x43')]));_0xa04aa1[_0x0bcb('0x41')]=_0xa04aa1[_0x0bcb('0x41')][_0x0bcb('0x51')]?_0xa04aa1[_0x0bcb('0x41')]:_0x4bcdff['model'];_0xa04aa1['order']=qs[_0x0bcb('0x46')](_0xfc33b['query']['sort']);_0xa04aa1['where']=qs[_0x0bcb('0x3f')](_[_0x0bcb('0x59')](_0xfc33b['query'],_0x4bcdff[_0x0bcb('0x3f')]));if(_0xfc33b[_0x0bcb('0x3e')]['filter']){_0xa04aa1[_0x0bcb('0x48')]=_[_0x0bcb('0x47')](_0xa04aa1['where'],{'$or':_[_0x0bcb('0x37')](_0xa04aa1[_0x0bcb('0x41')],function(_0x5a95b6){var _0x20518f={};_0x20518f[_0x5a95b6]={'$like':'%'+_0xfc33b[_0x0bcb('0x3e')]['filter']+'%'};return _0x20518f;})});}_0xa04aa1=_[_0x0bcb('0x47')]({},_0xa04aa1,_0xfc33b['options']);return _0x1fed1c[_0x0bcb('0x56')](_0xa04aa1);}})[_0x0bcb('0x1d')](function(_0x51266a){if(_0x51266a){_0x286d79=_0x51266a[_0x0bcb('0x51')];if(!_0xfc33b[_0x0bcb('0x3e')][_0x0bcb('0x5a')]('nolimit')){_0xa04aa1[_0x0bcb('0x44')]=qs['limit'](_0xfc33b[_0x0bcb('0x3e')][_0x0bcb('0x44')]);_0xa04aa1[_0x0bcb('0x2d')]=qs[_0x0bcb('0x2d')](_0xfc33b[_0x0bcb('0x3e')][_0x0bcb('0x2d')]);}return _0x1fed1c[_0x0bcb('0x56')](_0xa04aa1);}})[_0x0bcb('0x1d')](function(_0x3a9576){if(_0x3a9576){return _0x3a9576?{'count':_0x286d79,'rows':_0x3a9576}:null;}})[_0x0bcb('0x1d')](respondWithResult(_0x16d60e,null))[_0x0bcb('0x28')](handleError(_0x16d60e,null));};exports[_0x0bcb('0x5b')]=function(_0x392399,_0x213c86,_0x5c9aea){var _0x5802ec={};var _0x4219c3={};var _0x538824;var _0x40c1ea;return db['ZendeskConfiguration'][_0x0bcb('0x57')]({'where':{'id':_0x392399[_0x0bcb('0x50')]['id']}})['then'](handleEntityNotFound(_0x213c86,null))[_0x0bcb('0x1d')](function(_0x2e9465){if(_0x2e9465){_0x538824=_0x2e9465;_0x4219c3['model']=_[_0x0bcb('0x3d')](db[_0x0bcb('0x58')][_0x0bcb('0x39')]);_0x4219c3[_0x0bcb('0x3e')]=_[_0x0bcb('0x3d')](_0x392399[_0x0bcb('0x3e')]);_0x4219c3[_0x0bcb('0x3f')]=_[_0x0bcb('0x42')](_0x4219c3[_0x0bcb('0x40')],_0x4219c3[_0x0bcb('0x3e')]);_0x5802ec['attributes']=_['intersection'](_0x4219c3[_0x0bcb('0x40')],qs[_0x0bcb('0x43')](_0x392399[_0x0bcb('0x3e')][_0x0bcb('0x43')]));_0x5802ec['attributes']=_0x5802ec['attributes']['length']?_0x5802ec[_0x0bcb('0x41')]:_0x4219c3[_0x0bcb('0x40')];_0x5802ec[_0x0bcb('0x45')]=qs[_0x0bcb('0x46')](_0x392399[_0x0bcb('0x3e')][_0x0bcb('0x46')]);_0x5802ec['where']=qs[_0x0bcb('0x3f')](_[_0x0bcb('0x59')](_0x392399['query'],_0x4219c3[_0x0bcb('0x3f')]));if(_0x392399['query'][_0x0bcb('0x5c')]){_0x5802ec[_0x0bcb('0x48')]=_['merge'](_0x5802ec['where'],{'$or':_['map'](_0x5802ec['attributes'],function(_0x2bf681){var _0x4a9503={};_0x4a9503[_0x2bf681]={'$like':'%'+_0x392399[_0x0bcb('0x3e')]['filter']+'%'};return _0x4a9503;})});}_0x5802ec=_[_0x0bcb('0x47')]({},_0x5802ec,_0x392399[_0x0bcb('0x4a')]);return _0x538824[_0x0bcb('0x5b')](_0x5802ec);}})[_0x0bcb('0x1d')](function(_0x58aa66){if(_0x58aa66){_0x40c1ea=_0x58aa66[_0x0bcb('0x51')];if(!_0x392399[_0x0bcb('0x3e')]['hasOwnProperty'](_0x0bcb('0x5d'))){_0x5802ec['limit']=qs['limit'](_0x392399[_0x0bcb('0x3e')]['limit']);_0x5802ec[_0x0bcb('0x2d')]=qs[_0x0bcb('0x2d')](_0x392399[_0x0bcb('0x3e')]['offset']);}return _0x538824[_0x0bcb('0x5b')](_0x5802ec);}})[_0x0bcb('0x1d')](function(_0x32f862){if(_0x32f862){return _0x32f862?{'count':_0x40c1ea,'rows':_0x32f862}:null;}})[_0x0bcb('0x1d')](respondWithResult(_0x213c86,null))[_0x0bcb('0x28')](handleError(_0x213c86,null));};exports[_0x0bcb('0x5e')]=function(_0x9eca30,_0xdbcdf7,_0x5a0550){var _0x13a44b={};var _0x37a75d={};var _0x9d0681;var _0x1c0625;return db[_0x0bcb('0x38')][_0x0bcb('0x57')]({'where':{'id':_0x9eca30[_0x0bcb('0x50')]['id']}})[_0x0bcb('0x1d')](handleEntityNotFound(_0xdbcdf7,null))[_0x0bcb('0x1d')](function(_0x2cdec0){if(_0x2cdec0){_0x9d0681=_0x2cdec0;_0x37a75d['model']=_[_0x0bcb('0x3d')](db[_0x0bcb('0x58')][_0x0bcb('0x39')]);_0x37a75d['query']=_['keys'](_0x9eca30[_0x0bcb('0x3e')]);_0x37a75d['filters']=_['intersection'](_0x37a75d['model'],_0x37a75d[_0x0bcb('0x3e')]);_0x13a44b['attributes']=_[_0x0bcb('0x42')](_0x37a75d[_0x0bcb('0x40')],qs[_0x0bcb('0x43')](_0x9eca30['query']['fields']));_0x13a44b['attributes']=_0x13a44b[_0x0bcb('0x41')][_0x0bcb('0x51')]?_0x13a44b['attributes']:_0x37a75d[_0x0bcb('0x40')];_0x13a44b[_0x0bcb('0x45')]=qs[_0x0bcb('0x46')](_0x9eca30[_0x0bcb('0x3e')][_0x0bcb('0x46')]);_0x13a44b[_0x0bcb('0x48')]=qs['filters'](_['pick'](_0x9eca30[_0x0bcb('0x3e')],_0x37a75d[_0x0bcb('0x3f')]));if(_0x9eca30['query']['filter']){_0x13a44b[_0x0bcb('0x48')]=_['merge'](_0x13a44b[_0x0bcb('0x48')],{'$or':_[_0x0bcb('0x37')](_0x13a44b[_0x0bcb('0x41')],function(_0x21143d){var _0x568a02={};_0x568a02[_0x21143d]={'$like':'%'+_0x9eca30[_0x0bcb('0x3e')]['filter']+'%'};return _0x568a02;})});}_0x13a44b=_[_0x0bcb('0x47')]({},_0x13a44b,_0x9eca30[_0x0bcb('0x4a')]);return _0x9d0681[_0x0bcb('0x5e')](_0x13a44b);}})[_0x0bcb('0x1d')](function(_0x2eda52){if(_0x2eda52){_0x1c0625=_0x2eda52[_0x0bcb('0x51')];if(!_0x9eca30[_0x0bcb('0x3e')][_0x0bcb('0x5a')](_0x0bcb('0x5d'))){_0x13a44b['limit']=qs[_0x0bcb('0x44')](_0x9eca30['query'][_0x0bcb('0x44')]);_0x13a44b[_0x0bcb('0x2d')]=qs[_0x0bcb('0x2d')](_0x9eca30[_0x0bcb('0x3e')][_0x0bcb('0x2d')]);}return _0x9d0681[_0x0bcb('0x5e')](_0x13a44b);}})[_0x0bcb('0x1d')](function(_0x463bf1){if(_0x463bf1){return _0x463bf1?{'count':_0x1c0625,'rows':_0x463bf1}:null;}})[_0x0bcb('0x1d')](respondWithResult(_0xdbcdf7,null))[_0x0bcb('0x28')](handleError(_0xdbcdf7,null));};exports[_0x0bcb('0x5f')]=function(_0x5a8a56,_0x3d4963,_0x1e520d){var _0x3d5795={};var _0x1607c0={};var _0x1d8a53;var _0x36fd48;return db[_0x0bcb('0x38')]['findOne']({'where':{'id':_0x5a8a56[_0x0bcb('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d4963,null))[_0x0bcb('0x1d')](function(_0x1948fc){if(_0x1948fc){_0x1d8a53=_0x1948fc;_0x1607c0['model']=_[_0x0bcb('0x3d')](db[_0x0bcb('0x60')][_0x0bcb('0x39')]);_0x1607c0['query']=_[_0x0bcb('0x3d')](_0x5a8a56[_0x0bcb('0x3e')]);_0x1607c0['filters']=_[_0x0bcb('0x42')](_0x1607c0[_0x0bcb('0x40')],_0x1607c0['query']);_0x3d5795[_0x0bcb('0x41')]=_[_0x0bcb('0x42')](_0x1607c0[_0x0bcb('0x40')],qs[_0x0bcb('0x43')](_0x5a8a56[_0x0bcb('0x3e')]['fields']));_0x3d5795['attributes']=_0x3d5795['attributes']['length']?_0x3d5795[_0x0bcb('0x41')]:_0x1607c0[_0x0bcb('0x40')];_0x3d5795['order']=qs['sort'](_0x5a8a56[_0x0bcb('0x3e')]['sort']);_0x3d5795['where']=qs[_0x0bcb('0x3f')](_[_0x0bcb('0x59')](_0x5a8a56[_0x0bcb('0x3e')],_0x1607c0['filters']));if(_0x5a8a56['query']['filter']){_0x3d5795[_0x0bcb('0x48')]=_[_0x0bcb('0x47')](_0x3d5795[_0x0bcb('0x48')],{'$or':_[_0x0bcb('0x37')](_0x3d5795[_0x0bcb('0x41')],function(_0x22d17c){var _0x671685={};_0x671685[_0x22d17c]={'$like':'%'+_0x5a8a56[_0x0bcb('0x3e')][_0x0bcb('0x5c')]+'%'};return _0x671685;})});}_0x3d5795=_[_0x0bcb('0x47')]({},_0x3d5795,_0x5a8a56['options']);return _0x1d8a53[_0x0bcb('0x5f')](_0x3d5795);}})[_0x0bcb('0x1d')](function(_0x111440){if(_0x111440){_0x36fd48=_0x111440['length'];if(!_0x5a8a56[_0x0bcb('0x3e')]['hasOwnProperty'](_0x0bcb('0x5d'))){_0x3d5795[_0x0bcb('0x44')]=qs[_0x0bcb('0x44')](_0x5a8a56[_0x0bcb('0x3e')][_0x0bcb('0x44')]);_0x3d5795['offset']=qs[_0x0bcb('0x2d')](_0x5a8a56[_0x0bcb('0x3e')]['offset']);}return _0x1d8a53[_0x0bcb('0x5f')](_0x3d5795);}})[_0x0bcb('0x1d')](function(_0x5e415f){if(_0x5e415f){return _0x5e415f?{'count':_0x36fd48,'rows':_0x5e415f}:null;}})[_0x0bcb('0x1d')](respondWithResult(_0x3d4963,null))[_0x0bcb('0x28')](handleError(_0x3d4963,null));};exports[_0x0bcb('0x61')]=function(_0x49cde0,_0x374b7e,_0x183f29){if(_0x49cde0[_0x0bcb('0x54')]['id']){delete _0x49cde0[_0x0bcb('0x54')]['id'];}return db[_0x0bcb('0x38')][_0x0bcb('0x57')]({'where':{'id':_0x49cde0[_0x0bcb('0x50')]['id']}})[_0x0bcb('0x1d')](handleEntityNotFound(_0x374b7e,null))[_0x0bcb('0x1d')](function(_0x186dc8){if(_0x186dc8){return _0x186dc8[_0x0bcb('0x61')](_0x49cde0[_0x0bcb('0x54')][_0x0bcb('0x62')]||[]);}return null;})['then'](respondWithResult(_0x374b7e,null))['catch'](handleError(_0x374b7e,null));};
\ No newline at end of file
+var _0xfd32=['name','send','index','map','ZendeskConfiguration','fieldName','type','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','count','findAll','rows','show','params','rawAttributes','intersection','include','create','body','find','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0xfd32,0xe9));var _0x2fd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd32[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2fd3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2fd3('0x1'));var zipdir=require(_0x2fd3('0x2'));var jsonpatch=require(_0x2fd3('0x3'));var rp=require('request-promise');var moment=require(_0x2fd3('0x4'));var BPromise=require(_0x2fd3('0x5'));var Mustache=require(_0x2fd3('0x6'));var util=require(_0x2fd3('0x7'));var path=require(_0x2fd3('0x8'));var sox=require('sox');var csv=require(_0x2fd3('0x9'));var ejs=require(_0x2fd3('0xa'));var fs=require('fs');var _=require(_0x2fd3('0xb'));var squel=require(_0x2fd3('0xc'));var crypto=require('crypto');var jsforce=require(_0x2fd3('0xd'));var deskjs=require(_0x2fd3('0xe'));var toCsv=require(_0x2fd3('0x9'));var querystring=require(_0x2fd3('0xf'));var Papa=require(_0x2fd3('0x10'));var Redis=require(_0x2fd3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2fd3('0x12'));var as=require(_0x2fd3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2fd3('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2fd3('0x15'));var db=require(_0x2fd3('0x16'))['db'];var jayson=require(_0x2fd3('0x17'));var client=jayson[_0x2fd3('0x18')][_0x2fd3('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5c4d8d,_0x4f9b77,_0x3c5879){if(_0x3c5879){var _0x1d762c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d762c[_0x2fd3('0x1a')](_0x4f9b77)){return _0x5c4d8d;}else{throw new db[(_0x2fd3('0x1b'))][(_0x2fd3('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5c4d8d;}}function respondWithRpcPromise(_0x4596f5,_0x33bc61,_0x5c5e8d,_0x5b75ae){return new BPromise(function(_0x7d6212,_0x28ab41){var _0x132e4e=_0x5b75ae||client;return _0x132e4e[_0x2fd3('0x1d')](_0x4596f5,_0x5c5e8d)['then'](function(_0x367929){logger['info'](_0x2fd3('0x1e'),_0x33bc61,_0x2fd3('0x1f'));logger[_0x2fd3('0x20')](_0x2fd3('0x21'),_0x33bc61,_0x2fd3('0x1f'),JSON['stringify'](_0x367929));if(_0x367929[_0x2fd3('0x22')]){if(_0x367929[_0x2fd3('0x22')][_0x2fd3('0x23')]===0x1f4){logger[_0x2fd3('0x22')](_0x2fd3('0x1e'),_0x33bc61,_0x367929['error'][_0x2fd3('0x24')]);return _0x28ab41(_0x367929[_0x2fd3('0x22')][_0x2fd3('0x24')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x33bc61,_0x367929[_0x2fd3('0x22')]['message']);return _0x7d6212(_0x367929[_0x2fd3('0x22')][_0x2fd3('0x24')]);}else{logger[_0x2fd3('0x25')](_0x2fd3('0x1e'),_0x33bc61,_0x2fd3('0x1f'));_0x7d6212(_0x367929[_0x2fd3('0x26')][_0x2fd3('0x24')]);}})[_0x2fd3('0x27')](function(_0x36b07f){logger[_0x2fd3('0x22')](_0x2fd3('0x1e'),_0x33bc61,_0x36b07f);_0x28ab41(_0x36b07f);});});}function respondWithStatusCode(_0x472ed0,_0xd6e3af){_0xd6e3af=_0xd6e3af||0xcc;return function(_0x3512e5){if(_0x3512e5){return _0x472ed0['sendStatus'](_0xd6e3af);}return _0x472ed0[_0x2fd3('0x28')](_0xd6e3af)[_0x2fd3('0x29')]();};}function respondWithResult(_0x345bbb,_0xfc597c){_0xfc597c=_0xfc597c||0xc8;return function(_0x483a97){if(_0x483a97){return _0x345bbb[_0x2fd3('0x28')](_0xfc597c)['json'](_0x483a97);}};}function respondWithFilteredResult(_0x3799f5,_0x46bca1){return function(_0xdf7546){if(_0xdf7546){var _0x26b6be=_0xdf7546['count'],_0x352ff8=_0x46bca1[_0x2fd3('0x2a')],_0x217b28=_0x46bca1[_0x2fd3('0x2a')]+_0x46bca1[_0x2fd3('0x2b')],_0x13b373;if(_0x217b28>=_0x26b6be){_0x217b28=_0x26b6be;_0x13b373=0xc8;}else{_0x13b373=0xce;}_0x3799f5['status'](_0x13b373);return _0x3799f5[_0x2fd3('0x2c')](_0x2fd3('0x2d'),_0x352ff8+'-'+_0x217b28+'/'+_0x26b6be)['json'](_0xdf7546);}return null;};}function patchUpdates(_0x5988ec){return function(_0x214b18){try{jsonpatch[_0x2fd3('0x2e')](_0x214b18,_0x5988ec,!![]);}catch(_0x35cec4){return BPromise['reject'](_0x35cec4);}return _0x214b18[_0x2fd3('0x2f')]();};}function saveUpdates(_0x5eb6c0,_0x169cbc){return function(_0x1bba42){if(_0x1bba42){return _0x1bba42[_0x2fd3('0x30')](_0x5eb6c0)[_0x2fd3('0x31')](function(_0x458373){return _0x458373;});}return null;};}function removeEntity(_0x515162,_0x2c933d){return function(_0x4466fb){if(_0x4466fb){return _0x4466fb[_0x2fd3('0x32')]()[_0x2fd3('0x31')](function(){_0x515162['status'](0xcc)[_0x2fd3('0x29')]();});}};}function handleEntityNotFound(_0x482988,_0x4b9c25){return function(_0x264170){if(!_0x264170){_0x482988[_0x2fd3('0x33')](0x194);}return _0x264170;};}function handleError(_0x21687f,_0x476562){_0x476562=_0x476562||0x1f4;return function(_0x2d8084){logger[_0x2fd3('0x22')](_0x2d8084['stack']);if(_0x2d8084[_0x2fd3('0x34')]){delete _0x2d8084['name'];}_0x21687f[_0x2fd3('0x28')](_0x476562)[_0x2fd3('0x35')](_0x2d8084);};}exports[_0x2fd3('0x36')]=function(_0x3e2976,_0xf9d194){var _0x1ba550={},_0x22094d={},_0x1a66f2={'count':0x0,'rows':[]};var _0x34bcff=_[_0x2fd3('0x37')](db[_0x2fd3('0x38')]['rawAttributes'],function(_0xb46a58){return{'name':_0xb46a58[_0x2fd3('0x39')],'type':_0xb46a58[_0x2fd3('0x3a')]['key']};});_0x22094d[_0x2fd3('0x3b')]=_[_0x2fd3('0x37')](_0x34bcff,_0x2fd3('0x34'));_0x22094d[_0x2fd3('0x3c')]=_[_0x2fd3('0x3d')](_0x3e2976[_0x2fd3('0x3c')]);_0x22094d[_0x2fd3('0x3e')]=_['intersection'](_0x22094d['model'],_0x22094d[_0x2fd3('0x3c')]);_0x1ba550['attributes']=_['intersection'](_0x22094d[_0x2fd3('0x3b')],qs[_0x2fd3('0x3f')](_0x3e2976['query'][_0x2fd3('0x3f')]));_0x1ba550[_0x2fd3('0x40')]=_0x1ba550[_0x2fd3('0x40')][_0x2fd3('0x41')]?_0x1ba550[_0x2fd3('0x40')]:_0x22094d[_0x2fd3('0x3b')];if(!_0x3e2976[_0x2fd3('0x3c')][_0x2fd3('0x42')](_0x2fd3('0x43'))){_0x1ba550[_0x2fd3('0x2b')]=qs[_0x2fd3('0x2b')](_0x3e2976['query']['limit']);_0x1ba550[_0x2fd3('0x2a')]=qs[_0x2fd3('0x2a')](_0x3e2976[_0x2fd3('0x3c')][_0x2fd3('0x2a')]);}_0x1ba550[_0x2fd3('0x44')]=qs[_0x2fd3('0x45')](_0x3e2976[_0x2fd3('0x3c')][_0x2fd3('0x45')]);_0x1ba550['where']=qs[_0x2fd3('0x3e')](_[_0x2fd3('0x46')](_0x3e2976[_0x2fd3('0x3c')],_0x22094d['filters']),_0x34bcff);if(_0x3e2976[_0x2fd3('0x3c')][_0x2fd3('0x47')]){_0x1ba550[_0x2fd3('0x48')]=_[_0x2fd3('0x49')](_0x1ba550[_0x2fd3('0x48')],{'$or':_[_0x2fd3('0x37')](_0x34bcff,function(_0x2f0dc1){if(_0x2f0dc1[_0x2fd3('0x3a')]!=='VIRTUAL'){var _0x5c96f6={};_0x5c96f6[_0x2f0dc1[_0x2fd3('0x34')]]={'$like':'%'+_0x3e2976[_0x2fd3('0x3c')][_0x2fd3('0x47')]+'%'};return _0x5c96f6;}})});}_0x1ba550=_[_0x2fd3('0x49')]({},_0x1ba550,_0x3e2976[_0x2fd3('0x4a')]);var _0x26766a={'where':_0x1ba550[_0x2fd3('0x48')]};return db[_0x2fd3('0x38')]['count'](_0x26766a)[_0x2fd3('0x31')](function(_0x44be34){_0x1a66f2[_0x2fd3('0x4b')]=_0x44be34;if(_0x3e2976[_0x2fd3('0x3c')]['includeAll']){_0x1ba550['include']=[{'all':!![]}];}return db[_0x2fd3('0x38')][_0x2fd3('0x4c')](_0x1ba550);})[_0x2fd3('0x31')](function(_0x2b52fc){_0x1a66f2[_0x2fd3('0x4d')]=_0x2b52fc;return _0x1a66f2;})[_0x2fd3('0x31')](respondWithFilteredResult(_0xf9d194,_0x1ba550))['catch'](handleError(_0xf9d194,null));};exports[_0x2fd3('0x4e')]=function(_0x5026e8,_0xcc63cd){var _0x403f8f={'raw':![],'where':{'id':_0x5026e8[_0x2fd3('0x4f')]['id']}},_0x308844={};_0x308844['model']=_[_0x2fd3('0x3d')](db[_0x2fd3('0x38')][_0x2fd3('0x50')]);_0x308844[_0x2fd3('0x3c')]=_[_0x2fd3('0x3d')](_0x5026e8['query']);_0x308844[_0x2fd3('0x3e')]=_['intersection'](_0x308844[_0x2fd3('0x3b')],_0x308844[_0x2fd3('0x3c')]);_0x403f8f[_0x2fd3('0x40')]=_[_0x2fd3('0x51')](_0x308844[_0x2fd3('0x3b')],qs[_0x2fd3('0x3f')](_0x5026e8[_0x2fd3('0x3c')][_0x2fd3('0x3f')]));_0x403f8f[_0x2fd3('0x40')]=_0x403f8f[_0x2fd3('0x40')][_0x2fd3('0x41')]?_0x403f8f['attributes']:_0x308844[_0x2fd3('0x3b')];if(_0x5026e8[_0x2fd3('0x3c')]['includeAll']){_0x403f8f[_0x2fd3('0x52')]=[{'all':!![]}];}_0x403f8f=_['merge']({},_0x403f8f,_0x5026e8[_0x2fd3('0x4a')]);return db[_0x2fd3('0x38')]['find'](_0x403f8f)['then'](handleEntityNotFound(_0xcc63cd,null))[_0x2fd3('0x31')](respondWithResult(_0xcc63cd,null))['catch'](handleError(_0xcc63cd,null));};exports[_0x2fd3('0x53')]=function(_0x2b1093,_0x46d163){return db['ZendeskConfiguration']['create'](_0x2b1093[_0x2fd3('0x54')],{})[_0x2fd3('0x31')](respondWithResult(_0x46d163,0xc9))[_0x2fd3('0x27')](handleError(_0x46d163,null));};exports[_0x2fd3('0x30')]=function(_0xe145d4,_0x35d6b7){if(_0xe145d4['body']['id']){delete _0xe145d4[_0x2fd3('0x54')]['id'];}return db[_0x2fd3('0x38')][_0x2fd3('0x55')]({'where':{'id':_0xe145d4[_0x2fd3('0x4f')]['id']}})[_0x2fd3('0x31')](handleEntityNotFound(_0x35d6b7,null))[_0x2fd3('0x31')](saveUpdates(_0xe145d4[_0x2fd3('0x54')],null))['then'](respondWithResult(_0x35d6b7,null))[_0x2fd3('0x27')](handleError(_0x35d6b7,null));};exports[_0x2fd3('0x32')]=function(_0x5f4c35,_0x1c279f){return db['ZendeskConfiguration'][_0x2fd3('0x55')]({'where':{'id':_0x5f4c35[_0x2fd3('0x4f')]['id']}})[_0x2fd3('0x31')](handleEntityNotFound(_0x1c279f,null))['then'](removeEntity(_0x1c279f,null))['catch'](handleError(_0x1c279f,null));};exports[_0x2fd3('0x56')]=function(_0xedf9a9,_0x138095,_0x4e0e21){var _0x5bbbe2={};var _0x272b86={};var _0x348e00;var _0x3f95fd;return db[_0x2fd3('0x38')][_0x2fd3('0x57')]({'where':{'id':_0xedf9a9['params']['id']}})[_0x2fd3('0x31')](handleEntityNotFound(_0x138095,null))[_0x2fd3('0x31')](function(_0x3f351d){if(_0x3f351d){_0x348e00=_0x3f351d;_0x272b86[_0x2fd3('0x3b')]=_[_0x2fd3('0x3d')](db[_0x2fd3('0x58')][_0x2fd3('0x50')]);_0x272b86['query']=_[_0x2fd3('0x3d')](_0xedf9a9[_0x2fd3('0x3c')]);_0x272b86[_0x2fd3('0x3e')]=_[_0x2fd3('0x51')](_0x272b86[_0x2fd3('0x3b')],_0x272b86[_0x2fd3('0x3c')]);_0x5bbbe2['attributes']=_['intersection'](_0x272b86['model'],qs[_0x2fd3('0x3f')](_0xedf9a9[_0x2fd3('0x3c')][_0x2fd3('0x3f')]));_0x5bbbe2[_0x2fd3('0x40')]=_0x5bbbe2[_0x2fd3('0x40')][_0x2fd3('0x41')]?_0x5bbbe2['attributes']:_0x272b86[_0x2fd3('0x3b')];_0x5bbbe2[_0x2fd3('0x44')]=qs[_0x2fd3('0x45')](_0xedf9a9[_0x2fd3('0x3c')][_0x2fd3('0x45')]);_0x5bbbe2[_0x2fd3('0x48')]=qs['filters'](_[_0x2fd3('0x46')](_0xedf9a9['query'],_0x272b86[_0x2fd3('0x3e')]));if(_0xedf9a9[_0x2fd3('0x3c')]['filter']){_0x5bbbe2[_0x2fd3('0x48')]=_['merge'](_0x5bbbe2['where'],{'$or':_[_0x2fd3('0x37')](_0x5bbbe2['attributes'],function(_0x21380e){var _0x470cf7={};_0x470cf7[_0x21380e]={'$like':'%'+_0xedf9a9[_0x2fd3('0x3c')][_0x2fd3('0x47')]+'%'};return _0x470cf7;})});}_0x5bbbe2=_[_0x2fd3('0x49')]({},_0x5bbbe2,_0xedf9a9[_0x2fd3('0x4a')]);return _0x348e00[_0x2fd3('0x56')](_0x5bbbe2);}})[_0x2fd3('0x31')](function(_0x3abdcd){if(_0x3abdcd){_0x3f95fd=_0x3abdcd[_0x2fd3('0x41')];if(!_0xedf9a9[_0x2fd3('0x3c')]['hasOwnProperty'](_0x2fd3('0x43'))){_0x5bbbe2[_0x2fd3('0x2b')]=qs[_0x2fd3('0x2b')](_0xedf9a9['query'][_0x2fd3('0x2b')]);_0x5bbbe2[_0x2fd3('0x2a')]=qs['offset'](_0xedf9a9[_0x2fd3('0x3c')][_0x2fd3('0x2a')]);}return _0x348e00[_0x2fd3('0x56')](_0x5bbbe2);}})[_0x2fd3('0x31')](function(_0x2fb39b){if(_0x2fb39b){return _0x2fb39b?{'count':_0x3f95fd,'rows':_0x2fb39b}:null;}})[_0x2fd3('0x31')](respondWithResult(_0x138095,null))[_0x2fd3('0x27')](handleError(_0x138095,null));};exports[_0x2fd3('0x59')]=function(_0x62d251,_0x43107e,_0x10ffdd){var _0x32fed2={};var _0x32ee6={};var _0x27b92b;var _0x33d7a5;return db['ZendeskConfiguration'][_0x2fd3('0x57')]({'where':{'id':_0x62d251[_0x2fd3('0x4f')]['id']}})[_0x2fd3('0x31')](handleEntityNotFound(_0x43107e,null))[_0x2fd3('0x31')](function(_0x2d513b){if(_0x2d513b){_0x27b92b=_0x2d513b;_0x32ee6[_0x2fd3('0x3b')]=_[_0x2fd3('0x3d')](db[_0x2fd3('0x58')]['rawAttributes']);_0x32ee6[_0x2fd3('0x3c')]=_[_0x2fd3('0x3d')](_0x62d251[_0x2fd3('0x3c')]);_0x32ee6[_0x2fd3('0x3e')]=_[_0x2fd3('0x51')](_0x32ee6[_0x2fd3('0x3b')],_0x32ee6[_0x2fd3('0x3c')]);_0x32fed2['attributes']=_[_0x2fd3('0x51')](_0x32ee6[_0x2fd3('0x3b')],qs['fields'](_0x62d251['query']['fields']));_0x32fed2['attributes']=_0x32fed2[_0x2fd3('0x40')][_0x2fd3('0x41')]?_0x32fed2[_0x2fd3('0x40')]:_0x32ee6['model'];_0x32fed2['order']=qs[_0x2fd3('0x45')](_0x62d251[_0x2fd3('0x3c')]['sort']);_0x32fed2[_0x2fd3('0x48')]=qs[_0x2fd3('0x3e')](_[_0x2fd3('0x46')](_0x62d251[_0x2fd3('0x3c')],_0x32ee6[_0x2fd3('0x3e')]));if(_0x62d251[_0x2fd3('0x3c')]['filter']){_0x32fed2['where']=_[_0x2fd3('0x49')](_0x32fed2[_0x2fd3('0x48')],{'$or':_[_0x2fd3('0x37')](_0x32fed2[_0x2fd3('0x40')],function(_0x4deeea){var _0x111113={};_0x111113[_0x4deeea]={'$like':'%'+_0x62d251[_0x2fd3('0x3c')]['filter']+'%'};return _0x111113;})});}_0x32fed2=_[_0x2fd3('0x49')]({},_0x32fed2,_0x62d251[_0x2fd3('0x4a')]);return _0x27b92b['getSubjects'](_0x32fed2);}})['then'](function(_0x13f820){if(_0x13f820){_0x33d7a5=_0x13f820[_0x2fd3('0x41')];if(!_0x62d251[_0x2fd3('0x3c')]['hasOwnProperty'](_0x2fd3('0x43'))){_0x32fed2[_0x2fd3('0x2b')]=qs[_0x2fd3('0x2b')](_0x62d251[_0x2fd3('0x3c')]['limit']);_0x32fed2[_0x2fd3('0x2a')]=qs[_0x2fd3('0x2a')](_0x62d251[_0x2fd3('0x3c')]['offset']);}return _0x27b92b[_0x2fd3('0x59')](_0x32fed2);}})[_0x2fd3('0x31')](function(_0x32b699){if(_0x32b699){return _0x32b699?{'count':_0x33d7a5,'rows':_0x32b699}:null;}})[_0x2fd3('0x31')](respondWithResult(_0x43107e,null))[_0x2fd3('0x27')](handleError(_0x43107e,null));};exports[_0x2fd3('0x5a')]=function(_0xe60b97,_0x4174f2,_0x2a3255){var _0x270d49={};var _0x483d89={};var _0x5810ce;var _0x48cfa7;return db[_0x2fd3('0x38')][_0x2fd3('0x57')]({'where':{'id':_0xe60b97[_0x2fd3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4174f2,null))[_0x2fd3('0x31')](function(_0x41172b){if(_0x41172b){_0x5810ce=_0x41172b;_0x483d89[_0x2fd3('0x3b')]=_[_0x2fd3('0x3d')](db['ZendeskField'][_0x2fd3('0x50')]);_0x483d89[_0x2fd3('0x3c')]=_[_0x2fd3('0x3d')](_0xe60b97[_0x2fd3('0x3c')]);_0x483d89['filters']=_[_0x2fd3('0x51')](_0x483d89[_0x2fd3('0x3b')],_0x483d89[_0x2fd3('0x3c')]);_0x270d49['attributes']=_['intersection'](_0x483d89['model'],qs[_0x2fd3('0x3f')](_0xe60b97[_0x2fd3('0x3c')][_0x2fd3('0x3f')]));_0x270d49[_0x2fd3('0x40')]=_0x270d49[_0x2fd3('0x40')]['length']?_0x270d49['attributes']:_0x483d89['model'];_0x270d49[_0x2fd3('0x44')]=qs['sort'](_0xe60b97[_0x2fd3('0x3c')][_0x2fd3('0x45')]);_0x270d49[_0x2fd3('0x48')]=qs[_0x2fd3('0x3e')](_[_0x2fd3('0x46')](_0xe60b97[_0x2fd3('0x3c')],_0x483d89[_0x2fd3('0x3e')]));if(_0xe60b97['query'][_0x2fd3('0x47')]){_0x270d49[_0x2fd3('0x48')]=_[_0x2fd3('0x49')](_0x270d49[_0x2fd3('0x48')],{'$or':_[_0x2fd3('0x37')](_0x270d49[_0x2fd3('0x40')],function(_0x25470c){var _0x3ba606={};_0x3ba606[_0x25470c]={'$like':'%'+_0xe60b97[_0x2fd3('0x3c')][_0x2fd3('0x47')]+'%'};return _0x3ba606;})});}_0x270d49=_[_0x2fd3('0x49')]({},_0x270d49,_0xe60b97[_0x2fd3('0x4a')]);return _0x5810ce[_0x2fd3('0x5a')](_0x270d49);}})[_0x2fd3('0x31')](function(_0x4abd56){if(_0x4abd56){_0x48cfa7=_0x4abd56[_0x2fd3('0x41')];if(!_0xe60b97['query']['hasOwnProperty'](_0x2fd3('0x43'))){_0x270d49[_0x2fd3('0x2b')]=qs['limit'](_0xe60b97[_0x2fd3('0x3c')][_0x2fd3('0x2b')]);_0x270d49[_0x2fd3('0x2a')]=qs[_0x2fd3('0x2a')](_0xe60b97[_0x2fd3('0x3c')]['offset']);}return _0x5810ce[_0x2fd3('0x5a')](_0x270d49);}})[_0x2fd3('0x31')](function(_0x209820){if(_0x209820){return _0x209820?{'count':_0x48cfa7,'rows':_0x209820}:null;}})[_0x2fd3('0x31')](respondWithResult(_0x4174f2,null))[_0x2fd3('0x27')](handleError(_0x4174f2,null));};exports[_0x2fd3('0x5b')]=function(_0x5453fb,_0x45a196,_0x241a5d){var _0x26c495={};var _0x29db53={};var _0x4124d1;var _0x97e8be;return db[_0x2fd3('0x38')][_0x2fd3('0x57')]({'where':{'id':_0x5453fb['params']['id']}})[_0x2fd3('0x31')](handleEntityNotFound(_0x45a196,null))[_0x2fd3('0x31')](function(_0x2db3af){if(_0x2db3af){_0x4124d1=_0x2db3af;_0x29db53[_0x2fd3('0x3b')]=_[_0x2fd3('0x3d')](db[_0x2fd3('0x5c')][_0x2fd3('0x50')]);_0x29db53[_0x2fd3('0x3c')]=_[_0x2fd3('0x3d')](_0x5453fb[_0x2fd3('0x3c')]);_0x29db53[_0x2fd3('0x3e')]=_[_0x2fd3('0x51')](_0x29db53['model'],_0x29db53[_0x2fd3('0x3c')]);_0x26c495['attributes']=_[_0x2fd3('0x51')](_0x29db53[_0x2fd3('0x3b')],qs[_0x2fd3('0x3f')](_0x5453fb[_0x2fd3('0x3c')]['fields']));_0x26c495['attributes']=_0x26c495[_0x2fd3('0x40')][_0x2fd3('0x41')]?_0x26c495[_0x2fd3('0x40')]:_0x29db53[_0x2fd3('0x3b')];_0x26c495[_0x2fd3('0x44')]=qs[_0x2fd3('0x45')](_0x5453fb[_0x2fd3('0x3c')]['sort']);_0x26c495[_0x2fd3('0x48')]=qs['filters'](_[_0x2fd3('0x46')](_0x5453fb[_0x2fd3('0x3c')],_0x29db53['filters']));if(_0x5453fb[_0x2fd3('0x3c')][_0x2fd3('0x47')]){_0x26c495[_0x2fd3('0x48')]=_[_0x2fd3('0x49')](_0x26c495['where'],{'$or':_[_0x2fd3('0x37')](_0x26c495['attributes'],function(_0x4da686){var _0x3ba334={};_0x3ba334[_0x4da686]={'$like':'%'+_0x5453fb['query']['filter']+'%'};return _0x3ba334;})});}_0x26c495=_[_0x2fd3('0x49')]({},_0x26c495,_0x5453fb[_0x2fd3('0x4a')]);return _0x4124d1['getTags'](_0x26c495);}})[_0x2fd3('0x31')](function(_0x29ba0c){if(_0x29ba0c){_0x97e8be=_0x29ba0c[_0x2fd3('0x41')];if(!_0x5453fb[_0x2fd3('0x3c')]['hasOwnProperty']('nolimit')){_0x26c495[_0x2fd3('0x2b')]=qs[_0x2fd3('0x2b')](_0x5453fb[_0x2fd3('0x3c')][_0x2fd3('0x2b')]);_0x26c495[_0x2fd3('0x2a')]=qs[_0x2fd3('0x2a')](_0x5453fb[_0x2fd3('0x3c')][_0x2fd3('0x2a')]);}return _0x4124d1['getTags'](_0x26c495);}})['then'](function(_0x5d3f22){if(_0x5d3f22){return _0x5d3f22?{'count':_0x97e8be,'rows':_0x5d3f22}:null;}})[_0x2fd3('0x31')](respondWithResult(_0x45a196,null))[_0x2fd3('0x27')](handleError(_0x45a196,null));};exports[_0x2fd3('0x5d')]=function(_0x324020,_0x4899a4,_0x486f00){if(_0x324020[_0x2fd3('0x54')]['id']){delete _0x324020[_0x2fd3('0x54')]['id'];}return db[_0x2fd3('0x38')]['findOne']({'where':{'id':_0x324020[_0x2fd3('0x4f')]['id']}})[_0x2fd3('0x31')](handleEntityNotFound(_0x4899a4,null))[_0x2fd3('0x31')](function(_0x55ce84){if(_0x55ce84){return _0x55ce84[_0x2fd3('0x5d')](_0x324020[_0x2fd3('0x54')][_0x2fd3('0x5e')]||[]);}return null;})[_0x2fd3('0x31')](respondWithResult(_0x4899a4,null))[_0x2fd3('0x27')](handleError(_0x4899a4,null));};
\ No newline at end of file
index ce2e04e..256e752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ba5=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0x2ba5,0x196));var _0x52ba=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x2ba5[_0x421263];return _0x34e4b5;};'use strict';var _=require(_0x52ba('0x0'));var util=require(_0x52ba('0x1'));var logger=require('../../config/logger')(_0x52ba('0x2'));var moment=require(_0x52ba('0x3'));var BPromise=require(_0x52ba('0x4'));var rp=require(_0x52ba('0x5'));var fs=require('fs');var path=require(_0x52ba('0x6'));var rimraf=require('rimraf');var config=require(_0x52ba('0x7'));var attributes=require(_0x52ba('0x8'));module[_0x52ba('0x9')]=function(_0x2035d6,_0x161029){return _0x2035d6[_0x52ba('0xa')](_0x52ba('0xb'),attributes,{'tableName':_0x52ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9085=['int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define'];(function(_0x23da0c,_0x4ddae5){var _0x30f0d5=function(_0x432ec1){while(--_0x432ec1){_0x23da0c['push'](_0x23da0c['shift']());}};_0x30f0d5(++_0x4ddae5);}(_0x9085,0xd3));var _0x5908=function(_0x239875,_0x52a793){_0x239875=_0x239875-0x0;var _0x55a8d6=_0x9085[_0x239875];return _0x55a8d6;};'use strict';var _=require(_0x5908('0x0'));var util=require(_0x5908('0x1'));var logger=require(_0x5908('0x2'))(_0x5908('0x3'));var moment=require(_0x5908('0x4'));var BPromise=require(_0x5908('0x5'));var rp=require(_0x5908('0x6'));var fs=require('fs');var path=require(_0x5908('0x7'));var rimraf=require(_0x5908('0x8'));var config=require(_0x5908('0x9'));var attributes=require(_0x5908('0xa'));module[_0x5908('0xb')]=function(_0x3fdfef,_0x1e1174){return _0x3fdfef[_0x5908('0xc')]('ZendeskConfiguration',attributes,{'tableName':_0x5908('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7b6d3d3..fbe7ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1bc=['rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b5964,_0x2f21c4){var _0xbc8296=function(_0x1f0789){while(--_0x1f0789){_0x3b5964['push'](_0x3b5964['shift']());}};_0xbc8296(++_0x2f21c4);}(_0xa1bc,0x101));var _0xca1b=function(_0x293de0,_0x184c5c){_0x293de0=_0x293de0-0x0;var _0x148bd9=_0xa1bc[_0x293de0];return _0x148bd9;};'use strict';var _=require('lodash');var util=require(_0xca1b('0x0'));var moment=require(_0xca1b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca1b('0x2'));var fs=require('fs');var Redis=require(_0xca1b('0x3'));var db=require(_0xca1b('0x4'))['db'];var utils=require(_0xca1b('0x5'));var logger=require(_0xca1b('0x6'))(_0xca1b('0x7'));var config=require(_0xca1b('0x8'));var jayson=require(_0xca1b('0x9'));var client=jayson[_0xca1b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51a0d4,_0x290ab4,_0x49f6d7){return new BPromise(function(_0x5c0cf6,_0x18bbee){return client[_0xca1b('0xb')](_0x51a0d4,_0x49f6d7)[_0xca1b('0xc')](function(_0xa3548b){logger[_0xca1b('0xd')](_0xca1b('0xe'),_0x290ab4,_0xca1b('0xf'));logger['debug'](_0xca1b('0x10'),_0x290ab4,'request\x20sent',JSON[_0xca1b('0x11')](_0xa3548b));if(_0xa3548b[_0xca1b('0x12')]){if(_0xa3548b[_0xca1b('0x12')][_0xca1b('0x13')]===0x1f4){logger[_0xca1b('0x12')](_0xca1b('0xe'),_0x290ab4,_0xa3548b[_0xca1b('0x12')][_0xca1b('0x14')]);return _0x18bbee(_0xa3548b[_0xca1b('0x12')][_0xca1b('0x14')]);}logger[_0xca1b('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x290ab4,_0xa3548b['error'][_0xca1b('0x14')]);return _0x5c0cf6(_0xa3548b[_0xca1b('0x12')][_0xca1b('0x14')]);}else{logger[_0xca1b('0xd')](_0xca1b('0xe'),_0x290ab4,_0xca1b('0xf'));_0x5c0cf6(_0xa3548b['result'][_0xca1b('0x14')]);}})[_0xca1b('0x15')](function(_0x2ce158){logger[_0xca1b('0x12')](_0xca1b('0xe'),_0x290ab4,_0x2ce158);_0x18bbee(_0x2ce158);});});}
\ No newline at end of file
+var _0x27fc=['result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3bf2d5,_0x36116c){var _0x29e958=function(_0x18ba76){while(--_0x18ba76){_0x3bf2d5['push'](_0x3bf2d5['shift']());}};_0x29e958(++_0x36116c);}(_0x27fc,0x92));var _0xc27f=function(_0x2f2ff5,_0x352b1c){_0x2f2ff5=_0x2f2ff5-0x0;var _0x1df50c=_0x27fc[_0x2f2ff5];return _0x1df50c;};'use strict';var _=require('lodash');var util=require(_0xc27f('0x0'));var moment=require(_0xc27f('0x1'));var BPromise=require(_0xc27f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc27f('0x3'));var db=require(_0xc27f('0x4'))['db'];var utils=require(_0xc27f('0x5'));var logger=require(_0xc27f('0x6'))(_0xc27f('0x7'));var config=require(_0xc27f('0x8'));var jayson=require(_0xc27f('0x9'));var client=jayson[_0xc27f('0xa')][_0xc27f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x166b99,_0x4600ac,_0x2ee55d){return new BPromise(function(_0x3b9c8f,_0x6c4786){return client[_0xc27f('0xc')](_0x166b99,_0x2ee55d)[_0xc27f('0xd')](function(_0x20ea97){logger[_0xc27f('0xe')](_0xc27f('0xf'),_0x4600ac,'request\x20sent');logger[_0xc27f('0x10')](_0xc27f('0x11'),_0x4600ac,_0xc27f('0x12'),JSON['stringify'](_0x20ea97));if(_0x20ea97[_0xc27f('0x13')]){if(_0x20ea97[_0xc27f('0x13')][_0xc27f('0x14')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4600ac,_0x20ea97[_0xc27f('0x13')][_0xc27f('0x15')]);return _0x6c4786(_0x20ea97[_0xc27f('0x13')][_0xc27f('0x15')]);}logger[_0xc27f('0x13')](_0xc27f('0xf'),_0x4600ac,_0x20ea97[_0xc27f('0x13')]['message']);return _0x3b9c8f(_0x20ea97[_0xc27f('0x13')][_0xc27f('0x15')]);}else{logger[_0xc27f('0xe')](_0xc27f('0xf'),_0x4600ac,_0xc27f('0x12'));_0x3b9c8f(_0x20ea97[_0xc27f('0x16')][_0xc27f('0x15')]);}})[_0xc27f('0x17')](function(_0x29c689){logger['error'](_0xc27f('0xf'),_0x4600ac,_0x29c689);_0x6c4786(_0x29c689);});});}
\ No newline at end of file
index 614e5f6..6f6ad6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8820=['update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x2ac6e1,_0x2e58a0){var _0xf93881=function(_0x29d607){while(--_0x29d607){_0x2ac6e1['push'](_0x2ac6e1['shift']());}};_0xf93881(++_0x2e58a0);}(_0x8820,0x16c));var _0x0882=function(_0x2ee6f6,_0x36c49b){_0x2ee6f6=_0x2ee6f6-0x0;var _0x29beec=_0x8820[_0x2ee6f6];return _0x29beec;};'use strict';var multer=require(_0x0882('0x0'));var util=require('util');var path=require(_0x0882('0x1'));var timeout=require(_0x0882('0x2'));var express=require(_0x0882('0x3'));var router=express[_0x0882('0x4')]();var auth=require(_0x0882('0x5'));var interaction=require(_0x0882('0x6'));var config=require('../../config/environment');var controller=require(_0x0882('0x7'));router['get']('/',auth[_0x0882('0x8')](),controller[_0x0882('0x9')]);router[_0x0882('0xa')](_0x0882('0xb'),auth['isAuthenticated'](),controller[_0x0882('0xc')]);router[_0x0882('0xd')]('/',auth[_0x0882('0x8')](),controller[_0x0882('0xe')]);router[_0x0882('0xf')](_0x0882('0xb'),auth[_0x0882('0x8')](),controller[_0x0882('0x10')]);router[_0x0882('0x11')](_0x0882('0xb'),auth[_0x0882('0x8')](),controller[_0x0882('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x2bce=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x2ce230,_0x5308ed){var _0x4dbaf0=function(_0x20feb8){while(--_0x20feb8){_0x2ce230['push'](_0x2ce230['shift']());}};_0x4dbaf0(++_0x5308ed);}(_0x2bce,0xd3));var _0xe2bc=function(_0x2f8a9f,_0x33ad58){_0x2f8a9f=_0x2f8a9f-0x0;var _0x4b3a98=_0x2bce[_0x2f8a9f];return _0x4b3a98;};'use strict';var multer=require(_0xe2bc('0x0'));var util=require(_0xe2bc('0x1'));var path=require(_0xe2bc('0x2'));var timeout=require(_0xe2bc('0x3'));var express=require(_0xe2bc('0x4'));var router=express[_0xe2bc('0x5')]();var auth=require(_0xe2bc('0x6'));var interaction=require(_0xe2bc('0x7'));var config=require('../../config/environment');var controller=require(_0xe2bc('0x8'));router[_0xe2bc('0x9')]('/',auth[_0xe2bc('0xa')](),controller[_0xe2bc('0xb')]);router[_0xe2bc('0x9')](_0xe2bc('0xc'),auth[_0xe2bc('0xa')](),controller['show']);router[_0xe2bc('0xd')]('/',auth[_0xe2bc('0xa')](),controller[_0xe2bc('0xe')]);router[_0xe2bc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe2bc('0x10')]);router['delete']('/:id',auth[_0xe2bc('0xa')](),controller[_0xe2bc('0x11')]);module[_0xe2bc('0x12')]=router;
\ No newline at end of file
index 0a7c72d..7a9f477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9362=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x3104ae,_0x1e5ea8){var _0x1c3462=function(_0x2f4fd3){while(--_0x2f4fd3){_0x3104ae['push'](_0x3104ae['shift']());}};_0x1c3462(++_0x1e5ea8);}(_0x9362,0x169));var _0x2936=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9362[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2936('0x0'));module['exports']={'type':{'type':Sequelize[_0x2936('0x1')]('string',_0x2936('0x2'),_0x2936('0x3'),_0x2936('0x4')),'defaultValue':_0x2936('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2936('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x2936('0x5'),_0x2936('0x2'),_0x2936('0x3'))},'keyContent':{'type':Sequelize[_0x2936('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2936('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2936('0x6')]}};
\ No newline at end of file
+var _0xf675=['customVariable','sequelize','exports','ENUM','variable','keyValue','string','STRING'];(function(_0x2bce7c,_0x52e164){var _0x5d285d=function(_0x5e3adc){while(--_0x5e3adc){_0x2bce7c['push'](_0x2bce7c['shift']());}};_0x5d285d(++_0x52e164);}(_0xf675,0x199));var _0x5f67=function(_0x90e575,_0x48c2ec){_0x90e575=_0x90e575-0x0;var _0x1aae60=_0xf675[_0x90e575];return _0x1aae60;};'use strict';var Sequelize=require(_0x5f67('0x0'));module[_0x5f67('0x1')]={'type':{'type':Sequelize[_0x5f67('0x2')]('string',_0x5f67('0x3'),'customVariable',_0x5f67('0x4')),'defaultValue':_0x5f67('0x5')},'content':{'type':Sequelize[_0x5f67('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5f67('0x2')](_0x5f67('0x5'),_0x5f67('0x3'),_0x5f67('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5f67('0x6')]},'nameField':{'type':Sequelize[_0x5f67('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 934bf45..96f9c3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d44=['zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','html-pdf','eml-format','rimraf'];(function(_0x52241d,_0x12f6cc){var _0x338f09=function(_0x43f0df){while(--_0x43f0df){_0x52241d['push'](_0x52241d['shift']());}};_0x338f09(++_0x12f6cc);}(_0x6d44,0x8d));var _0x46d4=function(_0x2f0b82,_0xa07e26){_0x2f0b82=_0x2f0b82-0x0;var _0x5d6fb1=_0x6d44[_0x2f0b82];return _0x5d6fb1;};'use strict';var pdf=require(_0x46d4('0x0'));var emlformat=require(_0x46d4('0x1'));var rimraf=require(_0x46d4('0x2'));var zipdir=require(_0x46d4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46d4('0x4'));var moment=require('moment');var BPromise=require(_0x46d4('0x5'));var Mustache=require(_0x46d4('0x6'));var util=require(_0x46d4('0x7'));var path=require(_0x46d4('0x8'));var sox=require('sox');var csv=require(_0x46d4('0x9'));var ejs=require(_0x46d4('0xa'));var fs=require('fs');var _=require(_0x46d4('0xb'));var squel=require(_0x46d4('0xc'));var crypto=require(_0x46d4('0xd'));var jsforce=require(_0x46d4('0xe'));var deskjs=require(_0x46d4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x46d4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x46d4('0x11'));var as=require(_0x46d4('0x12'));var hardwareService=require(_0x46d4('0x13'));var logger=require(_0x46d4('0x14'))('api');var utils=require(_0x46d4('0x15'));var config=require(_0x46d4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e508e,_0x55fd9a){_0x55fd9a=_0x55fd9a||0xcc;return function(_0x1f1d93){if(_0x1f1d93){return _0x1e508e[_0x46d4('0x17')](_0x55fd9a);}return _0x1e508e['status'](_0x55fd9a)[_0x46d4('0x18')]();};}function respondWithResult(_0x14580f,_0x5bc70f){_0x5bc70f=_0x5bc70f||0xc8;return function(_0x4d3670){if(_0x4d3670){return _0x14580f['status'](_0x5bc70f)[_0x46d4('0x19')](_0x4d3670);}};}function respondWithFilteredResult(_0x4f0011,_0x1b0e70){return function(_0x263bdc){if(_0x263bdc){var _0x58e821=_0x263bdc[_0x46d4('0x1a')],_0x118fb5=_0x1b0e70[_0x46d4('0x1b')],_0x1c0388=_0x1b0e70[_0x46d4('0x1b')]+_0x1b0e70[_0x46d4('0x1c')],_0x1e736e;if(_0x1c0388>=_0x58e821){_0x1c0388=_0x58e821;_0x1e736e=0xc8;}else{_0x1e736e=0xce;}_0x4f0011[_0x46d4('0x1d')](_0x1e736e);return _0x4f0011['set'](_0x46d4('0x1e'),_0x118fb5+'-'+_0x1c0388+'/'+_0x58e821)['json'](_0x263bdc);}return null;};}function patchUpdates(_0x5bce76){return function(_0x5cebf8){try{jsonpatch[_0x46d4('0x1f')](_0x5cebf8,_0x5bce76,!![]);}catch(_0x220308){return BPromise[_0x46d4('0x20')](_0x220308);}return _0x5cebf8[_0x46d4('0x21')]();};}function saveUpdates(_0x236bfb,_0x5d2d5e){return function(_0x230e48){if(_0x230e48){return _0x230e48[_0x46d4('0x22')](_0x236bfb)[_0x46d4('0x23')](function(_0x43c342){return _0x43c342;});}return null;};}function removeEntity(_0x55b846,_0x524309){return function(_0x1bdfea){if(_0x1bdfea){return _0x1bdfea[_0x46d4('0x24')]()[_0x46d4('0x23')](function(){_0x55b846['status'](0xcc)[_0x46d4('0x18')]();});}};}function handleEntityNotFound(_0x250a67,_0x4ec228){return function(_0x812f4a){if(!_0x812f4a){_0x250a67['sendStatus'](0x194);}return _0x812f4a;};}function handleError(_0x39dee9,_0x5dfa7e){_0x5dfa7e=_0x5dfa7e||0x1f4;return function(_0x12105c){logger['error'](_0x12105c[_0x46d4('0x25')]);if(_0x12105c[_0x46d4('0x26')]){delete _0x12105c[_0x46d4('0x26')];}_0x39dee9[_0x46d4('0x1d')](_0x5dfa7e)[_0x46d4('0x27')](_0x12105c);};}exports['index']=function(_0x4aaf6e,_0x4ba348){var _0x3baff1={},_0x2f8bfb={},_0x500e8c={'count':0x0,'rows':[]};var _0x86eb1f=_[_0x46d4('0x28')](db[_0x46d4('0x29')][_0x46d4('0x2a')],function(_0x65016b){return{'name':_0x65016b[_0x46d4('0x2b')],'type':_0x65016b[_0x46d4('0x2c')][_0x46d4('0x2d')]};});_0x2f8bfb[_0x46d4('0x2e')]=_['map'](_0x86eb1f,'name');_0x2f8bfb['query']=_[_0x46d4('0x2f')](_0x4aaf6e[_0x46d4('0x30')]);_0x2f8bfb['filters']=_[_0x46d4('0x31')](_0x2f8bfb[_0x46d4('0x2e')],_0x2f8bfb[_0x46d4('0x30')]);_0x3baff1[_0x46d4('0x32')]=_['intersection'](_0x2f8bfb[_0x46d4('0x2e')],qs['fields'](_0x4aaf6e[_0x46d4('0x30')][_0x46d4('0x33')]));_0x3baff1[_0x46d4('0x32')]=_0x3baff1[_0x46d4('0x32')]['length']?_0x3baff1['attributes']:_0x2f8bfb[_0x46d4('0x2e')];if(!_0x4aaf6e[_0x46d4('0x30')][_0x46d4('0x34')](_0x46d4('0x35'))){_0x3baff1[_0x46d4('0x1c')]=qs['limit'](_0x4aaf6e[_0x46d4('0x30')][_0x46d4('0x1c')]);_0x3baff1[_0x46d4('0x1b')]=qs['offset'](_0x4aaf6e[_0x46d4('0x30')][_0x46d4('0x1b')]);}_0x3baff1['order']=qs[_0x46d4('0x36')](_0x4aaf6e[_0x46d4('0x30')]['sort']);_0x3baff1[_0x46d4('0x37')]=qs[_0x46d4('0x38')](_[_0x46d4('0x39')](_0x4aaf6e[_0x46d4('0x30')],_0x2f8bfb['filters']),_0x86eb1f);if(_0x4aaf6e[_0x46d4('0x30')]['filter']){_0x3baff1['where']=_[_0x46d4('0x3a')](_0x3baff1[_0x46d4('0x37')],{'$or':_['map'](_0x86eb1f,function(_0x293cf5){if(_0x293cf5[_0x46d4('0x2c')]!=='VIRTUAL'){var _0x58f76f={};_0x58f76f[_0x293cf5[_0x46d4('0x26')]]={'$like':'%'+_0x4aaf6e[_0x46d4('0x30')][_0x46d4('0x3b')]+'%'};return _0x58f76f;}})});}_0x3baff1=_[_0x46d4('0x3a')]({},_0x3baff1,_0x4aaf6e[_0x46d4('0x3c')]);var _0x130f4f={'where':_0x3baff1[_0x46d4('0x37')]};return db[_0x46d4('0x29')]['count'](_0x130f4f)['then'](function(_0x17d167){_0x500e8c[_0x46d4('0x1a')]=_0x17d167;if(_0x4aaf6e['query'][_0x46d4('0x3d')]){_0x3baff1[_0x46d4('0x3e')]=[{'all':!![]}];}return db[_0x46d4('0x29')][_0x46d4('0x3f')](_0x3baff1);})['then'](function(_0x24d79a){_0x500e8c[_0x46d4('0x40')]=_0x24d79a;return _0x500e8c;})[_0x46d4('0x23')](respondWithFilteredResult(_0x4ba348,_0x3baff1))[_0x46d4('0x41')](handleError(_0x4ba348,null));};exports[_0x46d4('0x42')]=function(_0x32e3a8,_0x2b7fbc){var _0x519148={'raw':!![],'where':{'id':_0x32e3a8[_0x46d4('0x43')]['id']}},_0x1429b2={};_0x1429b2[_0x46d4('0x2e')]=_[_0x46d4('0x2f')](db['ZendeskField']['rawAttributes']);_0x1429b2[_0x46d4('0x30')]=_[_0x46d4('0x2f')](_0x32e3a8[_0x46d4('0x30')]);_0x1429b2[_0x46d4('0x38')]=_[_0x46d4('0x31')](_0x1429b2[_0x46d4('0x2e')],_0x1429b2[_0x46d4('0x30')]);_0x519148[_0x46d4('0x32')]=_[_0x46d4('0x31')](_0x1429b2[_0x46d4('0x2e')],qs[_0x46d4('0x33')](_0x32e3a8[_0x46d4('0x30')]['fields']));_0x519148[_0x46d4('0x32')]=_0x519148[_0x46d4('0x32')][_0x46d4('0x44')]?_0x519148[_0x46d4('0x32')]:_0x1429b2[_0x46d4('0x2e')];if(_0x32e3a8[_0x46d4('0x30')]['includeAll']){_0x519148['include']=[{'all':!![]}];}_0x519148=_[_0x46d4('0x3a')]({},_0x519148,_0x32e3a8[_0x46d4('0x3c')]);return db[_0x46d4('0x29')][_0x46d4('0x45')](_0x519148)[_0x46d4('0x23')](handleEntityNotFound(_0x2b7fbc,null))[_0x46d4('0x23')](respondWithResult(_0x2b7fbc,null))[_0x46d4('0x41')](handleError(_0x2b7fbc,null));};exports[_0x46d4('0x46')]=function(_0x40432d,_0x46d541){return db[_0x46d4('0x29')][_0x46d4('0x46')](_0x40432d[_0x46d4('0x47')],{})[_0x46d4('0x23')](respondWithResult(_0x46d541,0xc9))['catch'](handleError(_0x46d541,null));};exports[_0x46d4('0x22')]=function(_0x521018,_0x419b56){if(_0x521018[_0x46d4('0x47')]['id']){delete _0x521018[_0x46d4('0x47')]['id'];}return db[_0x46d4('0x29')][_0x46d4('0x45')]({'where':{'id':_0x521018[_0x46d4('0x43')]['id']}})[_0x46d4('0x23')](handleEntityNotFound(_0x419b56,null))[_0x46d4('0x23')](saveUpdates(_0x521018[_0x46d4('0x47')],null))[_0x46d4('0x23')](respondWithResult(_0x419b56,null))[_0x46d4('0x41')](handleError(_0x419b56,null));};exports['destroy']=function(_0x50536d,_0x4c88ae){return db[_0x46d4('0x29')][_0x46d4('0x45')]({'where':{'id':_0x50536d[_0x46d4('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c88ae,null))[_0x46d4('0x23')](removeEntity(_0x4c88ae,null))[_0x46d4('0x41')](handleError(_0x4c88ae,null));};
\ No newline at end of file
+var _0xfd2c=['apply','reject','destroy','error','name','index','ZendeskField','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','show','keys','find','create','body','catch','update','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range'];(function(_0x25e10c,_0x49596a){var _0x5dfd94=function(_0x2f4bfb){while(--_0x2f4bfb){_0x25e10c['push'](_0x25e10c['shift']());}};_0x5dfd94(++_0x49596a);}(_0xfd2c,0x143));var _0xcfd2=function(_0x4d456d,_0x35071d){_0x4d456d=_0x4d456d-0x0;var _0x1d90eb=_0xfd2c[_0x4d456d];return _0x1d90eb;};'use strict';var pdf=require(_0xcfd2('0x0'));var emlformat=require(_0xcfd2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcfd2('0x2'));var jsonpatch=require(_0xcfd2('0x3'));var rp=require(_0xcfd2('0x4'));var moment=require('moment');var BPromise=require(_0xcfd2('0x5'));var Mustache=require('mustache');var util=require(_0xcfd2('0x6'));var path=require(_0xcfd2('0x7'));var sox=require(_0xcfd2('0x8'));var csv=require(_0xcfd2('0x9'));var ejs=require(_0xcfd2('0xa'));var fs=require('fs');var _=require(_0xcfd2('0xb'));var squel=require('squel');var crypto=require(_0xcfd2('0xc'));var jsforce=require(_0xcfd2('0xd'));var deskjs=require(_0xcfd2('0xe'));var toCsv=require(_0xcfd2('0x9'));var querystring=require(_0xcfd2('0xf'));var Papa=require(_0xcfd2('0x10'));var Redis=require(_0xcfd2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcfd2('0x12'));var hardwareService=require(_0xcfd2('0x13'));var logger=require(_0xcfd2('0x14'))(_0xcfd2('0x15'));var utils=require(_0xcfd2('0x16'));var config=require('../../config/environment');var db=require(_0xcfd2('0x17'))['db'];function respondWithStatusCode(_0xb79be4,_0x186c85){_0x186c85=_0x186c85||0xcc;return function(_0x2fe782){if(_0x2fe782){return _0xb79be4[_0xcfd2('0x18')](_0x186c85);}return _0xb79be4[_0xcfd2('0x19')](_0x186c85)[_0xcfd2('0x1a')]();};}function respondWithResult(_0x594c6f,_0x33b773){_0x33b773=_0x33b773||0xc8;return function(_0x281ad1){if(_0x281ad1){return _0x594c6f[_0xcfd2('0x19')](_0x33b773)[_0xcfd2('0x1b')](_0x281ad1);}};}function respondWithFilteredResult(_0xe05381,_0x2c1718){return function(_0x2036a0){if(_0x2036a0){var _0x249645=_0x2036a0[_0xcfd2('0x1c')],_0x3333d0=_0x2c1718[_0xcfd2('0x1d')],_0x4ac7bd=_0x2c1718[_0xcfd2('0x1d')]+_0x2c1718[_0xcfd2('0x1e')],_0x290d0f;if(_0x4ac7bd>=_0x249645){_0x4ac7bd=_0x249645;_0x290d0f=0xc8;}else{_0x290d0f=0xce;}_0xe05381[_0xcfd2('0x19')](_0x290d0f);return _0xe05381['set'](_0xcfd2('0x1f'),_0x3333d0+'-'+_0x4ac7bd+'/'+_0x249645)[_0xcfd2('0x1b')](_0x2036a0);}return null;};}function patchUpdates(_0x16a79e){return function(_0x35cabf){try{jsonpatch[_0xcfd2('0x20')](_0x35cabf,_0x16a79e,!![]);}catch(_0x2c2b42){return BPromise[_0xcfd2('0x21')](_0x2c2b42);}return _0x35cabf['save']();};}function saveUpdates(_0x342f8d,_0x24f10f){return function(_0x161190){if(_0x161190){return _0x161190['update'](_0x342f8d)['then'](function(_0x146602){return _0x146602;});}return null;};}function removeEntity(_0x4d4a27,_0xb6dae6){return function(_0x4794a7){if(_0x4794a7){return _0x4794a7[_0xcfd2('0x22')]()['then'](function(){_0x4d4a27[_0xcfd2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x318b90,_0x4b7df0){return function(_0x5fcd9b){if(!_0x5fcd9b){_0x318b90[_0xcfd2('0x18')](0x194);}return _0x5fcd9b;};}function handleError(_0x4756cc,_0x65109b){_0x65109b=_0x65109b||0x1f4;return function(_0x3949c7){logger[_0xcfd2('0x23')](_0x3949c7['stack']);if(_0x3949c7[_0xcfd2('0x24')]){delete _0x3949c7['name'];}_0x4756cc[_0xcfd2('0x19')](_0x65109b)['send'](_0x3949c7);};}exports[_0xcfd2('0x25')]=function(_0x1bea15,_0x3ef8dc){var _0x4b402d={},_0x29d26c={},_0x4abcaf={'count':0x0,'rows':[]};var _0x10a6f0=_['map'](db[_0xcfd2('0x26')][_0xcfd2('0x27')],function(_0x408c9f){return{'name':_0x408c9f[_0xcfd2('0x28')],'type':_0x408c9f[_0xcfd2('0x29')][_0xcfd2('0x2a')]};});_0x29d26c[_0xcfd2('0x2b')]=_[_0xcfd2('0x2c')](_0x10a6f0,_0xcfd2('0x24'));_0x29d26c[_0xcfd2('0x2d')]=_['keys'](_0x1bea15[_0xcfd2('0x2d')]);_0x29d26c[_0xcfd2('0x2e')]=_['intersection'](_0x29d26c['model'],_0x29d26c[_0xcfd2('0x2d')]);_0x4b402d[_0xcfd2('0x2f')]=_[_0xcfd2('0x30')](_0x29d26c[_0xcfd2('0x2b')],qs['fields'](_0x1bea15['query'][_0xcfd2('0x31')]));_0x4b402d[_0xcfd2('0x2f')]=_0x4b402d[_0xcfd2('0x2f')][_0xcfd2('0x32')]?_0x4b402d['attributes']:_0x29d26c[_0xcfd2('0x2b')];if(!_0x1bea15[_0xcfd2('0x2d')][_0xcfd2('0x33')]('nolimit')){_0x4b402d[_0xcfd2('0x1e')]=qs[_0xcfd2('0x1e')](_0x1bea15['query'][_0xcfd2('0x1e')]);_0x4b402d[_0xcfd2('0x1d')]=qs['offset'](_0x1bea15['query']['offset']);}_0x4b402d['order']=qs[_0xcfd2('0x34')](_0x1bea15['query'][_0xcfd2('0x34')]);_0x4b402d[_0xcfd2('0x35')]=qs['filters'](_[_0xcfd2('0x36')](_0x1bea15[_0xcfd2('0x2d')],_0x29d26c[_0xcfd2('0x2e')]),_0x10a6f0);if(_0x1bea15['query'][_0xcfd2('0x37')]){_0x4b402d[_0xcfd2('0x35')]=_[_0xcfd2('0x38')](_0x4b402d[_0xcfd2('0x35')],{'$or':_[_0xcfd2('0x2c')](_0x10a6f0,function(_0x2dcf00){if(_0x2dcf00[_0xcfd2('0x29')]!=='VIRTUAL'){var _0x1d3908={};_0x1d3908[_0x2dcf00[_0xcfd2('0x24')]]={'$like':'%'+_0x1bea15[_0xcfd2('0x2d')]['filter']+'%'};return _0x1d3908;}})});}_0x4b402d=_['merge']({},_0x4b402d,_0x1bea15[_0xcfd2('0x39')]);var _0x398dac={'where':_0x4b402d[_0xcfd2('0x35')]};return db[_0xcfd2('0x26')][_0xcfd2('0x1c')](_0x398dac)[_0xcfd2('0x3a')](function(_0x3178ca){_0x4abcaf[_0xcfd2('0x1c')]=_0x3178ca;if(_0x1bea15['query'][_0xcfd2('0x3b')]){_0x4b402d[_0xcfd2('0x3c')]=[{'all':!![]}];}return db[_0xcfd2('0x26')][_0xcfd2('0x3d')](_0x4b402d);})[_0xcfd2('0x3a')](function(_0x3111e5){_0x4abcaf[_0xcfd2('0x3e')]=_0x3111e5;return _0x4abcaf;})[_0xcfd2('0x3a')](respondWithFilteredResult(_0x3ef8dc,_0x4b402d))['catch'](handleError(_0x3ef8dc,null));};exports[_0xcfd2('0x3f')]=function(_0x24dbff,_0x309812){var _0x51c5aa={'raw':!![],'where':{'id':_0x24dbff['params']['id']}},_0x3f065b={};_0x3f065b[_0xcfd2('0x2b')]=_[_0xcfd2('0x40')](db['ZendeskField'][_0xcfd2('0x27')]);_0x3f065b['query']=_['keys'](_0x24dbff[_0xcfd2('0x2d')]);_0x3f065b[_0xcfd2('0x2e')]=_[_0xcfd2('0x30')](_0x3f065b[_0xcfd2('0x2b')],_0x3f065b[_0xcfd2('0x2d')]);_0x51c5aa[_0xcfd2('0x2f')]=_[_0xcfd2('0x30')](_0x3f065b[_0xcfd2('0x2b')],qs['fields'](_0x24dbff[_0xcfd2('0x2d')][_0xcfd2('0x31')]));_0x51c5aa[_0xcfd2('0x2f')]=_0x51c5aa[_0xcfd2('0x2f')][_0xcfd2('0x32')]?_0x51c5aa[_0xcfd2('0x2f')]:_0x3f065b[_0xcfd2('0x2b')];if(_0x24dbff[_0xcfd2('0x2d')][_0xcfd2('0x3b')]){_0x51c5aa[_0xcfd2('0x3c')]=[{'all':!![]}];}_0x51c5aa=_[_0xcfd2('0x38')]({},_0x51c5aa,_0x24dbff[_0xcfd2('0x39')]);return db[_0xcfd2('0x26')][_0xcfd2('0x41')](_0x51c5aa)[_0xcfd2('0x3a')](handleEntityNotFound(_0x309812,null))[_0xcfd2('0x3a')](respondWithResult(_0x309812,null))['catch'](handleError(_0x309812,null));};exports[_0xcfd2('0x42')]=function(_0x9cc99,_0x43a95b){return db[_0xcfd2('0x26')][_0xcfd2('0x42')](_0x9cc99[_0xcfd2('0x43')],{})[_0xcfd2('0x3a')](respondWithResult(_0x43a95b,0xc9))[_0xcfd2('0x44')](handleError(_0x43a95b,null));};exports[_0xcfd2('0x45')]=function(_0x13c046,_0x1e4115){if(_0x13c046[_0xcfd2('0x43')]['id']){delete _0x13c046[_0xcfd2('0x43')]['id'];}return db[_0xcfd2('0x26')][_0xcfd2('0x41')]({'where':{'id':_0x13c046[_0xcfd2('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e4115,null))[_0xcfd2('0x3a')](saveUpdates(_0x13c046[_0xcfd2('0x43')],null))['then'](respondWithResult(_0x1e4115,null))[_0xcfd2('0x44')](handleError(_0x1e4115,null));};exports['destroy']=function(_0x211aa3,_0x2e7b7e){return db[_0xcfd2('0x26')][_0xcfd2('0x41')]({'where':{'id':_0x211aa3[_0xcfd2('0x46')]['id']}})[_0xcfd2('0x3a')](handleEntityNotFound(_0x2e7b7e,null))[_0xcfd2('0x3a')](removeEntity(_0x2e7b7e,null))[_0xcfd2('0x44')](handleError(_0x2e7b7e,null));};
\ No newline at end of file
index a3179eb..b74a6a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x593e=['bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','api','moment'];(function(_0x4f6eb2,_0x4f3253){var _0x128bab=function(_0x14bfac){while(--_0x14bfac){_0x4f6eb2['push'](_0x4f6eb2['shift']());}};_0x128bab(++_0x4f3253);}(_0x593e,0xcb));var _0xe593=function(_0x36bec6,_0x474ed8){_0x36bec6=_0x36bec6-0x0;var _0x14604f=_0x593e[_0x36bec6];return _0x14604f;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var logger=require(_0xe593('0x2'))(_0xe593('0x3'));var moment=require(_0xe593('0x4'));var BPromise=require(_0xe593('0x5'));var rp=require(_0xe593('0x6'));var fs=require('fs');var path=require(_0xe593('0x7'));var rimraf=require('rimraf');var config=require(_0xe593('0x8'));var attributes=require(_0xe593('0x9'));module[_0xe593('0xa')]=function(_0x1e50d3,_0x3b7082){return _0x1e50d3[_0xe593('0xb')](_0xe593('0xc'),attributes,{'tableName':_0xe593('0xd'),'paranoid':![],'indexes':[{'name':_0xe593('0xe'),'fields':[_0xe593('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf4c=['zendesk_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x21bf82,_0x548558){_0x21bf82=_0x21bf82-0x0;var _0x2e837c=_0xaf4c[_0x21bf82];return _0x2e837c;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var logger=require(_0xcaf4('0x1'))('api');var moment=require(_0xcaf4('0x2'));var BPromise=require(_0xcaf4('0x3'));var rp=require(_0xcaf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var attributes=require(_0xcaf4('0x7'));module['exports']=function(_0x21ad95,_0x548527){return _0x21ad95[_0xcaf4('0x8')](_0xcaf4('0x9'),attributes,{'tableName':_0xcaf4('0xa'),'paranoid':![],'indexes':[{'name':_0xcaf4('0xb'),'fields':[_0xcaf4('0xc'),_0xcaf4('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index da5e974..aaee007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1244=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1ff9b1,_0xa8f50f){var _0x2b314d=function(_0x3e4c0a){while(--_0x3e4c0a){_0x1ff9b1['push'](_0x1ff9b1['shift']());}};_0x2b314d(++_0xa8f50f);}(_0x1244,0x10e));var _0x4124=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1244[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x4124('0x0'));var util=require(_0x4124('0x1'));var moment=require(_0x4124('0x2'));var BPromise=require('bluebird');var rs=require(_0x4124('0x3'));var fs=require('fs');var Redis=require(_0x4124('0x4'));var db=require(_0x4124('0x5'))['db'];var utils=require(_0x4124('0x6'));var logger=require('../../config/logger')(_0x4124('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4124('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e62ee,_0x135ae5,_0x2ff910){return new BPromise(function(_0x4c633d,_0x320c28){return client[_0x4124('0x9')](_0x4e62ee,_0x2ff910)['then'](function(_0x41c258){logger[_0x4124('0xa')](_0x4124('0xb'),_0x135ae5,_0x4124('0xc'));logger[_0x4124('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x135ae5,_0x4124('0xc'),JSON[_0x4124('0xe')](_0x41c258));if(_0x41c258[_0x4124('0xf')]){if(_0x41c258[_0x4124('0xf')]['code']===0x1f4){logger[_0x4124('0xf')](_0x4124('0xb'),_0x135ae5,_0x41c258['error'][_0x4124('0x10')]);return _0x320c28(_0x41c258[_0x4124('0xf')]['message']);}logger[_0x4124('0xf')]('ZendeskField,\x20%s,\x20%s',_0x135ae5,_0x41c258[_0x4124('0xf')]['message']);return _0x4c633d(_0x41c258[_0x4124('0xf')][_0x4124('0x10')]);}else{logger[_0x4124('0xa')](_0x4124('0xb'),_0x135ae5,_0x4124('0xc'));_0x4c633d(_0x41c258[_0x4124('0x11')][_0x4124('0x10')]);}})[_0x4124('0x12')](function(_0x33ac31){logger['error'](_0x4124('0xb'),_0x135ae5,_0x33ac31);_0x320c28(_0x33ac31);});});}
\ No newline at end of file
+var _0x1399=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x37de3d,_0x4393d3){var _0x3aa726=function(_0x5d8fb0){while(--_0x5d8fb0){_0x37de3d['push'](_0x37de3d['shift']());}};_0x3aa726(++_0x4393d3);}(_0x1399,0xbe));var _0x9139=function(_0xe3cfba,_0x14d39e){_0xe3cfba=_0xe3cfba-0x0;var _0x3feb92=_0x1399[_0xe3cfba];return _0x3feb92;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9139('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9139('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x9139('0x2'));var logger=require('../../config/logger')(_0x9139('0x3'));var config=require(_0x9139('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9139('0x5')][_0x9139('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x35cb49,_0x2832a9,_0x96e1e5){return new BPromise(function(_0x3e0af4,_0x5c7f9e){return client[_0x9139('0x7')](_0x35cb49,_0x96e1e5)[_0x9139('0x8')](function(_0x1bccd9){logger[_0x9139('0x9')](_0x9139('0xa'),_0x2832a9,_0x9139('0xb'));logger[_0x9139('0xc')](_0x9139('0xd'),_0x2832a9,_0x9139('0xb'),JSON[_0x9139('0xe')](_0x1bccd9));if(_0x1bccd9['error']){if(_0x1bccd9[_0x9139('0xf')][_0x9139('0x10')]===0x1f4){logger[_0x9139('0xf')](_0x9139('0xa'),_0x2832a9,_0x1bccd9[_0x9139('0xf')][_0x9139('0x11')]);return _0x5c7f9e(_0x1bccd9['error'][_0x9139('0x11')]);}logger['error'](_0x9139('0xa'),_0x2832a9,_0x1bccd9[_0x9139('0xf')][_0x9139('0x11')]);return _0x3e0af4(_0x1bccd9[_0x9139('0xf')]['message']);}else{logger[_0x9139('0x9')](_0x9139('0xa'),_0x2832a9,_0x9139('0xb'));_0x3e0af4(_0x1bccd9[_0x9139('0x12')][_0x9139('0x11')]);}})[_0x9139('0x13')](function(_0xbcccd1){logger['error'](_0x9139('0xa'),_0x2832a9,_0xbcccd1);_0x5c7f9e(_0xbcccd1);});});}
\ No newline at end of file
index 305bf08..9464d52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63df=['getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','show','/:id/configurations'];(function(_0x19c9d5,_0x7de572){var _0x10dcb8=function(_0x1e535e){while(--_0x1e535e){_0x19c9d5['push'](_0x19c9d5['shift']());}};_0x10dcb8(++_0x7de572);}(_0x63df,0x1a9));var _0xf63d=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x63df[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf63d('0x0'));var timeout=require(_0xf63d('0x1'));var express=require(_0xf63d('0x2'));var router=express[_0xf63d('0x3')]();var auth=require(_0xf63d('0x4'));var interaction=require(_0xf63d('0x5'));var config=require(_0xf63d('0x6'));var controller=require(_0xf63d('0x7'));router[_0xf63d('0x8')]('/',auth[_0xf63d('0x9')](),controller['index']);router[_0xf63d('0x8')]('/:id',auth[_0xf63d('0x9')](),controller[_0xf63d('0xa')]);router[_0xf63d('0x8')](_0xf63d('0xb'),auth[_0xf63d('0x9')](),controller[_0xf63d('0xc')]);router['get'](_0xf63d('0xd'),auth[_0xf63d('0x9')](),controller['getFields']);router[_0xf63d('0xe')]('/',auth[_0xf63d('0x9')](),controller[_0xf63d('0xf')]);router[_0xf63d('0xe')](_0xf63d('0xb'),auth[_0xf63d('0x9')](),controller[_0xf63d('0x10')]);router[_0xf63d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf63d('0x12')]);router[_0xf63d('0x13')](_0xf63d('0x14'),auth[_0xf63d('0x9')](),controller[_0xf63d('0x15')]);module[_0xf63d('0x16')]=router;
\ No newline at end of file
+var _0x3258=['express','Router','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','post','create','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x2093d1,_0x3f9327){var _0x4c9762=function(_0x37b54f){while(--_0x37b54f){_0x2093d1['push'](_0x2093d1['shift']());}};_0x4c9762(++_0x3f9327);}(_0x3258,0x1ec));var _0x8325=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3258[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8325('0x0'));var util=require(_0x8325('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8325('0x2'));var router=express[_0x8325('0x3')]();var auth=require(_0x8325('0x4'));var interaction=require(_0x8325('0x5'));var config=require('../../config/environment');var controller=require(_0x8325('0x6'));router['get']('/',auth[_0x8325('0x7')](),controller['index']);router[_0x8325('0x8')](_0x8325('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8325('0x8')](_0x8325('0xa'),auth['isAuthenticated'](),controller[_0x8325('0xb')]);router[_0x8325('0x8')]('/:id/fields',auth[_0x8325('0x7')](),controller['getFields']);router[_0x8325('0xc')]('/',auth['isAuthenticated'](),controller[_0x8325('0xd')]);router[_0x8325('0xc')](_0x8325('0xa'),auth[_0x8325('0x7')](),controller[_0x8325('0xe')]);router['put'](_0x8325('0x9'),auth['isAuthenticated'](),controller[_0x8325('0xf')]);router[_0x8325('0x10')](_0x8325('0x9'),auth['isAuthenticated'](),controller[_0x8325('0x11')]);module[_0x8325('0x12')]=router;
\ No newline at end of file
index c39f50d..13c36e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60d6=['STRING','sequelize','exports'];(function(_0x3b08c0,_0x54e8e0){var _0x4c3e43=function(_0x5d04f4){while(--_0x5d04f4){_0x3b08c0['push'](_0x3b08c0['shift']());}};_0x4c3e43(++_0x54e8e0);}(_0x60d6,0x82));var _0x660d=function(_0x4f4570,_0x233a3f){_0x4f4570=_0x4f4570-0x0;var _0x5e07de=_0x60d6[_0x4f4570];return _0x5e07de;};'use strict';var Sequelize=require(_0x660d('0x0'));module[_0x660d('0x1')]={'name':{'type':Sequelize[_0x660d('0x2')]},'description':{'type':Sequelize[_0x660d('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x660d('0x2')]},'clientId':{'type':Sequelize[_0x660d('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x660d('0x2')]},'code':{'type':Sequelize[_0x660d('0x2')]},'refreshToken':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfb1a=['exports','STRING','sequelize'];(function(_0x29638f,_0x5dfb8a){var _0x4c2121=function(_0x4d32ea){while(--_0x4d32ea){_0x29638f['push'](_0x29638f['shift']());}};_0x4c2121(++_0x5dfb8a);}(_0xfb1a,0x131));var _0xafb1=function(_0xb70040,_0x45702a){_0xb70040=_0xb70040-0x0;var _0x3cc22a=_0xfb1a[_0xb70040];return _0x3cc22a;};'use strict';var Sequelize=require(_0xafb1('0x0'));module[_0xafb1('0x1')]={'name':{'type':Sequelize[_0xafb1('0x2')]},'description':{'type':Sequelize[_0xafb1('0x2')]},'host':{'type':Sequelize[_0xafb1('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xafb1('0x2')]},'clientSecret':{'type':Sequelize[_0xafb1('0x2')]},'serverUrl':{'type':Sequelize[_0xafb1('0x2')]},'code':{'type':Sequelize[_0xafb1('0x2')]},'refreshToken':{'type':Sequelize[_0xafb1('0x2')]}};
\ No newline at end of file
index fa9c0df..230382e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebb4=['offset','limit','set','json','apply','save','destroy','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','include','findAll','rows','show','params','keys','includeAll','find','create','body','update','getConfigurations','ZohoConfiguration','hasOwnProperty','nolimit','findOne','AccountId','Subjects','getSubjects','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','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','zoho.eu','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Description','Call_Duration','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','count'];(function(_0x11d58b,_0x5d989c){var _0x191107=function(_0x272c84){while(--_0x272c84){_0x11d58b['push'](_0x11d58b['shift']());}};_0x191107(++_0x5d989c);}(_0xebb4,0x170));var _0x4ebb=function(_0x1c6936,_0x515371){_0x1c6936=_0x1c6936-0x0;var _0x41f20c=_0xebb4[_0x1c6936];return _0x41f20c;};'use strict';var pdf=require(_0x4ebb('0x0'));var emlformat=require(_0x4ebb('0x1'));var rimraf=require(_0x4ebb('0x2'));var zipdir=require(_0x4ebb('0x3'));var jsonpatch=require(_0x4ebb('0x4'));var rp=require(_0x4ebb('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ebb('0x6'));var util=require('util');var path=require(_0x4ebb('0x7'));var sox=require(_0x4ebb('0x8'));var csv=require(_0x4ebb('0x9'));var ejs=require(_0x4ebb('0xa'));var fs=require('fs');var _=require(_0x4ebb('0xb'));var squel=require(_0x4ebb('0xc'));var crypto=require(_0x4ebb('0xd'));var jsforce=require(_0x4ebb('0xe'));var deskjs=require(_0x4ebb('0xf'));var toCsv=require(_0x4ebb('0x9'));var querystring=require(_0x4ebb('0x10'));var Papa=require(_0x4ebb('0x11'));var Redis=require(_0x4ebb('0x12'));var authService=require(_0x4ebb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4ebb('0x14'));var hardwareService=require(_0x4ebb('0x15'));var logger=require(_0x4ebb('0x16'))(_0x4ebb('0x17'));var utils=require(_0x4ebb('0x18'));var config=require(_0x4ebb('0x19'));var db=require(_0x4ebb('0x1a'))['db'];var integrations=require(_0x4ebb('0x1b'));var jayson=require(_0x4ebb('0x1c'));var client=jayson['client'][_0x4ebb('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x359cbe,_0x13b588,_0x164729){if(_0x164729){var _0x3428a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3428a8[_0x4ebb('0x1e')](_0x13b588)){return _0x359cbe;}else{throw new db['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~!@#$%^&-_=+[{]}.');}}else{return _0x359cbe;}}function respondWithRpcPromise(_0x3de4a2,_0x59d039,_0xba3ff1,_0x40c532){return new BPromise(function(_0x5b2af0,_0x194489){var _0x518120=_0x40c532||client;return _0x518120[_0x4ebb('0x1f')](_0x3de4a2,_0xba3ff1)[_0x4ebb('0x20')](function(_0x36e3b8){logger[_0x4ebb('0x21')](_0x4ebb('0x22'),_0x59d039,_0x4ebb('0x23'));logger['debug'](_0x4ebb('0x24'),_0x59d039,_0x4ebb('0x23'),JSON[_0x4ebb('0x25')](_0x36e3b8));if(_0x36e3b8[_0x4ebb('0x26')]){if(_0x36e3b8[_0x4ebb('0x26')][_0x4ebb('0x27')]===0x1f4){logger[_0x4ebb('0x26')](_0x4ebb('0x22'),_0x59d039,_0x36e3b8[_0x4ebb('0x26')][_0x4ebb('0x28')]);return _0x194489(_0x36e3b8[_0x4ebb('0x26')][_0x4ebb('0x28')]);}logger[_0x4ebb('0x26')]('ZohoAccount,\x20%s,\x20%s',_0x59d039,_0x36e3b8['error'][_0x4ebb('0x28')]);return _0x5b2af0(_0x36e3b8[_0x4ebb('0x26')]['message']);}else{logger[_0x4ebb('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x59d039,'request\x20sent');_0x5b2af0(_0x36e3b8['result']['message']);}})[_0x4ebb('0x29')](function(_0x1b9c0b){logger[_0x4ebb('0x26')](_0x4ebb('0x22'),_0x59d039,_0x1b9c0b);_0x194489(_0x1b9c0b);});});}function respondWithStatusCode(_0x22e12a,_0xc641a3){_0xc641a3=_0xc641a3||0xcc;return function(_0x38d889){if(_0x38d889){return _0x22e12a[_0x4ebb('0x2a')](_0xc641a3);}return _0x22e12a['status'](_0xc641a3)[_0x4ebb('0x2b')]();};}function respondWithResult(_0x10013d,_0x25e710){_0x25e710=_0x25e710||0xc8;return function(_0x293984){if(_0x293984){return _0x10013d[_0x4ebb('0x2c')](_0x25e710)['json'](_0x293984);}};}function respondWithFilteredResult(_0x1c9264,_0x240831){return function(_0x46585f){if(_0x46585f){var _0x490edf=_0x46585f[_0x4ebb('0x2d')],_0xb6f9eb=_0x240831[_0x4ebb('0x2e')],_0x544caf=_0x240831[_0x4ebb('0x2e')]+_0x240831[_0x4ebb('0x2f')],_0xa38066;if(_0x544caf>=_0x490edf){_0x544caf=_0x490edf;_0xa38066=0xc8;}else{_0xa38066=0xce;}_0x1c9264[_0x4ebb('0x2c')](_0xa38066);return _0x1c9264[_0x4ebb('0x30')]('Content-Range',_0xb6f9eb+'-'+_0x544caf+'/'+_0x490edf)[_0x4ebb('0x31')](_0x46585f);}return null;};}function patchUpdates(_0x59fea5){return function(_0x21760a){try{jsonpatch[_0x4ebb('0x32')](_0x21760a,_0x59fea5,!![]);}catch(_0x1629e8){return BPromise['reject'](_0x1629e8);}return _0x21760a[_0x4ebb('0x33')]();};}function saveUpdates(_0x24fce3,_0xdd97fe){return function(_0x94bec3){if(_0x94bec3){return _0x94bec3['update'](_0x24fce3)['then'](function(_0x12343a){return _0x12343a;});}return null;};}function removeEntity(_0x3f455b,_0x3b7f1a){return function(_0x108df6){if(_0x108df6){return _0x108df6[_0x4ebb('0x34')]()[_0x4ebb('0x20')](function(){_0x3f455b['status'](0xcc)[_0x4ebb('0x2b')]();});}};}function handleEntityNotFound(_0x387e8f,_0x52be44){return function(_0x5eefff){if(!_0x5eefff){_0x387e8f[_0x4ebb('0x2a')](0x194);}return _0x5eefff;};}function handleError(_0x418965,_0x266c94){_0x266c94=_0x266c94||0x1f4;return function(_0x2515db){logger['error'](_0x2515db[_0x4ebb('0x35')]);if(_0x2515db['name']){delete _0x2515db[_0x4ebb('0x36')];}_0x418965[_0x4ebb('0x2c')](_0x266c94)[_0x4ebb('0x37')](_0x2515db);};}exports['index']=function(_0x2d67f7,_0x211369){var _0x4cc870={},_0x38715a={},_0x4dbd30={'count':0x0,'rows':[]};var _0x6d08d0=_[_0x4ebb('0x38')](db['ZohoAccount'][_0x4ebb('0x39')],function(_0x43eb57){return{'name':_0x43eb57['fieldName'],'type':_0x43eb57[_0x4ebb('0x3a')][_0x4ebb('0x3b')]};});_0x38715a[_0x4ebb('0x3c')]=_[_0x4ebb('0x38')](_0x6d08d0,_0x4ebb('0x36'));_0x38715a[_0x4ebb('0x3d')]=_['keys'](_0x2d67f7[_0x4ebb('0x3d')]);_0x38715a[_0x4ebb('0x3e')]=_[_0x4ebb('0x3f')](_0x38715a['model'],_0x38715a['query']);_0x4cc870[_0x4ebb('0x40')]=_[_0x4ebb('0x3f')](_0x38715a[_0x4ebb('0x3c')],qs['fields'](_0x2d67f7[_0x4ebb('0x3d')][_0x4ebb('0x41')]));_0x4cc870[_0x4ebb('0x40')]=_0x4cc870[_0x4ebb('0x40')][_0x4ebb('0x42')]?_0x4cc870[_0x4ebb('0x40')]:_0x38715a[_0x4ebb('0x3c')];if(!_0x2d67f7[_0x4ebb('0x3d')]['hasOwnProperty']('nolimit')){_0x4cc870[_0x4ebb('0x2f')]=qs[_0x4ebb('0x2f')](_0x2d67f7['query'][_0x4ebb('0x2f')]);_0x4cc870[_0x4ebb('0x2e')]=qs[_0x4ebb('0x2e')](_0x2d67f7[_0x4ebb('0x3d')]['offset']);}_0x4cc870['order']=qs[_0x4ebb('0x43')](_0x2d67f7[_0x4ebb('0x3d')][_0x4ebb('0x43')]);_0x4cc870[_0x4ebb('0x44')]=qs[_0x4ebb('0x3e')](_[_0x4ebb('0x45')](_0x2d67f7[_0x4ebb('0x3d')],_0x38715a[_0x4ebb('0x3e')]),_0x6d08d0);if(_0x2d67f7[_0x4ebb('0x3d')][_0x4ebb('0x46')]){_0x4cc870[_0x4ebb('0x44')]=_[_0x4ebb('0x47')](_0x4cc870['where'],{'$or':_[_0x4ebb('0x38')](_0x6d08d0,function(_0x53cb62){if(_0x53cb62['type']!==_0x4ebb('0x48')){var _0x5441cd={};_0x5441cd[_0x53cb62['name']]={'$like':'%'+_0x2d67f7['query'][_0x4ebb('0x46')]+'%'};return _0x5441cd;}})});}_0x4cc870=_[_0x4ebb('0x47')]({},_0x4cc870,_0x2d67f7[_0x4ebb('0x49')]);var _0x5c8167={'where':_0x4cc870[_0x4ebb('0x44')]};return db[_0x4ebb('0x4a')]['count'](_0x5c8167)[_0x4ebb('0x20')](function(_0x33a378){_0x4dbd30[_0x4ebb('0x2d')]=_0x33a378;if(_0x2d67f7[_0x4ebb('0x3d')]['includeAll']){_0x4cc870[_0x4ebb('0x4b')]=[{'all':!![]}];}return db[_0x4ebb('0x4a')][_0x4ebb('0x4c')](_0x4cc870);})[_0x4ebb('0x20')](function(_0x45b543){_0x4dbd30[_0x4ebb('0x4d')]=_0x45b543;return _0x4dbd30;})[_0x4ebb('0x20')](respondWithFilteredResult(_0x211369,_0x4cc870))[_0x4ebb('0x29')](handleError(_0x211369,null));};exports[_0x4ebb('0x4e')]=function(_0x48cc52,_0x382dea){var _0x12c599={'raw':![],'where':{'id':_0x48cc52[_0x4ebb('0x4f')]['id']}},_0x5244fe={};_0x5244fe[_0x4ebb('0x3c')]=_[_0x4ebb('0x50')](db[_0x4ebb('0x4a')]['rawAttributes']);_0x5244fe[_0x4ebb('0x3d')]=_[_0x4ebb('0x50')](_0x48cc52['query']);_0x5244fe['filters']=_['intersection'](_0x5244fe[_0x4ebb('0x3c')],_0x5244fe[_0x4ebb('0x3d')]);_0x12c599['attributes']=_[_0x4ebb('0x3f')](_0x5244fe[_0x4ebb('0x3c')],qs[_0x4ebb('0x41')](_0x48cc52['query'][_0x4ebb('0x41')]));_0x12c599[_0x4ebb('0x40')]=_0x12c599[_0x4ebb('0x40')][_0x4ebb('0x42')]?_0x12c599[_0x4ebb('0x40')]:_0x5244fe[_0x4ebb('0x3c')];if(_0x48cc52[_0x4ebb('0x3d')][_0x4ebb('0x51')]){_0x12c599[_0x4ebb('0x4b')]=[{'all':!![]}];}_0x12c599=_[_0x4ebb('0x47')]({},_0x12c599,_0x48cc52[_0x4ebb('0x49')]);return db[_0x4ebb('0x4a')][_0x4ebb('0x52')](_0x12c599)['then'](handleEntityNotFound(_0x382dea,null))['then'](respondWithResult(_0x382dea,null))[_0x4ebb('0x29')](handleError(_0x382dea,null));};exports['create']=function(_0x2b5e1c,_0x2e8e5f){return db[_0x4ebb('0x4a')][_0x4ebb('0x53')](_0x2b5e1c[_0x4ebb('0x54')],{})[_0x4ebb('0x20')](respondWithResult(_0x2e8e5f,0xc9))[_0x4ebb('0x29')](handleError(_0x2e8e5f,null));};exports[_0x4ebb('0x55')]=function(_0x521219,_0x422399){if(_0x521219[_0x4ebb('0x54')]['id']){delete _0x521219[_0x4ebb('0x54')]['id'];}return db[_0x4ebb('0x4a')]['find']({'where':{'id':_0x521219[_0x4ebb('0x4f')]['id']}})[_0x4ebb('0x20')](handleEntityNotFound(_0x422399,null))['then'](saveUpdates(_0x521219['body'],null))['then'](respondWithResult(_0x422399,null))[_0x4ebb('0x29')](handleError(_0x422399,null));};exports[_0x4ebb('0x34')]=function(_0xb5c8f4,_0x6350eb){return db[_0x4ebb('0x4a')][_0x4ebb('0x52')]({'where':{'id':_0xb5c8f4['params']['id']}})[_0x4ebb('0x20')](handleEntityNotFound(_0x6350eb,null))['then'](removeEntity(_0x6350eb,null))[_0x4ebb('0x29')](handleError(_0x6350eb,null));};exports[_0x4ebb('0x56')]=function(_0x2f09c9,_0x2c7d5e,_0x512be9){var _0x2f37a0={};var _0x355dfa={};var _0x3f261c;var _0x5e585a;return db[_0x4ebb('0x4a')]['findOne']({'where':{'id':_0x2f09c9[_0x4ebb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2c7d5e,null))[_0x4ebb('0x20')](function(_0x5d929d){if(_0x5d929d){_0x3f261c=_0x5d929d;_0x355dfa[_0x4ebb('0x3c')]=_[_0x4ebb('0x50')](db[_0x4ebb('0x57')]['rawAttributes']);_0x355dfa[_0x4ebb('0x3d')]=_[_0x4ebb('0x50')](_0x2f09c9[_0x4ebb('0x3d')]);_0x355dfa[_0x4ebb('0x3e')]=_[_0x4ebb('0x3f')](_0x355dfa[_0x4ebb('0x3c')],_0x355dfa['query']);_0x2f37a0[_0x4ebb('0x40')]=_[_0x4ebb('0x3f')](_0x355dfa[_0x4ebb('0x3c')],qs[_0x4ebb('0x41')](_0x2f09c9[_0x4ebb('0x3d')][_0x4ebb('0x41')]));_0x2f37a0['attributes']=_0x2f37a0[_0x4ebb('0x40')][_0x4ebb('0x42')]?_0x2f37a0[_0x4ebb('0x40')]:_0x355dfa[_0x4ebb('0x3c')];_0x2f37a0['order']=qs[_0x4ebb('0x43')](_0x2f09c9[_0x4ebb('0x3d')][_0x4ebb('0x43')]);_0x2f37a0[_0x4ebb('0x44')]=qs[_0x4ebb('0x3e')](_[_0x4ebb('0x45')](_0x2f09c9['query'],_0x355dfa[_0x4ebb('0x3e')]));if(_0x2f09c9[_0x4ebb('0x3d')][_0x4ebb('0x46')]){_0x2f37a0['where']=_[_0x4ebb('0x47')](_0x2f37a0['where'],{'$or':_['map'](_0x2f37a0['attributes'],function(_0x5d5f31){var _0x3d3a31={};_0x3d3a31[_0x5d5f31]={'$like':'%'+_0x2f09c9['query']['filter']+'%'};return _0x3d3a31;})});}_0x2f37a0=_['merge']({},_0x2f37a0,_0x2f09c9[_0x4ebb('0x49')]);return _0x3f261c[_0x4ebb('0x56')](_0x2f37a0);}})[_0x4ebb('0x20')](function(_0x496494){if(_0x496494){_0x5e585a=_0x496494[_0x4ebb('0x42')];if(!_0x2f09c9[_0x4ebb('0x3d')][_0x4ebb('0x58')](_0x4ebb('0x59'))){_0x2f37a0[_0x4ebb('0x2f')]=qs['limit'](_0x2f09c9[_0x4ebb('0x3d')][_0x4ebb('0x2f')]);_0x2f37a0[_0x4ebb('0x2e')]=qs[_0x4ebb('0x2e')](_0x2f09c9[_0x4ebb('0x3d')][_0x4ebb('0x2e')]);}return _0x3f261c[_0x4ebb('0x56')](_0x2f37a0);}})[_0x4ebb('0x20')](function(_0x166e74){if(_0x166e74){return _0x166e74?{'count':_0x5e585a,'rows':_0x166e74}:null;}})[_0x4ebb('0x20')](respondWithResult(_0x2c7d5e,null))['catch'](handleError(_0x2c7d5e,null));};exports['addConfiguration']=function(_0x11cfba,_0x3eed62,_0x30a011){if(_0x11cfba['body']['id']){delete _0x11cfba[_0x4ebb('0x54')]['id'];}return db['ZohoAccount'][_0x4ebb('0x5a')]({'where':{'id':_0x11cfba[_0x4ebb('0x4f')]['id']}})[_0x4ebb('0x20')](handleEntityNotFound(_0x3eed62,null))[_0x4ebb('0x20')](function(_0x2af57c){if(_0x2af57c){_0x11cfba[_0x4ebb('0x54')][_0x4ebb('0x5b')]=_0x2af57c['id'];_0x11cfba[_0x4ebb('0x54')][_0x4ebb('0x5c')]=integrations[_0x4ebb('0x5d')](_0x11cfba[_0x4ebb('0x54')][_0x4ebb('0x5e')],_0x11cfba[_0x4ebb('0x54')][_0x4ebb('0x3a')]);_0x11cfba['body'][_0x4ebb('0x5f')]=integrations[_0x4ebb('0x60')](_0x11cfba[_0x4ebb('0x54')]['channel'],_0x11cfba[_0x4ebb('0x54')][_0x4ebb('0x3a')]);return db[_0x4ebb('0x57')][_0x4ebb('0x53')](_0x11cfba['body'],{'include':[{'model':db[_0x4ebb('0x61')],'as':_0x4ebb('0x5c')},{'model':db[_0x4ebb('0x61')],'as':_0x4ebb('0x5f')}]});}return null;})[_0x4ebb('0x20')](respondWithResult(_0x3eed62,null))['catch'](handleError(_0x3eed62,null));};function getAccessToken(_0x5a13b9){return new Promise(function(_0x4f4930,_0x82db67){var _0x10d7a8;switch(_0x5a13b9[_0x4ebb('0x62')]){case'US':_0x10d7a8=_0x4ebb('0x63');break;case'AU':_0x10d7a8=_0x4ebb('0x64');break;case'EU':_0x10d7a8=_0x4ebb('0x65');break;case'IN':_0x10d7a8=_0x4ebb('0x66');break;case'CN':_0x10d7a8=_0x4ebb('0x67');break;default:_0x10d7a8='https://accounts.zoho.eu';break;}var _0x598890={'method':_0x4ebb('0x68'),'uri':_0x10d7a8+_0x4ebb('0x69'),'qs':{'refresh_token':_0x5a13b9[_0x4ebb('0x6a')],'client_id':_0x5a13b9[_0x4ebb('0x6b')],'client_secret':_0x5a13b9[_0x4ebb('0x6c')],'grant_type':_0x4ebb('0x6d')},'json':!![]};return rp(_0x598890)[_0x4ebb('0x20')](function(_0x2d549b){if(_0x2d549b['access_token']){_0x4f4930(_0x2d549b['access_token']);}else{_0x82db67(_0x4ebb('0x6e'));}})[_0x4ebb('0x29')](function(_0x39b89c){_0x82db67(_0x39b89c);});});}exports['getFields']=function(_0x346cd2,_0x10efec,_0x413d74){var _0x4929b0,_0x421679,_0x2ba5fe,_0x39ec16,_0x2037b8;return db[_0x4ebb('0x4a')][_0x4ebb('0x5a')]({'where':{'id':_0x346cd2[_0x4ebb('0x4f')]['id']},'attributes':['id',_0x4ebb('0x6f'),_0x4ebb('0x62'),_0x4ebb('0x6b'),_0x4ebb('0x6c'),_0x4ebb('0x70'),_0x4ebb('0x27'),_0x4ebb('0x6a')]})[_0x4ebb('0x20')](handleEntityNotFound(_0x10efec,null))[_0x4ebb('0x20')](function(_0x553dce){_0x2037b8=_0x553dce;_0x4929b0=_0x2037b8[_0x4ebb('0x6f')];_0x421679=_0x4929b0===_0x4ebb('0x71')?'eu':'com';_0x2ba5fe=_0x2037b8['serverUrl'];var _0x457a9b=_0x2ba5fe[_0x4ebb('0x72')](-0x1);if(_0x457a9b==='/'||_0x457a9b==='\x5c'||_0x457a9b===':'){_0x2ba5fe=_0x2ba5fe['substring'](0x0,_0x2ba5fe['lastIndexOf'](_0x457a9b));}if(!_0x2037b8[_0x4ebb('0x6a')]){throw new Error(_0x4ebb('0x73'));}return getAccessToken(_0x2037b8);})['then'](function(_0x53d308){if(_0x53d308){return rp({'method':_0x4ebb('0x74'),'uri':util[_0x4ebb('0x75')](_0x4ebb('0x76'),_0x421679),'qs':{'module':_0x4ebb('0x77')},'headers':{'Authorization':_0x4ebb('0x78')+_0x53d308},'json':!![]});}})[_0x4ebb('0x20')](function(_0x1979cc){if(_0x1979cc){if(_0x1979cc[_0x4ebb('0x79')]&&_0x1979cc[_0x4ebb('0x79')]['error']){throw new Error(_0x1979cc[_0x4ebb('0x79')][_0x4ebb('0x26')][_0x4ebb('0x28')]);}var _0x57a8b8=[];var _0x414174=[];var _0x35389e=['Owner','Subject',_0x4ebb('0x7a'),'WhoId',_0x4ebb('0x7b'),'Call_Result',_0x4ebb('0x7c'),'Call_Type'];_0x414174=_[_0x4ebb('0x7d')](_0x1979cc[_0x4ebb('0x41')],function(_0x545629){return _0x35389e[_0x4ebb('0x7e')](_0x545629[_0x4ebb('0x7f')]);});for(var _0x221c61=0x0;_0x221c61<_0x414174['length'];_0x221c61++){if(_0x414174[_0x221c61][_0x4ebb('0x80')]===![]){_0x57a8b8[_0x4ebb('0x81')]({'id':_0x414174[_0x221c61]['id'],'name':_0x414174[_0x221c61][_0x4ebb('0x82')],'custom':_0x414174[_0x221c61]['custom_field'],'options':_0x414174[_0x221c61][_0x4ebb('0x83')]===_0x4ebb('0x84')&&_0x414174[_0x221c61][_0x4ebb('0x85')][_0x4ebb('0x42')]>-0x1?_['map'](_0x414174[_0x221c61]['pick_list_values'],function(_0x25c50f){return{'name':_0x25c50f,'value':_0x25c50f};}):[]});}}return{'count':_0x57a8b8[_0x4ebb('0x42')],'rows':_0x57a8b8};}else{return{'count':0x0,'rows':[]};}})[_0x4ebb('0x20')](respondWithResult(_0x10efec,null))['catch'](function(_0x4ac99b){var _0x32b907=_0x346cd2[_0x4ebb('0x3d')][_0x4ebb('0x1e')]?0x1f4:_0x4ac99b['statusCode']||0x1f4;logger[_0x4ebb('0x26')](_0x4ebb('0x86'),_0x4ebb('0x87'),_0x32b907,JSON['stringify'](_0x4ac99b));delete _0x4ac99b['name'];if(_0x32b907===0x191){_0x32b907=0x190;}_0x10efec[_0x4ebb('0x2c')](_0x32b907)[_0x4ebb('0x37')](_0x346cd2[_0x4ebb('0x3d')][_0x4ebb('0x1e')]?{'message':_0x4ebb('0x88'),'statusCode':_0x4ac99b[_0x4ebb('0x89')]}:_0x4ac99b);});};
\ No newline at end of file
+var _0x075e=['http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','ZohoAccount','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zoho.eu','com','slice','substring','GET','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client'];(function(_0x5b072d,_0x2fdcf2){var _0xe8576d=function(_0x189960){while(--_0x189960){_0x5b072d['push'](_0x5b072d['shift']());}};_0xe8576d(++_0x2fdcf2);}(_0x075e,0x17b));var _0xe075=function(_0x553aa6,_0x1cdd15){_0x553aa6=_0x553aa6-0x0;var _0x380951=_0x075e[_0x553aa6];return _0x380951;};'use strict';var pdf=require(_0xe075('0x0'));var emlformat=require(_0xe075('0x1'));var rimraf=require(_0xe075('0x2'));var zipdir=require(_0xe075('0x3'));var jsonpatch=require(_0xe075('0x4'));var rp=require('request-promise');var moment=require(_0xe075('0x5'));var BPromise=require(_0xe075('0x6'));var Mustache=require(_0xe075('0x7'));var util=require('util');var path=require(_0xe075('0x8'));var sox=require(_0xe075('0x9'));var csv=require(_0xe075('0xa'));var ejs=require(_0xe075('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe075('0xc'));var crypto=require('crypto');var jsforce=require(_0xe075('0xd'));var deskjs=require(_0xe075('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe075('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe075('0x10'))(_0xe075('0x11'));var utils=require('../../config/utils');var config=require(_0xe075('0x12'));var db=require(_0xe075('0x13'))['db'];var integrations=require(_0xe075('0x14'));var jayson=require(_0xe075('0x15'));var client=jayson[_0xe075('0x16')][_0xe075('0x17')]({'port':0x232a});function checkPasswordPattern(_0x147962,_0x542b48,_0x6ff50f){if(_0x6ff50f){var _0x107e8f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x107e8f[_0xe075('0x18')](_0x542b48)){return _0x147962;}else{throw new db[(_0xe075('0x19'))][(_0xe075('0x1a'))](_0xe075('0x1b'));}}else{return _0x147962;}}function respondWithRpcPromise(_0x2c048b,_0x5818d6,_0x4af8af,_0x55267c){return new BPromise(function(_0x1daa1c,_0x536197){var _0x2e2140=_0x55267c||client;return _0x2e2140[_0xe075('0x1c')](_0x2c048b,_0x4af8af)['then'](function(_0xb4860){logger[_0xe075('0x1d')](_0xe075('0x1e'),_0x5818d6,'request\x20sent');logger[_0xe075('0x1f')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5818d6,_0xe075('0x20'),JSON[_0xe075('0x21')](_0xb4860));if(_0xb4860[_0xe075('0x22')]){if(_0xb4860[_0xe075('0x22')][_0xe075('0x23')]===0x1f4){logger[_0xe075('0x22')](_0xe075('0x1e'),_0x5818d6,_0xb4860[_0xe075('0x22')][_0xe075('0x24')]);return _0x536197(_0xb4860[_0xe075('0x22')][_0xe075('0x24')]);}logger[_0xe075('0x22')](_0xe075('0x1e'),_0x5818d6,_0xb4860[_0xe075('0x22')]['message']);return _0x1daa1c(_0xb4860['error']['message']);}else{logger[_0xe075('0x1d')]('ZohoAccount,\x20%s,\x20%s',_0x5818d6,'request\x20sent');_0x1daa1c(_0xb4860['result']['message']);}})['catch'](function(_0x6d753d){logger[_0xe075('0x22')](_0xe075('0x1e'),_0x5818d6,_0x6d753d);_0x536197(_0x6d753d);});});}function respondWithStatusCode(_0xbf8536,_0x139c5c){_0x139c5c=_0x139c5c||0xcc;return function(_0x257a6f){if(_0x257a6f){return _0xbf8536['sendStatus'](_0x139c5c);}return _0xbf8536[_0xe075('0x25')](_0x139c5c)['end']();};}function respondWithResult(_0x3ae7b9,_0x5367bd){_0x5367bd=_0x5367bd||0xc8;return function(_0x4d3abf){if(_0x4d3abf){return _0x3ae7b9['status'](_0x5367bd)[_0xe075('0x26')](_0x4d3abf);}};}function respondWithFilteredResult(_0x3d1ca1,_0x52278d){return function(_0x83cb2c){if(_0x83cb2c){var _0x57f585=_0x83cb2c[_0xe075('0x27')],_0x316871=_0x52278d[_0xe075('0x28')],_0x1903b1=_0x52278d[_0xe075('0x28')]+_0x52278d[_0xe075('0x29')],_0x200a8f;if(_0x1903b1>=_0x57f585){_0x1903b1=_0x57f585;_0x200a8f=0xc8;}else{_0x200a8f=0xce;}_0x3d1ca1['status'](_0x200a8f);return _0x3d1ca1[_0xe075('0x2a')](_0xe075('0x2b'),_0x316871+'-'+_0x1903b1+'/'+_0x57f585)['json'](_0x83cb2c);}return null;};}function patchUpdates(_0x5778fc){return function(_0x3c7e89){try{jsonpatch['apply'](_0x3c7e89,_0x5778fc,!![]);}catch(_0xf0e73a){return BPromise[_0xe075('0x2c')](_0xf0e73a);}return _0x3c7e89[_0xe075('0x2d')]();};}function saveUpdates(_0xd3e43d,_0x3e4ae2){return function(_0x47c219){if(_0x47c219){return _0x47c219[_0xe075('0x2e')](_0xd3e43d)[_0xe075('0x2f')](function(_0x38c8f0){return _0x38c8f0;});}return null;};}function removeEntity(_0x967d43,_0x12603d){return function(_0x2b5c90){if(_0x2b5c90){return _0x2b5c90[_0xe075('0x30')]()['then'](function(){_0x967d43[_0xe075('0x25')](0xcc)[_0xe075('0x31')]();});}};}function handleEntityNotFound(_0x1f6c3d,_0x3c92cc){return function(_0x4b0666){if(!_0x4b0666){_0x1f6c3d[_0xe075('0x32')](0x194);}return _0x4b0666;};}function handleError(_0xb1566b,_0x1b068a){_0x1b068a=_0x1b068a||0x1f4;return function(_0xa52288){logger[_0xe075('0x22')](_0xa52288[_0xe075('0x33')]);if(_0xa52288[_0xe075('0x34')]){delete _0xa52288['name'];}_0xb1566b['status'](_0x1b068a)[_0xe075('0x35')](_0xa52288);};}exports[_0xe075('0x36')]=function(_0x558b8a,_0x66746b){var _0x13e640={},_0xa4a20c={},_0x41e0a7={'count':0x0,'rows':[]};var _0x10ccab=_[_0xe075('0x37')](db[_0xe075('0x38')]['rawAttributes'],function(_0x372a36){return{'name':_0x372a36[_0xe075('0x39')],'type':_0x372a36[_0xe075('0x3a')][_0xe075('0x3b')]};});_0xa4a20c['model']=_['map'](_0x10ccab,_0xe075('0x34'));_0xa4a20c['query']=_[_0xe075('0x3c')](_0x558b8a[_0xe075('0x3d')]);_0xa4a20c['filters']=_[_0xe075('0x3e')](_0xa4a20c[_0xe075('0x3f')],_0xa4a20c[_0xe075('0x3d')]);_0x13e640[_0xe075('0x40')]=_[_0xe075('0x3e')](_0xa4a20c[_0xe075('0x3f')],qs[_0xe075('0x41')](_0x558b8a['query']['fields']));_0x13e640[_0xe075('0x40')]=_0x13e640[_0xe075('0x40')][_0xe075('0x42')]?_0x13e640[_0xe075('0x40')]:_0xa4a20c[_0xe075('0x3f')];if(!_0x558b8a[_0xe075('0x3d')][_0xe075('0x43')](_0xe075('0x44'))){_0x13e640[_0xe075('0x29')]=qs[_0xe075('0x29')](_0x558b8a[_0xe075('0x3d')][_0xe075('0x29')]);_0x13e640[_0xe075('0x28')]=qs['offset'](_0x558b8a[_0xe075('0x3d')][_0xe075('0x28')]);}_0x13e640[_0xe075('0x45')]=qs[_0xe075('0x46')](_0x558b8a[_0xe075('0x3d')][_0xe075('0x46')]);_0x13e640['where']=qs[_0xe075('0x47')](_['pick'](_0x558b8a['query'],_0xa4a20c[_0xe075('0x47')]),_0x10ccab);if(_0x558b8a[_0xe075('0x3d')][_0xe075('0x48')]){_0x13e640[_0xe075('0x49')]=_[_0xe075('0x4a')](_0x13e640['where'],{'$or':_[_0xe075('0x37')](_0x10ccab,function(_0x400431){if(_0x400431['type']!==_0xe075('0x4b')){var _0x98fbb4={};_0x98fbb4[_0x400431[_0xe075('0x34')]]={'$like':'%'+_0x558b8a[_0xe075('0x3d')][_0xe075('0x48')]+'%'};return _0x98fbb4;}})});}_0x13e640=_[_0xe075('0x4a')]({},_0x13e640,_0x558b8a[_0xe075('0x4c')]);var _0x1176e7={'where':_0x13e640[_0xe075('0x49')]};return db[_0xe075('0x38')][_0xe075('0x27')](_0x1176e7)[_0xe075('0x2f')](function(_0x4669a9){_0x41e0a7['count']=_0x4669a9;if(_0x558b8a[_0xe075('0x3d')][_0xe075('0x4d')]){_0x13e640[_0xe075('0x4e')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x13e640);})[_0xe075('0x2f')](function(_0x150853){_0x41e0a7['rows']=_0x150853;return _0x41e0a7;})['then'](respondWithFilteredResult(_0x66746b,_0x13e640))[_0xe075('0x4f')](handleError(_0x66746b,null));};exports[_0xe075('0x50')]=function(_0x376591,_0x2f5814){var _0x153806={'raw':![],'where':{'id':_0x376591['params']['id']}},_0xecaaf5={};_0xecaaf5[_0xe075('0x3f')]=_[_0xe075('0x3c')](db[_0xe075('0x38')][_0xe075('0x51')]);_0xecaaf5[_0xe075('0x3d')]=_['keys'](_0x376591['query']);_0xecaaf5['filters']=_['intersection'](_0xecaaf5[_0xe075('0x3f')],_0xecaaf5['query']);_0x153806[_0xe075('0x40')]=_['intersection'](_0xecaaf5[_0xe075('0x3f')],qs['fields'](_0x376591[_0xe075('0x3d')][_0xe075('0x41')]));_0x153806[_0xe075('0x40')]=_0x153806[_0xe075('0x40')][_0xe075('0x42')]?_0x153806['attributes']:_0xecaaf5[_0xe075('0x3f')];if(_0x376591[_0xe075('0x3d')][_0xe075('0x4d')]){_0x153806[_0xe075('0x4e')]=[{'all':!![]}];}_0x153806=_['merge']({},_0x153806,_0x376591[_0xe075('0x4c')]);return db[_0xe075('0x38')][_0xe075('0x52')](_0x153806)[_0xe075('0x2f')](handleEntityNotFound(_0x2f5814,null))[_0xe075('0x2f')](respondWithResult(_0x2f5814,null))['catch'](handleError(_0x2f5814,null));};exports[_0xe075('0x53')]=function(_0x15e9c2,_0x28b5e3){return db[_0xe075('0x38')][_0xe075('0x53')](_0x15e9c2[_0xe075('0x54')],{})['then'](respondWithResult(_0x28b5e3,0xc9))['catch'](handleError(_0x28b5e3,null));};exports[_0xe075('0x2e')]=function(_0x1d5e14,_0x4f8147){if(_0x1d5e14['body']['id']){delete _0x1d5e14[_0xe075('0x54')]['id'];}return db[_0xe075('0x38')]['find']({'where':{'id':_0x1d5e14[_0xe075('0x55')]['id']}})['then'](handleEntityNotFound(_0x4f8147,null))[_0xe075('0x2f')](saveUpdates(_0x1d5e14[_0xe075('0x54')],null))[_0xe075('0x2f')](respondWithResult(_0x4f8147,null))['catch'](handleError(_0x4f8147,null));};exports[_0xe075('0x30')]=function(_0x1e15ed,_0x19c1fb){return db[_0xe075('0x38')]['find']({'where':{'id':_0x1e15ed['params']['id']}})[_0xe075('0x2f')](handleEntityNotFound(_0x19c1fb,null))[_0xe075('0x2f')](removeEntity(_0x19c1fb,null))[_0xe075('0x4f')](handleError(_0x19c1fb,null));};exports[_0xe075('0x56')]=function(_0x1c8ffd,_0x127b19,_0x211b91){var _0x17b437={};var _0x514432={};var _0x3d9c8b;var _0x9f042d;return db[_0xe075('0x38')][_0xe075('0x57')]({'where':{'id':_0x1c8ffd[_0xe075('0x55')]['id']}})[_0xe075('0x2f')](handleEntityNotFound(_0x127b19,null))[_0xe075('0x2f')](function(_0xcfeb07){if(_0xcfeb07){_0x3d9c8b=_0xcfeb07;_0x514432['model']=_[_0xe075('0x3c')](db[_0xe075('0x58')][_0xe075('0x51')]);_0x514432['query']=_[_0xe075('0x3c')](_0x1c8ffd['query']);_0x514432[_0xe075('0x47')]=_['intersection'](_0x514432[_0xe075('0x3f')],_0x514432[_0xe075('0x3d')]);_0x17b437[_0xe075('0x40')]=_[_0xe075('0x3e')](_0x514432[_0xe075('0x3f')],qs[_0xe075('0x41')](_0x1c8ffd[_0xe075('0x3d')][_0xe075('0x41')]));_0x17b437[_0xe075('0x40')]=_0x17b437[_0xe075('0x40')]['length']?_0x17b437['attributes']:_0x514432[_0xe075('0x3f')];_0x17b437[_0xe075('0x45')]=qs['sort'](_0x1c8ffd['query'][_0xe075('0x46')]);_0x17b437[_0xe075('0x49')]=qs[_0xe075('0x47')](_[_0xe075('0x59')](_0x1c8ffd['query'],_0x514432['filters']));if(_0x1c8ffd[_0xe075('0x3d')][_0xe075('0x48')]){_0x17b437[_0xe075('0x49')]=_[_0xe075('0x4a')](_0x17b437['where'],{'$or':_[_0xe075('0x37')](_0x17b437[_0xe075('0x40')],function(_0x2987f8){var _0x3a43bc={};_0x3a43bc[_0x2987f8]={'$like':'%'+_0x1c8ffd['query'][_0xe075('0x48')]+'%'};return _0x3a43bc;})});}_0x17b437=_[_0xe075('0x4a')]({},_0x17b437,_0x1c8ffd[_0xe075('0x4c')]);return _0x3d9c8b[_0xe075('0x56')](_0x17b437);}})[_0xe075('0x2f')](function(_0x37c91f){if(_0x37c91f){_0x9f042d=_0x37c91f['length'];if(!_0x1c8ffd[_0xe075('0x3d')]['hasOwnProperty']('nolimit')){_0x17b437[_0xe075('0x29')]=qs[_0xe075('0x29')](_0x1c8ffd[_0xe075('0x3d')][_0xe075('0x29')]);_0x17b437[_0xe075('0x28')]=qs[_0xe075('0x28')](_0x1c8ffd[_0xe075('0x3d')][_0xe075('0x28')]);}return _0x3d9c8b['getConfigurations'](_0x17b437);}})[_0xe075('0x2f')](function(_0x373a29){if(_0x373a29){return _0x373a29?{'count':_0x9f042d,'rows':_0x373a29}:null;}})['then'](respondWithResult(_0x127b19,null))[_0xe075('0x4f')](handleError(_0x127b19,null));};exports[_0xe075('0x5a')]=function(_0x2e6338,_0x537396,_0x3331f3){if(_0x2e6338[_0xe075('0x54')]['id']){delete _0x2e6338[_0xe075('0x54')]['id'];}return db[_0xe075('0x38')][_0xe075('0x57')]({'where':{'id':_0x2e6338[_0xe075('0x55')]['id']}})[_0xe075('0x2f')](handleEntityNotFound(_0x537396,null))['then'](function(_0x2a9e87){if(_0x2a9e87){_0x2e6338['body']['AccountId']=_0x2a9e87['id'];_0x2e6338[_0xe075('0x54')][_0xe075('0x5b')]=integrations[_0xe075('0x5c')](_0x2e6338[_0xe075('0x54')][_0xe075('0x5d')],_0x2e6338[_0xe075('0x54')][_0xe075('0x3a')]);_0x2e6338['body']['Descriptions']=integrations['getDescriptions'](_0x2e6338['body'][_0xe075('0x5d')],_0x2e6338[_0xe075('0x54')][_0xe075('0x3a')]);return db['ZohoConfiguration'][_0xe075('0x53')](_0x2e6338[_0xe075('0x54')],{'include':[{'model':db[_0xe075('0x5e')],'as':'Subjects'},{'model':db[_0xe075('0x5e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x537396,null))['catch'](handleError(_0x537396,null));};function getAccessToken(_0x4d6d73){return new Promise(function(_0x3dec87,_0x58df42){var _0x84d8ec;switch(_0x4d6d73[_0xe075('0x5f')]){case'US':_0x84d8ec=_0xe075('0x60');break;case'AU':_0x84d8ec='https://accounts.zoho.com.au';break;case'EU':_0x84d8ec=_0xe075('0x61');break;case'IN':_0x84d8ec=_0xe075('0x62');break;case'CN':_0x84d8ec=_0xe075('0x63');break;default:_0x84d8ec=_0xe075('0x61');break;}var _0xa85506={'method':_0xe075('0x64'),'uri':_0x84d8ec+_0xe075('0x65'),'qs':{'refresh_token':_0x4d6d73[_0xe075('0x66')],'client_id':_0x4d6d73[_0xe075('0x67')],'client_secret':_0x4d6d73[_0xe075('0x68')],'grant_type':_0xe075('0x69')},'json':!![]};return rp(_0xa85506)[_0xe075('0x2f')](function(_0xb40e95){if(_0xb40e95[_0xe075('0x6a')]){_0x3dec87(_0xb40e95['access_token']);}else{_0x58df42(_0xe075('0x6b'));}})[_0xe075('0x4f')](function(_0xc41274){_0x58df42(_0xc41274);});});}exports[_0xe075('0x6c')]=function(_0x4c6470,_0x1775f6,_0x5ae181){var _0x4ee38d,_0x3744a7,_0x2d5e3a,_0x4e74b9,_0x25d9e9;return db[_0xe075('0x38')][_0xe075('0x57')]({'where':{'id':_0x4c6470[_0xe075('0x55')]['id']},'attributes':['id','host',_0xe075('0x5f'),_0xe075('0x67'),_0xe075('0x68'),'serverUrl',_0xe075('0x23'),_0xe075('0x66')]})[_0xe075('0x2f')](handleEntityNotFound(_0x1775f6,null))[_0xe075('0x2f')](function(_0x5c059b){_0x25d9e9=_0x5c059b;_0x4ee38d=_0x25d9e9[_0xe075('0x6d')];_0x3744a7=_0x4ee38d===_0xe075('0x6e')?'eu':_0xe075('0x6f');_0x2d5e3a=_0x25d9e9['serverUrl'];var _0x23c5e4=_0x2d5e3a[_0xe075('0x70')](-0x1);if(_0x23c5e4==='/'||_0x23c5e4==='\x5c'||_0x23c5e4===':'){_0x2d5e3a=_0x2d5e3a[_0xe075('0x71')](0x0,_0x2d5e3a['lastIndexOf'](_0x23c5e4));}if(!_0x25d9e9[_0xe075('0x66')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x25d9e9);})[_0xe075('0x2f')](function(_0x361770){if(_0x361770){return rp({'method':_0xe075('0x72'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x3744a7),'qs':{'module':'Calls'},'headers':{'Authorization':_0xe075('0x73')+_0x361770},'json':!![]});}})[_0xe075('0x2f')](function(_0x26545c){if(_0x26545c){if(_0x26545c[_0xe075('0x74')]&&_0x26545c[_0xe075('0x74')][_0xe075('0x22')]){throw new Error(_0x26545c['response'][_0xe075('0x22')][_0xe075('0x24')]);}var _0x387199=[];var _0x1e664f=[];var _0x33ed21=[_0xe075('0x75'),_0xe075('0x76'),_0xe075('0x77'),_0xe075('0x78'),_0xe075('0x79'),'Call_Result','Call_Start_Time',_0xe075('0x7a')];_0x1e664f=_[_0xe075('0x7b')](_0x26545c[_0xe075('0x41')],function(_0x11e9d9){return _0x33ed21['includes'](_0x11e9d9[_0xe075('0x7c')]);});for(var _0x31e8ea=0x0;_0x31e8ea<_0x1e664f['length'];_0x31e8ea++){if(_0x1e664f[_0x31e8ea][_0xe075('0x7d')]===![]){_0x387199[_0xe075('0x7e')]({'id':_0x1e664f[_0x31e8ea]['id'],'name':_0x1e664f[_0x31e8ea][_0xe075('0x7f')],'custom':_0x1e664f[_0x31e8ea][_0xe075('0x80')],'options':_0x1e664f[_0x31e8ea][_0xe075('0x81')]==='picklist'&&_0x1e664f[_0x31e8ea]['pick_list_values'][_0xe075('0x42')]>-0x1?_['map'](_0x1e664f[_0x31e8ea][_0xe075('0x82')],function(_0x135263){return{'name':_0x135263,'value':_0x135263};}):[]});}}return{'count':_0x387199['length'],'rows':_0x387199};}else{return{'count':0x0,'rows':[]};}})[_0xe075('0x2f')](respondWithResult(_0x1775f6,null))[_0xe075('0x4f')](function(_0x1e9eb5){var _0x15d424=_0x4c6470['query'][_0xe075('0x18')]?0x1f4:_0x1e9eb5[_0xe075('0x83')]||0x1f4;logger[_0xe075('0x22')](_0xe075('0x84'),_0xe075('0x6c'),_0x15d424,JSON['stringify'](_0x1e9eb5));delete _0x1e9eb5['name'];if(_0x15d424===0x191){_0x15d424=0x190;}_0x1775f6[_0xe075('0x25')](_0x15d424)[_0xe075('0x35')](_0x4c6470[_0xe075('0x3d')][_0xe075('0x18')]?{'message':_0xe075('0x85'),'statusCode':_0x1e9eb5['statusCode']}:_0x1e9eb5);});};
\ No newline at end of file
index 5a95790..cdd124b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4808=['name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','https://accounts.zoho.eu','POST','then','refresh_token','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','host','substring','lastIndexOf','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','parse','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x15c246,_0x3e0b1d){var _0x354de4=function(_0x510b4f){while(--_0x510b4f){_0x15c246['push'](_0x15c246['shift']());}};_0x354de4(++_0x3e0b1d);}(_0x4808,0x1cc));var _0x8480=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x4808[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x8480('0x0'));var util=require(_0x8480('0x1'));var logger=require(_0x8480('0x2'))(_0x8480('0x3'));var moment=require(_0x8480('0x4'));var BPromise=require(_0x8480('0x5'));var rp=require(_0x8480('0x6'));var fs=require('fs');var path=require(_0x8480('0x7'));var rimraf=require(_0x8480('0x8'));var config=require(_0x8480('0x9'));var attributes=require(_0x8480('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x8480('0xb')]=function(_0xf1622f,_0x3de577){return _0xf1622f[_0x8480('0xc')](_0x8480('0xd'),attributes,{'tableName':_0x8480('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x587b38,_0x283490,_0x4ded12){if(_0x587b38[_0x8480('0xf')]('zone')||_0x587b38['changed'](_0x8480('0x10'))||_0x587b38[_0x8480('0xf')](_0x8480('0x11'))||_0x587b38[_0x8480('0xf')](_0x8480('0x12'))||_0x587b38[_0x8480('0xf')]('code')||_0x587b38['changed'](_0x8480('0x13'))){var _0x1d592d,_0xf3afbc;_0x1d592d=_0x587b38[_0x8480('0x10')];var _0x310b54=_0x1d592d['slice'](-0x1);if(_0x310b54==='/'||_0x310b54==='\x5c'||_0x310b54===':'){_0x1d592d=_0x1d592d[_0x8480('0x14')](0x0,_0x1d592d[_0x8480('0x15')](_0x310b54));}switch(_0x587b38[_0x8480('0x16')]){case'US':_0xf3afbc='https://accounts.zoho.com';break;case'AU':_0xf3afbc=_0x8480('0x17');break;case'IN':_0xf3afbc=_0x8480('0x18');break;case'CN':_0xf3afbc=_0x8480('0x19');break;default:_0xf3afbc='https://accounts.zoho.eu';break;}var _0x4d6b59={'method':'POST','uri':_0xf3afbc+_0x8480('0x1a'),'form':{'grant_type':_0x8480('0x1b'),'client_id':_0x587b38[_0x8480('0x11')],'client_secret':_0x587b38[_0x8480('0x12')],'redirect_uri':_0x587b38[_0x8480('0x10')],'code':_0x587b38[_0x8480('0x1c')]},'headers':{'Content-Type':_0x8480('0x1d')}};return rp(_0x4d6b59)['then'](function(_0x5ca8ab){var _0x3a9f6b=JSON[_0x8480('0x1e')](_0x5ca8ab);if(_0x3a9f6b['refresh_token']){_0x587b38[_0x8480('0x1f')]=_0x3a9f6b['refresh_token'];logger[_0x8480('0x20')](util[_0x8480('0x21')](_0x8480('0x22'),_0x587b38[_0x8480('0x23')],_0x587b38['id']));}else{logger[_0x8480('0x24')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x587b38[_0x8480('0x23')],_0x587b38['id']),util[_0x8480('0x25')](_0x3a9f6b,{'showHidden':![],'depth':null}));}return _0x4ded12(null,_0x283490);})[_0x8480('0x26')](function(_0x5e96fd){logger[_0x8480('0x24')](util[_0x8480('0x21')](_0x8480('0x27'),_0x587b38['name'],_0x587b38['id']),util[_0x8480('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4ded12(_0x5e96fd);});}else{return _0x4ded12(null,_0x283490);}},'beforeUpdate':function(_0xb74130,_0x218af7,_0x5342f7){if(_0xb74130['changed'](_0x8480('0x16'))||_0xb74130['changed'](_0x8480('0x10'))||_0xb74130['changed'](_0x8480('0x11'))||_0xb74130[_0x8480('0xf')](_0x8480('0x12'))||_0xb74130['changed']('code')||_0xb74130[_0x8480('0xf')]('host')){var _0x171767,_0x49dc7c;_0x171767=_0xb74130[_0x8480('0x10')];var _0x4e3046=_0x171767[_0x8480('0x28')](-0x1);if(_0x4e3046==='/'||_0x4e3046==='\x5c'||_0x4e3046===':'){_0x171767=_0x171767[_0x8480('0x14')](0x0,_0x171767['lastIndexOf'](_0x4e3046));}switch(_0xb74130[_0x8480('0x16')]){case'US':_0x49dc7c='https://accounts.zoho.com';break;case'AU':_0x49dc7c='https://accounts.zoho.com.au';break;case'IN':_0x49dc7c=_0x8480('0x18');break;case'CN':_0x49dc7c=_0x8480('0x19');break;default:_0x49dc7c=_0x8480('0x29');break;}var _0x5bbdb2={'method':_0x8480('0x2a'),'uri':_0x49dc7c+'/oauth/v2/token','form':{'grant_type':_0x8480('0x1b'),'client_id':_0xb74130['clientId'],'client_secret':_0xb74130[_0x8480('0x12')],'redirect_uri':_0xb74130[_0x8480('0x10')],'code':_0xb74130[_0x8480('0x1c')]},'headers':{'Content-Type':_0x8480('0x1d')}};return rp(_0x5bbdb2)[_0x8480('0x2b')](function(_0x56d620){var _0x13bec1=JSON['parse'](_0x56d620);if(_0x13bec1[_0x8480('0x2c')]){_0xb74130['refreshToken']=_0x13bec1[_0x8480('0x2c')];logger['info'](util[_0x8480('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xb74130[_0x8480('0x23')],_0xb74130['id']));}else{logger[_0x8480('0x24')](util[_0x8480('0x21')](_0x8480('0x27'),_0xb74130['name'],_0xb74130['id']),util[_0x8480('0x25')](_0x13bec1,{'showHidden':![],'depth':null}));}return _0x5342f7(null,_0x218af7);})[_0x8480('0x26')](function(_0x472f2c){logger[_0x8480('0x24')](util[_0x8480('0x21')](_0x8480('0x27'),_0xb74130[_0x8480('0x23')],_0xb74130['id']),util[_0x8480('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x5342f7(_0x472f2c);});}else{return _0x5342f7(null,_0x218af7);}}}});};
\ No newline at end of file
+var _0xbf3b=['exports','define','ZohoAccount','int_zoho_accounts','zone','changed','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','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.eu','lodash','util','api','moment','bluebird','request-promise','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xbf3b,0xa7));var _0xbbf3=function(_0x4df587,_0x53b86d){_0x4df587=_0x4df587-0x0;var _0x593d5f=_0xbf3b[_0x4df587];return _0x593d5f;};'use strict';var _=require(_0xbbf3('0x0'));var util=require(_0xbbf3('0x1'));var logger=require('../../config/logger')(_0xbbf3('0x2'));var moment=require(_0xbbf3('0x3'));var BPromise=require(_0xbbf3('0x4'));var rp=require(_0xbbf3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbf3('0x6'));var config=require('../../config/environment');var attributes=require(_0xbbf3('0x7'));var integrations=require(_0xbbf3('0x8'));module[_0xbbf3('0x9')]=function(_0x5c0e80,_0xa892c8){return _0x5c0e80[_0xbbf3('0xa')](_0xbbf3('0xb'),attributes,{'tableName':_0xbbf3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c012e,_0x16d538,_0x1af27d){if(_0x3c012e['changed'](_0xbbf3('0xd'))||_0x3c012e[_0xbbf3('0xe')](_0xbbf3('0xf'))||_0x3c012e[_0xbbf3('0xe')](_0xbbf3('0x10'))||_0x3c012e[_0xbbf3('0xe')](_0xbbf3('0x11'))||_0x3c012e[_0xbbf3('0xe')]('code')||_0x3c012e[_0xbbf3('0xe')](_0xbbf3('0x12'))){var _0xb0dca6,_0x386547;_0xb0dca6=_0x3c012e['serverUrl'];var _0x45be0e=_0xb0dca6[_0xbbf3('0x13')](-0x1);if(_0x45be0e==='/'||_0x45be0e==='\x5c'||_0x45be0e===':'){_0xb0dca6=_0xb0dca6[_0xbbf3('0x14')](0x0,_0xb0dca6[_0xbbf3('0x15')](_0x45be0e));}switch(_0x3c012e[_0xbbf3('0xd')]){case'US':_0x386547=_0xbbf3('0x16');break;case'AU':_0x386547=_0xbbf3('0x17');break;case'IN':_0x386547=_0xbbf3('0x18');break;case'CN':_0x386547=_0xbbf3('0x19');break;default:_0x386547='https://accounts.zoho.eu';break;}var _0xf3583c={'method':_0xbbf3('0x1a'),'uri':_0x386547+_0xbbf3('0x1b'),'form':{'grant_type':_0xbbf3('0x1c'),'client_id':_0x3c012e[_0xbbf3('0x10')],'client_secret':_0x3c012e[_0xbbf3('0x11')],'redirect_uri':_0x3c012e[_0xbbf3('0xf')],'code':_0x3c012e[_0xbbf3('0x1d')]},'headers':{'Content-Type':_0xbbf3('0x1e')}};return rp(_0xf3583c)[_0xbbf3('0x1f')](function(_0x231e7b){var _0x5f8d8c=JSON[_0xbbf3('0x20')](_0x231e7b);if(_0x5f8d8c[_0xbbf3('0x21')]){_0x3c012e[_0xbbf3('0x22')]=_0x5f8d8c[_0xbbf3('0x21')];logger[_0xbbf3('0x23')](util['format'](_0xbbf3('0x24'),_0x3c012e[_0xbbf3('0x25')],_0x3c012e['id']));}else{logger[_0xbbf3('0x26')](util[_0xbbf3('0x27')](_0xbbf3('0x28'),_0x3c012e[_0xbbf3('0x25')],_0x3c012e['id']),util[_0xbbf3('0x29')](_0x5f8d8c,{'showHidden':![],'depth':null}));}return _0x1af27d(null,_0x16d538);})[_0xbbf3('0x2a')](function(_0x522356){logger[_0xbbf3('0x26')](util[_0xbbf3('0x27')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3c012e[_0xbbf3('0x25')],_0x3c012e['id']),util[_0xbbf3('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x1af27d(_0x522356);});}else{return _0x1af27d(null,_0x16d538);}},'beforeUpdate':function(_0x19fce0,_0x14a056,_0x8b2b3f){if(_0x19fce0[_0xbbf3('0xe')]('zone')||_0x19fce0['changed']('serverUrl')||_0x19fce0[_0xbbf3('0xe')]('clientId')||_0x19fce0['changed'](_0xbbf3('0x11'))||_0x19fce0[_0xbbf3('0xe')](_0xbbf3('0x1d'))||_0x19fce0[_0xbbf3('0xe')]('host')){var _0xbad036,_0x5e22eb;_0xbad036=_0x19fce0['serverUrl'];var _0x542b21=_0xbad036[_0xbbf3('0x13')](-0x1);if(_0x542b21==='/'||_0x542b21==='\x5c'||_0x542b21===':'){_0xbad036=_0xbad036[_0xbbf3('0x14')](0x0,_0xbad036['lastIndexOf'](_0x542b21));}switch(_0x19fce0['zone']){case'US':_0x5e22eb='https://accounts.zoho.com';break;case'AU':_0x5e22eb=_0xbbf3('0x17');break;case'IN':_0x5e22eb=_0xbbf3('0x18');break;case'CN':_0x5e22eb=_0xbbf3('0x19');break;default:_0x5e22eb=_0xbbf3('0x2b');break;}var _0x3a5ab8={'method':_0xbbf3('0x1a'),'uri':_0x5e22eb+_0xbbf3('0x1b'),'form':{'grant_type':_0xbbf3('0x1c'),'client_id':_0x19fce0[_0xbbf3('0x10')],'client_secret':_0x19fce0[_0xbbf3('0x11')],'redirect_uri':_0x19fce0[_0xbbf3('0xf')],'code':_0x19fce0[_0xbbf3('0x1d')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3a5ab8)[_0xbbf3('0x1f')](function(_0x251f07){var _0x136850=JSON[_0xbbf3('0x20')](_0x251f07);if(_0x136850[_0xbbf3('0x21')]){_0x19fce0[_0xbbf3('0x22')]=_0x136850['refresh_token'];logger['info'](util[_0xbbf3('0x27')](_0xbbf3('0x24'),_0x19fce0[_0xbbf3('0x25')],_0x19fce0['id']));}else{logger[_0xbbf3('0x26')](util[_0xbbf3('0x27')](_0xbbf3('0x28'),_0x19fce0[_0xbbf3('0x25')],_0x19fce0['id']),util[_0xbbf3('0x29')](_0x136850,{'showHidden':![],'depth':null}));}return _0x8b2b3f(null,_0x14a056);})[_0xbbf3('0x2a')](function(_0x41e9e0){logger['error'](util['format'](_0xbbf3('0x28'),_0x19fce0[_0xbbf3('0x25')],_0x19fce0['id']),util[_0xbbf3('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x8b2b3f(_0x41e9e0);});}else{return _0x8b2b3f(null,_0x14a056);}}}});};
\ No newline at end of file
index 4d55b5e..003abe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bc7=['error','code','message','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetZohoAccount','ShowZohoAccount','ZohoAccount','find','where','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15b257,_0x4d6700){var _0x5d6b4e=function(_0x2ce994){while(--_0x2ce994){_0x15b257['push'](_0x15b257['shift']());}};_0x5d6b4e(++_0x4d6700);}(_0x4bc7,0x188));var _0x74bc=function(_0x4d986d,_0x3d2cb2){_0x4d986d=_0x4d986d-0x0;var _0x150b8a=_0x4bc7[_0x4d986d];return _0x150b8a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x74bc('0x0'));var BPromise=require(_0x74bc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74bc('0x2'))['db'];var utils=require(_0x74bc('0x3'));var logger=require(_0x74bc('0x4'))(_0x74bc('0x5'));var config=require(_0x74bc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x74bc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36cfb5,_0x3bde72,_0xd45119){return new BPromise(function(_0x4e7419,_0x5e48f8){return client[_0x74bc('0x8')](_0x36cfb5,_0xd45119)[_0x74bc('0x9')](function(_0x5cfa2e){logger[_0x74bc('0xa')](_0x74bc('0xb'),_0x3bde72,_0x74bc('0xc'));logger[_0x74bc('0xd')](_0x74bc('0xe'),_0x3bde72,_0x74bc('0xc'),JSON[_0x74bc('0xf')](_0x5cfa2e));if(_0x5cfa2e[_0x74bc('0x10')]){if(_0x5cfa2e[_0x74bc('0x10')][_0x74bc('0x11')]===0x1f4){logger[_0x74bc('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x3bde72,_0x5cfa2e[_0x74bc('0x10')][_0x74bc('0x12')]);return _0x5e48f8(_0x5cfa2e[_0x74bc('0x10')]['message']);}logger['error'](_0x74bc('0xb'),_0x3bde72,_0x5cfa2e[_0x74bc('0x10')][_0x74bc('0x12')]);return _0x4e7419(_0x5cfa2e[_0x74bc('0x10')][_0x74bc('0x12')]);}else{logger['info'](_0x74bc('0xb'),_0x3bde72,_0x74bc('0xc'));_0x4e7419(_0x5cfa2e[_0x74bc('0x13')][_0x74bc('0x12')]);}})[_0x74bc('0x14')](function(_0xe82f8f){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x3bde72,_0xe82f8f);_0x5e48f8(_0xe82f8f);});});}exports['GetZohoAccount']=function(_0x118564){var _0x3f6102=this;return new Promise(function(_0x569d94,_0x12a009){return db['ZohoAccount'][_0x74bc('0x15')]({'raw':_0x118564['options']?_0x118564[_0x74bc('0x16')][_0x74bc('0x17')]===undefined?!![]:![]:!![],'where':_0x118564[_0x74bc('0x16')]?_0x118564[_0x74bc('0x16')]['where']||null:null,'attributes':_0x118564[_0x74bc('0x16')]?_0x118564[_0x74bc('0x16')][_0x74bc('0x18')]||null:null,'limit':_0x118564[_0x74bc('0x16')]?_0x118564[_0x74bc('0x16')][_0x74bc('0x19')]||null:null,'include':_0x118564[_0x74bc('0x16')]?_0x118564[_0x74bc('0x16')][_0x74bc('0x1a')]?_[_0x74bc('0x1b')](_0x118564['options']['include'],function(_0x213fb5){return{'model':db[_0x213fb5[_0x74bc('0x1c')]],'as':_0x213fb5['as'],'attributes':_0x213fb5['attributes'],'include':_0x213fb5[_0x74bc('0x1a')]?_[_0x74bc('0x1b')](_0x213fb5['include'],function(_0x55a6f7){return{'model':db[_0x55a6f7[_0x74bc('0x1c')]],'as':_0x55a6f7['as'],'attributes':_0x55a6f7[_0x74bc('0x18')],'include':_0x55a6f7[_0x74bc('0x1a')]?_[_0x74bc('0x1b')](_0x55a6f7['include'],function(_0x1be887){return{'model':db[_0x1be887['model']],'as':_0x1be887['as'],'attributes':_0x1be887[_0x74bc('0x18')]};}):[]};}):[]};}):[]:[]})[_0x74bc('0x9')](function(_0xf5be9f){logger[_0x74bc('0xa')](_0x74bc('0x1d'),_0x118564);logger['debug'](_0x74bc('0x1d'),_0x118564,JSON[_0x74bc('0xf')](_0xf5be9f));_0x569d94(_0xf5be9f);})[_0x74bc('0x14')](function(_0x48761f){logger[_0x74bc('0x10')](_0x74bc('0x1d'),_0x48761f[_0x74bc('0x12')],_0x118564);_0x12a009(_0x3f6102[_0x74bc('0x10')](0x1f4,_0x48761f['message']));});});};exports[_0x74bc('0x1e')]=function(_0x163985){var _0x5c4fb=this;return new Promise(function(_0x2b76a1,_0x543717){return db[_0x74bc('0x1f')][_0x74bc('0x20')]({'raw':_0x163985[_0x74bc('0x16')]?_0x163985['options'][_0x74bc('0x17')]===undefined?!![]:![]:!![],'where':_0x163985[_0x74bc('0x16')]?_0x163985[_0x74bc('0x16')][_0x74bc('0x21')]||null:null,'attributes':_0x163985[_0x74bc('0x16')]?_0x163985[_0x74bc('0x16')][_0x74bc('0x18')]||null:null,'include':_0x163985['options']?_0x163985['options'][_0x74bc('0x1a')]?_[_0x74bc('0x1b')](_0x163985[_0x74bc('0x16')][_0x74bc('0x1a')],function(_0x277c24){return{'model':db[_0x277c24[_0x74bc('0x1c')]],'as':_0x277c24['as'],'attributes':_0x277c24[_0x74bc('0x18')],'include':_0x277c24[_0x74bc('0x1a')]?_[_0x74bc('0x1b')](_0x277c24[_0x74bc('0x1a')],function(_0x44c81a){return{'model':db[_0x44c81a['model']],'as':_0x44c81a['as'],'attributes':_0x44c81a['attributes'],'include':_0x44c81a['include']?_['map'](_0x44c81a['include'],function(_0x3d2efb){return{'model':db[_0x3d2efb[_0x74bc('0x1c')]],'as':_0x3d2efb['as'],'attributes':_0x3d2efb[_0x74bc('0x18')]};}):[]};}):[]};}):[]:[]})[_0x74bc('0x9')](function(_0x5b83ff){logger['info'](_0x74bc('0x1e'),_0x163985);logger[_0x74bc('0xd')](_0x74bc('0x1e'),_0x163985,JSON[_0x74bc('0xf')](_0x5b83ff));_0x2b76a1(_0x5b83ff);})[_0x74bc('0x14')](function(_0x26e4ca){logger[_0x74bc('0x10')](_0x74bc('0x1e'),_0x26e4ca[_0x74bc('0x12')],_0x163985);_0x543717(_0x5c4fb[_0x74bc('0x10')](0x1f4,_0x26e4ca[_0x74bc('0x12')]));});});};
\ No newline at end of file
+var _0x9d3d=['request\x20sent','debug','error','message','info','ZohoAccount,\x20%s,\x20%s','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1702b8,_0x28c7da){var _0x50028a=function(_0x4135b1){while(--_0x4135b1){_0x1702b8['push'](_0x1702b8['shift']());}};_0x50028a(++_0x28c7da);}(_0x9d3d,0x77));var _0xd9d3=function(_0x521910,_0xd24a3c){_0x521910=_0x521910-0x0;var _0x4dda55=_0x9d3d[_0x521910];return _0x4dda55;};'use strict';var _=require(_0xd9d3('0x0'));var util=require(_0xd9d3('0x1'));var moment=require(_0xd9d3('0x2'));var BPromise=require(_0xd9d3('0x3'));var rs=require(_0xd9d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd9d3('0x6'));var config=require(_0xd9d3('0x7'));var jayson=require(_0xd9d3('0x8'));var client=jayson[_0xd9d3('0x9')][_0xd9d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42eb8b,_0x42b486,_0x7048d1){return new BPromise(function(_0x4fe370,_0x39f53f){return client[_0xd9d3('0xb')](_0x42eb8b,_0x7048d1)[_0xd9d3('0xc')](function(_0x1641e0){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x42b486,_0xd9d3('0xd'));logger[_0xd9d3('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x42b486,_0xd9d3('0xd'),JSON['stringify'](_0x1641e0));if(_0x1641e0['error']){if(_0x1641e0[_0xd9d3('0xf')]['code']===0x1f4){logger[_0xd9d3('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x42b486,_0x1641e0[_0xd9d3('0xf')][_0xd9d3('0x10')]);return _0x39f53f(_0x1641e0[_0xd9d3('0xf')][_0xd9d3('0x10')]);}logger[_0xd9d3('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x42b486,_0x1641e0['error'][_0xd9d3('0x10')]);return _0x4fe370(_0x1641e0[_0xd9d3('0xf')]['message']);}else{logger[_0xd9d3('0x11')](_0xd9d3('0x12'),_0x42b486,_0xd9d3('0xd'));_0x4fe370(_0x1641e0['result']['message']);}})[_0xd9d3('0x13')](function(_0x4db08b){logger[_0xd9d3('0xf')](_0xd9d3('0x12'),_0x42b486,_0x4db08b);_0x39f53f(_0x4db08b);});});}exports[_0xd9d3('0x14')]=function(_0xcf7324){var _0x267665=this;return new Promise(function(_0x40332b,_0xcc6854){return db[_0xd9d3('0x15')][_0xd9d3('0x16')]({'raw':_0xcf7324[_0xd9d3('0x17')]?_0xcf7324[_0xd9d3('0x17')][_0xd9d3('0x18')]===undefined?!![]:![]:!![],'where':_0xcf7324['options']?_0xcf7324[_0xd9d3('0x17')][_0xd9d3('0x19')]||null:null,'attributes':_0xcf7324['options']?_0xcf7324[_0xd9d3('0x17')][_0xd9d3('0x1a')]||null:null,'limit':_0xcf7324[_0xd9d3('0x17')]?_0xcf7324[_0xd9d3('0x17')][_0xd9d3('0x1b')]||null:null,'include':_0xcf7324[_0xd9d3('0x17')]?_0xcf7324[_0xd9d3('0x17')][_0xd9d3('0x1c')]?_[_0xd9d3('0x1d')](_0xcf7324[_0xd9d3('0x17')]['include'],function(_0x1b05d5){return{'model':db[_0x1b05d5['model']],'as':_0x1b05d5['as'],'attributes':_0x1b05d5['attributes'],'include':_0x1b05d5[_0xd9d3('0x1c')]?_[_0xd9d3('0x1d')](_0x1b05d5[_0xd9d3('0x1c')],function(_0x4608db){return{'model':db[_0x4608db[_0xd9d3('0x1e')]],'as':_0x4608db['as'],'attributes':_0x4608db[_0xd9d3('0x1a')],'include':_0x4608db[_0xd9d3('0x1c')]?_[_0xd9d3('0x1d')](_0x4608db[_0xd9d3('0x1c')],function(_0x4e0628){return{'model':db[_0x4e0628['model']],'as':_0x4e0628['as'],'attributes':_0x4e0628[_0xd9d3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd9d3('0xc')](function(_0x31d8d4){logger[_0xd9d3('0x11')](_0xd9d3('0x14'),_0xcf7324);logger[_0xd9d3('0xe')](_0xd9d3('0x14'),_0xcf7324,JSON[_0xd9d3('0x1f')](_0x31d8d4));_0x40332b(_0x31d8d4);})[_0xd9d3('0x13')](function(_0x33fd92){logger['error'](_0xd9d3('0x14'),_0x33fd92[_0xd9d3('0x10')],_0xcf7324);_0xcc6854(_0x267665[_0xd9d3('0xf')](0x1f4,_0x33fd92['message']));});});};exports[_0xd9d3('0x20')]=function(_0x180122){var _0x4eeecb=this;return new Promise(function(_0x3327df,_0x27f5e4){return db[_0xd9d3('0x15')]['find']({'raw':_0x180122[_0xd9d3('0x17')]?_0x180122['options']['raw']===undefined?!![]:![]:!![],'where':_0x180122['options']?_0x180122[_0xd9d3('0x17')]['where']||null:null,'attributes':_0x180122['options']?_0x180122['options']['attributes']||null:null,'include':_0x180122['options']?_0x180122[_0xd9d3('0x17')][_0xd9d3('0x1c')]?_[_0xd9d3('0x1d')](_0x180122['options'][_0xd9d3('0x1c')],function(_0x4cb61c){return{'model':db[_0x4cb61c[_0xd9d3('0x1e')]],'as':_0x4cb61c['as'],'attributes':_0x4cb61c[_0xd9d3('0x1a')],'include':_0x4cb61c[_0xd9d3('0x1c')]?_[_0xd9d3('0x1d')](_0x4cb61c[_0xd9d3('0x1c')],function(_0xb96da9){return{'model':db[_0xb96da9[_0xd9d3('0x1e')]],'as':_0xb96da9['as'],'attributes':_0xb96da9['attributes'],'include':_0xb96da9[_0xd9d3('0x1c')]?_[_0xd9d3('0x1d')](_0xb96da9['include'],function(_0x3afbbe){return{'model':db[_0x3afbbe[_0xd9d3('0x1e')]],'as':_0x3afbbe['as'],'attributes':_0x3afbbe[_0xd9d3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd9d3('0xc')](function(_0x4125fe){logger['info'](_0xd9d3('0x20'),_0x180122);logger[_0xd9d3('0xe')](_0xd9d3('0x20'),_0x180122,JSON[_0xd9d3('0x1f')](_0x4125fe));_0x3327df(_0x4125fe);})['catch'](function(_0x4a34c9){logger[_0xd9d3('0xf')]('ShowZohoAccount',_0x4a34c9['message'],_0x180122);_0x27f5e4(_0x4eeecb[_0xd9d3('0xf')](0x1f4,_0x4a34c9[_0xd9d3('0x10')]));});});};
\ No newline at end of file
index edfda77..48dd68f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ffe=['Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','express'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x4ffe,0x172));var _0xe4ff=function(_0x34501b,_0x264e47){_0x34501b=_0x34501b-0x0;var _0xdcbacd=_0x4ffe[_0x34501b];return _0xdcbacd;};'use strict';var multer=require(_0xe4ff('0x0'));var util=require(_0xe4ff('0x1'));var path=require(_0xe4ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4ff('0x3'));var router=express[_0xe4ff('0x4')]();var auth=require(_0xe4ff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe4ff('0x6'));var controller=require(_0xe4ff('0x7'));router[_0xe4ff('0x8')]('/',auth[_0xe4ff('0x9')](),controller[_0xe4ff('0xa')]);router['get'](_0xe4ff('0xb'),auth[_0xe4ff('0x9')](),controller[_0xe4ff('0xc')]);router[_0xe4ff('0x8')]('/:id/fields',auth[_0xe4ff('0x9')](),controller['getFields']);router[_0xe4ff('0x8')](_0xe4ff('0xd'),auth[_0xe4ff('0x9')](),controller[_0xe4ff('0xe')]);router['get']('/:id/descriptions',auth[_0xe4ff('0x9')](),controller[_0xe4ff('0xf')]);router[_0xe4ff('0x10')]('/',auth[_0xe4ff('0x9')](),controller[_0xe4ff('0x11')]);router[_0xe4ff('0x12')]('/:id',auth[_0xe4ff('0x9')](),controller[_0xe4ff('0x13')]);router['delete'](_0xe4ff('0xb'),auth['isAuthenticated'](),controller[_0xe4ff('0x14')]);module[_0xe4ff('0x15')]=router;
\ No newline at end of file
+var _0x4522=['../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x4c0658,_0x833e86){var _0x1ebcd7=function(_0x86b365){while(--_0x86b365){_0x4c0658['push'](_0x4c0658['shift']());}};_0x1ebcd7(++_0x833e86);}(_0x4522,0x1a0));var _0x2452=function(_0x5c8fe5,_0x3461d0){_0x5c8fe5=_0x5c8fe5-0x0;var _0x42928a=_0x4522[_0x5c8fe5];return _0x42928a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var auth=require(_0x2452('0x3'));var interaction=require(_0x2452('0x4'));var config=require(_0x2452('0x5'));var controller=require(_0x2452('0x6'));router[_0x2452('0x7')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0x9')]);router[_0x2452('0x7')](_0x2452('0xa'),auth[_0x2452('0x8')](),controller[_0x2452('0xb')]);router[_0x2452('0x7')](_0x2452('0xc'),auth[_0x2452('0x8')](),controller[_0x2452('0xd')]);router[_0x2452('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x2452('0xe')]);router['get']('/:id/descriptions',auth[_0x2452('0x8')](),controller[_0x2452('0xf')]);router[_0x2452('0x10')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0x11')]);router[_0x2452('0x12')](_0x2452('0xa'),auth[_0x2452('0x8')](),controller['update']);router['delete']('/:id',auth[_0x2452('0x8')](),controller['destroy']);module[_0x2452('0x13')]=router;
\ No newline at end of file
index 7d61896..9d10e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8085=['STRING','sequelize','exports','ENUM','lead','contact','nothing','contact_lead'];(function(_0x43576f,_0x1356ed){var _0x4d2466=function(_0x865deb){while(--_0x865deb){_0x43576f['push'](_0x43576f['shift']());}};_0x4d2466(++_0x1356ed);}(_0x8085,0x109));var _0x5808=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x8085[_0x485b5a];return _0xd2b34d;};'use strict';var Sequelize=require(_0x5808('0x0'));module[_0x5808('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x5808('0x2')](_0x5808('0x3'),_0x5808('0x4'),_0x5808('0x5')),'defaultValue':_0x5808('0x3')},'moduleSearch':{'type':Sequelize[_0x5808('0x2')](_0x5808('0x6'),'contact',_0x5808('0x3')),'defaultValue':_0x5808('0x6')},'description':{'type':Sequelize[_0x5808('0x7')]}};
\ No newline at end of file
+var _0xdacc=['sequelize','STRING','ENUM','lead','nothing','contact_lead','contact'];(function(_0x2c329e,_0x5c9860){var _0x329902=function(_0x7bd77a){while(--_0x7bd77a){_0x2c329e['push'](_0x2c329e['shift']());}};_0x329902(++_0x5c9860);}(_0xdacc,0x134));var _0xcdac=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdacc[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xcdac('0x0'));module['exports']={'name':{'type':Sequelize[_0xcdac('0x1')]},'moduleCreate':{'type':Sequelize[_0xcdac('0x2')](_0xcdac('0x3'),'contact',_0xcdac('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0xcdac('0x5'),_0xcdac('0x6'),_0xcdac('0x3')),'defaultValue':_0xcdac('0x5')},'description':{'type':Sequelize[_0xcdac('0x1')]}};
\ No newline at end of file
index 9ca0626..9b50306 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x895d=['body','getFields','findOne','ZohoField','order','pick','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','sort','filter','where','VIRTUAL','merge','options','ZohoConfiguration','includeAll','include','findAll','rows','params','intersection','length','find','create'];(function(_0x2df6a2,_0x186787){var _0x280ce0=function(_0x119c74){while(--_0x119c74){_0x2df6a2['push'](_0x2df6a2['shift']());}};_0x280ce0(++_0x186787);}(_0x895d,0x67));var _0xd895=function(_0x59ecbd,_0x50907b){_0x59ecbd=_0x59ecbd-0x0;var _0x10a53e=_0x895d[_0x59ecbd];return _0x10a53e;};'use strict';var pdf=require(_0xd895('0x0'));var emlformat=require(_0xd895('0x1'));var rimraf=require(_0xd895('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd895('0x3'));var rp=require(_0xd895('0x4'));var moment=require(_0xd895('0x5'));var BPromise=require(_0xd895('0x6'));var Mustache=require(_0xd895('0x7'));var util=require(_0xd895('0x8'));var path=require(_0xd895('0x9'));var sox=require(_0xd895('0xa'));var csv=require(_0xd895('0xb'));var ejs=require(_0xd895('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd895('0xd'));var crypto=require('crypto');var jsforce=require(_0xd895('0xe'));var deskjs=require(_0xd895('0xf'));var toCsv=require(_0xd895('0xb'));var querystring=require('querystring');var Papa=require(_0xd895('0x10'));var Redis=require('ioredis');var authService=require(_0xd895('0x11'));var qs=require(_0xd895('0x12'));var as=require(_0xd895('0x13'));var hardwareService=require(_0xd895('0x14'));var logger=require(_0xd895('0x15'))(_0xd895('0x16'));var utils=require(_0xd895('0x17'));var config=require(_0xd895('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xd895('0x19')][_0xd895('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4e28d4,_0x4c9820,_0x55304e){if(_0x55304e){var _0x38482b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38482b[_0xd895('0x1b')](_0x4c9820)){return _0x4e28d4;}else{throw new db[(_0xd895('0x1c'))]['ValidationError'](_0xd895('0x1d'));}}else{return _0x4e28d4;}}function respondWithRpcPromise(_0x3e6302,_0x2ddd32,_0xcf4b0a,_0x5cb53d){return new BPromise(function(_0x2f76ec,_0x25c536){var _0x11fd19=_0x5cb53d||client;return _0x11fd19['request'](_0x3e6302,_0xcf4b0a)['then'](function(_0x5b2893){logger['info'](_0xd895('0x1e'),_0x2ddd32,'request\x20sent');logger[_0xd895('0x1f')](_0xd895('0x20'),_0x2ddd32,'request\x20sent',JSON[_0xd895('0x21')](_0x5b2893));if(_0x5b2893[_0xd895('0x22')]){if(_0x5b2893[_0xd895('0x22')][_0xd895('0x23')]===0x1f4){logger[_0xd895('0x22')](_0xd895('0x1e'),_0x2ddd32,_0x5b2893[_0xd895('0x22')][_0xd895('0x24')]);return _0x25c536(_0x5b2893[_0xd895('0x22')][_0xd895('0x24')]);}logger[_0xd895('0x22')](_0xd895('0x1e'),_0x2ddd32,_0x5b2893[_0xd895('0x22')]['message']);return _0x2f76ec(_0x5b2893[_0xd895('0x22')][_0xd895('0x24')]);}else{logger[_0xd895('0x25')]('ZohoConfiguration,\x20%s,\x20%s',_0x2ddd32,_0xd895('0x26'));_0x2f76ec(_0x5b2893['result'][_0xd895('0x24')]);}})[_0xd895('0x27')](function(_0x38b49f){logger[_0xd895('0x22')](_0xd895('0x1e'),_0x2ddd32,_0x38b49f);_0x25c536(_0x38b49f);});});}function respondWithStatusCode(_0x537bbe,_0x5dc8a1){_0x5dc8a1=_0x5dc8a1||0xcc;return function(_0xce3853){if(_0xce3853){return _0x537bbe[_0xd895('0x28')](_0x5dc8a1);}return _0x537bbe[_0xd895('0x29')](_0x5dc8a1)[_0xd895('0x2a')]();};}function respondWithResult(_0x5c366b,_0x1dac73){_0x1dac73=_0x1dac73||0xc8;return function(_0x1293d7){if(_0x1293d7){return _0x5c366b[_0xd895('0x29')](_0x1dac73)[_0xd895('0x2b')](_0x1293d7);}};}function respondWithFilteredResult(_0x3730fd,_0x1f9745){return function(_0x46fa3b){if(_0x46fa3b){var _0x300207=_0x46fa3b[_0xd895('0x2c')],_0x29a9e1=_0x1f9745[_0xd895('0x2d')],_0x5ba779=_0x1f9745[_0xd895('0x2d')]+_0x1f9745['limit'],_0x43aaee;if(_0x5ba779>=_0x300207){_0x5ba779=_0x300207;_0x43aaee=0xc8;}else{_0x43aaee=0xce;}_0x3730fd[_0xd895('0x29')](_0x43aaee);return _0x3730fd[_0xd895('0x2e')](_0xd895('0x2f'),_0x29a9e1+'-'+_0x5ba779+'/'+_0x300207)[_0xd895('0x2b')](_0x46fa3b);}return null;};}function patchUpdates(_0x5f0aea){return function(_0x162ff5){try{jsonpatch[_0xd895('0x30')](_0x162ff5,_0x5f0aea,!![]);}catch(_0x44e6f5){return BPromise[_0xd895('0x31')](_0x44e6f5);}return _0x162ff5[_0xd895('0x32')]();};}function saveUpdates(_0x23c613,_0x24405c){return function(_0x2a5e34){if(_0x2a5e34){return _0x2a5e34[_0xd895('0x33')](_0x23c613)[_0xd895('0x34')](function(_0x45ef5e){return _0x45ef5e;});}return null;};}function removeEntity(_0x52e7bc,_0x26afb9){return function(_0x1a1f0e){if(_0x1a1f0e){return _0x1a1f0e[_0xd895('0x35')]()[_0xd895('0x34')](function(){_0x52e7bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1265a0,_0x4cd8a9){return function(_0x3623cc){if(!_0x3623cc){_0x1265a0[_0xd895('0x28')](0x194);}return _0x3623cc;};}function handleError(_0x1f1963,_0xab845f){_0xab845f=_0xab845f||0x1f4;return function(_0x545f4b){logger['error'](_0x545f4b[_0xd895('0x36')]);if(_0x545f4b['name']){delete _0x545f4b[_0xd895('0x37')];}_0x1f1963[_0xd895('0x29')](_0xab845f)['send'](_0x545f4b);};}exports[_0xd895('0x38')]=function(_0x5b349f,_0x174c2c){var _0x36b854={},_0x2e1c5f={},_0x1854a8={'count':0x0,'rows':[]};var _0x2fc38b=_[_0xd895('0x39')](db['ZohoConfiguration'][_0xd895('0x3a')],function(_0x529459){return{'name':_0x529459[_0xd895('0x3b')],'type':_0x529459[_0xd895('0x3c')][_0xd895('0x3d')]};});_0x2e1c5f[_0xd895('0x3e')]=_[_0xd895('0x39')](_0x2fc38b,'name');_0x2e1c5f[_0xd895('0x3f')]=_[_0xd895('0x40')](_0x5b349f[_0xd895('0x3f')]);_0x2e1c5f[_0xd895('0x41')]=_['intersection'](_0x2e1c5f[_0xd895('0x3e')],_0x2e1c5f[_0xd895('0x3f')]);_0x36b854[_0xd895('0x42')]=_['intersection'](_0x2e1c5f[_0xd895('0x3e')],qs[_0xd895('0x43')](_0x5b349f[_0xd895('0x3f')][_0xd895('0x43')]));_0x36b854[_0xd895('0x42')]=_0x36b854[_0xd895('0x42')]['length']?_0x36b854['attributes']:_0x2e1c5f['model'];if(!_0x5b349f[_0xd895('0x3f')][_0xd895('0x44')](_0xd895('0x45'))){_0x36b854[_0xd895('0x46')]=qs[_0xd895('0x46')](_0x5b349f['query'][_0xd895('0x46')]);_0x36b854[_0xd895('0x2d')]=qs[_0xd895('0x2d')](_0x5b349f[_0xd895('0x3f')][_0xd895('0x2d')]);}_0x36b854['order']=qs[_0xd895('0x47')](_0x5b349f[_0xd895('0x3f')][_0xd895('0x47')]);_0x36b854['where']=qs[_0xd895('0x41')](_['pick'](_0x5b349f[_0xd895('0x3f')],_0x2e1c5f[_0xd895('0x41')]),_0x2fc38b);if(_0x5b349f['query'][_0xd895('0x48')]){_0x36b854['where']=_['merge'](_0x36b854[_0xd895('0x49')],{'$or':_[_0xd895('0x39')](_0x2fc38b,function(_0xf1ea68){if(_0xf1ea68[_0xd895('0x3c')]!==_0xd895('0x4a')){var _0x3fd417={};_0x3fd417[_0xf1ea68['name']]={'$like':'%'+_0x5b349f[_0xd895('0x3f')][_0xd895('0x48')]+'%'};return _0x3fd417;}})});}_0x36b854=_[_0xd895('0x4b')]({},_0x36b854,_0x5b349f[_0xd895('0x4c')]);var _0x16e4a8={'where':_0x36b854[_0xd895('0x49')]};return db[_0xd895('0x4d')][_0xd895('0x2c')](_0x16e4a8)[_0xd895('0x34')](function(_0xc16ac7){_0x1854a8['count']=_0xc16ac7;if(_0x5b349f[_0xd895('0x3f')][_0xd895('0x4e')]){_0x36b854[_0xd895('0x4f')]=[{'all':!![]}];}return db[_0xd895('0x4d')][_0xd895('0x50')](_0x36b854);})[_0xd895('0x34')](function(_0x10b054){_0x1854a8[_0xd895('0x51')]=_0x10b054;return _0x1854a8;})[_0xd895('0x34')](respondWithFilteredResult(_0x174c2c,_0x36b854))[_0xd895('0x27')](handleError(_0x174c2c,null));};exports['show']=function(_0x302be7,_0xc865e0){var _0x38dc96={'raw':![],'where':{'id':_0x302be7[_0xd895('0x52')]['id']}},_0x578e41={};_0x578e41[_0xd895('0x3e')]=_[_0xd895('0x40')](db[_0xd895('0x4d')][_0xd895('0x3a')]);_0x578e41[_0xd895('0x3f')]=_[_0xd895('0x40')](_0x302be7[_0xd895('0x3f')]);_0x578e41[_0xd895('0x41')]=_['intersection'](_0x578e41[_0xd895('0x3e')],_0x578e41[_0xd895('0x3f')]);_0x38dc96[_0xd895('0x42')]=_[_0xd895('0x53')](_0x578e41[_0xd895('0x3e')],qs[_0xd895('0x43')](_0x302be7[_0xd895('0x3f')][_0xd895('0x43')]));_0x38dc96[_0xd895('0x42')]=_0x38dc96[_0xd895('0x42')][_0xd895('0x54')]?_0x38dc96[_0xd895('0x42')]:_0x578e41[_0xd895('0x3e')];if(_0x302be7[_0xd895('0x3f')][_0xd895('0x4e')]){_0x38dc96[_0xd895('0x4f')]=[{'all':!![]}];}_0x38dc96=_[_0xd895('0x4b')]({},_0x38dc96,_0x302be7[_0xd895('0x4c')]);return db['ZohoConfiguration'][_0xd895('0x55')](_0x38dc96)[_0xd895('0x34')](handleEntityNotFound(_0xc865e0,null))['then'](respondWithResult(_0xc865e0,null))[_0xd895('0x27')](handleError(_0xc865e0,null));};exports[_0xd895('0x56')]=function(_0x52d111,_0x57e34e){return db[_0xd895('0x4d')][_0xd895('0x56')](_0x52d111[_0xd895('0x57')],{})[_0xd895('0x34')](respondWithResult(_0x57e34e,0xc9))[_0xd895('0x27')](handleError(_0x57e34e,null));};exports[_0xd895('0x33')]=function(_0x4ddf2c,_0x2686de){if(_0x4ddf2c['body']['id']){delete _0x4ddf2c['body']['id'];}return db[_0xd895('0x4d')][_0xd895('0x55')]({'where':{'id':_0x4ddf2c['params']['id']}})[_0xd895('0x34')](handleEntityNotFound(_0x2686de,null))[_0xd895('0x34')](saveUpdates(_0x4ddf2c[_0xd895('0x57')],null))[_0xd895('0x34')](respondWithResult(_0x2686de,null))['catch'](handleError(_0x2686de,null));};exports[_0xd895('0x35')]=function(_0x4b4b3b,_0x5d0ab3){return db[_0xd895('0x4d')][_0xd895('0x55')]({'where':{'id':_0x4b4b3b[_0xd895('0x52')]['id']}})[_0xd895('0x34')](handleEntityNotFound(_0x5d0ab3,null))[_0xd895('0x34')](removeEntity(_0x5d0ab3,null))[_0xd895('0x27')](handleError(_0x5d0ab3,null));};exports[_0xd895('0x58')]=function(_0x14e511,_0xb7318c,_0x348738){var _0x12993f={};var _0x275f56={};var _0x73e39b;var _0x6ef5c5;return db[_0xd895('0x4d')][_0xd895('0x59')]({'where':{'id':_0x14e511[_0xd895('0x52')]['id']}})[_0xd895('0x34')](handleEntityNotFound(_0xb7318c,null))[_0xd895('0x34')](function(_0x30d95b){if(_0x30d95b){_0x73e39b=_0x30d95b;_0x275f56[_0xd895('0x3e')]=_['keys'](db[_0xd895('0x5a')][_0xd895('0x3a')]);_0x275f56[_0xd895('0x3f')]=_[_0xd895('0x40')](_0x14e511[_0xd895('0x3f')]);_0x275f56['filters']=_[_0xd895('0x53')](_0x275f56[_0xd895('0x3e')],_0x275f56[_0xd895('0x3f')]);_0x12993f['attributes']=_[_0xd895('0x53')](_0x275f56['model'],qs[_0xd895('0x43')](_0x14e511[_0xd895('0x3f')][_0xd895('0x43')]));_0x12993f[_0xd895('0x42')]=_0x12993f[_0xd895('0x42')][_0xd895('0x54')]?_0x12993f[_0xd895('0x42')]:_0x275f56[_0xd895('0x3e')];_0x12993f[_0xd895('0x5b')]=qs[_0xd895('0x47')](_0x14e511[_0xd895('0x3f')]['sort']);_0x12993f[_0xd895('0x49')]=qs[_0xd895('0x41')](_['pick'](_0x14e511[_0xd895('0x3f')],_0x275f56[_0xd895('0x41')]));if(_0x14e511[_0xd895('0x3f')][_0xd895('0x48')]){_0x12993f[_0xd895('0x49')]=_[_0xd895('0x4b')](_0x12993f[_0xd895('0x49')],{'$or':_[_0xd895('0x39')](_0x12993f[_0xd895('0x42')],function(_0x29fbcc){var _0xe33987={};_0xe33987[_0x29fbcc]={'$like':'%'+_0x14e511[_0xd895('0x3f')]['filter']+'%'};return _0xe33987;})});}_0x12993f=_[_0xd895('0x4b')]({},_0x12993f,_0x14e511[_0xd895('0x4c')]);return _0x73e39b[_0xd895('0x58')](_0x12993f);}})[_0xd895('0x34')](function(_0x4b8ad9){if(_0x4b8ad9){_0x6ef5c5=_0x4b8ad9[_0xd895('0x54')];if(!_0x14e511[_0xd895('0x3f')]['hasOwnProperty'](_0xd895('0x45'))){_0x12993f[_0xd895('0x46')]=qs[_0xd895('0x46')](_0x14e511['query'][_0xd895('0x46')]);_0x12993f[_0xd895('0x2d')]=qs[_0xd895('0x2d')](_0x14e511[_0xd895('0x3f')]['offset']);}return _0x73e39b[_0xd895('0x58')](_0x12993f);}})[_0xd895('0x34')](function(_0xed899e){if(_0xed899e){return _0xed899e?{'count':_0x6ef5c5,'rows':_0xed899e}:null;}})[_0xd895('0x34')](respondWithResult(_0xb7318c,null))['catch'](handleError(_0xb7318c,null));};exports['getSubjects']=function(_0xb19fc7,_0x4d3525,_0x51fe37){var _0x454eae={};var _0x43230c={};var _0x271043;var _0x49efe1;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xb19fc7['params']['id']}})[_0xd895('0x34')](handleEntityNotFound(_0x4d3525,null))[_0xd895('0x34')](function(_0x5cce8f){if(_0x5cce8f){_0x271043=_0x5cce8f;_0x43230c[_0xd895('0x3e')]=_['keys'](db[_0xd895('0x5a')]['rawAttributes']);_0x43230c[_0xd895('0x3f')]=_[_0xd895('0x40')](_0xb19fc7[_0xd895('0x3f')]);_0x43230c[_0xd895('0x41')]=_['intersection'](_0x43230c[_0xd895('0x3e')],_0x43230c[_0xd895('0x3f')]);_0x454eae['attributes']=_[_0xd895('0x53')](_0x43230c['model'],qs[_0xd895('0x43')](_0xb19fc7[_0xd895('0x3f')][_0xd895('0x43')]));_0x454eae[_0xd895('0x42')]=_0x454eae['attributes'][_0xd895('0x54')]?_0x454eae[_0xd895('0x42')]:_0x43230c[_0xd895('0x3e')];_0x454eae[_0xd895('0x5b')]=qs['sort'](_0xb19fc7[_0xd895('0x3f')][_0xd895('0x47')]);_0x454eae['where']=qs[_0xd895('0x41')](_[_0xd895('0x5c')](_0xb19fc7[_0xd895('0x3f')],_0x43230c['filters']));if(_0xb19fc7['query'][_0xd895('0x48')]){_0x454eae['where']=_[_0xd895('0x4b')](_0x454eae[_0xd895('0x49')],{'$or':_[_0xd895('0x39')](_0x454eae[_0xd895('0x42')],function(_0x3b67a1){var _0x783502={};_0x783502[_0x3b67a1]={'$like':'%'+_0xb19fc7[_0xd895('0x3f')][_0xd895('0x48')]+'%'};return _0x783502;})});}_0x454eae=_[_0xd895('0x4b')]({},_0x454eae,_0xb19fc7[_0xd895('0x4c')]);return _0x271043[_0xd895('0x5d')](_0x454eae);}})[_0xd895('0x34')](function(_0x39285b){if(_0x39285b){_0x49efe1=_0x39285b[_0xd895('0x54')];if(!_0xb19fc7[_0xd895('0x3f')][_0xd895('0x44')](_0xd895('0x45'))){_0x454eae[_0xd895('0x46')]=qs[_0xd895('0x46')](_0xb19fc7[_0xd895('0x3f')]['limit']);_0x454eae[_0xd895('0x2d')]=qs[_0xd895('0x2d')](_0xb19fc7['query'][_0xd895('0x2d')]);}return _0x271043['getSubjects'](_0x454eae);}})[_0xd895('0x34')](function(_0x22d58b){if(_0x22d58b){return _0x22d58b?{'count':_0x49efe1,'rows':_0x22d58b}:null;}})[_0xd895('0x34')](respondWithResult(_0x4d3525,null))[_0xd895('0x27')](handleError(_0x4d3525,null));};exports[_0xd895('0x5e')]=function(_0x34882b,_0x23baba,_0x167f74){var _0x563f7d={};var _0x57b099={};var _0x4e25fb;var _0x320382;return db[_0xd895('0x4d')]['findOne']({'where':{'id':_0x34882b[_0xd895('0x52')]['id']}})[_0xd895('0x34')](handleEntityNotFound(_0x23baba,null))[_0xd895('0x34')](function(_0x48bd8c){if(_0x48bd8c){_0x4e25fb=_0x48bd8c;_0x57b099[_0xd895('0x3e')]=_[_0xd895('0x40')](db[_0xd895('0x5a')][_0xd895('0x3a')]);_0x57b099['query']=_[_0xd895('0x40')](_0x34882b[_0xd895('0x3f')]);_0x57b099['filters']=_[_0xd895('0x53')](_0x57b099[_0xd895('0x3e')],_0x57b099[_0xd895('0x3f')]);_0x563f7d[_0xd895('0x42')]=_[_0xd895('0x53')](_0x57b099[_0xd895('0x3e')],qs['fields'](_0x34882b[_0xd895('0x3f')][_0xd895('0x43')]));_0x563f7d[_0xd895('0x42')]=_0x563f7d[_0xd895('0x42')]['length']?_0x563f7d[_0xd895('0x42')]:_0x57b099[_0xd895('0x3e')];_0x563f7d[_0xd895('0x5b')]=qs[_0xd895('0x47')](_0x34882b['query'][_0xd895('0x47')]);_0x563f7d[_0xd895('0x49')]=qs['filters'](_[_0xd895('0x5c')](_0x34882b[_0xd895('0x3f')],_0x57b099['filters']));if(_0x34882b[_0xd895('0x3f')][_0xd895('0x48')]){_0x563f7d[_0xd895('0x49')]=_[_0xd895('0x4b')](_0x563f7d[_0xd895('0x49')],{'$or':_['map'](_0x563f7d[_0xd895('0x42')],function(_0x155aba){var _0x57b614={};_0x57b614[_0x155aba]={'$like':'%'+_0x34882b['query'][_0xd895('0x48')]+'%'};return _0x57b614;})});}_0x563f7d=_[_0xd895('0x4b')]({},_0x563f7d,_0x34882b[_0xd895('0x4c')]);return _0x4e25fb['getDescriptions'](_0x563f7d);}})['then'](function(_0x595607){if(_0x595607){_0x320382=_0x595607['length'];if(!_0x34882b[_0xd895('0x3f')]['hasOwnProperty']('nolimit')){_0x563f7d[_0xd895('0x46')]=qs[_0xd895('0x46')](_0x34882b['query'][_0xd895('0x46')]);_0x563f7d[_0xd895('0x2d')]=qs[_0xd895('0x2d')](_0x34882b['query'][_0xd895('0x2d')]);}return _0x4e25fb[_0xd895('0x5e')](_0x563f7d);}})['then'](function(_0x28a39c){if(_0x28a39c){return _0x28a39c?{'count':_0x320382,'rows':_0x28a39c}:null;}})[_0xd895('0x34')](respondWithResult(_0x23baba,null))[_0xd895('0x27')](handleError(_0x23baba,null));};
\ No newline at end of file
+var _0xfbf4=['merge','type','options','includeAll','findAll','catch','show','keys','include','find','create','body','params','findOne','ZohoField','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count','limit','set','Content-Range','apply','reject','save','destroy','stack','name','map','ZohoConfiguration','rawAttributes','fieldName','key','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','offset','order','sort','where','filter'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfbf4,0x6f));var _0x4fbf=function(_0x35c5c8,_0x1b671a){_0x35c5c8=_0x35c5c8-0x0;var _0x52f3cf=_0xfbf4[_0x35c5c8];return _0x52f3cf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4fbf('0x0'));var rimraf=require(_0x4fbf('0x1'));var zipdir=require(_0x4fbf('0x2'));var jsonpatch=require(_0x4fbf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4fbf('0x4'));var Mustache=require(_0x4fbf('0x5'));var util=require(_0x4fbf('0x6'));var path=require(_0x4fbf('0x7'));var sox=require(_0x4fbf('0x8'));var csv=require(_0x4fbf('0x9'));var ejs=require(_0x4fbf('0xa'));var fs=require('fs');var _=require(_0x4fbf('0xb'));var squel=require(_0x4fbf('0xc'));var crypto=require(_0x4fbf('0xd'));var jsforce=require(_0x4fbf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4fbf('0x9'));var querystring=require(_0x4fbf('0xf'));var Papa=require(_0x4fbf('0x10'));var Redis=require(_0x4fbf('0x11'));var authService=require(_0x4fbf('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fbf('0x13'));var logger=require(_0x4fbf('0x14'))('api');var utils=require(_0x4fbf('0x15'));var config=require(_0x4fbf('0x16'));var db=require(_0x4fbf('0x17'))['db'];var jayson=require(_0x4fbf('0x18'));var client=jayson[_0x4fbf('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x2dfdaf,_0xe9ccca,_0x46a7fa){if(_0x46a7fa){var _0x3f5cce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f5cce[_0x4fbf('0x1a')](_0xe9ccca)){return _0x2dfdaf;}else{throw new db['Sequelize'][(_0x4fbf('0x1b'))](_0x4fbf('0x1c'));}}else{return _0x2dfdaf;}}function respondWithRpcPromise(_0x4ec018,_0x295a83,_0x4307c7,_0x7db0c){return new BPromise(function(_0x40a2a2,_0x3370d4){var _0x182ae0=_0x7db0c||client;return _0x182ae0['request'](_0x4ec018,_0x4307c7)[_0x4fbf('0x1d')](function(_0x3a2fdd){logger[_0x4fbf('0x1e')](_0x4fbf('0x1f'),_0x295a83,_0x4fbf('0x20'));logger[_0x4fbf('0x21')](_0x4fbf('0x22'),_0x295a83,_0x4fbf('0x20'),JSON[_0x4fbf('0x23')](_0x3a2fdd));if(_0x3a2fdd['error']){if(_0x3a2fdd[_0x4fbf('0x24')][_0x4fbf('0x25')]===0x1f4){logger[_0x4fbf('0x24')](_0x4fbf('0x1f'),_0x295a83,_0x3a2fdd[_0x4fbf('0x24')][_0x4fbf('0x26')]);return _0x3370d4(_0x3a2fdd[_0x4fbf('0x24')]['message']);}logger['error'](_0x4fbf('0x1f'),_0x295a83,_0x3a2fdd['error'][_0x4fbf('0x26')]);return _0x40a2a2(_0x3a2fdd[_0x4fbf('0x24')][_0x4fbf('0x26')]);}else{logger[_0x4fbf('0x1e')](_0x4fbf('0x1f'),_0x295a83,'request\x20sent');_0x40a2a2(_0x3a2fdd[_0x4fbf('0x27')]['message']);}})['catch'](function(_0x4384b9){logger[_0x4fbf('0x24')](_0x4fbf('0x1f'),_0x295a83,_0x4384b9);_0x3370d4(_0x4384b9);});});}function respondWithStatusCode(_0x3a1c5e,_0xc3f577){_0xc3f577=_0xc3f577||0xcc;return function(_0x41721b){if(_0x41721b){return _0x3a1c5e[_0x4fbf('0x28')](_0xc3f577);}return _0x3a1c5e['status'](_0xc3f577)[_0x4fbf('0x29')]();};}function respondWithResult(_0x525ff2,_0x2c5c3a){_0x2c5c3a=_0x2c5c3a||0xc8;return function(_0x52a637){if(_0x52a637){return _0x525ff2[_0x4fbf('0x2a')](_0x2c5c3a)[_0x4fbf('0x2b')](_0x52a637);}};}function respondWithFilteredResult(_0x391a9f,_0x5b8875){return function(_0x57f127){if(_0x57f127){var _0x619d1f=_0x57f127[_0x4fbf('0x2c')],_0x105288=_0x5b8875['offset'],_0x1b6972=_0x5b8875['offset']+_0x5b8875[_0x4fbf('0x2d')],_0xc193e8;if(_0x1b6972>=_0x619d1f){_0x1b6972=_0x619d1f;_0xc193e8=0xc8;}else{_0xc193e8=0xce;}_0x391a9f['status'](_0xc193e8);return _0x391a9f[_0x4fbf('0x2e')](_0x4fbf('0x2f'),_0x105288+'-'+_0x1b6972+'/'+_0x619d1f)[_0x4fbf('0x2b')](_0x57f127);}return null;};}function patchUpdates(_0x2f6b21){return function(_0x5fa1bb){try{jsonpatch[_0x4fbf('0x30')](_0x5fa1bb,_0x2f6b21,!![]);}catch(_0x315a41){return BPromise[_0x4fbf('0x31')](_0x315a41);}return _0x5fa1bb[_0x4fbf('0x32')]();};}function saveUpdates(_0x30ec06,_0x31e5ea){return function(_0x284154){if(_0x284154){return _0x284154['update'](_0x30ec06)['then'](function(_0x4158a6){return _0x4158a6;});}return null;};}function removeEntity(_0x45c5b4,_0x47825c){return function(_0x31f70c){if(_0x31f70c){return _0x31f70c[_0x4fbf('0x33')]()[_0x4fbf('0x1d')](function(){_0x45c5b4[_0x4fbf('0x2a')](0xcc)[_0x4fbf('0x29')]();});}};}function handleEntityNotFound(_0x703f34,_0x88fa01){return function(_0x3acf72){if(!_0x3acf72){_0x703f34[_0x4fbf('0x28')](0x194);}return _0x3acf72;};}function handleError(_0xb8e56e,_0x718e7d){_0x718e7d=_0x718e7d||0x1f4;return function(_0x1375fa){logger['error'](_0x1375fa[_0x4fbf('0x34')]);if(_0x1375fa[_0x4fbf('0x35')]){delete _0x1375fa[_0x4fbf('0x35')];}_0xb8e56e[_0x4fbf('0x2a')](_0x718e7d)['send'](_0x1375fa);};}exports['index']=function(_0x226658,_0x3a5cc4){var _0x3d0d4b={},_0x26cdfe={},_0xa9e5d3={'count':0x0,'rows':[]};var _0x3b3182=_[_0x4fbf('0x36')](db[_0x4fbf('0x37')][_0x4fbf('0x38')],function(_0x1c3690){return{'name':_0x1c3690[_0x4fbf('0x39')],'type':_0x1c3690['type'][_0x4fbf('0x3a')]};});_0x26cdfe['model']=_[_0x4fbf('0x36')](_0x3b3182,_0x4fbf('0x35'));_0x26cdfe[_0x4fbf('0x3b')]=_['keys'](_0x226658[_0x4fbf('0x3b')]);_0x26cdfe[_0x4fbf('0x3c')]=_['intersection'](_0x26cdfe['model'],_0x26cdfe[_0x4fbf('0x3b')]);_0x3d0d4b[_0x4fbf('0x3d')]=_[_0x4fbf('0x3e')](_0x26cdfe['model'],qs[_0x4fbf('0x3f')](_0x226658[_0x4fbf('0x3b')]['fields']));_0x3d0d4b[_0x4fbf('0x3d')]=_0x3d0d4b[_0x4fbf('0x3d')][_0x4fbf('0x40')]?_0x3d0d4b['attributes']:_0x26cdfe[_0x4fbf('0x41')];if(!_0x226658['query'][_0x4fbf('0x42')](_0x4fbf('0x43'))){_0x3d0d4b[_0x4fbf('0x2d')]=qs[_0x4fbf('0x2d')](_0x226658['query'][_0x4fbf('0x2d')]);_0x3d0d4b[_0x4fbf('0x44')]=qs[_0x4fbf('0x44')](_0x226658[_0x4fbf('0x3b')][_0x4fbf('0x44')]);}_0x3d0d4b[_0x4fbf('0x45')]=qs[_0x4fbf('0x46')](_0x226658['query'][_0x4fbf('0x46')]);_0x3d0d4b[_0x4fbf('0x47')]=qs[_0x4fbf('0x3c')](_['pick'](_0x226658['query'],_0x26cdfe['filters']),_0x3b3182);if(_0x226658[_0x4fbf('0x3b')][_0x4fbf('0x48')]){_0x3d0d4b[_0x4fbf('0x47')]=_[_0x4fbf('0x49')](_0x3d0d4b[_0x4fbf('0x47')],{'$or':_[_0x4fbf('0x36')](_0x3b3182,function(_0x3363ce){if(_0x3363ce[_0x4fbf('0x4a')]!=='VIRTUAL'){var _0x1ababc={};_0x1ababc[_0x3363ce['name']]={'$like':'%'+_0x226658[_0x4fbf('0x3b')][_0x4fbf('0x48')]+'%'};return _0x1ababc;}})});}_0x3d0d4b=_['merge']({},_0x3d0d4b,_0x226658[_0x4fbf('0x4b')]);var _0x1dded7={'where':_0x3d0d4b[_0x4fbf('0x47')]};return db[_0x4fbf('0x37')][_0x4fbf('0x2c')](_0x1dded7)['then'](function(_0x102588){_0xa9e5d3[_0x4fbf('0x2c')]=_0x102588;if(_0x226658[_0x4fbf('0x3b')][_0x4fbf('0x4c')]){_0x3d0d4b['include']=[{'all':!![]}];}return db[_0x4fbf('0x37')][_0x4fbf('0x4d')](_0x3d0d4b);})[_0x4fbf('0x1d')](function(_0x3965ef){_0xa9e5d3['rows']=_0x3965ef;return _0xa9e5d3;})[_0x4fbf('0x1d')](respondWithFilteredResult(_0x3a5cc4,_0x3d0d4b))[_0x4fbf('0x4e')](handleError(_0x3a5cc4,null));};exports[_0x4fbf('0x4f')]=function(_0x2e8189,_0x5b230c){var _0x4a15af={'raw':![],'where':{'id':_0x2e8189['params']['id']}},_0x20e54f={};_0x20e54f[_0x4fbf('0x41')]=_[_0x4fbf('0x50')](db['ZohoConfiguration'][_0x4fbf('0x38')]);_0x20e54f[_0x4fbf('0x3b')]=_[_0x4fbf('0x50')](_0x2e8189[_0x4fbf('0x3b')]);_0x20e54f[_0x4fbf('0x3c')]=_[_0x4fbf('0x3e')](_0x20e54f[_0x4fbf('0x41')],_0x20e54f['query']);_0x4a15af[_0x4fbf('0x3d')]=_[_0x4fbf('0x3e')](_0x20e54f[_0x4fbf('0x41')],qs[_0x4fbf('0x3f')](_0x2e8189[_0x4fbf('0x3b')]['fields']));_0x4a15af['attributes']=_0x4a15af[_0x4fbf('0x3d')][_0x4fbf('0x40')]?_0x4a15af[_0x4fbf('0x3d')]:_0x20e54f['model'];if(_0x2e8189[_0x4fbf('0x3b')][_0x4fbf('0x4c')]){_0x4a15af[_0x4fbf('0x51')]=[{'all':!![]}];}_0x4a15af=_[_0x4fbf('0x49')]({},_0x4a15af,_0x2e8189['options']);return db[_0x4fbf('0x37')][_0x4fbf('0x52')](_0x4a15af)[_0x4fbf('0x1d')](handleEntityNotFound(_0x5b230c,null))[_0x4fbf('0x1d')](respondWithResult(_0x5b230c,null))[_0x4fbf('0x4e')](handleError(_0x5b230c,null));};exports[_0x4fbf('0x53')]=function(_0x1dc004,_0x4a201e){return db[_0x4fbf('0x37')][_0x4fbf('0x53')](_0x1dc004[_0x4fbf('0x54')],{})[_0x4fbf('0x1d')](respondWithResult(_0x4a201e,0xc9))[_0x4fbf('0x4e')](handleError(_0x4a201e,null));};exports['update']=function(_0x3a0f08,_0x3b5820){if(_0x3a0f08['body']['id']){delete _0x3a0f08['body']['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x3a0f08[_0x4fbf('0x55')]['id']}})[_0x4fbf('0x1d')](handleEntityNotFound(_0x3b5820,null))[_0x4fbf('0x1d')](saveUpdates(_0x3a0f08[_0x4fbf('0x54')],null))['then'](respondWithResult(_0x3b5820,null))[_0x4fbf('0x4e')](handleError(_0x3b5820,null));};exports['destroy']=function(_0x22b533,_0x47bb6f){return db[_0x4fbf('0x37')][_0x4fbf('0x52')]({'where':{'id':_0x22b533['params']['id']}})[_0x4fbf('0x1d')](handleEntityNotFound(_0x47bb6f,null))['then'](removeEntity(_0x47bb6f,null))[_0x4fbf('0x4e')](handleError(_0x47bb6f,null));};exports['getFields']=function(_0x50c814,_0x2e04a9,_0x2d4f36){var _0x196bfe={};var _0x19b671={};var _0x23a3f2;var _0x3fcfb0;return db['ZohoConfiguration'][_0x4fbf('0x56')]({'where':{'id':_0x50c814[_0x4fbf('0x55')]['id']}})[_0x4fbf('0x1d')](handleEntityNotFound(_0x2e04a9,null))[_0x4fbf('0x1d')](function(_0x456ea0){if(_0x456ea0){_0x23a3f2=_0x456ea0;_0x19b671[_0x4fbf('0x41')]=_['keys'](db[_0x4fbf('0x57')][_0x4fbf('0x38')]);_0x19b671['query']=_[_0x4fbf('0x50')](_0x50c814['query']);_0x19b671['filters']=_[_0x4fbf('0x3e')](_0x19b671[_0x4fbf('0x41')],_0x19b671[_0x4fbf('0x3b')]);_0x196bfe[_0x4fbf('0x3d')]=_[_0x4fbf('0x3e')](_0x19b671[_0x4fbf('0x41')],qs[_0x4fbf('0x3f')](_0x50c814['query'][_0x4fbf('0x3f')]));_0x196bfe[_0x4fbf('0x3d')]=_0x196bfe[_0x4fbf('0x3d')]['length']?_0x196bfe[_0x4fbf('0x3d')]:_0x19b671[_0x4fbf('0x41')];_0x196bfe[_0x4fbf('0x45')]=qs[_0x4fbf('0x46')](_0x50c814[_0x4fbf('0x3b')][_0x4fbf('0x46')]);_0x196bfe[_0x4fbf('0x47')]=qs[_0x4fbf('0x3c')](_[_0x4fbf('0x58')](_0x50c814[_0x4fbf('0x3b')],_0x19b671[_0x4fbf('0x3c')]));if(_0x50c814['query'][_0x4fbf('0x48')]){_0x196bfe[_0x4fbf('0x47')]=_['merge'](_0x196bfe[_0x4fbf('0x47')],{'$or':_['map'](_0x196bfe[_0x4fbf('0x3d')],function(_0x10f762){var _0x402122={};_0x402122[_0x10f762]={'$like':'%'+_0x50c814[_0x4fbf('0x3b')][_0x4fbf('0x48')]+'%'};return _0x402122;})});}_0x196bfe=_[_0x4fbf('0x49')]({},_0x196bfe,_0x50c814[_0x4fbf('0x4b')]);return _0x23a3f2['getFields'](_0x196bfe);}})[_0x4fbf('0x1d')](function(_0x1bcb5a){if(_0x1bcb5a){_0x3fcfb0=_0x1bcb5a[_0x4fbf('0x40')];if(!_0x50c814[_0x4fbf('0x3b')][_0x4fbf('0x42')](_0x4fbf('0x43'))){_0x196bfe['limit']=qs[_0x4fbf('0x2d')](_0x50c814['query'][_0x4fbf('0x2d')]);_0x196bfe[_0x4fbf('0x44')]=qs[_0x4fbf('0x44')](_0x50c814[_0x4fbf('0x3b')][_0x4fbf('0x44')]);}return _0x23a3f2[_0x4fbf('0x59')](_0x196bfe);}})['then'](function(_0x3fbf46){if(_0x3fbf46){return _0x3fbf46?{'count':_0x3fcfb0,'rows':_0x3fbf46}:null;}})[_0x4fbf('0x1d')](respondWithResult(_0x2e04a9,null))[_0x4fbf('0x4e')](handleError(_0x2e04a9,null));};exports[_0x4fbf('0x5a')]=function(_0x5955b9,_0x318a0d,_0x50edc8){var _0x3c8c23={};var _0xcbce8d={};var _0x25cbd2;var _0x5c411c;return db[_0x4fbf('0x37')]['findOne']({'where':{'id':_0x5955b9[_0x4fbf('0x55')]['id']}})[_0x4fbf('0x1d')](handleEntityNotFound(_0x318a0d,null))['then'](function(_0x39ca60){if(_0x39ca60){_0x25cbd2=_0x39ca60;_0xcbce8d[_0x4fbf('0x41')]=_[_0x4fbf('0x50')](db[_0x4fbf('0x57')][_0x4fbf('0x38')]);_0xcbce8d[_0x4fbf('0x3b')]=_['keys'](_0x5955b9[_0x4fbf('0x3b')]);_0xcbce8d[_0x4fbf('0x3c')]=_[_0x4fbf('0x3e')](_0xcbce8d[_0x4fbf('0x41')],_0xcbce8d[_0x4fbf('0x3b')]);_0x3c8c23[_0x4fbf('0x3d')]=_['intersection'](_0xcbce8d[_0x4fbf('0x41')],qs[_0x4fbf('0x3f')](_0x5955b9['query'][_0x4fbf('0x3f')]));_0x3c8c23[_0x4fbf('0x3d')]=_0x3c8c23[_0x4fbf('0x3d')][_0x4fbf('0x40')]?_0x3c8c23[_0x4fbf('0x3d')]:_0xcbce8d[_0x4fbf('0x41')];_0x3c8c23['order']=qs[_0x4fbf('0x46')](_0x5955b9[_0x4fbf('0x3b')][_0x4fbf('0x46')]);_0x3c8c23['where']=qs['filters'](_['pick'](_0x5955b9['query'],_0xcbce8d['filters']));if(_0x5955b9[_0x4fbf('0x3b')][_0x4fbf('0x48')]){_0x3c8c23[_0x4fbf('0x47')]=_[_0x4fbf('0x49')](_0x3c8c23[_0x4fbf('0x47')],{'$or':_[_0x4fbf('0x36')](_0x3c8c23[_0x4fbf('0x3d')],function(_0x1cf581){var _0x5519c9={};_0x5519c9[_0x1cf581]={'$like':'%'+_0x5955b9['query'][_0x4fbf('0x48')]+'%'};return _0x5519c9;})});}_0x3c8c23=_[_0x4fbf('0x49')]({},_0x3c8c23,_0x5955b9['options']);return _0x25cbd2[_0x4fbf('0x5a')](_0x3c8c23);}})[_0x4fbf('0x1d')](function(_0x402414){if(_0x402414){_0x5c411c=_0x402414[_0x4fbf('0x40')];if(!_0x5955b9[_0x4fbf('0x3b')][_0x4fbf('0x42')](_0x4fbf('0x43'))){_0x3c8c23[_0x4fbf('0x2d')]=qs[_0x4fbf('0x2d')](_0x5955b9[_0x4fbf('0x3b')]['limit']);_0x3c8c23[_0x4fbf('0x44')]=qs[_0x4fbf('0x44')](_0x5955b9[_0x4fbf('0x3b')][_0x4fbf('0x44')]);}return _0x25cbd2[_0x4fbf('0x5a')](_0x3c8c23);}})['then'](function(_0xd27506){if(_0xd27506){return _0xd27506?{'count':_0x5c411c,'rows':_0xd27506}:null;}})['then'](respondWithResult(_0x318a0d,null))['catch'](handleError(_0x318a0d,null));};exports[_0x4fbf('0x5b')]=function(_0xb8529b,_0x4ccbdb,_0x3b5cab){var _0x553dd8={};var _0x40939f={};var _0x2f5b9b;var _0x5bb4bd;return db[_0x4fbf('0x37')]['findOne']({'where':{'id':_0xb8529b[_0x4fbf('0x55')]['id']}})[_0x4fbf('0x1d')](handleEntityNotFound(_0x4ccbdb,null))[_0x4fbf('0x1d')](function(_0x524e0a){if(_0x524e0a){_0x2f5b9b=_0x524e0a;_0x40939f[_0x4fbf('0x41')]=_[_0x4fbf('0x50')](db[_0x4fbf('0x57')][_0x4fbf('0x38')]);_0x40939f[_0x4fbf('0x3b')]=_['keys'](_0xb8529b['query']);_0x40939f['filters']=_[_0x4fbf('0x3e')](_0x40939f[_0x4fbf('0x41')],_0x40939f[_0x4fbf('0x3b')]);_0x553dd8[_0x4fbf('0x3d')]=_[_0x4fbf('0x3e')](_0x40939f[_0x4fbf('0x41')],qs[_0x4fbf('0x3f')](_0xb8529b[_0x4fbf('0x3b')][_0x4fbf('0x3f')]));_0x553dd8[_0x4fbf('0x3d')]=_0x553dd8[_0x4fbf('0x3d')]['length']?_0x553dd8['attributes']:_0x40939f[_0x4fbf('0x41')];_0x553dd8[_0x4fbf('0x45')]=qs[_0x4fbf('0x46')](_0xb8529b[_0x4fbf('0x3b')][_0x4fbf('0x46')]);_0x553dd8[_0x4fbf('0x47')]=qs['filters'](_[_0x4fbf('0x58')](_0xb8529b[_0x4fbf('0x3b')],_0x40939f[_0x4fbf('0x3c')]));if(_0xb8529b[_0x4fbf('0x3b')]['filter']){_0x553dd8[_0x4fbf('0x47')]=_[_0x4fbf('0x49')](_0x553dd8[_0x4fbf('0x47')],{'$or':_[_0x4fbf('0x36')](_0x553dd8['attributes'],function(_0x1bea00){var _0x485171={};_0x485171[_0x1bea00]={'$like':'%'+_0xb8529b['query']['filter']+'%'};return _0x485171;})});}_0x553dd8=_['merge']({},_0x553dd8,_0xb8529b[_0x4fbf('0x4b')]);return _0x2f5b9b[_0x4fbf('0x5b')](_0x553dd8);}})[_0x4fbf('0x1d')](function(_0x3fb15a){if(_0x3fb15a){_0x5bb4bd=_0x3fb15a[_0x4fbf('0x40')];if(!_0xb8529b[_0x4fbf('0x3b')]['hasOwnProperty'](_0x4fbf('0x43'))){_0x553dd8[_0x4fbf('0x2d')]=qs['limit'](_0xb8529b[_0x4fbf('0x3b')][_0x4fbf('0x2d')]);_0x553dd8['offset']=qs[_0x4fbf('0x44')](_0xb8529b[_0x4fbf('0x3b')][_0x4fbf('0x44')]);}return _0x2f5b9b[_0x4fbf('0x5b')](_0x553dd8);}})[_0x4fbf('0x1d')](function(_0x136a60){if(_0x136a60){return _0x136a60?{'count':_0x5bb4bd,'rows':_0x136a60}:null;}})[_0x4fbf('0x1d')](respondWithResult(_0x4ccbdb,null))[_0x4fbf('0x4e')](handleError(_0x4ccbdb,null));};
\ No newline at end of file
index 8417ae1..c06ea9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae8e=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x1e1f97,_0x2f6925){var _0x1e45fb=function(_0x2389ac){while(--_0x2389ac){_0x1e1f97['push'](_0x1e1f97['shift']());}};_0x1e45fb(++_0x2f6925);}(_0xae8e,0x10d));var _0xeae8=function(_0x4d8206,_0x138a64){_0x4d8206=_0x4d8206-0x0;var _0xe428e5=_0xae8e[_0x4d8206];return _0xe428e5;};'use strict';var _=require(_0xeae8('0x0'));var util=require(_0xeae8('0x1'));var logger=require(_0xeae8('0x2'))(_0xeae8('0x3'));var moment=require(_0xeae8('0x4'));var BPromise=require(_0xeae8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeae8('0x6'));var config=require(_0xeae8('0x7'));var attributes=require(_0xeae8('0x8'));module[_0xeae8('0x9')]=function(_0x3076f2,_0x139e32){return _0x3076f2[_0xeae8('0xa')](_0xeae8('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x21fe=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','int_zoho_configurations'];(function(_0x49a418,_0x2f23c6){var _0x4b9a82=function(_0x1f8501){while(--_0x1f8501){_0x49a418['push'](_0x49a418['shift']());}};_0x4b9a82(++_0x2f23c6);}(_0x21fe,0x19a));var _0xe21f=function(_0x574bb0,_0x3c05e7){_0x574bb0=_0x574bb0-0x0;var _0xc8e20c=_0x21fe[_0x574bb0];return _0xc8e20c;};'use strict';var _=require(_0xe21f('0x0'));var util=require('util');var logger=require(_0xe21f('0x1'))(_0xe21f('0x2'));var moment=require('moment');var BPromise=require(_0xe21f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe21f('0x4'));var rimraf=require(_0xe21f('0x5'));var config=require(_0xe21f('0x6'));var attributes=require(_0xe21f('0x7'));module['exports']=function(_0x57bb35,_0x30d8e5){return _0x57bb35[_0xe21f('0x8')]('ZohoConfiguration',attributes,{'tableName':_0xe21f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2c328fd..8d49715 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb48b=['../../config/environment','jayson/promise','client','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2fbe5f,_0x4c5c13){var _0x21db60=function(_0x467893){while(--_0x467893){_0x2fbe5f['push'](_0x2fbe5f['shift']());}};_0x21db60(++_0x4c5c13);}(_0xb48b,0xcf));var _0xbb48=function(_0x561a85,_0x36d66a){_0x561a85=_0x561a85-0x0;var _0x1520a3=_0xb48b[_0x561a85];return _0x1520a3;};'use strict';var _=require(_0xbb48('0x0'));var util=require(_0xbb48('0x1'));var moment=require(_0xbb48('0x2'));var BPromise=require(_0xbb48('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb48('0x4'));var db=require(_0xbb48('0x5'))['db'];var utils=require(_0xbb48('0x6'));var logger=require(_0xbb48('0x7'))(_0xbb48('0x8'));var config=require(_0xbb48('0x9'));var jayson=require(_0xbb48('0xa'));var client=jayson[_0xbb48('0xb')][_0xbb48('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44cd4c,_0x5a8cdb,_0x486790){return new BPromise(function(_0x2f8dda,_0x110e87){return client['request'](_0x44cd4c,_0x486790)[_0xbb48('0xd')](function(_0x1248c9){logger['info'](_0xbb48('0xe'),_0x5a8cdb,_0xbb48('0xf'));logger['debug'](_0xbb48('0x10'),_0x5a8cdb,_0xbb48('0xf'),JSON[_0xbb48('0x11')](_0x1248c9));if(_0x1248c9[_0xbb48('0x12')]){if(_0x1248c9[_0xbb48('0x12')][_0xbb48('0x13')]===0x1f4){logger[_0xbb48('0x12')](_0xbb48('0xe'),_0x5a8cdb,_0x1248c9[_0xbb48('0x12')][_0xbb48('0x14')]);return _0x110e87(_0x1248c9[_0xbb48('0x12')][_0xbb48('0x14')]);}logger[_0xbb48('0x12')](_0xbb48('0xe'),_0x5a8cdb,_0x1248c9[_0xbb48('0x12')][_0xbb48('0x14')]);return _0x2f8dda(_0x1248c9[_0xbb48('0x12')][_0xbb48('0x14')]);}else{logger[_0xbb48('0x15')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a8cdb,_0xbb48('0xf'));_0x2f8dda(_0x1248c9[_0xbb48('0x16')][_0xbb48('0x14')]);}})[_0xbb48('0x17')](function(_0x2802f9){logger[_0xbb48('0x12')](_0xbb48('0xe'),_0x5a8cdb,_0x2802f9);_0x110e87(_0x2802f9);});});}
\ No newline at end of file
+var _0xa0b6=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0xa0b6,0x1a3));var _0x6a0b=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xa0b6[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x6a0b('0x0'));var util=require(_0x6a0b('0x1'));var moment=require(_0x6a0b('0x2'));var BPromise=require(_0x6a0b('0x3'));var rs=require(_0x6a0b('0x4'));var fs=require('fs');var Redis=require(_0x6a0b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a0b('0x6'));var logger=require(_0x6a0b('0x7'))('rpc');var config=require(_0x6a0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a0b('0x9')][_0x6a0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10f2fe,_0x347e35,_0x41bd4c){return new BPromise(function(_0x1e7791,_0x551ebb){return client['request'](_0x10f2fe,_0x41bd4c)['then'](function(_0x4ea6d9){logger[_0x6a0b('0xb')](_0x6a0b('0xc'),_0x347e35,_0x6a0b('0xd'));logger[_0x6a0b('0xe')](_0x6a0b('0xf'),_0x347e35,_0x6a0b('0xd'),JSON[_0x6a0b('0x10')](_0x4ea6d9));if(_0x4ea6d9[_0x6a0b('0x11')]){if(_0x4ea6d9['error']['code']===0x1f4){logger[_0x6a0b('0x11')](_0x6a0b('0xc'),_0x347e35,_0x4ea6d9[_0x6a0b('0x11')][_0x6a0b('0x12')]);return _0x551ebb(_0x4ea6d9[_0x6a0b('0x11')]['message']);}logger[_0x6a0b('0x11')](_0x6a0b('0xc'),_0x347e35,_0x4ea6d9[_0x6a0b('0x11')][_0x6a0b('0x12')]);return _0x1e7791(_0x4ea6d9[_0x6a0b('0x11')]['message']);}else{logger[_0x6a0b('0xb')](_0x6a0b('0xc'),_0x347e35,_0x6a0b('0xd'));_0x1e7791(_0x4ea6d9[_0x6a0b('0x13')]['message']);}})[_0x6a0b('0x14')](function(_0x253c8f){logger[_0x6a0b('0x11')](_0x6a0b('0xc'),_0x347e35,_0x253c8f);_0x551ebb(_0x253c8f);});});}
\ No newline at end of file
index 4b6b484..a74bc91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ace=['index','show','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x3d77cb,_0x149f6f){var _0xe5e6f5=function(_0x23cb2d){while(--_0x23cb2d){_0x3d77cb['push'](_0x3d77cb['shift']());}};_0xe5e6f5(++_0x149f6f);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x267484,_0x3eb131){_0x267484=_0x267484-0x0;var _0x14a356=_0x8ace[_0x267484];return _0x14a356;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var auth=require(_0xe8ac('0x6'));var interaction=require(_0xe8ac('0x7'));var config=require(_0xe8ac('0x8'));var controller=require(_0xe8ac('0x9'));router[_0xe8ac('0xa')]('/',auth[_0xe8ac('0xb')](),controller[_0xe8ac('0xc')]);router[_0xe8ac('0xa')]('/:id',auth[_0xe8ac('0xb')](),controller[_0xe8ac('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe8ac('0xe')]);router['put'](_0xe8ac('0xf'),auth[_0xe8ac('0xb')](),controller[_0xe8ac('0x10')]);router[_0xe8ac('0x11')](_0xe8ac('0xf'),auth[_0xe8ac('0xb')](),controller['destroy']);module[_0xe8ac('0x12')]=router;
\ No newline at end of file
+var _0xbbbc=['../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x165857,_0x7bfc15){_0x165857=_0x165857-0x0;var _0x37e412=_0xbbbc[_0x165857];return _0x37e412;};'use strict';var multer=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var path=require(_0xcbbb('0x2'));var timeout=require(_0xcbbb('0x3'));var express=require(_0xcbbb('0x4'));var router=express[_0xcbbb('0x5')]();var auth=require(_0xcbbb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcbbb('0x7'));var controller=require(_0xcbbb('0x8'));router[_0xcbbb('0x9')]('/',auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xb')]);router['get'](_0xcbbb('0xc'),auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xd')]);router[_0xcbbb('0xe')]('/',auth[_0xcbbb('0xa')](),controller[_0xcbbb('0xf')]);router[_0xcbbb('0x10')]('/:id',auth[_0xcbbb('0xa')](),controller['update']);router['delete'](_0xcbbb('0xc'),auth['isAuthenticated'](),controller[_0xcbbb('0x11')]);module['exports']=router;
\ No newline at end of file
index 1173cff..b4cc826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27c5=['STRING','ENUM','string','variable','keyValue'];(function(_0x25a028,_0x5a5750){var _0x24b287=function(_0x594490){while(--_0x594490){_0x25a028['push'](_0x25a028['shift']());}};_0x24b287(++_0x5a5750);}(_0x27c5,0x173));var _0x527c=function(_0x448970,_0x44b9b4){_0x448970=_0x448970-0x0;var _0x2fa420=_0x27c5[_0x448970];return _0x2fa420;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x527c('0x0')](_0x527c('0x1'),_0x527c('0x2'),'customVariable',_0x527c('0x3')),'defaultValue':_0x527c('0x1')},'content':{'type':Sequelize[_0x527c('0x4')]},'key':{'type':Sequelize[_0x527c('0x4')]},'keyType':{'type':Sequelize[_0x527c('0x0')](_0x527c('0x1'),_0x527c('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x527c('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x527c('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x527c('0x4')]}};
\ No newline at end of file
+var _0x1e6c=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x4dd6f7,_0x5c8872){var _0x3538ff=function(_0x597230){while(--_0x597230){_0x4dd6f7['push'](_0x4dd6f7['shift']());}};_0x3538ff(++_0x5c8872);}(_0x1e6c,0x11a));var _0xc1e6=function(_0x1a6007,_0x350755){_0x1a6007=_0x1a6007-0x0;var _0x120665=_0x1e6c[_0x1a6007];return _0x120665;};'use strict';var Sequelize=require(_0xc1e6('0x0'));module['exports']={'type':{'type':Sequelize[_0xc1e6('0x1')](_0xc1e6('0x2'),_0xc1e6('0x3'),_0xc1e6('0x4'),_0xc1e6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc1e6('0x6')]},'keyType':{'type':Sequelize[_0xc1e6('0x1')](_0xc1e6('0x2'),_0xc1e6('0x3'),_0xc1e6('0x4'))},'keyContent':{'type':Sequelize[_0xc1e6('0x6')]},'idField':{'type':Sequelize[_0xc1e6('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc1e6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0f09015..2e24e81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x1a872c,_0x32b595){var _0x56e7e6=function(_0xcecb05){while(--_0xcecb05){_0x1a872c['push'](_0x1a872c['shift']());}};_0x56e7e6(++_0x32b595);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x3d9ce8,_0xd8d033){var _0xd1947c=function(_0x777125){while(--_0x777125){_0x3d9ce8['push'](_0x3d9ce8['shift']());}};_0xd1947c(++_0xd8d033);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
index 5aec1af..7f51f9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde1e=['api','moment','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x2e65c3,_0x37b8f2){var _0x27dea6=function(_0x535cdd){while(--_0x535cdd){_0x2e65c3['push'](_0x2e65c3['shift']());}};_0x27dea6(++_0x37b8f2);}(_0xde1e,0x177));var _0xede1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xde1e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xede1('0x0'));var util=require(_0xede1('0x1'));var logger=require(_0xede1('0x2'))(_0xede1('0x3'));var moment=require(_0xede1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xede1('0x5'));var rimraf=require(_0xede1('0x6'));var config=require(_0xede1('0x7'));var attributes=require(_0xede1('0x8'));module[_0xede1('0x9')]=function(_0xf72874,_0x41b141){return _0xf72874[_0xede1('0xa')]('ZohoField',attributes,{'tableName':_0xede1('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xede1('0xc'),_0xede1('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2c4=['bluebird','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','moment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe2c4,0x177));var _0x4e2c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xe2c4[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x4e2c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4e2c('0x1'));var BPromise=require(_0x4e2c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e2c('0x3'));var rimraf=require(_0x4e2c('0x4'));var config=require('../../config/environment');var attributes=require(_0x4e2c('0x5'));module[_0x4e2c('0x6')]=function(_0x6615d0,_0x3003a1){return _0x6615d0[_0x4e2c('0x7')](_0x4e2c('0x8'),attributes,{'tableName':_0x4e2c('0x9'),'paranoid':![],'indexes':[{'name':_0x4e2c('0xa'),'fields':[_0x4e2c('0xb'),_0x4e2c('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6168d43..a49c7c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec6=['then','info','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0xeec6,0x1c2));var _0x6eec=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xeec6[_0xca1f0e];return _0x35e4ef;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('ZohoField,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});}
\ No newline at end of file
+var _0x17ba=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3bdea8,_0x4355d9){var _0x4ddf93=function(_0x322516){while(--_0x322516){_0x3bdea8['push'](_0x3bdea8['shift']());}};_0x4ddf93(++_0x4355d9);}(_0x17ba,0xab));var _0xa17b=function(_0x26c75a,_0x42e035){_0x26c75a=_0x26c75a-0x0;var _0x52ee3e=_0x17ba[_0x26c75a];return _0x52ee3e;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d43,_0x1957be,_0x57f9cd){return new BPromise(function(_0x2ca4d3,_0x17d1d2){return client[_0xa17b('0xd')](_0x2e3d43,_0x57f9cd)[_0xa17b('0xe')](function(_0x15bdfc){logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));logger[_0xa17b('0x11')](_0xa17b('0x12'),_0x1957be,_0xa17b('0x10'),JSON[_0xa17b('0x13')](_0x15bdfc));if(_0x15bdfc[_0xa17b('0x14')]){if(_0x15bdfc['error'][_0xa17b('0x15')]===0x1f4){logger[_0xa17b('0x14')](_0xa17b('0xf'),_0x1957be,_0x15bdfc['error'][_0xa17b('0x16')]);return _0x17d1d2(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}logger[_0xa17b('0x14')]('ZohoField,\x20%s,\x20%s',_0x1957be,_0x15bdfc[_0xa17b('0x14')]['message']);return _0x2ca4d3(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}else{logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));_0x2ca4d3(_0x15bdfc[_0xa17b('0x17')][_0xa17b('0x16')]);}})['catch'](function(_0x98a295){logger['error']('ZohoField,\x20%s,\x20%s',_0x1957be,_0x98a295);_0x17d1d2(_0x98a295);});});}
\ No newline at end of file
index d4b7458..dad70ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf083=['multer','util','connect-timeout','express','Router','../../components/interaction/service','exports'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0xf083,0x150));var _0x3f08=function(_0x1d60fa,_0x448ef6){_0x1d60fa=_0x1d60fa-0x0;var _0x331884=_0xf083[_0x1d60fa];return _0x331884;};'use strict';var multer=require(_0x3f08('0x0'));var util=require(_0x3f08('0x1'));var path=require('path');var timeout=require(_0x3f08('0x2'));var express=require(_0x3f08('0x3'));var router=express[_0x3f08('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3f08('0x5'));var config=require('../../config/environment');module[_0x3f08('0x6')]=router;
\ No newline at end of file
+var _0x354a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout'];(function(_0x53aa24,_0x1856d1){var _0x1575bb=function(_0x248b33){while(--_0x248b33){_0x53aa24['push'](_0x53aa24['shift']());}};_0x1575bb(++_0x1856d1);}(_0x354a,0x1ec));var _0xa354=function(_0x15c166,_0xc6050f){_0x15c166=_0x15c166-0x0;var _0x55987e=_0x354a[_0x15c166];return _0x55987e;};'use strict';var multer=require('multer');var util=require(_0xa354('0x0'));var path=require(_0xa354('0x1'));var timeout=require(_0xa354('0x2'));var express=require(_0xa354('0x3'));var router=express[_0xa354('0x4')]();var auth=require(_0xa354('0x5'));var interaction=require(_0xa354('0x6'));var config=require(_0xa354('0x7'));module[_0xa354('0x8')]=router;
\ No newline at end of file
index d3abbb0..458cdbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ee7=['unique_name_and_version','STRING','app.js','BOOLEAN','state','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3ee7,0x6e));var _0x73ee=function(_0x53b135,_0x3aa0d3){_0x53b135=_0x53b135-0x0;var _0x56e52f=_0x3ee7[_0x53b135];return _0x56e52f;};'use strict';var Sequelize=require(_0x73ee('0x0'));module[_0x73ee('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x73ee('0x2')},'version':{'type':Sequelize[_0x73ee('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x73ee('0x3')],'defaultValue':_0x73ee('0x4')},'filename':{'type':Sequelize[_0x73ee('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x73ee('0x3')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x73ee('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x73ee('0x3')]},'state':{'type':Sequelize[_0x73ee('0x3')],'unique':_0x73ee('0x6')},'description':{'type':Sequelize[_0x73ee('0x3')]},'title':{'type':Sequelize[_0x73ee('0x3')]},'remoteUri':{'type':Sequelize[_0x73ee('0x3')]},'link':{'type':Sequelize[_0x73ee('0x3')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x694f=['INTEGER','state','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x552e6a,_0x249b42){var _0x1c38bd=function(_0x595987){while(--_0x595987){_0x552e6a['push'](_0x552e6a['shift']());}};_0x1c38bd(++_0x249b42);}(_0x694f,0x160));var _0xf694=function(_0xd743d0,_0x40aa03){_0xd743d0=_0xd743d0-0x0;var _0x41ac5e=_0x694f[_0xd743d0];return _0x41ac5e;};'use strict';var Sequelize=require(_0xf694('0x0'));module[_0xf694('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf694('0x2')},'version':{'type':Sequelize[_0xf694('0x3')],'allowNull':![],'unique':_0xf694('0x2')},'main':{'type':Sequelize[_0xf694('0x3')],'defaultValue':_0xf694('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xf694('0x3')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xf694('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xf694('0x3')]},'state':{'type':Sequelize[_0xf694('0x3')],'unique':_0xf694('0x6')},'description':{'type':Sequelize[_0xf694('0x3')]},'title':{'type':Sequelize[_0xf694('0x3')]},'remoteUri':{'type':Sequelize[_0xf694('0x3')]},'link':{'type':Sequelize[_0xf694('0x3')],'defaultValue':'#'}};
\ No newline at end of file
index db37a1e..441a952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc465=['include','rows','show','params','intersection','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','limit','order','sort','where','merge','filter','includeAll'];(function(_0x240fc1,_0xb6af43){var _0x3f93dd=function(_0x32182e){while(--_0x32182e){_0x240fc1['push'](_0x240fc1['shift']());}};_0x3f93dd(++_0xb6af43);}(_0xc465,0x125));var _0x5c46=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc465[_0x46698a];return _0x356db0;};'use strict';var pdf=require(_0x5c46('0x0'));var emlformat=require(_0x5c46('0x1'));var rimraf=require(_0x5c46('0x2'));var zipdir=require(_0x5c46('0x3'));var jsonpatch=require(_0x5c46('0x4'));var rp=require(_0x5c46('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c46('0x6'));var path=require(_0x5c46('0x7'));var sox=require('sox');var csv=require(_0x5c46('0x8'));var ejs=require(_0x5c46('0x9'));var fs=require('fs');var _=require(_0x5c46('0xa'));var squel=require('squel');var crypto=require(_0x5c46('0xb'));var jsforce=require(_0x5c46('0xc'));var deskjs=require(_0x5c46('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5c46('0xe'));var Papa=require('papaparse');var Redis=require(_0x5c46('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5c46('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c46('0x11'));var logger=require(_0x5c46('0x12'))(_0x5c46('0x13'));var utils=require(_0x5c46('0x14'));var config=require(_0x5c46('0x15'));var db=require(_0x5c46('0x16'))['db'];function respondWithStatusCode(_0x4777f6,_0x450ae5){_0x450ae5=_0x450ae5||0xcc;return function(_0x25fc1e){if(_0x25fc1e){return _0x4777f6[_0x5c46('0x17')](_0x450ae5);}return _0x4777f6['status'](_0x450ae5)['end']();};}function respondWithResult(_0x537c47,_0x46fe29){_0x46fe29=_0x46fe29||0xc8;return function(_0x4d07bb){if(_0x4d07bb){return _0x537c47[_0x5c46('0x18')](_0x46fe29)[_0x5c46('0x19')](_0x4d07bb);}};}function respondWithFilteredResult(_0x5428b0,_0x3f28b6){return function(_0x438294){if(_0x438294){var _0x407a89=_0x438294[_0x5c46('0x1a')],_0x3f0e8b=_0x3f28b6['offset'],_0x871795=_0x3f28b6[_0x5c46('0x1b')]+_0x3f28b6['limit'],_0x39e755;if(_0x871795>=_0x407a89){_0x871795=_0x407a89;_0x39e755=0xc8;}else{_0x39e755=0xce;}_0x5428b0[_0x5c46('0x18')](_0x39e755);return _0x5428b0['set'](_0x5c46('0x1c'),_0x3f0e8b+'-'+_0x871795+'/'+_0x407a89)[_0x5c46('0x19')](_0x438294);}return null;};}function patchUpdates(_0x356ef0){return function(_0x4e0e9c){try{jsonpatch[_0x5c46('0x1d')](_0x4e0e9c,_0x356ef0,!![]);}catch(_0xfdbb56){return BPromise[_0x5c46('0x1e')](_0xfdbb56);}return _0x4e0e9c[_0x5c46('0x1f')]();};}function saveUpdates(_0x5f4fee,_0xa44cc){return function(_0x30e909){if(_0x30e909){return _0x30e909[_0x5c46('0x20')](_0x5f4fee)['then'](function(_0x256181){return _0x256181;});}return null;};}function removeEntity(_0x47e76d,_0x59f259){return function(_0x21d52e){if(_0x21d52e){return _0x21d52e[_0x5c46('0x21')]()[_0x5c46('0x22')](function(){_0x47e76d[_0x5c46('0x18')](0xcc)[_0x5c46('0x23')]();});}};}function handleEntityNotFound(_0x30edc8,_0x156310){return function(_0x51f1e3){if(!_0x51f1e3){_0x30edc8[_0x5c46('0x17')](0x194);}return _0x51f1e3;};}function handleError(_0x666369,_0x2d9136){_0x2d9136=_0x2d9136||0x1f4;return function(_0x359753){logger[_0x5c46('0x24')](_0x359753[_0x5c46('0x25')]);if(_0x359753[_0x5c46('0x26')]){delete _0x359753['name'];}_0x666369[_0x5c46('0x18')](_0x2d9136)[_0x5c46('0x27')](_0x359753);};}exports[_0x5c46('0x28')]=function(_0x2f0fcf,_0x6eb900){var _0x58a7ae={},_0x314b68={},_0x3b51fc={'count':0x0,'rows':[]};var _0xcabd8c=_[_0x5c46('0x29')](db[_0x5c46('0x2a')][_0x5c46('0x2b')],function(_0x18e500){return{'name':_0x18e500[_0x5c46('0x2c')],'type':_0x18e500[_0x5c46('0x2d')][_0x5c46('0x2e')]};});_0x314b68[_0x5c46('0x2f')]=_['map'](_0xcabd8c,'name');_0x314b68['query']=_[_0x5c46('0x30')](_0x2f0fcf[_0x5c46('0x31')]);_0x314b68[_0x5c46('0x32')]=_['intersection'](_0x314b68['model'],_0x314b68['query']);_0x58a7ae['attributes']=_['intersection'](_0x314b68['model'],qs[_0x5c46('0x33')](_0x2f0fcf[_0x5c46('0x31')]['fields']));_0x58a7ae[_0x5c46('0x34')]=_0x58a7ae[_0x5c46('0x34')][_0x5c46('0x35')]?_0x58a7ae[_0x5c46('0x34')]:_0x314b68['model'];if(!_0x2f0fcf[_0x5c46('0x31')][_0x5c46('0x36')]('nolimit')){_0x58a7ae[_0x5c46('0x37')]=qs[_0x5c46('0x37')](_0x2f0fcf[_0x5c46('0x31')][_0x5c46('0x37')]);_0x58a7ae[_0x5c46('0x1b')]=qs[_0x5c46('0x1b')](_0x2f0fcf[_0x5c46('0x31')][_0x5c46('0x1b')]);}_0x58a7ae[_0x5c46('0x38')]=qs[_0x5c46('0x39')](_0x2f0fcf[_0x5c46('0x31')][_0x5c46('0x39')]);_0x58a7ae[_0x5c46('0x3a')]=qs['filters'](_['pick'](_0x2f0fcf[_0x5c46('0x31')],_0x314b68[_0x5c46('0x32')]),_0xcabd8c);if(_0x2f0fcf[_0x5c46('0x31')]['filter']){_0x58a7ae[_0x5c46('0x3a')]=_[_0x5c46('0x3b')](_0x58a7ae[_0x5c46('0x3a')],{'$or':_[_0x5c46('0x29')](_0xcabd8c,function(_0x4d3ddc){if(_0x4d3ddc[_0x5c46('0x2d')]!=='VIRTUAL'){var _0x556c50={};_0x556c50[_0x4d3ddc[_0x5c46('0x26')]]={'$like':'%'+_0x2f0fcf['query'][_0x5c46('0x3c')]+'%'};return _0x556c50;}})});}_0x58a7ae=_[_0x5c46('0x3b')]({},_0x58a7ae,_0x2f0fcf['options']);var _0x4620bc={'where':_0x58a7ae[_0x5c46('0x3a')]};return db[_0x5c46('0x2a')][_0x5c46('0x1a')](_0x4620bc)[_0x5c46('0x22')](function(_0xd02c66){_0x3b51fc['count']=_0xd02c66;if(_0x2f0fcf[_0x5c46('0x31')][_0x5c46('0x3d')]){_0x58a7ae[_0x5c46('0x3e')]=[{'all':!![]}];}return db[_0x5c46('0x2a')]['findAll'](_0x58a7ae);})[_0x5c46('0x22')](function(_0x123a6d){_0x3b51fc[_0x5c46('0x3f')]=_0x123a6d;return _0x3b51fc;})[_0x5c46('0x22')](respondWithFilteredResult(_0x6eb900,_0x58a7ae))['catch'](handleError(_0x6eb900,null));};exports[_0x5c46('0x40')]=function(_0x415186,_0x3357a8){var _0x1ed4d7={'raw':![],'where':{'id':_0x415186[_0x5c46('0x41')]['id']}},_0x5eba9f={};_0x5eba9f[_0x5c46('0x2f')]=_[_0x5c46('0x30')](db[_0x5c46('0x2a')][_0x5c46('0x2b')]);_0x5eba9f['query']=_[_0x5c46('0x30')](_0x415186[_0x5c46('0x31')]);_0x5eba9f[_0x5c46('0x32')]=_[_0x5c46('0x42')](_0x5eba9f['model'],_0x5eba9f['query']);_0x1ed4d7['attributes']=_[_0x5c46('0x42')](_0x5eba9f[_0x5c46('0x2f')],qs[_0x5c46('0x33')](_0x415186[_0x5c46('0x31')][_0x5c46('0x33')]));_0x1ed4d7[_0x5c46('0x34')]=_0x1ed4d7[_0x5c46('0x34')][_0x5c46('0x35')]?_0x1ed4d7[_0x5c46('0x34')]:_0x5eba9f['model'];if(_0x415186[_0x5c46('0x31')]['includeAll']){_0x1ed4d7[_0x5c46('0x3e')]=[{'all':!![]}];}_0x1ed4d7=_[_0x5c46('0x3b')]({},_0x1ed4d7,_0x415186['options']);return db[_0x5c46('0x2a')][_0x5c46('0x43')](_0x1ed4d7)['then'](handleEntityNotFound(_0x3357a8,null))['then'](respondWithResult(_0x3357a8,null))[_0x5c46('0x44')](handleError(_0x3357a8,null));};exports['create']=function(_0x51dc24,_0x25949b){return db['Integration'][_0x5c46('0x45')](_0x51dc24['body'],{})[_0x5c46('0x22')](respondWithResult(_0x25949b,0xc9))[_0x5c46('0x44')](handleError(_0x25949b,null));};exports[_0x5c46('0x20')]=function(_0x333cd5,_0x21ab6b){if(_0x333cd5[_0x5c46('0x46')]['id']){delete _0x333cd5[_0x5c46('0x46')]['id'];}return db['Integration'][_0x5c46('0x43')]({'where':{'id':_0x333cd5[_0x5c46('0x41')]['id']}})[_0x5c46('0x22')](handleEntityNotFound(_0x21ab6b,null))[_0x5c46('0x22')](saveUpdates(_0x333cd5[_0x5c46('0x46')],null))[_0x5c46('0x22')](respondWithResult(_0x21ab6b,null))[_0x5c46('0x44')](handleError(_0x21ab6b,null));};exports[_0x5c46('0x21')]=function(_0x4dc4a5,_0x156f69){return db['Integration'][_0x5c46('0x43')]({'where':{'id':_0x4dc4a5[_0x5c46('0x41')]['id']}})[_0x5c46('0x22')](handleEntityNotFound(_0x156f69,null))[_0x5c46('0x22')](removeEntity(_0x156f69,null))['catch'](handleError(_0x156f69,null));};
\ No newline at end of file
+var _0xbd05=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','Content-Range','apply','update','then','error','stack','name','send','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','length','options','find','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x123623,_0x9694e2){var _0x3b00d1=function(_0x7e48e0){while(--_0x7e48e0){_0x123623['push'](_0x123623['shift']());}};_0x3b00d1(++_0x9694e2);}(_0xbd05,0x158));var _0x5bd0=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xbd05[_0x4dcc2d];return _0x1bbd79;};'use strict';var pdf=require(_0x5bd0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5bd0('0x1'));var zipdir=require(_0x5bd0('0x2'));var jsonpatch=require(_0x5bd0('0x3'));var rp=require(_0x5bd0('0x4'));var moment=require(_0x5bd0('0x5'));var BPromise=require(_0x5bd0('0x6'));var Mustache=require(_0x5bd0('0x7'));var util=require('util');var path=require(_0x5bd0('0x8'));var sox=require('sox');var csv=require(_0x5bd0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5bd0('0xa'));var jsforce=require(_0x5bd0('0xb'));var deskjs=require(_0x5bd0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5bd0('0xd'));var Papa=require(_0x5bd0('0xe'));var Redis=require('ioredis');var authService=require(_0x5bd0('0xf'));var qs=require(_0x5bd0('0x10'));var as=require(_0x5bd0('0x11'));var hardwareService=require(_0x5bd0('0x12'));var logger=require(_0x5bd0('0x13'))(_0x5bd0('0x14'));var utils=require(_0x5bd0('0x15'));var config=require(_0x5bd0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x595718,_0x1023e0){_0x1023e0=_0x1023e0||0xcc;return function(_0x2f06f9){if(_0x2f06f9){return _0x595718[_0x5bd0('0x17')](_0x1023e0);}return _0x595718['status'](_0x1023e0)[_0x5bd0('0x18')]();};}function respondWithResult(_0x42b8aa,_0x8148f5){_0x8148f5=_0x8148f5||0xc8;return function(_0x39e06b){if(_0x39e06b){return _0x42b8aa[_0x5bd0('0x19')](_0x8148f5)[_0x5bd0('0x1a')](_0x39e06b);}};}function respondWithFilteredResult(_0x3bef6f,_0x3c22aa){return function(_0x3ccfe){if(_0x3ccfe){var _0x2bd23c=_0x3ccfe[_0x5bd0('0x1b')],_0x54abb1=_0x3c22aa[_0x5bd0('0x1c')],_0x114871=_0x3c22aa[_0x5bd0('0x1c')]+_0x3c22aa['limit'],_0x2db630;if(_0x114871>=_0x2bd23c){_0x114871=_0x2bd23c;_0x2db630=0xc8;}else{_0x2db630=0xce;}_0x3bef6f['status'](_0x2db630);return _0x3bef6f['set'](_0x5bd0('0x1d'),_0x54abb1+'-'+_0x114871+'/'+_0x2bd23c)[_0x5bd0('0x1a')](_0x3ccfe);}return null;};}function patchUpdates(_0x43af83){return function(_0x45b33d){try{jsonpatch[_0x5bd0('0x1e')](_0x45b33d,_0x43af83,!![]);}catch(_0x29140b){return BPromise['reject'](_0x29140b);}return _0x45b33d['save']();};}function saveUpdates(_0x2d5f90,_0x3aaab5){return function(_0xb738d4){if(_0xb738d4){return _0xb738d4[_0x5bd0('0x1f')](_0x2d5f90)['then'](function(_0x310a63){return _0x310a63;});}return null;};}function removeEntity(_0x5431f2,_0x4340fd){return function(_0x94566b){if(_0x94566b){return _0x94566b['destroy']()[_0x5bd0('0x20')](function(){_0x5431f2['status'](0xcc)[_0x5bd0('0x18')]();});}};}function handleEntityNotFound(_0x1cb898,_0x49d07b){return function(_0x2b5499){if(!_0x2b5499){_0x1cb898[_0x5bd0('0x17')](0x194);}return _0x2b5499;};}function handleError(_0x225868,_0x383d40){_0x383d40=_0x383d40||0x1f4;return function(_0x3c4956){logger[_0x5bd0('0x21')](_0x3c4956[_0x5bd0('0x22')]);if(_0x3c4956[_0x5bd0('0x23')]){delete _0x3c4956[_0x5bd0('0x23')];}_0x225868[_0x5bd0('0x19')](_0x383d40)[_0x5bd0('0x24')](_0x3c4956);};}exports['index']=function(_0x3efba8,_0x1e4df1){var _0x4224b4={},_0x549e67={},_0x45e77a={'count':0x0,'rows':[]};var _0x5147e5=_[_0x5bd0('0x25')](db[_0x5bd0('0x26')][_0x5bd0('0x27')],function(_0x271f36){return{'name':_0x271f36[_0x5bd0('0x28')],'type':_0x271f36[_0x5bd0('0x29')][_0x5bd0('0x2a')]};});_0x549e67[_0x5bd0('0x2b')]=_[_0x5bd0('0x25')](_0x5147e5,'name');_0x549e67[_0x5bd0('0x2c')]=_[_0x5bd0('0x2d')](_0x3efba8[_0x5bd0('0x2c')]);_0x549e67[_0x5bd0('0x2e')]=_['intersection'](_0x549e67[_0x5bd0('0x2b')],_0x549e67[_0x5bd0('0x2c')]);_0x4224b4[_0x5bd0('0x2f')]=_[_0x5bd0('0x30')](_0x549e67['model'],qs['fields'](_0x3efba8[_0x5bd0('0x2c')]['fields']));_0x4224b4[_0x5bd0('0x2f')]=_0x4224b4[_0x5bd0('0x2f')]['length']?_0x4224b4[_0x5bd0('0x2f')]:_0x549e67[_0x5bd0('0x2b')];if(!_0x3efba8[_0x5bd0('0x2c')][_0x5bd0('0x31')](_0x5bd0('0x32'))){_0x4224b4['limit']=qs[_0x5bd0('0x33')](_0x3efba8['query'][_0x5bd0('0x33')]);_0x4224b4[_0x5bd0('0x1c')]=qs[_0x5bd0('0x1c')](_0x3efba8['query'][_0x5bd0('0x1c')]);}_0x4224b4[_0x5bd0('0x34')]=qs[_0x5bd0('0x35')](_0x3efba8[_0x5bd0('0x2c')][_0x5bd0('0x35')]);_0x4224b4[_0x5bd0('0x36')]=qs[_0x5bd0('0x2e')](_[_0x5bd0('0x37')](_0x3efba8['query'],_0x549e67[_0x5bd0('0x2e')]),_0x5147e5);if(_0x3efba8[_0x5bd0('0x2c')][_0x5bd0('0x38')]){_0x4224b4['where']=_[_0x5bd0('0x39')](_0x4224b4[_0x5bd0('0x36')],{'$or':_[_0x5bd0('0x25')](_0x5147e5,function(_0x267f4d){if(_0x267f4d[_0x5bd0('0x29')]!==_0x5bd0('0x3a')){var _0x5a6f4e={};_0x5a6f4e[_0x267f4d[_0x5bd0('0x23')]]={'$like':'%'+_0x3efba8[_0x5bd0('0x2c')][_0x5bd0('0x38')]+'%'};return _0x5a6f4e;}})});}_0x4224b4=_[_0x5bd0('0x39')]({},_0x4224b4,_0x3efba8['options']);var _0x5ecbbe={'where':_0x4224b4['where']};return db[_0x5bd0('0x26')][_0x5bd0('0x1b')](_0x5ecbbe)[_0x5bd0('0x20')](function(_0x11c8ea){_0x45e77a[_0x5bd0('0x1b')]=_0x11c8ea;if(_0x3efba8['query'][_0x5bd0('0x3b')]){_0x4224b4[_0x5bd0('0x3c')]=[{'all':!![]}];}return db[_0x5bd0('0x26')][_0x5bd0('0x3d')](_0x4224b4);})[_0x5bd0('0x20')](function(_0x4ae278){_0x45e77a['rows']=_0x4ae278;return _0x45e77a;})[_0x5bd0('0x20')](respondWithFilteredResult(_0x1e4df1,_0x4224b4))[_0x5bd0('0x3e')](handleError(_0x1e4df1,null));};exports[_0x5bd0('0x3f')]=function(_0xe00372,_0xedf26a){var _0x93599b={'raw':![],'where':{'id':_0xe00372[_0x5bd0('0x40')]['id']}},_0x5da8ad={};_0x5da8ad[_0x5bd0('0x2b')]=_['keys'](db['Integration'][_0x5bd0('0x27')]);_0x5da8ad['query']=_['keys'](_0xe00372[_0x5bd0('0x2c')]);_0x5da8ad[_0x5bd0('0x2e')]=_[_0x5bd0('0x30')](_0x5da8ad['model'],_0x5da8ad[_0x5bd0('0x2c')]);_0x93599b[_0x5bd0('0x2f')]=_[_0x5bd0('0x30')](_0x5da8ad[_0x5bd0('0x2b')],qs['fields'](_0xe00372[_0x5bd0('0x2c')][_0x5bd0('0x41')]));_0x93599b[_0x5bd0('0x2f')]=_0x93599b[_0x5bd0('0x2f')][_0x5bd0('0x42')]?_0x93599b[_0x5bd0('0x2f')]:_0x5da8ad[_0x5bd0('0x2b')];if(_0xe00372[_0x5bd0('0x2c')][_0x5bd0('0x3b')]){_0x93599b['include']=[{'all':!![]}];}_0x93599b=_[_0x5bd0('0x39')]({},_0x93599b,_0xe00372[_0x5bd0('0x43')]);return db[_0x5bd0('0x26')][_0x5bd0('0x44')](_0x93599b)[_0x5bd0('0x20')](handleEntityNotFound(_0xedf26a,null))[_0x5bd0('0x20')](respondWithResult(_0xedf26a,null))[_0x5bd0('0x3e')](handleError(_0xedf26a,null));};exports[_0x5bd0('0x45')]=function(_0x1339cf,_0x30e1d2){return db[_0x5bd0('0x26')][_0x5bd0('0x45')](_0x1339cf[_0x5bd0('0x46')],{})[_0x5bd0('0x20')](respondWithResult(_0x30e1d2,0xc9))[_0x5bd0('0x3e')](handleError(_0x30e1d2,null));};exports[_0x5bd0('0x1f')]=function(_0x246e59,_0x12b3b2){if(_0x246e59[_0x5bd0('0x46')]['id']){delete _0x246e59['body']['id'];}return db[_0x5bd0('0x26')]['find']({'where':{'id':_0x246e59['params']['id']}})[_0x5bd0('0x20')](handleEntityNotFound(_0x12b3b2,null))[_0x5bd0('0x20')](saveUpdates(_0x246e59[_0x5bd0('0x46')],null))['then'](respondWithResult(_0x12b3b2,null))[_0x5bd0('0x3e')](handleError(_0x12b3b2,null));};exports[_0x5bd0('0x47')]=function(_0x3d8ae6,_0x12c368){return db[_0x5bd0('0x26')][_0x5bd0('0x44')]({'where':{'id':_0x3d8ae6['params']['id']}})[_0x5bd0('0x20')](handleEntityNotFound(_0x12c368,null))[_0x5bd0('0x20')](removeEntity(_0x12c368,null))[_0x5bd0('0x3e')](handleError(_0x12c368,null));};
\ No newline at end of file
index 733aa26..ac12c0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38cd=['util','api','moment','request-promise','path','../../config/environment','./integration.attributes','exports','define','Integration','lodash'];(function(_0x1ede92,_0x34a290){var _0x382e49=function(_0x2429e9){while(--_0x2429e9){_0x1ede92['push'](_0x1ede92['shift']());}};_0x382e49(++_0x34a290);}(_0x38cd,0x78));var _0xd38c=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x38cd[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0xd38c('0x0'));var util=require(_0xd38c('0x1'));var logger=require('../../config/logger')(_0xd38c('0x2'));var moment=require(_0xd38c('0x3'));var BPromise=require('bluebird');var rp=require(_0xd38c('0x4'));var fs=require('fs');var path=require(_0xd38c('0x5'));var rimraf=require('rimraf');var config=require(_0xd38c('0x6'));var attributes=require(_0xd38c('0x7'));module[_0xd38c('0x8')]=function(_0x3ed20a,_0x42baa9){return _0x3ed20a[_0xd38c('0x9')](_0xd38c('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x36d2=['../../config/environment','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5df57e,_0x2f5712){var _0x17705e=function(_0x1b9e8c){while(--_0x1b9e8c){_0x5df57e['push'](_0x5df57e['shift']());}};_0x17705e(++_0x2f5712);}(_0x36d2,0x9d));var _0x236d=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x36d2[_0x1ccbcc];return _0x1e873f;};'use strict';var _=require(_0x236d('0x0'));var util=require('util');var logger=require(_0x236d('0x1'))(_0x236d('0x2'));var moment=require(_0x236d('0x3'));var BPromise=require(_0x236d('0x4'));var rp=require(_0x236d('0x5'));var fs=require('fs');var path=require(_0x236d('0x6'));var rimraf=require(_0x236d('0x7'));var config=require(_0x236d('0x8'));var attributes=require('./integration.attributes');module[_0x236d('0x9')]=function(_0x115c63,_0x19423f){return _0x115c63[_0x236d('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9c3cda6..2c7b82b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe44=['stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x36bb32,_0x1cd320){var _0x140e42=function(_0x348e04){while(--_0x348e04){_0x36bb32['push'](_0x36bb32['shift']());}};_0x140e42(++_0x1cd320);}(_0xbe44,0x13a));var _0x4be4=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0xbe44[_0x3d9b04];return _0x557936;};'use strict';var _=require(_0x4be4('0x0'));var util=require('util');var moment=require(_0x4be4('0x1'));var BPromise=require(_0x4be4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4be4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4be4('0x4'));var logger=require(_0x4be4('0x5'))('rpc');var config=require(_0x4be4('0x6'));var jayson=require(_0x4be4('0x7'));var client=jayson[_0x4be4('0x8')][_0x4be4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7c0f,_0xf1e1f0,_0x94c6fd){return new BPromise(function(_0x2302bd,_0x3524a1){return client['request'](_0x3e7c0f,_0x94c6fd)[_0x4be4('0xa')](function(_0x5f927a){logger[_0x4be4('0xb')](_0x4be4('0xc'),_0xf1e1f0,'request\x20sent');logger[_0x4be4('0xd')](_0x4be4('0xe'),_0xf1e1f0,_0x4be4('0xf'),JSON[_0x4be4('0x10')](_0x5f927a));if(_0x5f927a[_0x4be4('0x11')]){if(_0x5f927a[_0x4be4('0x11')][_0x4be4('0x12')]===0x1f4){logger[_0x4be4('0x11')]('Integration,\x20%s,\x20%s',_0xf1e1f0,_0x5f927a[_0x4be4('0x11')][_0x4be4('0x13')]);return _0x3524a1(_0x5f927a[_0x4be4('0x11')][_0x4be4('0x13')]);}logger['error'](_0x4be4('0xc'),_0xf1e1f0,_0x5f927a[_0x4be4('0x11')]['message']);return _0x2302bd(_0x5f927a['error'][_0x4be4('0x13')]);}else{logger[_0x4be4('0xb')](_0x4be4('0xc'),_0xf1e1f0,'request\x20sent');_0x2302bd(_0x5f927a[_0x4be4('0x14')][_0x4be4('0x13')]);}})[_0x4be4('0x15')](function(_0x37f91e){logger[_0x4be4('0x11')]('Integration,\x20%s,\x20%s',_0xf1e1f0,_0x37f91e);_0x3524a1(_0x37f91e);});});}
\ No newline at end of file
+var _0xc5b4=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x2a31d1,_0x18e3e6){var _0x4bb2e7=function(_0x12fc50){while(--_0x12fc50){_0x2a31d1['push'](_0x2a31d1['shift']());}};_0x4bb2e7(++_0x18e3e6);}(_0xc5b4,0x1cb));var _0x4c5b=function(_0x1b347c,_0x5d400d){_0x1b347c=_0x1b347c-0x0;var _0x1ebb4f=_0xc5b4[_0x1b347c];return _0x1ebb4f;};'use strict';var _=require(_0x4c5b('0x0'));var util=require(_0x4c5b('0x1'));var moment=require(_0x4c5b('0x2'));var BPromise=require(_0x4c5b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c5b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c5b('0x5'));var logger=require('../../config/logger')(_0x4c5b('0x6'));var config=require(_0x4c5b('0x7'));var jayson=require(_0x4c5b('0x8'));var client=jayson[_0x4c5b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ada7a,_0x386e51,_0x233674){return new BPromise(function(_0xba50f6,_0x441922){return client[_0x4c5b('0xa')](_0x4ada7a,_0x233674)[_0x4c5b('0xb')](function(_0x211dc3){logger['info'](_0x4c5b('0xc'),_0x386e51,_0x4c5b('0xd'));logger[_0x4c5b('0xe')](_0x4c5b('0xf'),_0x386e51,_0x4c5b('0xd'),JSON['stringify'](_0x211dc3));if(_0x211dc3[_0x4c5b('0x10')]){if(_0x211dc3[_0x4c5b('0x10')][_0x4c5b('0x11')]===0x1f4){logger[_0x4c5b('0x10')](_0x4c5b('0xc'),_0x386e51,_0x211dc3[_0x4c5b('0x10')][_0x4c5b('0x12')]);return _0x441922(_0x211dc3[_0x4c5b('0x10')][_0x4c5b('0x12')]);}logger['error'](_0x4c5b('0xc'),_0x386e51,_0x211dc3[_0x4c5b('0x10')][_0x4c5b('0x12')]);return _0xba50f6(_0x211dc3[_0x4c5b('0x10')][_0x4c5b('0x12')]);}else{logger['info'](_0x4c5b('0xc'),_0x386e51,_0x4c5b('0xd'));_0xba50f6(_0x211dc3[_0x4c5b('0x13')][_0x4c5b('0x12')]);}})[_0x4c5b('0x14')](function(_0x3371a0){logger[_0x4c5b('0x10')](_0x4c5b('0xc'),_0x386e51,_0x3371a0);_0x441922(_0x3371a0);});});}
\ No newline at end of file
index 1544b0c..684b580 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x803f=['isAuthenticated','index','get','describe','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x803f,0x64));var _0xf803=function(_0x1c1837,_0xfd703){_0x1c1837=_0x1c1837-0x0;var _0x48890d=_0x803f[_0x1c1837];return _0x48890d;};'use strict';var multer=require(_0xf803('0x0'));var util=require('util');var path=require(_0xf803('0x1'));var timeout=require(_0xf803('0x2'));var express=require('express');var router=express[_0xf803('0x3')]();var auth=require(_0xf803('0x4'));var interaction=require(_0xf803('0x5'));var config=require(_0xf803('0x6'));var controller=require(_0xf803('0x7'));router['get']('/',auth[_0xf803('0x8')](),controller[_0xf803('0x9')]);router[_0xf803('0xa')]('/describe',auth[_0xf803('0x8')](),controller[_0xf803('0xb')]);router['get'](_0xf803('0xc'),auth[_0xf803('0x8')](),controller[_0xf803('0xd')]);router['post']('/',auth[_0xf803('0x8')](),controller['create']);router[_0xf803('0xe')](_0xf803('0xc'),auth['isAuthenticated'](),controller[_0xf803('0xf')]);router[_0xf803('0x10')](_0xf803('0xc'),auth[_0xf803('0x8')](),controller[_0xf803('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xc35b=['/describe','isAuthenticated','describe','show','create','put','update','delete','/:id','exports','util','path','express','../../config/environment','./integrationReport.controller','index','get'];(function(_0x5e8b7e,_0x258072){var _0x19d445=function(_0xf028e8){while(--_0xf028e8){_0x5e8b7e['push'](_0x5e8b7e['shift']());}};_0x19d445(++_0x258072);}(_0xc35b,0xa3));var _0xbc35=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xc35b[_0x256b72];return _0x2183e3;};'use strict';var multer=require('multer');var util=require(_0xbc35('0x0'));var path=require(_0xbc35('0x1'));var timeout=require('connect-timeout');var express=require(_0xbc35('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbc35('0x3'));var controller=require(_0xbc35('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc35('0x5')]);router[_0xbc35('0x6')](_0xbc35('0x7'),auth[_0xbc35('0x8')](),controller[_0xbc35('0x9')]);router[_0xbc35('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xbc35('0xa')]);router['post']('/',auth[_0xbc35('0x8')](),controller[_0xbc35('0xb')]);router[_0xbc35('0xc')]('/:id',auth[_0xbc35('0x8')](),controller[_0xbc35('0xd')]);router[_0xbc35('0xe')](_0xbc35('0xf'),auth[_0xbc35('0x8')](),controller['destroy']);module[_0xbc35('0x10')]=router;
\ No newline at end of file
index b452161..452bd4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a39=['RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x1a39,0x91));var _0x91a3=function(_0x5f42ef,_0x4dbe71){_0x5f42ef=_0x5f42ef-0x0;var _0x232b95=_0x1a39[_0x5f42ef];return _0x232b95;};'use strict';var Sequelize=require('sequelize');module[_0x91a3('0x0')]={'integration':{'type':Sequelize[_0x91a3('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x91a3('0x1')]},'ticketId':{'type':Sequelize[_0x91a3('0x1')]},'integrationId':{'type':Sequelize[_0x91a3('0x2')]},'contacts':{'type':Sequelize[_0x91a3('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x91a3('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x91a3('0x1')]},'interface':{'type':Sequelize[_0x91a3('0x1')]},'membername':{'type':Sequelize[_0x91a3('0x1')]},'agentcalledAt':{'type':Sequelize[_0x91a3('0x3')]},'agentconnectAt':{'type':Sequelize[_0x91a3('0x3')]},'holdtime':{'type':Sequelize[_0x91a3('0x2')]},'agentcomplete':{'type':Sequelize[_0x91a3('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x91a3('0x2')]},'agentacw':{'type':Sequelize[_0x91a3('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x91a3('0x2')]},'reason':{'type':Sequelize[_0x91a3('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x91a3('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x91a3('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x91a3('0x3')]},'lastevent':{'type':Sequelize[_0x91a3('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x91a3('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x91a3('0x1')]},'language':{'type':Sequelize[_0x91a3('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x91a3('0x1')]},'priority':{'type':Sequelize[_0x91a3('0x1')]},'destchannel':{'type':Sequelize[_0x91a3('0x1')]},'destchannelstate':{'type':Sequelize[_0x91a3('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x91a3('0x1')]},'destcalleridnum':{'type':Sequelize[_0x91a3('0x1')]},'destcalleridname':{'type':Sequelize[_0x91a3('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x91a3('0x1')]},'destlanguage':{'type':Sequelize[_0x91a3('0x1')]},'destaccountcode':{'type':Sequelize[_0x91a3('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x91a3('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x91a3('0x1')]},'from':{'type':Sequelize[_0x91a3('0x1')]},'to':{'type':Sequelize[_0x91a3('0x1')]},'cc':{'type':Sequelize[_0x91a3('0x1')]},'attachment':{'type':Sequelize[_0x91a3('0x5')]},'html':{'type':Sequelize[_0x91a3('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x91a3('0x6')](_0x91a3('0x7'),_0x91a3('0x8'),_0x91a3('0x9'),_0x91a3('0xa'))},'url':{'type':Sequelize[_0x91a3('0x1')]},'app':{'type':Sequelize[_0x91a3('0x1')]},'appdata':{'type':Sequelize[_0x91a3('0x1')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdb44=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','ENUM','SENT','SENDING'];(function(_0x17479d,_0x593129){var _0x2d461c=function(_0x347164){while(--_0x347164){_0x17479d['push'](_0x17479d['shift']());}};_0x2d461c(++_0x593129);}(_0xdb44,0x1a7));var _0x4db4=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xdb44[_0x1c8c28];return _0x1f59b4;};'use strict';var Sequelize=require(_0x4db4('0x0'));module[_0x4db4('0x1')]={'integration':{'type':Sequelize[_0x4db4('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x4db4('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x4db4('0x2')]},'uniqueid':{'type':Sequelize[_0x4db4('0x2')]},'calleridnum':{'type':Sequelize[_0x4db4('0x2')]},'calleridname':{'type':Sequelize[_0x4db4('0x2')]},'queue':{'type':Sequelize[_0x4db4('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4db4('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4db4('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4db4('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4db4('0x3')]},'talktime':{'type':Sequelize[_0x4db4('0x5')]},'agentacw':{'type':Sequelize[_0x4db4('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4db4('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x4db4('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4db4('0x3')]},'agentdump':{'type':Sequelize[_0x4db4('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4db4('0x2')]},'channelstate':{'type':Sequelize[_0x4db4('0x5')]},'channelstatedesc':{'type':Sequelize[_0x4db4('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4db4('0x2')]},'connectedlinename':{'type':Sequelize[_0x4db4('0x2')]},'language':{'type':Sequelize[_0x4db4('0x2')]},'accountcode':{'type':Sequelize[_0x4db4('0x2')]},'context':{'type':Sequelize[_0x4db4('0x2')]},'exten':{'type':Sequelize[_0x4db4('0x2')]},'priority':{'type':Sequelize[_0x4db4('0x2')]},'destchannel':{'type':Sequelize[_0x4db4('0x2')]},'destchannelstate':{'type':Sequelize[_0x4db4('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x4db4('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4db4('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4db4('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4db4('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4db4('0x2')]},'destcontext':{'type':Sequelize[_0x4db4('0x2')]},'destexten':{'type':Sequelize[_0x4db4('0x2')]},'destpriority':{'type':Sequelize[_0x4db4('0x2')]},'destuniqueid':{'type':Sequelize[_0x4db4('0x2')]},'messageId':{'type':Sequelize[_0x4db4('0x2')]},'inReplyTo':{'type':Sequelize[_0x4db4('0x2')]},'subject':{'type':Sequelize[_0x4db4('0x2')]},'from':{'type':Sequelize[_0x4db4('0x2')]},'to':{'type':Sequelize[_0x4db4('0x2')]},'cc':{'type':Sequelize[_0x4db4('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x4db4('0x6')](_0x4db4('0x7'),_0x4db4('0x8'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x4db4('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x4db4('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 42e3add..51af2cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe12=['fast-json-patch','request-promise','bluebird','path','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','then','destroy','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','intersection','includeAll','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x4ddbd8,_0x54faed){var _0xe5d736=function(_0x459b51){while(--_0x459b51){_0x4ddbd8['push'](_0x4ddbd8['shift']());}};_0xe5d736(++_0x54faed);}(_0xbe12,0xd1));var _0x2be1=function(_0xf47460,_0x157512){_0xf47460=_0xf47460-0x0;var _0x304d81=_0xbe12[_0xf47460];return _0x304d81;};'use strict';var pdf=require(_0x2be1('0x0'));var emlformat=require(_0x2be1('0x1'));var rimraf=require(_0x2be1('0x2'));var zipdir=require(_0x2be1('0x3'));var jsonpatch=require(_0x2be1('0x4'));var rp=require(_0x2be1('0x5'));var moment=require('moment');var BPromise=require(_0x2be1('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2be1('0x7'));var sox=require('sox');var csv=require(_0x2be1('0x8'));var ejs=require(_0x2be1('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2be1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2be1('0x8'));var querystring=require(_0x2be1('0xb'));var Papa=require(_0x2be1('0xc'));var Redis=require(_0x2be1('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2be1('0xe'));var hardwareService=require(_0x2be1('0xf'));var logger=require(_0x2be1('0x10'))(_0x2be1('0x11'));var utils=require('../../config/utils');var config=require(_0x2be1('0x12'));var db=require(_0x2be1('0x13'))['db'];function respondWithStatusCode(_0x9e3e4,_0x3b7850){_0x3b7850=_0x3b7850||0xcc;return function(_0x3bbabd){if(_0x3bbabd){return _0x9e3e4[_0x2be1('0x14')](_0x3b7850);}return _0x9e3e4['status'](_0x3b7850)[_0x2be1('0x15')]();};}function respondWithResult(_0x506f2d,_0xa54d2d){_0xa54d2d=_0xa54d2d||0xc8;return function(_0x3b74cf){if(_0x3b74cf){return _0x506f2d[_0x2be1('0x16')](_0xa54d2d)[_0x2be1('0x17')](_0x3b74cf);}};}function respondWithFilteredResult(_0x41de37,_0x165d84){return function(_0x1ddd47){if(_0x1ddd47){var _0x3895ab=_0x1ddd47[_0x2be1('0x18')],_0x211e85=_0x165d84['offset'],_0x28b30a=_0x165d84[_0x2be1('0x19')]+_0x165d84[_0x2be1('0x1a')],_0x15bc65;if(_0x28b30a>=_0x3895ab){_0x28b30a=_0x3895ab;_0x15bc65=0xc8;}else{_0x15bc65=0xce;}_0x41de37['status'](_0x15bc65);return _0x41de37[_0x2be1('0x1b')](_0x2be1('0x1c'),_0x211e85+'-'+_0x28b30a+'/'+_0x3895ab)[_0x2be1('0x17')](_0x1ddd47);}return null;};}function patchUpdates(_0x5d9ed5){return function(_0x482f16){try{jsonpatch['apply'](_0x482f16,_0x5d9ed5,!![]);}catch(_0x4be2aa){return BPromise[_0x2be1('0x1d')](_0x4be2aa);}return _0x482f16['save']();};}function saveUpdates(_0x50cf83,_0x56e190){return function(_0x11a8e8){if(_0x11a8e8){return _0x11a8e8['update'](_0x50cf83)[_0x2be1('0x1e')](function(_0x1e86f0){return _0x1e86f0;});}return null;};}function removeEntity(_0x4aba25,_0x2b85c5){return function(_0x3a3551){if(_0x3a3551){return _0x3a3551[_0x2be1('0x1f')]()[_0x2be1('0x1e')](function(){_0x4aba25[_0x2be1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x433e5a,_0x5e0a91){return function(_0x1cb070){if(!_0x1cb070){_0x433e5a['sendStatus'](0x194);}return _0x1cb070;};}function handleError(_0x6637e8,_0xf3c8b2){_0xf3c8b2=_0xf3c8b2||0x1f4;return function(_0x46c199){logger[_0x2be1('0x20')](_0x46c199[_0x2be1('0x21')]);if(_0x46c199[_0x2be1('0x22')]){delete _0x46c199['name'];}_0x6637e8[_0x2be1('0x16')](_0xf3c8b2)[_0x2be1('0x23')](_0x46c199);};}exports[_0x2be1('0x24')]=function(_0x5595b6,_0x3ebfce){var _0x3cba20={},_0x41a5a9={},_0x3f55d9={'count':0x0,'rows':[]};var _0x22b868=_['map'](db[_0x2be1('0x25')][_0x2be1('0x26')],function(_0x4230c5){return{'name':_0x4230c5[_0x2be1('0x27')],'type':_0x4230c5['type'][_0x2be1('0x28')]};});_0x41a5a9[_0x2be1('0x29')]=_[_0x2be1('0x2a')](_0x22b868,'name');_0x41a5a9[_0x2be1('0x2b')]=_[_0x2be1('0x2c')](_0x5595b6[_0x2be1('0x2b')]);_0x41a5a9[_0x2be1('0x2d')]=_['intersection'](_0x41a5a9['model'],_0x41a5a9[_0x2be1('0x2b')]);_0x3cba20[_0x2be1('0x2e')]=_['intersection'](_0x41a5a9[_0x2be1('0x29')],qs[_0x2be1('0x2f')](_0x5595b6[_0x2be1('0x2b')]['fields']));_0x3cba20[_0x2be1('0x2e')]=_0x3cba20['attributes'][_0x2be1('0x30')]?_0x3cba20[_0x2be1('0x2e')]:_0x41a5a9[_0x2be1('0x29')];if(!_0x5595b6['query'][_0x2be1('0x31')](_0x2be1('0x32'))){_0x3cba20[_0x2be1('0x1a')]=qs[_0x2be1('0x1a')](_0x5595b6[_0x2be1('0x2b')][_0x2be1('0x1a')]);_0x3cba20['offset']=qs['offset'](_0x5595b6[_0x2be1('0x2b')]['offset']);}_0x3cba20[_0x2be1('0x33')]=qs[_0x2be1('0x34')](_0x5595b6[_0x2be1('0x2b')][_0x2be1('0x34')]);_0x3cba20[_0x2be1('0x35')]=qs[_0x2be1('0x2d')](_[_0x2be1('0x36')](_0x5595b6[_0x2be1('0x2b')],_0x41a5a9['filters']),_0x22b868);if(_0x5595b6[_0x2be1('0x2b')]['filter']){_0x3cba20[_0x2be1('0x35')]=_[_0x2be1('0x37')](_0x3cba20[_0x2be1('0x35')],{'$or':_[_0x2be1('0x2a')](_0x22b868,function(_0x3d0c6e){if(_0x3d0c6e['type']!==_0x2be1('0x38')){var _0x136112={};_0x136112[_0x3d0c6e[_0x2be1('0x22')]]={'$like':'%'+_0x5595b6[_0x2be1('0x2b')][_0x2be1('0x39')]+'%'};return _0x136112;}})});}_0x3cba20=_[_0x2be1('0x37')]({},_0x3cba20,_0x5595b6[_0x2be1('0x3a')]);var _0xe4b9d8={'where':_0x3cba20[_0x2be1('0x35')]};return db[_0x2be1('0x25')][_0x2be1('0x18')](_0xe4b9d8)['then'](function(_0xcbac94){_0x3f55d9[_0x2be1('0x18')]=_0xcbac94;if(_0x5595b6['query']['includeAll']){_0x3cba20[_0x2be1('0x3b')]=[{'all':!![]}];}return db['IntegrationReport'][_0x2be1('0x3c')](_0x3cba20);})[_0x2be1('0x1e')](function(_0x59ec72){_0x3f55d9['rows']=_0x59ec72;return _0x3f55d9;})[_0x2be1('0x1e')](respondWithFilteredResult(_0x3ebfce,_0x3cba20))[_0x2be1('0x3d')](handleError(_0x3ebfce,null));};exports[_0x2be1('0x3e')]=function(_0x3e707c,_0xeb7137){var _0x3ed26e={'raw':![],'where':{'id':_0x3e707c[_0x2be1('0x3f')]['id']}},_0x4caa64={};_0x4caa64[_0x2be1('0x29')]=_[_0x2be1('0x2c')](db['IntegrationReport'][_0x2be1('0x26')]);_0x4caa64['query']=_[_0x2be1('0x2c')](_0x3e707c[_0x2be1('0x2b')]);_0x4caa64[_0x2be1('0x2d')]=_[_0x2be1('0x40')](_0x4caa64[_0x2be1('0x29')],_0x4caa64['query']);_0x3ed26e[_0x2be1('0x2e')]=_[_0x2be1('0x40')](_0x4caa64[_0x2be1('0x29')],qs[_0x2be1('0x2f')](_0x3e707c['query'][_0x2be1('0x2f')]));_0x3ed26e[_0x2be1('0x2e')]=_0x3ed26e[_0x2be1('0x2e')][_0x2be1('0x30')]?_0x3ed26e[_0x2be1('0x2e')]:_0x4caa64['model'];if(_0x3e707c[_0x2be1('0x2b')][_0x2be1('0x41')]){_0x3ed26e[_0x2be1('0x3b')]=[{'all':!![]}];}_0x3ed26e=_[_0x2be1('0x37')]({},_0x3ed26e,_0x3e707c[_0x2be1('0x3a')]);return db[_0x2be1('0x25')][_0x2be1('0x42')](_0x3ed26e)[_0x2be1('0x1e')](handleEntityNotFound(_0xeb7137,null))[_0x2be1('0x1e')](respondWithResult(_0xeb7137,null))[_0x2be1('0x3d')](handleError(_0xeb7137,null));};exports[_0x2be1('0x43')]=function(_0x1cf7c8,_0xb9df13){return db[_0x2be1('0x25')][_0x2be1('0x43')](_0x1cf7c8[_0x2be1('0x44')],{})[_0x2be1('0x1e')](respondWithResult(_0xb9df13,0xc9))[_0x2be1('0x3d')](handleError(_0xb9df13,null));};exports[_0x2be1('0x45')]=function(_0x4ebbca,_0x312b3a){if(_0x4ebbca['body']['id']){delete _0x4ebbca[_0x2be1('0x44')]['id'];}return db[_0x2be1('0x25')]['find']({'where':{'id':_0x4ebbca[_0x2be1('0x3f')]['id']}})[_0x2be1('0x1e')](handleEntityNotFound(_0x312b3a,null))[_0x2be1('0x1e')](saveUpdates(_0x4ebbca[_0x2be1('0x44')],null))[_0x2be1('0x1e')](respondWithResult(_0x312b3a,null))[_0x2be1('0x3d')](handleError(_0x312b3a,null));};exports[_0x2be1('0x1f')]=function(_0x3f6e98,_0x37c5f5){return db[_0x2be1('0x25')]['find']({'where':{'id':_0x3f6e98['params']['id']}})[_0x2be1('0x1e')](handleEntityNotFound(_0x37c5f5,null))[_0x2be1('0x1e')](removeEntity(_0x37c5f5,null))[_0x2be1('0x3d')](handleError(_0x37c5f5,null));};exports[_0x2be1('0x46')]=function(_0x37fdd0,_0x1961e3){return db['IntegrationReport'][_0x2be1('0x46')]()[_0x2be1('0x1e')](respondWithResult(_0x1961e3,null))[_0x2be1('0x3d')](handleError(_0x1961e3,null));};
\ No newline at end of file
+var _0x06b1=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter'];(function(_0x5d44d7,_0x3c13ea){var _0xf7b8e7=function(_0xc0a7ed){while(--_0xc0a7ed){_0x5d44d7['push'](_0x5d44d7['shift']());}};_0xf7b8e7(++_0x3c13ea);}(_0x06b1,0x129));var _0x106b=function(_0x5c1ddc,_0x538533){_0x5c1ddc=_0x5c1ddc-0x0;var _0x32f4d5=_0x06b1[_0x5c1ddc];return _0x32f4d5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x106b('0x0'));var zipdir=require(_0x106b('0x1'));var jsonpatch=require(_0x106b('0x2'));var rp=require(_0x106b('0x3'));var moment=require('moment');var BPromise=require(_0x106b('0x4'));var Mustache=require(_0x106b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x106b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x106b('0x7'));var squel=require(_0x106b('0x8'));var crypto=require('crypto');var jsforce=require(_0x106b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x106b('0xa'));var querystring=require(_0x106b('0xb'));var Papa=require('papaparse');var Redis=require(_0x106b('0xc'));var authService=require(_0x106b('0xd'));var qs=require(_0x106b('0xe'));var as=require(_0x106b('0xf'));var hardwareService=require(_0x106b('0x10'));var logger=require('../../config/logger')(_0x106b('0x11'));var utils=require(_0x106b('0x12'));var config=require(_0x106b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50667a,_0x254415){_0x254415=_0x254415||0xcc;return function(_0x1880d9){if(_0x1880d9){return _0x50667a[_0x106b('0x14')](_0x254415);}return _0x50667a[_0x106b('0x15')](_0x254415)[_0x106b('0x16')]();};}function respondWithResult(_0x466811,_0xf24440){_0xf24440=_0xf24440||0xc8;return function(_0x56b094){if(_0x56b094){return _0x466811[_0x106b('0x15')](_0xf24440)[_0x106b('0x17')](_0x56b094);}};}function respondWithFilteredResult(_0xac81ec,_0x2d711d){return function(_0x1aeca6){if(_0x1aeca6){var _0x12d79a=_0x1aeca6[_0x106b('0x18')],_0x45dad8=_0x2d711d[_0x106b('0x19')],_0x22f255=_0x2d711d[_0x106b('0x19')]+_0x2d711d['limit'],_0x3ed83c;if(_0x22f255>=_0x12d79a){_0x22f255=_0x12d79a;_0x3ed83c=0xc8;}else{_0x3ed83c=0xce;}_0xac81ec[_0x106b('0x15')](_0x3ed83c);return _0xac81ec[_0x106b('0x1a')](_0x106b('0x1b'),_0x45dad8+'-'+_0x22f255+'/'+_0x12d79a)[_0x106b('0x17')](_0x1aeca6);}return null;};}function patchUpdates(_0x30a771){return function(_0x239d09){try{jsonpatch[_0x106b('0x1c')](_0x239d09,_0x30a771,!![]);}catch(_0x58c5bd){return BPromise['reject'](_0x58c5bd);}return _0x239d09[_0x106b('0x1d')]();};}function saveUpdates(_0x151bd7,_0x417324){return function(_0x16c691){if(_0x16c691){return _0x16c691[_0x106b('0x1e')](_0x151bd7)[_0x106b('0x1f')](function(_0x2b20bd){return _0x2b20bd;});}return null;};}function removeEntity(_0x4f9aa9,_0x5c27e1){return function(_0x51df84){if(_0x51df84){return _0x51df84[_0x106b('0x20')]()['then'](function(){_0x4f9aa9[_0x106b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce925,_0xc4745e){return function(_0x3892ad){if(!_0x3892ad){_0x2ce925[_0x106b('0x14')](0x194);}return _0x3892ad;};}function handleError(_0x4b0825,_0x383c7c){_0x383c7c=_0x383c7c||0x1f4;return function(_0x5ad718){logger[_0x106b('0x21')](_0x5ad718['stack']);if(_0x5ad718[_0x106b('0x22')]){delete _0x5ad718['name'];}_0x4b0825[_0x106b('0x15')](_0x383c7c)[_0x106b('0x23')](_0x5ad718);};}exports[_0x106b('0x24')]=function(_0x13eb7b,_0x4c2672){var _0x341a34={},_0x49a7a2={},_0x2a301b={'count':0x0,'rows':[]};var _0x3c596c=_[_0x106b('0x25')](db[_0x106b('0x26')][_0x106b('0x27')],function(_0x2cc252){return{'name':_0x2cc252[_0x106b('0x28')],'type':_0x2cc252[_0x106b('0x29')]['key']};});_0x49a7a2[_0x106b('0x2a')]=_[_0x106b('0x25')](_0x3c596c,_0x106b('0x22'));_0x49a7a2[_0x106b('0x2b')]=_[_0x106b('0x2c')](_0x13eb7b[_0x106b('0x2b')]);_0x49a7a2[_0x106b('0x2d')]=_[_0x106b('0x2e')](_0x49a7a2[_0x106b('0x2a')],_0x49a7a2['query']);_0x341a34[_0x106b('0x2f')]=_['intersection'](_0x49a7a2[_0x106b('0x2a')],qs[_0x106b('0x30')](_0x13eb7b['query'][_0x106b('0x30')]));_0x341a34[_0x106b('0x2f')]=_0x341a34['attributes'][_0x106b('0x31')]?_0x341a34[_0x106b('0x2f')]:_0x49a7a2[_0x106b('0x2a')];if(!_0x13eb7b['query'][_0x106b('0x32')](_0x106b('0x33'))){_0x341a34['limit']=qs[_0x106b('0x34')](_0x13eb7b['query'][_0x106b('0x34')]);_0x341a34['offset']=qs[_0x106b('0x19')](_0x13eb7b[_0x106b('0x2b')]['offset']);}_0x341a34[_0x106b('0x35')]=qs[_0x106b('0x36')](_0x13eb7b['query']['sort']);_0x341a34[_0x106b('0x37')]=qs[_0x106b('0x2d')](_[_0x106b('0x38')](_0x13eb7b[_0x106b('0x2b')],_0x49a7a2[_0x106b('0x2d')]),_0x3c596c);if(_0x13eb7b[_0x106b('0x2b')][_0x106b('0x39')]){_0x341a34[_0x106b('0x37')]=_[_0x106b('0x3a')](_0x341a34['where'],{'$or':_['map'](_0x3c596c,function(_0x29314a){if(_0x29314a['type']!==_0x106b('0x3b')){var _0x29763f={};_0x29763f[_0x29314a['name']]={'$like':'%'+_0x13eb7b[_0x106b('0x2b')][_0x106b('0x39')]+'%'};return _0x29763f;}})});}_0x341a34=_['merge']({},_0x341a34,_0x13eb7b[_0x106b('0x3c')]);var _0x417bce={'where':_0x341a34[_0x106b('0x37')]};return db[_0x106b('0x26')][_0x106b('0x18')](_0x417bce)[_0x106b('0x1f')](function(_0x152a15){_0x2a301b[_0x106b('0x18')]=_0x152a15;if(_0x13eb7b[_0x106b('0x2b')][_0x106b('0x3d')]){_0x341a34[_0x106b('0x3e')]=[{'all':!![]}];}return db[_0x106b('0x26')][_0x106b('0x3f')](_0x341a34);})['then'](function(_0xd90025){_0x2a301b[_0x106b('0x40')]=_0xd90025;return _0x2a301b;})[_0x106b('0x1f')](respondWithFilteredResult(_0x4c2672,_0x341a34))[_0x106b('0x41')](handleError(_0x4c2672,null));};exports[_0x106b('0x42')]=function(_0x4308aa,_0x4f5084){var _0x2ba8c8={'raw':![],'where':{'id':_0x4308aa['params']['id']}},_0x1ec3f2={};_0x1ec3f2[_0x106b('0x2a')]=_[_0x106b('0x2c')](db[_0x106b('0x26')]['rawAttributes']);_0x1ec3f2[_0x106b('0x2b')]=_['keys'](_0x4308aa['query']);_0x1ec3f2[_0x106b('0x2d')]=_[_0x106b('0x2e')](_0x1ec3f2[_0x106b('0x2a')],_0x1ec3f2[_0x106b('0x2b')]);_0x2ba8c8[_0x106b('0x2f')]=_[_0x106b('0x2e')](_0x1ec3f2['model'],qs['fields'](_0x4308aa[_0x106b('0x2b')]['fields']));_0x2ba8c8['attributes']=_0x2ba8c8[_0x106b('0x2f')][_0x106b('0x31')]?_0x2ba8c8[_0x106b('0x2f')]:_0x1ec3f2[_0x106b('0x2a')];if(_0x4308aa[_0x106b('0x2b')]['includeAll']){_0x2ba8c8[_0x106b('0x3e')]=[{'all':!![]}];}_0x2ba8c8=_[_0x106b('0x3a')]({},_0x2ba8c8,_0x4308aa[_0x106b('0x3c')]);return db[_0x106b('0x26')]['find'](_0x2ba8c8)[_0x106b('0x1f')](handleEntityNotFound(_0x4f5084,null))[_0x106b('0x1f')](respondWithResult(_0x4f5084,null))[_0x106b('0x41')](handleError(_0x4f5084,null));};exports[_0x106b('0x43')]=function(_0x1a3294,_0x126f83){return db[_0x106b('0x26')]['create'](_0x1a3294[_0x106b('0x44')],{})[_0x106b('0x1f')](respondWithResult(_0x126f83,0xc9))[_0x106b('0x41')](handleError(_0x126f83,null));};exports['update']=function(_0x27b1af,_0xc3c5dd){if(_0x27b1af[_0x106b('0x44')]['id']){delete _0x27b1af[_0x106b('0x44')]['id'];}return db[_0x106b('0x26')][_0x106b('0x45')]({'where':{'id':_0x27b1af['params']['id']}})[_0x106b('0x1f')](handleEntityNotFound(_0xc3c5dd,null))[_0x106b('0x1f')](saveUpdates(_0x27b1af[_0x106b('0x44')],null))['then'](respondWithResult(_0xc3c5dd,null))['catch'](handleError(_0xc3c5dd,null));};exports[_0x106b('0x20')]=function(_0x5abc4b,_0x408b5c){return db['IntegrationReport'][_0x106b('0x45')]({'where':{'id':_0x5abc4b['params']['id']}})['then'](handleEntityNotFound(_0x408b5c,null))[_0x106b('0x1f')](removeEntity(_0x408b5c,null))[_0x106b('0x41')](handleError(_0x408b5c,null));};exports[_0x106b('0x46')]=function(_0x245764,_0x406818){return db['IntegrationReport'][_0x106b('0x46')]()[_0x106b('0x1f')](respondWithResult(_0x406818,null))[_0x106b('0x41')](handleError(_0x406818,null));};
\ No newline at end of file
index dbaf898..33589f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52c2=['path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util','api','moment','bluebird'];(function(_0x3cf5a3,_0x5a4492){var _0x39ba2d=function(_0x3ed989){while(--_0x3ed989){_0x3cf5a3['push'](_0x3cf5a3['shift']());}};_0x39ba2d(++_0x5a4492);}(_0x52c2,0x187));var _0x252c=function(_0x5a4789,_0x4a1044){_0x5a4789=_0x5a4789-0x0;var _0x59f547=_0x52c2[_0x5a4789];return _0x59f547;};'use strict';var _=require(_0x252c('0x0'));var util=require(_0x252c('0x1'));var logger=require('../../config/logger')(_0x252c('0x2'));var moment=require(_0x252c('0x3'));var BPromise=require(_0x252c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x252c('0x5'));var rimraf=require('rimraf');var config=require(_0x252c('0x6'));var attributes=require(_0x252c('0x7'));module[_0x252c('0x8')]=function(_0x332a28,_0x18559a){return _0x332a28[_0x252c('0x9')](_0x252c('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb70=['lodash','../../config/logger','api','path','rimraf','../../config/environment','exports','define','IntegrationReport','report_integration'];(function(_0x5e4c4e,_0x4925b2){var _0x2d6477=function(_0x527d0a){while(--_0x527d0a){_0x5e4c4e['push'](_0x5e4c4e['shift']());}};_0x2d6477(++_0x4925b2);}(_0xcb70,0x1d6));var _0x0cb7=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xcb70[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x0cb7('0x0'));var util=require('util');var logger=require(_0x0cb7('0x1'))(_0x0cb7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cb7('0x3'));var rimraf=require(_0x0cb7('0x4'));var config=require(_0x0cb7('0x5'));var attributes=require('./integrationReport.attributes');module[_0x0cb7('0x6')]=function(_0x766628,_0x2e42ab){return _0x766628[_0x0cb7('0x7')](_0x0cb7('0x8'),attributes,{'tableName':_0x0cb7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9a4b75b..8c7d54a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
+var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1184ce,_0x478240){var _0x1e1ec3=function(_0x352848){while(--_0x352848){_0x1184ce['push'](_0x1184ce['shift']());}};_0x1e1ec3(++_0x478240);}(_0xb10b,0x12a));var _0xbb10=function(_0x100770,_0x2a6617){_0x100770=_0x100770-0x0;var _0x26c777=_0xb10b[_0x100770];return _0x26c777;};'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);});});}
\ No newline at end of file
index 32881b1..13d2078 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./interval.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller['addInterval']);router[_0x7995('0xe')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router;
\ No newline at end of file
+var _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x205414,_0x16abb4){var _0x25f806=function(_0x1b1361){while(--_0x1b1361){_0x205414['push'](_0x205414['shift']());}};_0x25f806(++_0x16abb4);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router;
\ No newline at end of file
index 5e76364..3290eb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c99=['STRING','sequelize'];(function(_0x1b8319,_0x29f403){var _0x50a3a3=function(_0x13b3ea){while(--_0x13b3ea){_0x1b8319['push'](_0x1b8319['shift']());}};_0x50a3a3(++_0x29f403);}(_0x2c99,0x1ed));var _0x92c9=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x2c99[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0x92c9('0x0'));module['exports']={'name':{'type':Sequelize[_0x92c9('0x1')]},'description':{'type':Sequelize[_0x92c9('0x1')]},'interval':{'type':Sequelize[_0x92c9('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0xe0ba=['exports','STRING'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xe0ba,0x1a8));var _0xae0b=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xe0ba[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require('sequelize');module[_0xae0b('0x0')]={'name':{'type':Sequelize[_0xae0b('0x1')]},'description':{'type':Sequelize[_0xae0b('0x1')]},'interval':{'type':Sequelize[_0xae0b('0x1')],'allowNull':!![]}};
\ No newline at end of file
index fef70f6..bacddd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc965=['sort','pick','where','merge','VIRTUAL','options','Interval','count','includeAll','include','findAll','catch','show','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','findOne','order','filter','sequelize','IntervalId','bulkCreate','html-pdf','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','set','save','update','get','Intervals','UserProfileResource','destroy','then','status','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0xc965,0x6f));var _0x5c96=function(_0x4a5f95,_0x1553d3){_0x4a5f95=_0x4a5f95-0x0;var _0x4dcfa5=_0xc965[_0x4a5f95];return _0x4dcfa5;};'use strict';var pdf=require(_0x5c96('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5c96('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5c96('0x2'));var Mustache=require(_0x5c96('0x3'));var util=require('util');var path=require(_0x5c96('0x4'));var sox=require(_0x5c96('0x5'));var csv=require(_0x5c96('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5c96('0x7'));var squel=require(_0x5c96('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5c96('0x9'));var toCsv=require(_0x5c96('0x6'));var querystring=require(_0x5c96('0xa'));var Papa=require(_0x5c96('0xb'));var Redis=require('ioredis');var authService=require(_0x5c96('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x5c96('0xd'));var hardwareService=require(_0x5c96('0xe'));var logger=require(_0x5c96('0xf'))('api');var utils=require(_0x5c96('0x10'));var config=require(_0x5c96('0x11'));var db=require(_0x5c96('0x12'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2da932,_0x51ef70){_0x51ef70=_0x51ef70||0xcc;return function(_0x4e922a){if(_0x4e922a){return _0x2da932[_0x5c96('0x13')](_0x51ef70);}return _0x2da932['status'](_0x51ef70)[_0x5c96('0x14')]();};}function respondWithResult(_0x4f795d,_0x4713fe){_0x4713fe=_0x4713fe||0xc8;return function(_0x1dc296){if(_0x1dc296){return _0x4f795d['status'](_0x4713fe)[_0x5c96('0x15')](_0x1dc296);}};}function respondWithFilteredResult(_0x2ad486,_0x480dba){return function(_0x1e366c){if(_0x1e366c){var _0x506326=_0x1e366c['count'],_0x149639=_0x480dba['offset'],_0x315031=_0x480dba[_0x5c96('0x16')]+_0x480dba['limit'],_0x404e50;if(_0x315031>=_0x506326){_0x315031=_0x506326;_0x404e50=0xc8;}else{_0x404e50=0xce;}_0x2ad486['status'](_0x404e50);return _0x2ad486[_0x5c96('0x17')]('Content-Range',_0x149639+'-'+_0x315031+'/'+_0x506326)[_0x5c96('0x15')](_0x1e366c);}return null;};}function patchUpdates(_0xc4b1c2){return function(_0x1a765a){try{jsonpatch['apply'](_0x1a765a,_0xc4b1c2,!![]);}catch(_0x320fbb){return BPromise['reject'](_0x320fbb);}return _0x1a765a[_0x5c96('0x18')]();};}function saveUpdates(_0x16e8a5,_0x35a1df){return function(_0x59353e){if(_0x59353e){return _0x59353e[_0x5c96('0x19')](_0x16e8a5)['then'](function(_0x31ab){return _0x31ab;});}return null;};}function removeEntity(_0x14fac7,_0x367b2e){return function(_0x147732){if(_0x147732){return _0x147732['destroy']()['then'](function(){var _0x383e14=_0x147732[_0x5c96('0x1a')]({'plain':!![]});var _0x31fabf=_0x5c96('0x1b');return db[_0x5c96('0x1c')][_0x5c96('0x1d')]({'where':{'type':_0x31fabf,'resourceId':_0x383e14['id']}})[_0x5c96('0x1e')](function(){return _0x147732;});})[_0x5c96('0x1e')](function(){_0x14fac7[_0x5c96('0x1f')](0xcc)[_0x5c96('0x14')]();});}};}function handleEntityNotFound(_0x2fb54c,_0x46a126){return function(_0x4214ba){if(!_0x4214ba){_0x2fb54c[_0x5c96('0x13')](0x194);}return _0x4214ba;};}function handleError(_0x223d57,_0x48e686){_0x48e686=_0x48e686||0x1f4;return function(_0xd919fe){logger[_0x5c96('0x20')](_0xd919fe[_0x5c96('0x21')]);if(_0xd919fe['name']){delete _0xd919fe[_0x5c96('0x22')];}_0x223d57[_0x5c96('0x1f')](_0x48e686)[_0x5c96('0x23')](_0xd919fe);};}exports[_0x5c96('0x24')]=function(_0x2f1eaa,_0x1fd808){var _0x46b42d={},_0x18ae13={},_0x446b0f={'count':0x0,'rows':[]};var _0x4e0979=_[_0x5c96('0x25')](db['Interval'][_0x5c96('0x26')],function(_0x21ab30){return{'name':_0x21ab30['fieldName'],'type':_0x21ab30[_0x5c96('0x27')]['key']};});_0x18ae13[_0x5c96('0x28')]=_[_0x5c96('0x25')](_0x4e0979,_0x5c96('0x22'));_0x18ae13[_0x5c96('0x29')]=_[_0x5c96('0x2a')](_0x2f1eaa['query']);_0x18ae13[_0x5c96('0x2b')]=_[_0x5c96('0x2c')](_0x18ae13[_0x5c96('0x28')],_0x18ae13[_0x5c96('0x29')]);_0x46b42d[_0x5c96('0x2d')]=_['intersection'](_0x18ae13['model'],qs[_0x5c96('0x2e')](_0x2f1eaa[_0x5c96('0x29')]['fields']));_0x46b42d[_0x5c96('0x2d')]=_0x46b42d[_0x5c96('0x2d')][_0x5c96('0x2f')]?_0x46b42d[_0x5c96('0x2d')]:_0x18ae13['model'];if(!_0x2f1eaa[_0x5c96('0x29')][_0x5c96('0x30')](_0x5c96('0x31'))){_0x46b42d[_0x5c96('0x32')]=qs[_0x5c96('0x32')](_0x2f1eaa['query']['limit']);_0x46b42d['offset']=qs[_0x5c96('0x16')](_0x2f1eaa[_0x5c96('0x29')][_0x5c96('0x16')]);}_0x46b42d['order']=qs[_0x5c96('0x33')](_0x2f1eaa[_0x5c96('0x29')][_0x5c96('0x33')]);_0x46b42d['where']=qs[_0x5c96('0x2b')](_[_0x5c96('0x34')](_0x2f1eaa['query'],_0x18ae13[_0x5c96('0x2b')]),_0x4e0979);if(_0x2f1eaa[_0x5c96('0x29')]['filter']){_0x46b42d[_0x5c96('0x35')]=_[_0x5c96('0x36')](_0x46b42d[_0x5c96('0x35')],{'$or':_[_0x5c96('0x25')](_0x4e0979,function(_0x8f3dea){if(_0x8f3dea[_0x5c96('0x27')]!==_0x5c96('0x37')){var _0x5cb221={};_0x5cb221[_0x8f3dea['name']]={'$like':'%'+_0x2f1eaa[_0x5c96('0x29')]['filter']+'%'};return _0x5cb221;}})});}_0x46b42d=_['merge']({},_0x46b42d,_0x2f1eaa[_0x5c96('0x38')]);var _0x2f58b1={'where':_0x46b42d['where']};return db[_0x5c96('0x39')]['count'](_0x2f58b1)[_0x5c96('0x1e')](function(_0x2cead7){_0x446b0f[_0x5c96('0x3a')]=_0x2cead7;if(_0x2f1eaa[_0x5c96('0x29')][_0x5c96('0x3b')]){_0x46b42d[_0x5c96('0x3c')]=[{'all':!![]}];}return db[_0x5c96('0x39')][_0x5c96('0x3d')](_0x46b42d);})[_0x5c96('0x1e')](function(_0x396b0a){_0x446b0f['rows']=_0x396b0a;return _0x446b0f;})[_0x5c96('0x1e')](respondWithFilteredResult(_0x1fd808,_0x46b42d))[_0x5c96('0x3e')](handleError(_0x1fd808,null));};exports[_0x5c96('0x3f')]=function(_0x342f7e,_0x3e7005){var _0x4141cd={'raw':!![],'where':{'id':_0x342f7e[_0x5c96('0x40')]['id']}},_0x31ee3c={};_0x31ee3c[_0x5c96('0x28')]=_[_0x5c96('0x2a')](db['Interval'][_0x5c96('0x26')]);_0x31ee3c[_0x5c96('0x29')]=_[_0x5c96('0x2a')](_0x342f7e[_0x5c96('0x29')]);_0x31ee3c[_0x5c96('0x2b')]=_['intersection'](_0x31ee3c[_0x5c96('0x28')],_0x31ee3c[_0x5c96('0x29')]);_0x4141cd[_0x5c96('0x2d')]=_['intersection'](_0x31ee3c[_0x5c96('0x28')],qs[_0x5c96('0x2e')](_0x342f7e[_0x5c96('0x29')]['fields']));_0x4141cd['attributes']=_0x4141cd[_0x5c96('0x2d')][_0x5c96('0x2f')]?_0x4141cd['attributes']:_0x31ee3c['model'];if(_0x342f7e['query'][_0x5c96('0x3b')]){_0x4141cd['include']=[{'all':!![]}];}_0x4141cd=_[_0x5c96('0x36')]({},_0x4141cd,_0x342f7e[_0x5c96('0x38')]);return db[_0x5c96('0x39')][_0x5c96('0x41')](_0x4141cd)[_0x5c96('0x1e')](handleEntityNotFound(_0x3e7005,null))[_0x5c96('0x1e')](respondWithResult(_0x3e7005,null))[_0x5c96('0x3e')](handleError(_0x3e7005,null));};exports[_0x5c96('0x42')]=function(_0x5f4004,_0x173523){return db['Interval']['create'](_0x5f4004[_0x5c96('0x43')],{})[_0x5c96('0x1e')](function(_0x411258){var _0x21eac7=_0x5f4004['user']['get']({'plain':!![]});if(!_0x21eac7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21eac7[_0x5c96('0x44')]===_0x5c96('0x45')){var _0x3af9b2=_0x411258[_0x5c96('0x1a')]({'plain':!![]});var _0x27f085='Intervals';return db[_0x5c96('0x46')]['find']({'where':{'name':_0x27f085,'userProfileId':_0x21eac7[_0x5c96('0x47')]},'raw':!![]})[_0x5c96('0x1e')](function(_0x2f48dd){if(_0x2f48dd&&_0x2f48dd[_0x5c96('0x48')]===0x0){return db[_0x5c96('0x1c')][_0x5c96('0x42')]({'name':_0x3af9b2['name'],'resourceId':_0x3af9b2['id'],'type':_0x2f48dd['name'],'sectionId':_0x2f48dd['id']},{})[_0x5c96('0x1e')](function(){return _0x411258;});}else{return _0x411258;}})[_0x5c96('0x3e')](function(_0x50cbbb){logger[_0x5c96('0x20')](_0x5c96('0x49'),_0x50cbbb);throw _0x50cbbb;});}return _0x411258;})[_0x5c96('0x1e')](respondWithResult(_0x173523,0xc9))[_0x5c96('0x3e')](handleError(_0x173523,null));};exports[_0x5c96('0x19')]=function(_0x26cd8a,_0x39f67b){if(_0x26cd8a[_0x5c96('0x43')]['id']){delete _0x26cd8a['body']['id'];}return db[_0x5c96('0x39')][_0x5c96('0x41')]({'where':{'id':_0x26cd8a[_0x5c96('0x40')]['id']}})[_0x5c96('0x1e')](handleEntityNotFound(_0x39f67b,null))['then'](saveUpdates(_0x26cd8a[_0x5c96('0x43')],null))[_0x5c96('0x1e')](respondWithResult(_0x39f67b,null))[_0x5c96('0x3e')](handleError(_0x39f67b,null));};exports[_0x5c96('0x1d')]=function(_0xeb5539,_0x369f8b){return db['Interval'][_0x5c96('0x41')]({'where':{'id':_0xeb5539[_0x5c96('0x40')]['id']}})[_0x5c96('0x1e')](handleEntityNotFound(_0x369f8b,null))[_0x5c96('0x1e')](removeEntity(_0x369f8b,null))['catch'](handleError(_0x369f8b,null));};exports[_0x5c96('0x4a')]=function(_0x3e0756,_0x784b04,_0x5f3603){if(_0x3e0756[_0x5c96('0x43')]['id']){delete _0x3e0756[_0x5c96('0x43')]['id'];}return db[_0x5c96('0x39')][_0x5c96('0x41')]({'where':{'id':_0x3e0756[_0x5c96('0x40')]['id']}})[_0x5c96('0x1e')](handleEntityNotFound(_0x784b04,null))['then'](function(_0x233a40){if(_0x233a40){_0x3e0756[_0x5c96('0x43')]['IntervalId']=_0x233a40['id'];return db[_0x5c96('0x39')][_0x5c96('0x42')](_0x3e0756['body']);}})[_0x5c96('0x1e')](respondWithResult(_0x784b04,null))['catch'](handleError(_0x784b04,null));};exports['getIntervals']=function(_0x3ecac5,_0x29624e,_0x38ce2f){var _0x4c463d={};var _0x5b0834={};var _0x44616e;var _0x21f0fb;return db[_0x5c96('0x39')][_0x5c96('0x4b')]({'where':{'id':_0x3ecac5[_0x5c96('0x40')]['id']}})[_0x5c96('0x1e')](handleEntityNotFound(_0x29624e,null))['then'](function(_0x3244a8){if(_0x3244a8){_0x44616e=_0x3244a8;_0x5b0834[_0x5c96('0x28')]=_['keys'](db[_0x5c96('0x39')][_0x5c96('0x26')]);_0x5b0834[_0x5c96('0x29')]=_[_0x5c96('0x2a')](_0x3ecac5[_0x5c96('0x29')]);_0x5b0834[_0x5c96('0x2b')]=_[_0x5c96('0x2c')](_0x5b0834[_0x5c96('0x28')],_0x5b0834[_0x5c96('0x29')]);_0x4c463d[_0x5c96('0x2d')]=_['intersection'](_0x5b0834['model'],qs[_0x5c96('0x2e')](_0x3ecac5['query'][_0x5c96('0x2e')]));_0x4c463d[_0x5c96('0x2d')]=_0x4c463d[_0x5c96('0x2d')]['length']?_0x4c463d[_0x5c96('0x2d')]:_0x5b0834[_0x5c96('0x28')];_0x4c463d[_0x5c96('0x4c')]=qs[_0x5c96('0x33')](_0x3ecac5['query'][_0x5c96('0x33')]);_0x4c463d[_0x5c96('0x35')]=qs[_0x5c96('0x2b')](_[_0x5c96('0x34')](_0x3ecac5[_0x5c96('0x29')],_0x5b0834[_0x5c96('0x2b')]));if(_0x3ecac5[_0x5c96('0x29')][_0x5c96('0x4d')]){_0x4c463d['where']=_[_0x5c96('0x36')](_0x4c463d[_0x5c96('0x35')],{'$or':_[_0x5c96('0x25')](_0x4c463d[_0x5c96('0x2d')],function(_0x480c92){var _0x9efe72={};_0x9efe72[_0x480c92]={'$like':'%'+_0x3ecac5['query'][_0x5c96('0x4d')]+'%'};return _0x9efe72;})});}_0x4c463d=_[_0x5c96('0x36')]({},_0x4c463d,_0x3ecac5[_0x5c96('0x38')]);return _0x44616e['getIntervals'](_0x4c463d);}})[_0x5c96('0x1e')](function(_0x514982){if(_0x514982){_0x21f0fb=_0x514982[_0x5c96('0x2f')];if(!_0x3ecac5['query'][_0x5c96('0x30')](_0x5c96('0x31'))){_0x4c463d[_0x5c96('0x32')]=qs[_0x5c96('0x32')](_0x3ecac5['query']['limit']);_0x4c463d[_0x5c96('0x16')]=qs[_0x5c96('0x16')](_0x3ecac5['query'][_0x5c96('0x16')]);}return _0x44616e['getIntervals'](_0x4c463d);}})[_0x5c96('0x1e')](function(_0x6af10b){if(_0x6af10b){return _0x6af10b?{'count':_0x21f0fb,'rows':_0x6af10b}:null;}})[_0x5c96('0x1e')](respondWithResult(_0x29624e,null))['catch'](handleError(_0x29624e,null));};exports['addIntervals']=function(_0x3f6a18,_0x4b3ee1,_0xf74842){return db[_0x5c96('0x39')][_0x5c96('0x4b')]({'where':{'id':_0x3f6a18[_0x5c96('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b3ee1,null))[_0x5c96('0x1e')](function(_0x7c8747){if(_0x7c8747){return db[_0x5c96('0x4e')]['transaction'](function(_0x3185b2){return db[_0x5c96('0x39')][_0x5c96('0x1d')]({'where':{'IntervalId':_0x3f6a18[_0x5c96('0x40')]['id']},'transaction':_0x3185b2})[_0x5c96('0x1e')](function(_0x4b5afd){var _0x2d3a9e=_[_0x5c96('0x25')](_0x3f6a18[_0x5c96('0x43')],function(_0x2d4e7f){delete _0x2d4e7f['id'];_0x2d4e7f[_0x5c96('0x4f')]=_0x3f6a18[_0x5c96('0x40')]['id'];return _0x2d4e7f;});return db[_0x5c96('0x39')][_0x5c96('0x50')](_0x2d3a9e,{'transaction':_0x3185b2});});})[_0x5c96('0x1e')](function(){return db[_0x5c96('0x39')][_0x5c96('0x3d')]({'where':{'IntervalId':_0x3f6a18[_0x5c96('0x40')]['id']}});});}})[_0x5c96('0x1e')](respondWithResult(_0x4b3ee1,null))['catch'](handleError(_0x4b3ee1,null));};
\ No newline at end of file
+var _0x7837=['status','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','name','index','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','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','params','IntervalId','getIntervals','findOne','length','pick','sequelize','transaction','bulkCreate','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','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','../../mysqldb','sendStatus','end','json','count','offset','limit'];(function(_0xe4e05c,_0x1e8921){var _0x4e956f=function(_0x4ef592){while(--_0x4ef592){_0xe4e05c['push'](_0xe4e05c['shift']());}};_0x4e956f(++_0x1e8921);}(_0x7837,0xf3));var _0x7783=function(_0x1befb6,_0x45c9ad){_0x1befb6=_0x1befb6-0x0;var _0xcfa81=_0x7837[_0x1befb6];return _0xcfa81;};'use strict';var pdf=require(_0x7783('0x0'));var emlformat=require(_0x7783('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7783('0x2'));var rp=require(_0x7783('0x3'));var moment=require(_0x7783('0x4'));var BPromise=require(_0x7783('0x5'));var Mustache=require(_0x7783('0x6'));var util=require(_0x7783('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7783('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7783('0x9'));var crypto=require(_0x7783('0xa'));var jsforce=require(_0x7783('0xb'));var deskjs=require(_0x7783('0xc'));var toCsv=require(_0x7783('0x8'));var querystring=require(_0x7783('0xd'));var Papa=require(_0x7783('0xe'));var Redis=require('ioredis');var authService=require(_0x7783('0xf'));var qs=require(_0x7783('0x10'));var as=require(_0x7783('0x11'));var hardwareService=require(_0x7783('0x12'));var logger=require(_0x7783('0x13'))(_0x7783('0x14'));var utils=require(_0x7783('0x15'));var config=require(_0x7783('0x16'));var db=require(_0x7783('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4f3dd4,_0xedf2af){_0xedf2af=_0xedf2af||0xcc;return function(_0x479d3b){if(_0x479d3b){return _0x4f3dd4[_0x7783('0x18')](_0xedf2af);}return _0x4f3dd4['status'](_0xedf2af)[_0x7783('0x19')]();};}function respondWithResult(_0x2837d4,_0x20908b){_0x20908b=_0x20908b||0xc8;return function(_0x22ee69){if(_0x22ee69){return _0x2837d4['status'](_0x20908b)[_0x7783('0x1a')](_0x22ee69);}};}function respondWithFilteredResult(_0x49a8da,_0x374a78){return function(_0x502540){if(_0x502540){var _0x394813=_0x502540[_0x7783('0x1b')],_0x384e1e=_0x374a78[_0x7783('0x1c')],_0x14bd89=_0x374a78[_0x7783('0x1c')]+_0x374a78[_0x7783('0x1d')],_0xef698;if(_0x14bd89>=_0x394813){_0x14bd89=_0x394813;_0xef698=0xc8;}else{_0xef698=0xce;}_0x49a8da[_0x7783('0x1e')](_0xef698);return _0x49a8da[_0x7783('0x1f')](_0x7783('0x20'),_0x384e1e+'-'+_0x14bd89+'/'+_0x394813)[_0x7783('0x1a')](_0x502540);}return null;};}function patchUpdates(_0xfcecf9){return function(_0x64a9fe){try{jsonpatch[_0x7783('0x21')](_0x64a9fe,_0xfcecf9,!![]);}catch(_0xfe1f5a){return BPromise[_0x7783('0x22')](_0xfe1f5a);}return _0x64a9fe[_0x7783('0x23')]();};}function saveUpdates(_0x4ca52a,_0xc1b2de){return function(_0x3d982d){if(_0x3d982d){return _0x3d982d[_0x7783('0x24')](_0x4ca52a)[_0x7783('0x25')](function(_0x5da28e){return _0x5da28e;});}return null;};}function removeEntity(_0x20ba02,_0x4a1d24){return function(_0x1368cd){if(_0x1368cd){return _0x1368cd[_0x7783('0x26')]()['then'](function(){var _0x126d55=_0x1368cd[_0x7783('0x27')]({'plain':!![]});var _0x5ae057=_0x7783('0x28');return db[_0x7783('0x29')]['destroy']({'where':{'type':_0x5ae057,'resourceId':_0x126d55['id']}})['then'](function(){return _0x1368cd;});})[_0x7783('0x25')](function(){_0x20ba02[_0x7783('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2949ab,_0x174672){return function(_0x2125e2){if(!_0x2125e2){_0x2949ab[_0x7783('0x18')](0x194);}return _0x2125e2;};}function handleError(_0x3a6294,_0x2c57d3){_0x2c57d3=_0x2c57d3||0x1f4;return function(_0xf38da5){logger[_0x7783('0x2a')](_0xf38da5['stack']);if(_0xf38da5[_0x7783('0x2b')]){delete _0xf38da5[_0x7783('0x2b')];}_0x3a6294[_0x7783('0x1e')](_0x2c57d3)['send'](_0xf38da5);};}exports[_0x7783('0x2c')]=function(_0x34b83c,_0x401778){var _0x12fffa={},_0x372662={},_0x1d0447={'count':0x0,'rows':[]};var _0x1c7a98=_['map'](db[_0x7783('0x2d')][_0x7783('0x2e')],function(_0x3cbe28){return{'name':_0x3cbe28[_0x7783('0x2f')],'type':_0x3cbe28[_0x7783('0x30')][_0x7783('0x31')]};});_0x372662[_0x7783('0x32')]=_[_0x7783('0x33')](_0x1c7a98,_0x7783('0x2b'));_0x372662[_0x7783('0x34')]=_[_0x7783('0x35')](_0x34b83c[_0x7783('0x34')]);_0x372662[_0x7783('0x36')]=_[_0x7783('0x37')](_0x372662[_0x7783('0x32')],_0x372662[_0x7783('0x34')]);_0x12fffa[_0x7783('0x38')]=_['intersection'](_0x372662[_0x7783('0x32')],qs['fields'](_0x34b83c[_0x7783('0x34')][_0x7783('0x39')]));_0x12fffa[_0x7783('0x38')]=_0x12fffa[_0x7783('0x38')]['length']?_0x12fffa[_0x7783('0x38')]:_0x372662[_0x7783('0x32')];if(!_0x34b83c[_0x7783('0x34')][_0x7783('0x3a')](_0x7783('0x3b'))){_0x12fffa[_0x7783('0x1d')]=qs[_0x7783('0x1d')](_0x34b83c[_0x7783('0x34')][_0x7783('0x1d')]);_0x12fffa[_0x7783('0x1c')]=qs['offset'](_0x34b83c[_0x7783('0x34')]['offset']);}_0x12fffa[_0x7783('0x3c')]=qs['sort'](_0x34b83c['query'][_0x7783('0x3d')]);_0x12fffa[_0x7783('0x3e')]=qs[_0x7783('0x36')](_['pick'](_0x34b83c['query'],_0x372662[_0x7783('0x36')]),_0x1c7a98);if(_0x34b83c[_0x7783('0x34')][_0x7783('0x3f')]){_0x12fffa[_0x7783('0x3e')]=_['merge'](_0x12fffa['where'],{'$or':_[_0x7783('0x33')](_0x1c7a98,function(_0x847b56){if(_0x847b56[_0x7783('0x30')]!==_0x7783('0x40')){var _0x5b7352={};_0x5b7352[_0x847b56[_0x7783('0x2b')]]={'$like':'%'+_0x34b83c['query'][_0x7783('0x3f')]+'%'};return _0x5b7352;}})});}_0x12fffa=_[_0x7783('0x41')]({},_0x12fffa,_0x34b83c[_0x7783('0x42')]);var _0x554b6d={'where':_0x12fffa[_0x7783('0x3e')]};return db[_0x7783('0x2d')][_0x7783('0x1b')](_0x554b6d)[_0x7783('0x25')](function(_0x240491){_0x1d0447[_0x7783('0x1b')]=_0x240491;if(_0x34b83c[_0x7783('0x34')][_0x7783('0x43')]){_0x12fffa['include']=[{'all':!![]}];}return db[_0x7783('0x2d')][_0x7783('0x44')](_0x12fffa);})['then'](function(_0x59626a){_0x1d0447[_0x7783('0x45')]=_0x59626a;return _0x1d0447;})['then'](respondWithFilteredResult(_0x401778,_0x12fffa))[_0x7783('0x46')](handleError(_0x401778,null));};exports['show']=function(_0x14b951,_0x3ac78f){var _0x53b3a8={'raw':!![],'where':{'id':_0x14b951['params']['id']}},_0x525e66={};_0x525e66[_0x7783('0x32')]=_[_0x7783('0x35')](db[_0x7783('0x2d')][_0x7783('0x2e')]);_0x525e66[_0x7783('0x34')]=_[_0x7783('0x35')](_0x14b951[_0x7783('0x34')]);_0x525e66[_0x7783('0x36')]=_[_0x7783('0x37')](_0x525e66[_0x7783('0x32')],_0x525e66[_0x7783('0x34')]);_0x53b3a8[_0x7783('0x38')]=_[_0x7783('0x37')](_0x525e66['model'],qs['fields'](_0x14b951[_0x7783('0x34')][_0x7783('0x39')]));_0x53b3a8[_0x7783('0x38')]=_0x53b3a8[_0x7783('0x38')]['length']?_0x53b3a8['attributes']:_0x525e66[_0x7783('0x32')];if(_0x14b951['query'][_0x7783('0x43')]){_0x53b3a8[_0x7783('0x47')]=[{'all':!![]}];}_0x53b3a8=_['merge']({},_0x53b3a8,_0x14b951['options']);return db[_0x7783('0x2d')][_0x7783('0x48')](_0x53b3a8)[_0x7783('0x25')](handleEntityNotFound(_0x3ac78f,null))[_0x7783('0x25')](respondWithResult(_0x3ac78f,null))[_0x7783('0x46')](handleError(_0x3ac78f,null));};exports['create']=function(_0x193e51,_0x53437d){return db[_0x7783('0x2d')][_0x7783('0x49')](_0x193e51[_0x7783('0x4a')],{})[_0x7783('0x25')](function(_0x5237fd){var _0x37cf16=_0x193e51[_0x7783('0x4b')][_0x7783('0x27')]({'plain':!![]});if(!_0x37cf16)throw new Error(_0x7783('0x4c'));if(_0x37cf16[_0x7783('0x4d')]===_0x7783('0x4b')){var _0x7684c6=_0x5237fd[_0x7783('0x27')]({'plain':!![]});var _0x35b302=_0x7783('0x28');return db[_0x7783('0x4e')][_0x7783('0x48')]({'where':{'name':_0x35b302,'userProfileId':_0x37cf16[_0x7783('0x4f')]},'raw':!![]})[_0x7783('0x25')](function(_0x1a7c9e){if(_0x1a7c9e&&_0x1a7c9e[_0x7783('0x50')]===0x0){return db[_0x7783('0x29')][_0x7783('0x49')]({'name':_0x7684c6[_0x7783('0x2b')],'resourceId':_0x7684c6['id'],'type':_0x1a7c9e['name'],'sectionId':_0x1a7c9e['id']},{})[_0x7783('0x25')](function(){return _0x5237fd;});}else{return _0x5237fd;}})[_0x7783('0x46')](function(_0x51473c){logger[_0x7783('0x2a')](_0x7783('0x51'),_0x51473c);throw _0x51473c;});}return _0x5237fd;})[_0x7783('0x25')](respondWithResult(_0x53437d,0xc9))[_0x7783('0x46')](handleError(_0x53437d,null));};exports[_0x7783('0x24')]=function(_0x1ffd33,_0x37fc01){if(_0x1ffd33[_0x7783('0x4a')]['id']){delete _0x1ffd33[_0x7783('0x4a')]['id'];}return db[_0x7783('0x2d')]['find']({'where':{'id':_0x1ffd33[_0x7783('0x52')]['id']}})['then'](handleEntityNotFound(_0x37fc01,null))[_0x7783('0x25')](saveUpdates(_0x1ffd33[_0x7783('0x4a')],null))[_0x7783('0x25')](respondWithResult(_0x37fc01,null))[_0x7783('0x46')](handleError(_0x37fc01,null));};exports[_0x7783('0x26')]=function(_0x2f9db6,_0x327cbc){return db[_0x7783('0x2d')]['find']({'where':{'id':_0x2f9db6[_0x7783('0x52')]['id']}})['then'](handleEntityNotFound(_0x327cbc,null))[_0x7783('0x25')](removeEntity(_0x327cbc,null))[_0x7783('0x46')](handleError(_0x327cbc,null));};exports['addInterval']=function(_0x368088,_0xb22ae7,_0x2dfb7d){if(_0x368088[_0x7783('0x4a')]['id']){delete _0x368088[_0x7783('0x4a')]['id'];}return db['Interval'][_0x7783('0x48')]({'where':{'id':_0x368088[_0x7783('0x52')]['id']}})[_0x7783('0x25')](handleEntityNotFound(_0xb22ae7,null))[_0x7783('0x25')](function(_0x37e3ca){if(_0x37e3ca){_0x368088[_0x7783('0x4a')][_0x7783('0x53')]=_0x37e3ca['id'];return db[_0x7783('0x2d')][_0x7783('0x49')](_0x368088[_0x7783('0x4a')]);}})[_0x7783('0x25')](respondWithResult(_0xb22ae7,null))[_0x7783('0x46')](handleError(_0xb22ae7,null));};exports[_0x7783('0x54')]=function(_0x251ffd,_0x1db76b,_0x4d445d){var _0x34dcef={};var _0x296648={};var _0x79f722;var _0x3c70be;return db[_0x7783('0x2d')][_0x7783('0x55')]({'where':{'id':_0x251ffd[_0x7783('0x52')]['id']}})[_0x7783('0x25')](handleEntityNotFound(_0x1db76b,null))[_0x7783('0x25')](function(_0x5d084b){if(_0x5d084b){_0x79f722=_0x5d084b;_0x296648[_0x7783('0x32')]=_[_0x7783('0x35')](db['Interval']['rawAttributes']);_0x296648[_0x7783('0x34')]=_['keys'](_0x251ffd['query']);_0x296648[_0x7783('0x36')]=_[_0x7783('0x37')](_0x296648[_0x7783('0x32')],_0x296648[_0x7783('0x34')]);_0x34dcef[_0x7783('0x38')]=_[_0x7783('0x37')](_0x296648[_0x7783('0x32')],qs[_0x7783('0x39')](_0x251ffd[_0x7783('0x34')][_0x7783('0x39')]));_0x34dcef['attributes']=_0x34dcef[_0x7783('0x38')][_0x7783('0x56')]?_0x34dcef['attributes']:_0x296648['model'];_0x34dcef[_0x7783('0x3c')]=qs[_0x7783('0x3d')](_0x251ffd['query']['sort']);_0x34dcef[_0x7783('0x3e')]=qs[_0x7783('0x36')](_[_0x7783('0x57')](_0x251ffd[_0x7783('0x34')],_0x296648['filters']));if(_0x251ffd['query']['filter']){_0x34dcef[_0x7783('0x3e')]=_[_0x7783('0x41')](_0x34dcef[_0x7783('0x3e')],{'$or':_[_0x7783('0x33')](_0x34dcef[_0x7783('0x38')],function(_0x5f2656){var _0x7740cc={};_0x7740cc[_0x5f2656]={'$like':'%'+_0x251ffd[_0x7783('0x34')]['filter']+'%'};return _0x7740cc;})});}_0x34dcef=_[_0x7783('0x41')]({},_0x34dcef,_0x251ffd[_0x7783('0x42')]);return _0x79f722[_0x7783('0x54')](_0x34dcef);}})[_0x7783('0x25')](function(_0x58be42){if(_0x58be42){_0x3c70be=_0x58be42[_0x7783('0x56')];if(!_0x251ffd[_0x7783('0x34')][_0x7783('0x3a')](_0x7783('0x3b'))){_0x34dcef['limit']=qs[_0x7783('0x1d')](_0x251ffd['query'][_0x7783('0x1d')]);_0x34dcef['offset']=qs['offset'](_0x251ffd[_0x7783('0x34')]['offset']);}return _0x79f722['getIntervals'](_0x34dcef);}})[_0x7783('0x25')](function(_0x1f3729){if(_0x1f3729){return _0x1f3729?{'count':_0x3c70be,'rows':_0x1f3729}:null;}})[_0x7783('0x25')](respondWithResult(_0x1db76b,null))[_0x7783('0x46')](handleError(_0x1db76b,null));};exports['addIntervals']=function(_0x5bec27,_0xd4e9eb,_0x4c7938){return db['Interval'][_0x7783('0x55')]({'where':{'id':_0x5bec27['params']['id']}})['then'](handleEntityNotFound(_0xd4e9eb,null))[_0x7783('0x25')](function(_0x1583cf){if(_0x1583cf){return db[_0x7783('0x58')][_0x7783('0x59')](function(_0x58cc07){return db['Interval'][_0x7783('0x26')]({'where':{'IntervalId':_0x5bec27[_0x7783('0x52')]['id']},'transaction':_0x58cc07})['then'](function(_0x5aafa2){var _0x28c571=_[_0x7783('0x33')](_0x5bec27[_0x7783('0x4a')],function(_0x9bd27f){delete _0x9bd27f['id'];_0x9bd27f[_0x7783('0x53')]=_0x5bec27[_0x7783('0x52')]['id'];return _0x9bd27f;});return db[_0x7783('0x2d')][_0x7783('0x5a')](_0x28c571,{'transaction':_0x58cc07});});})[_0x7783('0x25')](function(){return db[_0x7783('0x2d')][_0x7783('0x44')]({'where':{'IntervalId':_0x5bec27[_0x7783('0x52')]['id']}});});}})[_0x7783('0x25')](respondWithResult(_0xd4e9eb,null))['catch'](handleError(_0xd4e9eb,null));};
\ No newline at end of file
index 40003d8..95a2a18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb50d=['exports','define','Interval','tools_intervals','rewrite','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c417a,_0xa07586){var _0x28b2ae=function(_0x1a9cf7){while(--_0x1a9cf7){_0x3c417a['push'](_0x3c417a['shift']());}};_0x28b2ae(++_0xa07586);}(_0xb50d,0xf5));var _0xdb50=function(_0x276bbd,_0xeff735){_0x276bbd=_0x276bbd-0x0;var _0x4cf287=_0xb50d[_0x276bbd];return _0x4cf287;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb50('0x0'))(_0xdb50('0x1'));var moment=require('moment');var BPromise=require(_0xdb50('0x2'));var rp=require(_0xdb50('0x3'));var fs=require('fs');var path=require(_0xdb50('0x4'));var rimraf=require(_0xdb50('0x5'));var config=require(_0xdb50('0x6'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0xdb50('0x7')]=function(_0xe3c447,_0x1ce74f){return _0xe3c447[_0xdb50('0x8')](_0xdb50('0x9'),attributes,{'tableName':_0xdb50('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ab3c1,_0x2835d8){extensions[_0xdb50('0xb')](_0xe3c447,_0x5ab3c1);},'afterBulkCreate':function(_0x318d08,_0x450604,_0x59a1c6){_0x59a1c6();extensions[_0xdb50('0xb')](_0xe3c447,_0x318d08[0x0]);},'afterUpdate':function(_0x36b773,_0x349bd2){extensions[_0xdb50('0xb')](_0xe3c447,_0x36b773);},'afterDestroy':function(_0x3fadec,_0x3fde27){extensions[_0xdb50('0xb')](_0xe3c447,_0x3fadec);}}});};
\ No newline at end of file
+var _0x0b25=['define','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','../../components/extensions/rewrite','exports'];(function(_0x348c09,_0x539458){var _0x22d339=function(_0x3be039){while(--_0x3be039){_0x348c09['push'](_0x348c09['shift']());}};_0x22d339(++_0x539458);}(_0x0b25,0x155));var _0x50b2=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x0b25[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0x50b2('0x0'));var util=require(_0x50b2('0x1'));var logger=require(_0x50b2('0x2'))(_0x50b2('0x3'));var moment=require(_0x50b2('0x4'));var BPromise=require(_0x50b2('0x5'));var rp=require(_0x50b2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x50b2('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0x50b2('0x8'));module[_0x50b2('0x9')]=function(_0x3cbc65,_0x29278f){return _0x3cbc65[_0x50b2('0xa')]('Interval',attributes,{'tableName':_0x50b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b7400,_0x319f6f){extensions[_0x50b2('0xc')](_0x3cbc65,_0x2b7400);},'afterBulkCreate':function(_0x54d618,_0x37811b,_0x593825){_0x593825();extensions[_0x50b2('0xc')](_0x3cbc65,_0x54d618[0x0]);},'afterUpdate':function(_0x3ace08,_0x4f9d1b){extensions[_0x50b2('0xc')](_0x3cbc65,_0x3ace08);},'afterDestroy':function(_0x494e53,_0x5b0f2a){extensions[_0x50b2('0xc')](_0x3cbc65,_0x494e53);}}});};
\ No newline at end of file
index 03dc43b..9a6b04d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x240c=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetInterval','Interval','findAll','options','raw','where','attributes','include','map','model','catch','ShowInterval'];(function(_0x162f73,_0x40bdbe){var _0x27fb6c=function(_0x2fe96f){while(--_0x2fe96f){_0x162f73['push'](_0x162f73['shift']());}};_0x27fb6c(++_0x40bdbe);}(_0x240c,0x18c));var _0xc240=function(_0x5acfbb,_0x15eff9){_0x5acfbb=_0x5acfbb-0x0;var _0x48f523=_0x240c[_0x5acfbb];return _0x48f523;};'use strict';var _=require(_0xc240('0x0'));var util=require(_0xc240('0x1'));var moment=require(_0xc240('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc240('0x3'));var db=require(_0xc240('0x4'))['db'];var utils=require(_0xc240('0x5'));var logger=require(_0xc240('0x6'))('rpc');var config=require(_0xc240('0x7'));var jayson=require(_0xc240('0x8'));var client=jayson[_0xc240('0x9')][_0xc240('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x262316,_0x27fed0,_0x44ce68){return new BPromise(function(_0x400b24,_0xfa8ee7){return client['request'](_0x262316,_0x44ce68)[_0xc240('0xb')](function(_0x3d30f8){logger[_0xc240('0xc')](_0xc240('0xd'),_0x27fed0,_0xc240('0xe'));logger[_0xc240('0xf')]('Interval,\x20%s,\x20%s,\x20%s',_0x27fed0,_0xc240('0xe'),JSON[_0xc240('0x10')](_0x3d30f8));if(_0x3d30f8[_0xc240('0x11')]){if(_0x3d30f8[_0xc240('0x11')][_0xc240('0x12')]===0x1f4){logger[_0xc240('0x11')](_0xc240('0xd'),_0x27fed0,_0x3d30f8['error'][_0xc240('0x13')]);return _0xfa8ee7(_0x3d30f8[_0xc240('0x11')][_0xc240('0x13')]);}logger[_0xc240('0x11')]('Interval,\x20%s,\x20%s',_0x27fed0,_0x3d30f8[_0xc240('0x11')][_0xc240('0x13')]);return _0x400b24(_0x3d30f8[_0xc240('0x11')][_0xc240('0x13')]);}else{logger['info']('Interval,\x20%s,\x20%s',_0x27fed0,'request\x20sent');_0x400b24(_0x3d30f8[_0xc240('0x14')][_0xc240('0x13')]);}})['catch'](function(_0x56211d){logger['error'](_0xc240('0xd'),_0x27fed0,_0x56211d);_0xfa8ee7(_0x56211d);});});}exports[_0xc240('0x15')]=function(_0x11c63e){var _0x430704=this;return new Promise(function(_0x3e5a98,_0x1fb2e9){return db[_0xc240('0x16')][_0xc240('0x17')]({'raw':_0x11c63e['options']?_0x11c63e[_0xc240('0x18')][_0xc240('0x19')]===undefined?!![]:![]:!![],'where':_0x11c63e[_0xc240('0x18')]?_0x11c63e[_0xc240('0x18')][_0xc240('0x1a')]||null:null,'attributes':_0x11c63e[_0xc240('0x18')]?_0x11c63e['options'][_0xc240('0x1b')]||null:null,'limit':_0x11c63e[_0xc240('0x18')]?_0x11c63e['options']['limit']||null:null,'include':_0x11c63e[_0xc240('0x18')]?_0x11c63e[_0xc240('0x18')][_0xc240('0x1c')]?_[_0xc240('0x1d')](_0x11c63e[_0xc240('0x18')][_0xc240('0x1c')],function(_0x531126){return{'model':db[_0x531126[_0xc240('0x1e')]],'as':_0x531126['as'],'attributes':_0x531126[_0xc240('0x1b')],'include':_0x531126[_0xc240('0x1c')]?_['map'](_0x531126['include'],function(_0x3b8842){return{'model':db[_0x3b8842[_0xc240('0x1e')]],'as':_0x3b8842['as'],'attributes':_0x3b8842[_0xc240('0x1b')],'include':_0x3b8842['include']?_[_0xc240('0x1d')](_0x3b8842[_0xc240('0x1c')],function(_0x49d973){return{'model':db[_0x49d973[_0xc240('0x1e')]],'as':_0x49d973['as'],'attributes':_0x49d973[_0xc240('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc240('0xb')](function(_0x4f6e8a){logger[_0xc240('0xc')](_0xc240('0x15'),_0x11c63e);logger[_0xc240('0xf')](_0xc240('0x15'),_0x11c63e,JSON[_0xc240('0x10')](_0x4f6e8a));_0x3e5a98(_0x4f6e8a);})[_0xc240('0x1f')](function(_0x3a3436){logger[_0xc240('0x11')](_0xc240('0x15'),_0x3a3436[_0xc240('0x13')],_0x11c63e);_0x1fb2e9(_0x430704[_0xc240('0x11')](0x1f4,_0x3a3436[_0xc240('0x13')]));});});};exports[_0xc240('0x20')]=function(_0x4af185){var _0x2b12a2=this;return new Promise(function(_0x3fe306,_0x4c8df6){return db[_0xc240('0x16')]['find']({'raw':_0x4af185['options']?_0x4af185[_0xc240('0x18')][_0xc240('0x19')]===undefined?!![]:![]:!![],'where':_0x4af185[_0xc240('0x18')]?_0x4af185[_0xc240('0x18')][_0xc240('0x1a')]||null:null,'attributes':_0x4af185[_0xc240('0x18')]?_0x4af185[_0xc240('0x18')][_0xc240('0x1b')]||null:null,'include':_0x4af185['options']?_0x4af185[_0xc240('0x18')][_0xc240('0x1c')]?_['map'](_0x4af185['options'][_0xc240('0x1c')],function(_0x22f9e3){return{'model':db[_0x22f9e3[_0xc240('0x1e')]],'as':_0x22f9e3['as'],'attributes':_0x22f9e3[_0xc240('0x1b')],'include':_0x22f9e3[_0xc240('0x1c')]?_[_0xc240('0x1d')](_0x22f9e3['include'],function(_0x2deee5){return{'model':db[_0x2deee5[_0xc240('0x1e')]],'as':_0x2deee5['as'],'attributes':_0x2deee5[_0xc240('0x1b')],'include':_0x2deee5[_0xc240('0x1c')]?_[_0xc240('0x1d')](_0x2deee5[_0xc240('0x1c')],function(_0xd5c49c){return{'model':db[_0xd5c49c['model']],'as':_0xd5c49c['as'],'attributes':_0xd5c49c[_0xc240('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc240('0xb')](function(_0x153801){logger[_0xc240('0xc')]('ShowInterval',_0x4af185);logger['debug']('ShowInterval',_0x4af185,JSON['stringify'](_0x153801));_0x3fe306(_0x153801);})[_0xc240('0x1f')](function(_0x4d0817){logger[_0xc240('0x11')](_0xc240('0x20'),_0x4d0817[_0xc240('0x13')],_0x4af185);_0x4c8df6(_0x2b12a2['error'](0x1f4,_0x4d0817[_0xc240('0x13')]));});});};
\ No newline at end of file
+var _0xf80f=['client','http','request','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetInterval','Interval','findAll','raw','options','where','attributes','limit','include','model','map','then','info','ShowInterval','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf80f,0x14d));var _0xff80=function(_0x5003f9,_0x24cd27){_0x5003f9=_0x5003f9-0x0;var _0x955af7=_0xf80f[_0x5003f9];return _0x955af7;};'use strict';var _=require(_0xff80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xff80('0x1'));var rs=require(_0xff80('0x2'));var fs=require('fs');var Redis=require(_0xff80('0x3'));var db=require(_0xff80('0x4'))['db'];var utils=require(_0xff80('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xff80('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xff80('0x7')][_0xff80('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e2357,_0x546c49,_0x3afe31){return new BPromise(function(_0x56f2f9,_0x4a1b9e){return client[_0xff80('0x9')](_0x1e2357,_0x3afe31)['then'](function(_0x17368f){logger['info'](_0xff80('0xa'),_0x546c49,_0xff80('0xb'));logger[_0xff80('0xc')](_0xff80('0xd'),_0x546c49,_0xff80('0xb'),JSON[_0xff80('0xe')](_0x17368f));if(_0x17368f[_0xff80('0xf')]){if(_0x17368f['error']['code']===0x1f4){logger[_0xff80('0xf')](_0xff80('0xa'),_0x546c49,_0x17368f[_0xff80('0xf')][_0xff80('0x10')]);return _0x4a1b9e(_0x17368f[_0xff80('0xf')][_0xff80('0x10')]);}logger[_0xff80('0xf')](_0xff80('0xa'),_0x546c49,_0x17368f['error'][_0xff80('0x10')]);return _0x56f2f9(_0x17368f[_0xff80('0xf')][_0xff80('0x10')]);}else{logger['info'](_0xff80('0xa'),_0x546c49,_0xff80('0xb'));_0x56f2f9(_0x17368f[_0xff80('0x11')]['message']);}})[_0xff80('0x12')](function(_0x4be2e1){logger['error'](_0xff80('0xa'),_0x546c49,_0x4be2e1);_0x4a1b9e(_0x4be2e1);});});}exports[_0xff80('0x13')]=function(_0x5100bd){var _0x32d6fb=this;return new Promise(function(_0x23699a,_0x2af695){return db[_0xff80('0x14')][_0xff80('0x15')]({'raw':_0x5100bd['options']?_0x5100bd['options'][_0xff80('0x16')]===undefined?!![]:![]:!![],'where':_0x5100bd[_0xff80('0x17')]?_0x5100bd[_0xff80('0x17')][_0xff80('0x18')]||null:null,'attributes':_0x5100bd['options']?_0x5100bd[_0xff80('0x17')][_0xff80('0x19')]||null:null,'limit':_0x5100bd['options']?_0x5100bd['options'][_0xff80('0x1a')]||null:null,'include':_0x5100bd[_0xff80('0x17')]?_0x5100bd[_0xff80('0x17')][_0xff80('0x1b')]?_['map'](_0x5100bd[_0xff80('0x17')][_0xff80('0x1b')],function(_0x4a96e5){return{'model':db[_0x4a96e5[_0xff80('0x1c')]],'as':_0x4a96e5['as'],'attributes':_0x4a96e5[_0xff80('0x19')],'include':_0x4a96e5[_0xff80('0x1b')]?_[_0xff80('0x1d')](_0x4a96e5[_0xff80('0x1b')],function(_0x230bb3){return{'model':db[_0x230bb3[_0xff80('0x1c')]],'as':_0x230bb3['as'],'attributes':_0x230bb3[_0xff80('0x19')],'include':_0x230bb3['include']?_[_0xff80('0x1d')](_0x230bb3[_0xff80('0x1b')],function(_0x1a982d){return{'model':db[_0x1a982d[_0xff80('0x1c')]],'as':_0x1a982d['as'],'attributes':_0x1a982d['attributes']};}):[]};}):[]};}):[]:[]})[_0xff80('0x1e')](function(_0x46b5b0){logger[_0xff80('0x1f')](_0xff80('0x13'),_0x5100bd);logger[_0xff80('0xc')]('GetInterval',_0x5100bd,JSON['stringify'](_0x46b5b0));_0x23699a(_0x46b5b0);})[_0xff80('0x12')](function(_0x3815e7){logger['error'](_0xff80('0x13'),_0x3815e7[_0xff80('0x10')],_0x5100bd);_0x2af695(_0x32d6fb[_0xff80('0xf')](0x1f4,_0x3815e7[_0xff80('0x10')]));});});};exports[_0xff80('0x20')]=function(_0x3521bc){var _0x12bc75=this;return new Promise(function(_0x42dcf1,_0x52167d){return db[_0xff80('0x14')][_0xff80('0x21')]({'raw':_0x3521bc[_0xff80('0x17')]?_0x3521bc[_0xff80('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3521bc['options']?_0x3521bc['options']['where']||null:null,'attributes':_0x3521bc[_0xff80('0x17')]?_0x3521bc[_0xff80('0x17')][_0xff80('0x19')]||null:null,'include':_0x3521bc[_0xff80('0x17')]?_0x3521bc['options'][_0xff80('0x1b')]?_['map'](_0x3521bc[_0xff80('0x17')][_0xff80('0x1b')],function(_0x5939bb){return{'model':db[_0x5939bb[_0xff80('0x1c')]],'as':_0x5939bb['as'],'attributes':_0x5939bb['attributes'],'include':_0x5939bb['include']?_[_0xff80('0x1d')](_0x5939bb['include'],function(_0x1fa825){return{'model':db[_0x1fa825[_0xff80('0x1c')]],'as':_0x1fa825['as'],'attributes':_0x1fa825[_0xff80('0x19')],'include':_0x1fa825[_0xff80('0x1b')]?_[_0xff80('0x1d')](_0x1fa825[_0xff80('0x1b')],function(_0x184eac){return{'model':db[_0x184eac['model']],'as':_0x184eac['as'],'attributes':_0x184eac[_0xff80('0x19')]};}):[]};}):[]};}):[]:[]})[_0xff80('0x1e')](function(_0x2eb779){logger[_0xff80('0x1f')](_0xff80('0x20'),_0x3521bc);logger[_0xff80('0xc')]('ShowInterval',_0x3521bc,JSON[_0xff80('0xe')](_0x2eb779));_0x42dcf1(_0x2eb779);})[_0xff80('0x12')](function(_0x1aca1d){logger[_0xff80('0xf')]('ShowInterval',_0x1aca1d[_0xff80('0x10')],_0x3521bc);_0x52167d(_0x12bc75[_0xff80('0xf')](0x1f4,_0x1aca1d[_0xff80('0x10')]));});});};
\ No newline at end of file
index 6aeed11..1c42cfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85da=['isAuthenticated','send','exports','express','../../components/auth/service','./jira.controller','post'];(function(_0x22c030,_0x46606f){var _0x1c9faf=function(_0x4ddae8){while(--_0x4ddae8){_0x22c030['push'](_0x22c030['shift']());}};_0x1c9faf(++_0x46606f);}(_0x85da,0x1ae));var _0xa85d=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0x85da[_0x2ab3d9];return _0x210a54;};'use strict';var express=require(_0xa85d('0x0'));var router=express['Router']();var auth=require(_0xa85d('0x1'));var controller=require(_0xa85d('0x2'));router[_0xa85d('0x3')]('/',auth[_0xa85d('0x4')](),controller[_0xa85d('0x5')]);module[_0xa85d('0x6')]=router;
\ No newline at end of file
+var _0x6157=['../../components/auth/service','./jira.controller','post','isAuthenticated','Router'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6157,0xea));var _0x7615=function(_0x201839,_0x22b860){_0x201839=_0x201839-0x0;var _0x2f1a1b=_0x6157[_0x201839];return _0x2f1a1b;};'use strict';var express=require('express');var router=express[_0x7615('0x0')]();var auth=require(_0x7615('0x1'));var controller=require(_0x7615('0x2'));router[_0x7615('0x3')]('/',auth[_0x7615('0x4')](),controller['send']);module['exports']=router;
\ No newline at end of file
index c5daf74..201c596 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34c0=['description','fields','customfield_11500','email','oldToken','customfield_11502','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','utf8','data','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','headers','socket','remoteAddress','connection','body','https','api','3eAmWpBVP0','MOTGUI','Report','\x20from\x20'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x34c0,0x1b2));var _0x034c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34c0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var https=require(_0x034c('0x0'));var logger=require('../../config/logger')(_0x034c('0x1'));var USERNAME='support';var PASSWORD=_0x034c('0x2');function openIssue(_0xeaf00a,_0x3f5bc9){var _0x3d0742={'fields':{'project':{'key':_0xeaf00a['key']||_0x034c('0x3')},'summary':(_0xeaf00a['summary']||_0x034c('0x4'))+_0x034c('0x5')+_0xeaf00a['ip'],'description':_0xeaf00a[_0x034c('0x6')]||JSON['stringify'](_0xeaf00a),'issuetype':{'name':_0xeaf00a['issuetype']||'Bug'}}};_0x3d0742[_0x034c('0x7')][_0x034c('0x8')]=_0xeaf00a[_0x034c('0x9')];_0x3d0742[_0x034c('0x7')]['customfield_11501']=_0xeaf00a[_0x034c('0xa')];_0x3d0742[_0x034c('0x7')][_0x034c('0xb')]=_0xeaf00a['newToken'];_0x3d0742[_0x034c('0x7')]['customfield_11503']=_0xeaf00a[_0x034c('0xc')];_0x3d0742[_0x034c('0x7')][_0x034c('0xd')]=_0xeaf00a[_0x034c('0xe')];_0x3d0742[_0x034c('0x7')][_0x034c('0xf')]=_0xeaf00a['ip'];var _0x2a3e56={'host':_0x034c('0x10'),'port':0x1bb,'path':_0x034c('0x11'),'method':_0x034c('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x034c('0x13'),'Authorization':_0x034c('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x034c('0x15')](_0x034c('0x16'))}};var _0x56ee13=JSON['stringify'](_0x3d0742);var _0x31a0fd=https['request'](_0x2a3e56,function(_0x174494){_0x174494['setEncoding'](_0x034c('0x17'));var _0x4e9bbf='';_0x174494['on'](_0x034c('0x18'),function(_0x218bf0){_0x4e9bbf+=_0x218bf0;});_0x174494['on'](_0x034c('0x19'),function(){if(_0x3f5bc9){return _0x3f5bc9[_0x034c('0x1a')](_0x174494[_0x034c('0x1b')])['json'](JSON[_0x034c('0x1c')](_0x4e9bbf));}});});_0x31a0fd['on'](_0x034c('0x1d'),function(_0x4fd3cf){if(_0x3f5bc9){return _0x3f5bc9[_0x034c('0x1a')](0x1f4)[_0x034c('0x1e')]({'errors':[{'message':_0x034c('0x1f'),'type':_0x034c('0x20')}]});}});_0x31a0fd['write'](_0x56ee13);_0x31a0fd[_0x034c('0x19')]();}exports[_0x034c('0x21')]=openIssue;exports[_0x034c('0x22')]=function(_0x23d420,_0x54c071){_0x23d420['body']['ip']=_0x23d420[_0x034c('0x23')]['x-forwarded-for']||_0x23d420['connection']['remoteAddress']||_0x23d420[_0x034c('0x24')][_0x034c('0x25')]||_0x23d420[_0x034c('0x26')][_0x034c('0x24')][_0x034c('0x25')];return openIssue(_0x23d420[_0x034c('0x27')],_0x54c071);};
\ No newline at end of file
+var _0xbc42=['error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','email','fields','oldToken','customfield_11502','customfield_11503','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request','setEncoding','data','end','status','statusCode','json','parse'];(function(_0x2ee0ab,_0x4142a4){var _0x572da1=function(_0x3ea56a){while(--_0x3ea56a){_0x2ee0ab['push'](_0x2ee0ab['shift']());}};_0x572da1(++_0x4142a4);}(_0xbc42,0x119));var _0x2bc4=function(_0x1d6fac,_0x5b806b){_0x1d6fac=_0x1d6fac-0x0;var _0x2cd4f6=_0xbc42[_0x1d6fac];return _0x2cd4f6;};'use strict';var BPromise=require(_0x2bc4('0x0'));var https=require(_0x2bc4('0x1'));var logger=require(_0x2bc4('0x2'))('api');var USERNAME='support';var PASSWORD=_0x2bc4('0x3');function openIssue(_0x9ccb1d,_0x44bbc0){var _0x7671={'fields':{'project':{'key':_0x9ccb1d[_0x2bc4('0x4')]||_0x2bc4('0x5')},'summary':(_0x9ccb1d[_0x2bc4('0x6')]||_0x2bc4('0x7'))+_0x2bc4('0x8')+_0x9ccb1d['ip'],'description':_0x9ccb1d[_0x2bc4('0x9')]||JSON[_0x2bc4('0xa')](_0x9ccb1d),'issuetype':{'name':_0x9ccb1d[_0x2bc4('0xb')]||_0x2bc4('0xc')}}};_0x7671['fields']['customfield_11500']=_0x9ccb1d[_0x2bc4('0xd')];_0x7671[_0x2bc4('0xe')]['customfield_11501']=_0x9ccb1d[_0x2bc4('0xf')];_0x7671[_0x2bc4('0xe')][_0x2bc4('0x10')]=_0x9ccb1d['newToken'];_0x7671[_0x2bc4('0xe')][_0x2bc4('0x11')]=_0x9ccb1d['name'];_0x7671[_0x2bc4('0xe')][_0x2bc4('0x12')]=_0x9ccb1d['reason'];_0x7671[_0x2bc4('0xe')][_0x2bc4('0x13')]=_0x9ccb1d['ip'];var _0x8e7df6={'host':_0x2bc4('0x14'),'port':0x1bb,'path':_0x2bc4('0x15'),'method':_0x2bc4('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x2bc4('0x17'),'Authorization':_0x2bc4('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x2bc4('0x19'))}};var _0x14bc1c=JSON[_0x2bc4('0xa')](_0x7671);var _0x1b7ad6=https[_0x2bc4('0x1a')](_0x8e7df6,function(_0x5da6b7){_0x5da6b7[_0x2bc4('0x1b')]('utf8');var _0xb53406='';_0x5da6b7['on'](_0x2bc4('0x1c'),function(_0x1c8135){_0xb53406+=_0x1c8135;});_0x5da6b7['on'](_0x2bc4('0x1d'),function(){if(_0x44bbc0){return _0x44bbc0[_0x2bc4('0x1e')](_0x5da6b7[_0x2bc4('0x1f')])[_0x2bc4('0x20')](JSON[_0x2bc4('0x21')](_0xb53406));}});});_0x1b7ad6['on'](_0x2bc4('0x22'),function(_0xd61d10){if(_0x44bbc0){return _0x44bbc0['status'](0x1f4)[_0x2bc4('0x20')]({'errors':[{'message':_0x2bc4('0x23'),'type':_0x2bc4('0x24')}]});}});_0x1b7ad6[_0x2bc4('0x25')](_0x14bc1c);_0x1b7ad6[_0x2bc4('0x1d')]();}exports['openIssue']=openIssue;exports[_0x2bc4('0x26')]=function(_0x5ecf7d,_0x49a5c9){_0x5ecf7d[_0x2bc4('0x27')]['ip']=_0x5ecf7d[_0x2bc4('0x28')][_0x2bc4('0x29')]||_0x5ecf7d[_0x2bc4('0x2a')][_0x2bc4('0x2b')]||_0x5ecf7d[_0x2bc4('0x2c')][_0x2bc4('0x2b')]||_0x5ecf7d[_0x2bc4('0x2a')][_0x2bc4('0x2c')]['remoteAddress'];return openIssue(_0x5ecf7d[_0x2bc4('0x27')],_0x49a5c9);};
\ No newline at end of file
index 2434e44..a171788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a2f=['update','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','create'];(function(_0x1003ea,_0x5e2b24){var _0x7c31b9=function(_0x4829e8){while(--_0x4829e8){_0x1003ea['push'](_0x1003ea['shift']());}};_0x7c31b9(++_0x5e2b24);}(_0x8a2f,0x198));var _0xf8a2=function(_0x3b613a,_0xb0f3bc){_0x3b613a=_0x3b613a-0x0;var _0x5ca3f3=_0x8a2f[_0x3b613a];return _0x5ca3f3;};'use strict';var multer=require(_0xf8a2('0x0'));var util=require(_0xf8a2('0x1'));var path=require(_0xf8a2('0x2'));var timeout=require(_0xf8a2('0x3'));var express=require(_0xf8a2('0x4'));var router=express[_0xf8a2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xf8a2('0x6'));var config=require(_0xf8a2('0x7'));var controller=require(_0xf8a2('0x8'));router[_0xf8a2('0x9')]('/',auth[_0xf8a2('0xa')](),controller['index']);router[_0xf8a2('0x9')]('/describe',auth[_0xf8a2('0xa')](),controller['describe']);router[_0xf8a2('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf8a2('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf8a2('0xc')]);router['delete'](_0xf8a2('0xd'),auth[_0xf8a2('0xa')](),controller[_0xf8a2('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x803a=['./jscriptyAnswerReport.controller','index','get','isAuthenticated','describe','/:id','show','put','update','delete','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x25adbb,_0x18fe04){var _0x2826d0=function(_0x125738){while(--_0x125738){_0x25adbb['push'](_0x25adbb['shift']());}};_0x2826d0(++_0x18fe04);}(_0x803a,0x13b));var _0xa803=function(_0x1ef1f2,_0x40743e){_0x1ef1f2=_0x1ef1f2-0x0;var _0x1f33be=_0x803a[_0x1ef1f2];return _0x1f33be;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa803('0x0'));var express=require(_0xa803('0x1'));var router=express[_0xa803('0x2')]();var auth=require(_0xa803('0x3'));var interaction=require(_0xa803('0x4'));var config=require('../../config/environment');var controller=require(_0xa803('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xa803('0x6')]);router[_0xa803('0x7')]('/describe',auth[_0xa803('0x8')](),controller[_0xa803('0x9')]);router['get'](_0xa803('0xa'),auth[_0xa803('0x8')](),controller[_0xa803('0xb')]);router['post']('/',auth[_0xa803('0x8')](),controller['create']);router[_0xa803('0xc')](_0xa803('0xa'),auth['isAuthenticated'](),controller[_0xa803('0xd')]);router[_0xa803('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa803('0xf')]=router;
\ No newline at end of file
index 188f5f2..960425f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4651=['TEXT','long','exports','STRING'];(function(_0x2cced4,_0x281e30){var _0x150917=function(_0x52484b){while(--_0x52484b){_0x2cced4['push'](_0x2cced4['shift']());}};_0x150917(++_0x281e30);}(_0x4651,0x1a2));var _0x1465=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4651[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x1465('0x0')]={'question':{'type':Sequelize[_0x1465('0x1')]},'answer':{'type':Sequelize[_0x1465('0x2')](_0x1465('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x1465('0x1')]},'queue':{'type':Sequelize[_0x1465('0x1')]},'uniqueid':{'type':Sequelize[_0x1465('0x1')]},'calleridname':{'type':Sequelize[_0x1465('0x1')]},'calleridnum':{'type':Sequelize[_0x1465('0x1')]},'questionId':{'type':Sequelize[_0x1465('0x1')]}};
\ No newline at end of file
+var _0x904c=['TEXT','sequelize','exports','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x904c,0x131));var _0xc904=function(_0x3f0c09,_0x41d069){_0x3f0c09=_0x3f0c09-0x0;var _0x339eda=_0x904c[_0x3f0c09];return _0x339eda;};'use strict';var Sequelize=require(_0xc904('0x0'));module[_0xc904('0x1')]={'question':{'type':Sequelize[_0xc904('0x2')]},'answer':{'type':Sequelize[_0xc904('0x3')]('long')},'membername':{'type':Sequelize[_0xc904('0x2')]},'projectname':{'type':Sequelize[_0xc904('0x2')]},'queue':{'type':Sequelize[_0xc904('0x2')]},'uniqueid':{'type':Sequelize[_0xc904('0x2')]},'calleridname':{'type':Sequelize[_0xc904('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f8374ac..8b26981 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dfe=['end','json','count','offset','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','limit','sort','where','pick','VIRTUAL','filter','options','includeAll','rows','catch','show','params','merge','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0x4dfe,0x1ab));var _0xe4df=function(_0x160b2e,_0x80481d){_0x160b2e=_0x160b2e-0x0;var _0x129478=_0x4dfe[_0x160b2e];return _0x129478;};'use strict';var pdf=require(_0xe4df('0x0'));var emlformat=require(_0xe4df('0x1'));var rimraf=require(_0xe4df('0x2'));var zipdir=require(_0xe4df('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4df('0x4'));var moment=require(_0xe4df('0x5'));var BPromise=require(_0xe4df('0x6'));var Mustache=require('mustache');var util=require(_0xe4df('0x7'));var path=require(_0xe4df('0x8'));var sox=require(_0xe4df('0x9'));var csv=require(_0xe4df('0xa'));var ejs=require(_0xe4df('0xb'));var fs=require('fs');var _=require(_0xe4df('0xc'));var squel=require(_0xe4df('0xd'));var crypto=require(_0xe4df('0xe'));var jsforce=require(_0xe4df('0xf'));var deskjs=require(_0xe4df('0x10'));var toCsv=require(_0xe4df('0xa'));var querystring=require(_0xe4df('0x11'));var Papa=require(_0xe4df('0x12'));var Redis=require(_0xe4df('0x13'));var authService=require(_0xe4df('0x14'));var qs=require(_0xe4df('0x15'));var as=require(_0xe4df('0x16'));var hardwareService=require(_0xe4df('0x17'));var logger=require(_0xe4df('0x18'))(_0xe4df('0x19'));var utils=require(_0xe4df('0x1a'));var config=require('../../config/environment');var db=require(_0xe4df('0x1b'))['db'];function respondWithStatusCode(_0x3f7db6,_0x43584d){_0x43584d=_0x43584d||0xcc;return function(_0x58bbaa){if(_0x58bbaa){return _0x3f7db6['sendStatus'](_0x43584d);}return _0x3f7db6[_0xe4df('0x1c')](_0x43584d)[_0xe4df('0x1d')]();};}function respondWithResult(_0x114631,_0xae6ca4){_0xae6ca4=_0xae6ca4||0xc8;return function(_0x10b5e6){if(_0x10b5e6){return _0x114631[_0xe4df('0x1c')](_0xae6ca4)[_0xe4df('0x1e')](_0x10b5e6);}};}function respondWithFilteredResult(_0x14789b,_0x458db1){return function(_0x20ab79){if(_0x20ab79){var _0x22e7b0=_0x20ab79[_0xe4df('0x1f')],_0x45077d=_0x458db1[_0xe4df('0x20')],_0x36078c=_0x458db1[_0xe4df('0x20')]+_0x458db1['limit'],_0x34c9db;if(_0x36078c>=_0x22e7b0){_0x36078c=_0x22e7b0;_0x34c9db=0xc8;}else{_0x34c9db=0xce;}_0x14789b[_0xe4df('0x1c')](_0x34c9db);return _0x14789b[_0xe4df('0x21')](_0xe4df('0x22'),_0x45077d+'-'+_0x36078c+'/'+_0x22e7b0)[_0xe4df('0x1e')](_0x20ab79);}return null;};}function patchUpdates(_0x4d7e36){return function(_0x1f1018){try{jsonpatch[_0xe4df('0x23')](_0x1f1018,_0x4d7e36,!![]);}catch(_0x1a0c7a){return BPromise['reject'](_0x1a0c7a);}return _0x1f1018['save']();};}function saveUpdates(_0x143234,_0x1465fa){return function(_0x361d97){if(_0x361d97){return _0x361d97[_0xe4df('0x24')](_0x143234)['then'](function(_0x2b214d){return _0x2b214d;});}return null;};}function removeEntity(_0x37999a,_0x24aee9){return function(_0x4e9dda){if(_0x4e9dda){return _0x4e9dda[_0xe4df('0x25')]()[_0xe4df('0x26')](function(){_0x37999a[_0xe4df('0x1c')](0xcc)[_0xe4df('0x1d')]();});}};}function handleEntityNotFound(_0x291c73,_0x37cb61){return function(_0x5e229f){if(!_0x5e229f){_0x291c73[_0xe4df('0x27')](0x194);}return _0x5e229f;};}function handleError(_0x325bc6,_0x5cd0b9){_0x5cd0b9=_0x5cd0b9||0x1f4;return function(_0x299404){logger[_0xe4df('0x28')](_0x299404[_0xe4df('0x29')]);if(_0x299404[_0xe4df('0x2a')]){delete _0x299404[_0xe4df('0x2a')];}_0x325bc6['status'](_0x5cd0b9)[_0xe4df('0x2b')](_0x299404);};}exports[_0xe4df('0x2c')]=function(_0x4735cf,_0x436241){var _0x559fa5={},_0x62eeff={},_0x1ee14e={'count':0x0,'rows':[]};var _0x7943ba=_[_0xe4df('0x2d')](db[_0xe4df('0x2e')][_0xe4df('0x2f')],function(_0x3c9d2a){return{'name':_0x3c9d2a[_0xe4df('0x30')],'type':_0x3c9d2a[_0xe4df('0x31')][_0xe4df('0x32')]};});_0x62eeff[_0xe4df('0x33')]=_[_0xe4df('0x2d')](_0x7943ba,'name');_0x62eeff[_0xe4df('0x34')]=_[_0xe4df('0x35')](_0x4735cf[_0xe4df('0x34')]);_0x62eeff[_0xe4df('0x36')]=_[_0xe4df('0x37')](_0x62eeff['model'],_0x62eeff['query']);_0x559fa5['attributes']=_[_0xe4df('0x37')](_0x62eeff[_0xe4df('0x33')],qs[_0xe4df('0x38')](_0x4735cf[_0xe4df('0x34')][_0xe4df('0x38')]));_0x559fa5[_0xe4df('0x39')]=_0x559fa5['attributes'][_0xe4df('0x3a')]?_0x559fa5['attributes']:_0x62eeff['model'];if(!_0x4735cf[_0xe4df('0x34')]['hasOwnProperty']('nolimit')){_0x559fa5[_0xe4df('0x3b')]=qs[_0xe4df('0x3b')](_0x4735cf[_0xe4df('0x34')][_0xe4df('0x3b')]);_0x559fa5[_0xe4df('0x20')]=qs['offset'](_0x4735cf[_0xe4df('0x34')][_0xe4df('0x20')]);}_0x559fa5['order']=qs[_0xe4df('0x3c')](_0x4735cf[_0xe4df('0x34')]['sort']);_0x559fa5[_0xe4df('0x3d')]=qs[_0xe4df('0x36')](_[_0xe4df('0x3e')](_0x4735cf[_0xe4df('0x34')],_0x62eeff[_0xe4df('0x36')]),_0x7943ba);if(_0x4735cf['query']['filter']){_0x559fa5[_0xe4df('0x3d')]=_['merge'](_0x559fa5['where'],{'$or':_[_0xe4df('0x2d')](_0x7943ba,function(_0x5b03fb){if(_0x5b03fb[_0xe4df('0x31')]!==_0xe4df('0x3f')){var _0x24625d={};_0x24625d[_0x5b03fb[_0xe4df('0x2a')]]={'$like':'%'+_0x4735cf['query'][_0xe4df('0x40')]+'%'};return _0x24625d;}})});}_0x559fa5=_['merge']({},_0x559fa5,_0x4735cf[_0xe4df('0x41')]);var _0x444042={'where':_0x559fa5[_0xe4df('0x3d')]};return db[_0xe4df('0x2e')]['count'](_0x444042)['then'](function(_0x373825){_0x1ee14e[_0xe4df('0x1f')]=_0x373825;if(_0x4735cf[_0xe4df('0x34')][_0xe4df('0x42')]){_0x559fa5['include']=[{'all':!![]}];}return db[_0xe4df('0x2e')]['findAll'](_0x559fa5);})[_0xe4df('0x26')](function(_0x557aa3){_0x1ee14e[_0xe4df('0x43')]=_0x557aa3;return _0x1ee14e;})['then'](respondWithFilteredResult(_0x436241,_0x559fa5))[_0xe4df('0x44')](handleError(_0x436241,null));};exports[_0xe4df('0x45')]=function(_0x5273e7,_0x17f1fa){var _0x37a743={'raw':!![],'where':{'id':_0x5273e7[_0xe4df('0x46')]['id']}},_0x33f647={};_0x33f647[_0xe4df('0x33')]=_[_0xe4df('0x35')](db['JscriptyAnswerReport'][_0xe4df('0x2f')]);_0x33f647[_0xe4df('0x34')]=_[_0xe4df('0x35')](_0x5273e7['query']);_0x33f647[_0xe4df('0x36')]=_[_0xe4df('0x37')](_0x33f647[_0xe4df('0x33')],_0x33f647[_0xe4df('0x34')]);_0x37a743[_0xe4df('0x39')]=_[_0xe4df('0x37')](_0x33f647['model'],qs[_0xe4df('0x38')](_0x5273e7[_0xe4df('0x34')][_0xe4df('0x38')]));_0x37a743[_0xe4df('0x39')]=_0x37a743['attributes'][_0xe4df('0x3a')]?_0x37a743[_0xe4df('0x39')]:_0x33f647[_0xe4df('0x33')];if(_0x5273e7['query'][_0xe4df('0x42')]){_0x37a743['include']=[{'all':!![]}];}_0x37a743=_[_0xe4df('0x47')]({},_0x37a743,_0x5273e7[_0xe4df('0x41')]);return db[_0xe4df('0x2e')][_0xe4df('0x48')](_0x37a743)[_0xe4df('0x26')](handleEntityNotFound(_0x17f1fa,null))[_0xe4df('0x26')](respondWithResult(_0x17f1fa,null))[_0xe4df('0x44')](handleError(_0x17f1fa,null));};exports[_0xe4df('0x49')]=function(_0x260917,_0xe4f51){return db[_0xe4df('0x2e')][_0xe4df('0x49')](_0x260917[_0xe4df('0x4a')],{})['then'](respondWithResult(_0xe4f51,0xc9))['catch'](handleError(_0xe4f51,null));};exports[_0xe4df('0x24')]=function(_0x49ad7b,_0x10b9e2){if(_0x49ad7b[_0xe4df('0x4a')]['id']){delete _0x49ad7b['body']['id'];}return db['JscriptyAnswerReport'][_0xe4df('0x48')]({'where':{'id':_0x49ad7b[_0xe4df('0x46')]['id']}})[_0xe4df('0x26')](handleEntityNotFound(_0x10b9e2,null))['then'](saveUpdates(_0x49ad7b[_0xe4df('0x4a')],null))[_0xe4df('0x26')](respondWithResult(_0x10b9e2,null))[_0xe4df('0x44')](handleError(_0x10b9e2,null));};exports[_0xe4df('0x25')]=function(_0x392e43,_0xcdd9ec){return db['JscriptyAnswerReport'][_0xe4df('0x48')]({'where':{'id':_0x392e43['params']['id']}})[_0xe4df('0x26')](handleEntityNotFound(_0xcdd9ec,null))[_0xe4df('0x26')](removeEntity(_0xcdd9ec,null))[_0xe4df('0x44')](handleError(_0xcdd9ec,null));};exports[_0xe4df('0x4b')]=function(_0x222713,_0x196091){return db[_0xe4df('0x2e')][_0xe4df('0x4b')]()[_0xe4df('0x26')](respondWithResult(_0x196091,null))[_0xe4df('0x44')](handleError(_0x196091,null));};
\ No newline at end of file
+var _0xea2b=['bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','findAll','rows','catch','params','rawAttributes','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x16967c,_0xd556cd){var _0x35a680=function(_0x294f53){while(--_0x294f53){_0x16967c['push'](_0x16967c['shift']());}};_0x35a680(++_0xd556cd);}(_0xea2b,0xdc));var _0xbea2=function(_0x6face9,_0xba6b95){_0x6face9=_0x6face9-0x0;var _0x563155=_0xea2b[_0x6face9];return _0x563155;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbea2('0x0'));var rimraf=require(_0xbea2('0x1'));var zipdir=require(_0xbea2('0x2'));var jsonpatch=require(_0xbea2('0x3'));var rp=require('request-promise');var moment=require(_0xbea2('0x4'));var BPromise=require(_0xbea2('0x5'));var Mustache=require(_0xbea2('0x6'));var util=require(_0xbea2('0x7'));var path=require(_0xbea2('0x8'));var sox=require(_0xbea2('0x9'));var csv=require(_0xbea2('0xa'));var ejs=require(_0xbea2('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbea2('0xc'));var jsforce=require(_0xbea2('0xd'));var deskjs=require(_0xbea2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbea2('0xf'));var Papa=require(_0xbea2('0x10'));var Redis=require(_0xbea2('0x11'));var authService=require(_0xbea2('0x12'));var qs=require(_0xbea2('0x13'));var as=require(_0xbea2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbea2('0x15'))(_0xbea2('0x16'));var utils=require(_0xbea2('0x17'));var config=require('../../config/environment');var db=require(_0xbea2('0x18'))['db'];function respondWithStatusCode(_0x271141,_0x11472c){_0x11472c=_0x11472c||0xcc;return function(_0x1aedb9){if(_0x1aedb9){return _0x271141[_0xbea2('0x19')](_0x11472c);}return _0x271141[_0xbea2('0x1a')](_0x11472c)[_0xbea2('0x1b')]();};}function respondWithResult(_0x3b0266,_0x485fc4){_0x485fc4=_0x485fc4||0xc8;return function(_0x3d54f3){if(_0x3d54f3){return _0x3b0266[_0xbea2('0x1a')](_0x485fc4)['json'](_0x3d54f3);}};}function respondWithFilteredResult(_0x463b16,_0x16a88d){return function(_0x17b6d6){if(_0x17b6d6){var _0x127a53=_0x17b6d6[_0xbea2('0x1c')],_0x4f6b9c=_0x16a88d[_0xbea2('0x1d')],_0xd85473=_0x16a88d[_0xbea2('0x1d')]+_0x16a88d[_0xbea2('0x1e')],_0x4348ca;if(_0xd85473>=_0x127a53){_0xd85473=_0x127a53;_0x4348ca=0xc8;}else{_0x4348ca=0xce;}_0x463b16[_0xbea2('0x1a')](_0x4348ca);return _0x463b16[_0xbea2('0x1f')](_0xbea2('0x20'),_0x4f6b9c+'-'+_0xd85473+'/'+_0x127a53)['json'](_0x17b6d6);}return null;};}function patchUpdates(_0x47c5fe){return function(_0x59efa8){try{jsonpatch[_0xbea2('0x21')](_0x59efa8,_0x47c5fe,!![]);}catch(_0x55a029){return BPromise[_0xbea2('0x22')](_0x55a029);}return _0x59efa8[_0xbea2('0x23')]();};}function saveUpdates(_0x3ce35d,_0x317d11){return function(_0x15b690){if(_0x15b690){return _0x15b690[_0xbea2('0x24')](_0x3ce35d)['then'](function(_0x39fe7b){return _0x39fe7b;});}return null;};}function removeEntity(_0x565d6a,_0x327bd9){return function(_0x3126c6){if(_0x3126c6){return _0x3126c6[_0xbea2('0x25')]()['then'](function(){_0x565d6a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31643d,_0x1dc3d5){return function(_0x7e02a5){if(!_0x7e02a5){_0x31643d['sendStatus'](0x194);}return _0x7e02a5;};}function handleError(_0x1f2214,_0xe64a68){_0xe64a68=_0xe64a68||0x1f4;return function(_0x114e7d){logger[_0xbea2('0x26')](_0x114e7d[_0xbea2('0x27')]);if(_0x114e7d[_0xbea2('0x28')]){delete _0x114e7d[_0xbea2('0x28')];}_0x1f2214[_0xbea2('0x1a')](_0xe64a68)[_0xbea2('0x29')](_0x114e7d);};}exports[_0xbea2('0x2a')]=function(_0x9c51c0,_0x1bdec0){var _0x568999={},_0x217833={},_0x426f97={'count':0x0,'rows':[]};var _0x55f523=_[_0xbea2('0x2b')](db[_0xbea2('0x2c')]['rawAttributes'],function(_0x247350){return{'name':_0x247350[_0xbea2('0x2d')],'type':_0x247350[_0xbea2('0x2e')]['key']};});_0x217833[_0xbea2('0x2f')]=_[_0xbea2('0x2b')](_0x55f523,_0xbea2('0x28'));_0x217833[_0xbea2('0x30')]=_['keys'](_0x9c51c0['query']);_0x217833[_0xbea2('0x31')]=_[_0xbea2('0x32')](_0x217833[_0xbea2('0x2f')],_0x217833['query']);_0x568999[_0xbea2('0x33')]=_[_0xbea2('0x32')](_0x217833['model'],qs[_0xbea2('0x34')](_0x9c51c0[_0xbea2('0x30')][_0xbea2('0x34')]));_0x568999[_0xbea2('0x33')]=_0x568999['attributes'][_0xbea2('0x35')]?_0x568999[_0xbea2('0x33')]:_0x217833['model'];if(!_0x9c51c0['query'][_0xbea2('0x36')](_0xbea2('0x37'))){_0x568999[_0xbea2('0x1e')]=qs[_0xbea2('0x1e')](_0x9c51c0[_0xbea2('0x30')]['limit']);_0x568999[_0xbea2('0x1d')]=qs[_0xbea2('0x1d')](_0x9c51c0['query'][_0xbea2('0x1d')]);}_0x568999['order']=qs[_0xbea2('0x38')](_0x9c51c0['query'][_0xbea2('0x38')]);_0x568999[_0xbea2('0x39')]=qs[_0xbea2('0x31')](_[_0xbea2('0x3a')](_0x9c51c0['query'],_0x217833[_0xbea2('0x31')]),_0x55f523);if(_0x9c51c0[_0xbea2('0x30')][_0xbea2('0x3b')]){_0x568999['where']=_[_0xbea2('0x3c')](_0x568999[_0xbea2('0x39')],{'$or':_['map'](_0x55f523,function(_0x87dfe){if(_0x87dfe[_0xbea2('0x2e')]!==_0xbea2('0x3d')){var _0x458b15={};_0x458b15[_0x87dfe[_0xbea2('0x28')]]={'$like':'%'+_0x9c51c0[_0xbea2('0x30')]['filter']+'%'};return _0x458b15;}})});}_0x568999=_['merge']({},_0x568999,_0x9c51c0['options']);var _0x3b8e20={'where':_0x568999[_0xbea2('0x39')]};return db[_0xbea2('0x2c')][_0xbea2('0x1c')](_0x3b8e20)[_0xbea2('0x3e')](function(_0x8781a0){_0x426f97['count']=_0x8781a0;if(_0x9c51c0[_0xbea2('0x30')][_0xbea2('0x3f')]){_0x568999['include']=[{'all':!![]}];}return db[_0xbea2('0x2c')][_0xbea2('0x40')](_0x568999);})[_0xbea2('0x3e')](function(_0x535046){_0x426f97[_0xbea2('0x41')]=_0x535046;return _0x426f97;})['then'](respondWithFilteredResult(_0x1bdec0,_0x568999))[_0xbea2('0x42')](handleError(_0x1bdec0,null));};exports['show']=function(_0x8fad0d,_0x214f7){var _0x218eaf={'raw':!![],'where':{'id':_0x8fad0d[_0xbea2('0x43')]['id']}},_0x4ee594={};_0x4ee594[_0xbea2('0x2f')]=_['keys'](db[_0xbea2('0x2c')][_0xbea2('0x44')]);_0x4ee594['query']=_[_0xbea2('0x45')](_0x8fad0d[_0xbea2('0x30')]);_0x4ee594['filters']=_[_0xbea2('0x32')](_0x4ee594[_0xbea2('0x2f')],_0x4ee594[_0xbea2('0x30')]);_0x218eaf[_0xbea2('0x33')]=_[_0xbea2('0x32')](_0x4ee594[_0xbea2('0x2f')],qs[_0xbea2('0x34')](_0x8fad0d[_0xbea2('0x30')][_0xbea2('0x34')]));_0x218eaf['attributes']=_0x218eaf[_0xbea2('0x33')]['length']?_0x218eaf['attributes']:_0x4ee594[_0xbea2('0x2f')];if(_0x8fad0d[_0xbea2('0x30')][_0xbea2('0x3f')]){_0x218eaf[_0xbea2('0x46')]=[{'all':!![]}];}_0x218eaf=_[_0xbea2('0x3c')]({},_0x218eaf,_0x8fad0d['options']);return db['JscriptyAnswerReport'][_0xbea2('0x47')](_0x218eaf)[_0xbea2('0x3e')](handleEntityNotFound(_0x214f7,null))[_0xbea2('0x3e')](respondWithResult(_0x214f7,null))[_0xbea2('0x42')](handleError(_0x214f7,null));};exports[_0xbea2('0x48')]=function(_0x34dc4d,_0x320ee3){return db['JscriptyAnswerReport'][_0xbea2('0x48')](_0x34dc4d['body'],{})[_0xbea2('0x3e')](respondWithResult(_0x320ee3,0xc9))[_0xbea2('0x42')](handleError(_0x320ee3,null));};exports['update']=function(_0x4dd153,_0x13bc5b){if(_0x4dd153[_0xbea2('0x49')]['id']){delete _0x4dd153[_0xbea2('0x49')]['id'];}return db[_0xbea2('0x2c')][_0xbea2('0x47')]({'where':{'id':_0x4dd153[_0xbea2('0x43')]['id']}})[_0xbea2('0x3e')](handleEntityNotFound(_0x13bc5b,null))[_0xbea2('0x3e')](saveUpdates(_0x4dd153[_0xbea2('0x49')],null))[_0xbea2('0x3e')](respondWithResult(_0x13bc5b,null))[_0xbea2('0x42')](handleError(_0x13bc5b,null));};exports[_0xbea2('0x25')]=function(_0x34836a,_0xebb7e1){return db[_0xbea2('0x2c')][_0xbea2('0x47')]({'where':{'id':_0x34836a[_0xbea2('0x43')]['id']}})[_0xbea2('0x3e')](handleEntityNotFound(_0xebb7e1,null))[_0xbea2('0x3e')](removeEntity(_0xebb7e1,null))[_0xbea2('0x42')](handleError(_0xebb7e1,null));};exports[_0xbea2('0x4a')]=function(_0x4d73f8,_0x3a389c){return db['JscriptyAnswerReport']['describe']()[_0xbea2('0x3e')](respondWithResult(_0x3a389c,null))[_0xbea2('0x42')](handleError(_0x3a389c,null));};
\ No newline at end of file
index 9f7085b..1fa3df3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d5=['bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x42ea24,_0x16736c){var _0x193911=function(_0x599c32){while(--_0x599c32){_0x42ea24['push'](_0x42ea24['shift']());}};_0x193911(++_0x16736c);}(_0x98d5,0x157));var _0x598d=function(_0x32196b,_0x353e79){_0x32196b=_0x32196b-0x0;var _0x281f82=_0x98d5[_0x32196b];return _0x281f82;};'use strict';var _=require(_0x598d('0x0'));var util=require(_0x598d('0x1'));var logger=require(_0x598d('0x2'))(_0x598d('0x3'));var moment=require(_0x598d('0x4'));var BPromise=require(_0x598d('0x5'));var rp=require(_0x598d('0x6'));var fs=require('fs');var path=require(_0x598d('0x7'));var rimraf=require(_0x598d('0x8'));var config=require('../../config/environment');var attributes=require(_0x598d('0x9'));module[_0x598d('0xa')]=function(_0x3f5769,_0x1e5ada){return _0x3f5769[_0x598d('0xb')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x727f=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./jscriptyAnswerReport.attributes','define'];(function(_0x51c72c,_0x2f787e){var _0xd28f2d=function(_0x3b1500){while(--_0x3b1500){_0x51c72c['push'](_0x51c72c['shift']());}};_0xd28f2d(++_0x2f787e);}(_0x727f,0x1b2));var _0xf727=function(_0x37e899,_0x36a067){_0x37e899=_0x37e899-0x0;var _0x916440=_0x727f[_0x37e899];return _0x916440;};'use strict';var _=require(_0xf727('0x0'));var util=require(_0xf727('0x1'));var logger=require(_0xf727('0x2'))(_0xf727('0x3'));var moment=require(_0xf727('0x4'));var BPromise=require(_0xf727('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf727('0x6'));var rimraf=require(_0xf727('0x7'));var config=require('../../config/environment');var attributes=require(_0xf727('0x8'));module['exports']=function(_0x3339b4,_0x20b377){return _0x3339b4[_0xf727('0x9')](_0xf727('0xa'),attributes,{'tableName':_0xf727('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d42197a..e2cd97c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07d9=['util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x15801,_0x2684c0){var _0x12c941=function(_0x58d3ad){while(--_0x58d3ad){_0x15801['push'](_0x15801['shift']());}};_0x12c941(++_0x2684c0);}(_0x07d9,0x1df));var _0x907d=function(_0x4780da,_0x1d7dd2){_0x4780da=_0x4780da-0x0;var _0x4fe2b5=_0x07d9[_0x4780da];return _0x4fe2b5;};'use strict';var _=require(_0x907d('0x0'));var util=require(_0x907d('0x1'));var moment=require(_0x907d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x907d('0x3'))['db'];var utils=require(_0x907d('0x4'));var logger=require('../../config/logger')(_0x907d('0x5'));var config=require(_0x907d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x907d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x357f97,_0x3ba663,_0x57ce2a){return new BPromise(function(_0x18e320,_0x2aa071){return client[_0x907d('0x8')](_0x357f97,_0x57ce2a)[_0x907d('0x9')](function(_0x4e4523){logger[_0x907d('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3ba663,_0x907d('0xb'));logger[_0x907d('0xc')](_0x907d('0xd'),_0x3ba663,_0x907d('0xb'),JSON[_0x907d('0xe')](_0x4e4523));if(_0x4e4523[_0x907d('0xf')]){if(_0x4e4523['error']['code']===0x1f4){logger[_0x907d('0xf')](_0x907d('0x10'),_0x3ba663,_0x4e4523[_0x907d('0xf')][_0x907d('0x11')]);return _0x2aa071(_0x4e4523[_0x907d('0xf')]['message']);}logger[_0x907d('0xf')](_0x907d('0x10'),_0x3ba663,_0x4e4523[_0x907d('0xf')][_0x907d('0x11')]);return _0x18e320(_0x4e4523[_0x907d('0xf')][_0x907d('0x11')]);}else{logger[_0x907d('0xa')](_0x907d('0x10'),_0x3ba663,'request\x20sent');_0x18e320(_0x4e4523[_0x907d('0x12')][_0x907d('0x11')]);}})[_0x907d('0x13')](function(_0x51e1b0){logger[_0x907d('0xf')](_0x907d('0x10'),_0x3ba663,_0x51e1b0);_0x2aa071(_0x51e1b0);});});}
\ No newline at end of file
+var _0x74fb=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3248c3,_0x355905){var _0x123814=function(_0x232e85){while(--_0x232e85){_0x3248c3['push'](_0x3248c3['shift']());}};_0x123814(++_0x355905);}(_0x74fb,0x6b));var _0xb74f=function(_0x2301a3,_0x2258e3){_0x2301a3=_0x2301a3-0x0;var _0x18816a=_0x74fb[_0x2301a3];return _0x18816a;};'use strict';var _=require(_0xb74f('0x0'));var util=require(_0xb74f('0x1'));var moment=require(_0xb74f('0x2'));var BPromise=require(_0xb74f('0x3'));var rs=require(_0xb74f('0x4'));var fs=require('fs');var Redis=require(_0xb74f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb74f('0x6'))('rpc');var config=require(_0xb74f('0x7'));var jayson=require(_0xb74f('0x8'));var client=jayson[_0xb74f('0x9')][_0xb74f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd14af0,_0x1c357c,_0x142cc0){return new BPromise(function(_0x2c3201,_0x46886e){return client[_0xb74f('0xb')](_0xd14af0,_0x142cc0)['then'](function(_0x22aa9a){logger[_0xb74f('0xc')](_0xb74f('0xd'),_0x1c357c,_0xb74f('0xe'));logger[_0xb74f('0xf')](_0xb74f('0x10'),_0x1c357c,_0xb74f('0xe'),JSON['stringify'](_0x22aa9a));if(_0x22aa9a[_0xb74f('0x11')]){if(_0x22aa9a[_0xb74f('0x11')][_0xb74f('0x12')]===0x1f4){logger[_0xb74f('0x11')](_0xb74f('0xd'),_0x1c357c,_0x22aa9a[_0xb74f('0x11')][_0xb74f('0x13')]);return _0x46886e(_0x22aa9a[_0xb74f('0x11')][_0xb74f('0x13')]);}logger[_0xb74f('0x11')](_0xb74f('0xd'),_0x1c357c,_0x22aa9a[_0xb74f('0x11')]['message']);return _0x2c3201(_0x22aa9a['error'][_0xb74f('0x13')]);}else{logger[_0xb74f('0xc')](_0xb74f('0xd'),_0x1c357c,_0xb74f('0xe'));_0x2c3201(_0x22aa9a[_0xb74f('0x14')][_0xb74f('0x13')]);}})['catch'](function(_0x27bfc0){logger[_0xb74f('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1c357c,_0x27bfc0);_0x46886e(_0x27bfc0);});});}
\ No newline at end of file
index 5e1d781..9c46b20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ae8=['../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','show','/:id/sessions','isAuthenticated','/:id/answers','/:id/summary','getSummary','post','create','clone','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x14d99b,_0x76f8ea){var _0x288bc9=function(_0x578b21){while(--_0x578b21){_0x14d99b['push'](_0x14d99b['shift']());}};_0x288bc9(++_0x76f8ea);}(_0x8ae8,0xda));var _0x88ae=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0x8ae8[_0x13e758];return _0x5b53c3;};'use strict';var multer=require(_0x88ae('0x0'));var util=require(_0x88ae('0x1'));var path=require(_0x88ae('0x2'));var timeout=require(_0x88ae('0x3'));var express=require(_0x88ae('0x4'));var router=express[_0x88ae('0x5')]();var auth=require(_0x88ae('0x6'));var interaction=require(_0x88ae('0x7'));var config=require(_0x88ae('0x8'));var controller=require(_0x88ae('0x9'));router[_0x88ae('0xa')]('/',auth['isAuthenticated'](),controller[_0x88ae('0xb')]);router[_0x88ae('0xa')](_0x88ae('0xc'),auth['isAuthenticated'](),controller[_0x88ae('0xd')]);router[_0x88ae('0xa')](_0x88ae('0xe'),auth[_0x88ae('0xf')](),controller['getSessions']);router[_0x88ae('0xa')](_0x88ae('0x10'),auth[_0x88ae('0xf')](),controller['getAnswers']);router[_0x88ae('0xa')](_0x88ae('0x11'),auth[_0x88ae('0xf')](),timeout('30s'),controller[_0x88ae('0x12')]);router[_0x88ae('0x13')]('/',auth[_0x88ae('0xf')](),controller[_0x88ae('0x14')]);router['post']('/:id/clone',auth[_0x88ae('0xf')](),controller[_0x88ae('0x15')]);router[_0x88ae('0x16')](_0x88ae('0xc'),auth['isAuthenticated'](),controller[_0x88ae('0x17')]);router['delete']('/:id',auth[_0x88ae('0xf')](),controller['destroy']);module[_0x88ae('0x18')]=router;
\ No newline at end of file
+var _0x4aaa=['clone','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','getAnswers','30s','create','post','/:id/clone'];(function(_0x3844ab,_0x461e40){var _0x2a3276=function(_0x1d1176){while(--_0x1d1176){_0x3844ab['push'](_0x3844ab['shift']());}};_0x2a3276(++_0x461e40);}(_0x4aaa,0x7b));var _0xa4aa=function(_0x1d0c1d,_0x16dd72){_0x1d0c1d=_0x1d0c1d-0x0;var _0x16c872=_0x4aaa[_0x1d0c1d];return _0x16c872;};'use strict';var multer=require('multer');var util=require(_0xa4aa('0x0'));var path=require(_0xa4aa('0x1'));var timeout=require(_0xa4aa('0x2'));var express=require(_0xa4aa('0x3'));var router=express[_0xa4aa('0x4')]();var auth=require(_0xa4aa('0x5'));var interaction=require(_0xa4aa('0x6'));var config=require(_0xa4aa('0x7'));var controller=require(_0xa4aa('0x8'));router[_0xa4aa('0x9')]('/',auth[_0xa4aa('0xa')](),controller[_0xa4aa('0xb')]);router[_0xa4aa('0x9')](_0xa4aa('0xc'),auth[_0xa4aa('0xa')](),controller[_0xa4aa('0xd')]);router['get'](_0xa4aa('0xe'),auth['isAuthenticated'](),controller[_0xa4aa('0xf')]);router[_0xa4aa('0x9')]('/:id/answers',auth[_0xa4aa('0xa')](),controller[_0xa4aa('0x10')]);router[_0xa4aa('0x9')]('/:id/summary',auth['isAuthenticated'](),timeout(_0xa4aa('0x11')),controller['getSummary']);router['post']('/',auth[_0xa4aa('0xa')](),controller[_0xa4aa('0x12')]);router[_0xa4aa('0x13')](_0xa4aa('0x14'),auth['isAuthenticated'](),controller[_0xa4aa('0x15')]);router[_0xa4aa('0x16')](_0xa4aa('0xc'),auth[_0xa4aa('0xa')](),controller['update']);router['delete']('/:id',auth[_0xa4aa('0xa')](),controller['destroy']);module[_0xa4aa('0x17')]=router;
\ No newline at end of file
index e27996f..44c69f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb318=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','getDataValue','BOOLEAN','sequelize','lodash','util','STRING','TEXT','long','isObjectLike','formData'];(function(_0x5ebecf,_0x5f4996){var _0x3c98a3=function(_0x18fbf6){while(--_0x18fbf6){_0x5ebecf['push'](_0x5ebecf['shift']());}};_0x3c98a3(++_0x5f4996);}(_0xb318,0x124));var _0x8b31=function(_0x337e03,_0x501688){_0x337e03=_0x337e03-0x0;var _0x233450=_0xb318[_0x337e03];return _0x233450;};'use strict';var Sequelize=require(_0x8b31('0x0'));var _=require(_0x8b31('0x1'));var util=require(_0x8b31('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x8b31('0x3')]},'formData':{'type':Sequelize[_0x8b31('0x4')](_0x8b31('0x5')),'set':function(_0x28a045){if(_[_0x8b31('0x6')](_0x28a045)){this['setDataValue'](_0x8b31('0x7'),JSON[_0x8b31('0x8')](_0x28a045));}else if(_[_0x8b31('0x9')](_0x28a045)){this['setDataValue']('formData',_0x28a045);}else{this['setDataValue'](_0x8b31('0x7'),util[_0x8b31('0xa')](_0x8b31('0xb'),this['getDataValue'](_0x8b31('0xc'))||'',this[_0x8b31('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8b31('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x071b=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x071b,0x113));var _0xb071=function(_0x173825,_0x1d8391){_0x173825=_0x173825-0x0;var _0x190a1e=_0x071b[_0x173825];return _0x190a1e;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb071('0x0'));var util=require(_0xb071('0x1'));module[_0xb071('0x2')]={'name':{'type':Sequelize[_0xb071('0x3')],'unique':_0xb071('0x4')},'description':{'type':Sequelize[_0xb071('0x3')]},'formData':{'type':Sequelize[_0xb071('0x5')](_0xb071('0x6')),'set':function(_0x11928c){if(_[_0xb071('0x7')](_0x11928c)){this[_0xb071('0x8')]('formData',JSON[_0xb071('0x9')](_0x11928c));}else if(_[_0xb071('0xa')](_0x11928c)){this[_0xb071('0x8')](_0xb071('0xb'),_0x11928c);}else{this[_0xb071('0x8')](_0xb071('0xb'),util[_0xb071('0xc')](_0xb071('0xd'),this[_0xb071('0xe')](_0xb071('0x4'))||'',this[_0xb071('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb071('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index cb8f120..c6c68eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f63=['sendStatus','status','end','count','offset','limit','set','json','reject','update','then','destroy','get','Projects','error','stack','name','send','map','JscriptyProject','rawAttributes','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','catch','clone','includeAll','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','text/csv','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x469703,_0x1a720c){var _0x3898ec=function(_0x2b9fae){while(--_0x2b9fae){_0x469703['push'](_0x469703['shift']());}};_0x3898ec(++_0x1a720c);}(_0x3f63,0xd1));var _0x33f6=function(_0x29b779,_0xf33e14){_0x29b779=_0x29b779-0x0;var _0x1e52d9=_0x3f63[_0x29b779];return _0x1e52d9;};'use strict';var pdf=require(_0x33f6('0x0'));var emlformat=require(_0x33f6('0x1'));var rimraf=require(_0x33f6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33f6('0x3'));var rp=require('request-promise');var moment=require(_0x33f6('0x4'));var BPromise=require(_0x33f6('0x5'));var Mustache=require(_0x33f6('0x6'));var util=require(_0x33f6('0x7'));var path=require(_0x33f6('0x8'));var sox=require(_0x33f6('0x9'));var csv=require(_0x33f6('0xa'));var ejs=require(_0x33f6('0xb'));var fs=require('fs');var _=require(_0x33f6('0xc'));var squel=require('squel');var crypto=require(_0x33f6('0xd'));var jsforce=require(_0x33f6('0xe'));var deskjs=require(_0x33f6('0xf'));var toCsv=require(_0x33f6('0xa'));var querystring=require(_0x33f6('0x10'));var Papa=require(_0x33f6('0x11'));var Redis=require(_0x33f6('0x12'));var authService=require(_0x33f6('0x13'));var qs=require(_0x33f6('0x14'));var as=require(_0x33f6('0x15'));var hardwareService=require(_0x33f6('0x16'));var logger=require(_0x33f6('0x17'))('api');var utils=require(_0x33f6('0x18'));var config=require(_0x33f6('0x19'));var db=require(_0x33f6('0x1a'))['db'];function respondWithStatusCode(_0x47486e,_0x164c90){_0x164c90=_0x164c90||0xcc;return function(_0x34a6db){if(_0x34a6db){return _0x47486e[_0x33f6('0x1b')](_0x164c90);}return _0x47486e[_0x33f6('0x1c')](_0x164c90)[_0x33f6('0x1d')]();};}function respondWithResult(_0x445b06,_0x522038){_0x522038=_0x522038||0xc8;return function(_0x3b92a1){if(_0x3b92a1){return _0x445b06[_0x33f6('0x1c')](_0x522038)['json'](_0x3b92a1);}};}function respondWithFilteredResult(_0x32eb89,_0x792f4){return function(_0x6e0fea){if(_0x6e0fea){var _0x28e6b9=_0x6e0fea[_0x33f6('0x1e')],_0x42592b=_0x792f4[_0x33f6('0x1f')],_0x5c0b1a=_0x792f4[_0x33f6('0x1f')]+_0x792f4[_0x33f6('0x20')],_0x4d24b5;if(_0x5c0b1a>=_0x28e6b9){_0x5c0b1a=_0x28e6b9;_0x4d24b5=0xc8;}else{_0x4d24b5=0xce;}_0x32eb89['status'](_0x4d24b5);return _0x32eb89[_0x33f6('0x21')]('Content-Range',_0x42592b+'-'+_0x5c0b1a+'/'+_0x28e6b9)[_0x33f6('0x22')](_0x6e0fea);}return null;};}function patchUpdates(_0x12abf9){return function(_0x561c7f){try{jsonpatch['apply'](_0x561c7f,_0x12abf9,!![]);}catch(_0x4773ea){return BPromise[_0x33f6('0x23')](_0x4773ea);}return _0x561c7f['save']();};}function saveUpdates(_0x27eb3b,_0x2d8a5c){return function(_0x6b139c){if(_0x6b139c){return _0x6b139c[_0x33f6('0x24')](_0x27eb3b)[_0x33f6('0x25')](function(_0x27d68e){return _0x27d68e;});}return null;};}function removeEntity(_0x55aff8,_0x1c0fc5){return function(_0x50e7a2){if(_0x50e7a2){return _0x50e7a2[_0x33f6('0x26')]()[_0x33f6('0x25')](function(){var _0x57f029=_0x50e7a2[_0x33f6('0x27')]({'plain':!![]});var _0x5621be=_0x33f6('0x28');return db['UserProfileResource'][_0x33f6('0x26')]({'where':{'type':_0x5621be,'resourceId':_0x57f029['id']}})['then'](function(){return _0x50e7a2;});})['then'](function(){_0x55aff8[_0x33f6('0x1c')](0xcc)[_0x33f6('0x1d')]();});}};}function handleEntityNotFound(_0x2781d4,_0x203a56){return function(_0x5f015f){if(!_0x5f015f){_0x2781d4[_0x33f6('0x1b')](0x194);}return _0x5f015f;};}function handleError(_0x1bb9c2,_0x4659a6){_0x4659a6=_0x4659a6||0x1f4;return function(_0x2232ff){logger[_0x33f6('0x29')](_0x2232ff[_0x33f6('0x2a')]);if(_0x2232ff['name']){delete _0x2232ff[_0x33f6('0x2b')];}_0x1bb9c2[_0x33f6('0x1c')](_0x4659a6)[_0x33f6('0x2c')](_0x2232ff);};}exports['index']=function(_0x204e30,_0x25cc45){var _0x176fb3={},_0x54368c={},_0x1f4200={'count':0x0,'rows':[]};var _0x309dcb=_[_0x33f6('0x2d')](db[_0x33f6('0x2e')][_0x33f6('0x2f')],function(_0x519087){return{'name':_0x519087['fieldName'],'type':_0x519087[_0x33f6('0x30')][_0x33f6('0x31')]};});_0x54368c[_0x33f6('0x32')]=_[_0x33f6('0x2d')](_0x309dcb,_0x33f6('0x2b'));_0x54368c['query']=_[_0x33f6('0x33')](_0x204e30[_0x33f6('0x34')]);_0x54368c[_0x33f6('0x35')]=_['intersection'](_0x54368c[_0x33f6('0x32')],_0x54368c[_0x33f6('0x34')]);_0x176fb3['attributes']=_['intersection'](_0x54368c[_0x33f6('0x32')],qs[_0x33f6('0x36')](_0x204e30[_0x33f6('0x34')][_0x33f6('0x36')]));_0x176fb3[_0x33f6('0x37')]=_0x176fb3[_0x33f6('0x37')][_0x33f6('0x38')]?_0x176fb3[_0x33f6('0x37')]:_0x54368c['model'];if(!_0x204e30[_0x33f6('0x34')][_0x33f6('0x39')](_0x33f6('0x3a'))){_0x176fb3[_0x33f6('0x20')]=qs[_0x33f6('0x20')](_0x204e30['query']['limit']);_0x176fb3[_0x33f6('0x1f')]=qs[_0x33f6('0x1f')](_0x204e30['query']['offset']);}_0x176fb3[_0x33f6('0x3b')]=qs['sort'](_0x204e30['query'][_0x33f6('0x3c')]);_0x176fb3['where']=qs[_0x33f6('0x35')](_[_0x33f6('0x3d')](_0x204e30['query'],_0x54368c[_0x33f6('0x35')]),_0x309dcb);if(_0x204e30[_0x33f6('0x34')]['filter']){_0x176fb3[_0x33f6('0x3e')]=_[_0x33f6('0x3f')](_0x176fb3[_0x33f6('0x3e')],{'$or':_[_0x33f6('0x2d')](_0x309dcb,function(_0x463842){if(_0x463842['type']!==_0x33f6('0x40')){var _0x39c4ad={};_0x39c4ad[_0x463842['name']]={'$like':'%'+_0x204e30[_0x33f6('0x34')][_0x33f6('0x41')]+'%'};return _0x39c4ad;}})});}_0x176fb3=_['merge']({},_0x176fb3,_0x204e30[_0x33f6('0x42')]);var _0x16f363={'where':_0x176fb3['where']};return db[_0x33f6('0x2e')][_0x33f6('0x1e')](_0x16f363)['then'](function(_0x468a62){_0x1f4200[_0x33f6('0x1e')]=_0x468a62;if(_0x204e30['query']['includeAll']){_0x176fb3[_0x33f6('0x43')]=[{'all':!![]}];}return db[_0x33f6('0x2e')][_0x33f6('0x44')](_0x176fb3);})[_0x33f6('0x25')](function(_0x1a6bd9){_0x1f4200[_0x33f6('0x45')]=_0x1a6bd9;return _0x1f4200;})['then'](respondWithFilteredResult(_0x25cc45,_0x176fb3))['catch'](handleError(_0x25cc45,null));};exports[_0x33f6('0x46')]=function(_0x280ba3,_0x2fb182){var _0x4a94b3={'raw':![],'where':{'id':_0x280ba3['params']['id']}},_0x5d92b1={};_0x5d92b1['model']=_[_0x33f6('0x33')](db['JscriptyProject'][_0x33f6('0x2f')]);_0x5d92b1[_0x33f6('0x34')]=_[_0x33f6('0x33')](_0x280ba3['query']);_0x5d92b1[_0x33f6('0x35')]=_['intersection'](_0x5d92b1[_0x33f6('0x32')],_0x5d92b1[_0x33f6('0x34')]);_0x4a94b3[_0x33f6('0x37')]=_[_0x33f6('0x47')](_0x5d92b1[_0x33f6('0x32')],qs[_0x33f6('0x36')](_0x280ba3[_0x33f6('0x34')][_0x33f6('0x36')]));_0x4a94b3[_0x33f6('0x37')]=_0x4a94b3[_0x33f6('0x37')][_0x33f6('0x38')]?_0x4a94b3[_0x33f6('0x37')]:_0x5d92b1[_0x33f6('0x32')];if(_0x280ba3[_0x33f6('0x34')]['includeAll']){_0x4a94b3[_0x33f6('0x43')]=[{'all':!![]}];}_0x4a94b3=_[_0x33f6('0x3f')]({},_0x4a94b3,_0x280ba3[_0x33f6('0x42')]);return db[_0x33f6('0x2e')][_0x33f6('0x48')](_0x4a94b3)['then'](handleEntityNotFound(_0x2fb182,null))[_0x33f6('0x25')](respondWithResult(_0x2fb182,null))['catch'](handleError(_0x2fb182,null));};exports[_0x33f6('0x49')]=function(_0x146f12,_0x484dc8){return db['JscriptyProject'][_0x33f6('0x49')](_0x146f12[_0x33f6('0x4a')],{})[_0x33f6('0x25')](function(_0x3ba108){var _0x35ebf3=_0x146f12['user'][_0x33f6('0x27')]({'plain':!![]});if(!_0x35ebf3)throw new Error(_0x33f6('0x4b'));if(_0x35ebf3[_0x33f6('0x4c')]===_0x33f6('0x4d')){var _0x4c9016=_0x3ba108[_0x33f6('0x27')]({'plain':!![]});var _0x2082f8=_0x33f6('0x28');return db[_0x33f6('0x4e')][_0x33f6('0x48')]({'where':{'name':_0x2082f8,'userProfileId':_0x35ebf3['userProfileId']},'raw':!![]})[_0x33f6('0x25')](function(_0x2b5eaa){if(_0x2b5eaa&&_0x2b5eaa['autoAssociation']===0x0){return db[_0x33f6('0x4f')][_0x33f6('0x49')]({'name':_0x4c9016[_0x33f6('0x2b')],'resourceId':_0x4c9016['id'],'type':_0x2b5eaa['name'],'sectionId':_0x2b5eaa['id']},{})[_0x33f6('0x25')](function(){return _0x3ba108;});}else{return _0x3ba108;}})[_0x33f6('0x50')](function(_0x1c0fc8){logger[_0x33f6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c0fc8);throw _0x1c0fc8;});}return _0x3ba108;})[_0x33f6('0x25')](respondWithResult(_0x484dc8,0xc9))[_0x33f6('0x50')](handleError(_0x484dc8,null));};exports[_0x33f6('0x51')]=function(_0x609f6f,_0x552186){var _0x3ef8af={'where':{'id':_0x609f6f['params']['id']}},_0xb7ef36={};_0xb7ef36[_0x33f6('0x32')]=_[_0x33f6('0x33')](db['JscriptyProject'][_0x33f6('0x2f')]);_0x3ef8af['attributes']=_[_0x33f6('0x47')](_0xb7ef36[_0x33f6('0x32')],qs[_0x33f6('0x36')](_0x609f6f[_0x33f6('0x34')][_0x33f6('0x36')]));_0x3ef8af[_0x33f6('0x37')]=_0x3ef8af[_0x33f6('0x37')][_0x33f6('0x38')]?_0x3ef8af[_0x33f6('0x37')]:_0xb7ef36['model'];if(_0x609f6f[_0x33f6('0x34')][_0x33f6('0x52')]){_0x3ef8af[_0x33f6('0x43')]=[{'all':!![]}];}_0x3ef8af=_[_0x33f6('0x3f')]({},_0x3ef8af,_0x609f6f[_0x33f6('0x42')]);return db[_0x33f6('0x2e')][_0x33f6('0x48')](_0x3ef8af)[_0x33f6('0x25')](handleEntityNotFound(_0x552186,null))['then'](function(_0xb23a6c){if(_0xb23a6c){var _0x403c91=_0xb23a6c[_0x33f6('0x27')]({'plain':!![]});_0x403c91=qs[_0x33f6('0x53')](_0x403c91,['id',_0x33f6('0x54'),'updatedAt']);_0x609f6f[_0x33f6('0x4a')]=_[_0x33f6('0x53')](_0x609f6f[_0x33f6('0x4a')],['id',_0x33f6('0x54'),_0x33f6('0x55')]);return db['JscriptyProject'][_0x33f6('0x49')](_['merge'](_0x403c91,_0x609f6f[_0x33f6('0x4a')]),{'include':_0x609f6f[_0x33f6('0x34')][_0x33f6('0x52')]?[{'all':!![]}]:undefined})[_0x33f6('0x25')](function(_0xfc4c9e){var _0x5e6a7c=_0x609f6f[_0x33f6('0x4d')]['get']({'plain':!![]});if(!_0x5e6a7c)throw new Error(_0x33f6('0x4b'));if(_0x5e6a7c[_0x33f6('0x4c')]==='user'){var _0x3cf326=_0xfc4c9e[_0x33f6('0x27')]({'plain':!![]});var _0x4eb26c=_0x33f6('0x28');return db[_0x33f6('0x4e')][_0x33f6('0x48')]({'where':{'name':_0x4eb26c,'userProfileId':_0x5e6a7c[_0x33f6('0x56')]},'raw':!![]})['then'](function(_0x4db3b8){if(_0x4db3b8&&_0x4db3b8[_0x33f6('0x57')]===0x0){return db[_0x33f6('0x4f')]['create']({'name':_0x3cf326[_0x33f6('0x2b')],'resourceId':_0x3cf326['id'],'type':_0x4db3b8[_0x33f6('0x2b')],'sectionId':_0x4db3b8['id']},{})[_0x33f6('0x25')](function(){return _0xfc4c9e;});}else{return _0xfc4c9e;}})[_0x33f6('0x50')](function(_0x51daec){logger[_0x33f6('0x29')](_0x33f6('0x58'),_0x51daec);throw _0x51daec;});}return _0xfc4c9e;});}})[_0x33f6('0x25')](respondWithResult(_0x552186,0xc9))['catch'](handleError(_0x552186,null));};exports[_0x33f6('0x24')]=function(_0x4c7e37,_0xad4f8d){if(_0x4c7e37[_0x33f6('0x4a')]['id']){delete _0x4c7e37[_0x33f6('0x4a')]['id'];}return db['JscriptyProject'][_0x33f6('0x48')]({'where':{'id':_0x4c7e37[_0x33f6('0x59')]['id']}})[_0x33f6('0x25')](handleEntityNotFound(_0xad4f8d,null))[_0x33f6('0x25')](saveUpdates(_0x4c7e37['body'],null))[_0x33f6('0x25')](respondWithResult(_0xad4f8d,null))[_0x33f6('0x50')](handleError(_0xad4f8d,null));};exports[_0x33f6('0x26')]=function(_0x45399f,_0x44093c){return db[_0x33f6('0x2e')][_0x33f6('0x48')]({'where':{'id':_0x45399f[_0x33f6('0x59')]['id']}})[_0x33f6('0x25')](handleEntityNotFound(_0x44093c,null))['then'](removeEntity(_0x44093c,null))[_0x33f6('0x50')](handleError(_0x44093c,null));};exports[_0x33f6('0x5a')]=function(_0x14ff9d,_0x173f59,_0x3c60a4){var _0x5aa9c9={'raw':!![],'where':{}};var _0x2ef9cb={};var _0x4eae93={'count':0x0,'rows':[]};return db[_0x33f6('0x2e')][_0x33f6('0x5b')]({'where':{'id':_0x14ff9d[_0x33f6('0x59')]['id']}})[_0x33f6('0x25')](handleEntityNotFound(_0x173f59,null))[_0x33f6('0x25')](function(_0x34bd86){if(_0x34bd86){_0x2ef9cb[_0x33f6('0x32')]=_[_0x33f6('0x33')](db[_0x33f6('0x5c')][_0x33f6('0x2f')]);_0x2ef9cb['query']=_[_0x33f6('0x33')](_0x14ff9d['query']);_0x2ef9cb['filters']=_[_0x33f6('0x47')](_0x2ef9cb[_0x33f6('0x32')],_0x2ef9cb['query']);_0x5aa9c9['attributes']=_['intersection'](_0x2ef9cb[_0x33f6('0x32')],qs['fields'](_0x14ff9d[_0x33f6('0x34')]['fields']));_0x5aa9c9[_0x33f6('0x37')]=_0x5aa9c9[_0x33f6('0x37')][_0x33f6('0x38')]?_0x5aa9c9[_0x33f6('0x37')]:_0x2ef9cb[_0x33f6('0x32')];if(!_0x14ff9d['query'][_0x33f6('0x39')](_0x33f6('0x3a'))){_0x5aa9c9[_0x33f6('0x20')]=qs['limit'](_0x14ff9d[_0x33f6('0x34')][_0x33f6('0x20')]);_0x5aa9c9[_0x33f6('0x1f')]=qs[_0x33f6('0x1f')](_0x14ff9d[_0x33f6('0x34')][_0x33f6('0x1f')]);}_0x5aa9c9['order']=qs[_0x33f6('0x3c')](_0x14ff9d[_0x33f6('0x34')][_0x33f6('0x3c')]);_0x5aa9c9[_0x33f6('0x3e')]=qs[_0x33f6('0x35')](_[_0x33f6('0x3d')](_0x14ff9d[_0x33f6('0x34')],_0x2ef9cb['filters']));_0x5aa9c9[_0x33f6('0x3e')][_0x33f6('0x5d')]=_0x34bd86['id'];if(_0x14ff9d[_0x33f6('0x34')][_0x33f6('0x41')]){_0x5aa9c9['where']=_[_0x33f6('0x3f')](_0x5aa9c9[_0x33f6('0x3e')],{'$or':_[_0x33f6('0x2d')](_0x5aa9c9['attributes'],function(_0x56a0d3){var _0x1ebf62={};_0x1ebf62[_0x56a0d3]={'$like':'%'+_0x14ff9d[_0x33f6('0x34')][_0x33f6('0x41')]+'%'};return _0x1ebf62;})});}_0x5aa9c9=_['merge']({},_0x5aa9c9,_0x14ff9d['options']);return db[_0x33f6('0x5c')][_0x33f6('0x1e')]({'where':_0x5aa9c9[_0x33f6('0x3e')]})['then'](function(_0x51e53c){_0x4eae93[_0x33f6('0x1e')]=_0x51e53c;if(_0x14ff9d[_0x33f6('0x34')][_0x33f6('0x52')]){_0x5aa9c9['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x5aa9c9);})[_0x33f6('0x25')](function(_0x19b40d){_0x4eae93[_0x33f6('0x45')]=_0x19b40d;return _0x4eae93;});}})[_0x33f6('0x25')](respondWithFilteredResult(_0x173f59,_0x5aa9c9))[_0x33f6('0x50')](handleError(_0x173f59,null));};exports[_0x33f6('0x5e')]=function(_0x49c30a,_0x4d6747,_0x43f7bd){var _0x41c592={'raw':!![],'where':{}};var _0x4bd98c={};var _0x4a8d3b={'count':0x0,'rows':[]};return db[_0x33f6('0x2e')]['findOne']({'where':{'id':_0x49c30a[_0x33f6('0x59')]['id']}})[_0x33f6('0x25')](handleEntityNotFound(_0x4d6747,null))['then'](function(_0x5a2fe2){if(_0x5a2fe2){_0x4bd98c[_0x33f6('0x32')]=_[_0x33f6('0x33')](db[_0x33f6('0x5f')][_0x33f6('0x2f')]);_0x4bd98c[_0x33f6('0x34')]=_[_0x33f6('0x33')](_0x49c30a[_0x33f6('0x34')]);_0x4bd98c['filters']=_['intersection'](_0x4bd98c['model'],_0x4bd98c['query']);_0x41c592[_0x33f6('0x37')]=_['intersection'](_0x4bd98c[_0x33f6('0x32')],qs[_0x33f6('0x36')](_0x49c30a[_0x33f6('0x34')]['fields']));_0x41c592['attributes']=_0x41c592[_0x33f6('0x37')][_0x33f6('0x38')]?_0x41c592['attributes']:_0x4bd98c['model'];if(!_0x49c30a[_0x33f6('0x34')][_0x33f6('0x39')]('nolimit')){_0x41c592[_0x33f6('0x20')]=qs[_0x33f6('0x20')](_0x49c30a['query'][_0x33f6('0x20')]);_0x41c592[_0x33f6('0x1f')]=qs[_0x33f6('0x1f')](_0x49c30a[_0x33f6('0x34')][_0x33f6('0x1f')]);}_0x41c592['order']=qs[_0x33f6('0x3c')](_0x49c30a['query'][_0x33f6('0x3c')]);_0x41c592[_0x33f6('0x3e')]=qs[_0x33f6('0x35')](_[_0x33f6('0x3d')](_0x49c30a['query'],_0x4bd98c[_0x33f6('0x35')]));_0x41c592['where'][_0x33f6('0x5d')]=_0x5a2fe2['id'];if(_0x49c30a[_0x33f6('0x34')][_0x33f6('0x41')]){_0x41c592[_0x33f6('0x3e')]=_[_0x33f6('0x3f')](_0x41c592[_0x33f6('0x3e')],{'$or':_[_0x33f6('0x2d')](_0x41c592[_0x33f6('0x37')],function(_0xd48151){var _0x3fb723={};_0x3fb723[_0xd48151]={'$like':'%'+_0x49c30a['query'][_0x33f6('0x41')]+'%'};return _0x3fb723;})});}_0x41c592=_[_0x33f6('0x3f')]({},_0x41c592,_0x49c30a[_0x33f6('0x42')]);return db[_0x33f6('0x5f')]['count']({'where':_0x41c592[_0x33f6('0x3e')]})[_0x33f6('0x25')](function(_0x5d120c){_0x4a8d3b[_0x33f6('0x1e')]=_0x5d120c;if(_0x49c30a['query']['includeAll']){_0x41c592[_0x33f6('0x43')]=[{'all':!![]}];}return db[_0x33f6('0x5f')][_0x33f6('0x44')](_0x41c592);})[_0x33f6('0x25')](function(_0xeff824){_0x4a8d3b[_0x33f6('0x45')]=_0xeff824;return _0x4a8d3b;});}})['then'](respondWithFilteredResult(_0x4d6747,_0x41c592))[_0x33f6('0x50')](handleError(_0x4d6747,null));};function char(_0x25a0d4){return'number'===typeof _0x25a0d4?String[_0x33f6('0x60')]['apply'](null,arguments):_0x25a0d4;}function needsEncapsulation(_0x49031e){return!!_0x49031e&&(_0x49031e[_0x33f6('0x61')]()['indexOf'](char(0xd))>=0x0||_0x49031e[_0x33f6('0x61')]()[_0x33f6('0x62')](char(0xa))>=0x0||_0x49031e[_0x33f6('0x61')]()[_0x33f6('0x62')](char(0x2c))>=0x0||_0x49031e['toString']()[_0x33f6('0x62')](char(0x22))>=0x0);}function encapsulate(_0x3540f1){var _0x54331e=char(0x22),_0x2fb68e='\x5c'+char(0x22),_0x22e6a3=_0x3540f1[_0x33f6('0x61')]()[_0x33f6('0x63')](new RegExp(_0x54331e,'g'),_0x2fb68e);return _0x54331e+_0x22e6a3+_0x54331e;}exports[_0x33f6('0x64')]=function(_0x3353ec,_0xf69174,_0x3ba479){var _0x22c88a,_0x5ea35b;var _0x436280={'where':{'ProjectId':_0x3353ec[_0x33f6('0x59')]['id']}};if(_0x3353ec[_0x33f6('0x34')][_0x33f6('0x65')]){_0x436280[_0x33f6('0x3e')][_0x33f6('0x66')]=JSON['parse'](_0x3353ec[_0x33f6('0x34')]['startTime']);}return db[_0x33f6('0x5c')][_0x33f6('0x44')](_0x436280)[_0x33f6('0x25')](handleEntityNotFound(_0xf69174,null))[_0x33f6('0x25')](function(_0x4aa0e8){if(_0x4aa0e8){_0x22c88a=_0x4aa0e8;return db[_0x33f6('0x67')][_0x33f6('0x44')]({'where':{'SessionId':{'$in':_[_0x33f6('0x2d')](_0x22c88a,'id')},'ProjectId':_0x3353ec['params']['id']},'order':_0x33f6('0x68')});}})[_0x33f6('0x25')](handleEntityNotFound(_0xf69174,null))['then'](function(_0x17e968){if(_0x17e968){_0x5ea35b=_0x17e968;var _0x1d8ed7={};for(var _0x1cc460=0x0,_0x307140=_0x5ea35b[_0x33f6('0x38')];_0x1cc460<_0x307140;_0x1cc460++){if(!_0x1d8ed7[_0x33f6('0x39')](_0x5ea35b[_0x1cc460]['questionId'])){_0x1d8ed7[_0x5ea35b[_0x1cc460]['questionId']]=needsEncapsulation(_0x5ea35b[_0x1cc460][_0x33f6('0x69')])?encapsulate(_0x5ea35b[_0x1cc460][_0x33f6('0x69')]):_0x5ea35b[_0x1cc460][_0x33f6('0x69')];}}var _0x2c9622=[],_0x2c9b47={};for(var _0x3a5fb0=0x0,_0x16c99e=_0x22c88a[_0x33f6('0x38')];_0x3a5fb0<_0x16c99e;_0x3a5fb0++){_0x2c9b47={'ProjectId':_0x3353ec['params']['id'],'SessionId':_0x22c88a[_0x3a5fb0]['id'],'StartTime':moment(_0x22c88a[_0x3a5fb0][_0x33f6('0x66')])[_0x33f6('0x6a')](_0x33f6('0x6b'))};for(var _0x18abb2=0x0,_0x15e150=_0x5ea35b['length'];_0x18abb2<_0x15e150;_0x18abb2++){if(_0x5ea35b[_0x18abb2][_0x33f6('0x6c')]==_0x22c88a[_0x3a5fb0]['id']&&_0x1d8ed7[_0x33f6('0x39')](_0x5ea35b[_0x18abb2][_0x33f6('0x6d')])){_0x2c9b47[_0x1d8ed7[_0x5ea35b[_0x18abb2]['questionId']]]=_0x5ea35b[_0x18abb2][_0x33f6('0x6e')];}}for(var _0xfdbd6 in _0x1d8ed7){if(!_0x2c9b47['hasOwnProperty'](_0x1d8ed7[_0xfdbd6])){_0x2c9b47[_0x1d8ed7[_0xfdbd6]]=null;}}_0x2c9622[_0x33f6('0x6f')](_0x2c9b47);}return _0x2c9622;}})[_0x33f6('0x25')](function(_0x32fffa){if(!_[_0x33f6('0x70')](_0x32fffa)){var _0x417d26=toCsv(_0x32fffa);var _0x24f9b7=Date['now']();fs[_0x33f6('0x71')](util[_0x33f6('0x6a')](_0x33f6('0x72'),_0x3353ec['params']['id'],_0x24f9b7),_0x417d26);_0xf69174[_0x33f6('0x73')]('Content-disposition','attachment;\x20filename='+util['format'](_0x33f6('0x74'),_0x3353ec[_0x33f6('0x59')]['id'],_0x24f9b7));_0xf69174[_0x33f6('0x73')]('Content-type',_0x33f6('0x75'));return _0xf69174['download'](util[_0x33f6('0x6a')](_0x33f6('0x72'),_0x3353ec[_0x33f6('0x59')]['id'],_0x24f9b7));}else{return _0xf69174[_0x33f6('0x1b')](0xcc);}})[_0x33f6('0x50')](handleError(_0xf69174,null));};
\ No newline at end of file
+var _0xd84f=['apply','reject','save','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','JscriptyProject','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','rawAttributes','keys','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','update','JscriptySessionReport','nolimit','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','json'];(function(_0x11ffcf,_0x35dc30){var _0x50e678=function(_0x1a73b5){while(--_0x1a73b5){_0x11ffcf['push'](_0x11ffcf['shift']());}};_0x50e678(++_0x35dc30);}(_0xd84f,0x1a4));var _0xfd84=function(_0x542d34,_0x4f09ee){_0x542d34=_0x542d34-0x0;var _0x3d421d=_0xd84f[_0x542d34];return _0x3d421d;};'use strict';var pdf=require(_0xfd84('0x0'));var emlformat=require(_0xfd84('0x1'));var rimraf=require(_0xfd84('0x2'));var zipdir=require(_0xfd84('0x3'));var jsonpatch=require(_0xfd84('0x4'));var rp=require(_0xfd84('0x5'));var moment=require(_0xfd84('0x6'));var BPromise=require(_0xfd84('0x7'));var Mustache=require(_0xfd84('0x8'));var util=require('util');var path=require(_0xfd84('0x9'));var sox=require(_0xfd84('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfd84('0xb'));var squel=require('squel');var crypto=require(_0xfd84('0xc'));var jsforce=require(_0xfd84('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd84('0xe'));var Papa=require(_0xfd84('0xf'));var Redis=require(_0xfd84('0x10'));var authService=require(_0xfd84('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfd84('0x12'));var hardwareService=require(_0xfd84('0x13'));var logger=require(_0xfd84('0x14'))(_0xfd84('0x15'));var utils=require(_0xfd84('0x16'));var config=require(_0xfd84('0x17'));var db=require(_0xfd84('0x18'))['db'];function respondWithStatusCode(_0x463aa5,_0x2a3d3a){_0x2a3d3a=_0x2a3d3a||0xcc;return function(_0x401964){if(_0x401964){return _0x463aa5['sendStatus'](_0x2a3d3a);}return _0x463aa5[_0xfd84('0x19')](_0x2a3d3a)[_0xfd84('0x1a')]();};}function respondWithResult(_0x3007fa,_0x5ad259){_0x5ad259=_0x5ad259||0xc8;return function(_0x4961f7){if(_0x4961f7){return _0x3007fa[_0xfd84('0x19')](_0x5ad259)['json'](_0x4961f7);}};}function respondWithFilteredResult(_0x313b66,_0x3c8e13){return function(_0x5ba21f){if(_0x5ba21f){var _0x393e57=_0x5ba21f[_0xfd84('0x1b')],_0x1647d2=_0x3c8e13['offset'],_0x5a9a8e=_0x3c8e13[_0xfd84('0x1c')]+_0x3c8e13[_0xfd84('0x1d')],_0x971bf0;if(_0x5a9a8e>=_0x393e57){_0x5a9a8e=_0x393e57;_0x971bf0=0xc8;}else{_0x971bf0=0xce;}_0x313b66[_0xfd84('0x19')](_0x971bf0);return _0x313b66['set'](_0xfd84('0x1e'),_0x1647d2+'-'+_0x5a9a8e+'/'+_0x393e57)[_0xfd84('0x1f')](_0x5ba21f);}return null;};}function patchUpdates(_0x1583d2){return function(_0x2e3cd4){try{jsonpatch[_0xfd84('0x20')](_0x2e3cd4,_0x1583d2,!![]);}catch(_0x262be3){return BPromise[_0xfd84('0x21')](_0x262be3);}return _0x2e3cd4[_0xfd84('0x22')]();};}function saveUpdates(_0x35627b,_0x3c2ad3){return function(_0x54993){if(_0x54993){return _0x54993['update'](_0x35627b)[_0xfd84('0x23')](function(_0x5bfe61){return _0x5bfe61;});}return null;};}function removeEntity(_0x3b9755,_0x5ee0dc){return function(_0x53ab2a){if(_0x53ab2a){return _0x53ab2a[_0xfd84('0x24')]()[_0xfd84('0x23')](function(){var _0x182b9f=_0x53ab2a[_0xfd84('0x25')]({'plain':!![]});var _0x2f92dd=_0xfd84('0x26');return db[_0xfd84('0x27')][_0xfd84('0x24')]({'where':{'type':_0x2f92dd,'resourceId':_0x182b9f['id']}})[_0xfd84('0x23')](function(){return _0x53ab2a;});})[_0xfd84('0x23')](function(){_0x3b9755[_0xfd84('0x19')](0xcc)[_0xfd84('0x1a')]();});}};}function handleEntityNotFound(_0x9024cd,_0x4c83b6){return function(_0x3a090c){if(!_0x3a090c){_0x9024cd['sendStatus'](0x194);}return _0x3a090c;};}function handleError(_0x3692c9,_0x3aa190){_0x3aa190=_0x3aa190||0x1f4;return function(_0x3c0ed9){logger[_0xfd84('0x28')](_0x3c0ed9[_0xfd84('0x29')]);if(_0x3c0ed9[_0xfd84('0x2a')]){delete _0x3c0ed9[_0xfd84('0x2a')];}_0x3692c9[_0xfd84('0x19')](_0x3aa190)[_0xfd84('0x2b')](_0x3c0ed9);};}exports[_0xfd84('0x2c')]=function(_0x248067,_0x58b56f){var _0x1ed13e={},_0x10d94d={},_0x5de916={'count':0x0,'rows':[]};var _0x2b0f9f=_['map'](db[_0xfd84('0x2d')]['rawAttributes'],function(_0x15a4cc){return{'name':_0x15a4cc[_0xfd84('0x2e')],'type':_0x15a4cc[_0xfd84('0x2f')]['key']};});_0x10d94d[_0xfd84('0x30')]=_[_0xfd84('0x31')](_0x2b0f9f,'name');_0x10d94d[_0xfd84('0x32')]=_['keys'](_0x248067[_0xfd84('0x32')]);_0x10d94d[_0xfd84('0x33')]=_[_0xfd84('0x34')](_0x10d94d[_0xfd84('0x30')],_0x10d94d[_0xfd84('0x32')]);_0x1ed13e[_0xfd84('0x35')]=_[_0xfd84('0x34')](_0x10d94d[_0xfd84('0x30')],qs['fields'](_0x248067['query'][_0xfd84('0x36')]));_0x1ed13e[_0xfd84('0x35')]=_0x1ed13e[_0xfd84('0x35')][_0xfd84('0x37')]?_0x1ed13e[_0xfd84('0x35')]:_0x10d94d[_0xfd84('0x30')];if(!_0x248067[_0xfd84('0x32')][_0xfd84('0x38')]('nolimit')){_0x1ed13e['limit']=qs['limit'](_0x248067[_0xfd84('0x32')][_0xfd84('0x1d')]);_0x1ed13e[_0xfd84('0x1c')]=qs['offset'](_0x248067['query'][_0xfd84('0x1c')]);}_0x1ed13e[_0xfd84('0x39')]=qs[_0xfd84('0x3a')](_0x248067[_0xfd84('0x32')][_0xfd84('0x3a')]);_0x1ed13e[_0xfd84('0x3b')]=qs[_0xfd84('0x33')](_['pick'](_0x248067[_0xfd84('0x32')],_0x10d94d['filters']),_0x2b0f9f);if(_0x248067[_0xfd84('0x32')][_0xfd84('0x3c')]){_0x1ed13e[_0xfd84('0x3b')]=_['merge'](_0x1ed13e[_0xfd84('0x3b')],{'$or':_[_0xfd84('0x31')](_0x2b0f9f,function(_0x3bed9a){if(_0x3bed9a['type']!==_0xfd84('0x3d')){var _0x24cb85={};_0x24cb85[_0x3bed9a[_0xfd84('0x2a')]]={'$like':'%'+_0x248067['query'][_0xfd84('0x3c')]+'%'};return _0x24cb85;}})});}_0x1ed13e=_[_0xfd84('0x3e')]({},_0x1ed13e,_0x248067[_0xfd84('0x3f')]);var _0x2b9b52={'where':_0x1ed13e[_0xfd84('0x3b')]};return db[_0xfd84('0x2d')]['count'](_0x2b9b52)[_0xfd84('0x23')](function(_0x42718c){_0x5de916[_0xfd84('0x1b')]=_0x42718c;if(_0x248067['query'][_0xfd84('0x40')]){_0x1ed13e['include']=[{'all':!![]}];}return db[_0xfd84('0x2d')][_0xfd84('0x41')](_0x1ed13e);})[_0xfd84('0x23')](function(_0x323df3){_0x5de916[_0xfd84('0x42')]=_0x323df3;return _0x5de916;})[_0xfd84('0x23')](respondWithFilteredResult(_0x58b56f,_0x1ed13e))['catch'](handleError(_0x58b56f,null));};exports[_0xfd84('0x43')]=function(_0x17109e,_0x3bea41){var _0x4911e0={'raw':![],'where':{'id':_0x17109e['params']['id']}},_0x26aae3={};_0x26aae3[_0xfd84('0x30')]=_['keys'](db['JscriptyProject'][_0xfd84('0x44')]);_0x26aae3[_0xfd84('0x32')]=_[_0xfd84('0x45')](_0x17109e[_0xfd84('0x32')]);_0x26aae3['filters']=_[_0xfd84('0x34')](_0x26aae3['model'],_0x26aae3[_0xfd84('0x32')]);_0x4911e0['attributes']=_[_0xfd84('0x34')](_0x26aae3['model'],qs['fields'](_0x17109e[_0xfd84('0x32')][_0xfd84('0x36')]));_0x4911e0[_0xfd84('0x35')]=_0x4911e0[_0xfd84('0x35')][_0xfd84('0x37')]?_0x4911e0['attributes']:_0x26aae3[_0xfd84('0x30')];if(_0x17109e[_0xfd84('0x32')][_0xfd84('0x40')]){_0x4911e0[_0xfd84('0x46')]=[{'all':!![]}];}_0x4911e0=_[_0xfd84('0x3e')]({},_0x4911e0,_0x17109e['options']);return db['JscriptyProject'][_0xfd84('0x47')](_0x4911e0)[_0xfd84('0x23')](handleEntityNotFound(_0x3bea41,null))['then'](respondWithResult(_0x3bea41,null))[_0xfd84('0x48')](handleError(_0x3bea41,null));};exports['create']=function(_0x12db27,_0x36608f){return db[_0xfd84('0x2d')][_0xfd84('0x49')](_0x12db27[_0xfd84('0x4a')],{})[_0xfd84('0x23')](function(_0x556125){var _0x29433a=_0x12db27[_0xfd84('0x4b')][_0xfd84('0x25')]({'plain':!![]});if(!_0x29433a)throw new Error(_0xfd84('0x4c'));if(_0x29433a[_0xfd84('0x4d')]===_0xfd84('0x4b')){var _0x2d0763=_0x556125[_0xfd84('0x25')]({'plain':!![]});var _0x1d080f=_0xfd84('0x26');return db[_0xfd84('0x4e')][_0xfd84('0x47')]({'where':{'name':_0x1d080f,'userProfileId':_0x29433a[_0xfd84('0x4f')]},'raw':!![]})['then'](function(_0xcf18cc){if(_0xcf18cc&&_0xcf18cc[_0xfd84('0x50')]===0x0){return db['UserProfileResource'][_0xfd84('0x49')]({'name':_0x2d0763[_0xfd84('0x2a')],'resourceId':_0x2d0763['id'],'type':_0xcf18cc[_0xfd84('0x2a')],'sectionId':_0xcf18cc['id']},{})[_0xfd84('0x23')](function(){return _0x556125;});}else{return _0x556125;}})['catch'](function(_0x5a1305){logger[_0xfd84('0x28')](_0xfd84('0x51'),_0x5a1305);throw _0x5a1305;});}return _0x556125;})[_0xfd84('0x23')](respondWithResult(_0x36608f,0xc9))[_0xfd84('0x48')](handleError(_0x36608f,null));};exports[_0xfd84('0x52')]=function(_0x1a5b73,_0x5aadfd){var _0x2d47dd={'where':{'id':_0x1a5b73[_0xfd84('0x53')]['id']}},_0x3bbb3d={};_0x3bbb3d['model']=_['keys'](db[_0xfd84('0x2d')][_0xfd84('0x44')]);_0x2d47dd['attributes']=_[_0xfd84('0x34')](_0x3bbb3d[_0xfd84('0x30')],qs['fields'](_0x1a5b73[_0xfd84('0x32')]['fields']));_0x2d47dd[_0xfd84('0x35')]=_0x2d47dd[_0xfd84('0x35')][_0xfd84('0x37')]?_0x2d47dd[_0xfd84('0x35')]:_0x3bbb3d[_0xfd84('0x30')];if(_0x1a5b73[_0xfd84('0x32')][_0xfd84('0x40')]){_0x2d47dd['include']=[{'all':!![]}];}_0x2d47dd=_[_0xfd84('0x3e')]({},_0x2d47dd,_0x1a5b73[_0xfd84('0x3f')]);return db[_0xfd84('0x2d')][_0xfd84('0x47')](_0x2d47dd)[_0xfd84('0x23')](handleEntityNotFound(_0x5aadfd,null))[_0xfd84('0x23')](function(_0x8470a){if(_0x8470a){var _0x50ceae=_0x8470a[_0xfd84('0x25')]({'plain':!![]});_0x50ceae=qs[_0xfd84('0x54')](_0x50ceae,['id',_0xfd84('0x55'),_0xfd84('0x56')]);_0x1a5b73[_0xfd84('0x4a')]=_[_0xfd84('0x54')](_0x1a5b73[_0xfd84('0x4a')],['id','createdAt','updatedAt']);return db['JscriptyProject']['create'](_['merge'](_0x50ceae,_0x1a5b73[_0xfd84('0x4a')]),{'include':_0x1a5b73[_0xfd84('0x32')][_0xfd84('0x40')]?[{'all':!![]}]:undefined})[_0xfd84('0x23')](function(_0x2230fc){var _0x487bdd=_0x1a5b73[_0xfd84('0x4b')][_0xfd84('0x25')]({'plain':!![]});if(!_0x487bdd)throw new Error(_0xfd84('0x4c'));if(_0x487bdd[_0xfd84('0x4d')]===_0xfd84('0x4b')){var _0x53cf3e=_0x2230fc[_0xfd84('0x25')]({'plain':!![]});var _0x438c11=_0xfd84('0x26');return db[_0xfd84('0x4e')]['find']({'where':{'name':_0x438c11,'userProfileId':_0x487bdd['userProfileId']},'raw':!![]})[_0xfd84('0x23')](function(_0x45a4a9){if(_0x45a4a9&&_0x45a4a9['autoAssociation']===0x0){return db[_0xfd84('0x27')][_0xfd84('0x49')]({'name':_0x53cf3e[_0xfd84('0x2a')],'resourceId':_0x53cf3e['id'],'type':_0x45a4a9[_0xfd84('0x2a')],'sectionId':_0x45a4a9['id']},{})[_0xfd84('0x23')](function(){return _0x2230fc;});}else{return _0x2230fc;}})[_0xfd84('0x48')](function(_0xef894b){logger[_0xfd84('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xef894b);throw _0xef894b;});}return _0x2230fc;});}})[_0xfd84('0x23')](respondWithResult(_0x5aadfd,0xc9))[_0xfd84('0x48')](handleError(_0x5aadfd,null));};exports[_0xfd84('0x57')]=function(_0x4f683c,_0x14c7aa){if(_0x4f683c[_0xfd84('0x4a')]['id']){delete _0x4f683c[_0xfd84('0x4a')]['id'];}return db[_0xfd84('0x2d')][_0xfd84('0x47')]({'where':{'id':_0x4f683c[_0xfd84('0x53')]['id']}})[_0xfd84('0x23')](handleEntityNotFound(_0x14c7aa,null))[_0xfd84('0x23')](saveUpdates(_0x4f683c['body'],null))[_0xfd84('0x23')](respondWithResult(_0x14c7aa,null))['catch'](handleError(_0x14c7aa,null));};exports['destroy']=function(_0x36529c,_0x4859f2){return db[_0xfd84('0x2d')][_0xfd84('0x47')]({'where':{'id':_0x36529c[_0xfd84('0x53')]['id']}})['then'](handleEntityNotFound(_0x4859f2,null))[_0xfd84('0x23')](removeEntity(_0x4859f2,null))[_0xfd84('0x48')](handleError(_0x4859f2,null));};exports['getSessions']=function(_0x17333c,_0x54c8a5,_0x2e5a82){var _0x33660d={'raw':!![],'where':{}};var _0x1a73d9={};var _0x416818={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x17333c[_0xfd84('0x53')]['id']}})['then'](handleEntityNotFound(_0x54c8a5,null))['then'](function(_0x5967de){if(_0x5967de){_0x1a73d9[_0xfd84('0x30')]=_[_0xfd84('0x45')](db[_0xfd84('0x58')][_0xfd84('0x44')]);_0x1a73d9['query']=_['keys'](_0x17333c['query']);_0x1a73d9[_0xfd84('0x33')]=_['intersection'](_0x1a73d9[_0xfd84('0x30')],_0x1a73d9['query']);_0x33660d[_0xfd84('0x35')]=_[_0xfd84('0x34')](_0x1a73d9[_0xfd84('0x30')],qs['fields'](_0x17333c['query'][_0xfd84('0x36')]));_0x33660d[_0xfd84('0x35')]=_0x33660d[_0xfd84('0x35')][_0xfd84('0x37')]?_0x33660d[_0xfd84('0x35')]:_0x1a73d9[_0xfd84('0x30')];if(!_0x17333c[_0xfd84('0x32')][_0xfd84('0x38')](_0xfd84('0x59'))){_0x33660d[_0xfd84('0x1d')]=qs['limit'](_0x17333c['query'][_0xfd84('0x1d')]);_0x33660d[_0xfd84('0x1c')]=qs[_0xfd84('0x1c')](_0x17333c[_0xfd84('0x32')]['offset']);}_0x33660d[_0xfd84('0x39')]=qs['sort'](_0x17333c[_0xfd84('0x32')][_0xfd84('0x3a')]);_0x33660d[_0xfd84('0x3b')]=qs[_0xfd84('0x33')](_['pick'](_0x17333c[_0xfd84('0x32')],_0x1a73d9[_0xfd84('0x33')]));_0x33660d['where']['ProjectId']=_0x5967de['id'];if(_0x17333c['query']['filter']){_0x33660d['where']=_['merge'](_0x33660d[_0xfd84('0x3b')],{'$or':_[_0xfd84('0x31')](_0x33660d['attributes'],function(_0x35ec9d){var _0x297d40={};_0x297d40[_0x35ec9d]={'$like':'%'+_0x17333c[_0xfd84('0x32')][_0xfd84('0x3c')]+'%'};return _0x297d40;})});}_0x33660d=_[_0xfd84('0x3e')]({},_0x33660d,_0x17333c[_0xfd84('0x3f')]);return db['JscriptySessionReport'][_0xfd84('0x1b')]({'where':_0x33660d[_0xfd84('0x3b')]})[_0xfd84('0x23')](function(_0x38e16c){_0x416818[_0xfd84('0x1b')]=_0x38e16c;if(_0x17333c[_0xfd84('0x32')][_0xfd84('0x40')]){_0x33660d['include']=[{'all':!![]}];}return db[_0xfd84('0x58')][_0xfd84('0x41')](_0x33660d);})[_0xfd84('0x23')](function(_0x4f1c92){_0x416818['rows']=_0x4f1c92;return _0x416818;});}})[_0xfd84('0x23')](respondWithFilteredResult(_0x54c8a5,_0x33660d))[_0xfd84('0x48')](handleError(_0x54c8a5,null));};exports['getAnswers']=function(_0x2fcbe9,_0x5c111e,_0x1e261c){var _0x2cc1d2={'raw':!![],'where':{}};var _0x3698bc={};var _0x24ca89={'count':0x0,'rows':[]};return db[_0xfd84('0x2d')]['findOne']({'where':{'id':_0x2fcbe9[_0xfd84('0x53')]['id']}})[_0xfd84('0x23')](handleEntityNotFound(_0x5c111e,null))[_0xfd84('0x23')](function(_0xb9480d){if(_0xb9480d){_0x3698bc[_0xfd84('0x30')]=_[_0xfd84('0x45')](db[_0xfd84('0x5a')]['rawAttributes']);_0x3698bc['query']=_[_0xfd84('0x45')](_0x2fcbe9[_0xfd84('0x32')]);_0x3698bc['filters']=_[_0xfd84('0x34')](_0x3698bc[_0xfd84('0x30')],_0x3698bc[_0xfd84('0x32')]);_0x2cc1d2[_0xfd84('0x35')]=_[_0xfd84('0x34')](_0x3698bc[_0xfd84('0x30')],qs[_0xfd84('0x36')](_0x2fcbe9['query'][_0xfd84('0x36')]));_0x2cc1d2['attributes']=_0x2cc1d2[_0xfd84('0x35')][_0xfd84('0x37')]?_0x2cc1d2['attributes']:_0x3698bc[_0xfd84('0x30')];if(!_0x2fcbe9[_0xfd84('0x32')]['hasOwnProperty'](_0xfd84('0x59'))){_0x2cc1d2[_0xfd84('0x1d')]=qs[_0xfd84('0x1d')](_0x2fcbe9[_0xfd84('0x32')][_0xfd84('0x1d')]);_0x2cc1d2[_0xfd84('0x1c')]=qs[_0xfd84('0x1c')](_0x2fcbe9[_0xfd84('0x32')]['offset']);}_0x2cc1d2[_0xfd84('0x39')]=qs[_0xfd84('0x3a')](_0x2fcbe9[_0xfd84('0x32')]['sort']);_0x2cc1d2[_0xfd84('0x3b')]=qs[_0xfd84('0x33')](_['pick'](_0x2fcbe9[_0xfd84('0x32')],_0x3698bc['filters']));_0x2cc1d2[_0xfd84('0x3b')][_0xfd84('0x5b')]=_0xb9480d['id'];if(_0x2fcbe9[_0xfd84('0x32')][_0xfd84('0x3c')]){_0x2cc1d2[_0xfd84('0x3b')]=_[_0xfd84('0x3e')](_0x2cc1d2[_0xfd84('0x3b')],{'$or':_[_0xfd84('0x31')](_0x2cc1d2[_0xfd84('0x35')],function(_0x3fd832){var _0x1b51f7={};_0x1b51f7[_0x3fd832]={'$like':'%'+_0x2fcbe9[_0xfd84('0x32')][_0xfd84('0x3c')]+'%'};return _0x1b51f7;})});}_0x2cc1d2=_['merge']({},_0x2cc1d2,_0x2fcbe9[_0xfd84('0x3f')]);return db['JscriptyAnswerReport'][_0xfd84('0x1b')]({'where':_0x2cc1d2['where']})['then'](function(_0x9ae0fd){_0x24ca89[_0xfd84('0x1b')]=_0x9ae0fd;if(_0x2fcbe9[_0xfd84('0x32')][_0xfd84('0x40')]){_0x2cc1d2[_0xfd84('0x46')]=[{'all':!![]}];}return db[_0xfd84('0x5a')][_0xfd84('0x41')](_0x2cc1d2);})['then'](function(_0x39ff1a){_0x24ca89[_0xfd84('0x42')]=_0x39ff1a;return _0x24ca89;});}})['then'](respondWithFilteredResult(_0x5c111e,_0x2cc1d2))['catch'](handleError(_0x5c111e,null));};function char(_0x526ca4){return _0xfd84('0x5c')===typeof _0x526ca4?String[_0xfd84('0x5d')][_0xfd84('0x20')](null,arguments):_0x526ca4;}function needsEncapsulation(_0x2270d4){return!!_0x2270d4&&(_0x2270d4[_0xfd84('0x5e')]()[_0xfd84('0x5f')](char(0xd))>=0x0||_0x2270d4[_0xfd84('0x5e')]()[_0xfd84('0x5f')](char(0xa))>=0x0||_0x2270d4[_0xfd84('0x5e')]()[_0xfd84('0x5f')](char(0x2c))>=0x0||_0x2270d4[_0xfd84('0x5e')]()[_0xfd84('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x15ee46){var _0x11122e=char(0x22),_0x49a716='\x5c'+char(0x22),_0x35bf1e=_0x15ee46['toString']()[_0xfd84('0x60')](new RegExp(_0x11122e,'g'),_0x49a716);return _0x11122e+_0x35bf1e+_0x11122e;}exports['getSummary']=function(_0xa70d8b,_0x316260,_0xc89661){var _0x69b57f,_0x4ad3a8;var _0x17bdee={'where':{'ProjectId':_0xa70d8b['params']['id']}};if(_0xa70d8b[_0xfd84('0x32')][_0xfd84('0x61')]){_0x17bdee[_0xfd84('0x3b')]['starttime']=JSON[_0xfd84('0x62')](_0xa70d8b[_0xfd84('0x32')][_0xfd84('0x61')]);}return db[_0xfd84('0x58')][_0xfd84('0x41')](_0x17bdee)['then'](handleEntityNotFound(_0x316260,null))[_0xfd84('0x23')](function(_0x4fed24){if(_0x4fed24){_0x69b57f=_0x4fed24;return db[_0xfd84('0x63')][_0xfd84('0x41')]({'where':{'SessionId':{'$in':_[_0xfd84('0x31')](_0x69b57f,'id')},'ProjectId':_0xa70d8b[_0xfd84('0x53')]['id']},'order':_0xfd84('0x64')});}})[_0xfd84('0x23')](handleEntityNotFound(_0x316260,null))[_0xfd84('0x23')](function(_0xddbbef){if(_0xddbbef){_0x4ad3a8=_0xddbbef;var _0x2f85b8={};for(var _0x2b7f72=0x0,_0x47d4ad=_0x4ad3a8[_0xfd84('0x37')];_0x2b7f72<_0x47d4ad;_0x2b7f72++){if(!_0x2f85b8[_0xfd84('0x38')](_0x4ad3a8[_0x2b7f72][_0xfd84('0x65')])){_0x2f85b8[_0x4ad3a8[_0x2b7f72][_0xfd84('0x65')]]=needsEncapsulation(_0x4ad3a8[_0x2b7f72]['question'])?encapsulate(_0x4ad3a8[_0x2b7f72]['question']):_0x4ad3a8[_0x2b7f72][_0xfd84('0x66')];}}var _0x5b4829=[],_0x132564={};for(var _0x2b88fb=0x0,_0x1656cf=_0x69b57f[_0xfd84('0x37')];_0x2b88fb<_0x1656cf;_0x2b88fb++){_0x132564={'ProjectId':_0xa70d8b['params']['id'],'SessionId':_0x69b57f[_0x2b88fb]['id'],'StartTime':moment(_0x69b57f[_0x2b88fb]['starttime'])[_0xfd84('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x15caad=0x0,_0x178192=_0x4ad3a8[_0xfd84('0x37')];_0x15caad<_0x178192;_0x15caad++){if(_0x4ad3a8[_0x15caad]['SessionId']==_0x69b57f[_0x2b88fb]['id']&&_0x2f85b8[_0xfd84('0x38')](_0x4ad3a8[_0x15caad][_0xfd84('0x65')])){_0x132564[_0x2f85b8[_0x4ad3a8[_0x15caad]['questionId']]]=_0x4ad3a8[_0x15caad][_0xfd84('0x68')];}}for(var _0x5b5218 in _0x2f85b8){if(!_0x132564[_0xfd84('0x38')](_0x2f85b8[_0x5b5218])){_0x132564[_0x2f85b8[_0x5b5218]]=null;}}_0x5b4829[_0xfd84('0x69')](_0x132564);}return _0x5b4829;}})[_0xfd84('0x23')](function(_0x1add26){if(!_[_0xfd84('0x6a')](_0x1add26)){var _0x2356f2=toCsv(_0x1add26);var _0x3fe4e1=Date[_0xfd84('0x6b')]();fs['writeFileSync'](util[_0xfd84('0x67')](_0xfd84('0x6c'),_0xa70d8b['params']['id'],_0x3fe4e1),_0x2356f2);_0x316260[_0xfd84('0x6d')]('Content-disposition','attachment;\x20filename='+util['format'](_0xfd84('0x6e'),_0xa70d8b[_0xfd84('0x53')]['id'],_0x3fe4e1));_0x316260[_0xfd84('0x6d')]('Content-type',_0xfd84('0x6f'));return _0x316260[_0xfd84('0x70')](util['format'](_0xfd84('0x6c'),_0xa70d8b['params']['id'],_0x3fe4e1));}else{return _0x316260['sendStatus'](0xcc);}})[_0xfd84('0x48')](handleError(_0x316260,null));};
\ No newline at end of file
index cb8cdae..1119fef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x589e=['bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','util','api','moment'];(function(_0x2e8d7d,_0x53dcc3){var _0x2f3d36=function(_0x472cbd){while(--_0x472cbd){_0x2e8d7d['push'](_0x2e8d7d['shift']());}};_0x2f3d36(++_0x53dcc3);}(_0x589e,0x1dc));var _0xe589=function(_0x4ff628,_0xb56aeb){_0x4ff628=_0x4ff628-0x0;var _0x3654ac=_0x589e[_0x4ff628];return _0x3654ac;};'use strict';var _=require(_0xe589('0x0'));var util=require(_0xe589('0x1'));var logger=require('../../config/logger')(_0xe589('0x2'));var moment=require(_0xe589('0x3'));var BPromise=require(_0xe589('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe589('0x5'));var rimraf=require(_0xe589('0x6'));var config=require(_0xe589('0x7'));var attributes=require(_0xe589('0x8'));module['exports']=function(_0x114395,_0x399961){return _0x114395[_0xe589('0x9')](_0xe589('0xa'),attributes,{'tableName':_0xe589('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2963=['rimraf','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','util','api','moment','bluebird'];(function(_0x380533,_0x2cd2e0){var _0x251d8b=function(_0x478cd2){while(--_0x478cd2){_0x380533['push'](_0x380533['shift']());}};_0x251d8b(++_0x2cd2e0);}(_0x2963,0xff));var _0x3296=function(_0x33c315,_0x19cc6e){_0x33c315=_0x33c315-0x0;var _0x43ddfa=_0x2963[_0x33c315];return _0x43ddfa;};'use strict';var _=require(_0x3296('0x0'));var util=require(_0x3296('0x1'));var logger=require('../../config/logger')(_0x3296('0x2'));var moment=require(_0x3296('0x3'));var BPromise=require(_0x3296('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3296('0x5'));var config=require('../../config/environment');var attributes=require(_0x3296('0x6'));module['exports']=function(_0x573dd3,_0x4126bb){return _0x573dd3[_0x3296('0x7')](_0x3296('0x8'),attributes,{'tableName':_0x3296('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c99b50..0e6ffca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d19=['then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x20a461,_0x5435ed){var _0x5bb9f8=function(_0x2e2767){while(--_0x2e2767){_0x20a461['push'](_0x20a461['shift']());}};_0x5bb9f8(++_0x5435ed);}(_0x7d19,0x1d9));var _0x97d1=function(_0x430936,_0x2a6e66){_0x430936=_0x430936-0x0;var _0x470994=_0x7d19[_0x430936];return _0x470994;};'use strict';var _=require('lodash');var util=require(_0x97d1('0x0'));var moment=require(_0x97d1('0x1'));var BPromise=require(_0x97d1('0x2'));var rs=require(_0x97d1('0x3'));var fs=require('fs');var Redis=require(_0x97d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x97d1('0x5'))('rpc');var config=require(_0x97d1('0x6'));var jayson=require(_0x97d1('0x7'));var client=jayson[_0x97d1('0x8')][_0x97d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x62917f,_0x47bae7,_0x5b2b2a){return new BPromise(function(_0x2b8000,_0x4039f8){return client['request'](_0x62917f,_0x5b2b2a)[_0x97d1('0xa')](function(_0x3ac89b){logger[_0x97d1('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x47bae7,_0x97d1('0xc'));logger[_0x97d1('0xd')](_0x97d1('0xe'),_0x47bae7,_0x97d1('0xc'),JSON['stringify'](_0x3ac89b));if(_0x3ac89b[_0x97d1('0xf')]){if(_0x3ac89b['error'][_0x97d1('0x10')]===0x1f4){logger[_0x97d1('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x47bae7,_0x3ac89b['error'][_0x97d1('0x11')]);return _0x4039f8(_0x3ac89b['error'][_0x97d1('0x11')]);}logger[_0x97d1('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x47bae7,_0x3ac89b[_0x97d1('0xf')]['message']);return _0x2b8000(_0x3ac89b[_0x97d1('0xf')][_0x97d1('0x11')]);}else{logger[_0x97d1('0xb')](_0x97d1('0x12'),_0x47bae7,_0x97d1('0xc'));_0x2b8000(_0x3ac89b[_0x97d1('0x13')][_0x97d1('0x11')]);}})[_0x97d1('0x14')](function(_0x3a2479){logger[_0x97d1('0xf')](_0x97d1('0x12'),_0x47bae7,_0x3a2479);_0x4039f8(_0x3a2479);});});}
\ No newline at end of file
+var _0x3e41=['jayson/promise','http','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x48da79,_0x261e45){var _0x15fc87=function(_0x3d3853){while(--_0x3d3853){_0x48da79['push'](_0x48da79['shift']());}};_0x15fc87(++_0x261e45);}(_0x3e41,0xf4));var _0x13e4=function(_0x28daa1,_0xc546c7){_0x28daa1=_0x28daa1-0x0;var _0x571a0f=_0x3e41[_0x28daa1];return _0x571a0f;};'use strict';var _=require(_0x13e4('0x0'));var util=require(_0x13e4('0x1'));var moment=require(_0x13e4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13e4('0x3'));var db=require(_0x13e4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x13e4('0x5'))(_0x13e4('0x6'));var config=require(_0x13e4('0x7'));var jayson=require(_0x13e4('0x8'));var client=jayson['client'][_0x13e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a16e8,_0x4e73ab,_0x277930){return new BPromise(function(_0x14f1fc,_0x2d2ff8){return client['request'](_0x4a16e8,_0x277930)['then'](function(_0x432b89){logger['info'](_0x13e4('0xa'),_0x4e73ab,_0x13e4('0xb'));logger[_0x13e4('0xc')](_0x13e4('0xd'),_0x4e73ab,_0x13e4('0xb'),JSON[_0x13e4('0xe')](_0x432b89));if(_0x432b89[_0x13e4('0xf')]){if(_0x432b89[_0x13e4('0xf')][_0x13e4('0x10')]===0x1f4){logger[_0x13e4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x4e73ab,_0x432b89['error']['message']);return _0x2d2ff8(_0x432b89['error'][_0x13e4('0x11')]);}logger[_0x13e4('0xf')](_0x13e4('0xa'),_0x4e73ab,_0x432b89[_0x13e4('0xf')][_0x13e4('0x11')]);return _0x14f1fc(_0x432b89[_0x13e4('0xf')][_0x13e4('0x11')]);}else{logger[_0x13e4('0x12')](_0x13e4('0xa'),_0x4e73ab,'request\x20sent');_0x14f1fc(_0x432b89[_0x13e4('0x13')]['message']);}})[_0x13e4('0x14')](function(_0x471358){logger[_0x13e4('0xf')](_0x13e4('0xa'),_0x4e73ab,_0x471358);_0x2d2ff8(_0x471358);});});}
\ No newline at end of file
index 40bfe0f..eb37321 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91c3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x11811b,_0x2317cc){var _0x2321e7=function(_0x1b6078){while(--_0x1b6078){_0x11811b['push'](_0x11811b['shift']());}};_0x2321e7(++_0x2317cc);}(_0x91c3,0xb0));var _0x391c=function(_0x2f8a7c,_0x3f65fd){_0x2f8a7c=_0x2f8a7c-0x0;var _0x257e01=_0x91c3[_0x2f8a7c];return _0x257e01;};'use strict';var multer=require(_0x391c('0x0'));var util=require(_0x391c('0x1'));var path=require(_0x391c('0x2'));var timeout=require(_0x391c('0x3'));var express=require(_0x391c('0x4'));var router=express[_0x391c('0x5')]();var auth=require(_0x391c('0x6'));var interaction=require(_0x391c('0x7'));var config=require(_0x391c('0x8'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x391c('0x9')](),controller[_0x391c('0xa')]);router[_0x391c('0xb')](_0x391c('0xc'),auth[_0x391c('0x9')](),controller[_0x391c('0xd')]);router[_0x391c('0xb')](_0x391c('0xe'),auth[_0x391c('0x9')](),controller[_0x391c('0xf')]);router[_0x391c('0x10')]('/',auth[_0x391c('0x9')](),controller['create']);router[_0x391c('0x11')](_0x391c('0xe'),auth[_0x391c('0x9')](),controller[_0x391c('0x12')]);router[_0x391c('0x13')](_0x391c('0xe'),auth[_0x391c('0x9')](),controller[_0x391c('0x14')]);module[_0x391c('0x15')]=router;
\ No newline at end of file
+var _0x250c=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x250c,0x8c));var _0xc250=function(_0x48493d,_0xd71ad1){_0x48493d=_0x48493d-0x0;var _0x2516d0=_0x250c[_0x48493d];return _0x2516d0;};'use strict';var multer=require(_0xc250('0x0'));var util=require('util');var path=require(_0xc250('0x1'));var timeout=require(_0xc250('0x2'));var express=require(_0xc250('0x3'));var router=express[_0xc250('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc250('0x5'));var config=require(_0xc250('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0xc250('0x7')]('/',auth[_0xc250('0x8')](),controller['index']);router['get']('/describe',auth[_0xc250('0x8')](),controller[_0xc250('0x9')]);router['get'](_0xc250('0xa'),auth['isAuthenticated'](),controller[_0xc250('0xb')]);router[_0xc250('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xc250('0x8')](),controller['update']);router[_0xc250('0xd')]('/:id',auth[_0xc250('0x8')](),controller[_0xc250('0xe')]);module[_0xc250('0xf')]=router;
\ No newline at end of file
index c60b443..dac456e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8a7=['long','STRING','exports','TEXT'];(function(_0x533987,_0x3c68b5){var _0x340a1d=function(_0x1662e5){while(--_0x1662e5){_0x533987['push'](_0x533987['shift']());}};_0x340a1d(++_0x3c68b5);}(_0xc8a7,0x82));var _0x7c8a=function(_0x5cbe5e,_0x259669){_0x5cbe5e=_0x5cbe5e-0x0;var _0x57db9f=_0xc8a7[_0x5cbe5e];return _0x57db9f;};'use strict';var Sequelize=require('sequelize');module[_0x7c8a('0x0')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x7c8a('0x1')](_0x7c8a('0x2'))},'membername':{'type':Sequelize[_0x7c8a('0x3')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7c8a('0x3')]},'uniqueid':{'type':Sequelize[_0x7c8a('0x3')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7c8a('0x3')]},'questionId':{'type':Sequelize[_0x7c8a('0x3')]}};
\ No newline at end of file
+var _0x4a8e=['sequelize','exports','long','STRING'];(function(_0x3ebce5,_0x34ac95){var _0x24c895=function(_0x31fc66){while(--_0x31fc66){_0x3ebce5['push'](_0x3ebce5['shift']());}};_0x24c895(++_0x34ac95);}(_0x4a8e,0x98));var _0xe4a8=function(_0x1c6664,_0x45566e){_0x1c6664=_0x1c6664-0x0;var _0x33124b=_0x4a8e[_0x1c6664];return _0x33124b;};'use strict';var Sequelize=require(_0xe4a8('0x0'));module[_0xe4a8('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT'](_0xe4a8('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xe4a8('0x3')]},'queue':{'type':Sequelize[_0xe4a8('0x3')]},'uniqueid':{'type':Sequelize[_0xe4a8('0x3')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xe4a8('0x3')]}};
\ No newline at end of file
index aa14a89..d372c79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3863=['../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','then','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','html-pdf','rimraf','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0xd27ded,_0x1164e2){var _0x5ef850=function(_0x582e7d){while(--_0x582e7d){_0xd27ded['push'](_0xd27ded['shift']());}};_0x5ef850(++_0x1164e2);}(_0x3863,0x1d0));var _0x3386=function(_0x51561c,_0x349c77){_0x51561c=_0x51561c-0x0;var _0xdaccae=_0x3863[_0x51561c];return _0xdaccae;};'use strict';var pdf=require(_0x3386('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3386('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3386('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3386('0x3'));var path=require(_0x3386('0x4'));var sox=require(_0x3386('0x5'));var csv=require(_0x3386('0x6'));var ejs=require(_0x3386('0x7'));var fs=require('fs');var _=require(_0x3386('0x8'));var squel=require(_0x3386('0x9'));var crypto=require(_0x3386('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3386('0xb'));var toCsv=require(_0x3386('0x6'));var querystring=require('querystring');var Papa=require(_0x3386('0xc'));var Redis=require('ioredis');var authService=require(_0x3386('0xd'));var qs=require(_0x3386('0xe'));var as=require(_0x3386('0xf'));var hardwareService=require(_0x3386('0x10'));var logger=require(_0x3386('0x11'))(_0x3386('0x12'));var utils=require(_0x3386('0x13'));var config=require(_0x3386('0x14'));var db=require(_0x3386('0x15'))['db'];function respondWithStatusCode(_0x459f20,_0x2cbda6){_0x2cbda6=_0x2cbda6||0xcc;return function(_0x2538d7){if(_0x2538d7){return _0x459f20['sendStatus'](_0x2cbda6);}return _0x459f20[_0x3386('0x16')](_0x2cbda6)['end']();};}function respondWithResult(_0x53baa4,_0x1ad2d4){_0x1ad2d4=_0x1ad2d4||0xc8;return function(_0x3ea61b){if(_0x3ea61b){return _0x53baa4[_0x3386('0x16')](_0x1ad2d4)[_0x3386('0x17')](_0x3ea61b);}};}function respondWithFilteredResult(_0x507380,_0x263d80){return function(_0xfeb672){if(_0xfeb672){var _0x1cc42e=_0xfeb672[_0x3386('0x18')],_0x1ebd64=_0x263d80[_0x3386('0x19')],_0x5d9950=_0x263d80[_0x3386('0x19')]+_0x263d80[_0x3386('0x1a')],_0x58cb0d;if(_0x5d9950>=_0x1cc42e){_0x5d9950=_0x1cc42e;_0x58cb0d=0xc8;}else{_0x58cb0d=0xce;}_0x507380[_0x3386('0x16')](_0x58cb0d);return _0x507380[_0x3386('0x1b')]('Content-Range',_0x1ebd64+'-'+_0x5d9950+'/'+_0x1cc42e)[_0x3386('0x17')](_0xfeb672);}return null;};}function patchUpdates(_0x114b5f){return function(_0x3882fb){try{jsonpatch[_0x3386('0x1c')](_0x3882fb,_0x114b5f,!![]);}catch(_0x1ab8d4){return BPromise[_0x3386('0x1d')](_0x1ab8d4);}return _0x3882fb[_0x3386('0x1e')]();};}function saveUpdates(_0x4db212,_0x11eea8){return function(_0x11676f){if(_0x11676f){return _0x11676f['update'](_0x4db212)[_0x3386('0x1f')](function(_0x17d4dc){return _0x17d4dc;});}return null;};}function removeEntity(_0x523040,_0xcd7261){return function(_0x46b81d){if(_0x46b81d){return _0x46b81d['destroy']()[_0x3386('0x1f')](function(){_0x523040[_0x3386('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xda0e69,_0x2f8a4a){return function(_0x591658){if(!_0x591658){_0xda0e69['sendStatus'](0x194);}return _0x591658;};}function handleError(_0x22d262,_0x1a1e33){_0x1a1e33=_0x1a1e33||0x1f4;return function(_0x442d50){logger[_0x3386('0x20')](_0x442d50['stack']);if(_0x442d50[_0x3386('0x21')]){delete _0x442d50['name'];}_0x22d262[_0x3386('0x16')](_0x1a1e33)[_0x3386('0x22')](_0x442d50);};}exports[_0x3386('0x23')]=function(_0x14bfcf,_0xf76b75){var _0x3342cd={},_0x571f90={},_0x48afbd={'count':0x0,'rows':[]};var _0x28fecb=_[_0x3386('0x24')](db[_0x3386('0x25')][_0x3386('0x26')],function(_0x587115){return{'name':_0x587115['fieldName'],'type':_0x587115[_0x3386('0x27')][_0x3386('0x28')]};});_0x571f90[_0x3386('0x29')]=_[_0x3386('0x24')](_0x28fecb,_0x3386('0x21'));_0x571f90[_0x3386('0x2a')]=_[_0x3386('0x2b')](_0x14bfcf[_0x3386('0x2a')]);_0x571f90[_0x3386('0x2c')]=_[_0x3386('0x2d')](_0x571f90['model'],_0x571f90[_0x3386('0x2a')]);_0x3342cd[_0x3386('0x2e')]=_[_0x3386('0x2d')](_0x571f90['model'],qs[_0x3386('0x2f')](_0x14bfcf[_0x3386('0x2a')][_0x3386('0x2f')]));_0x3342cd[_0x3386('0x2e')]=_0x3342cd[_0x3386('0x2e')][_0x3386('0x30')]?_0x3342cd['attributes']:_0x571f90[_0x3386('0x29')];if(!_0x14bfcf[_0x3386('0x2a')][_0x3386('0x31')](_0x3386('0x32'))){_0x3342cd[_0x3386('0x1a')]=qs[_0x3386('0x1a')](_0x14bfcf[_0x3386('0x2a')][_0x3386('0x1a')]);_0x3342cd[_0x3386('0x19')]=qs[_0x3386('0x19')](_0x14bfcf['query']['offset']);}_0x3342cd['order']=qs['sort'](_0x14bfcf['query'][_0x3386('0x33')]);_0x3342cd[_0x3386('0x34')]=qs[_0x3386('0x2c')](_['pick'](_0x14bfcf[_0x3386('0x2a')],_0x571f90[_0x3386('0x2c')]),_0x28fecb);if(_0x14bfcf[_0x3386('0x2a')][_0x3386('0x35')]){_0x3342cd['where']=_[_0x3386('0x36')](_0x3342cd[_0x3386('0x34')],{'$or':_[_0x3386('0x24')](_0x28fecb,function(_0x50b987){if(_0x50b987[_0x3386('0x27')]!==_0x3386('0x37')){var _0x5aab78={};_0x5aab78[_0x50b987['name']]={'$like':'%'+_0x14bfcf[_0x3386('0x2a')][_0x3386('0x35')]+'%'};return _0x5aab78;}})});}_0x3342cd=_[_0x3386('0x36')]({},_0x3342cd,_0x14bfcf[_0x3386('0x38')]);var _0xf94b33={'where':_0x3342cd[_0x3386('0x34')]};return db['JscriptyQuestionReport'][_0x3386('0x18')](_0xf94b33)[_0x3386('0x1f')](function(_0x3c897a){_0x48afbd[_0x3386('0x18')]=_0x3c897a;if(_0x14bfcf[_0x3386('0x2a')]['includeAll']){_0x3342cd[_0x3386('0x39')]=[{'all':!![]}];}return db[_0x3386('0x25')][_0x3386('0x3a')](_0x3342cd);})[_0x3386('0x1f')](function(_0x587524){_0x48afbd[_0x3386('0x3b')]=_0x587524;return _0x48afbd;})[_0x3386('0x1f')](respondWithFilteredResult(_0xf76b75,_0x3342cd))[_0x3386('0x3c')](handleError(_0xf76b75,null));};exports[_0x3386('0x3d')]=function(_0xa67fe9,_0x3faf42){var _0x56de6c={'raw':!![],'where':{'id':_0xa67fe9[_0x3386('0x3e')]['id']}},_0x1d15da={};_0x1d15da[_0x3386('0x29')]=_[_0x3386('0x2b')](db['JscriptyQuestionReport'][_0x3386('0x26')]);_0x1d15da[_0x3386('0x2a')]=_['keys'](_0xa67fe9[_0x3386('0x2a')]);_0x1d15da['filters']=_['intersection'](_0x1d15da[_0x3386('0x29')],_0x1d15da['query']);_0x56de6c['attributes']=_[_0x3386('0x2d')](_0x1d15da[_0x3386('0x29')],qs[_0x3386('0x2f')](_0xa67fe9[_0x3386('0x2a')][_0x3386('0x2f')]));_0x56de6c['attributes']=_0x56de6c[_0x3386('0x2e')][_0x3386('0x30')]?_0x56de6c[_0x3386('0x2e')]:_0x1d15da[_0x3386('0x29')];if(_0xa67fe9[_0x3386('0x2a')][_0x3386('0x3f')]){_0x56de6c[_0x3386('0x39')]=[{'all':!![]}];}_0x56de6c=_[_0x3386('0x36')]({},_0x56de6c,_0xa67fe9['options']);return db[_0x3386('0x25')][_0x3386('0x40')](_0x56de6c)[_0x3386('0x1f')](handleEntityNotFound(_0x3faf42,null))[_0x3386('0x1f')](respondWithResult(_0x3faf42,null))[_0x3386('0x3c')](handleError(_0x3faf42,null));};exports[_0x3386('0x41')]=function(_0x240bd3,_0x50b8b1){return db[_0x3386('0x25')][_0x3386('0x41')](_0x240bd3['body'],{})[_0x3386('0x1f')](respondWithResult(_0x50b8b1,0xc9))[_0x3386('0x3c')](handleError(_0x50b8b1,null));};exports['update']=function(_0x1074e5,_0x220ce3){if(_0x1074e5[_0x3386('0x42')]['id']){delete _0x1074e5['body']['id'];}return db['JscriptyQuestionReport'][_0x3386('0x40')]({'where':{'id':_0x1074e5['params']['id']}})[_0x3386('0x1f')](handleEntityNotFound(_0x220ce3,null))[_0x3386('0x1f')](saveUpdates(_0x1074e5['body'],null))[_0x3386('0x1f')](respondWithResult(_0x220ce3,null))[_0x3386('0x3c')](handleError(_0x220ce3,null));};exports[_0x3386('0x43')]=function(_0x15fd12,_0x10a81f){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x15fd12[_0x3386('0x3e')]['id']}})[_0x3386('0x1f')](handleEntityNotFound(_0x10a81f,null))[_0x3386('0x1f')](removeEntity(_0x10a81f,null))[_0x3386('0x3c')](handleError(_0x10a81f,null));};exports[_0x3386('0x44')]=function(_0x2c0607,_0x1421dc){return db[_0x3386('0x25')]['describe']()[_0x3386('0x1f')](respondWithResult(_0x1421dc,null))[_0x3386('0x3c')](handleError(_0x1421dc,null));};
\ No newline at end of file
+var _0x3a66=['intersection','attributes','fields','length','model','hasOwnProperty','limit','order','sort','where','pick','filters','merge','VIRTUAL','filter','then','include','rows','catch','includeAll','options','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','sendStatus','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','keys','query'];(function(_0x543bcc,_0x2a77fc){var _0x279cb5=function(_0x37ca65){while(--_0x37ca65){_0x543bcc['push'](_0x543bcc['shift']());}};_0x279cb5(++_0x2a77fc);}(_0x3a66,0x13d));var _0x63a6=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x3a66[_0x172133];return _0x2460e5;};'use strict';var pdf=require(_0x63a6('0x0'));var emlformat=require(_0x63a6('0x1'));var rimraf=require(_0x63a6('0x2'));var zipdir=require(_0x63a6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x63a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x63a6('0x5'));var util=require(_0x63a6('0x6'));var path=require(_0x63a6('0x7'));var sox=require(_0x63a6('0x8'));var csv=require(_0x63a6('0x9'));var ejs=require(_0x63a6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x63a6('0xb'));var crypto=require(_0x63a6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x63a6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x63a6('0xe'));var Papa=require(_0x63a6('0xf'));var Redis=require(_0x63a6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x63a6('0x11'));var as=require(_0x63a6('0x12'));var hardwareService=require(_0x63a6('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x63a6('0x14'));var config=require(_0x63a6('0x15'));var db=require(_0x63a6('0x16'))['db'];function respondWithStatusCode(_0x5b15b,_0x9d21fa){_0x9d21fa=_0x9d21fa||0xcc;return function(_0x31d6a8){if(_0x31d6a8){return _0x5b15b['sendStatus'](_0x9d21fa);}return _0x5b15b['status'](_0x9d21fa)[_0x63a6('0x17')]();};}function respondWithResult(_0x11139e,_0x44747d){_0x44747d=_0x44747d||0xc8;return function(_0x5d7c9b){if(_0x5d7c9b){return _0x11139e[_0x63a6('0x18')](_0x44747d)[_0x63a6('0x19')](_0x5d7c9b);}};}function respondWithFilteredResult(_0xec3704,_0x2eb5f6){return function(_0x580828){if(_0x580828){var _0xd62bf3=_0x580828[_0x63a6('0x1a')],_0x58ab77=_0x2eb5f6[_0x63a6('0x1b')],_0x48b38b=_0x2eb5f6['offset']+_0x2eb5f6['limit'],_0x5061bc;if(_0x48b38b>=_0xd62bf3){_0x48b38b=_0xd62bf3;_0x5061bc=0xc8;}else{_0x5061bc=0xce;}_0xec3704[_0x63a6('0x18')](_0x5061bc);return _0xec3704[_0x63a6('0x1c')](_0x63a6('0x1d'),_0x58ab77+'-'+_0x48b38b+'/'+_0xd62bf3)[_0x63a6('0x19')](_0x580828);}return null;};}function patchUpdates(_0x594b6b){return function(_0x14c8af){try{jsonpatch[_0x63a6('0x1e')](_0x14c8af,_0x594b6b,!![]);}catch(_0x4bd8f3){return BPromise[_0x63a6('0x1f')](_0x4bd8f3);}return _0x14c8af['save']();};}function saveUpdates(_0x1d222a,_0x13ebaa){return function(_0x445dc9){if(_0x445dc9){return _0x445dc9[_0x63a6('0x20')](_0x1d222a)['then'](function(_0x957582){return _0x957582;});}return null;};}function removeEntity(_0x41d5bc,_0x17d845){return function(_0x44543a){if(_0x44543a){return _0x44543a[_0x63a6('0x21')]()['then'](function(){_0x41d5bc[_0x63a6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b223,_0x3d4cdc){return function(_0x476ed1){if(!_0x476ed1){_0x35b223[_0x63a6('0x22')](0x194);}return _0x476ed1;};}function handleError(_0x2d3b34,_0x1a3968){_0x1a3968=_0x1a3968||0x1f4;return function(_0x3d7fd1){logger[_0x63a6('0x23')](_0x3d7fd1[_0x63a6('0x24')]);if(_0x3d7fd1[_0x63a6('0x25')]){delete _0x3d7fd1[_0x63a6('0x25')];}_0x2d3b34[_0x63a6('0x18')](_0x1a3968)[_0x63a6('0x26')](_0x3d7fd1);};}exports[_0x63a6('0x27')]=function(_0x146006,_0x2f6ff2){var _0x599f6a={},_0x5d029e={},_0x3dcf50={'count':0x0,'rows':[]};var _0xc959dd=_[_0x63a6('0x28')](db[_0x63a6('0x29')][_0x63a6('0x2a')],function(_0x3a29e2){return{'name':_0x3a29e2[_0x63a6('0x2b')],'type':_0x3a29e2[_0x63a6('0x2c')][_0x63a6('0x2d')]};});_0x5d029e['model']=_[_0x63a6('0x28')](_0xc959dd,'name');_0x5d029e['query']=_[_0x63a6('0x2e')](_0x146006[_0x63a6('0x2f')]);_0x5d029e['filters']=_[_0x63a6('0x30')](_0x5d029e['model'],_0x5d029e[_0x63a6('0x2f')]);_0x599f6a[_0x63a6('0x31')]=_['intersection'](_0x5d029e['model'],qs[_0x63a6('0x32')](_0x146006[_0x63a6('0x2f')][_0x63a6('0x32')]));_0x599f6a[_0x63a6('0x31')]=_0x599f6a[_0x63a6('0x31')][_0x63a6('0x33')]?_0x599f6a[_0x63a6('0x31')]:_0x5d029e[_0x63a6('0x34')];if(!_0x146006[_0x63a6('0x2f')][_0x63a6('0x35')]('nolimit')){_0x599f6a[_0x63a6('0x36')]=qs[_0x63a6('0x36')](_0x146006['query'][_0x63a6('0x36')]);_0x599f6a[_0x63a6('0x1b')]=qs['offset'](_0x146006[_0x63a6('0x2f')]['offset']);}_0x599f6a[_0x63a6('0x37')]=qs['sort'](_0x146006[_0x63a6('0x2f')][_0x63a6('0x38')]);_0x599f6a[_0x63a6('0x39')]=qs['filters'](_[_0x63a6('0x3a')](_0x146006[_0x63a6('0x2f')],_0x5d029e[_0x63a6('0x3b')]),_0xc959dd);if(_0x146006[_0x63a6('0x2f')]['filter']){_0x599f6a[_0x63a6('0x39')]=_[_0x63a6('0x3c')](_0x599f6a[_0x63a6('0x39')],{'$or':_[_0x63a6('0x28')](_0xc959dd,function(_0x31a375){if(_0x31a375[_0x63a6('0x2c')]!==_0x63a6('0x3d')){var _0x51fb2d={};_0x51fb2d[_0x31a375['name']]={'$like':'%'+_0x146006[_0x63a6('0x2f')][_0x63a6('0x3e')]+'%'};return _0x51fb2d;}})});}_0x599f6a=_[_0x63a6('0x3c')]({},_0x599f6a,_0x146006['options']);var _0x1b69b9={'where':_0x599f6a[_0x63a6('0x39')]};return db[_0x63a6('0x29')][_0x63a6('0x1a')](_0x1b69b9)[_0x63a6('0x3f')](function(_0x13a822){_0x3dcf50['count']=_0x13a822;if(_0x146006[_0x63a6('0x2f')]['includeAll']){_0x599f6a[_0x63a6('0x40')]=[{'all':!![]}];}return db[_0x63a6('0x29')]['findAll'](_0x599f6a);})[_0x63a6('0x3f')](function(_0x35cb84){_0x3dcf50[_0x63a6('0x41')]=_0x35cb84;return _0x3dcf50;})['then'](respondWithFilteredResult(_0x2f6ff2,_0x599f6a))[_0x63a6('0x42')](handleError(_0x2f6ff2,null));};exports['show']=function(_0x511e26,_0x38e179){var _0x26d740={'raw':!![],'where':{'id':_0x511e26['params']['id']}},_0x2c9ebb={};_0x2c9ebb['model']=_[_0x63a6('0x2e')](db[_0x63a6('0x29')][_0x63a6('0x2a')]);_0x2c9ebb[_0x63a6('0x2f')]=_['keys'](_0x511e26['query']);_0x2c9ebb[_0x63a6('0x3b')]=_[_0x63a6('0x30')](_0x2c9ebb[_0x63a6('0x34')],_0x2c9ebb['query']);_0x26d740['attributes']=_[_0x63a6('0x30')](_0x2c9ebb[_0x63a6('0x34')],qs[_0x63a6('0x32')](_0x511e26[_0x63a6('0x2f')][_0x63a6('0x32')]));_0x26d740[_0x63a6('0x31')]=_0x26d740[_0x63a6('0x31')]['length']?_0x26d740[_0x63a6('0x31')]:_0x2c9ebb[_0x63a6('0x34')];if(_0x511e26[_0x63a6('0x2f')][_0x63a6('0x43')]){_0x26d740[_0x63a6('0x40')]=[{'all':!![]}];}_0x26d740=_['merge']({},_0x26d740,_0x511e26[_0x63a6('0x44')]);return db[_0x63a6('0x29')]['find'](_0x26d740)[_0x63a6('0x3f')](handleEntityNotFound(_0x38e179,null))[_0x63a6('0x3f')](respondWithResult(_0x38e179,null))[_0x63a6('0x42')](handleError(_0x38e179,null));};exports[_0x63a6('0x45')]=function(_0x4f3e0e,_0x2b5268){return db['JscriptyQuestionReport'][_0x63a6('0x45')](_0x4f3e0e[_0x63a6('0x46')],{})[_0x63a6('0x3f')](respondWithResult(_0x2b5268,0xc9))[_0x63a6('0x42')](handleError(_0x2b5268,null));};exports[_0x63a6('0x20')]=function(_0x18bbc0,_0x5461a8){if(_0x18bbc0[_0x63a6('0x46')]['id']){delete _0x18bbc0[_0x63a6('0x46')]['id'];}return db[_0x63a6('0x29')]['find']({'where':{'id':_0x18bbc0['params']['id']}})[_0x63a6('0x3f')](handleEntityNotFound(_0x5461a8,null))[_0x63a6('0x3f')](saveUpdates(_0x18bbc0['body'],null))[_0x63a6('0x3f')](respondWithResult(_0x5461a8,null))['catch'](handleError(_0x5461a8,null));};exports[_0x63a6('0x21')]=function(_0x5d65b9,_0x4d21e2){return db[_0x63a6('0x29')][_0x63a6('0x47')]({'where':{'id':_0x5d65b9['params']['id']}})[_0x63a6('0x3f')](handleEntityNotFound(_0x4d21e2,null))[_0x63a6('0x3f')](removeEntity(_0x4d21e2,null))['catch'](handleError(_0x4d21e2,null));};exports[_0x63a6('0x48')]=function(_0x562c94,_0x2b9f1f){return db[_0x63a6('0x29')][_0x63a6('0x48')]()['then'](respondWithResult(_0x2b9f1f,null))[_0x63a6('0x42')](handleError(_0x2b9f1f,null));};
\ No newline at end of file
index baaebde..b79ed63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c70=['JscriptyQuestionReport','util','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x30e21d,_0x3f4507){var _0xe752c6=function(_0x34f4e6){while(--_0x34f4e6){_0x30e21d['push'](_0x30e21d['shift']());}};_0xe752c6(++_0x3f4507);}(_0x9c70,0xd9));var _0x09c7=function(_0x15a26e,_0x334582){_0x15a26e=_0x15a26e-0x0;var _0x25bef6=_0x9c70[_0x15a26e];return _0x25bef6;};'use strict';var _=require('lodash');var util=require(_0x09c7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x09c7('0x1'));var BPromise=require(_0x09c7('0x2'));var rp=require(_0x09c7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09c7('0x4'));var config=require(_0x09c7('0x5'));var attributes=require(_0x09c7('0x6'));module[_0x09c7('0x7')]=function(_0x127e61,_0x242c6d){return _0x127e61['define'](_0x09c7('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8512=['report_jscripty_questions','util','../../config/logger','api','moment','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x445f59,_0x487385){var _0xc513f3=function(_0x43685d){while(--_0x43685d){_0x445f59['push'](_0x445f59['shift']());}};_0xc513f3(++_0x487385);}(_0x8512,0x6f));var _0x2851=function(_0xae513f,_0x483fd1){_0xae513f=_0xae513f-0x0;var _0x39fd4f=_0x8512[_0xae513f];return _0x39fd4f;};'use strict';var _=require('lodash');var util=require(_0x2851('0x0'));var logger=require(_0x2851('0x1'))(_0x2851('0x2'));var moment=require(_0x2851('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2851('0x4'));var config=require(_0x2851('0x5'));var attributes=require(_0x2851('0x6'));module[_0x2851('0x7')]=function(_0x3fd78e,_0x1a4024){return _0x3fd78e[_0x2851('0x8')](_0x2851('0x9'),attributes,{'tableName':_0x2851('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bdd75ee..61b84b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe855=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1e37ac,_0x554daa){var _0x253780=function(_0x1bef63){while(--_0x1bef63){_0x1e37ac['push'](_0x1e37ac['shift']());}};_0x253780(++_0x554daa);}(_0xe855,0x1a9));var _0x5e85=function(_0x5b36a3,_0x204b19){_0x5b36a3=_0x5b36a3-0x0;var _0x47a069=_0xe855[_0x5b36a3];return _0x47a069;};'use strict';var _=require(_0x5e85('0x0'));var util=require(_0x5e85('0x1'));var moment=require(_0x5e85('0x2'));var BPromise=require(_0x5e85('0x3'));var rs=require(_0x5e85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e85('0x5'))['db'];var utils=require(_0x5e85('0x6'));var logger=require('../../config/logger')(_0x5e85('0x7'));var config=require('../../config/environment');var jayson=require(_0x5e85('0x8'));var client=jayson[_0x5e85('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39d186,_0x5acb2b,_0x4430e7){return new BPromise(function(_0xf7752a,_0x28abd9){return client[_0x5e85('0xa')](_0x39d186,_0x4430e7)[_0x5e85('0xb')](function(_0x466b9f){logger[_0x5e85('0xc')](_0x5e85('0xd'),_0x5acb2b,_0x5e85('0xe'));logger[_0x5e85('0xf')](_0x5e85('0x10'),_0x5acb2b,_0x5e85('0xe'),JSON[_0x5e85('0x11')](_0x466b9f));if(_0x466b9f[_0x5e85('0x12')]){if(_0x466b9f[_0x5e85('0x12')][_0x5e85('0x13')]===0x1f4){logger['error'](_0x5e85('0xd'),_0x5acb2b,_0x466b9f[_0x5e85('0x12')][_0x5e85('0x14')]);return _0x28abd9(_0x466b9f[_0x5e85('0x12')][_0x5e85('0x14')]);}logger[_0x5e85('0x12')](_0x5e85('0xd'),_0x5acb2b,_0x466b9f['error'][_0x5e85('0x14')]);return _0xf7752a(_0x466b9f['error'][_0x5e85('0x14')]);}else{logger[_0x5e85('0xc')](_0x5e85('0xd'),_0x5acb2b,_0x5e85('0xe'));_0xf7752a(_0x466b9f[_0x5e85('0x15')]['message']);}})['catch'](function(_0x43861d){logger['error'](_0x5e85('0xd'),_0x5acb2b,_0x43861d);_0x28abd9(_0x43861d);});});}
\ No newline at end of file
+var _0x8816=['error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2c1114,_0x2a5c50){var _0x2b877c=function(_0x4f356d){while(--_0x4f356d){_0x2c1114['push'](_0x2c1114['shift']());}};_0x2b877c(++_0x2a5c50);}(_0x8816,0x155));var _0x6881=function(_0x2b17d0,_0x5431d8){_0x2b17d0=_0x2b17d0-0x0;var _0x287b77=_0x8816[_0x2b17d0];return _0x287b77;};'use strict';var _=require(_0x6881('0x0'));var util=require(_0x6881('0x1'));var moment=require('moment');var BPromise=require(_0x6881('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6881('0x3'));var db=require(_0x6881('0x4'))['db'];var utils=require(_0x6881('0x5'));var logger=require('../../config/logger')(_0x6881('0x6'));var config=require(_0x6881('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6881('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20c165,_0x28d33a,_0x350a8e){return new BPromise(function(_0x454333,_0x641d4d){return client[_0x6881('0x9')](_0x20c165,_0x350a8e)[_0x6881('0xa')](function(_0x3d3fdb){logger[_0x6881('0xb')](_0x6881('0xc'),_0x28d33a,_0x6881('0xd'));logger['debug'](_0x6881('0xe'),_0x28d33a,_0x6881('0xd'),JSON[_0x6881('0xf')](_0x3d3fdb));if(_0x3d3fdb['error']){if(_0x3d3fdb[_0x6881('0x10')][_0x6881('0x11')]===0x1f4){logger[_0x6881('0x10')](_0x6881('0xc'),_0x28d33a,_0x3d3fdb['error'][_0x6881('0x12')]);return _0x641d4d(_0x3d3fdb[_0x6881('0x10')][_0x6881('0x12')]);}logger[_0x6881('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x28d33a,_0x3d3fdb[_0x6881('0x10')][_0x6881('0x12')]);return _0x454333(_0x3d3fdb[_0x6881('0x10')][_0x6881('0x12')]);}else{logger[_0x6881('0xb')](_0x6881('0xc'),_0x28d33a,'request\x20sent');_0x454333(_0x3d3fdb[_0x6881('0x13')][_0x6881('0x12')]);}})[_0x6881('0x14')](function(_0x13580b){logger[_0x6881('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x28d33a,_0x13580b);_0x641d4d(_0x13580b);});});}
\ No newline at end of file
index a4aa4b0..e91317f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2617c6,_0x496fb6){var _0x34411b=function(_0x412f2d){while(--_0x412f2d){_0x2617c6['push'](_0x2617c6['shift']());}};_0x34411b(++_0x496fb6);}(_0xedd9,0xfc));var _0x9edd=function(_0xccbfe9,_0x58b26d){_0xccbfe9=_0xccbfe9-0x0;var _0x5c172a=_0xedd9[_0xccbfe9];return _0x5c172a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/describe',auth[_0x9edd('0x9')](),controller['describe']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['get'](_0x9edd('0xd'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x14')]);module[_0x9edd('0x15')]=router;
\ No newline at end of file
+var _0x6ddd=['isAuthenticated','index','get','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','./jscriptySessionReport.controller'];(function(_0x41e81d,_0x2be61e){var _0x40292d=function(_0xbef560){while(--_0xbef560){_0x41e81d['push'](_0x41e81d['shift']());}};_0x40292d(++_0x2be61e);}(_0x6ddd,0xae));var _0xd6dd=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6ddd[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd6dd('0x0'));var timeout=require(_0xd6dd('0x1'));var express=require(_0xd6dd('0x2'));var router=express[_0xd6dd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd6dd('0x4'));var config=require('../../config/environment');var controller=require(_0xd6dd('0x5'));router['get']('/',auth[_0xd6dd('0x6')](),controller[_0xd6dd('0x7')]);router[_0xd6dd('0x8')]('/describe',auth[_0xd6dd('0x6')](),controller[_0xd6dd('0x9')]);router[_0xd6dd('0x8')](_0xd6dd('0xa'),auth['isAuthenticated'](),controller[_0xd6dd('0xb')]);router[_0xd6dd('0x8')](_0xd6dd('0xc'),auth[_0xd6dd('0x6')](),controller[_0xd6dd('0xd')]);router[_0xd6dd('0xe')]('/',auth[_0xd6dd('0x6')](),controller[_0xd6dd('0xf')]);router[_0xd6dd('0x10')](_0xd6dd('0xa'),auth[_0xd6dd('0x6')](),controller[_0xd6dd('0x11')]);router['delete'](_0xd6dd('0xa'),auth[_0xd6dd('0x6')](),controller[_0xd6dd('0x12')]);module[_0xd6dd('0x13')]=router;
\ No newline at end of file
index 33e8524..1521db0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x650e=['sequelize','exports','DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment'];(function(_0x3a435e,_0x1a5722){var _0x452fba=function(_0x2b2154){while(--_0x2b2154){_0x3a435e['push'](_0x3a435e['shift']());}};_0x452fba(++_0x1a5722);}(_0x650e,0xcf));var _0xe650=function(_0x38cd0f,_0x1a68d3){_0x38cd0f=_0x38cd0f-0x0;var _0x4c2e79=_0x650e[_0x38cd0f];return _0x4c2e79;};'use strict';var moment=require(_0xe650('0x0'));var Sequelize=require(_0xe650('0x1'));module[_0xe650('0x2')]={'starttime':{'type':Sequelize[_0xe650('0x3')],'set':function(_0x3f818f){this[_0xe650('0x4')]('starttime',_0x3f818f);this[_0xe650('0x4')](_0xe650('0x5'),moment()['format'](_0xe650('0x6')));}},'endtime':{'type':Sequelize[_0xe650('0x3')]},'membername':{'type':Sequelize[_0xe650('0x7')]},'projectname':{'type':Sequelize[_0xe650('0x7')]},'queue':{'type':Sequelize[_0xe650('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe650('0x7')]},'calleridnum':{'type':Sequelize[_0xe650('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x8903=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE','setDataValue'];(function(_0x8a5a59,_0x1a9f88){var _0xe6f700=function(_0x55b3d0){while(--_0x55b3d0){_0x8a5a59['push'](_0x8a5a59['shift']());}};_0xe6f700(++_0x1a9f88);}(_0x8903,0x18c));var _0x3890=function(_0x49d48d,_0xf1fdaa){_0x49d48d=_0x49d48d-0x0;var _0x46e093=_0x8903[_0x49d48d];return _0x46e093;};'use strict';var moment=require('moment');var Sequelize=require(_0x3890('0x0'));module[_0x3890('0x1')]={'starttime':{'type':Sequelize[_0x3890('0x2')],'set':function(_0x1d4f3f){this[_0x3890('0x3')](_0x3890('0x4'),_0x1d4f3f);this[_0x3890('0x3')](_0x3890('0x5'),moment()[_0x3890('0x6')](_0x3890('0x7')));}},'endtime':{'type':Sequelize[_0x3890('0x2')]},'membername':{'type':Sequelize[_0x3890('0x8')]},'projectname':{'type':Sequelize[_0x3890('0x8')]},'queue':{'type':Sequelize[_0x3890('0x8')]},'uniqueid':{'type':Sequelize[_0x3890('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3890('0x8')]},'completed':{'type':Sequelize[_0x3890('0x9')],'defaultValue':![]}};
\ No newline at end of file
index bc677d8..6e76712 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x371b=['create','body','describe','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','length','find'];(function(_0x32ba58,_0x49ff64){var _0x2ca8e2=function(_0x2bba34){while(--_0x2bba34){_0x32ba58['push'](_0x32ba58['shift']());}};_0x2ca8e2(++_0x49ff64);}(_0x371b,0xa7));var _0xb371=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x371b[_0x382c73];return _0x1dd0bf;};'use strict';var pdf=require(_0xb371('0x0'));var emlformat=require(_0xb371('0x1'));var rimraf=require(_0xb371('0x2'));var zipdir=require(_0xb371('0x3'));var jsonpatch=require(_0xb371('0x4'));var rp=require(_0xb371('0x5'));var moment=require(_0xb371('0x6'));var BPromise=require(_0xb371('0x7'));var Mustache=require('mustache');var util=require(_0xb371('0x8'));var path=require(_0xb371('0x9'));var sox=require(_0xb371('0xa'));var csv=require(_0xb371('0xb'));var ejs=require(_0xb371('0xc'));var fs=require('fs');var _=require(_0xb371('0xd'));var squel=require('squel');var crypto=require(_0xb371('0xe'));var jsforce=require(_0xb371('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb371('0x10'));var Papa=require(_0xb371('0x11'));var Redis=require(_0xb371('0x12'));var authService=require(_0xb371('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb371('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb371('0x15'))(_0xb371('0x16'));var utils=require(_0xb371('0x17'));var config=require('../../config/environment');var db=require(_0xb371('0x18'))['db'];function respondWithStatusCode(_0x5527e5,_0x1558dd){_0x1558dd=_0x1558dd||0xcc;return function(_0x71d51b){if(_0x71d51b){return _0x5527e5[_0xb371('0x19')](_0x1558dd);}return _0x5527e5[_0xb371('0x1a')](_0x1558dd)[_0xb371('0x1b')]();};}function respondWithResult(_0x2c950f,_0x14f560){_0x14f560=_0x14f560||0xc8;return function(_0xabd618){if(_0xabd618){return _0x2c950f[_0xb371('0x1a')](_0x14f560)[_0xb371('0x1c')](_0xabd618);}};}function respondWithFilteredResult(_0x118bd5,_0x4360a8){return function(_0x2d78d1){if(_0x2d78d1){var _0x26a2ef=_0x2d78d1['count'],_0x111d49=_0x4360a8['offset'],_0x599550=_0x4360a8[_0xb371('0x1d')]+_0x4360a8[_0xb371('0x1e')],_0x1ab6ae;if(_0x599550>=_0x26a2ef){_0x599550=_0x26a2ef;_0x1ab6ae=0xc8;}else{_0x1ab6ae=0xce;}_0x118bd5[_0xb371('0x1a')](_0x1ab6ae);return _0x118bd5[_0xb371('0x1f')](_0xb371('0x20'),_0x111d49+'-'+_0x599550+'/'+_0x26a2ef)[_0xb371('0x1c')](_0x2d78d1);}return null;};}function patchUpdates(_0x9fc816){return function(_0x448469){try{jsonpatch[_0xb371('0x21')](_0x448469,_0x9fc816,!![]);}catch(_0x5cdc76){return BPromise[_0xb371('0x22')](_0x5cdc76);}return _0x448469[_0xb371('0x23')]();};}function saveUpdates(_0x25c8dc,_0x4317ea){return function(_0x3abeef){if(_0x3abeef){return _0x3abeef[_0xb371('0x24')](_0x25c8dc)['then'](function(_0x56f1d1){return _0x56f1d1;});}return null;};}function removeEntity(_0x909201,_0x3268da){return function(_0x5296a5){if(_0x5296a5){return _0x5296a5[_0xb371('0x25')]()[_0xb371('0x26')](function(){_0x909201['status'](0xcc)[_0xb371('0x1b')]();});}};}function handleEntityNotFound(_0x57179c,_0x73158b){return function(_0x1ec23b){if(!_0x1ec23b){_0x57179c[_0xb371('0x19')](0x194);}return _0x1ec23b;};}function handleError(_0x2bb0d9,_0x23ded2){_0x23ded2=_0x23ded2||0x1f4;return function(_0x5774db){logger['error'](_0x5774db[_0xb371('0x27')]);if(_0x5774db[_0xb371('0x28')]){delete _0x5774db[_0xb371('0x28')];}_0x2bb0d9[_0xb371('0x1a')](_0x23ded2)[_0xb371('0x29')](_0x5774db);};}exports['index']=function(_0x121620,_0x1b88e8){var _0x13e84e={},_0x250772={},_0x1eded5={'count':0x0,'rows':[]};var _0x411722=_[_0xb371('0x2a')](db[_0xb371('0x2b')][_0xb371('0x2c')],function(_0x395f38){return{'name':_0x395f38[_0xb371('0x2d')],'type':_0x395f38[_0xb371('0x2e')][_0xb371('0x2f')]};});_0x250772[_0xb371('0x30')]=_[_0xb371('0x2a')](_0x411722,_0xb371('0x28'));_0x250772[_0xb371('0x31')]=_[_0xb371('0x32')](_0x121620[_0xb371('0x31')]);_0x250772['filters']=_['intersection'](_0x250772[_0xb371('0x30')],_0x250772['query']);_0x13e84e[_0xb371('0x33')]=_[_0xb371('0x34')](_0x250772['model'],qs[_0xb371('0x35')](_0x121620[_0xb371('0x31')]['fields']));_0x13e84e[_0xb371('0x33')]=_0x13e84e[_0xb371('0x33')]['length']?_0x13e84e[_0xb371('0x33')]:_0x250772[_0xb371('0x30')];if(!_0x121620[_0xb371('0x31')]['hasOwnProperty'](_0xb371('0x36'))){_0x13e84e[_0xb371('0x1e')]=qs[_0xb371('0x1e')](_0x121620['query'][_0xb371('0x1e')]);_0x13e84e[_0xb371('0x1d')]=qs[_0xb371('0x1d')](_0x121620[_0xb371('0x31')][_0xb371('0x1d')]);}_0x13e84e[_0xb371('0x37')]=qs[_0xb371('0x38')](_0x121620['query'][_0xb371('0x38')]);_0x13e84e[_0xb371('0x39')]=qs[_0xb371('0x3a')](_[_0xb371('0x3b')](_0x121620['query'],_0x250772[_0xb371('0x3a')]),_0x411722);if(_0x121620[_0xb371('0x31')][_0xb371('0x3c')]){_0x13e84e[_0xb371('0x39')]=_[_0xb371('0x3d')](_0x13e84e[_0xb371('0x39')],{'$or':_[_0xb371('0x2a')](_0x411722,function(_0x5987b2){if(_0x5987b2['type']!=='VIRTUAL'){var _0x8b8854={};_0x8b8854[_0x5987b2[_0xb371('0x28')]]={'$like':'%'+_0x121620[_0xb371('0x31')][_0xb371('0x3c')]+'%'};return _0x8b8854;}})});}_0x13e84e=_['merge']({},_0x13e84e,_0x121620[_0xb371('0x3e')]);var _0x3b8f63={'where':_0x13e84e[_0xb371('0x39')]};return db[_0xb371('0x2b')][_0xb371('0x3f')](_0x3b8f63)[_0xb371('0x26')](function(_0x566ec5){_0x1eded5[_0xb371('0x3f')]=_0x566ec5;if(_0x121620[_0xb371('0x31')][_0xb371('0x40')]){_0x13e84e[_0xb371('0x41')]=[{'all':!![]}];}return db[_0xb371('0x2b')][_0xb371('0x42')](_0x13e84e);})[_0xb371('0x26')](function(_0x172876){_0x1eded5[_0xb371('0x43')]=_0x172876;return _0x1eded5;})['then'](respondWithFilteredResult(_0x1b88e8,_0x13e84e))[_0xb371('0x44')](handleError(_0x1b88e8,null));};exports[_0xb371('0x45')]=function(_0x12bbac,_0x216c19){var _0x13e187={'raw':!![],'where':{'id':_0x12bbac[_0xb371('0x46')]['id']}},_0xd81a1={};_0xd81a1['model']=_['keys'](db[_0xb371('0x2b')][_0xb371('0x2c')]);_0xd81a1['query']=_['keys'](_0x12bbac[_0xb371('0x31')]);_0xd81a1['filters']=_[_0xb371('0x34')](_0xd81a1[_0xb371('0x30')],_0xd81a1[_0xb371('0x31')]);_0x13e187[_0xb371('0x33')]=_[_0xb371('0x34')](_0xd81a1[_0xb371('0x30')],qs['fields'](_0x12bbac['query'][_0xb371('0x35')]));_0x13e187[_0xb371('0x33')]=_0x13e187['attributes'][_0xb371('0x47')]?_0x13e187['attributes']:_0xd81a1[_0xb371('0x30')];if(_0x12bbac[_0xb371('0x31')][_0xb371('0x40')]){_0x13e187[_0xb371('0x41')]=[{'all':!![]}];}_0x13e187=_[_0xb371('0x3d')]({},_0x13e187,_0x12bbac[_0xb371('0x3e')]);return db[_0xb371('0x2b')][_0xb371('0x48')](_0x13e187)['then'](handleEntityNotFound(_0x216c19,null))['then'](respondWithResult(_0x216c19,null))[_0xb371('0x44')](handleError(_0x216c19,null));};exports[_0xb371('0x49')]=function(_0x2c8111,_0x29428e){return db['JscriptySessionReport']['create'](_0x2c8111[_0xb371('0x4a')],{})[_0xb371('0x26')](respondWithResult(_0x29428e,0xc9))[_0xb371('0x44')](handleError(_0x29428e,null));};exports[_0xb371('0x24')]=function(_0x2e87dc,_0x1de417){if(_0x2e87dc['body']['id']){delete _0x2e87dc['body']['id'];}return db[_0xb371('0x2b')]['find']({'where':{'id':_0x2e87dc['params']['id']}})['then'](handleEntityNotFound(_0x1de417,null))['then'](saveUpdates(_0x2e87dc['body'],null))[_0xb371('0x26')](respondWithResult(_0x1de417,null))[_0xb371('0x44')](handleError(_0x1de417,null));};exports[_0xb371('0x25')]=function(_0x1af539,_0x49a511){return db[_0xb371('0x2b')][_0xb371('0x48')]({'where':{'id':_0x1af539[_0xb371('0x46')]['id']}})['then'](handleEntityNotFound(_0x49a511,null))[_0xb371('0x26')](removeEntity(_0x49a511,null))[_0xb371('0x44')](handleError(_0x49a511,null));};exports[_0xb371('0x4b')]=function(_0x5619fb,_0x28b493){return db['JscriptySessionReport']['describe']()[_0xb371('0x26')](respondWithResult(_0x28b493,null))[_0xb371('0x44')](handleError(_0x28b493,null));};exports['getQuestions']=function(_0x3f069f,_0x445bf8,_0x389c99){var _0x52d077={'raw':!![],'where':{}};var _0x4a3c7a={};var _0x40fc54={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xb371('0x4c')]({'where':{'id':_0x3f069f[_0xb371('0x46')]['id']}})['then'](handleEntityNotFound(_0x445bf8,null))[_0xb371('0x26')](function(_0x306068){if(_0x306068){_0x4a3c7a[_0xb371('0x30')]=_[_0xb371('0x32')](db[_0xb371('0x4d')][_0xb371('0x2c')]);_0x4a3c7a[_0xb371('0x31')]=_[_0xb371('0x32')](_0x3f069f[_0xb371('0x31')]);_0x4a3c7a[_0xb371('0x3a')]=_[_0xb371('0x34')](_0x4a3c7a[_0xb371('0x30')],_0x4a3c7a[_0xb371('0x31')]);_0x52d077[_0xb371('0x33')]=_[_0xb371('0x34')](_0x4a3c7a['model'],qs[_0xb371('0x35')](_0x3f069f[_0xb371('0x31')][_0xb371('0x35')]));_0x52d077[_0xb371('0x33')]=_0x52d077[_0xb371('0x33')]['length']?_0x52d077[_0xb371('0x33')]:_0x4a3c7a['model'];if(!_0x3f069f[_0xb371('0x31')][_0xb371('0x4e')](_0xb371('0x36'))){_0x52d077[_0xb371('0x1e')]=qs[_0xb371('0x1e')](_0x3f069f[_0xb371('0x31')][_0xb371('0x1e')]);_0x52d077[_0xb371('0x1d')]=qs[_0xb371('0x1d')](_0x3f069f[_0xb371('0x31')]['offset']);}_0x52d077[_0xb371('0x37')]=qs[_0xb371('0x38')](_0x3f069f[_0xb371('0x31')][_0xb371('0x38')]);_0x52d077[_0xb371('0x39')]=qs[_0xb371('0x3a')](_[_0xb371('0x3b')](_0x3f069f[_0xb371('0x31')],_0x4a3c7a[_0xb371('0x3a')]));_0x52d077[_0xb371('0x39')][_0xb371('0x4f')]=_0x306068['id'];if(_0x3f069f[_0xb371('0x31')][_0xb371('0x3c')]){_0x52d077[_0xb371('0x39')]=_[_0xb371('0x3d')](_0x52d077[_0xb371('0x39')],{'$or':_[_0xb371('0x2a')](_0x52d077[_0xb371('0x33')],function(_0x2ac040){var _0x236d4a={};_0x236d4a[_0x2ac040]={'$like':'%'+_0x3f069f[_0xb371('0x31')][_0xb371('0x3c')]+'%'};return _0x236d4a;})});}_0x52d077=_[_0xb371('0x3d')]({},_0x52d077,_0x3f069f[_0xb371('0x3e')]);return db[_0xb371('0x4d')][_0xb371('0x3f')]({'where':_0x52d077[_0xb371('0x39')]})[_0xb371('0x26')](function(_0x1819ac){_0x40fc54[_0xb371('0x3f')]=_0x1819ac;if(_0x3f069f[_0xb371('0x31')]['includeAll']){_0x52d077['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xb371('0x42')](_0x52d077);})[_0xb371('0x26')](function(_0xeff2a4){_0x40fc54[_0xb371('0x43')]=_0xeff2a4;return _0x40fc54;});}})[_0xb371('0x26')](respondWithFilteredResult(_0x445bf8,_0x52d077))[_0xb371('0x44')](handleError(_0x445bf8,null));};
\ No newline at end of file
+var _0x5be1=['filter','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','length','merge','find','create','body','update','params','describe','getQuestions','JscriptyQuestionReport','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','json','apply','save','destroy','error','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x154fe9,_0x1119d4){var _0x5def50=function(_0x41fbef){while(--_0x41fbef){_0x154fe9['push'](_0x154fe9['shift']());}};_0x5def50(++_0x1119d4);}(_0x5be1,0x145));var _0x15be=function(_0x5f23e4,_0xcce779){_0x5f23e4=_0x5f23e4-0x0;var _0x40c0ea=_0x5be1[_0x5f23e4];return _0x40c0ea;};'use strict';var pdf=require(_0x15be('0x0'));var emlformat=require(_0x15be('0x1'));var rimraf=require(_0x15be('0x2'));var zipdir=require(_0x15be('0x3'));var jsonpatch=require(_0x15be('0x4'));var rp=require(_0x15be('0x5'));var moment=require(_0x15be('0x6'));var BPromise=require(_0x15be('0x7'));var Mustache=require('mustache');var util=require(_0x15be('0x8'));var path=require('path');var sox=require(_0x15be('0x9'));var csv=require(_0x15be('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x15be('0xb'));var squel=require(_0x15be('0xc'));var crypto=require(_0x15be('0xd'));var jsforce=require(_0x15be('0xe'));var deskjs=require(_0x15be('0xf'));var toCsv=require(_0x15be('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x15be('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x15be('0x11'));var hardwareService=require(_0x15be('0x12'));var logger=require(_0x15be('0x13'))(_0x15be('0x14'));var utils=require(_0x15be('0x15'));var config=require(_0x15be('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a3d94,_0xba3620){_0xba3620=_0xba3620||0xcc;return function(_0x4e230b){if(_0x4e230b){return _0x5a3d94[_0x15be('0x17')](_0xba3620);}return _0x5a3d94[_0x15be('0x18')](_0xba3620)[_0x15be('0x19')]();};}function respondWithResult(_0x21588f,_0x62f57a){_0x62f57a=_0x62f57a||0xc8;return function(_0x4a2900){if(_0x4a2900){return _0x21588f[_0x15be('0x18')](_0x62f57a)['json'](_0x4a2900);}};}function respondWithFilteredResult(_0x29621d,_0x5df5b8){return function(_0x301493){if(_0x301493){var _0x95a273=_0x301493[_0x15be('0x1a')],_0x34c296=_0x5df5b8[_0x15be('0x1b')],_0x1fc220=_0x5df5b8['offset']+_0x5df5b8[_0x15be('0x1c')],_0x4a0d9b;if(_0x1fc220>=_0x95a273){_0x1fc220=_0x95a273;_0x4a0d9b=0xc8;}else{_0x4a0d9b=0xce;}_0x29621d['status'](_0x4a0d9b);return _0x29621d['set']('Content-Range',_0x34c296+'-'+_0x1fc220+'/'+_0x95a273)[_0x15be('0x1d')](_0x301493);}return null;};}function patchUpdates(_0x50d192){return function(_0x41e474){try{jsonpatch[_0x15be('0x1e')](_0x41e474,_0x50d192,!![]);}catch(_0x4a3394){return BPromise['reject'](_0x4a3394);}return _0x41e474[_0x15be('0x1f')]();};}function saveUpdates(_0x1a88e6,_0x49885c){return function(_0x8e9b16){if(_0x8e9b16){return _0x8e9b16['update'](_0x1a88e6)['then'](function(_0x246d33){return _0x246d33;});}return null;};}function removeEntity(_0x164a91,_0x145ee1){return function(_0x1a01e7){if(_0x1a01e7){return _0x1a01e7[_0x15be('0x20')]()['then'](function(){_0x164a91[_0x15be('0x18')](0xcc)[_0x15be('0x19')]();});}};}function handleEntityNotFound(_0x52e6b8,_0x3573c3){return function(_0x3d8581){if(!_0x3d8581){_0x52e6b8[_0x15be('0x17')](0x194);}return _0x3d8581;};}function handleError(_0x260d5a,_0x4dcadd){_0x4dcadd=_0x4dcadd||0x1f4;return function(_0x449ce9){logger[_0x15be('0x21')](_0x449ce9[_0x15be('0x22')]);if(_0x449ce9[_0x15be('0x23')]){delete _0x449ce9[_0x15be('0x23')];}_0x260d5a[_0x15be('0x18')](_0x4dcadd)[_0x15be('0x24')](_0x449ce9);};}exports['index']=function(_0x315ed7,_0x5e7d5e){var _0x45bcdb={},_0x22914f={},_0x5d5ceb={'count':0x0,'rows':[]};var _0x19f2bf=_[_0x15be('0x25')](db[_0x15be('0x26')][_0x15be('0x27')],function(_0x354f59){return{'name':_0x354f59[_0x15be('0x28')],'type':_0x354f59[_0x15be('0x29')][_0x15be('0x2a')]};});_0x22914f['model']=_[_0x15be('0x25')](_0x19f2bf,_0x15be('0x23'));_0x22914f[_0x15be('0x2b')]=_[_0x15be('0x2c')](_0x315ed7[_0x15be('0x2b')]);_0x22914f[_0x15be('0x2d')]=_[_0x15be('0x2e')](_0x22914f[_0x15be('0x2f')],_0x22914f['query']);_0x45bcdb[_0x15be('0x30')]=_['intersection'](_0x22914f[_0x15be('0x2f')],qs['fields'](_0x315ed7['query'][_0x15be('0x31')]));_0x45bcdb['attributes']=_0x45bcdb[_0x15be('0x30')]['length']?_0x45bcdb['attributes']:_0x22914f[_0x15be('0x2f')];if(!_0x315ed7[_0x15be('0x2b')][_0x15be('0x32')](_0x15be('0x33'))){_0x45bcdb[_0x15be('0x1c')]=qs[_0x15be('0x1c')](_0x315ed7[_0x15be('0x2b')][_0x15be('0x1c')]);_0x45bcdb[_0x15be('0x1b')]=qs['offset'](_0x315ed7['query'][_0x15be('0x1b')]);}_0x45bcdb[_0x15be('0x34')]=qs[_0x15be('0x35')](_0x315ed7[_0x15be('0x2b')]['sort']);_0x45bcdb[_0x15be('0x36')]=qs[_0x15be('0x2d')](_['pick'](_0x315ed7[_0x15be('0x2b')],_0x22914f[_0x15be('0x2d')]),_0x19f2bf);if(_0x315ed7[_0x15be('0x2b')][_0x15be('0x37')]){_0x45bcdb[_0x15be('0x36')]=_['merge'](_0x45bcdb[_0x15be('0x36')],{'$or':_[_0x15be('0x25')](_0x19f2bf,function(_0x3ce160){if(_0x3ce160['type']!==_0x15be('0x38')){var _0x12a4ef={};_0x12a4ef[_0x3ce160[_0x15be('0x23')]]={'$like':'%'+_0x315ed7['query']['filter']+'%'};return _0x12a4ef;}})});}_0x45bcdb=_['merge']({},_0x45bcdb,_0x315ed7[_0x15be('0x39')]);var _0x7ff768={'where':_0x45bcdb[_0x15be('0x36')]};return db[_0x15be('0x26')][_0x15be('0x1a')](_0x7ff768)[_0x15be('0x3a')](function(_0x50c148){_0x5d5ceb[_0x15be('0x1a')]=_0x50c148;if(_0x315ed7[_0x15be('0x2b')][_0x15be('0x3b')]){_0x45bcdb[_0x15be('0x3c')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x15be('0x3d')](_0x45bcdb);})[_0x15be('0x3a')](function(_0xf0a105){_0x5d5ceb[_0x15be('0x3e')]=_0xf0a105;return _0x5d5ceb;})[_0x15be('0x3a')](respondWithFilteredResult(_0x5e7d5e,_0x45bcdb))[_0x15be('0x3f')](handleError(_0x5e7d5e,null));};exports[_0x15be('0x40')]=function(_0x4414a9,_0x693b1b){var _0x314b59={'raw':!![],'where':{'id':_0x4414a9['params']['id']}},_0x43bb77={};_0x43bb77[_0x15be('0x2f')]=_[_0x15be('0x2c')](db['JscriptySessionReport'][_0x15be('0x27')]);_0x43bb77['query']=_[_0x15be('0x2c')](_0x4414a9[_0x15be('0x2b')]);_0x43bb77['filters']=_[_0x15be('0x2e')](_0x43bb77[_0x15be('0x2f')],_0x43bb77[_0x15be('0x2b')]);_0x314b59['attributes']=_[_0x15be('0x2e')](_0x43bb77[_0x15be('0x2f')],qs[_0x15be('0x31')](_0x4414a9[_0x15be('0x2b')][_0x15be('0x31')]));_0x314b59['attributes']=_0x314b59[_0x15be('0x30')][_0x15be('0x41')]?_0x314b59['attributes']:_0x43bb77['model'];if(_0x4414a9[_0x15be('0x2b')][_0x15be('0x3b')]){_0x314b59[_0x15be('0x3c')]=[{'all':!![]}];}_0x314b59=_[_0x15be('0x42')]({},_0x314b59,_0x4414a9[_0x15be('0x39')]);return db[_0x15be('0x26')][_0x15be('0x43')](_0x314b59)[_0x15be('0x3a')](handleEntityNotFound(_0x693b1b,null))['then'](respondWithResult(_0x693b1b,null))[_0x15be('0x3f')](handleError(_0x693b1b,null));};exports[_0x15be('0x44')]=function(_0x43b2c9,_0x59de44){return db[_0x15be('0x26')][_0x15be('0x44')](_0x43b2c9[_0x15be('0x45')],{})[_0x15be('0x3a')](respondWithResult(_0x59de44,0xc9))['catch'](handleError(_0x59de44,null));};exports[_0x15be('0x46')]=function(_0x4d5dc3,_0x934dc0){if(_0x4d5dc3[_0x15be('0x45')]['id']){delete _0x4d5dc3[_0x15be('0x45')]['id'];}return db[_0x15be('0x26')]['find']({'where':{'id':_0x4d5dc3[_0x15be('0x47')]['id']}})[_0x15be('0x3a')](handleEntityNotFound(_0x934dc0,null))[_0x15be('0x3a')](saveUpdates(_0x4d5dc3[_0x15be('0x45')],null))['then'](respondWithResult(_0x934dc0,null))[_0x15be('0x3f')](handleError(_0x934dc0,null));};exports[_0x15be('0x20')]=function(_0x448cdb,_0xbbe1da){return db['JscriptySessionReport'][_0x15be('0x43')]({'where':{'id':_0x448cdb[_0x15be('0x47')]['id']}})[_0x15be('0x3a')](handleEntityNotFound(_0xbbe1da,null))[_0x15be('0x3a')](removeEntity(_0xbbe1da,null))['catch'](handleError(_0xbbe1da,null));};exports[_0x15be('0x48')]=function(_0x2fbbc5,_0x50bf4b){return db[_0x15be('0x26')][_0x15be('0x48')]()[_0x15be('0x3a')](respondWithResult(_0x50bf4b,null))[_0x15be('0x3f')](handleError(_0x50bf4b,null));};exports[_0x15be('0x49')]=function(_0x3b446c,_0x51b99b,_0x27a2c1){var _0x5debd4={'raw':!![],'where':{}};var _0x4702ca={};var _0x4dd0cc={'count':0x0,'rows':[]};return db[_0x15be('0x26')]['findOne']({'where':{'id':_0x3b446c[_0x15be('0x47')]['id']}})['then'](handleEntityNotFound(_0x51b99b,null))[_0x15be('0x3a')](function(_0x3f33bc){if(_0x3f33bc){_0x4702ca['model']=_[_0x15be('0x2c')](db[_0x15be('0x4a')][_0x15be('0x27')]);_0x4702ca[_0x15be('0x2b')]=_['keys'](_0x3b446c[_0x15be('0x2b')]);_0x4702ca[_0x15be('0x2d')]=_['intersection'](_0x4702ca[_0x15be('0x2f')],_0x4702ca['query']);_0x5debd4[_0x15be('0x30')]=_[_0x15be('0x2e')](_0x4702ca[_0x15be('0x2f')],qs[_0x15be('0x31')](_0x3b446c[_0x15be('0x2b')][_0x15be('0x31')]));_0x5debd4[_0x15be('0x30')]=_0x5debd4[_0x15be('0x30')][_0x15be('0x41')]?_0x5debd4[_0x15be('0x30')]:_0x4702ca['model'];if(!_0x3b446c['query'][_0x15be('0x32')](_0x15be('0x33'))){_0x5debd4['limit']=qs[_0x15be('0x1c')](_0x3b446c[_0x15be('0x2b')][_0x15be('0x1c')]);_0x5debd4[_0x15be('0x1b')]=qs[_0x15be('0x1b')](_0x3b446c[_0x15be('0x2b')][_0x15be('0x1b')]);}_0x5debd4[_0x15be('0x34')]=qs[_0x15be('0x35')](_0x3b446c['query']['sort']);_0x5debd4['where']=qs['filters'](_[_0x15be('0x4b')](_0x3b446c[_0x15be('0x2b')],_0x4702ca[_0x15be('0x2d')]));_0x5debd4[_0x15be('0x36')]['SessionId']=_0x3f33bc['id'];if(_0x3b446c[_0x15be('0x2b')]['filter']){_0x5debd4[_0x15be('0x36')]=_[_0x15be('0x42')](_0x5debd4[_0x15be('0x36')],{'$or':_['map'](_0x5debd4[_0x15be('0x30')],function(_0x2e4204){var _0x99d057={};_0x99d057[_0x2e4204]={'$like':'%'+_0x3b446c[_0x15be('0x2b')][_0x15be('0x37')]+'%'};return _0x99d057;})});}_0x5debd4=_[_0x15be('0x42')]({},_0x5debd4,_0x3b446c[_0x15be('0x39')]);return db[_0x15be('0x4a')][_0x15be('0x1a')]({'where':_0x5debd4[_0x15be('0x36')]})[_0x15be('0x3a')](function(_0xb6ac3b){_0x4dd0cc[_0x15be('0x1a')]=_0xb6ac3b;if(_0x3b446c[_0x15be('0x2b')]['includeAll']){_0x5debd4[_0x15be('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x5debd4);})['then'](function(_0x5d9d13){_0x4dd0cc[_0x15be('0x3e')]=_0x5d9d13;return _0x4dd0cc;});}})[_0x15be('0x3a')](respondWithFilteredResult(_0x51b99b,_0x5debd4))[_0x15be('0x3f')](handleError(_0x51b99b,null));};
\ No newline at end of file
index 286e07c..b460474 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebcd=['exports','define','JscriptySessionReport','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xebcd,0x87));var _0xdebc=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xebcd[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xdebc('0x0'));var util=require('util');var logger=require(_0xdebc('0x1'))(_0xdebc('0x2'));var moment=require(_0xdebc('0x3'));var BPromise=require('bluebird');var rp=require(_0xdebc('0x4'));var fs=require('fs');var path=require(_0xdebc('0x5'));var rimraf=require('rimraf');var config=require(_0xdebc('0x6'));var attributes=require(_0xdebc('0x7'));module[_0xdebc('0x8')]=function(_0x53faff,_0x4a364d){return _0x53faff[_0xdebc('0x9')](_0xdebc('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa882=['report_jscripty_sessions','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define'];(function(_0x4ee2f2,_0x416932){var _0x1d5161=function(_0x2f683b){while(--_0x2f683b){_0x4ee2f2['push'](_0x4ee2f2['shift']());}};_0x1d5161(++_0x416932);}(_0xa882,0x135));var _0x2a88=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0xa882[_0x2f3794];return _0x1c9fbe;};'use strict';var _=require(_0x2a88('0x0'));var util=require(_0x2a88('0x1'));var logger=require(_0x2a88('0x2'))('api');var moment=require(_0x2a88('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a88('0x4'));var fs=require('fs');var path=require(_0x2a88('0x5'));var rimraf=require(_0x2a88('0x6'));var config=require(_0x2a88('0x7'));var attributes=require(_0x2a88('0x8'));module['exports']=function(_0x106b35,_0x58339c){return _0x106b35[_0x2a88('0x9')]('JscriptySessionReport',attributes,{'tableName':_0x2a88('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e611bd9..b2feac4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf6d=['../../config/logger','rpc','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x33fe7f,_0x344195){var _0x3f3b80=function(_0x27a5bc){while(--_0x27a5bc){_0x33fe7f['push'](_0x33fe7f['shift']());}};_0x3f3b80(++_0x344195);}(_0xdf6d,0x15e));var _0xddf6=function(_0x6a9ec4,_0x19031f){_0x6a9ec4=_0x6a9ec4-0x0;var _0x47df6d=_0xdf6d[_0x6a9ec4];return _0x47df6d;};'use strict';var _=require(_0xddf6('0x0'));var util=require('util');var moment=require(_0xddf6('0x1'));var BPromise=require(_0xddf6('0x2'));var rs=require(_0xddf6('0x3'));var fs=require('fs');var Redis=require(_0xddf6('0x4'));var db=require(_0xddf6('0x5'))['db'];var utils=require(_0xddf6('0x6'));var logger=require(_0xddf6('0x7'))(_0xddf6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xddf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54e47e,_0x175d72,_0x1fca31){return new BPromise(function(_0x31bf50,_0x3bb36a){return client['request'](_0x54e47e,_0x1fca31)[_0xddf6('0xa')](function(_0xbc615){logger[_0xddf6('0xb')](_0xddf6('0xc'),_0x175d72,_0xddf6('0xd'));logger[_0xddf6('0xe')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x175d72,'request\x20sent',JSON[_0xddf6('0xf')](_0xbc615));if(_0xbc615[_0xddf6('0x10')]){if(_0xbc615[_0xddf6('0x10')][_0xddf6('0x11')]===0x1f4){logger[_0xddf6('0x10')](_0xddf6('0xc'),_0x175d72,_0xbc615['error'][_0xddf6('0x12')]);return _0x3bb36a(_0xbc615['error']['message']);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x175d72,_0xbc615[_0xddf6('0x10')][_0xddf6('0x12')]);return _0x31bf50(_0xbc615[_0xddf6('0x10')][_0xddf6('0x12')]);}else{logger[_0xddf6('0xb')](_0xddf6('0xc'),_0x175d72,_0xddf6('0xd'));_0x31bf50(_0xbc615[_0xddf6('0x13')][_0xddf6('0x12')]);}})[_0xddf6('0x14')](function(_0x3ddabf){logger['error'](_0xddf6('0xc'),_0x175d72,_0x3ddabf);_0x3bb36a(_0x3ddabf);});});}
\ No newline at end of file
+var _0x6cdd=['rpc','jayson/promise','client','request','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','moment','ioredis','../../config/utils'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x6cdd,0x140));var _0xd6cd=function(_0x1983e8,_0x2d179b){_0x1983e8=_0x1983e8-0x0;var _0x8dd5a=_0x6cdd[_0x1983e8];return _0x8dd5a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6cd('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6cd('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xd6cd('0x2'));var logger=require('../../config/logger')(_0xd6cd('0x3'));var config=require('../../config/environment');var jayson=require(_0xd6cd('0x4'));var client=jayson[_0xd6cd('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26a420,_0x1b1b9a,_0x5d8dbc){return new BPromise(function(_0x340afc,_0x2ddd44){return client[_0xd6cd('0x6')](_0x26a420,_0x5d8dbc)['then'](function(_0x46619b){logger[_0xd6cd('0x7')]('JscriptySessionReport,\x20%s,\x20%s',_0x1b1b9a,_0xd6cd('0x8'));logger[_0xd6cd('0x9')](_0xd6cd('0xa'),_0x1b1b9a,_0xd6cd('0x8'),JSON[_0xd6cd('0xb')](_0x46619b));if(_0x46619b[_0xd6cd('0xc')]){if(_0x46619b[_0xd6cd('0xc')][_0xd6cd('0xd')]===0x1f4){logger[_0xd6cd('0xc')](_0xd6cd('0xe'),_0x1b1b9a,_0x46619b[_0xd6cd('0xc')][_0xd6cd('0xf')]);return _0x2ddd44(_0x46619b['error'][_0xd6cd('0xf')]);}logger['error'](_0xd6cd('0xe'),_0x1b1b9a,_0x46619b[_0xd6cd('0xc')][_0xd6cd('0xf')]);return _0x340afc(_0x46619b['error'][_0xd6cd('0xf')]);}else{logger[_0xd6cd('0x7')]('JscriptySessionReport,\x20%s,\x20%s',_0x1b1b9a,_0xd6cd('0x8'));_0x340afc(_0x46619b[_0xd6cd('0x10')][_0xd6cd('0xf')]);}})['catch'](function(_0x548ba9){logger[_0xd6cd('0xc')](_0xd6cd('0xe'),_0x1b1b9a,_0x548ba9);_0x2ddd44(_0x548ba9);});});}
\ No newline at end of file
index 18f2692..14af197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd828=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update','exports','multer','util','path'];(function(_0x936b52,_0x4598fb){var _0x615801=function(_0x1b3874){while(--_0x1b3874){_0x936b52['push'](_0x936b52['shift']());}};_0x615801(++_0x4598fb);}(_0xd828,0x11a));var _0x8d82=function(_0x385419,_0x529ef1){_0x385419=_0x385419-0x0;var _0x49fd20=_0xd828[_0x385419];return _0x49fd20;};'use strict';var multer=require(_0x8d82('0x0'));var util=require(_0x8d82('0x1'));var path=require(_0x8d82('0x2'));var timeout=require(_0x8d82('0x3'));var express=require(_0x8d82('0x4'));var router=express['Router']();var auth=require(_0x8d82('0x5'));var interaction=require(_0x8d82('0x6'));var config=require(_0x8d82('0x7'));var controller=require(_0x8d82('0x8'));router[_0x8d82('0x9')]('/',controller[_0x8d82('0xa')]);router['put'](_0x8d82('0xb'),auth[_0x8d82('0xc')](),controller[_0x8d82('0xd')]);module[_0x8d82('0xe')]=router;
\ No newline at end of file
+var _0x2a0a=['/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./license.controller','get','index','put'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x2a0a,0xa9));var _0xa2a0=function(_0x753ac6,_0x4605ff){_0x753ac6=_0x753ac6-0x0;var _0x5a4dc7=_0x2a0a[_0x753ac6];return _0x5a4dc7;};'use strict';var multer=require(_0xa2a0('0x0'));var util=require(_0xa2a0('0x1'));var path=require('path');var timeout=require(_0xa2a0('0x2'));var express=require(_0xa2a0('0x3'));var router=express[_0xa2a0('0x4')]();var auth=require(_0xa2a0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa2a0('0x6'));var controller=require(_0xa2a0('0x7'));router[_0xa2a0('0x8')]('/',controller[_0xa2a0('0x9')]);router[_0xa2a0('0xa')](_0xa2a0('0xb'),auth[_0xa2a0('0xc')](),controller[_0xa2a0('0xd')]);module[_0xa2a0('0xe')]=router;
\ No newline at end of file
index ebf3994..70d70f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['exports','STRING','INTEGER'];(function(_0x1425e8,_0x2c195b){var _0x1cd239=function(_0x404246){while(--_0x404246){_0x1425e8['push'](_0x1425e8['shift']());}};_0x1cd239(++_0x2c195b);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x543dc8,_0x137f88){_0x543dc8=_0x543dc8-0x0;var _0x6948ba=_0xdbf5[_0x543dc8];return _0x6948ba;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x5dbf('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x5dbf('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4819=['INTEGER','exports','TEXT','STRING'];(function(_0x46efff,_0x56f657){var _0x196cfc=function(_0x5212b1){while(--_0x5212b1){_0x46efff['push'](_0x46efff['shift']());}};_0x196cfc(++_0x56f657);}(_0x4819,0xcd));var _0x9481=function(_0x40b723,_0x118b22){_0x40b723=_0x40b723-0x0;var _0x1981ad=_0x4819[_0x40b723];return _0x1981ad;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'license':{'type':Sequelize[_0x9481('0x1')]},'data1':{'type':Sequelize[_0x9481('0x2')]},'data2':{'type':Sequelize[_0x9481('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x9481('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index a738a34..f4c8a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xced3=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','stack','name','send','../../config/license/util','index','model','License','rawAttributes','keys','query','filters','intersection','attributes','fields','options','getLicense','catch','update','body','find','params','checkLicense','demo','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash'];(function(_0x2f8226,_0xef0268){var _0x2f40a2=function(_0x91c05d){while(--_0x91c05d){_0x2f8226['push'](_0x2f8226['shift']());}};_0x2f40a2(++_0xef0268);}(_0xced3,0x68));var _0x3ced=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xced3[_0x87b0ff];return _0x3bc0b2;};'use strict';var pdf=require(_0x3ced('0x0'));var emlformat=require(_0x3ced('0x1'));var rimraf=require(_0x3ced('0x2'));var zipdir=require(_0x3ced('0x3'));var jsonpatch=require(_0x3ced('0x4'));var rp=require('request-promise');var moment=require(_0x3ced('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3ced('0x6'));var util=require(_0x3ced('0x7'));var path=require(_0x3ced('0x8'));var sox=require(_0x3ced('0x9'));var csv=require('to-csv');var ejs=require(_0x3ced('0xa'));var fs=require('fs');var _=require(_0x3ced('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ced('0xc'));var deskjs=require(_0x3ced('0xd'));var toCsv=require(_0x3ced('0xe'));var querystring=require('querystring');var Papa=require(_0x3ced('0xf'));var Redis=require(_0x3ced('0x10'));var authService=require(_0x3ced('0x11'));var qs=require(_0x3ced('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ced('0x13'));var logger=require('../../config/logger')(_0x3ced('0x14'));var utils=require(_0x3ced('0x15'));var config=require(_0x3ced('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xafe736,_0x333047){_0x333047=_0x333047||0xcc;return function(_0x2aaff4){if(_0x2aaff4){return _0xafe736[_0x3ced('0x17')](_0x333047);}return _0xafe736[_0x3ced('0x18')](_0x333047)[_0x3ced('0x19')]();};}function respondWithResult(_0x118ad3,_0x5d38ae){_0x5d38ae=_0x5d38ae||0xc8;return function(_0x21e1f5){if(_0x21e1f5){return _0x118ad3[_0x3ced('0x18')](_0x5d38ae)[_0x3ced('0x1a')](_0x21e1f5);}};}function respondWithFilteredResult(_0x2b4124,_0x316fcf){return function(_0x514bf5){if(_0x514bf5){var _0x302140=_0x514bf5[_0x3ced('0x1b')],_0xc351e7=_0x316fcf[_0x3ced('0x1c')],_0x169a86=_0x316fcf[_0x3ced('0x1c')]+_0x316fcf[_0x3ced('0x1d')],_0x45efff;if(_0x169a86>=_0x302140){_0x169a86=_0x302140;_0x45efff=0xc8;}else{_0x45efff=0xce;}_0x2b4124[_0x3ced('0x18')](_0x45efff);return _0x2b4124[_0x3ced('0x1e')](_0x3ced('0x1f'),_0xc351e7+'-'+_0x169a86+'/'+_0x302140)[_0x3ced('0x1a')](_0x514bf5);}return null;};}function patchUpdates(_0x154b81){return function(_0x245155){try{jsonpatch['apply'](_0x245155,_0x154b81,!![]);}catch(_0x394242){return BPromise['reject'](_0x394242);}return _0x245155[_0x3ced('0x20')]();};}function saveUpdates(_0x5541bc,_0x54ef21){return function(_0x5778ac){if(_0x5778ac){return _0x5778ac['update'](_0x5541bc)[_0x3ced('0x21')](function(_0x12995d){return _0x12995d;});}return null;};}function removeEntity(_0x1c8617,_0xd1a560){return function(_0x14b7ee){if(_0x14b7ee){return _0x14b7ee[_0x3ced('0x22')]()[_0x3ced('0x21')](function(){_0x1c8617[_0x3ced('0x18')](0xcc)[_0x3ced('0x19')]();});}};}function handleEntityNotFound(_0x4c7fe1,_0x3b5e41){return function(_0x1f8f64){if(!_0x1f8f64){_0x4c7fe1['sendStatus'](0x194);}return _0x1f8f64;};}function handleError(_0x2b95f2,_0xb220ed){_0xb220ed=_0xb220ed||0x1f4;return function(_0x3d1bfc){logger['error'](_0x3d1bfc[_0x3ced('0x23')]);if(_0x3d1bfc[_0x3ced('0x24')]){delete _0x3d1bfc[_0x3ced('0x24')];}_0x2b95f2[_0x3ced('0x18')](_0xb220ed)[_0x3ced('0x25')](_0x3d1bfc);};}var utilLicense=require(_0x3ced('0x26'));exports[_0x3ced('0x27')]=function(_0x532050,_0x4909b8){var _0x4352c9={'raw':!![],'where':{'id':0x1}},_0x16853e={};_0x16853e[_0x3ced('0x28')]=_['keys'](db[_0x3ced('0x29')][_0x3ced('0x2a')]);_0x16853e['query']=_[_0x3ced('0x2b')](_0x532050[_0x3ced('0x2c')]);_0x16853e[_0x3ced('0x2d')]=_[_0x3ced('0x2e')](_0x16853e[_0x3ced('0x28')],_0x16853e[_0x3ced('0x2c')]);_0x4352c9[_0x3ced('0x2f')]=_[_0x3ced('0x2e')](_0x16853e[_0x3ced('0x28')],qs[_0x3ced('0x30')](_0x532050[_0x3ced('0x2c')][_0x3ced('0x30')]));_0x4352c9[_0x3ced('0x2f')]=_0x4352c9[_0x3ced('0x2f')]['length']?_0x4352c9[_0x3ced('0x2f')]:_0x16853e[_0x3ced('0x28')];_0x4352c9=_['merge']({},_0x4352c9,_0x532050[_0x3ced('0x31')]);return utilLicense[_0x3ced('0x32')](_0x4352c9)[_0x3ced('0x21')](respondWithResult(_0x4909b8,null))[_0x3ced('0x33')](handleError(_0x4909b8,null));};exports[_0x3ced('0x34')]=function(_0x244527,_0x26a579){if(_0x244527[_0x3ced('0x35')]['id']){delete _0x244527[_0x3ced('0x35')]['id'];}return db[_0x3ced('0x29')][_0x3ced('0x36')]({'where':{'id':_0x244527[_0x3ced('0x37')]['id']}})['then'](handleEntityNotFound(_0x26a579,null))['then'](function(_0x281a81){var _0x143a17=_0x281a81['get']({'plain':!![]});return utilLicense[_0x3ced('0x38')](_0x143a17,_0x244527[_0x3ced('0x35')]['key']);})[_0x3ced('0x21')](function(_0x2c2699){if(!_0x2c2699[_0x3ced('0x39')]){return saveUpdates(_0x244527[_0x3ced('0x35')],null);}return _0x2c2699;})['then'](respondWithResult(_0x26a579,null))[_0x3ced('0x33')](handleError(_0x26a579,null));};
\ No newline at end of file
+var _0x8829=['params','get','checkLicense','demo','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','../../config/license/util','model','License','rawAttributes','query','keys','filters','intersection','fields','attributes','length','merge','options','getLicense','catch','body','find'];(function(_0x2c1eeb,_0x4f4092){var _0x8d971=function(_0x5d3bb7){while(--_0x5d3bb7){_0x2c1eeb['push'](_0x2c1eeb['shift']());}};_0x8d971(++_0x4f4092);}(_0x8829,0x12b));var _0x9882=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8829[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x9882('0x0'));var emlformat=require(_0x9882('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9882('0x2'));var jsonpatch=require(_0x9882('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9882('0x4'));var Mustache=require(_0x9882('0x5'));var util=require(_0x9882('0x6'));var path=require(_0x9882('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9882('0x8'));var crypto=require('crypto');var jsforce=require(_0x9882('0x9'));var deskjs=require(_0x9882('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9882('0xb'));var Papa=require(_0x9882('0xc'));var Redis=require(_0x9882('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9882('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9882('0xf'));var logger=require(_0x9882('0x10'))(_0x9882('0x11'));var utils=require('../../config/utils');var config=require(_0x9882('0x12'));var db=require(_0x9882('0x13'))['db'];function respondWithStatusCode(_0x28dda4,_0x30cde0){_0x30cde0=_0x30cde0||0xcc;return function(_0x125555){if(_0x125555){return _0x28dda4[_0x9882('0x14')](_0x30cde0);}return _0x28dda4[_0x9882('0x15')](_0x30cde0)[_0x9882('0x16')]();};}function respondWithResult(_0xe45a0b,_0x3873cd){_0x3873cd=_0x3873cd||0xc8;return function(_0x536b3a){if(_0x536b3a){return _0xe45a0b[_0x9882('0x15')](_0x3873cd)[_0x9882('0x17')](_0x536b3a);}};}function respondWithFilteredResult(_0x2be449,_0x3ddc50){return function(_0x4e10bb){if(_0x4e10bb){var _0x1f5954=_0x4e10bb[_0x9882('0x18')],_0x52b5d7=_0x3ddc50['offset'],_0x243aef=_0x3ddc50['offset']+_0x3ddc50[_0x9882('0x19')],_0x582c85;if(_0x243aef>=_0x1f5954){_0x243aef=_0x1f5954;_0x582c85=0xc8;}else{_0x582c85=0xce;}_0x2be449[_0x9882('0x15')](_0x582c85);return _0x2be449[_0x9882('0x1a')](_0x9882('0x1b'),_0x52b5d7+'-'+_0x243aef+'/'+_0x1f5954)[_0x9882('0x17')](_0x4e10bb);}return null;};}function patchUpdates(_0x531a09){return function(_0x4adc82){try{jsonpatch[_0x9882('0x1c')](_0x4adc82,_0x531a09,!![]);}catch(_0x29a356){return BPromise[_0x9882('0x1d')](_0x29a356);}return _0x4adc82[_0x9882('0x1e')]();};}function saveUpdates(_0x18e885,_0x278d05){return function(_0x669651){if(_0x669651){return _0x669651[_0x9882('0x1f')](_0x18e885)[_0x9882('0x20')](function(_0xcb64ba){return _0xcb64ba;});}return null;};}function removeEntity(_0x45cd73,_0x5050e3){return function(_0x4eaccf){if(_0x4eaccf){return _0x4eaccf[_0x9882('0x21')]()[_0x9882('0x20')](function(){_0x45cd73[_0x9882('0x15')](0xcc)[_0x9882('0x16')]();});}};}function handleEntityNotFound(_0x8a34f6,_0x51055c){return function(_0x5eb02b){if(!_0x5eb02b){_0x8a34f6['sendStatus'](0x194);}return _0x5eb02b;};}function handleError(_0x300815,_0x541d72){_0x541d72=_0x541d72||0x1f4;return function(_0x5d3e57){logger[_0x9882('0x22')](_0x5d3e57[_0x9882('0x23')]);if(_0x5d3e57[_0x9882('0x24')]){delete _0x5d3e57['name'];}_0x300815[_0x9882('0x15')](_0x541d72)[_0x9882('0x25')](_0x5d3e57);};}var utilLicense=require(_0x9882('0x26'));exports['index']=function(_0x477c0b,_0x3ad808){var _0x2ceff3={'raw':!![],'where':{'id':0x1}},_0x797abf={};_0x797abf[_0x9882('0x27')]=_['keys'](db[_0x9882('0x28')][_0x9882('0x29')]);_0x797abf[_0x9882('0x2a')]=_[_0x9882('0x2b')](_0x477c0b[_0x9882('0x2a')]);_0x797abf[_0x9882('0x2c')]=_['intersection'](_0x797abf[_0x9882('0x27')],_0x797abf[_0x9882('0x2a')]);_0x2ceff3['attributes']=_[_0x9882('0x2d')](_0x797abf[_0x9882('0x27')],qs[_0x9882('0x2e')](_0x477c0b[_0x9882('0x2a')][_0x9882('0x2e')]));_0x2ceff3[_0x9882('0x2f')]=_0x2ceff3[_0x9882('0x2f')][_0x9882('0x30')]?_0x2ceff3['attributes']:_0x797abf[_0x9882('0x27')];_0x2ceff3=_[_0x9882('0x31')]({},_0x2ceff3,_0x477c0b[_0x9882('0x32')]);return utilLicense[_0x9882('0x33')](_0x2ceff3)[_0x9882('0x20')](respondWithResult(_0x3ad808,null))[_0x9882('0x34')](handleError(_0x3ad808,null));};exports[_0x9882('0x1f')]=function(_0x3bbb62,_0x144457){if(_0x3bbb62['body']['id']){delete _0x3bbb62[_0x9882('0x35')]['id'];}return db[_0x9882('0x28')][_0x9882('0x36')]({'where':{'id':_0x3bbb62[_0x9882('0x37')]['id']}})[_0x9882('0x20')](handleEntityNotFound(_0x144457,null))[_0x9882('0x20')](function(_0x21d1a0){var _0x51bd56=_0x21d1a0[_0x9882('0x38')]({'plain':!![]});return utilLicense[_0x9882('0x39')](_0x51bd56,_0x3bbb62[_0x9882('0x35')]['key']);})['then'](function(_0x434bce){if(!_0x434bce[_0x9882('0x3a')]){return saveUpdates(_0x3bbb62[_0x9882('0x35')],null);}return _0x434bce;})[_0x9882('0x20')](respondWithResult(_0x144457,null))[_0x9882('0x34')](handleError(_0x144457,null));};
\ No newline at end of file
index 184843a..8f2833d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca60=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./license.attributes','exports','define','License','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xca60,0xef));var _0x0ca6=function(_0x4f51f9,_0x5d5613){_0x4f51f9=_0x4f51f9-0x0;var _0x533984=_0xca60[_0x4f51f9];return _0x533984;};'use strict';var _=require(_0x0ca6('0x0'));var util=require('util');var logger=require(_0x0ca6('0x1'))(_0x0ca6('0x2'));var moment=require(_0x0ca6('0x3'));var BPromise=require(_0x0ca6('0x4'));var rp=require(_0x0ca6('0x5'));var fs=require('fs');var path=require(_0x0ca6('0x6'));var rimraf=require(_0x0ca6('0x7'));var config=require('../../config/environment');var attributes=require(_0x0ca6('0x8'));module[_0x0ca6('0x9')]=function(_0x526fef,_0x5e6895){return _0x526fef[_0x0ca6('0xa')](_0x0ca6('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcacd=['path','rimraf','./license.attributes','exports','define','License','license','lodash','moment','bluebird','request-promise'];(function(_0x19b351,_0x547358){var _0x104803=function(_0x412161){while(--_0x412161){_0x19b351['push'](_0x19b351['shift']());}};_0x104803(++_0x547358);}(_0xcacd,0x1bf));var _0xdcac=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcacd[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xdcac('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdcac('0x1'));var BPromise=require(_0xdcac('0x2'));var rp=require(_0xdcac('0x3'));var fs=require('fs');var path=require(_0xdcac('0x4'));var rimraf=require(_0xdcac('0x5'));var config=require('../../config/environment');var attributes=require(_0xdcac('0x6'));module[_0xdcac('0x7')]=function(_0x208907,_0x58af9f){return _0x208907[_0xdcac('0x8')](_0xdcac('0x9'),attributes,{'tableName':_0xdcac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c89b43e..6ee560b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd136=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','License,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd136,0x94));var _0x6d13=function(_0x55049b,_0x4cfae8){_0x55049b=_0x55049b-0x0;var _0x283d4f=_0xd136[_0x55049b];return _0x283d4f;};'use strict';var _=require('lodash');var util=require(_0x6d13('0x0'));var moment=require(_0x6d13('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d13('0x2'));var fs=require('fs');var Redis=require(_0x6d13('0x3'));var db=require(_0x6d13('0x4'))['db'];var utils=require(_0x6d13('0x5'));var logger=require(_0x6d13('0x6'))(_0x6d13('0x7'));var config=require(_0x6d13('0x8'));var jayson=require(_0x6d13('0x9'));var client=jayson[_0x6d13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335482,_0xdf6760,_0x4c563a){return new BPromise(function(_0x598021,_0x1af16f){return client[_0x6d13('0xb')](_0x335482,_0x4c563a)[_0x6d13('0xc')](function(_0x2216d7){logger['info']('License,\x20%s,\x20%s',_0xdf6760,_0x6d13('0xd'));logger[_0x6d13('0xe')](_0x6d13('0xf'),_0xdf6760,'request\x20sent',JSON['stringify'](_0x2216d7));if(_0x2216d7[_0x6d13('0x10')]){if(_0x2216d7[_0x6d13('0x10')][_0x6d13('0x11')]===0x1f4){logger['error'](_0x6d13('0x12'),_0xdf6760,_0x2216d7[_0x6d13('0x10')][_0x6d13('0x13')]);return _0x1af16f(_0x2216d7[_0x6d13('0x10')]['message']);}logger['error']('License,\x20%s,\x20%s',_0xdf6760,_0x2216d7[_0x6d13('0x10')][_0x6d13('0x13')]);return _0x598021(_0x2216d7[_0x6d13('0x10')][_0x6d13('0x13')]);}else{logger[_0x6d13('0x14')]('License,\x20%s,\x20%s',_0xdf6760,_0x6d13('0xd'));_0x598021(_0x2216d7[_0x6d13('0x15')][_0x6d13('0x13')]);}})[_0x6d13('0x16')](function(_0x348cab){logger[_0x6d13('0x10')](_0x6d13('0x12'),_0xdf6760,_0x348cab);_0x1af16f(_0x348cab);});});}
\ No newline at end of file
+var _0x9b00=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x355d8c,_0x2de949){var _0xd527fa=function(_0x49ca82){while(--_0x49ca82){_0x355d8c['push'](_0x355d8c['shift']());}};_0xd527fa(++_0x2de949);}(_0x9b00,0xcc));var _0x09b0=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9b00[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x09b0('0x0'));var util=require(_0x09b0('0x1'));var moment=require(_0x09b0('0x2'));var BPromise=require('bluebird');var rs=require(_0x09b0('0x3'));var fs=require('fs');var Redis=require(_0x09b0('0x4'));var db=require(_0x09b0('0x5'))['db'];var utils=require(_0x09b0('0x6'));var logger=require(_0x09b0('0x7'))(_0x09b0('0x8'));var config=require(_0x09b0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x09b0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20c971,_0x36b4ca,_0x396bd6){return new BPromise(function(_0x4290c7,_0x1bc2ce){return client[_0x09b0('0xb')](_0x20c971,_0x396bd6)[_0x09b0('0xc')](function(_0x541785){logger[_0x09b0('0xd')](_0x09b0('0xe'),_0x36b4ca,_0x09b0('0xf'));logger[_0x09b0('0x10')](_0x09b0('0x11'),_0x36b4ca,_0x09b0('0xf'),JSON[_0x09b0('0x12')](_0x541785));if(_0x541785[_0x09b0('0x13')]){if(_0x541785[_0x09b0('0x13')][_0x09b0('0x14')]===0x1f4){logger[_0x09b0('0x13')]('License,\x20%s,\x20%s',_0x36b4ca,_0x541785[_0x09b0('0x13')][_0x09b0('0x15')]);return _0x1bc2ce(_0x541785[_0x09b0('0x13')]['message']);}logger[_0x09b0('0x13')](_0x09b0('0xe'),_0x36b4ca,_0x541785['error'][_0x09b0('0x15')]);return _0x4290c7(_0x541785['error'][_0x09b0('0x15')]);}else{logger[_0x09b0('0xd')](_0x09b0('0xe'),_0x36b4ca,_0x09b0('0xf'));_0x4290c7(_0x541785['result']['message']);}})['catch'](function(_0xff4b8f){logger[_0x09b0('0x13')]('License,\x20%s,\x20%s',_0x36b4ca,_0xff4b8f);_0x1bc2ce(_0xff4b8f);});});}
\ No newline at end of file
index 02bfd3a..9937880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cef=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeImap','removeSmtp','/:id','destroy','exports','multer','path'];(function(_0x1f9187,_0x35be13){var _0x5dad9c=function(_0x47deff){while(--_0x47deff){_0x1f9187['push'](_0x1f9187['shift']());}};_0x5dad9c(++_0x35be13);}(_0x4cef,0xe4));var _0xf4ce=function(_0x149db1,_0x25f28b){_0x149db1=_0x149db1-0x0;var _0x2059a8=_0x4cef[_0x149db1];return _0x2059a8;};'use strict';var multer=require(_0xf4ce('0x0'));var util=require('util');var path=require(_0xf4ce('0x1'));var timeout=require(_0xf4ce('0x2'));var express=require(_0xf4ce('0x3'));var router=express[_0xf4ce('0x4')]();var auth=require(_0xf4ce('0x5'));var interaction=require(_0xf4ce('0x6'));var config=require(_0xf4ce('0x7'));var controller=require('./mailAccount.controller');router[_0xf4ce('0x8')]('/',auth[_0xf4ce('0x9')](),controller[_0xf4ce('0xa')]);router[_0xf4ce('0x8')]('/describe',auth[_0xf4ce('0x9')](),controller['describe']);router[_0xf4ce('0x8')]('/:id',auth[_0xf4ce('0x9')](),controller[_0xf4ce('0xb')]);router[_0xf4ce('0x8')](_0xf4ce('0xc'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0xd')]);router[_0xf4ce('0x8')](_0xf4ce('0xe'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0xf')]);router[_0xf4ce('0x8')](_0xf4ce('0x10'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x11')]);router['get'](_0xf4ce('0x12'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x13')]);router[_0xf4ce('0x8')](_0xf4ce('0x14'),auth['isAuthenticated'](),controller[_0xf4ce('0x15')]);router[_0xf4ce('0x8')](_0xf4ce('0x16'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf4ce('0x8')](_0xf4ce('0x17'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x18')]);router[_0xf4ce('0x8')](_0xf4ce('0x19'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x1a')]);router['get'](_0xf4ce('0x1b'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x1c')]);router[_0xf4ce('0x1d')](_0xf4ce('0xc'),auth[_0xf4ce('0x9')](),controller['addDisposition']);router[_0xf4ce('0x1d')](_0xf4ce('0xe'),auth['isAuthenticated'](),controller[_0xf4ce('0x1e')]);router['post']('/',auth[_0xf4ce('0x9')](),controller['create']);router[_0xf4ce('0x1d')]('/:id/in_servers',auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x1f')]);router['post'](_0xf4ce('0x12'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x20')]);router[_0xf4ce('0x1d')](_0xf4ce('0x14'),auth[_0xf4ce('0x9')](),controller['addInteraction']);router[_0xf4ce('0x1d')](_0xf4ce('0x16'),auth['isAuthenticated'](),controller[_0xf4ce('0x21')]);router[_0xf4ce('0x1d')](_0xf4ce('0x22'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x23')]);router[_0xf4ce('0x1d')]('/:id/users',auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x24')]);router[_0xf4ce('0x25')]('/:id',auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x26')]);router[_0xf4ce('0x27')]('/:id/dispositions',auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x28')]);router[_0xf4ce('0x27')](_0xf4ce('0xe'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xf4ce('0x27')](_0xf4ce('0x10'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x29')]);router[_0xf4ce('0x27')]('/:id/out_servers',auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x2a')]);router[_0xf4ce('0x27')](_0xf4ce('0x2b'),auth[_0xf4ce('0x9')](),controller[_0xf4ce('0x2c')]);router[_0xf4ce('0x27')](_0xf4ce('0x1b'),auth[_0xf4ce('0x9')](),controller['removeAgents']);module[_0xf4ce('0x2d')]=router;
\ No newline at end of file
+var _0x9e7f=['../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','addDisposition','addAnswer','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x118064,_0x37e68d){var _0x21c5cc=function(_0x401411){while(--_0x401411){_0x118064['push'](_0x118064['shift']());}};_0x21c5cc(++_0x37e68d);}(_0x9e7f,0xaa));var _0xf9e7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9e7f[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf9e7('0x0'));var timeout=require(_0xf9e7('0x1'));var express=require(_0xf9e7('0x2'));var router=express[_0xf9e7('0x3')]();var auth=require(_0xf9e7('0x4'));var interaction=require(_0xf9e7('0x5'));var config=require(_0xf9e7('0x6'));var controller=require(_0xf9e7('0x7'));router[_0xf9e7('0x8')]('/',auth['isAuthenticated'](),controller[_0xf9e7('0x9')]);router[_0xf9e7('0x8')](_0xf9e7('0xa'),auth[_0xf9e7('0xb')](),controller['describe']);router[_0xf9e7('0x8')](_0xf9e7('0xc'),auth['isAuthenticated'](),controller[_0xf9e7('0xd')]);router['get'](_0xf9e7('0xe'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0xf')]);router[_0xf9e7('0x8')](_0xf9e7('0x10'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x11')]);router[_0xf9e7('0x8')](_0xf9e7('0x12'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x13')]);router[_0xf9e7('0x8')](_0xf9e7('0x14'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x15')]);router['get'](_0xf9e7('0x16'),auth[_0xf9e7('0xb')](),controller['getInteractions']);router[_0xf9e7('0x8')](_0xf9e7('0x17'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x18')]);router[_0xf9e7('0x8')](_0xf9e7('0x19'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x1a')]);router['get']('/:id/verify',auth[_0xf9e7('0xb')](),controller['verifySmtp']);router['get'](_0xf9e7('0x1b'),auth[_0xf9e7('0xb')](),controller['getAgents']);router[_0xf9e7('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf9e7('0x1d')]);router[_0xf9e7('0x1c')](_0xf9e7('0x10'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x1e')]);router[_0xf9e7('0x1c')]('/',auth[_0xf9e7('0xb')](),controller['create']);router[_0xf9e7('0x1c')](_0xf9e7('0x12'),auth['isAuthenticated'](),controller[_0xf9e7('0x1f')]);router[_0xf9e7('0x1c')](_0xf9e7('0x14'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x20')]);router['post']('/:id/interactions',auth[_0xf9e7('0xb')](),controller['addInteraction']);router[_0xf9e7('0x1c')](_0xf9e7('0x17'),auth['isAuthenticated'](),controller[_0xf9e7('0x21')]);router[_0xf9e7('0x1c')](_0xf9e7('0x22'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x23')]);router[_0xf9e7('0x1c')](_0xf9e7('0x1b'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x24')]);router[_0xf9e7('0x25')](_0xf9e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf9e7('0x26')](_0xf9e7('0xe'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x27')]);router[_0xf9e7('0x26')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf9e7('0x28')]);router['delete']('/:id/in_servers',auth['isAuthenticated'](),controller['removeImap']);router['delete'](_0xf9e7('0x14'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x29')]);router[_0xf9e7('0x26')](_0xf9e7('0xc'),auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x2a')]);router['delete']('/:id/users',auth[_0xf9e7('0xb')](),controller[_0xf9e7('0x2b')]);module['exports']=router;
\ No newline at end of file
index 79cd1ee..b002dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x998d=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x419b9b,_0x4be507){var _0x40b707=function(_0x1c5484){while(--_0x1c5484){_0x419b9b['push'](_0x419b9b['shift']());}};_0x40b707(++_0x4be507);}(_0x998d,0xdf));var _0xd998=function(_0x5aa825,_0x362f2f){_0x5aa825=_0x5aa825-0x0;var _0x28b831=_0x998d[_0x5aa825];return _0x28b831;};'use strict';var Sequelize=require(_0xd998('0x0'));module[_0xd998('0x1')]={'description':{'type':Sequelize[_0xd998('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xd998('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xd998('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xd998('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd998('0x2')],'allowNull':![],'defaultValue':_0xd998('0x4')},'fontSize':{'type':Sequelize[_0xd998('0x5')](0x2)[_0xd998('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd998('0x7');}},'notificationSound':{'type':Sequelize[_0xd998('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd998('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd998('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd998('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd998('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd998('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xd998('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xd998('0x3')],'defaultValue':![],'comment':_0xd998('0x9'),'set':function(_0x3673b2){if(!_0x3673b2)this[_0xd998('0xa')](_0xd998('0xb'),null);this[_0xd998('0xa')](_0xd998('0xc'),_0x3673b2);}}};
\ No newline at end of file
+var _0xb7d6=['BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','STRING'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb7d6,0x1ab));var _0x6b7d=function(_0x69e89e,_0x1fb302){_0x69e89e=_0x69e89e-0x0;var _0x39b87d=_0xb7d6[_0x69e89e];return _0x39b87d;};'use strict';var Sequelize=require(_0x6b7d('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x6b7d('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x6b7d('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x6b7d('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x6b7d('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x6b7d('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x6b7d('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6b7d('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x6b7d('0x4')](0x2)[_0x6b7d('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6b7d('0x3')],'defaultValue':function(){return _0x6b7d('0x6');}},'notificationSound':{'type':Sequelize[_0x6b7d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6b7d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b7d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6b7d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b7d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6b7d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6b7d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b7d('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x6b7d('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6b7d('0x8'),'set':function(_0x928663){if(!_0x928663)this[_0x6b7d('0x9')](_0x6b7d('0xa'),null);this[_0x6b7d('0x9')]('mandatoryDisposition',_0x928663);}}};
\ No newline at end of file
index e652236..dad60ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d31=['socket.io-emitter','register','jayson/promise','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','MailAccounts','stack','name','send','index','MailServerIn','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','rows','show','params','Imap','Pause','fields','include','find','body','update','describe','addDisposition','Disposition','getDispositions','findOne','MailAccountId','options','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','create','email','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','host','port','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','tag','addApplications','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','split','CmList','List','Contacts','updatedAt','DESC','from','attachments','join','root','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','defaults','subject','attach','out','messageId','Messages','verifySmtp','authentication','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost'];(function(_0xd598e9,_0x20cb54){var _0x12c224=function(_0x5046e1){while(--_0x5046e1){_0xd598e9['push'](_0xd598e9['shift']());}};_0x12c224(++_0x20cb54);}(_0x5d31,0x16c));var _0x15d3=function(_0x4ea6ae,_0x2644d0){_0x4ea6ae=_0x4ea6ae-0x0;var _0x17704b=_0x5d31[_0x4ea6ae];return _0x17704b;};'use strict';var pdf=require(_0x15d3('0x0'));var emlformat=require(_0x15d3('0x1'));var rimraf=require(_0x15d3('0x2'));var zipdir=require(_0x15d3('0x3'));var jsonpatch=require(_0x15d3('0x4'));var rp=require('request-promise');var moment=require(_0x15d3('0x5'));var BPromise=require(_0x15d3('0x6'));var Mustache=require('mustache');var util=require(_0x15d3('0x7'));var path=require(_0x15d3('0x8'));var sox=require(_0x15d3('0x9'));var csv=require(_0x15d3('0xa'));var ejs=require(_0x15d3('0xb'));var fs=require('fs');var _=require(_0x15d3('0xc'));var squel=require('squel');var crypto=require(_0x15d3('0xd'));var jsforce=require(_0x15d3('0xe'));var deskjs=require(_0x15d3('0xf'));var toCsv=require(_0x15d3('0xa'));var querystring=require('querystring');var Papa=require(_0x15d3('0x10'));var Redis=require('ioredis');var authService=require(_0x15d3('0x11'));var qs=require(_0x15d3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d3('0x13'));var logger=require(_0x15d3('0x14'))(_0x15d3('0x15'));var utils=require(_0x15d3('0x16'));var config=require(_0x15d3('0x17'));var db=require('../../mysqldb')['db'];config[_0x15d3('0x18')]=_['defaults'](config[_0x15d3('0x18')],{'host':_0x15d3('0x19'),'port':0x18eb});var socket=require(_0x15d3('0x1a'))(new Redis(config[_0x15d3('0x18')]));require('./mailAccount.socket')[_0x15d3('0x1b')](socket);var jayson=require(_0x15d3('0x1c'));var client=jayson[_0x15d3('0x1d')]['http']({'port':0x232b});function checkPasswordPattern(_0x2d9bed,_0x31e766,_0x2d2809){if(_0x2d2809){var _0x4cf918=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cf918[_0x15d3('0x1e')](_0x31e766)){return _0x2d9bed;}else{throw new db['Sequelize'][(_0x15d3('0x1f'))](_0x15d3('0x20'));}}else{return _0x2d9bed;}}function respondWithRpcPromise(_0x28d34e,_0x5335a8,_0x38e857,_0x4f29af){return new BPromise(function(_0x1bdb1c,_0x317408){var _0x1a153e=_0x4f29af||client;return _0x1a153e[_0x15d3('0x21')](_0x28d34e,_0x38e857)['then'](function(_0x588592){logger[_0x15d3('0x22')](_0x15d3('0x23'),_0x5335a8,_0x15d3('0x24'));logger[_0x15d3('0x25')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5335a8,'request\x20sent',JSON[_0x15d3('0x26')](_0x588592));if(_0x588592[_0x15d3('0x27')]){if(_0x588592[_0x15d3('0x27')][_0x15d3('0x28')]===0x1f4){logger[_0x15d3('0x27')](_0x15d3('0x23'),_0x5335a8,_0x588592[_0x15d3('0x27')]['message']);return _0x317408(_0x588592[_0x15d3('0x27')]['message']);}logger[_0x15d3('0x27')](_0x15d3('0x23'),_0x5335a8,_0x588592[_0x15d3('0x27')][_0x15d3('0x29')]);return _0x1bdb1c(_0x588592[_0x15d3('0x27')][_0x15d3('0x29')]);}else{logger[_0x15d3('0x22')](_0x15d3('0x23'),_0x5335a8,_0x15d3('0x24'));_0x1bdb1c(_0x588592[_0x15d3('0x2a')][_0x15d3('0x29')]);}})[_0x15d3('0x2b')](function(_0x4c69dd){logger[_0x15d3('0x27')]('MailAccount,\x20%s,\x20%s',_0x5335a8,_0x4c69dd);_0x317408(_0x4c69dd);});});}function respondWithStatusCode(_0x43c97b,_0x31cfce){_0x31cfce=_0x31cfce||0xcc;return function(_0x2c7272){if(_0x2c7272){return _0x43c97b[_0x15d3('0x2c')](_0x31cfce);}return _0x43c97b[_0x15d3('0x2d')](_0x31cfce)[_0x15d3('0x2e')]();};}function respondWithResult(_0x22776f,_0x662c78){_0x662c78=_0x662c78||0xc8;return function(_0x3cc272){if(_0x3cc272){return _0x22776f[_0x15d3('0x2d')](_0x662c78)['json'](_0x3cc272);}};}function respondWithFilteredResult(_0x122ed0,_0x1c9950){return function(_0x448bf0){if(_0x448bf0){var _0x539f34=_0x448bf0[_0x15d3('0x2f')],_0x298e2c=_0x1c9950[_0x15d3('0x30')],_0x473203=_0x1c9950[_0x15d3('0x30')]+_0x1c9950[_0x15d3('0x31')],_0x46eb2a;if(_0x473203>=_0x539f34){_0x473203=_0x539f34;_0x46eb2a=0xc8;}else{_0x46eb2a=0xce;}_0x122ed0[_0x15d3('0x2d')](_0x46eb2a);return _0x122ed0[_0x15d3('0x32')](_0x15d3('0x33'),_0x298e2c+'-'+_0x473203+'/'+_0x539f34)[_0x15d3('0x34')](_0x448bf0);}return null;};}function patchUpdates(_0x61e842){return function(_0x4c5f9b){try{jsonpatch[_0x15d3('0x35')](_0x4c5f9b,_0x61e842,!![]);}catch(_0x9b37a1){return BPromise[_0x15d3('0x36')](_0x9b37a1);}return _0x4c5f9b[_0x15d3('0x37')]();};}function saveUpdates(_0xcff562,_0x570041){return function(_0x367203){if(_0x367203){return _0x367203['update'](_0xcff562)[_0x15d3('0x38')](function(_0x144d80){return _0x144d80;});}return null;};}function removeEntity(_0x186f07,_0x3401e4){return function(_0x305d2d){if(_0x305d2d){return _0x305d2d[_0x15d3('0x39')]()[_0x15d3('0x38')](function(){var _0x43b1c2=_0x305d2d['get']({'plain':!![]});var _0x31077f=_0x15d3('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x31077f,'resourceId':_0x43b1c2['id']}})[_0x15d3('0x38')](function(){return _0x305d2d;});})['then'](function(){_0x186f07[_0x15d3('0x2d')](0xcc)[_0x15d3('0x2e')]();});}};}function handleEntityNotFound(_0x3fa574,_0x3ac390){return function(_0x1671ca){if(!_0x1671ca){_0x3fa574['sendStatus'](0x194);}return _0x1671ca;};}function handleError(_0x2f4439,_0x20721a){_0x20721a=_0x20721a||0x1f4;return function(_0x36aa4f){logger['error'](_0x36aa4f[_0x15d3('0x3b')]);if(_0x36aa4f[_0x15d3('0x3c')]){delete _0x36aa4f[_0x15d3('0x3c')];}_0x2f4439[_0x15d3('0x2d')](_0x20721a)[_0x15d3('0x3d')](_0x36aa4f);};}exports[_0x15d3('0x3e')]=function(_0x583921,_0x44a5c9){var _0x7c2608={'include':[{'model':db[_0x15d3('0x3f')],'as':'Imap'},{'model':db[_0x15d3('0x40')],'as':_0x15d3('0x41')},{'model':db['Pause'],'as':_0x15d3('0x42')}]},_0x32de52={},_0x21313b={'count':0x0,'rows':[]};var _0x3e7df9=_[_0x15d3('0x43')](db[_0x15d3('0x44')][_0x15d3('0x45')],function(_0x2b3b58){return{'name':_0x2b3b58[_0x15d3('0x46')],'type':_0x2b3b58['type'][_0x15d3('0x47')]};});_0x32de52['model']=_[_0x15d3('0x43')](_0x3e7df9,'name');_0x32de52[_0x15d3('0x48')]=_[_0x15d3('0x49')](_0x583921[_0x15d3('0x48')]);_0x32de52[_0x15d3('0x4a')]=_[_0x15d3('0x4b')](_0x32de52[_0x15d3('0x4c')],_0x32de52[_0x15d3('0x48')]);_0x7c2608[_0x15d3('0x4d')]=_['intersection'](_0x32de52[_0x15d3('0x4c')],qs['fields'](_0x583921[_0x15d3('0x48')]['fields']));_0x7c2608['attributes']=_0x7c2608[_0x15d3('0x4d')][_0x15d3('0x4e')]?_0x7c2608['attributes']:_0x32de52[_0x15d3('0x4c')];if(!_0x583921['query'][_0x15d3('0x4f')](_0x15d3('0x50'))){_0x7c2608['limit']=qs[_0x15d3('0x31')](_0x583921[_0x15d3('0x48')][_0x15d3('0x31')]);_0x7c2608[_0x15d3('0x30')]=qs['offset'](_0x583921['query']['offset']);}_0x7c2608[_0x15d3('0x51')]=qs[_0x15d3('0x52')](_0x583921[_0x15d3('0x48')]['sort']);_0x7c2608[_0x15d3('0x53')]=qs[_0x15d3('0x4a')](_[_0x15d3('0x54')](_0x583921['query'],_0x32de52[_0x15d3('0x4a')]),_0x3e7df9);if(_0x583921[_0x15d3('0x48')][_0x15d3('0x55')]){_0x7c2608[_0x15d3('0x53')]=_['merge'](_0x7c2608[_0x15d3('0x53')],{'$or':_[_0x15d3('0x43')](_0x3e7df9,function(_0x3ccbea){if(_0x3ccbea[_0x15d3('0x56')]!==_0x15d3('0x57')){var _0x39d434={};_0x39d434[_0x3ccbea[_0x15d3('0x3c')]]={'$like':'%'+_0x583921[_0x15d3('0x48')]['filter']+'%'};return _0x39d434;}})});}_0x7c2608=_[_0x15d3('0x58')]({},_0x7c2608,_0x583921['options']);var _0x5f05f7={'where':_0x7c2608['where']};return db[_0x15d3('0x44')][_0x15d3('0x2f')](_0x5f05f7)['then'](function(_0x335f57){_0x21313b[_0x15d3('0x2f')]=_0x335f57;if(_0x583921[_0x15d3('0x48')][_0x15d3('0x59')]){_0x7c2608['include']=[{'all':!![]}];}return db[_0x15d3('0x44')]['findAll'](_0x7c2608);})[_0x15d3('0x38')](function(_0x2eb019){_0x21313b[_0x15d3('0x5a')]=_0x2eb019;return _0x21313b;})['then'](respondWithFilteredResult(_0x44a5c9,_0x7c2608))[_0x15d3('0x2b')](handleError(_0x44a5c9,null));};exports[_0x15d3('0x5b')]=function(_0x22df4e,_0x1c5c99){var _0x512e49={'raw':![],'where':{'id':_0x22df4e[_0x15d3('0x5c')]['id']},'include':[{'model':db[_0x15d3('0x3f')],'as':_0x15d3('0x5d')},{'model':db['MailServerOut'],'as':_0x15d3('0x41')},{'model':db[_0x15d3('0x5e')],'as':_0x15d3('0x42')}]},_0x190247={};_0x190247[_0x15d3('0x4c')]=_[_0x15d3('0x49')](db[_0x15d3('0x44')][_0x15d3('0x45')]);_0x190247[_0x15d3('0x48')]=_[_0x15d3('0x49')](_0x22df4e['query']);_0x190247[_0x15d3('0x4a')]=_['intersection'](_0x190247[_0x15d3('0x4c')],_0x190247[_0x15d3('0x48')]);_0x512e49[_0x15d3('0x4d')]=_[_0x15d3('0x4b')](_0x190247[_0x15d3('0x4c')],qs[_0x15d3('0x5f')](_0x22df4e['query'][_0x15d3('0x5f')]));_0x512e49['attributes']=_0x512e49[_0x15d3('0x4d')][_0x15d3('0x4e')]?_0x512e49[_0x15d3('0x4d')]:_0x190247['model'];if(_0x22df4e[_0x15d3('0x48')][_0x15d3('0x59')]){_0x512e49[_0x15d3('0x60')]=[{'all':!![]}];}_0x512e49=_['merge']({},_0x512e49,_0x22df4e['options']);return db[_0x15d3('0x44')][_0x15d3('0x61')](_0x512e49)['then'](handleEntityNotFound(_0x1c5c99,null))[_0x15d3('0x38')](respondWithResult(_0x1c5c99,null))[_0x15d3('0x2b')](handleError(_0x1c5c99,null));};exports['update']=function(_0x22b867,_0x4706a1){if(_0x22b867[_0x15d3('0x62')]['id']){delete _0x22b867[_0x15d3('0x62')]['id'];}return db['MailAccount'][_0x15d3('0x61')]({'where':{'id':_0x22b867[_0x15d3('0x5c')]['id']},'include':[{'model':db[_0x15d3('0x3f')],'as':'Imap'},{'model':db[_0x15d3('0x40')],'as':'Smtp'},{'model':db[_0x15d3('0x5e')],'as':_0x15d3('0x42')}]})[_0x15d3('0x38')](handleEntityNotFound(_0x4706a1,null))[_0x15d3('0x38')](saveUpdates(_0x22b867[_0x15d3('0x62')],null))[_0x15d3('0x38')](function(_0x2fedd7){if(_0x2fedd7&&_0x22b867[_0x15d3('0x62')][_0x15d3('0x5d')]){return db[_0x15d3('0x3f')]['update'](_0x22b867[_0x15d3('0x62')][_0x15d3('0x5d')],{'where':{'MailAccountId':_0x2fedd7['id']}})['then'](function(){return _0x2fedd7;});}return _0x2fedd7;})['then'](function(_0x2f9fb1){if(_0x2f9fb1&&_0x22b867[_0x15d3('0x62')][_0x15d3('0x41')]){return db['MailServerOut'][_0x15d3('0x63')](_0x22b867['body'][_0x15d3('0x41')],{'where':{'MailAccountId':_0x2f9fb1['id']}})[_0x15d3('0x38')](function(){return _0x2f9fb1;});}return _0x2f9fb1;})[_0x15d3('0x38')](respondWithResult(_0x4706a1,null))[_0x15d3('0x2b')](handleError(_0x4706a1,null));};exports[_0x15d3('0x64')]=function(_0x234bda,_0x33491d){return db[_0x15d3('0x44')]['describe']()[_0x15d3('0x38')](respondWithResult(_0x33491d,null))[_0x15d3('0x2b')](handleError(_0x33491d,null));};exports[_0x15d3('0x65')]=function(_0x3dbe51,_0x1b6d32,_0x2be25c){if(_0x3dbe51[_0x15d3('0x62')]['id']){delete _0x3dbe51[_0x15d3('0x62')]['id'];}return db[_0x15d3('0x44')]['find']({'where':{'id':_0x3dbe51[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x1b6d32,null))[_0x15d3('0x38')](function(_0x3484a2){if(_0x3484a2){_0x3dbe51[_0x15d3('0x62')]['MailAccountId']=_0x3484a2['id'];return db[_0x15d3('0x66')]['create'](_0x3dbe51[_0x15d3('0x62')]);}})[_0x15d3('0x38')](respondWithResult(_0x1b6d32,null))[_0x15d3('0x2b')](handleError(_0x1b6d32,null));};exports[_0x15d3('0x67')]=function(_0x5bfb20,_0x46aa9f,_0xb9bc4e){var _0x3c5a0d={'raw':![],'where':{}};var _0x25eaba={};var _0x7bdcc5={'count':0x0,'rows':[]};return db['MailAccount'][_0x15d3('0x68')]({'where':{'id':_0x5bfb20['params']['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x46aa9f,null))[_0x15d3('0x38')](function(_0x16dd6e){if(_0x16dd6e){_0x25eaba['model']=_[_0x15d3('0x49')](db[_0x15d3('0x66')][_0x15d3('0x45')]);_0x25eaba[_0x15d3('0x48')]=_[_0x15d3('0x49')](_0x5bfb20['query']);_0x25eaba['filters']=_[_0x15d3('0x4b')](_0x25eaba['model'],_0x25eaba[_0x15d3('0x48')]);_0x3c5a0d[_0x15d3('0x4d')]=_[_0x15d3('0x4b')](_0x25eaba[_0x15d3('0x4c')],qs[_0x15d3('0x5f')](_0x5bfb20[_0x15d3('0x48')][_0x15d3('0x5f')]));_0x3c5a0d['attributes']=_0x3c5a0d[_0x15d3('0x4d')][_0x15d3('0x4e')]?_0x3c5a0d[_0x15d3('0x4d')]:_0x25eaba['model'];if(!_0x5bfb20[_0x15d3('0x48')][_0x15d3('0x4f')](_0x15d3('0x50'))){_0x3c5a0d[_0x15d3('0x31')]=qs['limit'](_0x5bfb20['query']['limit']);_0x3c5a0d[_0x15d3('0x30')]=qs[_0x15d3('0x30')](_0x5bfb20[_0x15d3('0x48')][_0x15d3('0x30')]);}_0x3c5a0d[_0x15d3('0x51')]=qs['sort'](_0x5bfb20['query'][_0x15d3('0x52')]);_0x3c5a0d[_0x15d3('0x53')]=qs[_0x15d3('0x4a')](_['pick'](_0x5bfb20[_0x15d3('0x48')],_0x25eaba[_0x15d3('0x4a')]));_0x3c5a0d[_0x15d3('0x53')][_0x15d3('0x69')]=_0x16dd6e['id'];if(_0x5bfb20[_0x15d3('0x48')][_0x15d3('0x55')]){_0x3c5a0d['where']=_[_0x15d3('0x58')](_0x3c5a0d[_0x15d3('0x53')],{'$or':_[_0x15d3('0x43')](_0x3c5a0d[_0x15d3('0x4d')],function(_0x3167ce){var _0x3b6a9d={};_0x3b6a9d[_0x3167ce]={'$like':'%'+_0x5bfb20[_0x15d3('0x48')][_0x15d3('0x55')]+'%'};return _0x3b6a9d;})});}_0x3c5a0d=_[_0x15d3('0x58')]({},_0x3c5a0d,_0x5bfb20[_0x15d3('0x6a')]);return db[_0x15d3('0x66')][_0x15d3('0x2f')]({'where':_0x3c5a0d[_0x15d3('0x53')]})[_0x15d3('0x38')](function(_0x26e759){_0x7bdcc5[_0x15d3('0x2f')]=_0x26e759;if(_0x5bfb20[_0x15d3('0x48')][_0x15d3('0x59')]){_0x3c5a0d[_0x15d3('0x60')]=[{'all':!![]}];}return db[_0x15d3('0x66')][_0x15d3('0x6b')](_0x3c5a0d);})[_0x15d3('0x38')](function(_0x25026a){_0x7bdcc5[_0x15d3('0x5a')]=_0x25026a;return _0x7bdcc5;});}})[_0x15d3('0x38')](respondWithFilteredResult(_0x46aa9f,_0x3c5a0d))[_0x15d3('0x2b')](handleError(_0x46aa9f,null));};exports[_0x15d3('0x6c')]=function(_0x43148f,_0x223a59,_0x3c269f){return db[_0x15d3('0x44')]['find']({'where':{'id':_0x43148f[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x223a59,null))['then'](function(_0x46132e){if(_0x46132e){return _0x46132e['removeDispositions'](_0x43148f[_0x15d3('0x48')][_0x15d3('0x6d')]);}})['then'](respondWithStatusCode(_0x223a59,null))[_0x15d3('0x2b')](handleError(_0x223a59,null));};exports[_0x15d3('0x6e')]=function(_0x1382a3,_0x2950c7,_0x1992b2){if(_0x1382a3['body']['id']){delete _0x1382a3[_0x15d3('0x62')]['id'];}return db[_0x15d3('0x44')]['find']({'where':{'id':_0x1382a3['params']['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x2950c7,null))['then'](function(_0x316e4f){if(_0x316e4f){_0x1382a3['body'][_0x15d3('0x69')]=_0x316e4f['id'];return db[_0x15d3('0x6f')]['create'](_0x1382a3[_0x15d3('0x62')]);}})[_0x15d3('0x38')](respondWithResult(_0x2950c7,null))[_0x15d3('0x2b')](handleError(_0x2950c7,null));};exports['getAnswers']=function(_0xaf4260,_0x583da5,_0x5825bd){var _0x130427={'raw':![],'where':{}};var _0x8d45c7={};var _0x4253b0={'count':0x0,'rows':[]};return db[_0x15d3('0x44')][_0x15d3('0x68')]({'where':{'id':_0xaf4260[_0x15d3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x583da5,null))[_0x15d3('0x38')](function(_0xdf9162){if(_0xdf9162){_0x8d45c7[_0x15d3('0x4c')]=_['keys'](db[_0x15d3('0x6f')][_0x15d3('0x45')]);_0x8d45c7[_0x15d3('0x48')]=_['keys'](_0xaf4260[_0x15d3('0x48')]);_0x8d45c7['filters']=_[_0x15d3('0x4b')](_0x8d45c7[_0x15d3('0x4c')],_0x8d45c7[_0x15d3('0x48')]);_0x130427[_0x15d3('0x4d')]=_[_0x15d3('0x4b')](_0x8d45c7[_0x15d3('0x4c')],qs[_0x15d3('0x5f')](_0xaf4260['query']['fields']));_0x130427[_0x15d3('0x4d')]=_0x130427['attributes'][_0x15d3('0x4e')]?_0x130427['attributes']:_0x8d45c7[_0x15d3('0x4c')];if(!_0xaf4260['query'][_0x15d3('0x4f')](_0x15d3('0x50'))){_0x130427[_0x15d3('0x31')]=qs[_0x15d3('0x31')](_0xaf4260[_0x15d3('0x48')]['limit']);_0x130427['offset']=qs[_0x15d3('0x30')](_0xaf4260['query'][_0x15d3('0x30')]);}_0x130427[_0x15d3('0x51')]=qs[_0x15d3('0x52')](_0xaf4260[_0x15d3('0x48')][_0x15d3('0x52')]);_0x130427['where']=qs[_0x15d3('0x4a')](_[_0x15d3('0x54')](_0xaf4260[_0x15d3('0x48')],_0x8d45c7['filters']));_0x130427[_0x15d3('0x53')][_0x15d3('0x69')]=_0xdf9162['id'];if(_0xaf4260['query'][_0x15d3('0x55')]){_0x130427[_0x15d3('0x53')]=_[_0x15d3('0x58')](_0x130427[_0x15d3('0x53')],{'$or':_['map'](_0x130427[_0x15d3('0x4d')],function(_0x5d11e7){var _0x240052={};_0x240052[_0x5d11e7]={'$like':'%'+_0xaf4260[_0x15d3('0x48')]['filter']+'%'};return _0x240052;})});}_0x130427=_['merge']({},_0x130427,_0xaf4260[_0x15d3('0x6a')]);return db[_0x15d3('0x6f')][_0x15d3('0x2f')]({'where':_0x130427[_0x15d3('0x53')]})[_0x15d3('0x38')](function(_0x3f9013){_0x4253b0[_0x15d3('0x2f')]=_0x3f9013;if(_0xaf4260[_0x15d3('0x48')][_0x15d3('0x59')]){_0x130427[_0x15d3('0x60')]=[{'all':!![]}];}return db[_0x15d3('0x6f')][_0x15d3('0x6b')](_0x130427);})['then'](function(_0x567e82){_0x4253b0['rows']=_0x567e82;return _0x4253b0;});}})[_0x15d3('0x38')](respondWithFilteredResult(_0x583da5,_0x130427))[_0x15d3('0x2b')](handleError(_0x583da5,null));};exports[_0x15d3('0x70')]=function(_0xc219f7,_0x726c9f,_0x1b7607){return db['MailAccount'][_0x15d3('0x61')]({'where':{'id':_0xc219f7['params']['id']}})['then'](handleEntityNotFound(_0x726c9f,null))[_0x15d3('0x38')](function(_0x1c2dce){if(_0x1c2dce){return _0x1c2dce[_0x15d3('0x70')](_0xc219f7['query'][_0x15d3('0x6d')]);}})[_0x15d3('0x38')](respondWithStatusCode(_0x726c9f,null))[_0x15d3('0x2b')](handleError(_0x726c9f,null));};exports[_0x15d3('0x71')]=function(_0xfbc38f,_0x24344c){var _0x5c3d03={'name':_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x3c')],'key':_0xfbc38f['body'][_0x15d3('0x47')],'email':_0xfbc38f['body'][_0x15d3('0x72')],'ListId':_0xfbc38f[_0x15d3('0x62')]['ListId'],'active':!_[_0x15d3('0x73')](_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x74')])?_0xfbc38f[_0x15d3('0x62')]['active']:!![],'description':_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x75')]||null,'Imap':{},'Smtp':{}};if(_[_0x15d3('0x73')](_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x76')])){if(_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x77')]){_0x5c3d03[_0x15d3('0x5d')][_0x15d3('0x78')]=_0x5c3d03[_0x15d3('0x41')][_0x15d3('0x78')]=_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x79')];_0x5c3d03[_0x15d3('0x5d')][_0x15d3('0x7a')]=_0x5c3d03[_0x15d3('0x41')][_0x15d3('0x7b')]=_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x7c')];}else{_0x5c3d03[_0x15d3('0x5d')]['authentication']=_0x5c3d03[_0x15d3('0x41')]['authentication']=![];}_0x5c3d03[_0x15d3('0x5d')][_0x15d3('0x7d')]=_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x5d')][_0x15d3('0x7d')];_0x5c3d03[_0x15d3('0x5d')]['port']=_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x5d')][_0x15d3('0x7e')];_0x5c3d03[_0x15d3('0x41')][_0x15d3('0x7d')]=_0xfbc38f[_0x15d3('0x62')]['Smtp'][_0x15d3('0x7d')];_0x5c3d03[_0x15d3('0x41')][_0x15d3('0x7e')]=_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x41')][_0x15d3('0x7e')];}else{_0x5c3d03['Imap']['service']=_0x5c3d03['Smtp'][_0x15d3('0x7f')]=_0xfbc38f[_0x15d3('0x62')][_0x15d3('0x76')];_0x5c3d03[_0x15d3('0x5d')]['user']=_0x5c3d03[_0x15d3('0x41')][_0x15d3('0x78')]=_0xfbc38f[_0x15d3('0x62')]['cuser'];_0x5c3d03['Imap']['password']=_0x5c3d03['Smtp'][_0x15d3('0x7b')]=_0xfbc38f[_0x15d3('0x62')]['cpassword'];}return db[_0x15d3('0x44')][_0x15d3('0x71')](_0x5c3d03,{'include':[{'model':db[_0x15d3('0x40')],'as':_0x15d3('0x41')},{'model':db['MailServerIn'],'as':_0x15d3('0x5d')}]})[_0x15d3('0x38')](function(_0x47b54f){var _0x51e3b3=_0xfbc38f[_0x15d3('0x78')][_0x15d3('0x80')]({'plain':!![]});if(!_0x51e3b3)throw new Error(_0x15d3('0x81'));if(_0x51e3b3[_0x15d3('0x82')]===_0x15d3('0x78')){var _0x14f611=_0x47b54f[_0x15d3('0x80')]({'plain':!![]});return db['UserProfileSection'][_0x15d3('0x61')]({'where':{'name':_0x15d3('0x3a'),'userProfileId':_0x51e3b3[_0x15d3('0x83')]},'raw':!![]})[_0x15d3('0x38')](function(_0x14f400){if(_0x14f400&&_0x14f400['autoAssociation']===0x0){return db['UserProfileResource'][_0x15d3('0x71')]({'name':_0x14f611[_0x15d3('0x3c')],'resourceId':_0x14f611['id'],'type':_0x14f400['name'],'sectionId':_0x14f400['id']},{})[_0x15d3('0x38')](function(){return _0x47b54f;});}else{return _0x47b54f;}})[_0x15d3('0x2b')](function(_0x367008){logger[_0x15d3('0x27')](_0x15d3('0x84'),_0x367008);throw _0x367008;});}return _0x47b54f;})[_0x15d3('0x38')](respondWithResult(_0x24344c,0xc9))[_0x15d3('0x2b')](handleError(_0x24344c,null));};exports[_0x15d3('0x85')]=function(_0x3d17c1,_0x31a9f8,_0x5c17e4){return db[_0x15d3('0x44')][_0x15d3('0x68')]({'where':{'id':_0x3d17c1['params']['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x31a9f8,null))['then'](function(_0x4d3847){if(_0x4d3847){return _0x4d3847[_0x15d3('0x85')]();}return null;})[_0x15d3('0x38')](respondWithResult(_0x31a9f8,null))[_0x15d3('0x2b')](handleError(_0x31a9f8,null));};exports[_0x15d3('0x86')]=function(_0x4676e7,_0x4ff35c,_0x247e26){if(_0x4676e7[_0x15d3('0x62')]['id']){delete _0x4676e7[_0x15d3('0x62')]['id'];}return db[_0x15d3('0x44')]['find']({'where':{'id':_0x4676e7[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x4ff35c,null))['then'](function(_0x4760a2){if(_0x4760a2){_0x4676e7['body'][_0x15d3('0x69')]=_0x4760a2['id'];return db[_0x15d3('0x3f')][_0x15d3('0x71')](_0x4676e7['body']);}})['then'](respondWithResult(_0x4ff35c,null))['catch'](handleError(_0x4ff35c,null));};exports[_0x15d3('0x87')]=function(_0x6598fb,_0x52b06a,_0x4ee7f1){return db[_0x15d3('0x44')][_0x15d3('0x68')]({'where':{'id':_0x6598fb[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x52b06a,null))[_0x15d3('0x38')](function(_0x34397b){if(_0x34397b){return _0x34397b[_0x15d3('0x88')](null);}return null;})[_0x15d3('0x38')](respondWithStatusCode(_0x52b06a,null))[_0x15d3('0x2b')](handleError(_0x52b06a,null));};exports[_0x15d3('0x89')]=function(_0xa8c7aa,_0x65bb6c,_0x4ac61f){return db[_0x15d3('0x44')][_0x15d3('0x68')]({'where':{'id':_0xa8c7aa[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x65bb6c,null))['then'](function(_0x46e1b8){if(_0x46e1b8){return _0x46e1b8['getSmtp']();}return null;})[_0x15d3('0x38')](respondWithResult(_0x65bb6c,null))[_0x15d3('0x2b')](handleError(_0x65bb6c,null));};exports['addSmtp']=function(_0x2b52af,_0x3f027c,_0x58bb67){if(_0x2b52af[_0x15d3('0x62')]['id']){delete _0x2b52af[_0x15d3('0x62')]['id'];}return db[_0x15d3('0x44')][_0x15d3('0x61')]({'where':{'id':_0x2b52af[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x3f027c,null))[_0x15d3('0x38')](function(_0x3575da){if(_0x3575da){_0x2b52af[_0x15d3('0x62')][_0x15d3('0x69')]=_0x3575da['id'];return db[_0x15d3('0x40')]['create'](_0x2b52af[_0x15d3('0x62')]);}})[_0x15d3('0x38')](respondWithResult(_0x3f027c,null))['catch'](handleError(_0x3f027c,null));};exports['removeSmtp']=function(_0x268a2c,_0x10de5c,_0x50e159){return db[_0x15d3('0x44')][_0x15d3('0x68')]({'where':{'id':_0x268a2c[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x10de5c,null))[_0x15d3('0x38')](function(_0x3995b5){if(_0x3995b5){return _0x3995b5[_0x15d3('0x8a')](null);}return null;})[_0x15d3('0x38')](respondWithStatusCode(_0x10de5c,null))[_0x15d3('0x2b')](handleError(_0x10de5c,null));};exports['addInteraction']=function(_0x26b865,_0x139c75,_0x1b3cd5){return db[_0x15d3('0x8b')]['find']({'where':{'id':_0x26b865[_0x15d3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x139c75,null))['then'](function(_0x127825){if(_0x127825){return _0x127825[_0x15d3('0x8c')](_0x26b865[_0x15d3('0x62')][_0x15d3('0x6d')],_[_0x15d3('0x8d')](_0x26b865[_0x15d3('0x62')],[_0x15d3('0x6d'),'id'])||{});}})[_0x15d3('0x38')](respondWithResult(_0x139c75,null))[_0x15d3('0x2b')](handleError(_0x139c75,null));};exports[_0x15d3('0x8e')]=function(_0x5a11d8,_0x249bc9,_0x38cc5b){var _0x403670={'raw':![],'where':{}};var _0x8610a6={};var _0x1df6e9={'count':0x0,'rows':[]};return db[_0x15d3('0x44')]['findOne']({'where':{'id':_0x5a11d8[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x249bc9,null))[_0x15d3('0x38')](function(_0x14207b){if(_0x14207b){_0x8610a6[_0x15d3('0x4c')]=_['keys'](db[_0x15d3('0x8b')]['rawAttributes']);_0x8610a6[_0x15d3('0x48')]=_['keys'](_0x5a11d8['query']);_0x8610a6['filters']=_['intersection'](_0x8610a6[_0x15d3('0x4c')],_0x8610a6['query']);_0x403670[_0x15d3('0x4d')]=_['intersection'](_0x8610a6[_0x15d3('0x4c')],qs[_0x15d3('0x5f')](_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x5f')]));_0x403670[_0x15d3('0x4d')]=_0x403670[_0x15d3('0x4d')][_0x15d3('0x4e')]?_0x403670[_0x15d3('0x4d')]:_0x8610a6['model'];if(!_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x4f')](_0x15d3('0x50'))){_0x403670[_0x15d3('0x31')]=qs[_0x15d3('0x31')](_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x31')]);_0x403670['offset']=qs[_0x15d3('0x30')](_0x5a11d8['query']['offset']);}_0x403670[_0x15d3('0x51')]=qs[_0x15d3('0x52')](_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x52')]);_0x403670['where']=qs[_0x15d3('0x4a')](_[_0x15d3('0x54')](_0x5a11d8['query'],_0x8610a6['filters']));_0x403670[_0x15d3('0x53')][_0x15d3('0x69')]=_0x14207b['id'];if(_0x5a11d8['query'][_0x15d3('0x55')]){_0x403670['where']=_[_0x15d3('0x58')](_0x403670[_0x15d3('0x53')],{'$or':_[_0x15d3('0x43')](_0x403670[_0x15d3('0x4d')],function(_0x100833){var _0x28b648={};_0x28b648[_0x100833]={'$like':'%'+_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x55')]+'%'};return _0x28b648;})});}_0x403670=_[_0x15d3('0x58')]({},_0x403670,_0x5a11d8[_0x15d3('0x6a')]);return db[_0x15d3('0x8b')]['count']({'where':_0x403670[_0x15d3('0x53')]})[_0x15d3('0x38')](function(_0x4af51a){_0x1df6e9[_0x15d3('0x2f')]=_0x4af51a;if(_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x59')]){_0x403670[_0x15d3('0x60')]=[{'model':db[_0x15d3('0x8f')],'as':_0x15d3('0x90'),'required':![]},{'model':db[_0x15d3('0x91')],'as':_0x15d3('0x92'),'attributes':['name',_0x15d3('0x93'),'internal'],'required':![]},{'model':db[_0x15d3('0x94')],'as':'Tags','attributes':['id',_0x15d3('0x3c'),'color'],'where':_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x95')]?{'id':_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x95')]}:undefined,'required':_0x5a11d8[_0x15d3('0x48')][_0x15d3('0x95')]?!![]:![]}];}return db[_0x15d3('0x8b')][_0x15d3('0x6b')](_0x403670);})[_0x15d3('0x38')](function(_0x562842){_0x1df6e9[_0x15d3('0x5a')]=_0x562842;return _0x1df6e9;});}})[_0x15d3('0x38')](respondWithFilteredResult(_0x249bc9,_0x403670))[_0x15d3('0x2b')](handleError(_0x249bc9,null));};exports[_0x15d3('0x96')]=function(_0x2af374,_0x144a4d,_0x1aa379){return db[_0x15d3('0x44')][_0x15d3('0x68')]({'where':{'id':_0x2af374[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x144a4d,null))['then'](function(_0x2c6bfb){if(_0x2c6bfb){return db['sequelize'][_0x15d3('0x97')](function(_0xb3aefe){return db[_0x15d3('0x98')][_0x15d3('0x39')]({'where':{'MailAccountId':_0x2af374['params']['id']},'transaction':_0xb3aefe})[_0x15d3('0x38')](function(_0x5d2c5e){var _0x574f9b=_['map'](_0x2af374[_0x15d3('0x62')],function(_0x487120){_0x487120[_0x15d3('0x69')]=_0x2af374['params']['id'];return _0x487120;});return db[_0x15d3('0x98')][_0x15d3('0x99')](_0x574f9b,{'transaction':_0xb3aefe});});})['then'](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x2af374[_0x15d3('0x5c')]['id']},'order':_0x15d3('0x9a')});});}})[_0x15d3('0x38')](respondWithResult(_0x144a4d,null))[_0x15d3('0x2b')](handleError(_0x144a4d,null));};exports[_0x15d3('0x9b')]=function(_0x4016c2,_0x419cef,_0x3b1115){var _0x4d6873={};var _0x4f2752={};var _0x568f84;var _0x15edd7;return db[_0x15d3('0x44')][_0x15d3('0x68')]({'where':{'id':_0x4016c2['params']['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x419cef,null))[_0x15d3('0x38')](function(_0x244d08){if(_0x244d08){_0x568f84=_0x244d08;_0x4f2752['model']=_[_0x15d3('0x49')](db[_0x15d3('0x98')][_0x15d3('0x45')]);_0x4f2752[_0x15d3('0x48')]=_[_0x15d3('0x49')](_0x4016c2['query']);_0x4f2752[_0x15d3('0x4a')]=_[_0x15d3('0x4b')](_0x4f2752[_0x15d3('0x4c')],_0x4f2752[_0x15d3('0x48')]);_0x4d6873[_0x15d3('0x4d')]=_[_0x15d3('0x4b')](_0x4f2752[_0x15d3('0x4c')],qs[_0x15d3('0x5f')](_0x4016c2[_0x15d3('0x48')][_0x15d3('0x5f')]));_0x4d6873[_0x15d3('0x4d')]=_0x4d6873[_0x15d3('0x4d')]['length']?_0x4d6873[_0x15d3('0x4d')]:_0x4f2752[_0x15d3('0x4c')];_0x4d6873['order']=qs[_0x15d3('0x52')](_0x4016c2[_0x15d3('0x48')][_0x15d3('0x52')]);_0x4d6873['where']=qs[_0x15d3('0x4a')](_[_0x15d3('0x54')](_0x4016c2['query'],_0x4f2752['filters']));if(_0x4016c2['query'][_0x15d3('0x55')]){_0x4d6873['where']=_[_0x15d3('0x58')](_0x4d6873['where'],{'$or':_[_0x15d3('0x43')](_0x4d6873[_0x15d3('0x4d')],function(_0x201677){var _0x459bc1={};_0x459bc1[_0x201677]={'$like':'%'+_0x4016c2[_0x15d3('0x48')][_0x15d3('0x55')]+'%'};return _0x459bc1;})});}_0x4d6873=_['merge']({},_0x4d6873,_0x4016c2['options']);return _0x568f84[_0x15d3('0x9b')](_0x4d6873);}})[_0x15d3('0x38')](function(_0x351b94){if(_0x351b94){_0x15edd7=_0x351b94[_0x15d3('0x4e')];if(!_0x4016c2[_0x15d3('0x48')][_0x15d3('0x4f')](_0x15d3('0x50'))){_0x4d6873['limit']=qs['limit'](_0x4016c2[_0x15d3('0x48')][_0x15d3('0x31')]);_0x4d6873[_0x15d3('0x30')]=qs[_0x15d3('0x30')](_0x4016c2[_0x15d3('0x48')][_0x15d3('0x30')]);}return _0x568f84[_0x15d3('0x9b')](_0x4d6873);}})[_0x15d3('0x38')](function(_0x110d27){if(_0x110d27){return _0x110d27?{'count':_0x15edd7,'rows':_0x110d27}:null;}})['then'](respondWithResult(_0x419cef,null))[_0x15d3('0x2b')](handleError(_0x419cef,null));};exports[_0x15d3('0x9c')]=function(_0x2fcffc,_0x4b2c95,_0x4f198d){var _0x2aaefb={'raw':!![],'where':{}};var _0x316a74={};var _0x388f0f={'count':0x0,'rows':[]};return db[_0x15d3('0x44')][_0x15d3('0x68')]({'where':{'id':_0x2fcffc['params']['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x4b2c95,null))[_0x15d3('0x38')](function(_0x437258){if(_0x437258){_0x316a74[_0x15d3('0x4c')]=_[_0x15d3('0x49')](db[_0x15d3('0x9d')][_0x15d3('0x45')]);_0x316a74['query']=_[_0x15d3('0x49')](_0x2fcffc['query']);_0x316a74[_0x15d3('0x4a')]=_[_0x15d3('0x4b')](_0x316a74['model'],_0x316a74[_0x15d3('0x48')]);_0x2aaefb[_0x15d3('0x4d')]=_[_0x15d3('0x4b')](_0x316a74[_0x15d3('0x4c')],qs[_0x15d3('0x5f')](_0x2fcffc[_0x15d3('0x48')][_0x15d3('0x5f')]));_0x2aaefb[_0x15d3('0x4d')]=_0x2aaefb[_0x15d3('0x4d')][_0x15d3('0x4e')]?_0x2aaefb[_0x15d3('0x4d')]:_0x316a74['model'];if(!_0x2fcffc['query'][_0x15d3('0x4f')](_0x15d3('0x50'))){_0x2aaefb[_0x15d3('0x31')]=qs[_0x15d3('0x31')](_0x2fcffc[_0x15d3('0x48')]['limit']);_0x2aaefb['offset']=qs[_0x15d3('0x30')](_0x2fcffc[_0x15d3('0x48')][_0x15d3('0x30')]);}_0x2aaefb[_0x15d3('0x51')]=qs[_0x15d3('0x52')](_0x2fcffc['query'][_0x15d3('0x52')]);_0x2aaefb['where']=qs[_0x15d3('0x4a')](_[_0x15d3('0x54')](_0x2fcffc['query'],_0x316a74[_0x15d3('0x4a')]));_0x2aaefb[_0x15d3('0x53')]['MailAccountId']=_0x437258['id'];if(_0x2fcffc['query'][_0x15d3('0x55')]){_0x2aaefb[_0x15d3('0x53')]=_[_0x15d3('0x58')](_0x2aaefb[_0x15d3('0x53')],{'$or':_['map'](_0x2aaefb[_0x15d3('0x4d')],function(_0x56c081){var _0x12814b={};_0x12814b[_0x56c081]={'$like':'%'+_0x2fcffc[_0x15d3('0x48')][_0x15d3('0x55')]+'%'};return _0x12814b;})});}if(_0x2fcffc[_0x15d3('0x48')][_0x15d3('0x9e')]){var _0x1c7f59=_0x2fcffc[_0x15d3('0x48')][_0x15d3('0x9e')]['split'](',');var _0x2c2d28={};_0x2c2d28[_0x1c7f59[0x0]]={'$gte':moment(_0x1c7f59[0x1])[_0x15d3('0x9f')](_0x15d3('0xa0'))};_0x2aaefb[_0x15d3('0x53')]=_['merge'](_0x2aaefb['where'],_0x2c2d28);}_0x2aaefb=_['merge']({},_0x2aaefb,_0x2fcffc[_0x15d3('0x6a')]);return db[_0x15d3('0x9d')][_0x15d3('0x2f')]({'where':_0x2aaefb[_0x15d3('0x53')]})[_0x15d3('0x38')](function(_0x449e17){_0x388f0f['count']=_0x449e17;if(_0x2fcffc[_0x15d3('0x48')][_0x15d3('0x59')]){_0x2aaefb[_0x15d3('0x60')]=[{'all':!![]}];}return db[_0x15d3('0x9d')][_0x15d3('0x6b')](_0x2aaefb);})[_0x15d3('0x38')](function(_0x2fc328){_0x388f0f[_0x15d3('0x5a')]=_0x2fc328;return _0x388f0f;});}})[_0x15d3('0x38')](respondWithFilteredResult(_0x4b2c95,_0x2aaefb))[_0x15d3('0x2b')](handleError(_0x4b2c95,null));};exports[_0x15d3('0x3d')]=function(_0x12ee89,_0xdc3c12,_0x2a4e98){var _0xdd10e3,_0x44b85b={},_0x568bdd;if(_0x12ee89[_0x15d3('0x62')]['to']){_0x568bdd=_0x12ee89[_0x15d3('0x62')]['to'][_0x15d3('0xa1')](',')[0x0];}return db[_0x15d3('0x44')]['find']({'where':{'id':_0x12ee89[_0x15d3('0x5c')]['id']},'include':[{'model':db[_0x15d3('0xa2')],'as':_0x15d3('0xa3'),'include':[{'model':db['CmContact'],'as':_0x15d3('0xa4'),'where':{'email':_0x568bdd},'limit':0x1,'order':[[_0x15d3('0xa5'),_0x15d3('0xa6')]]}]},{'model':db['MailServerOut'],'as':_0x15d3('0x41'),'raw':!![]}]})[_0x15d3('0x38')](handleEntityNotFound(_0xdc3c12,null))[_0x15d3('0x38')](function(_0x4cb11c){if(_0x4cb11c){_0xdd10e3=_0x4cb11c;if(_0x4cb11c['Smtp']){if(_['isNil'](_0x12ee89['body'][_0x15d3('0xa7')])){_0x12ee89[_0x15d3('0x62')][_0x15d3('0xa7')]=util[_0x15d3('0x9f')]('%s\x20<%s>',_0x4cb11c['name'],_0x4cb11c[_0x15d3('0x72')]||_0x4cb11c['Smtp'][_0x15d3('0x78')]);}if(_0x12ee89[_0x15d3('0x62')][_0x15d3('0xa8')]&&_0x12ee89[_0x15d3('0x62')][_0x15d3('0xa8')]['length']){for(var _0x2a0a91=0x0;_0x2a0a91<_0x12ee89[_0x15d3('0x62')]['attachments'][_0x15d3('0x4e')];_0x2a0a91+=0x1){_0x12ee89[_0x15d3('0x62')][_0x15d3('0xa8')][_0x2a0a91]={'filename':_0x12ee89['body'][_0x15d3('0xa8')][_0x2a0a91][_0x15d3('0x3c')],'path':path[_0x15d3('0xa9')](config[_0x15d3('0xaa')],'server/files/attachments',_0x12ee89[_0x15d3('0x62')]['attachments'][_0x2a0a91][_0x15d3('0xab')])};}}var _0x4e3b28={'tls':{'rejectUnauthorized':![]}};if(_[_0x15d3('0x73')](_0x4cb11c[_0x15d3('0x41')][_0x15d3('0x7f')])){if(_0x4cb11c['Smtp']['authentication']){_0x4e3b28[_0x15d3('0xac')]={'user':_0x4cb11c[_0x15d3('0x41')]['user'],'pass':_0x4cb11c['Smtp'][_0x15d3('0x7b')]};}_0x4e3b28[_0x15d3('0x7d')]=_0x4cb11c[_0x15d3('0x41')][_0x15d3('0x7d')];_0x4e3b28[_0x15d3('0x7e')]=_0x4cb11c['Smtp'][_0x15d3('0x7e')];_0x4e3b28['secure']=_0x4cb11c[_0x15d3('0x41')][_0x15d3('0xad')];}else{_0x4e3b28[_0x15d3('0x7f')]=_0x4cb11c[_0x15d3('0x41')][_0x15d3('0x7f')];_0x4e3b28['auth']={'user':_0x4cb11c[_0x15d3('0x41')]['user'],'pass':_0x4cb11c[_0x15d3('0x41')][_0x15d3('0x7b')]};}return respondWithRpcPromise(_0x15d3('0xae'),_0x15d3('0xaf'),{'account':_0x4e3b28,'message':_0x12ee89[_0x15d3('0x62')]});}else{throw new Error(_0x15d3('0xb0'));}}})[_0x15d3('0x38')](function(_0x141d26){if(_0x141d26){_0x44b85b=_0x141d26;if(_0xdd10e3['List']){if(_0xdd10e3[_0x15d3('0xa3')][_0x15d3('0xa4')][_0x15d3('0x4e')]){return _0xdd10e3[_0x15d3('0xa3')][_0x15d3('0xa4')][0x0];}else{return db[_0x15d3('0x8f')]['create'](_[_0x15d3('0xb1')](_0x12ee89[_0x15d3('0x62')],{'firstName':_0x12ee89['body']['to'],'email':_0x12ee89[_0x15d3('0x62')]['to'],'phone':_0x12ee89[_0x15d3('0x62')]['to'],'ListId':_0xdd10e3['ListId']}));}}else{throw new Error(_0x15d3('0xb0'));}}})[_0x15d3('0x38')](function(_0x2e2b23){if(_0x2e2b23){var _0x44d194={'UserId':_0x12ee89[_0x15d3('0x78')]['id'],'ContactId':_0x2e2b23['id'],'MailAccountId':_0xdd10e3['id'],'inReplyTo':_0x44b85b['messageId'],'to':_0x12ee89[_0x15d3('0x62')][_0x15d3('0xa7')],'cc':_0x12ee89[_0x15d3('0x62')]['cc'],'subject':_0x12ee89[_0x15d3('0x62')][_0x15d3('0xb2')],'attach':_0x12ee89[_0x15d3('0x62')][_0x15d3('0xb3')],'firstMsgDirection':_0x15d3('0xb4'),'lastMsgAt':moment()[_0x15d3('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','lastMsgBody':_0x12ee89['body'][_0x15d3('0x62')],'Messages':[_[_0x15d3('0x58')](_0x12ee89['body'],{'messageId':_0x44b85b[_0x15d3('0xb5')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xdd10e3['id'],'UserId':_0x12ee89[_0x15d3('0x78')]['id'],'ContactId':_0x2e2b23['id']})]};if(_0x12ee89['body']['Interaction']){_0x44d194=_['merge'](_0x44d194,_0x12ee89[_0x15d3('0x62')]['Interaction']);}return db[_0x15d3('0x8b')][_0x15d3('0x71')](_0x44d194,{'include':[{'model':db['MailMessage'],'as':_0x15d3('0xb6')}]});}})['then'](respondWithResult(_0xdc3c12,null))['catch'](handleError(_0xdc3c12,null));};exports[_0x15d3('0xb7')]=function(_0x85660b,_0x2439f5,_0x3db6ef){return db[_0x15d3('0x44')]['find']({'where':{'id':_0x85660b[_0x15d3('0x5c')]['id']},'include':[{'model':db[_0x15d3('0x40')],'as':_0x15d3('0x41'),'raw':!![]}]})[_0x15d3('0x38')](handleEntityNotFound(_0x2439f5,null))[_0x15d3('0x38')](function(_0x337bb2){if(_0x337bb2&&_0x337bb2[_0x15d3('0x41')]){var _0x5282b5={'id':_0x337bb2['id'],'tls':{'rejectUnauthorized':![]}};if(_0x337bb2[_0x15d3('0x41')]['service']){_0x5282b5[_0x15d3('0x7f')]=_0x337bb2[_0x15d3('0x41')]['service'];}else{_0x5282b5['host']=_0x337bb2[_0x15d3('0x41')]['host'];_0x5282b5[_0x15d3('0x7e')]=_0x337bb2[_0x15d3('0x41')][_0x15d3('0x7e')];_0x5282b5[_0x15d3('0xad')]=_0x337bb2['Smtp'][_0x15d3('0xad')];}if(_0x337bb2[_0x15d3('0x41')][_0x15d3('0xb8')]){_0x5282b5[_0x15d3('0xac')]={'user':_0x337bb2['Smtp'][_0x15d3('0x78')],'pass':_0x337bb2[_0x15d3('0x41')][_0x15d3('0x7b')]};}return respondWithRpcPromise(_0x15d3('0xb9'),'verifySmtp',{'account':_0x5282b5});}})[_0x15d3('0x38')](respondWithResult(_0x2439f5,null))[_0x15d3('0x2b')](handleError(_0x2439f5,null));};exports[_0x15d3('0x39')]=function(_0x595a18,_0x2d6671){return db[_0x15d3('0x44')]['find']({'where':{'id':_0x595a18[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x2d6671,null))[_0x15d3('0x38')](function(_0xcffc5b){if(_0xcffc5b&&_0xcffc5b[_0x15d3('0x7f')]){throw new db['Sequelize'][(_0x15d3('0x1f'))](_0x15d3('0xba'));}return _0xcffc5b;})[_0x15d3('0x38')](removeEntity(_0x2d6671,null))[_0x15d3('0x2b')](handleError(_0x2d6671,null));};exports[_0x15d3('0xbb')]=function(_0x3772f0,_0x361bea,_0x314edc){return db['MailAccount'][_0x15d3('0x61')]({'where':{'id':_0x3772f0[_0x15d3('0x5c')]['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x361bea,null))[_0x15d3('0x38')](function(_0x21dc10){if(_0x21dc10){return _0x21dc10[_0x15d3('0xbb')](_0x3772f0[_0x15d3('0x62')][_0x15d3('0x6d')],_[_0x15d3('0x8d')](_0x3772f0['body'],['ids','id'])||{})[_0x15d3('0xbc')](function(_0x10b962){for(var _0x126174=0x0;_0x126174<_0x3772f0[_0x15d3('0x62')][_0x15d3('0x6d')]['length'];_0x126174+=0x1){socket[_0x15d3('0xbd')](_0x15d3('0xbe'),{'UserId':_0x3772f0[_0x15d3('0x62')][_0x15d3('0x6d')][_0x126174],'MailAccountId':_0x3772f0['params']['id']});}return _0x10b962;});}})['then'](respondWithResult(_0x361bea,null))[_0x15d3('0x2b')](handleError(_0x361bea,null));};exports[_0x15d3('0xbf')]=function(_0x35866f,_0x2d7fb2,_0x992ba2){return db[_0x15d3('0x44')][_0x15d3('0x61')]({'where':{'id':_0x35866f[_0x15d3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2d7fb2,null))[_0x15d3('0x38')](function(_0x409ac9){if(_0x409ac9){return _0x409ac9[_0x15d3('0xbf')](_0x35866f['query'][_0x15d3('0x6d')])[_0x15d3('0x38')](function(){if(_[_0x15d3('0xc0')](_0x35866f[_0x15d3('0x48')][_0x15d3('0x6d')])){for(var _0x1e07d8=0x0;_0x1e07d8<_0x35866f[_0x15d3('0x48')][_0x15d3('0x6d')]['length'];_0x1e07d8+=0x1){socket['emit'](_0x15d3('0xc1'),{'UserId':Number(_0x35866f['query'][_0x15d3('0x6d')][_0x1e07d8]),'MailAccountId':Number(_0x35866f[_0x15d3('0x5c')]['id'])});}}else{socket[_0x15d3('0xbd')](_0x15d3('0xc1'),{'UserId':Number(_0x35866f[_0x15d3('0x48')][_0x15d3('0x6d')]),'MailAccountId':Number(_0x35866f[_0x15d3('0x5c')]['id'])});}});}})[_0x15d3('0x38')](respondWithStatusCode(_0x2d7fb2,null))[_0x15d3('0x2b')](handleError(_0x2d7fb2,null));};exports[_0x15d3('0xc2')]=function(_0xe2181c,_0x5b53cb,_0x2b92be){var _0xe832ac={};var _0x554f9f={};var _0x3c4a99;var _0x58f706;return db['MailAccount'][_0x15d3('0x68')]({'where':{'id':_0xe2181c['params']['id']}})[_0x15d3('0x38')](handleEntityNotFound(_0x5b53cb,null))[_0x15d3('0x38')](function(_0x373751){if(_0x373751){_0x3c4a99=_0x373751;_0x554f9f[_0x15d3('0x4c')]=_['keys'](db[_0x15d3('0x91')][_0x15d3('0x45')]);_0x554f9f['query']=_[_0x15d3('0x49')](_0xe2181c[_0x15d3('0x48')]);_0x554f9f[_0x15d3('0x4a')]=_[_0x15d3('0x4b')](_0x554f9f[_0x15d3('0x4c')],_0x554f9f['query']);_0xe832ac[_0x15d3('0x4d')]=_[_0x15d3('0x4b')](_0x554f9f[_0x15d3('0x4c')],qs[_0x15d3('0x5f')](_0xe2181c[_0x15d3('0x48')][_0x15d3('0x5f')]));_0xe832ac[_0x15d3('0x4d')]=_0xe832ac[_0x15d3('0x4d')]['length']?_0xe832ac[_0x15d3('0x4d')]:_0x554f9f[_0x15d3('0x4c')];_0xe832ac[_0x15d3('0x51')]=qs[_0x15d3('0x52')](_0xe2181c[_0x15d3('0x48')][_0x15d3('0x52')]);_0xe832ac[_0x15d3('0x53')]=qs[_0x15d3('0x4a')](_[_0x15d3('0x54')](_0xe2181c['query'],_0x554f9f['filters']));if(_0xe2181c['query'][_0x15d3('0x55')]){_0xe832ac[_0x15d3('0x53')]=_['merge'](_0xe832ac['where'],{'$or':_[_0x15d3('0x43')](_0xe832ac[_0x15d3('0x4d')],function(_0x5182b2){var _0x53630d={};_0x53630d[_0x5182b2]={'$like':'%'+_0xe2181c[_0x15d3('0x48')][_0x15d3('0x55')]+'%'};return _0x53630d;})});}_0xe832ac=_['merge']({},_0xe832ac,_0xe2181c[_0x15d3('0x6a')]);return _0x3c4a99['getAgents'](_0xe832ac);}})[_0x15d3('0x38')](function(_0xd21ba6){if(_0xd21ba6){_0x58f706=_0xd21ba6[_0x15d3('0x4e')];if(!_0xe2181c['query'][_0x15d3('0x4f')]('nolimit')){_0xe832ac[_0x15d3('0x31')]=qs[_0x15d3('0x31')](_0xe2181c[_0x15d3('0x48')]['limit']);_0xe832ac[_0x15d3('0x30')]=qs[_0x15d3('0x30')](_0xe2181c[_0x15d3('0x48')][_0x15d3('0x30')]);}return _0x3c4a99['getAgents'](_0xe832ac);}})['then'](function(_0x3a77a5){if(_0x3a77a5){return _0x3a77a5?{'count':_0x58f706,'rows':_0x3a77a5}:null;}})[_0x15d3('0x38')](respondWithResult(_0x5b53cb,null))['catch'](handleError(_0x5b53cb,null));};
\ No newline at end of file
+var _0x1b06=['secure','sendMail','List\x20not\x20found','List','ListId','subject','out','format','Interaction','Messages','verifySmtp','VerifySmtp','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','sox','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','test','Sequelize','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','get','MailAccounts','UserProfileResource','sendStatus','stack','name','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','MailAccount','includeAll','findAll','show','body','find','params','describe','addDisposition','Disposition','create','getDispositions','findOne','rawAttributes','hasOwnProperty','MailAccountId','removeDispositions','ids','CannedAnswer','getAnswers','include','removeAnswers','email','isNil','description','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','tag','rows','addApplications','MailApplication','destroy','findAndCountAll','priority','getApplications','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','MailMessage','split','Contacts','updatedAt','from','attachments','join','root','server/files/attachments','basename','auth'];(function(_0x3434a4,_0x4de359){var _0x2a1284=function(_0x24da6c){while(--_0x24da6c){_0x3434a4['push'](_0x3434a4['shift']());}};_0x2a1284(++_0x4de359);}(_0x1b06,0x182));var _0x61b0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b06[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x61b0('0x0'));var emlformat=require(_0x61b0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x61b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61b0('0x3'));var moment=require(_0x61b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61b0('0x5'));var util=require(_0x61b0('0x6'));var path=require('path');var sox=require(_0x61b0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x61b0('0x8'));var jsforce=require(_0x61b0('0x9'));var deskjs=require(_0x61b0('0xa'));var toCsv=require('to-csv');var querystring=require(_0x61b0('0xb'));var Papa=require(_0x61b0('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x61b0('0xd'));var hardwareService=require(_0x61b0('0xe'));var logger=require(_0x61b0('0xf'))(_0x61b0('0x10'));var utils=require(_0x61b0('0x11'));var config=require('../../config/environment');var db=require(_0x61b0('0x12'))['db'];config[_0x61b0('0x13')]=_[_0x61b0('0x14')](config[_0x61b0('0x13')],{'host':_0x61b0('0x15'),'port':0x18eb});var socket=require(_0x61b0('0x16'))(new Redis(config[_0x61b0('0x13')]));require(_0x61b0('0x17'))[_0x61b0('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x61b0('0x19')][_0x61b0('0x1a')]({'port':0x232b});function checkPasswordPattern(_0x15ec58,_0x4b694b,_0x57c45d){if(_0x57c45d){var _0x32c543=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32c543[_0x61b0('0x1b')](_0x4b694b)){return _0x15ec58;}else{throw new db[(_0x61b0('0x1c'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x15ec58;}}function respondWithRpcPromise(_0x22c05e,_0x1c6bb7,_0x3a6cdc,_0x229d46){return new BPromise(function(_0x35cc39,_0x1c451d){var _0x5b341f=_0x229d46||client;return _0x5b341f[_0x61b0('0x1d')](_0x22c05e,_0x3a6cdc)[_0x61b0('0x1e')](function(_0x2241a5){logger['info'](_0x61b0('0x1f'),_0x1c6bb7,_0x61b0('0x20'));logger['debug'](_0x61b0('0x21'),_0x1c6bb7,_0x61b0('0x20'),JSON[_0x61b0('0x22')](_0x2241a5));if(_0x2241a5[_0x61b0('0x23')]){if(_0x2241a5['error'][_0x61b0('0x24')]===0x1f4){logger[_0x61b0('0x23')](_0x61b0('0x1f'),_0x1c6bb7,_0x2241a5[_0x61b0('0x23')][_0x61b0('0x25')]);return _0x1c451d(_0x2241a5[_0x61b0('0x23')][_0x61b0('0x25')]);}logger[_0x61b0('0x23')](_0x61b0('0x1f'),_0x1c6bb7,_0x2241a5['error']['message']);return _0x35cc39(_0x2241a5['error'][_0x61b0('0x25')]);}else{logger[_0x61b0('0x26')](_0x61b0('0x1f'),_0x1c6bb7,_0x61b0('0x20'));_0x35cc39(_0x2241a5[_0x61b0('0x27')][_0x61b0('0x25')]);}})[_0x61b0('0x28')](function(_0x4fa28e){logger['error'](_0x61b0('0x1f'),_0x1c6bb7,_0x4fa28e);_0x1c451d(_0x4fa28e);});});}function respondWithStatusCode(_0x396aba,_0x49e659){_0x49e659=_0x49e659||0xcc;return function(_0x26328d){if(_0x26328d){return _0x396aba['sendStatus'](_0x49e659);}return _0x396aba['status'](_0x49e659)[_0x61b0('0x29')]();};}function respondWithResult(_0x1594dc,_0x4e1e36){_0x4e1e36=_0x4e1e36||0xc8;return function(_0x45fc28){if(_0x45fc28){return _0x1594dc[_0x61b0('0x2a')](_0x4e1e36)[_0x61b0('0x2b')](_0x45fc28);}};}function respondWithFilteredResult(_0x3a5565,_0x1eed6b){return function(_0x336058){if(_0x336058){var _0x22a46f=_0x336058[_0x61b0('0x2c')],_0x15df82=_0x1eed6b['offset'],_0x3674c5=_0x1eed6b[_0x61b0('0x2d')]+_0x1eed6b[_0x61b0('0x2e')],_0x38ae8d;if(_0x3674c5>=_0x22a46f){_0x3674c5=_0x22a46f;_0x38ae8d=0xc8;}else{_0x38ae8d=0xce;}_0x3a5565['status'](_0x38ae8d);return _0x3a5565[_0x61b0('0x2f')](_0x61b0('0x30'),_0x15df82+'-'+_0x3674c5+'/'+_0x22a46f)['json'](_0x336058);}return null;};}function patchUpdates(_0x1f70f2){return function(_0x47b074){try{jsonpatch[_0x61b0('0x31')](_0x47b074,_0x1f70f2,!![]);}catch(_0x57f506){return BPromise['reject'](_0x57f506);}return _0x47b074[_0x61b0('0x32')]();};}function saveUpdates(_0x150bab,_0x48c237){return function(_0x3c970f){if(_0x3c970f){return _0x3c970f[_0x61b0('0x33')](_0x150bab)['then'](function(_0x1e63fb){return _0x1e63fb;});}return null;};}function removeEntity(_0x33a70e,_0xda74b2){return function(_0x2c481b){if(_0x2c481b){return _0x2c481b['destroy']()[_0x61b0('0x1e')](function(){var _0x1bdbec=_0x2c481b[_0x61b0('0x34')]({'plain':!![]});var _0x14a79d=_0x61b0('0x35');return db[_0x61b0('0x36')]['destroy']({'where':{'type':_0x14a79d,'resourceId':_0x1bdbec['id']}})[_0x61b0('0x1e')](function(){return _0x2c481b;});})[_0x61b0('0x1e')](function(){_0x33a70e[_0x61b0('0x2a')](0xcc)[_0x61b0('0x29')]();});}};}function handleEntityNotFound(_0xc087d4,_0x1288c0){return function(_0x260cb0){if(!_0x260cb0){_0xc087d4[_0x61b0('0x37')](0x194);}return _0x260cb0;};}function handleError(_0x31ea9b,_0x2f7b55){_0x2f7b55=_0x2f7b55||0x1f4;return function(_0x4d446f){logger['error'](_0x4d446f[_0x61b0('0x38')]);if(_0x4d446f[_0x61b0('0x39')]){delete _0x4d446f[_0x61b0('0x39')];}_0x31ea9b[_0x61b0('0x2a')](_0x2f7b55)['send'](_0x4d446f);};}exports[_0x61b0('0x3a')]=function(_0x2f0580,_0x9e9f91){var _0x369718={'include':[{'model':db[_0x61b0('0x3b')],'as':_0x61b0('0x3c')},{'model':db[_0x61b0('0x3d')],'as':_0x61b0('0x3e')},{'model':db[_0x61b0('0x3f')],'as':_0x61b0('0x40')}]},_0xe966ea={},_0x4308bd={'count':0x0,'rows':[]};var _0x106b25=_[_0x61b0('0x41')](db['MailAccount']['rawAttributes'],function(_0x465f45){return{'name':_0x465f45[_0x61b0('0x42')],'type':_0x465f45[_0x61b0('0x43')][_0x61b0('0x44')]};});_0xe966ea[_0x61b0('0x45')]=_[_0x61b0('0x41')](_0x106b25,_0x61b0('0x39'));_0xe966ea[_0x61b0('0x46')]=_[_0x61b0('0x47')](_0x2f0580['query']);_0xe966ea['filters']=_['intersection'](_0xe966ea[_0x61b0('0x45')],_0xe966ea[_0x61b0('0x46')]);_0x369718[_0x61b0('0x48')]=_[_0x61b0('0x49')](_0xe966ea['model'],qs[_0x61b0('0x4a')](_0x2f0580[_0x61b0('0x46')][_0x61b0('0x4a')]));_0x369718[_0x61b0('0x48')]=_0x369718[_0x61b0('0x48')][_0x61b0('0x4b')]?_0x369718[_0x61b0('0x48')]:_0xe966ea['model'];if(!_0x2f0580[_0x61b0('0x46')]['hasOwnProperty'](_0x61b0('0x4c'))){_0x369718['limit']=qs[_0x61b0('0x2e')](_0x2f0580[_0x61b0('0x46')][_0x61b0('0x2e')]);_0x369718[_0x61b0('0x2d')]=qs[_0x61b0('0x2d')](_0x2f0580[_0x61b0('0x46')][_0x61b0('0x2d')]);}_0x369718[_0x61b0('0x4d')]=qs['sort'](_0x2f0580[_0x61b0('0x46')][_0x61b0('0x4e')]);_0x369718[_0x61b0('0x4f')]=qs[_0x61b0('0x50')](_[_0x61b0('0x51')](_0x2f0580[_0x61b0('0x46')],_0xe966ea[_0x61b0('0x50')]),_0x106b25);if(_0x2f0580[_0x61b0('0x46')]['filter']){_0x369718[_0x61b0('0x4f')]=_['merge'](_0x369718[_0x61b0('0x4f')],{'$or':_['map'](_0x106b25,function(_0x23dff6){if(_0x23dff6[_0x61b0('0x43')]!==_0x61b0('0x52')){var _0x1cec00={};_0x1cec00[_0x23dff6[_0x61b0('0x39')]]={'$like':'%'+_0x2f0580[_0x61b0('0x46')][_0x61b0('0x53')]+'%'};return _0x1cec00;}})});}_0x369718=_[_0x61b0('0x54')]({},_0x369718,_0x2f0580[_0x61b0('0x55')]);var _0x1be55f={'where':_0x369718[_0x61b0('0x4f')]};return db[_0x61b0('0x56')][_0x61b0('0x2c')](_0x1be55f)[_0x61b0('0x1e')](function(_0x564879){_0x4308bd[_0x61b0('0x2c')]=_0x564879;if(_0x2f0580['query'][_0x61b0('0x57')]){_0x369718['include']=[{'all':!![]}];}return db[_0x61b0('0x56')][_0x61b0('0x58')](_0x369718);})[_0x61b0('0x1e')](function(_0x41d8c2){_0x4308bd['rows']=_0x41d8c2;return _0x4308bd;})[_0x61b0('0x1e')](respondWithFilteredResult(_0x9e9f91,_0x369718))[_0x61b0('0x28')](handleError(_0x9e9f91,null));};exports[_0x61b0('0x59')]=function(_0x395771,_0x341f12){var _0x404e93={'raw':![],'where':{'id':_0x395771['params']['id']},'include':[{'model':db[_0x61b0('0x3b')],'as':_0x61b0('0x3c')},{'model':db[_0x61b0('0x3d')],'as':_0x61b0('0x3e')},{'model':db[_0x61b0('0x3f')],'as':_0x61b0('0x40')}]},_0x1cc43f={};_0x1cc43f[_0x61b0('0x45')]=_[_0x61b0('0x47')](db[_0x61b0('0x56')]['rawAttributes']);_0x1cc43f[_0x61b0('0x46')]=_[_0x61b0('0x47')](_0x395771[_0x61b0('0x46')]);_0x1cc43f['filters']=_['intersection'](_0x1cc43f[_0x61b0('0x45')],_0x1cc43f[_0x61b0('0x46')]);_0x404e93[_0x61b0('0x48')]=_[_0x61b0('0x49')](_0x1cc43f[_0x61b0('0x45')],qs[_0x61b0('0x4a')](_0x395771[_0x61b0('0x46')]['fields']));_0x404e93[_0x61b0('0x48')]=_0x404e93['attributes'][_0x61b0('0x4b')]?_0x404e93[_0x61b0('0x48')]:_0x1cc43f[_0x61b0('0x45')];if(_0x395771[_0x61b0('0x46')]['includeAll']){_0x404e93['include']=[{'all':!![]}];}_0x404e93=_[_0x61b0('0x54')]({},_0x404e93,_0x395771['options']);return db[_0x61b0('0x56')]['find'](_0x404e93)[_0x61b0('0x1e')](handleEntityNotFound(_0x341f12,null))['then'](respondWithResult(_0x341f12,null))[_0x61b0('0x28')](handleError(_0x341f12,null));};exports[_0x61b0('0x33')]=function(_0x30d637,_0x384b82){if(_0x30d637['body']['id']){delete _0x30d637[_0x61b0('0x5a')]['id'];}return db[_0x61b0('0x56')][_0x61b0('0x5b')]({'where':{'id':_0x30d637[_0x61b0('0x5c')]['id']},'include':[{'model':db[_0x61b0('0x3b')],'as':_0x61b0('0x3c')},{'model':db[_0x61b0('0x3d')],'as':_0x61b0('0x3e')},{'model':db[_0x61b0('0x3f')],'as':_0x61b0('0x40')}]})[_0x61b0('0x1e')](handleEntityNotFound(_0x384b82,null))['then'](saveUpdates(_0x30d637[_0x61b0('0x5a')],null))[_0x61b0('0x1e')](function(_0x19ff22){if(_0x19ff22&&_0x30d637['body']['Imap']){return db['MailServerIn'][_0x61b0('0x33')](_0x30d637[_0x61b0('0x5a')][_0x61b0('0x3c')],{'where':{'MailAccountId':_0x19ff22['id']}})[_0x61b0('0x1e')](function(){return _0x19ff22;});}return _0x19ff22;})[_0x61b0('0x1e')](function(_0x415dc5){if(_0x415dc5&&_0x30d637[_0x61b0('0x5a')][_0x61b0('0x3e')]){return db[_0x61b0('0x3d')][_0x61b0('0x33')](_0x30d637[_0x61b0('0x5a')][_0x61b0('0x3e')],{'where':{'MailAccountId':_0x415dc5['id']}})['then'](function(){return _0x415dc5;});}return _0x415dc5;})[_0x61b0('0x1e')](respondWithResult(_0x384b82,null))[_0x61b0('0x28')](handleError(_0x384b82,null));};exports[_0x61b0('0x5d')]=function(_0x2d7cb4,_0x5aa47d){return db[_0x61b0('0x56')][_0x61b0('0x5d')]()[_0x61b0('0x1e')](respondWithResult(_0x5aa47d,null))['catch'](handleError(_0x5aa47d,null));};exports[_0x61b0('0x5e')]=function(_0xdb863e,_0x254d5f,_0x550d47){if(_0xdb863e[_0x61b0('0x5a')]['id']){delete _0xdb863e['body']['id'];}return db[_0x61b0('0x56')][_0x61b0('0x5b')]({'where':{'id':_0xdb863e[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x254d5f,null))[_0x61b0('0x1e')](function(_0xd50e60){if(_0xd50e60){_0xdb863e[_0x61b0('0x5a')]['MailAccountId']=_0xd50e60['id'];return db[_0x61b0('0x5f')][_0x61b0('0x60')](_0xdb863e['body']);}})['then'](respondWithResult(_0x254d5f,null))[_0x61b0('0x28')](handleError(_0x254d5f,null));};exports[_0x61b0('0x61')]=function(_0xb31a32,_0x3133cd,_0x74228b){var _0x1a4140={'raw':![],'where':{}};var _0x219c81={};var _0x2519b1={'count':0x0,'rows':[]};return db[_0x61b0('0x56')][_0x61b0('0x62')]({'where':{'id':_0xb31a32[_0x61b0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3133cd,null))['then'](function(_0x3d3e7e){if(_0x3d3e7e){_0x219c81[_0x61b0('0x45')]=_[_0x61b0('0x47')](db[_0x61b0('0x5f')][_0x61b0('0x63')]);_0x219c81[_0x61b0('0x46')]=_[_0x61b0('0x47')](_0xb31a32[_0x61b0('0x46')]);_0x219c81[_0x61b0('0x50')]=_['intersection'](_0x219c81[_0x61b0('0x45')],_0x219c81[_0x61b0('0x46')]);_0x1a4140['attributes']=_[_0x61b0('0x49')](_0x219c81['model'],qs[_0x61b0('0x4a')](_0xb31a32['query'][_0x61b0('0x4a')]));_0x1a4140['attributes']=_0x1a4140[_0x61b0('0x48')][_0x61b0('0x4b')]?_0x1a4140['attributes']:_0x219c81['model'];if(!_0xb31a32['query'][_0x61b0('0x64')](_0x61b0('0x4c'))){_0x1a4140['limit']=qs[_0x61b0('0x2e')](_0xb31a32[_0x61b0('0x46')]['limit']);_0x1a4140[_0x61b0('0x2d')]=qs[_0x61b0('0x2d')](_0xb31a32['query'][_0x61b0('0x2d')]);}_0x1a4140[_0x61b0('0x4d')]=qs[_0x61b0('0x4e')](_0xb31a32['query'][_0x61b0('0x4e')]);_0x1a4140[_0x61b0('0x4f')]=qs[_0x61b0('0x50')](_['pick'](_0xb31a32[_0x61b0('0x46')],_0x219c81[_0x61b0('0x50')]));_0x1a4140[_0x61b0('0x4f')][_0x61b0('0x65')]=_0x3d3e7e['id'];if(_0xb31a32[_0x61b0('0x46')][_0x61b0('0x53')]){_0x1a4140[_0x61b0('0x4f')]=_['merge'](_0x1a4140[_0x61b0('0x4f')],{'$or':_[_0x61b0('0x41')](_0x1a4140['attributes'],function(_0x3195ab){var _0x565a4c={};_0x565a4c[_0x3195ab]={'$like':'%'+_0xb31a32['query'][_0x61b0('0x53')]+'%'};return _0x565a4c;})});}_0x1a4140=_[_0x61b0('0x54')]({},_0x1a4140,_0xb31a32[_0x61b0('0x55')]);return db[_0x61b0('0x5f')][_0x61b0('0x2c')]({'where':_0x1a4140['where']})[_0x61b0('0x1e')](function(_0x525893){_0x2519b1[_0x61b0('0x2c')]=_0x525893;if(_0xb31a32['query'][_0x61b0('0x57')]){_0x1a4140['include']=[{'all':!![]}];}return db[_0x61b0('0x5f')][_0x61b0('0x58')](_0x1a4140);})['then'](function(_0x31fa9e){_0x2519b1['rows']=_0x31fa9e;return _0x2519b1;});}})['then'](respondWithFilteredResult(_0x3133cd,_0x1a4140))['catch'](handleError(_0x3133cd,null));};exports[_0x61b0('0x66')]=function(_0x5d1735,_0x48e251,_0x25d476){return db[_0x61b0('0x56')][_0x61b0('0x5b')]({'where':{'id':_0x5d1735['params']['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x48e251,null))[_0x61b0('0x1e')](function(_0x516418){if(_0x516418){return _0x516418[_0x61b0('0x66')](_0x5d1735[_0x61b0('0x46')][_0x61b0('0x67')]);}})[_0x61b0('0x1e')](respondWithStatusCode(_0x48e251,null))[_0x61b0('0x28')](handleError(_0x48e251,null));};exports['addAnswer']=function(_0x40716d,_0x540bc5,_0x41770c){if(_0x40716d[_0x61b0('0x5a')]['id']){delete _0x40716d[_0x61b0('0x5a')]['id'];}return db['MailAccount'][_0x61b0('0x5b')]({'where':{'id':_0x40716d[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x540bc5,null))[_0x61b0('0x1e')](function(_0x57f055){if(_0x57f055){_0x40716d['body'][_0x61b0('0x65')]=_0x57f055['id'];return db[_0x61b0('0x68')][_0x61b0('0x60')](_0x40716d[_0x61b0('0x5a')]);}})['then'](respondWithResult(_0x540bc5,null))[_0x61b0('0x28')](handleError(_0x540bc5,null));};exports[_0x61b0('0x69')]=function(_0x1da89e,_0x8fb685,_0x2759f0){var _0x4f5f65={'raw':![],'where':{}};var _0x148e73={};var _0x29de56={'count':0x0,'rows':[]};return db['MailAccount'][_0x61b0('0x62')]({'where':{'id':_0x1da89e['params']['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x8fb685,null))[_0x61b0('0x1e')](function(_0x54d8ca){if(_0x54d8ca){_0x148e73['model']=_['keys'](db[_0x61b0('0x68')][_0x61b0('0x63')]);_0x148e73['query']=_['keys'](_0x1da89e['query']);_0x148e73['filters']=_['intersection'](_0x148e73['model'],_0x148e73[_0x61b0('0x46')]);_0x4f5f65[_0x61b0('0x48')]=_[_0x61b0('0x49')](_0x148e73[_0x61b0('0x45')],qs[_0x61b0('0x4a')](_0x1da89e[_0x61b0('0x46')][_0x61b0('0x4a')]));_0x4f5f65['attributes']=_0x4f5f65[_0x61b0('0x48')][_0x61b0('0x4b')]?_0x4f5f65[_0x61b0('0x48')]:_0x148e73[_0x61b0('0x45')];if(!_0x1da89e[_0x61b0('0x46')][_0x61b0('0x64')](_0x61b0('0x4c'))){_0x4f5f65[_0x61b0('0x2e')]=qs[_0x61b0('0x2e')](_0x1da89e[_0x61b0('0x46')][_0x61b0('0x2e')]);_0x4f5f65[_0x61b0('0x2d')]=qs['offset'](_0x1da89e[_0x61b0('0x46')][_0x61b0('0x2d')]);}_0x4f5f65[_0x61b0('0x4d')]=qs[_0x61b0('0x4e')](_0x1da89e[_0x61b0('0x46')][_0x61b0('0x4e')]);_0x4f5f65[_0x61b0('0x4f')]=qs[_0x61b0('0x50')](_[_0x61b0('0x51')](_0x1da89e['query'],_0x148e73[_0x61b0('0x50')]));_0x4f5f65['where'][_0x61b0('0x65')]=_0x54d8ca['id'];if(_0x1da89e[_0x61b0('0x46')][_0x61b0('0x53')]){_0x4f5f65[_0x61b0('0x4f')]=_[_0x61b0('0x54')](_0x4f5f65[_0x61b0('0x4f')],{'$or':_['map'](_0x4f5f65[_0x61b0('0x48')],function(_0xeabbf5){var _0x4b8c2c={};_0x4b8c2c[_0xeabbf5]={'$like':'%'+_0x1da89e[_0x61b0('0x46')][_0x61b0('0x53')]+'%'};return _0x4b8c2c;})});}_0x4f5f65=_[_0x61b0('0x54')]({},_0x4f5f65,_0x1da89e[_0x61b0('0x55')]);return db['CannedAnswer']['count']({'where':_0x4f5f65[_0x61b0('0x4f')]})[_0x61b0('0x1e')](function(_0x3816ac){_0x29de56['count']=_0x3816ac;if(_0x1da89e['query'][_0x61b0('0x57')]){_0x4f5f65[_0x61b0('0x6a')]=[{'all':!![]}];}return db[_0x61b0('0x68')][_0x61b0('0x58')](_0x4f5f65);})[_0x61b0('0x1e')](function(_0xc07cf8){_0x29de56['rows']=_0xc07cf8;return _0x29de56;});}})[_0x61b0('0x1e')](respondWithFilteredResult(_0x8fb685,_0x4f5f65))['catch'](handleError(_0x8fb685,null));};exports[_0x61b0('0x6b')]=function(_0x3c0683,_0xc94f62,_0x11469e){return db[_0x61b0('0x56')][_0x61b0('0x5b')]({'where':{'id':_0x3c0683[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0xc94f62,null))['then'](function(_0x4e5545){if(_0x4e5545){return _0x4e5545[_0x61b0('0x6b')](_0x3c0683[_0x61b0('0x46')][_0x61b0('0x67')]);}})['then'](respondWithStatusCode(_0xc94f62,null))[_0x61b0('0x28')](handleError(_0xc94f62,null));};exports['create']=function(_0x5d0685,_0x20d7f6){var _0x26a2fe={'name':_0x5d0685['body'][_0x61b0('0x39')],'key':_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x44')],'email':_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x6c')],'ListId':_0x5d0685[_0x61b0('0x5a')]['ListId'],'active':!_[_0x61b0('0x6d')](_0x5d0685[_0x61b0('0x5a')]['active'])?_0x5d0685[_0x61b0('0x5a')]['active']:!![],'description':_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x6e')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x5d0685['body'][_0x61b0('0x6f')])){if(_0x5d0685[_0x61b0('0x5a')]['cauthentication']){_0x26a2fe[_0x61b0('0x3c')]['user']=_0x26a2fe['Smtp'][_0x61b0('0x70')]=_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x71')];_0x26a2fe[_0x61b0('0x3c')][_0x61b0('0x72')]=_0x26a2fe['Smtp'][_0x61b0('0x73')]=_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x74')];}else{_0x26a2fe[_0x61b0('0x3c')][_0x61b0('0x75')]=_0x26a2fe['Smtp'][_0x61b0('0x75')]=![];}_0x26a2fe[_0x61b0('0x3c')][_0x61b0('0x76')]=_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x3c')][_0x61b0('0x76')];_0x26a2fe[_0x61b0('0x3c')][_0x61b0('0x77')]=_0x5d0685[_0x61b0('0x5a')]['Imap'][_0x61b0('0x77')];_0x26a2fe[_0x61b0('0x3e')]['host']=_0x5d0685['body'][_0x61b0('0x3e')]['host'];_0x26a2fe[_0x61b0('0x3e')]['port']=_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x3e')][_0x61b0('0x77')];}else{_0x26a2fe[_0x61b0('0x3c')][_0x61b0('0x78')]=_0x26a2fe[_0x61b0('0x3e')][_0x61b0('0x78')]=_0x5d0685['body'][_0x61b0('0x6f')];_0x26a2fe[_0x61b0('0x3c')][_0x61b0('0x70')]=_0x26a2fe[_0x61b0('0x3e')][_0x61b0('0x70')]=_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x71')];_0x26a2fe['Imap']['password']=_0x26a2fe[_0x61b0('0x3e')]['pass']=_0x5d0685[_0x61b0('0x5a')][_0x61b0('0x74')];}return db['MailAccount'][_0x61b0('0x60')](_0x26a2fe,{'include':[{'model':db['MailServerOut'],'as':_0x61b0('0x3e')},{'model':db[_0x61b0('0x3b')],'as':_0x61b0('0x3c')}]})[_0x61b0('0x1e')](function(_0x21efd4){var _0x3c0f55=_0x5d0685[_0x61b0('0x70')][_0x61b0('0x34')]({'plain':!![]});if(!_0x3c0f55)throw new Error(_0x61b0('0x79'));if(_0x3c0f55['role']===_0x61b0('0x70')){var _0x298865=_0x21efd4[_0x61b0('0x34')]({'plain':!![]});return db[_0x61b0('0x7a')][_0x61b0('0x5b')]({'where':{'name':_0x61b0('0x35'),'userProfileId':_0x3c0f55['userProfileId']},'raw':!![]})[_0x61b0('0x1e')](function(_0x3cae80){if(_0x3cae80&&_0x3cae80[_0x61b0('0x7b')]===0x0){return db[_0x61b0('0x36')][_0x61b0('0x60')]({'name':_0x298865['name'],'resourceId':_0x298865['id'],'type':_0x3cae80[_0x61b0('0x39')],'sectionId':_0x3cae80['id']},{})[_0x61b0('0x1e')](function(){return _0x21efd4;});}else{return _0x21efd4;}})[_0x61b0('0x28')](function(_0x3dd65e){logger[_0x61b0('0x23')](_0x61b0('0x7c'),_0x3dd65e);throw _0x3dd65e;});}return _0x21efd4;})['then'](respondWithResult(_0x20d7f6,0xc9))['catch'](handleError(_0x20d7f6,null));};exports[_0x61b0('0x7d')]=function(_0x5a88b0,_0x338a10,_0x4cad60){return db[_0x61b0('0x56')]['findOne']({'where':{'id':_0x5a88b0['params']['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x338a10,null))['then'](function(_0x43a4c5){if(_0x43a4c5){return _0x43a4c5['getImap']();}return null;})[_0x61b0('0x1e')](respondWithResult(_0x338a10,null))[_0x61b0('0x28')](handleError(_0x338a10,null));};exports[_0x61b0('0x7e')]=function(_0x4f926e,_0x1b659b,_0x104fd4){if(_0x4f926e[_0x61b0('0x5a')]['id']){delete _0x4f926e[_0x61b0('0x5a')]['id'];}return db[_0x61b0('0x56')][_0x61b0('0x5b')]({'where':{'id':_0x4f926e[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x1b659b,null))[_0x61b0('0x1e')](function(_0x16b1c8){if(_0x16b1c8){_0x4f926e[_0x61b0('0x5a')]['MailAccountId']=_0x16b1c8['id'];return db[_0x61b0('0x3b')][_0x61b0('0x60')](_0x4f926e[_0x61b0('0x5a')]);}})[_0x61b0('0x1e')](respondWithResult(_0x1b659b,null))[_0x61b0('0x28')](handleError(_0x1b659b,null));};exports['removeImap']=function(_0x4a456b,_0x4fb8c9,_0x3b6d52){return db['MailAccount']['findOne']({'where':{'id':_0x4a456b['params']['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x4fb8c9,null))[_0x61b0('0x1e')](function(_0x410064){if(_0x410064){return _0x410064['setImap'](null);}return null;})[_0x61b0('0x1e')](respondWithStatusCode(_0x4fb8c9,null))[_0x61b0('0x28')](handleError(_0x4fb8c9,null));};exports[_0x61b0('0x7f')]=function(_0x434644,_0x439b03,_0xf77fe8){return db[_0x61b0('0x56')][_0x61b0('0x62')]({'where':{'id':_0x434644['params']['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x439b03,null))['then'](function(_0x5a2fcf){if(_0x5a2fcf){return _0x5a2fcf[_0x61b0('0x7f')]();}return null;})[_0x61b0('0x1e')](respondWithResult(_0x439b03,null))[_0x61b0('0x28')](handleError(_0x439b03,null));};exports[_0x61b0('0x80')]=function(_0x1e7583,_0x38f36a,_0x36d7ae){if(_0x1e7583['body']['id']){delete _0x1e7583[_0x61b0('0x5a')]['id'];}return db[_0x61b0('0x56')][_0x61b0('0x5b')]({'where':{'id':_0x1e7583[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x38f36a,null))[_0x61b0('0x1e')](function(_0x6fcaf1){if(_0x6fcaf1){_0x1e7583[_0x61b0('0x5a')][_0x61b0('0x65')]=_0x6fcaf1['id'];return db[_0x61b0('0x3d')][_0x61b0('0x60')](_0x1e7583[_0x61b0('0x5a')]);}})[_0x61b0('0x1e')](respondWithResult(_0x38f36a,null))[_0x61b0('0x28')](handleError(_0x38f36a,null));};exports['removeSmtp']=function(_0x52039d,_0x20b8b3,_0x4f5a8a){return db[_0x61b0('0x56')][_0x61b0('0x62')]({'where':{'id':_0x52039d[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x20b8b3,null))[_0x61b0('0x1e')](function(_0x47900a){if(_0x47900a){return _0x47900a[_0x61b0('0x81')](null);}return null;})[_0x61b0('0x1e')](respondWithStatusCode(_0x20b8b3,null))[_0x61b0('0x28')](handleError(_0x20b8b3,null));};exports['addInteraction']=function(_0x10c7d9,_0x373080,_0x287f6c){return db[_0x61b0('0x82')]['find']({'where':{'id':_0x10c7d9[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x373080,null))[_0x61b0('0x1e')](function(_0x5d268b){if(_0x5d268b){return _0x5d268b[_0x61b0('0x83')](_0x10c7d9[_0x61b0('0x5a')][_0x61b0('0x67')],_[_0x61b0('0x84')](_0x10c7d9[_0x61b0('0x5a')],[_0x61b0('0x67'),'id'])||{});}})[_0x61b0('0x1e')](respondWithResult(_0x373080,null))[_0x61b0('0x28')](handleError(_0x373080,null));};exports[_0x61b0('0x85')]=function(_0x483052,_0x306643,_0x20ecba){var _0x4020c8={'raw':![],'where':{}};var _0x3c4352={};var _0x4c8c63={'count':0x0,'rows':[]};return db[_0x61b0('0x56')][_0x61b0('0x62')]({'where':{'id':_0x483052[_0x61b0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x306643,null))[_0x61b0('0x1e')](function(_0x326adb){if(_0x326adb){_0x3c4352[_0x61b0('0x45')]=_[_0x61b0('0x47')](db[_0x61b0('0x82')]['rawAttributes']);_0x3c4352[_0x61b0('0x46')]=_[_0x61b0('0x47')](_0x483052['query']);_0x3c4352[_0x61b0('0x50')]=_['intersection'](_0x3c4352[_0x61b0('0x45')],_0x3c4352[_0x61b0('0x46')]);_0x4020c8['attributes']=_['intersection'](_0x3c4352[_0x61b0('0x45')],qs[_0x61b0('0x4a')](_0x483052[_0x61b0('0x46')]['fields']));_0x4020c8['attributes']=_0x4020c8[_0x61b0('0x48')]['length']?_0x4020c8[_0x61b0('0x48')]:_0x3c4352[_0x61b0('0x45')];if(!_0x483052['query'][_0x61b0('0x64')](_0x61b0('0x4c'))){_0x4020c8[_0x61b0('0x2e')]=qs[_0x61b0('0x2e')](_0x483052[_0x61b0('0x46')][_0x61b0('0x2e')]);_0x4020c8[_0x61b0('0x2d')]=qs[_0x61b0('0x2d')](_0x483052[_0x61b0('0x46')][_0x61b0('0x2d')]);}_0x4020c8['order']=qs[_0x61b0('0x4e')](_0x483052[_0x61b0('0x46')]['sort']);_0x4020c8[_0x61b0('0x4f')]=qs[_0x61b0('0x50')](_[_0x61b0('0x51')](_0x483052[_0x61b0('0x46')],_0x3c4352[_0x61b0('0x50')]));_0x4020c8[_0x61b0('0x4f')][_0x61b0('0x65')]=_0x326adb['id'];if(_0x483052[_0x61b0('0x46')][_0x61b0('0x53')]){_0x4020c8[_0x61b0('0x4f')]=_[_0x61b0('0x54')](_0x4020c8[_0x61b0('0x4f')],{'$or':_[_0x61b0('0x41')](_0x4020c8[_0x61b0('0x48')],function(_0x5274eb){var _0x5dbfe1={};_0x5dbfe1[_0x5274eb]={'$like':'%'+_0x483052['query'][_0x61b0('0x53')]+'%'};return _0x5dbfe1;})});}_0x4020c8=_[_0x61b0('0x54')]({},_0x4020c8,_0x483052[_0x61b0('0x55')]);return db[_0x61b0('0x82')][_0x61b0('0x2c')]({'where':_0x4020c8[_0x61b0('0x4f')]})[_0x61b0('0x1e')](function(_0x2b3987){_0x4c8c63[_0x61b0('0x2c')]=_0x2b3987;if(_0x483052['query'][_0x61b0('0x57')]){_0x4020c8[_0x61b0('0x6a')]=[{'model':db[_0x61b0('0x86')],'as':_0x61b0('0x87'),'required':![]},{'model':db[_0x61b0('0x88')],'as':_0x61b0('0x89'),'attributes':['name',_0x61b0('0x8a'),'internal'],'required':![]},{'model':db[_0x61b0('0x8b')],'as':_0x61b0('0x8c'),'attributes':['id',_0x61b0('0x39'),'color'],'where':_0x483052['query']['tag']?{'id':_0x483052[_0x61b0('0x46')][_0x61b0('0x8d')]}:undefined,'required':_0x483052[_0x61b0('0x46')][_0x61b0('0x8d')]?!![]:![]}];}return db[_0x61b0('0x82')][_0x61b0('0x58')](_0x4020c8);})[_0x61b0('0x1e')](function(_0x5af24b){_0x4c8c63[_0x61b0('0x8e')]=_0x5af24b;return _0x4c8c63;});}})['then'](respondWithFilteredResult(_0x306643,_0x4020c8))['catch'](handleError(_0x306643,null));};exports[_0x61b0('0x8f')]=function(_0x4d6266,_0x1ddee8,_0x446a23){return db[_0x61b0('0x56')][_0x61b0('0x62')]({'where':{'id':_0x4d6266[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x1ddee8,null))[_0x61b0('0x1e')](function(_0x41effe){if(_0x41effe){return db['sequelize']['transaction'](function(_0x3b8e43){return db[_0x61b0('0x90')][_0x61b0('0x91')]({'where':{'MailAccountId':_0x4d6266[_0x61b0('0x5c')]['id']},'transaction':_0x3b8e43})[_0x61b0('0x1e')](function(_0x594524){var _0x31f71c=_[_0x61b0('0x41')](_0x4d6266[_0x61b0('0x5a')],function(_0x444aad){_0x444aad['MailAccountId']=_0x4d6266[_0x61b0('0x5c')]['id'];return _0x444aad;});return db[_0x61b0('0x90')]['bulkCreate'](_0x31f71c,{'transaction':_0x3b8e43});});})['then'](function(){return db[_0x61b0('0x90')][_0x61b0('0x92')]({'where':{'MailAccountId':_0x4d6266[_0x61b0('0x5c')]['id']},'order':_0x61b0('0x93')});});}})[_0x61b0('0x1e')](respondWithResult(_0x1ddee8,null))[_0x61b0('0x28')](handleError(_0x1ddee8,null));};exports[_0x61b0('0x94')]=function(_0x5ae806,_0x39309a,_0x5469d5){var _0x109e0f={};var _0x3ce664={};var _0x25655f;var _0x112655;return db['MailAccount'][_0x61b0('0x62')]({'where':{'id':_0x5ae806[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x39309a,null))[_0x61b0('0x1e')](function(_0x3666b5){if(_0x3666b5){_0x25655f=_0x3666b5;_0x3ce664['model']=_[_0x61b0('0x47')](db[_0x61b0('0x90')][_0x61b0('0x63')]);_0x3ce664[_0x61b0('0x46')]=_[_0x61b0('0x47')](_0x5ae806[_0x61b0('0x46')]);_0x3ce664['filters']=_['intersection'](_0x3ce664[_0x61b0('0x45')],_0x3ce664[_0x61b0('0x46')]);_0x109e0f[_0x61b0('0x48')]=_[_0x61b0('0x49')](_0x3ce664[_0x61b0('0x45')],qs[_0x61b0('0x4a')](_0x5ae806['query']['fields']));_0x109e0f[_0x61b0('0x48')]=_0x109e0f[_0x61b0('0x48')][_0x61b0('0x4b')]?_0x109e0f[_0x61b0('0x48')]:_0x3ce664['model'];_0x109e0f['order']=qs[_0x61b0('0x4e')](_0x5ae806[_0x61b0('0x46')]['sort']);_0x109e0f[_0x61b0('0x4f')]=qs['filters'](_['pick'](_0x5ae806['query'],_0x3ce664[_0x61b0('0x50')]));if(_0x5ae806[_0x61b0('0x46')][_0x61b0('0x53')]){_0x109e0f['where']=_[_0x61b0('0x54')](_0x109e0f[_0x61b0('0x4f')],{'$or':_['map'](_0x109e0f[_0x61b0('0x48')],function(_0x2080f9){var _0x2d034e={};_0x2d034e[_0x2080f9]={'$like':'%'+_0x5ae806[_0x61b0('0x46')]['filter']+'%'};return _0x2d034e;})});}_0x109e0f=_[_0x61b0('0x54')]({},_0x109e0f,_0x5ae806[_0x61b0('0x55')]);return _0x25655f[_0x61b0('0x94')](_0x109e0f);}})[_0x61b0('0x1e')](function(_0x2ffef9){if(_0x2ffef9){_0x112655=_0x2ffef9[_0x61b0('0x4b')];if(!_0x5ae806[_0x61b0('0x46')][_0x61b0('0x64')](_0x61b0('0x4c'))){_0x109e0f[_0x61b0('0x2e')]=qs['limit'](_0x5ae806[_0x61b0('0x46')][_0x61b0('0x2e')]);_0x109e0f[_0x61b0('0x2d')]=qs[_0x61b0('0x2d')](_0x5ae806[_0x61b0('0x46')]['offset']);}return _0x25655f['getApplications'](_0x109e0f);}})[_0x61b0('0x1e')](function(_0x4fb41c){if(_0x4fb41c){return _0x4fb41c?{'count':_0x112655,'rows':_0x4fb41c}:null;}})['then'](respondWithResult(_0x39309a,null))[_0x61b0('0x28')](handleError(_0x39309a,null));};exports[_0x61b0('0x95')]=function(_0x27c457,_0x421c75,_0x19dcc7){var _0x2b6976={'raw':!![],'where':{}};var _0x4f50e3={};var _0x2ecce0={'count':0x0,'rows':[]};return db[_0x61b0('0x56')]['findOne']({'where':{'id':_0x27c457[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x421c75,null))['then'](function(_0x7ebcb0){if(_0x7ebcb0){_0x4f50e3[_0x61b0('0x45')]=_['keys'](db['MailMessage'][_0x61b0('0x63')]);_0x4f50e3['query']=_['keys'](_0x27c457['query']);_0x4f50e3[_0x61b0('0x50')]=_[_0x61b0('0x49')](_0x4f50e3['model'],_0x4f50e3[_0x61b0('0x46')]);_0x2b6976[_0x61b0('0x48')]=_['intersection'](_0x4f50e3['model'],qs[_0x61b0('0x4a')](_0x27c457[_0x61b0('0x46')][_0x61b0('0x4a')]));_0x2b6976[_0x61b0('0x48')]=_0x2b6976[_0x61b0('0x48')][_0x61b0('0x4b')]?_0x2b6976[_0x61b0('0x48')]:_0x4f50e3['model'];if(!_0x27c457[_0x61b0('0x46')][_0x61b0('0x64')](_0x61b0('0x4c'))){_0x2b6976['limit']=qs['limit'](_0x27c457['query'][_0x61b0('0x2e')]);_0x2b6976['offset']=qs[_0x61b0('0x2d')](_0x27c457[_0x61b0('0x46')]['offset']);}_0x2b6976[_0x61b0('0x4d')]=qs[_0x61b0('0x4e')](_0x27c457['query']['sort']);_0x2b6976[_0x61b0('0x4f')]=qs['filters'](_['pick'](_0x27c457[_0x61b0('0x46')],_0x4f50e3[_0x61b0('0x50')]));_0x2b6976[_0x61b0('0x4f')][_0x61b0('0x65')]=_0x7ebcb0['id'];if(_0x27c457[_0x61b0('0x46')]['filter']){_0x2b6976[_0x61b0('0x4f')]=_[_0x61b0('0x54')](_0x2b6976[_0x61b0('0x4f')],{'$or':_['map'](_0x2b6976[_0x61b0('0x48')],function(_0x599392){var _0x2d9d07={};_0x2d9d07[_0x599392]={'$like':'%'+_0x27c457[_0x61b0('0x46')]['filter']+'%'};return _0x2d9d07;})});}if(_0x27c457[_0x61b0('0x46')][_0x61b0('0x96')]){var _0xf148df=_0x27c457[_0x61b0('0x46')][_0x61b0('0x96')]['split'](',');var _0x2cab3f={};_0x2cab3f[_0xf148df[0x0]]={'$gte':moment(_0xf148df[0x1])['format'](_0x61b0('0x97'))};_0x2b6976[_0x61b0('0x4f')]=_['merge'](_0x2b6976[_0x61b0('0x4f')],_0x2cab3f);}_0x2b6976=_[_0x61b0('0x54')]({},_0x2b6976,_0x27c457[_0x61b0('0x55')]);return db[_0x61b0('0x98')][_0x61b0('0x2c')]({'where':_0x2b6976[_0x61b0('0x4f')]})[_0x61b0('0x1e')](function(_0x102212){_0x2ecce0['count']=_0x102212;if(_0x27c457[_0x61b0('0x46')][_0x61b0('0x57')]){_0x2b6976[_0x61b0('0x6a')]=[{'all':!![]}];}return db[_0x61b0('0x98')][_0x61b0('0x58')](_0x2b6976);})[_0x61b0('0x1e')](function(_0x4113b3){_0x2ecce0[_0x61b0('0x8e')]=_0x4113b3;return _0x2ecce0;});}})[_0x61b0('0x1e')](respondWithFilteredResult(_0x421c75,_0x2b6976))[_0x61b0('0x28')](handleError(_0x421c75,null));};exports['send']=function(_0x1798cc,_0x51ed1e,_0x289464){var _0x3d8db0,_0x29486e={},_0x27c559;if(_0x1798cc[_0x61b0('0x5a')]['to']){_0x27c559=_0x1798cc[_0x61b0('0x5a')]['to'][_0x61b0('0x99')](',')[0x0];}return db[_0x61b0('0x56')][_0x61b0('0x5b')]({'where':{'id':_0x1798cc['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x61b0('0x86')],'as':_0x61b0('0x9a'),'where':{'email':_0x27c559},'limit':0x1,'order':[[_0x61b0('0x9b'),'DESC']]}]},{'model':db[_0x61b0('0x3d')],'as':_0x61b0('0x3e'),'raw':!![]}]})[_0x61b0('0x1e')](handleEntityNotFound(_0x51ed1e,null))[_0x61b0('0x1e')](function(_0x1ad0b6){if(_0x1ad0b6){_0x3d8db0=_0x1ad0b6;if(_0x1ad0b6['Smtp']){if(_[_0x61b0('0x6d')](_0x1798cc[_0x61b0('0x5a')]['from'])){_0x1798cc['body'][_0x61b0('0x9c')]=util['format']('%s\x20<%s>',_0x1ad0b6[_0x61b0('0x39')],_0x1ad0b6['email']||_0x1ad0b6[_0x61b0('0x3e')][_0x61b0('0x70')]);}if(_0x1798cc[_0x61b0('0x5a')][_0x61b0('0x9d')]&&_0x1798cc[_0x61b0('0x5a')][_0x61b0('0x9d')][_0x61b0('0x4b')]){for(var _0x3b8abc=0x0;_0x3b8abc<_0x1798cc['body'][_0x61b0('0x9d')][_0x61b0('0x4b')];_0x3b8abc+=0x1){_0x1798cc['body'][_0x61b0('0x9d')][_0x3b8abc]={'filename':_0x1798cc['body']['attachments'][_0x3b8abc][_0x61b0('0x39')],'path':path[_0x61b0('0x9e')](config[_0x61b0('0x9f')],_0x61b0('0xa0'),_0x1798cc[_0x61b0('0x5a')][_0x61b0('0x9d')][_0x3b8abc][_0x61b0('0xa1')])};}}var _0x537fec={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1ad0b6[_0x61b0('0x3e')]['service'])){if(_0x1ad0b6[_0x61b0('0x3e')][_0x61b0('0x75')]){_0x537fec[_0x61b0('0xa2')]={'user':_0x1ad0b6[_0x61b0('0x3e')][_0x61b0('0x70')],'pass':_0x1ad0b6['Smtp'][_0x61b0('0x73')]};}_0x537fec[_0x61b0('0x76')]=_0x1ad0b6[_0x61b0('0x3e')][_0x61b0('0x76')];_0x537fec[_0x61b0('0x77')]=_0x1ad0b6[_0x61b0('0x3e')][_0x61b0('0x77')];_0x537fec[_0x61b0('0xa3')]=_0x1ad0b6[_0x61b0('0x3e')][_0x61b0('0xa3')];}else{_0x537fec[_0x61b0('0x78')]=_0x1ad0b6[_0x61b0('0x3e')][_0x61b0('0x78')];_0x537fec[_0x61b0('0xa2')]={'user':_0x1ad0b6[_0x61b0('0x3e')][_0x61b0('0x70')],'pass':_0x1ad0b6['Smtp'][_0x61b0('0x73')]};}return respondWithRpcPromise('SendMail',_0x61b0('0xa4'),{'account':_0x537fec,'message':_0x1798cc['body']});}else{throw new Error(_0x61b0('0xa5'));}}})[_0x61b0('0x1e')](function(_0x4a7b4d){if(_0x4a7b4d){_0x29486e=_0x4a7b4d;if(_0x3d8db0[_0x61b0('0xa6')]){if(_0x3d8db0[_0x61b0('0xa6')][_0x61b0('0x9a')][_0x61b0('0x4b')]){return _0x3d8db0[_0x61b0('0xa6')][_0x61b0('0x9a')][0x0];}else{return db[_0x61b0('0x86')][_0x61b0('0x60')](_['defaults'](_0x1798cc[_0x61b0('0x5a')],{'firstName':_0x1798cc[_0x61b0('0x5a')]['to'],'email':_0x1798cc[_0x61b0('0x5a')]['to'],'phone':_0x1798cc['body']['to'],'ListId':_0x3d8db0[_0x61b0('0xa7')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x294208){if(_0x294208){var _0x1a924c={'UserId':_0x1798cc['user']['id'],'ContactId':_0x294208['id'],'MailAccountId':_0x3d8db0['id'],'inReplyTo':_0x29486e['messageId'],'to':_0x1798cc[_0x61b0('0x5a')][_0x61b0('0x9c')],'cc':_0x1798cc['body']['cc'],'subject':_0x1798cc[_0x61b0('0x5a')][_0x61b0('0xa8')],'attach':_0x1798cc[_0x61b0('0x5a')]['attach'],'firstMsgDirection':_0x61b0('0xa9'),'lastMsgAt':moment()[_0x61b0('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x61b0('0xa9'),'lastMsgBody':_0x1798cc[_0x61b0('0x5a')][_0x61b0('0x5a')],'Messages':[_[_0x61b0('0x54')](_0x1798cc[_0x61b0('0x5a')],{'messageId':_0x29486e['messageId'],'sentAt':moment()[_0x61b0('0xaa')](_0x61b0('0x97')),'read':!![],'MailAccountId':_0x3d8db0['id'],'UserId':_0x1798cc['user']['id'],'ContactId':_0x294208['id']})]};if(_0x1798cc[_0x61b0('0x5a')][_0x61b0('0xab')]){_0x1a924c=_[_0x61b0('0x54')](_0x1a924c,_0x1798cc['body']['Interaction']);}return db['MailInteraction'][_0x61b0('0x60')](_0x1a924c,{'include':[{'model':db[_0x61b0('0x98')],'as':_0x61b0('0xac')}]});}})[_0x61b0('0x1e')](respondWithResult(_0x51ed1e,null))[_0x61b0('0x28')](handleError(_0x51ed1e,null));};exports[_0x61b0('0xad')]=function(_0x13e084,_0x1c2ae8,_0xf8210f){return db[_0x61b0('0x56')]['find']({'where':{'id':_0x13e084['params']['id']},'include':[{'model':db[_0x61b0('0x3d')],'as':'Smtp','raw':!![]}]})[_0x61b0('0x1e')](handleEntityNotFound(_0x1c2ae8,null))['then'](function(_0x46894a){if(_0x46894a&&_0x46894a[_0x61b0('0x3e')]){var _0x982646={'id':_0x46894a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x46894a[_0x61b0('0x3e')]['service']){_0x982646['service']=_0x46894a[_0x61b0('0x3e')]['service'];}else{_0x982646[_0x61b0('0x76')]=_0x46894a[_0x61b0('0x3e')][_0x61b0('0x76')];_0x982646[_0x61b0('0x77')]=_0x46894a['Smtp'][_0x61b0('0x77')];_0x982646[_0x61b0('0xa3')]=_0x46894a[_0x61b0('0x3e')]['secure'];}if(_0x46894a[_0x61b0('0x3e')][_0x61b0('0x75')]){_0x982646['auth']={'user':_0x46894a[_0x61b0('0x3e')][_0x61b0('0x70')],'pass':_0x46894a['Smtp'][_0x61b0('0x73')]};}return respondWithRpcPromise(_0x61b0('0xae'),_0x61b0('0xad'),{'account':_0x982646});}})['then'](respondWithResult(_0x1c2ae8,null))['catch'](handleError(_0x1c2ae8,null));};exports[_0x61b0('0x91')]=function(_0x5efacb,_0x24477a){return db['MailAccount'][_0x61b0('0x5b')]({'where':{'id':_0x5efacb[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x24477a,null))['then'](function(_0x228ad5){if(_0x228ad5&&_0x228ad5['service']){throw new db[(_0x61b0('0x1c'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x228ad5;})[_0x61b0('0x1e')](removeEntity(_0x24477a,null))[_0x61b0('0x28')](handleError(_0x24477a,null));};exports[_0x61b0('0xaf')]=function(_0x111984,_0x1bbff9,_0x13f528){return db['MailAccount'][_0x61b0('0x5b')]({'where':{'id':_0x111984['params']['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x1bbff9,null))['then'](function(_0x31e914){if(_0x31e914){return _0x31e914['addAgents'](_0x111984[_0x61b0('0x5a')]['ids'],_[_0x61b0('0x84')](_0x111984[_0x61b0('0x5a')],[_0x61b0('0x67'),'id'])||{})[_0x61b0('0xb0')](function(_0x91f070){for(var _0x32506f=0x0;_0x32506f<_0x111984[_0x61b0('0x5a')][_0x61b0('0x67')][_0x61b0('0x4b')];_0x32506f+=0x1){socket[_0x61b0('0xb1')](_0x61b0('0xb2'),{'UserId':_0x111984[_0x61b0('0x5a')][_0x61b0('0x67')][_0x32506f],'MailAccountId':_0x111984[_0x61b0('0x5c')]['id']});}return _0x91f070;});}})[_0x61b0('0x1e')](respondWithResult(_0x1bbff9,null))[_0x61b0('0x28')](handleError(_0x1bbff9,null));};exports[_0x61b0('0xb3')]=function(_0x42e11b,_0x9ff6c3,_0x2a230f){return db['MailAccount'][_0x61b0('0x5b')]({'where':{'id':_0x42e11b[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x9ff6c3,null))[_0x61b0('0x1e')](function(_0x14ce54){if(_0x14ce54){return _0x14ce54[_0x61b0('0xb3')](_0x42e11b['query']['ids'])[_0x61b0('0x1e')](function(){if(_[_0x61b0('0xb4')](_0x42e11b[_0x61b0('0x46')][_0x61b0('0x67')])){for(var _0x4db08c=0x0;_0x4db08c<_0x42e11b[_0x61b0('0x46')]['ids'][_0x61b0('0x4b')];_0x4db08c+=0x1){socket[_0x61b0('0xb1')](_0x61b0('0xb5'),{'UserId':Number(_0x42e11b[_0x61b0('0x46')]['ids'][_0x4db08c]),'MailAccountId':Number(_0x42e11b['params']['id'])});}}else{socket['emit'](_0x61b0('0xb5'),{'UserId':Number(_0x42e11b[_0x61b0('0x46')][_0x61b0('0x67')]),'MailAccountId':Number(_0x42e11b[_0x61b0('0x5c')]['id'])});}});}})[_0x61b0('0x1e')](respondWithStatusCode(_0x9ff6c3,null))[_0x61b0('0x28')](handleError(_0x9ff6c3,null));};exports[_0x61b0('0xb6')]=function(_0x3902ed,_0x3ebfc3,_0x4d279d){var _0x1b562d={};var _0x573509={};var _0x19f9c8;var _0x8390cc;return db[_0x61b0('0x56')][_0x61b0('0x62')]({'where':{'id':_0x3902ed[_0x61b0('0x5c')]['id']}})[_0x61b0('0x1e')](handleEntityNotFound(_0x3ebfc3,null))['then'](function(_0xc70262){if(_0xc70262){_0x19f9c8=_0xc70262;_0x573509[_0x61b0('0x45')]=_[_0x61b0('0x47')](db[_0x61b0('0x88')][_0x61b0('0x63')]);_0x573509[_0x61b0('0x46')]=_[_0x61b0('0x47')](_0x3902ed[_0x61b0('0x46')]);_0x573509['filters']=_[_0x61b0('0x49')](_0x573509[_0x61b0('0x45')],_0x573509[_0x61b0('0x46')]);_0x1b562d[_0x61b0('0x48')]=_['intersection'](_0x573509[_0x61b0('0x45')],qs['fields'](_0x3902ed[_0x61b0('0x46')][_0x61b0('0x4a')]));_0x1b562d['attributes']=_0x1b562d[_0x61b0('0x48')]['length']?_0x1b562d[_0x61b0('0x48')]:_0x573509[_0x61b0('0x45')];_0x1b562d[_0x61b0('0x4d')]=qs[_0x61b0('0x4e')](_0x3902ed[_0x61b0('0x46')][_0x61b0('0x4e')]);_0x1b562d[_0x61b0('0x4f')]=qs['filters'](_[_0x61b0('0x51')](_0x3902ed['query'],_0x573509['filters']));if(_0x3902ed[_0x61b0('0x46')][_0x61b0('0x53')]){_0x1b562d[_0x61b0('0x4f')]=_[_0x61b0('0x54')](_0x1b562d[_0x61b0('0x4f')],{'$or':_['map'](_0x1b562d[_0x61b0('0x48')],function(_0x555d1a){var _0xef6cee={};_0xef6cee[_0x555d1a]={'$like':'%'+_0x3902ed[_0x61b0('0x46')][_0x61b0('0x53')]+'%'};return _0xef6cee;})});}_0x1b562d=_[_0x61b0('0x54')]({},_0x1b562d,_0x3902ed['options']);return _0x19f9c8[_0x61b0('0xb6')](_0x1b562d);}})[_0x61b0('0x1e')](function(_0x58e643){if(_0x58e643){_0x8390cc=_0x58e643['length'];if(!_0x3902ed[_0x61b0('0x46')][_0x61b0('0x64')](_0x61b0('0x4c'))){_0x1b562d[_0x61b0('0x2e')]=qs['limit'](_0x3902ed[_0x61b0('0x46')]['limit']);_0x1b562d[_0x61b0('0x2d')]=qs[_0x61b0('0x2d')](_0x3902ed[_0x61b0('0x46')]['offset']);}return _0x19f9c8['getAgents'](_0x1b562d);}})[_0x61b0('0x1e')](function(_0x156798){if(_0x156798){return _0x156798?{'count':_0x8390cc,'rows':_0x156798}:null;}})[_0x61b0('0x1e')](respondWithResult(_0x3ebfc3,null))[_0x61b0('0x28')](handleError(_0x3ebfc3,null));};
\ No newline at end of file
index 1c0c259..995b782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa111=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x262748,_0x488874){var _0x1d3dc7=function(_0x5a2735){while(--_0x5a2735){_0x262748['push'](_0x262748['shift']());}};_0x1d3dc7(++_0x488874);}(_0xa111,0x198));var _0x1a11=function(_0x33c6e3,_0x337477){_0x33c6e3=_0x33c6e3-0x0;var _0x167991=_0xa111[_0x33c6e3];return _0x167991;};'use strict';var EventEmitter=require(_0x1a11('0x0'));var MailAccount=require(_0x1a11('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1a11('0x2')](0x0);var events={'afterCreate':_0x1a11('0x3'),'afterUpdate':_0x1a11('0x4'),'afterDestroy':_0x1a11('0x5')};function emitEvent(_0x138904){return function(_0x1ef43b,_0x1a4a36,_0x4708fa){MailAccountEvents['emit'](_0x138904+':'+_0x1ef43b['id'],_0x1ef43b);MailAccountEvents['emit'](_0x138904,_0x1ef43b);_0x4708fa(null);};}for(var e in events){if(events[_0x1a11('0x6')](e)){var event=events[e];MailAccount[_0x1a11('0x7')](e,emitEvent(event));}}module[_0x1a11('0x8')]=MailAccountEvents;
\ No newline at end of file
+var _0x47cd=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','MailAccount'];(function(_0x2e6e98,_0x661a12){var _0x4ceb9d=function(_0x30017a){while(--_0x30017a){_0x2e6e98['push'](_0x2e6e98['shift']());}};_0x4ceb9d(++_0x661a12);}(_0x47cd,0xf7));var _0xd47c=function(_0x5491e1,_0x30315a){_0x5491e1=_0x5491e1-0x0;var _0x2a1f6e=_0x47cd[_0x5491e1];return _0x2a1f6e;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0xd47c('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd47c('0x1')](0x0);var events={'afterCreate':_0xd47c('0x2'),'afterUpdate':'update','afterDestroy':_0xd47c('0x3')};function emitEvent(_0xe6acf0){return function(_0x36afc2,_0x5e783f,_0x924b15){MailAccountEvents[_0xd47c('0x4')](_0xe6acf0+':'+_0x36afc2['id'],_0x36afc2);MailAccountEvents[_0xd47c('0x4')](_0xe6acf0,_0x36afc2);_0x924b15(null);};}for(var e in events){if(events[_0xd47c('0x5')](e)){var event=events[e];MailAccount[_0xd47c('0x6')](e,emitEvent(event));}}module[_0xd47c('0x7')]=MailAccountEvents;
\ No newline at end of file
index a901d33..a1d02e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08d0=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','mail_accounts','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1bbad0,_0x34e914){var _0x463383=function(_0x50dfcf){while(--_0x50dfcf){_0x1bbad0['push'](_0x1bbad0['shift']());}};_0x463383(++_0x34e914);}(_0x08d0,0x133));var _0x008d=function(_0x4a8b9b,_0x21e4e1){_0x4a8b9b=_0x4a8b9b-0x0;var _0x1e50ca=_0x08d0[_0x4a8b9b];return _0x1e50ca;};'use strict';var _=require(_0x008d('0x0'));var util=require(_0x008d('0x1'));var logger=require(_0x008d('0x2'))('api');var moment=require(_0x008d('0x3'));var BPromise=require(_0x008d('0x4'));var rp=require(_0x008d('0x5'));var fs=require('fs');var path=require(_0x008d('0x6'));var rimraf=require(_0x008d('0x7'));var config=require(_0x008d('0x8'));var attributes=require(_0x008d('0x9'));module['exports']=function(_0x400294,_0x3e4086){return _0x400294[_0x008d('0xa')](_0x008d('0xb'),attributes,{'tableName':_0x008d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55c0=['path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api','moment','request-promise'];(function(_0x5cb7de,_0x90f7a2){var _0x199040=function(_0x6c5cb6){while(--_0x6c5cb6){_0x5cb7de['push'](_0x5cb7de['shift']());}};_0x199040(++_0x90f7a2);}(_0x55c0,0x140));var _0x055c=function(_0x304aca,_0x4f8e0b){_0x304aca=_0x304aca-0x0;var _0x3b811c=_0x55c0[_0x304aca];return _0x3b811c;};'use strict';var _=require(_0x055c('0x0'));var util=require('util');var logger=require(_0x055c('0x1'))(_0x055c('0x2'));var moment=require(_0x055c('0x3'));var BPromise=require('bluebird');var rp=require(_0x055c('0x4'));var fs=require('fs');var path=require(_0x055c('0x5'));var rimraf=require(_0x055c('0x6'));var config=require(_0x055c('0x7'));var attributes=require(_0x055c('0x8'));module[_0x055c('0x9')]=function(_0x30d14a,_0x3dba7b){return _0x30d14a[_0x055c('0xa')](_0x055c('0xb'),attributes,{'tableName':_0x055c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 14e2950..2efc3f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3750=['request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailAccount','MailAccount','options','raw','attributes','limit','map','include','model','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','MailApplication','MailServerOut','Smtp','get','omit','Applications','applications','list','orderBy','priority','asc','length','close','autoclose','*,*,*,*','Contacts','defaults','create','List\x20not\x20found','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','MailInteraction','Contact\x20not\x20found','spread','format','interaction','created','attachments','originTo','bcc','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register'];(function(_0x5e9997,_0x243fa6){var _0x959a8b=function(_0xd6f27f){while(--_0xd6f27f){_0x5e9997['push'](_0x5e9997['shift']());}};_0x959a8b(++_0x243fa6);}(_0x3750,0xbb));var _0x0375=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x3750[_0x408e38];return _0x426b0e;};'use strict';var _=require(_0x0375('0x0'));var util=require(_0x0375('0x1'));var moment=require(_0x0375('0x2'));var BPromise=require(_0x0375('0x3'));var rs=require(_0x0375('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0375('0x5'))['db'];var utils=require(_0x0375('0x6'));var logger=require('../../config/logger')(_0x0375('0x7'));var config=require(_0x0375('0x8'));var jayson=require(_0x0375('0x9'));var client=jayson[_0x0375('0xa')][_0x0375('0xb')]({'port':0x232c});config[_0x0375('0xc')]=_['defaults'](config[_0x0375('0xc')],{'host':_0x0375('0xd'),'port':0x18eb});var socket=require(_0x0375('0xe'))(new Redis(config[_0x0375('0xc')]));require(_0x0375('0xf'))[_0x0375('0x10')](socket);function respondWithRpcPromise(_0x57c040,_0x7d6563,_0x2b667c){return new BPromise(function(_0x257974,_0x91f5fb){return client[_0x0375('0x11')](_0x57c040,_0x2b667c)[_0x0375('0x12')](function(_0x36e0f0){logger[_0x0375('0x13')](_0x0375('0x14'),_0x7d6563,_0x0375('0x15'));logger[_0x0375('0x16')](_0x0375('0x17'),_0x7d6563,'request\x20sent',JSON[_0x0375('0x18')](_0x36e0f0));if(_0x36e0f0['error']){if(_0x36e0f0[_0x0375('0x19')]['code']===0x1f4){logger[_0x0375('0x19')]('MailAccount,\x20%s,\x20%s',_0x7d6563,_0x36e0f0[_0x0375('0x19')][_0x0375('0x1a')]);return _0x91f5fb(_0x36e0f0[_0x0375('0x19')][_0x0375('0x1a')]);}logger[_0x0375('0x19')](_0x0375('0x14'),_0x7d6563,_0x36e0f0[_0x0375('0x19')][_0x0375('0x1a')]);return _0x257974(_0x36e0f0[_0x0375('0x19')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x7d6563,_0x0375('0x15'));_0x257974(_0x36e0f0['result']['message']);}})[_0x0375('0x1b')](function(_0x12771d){logger[_0x0375('0x19')]('MailAccount,\x20%s,\x20%s',_0x7d6563,_0x12771d);_0x91f5fb(_0x12771d);});});}exports[_0x0375('0x1c')]=function(_0x2d14b6){var _0x4f0830=this;return new Promise(function(_0x4a9331,_0x5ee87e){return db[_0x0375('0x1d')]['findAll']({'raw':_0x2d14b6[_0x0375('0x1e')]?_0x2d14b6[_0x0375('0x1e')][_0x0375('0x1f')]===undefined?!![]:![]:!![],'where':_0x2d14b6[_0x0375('0x1e')]?_0x2d14b6[_0x0375('0x1e')]['where']||null:null,'attributes':_0x2d14b6[_0x0375('0x1e')]?_0x2d14b6[_0x0375('0x1e')][_0x0375('0x20')]||null:null,'limit':_0x2d14b6['options']?_0x2d14b6[_0x0375('0x1e')][_0x0375('0x21')]||null:null,'include':_0x2d14b6[_0x0375('0x1e')]?_0x2d14b6[_0x0375('0x1e')]['include']?_[_0x0375('0x22')](_0x2d14b6[_0x0375('0x1e')]['include'],function(_0x4c2285){return{'model':db[_0x4c2285['model']],'as':_0x4c2285['as'],'attributes':_0x4c2285['attributes'],'include':_0x4c2285[_0x0375('0x23')]?_[_0x0375('0x22')](_0x4c2285[_0x0375('0x23')],function(_0x527204){return{'model':db[_0x527204[_0x0375('0x24')]],'as':_0x527204['as'],'attributes':_0x527204['attributes'],'include':_0x527204[_0x0375('0x23')]?_[_0x0375('0x22')](_0x527204[_0x0375('0x23')],function(_0x43273c){return{'model':db[_0x43273c[_0x0375('0x24')]],'as':_0x43273c['as'],'attributes':_0x43273c[_0x0375('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0375('0x12')](function(_0x4fe547){logger[_0x0375('0x13')](_0x0375('0x1c'),_0x2d14b6);logger['debug'](_0x0375('0x1c'),_0x2d14b6,JSON['stringify'](_0x4fe547));_0x4a9331(_0x4fe547);})[_0x0375('0x1b')](function(_0x129416){logger['error'](_0x0375('0x1c'),_0x129416[_0x0375('0x1a')],_0x2d14b6);_0x5ee87e(_0x4f0830['error'](0x1f4,_0x129416['message']));});});};exports[_0x0375('0x25')]=function(_0x3379ed){var _0x18b054=this;return new Promise(function(_0x5f15a5,_0x4d24be){return db[_0x0375('0x1d')][_0x0375('0x26')]({'raw':_0x3379ed[_0x0375('0x1e')]?_0x3379ed[_0x0375('0x1e')][_0x0375('0x1f')]===undefined?!![]:![]:!![],'where':_0x3379ed['options']?_0x3379ed['options']['where']||null:null,'attributes':_0x3379ed['options']?_0x3379ed['options'][_0x0375('0x20')]||null:null,'include':_0x3379ed[_0x0375('0x1e')]?_0x3379ed[_0x0375('0x1e')][_0x0375('0x23')]?_[_0x0375('0x22')](_0x3379ed['options'][_0x0375('0x23')],function(_0x11804f){return{'model':db[_0x11804f['model']],'as':_0x11804f['as'],'attributes':_0x11804f[_0x0375('0x20')],'include':_0x11804f[_0x0375('0x23')]?_[_0x0375('0x22')](_0x11804f[_0x0375('0x23')],function(_0x13e6a4){return{'model':db[_0x13e6a4[_0x0375('0x24')]],'as':_0x13e6a4['as'],'attributes':_0x13e6a4[_0x0375('0x20')],'include':_0x13e6a4[_0x0375('0x23')]?_['map'](_0x13e6a4[_0x0375('0x23')],function(_0x44d566){return{'model':db[_0x44d566[_0x0375('0x24')]],'as':_0x44d566['as'],'attributes':_0x44d566[_0x0375('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0375('0x12')](function(_0xcdb334){logger['info'](_0x0375('0x25'),_0x3379ed);logger['debug']('ShowMailAccount',_0x3379ed,JSON[_0x0375('0x18')](_0xcdb334));_0x5f15a5(_0xcdb334);})['catch'](function(_0xbd491d){logger['error'](_0x0375('0x25'),_0xbd491d[_0x0375('0x1a')],_0x3379ed);_0x4d24be(_0x18b054['error'](0x1f4,_0xbd491d['message']));});});};exports[_0x0375('0x27')]=function(_0x2e60be){var _0x1f2065=this;return new Promise(function(_0x963231,_0xc6a86c){var _0x49878f={'body':_0x2e60be[_0x0375('0x28')],'channel':_0x0375('0x29')};var _0x3f1532=_[_0x0375('0x2a')](_[_0x0375('0x2b')](db[_0x0375('0x2c')][_0x0375('0x2d')]),['createdAt',_0x0375('0x2e'),_0x0375('0x2f'),_0x0375('0x30')]);var _0x5de35e=![];if(_0x2e60be[_0x0375('0x28')]['id']){delete _0x2e60be['body']['id'];}if(_[_0x0375('0x31')](_0x2e60be[_0x0375('0x28')][_0x0375('0x32')])){return _0xc6a86c(_0x1f2065['error'](0x1f4,_0x0375('0x33')));}if(_[_0x0375('0x31')](_0x2e60be[_0x0375('0x28')]['body'])||_0x2e60be[_0x0375('0x28')][_0x0375('0x28')]===''){return _0xc6a86c(_0x1f2065[_0x0375('0x19')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x0375('0x31')](_0x2e60be['body'][_0x0375('0x34')])){return _0xc6a86c(_0x1f2065[_0x0375('0x19')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f1532));}if(!_['includes'](_0x3f1532,_0x2e60be['body'][_0x0375('0x34')])){return _0xc6a86c(_0x1f2065[_0x0375('0x19')](0x1f4,_0x0375('0x35')+_0x3f1532));}var _0x49a9a9={};_0x49a9a9[_0x2e60be[_0x0375('0x28')]['mapKey']]=_0x2e60be['body'][_0x0375('0x32')];return db['MailAccount'][_0x0375('0x26')]({'where':{'id':_0x2e60be[_0x0375('0x36')]['id']},'include':[{'model':db[_0x0375('0x37')],'as':_0x0375('0x38'),'include':[{'model':db[_0x0375('0x2c')],'as':'Contacts','where':_0x49a9a9,'limit':0x1,'order':[[_0x0375('0x2e'),_0x0375('0x39')]]}]},{'model':db[_0x0375('0x3a')],'as':'Applications'},{'model':db[_0x0375('0x3b')],'as':_0x0375('0x3c')}]})[_0x0375('0x12')](function(_0x50fad9){if(_0x50fad9&&_0x50fad9['List']){var _0x1ebcce=_0x50fad9[_0x0375('0x3d')]({'plain':!![]});_0x49878f[_0x0375('0x36')]=_[_0x0375('0x3e')](_0x1ebcce,[_0x0375('0x3f'),_0x0375('0x38')]);_0x49878f[_0x0375('0x40')]=_0x1ebcce[_0x0375('0x3f')];_0x49878f[_0x0375('0x41')]=_0x1ebcce['List'];_0x49878f[_0x0375('0x40')]=_[_0x0375('0x42')](_0x49878f[_0x0375('0x40')],[_0x0375('0x43')],[_0x0375('0x44')]);if(_0x49878f[_0x0375('0x36')]&&_0x49878f[_0x0375('0x36')]['autoclose']){_0x49878f[_0x0375('0x40')]['push']({'id':0x0,'priority':_0x49878f[_0x0375('0x40')][_0x0375('0x45')]+0x1,'app':_0x0375('0x46'),'appdata':_0x0375('0x47'),'interval':_0x0375('0x48')});}if(_0x49878f[_0x0375('0x36')]['Applications']){delete _0x49878f['account'][_0x0375('0x3f')];}if(_0x49878f[_0x0375('0x36')][_0x0375('0x38')]){delete _0x49878f[_0x0375('0x36')][_0x0375('0x38')];}if(_0x1ebcce[_0x0375('0x38')][_0x0375('0x49')]['length']){return _0x1ebcce[_0x0375('0x38')][_0x0375('0x49')][0x0];}var _0x43e9ca=_[_0x0375('0x4a')](_0x2e60be[_0x0375('0x28')],{'firstName':_0x2e60be[_0x0375('0x28')][_0x0375('0x32')],'ListId':_0x1ebcce[_0x0375('0x30')]});_0x43e9ca[_0x2e60be[_0x0375('0x28')][_0x0375('0x34')]]=_0x2e60be['body']['from'];return db['CmContact'][_0x0375('0x4b')](_0x43e9ca);}else{throw new Error(_0x0375('0x4c'));}})[_0x0375('0x12')](function(_0x4c0799){_0x49878f['contact']=_0x4c0799;if(_0x4c0799){if(!_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x4d')]){_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')]['messageId']=rs[_0x0375('0x4e')]()+'\x20'+_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')]['from'];}var _0x5ecb91={'ContactId':_0x4c0799['id'],'MailAccountId':_0x2e60be[_0x0375('0x36')]['id'],'inReplyTo':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x4d')],'to':_0x2e60be[_0x0375('0x28')]['message'][_0x0375('0x32')],'cc':_0x2e60be[_0x0375('0x28')]['message']['cc'],'subject':_0x2e60be[_0x0375('0x28')]['message'][_0x0375('0x4f')],'attach':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x50')],'lastMsgAt':moment()['format'](_0x0375('0x51')),'lastMsgDirection':'in','lastMsgBody':_0x2e60be[_0x0375('0x28')][_0x0375('0x28')]};return db['MailInteraction'][_0x0375('0x26')]({'where':{'closed':![],'MailAccountId':_0x2e60be['account']['id']},'include':[{'model':db[_0x0375('0x52')],'as':_0x0375('0x53'),'attributes':[_0x0375('0x4d')],'where':{'messageId':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')]['inReplyTo']}}]})['then'](function(_0x527a24){if(_0x527a24){return[_0x527a24,![]];}return db[_0x0375('0x54')][_0x0375('0x4b')](_0x5ecb91)[_0x0375('0x12')](function(_0x435dd9){return[_0x435dd9,!![]];});});}else{throw new Error(_0x0375('0x55'));}})[_0x0375('0x56')](function(_0x588667,_0x32a706){if(_0x588667){_0x5de35e=_0x32a706;if(!_0x32a706){return _0x588667['update']({'inReplyTo':_0x2e60be['body'][_0x0375('0x1a')][_0x0375('0x4d')],'to':_0x2e60be[_0x0375('0x28')]['message']['from'],'cc':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')]['cc'],'subject':_0x2e60be[_0x0375('0x28')]['message'][_0x0375('0x4f')],'attach':_0x588667['attach']?_0x588667[_0x0375('0x50')]:_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x50')],'substatus':null,'substatusAt':moment()[_0x0375('0x57')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x0375('0x57')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x2e60be[_0x0375('0x28')][_0x0375('0x28')]});}else{return _0x588667;}}})[_0x0375('0x12')](function(_0x2a119a){_0x49878f[_0x0375('0x58')]=_0x2a119a[_0x0375('0x3d')]({'plain':!![]});_0x49878f[_0x0375('0x58')][_0x0375('0x59')]=_0x5de35e;return db[_0x0375('0x52')][_0x0375('0x4b')]({'body':_0x2e60be[_0x0375('0x28')][_0x0375('0x28')],'MailAccountId':_0x2e60be['account']['id'],'MailInteractionId':_0x2a119a['id'],'direction':'in','ContactId':_0x49878f['contact']['id'],'messageId':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x4d')],'from':_0x2e60be[_0x0375('0x28')]['message'][_0x0375('0x32')],'to':_0x2e60be['body'][_0x0375('0x1a')]['to'],'cc':_0x2e60be[_0x0375('0x28')]['message']['cc'],'subject':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x4f')],'attach':_0x2e60be[_0x0375('0x28')]['message'][_0x0375('0x50')],'Attachments':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x5a')],'originTo':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x5b')],'originCc':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')]['originCc'],'bcc':_0x2e60be[_0x0375('0x28')][_0x0375('0x1a')][_0x0375('0x5c')]},{'include':[{'model':db['Attachment'],'as':_0x0375('0x5d')}]});})[_0x0375('0x12')](function(_0x1d4229){_0x49878f[_0x0375('0x1a')]=_0x1d4229;if(_0x49878f['interaction']['UserId']){return db[_0x0375('0x5e')][_0x0375('0x26')]({'attributes':['id',_0x0375('0x5f')],'where':{'id':_0x49878f[_0x0375('0x58')][_0x0375('0x60')]}})['then'](function(_0x13cce5){if(_0x13cce5){_0x49878f[_0x0375('0x40')][_0x0375('0x61')]({'id':0x0,'priority':0x0,'app':_0x0375('0x62'),'appdata':_0x13cce5[_0x0375('0x5f')]+','+(_0x49878f['account'][_0x0375('0x63')]||0xa),'interval':_0x0375('0x48')});}return respondWithRpcPromise(_0x0375('0x64'),'startRouting',_0x49878f);});}return respondWithRpcPromise(_0x0375('0x64'),_0x0375('0x65'),_0x49878f);})[_0x0375('0x12')](function(_0x50a368){_0x963231(_0x50a368);})[_0x0375('0x1b')](function(_0xf2eed8){_0xc6a86c(_0x1f2065[_0x0375('0x19')](0x1f4,_0xf2eed8[_0x0375('0x1a')]));});});};
\ No newline at end of file
+var _0x41bb=['Attachment','Attachments','UserId','name','unshift','Start','startRouting','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','model','map','then','ShowMailAccount','find','catch','NotifyMailAccount','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','List','get','omit','Applications','applications','list','orderBy','asc','autoclose','push','length','close','*,*,*,*','defaults','from','create','List\x20not\x20found','contact','messageId','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','YYYY-MM-DD\x20HH:mm:ss','interaction','originTo','originCc'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0x41bb,0xc5));var _0xb41b=function(_0x42db0b,_0x2b7c94){_0x42db0b=_0x42db0b-0x0;var _0x5928ca=_0x41bb[_0x42db0b];return _0x5928ca;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232c});config['redis']=_['defaults'](config[_0xb41b('0xa')],{'host':_0xb41b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb41b('0xa')]));require(_0xb41b('0xc'))[_0xb41b('0xd')](socket);function respondWithRpcPromise(_0xa2aa66,_0x26d531,_0x11f049){return new BPromise(function(_0x5e5c5b,_0x4baa03){return client[_0xb41b('0xe')](_0xa2aa66,_0x11f049)['then'](function(_0x2e906c){logger[_0xb41b('0xf')](_0xb41b('0x10'),_0x26d531,_0xb41b('0x11'));logger[_0xb41b('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x26d531,_0xb41b('0x11'),JSON[_0xb41b('0x13')](_0x2e906c));if(_0x2e906c[_0xb41b('0x14')]){if(_0x2e906c[_0xb41b('0x14')][_0xb41b('0x15')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x26d531,_0x2e906c['error'][_0xb41b('0x16')]);return _0x4baa03(_0x2e906c[_0xb41b('0x14')][_0xb41b('0x16')]);}logger[_0xb41b('0x14')](_0xb41b('0x10'),_0x26d531,_0x2e906c['error'][_0xb41b('0x16')]);return _0x5e5c5b(_0x2e906c[_0xb41b('0x14')][_0xb41b('0x16')]);}else{logger[_0xb41b('0xf')](_0xb41b('0x10'),_0x26d531,_0xb41b('0x11'));_0x5e5c5b(_0x2e906c[_0xb41b('0x17')]['message']);}})['catch'](function(_0x5da8e3){logger[_0xb41b('0x14')]('MailAccount,\x20%s,\x20%s',_0x26d531,_0x5da8e3);_0x4baa03(_0x5da8e3);});});}exports[_0xb41b('0x18')]=function(_0x1de9ea){var _0x23700f=this;return new Promise(function(_0x5b7332,_0x53bc44){return db[_0xb41b('0x19')][_0xb41b('0x1a')]({'raw':_0x1de9ea[_0xb41b('0x1b')]?_0x1de9ea[_0xb41b('0x1b')][_0xb41b('0x1c')]===undefined?!![]:![]:!![],'where':_0x1de9ea[_0xb41b('0x1b')]?_0x1de9ea['options']['where']||null:null,'attributes':_0x1de9ea[_0xb41b('0x1b')]?_0x1de9ea[_0xb41b('0x1b')][_0xb41b('0x1d')]||null:null,'limit':_0x1de9ea['options']?_0x1de9ea[_0xb41b('0x1b')][_0xb41b('0x1e')]||null:null,'include':_0x1de9ea['options']?_0x1de9ea[_0xb41b('0x1b')][_0xb41b('0x1f')]?_['map'](_0x1de9ea[_0xb41b('0x1b')]['include'],function(_0x2d0f27){return{'model':db[_0x2d0f27[_0xb41b('0x20')]],'as':_0x2d0f27['as'],'attributes':_0x2d0f27['attributes'],'include':_0x2d0f27[_0xb41b('0x1f')]?_[_0xb41b('0x21')](_0x2d0f27['include'],function(_0x4c2e41){return{'model':db[_0x4c2e41[_0xb41b('0x20')]],'as':_0x4c2e41['as'],'attributes':_0x4c2e41[_0xb41b('0x1d')],'include':_0x4c2e41[_0xb41b('0x1f')]?_[_0xb41b('0x21')](_0x4c2e41[_0xb41b('0x1f')],function(_0x181cbd){return{'model':db[_0x181cbd[_0xb41b('0x20')]],'as':_0x181cbd['as'],'attributes':_0x181cbd['attributes']};}):[]};}):[]};}):[]:[]})[_0xb41b('0x22')](function(_0xb68029){logger['info'](_0xb41b('0x18'),_0x1de9ea);logger['debug'](_0xb41b('0x18'),_0x1de9ea,JSON[_0xb41b('0x13')](_0xb68029));_0x5b7332(_0xb68029);})['catch'](function(_0x23a6ed){logger['error'](_0xb41b('0x18'),_0x23a6ed[_0xb41b('0x16')],_0x1de9ea);_0x53bc44(_0x23700f['error'](0x1f4,_0x23a6ed[_0xb41b('0x16')]));});});};exports[_0xb41b('0x23')]=function(_0x14c2e7){var _0x4503cf=this;return new Promise(function(_0x260170,_0x195d63){return db[_0xb41b('0x19')][_0xb41b('0x24')]({'raw':_0x14c2e7[_0xb41b('0x1b')]?_0x14c2e7[_0xb41b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x14c2e7[_0xb41b('0x1b')]?_0x14c2e7['options']['where']||null:null,'attributes':_0x14c2e7[_0xb41b('0x1b')]?_0x14c2e7[_0xb41b('0x1b')][_0xb41b('0x1d')]||null:null,'include':_0x14c2e7[_0xb41b('0x1b')]?_0x14c2e7[_0xb41b('0x1b')][_0xb41b('0x1f')]?_[_0xb41b('0x21')](_0x14c2e7[_0xb41b('0x1b')][_0xb41b('0x1f')],function(_0x1d3e90){return{'model':db[_0x1d3e90[_0xb41b('0x20')]],'as':_0x1d3e90['as'],'attributes':_0x1d3e90['attributes'],'include':_0x1d3e90[_0xb41b('0x1f')]?_[_0xb41b('0x21')](_0x1d3e90[_0xb41b('0x1f')],function(_0x23ac00){return{'model':db[_0x23ac00[_0xb41b('0x20')]],'as':_0x23ac00['as'],'attributes':_0x23ac00[_0xb41b('0x1d')],'include':_0x23ac00['include']?_['map'](_0x23ac00[_0xb41b('0x1f')],function(_0x375bb9){return{'model':db[_0x375bb9['model']],'as':_0x375bb9['as'],'attributes':_0x375bb9[_0xb41b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb41b('0x22')](function(_0x2622fd){logger[_0xb41b('0xf')](_0xb41b('0x23'),_0x14c2e7);logger['debug'](_0xb41b('0x23'),_0x14c2e7,JSON['stringify'](_0x2622fd));_0x260170(_0x2622fd);})[_0xb41b('0x25')](function(_0x22c741){logger[_0xb41b('0x14')](_0xb41b('0x23'),_0x22c741[_0xb41b('0x16')],_0x14c2e7);_0x195d63(_0x4503cf[_0xb41b('0x14')](0x1f4,_0x22c741[_0xb41b('0x16')]));});});};exports[_0xb41b('0x26')]=function(_0x2b0721){var _0x578b67=this;return new Promise(function(_0x49e8c4,_0x4e0a61){var _0x3a4e31={'body':_0x2b0721['body'],'channel':'mail'};var _0x781302=_['difference'](_[_0xb41b('0x27')](db[_0xb41b('0x28')][_0xb41b('0x29')]),[_0xb41b('0x2a'),_0xb41b('0x2b'),_0xb41b('0x2c'),_0xb41b('0x2d')]);var _0x57e043=![];if(_0x2b0721[_0xb41b('0x2e')]['id']){delete _0x2b0721[_0xb41b('0x2e')]['id'];}if(_[_0xb41b('0x2f')](_0x2b0721[_0xb41b('0x2e')]['from'])){return _0x4e0a61(_0x578b67[_0xb41b('0x14')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xb41b('0x2f')](_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x2e')])||_0x2b0721['body']['body']===''){return _0x4e0a61(_0x578b67[_0xb41b('0x14')](0x1f4,_0xb41b('0x30')));}if(_[_0xb41b('0x2f')](_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x31')])){return _0x4e0a61(_0x578b67[_0xb41b('0x14')](0x1f4,_0xb41b('0x32')+_0x781302));}if(!_['includes'](_0x781302,_0x2b0721['body'][_0xb41b('0x31')])){return _0x4e0a61(_0x578b67['error'](0x1f4,_0xb41b('0x33')+_0x781302));}var _0x5b64b4={};_0x5b64b4[_0x2b0721[_0xb41b('0x2e')]['mapKey']]=_0x2b0721[_0xb41b('0x2e')]['from'];return db[_0xb41b('0x19')][_0xb41b('0x24')]({'where':{'id':_0x2b0721[_0xb41b('0x34')]['id']},'include':[{'model':db[_0xb41b('0x35')],'as':'List','include':[{'model':db[_0xb41b('0x28')],'as':_0xb41b('0x36'),'where':_0x5b64b4,'limit':0x1,'order':[['updatedAt',_0xb41b('0x37')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xb41b('0x22')](function(_0x23ea63){if(_0x23ea63&&_0x23ea63[_0xb41b('0x38')]){var _0x3128a7=_0x23ea63[_0xb41b('0x39')]({'plain':!![]});_0x3a4e31[_0xb41b('0x34')]=_[_0xb41b('0x3a')](_0x3128a7,[_0xb41b('0x3b'),_0xb41b('0x38')]);_0x3a4e31[_0xb41b('0x3c')]=_0x3128a7[_0xb41b('0x3b')];_0x3a4e31[_0xb41b('0x3d')]=_0x3128a7[_0xb41b('0x38')];_0x3a4e31[_0xb41b('0x3c')]=_[_0xb41b('0x3e')](_0x3a4e31[_0xb41b('0x3c')],['priority'],[_0xb41b('0x3f')]);if(_0x3a4e31['account']&&_0x3a4e31['account'][_0xb41b('0x40')]){_0x3a4e31[_0xb41b('0x3c')][_0xb41b('0x41')]({'id':0x0,'priority':_0x3a4e31[_0xb41b('0x3c')][_0xb41b('0x42')]+0x1,'app':_0xb41b('0x43'),'appdata':_0xb41b('0x40'),'interval':_0xb41b('0x44')});}if(_0x3a4e31[_0xb41b('0x34')][_0xb41b('0x3b')]){delete _0x3a4e31[_0xb41b('0x34')][_0xb41b('0x3b')];}if(_0x3a4e31[_0xb41b('0x34')][_0xb41b('0x38')]){delete _0x3a4e31[_0xb41b('0x34')][_0xb41b('0x38')];}if(_0x3128a7[_0xb41b('0x38')][_0xb41b('0x36')][_0xb41b('0x42')]){return _0x3128a7[_0xb41b('0x38')][_0xb41b('0x36')][0x0];}var _0x571a8c=_[_0xb41b('0x45')](_0x2b0721['body'],{'firstName':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x46')],'ListId':_0x3128a7[_0xb41b('0x2d')]});_0x571a8c[_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x31')]]=_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x46')];return db['CmContact'][_0xb41b('0x47')](_0x571a8c);}else{throw new Error(_0xb41b('0x48'));}})[_0xb41b('0x22')](function(_0x4ce48e){_0x3a4e31[_0xb41b('0x49')]=_0x4ce48e;if(_0x4ce48e){if(!_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x4a')]){_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x4a')]=rs['generate']()+'\x20'+_0x2b0721['body'][_0xb41b('0x16')][_0xb41b('0x46')];}var _0x50d28c={'ContactId':_0x4ce48e['id'],'MailAccountId':_0x2b0721[_0xb41b('0x34')]['id'],'inReplyTo':_0x2b0721[_0xb41b('0x2e')]['message'][_0xb41b('0x4a')],'to':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x46')],'cc':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')]['cc'],'subject':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x4b')],'attach':_0x2b0721[_0xb41b('0x2e')]['message'][_0xb41b('0x4c')],'lastMsgAt':moment()[_0xb41b('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x2b0721['body'][_0xb41b('0x2e')]};return db[_0xb41b('0x4e')][_0xb41b('0x24')]({'where':{'closed':![],'MailAccountId':_0x2b0721['account']['id']},'include':[{'model':db[_0xb41b('0x4f')],'as':_0xb41b('0x50'),'attributes':[_0xb41b('0x4a')],'where':{'messageId':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x51')]}}]})[_0xb41b('0x22')](function(_0x20b91e){if(_0x20b91e){return[_0x20b91e,![]];}return db[_0xb41b('0x4e')][_0xb41b('0x47')](_0x50d28c)['then'](function(_0x44a12e){return[_0x44a12e,!![]];});});}else{throw new Error(_0xb41b('0x52'));}})['spread'](function(_0x2a46ff,_0x32ef07){if(_0x2a46ff){_0x57e043=_0x32ef07;if(!_0x32ef07){return _0x2a46ff[_0xb41b('0x53')]({'inReplyTo':_0x2b0721['body'][_0xb41b('0x16')][_0xb41b('0x4a')],'to':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x46')],'cc':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')]['cc'],'subject':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x4b')],'attach':_0x2a46ff['attach']?_0x2a46ff['attach']:_0x2b0721['body']['message'][_0xb41b('0x4c')],'substatus':null,'substatusAt':moment()[_0xb41b('0x4d')](_0xb41b('0x54')),'lastMsgAt':moment()[_0xb41b('0x4d')](_0xb41b('0x54')),'lastMsgDirection':'in','lastMsgBody':_0x2b0721[_0xb41b('0x2e')]['body']});}else{return _0x2a46ff;}}})[_0xb41b('0x22')](function(_0x5e34a2){_0x3a4e31[_0xb41b('0x55')]=_0x5e34a2['get']({'plain':!![]});_0x3a4e31[_0xb41b('0x55')]['created']=_0x57e043;return db[_0xb41b('0x4f')][_0xb41b('0x47')]({'body':_0x2b0721['body'][_0xb41b('0x2e')],'MailAccountId':_0x2b0721[_0xb41b('0x34')]['id'],'MailInteractionId':_0x5e34a2['id'],'direction':'in','ContactId':_0x3a4e31[_0xb41b('0x49')]['id'],'messageId':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x4a')],'from':_0x2b0721[_0xb41b('0x2e')]['message'][_0xb41b('0x46')],'to':_0x2b0721['body'][_0xb41b('0x16')]['to'],'cc':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')]['cc'],'subject':_0x2b0721['body']['message']['subject'],'attach':_0x2b0721['body'][_0xb41b('0x16')][_0xb41b('0x4c')],'Attachments':_0x2b0721[_0xb41b('0x2e')]['message']['attachments'],'originTo':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x56')],'originCc':_0x2b0721[_0xb41b('0x2e')][_0xb41b('0x16')][_0xb41b('0x57')],'bcc':_0x2b0721[_0xb41b('0x2e')]['message']['bcc']},{'include':[{'model':db[_0xb41b('0x58')],'as':_0xb41b('0x59')}]});})['then'](function(_0x275e12){_0x3a4e31['message']=_0x275e12;if(_0x3a4e31[_0xb41b('0x55')][_0xb41b('0x5a')]){return db['User'][_0xb41b('0x24')]({'attributes':['id',_0xb41b('0x5b')],'where':{'id':_0x3a4e31['interaction']['UserId']}})[_0xb41b('0x22')](function(_0x17abee){if(_0x17abee){_0x3a4e31['applications'][_0xb41b('0x5c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x17abee[_0xb41b('0x5b')]+','+(_0x3a4e31[_0xb41b('0x34')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb41b('0x5d'),_0xb41b('0x5e'),_0x3a4e31);});}return respondWithRpcPromise('Start',_0xb41b('0x5e'),_0x3a4e31);})[_0xb41b('0x22')](function(_0x2ca89b){_0x49e8c4(_0x2ca89b);})['catch'](function(_0x1fb90e){_0x4e0a61(_0x578b67['error'](0x1f4,_0x1fb90e['message']));});});};
\ No newline at end of file
index bc8faab..3517bf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x535f=['removeListener','register','mailAccount:','save','remove','emit'];(function(_0x515bf6,_0x5491ad){var _0x5c0c1f=function(_0x564e3a){while(--_0x564e3a){_0x515bf6['push'](_0x515bf6['shift']());}};_0x5c0c1f(++_0x5491ad);}(_0x535f,0x111));var _0xf535=function(_0x112851,_0x2c8ad4){_0x112851=_0x112851-0x0;var _0x7cbafb=_0x535f[_0x112851];return _0x7cbafb;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xf535('0x0'),_0xf535('0x1'),'update'];function createListener(_0x3d9c4d,_0x3a8c17){return function(_0x64d0bc){_0x3a8c17[_0xf535('0x2')](_0x3d9c4d,_0x64d0bc);};}function removeListener(_0x4ff0b3,_0xd1ee93){return function(){MailAccountEvents[_0xf535('0x3')](_0x4ff0b3,_0xd1ee93);};}exports[_0xf535('0x4')]=function(_0x30936d){for(var _0x41ca74=0x0,_0xc74104=events['length'];_0x41ca74<_0xc74104;_0x41ca74++){var _0x510b86=events[_0x41ca74];var _0x17f72e=createListener(_0xf535('0x5')+_0x510b86,_0x30936d);MailAccountEvents['on'](_0x510b86,_0x17f72e);}};
\ No newline at end of file
+var _0xaa37=['removeListener','register','mailAccount:','./mailAccount.events','save','remove','update','emit'];(function(_0x49a84b,_0x17c1be){var _0x171650=function(_0x1cc9cf){while(--_0x1cc9cf){_0x49a84b['push'](_0x49a84b['shift']());}};_0x171650(++_0x17c1be);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xaa37[_0x53ccf2];return _0x5a2964;};'use strict';var MailAccountEvents=require(_0x7aa3('0x0'));var events=[_0x7aa3('0x1'),_0x7aa3('0x2'),_0x7aa3('0x3')];function createListener(_0x4dcf7a,_0xa0e7e9){return function(_0x27adcf){_0xa0e7e9[_0x7aa3('0x4')](_0x4dcf7a,_0x27adcf);};}function removeListener(_0x11e64c,_0x334919){return function(){MailAccountEvents[_0x7aa3('0x5')](_0x11e64c,_0x334919);};}exports[_0x7aa3('0x6')]=function(_0x5b738a){for(var _0x437b90=0x0,_0xbbcc8a=events['length'];_0x437b90<_0xbbcc8a;_0x437b90++){var _0x100894=events[_0x437b90];var _0x390c82=createListener(_0x7aa3('0x7')+_0x100894,_0x5b738a);MailAccountEvents['on'](_0x100894,_0x390c82);}};
\ No newline at end of file
index a7e3374..850f763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97c1=['util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','show','put','/:id','isAuthenticated','destroy','exports','multer'];(function(_0x66eec8,_0x26d1ff){var _0x3375a0=function(_0x144db1){while(--_0x144db1){_0x66eec8['push'](_0x66eec8['shift']());}};_0x3375a0(++_0x26d1ff);}(_0x97c1,0xdf));var _0x197c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x97c1[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var path=require('path');var timeout=require(_0x197c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x197c('0x3'));var interaction=require(_0x197c('0x4'));var config=require(_0x197c('0x5'));var controller=require(_0x197c('0x6'));router[_0x197c('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x197c('0x8')]);router[_0x197c('0x9')](_0x197c('0xa'),auth[_0x197c('0xb')](),controller['update']);router['delete'](_0x197c('0xa'),auth['isAuthenticated'](),controller[_0x197c('0xc')]);module[_0x197c('0xd')]=router;
\ No newline at end of file
+var _0x6b20=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer'];(function(_0x4ac96c,_0x2785d5){var _0x31b35e=function(_0x390915){while(--_0x390915){_0x4ac96c['push'](_0x4ac96c['shift']());}};_0x31b35e(++_0x2785d5);}(_0x6b20,0xd1));var _0x06b2=function(_0x474fe1,_0x312977){_0x474fe1=_0x474fe1-0x0;var _0x3ac2d6=_0x6b20[_0x474fe1];return _0x3ac2d6;};'use strict';var multer=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var path=require('path');var timeout=require(_0x06b2('0x2'));var express=require('express');var router=express[_0x06b2('0x3')]();var auth=require(_0x06b2('0x4'));var interaction=require(_0x06b2('0x5'));var config=require('../../config/environment');var controller=require(_0x06b2('0x6'));router[_0x06b2('0x7')](_0x06b2('0x8'),auth[_0x06b2('0x9')](),controller[_0x06b2('0xa')]);router[_0x06b2('0xb')](_0x06b2('0x8'),auth['isAuthenticated'](),controller[_0x06b2('0xc')]);router[_0x06b2('0xd')](_0x06b2('0x8'),auth['isAuthenticated'](),controller[_0x06b2('0xe')]);module['exports']=router;
\ No newline at end of file
index c4d351d..bde0f69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e2=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x491842,_0x4ca9af){var _0x54b04e=function(_0x1f62b8){while(--_0x1f62b8){_0x491842['push'](_0x491842['shift']());}};_0x54b04e(++_0x4ca9af);}(_0x28e2,0x1a5));var _0x228e=function(_0x17fec7,_0x2c0578){_0x17fec7=_0x17fec7-0x0;var _0x330511=_0x28e2[_0x17fec7];return _0x330511;};'use strict';var Sequelize=require(_0x228e('0x0'));module[_0x228e('0x1')]={'priority':{'type':Sequelize[_0x228e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x228e('0x3')],'allowNull':![],'defaultValue':_0x228e('0x4')},'appdata':{'type':Sequelize[_0x228e('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x4345=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x174fae,_0x5d7bad){var _0x5d8970=function(_0x3bfe83){while(--_0x3bfe83){_0x174fae['push'](_0x174fae['shift']());}};_0x5d8970(++_0x5d7bad);}(_0x4345,0x71));var _0x5434=function(_0x33c871,_0x345dc6){_0x33c871=_0x33c871-0x0;var _0x1c083c=_0x4345[_0x33c871];return _0x1c083c;};'use strict';var Sequelize=require('sequelize');module[_0x5434('0x0')]={'priority':{'type':Sequelize[_0x5434('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5434('0x2')],'allowNull':![],'defaultValue':_0x5434('0x3')},'appdata':{'type':Sequelize[_0x5434('0x4')]()},'description':{'type':Sequelize[_0x5434('0x2')]},'interval':{'type':Sequelize[_0x5434('0x2')],'defaultValue':_0x5434('0x5')}};
\ No newline at end of file
index a8efd30..74e8593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62f7=['bluebird','mustache','path','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1f025c,_0x295eaf){var _0x173754=function(_0x1e08e2){while(--_0x1e08e2){_0x1f025c['push'](_0x1f025c['shift']());}};_0x173754(++_0x295eaf);}(_0x62f7,0x1e9));var _0x762f=function(_0x53e68c,_0x3ca788){_0x53e68c=_0x53e68c-0x0;var _0x23600d=_0x62f7[_0x53e68c];return _0x23600d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x762f('0x0'));var rimraf=require(_0x762f('0x1'));var zipdir=require(_0x762f('0x2'));var jsonpatch=require(_0x762f('0x3'));var rp=require(_0x762f('0x4'));var moment=require(_0x762f('0x5'));var BPromise=require(_0x762f('0x6'));var Mustache=require(_0x762f('0x7'));var util=require('util');var path=require(_0x762f('0x8'));var sox=require('sox');var csv=require(_0x762f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x762f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x762f('0xb'));var deskjs=require(_0x762f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x762f('0xd'));var Redis=require(_0x762f('0xe'));var authService=require(_0x762f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x762f('0x10'));var hardwareService=require(_0x762f('0x11'));var logger=require(_0x762f('0x12'))(_0x762f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x762f('0x14'))['db'];function respondWithStatusCode(_0x4da5f8,_0x36f360){_0x36f360=_0x36f360||0xcc;return function(_0x37f63d){if(_0x37f63d){return _0x4da5f8[_0x762f('0x15')](_0x36f360);}return _0x4da5f8[_0x762f('0x16')](_0x36f360)[_0x762f('0x17')]();};}function respondWithResult(_0x230241,_0x313249){_0x313249=_0x313249||0xc8;return function(_0x563839){if(_0x563839){return _0x230241[_0x762f('0x16')](_0x313249)[_0x762f('0x18')](_0x563839);}};}function respondWithFilteredResult(_0x2469e1,_0x3c4aaa){return function(_0x594a17){if(_0x594a17){var _0x1e2da1=_0x594a17[_0x762f('0x19')],_0x465e67=_0x3c4aaa['offset'],_0x2fbfe0=_0x3c4aaa[_0x762f('0x1a')]+_0x3c4aaa[_0x762f('0x1b')],_0x27ef21;if(_0x2fbfe0>=_0x1e2da1){_0x2fbfe0=_0x1e2da1;_0x27ef21=0xc8;}else{_0x27ef21=0xce;}_0x2469e1[_0x762f('0x16')](_0x27ef21);return _0x2469e1['set']('Content-Range',_0x465e67+'-'+_0x2fbfe0+'/'+_0x1e2da1)[_0x762f('0x18')](_0x594a17);}return null;};}function patchUpdates(_0x45792c){return function(_0xe379da){try{jsonpatch[_0x762f('0x1c')](_0xe379da,_0x45792c,!![]);}catch(_0x4b35df){return BPromise[_0x762f('0x1d')](_0x4b35df);}return _0xe379da[_0x762f('0x1e')]();};}function saveUpdates(_0x2d7d79,_0x3cdffb){return function(_0x5ded2c){if(_0x5ded2c){return _0x5ded2c[_0x762f('0x1f')](_0x2d7d79)[_0x762f('0x20')](function(_0xf9c759){return _0xf9c759;});}return null;};}function removeEntity(_0x556379,_0x377c34){return function(_0x3565b9){if(_0x3565b9){return _0x3565b9[_0x762f('0x21')]()['then'](function(){_0x556379['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f6a18,_0x372577){return function(_0x3df136){if(!_0x3df136){_0x3f6a18[_0x762f('0x15')](0x194);}return _0x3df136;};}function handleError(_0x2ef377,_0x57b3ca){_0x57b3ca=_0x57b3ca||0x1f4;return function(_0x382921){logger['error'](_0x382921[_0x762f('0x22')]);if(_0x382921['name']){delete _0x382921[_0x762f('0x23')];}_0x2ef377[_0x762f('0x16')](_0x57b3ca)[_0x762f('0x24')](_0x382921);};}exports[_0x762f('0x25')]=function(_0x3b2dfb,_0x49838d){var _0x342756={'raw':!![],'where':{'id':_0x3b2dfb[_0x762f('0x26')]['id']}},_0x3f4433={};_0x3f4433[_0x762f('0x27')]=_[_0x762f('0x28')](db[_0x762f('0x29')][_0x762f('0x2a')]);_0x3f4433[_0x762f('0x2b')]=_[_0x762f('0x28')](_0x3b2dfb['query']);_0x3f4433['filters']=_['intersection'](_0x3f4433['model'],_0x3f4433['query']);_0x342756[_0x762f('0x2c')]=_[_0x762f('0x2d')](_0x3f4433['model'],qs[_0x762f('0x2e')](_0x3b2dfb[_0x762f('0x2b')][_0x762f('0x2e')]));_0x342756[_0x762f('0x2c')]=_0x342756[_0x762f('0x2c')][_0x762f('0x2f')]?_0x342756['attributes']:_0x3f4433[_0x762f('0x27')];if(_0x3b2dfb[_0x762f('0x2b')][_0x762f('0x30')]){_0x342756[_0x762f('0x31')]=[{'all':!![]}];}_0x342756=_[_0x762f('0x32')]({},_0x342756,_0x3b2dfb[_0x762f('0x33')]);return db[_0x762f('0x29')][_0x762f('0x34')](_0x342756)[_0x762f('0x20')](handleEntityNotFound(_0x49838d,null))[_0x762f('0x20')](respondWithResult(_0x49838d,null))[_0x762f('0x35')](handleError(_0x49838d,null));};exports[_0x762f('0x1f')]=function(_0x3e9d33,_0x12d730){if(_0x3e9d33[_0x762f('0x36')]['id']){delete _0x3e9d33[_0x762f('0x36')]['id'];}return db['MailApplication'][_0x762f('0x34')]({'where':{'id':_0x3e9d33[_0x762f('0x26')]['id']}})['then'](handleEntityNotFound(_0x12d730,null))['then'](saveUpdates(_0x3e9d33[_0x762f('0x36')],null))[_0x762f('0x20')](respondWithResult(_0x12d730,null))[_0x762f('0x35')](handleError(_0x12d730,null));};exports['destroy']=function(_0xe2096e,_0x57ba75){return db[_0x762f('0x29')]['find']({'where':{'id':_0xe2096e[_0x762f('0x26')]['id']}})[_0x762f('0x20')](handleEntityNotFound(_0x57ba75,null))['then'](removeEntity(_0x57ba75,null))[_0x762f('0x35')](handleError(_0x57ba75,null));};
\ No newline at end of file
+var _0xa66a=['model','attributes','fields','length','includeAll','include','options','MailApplication','find','then','catch','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','params','keys','rawAttributes','query','filters','intersection'];(function(_0xcb6d64,_0x604e3f){var _0x386710=function(_0x42bd3d){while(--_0x42bd3d){_0xcb6d64['push'](_0xcb6d64['shift']());}};_0x386710(++_0x604e3f);}(_0xa66a,0xf0));var _0xaa66=function(_0x4265ac,_0xe7d35f){_0x4265ac=_0x4265ac-0x0;var _0x35b7ca=_0xa66a[_0x4265ac];return _0x35b7ca;};'use strict';var pdf=require(_0xaa66('0x0'));var emlformat=require(_0xaa66('0x1'));var rimraf=require(_0xaa66('0x2'));var zipdir=require(_0xaa66('0x3'));var jsonpatch=require(_0xaa66('0x4'));var rp=require('request-promise');var moment=require(_0xaa66('0x5'));var BPromise=require(_0xaa66('0x6'));var Mustache=require('mustache');var util=require(_0xaa66('0x7'));var path=require('path');var sox=require(_0xaa66('0x8'));var csv=require('to-csv');var ejs=require(_0xaa66('0x9'));var fs=require('fs');var _=require(_0xaa66('0xa'));var squel=require('squel');var crypto=require(_0xaa66('0xb'));var jsforce=require(_0xaa66('0xc'));var deskjs=require(_0xaa66('0xd'));var toCsv=require(_0xaa66('0xe'));var querystring=require(_0xaa66('0xf'));var Papa=require('papaparse');var Redis=require(_0xaa66('0x10'));var authService=require(_0xaa66('0x11'));var qs=require(_0xaa66('0x12'));var as=require(_0xaa66('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa66('0x14'))(_0xaa66('0x15'));var utils=require(_0xaa66('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dbd89,_0x235b58){_0x235b58=_0x235b58||0xcc;return function(_0x24ba45){if(_0x24ba45){return _0x3dbd89[_0xaa66('0x17')](_0x235b58);}return _0x3dbd89[_0xaa66('0x18')](_0x235b58)[_0xaa66('0x19')]();};}function respondWithResult(_0x435a50,_0x3bd064){_0x3bd064=_0x3bd064||0xc8;return function(_0x306123){if(_0x306123){return _0x435a50[_0xaa66('0x18')](_0x3bd064)[_0xaa66('0x1a')](_0x306123);}};}function respondWithFilteredResult(_0x2a931e,_0x1130c4){return function(_0xd7709e){if(_0xd7709e){var _0x5464fe=_0xd7709e[_0xaa66('0x1b')],_0x49b849=_0x1130c4[_0xaa66('0x1c')],_0x1fd44b=_0x1130c4[_0xaa66('0x1c')]+_0x1130c4[_0xaa66('0x1d')],_0x19718f;if(_0x1fd44b>=_0x5464fe){_0x1fd44b=_0x5464fe;_0x19718f=0xc8;}else{_0x19718f=0xce;}_0x2a931e[_0xaa66('0x18')](_0x19718f);return _0x2a931e[_0xaa66('0x1e')](_0xaa66('0x1f'),_0x49b849+'-'+_0x1fd44b+'/'+_0x5464fe)[_0xaa66('0x1a')](_0xd7709e);}return null;};}function patchUpdates(_0x288a7d){return function(_0x5b0928){try{jsonpatch['apply'](_0x5b0928,_0x288a7d,!![]);}catch(_0x55b7c9){return BPromise[_0xaa66('0x20')](_0x55b7c9);}return _0x5b0928[_0xaa66('0x21')]();};}function saveUpdates(_0x263e3e,_0x131f14){return function(_0xfd6aec){if(_0xfd6aec){return _0xfd6aec[_0xaa66('0x22')](_0x263e3e)['then'](function(_0x2ffe5a){return _0x2ffe5a;});}return null;};}function removeEntity(_0xf8176d,_0x269aa1){return function(_0x27402d){if(_0x27402d){return _0x27402d[_0xaa66('0x23')]()['then'](function(){_0xf8176d[_0xaa66('0x18')](0xcc)[_0xaa66('0x19')]();});}};}function handleEntityNotFound(_0xcf141f,_0x5028a2){return function(_0x20cda8){if(!_0x20cda8){_0xcf141f[_0xaa66('0x17')](0x194);}return _0x20cda8;};}function handleError(_0x35784d,_0x3a2bcc){_0x3a2bcc=_0x3a2bcc||0x1f4;return function(_0x2a281d){logger['error'](_0x2a281d[_0xaa66('0x24')]);if(_0x2a281d[_0xaa66('0x25')]){delete _0x2a281d['name'];}_0x35784d[_0xaa66('0x18')](_0x3a2bcc)[_0xaa66('0x26')](_0x2a281d);};}exports['show']=function(_0x31a8e1,_0x2be001){var _0x5ecf3f={'raw':!![],'where':{'id':_0x31a8e1[_0xaa66('0x27')]['id']}},_0x533988={};_0x533988['model']=_[_0xaa66('0x28')](db['MailApplication'][_0xaa66('0x29')]);_0x533988['query']=_[_0xaa66('0x28')](_0x31a8e1[_0xaa66('0x2a')]);_0x533988[_0xaa66('0x2b')]=_[_0xaa66('0x2c')](_0x533988[_0xaa66('0x2d')],_0x533988['query']);_0x5ecf3f[_0xaa66('0x2e')]=_[_0xaa66('0x2c')](_0x533988['model'],qs[_0xaa66('0x2f')](_0x31a8e1[_0xaa66('0x2a')]['fields']));_0x5ecf3f['attributes']=_0x5ecf3f[_0xaa66('0x2e')][_0xaa66('0x30')]?_0x5ecf3f[_0xaa66('0x2e')]:_0x533988['model'];if(_0x31a8e1['query'][_0xaa66('0x31')]){_0x5ecf3f[_0xaa66('0x32')]=[{'all':!![]}];}_0x5ecf3f=_['merge']({},_0x5ecf3f,_0x31a8e1[_0xaa66('0x33')]);return db[_0xaa66('0x34')][_0xaa66('0x35')](_0x5ecf3f)[_0xaa66('0x36')](handleEntityNotFound(_0x2be001,null))[_0xaa66('0x36')](respondWithResult(_0x2be001,null))[_0xaa66('0x37')](handleError(_0x2be001,null));};exports[_0xaa66('0x22')]=function(_0x5e98ff,_0x5e1f47){if(_0x5e98ff[_0xaa66('0x38')]['id']){delete _0x5e98ff['body']['id'];}return db[_0xaa66('0x34')]['find']({'where':{'id':_0x5e98ff[_0xaa66('0x27')]['id']}})[_0xaa66('0x36')](handleEntityNotFound(_0x5e1f47,null))[_0xaa66('0x36')](saveUpdates(_0x5e98ff[_0xaa66('0x38')],null))[_0xaa66('0x36')](respondWithResult(_0x5e1f47,null))['catch'](handleError(_0x5e1f47,null));};exports[_0xaa66('0x23')]=function(_0x2a6bbf,_0x255ea8){return db[_0xaa66('0x34')][_0xaa66('0x35')]({'where':{'id':_0x2a6bbf[_0xaa66('0x27')]['id']}})[_0xaa66('0x36')](handleEntityNotFound(_0x255ea8,null))['then'](removeEntity(_0x255ea8,null))[_0xaa66('0x37')](handleError(_0x255ea8,null));};
\ No newline at end of file
index 34677b2..a2961b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa467=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailApplication','utf8mb4'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0xa467,0x143));var _0x7a46=function(_0x511275,_0x2ca012){_0x511275=_0x511275-0x0;var _0x57cf34=_0xa467[_0x511275];return _0x57cf34;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var logger=require(_0x7a46('0x2'))(_0x7a46('0x3'));var moment=require(_0x7a46('0x4'));var BPromise=require(_0x7a46('0x5'));var rp=require(_0x7a46('0x6'));var fs=require('fs');var path=require(_0x7a46('0x7'));var rimraf=require(_0x7a46('0x8'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x7a46('0x9')]=function(_0x1940e6,_0x3bfa2c){return _0x1940e6[_0x7a46('0xa')](_0x7a46('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7a46('0xc'),'collate':_0x7a46('0xd')});};
\ No newline at end of file
+var _0x34bd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x9a138c,_0x2607f8){var _0x3771a3=function(_0x22ebbb){while(--_0x22ebbb){_0x9a138c['push'](_0x9a138c['shift']());}};_0x3771a3(++_0x2607f8);}(_0x34bd,0x1d2));var _0xd34b=function(_0x2a5042,_0x307d04){_0x2a5042=_0x2a5042-0x0;var _0x4bc22f=_0x34bd[_0x2a5042];return _0x4bc22f;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd34b('0x1'));var moment=require(_0xd34b('0x2'));var BPromise=require(_0xd34b('0x3'));var rp=require(_0xd34b('0x4'));var fs=require('fs');var path=require(_0xd34b('0x5'));var rimraf=require(_0xd34b('0x6'));var config=require(_0xd34b('0x7'));var attributes=require('./mailApplication.attributes');module[_0xd34b('0x8')]=function(_0x5d161e,_0x4e6e94){return _0x5d161e['define'](_0xd34b('0x9'),attributes,{'tableName':_0xd34b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd34b('0xb'),'collate':_0xd34b('0xc')});};
\ No newline at end of file
index c5f88a3..4202b8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x724a=['MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then'];(function(_0xa2ac9,_0xf07f28){var _0x690e9b=function(_0x5b2582){while(--_0x5b2582){_0xa2ac9['push'](_0xa2ac9['shift']());}};_0x690e9b(++_0xf07f28);}(_0x724a,0x16e));var _0xa724=function(_0x216f98,_0x470c7f){_0x216f98=_0x216f98-0x0;var _0xea6b36=_0x724a[_0x216f98];return _0xea6b36;};'use strict';var _=require('lodash');var util=require(_0xa724('0x0'));var moment=require(_0xa724('0x1'));var BPromise=require(_0xa724('0x2'));var rs=require(_0xa724('0x3'));var fs=require('fs');var Redis=require(_0xa724('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa724('0x5'));var config=require(_0xa724('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa724('0x7')][_0xa724('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c23d4,_0x417c17,_0x47f58f){return new BPromise(function(_0x1db05a,_0x3c2d9d){return client[_0xa724('0x9')](_0x4c23d4,_0x47f58f)[_0xa724('0xa')](function(_0x18e3a7){logger['info'](_0xa724('0xb'),_0x417c17,_0xa724('0xc'));logger[_0xa724('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x417c17,_0xa724('0xc'),JSON[_0xa724('0xe')](_0x18e3a7));if(_0x18e3a7[_0xa724('0xf')]){if(_0x18e3a7[_0xa724('0xf')][_0xa724('0x10')]===0x1f4){logger['error'](_0xa724('0xb'),_0x417c17,_0x18e3a7[_0xa724('0xf')][_0xa724('0x11')]);return _0x3c2d9d(_0x18e3a7['error'][_0xa724('0x11')]);}logger['error'](_0xa724('0xb'),_0x417c17,_0x18e3a7[_0xa724('0xf')][_0xa724('0x11')]);return _0x1db05a(_0x18e3a7[_0xa724('0xf')][_0xa724('0x11')]);}else{logger[_0xa724('0x12')](_0xa724('0xb'),_0x417c17,_0xa724('0xc'));_0x1db05a(_0x18e3a7[_0xa724('0x13')][_0xa724('0x11')]);}})[_0xa724('0x14')](function(_0x35b102){logger[_0xa724('0xf')](_0xa724('0xb'),_0x417c17,_0x35b102);_0x3c2d9d(_0x35b102);});});}exports[_0xa724('0x15')]=function(_0x54cef7){var _0x1895e6=this;return new Promise(function(_0x5350ef,_0x2a29e8){return db[_0xa724('0x16')][_0xa724('0x17')](_0x54cef7[_0xa724('0x18')],{'raw':_0x54cef7[_0xa724('0x19')]?_0x54cef7['options'][_0xa724('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54cef7['options']?_0x54cef7[_0xa724('0x19')]['where']||null:null,'attributes':_0x54cef7[_0xa724('0x19')]?_0x54cef7['options'][_0xa724('0x1b')]||null:null,'limit':_0x54cef7[_0xa724('0x19')]?_0x54cef7[_0xa724('0x19')][_0xa724('0x1c')]||null:null})['then'](function(_0x36d245){logger[_0xa724('0x12')](_0xa724('0x15'),_0x54cef7);logger[_0xa724('0xd')]('UpdateMailApplication',_0x54cef7,JSON[_0xa724('0xe')](_0x36d245));_0x5350ef(_0x36d245);})[_0xa724('0x14')](function(_0x14e98f){logger[_0xa724('0xf')](_0xa724('0x15'),_0x14e98f[_0xa724('0x11')],_0x54cef7);_0x2a29e8(_0x1895e6[_0xa724('0xf')](0x1f4,_0x14e98f[_0xa724('0x11')]));});});};
\ No newline at end of file
+var _0xa23d=['code','MailApplication,\x20%s,\x20%s','message','catch','UpdateMailApplication','MailApplication','options','raw','where','limit','debug','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x80b9b8,_0x2a2163){var _0xb7fe18=function(_0x4db660){while(--_0x4db660){_0x80b9b8['push'](_0x80b9b8['shift']());}};_0xb7fe18(++_0x2a2163);}(_0xa23d,0x1f1));var _0xda23=function(_0x17fbd5,_0x3ff360){_0x17fbd5=_0x17fbd5-0x0;var _0x4c4765=_0xa23d[_0x17fbd5];return _0x4c4765;};'use strict';var _=require('lodash');var util=require(_0xda23('0x0'));var moment=require(_0xda23('0x1'));var BPromise=require(_0xda23('0x2'));var rs=require(_0xda23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xda23('0x4'));var logger=require(_0xda23('0x5'))(_0xda23('0x6'));var config=require(_0xda23('0x7'));var jayson=require(_0xda23('0x8'));var client=jayson[_0xda23('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x127489,_0x325a28,_0x3fdc87){return new BPromise(function(_0x160163,_0x155eb2){return client[_0xda23('0xa')](_0x127489,_0x3fdc87)['then'](function(_0x3c0275){logger[_0xda23('0xb')]('MailApplication,\x20%s,\x20%s',_0x325a28,_0xda23('0xc'));logger['debug'](_0xda23('0xd'),_0x325a28,_0xda23('0xc'),JSON[_0xda23('0xe')](_0x3c0275));if(_0x3c0275[_0xda23('0xf')]){if(_0x3c0275[_0xda23('0xf')][_0xda23('0x10')]===0x1f4){logger['error'](_0xda23('0x11'),_0x325a28,_0x3c0275['error'][_0xda23('0x12')]);return _0x155eb2(_0x3c0275[_0xda23('0xf')]['message']);}logger[_0xda23('0xf')](_0xda23('0x11'),_0x325a28,_0x3c0275['error']['message']);return _0x160163(_0x3c0275[_0xda23('0xf')][_0xda23('0x12')]);}else{logger[_0xda23('0xb')](_0xda23('0x11'),_0x325a28,'request\x20sent');_0x160163(_0x3c0275['result'][_0xda23('0x12')]);}})[_0xda23('0x13')](function(_0x387d98){logger[_0xda23('0xf')](_0xda23('0x11'),_0x325a28,_0x387d98);_0x155eb2(_0x387d98);});});}exports[_0xda23('0x14')]=function(_0x58e2e0){var _0x37efae=this;return new Promise(function(_0x5f3607,_0x2cf135){return db[_0xda23('0x15')]['update'](_0x58e2e0['body'],{'raw':_0x58e2e0[_0xda23('0x16')]?_0x58e2e0['options'][_0xda23('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58e2e0[_0xda23('0x16')]?_0x58e2e0['options'][_0xda23('0x18')]||null:null,'attributes':_0x58e2e0[_0xda23('0x16')]?_0x58e2e0['options']['attributes']||null:null,'limit':_0x58e2e0[_0xda23('0x16')]?_0x58e2e0[_0xda23('0x16')][_0xda23('0x19')]||null:null})['then'](function(_0x37f1f7){logger[_0xda23('0xb')]('UpdateMailApplication',_0x58e2e0);logger[_0xda23('0x1a')](_0xda23('0x14'),_0x58e2e0,JSON['stringify'](_0x37f1f7));_0x5f3607(_0x37f1f7);})[_0xda23('0x13')](function(_0x264076){logger[_0xda23('0xf')](_0xda23('0x14'),_0x264076[_0xda23('0x12')],_0x58e2e0);_0x2cf135(_0x37efae[_0xda23('0xf')](0x1f4,_0x264076[_0xda23('0x12')]));});});};
\ No newline at end of file
index 459c768..19d8376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc69b=['destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','delete','mailinteraction:destroy'];(function(_0x4ce30f,_0x46d390){var _0x24ba63=function(_0xda4372){while(--_0xda4372){_0x4ce30f['push'](_0x4ce30f['shift']());}};_0x24ba63(++_0x46d390);}(_0xc69b,0x1d3));var _0xbc69=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0xc69b[_0xad57ee];return _0x3eaea9;};'use strict';var multer=require(_0xbc69('0x0'));var util=require(_0xbc69('0x1'));var path=require('path');var timeout=require(_0xbc69('0x2'));var express=require(_0xbc69('0x3'));var router=express[_0xbc69('0x4')]();var auth=require(_0xbc69('0x5'));var interaction=require(_0xbc69('0x6'));var config=require(_0xbc69('0x7'));var controller=require(_0xbc69('0x8'));router[_0xbc69('0x9')]('/',auth[_0xbc69('0xa')](),controller[_0xbc69('0xb')]);router[_0xbc69('0x9')]('/describe',auth[_0xbc69('0xa')](),controller[_0xbc69('0xc')]);router[_0xbc69('0x9')](_0xbc69('0xd'),auth['isAuthenticated'](),controller[_0xbc69('0xe')]);router[_0xbc69('0x9')](_0xbc69('0xf'),auth['isAuthenticated'](),controller[_0xbc69('0x10')]);router['get']('/:id/download',auth[_0xbc69('0xa')](),controller['download']);router[_0xbc69('0x11')]('/',auth[_0xbc69('0xa')](),controller['create']);router[_0xbc69('0x11')](_0xbc69('0xf'),auth[_0xbc69('0xa')](),controller[_0xbc69('0x12')]);router[_0xbc69('0x11')](_0xbc69('0x13'),auth[_0xbc69('0xa')](),interaction[_0xbc69('0x14')](_0xbc69('0x15'),_0xbc69('0x16')),controller['addTags']);router[_0xbc69('0x17')](_0xbc69('0xd'),auth[_0xbc69('0xa')](),interaction[_0xbc69('0x14')](_0xbc69('0x15'),'mailinteraction:update'),controller['update']);router[_0xbc69('0x18')](_0xbc69('0xd'),auth[_0xbc69('0xa')](),interaction['tracked']('mail',_0xbc69('0x19')),controller[_0xbc69('0x1a')]);router[_0xbc69('0x18')](_0xbc69('0x13'),auth[_0xbc69('0xa')](),controller[_0xbc69('0x1b')]);module[_0xbc69('0x1c')]=router;
\ No newline at end of file
+var _0x3d7b=['path','connect-timeout','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','getMessages','/:id/download','post','/:id/messages','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','mailinteraction:destroy','delete','exports','multer','util'];(function(_0xc5e02a,_0xd9da3c){var _0xbeca77=function(_0x2a7d11){while(--_0x2a7d11){_0xc5e02a['push'](_0xc5e02a['shift']());}};_0xbeca77(++_0xd9da3c);}(_0x3d7b,0x1a2));var _0xb3d7=function(_0x4f7a4f,_0x3c68cf){_0x4f7a4f=_0x4f7a4f-0x0;var _0x41789d=_0x3d7b[_0x4f7a4f];return _0x41789d;};'use strict';var multer=require(_0xb3d7('0x0'));var util=require(_0xb3d7('0x1'));var path=require(_0xb3d7('0x2'));var timeout=require(_0xb3d7('0x3'));var express=require(_0xb3d7('0x4'));var router=express[_0xb3d7('0x5')]();var auth=require(_0xb3d7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb3d7('0x7'));router[_0xb3d7('0x8')]('/',auth[_0xb3d7('0x9')](),controller[_0xb3d7('0xa')]);router[_0xb3d7('0x8')]('/describe',auth[_0xb3d7('0x9')](),controller[_0xb3d7('0xb')]);router['get'](_0xb3d7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb3d7('0x8')]('/:id/messages',auth[_0xb3d7('0x9')](),controller[_0xb3d7('0xd')]);router[_0xb3d7('0x8')](_0xb3d7('0xe'),auth['isAuthenticated'](),controller['download']);router[_0xb3d7('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb3d7('0xf')](_0xb3d7('0x10'),auth[_0xb3d7('0x9')](),controller['addMessage']);router['post'](_0xb3d7('0x11'),auth['isAuthenticated'](),interaction[_0xb3d7('0x12')](_0xb3d7('0x13'),_0xb3d7('0x14')),controller[_0xb3d7('0x15')]);router[_0xb3d7('0x16')](_0xb3d7('0xc'),auth[_0xb3d7('0x9')](),interaction['tracked'](_0xb3d7('0x13'),_0xb3d7('0x17')),controller[_0xb3d7('0x18')]);router['delete']('/:id',auth[_0xb3d7('0x9')](),interaction[_0xb3d7('0x12')]('mail',_0xb3d7('0x19')),controller['destroy']);router[_0xb3d7('0x1a')](_0xb3d7('0x11'),auth[_0xb3d7('0x9')](),controller['removeTags']);module[_0xb3d7('0x1b')]=router;
\ No newline at end of file
index 37faba0..ba5bb5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff69=['TEXT','sequelize','exports','BOOLEAN','STRING','long','DATE','ENUM'];(function(_0xe63da0,_0x296849){var _0x9d3728=function(_0x53951b){while(--_0x53951b){_0xe63da0['push'](_0xe63da0['shift']());}};_0x9d3728(++_0x296849);}(_0xff69,0x1b9));var _0x9ff6=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0xff69[_0x98db33];return _0x5ae63a;};'use strict';var Sequelize=require(_0x9ff6('0x0'));var iconv=require('iconv');module[_0x9ff6('0x1')]={'closed':{'type':Sequelize[_0x9ff6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x9ff6('0x3')](0x1fe)},'to':{'type':Sequelize[_0x9ff6('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x9ff6('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x9ff6('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9ff6('0x5')]},'substatus':{'type':Sequelize[_0x9ff6('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9ff6('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9ff6('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x9ff6('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x9ff6('0x7')]('long')},'lastMsgText':{'type':Sequelize[_0x9ff6('0x7')]('long')}};
\ No newline at end of file
+var _0x69d2=['BOOLEAN','out','ENUM','sequelize','iconv','exports','DATE','STRING','TEXT','long'];(function(_0x3e4c1c,_0x2daacb){var _0x4bc948=function(_0x17fd7f){while(--_0x17fd7f){_0x3e4c1c['push'](_0x3e4c1c['shift']());}};_0x4bc948(++_0x2daacb);}(_0x69d2,0x1d9));var _0x269d=function(_0x59c6da,_0x215c8d){_0x59c6da=_0x59c6da-0x0;var _0x233650=_0x69d2[_0x59c6da];return _0x233650;};'use strict';var Sequelize=require(_0x269d('0x0'));var iconv=require(_0x269d('0x1'));module[_0x269d('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x269d('0x3')]},'disposition':{'type':Sequelize[_0x269d('0x4')]},'note':{'type':Sequelize[_0x269d('0x4')]},'inReplyTo':{'type':Sequelize[_0x269d('0x4')](0x1fe)},'to':{'type':Sequelize[_0x269d('0x4')]},'cc':{'type':Sequelize[_0x269d('0x5')](_0x269d('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x269d('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x269d('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x269d('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x269d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x269d('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x269d('0x5')]('long')},'lastMsgText':{'type':Sequelize[_0x269d('0x5')](_0x269d('0x6'))}};
\ No newline at end of file
index 8bd838e..c3f2765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','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)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x46ff27,_0x4d966e){var _0x44fa7c=function(_0xe212a9){while(--_0xe212a9){_0x46ff27['push'](_0x46ff27['shift']());}};_0x44fa7c(++_0x4d966e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));};
\ No newline at end of file
+var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','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)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x584ec2,_0x25e4df){var _0x695be7=function(_0x3a90b0){while(--_0x3a90b0){_0x584ec2['push'](_0x584ec2['shift']());}};_0x695be7(++_0x25e4df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));};
\ No newline at end of file
index 4907fe9..cf467da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6059=['exports','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6059,0xe1));var _0x9605=function(_0x34b245,_0xfe65b4){_0x34b245=_0x34b245-0x0;var _0x3a8984=_0x6059[_0x34b245];return _0x3a8984;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x9605('0x0'))['db'][_0x9605('0x1')];var MailMessage=require(_0x9605('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9605('0x2')](0x0);var events={'afterCreate':_0x9605('0x3'),'afterUpdate':_0x9605('0x4'),'afterDestroy':_0x9605('0x5')};function emitEvent(_0x29f107){return function(_0x68b777,_0x4038ad,_0x5a2f3b){_0x68b777[_0x9605('0x6')]({'attributes':['id'],'raw':!![]})[_0x9605('0x7')](function(_0x8b1e05){_0x68b777[_0x9605('0x8')](_0x9605('0x9'),_0x8b1e05[_0x9605('0xa')](function(_0x1c802d){return{'id':_0x1c802d['id']};}));return MailMessage[_0x9605('0xb')]({'where':{'MailInteractionId':_0x68b777['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x431b03){_0x68b777['setDataValue'](_0x9605('0xc'),_0x431b03['length']);MailInteractionEvents[_0x9605('0xd')](_0x29f107+':'+_0x68b777['id'],_0x68b777);MailInteractionEvents['emit'](_0x29f107,_0x68b777);_0x5a2f3b(null);})['catch'](_0x5a2f3b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x9605('0xe')](e,emitEvent(event));}}module[_0x9605('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0x2d40=['then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users'];(function(_0x40f340,_0x167f80){var _0x2538c5=function(_0x267585){while(--_0x267585){_0x40f340['push'](_0x40f340['shift']());}};_0x2538c5(++_0x167f80);}(_0x2d40,0xb7));var _0x02d4=function(_0x7e3b45,_0x29c4c7){_0x7e3b45=_0x7e3b45-0x0;var _0x150ad6=_0x2d40[_0x7e3b45];return _0x150ad6;};'use strict';var EventEmitter=require(_0x02d4('0x0'));var MailInteraction=require(_0x02d4('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x02d4('0x1'))['db'][_0x02d4('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x02d4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x02d4('0x4'),'afterDestroy':_0x02d4('0x5')};function emitEvent(_0x2bd472){return function(_0x2570b5,_0x4c477c,_0x793662){_0x2570b5[_0x02d4('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1d2b89){_0x2570b5[_0x02d4('0x7')](_0x02d4('0x8'),_0x1d2b89['map'](function(_0x34b714){return{'id':_0x34b714['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2570b5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x02d4('0x9')](function(_0x30a93f){_0x2570b5[_0x02d4('0x7')](_0x02d4('0xa'),_0x30a93f[_0x02d4('0xb')]);MailInteractionEvents[_0x02d4('0xc')](_0x2bd472+':'+_0x2570b5['id'],_0x2570b5);MailInteractionEvents[_0x02d4('0xc')](_0x2bd472,_0x2570b5);_0x793662(null);})[_0x02d4('0xd')](_0x793662(null));};}for(var e in events){if(events[_0x02d4('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x02d4('0xf')]=MailInteractionEvents;
\ No newline at end of file
index 3ff045e..49caa13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e34=['models','get','MailMessage','update','catch','utf8mb4','../../config/logger','api','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','substatusAt','closed'];(function(_0x159a90,_0x187619){var _0x2fdc0b=function(_0x3ee4fa){while(--_0x3ee4fa){_0x159a90['push'](_0x159a90['shift']());}};_0x2fdc0b(++_0x187619);}(_0x4e34,0x19e));var _0x44e3=function(_0x1c5fc2,_0x3ab448){_0x1c5fc2=_0x1c5fc2-0x0;var _0x3c6b80=_0x4e34[_0x1c5fc2];return _0x3c6b80;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44e3('0x0'))(_0x44e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x44e3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44e3('0x3'));var config=require(_0x44e3('0x4'));var attributes=require(_0x44e3('0x5'));module['exports']=function(_0x50805a,_0x162bd9){return _0x50805a[_0x44e3('0x6')](_0x44e3('0x7'),attributes,{'tableName':_0x44e3('0x8'),'paranoid':![],'indexes':[{'name':_0x44e3('0x9'),'fields':[_0x44e3('0xa'),'to'],'type':_0x44e3('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b9f51,_0xf7e448,_0xc041c6){if(_0x4b9f51['substatus']){_0x4b9f51['substatusAt']=moment()[_0x44e3('0xc')](_0x44e3('0xd'));}if(_0x4b9f51['closed']){_0x4b9f51['closedAt']=moment()[_0x44e3('0xc')](_0x44e3('0xd'));}_0xc041c6(null,_0xf7e448);},'beforeUpdate':function(_0x7faa46,_0x730048,_0x4e2dd9){if(_0x7faa46[_0x44e3('0xe')](_0x44e3('0xf'))){_0x7faa46[_0x44e3('0x10')]=_0x7faa46[_0x44e3('0xf')]?moment()[_0x44e3('0xc')](_0x44e3('0xd')):null;}if(_0x7faa46[_0x44e3('0xe')](_0x44e3('0x11'))){_0x7faa46['closedAt']=moment()[_0x44e3('0xc')]('YYYY-MM-DD\x20HH:mm:ss');_0x7faa46[_0x44e3('0xf')]=null;_0x7faa46[_0x44e3('0x10')]=null;}_0x4e2dd9(null,_0x7faa46);},'afterUpdate':function(_0x5a140d,_0x28fc7a,_0xf1633d){var _0x103eb0=_0x50805a[_0x44e3('0x12')];var _0x43aafe=_0x5a140d[_0x44e3('0x13')]({'plain':!![]});if(_0x43aafe[_0x44e3('0x11')]){return _0x103eb0[_0x44e3('0x14')][_0x44e3('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x43aafe['id']}})['then'](function(){_0xf1633d();})[_0x44e3('0x16')](function(_0x5d3e69){_0xf1633d(_0x5d3e69);});}else{_0xf1633d();}}},'charset':_0x44e3('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb7f1=['update','then','catch','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','format','changed','closed','closedAt','models','MailMessage'];(function(_0x25067a,_0x10cebe){var _0x4b1db7=function(_0x5ca373){while(--_0x5ca373){_0x25067a['push'](_0x25067a['shift']());}};_0x4b1db7(++_0x10cebe);}(_0xb7f1,0xdc));var _0x1b7f=function(_0x4d0e98,_0x1a2e6d){_0x4d0e98=_0x4d0e98-0x0;var _0x23548a=_0xb7f1[_0x4d0e98];return _0x23548a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b7f('0x0'))(_0x1b7f('0x1'));var moment=require(_0x1b7f('0x2'));var BPromise=require('bluebird');var rp=require(_0x1b7f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1b7f('0x4'));var attributes=require(_0x1b7f('0x5'));module['exports']=function(_0x45f084,_0x3882a7){return _0x45f084[_0x1b7f('0x6')](_0x1b7f('0x7'),attributes,{'tableName':_0x1b7f('0x8'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x1b7f('0x9'),'to'],'type':_0x1b7f('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x32ba46,_0x1ee997,_0x330582){if(_0x32ba46[_0x1b7f('0xb')]){_0x32ba46[_0x1b7f('0xc')]=moment()['format'](_0x1b7f('0xd'));}if(_0x32ba46['closed']){_0x32ba46['closedAt']=moment()[_0x1b7f('0xe')](_0x1b7f('0xd'));}_0x330582(null,_0x1ee997);},'beforeUpdate':function(_0x2477a3,_0x2226d5,_0x308743){if(_0x2477a3[_0x1b7f('0xf')]('substatus')){_0x2477a3[_0x1b7f('0xc')]=_0x2477a3[_0x1b7f('0xb')]?moment()[_0x1b7f('0xe')](_0x1b7f('0xd')):null;}if(_0x2477a3[_0x1b7f('0xf')](_0x1b7f('0x10'))){_0x2477a3[_0x1b7f('0x11')]=moment()[_0x1b7f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x2477a3['substatus']=null;_0x2477a3[_0x1b7f('0xc')]=null;}_0x308743(null,_0x2477a3);},'afterUpdate':function(_0x389ff7,_0x5d7b55,_0x17afcf){var _0x45735f=_0x45f084[_0x1b7f('0x12')];var _0x3d5922=_0x389ff7['get']({'plain':!![]});if(_0x3d5922[_0x1b7f('0x10')]){return _0x45735f[_0x1b7f('0x13')][_0x1b7f('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x3d5922['id']}})[_0x1b7f('0x15')](function(){_0x17afcf();})[_0x1b7f('0x16')](function(_0x386386){_0x17afcf(_0x386386);});}else{_0x17afcf();}}},'charset':'utf8mb4','collate':_0x1b7f('0x17')});};
\ No newline at end of file
index 60aabaf..5012aab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b87=['catch','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./mailInteraction.socket','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','then'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x9b87,0x8e));var _0x79b8=function(_0xc5df6b,_0x3725ca){_0xc5df6b=_0xc5df6b-0x0;var _0x2bb1be=_0x9b87[_0xc5df6b];return _0x2bb1be;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var moment=require(_0x79b8('0x2'));var BPromise=require(_0x79b8('0x3'));var rs=require(_0x79b8('0x4'));var fs=require('fs');var Redis=require(_0x79b8('0x5'));var db=require(_0x79b8('0x6'))['db'];var utils=require(_0x79b8('0x7'));var logger=require(_0x79b8('0x8'))(_0x79b8('0x9'));var config=require(_0x79b8('0xa'));var jayson=require(_0x79b8('0xb'));var client=jayson[_0x79b8('0xc')][_0x79b8('0xd')]({'port':0x232a});config[_0x79b8('0xe')]=_[_0x79b8('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x79b8('0x10'))[_0x79b8('0x11')](socket);function respondWithRpcPromise(_0x2f3453,_0x4bc41f,_0x28434){return new BPromise(function(_0x2fdb05,_0xdf585a){return client['request'](_0x2f3453,_0x28434)['then'](function(_0x46c0ce){logger[_0x79b8('0x12')](_0x79b8('0x13'),_0x4bc41f,_0x79b8('0x14'));logger[_0x79b8('0x15')](_0x79b8('0x16'),_0x4bc41f,_0x79b8('0x14'),JSON[_0x79b8('0x17')](_0x46c0ce));if(_0x46c0ce[_0x79b8('0x18')]){if(_0x46c0ce[_0x79b8('0x18')][_0x79b8('0x19')]===0x1f4){logger['error'](_0x79b8('0x13'),_0x4bc41f,_0x46c0ce['error']['message']);return _0xdf585a(_0x46c0ce[_0x79b8('0x18')][_0x79b8('0x1a')]);}logger[_0x79b8('0x18')]('MailInteraction,\x20%s,\x20%s',_0x4bc41f,_0x46c0ce[_0x79b8('0x18')]['message']);return _0x2fdb05(_0x46c0ce['error'][_0x79b8('0x1a')]);}else{logger[_0x79b8('0x12')](_0x79b8('0x13'),_0x4bc41f,_0x79b8('0x14'));_0x2fdb05(_0x46c0ce[_0x79b8('0x1b')][_0x79b8('0x1a')]);}})['catch'](function(_0x6a0de5){logger['error']('MailInteraction,\x20%s,\x20%s',_0x4bc41f,_0x6a0de5);_0xdf585a(_0x6a0de5);});});}exports[_0x79b8('0x1c')]=function(_0x131d04){var _0x406b56=this;return new Promise(function(_0x3e0157,_0x1e24cf){return db[_0x79b8('0x1d')][_0x79b8('0x1e')](_0x131d04[_0x79b8('0x1f')],{'raw':_0x131d04[_0x79b8('0x20')]?_0x131d04['options'][_0x79b8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x131d04[_0x79b8('0x20')]?_0x131d04['options'][_0x79b8('0x22')]||null:null,'attributes':_0x131d04[_0x79b8('0x20')]?_0x131d04['options'][_0x79b8('0x23')]||null:null,'limit':_0x131d04['options']?_0x131d04['options'][_0x79b8('0x24')]||null:null})[_0x79b8('0x25')](function(_0x262b48){logger[_0x79b8('0x12')](_0x79b8('0x1c'),_0x131d04);logger['debug'](_0x79b8('0x1c'),_0x131d04,JSON[_0x79b8('0x17')](_0x262b48));_0x3e0157(_0x262b48);})[_0x79b8('0x26')](function(_0x3ba5ac){logger['error'](_0x79b8('0x1c'),_0x3ba5ac[_0x79b8('0x1a')],_0x131d04);_0x1e24cf(_0x406b56[_0x79b8('0x18')](0x1f4,_0x3ba5ac['message']));});});};exports[_0x79b8('0x27')]=function(_0x4a4ef6){return new Promise(function(_0x43058e,_0x2942e9){return db[_0x79b8('0x1d')][_0x79b8('0x28')]({'where':_0x4a4ef6['options']?_0x4a4ef6[_0x79b8('0x20')]['where']||null:null})[_0x79b8('0x25')](function(_0x4a4d64){if(_0x4a4d64){return _0x4a4d64[_0x79b8('0x29')](_0x4a4ef6[_0x79b8('0x1f')][_0x79b8('0x2a')],_['omit'](_0x4a4ef6[_0x79b8('0x1f')],[_0x79b8('0x2a'),'id'])||{});}})[_0x79b8('0x2b')](function(_0xdc3993){logger['info'](_0x79b8('0x2c'),_0x4a4ef6);logger['debug']('AddTags',_0x4a4ef6,JSON[_0x79b8('0x17')](_0xdc3993));_0x43058e(_0xdc3993);})[_0x79b8('0x26')](function(_0x4a038b){logger[_0x79b8('0x18')]('AddTags',_0x4a038b['message'],_0x4a4ef6);_0x2942e9(_this[_0x79b8('0x18')](0x1f4,_0x4a038b['message']));});});};
\ No newline at end of file
+var _0x1789=['then','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s','message','info','request\x20sent','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0xd204b0,_0x4c7d1d){var _0xfc8310=function(_0x4f4b5a){while(--_0x4f4b5a){_0xd204b0['push'](_0xd204b0['shift']());}};_0xfc8310(++_0x4c7d1d);}(_0x1789,0x92));var _0x9178=function(_0x5b73ff,_0x1cba4d){_0x5b73ff=_0x5b73ff-0x0;var _0x1c4ba4=_0x1789[_0x5b73ff];return _0x1c4ba4;};'use strict';var _=require(_0x9178('0x0'));var util=require(_0x9178('0x1'));var moment=require(_0x9178('0x2'));var BPromise=require('bluebird');var rs=require(_0x9178('0x3'));var fs=require('fs');var Redis=require(_0x9178('0x4'));var db=require(_0x9178('0x5'))['db'];var utils=require(_0x9178('0x6'));var logger=require(_0x9178('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9178('0x8'));var client=jayson[_0x9178('0x9')][_0x9178('0xa')]({'port':0x232a});config[_0x9178('0xb')]=_['defaults'](config[_0x9178('0xb')],{'host':_0x9178('0xc'),'port':0x18eb});var socket=require(_0x9178('0xd'))(new Redis(config[_0x9178('0xb')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x537261,_0xdd2085,_0x320615){return new BPromise(function(_0x49efc8,_0x27f968){return client['request'](_0x537261,_0x320615)[_0x9178('0xe')](function(_0x80d440){logger['info']('MailInteraction,\x20%s,\x20%s',_0xdd2085,'request\x20sent');logger[_0x9178('0xf')](_0x9178('0x10'),_0xdd2085,'request\x20sent',JSON[_0x9178('0x11')](_0x80d440));if(_0x80d440[_0x9178('0x12')]){if(_0x80d440[_0x9178('0x12')]['code']===0x1f4){logger[_0x9178('0x12')](_0x9178('0x13'),_0xdd2085,_0x80d440['error'][_0x9178('0x14')]);return _0x27f968(_0x80d440['error'][_0x9178('0x14')]);}logger[_0x9178('0x12')](_0x9178('0x13'),_0xdd2085,_0x80d440[_0x9178('0x12')][_0x9178('0x14')]);return _0x49efc8(_0x80d440[_0x9178('0x12')][_0x9178('0x14')]);}else{logger[_0x9178('0x15')](_0x9178('0x13'),_0xdd2085,_0x9178('0x16'));_0x49efc8(_0x80d440[_0x9178('0x17')][_0x9178('0x14')]);}})[_0x9178('0x18')](function(_0x30c430){logger['error'](_0x9178('0x13'),_0xdd2085,_0x30c430);_0x27f968(_0x30c430);});});}exports[_0x9178('0x19')]=function(_0x567e52){var _0x384b48=this;return new Promise(function(_0x59b1d2,_0x94c136){return db[_0x9178('0x1a')][_0x9178('0x1b')](_0x567e52[_0x9178('0x1c')],{'raw':_0x567e52[_0x9178('0x1d')]?_0x567e52[_0x9178('0x1d')][_0x9178('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x567e52[_0x9178('0x1d')]?_0x567e52['options'][_0x9178('0x1f')]||null:null,'attributes':_0x567e52['options']?_0x567e52['options'][_0x9178('0x20')]||null:null,'limit':_0x567e52[_0x9178('0x1d')]?_0x567e52[_0x9178('0x1d')][_0x9178('0x21')]||null:null})[_0x9178('0xe')](function(_0x2e2723){logger[_0x9178('0x15')](_0x9178('0x19'),_0x567e52);logger[_0x9178('0xf')](_0x9178('0x19'),_0x567e52,JSON[_0x9178('0x11')](_0x2e2723));_0x59b1d2(_0x2e2723);})[_0x9178('0x18')](function(_0x3dccbf){logger[_0x9178('0x12')]('UpdateMailInteraction',_0x3dccbf[_0x9178('0x14')],_0x567e52);_0x94c136(_0x384b48[_0x9178('0x12')](0x1f4,_0x3dccbf['message']));});});};exports[_0x9178('0x22')]=function(_0x14fa42){return new Promise(function(_0x39d309,_0x2b977b){return db[_0x9178('0x1a')][_0x9178('0x23')]({'where':_0x14fa42['options']?_0x14fa42[_0x9178('0x1d')][_0x9178('0x1f')]||null:null})['then'](function(_0x20263c){if(_0x20263c){return _0x20263c[_0x9178('0x24')](_0x14fa42[_0x9178('0x1c')][_0x9178('0x25')],_[_0x9178('0x26')](_0x14fa42[_0x9178('0x1c')],[_0x9178('0x25'),'id'])||{});}})['spread'](function(_0x159900){logger['info'](_0x9178('0x27'),_0x14fa42);logger[_0x9178('0xf')]('AddTags',_0x14fa42,JSON[_0x9178('0x11')](_0x159900));_0x39d309(_0x159900);})[_0x9178('0x18')](function(_0x1e26c1){logger[_0x9178('0x12')]('AddTags',_0x1e26c1[_0x9178('0x14')],_0x14fa42);_0x2b977b(_this[_0x9178('0x12')](0x1f4,_0x1e26c1[_0x9178('0x14')]));});});};
\ No newline at end of file
index 25ff05c..15482e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c97=['length','mailInteraction:','./mailInteraction.events','save','update','emit','removeListener','register'];(function(_0x465be8,_0x29d330){var _0x2d6137=function(_0x4d0939){while(--_0x4d0939){_0x465be8['push'](_0x465be8['shift']());}};_0x2d6137(++_0x29d330);}(_0x4c97,0x1ca));var _0x74c9=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x4c97[_0x485b5a];return _0xd2b34d;};'use strict';var MailInteractionEvents=require(_0x74c9('0x0'));var events=[_0x74c9('0x1'),'remove',_0x74c9('0x2')];function createListener(_0x3989db,_0x42884b){return function(_0x536c8a){_0x42884b[_0x74c9('0x3')](_0x3989db,_0x536c8a);};}function removeListener(_0x328701,_0x5c93f9){return function(){MailInteractionEvents[_0x74c9('0x4')](_0x328701,_0x5c93f9);};}exports[_0x74c9('0x5')]=function(_0x545e42){for(var _0x94730a=0x0,_0xb67c3c=events[_0x74c9('0x6')];_0x94730a<_0xb67c3c;_0x94730a++){var _0x1269ba=events[_0x94730a];var _0x36c780=createListener(_0x74c9('0x7')+_0x1269ba,_0x545e42);MailInteractionEvents['on'](_0x1269ba,_0x36c780);}};
\ No newline at end of file
+var _0x233e=['remove','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x233e,0xce));var _0xe233=function(_0x270281,_0x1078c5){_0x270281=_0x270281-0x0;var _0x4888dd=_0x233e[_0x270281];return _0x4888dd;};'use strict';var MailInteractionEvents=require(_0xe233('0x0'));var events=[_0xe233('0x1'),_0xe233('0x2'),'update'];function createListener(_0x18cab3,_0x30aa7d){return function(_0x1dacab){_0x30aa7d[_0xe233('0x3')](_0x18cab3,_0x1dacab);};}function removeListener(_0x12ec79,_0x2e40cd){return function(){MailInteractionEvents[_0xe233('0x4')](_0x12ec79,_0x2e40cd);};}exports[_0xe233('0x5')]=function(_0x4c6dc4){for(var _0x5ba46d=0x0,_0xc5ecd=events[_0xe233('0x6')];_0x5ba46d<_0xc5ecd;_0x5ba46d++){var _0x531d92=events[_0x5ba46d];var _0x143664=createListener(_0xe233('0x7')+_0x531d92,_0x4c6dc4);MailInteractionEvents['on'](_0x531d92,_0x143664);}};
\ No newline at end of file
index 8d43cb3..bc6c85d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','update','put','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5ded36,_0xe9e3c8){var _0x1f27b0=function(_0xb53874){while(--_0xb53874){_0x5ded36['push'](_0x5ded36['shift']());}};_0x1f27b0(++_0xe9e3c8);}(_0x24ca,0x1bc));var _0xa24c=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x24ca[_0x531d15];return _0x271a18;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var auth=require(_0xa24c('0x4'));var interaction=require(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var controller=require(_0xa24c('0x7'));router[_0xa24c('0x8')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x8')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xc')]);router['get'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router['get'](_0xa24c('0xf'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x10')]);router[_0xa24c('0x11')]('/',auth[_0xa24c('0x9')](),interaction[_0xa24c('0x12')](_0xa24c('0x13'),_0xa24c('0x14')),controller[_0xa24c('0x15')]);router['put'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x16')]);router[_0xa24c('0x17')]('/:id/accept',auth[_0xa24c('0x9')](),controller[_0xa24c('0x18')]);router[_0xa24c('0x17')](_0xa24c('0x19'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x1a')]);router[_0xa24c('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xa24c('0x1c')]);module[_0xa24c('0x1d')]=router;
\ No newline at end of file
+var _0x98a8=['./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','mail','create','update','accept','put','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x98a8,0x12c));var _0x898a=function(_0x416a90,_0x411042){_0x416a90=_0x416a90-0x0;var _0x25c0b1=_0x98a8[_0x416a90];return _0x25c0b1;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var auth=require(_0x898a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x898a('0x7'));var controller=require(_0x898a('0x8'));router[_0x898a('0x9')]('/',auth[_0x898a('0xa')](),controller[_0x898a('0xb')]);router['get'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0xd')]);router['get'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0xf')]);router[_0x898a('0x9')](_0x898a('0x10'),auth[_0x898a('0xa')](),controller[_0x898a('0x11')]);router[_0x898a('0x12')]('/',auth[_0x898a('0xa')](),interaction['tracked'](_0x898a('0x13'),'mailmessage:create'),controller[_0x898a('0x14')]);router['put'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0x15')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x898a('0x16')]);router[_0x898a('0x17')](_0x898a('0x18'),auth[_0x898a('0xa')](),controller[_0x898a('0x19')]);router[_0x898a('0x1a')]('/:id',auth[_0x898a('0xa')](),controller['destroy']);module[_0x898a('0x1b')]=router;
\ No newline at end of file
index 6c1cfff..04807fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdfb=['sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbdfb,0x1ef));var _0xbbdf=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0xbdfb[_0x214a25];return _0x405988;};'use strict';var Sequelize=require(_0xbbdf('0x0'));var _=require(_0xbbdf('0x1'));module[_0xbbdf('0x2')]={'body':{'type':Sequelize[_0xbbdf('0x3')](_0xbbdf('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbbdf('0x3')](_0xbbdf('0x5'))},'read':{'type':Sequelize[_0xbbdf('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbbdf('0x7')]('in',_0xbbdf('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbbdf('0x9')](0x1fe)},'from':{'type':Sequelize[_0xbbdf('0x9')]},'to':{'type':Sequelize['TEXT'](_0xbbdf('0x4'))},'cc':{'type':Sequelize[_0xbbdf('0x3')]('long')},'bcc':{'type':Sequelize[_0xbbdf('0x3')](_0xbbdf('0x4'))},'subject':{'type':Sequelize[_0xbbdf('0x3')]},'sentAt':{'type':Sequelize[_0xbbdf('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xbbdf('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xbbdf('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0xbbdf('0x4'))},'originCc':{'type':Sequelize[_0xbbdf('0x3')](_0xbbdf('0x4'))}};
\ No newline at end of file
+var _0x853e=['STRING','long','DATE','INTEGER','lodash','TEXT','BOOLEAN','ENUM','out'];(function(_0x1702b0,_0x2a16ae){var _0x29af28=function(_0x5baf8e){while(--_0x5baf8e){_0x1702b0['push'](_0x1702b0['shift']());}};_0x29af28(++_0x2a16ae);}(_0x853e,0x1ea));var _0xe853=function(_0x51c6cb,_0x5f2f62){_0x51c6cb=_0x51c6cb-0x0;var _0x11f87a=_0x853e[_0x51c6cb];return _0x11f87a;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe853('0x0'));module['exports']={'body':{'type':Sequelize[_0xe853('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe853('0x1')]('medium')},'read':{'type':Sequelize[_0xe853('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe853('0x3')]('in',_0xe853('0x4')),'defaultValue':_0xe853('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe853('0x5')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xe853('0x1')](_0xe853('0x6'))},'cc':{'type':Sequelize[_0xe853('0x1')](_0xe853('0x6'))},'bcc':{'type':Sequelize[_0xe853('0x1')](_0xe853('0x6'))},'subject':{'type':Sequelize[_0xe853('0x1')]},'sentAt':{'type':Sequelize[_0xe853('0x7')]},'attach':{'type':Sequelize[_0xe853('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe853('0x2')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0xe853('0x1')]('long')}};
\ No newline at end of file
index 05fca02..1b42de5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ea=['moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','test','Sequelize','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','options','MailMessage','includeAll','findAll','catch','show','length','body','find','params','describe','create','direction','out','split','findOne','MailAccountId','List','CmContact','updatedAt','DESC','Smtp','service','host','secure','authentication','auth','pass','user','attachments','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','get','MailInteractionId','isNil','format','interaction','AcceptMessage','manual','interface','channel','event','EventManager','acceptmessage','mail-interactions','MailInteraction','role','null','rejectMessage','rejectmessage','download','unix','toString','join','root','server','tmp','files','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','err','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4ea,0x1ef));var _0xac4e=function(_0x5a377c,_0x22efdc){_0x5a377c=_0x5a377c-0x0;var _0x3d5b85=_0xc4ea[_0x5a377c];return _0x3d5b85;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xac4e('0x0'));var rimraf=require(_0xac4e('0x1'));var zipdir=require(_0xac4e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xac4e('0x3'));var BPromise=require(_0xac4e('0x4'));var Mustache=require(_0xac4e('0x5'));var util=require(_0xac4e('0x6'));var path=require(_0xac4e('0x7'));var sox=require('sox');var csv=require(_0xac4e('0x8'));var ejs=require(_0xac4e('0x9'));var fs=require('fs');var _=require(_0xac4e('0xa'));var squel=require(_0xac4e('0xb'));var crypto=require(_0xac4e('0xc'));var jsforce=require(_0xac4e('0xd'));var deskjs=require(_0xac4e('0xe'));var toCsv=require(_0xac4e('0x8'));var querystring=require(_0xac4e('0xf'));var Papa=require(_0xac4e('0x10'));var Redis=require(_0xac4e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xac4e('0x12'));var as=require(_0xac4e('0x13'));var hardwareService=require(_0xac4e('0x14'));var logger=require(_0xac4e('0x15'))(_0xac4e('0x16'));var utils=require(_0xac4e('0x17'));var config=require(_0xac4e('0x18'));var db=require(_0xac4e('0x19'))['db'];config[_0xac4e('0x1a')]=_[_0xac4e('0x1b')](config[_0xac4e('0x1a')],{'host':_0xac4e('0x1c'),'port':0x18eb});var socket=require(_0xac4e('0x1d'))(new Redis(config[_0xac4e('0x1a')]));require('./mailMessage.socket')[_0xac4e('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xac4e('0x1f')][_0xac4e('0x20')]({'port':0x232c});var client9003=jayson['client'][_0xac4e('0x20')]({'port':0x232b});var client9002=jayson[_0xac4e('0x1f')][_0xac4e('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1b81a8,_0x51953f,_0x241230){if(_0x241230){var _0x31becd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31becd[_0xac4e('0x21')](_0x51953f)){return _0x1b81a8;}else{throw new db[(_0xac4e('0x22'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1b81a8;}}function respondWithRpcPromise(_0x1fa3ee,_0xba59ff,_0x394c8f,_0x26be54){return new BPromise(function(_0x28d0b2,_0x1961bb){var _0x58fa16=_0x26be54||client;return _0x58fa16[_0xac4e('0x23')](_0x1fa3ee,_0x394c8f)[_0xac4e('0x24')](function(_0x58d2fa){logger[_0xac4e('0x25')](_0xac4e('0x26'),_0xba59ff,_0xac4e('0x27'));logger[_0xac4e('0x28')](_0xac4e('0x29'),_0xba59ff,'request\x20sent',JSON[_0xac4e('0x2a')](_0x58d2fa));if(_0x58d2fa[_0xac4e('0x2b')]){if(_0x58d2fa['error']['code']===0x1f4){logger['error'](_0xac4e('0x26'),_0xba59ff,_0x58d2fa[_0xac4e('0x2b')][_0xac4e('0x2c')]);return _0x1961bb(_0x58d2fa[_0xac4e('0x2b')][_0xac4e('0x2c')]);}logger['error'](_0xac4e('0x26'),_0xba59ff,_0x58d2fa['error'][_0xac4e('0x2c')]);return _0x28d0b2(_0x58d2fa[_0xac4e('0x2b')][_0xac4e('0x2c')]);}else{logger[_0xac4e('0x25')](_0xac4e('0x26'),_0xba59ff,_0xac4e('0x27'));_0x28d0b2(_0x58d2fa[_0xac4e('0x2d')][_0xac4e('0x2c')]);}})['catch'](function(_0x586ca0){logger[_0xac4e('0x2b')](_0xac4e('0x26'),_0xba59ff,_0x586ca0);_0x1961bb(_0x586ca0);});});}function respondWithStatusCode(_0x5059d5,_0x1aaa48){_0x1aaa48=_0x1aaa48||0xcc;return function(_0x53d24f){if(_0x53d24f){return _0x5059d5[_0xac4e('0x2e')](_0x1aaa48);}return _0x5059d5[_0xac4e('0x2f')](_0x1aaa48)[_0xac4e('0x30')]();};}function respondWithResult(_0x38b164,_0x488561){_0x488561=_0x488561||0xc8;return function(_0x1e3405){if(_0x1e3405){return _0x38b164[_0xac4e('0x2f')](_0x488561)[_0xac4e('0x31')](_0x1e3405);}};}function respondWithFilteredResult(_0x5a6141,_0x8ed089){return function(_0xefe830){if(_0xefe830){var _0xdfc523=_0xefe830[_0xac4e('0x32')],_0x29ba0b=_0x8ed089[_0xac4e('0x33')],_0x57f122=_0x8ed089[_0xac4e('0x33')]+_0x8ed089['limit'],_0x3e7cff;if(_0x57f122>=_0xdfc523){_0x57f122=_0xdfc523;_0x3e7cff=0xc8;}else{_0x3e7cff=0xce;}_0x5a6141['status'](_0x3e7cff);return _0x5a6141['set'](_0xac4e('0x34'),_0x29ba0b+'-'+_0x57f122+'/'+_0xdfc523)['json'](_0xefe830);}return null;};}function patchUpdates(_0xa1d175){return function(_0x481d21){try{jsonpatch[_0xac4e('0x35')](_0x481d21,_0xa1d175,!![]);}catch(_0x3d2a73){return BPromise[_0xac4e('0x36')](_0x3d2a73);}return _0x481d21[_0xac4e('0x37')]();};}function saveUpdates(_0x5efe40,_0x2c6032){return function(_0x38190c){if(_0x38190c){return _0x38190c[_0xac4e('0x38')](_0x5efe40)[_0xac4e('0x24')](function(_0x37b475){return _0x37b475;});}return null;};}function removeEntity(_0x42d151,_0x26de6d){return function(_0x523e17){if(_0x523e17){return _0x523e17[_0xac4e('0x39')]()['then'](function(){_0x42d151['status'](0xcc)[_0xac4e('0x30')]();});}};}function handleEntityNotFound(_0x4b2dee,_0x109028){return function(_0x236c85){if(!_0x236c85){_0x4b2dee[_0xac4e('0x2e')](0x194);}return _0x236c85;};}function handleError(_0x4ddae4,_0x5ccbfc){_0x5ccbfc=_0x5ccbfc||0x1f4;return function(_0x183dd4){logger[_0xac4e('0x2b')](_0x183dd4[_0xac4e('0x3a')]);if(_0x183dd4[_0xac4e('0x3b')]){delete _0x183dd4['name'];}_0x4ddae4[_0xac4e('0x2f')](_0x5ccbfc)[_0xac4e('0x3c')](_0x183dd4);};}exports[_0xac4e('0x3d')]=function(_0x19efac,_0x5eb21c){var _0x3d41e7={},_0x167dc7={},_0x43c781={'count':0x0,'rows':[]};var _0x129991=_['map'](db['MailMessage'][_0xac4e('0x3e')],function(_0x6843ad){return{'name':_0x6843ad[_0xac4e('0x3f')],'type':_0x6843ad['type'][_0xac4e('0x40')]};});_0x167dc7[_0xac4e('0x41')]=_[_0xac4e('0x42')](_0x129991,_0xac4e('0x3b'));_0x167dc7[_0xac4e('0x43')]=_[_0xac4e('0x44')](_0x19efac[_0xac4e('0x43')]);_0x167dc7[_0xac4e('0x45')]=_['intersection'](_0x167dc7[_0xac4e('0x41')],_0x167dc7[_0xac4e('0x43')]);_0x3d41e7[_0xac4e('0x46')]=_[_0xac4e('0x47')](_0x167dc7[_0xac4e('0x41')],qs[_0xac4e('0x48')](_0x19efac[_0xac4e('0x43')][_0xac4e('0x48')]));_0x3d41e7['attributes']=_0x3d41e7[_0xac4e('0x46')]['length']?_0x3d41e7[_0xac4e('0x46')]:_0x167dc7['model'];if(!_0x19efac[_0xac4e('0x43')][_0xac4e('0x49')](_0xac4e('0x4a'))){_0x3d41e7[_0xac4e('0x4b')]=qs[_0xac4e('0x4b')](_0x19efac[_0xac4e('0x43')][_0xac4e('0x4b')]);_0x3d41e7[_0xac4e('0x33')]=qs[_0xac4e('0x33')](_0x19efac[_0xac4e('0x43')]['offset']);}_0x3d41e7[_0xac4e('0x4c')]=qs[_0xac4e('0x4d')](_0x19efac[_0xac4e('0x43')]['sort']);_0x3d41e7['where']=qs[_0xac4e('0x45')](_['pick'](_0x19efac[_0xac4e('0x43')],_0x167dc7[_0xac4e('0x45')]),_0x129991);if(_0x19efac[_0xac4e('0x43')][_0xac4e('0x4e')]){_0x3d41e7[_0xac4e('0x4f')]=_[_0xac4e('0x50')](_0x3d41e7[_0xac4e('0x4f')],{'$or':_[_0xac4e('0x42')](_0x129991,function(_0x579761){if(_0x579761[_0xac4e('0x51')]!=='VIRTUAL'){var _0x37d236={};_0x37d236[_0x579761[_0xac4e('0x3b')]]={'$like':'%'+_0x19efac['query'][_0xac4e('0x4e')]+'%'};return _0x37d236;}})});}_0x3d41e7=_[_0xac4e('0x50')]({},_0x3d41e7,_0x19efac[_0xac4e('0x52')]);var _0x242f7f={'where':_0x3d41e7[_0xac4e('0x4f')]};return db[_0xac4e('0x53')][_0xac4e('0x32')](_0x242f7f)['then'](function(_0x219676){_0x43c781[_0xac4e('0x32')]=_0x219676;if(_0x19efac['query'][_0xac4e('0x54')]){_0x3d41e7['include']=[{'all':!![]}];}return db[_0xac4e('0x53')][_0xac4e('0x55')](_0x3d41e7);})[_0xac4e('0x24')](function(_0x35a9f9){_0x43c781['rows']=_0x35a9f9;return _0x43c781;})[_0xac4e('0x24')](respondWithFilteredResult(_0x5eb21c,_0x3d41e7))[_0xac4e('0x56')](handleError(_0x5eb21c,null));};exports[_0xac4e('0x57')]=function(_0x594683,_0x2c12af){var _0x1291c1={'raw':!![],'where':{'id':_0x594683['params']['id']}},_0x471494={};_0x471494['model']=_[_0xac4e('0x44')](db[_0xac4e('0x53')][_0xac4e('0x3e')]);_0x471494['query']=_['keys'](_0x594683['query']);_0x471494[_0xac4e('0x45')]=_[_0xac4e('0x47')](_0x471494['model'],_0x471494[_0xac4e('0x43')]);_0x1291c1[_0xac4e('0x46')]=_['intersection'](_0x471494[_0xac4e('0x41')],qs[_0xac4e('0x48')](_0x594683[_0xac4e('0x43')][_0xac4e('0x48')]));_0x1291c1['attributes']=_0x1291c1[_0xac4e('0x46')][_0xac4e('0x58')]?_0x1291c1[_0xac4e('0x46')]:_0x471494[_0xac4e('0x41')];if(_0x594683['query'][_0xac4e('0x54')]){_0x1291c1['include']=[{'all':!![]}];}_0x1291c1=_[_0xac4e('0x50')]({},_0x1291c1,_0x594683[_0xac4e('0x52')]);return db[_0xac4e('0x53')]['find'](_0x1291c1)[_0xac4e('0x24')](handleEntityNotFound(_0x2c12af,null))[_0xac4e('0x24')](respondWithResult(_0x2c12af,null))['catch'](handleError(_0x2c12af,null));};exports[_0xac4e('0x38')]=function(_0x3dc360,_0x1a6166){if(_0x3dc360[_0xac4e('0x59')]['id']){delete _0x3dc360[_0xac4e('0x59')]['id'];}return db[_0xac4e('0x53')][_0xac4e('0x5a')]({'where':{'id':_0x3dc360[_0xac4e('0x5b')]['id']}})[_0xac4e('0x24')](handleEntityNotFound(_0x1a6166,null))[_0xac4e('0x24')](saveUpdates(_0x3dc360[_0xac4e('0x59')],null))[_0xac4e('0x24')](respondWithResult(_0x1a6166,null))[_0xac4e('0x56')](handleError(_0x1a6166,null));};exports['destroy']=function(_0x46ca81,_0x42c422){return db[_0xac4e('0x53')][_0xac4e('0x5a')]({'where':{'id':_0x46ca81[_0xac4e('0x5b')]['id']}})[_0xac4e('0x24')](handleEntityNotFound(_0x42c422,null))[_0xac4e('0x24')](removeEntity(_0x42c422,null))['catch'](handleError(_0x42c422,null));};exports['describe']=function(_0x221562,_0x16f871){return db[_0xac4e('0x53')][_0xac4e('0x5c')]()[_0xac4e('0x24')](respondWithResult(_0x16f871,null))[_0xac4e('0x56')](handleError(_0x16f871,null));};exports[_0xac4e('0x5d')]=function(_0x31a370,_0x4c15b9){return db[_0xac4e('0x53')][_0xac4e('0x5d')](_0x31a370[_0xac4e('0x59')])['then'](function(_0xa211d7){if(_0xa211d7){if(_0xa211d7[_0xac4e('0x5e')]===_0xac4e('0x5f')&&!_0xa211d7['secret']){var _0x3aece4,_0x14dd65,_0xcac63c;if(_0x31a370[_0xac4e('0x59')]['to']){_0x14dd65=_0x31a370[_0xac4e('0x59')]['to'][_0xac4e('0x60')](',')[0x0];}return db['MailAccount'][_0xac4e('0x61')]({'where':{'id':_0xa211d7[_0xac4e('0x62')]},'include':[{'model':db['CmList'],'as':_0xac4e('0x63'),'include':[{'model':db[_0xac4e('0x64')],'as':'Contacts','where':{'email':_0x14dd65},'limit':0x1,'order':[[_0xac4e('0x65'),_0xac4e('0x66')]]}]},{'model':db['MailServerOut'],'as':_0xac4e('0x67'),'raw':!![]}]})['then'](function(_0x5b02a3){_0x3aece4=_0x5b02a3;if(_0x3aece4&&_0x3aece4[_0xac4e('0x67')]){var _0x5817fe={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x3aece4[_0xac4e('0x67')][_0xac4e('0x68')])){_0x5817fe[_0xac4e('0x69')]=_0x3aece4[_0xac4e('0x67')][_0xac4e('0x69')];_0x5817fe['port']=_0x3aece4['Smtp']['port'];_0x5817fe[_0xac4e('0x6a')]=_0x3aece4['Smtp'][_0xac4e('0x6a')];if(_0x3aece4[_0xac4e('0x67')][_0xac4e('0x6b')]){_0x5817fe[_0xac4e('0x6c')]={'user':_0x3aece4['Smtp']['user'],'pass':_0x3aece4[_0xac4e('0x67')][_0xac4e('0x6d')]};}}else{_0x5817fe[_0xac4e('0x68')]=_0x3aece4[_0xac4e('0x67')][_0xac4e('0x68')];_0x5817fe['auth']={'user':_0x3aece4[_0xac4e('0x67')][_0xac4e('0x6e')],'pass':_0x3aece4[_0xac4e('0x67')][_0xac4e('0x6d')]};_0x5817fe[_0xac4e('0x6a')]=_0x3aece4['Smtp'][_0xac4e('0x6a')];}if(_0x31a370[_0xac4e('0x59')][_0xac4e('0x6f')]&&_0x31a370['body'][_0xac4e('0x6f')][_0xac4e('0x58')]){for(var _0x60238d=0x0;_0x60238d<_0x31a370['body'][_0xac4e('0x6f')][_0xac4e('0x58')];_0x60238d+=0x1){_0x31a370[_0xac4e('0x59')]['attachments'][_0x60238d]={'filename':_0x31a370['body'][_0xac4e('0x6f')][_0x60238d][_0xac4e('0x3b')],'path':path['join'](config['root'],_0xac4e('0x70'),_0x31a370[_0xac4e('0x59')][_0xac4e('0x6f')][_0x60238d][_0xac4e('0x71')])};}}_0xcac63c={'account':_0x5817fe,'message':_0x31a370['body']};return;}})[_0xac4e('0x24')](function(){if(_0x3aece4['List']){if(_0x3aece4[_0xac4e('0x63')][_0xac4e('0x72')][_0xac4e('0x58')]){return _0x3aece4[_0xac4e('0x63')][_0xac4e('0x72')][0x0];}else{return db['CmContact']['create'](_[_0xac4e('0x1b')](_0x31a370[_0xac4e('0x59')],{'firstName':_0x31a370[_0xac4e('0x59')]['to'],'email':_0x31a370[_0xac4e('0x59')]['to'],'phone':_0x31a370[_0xac4e('0x59')]['to'],'ListId':_0x3aece4[_0xac4e('0x73')]}));}}else{throw new Error(_0xac4e('0x74'));}})['then'](function(){if(_0xcac63c){return respondWithRpcPromise('SendMail','sendMail',_0xcac63c,client9003)['then'](function(_0x5ceb95){return _0xa211d7[_0xac4e('0x38')]({'read':!![],'messageId':_0x5ceb95[_0xac4e('0x75')],'sentAt':moment()['format'](_0xac4e('0x76'))});})[_0xac4e('0x56')](function(_0x318083){logger['error']('%s',JSON['stringify'](_0x318083));return _0xa211d7;});}return _0xa211d7;});}return _0xa211d7;}})[_0xac4e('0x24')](respondWithResult(_0x4c15b9,0xc9))[_0xac4e('0x56')](handleError(_0x4c15b9,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0xac4e('0x77')]=function(_0x494bd6,_0x509af1,_0x161a33){var _0x4600c0={'channel':_0xac4e('0x78')};if(_0x494bd6[_0xac4e('0x59')]['id']){delete _0x494bd6[_0xac4e('0x59')]['id'];}_0x494bd6[_0xac4e('0x59')][_0xac4e('0x79')]=!![];_0x494bd6['body'][_0xac4e('0x7a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x494bd6[_0xac4e('0x59')][_0xac4e('0x7b')]=_0x494bd6[_0xac4e('0x59')][_0xac4e('0x7b')]||_0x494bd6[_0xac4e('0x6e')]['id'];return db[_0xac4e('0x53')]['find']({'where':{'id':_0x494bd6[_0xac4e('0x5b')]['id'],'UserId':null},'include':[{'model':db[_0xac4e('0x64')],'as':'Contact'}]})[_0xac4e('0x24')](handleEntityNotFound(_0x509af1,null))[_0xac4e('0x24')](saveUpdates(_0x494bd6['body'],null))[_0xac4e('0x24')](function(_0x15f8f1){if(_0x15f8f1){_0x4600c0[_0xac4e('0x2c')]=_0x15f8f1[_0xac4e('0x7c')]({'plain':!![]});return db['MailInteraction'][_0xac4e('0x5a')]({'where':{'id':_0x15f8f1[_0xac4e('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x509af1,null))[_0xac4e('0x24')](function(_0x339a4a){if(_0x339a4a){return _0x339a4a['update']({'UserId':_0x494bd6[_0xac4e('0x59')][_0xac4e('0x7b')],'read1stAt':_[_0xac4e('0x7e')](_0x339a4a['read1stAt'])?moment()[_0xac4e('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xac4e('0x24')](function(_0x16f961){if(_0x16f961){_0x4600c0[_0xac4e('0x80')]=_0x16f961['get']({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x494bd6['user']['id'],_0x494bd6[_0xac4e('0x6e')][_0xac4e('0x3b')],_0x494bd6['user']['role'],_0x4600c0[_0xac4e('0x80')]['id'],_0x494bd6[_0xac4e('0x59')]?JSON[_0xac4e('0x2a')](_0x494bd6[_0xac4e('0x59')]):'null');return respondWithRpcPromise(_0xac4e('0x81'),'acceptMessage',_0x4600c0);}return null;})[_0xac4e('0x24')](function(_0x1cbccc){if(_0x1cbccc){if(_0x494bd6[_0xac4e('0x59')][_0xac4e('0x82')]){_0x4600c0[_0xac4e('0x2c')][_0xac4e('0x83')]=util[_0xac4e('0x7f')]('SIP/%s',_0x494bd6[_0xac4e('0x6e')][_0xac4e('0x3b')]);_0x4600c0[_0xac4e('0x2c')][_0xac4e('0x84')]=_0x4600c0[_0xac4e('0x84')];_0x4600c0[_0xac4e('0x2c')][_0xac4e('0x85')]=_0xac4e('0x77');return respondWithRpcPromise(_0xac4e('0x86'),_0xac4e('0x86'),{'event':_0xac4e('0x87'),'message':_0x4600c0[_0xac4e('0x2c')]},client9002)[_0xac4e('0x24')](function(){return _0x4600c0;});}return _0x4600c0;}return null;})[_0xac4e('0x24')](respondWithResult(_0x509af1,null))[_0xac4e('0x56')](handleError(_0x509af1,null));};var interaction_log=require(_0xac4e('0x15'))(_0xac4e('0x88'));exports[_0xac4e('0x36')]=function(_0x3d7050,_0x250cb0,_0x5df299){var _0x2d6ec4={'agent':{},'channel':_0xac4e('0x78')};if(_0x3d7050[_0xac4e('0x59')]['id']){delete _0x3d7050[_0xac4e('0x59')]['id'];}_0x3d7050['body'][_0xac4e('0x7b')]=_0x3d7050[_0xac4e('0x59')][_0xac4e('0x7b')]||_0x3d7050['user']['id'];_0x2d6ec4['agent']['id']=_0x3d7050[_0xac4e('0x59')]['UserId'];return db['MailMessage'][_0xac4e('0x5a')]({'where':{'id':_0x3d7050[_0xac4e('0x5b')]['id'],'UserId':null}})[_0xac4e('0x24')](handleEntityNotFound(_0x250cb0,null))[_0xac4e('0x24')](function(_0x10f327){if(_0x10f327){_0x2d6ec4[_0xac4e('0x2c')]=_0x10f327[_0xac4e('0x7c')]({'plain':!![]});return db[_0xac4e('0x89')]['find']({'where':{'id':_0x10f327['MailInteractionId']}});}return null;})[_0xac4e('0x24')](handleEntityNotFound(_0x250cb0,null))[_0xac4e('0x24')](function(_0x17a6de){if(_0x17a6de){_0x2d6ec4['interaction']=_0x17a6de[_0xac4e('0x7c')]({'plain':!![]});interaction_log[_0xac4e('0x25')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3d7050[_0xac4e('0x6e')]['id'],_0x3d7050[_0xac4e('0x6e')]['name'],_0x3d7050[_0xac4e('0x6e')][_0xac4e('0x8a')],_0x2d6ec4['interaction']['id'],_0x3d7050[_0xac4e('0x59')]?JSON['stringify'](_0x3d7050[_0xac4e('0x59')]):_0xac4e('0x8b'));return respondWithRpcPromise('RejectMessage',_0xac4e('0x8c'),_0x2d6ec4);}return null;})[_0xac4e('0x24')](function(_0x353919){if(_0x353919){_0x353919[_0xac4e('0x2c')][_0xac4e('0x83')]=util[_0xac4e('0x7f')]('SIP/%s',_0x3d7050[_0xac4e('0x6e')][_0xac4e('0x3b')]);_0x353919[_0xac4e('0x2c')]['channel']=_0x2d6ec4['channel'];_0x353919[_0xac4e('0x2c')]['event']=_0xac4e('0x36');respondWithRpcPromise(_0xac4e('0x86'),_0xac4e('0x86'),{'event':_0xac4e('0x8d'),'message':_0x353919[_0xac4e('0x2c')]},client9002);return _0x2d6ec4;}return null;})[_0xac4e('0x24')](respondWithResult(_0x250cb0,null))[_0xac4e('0x56')](handleError(_0x250cb0,null));};exports[_0xac4e('0x8e')]=function(_0x51ab1e,_0x4f8fa1){var _0x23e9ce=moment()[_0xac4e('0x8f')]()[_0xac4e('0x90')]();var _0x264de4=path[_0xac4e('0x91')](config[_0xac4e('0x92')],_0xac4e('0x93'),'files',_0xac4e('0x94'));var _0xf04c45=path['join'](config['root'],_0xac4e('0x93'),_0xac4e('0x95'),_0xac4e('0x6f'));var _0x4a443e=util[_0xac4e('0x7f')](_0xac4e('0x96'),_0x23e9ce);return db[_0xac4e('0x53')]['find']({'where':{'id':_0x51ab1e[_0xac4e('0x5b')]['id']},'attributes':['id',_0xac4e('0x59'),_0xac4e('0x97'),'to','cc',_0xac4e('0x98'),'subject',_0xac4e('0x99')],'include':_0x51ab1e[_0xac4e('0x43')][_0xac4e('0x6f')]?[{'model':db[_0xac4e('0x9a')],'as':_0xac4e('0x9b')}]:undefined})[_0xac4e('0x24')](handleEntityNotFound(_0x4f8fa1,null))[_0xac4e('0x24')](function(_0x23d41c){if(_0x23d41c){var _0x434ddb=_0x23d41c;var _0x5b049e={'from':_0x434ddb[_0xac4e('0x97')],'to':_0x434ddb['to'],'subject':_0x434ddb[_0xac4e('0x9c')],'html':_0x434ddb[_0xac4e('0x59')],'headers':{'Date':moment(_0x434ddb[_0xac4e('0x99')])[_0xac4e('0x7f')](_0xac4e('0x9d'))},'attachments':[]};if(_0x23d41c['cc']){_0x5b049e[_0xac4e('0x9e')]['Cc']=_0x23d41c['cc'];}if(_0x23d41c[_0xac4e('0x98')]){_0x5b049e['headers'][_0xac4e('0x9f')]=_0x23d41c[_0xac4e('0x98')];}return new BPromise(function(_0xf02515,_0x37fc2d){if(_0x23d41c['Attachments']){for(var _0x131059=0x0;_0x131059<_0x23d41c[_0xac4e('0x9b')]['length'];_0x131059++){var _0x4fccca=_0x23d41c['Attachments'][_0x131059];var _0x403ef1=path[_0xac4e('0x91')](_0xf04c45,_0x4fccca[_0xac4e('0x71')]);if(fs[_0xac4e('0xa0')](_0x403ef1)){_0x5b049e[_0xac4e('0x6f')][_0xac4e('0xa1')]({'name':_0x4fccca[_0xac4e('0x3b')],'contentType':_0x4fccca[_0xac4e('0x51')],'data':fs[_0xac4e('0xa2')](_0x403ef1)});}}}emlformat[_0xac4e('0xa3')](_0x5b049e,function(_0x3e9541,_0x454a0a){if(_0x3e9541)return _0x37fc2d(_0x3e9541);fs['writeFileSync'](path[_0xac4e('0x91')](_0x264de4,_0x4a443e),_0x454a0a);return _0xf02515(_0x454a0a);});});}})[_0xac4e('0x24')](function(_0x3175ce){if(_0x3175ce){return _0x4f8fa1[_0xac4e('0x8e')](path[_0xac4e('0x91')](_0x264de4,_0x4a443e),_0x4a443e,function(_0x318a30){if(_0x318a30){console['log'](_0xac4e('0xa4'),_0x318a30);}else{fs[_0xac4e('0xa5')](path[_0xac4e('0x91')](_0x264de4,_0x4a443e));}});}})[_0xac4e('0x56')](handleError(_0x4f8fa1,null));};
\ No newline at end of file
+var _0x57c2=['destroy','stack','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','describe','create','out','secret','split','findOne','MailAccountId','List','Contacts','updatedAt','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','attachments','join','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','format','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','mail-interactions','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','rejectmessage','unix','toString','root','server','files','tmp','from','bcc','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','existsSync','push','readFileSync','build','writeFileSync','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x1a346c,_0x359d1e){var _0x4364c2=function(_0x42c6b5){while(--_0x42c6b5){_0x1a346c['push'](_0x1a346c['shift']());}};_0x4364c2(++_0x359d1e);}(_0x57c2,0x113));var _0x257c=function(_0x4e4aab,_0x4948b9){_0x4e4aab=_0x4e4aab-0x0;var _0x1e6175=_0x57c2[_0x4e4aab];return _0x1e6175;};'use strict';var pdf=require(_0x257c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x257c('0x1'));var zipdir=require(_0x257c('0x2'));var jsonpatch=require(_0x257c('0x3'));var rp=require('request-promise');var moment=require(_0x257c('0x4'));var BPromise=require(_0x257c('0x5'));var Mustache=require('mustache');var util=require(_0x257c('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x257c('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x257c('0x8'));var crypto=require('crypto');var jsforce=require(_0x257c('0x9'));var deskjs=require(_0x257c('0xa'));var toCsv=require(_0x257c('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x257c('0xc'));var qs=require(_0x257c('0xd'));var as=require(_0x257c('0xe'));var hardwareService=require(_0x257c('0xf'));var logger=require(_0x257c('0x10'))('api');var utils=require(_0x257c('0x11'));var config=require('../../config/environment');var db=require(_0x257c('0x12'))['db'];config[_0x257c('0x13')]=_[_0x257c('0x14')](config[_0x257c('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x257c('0x15'))(new Redis(config[_0x257c('0x13')]));require('./mailMessage.socket')[_0x257c('0x16')](socket);var jayson=require(_0x257c('0x17'));var client=jayson[_0x257c('0x18')][_0x257c('0x19')]({'port':0x232c});var client9003=jayson[_0x257c('0x18')][_0x257c('0x19')]({'port':0x232b});var client9002=jayson['client'][_0x257c('0x19')]({'port':0x232a});function checkPasswordPattern(_0x57769c,_0x1ddb42,_0x429baf){if(_0x429baf){var _0x19750d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19750d[_0x257c('0x1a')](_0x1ddb42)){return _0x57769c;}else{throw new db[(_0x257c('0x1b'))][(_0x257c('0x1c'))](_0x257c('0x1d'));}}else{return _0x57769c;}}function respondWithRpcPromise(_0x113b73,_0xd3962d,_0x270dc7,_0x281eb6){return new BPromise(function(_0x498b5d,_0x3e41a7){var _0x551a3c=_0x281eb6||client;return _0x551a3c['request'](_0x113b73,_0x270dc7)[_0x257c('0x1e')](function(_0x4a7425){logger[_0x257c('0x1f')](_0x257c('0x20'),_0xd3962d,'request\x20sent');logger[_0x257c('0x21')](_0x257c('0x22'),_0xd3962d,_0x257c('0x23'),JSON[_0x257c('0x24')](_0x4a7425));if(_0x4a7425[_0x257c('0x25')]){if(_0x4a7425['error'][_0x257c('0x26')]===0x1f4){logger[_0x257c('0x25')]('MailMessage,\x20%s,\x20%s',_0xd3962d,_0x4a7425[_0x257c('0x25')]['message']);return _0x3e41a7(_0x4a7425[_0x257c('0x25')][_0x257c('0x27')]);}logger[_0x257c('0x25')](_0x257c('0x20'),_0xd3962d,_0x4a7425[_0x257c('0x25')][_0x257c('0x27')]);return _0x498b5d(_0x4a7425[_0x257c('0x25')][_0x257c('0x27')]);}else{logger[_0x257c('0x1f')]('MailMessage,\x20%s,\x20%s',_0xd3962d,_0x257c('0x23'));_0x498b5d(_0x4a7425['result'][_0x257c('0x27')]);}})[_0x257c('0x28')](function(_0x543233){logger[_0x257c('0x25')]('MailMessage,\x20%s,\x20%s',_0xd3962d,_0x543233);_0x3e41a7(_0x543233);});});}function respondWithStatusCode(_0x3ccb6a,_0x35f99e){_0x35f99e=_0x35f99e||0xcc;return function(_0x24be99){if(_0x24be99){return _0x3ccb6a['sendStatus'](_0x35f99e);}return _0x3ccb6a[_0x257c('0x29')](_0x35f99e)[_0x257c('0x2a')]();};}function respondWithResult(_0x48c915,_0x3937b3){_0x3937b3=_0x3937b3||0xc8;return function(_0x1954d8){if(_0x1954d8){return _0x48c915[_0x257c('0x29')](_0x3937b3)[_0x257c('0x2b')](_0x1954d8);}};}function respondWithFilteredResult(_0x35f1cb,_0x4dc33a){return function(_0x4b41fc){if(_0x4b41fc){var _0x4885c2=_0x4b41fc[_0x257c('0x2c')],_0x1dfa3d=_0x4dc33a[_0x257c('0x2d')],_0xa64f6c=_0x4dc33a[_0x257c('0x2d')]+_0x4dc33a[_0x257c('0x2e')],_0x4a78c1;if(_0xa64f6c>=_0x4885c2){_0xa64f6c=_0x4885c2;_0x4a78c1=0xc8;}else{_0x4a78c1=0xce;}_0x35f1cb[_0x257c('0x29')](_0x4a78c1);return _0x35f1cb[_0x257c('0x2f')](_0x257c('0x30'),_0x1dfa3d+'-'+_0xa64f6c+'/'+_0x4885c2)[_0x257c('0x2b')](_0x4b41fc);}return null;};}function patchUpdates(_0x415df6){return function(_0x1d4f9c){try{jsonpatch[_0x257c('0x31')](_0x1d4f9c,_0x415df6,!![]);}catch(_0x4b0601){return BPromise[_0x257c('0x32')](_0x4b0601);}return _0x1d4f9c[_0x257c('0x33')]();};}function saveUpdates(_0x435f75,_0x39b1a3){return function(_0x158b35){if(_0x158b35){return _0x158b35[_0x257c('0x34')](_0x435f75)[_0x257c('0x1e')](function(_0x1f655a){return _0x1f655a;});}return null;};}function removeEntity(_0x5ef00d,_0xabf10f){return function(_0x493baf){if(_0x493baf){return _0x493baf[_0x257c('0x35')]()[_0x257c('0x1e')](function(){_0x5ef00d['status'](0xcc)[_0x257c('0x2a')]();});}};}function handleEntityNotFound(_0x3d9236,_0x3c77a4){return function(_0x1dad0e){if(!_0x1dad0e){_0x3d9236['sendStatus'](0x194);}return _0x1dad0e;};}function handleError(_0x241156,_0x5597d9){_0x5597d9=_0x5597d9||0x1f4;return function(_0x28b49b){logger[_0x257c('0x25')](_0x28b49b[_0x257c('0x36')]);if(_0x28b49b['name']){delete _0x28b49b['name'];}_0x241156[_0x257c('0x29')](_0x5597d9)[_0x257c('0x37')](_0x28b49b);};}exports[_0x257c('0x38')]=function(_0x3909e2,_0xd8fbfc){var _0x814dab={},_0x149ce4={},_0x1e5810={'count':0x0,'rows':[]};var _0x31f169=_[_0x257c('0x39')](db[_0x257c('0x3a')][_0x257c('0x3b')],function(_0x37f62a){return{'name':_0x37f62a[_0x257c('0x3c')],'type':_0x37f62a[_0x257c('0x3d')][_0x257c('0x3e')]};});_0x149ce4[_0x257c('0x3f')]=_[_0x257c('0x39')](_0x31f169,_0x257c('0x40'));_0x149ce4[_0x257c('0x41')]=_[_0x257c('0x42')](_0x3909e2[_0x257c('0x41')]);_0x149ce4[_0x257c('0x43')]=_['intersection'](_0x149ce4[_0x257c('0x3f')],_0x149ce4['query']);_0x814dab['attributes']=_[_0x257c('0x44')](_0x149ce4[_0x257c('0x3f')],qs['fields'](_0x3909e2[_0x257c('0x41')][_0x257c('0x45')]));_0x814dab['attributes']=_0x814dab[_0x257c('0x46')][_0x257c('0x47')]?_0x814dab['attributes']:_0x149ce4[_0x257c('0x3f')];if(!_0x3909e2['query']['hasOwnProperty']('nolimit')){_0x814dab[_0x257c('0x2e')]=qs[_0x257c('0x2e')](_0x3909e2[_0x257c('0x41')][_0x257c('0x2e')]);_0x814dab['offset']=qs['offset'](_0x3909e2['query'][_0x257c('0x2d')]);}_0x814dab[_0x257c('0x48')]=qs['sort'](_0x3909e2[_0x257c('0x41')][_0x257c('0x49')]);_0x814dab[_0x257c('0x4a')]=qs[_0x257c('0x43')](_[_0x257c('0x4b')](_0x3909e2[_0x257c('0x41')],_0x149ce4[_0x257c('0x43')]),_0x31f169);if(_0x3909e2['query'][_0x257c('0x4c')]){_0x814dab[_0x257c('0x4a')]=_[_0x257c('0x4d')](_0x814dab[_0x257c('0x4a')],{'$or':_['map'](_0x31f169,function(_0x1d7eef){if(_0x1d7eef['type']!==_0x257c('0x4e')){var _0x4ccffa={};_0x4ccffa[_0x1d7eef[_0x257c('0x40')]]={'$like':'%'+_0x3909e2['query']['filter']+'%'};return _0x4ccffa;}})});}_0x814dab=_['merge']({},_0x814dab,_0x3909e2[_0x257c('0x4f')]);var _0x230e89={'where':_0x814dab[_0x257c('0x4a')]};return db[_0x257c('0x3a')]['count'](_0x230e89)[_0x257c('0x1e')](function(_0x10debf){_0x1e5810['count']=_0x10debf;if(_0x3909e2[_0x257c('0x41')][_0x257c('0x50')]){_0x814dab[_0x257c('0x51')]=[{'all':!![]}];}return db['MailMessage'][_0x257c('0x52')](_0x814dab);})['then'](function(_0x439954){_0x1e5810[_0x257c('0x53')]=_0x439954;return _0x1e5810;})[_0x257c('0x1e')](respondWithFilteredResult(_0xd8fbfc,_0x814dab))['catch'](handleError(_0xd8fbfc,null));};exports[_0x257c('0x54')]=function(_0x5c525b,_0x4b076b){var _0x4fc42d={'raw':!![],'where':{'id':_0x5c525b[_0x257c('0x55')]['id']}},_0x1a7cf9={};_0x1a7cf9[_0x257c('0x3f')]=_[_0x257c('0x42')](db[_0x257c('0x3a')]['rawAttributes']);_0x1a7cf9['query']=_['keys'](_0x5c525b[_0x257c('0x41')]);_0x1a7cf9[_0x257c('0x43')]=_[_0x257c('0x44')](_0x1a7cf9[_0x257c('0x3f')],_0x1a7cf9[_0x257c('0x41')]);_0x4fc42d[_0x257c('0x46')]=_[_0x257c('0x44')](_0x1a7cf9[_0x257c('0x3f')],qs['fields'](_0x5c525b[_0x257c('0x41')][_0x257c('0x45')]));_0x4fc42d[_0x257c('0x46')]=_0x4fc42d[_0x257c('0x46')][_0x257c('0x47')]?_0x4fc42d['attributes']:_0x1a7cf9[_0x257c('0x3f')];if(_0x5c525b[_0x257c('0x41')][_0x257c('0x50')]){_0x4fc42d[_0x257c('0x51')]=[{'all':!![]}];}_0x4fc42d=_[_0x257c('0x4d')]({},_0x4fc42d,_0x5c525b[_0x257c('0x4f')]);return db[_0x257c('0x3a')][_0x257c('0x56')](_0x4fc42d)[_0x257c('0x1e')](handleEntityNotFound(_0x4b076b,null))['then'](respondWithResult(_0x4b076b,null))['catch'](handleError(_0x4b076b,null));};exports[_0x257c('0x34')]=function(_0x5b1684,_0x1b609d){if(_0x5b1684[_0x257c('0x57')]['id']){delete _0x5b1684[_0x257c('0x57')]['id'];}return db[_0x257c('0x3a')][_0x257c('0x56')]({'where':{'id':_0x5b1684[_0x257c('0x55')]['id']}})[_0x257c('0x1e')](handleEntityNotFound(_0x1b609d,null))[_0x257c('0x1e')](saveUpdates(_0x5b1684[_0x257c('0x57')],null))[_0x257c('0x1e')](respondWithResult(_0x1b609d,null))[_0x257c('0x28')](handleError(_0x1b609d,null));};exports[_0x257c('0x35')]=function(_0x20a8e6,_0x580341){return db[_0x257c('0x3a')][_0x257c('0x56')]({'where':{'id':_0x20a8e6[_0x257c('0x55')]['id']}})['then'](handleEntityNotFound(_0x580341,null))[_0x257c('0x1e')](removeEntity(_0x580341,null))[_0x257c('0x28')](handleError(_0x580341,null));};exports['describe']=function(_0x503934,_0x1b8556){return db[_0x257c('0x3a')][_0x257c('0x58')]()[_0x257c('0x1e')](respondWithResult(_0x1b8556,null))[_0x257c('0x28')](handleError(_0x1b8556,null));};exports[_0x257c('0x59')]=function(_0x16f2f9,_0x61df2b){return db['MailMessage']['create'](_0x16f2f9[_0x257c('0x57')])[_0x257c('0x1e')](function(_0x5cfec9){if(_0x5cfec9){if(_0x5cfec9['direction']===_0x257c('0x5a')&&!_0x5cfec9[_0x257c('0x5b')]){var _0x31558e,_0x366561,_0x2053ac;if(_0x16f2f9['body']['to']){_0x366561=_0x16f2f9[_0x257c('0x57')]['to'][_0x257c('0x5c')](',')[0x0];}return db['MailAccount'][_0x257c('0x5d')]({'where':{'id':_0x5cfec9[_0x257c('0x5e')]},'include':[{'model':db['CmList'],'as':_0x257c('0x5f'),'include':[{'model':db['CmContact'],'as':_0x257c('0x60'),'where':{'email':_0x366561},'limit':0x1,'order':[[_0x257c('0x61'),'DESC']]}]},{'model':db[_0x257c('0x62')],'as':_0x257c('0x63'),'raw':!![]}]})[_0x257c('0x1e')](function(_0x462152){_0x31558e=_0x462152;if(_0x31558e&&_0x31558e[_0x257c('0x63')]){var _0x43b511={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x31558e['Smtp'][_0x257c('0x64')])){_0x43b511['host']=_0x31558e[_0x257c('0x63')][_0x257c('0x65')];_0x43b511[_0x257c('0x66')]=_0x31558e[_0x257c('0x63')]['port'];_0x43b511[_0x257c('0x67')]=_0x31558e[_0x257c('0x63')][_0x257c('0x67')];if(_0x31558e[_0x257c('0x63')]['authentication']){_0x43b511[_0x257c('0x68')]={'user':_0x31558e['Smtp'][_0x257c('0x69')],'pass':_0x31558e[_0x257c('0x63')][_0x257c('0x6a')]};}}else{_0x43b511[_0x257c('0x64')]=_0x31558e['Smtp'][_0x257c('0x64')];_0x43b511[_0x257c('0x68')]={'user':_0x31558e[_0x257c('0x63')][_0x257c('0x69')],'pass':_0x31558e[_0x257c('0x63')][_0x257c('0x6a')]};_0x43b511['secure']=_0x31558e['Smtp']['secure'];}if(_0x16f2f9[_0x257c('0x57')]['attachments']&&_0x16f2f9[_0x257c('0x57')][_0x257c('0x6b')][_0x257c('0x47')]){for(var _0x15458d=0x0;_0x15458d<_0x16f2f9['body']['attachments'][_0x257c('0x47')];_0x15458d+=0x1){_0x16f2f9[_0x257c('0x57')][_0x257c('0x6b')][_0x15458d]={'filename':_0x16f2f9[_0x257c('0x57')][_0x257c('0x6b')][_0x15458d][_0x257c('0x40')],'path':path[_0x257c('0x6c')](config['root'],_0x257c('0x6d'),_0x16f2f9['body'][_0x257c('0x6b')][_0x15458d][_0x257c('0x6e')])};}}_0x2053ac={'account':_0x43b511,'message':_0x16f2f9['body']};return;}})[_0x257c('0x1e')](function(){if(_0x31558e[_0x257c('0x5f')]){if(_0x31558e[_0x257c('0x5f')][_0x257c('0x60')][_0x257c('0x47')]){return _0x31558e[_0x257c('0x5f')][_0x257c('0x60')][0x0];}else{return db['CmContact'][_0x257c('0x59')](_[_0x257c('0x14')](_0x16f2f9[_0x257c('0x57')],{'firstName':_0x16f2f9[_0x257c('0x57')]['to'],'email':_0x16f2f9[_0x257c('0x57')]['to'],'phone':_0x16f2f9[_0x257c('0x57')]['to'],'ListId':_0x31558e[_0x257c('0x6f')]}));}}else{throw new Error(_0x257c('0x70'));}})[_0x257c('0x1e')](function(){if(_0x2053ac){return respondWithRpcPromise(_0x257c('0x71'),_0x257c('0x72'),_0x2053ac,client9003)[_0x257c('0x1e')](function(_0xcbbf6b){return _0x5cfec9[_0x257c('0x34')]({'read':!![],'messageId':_0xcbbf6b['messageId'],'sentAt':moment()[_0x257c('0x73')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x257c('0x28')](function(_0x152fcd){logger['error']('%s',JSON[_0x257c('0x24')](_0x152fcd));return _0x5cfec9;});}return _0x5cfec9;});}return _0x5cfec9;}})[_0x257c('0x1e')](respondWithResult(_0x61df2b,0xc9))['catch'](handleError(_0x61df2b,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports['accept']=function(_0x5930fa,_0x5e77c0,_0x42d802){var _0x322503={'channel':_0x257c('0x74')};if(_0x5930fa[_0x257c('0x57')]['id']){delete _0x5930fa[_0x257c('0x57')]['id'];}_0x5930fa['body']['read']=!![];_0x5930fa['body'][_0x257c('0x75')]=moment()[_0x257c('0x73')](_0x257c('0x76'));_0x5930fa[_0x257c('0x57')]['UserId']=_0x5930fa['body'][_0x257c('0x77')]||_0x5930fa[_0x257c('0x69')]['id'];return db[_0x257c('0x3a')][_0x257c('0x56')]({'where':{'id':_0x5930fa[_0x257c('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x257c('0x78')],'as':_0x257c('0x79')}]})[_0x257c('0x1e')](handleEntityNotFound(_0x5e77c0,null))['then'](saveUpdates(_0x5930fa['body'],null))[_0x257c('0x1e')](function(_0x9957dc){if(_0x9957dc){_0x322503[_0x257c('0x27')]=_0x9957dc[_0x257c('0x7a')]({'plain':!![]});return db[_0x257c('0x7b')][_0x257c('0x56')]({'where':{'id':_0x9957dc[_0x257c('0x7c')]}});}return null;})[_0x257c('0x1e')](handleEntityNotFound(_0x5e77c0,null))[_0x257c('0x1e')](function(_0x539f14){if(_0x539f14){return _0x539f14[_0x257c('0x34')]({'UserId':_0x5930fa[_0x257c('0x57')]['UserId'],'read1stAt':_[_0x257c('0x7d')](_0x539f14[_0x257c('0x7e')])?moment()[_0x257c('0x73')](_0x257c('0x76')):undefined});}return null;})['then'](function(_0x1a3c01){if(_0x1a3c01){_0x322503['interaction']=_0x1a3c01['get']({'plain':!![]});interaction_log[_0x257c('0x1f')](_0x257c('0x7f'),_0x5930fa[_0x257c('0x69')]['id'],_0x5930fa[_0x257c('0x69')][_0x257c('0x40')],_0x5930fa[_0x257c('0x69')]['role'],_0x322503[_0x257c('0x80')]['id'],_0x5930fa[_0x257c('0x57')]?JSON[_0x257c('0x24')](_0x5930fa[_0x257c('0x57')]):_0x257c('0x81'));return respondWithRpcPromise(_0x257c('0x82'),_0x257c('0x83'),_0x322503);}return null;})[_0x257c('0x1e')](function(_0x47daea){if(_0x47daea){if(_0x5930fa[_0x257c('0x57')][_0x257c('0x84')]){_0x322503[_0x257c('0x27')][_0x257c('0x85')]=util['format'](_0x257c('0x86'),_0x5930fa[_0x257c('0x69')]['name']);_0x322503['message']['channel']=_0x322503[_0x257c('0x87')];_0x322503['message'][_0x257c('0x88')]=_0x257c('0x89');return respondWithRpcPromise(_0x257c('0x8a'),_0x257c('0x8a'),{'event':'acceptmessage','message':_0x322503[_0x257c('0x27')]},client9002)[_0x257c('0x1e')](function(){return _0x322503;});}return _0x322503;}return null;})[_0x257c('0x1e')](respondWithResult(_0x5e77c0,null))[_0x257c('0x28')](handleError(_0x5e77c0,null));};var interaction_log=require(_0x257c('0x10'))(_0x257c('0x8b'));exports[_0x257c('0x32')]=function(_0x2672a0,_0x51a992,_0x3e1c16){var _0x17f1e1={'agent':{},'channel':'mail'};if(_0x2672a0[_0x257c('0x57')]['id']){delete _0x2672a0[_0x257c('0x57')]['id'];}_0x2672a0[_0x257c('0x57')]['UserId']=_0x2672a0[_0x257c('0x57')][_0x257c('0x77')]||_0x2672a0['user']['id'];_0x17f1e1[_0x257c('0x8c')]['id']=_0x2672a0['body'][_0x257c('0x77')];return db[_0x257c('0x3a')][_0x257c('0x56')]({'where':{'id':_0x2672a0[_0x257c('0x55')]['id'],'UserId':null}})[_0x257c('0x1e')](handleEntityNotFound(_0x51a992,null))[_0x257c('0x1e')](function(_0x362f83){if(_0x362f83){_0x17f1e1[_0x257c('0x27')]=_0x362f83[_0x257c('0x7a')]({'plain':!![]});return db[_0x257c('0x7b')][_0x257c('0x56')]({'where':{'id':_0x362f83[_0x257c('0x7c')]}});}return null;})[_0x257c('0x1e')](handleEntityNotFound(_0x51a992,null))['then'](function(_0x95afb1){if(_0x95afb1){_0x17f1e1[_0x257c('0x80')]=_0x95afb1[_0x257c('0x7a')]({'plain':!![]});interaction_log[_0x257c('0x1f')](_0x257c('0x8d'),_0x2672a0[_0x257c('0x69')]['id'],_0x2672a0[_0x257c('0x69')]['name'],_0x2672a0[_0x257c('0x69')][_0x257c('0x8e')],_0x17f1e1[_0x257c('0x80')]['id'],_0x2672a0[_0x257c('0x57')]?JSON[_0x257c('0x24')](_0x2672a0[_0x257c('0x57')]):'null');return respondWithRpcPromise(_0x257c('0x8f'),_0x257c('0x90'),_0x17f1e1);}return null;})[_0x257c('0x1e')](function(_0x160038){if(_0x160038){_0x160038[_0x257c('0x27')][_0x257c('0x85')]=util[_0x257c('0x73')](_0x257c('0x86'),_0x2672a0[_0x257c('0x69')][_0x257c('0x40')]);_0x160038[_0x257c('0x27')][_0x257c('0x87')]=_0x17f1e1[_0x257c('0x87')];_0x160038['message'][_0x257c('0x88')]=_0x257c('0x32');respondWithRpcPromise(_0x257c('0x8a'),_0x257c('0x8a'),{'event':_0x257c('0x91'),'message':_0x160038[_0x257c('0x27')]},client9002);return _0x17f1e1;}return null;})['then'](respondWithResult(_0x51a992,null))[_0x257c('0x28')](handleError(_0x51a992,null));};exports['download']=function(_0x2b2332,_0xb8f413){var _0x6748e4=moment()[_0x257c('0x92')]()[_0x257c('0x93')]();var _0x5cd1f3=path['join'](config[_0x257c('0x94')],_0x257c('0x95'),_0x257c('0x96'),_0x257c('0x97'));var _0x3de237=path[_0x257c('0x6c')](config['root'],_0x257c('0x95'),'files',_0x257c('0x6b'));var _0x336054=util[_0x257c('0x73')]('message-%s.eml',_0x6748e4);return db[_0x257c('0x3a')][_0x257c('0x56')]({'where':{'id':_0x2b2332[_0x257c('0x55')]['id']},'attributes':['id',_0x257c('0x57'),_0x257c('0x98'),'to','cc',_0x257c('0x99'),'subject',_0x257c('0x9a')],'include':_0x2b2332[_0x257c('0x41')][_0x257c('0x6b')]?[{'model':db[_0x257c('0x9b')],'as':_0x257c('0x9c')}]:undefined})[_0x257c('0x1e')](handleEntityNotFound(_0xb8f413,null))['then'](function(_0x377832){if(_0x377832){var _0x2ea6f1=_0x377832;var _0x2fa473={'from':_0x2ea6f1[_0x257c('0x98')],'to':_0x2ea6f1['to'],'subject':_0x2ea6f1['subject'],'html':_0x2ea6f1[_0x257c('0x57')],'headers':{'Date':moment(_0x2ea6f1['createdAt'])['format'](_0x257c('0x9d'))},'attachments':[]};if(_0x377832['cc']){_0x2fa473['headers']['Cc']=_0x377832['cc'];}if(_0x377832[_0x257c('0x99')]){_0x2fa473['headers'][_0x257c('0x9e')]=_0x377832['bcc'];}return new BPromise(function(_0x442e7b,_0x1e3441){if(_0x377832[_0x257c('0x9c')]){for(var _0x24671a=0x0;_0x24671a<_0x377832[_0x257c('0x9c')][_0x257c('0x47')];_0x24671a++){var _0x581510=_0x377832[_0x257c('0x9c')][_0x24671a];var _0x145f45=path[_0x257c('0x6c')](_0x3de237,_0x581510['basename']);if(fs[_0x257c('0x9f')](_0x145f45)){_0x2fa473[_0x257c('0x6b')][_0x257c('0xa0')]({'name':_0x581510['name'],'contentType':_0x581510['type'],'data':fs[_0x257c('0xa1')](_0x145f45)});}}}emlformat[_0x257c('0xa2')](_0x2fa473,function(_0x264beb,_0x671aea){if(_0x264beb)return _0x1e3441(_0x264beb);fs[_0x257c('0xa3')](path[_0x257c('0x6c')](_0x5cd1f3,_0x336054),_0x671aea);return _0x442e7b(_0x671aea);});});}})['then'](function(_0x305931){if(_0x305931){return _0xb8f413['download'](path[_0x257c('0x6c')](_0x5cd1f3,_0x336054),_0x336054,function(_0x3df242){if(_0x3df242){console['log']('err',_0x3df242);}else{fs['unlinkSync'](path[_0x257c('0x6c')](_0x5cd1f3,_0x336054));}});}})[_0x257c('0x28')](handleError(_0xb8f413,null));};
\ No newline at end of file
index cfe4f50..07d5d19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e70=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xa5becb,_0x13aeb9){var _0x1ef45d=function(_0x3e9738){while(--_0x3e9738){_0xa5becb['push'](_0xa5becb['shift']());}};_0x1ef45d(++_0x13aeb9);}(_0x9e70,0x13c));var _0x09e7=function(_0x37314a,_0x5d8a9f){_0x37314a=_0x37314a-0x0;var _0x56cc24=_0x9e70[_0x37314a];return _0x56cc24;};'use strict';var EventEmitter=require(_0x09e7('0x0'));var MailMessage=require(_0x09e7('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x09e7('0x2'),'afterUpdate':_0x09e7('0x3'),'afterDestroy':_0x09e7('0x4')};function emitEvent(_0x26b42c){return function(_0x5924ee,_0x25cf37,_0x4d0823){MailMessageEvents['emit'](_0x26b42c+':'+_0x5924ee['id'],_0x5924ee);MailMessageEvents[_0x09e7('0x5')](_0x26b42c,_0x5924ee);_0x4d0823(null);};}for(var e in events){if(events[_0x09e7('0x6')](e)){var event=events[e];MailMessage[_0x09e7('0x7')](e,emitEvent(event));}}module[_0x09e7('0x8')]=MailMessageEvents;
\ No newline at end of file
+var _0xc6d4=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x565f74,_0x7e45f8){var _0x1c0d7c=function(_0x34137b){while(--_0x34137b){_0x565f74['push'](_0x565f74['shift']());}};_0x1c0d7c(++_0x7e45f8);}(_0xc6d4,0xe7));var _0x4c6d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc6d4[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x4c6d('0x0'));var MailMessage=require(_0x4c6d('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x4c6d('0x2')](0x0);var events={'afterCreate':_0x4c6d('0x3'),'afterUpdate':_0x4c6d('0x4'),'afterDestroy':_0x4c6d('0x5')};function emitEvent(_0x885322){return function(_0x39ec91,_0x6e7df7,_0x58419b){MailMessageEvents[_0x4c6d('0x6')](_0x885322+':'+_0x39ec91['id'],_0x39ec91);MailMessageEvents[_0x4c6d('0x6')](_0x885322,_0x39ec91);_0x58419b(null);};}for(var e in events){if(events[_0x4c6d('0x7')](e)){var event=events[e];MailMessage[_0x4c6d('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index cdb2317..ae7bdce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9fd=['lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','models','get','secret','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','direction','body','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0xb9fd,0xee));var _0xdb9f=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xb9fd[_0xf2628e];return _0x13863a;};'use strict';var _=require(_0xdb9f('0x0'));var util=require(_0xdb9f('0x1'));var logger=require(_0xdb9f('0x2'))(_0xdb9f('0x3'));var moment=require('moment');var BPromise=require(_0xdb9f('0x4'));var rp=require(_0xdb9f('0x5'));var htmlToText=require(_0xdb9f('0x6'));var fs=require('fs');var path=require(_0xdb9f('0x7'));var rimraf=require(_0xdb9f('0x8'));var config=require(_0xdb9f('0x9'));var attributes=require('./mailMessage.attributes');module[_0xdb9f('0xa')]=function(_0x96c5f4,_0xbafa36){return _0x96c5f4[_0xdb9f('0xb')]('MailMessage',attributes,{'tableName':_0xdb9f('0xc'),'paranoid':![],'indexes':[{'name':_0xdb9f('0xd'),'fields':[_0xdb9f('0xd')]},{'name':_0xdb9f('0xe'),'fields':[_0xdb9f('0xf'),_0xdb9f('0x10')],'type':_0xdb9f('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x16fbb3,_0x4f05e2,_0x2a1984){if(_0x16fbb3['body']){_0x16fbb3['plainBody']=htmlToText[_0xdb9f('0x12')](_0x16fbb3['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2a1984(null,_0x4f05e2);},'afterCreate':function(_0x2d8e6b,_0x2d08c,_0xd2b620){var _0x18a150=_0x96c5f4[_0xdb9f('0x13')];var _0x53f072=_0x2d8e6b[_0xdb9f('0x14')]({'plain':!![]});if(_0x53f072['direction']['toLowerCase']()==='in'||_0x53f072['direction']['toLowerCase']()==='out'&&!_0x53f072[_0xdb9f('0x15')]&&!_['isNil'](_0x53f072[_0xdb9f('0x16')])){_0x18a150[_0xdb9f('0x17')][_0xdb9f('0x18')]({'where':{'id':_0x53f072[_0xdb9f('0x19')]}})['then'](function(_0x94786b){if(_0x94786b){_0x94786b[_0xdb9f('0x1a')]({'lastMsgAt':_0x53f072[_0xdb9f('0x1b')],'lastMsgDirection':_0x53f072[_0xdb9f('0x1c')]['toLowerCase'](),'lastMsgBody':_0x53f072[_0xdb9f('0x1d')]});}})[_0xdb9f('0x1e')](function(_0x119eca){console[_0xdb9f('0x1f')](_0x119eca);});}_0xd2b620();}},'charset':_0xdb9f('0x20'),'collate':_0xdb9f('0x21')});};
\ No newline at end of file
+var _0xacb1=['toLowerCase','out','MailInteraction','findOne','MailInteractionId','update','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','plainBody','subject','body','models','get','direction'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0xacb1,0x148));var _0x1acb=function(_0x1f6a6f,_0x44acc6){_0x1f6a6f=_0x1f6a6f-0x0;var _0x2cea61=_0xacb1[_0x1f6a6f];return _0x2cea61;};'use strict';var _=require(_0x1acb('0x0'));var util=require('util');var logger=require(_0x1acb('0x1'))(_0x1acb('0x2'));var moment=require(_0x1acb('0x3'));var BPromise=require('bluebird');var rp=require(_0x1acb('0x4'));var htmlToText=require(_0x1acb('0x5'));var fs=require('fs');var path=require(_0x1acb('0x6'));var rimraf=require(_0x1acb('0x7'));var config=require(_0x1acb('0x8'));var attributes=require(_0x1acb('0x9'));module[_0x1acb('0xa')]=function(_0x34bbee,_0x34029d){return _0x34bbee['define'](_0x1acb('0xb'),attributes,{'tableName':_0x1acb('0xc'),'paranoid':![],'indexes':[{'name':_0x1acb('0xd'),'fields':[_0x1acb('0xd')]},{'name':'fti_mail_messages','fields':[_0x1acb('0xe'),_0x1acb('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x223f17,_0x3cd7a6,_0x2769ea){if(_0x223f17[_0x1acb('0x10')]){_0x223f17['plainBody']=htmlToText['fromString'](_0x223f17[_0x1acb('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2769ea(null,_0x3cd7a6);},'afterCreate':function(_0x969b26,_0x577e5e,_0x4be936){var _0xe5559e=_0x34bbee[_0x1acb('0x11')];var _0x50b94c=_0x969b26[_0x1acb('0x12')]({'plain':!![]});if(_0x50b94c[_0x1acb('0x13')][_0x1acb('0x14')]()==='in'||_0x50b94c[_0x1acb('0x13')]['toLowerCase']()===_0x1acb('0x15')&&!_0x50b94c['secret']&&!_['isNil'](_0x50b94c['UserId'])){_0xe5559e[_0x1acb('0x16')][_0x1acb('0x17')]({'where':{'id':_0x50b94c[_0x1acb('0x18')]}})['then'](function(_0x201df0){if(_0x201df0){_0x201df0[_0x1acb('0x19')]({'lastMsgAt':_0x50b94c['createdAt'],'lastMsgDirection':_0x50b94c['direction'][_0x1acb('0x14')](),'lastMsgBody':_0x50b94c['body']});}})[_0x1acb('0x1a')](function(_0x29ab8b){console[_0x1acb('0x1b')](_0x29ab8b);});}_0x4be936();}},'charset':'utf8mb4','collate':_0x1acb('0x1c')});};
\ No newline at end of file
index e5a4385..edd458f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7409=['info','error','MailMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateMailMessage','MailMessage','create','options','raw','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7409,0x6e));var _0x9740=function(_0x544c03,_0x558fe4){_0x544c03=_0x544c03-0x0;var _0x5e86ad=_0x7409[_0x544c03];return _0x5e86ad;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var moment=require('moment');var BPromise=require(_0x9740('0x2'));var rs=require(_0x9740('0x3'));var fs=require('fs');var Redis=require(_0x9740('0x4'));var db=require(_0x9740('0x5'))['db'];var utils=require(_0x9740('0x6'));var logger=require(_0x9740('0x7'))(_0x9740('0x8'));var config=require(_0x9740('0x9'));var jayson=require(_0x9740('0xa'));var client=jayson['client'][_0x9740('0xb')]({'port':0x232a});config[_0x9740('0xc')]=_[_0x9740('0xd')](config['redis'],{'host':_0x9740('0xe'),'port':0x18eb});var socket=require(_0x9740('0xf'))(new Redis(config[_0x9740('0xc')]));require('./mailMessage.socket')[_0x9740('0x10')](socket);function respondWithRpcPromise(_0x548bf8,_0x1a6ff9,_0xc27c18){return new BPromise(function(_0x4e39f9,_0x59dd44){return client['request'](_0x548bf8,_0xc27c18)[_0x9740('0x11')](function(_0x3bc357){logger[_0x9740('0x12')]('MailMessage,\x20%s,\x20%s',_0x1a6ff9,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x1a6ff9,'request\x20sent',JSON['stringify'](_0x3bc357));if(_0x3bc357['error']){if(_0x3bc357[_0x9740('0x13')]['code']===0x1f4){logger['error'](_0x9740('0x14'),_0x1a6ff9,_0x3bc357['error'][_0x9740('0x15')]);return _0x59dd44(_0x3bc357[_0x9740('0x13')][_0x9740('0x15')]);}logger[_0x9740('0x13')]('MailMessage,\x20%s,\x20%s',_0x1a6ff9,_0x3bc357[_0x9740('0x13')]['message']);return _0x4e39f9(_0x3bc357[_0x9740('0x13')][_0x9740('0x15')]);}else{logger[_0x9740('0x12')](_0x9740('0x14'),_0x1a6ff9,_0x9740('0x16'));_0x4e39f9(_0x3bc357[_0x9740('0x17')][_0x9740('0x15')]);}})[_0x9740('0x18')](function(_0x206c4d){logger['error'](_0x9740('0x14'),_0x1a6ff9,_0x206c4d);_0x59dd44(_0x206c4d);});});}exports[_0x9740('0x19')]=function(_0x3fb57c){var _0x31d4f7=this;return new Promise(function(_0x3f9e9d,_0xdf62fc){return db[_0x9740('0x1a')][_0x9740('0x1b')](_0x3fb57c['body'],{'raw':_0x3fb57c[_0x9740('0x1c')]?_0x3fb57c['options'][_0x9740('0x1d')]===undefined?!![]:![]:!![]})[_0x9740('0x11')](function(_0x1af88e){logger[_0x9740('0x12')](_0x9740('0x19'),_0x3fb57c);logger[_0x9740('0x1e')]('CreateMailMessage',_0x3fb57c,JSON[_0x9740('0x1f')](_0x1af88e));_0x3f9e9d(_0x1af88e);})[_0x9740('0x18')](function(_0xa24326){logger[_0x9740('0x13')](_0x9740('0x19'),_0xa24326[_0x9740('0x15')],_0x3fb57c);_0xdf62fc(_0x31d4f7[_0x9740('0x13')](0x1f4,_0xa24326[_0x9740('0x15')]));});});};
\ No newline at end of file
+var _0x0c23=['localhost','socket.io-emitter','register','request','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x39ae31,_0x26a95d){var _0x2016f5=function(_0xe9923e){while(--_0xe9923e){_0x39ae31['push'](_0x39ae31['shift']());}};_0x2016f5(++_0x26a95d);}(_0x0c23,0x13e));var _0x30c2=function(_0x3c29cf,_0x3edfce){_0x3c29cf=_0x3c29cf-0x0;var _0x8e5a9b=_0x0c23[_0x3c29cf];return _0x8e5a9b;};'use strict';var _=require(_0x30c2('0x0'));var util=require(_0x30c2('0x1'));var moment=require(_0x30c2('0x2'));var BPromise=require(_0x30c2('0x3'));var rs=require(_0x30c2('0x4'));var fs=require('fs');var Redis=require(_0x30c2('0x5'));var db=require(_0x30c2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x30c2('0x7'))(_0x30c2('0x8'));var config=require(_0x30c2('0x9'));var jayson=require(_0x30c2('0xa'));var client=jayson[_0x30c2('0xb')][_0x30c2('0xc')]({'port':0x232a});config['redis']=_[_0x30c2('0xd')](config[_0x30c2('0xe')],{'host':_0x30c2('0xf'),'port':0x18eb});var socket=require(_0x30c2('0x10'))(new Redis(config[_0x30c2('0xe')]));require('./mailMessage.socket')[_0x30c2('0x11')](socket);function respondWithRpcPromise(_0x2b6595,_0x4bd5be,_0x3365c5){return new BPromise(function(_0x44e778,_0x40f639){return client[_0x30c2('0x12')](_0x2b6595,_0x3365c5)[_0x30c2('0x13')](function(_0x17eb67){logger['info']('MailMessage,\x20%s,\x20%s',_0x4bd5be,'request\x20sent');logger[_0x30c2('0x14')](_0x30c2('0x15'),_0x4bd5be,_0x30c2('0x16'),JSON[_0x30c2('0x17')](_0x17eb67));if(_0x17eb67[_0x30c2('0x18')]){if(_0x17eb67[_0x30c2('0x18')][_0x30c2('0x19')]===0x1f4){logger['error'](_0x30c2('0x1a'),_0x4bd5be,_0x17eb67[_0x30c2('0x18')]['message']);return _0x40f639(_0x17eb67[_0x30c2('0x18')][_0x30c2('0x1b')]);}logger[_0x30c2('0x18')](_0x30c2('0x1a'),_0x4bd5be,_0x17eb67[_0x30c2('0x18')][_0x30c2('0x1b')]);return _0x44e778(_0x17eb67[_0x30c2('0x18')][_0x30c2('0x1b')]);}else{logger[_0x30c2('0x1c')](_0x30c2('0x1a'),_0x4bd5be,_0x30c2('0x16'));_0x44e778(_0x17eb67[_0x30c2('0x1d')]['message']);}})[_0x30c2('0x1e')](function(_0x48697c){logger['error'](_0x30c2('0x1a'),_0x4bd5be,_0x48697c);_0x40f639(_0x48697c);});});}exports[_0x30c2('0x1f')]=function(_0x8f7223){var _0x5ac53a=this;return new Promise(function(_0x2875dd,_0x1d0b52){return db[_0x30c2('0x20')][_0x30c2('0x21')](_0x8f7223[_0x30c2('0x22')],{'raw':_0x8f7223[_0x30c2('0x23')]?_0x8f7223[_0x30c2('0x23')][_0x30c2('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x57b861){logger[_0x30c2('0x1c')](_0x30c2('0x1f'),_0x8f7223);logger[_0x30c2('0x14')](_0x30c2('0x1f'),_0x8f7223,JSON[_0x30c2('0x17')](_0x57b861));_0x2875dd(_0x57b861);})['catch'](function(_0x1c9cbd){logger[_0x30c2('0x18')](_0x30c2('0x1f'),_0x1c9cbd['message'],_0x8f7223);_0x1d0b52(_0x5ac53a[_0x30c2('0x18')](0x1f4,_0x1c9cbd[_0x30c2('0x1b')]));});});};
\ No newline at end of file
index 3e0567a..5b4137a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3372=['update','length','mailMessage:','./mailMessage.events','save'];(function(_0x4c3de8,_0x32e9bf){var _0x1ada6e=function(_0xb92ee4){while(--_0xb92ee4){_0x4c3de8['push'](_0x4c3de8['shift']());}};_0x1ada6e(++_0x32e9bf);}(_0x3372,0x125));var _0x2337=function(_0x4aea5e,_0x15abab){_0x4aea5e=_0x4aea5e-0x0;var _0x2f8904=_0x3372[_0x4aea5e];return _0x2f8904;};'use strict';var MailMessageEvents=require(_0x2337('0x0'));var events=[_0x2337('0x1'),'remove',_0x2337('0x2')];function createListener(_0x1acda7,_0x4a3e52){return function(_0x11db1a){_0x4a3e52['emit'](_0x1acda7,_0x11db1a);};}function removeListener(_0x3e43ec,_0x28dc63){return function(){MailMessageEvents['removeListener'](_0x3e43ec,_0x28dc63);};}exports['register']=function(_0x30c02f){for(var _0x26729e=0x0,_0x308c6f=events[_0x2337('0x3')];_0x26729e<_0x308c6f;_0x26729e++){var _0x45f093=events[_0x26729e];var _0x535e70=createListener(_0x2337('0x4')+_0x45f093,_0x30c02f);MailMessageEvents['on'](_0x45f093,_0x535e70);}};
\ No newline at end of file
+var _0xfd65=['emit','removeListener','register','length','mailMessage:','update'];(function(_0x1935f6,_0xee595c){var _0x407257=function(_0x109e2a){while(--_0x109e2a){_0x1935f6['push'](_0x1935f6['shift']());}};_0x407257(++_0xee595c);}(_0xfd65,0x13d));var _0x5fd6=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xfd65[_0x9c2427];return _0x51984f;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0x5fd6('0x0')];function createListener(_0x1769a5,_0x47ea01){return function(_0x469835){_0x47ea01[_0x5fd6('0x1')](_0x1769a5,_0x469835);};}function removeListener(_0x11bdad,_0x3e8384){return function(){MailMessageEvents[_0x5fd6('0x2')](_0x11bdad,_0x3e8384);};}exports[_0x5fd6('0x3')]=function(_0x2daf43){for(var _0x4865ee=0x0,_0x57018f=events[_0x5fd6('0x4')];_0x4865ee<_0x57018f;_0x4865ee++){var _0x23542d=events[_0x4865ee];var _0xd8153e=createListener(_0x5fd6('0x5')+_0x23542d,_0x2daf43);MailMessageEvents['on'](_0x23542d,_0xd8153e);}};
\ No newline at end of file
index 7350489..d94207b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9034=['/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','get','/describe','describe','/:id','isAuthenticated','getMembers'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x9034,0x1cf));var _0x4903=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9034[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x4903('0x0'));var util=require(_0x4903('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4903('0x2')]();var auth=require(_0x4903('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4903('0x4'));var controller=require(_0x4903('0x5'));router[_0x4903('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4903('0x6')](_0x4903('0x7'),auth['isAuthenticated'](),controller[_0x4903('0x8')]);router[_0x4903('0x6')](_0x4903('0x9'),auth[_0x4903('0xa')](),controller['show']);router[_0x4903('0x6')]('/:id/members',auth[_0x4903('0xa')](),controller[_0x4903('0xb')]);router[_0x4903('0x6')](_0x4903('0xc'),auth[_0x4903('0xa')](),controller[_0x4903('0xd')]);router[_0x4903('0x6')](_0x4903('0xe'),auth[_0x4903('0xa')](),controller['getAgents']);router['post']('/',auth[_0x4903('0xa')](),controller[_0x4903('0xf')]);router[_0x4903('0x10')](_0x4903('0xc'),auth[_0x4903('0xa')](),controller[_0x4903('0x11')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x4903('0x12')]);router[_0x4903('0x13')]('/:id',auth[_0x4903('0xa')](),controller[_0x4903('0x14')]);router['delete'](_0x4903('0x9'),auth[_0x4903('0xa')](),controller[_0x4903('0x15')]);router[_0x4903('0x16')](_0x4903('0xc'),auth[_0x4903('0xa')](),controller['removeTeams']);router[_0x4903('0x16')](_0x4903('0xe'),auth[_0x4903('0xa')](),controller[_0x4903('0x17')]);module[_0x4903('0x18')]=router;
\ No newline at end of file
+var _0x83e0=['addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id/teams','/:id/users','getAgents','post','create','addTeams'];(function(_0xf124f0,_0x4e1e1c){var _0x291bd7=function(_0x317442){while(--_0x317442){_0xf124f0['push'](_0xf124f0['shift']());}};_0x291bd7(++_0x4e1e1c);}(_0x83e0,0x1cf));var _0x083e=function(_0x3340cf,_0x2ac2d9){_0x3340cf=_0x3340cf-0x0;var _0x14b17=_0x83e0[_0x3340cf];return _0x14b17;};'use strict';var multer=require(_0x083e('0x0'));var util=require('util');var path=require(_0x083e('0x1'));var timeout=require('connect-timeout');var express=require(_0x083e('0x2'));var router=express['Router']();var auth=require(_0x083e('0x3'));var interaction=require(_0x083e('0x4'));var config=require(_0x083e('0x5'));var controller=require(_0x083e('0x6'));router[_0x083e('0x7')]('/',auth[_0x083e('0x8')](),controller['index']);router['get'](_0x083e('0x9'),auth[_0x083e('0x8')](),controller[_0x083e('0xa')]);router[_0x083e('0x7')]('/:id',auth[_0x083e('0x8')](),controller['show']);router[_0x083e('0x7')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x083e('0x7')](_0x083e('0xb'),auth[_0x083e('0x8')](),controller['getTeams']);router['get'](_0x083e('0xc'),auth[_0x083e('0x8')](),controller[_0x083e('0xd')]);router[_0x083e('0xe')]('/',auth['isAuthenticated'](),controller[_0x083e('0xf')]);router['post'](_0x083e('0xb'),auth['isAuthenticated'](),controller[_0x083e('0x10')]);router[_0x083e('0xe')]('/:id/users',auth['isAuthenticated'](),controller[_0x083e('0x11')]);router[_0x083e('0x12')](_0x083e('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x083e('0x14')]('/:id',auth[_0x083e('0x8')](),controller[_0x083e('0x15')]);router[_0x083e('0x14')](_0x083e('0xb'),auth[_0x083e('0x8')](),controller['removeTeams']);router[_0x083e('0x14')](_0x083e('0xc'),auth[_0x083e('0x8')](),controller[_0x083e('0x16')]);module[_0x083e('0x17')]=router;
\ No newline at end of file
index 629c158..4ccdd97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6931=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1626c6,_0x9d9655){var _0x4ce49a=function(_0x5e6edb){while(--_0x5e6edb){_0x1626c6['push'](_0x1626c6['shift']());}};_0x4ce49a(++_0x9d9655);}(_0x6931,0x1a9));var _0x1693=function(_0xdb9150,_0x3aa0eb){_0xdb9150=_0xdb9150-0x0;var _0x214a80=_0x6931[_0xdb9150];return _0x214a80;};'use strict';var Sequelize=require(_0x1693('0x0'));module[_0x1693('0x1')]={'name':{'type':Sequelize[_0x1693('0x2')],'unique':_0x1693('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1693('0x2')]},'timeout':{'type':Sequelize[_0x1693('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1693('0x5')](_0x1693('0x6'),'beepall',_0x1693('0x7'))}};
\ No newline at end of file
+var _0x6f8e=['STRING','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x5b576d,_0x34cffd){var _0x12a7b5=function(_0x26ddde){while(--_0x26ddde){_0x5b576d['push'](_0x5b576d['shift']());}};_0x12a7b5(++_0x34cffd);}(_0x6f8e,0x15a));var _0xe6f8=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x6f8e[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xe6f8('0x0'));module[_0xe6f8('0x1')]={'name':{'type':Sequelize[_0xe6f8('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe6f8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe6f8('0x3'),_0xe6f8('0x4'),_0xe6f8('0x5'))}};
\ No newline at end of file
index edf22ec..1c7898c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e13=['filter','merge','VIRTUAL','options','MailQueue','includeAll','include','rows','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserMailQueue','MailQueueId','findAll','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','mailPause','getTeams','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','Team','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','clone','push','toString','QueryTypes','all','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','then','destroy','get','MailQueues','end','error','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x1e19a0,_0x5a3d51){var _0x2c9784=function(_0x39fd6d){while(--_0x39fd6d){_0x1e19a0['push'](_0x1e19a0['shift']());}};_0x2c9784(++_0x5a3d51);}(_0x9e13,0x154));var _0x39e1=function(_0x19148a,_0x3ed1ff){_0x19148a=_0x19148a-0x0;var _0x1cd8f6=_0x9e13[_0x19148a];return _0x1cd8f6;};'use strict';var pdf=require(_0x39e1('0x0'));var emlformat=require(_0x39e1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x39e1('0x2'));var rp=require(_0x39e1('0x3'));var moment=require(_0x39e1('0x4'));var BPromise=require(_0x39e1('0x5'));var Mustache=require(_0x39e1('0x6'));var util=require(_0x39e1('0x7'));var path=require('path');var sox=require(_0x39e1('0x8'));var csv=require(_0x39e1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x39e1('0xa'));var crypto=require(_0x39e1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x39e1('0xc'));var toCsv=require(_0x39e1('0x9'));var querystring=require('querystring');var Papa=require(_0x39e1('0xd'));var Redis=require(_0x39e1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x39e1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x39e1('0x10'));var config=require(_0x39e1('0x11'));var db=require(_0x39e1('0x12'))['db'];config['redis']=_['defaults'](config[_0x39e1('0x13')],{'host':_0x39e1('0x14'),'port':0x18eb});var socket=require(_0x39e1('0x15'))(new Redis(config['redis']));require(_0x39e1('0x16'))[_0x39e1('0x17')](socket);function respondWithStatusCode(_0x225a52,_0x17e9ee){_0x17e9ee=_0x17e9ee||0xcc;return function(_0x3defa0){if(_0x3defa0){return _0x225a52[_0x39e1('0x18')](_0x17e9ee);}return _0x225a52[_0x39e1('0x19')](_0x17e9ee)['end']();};}function respondWithResult(_0x23be85,_0x1f2e36){_0x1f2e36=_0x1f2e36||0xc8;return function(_0x1aa6a6){if(_0x1aa6a6){return _0x23be85[_0x39e1('0x19')](_0x1f2e36)[_0x39e1('0x1a')](_0x1aa6a6);}};}function respondWithFilteredResult(_0xb10c6f,_0x577c9){return function(_0x3a61d9){if(_0x3a61d9){var _0x22e58d=_0x3a61d9[_0x39e1('0x1b')],_0x5227be=_0x577c9[_0x39e1('0x1c')],_0xf9eeeb=_0x577c9[_0x39e1('0x1c')]+_0x577c9[_0x39e1('0x1d')],_0x39c56e;if(_0xf9eeeb>=_0x22e58d){_0xf9eeeb=_0x22e58d;_0x39c56e=0xc8;}else{_0x39c56e=0xce;}_0xb10c6f[_0x39e1('0x19')](_0x39c56e);return _0xb10c6f[_0x39e1('0x1e')](_0x39e1('0x1f'),_0x5227be+'-'+_0xf9eeeb+'/'+_0x22e58d)[_0x39e1('0x1a')](_0x3a61d9);}return null;};}function patchUpdates(_0x4bb809){return function(_0x36b23f){try{jsonpatch[_0x39e1('0x20')](_0x36b23f,_0x4bb809,!![]);}catch(_0xdd410f){return BPromise['reject'](_0xdd410f);}return _0x36b23f['save']();};}function saveUpdates(_0x3e7360,_0x56c912){return function(_0x391401){if(_0x391401){return _0x391401['update'](_0x3e7360)[_0x39e1('0x21')](function(_0x390814){return _0x390814;});}return null;};}function removeEntity(_0x2aa38e,_0x40ab21){return function(_0x5dc1d8){if(_0x5dc1d8){return _0x5dc1d8[_0x39e1('0x22')]()[_0x39e1('0x21')](function(){var _0x5d5af9=_0x5dc1d8[_0x39e1('0x23')]({'plain':!![]});var _0x19f887=_0x39e1('0x24');return db['UserProfileResource'][_0x39e1('0x22')]({'where':{'type':_0x19f887,'resourceId':_0x5d5af9['id']}})['then'](function(){return _0x5dc1d8;});})[_0x39e1('0x21')](function(){_0x2aa38e[_0x39e1('0x19')](0xcc)[_0x39e1('0x25')]();});}};}function handleEntityNotFound(_0x21828a,_0x15502f){return function(_0x3d8c34){if(!_0x3d8c34){_0x21828a[_0x39e1('0x18')](0x194);}return _0x3d8c34;};}function handleError(_0x3d055a,_0x3ace74){_0x3ace74=_0x3ace74||0x1f4;return function(_0x566b1e){logger[_0x39e1('0x26')](_0x566b1e['stack']);if(_0x566b1e[_0x39e1('0x27')]){delete _0x566b1e[_0x39e1('0x27')];}_0x3d055a['status'](_0x3ace74)[_0x39e1('0x28')](_0x566b1e);};}exports[_0x39e1('0x29')]=function(_0x286987,_0x52c741){var _0x30dda3={},_0x166ab9={},_0x474747={'count':0x0,'rows':[]};var _0x1ad554=_[_0x39e1('0x2a')](db['MailQueue'][_0x39e1('0x2b')],function(_0x12bdc9){return{'name':_0x12bdc9[_0x39e1('0x2c')],'type':_0x12bdc9[_0x39e1('0x2d')]['key']};});_0x166ab9[_0x39e1('0x2e')]=_[_0x39e1('0x2a')](_0x1ad554,_0x39e1('0x27'));_0x166ab9[_0x39e1('0x2f')]=_['keys'](_0x286987[_0x39e1('0x2f')]);_0x166ab9['filters']=_[_0x39e1('0x30')](_0x166ab9[_0x39e1('0x2e')],_0x166ab9[_0x39e1('0x2f')]);_0x30dda3[_0x39e1('0x31')]=_[_0x39e1('0x30')](_0x166ab9[_0x39e1('0x2e')],qs[_0x39e1('0x32')](_0x286987[_0x39e1('0x2f')][_0x39e1('0x32')]));_0x30dda3[_0x39e1('0x31')]=_0x30dda3[_0x39e1('0x31')][_0x39e1('0x33')]?_0x30dda3[_0x39e1('0x31')]:_0x166ab9[_0x39e1('0x2e')];if(!_0x286987[_0x39e1('0x2f')][_0x39e1('0x34')](_0x39e1('0x35'))){_0x30dda3[_0x39e1('0x1d')]=qs[_0x39e1('0x1d')](_0x286987[_0x39e1('0x2f')][_0x39e1('0x1d')]);_0x30dda3[_0x39e1('0x1c')]=qs['offset'](_0x286987[_0x39e1('0x2f')][_0x39e1('0x1c')]);}_0x30dda3[_0x39e1('0x36')]=qs[_0x39e1('0x37')](_0x286987[_0x39e1('0x2f')][_0x39e1('0x37')]);_0x30dda3[_0x39e1('0x38')]=qs[_0x39e1('0x39')](_[_0x39e1('0x3a')](_0x286987[_0x39e1('0x2f')],_0x166ab9[_0x39e1('0x39')]),_0x1ad554);if(_0x286987[_0x39e1('0x2f')][_0x39e1('0x3b')]){_0x30dda3[_0x39e1('0x38')]=_[_0x39e1('0x3c')](_0x30dda3[_0x39e1('0x38')],{'$or':_[_0x39e1('0x2a')](_0x1ad554,function(_0x1cc1a4){if(_0x1cc1a4['type']!==_0x39e1('0x3d')){var _0x3e0f88={};_0x3e0f88[_0x1cc1a4[_0x39e1('0x27')]]={'$like':'%'+_0x286987[_0x39e1('0x2f')][_0x39e1('0x3b')]+'%'};return _0x3e0f88;}})});}_0x30dda3=_[_0x39e1('0x3c')]({},_0x30dda3,_0x286987[_0x39e1('0x3e')]);var _0x588ed7={'where':_0x30dda3[_0x39e1('0x38')]};return db[_0x39e1('0x3f')][_0x39e1('0x1b')](_0x588ed7)[_0x39e1('0x21')](function(_0x44a587){_0x474747['count']=_0x44a587;if(_0x286987[_0x39e1('0x2f')][_0x39e1('0x40')]){_0x30dda3[_0x39e1('0x41')]=[{'all':!![]}];}return db[_0x39e1('0x3f')]['findAll'](_0x30dda3);})['then'](function(_0x1f2284){_0x474747[_0x39e1('0x42')]=_0x1f2284;return _0x474747;})['then'](respondWithFilteredResult(_0x52c741,_0x30dda3))['catch'](handleError(_0x52c741,null));};exports['show']=function(_0x32f075,_0x36d275){var _0x48348c={'raw':!![],'where':{'id':_0x32f075[_0x39e1('0x43')]['id']}},_0x217ab9={};_0x217ab9[_0x39e1('0x2e')]=_[_0x39e1('0x44')](db[_0x39e1('0x3f')][_0x39e1('0x2b')]);_0x217ab9[_0x39e1('0x2f')]=_[_0x39e1('0x44')](_0x32f075[_0x39e1('0x2f')]);_0x217ab9['filters']=_[_0x39e1('0x30')](_0x217ab9[_0x39e1('0x2e')],_0x217ab9[_0x39e1('0x2f')]);_0x48348c[_0x39e1('0x31')]=_['intersection'](_0x217ab9[_0x39e1('0x2e')],qs[_0x39e1('0x32')](_0x32f075[_0x39e1('0x2f')][_0x39e1('0x32')]));_0x48348c[_0x39e1('0x31')]=_0x48348c['attributes'][_0x39e1('0x33')]?_0x48348c[_0x39e1('0x31')]:_0x217ab9[_0x39e1('0x2e')];if(_0x32f075[_0x39e1('0x2f')][_0x39e1('0x40')]){_0x48348c[_0x39e1('0x41')]=[{'all':!![]}];}_0x48348c=_[_0x39e1('0x3c')]({},_0x48348c,_0x32f075[_0x39e1('0x3e')]);return db[_0x39e1('0x3f')][_0x39e1('0x45')](_0x48348c)['then'](handleEntityNotFound(_0x36d275,null))[_0x39e1('0x21')](respondWithResult(_0x36d275,null))[_0x39e1('0x46')](handleError(_0x36d275,null));};exports[_0x39e1('0x47')]=function(_0x509514,_0x23995c){return db[_0x39e1('0x3f')][_0x39e1('0x47')](_0x509514['body'],{})[_0x39e1('0x21')](function(_0xca52d0){var _0xe24ced=_0x509514[_0x39e1('0x48')][_0x39e1('0x23')]({'plain':!![]});if(!_0xe24ced)throw new Error(_0x39e1('0x49'));if(_0xe24ced[_0x39e1('0x4a')]===_0x39e1('0x48')){var _0x26b91d=_0xca52d0['get']({'plain':!![]});var _0x450f11=_0x39e1('0x24');return db[_0x39e1('0x4b')][_0x39e1('0x45')]({'where':{'name':_0x450f11,'userProfileId':_0xe24ced[_0x39e1('0x4c')]},'raw':!![]})['then'](function(_0x219c59){if(_0x219c59&&_0x219c59[_0x39e1('0x4d')]===0x0){return db[_0x39e1('0x4e')]['create']({'name':_0x26b91d[_0x39e1('0x27')],'resourceId':_0x26b91d['id'],'type':_0x219c59[_0x39e1('0x27')],'sectionId':_0x219c59['id']},{})['then'](function(){return _0xca52d0;});}else{return _0xca52d0;}})[_0x39e1('0x46')](function(_0x48da2a){logger[_0x39e1('0x26')](_0x39e1('0x4f'),_0x48da2a);throw _0x48da2a;});}return _0xca52d0;})[_0x39e1('0x21')](respondWithResult(_0x23995c,0xc9))[_0x39e1('0x46')](handleError(_0x23995c,null));};exports[_0x39e1('0x50')]=function(_0x5140f4,_0x30d5d0){if(_0x5140f4[_0x39e1('0x51')]['id']){delete _0x5140f4['body']['id'];}return db[_0x39e1('0x3f')][_0x39e1('0x45')]({'where':{'id':_0x5140f4[_0x39e1('0x43')]['id']}})[_0x39e1('0x21')](handleEntityNotFound(_0x30d5d0,null))['then'](saveUpdates(_0x5140f4[_0x39e1('0x51')],null))[_0x39e1('0x21')](respondWithResult(_0x30d5d0,null))[_0x39e1('0x46')](handleError(_0x30d5d0,null));};exports['destroy']=function(_0x2c9837,_0x58d983){return db['MailQueue']['find']({'where':{'id':_0x2c9837['params']['id']}})[_0x39e1('0x21')](handleEntityNotFound(_0x58d983,null))[_0x39e1('0x21')](removeEntity(_0x58d983,null))[_0x39e1('0x46')](handleError(_0x58d983,null));};exports[_0x39e1('0x52')]=function(_0x35b8c3,_0x42698b){return db[_0x39e1('0x3f')][_0x39e1('0x52')]()['then'](respondWithResult(_0x42698b,null))[_0x39e1('0x46')](handleError(_0x42698b,null));};exports[_0x39e1('0x53')]=function(_0x633c50,_0x34d6f5,_0x454edf){var _0x5bf8c7={'raw':!![],'where':{}},_0x483e95={},_0x5bef6a;return db[_0x39e1('0x3f')][_0x39e1('0x54')]({'where':{'id':_0x633c50[_0x39e1('0x43')]['id']}})[_0x39e1('0x21')](handleEntityNotFound(_0x34d6f5,null))[_0x39e1('0x21')](function(_0x2a56a5){if(_0x2a56a5){_0x5bef6a=_0x2a56a5['get']({'plain':!![]});_0x483e95[_0x39e1('0x2e')]=_[_0x39e1('0x44')](db[_0x39e1('0x55')]['rawAttributes']);_0x483e95[_0x39e1('0x2f')]=_[_0x39e1('0x44')](_0x633c50[_0x39e1('0x2f')]);_0x483e95['filters']=_[_0x39e1('0x30')](_0x483e95[_0x39e1('0x2e')],_0x483e95[_0x39e1('0x2f')]);_0x5bf8c7[_0x39e1('0x31')]=_[_0x39e1('0x30')](_0x483e95[_0x39e1('0x2e')],qs[_0x39e1('0x32')](_0x633c50['query'][_0x39e1('0x32')]));_0x5bf8c7[_0x39e1('0x31')]=_0x5bf8c7[_0x39e1('0x31')]['length']?_0x5bf8c7[_0x39e1('0x31')]:_0x483e95[_0x39e1('0x2e')];if(!_0x633c50[_0x39e1('0x2f')]['hasOwnProperty'](_0x39e1('0x35'))){_0x5bf8c7[_0x39e1('0x1d')]=qs[_0x39e1('0x1d')](_0x633c50['query'][_0x39e1('0x1d')]);_0x5bf8c7['offset']=qs[_0x39e1('0x1c')](_0x633c50['query'][_0x39e1('0x1c')]);}_0x5bf8c7['order']=qs[_0x39e1('0x37')](_0x633c50[_0x39e1('0x2f')][_0x39e1('0x37')]);_0x5bf8c7[_0x39e1('0x38')]=qs[_0x39e1('0x39')](_[_0x39e1('0x3a')](_0x633c50[_0x39e1('0x2f')],_0x483e95[_0x39e1('0x39')]));_0x5bf8c7[_0x39e1('0x38')][_0x39e1('0x56')]=_0x2a56a5['id'];if(_0x633c50[_0x39e1('0x2f')]['filter']){_0x5bf8c7[_0x39e1('0x38')]=_[_0x39e1('0x3c')](_0x5bf8c7['where'],{'$or':_[_0x39e1('0x2a')](_0x5bf8c7['attributes'],function(_0x87ba1){var _0xe784e9={};_0xe784e9[_0x87ba1]={'$like':'%'+_0x633c50[_0x39e1('0x2f')][_0x39e1('0x3b')]+'%'};return _0xe784e9;})});}_0x5bf8c7=_['merge']({},_0x5bf8c7,_0x633c50[_0x39e1('0x3e')]);return db[_0x39e1('0x55')][_0x39e1('0x57')](_0x5bf8c7);}})[_0x39e1('0x21')](function(_0x378076){if(_0x378076){return db['User'][_0x39e1('0x58')]({'where':{'id':_['map'](_0x378076,_0x39e1('0x59')),'role':_0x39e1('0x5a')},'attributes':['id',_0x39e1('0x27'),'mailPause',_0x39e1('0x5b'),_0x39e1('0x5c')]});}})[_0x39e1('0x21')](function(_0x1c8c8d){if(_0x1c8c8d){return{'count':_0x1c8c8d[_0x39e1('0x1b')],'rows':_[_0x39e1('0x2a')](_0x1c8c8d['rows'],function(_0x52fd9b){return{'membername':_0x52fd9b[_0x39e1('0x27')],'UserId':_0x52fd9b['id'],'queue_name':_0x5bef6a[_0x39e1('0x27')],'MailQueueId':_0x5bef6a['id'],'interface':util[_0x39e1('0x5d')]('%s/%s',_0x39e1('0x5e'),_0x52fd9b[_0x39e1('0x27')]),'penalty':0x0,'paused':_0x52fd9b[_0x39e1('0x5f')],'createdAt':_0x52fd9b[_0x39e1('0x5c')],'updatedAt':_0x52fd9b[_0x39e1('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x34d6f5,_0x5bf8c7))[_0x39e1('0x46')](handleError(_0x34d6f5,null));};exports['getTeams']=function(_0x3ea51f,_0x4d1ed1,_0x3fec70){var _0xbb34bb={};var _0x26a11c={};var _0x2b3840;var _0x510341;return db['MailQueue'][_0x39e1('0x54')]({'where':{'id':_0x3ea51f[_0x39e1('0x43')]['id']}})[_0x39e1('0x21')](handleEntityNotFound(_0x4d1ed1,null))['then'](function(_0x3c69b6){if(_0x3c69b6){_0x2b3840=_0x3c69b6;_0x26a11c['model']=_[_0x39e1('0x44')](db['Team'][_0x39e1('0x2b')]);_0x26a11c['query']=_[_0x39e1('0x44')](_0x3ea51f['query']);_0x26a11c[_0x39e1('0x39')]=_[_0x39e1('0x30')](_0x26a11c[_0x39e1('0x2e')],_0x26a11c['query']);_0xbb34bb['attributes']=_[_0x39e1('0x30')](_0x26a11c[_0x39e1('0x2e')],qs[_0x39e1('0x32')](_0x3ea51f[_0x39e1('0x2f')][_0x39e1('0x32')]));_0xbb34bb[_0x39e1('0x31')]=_0xbb34bb[_0x39e1('0x31')][_0x39e1('0x33')]?_0xbb34bb[_0x39e1('0x31')]:_0x26a11c[_0x39e1('0x2e')];_0xbb34bb[_0x39e1('0x36')]=qs[_0x39e1('0x37')](_0x3ea51f['query'][_0x39e1('0x37')]);_0xbb34bb[_0x39e1('0x38')]=qs[_0x39e1('0x39')](_['pick'](_0x3ea51f['query'],_0x26a11c[_0x39e1('0x39')]));if(_0x3ea51f[_0x39e1('0x2f')][_0x39e1('0x3b')]){_0xbb34bb[_0x39e1('0x38')]=_[_0x39e1('0x3c')](_0xbb34bb['where'],{'$or':_[_0x39e1('0x2a')](_0xbb34bb[_0x39e1('0x31')],function(_0x3cd72f){var _0x4ce8af={};_0x4ce8af[_0x3cd72f]={'$like':'%'+_0x3ea51f[_0x39e1('0x2f')][_0x39e1('0x3b')]+'%'};return _0x4ce8af;})});}_0xbb34bb=_[_0x39e1('0x3c')]({},_0xbb34bb,_0x3ea51f[_0x39e1('0x3e')]);return _0x2b3840[_0x39e1('0x60')](_0xbb34bb);}})['then'](function(_0x19080c){if(_0x19080c){_0x510341=_0x19080c['length'];if(!_0x3ea51f['query'][_0x39e1('0x34')](_0x39e1('0x35'))){_0xbb34bb[_0x39e1('0x1d')]=qs[_0x39e1('0x1d')](_0x3ea51f[_0x39e1('0x2f')]['limit']);_0xbb34bb[_0x39e1('0x1c')]=qs[_0x39e1('0x1c')](_0x3ea51f[_0x39e1('0x2f')]['offset']);}return _0x2b3840[_0x39e1('0x60')](_0xbb34bb);}})[_0x39e1('0x21')](function(_0xcbb69){if(_0xcbb69){return _0xcbb69?{'count':_0x510341,'rows':_0xcbb69}:null;}})[_0x39e1('0x21')](respondWithResult(_0x4d1ed1,null))[_0x39e1('0x46')](handleError(_0x4d1ed1,null));};exports['addTeams']=function(_0x49564c,_0x334cf5,_0x2901bb){var _0x173342=_0x49564c['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x173342},'attributes':['id'],'include':[{'model':db[_0x39e1('0x61')],'as':_0x39e1('0x62'),'attributes':['id','name',_0x39e1('0x63'),_0x39e1('0x64'),'interface'],'raw':!![]}]})[_0x39e1('0x21')](function(_0x4fd392){if(_0x4fd392){var _0x3463c4=_[_0x39e1('0x65')](_0x4fd392,function(_0xf80240){var _0x205084=_0xf80240[_0x39e1('0x23')]({'plain':!![]});return _0x205084[_0x39e1('0x62')];});return db['MailQueue'][_0x39e1('0x45')]({'where':{'id':_0x49564c[_0x39e1('0x43')]['id']}})[_0x39e1('0x21')](function(_0x1196f8){return db[_0x39e1('0x66')][_0x39e1('0x67')](function(_0x505481){return _0x1196f8['addTeams'](_0x173342,{'transaction':_0x505481})['then'](function(){return BPromise[_0x39e1('0x68')](_0x3463c4,function(_0x28426c){return db[_0x39e1('0x55')][_0x39e1('0x69')]({'where':{'UserId':_0x28426c['id'],'MailQueueId':_0x49564c[_0x39e1('0x43')]['id']},'transaction':_0x505481});});})['then'](function(){_0x3463c4[_0x39e1('0x6a')](function(_0x2c1581){socket[_0x39e1('0x6b')]('userMailQueue:save',{'UserId':_0x2c1581['id'],'MailQueueId':_0x1196f8['id']});});});});});}})[_0x39e1('0x21')](respondWithStatusCode(_0x334cf5,null))['catch'](handleError(_0x334cf5,null));};exports[_0x39e1('0x6c')]=function(_0x15079f,_0x139511,_0x1189e2){return db[_0x39e1('0x6d')][_0x39e1('0x57')]({'where':{'id':_0x15079f[_0x39e1('0x2f')][_0x39e1('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x39e1('0x61')],'as':_0x39e1('0x62'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x139511,null))['then'](function(_0x3ef063){var _0x2b8ec8=_[_0x39e1('0x2a')](_0x3ef063,'id');var _0xd1b0df=[];var _0x3b7ddf=[];var _0x1c3809=squel[_0x39e1('0x6f')]();_0x1c3809[_0x39e1('0x70')](_0x39e1('0x71'))[_0x39e1('0x72')](_0x39e1('0x73'),'tq')[_0x39e1('0x74')](_0x39e1('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('MailQueueId\x20=\x20?',_0x15079f['params']['id']);for(var _0xa3403e=0x0;_0xa3403e<_0x3ef063[_0x39e1('0x33')];_0xa3403e+=0x1){let _0x3dda89=_0x3ef063[_0xa3403e];for(var _0x404579=0x0;_0x404579<_0x3dda89['Agents'][_0x39e1('0x33')];_0x404579+=0x1){let _0x507862=_0x3dda89[_0x39e1('0x62')][_0x404579];var _0x2c7fd3=_0x1c3809[_0x39e1('0x76')]();_0x2c7fd3['where']('ut.UserId\x20=\x20?',_0x507862['id']);_0x3b7ddf[_0x39e1('0x77')](db[_0x39e1('0x66')][_0x39e1('0x2f')](_0x2c7fd3[_0x39e1('0x78')](),{'type':db[_0x39e1('0x66')][_0x39e1('0x79')]['SELECT']})['then'](function(_0x7ab960){if(_0x7ab960[_0x39e1('0x33')]===0x1){return _0x507862['id'];}else{var _0x23121b=_['every'](_['map'](_0x7ab960,'TeamId'),function(_0x32006a){return _['includes'](_0x2b8ec8,_0x32006a);});if(_0x23121b){return _0x507862['id'];}}}));}}return BPromise[_0x39e1('0x7a')](_0x3b7ddf)[_0x39e1('0x21')](function(_0x1bb091){_0xd1b0df=_(_0xd1b0df)['union'](_0x1bb091)[_0x39e1('0x7b')]()[_0x39e1('0x7c')]();return db[_0x39e1('0x3f')]['find']({'where':{'id':_0x15079f[_0x39e1('0x43')]['id']}})['then'](function(_0x496617){return db[_0x39e1('0x66')][_0x39e1('0x67')](function(_0x243e4b){return _0x496617[_0x39e1('0x6c')](_0x15079f[_0x39e1('0x2f')][_0x39e1('0x6e')],{'transaction':_0x243e4b})[_0x39e1('0x21')](function(){if(!_[_0x39e1('0x7d')](_0xd1b0df)){return _0x496617[_0x39e1('0x7e')](_0xd1b0df,{'transaction':_0x243e4b});}})[_0x39e1('0x21')](function(){_0xd1b0df[_0x39e1('0x6a')](function(_0x5d5da0){socket[_0x39e1('0x6b')]('userMailQueue:remove',{'UserId':_0x5d5da0,'MailQueueId':_0x496617['id']});});});});});});})[_0x39e1('0x21')](respondWithStatusCode(_0x139511,null))[_0x39e1('0x46')](handleError(_0x139511,null));};exports[_0x39e1('0x7f')]=function(_0x540398,_0x13b58b,_0x39415a){return db[_0x39e1('0x3f')]['find']({'where':{'id':_0x540398[_0x39e1('0x43')]['id']}})[_0x39e1('0x21')](handleEntityNotFound(_0x13b58b,null))[_0x39e1('0x21')](function(_0x208952){if(_0x208952){return _0x208952[_0x39e1('0x7f')](_0x540398['body']['ids'],_[_0x39e1('0x80')](_0x540398['body'],[_0x39e1('0x6e'),'id'])||{})[_0x39e1('0x81')](function(_0xd08e18){for(var _0xf4d056=0x0;_0xf4d056<_0x540398[_0x39e1('0x51')][_0x39e1('0x6e')][_0x39e1('0x33')];_0xf4d056+=0x1){socket[_0x39e1('0x6b')]('userMailQueue:save',{'UserId':_0x540398['body']['ids'][_0xf4d056],'MailQueueId':_0x540398[_0x39e1('0x43')]['id']});}return _0xd08e18;});}})['then'](respondWithResult(_0x13b58b,null))[_0x39e1('0x46')](handleError(_0x13b58b,null));};exports[_0x39e1('0x7e')]=function(_0x23768b,_0x53bb5d,_0x195bb1){return db[_0x39e1('0x3f')][_0x39e1('0x45')]({'where':{'id':_0x23768b[_0x39e1('0x43')]['id']}})['then'](handleEntityNotFound(_0x53bb5d,null))[_0x39e1('0x21')](function(_0x1128d7){if(_0x1128d7){return _0x1128d7[_0x39e1('0x7e')](_0x23768b['query']['ids'])[_0x39e1('0x21')](function(){if(_[_0x39e1('0x82')](_0x23768b[_0x39e1('0x2f')][_0x39e1('0x6e')])){for(var _0x1f8608=0x0;_0x1f8608<_0x23768b[_0x39e1('0x2f')][_0x39e1('0x6e')][_0x39e1('0x33')];_0x1f8608+=0x1){socket['emit'](_0x39e1('0x83'),{'UserId':Number(_0x23768b['query'][_0x39e1('0x6e')][_0x1f8608]),'MailQueueId':Number(_0x23768b[_0x39e1('0x43')]['id'])});}}else{socket['emit'](_0x39e1('0x83'),{'UserId':Number(_0x23768b[_0x39e1('0x2f')][_0x39e1('0x6e')]),'MailQueueId':Number(_0x23768b[_0x39e1('0x43')]['id'])});}});}})[_0x39e1('0x21')](respondWithStatusCode(_0x53bb5d,null))[_0x39e1('0x46')](handleError(_0x53bb5d,null));};exports[_0x39e1('0x84')]=function(_0x443ed8,_0x262670,_0x47cd41){var _0x20d7d4={};var _0x22998f={};var _0x4d4b49;var _0x5d0aa6;return db[_0x39e1('0x3f')][_0x39e1('0x54')]({'where':{'id':_0x443ed8[_0x39e1('0x43')]['id']}})[_0x39e1('0x21')](handleEntityNotFound(_0x262670,null))['then'](function(_0x18bf58){if(_0x18bf58){_0x4d4b49=_0x18bf58;_0x22998f[_0x39e1('0x2e')]=_['keys'](db[_0x39e1('0x61')][_0x39e1('0x2b')]);_0x22998f['query']=_['keys'](_0x443ed8[_0x39e1('0x2f')]);_0x22998f[_0x39e1('0x39')]=_['intersection'](_0x22998f[_0x39e1('0x2e')],_0x22998f[_0x39e1('0x2f')]);_0x20d7d4['attributes']=_[_0x39e1('0x30')](_0x22998f[_0x39e1('0x2e')],qs[_0x39e1('0x32')](_0x443ed8[_0x39e1('0x2f')][_0x39e1('0x32')]));_0x20d7d4['attributes']=_0x20d7d4['attributes'][_0x39e1('0x33')]?_0x20d7d4[_0x39e1('0x31')]:_0x22998f[_0x39e1('0x2e')];_0x20d7d4[_0x39e1('0x36')]=qs[_0x39e1('0x37')](_0x443ed8[_0x39e1('0x2f')][_0x39e1('0x37')]);_0x20d7d4[_0x39e1('0x38')]=qs[_0x39e1('0x39')](_[_0x39e1('0x3a')](_0x443ed8[_0x39e1('0x2f')],_0x22998f[_0x39e1('0x39')]));if(_0x443ed8[_0x39e1('0x2f')]['filter']){_0x20d7d4[_0x39e1('0x38')]=_['merge'](_0x20d7d4[_0x39e1('0x38')],{'$or':_[_0x39e1('0x2a')](_0x20d7d4[_0x39e1('0x31')],function(_0x2bf1bc){var _0x4aaeed={};_0x4aaeed[_0x2bf1bc]={'$like':'%'+_0x443ed8[_0x39e1('0x2f')][_0x39e1('0x3b')]+'%'};return _0x4aaeed;})});}_0x20d7d4=_['merge']({},_0x20d7d4,_0x443ed8[_0x39e1('0x3e')]);return _0x4d4b49[_0x39e1('0x84')](_0x20d7d4);}})[_0x39e1('0x21')](function(_0x8ff769){if(_0x8ff769){_0x5d0aa6=_0x8ff769['length'];if(!_0x443ed8[_0x39e1('0x2f')][_0x39e1('0x34')](_0x39e1('0x35'))){_0x20d7d4['limit']=qs[_0x39e1('0x1d')](_0x443ed8[_0x39e1('0x2f')][_0x39e1('0x1d')]);_0x20d7d4[_0x39e1('0x1c')]=qs[_0x39e1('0x1c')](_0x443ed8[_0x39e1('0x2f')][_0x39e1('0x1c')]);}return _0x4d4b49[_0x39e1('0x84')](_0x20d7d4);}})['then'](function(_0x285b7c){if(_0x285b7c){return _0x285b7c?{'count':_0x5d0aa6,'rows':_0x285b7c}:null;}})['then'](respondWithResult(_0x262670,null))['catch'](handleError(_0x262670,null));};
\ No newline at end of file
+var _0x7e80=['getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','register','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','MailQueues','UserProfileResource','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','nolimit','sort','pick','where','filter','merge','options','MailQueue','count','includeAll','include','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','length','hasOwnProperty','findAll','findAndCountAll','agent','updatedAt','%s/%s','SIP','mailPause','createdAt','getTeams','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','Team','User','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','removeTeams','removeAgents','forEach','addAgents','omit','spread','isArray','userMailQueue:remove','findOne'];(function(_0x17265e,_0x5ee18f){var _0x29ab1e=function(_0x4bce9f){while(--_0x4bce9f){_0x17265e['push'](_0x17265e['shift']());}};_0x29ab1e(++_0x5ee18f);}(_0x7e80,0x125));var _0x07e8=function(_0x24e73b,_0x3cd8aa){_0x24e73b=_0x24e73b-0x0;var _0x4044b4=_0x7e80[_0x24e73b];return _0x4044b4;};'use strict';var pdf=require(_0x07e8('0x0'));var emlformat=require(_0x07e8('0x1'));var rimraf=require(_0x07e8('0x2'));var zipdir=require(_0x07e8('0x3'));var jsonpatch=require(_0x07e8('0x4'));var rp=require('request-promise');var moment=require(_0x07e8('0x5'));var BPromise=require(_0x07e8('0x6'));var Mustache=require('mustache');var util=require(_0x07e8('0x7'));var path=require(_0x07e8('0x8'));var sox=require(_0x07e8('0x9'));var csv=require(_0x07e8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x07e8('0xb'));var crypto=require(_0x07e8('0xc'));var jsforce=require(_0x07e8('0xd'));var deskjs=require(_0x07e8('0xe'));var toCsv=require(_0x07e8('0xa'));var querystring=require(_0x07e8('0xf'));var Papa=require(_0x07e8('0x10'));var Redis=require(_0x07e8('0x11'));var authService=require(_0x07e8('0x12'));var qs=require(_0x07e8('0x13'));var as=require(_0x07e8('0x14'));var hardwareService=require(_0x07e8('0x15'));var logger=require(_0x07e8('0x16'))(_0x07e8('0x17'));var utils=require(_0x07e8('0x18'));var config=require(_0x07e8('0x19'));var db=require(_0x07e8('0x1a'))['db'];config['redis']=_[_0x07e8('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x07e8('0x1c'))(new Redis(config[_0x07e8('0x1d')]));require('./mailQueue.socket')[_0x07e8('0x1e')](socket);function respondWithStatusCode(_0x411166,_0x15ad02){_0x15ad02=_0x15ad02||0xcc;return function(_0x2a7837){if(_0x2a7837){return _0x411166['sendStatus'](_0x15ad02);}return _0x411166[_0x07e8('0x1f')](_0x15ad02)[_0x07e8('0x20')]();};}function respondWithResult(_0x15bc40,_0x5521e4){_0x5521e4=_0x5521e4||0xc8;return function(_0x3af52c){if(_0x3af52c){return _0x15bc40[_0x07e8('0x1f')](_0x5521e4)[_0x07e8('0x21')](_0x3af52c);}};}function respondWithFilteredResult(_0x5b9c4c,_0x2f245a){return function(_0x27ff4f){if(_0x27ff4f){var _0x3067a4=_0x27ff4f['count'],_0x333402=_0x2f245a['offset'],_0x30ab8e=_0x2f245a[_0x07e8('0x22')]+_0x2f245a[_0x07e8('0x23')],_0x567228;if(_0x30ab8e>=_0x3067a4){_0x30ab8e=_0x3067a4;_0x567228=0xc8;}else{_0x567228=0xce;}_0x5b9c4c[_0x07e8('0x1f')](_0x567228);return _0x5b9c4c[_0x07e8('0x24')](_0x07e8('0x25'),_0x333402+'-'+_0x30ab8e+'/'+_0x3067a4)['json'](_0x27ff4f);}return null;};}function patchUpdates(_0x5321e4){return function(_0x198352){try{jsonpatch['apply'](_0x198352,_0x5321e4,!![]);}catch(_0x1e0ea8){return BPromise[_0x07e8('0x26')](_0x1e0ea8);}return _0x198352[_0x07e8('0x27')]();};}function saveUpdates(_0x250c31,_0x232af6){return function(_0x52d41f){if(_0x52d41f){return _0x52d41f[_0x07e8('0x28')](_0x250c31)[_0x07e8('0x29')](function(_0x136d95){return _0x136d95;});}return null;};}function removeEntity(_0x2cd993,_0x38d12d){return function(_0x1fc879){if(_0x1fc879){return _0x1fc879[_0x07e8('0x2a')]()['then'](function(){var _0x5e8829=_0x1fc879['get']({'plain':!![]});var _0x380e2f=_0x07e8('0x2b');return db[_0x07e8('0x2c')][_0x07e8('0x2a')]({'where':{'type':_0x380e2f,'resourceId':_0x5e8829['id']}})[_0x07e8('0x29')](function(){return _0x1fc879;});})[_0x07e8('0x29')](function(){_0x2cd993[_0x07e8('0x1f')](0xcc)[_0x07e8('0x20')]();});}};}function handleEntityNotFound(_0x5ce481,_0x39b931){return function(_0x328fdb){if(!_0x328fdb){_0x5ce481[_0x07e8('0x2d')](0x194);}return _0x328fdb;};}function handleError(_0x378038,_0x2749a2){_0x2749a2=_0x2749a2||0x1f4;return function(_0x5326c8){logger['error'](_0x5326c8[_0x07e8('0x2e')]);if(_0x5326c8['name']){delete _0x5326c8[_0x07e8('0x2f')];}_0x378038['status'](_0x2749a2)[_0x07e8('0x30')](_0x5326c8);};}exports[_0x07e8('0x31')]=function(_0x4728fe,_0x25cae3){var _0x5cd330={},_0x27fc9e={},_0x141b84={'count':0x0,'rows':[]};var _0x3488b8=_['map'](db['MailQueue'][_0x07e8('0x32')],function(_0x4116b8){return{'name':_0x4116b8[_0x07e8('0x33')],'type':_0x4116b8[_0x07e8('0x34')][_0x07e8('0x35')]};});_0x27fc9e[_0x07e8('0x36')]=_[_0x07e8('0x37')](_0x3488b8,_0x07e8('0x2f'));_0x27fc9e[_0x07e8('0x38')]=_[_0x07e8('0x39')](_0x4728fe[_0x07e8('0x38')]);_0x27fc9e[_0x07e8('0x3a')]=_['intersection'](_0x27fc9e[_0x07e8('0x36')],_0x27fc9e[_0x07e8('0x38')]);_0x5cd330[_0x07e8('0x3b')]=_[_0x07e8('0x3c')](_0x27fc9e[_0x07e8('0x36')],qs[_0x07e8('0x3d')](_0x4728fe[_0x07e8('0x38')]['fields']));_0x5cd330[_0x07e8('0x3b')]=_0x5cd330[_0x07e8('0x3b')]['length']?_0x5cd330[_0x07e8('0x3b')]:_0x27fc9e[_0x07e8('0x36')];if(!_0x4728fe[_0x07e8('0x38')]['hasOwnProperty'](_0x07e8('0x3e'))){_0x5cd330['limit']=qs['limit'](_0x4728fe[_0x07e8('0x38')][_0x07e8('0x23')]);_0x5cd330['offset']=qs[_0x07e8('0x22')](_0x4728fe[_0x07e8('0x38')]['offset']);}_0x5cd330['order']=qs[_0x07e8('0x3f')](_0x4728fe['query']['sort']);_0x5cd330['where']=qs[_0x07e8('0x3a')](_[_0x07e8('0x40')](_0x4728fe[_0x07e8('0x38')],_0x27fc9e[_0x07e8('0x3a')]),_0x3488b8);if(_0x4728fe[_0x07e8('0x38')]['filter']){_0x5cd330[_0x07e8('0x41')]=_['merge'](_0x5cd330[_0x07e8('0x41')],{'$or':_[_0x07e8('0x37')](_0x3488b8,function(_0x9e1296){if(_0x9e1296['type']!=='VIRTUAL'){var _0x10dcec={};_0x10dcec[_0x9e1296[_0x07e8('0x2f')]]={'$like':'%'+_0x4728fe['query'][_0x07e8('0x42')]+'%'};return _0x10dcec;}})});}_0x5cd330=_[_0x07e8('0x43')]({},_0x5cd330,_0x4728fe[_0x07e8('0x44')]);var _0x10ed01={'where':_0x5cd330[_0x07e8('0x41')]};return db[_0x07e8('0x45')]['count'](_0x10ed01)[_0x07e8('0x29')](function(_0x263f8e){_0x141b84[_0x07e8('0x46')]=_0x263f8e;if(_0x4728fe['query'][_0x07e8('0x47')]){_0x5cd330[_0x07e8('0x48')]=[{'all':!![]}];}return db[_0x07e8('0x45')]['findAll'](_0x5cd330);})[_0x07e8('0x29')](function(_0x2b461b){_0x141b84[_0x07e8('0x49')]=_0x2b461b;return _0x141b84;})['then'](respondWithFilteredResult(_0x25cae3,_0x5cd330))[_0x07e8('0x4a')](handleError(_0x25cae3,null));};exports['show']=function(_0x481c26,_0x275218){var _0xc2637a={'raw':!![],'where':{'id':_0x481c26[_0x07e8('0x4b')]['id']}},_0x152fa2={};_0x152fa2[_0x07e8('0x36')]=_['keys'](db[_0x07e8('0x45')][_0x07e8('0x32')]);_0x152fa2['query']=_['keys'](_0x481c26[_0x07e8('0x38')]);_0x152fa2[_0x07e8('0x3a')]=_[_0x07e8('0x3c')](_0x152fa2[_0x07e8('0x36')],_0x152fa2[_0x07e8('0x38')]);_0xc2637a[_0x07e8('0x3b')]=_[_0x07e8('0x3c')](_0x152fa2[_0x07e8('0x36')],qs[_0x07e8('0x3d')](_0x481c26[_0x07e8('0x38')]['fields']));_0xc2637a['attributes']=_0xc2637a[_0x07e8('0x3b')]['length']?_0xc2637a[_0x07e8('0x3b')]:_0x152fa2[_0x07e8('0x36')];if(_0x481c26[_0x07e8('0x38')]['includeAll']){_0xc2637a[_0x07e8('0x48')]=[{'all':!![]}];}_0xc2637a=_[_0x07e8('0x43')]({},_0xc2637a,_0x481c26[_0x07e8('0x44')]);return db[_0x07e8('0x45')][_0x07e8('0x4c')](_0xc2637a)[_0x07e8('0x29')](handleEntityNotFound(_0x275218,null))[_0x07e8('0x29')](respondWithResult(_0x275218,null))['catch'](handleError(_0x275218,null));};exports[_0x07e8('0x4d')]=function(_0x4dfc71,_0x2b3710){return db['MailQueue']['create'](_0x4dfc71[_0x07e8('0x4e')],{})[_0x07e8('0x29')](function(_0x5507ea){var _0x59abbe=_0x4dfc71[_0x07e8('0x4f')][_0x07e8('0x50')]({'plain':!![]});if(!_0x59abbe)throw new Error(_0x07e8('0x51'));if(_0x59abbe['role']===_0x07e8('0x4f')){var _0x317fbb=_0x5507ea[_0x07e8('0x50')]({'plain':!![]});var _0x317fd2=_0x07e8('0x2b');return db['UserProfileSection'][_0x07e8('0x4c')]({'where':{'name':_0x317fd2,'userProfileId':_0x59abbe[_0x07e8('0x52')]},'raw':!![]})[_0x07e8('0x29')](function(_0x19dd7f){if(_0x19dd7f&&_0x19dd7f[_0x07e8('0x53')]===0x0){return db['UserProfileResource'][_0x07e8('0x4d')]({'name':_0x317fbb['name'],'resourceId':_0x317fbb['id'],'type':_0x19dd7f[_0x07e8('0x2f')],'sectionId':_0x19dd7f['id']},{})['then'](function(){return _0x5507ea;});}else{return _0x5507ea;}})[_0x07e8('0x4a')](function(_0x5bd163){logger[_0x07e8('0x54')](_0x07e8('0x55'),_0x5bd163);throw _0x5bd163;});}return _0x5507ea;})[_0x07e8('0x29')](respondWithResult(_0x2b3710,0xc9))[_0x07e8('0x4a')](handleError(_0x2b3710,null));};exports[_0x07e8('0x28')]=function(_0xb5b41a,_0x585ab2){if(_0xb5b41a[_0x07e8('0x4e')]['id']){delete _0xb5b41a[_0x07e8('0x4e')]['id'];}return db[_0x07e8('0x45')]['find']({'where':{'id':_0xb5b41a[_0x07e8('0x4b')]['id']}})[_0x07e8('0x29')](handleEntityNotFound(_0x585ab2,null))[_0x07e8('0x29')](saveUpdates(_0xb5b41a['body'],null))['then'](respondWithResult(_0x585ab2,null))[_0x07e8('0x4a')](handleError(_0x585ab2,null));};exports[_0x07e8('0x2a')]=function(_0x47c92c,_0x4e2e2a){return db[_0x07e8('0x45')][_0x07e8('0x4c')]({'where':{'id':_0x47c92c[_0x07e8('0x4b')]['id']}})[_0x07e8('0x29')](handleEntityNotFound(_0x4e2e2a,null))[_0x07e8('0x29')](removeEntity(_0x4e2e2a,null))[_0x07e8('0x4a')](handleError(_0x4e2e2a,null));};exports['describe']=function(_0x334ea1,_0x456d17){return db[_0x07e8('0x45')][_0x07e8('0x56')]()['then'](respondWithResult(_0x456d17,null))['catch'](handleError(_0x456d17,null));};exports[_0x07e8('0x57')]=function(_0x254d9b,_0x40842c,_0x42e97b){var _0x583455={'raw':!![],'where':{}},_0x478238={},_0x2d455e;return db[_0x07e8('0x45')]['findOne']({'where':{'id':_0x254d9b[_0x07e8('0x4b')]['id']}})[_0x07e8('0x29')](handleEntityNotFound(_0x40842c,null))['then'](function(_0x4e1ae5){if(_0x4e1ae5){_0x2d455e=_0x4e1ae5[_0x07e8('0x50')]({'plain':!![]});_0x478238[_0x07e8('0x36')]=_[_0x07e8('0x39')](db[_0x07e8('0x58')]['rawAttributes']);_0x478238[_0x07e8('0x38')]=_[_0x07e8('0x39')](_0x254d9b['query']);_0x478238[_0x07e8('0x3a')]=_['intersection'](_0x478238[_0x07e8('0x36')],_0x478238['query']);_0x583455['attributes']=_[_0x07e8('0x3c')](_0x478238[_0x07e8('0x36')],qs[_0x07e8('0x3d')](_0x254d9b[_0x07e8('0x38')]['fields']));_0x583455['attributes']=_0x583455[_0x07e8('0x3b')][_0x07e8('0x59')]?_0x583455[_0x07e8('0x3b')]:_0x478238[_0x07e8('0x36')];if(!_0x254d9b[_0x07e8('0x38')][_0x07e8('0x5a')](_0x07e8('0x3e'))){_0x583455['limit']=qs[_0x07e8('0x23')](_0x254d9b[_0x07e8('0x38')][_0x07e8('0x23')]);_0x583455[_0x07e8('0x22')]=qs[_0x07e8('0x22')](_0x254d9b['query'][_0x07e8('0x22')]);}_0x583455['order']=qs['sort'](_0x254d9b['query'][_0x07e8('0x3f')]);_0x583455['where']=qs[_0x07e8('0x3a')](_[_0x07e8('0x40')](_0x254d9b['query'],_0x478238[_0x07e8('0x3a')]));_0x583455['where']['MailQueueId']=_0x4e1ae5['id'];if(_0x254d9b['query'][_0x07e8('0x42')]){_0x583455[_0x07e8('0x41')]=_[_0x07e8('0x43')](_0x583455[_0x07e8('0x41')],{'$or':_['map'](_0x583455[_0x07e8('0x3b')],function(_0x1810ba){var _0x527e4d={};_0x527e4d[_0x1810ba]={'$like':'%'+_0x254d9b[_0x07e8('0x38')][_0x07e8('0x42')]+'%'};return _0x527e4d;})});}_0x583455=_[_0x07e8('0x43')]({},_0x583455,_0x254d9b[_0x07e8('0x44')]);return db[_0x07e8('0x58')][_0x07e8('0x5b')](_0x583455);}})['then'](function(_0x14fb62){if(_0x14fb62){return db['User'][_0x07e8('0x5c')]({'where':{'id':_[_0x07e8('0x37')](_0x14fb62,'UserId'),'role':_0x07e8('0x5d')},'attributes':['id',_0x07e8('0x2f'),'mailPause',_0x07e8('0x5e'),'createdAt']});}})['then'](function(_0x4aeea1){if(_0x4aeea1){return{'count':_0x4aeea1[_0x07e8('0x46')],'rows':_[_0x07e8('0x37')](_0x4aeea1[_0x07e8('0x49')],function(_0x533269){return{'membername':_0x533269[_0x07e8('0x2f')],'UserId':_0x533269['id'],'queue_name':_0x2d455e['name'],'MailQueueId':_0x2d455e['id'],'interface':util['format'](_0x07e8('0x5f'),_0x07e8('0x60'),_0x533269['name']),'penalty':0x0,'paused':_0x533269[_0x07e8('0x61')],'createdAt':_0x533269[_0x07e8('0x62')],'updatedAt':_0x533269[_0x07e8('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x07e8('0x29')](respondWithFilteredResult(_0x40842c,_0x583455))[_0x07e8('0x4a')](handleError(_0x40842c,null));};exports[_0x07e8('0x63')]=function(_0x2d90f2,_0x437f6a,_0x4e3ee5){var _0x1153ac={};var _0x53da1b={};var _0x387e30;var _0x33d30e;return db['MailQueue']['findOne']({'where':{'id':_0x2d90f2['params']['id']}})[_0x07e8('0x29')](handleEntityNotFound(_0x437f6a,null))[_0x07e8('0x29')](function(_0x502c0c){if(_0x502c0c){_0x387e30=_0x502c0c;_0x53da1b[_0x07e8('0x36')]=_[_0x07e8('0x39')](db['Team'][_0x07e8('0x32')]);_0x53da1b[_0x07e8('0x38')]=_['keys'](_0x2d90f2[_0x07e8('0x38')]);_0x53da1b['filters']=_[_0x07e8('0x3c')](_0x53da1b[_0x07e8('0x36')],_0x53da1b[_0x07e8('0x38')]);_0x1153ac[_0x07e8('0x3b')]=_[_0x07e8('0x3c')](_0x53da1b['model'],qs[_0x07e8('0x3d')](_0x2d90f2['query']['fields']));_0x1153ac[_0x07e8('0x3b')]=_0x1153ac[_0x07e8('0x3b')]['length']?_0x1153ac[_0x07e8('0x3b')]:_0x53da1b[_0x07e8('0x36')];_0x1153ac[_0x07e8('0x64')]=qs[_0x07e8('0x3f')](_0x2d90f2['query'][_0x07e8('0x3f')]);_0x1153ac[_0x07e8('0x41')]=qs[_0x07e8('0x3a')](_[_0x07e8('0x40')](_0x2d90f2[_0x07e8('0x38')],_0x53da1b['filters']));if(_0x2d90f2[_0x07e8('0x38')]['filter']){_0x1153ac[_0x07e8('0x41')]=_['merge'](_0x1153ac[_0x07e8('0x41')],{'$or':_[_0x07e8('0x37')](_0x1153ac[_0x07e8('0x3b')],function(_0x9ea177){var _0x1b8014={};_0x1b8014[_0x9ea177]={'$like':'%'+_0x2d90f2[_0x07e8('0x38')]['filter']+'%'};return _0x1b8014;})});}_0x1153ac=_[_0x07e8('0x43')]({},_0x1153ac,_0x2d90f2[_0x07e8('0x44')]);return _0x387e30[_0x07e8('0x63')](_0x1153ac);}})[_0x07e8('0x29')](function(_0x459bca){if(_0x459bca){_0x33d30e=_0x459bca[_0x07e8('0x59')];if(!_0x2d90f2[_0x07e8('0x38')][_0x07e8('0x5a')](_0x07e8('0x3e'))){_0x1153ac[_0x07e8('0x23')]=qs['limit'](_0x2d90f2[_0x07e8('0x38')][_0x07e8('0x23')]);_0x1153ac[_0x07e8('0x22')]=qs[_0x07e8('0x22')](_0x2d90f2[_0x07e8('0x38')][_0x07e8('0x22')]);}return _0x387e30[_0x07e8('0x63')](_0x1153ac);}})[_0x07e8('0x29')](function(_0x537070){if(_0x537070){return _0x537070?{'count':_0x33d30e,'rows':_0x537070}:null;}})['then'](respondWithResult(_0x437f6a,null))[_0x07e8('0x4a')](handleError(_0x437f6a,null));};exports[_0x07e8('0x65')]=function(_0x11dd8e,_0x503b90,_0x2b71b5){var _0x133373=_0x11dd8e[_0x07e8('0x4e')][_0x07e8('0x66')];return db['Team']['findAll']({'where':{'id':_0x133373},'attributes':['id'],'include':[{'model':db['User'],'as':_0x07e8('0x67'),'attributes':['id','name',_0x07e8('0x68'),_0x07e8('0x69'),_0x07e8('0x6a')],'raw':!![]}]})[_0x07e8('0x29')](function(_0x21aee1){if(_0x21aee1){var _0x9da8dd=_[_0x07e8('0x6b')](_0x21aee1,function(_0x30dcd4){var _0x70caef=_0x30dcd4[_0x07e8('0x50')]({'plain':!![]});return _0x70caef[_0x07e8('0x67')];});return db[_0x07e8('0x45')][_0x07e8('0x4c')]({'where':{'id':_0x11dd8e[_0x07e8('0x4b')]['id']}})['then'](function(_0x39119a){return db[_0x07e8('0x6c')][_0x07e8('0x6d')](function(_0x3f8f05){return _0x39119a['addTeams'](_0x133373,{'transaction':_0x3f8f05})[_0x07e8('0x29')](function(){return BPromise[_0x07e8('0x6e')](_0x9da8dd,function(_0x2ad155){return db[_0x07e8('0x58')][_0x07e8('0x6f')]({'where':{'UserId':_0x2ad155['id'],'MailQueueId':_0x11dd8e[_0x07e8('0x4b')]['id']},'transaction':_0x3f8f05});});})['then'](function(){_0x9da8dd['forEach'](function(_0xf908b5){socket[_0x07e8('0x70')](_0x07e8('0x71'),{'UserId':_0xf908b5['id'],'MailQueueId':_0x39119a['id']});});});});});}})[_0x07e8('0x29')](respondWithStatusCode(_0x503b90,null))[_0x07e8('0x4a')](handleError(_0x503b90,null));};exports['removeTeams']=function(_0x2e7fd3,_0x3c8c37,_0x230600){return db[_0x07e8('0x72')][_0x07e8('0x5b')]({'where':{'id':_0x2e7fd3[_0x07e8('0x38')][_0x07e8('0x66')]},'attributes':['id'],'include':[{'model':db[_0x07e8('0x73')],'as':_0x07e8('0x67'),'attributes':['id'],'raw':!![]}]})[_0x07e8('0x29')](handleEntityNotFound(_0x3c8c37,null))[_0x07e8('0x29')](function(_0x56417a){var _0x4100ab=_[_0x07e8('0x37')](_0x56417a,'id');var _0x562f54=[];var _0x58cede=[];var _0x855826=squel[_0x07e8('0x74')]();_0x855826[_0x07e8('0x75')](_0x07e8('0x76'))[_0x07e8('0x77')](_0x07e8('0x78'),'tq')[_0x07e8('0x79')](_0x07e8('0x7a'),'ut',_0x07e8('0x7b'))[_0x07e8('0x41')](_0x07e8('0x7c'),_0x2e7fd3[_0x07e8('0x4b')]['id']);for(var _0x5cf8b4=0x0;_0x5cf8b4<_0x56417a['length'];_0x5cf8b4+=0x1){let _0x293c58=_0x56417a[_0x5cf8b4];for(var _0x30cdb9=0x0;_0x30cdb9<_0x293c58['Agents'][_0x07e8('0x59')];_0x30cdb9+=0x1){let _0x4b658f=_0x293c58[_0x07e8('0x67')][_0x30cdb9];var _0x215d4d=_0x855826[_0x07e8('0x7d')]();_0x215d4d[_0x07e8('0x41')](_0x07e8('0x7e'),_0x4b658f['id']);_0x58cede[_0x07e8('0x7f')](db[_0x07e8('0x6c')]['query'](_0x215d4d[_0x07e8('0x80')](),{'type':db[_0x07e8('0x6c')][_0x07e8('0x81')][_0x07e8('0x82')]})[_0x07e8('0x29')](function(_0x5c45eb){if(_0x5c45eb[_0x07e8('0x59')]===0x1){return _0x4b658f['id'];}else{var _0x5db17f=_['every'](_[_0x07e8('0x37')](_0x5c45eb,_0x07e8('0x83')),function(_0x5ec1d2){return _[_0x07e8('0x84')](_0x4100ab,_0x5ec1d2);});if(_0x5db17f){return _0x4b658f['id'];}}}));}}return BPromise[_0x07e8('0x85')](_0x58cede)[_0x07e8('0x29')](function(_0xedee4a){_0x562f54=_(_0x562f54)[_0x07e8('0x86')](_0xedee4a)['compact']()[_0x07e8('0x87')]();return db[_0x07e8('0x45')][_0x07e8('0x4c')]({'where':{'id':_0x2e7fd3[_0x07e8('0x4b')]['id']}})[_0x07e8('0x29')](function(_0x4e2f2d){return db[_0x07e8('0x6c')][_0x07e8('0x6d')](function(_0x5c5cd7){return _0x4e2f2d[_0x07e8('0x88')](_0x2e7fd3[_0x07e8('0x38')][_0x07e8('0x66')],{'transaction':_0x5c5cd7})[_0x07e8('0x29')](function(){if(!_['isEmpty'](_0x562f54)){return _0x4e2f2d[_0x07e8('0x89')](_0x562f54,{'transaction':_0x5c5cd7});}})[_0x07e8('0x29')](function(){_0x562f54[_0x07e8('0x8a')](function(_0x323e6b){socket[_0x07e8('0x70')]('userMailQueue:remove',{'UserId':_0x323e6b,'MailQueueId':_0x4e2f2d['id']});});});});});});})[_0x07e8('0x29')](respondWithStatusCode(_0x3c8c37,null))[_0x07e8('0x4a')](handleError(_0x3c8c37,null));};exports[_0x07e8('0x8b')]=function(_0x267abb,_0x3b541f,_0x2345e8){return db[_0x07e8('0x45')][_0x07e8('0x4c')]({'where':{'id':_0x267abb[_0x07e8('0x4b')]['id']}})[_0x07e8('0x29')](handleEntityNotFound(_0x3b541f,null))[_0x07e8('0x29')](function(_0x1e78fe){if(_0x1e78fe){return _0x1e78fe['addAgents'](_0x267abb['body'][_0x07e8('0x66')],_[_0x07e8('0x8c')](_0x267abb['body'],[_0x07e8('0x66'),'id'])||{})[_0x07e8('0x8d')](function(_0x5e4099){for(var _0x211a19=0x0;_0x211a19<_0x267abb[_0x07e8('0x4e')]['ids'][_0x07e8('0x59')];_0x211a19+=0x1){socket[_0x07e8('0x70')](_0x07e8('0x71'),{'UserId':_0x267abb[_0x07e8('0x4e')][_0x07e8('0x66')][_0x211a19],'MailQueueId':_0x267abb[_0x07e8('0x4b')]['id']});}return _0x5e4099;});}})[_0x07e8('0x29')](respondWithResult(_0x3b541f,null))[_0x07e8('0x4a')](handleError(_0x3b541f,null));};exports[_0x07e8('0x89')]=function(_0x4b4ab9,_0xc60d43,_0x40c2ec){return db[_0x07e8('0x45')][_0x07e8('0x4c')]({'where':{'id':_0x4b4ab9['params']['id']}})[_0x07e8('0x29')](handleEntityNotFound(_0xc60d43,null))['then'](function(_0x4f79ac){if(_0x4f79ac){return _0x4f79ac[_0x07e8('0x89')](_0x4b4ab9[_0x07e8('0x38')][_0x07e8('0x66')])[_0x07e8('0x29')](function(){if(_[_0x07e8('0x8e')](_0x4b4ab9[_0x07e8('0x38')][_0x07e8('0x66')])){for(var _0x337a21=0x0;_0x337a21<_0x4b4ab9[_0x07e8('0x38')][_0x07e8('0x66')][_0x07e8('0x59')];_0x337a21+=0x1){socket[_0x07e8('0x70')](_0x07e8('0x8f'),{'UserId':Number(_0x4b4ab9[_0x07e8('0x38')][_0x07e8('0x66')][_0x337a21]),'MailQueueId':Number(_0x4b4ab9[_0x07e8('0x4b')]['id'])});}}else{socket[_0x07e8('0x70')](_0x07e8('0x8f'),{'UserId':Number(_0x4b4ab9[_0x07e8('0x38')][_0x07e8('0x66')]),'MailQueueId':Number(_0x4b4ab9[_0x07e8('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0xc60d43,null))[_0x07e8('0x4a')](handleError(_0xc60d43,null));};exports['getAgents']=function(_0x8caa7a,_0x369573,_0x43550e){var _0x29b004={};var _0xd684c5={};var _0x1fab34;var _0xa51d96;return db[_0x07e8('0x45')][_0x07e8('0x90')]({'where':{'id':_0x8caa7a['params']['id']}})[_0x07e8('0x29')](handleEntityNotFound(_0x369573,null))[_0x07e8('0x29')](function(_0x41f8a7){if(_0x41f8a7){_0x1fab34=_0x41f8a7;_0xd684c5[_0x07e8('0x36')]=_[_0x07e8('0x39')](db[_0x07e8('0x73')][_0x07e8('0x32')]);_0xd684c5['query']=_[_0x07e8('0x39')](_0x8caa7a[_0x07e8('0x38')]);_0xd684c5[_0x07e8('0x3a')]=_[_0x07e8('0x3c')](_0xd684c5[_0x07e8('0x36')],_0xd684c5['query']);_0x29b004[_0x07e8('0x3b')]=_[_0x07e8('0x3c')](_0xd684c5[_0x07e8('0x36')],qs['fields'](_0x8caa7a['query']['fields']));_0x29b004['attributes']=_0x29b004[_0x07e8('0x3b')]['length']?_0x29b004[_0x07e8('0x3b')]:_0xd684c5[_0x07e8('0x36')];_0x29b004[_0x07e8('0x64')]=qs['sort'](_0x8caa7a['query'][_0x07e8('0x3f')]);_0x29b004[_0x07e8('0x41')]=qs[_0x07e8('0x3a')](_['pick'](_0x8caa7a[_0x07e8('0x38')],_0xd684c5['filters']));if(_0x8caa7a['query'][_0x07e8('0x42')]){_0x29b004[_0x07e8('0x41')]=_[_0x07e8('0x43')](_0x29b004['where'],{'$or':_[_0x07e8('0x37')](_0x29b004[_0x07e8('0x3b')],function(_0x17973e){var _0x2195ad={};_0x2195ad[_0x17973e]={'$like':'%'+_0x8caa7a[_0x07e8('0x38')][_0x07e8('0x42')]+'%'};return _0x2195ad;})});}_0x29b004=_[_0x07e8('0x43')]({},_0x29b004,_0x8caa7a[_0x07e8('0x44')]);return _0x1fab34[_0x07e8('0x91')](_0x29b004);}})[_0x07e8('0x29')](function(_0x4537d4){if(_0x4537d4){_0xa51d96=_0x4537d4[_0x07e8('0x59')];if(!_0x8caa7a[_0x07e8('0x38')][_0x07e8('0x5a')](_0x07e8('0x3e'))){_0x29b004[_0x07e8('0x23')]=qs[_0x07e8('0x23')](_0x8caa7a[_0x07e8('0x38')]['limit']);_0x29b004[_0x07e8('0x22')]=qs['offset'](_0x8caa7a[_0x07e8('0x38')][_0x07e8('0x22')]);}return _0x1fab34[_0x07e8('0x91')](_0x29b004);}})[_0x07e8('0x29')](function(_0x2aba33){if(_0x2aba33){return _0x2aba33?{'count':_0xa51d96,'rows':_0x2aba33}:null;}})[_0x07e8('0x29')](respondWithResult(_0x369573,null))[_0x07e8('0x4a')](handleError(_0x369573,null));};
\ No newline at end of file
index a523c5d..a89b216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8486=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','MailQueue'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x8486,0x156));var _0x6848=function(_0x122811,_0x47fdae){_0x122811=_0x122811-0x0;var _0x150f9b=_0x8486[_0x122811];return _0x150f9b;};'use strict';var EventEmitter=require(_0x6848('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x6848('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6848('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6848('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1da543){return function(_0x4b796b,_0x5835f4,_0xf73400){MailQueueEvents[_0x6848('0x4')](_0x1da543+':'+_0x4b796b['id'],_0x4b796b);MailQueueEvents['emit'](_0x1da543,_0x4b796b);_0xf73400(null);};}for(var e in events){if(events[_0x6848('0x5')](e)){var event=events[e];MailQueue[_0x6848('0x6')](e,emitEvent(event));}}module[_0x6848('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0x43a8=['setMaxListeners','save','update','emit','hook','events','../../mysqldb','MailQueue'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x43a8,0xa5));var _0x843a=function(_0x1aca59,_0x287f24){_0x1aca59=_0x1aca59-0x0;var _0x1b2539=_0x43a8[_0x1aca59];return _0x1b2539;};'use strict';var EventEmitter=require(_0x843a('0x0'));var MailQueue=require(_0x843a('0x1'))['db'][_0x843a('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x843a('0x3')](0x0);var events={'afterCreate':_0x843a('0x4'),'afterUpdate':_0x843a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x254a51){return function(_0x2cd122,_0x5468d4,_0xb2264b){MailQueueEvents[_0x843a('0x6')](_0x254a51+':'+_0x2cd122['id'],_0x2cd122);MailQueueEvents[_0x843a('0x6')](_0x254a51,_0x2cd122);_0xb2264b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x843a('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
index ef6eb3f..5afcb7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f3b=['lodash','util','../../config/logger','api','bluebird','request-promise','path','exports','define','MailQueue'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6f3b,0x1ae));var _0xb6f3=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0x6f3b[_0x3616bb];return _0x1c0994;};'use strict';var _=require(_0xb6f3('0x0'));var util=require(_0xb6f3('0x1'));var logger=require(_0xb6f3('0x2'))(_0xb6f3('0x3'));var moment=require('moment');var BPromise=require(_0xb6f3('0x4'));var rp=require(_0xb6f3('0x5'));var fs=require('fs');var path=require(_0xb6f3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0xb6f3('0x7')]=function(_0x2a3c47,_0x163913){return _0x2a3c47[_0xb6f3('0x8')](_0xb6f3('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fa4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailQueue','mail_queues','../../config/logger','api'];(function(_0x312d1f,_0x2f97a8){var _0x3a0f42=function(_0x21a357){while(--_0x21a357){_0x312d1f['push'](_0x312d1f['shift']());}};_0x3a0f42(++_0x2f97a8);}(_0x0fa4,0x106));var _0x40fa=function(_0x101039,_0x4cfd50){_0x101039=_0x101039-0x0;var _0x50ab70=_0x0fa4[_0x101039];return _0x50ab70;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x40fa('0x0'))(_0x40fa('0x1'));var moment=require(_0x40fa('0x2'));var BPromise=require(_0x40fa('0x3'));var rp=require(_0x40fa('0x4'));var fs=require('fs');var path=require(_0x40fa('0x5'));var rimraf=require(_0x40fa('0x6'));var config=require(_0x40fa('0x7'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x13e3a6,_0x4d2600){return _0x13e3a6[_0x40fa('0x8')](_0x40fa('0x9'),attributes,{'tableName':_0x40fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 25b5505..45736a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa01=['result','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetMailQueue','debug','catch','find','ShowMailQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message'];(function(_0x42f0d1,_0x45fe4a){var _0x43f981=function(_0x5882e8){while(--_0x5882e8){_0x42f0d1['push'](_0x42f0d1['shift']());}};_0x43f981(++_0x45fe4a);}(_0xfa01,0x113));var _0x1fa0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfa01[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x1fa0('0x0'));var util=require(_0x1fa0('0x1'));var moment=require('moment');var BPromise=require(_0x1fa0('0x2'));var rs=require(_0x1fa0('0x3'));var fs=require('fs');var Redis=require(_0x1fa0('0x4'));var db=require(_0x1fa0('0x5'))['db'];var utils=require(_0x1fa0('0x6'));var logger=require(_0x1fa0('0x7'))(_0x1fa0('0x8'));var config=require(_0x1fa0('0x9'));var jayson=require(_0x1fa0('0xa'));var client=jayson[_0x1fa0('0xb')][_0x1fa0('0xc')]({'port':0x232a});config[_0x1fa0('0xd')]=_['defaults'](config['redis'],{'host':_0x1fa0('0xe'),'port':0x18eb});var socket=require(_0x1fa0('0xf'))(new Redis(config[_0x1fa0('0xd')]));require('./mailQueue.socket')[_0x1fa0('0x10')](socket);function respondWithRpcPromise(_0x31f0c3,_0xdec7d7,_0x7dc0ad){return new BPromise(function(_0x1aaf7e,_0x59e4ca){return client[_0x1fa0('0x11')](_0x31f0c3,_0x7dc0ad)['then'](function(_0x392f47){logger[_0x1fa0('0x12')]('MailQueue,\x20%s,\x20%s',_0xdec7d7,_0x1fa0('0x13'));logger['debug'](_0x1fa0('0x14'),_0xdec7d7,_0x1fa0('0x13'),JSON[_0x1fa0('0x15')](_0x392f47));if(_0x392f47[_0x1fa0('0x16')]){if(_0x392f47[_0x1fa0('0x16')][_0x1fa0('0x17')]===0x1f4){logger[_0x1fa0('0x16')](_0x1fa0('0x18'),_0xdec7d7,_0x392f47[_0x1fa0('0x16')][_0x1fa0('0x19')]);return _0x59e4ca(_0x392f47['error']['message']);}logger[_0x1fa0('0x16')](_0x1fa0('0x18'),_0xdec7d7,_0x392f47[_0x1fa0('0x16')]['message']);return _0x1aaf7e(_0x392f47['error'][_0x1fa0('0x19')]);}else{logger[_0x1fa0('0x12')]('MailQueue,\x20%s,\x20%s',_0xdec7d7,_0x1fa0('0x13'));_0x1aaf7e(_0x392f47[_0x1fa0('0x1a')][_0x1fa0('0x19')]);}})['catch'](function(_0x4ef9b1){logger[_0x1fa0('0x16')](_0x1fa0('0x18'),_0xdec7d7,_0x4ef9b1);_0x59e4ca(_0x4ef9b1);});});}exports['GetMailQueue']=function(_0x4bf802){var _0x129907=this;return new Promise(function(_0xf0dbc9,_0x44dcc9){return db[_0x1fa0('0x1b')][_0x1fa0('0x1c')]({'raw':_0x4bf802[_0x1fa0('0x1d')]?_0x4bf802[_0x1fa0('0x1d')][_0x1fa0('0x1e')]===undefined?!![]:![]:!![],'where':_0x4bf802['options']?_0x4bf802[_0x1fa0('0x1d')][_0x1fa0('0x1f')]||null:null,'attributes':_0x4bf802[_0x1fa0('0x1d')]?_0x4bf802[_0x1fa0('0x1d')][_0x1fa0('0x20')]||null:null,'limit':_0x4bf802[_0x1fa0('0x1d')]?_0x4bf802['options'][_0x1fa0('0x21')]||null:null,'include':_0x4bf802[_0x1fa0('0x1d')]?_0x4bf802[_0x1fa0('0x1d')][_0x1fa0('0x22')]?_[_0x1fa0('0x23')](_0x4bf802['options']['include'],function(_0x1c7a1e){return{'model':db[_0x1c7a1e[_0x1fa0('0x24')]],'as':_0x1c7a1e['as'],'attributes':_0x1c7a1e[_0x1fa0('0x20')],'include':_0x1c7a1e[_0x1fa0('0x22')]?_[_0x1fa0('0x23')](_0x1c7a1e[_0x1fa0('0x22')],function(_0x385842){return{'model':db[_0x385842[_0x1fa0('0x24')]],'as':_0x385842['as'],'attributes':_0x385842['attributes'],'include':_0x385842[_0x1fa0('0x22')]?_[_0x1fa0('0x23')](_0x385842[_0x1fa0('0x22')],function(_0x3c7fe4){return{'model':db[_0x3c7fe4['model']],'as':_0x3c7fe4['as'],'attributes':_0x3c7fe4[_0x1fa0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1fa0('0x25')](function(_0x466e3c){logger[_0x1fa0('0x12')](_0x1fa0('0x26'),_0x4bf802);logger[_0x1fa0('0x27')]('GetMailQueue',_0x4bf802,JSON[_0x1fa0('0x15')](_0x466e3c));_0xf0dbc9(_0x466e3c);})[_0x1fa0('0x28')](function(_0x2cd149){logger[_0x1fa0('0x16')]('GetMailQueue',_0x2cd149['message'],_0x4bf802);_0x44dcc9(_0x129907['error'](0x1f4,_0x2cd149['message']));});});};exports['ShowMailQueue']=function(_0xabaf2b){var _0x13b595=this;return new Promise(function(_0x5a1401,_0x1668ff){return db[_0x1fa0('0x1b')][_0x1fa0('0x29')]({'raw':_0xabaf2b[_0x1fa0('0x1d')]?_0xabaf2b['options'][_0x1fa0('0x1e')]===undefined?!![]:![]:!![],'where':_0xabaf2b[_0x1fa0('0x1d')]?_0xabaf2b[_0x1fa0('0x1d')][_0x1fa0('0x1f')]||null:null,'attributes':_0xabaf2b['options']?_0xabaf2b['options'][_0x1fa0('0x20')]||null:null,'include':_0xabaf2b['options']?_0xabaf2b[_0x1fa0('0x1d')]['include']?_[_0x1fa0('0x23')](_0xabaf2b[_0x1fa0('0x1d')][_0x1fa0('0x22')],function(_0x1b5642){return{'model':db[_0x1b5642['model']],'as':_0x1b5642['as'],'attributes':_0x1b5642['attributes'],'include':_0x1b5642[_0x1fa0('0x22')]?_[_0x1fa0('0x23')](_0x1b5642[_0x1fa0('0x22')],function(_0x4012b1){return{'model':db[_0x4012b1[_0x1fa0('0x24')]],'as':_0x4012b1['as'],'attributes':_0x4012b1[_0x1fa0('0x20')],'include':_0x4012b1[_0x1fa0('0x22')]?_[_0x1fa0('0x23')](_0x4012b1['include'],function(_0x2652de){return{'model':db[_0x2652de[_0x1fa0('0x24')]],'as':_0x2652de['as'],'attributes':_0x2652de['attributes']};}):[]};}):[]};}):[]:[]})[_0x1fa0('0x25')](function(_0x2b3007){logger[_0x1fa0('0x12')]('ShowMailQueue',_0xabaf2b);logger[_0x1fa0('0x27')](_0x1fa0('0x2a'),_0xabaf2b,JSON[_0x1fa0('0x15')](_0x2b3007));_0x5a1401(_0x2b3007);})[_0x1fa0('0x28')](function(_0x50a05b){logger[_0x1fa0('0x16')](_0x1fa0('0x2a'),_0x50a05b[_0x1fa0('0x19')],_0xabaf2b);_0x1668ff(_0x13b595['error'](0x1f4,_0x50a05b[_0x1fa0('0x19')]));});});};
\ No newline at end of file
+var _0x9165=['limit','include','map','model','catch','ShowMailQueue','MailQueue','find','raw','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailQueue','findAll','options','where','attributes'];(function(_0x38b182,_0x41a373){var _0xf3e3f6=function(_0x49c368){while(--_0x49c368){_0x38b182['push'](_0x38b182['shift']());}};_0xf3e3f6(++_0x41a373);}(_0x9165,0xf3));var _0x5916=function(_0x35fc80,_0xd6ce40){_0x35fc80=_0x35fc80-0x0;var _0x3f0fb3=_0x9165[_0x35fc80];return _0x3f0fb3;};'use strict';var _=require(_0x5916('0x0'));var util=require(_0x5916('0x1'));var moment=require('moment');var BPromise=require(_0x5916('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(_0x5916('0x3'))(_0x5916('0x4'));var config=require(_0x5916('0x5'));var jayson=require(_0x5916('0x6'));var client=jayson[_0x5916('0x7')]['http']({'port':0x232a});config[_0x5916('0x8')]=_['defaults'](config[_0x5916('0x8')],{'host':_0x5916('0x9'),'port':0x18eb});var socket=require(_0x5916('0xa'))(new Redis(config[_0x5916('0x8')]));require(_0x5916('0xb'))[_0x5916('0xc')](socket);function respondWithRpcPromise(_0x3cf567,_0x351b35,_0x298f47){return new BPromise(function(_0x2e3e39,_0x303eb1){return client[_0x5916('0xd')](_0x3cf567,_0x298f47)[_0x5916('0xe')](function(_0x4356ee){logger[_0x5916('0xf')](_0x5916('0x10'),_0x351b35,'request\x20sent');logger[_0x5916('0x11')](_0x5916('0x12'),_0x351b35,_0x5916('0x13'),JSON[_0x5916('0x14')](_0x4356ee));if(_0x4356ee[_0x5916('0x15')]){if(_0x4356ee[_0x5916('0x15')][_0x5916('0x16')]===0x1f4){logger[_0x5916('0x15')]('MailQueue,\x20%s,\x20%s',_0x351b35,_0x4356ee[_0x5916('0x15')]['message']);return _0x303eb1(_0x4356ee['error'][_0x5916('0x17')]);}logger[_0x5916('0x15')](_0x5916('0x10'),_0x351b35,_0x4356ee[_0x5916('0x15')][_0x5916('0x17')]);return _0x2e3e39(_0x4356ee[_0x5916('0x15')][_0x5916('0x17')]);}else{logger[_0x5916('0xf')]('MailQueue,\x20%s,\x20%s',_0x351b35,_0x5916('0x13'));_0x2e3e39(_0x4356ee[_0x5916('0x18')][_0x5916('0x17')]);}})['catch'](function(_0x21d3bc){logger[_0x5916('0x15')](_0x5916('0x10'),_0x351b35,_0x21d3bc);_0x303eb1(_0x21d3bc);});});}exports[_0x5916('0x19')]=function(_0x2c6cea){var _0x36b288=this;return new Promise(function(_0x2b9e7d,_0x258791){return db['MailQueue'][_0x5916('0x1a')]({'raw':_0x2c6cea[_0x5916('0x1b')]?_0x2c6cea[_0x5916('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2c6cea[_0x5916('0x1b')]?_0x2c6cea['options'][_0x5916('0x1c')]||null:null,'attributes':_0x2c6cea[_0x5916('0x1b')]?_0x2c6cea[_0x5916('0x1b')][_0x5916('0x1d')]||null:null,'limit':_0x2c6cea[_0x5916('0x1b')]?_0x2c6cea[_0x5916('0x1b')][_0x5916('0x1e')]||null:null,'include':_0x2c6cea[_0x5916('0x1b')]?_0x2c6cea[_0x5916('0x1b')][_0x5916('0x1f')]?_[_0x5916('0x20')](_0x2c6cea[_0x5916('0x1b')][_0x5916('0x1f')],function(_0xf940d5){return{'model':db[_0xf940d5[_0x5916('0x21')]],'as':_0xf940d5['as'],'attributes':_0xf940d5[_0x5916('0x1d')],'include':_0xf940d5['include']?_[_0x5916('0x20')](_0xf940d5[_0x5916('0x1f')],function(_0x4c114e){return{'model':db[_0x4c114e[_0x5916('0x21')]],'as':_0x4c114e['as'],'attributes':_0x4c114e[_0x5916('0x1d')],'include':_0x4c114e[_0x5916('0x1f')]?_[_0x5916('0x20')](_0x4c114e[_0x5916('0x1f')],function(_0x2fdc6f){return{'model':db[_0x2fdc6f[_0x5916('0x21')]],'as':_0x2fdc6f['as'],'attributes':_0x2fdc6f[_0x5916('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5916('0xe')](function(_0x2295bb){logger[_0x5916('0xf')](_0x5916('0x19'),_0x2c6cea);logger[_0x5916('0x11')](_0x5916('0x19'),_0x2c6cea,JSON[_0x5916('0x14')](_0x2295bb));_0x2b9e7d(_0x2295bb);})[_0x5916('0x22')](function(_0x8ea49a){logger['error'](_0x5916('0x19'),_0x8ea49a['message'],_0x2c6cea);_0x258791(_0x36b288[_0x5916('0x15')](0x1f4,_0x8ea49a['message']));});});};exports[_0x5916('0x23')]=function(_0x193c81){var _0x4fd1ae=this;return new Promise(function(_0x531da9,_0x57bf2d){return db[_0x5916('0x24')][_0x5916('0x25')]({'raw':_0x193c81[_0x5916('0x1b')]?_0x193c81['options'][_0x5916('0x26')]===undefined?!![]:![]:!![],'where':_0x193c81['options']?_0x193c81[_0x5916('0x1b')]['where']||null:null,'attributes':_0x193c81[_0x5916('0x1b')]?_0x193c81[_0x5916('0x1b')][_0x5916('0x1d')]||null:null,'include':_0x193c81[_0x5916('0x1b')]?_0x193c81[_0x5916('0x1b')][_0x5916('0x1f')]?_['map'](_0x193c81[_0x5916('0x1b')][_0x5916('0x1f')],function(_0x3a545b){return{'model':db[_0x3a545b['model']],'as':_0x3a545b['as'],'attributes':_0x3a545b[_0x5916('0x1d')],'include':_0x3a545b[_0x5916('0x1f')]?_[_0x5916('0x20')](_0x3a545b[_0x5916('0x1f')],function(_0x5c162c){return{'model':db[_0x5c162c[_0x5916('0x21')]],'as':_0x5c162c['as'],'attributes':_0x5c162c['attributes'],'include':_0x5c162c[_0x5916('0x1f')]?_[_0x5916('0x20')](_0x5c162c[_0x5916('0x1f')],function(_0x5a23c3){return{'model':db[_0x5a23c3[_0x5916('0x21')]],'as':_0x5a23c3['as'],'attributes':_0x5a23c3[_0x5916('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5916('0xe')](function(_0x32ad33){logger[_0x5916('0xf')](_0x5916('0x23'),_0x193c81);logger[_0x5916('0x11')](_0x5916('0x23'),_0x193c81,JSON['stringify'](_0x32ad33));_0x531da9(_0x32ad33);})['catch'](function(_0x5bea86){logger[_0x5916('0x15')](_0x5916('0x23'),_0x5bea86[_0x5916('0x17')],_0x193c81);_0x57bf2d(_0x4fd1ae[_0x5916('0x15')](0x1f4,_0x5bea86[_0x5916('0x17')]));});});};
\ No newline at end of file
index ecc889d..bf2e0dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ac=['emit','length','mailQueue:','save','remove'];(function(_0x3bd71b,_0x1ebd61){var _0x2ae3c5=function(_0x5bb3bc){while(--_0x5bb3bc){_0x3bd71b['push'](_0x3bd71b['shift']());}};_0x2ae3c5(++_0x1ebd61);}(_0x42ac,0x14d));var _0xc42a=function(_0x23aabb,_0x4ab07c){_0x23aabb=_0x23aabb-0x0;var _0x2f3bec=_0x42ac[_0x23aabb];return _0x2f3bec;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xc42a('0x0'),_0xc42a('0x1'),'update'];function createListener(_0x503138,_0x161381){return function(_0x4f249f){_0x161381[_0xc42a('0x2')](_0x503138,_0x4f249f);};}function removeListener(_0x58c3a8,_0x14770a){return function(){MailQueueEvents['removeListener'](_0x58c3a8,_0x14770a);};}exports['register']=function(_0x199890){for(var _0x4b3687=0x0,_0x3cda29=events[_0xc42a('0x3')];_0x4b3687<_0x3cda29;_0x4b3687++){var _0x3e8baf=events[_0x4b3687];var _0x149f28=createListener(_0xc42a('0x4')+_0x3e8baf,_0x199890);MailQueueEvents['on'](_0x3e8baf,_0x149f28);}};
\ No newline at end of file
+var _0x5ceb=['mailQueue:','save','remove','update','emit','removeListener','register'];(function(_0x51e59d,_0x245c77){var _0x4be8c9=function(_0x11be17){while(--_0x11be17){_0x51e59d['push'](_0x51e59d['shift']());}};_0x4be8c9(++_0x245c77);}(_0x5ceb,0x15f));var _0xb5ce=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x5ceb[_0x565c49];return _0x20ca34;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xb5ce('0x0'),_0xb5ce('0x1'),_0xb5ce('0x2')];function createListener(_0x18aa3d,_0x438002){return function(_0x2d0f58){_0x438002[_0xb5ce('0x3')](_0x18aa3d,_0x2d0f58);};}function removeListener(_0x19bb4f,_0x3ccd5c){return function(){MailQueueEvents[_0xb5ce('0x4')](_0x19bb4f,_0x3ccd5c);};}exports[_0xb5ce('0x5')]=function(_0x5be1eb){for(var _0x120951=0x0,_0x435f08=events['length'];_0x120951<_0x435f08;_0x120951++){var _0x475390=events[_0x120951];var _0x517c57=createListener(_0xb5ce('0x6')+_0x475390,_0x5be1eb);MailQueueEvents['on'](_0x475390,_0x517c57);}};
\ No newline at end of file
index 21b56bf..4442efa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd40=['/:id','show','create','put','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x4c1df0,_0x5cd10e){var _0x373946=function(_0x1393c8){while(--_0x1393c8){_0x4c1df0['push'](_0x4c1df0['shift']());}};_0x373946(++_0x5cd10e);}(_0xdd40,0x1c5));var _0x0dd4=function(_0x1776f6,_0x5ec2f9){_0x1776f6=_0x1776f6-0x0;var _0x4c9fb2=_0xdd40[_0x1776f6];return _0x4c9fb2;};'use strict';var multer=require(_0x0dd4('0x0'));var util=require(_0x0dd4('0x1'));var path=require(_0x0dd4('0x2'));var timeout=require('connect-timeout');var express=require(_0x0dd4('0x3'));var router=express['Router']();var auth=require(_0x0dd4('0x4'));var interaction=require(_0x0dd4('0x5'));var config=require(_0x0dd4('0x6'));var controller=require('./mailQueueReport.controller');router[_0x0dd4('0x7')]('/',auth[_0x0dd4('0x8')](),controller['index']);router[_0x0dd4('0x7')](_0x0dd4('0x9'),auth['isAuthenticated'](),controller[_0x0dd4('0xa')]);router[_0x0dd4('0x7')](_0x0dd4('0xb'),auth[_0x0dd4('0x8')](),controller[_0x0dd4('0xc')]);router['post']('/',auth[_0x0dd4('0x8')](),controller[_0x0dd4('0xd')]);router[_0x0dd4('0xe')](_0x0dd4('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0dd4('0xb'),auth[_0x0dd4('0x8')](),controller['destroy']);module[_0x0dd4('0xf')]=router;
\ No newline at end of file
+var _0x94eb=['create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','post'];(function(_0x57a115,_0x12fda8){var _0x88158f=function(_0x5ce7c9){while(--_0x5ce7c9){_0x57a115['push'](_0x57a115['shift']());}};_0x88158f(++_0x12fda8);}(_0x94eb,0x1d4));var _0xb94e=function(_0x3b7708,_0xc09493){_0x3b7708=_0x3b7708-0x0;var _0x3e33f7=_0x94eb[_0x3b7708];return _0x3e33f7;};'use strict';var multer=require(_0xb94e('0x0'));var util=require(_0xb94e('0x1'));var path=require(_0xb94e('0x2'));var timeout=require(_0xb94e('0x3'));var express=require(_0xb94e('0x4'));var router=express['Router']();var auth=require(_0xb94e('0x5'));var interaction=require(_0xb94e('0x6'));var config=require(_0xb94e('0x7'));var controller=require(_0xb94e('0x8'));router[_0xb94e('0x9')]('/',auth[_0xb94e('0xa')](),controller[_0xb94e('0xb')]);router[_0xb94e('0x9')](_0xb94e('0xc'),auth[_0xb94e('0xa')](),controller[_0xb94e('0xd')]);router[_0xb94e('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb94e('0xe')]('/',auth[_0xb94e('0xa')](),controller[_0xb94e('0xf')]);router[_0xb94e('0x10')](_0xb94e('0x11'),auth[_0xb94e('0xa')](),controller[_0xb94e('0x12')]);router[_0xb94e('0x13')](_0xb94e('0x11'),auth[_0xb94e('0xa')](),controller['destroy']);module[_0xb94e('0x14')]=router;
\ No newline at end of file
index 78f0c07..186a657 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3439=['moment','STRING','DATE'];(function(_0x3d1f53,_0x6586ac){var _0x3f7cf2=function(_0x3f1b90){while(--_0x3f1b90){_0x3d1f53['push'](_0x3d1f53['shift']());}};_0x3f7cf2(++_0x6586ac);}(_0x3439,0x16b));var _0x9343=function(_0x8bc275,_0x34d95b){_0x8bc275=_0x8bc275-0x0;var _0x365c08=_0x3439[_0x8bc275];return _0x365c08;};'use strict';var moment=require(_0x9343('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x9343('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x9343('0x1')]},'joinAt':{'type':Sequelize[_0x9343('0x2')]},'leaveAt':{'type':Sequelize[_0x9343('0x2')]},'acceptAt':{'type':Sequelize[_0x9343('0x2')]},'exitAt':{'type':Sequelize[_0x9343('0x2')]},'reason':{'type':Sequelize[_0x9343('0x1')]}};
\ No newline at end of file
+var _0xaca1=['exports','STRING','DATE','moment','sequelize'];(function(_0x166bc1,_0xf8034){var _0x589664=function(_0x620ebf){while(--_0x620ebf){_0x166bc1['push'](_0x166bc1['shift']());}};_0x589664(++_0xf8034);}(_0xaca1,0x107));var _0x1aca=function(_0xbd0586,_0x3ea034){_0xbd0586=_0xbd0586-0x0;var _0x3cbc64=_0xaca1[_0xbd0586];return _0x3cbc64;};'use strict';var moment=require(_0x1aca('0x0'));var Sequelize=require(_0x1aca('0x1'));module[_0x1aca('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1aca('0x3')]},'joinAt':{'type':Sequelize[_0x1aca('0x4')]},'leaveAt':{'type':Sequelize[_0x1aca('0x4')]},'acceptAt':{'type':Sequelize[_0x1aca('0x4')]},'exitAt':{'type':Sequelize[_0x1aca('0x4')]},'reason':{'type':Sequelize[_0x1aca('0x3')]}};
\ No newline at end of file
index cbc391e..c084051 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16cc=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','index','map','MailQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','describe'];(function(_0x5b6583,_0x52c6a9){var _0x3882ad=function(_0x201f38){while(--_0x201f38){_0x5b6583['push'](_0x5b6583['shift']());}};_0x3882ad(++_0x52c6a9);}(_0x16cc,0x120));var _0xc16c=function(_0x313e9b,_0x3a8870){_0x313e9b=_0x313e9b-0x0;var _0x29d692=_0x16cc[_0x313e9b];return _0x29d692;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc16c('0x0'));var rimraf=require(_0xc16c('0x1'));var zipdir=require(_0xc16c('0x2'));var jsonpatch=require(_0xc16c('0x3'));var rp=require(_0xc16c('0x4'));var moment=require(_0xc16c('0x5'));var BPromise=require(_0xc16c('0x6'));var Mustache=require('mustache');var util=require(_0xc16c('0x7'));var path=require(_0xc16c('0x8'));var sox=require(_0xc16c('0x9'));var csv=require(_0xc16c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc16c('0xb'));var squel=require('squel');var crypto=require(_0xc16c('0xc'));var jsforce=require(_0xc16c('0xd'));var deskjs=require(_0xc16c('0xe'));var toCsv=require(_0xc16c('0xa'));var querystring=require('querystring');var Papa=require(_0xc16c('0xf'));var Redis=require(_0xc16c('0x10'));var authService=require(_0xc16c('0x11'));var qs=require(_0xc16c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc16c('0x13'));var logger=require(_0xc16c('0x14'))(_0xc16c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc16c('0x16'))['db'];function respondWithStatusCode(_0x2cf236,_0x62b43c){_0x62b43c=_0x62b43c||0xcc;return function(_0x5265f7){if(_0x5265f7){return _0x2cf236['sendStatus'](_0x62b43c);}return _0x2cf236['status'](_0x62b43c)[_0xc16c('0x17')]();};}function respondWithResult(_0x3f406e,_0x440d6e){_0x440d6e=_0x440d6e||0xc8;return function(_0x21d788){if(_0x21d788){return _0x3f406e[_0xc16c('0x18')](_0x440d6e)[_0xc16c('0x19')](_0x21d788);}};}function respondWithFilteredResult(_0x47ea69,_0x32b7cd){return function(_0x200ec0){if(_0x200ec0){var _0x304303=_0x200ec0[_0xc16c('0x1a')],_0x244e4c=_0x32b7cd[_0xc16c('0x1b')],_0xcc4850=_0x32b7cd['offset']+_0x32b7cd['limit'],_0x2818e;if(_0xcc4850>=_0x304303){_0xcc4850=_0x304303;_0x2818e=0xc8;}else{_0x2818e=0xce;}_0x47ea69[_0xc16c('0x18')](_0x2818e);return _0x47ea69[_0xc16c('0x1c')](_0xc16c('0x1d'),_0x244e4c+'-'+_0xcc4850+'/'+_0x304303)[_0xc16c('0x19')](_0x200ec0);}return null;};}function patchUpdates(_0x432a0a){return function(_0x24d0f5){try{jsonpatch[_0xc16c('0x1e')](_0x24d0f5,_0x432a0a,!![]);}catch(_0xb29555){return BPromise['reject'](_0xb29555);}return _0x24d0f5[_0xc16c('0x1f')]();};}function saveUpdates(_0x37afc3,_0x121da2){return function(_0x290e9){if(_0x290e9){return _0x290e9[_0xc16c('0x20')](_0x37afc3)[_0xc16c('0x21')](function(_0x264c24){return _0x264c24;});}return null;};}function removeEntity(_0x264a3a,_0x41f7c3){return function(_0x4112d3){if(_0x4112d3){return _0x4112d3[_0xc16c('0x22')]()[_0xc16c('0x21')](function(){_0x264a3a[_0xc16c('0x18')](0xcc)[_0xc16c('0x17')]();});}};}function handleEntityNotFound(_0x2d6727,_0x534a87){return function(_0x565d36){if(!_0x565d36){_0x2d6727[_0xc16c('0x23')](0x194);}return _0x565d36;};}function handleError(_0x5911cf,_0xfd31a7){_0xfd31a7=_0xfd31a7||0x1f4;return function(_0x689030){logger['error'](_0x689030[_0xc16c('0x24')]);if(_0x689030['name']){delete _0x689030[_0xc16c('0x25')];}_0x5911cf[_0xc16c('0x18')](_0xfd31a7)['send'](_0x689030);};}exports[_0xc16c('0x26')]=function(_0x29fe0b,_0x323b60){var _0x536bf1={},_0x403c67={},_0x29c413={'count':0x0,'rows':[]};var _0x49d11e=_[_0xc16c('0x27')](db[_0xc16c('0x28')]['rawAttributes'],function(_0x558d79){return{'name':_0x558d79[_0xc16c('0x29')],'type':_0x558d79['type'][_0xc16c('0x2a')]};});_0x403c67[_0xc16c('0x2b')]=_[_0xc16c('0x27')](_0x49d11e,'name');_0x403c67[_0xc16c('0x2c')]=_[_0xc16c('0x2d')](_0x29fe0b[_0xc16c('0x2c')]);_0x403c67[_0xc16c('0x2e')]=_[_0xc16c('0x2f')](_0x403c67[_0xc16c('0x2b')],_0x403c67[_0xc16c('0x2c')]);_0x536bf1[_0xc16c('0x30')]=_[_0xc16c('0x2f')](_0x403c67[_0xc16c('0x2b')],qs[_0xc16c('0x31')](_0x29fe0b[_0xc16c('0x2c')][_0xc16c('0x31')]));_0x536bf1[_0xc16c('0x30')]=_0x536bf1['attributes'][_0xc16c('0x32')]?_0x536bf1[_0xc16c('0x30')]:_0x403c67[_0xc16c('0x2b')];if(!_0x29fe0b['query']['hasOwnProperty']('nolimit')){_0x536bf1[_0xc16c('0x33')]=qs[_0xc16c('0x33')](_0x29fe0b[_0xc16c('0x2c')][_0xc16c('0x33')]);_0x536bf1[_0xc16c('0x1b')]=qs[_0xc16c('0x1b')](_0x29fe0b[_0xc16c('0x2c')][_0xc16c('0x1b')]);}_0x536bf1[_0xc16c('0x34')]=qs['sort'](_0x29fe0b['query'][_0xc16c('0x35')]);_0x536bf1[_0xc16c('0x36')]=qs[_0xc16c('0x2e')](_[_0xc16c('0x37')](_0x29fe0b[_0xc16c('0x2c')],_0x403c67[_0xc16c('0x2e')]),_0x49d11e);if(_0x29fe0b['query'][_0xc16c('0x38')]){_0x536bf1[_0xc16c('0x36')]=_[_0xc16c('0x39')](_0x536bf1[_0xc16c('0x36')],{'$or':_['map'](_0x49d11e,function(_0xce0c1){if(_0xce0c1[_0xc16c('0x3a')]!==_0xc16c('0x3b')){var _0x325d9e={};_0x325d9e[_0xce0c1[_0xc16c('0x25')]]={'$like':'%'+_0x29fe0b[_0xc16c('0x2c')]['filter']+'%'};return _0x325d9e;}})});}_0x536bf1=_[_0xc16c('0x39')]({},_0x536bf1,_0x29fe0b[_0xc16c('0x3c')]);var _0x446fc5={'where':_0x536bf1[_0xc16c('0x36')]};return db[_0xc16c('0x28')][_0xc16c('0x1a')](_0x446fc5)[_0xc16c('0x21')](function(_0x93f257){_0x29c413[_0xc16c('0x1a')]=_0x93f257;if(_0x29fe0b[_0xc16c('0x2c')][_0xc16c('0x3d')]){_0x536bf1[_0xc16c('0x3e')]=[{'all':!![]}];}return db[_0xc16c('0x28')][_0xc16c('0x3f')](_0x536bf1);})[_0xc16c('0x21')](function(_0x2330c4){_0x29c413[_0xc16c('0x40')]=_0x2330c4;return _0x29c413;})[_0xc16c('0x21')](respondWithFilteredResult(_0x323b60,_0x536bf1))['catch'](handleError(_0x323b60,null));};exports[_0xc16c('0x41')]=function(_0x5c91ea,_0x46becc){var _0x5ed04c={'raw':!![],'where':{'id':_0x5c91ea[_0xc16c('0x42')]['id']}},_0x3aa9af={};_0x3aa9af[_0xc16c('0x2b')]=_['keys'](db[_0xc16c('0x28')]['rawAttributes']);_0x3aa9af[_0xc16c('0x2c')]=_[_0xc16c('0x2d')](_0x5c91ea[_0xc16c('0x2c')]);_0x3aa9af[_0xc16c('0x2e')]=_[_0xc16c('0x2f')](_0x3aa9af[_0xc16c('0x2b')],_0x3aa9af['query']);_0x5ed04c[_0xc16c('0x30')]=_['intersection'](_0x3aa9af[_0xc16c('0x2b')],qs['fields'](_0x5c91ea[_0xc16c('0x2c')]['fields']));_0x5ed04c[_0xc16c('0x30')]=_0x5ed04c[_0xc16c('0x30')][_0xc16c('0x32')]?_0x5ed04c['attributes']:_0x3aa9af[_0xc16c('0x2b')];if(_0x5c91ea[_0xc16c('0x2c')][_0xc16c('0x3d')]){_0x5ed04c[_0xc16c('0x3e')]=[{'all':!![]}];}_0x5ed04c=_[_0xc16c('0x39')]({},_0x5ed04c,_0x5c91ea[_0xc16c('0x3c')]);return db[_0xc16c('0x28')]['find'](_0x5ed04c)['then'](handleEntityNotFound(_0x46becc,null))[_0xc16c('0x21')](respondWithResult(_0x46becc,null))['catch'](handleError(_0x46becc,null));};exports[_0xc16c('0x43')]=function(_0x221358,_0x55b1ff){return db[_0xc16c('0x28')]['create'](_0x221358[_0xc16c('0x44')],{})[_0xc16c('0x21')](respondWithResult(_0x55b1ff,0xc9))[_0xc16c('0x45')](handleError(_0x55b1ff,null));};exports[_0xc16c('0x20')]=function(_0x378aca,_0x2b66f1){if(_0x378aca['body']['id']){delete _0x378aca[_0xc16c('0x44')]['id'];}return db['MailQueueReport'][_0xc16c('0x46')]({'where':{'id':_0x378aca['params']['id']}})['then'](handleEntityNotFound(_0x2b66f1,null))[_0xc16c('0x21')](saveUpdates(_0x378aca[_0xc16c('0x44')],null))['then'](respondWithResult(_0x2b66f1,null))['catch'](handleError(_0x2b66f1,null));};exports['destroy']=function(_0x4e7003,_0x40ec2c){return db[_0xc16c('0x28')][_0xc16c('0x46')]({'where':{'id':_0x4e7003['params']['id']}})[_0xc16c('0x21')](handleEntityNotFound(_0x40ec2c,null))[_0xc16c('0x21')](removeEntity(_0x40ec2c,null))[_0xc16c('0x45')](handleError(_0x40ec2c,null));};exports[_0xc16c('0x47')]=function(_0x40c69b,_0x4b3791){return db[_0xc16c('0x28')]['describe']()['then'](respondWithResult(_0x4b3791,null))[_0xc16c('0x45')](handleError(_0x4b3791,null));};
\ No newline at end of file
+var _0x971d=['sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','end','stack','name','send','index','map','MailQueueReport','fieldName','type','keys','query','filters','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x23f725,_0x56327a){var _0x2c89ab=function(_0x2f9375){while(--_0x2f9375){_0x23f725['push'](_0x23f725['shift']());}};_0x2c89ab(++_0x56327a);}(_0x971d,0xc5));var _0xd971=function(_0x55dc7c,_0x108898){_0x55dc7c=_0x55dc7c-0x0;var _0x27873f=_0x971d[_0x55dc7c];return _0x27873f;};'use strict';var pdf=require(_0xd971('0x0'));var emlformat=require(_0xd971('0x1'));var rimraf=require(_0xd971('0x2'));var zipdir=require(_0xd971('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd971('0x4'));var moment=require('moment');var BPromise=require(_0xd971('0x5'));var Mustache=require(_0xd971('0x6'));var util=require(_0xd971('0x7'));var path=require(_0xd971('0x8'));var sox=require(_0xd971('0x9'));var csv=require(_0xd971('0xa'));var ejs=require(_0xd971('0xb'));var fs=require('fs');var _=require(_0xd971('0xc'));var squel=require(_0xd971('0xd'));var crypto=require(_0xd971('0xe'));var jsforce=require(_0xd971('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd971('0xa'));var querystring=require(_0xd971('0x10'));var Papa=require('papaparse');var Redis=require(_0xd971('0x11'));var authService=require(_0xd971('0x12'));var qs=require(_0xd971('0x13'));var as=require(_0xd971('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd971('0x15'));var utils=require(_0xd971('0x16'));var config=require(_0xd971('0x17'));var db=require(_0xd971('0x18'))['db'];function respondWithStatusCode(_0x48b5fe,_0x393012){_0x393012=_0x393012||0xcc;return function(_0x4f4822){if(_0x4f4822){return _0x48b5fe[_0xd971('0x19')](_0x393012);}return _0x48b5fe[_0xd971('0x1a')](_0x393012)['end']();};}function respondWithResult(_0x45fbcb,_0x4d0f72){_0x4d0f72=_0x4d0f72||0xc8;return function(_0x384951){if(_0x384951){return _0x45fbcb[_0xd971('0x1a')](_0x4d0f72)[_0xd971('0x1b')](_0x384951);}};}function respondWithFilteredResult(_0x15e866,_0x223ff0){return function(_0x41acf7){if(_0x41acf7){var _0x5f5a04=_0x41acf7[_0xd971('0x1c')],_0x19510f=_0x223ff0[_0xd971('0x1d')],_0x52638e=_0x223ff0['offset']+_0x223ff0[_0xd971('0x1e')],_0x1e5fe5;if(_0x52638e>=_0x5f5a04){_0x52638e=_0x5f5a04;_0x1e5fe5=0xc8;}else{_0x1e5fe5=0xce;}_0x15e866[_0xd971('0x1a')](_0x1e5fe5);return _0x15e866[_0xd971('0x1f')](_0xd971('0x20'),_0x19510f+'-'+_0x52638e+'/'+_0x5f5a04)[_0xd971('0x1b')](_0x41acf7);}return null;};}function patchUpdates(_0x5f38cd){return function(_0x221aff){try{jsonpatch['apply'](_0x221aff,_0x5f38cd,!![]);}catch(_0x4b2fb5){return BPromise[_0xd971('0x21')](_0x4b2fb5);}return _0x221aff['save']();};}function saveUpdates(_0x1a65fc,_0x4e1f12){return function(_0x15bbb8){if(_0x15bbb8){return _0x15bbb8[_0xd971('0x22')](_0x1a65fc)[_0xd971('0x23')](function(_0x395663){return _0x395663;});}return null;};}function removeEntity(_0x1dd362,_0x235b0b){return function(_0x4579a9){if(_0x4579a9){return _0x4579a9[_0xd971('0x24')]()[_0xd971('0x23')](function(){_0x1dd362[_0xd971('0x1a')](0xcc)[_0xd971('0x25')]();});}};}function handleEntityNotFound(_0x41b41f,_0x168474){return function(_0x31517b){if(!_0x31517b){_0x41b41f[_0xd971('0x19')](0x194);}return _0x31517b;};}function handleError(_0x1c6eb2,_0x2df904){_0x2df904=_0x2df904||0x1f4;return function(_0x17759e){logger['error'](_0x17759e[_0xd971('0x26')]);if(_0x17759e[_0xd971('0x27')]){delete _0x17759e[_0xd971('0x27')];}_0x1c6eb2[_0xd971('0x1a')](_0x2df904)[_0xd971('0x28')](_0x17759e);};}exports[_0xd971('0x29')]=function(_0x15e9d9,_0x257ffc){var _0x1c1986={},_0x444fe5={},_0x2d96ae={'count':0x0,'rows':[]};var _0x22e824=_[_0xd971('0x2a')](db[_0xd971('0x2b')]['rawAttributes'],function(_0x4fe8a1){return{'name':_0x4fe8a1[_0xd971('0x2c')],'type':_0x4fe8a1[_0xd971('0x2d')]['key']};});_0x444fe5['model']=_[_0xd971('0x2a')](_0x22e824,_0xd971('0x27'));_0x444fe5['query']=_[_0xd971('0x2e')](_0x15e9d9[_0xd971('0x2f')]);_0x444fe5[_0xd971('0x30')]=_[_0xd971('0x31')](_0x444fe5[_0xd971('0x32')],_0x444fe5[_0xd971('0x2f')]);_0x1c1986['attributes']=_[_0xd971('0x31')](_0x444fe5[_0xd971('0x32')],qs[_0xd971('0x33')](_0x15e9d9[_0xd971('0x2f')][_0xd971('0x33')]));_0x1c1986['attributes']=_0x1c1986['attributes'][_0xd971('0x34')]?_0x1c1986['attributes']:_0x444fe5[_0xd971('0x32')];if(!_0x15e9d9[_0xd971('0x2f')]['hasOwnProperty'](_0xd971('0x35'))){_0x1c1986[_0xd971('0x1e')]=qs[_0xd971('0x1e')](_0x15e9d9[_0xd971('0x2f')][_0xd971('0x1e')]);_0x1c1986[_0xd971('0x1d')]=qs[_0xd971('0x1d')](_0x15e9d9['query'][_0xd971('0x1d')]);}_0x1c1986[_0xd971('0x36')]=qs['sort'](_0x15e9d9[_0xd971('0x2f')][_0xd971('0x37')]);_0x1c1986[_0xd971('0x38')]=qs['filters'](_[_0xd971('0x39')](_0x15e9d9[_0xd971('0x2f')],_0x444fe5[_0xd971('0x30')]),_0x22e824);if(_0x15e9d9[_0xd971('0x2f')][_0xd971('0x3a')]){_0x1c1986[_0xd971('0x38')]=_[_0xd971('0x3b')](_0x1c1986[_0xd971('0x38')],{'$or':_['map'](_0x22e824,function(_0x4b70eb){if(_0x4b70eb[_0xd971('0x2d')]!==_0xd971('0x3c')){var _0x167198={};_0x167198[_0x4b70eb['name']]={'$like':'%'+_0x15e9d9[_0xd971('0x2f')][_0xd971('0x3a')]+'%'};return _0x167198;}})});}_0x1c1986=_[_0xd971('0x3b')]({},_0x1c1986,_0x15e9d9[_0xd971('0x3d')]);var _0x1908ae={'where':_0x1c1986[_0xd971('0x38')]};return db[_0xd971('0x2b')][_0xd971('0x1c')](_0x1908ae)[_0xd971('0x23')](function(_0x516337){_0x2d96ae[_0xd971('0x1c')]=_0x516337;if(_0x15e9d9[_0xd971('0x2f')][_0xd971('0x3e')]){_0x1c1986[_0xd971('0x3f')]=[{'all':!![]}];}return db[_0xd971('0x2b')][_0xd971('0x40')](_0x1c1986);})[_0xd971('0x23')](function(_0xa885b2){_0x2d96ae[_0xd971('0x41')]=_0xa885b2;return _0x2d96ae;})[_0xd971('0x23')](respondWithFilteredResult(_0x257ffc,_0x1c1986))[_0xd971('0x42')](handleError(_0x257ffc,null));};exports[_0xd971('0x43')]=function(_0x524e99,_0xd1b132){var _0xd1ef68={'raw':!![],'where':{'id':_0x524e99[_0xd971('0x44')]['id']}},_0x277d39={};_0x277d39['model']=_[_0xd971('0x2e')](db[_0xd971('0x2b')]['rawAttributes']);_0x277d39[_0xd971('0x2f')]=_['keys'](_0x524e99['query']);_0x277d39[_0xd971('0x30')]=_[_0xd971('0x31')](_0x277d39[_0xd971('0x32')],_0x277d39['query']);_0xd1ef68['attributes']=_['intersection'](_0x277d39['model'],qs[_0xd971('0x33')](_0x524e99[_0xd971('0x2f')]['fields']));_0xd1ef68[_0xd971('0x45')]=_0xd1ef68['attributes'][_0xd971('0x34')]?_0xd1ef68['attributes']:_0x277d39[_0xd971('0x32')];if(_0x524e99['query'][_0xd971('0x3e')]){_0xd1ef68[_0xd971('0x3f')]=[{'all':!![]}];}_0xd1ef68=_[_0xd971('0x3b')]({},_0xd1ef68,_0x524e99[_0xd971('0x3d')]);return db[_0xd971('0x2b')][_0xd971('0x46')](_0xd1ef68)['then'](handleEntityNotFound(_0xd1b132,null))[_0xd971('0x23')](respondWithResult(_0xd1b132,null))[_0xd971('0x42')](handleError(_0xd1b132,null));};exports[_0xd971('0x47')]=function(_0x1d51c9,_0x1d4a94){return db[_0xd971('0x2b')][_0xd971('0x47')](_0x1d51c9['body'],{})[_0xd971('0x23')](respondWithResult(_0x1d4a94,0xc9))[_0xd971('0x42')](handleError(_0x1d4a94,null));};exports[_0xd971('0x22')]=function(_0x15a0f0,_0x202b51){if(_0x15a0f0['body']['id']){delete _0x15a0f0[_0xd971('0x48')]['id'];}return db[_0xd971('0x2b')][_0xd971('0x46')]({'where':{'id':_0x15a0f0['params']['id']}})[_0xd971('0x23')](handleEntityNotFound(_0x202b51,null))[_0xd971('0x23')](saveUpdates(_0x15a0f0[_0xd971('0x48')],null))[_0xd971('0x23')](respondWithResult(_0x202b51,null))[_0xd971('0x42')](handleError(_0x202b51,null));};exports[_0xd971('0x24')]=function(_0x4bd9f4,_0x462a23){return db[_0xd971('0x2b')][_0xd971('0x46')]({'where':{'id':_0x4bd9f4['params']['id']}})[_0xd971('0x23')](handleEntityNotFound(_0x462a23,null))[_0xd971('0x23')](removeEntity(_0x462a23,null))[_0xd971('0x42')](handleError(_0x462a23,null));};exports[_0xd971('0x49')]=function(_0x28330a,_0x5c0bac){return db[_0xd971('0x2b')]['describe']()['then'](respondWithResult(_0x5c0bac,null))[_0xd971('0x42')](handleError(_0x5c0bac,null));};
\ No newline at end of file
index 336710c..4751250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c3b=['rimraf','../../config/environment','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x5c3b,0x1aa));var _0xb5c3=function(_0x2a0afd,_0x4224c6){_0x2a0afd=_0x2a0afd-0x0;var _0x5c998f=_0x5c3b[_0x2a0afd];return _0x5c998f;};'use strict';var _=require(_0xb5c3('0x0'));var util=require(_0xb5c3('0x1'));var logger=require(_0xb5c3('0x2'))(_0xb5c3('0x3'));var moment=require(_0xb5c3('0x4'));var BPromise=require('bluebird');var rp=require(_0xb5c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb5c3('0x6'));var config=require(_0xb5c3('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0xb5c3('0x8')]=function(_0x5ee01a,_0xf7fab8){return _0x5ee01a[_0xb5c3('0x9')](_0xb5c3('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xb5c3('0xb'),'fields':[_0xb5c3('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x49c3=['request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1b8e64,_0x179b76){var _0x481c86=function(_0x33fd12){while(--_0x33fd12){_0x1b8e64['push'](_0x1b8e64['shift']());}};_0x481c86(++_0x179b76);}(_0x49c3,0xb1));var _0x349c=function(_0x1fb42e,_0x351df6){_0x1fb42e=_0x1fb42e-0x0;var _0x6622a4=_0x49c3[_0x1fb42e];return _0x6622a4;};'use strict';var _=require(_0x349c('0x0'));var util=require(_0x349c('0x1'));var logger=require(_0x349c('0x2'))('api');var moment=require(_0x349c('0x3'));var BPromise=require(_0x349c('0x4'));var rp=require(_0x349c('0x5'));var fs=require('fs');var path=require(_0x349c('0x6'));var rimraf=require(_0x349c('0x7'));var config=require('../../config/environment');var attributes=require(_0x349c('0x8'));module[_0x349c('0x9')]=function(_0x5290ec,_0x47b9d8){return _0x5290ec[_0x349c('0xa')](_0x349c('0xb'),attributes,{'tableName':_0x349c('0xc'),'paranoid':![],'indexes':[{'name':_0x349c('0xd'),'fields':[_0x349c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index a4a622b..5977133 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['info','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','CreateMailQueueReport','create','body','options','raw','MailQueueReport','update','where','attributes','limit','UpdateMailQueueReport','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4ec9b0,_0x418ccf){var _0x423685=function(_0x7bb63a){while(--_0x7bb63a){_0x4ec9b0['push'](_0x4ec9b0['shift']());}};_0x423685(++_0x418ccf);}(_0x2542,0x169));var _0x2254=function(_0x74f88f,_0x44cf35){_0x74f88f=_0x74f88f-0x0;var _0x149e36=_0x2542[_0x74f88f];return _0x149e36;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}exports[_0x2254('0x16')]=function(_0x1ae11e){var _0x34f90e=this;return new Promise(function(_0x497724,_0x51b395){return db['MailQueueReport'][_0x2254('0x17')](_0x1ae11e[_0x2254('0x18')],{'raw':_0x1ae11e[_0x2254('0x19')]?_0x1ae11e[_0x2254('0x19')][_0x2254('0x1a')]===undefined?!![]:![]:!![]})[_0x2254('0xc')](function(_0x487f72){logger[_0x2254('0xd')](_0x2254('0x16'),_0x1ae11e);logger[_0x2254('0xf')]('CreateMailQueueReport',_0x1ae11e,JSON['stringify'](_0x487f72));_0x497724(_0x487f72);})['catch'](function(_0x1e8a98){logger[_0x2254('0x14')](_0x2254('0x16'),_0x1e8a98['message'],_0x1ae11e);_0x51b395(_0x34f90e['error'](0x1f4,_0x1e8a98['message']));});});};exports['UpdateMailQueueReport']=function(_0x5e5edb){var _0x4f797d=this;return new Promise(function(_0x1aa71f,_0x9d6ccf){return db[_0x2254('0x1b')][_0x2254('0x1c')](_0x5e5edb[_0x2254('0x18')],{'raw':_0x5e5edb[_0x2254('0x19')]?_0x5e5edb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e5edb[_0x2254('0x19')]?_0x5e5edb['options'][_0x2254('0x1d')]||null:null,'attributes':_0x5e5edb[_0x2254('0x19')]?_0x5e5edb[_0x2254('0x19')][_0x2254('0x1e')]||null:null,'limit':_0x5e5edb[_0x2254('0x19')]?_0x5e5edb['options'][_0x2254('0x1f')]||null:null})[_0x2254('0xc')](function(_0x21285d){logger[_0x2254('0xd')](_0x2254('0x20'),_0x5e5edb);logger[_0x2254('0xf')](_0x2254('0x20'),_0x5e5edb,JSON[_0x2254('0x12')](_0x21285d));_0x1aa71f(_0x21285d);})[_0x2254('0x21')](function(_0x221db9){logger[_0x2254('0x14')](_0x2254('0x20'),_0x221db9[_0x2254('0x15')],_0x5e5edb);_0x9d6ccf(_0x4f797d[_0x2254('0x14')](0x1f4,_0x221db9[_0x2254('0x15')]));});});};
\ No newline at end of file
+var _0xc1c6=['stringify','error','message','info','catch','create','options','raw','CreateMailQueueReport','UpdateMailQueueReport','MailQueueReport','update','body','where','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x5d5262,_0x4154fb){_0x5d5262=_0x5d5262-0x0;var _0x1fb4b5=_0xc1c6[_0x5d5262];return _0x1fb4b5;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}exports['CreateMailQueueReport']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['MailQueueReport'][_0x6c1c('0x13')](_0x137770['body'],{'raw':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![]})[_0x6c1c('0x9')](function(_0x1acf7f){logger[_0x6c1c('0x11')](_0x6c1c('0x16'),_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x16'),_0x137770,JSON[_0x6c1c('0xe')](_0x1acf7f));_0x338dc2(_0x1acf7f);})[_0x6c1c('0x12')](function(_0x450b1f){logger[_0x6c1c('0xf')](_0x6c1c('0x16'),_0x450b1f[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x450b1f[_0x6c1c('0x10')]));});});};exports[_0x6c1c('0x17')]=function(_0x3a3f13){var _0x1dba08=this;return new Promise(function(_0x96046a,_0x3f517e){return db[_0x6c1c('0x18')][_0x6c1c('0x19')](_0x3a3f13[_0x6c1c('0x1a')],{'raw':_0x3a3f13[_0x6c1c('0x14')]?_0x3a3f13[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a3f13[_0x6c1c('0x14')]?_0x3a3f13['options'][_0x6c1c('0x1b')]||null:null,'attributes':_0x3a3f13['options']?_0x3a3f13[_0x6c1c('0x14')]['attributes']||null:null,'limit':_0x3a3f13[_0x6c1c('0x14')]?_0x3a3f13['options'][_0x6c1c('0x1c')]||null:null})[_0x6c1c('0x9')](function(_0x504348){logger[_0x6c1c('0x11')](_0x6c1c('0x17'),_0x3a3f13);logger['debug'](_0x6c1c('0x17'),_0x3a3f13,JSON[_0x6c1c('0xe')](_0x504348));_0x96046a(_0x504348);})[_0x6c1c('0x12')](function(_0xcb489a){logger['error']('UpdateMailQueueReport',_0xcb489a[_0x6c1c('0x10')],_0x3a3f13);_0x3f517e(_0x1dba08[_0x6c1c('0xf')](0x1f4,_0xcb489a[_0x6c1c('0x10')]));});});};
\ No newline at end of file
index 373c36c..5a487ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2272=['express','Router','../../components/auth/service','../../config/environment','exports','util','connect-timeout'];(function(_0x3ceaf6,_0x3d1cc1){var _0x2d1989=function(_0x3c5984){while(--_0x3c5984){_0x3ceaf6['push'](_0x3ceaf6['shift']());}};_0x2d1989(++_0x3d1cc1);}(_0x2272,0xf3));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x2227('0x0'));var path=require('path');var timeout=require(_0x2227('0x1'));var express=require(_0x2227('0x2'));var router=express[_0x2227('0x3')]();var auth=require(_0x2227('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2227('0x5'));module[_0x2227('0x6')]=router;
\ No newline at end of file
+var _0x6c15=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','express'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6c15,0xf8));var _0x56c1=function(_0x528912,_0x18073b){_0x528912=_0x528912-0x0;var _0x32efd4=_0x6c15[_0x528912];return _0x32efd4;};'use strict';var multer=require(_0x56c1('0x0'));var util=require(_0x56c1('0x1'));var path=require('path');var timeout=require(_0x56c1('0x2'));var express=require(_0x56c1('0x3'));var router=express[_0x56c1('0x4')]();var auth=require(_0x56c1('0x5'));var interaction=require(_0x56c1('0x6'));var config=require(_0x56c1('0x7'));module[_0x56c1('0x8')]=router;
\ No newline at end of file
index a6c0712..20a7d83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe198=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x234b10,_0x13ec61){var _0x45716c=function(_0x152763){while(--_0x152763){_0x234b10['push'](_0x234b10['shift']());}};_0x45716c(++_0x13ec61);}(_0xe198,0x1c4));var _0x8e19=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xe198[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require('sequelize');module[_0x8e19('0x0')]={'description':{'type':Sequelize[_0x8e19('0x1')]},'host':{'type':Sequelize[_0x8e19('0x1')]},'authentication':{'type':Sequelize[_0x8e19('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x8e19('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x8e19('0x1')]},'port':{'type':Sequelize[_0x8e19('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8e19('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x8e19('0x1')]}};
\ No newline at end of file
+var _0x8e23=['INTEGER','sequelize','STRING','BOOLEAN','username'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x8e23,0x1b9));var _0x38e2=function(_0x584e66,_0x447a76){_0x584e66=_0x584e66-0x0;var _0x25e823=_0x8e23[_0x584e66];return _0x25e823;};'use strict';var Sequelize=require(_0x38e2('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x38e2('0x1')]},'authentication':{'type':Sequelize[_0x38e2('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x38e2('0x1')],'unique':_0x38e2('0x3')},'password':{'type':Sequelize[_0x38e2('0x1')]},'port':{'type':Sequelize[_0x38e2('0x4')]},'tls':{'type':Sequelize[_0x38e2('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 03f5b67..2fa6cd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b0e=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','MailServerIn','mail_servers_in','lodash','util'];(function(_0x20172b,_0x3f8572){var _0x12c5cc=function(_0x1d636d){while(--_0x1d636d){_0x20172b['push'](_0x20172b['shift']());}};_0x12c5cc(++_0x3f8572);}(_0x1b0e,0x132));var _0xe1b0=function(_0x1a8559,_0x13ab88){_0x1a8559=_0x1a8559-0x0;var _0x34aff0=_0x1b0e[_0x1a8559];return _0x34aff0;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var logger=require(_0xe1b0('0x2'))(_0xe1b0('0x3'));var moment=require(_0xe1b0('0x4'));var BPromise=require(_0xe1b0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe1b0('0x6'));var config=require(_0xe1b0('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xe1b0('0x8')]=function(_0x2a049f,_0xfb57ae){return _0x2a049f['define'](_0xe1b0('0x9'),attributes,{'tableName':_0xe1b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde9f=['lodash','api','moment','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xde9f,0x118));var _0xfde9=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0xde9f[_0x45ee03];return _0x13d535;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde9('0x1'));var moment=require(_0xfde9('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde9('0x3'));var fs=require('fs');var path=require(_0xfde9('0x4'));var rimraf=require('rimraf');var config=require(_0xfde9('0x5'));var attributes=require(_0xfde9('0x6'));module[_0xfde9('0x7')]=function(_0xe30eaf,_0x5e69c0){return _0xe30eaf['define'](_0xfde9('0x8'),attributes,{'tableName':_0xfde9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 039d1ed..5980382 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf46c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','findAll','options','raw','where','limit','map','include','model','attributes','debug','lodash'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xf46c,0x1ac));var _0xcf46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf46c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf46('0x0'));var util=require(_0xcf46('0x1'));var moment=require('moment');var BPromise=require(_0xcf46('0x2'));var rs=require(_0xcf46('0x3'));var fs=require('fs');var Redis=require(_0xcf46('0x4'));var db=require(_0xcf46('0x5'))['db'];var utils=require(_0xcf46('0x6'));var logger=require('../../config/logger')(_0xcf46('0x7'));var config=require('../../config/environment');var jayson=require(_0xcf46('0x8'));var client=jayson[_0xcf46('0x9')][_0xcf46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20e4f8,_0x3ed778,_0x250e23){return new BPromise(function(_0x31ce10,_0x569534){return client['request'](_0x20e4f8,_0x250e23)[_0xcf46('0xb')](function(_0x52d199){logger[_0xcf46('0xc')]('MailServerIn,\x20%s,\x20%s',_0x3ed778,_0xcf46('0xd'));logger['debug'](_0xcf46('0xe'),_0x3ed778,_0xcf46('0xd'),JSON[_0xcf46('0xf')](_0x52d199));if(_0x52d199['error']){if(_0x52d199[_0xcf46('0x10')][_0xcf46('0x11')]===0x1f4){logger['error'](_0xcf46('0x12'),_0x3ed778,_0x52d199[_0xcf46('0x10')]['message']);return _0x569534(_0x52d199[_0xcf46('0x10')][_0xcf46('0x13')]);}logger[_0xcf46('0x10')](_0xcf46('0x12'),_0x3ed778,_0x52d199[_0xcf46('0x10')][_0xcf46('0x13')]);return _0x31ce10(_0x52d199[_0xcf46('0x10')][_0xcf46('0x13')]);}else{logger[_0xcf46('0xc')](_0xcf46('0x12'),_0x3ed778,_0xcf46('0xd'));_0x31ce10(_0x52d199[_0xcf46('0x14')]['message']);}})[_0xcf46('0x15')](function(_0x3c25d6){logger['error']('MailServerIn,\x20%s,\x20%s',_0x3ed778,_0x3c25d6);_0x569534(_0x3c25d6);});});}exports[_0xcf46('0x16')]=function(_0x511b62){var _0x594eb9=this;return new Promise(function(_0x3e77b9,_0x4fab1a){return db['MailServerIn'][_0xcf46('0x17')]({'raw':_0x511b62[_0xcf46('0x18')]?_0x511b62[_0xcf46('0x18')][_0xcf46('0x19')]===undefined?!![]:![]:!![],'where':_0x511b62[_0xcf46('0x18')]?_0x511b62[_0xcf46('0x18')][_0xcf46('0x1a')]||null:null,'attributes':_0x511b62['options']?_0x511b62[_0xcf46('0x18')]['attributes']||null:null,'limit':_0x511b62[_0xcf46('0x18')]?_0x511b62[_0xcf46('0x18')][_0xcf46('0x1b')]||null:null,'include':_0x511b62[_0xcf46('0x18')]?_0x511b62[_0xcf46('0x18')]['include']?_[_0xcf46('0x1c')](_0x511b62[_0xcf46('0x18')][_0xcf46('0x1d')],function(_0x5c995c){return{'model':db[_0x5c995c[_0xcf46('0x1e')]],'as':_0x5c995c['as'],'attributes':_0x5c995c['attributes'],'include':_0x5c995c[_0xcf46('0x1d')]?_[_0xcf46('0x1c')](_0x5c995c[_0xcf46('0x1d')],function(_0x1ec1be){return{'model':db[_0x1ec1be['model']],'as':_0x1ec1be['as'],'attributes':_0x1ec1be[_0xcf46('0x1f')],'include':_0x1ec1be[_0xcf46('0x1d')]?_[_0xcf46('0x1c')](_0x1ec1be[_0xcf46('0x1d')],function(_0x5649c6){return{'model':db[_0x5649c6['model']],'as':_0x5649c6['as'],'attributes':_0x5649c6[_0xcf46('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcf46('0xb')](function(_0x1060ec){logger[_0xcf46('0xc')](_0xcf46('0x16'),_0x511b62);logger[_0xcf46('0x20')](_0xcf46('0x16'),_0x511b62,JSON[_0xcf46('0xf')](_0x1060ec));_0x3e77b9(_0x1060ec);})[_0xcf46('0x15')](function(_0x1c2428){logger['error'](_0xcf46('0x16'),_0x1c2428[_0xcf46('0x13')],_0x511b62);_0x4fab1a(_0x594eb9[_0xcf46('0x10')](0x1f4,_0x1c2428[_0xcf46('0x13')]));});});};
\ No newline at end of file
+var _0x15b2=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','stringify'];(function(_0x5e47be,_0x5e803a){var _0x58aa0f=function(_0x3c4af7){while(--_0x3c4af7){_0x5e47be['push'](_0x5e47be['shift']());}};_0x58aa0f(++_0x5e803a);}(_0x15b2,0x1e0));var _0x215b=function(_0x259b56,_0x1b18da){_0x259b56=_0x259b56-0x0;var _0x54936e=_0x15b2[_0x259b56];return _0x54936e;};'use strict';var _=require(_0x215b('0x0'));var util=require('util');var moment=require(_0x215b('0x1'));var BPromise=require(_0x215b('0x2'));var rs=require(_0x215b('0x3'));var fs=require('fs');var Redis=require(_0x215b('0x4'));var db=require(_0x215b('0x5'))['db'];var utils=require(_0x215b('0x6'));var logger=require(_0x215b('0x7'))(_0x215b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x215b('0x9')][_0x215b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f05e7,_0x5ceca3,_0x5eb920){return new BPromise(function(_0x56710c,_0x958d37){return client[_0x215b('0xb')](_0x4f05e7,_0x5eb920)[_0x215b('0xc')](function(_0x11a348){logger[_0x215b('0xd')]('MailServerIn,\x20%s,\x20%s',_0x5ceca3,_0x215b('0xe'));logger[_0x215b('0xf')](_0x215b('0x10'),_0x5ceca3,_0x215b('0xe'),JSON['stringify'](_0x11a348));if(_0x11a348[_0x215b('0x11')]){if(_0x11a348['error']['code']===0x1f4){logger[_0x215b('0x11')](_0x215b('0x12'),_0x5ceca3,_0x11a348['error']['message']);return _0x958d37(_0x11a348[_0x215b('0x11')]['message']);}logger[_0x215b('0x11')](_0x215b('0x12'),_0x5ceca3,_0x11a348[_0x215b('0x11')]['message']);return _0x56710c(_0x11a348[_0x215b('0x11')][_0x215b('0x13')]);}else{logger[_0x215b('0xd')]('MailServerIn,\x20%s,\x20%s',_0x5ceca3,'request\x20sent');_0x56710c(_0x11a348['result'][_0x215b('0x13')]);}})[_0x215b('0x14')](function(_0x47b3cd){logger[_0x215b('0x11')](_0x215b('0x12'),_0x5ceca3,_0x47b3cd);_0x958d37(_0x47b3cd);});});}exports[_0x215b('0x15')]=function(_0x21feb5){var _0x1b0df4=this;return new Promise(function(_0x595223,_0x3baf3f){return db[_0x215b('0x16')][_0x215b('0x17')]({'raw':_0x21feb5[_0x215b('0x18')]?_0x21feb5[_0x215b('0x18')][_0x215b('0x19')]===undefined?!![]:![]:!![],'where':_0x21feb5[_0x215b('0x18')]?_0x21feb5[_0x215b('0x18')]['where']||null:null,'attributes':_0x21feb5[_0x215b('0x18')]?_0x21feb5[_0x215b('0x18')][_0x215b('0x1a')]||null:null,'limit':_0x21feb5[_0x215b('0x18')]?_0x21feb5[_0x215b('0x18')][_0x215b('0x1b')]||null:null,'include':_0x21feb5[_0x215b('0x18')]?_0x21feb5[_0x215b('0x18')][_0x215b('0x1c')]?_[_0x215b('0x1d')](_0x21feb5[_0x215b('0x18')][_0x215b('0x1c')],function(_0x2a3f8b){return{'model':db[_0x2a3f8b[_0x215b('0x1e')]],'as':_0x2a3f8b['as'],'attributes':_0x2a3f8b[_0x215b('0x1a')],'include':_0x2a3f8b['include']?_[_0x215b('0x1d')](_0x2a3f8b[_0x215b('0x1c')],function(_0x22ba45){return{'model':db[_0x22ba45[_0x215b('0x1e')]],'as':_0x22ba45['as'],'attributes':_0x22ba45[_0x215b('0x1a')],'include':_0x22ba45[_0x215b('0x1c')]?_[_0x215b('0x1d')](_0x22ba45[_0x215b('0x1c')],function(_0x41313d){return{'model':db[_0x41313d[_0x215b('0x1e')]],'as':_0x41313d['as'],'attributes':_0x41313d[_0x215b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x215b('0xc')](function(_0x553c2b){logger[_0x215b('0xd')]('GetMailServerIn',_0x21feb5);logger[_0x215b('0xf')](_0x215b('0x15'),_0x21feb5,JSON[_0x215b('0x1f')](_0x553c2b));_0x595223(_0x553c2b);})[_0x215b('0x14')](function(_0x3525df){logger[_0x215b('0x11')](_0x215b('0x15'),_0x3525df['message'],_0x21feb5);_0x3baf3f(_0x1b0df4[_0x215b('0x11')](0x1f4,_0x3525df['message']));});});};
\ No newline at end of file
index 29ba96a..36b53f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e4f=['get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0e4f,0x13b));var _0xf0e4=function(_0x601e4b,_0x56ec66){_0x601e4b=_0x601e4b-0x0;var _0x5d62ca=_0x0e4f[_0x601e4b];return _0x5d62ca;};'use strict';var multer=require(_0xf0e4('0x0'));var util=require('util');var path=require(_0xf0e4('0x1'));var timeout=require(_0xf0e4('0x2'));var express=require(_0xf0e4('0x3'));var router=express[_0xf0e4('0x4')]();var auth=require(_0xf0e4('0x5'));var interaction=require(_0xf0e4('0x6'));var config=require('../../config/environment');var controller=require(_0xf0e4('0x7'));router[_0xf0e4('0x8')]('/',auth[_0xf0e4('0x9')](),controller[_0xf0e4('0xa')]);router['get'](_0xf0e4('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf0e4('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xf0e4('0x9')](),controller[_0xf0e4('0xd')]);router[_0xf0e4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf0e4('0xf')]);module[_0xf0e4('0x10')]=router;
\ No newline at end of file
+var _0x6ae6=['put','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./mailServerOut.controller','index','get','/:id','isAuthenticated','show','post','create'];(function(_0x1022f2,_0x2d0b56){var _0x2d6585=function(_0x4feb46){while(--_0x4feb46){_0x1022f2['push'](_0x1022f2['shift']());}};_0x2d6585(++_0x2d0b56);}(_0x6ae6,0x1b5));var _0x66ae=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x6ae6[_0x4bf96c];return _0x281d09;};'use strict';var multer=require('multer');var util=require(_0x66ae('0x0'));var path=require('path');var timeout=require(_0x66ae('0x1'));var express=require(_0x66ae('0x2'));var router=express['Router']();var auth=require(_0x66ae('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x66ae('0x4'));var controller=require(_0x66ae('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x66ae('0x6')]);router[_0x66ae('0x7')](_0x66ae('0x8'),auth[_0x66ae('0x9')](),controller[_0x66ae('0xa')]);router[_0x66ae('0xb')]('/',auth[_0x66ae('0x9')](),controller[_0x66ae('0xc')]);router[_0x66ae('0xd')](_0x66ae('0x8'),auth[_0x66ae('0x9')](),controller[_0x66ae('0xe')]);router[_0x66ae('0xf')](_0x66ae('0x8'),auth[_0x66ae('0x9')](),controller[_0x66ae('0x10')]);module[_0x66ae('0x11')]=router;
\ No newline at end of file
index e5aa618..0ce7f05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1d3=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x3744e6,_0x15fe80){var _0x24480d=function(_0x27a0dc){while(--_0x27a0dc){_0x3744e6['push'](_0x3744e6['shift']());}};_0x24480d(++_0x15fe80);}(_0xc1d3,0x147));var _0x3c1d=function(_0x469f86,_0x4fd0af){_0x469f86=_0x469f86-0x0;var _0x2b0cc6=_0xc1d3[_0x469f86];return _0x2b0cc6;};'use strict';var Sequelize=require(_0x3c1d('0x0'));module[_0x3c1d('0x1')]={'description':{'type':Sequelize[_0x3c1d('0x2')]},'host':{'type':Sequelize[_0x3c1d('0x2')]},'user':{'type':Sequelize[_0x3c1d('0x2')]},'pass':{'type':Sequelize[_0x3c1d('0x2')]},'port':{'type':Sequelize[_0x3c1d('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3c1d('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xa498=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xa498,0x1d6));var _0x8a49=function(_0x1e6b59,_0x5eca5d){_0x1e6b59=_0x1e6b59-0x0;var _0x40d7c5=_0xa498[_0x1e6b59];return _0x40d7c5;};'use strict';var Sequelize=require('sequelize');module[_0x8a49('0x0')]={'description':{'type':Sequelize[_0x8a49('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x8a49('0x1')]},'port':{'type':Sequelize[_0x8a49('0x2')]},'secure':{'type':Sequelize[_0x8a49('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x8a49('0x1')]},'authentication':{'type':Sequelize[_0x8a49('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 178d093..ff3e413 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75f3=['body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','MailServerOut','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','options','findAll','catch','show','params','keys','rawAttributes','includeAll','include','find','create','update'];(function(_0x2666e3,_0x3ab570){var _0x3af69d=function(_0x408066){while(--_0x408066){_0x2666e3['push'](_0x2666e3['shift']());}};_0x3af69d(++_0x3ab570);}(_0x75f3,0x125));var _0x375f=function(_0x104cfc,_0x39f419){_0x104cfc=_0x104cfc-0x0;var _0x451ad5=_0x75f3[_0x104cfc];return _0x451ad5;};'use strict';var pdf=require(_0x375f('0x0'));var emlformat=require(_0x375f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x375f('0x2'));var jsonpatch=require(_0x375f('0x3'));var rp=require(_0x375f('0x4'));var moment=require(_0x375f('0x5'));var BPromise=require(_0x375f('0x6'));var Mustache=require(_0x375f('0x7'));var util=require(_0x375f('0x8'));var path=require('path');var sox=require(_0x375f('0x9'));var csv=require('to-csv');var ejs=require(_0x375f('0xa'));var fs=require('fs');var _=require(_0x375f('0xb'));var squel=require('squel');var crypto=require(_0x375f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x375f('0xd'));var toCsv=require(_0x375f('0xe'));var querystring=require(_0x375f('0xf'));var Papa=require('papaparse');var Redis=require(_0x375f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x375f('0x11'));var hardwareService=require(_0x375f('0x12'));var logger=require(_0x375f('0x13'))(_0x375f('0x14'));var utils=require('../../config/utils');var config=require(_0x375f('0x15'));var db=require(_0x375f('0x16'))['db'];function respondWithStatusCode(_0x164470,_0x5e025c){_0x5e025c=_0x5e025c||0xcc;return function(_0x2a81d0){if(_0x2a81d0){return _0x164470[_0x375f('0x17')](_0x5e025c);}return _0x164470[_0x375f('0x18')](_0x5e025c)[_0x375f('0x19')]();};}function respondWithResult(_0x43c5f0,_0x43f4a1){_0x43f4a1=_0x43f4a1||0xc8;return function(_0x2edd4c){if(_0x2edd4c){return _0x43c5f0[_0x375f('0x18')](_0x43f4a1)[_0x375f('0x1a')](_0x2edd4c);}};}function respondWithFilteredResult(_0x2fa612,_0xe11e65){return function(_0x57c6ba){if(_0x57c6ba){var _0x56f9a8=_0x57c6ba[_0x375f('0x1b')],_0x3b073f=_0xe11e65[_0x375f('0x1c')],_0x4a7c6d=_0xe11e65[_0x375f('0x1c')]+_0xe11e65['limit'],_0x209cbd;if(_0x4a7c6d>=_0x56f9a8){_0x4a7c6d=_0x56f9a8;_0x209cbd=0xc8;}else{_0x209cbd=0xce;}_0x2fa612['status'](_0x209cbd);return _0x2fa612[_0x375f('0x1d')](_0x375f('0x1e'),_0x3b073f+'-'+_0x4a7c6d+'/'+_0x56f9a8)[_0x375f('0x1a')](_0x57c6ba);}return null;};}function patchUpdates(_0x40a75d){return function(_0xb906c1){try{jsonpatch[_0x375f('0x1f')](_0xb906c1,_0x40a75d,!![]);}catch(_0x8e8df6){return BPromise[_0x375f('0x20')](_0x8e8df6);}return _0xb906c1[_0x375f('0x21')]();};}function saveUpdates(_0x3ecf3a,_0x21260c){return function(_0x302138){if(_0x302138){return _0x302138['update'](_0x3ecf3a)[_0x375f('0x22')](function(_0x36f5c5){return _0x36f5c5;});}return null;};}function removeEntity(_0x5393e9,_0x3e0512){return function(_0x48dd51){if(_0x48dd51){return _0x48dd51[_0x375f('0x23')]()[_0x375f('0x22')](function(){_0x5393e9['status'](0xcc)[_0x375f('0x19')]();});}};}function handleEntityNotFound(_0x5266a5,_0x4c3e8b){return function(_0x44df99){if(!_0x44df99){_0x5266a5[_0x375f('0x17')](0x194);}return _0x44df99;};}function handleError(_0x1daf05,_0x46a9b1){_0x46a9b1=_0x46a9b1||0x1f4;return function(_0x133954){logger['error'](_0x133954[_0x375f('0x24')]);if(_0x133954[_0x375f('0x25')]){delete _0x133954['name'];}_0x1daf05[_0x375f('0x18')](_0x46a9b1)[_0x375f('0x26')](_0x133954);};}exports[_0x375f('0x27')]=function(_0x31c714,_0x5d773b){var _0x5e49c3={},_0x1be491={},_0x275072={'count':0x0,'rows':[]};var _0x29b7f0=_[_0x375f('0x28')](db[_0x375f('0x29')]['rawAttributes'],function(_0x4b760d){return{'name':_0x4b760d[_0x375f('0x2a')],'type':_0x4b760d[_0x375f('0x2b')][_0x375f('0x2c')]};});_0x1be491['model']=_[_0x375f('0x28')](_0x29b7f0,_0x375f('0x25'));_0x1be491[_0x375f('0x2d')]=_['keys'](_0x31c714[_0x375f('0x2d')]);_0x1be491[_0x375f('0x2e')]=_[_0x375f('0x2f')](_0x1be491[_0x375f('0x30')],_0x1be491[_0x375f('0x2d')]);_0x5e49c3['attributes']=_[_0x375f('0x2f')](_0x1be491[_0x375f('0x30')],qs['fields'](_0x31c714[_0x375f('0x2d')][_0x375f('0x31')]));_0x5e49c3['attributes']=_0x5e49c3[_0x375f('0x32')][_0x375f('0x33')]?_0x5e49c3[_0x375f('0x32')]:_0x1be491[_0x375f('0x30')];if(!_0x31c714['query'][_0x375f('0x34')](_0x375f('0x35'))){_0x5e49c3[_0x375f('0x36')]=qs[_0x375f('0x36')](_0x31c714[_0x375f('0x2d')][_0x375f('0x36')]);_0x5e49c3[_0x375f('0x1c')]=qs[_0x375f('0x1c')](_0x31c714['query']['offset']);}_0x5e49c3[_0x375f('0x37')]=qs[_0x375f('0x38')](_0x31c714[_0x375f('0x2d')][_0x375f('0x38')]);_0x5e49c3[_0x375f('0x39')]=qs[_0x375f('0x2e')](_[_0x375f('0x3a')](_0x31c714[_0x375f('0x2d')],_0x1be491['filters']),_0x29b7f0);if(_0x31c714[_0x375f('0x2d')]['filter']){_0x5e49c3[_0x375f('0x39')]=_[_0x375f('0x3b')](_0x5e49c3[_0x375f('0x39')],{'$or':_['map'](_0x29b7f0,function(_0xeabb6){if(_0xeabb6[_0x375f('0x2b')]!=='VIRTUAL'){var _0x485fb9={};_0x485fb9[_0xeabb6['name']]={'$like':'%'+_0x31c714[_0x375f('0x2d')]['filter']+'%'};return _0x485fb9;}})});}_0x5e49c3=_[_0x375f('0x3b')]({},_0x5e49c3,_0x31c714[_0x375f('0x3c')]);var _0x24949c={'where':_0x5e49c3['where']};return db['MailServerOut'][_0x375f('0x1b')](_0x24949c)[_0x375f('0x22')](function(_0x1c3d12){_0x275072['count']=_0x1c3d12;if(_0x31c714[_0x375f('0x2d')]['includeAll']){_0x5e49c3['include']=[{'all':!![]}];}return db[_0x375f('0x29')][_0x375f('0x3d')](_0x5e49c3);})[_0x375f('0x22')](function(_0xeb55c3){_0x275072['rows']=_0xeb55c3;return _0x275072;})[_0x375f('0x22')](respondWithFilteredResult(_0x5d773b,_0x5e49c3))[_0x375f('0x3e')](handleError(_0x5d773b,null));};exports[_0x375f('0x3f')]=function(_0x32e89c,_0x4c3991){var _0x363267={'raw':!![],'where':{'id':_0x32e89c[_0x375f('0x40')]['id']}},_0x52b470={};_0x52b470[_0x375f('0x30')]=_[_0x375f('0x41')](db[_0x375f('0x29')][_0x375f('0x42')]);_0x52b470[_0x375f('0x2d')]=_[_0x375f('0x41')](_0x32e89c['query']);_0x52b470[_0x375f('0x2e')]=_[_0x375f('0x2f')](_0x52b470[_0x375f('0x30')],_0x52b470[_0x375f('0x2d')]);_0x363267[_0x375f('0x32')]=_[_0x375f('0x2f')](_0x52b470[_0x375f('0x30')],qs[_0x375f('0x31')](_0x32e89c[_0x375f('0x2d')][_0x375f('0x31')]));_0x363267[_0x375f('0x32')]=_0x363267[_0x375f('0x32')][_0x375f('0x33')]?_0x363267[_0x375f('0x32')]:_0x52b470[_0x375f('0x30')];if(_0x32e89c['query'][_0x375f('0x43')]){_0x363267[_0x375f('0x44')]=[{'all':!![]}];}_0x363267=_['merge']({},_0x363267,_0x32e89c[_0x375f('0x3c')]);return db['MailServerOut'][_0x375f('0x45')](_0x363267)[_0x375f('0x22')](handleEntityNotFound(_0x4c3991,null))[_0x375f('0x22')](respondWithResult(_0x4c3991,null))[_0x375f('0x3e')](handleError(_0x4c3991,null));};exports['create']=function(_0x23a46b,_0x3d6d23){return db[_0x375f('0x29')][_0x375f('0x46')](_0x23a46b['body'],{})[_0x375f('0x22')](respondWithResult(_0x3d6d23,0xc9))[_0x375f('0x3e')](handleError(_0x3d6d23,null));};exports[_0x375f('0x47')]=function(_0x1cabbc,_0x24cff4){if(_0x1cabbc[_0x375f('0x48')]['id']){delete _0x1cabbc[_0x375f('0x48')]['id'];}return db[_0x375f('0x29')][_0x375f('0x45')]({'where':{'id':_0x1cabbc['params']['id']}})[_0x375f('0x22')](handleEntityNotFound(_0x24cff4,null))[_0x375f('0x22')](saveUpdates(_0x1cabbc[_0x375f('0x48')],null))['then'](respondWithResult(_0x24cff4,null))[_0x375f('0x3e')](handleError(_0x24cff4,null));};exports[_0x375f('0x23')]=function(_0x43e797,_0x59443e){return db['MailServerOut'][_0x375f('0x45')]({'where':{'id':_0x43e797[_0x375f('0x40')]['id']}})['then'](handleEntityNotFound(_0x59443e,null))[_0x375f('0x22')](removeEntity(_0x59443e,null))['catch'](handleError(_0x59443e,null));};
\ No newline at end of file
+var _0xa287=['sort','where','filter','merge','VIRTUAL','MailServerOut','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','count','offset','limit','set','json','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit'];(function(_0x5b6e7c,_0x1d5684){var _0x10cc1d=function(_0x22a763){while(--_0x22a763){_0x5b6e7c['push'](_0x5b6e7c['shift']());}};_0x10cc1d(++_0x1d5684);}(_0xa287,0xe0));var _0x7a28=function(_0xb68695,_0x1881a4){_0xb68695=_0xb68695-0x0;var _0x15a817=_0xa287[_0xb68695];return _0x15a817;};'use strict';var pdf=require(_0x7a28('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7a28('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a28('0x2'));var moment=require(_0x7a28('0x3'));var BPromise=require(_0x7a28('0x4'));var Mustache=require(_0x7a28('0x5'));var util=require(_0x7a28('0x6'));var path=require(_0x7a28('0x7'));var sox=require(_0x7a28('0x8'));var csv=require(_0x7a28('0x9'));var ejs=require(_0x7a28('0xa'));var fs=require('fs');var _=require(_0x7a28('0xb'));var squel=require(_0x7a28('0xc'));var crypto=require(_0x7a28('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7a28('0xe'));var toCsv=require(_0x7a28('0x9'));var querystring=require(_0x7a28('0xf'));var Papa=require(_0x7a28('0x10'));var Redis=require('ioredis');var authService=require(_0x7a28('0x11'));var qs=require(_0x7a28('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a28('0x13'));var logger=require(_0x7a28('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7a28('0x15'));var db=require(_0x7a28('0x16'))['db'];function respondWithStatusCode(_0x57e161,_0x10ff5e){_0x10ff5e=_0x10ff5e||0xcc;return function(_0xf934c1){if(_0xf934c1){return _0x57e161['sendStatus'](_0x10ff5e);}return _0x57e161[_0x7a28('0x17')](_0x10ff5e)['end']();};}function respondWithResult(_0x27072e,_0x3e4b8f){_0x3e4b8f=_0x3e4b8f||0xc8;return function(_0x1a7e14){if(_0x1a7e14){return _0x27072e[_0x7a28('0x17')](_0x3e4b8f)['json'](_0x1a7e14);}};}function respondWithFilteredResult(_0x46ce87,_0x1db255){return function(_0x28c3e8){if(_0x28c3e8){var _0x5b902e=_0x28c3e8[_0x7a28('0x18')],_0x4fccd8=_0x1db255[_0x7a28('0x19')],_0x245040=_0x1db255[_0x7a28('0x19')]+_0x1db255[_0x7a28('0x1a')],_0x459b4e;if(_0x245040>=_0x5b902e){_0x245040=_0x5b902e;_0x459b4e=0xc8;}else{_0x459b4e=0xce;}_0x46ce87[_0x7a28('0x17')](_0x459b4e);return _0x46ce87[_0x7a28('0x1b')]('Content-Range',_0x4fccd8+'-'+_0x245040+'/'+_0x5b902e)[_0x7a28('0x1c')](_0x28c3e8);}return null;};}function patchUpdates(_0x16b6d5){return function(_0x2d9820){try{jsonpatch['apply'](_0x2d9820,_0x16b6d5,!![]);}catch(_0x27e2b4){return BPromise[_0x7a28('0x1d')](_0x27e2b4);}return _0x2d9820['save']();};}function saveUpdates(_0x5667ba,_0x5d7d82){return function(_0x4fcb8b){if(_0x4fcb8b){return _0x4fcb8b[_0x7a28('0x1e')](_0x5667ba)[_0x7a28('0x1f')](function(_0x5da710){return _0x5da710;});}return null;};}function removeEntity(_0x5ed6ce,_0x50290e){return function(_0x2e6006){if(_0x2e6006){return _0x2e6006[_0x7a28('0x20')]()[_0x7a28('0x1f')](function(){_0x5ed6ce[_0x7a28('0x17')](0xcc)[_0x7a28('0x21')]();});}};}function handleEntityNotFound(_0x4e72d9,_0x53e473){return function(_0x390288){if(!_0x390288){_0x4e72d9['sendStatus'](0x194);}return _0x390288;};}function handleError(_0x405342,_0x1fe67d){_0x1fe67d=_0x1fe67d||0x1f4;return function(_0x36e27d){logger[_0x7a28('0x22')](_0x36e27d[_0x7a28('0x23')]);if(_0x36e27d['name']){delete _0x36e27d[_0x7a28('0x24')];}_0x405342[_0x7a28('0x17')](_0x1fe67d)[_0x7a28('0x25')](_0x36e27d);};}exports[_0x7a28('0x26')]=function(_0x2cb329,_0x6e73b3){var _0x1c8d02={},_0x311e79={},_0x4826a9={'count':0x0,'rows':[]};var _0x10e05f=_[_0x7a28('0x27')](db['MailServerOut'][_0x7a28('0x28')],function(_0x493615){return{'name':_0x493615['fieldName'],'type':_0x493615[_0x7a28('0x29')]['key']};});_0x311e79['model']=_['map'](_0x10e05f,_0x7a28('0x24'));_0x311e79['query']=_[_0x7a28('0x2a')](_0x2cb329['query']);_0x311e79[_0x7a28('0x2b')]=_[_0x7a28('0x2c')](_0x311e79[_0x7a28('0x2d')],_0x311e79['query']);_0x1c8d02[_0x7a28('0x2e')]=_[_0x7a28('0x2c')](_0x311e79['model'],qs[_0x7a28('0x2f')](_0x2cb329[_0x7a28('0x30')][_0x7a28('0x2f')]));_0x1c8d02[_0x7a28('0x2e')]=_0x1c8d02[_0x7a28('0x2e')][_0x7a28('0x31')]?_0x1c8d02[_0x7a28('0x2e')]:_0x311e79[_0x7a28('0x2d')];if(!_0x2cb329[_0x7a28('0x30')][_0x7a28('0x32')](_0x7a28('0x33'))){_0x1c8d02['limit']=qs[_0x7a28('0x1a')](_0x2cb329[_0x7a28('0x30')]['limit']);_0x1c8d02[_0x7a28('0x19')]=qs[_0x7a28('0x19')](_0x2cb329['query'][_0x7a28('0x19')]);}_0x1c8d02['order']=qs['sort'](_0x2cb329[_0x7a28('0x30')][_0x7a28('0x34')]);_0x1c8d02[_0x7a28('0x35')]=qs['filters'](_['pick'](_0x2cb329[_0x7a28('0x30')],_0x311e79[_0x7a28('0x2b')]),_0x10e05f);if(_0x2cb329[_0x7a28('0x30')][_0x7a28('0x36')]){_0x1c8d02['where']=_[_0x7a28('0x37')](_0x1c8d02['where'],{'$or':_[_0x7a28('0x27')](_0x10e05f,function(_0x10e729){if(_0x10e729[_0x7a28('0x29')]!==_0x7a28('0x38')){var _0x1ca8d4={};_0x1ca8d4[_0x10e729[_0x7a28('0x24')]]={'$like':'%'+_0x2cb329[_0x7a28('0x30')][_0x7a28('0x36')]+'%'};return _0x1ca8d4;}})});}_0x1c8d02=_[_0x7a28('0x37')]({},_0x1c8d02,_0x2cb329['options']);var _0x4eb085={'where':_0x1c8d02[_0x7a28('0x35')]};return db[_0x7a28('0x39')]['count'](_0x4eb085)[_0x7a28('0x1f')](function(_0x435ae9){_0x4826a9[_0x7a28('0x18')]=_0x435ae9;if(_0x2cb329[_0x7a28('0x30')][_0x7a28('0x3a')]){_0x1c8d02[_0x7a28('0x3b')]=[{'all':!![]}];}return db[_0x7a28('0x39')][_0x7a28('0x3c')](_0x1c8d02);})[_0x7a28('0x1f')](function(_0x3473b1){_0x4826a9[_0x7a28('0x3d')]=_0x3473b1;return _0x4826a9;})[_0x7a28('0x1f')](respondWithFilteredResult(_0x6e73b3,_0x1c8d02))[_0x7a28('0x3e')](handleError(_0x6e73b3,null));};exports[_0x7a28('0x3f')]=function(_0x66f242,_0x17b960){var _0x39259d={'raw':!![],'where':{'id':_0x66f242[_0x7a28('0x40')]['id']}},_0x3890f8={};_0x3890f8['model']=_[_0x7a28('0x2a')](db[_0x7a28('0x39')][_0x7a28('0x28')]);_0x3890f8[_0x7a28('0x30')]=_[_0x7a28('0x2a')](_0x66f242[_0x7a28('0x30')]);_0x3890f8[_0x7a28('0x2b')]=_['intersection'](_0x3890f8[_0x7a28('0x2d')],_0x3890f8[_0x7a28('0x30')]);_0x39259d[_0x7a28('0x2e')]=_[_0x7a28('0x2c')](_0x3890f8['model'],qs[_0x7a28('0x2f')](_0x66f242[_0x7a28('0x30')][_0x7a28('0x2f')]));_0x39259d[_0x7a28('0x2e')]=_0x39259d[_0x7a28('0x2e')][_0x7a28('0x31')]?_0x39259d[_0x7a28('0x2e')]:_0x3890f8[_0x7a28('0x2d')];if(_0x66f242[_0x7a28('0x30')][_0x7a28('0x3a')]){_0x39259d[_0x7a28('0x3b')]=[{'all':!![]}];}_0x39259d=_[_0x7a28('0x37')]({},_0x39259d,_0x66f242[_0x7a28('0x41')]);return db[_0x7a28('0x39')][_0x7a28('0x42')](_0x39259d)['then'](handleEntityNotFound(_0x17b960,null))[_0x7a28('0x1f')](respondWithResult(_0x17b960,null))[_0x7a28('0x3e')](handleError(_0x17b960,null));};exports[_0x7a28('0x43')]=function(_0x14420f,_0x2932bb){return db[_0x7a28('0x39')]['create'](_0x14420f['body'],{})[_0x7a28('0x1f')](respondWithResult(_0x2932bb,0xc9))[_0x7a28('0x3e')](handleError(_0x2932bb,null));};exports[_0x7a28('0x1e')]=function(_0x59f8f0,_0x370fae){if(_0x59f8f0[_0x7a28('0x44')]['id']){delete _0x59f8f0[_0x7a28('0x44')]['id'];}return db[_0x7a28('0x39')][_0x7a28('0x42')]({'where':{'id':_0x59f8f0[_0x7a28('0x40')]['id']}})['then'](handleEntityNotFound(_0x370fae,null))['then'](saveUpdates(_0x59f8f0[_0x7a28('0x44')],null))[_0x7a28('0x1f')](respondWithResult(_0x370fae,null))[_0x7a28('0x3e')](handleError(_0x370fae,null));};exports[_0x7a28('0x20')]=function(_0x17b627,_0x1a7439){return db[_0x7a28('0x39')][_0x7a28('0x42')]({'where':{'id':_0x17b627[_0x7a28('0x40')]['id']}})[_0x7a28('0x1f')](handleEntityNotFound(_0x1a7439,null))[_0x7a28('0x1f')](removeEntity(_0x1a7439,null))[_0x7a28('0x3e')](handleError(_0x1a7439,null));};
\ No newline at end of file
index 8432554..eed877f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['path','../../config/environment','./mailServerOut.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x2b6b89,_0x172ec0){var _0x5aa6af=function(_0x19cd5e){while(--_0x19cd5e){_0x2b6b89['push'](_0x2b6b89['shift']());}};_0x5aa6af(++_0x172ec0);}(_0xdc97,0x13b));var _0x7dc9=function(_0x8c327,_0x18df3c){_0x8c327=_0x8c327-0x0;var _0x23953a=_0xdc97[_0x8c327];return _0x23953a;};'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'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xba34=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x288bb5,_0x44bcbb){var _0x500d91=function(_0x48d7f4){while(--_0x48d7f4){_0x288bb5['push'](_0x288bb5['shift']());}};_0x500d91(++_0x44bcbb);}(_0xba34,0x119));var _0x4ba3=function(_0x97085,_0x338e6d){_0x97085=_0x97085-0x0;var _0xe371c5=_0xba34[_0x97085];return _0xe371c5;};'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')]('MailServerOut',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fcb379b..40a72ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09aa=['request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','MailServerOut,\x20%s,\x20%s'];(function(_0x2759cf,_0x1bdc35){var _0x31731a=function(_0x3bd6db){while(--_0x3bd6db){_0x2759cf['push'](_0x2759cf['shift']());}};_0x31731a(++_0x1bdc35);}(_0x09aa,0x11e));var _0xa09a=function(_0x28a0e1,_0x38ecdb){_0x28a0e1=_0x28a0e1-0x0;var _0x2cfa79=_0x09aa[_0x28a0e1];return _0x2cfa79;};'use strict';var _=require(_0xa09a('0x0'));var util=require('util');var moment=require(_0xa09a('0x1'));var BPromise=require(_0xa09a('0x2'));var rs=require(_0xa09a('0x3'));var fs=require('fs');var Redis=require(_0xa09a('0x4'));var db=require(_0xa09a('0x5'))['db'];var utils=require(_0xa09a('0x6'));var logger=require(_0xa09a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa09a('0x8'));var client=jayson['client'][_0xa09a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f68e1,_0x50161e,_0x40e2f4){return new BPromise(function(_0x5a844b,_0x5a737d){return client[_0xa09a('0xa')](_0x3f68e1,_0x40e2f4)[_0xa09a('0xb')](function(_0x486931){logger[_0xa09a('0xc')](_0xa09a('0xd'),_0x50161e,_0xa09a('0xe'));logger[_0xa09a('0xf')](_0xa09a('0x10'),_0x50161e,_0xa09a('0xe'),JSON['stringify'](_0x486931));if(_0x486931['error']){if(_0x486931[_0xa09a('0x11')]['code']===0x1f4){logger[_0xa09a('0x11')]('MailServerOut,\x20%s,\x20%s',_0x50161e,_0x486931[_0xa09a('0x11')][_0xa09a('0x12')]);return _0x5a737d(_0x486931[_0xa09a('0x11')]['message']);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x50161e,_0x486931[_0xa09a('0x11')][_0xa09a('0x12')]);return _0x5a844b(_0x486931[_0xa09a('0x11')]['message']);}else{logger[_0xa09a('0xc')](_0xa09a('0xd'),_0x50161e,_0xa09a('0xe'));_0x5a844b(_0x486931[_0xa09a('0x13')][_0xa09a('0x12')]);}})['catch'](function(_0x1ff6d9){logger['error'](_0xa09a('0xd'),_0x50161e,_0x1ff6d9);_0x5a737d(_0x1ff6d9);});});}
\ No newline at end of file
+var _0x307e=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x37a7c1,_0x5cd0ee){var _0x4e30e8=function(_0x252c3d){while(--_0x252c3d){_0x37a7c1['push'](_0x37a7c1['shift']());}};_0x4e30e8(++_0x5cd0ee);}(_0x307e,0x1b2));var _0xe307=function(_0x55891b,_0x32569){_0x55891b=_0x55891b-0x0;var _0x28741e=_0x307e[_0x55891b];return _0x28741e;};'use strict';var _=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var moment=require('moment');var BPromise=require(_0xe307('0x2'));var rs=require(_0xe307('0x3'));var fs=require('fs');var Redis=require(_0xe307('0x4'));var db=require(_0xe307('0x5'))['db'];var utils=require(_0xe307('0x6'));var logger=require(_0xe307('0x7'))('rpc');var config=require(_0xe307('0x8'));var jayson=require(_0xe307('0x9'));var client=jayson[_0xe307('0xa')][_0xe307('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x126968,_0x1949c4,_0x38ef30){return new BPromise(function(_0x29b679,_0x9543e6){return client['request'](_0x126968,_0x38ef30)['then'](function(_0xbacd07){logger[_0xe307('0xc')](_0xe307('0xd'),_0x1949c4,_0xe307('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0x1949c4,'request\x20sent',JSON[_0xe307('0xf')](_0xbacd07));if(_0xbacd07['error']){if(_0xbacd07[_0xe307('0x10')][_0xe307('0x11')]===0x1f4){logger[_0xe307('0x10')](_0xe307('0xd'),_0x1949c4,_0xbacd07[_0xe307('0x10')][_0xe307('0x12')]);return _0x9543e6(_0xbacd07[_0xe307('0x10')]['message']);}logger[_0xe307('0x10')](_0xe307('0xd'),_0x1949c4,_0xbacd07[_0xe307('0x10')][_0xe307('0x12')]);return _0x29b679(_0xbacd07[_0xe307('0x10')][_0xe307('0x12')]);}else{logger[_0xe307('0xc')](_0xe307('0xd'),_0x1949c4,_0xe307('0xe'));_0x29b679(_0xbacd07['result'][_0xe307('0x12')]);}})[_0xe307('0x13')](function(_0x56e48f){logger[_0xe307('0x10')]('MailServerOut,\x20%s,\x20%s',_0x1949c4,_0x56e48f);_0x9543e6(_0x56e48f);});});}
\ No newline at end of file
index e0ec9a3..64987e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46be=['/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index'];(function(_0xf22e8a,_0x1a1437){var _0x1acf3e=function(_0x254a32){while(--_0x254a32){_0xf22e8a['push'](_0xf22e8a['shift']());}};_0x1acf3e(++_0x1a1437);}(_0x46be,0xe5));var _0xe46b=function(_0x470a31,_0x5d9949){_0x470a31=_0x470a31-0x0;var _0x4d9380=_0x46be[_0x470a31];return _0x4d9380;};'use strict';var multer=require(_0xe46b('0x0'));var util=require(_0xe46b('0x1'));var path=require(_0xe46b('0x2'));var timeout=require(_0xe46b('0x3'));var express=require('express');var router=express[_0xe46b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe46b('0x5'));var config=require(_0xe46b('0x6'));var controller=require(_0xe46b('0x7'));router[_0xe46b('0x8')]('/',auth[_0xe46b('0x9')](),controller[_0xe46b('0xa')]);router[_0xe46b('0x8')](_0xe46b('0xb'),auth[_0xe46b('0x9')](),controller[_0xe46b('0xc')]);router[_0xe46b('0x8')](_0xe46b('0xd'),auth['isAuthenticated'](),controller[_0xe46b('0xe')]);router[_0xe46b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe46b('0xd'),auth[_0xe46b('0x9')](),controller[_0xe46b('0x10')]);router[_0xe46b('0x11')]('/:id',auth[_0xe46b('0x9')](),controller[_0xe46b('0x12')]);module[_0xe46b('0x13')]=router;
\ No newline at end of file
+var _0x7005=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','create','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x4d23f3,_0x59b5f7){var _0x261d33=function(_0x29bd94){while(--_0x29bd94){_0x4d23f3['push'](_0x4d23f3['shift']());}};_0x261d33(++_0x59b5f7);}(_0x7005,0x1a4));var _0x5700=function(_0xc987f2,_0x74b22e){_0xc987f2=_0xc987f2-0x0;var _0x325bb4=_0x7005[_0xc987f2];return _0x325bb4;};'use strict';var multer=require(_0x5700('0x0'));var util=require('util');var path=require(_0x5700('0x1'));var timeout=require(_0x5700('0x2'));var express=require(_0x5700('0x3'));var router=express[_0x5700('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5700('0x5'));var config=require(_0x5700('0x6'));var controller=require('./mailSubstatus.controller');router[_0x5700('0x7')]('/',auth[_0x5700('0x8')](),controller[_0x5700('0x9')]);router[_0x5700('0x7')](_0x5700('0xa'),auth[_0x5700('0x8')](),controller['describe']);router[_0x5700('0x7')]('/:id',auth[_0x5700('0x8')](),controller[_0x5700('0xb')]);router['post']('/',auth[_0x5700('0x8')](),controller[_0x5700('0xc')]);router['put'](_0x5700('0xd'),auth[_0x5700('0x8')](),controller[_0x5700('0xe')]);router['delete'](_0x5700('0xd'),auth['isAuthenticated'](),controller[_0x5700('0xf')]);module[_0x5700('0x10')]=router;
\ No newline at end of file
index 79034f3..d2979c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf643=['STRING','name','sequelize','exports'];(function(_0x3db1e2,_0x59c12d){var _0x174413=function(_0x471a6e){while(--_0x471a6e){_0x3db1e2['push'](_0x3db1e2['shift']());}};_0x174413(++_0x59c12d);}(_0xf643,0x122));var _0x3f64=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0xf643[_0x496333];return _0x44256e;};'use strict';var Sequelize=require(_0x3f64('0x0'));module[_0x3f64('0x1')]={'name':{'type':Sequelize[_0x3f64('0x2')],'unique':_0x3f64('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe953=['sequelize','exports','STRING'];(function(_0x1450df,_0x5e6e59){var _0x37b90b=function(_0x4ad5fa){while(--_0x4ad5fa){_0x1450df['push'](_0x1450df['shift']());}};_0x37b90b(++_0x5e6e59);}(_0xe953,0xf9));var _0x3e95=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xe953[_0x2a5099];return _0x2802f1;};'use strict';var Sequelize=require(_0x3e95('0x0'));module[_0x3e95('0x1')]={'name':{'type':Sequelize[_0x3e95('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3e95('0x2')]}};
\ No newline at end of file
index 0a6b1ad..f6bac8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2105=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','intersection','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x588fe2,_0x102fc1){var _0x27972b=function(_0x402dc5){while(--_0x402dc5){_0x588fe2['push'](_0x588fe2['shift']());}};_0x27972b(++_0x102fc1);}(_0x2105,0x174));var _0x5210=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x2105[_0xa148b7];return _0x51efd3;};'use strict';var pdf=require(_0x5210('0x0'));var emlformat=require(_0x5210('0x1'));var rimraf=require(_0x5210('0x2'));var zipdir=require(_0x5210('0x3'));var jsonpatch=require(_0x5210('0x4'));var rp=require(_0x5210('0x5'));var moment=require(_0x5210('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5210('0x7'));var util=require(_0x5210('0x8'));var path=require(_0x5210('0x9'));var sox=require(_0x5210('0xa'));var csv=require(_0x5210('0xb'));var ejs=require(_0x5210('0xc'));var fs=require('fs');var _=require(_0x5210('0xd'));var squel=require(_0x5210('0xe'));var crypto=require(_0x5210('0xf'));var jsforce=require(_0x5210('0x10'));var deskjs=require(_0x5210('0x11'));var toCsv=require(_0x5210('0xb'));var querystring=require(_0x5210('0x12'));var Papa=require(_0x5210('0x13'));var Redis=require('ioredis');var authService=require(_0x5210('0x14'));var qs=require(_0x5210('0x15'));var as=require(_0x5210('0x16'));var hardwareService=require(_0x5210('0x17'));var logger=require(_0x5210('0x18'))('api');var utils=require(_0x5210('0x19'));var config=require(_0x5210('0x1a'));var db=require(_0x5210('0x1b'))['db'];function respondWithStatusCode(_0x545313,_0x583ec7){_0x583ec7=_0x583ec7||0xcc;return function(_0x4bbbd8){if(_0x4bbbd8){return _0x545313[_0x5210('0x1c')](_0x583ec7);}return _0x545313[_0x5210('0x1d')](_0x583ec7)[_0x5210('0x1e')]();};}function respondWithResult(_0x33ed4e,_0x27dd5e){_0x27dd5e=_0x27dd5e||0xc8;return function(_0x1fab8a){if(_0x1fab8a){return _0x33ed4e['status'](_0x27dd5e)[_0x5210('0x1f')](_0x1fab8a);}};}function respondWithFilteredResult(_0x29f922,_0x17beaf){return function(_0x11470a){if(_0x11470a){var _0x450c09=_0x11470a[_0x5210('0x20')],_0x50e571=_0x17beaf['offset'],_0x4dda38=_0x17beaf[_0x5210('0x21')]+_0x17beaf[_0x5210('0x22')],_0x50c414;if(_0x4dda38>=_0x450c09){_0x4dda38=_0x450c09;_0x50c414=0xc8;}else{_0x50c414=0xce;}_0x29f922['status'](_0x50c414);return _0x29f922[_0x5210('0x23')](_0x5210('0x24'),_0x50e571+'-'+_0x4dda38+'/'+_0x450c09)[_0x5210('0x1f')](_0x11470a);}return null;};}function patchUpdates(_0x209db7){return function(_0x50580d){try{jsonpatch['apply'](_0x50580d,_0x209db7,!![]);}catch(_0x285624){return BPromise[_0x5210('0x25')](_0x285624);}return _0x50580d[_0x5210('0x26')]();};}function saveUpdates(_0x4d2f88,_0x4de57a){return function(_0x4d4ef6){if(_0x4d4ef6){return _0x4d4ef6[_0x5210('0x27')](_0x4d2f88)[_0x5210('0x28')](function(_0x102d2b){return _0x102d2b;});}return null;};}function removeEntity(_0x2a7c42,_0x4759e9){return function(_0xf1f3b0){if(_0xf1f3b0){return _0xf1f3b0[_0x5210('0x29')]()[_0x5210('0x28')](function(){_0x2a7c42['status'](0xcc)[_0x5210('0x1e')]();});}};}function handleEntityNotFound(_0x39063a,_0x43d10c){return function(_0x1d9e2d){if(!_0x1d9e2d){_0x39063a[_0x5210('0x1c')](0x194);}return _0x1d9e2d;};}function handleError(_0xeb97bf,_0xb2d3ca){_0xb2d3ca=_0xb2d3ca||0x1f4;return function(_0x3b9459){logger[_0x5210('0x2a')](_0x3b9459['stack']);if(_0x3b9459['name']){delete _0x3b9459[_0x5210('0x2b')];}_0xeb97bf['status'](_0xb2d3ca)['send'](_0x3b9459);};}exports[_0x5210('0x2c')]=function(_0x3580e5,_0x12e760){var _0xe26cc3={},_0xf0cbac={},_0x1f8b41={'count':0x0,'rows':[]};var _0x26e63a=_[_0x5210('0x2d')](db[_0x5210('0x2e')][_0x5210('0x2f')],function(_0x42af7e){return{'name':_0x42af7e[_0x5210('0x30')],'type':_0x42af7e[_0x5210('0x31')][_0x5210('0x32')]};});_0xf0cbac[_0x5210('0x33')]=_['map'](_0x26e63a,'name');_0xf0cbac[_0x5210('0x34')]=_['keys'](_0x3580e5[_0x5210('0x34')]);_0xf0cbac[_0x5210('0x35')]=_['intersection'](_0xf0cbac['model'],_0xf0cbac[_0x5210('0x34')]);_0xe26cc3[_0x5210('0x36')]=_['intersection'](_0xf0cbac[_0x5210('0x33')],qs[_0x5210('0x37')](_0x3580e5[_0x5210('0x34')][_0x5210('0x37')]));_0xe26cc3[_0x5210('0x36')]=_0xe26cc3['attributes'][_0x5210('0x38')]?_0xe26cc3[_0x5210('0x36')]:_0xf0cbac[_0x5210('0x33')];if(!_0x3580e5[_0x5210('0x34')][_0x5210('0x39')](_0x5210('0x3a'))){_0xe26cc3[_0x5210('0x22')]=qs[_0x5210('0x22')](_0x3580e5[_0x5210('0x34')][_0x5210('0x22')]);_0xe26cc3[_0x5210('0x21')]=qs[_0x5210('0x21')](_0x3580e5[_0x5210('0x34')]['offset']);}_0xe26cc3[_0x5210('0x3b')]=qs[_0x5210('0x3c')](_0x3580e5[_0x5210('0x34')][_0x5210('0x3c')]);_0xe26cc3[_0x5210('0x3d')]=qs[_0x5210('0x35')](_[_0x5210('0x3e')](_0x3580e5['query'],_0xf0cbac['filters']),_0x26e63a);if(_0x3580e5[_0x5210('0x34')][_0x5210('0x3f')]){_0xe26cc3[_0x5210('0x3d')]=_[_0x5210('0x40')](_0xe26cc3[_0x5210('0x3d')],{'$or':_[_0x5210('0x2d')](_0x26e63a,function(_0x296de9){if(_0x296de9[_0x5210('0x31')]!==_0x5210('0x41')){var _0x3db244={};_0x3db244[_0x296de9[_0x5210('0x2b')]]={'$like':'%'+_0x3580e5[_0x5210('0x34')][_0x5210('0x3f')]+'%'};return _0x3db244;}})});}_0xe26cc3=_[_0x5210('0x40')]({},_0xe26cc3,_0x3580e5[_0x5210('0x42')]);var _0x5d550a={'where':_0xe26cc3[_0x5210('0x3d')]};return db[_0x5210('0x2e')][_0x5210('0x20')](_0x5d550a)[_0x5210('0x28')](function(_0x403d96){_0x1f8b41[_0x5210('0x20')]=_0x403d96;if(_0x3580e5[_0x5210('0x34')][_0x5210('0x43')]){_0xe26cc3[_0x5210('0x44')]=[{'all':!![]}];}return db[_0x5210('0x2e')]['findAll'](_0xe26cc3);})['then'](function(_0x199ba9){_0x1f8b41[_0x5210('0x45')]=_0x199ba9;return _0x1f8b41;})[_0x5210('0x28')](respondWithFilteredResult(_0x12e760,_0xe26cc3))[_0x5210('0x46')](handleError(_0x12e760,null));};exports[_0x5210('0x47')]=function(_0x1d1c03,_0x583f71){var _0x1696e2={'raw':!![],'where':{'id':_0x1d1c03['params']['id']}},_0x43a701={};_0x43a701[_0x5210('0x33')]=_[_0x5210('0x48')](db['MailSubstatus']['rawAttributes']);_0x43a701[_0x5210('0x34')]=_['keys'](_0x1d1c03['query']);_0x43a701[_0x5210('0x35')]=_['intersection'](_0x43a701[_0x5210('0x33')],_0x43a701[_0x5210('0x34')]);_0x1696e2[_0x5210('0x36')]=_[_0x5210('0x49')](_0x43a701[_0x5210('0x33')],qs[_0x5210('0x37')](_0x1d1c03[_0x5210('0x34')][_0x5210('0x37')]));_0x1696e2['attributes']=_0x1696e2[_0x5210('0x36')]['length']?_0x1696e2['attributes']:_0x43a701[_0x5210('0x33')];if(_0x1d1c03[_0x5210('0x34')]['includeAll']){_0x1696e2[_0x5210('0x44')]=[{'all':!![]}];}_0x1696e2=_[_0x5210('0x40')]({},_0x1696e2,_0x1d1c03[_0x5210('0x42')]);return db['MailSubstatus'][_0x5210('0x4a')](_0x1696e2)['then'](handleEntityNotFound(_0x583f71,null))[_0x5210('0x28')](respondWithResult(_0x583f71,null))[_0x5210('0x46')](handleError(_0x583f71,null));};exports[_0x5210('0x4b')]=function(_0x4aba8c,_0x19f64a){return db[_0x5210('0x2e')][_0x5210('0x4b')](_0x4aba8c[_0x5210('0x4c')],{})[_0x5210('0x28')](respondWithResult(_0x19f64a,0xc9))[_0x5210('0x46')](handleError(_0x19f64a,null));};exports[_0x5210('0x27')]=function(_0x31a1f7,_0x196efe){if(_0x31a1f7[_0x5210('0x4c')]['id']){delete _0x31a1f7[_0x5210('0x4c')]['id'];}return db['MailSubstatus'][_0x5210('0x4a')]({'where':{'id':_0x31a1f7[_0x5210('0x4d')]['id']}})[_0x5210('0x28')](handleEntityNotFound(_0x196efe,null))[_0x5210('0x28')](saveUpdates(_0x31a1f7[_0x5210('0x4c')],null))['then'](respondWithResult(_0x196efe,null))[_0x5210('0x46')](handleError(_0x196efe,null));};exports[_0x5210('0x29')]=function(_0x3fcbfc,_0x292b50){return db[_0x5210('0x2e')][_0x5210('0x4a')]({'where':{'id':_0x3fcbfc[_0x5210('0x4d')]['id']}})[_0x5210('0x28')](handleEntityNotFound(_0x292b50,null))[_0x5210('0x28')](removeEntity(_0x292b50,null))[_0x5210('0x46')](handleError(_0x292b50,null));};exports[_0x5210('0x4e')]=function(_0x273cc3,_0x5a5d15){return db[_0x5210('0x2e')][_0x5210('0x4e')]()[_0x5210('0x28')](respondWithResult(_0x5a5d15,null))[_0x5210('0x46')](handleError(_0x5a5d15,null));};
\ No newline at end of file
+var _0x253f=['json','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status'];(function(_0xe14412,_0x2f9d9d){var _0x287bcf=function(_0x514ec2){while(--_0x514ec2){_0xe14412['push'](_0xe14412['shift']());}};_0x287bcf(++_0x2f9d9d);}(_0x253f,0x154));var _0xf253=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x253f[_0x122096];return _0x3d1966;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf253('0x0'));var zipdir=require(_0xf253('0x1'));var jsonpatch=require(_0xf253('0x2'));var rp=require(_0xf253('0x3'));var moment=require(_0xf253('0x4'));var BPromise=require(_0xf253('0x5'));var Mustache=require(_0xf253('0x6'));var util=require(_0xf253('0x7'));var path=require(_0xf253('0x8'));var sox=require(_0xf253('0x9'));var csv=require(_0xf253('0xa'));var ejs=require(_0xf253('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf253('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf253('0xd'));var Redis=require(_0xf253('0xe'));var authService=require(_0xf253('0xf'));var qs=require(_0xf253('0x10'));var as=require(_0xf253('0x11'));var hardwareService=require(_0xf253('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf253('0x13'));var config=require(_0xf253('0x14'));var db=require(_0xf253('0x15'))['db'];function respondWithStatusCode(_0x50e22c,_0x4b37e6){_0x4b37e6=_0x4b37e6||0xcc;return function(_0x55df3d){if(_0x55df3d){return _0x50e22c[_0xf253('0x16')](_0x4b37e6);}return _0x50e22c['status'](_0x4b37e6)[_0xf253('0x17')]();};}function respondWithResult(_0x5f56eb,_0x4f25ff){_0x4f25ff=_0x4f25ff||0xc8;return function(_0x27d4cb){if(_0x27d4cb){return _0x5f56eb[_0xf253('0x18')](_0x4f25ff)[_0xf253('0x19')](_0x27d4cb);}};}function respondWithFilteredResult(_0x556ea8,_0x1ad066){return function(_0x12a0f3){if(_0x12a0f3){var _0x38ba5e=_0x12a0f3[_0xf253('0x1a')],_0x3f62fb=_0x1ad066['offset'],_0x739447=_0x1ad066['offset']+_0x1ad066['limit'],_0x21910f;if(_0x739447>=_0x38ba5e){_0x739447=_0x38ba5e;_0x21910f=0xc8;}else{_0x21910f=0xce;}_0x556ea8[_0xf253('0x18')](_0x21910f);return _0x556ea8[_0xf253('0x1b')](_0xf253('0x1c'),_0x3f62fb+'-'+_0x739447+'/'+_0x38ba5e)['json'](_0x12a0f3);}return null;};}function patchUpdates(_0x1e996f){return function(_0x4dc9d7){try{jsonpatch[_0xf253('0x1d')](_0x4dc9d7,_0x1e996f,!![]);}catch(_0x38967c){return BPromise['reject'](_0x38967c);}return _0x4dc9d7[_0xf253('0x1e')]();};}function saveUpdates(_0x5470fc,_0xd67d98){return function(_0xefedc1){if(_0xefedc1){return _0xefedc1[_0xf253('0x1f')](_0x5470fc)[_0xf253('0x20')](function(_0x2b84db){return _0x2b84db;});}return null;};}function removeEntity(_0x39eeb1,_0x5eb21a){return function(_0x381519){if(_0x381519){return _0x381519[_0xf253('0x21')]()['then'](function(){_0x39eeb1[_0xf253('0x18')](0xcc)[_0xf253('0x17')]();});}};}function handleEntityNotFound(_0xd7d2bf,_0x549ebc){return function(_0x40b7d8){if(!_0x40b7d8){_0xd7d2bf[_0xf253('0x16')](0x194);}return _0x40b7d8;};}function handleError(_0x3f872e,_0xc680b){_0xc680b=_0xc680b||0x1f4;return function(_0x58546e){logger[_0xf253('0x22')](_0x58546e['stack']);if(_0x58546e['name']){delete _0x58546e[_0xf253('0x23')];}_0x3f872e[_0xf253('0x18')](_0xc680b)[_0xf253('0x24')](_0x58546e);};}exports[_0xf253('0x25')]=function(_0x1a4bb2,_0x59e8b0){var _0x121727={},_0x465223={},_0x17dc8f={'count':0x0,'rows':[]};var _0x187bed=_[_0xf253('0x26')](db[_0xf253('0x27')][_0xf253('0x28')],function(_0x148494){return{'name':_0x148494[_0xf253('0x29')],'type':_0x148494[_0xf253('0x2a')][_0xf253('0x2b')]};});_0x465223[_0xf253('0x2c')]=_[_0xf253('0x26')](_0x187bed,_0xf253('0x23'));_0x465223['query']=_[_0xf253('0x2d')](_0x1a4bb2['query']);_0x465223[_0xf253('0x2e')]=_[_0xf253('0x2f')](_0x465223[_0xf253('0x2c')],_0x465223[_0xf253('0x30')]);_0x121727['attributes']=_[_0xf253('0x2f')](_0x465223[_0xf253('0x2c')],qs[_0xf253('0x31')](_0x1a4bb2['query'][_0xf253('0x31')]));_0x121727[_0xf253('0x32')]=_0x121727[_0xf253('0x32')][_0xf253('0x33')]?_0x121727[_0xf253('0x32')]:_0x465223[_0xf253('0x2c')];if(!_0x1a4bb2[_0xf253('0x30')][_0xf253('0x34')](_0xf253('0x35'))){_0x121727[_0xf253('0x36')]=qs[_0xf253('0x36')](_0x1a4bb2[_0xf253('0x30')][_0xf253('0x36')]);_0x121727[_0xf253('0x37')]=qs[_0xf253('0x37')](_0x1a4bb2[_0xf253('0x30')][_0xf253('0x37')]);}_0x121727[_0xf253('0x38')]=qs[_0xf253('0x39')](_0x1a4bb2['query']['sort']);_0x121727[_0xf253('0x3a')]=qs[_0xf253('0x2e')](_['pick'](_0x1a4bb2['query'],_0x465223[_0xf253('0x2e')]),_0x187bed);if(_0x1a4bb2[_0xf253('0x30')][_0xf253('0x3b')]){_0x121727[_0xf253('0x3a')]=_['merge'](_0x121727[_0xf253('0x3a')],{'$or':_[_0xf253('0x26')](_0x187bed,function(_0x3dab9d){if(_0x3dab9d[_0xf253('0x2a')]!==_0xf253('0x3c')){var _0xbdf092={};_0xbdf092[_0x3dab9d['name']]={'$like':'%'+_0x1a4bb2['query'][_0xf253('0x3b')]+'%'};return _0xbdf092;}})});}_0x121727=_[_0xf253('0x3d')]({},_0x121727,_0x1a4bb2[_0xf253('0x3e')]);var _0x533888={'where':_0x121727[_0xf253('0x3a')]};return db[_0xf253('0x27')][_0xf253('0x1a')](_0x533888)[_0xf253('0x20')](function(_0x597a71){_0x17dc8f[_0xf253('0x1a')]=_0x597a71;if(_0x1a4bb2[_0xf253('0x30')][_0xf253('0x3f')]){_0x121727[_0xf253('0x40')]=[{'all':!![]}];}return db[_0xf253('0x27')][_0xf253('0x41')](_0x121727);})[_0xf253('0x20')](function(_0x4b704f){_0x17dc8f[_0xf253('0x42')]=_0x4b704f;return _0x17dc8f;})['then'](respondWithFilteredResult(_0x59e8b0,_0x121727))[_0xf253('0x43')](handleError(_0x59e8b0,null));};exports['show']=function(_0x18ff50,_0x50a4e3){var _0x14c061={'raw':!![],'where':{'id':_0x18ff50[_0xf253('0x44')]['id']}},_0x5c39ba={};_0x5c39ba['model']=_[_0xf253('0x2d')](db[_0xf253('0x27')][_0xf253('0x28')]);_0x5c39ba[_0xf253('0x30')]=_[_0xf253('0x2d')](_0x18ff50[_0xf253('0x30')]);_0x5c39ba[_0xf253('0x2e')]=_[_0xf253('0x2f')](_0x5c39ba[_0xf253('0x2c')],_0x5c39ba[_0xf253('0x30')]);_0x14c061['attributes']=_['intersection'](_0x5c39ba[_0xf253('0x2c')],qs['fields'](_0x18ff50[_0xf253('0x30')]['fields']));_0x14c061[_0xf253('0x32')]=_0x14c061[_0xf253('0x32')]['length']?_0x14c061[_0xf253('0x32')]:_0x5c39ba[_0xf253('0x2c')];if(_0x18ff50[_0xf253('0x30')]['includeAll']){_0x14c061[_0xf253('0x40')]=[{'all':!![]}];}_0x14c061=_[_0xf253('0x3d')]({},_0x14c061,_0x18ff50[_0xf253('0x3e')]);return db['MailSubstatus'][_0xf253('0x45')](_0x14c061)[_0xf253('0x20')](handleEntityNotFound(_0x50a4e3,null))[_0xf253('0x20')](respondWithResult(_0x50a4e3,null))[_0xf253('0x43')](handleError(_0x50a4e3,null));};exports[_0xf253('0x46')]=function(_0x412e36,_0x22d68c){return db[_0xf253('0x27')][_0xf253('0x46')](_0x412e36[_0xf253('0x47')],{})[_0xf253('0x20')](respondWithResult(_0x22d68c,0xc9))[_0xf253('0x43')](handleError(_0x22d68c,null));};exports[_0xf253('0x1f')]=function(_0x3f269d,_0x3641dd){if(_0x3f269d[_0xf253('0x47')]['id']){delete _0x3f269d[_0xf253('0x47')]['id'];}return db[_0xf253('0x27')]['find']({'where':{'id':_0x3f269d['params']['id']}})[_0xf253('0x20')](handleEntityNotFound(_0x3641dd,null))[_0xf253('0x20')](saveUpdates(_0x3f269d[_0xf253('0x47')],null))[_0xf253('0x20')](respondWithResult(_0x3641dd,null))[_0xf253('0x43')](handleError(_0x3641dd,null));};exports[_0xf253('0x21')]=function(_0x5f1a08,_0x7f25bf){return db[_0xf253('0x27')][_0xf253('0x45')]({'where':{'id':_0x5f1a08['params']['id']}})['then'](handleEntityNotFound(_0x7f25bf,null))[_0xf253('0x20')](removeEntity(_0x7f25bf,null))['catch'](handleError(_0x7f25bf,null));};exports[_0xf253('0x48')]=function(_0x2ee3a7,_0x25119b){return db['MailSubstatus'][_0xf253('0x48')]()[_0xf253('0x20')](respondWithResult(_0x25119b,null))[_0xf253('0x43')](handleError(_0x25119b,null));};
\ No newline at end of file
index 29dc56a..3faa973 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa32b=['path','../../config/environment','./mailSubstatus.attributes','exports','MailSubstatus','lodash','../../config/logger','bluebird','request-promise'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa32b,0x68));var _0xba32=function(_0x3ae34a,_0x143082){_0x3ae34a=_0x3ae34a-0x0;var _0x4c9edc=_0xa32b[_0x3ae34a];return _0x4c9edc;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var logger=require(_0xba32('0x1'))('api');var moment=require('moment');var BPromise=require(_0xba32('0x2'));var rp=require(_0xba32('0x3'));var fs=require('fs');var path=require(_0xba32('0x4'));var rimraf=require('rimraf');var config=require(_0xba32('0x5'));var attributes=require(_0xba32('0x6'));module[_0xba32('0x7')]=function(_0x312fe7,_0x31dc74){return _0x312fe7['define'](_0xba32('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d04=['../../config/environment','./mailSubstatus.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x23eef6,_0x476f63){var _0x45b0dd=function(_0x578260){while(--_0x578260){_0x23eef6['push'](_0x23eef6['shift']());}};_0x45b0dd(++_0x476f63);}(_0x3d04,0xbe));var _0x43d0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3d04[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));module[_0x43d0('0xa')]=function(_0x617bf,_0x5e284f){return _0x617bf['define']('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a069d8..267e65c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird'];(function(_0x1ca688,_0x2fd10c){var _0x4ff46b=function(_0xa6e1a6){while(--_0xa6e1a6){_0x1ca688['push'](_0x1ca688['shift']());}};_0x4ff46b(++_0x2fd10c);}(_0xb58b,0x1f1));var _0xbb58=function(_0x370c1a,_0x444e6f){_0x370c1a=_0x370c1a-0x0;var _0xb4f5e9=_0xb58b[_0x370c1a];return _0xb4f5e9;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cbda,_0x323066,_0xe874f2){return new BPromise(function(_0x5d7fe8,_0xd94f1){return client[_0xbb58('0x9')](_0x27cbda,_0xe874f2)[_0xbb58('0xa')](function(_0x36ca50){logger[_0xbb58('0xb')](_0xbb58('0xc'),_0x323066,_0xbb58('0xd'));logger['debug'](_0xbb58('0xe'),_0x323066,'request\x20sent',JSON[_0xbb58('0xf')](_0x36ca50));if(_0x36ca50[_0xbb58('0x10')]){if(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x11')]===0x1f4){logger['error'](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0xd94f1(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}logger[_0xbb58('0x10')](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0x5d7fe8(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x323066,_0xbb58('0xd'));_0x5d7fe8(_0x36ca50[_0xbb58('0x13')][_0xbb58('0x12')]);}})['catch'](function(_0x5edc97){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x323066,_0x5edc97);_0xd94f1(_0x5edc97);});});}
\ No newline at end of file
+var _0xa75b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x120791,_0x2186d8){var _0x244e62=function(_0x17e248){while(--_0x17e248){_0x120791['push'](_0x120791['shift']());}};_0x244e62(++_0x2186d8);}(_0xa75b,0x170));var _0xba75=function(_0x2456cf,_0x50da4b){_0x2456cf=_0x2456cf-0x0;var _0x969445=_0xa75b[_0x2456cf];return _0x969445;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238a33,_0x3ccab5,_0x5c79e3){return new BPromise(function(_0x4b842d,_0x731cae){return client['request'](_0x238a33,_0x5c79e3)['then'](function(_0x218dbd){logger['info'](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));logger[_0xba75('0xe')](_0xba75('0xf'),_0x3ccab5,_0xba75('0xd'),JSON[_0xba75('0x10')](_0x218dbd));if(_0x218dbd[_0xba75('0x11')]){if(_0x218dbd[_0xba75('0x11')][_0xba75('0x12')]===0x1f4){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')]['message']);return _0x731cae(_0x218dbd['error'][_0xba75('0x13')]);}logger['error'](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')][_0xba75('0x13')]);return _0x4b842d(_0x218dbd[_0xba75('0x11')]['message']);}else{logger[_0xba75('0x14')](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));_0x4b842d(_0x218dbd[_0xba75('0x15')][_0xba75('0x13')]);}})['catch'](function(_0x350a9d){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x350a9d);_0x731cae(_0x350a9d);});});}
\ No newline at end of file
index be0b73f..8187231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccbd=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','create','put','/:id','update'];(function(_0x4c1cc8,_0x5347d6){var _0xaecb2a=function(_0x21ed92){while(--_0x21ed92){_0x4c1cc8['push'](_0x4c1cc8['shift']());}};_0xaecb2a(++_0x5347d6);}(_0xccbd,0x11a));var _0xdccb=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xccbd[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xdccb('0x0'));var util=require(_0xdccb('0x1'));var path=require(_0xdccb('0x2'));var timeout=require(_0xdccb('0x3'));var express=require(_0xdccb('0x4'));var router=express[_0xdccb('0x5')]();var auth=require(_0xdccb('0x6'));var interaction=require(_0xdccb('0x7'));var config=require(_0xdccb('0x8'));var controller=require(_0xdccb('0x9'));router[_0xdccb('0xa')]('/',auth[_0xdccb('0xb')](),controller[_0xdccb('0xc')]);router[_0xdccb('0xa')](_0xdccb('0xd'),auth[_0xdccb('0xb')](),controller['describe']);router['get']('/:id',auth[_0xdccb('0xb')](),controller['show']);router['post']('/',auth[_0xdccb('0xb')](),controller[_0xdccb('0xe')]);router[_0xdccb('0xf')](_0xdccb('0x10'),auth['isAuthenticated'](),controller[_0xdccb('0x11')]);router[_0xdccb('0x12')]('/:id',auth[_0xdccb('0xb')](),controller['destroy']);module[_0xdccb('0x13')]=router;
\ No newline at end of file
+var _0x73da=['exports','multer','path','connect-timeout','express','Router','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0xe46db8,_0x4d7ced){var _0x46cdbd=function(_0x12c3c9){while(--_0x12c3c9){_0xe46db8['push'](_0xe46db8['shift']());}};_0x46cdbd(++_0x4d7ced);}(_0x73da,0x78));var _0xa73d=function(_0x5e06c3,_0x154aa1){_0x5e06c3=_0x5e06c3-0x0;var _0xd287dd=_0x73da[_0x5e06c3];return _0xd287dd;};'use strict';var multer=require(_0xa73d('0x0'));var util=require('util');var path=require(_0xa73d('0x1'));var timeout=require(_0xa73d('0x2'));var express=require(_0xa73d('0x3'));var router=express[_0xa73d('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa73d('0x5'));var controller=require(_0xa73d('0x6'));router[_0xa73d('0x7')]('/',auth[_0xa73d('0x8')](),controller['index']);router[_0xa73d('0x7')]('/describe',auth[_0xa73d('0x8')](),controller['describe']);router[_0xa73d('0x7')](_0xa73d('0x9'),auth[_0xa73d('0x8')](),controller[_0xa73d('0xa')]);router[_0xa73d('0xb')]('/',auth[_0xa73d('0x8')](),controller[_0xa73d('0xc')]);router['put'](_0xa73d('0x9'),auth['isAuthenticated'](),controller[_0xa73d('0xd')]);router[_0xa73d('0xe')](_0xa73d('0x9'),auth[_0xa73d('0x8')](),controller[_0xa73d('0xf')]);module[_0xa73d('0x10')]=router;
\ No newline at end of file
index 71973ec..48a31f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a1f=['queue','DATE','NOW','moment','exports','ENUM','agent'];(function(_0x55fdce,_0x1d0cad){var _0x726856=function(_0x942b35){while(--_0x942b35){_0x55fdce['push'](_0x55fdce['shift']());}};_0x726856(++_0x1d0cad);}(_0x1a1f,0xc7));var _0xf1a1=function(_0xea5f17,_0xc789cd){_0xea5f17=_0xea5f17-0x0;var _0x307e31=_0x1a1f[_0xea5f17];return _0x307e31;};'use strict';var moment=require(_0xf1a1('0x0'));var Sequelize=require('sequelize');module[_0xf1a1('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf1a1('0x2')]('account',_0xf1a1('0x3'),_0xf1a1('0x4')),'allowNull':![],'defaultValue':_0xf1a1('0x4')},'transferredAt':{'type':Sequelize[_0xf1a1('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xf1a1('0x6')]}};
\ No newline at end of file
+var _0x180f=['account','agent','NOW','moment','sequelize','exports','ENUM'];(function(_0x5e1624,_0x26957f){var _0x3c6417=function(_0x501fc6){while(--_0x501fc6){_0x5e1624['push'](_0x5e1624['shift']());}};_0x3c6417(++_0x26957f);}(_0x180f,0x1ae));var _0xf180=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x180f[_0x41e8c4];return _0x54ffbe;};'use strict';var moment=require(_0xf180('0x0'));var Sequelize=require(_0xf180('0x1'));module[_0xf180('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf180('0x3')](_0xf180('0x4'),_0xf180('0x5'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf180('0x6')]}};
\ No newline at end of file
index aaeb875..ec2212a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3807=['params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','map','MailTransferReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','catch'];(function(_0x4275a3,_0x2030f0){var _0x24d729=function(_0x37a0c6){while(--_0x37a0c6){_0x4275a3['push'](_0x4275a3['shift']());}};_0x24d729(++_0x2030f0);}(_0x3807,0x198));var _0x7380=function(_0x6f7163,_0x599d1e){_0x6f7163=_0x6f7163-0x0;var _0xdb229c=_0x3807[_0x6f7163];return _0xdb229c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7380('0x0'));var zipdir=require(_0x7380('0x1'));var jsonpatch=require(_0x7380('0x2'));var rp=require(_0x7380('0x3'));var moment=require(_0x7380('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7380('0x5'));var util=require(_0x7380('0x6'));var path=require(_0x7380('0x7'));var sox=require(_0x7380('0x8'));var csv=require('to-csv');var ejs=require(_0x7380('0x9'));var fs=require('fs');var _=require(_0x7380('0xa'));var squel=require(_0x7380('0xb'));var crypto=require(_0x7380('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7380('0xd'));var Papa=require('papaparse');var Redis=require(_0x7380('0xe'));var authService=require(_0x7380('0xf'));var qs=require(_0x7380('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7380('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7380('0x12'));var config=require(_0x7380('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x221719,_0x30f842){_0x30f842=_0x30f842||0xcc;return function(_0x22a6e6){if(_0x22a6e6){return _0x221719[_0x7380('0x14')](_0x30f842);}return _0x221719[_0x7380('0x15')](_0x30f842)[_0x7380('0x16')]();};}function respondWithResult(_0x38c436,_0x38245){_0x38245=_0x38245||0xc8;return function(_0x511aa0){if(_0x511aa0){return _0x38c436[_0x7380('0x15')](_0x38245)[_0x7380('0x17')](_0x511aa0);}};}function respondWithFilteredResult(_0x380ed7,_0x506159){return function(_0x576fb6){if(_0x576fb6){var _0x392720=_0x576fb6[_0x7380('0x18')],_0x381844=_0x506159[_0x7380('0x19')],_0x1466a9=_0x506159['offset']+_0x506159[_0x7380('0x1a')],_0x357208;if(_0x1466a9>=_0x392720){_0x1466a9=_0x392720;_0x357208=0xc8;}else{_0x357208=0xce;}_0x380ed7['status'](_0x357208);return _0x380ed7[_0x7380('0x1b')]('Content-Range',_0x381844+'-'+_0x1466a9+'/'+_0x392720)[_0x7380('0x17')](_0x576fb6);}return null;};}function patchUpdates(_0x36f41f){return function(_0x5cb42d){try{jsonpatch[_0x7380('0x1c')](_0x5cb42d,_0x36f41f,!![]);}catch(_0x14f734){return BPromise[_0x7380('0x1d')](_0x14f734);}return _0x5cb42d[_0x7380('0x1e')]();};}function saveUpdates(_0x1dd0e2,_0x31ac7e){return function(_0x3f9dde){if(_0x3f9dde){return _0x3f9dde[_0x7380('0x1f')](_0x1dd0e2)[_0x7380('0x20')](function(_0x38c341){return _0x38c341;});}return null;};}function removeEntity(_0x6965f9,_0x520d29){return function(_0x28ab71){if(_0x28ab71){return _0x28ab71[_0x7380('0x21')]()[_0x7380('0x20')](function(){_0x6965f9[_0x7380('0x15')](0xcc)[_0x7380('0x16')]();});}};}function handleEntityNotFound(_0x51b3fe,_0x15bed8){return function(_0x1fdde5){if(!_0x1fdde5){_0x51b3fe['sendStatus'](0x194);}return _0x1fdde5;};}function handleError(_0x53412e,_0xde7e6e){_0xde7e6e=_0xde7e6e||0x1f4;return function(_0x55f485){logger[_0x7380('0x22')](_0x55f485[_0x7380('0x23')]);if(_0x55f485['name']){delete _0x55f485[_0x7380('0x24')];}_0x53412e[_0x7380('0x15')](_0xde7e6e)['send'](_0x55f485);};}exports['index']=function(_0x4ce784,_0x526170){var _0x3df075={},_0x42107b={},_0x1b6745={'count':0x0,'rows':[]};var _0x3b6bcc=_[_0x7380('0x25')](db[_0x7380('0x26')][_0x7380('0x27')],function(_0x255a24){return{'name':_0x255a24['fieldName'],'type':_0x255a24['type'][_0x7380('0x28')]};});_0x42107b[_0x7380('0x29')]=_[_0x7380('0x25')](_0x3b6bcc,_0x7380('0x24'));_0x42107b['query']=_[_0x7380('0x2a')](_0x4ce784[_0x7380('0x2b')]);_0x42107b[_0x7380('0x2c')]=_[_0x7380('0x2d')](_0x42107b[_0x7380('0x29')],_0x42107b[_0x7380('0x2b')]);_0x3df075[_0x7380('0x2e')]=_[_0x7380('0x2d')](_0x42107b[_0x7380('0x29')],qs[_0x7380('0x2f')](_0x4ce784[_0x7380('0x2b')]['fields']));_0x3df075[_0x7380('0x2e')]=_0x3df075[_0x7380('0x2e')]['length']?_0x3df075[_0x7380('0x2e')]:_0x42107b[_0x7380('0x29')];if(!_0x4ce784[_0x7380('0x2b')][_0x7380('0x30')](_0x7380('0x31'))){_0x3df075[_0x7380('0x1a')]=qs['limit'](_0x4ce784['query'][_0x7380('0x1a')]);_0x3df075[_0x7380('0x19')]=qs[_0x7380('0x19')](_0x4ce784['query'][_0x7380('0x19')]);}_0x3df075[_0x7380('0x32')]=qs[_0x7380('0x33')](_0x4ce784[_0x7380('0x2b')][_0x7380('0x33')]);_0x3df075[_0x7380('0x34')]=qs[_0x7380('0x2c')](_['pick'](_0x4ce784[_0x7380('0x2b')],_0x42107b[_0x7380('0x2c')]),_0x3b6bcc);if(_0x4ce784[_0x7380('0x2b')][_0x7380('0x35')]){_0x3df075[_0x7380('0x34')]=_[_0x7380('0x36')](_0x3df075[_0x7380('0x34')],{'$or':_[_0x7380('0x25')](_0x3b6bcc,function(_0x299b90){if(_0x299b90[_0x7380('0x37')]!==_0x7380('0x38')){var _0x3ab3d1={};_0x3ab3d1[_0x299b90['name']]={'$like':'%'+_0x4ce784[_0x7380('0x2b')][_0x7380('0x35')]+'%'};return _0x3ab3d1;}})});}_0x3df075=_[_0x7380('0x36')]({},_0x3df075,_0x4ce784[_0x7380('0x39')]);var _0x119f92={'where':_0x3df075['where']};return db['MailTransferReport'][_0x7380('0x18')](_0x119f92)[_0x7380('0x20')](function(_0x4630a7){_0x1b6745['count']=_0x4630a7;if(_0x4ce784[_0x7380('0x2b')][_0x7380('0x3a')]){_0x3df075[_0x7380('0x3b')]=[{'all':!![]}];}return db[_0x7380('0x26')]['findAll'](_0x3df075);})[_0x7380('0x20')](function(_0x258daa){_0x1b6745['rows']=_0x258daa;return _0x1b6745;})[_0x7380('0x20')](respondWithFilteredResult(_0x526170,_0x3df075))[_0x7380('0x3c')](handleError(_0x526170,null));};exports['show']=function(_0x47f5c0,_0x1effc3){var _0xff9ecb={'raw':!![],'where':{'id':_0x47f5c0[_0x7380('0x3d')]['id']}},_0x1abdc2={};_0x1abdc2['model']=_[_0x7380('0x2a')](db['MailTransferReport'][_0x7380('0x27')]);_0x1abdc2[_0x7380('0x2b')]=_['keys'](_0x47f5c0[_0x7380('0x2b')]);_0x1abdc2[_0x7380('0x2c')]=_[_0x7380('0x2d')](_0x1abdc2[_0x7380('0x29')],_0x1abdc2[_0x7380('0x2b')]);_0xff9ecb[_0x7380('0x2e')]=_[_0x7380('0x2d')](_0x1abdc2['model'],qs[_0x7380('0x2f')](_0x47f5c0[_0x7380('0x2b')]['fields']));_0xff9ecb[_0x7380('0x2e')]=_0xff9ecb[_0x7380('0x2e')][_0x7380('0x3e')]?_0xff9ecb['attributes']:_0x1abdc2['model'];if(_0x47f5c0[_0x7380('0x2b')][_0x7380('0x3a')]){_0xff9ecb[_0x7380('0x3b')]=[{'all':!![]}];}_0xff9ecb=_[_0x7380('0x36')]({},_0xff9ecb,_0x47f5c0[_0x7380('0x39')]);return db['MailTransferReport'][_0x7380('0x3f')](_0xff9ecb)[_0x7380('0x20')](handleEntityNotFound(_0x1effc3,null))[_0x7380('0x20')](respondWithResult(_0x1effc3,null))['catch'](handleError(_0x1effc3,null));};exports[_0x7380('0x40')]=function(_0x63c9ee,_0x583575){return db[_0x7380('0x26')]['create'](_0x63c9ee[_0x7380('0x41')],{})['then'](respondWithResult(_0x583575,0xc9))[_0x7380('0x3c')](handleError(_0x583575,null));};exports[_0x7380('0x1f')]=function(_0x57d0ee,_0x35b384){if(_0x57d0ee[_0x7380('0x41')]['id']){delete _0x57d0ee[_0x7380('0x41')]['id'];}return db[_0x7380('0x26')][_0x7380('0x3f')]({'where':{'id':_0x57d0ee[_0x7380('0x3d')]['id']}})[_0x7380('0x20')](handleEntityNotFound(_0x35b384,null))[_0x7380('0x20')](saveUpdates(_0x57d0ee[_0x7380('0x41')],null))[_0x7380('0x20')](respondWithResult(_0x35b384,null))[_0x7380('0x3c')](handleError(_0x35b384,null));};exports[_0x7380('0x21')]=function(_0x13b1d4,_0x3ac94a){return db[_0x7380('0x26')][_0x7380('0x3f')]({'where':{'id':_0x13b1d4[_0x7380('0x3d')]['id']}})[_0x7380('0x20')](handleEntityNotFound(_0x3ac94a,null))[_0x7380('0x20')](removeEntity(_0x3ac94a,null))[_0x7380('0x3c')](handleError(_0x3ac94a,null));};exports[_0x7380('0x42')]=function(_0x400c51,_0x1e70e2){return db[_0x7380('0x26')]['describe']()[_0x7380('0x20')](respondWithResult(_0x1e70e2,null))[_0x7380('0x3c')](handleError(_0x1e70e2,null));};
\ No newline at end of file
+var _0xe5b1=['pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','catch','show','length','options','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','sort'];(function(_0x6cedff,_0x3b696c){var _0x282d11=function(_0x35d0f3){while(--_0x35d0f3){_0x6cedff['push'](_0x6cedff['shift']());}};_0x282d11(++_0x3b696c);}(_0xe5b1,0x139));var _0x1e5b=function(_0x71cd05,_0x36ac11){_0x71cd05=_0x71cd05-0x0;var _0x59c9e7=_0xe5b1[_0x71cd05];return _0x59c9e7;};'use strict';var pdf=require(_0x1e5b('0x0'));var emlformat=require(_0x1e5b('0x1'));var rimraf=require(_0x1e5b('0x2'));var zipdir=require(_0x1e5b('0x3'));var jsonpatch=require(_0x1e5b('0x4'));var rp=require(_0x1e5b('0x5'));var moment=require(_0x1e5b('0x6'));var BPromise=require(_0x1e5b('0x7'));var Mustache=require(_0x1e5b('0x8'));var util=require('util');var path=require(_0x1e5b('0x9'));var sox=require(_0x1e5b('0xa'));var csv=require(_0x1e5b('0xb'));var ejs=require(_0x1e5b('0xc'));var fs=require('fs');var _=require(_0x1e5b('0xd'));var squel=require(_0x1e5b('0xe'));var crypto=require(_0x1e5b('0xf'));var jsforce=require(_0x1e5b('0x10'));var deskjs=require(_0x1e5b('0x11'));var toCsv=require('to-csv');var querystring=require(_0x1e5b('0x12'));var Papa=require('papaparse');var Redis=require(_0x1e5b('0x13'));var authService=require(_0x1e5b('0x14'));var qs=require(_0x1e5b('0x15'));var as=require(_0x1e5b('0x16'));var hardwareService=require(_0x1e5b('0x17'));var logger=require('../../config/logger')(_0x1e5b('0x18'));var utils=require('../../config/utils');var config=require(_0x1e5b('0x19'));var db=require(_0x1e5b('0x1a'))['db'];function respondWithStatusCode(_0x38b107,_0x5f2b93){_0x5f2b93=_0x5f2b93||0xcc;return function(_0x45fce1){if(_0x45fce1){return _0x38b107[_0x1e5b('0x1b')](_0x5f2b93);}return _0x38b107[_0x1e5b('0x1c')](_0x5f2b93)[_0x1e5b('0x1d')]();};}function respondWithResult(_0x5f384c,_0x36eb8b){_0x36eb8b=_0x36eb8b||0xc8;return function(_0x19038d){if(_0x19038d){return _0x5f384c[_0x1e5b('0x1c')](_0x36eb8b)[_0x1e5b('0x1e')](_0x19038d);}};}function respondWithFilteredResult(_0x4d7f51,_0x36109f){return function(_0x302d23){if(_0x302d23){var _0x5d7b9d=_0x302d23[_0x1e5b('0x1f')],_0x218d06=_0x36109f[_0x1e5b('0x20')],_0x4fae11=_0x36109f[_0x1e5b('0x20')]+_0x36109f[_0x1e5b('0x21')],_0x3609bb;if(_0x4fae11>=_0x5d7b9d){_0x4fae11=_0x5d7b9d;_0x3609bb=0xc8;}else{_0x3609bb=0xce;}_0x4d7f51[_0x1e5b('0x1c')](_0x3609bb);return _0x4d7f51['set'](_0x1e5b('0x22'),_0x218d06+'-'+_0x4fae11+'/'+_0x5d7b9d)[_0x1e5b('0x1e')](_0x302d23);}return null;};}function patchUpdates(_0x5e84c0){return function(_0x372ff8){try{jsonpatch[_0x1e5b('0x23')](_0x372ff8,_0x5e84c0,!![]);}catch(_0x3bf328){return BPromise[_0x1e5b('0x24')](_0x3bf328);}return _0x372ff8[_0x1e5b('0x25')]();};}function saveUpdates(_0x50eec8,_0x276a5e){return function(_0x5c7025){if(_0x5c7025){return _0x5c7025[_0x1e5b('0x26')](_0x50eec8)['then'](function(_0x1b9000){return _0x1b9000;});}return null;};}function removeEntity(_0x390f9,_0xbfb01d){return function(_0x5ca679){if(_0x5ca679){return _0x5ca679[_0x1e5b('0x27')]()[_0x1e5b('0x28')](function(){_0x390f9[_0x1e5b('0x1c')](0xcc)[_0x1e5b('0x1d')]();});}};}function handleEntityNotFound(_0x1114f8,_0x10494d){return function(_0x481a2b){if(!_0x481a2b){_0x1114f8[_0x1e5b('0x1b')](0x194);}return _0x481a2b;};}function handleError(_0x14c5cb,_0x120560){_0x120560=_0x120560||0x1f4;return function(_0xf8d86c){logger['error'](_0xf8d86c[_0x1e5b('0x29')]);if(_0xf8d86c[_0x1e5b('0x2a')]){delete _0xf8d86c[_0x1e5b('0x2a')];}_0x14c5cb[_0x1e5b('0x1c')](_0x120560)['send'](_0xf8d86c);};}exports[_0x1e5b('0x2b')]=function(_0x5cf7ec,_0x3a7333){var _0x3ec359={},_0xae519f={},_0x237170={'count':0x0,'rows':[]};var _0x16c388=_[_0x1e5b('0x2c')](db[_0x1e5b('0x2d')][_0x1e5b('0x2e')],function(_0x47a32e){return{'name':_0x47a32e[_0x1e5b('0x2f')],'type':_0x47a32e['type'][_0x1e5b('0x30')]};});_0xae519f[_0x1e5b('0x31')]=_[_0x1e5b('0x2c')](_0x16c388,'name');_0xae519f[_0x1e5b('0x32')]=_[_0x1e5b('0x33')](_0x5cf7ec['query']);_0xae519f[_0x1e5b('0x34')]=_['intersection'](_0xae519f[_0x1e5b('0x31')],_0xae519f[_0x1e5b('0x32')]);_0x3ec359[_0x1e5b('0x35')]=_[_0x1e5b('0x36')](_0xae519f[_0x1e5b('0x31')],qs[_0x1e5b('0x37')](_0x5cf7ec[_0x1e5b('0x32')][_0x1e5b('0x37')]));_0x3ec359['attributes']=_0x3ec359['attributes']['length']?_0x3ec359[_0x1e5b('0x35')]:_0xae519f[_0x1e5b('0x31')];if(!_0x5cf7ec[_0x1e5b('0x32')]['hasOwnProperty']('nolimit')){_0x3ec359[_0x1e5b('0x21')]=qs['limit'](_0x5cf7ec[_0x1e5b('0x32')][_0x1e5b('0x21')]);_0x3ec359['offset']=qs[_0x1e5b('0x20')](_0x5cf7ec[_0x1e5b('0x32')][_0x1e5b('0x20')]);}_0x3ec359['order']=qs[_0x1e5b('0x38')](_0x5cf7ec[_0x1e5b('0x32')][_0x1e5b('0x38')]);_0x3ec359['where']=qs[_0x1e5b('0x34')](_[_0x1e5b('0x39')](_0x5cf7ec[_0x1e5b('0x32')],_0xae519f[_0x1e5b('0x34')]),_0x16c388);if(_0x5cf7ec['query'][_0x1e5b('0x3a')]){_0x3ec359['where']=_['merge'](_0x3ec359[_0x1e5b('0x3b')],{'$or':_[_0x1e5b('0x2c')](_0x16c388,function(_0x51236a){if(_0x51236a[_0x1e5b('0x3c')]!==_0x1e5b('0x3d')){var _0x547d22={};_0x547d22[_0x51236a[_0x1e5b('0x2a')]]={'$like':'%'+_0x5cf7ec['query'][_0x1e5b('0x3a')]+'%'};return _0x547d22;}})});}_0x3ec359=_[_0x1e5b('0x3e')]({},_0x3ec359,_0x5cf7ec['options']);var _0x47f7fd={'where':_0x3ec359[_0x1e5b('0x3b')]};return db[_0x1e5b('0x2d')][_0x1e5b('0x1f')](_0x47f7fd)[_0x1e5b('0x28')](function(_0x3586de){_0x237170[_0x1e5b('0x1f')]=_0x3586de;if(_0x5cf7ec['query'][_0x1e5b('0x3f')]){_0x3ec359[_0x1e5b('0x40')]=[{'all':!![]}];}return db[_0x1e5b('0x2d')][_0x1e5b('0x41')](_0x3ec359);})['then'](function(_0xa643f0){_0x237170['rows']=_0xa643f0;return _0x237170;})['then'](respondWithFilteredResult(_0x3a7333,_0x3ec359))[_0x1e5b('0x42')](handleError(_0x3a7333,null));};exports[_0x1e5b('0x43')]=function(_0x55897d,_0x108c38){var _0x41fcb2={'raw':!![],'where':{'id':_0x55897d['params']['id']}},_0x227cbc={};_0x227cbc[_0x1e5b('0x31')]=_[_0x1e5b('0x33')](db[_0x1e5b('0x2d')]['rawAttributes']);_0x227cbc[_0x1e5b('0x32')]=_[_0x1e5b('0x33')](_0x55897d[_0x1e5b('0x32')]);_0x227cbc[_0x1e5b('0x34')]=_[_0x1e5b('0x36')](_0x227cbc[_0x1e5b('0x31')],_0x227cbc['query']);_0x41fcb2['attributes']=_[_0x1e5b('0x36')](_0x227cbc[_0x1e5b('0x31')],qs[_0x1e5b('0x37')](_0x55897d[_0x1e5b('0x32')]['fields']));_0x41fcb2['attributes']=_0x41fcb2[_0x1e5b('0x35')][_0x1e5b('0x44')]?_0x41fcb2[_0x1e5b('0x35')]:_0x227cbc['model'];if(_0x55897d[_0x1e5b('0x32')][_0x1e5b('0x3f')]){_0x41fcb2[_0x1e5b('0x40')]=[{'all':!![]}];}_0x41fcb2=_[_0x1e5b('0x3e')]({},_0x41fcb2,_0x55897d[_0x1e5b('0x45')]);return db[_0x1e5b('0x2d')][_0x1e5b('0x46')](_0x41fcb2)[_0x1e5b('0x28')](handleEntityNotFound(_0x108c38,null))[_0x1e5b('0x28')](respondWithResult(_0x108c38,null))[_0x1e5b('0x42')](handleError(_0x108c38,null));};exports['create']=function(_0x2d3914,_0x4a5f72){return db[_0x1e5b('0x2d')][_0x1e5b('0x47')](_0x2d3914['body'],{})['then'](respondWithResult(_0x4a5f72,0xc9))[_0x1e5b('0x42')](handleError(_0x4a5f72,null));};exports[_0x1e5b('0x26')]=function(_0x667a4a,_0x4a0d6f){if(_0x667a4a[_0x1e5b('0x48')]['id']){delete _0x667a4a['body']['id'];}return db['MailTransferReport'][_0x1e5b('0x46')]({'where':{'id':_0x667a4a[_0x1e5b('0x49')]['id']}})[_0x1e5b('0x28')](handleEntityNotFound(_0x4a0d6f,null))[_0x1e5b('0x28')](saveUpdates(_0x667a4a[_0x1e5b('0x48')],null))[_0x1e5b('0x28')](respondWithResult(_0x4a0d6f,null))[_0x1e5b('0x42')](handleError(_0x4a0d6f,null));};exports[_0x1e5b('0x27')]=function(_0xb21b74,_0x1d24e){return db[_0x1e5b('0x2d')][_0x1e5b('0x46')]({'where':{'id':_0xb21b74[_0x1e5b('0x49')]['id']}})[_0x1e5b('0x28')](handleEntityNotFound(_0x1d24e,null))[_0x1e5b('0x28')](removeEntity(_0x1d24e,null))[_0x1e5b('0x42')](handleError(_0x1d24e,null));};exports['describe']=function(_0x8fd747,_0x11bde3){return db[_0x1e5b('0x2d')]['describe']()[_0x1e5b('0x28')](respondWithResult(_0x11bde3,null))['catch'](handleError(_0x11bde3,null));};
\ No newline at end of file
index 55e3ef1..8617a49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b2d=['./mailTransferReport.attributes','exports','MailTransferReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2f432a,_0x21efbd){var _0x9fb239=function(_0x56549c){while(--_0x56549c){_0x2f432a['push'](_0x2f432a['shift']());}};_0x9fb239(++_0x21efbd);}(_0x2b2d,0x18f));var _0xd2b2=function(_0x3116d6,_0x2d574f){_0x3116d6=_0x3116d6-0x0;var _0x18729d=_0x2b2d[_0x3116d6];return _0x18729d;};'use strict';var _=require(_0xd2b2('0x0'));var util=require(_0xd2b2('0x1'));var logger=require(_0xd2b2('0x2'))(_0xd2b2('0x3'));var moment=require('moment');var BPromise=require(_0xd2b2('0x4'));var rp=require(_0xd2b2('0x5'));var fs=require('fs');var path=require(_0xd2b2('0x6'));var rimraf=require(_0xd2b2('0x7'));var config=require(_0xd2b2('0x8'));var attributes=require(_0xd2b2('0x9'));module[_0xd2b2('0xa')]=function(_0x2f24c3,_0x5ba84d){return _0x2f24c3['define'](_0xd2b2('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2283=['path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','moment','bluebird','request-promise'];(function(_0xed4bb8,_0x5e23f8){var _0x5077d9=function(_0x28acbd){while(--_0x28acbd){_0xed4bb8['push'](_0xed4bb8['shift']());}};_0x5077d9(++_0x5e23f8);}(_0x2283,0x167));var _0x3228=function(_0x4ec43d,_0x49c289){_0x4ec43d=_0x4ec43d-0x0;var _0x3b227f=_0x2283[_0x4ec43d];return _0x3b227f;};'use strict';var _=require(_0x3228('0x0'));var util=require(_0x3228('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3228('0x2'));var BPromise=require(_0x3228('0x3'));var rp=require(_0x3228('0x4'));var fs=require('fs');var path=require(_0x3228('0x5'));var rimraf=require(_0x3228('0x6'));var config=require(_0x3228('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0x3228('0x8')]=function(_0x3653d4,_0x5c2d57){return _0x3653d4[_0x3228('0x9')](_0x3228('0xa'),attributes,{'tableName':_0x3228('0xb'),'paranoid':![],'indexes':[{'name':_0x3228('0xc'),'fields':[_0x3228('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0858377..57085e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeada=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','MailTransferReport,\x20%s,\x20%s','catch','lodash'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0xeada,0x153));var _0xaead=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeada[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaead('0x0'));var util=require(_0xaead('0x1'));var moment=require('moment');var BPromise=require(_0xaead('0x2'));var rs=require(_0xaead('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaead('0x4'))['db'];var utils=require(_0xaead('0x5'));var logger=require(_0xaead('0x6'))(_0xaead('0x7'));var config=require('../../config/environment');var jayson=require(_0xaead('0x8'));var client=jayson[_0xaead('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ff772,_0x52f130,_0x475a75){return new BPromise(function(_0x3d1d96,_0x3192ed){return client[_0xaead('0xa')](_0x3ff772,_0x475a75)['then'](function(_0x14f3e9){logger[_0xaead('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x52f130,_0xaead('0xc'));logger[_0xaead('0xd')](_0xaead('0xe'),_0x52f130,_0xaead('0xc'),JSON[_0xaead('0xf')](_0x14f3e9));if(_0x14f3e9[_0xaead('0x10')]){if(_0x14f3e9[_0xaead('0x10')]['code']===0x1f4){logger[_0xaead('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x52f130,_0x14f3e9[_0xaead('0x10')]['message']);return _0x3192ed(_0x14f3e9['error'][_0xaead('0x11')]);}logger[_0xaead('0x10')](_0xaead('0x12'),_0x52f130,_0x14f3e9[_0xaead('0x10')][_0xaead('0x11')]);return _0x3d1d96(_0x14f3e9[_0xaead('0x10')][_0xaead('0x11')]);}else{logger[_0xaead('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x52f130,'request\x20sent');_0x3d1d96(_0x14f3e9['result'][_0xaead('0x11')]);}})[_0xaead('0x13')](function(_0x8189aa){logger[_0xaead('0x10')](_0xaead('0x12'),_0x52f130,_0x8189aa);_0x3192ed(_0x8189aa);});});}
\ No newline at end of file
+var _0x2a71=['request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a71,0x117));var _0x12a7=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0x2a71[_0x197185];return _0x2c8af1;};'use strict';var _=require(_0x12a7('0x0'));var util=require(_0x12a7('0x1'));var moment=require('moment');var BPromise=require(_0x12a7('0x2'));var rs=require(_0x12a7('0x3'));var fs=require('fs');var Redis=require(_0x12a7('0x4'));var db=require(_0x12a7('0x5'))['db'];var utils=require(_0x12a7('0x6'));var logger=require(_0x12a7('0x7'))('rpc');var config=require(_0x12a7('0x8'));var jayson=require(_0x12a7('0x9'));var client=jayson[_0x12a7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e269d,_0x34ce12,_0x606fd3){return new BPromise(function(_0x20fd8d,_0x27b73d){return client[_0x12a7('0xb')](_0x2e269d,_0x606fd3)[_0x12a7('0xc')](function(_0x3721ff){logger[_0x12a7('0xd')](_0x12a7('0xe'),_0x34ce12,_0x12a7('0xf'));logger[_0x12a7('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x34ce12,_0x12a7('0xf'),JSON[_0x12a7('0x11')](_0x3721ff));if(_0x3721ff[_0x12a7('0x12')]){if(_0x3721ff[_0x12a7('0x12')]['code']===0x1f4){logger['error'](_0x12a7('0xe'),_0x34ce12,_0x3721ff[_0x12a7('0x12')]['message']);return _0x27b73d(_0x3721ff['error'][_0x12a7('0x13')]);}logger[_0x12a7('0x12')](_0x12a7('0xe'),_0x34ce12,_0x3721ff['error'][_0x12a7('0x13')]);return _0x20fd8d(_0x3721ff[_0x12a7('0x12')][_0x12a7('0x13')]);}else{logger['info'](_0x12a7('0xe'),_0x34ce12,_0x12a7('0xf'));_0x20fd8d(_0x3721ff[_0x12a7('0x14')][_0x12a7('0x13')]);}})['catch'](function(_0x1ca016){logger[_0x12a7('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x34ce12,_0x1ca016);_0x27b73d(_0x1ca016);});});}
\ No newline at end of file
index edde9bf..81add89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41bc=['../../config/environment','./memberReport.controller','get','isAuthenticated','describe','show','post','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x10add3,_0x5a098f){var _0x4c602a=function(_0x6c7b37){while(--_0x6c7b37){_0x10add3['push'](_0x10add3['shift']());}};_0x4c602a(++_0x5a098f);}(_0x41bc,0xef));var _0xc41b=function(_0x2ab9bb,_0x35465a){_0x2ab9bb=_0x2ab9bb-0x0;var _0x3233c4=_0x41bc[_0x2ab9bb];return _0x3233c4;};'use strict';var multer=require(_0xc41b('0x0'));var util=require(_0xc41b('0x1'));var path=require(_0xc41b('0x2'));var timeout=require(_0xc41b('0x3'));var express=require(_0xc41b('0x4'));var router=express[_0xc41b('0x5')]();var auth=require(_0xc41b('0x6'));var interaction=require(_0xc41b('0x7'));var config=require(_0xc41b('0x8'));var controller=require(_0xc41b('0x9'));router[_0xc41b('0xa')]('/',auth[_0xc41b('0xb')](),controller['index']);router[_0xc41b('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xc41b('0xc')]);router[_0xc41b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc41b('0xd')]);router[_0xc41b('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc41b('0xf'),auth[_0xc41b('0xb')](),controller[_0xc41b('0x10')]);router[_0xc41b('0x11')](_0xc41b('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xc41b('0x12')]=router;
\ No newline at end of file
+var _0x7231=['put','delete','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','create'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0x7231,0xd2));var _0x1723=function(_0x1c63fd,_0x5c08df){_0x1c63fd=_0x1c63fd-0x0;var _0x4284a6=_0x7231[_0x1c63fd];return _0x4284a6;};'use strict';var multer=require('multer');var util=require(_0x1723('0x0'));var path=require(_0x1723('0x1'));var timeout=require(_0x1723('0x2'));var express=require(_0x1723('0x3'));var router=express['Router']();var auth=require(_0x1723('0x4'));var interaction=require(_0x1723('0x5'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router['get']('/',auth[_0x1723('0x6')](),controller[_0x1723('0x7')]);router[_0x1723('0x8')](_0x1723('0x9'),auth[_0x1723('0x6')](),controller[_0x1723('0xa')]);router[_0x1723('0x8')](_0x1723('0xb'),auth['isAuthenticated'](),controller[_0x1723('0xc')]);router['post']('/',auth[_0x1723('0x6')](),controller[_0x1723('0xd')]);router[_0x1723('0xe')](_0x1723('0xb'),auth[_0x1723('0x6')](),controller['update']);router[_0x1723('0xf')]('/:id',auth[_0x1723('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 6541def..31550c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x935b=['moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x32fe5b,_0x464e33){var _0x2440e5=function(_0x43522f){while(--_0x43522f){_0x32fe5b['push'](_0x32fe5b['shift']());}};_0x2440e5(++_0x464e33);}(_0x935b,0x1c7));var _0xb935=function(_0x59496a,_0x24777c){_0x59496a=_0x59496a-0x0;var _0x22600a=_0x935b[_0x59496a];return _0x22600a;};'use strict';var Sequelize=require(_0xb935('0x0'));var moment=require(_0xb935('0x1'));module[_0xb935('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb935('0x3')]},'interface':{'type':Sequelize[_0xb935('0x3')]},'type':{'type':Sequelize[_0xb935('0x3')],'defaultValue':_0xb935('0x4'),'comment':_0xb935('0x5')},'duration':{'type':Sequelize[_0xb935('0x6')]},'enterAt':{'type':Sequelize[_0xb935('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5b5563){var _0x498c20=moment(_0x5b5563);var _0x53a966=moment(this[_0xb935('0x8')](_0xb935('0x9')));var _0x442daf=_0x498c20['diff'](_0x53a966,_0xb935('0xa'));this[_0xb935('0xb')](_0xb935('0xc'),_0x5b5563);this[_0xb935('0xb')](_0xb935('0xd'),_0x442daf||null);}},'data1':{'type':Sequelize[_0xb935('0x3')],'comment':_0xb935('0xe')},'data2':{'type':Sequelize[_0xb935('0x3')],'comment':_0xb935('0xf')},'data3':{'type':Sequelize[_0xb935('0x3')],'comment':_0xb935('0x10')},'data4':{'type':Sequelize['STRING'],'comment':_0xb935('0x11')},'data5':{'type':Sequelize[_0xb935('0x3')],'comment':_0xb935('0x12')},'role':{'type':Sequelize[_0xb935('0x3')]},'internal':{'type':Sequelize[_0xb935('0x6')]},'uniqueid':{'type':Sequelize[_0xb935('0x3')]}};
\ No newline at end of file
+var _0xa994=['STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','exports'];(function(_0x23f516,_0xba7b91){var _0x1f983c=function(_0x5d2497){while(--_0x5d2497){_0x23f516['push'](_0x23f516['shift']());}};_0x1f983c(++_0xba7b91);}(_0xa994,0x176));var _0x4a99=function(_0x102fcf,_0x41bf3e){_0x102fcf=_0x102fcf-0x0;var _0x248f24=_0xa994[_0x102fcf];return _0x248f24;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x4a99('0x0')]={'channel':{'type':Sequelize[_0x4a99('0x1')]},'membername':{'type':Sequelize[_0x4a99('0x1')]},'interface':{'type':Sequelize[_0x4a99('0x1')]},'type':{'type':Sequelize[_0x4a99('0x1')],'defaultValue':_0x4a99('0x2'),'comment':_0x4a99('0x3')},'duration':{'type':Sequelize[_0x4a99('0x4')]},'enterAt':{'type':Sequelize[_0x4a99('0x5')]},'exitAt':{'type':Sequelize[_0x4a99('0x5')],'set':function(_0x4bc47b){var _0x2d2401=moment(_0x4bc47b);var _0x3b46b7=moment(this['getDataValue'](_0x4a99('0x6')));var _0x2356c2=_0x2d2401[_0x4a99('0x7')](_0x3b46b7,'seconds');this[_0x4a99('0x8')](_0x4a99('0x9'),_0x4bc47b);this[_0x4a99('0x8')](_0x4a99('0xa'),_0x2356c2||null);}},'data1':{'type':Sequelize[_0x4a99('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x4a99('0x1')],'comment':_0x4a99('0xb')},'data3':{'type':Sequelize[_0x4a99('0x1')],'comment':_0x4a99('0xc')},'data4':{'type':Sequelize[_0x4a99('0x1')],'comment':_0x4a99('0xd')},'data5':{'type':Sequelize[_0x4a99('0x1')],'comment':_0x4a99('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 103c44d..df391f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f4b=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','save','update','then','error','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x396173,_0x155ff4){var _0x1fab5b=function(_0x3f8706){while(--_0x3f8706){_0x396173['push'](_0x396173['shift']());}};_0x1fab5b(++_0x155ff4);}(_0x9f4b,0x1e4));var _0xb9f4=function(_0x5cb0c4,_0x1cba3a){_0x5cb0c4=_0x5cb0c4-0x0;var _0x56f81a=_0x9f4b[_0x5cb0c4];return _0x56f81a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9f4('0x0'));var rimraf=require(_0xb9f4('0x1'));var zipdir=require(_0xb9f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9f4('0x3'));var moment=require(_0xb9f4('0x4'));var BPromise=require(_0xb9f4('0x5'));var Mustache=require(_0xb9f4('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb9f4('0x7'));var csv=require(_0xb9f4('0x8'));var ejs=require(_0xb9f4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb9f4('0xa'));var crypto=require(_0xb9f4('0xb'));var jsforce=require(_0xb9f4('0xc'));var deskjs=require(_0xb9f4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb9f4('0xe'));var Papa=require('papaparse');var Redis=require(_0xb9f4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb9f4('0x10'));var as=require(_0xb9f4('0x11'));var hardwareService=require(_0xb9f4('0x12'));var logger=require(_0xb9f4('0x13'))('api');var utils=require(_0xb9f4('0x14'));var config=require(_0xb9f4('0x15'));var db=require(_0xb9f4('0x16'))['db'];function respondWithStatusCode(_0x268fc1,_0x198bdf){_0x198bdf=_0x198bdf||0xcc;return function(_0x5bb546){if(_0x5bb546){return _0x268fc1[_0xb9f4('0x17')](_0x198bdf);}return _0x268fc1[_0xb9f4('0x18')](_0x198bdf)[_0xb9f4('0x19')]();};}function respondWithResult(_0x2acf95,_0x2d5ddb){_0x2d5ddb=_0x2d5ddb||0xc8;return function(_0x469c27){if(_0x469c27){return _0x2acf95['status'](_0x2d5ddb)[_0xb9f4('0x1a')](_0x469c27);}};}function respondWithFilteredResult(_0xc4dd3e,_0x56359a){return function(_0x47e0b9){if(_0x47e0b9){var _0x88a2a9=_0x47e0b9[_0xb9f4('0x1b')],_0x49ba01=_0x56359a[_0xb9f4('0x1c')],_0x8e2d81=_0x56359a[_0xb9f4('0x1c')]+_0x56359a['limit'],_0x89e0d0;if(_0x8e2d81>=_0x88a2a9){_0x8e2d81=_0x88a2a9;_0x89e0d0=0xc8;}else{_0x89e0d0=0xce;}_0xc4dd3e[_0xb9f4('0x18')](_0x89e0d0);return _0xc4dd3e['set']('Content-Range',_0x49ba01+'-'+_0x8e2d81+'/'+_0x88a2a9)[_0xb9f4('0x1a')](_0x47e0b9);}return null;};}function patchUpdates(_0x279f39){return function(_0x39f596){try{jsonpatch[_0xb9f4('0x1d')](_0x39f596,_0x279f39,!![]);}catch(_0x20703b){return BPromise[_0xb9f4('0x1e')](_0x20703b);}return _0x39f596[_0xb9f4('0x1f')]();};}function saveUpdates(_0x52aebb,_0x234dce){return function(_0x4b3468){if(_0x4b3468){return _0x4b3468[_0xb9f4('0x20')](_0x52aebb)[_0xb9f4('0x21')](function(_0x367a29){return _0x367a29;});}return null;};}function removeEntity(_0x40e5ec,_0x428afe){return function(_0x525659){if(_0x525659){return _0x525659['destroy']()[_0xb9f4('0x21')](function(){_0x40e5ec['status'](0xcc)[_0xb9f4('0x19')]();});}};}function handleEntityNotFound(_0x62696c,_0x343030){return function(_0x193cd2){if(!_0x193cd2){_0x62696c['sendStatus'](0x194);}return _0x193cd2;};}function handleError(_0x3e3237,_0x59cf10){_0x59cf10=_0x59cf10||0x1f4;return function(_0x522aa4){logger[_0xb9f4('0x22')](_0x522aa4[_0xb9f4('0x23')]);if(_0x522aa4[_0xb9f4('0x24')]){delete _0x522aa4['name'];}_0x3e3237['status'](_0x59cf10)[_0xb9f4('0x25')](_0x522aa4);};}exports[_0xb9f4('0x26')]=function(_0x2eb2c9,_0x3b03e2){var _0x387605={},_0x45dfca={},_0x5f4f47={'count':0x0,'rows':[]};var _0x4bd912=_[_0xb9f4('0x27')](db[_0xb9f4('0x28')][_0xb9f4('0x29')],function(_0x1ced0c){return{'name':_0x1ced0c[_0xb9f4('0x2a')],'type':_0x1ced0c[_0xb9f4('0x2b')]['key']};});_0x45dfca[_0xb9f4('0x2c')]=_[_0xb9f4('0x27')](_0x4bd912,_0xb9f4('0x24'));_0x45dfca['query']=_[_0xb9f4('0x2d')](_0x2eb2c9['query']);_0x45dfca['filters']=_[_0xb9f4('0x2e')](_0x45dfca[_0xb9f4('0x2c')],_0x45dfca[_0xb9f4('0x2f')]);_0x387605[_0xb9f4('0x30')]=_[_0xb9f4('0x2e')](_0x45dfca[_0xb9f4('0x2c')],qs['fields'](_0x2eb2c9[_0xb9f4('0x2f')][_0xb9f4('0x31')]));_0x387605[_0xb9f4('0x30')]=_0x387605['attributes'][_0xb9f4('0x32')]?_0x387605[_0xb9f4('0x30')]:_0x45dfca[_0xb9f4('0x2c')];if(!_0x2eb2c9[_0xb9f4('0x2f')]['hasOwnProperty'](_0xb9f4('0x33'))){_0x387605['limit']=qs['limit'](_0x2eb2c9[_0xb9f4('0x2f')][_0xb9f4('0x34')]);_0x387605[_0xb9f4('0x1c')]=qs[_0xb9f4('0x1c')](_0x2eb2c9[_0xb9f4('0x2f')][_0xb9f4('0x1c')]);}_0x387605[_0xb9f4('0x35')]=qs[_0xb9f4('0x36')](_0x2eb2c9[_0xb9f4('0x2f')]['sort']);_0x387605[_0xb9f4('0x37')]=qs[_0xb9f4('0x38')](_[_0xb9f4('0x39')](_0x2eb2c9['query'],_0x45dfca[_0xb9f4('0x38')]),_0x4bd912);if(_0x2eb2c9[_0xb9f4('0x2f')][_0xb9f4('0x3a')]){_0x387605[_0xb9f4('0x37')]=_[_0xb9f4('0x3b')](_0x387605['where'],{'$or':_['map'](_0x4bd912,function(_0xa58dc7){if(_0xa58dc7[_0xb9f4('0x2b')]!==_0xb9f4('0x3c')){var _0x51a276={};_0x51a276[_0xa58dc7[_0xb9f4('0x24')]]={'$like':'%'+_0x2eb2c9[_0xb9f4('0x2f')][_0xb9f4('0x3a')]+'%'};return _0x51a276;}})});}_0x387605=_[_0xb9f4('0x3b')]({},_0x387605,_0x2eb2c9[_0xb9f4('0x3d')]);var _0x4ffe81={'where':_0x387605['where']};return db[_0xb9f4('0x28')]['count'](_0x4ffe81)[_0xb9f4('0x21')](function(_0x520602){_0x5f4f47[_0xb9f4('0x1b')]=_0x520602;if(_0x2eb2c9[_0xb9f4('0x2f')][_0xb9f4('0x3e')]){_0x387605['include']=[{'all':!![]}];}return db[_0xb9f4('0x28')][_0xb9f4('0x3f')](_0x387605);})[_0xb9f4('0x21')](function(_0x24496d){_0x5f4f47['rows']=_0x24496d;return _0x5f4f47;})[_0xb9f4('0x21')](respondWithFilteredResult(_0x3b03e2,_0x387605))[_0xb9f4('0x40')](handleError(_0x3b03e2,null));};exports[_0xb9f4('0x41')]=function(_0x5f2f2e,_0x513415){var _0x3a3f78={'raw':!![],'where':{'id':_0x5f2f2e[_0xb9f4('0x42')]['id']}},_0x1e3e48={};_0x1e3e48[_0xb9f4('0x2c')]=_[_0xb9f4('0x2d')](db[_0xb9f4('0x28')][_0xb9f4('0x29')]);_0x1e3e48[_0xb9f4('0x2f')]=_['keys'](_0x5f2f2e['query']);_0x1e3e48[_0xb9f4('0x38')]=_[_0xb9f4('0x2e')](_0x1e3e48[_0xb9f4('0x2c')],_0x1e3e48[_0xb9f4('0x2f')]);_0x3a3f78[_0xb9f4('0x30')]=_['intersection'](_0x1e3e48[_0xb9f4('0x2c')],qs[_0xb9f4('0x31')](_0x5f2f2e[_0xb9f4('0x2f')]['fields']));_0x3a3f78[_0xb9f4('0x30')]=_0x3a3f78[_0xb9f4('0x30')][_0xb9f4('0x32')]?_0x3a3f78[_0xb9f4('0x30')]:_0x1e3e48['model'];if(_0x5f2f2e['query']['includeAll']){_0x3a3f78['include']=[{'all':!![]}];}_0x3a3f78=_['merge']({},_0x3a3f78,_0x5f2f2e['options']);return db[_0xb9f4('0x28')][_0xb9f4('0x43')](_0x3a3f78)[_0xb9f4('0x21')](handleEntityNotFound(_0x513415,null))[_0xb9f4('0x21')](respondWithResult(_0x513415,null))[_0xb9f4('0x40')](handleError(_0x513415,null));};exports[_0xb9f4('0x44')]=function(_0x4e5154,_0x310f31){return db[_0xb9f4('0x28')][_0xb9f4('0x44')](_0x4e5154[_0xb9f4('0x45')],{})[_0xb9f4('0x21')](respondWithResult(_0x310f31,0xc9))[_0xb9f4('0x40')](handleError(_0x310f31,null));};exports[_0xb9f4('0x20')]=function(_0x94b71d,_0x24b98e){if(_0x94b71d[_0xb9f4('0x45')]['id']){delete _0x94b71d['body']['id'];}return db[_0xb9f4('0x28')][_0xb9f4('0x43')]({'where':{'id':_0x94b71d['params']['id']}})[_0xb9f4('0x21')](handleEntityNotFound(_0x24b98e,null))['then'](saveUpdates(_0x94b71d['body'],null))[_0xb9f4('0x21')](respondWithResult(_0x24b98e,null))[_0xb9f4('0x40')](handleError(_0x24b98e,null));};exports[_0xb9f4('0x46')]=function(_0x3b0bef,_0x356493){return db[_0xb9f4('0x28')]['find']({'where':{'id':_0x3b0bef['params']['id']}})[_0xb9f4('0x21')](handleEntityNotFound(_0x356493,null))[_0xb9f4('0x21')](removeEntity(_0x356493,null))[_0xb9f4('0x40')](handleError(_0x356493,null));};exports[_0xb9f4('0x47')]=function(_0x5b54cf,_0x51e95e){return db[_0xb9f4('0x28')][_0xb9f4('0x47')]()[_0xb9f4('0x21')](respondWithResult(_0x51e95e,null))[_0xb9f4('0x40')](handleError(_0x51e95e,null));};
\ No newline at end of file
+var _0xf015=['api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','MemberReport','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x107995,_0x42fb77){var _0xa09073=function(_0x581ba7){while(--_0x581ba7){_0x107995['push'](_0x107995['shift']());}};_0xa09073(++_0x42fb77);}(_0xf015,0xc2));var _0x5f01=function(_0x1823e9,_0x2d7b01){_0x1823e9=_0x1823e9-0x0;var _0x29808f=_0xf015[_0x1823e9];return _0x29808f;};'use strict';var pdf=require(_0x5f01('0x0'));var emlformat=require(_0x5f01('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5f01('0x2'));var jsonpatch=require(_0x5f01('0x3'));var rp=require(_0x5f01('0x4'));var moment=require(_0x5f01('0x5'));var BPromise=require(_0x5f01('0x6'));var Mustache=require(_0x5f01('0x7'));var util=require(_0x5f01('0x8'));var path=require(_0x5f01('0x9'));var sox=require(_0x5f01('0xa'));var csv=require('to-csv');var ejs=require(_0x5f01('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f01('0xc'));var jsforce=require(_0x5f01('0xd'));var deskjs=require(_0x5f01('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5f01('0xf'));var Redis=require('ioredis');var authService=require(_0x5f01('0x10'));var qs=require(_0x5f01('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f01('0x12'))(_0x5f01('0x13'));var utils=require('../../config/utils');var config=require(_0x5f01('0x14'));var db=require(_0x5f01('0x15'))['db'];function respondWithStatusCode(_0x5f2b92,_0x4de2ce){_0x4de2ce=_0x4de2ce||0xcc;return function(_0xcdc919){if(_0xcdc919){return _0x5f2b92[_0x5f01('0x16')](_0x4de2ce);}return _0x5f2b92[_0x5f01('0x17')](_0x4de2ce)['end']();};}function respondWithResult(_0x2b77f6,_0x4498b6){_0x4498b6=_0x4498b6||0xc8;return function(_0x4d13f0){if(_0x4d13f0){return _0x2b77f6[_0x5f01('0x17')](_0x4498b6)[_0x5f01('0x18')](_0x4d13f0);}};}function respondWithFilteredResult(_0x2664cf,_0x1f0bd1){return function(_0x100a71){if(_0x100a71){var _0x16f8ea=_0x100a71['count'],_0x1bba2b=_0x1f0bd1[_0x5f01('0x19')],_0x2be2b5=_0x1f0bd1[_0x5f01('0x19')]+_0x1f0bd1['limit'],_0x568523;if(_0x2be2b5>=_0x16f8ea){_0x2be2b5=_0x16f8ea;_0x568523=0xc8;}else{_0x568523=0xce;}_0x2664cf[_0x5f01('0x17')](_0x568523);return _0x2664cf[_0x5f01('0x1a')](_0x5f01('0x1b'),_0x1bba2b+'-'+_0x2be2b5+'/'+_0x16f8ea)['json'](_0x100a71);}return null;};}function patchUpdates(_0x27069f){return function(_0x1d8040){try{jsonpatch[_0x5f01('0x1c')](_0x1d8040,_0x27069f,!![]);}catch(_0x4daadf){return BPromise[_0x5f01('0x1d')](_0x4daadf);}return _0x1d8040[_0x5f01('0x1e')]();};}function saveUpdates(_0x1bfd4c,_0x5ae548){return function(_0x1d437b){if(_0x1d437b){return _0x1d437b[_0x5f01('0x1f')](_0x1bfd4c)['then'](function(_0x243f75){return _0x243f75;});}return null;};}function removeEntity(_0x35cd02,_0x5c8cc6){return function(_0xbd9e82){if(_0xbd9e82){return _0xbd9e82[_0x5f01('0x20')]()[_0x5f01('0x21')](function(){_0x35cd02[_0x5f01('0x17')](0xcc)[_0x5f01('0x22')]();});}};}function handleEntityNotFound(_0x37a817,_0x268ce8){return function(_0x15af9b){if(!_0x15af9b){_0x37a817[_0x5f01('0x16')](0x194);}return _0x15af9b;};}function handleError(_0x59193f,_0x2cc737){_0x2cc737=_0x2cc737||0x1f4;return function(_0x32874a){logger[_0x5f01('0x23')](_0x32874a[_0x5f01('0x24')]);if(_0x32874a[_0x5f01('0x25')]){delete _0x32874a['name'];}_0x59193f[_0x5f01('0x17')](_0x2cc737)[_0x5f01('0x26')](_0x32874a);};}exports[_0x5f01('0x27')]=function(_0x52b76d,_0x482ea3){var _0x1c2074={},_0x11bc29={},_0x42287f={'count':0x0,'rows':[]};var _0x5ec8ee=_[_0x5f01('0x28')](db[_0x5f01('0x29')]['rawAttributes'],function(_0x3ca33b){return{'name':_0x3ca33b['fieldName'],'type':_0x3ca33b['type'][_0x5f01('0x2a')]};});_0x11bc29[_0x5f01('0x2b')]=_[_0x5f01('0x28')](_0x5ec8ee,_0x5f01('0x25'));_0x11bc29[_0x5f01('0x2c')]=_[_0x5f01('0x2d')](_0x52b76d[_0x5f01('0x2c')]);_0x11bc29['filters']=_[_0x5f01('0x2e')](_0x11bc29[_0x5f01('0x2b')],_0x11bc29['query']);_0x1c2074[_0x5f01('0x2f')]=_[_0x5f01('0x2e')](_0x11bc29[_0x5f01('0x2b')],qs[_0x5f01('0x30')](_0x52b76d[_0x5f01('0x2c')]['fields']));_0x1c2074['attributes']=_0x1c2074[_0x5f01('0x2f')][_0x5f01('0x31')]?_0x1c2074['attributes']:_0x11bc29['model'];if(!_0x52b76d['query'][_0x5f01('0x32')](_0x5f01('0x33'))){_0x1c2074[_0x5f01('0x34')]=qs[_0x5f01('0x34')](_0x52b76d[_0x5f01('0x2c')][_0x5f01('0x34')]);_0x1c2074[_0x5f01('0x19')]=qs['offset'](_0x52b76d[_0x5f01('0x2c')][_0x5f01('0x19')]);}_0x1c2074['order']=qs['sort'](_0x52b76d[_0x5f01('0x2c')][_0x5f01('0x35')]);_0x1c2074[_0x5f01('0x36')]=qs[_0x5f01('0x37')](_['pick'](_0x52b76d['query'],_0x11bc29['filters']),_0x5ec8ee);if(_0x52b76d[_0x5f01('0x2c')][_0x5f01('0x38')]){_0x1c2074[_0x5f01('0x36')]=_[_0x5f01('0x39')](_0x1c2074['where'],{'$or':_[_0x5f01('0x28')](_0x5ec8ee,function(_0x380b20){if(_0x380b20[_0x5f01('0x3a')]!==_0x5f01('0x3b')){var _0x4bebcf={};_0x4bebcf[_0x380b20[_0x5f01('0x25')]]={'$like':'%'+_0x52b76d['query'][_0x5f01('0x38')]+'%'};return _0x4bebcf;}})});}_0x1c2074=_[_0x5f01('0x39')]({},_0x1c2074,_0x52b76d[_0x5f01('0x3c')]);var _0x1e7144={'where':_0x1c2074[_0x5f01('0x36')]};return db[_0x5f01('0x29')]['count'](_0x1e7144)[_0x5f01('0x21')](function(_0x59428e){_0x42287f['count']=_0x59428e;if(_0x52b76d[_0x5f01('0x2c')][_0x5f01('0x3d')]){_0x1c2074['include']=[{'all':!![]}];}return db[_0x5f01('0x29')][_0x5f01('0x3e')](_0x1c2074);})['then'](function(_0x289831){_0x42287f[_0x5f01('0x3f')]=_0x289831;return _0x42287f;})[_0x5f01('0x21')](respondWithFilteredResult(_0x482ea3,_0x1c2074))['catch'](handleError(_0x482ea3,null));};exports['show']=function(_0x41e418,_0x2de445){var _0x5b0b05={'raw':!![],'where':{'id':_0x41e418[_0x5f01('0x40')]['id']}},_0x3e3bf4={};_0x3e3bf4[_0x5f01('0x2b')]=_[_0x5f01('0x2d')](db[_0x5f01('0x29')]['rawAttributes']);_0x3e3bf4[_0x5f01('0x2c')]=_[_0x5f01('0x2d')](_0x41e418['query']);_0x3e3bf4['filters']=_[_0x5f01('0x2e')](_0x3e3bf4[_0x5f01('0x2b')],_0x3e3bf4['query']);_0x5b0b05[_0x5f01('0x2f')]=_['intersection'](_0x3e3bf4['model'],qs['fields'](_0x41e418['query'][_0x5f01('0x30')]));_0x5b0b05[_0x5f01('0x2f')]=_0x5b0b05[_0x5f01('0x2f')][_0x5f01('0x31')]?_0x5b0b05[_0x5f01('0x2f')]:_0x3e3bf4['model'];if(_0x41e418[_0x5f01('0x2c')]['includeAll']){_0x5b0b05[_0x5f01('0x41')]=[{'all':!![]}];}_0x5b0b05=_[_0x5f01('0x39')]({},_0x5b0b05,_0x41e418[_0x5f01('0x3c')]);return db[_0x5f01('0x29')][_0x5f01('0x42')](_0x5b0b05)[_0x5f01('0x21')](handleEntityNotFound(_0x2de445,null))[_0x5f01('0x21')](respondWithResult(_0x2de445,null))[_0x5f01('0x43')](handleError(_0x2de445,null));};exports[_0x5f01('0x44')]=function(_0x56c60c,_0x254919){return db['MemberReport'][_0x5f01('0x44')](_0x56c60c['body'],{})[_0x5f01('0x21')](respondWithResult(_0x254919,0xc9))['catch'](handleError(_0x254919,null));};exports[_0x5f01('0x1f')]=function(_0x546abc,_0xbb1da){if(_0x546abc[_0x5f01('0x45')]['id']){delete _0x546abc['body']['id'];}return db[_0x5f01('0x29')][_0x5f01('0x42')]({'where':{'id':_0x546abc['params']['id']}})[_0x5f01('0x21')](handleEntityNotFound(_0xbb1da,null))[_0x5f01('0x21')](saveUpdates(_0x546abc['body'],null))[_0x5f01('0x21')](respondWithResult(_0xbb1da,null))['catch'](handleError(_0xbb1da,null));};exports[_0x5f01('0x20')]=function(_0x580856,_0x68b9df){return db[_0x5f01('0x29')]['find']({'where':{'id':_0x580856[_0x5f01('0x40')]['id']}})['then'](handleEntityNotFound(_0x68b9df,null))['then'](removeEntity(_0x68b9df,null))[_0x5f01('0x43')](handleError(_0x68b9df,null));};exports[_0x5f01('0x46')]=function(_0x137899,_0x1f65e8){return db['MemberReport'][_0x5f01('0x46')]()[_0x5f01('0x21')](respondWithResult(_0x1f65e8,null))[_0x5f01('0x43')](handleError(_0x1f65e8,null));};
\ No newline at end of file
index db41eb6..96c7ddc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x185f=['membername','interface','lodash','util','../../config/logger','moment','request-promise','define','MemberReport','report_member','membername_interface'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x185f,0x9c));var _0xf185=function(_0x30aa9c,_0x19da4a){_0x30aa9c=_0x30aa9c-0x0;var _0x3bb5dc=_0x185f[_0x30aa9c];return _0x3bb5dc;};'use strict';var _=require(_0xf185('0x0'));var util=require(_0xf185('0x1'));var logger=require(_0xf185('0x2'))('api');var moment=require(_0xf185('0x3'));var BPromise=require('bluebird');var rp=require(_0xf185('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x5e2b2a,_0x564c4c){return _0x5e2b2a[_0xf185('0x5')](_0xf185('0x6'),attributes,{'tableName':_0xf185('0x7'),'paranoid':![],'indexes':[{'name':_0xf185('0x8'),'fields':[_0xf185('0x9'),_0xf185('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa76b=['define','MemberReport','membername_interface','membername','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./memberReport.attributes','exports'];(function(_0x19ba39,_0x2e167d){var _0x981253=function(_0x3848cf){while(--_0x3848cf){_0x19ba39['push'](_0x19ba39['shift']());}};_0x981253(++_0x2e167d);}(_0xa76b,0x9e));var _0xba76=function(_0x4e8cb1,_0x46fb83){_0x4e8cb1=_0x4e8cb1-0x0;var _0x50d8a2=_0xa76b[_0x4e8cb1];return _0x50d8a2;};'use strict';var _=require(_0xba76('0x0'));var util=require(_0xba76('0x1'));var logger=require(_0xba76('0x2'))(_0xba76('0x3'));var moment=require(_0xba76('0x4'));var BPromise=require(_0xba76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba76('0x6'));var rimraf=require(_0xba76('0x7'));var config=require('../../config/environment');var attributes=require(_0xba76('0x8'));module[_0xba76('0x9')]=function(_0x49b666,_0x454866){return _0x49b666[_0xba76('0xa')](_0xba76('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xba76('0xc'),'fields':[_0xba76('0xd'),'interface']}],'timestamps':!![]});};
\ No newline at end of file
index e89216d..bc6c4d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x111a=['bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetMemberReport','findAll','options','where','attributes','limit','include','map','model','catch','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','raw','lodash','util','moment'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x111a,0x1c4));var _0xa111=function(_0x53f744,_0x31eb7b){_0x53f744=_0x53f744-0x0;var _0x946276=_0x111a[_0x53f744];return _0x946276;};'use strict';var _=require(_0xa111('0x0'));var util=require(_0xa111('0x1'));var moment=require(_0xa111('0x2'));var BPromise=require(_0xa111('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa111('0x4'))['db'];var utils=require(_0xa111('0x5'));var logger=require(_0xa111('0x6'))('rpc');var config=require(_0xa111('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa111('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a22c1,_0x99f39,_0x492580){return new BPromise(function(_0xccce,_0xd35f19){return client[_0xa111('0x9')](_0x5a22c1,_0x492580)[_0xa111('0xa')](function(_0x17508c){logger[_0xa111('0xb')](_0xa111('0xc'),_0x99f39,_0xa111('0xd'));logger[_0xa111('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x99f39,_0xa111('0xd'),JSON[_0xa111('0xf')](_0x17508c));if(_0x17508c[_0xa111('0x10')]){if(_0x17508c[_0xa111('0x10')]['code']===0x1f4){logger[_0xa111('0x10')](_0xa111('0xc'),_0x99f39,_0x17508c[_0xa111('0x10')]['message']);return _0xd35f19(_0x17508c[_0xa111('0x10')][_0xa111('0x11')]);}logger[_0xa111('0x10')]('MemberReport,\x20%s,\x20%s',_0x99f39,_0x17508c[_0xa111('0x10')][_0xa111('0x11')]);return _0xccce(_0x17508c[_0xa111('0x10')][_0xa111('0x11')]);}else{logger[_0xa111('0xb')](_0xa111('0xc'),_0x99f39,_0xa111('0xd'));_0xccce(_0x17508c[_0xa111('0x12')][_0xa111('0x11')]);}})['catch'](function(_0x9947d1){logger[_0xa111('0x10')]('MemberReport,\x20%s,\x20%s',_0x99f39,_0x9947d1);_0xd35f19(_0x9947d1);});});}exports[_0xa111('0x13')]=function(_0x2c4e81){var _0x1794b1=this;return new Promise(function(_0x560ce8,_0x484331){return db['MemberReport'][_0xa111('0x14')]({'raw':_0x2c4e81['options']?_0x2c4e81['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c4e81[_0xa111('0x15')]?_0x2c4e81[_0xa111('0x15')][_0xa111('0x16')]||null:null,'attributes':_0x2c4e81[_0xa111('0x15')]?_0x2c4e81[_0xa111('0x15')][_0xa111('0x17')]||null:null,'limit':_0x2c4e81[_0xa111('0x15')]?_0x2c4e81[_0xa111('0x15')][_0xa111('0x18')]||null:null,'include':_0x2c4e81[_0xa111('0x15')]?_0x2c4e81[_0xa111('0x15')][_0xa111('0x19')]?_[_0xa111('0x1a')](_0x2c4e81[_0xa111('0x15')][_0xa111('0x19')],function(_0x18421b){return{'model':db[_0x18421b['model']],'as':_0x18421b['as'],'attributes':_0x18421b[_0xa111('0x17')],'include':_0x18421b[_0xa111('0x19')]?_[_0xa111('0x1a')](_0x18421b[_0xa111('0x19')],function(_0x1b6f66){return{'model':db[_0x1b6f66['model']],'as':_0x1b6f66['as'],'attributes':_0x1b6f66[_0xa111('0x17')],'include':_0x1b6f66[_0xa111('0x19')]?_[_0xa111('0x1a')](_0x1b6f66[_0xa111('0x19')],function(_0x5b859f){return{'model':db[_0x5b859f[_0xa111('0x1b')]],'as':_0x5b859f['as'],'attributes':_0x5b859f['attributes']};}):[]};}):[]};}):[]:[]})[_0xa111('0xa')](function(_0x124574){logger[_0xa111('0xb')](_0xa111('0x13'),_0x2c4e81);logger[_0xa111('0xe')](_0xa111('0x13'),_0x2c4e81,JSON[_0xa111('0xf')](_0x124574));_0x560ce8(_0x124574);})[_0xa111('0x1c')](function(_0x57ceef){logger[_0xa111('0x10')](_0xa111('0x13'),_0x57ceef[_0xa111('0x11')],_0x2c4e81);_0x484331(_0x1794b1[_0xa111('0x10')](0x1f4,_0x57ceef[_0xa111('0x11')]));});});};exports[_0xa111('0x1d')]=function(_0x170fac){var _0x695df9=this;return new Promise(function(_0x57da5f,_0x8efdff){return db[_0xa111('0x1e')][_0xa111('0x1f')](_0x170fac[_0xa111('0x20')],{'raw':_0x170fac[_0xa111('0x15')]?_0x170fac[_0xa111('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4446b0){logger['info'](_0xa111('0x1d'),_0x170fac);logger['debug'](_0xa111('0x1d'),_0x170fac,JSON[_0xa111('0xf')](_0x4446b0));_0x57da5f(_0x4446b0);})['catch'](function(_0x339278){logger[_0xa111('0x10')]('CreateMemberReport',_0x339278[_0xa111('0x11')],_0x170fac);_0x8efdff(_0x695df9[_0xa111('0x10')](0x1f4,_0x339278['message']));});});};exports[_0xa111('0x21')]=function(_0x222fc3){var _0x193f16=this;return new Promise(function(_0x4b3f7e,_0xd7dbe1){return db[_0xa111('0x1e')]['update'](_0x222fc3['body'],{'raw':_0x222fc3[_0xa111('0x15')]?_0x222fc3[_0xa111('0x15')][_0xa111('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x222fc3[_0xa111('0x15')]?_0x222fc3[_0xa111('0x15')][_0xa111('0x16')]||null:null,'attributes':_0x222fc3[_0xa111('0x15')]?_0x222fc3[_0xa111('0x15')][_0xa111('0x17')]||null:null,'limit':_0x222fc3['options']?_0x222fc3[_0xa111('0x15')]['limit']||null:null})[_0xa111('0xa')](function(_0x447a1b){logger[_0xa111('0xb')]('UpdateMemberReport',_0x222fc3);logger[_0xa111('0xe')]('UpdateMemberReport',_0x222fc3,JSON[_0xa111('0xf')](_0x447a1b));_0x4b3f7e(_0x447a1b);})[_0xa111('0x1c')](function(_0x233184){logger[_0xa111('0x10')]('UpdateMemberReport',_0x233184[_0xa111('0x11')],_0x222fc3);_0xd7dbe1(_0x193f16[_0xa111('0x10')](0x1f4,_0x233184[_0xa111('0x11')]));});});};
\ No newline at end of file
+var _0xc686=['MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','then','CreateMemberReport','create','UpdateMemberReport','update','body','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport'];(function(_0x351ba6,_0x399ec7){var _0x38cd38=function(_0x461e15){while(--_0x461e15){_0x351ba6['push'](_0x351ba6['shift']());}};_0x38cd38(++_0x399ec7);}(_0xc686,0x1cc));var _0x6c68=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xc686[_0x411add];return _0x238242;};'use strict';var _=require('lodash');var util=require(_0x6c68('0x0'));var moment=require('moment');var BPromise=require(_0x6c68('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c68('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c68('0x3'));var logger=require(_0x6c68('0x4'))(_0x6c68('0x5'));var config=require('../../config/environment');var jayson=require(_0x6c68('0x6'));var client=jayson[_0x6c68('0x7')][_0x6c68('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12df08,_0x357c08,_0xc77c1d){return new BPromise(function(_0x344a6a,_0x4a398e){return client[_0x6c68('0x9')](_0x12df08,_0xc77c1d)['then'](function(_0x32d8b9){logger[_0x6c68('0xa')](_0x6c68('0xb'),_0x357c08,_0x6c68('0xc'));logger[_0x6c68('0xd')](_0x6c68('0xe'),_0x357c08,_0x6c68('0xc'),JSON[_0x6c68('0xf')](_0x32d8b9));if(_0x32d8b9['error']){if(_0x32d8b9[_0x6c68('0x10')]['code']===0x1f4){logger[_0x6c68('0x10')](_0x6c68('0xb'),_0x357c08,_0x32d8b9[_0x6c68('0x10')][_0x6c68('0x11')]);return _0x4a398e(_0x32d8b9[_0x6c68('0x10')][_0x6c68('0x11')]);}logger[_0x6c68('0x10')](_0x6c68('0xb'),_0x357c08,_0x32d8b9['error'][_0x6c68('0x11')]);return _0x344a6a(_0x32d8b9[_0x6c68('0x10')]['message']);}else{logger[_0x6c68('0xa')]('MemberReport,\x20%s,\x20%s',_0x357c08,'request\x20sent');_0x344a6a(_0x32d8b9[_0x6c68('0x12')]['message']);}})[_0x6c68('0x13')](function(_0x12d24e){logger[_0x6c68('0x10')](_0x6c68('0xb'),_0x357c08,_0x12d24e);_0x4a398e(_0x12d24e);});});}exports[_0x6c68('0x14')]=function(_0x242643){var _0x569342=this;return new Promise(function(_0x17035b,_0x212625){return db[_0x6c68('0x15')][_0x6c68('0x16')]({'raw':_0x242643[_0x6c68('0x17')]?_0x242643['options'][_0x6c68('0x18')]===undefined?!![]:![]:!![],'where':_0x242643[_0x6c68('0x17')]?_0x242643[_0x6c68('0x17')][_0x6c68('0x19')]||null:null,'attributes':_0x242643['options']?_0x242643[_0x6c68('0x17')][_0x6c68('0x1a')]||null:null,'limit':_0x242643[_0x6c68('0x17')]?_0x242643['options'][_0x6c68('0x1b')]||null:null,'include':_0x242643[_0x6c68('0x17')]?_0x242643[_0x6c68('0x17')][_0x6c68('0x1c')]?_[_0x6c68('0x1d')](_0x242643[_0x6c68('0x17')]['include'],function(_0x10587b){return{'model':db[_0x10587b[_0x6c68('0x1e')]],'as':_0x10587b['as'],'attributes':_0x10587b[_0x6c68('0x1a')],'include':_0x10587b[_0x6c68('0x1c')]?_['map'](_0x10587b[_0x6c68('0x1c')],function(_0x1c736c){return{'model':db[_0x1c736c['model']],'as':_0x1c736c['as'],'attributes':_0x1c736c[_0x6c68('0x1a')],'include':_0x1c736c[_0x6c68('0x1c')]?_[_0x6c68('0x1d')](_0x1c736c[_0x6c68('0x1c')],function(_0x665ee4){return{'model':db[_0x665ee4[_0x6c68('0x1e')]],'as':_0x665ee4['as'],'attributes':_0x665ee4[_0x6c68('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6c68('0x1f')](function(_0x43fd23){logger[_0x6c68('0xa')](_0x6c68('0x14'),_0x242643);logger['debug']('GetMemberReport',_0x242643,JSON[_0x6c68('0xf')](_0x43fd23));_0x17035b(_0x43fd23);})['catch'](function(_0x40ae9d){logger['error'](_0x6c68('0x14'),_0x40ae9d[_0x6c68('0x11')],_0x242643);_0x212625(_0x569342[_0x6c68('0x10')](0x1f4,_0x40ae9d[_0x6c68('0x11')]));});});};exports[_0x6c68('0x20')]=function(_0x4d690c){var _0x3636e4=this;return new Promise(function(_0x306f68,_0x4ef4cd){return db[_0x6c68('0x15')][_0x6c68('0x21')](_0x4d690c['body'],{'raw':_0x4d690c[_0x6c68('0x17')]?_0x4d690c[_0x6c68('0x17')][_0x6c68('0x18')]===undefined?!![]:![]:!![]})[_0x6c68('0x1f')](function(_0x456579){logger[_0x6c68('0xa')](_0x6c68('0x20'),_0x4d690c);logger[_0x6c68('0xd')](_0x6c68('0x20'),_0x4d690c,JSON[_0x6c68('0xf')](_0x456579));_0x306f68(_0x456579);})[_0x6c68('0x13')](function(_0x1f40cf){logger[_0x6c68('0x10')](_0x6c68('0x20'),_0x1f40cf[_0x6c68('0x11')],_0x4d690c);_0x4ef4cd(_0x3636e4[_0x6c68('0x10')](0x1f4,_0x1f40cf[_0x6c68('0x11')]));});});};exports[_0x6c68('0x22')]=function(_0x2d6be7){var _0x4e882a=this;return new Promise(function(_0x315a56,_0x5165d9){return db[_0x6c68('0x15')][_0x6c68('0x23')](_0x2d6be7[_0x6c68('0x24')],{'raw':_0x2d6be7['options']?_0x2d6be7[_0x6c68('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d6be7[_0x6c68('0x17')]?_0x2d6be7[_0x6c68('0x17')][_0x6c68('0x19')]||null:null,'attributes':_0x2d6be7[_0x6c68('0x17')]?_0x2d6be7[_0x6c68('0x17')][_0x6c68('0x1a')]||null:null,'limit':_0x2d6be7[_0x6c68('0x17')]?_0x2d6be7[_0x6c68('0x17')][_0x6c68('0x1b')]||null:null})[_0x6c68('0x1f')](function(_0x599e73){logger['info']('UpdateMemberReport',_0x2d6be7);logger['debug']('UpdateMemberReport',_0x2d6be7,JSON[_0x6c68('0xf')](_0x599e73));_0x315a56(_0x599e73);})[_0x6c68('0x13')](function(_0x4c52ff){logger[_0x6c68('0x10')](_0x6c68('0x22'),_0x4c52ff[_0x6c68('0x11')],_0x2d6be7);_0x5165d9(_0x4e882a[_0x6c68('0x10')](0x1f4,_0x4c52ff[_0x6c68('0x11')]));});});};
\ No newline at end of file
index 245a618..2dd8298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1339=['./migration.controller','index','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0x1339,0x1ed));var _0x9133=function(_0x26e53c,_0x4dd428){_0x26e53c=_0x26e53c-0x0;var _0x75c1f7=_0x1339[_0x26e53c];return _0x75c1f7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var auth=require(_0x9133('0x4'));var interaction=require(_0x9133('0x5'));var config=require(_0x9133('0x6'));var controller=require(_0x9133('0x7'));router['get']('/',controller[_0x9133('0x8')]);module[_0x9133('0x9')]=router;
\ No newline at end of file
+var _0x91a7=['util','path','connect-timeout','Router','../../components/interaction/service','get','index'];(function(_0x236400,_0x5b07d9){var _0x62495f=function(_0x2e45d3){while(--_0x2e45d3){_0x236400['push'](_0x236400['shift']());}};_0x62495f(++_0x5b07d9);}(_0x91a7,0xe7));var _0x791a=function(_0xd47916,_0x4be2a2){_0xd47916=_0xd47916-0x0;var _0x30759c=_0x91a7[_0xd47916];return _0x30759c;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x791a('0x4'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x791a('0x5')]('/',controller[_0x791a('0x6')]);module['exports']=router;
\ No newline at end of file
index 4aa6ec1..dc3120f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a57=['exports','STRING'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0x3a57,0xc8));var _0x73a5=function(_0x474900,_0x486253){_0x474900=_0x474900-0x0;var _0x2f3093=_0x3a57[_0x474900];return _0x2f3093;};'use strict';var Sequelize=require('sequelize');module[_0x73a5('0x0')]={'version':{'type':Sequelize[_0x73a5('0x1')],'unique':'version'}};
\ No newline at end of file
+var _0xa6d3=['version','sequelize','exports','STRING'];(function(_0x596487,_0x429810){var _0x307949=function(_0x4b7f6c){while(--_0x4b7f6c){_0x596487['push'](_0x596487['shift']());}};_0x307949(++_0x429810);}(_0xa6d3,0xe9));var _0x3a6d=function(_0x59d041,_0x5c13f3){_0x59d041=_0x59d041-0x0;var _0x102dd5=_0xa6d3[_0x59d041];return _0x102dd5;};'use strict';var Sequelize=require(_0x3a6d('0x0'));module[_0x3a6d('0x1')]={'version':{'type':Sequelize[_0x3a6d('0x2')],'unique':_0x3a6d('0x3')}};
\ No newline at end of file
index 6183116..610288c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','Migration','include','findAll','rows','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe706,0xa3));var _0x6e70=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0xe706[_0x1a4748];return _0x28ca99;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=_[_0x6e70('0x2c')](db['Migration'][_0x6e70('0x2d')],function(_0x406f29){return{'name':_0x406f29[_0x6e70('0x2e')],'type':_0x406f29[_0x6e70('0x2f')][_0x6e70('0x30')]};});_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x2c')](_0x114344,_0x6e70('0x29'));_0x3af17f[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x4a67ac['query']);_0x3af17f[_0x6e70('0x34')]=_['intersection'](_0x3af17f[_0x6e70('0x31')],_0x3af17f['query']);_0x2c4d37[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x3af17f[_0x6e70('0x31')],qs['fields'](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x37')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x31')];if(!_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x39')](_0x6e70('0x3a'))){_0x2c4d37[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x3b')]=qs[_0x6e70('0x3b')](_0x4a67ac['query'][_0x6e70('0x3b')]);}_0x2c4d37['order']=qs[_0x6e70('0x3c')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3c')]);_0x2c4d37[_0x6e70('0x3d')]=qs[_0x6e70('0x34')](_[_0x6e70('0x3e')](_0x4a67ac[_0x6e70('0x32')],_0x3af17f[_0x6e70('0x34')]),_0x114344);if(_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]){_0x2c4d37[_0x6e70('0x3d')]=_[_0x6e70('0x40')](_0x2c4d37[_0x6e70('0x3d')],{'$or':_['map'](_0x114344,function(_0x5446a2){if(_0x5446a2['type']!==_0x6e70('0x41')){var _0x3841a0={};_0x3841a0[_0x5446a2[_0x6e70('0x29')]]={'$like':'%'+_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]+'%'};return _0x3841a0;}})});}_0x2c4d37=_[_0x6e70('0x40')]({},_0x2c4d37,_0x4a67ac['options']);var _0x3b508c={'where':_0x2c4d37[_0x6e70('0x3d')]};return db[_0x6e70('0x42')][_0x6e70('0x1f')](_0x3b508c)[_0x6e70('0x27')](function(_0x37bf46){_0x83c836[_0x6e70('0x1f')]=_0x37bf46;if(_0x4a67ac[_0x6e70('0x32')]['includeAll']){_0x2c4d37[_0x6e70('0x43')]=[{'all':!![]}];}return db[_0x6e70('0x42')][_0x6e70('0x44')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x201da9){_0x83c836[_0x6e70('0x45')]=_0x201da9;return _0x83c836;})[_0x6e70('0x27')](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))['catch'](handleError(_0x54a5fe,null));};
\ No newline at end of file
+var _0x00bb=['html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','count','offset','Content-Range','apply','update','then','destroy','error','stack','map','Migration','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x00bb[_0x46aff0];return _0x9d78cf;};'use strict';var pdf=require(_0xb00b('0x0'));var emlformat=require(_0xb00b('0x1'));var rimraf=require(_0xb00b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb00b('0x3'));var rp=require('request-promise');var moment=require(_0xb00b('0x4'));var BPromise=require(_0xb00b('0x5'));var Mustache=require('mustache');var util=require(_0xb00b('0x6'));var path=require(_0xb00b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ff792,_0x2d8ddf){_0x2d8ddf=_0x2d8ddf||0xcc;return function(_0x1be8aa){if(_0x1be8aa){return _0x4ff792[_0xb00b('0x14')](_0x2d8ddf);}return _0x4ff792[_0xb00b('0x15')](_0x2d8ddf)[_0xb00b('0x16')]();};}function respondWithResult(_0x4ada81,_0x218de2){_0x218de2=_0x218de2||0xc8;return function(_0xb0d42e){if(_0xb0d42e){return _0x4ada81['status'](_0x218de2)[_0xb00b('0x17')](_0xb0d42e);}};}function respondWithFilteredResult(_0x1084a6,_0x540b79){return function(_0x5da36b){if(_0x5da36b){var _0x9b471e=_0x5da36b[_0xb00b('0x18')],_0x4dcd45=_0x540b79[_0xb00b('0x19')],_0x51d136=_0x540b79[_0xb00b('0x19')]+_0x540b79['limit'],_0x1f9c78;if(_0x51d136>=_0x9b471e){_0x51d136=_0x9b471e;_0x1f9c78=0xc8;}else{_0x1f9c78=0xce;}_0x1084a6[_0xb00b('0x15')](_0x1f9c78);return _0x1084a6['set'](_0xb00b('0x1a'),_0x4dcd45+'-'+_0x51d136+'/'+_0x9b471e)['json'](_0x5da36b);}return null;};}function patchUpdates(_0x25d7a0){return function(_0x5e8d7b){try{jsonpatch[_0xb00b('0x1b')](_0x5e8d7b,_0x25d7a0,!![]);}catch(_0x3355a3){return BPromise['reject'](_0x3355a3);}return _0x5e8d7b['save']();};}function saveUpdates(_0x2b0da1,_0x4a334b){return function(_0x1344c4){if(_0x1344c4){return _0x1344c4[_0xb00b('0x1c')](_0x2b0da1)[_0xb00b('0x1d')](function(_0x3501af){return _0x3501af;});}return null;};}function removeEntity(_0x56c189,_0x362ee0){return function(_0x4df284){if(_0x4df284){return _0x4df284[_0xb00b('0x1e')]()[_0xb00b('0x1d')](function(){_0x56c189['status'](0xcc)[_0xb00b('0x16')]();});}};}function handleEntityNotFound(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(!_0x3ab3cc){_0x2896d1[_0xb00b('0x14')](0x194);}return _0x3ab3cc;};}function handleError(_0x5568bb,_0x44efe5){_0x44efe5=_0x44efe5||0x1f4;return function(_0x243fdb){logger[_0xb00b('0x1f')](_0x243fdb[_0xb00b('0x20')]);if(_0x243fdb['name']){delete _0x243fdb['name'];}_0x5568bb[_0xb00b('0x15')](_0x44efe5)['send'](_0x243fdb);};}exports['index']=function(_0x4a635e,_0x16ac55){var _0x73b6b0={},_0x2592cf={},_0x3825af={'count':0x0,'rows':[]};var _0x1f14fa=_[_0xb00b('0x21')](db[_0xb00b('0x22')]['rawAttributes'],function(_0x22c22d){return{'name':_0x22c22d['fieldName'],'type':_0x22c22d[_0xb00b('0x23')][_0xb00b('0x24')]};});_0x2592cf[_0xb00b('0x25')]=_['map'](_0x1f14fa,_0xb00b('0x26'));_0x2592cf[_0xb00b('0x27')]=_[_0xb00b('0x28')](_0x4a635e[_0xb00b('0x27')]);_0x2592cf[_0xb00b('0x29')]=_[_0xb00b('0x2a')](_0x2592cf[_0xb00b('0x25')],_0x2592cf[_0xb00b('0x27')]);_0x73b6b0[_0xb00b('0x2b')]=_['intersection'](_0x2592cf[_0xb00b('0x25')],qs[_0xb00b('0x2c')](_0x4a635e['query'][_0xb00b('0x2c')]));_0x73b6b0[_0xb00b('0x2b')]=_0x73b6b0['attributes'][_0xb00b('0x2d')]?_0x73b6b0['attributes']:_0x2592cf[_0xb00b('0x25')];if(!_0x4a635e[_0xb00b('0x27')][_0xb00b('0x2e')](_0xb00b('0x2f'))){_0x73b6b0[_0xb00b('0x30')]=qs[_0xb00b('0x30')](_0x4a635e[_0xb00b('0x27')]['limit']);_0x73b6b0['offset']=qs['offset'](_0x4a635e[_0xb00b('0x27')][_0xb00b('0x19')]);}_0x73b6b0[_0xb00b('0x31')]=qs[_0xb00b('0x32')](_0x4a635e['query'][_0xb00b('0x32')]);_0x73b6b0[_0xb00b('0x33')]=qs[_0xb00b('0x29')](_[_0xb00b('0x34')](_0x4a635e[_0xb00b('0x27')],_0x2592cf[_0xb00b('0x29')]),_0x1f14fa);if(_0x4a635e[_0xb00b('0x27')][_0xb00b('0x35')]){_0x73b6b0['where']=_['merge'](_0x73b6b0[_0xb00b('0x33')],{'$or':_['map'](_0x1f14fa,function(_0x1c8258){if(_0x1c8258[_0xb00b('0x23')]!==_0xb00b('0x36')){var _0x45ca74={};_0x45ca74[_0x1c8258[_0xb00b('0x26')]]={'$like':'%'+_0x4a635e[_0xb00b('0x27')][_0xb00b('0x35')]+'%'};return _0x45ca74;}})});}_0x73b6b0=_['merge']({},_0x73b6b0,_0x4a635e[_0xb00b('0x37')]);var _0x25578e={'where':_0x73b6b0[_0xb00b('0x33')]};return db[_0xb00b('0x22')][_0xb00b('0x18')](_0x25578e)[_0xb00b('0x1d')](function(_0x59fb00){_0x3825af[_0xb00b('0x18')]=_0x59fb00;if(_0x4a635e[_0xb00b('0x27')]['includeAll']){_0x73b6b0[_0xb00b('0x38')]=[{'all':!![]}];}return db[_0xb00b('0x22')][_0xb00b('0x39')](_0x73b6b0);})[_0xb00b('0x1d')](function(_0x2954e8){_0x3825af['rows']=_0x2954e8;return _0x3825af;})[_0xb00b('0x1d')](respondWithFilteredResult(_0x16ac55,_0x73b6b0))[_0xb00b('0x3a')](handleError(_0x16ac55,null));};
\ No newline at end of file
index acea327..7e1dfba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cc0=['./migration.attributes','define','migrations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40cd90,_0x1651d1){var _0x3725f8=function(_0x5bf7ad){while(--_0x5bf7ad){_0x40cd90['push'](_0x40cd90['shift']());}};_0x3725f8(++_0x1651d1);}(_0x2cc0,0xdf));var _0x02cc=function(_0x3d6fda,_0x1a5e0c){_0x3d6fda=_0x3d6fda-0x0;var _0x2d66a2=_0x2cc0[_0x3d6fda];return _0x2d66a2;};'use strict';var _=require(_0x02cc('0x0'));var util=require('util');var logger=require(_0x02cc('0x1'))('api');var moment=require(_0x02cc('0x2'));var BPromise=require(_0x02cc('0x3'));var rp=require(_0x02cc('0x4'));var fs=require('fs');var path=require(_0x02cc('0x5'));var rimraf=require(_0x02cc('0x6'));var config=require(_0x02cc('0x7'));var attributes=require(_0x02cc('0x8'));module['exports']=function(_0x26269a,_0x48da65){return _0x26269a[_0x02cc('0x9')]('Migration',attributes,{'tableName':_0x02cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d4d=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./migration.attributes','exports','Migration'];(function(_0x450f20,_0x159bb3){var _0x15bd66=function(_0x304648){while(--_0x304648){_0x450f20['push'](_0x450f20['shift']());}};_0x15bd66(++_0x159bb3);}(_0x2d4d,0x14a));var _0xd2d4=function(_0x18da7a,_0x39b9b0){_0x18da7a=_0x18da7a-0x0;var _0x24cd57=_0x2d4d[_0x18da7a];return _0x24cd57;};'use strict';var _=require('lodash');var util=require(_0xd2d4('0x0'));var logger=require(_0xd2d4('0x1'))(_0xd2d4('0x2'));var moment=require(_0xd2d4('0x3'));var BPromise=require(_0xd2d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2d4('0x5'));var rimraf=require(_0xd2d4('0x6'));var config=require(_0xd2d4('0x7'));var attributes=require(_0xd2d4('0x8'));module[_0xd2d4('0x9')]=function(_0xd97dc0,_0x51f794){return _0xd97dc0['define'](_0xd2d4('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 51a02bc..5137665 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f06=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird'];(function(_0x47ae56,_0x13ec08){var _0x222aa2=function(_0x290266){while(--_0x290266){_0x47ae56['push'](_0x47ae56['shift']());}};_0x222aa2(++_0x13ec08);}(_0x3f06,0x140));var _0x63f0=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3f06[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x63f0('0x0'));var moment=require('moment');var BPromise=require(_0x63f0('0x1'));var rs=require(_0x63f0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63f0('0x3'))['db'];var utils=require(_0x63f0('0x4'));var logger=require(_0x63f0('0x5'))(_0x63f0('0x6'));var config=require(_0x63f0('0x7'));var jayson=require(_0x63f0('0x8'));var client=jayson[_0x63f0('0x9')][_0x63f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dab15,_0x16fd67,_0x7ca10a){return new BPromise(function(_0x49557b,_0x5c9261){return client[_0x63f0('0xb')](_0x4dab15,_0x7ca10a)['then'](function(_0x1d2371){logger['info'](_0x63f0('0xc'),_0x16fd67,_0x63f0('0xd'));logger[_0x63f0('0xe')](_0x63f0('0xf'),_0x16fd67,_0x63f0('0xd'),JSON[_0x63f0('0x10')](_0x1d2371));if(_0x1d2371[_0x63f0('0x11')]){if(_0x1d2371['error'][_0x63f0('0x12')]===0x1f4){logger[_0x63f0('0x11')]('Migration,\x20%s,\x20%s',_0x16fd67,_0x1d2371[_0x63f0('0x11')][_0x63f0('0x13')]);return _0x5c9261(_0x1d2371[_0x63f0('0x11')][_0x63f0('0x13')]);}logger[_0x63f0('0x11')](_0x63f0('0xc'),_0x16fd67,_0x1d2371[_0x63f0('0x11')][_0x63f0('0x13')]);return _0x49557b(_0x1d2371[_0x63f0('0x11')]['message']);}else{logger[_0x63f0('0x14')](_0x63f0('0xc'),_0x16fd67,_0x63f0('0xd'));_0x49557b(_0x1d2371[_0x63f0('0x15')][_0x63f0('0x13')]);}})[_0x63f0('0x16')](function(_0x3d53bd){logger[_0x63f0('0x11')](_0x63f0('0xc'),_0x16fd67,_0x3d53bd);_0x5c9261(_0x3d53bd);});});}
\ No newline at end of file
+var _0x0577=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x26fdfc,_0x5ede52){var _0x5c9e63=function(_0x34e7fb){while(--_0x34e7fb){_0x26fdfc['push'](_0x26fdfc['shift']());}};_0x5c9e63(++_0x5ede52);}(_0x0577,0xa4));var _0x7057=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0577[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7057('0x0'));var util=require(_0x7057('0x1'));var moment=require(_0x7057('0x2'));var BPromise=require(_0x7057('0x3'));var rs=require(_0x7057('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7057('0x5'))['db'];var utils=require(_0x7057('0x6'));var logger=require(_0x7057('0x7'))(_0x7057('0x8'));var config=require(_0x7057('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7057('0xa')][_0x7057('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d2801,_0x48f68d,_0x3fc673){return new BPromise(function(_0x548f1a,_0x5e4ae6){return client['request'](_0x4d2801,_0x3fc673)[_0x7057('0xc')](function(_0x5e5723){logger[_0x7057('0xd')](_0x7057('0xe'),_0x48f68d,_0x7057('0xf'));logger[_0x7057('0x10')](_0x7057('0x11'),_0x48f68d,_0x7057('0xf'),JSON[_0x7057('0x12')](_0x5e5723));if(_0x5e5723[_0x7057('0x13')]){if(_0x5e5723[_0x7057('0x13')]['code']===0x1f4){logger[_0x7057('0x13')](_0x7057('0xe'),_0x48f68d,_0x5e5723['error'][_0x7057('0x14')]);return _0x5e4ae6(_0x5e5723[_0x7057('0x13')][_0x7057('0x14')]);}logger[_0x7057('0x13')](_0x7057('0xe'),_0x48f68d,_0x5e5723[_0x7057('0x13')][_0x7057('0x14')]);return _0x548f1a(_0x5e5723['error'][_0x7057('0x14')]);}else{logger[_0x7057('0xd')](_0x7057('0xe'),_0x48f68d,_0x7057('0xf'));_0x548f1a(_0x5e5723[_0x7057('0x15')][_0x7057('0x14')]);}})[_0x7057('0x16')](function(_0x2de73d){logger[_0x7057('0x13')](_0x7057('0xe'),_0x48f68d,_0x2de73d);_0x5e4ae6(_0x2de73d);});});}
\ No newline at end of file
index d6964d4..2642cfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd83=['get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./network.controller'];(function(_0x59ea9d,_0x30cf90){var _0x4b94ce=function(_0x1450fe){while(--_0x1450fe){_0x59ea9d['push'](_0x59ea9d['shift']());}};_0x4b94ce(++_0x30cf90);}(_0xdd83,0xe1));var _0x3dd8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xdd83[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x3dd8('0x0'));var util=require(_0x3dd8('0x1'));var path=require(_0x3dd8('0x2'));var timeout=require(_0x3dd8('0x3'));var express=require(_0x3dd8('0x4'));var router=express[_0x3dd8('0x5')]();var auth=require(_0x3dd8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3dd8('0x7'));var controller=require(_0x3dd8('0x8'));router[_0x3dd8('0x9')]('/',auth[_0x3dd8('0xa')](),controller[_0x3dd8('0xb')]);router[_0x3dd8('0x9')](_0x3dd8('0xc'),auth[_0x3dd8('0xa')](),controller[_0x3dd8('0xd')]);router['post']('/',auth[_0x3dd8('0xa')](),controller[_0x3dd8('0xe')]);router['put'](_0x3dd8('0xc'),auth[_0x3dd8('0xa')](),controller[_0x3dd8('0xf')]);router[_0x3dd8('0x10')](_0x3dd8('0xc'),auth[_0x3dd8('0xa')](),controller[_0x3dd8('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xad78=['create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xad78,0x149));var _0x8ad7=function(_0x34506f,_0x40a755){_0x34506f=_0x34506f-0x0;var _0x5b3643=_0xad78[_0x34506f];return _0x5b3643;};'use strict';var multer=require(_0x8ad7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ad7('0x1'));var express=require(_0x8ad7('0x2'));var router=express['Router']();var auth=require(_0x8ad7('0x3'));var interaction=require(_0x8ad7('0x4'));var config=require(_0x8ad7('0x5'));var controller=require(_0x8ad7('0x6'));router[_0x8ad7('0x7')]('/',auth[_0x8ad7('0x8')](),controller[_0x8ad7('0x9')]);router[_0x8ad7('0x7')](_0x8ad7('0xa'),auth[_0x8ad7('0x8')](),controller['show']);router['post']('/',auth[_0x8ad7('0x8')](),controller[_0x8ad7('0xb')]);router[_0x8ad7('0xc')](_0x8ad7('0xa'),auth[_0x8ad7('0x8')](),controller[_0x8ad7('0xd')]);router[_0x8ad7('0xe')]('/:id',auth[_0x8ad7('0x8')](),controller[_0x8ad7('0xf')]);module[_0x8ad7('0x10')]=router;
\ No newline at end of file
index 049c0ee..684e297 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x1e46b6,_0xf0ba17){var _0xe81212=function(_0x250cd6){while(--_0x250cd6){_0x1e46b6['push'](_0x1e46b6['shift']());}};_0xe81212(++_0xf0ba17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}};
\ No newline at end of file
+var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x4ea517,_0x2fb3dc){var _0x5dc339=function(_0x354f44){while(--_0x354f44){_0x4ea517['push'](_0x4ea517['shift']());}};_0x5dc339(++_0x2fb3dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}};
\ No newline at end of file
index e29b409..d1aa726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec02=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','client','http','Sequelize','ValidationError','request','then','Network,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','Network','findAll','show','params','keys','include','find','create','body','toUpperCase','STUN','join','root','render','writeFileSync','res_stun_monitor.so','readFileSync','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','sequelize','transaction','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x53ae5a,_0x97d474){var _0x34a89e=function(_0x4f5d57){while(--_0x4f5d57){_0x53ae5a['push'](_0x53ae5a['shift']());}};_0x34a89e(++_0x97d474);}(_0xec02,0x1ef));var _0x2ec0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xec02[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2ec0('0x0'));var rimraf=require(_0x2ec0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ec0('0x2'));var rp=require(_0x2ec0('0x3'));var moment=require(_0x2ec0('0x4'));var BPromise=require(_0x2ec0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2ec0('0x6'));var ejs=require(_0x2ec0('0x7'));var fs=require('fs');var _=require(_0x2ec0('0x8'));var squel=require(_0x2ec0('0x9'));var crypto=require(_0x2ec0('0xa'));var jsforce=require(_0x2ec0('0xb'));var deskjs=require(_0x2ec0('0xc'));var toCsv=require(_0x2ec0('0x6'));var querystring=require('querystring');var Papa=require(_0x2ec0('0xd'));var Redis=require(_0x2ec0('0xe'));var authService=require(_0x2ec0('0xf'));var qs=require(_0x2ec0('0x10'));var as=require(_0x2ec0('0x11'));var hardwareService=require(_0x2ec0('0x12'));var logger=require(_0x2ec0('0x13'))(_0x2ec0('0x14'));var utils=require('../../config/utils');var config=require(_0x2ec0('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x2ec0('0x16')][_0x2ec0('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1df904,_0x4b3a25,_0x3d7239){if(_0x3d7239){var _0x4250a9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4250a9['test'](_0x4b3a25)){return _0x1df904;}else{throw new db[(_0x2ec0('0x18'))][(_0x2ec0('0x19'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1df904;}}function respondWithRpcPromise(_0xc4384e,_0x18915b,_0x2abe41,_0x41f95c){return new BPromise(function(_0x1fb0f2,_0x3785eb){var _0xb0d4a4=_0x41f95c||client;return _0xb0d4a4[_0x2ec0('0x1a')](_0xc4384e,_0x2abe41)[_0x2ec0('0x1b')](function(_0x489787){logger['info'](_0x2ec0('0x1c'),_0x18915b,_0x2ec0('0x1d'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x18915b,_0x2ec0('0x1d'),JSON['stringify'](_0x489787));if(_0x489787[_0x2ec0('0x1e')]){if(_0x489787[_0x2ec0('0x1e')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x18915b,_0x489787[_0x2ec0('0x1e')]['message']);return _0x3785eb(_0x489787['error']['message']);}logger[_0x2ec0('0x1e')](_0x2ec0('0x1c'),_0x18915b,_0x489787['error'][_0x2ec0('0x1f')]);return _0x1fb0f2(_0x489787['error']['message']);}else{logger[_0x2ec0('0x20')](_0x2ec0('0x1c'),_0x18915b,_0x2ec0('0x1d'));_0x1fb0f2(_0x489787[_0x2ec0('0x21')][_0x2ec0('0x1f')]);}})[_0x2ec0('0x22')](function(_0x30154a){logger[_0x2ec0('0x1e')](_0x2ec0('0x1c'),_0x18915b,_0x30154a);_0x3785eb(_0x30154a);});});}function respondWithStatusCode(_0x37ca3d,_0x3b30df){_0x3b30df=_0x3b30df||0xcc;return function(_0xbe0151){if(_0xbe0151){return _0x37ca3d[_0x2ec0('0x23')](_0x3b30df);}return _0x37ca3d['status'](_0x3b30df)[_0x2ec0('0x24')]();};}function respondWithResult(_0x8f770b,_0x2ed7b6){_0x2ed7b6=_0x2ed7b6||0xc8;return function(_0x462426){if(_0x462426){return _0x8f770b[_0x2ec0('0x25')](_0x2ed7b6)['json'](_0x462426);}};}function respondWithFilteredResult(_0x29fcc6,_0x17348c){return function(_0x27fbc2){if(_0x27fbc2){var _0x11e123=_0x27fbc2[_0x2ec0('0x26')],_0x2863b2=_0x17348c[_0x2ec0('0x27')],_0x325759=_0x17348c[_0x2ec0('0x27')]+_0x17348c[_0x2ec0('0x28')],_0x5f1af3;if(_0x325759>=_0x11e123){_0x325759=_0x11e123;_0x5f1af3=0xc8;}else{_0x5f1af3=0xce;}_0x29fcc6[_0x2ec0('0x25')](_0x5f1af3);return _0x29fcc6[_0x2ec0('0x29')](_0x2ec0('0x2a'),_0x2863b2+'-'+_0x325759+'/'+_0x11e123)[_0x2ec0('0x2b')](_0x27fbc2);}return null;};}function patchUpdates(_0x131a2f){return function(_0x4cf8c5){try{jsonpatch[_0x2ec0('0x2c')](_0x4cf8c5,_0x131a2f,!![]);}catch(_0x5f0f39){return BPromise[_0x2ec0('0x2d')](_0x5f0f39);}return _0x4cf8c5[_0x2ec0('0x2e')]();};}function saveUpdates(_0x4eaf6e,_0x474150){return function(_0xb3b5f7){if(_0xb3b5f7){return _0xb3b5f7[_0x2ec0('0x2f')](_0x4eaf6e)[_0x2ec0('0x1b')](function(_0x4d4501){return _0x4d4501;});}return null;};}function removeEntity(_0x1d7d14,_0x239e54){return function(_0x4b0e66){if(_0x4b0e66){return _0x4b0e66[_0x2ec0('0x30')]()[_0x2ec0('0x1b')](function(){_0x1d7d14[_0x2ec0('0x25')](0xcc)[_0x2ec0('0x24')]();});}};}function handleEntityNotFound(_0x54a03c,_0x5a039a){return function(_0x34fbb6){if(!_0x34fbb6){_0x54a03c[_0x2ec0('0x23')](0x194);}return _0x34fbb6;};}function handleError(_0x4eea1a,_0x2847cb){_0x2847cb=_0x2847cb||0x1f4;return function(_0xdd466a){logger[_0x2ec0('0x1e')](_0xdd466a['stack']);if(_0xdd466a[_0x2ec0('0x31')]){delete _0xdd466a[_0x2ec0('0x31')];}_0x4eea1a[_0x2ec0('0x25')](_0x2847cb)[_0x2ec0('0x32')](_0xdd466a);};}exports[_0x2ec0('0x33')]=function(_0x4416a4,_0x4b38ad){var _0x3c26f1={},_0x508d0d={},_0x20d40b={'count':0x0,'rows':[]};var _0x1fa54d=_[_0x2ec0('0x34')](db['Network'][_0x2ec0('0x35')],function(_0x393e29){return{'name':_0x393e29[_0x2ec0('0x36')],'type':_0x393e29[_0x2ec0('0x37')][_0x2ec0('0x38')]};});_0x508d0d[_0x2ec0('0x39')]=_[_0x2ec0('0x34')](_0x1fa54d,_0x2ec0('0x31'));_0x508d0d[_0x2ec0('0x3a')]=_['keys'](_0x4416a4[_0x2ec0('0x3a')]);_0x508d0d[_0x2ec0('0x3b')]=_[_0x2ec0('0x3c')](_0x508d0d['model'],_0x508d0d[_0x2ec0('0x3a')]);_0x3c26f1[_0x2ec0('0x3d')]=_['intersection'](_0x508d0d['model'],qs[_0x2ec0('0x3e')](_0x4416a4['query']['fields']));_0x3c26f1['attributes']=_0x3c26f1[_0x2ec0('0x3d')][_0x2ec0('0x3f')]?_0x3c26f1['attributes']:_0x508d0d['model'];if(!_0x4416a4['query']['hasOwnProperty'](_0x2ec0('0x40'))){_0x3c26f1[_0x2ec0('0x28')]=qs[_0x2ec0('0x28')](_0x4416a4['query'][_0x2ec0('0x28')]);_0x3c26f1[_0x2ec0('0x27')]=qs[_0x2ec0('0x27')](_0x4416a4[_0x2ec0('0x3a')][_0x2ec0('0x27')]);}_0x3c26f1[_0x2ec0('0x41')]=qs[_0x2ec0('0x42')](_0x4416a4[_0x2ec0('0x3a')]['sort']);_0x3c26f1['where']=qs[_0x2ec0('0x3b')](_[_0x2ec0('0x43')](_0x4416a4[_0x2ec0('0x3a')],_0x508d0d[_0x2ec0('0x3b')]),_0x1fa54d);if(_0x4416a4['query'][_0x2ec0('0x44')]){_0x3c26f1['where']=_[_0x2ec0('0x45')](_0x3c26f1[_0x2ec0('0x46')],{'$or':_['map'](_0x1fa54d,function(_0x4bb73a){if(_0x4bb73a[_0x2ec0('0x37')]!==_0x2ec0('0x47')){var _0x5027ab={};_0x5027ab[_0x4bb73a[_0x2ec0('0x31')]]={'$like':'%'+_0x4416a4[_0x2ec0('0x3a')][_0x2ec0('0x44')]+'%'};return _0x5027ab;}})});}_0x3c26f1=_['merge']({},_0x3c26f1,_0x4416a4[_0x2ec0('0x48')]);var _0x3adff4={'where':_0x3c26f1[_0x2ec0('0x46')]};return db['Network'][_0x2ec0('0x26')](_0x3adff4)['then'](function(_0x288f47){_0x20d40b[_0x2ec0('0x26')]=_0x288f47;if(_0x4416a4['query'][_0x2ec0('0x49')]){_0x3c26f1['include']=[{'all':!![]}];}return db[_0x2ec0('0x4a')][_0x2ec0('0x4b')](_0x3c26f1);})['then'](function(_0x567717){_0x20d40b['rows']=_0x567717;return _0x20d40b;})[_0x2ec0('0x1b')](respondWithFilteredResult(_0x4b38ad,_0x3c26f1))[_0x2ec0('0x22')](handleError(_0x4b38ad,null));};exports[_0x2ec0('0x4c')]=function(_0x54a9cb,_0x31ebbd){var _0x9cd566={'raw':!![],'where':{'id':_0x54a9cb[_0x2ec0('0x4d')]['id']}},_0x2fe92f={};_0x2fe92f['model']=_[_0x2ec0('0x4e')](db[_0x2ec0('0x4a')][_0x2ec0('0x35')]);_0x2fe92f[_0x2ec0('0x3a')]=_['keys'](_0x54a9cb[_0x2ec0('0x3a')]);_0x2fe92f[_0x2ec0('0x3b')]=_['intersection'](_0x2fe92f['model'],_0x2fe92f['query']);_0x9cd566['attributes']=_[_0x2ec0('0x3c')](_0x2fe92f[_0x2ec0('0x39')],qs[_0x2ec0('0x3e')](_0x54a9cb['query'][_0x2ec0('0x3e')]));_0x9cd566['attributes']=_0x9cd566['attributes'][_0x2ec0('0x3f')]?_0x9cd566[_0x2ec0('0x3d')]:_0x2fe92f[_0x2ec0('0x39')];if(_0x54a9cb[_0x2ec0('0x3a')]['includeAll']){_0x9cd566[_0x2ec0('0x4f')]=[{'all':!![]}];}_0x9cd566=_[_0x2ec0('0x45')]({},_0x9cd566,_0x54a9cb[_0x2ec0('0x48')]);return db[_0x2ec0('0x4a')][_0x2ec0('0x50')](_0x9cd566)[_0x2ec0('0x1b')](handleEntityNotFound(_0x31ebbd,null))[_0x2ec0('0x1b')](respondWithResult(_0x31ebbd,null))[_0x2ec0('0x22')](handleError(_0x31ebbd,null));};exports[_0x2ec0('0x51')]=function(_0x358332,_0x143175,_0x2b1c13){var _0x58b560;return db['sequelize']['transaction'](function(_0x1e7617){return db[_0x2ec0('0x4a')][_0x2ec0('0x51')](_0x358332[_0x2ec0('0x52')],{'raw':!![]})['then'](function(_0xedd6ac){_0x58b560=_0xedd6ac;return db[_0x2ec0('0x4a')][_0x2ec0('0x4b')]({'where':{'type':_0x358332[_0x2ec0('0x52')][_0x2ec0('0x37')]},'raw':!![]});})[_0x2ec0('0x1b')](function(_0x15dfb7){if(_0x58b560['type'][_0x2ec0('0x53')]()==_0x2ec0('0x54')){var _0x40bd1b=fs['readFileSync'](path[_0x2ec0('0x55')](config[_0x2ec0('0x56')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x1a0b48=ejs[_0x2ec0('0x57')](_0x40bd1b,{'networks':_0x15dfb7||[]});fs[_0x2ec0('0x58')]('/etc/asterisk/stun_xcally.conf',_0x1a0b48);return respondWithRpcPromise('Reload',_0x2ec0('0x51'),{'module':_0x2ec0('0x59')});}else if(_0x58b560[_0x2ec0('0x37')][_0x2ec0('0x53')]()=='TURN'){var _0x3be7fb=fs[_0x2ec0('0x5a')](path[_0x2ec0('0x55')](config[_0x2ec0('0x56')],_0x2ec0('0x5b')),_0x2ec0('0x5c'));var _0x5004aa=ejs['render'](_0x3be7fb,{'networks':_0x15dfb7||[]});fs[_0x2ec0('0x58')](_0x2ec0('0x5d'),_0x5004aa);return respondWithRpcPromise(_0x2ec0('0x5e'),_0x2ec0('0x51'),{'module':'res_stun_monitor.so'});}else{var _0x22d98a=fs[_0x2ec0('0x5a')](path[_0x2ec0('0x55')](config[_0x2ec0('0x56')],_0x2ec0('0x5f')),_0x2ec0('0x5c'));var _0x5b1cc5=ejs[_0x2ec0('0x57')](_0x22d98a,{'networks':_0x15dfb7||[]});fs[_0x2ec0('0x58')](util[_0x2ec0('0x60')]('/etc/asterisk/sip_xcally_%s.conf',_0x358332[_0x2ec0('0x52')][_0x2ec0('0x37')][_0x2ec0('0x61')]()),_0x5b1cc5);return respondWithRpcPromise(_0x2ec0('0x5e'),_0x2ec0('0x51'),{'module':_0x2ec0('0x62')});}return null;})[_0x2ec0('0x1b')](function(){return _0x58b560;});})[_0x2ec0('0x1b')](respondWithResult(_0x143175,0xc9))[_0x2ec0('0x22')](handleError(_0x143175,null));};exports[_0x2ec0('0x2f')]=function(_0x4621e5,_0x23594d,_0x230d0e){var _0x1b6fe8;return db[_0x2ec0('0x63')][_0x2ec0('0x64')](function(_0x2586c5){return db['Network'][_0x2ec0('0x50')]({'where':{'id':_0x4621e5[_0x2ec0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23594d,null))[_0x2ec0('0x1b')](saveUpdates(_0x4621e5[_0x2ec0('0x52')],null))['then'](function(_0x558d91){if(_0x558d91){_0x1b6fe8=_0x558d91;return db[_0x2ec0('0x4a')][_0x2ec0('0x4b')]({'where':{'type':_0x1b6fe8[_0x2ec0('0x37')]},'raw':!![]});}return null;})[_0x2ec0('0x1b')](function(_0x3b289e){if(_0x1b6fe8[_0x2ec0('0x37')]['toUpperCase']()==_0x2ec0('0x54')){var _0x164a17=fs[_0x2ec0('0x5a')](path['join'](config[_0x2ec0('0x56')],'server/files/templates/stun_multiple.ejs'),_0x2ec0('0x5c'));var _0x5311e3=ejs[_0x2ec0('0x57')](_0x164a17,{'networks':_0x3b289e||[]});fs[_0x2ec0('0x58')]('/etc/asterisk/stun_xcally.conf',_0x5311e3);return respondWithRpcPromise('Reload',_0x2ec0('0x2f'),{'module':_0x2ec0('0x59')});}else if(_0x1b6fe8['type']['toUpperCase']()=='TURN'){var _0x1c84b2=fs[_0x2ec0('0x5a')](path['join'](config[_0x2ec0('0x56')],_0x2ec0('0x5b')),_0x2ec0('0x5c'));var _0x20bc82=ejs[_0x2ec0('0x57')](_0x1c84b2,{'networks':_0x3b289e||[]});fs[_0x2ec0('0x58')]('/etc/asterisk/turn_xcally.conf',_0x20bc82);return respondWithRpcPromise(_0x2ec0('0x5e'),'update',{'module':'res_stun_monitor.so'});}else{var _0x493eb6=fs[_0x2ec0('0x5a')](path[_0x2ec0('0x55')](config['root'],'server/files/templates/network.ejs'),_0x2ec0('0x5c'));var _0x1d9887=ejs[_0x2ec0('0x57')](_0x493eb6,{'networks':_0x3b289e||[]});fs[_0x2ec0('0x58')](util['format'](_0x2ec0('0x65'),_0x4621e5[_0x2ec0('0x52')][_0x2ec0('0x37')][_0x2ec0('0x61')]()),_0x1d9887);return respondWithRpcPromise('Reload','update',{'module':_0x2ec0('0x62')});}return null;})[_0x2ec0('0x1b')](function(_0x39f58c){if(_0x39f58c){return _0x1b6fe8;}return null;});})[_0x2ec0('0x1b')](respondWithResult(_0x23594d,null))[_0x2ec0('0x22')](handleError(_0x23594d,null));};exports['destroy']=function(_0x53f18c,_0x5ea23a,_0xd2b44b){var _0x1dd1c0;return db['Network'][_0x2ec0('0x50')]({'where':{'id':_0x53f18c[_0x2ec0('0x4d')]['id']}})[_0x2ec0('0x1b')](function(_0x409b83){_0x1dd1c0=_0x409b83;return _0x409b83;})[_0x2ec0('0x1b')](handleEntityNotFound(_0x5ea23a,null))[_0x2ec0('0x1b')](removeEntity(_0x5ea23a,null))[_0x2ec0('0x1b')](function(){if(_0x1dd1c0){return db[_0x2ec0('0x4a')][_0x2ec0('0x4b')]({'where':{'type':_0x1dd1c0['type']},'raw':!![]});}})[_0x2ec0('0x1b')](function(_0x1db86b){if(_0x1dd1c0[_0x2ec0('0x37')][_0x2ec0('0x53')]()==_0x2ec0('0x54')){var _0x1b4e60=fs[_0x2ec0('0x5a')](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0x2ec0('0x5c'));var _0x2843b7=ejs['render'](_0x1b4e60,{'networks':_0x1db86b||[]});fs[_0x2ec0('0x58')]('/etc/asterisk/stun_xcally.conf',_0x2843b7);return respondWithRpcPromise(_0x2ec0('0x5e'),'destroy',{'module':_0x2ec0('0x59')});}else if(_0x1dd1c0[_0x2ec0('0x37')][_0x2ec0('0x53')]()=='TURN'){var _0x3e0497=fs[_0x2ec0('0x5a')](path['join'](config[_0x2ec0('0x56')],_0x2ec0('0x5b')),_0x2ec0('0x5c'));var _0x5e579e=ejs[_0x2ec0('0x57')](_0x3e0497,{'networks':_0x1db86b||[]});fs['writeFileSync'](_0x2ec0('0x5d'),_0x5e579e);return respondWithRpcPromise(_0x2ec0('0x5e'),_0x2ec0('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x6d08af=fs[_0x2ec0('0x5a')](path['join'](config[_0x2ec0('0x56')],'server/files/templates/network.ejs'),_0x2ec0('0x5c'));var _0x43301f=ejs['render'](_0x6d08af,{'networks':_0x1db86b||[]});fs[_0x2ec0('0x58')](util['format'](_0x2ec0('0x65'),_0x53f18c['body']['type']['toLowerCase']()),_0x43301f);return respondWithRpcPromise(_0x2ec0('0x5e'),_0x2ec0('0x30'),{'module':_0x2ec0('0x62')});}return null;})[_0x2ec0('0x22')](handleError(_0x5ea23a,null));};
\ No newline at end of file
+var _0x3785=['rows','show','params','length','includeAll','create','sequelize','transaction','body','STUN','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','res_stun_monitor.so','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','update','find','toUpperCase','server/files/templates/stun_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','destroy','stack','name','index','map','Network','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll'];(function(_0x2bb30a,_0x13c669){var _0x1d0ae8=function(_0x3083b5){while(--_0x3083b5){_0x2bb30a['push'](_0x2bb30a['shift']());}};_0x1d0ae8(++_0x13c669);}(_0x3785,0x92));var _0x5378=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x3785[_0x257642];return _0x3d813b;};'use strict';var pdf=require(_0x5378('0x0'));var emlformat=require(_0x5378('0x1'));var rimraf=require(_0x5378('0x2'));var zipdir=require(_0x5378('0x3'));var jsonpatch=require(_0x5378('0x4'));var rp=require(_0x5378('0x5'));var moment=require('moment');var BPromise=require(_0x5378('0x6'));var Mustache=require(_0x5378('0x7'));var util=require('util');var path=require(_0x5378('0x8'));var sox=require(_0x5378('0x9'));var csv=require(_0x5378('0xa'));var ejs=require(_0x5378('0xb'));var fs=require('fs');var _=require(_0x5378('0xc'));var squel=require(_0x5378('0xd'));var crypto=require(_0x5378('0xe'));var jsforce=require(_0x5378('0xf'));var deskjs=require(_0x5378('0x10'));var toCsv=require(_0x5378('0xa'));var querystring=require(_0x5378('0x11'));var Papa=require(_0x5378('0x12'));var Redis=require(_0x5378('0x13'));var authService=require(_0x5378('0x14'));var qs=require(_0x5378('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5378('0x16'))(_0x5378('0x17'));var utils=require(_0x5378('0x18'));var config=require('../../config/environment');var db=require(_0x5378('0x19'))['db'];var jayson=require(_0x5378('0x1a'));var client=jayson['client'][_0x5378('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x20bcb0,_0x28be19,_0x8f728){if(_0x8f728){var _0x118749=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x118749[_0x5378('0x1c')](_0x28be19)){return _0x20bcb0;}else{throw new db[(_0x5378('0x1d'))][(_0x5378('0x1e'))](_0x5378('0x1f'));}}else{return _0x20bcb0;}}function respondWithRpcPromise(_0x3326cc,_0x4974e4,_0x234477,_0x5698d4){return new BPromise(function(_0x3034c4,_0x4075e4){var _0x16b27f=_0x5698d4||client;return _0x16b27f[_0x5378('0x20')](_0x3326cc,_0x234477)[_0x5378('0x21')](function(_0x4b6171){logger[_0x5378('0x22')](_0x5378('0x23'),_0x4974e4,_0x5378('0x24'));logger[_0x5378('0x25')](_0x5378('0x26'),_0x4974e4,_0x5378('0x24'),JSON[_0x5378('0x27')](_0x4b6171));if(_0x4b6171[_0x5378('0x28')]){if(_0x4b6171['error'][_0x5378('0x29')]===0x1f4){logger[_0x5378('0x28')](_0x5378('0x23'),_0x4974e4,_0x4b6171[_0x5378('0x28')][_0x5378('0x2a')]);return _0x4075e4(_0x4b6171[_0x5378('0x28')][_0x5378('0x2a')]);}logger[_0x5378('0x28')](_0x5378('0x23'),_0x4974e4,_0x4b6171[_0x5378('0x28')][_0x5378('0x2a')]);return _0x3034c4(_0x4b6171['error'][_0x5378('0x2a')]);}else{logger['info'](_0x5378('0x23'),_0x4974e4,_0x5378('0x24'));_0x3034c4(_0x4b6171[_0x5378('0x2b')][_0x5378('0x2a')]);}})[_0x5378('0x2c')](function(_0x187122){logger[_0x5378('0x28')](_0x5378('0x23'),_0x4974e4,_0x187122);_0x4075e4(_0x187122);});});}function respondWithStatusCode(_0x34ded8,_0x31a316){_0x31a316=_0x31a316||0xcc;return function(_0x2b2bfb){if(_0x2b2bfb){return _0x34ded8[_0x5378('0x2d')](_0x31a316);}return _0x34ded8['status'](_0x31a316)[_0x5378('0x2e')]();};}function respondWithResult(_0x29e3f7,_0x45070d){_0x45070d=_0x45070d||0xc8;return function(_0x54be96){if(_0x54be96){return _0x29e3f7['status'](_0x45070d)[_0x5378('0x2f')](_0x54be96);}};}function respondWithFilteredResult(_0x1ebe4d,_0x366437){return function(_0x5ea24d){if(_0x5ea24d){var _0x3374cf=_0x5ea24d[_0x5378('0x30')],_0x20cd9d=_0x366437[_0x5378('0x31')],_0x5cea39=_0x366437[_0x5378('0x31')]+_0x366437[_0x5378('0x32')],_0x1fc9aa;if(_0x5cea39>=_0x3374cf){_0x5cea39=_0x3374cf;_0x1fc9aa=0xc8;}else{_0x1fc9aa=0xce;}_0x1ebe4d[_0x5378('0x33')](_0x1fc9aa);return _0x1ebe4d[_0x5378('0x34')](_0x5378('0x35'),_0x20cd9d+'-'+_0x5cea39+'/'+_0x3374cf)[_0x5378('0x2f')](_0x5ea24d);}return null;};}function patchUpdates(_0x5dd8f5){return function(_0x4a9ab7){try{jsonpatch[_0x5378('0x36')](_0x4a9ab7,_0x5dd8f5,!![]);}catch(_0x8c81c){return BPromise['reject'](_0x8c81c);}return _0x4a9ab7[_0x5378('0x37')]();};}function saveUpdates(_0x47e16c,_0x50c1bb){return function(_0x1dd7ef){if(_0x1dd7ef){return _0x1dd7ef['update'](_0x47e16c)[_0x5378('0x21')](function(_0x125254){return _0x125254;});}return null;};}function removeEntity(_0x422fad,_0x391bdd){return function(_0x3fe173){if(_0x3fe173){return _0x3fe173[_0x5378('0x38')]()['then'](function(){_0x422fad['status'](0xcc)[_0x5378('0x2e')]();});}};}function handleEntityNotFound(_0x471925,_0x4cc7b2){return function(_0x207fce){if(!_0x207fce){_0x471925[_0x5378('0x2d')](0x194);}return _0x207fce;};}function handleError(_0x141dc2,_0x161632){_0x161632=_0x161632||0x1f4;return function(_0x5c4412){logger[_0x5378('0x28')](_0x5c4412[_0x5378('0x39')]);if(_0x5c4412[_0x5378('0x3a')]){delete _0x5c4412[_0x5378('0x3a')];}_0x141dc2['status'](_0x161632)['send'](_0x5c4412);};}exports[_0x5378('0x3b')]=function(_0x2f6585,_0x46d69a){var _0x5c068d={},_0x43e2f9={},_0x51abc1={'count':0x0,'rows':[]};var _0x5e07c4=_[_0x5378('0x3c')](db[_0x5378('0x3d')][_0x5378('0x3e')],function(_0x3d860a){return{'name':_0x3d860a['fieldName'],'type':_0x3d860a['type'][_0x5378('0x3f')]};});_0x43e2f9[_0x5378('0x40')]=_['map'](_0x5e07c4,'name');_0x43e2f9['query']=_[_0x5378('0x41')](_0x2f6585[_0x5378('0x42')]);_0x43e2f9[_0x5378('0x43')]=_[_0x5378('0x44')](_0x43e2f9[_0x5378('0x40')],_0x43e2f9['query']);_0x5c068d[_0x5378('0x45')]=_[_0x5378('0x44')](_0x43e2f9[_0x5378('0x40')],qs[_0x5378('0x46')](_0x2f6585[_0x5378('0x42')][_0x5378('0x46')]));_0x5c068d[_0x5378('0x45')]=_0x5c068d[_0x5378('0x45')]['length']?_0x5c068d[_0x5378('0x45')]:_0x43e2f9['model'];if(!_0x2f6585[_0x5378('0x42')][_0x5378('0x47')](_0x5378('0x48'))){_0x5c068d[_0x5378('0x32')]=qs['limit'](_0x2f6585[_0x5378('0x42')][_0x5378('0x32')]);_0x5c068d[_0x5378('0x31')]=qs[_0x5378('0x31')](_0x2f6585[_0x5378('0x42')]['offset']);}_0x5c068d[_0x5378('0x49')]=qs[_0x5378('0x4a')](_0x2f6585[_0x5378('0x42')][_0x5378('0x4a')]);_0x5c068d['where']=qs[_0x5378('0x43')](_[_0x5378('0x4b')](_0x2f6585['query'],_0x43e2f9[_0x5378('0x43')]),_0x5e07c4);if(_0x2f6585[_0x5378('0x42')][_0x5378('0x4c')]){_0x5c068d['where']=_[_0x5378('0x4d')](_0x5c068d[_0x5378('0x4e')],{'$or':_[_0x5378('0x3c')](_0x5e07c4,function(_0x55252e){if(_0x55252e[_0x5378('0x4f')]!==_0x5378('0x50')){var _0x17e018={};_0x17e018[_0x55252e[_0x5378('0x3a')]]={'$like':'%'+_0x2f6585['query'][_0x5378('0x4c')]+'%'};return _0x17e018;}})});}_0x5c068d=_[_0x5378('0x4d')]({},_0x5c068d,_0x2f6585[_0x5378('0x51')]);var _0x4b4624={'where':_0x5c068d['where']};return db[_0x5378('0x3d')][_0x5378('0x30')](_0x4b4624)['then'](function(_0x14ca01){_0x51abc1[_0x5378('0x30')]=_0x14ca01;if(_0x2f6585[_0x5378('0x42')]['includeAll']){_0x5c068d[_0x5378('0x52')]=[{'all':!![]}];}return db['Network'][_0x5378('0x53')](_0x5c068d);})[_0x5378('0x21')](function(_0x5775e4){_0x51abc1[_0x5378('0x54')]=_0x5775e4;return _0x51abc1;})['then'](respondWithFilteredResult(_0x46d69a,_0x5c068d))['catch'](handleError(_0x46d69a,null));};exports[_0x5378('0x55')]=function(_0x5386ae,_0x5b3e56){var _0x4cfd9b={'raw':!![],'where':{'id':_0x5386ae[_0x5378('0x56')]['id']}},_0x38cfb0={};_0x38cfb0[_0x5378('0x40')]=_[_0x5378('0x41')](db['Network'][_0x5378('0x3e')]);_0x38cfb0[_0x5378('0x42')]=_['keys'](_0x5386ae[_0x5378('0x42')]);_0x38cfb0['filters']=_[_0x5378('0x44')](_0x38cfb0['model'],_0x38cfb0[_0x5378('0x42')]);_0x4cfd9b[_0x5378('0x45')]=_[_0x5378('0x44')](_0x38cfb0[_0x5378('0x40')],qs[_0x5378('0x46')](_0x5386ae[_0x5378('0x42')][_0x5378('0x46')]));_0x4cfd9b[_0x5378('0x45')]=_0x4cfd9b[_0x5378('0x45')][_0x5378('0x57')]?_0x4cfd9b[_0x5378('0x45')]:_0x38cfb0['model'];if(_0x5386ae[_0x5378('0x42')][_0x5378('0x58')]){_0x4cfd9b['include']=[{'all':!![]}];}_0x4cfd9b=_[_0x5378('0x4d')]({},_0x4cfd9b,_0x5386ae[_0x5378('0x51')]);return db[_0x5378('0x3d')]['find'](_0x4cfd9b)[_0x5378('0x21')](handleEntityNotFound(_0x5b3e56,null))[_0x5378('0x21')](respondWithResult(_0x5b3e56,null))['catch'](handleError(_0x5b3e56,null));};exports[_0x5378('0x59')]=function(_0x1b920d,_0x19ec39,_0x1c0055){var _0x488a66;return db[_0x5378('0x5a')][_0x5378('0x5b')](function(_0x121432){return db[_0x5378('0x3d')][_0x5378('0x59')](_0x1b920d[_0x5378('0x5c')],{'raw':!![]})[_0x5378('0x21')](function(_0x110ff4){_0x488a66=_0x110ff4;return db[_0x5378('0x3d')][_0x5378('0x53')]({'where':{'type':_0x1b920d['body']['type']},'raw':!![]});})['then'](function(_0x27e2aa){if(_0x488a66['type']['toUpperCase']()==_0x5378('0x5d')){var _0x4bb213=fs[_0x5378('0x5e')](path[_0x5378('0x5f')](config[_0x5378('0x60')],'server/files/templates/stun_multiple.ejs'),_0x5378('0x61'));var _0x5cfd3f=ejs[_0x5378('0x62')](_0x4bb213,{'networks':_0x27e2aa||[]});fs[_0x5378('0x63')](_0x5378('0x64'),_0x5cfd3f);return respondWithRpcPromise(_0x5378('0x65'),_0x5378('0x59'),{'module':'res_stun_monitor.so'});}else if(_0x488a66['type']['toUpperCase']()==_0x5378('0x66')){var _0x2682e2=fs['readFileSync'](path['join'](config[_0x5378('0x60')],_0x5378('0x67')),_0x5378('0x61'));var _0x20050c=ejs[_0x5378('0x62')](_0x2682e2,{'networks':_0x27e2aa||[]});fs[_0x5378('0x63')]('/etc/asterisk/turn_xcally.conf',_0x20050c);return respondWithRpcPromise(_0x5378('0x65'),_0x5378('0x59'),{'module':_0x5378('0x68')});}else{var _0x198f03=fs['readFileSync'](path[_0x5378('0x5f')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x1196d6=ejs[_0x5378('0x62')](_0x198f03,{'networks':_0x27e2aa||[]});fs['writeFileSync'](util['format'](_0x5378('0x69'),_0x1b920d['body'][_0x5378('0x4f')][_0x5378('0x6a')]()),_0x1196d6);return respondWithRpcPromise(_0x5378('0x65'),_0x5378('0x59'),{'module':'chan_sip.so'});}return null;})[_0x5378('0x21')](function(){return _0x488a66;});})[_0x5378('0x21')](respondWithResult(_0x19ec39,0xc9))[_0x5378('0x2c')](handleError(_0x19ec39,null));};exports[_0x5378('0x6b')]=function(_0x4a369a,_0x1826e6,_0x524efb){var _0x14288a;return db[_0x5378('0x5a')][_0x5378('0x5b')](function(_0x4ba609){return db[_0x5378('0x3d')][_0x5378('0x6c')]({'where':{'id':_0x4a369a['params']['id']}})['then'](handleEntityNotFound(_0x1826e6,null))['then'](saveUpdates(_0x4a369a[_0x5378('0x5c')],null))[_0x5378('0x21')](function(_0x4dd5ea){if(_0x4dd5ea){_0x14288a=_0x4dd5ea;return db['Network']['findAll']({'where':{'type':_0x14288a[_0x5378('0x4f')]},'raw':!![]});}return null;})[_0x5378('0x21')](function(_0x3115e6){if(_0x14288a['type'][_0x5378('0x6d')]()=='STUN'){var _0x3ed809=fs[_0x5378('0x5e')](path[_0x5378('0x5f')](config[_0x5378('0x60')],_0x5378('0x6e')),_0x5378('0x61'));var _0x29415e=ejs[_0x5378('0x62')](_0x3ed809,{'networks':_0x3115e6||[]});fs[_0x5378('0x63')](_0x5378('0x64'),_0x29415e);return respondWithRpcPromise('Reload',_0x5378('0x6b'),{'module':_0x5378('0x68')});}else if(_0x14288a[_0x5378('0x4f')][_0x5378('0x6d')]()=='TURN'){var _0x5e60b7=fs[_0x5378('0x5e')](path[_0x5378('0x5f')](config[_0x5378('0x60')],_0x5378('0x67')),'utf8');var _0x4a99d3=ejs[_0x5378('0x62')](_0x5e60b7,{'networks':_0x3115e6||[]});fs['writeFileSync'](_0x5378('0x6f'),_0x4a99d3);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else{var _0x2272d3=fs[_0x5378('0x5e')](path['join'](config['root'],_0x5378('0x70')),'utf8');var _0xc9a8f5=ejs[_0x5378('0x62')](_0x2272d3,{'networks':_0x3115e6||[]});fs['writeFileSync'](util[_0x5378('0x71')](_0x5378('0x69'),_0x4a369a[_0x5378('0x5c')][_0x5378('0x4f')][_0x5378('0x6a')]()),_0xc9a8f5);return respondWithRpcPromise(_0x5378('0x65'),_0x5378('0x6b'),{'module':'chan_sip.so'});}return null;})[_0x5378('0x21')](function(_0x168dc0){if(_0x168dc0){return _0x14288a;}return null;});})[_0x5378('0x21')](respondWithResult(_0x1826e6,null))[_0x5378('0x2c')](handleError(_0x1826e6,null));};exports['destroy']=function(_0xa1ee85,_0x1b5d6c,_0x1aef48){var _0x2b525f;return db[_0x5378('0x3d')][_0x5378('0x6c')]({'where':{'id':_0xa1ee85[_0x5378('0x56')]['id']}})[_0x5378('0x21')](function(_0x4ac290){_0x2b525f=_0x4ac290;return _0x4ac290;})[_0x5378('0x21')](handleEntityNotFound(_0x1b5d6c,null))[_0x5378('0x21')](removeEntity(_0x1b5d6c,null))['then'](function(){if(_0x2b525f){return db['Network'][_0x5378('0x53')]({'where':{'type':_0x2b525f[_0x5378('0x4f')]},'raw':!![]});}})['then'](function(_0x17ff8c){if(_0x2b525f[_0x5378('0x4f')][_0x5378('0x6d')]()==_0x5378('0x5d')){var _0x305dce=fs[_0x5378('0x5e')](path[_0x5378('0x5f')](config[_0x5378('0x60')],_0x5378('0x6e')),_0x5378('0x61'));var _0x1b23aa=ejs[_0x5378('0x62')](_0x305dce,{'networks':_0x17ff8c||[]});fs[_0x5378('0x63')](_0x5378('0x64'),_0x1b23aa);return respondWithRpcPromise(_0x5378('0x65'),_0x5378('0x38'),{'module':_0x5378('0x68')});}else if(_0x2b525f['type'][_0x5378('0x6d')]()==_0x5378('0x66')){var _0x32fd3b=fs[_0x5378('0x5e')](path[_0x5378('0x5f')](config[_0x5378('0x60')],'server/files/templates/turn_multiple.ejs'),_0x5378('0x61'));var _0x1a0068=ejs[_0x5378('0x62')](_0x32fd3b,{'networks':_0x17ff8c||[]});fs[_0x5378('0x63')](_0x5378('0x6f'),_0x1a0068);return respondWithRpcPromise(_0x5378('0x65'),'destroy',{'module':_0x5378('0x68')});}else{var _0x3f4d36=fs['readFileSync'](path[_0x5378('0x5f')](config[_0x5378('0x60')],_0x5378('0x70')),_0x5378('0x61'));var _0x3f4a9e=ejs['render'](_0x3f4d36,{'networks':_0x17ff8c||[]});fs[_0x5378('0x63')](util[_0x5378('0x71')](_0x5378('0x69'),_0xa1ee85[_0x5378('0x5c')][_0x5378('0x4f')][_0x5378('0x6a')]()),_0x3f4a9e);return respondWithRpcPromise('Reload',_0x5378('0x38'),{'module':_0x5378('0x72')});}return null;})[_0x5378('0x2c')](handleError(_0x1b5d6c,null));};
\ No newline at end of file
index d854c75..e9d23c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb68=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','util','../../config/logger','api','moment'];(function(_0x47ea2a,_0x44acee){var _0x1e3f06=function(_0x40423a){while(--_0x40423a){_0x47ea2a['push'](_0x47ea2a['shift']());}};_0x1e3f06(++_0x44acee);}(_0xcb68,0x104));var _0x8cb6=function(_0x5743ff,_0x1008f8){_0x5743ff=_0x5743ff-0x0;var _0x3768a0=_0xcb68[_0x5743ff];return _0x3768a0;};'use strict';var _=require('lodash');var util=require(_0x8cb6('0x0'));var logger=require(_0x8cb6('0x1'))(_0x8cb6('0x2'));var moment=require(_0x8cb6('0x3'));var BPromise=require('bluebird');var rp=require(_0x8cb6('0x4'));var fs=require('fs');var path=require(_0x8cb6('0x5'));var rimraf=require(_0x8cb6('0x6'));var config=require(_0x8cb6('0x7'));var attributes=require(_0x8cb6('0x8'));module[_0x8cb6('0x9')]=function(_0x39a3ed,_0x19ca09){return _0x39a3ed[_0x8cb6('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1bcd=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./network.attributes','define','Network','network','lodash'];(function(_0x52dff6,_0x71a84){var _0x21224c=function(_0x1b19f8){while(--_0x1b19f8){_0x52dff6['push'](_0x52dff6['shift']());}};_0x21224c(++_0x71a84);}(_0x1bcd,0x1a3));var _0xd1bc=function(_0x463c54,_0x38fa0f){_0x463c54=_0x463c54-0x0;var _0x2af370=_0x1bcd[_0x463c54];return _0x2af370;};'use strict';var _=require(_0xd1bc('0x0'));var util=require('util');var logger=require(_0xd1bc('0x1'))(_0xd1bc('0x2'));var moment=require(_0xd1bc('0x3'));var BPromise=require(_0xd1bc('0x4'));var rp=require(_0xd1bc('0x5'));var fs=require('fs');var path=require(_0xd1bc('0x6'));var rimraf=require('rimraf');var config=require(_0xd1bc('0x7'));var attributes=require(_0xd1bc('0x8'));module['exports']=function(_0x5d1b3e,_0x4f3d08){return _0x5d1b3e[_0xd1bc('0x9')](_0xd1bc('0xa'),attributes,{'tableName':_0xd1bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e2a0868..5b40f60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29f0=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x53db0d,_0x5f43a5){var _0x1c8108=function(_0x336990){while(--_0x336990){_0x53db0d['push'](_0x53db0d['shift']());}};_0x1c8108(++_0x5f43a5);}(_0x29f0,0x1d4));var _0x029f=function(_0x3985fa,_0x4a260c){_0x3985fa=_0x3985fa-0x0;var _0x59dd32=_0x29f0[_0x3985fa];return _0x59dd32;};'use strict';var _=require(_0x029f('0x0'));var util=require(_0x029f('0x1'));var moment=require(_0x029f('0x2'));var BPromise=require(_0x029f('0x3'));var rs=require(_0x029f('0x4'));var fs=require('fs');var Redis=require(_0x029f('0x5'));var db=require(_0x029f('0x6'))['db'];var utils=require(_0x029f('0x7'));var logger=require(_0x029f('0x8'))(_0x029f('0x9'));var config=require(_0x029f('0xa'));var jayson=require(_0x029f('0xb'));var client=jayson[_0x029f('0xc')][_0x029f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x441648,_0x317d08,_0x1976a0){return new BPromise(function(_0x76a0bd,_0x8d3064){return client[_0x029f('0xe')](_0x441648,_0x1976a0)[_0x029f('0xf')](function(_0x2c9e6d){logger[_0x029f('0x10')](_0x029f('0x11'),_0x317d08,_0x029f('0x12'));logger[_0x029f('0x13')](_0x029f('0x14'),_0x317d08,_0x029f('0x12'),JSON[_0x029f('0x15')](_0x2c9e6d));if(_0x2c9e6d[_0x029f('0x16')]){if(_0x2c9e6d[_0x029f('0x16')][_0x029f('0x17')]===0x1f4){logger[_0x029f('0x16')](_0x029f('0x11'),_0x317d08,_0x2c9e6d['error'][_0x029f('0x18')]);return _0x8d3064(_0x2c9e6d[_0x029f('0x16')]['message']);}logger[_0x029f('0x16')](_0x029f('0x11'),_0x317d08,_0x2c9e6d['error'][_0x029f('0x18')]);return _0x76a0bd(_0x2c9e6d[_0x029f('0x16')][_0x029f('0x18')]);}else{logger[_0x029f('0x10')](_0x029f('0x11'),_0x317d08,_0x029f('0x12'));_0x76a0bd(_0x2c9e6d['result'][_0x029f('0x18')]);}})[_0x029f('0x19')](function(_0x220baf){logger[_0x029f('0x16')](_0x029f('0x11'),_0x317d08,_0x220baf);_0x8d3064(_0x220baf);});});}
\ No newline at end of file
+var _0xd5c0=['request','then','info','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x28c294,_0x30b186){var _0x2481fc=function(_0xb856c4){while(--_0xb856c4){_0x28c294['push'](_0x28c294['shift']());}};_0x2481fc(++_0x30b186);}(_0xd5c0,0x1c5));var _0x0d5c=function(_0x481bdf,_0x231538){_0x481bdf=_0x481bdf-0x0;var _0x281a12=_0xd5c0[_0x481bdf];return _0x281a12;};'use strict';var _=require('lodash');var util=require(_0x0d5c('0x0'));var moment=require('moment');var BPromise=require(_0x0d5c('0x1'));var rs=require(_0x0d5c('0x2'));var fs=require('fs');var Redis=require(_0x0d5c('0x3'));var db=require(_0x0d5c('0x4'))['db'];var utils=require(_0x0d5c('0x5'));var logger=require(_0x0d5c('0x6'))('rpc');var config=require(_0x0d5c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0d5c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x161e69,_0x1b6162,_0x27ea98){return new BPromise(function(_0x5c9192,_0x447310){return client[_0x0d5c('0x9')](_0x161e69,_0x27ea98)[_0x0d5c('0xa')](function(_0x22f746){logger[_0x0d5c('0xb')]('Network,\x20%s,\x20%s',_0x1b6162,'request\x20sent');logger[_0x0d5c('0xc')](_0x0d5c('0xd'),_0x1b6162,'request\x20sent',JSON[_0x0d5c('0xe')](_0x22f746));if(_0x22f746[_0x0d5c('0xf')]){if(_0x22f746[_0x0d5c('0xf')][_0x0d5c('0x10')]===0x1f4){logger['error'](_0x0d5c('0x11'),_0x1b6162,_0x22f746['error'][_0x0d5c('0x12')]);return _0x447310(_0x22f746[_0x0d5c('0xf')][_0x0d5c('0x12')]);}logger[_0x0d5c('0xf')]('Network,\x20%s,\x20%s',_0x1b6162,_0x22f746['error'][_0x0d5c('0x12')]);return _0x5c9192(_0x22f746['error']['message']);}else{logger[_0x0d5c('0xb')](_0x0d5c('0x11'),_0x1b6162,_0x0d5c('0x13'));_0x5c9192(_0x22f746['result'][_0x0d5c('0x12')]);}})[_0x0d5c('0x14')](function(_0x4cbc1d){logger[_0x0d5c('0xf')](_0x0d5c('0x11'),_0x1b6162,_0x4cbc1d);_0x447310(_0x4cbc1d);});});}
\ No newline at end of file
index 08b477b..52a36c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe528=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./notification.controller','post','sendNotification','exports','multer','util','path'];(function(_0x563f36,_0x41ad7d){var _0x3905a5=function(_0x4d4287){while(--_0x4d4287){_0x563f36['push'](_0x563f36['shift']());}};_0x3905a5(++_0x41ad7d);}(_0xe528,0xd5));var _0x8e52=function(_0x30330c,_0x128030){_0x30330c=_0x30330c-0x0;var _0x540364=_0xe528[_0x30330c];return _0x540364;};'use strict';var multer=require(_0x8e52('0x0'));var util=require(_0x8e52('0x1'));var path=require(_0x8e52('0x2'));var timeout=require(_0x8e52('0x3'));var express=require(_0x8e52('0x4'));var router=express[_0x8e52('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8e52('0x6'));var config=require(_0x8e52('0x7'));var controller=require(_0x8e52('0x8'));router[_0x8e52('0x9')]('/',auth['isAuthenticated'](),controller[_0x8e52('0xa')]);module[_0x8e52('0xb')]=router;
\ No newline at end of file
+var _0x4fbf=['isAuthenticated','sendNotification','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./notification.controller','post'];(function(_0x3f32ae,_0x2cd2ef){var _0xdab85e=function(_0x27ccf3){while(--_0x27ccf3){_0x3f32ae['push'](_0x3f32ae['shift']());}};_0xdab85e(++_0x2cd2ef);}(_0x4fbf,0xc0));var _0xf4fb=function(_0x3b5836,_0x36f889){_0x3b5836=_0x3b5836-0x0;var _0x568f46=_0x4fbf[_0x3b5836];return _0x568f46;};'use strict';var multer=require(_0xf4fb('0x0'));var util=require(_0xf4fb('0x1'));var path=require('path');var timeout=require(_0xf4fb('0x2'));var express=require('express');var router=express[_0xf4fb('0x3')]();var auth=require(_0xf4fb('0x4'));var interaction=require(_0xf4fb('0x5'));var config=require('../../config/environment');var controller=require(_0xf4fb('0x6'));router[_0xf4fb('0x7')]('/',auth[_0xf4fb('0x8')](),controller[_0xf4fb('0x9')]);module['exports']=router;
\ No newline at end of file
index f2916f9..c1827b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1f9=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x48c253,_0x17bd9f){var _0x4abde4=function(_0x494a0e){while(--_0x494a0e){_0x48c253['push'](_0x48c253['shift']());}};_0x4abde4(++_0x17bd9f);}(_0xf1f9,0xe3));var _0x9f1f=function(_0x2cce10,_0x1c9bb3){_0x2cce10=_0x2cce10-0x0;var _0x22e6a1=_0xf1f9[_0x2cce10];return _0x22e6a1;};'use strict';var Sequelize=require(_0x9f1f('0x0'));module[_0x9f1f('0x1')]={'body':{'type':Sequelize[_0x9f1f('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x9f1f('0x2')]},'recipientsDescription':{'type':Sequelize[_0x9f1f('0x3')]},'beep':{'type':Sequelize[_0x9f1f('0x4')]}};
\ No newline at end of file
+var _0x7f7a=['exports','STRING','TEXT','sequelize'];(function(_0x2f0e84,_0x50db02){var _0x17e1a1=function(_0x57edbc){while(--_0x57edbc){_0x2f0e84['push'](_0x2f0e84['shift']());}};_0x17e1a1(++_0x50db02);}(_0x7f7a,0x1bf));var _0xa7f7=function(_0x3e38f2,_0x1561fd){_0x3e38f2=_0x3e38f2-0x0;var _0x470c0b=_0x7f7a[_0x3e38f2];return _0x470c0b;};'use strict';var Sequelize=require(_0xa7f7('0x0'));module[_0xa7f7('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xa7f7('0x2')]},'recipientsId':{'type':Sequelize[_0xa7f7('0x3')]},'recipientsDescription':{'type':Sequelize[_0xa7f7('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
index aa9987c..600a8c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bd1=['fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','create','forEach','emit','notification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','union','queue','ids','push','all','flatten','map','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./notification.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','sendNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName'];(function(_0x1bc741,_0x2bad31){var _0x265068=function(_0x5a17eb){while(--_0x5a17eb){_0x1bc741['push'](_0x1bc741['shift']());}};_0x265068(++_0x2bad31);}(_0x1bd1,0x149));var _0x11bd=function(_0x93557a,_0x43aa42){_0x93557a=_0x93557a-0x0;var _0x57c4bb=_0x1bd1[_0x93557a];return _0x57c4bb;};'use strict';var pdf=require(_0x11bd('0x0'));var emlformat=require(_0x11bd('0x1'));var rimraf=require(_0x11bd('0x2'));var zipdir=require(_0x11bd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x11bd('0x4'));var Mustache=require('mustache');var util=require(_0x11bd('0x5'));var path=require(_0x11bd('0x6'));var sox=require(_0x11bd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x11bd('0x8'));var crypto=require(_0x11bd('0x9'));var jsforce=require(_0x11bd('0xa'));var deskjs=require(_0x11bd('0xb'));var toCsv=require(_0x11bd('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x11bd('0xd'));var authService=require(_0x11bd('0xe'));var qs=require(_0x11bd('0xf'));var as=require(_0x11bd('0x10'));var hardwareService=require(_0x11bd('0x11'));var logger=require('../../config/logger')(_0x11bd('0x12'));var utils=require(_0x11bd('0x13'));var config=require(_0x11bd('0x14'));var db=require(_0x11bd('0x15'))['db'];config['redis']=_[_0x11bd('0x16')](config[_0x11bd('0x17')],{'host':_0x11bd('0x18'),'port':0x18eb});var socket=require(_0x11bd('0x19'))(new Redis(config[_0x11bd('0x17')]));require(_0x11bd('0x1a'))[_0x11bd('0x1b')](socket);function respondWithStatusCode(_0x507ab5,_0x4389f4){_0x4389f4=_0x4389f4||0xcc;return function(_0x3eb9a3){if(_0x3eb9a3){return _0x507ab5[_0x11bd('0x1c')](_0x4389f4);}return _0x507ab5[_0x11bd('0x1d')](_0x4389f4)[_0x11bd('0x1e')]();};}function respondWithResult(_0x23d050,_0x59043f){_0x59043f=_0x59043f||0xc8;return function(_0x39116d){if(_0x39116d){return _0x23d050[_0x11bd('0x1d')](_0x59043f)[_0x11bd('0x1f')](_0x39116d);}};}function respondWithFilteredResult(_0x2ce1fc,_0x1ff139){return function(_0x44cba7){if(_0x44cba7){var _0x561f24=_0x44cba7[_0x11bd('0x20')],_0x2f8a9b=_0x1ff139[_0x11bd('0x21')],_0xe9f85=_0x1ff139[_0x11bd('0x21')]+_0x1ff139['limit'],_0x28f616;if(_0xe9f85>=_0x561f24){_0xe9f85=_0x561f24;_0x28f616=0xc8;}else{_0x28f616=0xce;}_0x2ce1fc[_0x11bd('0x1d')](_0x28f616);return _0x2ce1fc[_0x11bd('0x22')](_0x11bd('0x23'),_0x2f8a9b+'-'+_0xe9f85+'/'+_0x561f24)[_0x11bd('0x1f')](_0x44cba7);}return null;};}function patchUpdates(_0xa076a9){return function(_0x1247de){try{jsonpatch['apply'](_0x1247de,_0xa076a9,!![]);}catch(_0xde031b){return BPromise[_0x11bd('0x24')](_0xde031b);}return _0x1247de[_0x11bd('0x25')]();};}function saveUpdates(_0x326591,_0x1f8ca6){return function(_0x3af304){if(_0x3af304){return _0x3af304[_0x11bd('0x26')](_0x326591)[_0x11bd('0x27')](function(_0x2e0d4a){return _0x2e0d4a;});}return null;};}function removeEntity(_0x41e22f,_0x1c17d9){return function(_0x1df6c6){if(_0x1df6c6){return _0x1df6c6[_0x11bd('0x28')]()['then'](function(){_0x41e22f[_0x11bd('0x1d')](0xcc)[_0x11bd('0x1e')]();});}};}function handleEntityNotFound(_0x4794e4,_0x322329){return function(_0x597063){if(!_0x597063){_0x4794e4[_0x11bd('0x1c')](0x194);}return _0x597063;};}function handleError(_0x5d2507,_0x33c950){_0x33c950=_0x33c950||0x1f4;return function(_0x309d65){logger[_0x11bd('0x29')](_0x309d65[_0x11bd('0x2a')]);if(_0x309d65[_0x11bd('0x2b')]){delete _0x309d65['name'];}_0x5d2507[_0x11bd('0x1d')](_0x33c950)[_0x11bd('0x2c')](_0x309d65);};}exports[_0x11bd('0x2d')]=function(_0xf976f3,_0x31164e,_0x22ebcd){if(!_0xf976f3[_0x11bd('0x2e')][_0x11bd('0x2f')](_0x11bd('0x30'))&&!_0xf976f3['body'][_0x11bd('0x2f')]('TemplateId')){throw new db[(_0x11bd('0x31'))][(_0x11bd('0x32'))](_0x11bd('0x33'));}else{if(_0xf976f3[_0x11bd('0x2e')][_0x11bd('0x2f')](_0x11bd('0x34'))&&!_0xf976f3[_0x11bd('0x2e')][_0x11bd('0x2f')]('view')){throw new db[(_0x11bd('0x31'))][(_0x11bd('0x32'))](_0x11bd('0x35'));}if(!_0xf976f3[_0x11bd('0x2e')][_0x11bd('0x2f')](_0x11bd('0x36'))){throw new db['Sequelize'][(_0x11bd('0x32'))](_0x11bd('0x37'));}else{try{var _0x1a0b27=JSON[_0x11bd('0x38')](_0xf976f3[_0x11bd('0x2e')][_0x11bd('0x36')]);}catch(_0xf2a7a8){logger[_0x11bd('0x29')](_0xf2a7a8);throw new db[(_0x11bd('0x31'))][(_0x11bd('0x32'))](_0x11bd('0x39'));}var _0x2dd6a9=[_0x11bd('0x3a'),'faxqueue',_0x11bd('0x3b'),_0x11bd('0x3c'),_0x11bd('0x3d'),_0x11bd('0x3e'),_0x11bd('0x3f'),_0x11bd('0x40'),_0x11bd('0x41')];if(_[_0x11bd('0x42')](_0x1a0b27,function(_0x1b38d1){return!_[_0x11bd('0x43')](_0x2dd6a9,_0x1b38d1['model'][_0x11bd('0x44')]());})){throw new db[(_0x11bd('0x31'))][(_0x11bd('0x32'))](_0x11bd('0x45'));}}}var _0x861e22={};_0x861e22[_0x11bd('0x46')]=_0xf976f3['body']['hasOwnProperty'](_0x11bd('0x46'))?_0xf976f3['body']['senderName']:_0xf976f3[_0x11bd('0x41')][_0x11bd('0x47')];_0x861e22[_0x11bd('0x48')]=_[_0x11bd('0x49')](_0xf976f3[_0x11bd('0x2e')][_0x11bd('0x48')])?null:_0xf976f3['body']['recipientsDescription'];_0x861e22['beep']=_0xf976f3[_0x11bd('0x2e')][_0x11bd('0x4a')]||![];_0x861e22[_0x11bd('0x4b')]=_0xf976f3['user']['id'];return getContent(_0xf976f3[_0x11bd('0x2e')])[_0x11bd('0x27')](function(_0x18c4cf){_0x861e22[_0x11bd('0x2e')]=_0x18c4cf;return getRecipients(_0x1a0b27);})['then'](function(_0x2ff9f8){_0x861e22[_0x11bd('0x4c')]=_[_0x11bd('0x4d')](_0x2ff9f8)[_0x11bd('0x4e')](',');return db[_0x11bd('0x4f')]['transaction'](function(_0xdd1bf4){return db['Notification'][_0x11bd('0x50')](_0x861e22,{'raw':!![],'transaction':_0xdd1bf4})[_0x11bd('0x27')](function(_0x5702b3){var _0x43c982={'sender':_0x861e22['senderName'],'description':_0x861e22[_0x11bd('0x48')],'content':_0x861e22[_0x11bd('0x2e')],'beep':_0x861e22[_0x11bd('0x4a')]};_0x2ff9f8[_0x11bd('0x51')](function(_0x3e633d){_0x43c982['recipient']=_0x3e633d;socket[_0x11bd('0x52')](_0x11bd('0x53'),_0x43c982);});return _0x5702b3;});});})[_0x11bd('0x27')](respondWithResult(_0x31164e,0xc9))[_0x11bd('0x54')](handleError(_0x31164e,null));};function getContent(_0x3cbedc){return new BPromise(function(_0x311393,_0x2bc80c){if(_0x3cbedc[_0x11bd('0x30')]){_0x311393(_0x3cbedc[_0x11bd('0x30')]);return;}return db[_0x11bd('0x55')][_0x11bd('0x56')]({'attributes':[_0x11bd('0x57')],'where':{'id':_0x3cbedc['TemplateId']},'raw':!![]})[_0x11bd('0x27')](function(_0x1756e5){if(!_0x1756e5)throw new db[(_0x11bd('0x31'))][(_0x11bd('0x32'))](_0x11bd('0x58'));var _0x2e1c9e=Mustache[_0x11bd('0x59')](_0x1756e5[_0x11bd('0x57')],_0x3cbedc['view']);_0x311393(_0x2e1c9e);})[_0x11bd('0x54')](function(_0x4b4881){_0x2bc80c(_0x4b4881);});});}function getRecipients(_0x4f1166){return new BPromise(function(_0x57883b,_0x36d560){var _0x566da8=[];var _0x5313c3=[];_0x4f1166[_0x11bd('0x51')](function(_0x65ea87){var _0x4b027d=_[_0x11bd('0x5a')](_0x65ea87[_0x11bd('0x5b')][_0x11bd('0x44')]());if(_0x4b027d===_0x11bd('0x5c')){_0x566da8=_[_0x11bd('0x5d')](_0x566da8,_0x65ea87['ids']);}else{if(_[_0x11bd('0x43')](_0x4b027d,_0x11bd('0x5e')))_0x4b027d=_0x4b027d['replace'](_0x11bd('0x5e'),'Queue');_0x65ea87[_0x11bd('0x5f')][_0x11bd('0x51')](function(_0x22ddee){_0x5313c3[_0x11bd('0x60')](getAgents(_0x4b027d,_0x22ddee));});}});return BPromise[_0x11bd('0x61')](_0x5313c3)[_0x11bd('0x27')](function(_0x4e63a2){_0x566da8=_[_0x11bd('0x5d')](_0x566da8,_[_0x11bd('0x62')](_0x4e63a2));_0x57883b(_0x566da8);})[_0x11bd('0x54')](function(_0x58333f){_0x36d560(_0x58333f);});});}function getAgents(_0x3f0d18,_0x37de12){return new BPromise(function(_0x5b7d0e,_0x2dbf2d){return db[_0x3f0d18][_0x11bd('0x56')]({'where':{'id':_0x37de12}})[_0x11bd('0x27')](function(_0x5a0400){return _0x5a0400['getAgents']({'attributes':['id'],'raw':!![]})[_0x11bd('0x27')](function(_0x29c5ee){var _0x10359f=_[_0x11bd('0x63')](_0x29c5ee,'id');_0x5b7d0e(_0x10359f);});})[_0x11bd('0x54')](function(_0x5dbfcf){_0x2dbf2d(_0x5dbfcf);});});}
\ No newline at end of file
+var _0x4f3b=['destroy','error','stack','send','hasOwnProperty','text','body','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','then','recipientsId','sortBy','join','sequelize','Notification','create','recipient','emit','notification:send','Template','findOne','html','render','catch','forEach','User','ids','queue','replace','Queue','union','flatten','map','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update'];(function(_0x24b722,_0x1958fd){var _0x43ebba=function(_0xe22539){while(--_0xe22539){_0x24b722['push'](_0x24b722['shift']());}};_0x43ebba(++_0x1958fd);}(_0x4f3b,0xf4));var _0xb4f3=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0x4f3b[_0x34f701];return _0x3e2429;};'use strict';var pdf=require(_0xb4f3('0x0'));var emlformat=require(_0xb4f3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb4f3('0x2'));var jsonpatch=require(_0xb4f3('0x3'));var rp=require('request-promise');var moment=require(_0xb4f3('0x4'));var BPromise=require(_0xb4f3('0x5'));var Mustache=require(_0xb4f3('0x6'));var util=require(_0xb4f3('0x7'));var path=require(_0xb4f3('0x8'));var sox=require(_0xb4f3('0x9'));var csv=require(_0xb4f3('0xa'));var ejs=require(_0xb4f3('0xb'));var fs=require('fs');var _=require(_0xb4f3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb4f3('0xa'));var querystring=require(_0xb4f3('0xd'));var Papa=require(_0xb4f3('0xe'));var Redis=require(_0xb4f3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb4f3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4f3('0x11'));var logger=require(_0xb4f3('0x12'))(_0xb4f3('0x13'));var utils=require('../../config/utils');var config=require(_0xb4f3('0x14'));var db=require(_0xb4f3('0x15'))['db'];config[_0xb4f3('0x16')]=_[_0xb4f3('0x17')](config[_0xb4f3('0x16')],{'host':_0xb4f3('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb4f3('0x16')]));require('./notification.socket')[_0xb4f3('0x19')](socket);function respondWithStatusCode(_0x4c75d1,_0x25a73d){_0x25a73d=_0x25a73d||0xcc;return function(_0x2fcb34){if(_0x2fcb34){return _0x4c75d1[_0xb4f3('0x1a')](_0x25a73d);}return _0x4c75d1[_0xb4f3('0x1b')](_0x25a73d)[_0xb4f3('0x1c')]();};}function respondWithResult(_0x286547,_0x42d72c){_0x42d72c=_0x42d72c||0xc8;return function(_0x515cfe){if(_0x515cfe){return _0x286547[_0xb4f3('0x1b')](_0x42d72c)['json'](_0x515cfe);}};}function respondWithFilteredResult(_0x258677,_0x218663){return function(_0x3f54dd){if(_0x3f54dd){var _0x2c4177=_0x3f54dd[_0xb4f3('0x1d')],_0x52a6f9=_0x218663[_0xb4f3('0x1e')],_0x5387c7=_0x218663[_0xb4f3('0x1e')]+_0x218663[_0xb4f3('0x1f')],_0x3ce18e;if(_0x5387c7>=_0x2c4177){_0x5387c7=_0x2c4177;_0x3ce18e=0xc8;}else{_0x3ce18e=0xce;}_0x258677[_0xb4f3('0x1b')](_0x3ce18e);return _0x258677[_0xb4f3('0x20')]('Content-Range',_0x52a6f9+'-'+_0x5387c7+'/'+_0x2c4177)[_0xb4f3('0x21')](_0x3f54dd);}return null;};}function patchUpdates(_0x2ed8b2){return function(_0x17a4fb){try{jsonpatch[_0xb4f3('0x22')](_0x17a4fb,_0x2ed8b2,!![]);}catch(_0x53b1a2){return BPromise[_0xb4f3('0x23')](_0x53b1a2);}return _0x17a4fb[_0xb4f3('0x24')]();};}function saveUpdates(_0x4ab577,_0x4703f4){return function(_0x473931){if(_0x473931){return _0x473931[_0xb4f3('0x25')](_0x4ab577)['then'](function(_0x22fc24){return _0x22fc24;});}return null;};}function removeEntity(_0x547c3e,_0x427ece){return function(_0x44c764){if(_0x44c764){return _0x44c764[_0xb4f3('0x26')]()['then'](function(){_0x547c3e[_0xb4f3('0x1b')](0xcc)[_0xb4f3('0x1c')]();});}};}function handleEntityNotFound(_0x45b02a,_0x3fd4f6){return function(_0x40e9f7){if(!_0x40e9f7){_0x45b02a[_0xb4f3('0x1a')](0x194);}return _0x40e9f7;};}function handleError(_0x2edc15,_0x544c31){_0x544c31=_0x544c31||0x1f4;return function(_0x3c3f46){logger[_0xb4f3('0x27')](_0x3c3f46[_0xb4f3('0x28')]);if(_0x3c3f46['name']){delete _0x3c3f46['name'];}_0x2edc15[_0xb4f3('0x1b')](_0x544c31)[_0xb4f3('0x29')](_0x3c3f46);};}exports['sendNotification']=function(_0x40da45,_0x3207a5,_0x4b4621){if(!_0x40da45['body'][_0xb4f3('0x2a')](_0xb4f3('0x2b'))&&!_0x40da45[_0xb4f3('0x2c')][_0xb4f3('0x2a')](_0xb4f3('0x2d'))){throw new db['Sequelize']['ValidationError'](_0xb4f3('0x2e'));}else{if(_0x40da45[_0xb4f3('0x2c')][_0xb4f3('0x2a')](_0xb4f3('0x2d'))&&!_0x40da45[_0xb4f3('0x2c')][_0xb4f3('0x2a')](_0xb4f3('0x2f'))){throw new db[(_0xb4f3('0x30'))][(_0xb4f3('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x40da45[_0xb4f3('0x2c')][_0xb4f3('0x2a')]('recipients')){throw new db['Sequelize'][(_0xb4f3('0x31'))](_0xb4f3('0x32'));}else{try{var _0x4d4b7f=JSON[_0xb4f3('0x33')](_0x40da45[_0xb4f3('0x2c')]['recipients']);}catch(_0x32692e){logger[_0xb4f3('0x27')](_0x32692e);throw new db[(_0xb4f3('0x30'))]['ValidationError'](_0xb4f3('0x34'));}var _0x1d5fb5=[_0xb4f3('0x35'),'faxqueue','mailqueue',_0xb4f3('0x36'),_0xb4f3('0x37'),_0xb4f3('0x38'),_0xb4f3('0x39'),'team','user'];if(_[_0xb4f3('0x3a')](_0x4d4b7f,function(_0x579efd){return!_[_0xb4f3('0x3b')](_0x1d5fb5,_0x579efd[_0xb4f3('0x3c')][_0xb4f3('0x3d')]());})){throw new db[(_0xb4f3('0x30'))]['ValidationError'](_0xb4f3('0x3e'));}}}var _0x5d7fe7={};_0x5d7fe7['senderName']=_0x40da45['body'][_0xb4f3('0x2a')](_0xb4f3('0x3f'))?_0x40da45[_0xb4f3('0x2c')][_0xb4f3('0x3f')]:_0x40da45[_0xb4f3('0x40')][_0xb4f3('0x41')];_0x5d7fe7[_0xb4f3('0x42')]=_[_0xb4f3('0x43')](_0x40da45[_0xb4f3('0x2c')]['recipientsDescription'])?null:_0x40da45['body'][_0xb4f3('0x42')];_0x5d7fe7[_0xb4f3('0x44')]=_0x40da45['body'][_0xb4f3('0x44')]||![];_0x5d7fe7[_0xb4f3('0x45')]=_0x40da45[_0xb4f3('0x40')]['id'];return getContent(_0x40da45[_0xb4f3('0x2c')])['then'](function(_0x2ba93a){_0x5d7fe7[_0xb4f3('0x2c')]=_0x2ba93a;return getRecipients(_0x4d4b7f);})[_0xb4f3('0x46')](function(_0x588362){_0x5d7fe7[_0xb4f3('0x47')]=_[_0xb4f3('0x48')](_0x588362)[_0xb4f3('0x49')](',');return db[_0xb4f3('0x4a')]['transaction'](function(_0x1db86f){return db[_0xb4f3('0x4b')][_0xb4f3('0x4c')](_0x5d7fe7,{'raw':!![],'transaction':_0x1db86f})[_0xb4f3('0x46')](function(_0x5f25a1){var _0x3ce062={'sender':_0x5d7fe7['senderName'],'description':_0x5d7fe7[_0xb4f3('0x42')],'content':_0x5d7fe7[_0xb4f3('0x2c')],'beep':_0x5d7fe7['beep']};_0x588362['forEach'](function(_0x1efacd){_0x3ce062[_0xb4f3('0x4d')]=_0x1efacd;socket[_0xb4f3('0x4e')](_0xb4f3('0x4f'),_0x3ce062);});return _0x5f25a1;});});})[_0xb4f3('0x46')](respondWithResult(_0x3207a5,0xc9))['catch'](handleError(_0x3207a5,null));};function getContent(_0x1a5667){return new BPromise(function(_0x7b1dac,_0x2d42cb){if(_0x1a5667[_0xb4f3('0x2b')]){_0x7b1dac(_0x1a5667[_0xb4f3('0x2b')]);return;}return db[_0xb4f3('0x50')][_0xb4f3('0x51')]({'attributes':[_0xb4f3('0x52')],'where':{'id':_0x1a5667['TemplateId']},'raw':!![]})[_0xb4f3('0x46')](function(_0x206d7f){if(!_0x206d7f)throw new db['Sequelize']['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x57f367=Mustache[_0xb4f3('0x53')](_0x206d7f[_0xb4f3('0x52')],_0x1a5667[_0xb4f3('0x2f')]);_0x7b1dac(_0x57f367);})[_0xb4f3('0x54')](function(_0x4b4b2a){_0x2d42cb(_0x4b4b2a);});});}function getRecipients(_0x10ce16){return new BPromise(function(_0x56d6c3,_0x32b84b){var _0x2d2858=[];var _0x1c9a9d=[];_0x10ce16[_0xb4f3('0x55')](function(_0xed112c){var _0x2547cc=_['startCase'](_0xed112c[_0xb4f3('0x3c')][_0xb4f3('0x3d')]());if(_0x2547cc===_0xb4f3('0x56')){_0x2d2858=_['union'](_0x2d2858,_0xed112c[_0xb4f3('0x57')]);}else{if(_[_0xb4f3('0x3b')](_0x2547cc,_0xb4f3('0x58')))_0x2547cc=_0x2547cc[_0xb4f3('0x59')]('queue',_0xb4f3('0x5a'));_0xed112c[_0xb4f3('0x57')][_0xb4f3('0x55')](function(_0x400396){_0x1c9a9d['push'](getAgents(_0x2547cc,_0x400396));});}});return BPromise['all'](_0x1c9a9d)[_0xb4f3('0x46')](function(_0x1eefc6){_0x2d2858=_[_0xb4f3('0x5b')](_0x2d2858,_[_0xb4f3('0x5c')](_0x1eefc6));_0x56d6c3(_0x2d2858);})[_0xb4f3('0x54')](function(_0x1957e8){_0x32b84b(_0x1957e8);});});}function getAgents(_0x2c6b3f,_0x3d2e45){return new BPromise(function(_0x527cb1,_0x15ff81){return db[_0x2c6b3f]['findOne']({'where':{'id':_0x3d2e45}})['then'](function(_0x50a135){return _0x50a135['getAgents']({'attributes':['id'],'raw':!![]})[_0xb4f3('0x46')](function(_0x5b657a){var _0x1ed463=_[_0xb4f3('0x5d')](_0x5b657a,'id');_0x527cb1(_0x1ed463);});})['catch'](function(_0x518482){_0x15ff81(_0x518482);});});}
\ No newline at end of file
index eff62d4..aa86900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['../../mysqldb','Notification','remove','emit','hasOwnProperty','hook'];(function(_0x35cb43,_0x3f4dc5){var _0x3b2973=function(_0x534fe7){while(--_0x534fe7){_0x35cb43['push'](_0x35cb43['shift']());}};_0x3b2973(++_0x3f4dc5);}(_0x757a,0xde));var _0xa757=function(_0x30dddb,_0xc4640b){_0x30dddb=_0x30dddb-0x0;var _0x46f9a2=_0x757a[_0x30dddb];return _0x46f9a2;};'use strict';var EventEmitter=require('events');var Notification=require(_0xa757('0x0'))['db'][_0xa757('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa757('0x2')};function emitEvent(_0x1721c6){return function(_0x1c2932,_0x453d07,_0x32630d){NotificationEvents[_0xa757('0x3')](_0x1721c6+':'+_0x1c2932['id'],_0x1c2932);NotificationEvents['emit'](_0x1721c6,_0x1c2932);_0x32630d(null);};}for(var e in events){if(events[_0xa757('0x4')](e)){var event=events[e];Notification[_0xa757('0x5')](e,emitEvent(event));}}module['exports']=NotificationEvents;
\ No newline at end of file
+var _0xdb28=['Notification','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x237d51,_0x5382b0){var _0x4d3eb0=function(_0x28714e){while(--_0x28714e){_0x237d51['push'](_0x237d51['shift']());}};_0x4d3eb0(++_0x5382b0);}(_0xdb28,0x106));var _0x8db2=function(_0x26df3b,_0x585b05){_0x26df3b=_0x26df3b-0x0;var _0x17ad32=_0xdb28[_0x26df3b];return _0x17ad32;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var Notification=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var NotificationEvents=new EventEmitter();NotificationEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){NotificationEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);NotificationEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Notification['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=NotificationEvents;
\ No newline at end of file
index 0efce92..5388ef0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96fb=['request-promise','path','./notification.attributes','exports','define','notifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x96fb,0xcc));var _0xb96f=function(_0x2deae6,_0x20b35c){_0x2deae6=_0x2deae6-0x0;var _0x23674f=_0x96fb[_0x2deae6];return _0x23674f;};'use strict';var _=require(_0xb96f('0x0'));var util=require(_0xb96f('0x1'));var logger=require(_0xb96f('0x2'))(_0xb96f('0x3'));var moment=require(_0xb96f('0x4'));var BPromise=require(_0xb96f('0x5'));var rp=require(_0xb96f('0x6'));var fs=require('fs');var path=require(_0xb96f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb96f('0x8'));module[_0xb96f('0x9')]=function(_0x459aa6,_0xd4ce84){return _0x459aa6[_0xb96f('0xa')]('Notification',attributes,{'tableName':_0xb96f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb96f('0xc'),'collate':_0xb96f('0xd')});};
\ No newline at end of file
+var _0x541b=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./notification.attributes','exports','Notification','notifications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x54f1a2,_0x4056dd){var _0x32179a=function(_0x130804){while(--_0x130804){_0x54f1a2['push'](_0x54f1a2['shift']());}};_0x32179a(++_0x4056dd);}(_0x541b,0x15d));var _0xb541=function(_0xa9b067,_0x2047eb){_0xa9b067=_0xa9b067-0x0;var _0x492156=_0x541b[_0xa9b067];return _0x492156;};'use strict';var _=require('lodash');var util=require(_0xb541('0x0'));var logger=require(_0xb541('0x1'))('api');var moment=require(_0xb541('0x2'));var BPromise=require(_0xb541('0x3'));var rp=require(_0xb541('0x4'));var fs=require('fs');var path=require(_0xb541('0x5'));var rimraf=require(_0xb541('0x6'));var config=require(_0xb541('0x7'));var attributes=require(_0xb541('0x8'));module[_0xb541('0x9')]=function(_0x3c68d2,_0x5edcf8){return _0x3c68d2['define'](_0xb541('0xa'),attributes,{'tableName':_0xb541('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb541('0xc'),'collate':_0xb541('0xd')});};
\ No newline at end of file
index e2ab439..dfc7feb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x415c=['register','request','info','Notification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./notification.socket'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x415c,0x1c0));var _0xc415=function(_0x53bf35,_0x4ba7b0){_0x53bf35=_0x53bf35-0x0;var _0x37e5ff=_0x415c[_0x53bf35];return _0x37e5ff;};'use strict';var _=require('lodash');var util=require(_0xc415('0x0'));var moment=require(_0xc415('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc415('0x2'));var db=require(_0xc415('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc415('0x4'))('rpc');var config=require(_0xc415('0x5'));var jayson=require(_0xc415('0x6'));var client=jayson['client'][_0xc415('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc415('0x8')],{'host':_0xc415('0x9'),'port':0x18eb});var socket=require(_0xc415('0xa'))(new Redis(config[_0xc415('0x8')]));require(_0xc415('0xb'))[_0xc415('0xc')](socket);function respondWithRpcPromise(_0x50a0f3,_0x34d9b7,_0x6335ef){return new BPromise(function(_0x1878af,_0x498c55){return client[_0xc415('0xd')](_0x50a0f3,_0x6335ef)['then'](function(_0x15cd84){logger[_0xc415('0xe')](_0xc415('0xf'),_0x34d9b7,_0xc415('0x10'));logger[_0xc415('0x11')]('Notification,\x20%s,\x20%s,\x20%s',_0x34d9b7,_0xc415('0x10'),JSON[_0xc415('0x12')](_0x15cd84));if(_0x15cd84[_0xc415('0x13')]){if(_0x15cd84[_0xc415('0x13')][_0xc415('0x14')]===0x1f4){logger[_0xc415('0x13')](_0xc415('0xf'),_0x34d9b7,_0x15cd84[_0xc415('0x13')][_0xc415('0x15')]);return _0x498c55(_0x15cd84[_0xc415('0x13')][_0xc415('0x15')]);}logger['error'](_0xc415('0xf'),_0x34d9b7,_0x15cd84[_0xc415('0x13')][_0xc415('0x15')]);return _0x1878af(_0x15cd84['error'][_0xc415('0x15')]);}else{logger[_0xc415('0xe')](_0xc415('0xf'),_0x34d9b7,'request\x20sent');_0x1878af(_0x15cd84[_0xc415('0x16')][_0xc415('0x15')]);}})['catch'](function(_0x4cb06b){logger[_0xc415('0x13')]('Notification,\x20%s,\x20%s',_0x34d9b7,_0x4cb06b);_0x498c55(_0x4cb06b);});});}
\ No newline at end of file
+var _0xacd6=['http','redis','localhost','socket.io-emitter','./notification.socket','register','request','then','info','Notification,\x20%s,\x20%s','request\x20sent','Notification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0xacd6,0x17d));var _0x6acd=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0xacd6[_0x4d8666];return _0x37175b;};'use strict';var _=require(_0x6acd('0x0'));var util=require('util');var moment=require(_0x6acd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6acd('0x2'));var db=require(_0x6acd('0x3'))['db'];var utils=require(_0x6acd('0x4'));var logger=require(_0x6acd('0x5'))(_0x6acd('0x6'));var config=require(_0x6acd('0x7'));var jayson=require(_0x6acd('0x8'));var client=jayson['client'][_0x6acd('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6acd('0xa')],{'host':_0x6acd('0xb'),'port':0x18eb});var socket=require(_0x6acd('0xc'))(new Redis(config[_0x6acd('0xa')]));require(_0x6acd('0xd'))[_0x6acd('0xe')](socket);function respondWithRpcPromise(_0x56c578,_0x3737c4,_0x3c7b29){return new BPromise(function(_0x52d64b,_0x15b3b6){return client[_0x6acd('0xf')](_0x56c578,_0x3c7b29)[_0x6acd('0x10')](function(_0x3d2e30){logger[_0x6acd('0x11')](_0x6acd('0x12'),_0x3737c4,_0x6acd('0x13'));logger['debug'](_0x6acd('0x14'),_0x3737c4,'request\x20sent',JSON['stringify'](_0x3d2e30));if(_0x3d2e30['error']){if(_0x3d2e30[_0x6acd('0x15')][_0x6acd('0x16')]===0x1f4){logger[_0x6acd('0x15')](_0x6acd('0x12'),_0x3737c4,_0x3d2e30[_0x6acd('0x15')][_0x6acd('0x17')]);return _0x15b3b6(_0x3d2e30[_0x6acd('0x15')][_0x6acd('0x17')]);}logger[_0x6acd('0x15')]('Notification,\x20%s,\x20%s',_0x3737c4,_0x3d2e30[_0x6acd('0x15')][_0x6acd('0x17')]);return _0x52d64b(_0x3d2e30['error'][_0x6acd('0x17')]);}else{logger[_0x6acd('0x11')](_0x6acd('0x12'),_0x3737c4,_0x6acd('0x13'));_0x52d64b(_0x3d2e30[_0x6acd('0x18')][_0x6acd('0x17')]);}})[_0x6acd('0x19')](function(_0x128bdd){logger[_0x6acd('0x15')](_0x6acd('0x12'),_0x3737c4,_0x128bdd);_0x15b3b6(_0x128bdd);});});}
\ No newline at end of file
index 651b4b7..520d6cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bf4=['removeListener','length','notification:','./notification.events','save','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7bf4,0xc9));var _0x47bf=function(_0x26347b,_0x32596c){_0x26347b=_0x26347b-0x0;var _0x5551ff=_0x7bf4[_0x26347b];return _0x5551ff;};'use strict';var NotificationEvents=require(_0x47bf('0x0'));var events=[_0x47bf('0x1'),'remove','update'];function createListener(_0xde944a,_0x56cda7){return function(_0x456443){_0x56cda7[_0x47bf('0x2')](_0xde944a,_0x456443);};}function removeListener(_0x4f1696,_0x27285e){return function(){NotificationEvents[_0x47bf('0x3')](_0x4f1696,_0x27285e);};}exports['register']=function(_0x47f0fb){for(var _0x152a5a=0x0,_0x9bbd12=events[_0x47bf('0x4')];_0x152a5a<_0x9bbd12;_0x152a5a++){var _0x340e10=events[_0x152a5a];var _0x5075f5=createListener(_0x47bf('0x5')+_0x340e10,_0x47f0fb);NotificationEvents['on'](_0x340e10,_0x5075f5);}};
\ No newline at end of file
+var _0x65de=['removeListener','length','notification:','./notification.events','save','emit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x65de,0x129));var _0xe65d=function(_0x142d3e,_0x3f756f){_0x142d3e=_0x142d3e-0x0;var _0x2be5e3=_0x65de[_0x142d3e];return _0x2be5e3;};'use strict';var NotificationEvents=require(_0xe65d('0x0'));var events=[_0xe65d('0x1'),'remove','update'];function createListener(_0x526cfd,_0x4b4a4e){return function(_0x3feadf){_0x4b4a4e[_0xe65d('0x2')](_0x526cfd,_0x3feadf);};}function removeListener(_0x4eba68,_0x4fc8d6){return function(){NotificationEvents[_0xe65d('0x3')](_0x4eba68,_0x4fc8d6);};}exports['register']=function(_0x3045c9){for(var _0x34b0a1=0x0,_0x45737a=events[_0xe65d('0x4')];_0x34b0a1<_0x45737a;_0x34b0a1++){var _0x9d6d49=events[_0x34b0a1];var _0x16321f=createListener(_0xe65d('0x5')+_0x9d6d49,_0x3045c9);NotificationEvents['on'](_0x9d6d49,_0x16321f);}};
\ No newline at end of file
index db7788e..e4ef10f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x557b=['index','/describe','describe','/:id','isAuthenticated','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','getAgents','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x557b,0x6a));var _0xb557=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x557b[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0xb557('0x0'));var util=require(_0xb557('0x1'));var path=require('path');var timeout=require(_0xb557('0x2'));var express=require(_0xb557('0x3'));var router=express['Router']();var auth=require(_0xb557('0x4'));var interaction=require(_0xb557('0x5'));var config=require('../../config/environment');var controller=require(_0xb557('0x6'));router[_0xb557('0x7')]('/',auth['isAuthenticated'](),controller[_0xb557('0x8')]);router[_0xb557('0x7')](_0xb557('0x9'),auth['isAuthenticated'](),controller[_0xb557('0xa')]);router[_0xb557('0x7')](_0xb557('0xb'),auth[_0xb557('0xc')](),controller[_0xb557('0xd')]);router['get']('/:id/dispositions',auth[_0xb557('0xc')](),controller[_0xb557('0xe')]);router[_0xb557('0x7')](_0xb557('0xf'),auth[_0xb557('0xc')](),controller[_0xb557('0x10')]);router[_0xb557('0x7')](_0xb557('0x11'),auth[_0xb557('0xc')](),controller[_0xb557('0x12')]);router[_0xb557('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xb557('0x13')]);router[_0xb557('0x7')]('/:id/users',auth[_0xb557('0xc')](),controller[_0xb557('0x14')]);router[_0xb557('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb557('0x15')](_0xb557('0x16'),auth[_0xb557('0xc')](),controller[_0xb557('0x17')]);router[_0xb557('0x15')](_0xb557('0xf'),auth[_0xb557('0xc')](),controller[_0xb557('0x18')]);router['post'](_0xb557('0x19'),controller[_0xb557('0x1a')]);router[_0xb557('0x15')](_0xb557('0x11'),auth[_0xb557('0xc')](),controller[_0xb557('0x1b')]);router['post'](_0xb557('0x1c'),auth['isAuthenticated'](),controller['addAgents']);router[_0xb557('0x15')](_0xb557('0x1d'),auth[_0xb557('0xc')](),controller[_0xb557('0x1e')]);router[_0xb557('0x1f')](_0xb557('0xb'),auth[_0xb557('0xc')](),controller[_0xb557('0x20')]);router[_0xb557('0x21')]('/:id',auth[_0xb557('0xc')](),controller[_0xb557('0x22')]);router[_0xb557('0x21')]('/:id/dispositions',auth[_0xb557('0xc')](),controller[_0xb557('0x23')]);router[_0xb557('0x21')]('/:id/canned_answers',auth[_0xb557('0xc')](),controller[_0xb557('0x24')]);router[_0xb557('0x21')](_0xb557('0x1c'),auth[_0xb557('0xc')](),controller['removeAgents']);module[_0xb557('0x25')]=router;
\ No newline at end of file
+var _0x1214=['addAgents','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/applications'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1214,0xec));var _0x4121=function(_0x3d34fc,_0x19448a){_0x3d34fc=_0x3d34fc-0x0;var _0x35a98c=_0x1214[_0x3d34fc];return _0x35a98c;};'use strict';var multer=require(_0x4121('0x0'));var util=require(_0x4121('0x1'));var path=require(_0x4121('0x2'));var timeout=require(_0x4121('0x3'));var express=require('express');var router=express[_0x4121('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4121('0x5'));var config=require(_0x4121('0x6'));var controller=require(_0x4121('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4121('0x8')]);router[_0x4121('0x9')](_0x4121('0xa'),auth[_0x4121('0xb')](),controller[_0x4121('0xc')]);router['get'](_0x4121('0xd'),auth[_0x4121('0xb')](),controller[_0x4121('0xe')]);router[_0x4121('0x9')](_0x4121('0xf'),auth['isAuthenticated'](),controller[_0x4121('0x10')]);router[_0x4121('0x9')](_0x4121('0x11'),auth[_0x4121('0xb')](),controller[_0x4121('0x12')]);router[_0x4121('0x9')]('/:id/applications',auth[_0x4121('0xb')](),controller[_0x4121('0x13')]);router[_0x4121('0x9')](_0x4121('0x14'),auth[_0x4121('0xb')](),controller[_0x4121('0x15')]);router[_0x4121('0x9')](_0x4121('0x16'),auth[_0x4121('0xb')](),controller[_0x4121('0x17')]);router[_0x4121('0x18')]('/',auth[_0x4121('0xb')](),controller[_0x4121('0x19')]);router[_0x4121('0x18')](_0x4121('0xf'),auth[_0x4121('0xb')](),controller['addDisposition']);router[_0x4121('0x18')]('/:id/canned_answers',auth[_0x4121('0xb')](),controller[_0x4121('0x1a')]);router[_0x4121('0x18')]('/:id/notify',controller['notify']);router[_0x4121('0x18')](_0x4121('0x1b'),auth[_0x4121('0xb')](),controller['addApplications']);router['post'](_0x4121('0x16'),auth[_0x4121('0xb')](),controller[_0x4121('0x1c')]);router[_0x4121('0x18')]('/:id/send',auth[_0x4121('0xb')](),controller['send']);router[_0x4121('0x1d')]('/:id',auth[_0x4121('0xb')](),controller[_0x4121('0x1e')]);router[_0x4121('0x1f')](_0x4121('0xd'),auth[_0x4121('0xb')](),controller['destroy']);router[_0x4121('0x1f')](_0x4121('0xf'),auth[_0x4121('0xb')](),controller['removeDispositions']);router[_0x4121('0x1f')](_0x4121('0x11'),auth[_0x4121('0xb')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x4121('0xb')](),controller['removeAgents']);module[_0x4121('0x20')]=router;
\ No newline at end of file
index 1346773..4944e69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b89=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x5b7606,_0x3367ef){var _0x186584=function(_0x3ba49d){while(--_0x3ba49d){_0x5b7606['push'](_0x5b7606['shift']());}};_0x186584(++_0x3367ef);}(_0x2b89,0x18a));var _0x92b8=function(_0x5e3fd0,_0x5c0726){_0x5e3fd0=_0x5e3fd0-0x0;var _0x110dce=_0x2b89[_0x5e3fd0];return _0x110dce;};'use strict';var Sequelize=require(_0x92b8('0x0'));var rs=require(_0x92b8('0x1'));module[_0x92b8('0x2')]={'name':{'type':Sequelize[_0x92b8('0x3')],'unique':_0x92b8('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x92b8('0x3')]},'token':{'type':Sequelize[_0x92b8('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x92b8('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x92b8('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x92b8('0x5');}},'notificationSound':{'type':Sequelize[_0x92b8('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x92b8('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x92b8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x92b8('0x3')]},'queueTransfer':{'type':Sequelize[_0x92b8('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x92b8('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x92b8('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x92b8('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x92b8('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x92b8('0x9'),'set':function(_0x2c24b5){if(!_0x2c24b5)this[_0x92b8('0xa')](_0x92b8('0xb'),null);this[_0x92b8('0xa')](_0x92b8('0xc'),_0x2c24b5);}}};
\ No newline at end of file
+var _0x85c7=['randomstring','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x189de4,_0x3d203f){var _0x52f95e=function(_0x4dea26){while(--_0x4dea26){_0x189de4['push'](_0x189de4['shift']());}};_0x52f95e(++_0x3d203f);}(_0x85c7,0x154));var _0x785c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x85c7[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x785c('0x0'));var rs=require(_0x785c('0x1'));module['exports']={'name':{'type':Sequelize[_0x785c('0x2')],'unique':_0x785c('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x785c('0x2')],'defaultValue':function(){return rs[_0x785c('0x4')]();}},'replyUri':{'type':Sequelize[_0x785c('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x785c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x785c('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x785c('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x785c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x785c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'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[_0x785c('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x785c('0x6')],'defaultValue':![],'comment':_0x785c('0x8'),'set':function(_0x33520c){if(!_0x33520c)this[_0x785c('0x9')](_0x785c('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x33520c);}}};
\ No newline at end of file
index e4be730..18d7da5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24b0=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','show','mandatoryDispositionPause','intersection','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','Applications','applications','list','orderBy','priority','account','Contacts','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','autoclose','unmanaged','*,*,*,*','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','sequelize','OpenchannelApplication','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','dataValues','Messages','push','html-pdf','rimraf','fast-json-patch','bluebird','mustache','sox','ejs','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','error','message','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length'];(function(_0x550296,_0x22e9d7){var _0x5a9993=function(_0x104c18){while(--_0x104c18){_0x550296['push'](_0x550296['shift']());}};_0x5a9993(++_0x22e9d7);}(_0x24b0,0x1d1));var _0x024b=function(_0x356c00,_0x47cf03){_0x356c00=_0x356c00-0x0;var _0x359721=_0x24b0[_0x356c00];return _0x359721;};'use strict';var pdf=require(_0x024b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x024b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x024b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x024b('0x3'));var Mustache=require(_0x024b('0x4'));var util=require('util');var path=require('path');var sox=require(_0x024b('0x5'));var csv=require('to-csv');var ejs=require(_0x024b('0x6'));var fs=require('fs');var _=require(_0x024b('0x7'));var squel=require(_0x024b('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x024b('0x9'));var Redis=require(_0x024b('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x024b('0xb'));var as=require(_0x024b('0xc'));var hardwareService=require(_0x024b('0xd'));var logger=require(_0x024b('0xe'))(_0x024b('0xf'));var utils=require('../../config/utils');var config=require(_0x024b('0x10'));var db=require(_0x024b('0x11'))['db'];config[_0x024b('0x12')]=_[_0x024b('0x13')](config[_0x024b('0x12')],{'host':_0x024b('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x024b('0x15'))[_0x024b('0x16')](socket);var jayson=require(_0x024b('0x17'));var client=jayson[_0x024b('0x18')][_0x024b('0x19')]({'port':0x232c});var client9002=jayson[_0x024b('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x115a3e,_0x2e6c97,_0x2a6b75){if(_0x2a6b75){var _0x12d1c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12d1c9[_0x024b('0x1a')](_0x2e6c97)){return _0x115a3e;}else{throw new db[(_0x024b('0x1b'))][(_0x024b('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x115a3e;}}function respondWithRpcPromise(_0x577526,_0x2159bd,_0x55f698,_0x497237){return new BPromise(function(_0x54e945,_0x5ad114){var _0x409340=_0x497237||client;return _0x409340[_0x024b('0x1d')](_0x577526,_0x55f698)['then'](function(_0x5197f8){logger[_0x024b('0x1e')](_0x024b('0x1f'),_0x2159bd,_0x024b('0x20'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2159bd,'request\x20sent',JSON['stringify'](_0x5197f8));if(_0x5197f8[_0x024b('0x21')]){if(_0x5197f8[_0x024b('0x21')]['code']===0x1f4){logger[_0x024b('0x21')](_0x024b('0x1f'),_0x2159bd,_0x5197f8[_0x024b('0x21')][_0x024b('0x22')]);return _0x5ad114(_0x5197f8[_0x024b('0x21')][_0x024b('0x22')]);}logger['error'](_0x024b('0x1f'),_0x2159bd,_0x5197f8['error'][_0x024b('0x22')]);return _0x54e945(_0x5197f8['error']['message']);}else{logger[_0x024b('0x1e')](_0x024b('0x1f'),_0x2159bd,_0x024b('0x20'));_0x54e945(_0x5197f8['result'][_0x024b('0x22')]);}})[_0x024b('0x23')](function(_0x252aeb){logger['error'](_0x024b('0x1f'),_0x2159bd,_0x252aeb);_0x5ad114(_0x252aeb);});});}function respondWithStatusCode(_0xf6af39,_0xc52600){_0xc52600=_0xc52600||0xcc;return function(_0x1271d4){if(_0x1271d4){return _0xf6af39['sendStatus'](_0xc52600);}return _0xf6af39[_0x024b('0x24')](_0xc52600)[_0x024b('0x25')]();};}function respondWithResult(_0x413b8b,_0x4be02b){_0x4be02b=_0x4be02b||0xc8;return function(_0x3ec4d6){if(_0x3ec4d6){return _0x413b8b['status'](_0x4be02b)[_0x024b('0x26')](_0x3ec4d6);}};}function respondWithFilteredResult(_0x2ada32,_0x46c636){return function(_0x3834be){if(_0x3834be){var _0x3db5d8=_0x3834be[_0x024b('0x27')],_0x1a862e=_0x46c636['offset'],_0xce019e=_0x46c636[_0x024b('0x28')]+_0x46c636[_0x024b('0x29')],_0x5e60bf;if(_0xce019e>=_0x3db5d8){_0xce019e=_0x3db5d8;_0x5e60bf=0xc8;}else{_0x5e60bf=0xce;}_0x2ada32[_0x024b('0x24')](_0x5e60bf);return _0x2ada32[_0x024b('0x2a')]('Content-Range',_0x1a862e+'-'+_0xce019e+'/'+_0x3db5d8)[_0x024b('0x26')](_0x3834be);}return null;};}function patchUpdates(_0x98eb3){return function(_0x4bcb20){try{jsonpatch[_0x024b('0x2b')](_0x4bcb20,_0x98eb3,!![]);}catch(_0xfc067d){return BPromise[_0x024b('0x2c')](_0xfc067d);}return _0x4bcb20[_0x024b('0x2d')]();};}function saveUpdates(_0x1e5f02,_0x31facb){return function(_0x54a41b){if(_0x54a41b){return _0x54a41b[_0x024b('0x2e')](_0x1e5f02)[_0x024b('0x2f')](function(_0x387945){return _0x387945;});}return null;};}function removeEntity(_0x37830b,_0x2ae41c){return function(_0x2f82f0){if(_0x2f82f0){return _0x2f82f0['destroy']()['then'](function(){var _0x55825e=_0x2f82f0[_0x024b('0x30')]({'plain':!![]});var _0x1a5e1e=_0x024b('0x31');return db[_0x024b('0x32')]['destroy']({'where':{'type':_0x1a5e1e,'resourceId':_0x55825e['id']}})[_0x024b('0x2f')](function(){return _0x2f82f0;});})[_0x024b('0x2f')](function(){_0x37830b['status'](0xcc)[_0x024b('0x25')]();});}};}function handleEntityNotFound(_0x34cc91,_0x50ef7f){return function(_0x3091f9){if(!_0x3091f9){_0x34cc91[_0x024b('0x33')](0x194);}return _0x3091f9;};}function handleError(_0x3f6f08,_0x4e394f){_0x4e394f=_0x4e394f||0x1f4;return function(_0x473844){logger['error'](_0x473844[_0x024b('0x34')]);if(_0x473844[_0x024b('0x35')]){delete _0x473844[_0x024b('0x35')];}_0x3f6f08[_0x024b('0x24')](_0x4e394f)['send'](_0x473844);};}exports[_0x024b('0x36')]=function(_0x18291a,_0x3f4fab){var _0x303370={'include':[{'model':db[_0x024b('0x37')],'as':'mandatoryDispositionPause'}]},_0x5efd0c={},_0x37d958={'count':0x0,'rows':[]};var _0x2c6cf0=_['map'](db[_0x024b('0x38')][_0x024b('0x39')],function(_0x55262f){return{'name':_0x55262f[_0x024b('0x3a')],'type':_0x55262f[_0x024b('0x3b')][_0x024b('0x3c')]};});_0x5efd0c[_0x024b('0x3d')]=_[_0x024b('0x3e')](_0x2c6cf0,_0x024b('0x35'));_0x5efd0c[_0x024b('0x3f')]=_[_0x024b('0x40')](_0x18291a[_0x024b('0x3f')]);_0x5efd0c[_0x024b('0x41')]=_['intersection'](_0x5efd0c[_0x024b('0x3d')],_0x5efd0c[_0x024b('0x3f')]);_0x303370[_0x024b('0x42')]=_['intersection'](_0x5efd0c[_0x024b('0x3d')],qs[_0x024b('0x43')](_0x18291a[_0x024b('0x3f')][_0x024b('0x43')]));_0x303370[_0x024b('0x42')]=_0x303370[_0x024b('0x42')][_0x024b('0x44')]?_0x303370[_0x024b('0x42')]:_0x5efd0c[_0x024b('0x3d')];if(!_0x18291a[_0x024b('0x3f')][_0x024b('0x45')](_0x024b('0x46'))){_0x303370[_0x024b('0x29')]=qs[_0x024b('0x29')](_0x18291a[_0x024b('0x3f')]['limit']);_0x303370[_0x024b('0x28')]=qs['offset'](_0x18291a[_0x024b('0x3f')][_0x024b('0x28')]);}_0x303370[_0x024b('0x47')]=qs[_0x024b('0x48')](_0x18291a[_0x024b('0x3f')][_0x024b('0x48')]);_0x303370[_0x024b('0x49')]=qs['filters'](_[_0x024b('0x4a')](_0x18291a[_0x024b('0x3f')],_0x5efd0c[_0x024b('0x41')]),_0x2c6cf0);if(_0x18291a[_0x024b('0x3f')][_0x024b('0x4b')]){_0x303370['where']=_[_0x024b('0x4c')](_0x303370[_0x024b('0x49')],{'$or':_[_0x024b('0x3e')](_0x2c6cf0,function(_0x2d29c5){if(_0x2d29c5[_0x024b('0x3b')]!=='VIRTUAL'){var _0x587f51={};_0x587f51[_0x2d29c5['name']]={'$like':'%'+_0x18291a['query']['filter']+'%'};return _0x587f51;}})});}_0x303370=_[_0x024b('0x4c')]({},_0x303370,_0x18291a['options']);var _0x9a902b={'where':_0x303370['where']};return db[_0x024b('0x38')][_0x024b('0x27')](_0x9a902b)[_0x024b('0x2f')](function(_0x40aaed){_0x37d958[_0x024b('0x27')]=_0x40aaed;if(_0x18291a['query'][_0x024b('0x4d')]){_0x303370[_0x024b('0x4e')]=[{'all':!![]}];}return db[_0x024b('0x38')][_0x024b('0x4f')](_0x303370);})[_0x024b('0x2f')](function(_0x19c11d){_0x37d958['rows']=_0x19c11d;return _0x37d958;})[_0x024b('0x2f')](respondWithFilteredResult(_0x3f4fab,_0x303370))[_0x024b('0x23')](handleError(_0x3f4fab,null));};exports[_0x024b('0x50')]=function(_0x2b1bcf,_0x5b7067){var _0x4c9523={'raw':![],'where':{'id':_0x2b1bcf['params']['id']},'include':[{'model':db[_0x024b('0x37')],'as':_0x024b('0x51')}]},_0xabe026={};_0xabe026[_0x024b('0x3d')]=_[_0x024b('0x40')](db[_0x024b('0x38')][_0x024b('0x39')]);_0xabe026[_0x024b('0x3f')]=_[_0x024b('0x40')](_0x2b1bcf[_0x024b('0x3f')]);_0xabe026[_0x024b('0x41')]=_[_0x024b('0x52')](_0xabe026[_0x024b('0x3d')],_0xabe026[_0x024b('0x3f')]);_0x4c9523[_0x024b('0x42')]=_[_0x024b('0x52')](_0xabe026[_0x024b('0x3d')],qs[_0x024b('0x43')](_0x2b1bcf[_0x024b('0x3f')][_0x024b('0x43')]));_0x4c9523['attributes']=_0x4c9523[_0x024b('0x42')][_0x024b('0x44')]?_0x4c9523[_0x024b('0x42')]:_0xabe026[_0x024b('0x3d')];if(_0x2b1bcf[_0x024b('0x3f')][_0x024b('0x4d')]){_0x4c9523[_0x024b('0x4e')]=[{'all':!![]}];}_0x4c9523=_[_0x024b('0x4c')]({},_0x4c9523,_0x2b1bcf[_0x024b('0x53')]);return db[_0x024b('0x38')][_0x024b('0x54')](_0x4c9523)[_0x024b('0x2f')](handleEntityNotFound(_0x5b7067,null))['then'](respondWithResult(_0x5b7067,null))[_0x024b('0x23')](handleError(_0x5b7067,null));};exports[_0x024b('0x55')]=function(_0x3fb4fd,_0x28664d){return db[_0x024b('0x38')][_0x024b('0x55')](_0x3fb4fd[_0x024b('0x56')],{})[_0x024b('0x2f')](function(_0xd19007){var _0x4b138f=_0x3fb4fd['user'][_0x024b('0x30')]({'plain':!![]});if(!_0x4b138f)throw new Error(_0x024b('0x57'));if(_0x4b138f[_0x024b('0x58')]===_0x024b('0x59')){var _0x168841=_0xd19007[_0x024b('0x30')]({'plain':!![]});var _0x4c650c='OpenchannelAccounts';return db[_0x024b('0x5a')][_0x024b('0x54')]({'where':{'name':_0x4c650c,'userProfileId':_0x4b138f[_0x024b('0x5b')]},'raw':!![]})[_0x024b('0x2f')](function(_0x395504){if(_0x395504&&_0x395504['autoAssociation']===0x0){return db[_0x024b('0x32')][_0x024b('0x55')]({'name':_0x168841[_0x024b('0x35')],'resourceId':_0x168841['id'],'type':_0x395504[_0x024b('0x35')],'sectionId':_0x395504['id']},{})[_0x024b('0x2f')](function(){return _0xd19007;});}else{return _0xd19007;}})['catch'](function(_0x1d9d68){logger[_0x024b('0x21')](_0x024b('0x5c'),_0x1d9d68);throw _0x1d9d68;});}return _0xd19007;})[_0x024b('0x2f')](respondWithResult(_0x28664d,0xc9))[_0x024b('0x23')](handleError(_0x28664d,null));};exports['update']=function(_0x54e121,_0x2d57ca){if(_0x54e121['body']['id']){delete _0x54e121[_0x024b('0x56')]['id'];}return db[_0x024b('0x38')][_0x024b('0x54')]({'where':{'id':_0x54e121[_0x024b('0x5d')]['id']},'include':[{'model':db[_0x024b('0x37')],'as':_0x024b('0x51')}]})[_0x024b('0x2f')](handleEntityNotFound(_0x2d57ca,null))[_0x024b('0x2f')](saveUpdates(_0x54e121['body'],null))[_0x024b('0x2f')](respondWithResult(_0x2d57ca,null))['catch'](handleError(_0x2d57ca,null));};exports['destroy']=function(_0x550b43,_0x5e2165){return db['OpenchannelAccount']['find']({'where':{'id':_0x550b43[_0x024b('0x5d')]['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x5e2165,null))[_0x024b('0x2f')](removeEntity(_0x5e2165,null))[_0x024b('0x23')](handleError(_0x5e2165,null));};exports[_0x024b('0x5e')]=function(_0x3ddc31,_0x2b1481){return db[_0x024b('0x38')][_0x024b('0x5e')]()['then'](respondWithResult(_0x2b1481,null))[_0x024b('0x23')](handleError(_0x2b1481,null));};exports[_0x024b('0x5f')]=function(_0x1766d1,_0xf17467,_0x4ebd0d){if(_0x1766d1['body']['id']){delete _0x1766d1[_0x024b('0x56')]['id'];}return db['OpenchannelAccount'][_0x024b('0x54')]({'where':{'id':_0x1766d1['params']['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0xf17467,null))[_0x024b('0x2f')](function(_0x214a49){if(_0x214a49){_0x1766d1[_0x024b('0x56')][_0x024b('0x60')]=_0x214a49['id'];return db[_0x024b('0x61')]['create'](_0x1766d1[_0x024b('0x56')]);}})[_0x024b('0x2f')](respondWithResult(_0xf17467,null))[_0x024b('0x23')](handleError(_0xf17467,null));};exports[_0x024b('0x62')]=function(_0x34479d,_0x4516f3,_0x9a50b6){var _0x5ad8a0={'raw':![],'where':{}};var _0x54a85e={};var _0x1495e9={'count':0x0,'rows':[]};return db[_0x024b('0x38')][_0x024b('0x63')]({'where':{'id':_0x34479d['params']['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x4516f3,null))[_0x024b('0x2f')](function(_0x583640){if(_0x583640){_0x54a85e['model']=_[_0x024b('0x40')](db[_0x024b('0x61')][_0x024b('0x39')]);_0x54a85e['query']=_['keys'](_0x34479d[_0x024b('0x3f')]);_0x54a85e[_0x024b('0x41')]=_[_0x024b('0x52')](_0x54a85e[_0x024b('0x3d')],_0x54a85e['query']);_0x5ad8a0[_0x024b('0x42')]=_[_0x024b('0x52')](_0x54a85e['model'],qs[_0x024b('0x43')](_0x34479d[_0x024b('0x3f')][_0x024b('0x43')]));_0x5ad8a0[_0x024b('0x42')]=_0x5ad8a0[_0x024b('0x42')][_0x024b('0x44')]?_0x5ad8a0['attributes']:_0x54a85e['model'];if(!_0x34479d[_0x024b('0x3f')][_0x024b('0x45')](_0x024b('0x46'))){_0x5ad8a0['limit']=qs[_0x024b('0x29')](_0x34479d[_0x024b('0x3f')][_0x024b('0x29')]);_0x5ad8a0[_0x024b('0x28')]=qs['offset'](_0x34479d[_0x024b('0x3f')][_0x024b('0x28')]);}_0x5ad8a0[_0x024b('0x47')]=qs[_0x024b('0x48')](_0x34479d[_0x024b('0x3f')][_0x024b('0x48')]);_0x5ad8a0[_0x024b('0x49')]=qs[_0x024b('0x41')](_[_0x024b('0x4a')](_0x34479d[_0x024b('0x3f')],_0x54a85e[_0x024b('0x41')]));_0x5ad8a0[_0x024b('0x49')][_0x024b('0x64')]=_0x583640['id'];if(_0x34479d[_0x024b('0x3f')][_0x024b('0x4b')]){_0x5ad8a0[_0x024b('0x49')]=_['merge'](_0x5ad8a0[_0x024b('0x49')],{'$or':_[_0x024b('0x3e')](_0x5ad8a0['attributes'],function(_0x150ab0){var _0x5b8b71={};_0x5b8b71[_0x150ab0]={'$like':'%'+_0x34479d[_0x024b('0x3f')]['filter']+'%'};return _0x5b8b71;})});}_0x5ad8a0=_[_0x024b('0x4c')]({},_0x5ad8a0,_0x34479d['options']);return db[_0x024b('0x61')][_0x024b('0x27')]({'where':_0x5ad8a0[_0x024b('0x49')]})[_0x024b('0x2f')](function(_0x1e1010){_0x1495e9['count']=_0x1e1010;if(_0x34479d[_0x024b('0x3f')][_0x024b('0x4d')]){_0x5ad8a0['include']=[{'all':!![]}];}return db[_0x024b('0x61')][_0x024b('0x4f')](_0x5ad8a0);})[_0x024b('0x2f')](function(_0x54665b){_0x1495e9[_0x024b('0x65')]=_0x54665b;return _0x1495e9;});}})[_0x024b('0x2f')](respondWithFilteredResult(_0x4516f3,_0x5ad8a0))[_0x024b('0x23')](handleError(_0x4516f3,null));};exports[_0x024b('0x66')]=function(_0x2d670d,_0x18db44,_0x420814){return db[_0x024b('0x38')][_0x024b('0x54')]({'where':{'id':_0x2d670d['params']['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x18db44,null))[_0x024b('0x2f')](function(_0x3991e6){if(_0x3991e6){return _0x3991e6[_0x024b('0x66')](_0x2d670d[_0x024b('0x3f')][_0x024b('0x67')]);}})[_0x024b('0x2f')](respondWithStatusCode(_0x18db44,null))[_0x024b('0x23')](handleError(_0x18db44,null));};exports[_0x024b('0x68')]=function(_0x4ea690,_0x30fb30,_0x1f11be){if(_0x4ea690['body']['id']){delete _0x4ea690[_0x024b('0x56')]['id'];}return db['OpenchannelAccount'][_0x024b('0x54')]({'where':{'id':_0x4ea690[_0x024b('0x5d')]['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x30fb30,null))[_0x024b('0x2f')](function(_0x2f8eb0){if(_0x2f8eb0){_0x4ea690['body']['OpenchannelAccountId']=_0x2f8eb0['id'];return db['CannedAnswer'][_0x024b('0x55')](_0x4ea690[_0x024b('0x56')]);}})['then'](respondWithResult(_0x30fb30,null))[_0x024b('0x23')](handleError(_0x30fb30,null));};exports['getAnswers']=function(_0x214d31,_0x169152,_0x13839f){var _0x29d14b={'raw':![],'where':{}};var _0x116b0f={};var _0xa0d761={'count':0x0,'rows':[]};return db[_0x024b('0x38')][_0x024b('0x63')]({'where':{'id':_0x214d31['params']['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x169152,null))[_0x024b('0x2f')](function(_0x3a2500){if(_0x3a2500){_0x116b0f[_0x024b('0x3d')]=_[_0x024b('0x40')](db[_0x024b('0x69')][_0x024b('0x39')]);_0x116b0f[_0x024b('0x3f')]=_[_0x024b('0x40')](_0x214d31[_0x024b('0x3f')]);_0x116b0f['filters']=_[_0x024b('0x52')](_0x116b0f[_0x024b('0x3d')],_0x116b0f[_0x024b('0x3f')]);_0x29d14b['attributes']=_['intersection'](_0x116b0f[_0x024b('0x3d')],qs[_0x024b('0x43')](_0x214d31[_0x024b('0x3f')][_0x024b('0x43')]));_0x29d14b['attributes']=_0x29d14b['attributes']['length']?_0x29d14b[_0x024b('0x42')]:_0x116b0f[_0x024b('0x3d')];if(!_0x214d31[_0x024b('0x3f')][_0x024b('0x45')](_0x024b('0x46'))){_0x29d14b['limit']=qs['limit'](_0x214d31[_0x024b('0x3f')][_0x024b('0x29')]);_0x29d14b[_0x024b('0x28')]=qs[_0x024b('0x28')](_0x214d31['query'][_0x024b('0x28')]);}_0x29d14b[_0x024b('0x47')]=qs[_0x024b('0x48')](_0x214d31[_0x024b('0x3f')][_0x024b('0x48')]);_0x29d14b[_0x024b('0x49')]=qs['filters'](_[_0x024b('0x4a')](_0x214d31[_0x024b('0x3f')],_0x116b0f[_0x024b('0x41')]));_0x29d14b[_0x024b('0x49')]['OpenchannelAccountId']=_0x3a2500['id'];if(_0x214d31[_0x024b('0x3f')][_0x024b('0x4b')]){_0x29d14b[_0x024b('0x49')]=_[_0x024b('0x4c')](_0x29d14b['where'],{'$or':_['map'](_0x29d14b[_0x024b('0x42')],function(_0xe0f795){var _0x358c5c={};_0x358c5c[_0xe0f795]={'$like':'%'+_0x214d31[_0x024b('0x3f')]['filter']+'%'};return _0x358c5c;})});}_0x29d14b=_[_0x024b('0x4c')]({},_0x29d14b,_0x214d31[_0x024b('0x53')]);return db[_0x024b('0x69')]['count']({'where':_0x29d14b[_0x024b('0x49')]})[_0x024b('0x2f')](function(_0x3fc84f){_0xa0d761[_0x024b('0x27')]=_0x3fc84f;if(_0x214d31[_0x024b('0x3f')][_0x024b('0x4d')]){_0x29d14b[_0x024b('0x4e')]=[{'all':!![]}];}return db[_0x024b('0x69')][_0x024b('0x4f')](_0x29d14b);})[_0x024b('0x2f')](function(_0x2a47d0){_0xa0d761[_0x024b('0x65')]=_0x2a47d0;return _0xa0d761;});}})[_0x024b('0x2f')](respondWithFilteredResult(_0x169152,_0x29d14b))[_0x024b('0x23')](handleError(_0x169152,null));};exports[_0x024b('0x6a')]=function(_0x48da88,_0x44c5cc,_0x5cef0b){return db['OpenchannelAccount']['find']({'where':{'id':_0x48da88[_0x024b('0x5d')]['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x44c5cc,null))[_0x024b('0x2f')](function(_0x44b335){if(_0x44b335){return _0x44b335[_0x024b('0x6a')](_0x48da88['query'][_0x024b('0x67')]);}})[_0x024b('0x2f')](respondWithStatusCode(_0x44c5cc,null))[_0x024b('0x23')](handleError(_0x44c5cc,null));};exports['notify']=function(_0x51cf94,_0x52cc35,_0x11012f){var _0x54cbf3={'body':_0x51cf94['body'],'channel':_0x024b('0x6b')};var _0xd986d=[];var _0x1b6128=[];var _0x18446d={};var _0x3a95d7=![];return db[_0x024b('0x6c')][_0x024b('0x5e')]()[_0x024b('0x2f')](function(_0x32c086){if(!_0x32c086){throw new db[(_0x024b('0x1b'))][(_0x024b('0x1c'))](_0x024b('0x6d'));}_0xd986d=_[_0x024b('0x6e')](_['keys'](_0x32c086),[_0x024b('0x6f'),'updatedAt']);_0x1b6128=_['difference'](_[_0x024b('0x40')](_0x32c086),[_0x024b('0x6f'),_0x024b('0x70'),_0x024b('0x71'),'ListId']);if(_0x51cf94[_0x024b('0x56')]['id']){delete _0x51cf94[_0x024b('0x56')]['id'];}if(_[_0x024b('0x72')](_0x51cf94['body'][_0x024b('0x73')])){throw new db[(_0x024b('0x1b'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x024b('0x72')](_0x51cf94[_0x024b('0x56')][_0x024b('0x56')])||_0x51cf94[_0x024b('0x56')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x024b('0x72')](_0x51cf94[_0x024b('0x56')]['mapKey'])){throw new db[(_0x024b('0x1b'))][(_0x024b('0x1c'))](_0x024b('0x74')+_0x1b6128);}if(!_[_0x024b('0x75')](_0x1b6128,_0x51cf94[_0x024b('0x56')][_0x024b('0x76')])){throw new db[(_0x024b('0x1b'))][(_0x024b('0x1c'))](_0x024b('0x77')+_0x1b6128);}_0x18446d[_0x51cf94['body'][_0x024b('0x76')]]=_0x51cf94['body']['from'];})[_0x024b('0x2f')](function(){return db['OpenchannelAccount'][_0x024b('0x54')]({'where':{'id':_0x51cf94[_0x024b('0x5d')]['id']},'include':[{'model':db[_0x024b('0x78')],'as':_0x024b('0x79'),'include':[{'model':db[_0x024b('0x6c')],'as':'Contacts','where':_0x18446d,'limit':0x1,'order':[[_0x024b('0x70'),_0x024b('0x7a')]]}]},{'model':db['OpenchannelApplication'],'as':_0x024b('0x7b')}]});})[_0x024b('0x2f')](handleEntityNotFound(_0x52cc35,null))[_0x024b('0x2f')](function(_0x326478){if(_0x326478&&_0x326478[_0x024b('0x79')]){_0x54cbf3['account']=_0x326478;_0x54cbf3[_0x024b('0x7c')]=_0x326478[_0x024b('0x7b')];_0x54cbf3[_0x024b('0x7d')]=_0x326478[_0x024b('0x79')];_0x54cbf3[_0x024b('0x7c')]=_[_0x024b('0x7e')](_0x54cbf3['applications'],[_0x024b('0x7f')],['asc']);if(_0x54cbf3['account']['Applications']){delete _0x54cbf3[_0x024b('0x80')][_0x024b('0x7b')];}if(_0x54cbf3[_0x024b('0x80')][_0x024b('0x79')]&&_0x54cbf3[_0x024b('0x80')]['List'][_0x024b('0x81')]['length']){return _0x54cbf3[_0x024b('0x80')][_0x024b('0x79')][_0x024b('0x81')][0x0];}var _0x4de5ac=_[_0x024b('0x13')](_0x51cf94[_0x024b('0x56')],{'firstName':_0x51cf94['body'][_0x024b('0x73')],'ListId':_0x326478[_0x024b('0x82')]});_0x4de5ac[_0x51cf94['body'][_0x024b('0x76')]]=_0x51cf94[_0x024b('0x56')]['from'];return db[_0x024b('0x6c')][_0x024b('0x55')](_0x4de5ac,{'fields':_0xd986d,'raw':!![]});}})[_0x024b('0x2f')](handleEntityNotFound(_0x52cc35,null))['then'](function(_0x44e9c0){_0x54cbf3[_0x024b('0x83')]=_0x44e9c0;if(_0x44e9c0){var _0x4d1a51={'ContactId':_0x44e9c0['id'],'OpenchannelAccountId':_0x51cf94['params']['id'],'from':(_0x44e9c0[_0x024b('0x84')]||'')+'\x20'+(_0x44e9c0[_0x024b('0x85')]||'')};var _0x1fa1f8={'OpenchannelAccountId':_0x51cf94[_0x024b('0x5d')]['id'],'closed':![]};if(_0x51cf94[_0x024b('0x56')][_0x024b('0x86')]){_0x1fa1f8[_0x024b('0x86')]=_0x51cf94[_0x024b('0x56')][_0x024b('0x86')];return db[_0x024b('0x87')]['find']({'where':_0x1fa1f8})[_0x024b('0x2f')](function(_0x2dbe0c){if(_0x2dbe0c){return[_0x2dbe0c,![]];}_0x4d1a51[_0x024b('0x86')]=_0x51cf94[_0x024b('0x56')][_0x024b('0x86')];_0x4d1a51[_0x024b('0x88')]=_0x51cf94[_0x024b('0x56')][_0x024b('0x88')];return db[_0x024b('0x87')][_0x024b('0x55')](_0x4d1a51)[_0x024b('0x2f')](function(_0x58a7fa){return[_0x58a7fa,!![]];});});}else{_0x1fa1f8['threadId']=null;}_0x1fa1f8[_0x024b('0x89')]=_0x44e9c0['id'];return db[_0x024b('0x87')][_0x024b('0x54')]({'where':_0x1fa1f8})[_0x024b('0x2f')](function(_0x29f167){if(_0x29f167){return[_0x29f167,![]];}return db['OpenchannelInteraction'][_0x024b('0x55')](_0x4d1a51)[_0x024b('0x2f')](function(_0x48bc7e){return[_0x48bc7e,!![]];});});}})[_0x024b('0x8a')](function(_0x481c24,_0x472a85){if(_0x481c24){_0x3a95d7=_0x472a85;if(!_0x472a85){var _0xdb9981={'from':(_0x54cbf3[_0x024b('0x83')]['firstName']||'')+'\x20'+(_0x54cbf3[_0x024b('0x83')][_0x024b('0x85')]||'')};if(_0x51cf94[_0x024b('0x56')][_0x024b('0x86')]&&_0x51cf94['body'][_0x024b('0x8b')]&&_0x51cf94[_0x024b('0x56')][_0x024b('0x86')]!=_0x51cf94[_0x024b('0x56')][_0x024b('0x8b')]){_0xdb9981[_0x024b('0x86')]=_0x51cf94[_0x024b('0x56')][_0x024b('0x8b')];}return _0x481c24[_0x024b('0x2e')](_0xdb9981);}else{return _0x481c24;}}})['then'](function(_0x1f6e5e){_0x54cbf3[_0x024b('0x8c')]=_0x1f6e5e[_0x024b('0x30')]({'plain':!![]});_0x54cbf3[_0x024b('0x8c')]['created']=_0x3a95d7;if(_0x54cbf3[_0x024b('0x8c')]['created']){if(_0x54cbf3[_0x024b('0x80')][_0x024b('0x8d')]){_0x54cbf3[_0x024b('0x7c')]['push']({'id':0x0,'priority':_0x54cbf3['applications'][_0x024b('0x44')]+0x1,'app':'close','appdata':_0x024b('0x8e'),'interval':_0x024b('0x8f')});}}return db['OpenchannelMessage'][_0x024b('0x55')]({'body':_0x51cf94[_0x024b('0x56')][_0x024b('0x56')],'OpenchannelAccountId':_0x51cf94[_0x024b('0x5d')]['id'],'OpenchannelInteractionId':_0x1f6e5e['id'],'direction':'in','ContactId':_0x54cbf3[_0x024b('0x83')]['id'],'AttachmentId':_0x51cf94[_0x024b('0x56')]['AttachmentId']});})['then'](function(_0x51ab22){_0x54cbf3['message']=_0x51ab22;if(_0x54cbf3[_0x024b('0x8c')]['UserId']){return db[_0x024b('0x90')][_0x024b('0x54')]({'attributes':['id','name'],'where':{'id':_0x54cbf3['interaction'][_0x024b('0x91')]}})[_0x024b('0x2f')](function(_0x1d59d6){if(_0x1d59d6){_0x54cbf3[_0x024b('0x7c')][_0x024b('0x92')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1d59d6[_0x024b('0x35')]+','+(_0x54cbf3[_0x024b('0x80')][_0x024b('0x93')]||0xa),'interval':_0x024b('0x8f')});_0x54cbf3[_0x024b('0x94')]=![];}return respondWithRpcPromise('Start',_0x024b('0x95'),_0x54cbf3);});}return respondWithRpcPromise(_0x024b('0x96'),_0x024b('0x95'),_0x54cbf3);})[_0x024b('0x2f')](function(_0x2d5d91){respondWithRpcPromise('EventManager',_0x024b('0x97'),{'event':_0x024b('0x98'),'message':_0x2d5d91},client9002);return _0x2d5d91;})['then'](respondWithResult(_0x52cc35,null))['catch'](handleError(_0x52cc35,null));};exports['addApplications']=function(_0xbdee71,_0x25f6ca,_0x547e27){return db[_0x024b('0x38')][_0x024b('0x63')]({'where':{'id':_0xbdee71['params']['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x25f6ca,null))[_0x024b('0x2f')](function(_0x599866){if(_0x599866){return db[_0x024b('0x99')]['transaction'](function(_0x8bb7aa){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0xbdee71[_0x024b('0x5d')]['id']},'transaction':_0x8bb7aa})['then'](function(_0x64acf0){var _0xb18f2=_['map'](_0xbdee71['body'],function(_0x55c785){_0x55c785[_0x024b('0x64')]=_0xbdee71['params']['id'];return _0x55c785;});return db[_0x024b('0x9a')]['bulkCreate'](_0xb18f2,{'transaction':_0x8bb7aa});});})[_0x024b('0x2f')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0xbdee71[_0x024b('0x5d')]['id']},'order':_0x024b('0x7f')});});}})[_0x024b('0x2f')](respondWithResult(_0x25f6ca,null))['catch'](handleError(_0x25f6ca,null));};exports['getApplications']=function(_0x3b5908,_0x4b8dda,_0x54fd2){var _0xfaf713={};var _0x6d7fe1={};var _0x45a47e;var _0x43edd0;return db[_0x024b('0x38')][_0x024b('0x63')]({'where':{'id':_0x3b5908[_0x024b('0x5d')]['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x4b8dda,null))['then'](function(_0x5d1c65){if(_0x5d1c65){_0x45a47e=_0x5d1c65;_0x6d7fe1[_0x024b('0x3d')]=_[_0x024b('0x40')](db['OpenchannelApplication'][_0x024b('0x39')]);_0x6d7fe1[_0x024b('0x3f')]=_[_0x024b('0x40')](_0x3b5908[_0x024b('0x3f')]);_0x6d7fe1[_0x024b('0x41')]=_[_0x024b('0x52')](_0x6d7fe1[_0x024b('0x3d')],_0x6d7fe1['query']);_0xfaf713[_0x024b('0x42')]=_[_0x024b('0x52')](_0x6d7fe1[_0x024b('0x3d')],qs[_0x024b('0x43')](_0x3b5908[_0x024b('0x3f')][_0x024b('0x43')]));_0xfaf713[_0x024b('0x42')]=_0xfaf713[_0x024b('0x42')][_0x024b('0x44')]?_0xfaf713[_0x024b('0x42')]:_0x6d7fe1[_0x024b('0x3d')];_0xfaf713[_0x024b('0x47')]=qs['sort'](_0x3b5908[_0x024b('0x3f')][_0x024b('0x48')]);_0xfaf713[_0x024b('0x49')]=qs[_0x024b('0x41')](_['pick'](_0x3b5908['query'],_0x6d7fe1['filters']));if(_0x3b5908[_0x024b('0x3f')][_0x024b('0x4b')]){_0xfaf713[_0x024b('0x49')]=_[_0x024b('0x4c')](_0xfaf713[_0x024b('0x49')],{'$or':_[_0x024b('0x3e')](_0xfaf713['attributes'],function(_0x519029){var _0x55d5d7={};_0x55d5d7[_0x519029]={'$like':'%'+_0x3b5908[_0x024b('0x3f')]['filter']+'%'};return _0x55d5d7;})});}_0xfaf713=_[_0x024b('0x4c')]({},_0xfaf713,_0x3b5908[_0x024b('0x53')]);return _0x45a47e[_0x024b('0x9b')](_0xfaf713);}})['then'](function(_0x2ada43){if(_0x2ada43){_0x43edd0=_0x2ada43[_0x024b('0x44')];if(!_0x3b5908[_0x024b('0x3f')][_0x024b('0x45')](_0x024b('0x46'))){_0xfaf713['limit']=qs['limit'](_0x3b5908[_0x024b('0x3f')]['limit']);_0xfaf713[_0x024b('0x28')]=qs[_0x024b('0x28')](_0x3b5908[_0x024b('0x3f')]['offset']);}return _0x45a47e[_0x024b('0x9b')](_0xfaf713);}})[_0x024b('0x2f')](function(_0x506bd7){if(_0x506bd7){return _0x506bd7?{'count':_0x43edd0,'rows':_0x506bd7}:null;}})['then'](respondWithResult(_0x4b8dda,null))['catch'](handleError(_0x4b8dda,null));};exports[_0x024b('0x9c')]=function(_0x51e20e,_0x2bb4a5,_0x3d31fa){var _0x4ff43b={'raw':![],'where':{}};var _0x2716c9={};var _0x4a7d5b={'count':0x0,'rows':[]};return db[_0x024b('0x38')][_0x024b('0x63')]({'where':{'id':_0x51e20e[_0x024b('0x5d')]['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x2bb4a5,null))[_0x024b('0x2f')](function(_0x425cca){if(_0x425cca){_0x2716c9[_0x024b('0x3d')]=_['keys'](db[_0x024b('0x87')][_0x024b('0x39')]);_0x2716c9[_0x024b('0x3f')]=_[_0x024b('0x40')](_0x51e20e[_0x024b('0x3f')]);_0x2716c9[_0x024b('0x41')]=_[_0x024b('0x52')](_0x2716c9[_0x024b('0x3d')],_0x2716c9[_0x024b('0x3f')]);_0x4ff43b[_0x024b('0x42')]=_[_0x024b('0x52')](_0x2716c9[_0x024b('0x3d')],qs[_0x024b('0x43')](_0x51e20e[_0x024b('0x3f')][_0x024b('0x43')]));_0x4ff43b[_0x024b('0x42')]=_0x4ff43b[_0x024b('0x42')][_0x024b('0x44')]?_0x4ff43b[_0x024b('0x42')]:_0x2716c9[_0x024b('0x3d')];if(!_0x51e20e[_0x024b('0x3f')][_0x024b('0x45')]('nolimit')){_0x4ff43b[_0x024b('0x29')]=qs[_0x024b('0x29')](_0x51e20e[_0x024b('0x3f')]['limit']);_0x4ff43b['offset']=qs[_0x024b('0x28')](_0x51e20e['query'][_0x024b('0x28')]);}_0x4ff43b[_0x024b('0x47')]=qs['sort'](_0x51e20e[_0x024b('0x3f')]['sort']);_0x4ff43b[_0x024b('0x49')]=qs[_0x024b('0x41')](_[_0x024b('0x4a')](_0x51e20e[_0x024b('0x3f')],_0x2716c9[_0x024b('0x41')]));_0x4ff43b[_0x024b('0x49')][_0x024b('0x64')]=_0x425cca['id'];if(_0x51e20e[_0x024b('0x3f')][_0x024b('0x4b')]){_0x4ff43b[_0x024b('0x49')]=_[_0x024b('0x4c')](_0x4ff43b[_0x024b('0x49')],{'$or':_[_0x024b('0x3e')](_0x4ff43b[_0x024b('0x42')],function(_0x13e6b0){var _0x1efef4={};_0x1efef4[_0x13e6b0]={'$like':'%'+_0x51e20e['query'][_0x024b('0x4b')]+'%'};return _0x1efef4;})});}_0x4ff43b=_[_0x024b('0x4c')]({},_0x4ff43b,_0x51e20e[_0x024b('0x53')]);return db['OpenchannelInteraction']['count']({'where':_0x4ff43b[_0x024b('0x49')]})[_0x024b('0x2f')](function(_0x4d3ba9){_0x4a7d5b[_0x024b('0x27')]=_0x4d3ba9;if(_0x51e20e['query']['includeAll']){_0x4ff43b['include']=[{'model':db[_0x024b('0x6c')],'as':'Contact','required':![]},{'model':db[_0x024b('0x90')],'as':'Owner','attributes':['name',_0x024b('0x9d'),_0x024b('0x9e')],'required':![]},{'model':db[_0x024b('0x9f')],'as':_0x024b('0xa0'),'attributes':['id',_0x024b('0x35'),_0x024b('0xa1')],'where':_0x51e20e[_0x024b('0x3f')][_0x024b('0xa2')]?{'id':_0x51e20e['query']['tag']}:undefined,'required':_0x51e20e[_0x024b('0x3f')][_0x024b('0xa2')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x024b('0x4f')](_0x4ff43b);})[_0x024b('0x2f')](function(_0x5ca30b){_0x4a7d5b[_0x024b('0x65')]=_0x5ca30b;return _0x4a7d5b;});}})[_0x024b('0x2f')](respondWithFilteredResult(_0x2bb4a5,_0x4ff43b))['catch'](handleError(_0x2bb4a5,null));};exports[_0x024b('0xa3')]=function(_0x354320,_0x1a5694,_0x485c59){return db[_0x024b('0x38')][_0x024b('0x54')]({'where':{'id':_0x354320[_0x024b('0x5d')]['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x1a5694,null))[_0x024b('0x2f')](function(_0x29992c){if(_0x29992c){return _0x29992c['addAgents'](_0x354320[_0x024b('0x56')][_0x024b('0x67')],_[_0x024b('0xa4')](_0x354320[_0x024b('0x56')],[_0x024b('0x67'),'id'])||{})[_0x024b('0x8a')](function(_0x18e9b1){for(var _0x29271e=0x0;_0x29271e<_0x354320['body'][_0x024b('0x67')][_0x024b('0x44')];_0x29271e+=0x1){socket['emit'](_0x024b('0xa5'),{'UserId':_0x354320[_0x024b('0x56')][_0x024b('0x67')][_0x29271e],'OpenchannelAccountId':_0x354320[_0x024b('0x5d')]['id']});}return _0x18e9b1;});}})[_0x024b('0x2f')](respondWithResult(_0x1a5694,null))[_0x024b('0x23')](handleError(_0x1a5694,null));};exports[_0x024b('0xa6')]=function(_0x193028,_0x1733ba,_0x4e42df){return db['OpenchannelAccount'][_0x024b('0x54')]({'where':{'id':_0x193028[_0x024b('0x5d')]['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x1733ba,null))['then'](function(_0x2e7546){if(_0x2e7546){return _0x2e7546[_0x024b('0xa6')](_0x193028['query'][_0x024b('0x67')])[_0x024b('0x2f')](function(){if(_[_0x024b('0xa7')](_0x193028[_0x024b('0x3f')][_0x024b('0x67')])){for(var _0x993e0d=0x0;_0x993e0d<_0x193028[_0x024b('0x3f')][_0x024b('0x67')][_0x024b('0x44')];_0x993e0d+=0x1){socket[_0x024b('0xa8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x193028[_0x024b('0x3f')]['ids'][_0x993e0d]),'OpenchannelAccountId':Number(_0x193028[_0x024b('0x5d')]['id'])});}}else{socket['emit'](_0x024b('0xa9'),{'UserId':Number(_0x193028[_0x024b('0x3f')][_0x024b('0x67')]),'OpenchannelAccountId':Number(_0x193028[_0x024b('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1733ba,null))[_0x024b('0x23')](handleError(_0x1733ba,null));};exports[_0x024b('0xaa')]=function(_0x5bb537,_0x133805,_0x17e59b){var _0x507a07={};var _0x511faf={};var _0x298286;var _0x5b672d;return db[_0x024b('0x38')][_0x024b('0x63')]({'where':{'id':_0x5bb537['params']['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x133805,null))['then'](function(_0x3ba944){if(_0x3ba944){_0x298286=_0x3ba944;_0x511faf[_0x024b('0x3d')]=_[_0x024b('0x40')](db['User'][_0x024b('0x39')]);_0x511faf[_0x024b('0x3f')]=_[_0x024b('0x40')](_0x5bb537[_0x024b('0x3f')]);_0x511faf[_0x024b('0x41')]=_[_0x024b('0x52')](_0x511faf[_0x024b('0x3d')],_0x511faf[_0x024b('0x3f')]);_0x507a07['attributes']=_[_0x024b('0x52')](_0x511faf[_0x024b('0x3d')],qs[_0x024b('0x43')](_0x5bb537[_0x024b('0x3f')][_0x024b('0x43')]));_0x507a07[_0x024b('0x42')]=_0x507a07[_0x024b('0x42')][_0x024b('0x44')]?_0x507a07[_0x024b('0x42')]:_0x511faf[_0x024b('0x3d')];_0x507a07[_0x024b('0x47')]=qs[_0x024b('0x48')](_0x5bb537['query'][_0x024b('0x48')]);_0x507a07[_0x024b('0x49')]=qs[_0x024b('0x41')](_[_0x024b('0x4a')](_0x5bb537[_0x024b('0x3f')],_0x511faf['filters']));if(_0x5bb537['query'][_0x024b('0x4b')]){_0x507a07['where']=_[_0x024b('0x4c')](_0x507a07[_0x024b('0x49')],{'$or':_['map'](_0x507a07['attributes'],function(_0x11f20d){var _0x309ef9={};_0x309ef9[_0x11f20d]={'$like':'%'+_0x5bb537[_0x024b('0x3f')][_0x024b('0x4b')]+'%'};return _0x309ef9;})});}_0x507a07=_[_0x024b('0x4c')]({},_0x507a07,_0x5bb537[_0x024b('0x53')]);return _0x298286[_0x024b('0xaa')](_0x507a07);}})[_0x024b('0x2f')](function(_0x160ab6){if(_0x160ab6){_0x5b672d=_0x160ab6[_0x024b('0x44')];if(!_0x5bb537['query'][_0x024b('0x45')](_0x024b('0x46'))){_0x507a07[_0x024b('0x29')]=qs[_0x024b('0x29')](_0x5bb537[_0x024b('0x3f')]['limit']);_0x507a07[_0x024b('0x28')]=qs['offset'](_0x5bb537[_0x024b('0x3f')][_0x024b('0x28')]);}return _0x298286[_0x024b('0xaa')](_0x507a07);}})[_0x024b('0x2f')](function(_0x4dba3a){if(_0x4dba3a){return _0x4dba3a?{'count':_0x5b672d,'rows':_0x4dba3a}:null;}})['then'](respondWithResult(_0x133805,null))[_0x024b('0x23')](handleError(_0x133805,null));};exports[_0x024b('0xab')]=function(_0x4b85cd,_0x34a060,_0x2ba7b9){var _0x8328ac,_0x2b13f9,_0x438291;if(_['isNil'](_0x4b85cd[_0x024b('0x56')]['body'])||_0x4b85cd[_0x024b('0x56')][_0x024b('0x56')]===''){throw new db[(_0x024b('0x1b'))][(_0x024b('0x1c'))](_0x024b('0xac'));}if(_[_0x024b('0x72')](_0x4b85cd[_0x024b('0x56')]['to'])){}_0x8328ac=_0x4b85cd['body']['to'];return db['OpenchannelAccount'][_0x024b('0x63')]({'where':{'id':_0x4b85cd[_0x024b('0x5d')]['id']}})[_0x024b('0x2f')](handleEntityNotFound(_0x34a060,null))[_0x024b('0x2f')](function(_0x593be5){if(_0x593be5){return db[_0x024b('0x38')][_0x024b('0x54')]({'where':{'id':_0x593be5['id']},'include':[{'model':db[_0x024b('0x78')],'as':'List','include':[{'model':db[_0x024b('0x6c')],'as':'Contacts','where':{[_0x593be5[_0x024b('0x76')]]:_0x8328ac},'limit':0x1,'order':[['updatedAt',_0x024b('0x7a')]]}]}]})[_0x024b('0x2f')](handleEntityNotFound(_0x34a060,null))[_0x024b('0x2f')](function(_0x159fb6){if(_0x159fb6&&_0x159fb6[_0x024b('0x79')]){_0x2b13f9=_0x159fb6[_0x024b('0x30')]({'plain':!![]});if(_0x2b13f9[_0x024b('0x79')]&&_0x2b13f9['List'][_0x024b('0x81')]['length']){return _0x2b13f9[_0x024b('0x79')][_0x024b('0x81')][0x0];}return db[_0x024b('0x6c')][_0x024b('0x55')](_[_0x024b('0x13')](_0x4b85cd[_0x024b('0x56')],{'firstName':_0x8328ac,[_0x159fb6[_0x024b('0x76')]]:_0x8328ac,'phone':_0x8328ac,'ListId':_0x2b13f9[_0x024b('0x82')]}));}})[_0x024b('0x2f')](handleEntityNotFound(_0x34a060,null))[_0x024b('0x2f')](function(_0x29f475){if(_0x29f475){_0x438291=_0x29f475;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x438291['id'],'closed':![],'OpenchannelAccountId':_0x2b13f9['id']}})[_0x024b('0x2f')](function(_0x265998){if(_0x265998){return[_0x265998,![]];}return db[_0x024b('0x87')][_0x024b('0x55')]({'UserId':_0x4b85cd[_0x024b('0x59')]['id'],'ContactId':_0x438291['id'],'OpenchannelAccountId':_0x2b13f9['id'],'lastMsgDirection':_0x024b('0xad'),'Messages':[_['merge'](_0x4b85cd['body'],{'read':![],'body':_0x4b85cd['body'][_0x024b('0x56')],'OpenchannelAccountId':_0x2b13f9['id'],'UserId':_0x4b85cd[_0x024b('0x59')]['id'],'ContactId':_0x438291['id']})]},{'include':[{'model':db[_0x024b('0xae')],'as':'Messages'}]})[_0x024b('0x2f')](function(_0x3c7556){return[_0x3c7556,!![]];});});}})[_0x024b('0x8a')](function(_0x14381f,_0x27045f){if(_0x27045f){return _0x14381f;}return db[_0x024b('0xae')]['create'](_[_0x024b('0x4c')](_0x4b85cd[_0x024b('0x56')],{'read':![],'body':_0x4b85cd[_0x024b('0x56')][_0x024b('0x56')],'OpenchannelAccountId':_0x2b13f9['id'],'OpenchannelInteractionId':_0x14381f['id'],'UserId':_0x4b85cd[_0x024b('0x59')]['id'],'ContactId':_0x438291['id']}))['then'](function(_0x5eca48){_0x14381f[_0x024b('0xaf')][_0x024b('0xb0')]=[];_0x14381f[_0x024b('0xaf')][_0x024b('0xb0')][_0x024b('0xb1')](_0x5eca48[_0x024b('0xaf')]);return _0x14381f;});});}})['then'](respondWithResult(_0x34a060,null))['catch'](handleError(_0x34a060,null));};
\ No newline at end of file
+var _0xb93f=['emit','userOpenchannelAccount:remove','getAgents','DESC','out','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','end','count','offset','limit','set','apply','reject','save','UserProfileResource','destroy','stack','send','Pause','OpenchannelAccount','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','name','filter','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','OpnechannelAccountId','getDispositions','findOne','Disposition','OpenchannelAccountId','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','priority','asc','ListId','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','User','unshift','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','tag','omit','ids','spread','userOpenchannelAccount:save','removeAgents','isArray'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xb93f,0xc4));var _0xfb93=function(_0x1d4449,_0x495153){_0x1d4449=_0x1d4449-0x0;var _0x4dcde3=_0xb93f[_0x1d4449];return _0x4dcde3;};'use strict';var pdf=require(_0xfb93('0x0'));var emlformat=require(_0xfb93('0x1'));var rimraf=require(_0xfb93('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb93('0x3'));var rp=require(_0xfb93('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfb93('0x5'));var util=require(_0xfb93('0x6'));var path=require(_0xfb93('0x7'));var sox=require(_0xfb93('0x8'));var csv=require(_0xfb93('0x9'));var ejs=require(_0xfb93('0xa'));var fs=require('fs');var _=require(_0xfb93('0xb'));var squel=require(_0xfb93('0xc'));var crypto=require(_0xfb93('0xd'));var jsforce=require(_0xfb93('0xe'));var deskjs=require(_0xfb93('0xf'));var toCsv=require(_0xfb93('0x9'));var querystring=require(_0xfb93('0x10'));var Papa=require(_0xfb93('0x11'));var Redis=require(_0xfb93('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfb93('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb93('0x14'));var logger=require(_0xfb93('0x15'))(_0xfb93('0x16'));var utils=require(_0xfb93('0x17'));var config=require('../../config/environment');var db=require(_0xfb93('0x18'))['db'];config[_0xfb93('0x19')]=_[_0xfb93('0x1a')](config[_0xfb93('0x19')],{'host':_0xfb93('0x1b'),'port':0x18eb});var socket=require(_0xfb93('0x1c'))(new Redis(config[_0xfb93('0x19')]));require(_0xfb93('0x1d'))[_0xfb93('0x1e')](socket);var jayson=require(_0xfb93('0x1f'));var client=jayson[_0xfb93('0x20')][_0xfb93('0x21')]({'port':0x232c});var client9002=jayson[_0xfb93('0x20')][_0xfb93('0x21')]({'port':0x232a});function checkPasswordPattern(_0x379ca8,_0x59510f,_0x5b961c){if(_0x5b961c){var _0x2e0655=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e0655[_0xfb93('0x22')](_0x59510f)){return _0x379ca8;}else{throw new db['Sequelize'][(_0xfb93('0x23'))](_0xfb93('0x24'));}}else{return _0x379ca8;}}function respondWithRpcPromise(_0x81a562,_0x883ff3,_0x361ca9,_0x4f2741){return new BPromise(function(_0x4e4f82,_0x247660){var _0x4f5e3a=_0x4f2741||client;return _0x4f5e3a[_0xfb93('0x25')](_0x81a562,_0x361ca9)[_0xfb93('0x26')](function(_0x4cdcb8){logger['info'](_0xfb93('0x27'),_0x883ff3,_0xfb93('0x28'));logger['debug'](_0xfb93('0x29'),_0x883ff3,'request\x20sent',JSON['stringify'](_0x4cdcb8));if(_0x4cdcb8[_0xfb93('0x2a')]){if(_0x4cdcb8[_0xfb93('0x2a')][_0xfb93('0x2b')]===0x1f4){logger[_0xfb93('0x2a')](_0xfb93('0x27'),_0x883ff3,_0x4cdcb8[_0xfb93('0x2a')]['message']);return _0x247660(_0x4cdcb8[_0xfb93('0x2a')][_0xfb93('0x2c')]);}logger['error'](_0xfb93('0x27'),_0x883ff3,_0x4cdcb8[_0xfb93('0x2a')][_0xfb93('0x2c')]);return _0x4e4f82(_0x4cdcb8['error'][_0xfb93('0x2c')]);}else{logger[_0xfb93('0x2d')]('OpenchannelAccount,\x20%s,\x20%s',_0x883ff3,'request\x20sent');_0x4e4f82(_0x4cdcb8[_0xfb93('0x2e')]['message']);}})['catch'](function(_0x4af140){logger['error'](_0xfb93('0x27'),_0x883ff3,_0x4af140);_0x247660(_0x4af140);});});}function respondWithStatusCode(_0x417e61,_0x5098fc){_0x5098fc=_0x5098fc||0xcc;return function(_0x5bf81a){if(_0x5bf81a){return _0x417e61[_0xfb93('0x2f')](_0x5098fc);}return _0x417e61[_0xfb93('0x30')](_0x5098fc)[_0xfb93('0x31')]();};}function respondWithResult(_0x2ab27f,_0x45e656){_0x45e656=_0x45e656||0xc8;return function(_0xb62a2a){if(_0xb62a2a){return _0x2ab27f['status'](_0x45e656)['json'](_0xb62a2a);}};}function respondWithFilteredResult(_0x4417d6,_0x52b575){return function(_0x1ca721){if(_0x1ca721){var _0x336386=_0x1ca721[_0xfb93('0x32')],_0x5dc013=_0x52b575[_0xfb93('0x33')],_0x465530=_0x52b575[_0xfb93('0x33')]+_0x52b575[_0xfb93('0x34')],_0x1d5aa9;if(_0x465530>=_0x336386){_0x465530=_0x336386;_0x1d5aa9=0xc8;}else{_0x1d5aa9=0xce;}_0x4417d6[_0xfb93('0x30')](_0x1d5aa9);return _0x4417d6[_0xfb93('0x35')]('Content-Range',_0x5dc013+'-'+_0x465530+'/'+_0x336386)['json'](_0x1ca721);}return null;};}function patchUpdates(_0x168847){return function(_0x2d868d){try{jsonpatch[_0xfb93('0x36')](_0x2d868d,_0x168847,!![]);}catch(_0x10c7b3){return BPromise[_0xfb93('0x37')](_0x10c7b3);}return _0x2d868d[_0xfb93('0x38')]();};}function saveUpdates(_0x97959e,_0x2fe5b0){return function(_0x3e7599){if(_0x3e7599){return _0x3e7599['update'](_0x97959e)[_0xfb93('0x26')](function(_0x406d55){return _0x406d55;});}return null;};}function removeEntity(_0x4fe71a,_0x31c7bb){return function(_0x173c29){if(_0x173c29){return _0x173c29['destroy']()[_0xfb93('0x26')](function(){var _0x5e4e88=_0x173c29['get']({'plain':!![]});var _0x2bd7cf='OpenchannelAccounts';return db[_0xfb93('0x39')][_0xfb93('0x3a')]({'where':{'type':_0x2bd7cf,'resourceId':_0x5e4e88['id']}})[_0xfb93('0x26')](function(){return _0x173c29;});})[_0xfb93('0x26')](function(){_0x4fe71a[_0xfb93('0x30')](0xcc)[_0xfb93('0x31')]();});}};}function handleEntityNotFound(_0x115b88,_0x32742f){return function(_0x1af39b){if(!_0x1af39b){_0x115b88['sendStatus'](0x194);}return _0x1af39b;};}function handleError(_0x12987d,_0x29b356){_0x29b356=_0x29b356||0x1f4;return function(_0x5e10b6){logger[_0xfb93('0x2a')](_0x5e10b6[_0xfb93('0x3b')]);if(_0x5e10b6['name']){delete _0x5e10b6['name'];}_0x12987d[_0xfb93('0x30')](_0x29b356)[_0xfb93('0x3c')](_0x5e10b6);};}exports['index']=function(_0x11f6ce,_0x50dd9a){var _0x48aa05={'include':[{'model':db[_0xfb93('0x3d')],'as':'mandatoryDispositionPause'}]},_0x2033eb={},_0x4f79d6={'count':0x0,'rows':[]};var _0x81f45=_['map'](db[_0xfb93('0x3e')][_0xfb93('0x3f')],function(_0x26bde7){return{'name':_0x26bde7['fieldName'],'type':_0x26bde7[_0xfb93('0x40')][_0xfb93('0x41')]};});_0x2033eb[_0xfb93('0x42')]=_[_0xfb93('0x43')](_0x81f45,'name');_0x2033eb['query']=_[_0xfb93('0x44')](_0x11f6ce['query']);_0x2033eb[_0xfb93('0x45')]=_[_0xfb93('0x46')](_0x2033eb[_0xfb93('0x42')],_0x2033eb[_0xfb93('0x47')]);_0x48aa05[_0xfb93('0x48')]=_[_0xfb93('0x46')](_0x2033eb['model'],qs['fields'](_0x11f6ce[_0xfb93('0x47')][_0xfb93('0x49')]));_0x48aa05[_0xfb93('0x48')]=_0x48aa05[_0xfb93('0x48')][_0xfb93('0x4a')]?_0x48aa05[_0xfb93('0x48')]:_0x2033eb['model'];if(!_0x11f6ce['query'][_0xfb93('0x4b')]('nolimit')){_0x48aa05[_0xfb93('0x34')]=qs[_0xfb93('0x34')](_0x11f6ce[_0xfb93('0x47')]['limit']);_0x48aa05['offset']=qs['offset'](_0x11f6ce['query'][_0xfb93('0x33')]);}_0x48aa05[_0xfb93('0x4c')]=qs[_0xfb93('0x4d')](_0x11f6ce[_0xfb93('0x47')][_0xfb93('0x4d')]);_0x48aa05[_0xfb93('0x4e')]=qs[_0xfb93('0x45')](_[_0xfb93('0x4f')](_0x11f6ce[_0xfb93('0x47')],_0x2033eb[_0xfb93('0x45')]),_0x81f45);if(_0x11f6ce[_0xfb93('0x47')]['filter']){_0x48aa05[_0xfb93('0x4e')]=_[_0xfb93('0x50')](_0x48aa05[_0xfb93('0x4e')],{'$or':_['map'](_0x81f45,function(_0x290c58){if(_0x290c58[_0xfb93('0x40')]!=='VIRTUAL'){var _0x2be554={};_0x2be554[_0x290c58[_0xfb93('0x51')]]={'$like':'%'+_0x11f6ce[_0xfb93('0x47')][_0xfb93('0x52')]+'%'};return _0x2be554;}})});}_0x48aa05=_['merge']({},_0x48aa05,_0x11f6ce[_0xfb93('0x53')]);var _0x191c89={'where':_0x48aa05[_0xfb93('0x4e')]};return db['OpenchannelAccount'][_0xfb93('0x32')](_0x191c89)['then'](function(_0x1acc17){_0x4f79d6[_0xfb93('0x32')]=_0x1acc17;if(_0x11f6ce['query'][_0xfb93('0x54')]){_0x48aa05[_0xfb93('0x55')]=[{'all':!![]}];}return db[_0xfb93('0x3e')][_0xfb93('0x56')](_0x48aa05);})['then'](function(_0x41c7fa){_0x4f79d6['rows']=_0x41c7fa;return _0x4f79d6;})[_0xfb93('0x26')](respondWithFilteredResult(_0x50dd9a,_0x48aa05))[_0xfb93('0x57')](handleError(_0x50dd9a,null));};exports[_0xfb93('0x58')]=function(_0x17f3bf,_0x28e66e){var _0x140f22={'raw':![],'where':{'id':_0x17f3bf[_0xfb93('0x59')]['id']},'include':[{'model':db[_0xfb93('0x3d')],'as':_0xfb93('0x5a')}]},_0x118131={};_0x118131[_0xfb93('0x42')]=_['keys'](db['OpenchannelAccount']['rawAttributes']);_0x118131['query']=_[_0xfb93('0x44')](_0x17f3bf[_0xfb93('0x47')]);_0x118131[_0xfb93('0x45')]=_[_0xfb93('0x46')](_0x118131['model'],_0x118131[_0xfb93('0x47')]);_0x140f22[_0xfb93('0x48')]=_[_0xfb93('0x46')](_0x118131['model'],qs[_0xfb93('0x49')](_0x17f3bf['query'][_0xfb93('0x49')]));_0x140f22['attributes']=_0x140f22[_0xfb93('0x48')][_0xfb93('0x4a')]?_0x140f22[_0xfb93('0x48')]:_0x118131[_0xfb93('0x42')];if(_0x17f3bf['query']['includeAll']){_0x140f22[_0xfb93('0x55')]=[{'all':!![]}];}_0x140f22=_[_0xfb93('0x50')]({},_0x140f22,_0x17f3bf[_0xfb93('0x53')]);return db[_0xfb93('0x3e')]['find'](_0x140f22)['then'](handleEntityNotFound(_0x28e66e,null))[_0xfb93('0x26')](respondWithResult(_0x28e66e,null))['catch'](handleError(_0x28e66e,null));};exports[_0xfb93('0x5b')]=function(_0x367b5e,_0x55f373){return db[_0xfb93('0x3e')][_0xfb93('0x5b')](_0x367b5e['body'],{})[_0xfb93('0x26')](function(_0x77884e){var _0x29b3f3=_0x367b5e[_0xfb93('0x5c')][_0xfb93('0x5d')]({'plain':!![]});if(!_0x29b3f3)throw new Error(_0xfb93('0x5e'));if(_0x29b3f3[_0xfb93('0x5f')]===_0xfb93('0x5c')){var _0x2cd696=_0x77884e[_0xfb93('0x5d')]({'plain':!![]});var _0x57271b=_0xfb93('0x60');return db[_0xfb93('0x61')][_0xfb93('0x62')]({'where':{'name':_0x57271b,'userProfileId':_0x29b3f3[_0xfb93('0x63')]},'raw':!![]})[_0xfb93('0x26')](function(_0x7009f1){if(_0x7009f1&&_0x7009f1[_0xfb93('0x64')]===0x0){return db[_0xfb93('0x39')][_0xfb93('0x5b')]({'name':_0x2cd696[_0xfb93('0x51')],'resourceId':_0x2cd696['id'],'type':_0x7009f1[_0xfb93('0x51')],'sectionId':_0x7009f1['id']},{})[_0xfb93('0x26')](function(){return _0x77884e;});}else{return _0x77884e;}})[_0xfb93('0x57')](function(_0x487a2e){logger[_0xfb93('0x2a')](_0xfb93('0x65'),_0x487a2e);throw _0x487a2e;});}return _0x77884e;})[_0xfb93('0x26')](respondWithResult(_0x55f373,0xc9))[_0xfb93('0x57')](handleError(_0x55f373,null));};exports[_0xfb93('0x66')]=function(_0x3c92ca,_0x50ae72){if(_0x3c92ca[_0xfb93('0x67')]['id']){delete _0x3c92ca[_0xfb93('0x67')]['id'];}return db['OpenchannelAccount'][_0xfb93('0x62')]({'where':{'id':_0x3c92ca[_0xfb93('0x59')]['id']},'include':[{'model':db[_0xfb93('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x50ae72,null))['then'](saveUpdates(_0x3c92ca[_0xfb93('0x67')],null))[_0xfb93('0x26')](respondWithResult(_0x50ae72,null))[_0xfb93('0x57')](handleError(_0x50ae72,null));};exports[_0xfb93('0x3a')]=function(_0x54de86,_0x14ef1a){return db[_0xfb93('0x3e')][_0xfb93('0x62')]({'where':{'id':_0x54de86[_0xfb93('0x59')]['id']}})[_0xfb93('0x26')](handleEntityNotFound(_0x14ef1a,null))['then'](removeEntity(_0x14ef1a,null))['catch'](handleError(_0x14ef1a,null));};exports[_0xfb93('0x68')]=function(_0x2c5e20,_0x3071ae){return db[_0xfb93('0x3e')][_0xfb93('0x68')]()[_0xfb93('0x26')](respondWithResult(_0x3071ae,null))[_0xfb93('0x57')](handleError(_0x3071ae,null));};exports[_0xfb93('0x69')]=function(_0x4ff789,_0x281eb4,_0x1fee22){if(_0x4ff789['body']['id']){delete _0x4ff789[_0xfb93('0x67')]['id'];}return db[_0xfb93('0x3e')]['find']({'where':{'id':_0x4ff789['params']['id']}})['then'](handleEntityNotFound(_0x281eb4,null))[_0xfb93('0x26')](function(_0x408314){if(_0x408314){_0x4ff789[_0xfb93('0x67')][_0xfb93('0x6a')]=_0x408314['id'];return db['Disposition'][_0xfb93('0x5b')](_0x4ff789['body']);}})['then'](respondWithResult(_0x281eb4,null))[_0xfb93('0x57')](handleError(_0x281eb4,null));};exports[_0xfb93('0x6b')]=function(_0x676f29,_0x1823d1,_0x4f20cb){var _0x5e9fed={'raw':![],'where':{}};var _0x49d2c1={};var _0x5bcd38={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xfb93('0x6c')]({'where':{'id':_0x676f29[_0xfb93('0x59')]['id']}})['then'](handleEntityNotFound(_0x1823d1,null))[_0xfb93('0x26')](function(_0x135737){if(_0x135737){_0x49d2c1[_0xfb93('0x42')]=_[_0xfb93('0x44')](db[_0xfb93('0x6d')][_0xfb93('0x3f')]);_0x49d2c1['query']=_[_0xfb93('0x44')](_0x676f29[_0xfb93('0x47')]);_0x49d2c1[_0xfb93('0x45')]=_['intersection'](_0x49d2c1['model'],_0x49d2c1['query']);_0x5e9fed['attributes']=_[_0xfb93('0x46')](_0x49d2c1[_0xfb93('0x42')],qs['fields'](_0x676f29[_0xfb93('0x47')][_0xfb93('0x49')]));_0x5e9fed[_0xfb93('0x48')]=_0x5e9fed[_0xfb93('0x48')]['length']?_0x5e9fed[_0xfb93('0x48')]:_0x49d2c1[_0xfb93('0x42')];if(!_0x676f29[_0xfb93('0x47')][_0xfb93('0x4b')]('nolimit')){_0x5e9fed[_0xfb93('0x34')]=qs[_0xfb93('0x34')](_0x676f29[_0xfb93('0x47')]['limit']);_0x5e9fed[_0xfb93('0x33')]=qs['offset'](_0x676f29['query'][_0xfb93('0x33')]);}_0x5e9fed[_0xfb93('0x4c')]=qs[_0xfb93('0x4d')](_0x676f29[_0xfb93('0x47')]['sort']);_0x5e9fed[_0xfb93('0x4e')]=qs[_0xfb93('0x45')](_[_0xfb93('0x4f')](_0x676f29[_0xfb93('0x47')],_0x49d2c1[_0xfb93('0x45')]));_0x5e9fed[_0xfb93('0x4e')][_0xfb93('0x6e')]=_0x135737['id'];if(_0x676f29[_0xfb93('0x47')][_0xfb93('0x52')]){_0x5e9fed['where']=_[_0xfb93('0x50')](_0x5e9fed[_0xfb93('0x4e')],{'$or':_['map'](_0x5e9fed[_0xfb93('0x48')],function(_0x5cfa51){var _0x19a861={};_0x19a861[_0x5cfa51]={'$like':'%'+_0x676f29[_0xfb93('0x47')]['filter']+'%'};return _0x19a861;})});}_0x5e9fed=_['merge']({},_0x5e9fed,_0x676f29[_0xfb93('0x53')]);return db['Disposition'][_0xfb93('0x32')]({'where':_0x5e9fed[_0xfb93('0x4e')]})[_0xfb93('0x26')](function(_0x38ae50){_0x5bcd38[_0xfb93('0x32')]=_0x38ae50;if(_0x676f29[_0xfb93('0x47')][_0xfb93('0x54')]){_0x5e9fed[_0xfb93('0x55')]=[{'all':!![]}];}return db[_0xfb93('0x6d')][_0xfb93('0x56')](_0x5e9fed);})[_0xfb93('0x26')](function(_0x53467e){_0x5bcd38[_0xfb93('0x6f')]=_0x53467e;return _0x5bcd38;});}})['then'](respondWithFilteredResult(_0x1823d1,_0x5e9fed))[_0xfb93('0x57')](handleError(_0x1823d1,null));};exports[_0xfb93('0x70')]=function(_0x34ae02,_0x316c7e,_0x1767df){return db[_0xfb93('0x3e')]['find']({'where':{'id':_0x34ae02[_0xfb93('0x59')]['id']}})['then'](handleEntityNotFound(_0x316c7e,null))[_0xfb93('0x26')](function(_0xbe8be7){if(_0xbe8be7){return _0xbe8be7[_0xfb93('0x70')](_0x34ae02[_0xfb93('0x47')]['ids']);}})[_0xfb93('0x26')](respondWithStatusCode(_0x316c7e,null))['catch'](handleError(_0x316c7e,null));};exports[_0xfb93('0x71')]=function(_0x52494b,_0x29ce1f,_0x99c37d){if(_0x52494b[_0xfb93('0x67')]['id']){delete _0x52494b['body']['id'];}return db['OpenchannelAccount'][_0xfb93('0x62')]({'where':{'id':_0x52494b[_0xfb93('0x59')]['id']}})['then'](handleEntityNotFound(_0x29ce1f,null))[_0xfb93('0x26')](function(_0x411617){if(_0x411617){_0x52494b[_0xfb93('0x67')]['OpenchannelAccountId']=_0x411617['id'];return db[_0xfb93('0x72')][_0xfb93('0x5b')](_0x52494b['body']);}})['then'](respondWithResult(_0x29ce1f,null))[_0xfb93('0x57')](handleError(_0x29ce1f,null));};exports[_0xfb93('0x73')]=function(_0x125216,_0x313bae,_0x19ba46){var _0x258e01={'raw':![],'where':{}};var _0x3f3941={};var _0x8bbd2e={'count':0x0,'rows':[]};return db[_0xfb93('0x3e')][_0xfb93('0x6c')]({'where':{'id':_0x125216[_0xfb93('0x59')]['id']}})[_0xfb93('0x26')](handleEntityNotFound(_0x313bae,null))[_0xfb93('0x26')](function(_0x4e6930){if(_0x4e6930){_0x3f3941[_0xfb93('0x42')]=_['keys'](db[_0xfb93('0x72')]['rawAttributes']);_0x3f3941[_0xfb93('0x47')]=_[_0xfb93('0x44')](_0x125216[_0xfb93('0x47')]);_0x3f3941['filters']=_[_0xfb93('0x46')](_0x3f3941[_0xfb93('0x42')],_0x3f3941[_0xfb93('0x47')]);_0x258e01[_0xfb93('0x48')]=_[_0xfb93('0x46')](_0x3f3941['model'],qs['fields'](_0x125216['query'][_0xfb93('0x49')]));_0x258e01['attributes']=_0x258e01[_0xfb93('0x48')][_0xfb93('0x4a')]?_0x258e01[_0xfb93('0x48')]:_0x3f3941[_0xfb93('0x42')];if(!_0x125216[_0xfb93('0x47')][_0xfb93('0x4b')](_0xfb93('0x74'))){_0x258e01[_0xfb93('0x34')]=qs['limit'](_0x125216['query'][_0xfb93('0x34')]);_0x258e01['offset']=qs['offset'](_0x125216[_0xfb93('0x47')][_0xfb93('0x33')]);}_0x258e01[_0xfb93('0x4c')]=qs[_0xfb93('0x4d')](_0x125216[_0xfb93('0x47')][_0xfb93('0x4d')]);_0x258e01[_0xfb93('0x4e')]=qs['filters'](_[_0xfb93('0x4f')](_0x125216[_0xfb93('0x47')],_0x3f3941[_0xfb93('0x45')]));_0x258e01[_0xfb93('0x4e')][_0xfb93('0x6e')]=_0x4e6930['id'];if(_0x125216['query']['filter']){_0x258e01[_0xfb93('0x4e')]=_[_0xfb93('0x50')](_0x258e01[_0xfb93('0x4e')],{'$or':_[_0xfb93('0x43')](_0x258e01['attributes'],function(_0x23e6f6){var _0x2a2cfe={};_0x2a2cfe[_0x23e6f6]={'$like':'%'+_0x125216[_0xfb93('0x47')][_0xfb93('0x52')]+'%'};return _0x2a2cfe;})});}_0x258e01=_[_0xfb93('0x50')]({},_0x258e01,_0x125216[_0xfb93('0x53')]);return db[_0xfb93('0x72')][_0xfb93('0x32')]({'where':_0x258e01[_0xfb93('0x4e')]})['then'](function(_0x23b21f){_0x8bbd2e[_0xfb93('0x32')]=_0x23b21f;if(_0x125216[_0xfb93('0x47')][_0xfb93('0x54')]){_0x258e01[_0xfb93('0x55')]=[{'all':!![]}];}return db[_0xfb93('0x72')][_0xfb93('0x56')](_0x258e01);})[_0xfb93('0x26')](function(_0x496d74){_0x8bbd2e[_0xfb93('0x6f')]=_0x496d74;return _0x8bbd2e;});}})[_0xfb93('0x26')](respondWithFilteredResult(_0x313bae,_0x258e01))[_0xfb93('0x57')](handleError(_0x313bae,null));};exports[_0xfb93('0x75')]=function(_0xed7a8a,_0x37c244,_0x55f7ba){return db['OpenchannelAccount'][_0xfb93('0x62')]({'where':{'id':_0xed7a8a[_0xfb93('0x59')]['id']}})['then'](handleEntityNotFound(_0x37c244,null))[_0xfb93('0x26')](function(_0x549e51){if(_0x549e51){return _0x549e51[_0xfb93('0x75')](_0xed7a8a[_0xfb93('0x47')]['ids']);}})[_0xfb93('0x26')](respondWithStatusCode(_0x37c244,null))[_0xfb93('0x57')](handleError(_0x37c244,null));};exports[_0xfb93('0x76')]=function(_0x4ffc4f,_0x37dc39,_0x20aad4){var _0x3bfd86={'body':_0x4ffc4f[_0xfb93('0x67')],'channel':_0xfb93('0x77')};var _0x1e60d3=[];var _0x3e1a21=[];var _0x4413a1={};var _0x1fa181=![];return db[_0xfb93('0x78')][_0xfb93('0x68')]()[_0xfb93('0x26')](function(_0x1a5bce){if(!_0x1a5bce){throw new db[(_0xfb93('0x79'))][(_0xfb93('0x23'))](_0xfb93('0x7a'));}_0x1e60d3=_[_0xfb93('0x7b')](_[_0xfb93('0x44')](_0x1a5bce),[_0xfb93('0x7c'),_0xfb93('0x7d')]);_0x3e1a21=_['difference'](_[_0xfb93('0x44')](_0x1a5bce),['createdAt',_0xfb93('0x7d'),'CompanyId','ListId']);if(_0x4ffc4f[_0xfb93('0x67')]['id']){delete _0x4ffc4f[_0xfb93('0x67')]['id'];}if(_[_0xfb93('0x7e')](_0x4ffc4f[_0xfb93('0x67')]['from'])){throw new db[(_0xfb93('0x79'))][(_0xfb93('0x23'))](_0xfb93('0x7f'));}if(_[_0xfb93('0x7e')](_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x67')])||_0x4ffc4f[_0xfb93('0x67')]['body']===''){throw new db['Sequelize'][(_0xfb93('0x23'))](_0xfb93('0x80'));}if(_[_0xfb93('0x7e')](_0x4ffc4f[_0xfb93('0x67')]['mapKey'])){throw new db[(_0xfb93('0x79'))]['ValidationError'](_0xfb93('0x81')+_0x3e1a21);}if(!_[_0xfb93('0x82')](_0x3e1a21,_0x4ffc4f[_0xfb93('0x67')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xfb93('0x83')+_0x3e1a21);}_0x4413a1[_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x84')]]=_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x85')];})['then'](function(){return db[_0xfb93('0x3e')][_0xfb93('0x62')]({'where':{'id':_0x4ffc4f[_0xfb93('0x59')]['id']},'include':[{'model':db[_0xfb93('0x86')],'as':_0xfb93('0x87'),'include':[{'model':db[_0xfb93('0x78')],'as':_0xfb93('0x88'),'where':_0x4413a1,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfb93('0x89')],'as':_0xfb93('0x8a')}]});})['then'](handleEntityNotFound(_0x37dc39,null))[_0xfb93('0x26')](function(_0x34fbf6){if(_0x34fbf6&&_0x34fbf6[_0xfb93('0x87')]){_0x3bfd86[_0xfb93('0x8b')]=_0x34fbf6;_0x3bfd86[_0xfb93('0x8c')]=_0x34fbf6['Applications'];_0x3bfd86[_0xfb93('0x8d')]=_0x34fbf6[_0xfb93('0x87')];_0x3bfd86[_0xfb93('0x8c')]=_['orderBy'](_0x3bfd86[_0xfb93('0x8c')],[_0xfb93('0x8e')],[_0xfb93('0x8f')]);if(_0x3bfd86['account'][_0xfb93('0x8a')]){delete _0x3bfd86[_0xfb93('0x8b')][_0xfb93('0x8a')];}if(_0x3bfd86[_0xfb93('0x8b')][_0xfb93('0x87')]&&_0x3bfd86[_0xfb93('0x8b')]['List']['Contacts'][_0xfb93('0x4a')]){return _0x3bfd86[_0xfb93('0x8b')]['List'][_0xfb93('0x88')][0x0];}var _0xe8b58d=_[_0xfb93('0x1a')](_0x4ffc4f['body'],{'firstName':_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x85')],'ListId':_0x34fbf6[_0xfb93('0x90')]});_0xe8b58d[_0x4ffc4f[_0xfb93('0x67')]['mapKey']]=_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x85')];return db[_0xfb93('0x78')]['create'](_0xe8b58d,{'fields':_0x1e60d3,'raw':!![]});}})[_0xfb93('0x26')](handleEntityNotFound(_0x37dc39,null))[_0xfb93('0x26')](function(_0x4c8297){_0x3bfd86[_0xfb93('0x91')]=_0x4c8297;if(_0x4c8297){var _0x441f22={'ContactId':_0x4c8297['id'],'OpenchannelAccountId':_0x4ffc4f['params']['id'],'from':(_0x4c8297['firstName']||'')+'\x20'+(_0x4c8297[_0xfb93('0x92')]||'')};var _0x2d561c={'OpenchannelAccountId':_0x4ffc4f['params']['id'],'closed':![]};if(_0x4ffc4f['body'][_0xfb93('0x93')]){_0x2d561c[_0xfb93('0x93')]=_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x93')];return db[_0xfb93('0x94')][_0xfb93('0x62')]({'where':_0x2d561c})[_0xfb93('0x26')](function(_0x38081d){if(_0x38081d){return[_0x38081d,![]];}_0x441f22[_0xfb93('0x93')]=_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x93')];_0x441f22[_0xfb93('0x95')]=_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x95')];return db[_0xfb93('0x94')][_0xfb93('0x5b')](_0x441f22)[_0xfb93('0x26')](function(_0x2fead3){return[_0x2fead3,!![]];});});}else{_0x2d561c[_0xfb93('0x93')]=null;}_0x2d561c[_0xfb93('0x96')]=_0x4c8297['id'];return db[_0xfb93('0x94')]['find']({'where':_0x2d561c})[_0xfb93('0x26')](function(_0x1d1970){if(_0x1d1970){return[_0x1d1970,![]];}return db[_0xfb93('0x94')]['create'](_0x441f22)[_0xfb93('0x26')](function(_0x15a296){return[_0x15a296,!![]];});});}})['spread'](function(_0x6f6680,_0x59845f){if(_0x6f6680){_0x1fa181=_0x59845f;if(!_0x59845f){var _0xb90e7f={'from':(_0x3bfd86[_0xfb93('0x91')]['firstName']||'')+'\x20'+(_0x3bfd86[_0xfb93('0x91')][_0xfb93('0x92')]||'')};if(_0x4ffc4f[_0xfb93('0x67')]['threadId']&&_0x4ffc4f['body'][_0xfb93('0x97')]&&_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x93')]!=_0x4ffc4f[_0xfb93('0x67')]['messageId']){_0xb90e7f['threadId']=_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x97')];}return _0x6f6680[_0xfb93('0x66')](_0xb90e7f);}else{return _0x6f6680;}}})[_0xfb93('0x26')](function(_0x5047a0){_0x3bfd86['interaction']=_0x5047a0[_0xfb93('0x5d')]({'plain':!![]});_0x3bfd86[_0xfb93('0x98')]['created']=_0x1fa181;if(_0x3bfd86[_0xfb93('0x98')][_0xfb93('0x99')]){if(_0x3bfd86[_0xfb93('0x8b')][_0xfb93('0x9a')]){_0x3bfd86[_0xfb93('0x8c')][_0xfb93('0x9b')]({'id':0x0,'priority':_0x3bfd86[_0xfb93('0x8c')][_0xfb93('0x4a')]+0x1,'app':'close','appdata':_0xfb93('0x9c'),'interval':_0xfb93('0x9d')});}}return db['OpenchannelMessage']['create']({'body':_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x67')],'OpenchannelAccountId':_0x4ffc4f[_0xfb93('0x59')]['id'],'OpenchannelInteractionId':_0x5047a0['id'],'direction':'in','ContactId':_0x3bfd86['contact']['id'],'AttachmentId':_0x4ffc4f[_0xfb93('0x67')][_0xfb93('0x9e')]});})[_0xfb93('0x26')](function(_0xc20175){_0x3bfd86[_0xfb93('0x2c')]=_0xc20175;if(_0x3bfd86['interaction']['UserId']){return db[_0xfb93('0x9f')][_0xfb93('0x62')]({'attributes':['id',_0xfb93('0x51')],'where':{'id':_0x3bfd86['interaction']['UserId']}})[_0xfb93('0x26')](function(_0xe32304){if(_0xe32304){_0x3bfd86[_0xfb93('0x8c')][_0xfb93('0xa0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe32304['name']+','+(_0x3bfd86[_0xfb93('0x8b')]['waitForTheAssignedAgent']||0xa),'interval':_0xfb93('0x9d')});_0x3bfd86[_0xfb93('0xa1')]=![];}return respondWithRpcPromise(_0xfb93('0xa2'),'startRouting',_0x3bfd86);});}return respondWithRpcPromise(_0xfb93('0xa2'),_0xfb93('0xa3'),_0x3bfd86);})[_0xfb93('0x26')](function(_0x1ffa16){respondWithRpcPromise('EventManager',_0xfb93('0xa4'),{'event':_0xfb93('0x76'),'message':_0x1ffa16},client9002);return _0x1ffa16;})[_0xfb93('0x26')](respondWithResult(_0x37dc39,null))['catch'](handleError(_0x37dc39,null));};exports[_0xfb93('0xa5')]=function(_0x58ce13,_0x447409,_0x6c15d8){return db[_0xfb93('0x3e')]['findOne']({'where':{'id':_0x58ce13[_0xfb93('0x59')]['id']}})[_0xfb93('0x26')](handleEntityNotFound(_0x447409,null))['then'](function(_0x54f07b){if(_0x54f07b){return db[_0xfb93('0xa6')]['transaction'](function(_0x33f0b8){return db[_0xfb93('0x89')]['destroy']({'where':{'OpenchannelAccountId':_0x58ce13[_0xfb93('0x59')]['id']},'transaction':_0x33f0b8})[_0xfb93('0x26')](function(_0x4fe161){var _0x3c7e48=_[_0xfb93('0x43')](_0x58ce13[_0xfb93('0x67')],function(_0xca6885){_0xca6885[_0xfb93('0x6e')]=_0x58ce13[_0xfb93('0x59')]['id'];return _0xca6885;});return db['OpenchannelApplication'][_0xfb93('0xa7')](_0x3c7e48,{'transaction':_0x33f0b8});});})[_0xfb93('0x26')](function(){return db[_0xfb93('0x89')][_0xfb93('0xa8')]({'where':{'OpenchannelAccountId':_0x58ce13['params']['id']},'order':_0xfb93('0x8e')});});}})[_0xfb93('0x26')](respondWithResult(_0x447409,null))[_0xfb93('0x57')](handleError(_0x447409,null));};exports[_0xfb93('0xa9')]=function(_0x22b36b,_0x436935,_0x521340){var _0x45f1e8={};var _0x1f23cd={};var _0x284798;var _0x324ac6;return db[_0xfb93('0x3e')]['findOne']({'where':{'id':_0x22b36b[_0xfb93('0x59')]['id']}})[_0xfb93('0x26')](handleEntityNotFound(_0x436935,null))[_0xfb93('0x26')](function(_0x229dc1){if(_0x229dc1){_0x284798=_0x229dc1;_0x1f23cd['model']=_['keys'](db[_0xfb93('0x89')]['rawAttributes']);_0x1f23cd[_0xfb93('0x47')]=_['keys'](_0x22b36b[_0xfb93('0x47')]);_0x1f23cd[_0xfb93('0x45')]=_[_0xfb93('0x46')](_0x1f23cd[_0xfb93('0x42')],_0x1f23cd['query']);_0x45f1e8['attributes']=_[_0xfb93('0x46')](_0x1f23cd[_0xfb93('0x42')],qs[_0xfb93('0x49')](_0x22b36b[_0xfb93('0x47')]['fields']));_0x45f1e8['attributes']=_0x45f1e8[_0xfb93('0x48')][_0xfb93('0x4a')]?_0x45f1e8[_0xfb93('0x48')]:_0x1f23cd[_0xfb93('0x42')];_0x45f1e8[_0xfb93('0x4c')]=qs[_0xfb93('0x4d')](_0x22b36b['query']['sort']);_0x45f1e8[_0xfb93('0x4e')]=qs[_0xfb93('0x45')](_[_0xfb93('0x4f')](_0x22b36b[_0xfb93('0x47')],_0x1f23cd[_0xfb93('0x45')]));if(_0x22b36b[_0xfb93('0x47')][_0xfb93('0x52')]){_0x45f1e8[_0xfb93('0x4e')]=_[_0xfb93('0x50')](_0x45f1e8[_0xfb93('0x4e')],{'$or':_['map'](_0x45f1e8[_0xfb93('0x48')],function(_0x289120){var _0x5e8f8d={};_0x5e8f8d[_0x289120]={'$like':'%'+_0x22b36b[_0xfb93('0x47')]['filter']+'%'};return _0x5e8f8d;})});}_0x45f1e8=_[_0xfb93('0x50')]({},_0x45f1e8,_0x22b36b[_0xfb93('0x53')]);return _0x284798['getApplications'](_0x45f1e8);}})[_0xfb93('0x26')](function(_0x175869){if(_0x175869){_0x324ac6=_0x175869[_0xfb93('0x4a')];if(!_0x22b36b[_0xfb93('0x47')]['hasOwnProperty'](_0xfb93('0x74'))){_0x45f1e8[_0xfb93('0x34')]=qs[_0xfb93('0x34')](_0x22b36b[_0xfb93('0x47')]['limit']);_0x45f1e8[_0xfb93('0x33')]=qs[_0xfb93('0x33')](_0x22b36b[_0xfb93('0x47')][_0xfb93('0x33')]);}return _0x284798[_0xfb93('0xa9')](_0x45f1e8);}})[_0xfb93('0x26')](function(_0x2a6e33){if(_0x2a6e33){return _0x2a6e33?{'count':_0x324ac6,'rows':_0x2a6e33}:null;}})['then'](respondWithResult(_0x436935,null))['catch'](handleError(_0x436935,null));};exports['getInteractions']=function(_0x20d9ad,_0x35607c,_0x1cb07f){var _0x2911fd={'raw':![],'where':{}};var _0x18ba2d={};var _0x2a6bc1={'count':0x0,'rows':[]};return db[_0xfb93('0x3e')][_0xfb93('0x6c')]({'where':{'id':_0x20d9ad[_0xfb93('0x59')]['id']}})[_0xfb93('0x26')](handleEntityNotFound(_0x35607c,null))[_0xfb93('0x26')](function(_0x2da7b2){if(_0x2da7b2){_0x18ba2d['model']=_['keys'](db[_0xfb93('0x94')][_0xfb93('0x3f')]);_0x18ba2d[_0xfb93('0x47')]=_['keys'](_0x20d9ad[_0xfb93('0x47')]);_0x18ba2d['filters']=_[_0xfb93('0x46')](_0x18ba2d[_0xfb93('0x42')],_0x18ba2d[_0xfb93('0x47')]);_0x2911fd[_0xfb93('0x48')]=_[_0xfb93('0x46')](_0x18ba2d[_0xfb93('0x42')],qs[_0xfb93('0x49')](_0x20d9ad['query'][_0xfb93('0x49')]));_0x2911fd['attributes']=_0x2911fd[_0xfb93('0x48')][_0xfb93('0x4a')]?_0x2911fd[_0xfb93('0x48')]:_0x18ba2d[_0xfb93('0x42')];if(!_0x20d9ad[_0xfb93('0x47')][_0xfb93('0x4b')](_0xfb93('0x74'))){_0x2911fd[_0xfb93('0x34')]=qs[_0xfb93('0x34')](_0x20d9ad[_0xfb93('0x47')]['limit']);_0x2911fd['offset']=qs[_0xfb93('0x33')](_0x20d9ad[_0xfb93('0x47')][_0xfb93('0x33')]);}_0x2911fd['order']=qs[_0xfb93('0x4d')](_0x20d9ad[_0xfb93('0x47')]['sort']);_0x2911fd[_0xfb93('0x4e')]=qs[_0xfb93('0x45')](_[_0xfb93('0x4f')](_0x20d9ad[_0xfb93('0x47')],_0x18ba2d[_0xfb93('0x45')]));_0x2911fd[_0xfb93('0x4e')]['OpenchannelAccountId']=_0x2da7b2['id'];if(_0x20d9ad['query'][_0xfb93('0x52')]){_0x2911fd['where']=_[_0xfb93('0x50')](_0x2911fd['where'],{'$or':_[_0xfb93('0x43')](_0x2911fd[_0xfb93('0x48')],function(_0x64a47b){var _0x83b18={};_0x83b18[_0x64a47b]={'$like':'%'+_0x20d9ad[_0xfb93('0x47')][_0xfb93('0x52')]+'%'};return _0x83b18;})});}_0x2911fd=_['merge']({},_0x2911fd,_0x20d9ad[_0xfb93('0x53')]);return db[_0xfb93('0x94')]['count']({'where':_0x2911fd[_0xfb93('0x4e')]})['then'](function(_0x5d24db){_0x2a6bc1[_0xfb93('0x32')]=_0x5d24db;if(_0x20d9ad[_0xfb93('0x47')]['includeAll']){_0x2911fd[_0xfb93('0x55')]=[{'model':db['CmContact'],'as':_0xfb93('0xaa'),'required':![]},{'model':db[_0xfb93('0x9f')],'as':_0xfb93('0xab'),'attributes':[_0xfb93('0x51'),_0xfb93('0xac'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xfb93('0x51'),'color'],'where':_0x20d9ad[_0xfb93('0x47')][_0xfb93('0xad')]?{'id':_0x20d9ad[_0xfb93('0x47')]['tag']}:undefined,'required':_0x20d9ad[_0xfb93('0x47')][_0xfb93('0xad')]?!![]:![]}];}return db[_0xfb93('0x94')]['findAll'](_0x2911fd);})[_0xfb93('0x26')](function(_0xc2ad66){_0x2a6bc1[_0xfb93('0x6f')]=_0xc2ad66;return _0x2a6bc1;});}})[_0xfb93('0x26')](respondWithFilteredResult(_0x35607c,_0x2911fd))[_0xfb93('0x57')](handleError(_0x35607c,null));};exports['addAgents']=function(_0xb07332,_0x2ade97,_0x2356a8){return db[_0xfb93('0x3e')][_0xfb93('0x62')]({'where':{'id':_0xb07332['params']['id']}})[_0xfb93('0x26')](handleEntityNotFound(_0x2ade97,null))[_0xfb93('0x26')](function(_0x18b48c){if(_0x18b48c){return _0x18b48c['addAgents'](_0xb07332[_0xfb93('0x67')]['ids'],_[_0xfb93('0xae')](_0xb07332[_0xfb93('0x67')],[_0xfb93('0xaf'),'id'])||{})[_0xfb93('0xb0')](function(_0x4c01cd){for(var _0x5d9da6=0x0;_0x5d9da6<_0xb07332['body'][_0xfb93('0xaf')]['length'];_0x5d9da6+=0x1){socket['emit'](_0xfb93('0xb1'),{'UserId':_0xb07332[_0xfb93('0x67')]['ids'][_0x5d9da6],'OpenchannelAccountId':_0xb07332[_0xfb93('0x59')]['id']});}return _0x4c01cd;});}})[_0xfb93('0x26')](respondWithResult(_0x2ade97,null))[_0xfb93('0x57')](handleError(_0x2ade97,null));};exports[_0xfb93('0xb2')]=function(_0x2b28a6,_0x20e3e2,_0x1072e4){return db[_0xfb93('0x3e')][_0xfb93('0x62')]({'where':{'id':_0x2b28a6[_0xfb93('0x59')]['id']}})[_0xfb93('0x26')](handleEntityNotFound(_0x20e3e2,null))[_0xfb93('0x26')](function(_0x260ece){if(_0x260ece){return _0x260ece[_0xfb93('0xb2')](_0x2b28a6['query'][_0xfb93('0xaf')])[_0xfb93('0x26')](function(){if(_[_0xfb93('0xb3')](_0x2b28a6['query']['ids'])){for(var _0x5f11a3=0x0;_0x5f11a3<_0x2b28a6[_0xfb93('0x47')][_0xfb93('0xaf')][_0xfb93('0x4a')];_0x5f11a3+=0x1){socket[_0xfb93('0xb4')](_0xfb93('0xb5'),{'UserId':Number(_0x2b28a6[_0xfb93('0x47')][_0xfb93('0xaf')][_0x5f11a3]),'OpenchannelAccountId':Number(_0x2b28a6[_0xfb93('0x59')]['id'])});}}else{socket[_0xfb93('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2b28a6[_0xfb93('0x47')][_0xfb93('0xaf')]),'OpenchannelAccountId':Number(_0x2b28a6[_0xfb93('0x59')]['id'])});}});}})[_0xfb93('0x26')](respondWithStatusCode(_0x20e3e2,null))[_0xfb93('0x57')](handleError(_0x20e3e2,null));};exports[_0xfb93('0xb6')]=function(_0x3cb6a4,_0x1bd1eb,_0x2c396b){var _0xd37033={};var _0x48b816={};var _0x5f0e4f;var _0x7c9f8d;return db['OpenchannelAccount'][_0xfb93('0x6c')]({'where':{'id':_0x3cb6a4[_0xfb93('0x59')]['id']}})['then'](handleEntityNotFound(_0x1bd1eb,null))[_0xfb93('0x26')](function(_0xe7a610){if(_0xe7a610){_0x5f0e4f=_0xe7a610;_0x48b816['model']=_[_0xfb93('0x44')](db[_0xfb93('0x9f')][_0xfb93('0x3f')]);_0x48b816[_0xfb93('0x47')]=_['keys'](_0x3cb6a4[_0xfb93('0x47')]);_0x48b816[_0xfb93('0x45')]=_[_0xfb93('0x46')](_0x48b816[_0xfb93('0x42')],_0x48b816[_0xfb93('0x47')]);_0xd37033[_0xfb93('0x48')]=_[_0xfb93('0x46')](_0x48b816[_0xfb93('0x42')],qs[_0xfb93('0x49')](_0x3cb6a4[_0xfb93('0x47')][_0xfb93('0x49')]));_0xd37033[_0xfb93('0x48')]=_0xd37033[_0xfb93('0x48')][_0xfb93('0x4a')]?_0xd37033['attributes']:_0x48b816['model'];_0xd37033[_0xfb93('0x4c')]=qs[_0xfb93('0x4d')](_0x3cb6a4[_0xfb93('0x47')][_0xfb93('0x4d')]);_0xd37033[_0xfb93('0x4e')]=qs['filters'](_['pick'](_0x3cb6a4[_0xfb93('0x47')],_0x48b816['filters']));if(_0x3cb6a4[_0xfb93('0x47')][_0xfb93('0x52')]){_0xd37033['where']=_[_0xfb93('0x50')](_0xd37033[_0xfb93('0x4e')],{'$or':_[_0xfb93('0x43')](_0xd37033[_0xfb93('0x48')],function(_0xe16dc9){var _0x4ffd01={};_0x4ffd01[_0xe16dc9]={'$like':'%'+_0x3cb6a4[_0xfb93('0x47')][_0xfb93('0x52')]+'%'};return _0x4ffd01;})});}_0xd37033=_['merge']({},_0xd37033,_0x3cb6a4[_0xfb93('0x53')]);return _0x5f0e4f[_0xfb93('0xb6')](_0xd37033);}})['then'](function(_0x15b243){if(_0x15b243){_0x7c9f8d=_0x15b243[_0xfb93('0x4a')];if(!_0x3cb6a4[_0xfb93('0x47')][_0xfb93('0x4b')](_0xfb93('0x74'))){_0xd37033['limit']=qs[_0xfb93('0x34')](_0x3cb6a4[_0xfb93('0x47')][_0xfb93('0x34')]);_0xd37033[_0xfb93('0x33')]=qs[_0xfb93('0x33')](_0x3cb6a4['query'][_0xfb93('0x33')]);}return _0x5f0e4f[_0xfb93('0xb6')](_0xd37033);}})[_0xfb93('0x26')](function(_0x4176fa){if(_0x4176fa){return _0x4176fa?{'count':_0x7c9f8d,'rows':_0x4176fa}:null;}})['then'](respondWithResult(_0x1bd1eb,null))[_0xfb93('0x57')](handleError(_0x1bd1eb,null));};exports['send']=function(_0x44ee92,_0x57aadf,_0x24335b){var _0x31dead,_0x35975b,_0x3f9c6c;if(_[_0xfb93('0x7e')](_0x44ee92[_0xfb93('0x67')][_0xfb93('0x67')])||_0x44ee92[_0xfb93('0x67')][_0xfb93('0x67')]===''){throw new db['Sequelize'][(_0xfb93('0x23'))](_0xfb93('0x80'));}if(_['isNil'](_0x44ee92['body']['to'])){}_0x31dead=_0x44ee92['body']['to'];return db[_0xfb93('0x3e')][_0xfb93('0x6c')]({'where':{'id':_0x44ee92[_0xfb93('0x59')]['id']}})[_0xfb93('0x26')](handleEntityNotFound(_0x57aadf,null))[_0xfb93('0x26')](function(_0xda419d){if(_0xda419d){return db['OpenchannelAccount'][_0xfb93('0x62')]({'where':{'id':_0xda419d['id']},'include':[{'model':db[_0xfb93('0x86')],'as':_0xfb93('0x87'),'include':[{'model':db[_0xfb93('0x78')],'as':_0xfb93('0x88'),'where':{[_0xda419d[_0xfb93('0x84')]]:_0x31dead},'limit':0x1,'order':[[_0xfb93('0x7d'),_0xfb93('0xb7')]]}]}]})[_0xfb93('0x26')](handleEntityNotFound(_0x57aadf,null))[_0xfb93('0x26')](function(_0x47fea4){if(_0x47fea4&&_0x47fea4[_0xfb93('0x87')]){_0x35975b=_0x47fea4['get']({'plain':!![]});if(_0x35975b[_0xfb93('0x87')]&&_0x35975b[_0xfb93('0x87')][_0xfb93('0x88')]['length']){return _0x35975b['List'][_0xfb93('0x88')][0x0];}return db[_0xfb93('0x78')][_0xfb93('0x5b')](_[_0xfb93('0x1a')](_0x44ee92['body'],{'firstName':_0x31dead,[_0x47fea4[_0xfb93('0x84')]]:_0x31dead,'phone':_0x31dead,'ListId':_0x35975b[_0xfb93('0x90')]}));}})[_0xfb93('0x26')](handleEntityNotFound(_0x57aadf,null))[_0xfb93('0x26')](function(_0x2726cb){if(_0x2726cb){_0x3f9c6c=_0x2726cb;return db[_0xfb93('0x94')][_0xfb93('0x62')]({'where':{'ContactId':_0x3f9c6c['id'],'closed':![],'OpenchannelAccountId':_0x35975b['id']}})['then'](function(_0x59b024){if(_0x59b024){return[_0x59b024,![]];}return db[_0xfb93('0x94')][_0xfb93('0x5b')]({'UserId':_0x44ee92[_0xfb93('0x5c')]['id'],'ContactId':_0x3f9c6c['id'],'OpenchannelAccountId':_0x35975b['id'],'lastMsgDirection':_0xfb93('0xb8'),'Messages':[_[_0xfb93('0x50')](_0x44ee92[_0xfb93('0x67')],{'read':![],'body':_0x44ee92[_0xfb93('0x67')][_0xfb93('0x67')],'OpenchannelAccountId':_0x35975b['id'],'UserId':_0x44ee92[_0xfb93('0x5c')]['id'],'ContactId':_0x3f9c6c['id']})]},{'include':[{'model':db[_0xfb93('0xb9')],'as':_0xfb93('0xba')}]})['then'](function(_0x19c736){return[_0x19c736,!![]];});});}})[_0xfb93('0xb0')](function(_0x54bb44,_0x13dc08){if(_0x13dc08){return _0x54bb44;}return db[_0xfb93('0xb9')][_0xfb93('0x5b')](_['merge'](_0x44ee92[_0xfb93('0x67')],{'read':![],'body':_0x44ee92['body'][_0xfb93('0x67')],'OpenchannelAccountId':_0x35975b['id'],'OpenchannelInteractionId':_0x54bb44['id'],'UserId':_0x44ee92['user']['id'],'ContactId':_0x3f9c6c['id']}))[_0xfb93('0x26')](function(_0x120df1){_0x54bb44['dataValues'][_0xfb93('0xba')]=[];_0x54bb44[_0xfb93('0xbb')]['Messages'][_0xfb93('0x9b')](_0x120df1[_0xfb93('0xbb')]);return _0x54bb44;});});}})['then'](respondWithResult(_0x57aadf,null))[_0xfb93('0x57')](handleError(_0x57aadf,null));};
\ No newline at end of file
index 76e8464..ab0723e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x764c=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4029c2,_0x36e533){var _0xa727fc=function(_0x4e3a8c){while(--_0x4e3a8c){_0x4029c2['push'](_0x4029c2['shift']());}};_0xa727fc(++_0x36e533);}(_0x764c,0xcc));var _0xc764=function(_0x68f9ff,_0x3a572f){_0x68f9ff=_0x68f9ff-0x0;var _0x4dd14f=_0x764c[_0x68f9ff];return _0x4dd14f;};'use strict';var EventEmitter=require(_0xc764('0x0'));var OpenchannelAccount=require(_0xc764('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xc764('0x2')](0x0);var events={'afterCreate':_0xc764('0x3'),'afterUpdate':_0xc764('0x4'),'afterDestroy':_0xc764('0x5')};function emitEvent(_0x22b023){return function(_0x2fa502,_0x456283,_0x1fda0e){OpenchannelAccountEvents[_0xc764('0x6')](_0x22b023+':'+_0x2fa502['id'],_0x2fa502);OpenchannelAccountEvents[_0xc764('0x6')](_0x22b023,_0x2fa502);_0x1fda0e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc764('0x7')](e,emitEvent(event));}}module[_0xc764('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xff59=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x2f13ce,_0xed6276){var _0x582e91=function(_0x58c71a){while(--_0x58c71a){_0x2f13ce['push'](_0x2f13ce['shift']());}};_0x582e91(++_0xed6276);}(_0xff59,0x128));var _0x9ff5=function(_0x312baa,_0x3cf768){_0x312baa=_0x312baa-0x0;var _0x2b0679=_0xff59[_0x312baa];return _0x2b0679;};'use strict';var EventEmitter=require(_0x9ff5('0x0'));var OpenchannelAccount=require(_0x9ff5('0x1'))['db'][_0x9ff5('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9ff5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9ff5('0x4'),'afterDestroy':_0x9ff5('0x5')};function emitEvent(_0xf73fd7){return function(_0x2fcab7,_0xad7257,_0x9c0846){OpenchannelAccountEvents['emit'](_0xf73fd7+':'+_0x2fcab7['id'],_0x2fcab7);OpenchannelAccountEvents['emit'](_0xf73fd7,_0x2fcab7);_0x9c0846(null);};}for(var e in events){if(events[_0x9ff5('0x6')](e)){var event=events[e];OpenchannelAccount[_0x9ff5('0x7')](e,emitEvent(event));}}module[_0x9ff5('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
index afea09c..6c22516 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2d0=['../../config/environment','./openchannelAccount.attributes','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2d0,0x9f));var _0x0c2d=function(_0x330d1f,_0x47c710){_0x330d1f=_0x330d1f-0x0;var _0x1df784=_0xc2d0[_0x330d1f];return _0x1df784;};'use strict';var _=require(_0x0c2d('0x0'));var util=require(_0x0c2d('0x1'));var logger=require(_0x0c2d('0x2'))(_0x0c2d('0x3'));var moment=require(_0x0c2d('0x4'));var BPromise=require(_0x0c2d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0c2d('0x6'));var attributes=require(_0x0c2d('0x7'));module['exports']=function(_0x213d7c,_0x28a746){return _0x213d7c[_0x0c2d('0x8')](_0x0c2d('0x9'),attributes,{'tableName':_0x0c2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f38=['path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x526bc7,_0x48b2f4){var _0x4e01fe=function(_0x4472eb){while(--_0x4472eb){_0x526bc7['push'](_0x526bc7['shift']());}};_0x4e01fe(++_0x48b2f4);}(_0x3f38,0x1e4));var _0x83f3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3f38[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x83f3('0x0'));var util=require(_0x83f3('0x1'));var logger=require('../../config/logger')(_0x83f3('0x2'));var moment=require(_0x83f3('0x3'));var BPromise=require(_0x83f3('0x4'));var rp=require(_0x83f3('0x5'));var fs=require('fs');var path=require(_0x83f3('0x6'));var rimraf=require(_0x83f3('0x7'));var config=require(_0x83f3('0x8'));var attributes=require(_0x83f3('0x9'));module[_0x83f3('0xa')]=function(_0x458b39,_0x2bb8b6){return _0x458b39[_0x83f3('0xb')](_0x83f3('0xc'),attributes,{'tableName':_0x83f3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd35ceb..a3af6fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1c9=['error','code','message','info','result','OpenchannelAccount,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0xe1c9,0xca));var _0x9e1c=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xe1c9[_0x41582d];return _0x59c504;};'use strict';var _=require(_0x9e1c('0x0'));var util=require('util');var moment=require(_0x9e1c('0x1'));var BPromise=require(_0x9e1c('0x2'));var rs=require(_0x9e1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e1c('0x4'))['db'];var utils=require(_0x9e1c('0x5'));var logger=require(_0x9e1c('0x6'))('rpc');var config=require(_0x9e1c('0x7'));var jayson=require(_0x9e1c('0x8'));var client=jayson['client'][_0x9e1c('0x9')]({'port':0x232a});config[_0x9e1c('0xa')]=_[_0x9e1c('0xb')](config[_0x9e1c('0xa')],{'host':_0x9e1c('0xc'),'port':0x18eb});var socket=require(_0x9e1c('0xd'))(new Redis(config[_0x9e1c('0xa')]));require(_0x9e1c('0xe'))[_0x9e1c('0xf')](socket);function respondWithRpcPromise(_0x3ff4e0,_0x4dceca,_0x551583){return new BPromise(function(_0x10fb6a,_0x1d3dd7){return client[_0x9e1c('0x10')](_0x3ff4e0,_0x551583)[_0x9e1c('0x11')](function(_0x170cc5){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4dceca,'request\x20sent');logger[_0x9e1c('0x12')](_0x9e1c('0x13'),_0x4dceca,_0x9e1c('0x14'),JSON[_0x9e1c('0x15')](_0x170cc5));if(_0x170cc5[_0x9e1c('0x16')]){if(_0x170cc5[_0x9e1c('0x16')][_0x9e1c('0x17')]===0x1f4){logger[_0x9e1c('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x4dceca,_0x170cc5[_0x9e1c('0x16')][_0x9e1c('0x18')]);return _0x1d3dd7(_0x170cc5[_0x9e1c('0x16')][_0x9e1c('0x18')]);}logger[_0x9e1c('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x4dceca,_0x170cc5[_0x9e1c('0x16')][_0x9e1c('0x18')]);return _0x10fb6a(_0x170cc5[_0x9e1c('0x16')][_0x9e1c('0x18')]);}else{logger[_0x9e1c('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x4dceca,'request\x20sent');_0x10fb6a(_0x170cc5[_0x9e1c('0x1a')][_0x9e1c('0x18')]);}})['catch'](function(_0x274b26){logger[_0x9e1c('0x16')](_0x9e1c('0x1b'),_0x4dceca,_0x274b26);_0x1d3dd7(_0x274b26);});});}
\ No newline at end of file
+var _0xd3b3=['request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x1caebc,_0x5abdfc){var _0x2b2ee1=function(_0x5e7ca6){while(--_0x5e7ca6){_0x1caebc['push'](_0x1caebc['shift']());}};_0x2b2ee1(++_0x5abdfc);}(_0xd3b3,0x199));var _0x3d3b=function(_0x208442,_0x11d2ba){_0x208442=_0x208442-0x0;var _0xd24f10=_0xd3b3[_0x208442];return _0xd24f10;};'use strict';var _=require(_0x3d3b('0x0'));var util=require(_0x3d3b('0x1'));var moment=require(_0x3d3b('0x2'));var BPromise=require(_0x3d3b('0x3'));var rs=require(_0x3d3b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d3b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3d3b('0x6'));var jayson=require(_0x3d3b('0x7'));var client=jayson[_0x3d3b('0x8')][_0x3d3b('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3d3b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d3b('0xb'))(new Redis(config[_0x3d3b('0xa')]));require('./openchannelAccount.socket')[_0x3d3b('0xc')](socket);function respondWithRpcPromise(_0x538cfa,_0x35feaa,_0x2654cd){return new BPromise(function(_0x284a6b,_0x315812){return client[_0x3d3b('0xd')](_0x538cfa,_0x2654cd)[_0x3d3b('0xe')](function(_0x405d40){logger['info'](_0x3d3b('0xf'),_0x35feaa,_0x3d3b('0x10'));logger[_0x3d3b('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x35feaa,_0x3d3b('0x10'),JSON[_0x3d3b('0x12')](_0x405d40));if(_0x405d40[_0x3d3b('0x13')]){if(_0x405d40[_0x3d3b('0x13')][_0x3d3b('0x14')]===0x1f4){logger['error'](_0x3d3b('0xf'),_0x35feaa,_0x405d40[_0x3d3b('0x13')][_0x3d3b('0x15')]);return _0x315812(_0x405d40['error'][_0x3d3b('0x15')]);}logger[_0x3d3b('0x13')](_0x3d3b('0xf'),_0x35feaa,_0x405d40[_0x3d3b('0x13')][_0x3d3b('0x15')]);return _0x284a6b(_0x405d40[_0x3d3b('0x13')][_0x3d3b('0x15')]);}else{logger[_0x3d3b('0x16')](_0x3d3b('0xf'),_0x35feaa,_0x3d3b('0x10'));_0x284a6b(_0x405d40[_0x3d3b('0x17')]['message']);}})[_0x3d3b('0x18')](function(_0x593c97){logger[_0x3d3b('0x13')](_0x3d3b('0xf'),_0x35feaa,_0x593c97);_0x315812(_0x593c97);});});}
\ No newline at end of file
index dee0704..3ac6335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33c6=['removeListener','register','./openchannelAccount.events','save','remove','update','emit'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0x33c6,0x14b));var _0x633c=function(_0x9c27f3,_0x1522c4){_0x9c27f3=_0x9c27f3-0x0;var _0x46c1b6=_0x33c6[_0x9c27f3];return _0x46c1b6;};'use strict';var OpenchannelAccountEvents=require(_0x633c('0x0'));var events=[_0x633c('0x1'),_0x633c('0x2'),_0x633c('0x3')];function createListener(_0x45ef36,_0x1d5bea){return function(_0x1271c4){_0x1d5bea[_0x633c('0x4')](_0x45ef36,_0x1271c4);};}function removeListener(_0xf14631,_0x5be839){return function(){OpenchannelAccountEvents[_0x633c('0x5')](_0xf14631,_0x5be839);};}exports[_0x633c('0x6')]=function(_0x391c0a){for(var _0x18bad5=0x0,_0x30b2c8=events['length'];_0x18bad5<_0x30b2c8;_0x18bad5++){var _0x1d6779=events[_0x18bad5];var _0x36e9e3=createListener('openchannelAccount:'+_0x1d6779,_0x391c0a);OpenchannelAccountEvents['on'](_0x1d6779,_0x36e9e3);}};
\ No newline at end of file
+var _0x1b9f=['remove','update','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x2a4dda,_0x394a1b){var _0xe725e=function(_0x5c005c){while(--_0x5c005c){_0x2a4dda['push'](_0x2a4dda['shift']());}};_0xe725e(++_0x394a1b);}(_0x1b9f,0x1da));var _0xf1b9=function(_0xd7f103,_0x28bcaa){_0xd7f103=_0xd7f103-0x0;var _0x4cb2be=_0x1b9f[_0xd7f103];return _0x4cb2be;};'use strict';var OpenchannelAccountEvents=require(_0xf1b9('0x0'));var events=[_0xf1b9('0x1'),_0xf1b9('0x2'),_0xf1b9('0x3')];function createListener(_0x125a7f,_0x3f4fc3){return function(_0x1ddbfd){_0x3f4fc3['emit'](_0x125a7f,_0x1ddbfd);};}function removeListener(_0x5040fa,_0x1a93a3){return function(){OpenchannelAccountEvents['removeListener'](_0x5040fa,_0x1a93a3);};}exports[_0xf1b9('0x4')]=function(_0x1ff854){for(var _0x2099ba=0x0,_0x3da025=events[_0xf1b9('0x5')];_0x2099ba<_0x3da025;_0x2099ba++){var _0x3a502c=events[_0x2099ba];var _0x4473b0=createListener(_0xf1b9('0x6')+_0x3a502c,_0x1ff854);OpenchannelAccountEvents['on'](_0x3a502c,_0x4473b0);}};
\ No newline at end of file
index 4070e08..fcaa7b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6288=['get','isAuthenticated','index','/:id','post','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelApplication.controller'];(function(_0x4cfe87,_0x4596e6){var _0x448e13=function(_0x142a3d){while(--_0x142a3d){_0x4cfe87['push'](_0x4cfe87['shift']());}};_0x448e13(++_0x4596e6);}(_0x6288,0x1c7));var _0x8628=function(_0x2a4fa4,_0x20ff6c){_0x2a4fa4=_0x2a4fa4-0x0;var _0x20104a=_0x6288[_0x2a4fa4];return _0x20104a;};'use strict';var multer=require('multer');var util=require(_0x8628('0x0'));var path=require(_0x8628('0x1'));var timeout=require(_0x8628('0x2'));var express=require(_0x8628('0x3'));var router=express['Router']();var auth=require(_0x8628('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8628('0x5'));var controller=require(_0x8628('0x6'));router[_0x8628('0x7')]('/',auth[_0x8628('0x8')](),controller[_0x8628('0x9')]);router[_0x8628('0x7')](_0x8628('0xa'),auth[_0x8628('0x8')](),controller['show']);router[_0x8628('0xb')]('/',auth[_0x8628('0x8')](),controller['create']);router['put']('/:id',auth[_0x8628('0x8')](),controller['update']);router[_0x8628('0xc')](_0x8628('0xa'),auth[_0x8628('0x8')](),controller[_0x8628('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x4a37=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','put','delete','/:id'];(function(_0x1d388f,_0x44617f){var _0x1fc79d=function(_0x26c0b7){while(--_0x26c0b7){_0x1d388f['push'](_0x1d388f['shift']());}};_0x1fc79d(++_0x44617f);}(_0x4a37,0x1e7));var _0x74a3=function(_0x4db06a,_0x4fbdea){_0x4db06a=_0x4db06a-0x0;var _0x2cb17a=_0x4a37[_0x4db06a];return _0x2cb17a;};'use strict';var multer=require(_0x74a3('0x0'));var util=require(_0x74a3('0x1'));var path=require('path');var timeout=require(_0x74a3('0x2'));var express=require(_0x74a3('0x3'));var router=express[_0x74a3('0x4')]();var auth=require(_0x74a3('0x5'));var interaction=require(_0x74a3('0x6'));var config=require(_0x74a3('0x7'));var controller=require(_0x74a3('0x8'));router[_0x74a3('0x9')]('/',auth[_0x74a3('0xa')](),controller[_0x74a3('0xb')]);router[_0x74a3('0x9')]('/:id',auth[_0x74a3('0xa')](),controller[_0x74a3('0xc')]);router[_0x74a3('0xd')]('/',auth[_0x74a3('0xa')](),controller['create']);router[_0x74a3('0xe')]('/:id',auth[_0x74a3('0xa')](),controller['update']);router[_0x74a3('0xf')](_0x74a3('0x10'),auth[_0x74a3('0xa')](),controller['destroy']);module[_0x74a3('0x11')]=router;
\ No newline at end of file
index 68b8307..d0a053d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde0a=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x3122b9,_0x4cb093){var _0x537dcc=function(_0x57c166){while(--_0x57c166){_0x3122b9['push'](_0x3122b9['shift']());}};_0x537dcc(++_0x4cb093);}(_0xde0a,0x1a0));var _0xade0=function(_0x3e8b3f,_0x290bc8){_0x3e8b3f=_0x3e8b3f-0x0;var _0x5a39db=_0xde0a[_0x3e8b3f];return _0x5a39db;};'use strict';var Sequelize=require('sequelize');module[_0xade0('0x0')]={'priority':{'type':Sequelize[_0xade0('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xade0('0x2')],'allowNull':![],'defaultValue':_0xade0('0x3')},'appdata':{'type':Sequelize[_0xade0('0x4')]()},'description':{'type':Sequelize[_0xade0('0x2')]},'interval':{'type':Sequelize[_0xade0('0x2')],'defaultValue':_0xade0('0x5')}};
\ No newline at end of file
+var _0x2744=['noop','sequelize','exports','STRING'];(function(_0x321588,_0x33e83a){var _0xd73706=function(_0x5a6f1a){while(--_0x5a6f1a){_0x321588['push'](_0x321588['shift']());}};_0xd73706(++_0x33e83a);}(_0x2744,0x79));var _0x4274=function(_0x4f1697,_0x48068d){_0x4f1697=_0x4f1697-0x0;var _0x4a32c4=_0x2744[_0x4f1697];return _0x4a32c4;};'use strict';var Sequelize=require(_0x4274('0x0'));module[_0x4274('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4274('0x2')],'allowNull':![],'defaultValue':_0x4274('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4274('0x2')]},'interval':{'type':Sequelize[_0x4274('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 308da12..a671bee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85fd=['index','OpenchannelApplication','rawAttributes','fieldName','type','key','map','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','json','count','offset','limit','status','Content-Range','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x548682,_0x3aff64){var _0x3f496b=function(_0x4dd6df){while(--_0x4dd6df){_0x548682['push'](_0x548682['shift']());}};_0x3f496b(++_0x3aff64);}(_0x85fd,0x66));var _0xd85f=function(_0x51fdce,_0x70efa8){_0x51fdce=_0x51fdce-0x0;var _0x19eba5=_0x85fd[_0x51fdce];return _0x19eba5;};'use strict';var pdf=require(_0xd85f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd85f('0x1'));var zipdir=require(_0xd85f('0x2'));var jsonpatch=require(_0xd85f('0x3'));var rp=require('request-promise');var moment=require(_0xd85f('0x4'));var BPromise=require(_0xd85f('0x5'));var Mustache=require(_0xd85f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd85f('0x7'));var csv=require(_0xd85f('0x8'));var ejs=require(_0xd85f('0x9'));var fs=require('fs');var _=require(_0xd85f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd85f('0xb'));var toCsv=require(_0xd85f('0x8'));var querystring=require(_0xd85f('0xc'));var Papa=require(_0xd85f('0xd'));var Redis=require(_0xd85f('0xe'));var authService=require(_0xd85f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd85f('0x10'));var hardwareService=require(_0xd85f('0x11'));var logger=require(_0xd85f('0x12'))(_0xd85f('0x13'));var utils=require(_0xd85f('0x14'));var config=require('../../config/environment');var db=require(_0xd85f('0x15'))['db'];function respondWithStatusCode(_0x2811e7,_0x1ef816){_0x1ef816=_0x1ef816||0xcc;return function(_0x155b9e){if(_0x155b9e){return _0x2811e7['sendStatus'](_0x1ef816);}return _0x2811e7['status'](_0x1ef816)[_0xd85f('0x16')]();};}function respondWithResult(_0x5deee8,_0x4b313a){_0x4b313a=_0x4b313a||0xc8;return function(_0x4caeb1){if(_0x4caeb1){return _0x5deee8['status'](_0x4b313a)[_0xd85f('0x17')](_0x4caeb1);}};}function respondWithFilteredResult(_0x118901,_0x686c5){return function(_0x27940b){if(_0x27940b){var _0x3b3d00=_0x27940b[_0xd85f('0x18')],_0xd0060c=_0x686c5[_0xd85f('0x19')],_0x57e26e=_0x686c5[_0xd85f('0x19')]+_0x686c5[_0xd85f('0x1a')],_0x51103b;if(_0x57e26e>=_0x3b3d00){_0x57e26e=_0x3b3d00;_0x51103b=0xc8;}else{_0x51103b=0xce;}_0x118901[_0xd85f('0x1b')](_0x51103b);return _0x118901['set'](_0xd85f('0x1c'),_0xd0060c+'-'+_0x57e26e+'/'+_0x3b3d00)[_0xd85f('0x17')](_0x27940b);}return null;};}function patchUpdates(_0x364461){return function(_0x57ca9e){try{jsonpatch['apply'](_0x57ca9e,_0x364461,!![]);}catch(_0x8348d3){return BPromise[_0xd85f('0x1d')](_0x8348d3);}return _0x57ca9e[_0xd85f('0x1e')]();};}function saveUpdates(_0xa4a43d,_0x2167d4){return function(_0x4e6fa3){if(_0x4e6fa3){return _0x4e6fa3[_0xd85f('0x1f')](_0xa4a43d)[_0xd85f('0x20')](function(_0x5e9da7){return _0x5e9da7;});}return null;};}function removeEntity(_0x4e5d98,_0x5107a3){return function(_0x4adc5b){if(_0x4adc5b){return _0x4adc5b[_0xd85f('0x21')]()[_0xd85f('0x20')](function(){_0x4e5d98['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c1172,_0x259184){return function(_0x24c26c){if(!_0x24c26c){_0x3c1172['sendStatus'](0x194);}return _0x24c26c;};}function handleError(_0x3eec07,_0x580d51){_0x580d51=_0x580d51||0x1f4;return function(_0x46e556){logger[_0xd85f('0x22')](_0x46e556[_0xd85f('0x23')]);if(_0x46e556[_0xd85f('0x24')]){delete _0x46e556[_0xd85f('0x24')];}_0x3eec07[_0xd85f('0x1b')](_0x580d51)[_0xd85f('0x25')](_0x46e556);};}exports[_0xd85f('0x26')]=function(_0x730429,_0x109bfd){var _0x1cc90a={},_0x4e4ef4={},_0x5b5342={'count':0x0,'rows':[]};var _0x21242c=_['map'](db[_0xd85f('0x27')][_0xd85f('0x28')],function(_0xba3aad){return{'name':_0xba3aad[_0xd85f('0x29')],'type':_0xba3aad[_0xd85f('0x2a')][_0xd85f('0x2b')]};});_0x4e4ef4['model']=_[_0xd85f('0x2c')](_0x21242c,_0xd85f('0x24'));_0x4e4ef4['query']=_['keys'](_0x730429['query']);_0x4e4ef4[_0xd85f('0x2d')]=_['intersection'](_0x4e4ef4[_0xd85f('0x2e')],_0x4e4ef4[_0xd85f('0x2f')]);_0x1cc90a[_0xd85f('0x30')]=_[_0xd85f('0x31')](_0x4e4ef4[_0xd85f('0x2e')],qs[_0xd85f('0x32')](_0x730429[_0xd85f('0x2f')][_0xd85f('0x32')]));_0x1cc90a[_0xd85f('0x30')]=_0x1cc90a[_0xd85f('0x30')][_0xd85f('0x33')]?_0x1cc90a[_0xd85f('0x30')]:_0x4e4ef4[_0xd85f('0x2e')];if(!_0x730429['query'][_0xd85f('0x34')]('nolimit')){_0x1cc90a[_0xd85f('0x1a')]=qs[_0xd85f('0x1a')](_0x730429['query'][_0xd85f('0x1a')]);_0x1cc90a['offset']=qs[_0xd85f('0x19')](_0x730429[_0xd85f('0x2f')][_0xd85f('0x19')]);}_0x1cc90a[_0xd85f('0x35')]=qs[_0xd85f('0x36')](_0x730429[_0xd85f('0x2f')][_0xd85f('0x36')]);_0x1cc90a['where']=qs[_0xd85f('0x2d')](_[_0xd85f('0x37')](_0x730429[_0xd85f('0x2f')],_0x4e4ef4[_0xd85f('0x2d')]),_0x21242c);if(_0x730429[_0xd85f('0x2f')][_0xd85f('0x38')]){_0x1cc90a[_0xd85f('0x39')]=_[_0xd85f('0x3a')](_0x1cc90a[_0xd85f('0x39')],{'$or':_[_0xd85f('0x2c')](_0x21242c,function(_0x46e734){if(_0x46e734[_0xd85f('0x2a')]!=='VIRTUAL'){var _0x2599b7={};_0x2599b7[_0x46e734['name']]={'$like':'%'+_0x730429[_0xd85f('0x2f')]['filter']+'%'};return _0x2599b7;}})});}_0x1cc90a=_[_0xd85f('0x3a')]({},_0x1cc90a,_0x730429['options']);var _0x4c9ddd={'where':_0x1cc90a[_0xd85f('0x39')]};return db[_0xd85f('0x27')][_0xd85f('0x18')](_0x4c9ddd)[_0xd85f('0x20')](function(_0x5ef9bb){_0x5b5342['count']=_0x5ef9bb;if(_0x730429[_0xd85f('0x2f')][_0xd85f('0x3b')]){_0x1cc90a[_0xd85f('0x3c')]=[{'all':!![]}];}return db[_0xd85f('0x27')][_0xd85f('0x3d')](_0x1cc90a);})['then'](function(_0x2a217d){_0x5b5342[_0xd85f('0x3e')]=_0x2a217d;return _0x5b5342;})[_0xd85f('0x20')](respondWithFilteredResult(_0x109bfd,_0x1cc90a))['catch'](handleError(_0x109bfd,null));};exports[_0xd85f('0x3f')]=function(_0xeaf5d4,_0x1f24c7){var _0x54e786={'raw':!![],'where':{'id':_0xeaf5d4['params']['id']}},_0x144c52={};_0x144c52[_0xd85f('0x2e')]=_[_0xd85f('0x40')](db[_0xd85f('0x27')]['rawAttributes']);_0x144c52[_0xd85f('0x2f')]=_[_0xd85f('0x40')](_0xeaf5d4['query']);_0x144c52[_0xd85f('0x2d')]=_[_0xd85f('0x31')](_0x144c52[_0xd85f('0x2e')],_0x144c52[_0xd85f('0x2f')]);_0x54e786[_0xd85f('0x30')]=_[_0xd85f('0x31')](_0x144c52[_0xd85f('0x2e')],qs[_0xd85f('0x32')](_0xeaf5d4['query'][_0xd85f('0x32')]));_0x54e786[_0xd85f('0x30')]=_0x54e786[_0xd85f('0x30')][_0xd85f('0x33')]?_0x54e786[_0xd85f('0x30')]:_0x144c52['model'];if(_0xeaf5d4[_0xd85f('0x2f')][_0xd85f('0x3b')]){_0x54e786[_0xd85f('0x3c')]=[{'all':!![]}];}_0x54e786=_[_0xd85f('0x3a')]({},_0x54e786,_0xeaf5d4['options']);return db['OpenchannelApplication'][_0xd85f('0x41')](_0x54e786)['then'](handleEntityNotFound(_0x1f24c7,null))[_0xd85f('0x20')](respondWithResult(_0x1f24c7,null))[_0xd85f('0x42')](handleError(_0x1f24c7,null));};exports[_0xd85f('0x43')]=function(_0x4fe6c1,_0x10bc14){return db[_0xd85f('0x27')][_0xd85f('0x43')](_0x4fe6c1[_0xd85f('0x44')],{})[_0xd85f('0x20')](respondWithResult(_0x10bc14,0xc9))[_0xd85f('0x42')](handleError(_0x10bc14,null));};exports[_0xd85f('0x1f')]=function(_0x1aa661,_0x33e2ad){if(_0x1aa661[_0xd85f('0x44')]['id']){delete _0x1aa661['body']['id'];}return db[_0xd85f('0x27')][_0xd85f('0x41')]({'where':{'id':_0x1aa661[_0xd85f('0x45')]['id']}})['then'](handleEntityNotFound(_0x33e2ad,null))[_0xd85f('0x20')](saveUpdates(_0x1aa661[_0xd85f('0x44')],null))[_0xd85f('0x20')](respondWithResult(_0x33e2ad,null))[_0xd85f('0x42')](handleError(_0x33e2ad,null));};exports[_0xd85f('0x21')]=function(_0x1ec074,_0x21a2d7){return db[_0xd85f('0x27')]['find']({'where':{'id':_0x1ec074[_0xd85f('0x45')]['id']}})[_0xd85f('0x20')](handleEntityNotFound(_0x21a2d7,null))[_0xd85f('0x20')](removeEntity(_0x21a2d7,null))[_0xd85f('0x42')](handleError(_0x21a2d7,null));};
\ No newline at end of file
+var _0xae90=['then','stack','send','index','OpenchannelApplication','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','create','update','find','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save'];(function(_0x12aa3e,_0x2640b4){var _0x58986b=function(_0xa73804){while(--_0xa73804){_0x12aa3e['push'](_0x12aa3e['shift']());}};_0x58986b(++_0x2640b4);}(_0xae90,0x1b1));var _0x0ae9=function(_0x5be4b1,_0x17e4fe){_0x5be4b1=_0x5be4b1-0x0;var _0x5a3126=_0xae90[_0x5be4b1];return _0x5a3126;};'use strict';var pdf=require(_0x0ae9('0x0'));var emlformat=require(_0x0ae9('0x1'));var rimraf=require(_0x0ae9('0x2'));var zipdir=require(_0x0ae9('0x3'));var jsonpatch=require(_0x0ae9('0x4'));var rp=require(_0x0ae9('0x5'));var moment=require(_0x0ae9('0x6'));var BPromise=require(_0x0ae9('0x7'));var Mustache=require(_0x0ae9('0x8'));var util=require(_0x0ae9('0x9'));var path=require(_0x0ae9('0xa'));var sox=require(_0x0ae9('0xb'));var csv=require(_0x0ae9('0xc'));var ejs=require(_0x0ae9('0xd'));var fs=require('fs');var _=require(_0x0ae9('0xe'));var squel=require(_0x0ae9('0xf'));var crypto=require(_0x0ae9('0x10'));var jsforce=require(_0x0ae9('0x11'));var deskjs=require(_0x0ae9('0x12'));var toCsv=require(_0x0ae9('0xc'));var querystring=require(_0x0ae9('0x13'));var Papa=require(_0x0ae9('0x14'));var Redis=require(_0x0ae9('0x15'));var authService=require(_0x0ae9('0x16'));var qs=require(_0x0ae9('0x17'));var as=require(_0x0ae9('0x18'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ae9('0x19'))('api');var utils=require(_0x0ae9('0x1a'));var config=require(_0x0ae9('0x1b'));var db=require(_0x0ae9('0x1c'))['db'];function respondWithStatusCode(_0x157954,_0x50ec85){_0x50ec85=_0x50ec85||0xcc;return function(_0x1696ea){if(_0x1696ea){return _0x157954[_0x0ae9('0x1d')](_0x50ec85);}return _0x157954[_0x0ae9('0x1e')](_0x50ec85)[_0x0ae9('0x1f')]();};}function respondWithResult(_0x15d327,_0x2df457){_0x2df457=_0x2df457||0xc8;return function(_0x4d4fdd){if(_0x4d4fdd){return _0x15d327['status'](_0x2df457)['json'](_0x4d4fdd);}};}function respondWithFilteredResult(_0x16a2d9,_0xd0dec1){return function(_0x11f589){if(_0x11f589){var _0x29329f=_0x11f589[_0x0ae9('0x20')],_0x5619ba=_0xd0dec1[_0x0ae9('0x21')],_0xb66f89=_0xd0dec1[_0x0ae9('0x21')]+_0xd0dec1[_0x0ae9('0x22')],_0xb2af1f;if(_0xb66f89>=_0x29329f){_0xb66f89=_0x29329f;_0xb2af1f=0xc8;}else{_0xb2af1f=0xce;}_0x16a2d9[_0x0ae9('0x1e')](_0xb2af1f);return _0x16a2d9[_0x0ae9('0x23')](_0x0ae9('0x24'),_0x5619ba+'-'+_0xb66f89+'/'+_0x29329f)[_0x0ae9('0x25')](_0x11f589);}return null;};}function patchUpdates(_0x444a25){return function(_0x213883){try{jsonpatch[_0x0ae9('0x26')](_0x213883,_0x444a25,!![]);}catch(_0x522c0e){return BPromise[_0x0ae9('0x27')](_0x522c0e);}return _0x213883[_0x0ae9('0x28')]();};}function saveUpdates(_0x12861a,_0x503d50){return function(_0xb386a1){if(_0xb386a1){return _0xb386a1['update'](_0x12861a)[_0x0ae9('0x29')](function(_0x5d0b99){return _0x5d0b99;});}return null;};}function removeEntity(_0x35e719,_0x544805){return function(_0x48b793){if(_0x48b793){return _0x48b793['destroy']()[_0x0ae9('0x29')](function(){_0x35e719['status'](0xcc)[_0x0ae9('0x1f')]();});}};}function handleEntityNotFound(_0x460f9f,_0x2c0535){return function(_0xf94d3a){if(!_0xf94d3a){_0x460f9f[_0x0ae9('0x1d')](0x194);}return _0xf94d3a;};}function handleError(_0x5d9822,_0xe9c227){_0xe9c227=_0xe9c227||0x1f4;return function(_0x1a335d){logger['error'](_0x1a335d[_0x0ae9('0x2a')]);if(_0x1a335d['name']){delete _0x1a335d['name'];}_0x5d9822[_0x0ae9('0x1e')](_0xe9c227)[_0x0ae9('0x2b')](_0x1a335d);};}exports[_0x0ae9('0x2c')]=function(_0x38b3,_0x171716){var _0x41f96a={},_0x7e2e7d={},_0x34baf7={'count':0x0,'rows':[]};var _0xa9649d=_['map'](db[_0x0ae9('0x2d')][_0x0ae9('0x2e')],function(_0x431b43){return{'name':_0x431b43[_0x0ae9('0x2f')],'type':_0x431b43[_0x0ae9('0x30')]['key']};});_0x7e2e7d[_0x0ae9('0x31')]=_[_0x0ae9('0x32')](_0xa9649d,'name');_0x7e2e7d[_0x0ae9('0x33')]=_['keys'](_0x38b3[_0x0ae9('0x33')]);_0x7e2e7d[_0x0ae9('0x34')]=_[_0x0ae9('0x35')](_0x7e2e7d[_0x0ae9('0x31')],_0x7e2e7d[_0x0ae9('0x33')]);_0x41f96a[_0x0ae9('0x36')]=_[_0x0ae9('0x35')](_0x7e2e7d[_0x0ae9('0x31')],qs[_0x0ae9('0x37')](_0x38b3['query'][_0x0ae9('0x37')]));_0x41f96a[_0x0ae9('0x36')]=_0x41f96a['attributes'][_0x0ae9('0x38')]?_0x41f96a[_0x0ae9('0x36')]:_0x7e2e7d[_0x0ae9('0x31')];if(!_0x38b3[_0x0ae9('0x33')][_0x0ae9('0x39')](_0x0ae9('0x3a'))){_0x41f96a[_0x0ae9('0x22')]=qs[_0x0ae9('0x22')](_0x38b3[_0x0ae9('0x33')][_0x0ae9('0x22')]);_0x41f96a[_0x0ae9('0x21')]=qs[_0x0ae9('0x21')](_0x38b3[_0x0ae9('0x33')][_0x0ae9('0x21')]);}_0x41f96a[_0x0ae9('0x3b')]=qs[_0x0ae9('0x3c')](_0x38b3[_0x0ae9('0x33')][_0x0ae9('0x3c')]);_0x41f96a[_0x0ae9('0x3d')]=qs[_0x0ae9('0x34')](_[_0x0ae9('0x3e')](_0x38b3[_0x0ae9('0x33')],_0x7e2e7d[_0x0ae9('0x34')]),_0xa9649d);if(_0x38b3[_0x0ae9('0x33')]['filter']){_0x41f96a[_0x0ae9('0x3d')]=_[_0x0ae9('0x3f')](_0x41f96a[_0x0ae9('0x3d')],{'$or':_[_0x0ae9('0x32')](_0xa9649d,function(_0x46c9d8){if(_0x46c9d8['type']!==_0x0ae9('0x40')){var _0x4f392b={};_0x4f392b[_0x46c9d8['name']]={'$like':'%'+_0x38b3[_0x0ae9('0x33')][_0x0ae9('0x41')]+'%'};return _0x4f392b;}})});}_0x41f96a=_[_0x0ae9('0x3f')]({},_0x41f96a,_0x38b3[_0x0ae9('0x42')]);var _0x4e12ca={'where':_0x41f96a['where']};return db[_0x0ae9('0x2d')][_0x0ae9('0x20')](_0x4e12ca)['then'](function(_0x52ca8a){_0x34baf7['count']=_0x52ca8a;if(_0x38b3['query'][_0x0ae9('0x43')]){_0x41f96a['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x0ae9('0x44')](_0x41f96a);})[_0x0ae9('0x29')](function(_0x393967){_0x34baf7[_0x0ae9('0x45')]=_0x393967;return _0x34baf7;})['then'](respondWithFilteredResult(_0x171716,_0x41f96a))[_0x0ae9('0x46')](handleError(_0x171716,null));};exports[_0x0ae9('0x47')]=function(_0x58d78b,_0x228348){var _0x396da4={'raw':!![],'where':{'id':_0x58d78b[_0x0ae9('0x48')]['id']}},_0x2db240={};_0x2db240['model']=_[_0x0ae9('0x49')](db[_0x0ae9('0x2d')][_0x0ae9('0x2e')]);_0x2db240['query']=_[_0x0ae9('0x49')](_0x58d78b[_0x0ae9('0x33')]);_0x2db240[_0x0ae9('0x34')]=_['intersection'](_0x2db240[_0x0ae9('0x31')],_0x2db240[_0x0ae9('0x33')]);_0x396da4[_0x0ae9('0x36')]=_[_0x0ae9('0x35')](_0x2db240[_0x0ae9('0x31')],qs[_0x0ae9('0x37')](_0x58d78b[_0x0ae9('0x33')][_0x0ae9('0x37')]));_0x396da4[_0x0ae9('0x36')]=_0x396da4[_0x0ae9('0x36')][_0x0ae9('0x38')]?_0x396da4['attributes']:_0x2db240[_0x0ae9('0x31')];if(_0x58d78b['query']['includeAll']){_0x396da4['include']=[{'all':!![]}];}_0x396da4=_[_0x0ae9('0x3f')]({},_0x396da4,_0x58d78b[_0x0ae9('0x42')]);return db[_0x0ae9('0x2d')]['find'](_0x396da4)[_0x0ae9('0x29')](handleEntityNotFound(_0x228348,null))[_0x0ae9('0x29')](respondWithResult(_0x228348,null))[_0x0ae9('0x46')](handleError(_0x228348,null));};exports[_0x0ae9('0x4a')]=function(_0x4d45f5,_0x357e6d){return db[_0x0ae9('0x2d')][_0x0ae9('0x4a')](_0x4d45f5['body'],{})[_0x0ae9('0x29')](respondWithResult(_0x357e6d,0xc9))[_0x0ae9('0x46')](handleError(_0x357e6d,null));};exports[_0x0ae9('0x4b')]=function(_0x1e6ac7,_0x10d1bf){if(_0x1e6ac7['body']['id']){delete _0x1e6ac7['body']['id'];}return db[_0x0ae9('0x2d')][_0x0ae9('0x4c')]({'where':{'id':_0x1e6ac7['params']['id']}})['then'](handleEntityNotFound(_0x10d1bf,null))[_0x0ae9('0x29')](saveUpdates(_0x1e6ac7[_0x0ae9('0x4d')],null))['then'](respondWithResult(_0x10d1bf,null))[_0x0ae9('0x46')](handleError(_0x10d1bf,null));};exports[_0x0ae9('0x4e')]=function(_0x5573c5,_0x45763f){return db[_0x0ae9('0x2d')]['find']({'where':{'id':_0x5573c5[_0x0ae9('0x48')]['id']}})[_0x0ae9('0x29')](handleEntityNotFound(_0x45763f,null))[_0x0ae9('0x29')](removeEntity(_0x45763f,null))['catch'](handleError(_0x45763f,null));};
\ No newline at end of file
index 0c094f5..2dca799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd375=['path','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0xd375,0x73));var _0x5d37=function(_0x2adcdd,_0x4d5998){_0x2adcdd=_0x2adcdd-0x0;var _0x51d6a1=_0xd375[_0x2adcdd];return _0x51d6a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5d37('0x0'));var moment=require(_0x5d37('0x1'));var BPromise=require(_0x5d37('0x2'));var rp=require(_0x5d37('0x3'));var fs=require('fs');var path=require(_0x5d37('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x4b240e,_0x4db29a){return _0x4b240e['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5d37('0x5'),'collate':_0x5d37('0x6')});};
\ No newline at end of file
+var _0x66f0=['openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes'];(function(_0x388a5c,_0x51b851){var _0x3fcae9=function(_0x245a4c){while(--_0x245a4c){_0x388a5c['push'](_0x388a5c['shift']());}};_0x3fcae9(++_0x51b851);}(_0x66f0,0xff));var _0x066f=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0x66f0[_0x3ed054];return _0x16dd95;};'use strict';var _=require(_0x066f('0x0'));var util=require(_0x066f('0x1'));var logger=require(_0x066f('0x2'))('api');var moment=require(_0x066f('0x3'));var BPromise=require(_0x066f('0x4'));var rp=require(_0x066f('0x5'));var fs=require('fs');var path=require(_0x066f('0x6'));var rimraf=require(_0x066f('0x7'));var config=require('../../config/environment');var attributes=require(_0x066f('0x8'));module['exports']=function(_0x1dce74,_0x3d7311){return _0x1dce74['define']('OpenchannelApplication',attributes,{'tableName':_0x066f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x066f('0xa')});};
\ No newline at end of file
index e6077eb..7bea663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});};
\ No newline at end of file
+var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2cd5f1,_0x58e244){var _0x2761c6=function(_0x2f13c8){while(--_0x2f13c8){_0x2cd5f1['push'](_0x2cd5f1['shift']());}};_0x2761c6(++_0x58e244);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c66f6,_0x2dae26){_0x2c66f6=_0x2c66f6-0x0;var _0x1e5894=_0xb10b[_0x2c66f6];return _0x1e5894;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});};
\ No newline at end of file
index 286e1a1..386555f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96dd=['/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get'];(function(_0x49e455,_0x272c04){var _0x2398fb=function(_0x39e6a1){while(--_0x39e6a1){_0x49e455['push'](_0x49e455['shift']());}};_0x2398fb(++_0x272c04);}(_0x96dd,0x114));var _0xd96d=function(_0x5e4ad4,_0x299a8e){_0x5e4ad4=_0x5e4ad4-0x0;var _0x8c7c4a=_0x96dd[_0x5e4ad4];return _0x8c7c4a;};'use strict';var multer=require(_0xd96d('0x0'));var util=require(_0xd96d('0x1'));var path=require(_0xd96d('0x2'));var timeout=require(_0xd96d('0x3'));var express=require(_0xd96d('0x4'));var router=express[_0xd96d('0x5')]();var auth=require(_0xd96d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd96d('0x7'));var controller=require(_0xd96d('0x8'));router['get']('/',auth[_0xd96d('0x9')](),controller[_0xd96d('0xa')]);router[_0xd96d('0xb')]('/describe',auth[_0xd96d('0x9')](),controller['describe']);router[_0xd96d('0xb')](_0xd96d('0xc'),auth[_0xd96d('0x9')](),controller[_0xd96d('0xd')]);router['get'](_0xd96d('0xe'),auth[_0xd96d('0x9')](),controller[_0xd96d('0xf')]);router[_0xd96d('0xb')](_0xd96d('0x10'),auth['isAuthenticated'](),controller[_0xd96d('0x11')]);router[_0xd96d('0x12')]('/',auth[_0xd96d('0x9')](),controller[_0xd96d('0x13')]);router[_0xd96d('0x12')](_0xd96d('0xe'),auth[_0xd96d('0x9')](),controller[_0xd96d('0x14')]);router[_0xd96d('0x12')](_0xd96d('0x15'),auth[_0xd96d('0x9')](),interaction[_0xd96d('0x16')](_0xd96d('0x17'),_0xd96d('0x18')),controller[_0xd96d('0x19')]);router[_0xd96d('0x1a')](_0xd96d('0xc'),auth[_0xd96d('0x9')](),interaction['tracked']('openchannel',_0xd96d('0x1b')),controller[_0xd96d('0x1c')]);router['delete'](_0xd96d('0xc'),auth[_0xd96d('0x9')](),interaction[_0xd96d('0x16')](_0xd96d('0x17'),'openchannelinteraction:destroy'),controller[_0xd96d('0x1d')]);router[_0xd96d('0x1e')](_0xd96d('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0xd96d('0x1f')]=router;
\ No newline at end of file
+var _0x5dab=['removeTags','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','/:id/tags','tracked','openchannel','addTags','update','delete','openchannelinteraction:destroy','destroy'];(function(_0x34e9d3,_0x15641e){var _0x65ad47=function(_0x279123){while(--_0x279123){_0x34e9d3['push'](_0x34e9d3['shift']());}};_0x65ad47(++_0x15641e);}(_0x5dab,0xd2));var _0xb5da=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x5dab[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0xb5da('0x0'));var util=require(_0xb5da('0x1'));var path=require(_0xb5da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb5da('0x3')]();var auth=require(_0xb5da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb5da('0x5'));var controller=require(_0xb5da('0x6'));router[_0xb5da('0x7')]('/',auth[_0xb5da('0x8')](),controller[_0xb5da('0x9')]);router[_0xb5da('0x7')](_0xb5da('0xa'),auth[_0xb5da('0x8')](),controller['describe']);router['get'](_0xb5da('0xb'),auth['isAuthenticated'](),controller[_0xb5da('0xc')]);router[_0xb5da('0x7')](_0xb5da('0xd'),auth[_0xb5da('0x8')](),controller['getMessages']);router[_0xb5da('0x7')]('/:id/download',auth[_0xb5da('0x8')](),controller[_0xb5da('0xe')]);router[_0xb5da('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb5da('0xf')](_0xb5da('0xd'),auth[_0xb5da('0x8')](),controller['addMessage']);router['post'](_0xb5da('0x10'),auth[_0xb5da('0x8')](),interaction[_0xb5da('0x11')](_0xb5da('0x12'),'openchannelinteraction:addtags'),controller[_0xb5da('0x13')]);router['put'](_0xb5da('0xb'),auth[_0xb5da('0x8')](),interaction['tracked'](_0xb5da('0x12'),'openchannelinteraction:update'),controller[_0xb5da('0x14')]);router[_0xb5da('0x15')](_0xb5da('0xb'),auth[_0xb5da('0x8')](),interaction['tracked'](_0xb5da('0x12'),_0xb5da('0x16')),controller[_0xb5da('0x17')]);router[_0xb5da('0x15')](_0xb5da('0x10'),auth[_0xb5da('0x8')](),controller[_0xb5da('0x18')]);module[_0xb5da('0x19')]=router;
\ No newline at end of file
index 8c22057..98a5fa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b0a=['DATE','STRING','out','sequelize','exports'];(function(_0x22868e,_0x19cc06){var _0x2e3329=function(_0x5cbf72){while(--_0x5cbf72){_0x22868e['push'](_0x22868e['shift']());}};_0x2e3329(++_0x19cc06);}(_0x5b0a,0x1b1));var _0xa5b0=function(_0xc2f007,_0x306627){_0xc2f007=_0xc2f007-0x0;var _0x54fc0a=_0x5b0a[_0xc2f007];return _0x54fc0a;};'use strict';var Sequelize=require(_0xa5b0('0x0'));module[_0xa5b0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa5b0('0x2')]},'disposition':{'type':Sequelize[_0xa5b0('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa5b0('0x2')]},'threadId':{'type':Sequelize[_0xa5b0('0x3')]},'externalUrl':{'type':Sequelize[_0xa5b0('0x3')]},'lastMsgAt':{'type':Sequelize[_0xa5b0('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa5b0('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa5b0('0x3')]}};
\ No newline at end of file
+var _0x61a6=['STRING','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x377e6a,_0x2ea695){var _0x31ca60=function(_0x2354fa){while(--_0x2354fa){_0x377e6a['push'](_0x377e6a['shift']());}};_0x31ca60(++_0x2ea695);}(_0x61a6,0x129));var _0x661a=function(_0x1345fa,_0x11947a){_0x1345fa=_0x1345fa-0x0;var _0xc32585=_0x61a6[_0x1345fa];return _0xc32585;};'use strict';var Sequelize=require(_0x661a('0x0'));module[_0x661a('0x1')]={'closed':{'type':Sequelize[_0x661a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x661a('0x3')]},'note':{'type':Sequelize[_0x661a('0x3')]},'read1stAt':{'type':Sequelize[_0x661a('0x4')]},'threadId':{'type':Sequelize[_0x661a('0x3')]},'externalUrl':{'type':Sequelize[_0x661a('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x661a('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cc04b80..f5ed597 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1801=['then','destroy','stack','name','Users','map','TagIds','Tags','forEach','push','catch','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$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','text','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','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?','filter','replace','\x27\x27\x27\x27','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','keyBy','OpenchannelInteraction','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','sequelize','groupBy','all','rows','params','includeAll','include','merge','options','create','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','pick','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','direction','secret','Account','fullname','get','mkdirSync','10px','30px','format','YYYY-MM-DD','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','Messages','Attachment','basename','createReadStream','pipe','createWriteStream','out','System','firstName','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update'];(function(_0x4cb69e,_0x229b5f){var _0x1f16e2=function(_0x4c51f5){while(--_0x4c51f5){_0x4cb69e['push'](_0x4cb69e['shift']());}};_0x1f16e2(++_0x229b5f);}(_0x1801,0xc6));var _0x1180=function(_0x183f14,_0x3ac93a){_0x183f14=_0x183f14-0x0;var _0x11e0f1=_0x1801[_0x183f14];return _0x11e0f1;};'use strict';var pdf=require(_0x1180('0x0'));var emlformat=require(_0x1180('0x1'));var rimraf=require(_0x1180('0x2'));var zipdir=require(_0x1180('0x3'));var jsonpatch=require(_0x1180('0x4'));var rp=require(_0x1180('0x5'));var moment=require(_0x1180('0x6'));var BPromise=require(_0x1180('0x7'));var Mustache=require(_0x1180('0x8'));var util=require(_0x1180('0x9'));var path=require(_0x1180('0xa'));var sox=require(_0x1180('0xb'));var csv=require(_0x1180('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1180('0xd'));var squel=require(_0x1180('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1180('0xf'));var toCsv=require(_0x1180('0xc'));var querystring=require(_0x1180('0x10'));var Papa=require(_0x1180('0x11'));var Redis=require(_0x1180('0x12'));var authService=require(_0x1180('0x13'));var qs=require(_0x1180('0x14'));var as=require(_0x1180('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1180('0x16'))(_0x1180('0x17'));var utils=require(_0x1180('0x18'));var config=require(_0x1180('0x19'));var db=require(_0x1180('0x1a'))['db'];config['redis']=_['defaults'](config[_0x1180('0x1b')],{'host':_0x1180('0x1c'),'port':0x18eb});var socket=require(_0x1180('0x1d'))(new Redis(config[_0x1180('0x1b')]));require(_0x1180('0x1e'))[_0x1180('0x1f')](socket);function respondWithStatusCode(_0x23876c,_0x414c1d){_0x414c1d=_0x414c1d||0xcc;return function(_0x4434d2){if(_0x4434d2){return _0x23876c[_0x1180('0x20')](_0x414c1d);}return _0x23876c[_0x1180('0x21')](_0x414c1d)[_0x1180('0x22')]();};}function respondWithResult(_0x12de8c,_0x5e263f){_0x5e263f=_0x5e263f||0xc8;return function(_0x56cd8b){if(_0x56cd8b){return _0x12de8c['status'](_0x5e263f)[_0x1180('0x23')](_0x56cd8b);}};}function respondWithFilteredResult(_0x5b8d60,_0x22448f){return function(_0x4e6781){if(_0x4e6781){var _0x11d278=_0x4e6781[_0x1180('0x24')],_0x2d4714=_0x22448f[_0x1180('0x25')],_0x476375=_0x22448f[_0x1180('0x25')]+_0x22448f[_0x1180('0x26')],_0x3c157c;if(_0x476375>=_0x11d278){_0x476375=_0x11d278;_0x3c157c=0xc8;}else{_0x3c157c=0xce;}_0x5b8d60[_0x1180('0x21')](_0x3c157c);return _0x5b8d60[_0x1180('0x27')](_0x1180('0x28'),_0x2d4714+'-'+_0x476375+'/'+_0x11d278)['json'](_0x4e6781);}return null;};}function patchUpdates(_0x4785ee){return function(_0x2ca779){try{jsonpatch[_0x1180('0x29')](_0x2ca779,_0x4785ee,!![]);}catch(_0x5c983e){return BPromise[_0x1180('0x2a')](_0x5c983e);}return _0x2ca779['save']();};}function saveUpdates(_0x325028,_0xb2282){return function(_0x3a4e82){if(_0x3a4e82){return _0x3a4e82[_0x1180('0x2b')](_0x325028)[_0x1180('0x2c')](function(_0x4ab2f7){return _0x4ab2f7;});}return null;};}function removeEntity(_0x276594,_0x199586){return function(_0x237d48){if(_0x237d48){return _0x237d48[_0x1180('0x2d')]()[_0x1180('0x2c')](function(){_0x276594[_0x1180('0x21')](0xcc)[_0x1180('0x22')]();});}};}function handleEntityNotFound(_0xdd7df5,_0x4c1b86){return function(_0x3bdeee){if(!_0x3bdeee){_0xdd7df5[_0x1180('0x20')](0x194);}return _0x3bdeee;};}function handleError(_0x289013,_0x712441){_0x712441=_0x712441||0x1f4;return function(_0x2edc3d){logger['error'](_0x2edc3d[_0x1180('0x2e')]);if(_0x2edc3d[_0x1180('0x2f')]){delete _0x2edc3d[_0x1180('0x2f')];}_0x289013[_0x1180('0x21')](_0x712441)['send'](_0x2edc3d);};}function getInteractionUsers(_0x349783,_0xbdec61){return new BPromise(function(_0x1917f5,_0x9bec5f){try{if(_0xbdec61[_0x349783['id']]){_0x349783[_0x1180('0x30')]=_[_0x1180('0x31')](_0xbdec61[_0x349783['id']],function(_0x5a3f6f){return{'id':_0x5a3f6f['id'],'fullname':_0x5a3f6f['fullname']};});}}catch(_0x141908){_0x9bec5f(_0x141908);}_0x1917f5(_0x349783);});}function getInteractionTags(_0x23ab3e,_0x54836a){return new BPromise(function(_0x1fdd59,_0x548d03){try{if(_0x23ab3e[_0x1180('0x32')]){_0x23ab3e[_0x1180('0x33')]=[];_0x23ab3e['TagIds']['split'](',')[_0x1180('0x34')](function(_0x41d55c){_0x23ab3e[_0x1180('0x33')][_0x1180('0x35')](_0x54836a[_0x41d55c]);});}delete _0x23ab3e[_0x1180('0x32')];}catch(_0xa88840){_0x548d03(_0xa88840);}_0x1fdd59(_0x23ab3e);});}function updateOpenchannelInteraction(_0x1d5978,_0x57875f,_0x501ae5){return new BPromise(function(_0x3b1967,_0x16dde2){return getInteractionUsers(_0x1d5978,_0x501ae5)[_0x1180('0x2c')](function(_0x3f1053){return getInteractionTags(_0x3f1053,_0x57875f);})[_0x1180('0x2c')](function(_0x566331){_0x3b1967(_0x566331);})[_0x1180('0x36')](function(_0x8f2563){_0x16dde2(_0x8f2563);});});}exports['index']=function(_0xa2aff8,_0xb6167c){var _0x564d28={},_0x2e1b6b={},_0x2f2fc3={'count':0x0,'rows':[]};var _0xb1099b=_[_0x1180('0x31')](db['OpenchannelInteraction'][_0x1180('0x37')],function(_0x28ca12){return{'name':_0x28ca12['fieldName'],'type':_0x28ca12[_0x1180('0x38')][_0x1180('0x39')]};});_0x2e1b6b[_0x1180('0x3a')]=_['map'](_0xb1099b,'name');_0x2e1b6b[_0x1180('0x3b')]=_[_0x1180('0x3c')](_0xa2aff8['query']);_0x2e1b6b[_0x1180('0x3d')]=_['intersection'](_0x2e1b6b[_0x1180('0x3a')],_0x2e1b6b[_0x1180('0x3b')]);_0x564d28[_0x1180('0x3e')]=_[_0x1180('0x3f')](_0x2e1b6b[_0x1180('0x3a')],qs[_0x1180('0x40')](_0xa2aff8['query'][_0x1180('0x40')]));_0x564d28[_0x1180('0x3e')]=_0x564d28[_0x1180('0x3e')][_0x1180('0x41')]?_0x564d28[_0x1180('0x3e')]:_0x2e1b6b[_0x1180('0x3a')];if(!_0xa2aff8['query'][_0x1180('0x42')](_0x1180('0x43'))){_0x564d28['limit']=qs[_0x1180('0x26')](_0xa2aff8['query'][_0x1180('0x26')]);_0x564d28[_0x1180('0x25')]=qs[_0x1180('0x25')](_0xa2aff8[_0x1180('0x3b')][_0x1180('0x25')]);}_0x564d28[_0x1180('0x44')]=qs[_0x1180('0x45')](_0xa2aff8['query'][_0x1180('0x45')]);_0x564d28[_0x1180('0x46')]=qs[_0x1180('0x3d')](_['pick'](_0xa2aff8[_0x1180('0x3b')],_0x2e1b6b[_0x1180('0x3d')]),_0xb1099b);var _0xdd574b=[];var _0x17e6a8=squel[_0x1180('0x47')]()[_0x1180('0x48')]('id')[_0x1180('0x48')](_0x1180('0x2f'))[_0x1180('0x48')](_0x1180('0x49'))[_0x1180('0x4a')]('tools_tags');var _0x2bade7=squel[_0x1180('0x47')]()[_0x1180('0x48')](_0x1180('0x4b'))[_0x1180('0x48')](_0x1180('0x4c'))['field']('ui.OpenchannelInteractionId')['from'](_0x1180('0x4d'),'ui')[_0x1180('0x4e')](_0x1180('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x4c0fc9=squel['select']()[_0x1180('0x4a')](_0x1180('0x50'),'i')[_0x1180('0x4e')]('cm_contacts','c',_0x1180('0x51'))[_0x1180('0x4e')](_0x1180('0x4f'),'o',_0x1180('0x52'))['left_join']('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x1180('0x4e')](_0x1180('0x53'),'me',_0x1180('0x54'))['left_join'](_0x1180('0x55'),'it',_0x1180('0x56'))[_0x1180('0x4e')](_0x1180('0x57'),'t',_0x1180('0x58'));var _0x4a89e3=squel[_0x1180('0x59')]();var _0x39dd9c=[];var _0xc46ff1=squel[_0x1180('0x59')]();var _0x21826d;if(_0xa2aff8[_0x1180('0x3b')][_0x1180('0x5a')]){_0x21826d=as['parseSearch'](_0xa2aff8['query'][_0x1180('0x5a')]);var _0x44803e=_0x21826d['sqlOperator'];for(var _0x16dfc4=0x0;_0x16dfc4<_0x21826d['conditions']['length'];_0x16dfc4++){var _0x1fabc0=_0x21826d['conditions'][_0x16dfc4];var _0x44a1c2='i';var _0x53cfcd=_[_0x1180('0x5b')](_0xb1099b,[_0x1180('0x2f'),_0x1fabc0[_0x1180('0x48')]]);if(!_0x53cfcd){switch(_0x1fabc0['field']){case _0x1180('0x5c'):if(_0x1fabc0['value']==0x1){_0x4c0fc9[_0x1180('0x5d')]('`'+_0x1fabc0[_0x1180('0x48')]+_0x1180('0x5e'));}else{_0x4c0fc9[_0x1180('0x5d')]('`'+_0x1fabc0[_0x1180('0x48')]+_0x1180('0x5f'));}break;case _0x1180('0x60'):if(_0x1fabc0['operator']===_0x1180('0x61')){if(_0x1fabc0[_0x1180('0x62')][_0x1180('0x63')]('\x20')['length']>0x1){_0x4a89e3[_0x44803e](_0x1180('0x64'),qs[_0x1180('0x65')](_0x1fabc0[_0x1180('0x62')]),null);}else{var _0x544764='%'+_0x1fabc0[_0x1180('0x62')]+'%';_0x4a89e3[_0x44803e](_0x1180('0x66'),_0x544764,_0x544764,_0x544764);}}else{_0x53cfcd=_[_0x1180('0x5b')](_0xb1099b,[_0x1180('0x2f'),'ContactId']);_0x1fabc0[_0x1180('0x48')]=_0x1180('0x67');_0x4dfb8e=as[_0x1180('0x68')](_0x44a1c2,_0x53cfcd[_0x1180('0x38')],_0x1fabc0);_0x4a89e3[_0x44803e](_0x4dfb8e[_0x1180('0x69')],_0x4dfb8e[_0x1180('0x62')][_0x1180('0x6a')],_0x4dfb8e[_0x1180('0x62')][_0x1180('0x22')]);}break;case _0x1180('0x6b'):var _0x41a7ae=_0x1fabc0[_0x1180('0x62')][_0x1180('0x63')](',')[_0x1180('0x31')](function(_0xdf3a5e){return Number(_0xdf3a5e);});_0x41a7ae[_0x1180('0x34')](function(_0x1503aa){_0xc46ff1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1503aa+',%');});_0x39dd9c=_[_0x1180('0x6c')](_0x39dd9c,_0x41a7ae);break;case _0x1180('0x6d'):if(_0x1fabc0[_0x1180('0x6e')]===_0x1180('0x61')){_0x4a89e3[_0x44803e](_0x1180('0x6f'),'%'+_0x1fabc0['value']+'%',null);}else{_0x53cfcd=_[_0x1180('0x5b')](_0xb1099b,[_0x1180('0x2f'),_0x1180('0x70')]);_0x1fabc0[_0x1180('0x48')]=_0x1180('0x70');_0x4dfb8e=as[_0x1180('0x68')](_0x44a1c2,_0x53cfcd[_0x1180('0x38')],_0x1fabc0);_0x4a89e3[_0x44803e](_0x4dfb8e['text'],_0x4dfb8e['value']['start'],_0x4dfb8e[_0x1180('0x62')][_0x1180('0x22')]);}break;case _0x1180('0x71'):_0x4dfb8e=as[_0x1180('0x68')]('me',null,_0x1fabc0);_0x4a89e3[_0x44803e](_0x4dfb8e['text'],_0x4dfb8e['value'][_0x1180('0x6a')],_0x4dfb8e['value'][_0x1180('0x22')]);break;}}else{var _0x4dfb8e=as['buildExpression'](_0x44a1c2,_0x53cfcd[_0x1180('0x38')],_0x1fabc0);_0x4a89e3[_0x44803e](_0x4dfb8e[_0x1180('0x69')],_0x4dfb8e['value'][_0x1180('0x6a')],_0x4dfb8e['value'][_0x1180('0x22')]);}}}else{var _0x5b3178=_(_0xa2aff8[_0x1180('0x3b')])[_0x1180('0x3c')]()[_0x1180('0x31')](function(_0x1c6355){return _[_0x1180('0x72')](_0xb1099b,[_0x1180('0x2f'),_0x1c6355])?_0x1c6355:undefined;})[_0x1180('0x73')]()['value']();if(!_[_0x1180('0x74')](_0x5b3178)){_0x5b3178[_0x1180('0x34')](function(_0x897c66){if(_0x897c66===_0x1180('0x75')){_0x4c0fc9['where'](_0x1180('0x76'),[]['concat'](_0xa2aff8[_0x1180('0x3b')][_0x897c66]));}else if(_0x897c66===_0x1180('0x77')){var _0x57f0a3=JSON[_0x1180('0x78')](_0xa2aff8[_0x1180('0x3b')][_0x897c66])[_0x1180('0x79')];var _0x423bc0=JSON[_0x1180('0x78')](_0xa2aff8[_0x1180('0x3b')][_0x897c66])[_0x1180('0x7a')];_0x4c0fc9[_0x1180('0x46')](_0x1180('0x7b'),_0x57f0a3,_0x423bc0);}else{if(_0xa2aff8[_0x1180('0x3b')][_0x897c66]===_0x1180('0x7c')){_0x4c0fc9[_0x1180('0x46')]('i.'+_0x897c66+'\x20IS\x20NULL');}else{_0x4c0fc9['where']('i.'+_0x897c66+_0x1180('0x7d'),_0xa2aff8[_0x1180('0x3b')][_0x897c66]);}}});}if(_0xa2aff8[_0x1180('0x3b')][_0x1180('0x7e')]){if(_0xa2aff8[_0x1180('0x3b')]['read']==0x1){_0x4c0fc9[_0x1180('0x5d')](_0x1180('0x7f'));}else{_0x4c0fc9[_0x1180('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0xa2aff8[_0x1180('0x3b')][_0x1180('0x80')]){_0x39dd9c=_[_0x1180('0x81')](_0xa2aff8[_0x1180('0x3b')][_0x1180('0x80')])?_0xa2aff8[_0x1180('0x3b')][_0x1180('0x80')]:new Array(_0xa2aff8[_0x1180('0x3b')][_0x1180('0x80')]);_0x39dd9c[_0x1180('0x34')](function(_0x408535){_0xc46ff1['or'](_0x1180('0x82'),'%,'+_0x408535+',%');});}if(_0xa2aff8[_0x1180('0x3b')]['filter']){var _0x4c37dc=_0xa2aff8['query'][_0x1180('0x83')][_0x1180('0x84')]('\x5c','\x5c\x5c')[_0x1180('0x84')]('\x27\x27',_0x1180('0x85'));if(qs[_0x1180('0x86')](_0x4c37dc)){_0x4a89e3['or']('i.id\x20LIKE\x20?',_0x4c37dc+'%');}else{_0x4a89e3['or'](_0x1180('0x87'),qs['getFullTextValue'](_0x4c37dc))['or']('i.from\x20LIKE\x20?',_0x4c37dc+'%')['or'](_0x1180('0x88'),_0x4c37dc+'%');}}}_0x4c0fc9['where'](_0x4a89e3);_0x4c0fc9[_0x1180('0x89')]('i.id');var _0x42ff60={'type':db[_0x1180('0x8a')][_0x1180('0x8b')][_0x1180('0x8c')],'raw':!![]};var _0x2fffc4=_0x4c0fc9['clone']();_0x2fffc4[_0x1180('0x48')]('i.id');_0x2fffc4[_0x1180('0x48')](_0x1180('0x8d'),_0x1180('0x5c'));if(_0x564d28[_0x1180('0x44')]){_0x564d28[_0x1180('0x44')][_0x1180('0x34')](function(_0x1bf034){_0x4c0fc9[_0x1180('0x44')]('i.'+_0x1bf034[0x0],_0x1bf034[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1180('0x74')](_0x39dd9c)){_0x4c0fc9[_0x1180('0x5d')](_0xc46ff1);_0x2fffc4[_0x1180('0x46')]('t.id\x20IN\x20?',_0x39dd9c);}BPromise[_0x1180('0x8e')]()[_0x1180('0x2c')](function(){if(!_0x21826d){if(_0xa2aff8[_0x1180('0x3b')]['OpenchannelAccountId']||_0xa2aff8['query'][_0x1180('0x8f')])return;_0x2fffc4[_0x1180('0x46')](_0x1180('0x90'));_0x4c0fc9[_0x1180('0x46')](_0x1180('0x90'));return;}return _0xa2aff8[_0x1180('0x91')][_0x1180('0x92')]({'attributes':['id'],'raw':!![]})[_0x1180('0x2c')](function(_0x4118a3){if(_[_0x1180('0x74')](_0x4118a3)){_0x2fffc4[_0x1180('0x46')](_0x1180('0x93'));_0x4c0fc9[_0x1180('0x46')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x2fffc4[_0x1180('0x46')](_0x1180('0x76'),_[_0x1180('0x31')](_0x4118a3,'id'));_0x4c0fc9['where'](_0x1180('0x76'),_[_0x1180('0x31')](_0x4118a3,'id'));}});})[_0x1180('0x2c')](function(){db['sequelize']['query'](_0x2fffc4[_0x1180('0x94')](),_0x42ff60)['then'](function(_0x4372eb){_0x2f2fc3['count']=_0x4372eb[_0x1180('0x41')];if(_0x2f2fc3['count']===0x0)return[];return db['sequelize']['query'](_0x17e6a8[_0x1180('0x94')](),_0x42ff60)['then'](function(_0x36715a){_0xdd574b=_[_0x1180('0x95')](_0x36715a,'id');_0x42ff60=_['merge'](_0x42ff60,{'model':db[_0x1180('0x96')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xa2aff8[_0x1180('0x3b')][_0x1180('0x40')]){_0x564d28[_0x1180('0x3e')][_0x1180('0x34')](function(_0x314e4d){_0x4c0fc9[_0x1180('0x48')]('i.'+_0x314e4d);});}else{_0x4c0fc9[_0x1180('0x48')](_0x1180('0x8d'),_0x1180('0x5c'));_0x4c0fc9[_0x1180('0x48')]('a.key',_0x1180('0x97'));_0x4c0fc9[_0x1180('0x48')](_0x1180('0x98'),'Account.mandatoryDisposition');_0x4c0fc9[_0x1180('0x48')](_0x1180('0x99'));_0x4c0fc9['field']('c.firstName',_0x1180('0x9a'));_0x4c0fc9[_0x1180('0x48')](_0x1180('0x9b'),_0x1180('0x9c'));_0x4c0fc9['field']('c.email',_0x1180('0x9d'));_0x4c0fc9['field'](_0x1180('0x9e'),_0x1180('0x9f'));_0x4c0fc9[_0x1180('0x48')]('c.mobile',_0x1180('0xa0'));_0x4c0fc9[_0x1180('0x48')](_0x1180('0xa1'),'Contact.fax');_0x4c0fc9[_0x1180('0x48')](_0x1180('0xa2'),_0x1180('0xa3'));_0x4c0fc9[_0x1180('0x48')](_0x1180('0xa4'),_0x1180('0xa5'));_0x4c0fc9[_0x1180('0x48')](_0x1180('0xa6'),'TagIds');}if(_0x564d28['limit'])_0x4c0fc9[_0x1180('0x26')](_0x564d28['limit']);if(_0x564d28[_0x1180('0x25')])_0x4c0fc9[_0x1180('0x25')](_0x564d28[_0x1180('0x25')]);return db['sequelize']['query'](_0x4c0fc9[_0x1180('0x94')](),_0x42ff60);})[_0x1180('0x2c')](function(_0x4ef66d){_0x2bade7['where'](_0x1180('0xa7'),_[_0x1180('0x31')](_0x4ef66d,'id'));return db[_0x1180('0xa8')][_0x1180('0x3b')](_0x2bade7['toString'](),_0x42ff60)['then'](function(_0x41b5e6){var _0x4c5cab=_[_0x1180('0xa9')](_0x41b5e6,'OpenchannelInteractionId');var _0x3d0d88=[];_0x4ef66d['forEach'](function(_0x4a1e5a){_0x3d0d88[_0x1180('0x35')](updateOpenchannelInteraction(_0x4a1e5a,_0xdd574b,_0x4c5cab));});return BPromise[_0x1180('0xaa')](_0x3d0d88);});});})[_0x1180('0x2c')](function(_0x2ebfea){_0x2f2fc3[_0x1180('0xab')]=_0x2ebfea;return _0x2f2fc3;})[_0x1180('0x2c')](respondWithFilteredResult(_0xb6167c,_0x564d28));})['catch'](handleError(_0xb6167c,null));};exports['show']=function(_0x42d1c9,_0x5eb61f){var _0x5dc550={'raw':![],'where':{'id':_0x42d1c9[_0x1180('0xac')]['id']}},_0x47bb95={};_0x47bb95[_0x1180('0x3a')]=_[_0x1180('0x3c')](db['OpenchannelInteraction']['rawAttributes']);_0x47bb95[_0x1180('0x3b')]=_[_0x1180('0x3c')](_0x42d1c9[_0x1180('0x3b')]);_0x47bb95[_0x1180('0x3d')]=_[_0x1180('0x3f')](_0x47bb95[_0x1180('0x3a')],_0x47bb95[_0x1180('0x3b')]);_0x5dc550[_0x1180('0x3e')]=_[_0x1180('0x3f')](_0x47bb95[_0x1180('0x3a')],qs[_0x1180('0x40')](_0x42d1c9[_0x1180('0x3b')][_0x1180('0x40')]));_0x5dc550['attributes']=_0x5dc550[_0x1180('0x3e')][_0x1180('0x41')]?_0x5dc550[_0x1180('0x3e')]:_0x47bb95[_0x1180('0x3a')];if(_0x42d1c9[_0x1180('0x3b')][_0x1180('0xad')]){_0x5dc550[_0x1180('0xae')]=[{'all':!![]}];}_0x5dc550=_[_0x1180('0xaf')]({},_0x5dc550,_0x42d1c9[_0x1180('0xb0')]);return db[_0x1180('0x96')][_0x1180('0x5b')](_0x5dc550)[_0x1180('0x2c')](handleEntityNotFound(_0x5eb61f,null))[_0x1180('0x2c')](respondWithResult(_0x5eb61f,null))['catch'](handleError(_0x5eb61f,null));};exports[_0x1180('0xb1')]=function(_0x44b7f6,_0x129e95){return db[_0x1180('0x96')][_0x1180('0xb1')](_0x44b7f6[_0x1180('0x71')],{})[_0x1180('0x2c')](respondWithResult(_0x129e95,0xc9))[_0x1180('0x36')](handleError(_0x129e95,null));};exports[_0x1180('0x2b')]=function(_0xcab93a,_0x1b865b){if(_0xcab93a[_0x1180('0x71')]['id']){delete _0xcab93a[_0x1180('0x71')]['id'];}return db['OpenchannelInteraction'][_0x1180('0x5b')]({'where':{'id':_0xcab93a['params']['id']}})[_0x1180('0x2c')](handleEntityNotFound(_0x1b865b,null))[_0x1180('0x2c')](saveUpdates(_0xcab93a['body'],null))[_0x1180('0x2c')](respondWithResult(_0x1b865b,null))[_0x1180('0x36')](handleError(_0x1b865b,null));};exports[_0x1180('0x2d')]=function(_0x10a93a,_0x5d4f81){return db[_0x1180('0x96')][_0x1180('0x5b')]({'where':{'id':_0x10a93a['params']['id']}})[_0x1180('0x2c')](handleEntityNotFound(_0x5d4f81,null))[_0x1180('0x2c')](removeEntity(_0x5d4f81,null))['catch'](handleError(_0x5d4f81,null));};exports[_0x1180('0xb2')]=function(_0x451d21,_0x5a9df7){return db[_0x1180('0x96')][_0x1180('0xb2')]()[_0x1180('0x2c')](respondWithResult(_0x5a9df7,null))[_0x1180('0x36')](handleError(_0x5a9df7,null));};exports[_0x1180('0xb3')]=function(_0xb35468,_0x391c7e,_0x769bb4){return db[_0x1180('0xb4')]['find']({'where':{'id':_0xb35468[_0x1180('0xac')]['id']}})['then'](handleEntityNotFound(_0x391c7e,null))[_0x1180('0x2c')](function(_0x39979e){if(_0x39979e){return _0x39979e[_0x1180('0xb3')](_0xb35468[_0x1180('0x71')][_0x1180('0xb5')],_['omit'](_0xb35468[_0x1180('0x71')],[_0x1180('0xb5'),'id'])||{});}})[_0x1180('0x2c')](respondWithResult(_0x391c7e,null))[_0x1180('0x36')](handleError(_0x391c7e,null));};exports[_0x1180('0xb6')]=function(_0x35872c,_0x44bc6f,_0x218e83){var _0x296917={'raw':![],'where':{}};var _0x2aa33b={};var _0x4e8b26={'count':0x0,'rows':[]};return db[_0x1180('0x96')][_0x1180('0xb7')]({'where':{'id':_0x35872c[_0x1180('0xac')]['id']}})[_0x1180('0x2c')](handleEntityNotFound(_0x44bc6f,null))[_0x1180('0x2c')](function(_0x1faa74){if(_0x1faa74){_0x2aa33b[_0x1180('0x3a')]=_['keys'](db[_0x1180('0xb4')][_0x1180('0x37')]);_0x2aa33b[_0x1180('0x3b')]=_[_0x1180('0x3c')](_0x35872c[_0x1180('0x3b')]);_0x2aa33b[_0x1180('0x3d')]=_[_0x1180('0x3f')](_0x2aa33b[_0x1180('0x3a')],_0x2aa33b[_0x1180('0x3b')]);_0x296917[_0x1180('0x3e')]=_['intersection'](_0x2aa33b[_0x1180('0x3a')],qs[_0x1180('0x40')](_0x35872c[_0x1180('0x3b')][_0x1180('0x40')]));_0x296917[_0x1180('0x3e')]=_0x296917['attributes'][_0x1180('0x41')]?_0x296917['attributes']:_0x2aa33b[_0x1180('0x3a')];if(!_0x35872c[_0x1180('0x3b')][_0x1180('0x42')](_0x1180('0x43'))){_0x296917['limit']=qs['limit'](_0x35872c[_0x1180('0x3b')][_0x1180('0x26')]);_0x296917[_0x1180('0x25')]=qs[_0x1180('0x25')](_0x35872c[_0x1180('0x3b')][_0x1180('0x25')]);}_0x296917['order']=qs['sort'](_0x35872c[_0x1180('0x3b')][_0x1180('0x45')]);_0x296917[_0x1180('0x46')]=qs['filters'](_[_0x1180('0xb8')](_0x35872c[_0x1180('0x3b')],_0x2aa33b[_0x1180('0x3d')]));_0x296917[_0x1180('0x46')][_0x1180('0xb9')]=_0x1faa74['id'];if(_0x35872c['query']['filter']){_0x296917[_0x1180('0x46')]=_[_0x1180('0xaf')](_0x296917[_0x1180('0x46')],{'$or':_[_0x1180('0x31')](_0x296917[_0x1180('0x3e')],function(_0xe48a5e){var _0x2ff78b={};_0x2ff78b[_0xe48a5e]={'$like':'%'+_0x35872c[_0x1180('0x3b')][_0x1180('0x83')]+'%'};return _0x2ff78b;})});}if(_0x35872c[_0x1180('0x3b')]['$gte']){var _0x540984=_0x35872c[_0x1180('0x3b')][_0x1180('0x79')][_0x1180('0x63')](',');var _0x28e066={};_0x28e066[_0x540984[0x0]]={'$gte':moment(_0x540984[0x1])['format'](_0x1180('0xba'))};_0x296917['where']=_[_0x1180('0xaf')](_0x296917[_0x1180('0x46')],_0x28e066);}_0x296917=_[_0x1180('0xaf')]({},_0x296917,_0x35872c[_0x1180('0xb0')]);return db['OpenchannelMessage']['count']({'where':_0x296917['where']})[_0x1180('0x2c')](function(_0x30eb9e){_0x4e8b26[_0x1180('0x24')]=_0x30eb9e;if(_0x35872c[_0x1180('0x3b')][_0x1180('0xad')]){_0x296917['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1180('0xbb')](_0x296917);})[_0x1180('0x2c')](function(_0x51d710){_0x4e8b26[_0x1180('0xab')]=_0x51d710;return _0x4e8b26;});}})['then'](respondWithFilteredResult(_0x44bc6f,_0x296917))[_0x1180('0x36')](handleError(_0x44bc6f,null));};exports[_0x1180('0xbc')]=function(_0x30258b,_0xe77c31,_0x51317a){return db[_0x1180('0x96')]['find']({'where':{'id':_0x30258b['params']['id']}})[_0x1180('0x2c')](handleEntityNotFound(_0xe77c31,null))[_0x1180('0x2c')](function(_0x429669){if(_0x429669){return _0x429669[_0x1180('0xbd')](_0x30258b[_0x1180('0x71')][_0x1180('0xb5')],_[_0x1180('0xbe')](_0x30258b['body'],[_0x1180('0xb5'),'id'])||{})[_0x1180('0xbf')](function(){return db[_0x1180('0x6b')][_0x1180('0xbb')]({'attributes':['id',_0x1180('0x2f'),_0x1180('0x49')],'where':{'id':_0x30258b[_0x1180('0x71')][_0x1180('0xb5')]}});})['then'](function(_0x53fb86){socket[_0x1180('0xc0')](_0x1180('0xc1'),{'id':Number(_0x30258b[_0x1180('0xac')]['id']),'tags':_0x53fb86||[]});return{'id':Number(_0x30258b[_0x1180('0xac')]['id']),'tags':_0x53fb86||[]};});}})[_0x1180('0x2c')](respondWithResult(_0xe77c31,null))['catch'](handleError(_0xe77c31,null));};exports[_0x1180('0xc2')]=function(_0x2262f4,_0x2ce442,_0x34e1f7){return db[_0x1180('0x96')][_0x1180('0x5b')]({'where':{'id':_0x2262f4[_0x1180('0xac')]['id']}})['then'](handleEntityNotFound(_0x2ce442,null))['then'](function(_0x5548ed){if(_0x5548ed){return _0x5548ed[_0x1180('0xc2')](_0x2262f4[_0x1180('0x3b')][_0x1180('0xb5')]);}})[_0x1180('0x2c')](respondWithStatusCode(_0x2ce442,null))['catch'](handleError(_0x2ce442,null));};exports[_0x1180('0xc3')]=function(_0xbf3afc,_0x401a4f){var _0x5f4555=moment()[_0x1180('0xc4')]()['toString']();var _0x2ee783=path[_0x1180('0xc5')](config[_0x1180('0xc6')],_0x1180('0xc7'),_0x1180('0xc8'),_0x1180('0xc9'));var _0x514dfa=path['join'](config[_0x1180('0xc6')],_0x1180('0xc7'),_0x1180('0xc8'),_0x1180('0xca'));var _0x3d8914=path[_0x1180('0xc5')](_0x2ee783,_0x5f4555);var _0x5b617a=util['format'](_0x1180('0xcb'),_0xbf3afc[_0x1180('0xac')]['id'],_0x5f4555);var _0x54afa8=path[_0x1180('0xc5')](_0x2ee783,_0x5b617a);var _0x6af76c=[];_0x6af76c[_0x1180('0x35')]({'model':db[_0x1180('0x6d')],'as':_0x1180('0x6d'),'attributes':['id','fullname'],'raw':!![]});_0x6af76c[_0x1180('0x35')]({'model':db[_0x1180('0xcc')],'as':_0x1180('0x60'),'attributes':['id','firstName',_0x1180('0xcd')],'raw':!![]});if(_0xbf3afc['query'][_0x1180('0xca')]){_0x6af76c[_0x1180('0x35')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x52ad74=[{'model':db[_0x1180('0xb4')],'as':'Messages','attributes':['id',_0x1180('0x71'),'createdAt',_0x1180('0xce'),_0x1180('0xcf'),_0x1180('0x7e')],'include':_0x6af76c}];_0x52ad74[_0x1180('0x35')]({'model':db['OpenchannelAccount'],'as':_0x1180('0xd0'),'attributes':['id',_0x1180('0x2f')]});_0x52ad74[_0x1180('0x35')]({'model':db['User'],'as':'Owner','attributes':['id',_0x1180('0xd1')]});return db[_0x1180('0x96')][_0x1180('0x5b')]({'where':{'id':_0xbf3afc[_0x1180('0xac')]['id']},'include':_0x52ad74})['then'](handleEntityNotFound(_0x401a4f,null))[_0x1180('0x2c')](function(_0x3fee5c){if(_0x3fee5c){var _0x45d3e1=_0x3fee5c[_0x1180('0xd2')]({'plain':!![]});fs[_0x1180('0xd3')](_0x3d8914);var _0x1a04cf={'format':'A4','border':_0x1180('0xd4'),'header':{'height':'40px','contents':{'first':'<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>'}},'footer':{'height':_0x1180('0xd5'),'contents':{'default':util[_0x1180('0xd6')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util[_0x1180('0xd6')]('%s\x20#%d','Openchannel',_0x45d3e1['id']),moment()[_0x1180('0xd6')](_0x1180('0xd7'))[_0x1180('0x94')]())}}};var _0x4daef9={'channel':_0x1180('0xd8'),'account':_0x45d3e1[_0x1180('0xd0')][_0x1180('0x2f')],'agent':_0x45d3e1[_0x1180('0xd9')]?_0x45d3e1[_0x1180('0xd9')][_0x1180('0xd1')]:_0x1180('0xda'),'createdAt':moment(_0x45d3e1[_0x1180('0x77')])[_0x1180('0xd6')](_0x1180('0xba'))[_0x1180('0x94')](),'closedAt':_0x45d3e1[_0x1180('0xdb')]?moment(_0x45d3e1[_0x1180('0xdc')])[_0x1180('0xd6')](_0x1180('0xba'))[_0x1180('0x94')]():'','disposition':_0x45d3e1[_0x1180('0xdd')],'visibility':_0x45d3e1[_0x1180('0xde')]?_0x1180('0xdf'):_0x1180('0xe0'),'messages':_(_0x45d3e1[_0x1180('0xe1')])['filter']({'secret':![]})[_0x1180('0x31')](function(_0x3c22ab){if(_0x3c22ab['Attachment']){var _0x250e8b=path[_0x1180('0xc5')](_0x514dfa,_0x3c22ab[_0x1180('0xe2')][_0x1180('0xe3')]);if(fs['existsSync'](_0x250e8b)){fs[_0x1180('0xe4')](_0x250e8b)[_0x1180('0xe5')](fs[_0x1180('0xe6')](path['join'](_0x3d8914,_0x3c22ab[_0x1180('0xe2')]['basename'])));}}return{'date':moment(_0x3c22ab[_0x1180('0x77')])['format'](_0x1180('0xba'))[_0x1180('0x94')](),'sender':_0x3c22ab[_0x1180('0xce')]===_0x1180('0xe7')?_0x3c22ab[_0x1180('0x6d')]?_0x3c22ab[_0x1180('0x6d')][_0x1180('0xd1')]:_0x1180('0xe8'):_0x3c22ab[_0x1180('0x60')][_0x1180('0xe9')]+(_0x3c22ab[_0x1180('0x60')][_0x1180('0xcd')]?'\x20'+_0x3c22ab[_0x1180('0x60')]['lastName']:''),'body':_0x3c22ab[_0x1180('0xe2')]?_0x3c22ab[_0x1180('0xe2')]['basename']:_0x3c22ab[_0x1180('0x71')],'direction':_0x3c22ab[_0x1180('0xce')]===_0x1180('0xe7')?'A':'C','secret':_0x3c22ab[_0x1180('0xcf')],'read':_0x3c22ab[_0x1180('0x7e')],'attachment':_0x3c22ab[_0x1180('0xe2')]};})[_0x1180('0x62')]()};return ejs['renderFile'](path['join'](config['root'],_0x1180('0xc7'),_0x1180('0xea'),_0x1180('0xeb')),{'interaction':_0x4daef9})[_0x1180('0x2c')](function(_0x71bb2c){return new BPromise(function(_0xa10c2e,_0x490f68){pdf[_0x1180('0xb1')](_0x71bb2c,_0x1a04cf)[_0x1180('0xec')](path['join'](_0x3d8914,_0x1180('0xed')+_0x45d3e1['id']+'-'+_0x5f4555+_0x1180('0xee')),function(_0x40e141,_0x3efb26){if(_0x40e141)return _0x490f68(_0x40e141);_0xa10c2e(_0x3efb26);});});})[_0x1180('0x2c')](function(){return new BPromise(function(_0x5be24f,_0x3356f1){zipdir(_0x3d8914,{'saveTo':_0x54afa8},function(_0x15b137,_0x83cd59){if(_0x15b137)return _0x3356f1(_0x15b137);return _0x5be24f(_0x83cd59);});})['then'](function(){return new BPromise(function(_0x4b6cbe,_0x552626){rimraf(_0x3d8914,function(_0x14074b){if(_0x14074b)_0x552626(_0x14074b);return _0x4b6cbe();});});})['then'](function(){return _0x401a4f['download'](_0x54afa8,_0x5b617a,function(_0x5e4452){if(_0x5e4452){console[_0x1180('0xef')](_0x1180('0xf0'),_0x5e4452);}else{fs[_0x1180('0xf1')](_0x54afa8);}});});});}else{return _0x401a4f[_0x1180('0x20')](0xc8);}})[_0x1180('0x36')](handleError(_0x401a4f,null));};
\ No newline at end of file
+var _0x3954=['$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','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','clone','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','keyBy','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','show','params','includeAll','include','merge','options','catch','create','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','emit','openchannelInteractionTags:save','removeTags','download','join','server','files','tmp','attachments','CmContact','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','get','mkdirSync','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','YYYY-MM-DD','Openchannel','Owner','N.A.','closed','closedAt','disposition','Private','basename','existsSync','createReadStream','createWriteStream','out','System','firstName','renderFile','root','views','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','push','index','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','start','body','some','compact','isEmpty','OpenchannelAccountId','concat','createdAt','parse','$gte'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3954,0x16d));var _0x4395=function(_0x23766d,_0xcbcb33){_0x23766d=_0x23766d-0x0;var _0x22e21e=_0x3954[_0x23766d];return _0x22e21e;};'use strict';var pdf=require(_0x4395('0x0'));var emlformat=require(_0x4395('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4395('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4395('0x3'));var moment=require(_0x4395('0x4'));var BPromise=require(_0x4395('0x5'));var Mustache=require(_0x4395('0x6'));var util=require(_0x4395('0x7'));var path=require(_0x4395('0x8'));var sox=require(_0x4395('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4395('0xa'));var squel=require(_0x4395('0xb'));var crypto=require(_0x4395('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4395('0xd'));var toCsv=require(_0x4395('0xe'));var querystring=require(_0x4395('0xf'));var Papa=require(_0x4395('0x10'));var Redis=require(_0x4395('0x11'));var authService=require(_0x4395('0x12'));var qs=require(_0x4395('0x13'));var as=require(_0x4395('0x14'));var hardwareService=require(_0x4395('0x15'));var logger=require(_0x4395('0x16'))(_0x4395('0x17'));var utils=require(_0x4395('0x18'));var config=require(_0x4395('0x19'));var db=require(_0x4395('0x1a'))['db'];config[_0x4395('0x1b')]=_['defaults'](config[_0x4395('0x1b')],{'host':_0x4395('0x1c'),'port':0x18eb});var socket=require(_0x4395('0x1d'))(new Redis(config['redis']));require(_0x4395('0x1e'))[_0x4395('0x1f')](socket);function respondWithStatusCode(_0x1dc7f6,_0x4a6ec2){_0x4a6ec2=_0x4a6ec2||0xcc;return function(_0x4a666c){if(_0x4a666c){return _0x1dc7f6[_0x4395('0x20')](_0x4a6ec2);}return _0x1dc7f6['status'](_0x4a6ec2)[_0x4395('0x21')]();};}function respondWithResult(_0x10cf4e,_0x322da3){_0x322da3=_0x322da3||0xc8;return function(_0x4109d4){if(_0x4109d4){return _0x10cf4e[_0x4395('0x22')](_0x322da3)[_0x4395('0x23')](_0x4109d4);}};}function respondWithFilteredResult(_0x294339,_0x562fd1){return function(_0x4f1d15){if(_0x4f1d15){var _0x5d5575=_0x4f1d15[_0x4395('0x24')],_0x4ac329=_0x562fd1[_0x4395('0x25')],_0x3c2ec9=_0x562fd1[_0x4395('0x25')]+_0x562fd1[_0x4395('0x26')],_0x569e12;if(_0x3c2ec9>=_0x5d5575){_0x3c2ec9=_0x5d5575;_0x569e12=0xc8;}else{_0x569e12=0xce;}_0x294339['status'](_0x569e12);return _0x294339['set'](_0x4395('0x27'),_0x4ac329+'-'+_0x3c2ec9+'/'+_0x5d5575)['json'](_0x4f1d15);}return null;};}function patchUpdates(_0x23f590){return function(_0x9528c){try{jsonpatch[_0x4395('0x28')](_0x9528c,_0x23f590,!![]);}catch(_0x179ffc){return BPromise['reject'](_0x179ffc);}return _0x9528c[_0x4395('0x29')]();};}function saveUpdates(_0x456d25,_0x20acc3){return function(_0x4b30b9){if(_0x4b30b9){return _0x4b30b9[_0x4395('0x2a')](_0x456d25)[_0x4395('0x2b')](function(_0x338d56){return _0x338d56;});}return null;};}function removeEntity(_0xb77236,_0x1de16f){return function(_0x3768db){if(_0x3768db){return _0x3768db[_0x4395('0x2c')]()['then'](function(){_0xb77236[_0x4395('0x22')](0xcc)[_0x4395('0x21')]();});}};}function handleEntityNotFound(_0x56fc47,_0x4c2603){return function(_0x3d4b3b){if(!_0x3d4b3b){_0x56fc47[_0x4395('0x20')](0x194);}return _0x3d4b3b;};}function handleError(_0x23f173,_0x493500){_0x493500=_0x493500||0x1f4;return function(_0x463c04){logger['error'](_0x463c04[_0x4395('0x2d')]);if(_0x463c04['name']){delete _0x463c04[_0x4395('0x2e')];}_0x23f173['status'](_0x493500)[_0x4395('0x2f')](_0x463c04);};}function getInteractionUsers(_0x355a7,_0x496eb3){return new BPromise(function(_0x124a3b,_0x23caa5){try{if(_0x496eb3[_0x355a7['id']]){_0x355a7[_0x4395('0x30')]=_[_0x4395('0x31')](_0x496eb3[_0x355a7['id']],function(_0x3ec303){return{'id':_0x3ec303['id'],'fullname':_0x3ec303[_0x4395('0x32')]};});}}catch(_0x3dd2a3){_0x23caa5(_0x3dd2a3);}_0x124a3b(_0x355a7);});}function getInteractionTags(_0x4a9f00,_0x10fcb3){return new BPromise(function(_0x1ecc84,_0x175328){try{if(_0x4a9f00['TagIds']){_0x4a9f00[_0x4395('0x33')]=[];_0x4a9f00[_0x4395('0x34')][_0x4395('0x35')](',')[_0x4395('0x36')](function(_0x5cd3ec){_0x4a9f00['Tags'][_0x4395('0x37')](_0x10fcb3[_0x5cd3ec]);});}delete _0x4a9f00[_0x4395('0x34')];}catch(_0x3a5871){_0x175328(_0x3a5871);}_0x1ecc84(_0x4a9f00);});}function updateOpenchannelInteraction(_0x4544f4,_0x434764,_0x28cb8f){return new BPromise(function(_0x5bc62c,_0x42dd48){return getInteractionUsers(_0x4544f4,_0x28cb8f)[_0x4395('0x2b')](function(_0x3a95f0){return getInteractionTags(_0x3a95f0,_0x434764);})['then'](function(_0x422c15){_0x5bc62c(_0x422c15);})['catch'](function(_0x1fe7ac){_0x42dd48(_0x1fe7ac);});});}exports[_0x4395('0x38')]=function(_0x2bf58e,_0x57dc22){var _0x5929fb={},_0x2857e8={},_0x477006={'count':0x0,'rows':[]};var _0x3ade9e=_[_0x4395('0x31')](db['OpenchannelInteraction'][_0x4395('0x39')],function(_0x1a9cb6){return{'name':_0x1a9cb6[_0x4395('0x3a')],'type':_0x1a9cb6[_0x4395('0x3b')][_0x4395('0x3c')]};});_0x2857e8[_0x4395('0x3d')]=_[_0x4395('0x31')](_0x3ade9e,_0x4395('0x2e'));_0x2857e8[_0x4395('0x3e')]=_[_0x4395('0x3f')](_0x2bf58e[_0x4395('0x3e')]);_0x2857e8['filters']=_['intersection'](_0x2857e8[_0x4395('0x3d')],_0x2857e8[_0x4395('0x3e')]);_0x5929fb[_0x4395('0x40')]=_[_0x4395('0x41')](_0x2857e8[_0x4395('0x3d')],qs[_0x4395('0x42')](_0x2bf58e[_0x4395('0x3e')][_0x4395('0x42')]));_0x5929fb[_0x4395('0x40')]=_0x5929fb['attributes'][_0x4395('0x43')]?_0x5929fb[_0x4395('0x40')]:_0x2857e8[_0x4395('0x3d')];if(!_0x2bf58e[_0x4395('0x3e')]['hasOwnProperty'](_0x4395('0x44'))){_0x5929fb[_0x4395('0x26')]=qs[_0x4395('0x26')](_0x2bf58e[_0x4395('0x3e')][_0x4395('0x26')]);_0x5929fb['offset']=qs[_0x4395('0x25')](_0x2bf58e['query'][_0x4395('0x25')]);}_0x5929fb[_0x4395('0x45')]=qs[_0x4395('0x46')](_0x2bf58e['query'][_0x4395('0x46')]);_0x5929fb[_0x4395('0x47')]=qs[_0x4395('0x48')](_[_0x4395('0x49')](_0x2bf58e[_0x4395('0x3e')],_0x2857e8[_0x4395('0x48')]),_0x3ade9e);var _0x41a9a5=[];var _0x5848ba=squel[_0x4395('0x4a')]()['field']('id')[_0x4395('0x4b')](_0x4395('0x2e'))[_0x4395('0x4b')](_0x4395('0x4c'))['from'](_0x4395('0x4d'));var _0x5792e6=squel[_0x4395('0x4a')]()[_0x4395('0x4b')](_0x4395('0x4e'))['field'](_0x4395('0x4f'))['field'](_0x4395('0x50'))[_0x4395('0x51')](_0x4395('0x52'),'ui')[_0x4395('0x53')]('users','u',_0x4395('0x54'));var _0x51b0c8=squel[_0x4395('0x4a')]()[_0x4395('0x51')](_0x4395('0x55'),'i')[_0x4395('0x53')](_0x4395('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x4395('0x53')]('users','o',_0x4395('0x57'))['left_join'](_0x4395('0x58'),'a',_0x4395('0x59'))[_0x4395('0x53')](_0x4395('0x5a'),'me',_0x4395('0x5b'))[_0x4395('0x53')]('openchannel_interaction_has_tags','it',_0x4395('0x5c'))[_0x4395('0x53')](_0x4395('0x4d'),'t','t.id\x20=\x20it.TagId');var _0x37dd78=squel[_0x4395('0x5d')]();var _0x434fea=[];var _0x2d62e2=squel[_0x4395('0x5d')]();var _0x4e341f;if(_0x2bf58e[_0x4395('0x3e')]['search']){_0x4e341f=as['parseSearch'](_0x2bf58e[_0x4395('0x3e')][_0x4395('0x5e')]);var _0x532cc7=_0x4e341f[_0x4395('0x5f')];for(var _0xf017dc=0x0;_0xf017dc<_0x4e341f['conditions'][_0x4395('0x43')];_0xf017dc++){var _0x292319=_0x4e341f[_0x4395('0x60')][_0xf017dc];var _0x212867='i';var _0x549992=_[_0x4395('0x61')](_0x3ade9e,[_0x4395('0x2e'),_0x292319[_0x4395('0x4b')]]);if(!_0x549992){switch(_0x292319[_0x4395('0x4b')]){case _0x4395('0x62'):if(_0x292319[_0x4395('0x63')]==0x1){_0x51b0c8[_0x4395('0x64')]('`'+_0x292319['field']+_0x4395('0x65'));}else{_0x51b0c8[_0x4395('0x64')]('`'+_0x292319['field']+_0x4395('0x66'));}break;case _0x4395('0x67'):if(_0x292319[_0x4395('0x68')]===_0x4395('0x69')){if(_0x292319['value'][_0x4395('0x35')]('\x20')[_0x4395('0x43')]>0x1){_0x37dd78[_0x532cc7](_0x4395('0x6a'),qs[_0x4395('0x6b')](_0x292319[_0x4395('0x63')]),null);}else{var _0x5d09e3='%'+_0x292319[_0x4395('0x63')]+'%';_0x37dd78[_0x532cc7](_0x4395('0x6c'),_0x5d09e3,_0x5d09e3,_0x5d09e3);}}else{_0x549992=_[_0x4395('0x61')](_0x3ade9e,[_0x4395('0x2e'),_0x4395('0x6d')]);_0x292319[_0x4395('0x4b')]=_0x4395('0x6d');_0x172afb=as[_0x4395('0x6e')](_0x212867,_0x549992[_0x4395('0x3b')],_0x292319);_0x37dd78[_0x532cc7](_0x172afb['text'],_0x172afb[_0x4395('0x63')]['start'],_0x172afb[_0x4395('0x63')][_0x4395('0x21')]);}break;case'Tag':var _0x582e37=_0x292319[_0x4395('0x63')][_0x4395('0x35')](',')[_0x4395('0x31')](function(_0x1b40ad){return Number(_0x1b40ad);});_0x582e37['forEach'](function(_0x35532b){_0x2d62e2['or'](_0x4395('0x6f'),'%,'+_0x35532b+',%');});_0x434fea=_[_0x4395('0x70')](_0x434fea,_0x582e37);break;case _0x4395('0x71'):if(_0x292319[_0x4395('0x68')]===_0x4395('0x69')){_0x37dd78[_0x532cc7](_0x4395('0x72'),'%'+_0x292319[_0x4395('0x63')]+'%',null);}else{_0x549992=_[_0x4395('0x61')](_0x3ade9e,['name',_0x4395('0x73')]);_0x292319[_0x4395('0x4b')]=_0x4395('0x73');_0x172afb=as[_0x4395('0x6e')](_0x212867,_0x549992[_0x4395('0x3b')],_0x292319);_0x37dd78[_0x532cc7](_0x172afb[_0x4395('0x74')],_0x172afb[_0x4395('0x63')][_0x4395('0x75')],_0x172afb[_0x4395('0x63')][_0x4395('0x21')]);}break;case _0x4395('0x76'):_0x172afb=as[_0x4395('0x6e')]('me',null,_0x292319);_0x37dd78[_0x532cc7](_0x172afb[_0x4395('0x74')],_0x172afb[_0x4395('0x63')][_0x4395('0x75')],_0x172afb['value'][_0x4395('0x21')]);break;}}else{var _0x172afb=as[_0x4395('0x6e')](_0x212867,_0x549992[_0x4395('0x3b')],_0x292319);_0x37dd78[_0x532cc7](_0x172afb[_0x4395('0x74')],_0x172afb['value']['start'],_0x172afb[_0x4395('0x63')][_0x4395('0x21')]);}}}else{var _0x2444e8=_(_0x2bf58e[_0x4395('0x3e')])[_0x4395('0x3f')]()[_0x4395('0x31')](function(_0x162213){return _[_0x4395('0x77')](_0x3ade9e,[_0x4395('0x2e'),_0x162213])?_0x162213:undefined;})[_0x4395('0x78')]()[_0x4395('0x63')]();if(!_[_0x4395('0x79')](_0x2444e8)){_0x2444e8[_0x4395('0x36')](function(_0x5b3cf8){if(_0x5b3cf8===_0x4395('0x7a')){_0x51b0c8[_0x4395('0x47')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x4395('0x7b')](_0x2bf58e['query'][_0x5b3cf8]));}else if(_0x5b3cf8===_0x4395('0x7c')){var _0x39b50d=JSON[_0x4395('0x7d')](_0x2bf58e[_0x4395('0x3e')][_0x5b3cf8])[_0x4395('0x7e')];var _0x2ed656=JSON[_0x4395('0x7d')](_0x2bf58e['query'][_0x5b3cf8])[_0x4395('0x7f')];_0x51b0c8[_0x4395('0x47')](_0x4395('0x80'),_0x39b50d,_0x2ed656);}else{if(_0x2bf58e[_0x4395('0x3e')][_0x5b3cf8]==='null'){_0x51b0c8[_0x4395('0x47')]('i.'+_0x5b3cf8+'\x20IS\x20NULL');}else{_0x51b0c8['where']('i.'+_0x5b3cf8+_0x4395('0x81'),_0x2bf58e[_0x4395('0x3e')][_0x5b3cf8]);}}});}if(_0x2bf58e['query'][_0x4395('0x82')]){if(_0x2bf58e[_0x4395('0x3e')][_0x4395('0x82')]==0x1){_0x51b0c8[_0x4395('0x64')](_0x4395('0x83'));}else{_0x51b0c8[_0x4395('0x64')](_0x4395('0x84'));}}if(_0x2bf58e[_0x4395('0x3e')][_0x4395('0x85')]){_0x434fea=_[_0x4395('0x86')](_0x2bf58e['query'][_0x4395('0x85')])?_0x2bf58e[_0x4395('0x3e')][_0x4395('0x85')]:new Array(_0x2bf58e[_0x4395('0x3e')][_0x4395('0x85')]);_0x434fea[_0x4395('0x36')](function(_0x128626){_0x2d62e2['or'](_0x4395('0x6f'),'%,'+_0x128626+',%');});}if(_0x2bf58e['query']['filter']){var _0x4b64d3=_0x2bf58e[_0x4395('0x3e')]['filter']['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x4b64d3)){_0x37dd78['or'](_0x4395('0x87'),_0x4b64d3+'%');}else{_0x37dd78['or'](_0x4395('0x88'),qs[_0x4395('0x6b')](_0x4b64d3))['or'](_0x4395('0x89'),_0x4b64d3+'%')['or'](_0x4395('0x8a'),_0x4b64d3+'%');}}}_0x51b0c8[_0x4395('0x47')](_0x37dd78);_0x51b0c8[_0x4395('0x8b')](_0x4395('0x8c'));var _0x14f956={'type':db['Sequelize'][_0x4395('0x8d')][_0x4395('0x8e')],'raw':!![]};var _0x52dfe2=_0x51b0c8[_0x4395('0x8f')]();_0x52dfe2[_0x4395('0x4b')]('i.id');_0x52dfe2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4395('0x62'));if(_0x5929fb['order']){_0x5929fb['order'][_0x4395('0x36')](function(_0xc0d0ed){_0x51b0c8[_0x4395('0x45')]('i.'+_0xc0d0ed[0x0],_0xc0d0ed[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x434fea)){_0x51b0c8[_0x4395('0x64')](_0x2d62e2);_0x52dfe2[_0x4395('0x47')](_0x4395('0x90'),_0x434fea);}BPromise[_0x4395('0x91')]()[_0x4395('0x2b')](function(){if(!_0x4e341f){if(_0x2bf58e[_0x4395('0x3e')][_0x4395('0x7a')]||_0x2bf58e['query'][_0x4395('0x92')])return;_0x52dfe2[_0x4395('0x47')](_0x4395('0x93'));_0x51b0c8[_0x4395('0x47')](_0x4395('0x93'));return;}return _0x2bf58e['user'][_0x4395('0x94')]({'attributes':['id'],'raw':!![]})[_0x4395('0x2b')](function(_0x518e55){if(_[_0x4395('0x79')](_0x518e55)){_0x52dfe2[_0x4395('0x47')](_0x4395('0x95'));_0x51b0c8[_0x4395('0x47')](_0x4395('0x95'));}else{_0x52dfe2[_0x4395('0x47')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x518e55,'id'));_0x51b0c8[_0x4395('0x47')](_0x4395('0x96'),_[_0x4395('0x31')](_0x518e55,'id'));}});})[_0x4395('0x2b')](function(){db['sequelize'][_0x4395('0x3e')](_0x52dfe2[_0x4395('0x97')](),_0x14f956)[_0x4395('0x2b')](function(_0xb4a6a9){_0x477006[_0x4395('0x24')]=_0xb4a6a9[_0x4395('0x43')];if(_0x477006[_0x4395('0x24')]===0x0)return[];return db[_0x4395('0x98')][_0x4395('0x3e')](_0x5848ba[_0x4395('0x97')](),_0x14f956)[_0x4395('0x2b')](function(_0xd19f0a){_0x41a9a5=_[_0x4395('0x99')](_0xd19f0a,'id');_0x14f956=_['merge'](_0x14f956,{'model':db[_0x4395('0x9a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2bf58e['query']['fields']){_0x5929fb[_0x4395('0x40')][_0x4395('0x36')](function(_0x5cfd76){_0x51b0c8[_0x4395('0x4b')]('i.'+_0x5cfd76);});}else{_0x51b0c8['field'](_0x4395('0x9b'),_0x4395('0x62'));_0x51b0c8[_0x4395('0x4b')](_0x4395('0x9c'),_0x4395('0x9d'));_0x51b0c8[_0x4395('0x4b')](_0x4395('0x9e'),_0x4395('0x9f'));_0x51b0c8[_0x4395('0x4b')]('i.*');_0x51b0c8[_0x4395('0x4b')](_0x4395('0xa0'),_0x4395('0xa1'));_0x51b0c8[_0x4395('0x4b')]('c.lastName','Contact.lastName');_0x51b0c8[_0x4395('0x4b')]('c.email',_0x4395('0xa2'));_0x51b0c8[_0x4395('0x4b')](_0x4395('0xa3'),'Contact.phone');_0x51b0c8[_0x4395('0x4b')](_0x4395('0xa4'),_0x4395('0xa5'));_0x51b0c8[_0x4395('0x4b')](_0x4395('0xa6'),_0x4395('0xa7'));_0x51b0c8[_0x4395('0x4b')](_0x4395('0xa8'),_0x4395('0xa9'));_0x51b0c8[_0x4395('0x4b')](_0x4395('0xaa'),'Owner.internal');_0x51b0c8['field'](_0x4395('0xab'),'TagIds');}if(_0x5929fb[_0x4395('0x26')])_0x51b0c8[_0x4395('0x26')](_0x5929fb['limit']);if(_0x5929fb[_0x4395('0x25')])_0x51b0c8[_0x4395('0x25')](_0x5929fb[_0x4395('0x25')]);return db['sequelize'][_0x4395('0x3e')](_0x51b0c8[_0x4395('0x97')](),_0x14f956);})['then'](function(_0xe04f11){_0x5792e6[_0x4395('0x47')](_0x4395('0xac'),_[_0x4395('0x31')](_0xe04f11,'id'));return db['sequelize']['query'](_0x5792e6[_0x4395('0x97')](),_0x14f956)[_0x4395('0x2b')](function(_0xfc7eaa){var _0x5610bf=_['groupBy'](_0xfc7eaa,_0x4395('0xad'));var _0x5a5e74=[];_0xe04f11['forEach'](function(_0x2ec4f8){_0x5a5e74['push'](updateOpenchannelInteraction(_0x2ec4f8,_0x41a9a5,_0x5610bf));});return BPromise[_0x4395('0xae')](_0x5a5e74);});});})[_0x4395('0x2b')](function(_0x154373){_0x477006['rows']=_0x154373;return _0x477006;})['then'](respondWithFilteredResult(_0x57dc22,_0x5929fb));})['catch'](handleError(_0x57dc22,null));};exports[_0x4395('0xaf')]=function(_0x4946ee,_0x470cd7){var _0x2668c5={'raw':![],'where':{'id':_0x4946ee[_0x4395('0xb0')]['id']}},_0x17c1bc={};_0x17c1bc[_0x4395('0x3d')]=_[_0x4395('0x3f')](db[_0x4395('0x9a')][_0x4395('0x39')]);_0x17c1bc[_0x4395('0x3e')]=_['keys'](_0x4946ee[_0x4395('0x3e')]);_0x17c1bc[_0x4395('0x48')]=_[_0x4395('0x41')](_0x17c1bc[_0x4395('0x3d')],_0x17c1bc[_0x4395('0x3e')]);_0x2668c5['attributes']=_[_0x4395('0x41')](_0x17c1bc[_0x4395('0x3d')],qs['fields'](_0x4946ee[_0x4395('0x3e')][_0x4395('0x42')]));_0x2668c5['attributes']=_0x2668c5[_0x4395('0x40')][_0x4395('0x43')]?_0x2668c5[_0x4395('0x40')]:_0x17c1bc['model'];if(_0x4946ee['query'][_0x4395('0xb1')]){_0x2668c5[_0x4395('0xb2')]=[{'all':!![]}];}_0x2668c5=_[_0x4395('0xb3')]({},_0x2668c5,_0x4946ee[_0x4395('0xb4')]);return db[_0x4395('0x9a')][_0x4395('0x61')](_0x2668c5)['then'](handleEntityNotFound(_0x470cd7,null))[_0x4395('0x2b')](respondWithResult(_0x470cd7,null))[_0x4395('0xb5')](handleError(_0x470cd7,null));};exports['create']=function(_0xba8b45,_0x2c4f4c){return db[_0x4395('0x9a')][_0x4395('0xb6')](_0xba8b45[_0x4395('0x76')],{})[_0x4395('0x2b')](respondWithResult(_0x2c4f4c,0xc9))[_0x4395('0xb5')](handleError(_0x2c4f4c,null));};exports['update']=function(_0x1ba02c,_0x42ca28){if(_0x1ba02c[_0x4395('0x76')]['id']){delete _0x1ba02c[_0x4395('0x76')]['id'];}return db[_0x4395('0x9a')]['find']({'where':{'id':_0x1ba02c[_0x4395('0xb0')]['id']}})[_0x4395('0x2b')](handleEntityNotFound(_0x42ca28,null))[_0x4395('0x2b')](saveUpdates(_0x1ba02c['body'],null))[_0x4395('0x2b')](respondWithResult(_0x42ca28,null))[_0x4395('0xb5')](handleError(_0x42ca28,null));};exports[_0x4395('0x2c')]=function(_0x3b3b3e,_0x220d61){return db[_0x4395('0x9a')][_0x4395('0x61')]({'where':{'id':_0x3b3b3e[_0x4395('0xb0')]['id']}})[_0x4395('0x2b')](handleEntityNotFound(_0x220d61,null))[_0x4395('0x2b')](removeEntity(_0x220d61,null))[_0x4395('0xb5')](handleError(_0x220d61,null));};exports[_0x4395('0xb7')]=function(_0x689d34,_0x1ec410){return db[_0x4395('0x9a')][_0x4395('0xb7')]()[_0x4395('0x2b')](respondWithResult(_0x1ec410,null))['catch'](handleError(_0x1ec410,null));};exports['addMessage']=function(_0xb7bdf5,_0xafa428,_0x1fa152){return db[_0x4395('0xb8')][_0x4395('0x61')]({'where':{'id':_0xb7bdf5[_0x4395('0xb0')]['id']}})[_0x4395('0x2b')](handleEntityNotFound(_0xafa428,null))[_0x4395('0x2b')](function(_0x80452){if(_0x80452){return _0x80452[_0x4395('0xb9')](_0xb7bdf5[_0x4395('0x76')][_0x4395('0xba')],_[_0x4395('0xbb')](_0xb7bdf5[_0x4395('0x76')],['ids','id'])||{});}})[_0x4395('0x2b')](respondWithResult(_0xafa428,null))[_0x4395('0xb5')](handleError(_0xafa428,null));};exports[_0x4395('0xbc')]=function(_0x484522,_0x106e77,_0x3fd4d5){var _0x4d046f={'raw':![],'where':{}};var _0x442ceb={};var _0x39f7dd={'count':0x0,'rows':[]};return db[_0x4395('0x9a')][_0x4395('0xbd')]({'where':{'id':_0x484522[_0x4395('0xb0')]['id']}})[_0x4395('0x2b')](handleEntityNotFound(_0x106e77,null))[_0x4395('0x2b')](function(_0xd2eaac){if(_0xd2eaac){_0x442ceb[_0x4395('0x3d')]=_[_0x4395('0x3f')](db['OpenchannelMessage'][_0x4395('0x39')]);_0x442ceb['query']=_[_0x4395('0x3f')](_0x484522[_0x4395('0x3e')]);_0x442ceb[_0x4395('0x48')]=_[_0x4395('0x41')](_0x442ceb['model'],_0x442ceb['query']);_0x4d046f['attributes']=_[_0x4395('0x41')](_0x442ceb[_0x4395('0x3d')],qs[_0x4395('0x42')](_0x484522[_0x4395('0x3e')][_0x4395('0x42')]));_0x4d046f['attributes']=_0x4d046f[_0x4395('0x40')][_0x4395('0x43')]?_0x4d046f[_0x4395('0x40')]:_0x442ceb[_0x4395('0x3d')];if(!_0x484522[_0x4395('0x3e')][_0x4395('0xbe')]('nolimit')){_0x4d046f['limit']=qs['limit'](_0x484522[_0x4395('0x3e')][_0x4395('0x26')]);_0x4d046f[_0x4395('0x25')]=qs['offset'](_0x484522[_0x4395('0x3e')][_0x4395('0x25')]);}_0x4d046f[_0x4395('0x45')]=qs[_0x4395('0x46')](_0x484522['query'][_0x4395('0x46')]);_0x4d046f[_0x4395('0x47')]=qs[_0x4395('0x48')](_['pick'](_0x484522[_0x4395('0x3e')],_0x442ceb[_0x4395('0x48')]));_0x4d046f['where'][_0x4395('0xad')]=_0xd2eaac['id'];if(_0x484522[_0x4395('0x3e')]['filter']){_0x4d046f[_0x4395('0x47')]=_[_0x4395('0xb3')](_0x4d046f[_0x4395('0x47')],{'$or':_['map'](_0x4d046f[_0x4395('0x40')],function(_0x1f62fc){var _0x1b1a75={};_0x1b1a75[_0x1f62fc]={'$like':'%'+_0x484522[_0x4395('0x3e')][_0x4395('0xbf')]+'%'};return _0x1b1a75;})});}if(_0x484522[_0x4395('0x3e')]['$gte']){var _0x40bee8=_0x484522[_0x4395('0x3e')]['$gte']['split'](',');var _0x47c0b0={};_0x47c0b0[_0x40bee8[0x0]]={'$gte':moment(_0x40bee8[0x1])[_0x4395('0xc0')](_0x4395('0xc1'))};_0x4d046f['where']=_[_0x4395('0xb3')](_0x4d046f['where'],_0x47c0b0);}_0x4d046f=_[_0x4395('0xb3')]({},_0x4d046f,_0x484522['options']);return db[_0x4395('0xb8')][_0x4395('0x24')]({'where':_0x4d046f[_0x4395('0x47')]})[_0x4395('0x2b')](function(_0x25764f){_0x39f7dd[_0x4395('0x24')]=_0x25764f;if(_0x484522[_0x4395('0x3e')][_0x4395('0xb1')]){_0x4d046f[_0x4395('0xb2')]=[{'all':!![]}];}return db[_0x4395('0xb8')][_0x4395('0xc2')](_0x4d046f);})[_0x4395('0x2b')](function(_0x505cb2){_0x39f7dd[_0x4395('0xc3')]=_0x505cb2;return _0x39f7dd;});}})[_0x4395('0x2b')](respondWithFilteredResult(_0x106e77,_0x4d046f))[_0x4395('0xb5')](handleError(_0x106e77,null));};exports[_0x4395('0xc4')]=function(_0x5c4d8d,_0x62e0a2,_0x45d96a){return db['OpenchannelInteraction']['find']({'where':{'id':_0x5c4d8d['params']['id']}})['then'](handleEntityNotFound(_0x62e0a2,null))['then'](function(_0x11fdef){if(_0x11fdef){return _0x11fdef[_0x4395('0xc5')](_0x5c4d8d[_0x4395('0x76')][_0x4395('0xba')],_[_0x4395('0xbb')](_0x5c4d8d[_0x4395('0x76')],['ids','id'])||{})[_0x4395('0xc6')](function(){return db[_0x4395('0xc7')][_0x4395('0xc2')]({'attributes':['id','name',_0x4395('0x4c')],'where':{'id':_0x5c4d8d[_0x4395('0x76')][_0x4395('0xba')]}});})[_0x4395('0x2b')](function(_0x433d3b){socket[_0x4395('0xc8')](_0x4395('0xc9'),{'id':Number(_0x5c4d8d['params']['id']),'tags':_0x433d3b||[]});return{'id':Number(_0x5c4d8d[_0x4395('0xb0')]['id']),'tags':_0x433d3b||[]};});}})[_0x4395('0x2b')](respondWithResult(_0x62e0a2,null))[_0x4395('0xb5')](handleError(_0x62e0a2,null));};exports[_0x4395('0xca')]=function(_0x4df0f4,_0x240d4c,_0x253976){return db[_0x4395('0x9a')]['find']({'where':{'id':_0x4df0f4[_0x4395('0xb0')]['id']}})['then'](handleEntityNotFound(_0x240d4c,null))[_0x4395('0x2b')](function(_0x5631b0){if(_0x5631b0){return _0x5631b0[_0x4395('0xca')](_0x4df0f4[_0x4395('0x3e')][_0x4395('0xba')]);}})['then'](respondWithStatusCode(_0x240d4c,null))[_0x4395('0xb5')](handleError(_0x240d4c,null));};exports[_0x4395('0xcb')]=function(_0x30ae4b,_0x51972f){var _0x26800b=moment()['unix']()[_0x4395('0x97')]();var _0x24f89e=path[_0x4395('0xcc')](config['root'],_0x4395('0xcd'),_0x4395('0xce'),_0x4395('0xcf'));var _0xaed8f4=path[_0x4395('0xcc')](config['root'],_0x4395('0xcd'),'files',_0x4395('0xd0'));var _0x9873f0=path['join'](_0x24f89e,_0x26800b);var _0x3d1a6f=util['format']('transcript-%d-%s.zip',_0x30ae4b[_0x4395('0xb0')]['id'],_0x26800b);var _0x1584d9=path[_0x4395('0xcc')](_0x24f89e,_0x3d1a6f);var _0x10ec23=[];_0x10ec23[_0x4395('0x37')]({'model':db[_0x4395('0x71')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x10ec23[_0x4395('0x37')]({'model':db[_0x4395('0xd1')],'as':_0x4395('0x67'),'attributes':['id','firstName',_0x4395('0xd2')],'raw':!![]});if(_0x30ae4b[_0x4395('0x3e')][_0x4395('0xd0')]){_0x10ec23[_0x4395('0x37')]({'model':db[_0x4395('0xd3')],'as':_0x4395('0xd3'),'raw':!![]});}var _0x1b2fa0=[{'model':db['OpenchannelMessage'],'as':_0x4395('0xd4'),'attributes':['id',_0x4395('0x76'),_0x4395('0x7c'),_0x4395('0xd5'),_0x4395('0xd6'),_0x4395('0x82')],'include':_0x10ec23}];_0x1b2fa0[_0x4395('0x37')]({'model':db[_0x4395('0xd7')],'as':_0x4395('0xd8'),'attributes':['id','name']});_0x1b2fa0[_0x4395('0x37')]({'model':db[_0x4395('0x71')],'as':'Owner','attributes':['id',_0x4395('0x32')]});return db[_0x4395('0x9a')][_0x4395('0x61')]({'where':{'id':_0x30ae4b[_0x4395('0xb0')]['id']},'include':_0x1b2fa0})[_0x4395('0x2b')](handleEntityNotFound(_0x51972f,null))[_0x4395('0x2b')](function(_0x50282c){if(_0x50282c){var _0x17323b=_0x50282c[_0x4395('0xd9')]({'plain':!![]});fs[_0x4395('0xda')](_0x9873f0);var _0x53a35a={'format':'A4','border':_0x4395('0xdb'),'header':{'height':_0x4395('0xdc'),'contents':{'first':_0x4395('0xdd')}},'footer':{'height':'30px','contents':{'default':util[_0x4395('0xc0')](_0x4395('0xde'),util[_0x4395('0xc0')]('%s\x20#%d','Openchannel',_0x17323b['id']),moment()[_0x4395('0xc0')](_0x4395('0xdf'))[_0x4395('0x97')]())}}};var _0x430954={'channel':_0x4395('0xe0'),'account':_0x17323b[_0x4395('0xd8')]['name'],'agent':_0x17323b[_0x4395('0xe1')]?_0x17323b['Owner']['fullname']:_0x4395('0xe2'),'createdAt':moment(_0x17323b[_0x4395('0x7c')])[_0x4395('0xc0')](_0x4395('0xc1'))[_0x4395('0x97')](),'closedAt':_0x17323b[_0x4395('0xe3')]?moment(_0x17323b[_0x4395('0xe4')])[_0x4395('0xc0')](_0x4395('0xc1'))[_0x4395('0x97')]():'','disposition':_0x17323b[_0x4395('0xe5')],'visibility':_0x17323b['threadId']?'Public':_0x4395('0xe6'),'messages':_(_0x17323b[_0x4395('0xd4')])[_0x4395('0xbf')]({'secret':![]})['map'](function(_0x479976){if(_0x479976['Attachment']){var _0x27c05=path[_0x4395('0xcc')](_0xaed8f4,_0x479976[_0x4395('0xd3')][_0x4395('0xe7')]);if(fs[_0x4395('0xe8')](_0x27c05)){fs[_0x4395('0xe9')](_0x27c05)['pipe'](fs[_0x4395('0xea')](path['join'](_0x9873f0,_0x479976[_0x4395('0xd3')][_0x4395('0xe7')])));}}return{'date':moment(_0x479976[_0x4395('0x7c')])[_0x4395('0xc0')](_0x4395('0xc1'))[_0x4395('0x97')](),'sender':_0x479976[_0x4395('0xd5')]===_0x4395('0xeb')?_0x479976[_0x4395('0x71')]?_0x479976[_0x4395('0x71')][_0x4395('0x32')]:_0x4395('0xec'):_0x479976[_0x4395('0x67')][_0x4395('0xed')]+(_0x479976[_0x4395('0x67')]['lastName']?'\x20'+_0x479976['Contact'][_0x4395('0xd2')]:''),'body':_0x479976['Attachment']?_0x479976[_0x4395('0xd3')][_0x4395('0xe7')]:_0x479976[_0x4395('0x76')],'direction':_0x479976[_0x4395('0xd5')]===_0x4395('0xeb')?'A':'C','secret':_0x479976[_0x4395('0xd6')],'read':_0x479976[_0x4395('0x82')],'attachment':_0x479976['Attachment']};})[_0x4395('0x63')]()};return ejs[_0x4395('0xee')](path[_0x4395('0xcc')](config[_0x4395('0xef')],_0x4395('0xcd'),_0x4395('0xf0'),'downloadInteraction.html'),{'interaction':_0x430954})['then'](function(_0x7c48e9){return new BPromise(function(_0x3aa8ed,_0x561ca9){pdf[_0x4395('0xb6')](_0x7c48e9,_0x53a35a)['toFile'](path[_0x4395('0xcc')](_0x9873f0,_0x4395('0xf1')+_0x17323b['id']+'-'+_0x26800b+_0x4395('0xf2')),function(_0x3c2ac1,_0x280d42){if(_0x3c2ac1)return _0x561ca9(_0x3c2ac1);_0x3aa8ed(_0x280d42);});});})[_0x4395('0x2b')](function(){return new BPromise(function(_0x2df85c,_0x5c2a2b){zipdir(_0x9873f0,{'saveTo':_0x1584d9},function(_0xaeb4bc,_0x470ec1){if(_0xaeb4bc)return _0x5c2a2b(_0xaeb4bc);return _0x2df85c(_0x470ec1);});})[_0x4395('0x2b')](function(){return new BPromise(function(_0x389810,_0x1dca27){rimraf(_0x9873f0,function(_0x1d8f27){if(_0x1d8f27)_0x1dca27(_0x1d8f27);return _0x389810();});});})['then'](function(){return _0x51972f[_0x4395('0xcb')](_0x1584d9,_0x3d1a6f,function(_0x4eb6c0){if(_0x4eb6c0){console[_0x4395('0xf3')](_0x4395('0xf4'),_0x4eb6c0);}else{fs[_0x4395('0xf5')](_0x1584d9);}});});});}else{return _0x51972f[_0x4395('0x20')](0xc8);}})[_0x4395('0xb5')](handleError(_0x51972f,null));};
\ No newline at end of file
index 915271c..ac1df77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99a1=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports'];(function(_0x3c1cbd,_0x4a5ea3){var _0x2aeef8=function(_0xb7bbb1){while(--_0xb7bbb1){_0x3c1cbd['push'](_0x3c1cbd['shift']());}};_0x2aeef8(++_0x4a5ea3);}(_0x99a1,0x69));var _0x199a=function(_0x542c6e,_0x1d23a6){_0x542c6e=_0x542c6e-0x0;var _0x167a96=_0x99a1[_0x542c6e];return _0x167a96;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x199a('0x0'))['db'][_0x199a('0x1')];var OpenchannelMessage=require(_0x199a('0x0'))['db'][_0x199a('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x199a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x199a('0x4')};function emitEvent(_0x2e11da){return function(_0x2a125f,_0x41891d,_0x4235ce){_0x2a125f[_0x199a('0x5')]({'attributes':['id'],'raw':!![]})[_0x199a('0x6')](function(_0x16c7e0){_0x2a125f[_0x199a('0x7')](_0x199a('0x8'),_0x16c7e0[_0x199a('0x9')](function(_0xb0600){return{'id':_0xb0600['id']};}));return OpenchannelMessage[_0x199a('0xa')]({'where':{'OpenchannelInteractionId':_0x2a125f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x199a('0x6')](function(_0x1f8fd9){_0x2a125f[_0x199a('0x7')]('unreadMessages',_0x1f8fd9['length']);OpenchannelInteractionEvents['emit'](_0x2e11da+':'+_0x2a125f['id'],_0x2a125f);OpenchannelInteractionEvents[_0x199a('0xb')](_0x2e11da,_0x2a125f);_0x4235ce(null);})[_0x199a('0xc')](_0x4235ce(null));};}for(var e in events){if(events[_0x199a('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x199a('0xe')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xa6ae=['map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','save','update','remove','getUsers','then','Users'];(function(_0x375eed,_0xb07660){var _0x204c21=function(_0x3748d7){while(--_0x3748d7){_0x375eed['push'](_0x375eed['shift']());}};_0x204c21(++_0xb07660);}(_0xa6ae,0x91));var _0xea6a=function(_0x59f1e6,_0xda13c5){_0x59f1e6=_0x59f1e6-0x0;var _0x2aada5=_0xa6ae[_0x59f1e6];return _0x2aada5;};'use strict';var EventEmitter=require(_0xea6a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xea6a('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xea6a('0x2'),'afterUpdate':_0xea6a('0x3'),'afterDestroy':_0xea6a('0x4')};function emitEvent(_0x487fb1){return function(_0xbdcf7a,_0x3a105c,_0x6ca25){_0xbdcf7a[_0xea6a('0x5')]({'attributes':['id'],'raw':!![]})[_0xea6a('0x6')](function(_0x39fde4){_0xbdcf7a['setDataValue'](_0xea6a('0x7'),_0x39fde4[_0xea6a('0x8')](function(_0x123a45){return{'id':_0x123a45['id']};}));return OpenchannelMessage[_0xea6a('0x9')]({'where':{'OpenchannelInteractionId':_0xbdcf7a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xea6a('0x6')](function(_0x4339d0){_0xbdcf7a[_0xea6a('0xa')](_0xea6a('0xb'),_0x4339d0[_0xea6a('0xc')]);OpenchannelInteractionEvents[_0xea6a('0xd')](_0x487fb1+':'+_0xbdcf7a['id'],_0xbdcf7a);OpenchannelInteractionEvents[_0xea6a('0xd')](_0x487fb1,_0xbdcf7a);_0x6ca25(null);})[_0xea6a('0xe')](_0x6ca25(null));};}for(var e in events){if(events[_0xea6a('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xea6a('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index e0136ce..380dd53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x444e=['OpenchannelInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x1ae78f,_0x122ed2){var _0x5baf80=function(_0x28a303){while(--_0x28a303){_0x1ae78f['push'](_0x1ae78f['shift']());}};_0x5baf80(++_0x122ed2);}(_0x444e,0xe8));var _0xe444=function(_0x46bcb8,_0x150571){_0x46bcb8=_0x46bcb8-0x0;var _0x204344=_0x444e[_0x46bcb8];return _0x204344;};'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':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29a2b7,_0x482b98,_0x3199dd){if(_0x29a2b7[_0xe444('0x9')](_0xe444('0xa'))){_0x29a2b7['closedAt']=moment()['format'](_0xe444('0xb'));}_0x3199dd(null,_0x29a2b7);}}});};
\ No newline at end of file
+var _0x3c94=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x11179b,_0x135dbf){var _0x3d67b5=function(_0x40dafe){while(--_0x40dafe){_0x11179b['push'](_0x11179b['shift']());}};_0x3d67b5(++_0x135dbf);}(_0x3c94,0xcd));var _0x43c9=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x3c94[_0x137d1d];return _0x485108;};'use strict';var _=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var logger=require(_0x43c9('0x2'))(_0x43c9('0x3'));var moment=require(_0x43c9('0x4'));var BPromise=require(_0x43c9('0x5'));var rp=require(_0x43c9('0x6'));var fs=require('fs');var path=require(_0x43c9('0x7'));var rimraf=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var attributes=require(_0x43c9('0xa'));module[_0x43c9('0xb')]=function(_0x4fdfc2,_0x39c220){return _0x4fdfc2[_0x43c9('0xc')](_0x43c9('0xd'),attributes,{'tableName':_0x43c9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x383adb,_0x7a0f6b,_0x28aa11){if(_0x383adb[_0x43c9('0xf')](_0x43c9('0x10'))){_0x383adb['closedAt']=moment()[_0x43c9('0x11')](_0x43c9('0x12'));}_0x28aa11(null,_0x383adb);}}});};
\ No newline at end of file
index 8f8b706..b1a15f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dba=['info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','limit','AddTagsToOpenchannelInteraction','where','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then'];(function(_0xbe3888,_0x5a0e4c){var _0x5a9d5a=function(_0x322e71){while(--_0x322e71){_0xbe3888['push'](_0xbe3888['shift']());}};_0x5a9d5a(++_0x5a0e4c);}(_0x4dba,0x102));var _0xa4db=function(_0x922ae0,_0x15e37d){_0x922ae0=_0x922ae0-0x0;var _0x176181=_0x4dba[_0x922ae0];return _0x176181;};'use strict';var _=require(_0xa4db('0x0'));var util=require('util');var moment=require(_0xa4db('0x1'));var BPromise=require(_0xa4db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa4db('0x3'));var logger=require(_0xa4db('0x4'))(_0xa4db('0x5'));var config=require(_0xa4db('0x6'));var jayson=require(_0xa4db('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xa4db('0x8')]=_[_0xa4db('0x9')](config[_0xa4db('0x8')],{'host':_0xa4db('0xa'),'port':0x18eb});var socket=require(_0xa4db('0xb'))(new Redis(config['redis']));require(_0xa4db('0xc'))['register'](socket);function respondWithRpcPromise(_0x4ba3a3,_0x5e7e11,_0x5c90ee){return new BPromise(function(_0x527469,_0x4be903){return client[_0xa4db('0xd')](_0x4ba3a3,_0x5c90ee)[_0xa4db('0xe')](function(_0x34bf8e){logger[_0xa4db('0xf')](_0xa4db('0x10'),_0x5e7e11,_0xa4db('0x11'));logger[_0xa4db('0x12')](_0xa4db('0x13'),_0x5e7e11,'request\x20sent',JSON[_0xa4db('0x14')](_0x34bf8e));if(_0x34bf8e[_0xa4db('0x15')]){if(_0x34bf8e[_0xa4db('0x15')][_0xa4db('0x16')]===0x1f4){logger[_0xa4db('0x15')](_0xa4db('0x10'),_0x5e7e11,_0x34bf8e[_0xa4db('0x15')]['message']);return _0x4be903(_0x34bf8e[_0xa4db('0x15')]['message']);}logger[_0xa4db('0x15')](_0xa4db('0x10'),_0x5e7e11,_0x34bf8e[_0xa4db('0x15')][_0xa4db('0x17')]);return _0x527469(_0x34bf8e['error'][_0xa4db('0x17')]);}else{logger['info'](_0xa4db('0x10'),_0x5e7e11,_0xa4db('0x11'));_0x527469(_0x34bf8e['result']['message']);}})[_0xa4db('0x18')](function(_0x1dc5c6){logger[_0xa4db('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5e7e11,_0x1dc5c6);_0x4be903(_0x1dc5c6);});});}exports[_0xa4db('0x19')]=function(_0x2478c2){var _0x48d9d=this;return new Promise(function(_0x363df5,_0x47dc5e){return db[_0xa4db('0x1a')][_0xa4db('0x1b')](_0x2478c2['body'],{'raw':_0x2478c2[_0xa4db('0x1c')]?_0x2478c2[_0xa4db('0x1c')][_0xa4db('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2478c2[_0xa4db('0x1c')]?_0x2478c2[_0xa4db('0x1c')]['where']||null:null,'attributes':_0x2478c2[_0xa4db('0x1c')]?_0x2478c2[_0xa4db('0x1c')]['attributes']||null:null,'limit':_0x2478c2[_0xa4db('0x1c')]?_0x2478c2[_0xa4db('0x1c')][_0xa4db('0x1e')]||null:null})[_0xa4db('0xe')](function(_0x198621){logger[_0xa4db('0xf')](_0xa4db('0x19'),_0x2478c2);logger[_0xa4db('0x12')]('UpdateOpenchannelInteraction',_0x2478c2,JSON['stringify'](_0x198621));_0x363df5(_0x198621);})[_0xa4db('0x18')](function(_0x226358){logger[_0xa4db('0x15')]('UpdateOpenchannelInteraction',_0x226358[_0xa4db('0x17')],_0x2478c2);_0x47dc5e(_0x48d9d[_0xa4db('0x15')](0x1f4,_0x226358['message']));});});};exports[_0xa4db('0x1f')]=function(_0x218578){return new Promise(function(_0x174ec3,_0xdf4049){return db['OpenchannelInteraction']['find']({'where':_0x218578[_0xa4db('0x1c')]?_0x218578['options'][_0xa4db('0x20')]||null:null})[_0xa4db('0xe')](function(_0x1a81e9){if(_0x1a81e9){return _0x1a81e9[_0xa4db('0x21')](_0x218578[_0xa4db('0x22')][_0xa4db('0x23')],_[_0xa4db('0x24')](_0x218578['body'],['ids','id'])||{});}})[_0xa4db('0x25')](function(_0x4c0555){logger[_0xa4db('0xf')](_0xa4db('0x26'),_0x218578);logger[_0xa4db('0x12')](_0xa4db('0x26'),_0x218578,JSON['stringify'](_0x4c0555));_0x174ec3(_0x4c0555);})[_0xa4db('0x18')](function(_0x4a1bdc){logger['error']('AddTags',_0x4a1bdc[_0xa4db('0x17')],_0x218578);_0xdf4049(_this[_0xa4db('0x15')](0x1f4,_0x4a1bdc[_0xa4db('0x17')]));});});};
\ No newline at end of file
+var _0x0711=['./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','AddTagsToOpenchannelInteraction','where','ids','omit','AddTags','stringify','lodash','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0711,0x14a));var _0x1071=function(_0x222604,_0x211b76){_0x222604=_0x222604-0x0;var _0x1c6eac=_0x0711[_0x222604];return _0x1c6eac;};'use strict';var _=require(_0x1071('0x0'));var util=require('util');var moment=require(_0x1071('0x1'));var BPromise=require(_0x1071('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1071('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1071('0x4'))('rpc');var config=require(_0x1071('0x5'));var jayson=require(_0x1071('0x6'));var client=jayson['client'][_0x1071('0x7')]({'port':0x232a});config['redis']=_[_0x1071('0x8')](config[_0x1071('0x9')],{'host':_0x1071('0xa'),'port':0x18eb});var socket=require(_0x1071('0xb'))(new Redis(config[_0x1071('0x9')]));require(_0x1071('0xc'))['register'](socket);function respondWithRpcPromise(_0x29afe9,_0x576cfc,_0x3312c8){return new BPromise(function(_0x4fd4f3,_0x12f0a9){return client[_0x1071('0xd')](_0x29afe9,_0x3312c8)[_0x1071('0xe')](function(_0x3d6150){logger[_0x1071('0xf')](_0x1071('0x10'),_0x576cfc,'request\x20sent');logger[_0x1071('0x11')](_0x1071('0x12'),_0x576cfc,_0x1071('0x13'),JSON['stringify'](_0x3d6150));if(_0x3d6150['error']){if(_0x3d6150[_0x1071('0x14')]['code']===0x1f4){logger[_0x1071('0x14')](_0x1071('0x10'),_0x576cfc,_0x3d6150[_0x1071('0x14')][_0x1071('0x15')]);return _0x12f0a9(_0x3d6150[_0x1071('0x14')][_0x1071('0x15')]);}logger[_0x1071('0x14')](_0x1071('0x10'),_0x576cfc,_0x3d6150['error'][_0x1071('0x15')]);return _0x4fd4f3(_0x3d6150[_0x1071('0x14')][_0x1071('0x15')]);}else{logger[_0x1071('0xf')](_0x1071('0x10'),_0x576cfc,'request\x20sent');_0x4fd4f3(_0x3d6150[_0x1071('0x16')]['message']);}})[_0x1071('0x17')](function(_0x14fa5d){logger['error'](_0x1071('0x10'),_0x576cfc,_0x14fa5d);_0x12f0a9(_0x14fa5d);});});}exports[_0x1071('0x18')]=function(_0x3dcf0d){var _0x4099c8=this;return new Promise(function(_0xe4141,_0x7ec627){return db[_0x1071('0x19')][_0x1071('0x1a')](_0x3dcf0d[_0x1071('0x1b')],{'raw':_0x3dcf0d[_0x1071('0x1c')]?_0x3dcf0d[_0x1071('0x1c')][_0x1071('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dcf0d[_0x1071('0x1c')]?_0x3dcf0d[_0x1071('0x1c')]['where']||null:null,'attributes':_0x3dcf0d[_0x1071('0x1c')]?_0x3dcf0d[_0x1071('0x1c')][_0x1071('0x1e')]||null:null,'limit':_0x3dcf0d['options']?_0x3dcf0d[_0x1071('0x1c')][_0x1071('0x1f')]||null:null})[_0x1071('0xe')](function(_0x3f0f9f){logger[_0x1071('0xf')](_0x1071('0x18'),_0x3dcf0d);logger[_0x1071('0x11')](_0x1071('0x18'),_0x3dcf0d,JSON['stringify'](_0x3f0f9f));_0xe4141(_0x3f0f9f);})['catch'](function(_0xd638f4){logger['error'](_0x1071('0x18'),_0xd638f4[_0x1071('0x15')],_0x3dcf0d);_0x7ec627(_0x4099c8[_0x1071('0x14')](0x1f4,_0xd638f4[_0x1071('0x15')]));});});};exports[_0x1071('0x20')]=function(_0x33ddbd){return new Promise(function(_0x21b5b7,_0xb5346e){return db[_0x1071('0x19')]['find']({'where':_0x33ddbd[_0x1071('0x1c')]?_0x33ddbd[_0x1071('0x1c')][_0x1071('0x21')]||null:null})[_0x1071('0xe')](function(_0x49488c){if(_0x49488c){return _0x49488c['addTags'](_0x33ddbd[_0x1071('0x1b')][_0x1071('0x22')],_[_0x1071('0x23')](_0x33ddbd[_0x1071('0x1b')],[_0x1071('0x22'),'id'])||{});}})['spread'](function(_0x374266){logger[_0x1071('0xf')](_0x1071('0x24'),_0x33ddbd);logger[_0x1071('0x11')](_0x1071('0x24'),_0x33ddbd,JSON[_0x1071('0x25')](_0x374266));_0x21b5b7(_0x374266);})[_0x1071('0x17')](function(_0x5aee17){logger['error']('AddTags',_0x5aee17[_0x1071('0x15')],_0x33ddbd);_0xb5346e(_this['error'](0x1f4,_0x5aee17['message']));});});};
\ No newline at end of file
index a9e68e8..e0fc815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd998=['save','remove','update','emit','register','length'];(function(_0x569f9a,_0x58cc03){var _0x33cafb=function(_0x4b2300){while(--_0x4b2300){_0x569f9a['push'](_0x569f9a['shift']());}};_0x33cafb(++_0x58cc03);}(_0xd998,0x18c));var _0x8d99=function(_0x13a10e,_0x215f40){_0x13a10e=_0x13a10e-0x0;var _0x29ca7d=_0xd998[_0x13a10e];return _0x29ca7d;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x8d99('0x0'),_0x8d99('0x1'),_0x8d99('0x2')];function createListener(_0x1fe597,_0x2a7a2a){return function(_0x5be316){_0x2a7a2a[_0x8d99('0x3')](_0x1fe597,_0x5be316);};}function removeListener(_0x1e4874,_0x4cc5c8){return function(){OpenchannelInteractionEvents['removeListener'](_0x1e4874,_0x4cc5c8);};}exports[_0x8d99('0x4')]=function(_0x399c2c){for(var _0x368e9f=0x0,_0x15ddd2=events[_0x8d99('0x5')];_0x368e9f<_0x15ddd2;_0x368e9f++){var _0x4c4677=events[_0x368e9f];var _0x49504d=createListener('openchannelInteraction:'+_0x4c4677,_0x399c2c);OpenchannelInteractionEvents['on'](_0x4c4677,_0x49504d);}};
\ No newline at end of file
+var _0xd1d5=['openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','register'];(function(_0x64b91f,_0x36e909){var _0x2ceb74=function(_0x5d9c79){while(--_0x5d9c79){_0x64b91f['push'](_0x64b91f['shift']());}};_0x2ceb74(++_0x36e909);}(_0xd1d5,0xb5));var _0x5d1d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd1d5[_0x432682];return _0x463d05;};'use strict';var OpenchannelInteractionEvents=require(_0x5d1d('0x0'));var events=['save',_0x5d1d('0x1'),_0x5d1d('0x2')];function createListener(_0x1ae085,_0xff3995){return function(_0x3c06b7){_0xff3995[_0x5d1d('0x3')](_0x1ae085,_0x3c06b7);};}function removeListener(_0x2d2d9e,_0x58333e){return function(){OpenchannelInteractionEvents['removeListener'](_0x2d2d9e,_0x58333e);};}exports[_0x5d1d('0x4')]=function(_0x408cc9){for(var _0x300f8b=0x0,_0x4367c3=events['length'];_0x300f8b<_0x4367c3;_0x300f8b++){var _0x586fcf=events[_0x300f8b];var _0x2c5e8a=createListener(_0x5d1d('0x5')+_0x586fcf,_0x408cc9);OpenchannelInteractionEvents['on'](_0x586fcf,_0x2c5e8a);}};
\ No newline at end of file
index eeb96f2..c8b1f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8636=['Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x54fdf2,_0x1affac){var _0x50adce=function(_0x53e316){while(--_0x53e316){_0x54fdf2['push'](_0x54fdf2['shift']());}};_0x50adce(++_0x1affac);}(_0x8636,0x184));var _0x6863=function(_0x32738a,_0x2f4dcd){_0x32738a=_0x32738a-0x0;var _0x404c12=_0x8636[_0x32738a];return _0x404c12;};'use strict';var multer=require(_0x6863('0x0'));var util=require('util');var path=require(_0x6863('0x1'));var timeout=require(_0x6863('0x2'));var express=require(_0x6863('0x3'));var router=express[_0x6863('0x4')]();var auth=require(_0x6863('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6863('0x6'));var controller=require(_0x6863('0x7'));router['get']('/',auth[_0x6863('0x8')](),controller[_0x6863('0x9')]);router[_0x6863('0xa')](_0x6863('0xb'),auth[_0x6863('0x8')](),controller[_0x6863('0xc')]);router['get'](_0x6863('0xd'),auth[_0x6863('0x8')](),controller[_0x6863('0xe')]);router[_0x6863('0xf')]('/',auth[_0x6863('0x8')](),interaction[_0x6863('0x10')](_0x6863('0x11'),'openchannelmessage:create'),controller[_0x6863('0x12')]);router[_0x6863('0x13')](_0x6863('0xd'),auth[_0x6863('0x8')](),controller[_0x6863('0x14')]);router[_0x6863('0x13')](_0x6863('0x15'),auth[_0x6863('0x8')](),controller[_0x6863('0x16')]);router[_0x6863('0x13')](_0x6863('0x17'),auth[_0x6863('0x8')](),controller[_0x6863('0x18')]);router[_0x6863('0x19')](_0x6863('0xd'),auth[_0x6863('0x8')](),controller[_0x6863('0x1a')]);module[_0x6863('0x1b')]=router;
\ No newline at end of file
+var _0x505a=['isAuthenticated','index','/describe','describe','show','post','tracked','openchannelmessage:create','put','accept','reject','/:id','exports','path','connect-timeout','../../components/auth/service','./openchannelMessage.controller','get'];(function(_0x58a070,_0xec54a5){var _0x18b084=function(_0x5f2820){while(--_0x5f2820){_0x58a070['push'](_0x58a070['shift']());}};_0x18b084(++_0xec54a5);}(_0x505a,0x175));var _0xa505=function(_0x1a6318,_0x3de013){_0x1a6318=_0x1a6318-0x0;var _0x380cd5=_0x505a[_0x1a6318];return _0x380cd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa505('0x0'));var timeout=require(_0xa505('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xa505('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa505('0x3'));router[_0xa505('0x4')]('/',auth[_0xa505('0x5')](),controller[_0xa505('0x6')]);router[_0xa505('0x4')](_0xa505('0x7'),auth[_0xa505('0x5')](),controller[_0xa505('0x8')]);router[_0xa505('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xa505('0x9')]);router[_0xa505('0xa')]('/',auth[_0xa505('0x5')](),interaction[_0xa505('0xb')]('openchannel',_0xa505('0xc')),controller['create']);router[_0xa505('0xd')]('/:id',auth[_0xa505('0x5')](),controller['update']);router[_0xa505('0xd')]('/:id/accept',auth['isAuthenticated'](),controller[_0xa505('0xe')]);router[_0xa505('0xd')]('/:id/reject',auth['isAuthenticated'](),controller[_0xa505('0xf')]);router['delete'](_0xa505('0x10'),auth[_0xa505('0x5')](),controller['destroy']);module[_0xa505('0x11')]=router;
\ No newline at end of file
index 2fed29e..3faa955 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b2d=['BOOLEAN','ENUM','out','exports','TEXT','medium'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9b2d,0x9f));var _0xd9b2=function(_0x9a9f46,_0x1d1e25){_0x9a9f46=_0x9a9f46-0x0;var _0x5dc8be=_0x9b2d[_0x9a9f46];return _0x5dc8be;};'use strict';var Sequelize=require('sequelize');module[_0xd9b2('0x0')]={'body':{'type':Sequelize[_0xd9b2('0x1')](_0xd9b2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9b2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9b2('0x4')]('in',_0xd9b2('0x5')),'defaultValue':_0xd9b2('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x26d7=['out','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x5d7533,_0x5c5947){var _0xa80024=function(_0x44bd4d){while(--_0x44bd4d){_0x5d7533['push'](_0x5d7533['shift']());}};_0xa80024(++_0x5c5947);}(_0x26d7,0x151));var _0x726d=function(_0x3c0f2f,_0x2618a0){_0x3c0f2f=_0x3c0f2f-0x0;var _0x185d72=_0x26d7[_0x3c0f2f];return _0x185d72;};'use strict';var Sequelize=require(_0x726d('0x0'));module['exports']={'body':{'type':Sequelize[_0x726d('0x1')](_0x726d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x726d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x726d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x726d('0x4')]('in',_0x726d('0x5')),'defaultValue':_0x726d('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index a8e1927..195755e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2de1=['limit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','show','params','rawAttributes','find','create','body','describe','../../config/logger','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','UserId','isNil','format','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','interface','channel','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SIP/%s','event','reject','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','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','./openchannelMessage.socket','register','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2cddcd,_0x404891){var _0x18993f=function(_0x158de9){while(--_0x158de9){_0x2cddcd['push'](_0x2cddcd['shift']());}};_0x18993f(++_0x404891);}(_0x2de1,0x12b));var _0x12de=function(_0x2aea8a,_0x658c77){_0x2aea8a=_0x2aea8a-0x0;var _0x3e0a0b=_0x2de1[_0x2aea8a];return _0x3e0a0b;};'use strict';var pdf=require(_0x12de('0x0'));var emlformat=require(_0x12de('0x1'));var rimraf=require(_0x12de('0x2'));var zipdir=require(_0x12de('0x3'));var jsonpatch=require(_0x12de('0x4'));var rp=require(_0x12de('0x5'));var moment=require(_0x12de('0x6'));var BPromise=require(_0x12de('0x7'));var Mustache=require(_0x12de('0x8'));var util=require(_0x12de('0x9'));var path=require(_0x12de('0xa'));var sox=require('sox');var csv=require(_0x12de('0xb'));var ejs=require(_0x12de('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x12de('0xd'));var crypto=require(_0x12de('0xe'));var jsforce=require(_0x12de('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x12de('0xb'));var querystring=require(_0x12de('0x10'));var Papa=require('papaparse');var Redis=require(_0x12de('0x11'));var authService=require(_0x12de('0x12'));var qs=require(_0x12de('0x13'));var as=require(_0x12de('0x14'));var hardwareService=require(_0x12de('0x15'));var logger=require('../../config/logger')(_0x12de('0x16'));var utils=require(_0x12de('0x17'));var config=require(_0x12de('0x18'));var db=require(_0x12de('0x19'))['db'];config[_0x12de('0x1a')]=_[_0x12de('0x1b')](config[_0x12de('0x1a')],{'host':_0x12de('0x1c'),'port':0x18eb});var socket=require(_0x12de('0x1d'))(new Redis(config['redis']));require(_0x12de('0x1e'))[_0x12de('0x1f')](socket);var jayson=require(_0x12de('0x20'));var client=jayson[_0x12de('0x21')][_0x12de('0x22')]({'port':0x232c});var client9002=jayson[_0x12de('0x21')][_0x12de('0x22')]({'port':0x232a});function checkPasswordPattern(_0x1ccdd4,_0x3a6d35,_0x592245){if(_0x592245){var _0x4383cf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4383cf['test'](_0x3a6d35)){return _0x1ccdd4;}else{throw new db['Sequelize'][(_0x12de('0x23'))](_0x12de('0x24'));}}else{return _0x1ccdd4;}}function respondWithRpcPromise(_0x11a5cd,_0x339cfe,_0xf47d61,_0xd0596){return new BPromise(function(_0x158d10,_0x416a52){var _0x3a1882=_0xd0596||client;return _0x3a1882[_0x12de('0x25')](_0x11a5cd,_0xf47d61)['then'](function(_0x35b768){logger[_0x12de('0x26')](_0x12de('0x27'),_0x339cfe,_0x12de('0x28'));logger[_0x12de('0x29')](_0x12de('0x2a'),_0x339cfe,_0x12de('0x28'),JSON[_0x12de('0x2b')](_0x35b768));if(_0x35b768[_0x12de('0x2c')]){if(_0x35b768[_0x12de('0x2c')]['code']===0x1f4){logger[_0x12de('0x2c')](_0x12de('0x27'),_0x339cfe,_0x35b768['error'][_0x12de('0x2d')]);return _0x416a52(_0x35b768[_0x12de('0x2c')]['message']);}logger[_0x12de('0x2c')](_0x12de('0x27'),_0x339cfe,_0x35b768['error']['message']);return _0x158d10(_0x35b768[_0x12de('0x2c')][_0x12de('0x2d')]);}else{logger[_0x12de('0x26')](_0x12de('0x27'),_0x339cfe,_0x12de('0x28'));_0x158d10(_0x35b768[_0x12de('0x2e')][_0x12de('0x2d')]);}})[_0x12de('0x2f')](function(_0x2cca19){logger[_0x12de('0x2c')](_0x12de('0x27'),_0x339cfe,_0x2cca19);_0x416a52(_0x2cca19);});});}function respondWithStatusCode(_0x1833b8,_0xa1f110){_0xa1f110=_0xa1f110||0xcc;return function(_0x1e2f40){if(_0x1e2f40){return _0x1833b8[_0x12de('0x30')](_0xa1f110);}return _0x1833b8[_0x12de('0x31')](_0xa1f110)[_0x12de('0x32')]();};}function respondWithResult(_0x4d239a,_0x5c7049){_0x5c7049=_0x5c7049||0xc8;return function(_0x3e6e17){if(_0x3e6e17){return _0x4d239a['status'](_0x5c7049)[_0x12de('0x33')](_0x3e6e17);}};}function respondWithFilteredResult(_0x552b6e,_0x1dc1ca){return function(_0x131ecc){if(_0x131ecc){var _0xe58e3c=_0x131ecc[_0x12de('0x34')],_0x6e7bf2=_0x1dc1ca['offset'],_0x4c142e=_0x1dc1ca[_0x12de('0x35')]+_0x1dc1ca['limit'],_0x5d13bd;if(_0x4c142e>=_0xe58e3c){_0x4c142e=_0xe58e3c;_0x5d13bd=0xc8;}else{_0x5d13bd=0xce;}_0x552b6e[_0x12de('0x31')](_0x5d13bd);return _0x552b6e[_0x12de('0x36')](_0x12de('0x37'),_0x6e7bf2+'-'+_0x4c142e+'/'+_0xe58e3c)[_0x12de('0x33')](_0x131ecc);}return null;};}function patchUpdates(_0x5b0944){return function(_0x30bcc4){try{jsonpatch[_0x12de('0x38')](_0x30bcc4,_0x5b0944,!![]);}catch(_0x2338ed){return BPromise['reject'](_0x2338ed);}return _0x30bcc4[_0x12de('0x39')]();};}function saveUpdates(_0x1ea591,_0x370767){return function(_0x233572){if(_0x233572){return _0x233572[_0x12de('0x3a')](_0x1ea591)[_0x12de('0x3b')](function(_0x439607){return _0x439607;});}return null;};}function removeEntity(_0x2b69a4,_0x2d99d3){return function(_0xd5ecd4){if(_0xd5ecd4){return _0xd5ecd4[_0x12de('0x3c')]()['then'](function(){_0x2b69a4[_0x12de('0x31')](0xcc)[_0x12de('0x32')]();});}};}function handleEntityNotFound(_0x2d39b3,_0x235675){return function(_0x5476fd){if(!_0x5476fd){_0x2d39b3['sendStatus'](0x194);}return _0x5476fd;};}function handleError(_0x414f0b,_0x4bf698){_0x4bf698=_0x4bf698||0x1f4;return function(_0x4937d5){logger[_0x12de('0x2c')](_0x4937d5[_0x12de('0x3d')]);if(_0x4937d5[_0x12de('0x3e')]){delete _0x4937d5['name'];}_0x414f0b[_0x12de('0x31')](_0x4bf698)[_0x12de('0x3f')](_0x4937d5);};}exports[_0x12de('0x40')]=function(_0x19f297,_0x37950f){var _0x100472={},_0x460ae3={},_0x59e6c8={'count':0x0,'rows':[]};var _0x51efba=_[_0x12de('0x41')](db[_0x12de('0x42')]['rawAttributes'],function(_0x52b30d){return{'name':_0x52b30d[_0x12de('0x43')],'type':_0x52b30d[_0x12de('0x44')]['key']};});_0x460ae3[_0x12de('0x45')]=_[_0x12de('0x41')](_0x51efba,_0x12de('0x3e'));_0x460ae3['query']=_[_0x12de('0x46')](_0x19f297['query']);_0x460ae3[_0x12de('0x47')]=_[_0x12de('0x48')](_0x460ae3[_0x12de('0x45')],_0x460ae3[_0x12de('0x49')]);_0x100472[_0x12de('0x4a')]=_[_0x12de('0x48')](_0x460ae3['model'],qs[_0x12de('0x4b')](_0x19f297['query']['fields']));_0x100472[_0x12de('0x4a')]=_0x100472[_0x12de('0x4a')][_0x12de('0x4c')]?_0x100472[_0x12de('0x4a')]:_0x460ae3[_0x12de('0x45')];if(!_0x19f297[_0x12de('0x49')][_0x12de('0x4d')](_0x12de('0x4e'))){_0x100472[_0x12de('0x4f')]=qs['limit'](_0x19f297['query']['limit']);_0x100472['offset']=qs[_0x12de('0x35')](_0x19f297[_0x12de('0x49')][_0x12de('0x35')]);}_0x100472['order']=qs[_0x12de('0x50')](_0x19f297[_0x12de('0x49')][_0x12de('0x50')]);_0x100472[_0x12de('0x51')]=qs[_0x12de('0x47')](_[_0x12de('0x52')](_0x19f297[_0x12de('0x49')],_0x460ae3['filters']),_0x51efba);if(_0x19f297[_0x12de('0x49')]['filter']){_0x100472[_0x12de('0x51')]=_['merge'](_0x100472[_0x12de('0x51')],{'$or':_[_0x12de('0x41')](_0x51efba,function(_0x2e3cfe){if(_0x2e3cfe['type']!==_0x12de('0x53')){var _0x1b970b={};_0x1b970b[_0x2e3cfe[_0x12de('0x3e')]]={'$like':'%'+_0x19f297['query'][_0x12de('0x54')]+'%'};return _0x1b970b;}})});}_0x100472=_[_0x12de('0x55')]({},_0x100472,_0x19f297[_0x12de('0x56')]);var _0x12e876={'where':_0x100472[_0x12de('0x51')]};return db[_0x12de('0x42')][_0x12de('0x34')](_0x12e876)[_0x12de('0x3b')](function(_0x5d4b7c){_0x59e6c8['count']=_0x5d4b7c;if(_0x19f297[_0x12de('0x49')][_0x12de('0x57')]){_0x100472[_0x12de('0x58')]=[{'all':!![]}];}return db[_0x12de('0x42')]['findAll'](_0x100472);})[_0x12de('0x3b')](function(_0x1f5842){_0x59e6c8['rows']=_0x1f5842;return _0x59e6c8;})[_0x12de('0x3b')](respondWithFilteredResult(_0x37950f,_0x100472))['catch'](handleError(_0x37950f,null));};exports[_0x12de('0x59')]=function(_0x5448ff,_0x3509aa){var _0x5b987d={'raw':!![],'where':{'id':_0x5448ff[_0x12de('0x5a')]['id']}},_0x3fd5c5={};_0x3fd5c5['model']=_[_0x12de('0x46')](db[_0x12de('0x42')][_0x12de('0x5b')]);_0x3fd5c5[_0x12de('0x49')]=_[_0x12de('0x46')](_0x5448ff[_0x12de('0x49')]);_0x3fd5c5[_0x12de('0x47')]=_['intersection'](_0x3fd5c5[_0x12de('0x45')],_0x3fd5c5['query']);_0x5b987d[_0x12de('0x4a')]=_[_0x12de('0x48')](_0x3fd5c5[_0x12de('0x45')],qs['fields'](_0x5448ff['query'][_0x12de('0x4b')]));_0x5b987d[_0x12de('0x4a')]=_0x5b987d[_0x12de('0x4a')]['length']?_0x5b987d[_0x12de('0x4a')]:_0x3fd5c5[_0x12de('0x45')];if(_0x5448ff[_0x12de('0x49')][_0x12de('0x57')]){_0x5b987d[_0x12de('0x58')]=[{'all':!![]}];}_0x5b987d=_['merge']({},_0x5b987d,_0x5448ff[_0x12de('0x56')]);return db['OpenchannelMessage'][_0x12de('0x5c')](_0x5b987d)[_0x12de('0x3b')](handleEntityNotFound(_0x3509aa,null))['then'](respondWithResult(_0x3509aa,null))[_0x12de('0x2f')](handleError(_0x3509aa,null));};exports[_0x12de('0x5d')]=function(_0x2d5677,_0x1277b6){return db[_0x12de('0x42')][_0x12de('0x5d')](_0x2d5677[_0x12de('0x5e')],{})[_0x12de('0x3b')](respondWithResult(_0x1277b6,0xc9))[_0x12de('0x2f')](handleError(_0x1277b6,null));};exports['update']=function(_0xb86e01,_0x4b8f27){if(_0xb86e01[_0x12de('0x5e')]['id']){delete _0xb86e01[_0x12de('0x5e')]['id'];}return db[_0x12de('0x42')][_0x12de('0x5c')]({'where':{'id':_0xb86e01[_0x12de('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b8f27,null))[_0x12de('0x3b')](saveUpdates(_0xb86e01[_0x12de('0x5e')],null))['then'](respondWithResult(_0x4b8f27,null))[_0x12de('0x2f')](handleError(_0x4b8f27,null));};exports['destroy']=function(_0x5d09e5,_0x5651f3){return db[_0x12de('0x42')][_0x12de('0x5c')]({'where':{'id':_0x5d09e5['params']['id']}})['then'](handleEntityNotFound(_0x5651f3,null))[_0x12de('0x3b')](removeEntity(_0x5651f3,null))['catch'](handleError(_0x5651f3,null));};exports['describe']=function(_0x3ac6de,_0x5d10a6){return db[_0x12de('0x42')][_0x12de('0x5f')]()[_0x12de('0x3b')](respondWithResult(_0x5d10a6,null))[_0x12de('0x2f')](handleError(_0x5d10a6,null));};var interaction_log=require(_0x12de('0x60'))('openchannel-interactions');exports[_0x12de('0x61')]=function(_0x1b852e,_0x241fd9,_0x5443a5){var _0x1b1151={'channel':_0x12de('0x62')};if(_0x1b852e[_0x12de('0x5e')]['id']){delete _0x1b852e[_0x12de('0x5e')]['id'];}_0x1b852e['body'][_0x12de('0x63')]=!![];_0x1b852e[_0x12de('0x5e')][_0x12de('0x64')]=moment()['format'](_0x12de('0x65'));_0x1b852e[_0x12de('0x5e')]['UserId']=_0x1b852e['body']['UserId']||_0x1b852e[_0x12de('0x66')]['id'];return db[_0x12de('0x42')]['find']({'where':{'id':_0x1b852e[_0x12de('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0x12de('0x67')],'as':'Contact'}]})[_0x12de('0x3b')](handleEntityNotFound(_0x241fd9,null))[_0x12de('0x3b')](saveUpdates(_0x1b852e[_0x12de('0x5e')],null))[_0x12de('0x3b')](function(_0x360a41){if(_0x360a41){_0x1b1151[_0x12de('0x2d')]=_0x360a41[_0x12de('0x68')]({'plain':!![]});return db[_0x12de('0x69')][_0x12de('0x5c')]({'where':{'id':_0x360a41[_0x12de('0x6a')]}});}return null;})[_0x12de('0x3b')](handleEntityNotFound(_0x241fd9,null))['then'](function(_0x1c5740){if(_0x1c5740){return _0x1c5740[_0x12de('0x3a')]({'UserId':_0x1b852e['body'][_0x12de('0x6b')],'read1stAt':_[_0x12de('0x6c')](_0x1c5740['read1stAt'])?moment()[_0x12de('0x6d')](_0x12de('0x65')):undefined});}return null;})['then'](function(_0x42dbe3){if(_0x42dbe3){_0x1b1151['interaction']=_0x42dbe3['get']({'plain':!![]});interaction_log[_0x12de('0x26')](_0x12de('0x6e'),_0x1b852e[_0x12de('0x66')]['id'],_0x1b852e[_0x12de('0x66')][_0x12de('0x3e')],_0x1b852e['user'][_0x12de('0x6f')],_0x1b1151[_0x12de('0x70')]['id'],_0x1b852e[_0x12de('0x5e')]?JSON['stringify'](_0x1b852e[_0x12de('0x5e')]):'null');return respondWithRpcPromise('AcceptMessage',_0x12de('0x71'),_0x1b1151);}return null;})[_0x12de('0x3b')](function(_0x40c351){if(_0x40c351){if(_0x1b852e[_0x12de('0x5e')]['manual']){_0x1b1151[_0x12de('0x2d')][_0x12de('0x72')]=util[_0x12de('0x6d')]('SIP/%s',_0x1b852e[_0x12de('0x66')][_0x12de('0x3e')]);_0x1b1151[_0x12de('0x2d')][_0x12de('0x73')]=_0x1b1151[_0x12de('0x73')];_0x1b1151['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x12de('0x74'),{'event':_0x12de('0x75'),'message':_0x1b1151['message']},client9002)['then'](function(){return _0x1b1151;});}return _0x1b1151;}return null;})[_0x12de('0x3b')](respondWithResult(_0x241fd9,null))['catch'](handleError(_0x241fd9,null));};var interaction_log=require(_0x12de('0x60'))('openchannel-interactions');exports['reject']=function(_0x3f56ef,_0x16700b,_0x4c6c90){var _0x565e4f={'agent':{},'channel':'openchannel'};if(_0x3f56ef[_0x12de('0x5e')]['id']){delete _0x3f56ef[_0x12de('0x5e')]['id'];}_0x3f56ef[_0x12de('0x5e')][_0x12de('0x6b')]=_0x3f56ef[_0x12de('0x5e')]['UserId']||_0x3f56ef[_0x12de('0x66')]['id'];_0x565e4f[_0x12de('0x76')]['id']=_0x3f56ef[_0x12de('0x5e')][_0x12de('0x6b')];return db['OpenchannelMessage'][_0x12de('0x5c')]({'where':{'id':_0x3f56ef['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x16700b,null))[_0x12de('0x3b')](function(_0x36dabf){if(_0x36dabf){_0x565e4f['message']=_0x36dabf[_0x12de('0x68')]({'plain':!![]});return db[_0x12de('0x69')][_0x12de('0x5c')]({'where':{'id':_0x36dabf[_0x12de('0x6a')]}});}return null;})[_0x12de('0x3b')](handleEntityNotFound(_0x16700b,null))[_0x12de('0x3b')](function(_0xc8bc23){if(_0xc8bc23){_0x565e4f[_0x12de('0x70')]=_0xc8bc23[_0x12de('0x68')]({'plain':!![]});interaction_log[_0x12de('0x26')](_0x12de('0x77'),_0x3f56ef[_0x12de('0x66')]['id'],_0x3f56ef[_0x12de('0x66')]['name'],_0x3f56ef[_0x12de('0x66')][_0x12de('0x6f')],_0x565e4f[_0x12de('0x70')]['id'],_0x3f56ef[_0x12de('0x5e')]?JSON['stringify'](_0x3f56ef[_0x12de('0x5e')]):_0x12de('0x78'));return respondWithRpcPromise('RejectMessage',_0x12de('0x79'),_0x565e4f);}return null;})[_0x12de('0x3b')](function(_0x4b968e){if(_0x4b968e){_0x4b968e[_0x12de('0x2d')][_0x12de('0x72')]=util['format'](_0x12de('0x7a'),_0x3f56ef[_0x12de('0x66')][_0x12de('0x3e')]);_0x4b968e[_0x12de('0x2d')][_0x12de('0x73')]=_0x565e4f[_0x12de('0x73')];_0x4b968e[_0x12de('0x2d')][_0x12de('0x7b')]=_0x12de('0x7c');respondWithRpcPromise(_0x12de('0x74'),_0x12de('0x74'),{'event':_0x12de('0x7d'),'message':_0x4b968e['message']},client9002);return _0x565e4f;}return null;})[_0x12de('0x3b')](respondWithResult(_0x16700b,null))[_0x12de('0x2f')](handleError(_0x16700b,null));};
\ No newline at end of file
+var _0x925d=['http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','../../config/logger','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','isNil','interaction','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','zip-dir','bluebird','mustache','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','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x925d,0x1ca));var _0xd925=function(_0x18c95f,_0x5d4d79){_0x18c95f=_0x18c95f-0x0;var _0xb1f91c=_0x925d[_0x18c95f];return _0xb1f91c;};'use strict';var pdf=require(_0xd925('0x0'));var emlformat=require(_0xd925('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd925('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd925('0x3'));var Mustache=require(_0xd925('0x4'));var util=require('util');var path=require('path');var sox=require(_0xd925('0x5'));var csv=require(_0xd925('0x6'));var ejs=require(_0xd925('0x7'));var fs=require('fs');var _=require(_0xd925('0x8'));var squel=require(_0xd925('0x9'));var crypto=require(_0xd925('0xa'));var jsforce=require(_0xd925('0xb'));var deskjs=require(_0xd925('0xc'));var toCsv=require(_0xd925('0x6'));var querystring=require(_0xd925('0xd'));var Papa=require(_0xd925('0xe'));var Redis=require(_0xd925('0xf'));var authService=require(_0xd925('0x10'));var qs=require(_0xd925('0x11'));var as=require(_0xd925('0x12'));var hardwareService=require(_0xd925('0x13'));var logger=require('../../config/logger')(_0xd925('0x14'));var utils=require(_0xd925('0x15'));var config=require(_0xd925('0x16'));var db=require('../../mysqldb')['db'];config[_0xd925('0x17')]=_[_0xd925('0x18')](config['redis'],{'host':_0xd925('0x19'),'port':0x18eb});var socket=require(_0xd925('0x1a'))(new Redis(config[_0xd925('0x17')]));require(_0xd925('0x1b'))['register'](socket);var jayson=require(_0xd925('0x1c'));var client=jayson[_0xd925('0x1d')][_0xd925('0x1e')]({'port':0x232c});var client9002=jayson[_0xd925('0x1d')][_0xd925('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3a90cc,_0x250612,_0x2401b5){if(_0x2401b5){var _0x20fb2c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20fb2c[_0xd925('0x1f')](_0x250612)){return _0x3a90cc;}else{throw new db[(_0xd925('0x20'))][(_0xd925('0x21'))](_0xd925('0x22'));}}else{return _0x3a90cc;}}function respondWithRpcPromise(_0xaeba07,_0xffb3e6,_0x34cb3d,_0x1ef9d6){return new BPromise(function(_0x4b611d,_0x59f176){var _0x1f79d9=_0x1ef9d6||client;return _0x1f79d9[_0xd925('0x23')](_0xaeba07,_0x34cb3d)[_0xd925('0x24')](function(_0x3d4607){logger[_0xd925('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0xffb3e6,'request\x20sent');logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xffb3e6,_0xd925('0x26'),JSON[_0xd925('0x27')](_0x3d4607));if(_0x3d4607[_0xd925('0x28')]){if(_0x3d4607['error'][_0xd925('0x29')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xffb3e6,_0x3d4607[_0xd925('0x28')][_0xd925('0x2a')]);return _0x59f176(_0x3d4607[_0xd925('0x28')][_0xd925('0x2a')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xffb3e6,_0x3d4607[_0xd925('0x28')][_0xd925('0x2a')]);return _0x4b611d(_0x3d4607[_0xd925('0x28')]['message']);}else{logger[_0xd925('0x25')](_0xd925('0x2b'),_0xffb3e6,_0xd925('0x26'));_0x4b611d(_0x3d4607[_0xd925('0x2c')][_0xd925('0x2a')]);}})['catch'](function(_0xe9d20f){logger[_0xd925('0x28')](_0xd925('0x2b'),_0xffb3e6,_0xe9d20f);_0x59f176(_0xe9d20f);});});}function respondWithStatusCode(_0x51248d,_0x2d584d){_0x2d584d=_0x2d584d||0xcc;return function(_0x88c683){if(_0x88c683){return _0x51248d[_0xd925('0x2d')](_0x2d584d);}return _0x51248d[_0xd925('0x2e')](_0x2d584d)['end']();};}function respondWithResult(_0x27169e,_0x5a562a){_0x5a562a=_0x5a562a||0xc8;return function(_0x1ccf55){if(_0x1ccf55){return _0x27169e[_0xd925('0x2e')](_0x5a562a)[_0xd925('0x2f')](_0x1ccf55);}};}function respondWithFilteredResult(_0x5e71c7,_0x4ddc48){return function(_0x17ba30){if(_0x17ba30){var _0x459396=_0x17ba30[_0xd925('0x30')],_0x875ecb=_0x4ddc48[_0xd925('0x31')],_0x140fed=_0x4ddc48['offset']+_0x4ddc48[_0xd925('0x32')],_0x2a0251;if(_0x140fed>=_0x459396){_0x140fed=_0x459396;_0x2a0251=0xc8;}else{_0x2a0251=0xce;}_0x5e71c7[_0xd925('0x2e')](_0x2a0251);return _0x5e71c7[_0xd925('0x33')](_0xd925('0x34'),_0x875ecb+'-'+_0x140fed+'/'+_0x459396)[_0xd925('0x2f')](_0x17ba30);}return null;};}function patchUpdates(_0x316bd8){return function(_0x42fd15){try{jsonpatch[_0xd925('0x35')](_0x42fd15,_0x316bd8,!![]);}catch(_0x6ae180){return BPromise[_0xd925('0x36')](_0x6ae180);}return _0x42fd15[_0xd925('0x37')]();};}function saveUpdates(_0x217e1e,_0x37f310){return function(_0x6389e){if(_0x6389e){return _0x6389e[_0xd925('0x38')](_0x217e1e)[_0xd925('0x24')](function(_0x5ebc24){return _0x5ebc24;});}return null;};}function removeEntity(_0x2c82e4,_0x3d3d6e){return function(_0x271ae6){if(_0x271ae6){return _0x271ae6[_0xd925('0x39')]()['then'](function(){_0x2c82e4[_0xd925('0x2e')](0xcc)[_0xd925('0x3a')]();});}};}function handleEntityNotFound(_0x11cd5d,_0x506893){return function(_0x512914){if(!_0x512914){_0x11cd5d[_0xd925('0x2d')](0x194);}return _0x512914;};}function handleError(_0x381c3c,_0x1e8fee){_0x1e8fee=_0x1e8fee||0x1f4;return function(_0x48d7df){logger[_0xd925('0x28')](_0x48d7df['stack']);if(_0x48d7df[_0xd925('0x3b')]){delete _0x48d7df[_0xd925('0x3b')];}_0x381c3c['status'](_0x1e8fee)[_0xd925('0x3c')](_0x48d7df);};}exports[_0xd925('0x3d')]=function(_0x151ebf,_0x4f8e58){var _0x7b6ce9={},_0x565a1b={},_0x52189d={'count':0x0,'rows':[]};var _0x955fbe=_[_0xd925('0x3e')](db[_0xd925('0x3f')][_0xd925('0x40')],function(_0x1c72d6){return{'name':_0x1c72d6[_0xd925('0x41')],'type':_0x1c72d6['type']['key']};});_0x565a1b['model']=_[_0xd925('0x3e')](_0x955fbe,_0xd925('0x3b'));_0x565a1b[_0xd925('0x42')]=_['keys'](_0x151ebf['query']);_0x565a1b[_0xd925('0x43')]=_[_0xd925('0x44')](_0x565a1b[_0xd925('0x45')],_0x565a1b[_0xd925('0x42')]);_0x7b6ce9[_0xd925('0x46')]=_[_0xd925('0x44')](_0x565a1b[_0xd925('0x45')],qs[_0xd925('0x47')](_0x151ebf[_0xd925('0x42')]['fields']));_0x7b6ce9[_0xd925('0x46')]=_0x7b6ce9[_0xd925('0x46')][_0xd925('0x48')]?_0x7b6ce9['attributes']:_0x565a1b[_0xd925('0x45')];if(!_0x151ebf[_0xd925('0x42')]['hasOwnProperty']('nolimit')){_0x7b6ce9['limit']=qs['limit'](_0x151ebf['query'][_0xd925('0x32')]);_0x7b6ce9[_0xd925('0x31')]=qs['offset'](_0x151ebf[_0xd925('0x42')]['offset']);}_0x7b6ce9[_0xd925('0x49')]=qs[_0xd925('0x4a')](_0x151ebf['query'][_0xd925('0x4a')]);_0x7b6ce9['where']=qs['filters'](_[_0xd925('0x4b')](_0x151ebf[_0xd925('0x42')],_0x565a1b[_0xd925('0x43')]),_0x955fbe);if(_0x151ebf[_0xd925('0x42')][_0xd925('0x4c')]){_0x7b6ce9[_0xd925('0x4d')]=_['merge'](_0x7b6ce9[_0xd925('0x4d')],{'$or':_['map'](_0x955fbe,function(_0x11fbce){if(_0x11fbce[_0xd925('0x4e')]!==_0xd925('0x4f')){var _0x2e0acc={};_0x2e0acc[_0x11fbce[_0xd925('0x3b')]]={'$like':'%'+_0x151ebf[_0xd925('0x42')][_0xd925('0x4c')]+'%'};return _0x2e0acc;}})});}_0x7b6ce9=_[_0xd925('0x50')]({},_0x7b6ce9,_0x151ebf[_0xd925('0x51')]);var _0x16930e={'where':_0x7b6ce9[_0xd925('0x4d')]};return db['OpenchannelMessage'][_0xd925('0x30')](_0x16930e)['then'](function(_0x5088a5){_0x52189d['count']=_0x5088a5;if(_0x151ebf[_0xd925('0x42')][_0xd925('0x52')]){_0x7b6ce9[_0xd925('0x53')]=[{'all':!![]}];}return db[_0xd925('0x3f')][_0xd925('0x54')](_0x7b6ce9);})[_0xd925('0x24')](function(_0x58b5eb){_0x52189d[_0xd925('0x55')]=_0x58b5eb;return _0x52189d;})[_0xd925('0x24')](respondWithFilteredResult(_0x4f8e58,_0x7b6ce9))[_0xd925('0x56')](handleError(_0x4f8e58,null));};exports['show']=function(_0x143873,_0xf3b374){var _0x320de0={'raw':!![],'where':{'id':_0x143873[_0xd925('0x57')]['id']}},_0x432ac8={};_0x432ac8[_0xd925('0x45')]=_['keys'](db[_0xd925('0x3f')][_0xd925('0x40')]);_0x432ac8['query']=_[_0xd925('0x58')](_0x143873[_0xd925('0x42')]);_0x432ac8['filters']=_['intersection'](_0x432ac8[_0xd925('0x45')],_0x432ac8['query']);_0x320de0['attributes']=_['intersection'](_0x432ac8[_0xd925('0x45')],qs['fields'](_0x143873[_0xd925('0x42')][_0xd925('0x47')]));_0x320de0['attributes']=_0x320de0[_0xd925('0x46')]['length']?_0x320de0[_0xd925('0x46')]:_0x432ac8['model'];if(_0x143873[_0xd925('0x42')][_0xd925('0x52')]){_0x320de0[_0xd925('0x53')]=[{'all':!![]}];}_0x320de0=_[_0xd925('0x50')]({},_0x320de0,_0x143873[_0xd925('0x51')]);return db[_0xd925('0x3f')]['find'](_0x320de0)[_0xd925('0x24')](handleEntityNotFound(_0xf3b374,null))['then'](respondWithResult(_0xf3b374,null))['catch'](handleError(_0xf3b374,null));};exports[_0xd925('0x59')]=function(_0x5d7265,_0x514d36){return db[_0xd925('0x3f')]['create'](_0x5d7265[_0xd925('0x5a')],{})[_0xd925('0x24')](respondWithResult(_0x514d36,0xc9))[_0xd925('0x56')](handleError(_0x514d36,null));};exports[_0xd925('0x38')]=function(_0x41ba8c,_0x1c44b5){if(_0x41ba8c[_0xd925('0x5a')]['id']){delete _0x41ba8c[_0xd925('0x5a')]['id'];}return db['OpenchannelMessage'][_0xd925('0x5b')]({'where':{'id':_0x41ba8c['params']['id']}})['then'](handleEntityNotFound(_0x1c44b5,null))[_0xd925('0x24')](saveUpdates(_0x41ba8c[_0xd925('0x5a')],null))[_0xd925('0x24')](respondWithResult(_0x1c44b5,null))[_0xd925('0x56')](handleError(_0x1c44b5,null));};exports[_0xd925('0x39')]=function(_0x3075fa,_0x3dc1a9){return db[_0xd925('0x3f')]['find']({'where':{'id':_0x3075fa[_0xd925('0x57')]['id']}})['then'](handleEntityNotFound(_0x3dc1a9,null))['then'](removeEntity(_0x3dc1a9,null))[_0xd925('0x56')](handleError(_0x3dc1a9,null));};exports[_0xd925('0x5c')]=function(_0x3d1974,_0x1b2dca){return db[_0xd925('0x3f')][_0xd925('0x5c')]()['then'](respondWithResult(_0x1b2dca,null))['catch'](handleError(_0x1b2dca,null));};var interaction_log=require(_0xd925('0x5d'))('openchannel-interactions');exports[_0xd925('0x5e')]=function(_0x3cf4c8,_0x2a2086,_0x66961){var _0x235b41={'channel':_0xd925('0x5f')};if(_0x3cf4c8['body']['id']){delete _0x3cf4c8[_0xd925('0x5a')]['id'];}_0x3cf4c8[_0xd925('0x5a')][_0xd925('0x60')]=!![];_0x3cf4c8[_0xd925('0x5a')][_0xd925('0x61')]=moment()[_0xd925('0x62')](_0xd925('0x63'));_0x3cf4c8['body']['UserId']=_0x3cf4c8['body'][_0xd925('0x64')]||_0x3cf4c8[_0xd925('0x65')]['id'];return db['OpenchannelMessage'][_0xd925('0x5b')]({'where':{'id':_0x3cf4c8[_0xd925('0x57')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xd925('0x24')](handleEntityNotFound(_0x2a2086,null))[_0xd925('0x24')](saveUpdates(_0x3cf4c8[_0xd925('0x5a')],null))[_0xd925('0x24')](function(_0x54a07c){if(_0x54a07c){_0x235b41[_0xd925('0x2a')]=_0x54a07c[_0xd925('0x66')]({'plain':!![]});return db[_0xd925('0x67')][_0xd925('0x5b')]({'where':{'id':_0x54a07c['OpenchannelInteractionId']}});}return null;})[_0xd925('0x24')](handleEntityNotFound(_0x2a2086,null))[_0xd925('0x24')](function(_0x45bc01){if(_0x45bc01){return _0x45bc01[_0xd925('0x38')]({'UserId':_0x3cf4c8[_0xd925('0x5a')][_0xd925('0x64')],'read1stAt':_[_0xd925('0x68')](_0x45bc01['read1stAt'])?moment()[_0xd925('0x62')](_0xd925('0x63')):undefined});}return null;})[_0xd925('0x24')](function(_0x27bed1){if(_0x27bed1){_0x235b41[_0xd925('0x69')]=_0x27bed1[_0xd925('0x66')]({'plain':!![]});interaction_log[_0xd925('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cf4c8['user']['id'],_0x3cf4c8['user'][_0xd925('0x3b')],_0x3cf4c8['user']['role'],_0x235b41['interaction']['id'],_0x3cf4c8[_0xd925('0x5a')]?JSON[_0xd925('0x27')](_0x3cf4c8['body']):'null');return respondWithRpcPromise(_0xd925('0x6a'),_0xd925('0x6b'),_0x235b41);}return null;})[_0xd925('0x24')](function(_0xf5cdd4){if(_0xf5cdd4){if(_0x3cf4c8[_0xd925('0x5a')][_0xd925('0x6c')]){_0x235b41['message'][_0xd925('0x6d')]=util[_0xd925('0x62')](_0xd925('0x6e'),_0x3cf4c8[_0xd925('0x65')][_0xd925('0x3b')]);_0x235b41[_0xd925('0x2a')][_0xd925('0x6f')]=_0x235b41[_0xd925('0x6f')];_0x235b41[_0xd925('0x2a')][_0xd925('0x70')]=_0xd925('0x5e');return respondWithRpcPromise(_0xd925('0x71'),'EventManager',{'event':_0xd925('0x72'),'message':_0x235b41[_0xd925('0x2a')]},client9002)['then'](function(){return _0x235b41;});}return _0x235b41;}return null;})[_0xd925('0x24')](respondWithResult(_0x2a2086,null))[_0xd925('0x56')](handleError(_0x2a2086,null));};var interaction_log=require(_0xd925('0x5d'))('openchannel-interactions');exports['reject']=function(_0x6f4c53,_0x2e5950,_0x4c3d0c){var _0xdf5826={'agent':{},'channel':_0xd925('0x5f')};if(_0x6f4c53[_0xd925('0x5a')]['id']){delete _0x6f4c53['body']['id'];}_0x6f4c53['body'][_0xd925('0x64')]=_0x6f4c53[_0xd925('0x5a')]['UserId']||_0x6f4c53['user']['id'];_0xdf5826[_0xd925('0x73')]['id']=_0x6f4c53[_0xd925('0x5a')][_0xd925('0x64')];return db[_0xd925('0x3f')][_0xd925('0x5b')]({'where':{'id':_0x6f4c53[_0xd925('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e5950,null))[_0xd925('0x24')](function(_0x5ac003){if(_0x5ac003){_0xdf5826[_0xd925('0x2a')]=_0x5ac003[_0xd925('0x66')]({'plain':!![]});return db[_0xd925('0x67')][_0xd925('0x5b')]({'where':{'id':_0x5ac003['OpenchannelInteractionId']}});}return null;})[_0xd925('0x24')](handleEntityNotFound(_0x2e5950,null))[_0xd925('0x24')](function(_0x2a9485){if(_0x2a9485){_0xdf5826[_0xd925('0x69')]=_0x2a9485[_0xd925('0x66')]({'plain':!![]});interaction_log[_0xd925('0x25')](_0xd925('0x74'),_0x6f4c53[_0xd925('0x65')]['id'],_0x6f4c53['user'][_0xd925('0x3b')],_0x6f4c53[_0xd925('0x65')][_0xd925('0x75')],_0xdf5826[_0xd925('0x69')]['id'],_0x6f4c53[_0xd925('0x5a')]?JSON[_0xd925('0x27')](_0x6f4c53[_0xd925('0x5a')]):_0xd925('0x76'));return respondWithRpcPromise(_0xd925('0x77'),_0xd925('0x78'),_0xdf5826);}return null;})['then'](function(_0x1d1581){if(_0x1d1581){_0x1d1581[_0xd925('0x2a')]['interface']=util[_0xd925('0x62')](_0xd925('0x6e'),_0x6f4c53[_0xd925('0x65')][_0xd925('0x3b')]);_0x1d1581['message'][_0xd925('0x6f')]=_0xdf5826['channel'];_0x1d1581[_0xd925('0x2a')][_0xd925('0x70')]=_0xd925('0x36');respondWithRpcPromise('EventManager',_0xd925('0x71'),{'event':_0xd925('0x79'),'message':_0x1d1581[_0xd925('0x2a')]},client9002);return _0xdf5826;}return null;})[_0xd925('0x24')](respondWithResult(_0x2e5950,null))[_0xd925('0x56')](handleError(_0x2e5950,null));};
\ No newline at end of file
index a201438..8bfa5d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a5f=['events','OpenchannelMessage','update','remove','emit','hook','exports'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0x5a5f,0x85));var _0xf5a5=function(_0x23f8d2,_0x301fec){_0x23f8d2=_0x23f8d2-0x0;var _0x5d174b=_0x5a5f[_0x23f8d2];return _0x5d174b;};'use strict';var EventEmitter=require(_0xf5a5('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xf5a5('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf5a5('0x2'),'afterDestroy':_0xf5a5('0x3')};function emitEvent(_0xb204f8){return function(_0x1eec9c,_0x580ce0,_0x25f47d){OpenchannelMessageEvents[_0xf5a5('0x4')](_0xb204f8+':'+_0x1eec9c['id'],_0x1eec9c);OpenchannelMessageEvents['emit'](_0xb204f8,_0x1eec9c);_0x25f47d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xf5a5('0x5')](e,emitEvent(event));}}module[_0xf5a5('0x6')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xef57=['../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef57,0x1ee));var _0x7ef5=function(_0x42ef63,_0x5ad086){_0x42ef63=_0x42ef63-0x0;var _0x1796c5=_0xef57[_0x42ef63];return _0x1796c5;};'use strict';var EventEmitter=require(_0x7ef5('0x0'));var OpenchannelMessage=require(_0x7ef5('0x1'))['db'][_0x7ef5('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7ef5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7ef5('0x4'),'afterDestroy':_0x7ef5('0x5')};function emitEvent(_0x403a4d){return function(_0x61266c,_0x4b0eb4,_0x35c1f7){OpenchannelMessageEvents['emit'](_0x403a4d+':'+_0x61266c['id'],_0x61266c);OpenchannelMessageEvents[_0x7ef5('0x6')](_0x403a4d,_0x61266c);_0x35c1f7(null);};}for(var e in events){if(events[_0x7ef5('0x7')](e)){var event=events[e];OpenchannelMessage[_0x7ef5('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index 392e077..3f49280 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40d2=['Interactions','length','Interaction','omit','method','GET','POST','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','api','bluebird','path','../../config/environment','exports','OpenchannelMessage','fti_openchannel_messages','body','models','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s'];(function(_0x152a03,_0x41a4fe){var _0x3ccbd0=function(_0x4fbf24){while(--_0x4fbf24){_0x152a03['push'](_0x152a03['shift']());}};_0x3ccbd0(++_0x41a4fe);}(_0x40d2,0xf3));var _0x240d=function(_0xa4405e,_0x4b5af1){_0xa4405e=_0xa4405e-0x0;var _0x29e6a5=_0x40d2[_0xa4405e];return _0x29e6a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x240d('0x0'));var moment=require('moment');var BPromise=require(_0x240d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x240d('0x2'));var rimraf=require('rimraf');var config=require(_0x240d('0x3'));var attributes=require('./openchannelMessage.attributes');module[_0x240d('0x4')]=function(_0x38a2a4,_0x4d2905){return _0x38a2a4['define'](_0x240d('0x5'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x240d('0x6'),'fields':[_0x240d('0x7')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51a64d,_0x2a9ec4,_0x2dba99){var _0x3b3b16=_0x38a2a4[_0x240d('0x8')];var _0x19f5e3=_0x51a64d['get']({'plain':!![]});if(_0x19f5e3[_0x240d('0x9')][_0x240d('0xa')]()==='in'||_0x19f5e3[_0x240d('0x9')][_0x240d('0xa')]()===_0x240d('0xb')&&!_0x19f5e3[_0x240d('0xc')]&&!_['isNil'](_0x19f5e3[_0x240d('0xd')])){_0x3b3b16[_0x240d('0xe')][_0x240d('0xf')]({'where':{'id':_0x19f5e3['OpenchannelInteractionId']}})[_0x240d('0x10')](function(_0x37a2fb){if(_0x37a2fb){_0x37a2fb[_0x240d('0x11')]({'lastMsgAt':_0x19f5e3[_0x240d('0x12')],'lastMsgDirection':_0x19f5e3[_0x240d('0x9')]['toLowerCase']()});}})['catch'](function(_0x110598){console[_0x240d('0x13')](_0x110598);});}if(_0x19f5e3[_0x240d('0x9')]==='out'&&!_0x19f5e3[_0x240d('0xc')]){var _0x338355;_0x3b3b16[_0x240d('0x14')][_0x240d('0x15')]()['then'](function(_0x1efe49){return _0x3b3b16[_0x240d('0x16')][_0x240d('0x17')]({'where':{'id':_0x19f5e3[_0x240d('0x18')]},'include':[{'model':_0x3b3b16[_0x240d('0xe')],'as':'Interactions','where':{'id':_0x19f5e3[_0x240d('0x19')]},'limit':0x1,'include':[{'model':_0x3b3b16[_0x240d('0x14')],'as':_0x240d('0x1a'),'attributes':_['keys'](_0x1efe49)}]}]});})['then'](function(_0x1103db){_0x338355=_0x1103db[_0x240d('0x1b')]({'plain':!![]});if(_0x338355&&_0x338355[_0x240d('0x1c')]){logger[_0x240d('0x1d')](_0x240d('0x1e'),_0x240d('0x1f'),util['format'](_0x240d('0x20'),_0x19f5e3['id'],_0x338355['replyUri']));if(_0x338355[_0x240d('0x21')]&&_0x338355[_0x240d('0x21')][_0x240d('0x22')]){_0x19f5e3[_0x240d('0x23')]=_[_0x240d('0x24')](_0x338355[_0x240d('0x21')][0x0],_0x240d('0x1a'));_0x19f5e3[_0x240d('0x1a')]=_0x338355[_0x240d('0x21')][0x0][_0x240d('0x1a')];}var _0x2a9ec4={'method':'POST','uri':encodeURI(_0x338355[_0x240d('0x1c')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2a9ec4[_0x240d('0x25')]){case _0x240d('0x26'):_0x2a9ec4['qs']=_0x19f5e3;break;case _0x240d('0x27'):_0x2a9ec4[_0x240d('0x7')]=_0x19f5e3;break;}return rp(_0x2a9ec4)['then'](function(_0x462cc5){logger[_0x240d('0x1d')](_0x240d('0x1e'),'afterCreate',util[_0x240d('0x28')](_0x240d('0x29'),_0x19f5e3['id'],_0x338355[_0x240d('0x1c')]));if(_0x462cc5[_0x240d('0x7')][_0x240d('0x2a')]&&_0x462cc5[_0x240d('0x7')][_0x240d('0x2a')]!=_0x19f5e3[_0x240d('0x23')][_0x240d('0x2a')]){return _0x3b3b16[_0x240d('0xe')][_0x240d('0x11')]({'threadId':_0x462cc5['body']['threadId']},{'logging':!![],'where':{'id':_0x19f5e3[_0x240d('0x23')]['id']}});}else{return;}})['then'](function(){return _0x51a64d[_0x240d('0x11')]({'read':!![]});})['catch'](function(_0x2ba9dd){logger[_0x240d('0x13')](_0x240d('0x1e'),_0x240d('0x1f'),util[_0x240d('0x2b')](_0x2ba9dd,{'showHidden':![],'depth':null}));_0x2dba99();});}else{_0x2dba99();}})['finally'](function(){_0x2dba99();});}else{_0x2dba99();}}},'charset':_0x240d('0x2c'),'collate':_0x240d('0x2d')});};
\ No newline at end of file
+var _0x94cb=['api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','body','threadId','inspect','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0x94cb,0xcd));var _0xb94c=function(_0x41eabc,_0x5c0bcc){_0x41eabc=_0x41eabc-0x0;var _0x9ee4a4=_0x94cb[_0x41eabc];return _0x9ee4a4;};'use strict';var _=require(_0xb94c('0x0'));var util=require(_0xb94c('0x1'));var logger=require(_0xb94c('0x2'))(_0xb94c('0x3'));var moment=require('moment');var BPromise=require(_0xb94c('0x4'));var rp=require(_0xb94c('0x5'));var fs=require('fs');var path=require(_0xb94c('0x6'));var rimraf=require(_0xb94c('0x7'));var config=require(_0xb94c('0x8'));var attributes=require(_0xb94c('0x9'));module[_0xb94c('0xa')]=function(_0xc36ca2,_0x566c65){return _0xc36ca2[_0xb94c('0xb')](_0xb94c('0xc'),attributes,{'tableName':_0xb94c('0xd'),'paranoid':![],'indexes':[{'name':_0xb94c('0xe'),'fields':['body'],'type':_0xb94c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4327a2,_0x524b62,_0x370fc1){var _0x209e7a=_0xc36ca2[_0xb94c('0x10')];var _0x56ad8f=_0x4327a2[_0xb94c('0x11')]({'plain':!![]});if(_0x56ad8f[_0xb94c('0x12')][_0xb94c('0x13')]()==='in'||_0x56ad8f[_0xb94c('0x12')][_0xb94c('0x13')]()===_0xb94c('0x14')&&!_0x56ad8f[_0xb94c('0x15')]&&!_[_0xb94c('0x16')](_0x56ad8f['UserId'])){_0x209e7a[_0xb94c('0x17')][_0xb94c('0x18')]({'where':{'id':_0x56ad8f[_0xb94c('0x19')]}})[_0xb94c('0x1a')](function(_0x322c8b){if(_0x322c8b){_0x322c8b[_0xb94c('0x1b')]({'lastMsgAt':_0x56ad8f[_0xb94c('0x1c')],'lastMsgDirection':_0x56ad8f[_0xb94c('0x12')]['toLowerCase']()});}})[_0xb94c('0x1d')](function(_0x1ce046){console[_0xb94c('0x1e')](_0x1ce046);});}if(_0x56ad8f[_0xb94c('0x12')]==='out'&&!_0x56ad8f[_0xb94c('0x15')]){var _0x13e08a;_0x209e7a[_0xb94c('0x1f')]['describe']()[_0xb94c('0x1a')](function(_0x108adc){return _0x209e7a[_0xb94c('0x20')][_0xb94c('0x21')]({'where':{'id':_0x56ad8f['OpenchannelAccountId']},'include':[{'model':_0x209e7a[_0xb94c('0x17')],'as':_0xb94c('0x22'),'where':{'id':_0x56ad8f[_0xb94c('0x19')]},'limit':0x1,'include':[{'model':_0x209e7a[_0xb94c('0x1f')],'as':_0xb94c('0x23'),'attributes':_[_0xb94c('0x24')](_0x108adc)}]}]});})['then'](function(_0x304a42){_0x13e08a=_0x304a42['get']({'plain':!![]});if(_0x13e08a&&_0x13e08a[_0xb94c('0x25')]){logger[_0xb94c('0x26')](_0xb94c('0x27'),_0xb94c('0x28'),util[_0xb94c('0x29')](_0xb94c('0x2a'),_0x56ad8f['id'],_0x13e08a['replyUri']));if(_0x13e08a[_0xb94c('0x22')]&&_0x13e08a['Interactions']['length']){_0x56ad8f[_0xb94c('0x2b')]=_[_0xb94c('0x2c')](_0x13e08a[_0xb94c('0x22')][0x0],'Contact');_0x56ad8f[_0xb94c('0x23')]=_0x13e08a[_0xb94c('0x22')][0x0]['Contact'];}var _0x524b62={'method':_0xb94c('0x2d'),'uri':encodeURI(_0x13e08a['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x524b62[_0xb94c('0x2e')]){case'GET':_0x524b62['qs']=_0x56ad8f;break;case _0xb94c('0x2d'):_0x524b62[_0xb94c('0x2f')]=_0x56ad8f;break;}return rp(_0x524b62)[_0xb94c('0x1a')](function(_0xf74405){logger['info'](_0xb94c('0x27'),'afterCreate',util[_0xb94c('0x29')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x56ad8f['id'],_0x13e08a['replyUri']));if(_0xf74405[_0xb94c('0x2f')]['threadId']&&_0xf74405[_0xb94c('0x2f')][_0xb94c('0x30')]!=_0x56ad8f[_0xb94c('0x2b')][_0xb94c('0x30')]){return _0x209e7a[_0xb94c('0x17')][_0xb94c('0x1b')]({'threadId':_0xf74405[_0xb94c('0x2f')][_0xb94c('0x30')]},{'logging':!![],'where':{'id':_0x56ad8f['Interaction']['id']}});}else{return;}})[_0xb94c('0x1a')](function(){return _0x4327a2[_0xb94c('0x1b')]({'read':!![]});})[_0xb94c('0x1d')](function(_0x3f3ade){logger['error'](_0xb94c('0x27'),_0xb94c('0x28'),util[_0xb94c('0x31')](_0x3f3ade,{'showHidden':![],'depth':null}));_0x370fc1();});}else{_0x370fc1();}})[_0xb94c('0x32')](function(){_0x370fc1();});}else{_0x370fc1();}}},'charset':'utf8mb4','collate':_0xb94c('0x33')});};
\ No newline at end of file
index 5fbbd05..fa23095 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2015=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','lodash','util','moment','bluebird'];(function(_0x4717b8,_0x331c49){var _0x42a536=function(_0x580b33){while(--_0x580b33){_0x4717b8['push'](_0x4717b8['shift']());}};_0x42a536(++_0x331c49);}(_0x2015,0x193));var _0x5201=function(_0x3600f3,_0x5545e3){_0x3600f3=_0x3600f3-0x0;var _0x110426=_0x2015[_0x3600f3];return _0x110426;};'use strict';var _=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var moment=require(_0x5201('0x2'));var BPromise=require(_0x5201('0x3'));var rs=require(_0x5201('0x4'));var fs=require('fs');var Redis=require(_0x5201('0x5'));var db=require(_0x5201('0x6'))['db'];var utils=require(_0x5201('0x7'));var logger=require('../../config/logger')(_0x5201('0x8'));var config=require(_0x5201('0x9'));var jayson=require(_0x5201('0xa'));var client=jayson[_0x5201('0xb')][_0x5201('0xc')]({'port':0x232a});config[_0x5201('0xd')]=_[_0x5201('0xe')](config[_0x5201('0xd')],{'host':_0x5201('0xf'),'port':0x18eb});var socket=require(_0x5201('0x10'))(new Redis(config['redis']));require(_0x5201('0x11'))[_0x5201('0x12')](socket);function respondWithRpcPromise(_0x48b93d,_0x26e0d1,_0x28cb95){return new BPromise(function(_0x86a0c8,_0x47aa66){return client[_0x5201('0x13')](_0x48b93d,_0x28cb95)[_0x5201('0x14')](function(_0x356a38){logger[_0x5201('0x15')](_0x5201('0x16'),_0x26e0d1,_0x5201('0x17'));logger[_0x5201('0x18')](_0x5201('0x19'),_0x26e0d1,_0x5201('0x17'),JSON[_0x5201('0x1a')](_0x356a38));if(_0x356a38[_0x5201('0x1b')]){if(_0x356a38[_0x5201('0x1b')]['code']===0x1f4){logger[_0x5201('0x1b')](_0x5201('0x16'),_0x26e0d1,_0x356a38['error']['message']);return _0x47aa66(_0x356a38[_0x5201('0x1b')][_0x5201('0x1c')]);}logger[_0x5201('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x26e0d1,_0x356a38['error'][_0x5201('0x1c')]);return _0x86a0c8(_0x356a38['error'][_0x5201('0x1c')]);}else{logger['info'](_0x5201('0x16'),_0x26e0d1,'request\x20sent');_0x86a0c8(_0x356a38[_0x5201('0x1d')][_0x5201('0x1c')]);}})[_0x5201('0x1e')](function(_0x23d13e){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x26e0d1,_0x23d13e);_0x47aa66(_0x23d13e);});});}exports[_0x5201('0x1f')]=function(_0x261975){var _0x468317=this;return new Promise(function(_0x54a901,_0xd028ab){return db[_0x5201('0x20')][_0x5201('0x21')](_0x261975[_0x5201('0x22')],{'raw':_0x261975[_0x5201('0x23')]?_0x261975['options'][_0x5201('0x24')]===undefined?!![]:![]:!![]})[_0x5201('0x14')](function(_0x33c2bb){logger[_0x5201('0x15')](_0x5201('0x1f'),_0x261975);logger[_0x5201('0x18')](_0x5201('0x1f'),_0x261975,JSON['stringify'](_0x33c2bb));_0x54a901(_0x33c2bb);})[_0x5201('0x1e')](function(_0x428ce9){logger[_0x5201('0x1b')](_0x5201('0x1f'),_0x428ce9[_0x5201('0x1c')],_0x261975);_0xd028ab(_0x468317[_0x5201('0x1b')](0x1f4,_0x428ce9[_0x5201('0x1c')]));});});};
\ No newline at end of file
+var _0x7e27=['redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','then','request\x20sent','debug','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7e27,0xdd));var _0x77e2=function(_0xf5cf2a,_0x58dda9){_0xf5cf2a=_0xf5cf2a-0x0;var _0x1596eb=_0x7e27[_0xf5cf2a];return _0x1596eb;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var moment=require('moment');var BPromise=require(_0x77e2('0x2'));var rs=require(_0x77e2('0x3'));var fs=require('fs');var Redis=require(_0x77e2('0x4'));var db=require(_0x77e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77e2('0x6'))(_0x77e2('0x7'));var config=require(_0x77e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e2('0x9')]['http']({'port':0x232a});config[_0x77e2('0xa')]=_[_0x77e2('0xb')](config['redis'],{'host':_0x77e2('0xc'),'port':0x18eb});var socket=require(_0x77e2('0xd'))(new Redis(config[_0x77e2('0xa')]));require(_0x77e2('0xe'))[_0x77e2('0xf')](socket);function respondWithRpcPromise(_0x1907e9,_0x23583e,_0x5a5789){return new BPromise(function(_0x5022db,_0x1b4740){return client['request'](_0x1907e9,_0x5a5789)[_0x77e2('0x10')](function(_0xf8293f){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x23583e,_0x77e2('0x11'));logger[_0x77e2('0x12')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x23583e,_0x77e2('0x11'),JSON['stringify'](_0xf8293f));if(_0xf8293f['error']){if(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x14')]===0x1f4){logger[_0x77e2('0x13')](_0x77e2('0x15'),_0x23583e,_0xf8293f[_0x77e2('0x13')]['message']);return _0x1b4740(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);}logger['error'](_0x77e2('0x15'),_0x23583e,_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);return _0x5022db(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);}else{logger[_0x77e2('0x17')](_0x77e2('0x15'),_0x23583e,_0x77e2('0x11'));_0x5022db(_0xf8293f[_0x77e2('0x18')][_0x77e2('0x16')]);}})['catch'](function(_0x375fb0){logger[_0x77e2('0x13')](_0x77e2('0x15'),_0x23583e,_0x375fb0);_0x1b4740(_0x375fb0);});});}exports[_0x77e2('0x19')]=function(_0x3774b3){var _0x2aae6c=this;return new Promise(function(_0x1a5415,_0x1e5273){return db[_0x77e2('0x1a')][_0x77e2('0x1b')](_0x3774b3[_0x77e2('0x1c')],{'raw':_0x3774b3['options']?_0x3774b3[_0x77e2('0x1d')][_0x77e2('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x2d30d3){logger['info']('CreateOpenchannelMessage',_0x3774b3);logger[_0x77e2('0x12')]('CreateOpenchannelMessage',_0x3774b3,JSON[_0x77e2('0x1f')](_0x2d30d3));_0x1a5415(_0x2d30d3);})[_0x77e2('0x20')](function(_0x20eda4){logger['error']('CreateOpenchannelMessage',_0x20eda4[_0x77e2('0x16')],_0x3774b3);_0x1e5273(_0x2aae6c['error'](0x1f4,_0x20eda4[_0x77e2('0x16')]));});});};
\ No newline at end of file
index e1f7557..345f9db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['removeListener','register','./openchannelMessage.events'];(function(_0x3f5706,_0x27f482){var _0x41d11b=function(_0x37d7e){while(--_0x37d7e){_0x3f5706['push'](_0x3f5706['shift']());}};_0x41d11b(++_0x27f482);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1a8333,_0x43a941){_0x1a8333=_0x1a8333-0x0;var _0x343b19=_0xf4eb[_0x1a8333];return _0x343b19;};'use strict';var OpenchannelMessageEvents=require(_0xbf4e('0x0'));var events=['save','remove','update'];function createListener(_0x5ed5b9,_0xbbbf01){return function(_0x49d80e){_0xbbbf01['emit'](_0x5ed5b9,_0x49d80e);};}function removeListener(_0x2e3070,_0x1c7606){return function(){OpenchannelMessageEvents[_0xbf4e('0x1')](_0x2e3070,_0x1c7606);};}exports[_0xbf4e('0x2')]=function(_0xa4dcf5){for(var _0x2fcfed=0x0,_0x15b99f=events['length'];_0x2fcfed<_0x15b99f;_0x2fcfed++){var _0x449d55=events[_0x2fcfed];var _0x5013c2=createListener('openchannelMessage:'+_0x449d55,_0xa4dcf5);OpenchannelMessageEvents['on'](_0x449d55,_0x5013c2);}};
\ No newline at end of file
+var _0x9c44=['emit','removeListener','length','openchannelMessage:','remove','update'];(function(_0x4f9ed9,_0x5c65ac){var _0x4fe47a=function(_0xba221f){while(--_0xba221f){_0x4f9ed9['push'](_0x4f9ed9['shift']());}};_0x4fe47a(++_0x5c65ac);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){OpenchannelMessageEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);OpenchannelMessageEvents['on'](_0x436234,_0x511d53);}};
\ No newline at end of file
index 1658f31..c78299f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7c3=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated'];(function(_0x26e157,_0x11b15c){var _0x48b006=function(_0x410600){while(--_0x410600){_0x26e157['push'](_0x26e157['shift']());}};_0x48b006(++_0x11b15c);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x341c5e,_0x5246d9){_0x341c5e=_0x341c5e-0x0;var _0x30e673=_0xd7c3[_0x341c5e];return _0x30e673;};'use strict';var multer=require(_0x3d7c('0x0'));var util=require(_0x3d7c('0x1'));var path=require(_0x3d7c('0x2'));var timeout=require(_0x3d7c('0x3'));var express=require(_0x3d7c('0x4'));var router=express[_0x3d7c('0x5')]();var auth=require(_0x3d7c('0x6'));var interaction=require(_0x3d7c('0x7'));var config=require(_0x3d7c('0x8'));var controller=require('./openchannelQueue.controller');router[_0x3d7c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3d7c('0xa'),auth[_0x3d7c('0xb')](),controller[_0x3d7c('0xc')]);router[_0x3d7c('0x9')](_0x3d7c('0xd'),auth[_0x3d7c('0xb')](),controller[_0x3d7c('0xe')]);router[_0x3d7c('0x9')](_0x3d7c('0xf'),auth[_0x3d7c('0xb')](),controller[_0x3d7c('0x10')]);router[_0x3d7c('0x9')](_0x3d7c('0x11'),auth[_0x3d7c('0xb')](),controller[_0x3d7c('0x12')]);router[_0x3d7c('0x9')](_0x3d7c('0x13'),auth[_0x3d7c('0xb')](),controller['getAgents']);router[_0x3d7c('0x14')]('/',auth[_0x3d7c('0xb')](),controller[_0x3d7c('0x15')]);router[_0x3d7c('0x14')](_0x3d7c('0x11'),auth[_0x3d7c('0xb')](),controller[_0x3d7c('0x16')]);router[_0x3d7c('0x14')](_0x3d7c('0x13'),auth[_0x3d7c('0xb')](),controller[_0x3d7c('0x17')]);router[_0x3d7c('0x18')](_0x3d7c('0xd'),auth[_0x3d7c('0xb')](),controller[_0x3d7c('0x19')]);router[_0x3d7c('0x1a')]('/:id',auth[_0x3d7c('0xb')](),controller[_0x3d7c('0x1b')]);router['delete']('/:id/teams',auth[_0x3d7c('0xb')](),controller[_0x3d7c('0x1c')]);router[_0x3d7c('0x1a')](_0x3d7c('0x13'),auth['isAuthenticated'](),controller[_0x3d7c('0x1d')]);module[_0x3d7c('0x1e')]=router;
\ No newline at end of file
+var _0xb76d=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','create','post','addAgents','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4c1140,_0x2a8df3){var _0x13a00a=function(_0x1338df){while(--_0x1338df){_0x4c1140['push'](_0x4c1140['shift']());}};_0x13a00a(++_0x2a8df3);}(_0xb76d,0x119));var _0xdb76=function(_0x8bd0e1,_0x290d76){_0x8bd0e1=_0x8bd0e1-0x0;var _0x19ea08=_0xb76d[_0x8bd0e1];return _0x19ea08;};'use strict';var multer=require(_0xdb76('0x0'));var util=require('util');var path=require(_0xdb76('0x1'));var timeout=require(_0xdb76('0x2'));var express=require(_0xdb76('0x3'));var router=express['Router']();var auth=require(_0xdb76('0x4'));var interaction=require(_0xdb76('0x5'));var config=require(_0xdb76('0x6'));var controller=require(_0xdb76('0x7'));router[_0xdb76('0x8')]('/',auth[_0xdb76('0x9')](),controller['index']);router[_0xdb76('0x8')](_0xdb76('0xa'),auth[_0xdb76('0x9')](),controller[_0xdb76('0xb')]);router['get'](_0xdb76('0xc'),auth[_0xdb76('0x9')](),controller['show']);router[_0xdb76('0x8')](_0xdb76('0xd'),auth[_0xdb76('0x9')](),controller[_0xdb76('0xe')]);router[_0xdb76('0x8')](_0xdb76('0xf'),auth[_0xdb76('0x9')](),controller['getTeams']);router['get'](_0xdb76('0x10'),auth[_0xdb76('0x9')](),controller[_0xdb76('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdb76('0x12')]);router['post'](_0xdb76('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0xdb76('0x13')](_0xdb76('0x10'),auth[_0xdb76('0x9')](),controller[_0xdb76('0x14')]);router['put'](_0xdb76('0xc'),auth[_0xdb76('0x9')](),controller['update']);router[_0xdb76('0x15')](_0xdb76('0xc'),auth[_0xdb76('0x9')](),controller[_0xdb76('0x16')]);router[_0xdb76('0x15')](_0xdb76('0xf'),auth['isAuthenticated'](),controller[_0xdb76('0x17')]);router[_0xdb76('0x15')](_0xdb76('0x10'),auth['isAuthenticated'](),controller[_0xdb76('0x18')]);module[_0xdb76('0x19')]=router;
\ No newline at end of file
index a619e5c..b4b941f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5437=['sequelize','exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x41ef02,_0x101e1a){var _0x5e6995=function(_0x124fdd){while(--_0x124fdd){_0x41ef02['push'](_0x41ef02['shift']());}};_0x5e6995(++_0x101e1a);}(_0x5437,0x110));var _0x7543=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0x5437[_0x4cd690];return _0x4a74a9;};'use strict';var Sequelize=require(_0x7543('0x0'));module[_0x7543('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7543('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7543('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7543('0x4')](_0x7543('0x5'),_0x7543('0x6'),_0x7543('0x7'))}};
\ No newline at end of file
+var _0x9bb8=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x34ca7a,_0x2eecc2){var _0x12a55c=function(_0x546375){while(--_0x546375){_0x34ca7a['push'](_0x34ca7a['shift']());}};_0x12a55c(++_0x2eecc2);}(_0x9bb8,0x1ae));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x89bb('0x0'));module[_0x89bb('0x1')]={'name':{'type':Sequelize[_0x89bb('0x2')],'unique':_0x89bb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x89bb('0x2')]},'timeout':{'type':Sequelize[_0x89bb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x89bb('0x5')](_0x89bb('0x6'),_0x89bb('0x7'),_0x89bb('0x8'))}};
\ No newline at end of file
index 42dda75..245cbcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeefa=['spread','isArray','getAgents','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','OpenchannelQueue','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','openchannelPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','TeamId','union','compact','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents'];(function(_0x221822,_0x460663){var _0x2e5c0d=function(_0x1ebaee){while(--_0x1ebaee){_0x221822['push'](_0x221822['shift']());}};_0x2e5c0d(++_0x460663);}(_0xeefa,0x196));var _0xaeef=function(_0x3450e0,_0x8dc08a){_0x3450e0=_0x3450e0-0x0;var _0x35a01e=_0xeefa[_0x3450e0];return _0x35a01e;};'use strict';var pdf=require(_0xaeef('0x0'));var emlformat=require(_0xaeef('0x1'));var rimraf=require(_0xaeef('0x2'));var zipdir=require(_0xaeef('0x3'));var jsonpatch=require(_0xaeef('0x4'));var rp=require(_0xaeef('0x5'));var moment=require('moment');var BPromise=require(_0xaeef('0x6'));var Mustache=require('mustache');var util=require(_0xaeef('0x7'));var path=require('path');var sox=require(_0xaeef('0x8'));var csv=require(_0xaeef('0x9'));var ejs=require(_0xaeef('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaeef('0xb'));var crypto=require(_0xaeef('0xc'));var jsforce=require(_0xaeef('0xd'));var deskjs=require(_0xaeef('0xe'));var toCsv=require(_0xaeef('0x9'));var querystring=require(_0xaeef('0xf'));var Papa=require(_0xaeef('0x10'));var Redis=require('ioredis');var authService=require(_0xaeef('0x11'));var qs=require(_0xaeef('0x12'));var as=require(_0xaeef('0x13'));var hardwareService=require(_0xaeef('0x14'));var logger=require(_0xaeef('0x15'))('api');var utils=require(_0xaeef('0x16'));var config=require('../../config/environment');var db=require(_0xaeef('0x17'))['db'];config[_0xaeef('0x18')]=_['defaults'](config['redis'],{'host':_0xaeef('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaeef('0x1a'))[_0xaeef('0x1b')](socket);function respondWithStatusCode(_0x36f217,_0x225ed1){_0x225ed1=_0x225ed1||0xcc;return function(_0x2a11c0){if(_0x2a11c0){return _0x36f217[_0xaeef('0x1c')](_0x225ed1);}return _0x36f217[_0xaeef('0x1d')](_0x225ed1)[_0xaeef('0x1e')]();};}function respondWithResult(_0x2cadca,_0x4cffb0){_0x4cffb0=_0x4cffb0||0xc8;return function(_0x23bccc){if(_0x23bccc){return _0x2cadca[_0xaeef('0x1d')](_0x4cffb0)[_0xaeef('0x1f')](_0x23bccc);}};}function respondWithFilteredResult(_0x26c2a1,_0x4e536b){return function(_0x5490d9){if(_0x5490d9){var _0x59633f=_0x5490d9[_0xaeef('0x20')],_0x5317fd=_0x4e536b[_0xaeef('0x21')],_0x253b4e=_0x4e536b[_0xaeef('0x21')]+_0x4e536b[_0xaeef('0x22')],_0x304c56;if(_0x253b4e>=_0x59633f){_0x253b4e=_0x59633f;_0x304c56=0xc8;}else{_0x304c56=0xce;}_0x26c2a1[_0xaeef('0x1d')](_0x304c56);return _0x26c2a1[_0xaeef('0x23')](_0xaeef('0x24'),_0x5317fd+'-'+_0x253b4e+'/'+_0x59633f)[_0xaeef('0x1f')](_0x5490d9);}return null;};}function patchUpdates(_0x71bf5f){return function(_0x13bef7){try{jsonpatch[_0xaeef('0x25')](_0x13bef7,_0x71bf5f,!![]);}catch(_0x27a0cf){return BPromise[_0xaeef('0x26')](_0x27a0cf);}return _0x13bef7[_0xaeef('0x27')]();};}function saveUpdates(_0x5b601a,_0x4d4e65){return function(_0x4edde4){if(_0x4edde4){return _0x4edde4['update'](_0x5b601a)[_0xaeef('0x28')](function(_0x57869d){return _0x57869d;});}return null;};}function removeEntity(_0x8d7b83,_0x510bc4){return function(_0x55e1c5){if(_0x55e1c5){return _0x55e1c5[_0xaeef('0x29')]()[_0xaeef('0x28')](function(){var _0x4817ff=_0x55e1c5[_0xaeef('0x2a')]({'plain':!![]});var _0x3c1941='OpenchannelQueues';return db[_0xaeef('0x2b')][_0xaeef('0x29')]({'where':{'type':_0x3c1941,'resourceId':_0x4817ff['id']}})[_0xaeef('0x28')](function(){return _0x55e1c5;});})['then'](function(){_0x8d7b83[_0xaeef('0x1d')](0xcc)[_0xaeef('0x1e')]();});}};}function handleEntityNotFound(_0x5535e1,_0x35454a){return function(_0x2001c7){if(!_0x2001c7){_0x5535e1[_0xaeef('0x1c')](0x194);}return _0x2001c7;};}function handleError(_0x35c939,_0x27d5bd){_0x27d5bd=_0x27d5bd||0x1f4;return function(_0xcb09b6){logger[_0xaeef('0x2c')](_0xcb09b6[_0xaeef('0x2d')]);if(_0xcb09b6[_0xaeef('0x2e')]){delete _0xcb09b6[_0xaeef('0x2e')];}_0x35c939['status'](_0x27d5bd)['send'](_0xcb09b6);};}exports[_0xaeef('0x2f')]=function(_0x4208db,_0x3dc38d){var _0x214378={},_0x4a8c6d={},_0x5651da={'count':0x0,'rows':[]};var _0x275047=_[_0xaeef('0x30')](db[_0xaeef('0x31')]['rawAttributes'],function(_0x2c7dcb){return{'name':_0x2c7dcb[_0xaeef('0x32')],'type':_0x2c7dcb[_0xaeef('0x33')]['key']};});_0x4a8c6d['model']=_[_0xaeef('0x30')](_0x275047,_0xaeef('0x2e'));_0x4a8c6d[_0xaeef('0x34')]=_[_0xaeef('0x35')](_0x4208db['query']);_0x4a8c6d['filters']=_[_0xaeef('0x36')](_0x4a8c6d[_0xaeef('0x37')],_0x4a8c6d['query']);_0x214378[_0xaeef('0x38')]=_[_0xaeef('0x36')](_0x4a8c6d[_0xaeef('0x37')],qs['fields'](_0x4208db['query'][_0xaeef('0x39')]));_0x214378[_0xaeef('0x38')]=_0x214378['attributes'][_0xaeef('0x3a')]?_0x214378[_0xaeef('0x38')]:_0x4a8c6d[_0xaeef('0x37')];if(!_0x4208db[_0xaeef('0x34')][_0xaeef('0x3b')](_0xaeef('0x3c'))){_0x214378[_0xaeef('0x22')]=qs[_0xaeef('0x22')](_0x4208db['query'][_0xaeef('0x22')]);_0x214378['offset']=qs['offset'](_0x4208db[_0xaeef('0x34')][_0xaeef('0x21')]);}_0x214378[_0xaeef('0x3d')]=qs[_0xaeef('0x3e')](_0x4208db[_0xaeef('0x34')][_0xaeef('0x3e')]);_0x214378['where']=qs[_0xaeef('0x3f')](_[_0xaeef('0x40')](_0x4208db[_0xaeef('0x34')],_0x4a8c6d[_0xaeef('0x3f')]),_0x275047);if(_0x4208db['query'][_0xaeef('0x41')]){_0x214378[_0xaeef('0x42')]=_[_0xaeef('0x43')](_0x214378[_0xaeef('0x42')],{'$or':_[_0xaeef('0x30')](_0x275047,function(_0x163f71){if(_0x163f71[_0xaeef('0x33')]!=='VIRTUAL'){var _0x54b18f={};_0x54b18f[_0x163f71[_0xaeef('0x2e')]]={'$like':'%'+_0x4208db[_0xaeef('0x34')][_0xaeef('0x41')]+'%'};return _0x54b18f;}})});}_0x214378=_[_0xaeef('0x43')]({},_0x214378,_0x4208db[_0xaeef('0x44')]);var _0x30eac8={'where':_0x214378['where']};return db[_0xaeef('0x31')][_0xaeef('0x20')](_0x30eac8)[_0xaeef('0x28')](function(_0x51afe5){_0x5651da[_0xaeef('0x20')]=_0x51afe5;if(_0x4208db[_0xaeef('0x34')][_0xaeef('0x45')]){_0x214378[_0xaeef('0x46')]=[{'all':!![]}];}return db[_0xaeef('0x31')][_0xaeef('0x47')](_0x214378);})[_0xaeef('0x28')](function(_0x173c41){_0x5651da[_0xaeef('0x48')]=_0x173c41;return _0x5651da;})['then'](respondWithFilteredResult(_0x3dc38d,_0x214378))[_0xaeef('0x49')](handleError(_0x3dc38d,null));};exports[_0xaeef('0x4a')]=function(_0x489d6c,_0x3db99f){var _0xeaa444={'raw':!![],'where':{'id':_0x489d6c[_0xaeef('0x4b')]['id']}},_0x4f943b={};_0x4f943b[_0xaeef('0x37')]=_[_0xaeef('0x35')](db[_0xaeef('0x31')][_0xaeef('0x4c')]);_0x4f943b['query']=_[_0xaeef('0x35')](_0x489d6c[_0xaeef('0x34')]);_0x4f943b[_0xaeef('0x3f')]=_[_0xaeef('0x36')](_0x4f943b['model'],_0x4f943b[_0xaeef('0x34')]);_0xeaa444[_0xaeef('0x38')]=_['intersection'](_0x4f943b[_0xaeef('0x37')],qs[_0xaeef('0x39')](_0x489d6c['query'][_0xaeef('0x39')]));_0xeaa444['attributes']=_0xeaa444['attributes'][_0xaeef('0x3a')]?_0xeaa444['attributes']:_0x4f943b[_0xaeef('0x37')];if(_0x489d6c['query'][_0xaeef('0x45')]){_0xeaa444[_0xaeef('0x46')]=[{'all':!![]}];}_0xeaa444=_[_0xaeef('0x43')]({},_0xeaa444,_0x489d6c[_0xaeef('0x44')]);return db['OpenchannelQueue'][_0xaeef('0x4d')](_0xeaa444)[_0xaeef('0x28')](handleEntityNotFound(_0x3db99f,null))['then'](respondWithResult(_0x3db99f,null))['catch'](handleError(_0x3db99f,null));};exports[_0xaeef('0x4e')]=function(_0x23386a,_0x384a1c){return db[_0xaeef('0x31')]['create'](_0x23386a['body'],{})[_0xaeef('0x28')](function(_0x335ada){var _0x34366e=_0x23386a[_0xaeef('0x4f')][_0xaeef('0x2a')]({'plain':!![]});if(!_0x34366e)throw new Error(_0xaeef('0x50'));if(_0x34366e[_0xaeef('0x51')]===_0xaeef('0x4f')){var _0x56d660=_0x335ada[_0xaeef('0x2a')]({'plain':!![]});var _0x44b63a=_0xaeef('0x52');return db[_0xaeef('0x53')][_0xaeef('0x4d')]({'where':{'name':_0x44b63a,'userProfileId':_0x34366e[_0xaeef('0x54')]},'raw':!![]})[_0xaeef('0x28')](function(_0x37b3fd){if(_0x37b3fd&&_0x37b3fd[_0xaeef('0x55')]===0x0){return db[_0xaeef('0x2b')][_0xaeef('0x4e')]({'name':_0x56d660['name'],'resourceId':_0x56d660['id'],'type':_0x37b3fd[_0xaeef('0x2e')],'sectionId':_0x37b3fd['id']},{})[_0xaeef('0x28')](function(){return _0x335ada;});}else{return _0x335ada;}})[_0xaeef('0x49')](function(_0x55e36f){logger[_0xaeef('0x2c')](_0xaeef('0x56'),_0x55e36f);throw _0x55e36f;});}return _0x335ada;})[_0xaeef('0x28')](respondWithResult(_0x384a1c,0xc9))[_0xaeef('0x49')](handleError(_0x384a1c,null));};exports[_0xaeef('0x57')]=function(_0x5b1bbd,_0x44ef9b){if(_0x5b1bbd['body']['id']){delete _0x5b1bbd[_0xaeef('0x58')]['id'];}return db['OpenchannelQueue'][_0xaeef('0x4d')]({'where':{'id':_0x5b1bbd[_0xaeef('0x4b')]['id']}})[_0xaeef('0x28')](handleEntityNotFound(_0x44ef9b,null))[_0xaeef('0x28')](saveUpdates(_0x5b1bbd[_0xaeef('0x58')],null))['then'](respondWithResult(_0x44ef9b,null))[_0xaeef('0x49')](handleError(_0x44ef9b,null));};exports[_0xaeef('0x29')]=function(_0xb1e922,_0x20925c){return db[_0xaeef('0x31')][_0xaeef('0x4d')]({'where':{'id':_0xb1e922['params']['id']}})[_0xaeef('0x28')](handleEntityNotFound(_0x20925c,null))[_0xaeef('0x28')](removeEntity(_0x20925c,null))[_0xaeef('0x49')](handleError(_0x20925c,null));};exports[_0xaeef('0x59')]=function(_0x4bf731,_0x2d7a75){return db[_0xaeef('0x31')][_0xaeef('0x59')]()['then'](respondWithResult(_0x2d7a75,null))[_0xaeef('0x49')](handleError(_0x2d7a75,null));};exports[_0xaeef('0x5a')]=function(_0x432227,_0x51e726,_0x2801ac){var _0x15e142={'raw':!![],'where':{}},_0xde3eea={},_0x16b3aa;return db[_0xaeef('0x31')]['findOne']({'where':{'id':_0x432227[_0xaeef('0x4b')]['id']}})[_0xaeef('0x28')](handleEntityNotFound(_0x51e726,null))[_0xaeef('0x28')](function(_0x768e6){if(_0x768e6){_0x16b3aa=_0x768e6[_0xaeef('0x2a')]({'plain':!![]});_0xde3eea[_0xaeef('0x37')]=_['keys'](db[_0xaeef('0x5b')][_0xaeef('0x4c')]);_0xde3eea[_0xaeef('0x34')]=_[_0xaeef('0x35')](_0x432227[_0xaeef('0x34')]);_0xde3eea['filters']=_[_0xaeef('0x36')](_0xde3eea[_0xaeef('0x37')],_0xde3eea[_0xaeef('0x34')]);_0x15e142['attributes']=_['intersection'](_0xde3eea[_0xaeef('0x37')],qs[_0xaeef('0x39')](_0x432227[_0xaeef('0x34')][_0xaeef('0x39')]));_0x15e142[_0xaeef('0x38')]=_0x15e142['attributes'][_0xaeef('0x3a')]?_0x15e142[_0xaeef('0x38')]:_0xde3eea[_0xaeef('0x37')];if(!_0x432227[_0xaeef('0x34')][_0xaeef('0x3b')]('nolimit')){_0x15e142['limit']=qs[_0xaeef('0x22')](_0x432227[_0xaeef('0x34')][_0xaeef('0x22')]);_0x15e142['offset']=qs[_0xaeef('0x21')](_0x432227['query'][_0xaeef('0x21')]);}_0x15e142[_0xaeef('0x3d')]=qs[_0xaeef('0x3e')](_0x432227[_0xaeef('0x34')][_0xaeef('0x3e')]);_0x15e142[_0xaeef('0x42')]=qs[_0xaeef('0x3f')](_['pick'](_0x432227[_0xaeef('0x34')],_0xde3eea[_0xaeef('0x3f')]));_0x15e142[_0xaeef('0x42')][_0xaeef('0x5c')]=_0x768e6['id'];if(_0x432227[_0xaeef('0x34')]['filter']){_0x15e142[_0xaeef('0x42')]=_[_0xaeef('0x43')](_0x15e142[_0xaeef('0x42')],{'$or':_[_0xaeef('0x30')](_0x15e142[_0xaeef('0x38')],function(_0xbd011e){var _0x1568bc={};_0x1568bc[_0xbd011e]={'$like':'%'+_0x432227[_0xaeef('0x34')][_0xaeef('0x41')]+'%'};return _0x1568bc;})});}_0x15e142=_[_0xaeef('0x43')]({},_0x15e142,_0x432227[_0xaeef('0x44')]);return db[_0xaeef('0x5b')][_0xaeef('0x47')](_0x15e142);}})[_0xaeef('0x28')](function(_0x394658){if(_0x394658){return db[_0xaeef('0x5d')][_0xaeef('0x5e')]({'where':{'id':_[_0xaeef('0x30')](_0x394658,'UserId'),'role':'agent'},'attributes':['id','name',_0xaeef('0x5f'),_0xaeef('0x60'),_0xaeef('0x61')]});}})[_0xaeef('0x28')](function(_0x50b0a7){if(_0x50b0a7){return{'count':_0x50b0a7[_0xaeef('0x20')],'rows':_['map'](_0x50b0a7[_0xaeef('0x48')],function(_0x33ecf2){return{'membername':_0x33ecf2['name'],'UserId':_0x33ecf2['id'],'queue_name':_0x16b3aa[_0xaeef('0x2e')],'OpenchannelQueueId':_0x16b3aa['id'],'interface':util['format'](_0xaeef('0x62'),'SIP',_0x33ecf2[_0xaeef('0x2e')]),'penalty':0x0,'paused':_0x33ecf2[_0xaeef('0x5f')],'createdAt':_0x33ecf2[_0xaeef('0x61')],'updatedAt':_0x33ecf2[_0xaeef('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaeef('0x28')](respondWithFilteredResult(_0x51e726,_0x15e142))['catch'](handleError(_0x51e726,null));};exports[_0xaeef('0x63')]=function(_0x5870ff,_0x4c97a3,_0xce5547){var _0x58e506={};var _0x47694d={};var _0x555c51;var _0x43bb79;return db[_0xaeef('0x31')]['findOne']({'where':{'id':_0x5870ff[_0xaeef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c97a3,null))[_0xaeef('0x28')](function(_0x11ceca){if(_0x11ceca){_0x555c51=_0x11ceca;_0x47694d[_0xaeef('0x37')]=_[_0xaeef('0x35')](db[_0xaeef('0x64')][_0xaeef('0x4c')]);_0x47694d['query']=_['keys'](_0x5870ff[_0xaeef('0x34')]);_0x47694d[_0xaeef('0x3f')]=_[_0xaeef('0x36')](_0x47694d[_0xaeef('0x37')],_0x47694d['query']);_0x58e506[_0xaeef('0x38')]=_[_0xaeef('0x36')](_0x47694d[_0xaeef('0x37')],qs[_0xaeef('0x39')](_0x5870ff['query']['fields']));_0x58e506[_0xaeef('0x38')]=_0x58e506[_0xaeef('0x38')][_0xaeef('0x3a')]?_0x58e506[_0xaeef('0x38')]:_0x47694d[_0xaeef('0x37')];_0x58e506[_0xaeef('0x3d')]=qs['sort'](_0x5870ff[_0xaeef('0x34')][_0xaeef('0x3e')]);_0x58e506['where']=qs['filters'](_[_0xaeef('0x40')](_0x5870ff[_0xaeef('0x34')],_0x47694d[_0xaeef('0x3f')]));if(_0x5870ff[_0xaeef('0x34')][_0xaeef('0x41')]){_0x58e506[_0xaeef('0x42')]=_['merge'](_0x58e506[_0xaeef('0x42')],{'$or':_[_0xaeef('0x30')](_0x58e506['attributes'],function(_0x222b33){var _0x2a2fa8={};_0x2a2fa8[_0x222b33]={'$like':'%'+_0x5870ff[_0xaeef('0x34')]['filter']+'%'};return _0x2a2fa8;})});}_0x58e506=_['merge']({},_0x58e506,_0x5870ff[_0xaeef('0x44')]);return _0x555c51[_0xaeef('0x63')](_0x58e506);}})['then'](function(_0x16c56e){if(_0x16c56e){_0x43bb79=_0x16c56e[_0xaeef('0x3a')];if(!_0x5870ff['query'][_0xaeef('0x3b')](_0xaeef('0x3c'))){_0x58e506[_0xaeef('0x22')]=qs[_0xaeef('0x22')](_0x5870ff[_0xaeef('0x34')][_0xaeef('0x22')]);_0x58e506[_0xaeef('0x21')]=qs[_0xaeef('0x21')](_0x5870ff['query'][_0xaeef('0x21')]);}return _0x555c51[_0xaeef('0x63')](_0x58e506);}})[_0xaeef('0x28')](function(_0x3dfd3e){if(_0x3dfd3e){return _0x3dfd3e?{'count':_0x43bb79,'rows':_0x3dfd3e}:null;}})[_0xaeef('0x28')](respondWithResult(_0x4c97a3,null))[_0xaeef('0x49')](handleError(_0x4c97a3,null));};exports[_0xaeef('0x65')]=function(_0x4b4775,_0x20525b,_0x1cf297){var _0x10afe1=_0x4b4775[_0xaeef('0x58')][_0xaeef('0x66')];return db[_0xaeef('0x64')][_0xaeef('0x47')]({'where':{'id':_0x10afe1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xaeef('0x67'),'attributes':['id',_0xaeef('0x2e'),'online',_0xaeef('0x68'),_0xaeef('0x69')],'raw':!![]}]})[_0xaeef('0x28')](function(_0x2baeb6){if(_0x2baeb6){var _0x16b042=_[_0xaeef('0x6a')](_0x2baeb6,function(_0x28fc3){var _0x47ddf4=_0x28fc3[_0xaeef('0x2a')]({'plain':!![]});return _0x47ddf4[_0xaeef('0x67')];});return db[_0xaeef('0x31')][_0xaeef('0x4d')]({'where':{'id':_0x4b4775['params']['id']}})[_0xaeef('0x28')](function(_0x173cf2){return db[_0xaeef('0x6b')][_0xaeef('0x6c')](function(_0x3bf231){return _0x173cf2[_0xaeef('0x65')](_0x10afe1,{'transaction':_0x3bf231})['then'](function(){return BPromise[_0xaeef('0x6d')](_0x16b042,function(_0x278c91){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x278c91['id'],'OpenchannelQueueId':_0x4b4775[_0xaeef('0x4b')]['id']},'transaction':_0x3bf231});});})[_0xaeef('0x28')](function(){_0x16b042[_0xaeef('0x6e')](function(_0x153cd3){socket[_0xaeef('0x6f')](_0xaeef('0x70'),{'UserId':_0x153cd3['id'],'OpenchannelQueueId':_0x173cf2['id']});});});});});}})[_0xaeef('0x28')](respondWithStatusCode(_0x20525b,null))[_0xaeef('0x49')](handleError(_0x20525b,null));};exports['removeTeams']=function(_0x2a0588,_0x15bfda,_0x1a19e5){return db[_0xaeef('0x64')][_0xaeef('0x47')]({'where':{'id':_0x2a0588['query'][_0xaeef('0x66')]},'attributes':['id'],'include':[{'model':db[_0xaeef('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xaeef('0x28')](handleEntityNotFound(_0x15bfda,null))[_0xaeef('0x28')](function(_0xc7bb85){var _0x363380=_['map'](_0xc7bb85,'id');var _0x33fcc4=[];var _0x2d650e=[];var _0x575a21=squel[_0xaeef('0x71')]();_0x575a21[_0xaeef('0x72')](_0xaeef('0x73'))[_0xaeef('0x74')](_0xaeef('0x75'),'tq')[_0xaeef('0x76')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xaeef('0x42')](_0xaeef('0x77'),_0x2a0588['params']['id']);for(var _0x15a364=0x0;_0x15a364<_0xc7bb85['length'];_0x15a364+=0x1){let _0x243894=_0xc7bb85[_0x15a364];for(var _0x2dc6d3=0x0;_0x2dc6d3<_0x243894[_0xaeef('0x67')][_0xaeef('0x3a')];_0x2dc6d3+=0x1){let _0x76ab25=_0x243894['Agents'][_0x2dc6d3];var _0x933498=_0x575a21[_0xaeef('0x78')]();_0x933498[_0xaeef('0x42')](_0xaeef('0x79'),_0x76ab25['id']);_0x2d650e['push'](db[_0xaeef('0x6b')]['query'](_0x933498['toString'](),{'type':db[_0xaeef('0x6b')]['QueryTypes'][_0xaeef('0x7a')]})[_0xaeef('0x28')](function(_0x5e1718){if(_0x5e1718['length']===0x1){return _0x76ab25['id'];}else{var _0x167b33=_['every'](_[_0xaeef('0x30')](_0x5e1718,_0xaeef('0x7b')),function(_0x1371cc){return _['includes'](_0x363380,_0x1371cc);});if(_0x167b33){return _0x76ab25['id'];}}}));}}return BPromise['all'](_0x2d650e)[_0xaeef('0x28')](function(_0x11ec8a){_0x33fcc4=_(_0x33fcc4)[_0xaeef('0x7c')](_0x11ec8a)[_0xaeef('0x7d')]()['value']();return db[_0xaeef('0x31')][_0xaeef('0x4d')]({'where':{'id':_0x2a0588[_0xaeef('0x4b')]['id']}})[_0xaeef('0x28')](function(_0x11e28f){return db[_0xaeef('0x6b')]['transaction'](function(_0x5f378c){return _0x11e28f['removeTeams'](_0x2a0588[_0xaeef('0x34')]['ids'],{'transaction':_0x5f378c})[_0xaeef('0x28')](function(){if(!_[_0xaeef('0x7e')](_0x33fcc4)){return _0x11e28f[_0xaeef('0x7f')](_0x33fcc4,{'transaction':_0x5f378c});}})['then'](function(){_0x33fcc4['forEach'](function(_0x29c011){socket['emit'](_0xaeef('0x80'),{'UserId':_0x29c011,'OpenchannelQueueId':_0x11e28f['id']});});});});});});})[_0xaeef('0x28')](respondWithStatusCode(_0x15bfda,null))['catch'](handleError(_0x15bfda,null));};exports[_0xaeef('0x81')]=function(_0x5d036e,_0x3f792e,_0x45d16c){return db['OpenchannelQueue']['find']({'where':{'id':_0x5d036e[_0xaeef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f792e,null))['then'](function(_0x58b3b6){if(_0x58b3b6){return _0x58b3b6[_0xaeef('0x81')](_0x5d036e[_0xaeef('0x58')][_0xaeef('0x66')],_['omit'](_0x5d036e['body'],['ids','id'])||{})[_0xaeef('0x82')](function(_0x21f24b){for(var _0x15baca=0x0;_0x15baca<_0x5d036e[_0xaeef('0x58')][_0xaeef('0x66')][_0xaeef('0x3a')];_0x15baca+=0x1){socket[_0xaeef('0x6f')]('userOpenchannelQueue:save',{'UserId':_0x5d036e['body'][_0xaeef('0x66')][_0x15baca],'OpenchannelQueueId':_0x5d036e[_0xaeef('0x4b')]['id']});}return _0x21f24b;});}})[_0xaeef('0x28')](respondWithResult(_0x3f792e,null))[_0xaeef('0x49')](handleError(_0x3f792e,null));};exports['removeAgents']=function(_0x145c51,_0x26b9e3,_0x3178c6){return db[_0xaeef('0x31')][_0xaeef('0x4d')]({'where':{'id':_0x145c51['params']['id']}})[_0xaeef('0x28')](handleEntityNotFound(_0x26b9e3,null))[_0xaeef('0x28')](function(_0x2ef2f3){if(_0x2ef2f3){return _0x2ef2f3['removeAgents'](_0x145c51[_0xaeef('0x34')][_0xaeef('0x66')])['then'](function(){if(_[_0xaeef('0x83')](_0x145c51['query'][_0xaeef('0x66')])){for(var _0x567c40=0x0;_0x567c40<_0x145c51[_0xaeef('0x34')][_0xaeef('0x66')][_0xaeef('0x3a')];_0x567c40+=0x1){socket[_0xaeef('0x6f')](_0xaeef('0x80'),{'UserId':Number(_0x145c51[_0xaeef('0x34')]['ids'][_0x567c40]),'OpenchannelQueueId':Number(_0x145c51[_0xaeef('0x4b')]['id'])});}}else{socket[_0xaeef('0x6f')](_0xaeef('0x80'),{'UserId':Number(_0x145c51['query']['ids']),'OpenchannelQueueId':Number(_0x145c51[_0xaeef('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x26b9e3,null))['catch'](handleError(_0x26b9e3,null));};exports[_0xaeef('0x84')]=function(_0x1f3b1f,_0x2572e6,_0x22ac64){var _0x47f554={};var _0x4edeac={};var _0x550c36;var _0x52d187;return db['OpenchannelQueue'][_0xaeef('0x85')]({'where':{'id':_0x1f3b1f[_0xaeef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2572e6,null))[_0xaeef('0x28')](function(_0x30c432){if(_0x30c432){_0x550c36=_0x30c432;_0x4edeac[_0xaeef('0x37')]=_['keys'](db['User'][_0xaeef('0x4c')]);_0x4edeac[_0xaeef('0x34')]=_[_0xaeef('0x35')](_0x1f3b1f[_0xaeef('0x34')]);_0x4edeac[_0xaeef('0x3f')]=_['intersection'](_0x4edeac[_0xaeef('0x37')],_0x4edeac['query']);_0x47f554[_0xaeef('0x38')]=_[_0xaeef('0x36')](_0x4edeac[_0xaeef('0x37')],qs[_0xaeef('0x39')](_0x1f3b1f[_0xaeef('0x34')][_0xaeef('0x39')]));_0x47f554['attributes']=_0x47f554[_0xaeef('0x38')]['length']?_0x47f554[_0xaeef('0x38')]:_0x4edeac[_0xaeef('0x37')];_0x47f554[_0xaeef('0x3d')]=qs['sort'](_0x1f3b1f[_0xaeef('0x34')][_0xaeef('0x3e')]);_0x47f554[_0xaeef('0x42')]=qs[_0xaeef('0x3f')](_[_0xaeef('0x40')](_0x1f3b1f[_0xaeef('0x34')],_0x4edeac['filters']));if(_0x1f3b1f[_0xaeef('0x34')][_0xaeef('0x41')]){_0x47f554[_0xaeef('0x42')]=_[_0xaeef('0x43')](_0x47f554[_0xaeef('0x42')],{'$or':_[_0xaeef('0x30')](_0x47f554['attributes'],function(_0x5385e9){var _0x128f13={};_0x128f13[_0x5385e9]={'$like':'%'+_0x1f3b1f['query']['filter']+'%'};return _0x128f13;})});}_0x47f554=_[_0xaeef('0x43')]({},_0x47f554,_0x1f3b1f[_0xaeef('0x44')]);return _0x550c36['getAgents'](_0x47f554);}})[_0xaeef('0x28')](function(_0x5dccd6){if(_0x5dccd6){_0x52d187=_0x5dccd6[_0xaeef('0x3a')];if(!_0x1f3b1f[_0xaeef('0x34')][_0xaeef('0x3b')](_0xaeef('0x3c'))){_0x47f554['limit']=qs[_0xaeef('0x22')](_0x1f3b1f[_0xaeef('0x34')][_0xaeef('0x22')]);_0x47f554[_0xaeef('0x21')]=qs[_0xaeef('0x21')](_0x1f3b1f[_0xaeef('0x34')][_0xaeef('0x21')]);}return _0x550c36['getAgents'](_0x47f554);}})[_0xaeef('0x28')](function(_0x494aa3){if(_0x494aa3){return _0x494aa3?{'count':_0x52d187,'rows':_0x494aa3}:null;}})[_0xaeef('0x28')](respondWithResult(_0x2572e6,null))[_0xaeef('0x49')](handleError(_0x2572e6,null));};
\ No newline at end of file
+var _0x9e92=['openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','Agents','field','from','team_has_openchannel_queues','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','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','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','name','send','index','map','OpenchannelQueue','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserOpenchannelQueue','order','OpenchannelQueueId','User','UserId','agent'];(function(_0x3ac1e4,_0x3664a2){var _0x5567b9=function(_0x445063){while(--_0x445063){_0x3ac1e4['push'](_0x3ac1e4['shift']());}};_0x5567b9(++_0x3664a2);}(_0x9e92,0xbb));var _0x29e9=function(_0x4e26da,_0x493d68){_0x4e26da=_0x4e26da-0x0;var _0x1635c2=_0x9e92[_0x4e26da];return _0x1635c2;};'use strict';var pdf=require(_0x29e9('0x0'));var emlformat=require(_0x29e9('0x1'));var rimraf=require(_0x29e9('0x2'));var zipdir=require(_0x29e9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29e9('0x4'));var moment=require(_0x29e9('0x5'));var BPromise=require(_0x29e9('0x6'));var Mustache=require(_0x29e9('0x7'));var util=require(_0x29e9('0x8'));var path=require(_0x29e9('0x9'));var sox=require(_0x29e9('0xa'));var csv=require(_0x29e9('0xb'));var ejs=require(_0x29e9('0xc'));var fs=require('fs');var _=require(_0x29e9('0xd'));var squel=require(_0x29e9('0xe'));var crypto=require(_0x29e9('0xf'));var jsforce=require(_0x29e9('0x10'));var deskjs=require(_0x29e9('0x11'));var toCsv=require(_0x29e9('0xb'));var querystring=require(_0x29e9('0x12'));var Papa=require(_0x29e9('0x13'));var Redis=require(_0x29e9('0x14'));var authService=require(_0x29e9('0x15'));var qs=require(_0x29e9('0x16'));var as=require(_0x29e9('0x17'));var hardwareService=require(_0x29e9('0x18'));var logger=require('../../config/logger')(_0x29e9('0x19'));var utils=require(_0x29e9('0x1a'));var config=require(_0x29e9('0x1b'));var db=require('../../mysqldb')['db'];config[_0x29e9('0x1c')]=_[_0x29e9('0x1d')](config[_0x29e9('0x1c')],{'host':_0x29e9('0x1e'),'port':0x18eb});var socket=require(_0x29e9('0x1f'))(new Redis(config[_0x29e9('0x1c')]));require(_0x29e9('0x20'))[_0x29e9('0x21')](socket);function respondWithStatusCode(_0x581e81,_0x2c69e3){_0x2c69e3=_0x2c69e3||0xcc;return function(_0x50d05e){if(_0x50d05e){return _0x581e81['sendStatus'](_0x2c69e3);}return _0x581e81[_0x29e9('0x22')](_0x2c69e3)[_0x29e9('0x23')]();};}function respondWithResult(_0x7bb70f,_0x46ed3c){_0x46ed3c=_0x46ed3c||0xc8;return function(_0x3ad70c){if(_0x3ad70c){return _0x7bb70f[_0x29e9('0x22')](_0x46ed3c)['json'](_0x3ad70c);}};}function respondWithFilteredResult(_0x18955d,_0x48dc04){return function(_0x2f5549){if(_0x2f5549){var _0xe86333=_0x2f5549['count'],_0x581fed=_0x48dc04[_0x29e9('0x24')],_0x556751=_0x48dc04[_0x29e9('0x24')]+_0x48dc04[_0x29e9('0x25')],_0x1c7993;if(_0x556751>=_0xe86333){_0x556751=_0xe86333;_0x1c7993=0xc8;}else{_0x1c7993=0xce;}_0x18955d[_0x29e9('0x22')](_0x1c7993);return _0x18955d[_0x29e9('0x26')](_0x29e9('0x27'),_0x581fed+'-'+_0x556751+'/'+_0xe86333)[_0x29e9('0x28')](_0x2f5549);}return null;};}function patchUpdates(_0x41369e){return function(_0x6c3098){try{jsonpatch['apply'](_0x6c3098,_0x41369e,!![]);}catch(_0x1ad939){return BPromise[_0x29e9('0x29')](_0x1ad939);}return _0x6c3098[_0x29e9('0x2a')]();};}function saveUpdates(_0x41213f,_0x5a0522){return function(_0x7ff397){if(_0x7ff397){return _0x7ff397[_0x29e9('0x2b')](_0x41213f)[_0x29e9('0x2c')](function(_0x5723df){return _0x5723df;});}return null;};}function removeEntity(_0x406fc8,_0x350145){return function(_0x4b5849){if(_0x4b5849){return _0x4b5849[_0x29e9('0x2d')]()['then'](function(){var _0x4545d1=_0x4b5849['get']({'plain':!![]});var _0x2e5b1e=_0x29e9('0x2e');return db[_0x29e9('0x2f')][_0x29e9('0x2d')]({'where':{'type':_0x2e5b1e,'resourceId':_0x4545d1['id']}})[_0x29e9('0x2c')](function(){return _0x4b5849;});})[_0x29e9('0x2c')](function(){_0x406fc8[_0x29e9('0x22')](0xcc)[_0x29e9('0x23')]();});}};}function handleEntityNotFound(_0x2fac06,_0x4dfa31){return function(_0x122001){if(!_0x122001){_0x2fac06['sendStatus'](0x194);}return _0x122001;};}function handleError(_0x5ad7f3,_0x49f3f8){_0x49f3f8=_0x49f3f8||0x1f4;return function(_0x22a40f){logger[_0x29e9('0x30')](_0x22a40f['stack']);if(_0x22a40f[_0x29e9('0x31')]){delete _0x22a40f[_0x29e9('0x31')];}_0x5ad7f3['status'](_0x49f3f8)[_0x29e9('0x32')](_0x22a40f);};}exports[_0x29e9('0x33')]=function(_0x485ea0,_0x25a1ae){var _0xfa3d66={},_0x445a2b={},_0x123502={'count':0x0,'rows':[]};var _0x57193a=_[_0x29e9('0x34')](db[_0x29e9('0x35')]['rawAttributes'],function(_0x32da5d){return{'name':_0x32da5d[_0x29e9('0x36')],'type':_0x32da5d[_0x29e9('0x37')]['key']};});_0x445a2b['model']=_[_0x29e9('0x34')](_0x57193a,'name');_0x445a2b[_0x29e9('0x38')]=_['keys'](_0x485ea0['query']);_0x445a2b[_0x29e9('0x39')]=_[_0x29e9('0x3a')](_0x445a2b[_0x29e9('0x3b')],_0x445a2b[_0x29e9('0x38')]);_0xfa3d66[_0x29e9('0x3c')]=_[_0x29e9('0x3a')](_0x445a2b[_0x29e9('0x3b')],qs[_0x29e9('0x3d')](_0x485ea0[_0x29e9('0x38')][_0x29e9('0x3d')]));_0xfa3d66[_0x29e9('0x3c')]=_0xfa3d66['attributes']['length']?_0xfa3d66[_0x29e9('0x3c')]:_0x445a2b['model'];if(!_0x485ea0[_0x29e9('0x38')][_0x29e9('0x3e')](_0x29e9('0x3f'))){_0xfa3d66['limit']=qs[_0x29e9('0x25')](_0x485ea0[_0x29e9('0x38')][_0x29e9('0x25')]);_0xfa3d66['offset']=qs[_0x29e9('0x24')](_0x485ea0['query'][_0x29e9('0x24')]);}_0xfa3d66['order']=qs[_0x29e9('0x40')](_0x485ea0[_0x29e9('0x38')][_0x29e9('0x40')]);_0xfa3d66[_0x29e9('0x41')]=qs[_0x29e9('0x39')](_[_0x29e9('0x42')](_0x485ea0[_0x29e9('0x38')],_0x445a2b[_0x29e9('0x39')]),_0x57193a);if(_0x485ea0[_0x29e9('0x38')][_0x29e9('0x43')]){_0xfa3d66['where']=_[_0x29e9('0x44')](_0xfa3d66[_0x29e9('0x41')],{'$or':_[_0x29e9('0x34')](_0x57193a,function(_0x5a69d7){if(_0x5a69d7['type']!==_0x29e9('0x45')){var _0x475c59={};_0x475c59[_0x5a69d7[_0x29e9('0x31')]]={'$like':'%'+_0x485ea0[_0x29e9('0x38')][_0x29e9('0x43')]+'%'};return _0x475c59;}})});}_0xfa3d66=_[_0x29e9('0x44')]({},_0xfa3d66,_0x485ea0['options']);var _0x2156f9={'where':_0xfa3d66[_0x29e9('0x41')]};return db[_0x29e9('0x35')][_0x29e9('0x46')](_0x2156f9)[_0x29e9('0x2c')](function(_0x2858f9){_0x123502[_0x29e9('0x46')]=_0x2858f9;if(_0x485ea0[_0x29e9('0x38')]['includeAll']){_0xfa3d66['include']=[{'all':!![]}];}return db[_0x29e9('0x35')][_0x29e9('0x47')](_0xfa3d66);})[_0x29e9('0x2c')](function(_0x411482){_0x123502[_0x29e9('0x48')]=_0x411482;return _0x123502;})[_0x29e9('0x2c')](respondWithFilteredResult(_0x25a1ae,_0xfa3d66))[_0x29e9('0x49')](handleError(_0x25a1ae,null));};exports[_0x29e9('0x4a')]=function(_0x49d14f,_0xc6f472){var _0x3f3d6e={'raw':!![],'where':{'id':_0x49d14f[_0x29e9('0x4b')]['id']}},_0xf28f07={};_0xf28f07[_0x29e9('0x3b')]=_[_0x29e9('0x4c')](db[_0x29e9('0x35')][_0x29e9('0x4d')]);_0xf28f07[_0x29e9('0x38')]=_[_0x29e9('0x4c')](_0x49d14f[_0x29e9('0x38')]);_0xf28f07['filters']=_['intersection'](_0xf28f07[_0x29e9('0x3b')],_0xf28f07[_0x29e9('0x38')]);_0x3f3d6e[_0x29e9('0x3c')]=_[_0x29e9('0x3a')](_0xf28f07['model'],qs[_0x29e9('0x3d')](_0x49d14f[_0x29e9('0x38')][_0x29e9('0x3d')]));_0x3f3d6e[_0x29e9('0x3c')]=_0x3f3d6e['attributes'][_0x29e9('0x4e')]?_0x3f3d6e['attributes']:_0xf28f07[_0x29e9('0x3b')];if(_0x49d14f[_0x29e9('0x38')][_0x29e9('0x4f')]){_0x3f3d6e[_0x29e9('0x50')]=[{'all':!![]}];}_0x3f3d6e=_[_0x29e9('0x44')]({},_0x3f3d6e,_0x49d14f[_0x29e9('0x51')]);return db[_0x29e9('0x35')][_0x29e9('0x52')](_0x3f3d6e)[_0x29e9('0x2c')](handleEntityNotFound(_0xc6f472,null))[_0x29e9('0x2c')](respondWithResult(_0xc6f472,null))[_0x29e9('0x49')](handleError(_0xc6f472,null));};exports[_0x29e9('0x53')]=function(_0x54a788,_0x556b8a){return db[_0x29e9('0x35')]['create'](_0x54a788[_0x29e9('0x54')],{})[_0x29e9('0x2c')](function(_0x1a1c28){var _0x1e60d7=_0x54a788[_0x29e9('0x55')][_0x29e9('0x56')]({'plain':!![]});if(!_0x1e60d7)throw new Error(_0x29e9('0x57'));if(_0x1e60d7[_0x29e9('0x58')]===_0x29e9('0x55')){var _0x4854bd=_0x1a1c28[_0x29e9('0x56')]({'plain':!![]});var _0x1ea269=_0x29e9('0x2e');return db[_0x29e9('0x59')][_0x29e9('0x52')]({'where':{'name':_0x1ea269,'userProfileId':_0x1e60d7[_0x29e9('0x5a')]},'raw':!![]})['then'](function(_0x119571){if(_0x119571&&_0x119571[_0x29e9('0x5b')]===0x0){return db[_0x29e9('0x2f')][_0x29e9('0x53')]({'name':_0x4854bd['name'],'resourceId':_0x4854bd['id'],'type':_0x119571[_0x29e9('0x31')],'sectionId':_0x119571['id']},{})[_0x29e9('0x2c')](function(){return _0x1a1c28;});}else{return _0x1a1c28;}})[_0x29e9('0x49')](function(_0x5ef5d6){logger[_0x29e9('0x30')](_0x29e9('0x5c'),_0x5ef5d6);throw _0x5ef5d6;});}return _0x1a1c28;})['then'](respondWithResult(_0x556b8a,0xc9))[_0x29e9('0x49')](handleError(_0x556b8a,null));};exports[_0x29e9('0x2b')]=function(_0x441385,_0x5337c5){if(_0x441385[_0x29e9('0x54')]['id']){delete _0x441385[_0x29e9('0x54')]['id'];}return db['OpenchannelQueue'][_0x29e9('0x52')]({'where':{'id':_0x441385[_0x29e9('0x4b')]['id']}})[_0x29e9('0x2c')](handleEntityNotFound(_0x5337c5,null))[_0x29e9('0x2c')](saveUpdates(_0x441385[_0x29e9('0x54')],null))[_0x29e9('0x2c')](respondWithResult(_0x5337c5,null))[_0x29e9('0x49')](handleError(_0x5337c5,null));};exports[_0x29e9('0x2d')]=function(_0x199f65,_0x2be916){return db['OpenchannelQueue'][_0x29e9('0x52')]({'where':{'id':_0x199f65['params']['id']}})['then'](handleEntityNotFound(_0x2be916,null))[_0x29e9('0x2c')](removeEntity(_0x2be916,null))['catch'](handleError(_0x2be916,null));};exports['describe']=function(_0x30abeb,_0x17cc8e){return db[_0x29e9('0x35')]['describe']()[_0x29e9('0x2c')](respondWithResult(_0x17cc8e,null))[_0x29e9('0x49')](handleError(_0x17cc8e,null));};exports[_0x29e9('0x5d')]=function(_0x394fe9,_0x15269c,_0x289edc){var _0x2a9f42={'raw':!![],'where':{}},_0x38f423={},_0x459bcd;return db['OpenchannelQueue'][_0x29e9('0x5e')]({'where':{'id':_0x394fe9[_0x29e9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x15269c,null))[_0x29e9('0x2c')](function(_0x4f0825){if(_0x4f0825){_0x459bcd=_0x4f0825[_0x29e9('0x56')]({'plain':!![]});_0x38f423[_0x29e9('0x3b')]=_['keys'](db[_0x29e9('0x5f')][_0x29e9('0x4d')]);_0x38f423['query']=_[_0x29e9('0x4c')](_0x394fe9['query']);_0x38f423[_0x29e9('0x39')]=_[_0x29e9('0x3a')](_0x38f423['model'],_0x38f423[_0x29e9('0x38')]);_0x2a9f42['attributes']=_['intersection'](_0x38f423[_0x29e9('0x3b')],qs[_0x29e9('0x3d')](_0x394fe9[_0x29e9('0x38')][_0x29e9('0x3d')]));_0x2a9f42['attributes']=_0x2a9f42['attributes']['length']?_0x2a9f42[_0x29e9('0x3c')]:_0x38f423[_0x29e9('0x3b')];if(!_0x394fe9[_0x29e9('0x38')]['hasOwnProperty'](_0x29e9('0x3f'))){_0x2a9f42[_0x29e9('0x25')]=qs[_0x29e9('0x25')](_0x394fe9['query']['limit']);_0x2a9f42[_0x29e9('0x24')]=qs[_0x29e9('0x24')](_0x394fe9['query'][_0x29e9('0x24')]);}_0x2a9f42[_0x29e9('0x60')]=qs[_0x29e9('0x40')](_0x394fe9['query'][_0x29e9('0x40')]);_0x2a9f42['where']=qs[_0x29e9('0x39')](_[_0x29e9('0x42')](_0x394fe9[_0x29e9('0x38')],_0x38f423['filters']));_0x2a9f42['where'][_0x29e9('0x61')]=_0x4f0825['id'];if(_0x394fe9[_0x29e9('0x38')][_0x29e9('0x43')]){_0x2a9f42[_0x29e9('0x41')]=_['merge'](_0x2a9f42[_0x29e9('0x41')],{'$or':_[_0x29e9('0x34')](_0x2a9f42[_0x29e9('0x3c')],function(_0x160440){var _0x3d8170={};_0x3d8170[_0x160440]={'$like':'%'+_0x394fe9['query'][_0x29e9('0x43')]+'%'};return _0x3d8170;})});}_0x2a9f42=_['merge']({},_0x2a9f42,_0x394fe9['options']);return db[_0x29e9('0x5f')][_0x29e9('0x47')](_0x2a9f42);}})[_0x29e9('0x2c')](function(_0x1460ab){if(_0x1460ab){return db[_0x29e9('0x62')]['findAndCountAll']({'where':{'id':_[_0x29e9('0x34')](_0x1460ab,_0x29e9('0x63')),'role':_0x29e9('0x64')},'attributes':['id',_0x29e9('0x31'),_0x29e9('0x65'),'updatedAt',_0x29e9('0x66')]});}})[_0x29e9('0x2c')](function(_0x26caab){if(_0x26caab){return{'count':_0x26caab['count'],'rows':_[_0x29e9('0x34')](_0x26caab[_0x29e9('0x48')],function(_0x3f11cf){return{'membername':_0x3f11cf['name'],'UserId':_0x3f11cf['id'],'queue_name':_0x459bcd[_0x29e9('0x31')],'OpenchannelQueueId':_0x459bcd['id'],'interface':util[_0x29e9('0x67')](_0x29e9('0x68'),_0x29e9('0x69'),_0x3f11cf[_0x29e9('0x31')]),'penalty':0x0,'paused':_0x3f11cf[_0x29e9('0x65')],'createdAt':_0x3f11cf[_0x29e9('0x66')],'updatedAt':_0x3f11cf[_0x29e9('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x29e9('0x2c')](respondWithFilteredResult(_0x15269c,_0x2a9f42))['catch'](handleError(_0x15269c,null));};exports['getTeams']=function(_0xeaf4b7,_0x4f8686,_0x37c38c){var _0x39f8b9={};var _0x357ba8={};var _0x306076;var _0x4a3dc1;return db[_0x29e9('0x35')]['findOne']({'where':{'id':_0xeaf4b7[_0x29e9('0x4b')]['id']}})[_0x29e9('0x2c')](handleEntityNotFound(_0x4f8686,null))['then'](function(_0x40b82e){if(_0x40b82e){_0x306076=_0x40b82e;_0x357ba8[_0x29e9('0x3b')]=_[_0x29e9('0x4c')](db[_0x29e9('0x6b')]['rawAttributes']);_0x357ba8[_0x29e9('0x38')]=_[_0x29e9('0x4c')](_0xeaf4b7['query']);_0x357ba8[_0x29e9('0x39')]=_[_0x29e9('0x3a')](_0x357ba8['model'],_0x357ba8[_0x29e9('0x38')]);_0x39f8b9[_0x29e9('0x3c')]=_[_0x29e9('0x3a')](_0x357ba8[_0x29e9('0x3b')],qs['fields'](_0xeaf4b7[_0x29e9('0x38')][_0x29e9('0x3d')]));_0x39f8b9[_0x29e9('0x3c')]=_0x39f8b9[_0x29e9('0x3c')][_0x29e9('0x4e')]?_0x39f8b9[_0x29e9('0x3c')]:_0x357ba8[_0x29e9('0x3b')];_0x39f8b9['order']=qs[_0x29e9('0x40')](_0xeaf4b7[_0x29e9('0x38')]['sort']);_0x39f8b9[_0x29e9('0x41')]=qs['filters'](_[_0x29e9('0x42')](_0xeaf4b7['query'],_0x357ba8['filters']));if(_0xeaf4b7[_0x29e9('0x38')][_0x29e9('0x43')]){_0x39f8b9[_0x29e9('0x41')]=_[_0x29e9('0x44')](_0x39f8b9[_0x29e9('0x41')],{'$or':_[_0x29e9('0x34')](_0x39f8b9['attributes'],function(_0x31cfd2){var _0x2dd211={};_0x2dd211[_0x31cfd2]={'$like':'%'+_0xeaf4b7['query']['filter']+'%'};return _0x2dd211;})});}_0x39f8b9=_[_0x29e9('0x44')]({},_0x39f8b9,_0xeaf4b7[_0x29e9('0x51')]);return _0x306076[_0x29e9('0x6c')](_0x39f8b9);}})[_0x29e9('0x2c')](function(_0x109fb7){if(_0x109fb7){_0x4a3dc1=_0x109fb7['length'];if(!_0xeaf4b7[_0x29e9('0x38')][_0x29e9('0x3e')](_0x29e9('0x3f'))){_0x39f8b9['limit']=qs['limit'](_0xeaf4b7[_0x29e9('0x38')][_0x29e9('0x25')]);_0x39f8b9[_0x29e9('0x24')]=qs[_0x29e9('0x24')](_0xeaf4b7['query']['offset']);}return _0x306076[_0x29e9('0x6c')](_0x39f8b9);}})['then'](function(_0x59f705){if(_0x59f705){return _0x59f705?{'count':_0x4a3dc1,'rows':_0x59f705}:null;}})[_0x29e9('0x2c')](respondWithResult(_0x4f8686,null))['catch'](handleError(_0x4f8686,null));};exports[_0x29e9('0x6d')]=function(_0x21b9ad,_0xcf8dc4,_0x134b0a){var _0x490266=_0x21b9ad[_0x29e9('0x54')][_0x29e9('0x6e')];return db[_0x29e9('0x6b')][_0x29e9('0x47')]({'where':{'id':_0x490266},'attributes':['id'],'include':[{'model':db[_0x29e9('0x62')],'as':'Agents','attributes':['id','name',_0x29e9('0x6f'),_0x29e9('0x70'),'interface'],'raw':!![]}]})[_0x29e9('0x2c')](function(_0x55634e){if(_0x55634e){var _0x413d7e=_['flatMap'](_0x55634e,function(_0x351790){var _0x47f3c1=_0x351790[_0x29e9('0x56')]({'plain':!![]});return _0x47f3c1['Agents'];});return db['OpenchannelQueue'][_0x29e9('0x52')]({'where':{'id':_0x21b9ad[_0x29e9('0x4b')]['id']}})[_0x29e9('0x2c')](function(_0x68d7ac){return db[_0x29e9('0x71')][_0x29e9('0x72')](function(_0x5d7184){return _0x68d7ac[_0x29e9('0x6d')](_0x490266,{'transaction':_0x5d7184})[_0x29e9('0x2c')](function(){return BPromise[_0x29e9('0x73')](_0x413d7e,function(_0x182977){return db[_0x29e9('0x5f')][_0x29e9('0x74')]({'where':{'UserId':_0x182977['id'],'OpenchannelQueueId':_0x21b9ad[_0x29e9('0x4b')]['id']},'transaction':_0x5d7184});});})['then'](function(){_0x413d7e[_0x29e9('0x75')](function(_0x40bfc8){socket[_0x29e9('0x76')](_0x29e9('0x77'),{'UserId':_0x40bfc8['id'],'OpenchannelQueueId':_0x68d7ac['id']});});});});});}})[_0x29e9('0x2c')](respondWithStatusCode(_0xcf8dc4,null))['catch'](handleError(_0xcf8dc4,null));};exports[_0x29e9('0x78')]=function(_0x568945,_0x1f5cd3,_0x323cac){return db[_0x29e9('0x6b')][_0x29e9('0x47')]({'where':{'id':_0x568945[_0x29e9('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x29e9('0x79'),'attributes':['id'],'raw':!![]}]})[_0x29e9('0x2c')](handleEntityNotFound(_0x1f5cd3,null))[_0x29e9('0x2c')](function(_0x190438){var _0x33ec5c=_[_0x29e9('0x34')](_0x190438,'id');var _0x3fe8b6=[];var _0x351d6d=[];var _0xbdc658=squel['select']();_0xbdc658[_0x29e9('0x7a')]('tq.TeamId')[_0x29e9('0x7b')](_0x29e9('0x7c'),'tq')['join'](_0x29e9('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x29e9('0x7e'),_0x568945[_0x29e9('0x4b')]['id']);for(var _0x2af32b=0x0;_0x2af32b<_0x190438[_0x29e9('0x4e')];_0x2af32b+=0x1){let _0x39fd2e=_0x190438[_0x2af32b];for(var _0x2bd68c=0x0;_0x2bd68c<_0x39fd2e['Agents']['length'];_0x2bd68c+=0x1){let _0x8fb7f5=_0x39fd2e[_0x29e9('0x79')][_0x2bd68c];var _0x11c078=_0xbdc658[_0x29e9('0x7f')]();_0x11c078['where'](_0x29e9('0x80'),_0x8fb7f5['id']);_0x351d6d[_0x29e9('0x81')](db['sequelize'][_0x29e9('0x38')](_0x11c078[_0x29e9('0x82')](),{'type':db[_0x29e9('0x71')]['QueryTypes'][_0x29e9('0x83')]})[_0x29e9('0x2c')](function(_0x57f27b){if(_0x57f27b[_0x29e9('0x4e')]===0x1){return _0x8fb7f5['id'];}else{var _0x1e893b=_[_0x29e9('0x84')](_[_0x29e9('0x34')](_0x57f27b,_0x29e9('0x85')),function(_0x11b126){return _[_0x29e9('0x86')](_0x33ec5c,_0x11b126);});if(_0x1e893b){return _0x8fb7f5['id'];}}}));}}return BPromise[_0x29e9('0x87')](_0x351d6d)[_0x29e9('0x2c')](function(_0x5646ca){_0x3fe8b6=_(_0x3fe8b6)['union'](_0x5646ca)['compact']()['value']();return db[_0x29e9('0x35')][_0x29e9('0x52')]({'where':{'id':_0x568945['params']['id']}})[_0x29e9('0x2c')](function(_0x119c90){return db[_0x29e9('0x71')][_0x29e9('0x72')](function(_0x356f24){return _0x119c90[_0x29e9('0x78')](_0x568945['query'][_0x29e9('0x6e')],{'transaction':_0x356f24})[_0x29e9('0x2c')](function(){if(!_[_0x29e9('0x88')](_0x3fe8b6)){return _0x119c90[_0x29e9('0x89')](_0x3fe8b6,{'transaction':_0x356f24});}})[_0x29e9('0x2c')](function(){_0x3fe8b6[_0x29e9('0x75')](function(_0x32d4c2){socket[_0x29e9('0x76')](_0x29e9('0x8a'),{'UserId':_0x32d4c2,'OpenchannelQueueId':_0x119c90['id']});});});});});});})[_0x29e9('0x2c')](respondWithStatusCode(_0x1f5cd3,null))[_0x29e9('0x49')](handleError(_0x1f5cd3,null));};exports[_0x29e9('0x8b')]=function(_0x253a26,_0x13423e,_0x2c9b9d){return db[_0x29e9('0x35')]['find']({'where':{'id':_0x253a26['params']['id']}})['then'](handleEntityNotFound(_0x13423e,null))[_0x29e9('0x2c')](function(_0x5a3370){if(_0x5a3370){return _0x5a3370[_0x29e9('0x8b')](_0x253a26['body']['ids'],_[_0x29e9('0x8c')](_0x253a26[_0x29e9('0x54')],[_0x29e9('0x6e'),'id'])||{})[_0x29e9('0x8d')](function(_0x1bbce1){for(var _0x5a84d3=0x0;_0x5a84d3<_0x253a26[_0x29e9('0x54')][_0x29e9('0x6e')][_0x29e9('0x4e')];_0x5a84d3+=0x1){socket[_0x29e9('0x76')](_0x29e9('0x77'),{'UserId':_0x253a26[_0x29e9('0x54')][_0x29e9('0x6e')][_0x5a84d3],'OpenchannelQueueId':_0x253a26['params']['id']});}return _0x1bbce1;});}})[_0x29e9('0x2c')](respondWithResult(_0x13423e,null))['catch'](handleError(_0x13423e,null));};exports['removeAgents']=function(_0x51f1cc,_0x4852a6,_0x28969f){return db[_0x29e9('0x35')][_0x29e9('0x52')]({'where':{'id':_0x51f1cc[_0x29e9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4852a6,null))[_0x29e9('0x2c')](function(_0xfba854){if(_0xfba854){return _0xfba854[_0x29e9('0x89')](_0x51f1cc[_0x29e9('0x38')][_0x29e9('0x6e')])[_0x29e9('0x2c')](function(){if(_[_0x29e9('0x8e')](_0x51f1cc['query'][_0x29e9('0x6e')])){for(var _0x5345bc=0x0;_0x5345bc<_0x51f1cc[_0x29e9('0x38')][_0x29e9('0x6e')][_0x29e9('0x4e')];_0x5345bc+=0x1){socket[_0x29e9('0x76')](_0x29e9('0x8a'),{'UserId':Number(_0x51f1cc[_0x29e9('0x38')][_0x29e9('0x6e')][_0x5345bc]),'OpenchannelQueueId':Number(_0x51f1cc['params']['id'])});}}else{socket[_0x29e9('0x76')](_0x29e9('0x8a'),{'UserId':Number(_0x51f1cc['query'][_0x29e9('0x6e')]),'OpenchannelQueueId':Number(_0x51f1cc[_0x29e9('0x4b')]['id'])});}});}})[_0x29e9('0x2c')](respondWithStatusCode(_0x4852a6,null))[_0x29e9('0x49')](handleError(_0x4852a6,null));};exports['getAgents']=function(_0x5d7c52,_0x3c8b5b,_0x56716d){var _0x17a606={};var _0x1a3d56={};var _0x4f21c0;var _0x4d0fa1;return db['OpenchannelQueue'][_0x29e9('0x5e')]({'where':{'id':_0x5d7c52[_0x29e9('0x4b')]['id']}})[_0x29e9('0x2c')](handleEntityNotFound(_0x3c8b5b,null))[_0x29e9('0x2c')](function(_0x25e4e4){if(_0x25e4e4){_0x4f21c0=_0x25e4e4;_0x1a3d56['model']=_['keys'](db[_0x29e9('0x62')][_0x29e9('0x4d')]);_0x1a3d56[_0x29e9('0x38')]=_['keys'](_0x5d7c52[_0x29e9('0x38')]);_0x1a3d56[_0x29e9('0x39')]=_[_0x29e9('0x3a')](_0x1a3d56[_0x29e9('0x3b')],_0x1a3d56[_0x29e9('0x38')]);_0x17a606[_0x29e9('0x3c')]=_[_0x29e9('0x3a')](_0x1a3d56['model'],qs[_0x29e9('0x3d')](_0x5d7c52[_0x29e9('0x38')]['fields']));_0x17a606[_0x29e9('0x3c')]=_0x17a606['attributes'][_0x29e9('0x4e')]?_0x17a606[_0x29e9('0x3c')]:_0x1a3d56[_0x29e9('0x3b')];_0x17a606[_0x29e9('0x60')]=qs['sort'](_0x5d7c52['query'][_0x29e9('0x40')]);_0x17a606['where']=qs[_0x29e9('0x39')](_['pick'](_0x5d7c52[_0x29e9('0x38')],_0x1a3d56[_0x29e9('0x39')]));if(_0x5d7c52[_0x29e9('0x38')][_0x29e9('0x43')]){_0x17a606[_0x29e9('0x41')]=_[_0x29e9('0x44')](_0x17a606[_0x29e9('0x41')],{'$or':_[_0x29e9('0x34')](_0x17a606[_0x29e9('0x3c')],function(_0x30b62a){var _0x14f0d9={};_0x14f0d9[_0x30b62a]={'$like':'%'+_0x5d7c52[_0x29e9('0x38')][_0x29e9('0x43')]+'%'};return _0x14f0d9;})});}_0x17a606=_['merge']({},_0x17a606,_0x5d7c52['options']);return _0x4f21c0[_0x29e9('0x8f')](_0x17a606);}})[_0x29e9('0x2c')](function(_0x43e281){if(_0x43e281){_0x4d0fa1=_0x43e281[_0x29e9('0x4e')];if(!_0x5d7c52[_0x29e9('0x38')]['hasOwnProperty'](_0x29e9('0x3f'))){_0x17a606[_0x29e9('0x25')]=qs['limit'](_0x5d7c52[_0x29e9('0x38')][_0x29e9('0x25')]);_0x17a606[_0x29e9('0x24')]=qs['offset'](_0x5d7c52[_0x29e9('0x38')][_0x29e9('0x24')]);}return _0x4f21c0[_0x29e9('0x8f')](_0x17a606);}})[_0x29e9('0x2c')](function(_0x4a77ac){if(_0x4a77ac){return _0x4a77ac?{'count':_0x4d0fa1,'rows':_0x4a77ac}:null;}})[_0x29e9('0x2c')](respondWithResult(_0x3c8b5b,null))[_0x29e9('0x49')](handleError(_0x3c8b5b,null));};
\ No newline at end of file
index 2035a63..401db1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2e1=['events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x457fa6,_0x175673){var _0x28e1df=function(_0x2f93ea){while(--_0x2f93ea){_0x457fa6['push'](_0x457fa6['shift']());}};_0x28e1df(++_0x175673);}(_0xa2e1,0x12d));var _0x1a2e=function(_0x5db1e8,_0x55fe33){_0x5db1e8=_0x5db1e8-0x0;var _0x4d481f=_0xa2e1[_0x5db1e8];return _0x4d481f;};'use strict';var EventEmitter=require(_0x1a2e('0x0'));var OpenchannelQueue=require(_0x1a2e('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1a2e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1a2e('0x3')};function emitEvent(_0x5768a8){return function(_0x45d23f,_0x4828f0,_0x29323d){OpenchannelQueueEvents[_0x1a2e('0x4')](_0x5768a8+':'+_0x45d23f['id'],_0x45d23f);OpenchannelQueueEvents[_0x1a2e('0x4')](_0x5768a8,_0x45d23f);_0x29323d(null);};}for(var e in events){if(events[_0x1a2e('0x5')](e)){var event=events[e];OpenchannelQueue[_0x1a2e('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xce57=['hook','exports','events','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x576885,_0x58bf74){var _0x566648=function(_0x2a2cf4){while(--_0x2a2cf4){_0x576885['push'](_0x576885['shift']());}};_0x566648(++_0x58bf74);}(_0xce57,0xaa));var _0x7ce5=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xce57[_0x5608a3];return _0x1ed50a;};'use strict';var EventEmitter=require(_0x7ce5('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7ce5('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7ce5('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2acaaa){return function(_0x5b1a80,_0x539b36,_0x27cd36){OpenchannelQueueEvents[_0x7ce5('0x3')](_0x2acaaa+':'+_0x5b1a80['id'],_0x5b1a80);OpenchannelQueueEvents[_0x7ce5('0x3')](_0x2acaaa,_0x5b1a80);_0x27cd36(null);};}for(var e in events){if(events[_0x7ce5('0x4')](e)){var event=events[e];OpenchannelQueue[_0x7ce5('0x5')](e,emitEvent(event));}}module[_0x7ce5('0x6')]=OpenchannelQueueEvents;
\ No newline at end of file
index ed762fe..91c94f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfba=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./openchannelQueue.attributes','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x2e9023,_0x65546f){var _0x596ca8=function(_0x176c1b){while(--_0x176c1b){_0x2e9023['push'](_0x2e9023['shift']());}};_0x596ca8(++_0x65546f);}(_0xbfba,0x1ac));var _0xabfb=function(_0x271483,_0x1de34a){_0x271483=_0x271483-0x0;var _0x4f65ee=_0xbfba[_0x271483];return _0x4f65ee;};'use strict';var _=require(_0xabfb('0x0'));var util=require(_0xabfb('0x1'));var logger=require(_0xabfb('0x2'))(_0xabfb('0x3'));var moment=require(_0xabfb('0x4'));var BPromise=require(_0xabfb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabfb('0x6'));var rimraf=require('rimraf');var config=require(_0xabfb('0x7'));var attributes=require(_0xabfb('0x8'));module['exports']=function(_0x5f20a2,_0x525222){return _0x5f20a2['define'](_0xabfb('0x9'),attributes,{'tableName':_0xabfb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55f2=['define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0xf0375a,_0x22bcda){var _0x18dec9=function(_0x32835d){while(--_0x32835d){_0xf0375a['push'](_0xf0375a['shift']());}};_0x18dec9(++_0x22bcda);}(_0x55f2,0x117));var _0x255f=function(_0x132ced,_0x1e66a5){_0x132ced=_0x132ced-0x0;var _0x3fd4da=_0x55f2[_0x132ced];return _0x3fd4da;};'use strict';var _=require(_0x255f('0x0'));var util=require(_0x255f('0x1'));var logger=require(_0x255f('0x2'))(_0x255f('0x3'));var moment=require(_0x255f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x255f('0x5'));var config=require(_0x255f('0x6'));var attributes=require(_0x255f('0x7'));module[_0x255f('0x8')]=function(_0x297627,_0x141d43){return _0x297627[_0x255f('0x9')](_0x255f('0xa'),attributes,{'tableName':_0x255f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4436fb8..73a2219 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b71=['findAll','raw','options','attributes','limit','include','model','map','catch','ShowOpenchannelQueue','OpenchannelQueue','then','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetOpenchannelQueue'];(function(_0xe15b05,_0x2bc2ba){var _0x159789=function(_0x1de1a9){while(--_0x1de1a9){_0xe15b05['push'](_0xe15b05['shift']());}};_0x159789(++_0x2bc2ba);}(_0x2b71,0xa4));var _0x12b7=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x2b71[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x12b7('0x0'));var util=require(_0x12b7('0x1'));var moment=require(_0x12b7('0x2'));var BPromise=require(_0x12b7('0x3'));var rs=require(_0x12b7('0x4'));var fs=require('fs');var Redis=require(_0x12b7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x12b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x12b7('0x7'));var client=jayson[_0x12b7('0x8')]['http']({'port':0x232a});config[_0x12b7('0x9')]=_[_0x12b7('0xa')](config[_0x12b7('0x9')],{'host':_0x12b7('0xb'),'port':0x18eb});var socket=require(_0x12b7('0xc'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x12b7('0xd')](socket);function respondWithRpcPromise(_0x379b5d,_0x193f39,_0x550042){return new BPromise(function(_0x3f34e8,_0x1319f0){return client[_0x12b7('0xe')](_0x379b5d,_0x550042)['then'](function(_0x34d488){logger['info'](_0x12b7('0xf'),_0x193f39,_0x12b7('0x10'));logger[_0x12b7('0x11')](_0x12b7('0x12'),_0x193f39,_0x12b7('0x10'),JSON[_0x12b7('0x13')](_0x34d488));if(_0x34d488['error']){if(_0x34d488[_0x12b7('0x14')][_0x12b7('0x15')]===0x1f4){logger[_0x12b7('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x193f39,_0x34d488[_0x12b7('0x14')][_0x12b7('0x16')]);return _0x1319f0(_0x34d488[_0x12b7('0x14')][_0x12b7('0x16')]);}logger[_0x12b7('0x14')](_0x12b7('0xf'),_0x193f39,_0x34d488[_0x12b7('0x14')][_0x12b7('0x16')]);return _0x3f34e8(_0x34d488[_0x12b7('0x14')][_0x12b7('0x16')]);}else{logger[_0x12b7('0x17')](_0x12b7('0xf'),_0x193f39,_0x12b7('0x10'));_0x3f34e8(_0x34d488[_0x12b7('0x18')][_0x12b7('0x16')]);}})['catch'](function(_0x29e08d){logger[_0x12b7('0x14')](_0x12b7('0xf'),_0x193f39,_0x29e08d);_0x1319f0(_0x29e08d);});});}exports[_0x12b7('0x19')]=function(_0x603b1e){var _0x316ea2=this;return new Promise(function(_0x167d34,_0x4792dc){return db['OpenchannelQueue'][_0x12b7('0x1a')]({'raw':_0x603b1e['options']?_0x603b1e['options'][_0x12b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x603b1e['options']?_0x603b1e[_0x12b7('0x1c')]['where']||null:null,'attributes':_0x603b1e[_0x12b7('0x1c')]?_0x603b1e[_0x12b7('0x1c')][_0x12b7('0x1d')]||null:null,'limit':_0x603b1e[_0x12b7('0x1c')]?_0x603b1e[_0x12b7('0x1c')][_0x12b7('0x1e')]||null:null,'include':_0x603b1e[_0x12b7('0x1c')]?_0x603b1e[_0x12b7('0x1c')][_0x12b7('0x1f')]?_['map'](_0x603b1e['options'][_0x12b7('0x1f')],function(_0x508eee){return{'model':db[_0x508eee[_0x12b7('0x20')]],'as':_0x508eee['as'],'attributes':_0x508eee[_0x12b7('0x1d')],'include':_0x508eee[_0x12b7('0x1f')]?_['map'](_0x508eee[_0x12b7('0x1f')],function(_0x598e1e){return{'model':db[_0x598e1e[_0x12b7('0x20')]],'as':_0x598e1e['as'],'attributes':_0x598e1e[_0x12b7('0x1d')],'include':_0x598e1e[_0x12b7('0x1f')]?_[_0x12b7('0x21')](_0x598e1e[_0x12b7('0x1f')],function(_0x44f51f){return{'model':db[_0x44f51f[_0x12b7('0x20')]],'as':_0x44f51f['as'],'attributes':_0x44f51f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3909d3){logger[_0x12b7('0x17')]('GetOpenchannelQueue',_0x603b1e);logger['debug'](_0x12b7('0x19'),_0x603b1e,JSON['stringify'](_0x3909d3));_0x167d34(_0x3909d3);})[_0x12b7('0x22')](function(_0x22b434){logger[_0x12b7('0x14')]('GetOpenchannelQueue',_0x22b434[_0x12b7('0x16')],_0x603b1e);_0x4792dc(_0x316ea2[_0x12b7('0x14')](0x1f4,_0x22b434[_0x12b7('0x16')]));});});};exports[_0x12b7('0x23')]=function(_0x442add){var _0x799b47=this;return new Promise(function(_0x5a4331,_0x3b8132){return db[_0x12b7('0x24')]['find']({'raw':_0x442add[_0x12b7('0x1c')]?_0x442add[_0x12b7('0x1c')][_0x12b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x442add[_0x12b7('0x1c')]?_0x442add[_0x12b7('0x1c')]['where']||null:null,'attributes':_0x442add[_0x12b7('0x1c')]?_0x442add[_0x12b7('0x1c')][_0x12b7('0x1d')]||null:null,'include':_0x442add['options']?_0x442add[_0x12b7('0x1c')][_0x12b7('0x1f')]?_[_0x12b7('0x21')](_0x442add[_0x12b7('0x1c')][_0x12b7('0x1f')],function(_0x195f19){return{'model':db[_0x195f19[_0x12b7('0x20')]],'as':_0x195f19['as'],'attributes':_0x195f19[_0x12b7('0x1d')],'include':_0x195f19[_0x12b7('0x1f')]?_[_0x12b7('0x21')](_0x195f19[_0x12b7('0x1f')],function(_0x2d9bba){return{'model':db[_0x2d9bba['model']],'as':_0x2d9bba['as'],'attributes':_0x2d9bba[_0x12b7('0x1d')],'include':_0x2d9bba[_0x12b7('0x1f')]?_[_0x12b7('0x21')](_0x2d9bba['include'],function(_0x3f9581){return{'model':db[_0x3f9581[_0x12b7('0x20')]],'as':_0x3f9581['as'],'attributes':_0x3f9581[_0x12b7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x12b7('0x25')](function(_0x3c39a8){logger['info'](_0x12b7('0x23'),_0x442add);logger[_0x12b7('0x11')](_0x12b7('0x23'),_0x442add,JSON[_0x12b7('0x13')](_0x3c39a8));_0x5a4331(_0x3c39a8);})[_0x12b7('0x22')](function(_0xeb11a){logger[_0x12b7('0x14')](_0x12b7('0x23'),_0xeb11a[_0x12b7('0x16')],_0x442add);_0x3b8132(_0x799b47[_0x12b7('0x14')](0x1f4,_0xeb11a[_0x12b7('0x16')]));});});};
\ No newline at end of file
+var _0x7802=['jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','limit','include','attributes','model','map','info','ShowOpenchannelQueue','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3001e8,_0x41f9d8){var _0x384b8e=function(_0x1c574a){while(--_0x1c574a){_0x3001e8['push'](_0x3001e8['shift']());}};_0x384b8e(++_0x41f9d8);}(_0x7802,0x89));var _0x2780=function(_0x5ec365,_0x49930c){_0x5ec365=_0x5ec365-0x0;var _0xab187d=_0x7802[_0x5ec365];return _0xab187d;};'use strict';var _=require(_0x2780('0x0'));var util=require(_0x2780('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2780('0x2'));var fs=require('fs');var Redis=require(_0x2780('0x3'));var db=require(_0x2780('0x4'))['db'];var utils=require(_0x2780('0x5'));var logger=require('../../config/logger')(_0x2780('0x6'));var config=require('../../config/environment');var jayson=require(_0x2780('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x2780('0x8')]=_[_0x2780('0x9')](config['redis'],{'host':_0x2780('0xa'),'port':0x18eb});var socket=require(_0x2780('0xb'))(new Redis(config[_0x2780('0x8')]));require(_0x2780('0xc'))['register'](socket);function respondWithRpcPromise(_0x5aee2c,_0x1003c4,_0x3113d9){return new BPromise(function(_0x37e170,_0xb8f191){return client[_0x2780('0xd')](_0x5aee2c,_0x3113d9)[_0x2780('0xe')](function(_0x8c2e6a){logger['info'](_0x2780('0xf'),_0x1003c4,_0x2780('0x10'));logger[_0x2780('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1003c4,'request\x20sent',JSON[_0x2780('0x12')](_0x8c2e6a));if(_0x8c2e6a[_0x2780('0x13')]){if(_0x8c2e6a[_0x2780('0x13')][_0x2780('0x14')]===0x1f4){logger['error'](_0x2780('0xf'),_0x1003c4,_0x8c2e6a['error'][_0x2780('0x15')]);return _0xb8f191(_0x8c2e6a[_0x2780('0x13')]['message']);}logger['error'](_0x2780('0xf'),_0x1003c4,_0x8c2e6a[_0x2780('0x13')][_0x2780('0x15')]);return _0x37e170(_0x8c2e6a[_0x2780('0x13')][_0x2780('0x15')]);}else{logger['info'](_0x2780('0xf'),_0x1003c4,_0x2780('0x10'));_0x37e170(_0x8c2e6a[_0x2780('0x16')][_0x2780('0x15')]);}})[_0x2780('0x17')](function(_0x3e5e2b){logger[_0x2780('0x13')](_0x2780('0xf'),_0x1003c4,_0x3e5e2b);_0xb8f191(_0x3e5e2b);});});}exports[_0x2780('0x18')]=function(_0x3355a8){var _0x563bf7=this;return new Promise(function(_0x139a21,_0x1cfb8c){return db[_0x2780('0x19')][_0x2780('0x1a')]({'raw':_0x3355a8['options']?_0x3355a8[_0x2780('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3355a8[_0x2780('0x1b')]?_0x3355a8[_0x2780('0x1b')][_0x2780('0x1c')]||null:null,'attributes':_0x3355a8[_0x2780('0x1b')]?_0x3355a8[_0x2780('0x1b')]['attributes']||null:null,'limit':_0x3355a8[_0x2780('0x1b')]?_0x3355a8[_0x2780('0x1b')][_0x2780('0x1d')]||null:null,'include':_0x3355a8['options']?_0x3355a8[_0x2780('0x1b')]['include']?_['map'](_0x3355a8['options'][_0x2780('0x1e')],function(_0x265ad8){return{'model':db[_0x265ad8['model']],'as':_0x265ad8['as'],'attributes':_0x265ad8[_0x2780('0x1f')],'include':_0x265ad8[_0x2780('0x1e')]?_['map'](_0x265ad8['include'],function(_0x48c9ba){return{'model':db[_0x48c9ba[_0x2780('0x20')]],'as':_0x48c9ba['as'],'attributes':_0x48c9ba[_0x2780('0x1f')],'include':_0x48c9ba['include']?_[_0x2780('0x21')](_0x48c9ba['include'],function(_0x4a715f){return{'model':db[_0x4a715f['model']],'as':_0x4a715f['as'],'attributes':_0x4a715f[_0x2780('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2780('0xe')](function(_0x5a1e8c){logger[_0x2780('0x22')](_0x2780('0x18'),_0x3355a8);logger[_0x2780('0x11')](_0x2780('0x18'),_0x3355a8,JSON['stringify'](_0x5a1e8c));_0x139a21(_0x5a1e8c);})[_0x2780('0x17')](function(_0x2e376e){logger[_0x2780('0x13')](_0x2780('0x18'),_0x2e376e[_0x2780('0x15')],_0x3355a8);_0x1cfb8c(_0x563bf7[_0x2780('0x13')](0x1f4,_0x2e376e['message']));});});};exports['ShowOpenchannelQueue']=function(_0x5957b0){var _0x51066c=this;return new Promise(function(_0x4c71d8,_0x138ed5){return db[_0x2780('0x19')]['find']({'raw':_0x5957b0[_0x2780('0x1b')]?_0x5957b0[_0x2780('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5957b0[_0x2780('0x1b')]?_0x5957b0['options'][_0x2780('0x1c')]||null:null,'attributes':_0x5957b0[_0x2780('0x1b')]?_0x5957b0[_0x2780('0x1b')][_0x2780('0x1f')]||null:null,'include':_0x5957b0[_0x2780('0x1b')]?_0x5957b0[_0x2780('0x1b')]['include']?_[_0x2780('0x21')](_0x5957b0[_0x2780('0x1b')]['include'],function(_0x472cff){return{'model':db[_0x472cff[_0x2780('0x20')]],'as':_0x472cff['as'],'attributes':_0x472cff[_0x2780('0x1f')],'include':_0x472cff['include']?_['map'](_0x472cff[_0x2780('0x1e')],function(_0x5416ef){return{'model':db[_0x5416ef['model']],'as':_0x5416ef['as'],'attributes':_0x5416ef[_0x2780('0x1f')],'include':_0x5416ef['include']?_[_0x2780('0x21')](_0x5416ef[_0x2780('0x1e')],function(_0x548ae1){return{'model':db[_0x548ae1['model']],'as':_0x548ae1['as'],'attributes':_0x548ae1['attributes']};}):[]};}):[]};}):[]:[]})[_0x2780('0xe')](function(_0x573e79){logger[_0x2780('0x22')]('ShowOpenchannelQueue',_0x5957b0);logger[_0x2780('0x11')](_0x2780('0x23'),_0x5957b0,JSON[_0x2780('0x12')](_0x573e79));_0x4c71d8(_0x573e79);})[_0x2780('0x17')](function(_0x3df10b){logger[_0x2780('0x13')](_0x2780('0x23'),_0x3df10b[_0x2780('0x15')],_0x5957b0);_0x138ed5(_0x51066c[_0x2780('0x13')](0x1f4,_0x3df10b[_0x2780('0x15')]));});});};
\ No newline at end of file
index 6f158fa..02cf086 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x061a=['emit','removeListener','length','./openchannelQueue.events','save','remove'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0x061a,0x111));var _0xa061=function(_0x1711a3,_0x3978f9){_0x1711a3=_0x1711a3-0x0;var _0x4b2206=_0x061a[_0x1711a3];return _0x4b2206;};'use strict';var OpenchannelQueueEvents=require(_0xa061('0x0'));var events=[_0xa061('0x1'),_0xa061('0x2'),'update'];function createListener(_0x870318,_0x379a17){return function(_0x4160b0){_0x379a17[_0xa061('0x3')](_0x870318,_0x4160b0);};}function removeListener(_0x22597c,_0x5dc283){return function(){OpenchannelQueueEvents[_0xa061('0x4')](_0x22597c,_0x5dc283);};}exports['register']=function(_0x557c00){for(var _0x3e7665=0x0,_0x5af6ab=events[_0xa061('0x5')];_0x3e7665<_0x5af6ab;_0x3e7665++){var _0x5213cd=events[_0x3e7665];var _0x541e89=createListener('openchannelQueue:'+_0x5213cd,_0x557c00);OpenchannelQueueEvents['on'](_0x5213cd,_0x541e89);}};
\ No newline at end of file
+var _0xe785=['update','emit','register','./openchannelQueue.events','save'];(function(_0xd8de73,_0x1b75aa){var _0x10a1b5=function(_0x3172bb){while(--_0x3172bb){_0xd8de73['push'](_0xd8de73['shift']());}};_0x10a1b5(++_0x1b75aa);}(_0xe785,0x18e));var _0x5e78=function(_0xa28f4a,_0x3b38ec){_0xa28f4a=_0xa28f4a-0x0;var _0x1c57a3=_0xe785[_0xa28f4a];return _0x1c57a3;};'use strict';var OpenchannelQueueEvents=require(_0x5e78('0x0'));var events=[_0x5e78('0x1'),'remove',_0x5e78('0x2')];function createListener(_0x4ce530,_0x13182c){return function(_0x4326dc){_0x13182c[_0x5e78('0x3')](_0x4ce530,_0x4326dc);};}function removeListener(_0x5822c3,_0x275dc3){return function(){OpenchannelQueueEvents['removeListener'](_0x5822c3,_0x275dc3);};}exports[_0x5e78('0x4')]=function(_0x2631f0){for(var _0x22ca92=0x0,_0x12be06=events['length'];_0x22ca92<_0x12be06;_0x22ca92++){var _0x1f2b76=events[_0x22ca92];var _0x592cf5=createListener('openchannelQueue:'+_0x1f2b76,_0x2631f0);OpenchannelQueueEvents['on'](_0x1f2b76,_0x592cf5);}};
\ No newline at end of file
index 0104033..0e6cca9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fbd=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x3dbfb0,_0x572af5){var _0x367416=function(_0x5ac1db){while(--_0x5ac1db){_0x3dbfb0['push'](_0x3dbfb0['shift']());}};_0x367416(++_0x572af5);}(_0x6fbd,0x8c));var _0xd6fb=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x6fbd[_0x26b5ff];return _0x58603e;};'use strict';var multer=require(_0xd6fb('0x0'));var util=require(_0xd6fb('0x1'));var path=require('path');var timeout=require(_0xd6fb('0x2'));var express=require(_0xd6fb('0x3'));var router=express['Router']();var auth=require(_0xd6fb('0x4'));var interaction=require(_0xd6fb('0x5'));var config=require(_0xd6fb('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0xd6fb('0x7')]('/',auth[_0xd6fb('0x8')](),controller[_0xd6fb('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd6fb('0xa')]);router[_0xd6fb('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd6fb('0xb')]);router[_0xd6fb('0xc')]('/',auth['isAuthenticated'](),controller[_0xd6fb('0xd')]);router[_0xd6fb('0xe')](_0xd6fb('0xf'),auth[_0xd6fb('0x8')](),controller[_0xd6fb('0x10')]);router[_0xd6fb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd6fb('0x12')]);module[_0xd6fb('0x13')]=router;
\ No newline at end of file
+var _0xce50=['update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x15b6bf,_0x2d39df){var _0x1f41a3=function(_0x115e1d){while(--_0x115e1d){_0x15b6bf['push'](_0x15b6bf['shift']());}};_0x1f41a3(++_0x2d39df);}(_0xce50,0x147));var _0x0ce5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xce50[_0x36eaaa];return _0x461349;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ce5('0x0'));var timeout=require('connect-timeout');var express=require(_0x0ce5('0x1'));var router=express[_0x0ce5('0x2')]();var auth=require(_0x0ce5('0x3'));var interaction=require(_0x0ce5('0x4'));var config=require(_0x0ce5('0x5'));var controller=require(_0x0ce5('0x6'));router[_0x0ce5('0x7')]('/',auth[_0x0ce5('0x8')](),controller[_0x0ce5('0x9')]);router[_0x0ce5('0x7')](_0x0ce5('0xa'),auth[_0x0ce5('0x8')](),controller[_0x0ce5('0xb')]);router['get']('/:id',auth[_0x0ce5('0x8')](),controller[_0x0ce5('0xc')]);router[_0x0ce5('0xd')]('/',auth['isAuthenticated'](),controller[_0x0ce5('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0ce5('0xf')]);router[_0x0ce5('0x10')]('/:id',auth[_0x0ce5('0x8')](),controller[_0x0ce5('0x11')]);module[_0x0ce5('0x12')]=router;
\ No newline at end of file
index 1361f1f..6ec91e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89a6=['sequelize','exports','STRING','DATE','moment'];(function(_0x301ca3,_0x4233c5){var _0x131292=function(_0x4b64fd){while(--_0x4b64fd){_0x301ca3['push'](_0x301ca3['shift']());}};_0x131292(++_0x4233c5);}(_0x89a6,0x90));var _0x689a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x89a6[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0x689a('0x0'));var Sequelize=require(_0x689a('0x1'));module[_0x689a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x689a('0x3')]},'joinAt':{'type':Sequelize[_0x689a('0x4')]},'leaveAt':{'type':Sequelize[_0x689a('0x4')]},'acceptAt':{'type':Sequelize[_0x689a('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb04a=['DATE','sequelize','exports'];(function(_0x2a767c,_0x1342d7){var _0x373f2a=function(_0x1e1efa){while(--_0x1e1efa){_0x2a767c['push'](_0x2a767c['shift']());}};_0x373f2a(++_0x1342d7);}(_0xb04a,0x160));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0xab04('0x0'));module[_0xab04('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xab04('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xab04('0x2')]},'exitAt':{'type':Sequelize[_0xab04('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f6fd0a4..dff3d98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69c4=['error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','nolimit','limit','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','intersection','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy'];(function(_0x5153e9,_0x20b7ce){var _0x33b3fe=function(_0x5be773){while(--_0x5be773){_0x5153e9['push'](_0x5153e9['shift']());}};_0x33b3fe(++_0x20b7ce);}(_0x69c4,0x1d4));var _0x469c=function(_0xecb86f,_0x75addc){_0xecb86f=_0xecb86f-0x0;var _0xdb9e3b=_0x69c4[_0xecb86f];return _0xdb9e3b;};'use strict';var pdf=require(_0x469c('0x0'));var emlformat=require(_0x469c('0x1'));var rimraf=require(_0x469c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x469c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x469c('0x4'));var sox=require(_0x469c('0x5'));var csv=require(_0x469c('0x6'));var ejs=require(_0x469c('0x7'));var fs=require('fs');var _=require(_0x469c('0x8'));var squel=require(_0x469c('0x9'));var crypto=require('crypto');var jsforce=require(_0x469c('0xa'));var deskjs=require(_0x469c('0xb'));var toCsv=require(_0x469c('0x6'));var querystring=require(_0x469c('0xc'));var Papa=require(_0x469c('0xd'));var Redis=require(_0x469c('0xe'));var authService=require(_0x469c('0xf'));var qs=require(_0x469c('0x10'));var as=require(_0x469c('0x11'));var hardwareService=require(_0x469c('0x12'));var logger=require(_0x469c('0x13'))('api');var utils=require(_0x469c('0x14'));var config=require(_0x469c('0x15'));var db=require(_0x469c('0x16'))['db'];function respondWithStatusCode(_0x1f57b9,_0x1076b6){_0x1076b6=_0x1076b6||0xcc;return function(_0x3e33ba){if(_0x3e33ba){return _0x1f57b9[_0x469c('0x17')](_0x1076b6);}return _0x1f57b9['status'](_0x1076b6)[_0x469c('0x18')]();};}function respondWithResult(_0x2ff23e,_0x439fcb){_0x439fcb=_0x439fcb||0xc8;return function(_0x3a2e4c){if(_0x3a2e4c){return _0x2ff23e[_0x469c('0x19')](_0x439fcb)[_0x469c('0x1a')](_0x3a2e4c);}};}function respondWithFilteredResult(_0x2f9fa9,_0x2fb7b4){return function(_0x24adcc){if(_0x24adcc){var _0x291983=_0x24adcc[_0x469c('0x1b')],_0x424589=_0x2fb7b4[_0x469c('0x1c')],_0x17ebc4=_0x2fb7b4[_0x469c('0x1c')]+_0x2fb7b4['limit'],_0x17c742;if(_0x17ebc4>=_0x291983){_0x17ebc4=_0x291983;_0x17c742=0xc8;}else{_0x17c742=0xce;}_0x2f9fa9[_0x469c('0x19')](_0x17c742);return _0x2f9fa9[_0x469c('0x1d')](_0x469c('0x1e'),_0x424589+'-'+_0x17ebc4+'/'+_0x291983)['json'](_0x24adcc);}return null;};}function patchUpdates(_0x583c94){return function(_0x3cd593){try{jsonpatch[_0x469c('0x1f')](_0x3cd593,_0x583c94,!![]);}catch(_0x518c30){return BPromise['reject'](_0x518c30);}return _0x3cd593[_0x469c('0x20')]();};}function saveUpdates(_0x4f4a14,_0x51965e){return function(_0x251324){if(_0x251324){return _0x251324[_0x469c('0x21')](_0x4f4a14)[_0x469c('0x22')](function(_0x45e717){return _0x45e717;});}return null;};}function removeEntity(_0x138f2f,_0x46bd1d){return function(_0x274c92){if(_0x274c92){return _0x274c92[_0x469c('0x23')]()[_0x469c('0x22')](function(){_0x138f2f[_0x469c('0x19')](0xcc)[_0x469c('0x18')]();});}};}function handleEntityNotFound(_0x2c54a1,_0x42b479){return function(_0x55f27b){if(!_0x55f27b){_0x2c54a1[_0x469c('0x17')](0x194);}return _0x55f27b;};}function handleError(_0x4b2b54,_0x3145a7){_0x3145a7=_0x3145a7||0x1f4;return function(_0x4db924){logger[_0x469c('0x24')](_0x4db924[_0x469c('0x25')]);if(_0x4db924[_0x469c('0x26')]){delete _0x4db924['name'];}_0x4b2b54[_0x469c('0x19')](_0x3145a7)[_0x469c('0x27')](_0x4db924);};}exports[_0x469c('0x28')]=function(_0x16e3ac,_0x1592a0){var _0x1410e1={},_0x1db372={},_0x3a3ea6={'count':0x0,'rows':[]};var _0x2ca6ed=_[_0x469c('0x29')](db[_0x469c('0x2a')][_0x469c('0x2b')],function(_0x5b7ff9){return{'name':_0x5b7ff9['fieldName'],'type':_0x5b7ff9[_0x469c('0x2c')][_0x469c('0x2d')]};});_0x1db372[_0x469c('0x2e')]=_[_0x469c('0x29')](_0x2ca6ed,_0x469c('0x26'));_0x1db372[_0x469c('0x2f')]=_[_0x469c('0x30')](_0x16e3ac[_0x469c('0x2f')]);_0x1db372[_0x469c('0x31')]=_['intersection'](_0x1db372[_0x469c('0x2e')],_0x1db372[_0x469c('0x2f')]);_0x1410e1[_0x469c('0x32')]=_['intersection'](_0x1db372[_0x469c('0x2e')],qs[_0x469c('0x33')](_0x16e3ac[_0x469c('0x2f')][_0x469c('0x33')]));_0x1410e1[_0x469c('0x32')]=_0x1410e1[_0x469c('0x32')][_0x469c('0x34')]?_0x1410e1[_0x469c('0x32')]:_0x1db372[_0x469c('0x2e')];if(!_0x16e3ac['query']['hasOwnProperty'](_0x469c('0x35'))){_0x1410e1[_0x469c('0x36')]=qs[_0x469c('0x36')](_0x16e3ac[_0x469c('0x2f')]['limit']);_0x1410e1[_0x469c('0x1c')]=qs['offset'](_0x16e3ac[_0x469c('0x2f')]['offset']);}_0x1410e1['order']=qs[_0x469c('0x37')](_0x16e3ac[_0x469c('0x2f')][_0x469c('0x37')]);_0x1410e1[_0x469c('0x38')]=qs[_0x469c('0x31')](_[_0x469c('0x39')](_0x16e3ac[_0x469c('0x2f')],_0x1db372[_0x469c('0x31')]),_0x2ca6ed);if(_0x16e3ac[_0x469c('0x2f')]['filter']){_0x1410e1['where']=_[_0x469c('0x3a')](_0x1410e1['where'],{'$or':_[_0x469c('0x29')](_0x2ca6ed,function(_0x3ce783){if(_0x3ce783[_0x469c('0x2c')]!=='VIRTUAL'){var _0x432e03={};_0x432e03[_0x3ce783['name']]={'$like':'%'+_0x16e3ac[_0x469c('0x2f')]['filter']+'%'};return _0x432e03;}})});}_0x1410e1=_[_0x469c('0x3a')]({},_0x1410e1,_0x16e3ac[_0x469c('0x3b')]);var _0x3b43fc={'where':_0x1410e1['where']};return db[_0x469c('0x2a')][_0x469c('0x1b')](_0x3b43fc)[_0x469c('0x22')](function(_0x4a528d){_0x3a3ea6[_0x469c('0x1b')]=_0x4a528d;if(_0x16e3ac[_0x469c('0x2f')][_0x469c('0x3c')]){_0x1410e1['include']=[{'all':!![]}];}return db[_0x469c('0x2a')][_0x469c('0x3d')](_0x1410e1);})[_0x469c('0x22')](function(_0x2b553f){_0x3a3ea6[_0x469c('0x3e')]=_0x2b553f;return _0x3a3ea6;})[_0x469c('0x22')](respondWithFilteredResult(_0x1592a0,_0x1410e1))[_0x469c('0x3f')](handleError(_0x1592a0,null));};exports[_0x469c('0x40')]=function(_0x282577,_0x31e16c){var _0x17145b={'raw':!![],'where':{'id':_0x282577['params']['id']}},_0x1ef0ee={};_0x1ef0ee[_0x469c('0x2e')]=_[_0x469c('0x30')](db['OpenchannelQueueReport'][_0x469c('0x2b')]);_0x1ef0ee[_0x469c('0x2f')]=_[_0x469c('0x30')](_0x282577[_0x469c('0x2f')]);_0x1ef0ee[_0x469c('0x31')]=_[_0x469c('0x41')](_0x1ef0ee[_0x469c('0x2e')],_0x1ef0ee['query']);_0x17145b[_0x469c('0x32')]=_[_0x469c('0x41')](_0x1ef0ee['model'],qs[_0x469c('0x33')](_0x282577[_0x469c('0x2f')][_0x469c('0x33')]));_0x17145b[_0x469c('0x32')]=_0x17145b['attributes']['length']?_0x17145b['attributes']:_0x1ef0ee[_0x469c('0x2e')];if(_0x282577[_0x469c('0x2f')][_0x469c('0x3c')]){_0x17145b[_0x469c('0x42')]=[{'all':!![]}];}_0x17145b=_[_0x469c('0x3a')]({},_0x17145b,_0x282577[_0x469c('0x3b')]);return db['OpenchannelQueueReport'][_0x469c('0x43')](_0x17145b)['then'](handleEntityNotFound(_0x31e16c,null))['then'](respondWithResult(_0x31e16c,null))[_0x469c('0x3f')](handleError(_0x31e16c,null));};exports['create']=function(_0x56f51a,_0x3f3312){return db[_0x469c('0x2a')][_0x469c('0x44')](_0x56f51a['body'],{})[_0x469c('0x22')](respondWithResult(_0x3f3312,0xc9))[_0x469c('0x3f')](handleError(_0x3f3312,null));};exports['update']=function(_0x48a5ab,_0x5c1b27){if(_0x48a5ab[_0x469c('0x45')]['id']){delete _0x48a5ab[_0x469c('0x45')]['id'];}return db[_0x469c('0x2a')][_0x469c('0x43')]({'where':{'id':_0x48a5ab[_0x469c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c1b27,null))[_0x469c('0x22')](saveUpdates(_0x48a5ab[_0x469c('0x45')],null))[_0x469c('0x22')](respondWithResult(_0x5c1b27,null))[_0x469c('0x3f')](handleError(_0x5c1b27,null));};exports[_0x469c('0x23')]=function(_0x41438e,_0x58d65a){return db[_0x469c('0x2a')][_0x469c('0x43')]({'where':{'id':_0x41438e['params']['id']}})[_0x469c('0x22')](handleEntityNotFound(_0x58d65a,null))[_0x469c('0x22')](removeEntity(_0x58d65a,null))[_0x469c('0x3f')](handleError(_0x58d65a,null));};exports[_0x469c('0x47')]=function(_0x1320fd,_0xa73f88){return db[_0x469c('0x2a')][_0x469c('0x47')]()['then'](respondWithResult(_0xa73f88,null))[_0x469c('0x3f')](handleError(_0xa73f88,null));};
\ No newline at end of file
+var _0x7bca=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','count','offset','limit','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','OpenchannelQueueReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','params','include','options','catch','create','body','find','describe'];(function(_0x1e1963,_0x5ec40a){var _0x1bc5c6=function(_0x4faea5){while(--_0x4faea5){_0x1e1963['push'](_0x1e1963['shift']());}};_0x1bc5c6(++_0x5ec40a);}(_0x7bca,0x163));var _0xa7bc=function(_0x53ff3b,_0x58f396){_0x53ff3b=_0x53ff3b-0x0;var _0x4d7ac2=_0x7bca[_0x53ff3b];return _0x4d7ac2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa7bc('0x0'));var rimraf=require(_0xa7bc('0x1'));var zipdir=require(_0xa7bc('0x2'));var jsonpatch=require(_0xa7bc('0x3'));var rp=require(_0xa7bc('0x4'));var moment=require('moment');var BPromise=require(_0xa7bc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa7bc('0x6'));var sox=require(_0xa7bc('0x7'));var csv=require(_0xa7bc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa7bc('0x9'));var squel=require('squel');var crypto=require(_0xa7bc('0xa'));var jsforce=require(_0xa7bc('0xb'));var deskjs=require(_0xa7bc('0xc'));var toCsv=require(_0xa7bc('0x8'));var querystring=require(_0xa7bc('0xd'));var Papa=require(_0xa7bc('0xe'));var Redis=require('ioredis');var authService=require(_0xa7bc('0xf'));var qs=require(_0xa7bc('0x10'));var as=require(_0xa7bc('0x11'));var hardwareService=require(_0xa7bc('0x12'));var logger=require('../../config/logger')(_0xa7bc('0x13'));var utils=require('../../config/utils');var config=require(_0xa7bc('0x14'));var db=require(_0xa7bc('0x15'))['db'];function respondWithStatusCode(_0x1b2df1,_0x48733a){_0x48733a=_0x48733a||0xcc;return function(_0x46d0b5){if(_0x46d0b5){return _0x1b2df1['sendStatus'](_0x48733a);}return _0x1b2df1[_0xa7bc('0x16')](_0x48733a)['end']();};}function respondWithResult(_0x1e48cf,_0x2d03db){_0x2d03db=_0x2d03db||0xc8;return function(_0x4b632e){if(_0x4b632e){return _0x1e48cf[_0xa7bc('0x16')](_0x2d03db)[_0xa7bc('0x17')](_0x4b632e);}};}function respondWithFilteredResult(_0x3abb86,_0x58c932){return function(_0x4a0a76){if(_0x4a0a76){var _0x337331=_0x4a0a76[_0xa7bc('0x18')],_0x52cf43=_0x58c932['offset'],_0xa0ab04=_0x58c932[_0xa7bc('0x19')]+_0x58c932[_0xa7bc('0x1a')],_0x57dd1f;if(_0xa0ab04>=_0x337331){_0xa0ab04=_0x337331;_0x57dd1f=0xc8;}else{_0x57dd1f=0xce;}_0x3abb86[_0xa7bc('0x16')](_0x57dd1f);return _0x3abb86['set']('Content-Range',_0x52cf43+'-'+_0xa0ab04+'/'+_0x337331)[_0xa7bc('0x17')](_0x4a0a76);}return null;};}function patchUpdates(_0x24413f){return function(_0x203930){try{jsonpatch[_0xa7bc('0x1b')](_0x203930,_0x24413f,!![]);}catch(_0x25aaaf){return BPromise[_0xa7bc('0x1c')](_0x25aaaf);}return _0x203930[_0xa7bc('0x1d')]();};}function saveUpdates(_0x4dbb70,_0x3257ff){return function(_0x322712){if(_0x322712){return _0x322712[_0xa7bc('0x1e')](_0x4dbb70)[_0xa7bc('0x1f')](function(_0x3800a1){return _0x3800a1;});}return null;};}function removeEntity(_0x42131,_0x233f95){return function(_0x7f0d04){if(_0x7f0d04){return _0x7f0d04[_0xa7bc('0x20')]()[_0xa7bc('0x1f')](function(){_0x42131['status'](0xcc)[_0xa7bc('0x21')]();});}};}function handleEntityNotFound(_0x23cfad,_0x27d3d7){return function(_0x283f0e){if(!_0x283f0e){_0x23cfad[_0xa7bc('0x22')](0x194);}return _0x283f0e;};}function handleError(_0x194b89,_0x3c4662){_0x3c4662=_0x3c4662||0x1f4;return function(_0x4f68aa){logger['error'](_0x4f68aa['stack']);if(_0x4f68aa[_0xa7bc('0x23')]){delete _0x4f68aa[_0xa7bc('0x23')];}_0x194b89['status'](_0x3c4662)[_0xa7bc('0x24')](_0x4f68aa);};}exports[_0xa7bc('0x25')]=function(_0x599a7a,_0x47f8f5){var _0x3e9228={},_0x381111={},_0x433289={'count':0x0,'rows':[]};var _0x2ef091=_['map'](db[_0xa7bc('0x26')][_0xa7bc('0x27')],function(_0xd9730a){return{'name':_0xd9730a['fieldName'],'type':_0xd9730a[_0xa7bc('0x28')][_0xa7bc('0x29')]};});_0x381111[_0xa7bc('0x2a')]=_[_0xa7bc('0x2b')](_0x2ef091,_0xa7bc('0x23'));_0x381111['query']=_[_0xa7bc('0x2c')](_0x599a7a[_0xa7bc('0x2d')]);_0x381111[_0xa7bc('0x2e')]=_[_0xa7bc('0x2f')](_0x381111['model'],_0x381111[_0xa7bc('0x2d')]);_0x3e9228[_0xa7bc('0x30')]=_[_0xa7bc('0x2f')](_0x381111[_0xa7bc('0x2a')],qs[_0xa7bc('0x31')](_0x599a7a['query']['fields']));_0x3e9228[_0xa7bc('0x30')]=_0x3e9228[_0xa7bc('0x30')][_0xa7bc('0x32')]?_0x3e9228[_0xa7bc('0x30')]:_0x381111['model'];if(!_0x599a7a[_0xa7bc('0x2d')][_0xa7bc('0x33')](_0xa7bc('0x34'))){_0x3e9228[_0xa7bc('0x1a')]=qs['limit'](_0x599a7a[_0xa7bc('0x2d')][_0xa7bc('0x1a')]);_0x3e9228[_0xa7bc('0x19')]=qs[_0xa7bc('0x19')](_0x599a7a[_0xa7bc('0x2d')][_0xa7bc('0x19')]);}_0x3e9228[_0xa7bc('0x35')]=qs[_0xa7bc('0x36')](_0x599a7a[_0xa7bc('0x2d')][_0xa7bc('0x36')]);_0x3e9228[_0xa7bc('0x37')]=qs['filters'](_[_0xa7bc('0x38')](_0x599a7a['query'],_0x381111[_0xa7bc('0x2e')]),_0x2ef091);if(_0x599a7a[_0xa7bc('0x2d')]['filter']){_0x3e9228[_0xa7bc('0x37')]=_[_0xa7bc('0x39')](_0x3e9228[_0xa7bc('0x37')],{'$or':_['map'](_0x2ef091,function(_0x457e58){if(_0x457e58[_0xa7bc('0x28')]!==_0xa7bc('0x3a')){var _0x22c0ac={};_0x22c0ac[_0x457e58[_0xa7bc('0x23')]]={'$like':'%'+_0x599a7a['query'][_0xa7bc('0x3b')]+'%'};return _0x22c0ac;}})});}_0x3e9228=_['merge']({},_0x3e9228,_0x599a7a['options']);var _0x3e5894={'where':_0x3e9228[_0xa7bc('0x37')]};return db[_0xa7bc('0x26')][_0xa7bc('0x18')](_0x3e5894)[_0xa7bc('0x1f')](function(_0x22a6df){_0x433289[_0xa7bc('0x18')]=_0x22a6df;if(_0x599a7a[_0xa7bc('0x2d')][_0xa7bc('0x3c')]){_0x3e9228['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xa7bc('0x3d')](_0x3e9228);})[_0xa7bc('0x1f')](function(_0x2e4297){_0x433289[_0xa7bc('0x3e')]=_0x2e4297;return _0x433289;})[_0xa7bc('0x1f')](respondWithFilteredResult(_0x47f8f5,_0x3e9228))['catch'](handleError(_0x47f8f5,null));};exports['show']=function(_0x162c9d,_0x3e65da){var _0x4770ac={'raw':!![],'where':{'id':_0x162c9d[_0xa7bc('0x3f')]['id']}},_0x3f297b={};_0x3f297b['model']=_[_0xa7bc('0x2c')](db['OpenchannelQueueReport'][_0xa7bc('0x27')]);_0x3f297b['query']=_[_0xa7bc('0x2c')](_0x162c9d[_0xa7bc('0x2d')]);_0x3f297b[_0xa7bc('0x2e')]=_[_0xa7bc('0x2f')](_0x3f297b[_0xa7bc('0x2a')],_0x3f297b['query']);_0x4770ac[_0xa7bc('0x30')]=_[_0xa7bc('0x2f')](_0x3f297b[_0xa7bc('0x2a')],qs['fields'](_0x162c9d[_0xa7bc('0x2d')][_0xa7bc('0x31')]));_0x4770ac[_0xa7bc('0x30')]=_0x4770ac[_0xa7bc('0x30')][_0xa7bc('0x32')]?_0x4770ac[_0xa7bc('0x30')]:_0x3f297b['model'];if(_0x162c9d[_0xa7bc('0x2d')][_0xa7bc('0x3c')]){_0x4770ac[_0xa7bc('0x40')]=[{'all':!![]}];}_0x4770ac=_[_0xa7bc('0x39')]({},_0x4770ac,_0x162c9d[_0xa7bc('0x41')]);return db[_0xa7bc('0x26')]['find'](_0x4770ac)['then'](handleEntityNotFound(_0x3e65da,null))[_0xa7bc('0x1f')](respondWithResult(_0x3e65da,null))[_0xa7bc('0x42')](handleError(_0x3e65da,null));};exports['create']=function(_0x4d1f02,_0x2a6eaf){return db[_0xa7bc('0x26')][_0xa7bc('0x43')](_0x4d1f02[_0xa7bc('0x44')],{})[_0xa7bc('0x1f')](respondWithResult(_0x2a6eaf,0xc9))[_0xa7bc('0x42')](handleError(_0x2a6eaf,null));};exports['update']=function(_0x29b99a,_0x39e7ed){if(_0x29b99a[_0xa7bc('0x44')]['id']){delete _0x29b99a[_0xa7bc('0x44')]['id'];}return db[_0xa7bc('0x26')]['find']({'where':{'id':_0x29b99a[_0xa7bc('0x3f')]['id']}})[_0xa7bc('0x1f')](handleEntityNotFound(_0x39e7ed,null))[_0xa7bc('0x1f')](saveUpdates(_0x29b99a[_0xa7bc('0x44')],null))[_0xa7bc('0x1f')](respondWithResult(_0x39e7ed,null))[_0xa7bc('0x42')](handleError(_0x39e7ed,null));};exports[_0xa7bc('0x20')]=function(_0x4f5d89,_0x4d20a2){return db[_0xa7bc('0x26')][_0xa7bc('0x45')]({'where':{'id':_0x4f5d89[_0xa7bc('0x3f')]['id']}})[_0xa7bc('0x1f')](handleEntityNotFound(_0x4d20a2,null))['then'](removeEntity(_0x4d20a2,null))[_0xa7bc('0x42')](handleError(_0x4d20a2,null));};exports[_0xa7bc('0x46')]=function(_0x3b3794,_0x458823){return db[_0xa7bc('0x26')]['describe']()[_0xa7bc('0x1f')](respondWithResult(_0x458823,null))[_0xa7bc('0x42')](handleError(_0x458823,null));};
\ No newline at end of file
index 676214c..140dc13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe437=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xe437,0x69));var _0x7e43=function(_0x35e25c,_0x301f23){_0x35e25c=_0x35e25c-0x0;var _0x5266c6=_0xe437[_0x35e25c];return _0x5266c6;};'use strict';var _=require(_0x7e43('0x0'));var util=require(_0x7e43('0x1'));var logger=require(_0x7e43('0x2'))('api');var moment=require(_0x7e43('0x3'));var BPromise=require(_0x7e43('0x4'));var rp=require(_0x7e43('0x5'));var fs=require('fs');var path=require(_0x7e43('0x6'));var rimraf=require(_0x7e43('0x7'));var config=require(_0x7e43('0x8'));var attributes=require(_0x7e43('0x9'));module[_0x7e43('0xa')]=function(_0x494ce6,_0x25752a){return _0x494ce6[_0x7e43('0xb')](_0x7e43('0xc'),attributes,{'tableName':_0x7e43('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7e43('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa48=['request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x278bb6,_0x356231){var _0x4d8952=function(_0x3e0bd0){while(--_0x3e0bd0){_0x278bb6['push'](_0x278bb6['shift']());}};_0x4d8952(++_0x356231);}(_0xaa48,0x15a));var _0x8aa4=function(_0x5e3fd7,_0x10d87c){_0x5e3fd7=_0x5e3fd7-0x0;var _0x2f2d3c=_0xaa48[_0x5e3fd7];return _0x2f2d3c;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var logger=require(_0x8aa4('0x2'))(_0x8aa4('0x3'));var moment=require(_0x8aa4('0x4'));var BPromise=require(_0x8aa4('0x5'));var rp=require(_0x8aa4('0x6'));var fs=require('fs');var path=require(_0x8aa4('0x7'));var rimraf=require(_0x8aa4('0x8'));var config=require(_0x8aa4('0x9'));var attributes=require(_0x8aa4('0xa'));module[_0x8aa4('0xb')]=function(_0x141d8b,_0x14614c){return _0x141d8b[_0x8aa4('0xc')](_0x8aa4('0xd'),attributes,{'tableName':_0x8aa4('0xe'),'paranoid':![],'indexes':[{'name':_0x8aa4('0xf'),'fields':[_0x8aa4('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 9e1c3eb..9c41bdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6db4=['OpenchannelQueueReport','body','options','UpdateOpenchannelQueueReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateOpenchannelQueueReport'];(function(_0x3654b0,_0x48d761){var _0x5b9b61=function(_0x41fcf6){while(--_0x41fcf6){_0x3654b0['push'](_0x3654b0['shift']());}};_0x5b9b61(++_0x48d761);}(_0x6db4,0x111));var _0x46db=function(_0x4b5815,_0x51b4f2){_0x4b5815=_0x4b5815-0x0;var _0x5f0470=_0x6db4[_0x4b5815];return _0x5f0470;};'use strict';var _=require('lodash');var util=require(_0x46db('0x0'));var moment=require(_0x46db('0x1'));var BPromise=require(_0x46db('0x2'));var rs=require(_0x46db('0x3'));var fs=require('fs');var Redis=require(_0x46db('0x4'));var db=require(_0x46db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46db('0x6'))(_0x46db('0x7'));var config=require(_0x46db('0x8'));var jayson=require(_0x46db('0x9'));var client=jayson[_0x46db('0xa')][_0x46db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23de32,_0x5409cd,_0x3a2dcb){return new BPromise(function(_0x2a597d,_0x27b949){return client[_0x46db('0xc')](_0x23de32,_0x3a2dcb)[_0x46db('0xd')](function(_0x427c62){logger[_0x46db('0xe')](_0x46db('0xf'),_0x5409cd,_0x46db('0x10'));logger[_0x46db('0x11')](_0x46db('0x12'),_0x5409cd,_0x46db('0x10'),JSON['stringify'](_0x427c62));if(_0x427c62[_0x46db('0x13')]){if(_0x427c62[_0x46db('0x13')][_0x46db('0x14')]===0x1f4){logger[_0x46db('0x13')](_0x46db('0xf'),_0x5409cd,_0x427c62[_0x46db('0x13')][_0x46db('0x15')]);return _0x27b949(_0x427c62[_0x46db('0x13')][_0x46db('0x15')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5409cd,_0x427c62['error'][_0x46db('0x15')]);return _0x2a597d(_0x427c62[_0x46db('0x13')]['message']);}else{logger[_0x46db('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5409cd,_0x46db('0x10'));_0x2a597d(_0x427c62['result'][_0x46db('0x15')]);}})[_0x46db('0x16')](function(_0x5a75fb){logger[_0x46db('0x13')](_0x46db('0xf'),_0x5409cd,_0x5a75fb);_0x27b949(_0x5a75fb);});});}exports[_0x46db('0x17')]=function(_0x32c5ef){var _0x1e24e6=this;return new Promise(function(_0x34101d,_0x1c6383){return db[_0x46db('0x18')]['create'](_0x32c5ef[_0x46db('0x19')],{'raw':_0x32c5ef[_0x46db('0x1a')]?_0x32c5ef[_0x46db('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4fb609){logger['info'](_0x46db('0x17'),_0x32c5ef);logger[_0x46db('0x11')](_0x46db('0x17'),_0x32c5ef,JSON['stringify'](_0x4fb609));_0x34101d(_0x4fb609);})['catch'](function(_0x27aab2){logger[_0x46db('0x13')](_0x46db('0x17'),_0x27aab2[_0x46db('0x15')],_0x32c5ef);_0x1c6383(_0x1e24e6[_0x46db('0x13')](0x1f4,_0x27aab2[_0x46db('0x15')]));});});};exports[_0x46db('0x1b')]=function(_0x3a50dd){var _0x4708df=this;return new Promise(function(_0x7bcdf5,_0x509ebf){return db[_0x46db('0x18')][_0x46db('0x1c')](_0x3a50dd[_0x46db('0x19')],{'raw':_0x3a50dd[_0x46db('0x1a')]?_0x3a50dd[_0x46db('0x1a')][_0x46db('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a50dd['options']?_0x3a50dd[_0x46db('0x1a')][_0x46db('0x1e')]||null:null,'attributes':_0x3a50dd[_0x46db('0x1a')]?_0x3a50dd['options'][_0x46db('0x1f')]||null:null,'limit':_0x3a50dd[_0x46db('0x1a')]?_0x3a50dd[_0x46db('0x1a')][_0x46db('0x20')]||null:null})[_0x46db('0xd')](function(_0x81dc80){logger[_0x46db('0xe')](_0x46db('0x1b'),_0x3a50dd);logger[_0x46db('0x11')](_0x46db('0x1b'),_0x3a50dd,JSON['stringify'](_0x81dc80));_0x7bcdf5(_0x81dc80);})[_0x46db('0x16')](function(_0x1d5f86){logger['error'](_0x46db('0x1b'),_0x1d5f86[_0x46db('0x15')],_0x3a50dd);_0x509ebf(_0x4708df[_0x46db('0x13')](0x1f4,_0x1d5f86[_0x46db('0x15')]));});});};
\ No newline at end of file
+var _0x7b84=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x48b916,_0x3498b6){var _0x1c20b9=function(_0x430086){while(--_0x430086){_0x48b916['push'](_0x48b916['shift']());}};_0x1c20b9(++_0x3498b6);}(_0x7b84,0x17c));var _0x47b8=function(_0x59ce13,_0x36e14c){_0x59ce13=_0x59ce13-0x0;var _0x51d2b3=_0x7b84[_0x59ce13];return _0x51d2b3;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}exports['CreateOpenchannelQueueReport']=function(_0x4f7317){var _0x299195=this;return new Promise(function(_0x36faf1,_0x2797ac){return db['OpenchannelQueueReport']['create'](_0x4f7317['body'],{'raw':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317['options'][_0x47b8('0x1b')]===undefined?!![]:![]:!![]})[_0x47b8('0xe')](function(_0x303f19){logger[_0x47b8('0xf')]('CreateOpenchannelQueueReport',_0x4f7317);logger[_0x47b8('0x12')](_0x47b8('0x1c'),_0x4f7317,JSON[_0x47b8('0x14')](_0x303f19));_0x36faf1(_0x303f19);})[_0x47b8('0x19')](function(_0x168cde){logger[_0x47b8('0x15')]('CreateOpenchannelQueueReport',_0x168cde[_0x47b8('0x17')],_0x4f7317);_0x2797ac(_0x299195[_0x47b8('0x15')](0x1f4,_0x168cde['message']));});});};exports[_0x47b8('0x1d')]=function(_0x247429){var _0x19b03e=this;return new Promise(function(_0x142fb6,_0x5604c9){return db[_0x47b8('0x1e')][_0x47b8('0x1f')](_0x247429[_0x47b8('0x20')],{'raw':_0x247429[_0x47b8('0x1a')]?_0x247429[_0x47b8('0x1a')][_0x47b8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x247429[_0x47b8('0x1a')]?_0x247429['options'][_0x47b8('0x21')]||null:null,'attributes':_0x247429[_0x47b8('0x1a')]?_0x247429['options'][_0x47b8('0x22')]||null:null,'limit':_0x247429[_0x47b8('0x1a')]?_0x247429[_0x47b8('0x1a')][_0x47b8('0x23')]||null:null})['then'](function(_0x162d96){logger['info'](_0x47b8('0x1d'),_0x247429);logger[_0x47b8('0x12')](_0x47b8('0x1d'),_0x247429,JSON[_0x47b8('0x14')](_0x162d96));_0x142fb6(_0x162d96);})['catch'](function(_0x35fbbb){logger[_0x47b8('0x15')](_0x47b8('0x1d'),_0x35fbbb[_0x47b8('0x17')],_0x247429);_0x5604c9(_0x19b03e[_0x47b8('0x15')](0x1f4,_0x35fbbb[_0x47b8('0x17')]));});});};
\ No newline at end of file
index 04761cc..11d7aa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
+var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
index 32e04c3..90bec01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad91=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x36a0b9,_0x5de13e){var _0x36a397=function(_0x59da19){while(--_0x59da19){_0x36a0b9['push'](_0x36a0b9['shift']());}};_0x36a397(++_0x5de13e);}(_0xad91,0x12d));var _0x1ad9=function(_0x27e7e2,_0x3ddb8a){_0x27e7e2=_0x27e7e2-0x0;var _0x55431f=_0xad91[_0x27e7e2];return _0x55431f;};'use strict';var moment=require(_0x1ad9('0x0'));var Sequelize=require(_0x1ad9('0x1'));module[_0x1ad9('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1ad9('0x3')]('account',_0x1ad9('0x4'),_0x1ad9('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x1ad9('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x1ad9('0x7')]}};
\ No newline at end of file
+var _0xbb48=['queue','DATE','NOW','moment','exports','STRING','agent'];(function(_0xf1b354,_0x32048c){var _0x405d3a=function(_0x2e1dbc){while(--_0x2e1dbc){_0xf1b354['push'](_0xf1b354['shift']());}};_0x405d3a(++_0x32048c);}(_0xbb48,0x1d8));var _0x8bb4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbb48[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0x8bb4('0x0'));var Sequelize=require('sequelize');module[_0x8bb4('0x1')]={'uniqueid':{'type':Sequelize[_0x8bb4('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x8bb4('0x3'),_0x8bb4('0x4')),'allowNull':![],'defaultValue':_0x8bb4('0x4')},'transferredAt':{'type':Sequelize[_0x8bb4('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x8bb4('0x6')]}};
\ No newline at end of file
index 3f7693f..24951b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6c5=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','OpenchannelTransferReport','rawAttributes','type','key','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service'];(function(_0x2210fb,_0x59d5f7){var _0x161060=function(_0x4d254f){while(--_0x4d254f){_0x2210fb['push'](_0x2210fb['shift']());}};_0x161060(++_0x59d5f7);}(_0xb6c5,0x84));var _0x5b6c=function(_0x401c08,_0x3aa4c7){_0x401c08=_0x401c08-0x0;var _0x45780e=_0xb6c5[_0x401c08];return _0x45780e;};'use strict';var pdf=require(_0x5b6c('0x0'));var emlformat=require(_0x5b6c('0x1'));var rimraf=require(_0x5b6c('0x2'));var zipdir=require(_0x5b6c('0x3'));var jsonpatch=require(_0x5b6c('0x4'));var rp=require(_0x5b6c('0x5'));var moment=require(_0x5b6c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5b6c('0x7'));var util=require(_0x5b6c('0x8'));var path=require(_0x5b6c('0x9'));var sox=require(_0x5b6c('0xa'));var csv=require(_0x5b6c('0xb'));var ejs=require(_0x5b6c('0xc'));var fs=require('fs');var _=require(_0x5b6c('0xd'));var squel=require(_0x5b6c('0xe'));var crypto=require('crypto');var jsforce=require(_0x5b6c('0xf'));var deskjs=require(_0x5b6c('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5b6c('0x11'));var qs=require(_0x5b6c('0x12'));var as=require(_0x5b6c('0x13'));var hardwareService=require(_0x5b6c('0x14'));var logger=require(_0x5b6c('0x15'))(_0x5b6c('0x16'));var utils=require(_0x5b6c('0x17'));var config=require(_0x5b6c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x431244,_0x8b7a46){_0x8b7a46=_0x8b7a46||0xcc;return function(_0x1971af){if(_0x1971af){return _0x431244[_0x5b6c('0x19')](_0x8b7a46);}return _0x431244['status'](_0x8b7a46)[_0x5b6c('0x1a')]();};}function respondWithResult(_0x2e114d,_0x5f0495){_0x5f0495=_0x5f0495||0xc8;return function(_0x7f5d22){if(_0x7f5d22){return _0x2e114d[_0x5b6c('0x1b')](_0x5f0495)[_0x5b6c('0x1c')](_0x7f5d22);}};}function respondWithFilteredResult(_0x103245,_0x50b869){return function(_0x2acd88){if(_0x2acd88){var _0x44ca9a=_0x2acd88[_0x5b6c('0x1d')],_0x2bf799=_0x50b869['offset'],_0x352179=_0x50b869[_0x5b6c('0x1e')]+_0x50b869['limit'],_0x31df8e;if(_0x352179>=_0x44ca9a){_0x352179=_0x44ca9a;_0x31df8e=0xc8;}else{_0x31df8e=0xce;}_0x103245[_0x5b6c('0x1b')](_0x31df8e);return _0x103245['set'](_0x5b6c('0x1f'),_0x2bf799+'-'+_0x352179+'/'+_0x44ca9a)[_0x5b6c('0x1c')](_0x2acd88);}return null;};}function patchUpdates(_0x162a60){return function(_0x35e3fd){try{jsonpatch[_0x5b6c('0x20')](_0x35e3fd,_0x162a60,!![]);}catch(_0x3513c9){return BPromise[_0x5b6c('0x21')](_0x3513c9);}return _0x35e3fd[_0x5b6c('0x22')]();};}function saveUpdates(_0x382ce7,_0x42e86a){return function(_0x3a852e){if(_0x3a852e){return _0x3a852e[_0x5b6c('0x23')](_0x382ce7)['then'](function(_0x1f9f86){return _0x1f9f86;});}return null;};}function removeEntity(_0x22f0b2,_0x12de65){return function(_0x1fe224){if(_0x1fe224){return _0x1fe224[_0x5b6c('0x24')]()[_0x5b6c('0x25')](function(){_0x22f0b2['status'](0xcc)[_0x5b6c('0x1a')]();});}};}function handleEntityNotFound(_0xea4074,_0x47b642){return function(_0x1e2b97){if(!_0x1e2b97){_0xea4074[_0x5b6c('0x19')](0x194);}return _0x1e2b97;};}function handleError(_0x133841,_0x53c452){_0x53c452=_0x53c452||0x1f4;return function(_0x4598f0){logger[_0x5b6c('0x26')](_0x4598f0[_0x5b6c('0x27')]);if(_0x4598f0['name']){delete _0x4598f0[_0x5b6c('0x28')];}_0x133841[_0x5b6c('0x1b')](_0x53c452)['send'](_0x4598f0);};}exports[_0x5b6c('0x29')]=function(_0x8631fa,_0xc73ca9){var _0x7f151f={},_0xd6609c={},_0x37b8cf={'count':0x0,'rows':[]};var _0xcf3799=_['map'](db[_0x5b6c('0x2a')][_0x5b6c('0x2b')],function(_0x1f1344){return{'name':_0x1f1344['fieldName'],'type':_0x1f1344[_0x5b6c('0x2c')][_0x5b6c('0x2d')]};});_0xd6609c['model']=_[_0x5b6c('0x2e')](_0xcf3799,'name');_0xd6609c['query']=_[_0x5b6c('0x2f')](_0x8631fa[_0x5b6c('0x30')]);_0xd6609c[_0x5b6c('0x31')]=_['intersection'](_0xd6609c[_0x5b6c('0x32')],_0xd6609c[_0x5b6c('0x30')]);_0x7f151f[_0x5b6c('0x33')]=_[_0x5b6c('0x34')](_0xd6609c['model'],qs[_0x5b6c('0x35')](_0x8631fa[_0x5b6c('0x30')][_0x5b6c('0x35')]));_0x7f151f[_0x5b6c('0x33')]=_0x7f151f[_0x5b6c('0x33')][_0x5b6c('0x36')]?_0x7f151f[_0x5b6c('0x33')]:_0xd6609c[_0x5b6c('0x32')];if(!_0x8631fa[_0x5b6c('0x30')][_0x5b6c('0x37')](_0x5b6c('0x38'))){_0x7f151f[_0x5b6c('0x39')]=qs[_0x5b6c('0x39')](_0x8631fa[_0x5b6c('0x30')][_0x5b6c('0x39')]);_0x7f151f[_0x5b6c('0x1e')]=qs[_0x5b6c('0x1e')](_0x8631fa[_0x5b6c('0x30')][_0x5b6c('0x1e')]);}_0x7f151f['order']=qs['sort'](_0x8631fa['query'][_0x5b6c('0x3a')]);_0x7f151f[_0x5b6c('0x3b')]=qs[_0x5b6c('0x31')](_[_0x5b6c('0x3c')](_0x8631fa['query'],_0xd6609c[_0x5b6c('0x31')]),_0xcf3799);if(_0x8631fa[_0x5b6c('0x30')][_0x5b6c('0x3d')]){_0x7f151f[_0x5b6c('0x3b')]=_['merge'](_0x7f151f[_0x5b6c('0x3b')],{'$or':_['map'](_0xcf3799,function(_0x399437){if(_0x399437[_0x5b6c('0x2c')]!=='VIRTUAL'){var _0x27c3ce={};_0x27c3ce[_0x399437[_0x5b6c('0x28')]]={'$like':'%'+_0x8631fa['query'][_0x5b6c('0x3d')]+'%'};return _0x27c3ce;}})});}_0x7f151f=_[_0x5b6c('0x3e')]({},_0x7f151f,_0x8631fa[_0x5b6c('0x3f')]);var _0x14d4ab={'where':_0x7f151f[_0x5b6c('0x3b')]};return db['OpenchannelTransferReport']['count'](_0x14d4ab)[_0x5b6c('0x25')](function(_0x19c785){_0x37b8cf[_0x5b6c('0x1d')]=_0x19c785;if(_0x8631fa[_0x5b6c('0x30')][_0x5b6c('0x40')]){_0x7f151f[_0x5b6c('0x41')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x5b6c('0x42')](_0x7f151f);})[_0x5b6c('0x25')](function(_0xef22e){_0x37b8cf[_0x5b6c('0x43')]=_0xef22e;return _0x37b8cf;})[_0x5b6c('0x25')](respondWithFilteredResult(_0xc73ca9,_0x7f151f))[_0x5b6c('0x44')](handleError(_0xc73ca9,null));};exports[_0x5b6c('0x45')]=function(_0x102f9b,_0x24d728){var _0x348454={'raw':!![],'where':{'id':_0x102f9b[_0x5b6c('0x46')]['id']}},_0x1236f0={};_0x1236f0[_0x5b6c('0x32')]=_[_0x5b6c('0x2f')](db['OpenchannelTransferReport'][_0x5b6c('0x2b')]);_0x1236f0[_0x5b6c('0x30')]=_[_0x5b6c('0x2f')](_0x102f9b[_0x5b6c('0x30')]);_0x1236f0[_0x5b6c('0x31')]=_[_0x5b6c('0x34')](_0x1236f0['model'],_0x1236f0['query']);_0x348454['attributes']=_['intersection'](_0x1236f0[_0x5b6c('0x32')],qs['fields'](_0x102f9b[_0x5b6c('0x30')][_0x5b6c('0x35')]));_0x348454['attributes']=_0x348454[_0x5b6c('0x33')][_0x5b6c('0x36')]?_0x348454[_0x5b6c('0x33')]:_0x1236f0[_0x5b6c('0x32')];if(_0x102f9b['query']['includeAll']){_0x348454[_0x5b6c('0x41')]=[{'all':!![]}];}_0x348454=_[_0x5b6c('0x3e')]({},_0x348454,_0x102f9b[_0x5b6c('0x3f')]);return db['OpenchannelTransferReport'][_0x5b6c('0x47')](_0x348454)[_0x5b6c('0x25')](handleEntityNotFound(_0x24d728,null))[_0x5b6c('0x25')](respondWithResult(_0x24d728,null))[_0x5b6c('0x44')](handleError(_0x24d728,null));};exports[_0x5b6c('0x48')]=function(_0x2f1736,_0x55b7c0){return db[_0x5b6c('0x2a')][_0x5b6c('0x48')](_0x2f1736[_0x5b6c('0x49')],{})[_0x5b6c('0x25')](respondWithResult(_0x55b7c0,0xc9))[_0x5b6c('0x44')](handleError(_0x55b7c0,null));};exports[_0x5b6c('0x23')]=function(_0x48a0c8,_0x54dd38){if(_0x48a0c8[_0x5b6c('0x49')]['id']){delete _0x48a0c8['body']['id'];}return db['OpenchannelTransferReport'][_0x5b6c('0x47')]({'where':{'id':_0x48a0c8[_0x5b6c('0x46')]['id']}})['then'](handleEntityNotFound(_0x54dd38,null))[_0x5b6c('0x25')](saveUpdates(_0x48a0c8[_0x5b6c('0x49')],null))[_0x5b6c('0x25')](respondWithResult(_0x54dd38,null))['catch'](handleError(_0x54dd38,null));};exports['destroy']=function(_0x509454,_0x387294){return db[_0x5b6c('0x2a')][_0x5b6c('0x47')]({'where':{'id':_0x509454[_0x5b6c('0x46')]['id']}})[_0x5b6c('0x25')](handleEntityNotFound(_0x387294,null))['then'](removeEntity(_0x387294,null))[_0x5b6c('0x44')](handleError(_0x387294,null));};exports[_0x5b6c('0x4a')]=function(_0x5c721c,_0x6fc437){return db['OpenchannelTransferReport']['describe']()['then'](respondWithResult(_0x6fc437,null))[_0x5b6c('0x44')](handleError(_0x6fc437,null));};
\ No newline at end of file
+var _0x017b=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','keys','include','find','create','body','update','destroy','describe','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','to-csv'];(function(_0x1fe30d,_0x51107c){var _0x3bd23e=function(_0xafc713){while(--_0xafc713){_0x1fe30d['push'](_0x1fe30d['shift']());}};_0x3bd23e(++_0x51107c);}(_0x017b,0x192));var _0xb017=function(_0x885036,_0x1e619f){_0x885036=_0x885036-0x0;var _0x9bc432=_0x017b[_0x885036];return _0x9bc432;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb017('0x0'));var zipdir=require(_0xb017('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb017('0x2'));var BPromise=require(_0xb017('0x3'));var Mustache=require('mustache');var util=require(_0xb017('0x4'));var path=require(_0xb017('0x5'));var sox=require(_0xb017('0x6'));var csv=require('to-csv');var ejs=require(_0xb017('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb017('0x8'));var crypto=require(_0xb017('0x9'));var jsforce=require(_0xb017('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb017('0xb'));var querystring=require(_0xb017('0xc'));var Papa=require(_0xb017('0xd'));var Redis=require(_0xb017('0xe'));var authService=require(_0xb017('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb017('0x10'));var logger=require(_0xb017('0x11'))(_0xb017('0x12'));var utils=require('../../config/utils');var config=require(_0xb017('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x183d28,_0x4e2c85){_0x4e2c85=_0x4e2c85||0xcc;return function(_0x402510){if(_0x402510){return _0x183d28[_0xb017('0x14')](_0x4e2c85);}return _0x183d28['status'](_0x4e2c85)[_0xb017('0x15')]();};}function respondWithResult(_0x51266d,_0x3eb5a3){_0x3eb5a3=_0x3eb5a3||0xc8;return function(_0x572f44){if(_0x572f44){return _0x51266d[_0xb017('0x16')](_0x3eb5a3)[_0xb017('0x17')](_0x572f44);}};}function respondWithFilteredResult(_0x356865,_0x197135){return function(_0x57741c){if(_0x57741c){var _0x30855b=_0x57741c[_0xb017('0x18')],_0x5b061c=_0x197135[_0xb017('0x19')],_0x101195=_0x197135[_0xb017('0x19')]+_0x197135[_0xb017('0x1a')],_0x2b4b09;if(_0x101195>=_0x30855b){_0x101195=_0x30855b;_0x2b4b09=0xc8;}else{_0x2b4b09=0xce;}_0x356865[_0xb017('0x16')](_0x2b4b09);return _0x356865[_0xb017('0x1b')](_0xb017('0x1c'),_0x5b061c+'-'+_0x101195+'/'+_0x30855b)['json'](_0x57741c);}return null;};}function patchUpdates(_0x1e6713){return function(_0x250d1f){try{jsonpatch['apply'](_0x250d1f,_0x1e6713,!![]);}catch(_0x4f4e8e){return BPromise[_0xb017('0x1d')](_0x4f4e8e);}return _0x250d1f[_0xb017('0x1e')]();};}function saveUpdates(_0x449eb3,_0x9954a0){return function(_0x59a66f){if(_0x59a66f){return _0x59a66f['update'](_0x449eb3)[_0xb017('0x1f')](function(_0xf86ef6){return _0xf86ef6;});}return null;};}function removeEntity(_0x42f59f,_0xd08839){return function(_0x1272ab){if(_0x1272ab){return _0x1272ab['destroy']()['then'](function(){_0x42f59f[_0xb017('0x16')](0xcc)[_0xb017('0x15')]();});}};}function handleEntityNotFound(_0x41e68c,_0x56e699){return function(_0x559e3b){if(!_0x559e3b){_0x41e68c[_0xb017('0x14')](0x194);}return _0x559e3b;};}function handleError(_0x146f74,_0x3b25bf){_0x3b25bf=_0x3b25bf||0x1f4;return function(_0x47662f){logger[_0xb017('0x20')](_0x47662f[_0xb017('0x21')]);if(_0x47662f['name']){delete _0x47662f[_0xb017('0x22')];}_0x146f74[_0xb017('0x16')](_0x3b25bf)[_0xb017('0x23')](_0x47662f);};}exports[_0xb017('0x24')]=function(_0x59e4ac,_0x44e459){var _0x3ceadb={},_0x5b2462={},_0x59cd69={'count':0x0,'rows':[]};var _0x2c5f39=_[_0xb017('0x25')](db[_0xb017('0x26')][_0xb017('0x27')],function(_0x3e77de){return{'name':_0x3e77de['fieldName'],'type':_0x3e77de['type'][_0xb017('0x28')]};});_0x5b2462[_0xb017('0x29')]=_['map'](_0x2c5f39,_0xb017('0x22'));_0x5b2462['query']=_['keys'](_0x59e4ac[_0xb017('0x2a')]);_0x5b2462[_0xb017('0x2b')]=_['intersection'](_0x5b2462[_0xb017('0x29')],_0x5b2462[_0xb017('0x2a')]);_0x3ceadb[_0xb017('0x2c')]=_[_0xb017('0x2d')](_0x5b2462[_0xb017('0x29')],qs[_0xb017('0x2e')](_0x59e4ac[_0xb017('0x2a')][_0xb017('0x2e')]));_0x3ceadb[_0xb017('0x2c')]=_0x3ceadb['attributes']['length']?_0x3ceadb[_0xb017('0x2c')]:_0x5b2462[_0xb017('0x29')];if(!_0x59e4ac[_0xb017('0x2a')][_0xb017('0x2f')]('nolimit')){_0x3ceadb['limit']=qs[_0xb017('0x1a')](_0x59e4ac['query'][_0xb017('0x1a')]);_0x3ceadb[_0xb017('0x19')]=qs[_0xb017('0x19')](_0x59e4ac[_0xb017('0x2a')][_0xb017('0x19')]);}_0x3ceadb[_0xb017('0x30')]=qs['sort'](_0x59e4ac[_0xb017('0x2a')][_0xb017('0x31')]);_0x3ceadb[_0xb017('0x32')]=qs[_0xb017('0x2b')](_[_0xb017('0x33')](_0x59e4ac[_0xb017('0x2a')],_0x5b2462[_0xb017('0x2b')]),_0x2c5f39);if(_0x59e4ac[_0xb017('0x2a')][_0xb017('0x34')]){_0x3ceadb[_0xb017('0x32')]=_[_0xb017('0x35')](_0x3ceadb[_0xb017('0x32')],{'$or':_[_0xb017('0x25')](_0x2c5f39,function(_0x306ec0){if(_0x306ec0[_0xb017('0x36')]!==_0xb017('0x37')){var _0x7b32e3={};_0x7b32e3[_0x306ec0[_0xb017('0x22')]]={'$like':'%'+_0x59e4ac[_0xb017('0x2a')][_0xb017('0x34')]+'%'};return _0x7b32e3;}})});}_0x3ceadb=_['merge']({},_0x3ceadb,_0x59e4ac[_0xb017('0x38')]);var _0x5b3f66={'where':_0x3ceadb[_0xb017('0x32')]};return db[_0xb017('0x26')][_0xb017('0x18')](_0x5b3f66)[_0xb017('0x1f')](function(_0x28d345){_0x59cd69[_0xb017('0x18')]=_0x28d345;if(_0x59e4ac[_0xb017('0x2a')]['includeAll']){_0x3ceadb['include']=[{'all':!![]}];}return db[_0xb017('0x26')][_0xb017('0x39')](_0x3ceadb);})[_0xb017('0x1f')](function(_0x4776fd){_0x59cd69['rows']=_0x4776fd;return _0x59cd69;})['then'](respondWithFilteredResult(_0x44e459,_0x3ceadb))[_0xb017('0x3a')](handleError(_0x44e459,null));};exports[_0xb017('0x3b')]=function(_0x1737bf,_0x58af6b){var _0xecf903={'raw':!![],'where':{'id':_0x1737bf[_0xb017('0x3c')]['id']}},_0x496fe0={};_0x496fe0[_0xb017('0x29')]=_[_0xb017('0x3d')](db[_0xb017('0x26')][_0xb017('0x27')]);_0x496fe0['query']=_['keys'](_0x1737bf['query']);_0x496fe0[_0xb017('0x2b')]=_[_0xb017('0x2d')](_0x496fe0[_0xb017('0x29')],_0x496fe0[_0xb017('0x2a')]);_0xecf903[_0xb017('0x2c')]=_[_0xb017('0x2d')](_0x496fe0[_0xb017('0x29')],qs['fields'](_0x1737bf[_0xb017('0x2a')][_0xb017('0x2e')]));_0xecf903[_0xb017('0x2c')]=_0xecf903[_0xb017('0x2c')]['length']?_0xecf903[_0xb017('0x2c')]:_0x496fe0['model'];if(_0x1737bf['query']['includeAll']){_0xecf903[_0xb017('0x3e')]=[{'all':!![]}];}_0xecf903=_[_0xb017('0x35')]({},_0xecf903,_0x1737bf[_0xb017('0x38')]);return db[_0xb017('0x26')][_0xb017('0x3f')](_0xecf903)[_0xb017('0x1f')](handleEntityNotFound(_0x58af6b,null))['then'](respondWithResult(_0x58af6b,null))[_0xb017('0x3a')](handleError(_0x58af6b,null));};exports[_0xb017('0x40')]=function(_0x349470,_0x427ee8){return db['OpenchannelTransferReport'][_0xb017('0x40')](_0x349470[_0xb017('0x41')],{})[_0xb017('0x1f')](respondWithResult(_0x427ee8,0xc9))[_0xb017('0x3a')](handleError(_0x427ee8,null));};exports[_0xb017('0x42')]=function(_0x1a2d68,_0x2b128d){if(_0x1a2d68[_0xb017('0x41')]['id']){delete _0x1a2d68[_0xb017('0x41')]['id'];}return db[_0xb017('0x26')][_0xb017('0x3f')]({'where':{'id':_0x1a2d68['params']['id']}})[_0xb017('0x1f')](handleEntityNotFound(_0x2b128d,null))[_0xb017('0x1f')](saveUpdates(_0x1a2d68[_0xb017('0x41')],null))[_0xb017('0x1f')](respondWithResult(_0x2b128d,null))[_0xb017('0x3a')](handleError(_0x2b128d,null));};exports[_0xb017('0x43')]=function(_0x163c9d,_0x4b441b){return db[_0xb017('0x26')][_0xb017('0x3f')]({'where':{'id':_0x163c9d['params']['id']}})[_0xb017('0x1f')](handleEntityNotFound(_0x4b441b,null))[_0xb017('0x1f')](removeEntity(_0x4b441b,null))[_0xb017('0x3a')](handleError(_0x4b441b,null));};exports[_0xb017('0x44')]=function(_0x19146f,_0x96cdc){return db[_0xb017('0x26')][_0xb017('0x44')]()['then'](respondWithResult(_0x96cdc,null))[_0xb017('0x3a')](handleError(_0x96cdc,null));};
\ No newline at end of file
index 3081170..dd2f722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5127=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x33af5e,_0x3c4bb7){var _0x4d7043=function(_0x255654){while(--_0x255654){_0x33af5e['push'](_0x33af5e['shift']());}};_0x4d7043(++_0x3c4bb7);}(_0x5127,0xe1));var _0x7512=function(_0x17c487,_0x2b72f1){_0x17c487=_0x17c487-0x0;var _0x3feeb8=_0x5127[_0x17c487];return _0x3feeb8;};'use strict';var _=require('lodash');var util=require(_0x7512('0x0'));var logger=require(_0x7512('0x1'))(_0x7512('0x2'));var moment=require(_0x7512('0x3'));var BPromise=require(_0x7512('0x4'));var rp=require(_0x7512('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7512('0x6'));var config=require(_0x7512('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x7512('0x8')]=function(_0x4ccc17,_0xa9177b){return _0x4ccc17[_0x7512('0x9')](_0x7512('0xa'),attributes,{'tableName':_0x7512('0xb'),'paranoid':![],'indexes':[{'name':_0x7512('0xc'),'fields':[_0x7512('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe714=['exports','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe714,0x12d));var _0x4e71=function(_0x25eca0,_0x2bbb67){_0x25eca0=_0x25eca0-0x0;var _0x1be6dd=_0xe714[_0x25eca0];return _0x1be6dd;};'use strict';var _=require(_0x4e71('0x0'));var util=require('util');var logger=require(_0x4e71('0x1'))(_0x4e71('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e71('0x3'));var fs=require('fs');var path=require(_0x4e71('0x4'));var rimraf=require(_0x4e71('0x5'));var config=require(_0x4e71('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x4e71('0x7')]=function(_0x328530,_0x4f3066){return _0x328530[_0x4e71('0x8')](_0x4e71('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x4e71('0xa'),'fields':[_0x4e71('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 42aee45..6bf4ce6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a72=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0xa2b1f9,_0x3ec7c1){var _0x2ddd98=function(_0x3f9a2f){while(--_0x3f9a2f){_0xa2b1f9['push'](_0xa2b1f9['shift']());}};_0x2ddd98(++_0x3ec7c1);}(_0x9a72,0x8e));var _0x29a7=function(_0x37cbdf,_0x4d1b17){_0x37cbdf=_0x37cbdf-0x0;var _0x4cd25c=_0x9a72[_0x37cbdf];return _0x4cd25c;};'use strict';var _=require(_0x29a7('0x0'));var util=require(_0x29a7('0x1'));var moment=require('moment');var BPromise=require(_0x29a7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29a7('0x3'))['db'];var utils=require(_0x29a7('0x4'));var logger=require(_0x29a7('0x5'))(_0x29a7('0x6'));var config=require('../../config/environment');var jayson=require(_0x29a7('0x7'));var client=jayson[_0x29a7('0x8')][_0x29a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ab9c8,_0x24a0dc,_0x555f0e){return new BPromise(function(_0x51cc53,_0x1e10ab){return client[_0x29a7('0xa')](_0x1ab9c8,_0x555f0e)[_0x29a7('0xb')](function(_0x327076){logger[_0x29a7('0xc')](_0x29a7('0xd'),_0x24a0dc,_0x29a7('0xe'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x24a0dc,_0x29a7('0xe'),JSON[_0x29a7('0xf')](_0x327076));if(_0x327076[_0x29a7('0x10')]){if(_0x327076[_0x29a7('0x10')][_0x29a7('0x11')]===0x1f4){logger[_0x29a7('0x10')](_0x29a7('0xd'),_0x24a0dc,_0x327076['error'][_0x29a7('0x12')]);return _0x1e10ab(_0x327076[_0x29a7('0x10')][_0x29a7('0x12')]);}logger[_0x29a7('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x24a0dc,_0x327076['error'][_0x29a7('0x12')]);return _0x51cc53(_0x327076[_0x29a7('0x10')][_0x29a7('0x12')]);}else{logger[_0x29a7('0xc')](_0x29a7('0xd'),_0x24a0dc,'request\x20sent');_0x51cc53(_0x327076[_0x29a7('0x13')]['message']);}})[_0x29a7('0x14')](function(_0x228fe1){logger[_0x29a7('0x10')](_0x29a7('0xd'),_0x24a0dc,_0x228fe1);_0x1e10ab(_0x228fe1);});});}
\ No newline at end of file
+var _0x7596=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x232c5e,_0x877850){var _0x37bb4e=function(_0x1c51c4){while(--_0x1c51c4){_0x232c5e['push'](_0x232c5e['shift']());}};_0x37bb4e(++_0x877850);}(_0x7596,0xa2));var _0x6759=function(_0x2ea4c4,_0x1fe353){_0x2ea4c4=_0x2ea4c4-0x0;var _0x34fcb0=_0x7596[_0x2ea4c4];return _0x34fcb0;};'use strict';var _=require(_0x6759('0x0'));var util=require(_0x6759('0x1'));var moment=require(_0x6759('0x2'));var BPromise=require(_0x6759('0x3'));var rs=require(_0x6759('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6759('0x5'));var logger=require(_0x6759('0x6'))(_0x6759('0x7'));var config=require(_0x6759('0x8'));var jayson=require(_0x6759('0x9'));var client=jayson[_0x6759('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b51f4,_0x1f48d7,_0x5780ee){return new BPromise(function(_0x1d7e85,_0x4a789c){return client[_0x6759('0xb')](_0x4b51f4,_0x5780ee)[_0x6759('0xc')](function(_0x248531){logger[_0x6759('0xd')](_0x6759('0xe'),_0x1f48d7,'request\x20sent');logger[_0x6759('0xf')](_0x6759('0x10'),_0x1f48d7,_0x6759('0x11'),JSON[_0x6759('0x12')](_0x248531));if(_0x248531[_0x6759('0x13')]){if(_0x248531[_0x6759('0x13')][_0x6759('0x14')]===0x1f4){logger[_0x6759('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f48d7,_0x248531[_0x6759('0x13')][_0x6759('0x15')]);return _0x4a789c(_0x248531[_0x6759('0x13')][_0x6759('0x15')]);}logger[_0x6759('0x13')](_0x6759('0xe'),_0x1f48d7,_0x248531[_0x6759('0x13')][_0x6759('0x15')]);return _0x1d7e85(_0x248531[_0x6759('0x13')][_0x6759('0x15')]);}else{logger[_0x6759('0xd')](_0x6759('0xe'),_0x1f48d7,_0x6759('0x11'));_0x1d7e85(_0x248531['result'][_0x6759('0x15')]);}})[_0x6759('0x16')](function(_0xc5e7db){logger[_0x6759('0x13')](_0x6759('0xe'),_0x1f48d7,_0xc5e7db);_0x4a789c(_0xc5e7db);});});}
\ No newline at end of file
index 5050e5e..ac2e212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd3c=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller'];(function(_0x34b441,_0x59f0ae){var _0x3640fa=function(_0x428eb3){while(--_0x428eb3){_0x34b441['push'](_0x34b441['shift']());}};_0x3640fa(++_0x59f0ae);}(_0xdd3c,0x175));var _0xcdd3=function(_0x5f3efe,_0x5c08b7){_0x5f3efe=_0x5f3efe-0x0;var _0x2aa9f3=_0xdd3c[_0x5f3efe];return _0x2aa9f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcdd3('0x0'));var timeout=require('connect-timeout');var express=require(_0xcdd3('0x1'));var router=express[_0xcdd3('0x2')]();var auth=require(_0xcdd3('0x3'));var interaction=require(_0xcdd3('0x4'));var config=require(_0xcdd3('0x5'));var controller=require(_0xcdd3('0x6'));router['get']('/',auth[_0xcdd3('0x7')](),controller[_0xcdd3('0x8')]);router[_0xcdd3('0x9')](_0xcdd3('0xa'),auth[_0xcdd3('0x7')](),controller[_0xcdd3('0xb')]);router[_0xcdd3('0xc')]('/',auth[_0xcdd3('0x7')](),controller[_0xcdd3('0xd')]);router[_0xcdd3('0xe')](_0xcdd3('0xa'),auth['isAuthenticated'](),controller[_0xcdd3('0xf')]);router[_0xcdd3('0x10')]('/:id',auth[_0xcdd3('0x7')](),controller[_0xcdd3('0x11')]);module[_0xcdd3('0x12')]=router;
\ No newline at end of file
+var _0x8275=['create','update','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','/:id','isAuthenticated','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8275,0x17a));var _0x5827=function(_0x36426d,_0x4d62fe){_0x36426d=_0x36426d-0x0;var _0x40bd33=_0x8275[_0x36426d];return _0x40bd33;};'use strict';var multer=require(_0x5827('0x0'));var util=require(_0x5827('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5827('0x2'));var router=express[_0x5827('0x3')]();var auth=require(_0x5827('0x4'));var interaction=require(_0x5827('0x5'));var config=require(_0x5827('0x6'));var controller=require(_0x5827('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5827('0x8'),auth[_0x5827('0x9')](),controller[_0x5827('0xa')]);router[_0x5827('0xb')]('/',auth[_0x5827('0x9')](),controller[_0x5827('0xc')]);router['put'](_0x5827('0x8'),auth['isAuthenticated'](),controller[_0x5827('0xd')]);router['delete'](_0x5827('0x8'),auth[_0x5827('0x9')](),controller['destroy']);module[_0x5827('0xe')]=router;
\ No newline at end of file
index c4a842e..bce8079 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9758=['name','exports'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9758,0x1cf));var _0x8975=function(_0x524804,_0xaaae04){_0x524804=_0x524804-0x0;var _0x3fe0b6=_0x9758[_0x524804];return _0x3fe0b6;};'use strict';var Sequelize=require('sequelize');module[_0x8975('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x8975('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8b40=['name','sequelize'];(function(_0x28f73d,_0x1722b0){var _0xf39d83=function(_0x24d23c){while(--_0x24d23c){_0x28f73d['push'](_0x28f73d['shift']());}};_0xf39d83(++_0x1722b0);}(_0x8b40,0x1b1));var _0x08b4=function(_0x25c106,_0x5b97a5){_0x25c106=_0x25c106-0x0;var _0x4ff2ce=_0x8b40[_0x25c106];return _0x4ff2ce;};'use strict';var Sequelize=require(_0x08b4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x08b4('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d88c3f8..659f48e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe48b=['Pause','fieldName','type','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','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','params','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','then','get','Pauses','UserProfileResource','destroy','end','stack','name','send','index','map'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0xe48b,0x1bb));var _0xbe48=function(_0x2ea581,_0x230440){_0x2ea581=_0x2ea581-0x0;var _0x2f5ecf=_0xe48b[_0x2ea581];return _0x2f5ecf;};'use strict';var pdf=require(_0xbe48('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbe48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe48('0x2'));var rp=require(_0xbe48('0x3'));var moment=require('moment');var BPromise=require(_0xbe48('0x4'));var Mustache=require(_0xbe48('0x5'));var util=require(_0xbe48('0x6'));var path=require(_0xbe48('0x7'));var sox=require(_0xbe48('0x8'));var csv=require(_0xbe48('0x9'));var ejs=require(_0xbe48('0xa'));var fs=require('fs');var _=require(_0xbe48('0xb'));var squel=require(_0xbe48('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbe48('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbe48('0xe'));var Redis=require(_0xbe48('0xf'));var authService=require(_0xbe48('0x10'));var qs=require(_0xbe48('0x11'));var as=require(_0xbe48('0x12'));var hardwareService=require(_0xbe48('0x13'));var logger=require(_0xbe48('0x14'))(_0xbe48('0x15'));var utils=require('../../config/utils');var config=require(_0xbe48('0x16'));var db=require(_0xbe48('0x17'))['db'];function respondWithStatusCode(_0x1a44cf,_0x2ae38f){_0x2ae38f=_0x2ae38f||0xcc;return function(_0x31d94f){if(_0x31d94f){return _0x1a44cf[_0xbe48('0x18')](_0x2ae38f);}return _0x1a44cf[_0xbe48('0x19')](_0x2ae38f)['end']();};}function respondWithResult(_0x3b8c4a,_0x1fd2e2){_0x1fd2e2=_0x1fd2e2||0xc8;return function(_0x47a36e){if(_0x47a36e){return _0x3b8c4a['status'](_0x1fd2e2)[_0xbe48('0x1a')](_0x47a36e);}};}function respondWithFilteredResult(_0x49f450,_0x33a086){return function(_0xefdc15){if(_0xefdc15){var _0x431a6d=_0xefdc15[_0xbe48('0x1b')],_0x4584df=_0x33a086[_0xbe48('0x1c')],_0x232c9a=_0x33a086[_0xbe48('0x1c')]+_0x33a086[_0xbe48('0x1d')],_0x28fac5;if(_0x232c9a>=_0x431a6d){_0x232c9a=_0x431a6d;_0x28fac5=0xc8;}else{_0x28fac5=0xce;}_0x49f450['status'](_0x28fac5);return _0x49f450['set']('Content-Range',_0x4584df+'-'+_0x232c9a+'/'+_0x431a6d)[_0xbe48('0x1a')](_0xefdc15);}return null;};}function patchUpdates(_0x1e254e){return function(_0x4326c7){try{jsonpatch[_0xbe48('0x1e')](_0x4326c7,_0x1e254e,!![]);}catch(_0x11d622){return BPromise[_0xbe48('0x1f')](_0x11d622);}return _0x4326c7['save']();};}function saveUpdates(_0x18cbba,_0x3013a2){return function(_0x158660){if(_0x158660){return _0x158660['update'](_0x18cbba)[_0xbe48('0x20')](function(_0x49e002){return _0x49e002;});}return null;};}function removeEntity(_0xe828,_0x1db77b){return function(_0x21f119){if(_0x21f119){return _0x21f119['destroy']()[_0xbe48('0x20')](function(){var _0x27b819=_0x21f119[_0xbe48('0x21')]({'plain':!![]});var _0x51c17c=_0xbe48('0x22');return db[_0xbe48('0x23')][_0xbe48('0x24')]({'where':{'type':_0x51c17c,'resourceId':_0x27b819['id']}})[_0xbe48('0x20')](function(){return _0x21f119;});})['then'](function(){_0xe828[_0xbe48('0x19')](0xcc)[_0xbe48('0x25')]();});}};}function handleEntityNotFound(_0x164aa6,_0x5932d7){return function(_0xd5be4b){if(!_0xd5be4b){_0x164aa6[_0xbe48('0x18')](0x194);}return _0xd5be4b;};}function handleError(_0x648c,_0x562bb7){_0x562bb7=_0x562bb7||0x1f4;return function(_0x5cd96b){logger['error'](_0x5cd96b[_0xbe48('0x26')]);if(_0x5cd96b[_0xbe48('0x27')]){delete _0x5cd96b[_0xbe48('0x27')];}_0x648c['status'](_0x562bb7)[_0xbe48('0x28')](_0x5cd96b);};}exports[_0xbe48('0x29')]=function(_0x5dfd0d,_0x1db900){var _0x49519c={},_0x385b5d={},_0x4890ff={'count':0x0,'rows':[]};var _0x396ea3=_[_0xbe48('0x2a')](db[_0xbe48('0x2b')]['rawAttributes'],function(_0x3c5b7f){return{'name':_0x3c5b7f[_0xbe48('0x2c')],'type':_0x3c5b7f[_0xbe48('0x2d')]['key']};});_0x385b5d[_0xbe48('0x2e')]=_[_0xbe48('0x2a')](_0x396ea3,_0xbe48('0x27'));_0x385b5d['query']=_['keys'](_0x5dfd0d['query']);_0x385b5d['filters']=_[_0xbe48('0x2f')](_0x385b5d[_0xbe48('0x2e')],_0x385b5d[_0xbe48('0x30')]);_0x49519c[_0xbe48('0x31')]=_[_0xbe48('0x2f')](_0x385b5d[_0xbe48('0x2e')],qs['fields'](_0x5dfd0d['query'][_0xbe48('0x32')]));_0x49519c[_0xbe48('0x31')]=_0x49519c[_0xbe48('0x31')][_0xbe48('0x33')]?_0x49519c[_0xbe48('0x31')]:_0x385b5d[_0xbe48('0x2e')];if(!_0x5dfd0d['query'][_0xbe48('0x34')](_0xbe48('0x35'))){_0x49519c[_0xbe48('0x1d')]=qs[_0xbe48('0x1d')](_0x5dfd0d[_0xbe48('0x30')][_0xbe48('0x1d')]);_0x49519c[_0xbe48('0x1c')]=qs[_0xbe48('0x1c')](_0x5dfd0d[_0xbe48('0x30')][_0xbe48('0x1c')]);}_0x49519c[_0xbe48('0x36')]=qs[_0xbe48('0x37')](_0x5dfd0d[_0xbe48('0x30')]['sort']);_0x49519c[_0xbe48('0x38')]=qs['filters'](_[_0xbe48('0x39')](_0x5dfd0d[_0xbe48('0x30')],_0x385b5d[_0xbe48('0x3a')]),_0x396ea3);if(_0x5dfd0d[_0xbe48('0x30')][_0xbe48('0x3b')]){_0x49519c['where']=_[_0xbe48('0x3c')](_0x49519c[_0xbe48('0x38')],{'$or':_[_0xbe48('0x2a')](_0x396ea3,function(_0x380602){if(_0x380602[_0xbe48('0x2d')]!==_0xbe48('0x3d')){var _0x54f5a7={};_0x54f5a7[_0x380602[_0xbe48('0x27')]]={'$like':'%'+_0x5dfd0d[_0xbe48('0x30')][_0xbe48('0x3b')]+'%'};return _0x54f5a7;}})});}_0x49519c=_[_0xbe48('0x3c')]({},_0x49519c,_0x5dfd0d[_0xbe48('0x3e')]);var _0x37bcc6={'where':_0x49519c[_0xbe48('0x38')]};return db['Pause'][_0xbe48('0x1b')](_0x37bcc6)[_0xbe48('0x20')](function(_0x55586a){_0x4890ff[_0xbe48('0x1b')]=_0x55586a;if(_0x5dfd0d['query'][_0xbe48('0x3f')]){_0x49519c[_0xbe48('0x40')]=[{'all':!![]}];}return db[_0xbe48('0x2b')][_0xbe48('0x41')](_0x49519c);})[_0xbe48('0x20')](function(_0x38b6f0){_0x4890ff['rows']=_0x38b6f0;return _0x4890ff;})[_0xbe48('0x20')](respondWithFilteredResult(_0x1db900,_0x49519c))[_0xbe48('0x42')](handleError(_0x1db900,null));};exports[_0xbe48('0x43')]=function(_0x193850,_0x4ccb50){var _0x594d08={'raw':!![],'where':{'id':_0x193850['params']['id']}},_0x1b81c3={};_0x1b81c3[_0xbe48('0x2e')]=_['keys'](db[_0xbe48('0x2b')]['rawAttributes']);_0x1b81c3[_0xbe48('0x30')]=_[_0xbe48('0x44')](_0x193850[_0xbe48('0x30')]);_0x1b81c3['filters']=_[_0xbe48('0x2f')](_0x1b81c3[_0xbe48('0x2e')],_0x1b81c3['query']);_0x594d08[_0xbe48('0x31')]=_['intersection'](_0x1b81c3['model'],qs[_0xbe48('0x32')](_0x193850[_0xbe48('0x30')][_0xbe48('0x32')]));_0x594d08[_0xbe48('0x31')]=_0x594d08[_0xbe48('0x31')][_0xbe48('0x33')]?_0x594d08[_0xbe48('0x31')]:_0x1b81c3[_0xbe48('0x2e')];if(_0x193850[_0xbe48('0x30')][_0xbe48('0x3f')]){_0x594d08[_0xbe48('0x40')]=[{'all':!![]}];}_0x594d08=_['merge']({},_0x594d08,_0x193850[_0xbe48('0x3e')]);return db['Pause'][_0xbe48('0x45')](_0x594d08)[_0xbe48('0x20')](handleEntityNotFound(_0x4ccb50,null))['then'](respondWithResult(_0x4ccb50,null))[_0xbe48('0x42')](handleError(_0x4ccb50,null));};exports[_0xbe48('0x46')]=function(_0x7fa52e,_0x254d7d){return db[_0xbe48('0x2b')][_0xbe48('0x46')](_0x7fa52e[_0xbe48('0x47')],{})['then'](function(_0xf74be8){var _0x367431=_0x7fa52e[_0xbe48('0x48')][_0xbe48('0x21')]({'plain':!![]});if(!_0x367431)throw new Error(_0xbe48('0x49'));if(_0x367431[_0xbe48('0x4a')]==='user'){var _0x5f4231=_0xf74be8[_0xbe48('0x21')]({'plain':!![]});var _0x4956e8=_0xbe48('0x22');return db[_0xbe48('0x4b')]['find']({'where':{'name':_0x4956e8,'userProfileId':_0x367431[_0xbe48('0x4c')]},'raw':!![]})[_0xbe48('0x20')](function(_0x828d08){if(_0x828d08&&_0x828d08[_0xbe48('0x4d')]===0x0){return db[_0xbe48('0x23')][_0xbe48('0x46')]({'name':_0x5f4231['name'],'resourceId':_0x5f4231['id'],'type':_0x828d08[_0xbe48('0x27')],'sectionId':_0x828d08['id']},{})[_0xbe48('0x20')](function(){return _0xf74be8;});}else{return _0xf74be8;}})['catch'](function(_0x2969c0){logger['error'](_0xbe48('0x4e'),_0x2969c0);throw _0x2969c0;});}return _0xf74be8;})['then'](respondWithResult(_0x254d7d,0xc9))[_0xbe48('0x42')](handleError(_0x254d7d,null));};exports[_0xbe48('0x4f')]=function(_0x422801,_0x1a448c){if(_0x422801['body']['id']){delete _0x422801[_0xbe48('0x47')]['id'];}return db[_0xbe48('0x2b')][_0xbe48('0x45')]({'where':{'id':_0x422801[_0xbe48('0x50')]['id']}})[_0xbe48('0x20')](handleEntityNotFound(_0x1a448c,null))[_0xbe48('0x20')](saveUpdates(_0x422801[_0xbe48('0x47')],null))['then'](respondWithResult(_0x1a448c,null))[_0xbe48('0x42')](handleError(_0x1a448c,null));};exports['destroy']=function(_0x6e002,_0x36bd8c){return db[_0xbe48('0x2b')][_0xbe48('0x45')]({'where':{'id':_0x6e002[_0xbe48('0x50')]['id']}})['then'](handleEntityNotFound(_0x36bd8c,null))[_0xbe48('0x20')](removeEntity(_0x36bd8c,null))['catch'](handleError(_0x36bd8c,null));};
\ No newline at end of file
+var _0x028a=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','get','Pauses','error','name','send','map','Pause','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','keys','include','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0x3379af,_0x416f71){var _0x30134e=function(_0x1e017a){while(--_0x1e017a){_0x3379af['push'](_0x3379af['shift']());}};_0x30134e(++_0x416f71);}(_0x028a,0x130));var _0xa028=function(_0x5af85f,_0x1613c0){_0x5af85f=_0x5af85f-0x0;var _0x105018=_0x028a[_0x5af85f];return _0x105018;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa028('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa028('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa028('0x2'));var BPromise=require(_0xa028('0x3'));var Mustache=require(_0xa028('0x4'));var util=require(_0xa028('0x5'));var path=require(_0xa028('0x6'));var sox=require(_0xa028('0x7'));var csv=require(_0xa028('0x8'));var ejs=require(_0xa028('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa028('0xa'));var crypto=require(_0xa028('0xb'));var jsforce=require(_0xa028('0xc'));var deskjs=require(_0xa028('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa028('0xe'));var Papa=require(_0xa028('0xf'));var Redis=require(_0xa028('0x10'));var authService=require(_0xa028('0x11'));var qs=require(_0xa028('0x12'));var as=require(_0xa028('0x13'));var hardwareService=require(_0xa028('0x14'));var logger=require(_0xa028('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa028('0x16'));var db=require(_0xa028('0x17'))['db'];function respondWithStatusCode(_0x3fcbd0,_0xa4885d){_0xa4885d=_0xa4885d||0xcc;return function(_0x256751){if(_0x256751){return _0x3fcbd0[_0xa028('0x18')](_0xa4885d);}return _0x3fcbd0[_0xa028('0x19')](_0xa4885d)[_0xa028('0x1a')]();};}function respondWithResult(_0x1f332a,_0xebefd3){_0xebefd3=_0xebefd3||0xc8;return function(_0x4b1544){if(_0x4b1544){return _0x1f332a[_0xa028('0x19')](_0xebefd3)[_0xa028('0x1b')](_0x4b1544);}};}function respondWithFilteredResult(_0x3fc0f6,_0x23b107){return function(_0x127442){if(_0x127442){var _0x2cf2aa=_0x127442[_0xa028('0x1c')],_0x2a03ba=_0x23b107[_0xa028('0x1d')],_0xca7e52=_0x23b107[_0xa028('0x1d')]+_0x23b107[_0xa028('0x1e')],_0x5c9aa;if(_0xca7e52>=_0x2cf2aa){_0xca7e52=_0x2cf2aa;_0x5c9aa=0xc8;}else{_0x5c9aa=0xce;}_0x3fc0f6[_0xa028('0x19')](_0x5c9aa);return _0x3fc0f6['set'](_0xa028('0x1f'),_0x2a03ba+'-'+_0xca7e52+'/'+_0x2cf2aa)[_0xa028('0x1b')](_0x127442);}return null;};}function patchUpdates(_0x16caf1){return function(_0x4116f3){try{jsonpatch[_0xa028('0x20')](_0x4116f3,_0x16caf1,!![]);}catch(_0xbba65){return BPromise['reject'](_0xbba65);}return _0x4116f3['save']();};}function saveUpdates(_0x698f42,_0x1cdfca){return function(_0x4c04e4){if(_0x4c04e4){return _0x4c04e4[_0xa028('0x21')](_0x698f42)[_0xa028('0x22')](function(_0xd17524){return _0xd17524;});}return null;};}function removeEntity(_0x25a311,_0xd892df){return function(_0x1e5c80){if(_0x1e5c80){return _0x1e5c80['destroy']()['then'](function(){var _0x5b3495=_0x1e5c80[_0xa028('0x23')]({'plain':!![]});var _0x4d96ec=_0xa028('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x4d96ec,'resourceId':_0x5b3495['id']}})[_0xa028('0x22')](function(){return _0x1e5c80;});})[_0xa028('0x22')](function(){_0x25a311['status'](0xcc)[_0xa028('0x1a')]();});}};}function handleEntityNotFound(_0xb1eaf4,_0x5ee91a){return function(_0x51b558){if(!_0x51b558){_0xb1eaf4['sendStatus'](0x194);}return _0x51b558;};}function handleError(_0x4e4c21,_0x1b87a1){_0x1b87a1=_0x1b87a1||0x1f4;return function(_0x18f5b1){logger[_0xa028('0x25')](_0x18f5b1['stack']);if(_0x18f5b1[_0xa028('0x26')]){delete _0x18f5b1['name'];}_0x4e4c21[_0xa028('0x19')](_0x1b87a1)[_0xa028('0x27')](_0x18f5b1);};}exports['index']=function(_0x3594e8,_0x534e5d){var _0xe6db91={},_0x31e2a0={},_0x390136={'count':0x0,'rows':[]};var _0x13951b=_[_0xa028('0x28')](db[_0xa028('0x29')][_0xa028('0x2a')],function(_0x5d6445){return{'name':_0x5d6445[_0xa028('0x2b')],'type':_0x5d6445[_0xa028('0x2c')]['key']};});_0x31e2a0[_0xa028('0x2d')]=_[_0xa028('0x28')](_0x13951b,_0xa028('0x26'));_0x31e2a0[_0xa028('0x2e')]=_['keys'](_0x3594e8[_0xa028('0x2e')]);_0x31e2a0[_0xa028('0x2f')]=_[_0xa028('0x30')](_0x31e2a0[_0xa028('0x2d')],_0x31e2a0[_0xa028('0x2e')]);_0xe6db91[_0xa028('0x31')]=_[_0xa028('0x30')](_0x31e2a0[_0xa028('0x2d')],qs[_0xa028('0x32')](_0x3594e8[_0xa028('0x2e')][_0xa028('0x32')]));_0xe6db91[_0xa028('0x31')]=_0xe6db91['attributes'][_0xa028('0x33')]?_0xe6db91[_0xa028('0x31')]:_0x31e2a0[_0xa028('0x2d')];if(!_0x3594e8[_0xa028('0x2e')][_0xa028('0x34')](_0xa028('0x35'))){_0xe6db91['limit']=qs[_0xa028('0x1e')](_0x3594e8[_0xa028('0x2e')][_0xa028('0x1e')]);_0xe6db91[_0xa028('0x1d')]=qs[_0xa028('0x1d')](_0x3594e8['query'][_0xa028('0x1d')]);}_0xe6db91['order']=qs[_0xa028('0x36')](_0x3594e8['query'][_0xa028('0x36')]);_0xe6db91[_0xa028('0x37')]=qs[_0xa028('0x2f')](_[_0xa028('0x38')](_0x3594e8[_0xa028('0x2e')],_0x31e2a0[_0xa028('0x2f')]),_0x13951b);if(_0x3594e8[_0xa028('0x2e')][_0xa028('0x39')]){_0xe6db91['where']=_['merge'](_0xe6db91[_0xa028('0x37')],{'$or':_[_0xa028('0x28')](_0x13951b,function(_0x6b3e90){if(_0x6b3e90[_0xa028('0x2c')]!==_0xa028('0x3a')){var _0x387414={};_0x387414[_0x6b3e90['name']]={'$like':'%'+_0x3594e8[_0xa028('0x2e')]['filter']+'%'};return _0x387414;}})});}_0xe6db91=_[_0xa028('0x3b')]({},_0xe6db91,_0x3594e8['options']);var _0x5a1138={'where':_0xe6db91[_0xa028('0x37')]};return db[_0xa028('0x29')][_0xa028('0x1c')](_0x5a1138)[_0xa028('0x22')](function(_0x101ec1){_0x390136['count']=_0x101ec1;if(_0x3594e8[_0xa028('0x2e')][_0xa028('0x3c')]){_0xe6db91['include']=[{'all':!![]}];}return db[_0xa028('0x29')][_0xa028('0x3d')](_0xe6db91);})[_0xa028('0x22')](function(_0x3da83f){_0x390136[_0xa028('0x3e')]=_0x3da83f;return _0x390136;})[_0xa028('0x22')](respondWithFilteredResult(_0x534e5d,_0xe6db91))['catch'](handleError(_0x534e5d,null));};exports[_0xa028('0x3f')]=function(_0x357f92,_0x5ba14d){var _0x27a0c0={'raw':!![],'where':{'id':_0x357f92[_0xa028('0x40')]['id']}},_0x467464={};_0x467464[_0xa028('0x2d')]=_[_0xa028('0x41')](db['Pause'][_0xa028('0x2a')]);_0x467464['query']=_[_0xa028('0x41')](_0x357f92['query']);_0x467464[_0xa028('0x2f')]=_[_0xa028('0x30')](_0x467464[_0xa028('0x2d')],_0x467464[_0xa028('0x2e')]);_0x27a0c0[_0xa028('0x31')]=_[_0xa028('0x30')](_0x467464[_0xa028('0x2d')],qs[_0xa028('0x32')](_0x357f92[_0xa028('0x2e')]['fields']));_0x27a0c0['attributes']=_0x27a0c0[_0xa028('0x31')]['length']?_0x27a0c0[_0xa028('0x31')]:_0x467464['model'];if(_0x357f92[_0xa028('0x2e')][_0xa028('0x3c')]){_0x27a0c0[_0xa028('0x42')]=[{'all':!![]}];}_0x27a0c0=_[_0xa028('0x3b')]({},_0x27a0c0,_0x357f92[_0xa028('0x43')]);return db['Pause'][_0xa028('0x44')](_0x27a0c0)[_0xa028('0x22')](handleEntityNotFound(_0x5ba14d,null))[_0xa028('0x22')](respondWithResult(_0x5ba14d,null))[_0xa028('0x45')](handleError(_0x5ba14d,null));};exports['create']=function(_0x27241a,_0x334af2){return db[_0xa028('0x29')][_0xa028('0x46')](_0x27241a['body'],{})[_0xa028('0x22')](function(_0x3d7134){var _0x21bd17=_0x27241a['user'][_0xa028('0x23')]({'plain':!![]});if(!_0x21bd17)throw new Error(_0xa028('0x47'));if(_0x21bd17[_0xa028('0x48')]==='user'){var _0x1b276a=_0x3d7134['get']({'plain':!![]});var _0x2ce0c8='Pauses';return db[_0xa028('0x49')][_0xa028('0x44')]({'where':{'name':_0x2ce0c8,'userProfileId':_0x21bd17['userProfileId']},'raw':!![]})[_0xa028('0x22')](function(_0x2457d7){if(_0x2457d7&&_0x2457d7[_0xa028('0x4a')]===0x0){return db[_0xa028('0x4b')][_0xa028('0x46')]({'name':_0x1b276a[_0xa028('0x26')],'resourceId':_0x1b276a['id'],'type':_0x2457d7[_0xa028('0x26')],'sectionId':_0x2457d7['id']},{})[_0xa028('0x22')](function(){return _0x3d7134;});}else{return _0x3d7134;}})[_0xa028('0x45')](function(_0x32e470){logger['error'](_0xa028('0x4c'),_0x32e470);throw _0x32e470;});}return _0x3d7134;})['then'](respondWithResult(_0x334af2,0xc9))[_0xa028('0x45')](handleError(_0x334af2,null));};exports[_0xa028('0x21')]=function(_0x3fb514,_0xa54667){if(_0x3fb514[_0xa028('0x4d')]['id']){delete _0x3fb514['body']['id'];}return db[_0xa028('0x29')][_0xa028('0x44')]({'where':{'id':_0x3fb514[_0xa028('0x40')]['id']}})[_0xa028('0x22')](handleEntityNotFound(_0xa54667,null))[_0xa028('0x22')](saveUpdates(_0x3fb514['body'],null))[_0xa028('0x22')](respondWithResult(_0xa54667,null))['catch'](handleError(_0xa54667,null));};exports[_0xa028('0x4e')]=function(_0x73abe7,_0x46b168){return db['Pause'][_0xa028('0x44')]({'where':{'id':_0x73abe7['params']['id']}})[_0xa028('0x22')](handleEntityNotFound(_0x46b168,null))[_0xa028('0x22')](removeEntity(_0x46b168,null))['catch'](handleError(_0x46b168,null));};
\ No newline at end of file
index 4efb411..7a19e93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf277=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_pauses','lodash','util','api'];(function(_0xf0627f,_0xc1cfa2){var _0xd4c371=function(_0x2a3b1d){while(--_0x2a3b1d){_0xf0627f['push'](_0xf0627f['shift']());}};_0xd4c371(++_0xc1cfa2);}(_0xf277,0x1e1));var _0x7f27=function(_0x1a091c,_0x3ee736){_0x1a091c=_0x1a091c-0x0;var _0x26f97f=_0xf277[_0x1a091c];return _0x26f97f;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var logger=require('../../config/logger')(_0x7f27('0x2'));var moment=require('moment');var BPromise=require(_0x7f27('0x3'));var rp=require(_0x7f27('0x4'));var fs=require('fs');var path=require(_0x7f27('0x5'));var rimraf=require(_0x7f27('0x6'));var config=require(_0x7f27('0x7'));var attributes=require('./pause.attributes');module[_0x7f27('0x8')]=function(_0x57b338,_0x40bcdf){return _0x57b338[_0x7f27('0x9')]('Pause',attributes,{'tableName':_0x7f27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x793b=['api','moment','request-promise','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger'];(function(_0x2af117,_0x3ebd51){var _0x1215ae=function(_0x4cead6){while(--_0x4cead6){_0x2af117['push'](_0x2af117['shift']());}};_0x1215ae(++_0x3ebd51);}(_0x793b,0x189));var _0xb793=function(_0x211cdd,_0x4810b4){_0x211cdd=_0x211cdd-0x0;var _0x889708=_0x793b[_0x211cdd];return _0x889708;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var logger=require(_0xb793('0x2'))(_0xb793('0x3'));var moment=require(_0xb793('0x4'));var BPromise=require('bluebird');var rp=require(_0xb793('0x5'));var fs=require('fs');var path=require(_0xb793('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb793('0x7'));module[_0xb793('0x8')]=function(_0x322b07,_0x2b1f19){return _0x322b07[_0xb793('0x9')](_0xb793('0xa'),attributes,{'tableName':_0xb793('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 855075c..42b9464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f8=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','Pause','find','options','raw','attributes','map','include','model','debug','ShowPause','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x14a55a,_0x17b22a){var _0x42d5e7=function(_0x1b73f9){while(--_0x1b73f9){_0x14a55a['push'](_0x14a55a['shift']());}};_0x42d5e7(++_0x17b22a);}(_0xd4f8,0xae));var _0x8d4f=function(_0x2e4e87,_0x341c6f){_0x2e4e87=_0x2e4e87-0x0;var _0x3f63e6=_0xd4f8[_0x2e4e87];return _0x3f63e6;};'use strict';var _=require(_0x8d4f('0x0'));var util=require(_0x8d4f('0x1'));var moment=require('moment');var BPromise=require(_0x8d4f('0x2'));var rs=require(_0x8d4f('0x3'));var fs=require('fs');var Redis=require(_0x8d4f('0x4'));var db=require(_0x8d4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d4f('0x6'))('rpc');var config=require(_0x8d4f('0x7'));var jayson=require(_0x8d4f('0x8'));var client=jayson[_0x8d4f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2adc56,_0x2f81dc,_0x590e61){return new BPromise(function(_0x2ed4c0,_0xc84d4e){return client[_0x8d4f('0xa')](_0x2adc56,_0x590e61)[_0x8d4f('0xb')](function(_0x44c119){logger[_0x8d4f('0xc')](_0x8d4f('0xd'),_0x2f81dc,_0x8d4f('0xe'));logger['debug']('Pause,\x20%s,\x20%s,\x20%s',_0x2f81dc,_0x8d4f('0xe'),JSON[_0x8d4f('0xf')](_0x44c119));if(_0x44c119[_0x8d4f('0x10')]){if(_0x44c119[_0x8d4f('0x10')][_0x8d4f('0x11')]===0x1f4){logger['error'](_0x8d4f('0xd'),_0x2f81dc,_0x44c119[_0x8d4f('0x10')][_0x8d4f('0x12')]);return _0xc84d4e(_0x44c119[_0x8d4f('0x10')][_0x8d4f('0x12')]);}logger[_0x8d4f('0x10')]('Pause,\x20%s,\x20%s',_0x2f81dc,_0x44c119[_0x8d4f('0x10')][_0x8d4f('0x12')]);return _0x2ed4c0(_0x44c119['error'][_0x8d4f('0x12')]);}else{logger[_0x8d4f('0xc')](_0x8d4f('0xd'),_0x2f81dc,_0x8d4f('0xe'));_0x2ed4c0(_0x44c119['result'][_0x8d4f('0x12')]);}})[_0x8d4f('0x13')](function(_0x1cd78a){logger['error'](_0x8d4f('0xd'),_0x2f81dc,_0x1cd78a);_0xc84d4e(_0x1cd78a);});});}exports['ShowPause']=function(_0x483cf2){var _0xeb6472=this;return new Promise(function(_0x58393f,_0x172722){return db[_0x8d4f('0x14')][_0x8d4f('0x15')]({'raw':_0x483cf2[_0x8d4f('0x16')]?_0x483cf2['options'][_0x8d4f('0x17')]===undefined?!![]:![]:!![],'where':_0x483cf2[_0x8d4f('0x16')]?_0x483cf2[_0x8d4f('0x16')]['where']||null:null,'attributes':_0x483cf2[_0x8d4f('0x16')]?_0x483cf2['options'][_0x8d4f('0x18')]||null:null,'include':_0x483cf2[_0x8d4f('0x16')]?_0x483cf2[_0x8d4f('0x16')]['include']?_[_0x8d4f('0x19')](_0x483cf2[_0x8d4f('0x16')][_0x8d4f('0x1a')],function(_0x3f6baa){return{'model':db[_0x3f6baa['model']],'as':_0x3f6baa['as'],'attributes':_0x3f6baa['attributes'],'include':_0x3f6baa[_0x8d4f('0x1a')]?_[_0x8d4f('0x19')](_0x3f6baa[_0x8d4f('0x1a')],function(_0x4f494d){return{'model':db[_0x4f494d[_0x8d4f('0x1b')]],'as':_0x4f494d['as'],'attributes':_0x4f494d[_0x8d4f('0x18')],'include':_0x4f494d[_0x8d4f('0x1a')]?_[_0x8d4f('0x19')](_0x4f494d[_0x8d4f('0x1a')],function(_0x3c0c55){return{'model':db[_0x3c0c55[_0x8d4f('0x1b')]],'as':_0x3c0c55['as'],'attributes':_0x3c0c55[_0x8d4f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1613c4){logger[_0x8d4f('0xc')]('ShowPause',_0x483cf2);logger[_0x8d4f('0x1c')](_0x8d4f('0x1d'),_0x483cf2,JSON['stringify'](_0x1613c4));_0x58393f(_0x1613c4);})[_0x8d4f('0x13')](function(_0x13aa1c){logger[_0x8d4f('0x10')]('ShowPause',_0x13aa1c['message'],_0x483cf2);_0x172722(_0xeb6472[_0x8d4f('0x10')](0x1f4,_0x13aa1c['message']));});});};
\ No newline at end of file
+var _0xe0d7=['error','code','Pause,\x20%s,\x20%s','message','catch','ShowPause','Pause','find','options','where','attributes','include','model','map','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s'];(function(_0x318751,_0x5e4490){var _0x3ab48d=function(_0xe22e8c){while(--_0xe22e8c){_0x318751['push'](_0x318751['shift']());}};_0x3ab48d(++_0x5e4490);}(_0xe0d7,0x1e0));var _0x7e0d=function(_0x92d72e,_0x6e0a25){_0x92d72e=_0x92d72e-0x0;var _0x5760c1=_0xe0d7[_0x92d72e];return _0x5760c1;};'use strict';var _=require('lodash');var util=require(_0x7e0d('0x0'));var moment=require('moment');var BPromise=require(_0x7e0d('0x1'));var rs=require(_0x7e0d('0x2'));var fs=require('fs');var Redis=require(_0x7e0d('0x3'));var db=require(_0x7e0d('0x4'))['db'];var utils=require(_0x7e0d('0x5'));var logger=require(_0x7e0d('0x6'))(_0x7e0d('0x7'));var config=require(_0x7e0d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x71294c,_0x42cfd7,_0x3bf7e2){return new BPromise(function(_0x1839fd,_0x1b8a71){return client[_0x7e0d('0xa')](_0x71294c,_0x3bf7e2)[_0x7e0d('0xb')](function(_0x34e8e9){logger[_0x7e0d('0xc')]('Pause,\x20%s,\x20%s',_0x42cfd7,_0x7e0d('0xd'));logger[_0x7e0d('0xe')](_0x7e0d('0xf'),_0x42cfd7,'request\x20sent',JSON['stringify'](_0x34e8e9));if(_0x34e8e9['error']){if(_0x34e8e9[_0x7e0d('0x10')][_0x7e0d('0x11')]===0x1f4){logger[_0x7e0d('0x10')](_0x7e0d('0x12'),_0x42cfd7,_0x34e8e9[_0x7e0d('0x10')]['message']);return _0x1b8a71(_0x34e8e9['error'][_0x7e0d('0x13')]);}logger['error'](_0x7e0d('0x12'),_0x42cfd7,_0x34e8e9['error'][_0x7e0d('0x13')]);return _0x1839fd(_0x34e8e9[_0x7e0d('0x10')][_0x7e0d('0x13')]);}else{logger[_0x7e0d('0xc')](_0x7e0d('0x12'),_0x42cfd7,_0x7e0d('0xd'));_0x1839fd(_0x34e8e9['result'][_0x7e0d('0x13')]);}})[_0x7e0d('0x14')](function(_0x1b6161){logger[_0x7e0d('0x10')](_0x7e0d('0x12'),_0x42cfd7,_0x1b6161);_0x1b8a71(_0x1b6161);});});}exports[_0x7e0d('0x15')]=function(_0x366a22){var _0x589954=this;return new Promise(function(_0x584561,_0x178924){return db[_0x7e0d('0x16')][_0x7e0d('0x17')]({'raw':_0x366a22[_0x7e0d('0x18')]?_0x366a22['options']['raw']===undefined?!![]:![]:!![],'where':_0x366a22[_0x7e0d('0x18')]?_0x366a22[_0x7e0d('0x18')][_0x7e0d('0x19')]||null:null,'attributes':_0x366a22[_0x7e0d('0x18')]?_0x366a22[_0x7e0d('0x18')][_0x7e0d('0x1a')]||null:null,'include':_0x366a22['options']?_0x366a22[_0x7e0d('0x18')][_0x7e0d('0x1b')]?_['map'](_0x366a22[_0x7e0d('0x18')][_0x7e0d('0x1b')],function(_0x3b9307){return{'model':db[_0x3b9307[_0x7e0d('0x1c')]],'as':_0x3b9307['as'],'attributes':_0x3b9307[_0x7e0d('0x1a')],'include':_0x3b9307[_0x7e0d('0x1b')]?_[_0x7e0d('0x1d')](_0x3b9307[_0x7e0d('0x1b')],function(_0x472b4f){return{'model':db[_0x472b4f[_0x7e0d('0x1c')]],'as':_0x472b4f['as'],'attributes':_0x472b4f[_0x7e0d('0x1a')],'include':_0x472b4f[_0x7e0d('0x1b')]?_[_0x7e0d('0x1d')](_0x472b4f[_0x7e0d('0x1b')],function(_0x2d6798){return{'model':db[_0x2d6798[_0x7e0d('0x1c')]],'as':_0x2d6798['as'],'attributes':_0x2d6798[_0x7e0d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7e0d('0xb')](function(_0x4c0eda){logger[_0x7e0d('0xc')](_0x7e0d('0x15'),_0x366a22);logger[_0x7e0d('0xe')](_0x7e0d('0x15'),_0x366a22,JSON[_0x7e0d('0x1e')](_0x4c0eda));_0x584561(_0x4c0eda);})[_0x7e0d('0x14')](function(_0x3108c3){logger['error'](_0x7e0d('0x15'),_0x3108c3[_0x7e0d('0x13')],_0x366a22);_0x178924(_0x589954[_0x7e0d('0x10')](0x1f4,_0x3108c3[_0x7e0d('0x13')]));});});};
\ No newline at end of file
index 3ee25d6..eac969c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb579=['/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','basename','extname','post','single','upload','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb579,0xb7));var _0x9b57=function(_0x28693a,_0x1aed05){_0x28693a=_0x28693a-0x0;var _0x3b1831=_0xb579[_0x28693a];return _0x3b1831;};'use strict';var multer=require(_0x9b57('0x0'));var util=require(_0x9b57('0x1'));var path=require(_0x9b57('0x2'));var timeout=require(_0x9b57('0x3'));var express=require(_0x9b57('0x4'));var router=express[_0x9b57('0x5')]();var auth=require(_0x9b57('0x6'));var interaction=require(_0x9b57('0x7'));var config=require('../../config/environment');var controller=require(_0x9b57('0x8'));router[_0x9b57('0x9')]('/',auth[_0x9b57('0xa')](),controller[_0x9b57('0xb')]);router['get'](_0x9b57('0xc'),controller['webhookGet']);router[_0x9b57('0x9')](_0x9b57('0xd'),auth[_0x9b57('0xa')](),controller[_0x9b57('0xe')]);router['get'](_0x9b57('0xf'),auth[_0x9b57('0xa')](),controller[_0x9b57('0x10')]);var upload=multer({'storage':multer[_0x9b57('0x11')]({'destination':function(_0x58c3c6,_0x400e9d,_0x5ddb42){_0x5ddb42(null,path[_0x9b57('0x12')](config[_0x9b57('0x13')],_0x9b57('0x14')));},'filename':function(_0x36a0fa,_0x314f8f,_0x2165c5){_0x314f8f[_0x9b57('0x15')]=_0x314f8f[_0x9b57('0x15')][_0x9b57('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2165c5(null,util['format']('%s-%s%s',path[_0x9b57('0x17')](_0x314f8f['originalname'],path[_0x9b57('0x18')](_0x314f8f[_0x9b57('0x15')])),Date['now'](),path['extname'](_0x314f8f[_0x9b57('0x15')])));}})});router[_0x9b57('0x19')]('/',upload[_0x9b57('0x1a')]('file'),controller[_0x9b57('0x1b')]);router[_0x9b57('0x19')](_0x9b57('0xc'),controller[_0x9b57('0x1c')]);router[_0x9b57('0x1d')](_0x9b57('0xd'),auth[_0x9b57('0xa')](),controller[_0x9b57('0x1e')]);router[_0x9b57('0x1f')]('/:id',auth[_0x9b57('0xa')](),controller[_0x9b57('0x1f')]);module[_0x9b57('0x20')]=router;
\ No newline at end of file
+var _0xdb51=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./plugin.controller','index','get','/webhook','webhookGet','/:id/download','download','diskStorage','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','put','/:id','isAuthenticated','update','delete'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xdb51,0x101));var _0x1db5=function(_0x147d98,_0x3de53a){_0x147d98=_0x147d98-0x0;var _0x5006c2=_0xdb51[_0x147d98];return _0x5006c2;};'use strict';var multer=require('multer');var util=require(_0x1db5('0x0'));var path=require('path');var timeout=require(_0x1db5('0x1'));var express=require(_0x1db5('0x2'));var router=express[_0x1db5('0x3')]();var auth=require(_0x1db5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1db5('0x5'));var controller=require(_0x1db5('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1db5('0x7')]);router[_0x1db5('0x8')](_0x1db5('0x9'),controller[_0x1db5('0xa')]);router[_0x1db5('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1db5('0x8')](_0x1db5('0xb'),auth['isAuthenticated'](),controller[_0x1db5('0xc')]);var upload=multer({'storage':multer[_0x1db5('0xd')]({'destination':function(_0x1eb119,_0x39281a,_0x3b16c0){_0x3b16c0(null,path['join'](config[_0x1db5('0xe')],_0x1db5('0xf')));},'filename':function(_0x4925b9,_0x105ab6,_0x1b875b){_0x105ab6[_0x1db5('0x10')]=_0x105ab6[_0x1db5('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1b875b(null,util[_0x1db5('0x11')](_0x1db5('0x12'),path[_0x1db5('0x13')](_0x105ab6[_0x1db5('0x10')],path[_0x1db5('0x14')](_0x105ab6['originalname'])),Date[_0x1db5('0x15')](),path[_0x1db5('0x14')](_0x105ab6[_0x1db5('0x10')])));}})});router[_0x1db5('0x16')]('/',upload[_0x1db5('0x17')](_0x1db5('0x18')),controller[_0x1db5('0x19')]);router[_0x1db5('0x16')](_0x1db5('0x9'),controller['webhookPost']);router[_0x1db5('0x1a')](_0x1db5('0x1b'),auth[_0x1db5('0x1c')](),controller[_0x1db5('0x1d')]);router[_0x1db5('0x1e')](_0x1db5('0x1b'),auth['isAuthenticated'](),controller[_0x1db5('0x1e')]);module[_0x1db5('0x1f')]=router;
\ No newline at end of file
index 98d25b8..e7f4a3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44c4=['STRING','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports'];(function(_0x48ff10,_0x5a5c4d){var _0x334605=function(_0x3f4a70){while(--_0x3f4a70){_0x48ff10['push'](_0x48ff10['shift']());}};_0x334605(++_0x5a5c4d);}(_0x44c4,0xe3));var _0x444c=function(_0x3c93f3,_0xea0daf){_0x3c93f3=_0x3c93f3-0x0;var _0x63b228=_0x44c4[_0x3c93f3];return _0x63b228;};'use strict';var Sequelize=require('sequelize');module[_0x444c('0x0')]={'name':{'type':Sequelize[_0x444c('0x1')]},'type':{'type':Sequelize['ENUM'](_0x444c('0x2'),_0x444c('0x3'))},'description':{'type':Sequelize[_0x444c('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x444c('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x444c('0x5')],'defaultValue':0x0,'comment':_0x444c('0x6')},'sidebar':{'type':Sequelize[_0x444c('0x7')](_0x444c('0x8'),_0x444c('0x9'),_0x444c('0xa'),'never'),'defaultValue':_0x444c('0xa'),'comment':_0x444c('0xb')},'icon':{'type':Sequelize[_0x444c('0x1')]},'adminUrl':{'type':Sequelize[_0x444c('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x444c('0x1')]}};
\ No newline at end of file
+var _0xe301=['STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x19a4a5,_0x405e18){var _0x1196b3=function(_0x5cdc32){while(--_0x5cdc32){_0x19a4a5['push'](_0x19a4a5['shift']());}};_0x1196b3(++_0x405e18);}(_0xe301,0x11b));var _0x1e30=function(_0x49477a,_0xc9d17c){_0x49477a=_0x49477a-0x0;var _0x4edd60=_0xe301[_0x49477a];return _0x4edd60;};'use strict';var Sequelize=require(_0x1e30('0x0'));module[_0x1e30('0x1')]={'name':{'type':Sequelize[_0x1e30('0x2')]},'type':{'type':Sequelize['ENUM'](_0x1e30('0x3'),_0x1e30('0x4'))},'description':{'type':Sequelize[_0x1e30('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x1e30('0x2')],'comment':_0x1e30('0x6')},'active':{'type':Sequelize[_0x1e30('0x7')],'defaultValue':0x0,'comment':_0x1e30('0x8')},'sidebar':{'type':Sequelize[_0x1e30('0x9')](_0x1e30('0xa'),_0x1e30('0xb'),'always',_0x1e30('0xc')),'defaultValue':_0x1e30('0xd'),'comment':_0x1e30('0xe')},'icon':{'type':Sequelize[_0x1e30('0x2')]},'adminUrl':{'type':Sequelize[_0x1e30('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x1e30('0x2')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f8dfbba..ef5f2c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4525=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','options','count','includeAll','rows','catch','show','params','find','join','root','server/files/plugins','format','basename','createWriteStream','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','dirname','node_modules/**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','%s.zip','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','readFileSync','manifest.json','parse','undefined','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','archiver'];(function(_0x1fbe59,_0x45dd45){var _0x315b32=function(_0x403fe){while(--_0x403fe){_0x1fbe59['push'](_0x1fbe59['shift']());}};_0x315b32(++_0x45dd45);}(_0x4525,0x133));var _0x5452=function(_0x3a24c3,_0x4d15d8){_0x3a24c3=_0x3a24c3-0x0;var _0x43d391=_0x4525[_0x3a24c3];return _0x43d391;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5452('0x0'));var rimraf=require(_0x5452('0x1'));var zipdir=require(_0x5452('0x2'));var jsonpatch=require(_0x5452('0x3'));var rp=require(_0x5452('0x4'));var moment=require('moment');var BPromise=require(_0x5452('0x5'));var Mustache=require('mustache');var util=require(_0x5452('0x6'));var path=require(_0x5452('0x7'));var sox=require(_0x5452('0x8'));var csv=require(_0x5452('0x9'));var ejs=require(_0x5452('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5452('0xb'));var crypto=require('crypto');var jsforce=require(_0x5452('0xc'));var deskjs=require(_0x5452('0xd'));var toCsv=require(_0x5452('0x9'));var querystring=require(_0x5452('0xe'));var Papa=require(_0x5452('0xf'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x5452('0x10'));var Redis=require(_0x5452('0x11'));var authService=require(_0x5452('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5452('0x13'));var logger=require(_0x5452('0x14'))('api');var utils=require(_0x5452('0x15'));var config=require(_0x5452('0x16'));var db=require(_0x5452('0x17'))['db'];config[_0x5452('0x18')]=_[_0x5452('0x19')](config[_0x5452('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5452('0x1a'))(new Redis(config[_0x5452('0x18')]));require('./plugin.socket')[_0x5452('0x1b')](socket);function respondWithStatusCode(_0x580665,_0x572e5b){_0x572e5b=_0x572e5b||0xcc;return function(_0x9b48bc){if(_0x9b48bc){return _0x580665[_0x5452('0x1c')](_0x572e5b);}return _0x580665[_0x5452('0x1d')](_0x572e5b)[_0x5452('0x1e')]();};}function respondWithResult(_0x57a859,_0x448840){_0x448840=_0x448840||0xc8;return function(_0x351a72){if(_0x351a72){return _0x57a859[_0x5452('0x1d')](_0x448840)[_0x5452('0x1f')](_0x351a72);}};}function respondWithFilteredResult(_0x48a974,_0x5c49e8){return function(_0x1bce02){if(_0x1bce02){var _0x3ca82c=_0x1bce02['count'],_0x12e473=_0x5c49e8[_0x5452('0x20')],_0x470bc7=_0x5c49e8[_0x5452('0x20')]+_0x5c49e8[_0x5452('0x21')],_0x4ca6d0;if(_0x470bc7>=_0x3ca82c){_0x470bc7=_0x3ca82c;_0x4ca6d0=0xc8;}else{_0x4ca6d0=0xce;}_0x48a974['status'](_0x4ca6d0);return _0x48a974[_0x5452('0x22')](_0x5452('0x23'),_0x12e473+'-'+_0x470bc7+'/'+_0x3ca82c)[_0x5452('0x1f')](_0x1bce02);}return null;};}function patchUpdates(_0x5b2dd1){return function(_0x2b10c4){try{jsonpatch[_0x5452('0x24')](_0x2b10c4,_0x5b2dd1,!![]);}catch(_0x44cd93){return BPromise['reject'](_0x44cd93);}return _0x2b10c4[_0x5452('0x25')]();};}function saveUpdates(_0x237f04,_0xf8491e){return function(_0x5beb76){if(_0x5beb76){return _0x5beb76[_0x5452('0x26')](_0x237f04)[_0x5452('0x27')](function(_0x587f53){return _0x587f53;});}return null;};}function removeEntity(_0x3382db,_0x102b6e){return function(_0xd7a779){if(_0xd7a779){return _0xd7a779[_0x5452('0x28')]()[_0x5452('0x27')](function(){var _0x231d27=_0xd7a779[_0x5452('0x29')]({'plain':!![]});var _0x182408=_0x5452('0x2a');return db[_0x5452('0x2b')][_0x5452('0x28')]({'where':{'type':_0x182408,'resourceId':_0x231d27['id']}})[_0x5452('0x27')](function(){return _0xd7a779;});})['then'](function(){_0x3382db[_0x5452('0x1d')](0xcc)[_0x5452('0x1e')]();});}};}function handleEntityNotFound(_0x573dd4,_0x1878fc){return function(_0x241b87){if(!_0x241b87){_0x573dd4[_0x5452('0x1c')](0x194);}return _0x241b87;};}function handleError(_0x3ef6e3,_0x37c41d){_0x37c41d=_0x37c41d||0x1f4;return function(_0x519f7b){logger[_0x5452('0x2c')](_0x519f7b[_0x5452('0x2d')]);if(_0x519f7b[_0x5452('0x2e')]){delete _0x519f7b[_0x5452('0x2e')];}_0x3ef6e3['status'](_0x37c41d)['send'](_0x519f7b);};}exports[_0x5452('0x2f')]=function(_0x3b6970,_0x1fd0ea){var _0x376cbb={},_0x4ecbad={},_0x1f1bf7={'count':0x0,'rows':[]};var _0x533dce=_[_0x5452('0x30')](db[_0x5452('0x31')][_0x5452('0x32')],function(_0x3fb3e6){return{'name':_0x3fb3e6[_0x5452('0x33')],'type':_0x3fb3e6[_0x5452('0x34')][_0x5452('0x35')]};});_0x4ecbad[_0x5452('0x36')]=_[_0x5452('0x30')](_0x533dce,'name');_0x4ecbad['query']=_[_0x5452('0x37')](_0x3b6970[_0x5452('0x38')]);_0x4ecbad['filters']=_['intersection'](_0x4ecbad[_0x5452('0x36')],_0x4ecbad[_0x5452('0x38')]);_0x376cbb[_0x5452('0x39')]=_[_0x5452('0x3a')](_0x4ecbad[_0x5452('0x36')],qs[_0x5452('0x3b')](_0x3b6970['query'][_0x5452('0x3b')]));_0x376cbb[_0x5452('0x39')]=_0x376cbb['attributes'][_0x5452('0x3c')]?_0x376cbb[_0x5452('0x39')]:_0x4ecbad[_0x5452('0x36')];if(!_0x3b6970[_0x5452('0x38')][_0x5452('0x3d')](_0x5452('0x3e'))){_0x376cbb[_0x5452('0x21')]=qs[_0x5452('0x21')](_0x3b6970[_0x5452('0x38')][_0x5452('0x21')]);_0x376cbb[_0x5452('0x20')]=qs[_0x5452('0x20')](_0x3b6970[_0x5452('0x38')][_0x5452('0x20')]);}_0x376cbb[_0x5452('0x3f')]=qs[_0x5452('0x40')](_0x3b6970[_0x5452('0x38')][_0x5452('0x40')]);_0x376cbb['where']=qs[_0x5452('0x41')](_[_0x5452('0x42')](_0x3b6970[_0x5452('0x38')],_0x4ecbad[_0x5452('0x41')]),_0x533dce);if(_0x3b6970[_0x5452('0x38')][_0x5452('0x43')]){_0x376cbb['where']=_[_0x5452('0x44')](_0x376cbb['where'],{'$or':_[_0x5452('0x30')](_0x533dce,function(_0x58c38d){if(_0x58c38d[_0x5452('0x34')]!=='VIRTUAL'){var _0x35a372={};_0x35a372[_0x58c38d[_0x5452('0x2e')]]={'$like':'%'+_0x3b6970[_0x5452('0x38')][_0x5452('0x43')]+'%'};return _0x35a372;}})});}_0x376cbb=_[_0x5452('0x44')]({},_0x376cbb,_0x3b6970[_0x5452('0x45')]);var _0x431234={'where':_0x376cbb['where']};return db[_0x5452('0x31')][_0x5452('0x46')](_0x431234)['then'](function(_0x384ba7){_0x1f1bf7[_0x5452('0x46')]=_0x384ba7;if(_0x3b6970[_0x5452('0x38')][_0x5452('0x47')]){_0x376cbb['include']=[{'all':!![]}];}return db[_0x5452('0x31')]['findAll'](_0x376cbb);})[_0x5452('0x27')](function(_0x50e182){_0x1f1bf7[_0x5452('0x48')]=_0x50e182;return _0x1f1bf7;})['then'](respondWithFilteredResult(_0x1fd0ea,_0x376cbb))[_0x5452('0x49')](handleError(_0x1fd0ea,null));};exports[_0x5452('0x4a')]=function(_0x1c2956,_0x4e8259){var _0x501ae7={'raw':!![],'where':{'id':_0x1c2956[_0x5452('0x4b')]['id']}},_0xc5a256={};_0xc5a256[_0x5452('0x36')]=_[_0x5452('0x37')](db['Plugin'][_0x5452('0x32')]);_0xc5a256[_0x5452('0x38')]=_['keys'](_0x1c2956['query']);_0xc5a256['filters']=_['intersection'](_0xc5a256[_0x5452('0x36')],_0xc5a256['query']);_0x501ae7[_0x5452('0x39')]=_[_0x5452('0x3a')](_0xc5a256['model'],qs[_0x5452('0x3b')](_0x1c2956[_0x5452('0x38')][_0x5452('0x3b')]));_0x501ae7[_0x5452('0x39')]=_0x501ae7[_0x5452('0x39')][_0x5452('0x3c')]?_0x501ae7[_0x5452('0x39')]:_0xc5a256['model'];if(_0x1c2956[_0x5452('0x38')][_0x5452('0x47')]){_0x501ae7['include']=[{'all':!![]}];}_0x501ae7=_[_0x5452('0x44')]({},_0x501ae7,_0x1c2956[_0x5452('0x45')]);return db[_0x5452('0x31')][_0x5452('0x4c')](_0x501ae7)['then'](handleEntityNotFound(_0x4e8259,null))[_0x5452('0x27')](respondWithResult(_0x4e8259,null))[_0x5452('0x49')](handleError(_0x4e8259,null));};exports['download']=function(_0x2e5686,_0x541122,_0xad81ec){return db['Plugin'][_0x5452('0x4c')]({'where':{'id':_0x2e5686[_0x5452('0x4b')]['id']},'attributes':[_0x5452('0x2e'),_0x5452('0x7')],'raw':!![]})[_0x5452('0x27')](handleEntityNotFound(_0x541122,null))[_0x5452('0x27')](function(_0x54bf35){if(_0x54bf35){var _0x293d11=path[_0x5452('0x4d')](config[_0x5452('0x4e')],_0x5452('0x4f'),util[_0x5452('0x50')]('%s.zip',path[_0x5452('0x51')](_0x54bf35[_0x5452('0x7')])));var _0x567358=fs[_0x5452('0x52')](_0x293d11);var _0x470c76=archiver('zip',{'zlib':{'level':0x9}});_0x470c76['on']('warning',function(_0x46f11f){if(_0x46f11f[_0x5452('0x53')]===_0x5452('0x54')){logger[_0x5452('0x2c')](_0x46f11f);}else{throw new db[(_0x5452('0x55'))][(_0x5452('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x470c76['on'](_0x5452('0x2c'),function(_0x7a4d5e){throw new db[(_0x5452('0x55'))]['Error'](_0x5452('0x57'));});_0x470c76['pipe'](_0x567358);_0x470c76['glob'](_0x5452('0x58'),{'cwd':path[_0x5452('0x4d')](config['root'],_0x5452('0x4f'),path[_0x5452('0x59')](_0x54bf35[_0x5452('0x7')])),'ignore':[path[_0x5452('0x4d')](path[_0x5452('0x51')](_0x54bf35[_0x5452('0x7')]),_0x5452('0x5a')),path['join'](path[_0x5452('0x51')](_0x54bf35[_0x5452('0x7')]),_0x5452('0x5b'))],'nodir':!![]})['finalize']();_0x567358['on']('close',function(){if(!fs[_0x5452('0x5c')](_0x293d11)){throw new db[(_0x5452('0x55'))][(_0x5452('0x56'))](_0x5452('0x5d'));}return _0x541122['download'](_0x293d11,util['format'](_0x5452('0x5e'),path[_0x5452('0x51')](_0x54bf35[_0x5452('0x7')])),function(_0x30dbc2){if(_0x30dbc2){throw new db['Sequelize'][(_0x5452('0x56'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x5452('0x5f')](_0x293d11);logger[_0x5452('0x60')](_0x5452('0x61'));logger[_0x5452('0x60')](_0x5452('0x62'));});});}return null;})[_0x5452('0x49')](handleError(_0x541122,null));};exports[_0x5452('0x63')]=function(_0x47ffcf,_0xf0c93e,_0x39c2fe){var _0x28376f=path['basename'](_0x47ffcf[_0x5452('0x64')][_0x5452('0x65')],path[_0x5452('0x66')](_0x47ffcf['file'][_0x5452('0x65')]));var _0x541fe9=path[_0x5452('0x4d')](config[_0x5452('0x4e')],_0x5452('0x4f'),_0x47ffcf[_0x5452('0x64')][_0x5452('0x65')]);var _0x51f0cb=path[_0x5452('0x4d')](config['root'],_0x5452('0x4f'),_0x28376f);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x541fe9);logger[_0x5452('0x60')]('Plugin\x20upload\x20destination:\x20%s',_0x51f0cb);try{fs['chmodSync'](_0x541fe9,parseInt(_0x5452('0x67'),0x8));extract(_0x541fe9,{'dir':_0x51f0cb},function(_0x4ba2de){if(_0x4ba2de){logger['error'](_0x4ba2de);handleError(_0x4ba2de,!![]);};var _0x4a192d=fs[_0x5452('0x68')](_0x51f0cb);if(_0x4a192d[_0x5452('0x3c')]>0x1){removeReferences(_0x541fe9,_0x51f0cb);logger[_0x5452('0x2c')](_0x5452('0x69'));return _0x39c2fe(new Error('Invalid\x20plugin\x20structure'));}var _0x1342d9=fs[_0x5452('0x6a')](path[_0x5452('0x4d')](_0x51f0cb,_0x4a192d[0x0]));if(_0x1342d9[_0x5452('0x6b')]()){removeReferences(_0x541fe9,_0x51f0cb);logger[_0x5452('0x2c')](_0x5452('0x69'));return _0x39c2fe(new Error(_0x5452('0x69')));}if(_0x1342d9['isDirectory']()){var _0x2d4be9=fs[_0x5452('0x68')](path['join'](_0x51f0cb,_0x4a192d[0x0]));if(_0x2d4be9['length']===0x0){removeReferences(_0x541fe9,_0x51f0cb);logger[_0x5452('0x2c')](_0x5452('0x69'));return _0x39c2fe(new Error(_0x5452('0x69')));}var _0x3bb962=_0x2d4be9[_0x5452('0x6c')](function(_0x3239de){return _0x3239de==='manifest.json';});if(!_0x3bb962){return _0x39c2fe(new Error('Plugin\x20manifest\x20missing'));}var _0x45ea6b=fs[_0x5452('0x6d')](path[_0x5452('0x4d')](_0x51f0cb,_0x4a192d[0x0],_0x5452('0x6e')));var _0x4d9eab=JSON[_0x5452('0x6f')](_0x45ea6b);if(_0x5452('0x70')==typeof _0x4d9eab[_0x5452('0x2e')]){return _0x39c2fe(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x4d9eab[_0x5452('0x34')]){return _0x39c2fe(new Error(_0x5452('0x71')));}if(_0x5452('0x70')==typeof _0x4d9eab['version']){return _0x39c2fe(new Error(_0x5452('0x72')));}if('undefined'==typeof _0x4d9eab[_0x5452('0x73')]){return _0x39c2fe(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4d9eab[_0x5452('0x34')]===_0x5452('0x74')){if('undefined'==typeof _0x4d9eab[_0x5452('0x73')][_0x5452('0x75')]){return _0x39c2fe(new Error(_0x5452('0x76')));}if(_0x5452('0x70')==typeof _0x4d9eab[_0x5452('0x73')][_0x5452('0x75')][_0x5452('0x77')]&&'undefined'==typeof _0x4d9eab['parameters']['views'][_0x5452('0x78')]){return _0x39c2fe(new Error(_0x5452('0x79')));}}else if(_0x4d9eab[_0x5452('0x34')]==='script'){if('undefined'==typeof _0x4d9eab[_0x5452('0x73')][_0x5452('0x7a')]){return _0x39c2fe(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x4d9eab[_0x5452('0x73')][_0x5452('0x7b')]){return _0x39c2fe(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x39c2fe(new Error(_0x5452('0x7c')));}var _0x169299=_0x4d9eab[_0x5452('0x2e')];var _0x11c5fe=_0x4d9eab[_0x5452('0x7d')];var _0x14f202=_0x4d9eab[_0x5452('0x34')];var _0x183e7e=_0x4d9eab[_0x5452('0x7e')]?_0x4d9eab[_0x5452('0x7e')]:_0x5452('0x7f');var _0x5615c2=_0x4d9eab['icon']?_0x4d9eab[_0x5452('0x80')]:_0x5452('0x81');var _0x659c2c='';var _0x21eb62='';var _0x334c68='';var _0xc931a3='';var _0x473977=_0x4d9eab[_0x5452('0x82')];if(_0x14f202===_0x5452('0x74')){if(_0x5452('0x70')!=typeof _0x4d9eab[_0x5452('0x73')][_0x5452('0x75')][_0x5452('0x77')]){var _0x2cc35f=_0x4d9eab['parameters'][_0x5452('0x75')][_0x5452('0x77')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2cc35f)){_0x659c2c=path[_0x5452('0x4d')](_0x5452('0x83'),_0x28376f,_0x4a192d[0x0],_0x2cc35f);}else{_0x659c2c=_0x2cc35f;}}else{logger[_0x5452('0x60')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x4d9eab['parameters'][_0x5452('0x75')][_0x5452('0x78')]){var _0x41920a=_0x4d9eab[_0x5452('0x73')][_0x5452('0x75')][_0x5452('0x78')];if(!/^(f|ht)tps?:\/\//i[_0x5452('0x84')](_0x41920a)){_0x21eb62=path[_0x5452('0x4d')](_0x5452('0x83'),_0x28376f,_0x4a192d[0x0],_0x41920a);}else{_0x21eb62=_0x41920a;}}else{logger[_0x5452('0x60')](_0x5452('0x85'));}}else if(_0x14f202===_0x5452('0x86')){_0x334c68=_0x4d9eab[_0x5452('0x73')]['scriptName'];_0xc931a3=_0x4d9eab[_0x5452('0x73')]['scriptPath'];if(_0x5452('0x70')!=typeof _0x4d9eab[_0x5452('0x73')][_0x5452('0x75')]){if('undefined'!=typeof _0x4d9eab[_0x5452('0x73')][_0x5452('0x75')][_0x5452('0x77')]){var _0x2cc35f=_0x4d9eab['parameters'][_0x5452('0x75')][_0x5452('0x77')];if(!/^(f|ht)tps?:\/\//i[_0x5452('0x84')](_0x2cc35f)){_0x659c2c=path[_0x5452('0x4d')](_0x5452('0x83'),_0x28376f,_0x4a192d[0x0],_0x2cc35f);}else{_0x659c2c=_0x2cc35f;}}if(_0x5452('0x70')!=typeof _0x4d9eab[_0x5452('0x73')]['views']['agent']){var _0x41920a=_0x4d9eab[_0x5452('0x73')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x5452('0x84')](_0x41920a)){_0x21eb62=path[_0x5452('0x4d')](_0x5452('0x83'),_0x28376f,_0x4a192d[0x0],_0x41920a);}else{_0x21eb62=_0x41920a;}}}}var _0x52ec12={'name':_0x169299,'description':_0x11c5fe,'path':path[_0x5452('0x4d')](_0x28376f,_0x4a192d[0x0]),'type':_0x14f202,'sidebar':_0x183e7e,'icon':_0x5615c2,'adminUrl':_0x659c2c,'agentUrl':_0x21eb62,'scriptName':_0x334c68,'scriptPath':_0xc931a3,'version':_0x473977};removeReferences(_0x541fe9,null);return db[_0x5452('0x31')][_0x5452('0x87')](_0x52ec12)[_0x5452('0x27')](function(_0x130a2c){var _0x2cab53={'role':_0x47ffcf[_0x5452('0x88')]['role'],'userProfileId':_0x47ffcf[_0x5452('0x88')]['userProfileId']};if(!_0x2cab53)throw new Error(_0x5452('0x89'));if(_0x2cab53[_0x5452('0x8a')]===_0x5452('0x8b')){var _0x4d857c=_0x130a2c[_0x5452('0x29')]({'plain':!![]});return db[_0x5452('0x8c')][_0x5452('0x4c')]({'where':{'name':_0x5452('0x2a'),'userProfileId':_0x2cab53['userProfileId']},'raw':!![]})[_0x5452('0x27')](function(_0x3d1199){if(_0x3d1199&&_0x3d1199[_0x5452('0x8d')]===0x0){return db[_0x5452('0x2b')][_0x5452('0x87')]({'name':_0x4d857c[_0x5452('0x2e')],'resourceId':_0x4d857c['id'],'type':_0x3d1199[_0x5452('0x2e')],'sectionId':_0x3d1199['id']},{})[_0x5452('0x27')](function(){return _0x130a2c;});}else{return _0x130a2c;}})[_0x5452('0x49')](function(_0x5acc90){logger['error'](_0x5452('0x8e'),_0x5acc90);throw _0x5acc90;});}return _0x130a2c;})[_0x5452('0x27')](respondWithResult(_0xf0c93e,null))[_0x5452('0x49')](handleError(_0xf0c93e,null));}});}catch(_0x504f34){_0xf0c93e[_0x5452('0x1d')](0x1f4)[_0x5452('0x8f')](_0x504f34);}};function removeReferences(_0x169f29,_0xd192c6){try{if(_0x169f29){fs[_0x5452('0x5f')](_0x169f29);logger[_0x5452('0x60')](_0x5452('0x90'));}if(_0xd192c6){rimraf(_0xd192c6,function(){});logger[_0x5452('0x60')](_0x5452('0x91'));}}catch(_0x16cf83){logger[_0x5452('0x2c')](_0x16cf83);}}exports[_0x5452('0x26')]=function(_0x3be660,_0x1b7423,_0x1beef8){return db[_0x5452('0x31')][_0x5452('0x4c')]({'where':{'id':_0x3be660[_0x5452('0x4b')]['id']}})[_0x5452('0x27')](handleEntityNotFound(_0x1b7423,null))['then'](saveUpdates(_0x3be660[_0x5452('0x88')],null))[_0x5452('0x27')](respondWithResult(_0x1b7423,null))[_0x5452('0x49')](handleError(_0x1b7423,null));};exports[_0x5452('0x92')]=function(_0x1de489,_0x1db1d8,_0x452d6d){return db[_0x5452('0x31')]['find']({'where':{'id':_0x1de489['params']['id']}})[_0x5452('0x27')](function(_0x446d1c){if(_0x446d1c){return _0x446d1c['destroy']();}})[_0x5452('0x27')](function(_0x55278c){rimraf(path[_0x5452('0x4d')](config[_0x5452('0x4e')],_0x5452('0x4f'),path[_0x5452('0x59')](_0x55278c[_0x5452('0x7')])),function(){});return _0x55278c;})[_0x5452('0x27')](handleEntityNotFound(_0x1db1d8,null))[_0x5452('0x27')](respondWithStatusCode(_0x1db1d8,null))[_0x5452('0x49')](handleError(_0x1db1d8,null));};exports['webhookGet']=function(_0x158452,_0x26cb48,_0x3ee19a){return BPromise[_0x5452('0x93')]()[_0x5452('0x27')](function(){if(!_0x158452[_0x5452('0x38')][_0x5452('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x158452[_0x5452('0x38')][_0x5452('0x94')]){throw new Error(_0x5452('0x95'));}var _0x1c21c1=_0x158452[_0x5452('0x38')][_0x5452('0x96')]?_0x158452[_0x5452('0x38')][_0x5452('0x96')]+':'+_0x158452[_0x5452('0x38')][_0x5452('0x94')]:_0x5452('0x97')+_0x158452[_0x5452('0x38')]['port'];var _0x25a0e7=_0x158452['query'][_0x5452('0x1f')]?_0x158452['query']['json']:!![];var _0x399aa0=_0x158452[_0x5452('0x38')][_0x5452('0x98')]?_0x158452[_0x5452('0x38')][_0x5452('0x98')]:null;var _0x122a5a={'method':_0x158452[_0x5452('0x99')],'uri':util[_0x5452('0x50')](_0x5452('0x9a'),_0x1c21c1,_0x158452['query'][_0x5452('0x7')]),'json':_0x25a0e7,'resolveWithFullResponse':!![],'encoding':_0x399aa0,'qs':_0x158452['query']};if(_0x158452[_0x5452('0x9b')]){_0x122a5a['headers']=_0x158452[_0x5452('0x9b')];if(_0x122a5a['headers'][_0x5452('0x9c')]){delete _0x122a5a['headers'][_0x5452('0x9c')];}}if(_0x122a5a[_0x5452('0x9b')][_0x5452('0x9d')]){delete _0x122a5a['headers'][_0x5452('0x9d')];}return rp(_0x122a5a);})[_0x5452('0x27')](function(_0x1f9999){if(_0x1f9999){_0x26cb48[_0x5452('0x22')](_0x1f9999[_0x5452('0x9b')]);logger['info'](_0x1f9999[_0x5452('0x88')]);if(_[_0x5452('0x9e')](_0x158452[_0x5452('0x38')][_0x5452('0x7')],'download')&&_0x1f9999[_0x5452('0x9f')]==0x1f4){return _0x26cb48['sendStatus'](_0x1f9999[_0x5452('0x9f')]);}else{return _0x26cb48['status'](_0x1f9999[_0x5452('0x9f')])[_0x5452('0x8f')](_0x1f9999[_0x5452('0x88')]);}}else{return _0x26cb48['sendStatus'](0xc8);}})['catch'](handleError(_0x26cb48,null));};exports[_0x5452('0xa0')]=function(_0x2bd7c8,_0x1304a0,_0x2fa6c1){return BPromise['resolve']()[_0x5452('0x27')](function(){if(!_0x2bd7c8[_0x5452('0x38')][_0x5452('0x7')]){throw new Error(_0x5452('0xa1'));}if(!_0x2bd7c8['query'][_0x5452('0x94')]){throw new Error(_0x5452('0x95'));}var _0x5db2c9=_0x2bd7c8[_0x5452('0x38')]['hostname']?_0x2bd7c8[_0x5452('0x38')]['hostname']+':'+_0x2bd7c8['query']['port']:_0x5452('0x97')+_0x2bd7c8['query'][_0x5452('0x94')];var _0x56a3f8=_0x2bd7c8['query'][_0x5452('0x1f')]?_0x2bd7c8[_0x5452('0x38')][_0x5452('0x1f')]:!![];var _0x552742=_0x2bd7c8[_0x5452('0x38')][_0x5452('0x98')]?_0x2bd7c8[_0x5452('0x38')]['encoding']:null;var _0x57afdd={'method':_0x2bd7c8[_0x5452('0x99')],'uri':util[_0x5452('0x50')](_0x5452('0x9a'),_0x5db2c9,_0x2bd7c8['query']['path']),'json':_0x56a3f8,'resolveWithFullResponse':!![],'encoding':_0x552742,'body':_0x2bd7c8[_0x5452('0x88')]};if(_0x2bd7c8[_0x5452('0x9b')]){_0x57afdd['headers']=_0x2bd7c8[_0x5452('0x9b')];if(_0x57afdd[_0x5452('0x9b')]['content-length']){delete _0x57afdd[_0x5452('0x9b')][_0x5452('0x9c')];}}if(_0x57afdd[_0x5452('0x9b')][_0x5452('0x9d')]){delete _0x57afdd[_0x5452('0x9b')][_0x5452('0x9d')];}return rp(_0x57afdd);})[_0x5452('0x27')](function(_0x5d6238){if(_0x5d6238){_0x1304a0[_0x5452('0x22')](_0x5d6238[_0x5452('0x9b')]);logger[_0x5452('0x60')](_0x5d6238['body']);return _0x1304a0[_0x5452('0x1d')](_0x5d6238[_0x5452('0x9f')])['send'](_0x5d6238[_0x5452('0x88')]);}else{return _0x1304a0[_0x5452('0x1c')](0xc8);}})[_0x5452('0x49')](handleError(_0x1304a0,null));};
\ No newline at end of file
+var _0xc282=['offset','Content-Range','apply','reject','save','update','destroy','then','Plugins','end','stack','name','send','Plugin','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','options','include','findAll','rows','params','rawAttributes','includeAll','catch','download','find','join','root','server/files/plugins','zip','code','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','node_modules/**/*','basename','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','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','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','body','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-type','set','endsWith','statusCode','webhookPost','content-length','html-pdf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','count'];(function(_0x3db7b2,_0x69280e){var _0x35af44=function(_0x5d5435){while(--_0x5d5435){_0x3db7b2['push'](_0x3db7b2['shift']());}};_0x35af44(++_0x69280e);}(_0xc282,0x12d));var _0x2c28=function(_0x25f192,_0x474c2b){_0x25f192=_0x25f192-0x0;var _0x16652f=_0xc282[_0x25f192];return _0x16652f;};'use strict';var pdf=require(_0x2c28('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2c28('0x1'));var rp=require('request-promise');var moment=require(_0x2c28('0x2'));var BPromise=require(_0x2c28('0x3'));var Mustache=require(_0x2c28('0x4'));var util=require(_0x2c28('0x5'));var path=require(_0x2c28('0x6'));var sox=require(_0x2c28('0x7'));var csv=require(_0x2c28('0x8'));var ejs=require(_0x2c28('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2c28('0xa'));var crypto=require(_0x2c28('0xb'));var jsforce=require(_0x2c28('0xc'));var deskjs=require(_0x2c28('0xd'));var toCsv=require(_0x2c28('0x8'));var querystring=require(_0x2c28('0xe'));var Papa=require('papaparse');var extract=require(_0x2c28('0xf'));var rimraf=require(_0x2c28('0x10'));var archiver=require(_0x2c28('0x11'));var Redis=require('ioredis');var authService=require(_0x2c28('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2c28('0x13'));var hardwareService=require(_0x2c28('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2c28('0x15'));var config=require(_0x2c28('0x16'));var db=require(_0x2c28('0x17'))['db'];config['redis']=_[_0x2c28('0x18')](config[_0x2c28('0x19')],{'host':_0x2c28('0x1a'),'port':0x18eb});var socket=require(_0x2c28('0x1b'))(new Redis(config[_0x2c28('0x19')]));require('./plugin.socket')[_0x2c28('0x1c')](socket);function respondWithStatusCode(_0x5ceaa3,_0x2b41ec){_0x2b41ec=_0x2b41ec||0xcc;return function(_0x249be0){if(_0x249be0){return _0x5ceaa3[_0x2c28('0x1d')](_0x2b41ec);}return _0x5ceaa3['status'](_0x2b41ec)['end']();};}function respondWithResult(_0x206669,_0x5b6864){_0x5b6864=_0x5b6864||0xc8;return function(_0x41ee6f){if(_0x41ee6f){return _0x206669[_0x2c28('0x1e')](_0x5b6864)[_0x2c28('0x1f')](_0x41ee6f);}};}function respondWithFilteredResult(_0x500a98,_0x1f9e2d){return function(_0x1bee4e){if(_0x1bee4e){var _0x4661e2=_0x1bee4e[_0x2c28('0x20')],_0x53e226=_0x1f9e2d[_0x2c28('0x21')],_0x38874d=_0x1f9e2d[_0x2c28('0x21')]+_0x1f9e2d['limit'],_0x58ae3a;if(_0x38874d>=_0x4661e2){_0x38874d=_0x4661e2;_0x58ae3a=0xc8;}else{_0x58ae3a=0xce;}_0x500a98['status'](_0x58ae3a);return _0x500a98['set'](_0x2c28('0x22'),_0x53e226+'-'+_0x38874d+'/'+_0x4661e2)[_0x2c28('0x1f')](_0x1bee4e);}return null;};}function patchUpdates(_0x3344e8){return function(_0x168657){try{jsonpatch[_0x2c28('0x23')](_0x168657,_0x3344e8,!![]);}catch(_0x1b646e){return BPromise[_0x2c28('0x24')](_0x1b646e);}return _0x168657[_0x2c28('0x25')]();};}function saveUpdates(_0x3d0c4e,_0x272be3){return function(_0xf66ca2){if(_0xf66ca2){return _0xf66ca2[_0x2c28('0x26')](_0x3d0c4e)['then'](function(_0x786e0f){return _0x786e0f;});}return null;};}function removeEntity(_0x687ddc,_0x37ef09){return function(_0x184219){if(_0x184219){return _0x184219[_0x2c28('0x27')]()[_0x2c28('0x28')](function(){var _0x301ae0=_0x184219['get']({'plain':!![]});var _0x126b37=_0x2c28('0x29');return db['UserProfileResource'][_0x2c28('0x27')]({'where':{'type':_0x126b37,'resourceId':_0x301ae0['id']}})['then'](function(){return _0x184219;});})[_0x2c28('0x28')](function(){_0x687ddc[_0x2c28('0x1e')](0xcc)[_0x2c28('0x2a')]();});}};}function handleEntityNotFound(_0x7c5015,_0xafe94f){return function(_0xc1263){if(!_0xc1263){_0x7c5015['sendStatus'](0x194);}return _0xc1263;};}function handleError(_0x16ebe8,_0x3a2af8){_0x3a2af8=_0x3a2af8||0x1f4;return function(_0x497a10){logger['error'](_0x497a10[_0x2c28('0x2b')]);if(_0x497a10[_0x2c28('0x2c')]){delete _0x497a10['name'];}_0x16ebe8[_0x2c28('0x1e')](_0x3a2af8)[_0x2c28('0x2d')](_0x497a10);};}exports['index']=function(_0x4d9ef0,_0x448992){var _0x56a66e={},_0x442ba6={},_0x5a370f={'count':0x0,'rows':[]};var _0x218be3=_['map'](db[_0x2c28('0x2e')]['rawAttributes'],function(_0x1f7bd5){return{'name':_0x1f7bd5['fieldName'],'type':_0x1f7bd5[_0x2c28('0x2f')][_0x2c28('0x30')]};});_0x442ba6['model']=_[_0x2c28('0x31')](_0x218be3,_0x2c28('0x2c'));_0x442ba6['query']=_[_0x2c28('0x32')](_0x4d9ef0[_0x2c28('0x33')]);_0x442ba6[_0x2c28('0x34')]=_[_0x2c28('0x35')](_0x442ba6[_0x2c28('0x36')],_0x442ba6[_0x2c28('0x33')]);_0x56a66e[_0x2c28('0x37')]=_['intersection'](_0x442ba6[_0x2c28('0x36')],qs[_0x2c28('0x38')](_0x4d9ef0['query']['fields']));_0x56a66e[_0x2c28('0x37')]=_0x56a66e[_0x2c28('0x37')][_0x2c28('0x39')]?_0x56a66e[_0x2c28('0x37')]:_0x442ba6[_0x2c28('0x36')];if(!_0x4d9ef0['query'][_0x2c28('0x3a')](_0x2c28('0x3b'))){_0x56a66e[_0x2c28('0x3c')]=qs[_0x2c28('0x3c')](_0x4d9ef0[_0x2c28('0x33')][_0x2c28('0x3c')]);_0x56a66e[_0x2c28('0x21')]=qs[_0x2c28('0x21')](_0x4d9ef0[_0x2c28('0x33')][_0x2c28('0x21')]);}_0x56a66e['order']=qs[_0x2c28('0x3d')](_0x4d9ef0[_0x2c28('0x33')][_0x2c28('0x3d')]);_0x56a66e['where']=qs[_0x2c28('0x34')](_[_0x2c28('0x3e')](_0x4d9ef0[_0x2c28('0x33')],_0x442ba6[_0x2c28('0x34')]),_0x218be3);if(_0x4d9ef0[_0x2c28('0x33')]['filter']){_0x56a66e[_0x2c28('0x3f')]=_[_0x2c28('0x40')](_0x56a66e[_0x2c28('0x3f')],{'$or':_['map'](_0x218be3,function(_0x5a4c08){if(_0x5a4c08[_0x2c28('0x2f')]!=='VIRTUAL'){var _0x2e3f54={};_0x2e3f54[_0x5a4c08['name']]={'$like':'%'+_0x4d9ef0[_0x2c28('0x33')]['filter']+'%'};return _0x2e3f54;}})});}_0x56a66e=_['merge']({},_0x56a66e,_0x4d9ef0[_0x2c28('0x41')]);var _0x6fa989={'where':_0x56a66e[_0x2c28('0x3f')]};return db[_0x2c28('0x2e')][_0x2c28('0x20')](_0x6fa989)[_0x2c28('0x28')](function(_0x3a93ac){_0x5a370f[_0x2c28('0x20')]=_0x3a93ac;if(_0x4d9ef0['query']['includeAll']){_0x56a66e[_0x2c28('0x42')]=[{'all':!![]}];}return db['Plugin'][_0x2c28('0x43')](_0x56a66e);})[_0x2c28('0x28')](function(_0x56fd4b){_0x5a370f[_0x2c28('0x44')]=_0x56fd4b;return _0x5a370f;})[_0x2c28('0x28')](respondWithFilteredResult(_0x448992,_0x56a66e))['catch'](handleError(_0x448992,null));};exports['show']=function(_0x116fb3,_0x373353){var _0x33834c={'raw':!![],'where':{'id':_0x116fb3[_0x2c28('0x45')]['id']}},_0x571844={};_0x571844[_0x2c28('0x36')]=_[_0x2c28('0x32')](db['Plugin'][_0x2c28('0x46')]);_0x571844['query']=_['keys'](_0x116fb3['query']);_0x571844['filters']=_[_0x2c28('0x35')](_0x571844[_0x2c28('0x36')],_0x571844[_0x2c28('0x33')]);_0x33834c[_0x2c28('0x37')]=_['intersection'](_0x571844[_0x2c28('0x36')],qs[_0x2c28('0x38')](_0x116fb3[_0x2c28('0x33')][_0x2c28('0x38')]));_0x33834c[_0x2c28('0x37')]=_0x33834c[_0x2c28('0x37')][_0x2c28('0x39')]?_0x33834c[_0x2c28('0x37')]:_0x571844[_0x2c28('0x36')];if(_0x116fb3[_0x2c28('0x33')][_0x2c28('0x47')]){_0x33834c[_0x2c28('0x42')]=[{'all':!![]}];}_0x33834c=_[_0x2c28('0x40')]({},_0x33834c,_0x116fb3[_0x2c28('0x41')]);return db[_0x2c28('0x2e')]['find'](_0x33834c)[_0x2c28('0x28')](handleEntityNotFound(_0x373353,null))['then'](respondWithResult(_0x373353,null))[_0x2c28('0x48')](handleError(_0x373353,null));};exports[_0x2c28('0x49')]=function(_0x52ce3b,_0x89fbca,_0x277275){return db['Plugin'][_0x2c28('0x4a')]({'where':{'id':_0x52ce3b[_0x2c28('0x45')]['id']},'attributes':['name','path'],'raw':!![]})[_0x2c28('0x28')](handleEntityNotFound(_0x89fbca,null))['then'](function(_0xddacdf){if(_0xddacdf){var _0x51daee=path[_0x2c28('0x4b')](config[_0x2c28('0x4c')],_0x2c28('0x4d'),util['format']('%s.zip',path['basename'](_0xddacdf['path'])));var _0x5b810=fs['createWriteStream'](_0x51daee);var _0x263a2a=archiver(_0x2c28('0x4e'),{'zlib':{'level':0x9}});_0x263a2a['on']('warning',function(_0x2eec05){if(_0x2eec05[_0x2c28('0x4f')]==='ENOENT'){logger[_0x2c28('0x50')](_0x2eec05);}else{throw new db[(_0x2c28('0x51'))][(_0x2c28('0x52'))](_0x2c28('0x53'));}});_0x263a2a['on'](_0x2c28('0x50'),function(_0x561414){throw new db[(_0x2c28('0x51'))]['Error'](_0x2c28('0x53'));});_0x263a2a[_0x2c28('0x54')](_0x5b810);_0x263a2a['glob'](_0x2c28('0x55'),{'cwd':path[_0x2c28('0x4b')](config[_0x2c28('0x4c')],_0x2c28('0x4d'),path['dirname'](_0xddacdf['path'])),'ignore':[path[_0x2c28('0x4b')](path['basename'](_0xddacdf[_0x2c28('0x6')]),_0x2c28('0x56')),path['join'](path[_0x2c28('0x57')](_0xddacdf[_0x2c28('0x6')]),_0x2c28('0x58'))],'nodir':!![]})[_0x2c28('0x59')]();_0x5b810['on'](_0x2c28('0x5a'),function(){if(!fs[_0x2c28('0x5b')](_0x51daee)){throw new db[(_0x2c28('0x51'))]['Error'](_0x2c28('0x5c'));}return _0x89fbca[_0x2c28('0x49')](_0x51daee,util[_0x2c28('0x5d')](_0x2c28('0x5e'),path[_0x2c28('0x57')](_0xddacdf[_0x2c28('0x6')])),function(_0x4e0dff){if(_0x4e0dff){throw new db[(_0x2c28('0x51'))][(_0x2c28('0x52'))](_0x2c28('0x5f'));}fs[_0x2c28('0x60')](_0x51daee);logger[_0x2c28('0x61')](_0x2c28('0x62'));logger[_0x2c28('0x61')](_0x2c28('0x63'));});});}return null;})[_0x2c28('0x48')](handleError(_0x89fbca,null));};exports['upload']=function(_0x26ff44,_0x4ff3be,_0x370ea5){var _0x3e1eb0=path['basename'](_0x26ff44[_0x2c28('0x64')][_0x2c28('0x65')],path[_0x2c28('0x66')](_0x26ff44[_0x2c28('0x64')]['filename']));var _0x3bfda1=path[_0x2c28('0x4b')](config[_0x2c28('0x4c')],_0x2c28('0x4d'),_0x26ff44['file'][_0x2c28('0x65')]);var _0x2de83d=path[_0x2c28('0x4b')](config[_0x2c28('0x4c')],_0x2c28('0x4d'),_0x3e1eb0);logger['info'](_0x2c28('0x67'),_0x3bfda1);logger[_0x2c28('0x61')](_0x2c28('0x68'),_0x2de83d);try{fs[_0x2c28('0x69')](_0x3bfda1,parseInt('0777',0x8));extract(_0x3bfda1,{'dir':_0x2de83d},function(_0x1c34d1){if(_0x1c34d1){logger[_0x2c28('0x50')](_0x1c34d1);handleError(_0x1c34d1,!![]);};var _0x1e3e66=fs[_0x2c28('0x6a')](_0x2de83d);if(_0x1e3e66[_0x2c28('0x39')]>0x1){removeReferences(_0x3bfda1,_0x2de83d);logger[_0x2c28('0x50')](_0x2c28('0x6b'));return _0x370ea5(new Error(_0x2c28('0x6b')));}var _0x2d2a9c=fs[_0x2c28('0x6c')](path[_0x2c28('0x4b')](_0x2de83d,_0x1e3e66[0x0]));if(_0x2d2a9c[_0x2c28('0x6d')]()){removeReferences(_0x3bfda1,_0x2de83d);logger[_0x2c28('0x50')](_0x2c28('0x6b'));return _0x370ea5(new Error(_0x2c28('0x6b')));}if(_0x2d2a9c[_0x2c28('0x6e')]()){var _0x2119a7=fs[_0x2c28('0x6a')](path[_0x2c28('0x4b')](_0x2de83d,_0x1e3e66[0x0]));if(_0x2119a7[_0x2c28('0x39')]===0x0){removeReferences(_0x3bfda1,_0x2de83d);logger[_0x2c28('0x50')](_0x2c28('0x6b'));return _0x370ea5(new Error(_0x2c28('0x6b')));}var _0x99499b=_0x2119a7[_0x2c28('0x6f')](function(_0x5a31a6){return _0x5a31a6===_0x2c28('0x70');});if(!_0x99499b){return _0x370ea5(new Error(_0x2c28('0x71')));}var _0x43b049=fs[_0x2c28('0x72')](path[_0x2c28('0x4b')](_0x2de83d,_0x1e3e66[0x0],_0x2c28('0x70')));var _0x2cf81b=JSON[_0x2c28('0x73')](_0x43b049);if('undefined'==typeof _0x2cf81b[_0x2c28('0x2c')]){return _0x370ea5(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x2c28('0x74')==typeof _0x2cf81b['type']){return _0x370ea5(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x2c28('0x74')==typeof _0x2cf81b[_0x2c28('0x75')]){return _0x370ea5(new Error(_0x2c28('0x76')));}if('undefined'==typeof _0x2cf81b[_0x2c28('0x77')]){return _0x370ea5(new Error(_0x2c28('0x78')));}if(_0x2cf81b[_0x2c28('0x2f')]===_0x2c28('0x79')){if(_0x2c28('0x74')==typeof _0x2cf81b[_0x2c28('0x77')][_0x2c28('0x7a')]){return _0x370ea5(new Error(_0x2c28('0x7b')));}if('undefined'==typeof _0x2cf81b[_0x2c28('0x77')][_0x2c28('0x7a')][_0x2c28('0x7c')]&&_0x2c28('0x74')==typeof _0x2cf81b[_0x2c28('0x77')][_0x2c28('0x7a')][_0x2c28('0x7d')]){return _0x370ea5(new Error(_0x2c28('0x7e')));}}else if(_0x2cf81b[_0x2c28('0x2f')]===_0x2c28('0x7f')){if(_0x2c28('0x74')==typeof _0x2cf81b['parameters'][_0x2c28('0x80')]){return _0x370ea5(new Error(_0x2c28('0x81')));}if(_0x2c28('0x74')==typeof _0x2cf81b[_0x2c28('0x77')][_0x2c28('0x82')]){return _0x370ea5(new Error(_0x2c28('0x83')));}}else{return _0x370ea5(new Error(_0x2c28('0x84')));}var _0x45ba02=_0x2cf81b[_0x2c28('0x2c')];var _0x5b9757=_0x2cf81b[_0x2c28('0x85')];var _0x1cf736=_0x2cf81b[_0x2c28('0x2f')];var _0x2553d6=_0x2cf81b[_0x2c28('0x86')]?_0x2cf81b[_0x2c28('0x86')]:'always';var _0x1ed2b8=_0x2cf81b['icon']?_0x2cf81b[_0x2c28('0x87')]:_0x2c28('0x88');var _0x33e069='';var _0x4b391f='';var _0x27291e='';var _0x397ddb='';var _0x16f1e7=_0x2cf81b['version'];if(_0x1cf736===_0x2c28('0x79')){if(_0x2c28('0x74')!=typeof _0x2cf81b[_0x2c28('0x77')][_0x2c28('0x7a')][_0x2c28('0x7c')]){var _0x529003=_0x2cf81b[_0x2c28('0x77')]['views'][_0x2c28('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x2c28('0x89')](_0x529003)){_0x33e069=path[_0x2c28('0x4b')](_0x2c28('0x8a'),_0x3e1eb0,_0x1e3e66[0x0],_0x529003);}else{_0x33e069=_0x529003;}}else{logger[_0x2c28('0x61')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x2c28('0x74')!=typeof _0x2cf81b[_0x2c28('0x77')]['views'][_0x2c28('0x7d')]){var _0x2ffad6=_0x2cf81b['parameters'][_0x2c28('0x7a')][_0x2c28('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x2c28('0x89')](_0x2ffad6)){_0x4b391f=path[_0x2c28('0x4b')]('plugins',_0x3e1eb0,_0x1e3e66[0x0],_0x2ffad6);}else{_0x4b391f=_0x2ffad6;}}else{logger[_0x2c28('0x61')](_0x2c28('0x8b'));}}else if(_0x1cf736===_0x2c28('0x7f')){_0x27291e=_0x2cf81b[_0x2c28('0x77')][_0x2c28('0x80')];_0x397ddb=_0x2cf81b['parameters']['scriptPath'];if(_0x2c28('0x74')!=typeof _0x2cf81b[_0x2c28('0x77')]['views']){if(_0x2c28('0x74')!=typeof _0x2cf81b[_0x2c28('0x77')][_0x2c28('0x7a')][_0x2c28('0x7c')]){var _0x529003=_0x2cf81b[_0x2c28('0x77')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x2c28('0x89')](_0x529003)){_0x33e069=path['join'](_0x2c28('0x8a'),_0x3e1eb0,_0x1e3e66[0x0],_0x529003);}else{_0x33e069=_0x529003;}}if(_0x2c28('0x74')!=typeof _0x2cf81b['parameters']['views']['agent']){var _0x2ffad6=_0x2cf81b['parameters'][_0x2c28('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x2c28('0x89')](_0x2ffad6)){_0x4b391f=path[_0x2c28('0x4b')]('plugins',_0x3e1eb0,_0x1e3e66[0x0],_0x2ffad6);}else{_0x4b391f=_0x2ffad6;}}}}var _0x378995={'name':_0x45ba02,'description':_0x5b9757,'path':path[_0x2c28('0x4b')](_0x3e1eb0,_0x1e3e66[0x0]),'type':_0x1cf736,'sidebar':_0x2553d6,'icon':_0x1ed2b8,'adminUrl':_0x33e069,'agentUrl':_0x4b391f,'scriptName':_0x27291e,'scriptPath':_0x397ddb,'version':_0x16f1e7};removeReferences(_0x3bfda1,null);return db[_0x2c28('0x2e')]['create'](_0x378995)[_0x2c28('0x28')](function(_0x57a9e3){var _0x590292={'role':_0x26ff44['body'][_0x2c28('0x8c')],'userProfileId':_0x26ff44['body'][_0x2c28('0x8d')]};if(!_0x590292)throw new Error(_0x2c28('0x8e'));if(_0x590292[_0x2c28('0x8c')]==='user'){var _0xe874f6=_0x57a9e3[_0x2c28('0x8f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x2c28('0x29'),'userProfileId':_0x590292[_0x2c28('0x8d')]},'raw':!![]})[_0x2c28('0x28')](function(_0x3a0a77){if(_0x3a0a77&&_0x3a0a77[_0x2c28('0x90')]===0x0){return db[_0x2c28('0x91')]['create']({'name':_0xe874f6['name'],'resourceId':_0xe874f6['id'],'type':_0x3a0a77[_0x2c28('0x2c')],'sectionId':_0x3a0a77['id']},{})[_0x2c28('0x28')](function(){return _0x57a9e3;});}else{return _0x57a9e3;}})[_0x2c28('0x48')](function(_0x3b3acd){logger[_0x2c28('0x50')](_0x2c28('0x92'),_0x3b3acd);throw _0x3b3acd;});}return _0x57a9e3;})['then'](respondWithResult(_0x4ff3be,null))[_0x2c28('0x48')](handleError(_0x4ff3be,null));}});}catch(_0x180b4e){_0x4ff3be['status'](0x1f4)['send'](_0x180b4e);}};function removeReferences(_0x4b6b39,_0xfea20b){try{if(_0x4b6b39){fs[_0x2c28('0x60')](_0x4b6b39);logger[_0x2c28('0x61')](_0x2c28('0x93'));}if(_0xfea20b){rimraf(_0xfea20b,function(){});logger[_0x2c28('0x61')](_0x2c28('0x94'));}}catch(_0x4e7ee3){logger[_0x2c28('0x50')](_0x4e7ee3);}}exports[_0x2c28('0x26')]=function(_0x1b79b5,_0x359290,_0x3052cc){return db['Plugin']['find']({'where':{'id':_0x1b79b5[_0x2c28('0x45')]['id']}})['then'](handleEntityNotFound(_0x359290,null))[_0x2c28('0x28')](saveUpdates(_0x1b79b5[_0x2c28('0x95')],null))['then'](respondWithResult(_0x359290,null))[_0x2c28('0x48')](handleError(_0x359290,null));};exports[_0x2c28('0x96')]=function(_0xca98df,_0x1e1140,_0x4c17f3){return db[_0x2c28('0x2e')][_0x2c28('0x4a')]({'where':{'id':_0xca98df[_0x2c28('0x45')]['id']}})[_0x2c28('0x28')](function(_0x5256ce){if(_0x5256ce){return _0x5256ce[_0x2c28('0x27')]();}})[_0x2c28('0x28')](function(_0x2052df){rimraf(path['join'](config['root'],'server/files/plugins',path['dirname'](_0x2052df[_0x2c28('0x6')])),function(){});return _0x2052df;})[_0x2c28('0x28')](handleEntityNotFound(_0x1e1140,null))[_0x2c28('0x28')](respondWithStatusCode(_0x1e1140,null))[_0x2c28('0x48')](handleError(_0x1e1140,null));};exports['webhookGet']=function(_0x17b8bf,_0x413eb1,_0x515de7){return BPromise[_0x2c28('0x97')]()[_0x2c28('0x28')](function(){if(!_0x17b8bf[_0x2c28('0x33')]['path']){throw new Error(_0x2c28('0x98'));}if(!_0x17b8bf[_0x2c28('0x33')][_0x2c28('0x99')]){throw new Error(_0x2c28('0x9a'));}var _0x1a98f0=_0x17b8bf[_0x2c28('0x33')]['hostname']?_0x17b8bf[_0x2c28('0x33')][_0x2c28('0x9b')]+':'+_0x17b8bf['query'][_0x2c28('0x99')]:_0x2c28('0x9c')+_0x17b8bf['query'][_0x2c28('0x99')];var _0x32673c=_0x17b8bf[_0x2c28('0x33')]['json']?_0x17b8bf['query'][_0x2c28('0x1f')]:!![];var _0x1569b6=_0x17b8bf[_0x2c28('0x33')]['encoding']?_0x17b8bf[_0x2c28('0x33')][_0x2c28('0x9d')]:null;var _0x57022e={'method':_0x17b8bf[_0x2c28('0x9e')],'uri':util[_0x2c28('0x5d')](_0x2c28('0x9f'),_0x1a98f0,_0x17b8bf['query'][_0x2c28('0x6')]),'json':_0x32673c,'resolveWithFullResponse':!![],'encoding':_0x1569b6,'qs':_0x17b8bf['query']};if(_0x17b8bf['headers']){_0x57022e[_0x2c28('0xa0')]=_0x17b8bf[_0x2c28('0xa0')];if(_0x57022e[_0x2c28('0xa0')]['content-length']){delete _0x57022e[_0x2c28('0xa0')]['content-length'];}}if(_0x57022e[_0x2c28('0xa0')][_0x2c28('0xa1')]){delete _0x57022e[_0x2c28('0xa0')][_0x2c28('0xa1')];}return rp(_0x57022e);})[_0x2c28('0x28')](function(_0x18cbf9){if(_0x18cbf9){_0x413eb1[_0x2c28('0xa2')](_0x18cbf9[_0x2c28('0xa0')]);logger['info'](_0x18cbf9['body']);if(_[_0x2c28('0xa3')](_0x17b8bf['query'][_0x2c28('0x6')],_0x2c28('0x49'))&&_0x18cbf9[_0x2c28('0xa4')]==0x1f4){return _0x413eb1['sendStatus'](_0x18cbf9[_0x2c28('0xa4')]);}else{return _0x413eb1[_0x2c28('0x1e')](_0x18cbf9[_0x2c28('0xa4')])[_0x2c28('0x2d')](_0x18cbf9[_0x2c28('0x95')]);}}else{return _0x413eb1[_0x2c28('0x1d')](0xc8);}})[_0x2c28('0x48')](handleError(_0x413eb1,null));};exports[_0x2c28('0xa5')]=function(_0x5a7cda,_0x27de79,_0x42891a){return BPromise[_0x2c28('0x97')]()[_0x2c28('0x28')](function(){if(!_0x5a7cda['query'][_0x2c28('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5a7cda[_0x2c28('0x33')][_0x2c28('0x99')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x18431c=_0x5a7cda[_0x2c28('0x33')][_0x2c28('0x9b')]?_0x5a7cda[_0x2c28('0x33')][_0x2c28('0x9b')]+':'+_0x5a7cda['query'][_0x2c28('0x99')]:_0x2c28('0x9c')+_0x5a7cda['query']['port'];var _0x3ea6fc=_0x5a7cda[_0x2c28('0x33')][_0x2c28('0x1f')]?_0x5a7cda['query'][_0x2c28('0x1f')]:!![];var _0x119b8f=_0x5a7cda[_0x2c28('0x33')][_0x2c28('0x9d')]?_0x5a7cda[_0x2c28('0x33')][_0x2c28('0x9d')]:null;var _0x113bbf={'method':_0x5a7cda[_0x2c28('0x9e')],'uri':util[_0x2c28('0x5d')](_0x2c28('0x9f'),_0x18431c,_0x5a7cda[_0x2c28('0x33')][_0x2c28('0x6')]),'json':_0x3ea6fc,'resolveWithFullResponse':!![],'encoding':_0x119b8f,'body':_0x5a7cda[_0x2c28('0x95')]};if(_0x5a7cda[_0x2c28('0xa0')]){_0x113bbf[_0x2c28('0xa0')]=_0x5a7cda[_0x2c28('0xa0')];if(_0x113bbf[_0x2c28('0xa0')][_0x2c28('0xa6')]){delete _0x113bbf[_0x2c28('0xa0')][_0x2c28('0xa6')];}}if(_0x113bbf[_0x2c28('0xa0')]['content-type']){delete _0x113bbf[_0x2c28('0xa0')][_0x2c28('0xa1')];}return rp(_0x113bbf);})[_0x2c28('0x28')](function(_0x261574){if(_0x261574){_0x27de79[_0x2c28('0xa2')](_0x261574[_0x2c28('0xa0')]);logger['info'](_0x261574[_0x2c28('0x95')]);return _0x27de79[_0x2c28('0x1e')](_0x261574[_0x2c28('0xa4')])[_0x2c28('0x2d')](_0x261574[_0x2c28('0x95')]);}else{return _0x27de79[_0x2c28('0x1d')](0xc8);}})['catch'](handleError(_0x27de79,null));};
\ No newline at end of file
index 4729fca..786c2db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4888=['emit','hasOwnProperty','hook','../../mysqldb','Plugin','setMaxListeners','save','update','remove'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0x4888,0x198));var _0x8488=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x4888[_0x1e7b16];return _0x37fadc;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x8488('0x2')](0x0);var events={'afterCreate':_0x8488('0x3'),'afterUpdate':_0x8488('0x4'),'afterDestroy':_0x8488('0x5')};function emitEvent(_0x19e51d){return function(_0x571e4b,_0x267093,_0xf45c3f){PluginEvents[_0x8488('0x6')](_0x19e51d+':'+_0x571e4b['id'],_0x571e4b);PluginEvents[_0x8488('0x6')](_0x19e51d,_0x571e4b);_0xf45c3f(null);};}for(var e in events){if(events[_0x8488('0x7')](e)){var event=events[e];Plugin[_0x8488('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0x4213=['../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x250d2a,_0x2983be){var _0x5738fa=function(_0x3cbde0){while(--_0x3cbde0){_0x250d2a['push'](_0x250d2a['shift']());}};_0x5738fa(++_0x2983be);}(_0x4213,0x77));var _0x3421=function(_0xf63cae,_0x3e66a5){_0xf63cae=_0xf63cae-0x0;var _0x4e69df=_0x4213[_0xf63cae];return _0x4e69df;};'use strict';var EventEmitter=require(_0x3421('0x0'));var Plugin=require(_0x3421('0x1'))['db'][_0x3421('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x3421('0x3')](0x0);var events={'afterCreate':_0x3421('0x4'),'afterUpdate':_0x3421('0x5'),'afterDestroy':_0x3421('0x6')};function emitEvent(_0x5a303d){return function(_0xdbd54e,_0x5c3719,_0x459c5e){PluginEvents[_0x3421('0x7')](_0x5a303d+':'+_0xdbd54e['id'],_0xdbd54e);PluginEvents[_0x3421('0x7')](_0x5a303d,_0xdbd54e);_0x459c5e(null);};}for(var e in events){if(events[_0x3421('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x3421('0x9')]=PluginEvents;
\ No newline at end of file
index 35bc358..73b9f73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','plugins','lodash','util','api'];(function(_0x5c49fd,_0x3f67e0){var _0xfa8651=function(_0x215e29){while(--_0x215e29){_0x5c49fd['push'](_0x5c49fd['shift']());}};_0xfa8651(++_0x3f67e0);}(_0xa41a,0x6b));var _0xaa41=function(_0x15a8ad,_0x45a915){_0x15a8ad=_0x15a8ad-0x0;var _0x3c8766=_0xa41a[_0x15a8ad];return _0x3c8766;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Plugin',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x9a19,0x114));var _0x99a1=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x9a19[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2f0c49a..26d1efc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4c8=['catch','CreatePlugin','Plugin','create','body','options','raw','info','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4acb35,_0x45e6f0){var _0xd1712=function(_0x2714d6){while(--_0x2714d6){_0x4acb35['push'](_0x4acb35['shift']());}};_0xd1712(++_0x45e6f0);}(_0xd4c8,0x195));var _0x8d4c=function(_0xcee11f,_0x717112){_0xcee11f=_0xcee11f-0x0;var _0x5e4578=_0xd4c8[_0xcee11f];return _0x5e4578;};'use strict';var _=require(_0x8d4c('0x0'));var util=require('util');var moment=require(_0x8d4c('0x1'));var BPromise=require(_0x8d4c('0x2'));var rs=require(_0x8d4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d4c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d4c('0x5'))(_0x8d4c('0x6'));var config=require(_0x8d4c('0x7'));var jayson=require(_0x8d4c('0x8'));var client=jayson['client'][_0x8d4c('0x9')]({'port':0x232a});config['redis']=_[_0x8d4c('0xa')](config[_0x8d4c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d4c('0xc'))(new Redis(config[_0x8d4c('0xb')]));require(_0x8d4c('0xd'))[_0x8d4c('0xe')](socket);function respondWithRpcPromise(_0x19cf86,_0x157af5,_0x501728){return new BPromise(function(_0x345f8b,_0x5b7e42){return client[_0x8d4c('0xf')](_0x19cf86,_0x501728)[_0x8d4c('0x10')](function(_0x446dd6){logger['info'](_0x8d4c('0x11'),_0x157af5,_0x8d4c('0x12'));logger['debug'](_0x8d4c('0x13'),_0x157af5,_0x8d4c('0x12'),JSON[_0x8d4c('0x14')](_0x446dd6));if(_0x446dd6[_0x8d4c('0x15')]){if(_0x446dd6['error']['code']===0x1f4){logger[_0x8d4c('0x15')](_0x8d4c('0x11'),_0x157af5,_0x446dd6[_0x8d4c('0x15')][_0x8d4c('0x16')]);return _0x5b7e42(_0x446dd6[_0x8d4c('0x15')][_0x8d4c('0x16')]);}logger[_0x8d4c('0x15')](_0x8d4c('0x11'),_0x157af5,_0x446dd6['error'][_0x8d4c('0x16')]);return _0x345f8b(_0x446dd6[_0x8d4c('0x15')][_0x8d4c('0x16')]);}else{logger['info'](_0x8d4c('0x11'),_0x157af5,_0x8d4c('0x12'));_0x345f8b(_0x446dd6[_0x8d4c('0x17')][_0x8d4c('0x16')]);}})[_0x8d4c('0x18')](function(_0x157f4d){logger['error'](_0x8d4c('0x11'),_0x157af5,_0x157f4d);_0x5b7e42(_0x157f4d);});});}exports[_0x8d4c('0x19')]=function(_0x11ca7c){var _0x18ee0d=this;return new Promise(function(_0x57cf35,_0x1a72e0){return db[_0x8d4c('0x1a')][_0x8d4c('0x1b')](_0x11ca7c[_0x8d4c('0x1c')],{'raw':_0x11ca7c[_0x8d4c('0x1d')]?_0x11ca7c[_0x8d4c('0x1d')][_0x8d4c('0x1e')]===undefined?!![]:![]:!![]})[_0x8d4c('0x10')](function(_0x12d130){logger[_0x8d4c('0x1f')]('CreatePlugin',_0x11ca7c);logger[_0x8d4c('0x20')](_0x8d4c('0x19'),_0x11ca7c,JSON[_0x8d4c('0x14')](_0x12d130));_0x57cf35(_0x12d130);})['catch'](function(_0x130897){logger[_0x8d4c('0x15')](_0x8d4c('0x19'),_0x130897['message'],_0x11ca7c);_0x1a72e0(_0x18ee0d[_0x8d4c('0x15')](0x1f4,_0x130897[_0x8d4c('0x16')]));});});};
\ No newline at end of file
+var _0xbd81=['redis','defaults','localhost','socket.io-emitter','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','create','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1646f5,_0x521057){var _0x16ea46=function(_0x5d2083){while(--_0x5d2083){_0x1646f5['push'](_0x1646f5['shift']());}};_0x16ea46(++_0x521057);}(_0xbd81,0x16a));var _0x1bd8=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xbd81[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x1bd8('0x0'));var util=require(_0x1bd8('0x1'));var moment=require(_0x1bd8('0x2'));var BPromise=require(_0x1bd8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bd8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1bd8('0x5'));var logger=require('../../config/logger')(_0x1bd8('0x6'));var config=require(_0x1bd8('0x7'));var jayson=require(_0x1bd8('0x8'));var client=jayson[_0x1bd8('0x9')]['http']({'port':0x232a});config[_0x1bd8('0xa')]=_[_0x1bd8('0xb')](config[_0x1bd8('0xa')],{'host':_0x1bd8('0xc'),'port':0x18eb});var socket=require(_0x1bd8('0xd'))(new Redis(config[_0x1bd8('0xa')]));require('./plugin.socket')[_0x1bd8('0xe')](socket);function respondWithRpcPromise(_0x21ff10,_0x35f9d4,_0x23f5b3){return new BPromise(function(_0x5daddf,_0x201e29){return client['request'](_0x21ff10,_0x23f5b3)[_0x1bd8('0xf')](function(_0x1286a9){logger[_0x1bd8('0x10')](_0x1bd8('0x11'),_0x35f9d4,_0x1bd8('0x12'));logger['debug'](_0x1bd8('0x13'),_0x35f9d4,_0x1bd8('0x12'),JSON[_0x1bd8('0x14')](_0x1286a9));if(_0x1286a9[_0x1bd8('0x15')]){if(_0x1286a9[_0x1bd8('0x15')][_0x1bd8('0x16')]===0x1f4){logger[_0x1bd8('0x15')]('Plugin,\x20%s,\x20%s',_0x35f9d4,_0x1286a9['error'][_0x1bd8('0x17')]);return _0x201e29(_0x1286a9[_0x1bd8('0x15')][_0x1bd8('0x17')]);}logger[_0x1bd8('0x15')]('Plugin,\x20%s,\x20%s',_0x35f9d4,_0x1286a9[_0x1bd8('0x15')][_0x1bd8('0x17')]);return _0x5daddf(_0x1286a9[_0x1bd8('0x15')][_0x1bd8('0x17')]);}else{logger[_0x1bd8('0x10')](_0x1bd8('0x11'),_0x35f9d4,_0x1bd8('0x12'));_0x5daddf(_0x1286a9[_0x1bd8('0x18')][_0x1bd8('0x17')]);}})[_0x1bd8('0x19')](function(_0x357872){logger[_0x1bd8('0x15')](_0x1bd8('0x11'),_0x35f9d4,_0x357872);_0x201e29(_0x357872);});});}exports[_0x1bd8('0x1a')]=function(_0x199cf3){var _0x44c84b=this;return new Promise(function(_0xcc33a3,_0x1600cf){return db['Plugin'][_0x1bd8('0x1b')](_0x199cf3['body'],{'raw':_0x199cf3[_0x1bd8('0x1c')]?_0x199cf3[_0x1bd8('0x1c')][_0x1bd8('0x1d')]===undefined?!![]:![]:!![]})[_0x1bd8('0xf')](function(_0x126e8a){logger[_0x1bd8('0x10')](_0x1bd8('0x1a'),_0x199cf3);logger[_0x1bd8('0x1e')](_0x1bd8('0x1a'),_0x199cf3,JSON[_0x1bd8('0x14')](_0x126e8a));_0xcc33a3(_0x126e8a);})[_0x1bd8('0x19')](function(_0x3740b9){logger[_0x1bd8('0x15')](_0x1bd8('0x1a'),_0x3740b9['message'],_0x199cf3);_0x1600cf(_0x44c84b[_0x1bd8('0x15')](0x1f4,_0x3740b9['message']));});});};
\ No newline at end of file
index 25ade4c..5b6fcca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ffe=['plugin:','save','remove','update','emit','register','length'];(function(_0x592382,_0x4d0052){var _0x59c998=function(_0x4806d3){while(--_0x4806d3){_0x592382['push'](_0x592382['shift']());}};_0x59c998(++_0x4d0052);}(_0x2ffe,0x6a));var _0xe2ff=function(_0x1ef545,_0x533aca){_0x1ef545=_0x1ef545-0x0;var _0x26fdae=_0x2ffe[_0x1ef545];return _0x26fdae;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xe2ff('0x0'),_0xe2ff('0x1'),_0xe2ff('0x2')];function createListener(_0x444dce,_0x4673bd){return function(_0x5a1ac6){_0x4673bd[_0xe2ff('0x3')](_0x444dce,_0x5a1ac6);};}function removeListener(_0x20a23b,_0x4c31ba){return function(){PluginEvents['removeListener'](_0x20a23b,_0x4c31ba);};}exports[_0xe2ff('0x4')]=function(_0xc562df){for(var _0xa461e7=0x0,_0x5dee4a=events[_0xe2ff('0x5')];_0xa461e7<_0x5dee4a;_0xa461e7++){var _0x212ecc=events[_0xa461e7];var _0x2a068f=createListener(_0xe2ff('0x6')+_0x212ecc,_0xc562df);PluginEvents['on'](_0x212ecc,_0x2a068f);}};
\ No newline at end of file
+var _0x1619=['removeListener','remove'];(function(_0x55dfdd,_0x11e0b5){var _0x2eac54=function(_0x5a919b){while(--_0x5a919b){_0x55dfdd['push'](_0x55dfdd['shift']());}};_0x2eac54(++_0x11e0b5);}(_0x1619,0x189));var _0x9161=function(_0xd56e77,_0x2982ba){_0xd56e77=_0xd56e77-0x0;var _0x5db728=_0x1619[_0xd56e77];return _0x5db728;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x9161('0x0'),'update'];function createListener(_0x32741a,_0x5b7e95){return function(_0x27b078){_0x5b7e95['emit'](_0x32741a,_0x27b078);};}function removeListener(_0x1a123e,_0x491624){return function(){PluginEvents[_0x9161('0x1')](_0x1a123e,_0x491624);};}exports['register']=function(_0x50ed78){for(var _0x1b006d=0x0,_0x280562=events['length'];_0x1b006d<_0x280562;_0x1b006d++){var _0xb212e4=events[_0x1b006d];var _0x1f8240=createListener('plugin:'+_0xb212e4,_0x50ed78);PluginEvents['on'](_0xb212e4,_0x1f8240);}};
\ No newline at end of file
index 2cb2b94..d65b01a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x046a=['destroy','exports','express','Router','../../components/auth/service','./pm2.controller','get','index','/:id','post','create','update','isAuthenticated'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x046a,0x1af));var _0xa046=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x046a[_0x126558];return _0x1f6d14;};'use strict';var express=require(_0xa046('0x0'));var router=express[_0xa046('0x1')]();var auth=require(_0xa046('0x2'));var controller=require(_0xa046('0x3'));router[_0xa046('0x4')]('/',auth['isAuthenticated'](),controller[_0xa046('0x5')]);router[_0xa046('0x4')](_0xa046('0x6'),auth['isAuthenticated'](),controller['show']);router[_0xa046('0x7')]('/',auth['isAuthenticated'](),controller[_0xa046('0x8')]);router['put'](_0xa046('0x6'),auth['isAuthenticated'](),controller[_0xa046('0x9')]);router['delete']('/:id',auth[_0xa046('0xa')](),controller[_0xa046('0xb')]);module[_0xa046('0xc')]=router;
\ No newline at end of file
+var _0xbcaa=['../../components/auth/service','./pm2.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','Router'];(function(_0x3c70c4,_0x486505){var _0x17afd6=function(_0x44cb5d){while(--_0x44cb5d){_0x3c70c4['push'](_0x3c70c4['shift']());}};_0x17afd6(++_0x486505);}(_0xbcaa,0xc2));var _0xabca=function(_0xf0bd2,_0x35db65){_0xf0bd2=_0xf0bd2-0x0;var _0x5b26ce=_0xbcaa[_0xf0bd2];return _0x5b26ce;};'use strict';var express=require('express');var router=express[_0xabca('0x0')]();var auth=require(_0xabca('0x1'));var controller=require(_0xabca('0x2'));router['get']('/',auth[_0xabca('0x3')](),controller[_0xabca('0x4')]);router[_0xabca('0x5')](_0xabca('0x6'),auth[_0xabca('0x3')](),controller[_0xabca('0x7')]);router[_0xabca('0x8')]('/',auth[_0xabca('0x3')](),controller[_0xabca('0x9')]);router[_0xabca('0xa')](_0xabca('0x6'),auth[_0xabca('0x3')](),controller[_0xabca('0xb')]);router[_0xabca('0xc')]('/:id',auth[_0xabca('0x3')](),controller[_0xabca('0xd')]);module[_0xabca('0xe')]=router;
\ No newline at end of file
index 789a830..88b4bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc374=['stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','json','error','stack','name','status','send','npm\x20install','info','list','then','reject','express','motion2','length','catch','show','describe','create','body','script','../../files/plugins','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0xa1e030,_0x579969){var _0x1619bb=function(_0x108f53){while(--_0x108f53){_0xa1e030['push'](_0xa1e030['shift']());}};_0x1619bb(++_0x579969);}(_0xc374,0x1da));var _0x4c37=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc374[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c37('0x0'));var pm2=require(_0x4c37('0x1'));var logger=require(_0x4c37('0x2'))(_0x4c37('0x3'));var path=require(_0x4c37('0x4'));var exec=require(_0x4c37('0x5'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x1d3f5b,_0x12f4de){return function(_0x39944b){if(!_0x39944b){_0x1d3f5b['sendStatus'](0x194);;}return _0x39944b;};}function respondWithResult(_0x293835,_0x4a2630){_0x4a2630=_0x4a2630||0xc8;return function(_0x42d429){if(_0x42d429){return _0x293835['status'](_0x4a2630)[_0x4c37('0x6')](_0x42d429);}return null;};}function handleError(_0x1d4a32,_0x5fbfe8){_0x5fbfe8=_0x5fbfe8||0x1f4;return function(_0x1f6701){logger[_0x4c37('0x7')](_0x1f6701[_0x4c37('0x8')]);if(_0x1f6701[_0x4c37('0x9')]){delete _0x1f6701['name'];}_0x1d4a32[_0x4c37('0xa')](_0x5fbfe8)[_0x4c37('0xb')](_0x1f6701);};}function execChildProcess(){return new BPromise(function(_0x7047e1,_0x11fbea){exec(_0x4c37('0xc'),function(_0x457d96,_0x159203,_0x1dce65){logger['info'](_0x159203);logger[_0x4c37('0xd')](_0x1dce65);if(_0x457d96){logger[_0x4c37('0x7')](_0x457d96);return _0x11fbea(_0x457d96);}return _0x7047e1(_0x159203);});});}exports['index']=function(_0x49b987,_0x53457f){return pm2[_0x4c37('0xe')]()[_0x4c37('0xf')](function(_0x2dbdaa){if(_0x2dbdaa){var _0x7442dd=_[_0x4c37('0x10')](_0x2dbdaa,function(_0x2d6651){return _0x2d6651['name']===_0x4c37('0x11')||_0x2d6651[_0x4c37('0x9')]===_0x4c37('0x12');});return{'rows':_0x7442dd,'count':_0x7442dd[_0x4c37('0x13')]};}return null;})['then'](respondWithResult(_0x53457f,null))[_0x4c37('0x14')](handleError(_0x53457f,null));};exports[_0x4c37('0x15')]=function(_0x4289b2,_0xb55f81){return pm2[_0x4c37('0x16')](_0x4289b2['params']['id'])['then'](respondWithResult(_0xb55f81,null))[_0x4c37('0xf')](handleEntityNotFound(_0xb55f81,null))['catch'](handleError(_0xb55f81,null));};exports[_0x4c37('0x17')]=function(_0x4a6016,_0x5a8a94){if(_0x4a6016[_0x4c37('0x18')][_0x4c37('0x9')]&&_0x4a6016['body'][_0x4c37('0x19')]){var _0x1ce839=path['join'](__dirname,_0x4c37('0x1a'),_0x4a6016[_0x4c37('0x18')][_0x4c37('0x19')]);var _0x1d9297=process['cwd']();process[_0x4c37('0x1b')](path['dirname'](_0x1ce839));return execChildProcess()[_0x4c37('0xf')](function(_0xa9fbbc){process[_0x4c37('0x1b')](_0x1d9297);return pm2[_0x4c37('0x1c')]({'name':_0x4a6016[_0x4c37('0x18')][_0x4c37('0x9')],'script':_0x1ce839});})[_0x4c37('0xf')](function(_0x838e3){pm2[_0x4c37('0x1d')]();return _0x838e3[0x0];})[_0x4c37('0xf')](respondWithResult(_0x5a8a94,0xc9))['catch'](handleError(_0x5a8a94,null));}else{return _0x5a8a94[_0x4c37('0xa')](0x1f4)[_0x4c37('0xb')]({'message':_0x4c37('0x1e')});}};exports[_0x4c37('0x1f')]=function(_0x160d49,_0xce55e9){if(_0x160d49[_0x4c37('0x18')]['id']){delete _0x160d49[_0x4c37('0x18')]['id'];}var _0x24241b={'online':_0x4c37('0x20'),'stopped':_0x4c37('0x21')};if(_0x24241b[_0x4c37('0x22')](_0x160d49['body'][_0x4c37('0xa')])){return pm2[_0x24241b[_0x160d49[_0x4c37('0x18')]['status']]](_0x160d49[_0x4c37('0x23')]['id'])['then'](respondWithResult(_0xce55e9,0xc8))[_0x4c37('0x14')](handleError(_0xce55e9,null));}else{return _0xce55e9[_0x4c37('0xa')](0x1f4)[_0x4c37('0xb')]({'message':_0x4c37('0x24')});}};exports[_0x4c37('0x25')]=function(_0xef979d,_0x17bf04){if(_0xef979d[_0x4c37('0x18')]['id']){delete _0xef979d[_0x4c37('0x18')]['id'];}if(_0xef979d[_0x4c37('0x23')]['id']){return pm2[_0x4c37('0x26')](_0xef979d[_0x4c37('0x23')]['id'])[_0x4c37('0xf')](function(_0x5655bc){pm2[_0x4c37('0x1d')]();return _0x5655bc[0x0];})[_0x4c37('0xf')](respondWithResult(_0x17bf04,null))[_0x4c37('0x14')](handleError(_0x17bf04,null));}else{return _0x17bf04[_0x4c37('0xa')](0x1f4)[_0x4c37('0xb')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0x467c=['error','name','send','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','stop','params','Unknown\x20status','destroy','lodash','../../config/pm2','../../config/logger','api','path','sendStatus','status','json'];(function(_0x435b1d,_0x323551){var _0x25f4e5=function(_0x5c5125){while(--_0x5c5125){_0x435b1d['push'](_0x435b1d['shift']());}};_0x25f4e5(++_0x323551);}(_0x467c,0x1d9));var _0xc467=function(_0xb58e48,_0x5cf818){_0xb58e48=_0xb58e48-0x0;var _0x358b15=_0x467c[_0xb58e48];return _0x358b15;};'use strict';var _=require(_0xc467('0x0'));var pm2=require(_0xc467('0x1'));var logger=require(_0xc467('0x2'))(_0xc467('0x3'));var path=require(_0xc467('0x4'));var exec=require('child_process')['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x2407a6,_0x31676d){return function(_0x34c406){if(!_0x34c406){_0x2407a6[_0xc467('0x5')](0x194);;}return _0x34c406;};}function respondWithResult(_0x2c925a,_0x1acf82){_0x1acf82=_0x1acf82||0xc8;return function(_0x157f8c){if(_0x157f8c){return _0x2c925a[_0xc467('0x6')](_0x1acf82)[_0xc467('0x7')](_0x157f8c);}return null;};}function handleError(_0x2a9dc4,_0x3228ee){_0x3228ee=_0x3228ee||0x1f4;return function(_0x2558a4){logger[_0xc467('0x8')](_0x2558a4['stack']);if(_0x2558a4[_0xc467('0x9')]){delete _0x2558a4[_0xc467('0x9')];}_0x2a9dc4[_0xc467('0x6')](_0x3228ee)[_0xc467('0xa')](_0x2558a4);};}function execChildProcess(){return new BPromise(function(_0x37650a,_0x45a600){exec(_0xc467('0xb'),function(_0x21a122,_0xf5de63,_0x5defe2){logger[_0xc467('0xc')](_0xf5de63);logger[_0xc467('0xc')](_0x5defe2);if(_0x21a122){logger[_0xc467('0x8')](_0x21a122);return _0x45a600(_0x21a122);}return _0x37650a(_0xf5de63);});});}exports[_0xc467('0xd')]=function(_0x53e76e,_0x3e23f2){return pm2[_0xc467('0xe')]()[_0xc467('0xf')](function(_0x3624bb){if(_0x3624bb){var _0x122c09=_[_0xc467('0x10')](_0x3624bb,function(_0x5150f8){return _0x5150f8['name']==='express'||_0x5150f8['name']===_0xc467('0x11');});return{'rows':_0x122c09,'count':_0x122c09[_0xc467('0x12')]};}return null;})[_0xc467('0xf')](respondWithResult(_0x3e23f2,null))[_0xc467('0x13')](handleError(_0x3e23f2,null));};exports[_0xc467('0x14')]=function(_0x4912e3,_0x443337){return pm2[_0xc467('0x15')](_0x4912e3['params']['id'])[_0xc467('0xf')](respondWithResult(_0x443337,null))['then'](handleEntityNotFound(_0x443337,null))[_0xc467('0x13')](handleError(_0x443337,null));};exports[_0xc467('0x16')]=function(_0x48bca1,_0x48867c){if(_0x48bca1['body'][_0xc467('0x9')]&&_0x48bca1[_0xc467('0x17')][_0xc467('0x18')]){var _0x1d2687=path[_0xc467('0x19')](__dirname,_0xc467('0x1a'),_0x48bca1[_0xc467('0x17')][_0xc467('0x18')]);var _0x4c09d5=process[_0xc467('0x1b')]();process[_0xc467('0x1c')](path['dirname'](_0x1d2687));return execChildProcess()[_0xc467('0xf')](function(_0x87b155){process['chdir'](_0x4c09d5);return pm2[_0xc467('0x1d')]({'name':_0x48bca1[_0xc467('0x17')][_0xc467('0x9')],'script':_0x1d2687});})[_0xc467('0xf')](function(_0x3f062c){pm2[_0xc467('0x1e')]();return _0x3f062c[0x0];})[_0xc467('0xf')](respondWithResult(_0x48867c,0xc9))[_0xc467('0x13')](handleError(_0x48867c,null));}else{return _0x48867c[_0xc467('0x6')](0x1f4)[_0xc467('0xa')]({'message':_0xc467('0x1f')});}};exports[_0xc467('0x20')]=function(_0x13bc84,_0x1f4aeb){if(_0x13bc84[_0xc467('0x17')]['id']){delete _0x13bc84['body']['id'];}var _0x5e14ad={'online':'restart','stopped':_0xc467('0x21')};if(_0x5e14ad['hasOwnProperty'](_0x13bc84[_0xc467('0x17')][_0xc467('0x6')])){return pm2[_0x5e14ad[_0x13bc84[_0xc467('0x17')]['status']]](_0x13bc84[_0xc467('0x22')]['id'])[_0xc467('0xf')](respondWithResult(_0x1f4aeb,0xc8))[_0xc467('0x13')](handleError(_0x1f4aeb,null));}else{return _0x1f4aeb[_0xc467('0x6')](0x1f4)['send']({'message':_0xc467('0x23')});}};exports[_0xc467('0x24')]=function(_0x1a8b81,_0x1b888f){if(_0x1a8b81[_0xc467('0x17')]['id']){delete _0x1a8b81[_0xc467('0x17')]['id'];}if(_0x1a8b81['params']['id']){return pm2['delete'](_0x1a8b81[_0xc467('0x22')]['id'])[_0xc467('0xf')](function(_0x1ed0cc){pm2[_0xc467('0x1e')]();return _0x1ed0cc[0x0];})[_0xc467('0xf')](respondWithResult(_0x1b888f,null))[_0xc467('0x13')](handleError(_0x1b888f,null));}else{return _0x1b888f['status'](0x1f4)[_0xc467('0xa')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index 90e5b50..a88224d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f3d=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x374ea8,_0x444720){var _0x5bdf9f=function(_0x4f81b7){while(--_0x4f81b7){_0x374ea8['push'](_0x374ea8['shift']());}};_0x5bdf9f(++_0x444720);}(_0x5f3d,0x1e8));var _0xd5f3=function(_0x2ed594,_0x215f8b){_0x2ed594=_0x2ed594-0x0;var _0x4e7462=_0x5f3d[_0x2ed594];return _0x4e7462;};'use strict';var multer=require(_0xd5f3('0x0'));var util=require(_0xd5f3('0x1'));var path=require('path');var timeout=require(_0xd5f3('0x2'));var express=require(_0xd5f3('0x3'));var router=express[_0xd5f3('0x4')]();var auth=require(_0xd5f3('0x5'));var interaction=require(_0xd5f3('0x6'));var config=require('../../config/environment');module[_0xd5f3('0x7')]=router;
\ No newline at end of file
+var _0xc34c=['exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc34c,0x9b));var _0xcc34=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc34c[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xcc34('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcc34('0x1'));var express=require(_0xcc34('0x2'));var router=express[_0xcc34('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcc34('0x4'));var config=require(_0xcc34('0x5'));module[_0xcc34('0x6')]=router;
\ No newline at end of file
index dadec5e..7e56a49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d80=['INTEGER','STRING','DATE','sequelize'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0x0d80,0xfb));var _0x00d8=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x0d80[_0x1283d4];return _0x433643;};'use strict';var Sequelize=require(_0x00d8('0x0'));module['exports']={'state':{'type':Sequelize[_0x00d8('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x00d8('0x2')]},'scheduledat':{'type':Sequelize[_0x00d8('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x00d8('0x3')]},'responsetime':{'type':Sequelize[_0x00d8('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x00d8('0x2')]},'membername':{'type':Sequelize[_0x00d8('0x2')]}};
\ No newline at end of file
+var _0x1de7=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x79a898,_0x3b4f71){var _0xeb5da=function(_0x3ae423){while(--_0x3ae423){_0x79a898['push'](_0x79a898['shift']());}};_0xeb5da(++_0x3b4f71);}(_0x1de7,0x1b5));var _0x71de=function(_0x358861,_0x588704){_0x358861=_0x358861-0x0;var _0x818c78=_0x1de7[_0x358861];return _0x818c78;};'use strict';var Sequelize=require(_0x71de('0x0'));module[_0x71de('0x1')]={'state':{'type':Sequelize[_0x71de('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x71de('0x3')]},'scheduledat':{'type':Sequelize[_0x71de('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x71de('0x4')]},'responsetime':{'type':Sequelize[_0x71de('0x4')]},'ringtime':{'type':Sequelize[_0x71de('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x71de('0x3')]},'campaigntype':{'type':Sequelize[_0x71de('0x3')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9b12958..f7173d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f40=['ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f40,0x6a));var _0x01f4=function(_0x2426f5,_0x49a44a){_0x2426f5=_0x2426f5-0x0;var _0x117a12=_0x1f40[_0x2426f5];return _0x117a12;};'use strict';var _=require(_0x01f4('0x0'));var util=require('util');var logger=require(_0x01f4('0x1'))(_0x01f4('0x2'));var moment=require('moment');var BPromise=require(_0x01f4('0x3'));var rp=require(_0x01f4('0x4'));var fs=require('fs');var path=require(_0x01f4('0x5'));var rimraf=require(_0x01f4('0x6'));var config=require(_0x01f4('0x7'));var attributes=require(_0x01f4('0x8'));module[_0x01f4('0x9')]=function(_0x1f17fe,_0x3a82dc){return _0x1f17fe[_0x01f4('0xa')](_0x01f4('0xb'),attributes,{'tableName':_0x01f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x11fd=['bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11fd,0x157));var _0xd11f=function(_0x245b7f,_0x2b8ed6){_0x245b7f=_0x245b7f-0x0;var _0x1fae5e=_0x11fd[_0x245b7f];return _0x1fae5e;};'use strict';var _=require(_0xd11f('0x0'));var util=require(_0xd11f('0x1'));var logger=require(_0xd11f('0x2'))(_0xd11f('0x3'));var moment=require(_0xd11f('0x4'));var BPromise=require(_0xd11f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd11f('0x6'));var rimraf=require(_0xd11f('0x7'));var config=require(_0xd11f('0x8'));var attributes=require(_0xd11f('0x9'));module['exports']=function(_0x1155af,_0x4f75b5){return _0x1155af['define'](_0xd11f('0xa'),attributes,{'tableName':_0xd11f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2de0f5c..6716a8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf84=['body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview'];(function(_0x575000,_0x2eb086){var _0x42ec5a=function(_0x5d609d){while(--_0x5d609d){_0x575000['push'](_0x575000['shift']());}};_0x42ec5a(++_0x2eb086);}(_0xcf84,0x111));var _0x4cf8=function(_0x3a9b74,_0x442c48){_0x3a9b74=_0x3a9b74-0x0;var _0x570a9d=_0xcf84[_0x3a9b74];return _0x570a9d;};'use strict';var _=require(_0x4cf8('0x0'));var util=require(_0x4cf8('0x1'));var moment=require(_0x4cf8('0x2'));var BPromise=require('bluebird');var rs=require(_0x4cf8('0x3'));var fs=require('fs');var Redis=require(_0x4cf8('0x4'));var db=require(_0x4cf8('0x5'))['db'];var utils=require(_0x4cf8('0x6'));var logger=require(_0x4cf8('0x7'))(_0x4cf8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4cf8('0x9')][_0x4cf8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9a57,_0x4e125f,_0x4b5d52){return new BPromise(function(_0x49b5eb,_0x7f9c0c){return client['request'](_0x9a57,_0x4b5d52)[_0x4cf8('0xb')](function(_0x5ebadc){logger[_0x4cf8('0xc')](_0x4cf8('0xd'),_0x4e125f,'request\x20sent');logger[_0x4cf8('0xe')](_0x4cf8('0xf'),_0x4e125f,_0x4cf8('0x10'),JSON[_0x4cf8('0x11')](_0x5ebadc));if(_0x5ebadc[_0x4cf8('0x12')]){if(_0x5ebadc[_0x4cf8('0x12')][_0x4cf8('0x13')]===0x1f4){logger[_0x4cf8('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x4e125f,_0x5ebadc[_0x4cf8('0x12')][_0x4cf8('0x14')]);return _0x7f9c0c(_0x5ebadc['error'][_0x4cf8('0x14')]);}logger[_0x4cf8('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x4e125f,_0x5ebadc[_0x4cf8('0x12')]['message']);return _0x49b5eb(_0x5ebadc[_0x4cf8('0x12')][_0x4cf8('0x14')]);}else{logger['info'](_0x4cf8('0xd'),_0x4e125f,_0x4cf8('0x10'));_0x49b5eb(_0x5ebadc[_0x4cf8('0x15')]['message']);}})['catch'](function(_0x59e0b9){logger[_0x4cf8('0x12')](_0x4cf8('0xd'),_0x4e125f,_0x59e0b9);_0x7f9c0c(_0x59e0b9);});});}exports[_0x4cf8('0x16')]=function(_0x3f7086){var _0xe8b4e2=this;return new Promise(function(_0x4cc4e0,_0x33fd9c){return db[_0x4cf8('0x17')]['create'](_0x3f7086[_0x4cf8('0x18')],{'raw':_0x3f7086[_0x4cf8('0x19')]?_0x3f7086[_0x4cf8('0x19')][_0x4cf8('0x1a')]===undefined?!![]:![]:!![]})[_0x4cf8('0xb')](function(_0x2caf7b){logger['info']('CreateReportAgentPreview',_0x3f7086);logger[_0x4cf8('0xe')]('CreateReportAgentPreview',_0x3f7086,JSON[_0x4cf8('0x11')](_0x2caf7b));_0x4cc4e0(_0x2caf7b);})['catch'](function(_0x1ec33d){logger[_0x4cf8('0x12')](_0x4cf8('0x16'),_0x1ec33d[_0x4cf8('0x14')],_0x3f7086);_0x33fd9c(_0xe8b4e2[_0x4cf8('0x12')](0x1f4,_0x1ec33d[_0x4cf8('0x14')]));});});};
\ No newline at end of file
+var _0x4f0f=['CreateReportAgentPreview','stringify','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ReportAgentPreview','create','body','options','raw'];(function(_0x24303d,_0x5a994b){var _0x35276e=function(_0x32b292){while(--_0x32b292){_0x24303d['push'](_0x24303d['shift']());}};_0x35276e(++_0x5a994b);}(_0x4f0f,0x16e));var _0xf4f0=function(_0x17febc,_0x5618f2){_0x17febc=_0x17febc-0x0;var _0x500db8=_0x4f0f[_0x17febc];return _0x500db8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf4f0('0x0'));var rs=require(_0xf4f0('0x1'));var fs=require('fs');var Redis=require(_0xf4f0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4f0('0x3'));var logger=require(_0xf4f0('0x4'))(_0xf4f0('0x5'));var config=require(_0xf4f0('0x6'));var jayson=require(_0xf4f0('0x7'));var client=jayson[_0xf4f0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a24a0,_0x5164d8,_0x69690c){return new BPromise(function(_0x39b8f4,_0x114715){return client[_0xf4f0('0x9')](_0x5a24a0,_0x69690c)[_0xf4f0('0xa')](function(_0x361d1e){logger[_0xf4f0('0xb')](_0xf4f0('0xc'),_0x5164d8,_0xf4f0('0xd'));logger[_0xf4f0('0xe')](_0xf4f0('0xf'),_0x5164d8,_0xf4f0('0xd'),JSON['stringify'](_0x361d1e));if(_0x361d1e[_0xf4f0('0x10')]){if(_0x361d1e['error'][_0xf4f0('0x11')]===0x1f4){logger[_0xf4f0('0x10')](_0xf4f0('0xc'),_0x5164d8,_0x361d1e[_0xf4f0('0x10')][_0xf4f0('0x12')]);return _0x114715(_0x361d1e['error'][_0xf4f0('0x12')]);}logger[_0xf4f0('0x10')](_0xf4f0('0xc'),_0x5164d8,_0x361d1e[_0xf4f0('0x10')][_0xf4f0('0x12')]);return _0x39b8f4(_0x361d1e[_0xf4f0('0x10')]['message']);}else{logger[_0xf4f0('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x5164d8,'request\x20sent');_0x39b8f4(_0x361d1e[_0xf4f0('0x13')][_0xf4f0('0x12')]);}})[_0xf4f0('0x14')](function(_0x30cea7){logger['error'](_0xf4f0('0xc'),_0x5164d8,_0x30cea7);_0x114715(_0x30cea7);});});}exports['CreateReportAgentPreview']=function(_0x142d2f){var _0x5f1a94=this;return new Promise(function(_0xcbfb98,_0xebae06){return db[_0xf4f0('0x15')][_0xf4f0('0x16')](_0x142d2f[_0xf4f0('0x17')],{'raw':_0x142d2f['options']?_0x142d2f[_0xf4f0('0x18')][_0xf4f0('0x19')]===undefined?!![]:![]:!![]})[_0xf4f0('0xa')](function(_0x181f3c){logger[_0xf4f0('0xb')](_0xf4f0('0x1a'),_0x142d2f);logger[_0xf4f0('0xe')](_0xf4f0('0x1a'),_0x142d2f,JSON[_0xf4f0('0x1b')](_0x181f3c));_0xcbfb98(_0x181f3c);})[_0xf4f0('0x14')](function(_0xd0fd3b){logger[_0xf4f0('0x10')]('CreateReportAgentPreview',_0xd0fd3b[_0xf4f0('0x12')],_0x142d2f);_0xebae06(_0x5f1a94[_0xf4f0('0x10')](0x1f4,_0xd0fd3b['message']));});});};
\ No newline at end of file
index e62e8ec..c09869b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbde=['smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/mail/queues','mailQueues','openchannelQueues','/sms/queues'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0xfbde,0x1f3));var _0xefbd=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xfbde[_0x45b034];return _0x509cb0;};'use strict';var multer=require(_0xefbd('0x0'));var util=require(_0xefbd('0x1'));var path=require(_0xefbd('0x2'));var express=require(_0xefbd('0x3'));var router=express['Router']();var auth=require(_0xefbd('0x4'));var controller=require(_0xefbd('0x5'));router[_0xefbd('0x6')](_0xefbd('0x7'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x9')]);router['get'](_0xefbd('0xa'),auth[_0xefbd('0x8')](),controller[_0xefbd('0xb')]);router[_0xefbd('0x6')](_0xefbd('0xc'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0xefbd('0x6')](_0xefbd('0xd'),auth[_0xefbd('0x8')](),controller[_0xefbd('0xe')]);router['get']('/chat/queues',auth[_0xefbd('0x8')](),controller['chatQueues']);router[_0xefbd('0x6')](_0xefbd('0xf'),auth['isAuthenticated'](),controller[_0xefbd('0x10')]);router[_0xefbd('0x6')]('/mail/accounts',auth[_0xefbd('0x8')](),controller['mailAccounts']);router[_0xefbd('0x6')]('/openchannel/queues',auth[_0xefbd('0x8')](),controller[_0xefbd('0x11')]);router[_0xefbd('0x6')](_0xefbd('0x12'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x13')]);router[_0xefbd('0x6')]('/whatsapp/queues',auth['isAuthenticated'](),controller['whatsappQueues']);router[_0xefbd('0x6')](_0xefbd('0x14'),auth[_0xefbd('0x8')](),controller['faxQueues']);router['get'](_0xefbd('0x15'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x16')]);router[_0xefbd('0x6')](_0xefbd('0x17'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x18')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0xefbd('0x8')](),controller[_0xefbd('0x19')]);router[_0xefbd('0x6')](_0xefbd('0x1a'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x1b')]);router[_0xefbd('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router['get'](_0xefbd('0x1c'),auth['isAuthenticated'](),controller[_0xefbd('0x1d')]);router[_0xefbd('0x6')](_0xefbd('0x1e'),auth['isAuthenticated'](),controller['outbound']);router[_0xefbd('0x6')](_0xefbd('0x1f'),auth['isAuthenticated'](),controller[_0xefbd('0x20')]);router[_0xefbd('0x6')](_0xefbd('0x21'),auth[_0xefbd('0x8')](),controller['agents']);router[_0xefbd('0x22')](_0xefbd('0x23'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x24')]);router[_0xefbd('0x6')](_0xefbd('0x25'),auth[_0xefbd('0x8')](),controller['telephones']);router[_0xefbd('0x6')](_0xefbd('0x26'),auth['isAuthenticated'](),controller[_0xefbd('0x27')]);router[_0xefbd('0x6')](_0xefbd('0x28'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x29')]);router[_0xefbd('0x6')](_0xefbd('0x2a'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x2b')]);router[_0xefbd('0x6')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0xefbd('0x6')](_0xefbd('0x2c'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x2d')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0xefbd('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0xefbd('0x6')](_0xefbd('0x2e'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x2f')]);router[_0xefbd('0x6')](_0xefbd('0x30'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x31')]);router['get']('/fax/queues/waitinginteractions',auth[_0xefbd('0x8')](),controller['faxQueuesWaitingInteractions']);router['post'](_0xefbd('0x32'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x33')]('mail'));router[_0xefbd('0x6')](_0xefbd('0x34'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xefbd('0x35')](_0xefbd('0x36'),auth['isAuthenticated'](),controller[_0xefbd('0x33')](_0xefbd('0x37')));router[_0xefbd('0x6')](_0xefbd('0x38'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x39')]);router['post'](_0xefbd('0x3a'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x33')](_0xefbd('0x3b')));router[_0xefbd('0x6')](_0xefbd('0x3c'),auth[_0xefbd('0x8')](),controller['showFaxQueues']);router['post'](_0xefbd('0x3d'),auth[_0xefbd('0x8')](),controller['queueNotify'](_0xefbd('0x3e')));router['get'](_0xefbd('0x3f'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x40')]);router['post'](_0xefbd('0x41'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x33')](_0xefbd('0x42')));router['post'](_0xefbd('0x43'),auth['isAuthenticated'](),controller[_0xefbd('0x33')](_0xefbd('0x44')));router[_0xefbd('0x6')]('/sms/queues/:id',auth[_0xefbd('0x8')](),controller[_0xefbd('0x45')]);router[_0xefbd('0x6')](_0xefbd('0x46'),auth[_0xefbd('0x8')](),controller[_0xefbd('0x47')]);router[_0xefbd('0x35')](_0xefbd('0x48'),auth[_0xefbd('0x8')](),controller['agentNotify']);module[_0xefbd('0x49')]=router;
\ No newline at end of file
+var _0x411c=['/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','exports','multer','util','Router','./rpc.controller','get'];(function(_0x5c4f89,_0x42e9d6){var _0x133307=function(_0x1484d6){while(--_0x1484d6){_0x5c4f89['push'](_0x5c4f89['shift']());}};_0x133307(++_0x42e9d6);}(_0x411c,0x93));var _0xc411=function(_0x4d2f96,_0xb8dfc8){_0x4d2f96=_0x4d2f96-0x0;var _0x1f0c90=_0x411c[_0x4d2f96];return _0x1f0c90;};'use strict';var multer=require(_0xc411('0x0'));var util=require(_0xc411('0x1'));var path=require('path');var express=require('express');var router=express[_0xc411('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0xc411('0x3'));router[_0xc411('0x4')](_0xc411('0x5'),auth[_0xc411('0x6')](),controller[_0xc411('0x7')]);router[_0xc411('0x4')](_0xc411('0x8'),auth[_0xc411('0x6')](),controller[_0xc411('0x9')]);router[_0xc411('0x4')](_0xc411('0xa'),auth[_0xc411('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0xc411('0x4')](_0xc411('0xb'),auth[_0xc411('0x6')](),controller[_0xc411('0xc')]);router[_0xc411('0x4')](_0xc411('0xd'),auth[_0xc411('0x6')](),controller[_0xc411('0xe')]);router[_0xc411('0x4')](_0xc411('0xf'),auth[_0xc411('0x6')](),controller[_0xc411('0x10')]);router[_0xc411('0x4')](_0xc411('0x11'),auth[_0xc411('0x6')](),controller[_0xc411('0x12')]);router[_0xc411('0x4')](_0xc411('0x13'),auth[_0xc411('0x6')](),controller['openchannelQueues']);router[_0xc411('0x4')](_0xc411('0x14'),auth[_0xc411('0x6')](),controller[_0xc411('0x15')]);router['get'](_0xc411('0x16'),auth[_0xc411('0x6')](),controller[_0xc411('0x17')]);router[_0xc411('0x4')](_0xc411('0x18'),auth[_0xc411('0x6')](),controller[_0xc411('0x19')]);router[_0xc411('0x4')](_0xc411('0x1a'),auth[_0xc411('0x6')](),controller[_0xc411('0x1b')]);router[_0xc411('0x4')](_0xc411('0x1c'),auth[_0xc411('0x6')](),controller[_0xc411('0x1d')]);router[_0xc411('0x4')]('/voice/queues/channels/:uniqueid',auth[_0xc411('0x6')](),controller[_0xc411('0x1e')]);router['get'](_0xc411('0x1f'),auth[_0xc411('0x6')](),controller[_0xc411('0x20')]);router['get'](_0xc411('0x21'),auth[_0xc411('0x6')](),controller[_0xc411('0x22')]);router[_0xc411('0x4')]('/voice/queues/:id',auth[_0xc411('0x6')](),controller['showVoiceQueues']);router[_0xc411('0x4')](_0xc411('0x23'),auth[_0xc411('0x6')](),controller[_0xc411('0x24')]);router[_0xc411('0x4')](_0xc411('0x25'),auth[_0xc411('0x6')](),controller[_0xc411('0x26')]);router[_0xc411('0x4')](_0xc411('0x27'),auth[_0xc411('0x6')](),controller[_0xc411('0x28')]);router[_0xc411('0x29')]('/agents/:id/capacity',auth[_0xc411('0x6')](),controller[_0xc411('0x2a')]);router[_0xc411('0x4')](_0xc411('0x2b'),auth[_0xc411('0x6')](),controller['telephones']);router[_0xc411('0x4')](_0xc411('0x2c'),auth[_0xc411('0x6')](),controller[_0xc411('0x2d')]);router[_0xc411('0x4')](_0xc411('0x2e'),auth[_0xc411('0x6')](),controller[_0xc411('0x2f')]);router[_0xc411('0x4')](_0xc411('0x30'),auth['isAuthenticated'](),controller[_0xc411('0x31')]);router[_0xc411('0x4')]('/chat/queues/waitinginteractions',auth[_0xc411('0x6')](),controller[_0xc411('0x32')]);router[_0xc411('0x4')]('/mail/queues/waitinginteractions',auth[_0xc411('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0xc411('0x4')](_0xc411('0x33'),auth[_0xc411('0x6')](),controller[_0xc411('0x34')]);router[_0xc411('0x4')](_0xc411('0x35'),auth[_0xc411('0x6')](),controller[_0xc411('0x36')]);router[_0xc411('0x4')](_0xc411('0x37'),auth['isAuthenticated'](),controller[_0xc411('0x38')]);router['get'](_0xc411('0x39'),auth[_0xc411('0x6')](),controller[_0xc411('0x3a')]);router[_0xc411('0x3b')](_0xc411('0x3c'),auth[_0xc411('0x6')](),controller[_0xc411('0x3d')]('mail'));router['get']('/mail/queues/:id',auth[_0xc411('0x6')](),controller[_0xc411('0x3e')]);router[_0xc411('0x3b')](_0xc411('0x3f'),auth[_0xc411('0x6')](),controller['queueNotify'](_0xc411('0x40')));router['get']('/chat/queues/:id',auth[_0xc411('0x6')](),controller[_0xc411('0x41')]);router['post']('/fax/queues/:id/notify',auth[_0xc411('0x6')](),controller[_0xc411('0x3d')]('fax'));router['get'](_0xc411('0x42'),auth[_0xc411('0x6')](),controller['showFaxQueues']);router['post'](_0xc411('0x43'),auth[_0xc411('0x6')](),controller['queueNotify'](_0xc411('0x44')));router[_0xc411('0x4')]('/openchannel/queues/:id',auth[_0xc411('0x6')](),controller[_0xc411('0x45')]);router[_0xc411('0x3b')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc411('0x3d')]('sms'));router[_0xc411('0x3b')](_0xc411('0x46'),auth[_0xc411('0x6')](),controller['queueNotify']('whatsapp'));router['get'](_0xc411('0x47'),auth['isAuthenticated'](),controller[_0xc411('0x48')]);router['get']('/whatsapp/queues/:id',auth[_0xc411('0x6')](),controller[_0xc411('0x49')]);router[_0xc411('0x3b')](_0xc411('0x4a'),auth[_0xc411('0x6')](),controller['agentNotify']);module[_0xc411('0x4b')]=router;
\ No newline at end of file
index 668535b..9ae6316 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x196d=['outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x196d,0x13f));var _0xd196=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x196d[_0x154192];return _0x3c2792;};'use strict';var BPromise=require(_0xd196('0x0'));var moment=require(_0xd196('0x1'));var _=require(_0xd196('0x2'));var util=require(_0xd196('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xd196('0x4'));var amiClient=jayson[_0xd196('0x5')][_0xd196('0x6')]({'port':0x232a});var mailClient=jayson[_0xd196('0x5')][_0xd196('0x6')]({'port':0x232b});var routingClient=jayson[_0xd196('0x5')][_0xd196('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x1d37b5,_0x31c7da,_0x26839b){return new BPromise(function(_0x58ded5,_0x1d3e6a){var _0x571f50=_0x26839b?_0x26839b:amiClient;return _0x571f50['request'](_0x1d37b5,_0x31c7da)[_0xd196('0x7')](function(_0x511348){if(_0x511348[_0xd196('0x8')]){if(_0x511348[_0xd196('0x8')][_0xd196('0x9')]===0x1f4){return _0x1d3e6a(_0x511348[_0xd196('0x8')][_0xd196('0xa')]);}return _0x58ded5(_0x511348[_0xd196('0x8')]['message']);}else{_0x58ded5(_0x511348[_0xd196('0xb')]);}})[_0xd196('0xc')](function(_0x4417a9){_0x1d3e6a(_0x4417a9);});});}function respondWithResult(_0x28ba49,_0x2e01e8){_0x2e01e8=_0x2e01e8||0xc8;return function(_0x447fb8){if(_0x447fb8){return _0x28ba49[_0xd196('0xd')](_0x2e01e8)[_0xd196('0xe')](_0x447fb8);}return _0x28ba49[_0xd196('0xf')](0x194);};}function handleError(_0xa01f53,_0x420356){_0x420356=_0x420356||0x1f4;return function(_0x2a31b1){logger['error'](_0x2a31b1[_0xd196('0x10')]);if(_0x2a31b1[_0xd196('0x11')]){delete _0x2a31b1[_0xd196('0x11')];}_0xa01f53['status'](_0x420356)['send'](_0x2a31b1);};}function findById(_0x3d6de0){return function(_0x549d66){if(!_[_0xd196('0x12')](_0x3d6de0)&&!_[_0xd196('0x12')](_0x549d66)&&!_[_0xd196('0x12')](_0x549d66[_0xd196('0x13')])){return _[_0xd196('0x14')](_0x549d66[_0xd196('0x13')],function(_0x542568){return _0x542568['id']==_0x3d6de0;});}return null;};}exports[_0xd196('0x15')]=function(_0x3a9121,_0x465640){return respondWithRpcPromise('VoiceChannels',_0x3a9121[_0xd196('0x16')])[_0xd196('0x7')](respondWithResult(_0x465640,null))[_0xd196('0xc')](handleError(_0x465640,null));};exports[_0xd196('0x17')]=function(_0xc53a73,_0x14ee93){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xd196('0x18')](_0xc53a73[_0xd196('0x16')],_0xc53a73[_0xd196('0x19')]))[_0xd196('0x7')](respondWithResult(_0x14ee93,null))[_0xd196('0xc')](handleError(_0x14ee93,null));};exports[_0xd196('0x1a')]=function(_0x22945e,_0x511773){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xd196('0x18')](_0x22945e[_0xd196('0x16')],_0x22945e[_0xd196('0x19')]))[_0xd196('0x7')](respondWithResult(_0x511773,null))[_0xd196('0xc')](handleError(_0x511773,null));};exports[_0xd196('0x1b')]=function(_0x239100,_0x2aa191){return respondWithRpcPromise(_0xd196('0x1c'),_0x239100[_0xd196('0x16')])[_0xd196('0x7')](respondWithResult(_0x2aa191,null))[_0xd196('0xc')](handleError(_0x2aa191,null));};exports[_0xd196('0x1d')]=function(_0x2fbe71,_0x587ee7){return respondWithRpcPromise(_0xd196('0x1c'),_0x2fbe71[_0xd196('0x16')])[_0xd196('0x7')](findById(_0x2fbe71[_0xd196('0x19')]['id']))[_0xd196('0x7')](respondWithResult(_0x587ee7,null))[_0xd196('0xc')](handleError(_0x587ee7,null));};exports[_0xd196('0x1e')]=function(_0x5bbeea,_0x79c81c){return respondWithRpcPromise(_0xd196('0x1f'),_[_0xd196('0x18')](_0x5bbeea[_0xd196('0x16')],_0x5bbeea[_0xd196('0x19')]))['then'](respondWithResult(_0x79c81c,null))[_0xd196('0xc')](handleError(_0x79c81c,null));};exports[_0xd196('0x20')]=function(_0x1ef24d,_0x2c6c7f){return respondWithRpcPromise('VoiceQueuesChannels',_0x1ef24d[_0xd196('0x16')])[_0xd196('0x7')](respondWithResult(_0x2c6c7f,null))[_0xd196('0xc')](handleError(_0x2c6c7f,null));};exports[_0xd196('0x21')]=function(_0x185a61,_0x4a8fef){return respondWithRpcPromise(_0xd196('0x22'),_[_0xd196('0x18')](_0x185a61['query'],_0x185a61[_0xd196('0x19')]))[_0xd196('0x7')](respondWithResult(_0x4a8fef,null))[_0xd196('0xc')](handleError(_0x4a8fef,null));};exports[_0xd196('0x23')]=function(_0x82312d,_0x541cea){return respondWithRpcPromise(_0xd196('0x24'),_[_0xd196('0x18')](_0x82312d['query'],_0x82312d[_0xd196('0x19')]))['then'](respondWithResult(_0x541cea,null))[_0xd196('0xc')](handleError(_0x541cea,null));};exports[_0xd196('0x25')]=function(_0x291a4a,_0xb690ea){return respondWithRpcPromise(_0xd196('0x26'),_[_0xd196('0x18')](_0x291a4a[_0xd196('0x16')],_0x291a4a[_0xd196('0x19')]))[_0xd196('0x7')](respondWithResult(_0xb690ea,null))[_0xd196('0xc')](handleError(_0xb690ea,null));};exports[_0xd196('0x27')]=function(_0x38c2dc,_0x5b0789){return respondWithRpcPromise(_0xd196('0x28'),_0x38c2dc[_0xd196('0x16')])[_0xd196('0x7')](respondWithResult(_0x5b0789,null))['catch'](handleError(_0x5b0789,null));};exports[_0xd196('0x29')]=function(_0x2d0d04,_0x328ad4){return respondWithRpcPromise(_0xd196('0x2a'),_0x2d0d04[_0xd196('0x16')])[_0xd196('0x7')](respondWithResult(_0x328ad4,null))[_0xd196('0xc')](handleError(_0x328ad4,null));};exports[_0xd196('0x2b')]=function(_0x1835f8,_0x389e87){var _0x184062;return respondWithRpcPromise(_0xd196('0x2c'),_0x1835f8[_0xd196('0x16')])[_0xd196('0x7')](function(_0xa52635){_0x184062=_0xa52635;return respondWithRpcPromise(_0xd196('0x2c'),_0x1835f8[_0xd196('0x16')],routingClient);})[_0xd196('0x7')](function(_0x52d361){return _[_0xd196('0x18')]({},_0x52d361,_0x184062);})['then'](respondWithResult(_0x389e87,null))['catch'](handleError(_0x389e87,null));};exports[_0xd196('0x2d')]=function(_0x19b6c8,_0x5bbf51){if(_0x19b6c8[_0xd196('0x2e')]&&_0x19b6c8[_0xd196('0x2e')][_0xd196('0x2f')]&&_0x19b6c8[_0xd196('0x30')]&&_0x19b6c8[_0xd196('0x30')]['name']){for(var _0x2e6d13 in _0x19b6c8[_0xd196('0x2e')][_0xd196('0x2f')]){if(_0x19b6c8[_0xd196('0x2e')][_0xd196('0x2f')]['hasOwnProperty'](_0x2e6d13)){db[_0xd196('0x31')][_0xd196('0x32')]({'where':{'channel':_0x2e6d13,'membername':_0x19b6c8['user'][_0xd196('0x11')],'type':_0xd196('0x33'),'exitAt':null,'uniqueid':_0x19b6c8[_0xd196('0x2e')][_0xd196('0x2f')][_0x2e6d13]&&_0x19b6c8[_0xd196('0x2e')][_0xd196('0x2f')][_0x2e6d13]['length']?{'$notIn':_0x19b6c8[_0xd196('0x2e')]['interaction'][_0x2e6d13]}:{'$ne':null}}})['then'](function(_0x2fd555){var _0x3bffe5=moment()[_0xd196('0x34')](_0xd196('0x35'));for(var _0x599eb9=0x0,_0x40ec71=_0x2fd555[_0xd196('0x36')];_0x599eb9<_0x40ec71;_0x599eb9+=0x1){_0x2fd555[_0x599eb9][_0xd196('0x37')]({'exitAt':_0x3bffe5});}});for(var _0x3933fa=0x0;_0x3933fa<_0x19b6c8['body']['interaction'][_0x2e6d13][_0xd196('0x36')];_0x3933fa+=0x1){db[_0xd196('0x31')][_0xd196('0x38')]({'where':{'channel':_0x2e6d13,'membername':_0x19b6c8[_0xd196('0x30')][_0xd196('0x11')],'type':_0xd196('0x33'),'uniqueid':_0x19b6c8['body'][_0xd196('0x2f')][_0x2e6d13][_0x3933fa],'exitAt':null},'defaults':{'channel':_0x2e6d13,'membername':_0x19b6c8[_0xd196('0x30')][_0xd196('0x11')],'interface':_[_0xd196('0x12')](_0x19b6c8[_0xd196('0x30')][_0xd196('0x39')])?util['format'](_0xd196('0x3a'),_0x19b6c8[_0xd196('0x30')]['name']):_0x19b6c8[_0xd196('0x30')]['interface'],'type':_0xd196('0x33'),'enterAt':moment()[_0xd196('0x34')](_0xd196('0x35')),'role':_0xd196('0x3b'),'internal':_0x19b6c8[_0xd196('0x30')][_0xd196('0x3c')],'uniqueid':_0x19b6c8[_0xd196('0x2e')][_0xd196('0x2f')][_0x2e6d13][_0x3933fa]}});}}}}return respondWithRpcPromise(_0xd196('0x3d'),{'id':_0x19b6c8[_0xd196('0x19')]['id'],'capacity':_0x19b6c8[_0xd196('0x2e')][_0xd196('0x3e')]},routingClient)['then'](respondWithResult(_0x5bbf51,null))['catch'](handleError(_0x5bbf51,null));};exports[_0xd196('0x3f')]=function(_0x1de168,_0x50dbfc){return respondWithRpcPromise(_0xd196('0x40'),_0x1de168['query'])[_0xd196('0x7')](respondWithResult(_0x50dbfc,null))[_0xd196('0xc')](handleError(_0x50dbfc,null));};exports['trunks']=function(_0x27600a,_0x1bc831){return respondWithRpcPromise('Trunks',_0x27600a[_0xd196('0x16')])[_0xd196('0x7')](respondWithResult(_0x1bc831,null))[_0xd196('0xc')](handleError(_0x1bc831,null));};exports[_0xd196('0x41')]=function(_0xa4f9b,_0x466cec){return respondWithRpcPromise(_0xd196('0x42'),_0xa4f9b[_0xd196('0x16')])[_0xd196('0x7')](respondWithResult(_0x466cec,null))['catch'](handleError(_0x466cec,null));};exports[_0xd196('0x43')]=function(_0x2d63fe,_0x1e1b61){return respondWithRpcPromise(_0xd196('0x44'),_0x2d63fe[_0xd196('0x16')],routingClient)[_0xd196('0x7')](respondWithResult(_0x1e1b61,null))[_0xd196('0xc')](handleError(_0x1e1b61,null));};exports[_0xd196('0x45')]=function(_0x276035,_0x20240b){return respondWithRpcPromise('ChatQueues',_0x276035['query'],routingClient)[_0xd196('0x7')](findById(_0x276035[_0xd196('0x19')]['id']))['then'](respondWithResult(_0x20240b,null))[_0xd196('0xc')](handleError(_0x20240b,null));};exports[_0xd196('0x46')]=function(_0x200b4c,_0x107278){return respondWithRpcPromise(_0xd196('0x47'),_0x200b4c[_0xd196('0x16')],routingClient)[_0xd196('0x7')](respondWithResult(_0x107278,null))[_0xd196('0xc')](handleError(_0x107278,null));};exports['showMailQueues']=function(_0x3c9c2e,_0x25ca15){return respondWithRpcPromise(_0xd196('0x47'),_0x3c9c2e[_0xd196('0x16')],routingClient)[_0xd196('0x7')](findById(_0x3c9c2e[_0xd196('0x19')]['id']))[_0xd196('0x7')](respondWithResult(_0x25ca15,null))['catch'](handleError(_0x25ca15,null));};exports[_0xd196('0x48')]=function(_0x3b20e8,_0x9b7b6b){return respondWithRpcPromise(_0xd196('0x49'),_0x3b20e8[_0xd196('0x16')],mailClient)['then'](respondWithResult(_0x9b7b6b,null))['catch'](handleError(_0x9b7b6b,null));};exports['openchannelQueues']=function(_0xc07ca9,_0x13f554){return respondWithRpcPromise(_0xd196('0x4a'),_0xc07ca9[_0xd196('0x16')],routingClient)['then'](respondWithResult(_0x13f554,null))[_0xd196('0xc')](handleError(_0x13f554,null));};exports[_0xd196('0x4b')]=function(_0x22c07c,_0x447d38){return respondWithRpcPromise(_0xd196('0x4a'),_0x22c07c[_0xd196('0x16')],routingClient)[_0xd196('0x7')](findById(_0x22c07c[_0xd196('0x19')]['id']))[_0xd196('0x7')](respondWithResult(_0x447d38,null))[_0xd196('0xc')](handleError(_0x447d38,null));};exports[_0xd196('0x4c')]=function(_0x5f36d5,_0x1a168c){return respondWithRpcPromise(_0xd196('0x4d'),_0x5f36d5['query'],routingClient)[_0xd196('0x7')](respondWithResult(_0x1a168c,null))[_0xd196('0xc')](handleError(_0x1a168c,null));};exports[_0xd196('0x4e')]=function(_0x1b4078,_0x37f46e){return respondWithRpcPromise(_0xd196('0x4d'),_0x1b4078[_0xd196('0x16')],routingClient)[_0xd196('0x7')](findById(_0x1b4078[_0xd196('0x19')]['id']))[_0xd196('0x7')](respondWithResult(_0x37f46e,null))[_0xd196('0xc')](handleError(_0x37f46e,null));};exports['whatsappQueues']=function(_0x51e4f8,_0x182eb1){return respondWithRpcPromise(_0xd196('0x4f'),_0x51e4f8['query'],routingClient)[_0xd196('0x7')](respondWithResult(_0x182eb1,null))[_0xd196('0xc')](handleError(_0x182eb1,null));};exports[_0xd196('0x50')]=function(_0x27b15a,_0xfdcf63){return respondWithRpcPromise(_0xd196('0x4f'),_0x27b15a['query'],routingClient)[_0xd196('0x7')](findById(_0x27b15a[_0xd196('0x19')]['id']))[_0xd196('0x7')](respondWithResult(_0xfdcf63,null))[_0xd196('0xc')](handleError(_0xfdcf63,null));};exports[_0xd196('0x51')]=function(_0x2e8ad4,_0x57438c){return respondWithRpcPromise('FaxQueues',_0x2e8ad4['query'],routingClient)[_0xd196('0x7')](respondWithResult(_0x57438c,null))[_0xd196('0xc')](handleError(_0x57438c,null));};exports[_0xd196('0x52')]=function(_0x9bf26,_0x5b712c){return respondWithRpcPromise('FaxQueues',_0x9bf26[_0xd196('0x16')],routingClient)[_0xd196('0x7')](findById(_0x9bf26[_0xd196('0x19')]['id']))[_0xd196('0x7')](respondWithResult(_0x5b712c,null))[_0xd196('0xc')](handleError(_0x5b712c,null));};exports['faxAccounts']=function(_0x5c54cd,_0x362588){return respondWithRpcPromise(_0xd196('0x53'),_0x5c54cd[_0xd196('0x16')])[_0xd196('0x7')](respondWithResult(_0x362588,null))[_0xd196('0xc')](handleError(_0x362588,null));};exports[_0xd196('0x54')]=function(_0x16c74c,_0x3e8e4c){return respondWithRpcPromise(_0xd196('0x55'),_0x16c74c['query'],routingClient)[_0xd196('0x7')](respondWithResult(_0x3e8e4c,null))[_0xd196('0xc')](handleError(_0x3e8e4c,null));};exports[_0xd196('0x56')]=function(_0x21b435,_0x951b81){return respondWithRpcPromise(_0xd196('0x57'),_0x21b435[_0xd196('0x16')],routingClient)[_0xd196('0x7')](respondWithResult(_0x951b81,null))['catch'](handleError(_0x951b81,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x49cccc,_0x39931f){return respondWithRpcPromise(_0xd196('0x58'),_0x49cccc['query'],routingClient)[_0xd196('0x7')](respondWithResult(_0x39931f,null))[_0xd196('0xc')](handleError(_0x39931f,null));};exports[_0xd196('0x59')]=function(_0x166396,_0x537425){return respondWithRpcPromise(_0xd196('0x5a'),_0x166396[_0xd196('0x16')],routingClient)[_0xd196('0x7')](respondWithResult(_0x537425,null))[_0xd196('0xc')](handleError(_0x537425,null));};exports[_0xd196('0x5b')]=function(_0x5967d3,_0x436dfc){return respondWithRpcPromise(_0xd196('0x5c'),_0x5967d3[_0xd196('0x16')],routingClient)[_0xd196('0x7')](respondWithResult(_0x436dfc,null))[_0xd196('0xc')](handleError(_0x436dfc,null));};exports['faxQueuesWaitingInteractions']=function(_0x2d06a7,_0x63d371){return respondWithRpcPromise(_0xd196('0x5d'),_0x2d06a7[_0xd196('0x16')],routingClient)[_0xd196('0x7')](respondWithResult(_0x63d371,null))[_0xd196('0xc')](handleError(_0x63d371,null));};exports[_0xd196('0x5e')]=function(_0x1b262f){return function(_0x2591bf,_0x1e8fa1){var _0x4134a0,_0x30cadc;var _0x316104=_[_0xd196('0x5f')](_0x1b262f);var _0x409c34=_0x1b262f===_0xd196('0x60')?_0xd196('0x61'):_0xd196('0x62');return db[_0x316104+_0xd196('0x63')]['findOne']({'raw':!![],'where':{'id':_0x2591bf[_0xd196('0x19')]['id']}})['then'](function(_0x21289f){if(_[_0xd196('0x12')](_0x21289f)){throw new Error(_0x316104+_0xd196('0x64'));}_0x4134a0=_0x21289f;return db[_0x316104+_0xd196('0x65')][_0xd196('0x66')]({'where':{'id':_0x2591bf['body'][_0xd196('0x67')]},'include':[{'model':db[_0x316104+_0xd196('0x68')],'as':_0xd196('0x68')},{'model':db[_0x316104+_0x409c34],'as':_0xd196('0x62')}]});})[_0xd196('0x7')](function(_0x5aeb02){if(_['isNil'](_0x5aeb02)){throw new Error(_0x316104+_0xd196('0x69'));}_0x30cadc=_0x5aeb02;return _0x5aeb02[_0xd196('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd196('0x7')](function(){var _0x336ac1={'uniqueid':_0x1b262f+'.'+_0x30cadc['id']+'.'+_0x30cadc[_0xd196('0x68')]['id'],'FromUserId':_0x2591bf[_0xd196('0x30')]['id'],'type':_0xd196('0x6b')};_0x336ac1[_0x316104+_0xd196('0x6c')]=_0x30cadc['id'];_0x336ac1[_0x316104+_0xd196('0x6d')]=_0x30cadc[_0xd196('0x68')]['id'];_0x336ac1[_0xd196('0x6e')+_0x316104+_0x409c34+'Id']=_0x30cadc[_0xd196('0x62')]['id'];_0x336ac1['To'+_0x316104+_0xd196('0x6f')]=_0x4134a0['id'];return db[_0x316104+_0xd196('0x70')][_0xd196('0x71')](_0x336ac1);})[_0xd196('0x7')](function(){return respondWithRpcPromise(_0xd196('0x72'),{'channel':_0x1b262f,'interaction':_0x30cadc[_0xd196('0x68')],'message':_0x30cadc,'account':_0x30cadc['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4134a0[_0xd196('0x11')]+','+(_0x30cadc['Account']['queueTransferTimeout']||0x12c),'interval':_0xd196('0x73')}]},routingClient);})[_0xd196('0x7')](respondWithResult(_0x1e8fa1,null))[_0xd196('0xc')](handleError(_0x1e8fa1,null));};};exports[_0xd196('0x74')]=function(_0x20a862,_0x319add){var _0x3bfafd,_0x54c008;if(_['isNil'](_0x20a862['body'][_0xd196('0x75')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0xb5b2ff=_0x20a862[_0xd196('0x2e')][_0xd196('0x75')];var _0x265c29=_[_0xd196('0x5f')](_0xb5b2ff);var _0x2ed311=_0xb5b2ff===_0xd196('0x60')?_0xd196('0x61'):_0xd196('0x62');return db[_0xd196('0x76')][_0xd196('0x66')]({'raw':!![],'where':{'id':_0x20a862['params']['id'],'role':_0xd196('0x3b')}})[_0xd196('0x7')](function(_0x2ae44a){if(_[_0xd196('0x12')](_0x2ae44a)){throw new Error(_0xd196('0x77'));}_0x3bfafd=_0x2ae44a;return db[_0x265c29+_0xd196('0x65')][_0xd196('0x66')]({'where':{'id':_0x20a862[_0xd196('0x2e')][_0xd196('0x67')]},'include':[{'model':db[_0x265c29+'Interaction'],'as':_0xd196('0x68')},{'model':db[_0x265c29+_0x2ed311],'as':_0xd196('0x62')}]});})[_0xd196('0x7')](function(_0xd0b1c5){if(_[_0xd196('0x12')](_0xd0b1c5)){throw new Error(_0x265c29+_0xd196('0x69'));}_0x54c008=_0xd0b1c5;return _0xd0b1c5[_0xd196('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1b61d7={'uniqueid':_0xb5b2ff+'.'+_0x54c008['id']+'.'+_0x54c008[_0xd196('0x68')]['id'],'FromUserId':_0x20a862[_0xd196('0x30')]['id'],'type':_0xd196('0x6b'),'ToUserId':_0x3bfafd['id']};_0x1b61d7[_0x265c29+_0xd196('0x6c')]=_0x54c008['id'];_0x1b61d7[_0x265c29+'InteractionId']=_0x54c008[_0xd196('0x68')]['id'];_0x1b61d7[_0xd196('0x6e')+_0x265c29+_0x2ed311+'Id']=_0x54c008['Account']['id'];return db[_0x265c29+_0xd196('0x70')][_0xd196('0x71')](_0x1b61d7);})[_0xd196('0x7')](function(){return respondWithRpcPromise(_0xd196('0x72'),{'channel':_0xb5b2ff,'interaction':_0x54c008[_0xd196('0x68')],'message':_0x54c008,'account':_0x54c008[_0xd196('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3bfafd['name']+','+(_0x54c008[_0xd196('0x62')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x319add,null))[_0xd196('0xc')](handleError(_0x319add,null));};
\ No newline at end of file
+var _0xe8da=['agent','Agent\x20not\x20found','Message','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','error','code','catch','status','name','send','isNil','rows','find','VoiceChannels','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','length','format','updateAttributes','findOrCreate','interface','YYYY-MM-DD\x20HH:mm:ss','internal','AgentCapacity','capacity','Telephones','Trunks','Campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xe8da,0xdf));var _0xae8d=function(_0x59035a,_0x39710a){_0x59035a=_0x59035a-0x0;var _0x4de37c=_0xe8da[_0x59035a];return _0x4de37c;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xae8d('0x0'));var util=require(_0xae8d('0x1'));var db=require(_0xae8d('0x2'))['db'];var logger=require(_0xae8d('0x3'))(_0xae8d('0x4'));var jayson=require(_0xae8d('0x5'));var amiClient=jayson[_0xae8d('0x6')][_0xae8d('0x7')]({'port':0x232a});var mailClient=jayson[_0xae8d('0x6')][_0xae8d('0x7')]({'port':0x232b});var routingClient=jayson[_0xae8d('0x6')][_0xae8d('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x5277af,_0x5edf22,_0x950653){return new BPromise(function(_0x1b2103,_0x458269){var _0xc25800=_0x950653?_0x950653:amiClient;return _0xc25800['request'](_0x5277af,_0x5edf22)['then'](function(_0x412ecb){if(_0x412ecb['error']){if(_0x412ecb[_0xae8d('0x8')][_0xae8d('0x9')]===0x1f4){return _0x458269(_0x412ecb[_0xae8d('0x8')]['message']);}return _0x1b2103(_0x412ecb['error']['message']);}else{_0x1b2103(_0x412ecb['result']);}})[_0xae8d('0xa')](function(_0x286165){_0x458269(_0x286165);});});}function respondWithResult(_0x1fdfc4,_0x150023){_0x150023=_0x150023||0xc8;return function(_0x3edc26){if(_0x3edc26){return _0x1fdfc4[_0xae8d('0xb')](_0x150023)['json'](_0x3edc26);}return _0x1fdfc4['sendStatus'](0x194);};}function handleError(_0x89863e,_0x5f08f0){_0x5f08f0=_0x5f08f0||0x1f4;return function(_0x5d120a){logger[_0xae8d('0x8')](_0x5d120a['stack']);if(_0x5d120a[_0xae8d('0xc')]){delete _0x5d120a['name'];}_0x89863e[_0xae8d('0xb')](_0x5f08f0)[_0xae8d('0xd')](_0x5d120a);};}function findById(_0x4ddc0d){return function(_0x4962e6){if(!_[_0xae8d('0xe')](_0x4ddc0d)&&!_[_0xae8d('0xe')](_0x4962e6)&&!_[_0xae8d('0xe')](_0x4962e6[_0xae8d('0xf')])){return _[_0xae8d('0x10')](_0x4962e6[_0xae8d('0xf')],function(_0xd7ceec){return _0xd7ceec['id']==_0x4ddc0d;});}return null;};}exports['voiceChannels']=function(_0x2e2dc2,_0x5d8c11){return respondWithRpcPromise(_0xae8d('0x11'),_0x2e2dc2['query'])[_0xae8d('0x12')](respondWithResult(_0x5d8c11,null))['catch'](handleError(_0x5d8c11,null));};exports[_0xae8d('0x13')]=function(_0x56a8e0,_0x5a2d74){return respondWithRpcPromise(_0xae8d('0x14'),_[_0xae8d('0x15')](_0x56a8e0[_0xae8d('0x16')],_0x56a8e0[_0xae8d('0x17')]))[_0xae8d('0x12')](respondWithResult(_0x5a2d74,null))[_0xae8d('0xa')](handleError(_0x5a2d74,null));};exports[_0xae8d('0x18')]=function(_0x5ad8fb,_0x44ff3c){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xae8d('0x15')](_0x5ad8fb[_0xae8d('0x16')],_0x5ad8fb[_0xae8d('0x17')]))[_0xae8d('0x12')](respondWithResult(_0x44ff3c,null))[_0xae8d('0xa')](handleError(_0x44ff3c,null));};exports['voiceQueues']=function(_0x3c3bcf,_0x5cda50){return respondWithRpcPromise(_0xae8d('0x19'),_0x3c3bcf['query'])['then'](respondWithResult(_0x5cda50,null))[_0xae8d('0xa')](handleError(_0x5cda50,null));};exports[_0xae8d('0x1a')]=function(_0x5c3f66,_0x50a37c){return respondWithRpcPromise(_0xae8d('0x19'),_0x5c3f66[_0xae8d('0x16')])[_0xae8d('0x12')](findById(_0x5c3f66[_0xae8d('0x17')]['id']))[_0xae8d('0x12')](respondWithResult(_0x50a37c,null))[_0xae8d('0xa')](handleError(_0x50a37c,null));};exports[_0xae8d('0x1b')]=function(_0x49db2e,_0x30b90b){return respondWithRpcPromise(_0xae8d('0x1c'),_[_0xae8d('0x15')](_0x49db2e[_0xae8d('0x16')],_0x49db2e[_0xae8d('0x17')]))[_0xae8d('0x12')](respondWithResult(_0x30b90b,null))[_0xae8d('0xa')](handleError(_0x30b90b,null));};exports['voiceQueuesChannels']=function(_0x58b2af,_0x3af13d){return respondWithRpcPromise(_0xae8d('0x1d'),_0x58b2af[_0xae8d('0x16')])[_0xae8d('0x12')](respondWithResult(_0x3af13d,null))['catch'](handleError(_0x3af13d,null));};exports[_0xae8d('0x1e')]=function(_0x4b2895,_0x3325aa){return respondWithRpcPromise(_0xae8d('0x1f'),_[_0xae8d('0x15')](_0x4b2895[_0xae8d('0x16')],_0x4b2895[_0xae8d('0x17')]))[_0xae8d('0x12')](respondWithResult(_0x3325aa,null))[_0xae8d('0xa')](handleError(_0x3325aa,null));};exports['voiceQueuesChannelHangup']=function(_0xbe93e8,_0x42a6a6){return respondWithRpcPromise(_0xae8d('0x20'),_['merge'](_0xbe93e8[_0xae8d('0x16')],_0xbe93e8[_0xae8d('0x17')]))[_0xae8d('0x12')](respondWithResult(_0x42a6a6,null))[_0xae8d('0xa')](handleError(_0x42a6a6,null));};exports[_0xae8d('0x21')]=function(_0x3792f8,_0x2c1f7a){return respondWithRpcPromise(_0xae8d('0x22'),_['merge'](_0x3792f8[_0xae8d('0x16')],_0x3792f8['params']))[_0xae8d('0x12')](respondWithResult(_0x2c1f7a,null))[_0xae8d('0xa')](handleError(_0x2c1f7a,null));};exports['outbound']=function(_0x5b6b78,_0x16614d){return respondWithRpcPromise(_0xae8d('0x23'),_0x5b6b78[_0xae8d('0x16')])[_0xae8d('0x12')](respondWithResult(_0x16614d,null))[_0xae8d('0xa')](handleError(_0x16614d,null));};exports[_0xae8d('0x24')]=function(_0x2a7bed,_0x3e4ca8){return respondWithRpcPromise(_0xae8d('0x25'),_0x2a7bed[_0xae8d('0x16')])[_0xae8d('0x12')](respondWithResult(_0x3e4ca8,null))[_0xae8d('0xa')](handleError(_0x3e4ca8,null));};exports[_0xae8d('0x26')]=function(_0x265a5b,_0x5f3f7f){var _0x8ac60f;return respondWithRpcPromise(_0xae8d('0x27'),_0x265a5b[_0xae8d('0x16')])[_0xae8d('0x12')](function(_0x2355c6){_0x8ac60f=_0x2355c6;return respondWithRpcPromise('Agents',_0x265a5b[_0xae8d('0x16')],routingClient);})['then'](function(_0x34dd9a){return _[_0xae8d('0x15')]({},_0x34dd9a,_0x8ac60f);})[_0xae8d('0x12')](respondWithResult(_0x5f3f7f,null))[_0xae8d('0xa')](handleError(_0x5f3f7f,null));};exports[_0xae8d('0x28')]=function(_0xbdf56a,_0x1fa357){if(_0xbdf56a[_0xae8d('0x29')]&&_0xbdf56a[_0xae8d('0x29')][_0xae8d('0x2a')]&&_0xbdf56a[_0xae8d('0x2b')]&&_0xbdf56a[_0xae8d('0x2b')][_0xae8d('0xc')]){for(var _0x5700b6 in _0xbdf56a['body'][_0xae8d('0x2a')]){if(_0xbdf56a['body']['interaction']['hasOwnProperty'](_0x5700b6)){db[_0xae8d('0x2c')][_0xae8d('0x2d')]({'where':{'channel':_0x5700b6,'membername':_0xbdf56a[_0xae8d('0x2b')]['name'],'type':_0xae8d('0x2e'),'exitAt':null,'uniqueid':_0xbdf56a[_0xae8d('0x29')]['interaction'][_0x5700b6]&&_0xbdf56a['body'][_0xae8d('0x2a')][_0x5700b6][_0xae8d('0x2f')]?{'$notIn':_0xbdf56a['body'][_0xae8d('0x2a')][_0x5700b6]}:{'$ne':null}}})[_0xae8d('0x12')](function(_0xd4b992){var _0x561306=moment()[_0xae8d('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2385c7=0x0,_0x369da0=_0xd4b992[_0xae8d('0x2f')];_0x2385c7<_0x369da0;_0x2385c7+=0x1){_0xd4b992[_0x2385c7][_0xae8d('0x31')]({'exitAt':_0x561306});}});for(var _0x31255d=0x0;_0x31255d<_0xbdf56a[_0xae8d('0x29')][_0xae8d('0x2a')][_0x5700b6][_0xae8d('0x2f')];_0x31255d+=0x1){db['MemberReport'][_0xae8d('0x32')]({'where':{'channel':_0x5700b6,'membername':_0xbdf56a['user'][_0xae8d('0xc')],'type':_0xae8d('0x2e'),'uniqueid':_0xbdf56a['body'][_0xae8d('0x2a')][_0x5700b6][_0x31255d],'exitAt':null},'defaults':{'channel':_0x5700b6,'membername':_0xbdf56a['user']['name'],'interface':_[_0xae8d('0xe')](_0xbdf56a[_0xae8d('0x2b')]['interface'])?util[_0xae8d('0x30')]('SIP/%s',_0xbdf56a[_0xae8d('0x2b')]['name']):_0xbdf56a[_0xae8d('0x2b')][_0xae8d('0x33')],'type':'INTERACTION','enterAt':moment()['format'](_0xae8d('0x34')),'role':'agent','internal':_0xbdf56a[_0xae8d('0x2b')][_0xae8d('0x35')],'uniqueid':_0xbdf56a['body'][_0xae8d('0x2a')][_0x5700b6][_0x31255d]}});}}}}return respondWithRpcPromise(_0xae8d('0x36'),{'id':_0xbdf56a[_0xae8d('0x17')]['id'],'capacity':_0xbdf56a[_0xae8d('0x29')][_0xae8d('0x37')]},routingClient)[_0xae8d('0x12')](respondWithResult(_0x1fa357,null))[_0xae8d('0xa')](handleError(_0x1fa357,null));};exports['telephones']=function(_0x4ad561,_0x1df481){return respondWithRpcPromise(_0xae8d('0x38'),_0x4ad561['query'])[_0xae8d('0x12')](respondWithResult(_0x1df481,null))['catch'](handleError(_0x1df481,null));};exports['trunks']=function(_0x42c701,_0x41bfab){return respondWithRpcPromise(_0xae8d('0x39'),_0x42c701[_0xae8d('0x16')])[_0xae8d('0x12')](respondWithResult(_0x41bfab,null))['catch'](handleError(_0x41bfab,null));};exports['campaigns']=function(_0x8060a5,_0x21d8ed){return respondWithRpcPromise(_0xae8d('0x3a'),_0x8060a5[_0xae8d('0x16')])['then'](respondWithResult(_0x21d8ed,null))[_0xae8d('0xa')](handleError(_0x21d8ed,null));};exports['chatQueues']=function(_0x507c39,_0x2df7af){return respondWithRpcPromise(_0xae8d('0x3b'),_0x507c39[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](respondWithResult(_0x2df7af,null))[_0xae8d('0xa')](handleError(_0x2df7af,null));};exports['showChatQueues']=function(_0x1b21fa,_0x49cc29){return respondWithRpcPromise('ChatQueues',_0x1b21fa[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](findById(_0x1b21fa[_0xae8d('0x17')]['id']))['then'](respondWithResult(_0x49cc29,null))[_0xae8d('0xa')](handleError(_0x49cc29,null));};exports[_0xae8d('0x3c')]=function(_0x3c1fad,_0x4b3024){return respondWithRpcPromise(_0xae8d('0x3d'),_0x3c1fad['query'],routingClient)[_0xae8d('0x12')](respondWithResult(_0x4b3024,null))[_0xae8d('0xa')](handleError(_0x4b3024,null));};exports[_0xae8d('0x3e')]=function(_0x825b7b,_0x384ee4){return respondWithRpcPromise('MailQueues',_0x825b7b['query'],routingClient)[_0xae8d('0x12')](findById(_0x825b7b[_0xae8d('0x17')]['id']))['then'](respondWithResult(_0x384ee4,null))[_0xae8d('0xa')](handleError(_0x384ee4,null));};exports['mailAccounts']=function(_0x23ed9e,_0xc50f53){return respondWithRpcPromise(_0xae8d('0x3f'),_0x23ed9e[_0xae8d('0x16')],mailClient)[_0xae8d('0x12')](respondWithResult(_0xc50f53,null))[_0xae8d('0xa')](handleError(_0xc50f53,null));};exports[_0xae8d('0x40')]=function(_0x40ef78,_0x41e5de){return respondWithRpcPromise(_0xae8d('0x41'),_0x40ef78[_0xae8d('0x16')],routingClient)['then'](respondWithResult(_0x41e5de,null))[_0xae8d('0xa')](handleError(_0x41e5de,null));};exports['showOpenchannelQueues']=function(_0x4e6dfb,_0xa9d46a){return respondWithRpcPromise(_0xae8d('0x41'),_0x4e6dfb['query'],routingClient)['then'](findById(_0x4e6dfb[_0xae8d('0x17')]['id']))[_0xae8d('0x12')](respondWithResult(_0xa9d46a,null))[_0xae8d('0xa')](handleError(_0xa9d46a,null));};exports[_0xae8d('0x42')]=function(_0x3bd7e5,_0x9c1766){return respondWithRpcPromise(_0xae8d('0x43'),_0x3bd7e5[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](respondWithResult(_0x9c1766,null))[_0xae8d('0xa')](handleError(_0x9c1766,null));};exports[_0xae8d('0x44')]=function(_0x9a620f,_0x16bbe6){return respondWithRpcPromise('SmsQueues',_0x9a620f[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](findById(_0x9a620f[_0xae8d('0x17')]['id']))[_0xae8d('0x12')](respondWithResult(_0x16bbe6,null))[_0xae8d('0xa')](handleError(_0x16bbe6,null));};exports[_0xae8d('0x45')]=function(_0x28187d,_0x3b99b7){return respondWithRpcPromise(_0xae8d('0x46'),_0x28187d[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](respondWithResult(_0x3b99b7,null))[_0xae8d('0xa')](handleError(_0x3b99b7,null));};exports[_0xae8d('0x47')]=function(_0x1d0d77,_0x2b23de){return respondWithRpcPromise(_0xae8d('0x46'),_0x1d0d77[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](findById(_0x1d0d77['params']['id']))[_0xae8d('0x12')](respondWithResult(_0x2b23de,null))['catch'](handleError(_0x2b23de,null));};exports[_0xae8d('0x48')]=function(_0x5b17f2,_0x1da6a9){return respondWithRpcPromise(_0xae8d('0x49'),_0x5b17f2[_0xae8d('0x16')],routingClient)['then'](respondWithResult(_0x1da6a9,null))['catch'](handleError(_0x1da6a9,null));};exports[_0xae8d('0x4a')]=function(_0x3cc29b,_0x49eb8e){return respondWithRpcPromise(_0xae8d('0x49'),_0x3cc29b[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](findById(_0x3cc29b[_0xae8d('0x17')]['id']))[_0xae8d('0x12')](respondWithResult(_0x49eb8e,null))['catch'](handleError(_0x49eb8e,null));};exports['faxAccounts']=function(_0x4480a3,_0x580301){return respondWithRpcPromise(_0xae8d('0x4b'),_0x4480a3['query'])[_0xae8d('0x12')](respondWithResult(_0x580301,null))[_0xae8d('0xa')](handleError(_0x580301,null));};exports[_0xae8d('0x4c')]=function(_0x284f69,_0x2f94f0){return respondWithRpcPromise(_0xae8d('0x4d'),_0x284f69[_0xae8d('0x16')],routingClient)['then'](respondWithResult(_0x2f94f0,null))['catch'](handleError(_0x2f94f0,null));};exports['mailQueuesWaitingInteractions']=function(_0x12a252,_0x58dca2){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x12a252['query'],routingClient)['then'](respondWithResult(_0x58dca2,null))[_0xae8d('0xa')](handleError(_0x58dca2,null));};exports[_0xae8d('0x4e')]=function(_0x53c314,_0x5d65c6){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x53c314['query'],routingClient)[_0xae8d('0x12')](respondWithResult(_0x5d65c6,null))[_0xae8d('0xa')](handleError(_0x5d65c6,null));};exports[_0xae8d('0x4f')]=function(_0x320c76,_0x52312e){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x320c76[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](respondWithResult(_0x52312e,null))[_0xae8d('0xa')](handleError(_0x52312e,null));};exports[_0xae8d('0x50')]=function(_0x46547d,_0x361b53){return respondWithRpcPromise(_0xae8d('0x51'),_0x46547d[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](respondWithResult(_0x361b53,null))[_0xae8d('0xa')](handleError(_0x361b53,null));};exports[_0xae8d('0x52')]=function(_0x291c16,_0x5205dd){return respondWithRpcPromise(_0xae8d('0x53'),_0x291c16[_0xae8d('0x16')],routingClient)[_0xae8d('0x12')](respondWithResult(_0x5205dd,null))[_0xae8d('0xa')](handleError(_0x5205dd,null));};exports[_0xae8d('0x54')]=function(_0x44edb5){return function(_0x41dc82,_0x272e7e){var _0x190d17,_0x51fd82;var _0x3e9d3f=_[_0xae8d('0x55')](_0x44edb5);var _0x422d31=_0x44edb5===_0xae8d('0x56')?_0xae8d('0x57'):_0xae8d('0x58');return db[_0x3e9d3f+_0xae8d('0x59')]['findOne']({'raw':!![],'where':{'id':_0x41dc82[_0xae8d('0x17')]['id']}})[_0xae8d('0x12')](function(_0x2b7e57){if(_[_0xae8d('0xe')](_0x2b7e57)){throw new Error(_0x3e9d3f+_0xae8d('0x5a'));}_0x190d17=_0x2b7e57;return db[_0x3e9d3f+'Message'][_0xae8d('0x5b')]({'where':{'id':_0x41dc82[_0xae8d('0x29')][_0xae8d('0x5c')]},'include':[{'model':db[_0x3e9d3f+_0xae8d('0x5d')],'as':_0xae8d('0x5d')},{'model':db[_0x3e9d3f+_0x422d31],'as':_0xae8d('0x58')}]});})['then'](function(_0x9f942f){if(_['isNil'](_0x9f942f)){throw new Error(_0x3e9d3f+_0xae8d('0x5e'));}_0x51fd82=_0x9f942f;return _0x9f942f[_0xae8d('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xae8d('0x12')](function(){var _0x1a6326={'uniqueid':_0x44edb5+'.'+_0x51fd82['id']+'.'+_0x51fd82[_0xae8d('0x5d')]['id'],'FromUserId':_0x41dc82[_0xae8d('0x2b')]['id'],'type':_0xae8d('0x60')};_0x1a6326[_0x3e9d3f+_0xae8d('0x61')]=_0x51fd82['id'];_0x1a6326[_0x3e9d3f+_0xae8d('0x62')]=_0x51fd82['Interaction']['id'];_0x1a6326[_0xae8d('0x63')+_0x3e9d3f+_0x422d31+'Id']=_0x51fd82[_0xae8d('0x58')]['id'];_0x1a6326['To'+_0x3e9d3f+_0xae8d('0x64')]=_0x190d17['id'];return db[_0x3e9d3f+_0xae8d('0x65')][_0xae8d('0x66')](_0x1a6326);})[_0xae8d('0x12')](function(){return respondWithRpcPromise(_0xae8d('0x67'),{'channel':_0x44edb5,'interaction':_0x51fd82[_0xae8d('0x5d')],'message':_0x51fd82,'account':_0x51fd82[_0xae8d('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':_0xae8d('0x60'),'appdata':_0x190d17[_0xae8d('0xc')]+','+(_0x51fd82[_0xae8d('0x58')][_0xae8d('0x68')]||0x12c),'interval':_0xae8d('0x69')}]},routingClient);})[_0xae8d('0x12')](respondWithResult(_0x272e7e,null))[_0xae8d('0xa')](handleError(_0x272e7e,null));};};exports['agentNotify']=function(_0x527a24,_0x433724){var _0x1eaa48,_0x29f8dd;if(_[_0xae8d('0xe')](_0x527a24[_0xae8d('0x29')][_0xae8d('0x6a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x36f340=_0x527a24[_0xae8d('0x29')][_0xae8d('0x6a')];var _0x212c5d=_['capitalize'](_0x36f340);var _0x42d109=_0x36f340===_0xae8d('0x56')?'Website':'Account';return db['User'][_0xae8d('0x5b')]({'raw':!![],'where':{'id':_0x527a24[_0xae8d('0x17')]['id'],'role':_0xae8d('0x6b')}})[_0xae8d('0x12')](function(_0x54ae67){if(_[_0xae8d('0xe')](_0x54ae67)){throw new Error(_0xae8d('0x6c'));}_0x1eaa48=_0x54ae67;return db[_0x212c5d+_0xae8d('0x6d')][_0xae8d('0x5b')]({'where':{'id':_0x527a24[_0xae8d('0x29')][_0xae8d('0x5c')]},'include':[{'model':db[_0x212c5d+_0xae8d('0x5d')],'as':_0xae8d('0x5d')},{'model':db[_0x212c5d+_0x42d109],'as':'Account'}]});})['then'](function(_0x317955){if(_[_0xae8d('0xe')](_0x317955)){throw new Error(_0x212c5d+_0xae8d('0x5e'));}_0x29f8dd=_0x317955;return _0x317955[_0xae8d('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x162d50={'uniqueid':_0x36f340+'.'+_0x29f8dd['id']+'.'+_0x29f8dd['Interaction']['id'],'FromUserId':_0x527a24[_0xae8d('0x2b')]['id'],'type':_0xae8d('0x60'),'ToUserId':_0x1eaa48['id']};_0x162d50[_0x212c5d+_0xae8d('0x61')]=_0x29f8dd['id'];_0x162d50[_0x212c5d+_0xae8d('0x62')]=_0x29f8dd['Interaction']['id'];_0x162d50['From'+_0x212c5d+_0x42d109+'Id']=_0x29f8dd[_0xae8d('0x58')]['id'];return db[_0x212c5d+_0xae8d('0x65')][_0xae8d('0x66')](_0x162d50);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x36f340,'interaction':_0x29f8dd[_0xae8d('0x5d')],'message':_0x29f8dd,'account':_0x29f8dd[_0xae8d('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1eaa48[_0xae8d('0xc')]+','+(_0x29f8dd['Account']['agentTransferTimeout']||0x12c),'interval':_0xae8d('0x69')}]},routingClient);})['then'](respondWithResult(_0x433724,null))[_0xae8d('0xa')](handleError(_0x433724,null));};
\ No newline at end of file
index 3bd5d93..0b399a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bd5=['run','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','./schedule.controller','get','index','show','/:id/run','isAuthenticated'];(function(_0x5ed644,_0x122e0c){var _0xf13b4f=function(_0x38f3f4){while(--_0x38f3f4){_0x5ed644['push'](_0x5ed644['shift']());}};_0xf13b4f(++_0x122e0c);}(_0x9bd5,0x10d));var _0x59bd=function(_0x3cb6b4,_0x38d007){_0x3cb6b4=_0x3cb6b4-0x0;var _0x475487=_0x9bd5[_0x3cb6b4];return _0x475487;};'use strict';var multer=require('multer');var util=require(_0x59bd('0x0'));var path=require('path');var timeout=require(_0x59bd('0x1'));var express=require(_0x59bd('0x2'));var router=express[_0x59bd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x59bd('0x4'));var config=require('../../config/environment');var controller=require(_0x59bd('0x5'));router[_0x59bd('0x6')]('/',auth['isAuthenticated'](),controller[_0x59bd('0x7')]);router[_0x59bd('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x59bd('0x8')]);router[_0x59bd('0x6')](_0x59bd('0x9'),auth[_0x59bd('0xa')](),controller[_0x59bd('0xb')]);router[_0x59bd('0xc')]('/',auth[_0x59bd('0xa')](),controller[_0x59bd('0xd')]);router[_0x59bd('0xe')](_0x59bd('0xf'),auth[_0x59bd('0xa')](),controller[_0x59bd('0x10')]);router[_0x59bd('0x11')](_0x59bd('0xf'),auth['isAuthenticated'](),controller[_0x59bd('0x12')]);module[_0x59bd('0x13')]=router;
\ No newline at end of file
+var _0x27cd=['/:id','multer','util','express','Router','get','isAuthenticated','index','show','/:id/run','run','post','create','put','update'];(function(_0x28be64,_0x48c7c5){var _0x3d92ec=function(_0x4c8a1a){while(--_0x4c8a1a){_0x28be64['push'](_0x28be64['shift']());}};_0x3d92ec(++_0x48c7c5);}(_0x27cd,0x100));var _0xd27c=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x27cd[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0xd27c('0x0'));var util=require(_0xd27c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd27c('0x2'));var router=express[_0xd27c('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0xd27c('0x4')]('/',auth[_0xd27c('0x5')](),controller[_0xd27c('0x6')]);router[_0xd27c('0x4')]('/:id',auth[_0xd27c('0x5')](),controller[_0xd27c('0x7')]);router[_0xd27c('0x4')](_0xd27c('0x8'),auth['isAuthenticated'](),controller[_0xd27c('0x9')]);router[_0xd27c('0xa')]('/',auth['isAuthenticated'](),controller[_0xd27c('0xb')]);router[_0xd27c('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xd27c('0xd')]);router['delete'](_0xd27c('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index cde4286..df14a24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2ac=['ENUM','years','quarters','weeks','days','pdf','xlsx','csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER'];(function(_0x4ffab9,_0x23fa7c){var _0x5abbb0=function(_0x4a96fb){while(--_0x4a96fb){_0x4ffab9['push'](_0x4ffab9['shift']());}};_0x5abbb0(++_0x23fa7c);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x12b11e,_0x976c67){_0x12b11e=_0x12b11e-0x0;var _0x4dae20=_0xb2ac[_0x12b11e];return _0x4dae20;};'use strict';var Sequelize=require(_0xcb2a('0x0'));module[_0xcb2a('0x1')]={'name':{'type':Sequelize[_0xcb2a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcb2a('0x2')]},'active':{'type':Sequelize[_0xcb2a('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xcb2a('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xcb2a('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xcb2a('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xcb2a('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xcb2a('0x6')](_0xcb2a('0x7'),_0xcb2a('0x8'),'months',_0xcb2a('0x9'),_0xcb2a('0xa'),'hours','minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xcb2a('0x6')]('csv',_0xcb2a('0xb'),_0xcb2a('0xc')),'allowNull':![],'defaultValue':_0xcb2a('0xd')},'type':{'type':Sequelize[_0xcb2a('0x6')](_0xcb2a('0xe'),'default'),'allowNull':![],'defaultValue':_0xcb2a('0xe')},'sendMail':{'type':Sequelize[_0xcb2a('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xcb2a('0xf')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xfdbd=['default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','minutes','days','csv','pdf','xlsx','custom'];(function(_0x16eef6,_0x57479d){var _0x1f0285=function(_0x2e07a6){while(--_0x2e07a6){_0x16eef6['push'](_0x16eef6['shift']());}};_0x1f0285(++_0x57479d);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0xfdbd[_0x43d16c];return _0x208cce;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'active':{'type':Sequelize[_0xdfdb('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![],'defaultValue':_0xdfdb('0x4')},'startAt':{'type':Sequelize[_0xdfdb('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xdfdb('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xdfdb('0x6')]('years',_0xdfdb('0x7'),_0xdfdb('0x8'),'weeks','days','hours',_0xdfdb('0x9')),'allowNull':![],'defaultValue':_0xdfdb('0xa')},'output':{'type':Sequelize['ENUM'](_0xdfdb('0xb'),_0xdfdb('0xc'),_0xdfdb('0xd')),'allowNull':![],'defaultValue':_0xdfdb('0xb')},'type':{'type':Sequelize[_0xdfdb('0x6')](_0xdfdb('0xe'),_0xdfdb('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xdfdb('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xdfdb('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xdfdb('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xdfdb('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 36cd869..f9520b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc58b=['../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','json','apply','reject','save','get','destroy','then','error','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','catch','keys','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x222bd3,_0x4c9a4f){var _0x4bed46=function(_0x4a0261){while(--_0x4a0261){_0x222bd3['push'](_0x222bd3['shift']());}};_0x4bed46(++_0x4c9a4f);}(_0xc58b,0x17a));var _0xbc58=function(_0x3f0919,_0x44f104){_0x3f0919=_0x3f0919-0x0;var _0x8532d1=_0xc58b[_0x3f0919];return _0x8532d1;};'use strict';var pdf=require(_0xbc58('0x0'));var emlformat=require(_0xbc58('0x1'));var rimraf=require(_0xbc58('0x2'));var zipdir=require(_0xbc58('0x3'));var jsonpatch=require(_0xbc58('0x4'));var rp=require(_0xbc58('0x5'));var moment=require(_0xbc58('0x6'));var BPromise=require(_0xbc58('0x7'));var Mustache=require(_0xbc58('0x8'));var util=require(_0xbc58('0x9'));var path=require(_0xbc58('0xa'));var sox=require(_0xbc58('0xb'));var csv=require(_0xbc58('0xc'));var ejs=require(_0xbc58('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbc58('0xe'));var jsforce=require(_0xbc58('0xf'));var deskjs=require(_0xbc58('0x10'));var toCsv=require(_0xbc58('0xc'));var querystring=require(_0xbc58('0x11'));var Papa=require(_0xbc58('0x12'));var Redis=require(_0xbc58('0x13'));var authService=require(_0xbc58('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xbc58('0x15'));var hardwareService=require(_0xbc58('0x16'));var logger=require(_0xbc58('0x17'))('api');var utils=require(_0xbc58('0x18'));var config=require('../../config/environment');var db=require(_0xbc58('0x19'))['db'];function respondWithStatusCode(_0xd8afd,_0x1f3c0c){_0x1f3c0c=_0x1f3c0c||0xcc;return function(_0x34918a){if(_0x34918a){return _0xd8afd[_0xbc58('0x1a')](_0x1f3c0c);}return _0xd8afd['status'](_0x1f3c0c)[_0xbc58('0x1b')]();};}function respondWithResult(_0x346eca,_0x349045){_0x349045=_0x349045||0xc8;return function(_0xb86581){if(_0xb86581){return _0x346eca[_0xbc58('0x1c')](_0x349045)['json'](_0xb86581);}};}function respondWithFilteredResult(_0x409325,_0x3c5963){return function(_0x11b926){if(_0x11b926){var _0x3733e8=_0x11b926[_0xbc58('0x1d')],_0x36c92e=_0x3c5963[_0xbc58('0x1e')],_0x26742c=_0x3c5963['offset']+_0x3c5963[_0xbc58('0x1f')],_0x8a210;if(_0x26742c>=_0x3733e8){_0x26742c=_0x3733e8;_0x8a210=0xc8;}else{_0x8a210=0xce;}_0x409325[_0xbc58('0x1c')](_0x8a210);return _0x409325['set']('Content-Range',_0x36c92e+'-'+_0x26742c+'/'+_0x3733e8)[_0xbc58('0x20')](_0x11b926);}return null;};}function patchUpdates(_0x14c295){return function(_0x6f6d18){try{jsonpatch[_0xbc58('0x21')](_0x6f6d18,_0x14c295,!![]);}catch(_0x587754){return BPromise[_0xbc58('0x22')](_0x587754);}return _0x6f6d18[_0xbc58('0x23')]();};}function saveUpdates(_0x53183c,_0x1d248a){return function(_0xfcd197){if(_0xfcd197){return _0xfcd197['update'](_0x53183c)['then'](function(_0x39a5b8){return _0x39a5b8;});}return null;};}function removeEntity(_0x37aa14,_0x1b15f8){return function(_0x18b79b){if(_0x18b79b){return _0x18b79b['destroy']()['then'](function(){var _0x43e508=_0x18b79b[_0xbc58('0x24')]({'plain':!![]});var _0x2e682e='Scheduler';return db['UserProfileResource'][_0xbc58('0x25')]({'where':{'type':_0x2e682e,'resourceId':_0x43e508['id']}})[_0xbc58('0x26')](function(){return _0x18b79b;});})[_0xbc58('0x26')](function(){_0x37aa14[_0xbc58('0x1c')](0xcc)[_0xbc58('0x1b')]();});}};}function handleEntityNotFound(_0x4a38fa,_0x34ad48){return function(_0x46c4d7){if(!_0x46c4d7){_0x4a38fa[_0xbc58('0x1a')](0x194);}return _0x46c4d7;};}function handleError(_0x6199bc,_0x37a559){_0x37a559=_0x37a559||0x1f4;return function(_0x332512){logger[_0xbc58('0x27')](_0x332512['stack']);if(_0x332512[_0xbc58('0x28')]){delete _0x332512[_0xbc58('0x28')];}_0x6199bc[_0xbc58('0x1c')](_0x37a559)[_0xbc58('0x29')](_0x332512);};}exports[_0xbc58('0x2a')]=function(_0x330c1c,_0x45b734){var _0xe3b559={},_0x5b155a={},_0x189ed0={'count':0x0,'rows':[]};var _0xcbe209=_[_0xbc58('0x2b')](db[_0xbc58('0x2c')][_0xbc58('0x2d')],function(_0x28164c){return{'name':_0x28164c[_0xbc58('0x2e')],'type':_0x28164c[_0xbc58('0x2f')][_0xbc58('0x30')]};});_0x5b155a[_0xbc58('0x31')]=_[_0xbc58('0x2b')](_0xcbe209,_0xbc58('0x28'));_0x5b155a[_0xbc58('0x32')]=_['keys'](_0x330c1c[_0xbc58('0x32')]);_0x5b155a['filters']=_[_0xbc58('0x33')](_0x5b155a[_0xbc58('0x31')],_0x5b155a[_0xbc58('0x32')]);_0xe3b559[_0xbc58('0x34')]=_['intersection'](_0x5b155a[_0xbc58('0x31')],qs[_0xbc58('0x35')](_0x330c1c[_0xbc58('0x32')][_0xbc58('0x35')]));_0xe3b559[_0xbc58('0x34')]=_0xe3b559['attributes'][_0xbc58('0x36')]?_0xe3b559[_0xbc58('0x34')]:_0x5b155a['model'];if(!_0x330c1c[_0xbc58('0x32')]['hasOwnProperty']('nolimit')){_0xe3b559[_0xbc58('0x1f')]=qs[_0xbc58('0x1f')](_0x330c1c[_0xbc58('0x32')]['limit']);_0xe3b559['offset']=qs[_0xbc58('0x1e')](_0x330c1c['query'][_0xbc58('0x1e')]);}_0xe3b559[_0xbc58('0x37')]=qs[_0xbc58('0x38')](_0x330c1c[_0xbc58('0x32')]['sort']);_0xe3b559[_0xbc58('0x39')]=qs[_0xbc58('0x3a')](_[_0xbc58('0x3b')](_0x330c1c['query'],_0x5b155a['filters']),_0xcbe209);if(_0x330c1c['query'][_0xbc58('0x3c')]){_0xe3b559[_0xbc58('0x39')]=_['merge'](_0xe3b559[_0xbc58('0x39')],{'$or':_[_0xbc58('0x2b')](_0xcbe209,function(_0x376b05){if(_0x376b05[_0xbc58('0x2f')]!=='VIRTUAL'){var _0x4d1b9b={};_0x4d1b9b[_0x376b05[_0xbc58('0x28')]]={'$like':'%'+_0x330c1c[_0xbc58('0x32')][_0xbc58('0x3c')]+'%'};return _0x4d1b9b;}})});}_0xe3b559=_['merge']({},_0xe3b559,_0x330c1c[_0xbc58('0x3d')]);var _0x425fef={'where':_0xe3b559[_0xbc58('0x39')]};return db[_0xbc58('0x2c')][_0xbc58('0x1d')](_0x425fef)['then'](function(_0x40608b){_0x189ed0[_0xbc58('0x1d')]=_0x40608b;if(_0x330c1c[_0xbc58('0x32')][_0xbc58('0x3e')]){_0xe3b559[_0xbc58('0x3f')]=[{'all':!![]}];}return db[_0xbc58('0x2c')][_0xbc58('0x40')](_0xe3b559);})[_0xbc58('0x26')](function(_0x406863){_0x189ed0[_0xbc58('0x41')]=_0x406863;return _0x189ed0;})['then'](respondWithFilteredResult(_0x45b734,_0xe3b559))[_0xbc58('0x42')](handleError(_0x45b734,null));};exports['show']=function(_0x43bdf4,_0x4b6588){var _0x3d39fd={'raw':![],'where':{'id':_0x43bdf4['params']['id']}},_0x31ba74={};_0x31ba74[_0xbc58('0x31')]=_['keys'](db['Schedule'][_0xbc58('0x2d')]);_0x31ba74[_0xbc58('0x32')]=_[_0xbc58('0x43')](_0x43bdf4[_0xbc58('0x32')]);_0x31ba74[_0xbc58('0x3a')]=_[_0xbc58('0x33')](_0x31ba74[_0xbc58('0x31')],_0x31ba74[_0xbc58('0x32')]);_0x3d39fd[_0xbc58('0x34')]=_['intersection'](_0x31ba74[_0xbc58('0x31')],qs[_0xbc58('0x35')](_0x43bdf4['query'][_0xbc58('0x35')]));_0x3d39fd[_0xbc58('0x34')]=_0x3d39fd[_0xbc58('0x34')][_0xbc58('0x36')]?_0x3d39fd[_0xbc58('0x34')]:_0x31ba74[_0xbc58('0x31')];if(_0x43bdf4['query'][_0xbc58('0x3e')]){_0x3d39fd[_0xbc58('0x3f')]=[{'all':!![]}];}_0x3d39fd=_[_0xbc58('0x44')]({},_0x3d39fd,_0x43bdf4['options']);return db[_0xbc58('0x2c')][_0xbc58('0x45')](_0x3d39fd)[_0xbc58('0x26')](handleEntityNotFound(_0x4b6588,null))['then'](respondWithResult(_0x4b6588,null))['catch'](handleError(_0x4b6588,null));};exports[_0xbc58('0x46')]=function(_0x1a143b,_0x44f703){return db[_0xbc58('0x2c')][_0xbc58('0x46')](_0x1a143b[_0xbc58('0x47')],{})[_0xbc58('0x26')](function(_0x438fd0){var _0xee3c7a=_0x1a143b['user'][_0xbc58('0x24')]({'plain':!![]});if(!_0xee3c7a)throw new Error(_0xbc58('0x48'));if(_0xee3c7a[_0xbc58('0x49')]==='user'){var _0x516365=_0x438fd0['get']({'plain':!![]});var _0x287cff='Scheduler';return db[_0xbc58('0x4a')][_0xbc58('0x45')]({'where':{'name':_0x287cff,'userProfileId':_0xee3c7a[_0xbc58('0x4b')]},'raw':!![]})[_0xbc58('0x26')](function(_0x30e9e8){if(_0x30e9e8&&_0x30e9e8[_0xbc58('0x4c')]===0x0){return db['UserProfileResource'][_0xbc58('0x46')]({'name':_0x516365['name'],'resourceId':_0x516365['id'],'type':_0x30e9e8[_0xbc58('0x28')],'sectionId':_0x30e9e8['id']},{})['then'](function(){return _0x438fd0;});}else{return _0x438fd0;}})['catch'](function(_0x1ae3a7){logger['error'](_0xbc58('0x4d'),_0x1ae3a7);throw _0x1ae3a7;});}return _0x438fd0;})['then'](respondWithResult(_0x44f703,0xc9))[_0xbc58('0x42')](handleError(_0x44f703,null));};exports['update']=function(_0x4631d4,_0x2ff2bd){if(_0x4631d4[_0xbc58('0x47')]['id']){delete _0x4631d4[_0xbc58('0x47')]['id'];}return db[_0xbc58('0x2c')]['find']({'where':{'id':_0x4631d4[_0xbc58('0x4e')]['id']}})[_0xbc58('0x26')](handleEntityNotFound(_0x2ff2bd,null))['then'](saveUpdates(_0x4631d4[_0xbc58('0x47')],null))[_0xbc58('0x26')](respondWithResult(_0x2ff2bd,null))[_0xbc58('0x42')](handleError(_0x2ff2bd,null));};exports['destroy']=function(_0x2cd403,_0xe079d9){return db['Schedule']['find']({'where':{'id':_0x2cd403[_0xbc58('0x4e')]['id']}})['then'](handleEntityNotFound(_0xe079d9,null))[_0xbc58('0x26')](removeEntity(_0xe079d9,null))[_0xbc58('0x42')](handleError(_0xe079d9,null));};exports[_0xbc58('0x4f')]=function(_0x35f140,_0x4a398a,_0x377343){var _0x27d06f=require('../../config/schedule');return db[_0xbc58('0x2c')][_0xbc58('0x45')]({'where':{'id':_0x35f140[_0xbc58('0x4e')]['id']},'raw':!![]})[_0xbc58('0x26')](handleEntityNotFound(_0x4a398a,null))[_0xbc58('0x26')](function(){_0x27d06f[_0xbc58('0x4f')](_0x35f140['params']['id']);})[_0xbc58('0x26')](respondWithStatusCode(_0x4a398a,null))['catch'](handleError(_0x4a398a,null));};
\ No newline at end of file
+var _0xf23d=['key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','Schedule','findAll','show','length','includeAll','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','end','name','send','index','rawAttributes','fieldName','type'];(function(_0x4446d3,_0x405295){var _0x3bec74=function(_0x54ceee){while(--_0x54ceee){_0x4446d3['push'](_0x4446d3['shift']());}};_0x3bec74(++_0x405295);}(_0xf23d,0xcc));var _0xdf23=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xf23d[_0x352e09];return _0x1b7094;};'use strict';var pdf=require(_0xdf23('0x0'));var emlformat=require(_0xdf23('0x1'));var rimraf=require(_0xdf23('0x2'));var zipdir=require(_0xdf23('0x3'));var jsonpatch=require(_0xdf23('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdf23('0x5'));var Mustache=require('mustache');var util=require(_0xdf23('0x6'));var path=require(_0xdf23('0x7'));var sox=require(_0xdf23('0x8'));var csv=require(_0xdf23('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf23('0xa'));var squel=require(_0xdf23('0xb'));var crypto=require(_0xdf23('0xc'));var jsforce=require(_0xdf23('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdf23('0x9'));var querystring=require(_0xdf23('0xe'));var Papa=require(_0xdf23('0xf'));var Redis=require(_0xdf23('0x10'));var authService=require(_0xdf23('0x11'));var qs=require(_0xdf23('0x12'));var as=require(_0xdf23('0x13'));var hardwareService=require(_0xdf23('0x14'));var logger=require(_0xdf23('0x15'))(_0xdf23('0x16'));var utils=require(_0xdf23('0x17'));var config=require(_0xdf23('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28230b,_0x7f426b){_0x7f426b=_0x7f426b||0xcc;return function(_0x3c5ea1){if(_0x3c5ea1){return _0x28230b[_0xdf23('0x19')](_0x7f426b);}return _0x28230b[_0xdf23('0x1a')](_0x7f426b)['end']();};}function respondWithResult(_0x3967c4,_0x58b64d){_0x58b64d=_0x58b64d||0xc8;return function(_0x416b1a){if(_0x416b1a){return _0x3967c4[_0xdf23('0x1a')](_0x58b64d)['json'](_0x416b1a);}};}function respondWithFilteredResult(_0x301ebf,_0x590be5){return function(_0x5bd873){if(_0x5bd873){var _0x4006ad=_0x5bd873[_0xdf23('0x1b')],_0x2c8977=_0x590be5[_0xdf23('0x1c')],_0x349899=_0x590be5[_0xdf23('0x1c')]+_0x590be5['limit'],_0x5a0b22;if(_0x349899>=_0x4006ad){_0x349899=_0x4006ad;_0x5a0b22=0xc8;}else{_0x5a0b22=0xce;}_0x301ebf[_0xdf23('0x1a')](_0x5a0b22);return _0x301ebf[_0xdf23('0x1d')](_0xdf23('0x1e'),_0x2c8977+'-'+_0x349899+'/'+_0x4006ad)[_0xdf23('0x1f')](_0x5bd873);}return null;};}function patchUpdates(_0x42ffa0){return function(_0x17f289){try{jsonpatch[_0xdf23('0x20')](_0x17f289,_0x42ffa0,!![]);}catch(_0x3c35ce){return BPromise[_0xdf23('0x21')](_0x3c35ce);}return _0x17f289[_0xdf23('0x22')]();};}function saveUpdates(_0x967698,_0x2401bf){return function(_0x4e9038){if(_0x4e9038){return _0x4e9038[_0xdf23('0x23')](_0x967698)[_0xdf23('0x24')](function(_0x280640){return _0x280640;});}return null;};}function removeEntity(_0x38c063,_0x10b5f5){return function(_0x4de31b){if(_0x4de31b){return _0x4de31b[_0xdf23('0x25')]()['then'](function(){var _0x2a397b=_0x4de31b[_0xdf23('0x26')]({'plain':!![]});var _0x188e7a=_0xdf23('0x27');return db[_0xdf23('0x28')]['destroy']({'where':{'type':_0x188e7a,'resourceId':_0x2a397b['id']}})[_0xdf23('0x24')](function(){return _0x4de31b;});})[_0xdf23('0x24')](function(){_0x38c063['status'](0xcc)[_0xdf23('0x29')]();});}};}function handleEntityNotFound(_0x50063a,_0x35b31a){return function(_0x32b5d2){if(!_0x32b5d2){_0x50063a[_0xdf23('0x19')](0x194);}return _0x32b5d2;};}function handleError(_0xb26699,_0x119503){_0x119503=_0x119503||0x1f4;return function(_0x2d1a92){logger['error'](_0x2d1a92['stack']);if(_0x2d1a92[_0xdf23('0x2a')]){delete _0x2d1a92[_0xdf23('0x2a')];}_0xb26699['status'](_0x119503)[_0xdf23('0x2b')](_0x2d1a92);};}exports[_0xdf23('0x2c')]=function(_0x3a7340,_0x5b54a9){var _0x16903d={},_0x3ee542={},_0x195b9c={'count':0x0,'rows':[]};var _0x3e8a8f=_['map'](db['Schedule'][_0xdf23('0x2d')],function(_0x21b35a){return{'name':_0x21b35a[_0xdf23('0x2e')],'type':_0x21b35a[_0xdf23('0x2f')][_0xdf23('0x30')]};});_0x3ee542[_0xdf23('0x31')]=_[_0xdf23('0x32')](_0x3e8a8f,'name');_0x3ee542[_0xdf23('0x33')]=_[_0xdf23('0x34')](_0x3a7340[_0xdf23('0x33')]);_0x3ee542[_0xdf23('0x35')]=_['intersection'](_0x3ee542['model'],_0x3ee542['query']);_0x16903d['attributes']=_[_0xdf23('0x36')](_0x3ee542[_0xdf23('0x31')],qs['fields'](_0x3a7340[_0xdf23('0x33')][_0xdf23('0x37')]));_0x16903d['attributes']=_0x16903d[_0xdf23('0x38')]['length']?_0x16903d['attributes']:_0x3ee542[_0xdf23('0x31')];if(!_0x3a7340['query'][_0xdf23('0x39')]('nolimit')){_0x16903d['limit']=qs['limit'](_0x3a7340[_0xdf23('0x33')]['limit']);_0x16903d[_0xdf23('0x1c')]=qs[_0xdf23('0x1c')](_0x3a7340[_0xdf23('0x33')]['offset']);}_0x16903d['order']=qs[_0xdf23('0x3a')](_0x3a7340[_0xdf23('0x33')]['sort']);_0x16903d[_0xdf23('0x3b')]=qs['filters'](_['pick'](_0x3a7340[_0xdf23('0x33')],_0x3ee542['filters']),_0x3e8a8f);if(_0x3a7340[_0xdf23('0x33')][_0xdf23('0x3c')]){_0x16903d['where']=_[_0xdf23('0x3d')](_0x16903d['where'],{'$or':_[_0xdf23('0x32')](_0x3e8a8f,function(_0x476d1b){if(_0x476d1b[_0xdf23('0x2f')]!==_0xdf23('0x3e')){var _0xab7dc8={};_0xab7dc8[_0x476d1b['name']]={'$like':'%'+_0x3a7340[_0xdf23('0x33')][_0xdf23('0x3c')]+'%'};return _0xab7dc8;}})});}_0x16903d=_[_0xdf23('0x3d')]({},_0x16903d,_0x3a7340[_0xdf23('0x3f')]);var _0x4d29a7={'where':_0x16903d[_0xdf23('0x3b')]};return db[_0xdf23('0x40')]['count'](_0x4d29a7)[_0xdf23('0x24')](function(_0x4fdda1){_0x195b9c['count']=_0x4fdda1;if(_0x3a7340['query']['includeAll']){_0x16903d['include']=[{'all':!![]}];}return db[_0xdf23('0x40')][_0xdf23('0x41')](_0x16903d);})[_0xdf23('0x24')](function(_0x32f26d){_0x195b9c['rows']=_0x32f26d;return _0x195b9c;})[_0xdf23('0x24')](respondWithFilteredResult(_0x5b54a9,_0x16903d))['catch'](handleError(_0x5b54a9,null));};exports[_0xdf23('0x42')]=function(_0x3dd7f6,_0x19bfd1){var _0x23ff57={'raw':![],'where':{'id':_0x3dd7f6['params']['id']}},_0x51909a={};_0x51909a['model']=_[_0xdf23('0x34')](db[_0xdf23('0x40')]['rawAttributes']);_0x51909a[_0xdf23('0x33')]=_[_0xdf23('0x34')](_0x3dd7f6[_0xdf23('0x33')]);_0x51909a[_0xdf23('0x35')]=_[_0xdf23('0x36')](_0x51909a[_0xdf23('0x31')],_0x51909a[_0xdf23('0x33')]);_0x23ff57[_0xdf23('0x38')]=_[_0xdf23('0x36')](_0x51909a[_0xdf23('0x31')],qs[_0xdf23('0x37')](_0x3dd7f6[_0xdf23('0x33')][_0xdf23('0x37')]));_0x23ff57['attributes']=_0x23ff57['attributes'][_0xdf23('0x43')]?_0x23ff57[_0xdf23('0x38')]:_0x51909a[_0xdf23('0x31')];if(_0x3dd7f6['query'][_0xdf23('0x44')]){_0x23ff57[_0xdf23('0x45')]=[{'all':!![]}];}_0x23ff57=_[_0xdf23('0x3d')]({},_0x23ff57,_0x3dd7f6[_0xdf23('0x3f')]);return db[_0xdf23('0x40')]['find'](_0x23ff57)['then'](handleEntityNotFound(_0x19bfd1,null))['then'](respondWithResult(_0x19bfd1,null))['catch'](handleError(_0x19bfd1,null));};exports['create']=function(_0x2bc70c,_0x30ec51){return db[_0xdf23('0x40')][_0xdf23('0x46')](_0x2bc70c[_0xdf23('0x47')],{})[_0xdf23('0x24')](function(_0x43c44a){var _0xc210c9=_0x2bc70c[_0xdf23('0x48')]['get']({'plain':!![]});if(!_0xc210c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc210c9[_0xdf23('0x49')]===_0xdf23('0x48')){var _0x200e00=_0x43c44a[_0xdf23('0x26')]({'plain':!![]});var _0x49f263=_0xdf23('0x27');return db[_0xdf23('0x4a')][_0xdf23('0x4b')]({'where':{'name':_0x49f263,'userProfileId':_0xc210c9[_0xdf23('0x4c')]},'raw':!![]})[_0xdf23('0x24')](function(_0x37192c){if(_0x37192c&&_0x37192c[_0xdf23('0x4d')]===0x0){return db[_0xdf23('0x28')][_0xdf23('0x46')]({'name':_0x200e00[_0xdf23('0x2a')],'resourceId':_0x200e00['id'],'type':_0x37192c[_0xdf23('0x2a')],'sectionId':_0x37192c['id']},{})[_0xdf23('0x24')](function(){return _0x43c44a;});}else{return _0x43c44a;}})[_0xdf23('0x4e')](function(_0x10532d){logger[_0xdf23('0x4f')](_0xdf23('0x50'),_0x10532d);throw _0x10532d;});}return _0x43c44a;})[_0xdf23('0x24')](respondWithResult(_0x30ec51,0xc9))[_0xdf23('0x4e')](handleError(_0x30ec51,null));};exports[_0xdf23('0x23')]=function(_0x40125d,_0x186f97){if(_0x40125d[_0xdf23('0x47')]['id']){delete _0x40125d[_0xdf23('0x47')]['id'];}return db[_0xdf23('0x40')][_0xdf23('0x4b')]({'where':{'id':_0x40125d['params']['id']}})[_0xdf23('0x24')](handleEntityNotFound(_0x186f97,null))[_0xdf23('0x24')](saveUpdates(_0x40125d[_0xdf23('0x47')],null))['then'](respondWithResult(_0x186f97,null))[_0xdf23('0x4e')](handleError(_0x186f97,null));};exports[_0xdf23('0x25')]=function(_0x4cd9ec,_0x47b8c){return db['Schedule']['find']({'where':{'id':_0x4cd9ec['params']['id']}})['then'](handleEntityNotFound(_0x47b8c,null))['then'](removeEntity(_0x47b8c,null))['catch'](handleError(_0x47b8c,null));};exports[_0xdf23('0x51')]=function(_0x5c690a,_0x1c44c2,_0x5815c2){var _0x1c9be0=require(_0xdf23('0x52'));return db[_0xdf23('0x40')][_0xdf23('0x4b')]({'where':{'id':_0x5c690a[_0xdf23('0x53')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1c44c2,null))[_0xdf23('0x24')](function(){_0x1c9be0['run'](_0x5c690a[_0xdf23('0x53')]['id']);})[_0xdf23('0x24')](respondWithStatusCode(_0x1c44c2,null))[_0xdf23('0x4e')](handleError(_0x1c44c2,null));};
\ No newline at end of file
index 4f1345d..edc960c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x435a=['./schedule.attributes','Schedule','tools_schedules','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x12283c,_0x379df9){var _0x536073=function(_0x1101a4){while(--_0x1101a4){_0x12283c['push'](_0x12283c['shift']());}};_0x536073(++_0x379df9);}(_0x435a,0x1d9));var _0xa435=function(_0x42a9fd,_0xe441ed){_0x42a9fd=_0x42a9fd-0x0;var _0xaf6e41=_0x435a[_0x42a9fd];return _0xaf6e41;};'use strict';var _=require(_0xa435('0x0'));var util=require(_0xa435('0x1'));var logger=require(_0xa435('0x2'))('api');var moment=require(_0xa435('0x3'));var BPromise=require(_0xa435('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa435('0x5'));var config=require(_0xa435('0x6'));var attributes=require(_0xa435('0x7'));module['exports']=function(_0x5d8a11,_0x412527){return _0x5d8a11['define'](_0xa435('0x8'),attributes,{'tableName':_0xa435('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2709=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','tools_schedules'];(function(_0x4f6883,_0x4c0061){var _0xe2ba1f=function(_0x5dd38b){while(--_0x5dd38b){_0x4f6883['push'](_0x4f6883['shift']());}};_0xe2ba1f(++_0x4c0061);}(_0x2709,0x78));var _0x9270=function(_0x33bdd8,_0x36fdac){_0x33bdd8=_0x33bdd8-0x0;var _0x337f78=_0x2709[_0x33bdd8];return _0x337f78;};'use strict';var _=require('lodash');var util=require(_0x9270('0x0'));var logger=require(_0x9270('0x1'))(_0x9270('0x2'));var moment=require(_0x9270('0x3'));var BPromise=require(_0x9270('0x4'));var rp=require(_0x9270('0x5'));var fs=require('fs');var path=require(_0x9270('0x6'));var rimraf=require('rimraf');var config=require(_0x9270('0x7'));var attributes=require(_0x9270('0x8'));module[_0x9270('0x9')]=function(_0x12e1db,_0x46b54b){return _0x12e1db[_0x9270('0xa')]('Schedule',attributes,{'tableName':_0x9270('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5019efb..27a2b14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75ab=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x38d76e,_0x13eede){var _0x467beb=function(_0x1c032c){while(--_0x1c032c){_0x38d76e['push'](_0x38d76e['shift']());}};_0x467beb(++_0x13eede);}(_0x75ab,0xa6));var _0xb75a=function(_0x58801e,_0x1f6819){_0x58801e=_0x58801e-0x0;var _0x264b57=_0x75ab[_0x58801e];return _0x264b57;};'use strict';var _=require(_0xb75a('0x0'));var util=require(_0xb75a('0x1'));var moment=require(_0xb75a('0x2'));var BPromise=require(_0xb75a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb75a('0x4'));var db=require(_0xb75a('0x5'))['db'];var utils=require(_0xb75a('0x6'));var logger=require('../../config/logger')(_0xb75a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb75a('0x8')][_0xb75a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46847a,_0x2581a2,_0x29bea4){return new BPromise(function(_0x250424,_0x57d8a6){return client['request'](_0x46847a,_0x29bea4)[_0xb75a('0xa')](function(_0x1853bd){logger[_0xb75a('0xb')](_0xb75a('0xc'),_0x2581a2,_0xb75a('0xd'));logger['debug'](_0xb75a('0xe'),_0x2581a2,_0xb75a('0xd'),JSON[_0xb75a('0xf')](_0x1853bd));if(_0x1853bd[_0xb75a('0x10')]){if(_0x1853bd[_0xb75a('0x10')]['code']===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x2581a2,_0x1853bd[_0xb75a('0x10')][_0xb75a('0x11')]);return _0x57d8a6(_0x1853bd[_0xb75a('0x10')]['message']);}logger[_0xb75a('0x10')]('Schedule,\x20%s,\x20%s',_0x2581a2,_0x1853bd[_0xb75a('0x10')][_0xb75a('0x11')]);return _0x250424(_0x1853bd['error'][_0xb75a('0x11')]);}else{logger[_0xb75a('0xb')]('Schedule,\x20%s,\x20%s',_0x2581a2,_0xb75a('0xd'));_0x250424(_0x1853bd[_0xb75a('0x12')][_0xb75a('0x11')]);}})[_0xb75a('0x13')](function(_0x346453){logger[_0xb75a('0x10')](_0xb75a('0xc'),_0x2581a2,_0x346453);_0x57d8a6(_0x346453);});});}
\ No newline at end of file
+var _0x6b0e=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\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','then','info'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x6b0e,0x141));var _0xe6b0=function(_0x514833,_0x4f691e){_0x514833=_0x514833-0x0;var _0x1879fb=_0x6b0e[_0x514833];return _0x1879fb;};'use strict';var _=require(_0xe6b0('0x0'));var util=require(_0xe6b0('0x1'));var moment=require(_0xe6b0('0x2'));var BPromise=require(_0xe6b0('0x3'));var rs=require(_0xe6b0('0x4'));var fs=require('fs');var Redis=require(_0xe6b0('0x5'));var db=require(_0xe6b0('0x6'))['db'];var utils=require(_0xe6b0('0x7'));var logger=require(_0xe6b0('0x8'))(_0xe6b0('0x9'));var config=require(_0xe6b0('0xa'));var jayson=require(_0xe6b0('0xb'));var client=jayson[_0xe6b0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5500,_0x26bfb9,_0x55d1c1){return new BPromise(function(_0x4fff4,_0x22d974){return client['request'](_0x1c5500,_0x55d1c1)[_0xe6b0('0xd')](function(_0x5937d7){logger[_0xe6b0('0xe')](_0xe6b0('0xf'),_0x26bfb9,_0xe6b0('0x10'));logger[_0xe6b0('0x11')](_0xe6b0('0x12'),_0x26bfb9,_0xe6b0('0x10'),JSON[_0xe6b0('0x13')](_0x5937d7));if(_0x5937d7[_0xe6b0('0x14')]){if(_0x5937d7[_0xe6b0('0x14')][_0xe6b0('0x15')]===0x1f4){logger[_0xe6b0('0x14')](_0xe6b0('0xf'),_0x26bfb9,_0x5937d7[_0xe6b0('0x14')][_0xe6b0('0x16')]);return _0x22d974(_0x5937d7[_0xe6b0('0x14')][_0xe6b0('0x16')]);}logger[_0xe6b0('0x14')]('Schedule,\x20%s,\x20%s',_0x26bfb9,_0x5937d7[_0xe6b0('0x14')][_0xe6b0('0x16')]);return _0x4fff4(_0x5937d7['error'][_0xe6b0('0x16')]);}else{logger[_0xe6b0('0xe')]('Schedule,\x20%s,\x20%s',_0x26bfb9,_0xe6b0('0x10'));_0x4fff4(_0x5937d7['result']['message']);}})[_0xe6b0('0x17')](function(_0x971561){logger[_0xe6b0('0x14')](_0xe6b0('0xf'),_0x26bfb9,_0x971561);_0x22d974(_0x971561);});});}
\ No newline at end of file
index c735b00..c2a0a17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93d5=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id/download','download','post','create','put'];(function(_0x2d68e2,_0x2feae3){var _0x5c6b8f=function(_0x1adf96){while(--_0x1adf96){_0x2d68e2['push'](_0x2d68e2['shift']());}};_0x5c6b8f(++_0x2feae3);}(_0x93d5,0x1e8));var _0x593d=function(_0x342033,_0x2070b1){_0x342033=_0x342033-0x0;var _0x2409b4=_0x93d5[_0x342033];return _0x2409b4;};'use strict';var multer=require(_0x593d('0x0'));var util=require('util');var path=require(_0x593d('0x1'));var timeout=require(_0x593d('0x2'));var express=require(_0x593d('0x3'));var router=express[_0x593d('0x4')]();var auth=require(_0x593d('0x5'));var interaction=require(_0x593d('0x6'));var config=require('../../config/environment');var controller=require(_0x593d('0x7'));router[_0x593d('0x8')]('/',auth[_0x593d('0x9')](),controller[_0x593d('0xa')]);router[_0x593d('0x8')](_0x593d('0xb'),auth[_0x593d('0x9')](),controller[_0x593d('0xc')]);router['get']('/:id',auth[_0x593d('0x9')](),controller['show']);router[_0x593d('0x8')](_0x593d('0xd'),auth[_0x593d('0x9')](),controller[_0x593d('0xe')]);router[_0x593d('0xf')]('/',auth[_0x593d('0x9')](),controller[_0x593d('0x10')]);router[_0x593d('0x11')](_0x593d('0x12'),auth[_0x593d('0x9')](),controller[_0x593d('0x13')]);router[_0x593d('0x14')]('/:id',auth[_0x593d('0x9')](),controller[_0x593d('0x15')]);module[_0x593d('0x16')]=router;
\ No newline at end of file
+var _0x4198=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','destroy','exports','util','connect-timeout','../../components/auth/service'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x4198,0x75));var _0x8419=function(_0x2e6e75,_0x3843e4){_0x2e6e75=_0x2e6e75-0x0;var _0x3f8525=_0x4198[_0x2e6e75];return _0x3f8525;};'use strict';var multer=require('multer');var util=require(_0x8419('0x0'));var path=require('path');var timeout=require(_0x8419('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x8419('0x2'));var interaction=require(_0x8419('0x3'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x8419('0x4')]('/',auth[_0x8419('0x5')](),controller[_0x8419('0x6')]);router[_0x8419('0x4')]('/describe',auth[_0x8419('0x5')](),controller['describe']);router['get'](_0x8419('0x7'),auth[_0x8419('0x5')](),controller[_0x8419('0x8')]);router[_0x8419('0x4')](_0x8419('0x9'),auth[_0x8419('0x5')](),controller[_0x8419('0xa')]);router['post']('/',auth[_0x8419('0x5')](),controller[_0x8419('0xb')]);router[_0x8419('0xc')]('/:id',auth[_0x8419('0x5')](),controller['update']);router['delete'](_0x8419('0x7'),auth['isAuthenticated'](),controller[_0x8419('0xd')]);module[_0x8419('0xe')]=router;
\ No newline at end of file
index b59c9e0..9be104b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','moment'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0xe5b3[_0x3b0c9d];return _0xcfc8d7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var config=require(_0x3e5b('0x2'));module[_0x3e5b('0x3')]={'format':{'type':Sequelize[_0x3e5b('0x4')],'get':function(){return this[_0x3e5b('0x5')](_0x3e5b('0x6'))?path[_0x3e5b('0x7')](this[_0x3e5b('0x5')](_0x3e5b('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x3e5b('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x3e5b('0x8')],'set':function(_0x5dcf55){var _0x534e7d=_0x5dcf55[_0x3e5b('0x9')](/\\/g,'/');this[_0x3e5b('0xa')](_0x3e5b('0x6'),_0x534e7d);}},'rating':{'type':Sequelize[_0x3e5b('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4ed6bc){this[_0x3e5b('0xa')](_0x3e5b('0xc'),moment()[_0x3e5b('0xd')](_0x4ed6bc,'ms'));this[_0x3e5b('0xa')](_0x3e5b('0xe'),moment());this['setDataValue'](_0x3e5b('0xf'),_0x4ed6bc);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x3e5b('0x5')](_0x3e5b('0xc')))[_0x3e5b('0x10')](_0x3e5b('0x11'))[_0x3e5b('0x12')]();}},'closedAt':{'type':Sequelize[_0x3e5b('0x13')],'get':function(){return moment(this[_0x3e5b('0x5')]('closedAt'))[_0x3e5b('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x3e5b('0x5')](_0x3e5b('0x14')))[_0x3e5b('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x3e5b('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x3e5b('0x15')))[_0x3e5b('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x3e5b('0x12')]();}}};
\ No newline at end of file
+var _0xf2ca=['format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE'];(function(_0x1d27b1,_0x582136){var _0x45198b=function(_0x4819f4){while(--_0x4819f4){_0x1d27b1['push'](_0x1d27b1['shift']());}};_0x45198b(++_0x582136);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0xf2ca[_0x4cd690];return _0x4a74a9;};'use strict';var Sequelize=require(_0xaf2c('0x0'));var moment=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var config=require('../../config/environment');module[_0xaf2c('0x3')]={'format':{'type':Sequelize[_0xaf2c('0x4')],'get':function(){return this[_0xaf2c('0x5')](_0xaf2c('0x6'))?path[_0xaf2c('0x7')](this[_0xaf2c('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xaf2c('0x8')]},'channel':{'type':Sequelize[_0xaf2c('0x8')]},'value':{'type':Sequelize[_0xaf2c('0x8')],'set':function(_0x1f9531){var _0x58351f=_0x1f9531[_0xaf2c('0x9')](/\\/g,'/');this[_0xaf2c('0xa')]('value',_0x58351f);}},'rating':{'type':Sequelize[_0xaf2c('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x439ca3){this['setDataValue'](_0xaf2c('0xc'),moment()[_0xaf2c('0xd')](_0x439ca3,'ms'));this[_0xaf2c('0xa')](_0xaf2c('0xe'),moment());this['setDataValue']('duration',_0x439ca3);}},'startedAt':{'type':Sequelize[_0xaf2c('0xf')],'get':function(){return moment(this[_0xaf2c('0x5')](_0xaf2c('0xc')))[_0xaf2c('0x10')](_0xaf2c('0x11'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xaf2c('0x5')](_0xaf2c('0xe')))[_0xaf2c('0x10')](_0xaf2c('0x11'))[_0xaf2c('0x12')]();}},'createdAt':{'type':Sequelize[_0xaf2c('0xf')],'get':function(){return moment(this[_0xaf2c('0x5')](_0xaf2c('0x13')))[_0xaf2c('0x10')](_0xaf2c('0x11'))[_0xaf2c('0x12')]();}},'updatedAt':{'type':Sequelize[_0xaf2c('0xf')],'get':function(){return moment(this[_0xaf2c('0x5')](_0xaf2c('0x14')))[_0xaf2c('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xaf2c('0x12')]();}}};
\ No newline at end of file
index a7c95fa..f7b9d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ac=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','save','update','then','error','name','send','map','rawAttributes','type','differenceBy','format','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','ScreenRecording','includeAll','rows','catch','show','include','find','create','body','closedAt','value','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','Not\x20found','destroy','params','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','html-pdf','rimraf'];(function(_0x5c9e5b,_0x39d966){var _0x32a923=function(_0x490dac){while(--_0x490dac){_0x5c9e5b['push'](_0x5c9e5b['shift']());}};_0x32a923(++_0x39d966);}(_0x02ac,0x1ed));var _0xc02a=function(_0x4b401e,_0x54db9e){_0x4b401e=_0x4b401e-0x0;var _0x4aed70=_0x02ac[_0x4b401e];return _0x4aed70;};'use strict';var pdf=require(_0xc02a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc02a('0x1'));var zipdir=require(_0xc02a('0x2'));var jsonpatch=require(_0xc02a('0x3'));var rp=require(_0xc02a('0x4'));var moment=require(_0xc02a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc02a('0x6'));var util=require(_0xc02a('0x7'));var path=require(_0xc02a('0x8'));var sox=require('sox');var csv=require(_0xc02a('0x9'));var ejs=require(_0xc02a('0xa'));var fs=require('fs');var _=require(_0xc02a('0xb'));var squel=require(_0xc02a('0xc'));var crypto=require(_0xc02a('0xd'));var jsforce=require(_0xc02a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc02a('0x9'));var querystring=require(_0xc02a('0xf'));var Papa=require(_0xc02a('0x10'));var Redis=require(_0xc02a('0x11'));var authService=require(_0xc02a('0x12'));var qs=require(_0xc02a('0x13'));var as=require(_0xc02a('0x14'));var hardwareService=require(_0xc02a('0x15'));var logger=require('../../config/logger')(_0xc02a('0x16'));var utils=require(_0xc02a('0x17'));var config=require(_0xc02a('0x18'));var db=require(_0xc02a('0x19'))['db'];function respondWithStatusCode(_0x331840,_0x54ece0){_0x54ece0=_0x54ece0||0xcc;return function(_0x7aa154){if(_0x7aa154){return _0x331840[_0xc02a('0x1a')](_0x54ece0);}return _0x331840['status'](_0x54ece0)[_0xc02a('0x1b')]();};}function respondWithResult(_0x558c5e,_0x57589b){_0x57589b=_0x57589b||0xc8;return function(_0x5cb304){if(_0x5cb304){return _0x558c5e['status'](_0x57589b)[_0xc02a('0x1c')](_0x5cb304);}};}function respondWithFilteredResult(_0x52fc54,_0x3d75d3){return function(_0x2e6aea){if(_0x2e6aea){var _0x28388f=_0x2e6aea[_0xc02a('0x1d')],_0x3dba6f=_0x3d75d3[_0xc02a('0x1e')],_0x3f9519=_0x3d75d3[_0xc02a('0x1e')]+_0x3d75d3['limit'],_0x510a55;if(_0x3f9519>=_0x28388f){_0x3f9519=_0x28388f;_0x510a55=0xc8;}else{_0x510a55=0xce;}_0x52fc54[_0xc02a('0x1f')](_0x510a55);return _0x52fc54[_0xc02a('0x20')](_0xc02a('0x21'),_0x3dba6f+'-'+_0x3f9519+'/'+_0x28388f)[_0xc02a('0x1c')](_0x2e6aea);}return null;};}function patchUpdates(_0x57432f){return function(_0x46194e){try{jsonpatch[_0xc02a('0x22')](_0x46194e,_0x57432f,!![]);}catch(_0x3b7185){return BPromise['reject'](_0x3b7185);}return _0x46194e[_0xc02a('0x23')]();};}function saveUpdates(_0x1eb943,_0x39dcc9){return function(_0x4be595){if(_0x4be595){return _0x4be595[_0xc02a('0x24')](_0x1eb943)[_0xc02a('0x25')](function(_0x1859d7){return _0x1859d7;});}return null;};}function removeEntity(_0x46405d,_0x4a9a40){return function(_0x5c7902){if(_0x5c7902){return _0x5c7902['destroy']()[_0xc02a('0x25')](function(){_0x46405d[_0xc02a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d083e,_0xb9a42){return function(_0x263527){if(!_0x263527){_0x4d083e[_0xc02a('0x1a')](0x194);}return _0x263527;};}function handleError(_0x2c4064,_0x464306){_0x464306=_0x464306||0x1f4;return function(_0x32b356){logger[_0xc02a('0x26')](_0x32b356['stack']);if(_0x32b356[_0xc02a('0x27')]){delete _0x32b356[_0xc02a('0x27')];}_0x2c4064[_0xc02a('0x1f')](_0x464306)[_0xc02a('0x28')](_0x32b356);};}exports['index']=function(_0x3a88e6,_0x6001){var _0x44c05c={},_0x1d246a={},_0x2daacf={'count':0x0,'rows':[]};var _0x24b8bb=_[_0xc02a('0x29')](db['ScreenRecording'][_0xc02a('0x2a')],function(_0x16122d){return{'name':_0x16122d['fieldName'],'type':_0x16122d[_0xc02a('0x2b')]['key']};});_0x1d246a['model']=_[_0xc02a('0x2c')](_[_0xc02a('0x29')](_0x24b8bb,_0xc02a('0x27')),[_0xc02a('0x2d')]);_0x1d246a[_0xc02a('0x2e')]=_[_0xc02a('0x2f')](_0x3a88e6[_0xc02a('0x2e')]);_0x1d246a[_0xc02a('0x30')]=_[_0xc02a('0x31')](_0x1d246a[_0xc02a('0x32')],_0x1d246a[_0xc02a('0x2e')]);_0x44c05c['attributes']=_['intersection'](_0x1d246a[_0xc02a('0x32')],qs[_0xc02a('0x33')](_0x3a88e6['query'][_0xc02a('0x33')]));_0x44c05c[_0xc02a('0x34')]=_0x44c05c['attributes'][_0xc02a('0x35')]?_0x44c05c[_0xc02a('0x34')]:_0x1d246a[_0xc02a('0x32')];if(!_0x3a88e6[_0xc02a('0x2e')]['hasOwnProperty'](_0xc02a('0x36'))){_0x44c05c[_0xc02a('0x37')]=qs['limit'](_0x3a88e6[_0xc02a('0x2e')]['limit']);_0x44c05c['offset']=qs['offset'](_0x3a88e6[_0xc02a('0x2e')][_0xc02a('0x1e')]);}_0x44c05c[_0xc02a('0x38')]=qs[_0xc02a('0x39')](_0x3a88e6[_0xc02a('0x2e')][_0xc02a('0x39')]);_0x44c05c[_0xc02a('0x3a')]=qs[_0xc02a('0x30')](_['pick'](_0x3a88e6['query'],_0x1d246a[_0xc02a('0x30')]),_0x24b8bb);if(_0x3a88e6['query'][_0xc02a('0x3b')]){_0x44c05c[_0xc02a('0x3a')]=_[_0xc02a('0x3c')](_0x44c05c['where'],{'$or':_['map'](_0x24b8bb,function(_0x16610d){if(_0x16610d[_0xc02a('0x2b')]!==_0xc02a('0x3d')){var _0x1a4ab3={};_0x1a4ab3[_0x16610d[_0xc02a('0x27')]]={'$like':'%'+_0x3a88e6['query'][_0xc02a('0x3b')]+'%'};return _0x1a4ab3;}})});}_0x44c05c=_[_0xc02a('0x3c')]({},_0x44c05c,_0x3a88e6['options']);var _0x25a169={'where':_0x44c05c[_0xc02a('0x3a')]};return db[_0xc02a('0x3e')][_0xc02a('0x1d')](_0x25a169)[_0xc02a('0x25')](function(_0x2a3a63){_0x2daacf[_0xc02a('0x1d')]=_0x2a3a63;if(_0x3a88e6[_0xc02a('0x2e')][_0xc02a('0x3f')]){_0x44c05c['include']=[{'all':!![]}];}return db[_0xc02a('0x3e')]['findAll'](_0x44c05c);})[_0xc02a('0x25')](function(_0xa2fc7){_0x2daacf[_0xc02a('0x40')]=_0xa2fc7;return _0x2daacf;})[_0xc02a('0x25')](respondWithFilteredResult(_0x6001,_0x44c05c))[_0xc02a('0x41')](handleError(_0x6001,null));};exports[_0xc02a('0x42')]=function(_0x558633,_0x585069){var _0x5cdeef={'raw':![],'where':{'id':_0x558633['params']['id']}},_0x53e7aa={};_0x53e7aa[_0xc02a('0x32')]=_[_0xc02a('0x2f')](db[_0xc02a('0x3e')][_0xc02a('0x2a')]);_0x53e7aa[_0xc02a('0x2e')]=_[_0xc02a('0x2f')](_0x558633[_0xc02a('0x2e')]);_0x53e7aa[_0xc02a('0x30')]=_['intersection'](_0x53e7aa[_0xc02a('0x32')],_0x53e7aa[_0xc02a('0x2e')]);_0x5cdeef[_0xc02a('0x34')]=_['intersection'](_0x53e7aa['model'],qs[_0xc02a('0x33')](_0x558633[_0xc02a('0x2e')][_0xc02a('0x33')]));_0x5cdeef[_0xc02a('0x34')]=_0x5cdeef['attributes'][_0xc02a('0x35')]?_0x5cdeef['attributes']:_0x53e7aa[_0xc02a('0x32')];if(_0x558633['query']['includeAll']){_0x5cdeef[_0xc02a('0x43')]=[{'all':!![]}];}_0x5cdeef=_[_0xc02a('0x3c')]({},_0x5cdeef,_0x558633['options']);return db['ScreenRecording'][_0xc02a('0x44')](_0x5cdeef)[_0xc02a('0x25')](handleEntityNotFound(_0x585069,null))['then'](respondWithResult(_0x585069,null))[_0xc02a('0x41')](handleError(_0x585069,null));};exports[_0xc02a('0x45')]=function(_0xad1600,_0x26b93b){return db[_0xc02a('0x3e')][_0xc02a('0x45')](_0xad1600[_0xc02a('0x46')],{})[_0xc02a('0x25')](respondWithResult(_0x26b93b,0xc9))[_0xc02a('0x41')](handleError(_0x26b93b,null));};exports['update']=function(_0x33b639,_0x489a1b){if(_0x33b639[_0xc02a('0x46')]['id']){delete _0x33b639[_0xc02a('0x46')]['id'];}delete _0x33b639[_0xc02a('0x46')]['duration'];delete _0x33b639['body']['createdAt'];delete _0x33b639[_0xc02a('0x46')][_0xc02a('0x47')];delete _0x33b639['body'][_0xc02a('0x48')];return db[_0xc02a('0x3e')]['find']({'where':{'id':_0x33b639['params']['id']}})['then'](handleEntityNotFound(_0x489a1b,null))[_0xc02a('0x25')](saveUpdates(_0x33b639[_0xc02a('0x46')],null))['then'](respondWithResult(_0x489a1b,null))['catch'](handleError(_0x489a1b,null));};exports['describe']=function(_0x44b2dc,_0xc0318f){return db[_0xc02a('0x3e')]['describe']()[_0xc02a('0x25')](respondWithResult(_0xc0318f,null))[_0xc02a('0x41')](handleError(_0xc0318f,null));};exports['download']=function(_0x17596f,_0x29a1a3,_0x112fd9){var _0x12c2f3=require(_0xc02a('0x49'));var _0x54e4f5=![];var _0xd96d18={};if(_0x17596f['query'][_0xc02a('0x2b')]&&_0x17596f[_0xc02a('0x2e')][_0xc02a('0x2b')]===_0xc02a('0x4a')){_0xd96d18[_0xc02a('0x4a')]=_0x17596f['params']['id'];}else{_0xd96d18['id']=_0x17596f['params']['id'];}return db[_0xc02a('0x3e')][_0xc02a('0x44')]({'where':_0xd96d18,'attributes':['id','value'],'raw':!![]})[_0xc02a('0x25')](handleEntityNotFound(_0x29a1a3,null))[_0xc02a('0x25')](function(_0x222237){if(_0x222237){var _0x45c5c2=path[_0xc02a('0x4b')](config[_0xc02a('0x4c')],_0xc02a('0x4d'),_0x222237['value']);var _0x5139b2=util[_0xc02a('0x2d')](_0xc02a('0x4e'),_0x45c5c2);if(fs[_0xc02a('0x4f')](_0x5139b2)){_0x54e4f5=!![];return _0x12c2f3[_0xc02a('0x50')](_0x5139b2,_0x45c5c2,config[_0xc02a('0x51')][_0xc02a('0x52')])['then'](function(){return _0x222237;});}return _0x222237;}})[_0xc02a('0x25')](function(_0x262e9d){if(_0x262e9d){var _0x1b685e=path['join'](config[_0xc02a('0x4c')],'server/files/screen_recordings',_0x262e9d['value']);if(!fs[_0xc02a('0x4f')](_0x1b685e)){throw new db[(_0xc02a('0x53'))][(_0xc02a('0x54'))](_0xc02a('0x55'));}if(_0x262e9d[_0xc02a('0x56')]){return _0x29a1a3['download'](_0x1b685e,_0x262e9d['filename']+path['extname'](_0x1b685e),function(){if(_0x54e4f5){fs[_0xc02a('0x57')](_0x1b685e);}});}else{return _0x29a1a3['download'](_0x1b685e,function(_0x3f551e){if(_0x54e4f5){fs[_0xc02a('0x57')](_0x1b685e);}});}}})[_0xc02a('0x41')](function(_0x5739a9){if(_0x5739a9['message']===_0xc02a('0x55')){_0x29a1a3[_0xc02a('0x1f')](0x194)[_0xc02a('0x28')](_0xc02a('0x58'));}else{return handleError(_0x29a1a3,null);}});};exports[_0xc02a('0x59')]=function(_0x5e8bb9,_0x34b95){return db['ScreenRecording'][_0xc02a('0x44')]({'where':{'id':_0x5e8bb9[_0xc02a('0x5a')]['id']}})[_0xc02a('0x25')](function(_0x55ece4){if(!_0x55ece4)throw new ReferenceError(_0xc02a('0x5b'));return _0x55ece4;})[_0xc02a('0x25')](function(_0xf3c86){var _0x23b3f4=path[_0xc02a('0x4b')](config[_0xc02a('0x4c')],_0xc02a('0x4d'),_0xf3c86['value']);logger[_0xc02a('0x5c')](_0xc02a('0x5d'),_0x23b3f4);if(!_[_0xc02a('0x5e')](_0xf3c86['value'])&&fs[_0xc02a('0x4f')](_0x23b3f4)){logger[_0xc02a('0x5c')]('File:\x20\x22'+_0x23b3f4+_0xc02a('0x5f'));fs[_0xc02a('0x60')](_0x23b3f4);}_0x23b3f4=_0x23b3f4+_0xc02a('0x61');if(!_[_0xc02a('0x5e')](_0xf3c86[_0xc02a('0x48')])&&fs[_0xc02a('0x4f')](_0x23b3f4)){logger[_0xc02a('0x5c')](_0xc02a('0x62')+_0x23b3f4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc02a('0x60')](_0x23b3f4);}return _0xf3c86;})[_0xc02a('0x25')](function(_0x1644a4){if(!_0x1644a4)throw new InternalError();return _0x1644a4[_0xc02a('0x59')]();})['then'](function(){_0x34b95[_0xc02a('0x1f')](0xcc)[_0xc02a('0x1b')]();})[_0xc02a('0x41')](handleError(_0x34b95,null));};
\ No newline at end of file
+var _0xb066=['set','Content-Range','json','reject','then','destroy','error','name','send','rawAttributes','type','key','model','map','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','merge','VIRTUAL','options','where','ScreenRecording','include','findAll','catch','includeAll','create','body','update','createdAt','closedAt','value','find','params','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','download','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','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset'];(function(_0x46e190,_0xd0ba63){var _0x450a36=function(_0x3e2c09){while(--_0x3e2c09){_0x46e190['push'](_0x46e190['shift']());}};_0x450a36(++_0xd0ba63);}(_0xb066,0x1c9));var _0x6b06=function(_0x4a8f77,_0x5ee2ca){_0x4a8f77=_0x4a8f77-0x0;var _0x5a26b2=_0xb066[_0x4a8f77];return _0x5a26b2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6b06('0x0'));var rimraf=require(_0x6b06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b06('0x2'));var moment=require(_0x6b06('0x3'));var BPromise=require(_0x6b06('0x4'));var Mustache=require(_0x6b06('0x5'));var util=require(_0x6b06('0x6'));var path=require(_0x6b06('0x7'));var sox=require(_0x6b06('0x8'));var csv=require(_0x6b06('0x9'));var ejs=require(_0x6b06('0xa'));var fs=require('fs');var _=require(_0x6b06('0xb'));var squel=require('squel');var crypto=require(_0x6b06('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b06('0x9'));var querystring=require(_0x6b06('0xd'));var Papa=require(_0x6b06('0xe'));var Redis=require('ioredis');var authService=require(_0x6b06('0xf'));var qs=require(_0x6b06('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b06('0x11'));var logger=require(_0x6b06('0x12'))(_0x6b06('0x13'));var utils=require(_0x6b06('0x14'));var config=require(_0x6b06('0x15'));var db=require(_0x6b06('0x16'))['db'];function respondWithStatusCode(_0x5af4b3,_0xeccd10){_0xeccd10=_0xeccd10||0xcc;return function(_0x51d1d8){if(_0x51d1d8){return _0x5af4b3[_0x6b06('0x17')](_0xeccd10);}return _0x5af4b3[_0x6b06('0x18')](_0xeccd10)[_0x6b06('0x19')]();};}function respondWithResult(_0x3743b5,_0x24c833){_0x24c833=_0x24c833||0xc8;return function(_0x35a35a){if(_0x35a35a){return _0x3743b5[_0x6b06('0x18')](_0x24c833)['json'](_0x35a35a);}};}function respondWithFilteredResult(_0x9c5c6f,_0x23e93f){return function(_0x485024){if(_0x485024){var _0x4ccd87=_0x485024[_0x6b06('0x1a')],_0x33907c=_0x23e93f[_0x6b06('0x1b')],_0x1a48a2=_0x23e93f[_0x6b06('0x1b')]+_0x23e93f['limit'],_0x28e511;if(_0x1a48a2>=_0x4ccd87){_0x1a48a2=_0x4ccd87;_0x28e511=0xc8;}else{_0x28e511=0xce;}_0x9c5c6f['status'](_0x28e511);return _0x9c5c6f[_0x6b06('0x1c')](_0x6b06('0x1d'),_0x33907c+'-'+_0x1a48a2+'/'+_0x4ccd87)[_0x6b06('0x1e')](_0x485024);}return null;};}function patchUpdates(_0xde5737){return function(_0xb2373){try{jsonpatch['apply'](_0xb2373,_0xde5737,!![]);}catch(_0x20478e){return BPromise[_0x6b06('0x1f')](_0x20478e);}return _0xb2373['save']();};}function saveUpdates(_0x4b2bc8,_0x172a7f){return function(_0x170437){if(_0x170437){return _0x170437['update'](_0x4b2bc8)[_0x6b06('0x20')](function(_0x3c692d){return _0x3c692d;});}return null;};}function removeEntity(_0x985f21,_0x545ebf){return function(_0x7f3ab){if(_0x7f3ab){return _0x7f3ab[_0x6b06('0x21')]()['then'](function(){_0x985f21[_0x6b06('0x18')](0xcc)[_0x6b06('0x19')]();});}};}function handleEntityNotFound(_0x1eb06b,_0x2e3c64){return function(_0x2501be){if(!_0x2501be){_0x1eb06b[_0x6b06('0x17')](0x194);}return _0x2501be;};}function handleError(_0x2a4fee,_0x2ecbea){_0x2ecbea=_0x2ecbea||0x1f4;return function(_0x56bd06){logger[_0x6b06('0x22')](_0x56bd06['stack']);if(_0x56bd06[_0x6b06('0x23')]){delete _0x56bd06[_0x6b06('0x23')];}_0x2a4fee[_0x6b06('0x18')](_0x2ecbea)[_0x6b06('0x24')](_0x56bd06);};}exports['index']=function(_0x14b5a4,_0x5a0f51){var _0x1144f1={},_0x390486={},_0x545908={'count':0x0,'rows':[]};var _0x42b7b2=_['map'](db['ScreenRecording'][_0x6b06('0x25')],function(_0x1bc98e){return{'name':_0x1bc98e['fieldName'],'type':_0x1bc98e[_0x6b06('0x26')][_0x6b06('0x27')]};});_0x390486[_0x6b06('0x28')]=_['differenceBy'](_[_0x6b06('0x29')](_0x42b7b2,'name'),[_0x6b06('0x2a')]);_0x390486[_0x6b06('0x2b')]=_[_0x6b06('0x2c')](_0x14b5a4[_0x6b06('0x2b')]);_0x390486[_0x6b06('0x2d')]=_[_0x6b06('0x2e')](_0x390486[_0x6b06('0x28')],_0x390486[_0x6b06('0x2b')]);_0x1144f1[_0x6b06('0x2f')]=_[_0x6b06('0x2e')](_0x390486['model'],qs['fields'](_0x14b5a4[_0x6b06('0x2b')][_0x6b06('0x30')]));_0x1144f1[_0x6b06('0x2f')]=_0x1144f1['attributes'][_0x6b06('0x31')]?_0x1144f1[_0x6b06('0x2f')]:_0x390486[_0x6b06('0x28')];if(!_0x14b5a4[_0x6b06('0x2b')][_0x6b06('0x32')]('nolimit')){_0x1144f1[_0x6b06('0x33')]=qs[_0x6b06('0x33')](_0x14b5a4[_0x6b06('0x2b')][_0x6b06('0x33')]);_0x1144f1[_0x6b06('0x1b')]=qs[_0x6b06('0x1b')](_0x14b5a4[_0x6b06('0x2b')][_0x6b06('0x1b')]);}_0x1144f1[_0x6b06('0x34')]=qs['sort'](_0x14b5a4['query'][_0x6b06('0x35')]);_0x1144f1['where']=qs[_0x6b06('0x2d')](_['pick'](_0x14b5a4[_0x6b06('0x2b')],_0x390486[_0x6b06('0x2d')]),_0x42b7b2);if(_0x14b5a4[_0x6b06('0x2b')][_0x6b06('0x36')]){_0x1144f1['where']=_[_0x6b06('0x37')](_0x1144f1['where'],{'$or':_[_0x6b06('0x29')](_0x42b7b2,function(_0x380aa9){if(_0x380aa9[_0x6b06('0x26')]!==_0x6b06('0x38')){var _0x331f20={};_0x331f20[_0x380aa9['name']]={'$like':'%'+_0x14b5a4[_0x6b06('0x2b')][_0x6b06('0x36')]+'%'};return _0x331f20;}})});}_0x1144f1=_['merge']({},_0x1144f1,_0x14b5a4[_0x6b06('0x39')]);var _0x293ae8={'where':_0x1144f1[_0x6b06('0x3a')]};return db[_0x6b06('0x3b')][_0x6b06('0x1a')](_0x293ae8)[_0x6b06('0x20')](function(_0x25992a){_0x545908[_0x6b06('0x1a')]=_0x25992a;if(_0x14b5a4[_0x6b06('0x2b')]['includeAll']){_0x1144f1[_0x6b06('0x3c')]=[{'all':!![]}];}return db[_0x6b06('0x3b')][_0x6b06('0x3d')](_0x1144f1);})[_0x6b06('0x20')](function(_0x575856){_0x545908['rows']=_0x575856;return _0x545908;})['then'](respondWithFilteredResult(_0x5a0f51,_0x1144f1))[_0x6b06('0x3e')](handleError(_0x5a0f51,null));};exports['show']=function(_0x4d323c,_0x4a48a1){var _0x34ecef={'raw':![],'where':{'id':_0x4d323c['params']['id']}},_0x58379d={};_0x58379d[_0x6b06('0x28')]=_['keys'](db['ScreenRecording'][_0x6b06('0x25')]);_0x58379d[_0x6b06('0x2b')]=_['keys'](_0x4d323c[_0x6b06('0x2b')]);_0x58379d['filters']=_['intersection'](_0x58379d['model'],_0x58379d[_0x6b06('0x2b')]);_0x34ecef['attributes']=_['intersection'](_0x58379d['model'],qs['fields'](_0x4d323c[_0x6b06('0x2b')]['fields']));_0x34ecef[_0x6b06('0x2f')]=_0x34ecef['attributes']['length']?_0x34ecef[_0x6b06('0x2f')]:_0x58379d[_0x6b06('0x28')];if(_0x4d323c[_0x6b06('0x2b')][_0x6b06('0x3f')]){_0x34ecef['include']=[{'all':!![]}];}_0x34ecef=_['merge']({},_0x34ecef,_0x4d323c[_0x6b06('0x39')]);return db['ScreenRecording']['find'](_0x34ecef)['then'](handleEntityNotFound(_0x4a48a1,null))[_0x6b06('0x20')](respondWithResult(_0x4a48a1,null))[_0x6b06('0x3e')](handleError(_0x4a48a1,null));};exports[_0x6b06('0x40')]=function(_0x59a48b,_0x47da6f){return db[_0x6b06('0x3b')]['create'](_0x59a48b[_0x6b06('0x41')],{})['then'](respondWithResult(_0x47da6f,0xc9))['catch'](handleError(_0x47da6f,null));};exports[_0x6b06('0x42')]=function(_0x4c5164,_0x1f8e4c){if(_0x4c5164[_0x6b06('0x41')]['id']){delete _0x4c5164['body']['id'];}delete _0x4c5164[_0x6b06('0x41')]['duration'];delete _0x4c5164[_0x6b06('0x41')][_0x6b06('0x43')];delete _0x4c5164[_0x6b06('0x41')][_0x6b06('0x44')];delete _0x4c5164['body'][_0x6b06('0x45')];return db[_0x6b06('0x3b')][_0x6b06('0x46')]({'where':{'id':_0x4c5164[_0x6b06('0x47')]['id']}})[_0x6b06('0x20')](handleEntityNotFound(_0x1f8e4c,null))[_0x6b06('0x20')](saveUpdates(_0x4c5164[_0x6b06('0x41')],null))[_0x6b06('0x20')](respondWithResult(_0x1f8e4c,null))['catch'](handleError(_0x1f8e4c,null));};exports['describe']=function(_0x3addbb,_0x3174da){return db[_0x6b06('0x3b')]['describe']()[_0x6b06('0x20')](respondWithResult(_0x3174da,null))[_0x6b06('0x3e')](handleError(_0x3174da,null));};exports['download']=function(_0xff3185,_0xa91cf5,_0x3de848){var _0x4a9a63=require(_0x6b06('0x48'));var _0x181162=![];var _0x16729a={};if(_0xff3185['query'][_0x6b06('0x26')]&&_0xff3185[_0x6b06('0x2b')][_0x6b06('0x26')]==='uniqueid'){_0x16729a[_0x6b06('0x49')]=_0xff3185['params']['id'];}else{_0x16729a['id']=_0xff3185['params']['id'];}return db[_0x6b06('0x3b')][_0x6b06('0x46')]({'where':_0x16729a,'attributes':['id',_0x6b06('0x45')],'raw':!![]})[_0x6b06('0x20')](handleEntityNotFound(_0xa91cf5,null))[_0x6b06('0x20')](function(_0xda5f76){if(_0xda5f76){var _0x23f317=path[_0x6b06('0x4a')](config[_0x6b06('0x4b')],_0x6b06('0x4c'),_0xda5f76['value']);var _0x47d785=util[_0x6b06('0x2a')]('%s.cypher',_0x23f317);if(fs[_0x6b06('0x4d')](_0x47d785)){_0x181162=!![];return _0x4a9a63[_0x6b06('0x4e')](_0x47d785,_0x23f317,config[_0x6b06('0x4f')][_0x6b06('0x50')])[_0x6b06('0x20')](function(){return _0xda5f76;});}return _0xda5f76;}})[_0x6b06('0x20')](function(_0x41afb2){if(_0x41afb2){var _0x1aa199=path[_0x6b06('0x4a')](config[_0x6b06('0x4b')],_0x6b06('0x4c'),_0x41afb2[_0x6b06('0x45')]);if(!fs[_0x6b06('0x4d')](_0x1aa199)){throw new db[(_0x6b06('0x51'))][(_0x6b06('0x52'))](_0x6b06('0x53'));}if(_0x41afb2['filename']){return _0xa91cf5[_0x6b06('0x54')](_0x1aa199,_0x41afb2[_0x6b06('0x55')]+path[_0x6b06('0x56')](_0x1aa199),function(){if(_0x181162){fs[_0x6b06('0x57')](_0x1aa199);}});}else{return _0xa91cf5['download'](_0x1aa199,function(_0x164670){if(_0x181162){fs['unlink'](_0x1aa199);}});}}})['catch'](function(_0x113567){if(_0x113567[_0x6b06('0x58')]===_0x6b06('0x53')){_0xa91cf5[_0x6b06('0x18')](0x194)['send'](_0x6b06('0x59'));}else{return handleError(_0xa91cf5,null);}});};exports[_0x6b06('0x21')]=function(_0x2e78e5,_0x4b9985){return db[_0x6b06('0x3b')][_0x6b06('0x46')]({'where':{'id':_0x2e78e5['params']['id']}})[_0x6b06('0x20')](function(_0x212baa){if(!_0x212baa)throw new ReferenceError(_0x6b06('0x5a'));return _0x212baa;})[_0x6b06('0x20')](function(_0x12b25f){var _0x192671=path[_0x6b06('0x4a')](config[_0x6b06('0x4b')],_0x6b06('0x4c'),_0x12b25f[_0x6b06('0x45')]);logger[_0x6b06('0x5b')](_0x6b06('0x5c'),_0x192671);if(!_[_0x6b06('0x5d')](_0x12b25f[_0x6b06('0x45')])&&fs['existsSync'](_0x192671)){logger['info'](_0x6b06('0x5e')+_0x192671+_0x6b06('0x5f'));fs[_0x6b06('0x60')](_0x192671);}_0x192671=_0x192671+'.cypher';if(!_[_0x6b06('0x5d')](_0x12b25f[_0x6b06('0x45')])&&fs['existsSync'](_0x192671)){logger['info'](_0x6b06('0x5e')+_0x192671+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x192671);}return _0x12b25f;})['then'](function(_0x3376cc){if(!_0x3376cc)throw new InternalError();return _0x3376cc[_0x6b06('0x21')]();})[_0x6b06('0x20')](function(){_0x4b9985['status'](0xcc)['end']();})[_0x6b06('0x3e')](handleError(_0x4b9985,null));};
\ No newline at end of file
index b82ba98..42e06f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e55=['interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x5d12a8,_0x593aa1){var _0x35194f=function(_0x4a4edc){while(--_0x4a4edc){_0x5d12a8['push'](_0x5d12a8['shift']());}};_0x35194f(++_0x593aa1);}(_0x0e55,0xcd));var _0x50e5=function(_0x361add,_0x2a0f15){_0x361add=_0x361add-0x0;var _0x30f052=_0x0e55[_0x361add];return _0x30f052;};'use strict';var _=require(_0x50e5('0x0'));var util=require(_0x50e5('0x1'));var logger=require(_0x50e5('0x2'))(_0x50e5('0x3'));var moment=require(_0x50e5('0x4'));var BPromise=require(_0x50e5('0x5'));var rp=require(_0x50e5('0x6'));var fs=require('fs');var path=require(_0x50e5('0x7'));var rimraf=require(_0x50e5('0x8'));var config=require(_0x50e5('0x9'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x4abd5d,_0x405dcf){return _0x4abd5d[_0x50e5('0xa')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x50e5('0xb'),'fields':[_0x50e5('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa2f8=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1ab852,_0x15ed66){var _0x2da601=function(_0x228c2a){while(--_0x228c2a){_0x1ab852['push'](_0x1ab852['shift']());}};_0x2da601(++_0x15ed66);}(_0xa2f8,0x90));var _0x8a2f=function(_0x4b9a2e,_0x26b0fe){_0x4b9a2e=_0x4b9a2e-0x0;var _0x46ea53=_0xa2f8[_0x4b9a2e];return _0x46ea53;};'use strict';var _=require(_0x8a2f('0x0'));var util=require(_0x8a2f('0x1'));var logger=require('../../config/logger')(_0x8a2f('0x2'));var moment=require(_0x8a2f('0x3'));var BPromise=require(_0x8a2f('0x4'));var rp=require(_0x8a2f('0x5'));var fs=require('fs');var path=require(_0x8a2f('0x6'));var rimraf=require(_0x8a2f('0x7'));var config=require(_0x8a2f('0x8'));var attributes=require(_0x8a2f('0x9'));module[_0x8a2f('0xa')]=function(_0x4b1982,_0x32b161){return _0x4b1982[_0x8a2f('0xb')](_0x8a2f('0xc'),attributes,{'tableName':_0x8a2f('0xd'),'paranoid':![],'indexes':[{'name':_0x8a2f('0xe'),'fields':[_0x8a2f('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index a497053..27037a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x54d96d,_0x578790){var _0x4388a6=function(_0x102d43){while(--_0x102d43){_0x54d96d['push'](_0x54d96d['shift']());}};_0x4388a6(++_0x578790);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4c73f7,_0x373731){var _0x3524fb=function(_0x4ada4e){while(--_0x4ada4e){_0x4c73f7['push'](_0x4c73f7['shift']());}};_0x3524fb(++_0x373731);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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
index 0c52a2c..d80b871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc35=['getPreferred','/:id/favicon','getFavicon','diskStorage','join','extname','originalname','post','file','addLogo','root','server/files/images/logos/','format','%s%s','logologin','single','addLogoLogin','preferred','favicon','addFavicon','put','isAuthenticated','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcc35,0x13f));var _0x5cc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc35[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5cc3('0x0'));var util=require('util');var path=require(_0x5cc3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5cc3('0x2')]();var auth=require(_0x5cc3('0x3'));var interaction=require(_0x5cc3('0x4'));var config=require(_0x5cc3('0x5'));var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5cc3('0x6')]);router[_0x5cc3('0x7')](_0x5cc3('0x8'),controller['show']);router[_0x5cc3('0x7')](_0x5cc3('0x9'),controller['getLogo']);router[_0x5cc3('0x7')](_0x5cc3('0xa'),controller[_0x5cc3('0xb')]);router[_0x5cc3('0x7')]('/:id/gdpr',controller[_0x5cc3('0xc')]);router[_0x5cc3('0x7')](_0x5cc3('0xd'),controller[_0x5cc3('0xe')]);router[_0x5cc3('0x7')](_0x5cc3('0xf'),controller[_0x5cc3('0x10')]);var upload=multer({'storage':multer[_0x5cc3('0x11')]({'destination':function(_0x5b9edc,_0x1eb497,_0x391c04){_0x391c04(null,path[_0x5cc3('0x12')](config['root'],'server/files/images/logos/'));},'filename':function(_0x4687b9,_0x2afe13,_0x236c9c){_0x236c9c(null,util['format']('%s%s','logo',path[_0x5cc3('0x13')](_0x2afe13[_0x5cc3('0x14')])));}})});router[_0x5cc3('0x15')](_0x5cc3('0x9'),upload['single'](_0x5cc3('0x16')),controller[_0x5cc3('0x17')]);var upload=multer({'storage':multer[_0x5cc3('0x11')]({'destination':function(_0x1c8369,_0x24f3ab,_0x52f61c){_0x52f61c(null,path['join'](config[_0x5cc3('0x18')],_0x5cc3('0x19')));},'filename':function(_0x121581,_0x532422,_0x418306){_0x418306(null,util[_0x5cc3('0x1a')](_0x5cc3('0x1b'),_0x5cc3('0x1c'),path[_0x5cc3('0x13')](_0x532422[_0x5cc3('0x14')])));}})});router[_0x5cc3('0x15')]('/:id/logo_login',upload[_0x5cc3('0x1d')](_0x5cc3('0x16')),controller[_0x5cc3('0x1e')]);var upload=multer({'storage':multer[_0x5cc3('0x11')]({'destination':function(_0x3ef746,_0x2c0c2b,_0x1a2db7){_0x1a2db7(null,path[_0x5cc3('0x12')](config[_0x5cc3('0x18')],_0x5cc3('0x19')));},'filename':function(_0x293a18,_0x421ac5,_0x551079){_0x551079(null,util[_0x5cc3('0x1a')](_0x5cc3('0x1b'),_0x5cc3('0x1f'),path[_0x5cc3('0x13')](_0x421ac5[_0x5cc3('0x14')])));}})});router[_0x5cc3('0x15')]('/:id/preferred',upload[_0x5cc3('0x1d')](_0x5cc3('0x16')),controller['addPreferred']);var upload=multer({'storage':multer[_0x5cc3('0x11')]({'destination':function(_0x20aaa1,_0x4197ba,_0x33694e){_0x33694e(null,path[_0x5cc3('0x12')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2108a1,_0x3d9e1c,_0x2c15a0){_0x2c15a0(null,util[_0x5cc3('0x1a')](_0x5cc3('0x1b'),_0x5cc3('0x20'),path[_0x5cc3('0x13')](_0x3d9e1c[_0x5cc3('0x14')])));}})});router['post'](_0x5cc3('0xf'),upload[_0x5cc3('0x1d')]('file'),controller[_0x5cc3('0x21')]);router[_0x5cc3('0x22')](_0x5cc3('0x8'),auth[_0x5cc3('0x23')](),controller['update']);module[_0x5cc3('0x24')]=router;
\ No newline at end of file
+var _0x646b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','single','file','addLogo','server/files/images/logos/','logologin','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util'];(function(_0x41ae57,_0x49cc48){var _0x400213=function(_0x271a47){while(--_0x271a47){_0x41ae57['push'](_0x41ae57['shift']());}};_0x400213(++_0x49cc48);}(_0x646b,0x85));var _0xb646=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0x646b[_0x24679e];return _0x291f21;};'use strict';var multer=require(_0xb646('0x0'));var util=require(_0xb646('0x1'));var path=require(_0xb646('0x2'));var timeout=require(_0xb646('0x3'));var express=require(_0xb646('0x4'));var router=express[_0xb646('0x5')]();var auth=require(_0xb646('0x6'));var interaction=require(_0xb646('0x7'));var config=require(_0xb646('0x8'));var controller=require('./setting.controller');router['get']('/',auth[_0xb646('0x9')](),controller[_0xb646('0xa')]);router['get'](_0xb646('0xb'),controller[_0xb646('0xc')]);router[_0xb646('0xd')](_0xb646('0xe'),controller[_0xb646('0xf')]);router[_0xb646('0xd')](_0xb646('0x10'),controller[_0xb646('0x11')]);router[_0xb646('0xd')](_0xb646('0x12'),controller[_0xb646('0x13')]);router[_0xb646('0xd')](_0xb646('0x14'),controller[_0xb646('0x15')]);router['get'](_0xb646('0x16'),controller['getFavicon']);var upload=multer({'storage':multer[_0xb646('0x17')]({'destination':function(_0x32a383,_0x302725,_0xe47a40){_0xe47a40(null,path[_0xb646('0x18')](config[_0xb646('0x19')],'server/files/images/logos/'));},'filename':function(_0x1c6291,_0x4b7fa8,_0x22cbee){_0x22cbee(null,util[_0xb646('0x1a')](_0xb646('0x1b'),_0xb646('0x1c'),path[_0xb646('0x1d')](_0x4b7fa8[_0xb646('0x1e')])));}})});router[_0xb646('0x1f')](_0xb646('0xe'),upload[_0xb646('0x20')](_0xb646('0x21')),controller[_0xb646('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a93c3,_0x24023f,_0x9eb244){_0x9eb244(null,path[_0xb646('0x18')](config[_0xb646('0x19')],_0xb646('0x23')));},'filename':function(_0x3746f8,_0x3de944,_0x34176a){_0x34176a(null,util[_0xb646('0x1a')](_0xb646('0x1b'),_0xb646('0x24'),path[_0xb646('0x1d')](_0x3de944[_0xb646('0x1e')])));}})});router[_0xb646('0x1f')](_0xb646('0x10'),upload[_0xb646('0x20')]('file'),controller[_0xb646('0x25')]);var upload=multer({'storage':multer[_0xb646('0x17')]({'destination':function(_0x2ddae5,_0x5018c2,_0x17ed5){_0x17ed5(null,path[_0xb646('0x18')](config[_0xb646('0x19')],_0xb646('0x23')));},'filename':function(_0x57092b,_0x1964a0,_0x3f3039){_0x3f3039(null,util[_0xb646('0x1a')](_0xb646('0x1b'),_0xb646('0x26'),path[_0xb646('0x1d')](_0x1964a0[_0xb646('0x1e')])));}})});router['post'](_0xb646('0x14'),upload['single'](_0xb646('0x21')),controller[_0xb646('0x27')]);var upload=multer({'storage':multer[_0xb646('0x17')]({'destination':function(_0x1682e2,_0x3b47bc,_0x5414a6){_0x5414a6(null,path[_0xb646('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2e318c,_0x2fb208,_0x12f70d){_0x12f70d(null,util[_0xb646('0x1a')](_0xb646('0x1b'),_0xb646('0x28'),path[_0xb646('0x1d')](_0x2fb208['originalname'])));}})});router[_0xb646('0x1f')](_0xb646('0x16'),upload[_0xb646('0x20')](_0xb646('0x21')),controller[_0xb646('0x29')]);router[_0xb646('0x2a')](_0xb646('0xb'),auth[_0xb646('0x9')](),controller[_0xb646('0x2b')]);module[_0xb646('0x2c')]=router;
\ No newline at end of file
index b6edfa2..a346ca6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x920a=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_internal'];(function(_0x2f2c0c,_0x4490d1){var _0x5da264=function(_0x424a46){while(--_0x424a46){_0x2f2c0c['push'](_0x2f2c0c['shift']());}};_0x5da264(++_0x4490d1);}(_0x920a,0x68));var _0xa920=function(_0x4ac928,_0x302724){_0x4ac928=_0x4ac928-0x0;var _0x16d566=_0x920a[_0x4ac928];return _0x16d566;};'use strict';var Sequelize=require(_0xa920('0x0'));module[_0xa920('0x1')]={'min_internal':{'type':Sequelize[_0xa920('0x2')](0xb),'unique':_0xa920('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xa920('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xa920('0x4')],'defaultValue':_0xa920('0x5')},'logo':{'type':Sequelize[_0xa920('0x4')]},'defaultLogo':{'type':Sequelize[_0xa920('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xa920('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xa920('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xa920('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xa920('0x4')]},'turnaddr':{'type':Sequelize[_0xa920('0x4')]},'turnusername':{'type':Sequelize[_0xa920('0x4')]},'turnpassword':{'type':Sequelize[_0xa920('0x4')]},'pageTitle':{'type':Sequelize[_0xa920('0x4')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xa920('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xa920('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xa920('0x4')],'defaultValue':_0xa920('0x7')},'enableEmailPreview':{'type':Sequelize[_0xa920('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xa920('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xa920('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xa920('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xa920('0x4')],'defaultValue':_0xa920('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xa920('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xa920('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xa920('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xa920('0x4')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xa920('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xa920('0x4')]},'defaultFavicon':{'type':Sequelize[_0xa920('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xa920('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xa920('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xa920('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xa920('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xa920('0x2')]},'sentimentRegion':{'type':Sequelize[_0xa920('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xa920('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0xa920('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0b00=['BOOLEAN','alternate','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x2a1764,_0x5656da){var _0x5532a6=function(_0x516692){while(--_0x516692){_0x2a1764['push'](_0x2a1764['shift']());}};_0x5532a6(++_0x5656da);}(_0x0b00,0x1d2));var _0x00b0=function(_0x592a9f,_0x172adf){_0x592a9f=_0x592a9f-0x0;var _0x17370a=_0x0b00[_0x592a9f];return _0x17370a;};'use strict';var Sequelize=require('sequelize');module[_0x00b0('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x00b0('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x00b0('0x2')](0xb),'unique':_0x00b0('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x00b0('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x00b0('0x4')],'defaultValue':_0x00b0('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x00b0('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x00b0('0x4')]},'turnaddr':{'type':Sequelize[_0x00b0('0x4')]},'turnusername':{'type':Sequelize[_0x00b0('0x4')]},'turnpassword':{'type':Sequelize[_0x00b0('0x4')]},'pageTitle':{'type':Sequelize[_0x00b0('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x00b0('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x00b0('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x00b0('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x00b0('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x00b0('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x00b0('0x7')},'chatTimeout':{'type':Sequelize[_0x00b0('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x00b0('0x4')]},'defaultPreferred':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x00b0('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x00b0('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x00b0('0x4')]},'sentiment':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x00b0('0x2')]},'sentimentRegion':{'type':Sequelize[_0x00b0('0x4')]},'language':{'type':Sequelize[_0x00b0('0x4')]},'bucket':{'type':Sequelize[_0x00b0('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x00b0('0x6')],'defaultValue':![]}};
\ No newline at end of file
index ab0bd2d..c5f3385 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bf0=['\x20not\x20found','gdpr','securePassword','server/files/images/logos','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','test','Sequelize','ValidationError','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','Setting','includeAll','rows','catch','show','length','include','find','body','params','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.png','default','upperFirst','existsSync','download','getLogoLogin','getLicense','default_loginLogo.png','custom'];(function(_0x2a5fd6,_0x35a9d6){var _0x12b634=function(_0x4dda0e){while(--_0x4dda0e){_0x2a5fd6['push'](_0x2a5fd6['shift']());}};_0x12b634(++_0x35a9d6);}(_0x0bf0,0x80));var _0x00bf=function(_0xf46abe,_0x403fe){_0xf46abe=_0xf46abe-0x0;var _0x98160=_0x0bf0[_0xf46abe];return _0x98160;};'use strict';var pdf=require(_0x00bf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x00bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00bf('0x2'));var rp=require(_0x00bf('0x3'));var moment=require(_0x00bf('0x4'));var BPromise=require(_0x00bf('0x5'));var Mustache=require(_0x00bf('0x6'));var util=require(_0x00bf('0x7'));var path=require('path');var sox=require(_0x00bf('0x8'));var csv=require(_0x00bf('0x9'));var ejs=require(_0x00bf('0xa'));var fs=require('fs');var _=require(_0x00bf('0xb'));var squel=require(_0x00bf('0xc'));var crypto=require('crypto');var jsforce=require(_0x00bf('0xd'));var deskjs=require(_0x00bf('0xe'));var toCsv=require(_0x00bf('0x9'));var querystring=require('querystring');var Papa=require(_0x00bf('0xf'));var Redis=require(_0x00bf('0x10'));var authService=require(_0x00bf('0x11'));var qs=require(_0x00bf('0x12'));var as=require(_0x00bf('0x13'));var hardwareService=require(_0x00bf('0x14'));var logger=require(_0x00bf('0x15'))(_0x00bf('0x16'));var utils=require('../../config/utils');var config=require(_0x00bf('0x17'));var db=require(_0x00bf('0x18'))['db'];var jayson=require(_0x00bf('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2f1d3d,_0x2cf093,_0x531393){if(_0x531393){var _0x208820=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x208820[_0x00bf('0x1a')](_0x2cf093)){return _0x2f1d3d;}else{throw new db[(_0x00bf('0x1b'))][(_0x00bf('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2f1d3d;}}function respondWithRpcPromise(_0x257add,_0x4e929d,_0x40bd12,_0x45098e){return new BPromise(function(_0xff3014,_0x2602ab){var _0x3c3a62=_0x45098e||client;return _0x3c3a62[_0x00bf('0x1d')](_0x257add,_0x40bd12)[_0x00bf('0x1e')](function(_0x48fa87){logger[_0x00bf('0x1f')](_0x00bf('0x20'),_0x4e929d,_0x00bf('0x21'));logger[_0x00bf('0x22')]('Setting,\x20%s,\x20%s,\x20%s',_0x4e929d,_0x00bf('0x21'),JSON[_0x00bf('0x23')](_0x48fa87));if(_0x48fa87['error']){if(_0x48fa87[_0x00bf('0x24')][_0x00bf('0x25')]===0x1f4){logger[_0x00bf('0x24')](_0x00bf('0x20'),_0x4e929d,_0x48fa87['error']['message']);return _0x2602ab(_0x48fa87[_0x00bf('0x24')][_0x00bf('0x26')]);}logger[_0x00bf('0x24')](_0x00bf('0x20'),_0x4e929d,_0x48fa87['error'][_0x00bf('0x26')]);return _0xff3014(_0x48fa87[_0x00bf('0x24')][_0x00bf('0x26')]);}else{logger[_0x00bf('0x1f')]('Setting,\x20%s,\x20%s',_0x4e929d,_0x00bf('0x21'));_0xff3014(_0x48fa87[_0x00bf('0x27')][_0x00bf('0x26')]);}})['catch'](function(_0x488a55){logger['error']('Setting,\x20%s,\x20%s',_0x4e929d,_0x488a55);_0x2602ab(_0x488a55);});});}function respondWithStatusCode(_0x354fe0,_0x381757){_0x381757=_0x381757||0xcc;return function(_0x5c003f){if(_0x5c003f){return _0x354fe0[_0x00bf('0x28')](_0x381757);}return _0x354fe0['status'](_0x381757)[_0x00bf('0x29')]();};}function respondWithResult(_0x331dcd,_0x3a9f71){_0x3a9f71=_0x3a9f71||0xc8;return function(_0x51b376){if(_0x51b376){return _0x331dcd[_0x00bf('0x2a')](_0x3a9f71)['json'](_0x51b376);}};}function respondWithFilteredResult(_0x10d115,_0x3b1924){return function(_0x1ef24d){if(_0x1ef24d){var _0x2d25f0=_0x1ef24d[_0x00bf('0x2b')],_0xeaabc4=_0x3b1924[_0x00bf('0x2c')],_0x44468c=_0x3b1924[_0x00bf('0x2c')]+_0x3b1924[_0x00bf('0x2d')],_0x2bfb56;if(_0x44468c>=_0x2d25f0){_0x44468c=_0x2d25f0;_0x2bfb56=0xc8;}else{_0x2bfb56=0xce;}_0x10d115['status'](_0x2bfb56);return _0x10d115[_0x00bf('0x2e')](_0x00bf('0x2f'),_0xeaabc4+'-'+_0x44468c+'/'+_0x2d25f0)[_0x00bf('0x30')](_0x1ef24d);}return null;};}function patchUpdates(_0x4c997b){return function(_0x58b8cf){try{jsonpatch[_0x00bf('0x31')](_0x58b8cf,_0x4c997b,!![]);}catch(_0x404274){return BPromise[_0x00bf('0x32')](_0x404274);}return _0x58b8cf[_0x00bf('0x33')]();};}function saveUpdates(_0x21e32f,_0x359825){return function(_0x576077){if(_0x576077){return _0x576077['update'](_0x21e32f)['then'](function(_0x584e30){return _0x584e30;});}return null;};}function removeEntity(_0x4a7329,_0x245a7d){return function(_0x5d7ab9){if(_0x5d7ab9){return _0x5d7ab9[_0x00bf('0x34')]()['then'](function(){_0x4a7329['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b2950,_0x58be74){return function(_0x1c2bc5){if(!_0x1c2bc5){_0x1b2950[_0x00bf('0x28')](0x194);}return _0x1c2bc5;};}function handleError(_0x2feb03,_0x4be79d){_0x4be79d=_0x4be79d||0x1f4;return function(_0x5a162d){logger['error'](_0x5a162d[_0x00bf('0x35')]);if(_0x5a162d[_0x00bf('0x36')]){delete _0x5a162d[_0x00bf('0x36')];}_0x2feb03[_0x00bf('0x2a')](_0x4be79d)[_0x00bf('0x37')](_0x5a162d);};}exports['index']=function(_0x5d2978,_0x22ef22){var _0x3810f4={},_0x3e863e={},_0x5a7137={'count':0x0,'rows':[]};var _0x5a576c=_[_0x00bf('0x38')](db['Setting']['rawAttributes'],function(_0x367395){return{'name':_0x367395[_0x00bf('0x39')],'type':_0x367395[_0x00bf('0x3a')][_0x00bf('0x3b')]};});_0x3e863e[_0x00bf('0x3c')]=_[_0x00bf('0x38')](_0x5a576c,_0x00bf('0x36'));_0x3e863e[_0x00bf('0x3d')]=_[_0x00bf('0x3e')](_0x5d2978[_0x00bf('0x3d')]);_0x3e863e['filters']=_[_0x00bf('0x3f')](_0x3e863e['model'],_0x3e863e[_0x00bf('0x3d')]);_0x3810f4['attributes']=_[_0x00bf('0x3f')](_0x3e863e[_0x00bf('0x3c')],qs[_0x00bf('0x40')](_0x5d2978[_0x00bf('0x3d')][_0x00bf('0x40')]));_0x3810f4['attributes']=_0x3810f4['attributes']['length']?_0x3810f4[_0x00bf('0x41')]:_0x3e863e[_0x00bf('0x3c')];if(!_0x5d2978[_0x00bf('0x3d')][_0x00bf('0x42')](_0x00bf('0x43'))){_0x3810f4[_0x00bf('0x2d')]=qs[_0x00bf('0x2d')](_0x5d2978[_0x00bf('0x3d')]['limit']);_0x3810f4['offset']=qs[_0x00bf('0x2c')](_0x5d2978['query'][_0x00bf('0x2c')]);}_0x3810f4['order']=qs[_0x00bf('0x44')](_0x5d2978[_0x00bf('0x3d')][_0x00bf('0x44')]);_0x3810f4[_0x00bf('0x45')]=qs[_0x00bf('0x46')](_[_0x00bf('0x47')](_0x5d2978[_0x00bf('0x3d')],_0x3e863e[_0x00bf('0x46')]),_0x5a576c);if(_0x5d2978[_0x00bf('0x3d')]['filter']){_0x3810f4[_0x00bf('0x45')]=_[_0x00bf('0x48')](_0x3810f4['where'],{'$or':_['map'](_0x5a576c,function(_0x3b6bca){if(_0x3b6bca[_0x00bf('0x3a')]!==_0x00bf('0x49')){var _0x56190b={};_0x56190b[_0x3b6bca['name']]={'$like':'%'+_0x5d2978[_0x00bf('0x3d')][_0x00bf('0x4a')]+'%'};return _0x56190b;}})});}_0x3810f4=_[_0x00bf('0x48')]({},_0x3810f4,_0x5d2978[_0x00bf('0x4b')]);var _0x1b86e1={'where':_0x3810f4[_0x00bf('0x45')]};return db[_0x00bf('0x4c')]['count'](_0x1b86e1)['then'](function(_0x2b285b){_0x5a7137[_0x00bf('0x2b')]=_0x2b285b;if(_0x5d2978[_0x00bf('0x3d')][_0x00bf('0x4d')]){_0x3810f4['include']=[{'all':!![]}];}return db[_0x00bf('0x4c')]['findAll'](_0x3810f4);})[_0x00bf('0x1e')](function(_0xb5495c){_0x5a7137[_0x00bf('0x4e')]=_0xb5495c;return _0x5a7137;})[_0x00bf('0x1e')](respondWithFilteredResult(_0x22ef22,_0x3810f4))[_0x00bf('0x4f')](handleError(_0x22ef22,null));};exports[_0x00bf('0x50')]=function(_0x53d9d6,_0x56a2e5){var _0x3b652a={'raw':![],'where':{'id':_0x53d9d6['params']['id']}},_0x3d73a4={};_0x3d73a4[_0x00bf('0x3c')]=_[_0x00bf('0x3e')](db[_0x00bf('0x4c')]['rawAttributes']);_0x3d73a4[_0x00bf('0x3d')]=_[_0x00bf('0x3e')](_0x53d9d6[_0x00bf('0x3d')]);_0x3d73a4['filters']=_[_0x00bf('0x3f')](_0x3d73a4[_0x00bf('0x3c')],_0x3d73a4[_0x00bf('0x3d')]);_0x3b652a[_0x00bf('0x41')]=_['intersection'](_0x3d73a4[_0x00bf('0x3c')],qs[_0x00bf('0x40')](_0x53d9d6[_0x00bf('0x3d')][_0x00bf('0x40')]));_0x3b652a[_0x00bf('0x41')]=_0x3b652a[_0x00bf('0x41')][_0x00bf('0x51')]?_0x3b652a[_0x00bf('0x41')]:_0x3d73a4[_0x00bf('0x3c')];if(_0x53d9d6[_0x00bf('0x3d')]['includeAll']){_0x3b652a[_0x00bf('0x52')]=[{'all':!![]}];}_0x3b652a=_[_0x00bf('0x48')]({},_0x3b652a,_0x53d9d6[_0x00bf('0x4b')]);return db[_0x00bf('0x4c')][_0x00bf('0x53')](_0x3b652a)[_0x00bf('0x1e')](handleEntityNotFound(_0x56a2e5,null))[_0x00bf('0x1e')](respondWithResult(_0x56a2e5,null))['catch'](handleError(_0x56a2e5,null));};exports['update']=function(_0x45b7b0,_0x95db6f){if(_0x45b7b0[_0x00bf('0x54')]['id']){delete _0x45b7b0[_0x00bf('0x54')]['id'];}return db[_0x00bf('0x4c')][_0x00bf('0x53')]({'where':{'id':_0x45b7b0[_0x00bf('0x55')]['id']}})[_0x00bf('0x1e')](handleEntityNotFound(_0x95db6f,null))['then'](saveUpdates(_0x45b7b0[_0x00bf('0x54')],null))[_0x00bf('0x1e')](respondWithResult(_0x95db6f,null))[_0x00bf('0x4f')](handleError(_0x95db6f,null));};exports[_0x00bf('0x56')]=function(_0x3a0475,_0x5d6fd6,_0x2c3bb2){if(_0x3a0475[_0x00bf('0x57')]&&_0x3a0475[_0x00bf('0x57')][_0x00bf('0x58')]){_0x3a0475[_0x00bf('0x54')]['logo']=_0x3a0475['file'][_0x00bf('0x58')];}return db[_0x00bf('0x4c')][_0x00bf('0x53')]({'where':{'id':_0x3a0475[_0x00bf('0x55')]['id']}})['then'](handleEntityNotFound(_0x5d6fd6,null))[_0x00bf('0x1e')](saveUpdates(_0x3a0475['body'],null))[_0x00bf('0x1e')](respondWithResult(_0x5d6fd6,null))[_0x00bf('0x4f')](handleError(_0x5d6fd6,null));};exports[_0x00bf('0x59')]=function(_0x1d64f7,_0x970a9f,_0x285a73){if(_0x1d64f7[_0x00bf('0x57')]&&_0x1d64f7[_0x00bf('0x57')][_0x00bf('0x58')]){_0x1d64f7['body'][_0x00bf('0x5a')]=_0x1d64f7[_0x00bf('0x57')][_0x00bf('0x58')];}return db['Setting'][_0x00bf('0x53')]({'where':{'id':_0x1d64f7[_0x00bf('0x55')]['id']}})[_0x00bf('0x1e')](handleEntityNotFound(_0x970a9f,null))['then'](saveUpdates(_0x1d64f7[_0x00bf('0x54')],null))[_0x00bf('0x1e')](respondWithResult(_0x970a9f,null))[_0x00bf('0x4f')](handleError(_0x970a9f,null));};var utilLicense=require(_0x00bf('0x5b'));exports[_0x00bf('0x5c')]=function(_0x39b624,_0x411769,_0x3e25e6){var _0x16515a='server/files/images/logos';var _0x27c16c={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1bf7a9){if(_0x1bf7a9){_0x27c16c=_0x1bf7a9;}return db[_0x00bf('0x4c')]['find']({'where':{'id':_0x39b624['params']['id']},'attributes':[_0x00bf('0x5d'),_0x00bf('0x5a'),_0x00bf('0x5e'),_0x00bf('0x5f'),_0x00bf('0x60'),_0x00bf('0x61'),_0x00bf('0x62'),_0x00bf('0x63')],'raw':!![]});})[_0x00bf('0x1e')](handleEntityNotFound(_0x411769,null))[_0x00bf('0x1e')](function(_0x1e1527){if(_0x1e1527){var _0x44e4ff=_0x1e1527['logo']&&fs['existsSync'](path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0x16515a,_[_0x00bf('0x66')](_0x1e1527[_0x00bf('0x5d')])))?path[_0x00bf('0x64')](config['root'],_0x16515a,_['toLower'](_0x1e1527[_0x00bf('0x5d')])):path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0x16515a,_['toLower'](_0x00bf('0x67')));var _0x416340=_0x00bf('0x68')+_[_0x00bf('0x69')](_0x00bf('0x5d'));if(_0x1e1527[_0x416340]||!_0x27c16c['custom']){_0x44e4ff=path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0x16515a,_[_0x00bf('0x66')](_0x00bf('0x67')));}if(!fs[_0x00bf('0x6a')](_0x44e4ff)){throw new db[(_0x00bf('0x1b'))][(_0x00bf('0x1c'))](_['upperFirst'](_0x00bf('0x5d'))+'\x20not\x20found');}return _0x411769[_0x00bf('0x6b')](_0x44e4ff);}})['catch'](handleError(_0x411769,null));};var utilLicense=require(_0x00bf('0x5b'));exports[_0x00bf('0x6c')]=function(_0x537ad3,_0x1de809,_0x177a01){var _0xae890='server/files/images/logos';var _0x16ed6b={'custom':![]};return utilLicense[_0x00bf('0x6d')]()[_0x00bf('0x1e')](function(_0x4372c4){if(_0x4372c4){_0x16ed6b=_0x4372c4;}return db['Setting'][_0x00bf('0x53')]({'where':{'id':_0x537ad3[_0x00bf('0x55')]['id']},'attributes':[_0x00bf('0x5d'),_0x00bf('0x5a'),_0x00bf('0x5e'),_0x00bf('0x5f'),_0x00bf('0x60'),'defaultLoginLogo',_0x00bf('0x62'),_0x00bf('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x1de809,null))[_0x00bf('0x1e')](function(_0x2947b0){if(_0x2947b0){var _0x382578=_0x2947b0[_0x00bf('0x5a')]&&fs['existsSync'](path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0xae890,_[_0x00bf('0x66')](_0x2947b0['loginLogo'])))?path[_0x00bf('0x64')](config['root'],_0xae890,_[_0x00bf('0x66')](_0x2947b0[_0x00bf('0x5a')])):path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0xae890,_[_0x00bf('0x66')](_0x00bf('0x6e')));var _0x1830d3=_0x00bf('0x68')+_[_0x00bf('0x69')]('loginLogo');if(_0x2947b0[_0x1830d3]||!_0x16ed6b[_0x00bf('0x6f')]){_0x382578=path['join'](config[_0x00bf('0x65')],_0xae890,_[_0x00bf('0x66')](_0x00bf('0x6e')));}if(!fs[_0x00bf('0x6a')](_0x382578)){throw new db[(_0x00bf('0x1b'))][(_0x00bf('0x1c'))](_[_0x00bf('0x69')](_0x00bf('0x5a'))+_0x00bf('0x70'));}return _0x1de809[_0x00bf('0x6b')](_0x382578);}})[_0x00bf('0x4f')](handleError(_0x1de809,null));};exports[_0x00bf('0x71')]=function(_0x3c108f,_0x4dfb8c){return db[_0x00bf('0x4c')]['find']({'where':{'id':_0x3c108f[_0x00bf('0x55')]['id']},'attributes':[_0x00bf('0x72')]})[_0x00bf('0x1e')](respondWithResult(_0x4dfb8c,null))['catch'](handleError(_0x4dfb8c,null));};exports['addPreferred']=function(_0x4d606a,_0x111420,_0x45141d){if(_0x4d606a[_0x00bf('0x57')]&&_0x4d606a['file'][_0x00bf('0x58')]){_0x4d606a[_0x00bf('0x54')][_0x00bf('0x5e')]=_0x4d606a[_0x00bf('0x57')]['filename'];}return db['Setting'][_0x00bf('0x53')]({'where':{'id':_0x4d606a[_0x00bf('0x55')]['id']}})[_0x00bf('0x1e')](handleEntityNotFound(_0x111420,null))[_0x00bf('0x1e')](saveUpdates(_0x4d606a[_0x00bf('0x54')],null))[_0x00bf('0x1e')](respondWithResult(_0x111420,null))[_0x00bf('0x4f')](handleError(_0x111420,null));};var utilLicense=require(_0x00bf('0x5b'));exports['getPreferred']=function(_0x5ab4b9,_0x1411f4,_0x3b355a){var _0x5704f0=_0x00bf('0x73');var _0x3e1653={'custom':![]};return utilLicense[_0x00bf('0x6d')]()[_0x00bf('0x1e')](function(_0xc09412){if(_0xc09412){_0x3e1653=_0xc09412;}return db[_0x00bf('0x4c')]['find']({'where':{'id':_0x5ab4b9[_0x00bf('0x55')]['id']},'attributes':[_0x00bf('0x5d'),'loginLogo',_0x00bf('0x5e'),_0x00bf('0x5f'),_0x00bf('0x60'),_0x00bf('0x61'),_0x00bf('0x62'),_0x00bf('0x63')],'raw':!![]});})[_0x00bf('0x1e')](handleEntityNotFound(_0x1411f4,null))[_0x00bf('0x1e')](function(_0xe389e5){if(_0xe389e5){var _0x40547c=_0xe389e5[_0x00bf('0x5e')]&&fs['existsSync'](path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0x5704f0,_[_0x00bf('0x66')](_0xe389e5[_0x00bf('0x5e')])))?path['join'](config['root'],_0x5704f0,_[_0x00bf('0x66')](_0xe389e5['preferred'])):path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0x5704f0,_['toLower'](_0x00bf('0x74')));var _0x435a21=_0x00bf('0x68')+_['upperFirst'](_0x00bf('0x5e'));if(_0xe389e5[_0x435a21]||!_0x3e1653['custom']||!_0x3e1653[_0x00bf('0x5e')]){_0x40547c=path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0x5704f0,_[_0x00bf('0x66')](_0x00bf('0x74')));}if(!fs[_0x00bf('0x6a')](_0x40547c)){throw new db[(_0x00bf('0x1b'))]['ValidationError'](_[_0x00bf('0x69')](_0x00bf('0x5e'))+'\x20not\x20found');}return _0x1411f4[_0x00bf('0x6b')](_0x40547c);}})[_0x00bf('0x4f')](handleError(_0x1411f4,null));};exports[_0x00bf('0x75')]=function(_0xc25c7f,_0x1cf089,_0x197587){if(_0xc25c7f['file']&&_0xc25c7f[_0x00bf('0x57')][_0x00bf('0x58')]){_0xc25c7f['body']['favicon']=_0xc25c7f['file'][_0x00bf('0x58')];}return db[_0x00bf('0x4c')][_0x00bf('0x53')]({'where':{'id':_0xc25c7f[_0x00bf('0x55')]['id']}})[_0x00bf('0x1e')](handleEntityNotFound(_0x1cf089,null))[_0x00bf('0x1e')](saveUpdates(_0xc25c7f[_0x00bf('0x54')],null))[_0x00bf('0x1e')](respondWithResult(_0x1cf089,null))[_0x00bf('0x4f')](handleError(_0x1cf089,null));};var utilLicense=require(_0x00bf('0x5b'));exports[_0x00bf('0x76')]=function(_0x51df1f,_0x5a2b3c,_0x40bb79){var _0x46969c=_0x00bf('0x73');var _0x2112ba={'custom':![]};return utilLicense[_0x00bf('0x6d')]()[_0x00bf('0x1e')](function(_0x44df7d){if(_0x44df7d){_0x2112ba=_0x44df7d;}return db['Setting'][_0x00bf('0x53')]({'where':{'id':_0x51df1f['params']['id']},'attributes':[_0x00bf('0x5d'),_0x00bf('0x5a'),_0x00bf('0x5e'),_0x00bf('0x5f'),'defaultLogo',_0x00bf('0x61'),_0x00bf('0x62'),_0x00bf('0x63')],'raw':!![]});})[_0x00bf('0x1e')](handleEntityNotFound(_0x5a2b3c,null))[_0x00bf('0x1e')](function(_0x3179f3){if(_0x3179f3){var _0x3f7f7a=_0x3179f3[_0x00bf('0x5f')]&&fs['existsSync'](path['join'](config[_0x00bf('0x65')],_0x46969c,_[_0x00bf('0x66')](_0x3179f3[_0x00bf('0x5f')])))?path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0x46969c,_['toLower'](_0x3179f3['favicon'])):path['join'](config[_0x00bf('0x65')],_0x46969c,_[_0x00bf('0x66')](_0x00bf('0x77')));var _0x4cbfa4=_0x00bf('0x68')+_[_0x00bf('0x69')]('favicon');if(_0x3179f3[_0x4cbfa4]||!_0x2112ba[_0x00bf('0x6f')]){_0x3f7f7a=path[_0x00bf('0x64')](config[_0x00bf('0x65')],_0x46969c,_['toLower'](_0x00bf('0x77')));}if(!fs['existsSync'](_0x3f7f7a)){throw new db['Sequelize']['ValidationError'](_[_0x00bf('0x69')](_0x00bf('0x5f'))+_0x00bf('0x70'));}return _0x5a2b3c['download'](_0x3f7f7a);}})[_0x00bf('0x4f')](handleError(_0x5a2b3c,null));};
\ No newline at end of file
+var _0x89e3=['toLower','default_logo.png','upperFirst','custom','\x20not\x20found','getLogoLogin','favicon','defaultLogo','defaultFavicon','default_loginLogo.png','default','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','ValidationError','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','reject','save','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','Setting','includeAll','include','show','params','options','find','update','body','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','preferred','defaultLoginLogo','defaultPreferred','existsSync','join','root'];(function(_0x12793a,_0x4f77d3){var _0x25beb9=function(_0x2d6c4a){while(--_0x2d6c4a){_0x12793a['push'](_0x12793a['shift']());}};_0x25beb9(++_0x4f77d3);}(_0x89e3,0x1e7));var _0x389e=function(_0x112221,_0x31c1b4){_0x112221=_0x112221-0x0;var _0x3ef12b=_0x89e3[_0x112221];return _0x3ef12b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x389e('0x0'));var rimraf=require(_0x389e('0x1'));var zipdir=require(_0x389e('0x2'));var jsonpatch=require(_0x389e('0x3'));var rp=require('request-promise');var moment=require(_0x389e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x389e('0x5'));var util=require(_0x389e('0x6'));var path=require(_0x389e('0x7'));var sox=require(_0x389e('0x8'));var csv=require('to-csv');var ejs=require(_0x389e('0x9'));var fs=require('fs');var _=require(_0x389e('0xa'));var squel=require(_0x389e('0xb'));var crypto=require(_0x389e('0xc'));var jsforce=require(_0x389e('0xd'));var deskjs=require(_0x389e('0xe'));var toCsv=require(_0x389e('0xf'));var querystring=require(_0x389e('0x10'));var Papa=require(_0x389e('0x11'));var Redis=require('ioredis');var authService=require(_0x389e('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x389e('0x13'));var logger=require('../../config/logger')(_0x389e('0x14'));var utils=require(_0x389e('0x15'));var config=require(_0x389e('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x389e('0x17'));var client=jayson['client'][_0x389e('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4f3d35,_0x17056c,_0x2b1a1c){if(_0x2b1a1c){var _0x1eead9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1eead9[_0x389e('0x19')](_0x17056c)){return _0x4f3d35;}else{throw new db[(_0x389e('0x1a'))][(_0x389e('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4f3d35;}}function respondWithRpcPromise(_0x4676e0,_0x249975,_0x3b8b51,_0x13a726){return new BPromise(function(_0x417490,_0x4cf7ac){var _0x301431=_0x13a726||client;return _0x301431[_0x389e('0x1c')](_0x4676e0,_0x3b8b51)[_0x389e('0x1d')](function(_0x441192){logger[_0x389e('0x1e')](_0x389e('0x1f'),_0x249975,_0x389e('0x20'));logger['debug'](_0x389e('0x21'),_0x249975,'request\x20sent',JSON[_0x389e('0x22')](_0x441192));if(_0x441192[_0x389e('0x23')]){if(_0x441192[_0x389e('0x23')][_0x389e('0x24')]===0x1f4){logger[_0x389e('0x23')](_0x389e('0x1f'),_0x249975,_0x441192['error'][_0x389e('0x25')]);return _0x4cf7ac(_0x441192['error'][_0x389e('0x25')]);}logger[_0x389e('0x23')](_0x389e('0x1f'),_0x249975,_0x441192[_0x389e('0x23')]['message']);return _0x417490(_0x441192[_0x389e('0x23')]['message']);}else{logger[_0x389e('0x1e')](_0x389e('0x1f'),_0x249975,_0x389e('0x20'));_0x417490(_0x441192[_0x389e('0x26')][_0x389e('0x25')]);}})[_0x389e('0x27')](function(_0x21fda9){logger[_0x389e('0x23')](_0x389e('0x1f'),_0x249975,_0x21fda9);_0x4cf7ac(_0x21fda9);});});}function respondWithStatusCode(_0x18b814,_0x54db65){_0x54db65=_0x54db65||0xcc;return function(_0x43a161){if(_0x43a161){return _0x18b814[_0x389e('0x28')](_0x54db65);}return _0x18b814[_0x389e('0x29')](_0x54db65)['end']();};}function respondWithResult(_0x46db3f,_0x44af2d){_0x44af2d=_0x44af2d||0xc8;return function(_0x9d0ede){if(_0x9d0ede){return _0x46db3f[_0x389e('0x29')](_0x44af2d)[_0x389e('0x2a')](_0x9d0ede);}};}function respondWithFilteredResult(_0x107cbe,_0x4b42e8){return function(_0x51307e){if(_0x51307e){var _0x69f977=_0x51307e[_0x389e('0x2b')],_0x420a0d=_0x4b42e8[_0x389e('0x2c')],_0x59578a=_0x4b42e8[_0x389e('0x2c')]+_0x4b42e8['limit'],_0x4dc832;if(_0x59578a>=_0x69f977){_0x59578a=_0x69f977;_0x4dc832=0xc8;}else{_0x4dc832=0xce;}_0x107cbe[_0x389e('0x29')](_0x4dc832);return _0x107cbe[_0x389e('0x2d')]('Content-Range',_0x420a0d+'-'+_0x59578a+'/'+_0x69f977)[_0x389e('0x2a')](_0x51307e);}return null;};}function patchUpdates(_0x164873){return function(_0x566e03){try{jsonpatch['apply'](_0x566e03,_0x164873,!![]);}catch(_0x5e16b2){return BPromise[_0x389e('0x2e')](_0x5e16b2);}return _0x566e03[_0x389e('0x2f')]();};}function saveUpdates(_0x192bd7,_0x8ae077){return function(_0x444f94){if(_0x444f94){return _0x444f94['update'](_0x192bd7)[_0x389e('0x1d')](function(_0x297743){return _0x297743;});}return null;};}function removeEntity(_0x3e0a87,_0x2858cb){return function(_0x5361ff){if(_0x5361ff){return _0x5361ff[_0x389e('0x30')]()[_0x389e('0x1d')](function(){_0x3e0a87[_0x389e('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2115cc,_0x27db87){return function(_0xc390a8){if(!_0xc390a8){_0x2115cc[_0x389e('0x28')](0x194);}return _0xc390a8;};}function handleError(_0x5455ce,_0x265b6f){_0x265b6f=_0x265b6f||0x1f4;return function(_0x172eaf){logger[_0x389e('0x23')](_0x172eaf[_0x389e('0x31')]);if(_0x172eaf[_0x389e('0x32')]){delete _0x172eaf[_0x389e('0x32')];}_0x5455ce[_0x389e('0x29')](_0x265b6f)['send'](_0x172eaf);};}exports[_0x389e('0x33')]=function(_0xa8ca79,_0x50d828){var _0x35ba62={},_0x469fc9={},_0x23c816={'count':0x0,'rows':[]};var _0x1e4658=_[_0x389e('0x34')](db['Setting'][_0x389e('0x35')],function(_0x19ed26){return{'name':_0x19ed26[_0x389e('0x36')],'type':_0x19ed26[_0x389e('0x37')]['key']};});_0x469fc9[_0x389e('0x38')]=_['map'](_0x1e4658,_0x389e('0x32'));_0x469fc9['query']=_[_0x389e('0x39')](_0xa8ca79[_0x389e('0x3a')]);_0x469fc9[_0x389e('0x3b')]=_[_0x389e('0x3c')](_0x469fc9['model'],_0x469fc9['query']);_0x35ba62['attributes']=_[_0x389e('0x3c')](_0x469fc9['model'],qs[_0x389e('0x3d')](_0xa8ca79[_0x389e('0x3a')]['fields']));_0x35ba62[_0x389e('0x3e')]=_0x35ba62[_0x389e('0x3e')][_0x389e('0x3f')]?_0x35ba62[_0x389e('0x3e')]:_0x469fc9[_0x389e('0x38')];if(!_0xa8ca79['query'][_0x389e('0x40')](_0x389e('0x41'))){_0x35ba62[_0x389e('0x42')]=qs[_0x389e('0x42')](_0xa8ca79[_0x389e('0x3a')]['limit']);_0x35ba62['offset']=qs[_0x389e('0x2c')](_0xa8ca79[_0x389e('0x3a')]['offset']);}_0x35ba62['order']=qs['sort'](_0xa8ca79[_0x389e('0x3a')][_0x389e('0x43')]);_0x35ba62[_0x389e('0x44')]=qs[_0x389e('0x3b')](_[_0x389e('0x45')](_0xa8ca79[_0x389e('0x3a')],_0x469fc9['filters']),_0x1e4658);if(_0xa8ca79[_0x389e('0x3a')]['filter']){_0x35ba62[_0x389e('0x44')]=_['merge'](_0x35ba62[_0x389e('0x44')],{'$or':_[_0x389e('0x34')](_0x1e4658,function(_0x2904fc){if(_0x2904fc[_0x389e('0x37')]!==_0x389e('0x46')){var _0x2bb954={};_0x2bb954[_0x2904fc[_0x389e('0x32')]]={'$like':'%'+_0xa8ca79['query'][_0x389e('0x47')]+'%'};return _0x2bb954;}})});}_0x35ba62=_[_0x389e('0x48')]({},_0x35ba62,_0xa8ca79['options']);var _0x46fc00={'where':_0x35ba62['where']};return db[_0x389e('0x49')][_0x389e('0x2b')](_0x46fc00)[_0x389e('0x1d')](function(_0x44e9ec){_0x23c816[_0x389e('0x2b')]=_0x44e9ec;if(_0xa8ca79[_0x389e('0x3a')][_0x389e('0x4a')]){_0x35ba62[_0x389e('0x4b')]=[{'all':!![]}];}return db[_0x389e('0x49')]['findAll'](_0x35ba62);})[_0x389e('0x1d')](function(_0x260675){_0x23c816['rows']=_0x260675;return _0x23c816;})[_0x389e('0x1d')](respondWithFilteredResult(_0x50d828,_0x35ba62))[_0x389e('0x27')](handleError(_0x50d828,null));};exports[_0x389e('0x4c')]=function(_0x536e29,_0x3e5fa0){var _0x28053d={'raw':![],'where':{'id':_0x536e29[_0x389e('0x4d')]['id']}},_0xef208d={};_0xef208d[_0x389e('0x38')]=_[_0x389e('0x39')](db[_0x389e('0x49')][_0x389e('0x35')]);_0xef208d['query']=_[_0x389e('0x39')](_0x536e29['query']);_0xef208d[_0x389e('0x3b')]=_[_0x389e('0x3c')](_0xef208d[_0x389e('0x38')],_0xef208d[_0x389e('0x3a')]);_0x28053d['attributes']=_[_0x389e('0x3c')](_0xef208d[_0x389e('0x38')],qs[_0x389e('0x3d')](_0x536e29[_0x389e('0x3a')]['fields']));_0x28053d[_0x389e('0x3e')]=_0x28053d[_0x389e('0x3e')]['length']?_0x28053d[_0x389e('0x3e')]:_0xef208d[_0x389e('0x38')];if(_0x536e29['query'][_0x389e('0x4a')]){_0x28053d[_0x389e('0x4b')]=[{'all':!![]}];}_0x28053d=_[_0x389e('0x48')]({},_0x28053d,_0x536e29[_0x389e('0x4e')]);return db[_0x389e('0x49')][_0x389e('0x4f')](_0x28053d)[_0x389e('0x1d')](handleEntityNotFound(_0x3e5fa0,null))['then'](respondWithResult(_0x3e5fa0,null))[_0x389e('0x27')](handleError(_0x3e5fa0,null));};exports[_0x389e('0x50')]=function(_0x3bb45c,_0x2dd64){if(_0x3bb45c[_0x389e('0x51')]['id']){delete _0x3bb45c[_0x389e('0x51')]['id'];}return db[_0x389e('0x49')][_0x389e('0x4f')]({'where':{'id':_0x3bb45c[_0x389e('0x4d')]['id']}})[_0x389e('0x1d')](handleEntityNotFound(_0x2dd64,null))[_0x389e('0x1d')](saveUpdates(_0x3bb45c[_0x389e('0x51')],null))[_0x389e('0x1d')](respondWithResult(_0x2dd64,null))[_0x389e('0x27')](handleError(_0x2dd64,null));};exports[_0x389e('0x52')]=function(_0x58cefa,_0x55a33d,_0x59d351){if(_0x58cefa['file']&&_0x58cefa[_0x389e('0x53')][_0x389e('0x54')]){_0x58cefa[_0x389e('0x51')]['logo']=_0x58cefa[_0x389e('0x53')][_0x389e('0x54')];}return db[_0x389e('0x49')]['find']({'where':{'id':_0x58cefa[_0x389e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55a33d,null))[_0x389e('0x1d')](saveUpdates(_0x58cefa[_0x389e('0x51')],null))[_0x389e('0x1d')](respondWithResult(_0x55a33d,null))['catch'](handleError(_0x55a33d,null));};exports[_0x389e('0x55')]=function(_0x1ba1e3,_0x5bacda,_0x409ab7){if(_0x1ba1e3[_0x389e('0x53')]&&_0x1ba1e3[_0x389e('0x53')][_0x389e('0x54')]){_0x1ba1e3[_0x389e('0x51')][_0x389e('0x56')]=_0x1ba1e3[_0x389e('0x53')][_0x389e('0x54')];}return db[_0x389e('0x49')][_0x389e('0x4f')]({'where':{'id':_0x1ba1e3['params']['id']}})['then'](handleEntityNotFound(_0x5bacda,null))[_0x389e('0x1d')](saveUpdates(_0x1ba1e3[_0x389e('0x51')],null))[_0x389e('0x1d')](respondWithResult(_0x5bacda,null))[_0x389e('0x27')](handleError(_0x5bacda,null));};var utilLicense=require(_0x389e('0x57'));exports[_0x389e('0x58')]=function(_0xed3a2b,_0x551e75,_0x2940eb){var _0x3086c1=_0x389e('0x59');var _0x55b6bb={'custom':![]};return utilLicense[_0x389e('0x5a')]()['then'](function(_0x287288){if(_0x287288){_0x55b6bb=_0x287288;}return db[_0x389e('0x49')]['find']({'where':{'id':_0xed3a2b[_0x389e('0x4d')]['id']},'attributes':[_0x389e('0x5b'),_0x389e('0x56'),_0x389e('0x5c'),'favicon','defaultLogo',_0x389e('0x5d'),_0x389e('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x389e('0x1d')](handleEntityNotFound(_0x551e75,null))[_0x389e('0x1d')](function(_0x1f0510){if(_0x1f0510){var _0x13d615=_0x1f0510[_0x389e('0x5b')]&&fs[_0x389e('0x5f')](path[_0x389e('0x60')](config[_0x389e('0x61')],_0x3086c1,_[_0x389e('0x62')](_0x1f0510['logo'])))?path[_0x389e('0x60')](config[_0x389e('0x61')],_0x3086c1,_['toLower'](_0x1f0510['logo'])):path[_0x389e('0x60')](config[_0x389e('0x61')],_0x3086c1,_[_0x389e('0x62')](_0x389e('0x63')));var _0x480060='default'+_[_0x389e('0x64')]('logo');if(_0x1f0510[_0x480060]||!_0x55b6bb[_0x389e('0x65')]){_0x13d615=path['join'](config[_0x389e('0x61')],_0x3086c1,_['toLower'](_0x389e('0x63')));}if(!fs['existsSync'](_0x13d615)){throw new db[(_0x389e('0x1a'))][(_0x389e('0x1b'))](_['upperFirst'](_0x389e('0x5b'))+_0x389e('0x66'));}return _0x551e75['download'](_0x13d615);}})[_0x389e('0x27')](handleError(_0x551e75,null));};var utilLicense=require(_0x389e('0x57'));exports[_0x389e('0x67')]=function(_0x282a6b,_0x2e64c5,_0x478f5a){var _0x2a49f3=_0x389e('0x59');var _0x289dcd={'custom':![]};return utilLicense[_0x389e('0x5a')]()['then'](function(_0xf51fb6){if(_0xf51fb6){_0x289dcd=_0xf51fb6;}return db['Setting']['find']({'where':{'id':_0x282a6b[_0x389e('0x4d')]['id']},'attributes':[_0x389e('0x5b'),_0x389e('0x56'),_0x389e('0x5c'),_0x389e('0x68'),_0x389e('0x69'),'defaultLoginLogo',_0x389e('0x5e'),_0x389e('0x6a')],'raw':!![]});})[_0x389e('0x1d')](handleEntityNotFound(_0x2e64c5,null))[_0x389e('0x1d')](function(_0xd136f5){if(_0xd136f5){var _0x3b4f0d=_0xd136f5[_0x389e('0x56')]&&fs[_0x389e('0x5f')](path[_0x389e('0x60')](config[_0x389e('0x61')],_0x2a49f3,_['toLower'](_0xd136f5['loginLogo'])))?path['join'](config[_0x389e('0x61')],_0x2a49f3,_[_0x389e('0x62')](_0xd136f5[_0x389e('0x56')])):path[_0x389e('0x60')](config[_0x389e('0x61')],_0x2a49f3,_[_0x389e('0x62')](_0x389e('0x6b')));var _0x3c3044=_0x389e('0x6c')+_[_0x389e('0x64')](_0x389e('0x56'));if(_0xd136f5[_0x3c3044]||!_0x289dcd[_0x389e('0x65')]){_0x3b4f0d=path[_0x389e('0x60')](config[_0x389e('0x61')],_0x2a49f3,_[_0x389e('0x62')](_0x389e('0x6b')));}if(!fs['existsSync'](_0x3b4f0d)){throw new db[(_0x389e('0x1a'))][(_0x389e('0x1b'))](_[_0x389e('0x64')](_0x389e('0x56'))+_0x389e('0x66'));}return _0x2e64c5[_0x389e('0x6d')](_0x3b4f0d);}})[_0x389e('0x27')](handleError(_0x2e64c5,null));};exports[_0x389e('0x6e')]=function(_0x2b7514,_0x27ce26){return db[_0x389e('0x49')][_0x389e('0x4f')]({'where':{'id':_0x2b7514[_0x389e('0x4d')]['id']},'attributes':[_0x389e('0x6f')]})['then'](respondWithResult(_0x27ce26,null))['catch'](handleError(_0x27ce26,null));};exports[_0x389e('0x70')]=function(_0xba7ce2,_0x31bef3,_0x22770c){if(_0xba7ce2[_0x389e('0x53')]&&_0xba7ce2[_0x389e('0x53')][_0x389e('0x54')]){_0xba7ce2[_0x389e('0x51')][_0x389e('0x5c')]=_0xba7ce2['file']['filename'];}return db[_0x389e('0x49')][_0x389e('0x4f')]({'where':{'id':_0xba7ce2[_0x389e('0x4d')]['id']}})[_0x389e('0x1d')](handleEntityNotFound(_0x31bef3,null))[_0x389e('0x1d')](saveUpdates(_0xba7ce2[_0x389e('0x51')],null))[_0x389e('0x1d')](respondWithResult(_0x31bef3,null))['catch'](handleError(_0x31bef3,null));};var utilLicense=require('../../config/license/util');exports[_0x389e('0x71')]=function(_0x331c31,_0x4eee40,_0xd01455){var _0x22db6b=_0x389e('0x59');var _0x57738b={'custom':![]};return utilLicense['getLicense']()[_0x389e('0x1d')](function(_0x160be3){if(_0x160be3){_0x57738b=_0x160be3;}return db[_0x389e('0x49')][_0x389e('0x4f')]({'where':{'id':_0x331c31[_0x389e('0x4d')]['id']},'attributes':['logo','loginLogo',_0x389e('0x5c'),_0x389e('0x68'),_0x389e('0x69'),_0x389e('0x5d'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x4eee40,null))[_0x389e('0x1d')](function(_0xb7d0fe){if(_0xb7d0fe){var _0x24d5c4=_0xb7d0fe[_0x389e('0x5c')]&&fs[_0x389e('0x5f')](path[_0x389e('0x60')](config[_0x389e('0x61')],_0x22db6b,_[_0x389e('0x62')](_0xb7d0fe[_0x389e('0x5c')])))?path['join'](config['root'],_0x22db6b,_['toLower'](_0xb7d0fe[_0x389e('0x5c')])):path[_0x389e('0x60')](config['root'],_0x22db6b,_[_0x389e('0x62')](_0x389e('0x72')));var _0x37491a='default'+_[_0x389e('0x64')](_0x389e('0x5c'));if(_0xb7d0fe[_0x37491a]||!_0x57738b[_0x389e('0x65')]||!_0x57738b[_0x389e('0x5c')]){_0x24d5c4=path[_0x389e('0x60')](config['root'],_0x22db6b,_['toLower']('default_preferred.png'));}if(!fs[_0x389e('0x5f')](_0x24d5c4)){throw new db[(_0x389e('0x1a'))][(_0x389e('0x1b'))](_[_0x389e('0x64')]('preferred')+_0x389e('0x66'));}return _0x4eee40[_0x389e('0x6d')](_0x24d5c4);}})['catch'](handleError(_0x4eee40,null));};exports[_0x389e('0x73')]=function(_0x3913e8,_0xb051e6,_0x5528fb){if(_0x3913e8[_0x389e('0x53')]&&_0x3913e8[_0x389e('0x53')][_0x389e('0x54')]){_0x3913e8[_0x389e('0x51')][_0x389e('0x68')]=_0x3913e8[_0x389e('0x53')][_0x389e('0x54')];}return db[_0x389e('0x49')]['find']({'where':{'id':_0x3913e8[_0x389e('0x4d')]['id']}})[_0x389e('0x1d')](handleEntityNotFound(_0xb051e6,null))[_0x389e('0x1d')](saveUpdates(_0x3913e8[_0x389e('0x51')],null))[_0x389e('0x1d')](respondWithResult(_0xb051e6,null))['catch'](handleError(_0xb051e6,null));};var utilLicense=require(_0x389e('0x57'));exports['getFavicon']=function(_0xa98bc1,_0x54396c,_0x459f49){var _0x55401d=_0x389e('0x59');var _0x22db4f={'custom':![]};return utilLicense[_0x389e('0x5a')]()[_0x389e('0x1d')](function(_0x20f0b7){if(_0x20f0b7){_0x22db4f=_0x20f0b7;}return db['Setting']['find']({'where':{'id':_0xa98bc1[_0x389e('0x4d')]['id']},'attributes':[_0x389e('0x5b'),'loginLogo','preferred',_0x389e('0x68'),_0x389e('0x69'),_0x389e('0x5d'),_0x389e('0x5e'),_0x389e('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x54396c,null))['then'](function(_0x48d2f6){if(_0x48d2f6){var _0x298b9a=_0x48d2f6['favicon']&&fs['existsSync'](path['join'](config[_0x389e('0x61')],_0x55401d,_[_0x389e('0x62')](_0x48d2f6[_0x389e('0x68')])))?path[_0x389e('0x60')](config[_0x389e('0x61')],_0x55401d,_[_0x389e('0x62')](_0x48d2f6[_0x389e('0x68')])):path['join'](config[_0x389e('0x61')],_0x55401d,_[_0x389e('0x62')](_0x389e('0x74')));var _0x2a8598=_0x389e('0x6c')+_[_0x389e('0x64')]('favicon');if(_0x48d2f6[_0x2a8598]||!_0x22db4f[_0x389e('0x65')]){_0x298b9a=path['join'](config['root'],_0x55401d,_[_0x389e('0x62')](_0x389e('0x74')));}if(!fs[_0x389e('0x5f')](_0x298b9a)){throw new db[(_0x389e('0x1a'))]['ValidationError'](_[_0x389e('0x64')]('favicon')+_0x389e('0x66'));}return _0x54396c[_0x389e('0x6d')](_0x298b9a);}})[_0x389e('0x27')](handleError(_0x54396c,null));};
\ No newline at end of file
index 43fb29f..a132dc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c79=['exports','define','Setting','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./setting.attributes'];(function(_0x3bf225,_0x27e923){var _0x17666f=function(_0x1f1255){while(--_0x1f1255){_0x3bf225['push'](_0x3bf225['shift']());}};_0x17666f(++_0x27e923);}(_0x5c79,0x1ca));var _0x95c7=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0x5c79[_0x4a7e98];return _0x27d10d;};'use strict';var _=require(_0x95c7('0x0'));var util=require(_0x95c7('0x1'));var logger=require(_0x95c7('0x2'))(_0x95c7('0x3'));var moment=require(_0x95c7('0x4'));var BPromise=require(_0x95c7('0x5'));var rp=require(_0x95c7('0x6'));var fs=require('fs');var path=require(_0x95c7('0x7'));var rimraf=require('rimraf');var config=require(_0x95c7('0x8'));var attributes=require(_0x95c7('0x9'));module[_0x95c7('0xa')]=function(_0x47b2ba,_0x1747e2){return _0x47b2ba[_0x95c7('0xb')](_0x95c7('0xc'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7993=['exports','define','Setting','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./setting.attributes'];(function(_0x546baa,_0x2a3641){var _0x3d151b=function(_0x33b758){while(--_0x33b758){_0x546baa['push'](_0x546baa['shift']());}};_0x3d151b(++_0x2a3641);}(_0x7993,0x87));var _0x3799=function(_0x5b0ac7,_0x22fd0e){_0x5b0ac7=_0x5b0ac7-0x0;var _0x3c1c4b=_0x7993[_0x5b0ac7];return _0x3c1c4b;};'use strict';var _=require(_0x3799('0x0'));var util=require(_0x3799('0x1'));var logger=require(_0x3799('0x2'))(_0x3799('0x3'));var moment=require(_0x3799('0x4'));var BPromise=require(_0x3799('0x5'));var rp=require(_0x3799('0x6'));var fs=require('fs');var path=require(_0x3799('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3799('0x8'));module[_0x3799('0x9')]=function(_0x1d764c,_0x2b251d){return _0x1d764c[_0x3799('0xa')](_0x3799('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 85e73ff..dd58562 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad4f=['debug','stringify','error','message','info','result','catch','ioredis','../../config/logger','../../config/environment','jayson/promise','client','then','Setting,\x20%s,\x20%s','request\x20sent'];(function(_0x482dd9,_0x4ec5e5){var _0xbb957c=function(_0x3d9659){while(--_0x3d9659){_0x482dd9['push'](_0x482dd9['shift']());}};_0xbb957c(++_0x4ec5e5);}(_0xad4f,0xe8));var _0xfad4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xad4f[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfad4('0x0'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfad4('0x1'))('rpc');var config=require(_0xfad4('0x2'));var jayson=require(_0xfad4('0x3'));var client=jayson[_0xfad4('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d20b,_0x111d79,_0x33a345){return new BPromise(function(_0x4e493c,_0x1589fa){return client['request'](_0x40d20b,_0x33a345)[_0xfad4('0x5')](function(_0x4ae179){logger['info'](_0xfad4('0x6'),_0x111d79,_0xfad4('0x7'));logger[_0xfad4('0x8')]('Setting,\x20%s,\x20%s,\x20%s',_0x111d79,_0xfad4('0x7'),JSON[_0xfad4('0x9')](_0x4ae179));if(_0x4ae179[_0xfad4('0xa')]){if(_0x4ae179[_0xfad4('0xa')]['code']===0x1f4){logger[_0xfad4('0xa')](_0xfad4('0x6'),_0x111d79,_0x4ae179[_0xfad4('0xa')][_0xfad4('0xb')]);return _0x1589fa(_0x4ae179[_0xfad4('0xa')][_0xfad4('0xb')]);}logger[_0xfad4('0xa')](_0xfad4('0x6'),_0x111d79,_0x4ae179['error'][_0xfad4('0xb')]);return _0x4e493c(_0x4ae179[_0xfad4('0xa')][_0xfad4('0xb')]);}else{logger[_0xfad4('0xc')](_0xfad4('0x6'),_0x111d79,_0xfad4('0x7'));_0x4e493c(_0x4ae179[_0xfad4('0xd')]['message']);}})[_0xfad4('0xe')](function(_0x241ec6){logger[_0xfad4('0xa')](_0xfad4('0x6'),_0x111d79,_0x241ec6);_0x1589fa(_0x241ec6);});});}
\ No newline at end of file
+var _0x3c9e=['http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x342c52,_0x571d7a){var _0x3ee49a=function(_0x1c01f3){while(--_0x1c01f3){_0x342c52['push'](_0x342c52['shift']());}};_0x3ee49a(++_0x571d7a);}(_0x3c9e,0x1d8));var _0xe3c9=function(_0x4d22e0,_0x111e87){_0x4d22e0=_0x4d22e0-0x0;var _0x86684a=_0x3c9e[_0x4d22e0];return _0x86684a;};'use strict';var _=require(_0xe3c9('0x0'));var util=require(_0xe3c9('0x1'));var moment=require(_0xe3c9('0x2'));var BPromise=require(_0xe3c9('0x3'));var rs=require(_0xe3c9('0x4'));var fs=require('fs');var Redis=require(_0xe3c9('0x5'));var db=require(_0xe3c9('0x6'))['db'];var utils=require(_0xe3c9('0x7'));var logger=require(_0xe3c9('0x8'))('rpc');var config=require(_0xe3c9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe3c9('0xa')][_0xe3c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35de7c,_0x3c27f6,_0x1a3336){return new BPromise(function(_0x4ef5e5,_0x47f17d){return client[_0xe3c9('0xc')](_0x35de7c,_0x1a3336)['then'](function(_0x28352e){logger['info'](_0xe3c9('0xd'),_0x3c27f6,_0xe3c9('0xe'));logger[_0xe3c9('0xf')](_0xe3c9('0x10'),_0x3c27f6,_0xe3c9('0xe'),JSON[_0xe3c9('0x11')](_0x28352e));if(_0x28352e[_0xe3c9('0x12')]){if(_0x28352e['error'][_0xe3c9('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x3c27f6,_0x28352e['error'][_0xe3c9('0x14')]);return _0x47f17d(_0x28352e['error'][_0xe3c9('0x14')]);}logger[_0xe3c9('0x12')](_0xe3c9('0xd'),_0x3c27f6,_0x28352e[_0xe3c9('0x12')]['message']);return _0x4ef5e5(_0x28352e['error'][_0xe3c9('0x14')]);}else{logger[_0xe3c9('0x15')](_0xe3c9('0xd'),_0x3c27f6,_0xe3c9('0xe'));_0x4ef5e5(_0x28352e['result'][_0xe3c9('0x14')]);}})[_0xe3c9('0x16')](function(_0x25a6a6){logger[_0xe3c9('0x12')]('Setting,\x20%s,\x20%s',_0x3c27f6,_0x25a6a6);_0x47f17d(_0x25a6a6);});});}
\ No newline at end of file
index a1468d3..7debb51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x582a=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','/:id/send','send','status','put','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5a3677,_0x2a7eee){var _0x3b8ab7=function(_0x23aae0){while(--_0x23aae0){_0x5a3677['push'](_0x5a3677['shift']());}};_0x3b8ab7(++_0x2a7eee);}(_0x582a,0x131));var _0xa582=function(_0x1496c1,_0x23cf40){_0x1496c1=_0x1496c1-0x0;var _0x48abc0=_0x582a[_0x1496c1];return _0x48abc0;};'use strict';var multer=require(_0xa582('0x0'));var util=require(_0xa582('0x1'));var path=require(_0xa582('0x2'));var timeout=require(_0xa582('0x3'));var express=require(_0xa582('0x4'));var router=express[_0xa582('0x5')]();var auth=require(_0xa582('0x6'));var interaction=require(_0xa582('0x7'));var config=require(_0xa582('0x8'));var controller=require('./smsAccount.controller');router[_0xa582('0x9')]('/',auth[_0xa582('0xa')](),controller['index']);router[_0xa582('0x9')](_0xa582('0xb'),auth[_0xa582('0xa')](),controller[_0xa582('0xc')]);router[_0xa582('0x9')](_0xa582('0xd'),auth[_0xa582('0xa')](),controller[_0xa582('0xe')]);router[_0xa582('0x9')](_0xa582('0xf'),auth[_0xa582('0xa')](),controller[_0xa582('0x10')]);router[_0xa582('0x9')](_0xa582('0x11'),auth[_0xa582('0xa')](),controller[_0xa582('0x12')]);router[_0xa582('0x9')](_0xa582('0x13'),auth[_0xa582('0xa')](),controller['getApplications']);router[_0xa582('0x9')](_0xa582('0x14'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xa582('0x9')](_0xa582('0x15'),controller[_0xa582('0x16')]);router[_0xa582('0x9')](_0xa582('0x17'),auth[_0xa582('0xa')](),controller[_0xa582('0x18')]);router[_0xa582('0x19')]('/',auth[_0xa582('0xa')](),controller[_0xa582('0x1a')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa582('0x1b')]);router[_0xa582('0x19')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0xa582('0x19')](_0xa582('0x1c'),controller[_0xa582('0x1d')]);router['post'](_0xa582('0x13'),auth['isAuthenticated'](),controller[_0xa582('0x1e')]);router[_0xa582('0x19')](_0xa582('0x1f'),auth[_0xa582('0xa')](),controller[_0xa582('0x20')]);router[_0xa582('0x19')](_0xa582('0x15'),controller[_0xa582('0x21')]);router['post'](_0xa582('0x17'),auth[_0xa582('0xa')](),controller['addAgents']);router[_0xa582('0x22')](_0xa582('0xd'),auth[_0xa582('0xa')](),controller['update']);router[_0xa582('0x23')](_0xa582('0xd'),auth[_0xa582('0xa')](),controller[_0xa582('0x24')]);router[_0xa582('0x23')](_0xa582('0xf'),auth[_0xa582('0xa')](),controller['removeDispositions']);router[_0xa582('0x23')](_0xa582('0x11'),auth[_0xa582('0xa')](),controller[_0xa582('0x25')]);router[_0xa582('0x23')](_0xa582('0x17'),auth[_0xa582('0xa')](),controller[_0xa582('0x26')]);module['exports']=router;
\ No newline at end of file
+var _0x78aa=['/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','post','create','addAnswer','/:id/notify','addApplications','status','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x31df23,_0x46f0e1){var _0x438a31=function(_0x1d6d77){while(--_0x1d6d77){_0x31df23['push'](_0x31df23['shift']());}};_0x438a31(++_0x46f0e1);}(_0x78aa,0xa5));var _0xa78a=function(_0x4e54ea,_0x2fee48){_0x4e54ea=_0x4e54ea-0x0;var _0x1872f4=_0x78aa[_0x4e54ea];return _0x1872f4;};'use strict';var multer=require(_0xa78a('0x0'));var util=require(_0xa78a('0x1'));var path=require('path');var timeout=require(_0xa78a('0x2'));var express=require(_0xa78a('0x3'));var router=express[_0xa78a('0x4')]();var auth=require(_0xa78a('0x5'));var interaction=require(_0xa78a('0x6'));var config=require(_0xa78a('0x7'));var controller=require('./smsAccount.controller');router[_0xa78a('0x8')]('/',auth[_0xa78a('0x9')](),controller['index']);router[_0xa78a('0x8')](_0xa78a('0xa'),auth['isAuthenticated'](),controller[_0xa78a('0xb')]);router['get'](_0xa78a('0xc'),auth[_0xa78a('0x9')](),controller[_0xa78a('0xd')]);router[_0xa78a('0x8')](_0xa78a('0xe'),auth[_0xa78a('0x9')](),controller['getDispositions']);router['get'](_0xa78a('0xf'),auth[_0xa78a('0x9')](),controller[_0xa78a('0x10')]);router[_0xa78a('0x8')](_0xa78a('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa78a('0x8')](_0xa78a('0x12'),auth[_0xa78a('0x9')](),controller['getInteractions']);router['get'](_0xa78a('0x13'),controller[_0xa78a('0x14')]);router[_0xa78a('0x8')](_0xa78a('0x15'),auth['isAuthenticated'](),controller[_0xa78a('0x16')]);router[_0xa78a('0x17')]('/',auth[_0xa78a('0x9')](),controller[_0xa78a('0x18')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xa78a('0xf'),auth[_0xa78a('0x9')](),controller[_0xa78a('0x19')]);router[_0xa78a('0x17')](_0xa78a('0x1a'),controller['notify']);router[_0xa78a('0x17')](_0xa78a('0x11'),auth['isAuthenticated'](),controller[_0xa78a('0x1b')]);router['post']('/:id/send',auth[_0xa78a('0x9')](),controller['send']);router[_0xa78a('0x17')](_0xa78a('0x13'),controller[_0xa78a('0x1c')]);router[_0xa78a('0x17')](_0xa78a('0x15'),auth[_0xa78a('0x9')](),controller['addAgents']);router[_0xa78a('0x1d')](_0xa78a('0xc'),auth[_0xa78a('0x9')](),controller[_0xa78a('0x1e')]);router[_0xa78a('0x1f')]('/:id',auth[_0xa78a('0x9')](),controller[_0xa78a('0x20')]);router[_0xa78a('0x1f')](_0xa78a('0xe'),auth[_0xa78a('0x9')](),controller[_0xa78a('0x21')]);router['delete'](_0xa78a('0xf'),auth[_0xa78a('0x9')](),controller[_0xa78a('0x22')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xa78a('0x23')]);module['exports']=router;
\ No newline at end of file
index 0f16f9b..6f42f4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14c1=['clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','twilio','skebby','connectel','clicksend'];(function(_0x24ecff,_0x5f0aca){var _0x38984c=function(_0x2752fc){while(--_0x2752fc){_0x24ecff['push'](_0x24ecff['shift']());}};_0x38984c(++_0x5f0aca);}(_0x14c1,0x128));var _0x114c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x14c1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x114c('0x0'));var rs=require('randomstring');module[_0x114c('0x1')]={'name':{'type':Sequelize[_0x114c('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x114c('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x114c('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x114c('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x114c('0x2')]},'type':{'type':Sequelize[_0x114c('0x3')](_0x114c('0x4'),_0x114c('0x5'),_0x114c('0x6'),_0x114c('0x7'),'plivo',_0x114c('0x8'),_0x114c('0x9'),_0x114c('0xa'),_0x114c('0xb'))},'accountSid':{'type':Sequelize[_0x114c('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x114c('0x2')]},'smsMethod':{'type':Sequelize[_0x114c('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0x114c('0x2')]},'password':{'type':Sequelize[_0x114c('0x2')]},'apiKey':{'type':Sequelize[_0x114c('0x2')]},'senderString':{'type':Sequelize[_0x114c('0x2')]},'deliveryReport':{'type':Sequelize[_0x114c('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x114c('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x114c('0xd');}},'notificationSound':{'type':Sequelize[_0x114c('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x114c('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x114c('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x114c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x114c('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x114c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x114c('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x114c('0xe')],'comment':_0x114c('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x114c('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x23ff36){if(!_0x23ff36)this[_0x114c('0x10')](_0x114c('0x11'),null);this[_0x114c('0x10')](_0x114c('0x12'),_0x23ff36);}}};
\ No newline at end of file
+var _0xfc9f=['exports','STRING','name','generate','twilio','skebby','connectel','plivo','clickatell','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x3b1bcb,_0x34f49e){var _0x5d2085=function(_0x4993df){while(--_0x4993df){_0x3b1bcb['push'](_0x3b1bcb['shift']());}};_0x5d2085(++_0x34f49e);}(_0xfc9f,0x1e2));var _0xffc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc9f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xffc9('0x0'));var rs=require(_0xffc9('0x1'));module[_0xffc9('0x2')]={'name':{'type':Sequelize[_0xffc9('0x3')],'unique':_0xffc9('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xffc9('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xffc9('0x3')],'defaultValue':function(){return rs[_0xffc9('0x5')]();}},'phone':{'type':Sequelize[_0xffc9('0x3')]},'type':{'type':Sequelize['ENUM'](_0xffc9('0x6'),_0xffc9('0x7'),_0xffc9('0x8'),'clicksend',_0xffc9('0x9'),_0xffc9('0xa'),_0xffc9('0xb'),_0xffc9('0xc'),_0xffc9('0xd'))},'accountSid':{'type':Sequelize[_0xffc9('0x3')]},'authId':{'type':Sequelize[_0xffc9('0x3')]},'authToken':{'type':Sequelize[_0xffc9('0x3')]},'smsMethod':{'type':Sequelize[_0xffc9('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0xffc9('0x3')]},'password':{'type':Sequelize[_0xffc9('0x3')]},'apiKey':{'type':Sequelize[_0xffc9('0x3')]},'senderString':{'type':Sequelize[_0xffc9('0x3')]},'deliveryReport':{'type':Sequelize[_0xffc9('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xffc9('0x3')]},'notificationTemplate':{'type':Sequelize[_0xffc9('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xffc9('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xffc9('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xffc9('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xffc9('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xffc9('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xffc9('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xffc9('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xffc9('0x11')],'comment':_0xffc9('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xffc9('0xf')],'defaultValue':![],'comment':_0xffc9('0x13'),'set':function(_0x231d35){if(!_0x231d35)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xffc9('0x14')](_0xffc9('0x15'),_0x231d35);}}};
\ No newline at end of file
index a02a07b..c7c39d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['show','params','fields','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','sort','pick','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','account','applications','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','entity\x20found','stringify','Content-Type','text/xml','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','DESC','dataValues','Messages','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','intelepeer','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','test','ValidationError','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','save','destroy','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','limit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x7995('0x1e'));var client=jayson[_0x7995('0x1f')][_0x7995('0x20')]({'port':0x232c});function checkPasswordPattern(_0x321ae8,_0x3f1d3e,_0x1a5310){if(_0x1a5310){var _0x2202ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2202ce[_0x7995('0x21')](_0x3f1d3e)){return _0x321ae8;}else{throw new db['Sequelize'][(_0x7995('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x321ae8;}}function respondWithRpcPromise(_0x2f832e,_0x37f297,_0x43d4b8,_0x291317){return new BPromise(function(_0x1e1415,_0x37a7d4){var _0x4faa60=_0x291317||client;return _0x4faa60['request'](_0x2f832e,_0x43d4b8)[_0x7995('0x23')](function(_0x5e6f90){logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));logger['debug'](_0x7995('0x26'),_0x37f297,'request\x20sent',JSON['stringify'](_0x5e6f90));if(_0x5e6f90[_0x7995('0x27')]){if(_0x5e6f90[_0x7995('0x27')][_0x7995('0x28')]===0x1f4){logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')]['message']);return _0x37a7d4(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);return _0x1e1415(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}else{logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));_0x1e1415(_0x5e6f90[_0x7995('0x2a')][_0x7995('0x29')]);}})[_0x7995('0x2b')](function(_0x2a307e){logger['error'](_0x7995('0x24'),_0x37f297,_0x2a307e);_0x37a7d4(_0x2a307e);});});}function respondWithStatusCode(_0x5911c3,_0x229742){_0x229742=_0x229742||0xcc;return function(_0x49bc7e){if(_0x49bc7e){return _0x5911c3[_0x7995('0x2c')](_0x229742);}return _0x5911c3[_0x7995('0x2d')](_0x229742)[_0x7995('0x2e')]();};}function respondWithResult(_0x4b6f99,_0x9b2a15){_0x9b2a15=_0x9b2a15||0xc8;return function(_0x514445){if(_0x514445){return _0x4b6f99[_0x7995('0x2d')](_0x9b2a15)[_0x7995('0x2f')](_0x514445);}};}function respondWithFilteredResult(_0x4253e5,_0x574574){return function(_0x530611){if(_0x530611){var _0x48e573=_0x530611[_0x7995('0x30')],_0x3573be=_0x574574[_0x7995('0x31')],_0xe6b0b3=_0x574574[_0x7995('0x31')]+_0x574574['limit'],_0x327a81;if(_0xe6b0b3>=_0x48e573){_0xe6b0b3=_0x48e573;_0x327a81=0xc8;}else{_0x327a81=0xce;}_0x4253e5['status'](_0x327a81);return _0x4253e5[_0x7995('0x32')]('Content-Range',_0x3573be+'-'+_0xe6b0b3+'/'+_0x48e573)[_0x7995('0x2f')](_0x530611);}return null;};}function patchUpdates(_0x3eb566){return function(_0x29fac5){try{jsonpatch[_0x7995('0x33')](_0x29fac5,_0x3eb566,!![]);}catch(_0x1f7d27){return BPromise['reject'](_0x1f7d27);}return _0x29fac5[_0x7995('0x34')]();};}function saveUpdates(_0x33e24e,_0x5dd802){return function(_0x48db25){if(_0x48db25){return _0x48db25['update'](_0x33e24e)[_0x7995('0x23')](function(_0x3acfc3){return _0x3acfc3;});}return null;};}function removeEntity(_0x4a176f,_0x3e7020){return function(_0x51b95d){if(_0x51b95d){return _0x51b95d[_0x7995('0x35')]()[_0x7995('0x23')](function(){var _0x177cb4=_0x51b95d['get']({'plain':!![]});var _0x52d76d=_0x7995('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x52d76d,'resourceId':_0x177cb4['id']}})[_0x7995('0x23')](function(){return _0x51b95d;});})[_0x7995('0x23')](function(){_0x4a176f['status'](0xcc)[_0x7995('0x2e')]();});}};}function handleEntityNotFound(_0x1922b4,_0x2b772f){return function(_0x18667c){if(!_0x18667c){_0x1922b4[_0x7995('0x2c')](0x194);}return _0x18667c;};}function handleError(_0x53002a,_0x2d4285){_0x2d4285=_0x2d4285||0x1f4;return function(_0x242713){logger[_0x7995('0x27')](_0x242713[_0x7995('0x37')]);if(_0x242713['name']){delete _0x242713[_0x7995('0x38')];}_0x53002a[_0x7995('0x2d')](_0x2d4285)[_0x7995('0x39')](_0x242713);};}exports[_0x7995('0x3a')]=function(_0x1f5bee,_0x1035dc){var _0x5688a1={'include':[{'model':db[_0x7995('0x3b')],'as':_0x7995('0x3c')}]},_0x183a68={},_0x3be298={'count':0x0,'rows':[]};var _0x2e04cd=_[_0x7995('0x3d')](db[_0x7995('0x3e')][_0x7995('0x3f')],function(_0x1234e1){return{'name':_0x1234e1[_0x7995('0x40')],'type':_0x1234e1[_0x7995('0x41')][_0x7995('0x42')]};});_0x183a68[_0x7995('0x43')]=_['map'](_0x2e04cd,'name');_0x183a68[_0x7995('0x44')]=_[_0x7995('0x45')](_0x1f5bee['query']);_0x183a68['filters']=_[_0x7995('0x46')](_0x183a68['model'],_0x183a68['query']);_0x5688a1[_0x7995('0x47')]=_[_0x7995('0x46')](_0x183a68[_0x7995('0x43')],qs['fields'](_0x1f5bee[_0x7995('0x44')]['fields']));_0x5688a1[_0x7995('0x47')]=_0x5688a1['attributes']['length']?_0x5688a1[_0x7995('0x47')]:_0x183a68[_0x7995('0x43')];if(!_0x1f5bee[_0x7995('0x44')][_0x7995('0x48')]('nolimit')){_0x5688a1[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x1f5bee[_0x7995('0x44')][_0x7995('0x49')]);_0x5688a1['offset']=qs['offset'](_0x1f5bee[_0x7995('0x44')]['offset']);}_0x5688a1[_0x7995('0x4a')]=qs['sort'](_0x1f5bee[_0x7995('0x44')]['sort']);_0x5688a1[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x1f5bee[_0x7995('0x44')],_0x183a68[_0x7995('0x4c')]),_0x2e04cd);if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x4d')]){_0x5688a1['where']=_[_0x7995('0x4e')](_0x5688a1[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x2e04cd,function(_0x491184){if(_0x491184[_0x7995('0x41')]!==_0x7995('0x4f')){var _0x511567={};_0x511567[_0x491184[_0x7995('0x38')]]={'$like':'%'+_0x1f5bee[_0x7995('0x44')]['filter']+'%'};return _0x511567;}})});}_0x5688a1=_[_0x7995('0x4e')]({},_0x5688a1,_0x1f5bee[_0x7995('0x50')]);var _0x5921b9={'where':_0x5688a1[_0x7995('0x4b')]};return db['SmsAccount'][_0x7995('0x30')](_0x5921b9)[_0x7995('0x23')](function(_0x1afab4){_0x3be298[_0x7995('0x30')]=_0x1afab4;if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x51')]){_0x5688a1[_0x7995('0x52')]=[{'all':!![]}];}return db['SmsAccount'][_0x7995('0x53')](_0x5688a1);})[_0x7995('0x23')](function(_0x418eb9){_0x3be298['rows']=_0x418eb9;return _0x3be298;})[_0x7995('0x23')](respondWithFilteredResult(_0x1035dc,_0x5688a1))[_0x7995('0x2b')](handleError(_0x1035dc,null));};exports[_0x7995('0x54')]=function(_0x47d1d8,_0x4ec548){var _0x5a592e={'raw':![],'where':{'id':_0x47d1d8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]},_0xb70620={};_0xb70620[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0x3e')][_0x7995('0x3f')]);_0xb70620['query']=_[_0x7995('0x45')](_0x47d1d8['query']);_0xb70620[_0x7995('0x4c')]=_[_0x7995('0x46')](_0xb70620[_0x7995('0x43')],_0xb70620['query']);_0x5a592e['attributes']=_['intersection'](_0xb70620['model'],qs[_0x7995('0x56')](_0x47d1d8[_0x7995('0x44')][_0x7995('0x56')]));_0x5a592e[_0x7995('0x47')]=_0x5a592e[_0x7995('0x47')][_0x7995('0x57')]?_0x5a592e[_0x7995('0x47')]:_0xb70620[_0x7995('0x43')];if(_0x47d1d8[_0x7995('0x44')][_0x7995('0x51')]){_0x5a592e[_0x7995('0x52')]=[{'all':!![]}];}_0x5a592e=_[_0x7995('0x4e')]({},_0x5a592e,_0x47d1d8[_0x7995('0x50')]);return db[_0x7995('0x3e')][_0x7995('0x58')](_0x5a592e)[_0x7995('0x23')](handleEntityNotFound(_0x4ec548,null))[_0x7995('0x23')](respondWithResult(_0x4ec548,null))[_0x7995('0x2b')](handleError(_0x4ec548,null));};exports[_0x7995('0x59')]=function(_0x50b7c2,_0x56a374){return db[_0x7995('0x3e')][_0x7995('0x59')](_0x50b7c2[_0x7995('0x5a')],{})['then'](function(_0x53125a){var _0x402fa0=_0x50b7c2[_0x7995('0x5b')][_0x7995('0x5c')]({'plain':!![]});if(!_0x402fa0)throw new Error(_0x7995('0x5d'));if(_0x402fa0['role']===_0x7995('0x5b')){var _0x74ff38=_0x53125a[_0x7995('0x5c')]({'plain':!![]});var _0x33c49c='SmsAccounts';return db['UserProfileSection'][_0x7995('0x58')]({'where':{'name':_0x33c49c,'userProfileId':_0x402fa0[_0x7995('0x5e')]},'raw':!![]})[_0x7995('0x23')](function(_0x1d69ce){if(_0x1d69ce&&_0x1d69ce[_0x7995('0x5f')]===0x0){return db[_0x7995('0x60')][_0x7995('0x59')]({'name':_0x74ff38[_0x7995('0x38')],'resourceId':_0x74ff38['id'],'type':_0x1d69ce[_0x7995('0x38')],'sectionId':_0x1d69ce['id']},{})['then'](function(){return _0x53125a;});}else{return _0x53125a;}})[_0x7995('0x2b')](function(_0x3ec5a8){logger[_0x7995('0x27')](_0x7995('0x61'),_0x3ec5a8);throw _0x3ec5a8;});}return _0x53125a;})['then'](respondWithResult(_0x56a374,0xc9))['catch'](handleError(_0x56a374,null));};exports[_0x7995('0x62')]=function(_0xebb5c8,_0x47d5d7){if(_0xebb5c8[_0x7995('0x5a')]['id']){delete _0xebb5c8[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xebb5c8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]})['then'](handleEntityNotFound(_0x47d5d7,null))[_0x7995('0x23')](saveUpdates(_0xebb5c8[_0x7995('0x5a')],null))[_0x7995('0x23')](respondWithResult(_0x47d5d7,null))[_0x7995('0x2b')](handleError(_0x47d5d7,null));};exports[_0x7995('0x35')]=function(_0xeb8920,_0x2b3c1d){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xeb8920[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x2b3c1d,null))[_0x7995('0x23')](removeEntity(_0x2b3c1d,null))['catch'](handleError(_0x2b3c1d,null));};exports[_0x7995('0x63')]=function(_0x23bbc1,_0x293480){return db[_0x7995('0x3e')][_0x7995('0x63')]()['then'](respondWithResult(_0x293480,null))['catch'](handleError(_0x293480,null));};exports[_0x7995('0x64')]=function(_0x87e38d,_0x221542,_0xae6166){if(_0x87e38d['body']['id']){delete _0x87e38d[_0x7995('0x5a')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x87e38d[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x221542,null))[_0x7995('0x23')](function(_0x44bf2b){if(_0x44bf2b){_0x87e38d[_0x7995('0x5a')][_0x7995('0x65')]=_0x44bf2b['id'];return db[_0x7995('0x66')][_0x7995('0x59')](_0x87e38d[_0x7995('0x5a')]);}})[_0x7995('0x23')](respondWithResult(_0x221542,null))['catch'](handleError(_0x221542,null));};exports[_0x7995('0x67')]=function(_0x8908cd,_0x3c5802,_0x4cc247){var _0x1fe1cb={'raw':![],'where':{}};var _0x1d2f9d={};var _0x705f0={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x8908cd[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3c5802,null))[_0x7995('0x23')](function(_0x2f94c4){if(_0x2f94c4){_0x1d2f9d[_0x7995('0x43')]=_[_0x7995('0x45')](db['Disposition']['rawAttributes']);_0x1d2f9d[_0x7995('0x44')]=_[_0x7995('0x45')](_0x8908cd[_0x7995('0x44')]);_0x1d2f9d[_0x7995('0x4c')]=_['intersection'](_0x1d2f9d[_0x7995('0x43')],_0x1d2f9d[_0x7995('0x44')]);_0x1fe1cb['attributes']=_['intersection'](_0x1d2f9d[_0x7995('0x43')],qs[_0x7995('0x56')](_0x8908cd['query'][_0x7995('0x56')]));_0x1fe1cb['attributes']=_0x1fe1cb[_0x7995('0x47')][_0x7995('0x57')]?_0x1fe1cb['attributes']:_0x1d2f9d['model'];if(!_0x8908cd[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x1fe1cb[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x8908cd[_0x7995('0x44')][_0x7995('0x49')]);_0x1fe1cb[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x8908cd[_0x7995('0x44')][_0x7995('0x31')]);}_0x1fe1cb[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x8908cd[_0x7995('0x44')][_0x7995('0x6a')]);_0x1fe1cb[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x8908cd[_0x7995('0x44')],_0x1d2f9d[_0x7995('0x4c')]));_0x1fe1cb[_0x7995('0x4b')][_0x7995('0x65')]=_0x2f94c4['id'];if(_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]){_0x1fe1cb[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x1fe1cb[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x1fe1cb[_0x7995('0x47')],function(_0x34724d){var _0x59efff={};_0x59efff[_0x34724d]={'$like':'%'+_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x59efff;})});}_0x1fe1cb=_['merge']({},_0x1fe1cb,_0x8908cd['options']);return db[_0x7995('0x66')][_0x7995('0x30')]({'where':_0x1fe1cb[_0x7995('0x4b')]})[_0x7995('0x23')](function(_0xe1ce4){_0x705f0[_0x7995('0x30')]=_0xe1ce4;if(_0x8908cd['query'][_0x7995('0x51')]){_0x1fe1cb[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x66')][_0x7995('0x53')](_0x1fe1cb);})[_0x7995('0x23')](function(_0x3f0bff){_0x705f0[_0x7995('0x6c')]=_0x3f0bff;return _0x705f0;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x3c5802,_0x1fe1cb))['catch'](handleError(_0x3c5802,null));};exports[_0x7995('0x6d')]=function(_0x2b8217,_0x5c04c9,_0x479271){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x2b8217[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x5c04c9,null))[_0x7995('0x23')](function(_0x4a02ea){if(_0x4a02ea){return _0x4a02ea[_0x7995('0x6d')](_0x2b8217[_0x7995('0x44')]['ids']);}})[_0x7995('0x23')](respondWithStatusCode(_0x5c04c9,null))[_0x7995('0x2b')](handleError(_0x5c04c9,null));};exports['addAnswer']=function(_0x1535a3,_0x4a5bc5,_0x135191){if(_0x1535a3[_0x7995('0x5a')]['id']){delete _0x1535a3[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x1535a3['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4a5bc5,null))[_0x7995('0x23')](function(_0x38b37f){if(_0x38b37f){_0x1535a3['body'][_0x7995('0x65')]=_0x38b37f['id'];return db[_0x7995('0x6e')][_0x7995('0x59')](_0x1535a3[_0x7995('0x5a')]);}})['then'](respondWithResult(_0x4a5bc5,null))[_0x7995('0x2b')](handleError(_0x4a5bc5,null));};exports[_0x7995('0x6f')]=function(_0x3a5f5e,_0x4aafa3,_0x5358d4){var _0x3fc10={'raw':![],'where':{}};var _0x333379={};var _0x4800a8={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x3a5f5e[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4aafa3,null))[_0x7995('0x23')](function(_0x2ba606){if(_0x2ba606){_0x333379['model']=_['keys'](db[_0x7995('0x6e')]['rawAttributes']);_0x333379['query']=_[_0x7995('0x45')](_0x3a5f5e[_0x7995('0x44')]);_0x333379[_0x7995('0x4c')]=_['intersection'](_0x333379[_0x7995('0x43')],_0x333379[_0x7995('0x44')]);_0x3fc10[_0x7995('0x47')]=_[_0x7995('0x46')](_0x333379[_0x7995('0x43')],qs['fields'](_0x3a5f5e[_0x7995('0x44')][_0x7995('0x56')]));_0x3fc10[_0x7995('0x47')]=_0x3fc10[_0x7995('0x47')]['length']?_0x3fc10[_0x7995('0x47')]:_0x333379[_0x7995('0x43')];if(!_0x3a5f5e['query'][_0x7995('0x48')](_0x7995('0x69'))){_0x3fc10['limit']=qs[_0x7995('0x49')](_0x3a5f5e['query'][_0x7995('0x49')]);_0x3fc10['offset']=qs[_0x7995('0x31')](_0x3a5f5e['query'][_0x7995('0x31')]);}_0x3fc10[_0x7995('0x4a')]=qs['sort'](_0x3a5f5e[_0x7995('0x44')]['sort']);_0x3fc10['where']=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x3a5f5e[_0x7995('0x44')],_0x333379[_0x7995('0x4c')]));_0x3fc10['where'][_0x7995('0x65')]=_0x2ba606['id'];if(_0x3a5f5e[_0x7995('0x44')]['filter']){_0x3fc10['where']=_[_0x7995('0x4e')](_0x3fc10['where'],{'$or':_[_0x7995('0x3d')](_0x3fc10[_0x7995('0x47')],function(_0xfb4479){var _0x5b42be={};_0x5b42be[_0xfb4479]={'$like':'%'+_0x3a5f5e['query'][_0x7995('0x4d')]+'%'};return _0x5b42be;})});}_0x3fc10=_['merge']({},_0x3fc10,_0x3a5f5e[_0x7995('0x50')]);return db[_0x7995('0x6e')][_0x7995('0x30')]({'where':_0x3fc10[_0x7995('0x4b')]})['then'](function(_0x52d102){_0x4800a8['count']=_0x52d102;if(_0x3a5f5e[_0x7995('0x44')][_0x7995('0x51')]){_0x3fc10[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x6e')][_0x7995('0x53')](_0x3fc10);})[_0x7995('0x23')](function(_0x59a793){_0x4800a8['rows']=_0x59a793;return _0x4800a8;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x4aafa3,_0x3fc10))['catch'](handleError(_0x4aafa3,null));};exports['removeAnswers']=function(_0x17d00f,_0x5e95c0,_0x57a164){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x17d00f[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e95c0,null))[_0x7995('0x23')](function(_0xf604d9){if(_0xf604d9){return _0xf604d9[_0x7995('0x70')](_0x17d00f[_0x7995('0x44')][_0x7995('0x71')]);}})[_0x7995('0x23')](respondWithStatusCode(_0x5e95c0,null))[_0x7995('0x2b')](handleError(_0x5e95c0,null));};exports[_0x7995('0x72')]=function(_0x19d746,_0x570b71,_0x3eb3fa){var _0x87a539={'channel':_0x7995('0x73')};var _0x2056da=[];var _0x2a01d4=[];var _0x5a4695={};return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x19d746[_0x7995('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x17f7d6){_0x87a539[_0x7995('0x74')]=_0x17f7d6;_0x87a539[_0x7995('0x75')]=_[_0x7995('0x76')](_0x17f7d6[_0x7995('0x77')],['priority'],[_0x7995('0x78')]);if(_0x87a539['account'][_0x7995('0x77')]){delete _0x87a539[_0x7995('0x74')][_0x7995('0x77')];}return db[_0x7995('0x79')][_0x7995('0x63')]();})[_0x7995('0x23')](function(_0x4f929b){if(!_0x4f929b){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x7b'));}_0x2056da=_[_0x7995('0x7c')](_['keys'](_0x4f929b),[_0x7995('0x7d'),'updatedAt']);_0x2a01d4=_[_0x7995('0x7c')](_[_0x7995('0x45')](_0x4f929b),['createdAt','updatedAt',_0x7995('0x7e'),_0x7995('0x7f')]);_0x87a539[_0x7995('0x5a')]={'mapKey':_0x7995('0x80')};if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){switch(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){case _0x7995('0x81'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x83')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x85')];break;case _0x7995('0x86'):_0x87a539['body'][_0x7995('0x82')]='+'+_0x19d746['body'][_0x7995('0x87')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x88')];break;case _0x7995('0x89'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['message'];break;case _0x7995('0x8a'):_0x87a539[_0x7995('0x5a')]['from']=_0x19d746['body'][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['body'];_0x87a539['body'][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8b')];break;case _0x7995('0x8c'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')]['Text'];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x8d')];break;case _0x7995('0x8e'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]='+'+_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x88')];_0x87a539[_0x7995('0x5a')]['messageId']=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x84')];break;case _0x7995('0x90'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x91')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x92')][_0x7995('0x29')];break;case _0x7995('0x93'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746['body'][_0x7995('0x94')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x88')];_0x87a539['body'][_0x7995('0x84')]=_0x19d746['body']['replyMessageId'];break;case'intelepeer':_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['from'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x29')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x95')];break;}}if(_0x87a539['body']['id']){delete _0x87a539[_0x7995('0x5a')]['id'];}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x82')])){throw new db['Sequelize'][(_0x7995('0x22'))](_0x7995('0x97'));}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')])||_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x98'));}if(_['isNil'](_0x87a539[_0x7995('0x5a')]['mapKey'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x99')+_0x2a01d4);}if(!_['includes'](_0x2a01d4,_0x87a539['body'][_0x7995('0x9a')])){throw new db[(_0x7995('0x7a'))]['ValidationError'](_0x7995('0x9b')+_0x2a01d4);}_0x5a4695[_0x87a539['body'][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')][_0x7995('0x82')];return db[_0x7995('0x9c')]['find']({'where':{'id':_0x87a539['account'][_0x7995('0x7f')]},'include':[{'model':db[_0x7995('0x79')],'as':_0x7995('0x9d'),'where':_0x5a4695,'limit':0x1,'order':[[_0x7995('0x9e'),'DESC']]}]});})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x8b820b){if(_0x8b820b){_0x87a539[_0x7995('0x9f')]=_[_0x7995('0xa0')](_0x8b820b,['Contacts']);if(_0x8b820b['Contacts']['length']){return _0x8b820b[_0x7995('0x9d')][0x0];}var _0x24a3cf=_['defaults'](_0x87a539[_0x7995('0x5a')],{'firstName':_0x87a539['body'][_0x7995('0x82')],'ListId':_0x8b820b['id']});_0x24a3cf[_0x87a539[_0x7995('0x5a')][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')]['from'];return db[_0x7995('0x79')][_0x7995('0x59')](_0x24a3cf,{'fields':_0x2056da,'raw':!![]});}})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x2023a7){if(_0x2023a7){_0x87a539[_0x7995('0xa1')]=_0x2023a7;var _0x1d200d={'ContactId':_0x2023a7['id'],'phone':_0x87a539[_0x7995('0x5a')][_0x7995('0x82')],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id']};var _0x30893a={'ContactId':_0x2023a7['id'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'closed':![]};return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':_0x30893a})['then'](function(_0x764245){if(_0x764245){return[_0x764245,![]];}return db['SmsInteraction'][_0x7995('0x59')](_0x1d200d)[_0x7995('0x23')](function(_0x5cf7b2){return[_0x5cf7b2,!![]];});});}})[_0x7995('0xa3')](function(_0x55dc6c,_0x17c3f9){_0x87a539[_0x7995('0xa4')]=_0x55dc6c['get']({'plain':!![]});_0x87a539['interaction']['created']=![];if(_0x17c3f9){if(_0x87a539[_0x7995('0x74')][_0x7995('0xa5')]){_0x87a539[_0x7995('0x75')][_0x7995('0xa6')]({'id':0x0,'priority':_0x87a539['applications'][_0x7995('0x57')]+0x1,'app':_0x7995('0xa7'),'appdata':_0x7995('0xa8'),'interval':_0x7995('0xa9')});}_0x87a539[_0x7995('0xa4')][_0x7995('0xaa')]=!![];}return db[_0x7995('0xab')][_0x7995('0x59')]({'phone':_0x87a539['body'][_0x7995('0x82')],'messageId':_0x87a539[_0x7995('0x5a')][_0x7995('0x84')],'body':_0x87a539[_0x7995('0x5a')]['body'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'SmsInteractionId':_0x55dc6c['id'],'direction':'in','ContactId':_0x55dc6c[_0x7995('0xac')],'AttachmentId':_0x87a539[_0x7995('0x5a')][_0x7995('0xad')]});})[_0x7995('0x23')](function(_0x2e7416){_0x87a539['message']=_0x2e7416;if(_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]){return db[_0x7995('0xaf')][_0x7995('0x58')]({'attributes':['id',_0x7995('0x38')],'where':{'id':_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]}})[_0x7995('0x23')](function(_0xf76f46){if(_0xf76f46){_0x87a539[_0x7995('0x75')][_0x7995('0xb0')]({'id':0x0,'priority':0x0,'app':_0x7995('0xb1'),'appdata':_0xf76f46[_0x7995('0x38')]+','+(_0x87a539[_0x7995('0x74')][_0x7995('0xb2')]||0xa),'interval':_0x7995('0xa9')});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);})[_0x7995('0x23')](function(_0x51f854){if(_0x51f854){var _0x4cf7f1=0xc8;var _0x1a980b=_0x7995('0xb5');logger['info'](_0x7995('0x26'),_0x1a980b,_0x4cf7f1,'entity\x20found');logger[_0x7995('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1a980b,_0x4cf7f1,_0x7995('0xb7'),JSON[_0x7995('0xb8')](_0x51f854));if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]===_0x7995('0x81')){return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x32')](_0x7995('0xb9'),_0x7995('0xba'))[_0x7995('0x39')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x2f')](_0x51f854);}}})[_0x7995('0x2b')](handleError(_0x570b71,null));};exports[_0x7995('0xbb')]=function(_0x54b803,_0x408c22,_0x1d2afe){return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x54b803['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x408c22,null))[_0x7995('0x23')](function(_0x31d0e9){if(_0x31d0e9){return db[_0x7995('0xbc')][_0x7995('0xbd')](function(_0x13dda4){return db[_0x7995('0xbe')][_0x7995('0x35')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'transaction':_0x13dda4})['then'](function(_0x3c81cc){var _0x5f5496=_[_0x7995('0x3d')](_0x54b803[_0x7995('0x5a')],function(_0x35b217){_0x35b217[_0x7995('0x65')]=_0x54b803['params']['id'];return _0x35b217;});return db[_0x7995('0xbe')][_0x7995('0xbf')](_0x5f5496,{'transaction':_0x13dda4});});})[_0x7995('0x23')](function(){return db[_0x7995('0xbe')][_0x7995('0xc0')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'order':_0x7995('0xc1')});});}})[_0x7995('0x23')](respondWithResult(_0x408c22,null))[_0x7995('0x2b')](handleError(_0x408c22,null));};exports[_0x7995('0xc2')]=function(_0x45f389,_0x44d6a8,_0x7d14e2){var _0x405711={};var _0x54e341={};var _0x5cb30e;var _0xdfc11d;return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x45f389['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x44d6a8,null))[_0x7995('0x23')](function(_0x610b81){if(_0x610b81){_0x5cb30e=_0x610b81;_0x54e341['model']=_[_0x7995('0x45')](db[_0x7995('0xbe')][_0x7995('0x3f')]);_0x54e341[_0x7995('0x44')]=_[_0x7995('0x45')](_0x45f389[_0x7995('0x44')]);_0x54e341[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x54e341[_0x7995('0x43')],_0x54e341[_0x7995('0x44')]);_0x405711[_0x7995('0x47')]=_['intersection'](_0x54e341['model'],qs[_0x7995('0x56')](_0x45f389['query'][_0x7995('0x56')]));_0x405711[_0x7995('0x47')]=_0x405711[_0x7995('0x47')][_0x7995('0x57')]?_0x405711[_0x7995('0x47')]:_0x54e341['model'];_0x405711['order']=qs[_0x7995('0x6a')](_0x45f389[_0x7995('0x44')][_0x7995('0x6a')]);_0x405711[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x45f389[_0x7995('0x44')],_0x54e341[_0x7995('0x4c')]));if(_0x45f389[_0x7995('0x44')][_0x7995('0x4d')]){_0x405711['where']=_[_0x7995('0x4e')](_0x405711[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x405711[_0x7995('0x47')],function(_0x511cf8){var _0x4d6da0={};_0x4d6da0[_0x511cf8]={'$like':'%'+_0x45f389['query']['filter']+'%'};return _0x4d6da0;})});}_0x405711=_['merge']({},_0x405711,_0x45f389[_0x7995('0x50')]);return _0x5cb30e['getApplications'](_0x405711);}})['then'](function(_0x32f19d){if(_0x32f19d){_0xdfc11d=_0x32f19d[_0x7995('0x57')];if(!_0x45f389[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x405711['limit']=qs[_0x7995('0x49')](_0x45f389[_0x7995('0x44')][_0x7995('0x49')]);_0x405711['offset']=qs[_0x7995('0x31')](_0x45f389[_0x7995('0x44')][_0x7995('0x31')]);}return _0x5cb30e['getApplications'](_0x405711);}})[_0x7995('0x23')](function(_0x15cfd3){if(_0x15cfd3){return _0x15cfd3?{'count':_0xdfc11d,'rows':_0x15cfd3}:null;}})[_0x7995('0x23')](respondWithResult(_0x44d6a8,null))[_0x7995('0x2b')](handleError(_0x44d6a8,null));};exports[_0x7995('0xc3')]=function(_0x574e2a,_0x1761e1,_0x2a4991){var _0xc8bbb4={'raw':![],'where':{}};var _0x484b6c={};var _0x20852c={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x574e2a[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1761e1,null))['then'](function(_0x2995a3){if(_0x2995a3){_0x484b6c[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xa2')][_0x7995('0x3f')]);_0x484b6c[_0x7995('0x44')]=_[_0x7995('0x45')](_0x574e2a['query']);_0x484b6c['filters']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],_0x484b6c['query']);_0xc8bbb4['attributes']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],qs[_0x7995('0x56')](_0x574e2a[_0x7995('0x44')][_0x7995('0x56')]));_0xc8bbb4[_0x7995('0x47')]=_0xc8bbb4[_0x7995('0x47')]['length']?_0xc8bbb4[_0x7995('0x47')]:_0x484b6c[_0x7995('0x43')];if(!_0x574e2a[_0x7995('0x44')][_0x7995('0x48')](_0x7995('0x69'))){_0xc8bbb4[_0x7995('0x49')]=qs['limit'](_0x574e2a[_0x7995('0x44')][_0x7995('0x49')]);_0xc8bbb4[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x574e2a[_0x7995('0x44')][_0x7995('0x31')]);}_0xc8bbb4[_0x7995('0x4a')]=qs['sort'](_0x574e2a[_0x7995('0x44')][_0x7995('0x6a')]);_0xc8bbb4[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x574e2a[_0x7995('0x44')],_0x484b6c['filters']));_0xc8bbb4[_0x7995('0x4b')][_0x7995('0x65')]=_0x2995a3['id'];if(_0x574e2a['query']['filter']){_0xc8bbb4['where']=_[_0x7995('0x4e')](_0xc8bbb4[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0xc8bbb4[_0x7995('0x47')],function(_0x503b32){var _0x2da21e={};_0x2da21e[_0x503b32]={'$like':'%'+_0x574e2a[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x2da21e;})});}_0xc8bbb4=_[_0x7995('0x4e')]({},_0xc8bbb4,_0x574e2a[_0x7995('0x50')]);return db[_0x7995('0xa2')][_0x7995('0x30')]({'where':_0xc8bbb4['where']})['then'](function(_0x2695eb){_0x20852c['count']=_0x2695eb;if(_0x574e2a['query'][_0x7995('0x51')]){_0xc8bbb4[_0x7995('0x52')]=[{'model':db[_0x7995('0x79')],'as':_0x7995('0xc4'),'required':![]},{'model':db[_0x7995('0xaf')],'as':_0x7995('0xc5'),'attributes':[_0x7995('0x38'),_0x7995('0xc6'),_0x7995('0xc7')],'required':![]},{'model':db[_0x7995('0xc8')],'as':_0x7995('0xc9'),'attributes':['id',_0x7995('0x38'),'color'],'where':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?{'id':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]}:undefined,'required':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?!![]:![]}];}return db[_0x7995('0xa2')]['findAll'](_0xc8bbb4);})[_0x7995('0x23')](function(_0x234832){_0x20852c[_0x7995('0x6c')]=_0x234832;return _0x20852c;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x1761e1,_0xc8bbb4))[_0x7995('0x2b')](handleError(_0x1761e1,null));};exports['send']=function(_0x2d1c14,_0x5e7fde,_0x156b65){var _0x12f4c5,_0x221be8,_0x5150aa;if(_[_0x7995('0x96')](_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')])||_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2d1c14[_0x7995('0x5a')]['to'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0xcb'));}_0x12f4c5=_0x2d1c14[_0x7995('0x5a')]['to'];return db[_0x7995('0x3e')]['find']({'where':{'id':_0x2d1c14[_0x7995('0x55')]['id']},'include':[{'model':db[_0x7995('0x9c')],'as':_0x7995('0xcc'),'include':[{'model':db[_0x7995('0x79')],'as':'Contacts','where':{'mobile':_0x12f4c5},'limit':0x1,'order':[['updatedAt',_0x7995('0xcd')]]}]}]})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0x3130f2){if(_0x3130f2&&_0x3130f2[_0x7995('0xcc')]){_0x221be8=_0x3130f2['get']({'plain':!![]});if(_0x221be8[_0x7995('0xcc')]&&_0x221be8[_0x7995('0xcc')][_0x7995('0x9d')][_0x7995('0x57')]){return _0x221be8[_0x7995('0xcc')]['Contacts'][0x0];}return db['CmContact'][_0x7995('0x59')](_[_0x7995('0x1b')](_0x2d1c14[_0x7995('0x5a')],{'firstName':_0x12f4c5,'mobile':_0x12f4c5,'phone':_0x12f4c5,'ListId':_0x221be8[_0x7995('0x7f')]}));}})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0xd0da6e){if(_0xd0da6e){_0x5150aa=_0xd0da6e;return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':{'ContactId':_0x5150aa['id'],'closed':![],'SmsAccountId':_0x221be8['id']}})[_0x7995('0x23')](function(_0x1949f5){if(_0x1949f5){return[_0x1949f5,![]];}return db['SmsInteraction']['create']({'UserId':_0x2d1c14['user']['id'],'ContactId':_0x5150aa['id'],'SmsAccountId':_0x221be8['id'],'phone':_0x12f4c5,'firstMsgDirection':'out','Messages':[_[_0x7995('0x4e')](_0x2d1c14[_0x7995('0x5a')],{'read':![],'body':_0x2d1c14['body'][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x7995('0x23')](function(_0x3ee80c){return[_0x3ee80c,!![]];});});}})[_0x7995('0xa3')](function(_0x8bd55,_0x20a056){if(_0x20a056){return _0x8bd55;}return db[_0x7995('0xab')][_0x7995('0x59')](_['merge'](_0x2d1c14['body'],{'read':![],'body':_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'SmsInteractionId':_0x8bd55['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']}))['then'](function(_0x2f96fd){_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')]=[];_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')][_0x7995('0xa6')](_0x2f96fd[_0x7995('0xce')]);return _0x8bd55;});})[_0x7995('0x23')](respondWithResult(_0x5e7fde,null))[_0x7995('0x2b')](handleError(_0x5e7fde,null));};exports['status']=function(_0x5136f5,_0x1161f2,_0x4bd222){if(_0x5136f5[_0x7995('0x5a')]['id']){delete _0x5136f5['body']['id'];}console[_0x7995('0xd0')](_0x7995('0xd1'),_0x5136f5[_0x7995('0x5a')]);var _0x4a75d2,_0x4c810d,_0x1401b4;return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x5136f5[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0xb0164a){if(_0xb0164a){_0x1401b4=_0xb0164a;logger[_0x7995('0xb6')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0xd2'),_0xb0164a['type'],util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));switch(_0xb0164a[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x5136f5[_0x7995('0x5a')]['skebby_dispatch_id']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd4')]}});}break;case _0x7995('0x89'):if(_0x5136f5['body']['requestid']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd6')]}});}break;case _0x7995('0x8a'):if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')];return db['SmsMessage']['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]}});}break;case _0x7995('0x8e'):var _0x296643=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x296643[_0x7995('0x84')]&&_0x296643[_0x7995('0x2d')]['groupName']==='DELIVERED'){_0x4c810d=_0x296643[_0x7995('0x2d')][_0x7995('0xd8')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x296643['messageId']}});}break;case'clickatell':if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]}});}break;case _0x7995('0xd9'):if(_0x5136f5[_0x7995('0x5a')]['redif']&&_0x5136f5['body'][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')]['redif']}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0x308d0e){if(_0x308d0e){_0x4a75d2=_0x308d0e;switch(_0x1401b4[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x4c810d===_0x7995('0xda')){return _0x4a75d2['update']({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x86'),util['inspect'](_0x5136f5['body'],{'showHidden':![],'depth':null}));}break;case _0x7995('0x89'):if(_0x4c810d==='1'){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status',_0x7995('0x86'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5136f5[_0x7995('0x5a')][_0x7995('0xdb')]&&_0x4c810d>=0xc8&&_0x4c810d<=0xce){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x8a'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0x8e'):var _0x1f6c3e=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x1f6c3e['status'][_0x7995('0xd8')]===_0x7995('0xda')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7995('0x2d'),_0x7995('0x8e'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c810d==_0x7995('0xdc')||_0x4c810d==_0x7995('0xdd')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x93'),util['inspect'](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0xd9'):if(_0x4c810d===_0x7995('0xde')||_0x4c810d===_0x7995('0xdf')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),'status',_0x7995('0xd9'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4a75d2;}})['then'](respondWithResult(_0x1161f2,null))['catch'](handleError(_0x1161f2,null));};exports['statusGet']=function(_0x21ff84,_0x1763aa,_0x32e443){var _0x35b6f9,_0x17fab0,_0x4da0e8;return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x21ff84[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x5bc1b4){if(_0x5bc1b4){_0x4da0e8=_0x5bc1b4;logger[_0x7995('0xb6')](_0x7995('0x26'),'status',_0x7995('0xd2'),_0x5bc1b4['type'],util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));switch(_0x5bc1b4[_0x7995('0x41')]){case'csc':if(_0x21ff84['query'][_0x7995('0xe0')]&&_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')]){_0x17fab0=_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x21ff84[_0x7995('0x44')][_0x7995('0xe0')]}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x48c9fc){if(_0x48c9fc){_0x35b6f9=_0x48c9fc;switch(_0x4da0e8['type']){case _0x7995('0x90'):if(_0x17fab0==='2'||_0x17fab0==='6'){return _0x35b6f9[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status','csc',util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x35b6f9;}})['then'](respondWithResult(_0x1763aa,null))['catch'](handleError(_0x1763aa,null));};exports[_0x7995('0xe2')]=function(_0x469cd6,_0x3ad24,_0x17c27b){return db[_0x7995('0x3e')]['find']({'where':{'id':_0x469cd6[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3ad24,null))['then'](function(_0xf9859c){if(_0xf9859c){return _0xf9859c[_0x7995('0xe2')](_0x469cd6[_0x7995('0x5a')]['ids'],_[_0x7995('0xa0')](_0x469cd6[_0x7995('0x5a')],[_0x7995('0x71'),'id'])||{})[_0x7995('0xa3')](function(_0x113e03){for(var _0x5348b1=0x0;_0x5348b1<_0x469cd6['body'][_0x7995('0x71')]['length'];_0x5348b1+=0x1){socket[_0x7995('0xe3')]('userSmsAccount:save',{'UserId':_0x469cd6[_0x7995('0x5a')][_0x7995('0x71')][_0x5348b1],'SmsAccountId':_0x469cd6[_0x7995('0x55')]['id']});}return _0x113e03;});}})['then'](respondWithResult(_0x3ad24,null))['catch'](handleError(_0x3ad24,null));};exports['removeAgents']=function(_0x362580,_0x1da57f,_0x270ef3){return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x362580[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x1da57f,null))[_0x7995('0x23')](function(_0x39449e){if(_0x39449e){return _0x39449e[_0x7995('0xe4')](_0x362580[_0x7995('0x44')][_0x7995('0x71')])['then'](function(){if(_['isArray'](_0x362580[_0x7995('0x44')][_0x7995('0x71')])){for(var _0x134da2=0x0;_0x134da2<_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x7995('0x57')];_0x134da2+=0x1){socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x134da2]),'SmsAccountId':Number(_0x362580['params']['id'])});}}else{socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')]),'SmsAccountId':Number(_0x362580[_0x7995('0x55')]['id'])});}});}})[_0x7995('0x23')](respondWithStatusCode(_0x1da57f,null))[_0x7995('0x2b')](handleError(_0x1da57f,null));};exports['getAgents']=function(_0x5d0fe6,_0x43a8a4,_0x2aec8d){var _0x12df49={};var _0x1f4efc={};var _0x55ce63;var _0x572c53;return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x5d0fe6[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x43a8a4,null))[_0x7995('0x23')](function(_0x2265cf){if(_0x2265cf){_0x55ce63=_0x2265cf;_0x1f4efc[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xaf')][_0x7995('0x3f')]);_0x1f4efc[_0x7995('0x44')]=_[_0x7995('0x45')](_0x5d0fe6['query']);_0x1f4efc[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x1f4efc[_0x7995('0x43')],_0x1f4efc['query']);_0x12df49[_0x7995('0x47')]=_['intersection'](_0x1f4efc['model'],qs['fields'](_0x5d0fe6['query'][_0x7995('0x56')]));_0x12df49['attributes']=_0x12df49[_0x7995('0x47')][_0x7995('0x57')]?_0x12df49['attributes']:_0x1f4efc[_0x7995('0x43')];_0x12df49[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x5d0fe6[_0x7995('0x44')]['sort']);_0x12df49[_0x7995('0x4b')]=qs['filters'](_[_0x7995('0x6b')](_0x5d0fe6[_0x7995('0x44')],_0x1f4efc[_0x7995('0x4c')]));if(_0x5d0fe6[_0x7995('0x44')][_0x7995('0x4d')]){_0x12df49[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x12df49[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x12df49[_0x7995('0x47')],function(_0x4aa202){var _0x8c9b6f={};_0x8c9b6f[_0x4aa202]={'$like':'%'+_0x5d0fe6[_0x7995('0x44')]['filter']+'%'};return _0x8c9b6f;})});}_0x12df49=_[_0x7995('0x4e')]({},_0x12df49,_0x5d0fe6[_0x7995('0x50')]);return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x1a6f42){if(_0x1a6f42){_0x572c53=_0x1a6f42[_0x7995('0x57')];if(!_0x5d0fe6['query'][_0x7995('0x48')]('nolimit')){_0x12df49[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x5d0fe6[_0x7995('0x44')][_0x7995('0x49')]);_0x12df49[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x5d0fe6['query'][_0x7995('0x31')]);}return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x4c2faf){if(_0x4c2faf){return _0x4c2faf?{'count':_0x572c53,'rows':_0x4c2faf}:null;}})[_0x7995('0x23')](respondWithResult(_0x43a8a4,null))[_0x7995('0x2b')](handleError(_0x43a8a4,null));};
\ No newline at end of file
+var _0x9957=['show','params','fields','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','sort','pick','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','account','applications','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','entity\x20found','stringify','Content-Type','text/xml','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','DESC','dataValues','Messages','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','intelepeer','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','test','ValidationError','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','save','destroy','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','limit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x5bc75a,_0x38ce5c){var _0x51abb3=function(_0x2622c0){while(--_0x2622c0){_0x5bc75a['push'](_0x5bc75a['shift']());}};_0x51abb3(++_0x38ce5c);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x7995('0x1e'));var client=jayson[_0x7995('0x1f')][_0x7995('0x20')]({'port':0x232c});function checkPasswordPattern(_0x321ae8,_0x3f1d3e,_0x1a5310){if(_0x1a5310){var _0x2202ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2202ce[_0x7995('0x21')](_0x3f1d3e)){return _0x321ae8;}else{throw new db['Sequelize'][(_0x7995('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x321ae8;}}function respondWithRpcPromise(_0x2f832e,_0x37f297,_0x43d4b8,_0x291317){return new BPromise(function(_0x1e1415,_0x37a7d4){var _0x4faa60=_0x291317||client;return _0x4faa60['request'](_0x2f832e,_0x43d4b8)[_0x7995('0x23')](function(_0x5e6f90){logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));logger['debug'](_0x7995('0x26'),_0x37f297,'request\x20sent',JSON['stringify'](_0x5e6f90));if(_0x5e6f90[_0x7995('0x27')]){if(_0x5e6f90[_0x7995('0x27')][_0x7995('0x28')]===0x1f4){logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')]['message']);return _0x37a7d4(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);return _0x1e1415(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}else{logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));_0x1e1415(_0x5e6f90[_0x7995('0x2a')][_0x7995('0x29')]);}})[_0x7995('0x2b')](function(_0x2a307e){logger['error'](_0x7995('0x24'),_0x37f297,_0x2a307e);_0x37a7d4(_0x2a307e);});});}function respondWithStatusCode(_0x5911c3,_0x229742){_0x229742=_0x229742||0xcc;return function(_0x49bc7e){if(_0x49bc7e){return _0x5911c3[_0x7995('0x2c')](_0x229742);}return _0x5911c3[_0x7995('0x2d')](_0x229742)[_0x7995('0x2e')]();};}function respondWithResult(_0x4b6f99,_0x9b2a15){_0x9b2a15=_0x9b2a15||0xc8;return function(_0x514445){if(_0x514445){return _0x4b6f99[_0x7995('0x2d')](_0x9b2a15)[_0x7995('0x2f')](_0x514445);}};}function respondWithFilteredResult(_0x4253e5,_0x574574){return function(_0x530611){if(_0x530611){var _0x48e573=_0x530611[_0x7995('0x30')],_0x3573be=_0x574574[_0x7995('0x31')],_0xe6b0b3=_0x574574[_0x7995('0x31')]+_0x574574['limit'],_0x327a81;if(_0xe6b0b3>=_0x48e573){_0xe6b0b3=_0x48e573;_0x327a81=0xc8;}else{_0x327a81=0xce;}_0x4253e5['status'](_0x327a81);return _0x4253e5[_0x7995('0x32')]('Content-Range',_0x3573be+'-'+_0xe6b0b3+'/'+_0x48e573)[_0x7995('0x2f')](_0x530611);}return null;};}function patchUpdates(_0x3eb566){return function(_0x29fac5){try{jsonpatch[_0x7995('0x33')](_0x29fac5,_0x3eb566,!![]);}catch(_0x1f7d27){return BPromise['reject'](_0x1f7d27);}return _0x29fac5[_0x7995('0x34')]();};}function saveUpdates(_0x33e24e,_0x5dd802){return function(_0x48db25){if(_0x48db25){return _0x48db25['update'](_0x33e24e)[_0x7995('0x23')](function(_0x3acfc3){return _0x3acfc3;});}return null;};}function removeEntity(_0x4a176f,_0x3e7020){return function(_0x51b95d){if(_0x51b95d){return _0x51b95d[_0x7995('0x35')]()[_0x7995('0x23')](function(){var _0x177cb4=_0x51b95d['get']({'plain':!![]});var _0x52d76d=_0x7995('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x52d76d,'resourceId':_0x177cb4['id']}})[_0x7995('0x23')](function(){return _0x51b95d;});})[_0x7995('0x23')](function(){_0x4a176f['status'](0xcc)[_0x7995('0x2e')]();});}};}function handleEntityNotFound(_0x1922b4,_0x2b772f){return function(_0x18667c){if(!_0x18667c){_0x1922b4[_0x7995('0x2c')](0x194);}return _0x18667c;};}function handleError(_0x53002a,_0x2d4285){_0x2d4285=_0x2d4285||0x1f4;return function(_0x242713){logger[_0x7995('0x27')](_0x242713[_0x7995('0x37')]);if(_0x242713['name']){delete _0x242713[_0x7995('0x38')];}_0x53002a[_0x7995('0x2d')](_0x2d4285)[_0x7995('0x39')](_0x242713);};}exports[_0x7995('0x3a')]=function(_0x1f5bee,_0x1035dc){var _0x5688a1={'include':[{'model':db[_0x7995('0x3b')],'as':_0x7995('0x3c')}]},_0x183a68={},_0x3be298={'count':0x0,'rows':[]};var _0x2e04cd=_[_0x7995('0x3d')](db[_0x7995('0x3e')][_0x7995('0x3f')],function(_0x1234e1){return{'name':_0x1234e1[_0x7995('0x40')],'type':_0x1234e1[_0x7995('0x41')][_0x7995('0x42')]};});_0x183a68[_0x7995('0x43')]=_['map'](_0x2e04cd,'name');_0x183a68[_0x7995('0x44')]=_[_0x7995('0x45')](_0x1f5bee['query']);_0x183a68['filters']=_[_0x7995('0x46')](_0x183a68['model'],_0x183a68['query']);_0x5688a1[_0x7995('0x47')]=_[_0x7995('0x46')](_0x183a68[_0x7995('0x43')],qs['fields'](_0x1f5bee[_0x7995('0x44')]['fields']));_0x5688a1[_0x7995('0x47')]=_0x5688a1['attributes']['length']?_0x5688a1[_0x7995('0x47')]:_0x183a68[_0x7995('0x43')];if(!_0x1f5bee[_0x7995('0x44')][_0x7995('0x48')]('nolimit')){_0x5688a1[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x1f5bee[_0x7995('0x44')][_0x7995('0x49')]);_0x5688a1['offset']=qs['offset'](_0x1f5bee[_0x7995('0x44')]['offset']);}_0x5688a1[_0x7995('0x4a')]=qs['sort'](_0x1f5bee[_0x7995('0x44')]['sort']);_0x5688a1[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x1f5bee[_0x7995('0x44')],_0x183a68[_0x7995('0x4c')]),_0x2e04cd);if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x4d')]){_0x5688a1['where']=_[_0x7995('0x4e')](_0x5688a1[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x2e04cd,function(_0x491184){if(_0x491184[_0x7995('0x41')]!==_0x7995('0x4f')){var _0x511567={};_0x511567[_0x491184[_0x7995('0x38')]]={'$like':'%'+_0x1f5bee[_0x7995('0x44')]['filter']+'%'};return _0x511567;}})});}_0x5688a1=_[_0x7995('0x4e')]({},_0x5688a1,_0x1f5bee[_0x7995('0x50')]);var _0x5921b9={'where':_0x5688a1[_0x7995('0x4b')]};return db['SmsAccount'][_0x7995('0x30')](_0x5921b9)[_0x7995('0x23')](function(_0x1afab4){_0x3be298[_0x7995('0x30')]=_0x1afab4;if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x51')]){_0x5688a1[_0x7995('0x52')]=[{'all':!![]}];}return db['SmsAccount'][_0x7995('0x53')](_0x5688a1);})[_0x7995('0x23')](function(_0x418eb9){_0x3be298['rows']=_0x418eb9;return _0x3be298;})[_0x7995('0x23')](respondWithFilteredResult(_0x1035dc,_0x5688a1))[_0x7995('0x2b')](handleError(_0x1035dc,null));};exports[_0x7995('0x54')]=function(_0x47d1d8,_0x4ec548){var _0x5a592e={'raw':![],'where':{'id':_0x47d1d8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]},_0xb70620={};_0xb70620[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0x3e')][_0x7995('0x3f')]);_0xb70620['query']=_[_0x7995('0x45')](_0x47d1d8['query']);_0xb70620[_0x7995('0x4c')]=_[_0x7995('0x46')](_0xb70620[_0x7995('0x43')],_0xb70620['query']);_0x5a592e['attributes']=_['intersection'](_0xb70620['model'],qs[_0x7995('0x56')](_0x47d1d8[_0x7995('0x44')][_0x7995('0x56')]));_0x5a592e[_0x7995('0x47')]=_0x5a592e[_0x7995('0x47')][_0x7995('0x57')]?_0x5a592e[_0x7995('0x47')]:_0xb70620[_0x7995('0x43')];if(_0x47d1d8[_0x7995('0x44')][_0x7995('0x51')]){_0x5a592e[_0x7995('0x52')]=[{'all':!![]}];}_0x5a592e=_[_0x7995('0x4e')]({},_0x5a592e,_0x47d1d8[_0x7995('0x50')]);return db[_0x7995('0x3e')][_0x7995('0x58')](_0x5a592e)[_0x7995('0x23')](handleEntityNotFound(_0x4ec548,null))[_0x7995('0x23')](respondWithResult(_0x4ec548,null))[_0x7995('0x2b')](handleError(_0x4ec548,null));};exports[_0x7995('0x59')]=function(_0x50b7c2,_0x56a374){return db[_0x7995('0x3e')][_0x7995('0x59')](_0x50b7c2[_0x7995('0x5a')],{})['then'](function(_0x53125a){var _0x402fa0=_0x50b7c2[_0x7995('0x5b')][_0x7995('0x5c')]({'plain':!![]});if(!_0x402fa0)throw new Error(_0x7995('0x5d'));if(_0x402fa0['role']===_0x7995('0x5b')){var _0x74ff38=_0x53125a[_0x7995('0x5c')]({'plain':!![]});var _0x33c49c='SmsAccounts';return db['UserProfileSection'][_0x7995('0x58')]({'where':{'name':_0x33c49c,'userProfileId':_0x402fa0[_0x7995('0x5e')]},'raw':!![]})[_0x7995('0x23')](function(_0x1d69ce){if(_0x1d69ce&&_0x1d69ce[_0x7995('0x5f')]===0x0){return db[_0x7995('0x60')][_0x7995('0x59')]({'name':_0x74ff38[_0x7995('0x38')],'resourceId':_0x74ff38['id'],'type':_0x1d69ce[_0x7995('0x38')],'sectionId':_0x1d69ce['id']},{})['then'](function(){return _0x53125a;});}else{return _0x53125a;}})[_0x7995('0x2b')](function(_0x3ec5a8){logger[_0x7995('0x27')](_0x7995('0x61'),_0x3ec5a8);throw _0x3ec5a8;});}return _0x53125a;})['then'](respondWithResult(_0x56a374,0xc9))['catch'](handleError(_0x56a374,null));};exports[_0x7995('0x62')]=function(_0xebb5c8,_0x47d5d7){if(_0xebb5c8[_0x7995('0x5a')]['id']){delete _0xebb5c8[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xebb5c8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]})['then'](handleEntityNotFound(_0x47d5d7,null))[_0x7995('0x23')](saveUpdates(_0xebb5c8[_0x7995('0x5a')],null))[_0x7995('0x23')](respondWithResult(_0x47d5d7,null))[_0x7995('0x2b')](handleError(_0x47d5d7,null));};exports[_0x7995('0x35')]=function(_0xeb8920,_0x2b3c1d){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xeb8920[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x2b3c1d,null))[_0x7995('0x23')](removeEntity(_0x2b3c1d,null))['catch'](handleError(_0x2b3c1d,null));};exports[_0x7995('0x63')]=function(_0x23bbc1,_0x293480){return db[_0x7995('0x3e')][_0x7995('0x63')]()['then'](respondWithResult(_0x293480,null))['catch'](handleError(_0x293480,null));};exports[_0x7995('0x64')]=function(_0x87e38d,_0x221542,_0xae6166){if(_0x87e38d['body']['id']){delete _0x87e38d[_0x7995('0x5a')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x87e38d[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x221542,null))[_0x7995('0x23')](function(_0x44bf2b){if(_0x44bf2b){_0x87e38d[_0x7995('0x5a')][_0x7995('0x65')]=_0x44bf2b['id'];return db[_0x7995('0x66')][_0x7995('0x59')](_0x87e38d[_0x7995('0x5a')]);}})[_0x7995('0x23')](respondWithResult(_0x221542,null))['catch'](handleError(_0x221542,null));};exports[_0x7995('0x67')]=function(_0x8908cd,_0x3c5802,_0x4cc247){var _0x1fe1cb={'raw':![],'where':{}};var _0x1d2f9d={};var _0x705f0={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x8908cd[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3c5802,null))[_0x7995('0x23')](function(_0x2f94c4){if(_0x2f94c4){_0x1d2f9d[_0x7995('0x43')]=_[_0x7995('0x45')](db['Disposition']['rawAttributes']);_0x1d2f9d[_0x7995('0x44')]=_[_0x7995('0x45')](_0x8908cd[_0x7995('0x44')]);_0x1d2f9d[_0x7995('0x4c')]=_['intersection'](_0x1d2f9d[_0x7995('0x43')],_0x1d2f9d[_0x7995('0x44')]);_0x1fe1cb['attributes']=_['intersection'](_0x1d2f9d[_0x7995('0x43')],qs[_0x7995('0x56')](_0x8908cd['query'][_0x7995('0x56')]));_0x1fe1cb['attributes']=_0x1fe1cb[_0x7995('0x47')][_0x7995('0x57')]?_0x1fe1cb['attributes']:_0x1d2f9d['model'];if(!_0x8908cd[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x1fe1cb[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x8908cd[_0x7995('0x44')][_0x7995('0x49')]);_0x1fe1cb[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x8908cd[_0x7995('0x44')][_0x7995('0x31')]);}_0x1fe1cb[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x8908cd[_0x7995('0x44')][_0x7995('0x6a')]);_0x1fe1cb[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x8908cd[_0x7995('0x44')],_0x1d2f9d[_0x7995('0x4c')]));_0x1fe1cb[_0x7995('0x4b')][_0x7995('0x65')]=_0x2f94c4['id'];if(_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]){_0x1fe1cb[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x1fe1cb[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x1fe1cb[_0x7995('0x47')],function(_0x34724d){var _0x59efff={};_0x59efff[_0x34724d]={'$like':'%'+_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x59efff;})});}_0x1fe1cb=_['merge']({},_0x1fe1cb,_0x8908cd['options']);return db[_0x7995('0x66')][_0x7995('0x30')]({'where':_0x1fe1cb[_0x7995('0x4b')]})[_0x7995('0x23')](function(_0xe1ce4){_0x705f0[_0x7995('0x30')]=_0xe1ce4;if(_0x8908cd['query'][_0x7995('0x51')]){_0x1fe1cb[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x66')][_0x7995('0x53')](_0x1fe1cb);})[_0x7995('0x23')](function(_0x3f0bff){_0x705f0[_0x7995('0x6c')]=_0x3f0bff;return _0x705f0;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x3c5802,_0x1fe1cb))['catch'](handleError(_0x3c5802,null));};exports[_0x7995('0x6d')]=function(_0x2b8217,_0x5c04c9,_0x479271){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x2b8217[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x5c04c9,null))[_0x7995('0x23')](function(_0x4a02ea){if(_0x4a02ea){return _0x4a02ea[_0x7995('0x6d')](_0x2b8217[_0x7995('0x44')]['ids']);}})[_0x7995('0x23')](respondWithStatusCode(_0x5c04c9,null))[_0x7995('0x2b')](handleError(_0x5c04c9,null));};exports['addAnswer']=function(_0x1535a3,_0x4a5bc5,_0x135191){if(_0x1535a3[_0x7995('0x5a')]['id']){delete _0x1535a3[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x1535a3['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4a5bc5,null))[_0x7995('0x23')](function(_0x38b37f){if(_0x38b37f){_0x1535a3['body'][_0x7995('0x65')]=_0x38b37f['id'];return db[_0x7995('0x6e')][_0x7995('0x59')](_0x1535a3[_0x7995('0x5a')]);}})['then'](respondWithResult(_0x4a5bc5,null))[_0x7995('0x2b')](handleError(_0x4a5bc5,null));};exports[_0x7995('0x6f')]=function(_0x3a5f5e,_0x4aafa3,_0x5358d4){var _0x3fc10={'raw':![],'where':{}};var _0x333379={};var _0x4800a8={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x3a5f5e[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4aafa3,null))[_0x7995('0x23')](function(_0x2ba606){if(_0x2ba606){_0x333379['model']=_['keys'](db[_0x7995('0x6e')]['rawAttributes']);_0x333379['query']=_[_0x7995('0x45')](_0x3a5f5e[_0x7995('0x44')]);_0x333379[_0x7995('0x4c')]=_['intersection'](_0x333379[_0x7995('0x43')],_0x333379[_0x7995('0x44')]);_0x3fc10[_0x7995('0x47')]=_[_0x7995('0x46')](_0x333379[_0x7995('0x43')],qs['fields'](_0x3a5f5e[_0x7995('0x44')][_0x7995('0x56')]));_0x3fc10[_0x7995('0x47')]=_0x3fc10[_0x7995('0x47')]['length']?_0x3fc10[_0x7995('0x47')]:_0x333379[_0x7995('0x43')];if(!_0x3a5f5e['query'][_0x7995('0x48')](_0x7995('0x69'))){_0x3fc10['limit']=qs[_0x7995('0x49')](_0x3a5f5e['query'][_0x7995('0x49')]);_0x3fc10['offset']=qs[_0x7995('0x31')](_0x3a5f5e['query'][_0x7995('0x31')]);}_0x3fc10[_0x7995('0x4a')]=qs['sort'](_0x3a5f5e[_0x7995('0x44')]['sort']);_0x3fc10['where']=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x3a5f5e[_0x7995('0x44')],_0x333379[_0x7995('0x4c')]));_0x3fc10['where'][_0x7995('0x65')]=_0x2ba606['id'];if(_0x3a5f5e[_0x7995('0x44')]['filter']){_0x3fc10['where']=_[_0x7995('0x4e')](_0x3fc10['where'],{'$or':_[_0x7995('0x3d')](_0x3fc10[_0x7995('0x47')],function(_0xfb4479){var _0x5b42be={};_0x5b42be[_0xfb4479]={'$like':'%'+_0x3a5f5e['query'][_0x7995('0x4d')]+'%'};return _0x5b42be;})});}_0x3fc10=_['merge']({},_0x3fc10,_0x3a5f5e[_0x7995('0x50')]);return db[_0x7995('0x6e')][_0x7995('0x30')]({'where':_0x3fc10[_0x7995('0x4b')]})['then'](function(_0x52d102){_0x4800a8['count']=_0x52d102;if(_0x3a5f5e[_0x7995('0x44')][_0x7995('0x51')]){_0x3fc10[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x6e')][_0x7995('0x53')](_0x3fc10);})[_0x7995('0x23')](function(_0x59a793){_0x4800a8['rows']=_0x59a793;return _0x4800a8;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x4aafa3,_0x3fc10))['catch'](handleError(_0x4aafa3,null));};exports['removeAnswers']=function(_0x17d00f,_0x5e95c0,_0x57a164){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x17d00f[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e95c0,null))[_0x7995('0x23')](function(_0xf604d9){if(_0xf604d9){return _0xf604d9[_0x7995('0x70')](_0x17d00f[_0x7995('0x44')][_0x7995('0x71')]);}})[_0x7995('0x23')](respondWithStatusCode(_0x5e95c0,null))[_0x7995('0x2b')](handleError(_0x5e95c0,null));};exports[_0x7995('0x72')]=function(_0x19d746,_0x570b71,_0x3eb3fa){var _0x87a539={'channel':_0x7995('0x73')};var _0x2056da=[];var _0x2a01d4=[];var _0x5a4695={};return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x19d746[_0x7995('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x17f7d6){_0x87a539[_0x7995('0x74')]=_0x17f7d6;_0x87a539[_0x7995('0x75')]=_[_0x7995('0x76')](_0x17f7d6[_0x7995('0x77')],['priority'],[_0x7995('0x78')]);if(_0x87a539['account'][_0x7995('0x77')]){delete _0x87a539[_0x7995('0x74')][_0x7995('0x77')];}return db[_0x7995('0x79')][_0x7995('0x63')]();})[_0x7995('0x23')](function(_0x4f929b){if(!_0x4f929b){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x7b'));}_0x2056da=_[_0x7995('0x7c')](_['keys'](_0x4f929b),[_0x7995('0x7d'),'updatedAt']);_0x2a01d4=_[_0x7995('0x7c')](_[_0x7995('0x45')](_0x4f929b),['createdAt','updatedAt',_0x7995('0x7e'),_0x7995('0x7f')]);_0x87a539[_0x7995('0x5a')]={'mapKey':_0x7995('0x80')};if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){switch(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){case _0x7995('0x81'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x83')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x85')];break;case _0x7995('0x86'):_0x87a539['body'][_0x7995('0x82')]='+'+_0x19d746['body'][_0x7995('0x87')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x88')];break;case _0x7995('0x89'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['message'];break;case _0x7995('0x8a'):_0x87a539[_0x7995('0x5a')]['from']=_0x19d746['body'][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['body'];_0x87a539['body'][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8b')];break;case _0x7995('0x8c'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')]['Text'];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x8d')];break;case _0x7995('0x8e'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]='+'+_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x88')];_0x87a539[_0x7995('0x5a')]['messageId']=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x84')];break;case _0x7995('0x90'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x91')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x92')][_0x7995('0x29')];break;case _0x7995('0x93'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746['body'][_0x7995('0x94')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x88')];_0x87a539['body'][_0x7995('0x84')]=_0x19d746['body']['replyMessageId'];break;case'intelepeer':_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['from'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x29')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x95')];break;}}if(_0x87a539['body']['id']){delete _0x87a539[_0x7995('0x5a')]['id'];}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x82')])){throw new db['Sequelize'][(_0x7995('0x22'))](_0x7995('0x97'));}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')])||_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x98'));}if(_['isNil'](_0x87a539[_0x7995('0x5a')]['mapKey'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x99')+_0x2a01d4);}if(!_['includes'](_0x2a01d4,_0x87a539['body'][_0x7995('0x9a')])){throw new db[(_0x7995('0x7a'))]['ValidationError'](_0x7995('0x9b')+_0x2a01d4);}_0x5a4695[_0x87a539['body'][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')][_0x7995('0x82')];return db[_0x7995('0x9c')]['find']({'where':{'id':_0x87a539['account'][_0x7995('0x7f')]},'include':[{'model':db[_0x7995('0x79')],'as':_0x7995('0x9d'),'where':_0x5a4695,'limit':0x1,'order':[[_0x7995('0x9e'),'DESC']]}]});})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x8b820b){if(_0x8b820b){_0x87a539[_0x7995('0x9f')]=_[_0x7995('0xa0')](_0x8b820b,['Contacts']);if(_0x8b820b['Contacts']['length']){return _0x8b820b[_0x7995('0x9d')][0x0];}var _0x24a3cf=_['defaults'](_0x87a539[_0x7995('0x5a')],{'firstName':_0x87a539['body'][_0x7995('0x82')],'ListId':_0x8b820b['id']});_0x24a3cf[_0x87a539[_0x7995('0x5a')][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')]['from'];return db[_0x7995('0x79')][_0x7995('0x59')](_0x24a3cf,{'fields':_0x2056da,'raw':!![]});}})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x2023a7){if(_0x2023a7){_0x87a539[_0x7995('0xa1')]=_0x2023a7;var _0x1d200d={'ContactId':_0x2023a7['id'],'phone':_0x87a539[_0x7995('0x5a')][_0x7995('0x82')],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id']};var _0x30893a={'ContactId':_0x2023a7['id'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'closed':![]};return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':_0x30893a})['then'](function(_0x764245){if(_0x764245){return[_0x764245,![]];}return db['SmsInteraction'][_0x7995('0x59')](_0x1d200d)[_0x7995('0x23')](function(_0x5cf7b2){return[_0x5cf7b2,!![]];});});}})[_0x7995('0xa3')](function(_0x55dc6c,_0x17c3f9){_0x87a539[_0x7995('0xa4')]=_0x55dc6c['get']({'plain':!![]});_0x87a539['interaction']['created']=![];if(_0x17c3f9){if(_0x87a539[_0x7995('0x74')][_0x7995('0xa5')]){_0x87a539[_0x7995('0x75')][_0x7995('0xa6')]({'id':0x0,'priority':_0x87a539['applications'][_0x7995('0x57')]+0x1,'app':_0x7995('0xa7'),'appdata':_0x7995('0xa8'),'interval':_0x7995('0xa9')});}_0x87a539[_0x7995('0xa4')][_0x7995('0xaa')]=!![];}return db[_0x7995('0xab')][_0x7995('0x59')]({'phone':_0x87a539['body'][_0x7995('0x82')],'messageId':_0x87a539[_0x7995('0x5a')][_0x7995('0x84')],'body':_0x87a539[_0x7995('0x5a')]['body'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'SmsInteractionId':_0x55dc6c['id'],'direction':'in','ContactId':_0x55dc6c[_0x7995('0xac')],'AttachmentId':_0x87a539[_0x7995('0x5a')][_0x7995('0xad')]});})[_0x7995('0x23')](function(_0x2e7416){_0x87a539['message']=_0x2e7416;if(_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]){return db[_0x7995('0xaf')][_0x7995('0x58')]({'attributes':['id',_0x7995('0x38')],'where':{'id':_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]}})[_0x7995('0x23')](function(_0xf76f46){if(_0xf76f46){_0x87a539[_0x7995('0x75')][_0x7995('0xb0')]({'id':0x0,'priority':0x0,'app':_0x7995('0xb1'),'appdata':_0xf76f46[_0x7995('0x38')]+','+(_0x87a539[_0x7995('0x74')][_0x7995('0xb2')]||0xa),'interval':_0x7995('0xa9')});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);})[_0x7995('0x23')](function(_0x51f854){if(_0x51f854){var _0x4cf7f1=0xc8;var _0x1a980b=_0x7995('0xb5');logger['info'](_0x7995('0x26'),_0x1a980b,_0x4cf7f1,'entity\x20found');logger[_0x7995('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1a980b,_0x4cf7f1,_0x7995('0xb7'),JSON[_0x7995('0xb8')](_0x51f854));if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]===_0x7995('0x81')){return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x32')](_0x7995('0xb9'),_0x7995('0xba'))[_0x7995('0x39')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x2f')](_0x51f854);}}})[_0x7995('0x2b')](handleError(_0x570b71,null));};exports[_0x7995('0xbb')]=function(_0x54b803,_0x408c22,_0x1d2afe){return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x54b803['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x408c22,null))[_0x7995('0x23')](function(_0x31d0e9){if(_0x31d0e9){return db[_0x7995('0xbc')][_0x7995('0xbd')](function(_0x13dda4){return db[_0x7995('0xbe')][_0x7995('0x35')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'transaction':_0x13dda4})['then'](function(_0x3c81cc){var _0x5f5496=_[_0x7995('0x3d')](_0x54b803[_0x7995('0x5a')],function(_0x35b217){_0x35b217[_0x7995('0x65')]=_0x54b803['params']['id'];return _0x35b217;});return db[_0x7995('0xbe')][_0x7995('0xbf')](_0x5f5496,{'transaction':_0x13dda4});});})[_0x7995('0x23')](function(){return db[_0x7995('0xbe')][_0x7995('0xc0')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'order':_0x7995('0xc1')});});}})[_0x7995('0x23')](respondWithResult(_0x408c22,null))[_0x7995('0x2b')](handleError(_0x408c22,null));};exports[_0x7995('0xc2')]=function(_0x45f389,_0x44d6a8,_0x7d14e2){var _0x405711={};var _0x54e341={};var _0x5cb30e;var _0xdfc11d;return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x45f389['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x44d6a8,null))[_0x7995('0x23')](function(_0x610b81){if(_0x610b81){_0x5cb30e=_0x610b81;_0x54e341['model']=_[_0x7995('0x45')](db[_0x7995('0xbe')][_0x7995('0x3f')]);_0x54e341[_0x7995('0x44')]=_[_0x7995('0x45')](_0x45f389[_0x7995('0x44')]);_0x54e341[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x54e341[_0x7995('0x43')],_0x54e341[_0x7995('0x44')]);_0x405711[_0x7995('0x47')]=_['intersection'](_0x54e341['model'],qs[_0x7995('0x56')](_0x45f389['query'][_0x7995('0x56')]));_0x405711[_0x7995('0x47')]=_0x405711[_0x7995('0x47')][_0x7995('0x57')]?_0x405711[_0x7995('0x47')]:_0x54e341['model'];_0x405711['order']=qs[_0x7995('0x6a')](_0x45f389[_0x7995('0x44')][_0x7995('0x6a')]);_0x405711[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x45f389[_0x7995('0x44')],_0x54e341[_0x7995('0x4c')]));if(_0x45f389[_0x7995('0x44')][_0x7995('0x4d')]){_0x405711['where']=_[_0x7995('0x4e')](_0x405711[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x405711[_0x7995('0x47')],function(_0x511cf8){var _0x4d6da0={};_0x4d6da0[_0x511cf8]={'$like':'%'+_0x45f389['query']['filter']+'%'};return _0x4d6da0;})});}_0x405711=_['merge']({},_0x405711,_0x45f389[_0x7995('0x50')]);return _0x5cb30e['getApplications'](_0x405711);}})['then'](function(_0x32f19d){if(_0x32f19d){_0xdfc11d=_0x32f19d[_0x7995('0x57')];if(!_0x45f389[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x405711['limit']=qs[_0x7995('0x49')](_0x45f389[_0x7995('0x44')][_0x7995('0x49')]);_0x405711['offset']=qs[_0x7995('0x31')](_0x45f389[_0x7995('0x44')][_0x7995('0x31')]);}return _0x5cb30e['getApplications'](_0x405711);}})[_0x7995('0x23')](function(_0x15cfd3){if(_0x15cfd3){return _0x15cfd3?{'count':_0xdfc11d,'rows':_0x15cfd3}:null;}})[_0x7995('0x23')](respondWithResult(_0x44d6a8,null))[_0x7995('0x2b')](handleError(_0x44d6a8,null));};exports[_0x7995('0xc3')]=function(_0x574e2a,_0x1761e1,_0x2a4991){var _0xc8bbb4={'raw':![],'where':{}};var _0x484b6c={};var _0x20852c={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x574e2a[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1761e1,null))['then'](function(_0x2995a3){if(_0x2995a3){_0x484b6c[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xa2')][_0x7995('0x3f')]);_0x484b6c[_0x7995('0x44')]=_[_0x7995('0x45')](_0x574e2a['query']);_0x484b6c['filters']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],_0x484b6c['query']);_0xc8bbb4['attributes']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],qs[_0x7995('0x56')](_0x574e2a[_0x7995('0x44')][_0x7995('0x56')]));_0xc8bbb4[_0x7995('0x47')]=_0xc8bbb4[_0x7995('0x47')]['length']?_0xc8bbb4[_0x7995('0x47')]:_0x484b6c[_0x7995('0x43')];if(!_0x574e2a[_0x7995('0x44')][_0x7995('0x48')](_0x7995('0x69'))){_0xc8bbb4[_0x7995('0x49')]=qs['limit'](_0x574e2a[_0x7995('0x44')][_0x7995('0x49')]);_0xc8bbb4[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x574e2a[_0x7995('0x44')][_0x7995('0x31')]);}_0xc8bbb4[_0x7995('0x4a')]=qs['sort'](_0x574e2a[_0x7995('0x44')][_0x7995('0x6a')]);_0xc8bbb4[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x574e2a[_0x7995('0x44')],_0x484b6c['filters']));_0xc8bbb4[_0x7995('0x4b')][_0x7995('0x65')]=_0x2995a3['id'];if(_0x574e2a['query']['filter']){_0xc8bbb4['where']=_[_0x7995('0x4e')](_0xc8bbb4[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0xc8bbb4[_0x7995('0x47')],function(_0x503b32){var _0x2da21e={};_0x2da21e[_0x503b32]={'$like':'%'+_0x574e2a[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x2da21e;})});}_0xc8bbb4=_[_0x7995('0x4e')]({},_0xc8bbb4,_0x574e2a[_0x7995('0x50')]);return db[_0x7995('0xa2')][_0x7995('0x30')]({'where':_0xc8bbb4['where']})['then'](function(_0x2695eb){_0x20852c['count']=_0x2695eb;if(_0x574e2a['query'][_0x7995('0x51')]){_0xc8bbb4[_0x7995('0x52')]=[{'model':db[_0x7995('0x79')],'as':_0x7995('0xc4'),'required':![]},{'model':db[_0x7995('0xaf')],'as':_0x7995('0xc5'),'attributes':[_0x7995('0x38'),_0x7995('0xc6'),_0x7995('0xc7')],'required':![]},{'model':db[_0x7995('0xc8')],'as':_0x7995('0xc9'),'attributes':['id',_0x7995('0x38'),'color'],'where':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?{'id':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]}:undefined,'required':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?!![]:![]}];}return db[_0x7995('0xa2')]['findAll'](_0xc8bbb4);})[_0x7995('0x23')](function(_0x234832){_0x20852c[_0x7995('0x6c')]=_0x234832;return _0x20852c;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x1761e1,_0xc8bbb4))[_0x7995('0x2b')](handleError(_0x1761e1,null));};exports['send']=function(_0x2d1c14,_0x5e7fde,_0x156b65){var _0x12f4c5,_0x221be8,_0x5150aa;if(_[_0x7995('0x96')](_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')])||_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2d1c14[_0x7995('0x5a')]['to'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0xcb'));}_0x12f4c5=_0x2d1c14[_0x7995('0x5a')]['to'];return db[_0x7995('0x3e')]['find']({'where':{'id':_0x2d1c14[_0x7995('0x55')]['id']},'include':[{'model':db[_0x7995('0x9c')],'as':_0x7995('0xcc'),'include':[{'model':db[_0x7995('0x79')],'as':'Contacts','where':{'mobile':_0x12f4c5},'limit':0x1,'order':[['updatedAt',_0x7995('0xcd')]]}]}]})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0x3130f2){if(_0x3130f2&&_0x3130f2[_0x7995('0xcc')]){_0x221be8=_0x3130f2['get']({'plain':!![]});if(_0x221be8[_0x7995('0xcc')]&&_0x221be8[_0x7995('0xcc')][_0x7995('0x9d')][_0x7995('0x57')]){return _0x221be8[_0x7995('0xcc')]['Contacts'][0x0];}return db['CmContact'][_0x7995('0x59')](_[_0x7995('0x1b')](_0x2d1c14[_0x7995('0x5a')],{'firstName':_0x12f4c5,'mobile':_0x12f4c5,'phone':_0x12f4c5,'ListId':_0x221be8[_0x7995('0x7f')]}));}})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0xd0da6e){if(_0xd0da6e){_0x5150aa=_0xd0da6e;return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':{'ContactId':_0x5150aa['id'],'closed':![],'SmsAccountId':_0x221be8['id']}})[_0x7995('0x23')](function(_0x1949f5){if(_0x1949f5){return[_0x1949f5,![]];}return db['SmsInteraction']['create']({'UserId':_0x2d1c14['user']['id'],'ContactId':_0x5150aa['id'],'SmsAccountId':_0x221be8['id'],'phone':_0x12f4c5,'firstMsgDirection':'out','Messages':[_[_0x7995('0x4e')](_0x2d1c14[_0x7995('0x5a')],{'read':![],'body':_0x2d1c14['body'][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x7995('0x23')](function(_0x3ee80c){return[_0x3ee80c,!![]];});});}})[_0x7995('0xa3')](function(_0x8bd55,_0x20a056){if(_0x20a056){return _0x8bd55;}return db[_0x7995('0xab')][_0x7995('0x59')](_['merge'](_0x2d1c14['body'],{'read':![],'body':_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'SmsInteractionId':_0x8bd55['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']}))['then'](function(_0x2f96fd){_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')]=[];_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')][_0x7995('0xa6')](_0x2f96fd[_0x7995('0xce')]);return _0x8bd55;});})[_0x7995('0x23')](respondWithResult(_0x5e7fde,null))[_0x7995('0x2b')](handleError(_0x5e7fde,null));};exports['status']=function(_0x5136f5,_0x1161f2,_0x4bd222){if(_0x5136f5[_0x7995('0x5a')]['id']){delete _0x5136f5['body']['id'];}console[_0x7995('0xd0')](_0x7995('0xd1'),_0x5136f5[_0x7995('0x5a')]);var _0x4a75d2,_0x4c810d,_0x1401b4;return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x5136f5[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0xb0164a){if(_0xb0164a){_0x1401b4=_0xb0164a;logger[_0x7995('0xb6')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0xd2'),_0xb0164a['type'],util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));switch(_0xb0164a[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x5136f5[_0x7995('0x5a')]['skebby_dispatch_id']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd4')]}});}break;case _0x7995('0x89'):if(_0x5136f5['body']['requestid']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd6')]}});}break;case _0x7995('0x8a'):if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')];return db['SmsMessage']['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]}});}break;case _0x7995('0x8e'):var _0x296643=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x296643[_0x7995('0x84')]&&_0x296643[_0x7995('0x2d')]['groupName']==='DELIVERED'){_0x4c810d=_0x296643[_0x7995('0x2d')][_0x7995('0xd8')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x296643['messageId']}});}break;case'clickatell':if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]}});}break;case _0x7995('0xd9'):if(_0x5136f5[_0x7995('0x5a')]['redif']&&_0x5136f5['body'][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')]['redif']}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0x308d0e){if(_0x308d0e){_0x4a75d2=_0x308d0e;switch(_0x1401b4[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x4c810d===_0x7995('0xda')){return _0x4a75d2['update']({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x86'),util['inspect'](_0x5136f5['body'],{'showHidden':![],'depth':null}));}break;case _0x7995('0x89'):if(_0x4c810d==='1'){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status',_0x7995('0x86'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5136f5[_0x7995('0x5a')][_0x7995('0xdb')]&&_0x4c810d>=0xc8&&_0x4c810d<=0xce){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x8a'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0x8e'):var _0x1f6c3e=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x1f6c3e['status'][_0x7995('0xd8')]===_0x7995('0xda')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7995('0x2d'),_0x7995('0x8e'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c810d==_0x7995('0xdc')||_0x4c810d==_0x7995('0xdd')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x93'),util['inspect'](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0xd9'):if(_0x4c810d===_0x7995('0xde')||_0x4c810d===_0x7995('0xdf')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),'status',_0x7995('0xd9'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4a75d2;}})['then'](respondWithResult(_0x1161f2,null))['catch'](handleError(_0x1161f2,null));};exports['statusGet']=function(_0x21ff84,_0x1763aa,_0x32e443){var _0x35b6f9,_0x17fab0,_0x4da0e8;return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x21ff84[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x5bc1b4){if(_0x5bc1b4){_0x4da0e8=_0x5bc1b4;logger[_0x7995('0xb6')](_0x7995('0x26'),'status',_0x7995('0xd2'),_0x5bc1b4['type'],util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));switch(_0x5bc1b4[_0x7995('0x41')]){case'csc':if(_0x21ff84['query'][_0x7995('0xe0')]&&_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')]){_0x17fab0=_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x21ff84[_0x7995('0x44')][_0x7995('0xe0')]}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x48c9fc){if(_0x48c9fc){_0x35b6f9=_0x48c9fc;switch(_0x4da0e8['type']){case _0x7995('0x90'):if(_0x17fab0==='2'||_0x17fab0==='6'){return _0x35b6f9[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status','csc',util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x35b6f9;}})['then'](respondWithResult(_0x1763aa,null))['catch'](handleError(_0x1763aa,null));};exports[_0x7995('0xe2')]=function(_0x469cd6,_0x3ad24,_0x17c27b){return db[_0x7995('0x3e')]['find']({'where':{'id':_0x469cd6[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3ad24,null))['then'](function(_0xf9859c){if(_0xf9859c){return _0xf9859c[_0x7995('0xe2')](_0x469cd6[_0x7995('0x5a')]['ids'],_[_0x7995('0xa0')](_0x469cd6[_0x7995('0x5a')],[_0x7995('0x71'),'id'])||{})[_0x7995('0xa3')](function(_0x113e03){for(var _0x5348b1=0x0;_0x5348b1<_0x469cd6['body'][_0x7995('0x71')]['length'];_0x5348b1+=0x1){socket[_0x7995('0xe3')]('userSmsAccount:save',{'UserId':_0x469cd6[_0x7995('0x5a')][_0x7995('0x71')][_0x5348b1],'SmsAccountId':_0x469cd6[_0x7995('0x55')]['id']});}return _0x113e03;});}})['then'](respondWithResult(_0x3ad24,null))['catch'](handleError(_0x3ad24,null));};exports['removeAgents']=function(_0x362580,_0x1da57f,_0x270ef3){return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x362580[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x1da57f,null))[_0x7995('0x23')](function(_0x39449e){if(_0x39449e){return _0x39449e[_0x7995('0xe4')](_0x362580[_0x7995('0x44')][_0x7995('0x71')])['then'](function(){if(_['isArray'](_0x362580[_0x7995('0x44')][_0x7995('0x71')])){for(var _0x134da2=0x0;_0x134da2<_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x7995('0x57')];_0x134da2+=0x1){socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x134da2]),'SmsAccountId':Number(_0x362580['params']['id'])});}}else{socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')]),'SmsAccountId':Number(_0x362580[_0x7995('0x55')]['id'])});}});}})[_0x7995('0x23')](respondWithStatusCode(_0x1da57f,null))[_0x7995('0x2b')](handleError(_0x1da57f,null));};exports['getAgents']=function(_0x5d0fe6,_0x43a8a4,_0x2aec8d){var _0x12df49={};var _0x1f4efc={};var _0x55ce63;var _0x572c53;return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x5d0fe6[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x43a8a4,null))[_0x7995('0x23')](function(_0x2265cf){if(_0x2265cf){_0x55ce63=_0x2265cf;_0x1f4efc[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xaf')][_0x7995('0x3f')]);_0x1f4efc[_0x7995('0x44')]=_[_0x7995('0x45')](_0x5d0fe6['query']);_0x1f4efc[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x1f4efc[_0x7995('0x43')],_0x1f4efc['query']);_0x12df49[_0x7995('0x47')]=_['intersection'](_0x1f4efc['model'],qs['fields'](_0x5d0fe6['query'][_0x7995('0x56')]));_0x12df49['attributes']=_0x12df49[_0x7995('0x47')][_0x7995('0x57')]?_0x12df49['attributes']:_0x1f4efc[_0x7995('0x43')];_0x12df49[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x5d0fe6[_0x7995('0x44')]['sort']);_0x12df49[_0x7995('0x4b')]=qs['filters'](_[_0x7995('0x6b')](_0x5d0fe6[_0x7995('0x44')],_0x1f4efc[_0x7995('0x4c')]));if(_0x5d0fe6[_0x7995('0x44')][_0x7995('0x4d')]){_0x12df49[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x12df49[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x12df49[_0x7995('0x47')],function(_0x4aa202){var _0x8c9b6f={};_0x8c9b6f[_0x4aa202]={'$like':'%'+_0x5d0fe6[_0x7995('0x44')]['filter']+'%'};return _0x8c9b6f;})});}_0x12df49=_[_0x7995('0x4e')]({},_0x12df49,_0x5d0fe6[_0x7995('0x50')]);return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x1a6f42){if(_0x1a6f42){_0x572c53=_0x1a6f42[_0x7995('0x57')];if(!_0x5d0fe6['query'][_0x7995('0x48')]('nolimit')){_0x12df49[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x5d0fe6[_0x7995('0x44')][_0x7995('0x49')]);_0x12df49[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x5d0fe6['query'][_0x7995('0x31')]);}return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x4c2faf){if(_0x4c2faf){return _0x4c2faf?{'count':_0x572c53,'rows':_0x4c2faf}:null;}})[_0x7995('0x23')](respondWithResult(_0x43a8a4,null))[_0x7995('0x2b')](handleError(_0x43a8a4,null));};
\ No newline at end of file
index 70ec9a7..c853f30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc457=['../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x45ee1a,_0xa404b4){var _0x871dc5=function(_0x35199b){while(--_0x35199b){_0x45ee1a['push'](_0x45ee1a['shift']());}};_0x871dc5(++_0xa404b4);}(_0xc457,0x80));var _0x7c45=function(_0x40a278,_0x5f67f){_0x40a278=_0x40a278-0x0;var _0xb512ce=_0xc457[_0x40a278];return _0xb512ce;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x7c45('0x0'))['db'][_0x7c45('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7c45('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7c45('0x3'),'afterDestroy':_0x7c45('0x4')};function emitEvent(_0x42398c){return function(_0xa27d33,_0x2add97,_0x5ddb5a){SmsAccountEvents[_0x7c45('0x5')](_0x42398c+':'+_0xa27d33['id'],_0xa27d33);SmsAccountEvents[_0x7c45('0x5')](_0x42398c,_0xa27d33);_0x5ddb5a(null);};}for(var e in events){if(events[_0x7c45('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x7c45('0x7')]=SmsAccountEvents;
\ No newline at end of file
+var _0xa8ce=['../../mysqldb','SmsAccount','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x65e216,_0x568bd5){var _0x4e3e06=function(_0x351fc0){while(--_0x351fc0){_0x65e216['push'](_0x65e216['shift']());}};_0x4e3e06(++_0x568bd5);}(_0xa8ce,0x197));var _0xea8c=function(_0x5692c2,_0x3e8b34){_0x5692c2=_0x5692c2-0x0;var _0x556903=_0xa8ce[_0x5692c2];return _0x556903;};'use strict';var EventEmitter=require(_0xea8c('0x0'));var SmsAccount=require(_0xea8c('0x1'))['db'][_0xea8c('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xea8c('0x3'),'afterDestroy':_0xea8c('0x4')};function emitEvent(_0x1fde52){return function(_0x22e4b7,_0xcae704,_0x3b7b36){SmsAccountEvents['emit'](_0x1fde52+':'+_0x22e4b7['id'],_0x22e4b7);SmsAccountEvents[_0xea8c('0x5')](_0x1fde52,_0x22e4b7);_0x3b7b36(null);};}for(var e in events){if(events[_0xea8c('0x6')](e)){var event=events[e];SmsAccount[_0xea8c('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
index aadae9d..2f29e14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f6=['request-promise','rimraf','exports','SmsAccount','sms_accounts','lodash','../../config/logger','api','moment'];(function(_0xb40478,_0x3d81fd){var _0x53b0fb=function(_0x277a9f){while(--_0x277a9f){_0xb40478['push'](_0xb40478['shift']());}};_0x53b0fb(++_0x3d81fd);}(_0x68f6,0x19a));var _0x668f=function(_0x51d473,_0x10be9b){_0x51d473=_0x51d473-0x0;var _0x501138=_0x68f6[_0x51d473];return _0x501138;};'use strict';var _=require(_0x668f('0x0'));var util=require('util');var logger=require(_0x668f('0x1'))(_0x668f('0x2'));var moment=require(_0x668f('0x3'));var BPromise=require('bluebird');var rp=require(_0x668f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x668f('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x668f('0x6')]=function(_0x4c6891,_0x13908e){return _0x4c6891['define'](_0x668f('0x7'),attributes,{'tableName':_0x668f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ef5=['rimraf','../../config/environment','./smsAccount.attributes','exports','lodash','util','../../config/logger','moment','path'];(function(_0x4c887b,_0x2ef38a){var _0x383b04=function(_0x517a7f){while(--_0x517a7f){_0x4c887b['push'](_0x4c887b['shift']());}};_0x383b04(++_0x2ef38a);}(_0x8ef5,0x175));var _0x58ef=function(_0x413e7f,_0x908f1b){_0x413e7f=_0x413e7f-0x0;var _0x4b9b88=_0x8ef5[_0x413e7f];return _0x4b9b88;};'use strict';var _=require(_0x58ef('0x0'));var util=require(_0x58ef('0x1'));var logger=require(_0x58ef('0x2'))('api');var moment=require(_0x58ef('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x58ef('0x4'));var rimraf=require(_0x58ef('0x5'));var config=require(_0x58ef('0x6'));var attributes=require(_0x58ef('0x7'));module[_0x58ef('0x8')]=function(_0x27d332,_0x59cfee){return _0x27d332['define']('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 98387db..e675181 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29c9=['SmsAccount','find','raw','options','where','attributes','include','map','model','ShowSmsAccount','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result'];(function(_0x275180,_0xc84153){var _0x5dd3c5=function(_0x28ba58){while(--_0x28ba58){_0x275180['push'](_0x275180['shift']());}};_0x5dd3c5(++_0xc84153);}(_0x29c9,0x1ad));var _0x929c=function(_0x3bbf40,_0x103f0a){_0x3bbf40=_0x3bbf40-0x0;var _0xe17584=_0x29c9[_0x3bbf40];return _0xe17584;};'use strict';var _=require(_0x929c('0x0'));var util=require(_0x929c('0x1'));var moment=require(_0x929c('0x2'));var BPromise=require(_0x929c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x929c('0x4'));var db=require(_0x929c('0x5'))['db'];var utils=require(_0x929c('0x6'));var logger=require(_0x929c('0x7'))(_0x929c('0x8'));var config=require('../../config/environment');var jayson=require(_0x929c('0x9'));var client=jayson[_0x929c('0xa')][_0x929c('0xb')]({'port':0x232a});config['redis']=_[_0x929c('0xc')](config[_0x929c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x929c('0xe'))(new Redis(config[_0x929c('0xd')]));require(_0x929c('0xf'))['register'](socket);function respondWithRpcPromise(_0x3943b5,_0xe819ac,_0x3e509f){return new BPromise(function(_0x54c744,_0x15196b){return client[_0x929c('0x10')](_0x3943b5,_0x3e509f)[_0x929c('0x11')](function(_0x2dd979){logger['info'](_0x929c('0x12'),_0xe819ac,'request\x20sent');logger[_0x929c('0x13')](_0x929c('0x14'),_0xe819ac,'request\x20sent',JSON[_0x929c('0x15')](_0x2dd979));if(_0x2dd979[_0x929c('0x16')]){if(_0x2dd979[_0x929c('0x16')]['code']===0x1f4){logger[_0x929c('0x16')](_0x929c('0x12'),_0xe819ac,_0x2dd979[_0x929c('0x16')][_0x929c('0x17')]);return _0x15196b(_0x2dd979[_0x929c('0x16')]['message']);}logger['error'](_0x929c('0x12'),_0xe819ac,_0x2dd979[_0x929c('0x16')][_0x929c('0x17')]);return _0x54c744(_0x2dd979[_0x929c('0x16')][_0x929c('0x17')]);}else{logger[_0x929c('0x18')](_0x929c('0x12'),_0xe819ac,_0x929c('0x19'));_0x54c744(_0x2dd979[_0x929c('0x1a')]['message']);}})['catch'](function(_0x2f117c){logger['error']('SmsAccount,\x20%s,\x20%s',_0xe819ac,_0x2f117c);_0x15196b(_0x2f117c);});});}exports['ShowSmsAccount']=function(_0x274005){var _0x231bd9=this;return new Promise(function(_0x4c7050,_0x45dba4){return db[_0x929c('0x1b')][_0x929c('0x1c')]({'raw':_0x274005['options']?_0x274005['options'][_0x929c('0x1d')]===undefined?!![]:![]:!![],'where':_0x274005[_0x929c('0x1e')]?_0x274005[_0x929c('0x1e')][_0x929c('0x1f')]||null:null,'attributes':_0x274005['options']?_0x274005['options'][_0x929c('0x20')]||null:null,'include':_0x274005['options']?_0x274005[_0x929c('0x1e')][_0x929c('0x21')]?_[_0x929c('0x22')](_0x274005[_0x929c('0x1e')]['include'],function(_0x45b73d){return{'model':db[_0x45b73d['model']],'as':_0x45b73d['as'],'attributes':_0x45b73d[_0x929c('0x20')],'include':_0x45b73d[_0x929c('0x21')]?_[_0x929c('0x22')](_0x45b73d['include'],function(_0x14d49f){return{'model':db[_0x14d49f[_0x929c('0x23')]],'as':_0x14d49f['as'],'attributes':_0x14d49f[_0x929c('0x20')],'include':_0x14d49f[_0x929c('0x21')]?_['map'](_0x14d49f['include'],function(_0x45cf98){return{'model':db[_0x45cf98[_0x929c('0x23')]],'as':_0x45cf98['as'],'attributes':_0x45cf98['attributes']};}):[]};}):[]};}):[]:[]})[_0x929c('0x11')](function(_0x49da7c){logger[_0x929c('0x18')]('ShowSmsAccount',_0x274005);logger['debug'](_0x929c('0x24'),_0x274005,JSON[_0x929c('0x15')](_0x49da7c));_0x4c7050(_0x49da7c);})[_0x929c('0x25')](function(_0x3f4c00){logger[_0x929c('0x16')](_0x929c('0x24'),_0x3f4c00['message'],_0x274005);_0x45dba4(_0x231bd9[_0x929c('0x16')](0x1f4,_0x3f4c00[_0x929c('0x17')]));});});};
\ No newline at end of file
+var _0x0913=['defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','SmsAccount,\x20%s,\x20%s','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xcc69c5,_0x5b35b2){var _0x14ec59=function(_0x4377ec){while(--_0x4377ec){_0xcc69c5['push'](_0xcc69c5['shift']());}};_0x14ec59(++_0x5b35b2);}(_0x0913,0xa4));var _0x3091=function(_0x326406,_0x5aa772){_0x326406=_0x326406-0x0;var _0x30abe7=_0x0913[_0x326406];return _0x30abe7;};'use strict';var _=require('lodash');var util=require(_0x3091('0x0'));var moment=require(_0x3091('0x1'));var BPromise=require(_0x3091('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3091('0x3'));var db=require(_0x3091('0x4'))['db'];var utils=require(_0x3091('0x5'));var logger=require(_0x3091('0x6'))('rpc');var config=require(_0x3091('0x7'));var jayson=require(_0x3091('0x8'));var client=jayson[_0x3091('0x9')][_0x3091('0xa')]({'port':0x232a});config['redis']=_[_0x3091('0xb')](config[_0x3091('0xc')],{'host':_0x3091('0xd'),'port':0x18eb});var socket=require(_0x3091('0xe'))(new Redis(config[_0x3091('0xc')]));require('./smsAccount.socket')[_0x3091('0xf')](socket);function respondWithRpcPromise(_0x49e28e,_0x28407c,_0x2d85a6){return new BPromise(function(_0x156539,_0x28f147){return client[_0x3091('0x10')](_0x49e28e,_0x2d85a6)[_0x3091('0x11')](function(_0x2fbd11){logger[_0x3091('0x12')]('SmsAccount,\x20%s,\x20%s',_0x28407c,_0x3091('0x13'));logger['debug'](_0x3091('0x14'),_0x28407c,_0x3091('0x13'),JSON['stringify'](_0x2fbd11));if(_0x2fbd11[_0x3091('0x15')]){if(_0x2fbd11[_0x3091('0x15')]['code']===0x1f4){logger[_0x3091('0x15')]('SmsAccount,\x20%s,\x20%s',_0x28407c,_0x2fbd11[_0x3091('0x15')][_0x3091('0x16')]);return _0x28f147(_0x2fbd11['error'][_0x3091('0x16')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x28407c,_0x2fbd11[_0x3091('0x15')]['message']);return _0x156539(_0x2fbd11[_0x3091('0x15')][_0x3091('0x16')]);}else{logger[_0x3091('0x12')](_0x3091('0x17'),_0x28407c,_0x3091('0x13'));_0x156539(_0x2fbd11['result'][_0x3091('0x16')]);}})[_0x3091('0x18')](function(_0x3da196){logger['error'](_0x3091('0x17'),_0x28407c,_0x3da196);_0x28f147(_0x3da196);});});}exports[_0x3091('0x19')]=function(_0x264b0d){var _0x5c86cd=this;return new Promise(function(_0x7029f3,_0x32dec9){return db[_0x3091('0x1a')][_0x3091('0x1b')]({'raw':_0x264b0d[_0x3091('0x1c')]?_0x264b0d['options']['raw']===undefined?!![]:![]:!![],'where':_0x264b0d['options']?_0x264b0d['options'][_0x3091('0x1d')]||null:null,'attributes':_0x264b0d[_0x3091('0x1c')]?_0x264b0d[_0x3091('0x1c')][_0x3091('0x1e')]||null:null,'include':_0x264b0d['options']?_0x264b0d[_0x3091('0x1c')]['include']?_['map'](_0x264b0d[_0x3091('0x1c')][_0x3091('0x1f')],function(_0xbd896b){return{'model':db[_0xbd896b['model']],'as':_0xbd896b['as'],'attributes':_0xbd896b[_0x3091('0x1e')],'include':_0xbd896b[_0x3091('0x1f')]?_[_0x3091('0x20')](_0xbd896b[_0x3091('0x1f')],function(_0x5a948d){return{'model':db[_0x5a948d[_0x3091('0x21')]],'as':_0x5a948d['as'],'attributes':_0x5a948d['attributes'],'include':_0x5a948d[_0x3091('0x1f')]?_['map'](_0x5a948d[_0x3091('0x1f')],function(_0x3ccdbd){return{'model':db[_0x3ccdbd[_0x3091('0x21')]],'as':_0x3ccdbd['as'],'attributes':_0x3ccdbd[_0x3091('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3091('0x11')](function(_0x101d7e){logger[_0x3091('0x12')](_0x3091('0x19'),_0x264b0d);logger['debug'](_0x3091('0x19'),_0x264b0d,JSON[_0x3091('0x22')](_0x101d7e));_0x7029f3(_0x101d7e);})['catch'](function(_0x835f0f){logger[_0x3091('0x15')](_0x3091('0x19'),_0x835f0f[_0x3091('0x16')],_0x264b0d);_0x32dec9(_0x5c86cd[_0x3091('0x15')](0x1f4,_0x835f0f['message']));});});};
\ No newline at end of file
index 1caa958..3aa3c10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['save','remove','update','removeListener','register','length','smsAccount:'];(function(_0x29f711,_0x2029e1){var _0xb76098=function(_0x5d2ad1){while(--_0x5d2ad1){_0x29f711['push'](_0x29f711['shift']());}};_0xb76098(++_0x2029e1);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x2595a6,_0x48fc45){_0x2595a6=_0x2595a6-0x0;var _0x460197=_0x8caf[_0x2595a6];return _0x460197;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0xf8ca('0x0'),_0xf8ca('0x1'),_0xf8ca('0x2')];function createListener(_0x2306e8,_0xedc446){return function(_0x35d47c){_0xedc446['emit'](_0x2306e8,_0x35d47c);};}function removeListener(_0x129ca9,_0x23939c){return function(){SmsAccountEvents[_0xf8ca('0x3')](_0x129ca9,_0x23939c);};}exports[_0xf8ca('0x4')]=function(_0x1e2888){for(var _0x20c10a=0x0,_0x562eea=events[_0xf8ca('0x5')];_0x20c10a<_0x562eea;_0x20c10a++){var _0x3abd58=events[_0x20c10a];var _0x3a91d3=createListener(_0xf8ca('0x6')+_0x3abd58,_0x1e2888);SmsAccountEvents['on'](_0x3abd58,_0x3a91d3);}};
\ No newline at end of file
+var _0x1437=['update','emit','removeListener','register','smsAccount:','./smsAccount.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1437,0x1c5));var _0x7143=function(_0x415c11,_0x4b8067){_0x415c11=_0x415c11-0x0;var _0x3deb58=_0x1437[_0x415c11];return _0x3deb58;};'use strict';var SmsAccountEvents=require(_0x7143('0x0'));var events=[_0x7143('0x1'),'remove',_0x7143('0x2')];function createListener(_0x9ef40b,_0x5a08b7){return function(_0x162fc5){_0x5a08b7[_0x7143('0x3')](_0x9ef40b,_0x162fc5);};}function removeListener(_0x1a3e3a,_0x47a72d){return function(){SmsAccountEvents[_0x7143('0x4')](_0x1a3e3a,_0x47a72d);};}exports[_0x7143('0x5')]=function(_0x2ab1c7){for(var _0x24b4f6=0x0,_0x57fdcb=events['length'];_0x24b4f6<_0x57fdcb;_0x24b4f6++){var _0x13d779=events[_0x24b4f6];var _0x201368=createListener(_0x7143('0x6')+_0x13d779,_0x2ab1c7);SmsAccountEvents['on'](_0x13d779,_0x201368);}};
\ No newline at end of file
index bf104b4..6cf742b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa667=['/:id','show','post','create','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','isAuthenticated','index','get'];(function(_0x1d1432,_0x4cbb1e){var _0x32b8d7=function(_0x3471b6){while(--_0x3471b6){_0x1d1432['push'](_0x1d1432['shift']());}};_0x32b8d7(++_0x4cbb1e);}(_0xa667,0x19e));var _0x7a66=function(_0x59d4f6,_0x1a3c73){_0x59d4f6=_0x59d4f6-0x0;var _0x474ddd=_0xa667[_0x59d4f6];return _0x474ddd;};'use strict';var multer=require('multer');var util=require(_0x7a66('0x0'));var path=require('path');var timeout=require(_0x7a66('0x1'));var express=require(_0x7a66('0x2'));var router=express[_0x7a66('0x3')]();var auth=require(_0x7a66('0x4'));var interaction=require(_0x7a66('0x5'));var config=require(_0x7a66('0x6'));var controller=require(_0x7a66('0x7'));router['get']('/',auth[_0x7a66('0x8')](),controller[_0x7a66('0x9')]);router[_0x7a66('0xa')](_0x7a66('0xb'),auth[_0x7a66('0x8')](),controller[_0x7a66('0xc')]);router[_0x7a66('0xd')]('/',auth[_0x7a66('0x8')](),controller[_0x7a66('0xe')]);router['put'](_0x7a66('0xb'),auth[_0x7a66('0x8')](),controller['update']);router[_0x7a66('0xf')](_0x7a66('0xb'),auth[_0x7a66('0x8')](),controller['destroy']);module[_0x7a66('0x10')]=router;
\ No newline at end of file
+var _0xd2fb=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','exports','multer','util'];(function(_0x5fd46f,_0x3fd0c9){var _0x5e425f=function(_0x39046b){while(--_0x39046b){_0x5fd46f['push'](_0x5fd46f['shift']());}};_0x5e425f(++_0x3fd0c9);}(_0xd2fb,0x64));var _0xbd2f=function(_0x4603ea,_0x23b157){_0x4603ea=_0x4603ea-0x0;var _0x265b24=_0xd2fb[_0x4603ea];return _0x265b24;};'use strict';var multer=require(_0xbd2f('0x0'));var util=require(_0xbd2f('0x1'));var path=require('path');var timeout=require(_0xbd2f('0x2'));var express=require('express');var router=express[_0xbd2f('0x3')]();var auth=require(_0xbd2f('0x4'));var interaction=require(_0xbd2f('0x5'));var config=require(_0xbd2f('0x6'));var controller=require(_0xbd2f('0x7'));router[_0xbd2f('0x8')]('/',auth[_0xbd2f('0x9')](),controller[_0xbd2f('0xa')]);router[_0xbd2f('0x8')](_0xbd2f('0xb'),auth[_0xbd2f('0x9')](),controller[_0xbd2f('0xc')]);router[_0xbd2f('0xd')]('/',auth['isAuthenticated'](),controller[_0xbd2f('0xe')]);router[_0xbd2f('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xbd2f('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xbd2f('0x10')]=router;
\ No newline at end of file
index f5df654..06e9326 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x665f=['STRING','noop','exports'];(function(_0x1e5e0e,_0xeeadde){var _0x53e280=function(_0x12b2e4){while(--_0x12b2e4){_0x1e5e0e['push'](_0x1e5e0e['shift']());}};_0x53e280(++_0xeeadde);}(_0x665f,0xc2));var _0xf665=function(_0x4c21c9,_0x48a194){_0x4c21c9=_0x4c21c9-0x0;var _0x5e15f1=_0x665f[_0x4c21c9];return _0x5e15f1;};'use strict';var Sequelize=require('sequelize');module[_0xf665('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf665('0x1')],'allowNull':![],'defaultValue':_0xf665('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf665('0x1')]},'interval':{'type':Sequelize[_0xf665('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x8cf3=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x17b9b7,_0x4e4f73){var _0x8b11f7=function(_0xb599cb){while(--_0xb599cb){_0x17b9b7['push'](_0x17b9b7['shift']());}};_0x8b11f7(++_0x4e4f73);}(_0x8cf3,0x113));var _0x38cf=function(_0x50af80,_0x33ee3d){_0x50af80=_0x50af80-0x0;var _0x3eb7e0=_0x8cf3[_0x50af80];return _0x3eb7e0;};'use strict';var Sequelize=require(_0x38cf('0x0'));module[_0x38cf('0x1')]={'priority':{'type':Sequelize[_0x38cf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x38cf('0x3')],'allowNull':![],'defaultValue':_0x38cf('0x4')},'appdata':{'type':Sequelize[_0x38cf('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x38cf('0x3')],'defaultValue':_0x38cf('0x6')}};
\ No newline at end of file
index 2657cbd..32b612d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f4=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','update','then','end','error','stack','send','index','SmsApplication','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','rawAttributes','fields','catch','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel'];(function(_0x265cf6,_0x26f1d8){var _0x3f2737=function(_0x3d095f){while(--_0x3d095f){_0x265cf6['push'](_0x265cf6['shift']());}};_0x3f2737(++_0x26f1d8);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x298413,_0x370fc4){_0x298413=_0x298413-0x0;var _0x160f9c=_0xd4f4[_0x298413];return _0x160f9c;};'use strict';var pdf=require(_0x4d4f('0x0'));var emlformat=require(_0x4d4f('0x1'));var rimraf=require(_0x4d4f('0x2'));var zipdir=require(_0x4d4f('0x3'));var jsonpatch=require(_0x4d4f('0x4'));var rp=require(_0x4d4f('0x5'));var moment=require(_0x4d4f('0x6'));var BPromise=require(_0x4d4f('0x7'));var Mustache=require(_0x4d4f('0x8'));var util=require(_0x4d4f('0x9'));var path=require(_0x4d4f('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var db=require(_0x4d4f('0x1c'))['db'];function respondWithStatusCode(_0x5f3182,_0x551a10){_0x551a10=_0x551a10||0xcc;return function(_0x5b4f4e){if(_0x5b4f4e){return _0x5f3182[_0x4d4f('0x1d')](_0x551a10);}return _0x5f3182[_0x4d4f('0x1e')](_0x551a10)['end']();};}function respondWithResult(_0x1ea8b3,_0x301380){_0x301380=_0x301380||0xc8;return function(_0x1878b6){if(_0x1878b6){return _0x1ea8b3['status'](_0x301380)[_0x4d4f('0x1f')](_0x1878b6);}};}function respondWithFilteredResult(_0x2e736b,_0x1a9173){return function(_0x4a3364){if(_0x4a3364){var _0x59bfb5=_0x4a3364[_0x4d4f('0x20')],_0x5e4ff5=_0x1a9173['offset'],_0x18a528=_0x1a9173[_0x4d4f('0x21')]+_0x1a9173[_0x4d4f('0x22')],_0x16f8e7;if(_0x18a528>=_0x59bfb5){_0x18a528=_0x59bfb5;_0x16f8e7=0xc8;}else{_0x16f8e7=0xce;}_0x2e736b['status'](_0x16f8e7);return _0x2e736b['set']('Content-Range',_0x5e4ff5+'-'+_0x18a528+'/'+_0x59bfb5)['json'](_0x4a3364);}return null;};}function patchUpdates(_0x5eebec){return function(_0x34429e){try{jsonpatch[_0x4d4f('0x23')](_0x34429e,_0x5eebec,!![]);}catch(_0x433222){return BPromise[_0x4d4f('0x24')](_0x433222);}return _0x34429e['save']();};}function saveUpdates(_0x5b2863,_0x1e1ae2){return function(_0x4dd360){if(_0x4dd360){return _0x4dd360[_0x4d4f('0x25')](_0x5b2863)[_0x4d4f('0x26')](function(_0x3d1e38){return _0x3d1e38;});}return null;};}function removeEntity(_0x105c46,_0x3dd36a){return function(_0x5beab4){if(_0x5beab4){return _0x5beab4['destroy']()[_0x4d4f('0x26')](function(){_0x105c46['status'](0xcc)[_0x4d4f('0x27')]();});}};}function handleEntityNotFound(_0x3d5d93,_0x2d2fb3){return function(_0x3f4a55){if(!_0x3f4a55){_0x3d5d93[_0x4d4f('0x1d')](0x194);}return _0x3f4a55;};}function handleError(_0x497cec,_0x44bd2f){_0x44bd2f=_0x44bd2f||0x1f4;return function(_0x312728){logger[_0x4d4f('0x28')](_0x312728[_0x4d4f('0x29')]);if(_0x312728['name']){delete _0x312728['name'];}_0x497cec[_0x4d4f('0x1e')](_0x44bd2f)[_0x4d4f('0x2a')](_0x312728);};}exports[_0x4d4f('0x2b')]=function(_0x1f79f9,_0x58acbe){var _0x671c87={},_0x380ebf={},_0x388593={'count':0x0,'rows':[]};var _0x2e91b2=_['map'](db[_0x4d4f('0x2c')]['rawAttributes'],function(_0x1688bb){return{'name':_0x1688bb[_0x4d4f('0x2d')],'type':_0x1688bb['type'][_0x4d4f('0x2e')]};});_0x380ebf[_0x4d4f('0x2f')]=_[_0x4d4f('0x30')](_0x2e91b2,_0x4d4f('0x31'));_0x380ebf[_0x4d4f('0x32')]=_[_0x4d4f('0x33')](_0x1f79f9['query']);_0x380ebf[_0x4d4f('0x34')]=_[_0x4d4f('0x35')](_0x380ebf[_0x4d4f('0x2f')],_0x380ebf[_0x4d4f('0x32')]);_0x671c87[_0x4d4f('0x36')]=_['intersection'](_0x380ebf[_0x4d4f('0x2f')],qs['fields'](_0x1f79f9[_0x4d4f('0x32')]['fields']));_0x671c87['attributes']=_0x671c87['attributes'][_0x4d4f('0x37')]?_0x671c87['attributes']:_0x380ebf[_0x4d4f('0x2f')];if(!_0x1f79f9[_0x4d4f('0x32')][_0x4d4f('0x38')]('nolimit')){_0x671c87[_0x4d4f('0x22')]=qs[_0x4d4f('0x22')](_0x1f79f9[_0x4d4f('0x32')]['limit']);_0x671c87[_0x4d4f('0x21')]=qs['offset'](_0x1f79f9[_0x4d4f('0x32')][_0x4d4f('0x21')]);}_0x671c87[_0x4d4f('0x39')]=qs[_0x4d4f('0x3a')](_0x1f79f9[_0x4d4f('0x32')][_0x4d4f('0x3a')]);_0x671c87[_0x4d4f('0x3b')]=qs[_0x4d4f('0x34')](_['pick'](_0x1f79f9['query'],_0x380ebf[_0x4d4f('0x34')]),_0x2e91b2);if(_0x1f79f9['query']['filter']){_0x671c87[_0x4d4f('0x3b')]=_[_0x4d4f('0x3c')](_0x671c87[_0x4d4f('0x3b')],{'$or':_[_0x4d4f('0x30')](_0x2e91b2,function(_0x129103){if(_0x129103['type']!==_0x4d4f('0x3d')){var _0x27466f={};_0x27466f[_0x129103['name']]={'$like':'%'+_0x1f79f9[_0x4d4f('0x32')][_0x4d4f('0x3e')]+'%'};return _0x27466f;}})});}_0x671c87=_[_0x4d4f('0x3c')]({},_0x671c87,_0x1f79f9[_0x4d4f('0x3f')]);var _0x18800e={'where':_0x671c87[_0x4d4f('0x3b')]};return db[_0x4d4f('0x2c')][_0x4d4f('0x20')](_0x18800e)[_0x4d4f('0x26')](function(_0x4e54aa){_0x388593['count']=_0x4e54aa;if(_0x1f79f9[_0x4d4f('0x32')][_0x4d4f('0x40')]){_0x671c87[_0x4d4f('0x41')]=[{'all':!![]}];}return db[_0x4d4f('0x2c')]['findAll'](_0x671c87);})['then'](function(_0x3afb4c){_0x388593[_0x4d4f('0x42')]=_0x3afb4c;return _0x388593;})['then'](respondWithFilteredResult(_0x58acbe,_0x671c87))['catch'](handleError(_0x58acbe,null));};exports[_0x4d4f('0x43')]=function(_0x209cd0,_0x548fba){var _0x949a6d={'raw':!![],'where':{'id':_0x209cd0[_0x4d4f('0x44')]['id']}},_0x330bca={};_0x330bca[_0x4d4f('0x2f')]=_[_0x4d4f('0x33')](db['SmsApplication'][_0x4d4f('0x45')]);_0x330bca['query']=_[_0x4d4f('0x33')](_0x209cd0[_0x4d4f('0x32')]);_0x330bca['filters']=_[_0x4d4f('0x35')](_0x330bca[_0x4d4f('0x2f')],_0x330bca[_0x4d4f('0x32')]);_0x949a6d['attributes']=_[_0x4d4f('0x35')](_0x330bca['model'],qs[_0x4d4f('0x46')](_0x209cd0['query'][_0x4d4f('0x46')]));_0x949a6d[_0x4d4f('0x36')]=_0x949a6d[_0x4d4f('0x36')][_0x4d4f('0x37')]?_0x949a6d[_0x4d4f('0x36')]:_0x330bca['model'];if(_0x209cd0['query'][_0x4d4f('0x40')]){_0x949a6d[_0x4d4f('0x41')]=[{'all':!![]}];}_0x949a6d=_[_0x4d4f('0x3c')]({},_0x949a6d,_0x209cd0[_0x4d4f('0x3f')]);return db['SmsApplication']['find'](_0x949a6d)['then'](handleEntityNotFound(_0x548fba,null))[_0x4d4f('0x26')](respondWithResult(_0x548fba,null))[_0x4d4f('0x47')](handleError(_0x548fba,null));};exports[_0x4d4f('0x48')]=function(_0x326cf1,_0x15bd8d){return db[_0x4d4f('0x2c')][_0x4d4f('0x48')](_0x326cf1[_0x4d4f('0x49')],{})[_0x4d4f('0x26')](respondWithResult(_0x15bd8d,0xc9))[_0x4d4f('0x47')](handleError(_0x15bd8d,null));};exports[_0x4d4f('0x25')]=function(_0x1c290b,_0x5c7a41){if(_0x1c290b[_0x4d4f('0x49')]['id']){delete _0x1c290b[_0x4d4f('0x49')]['id'];}return db['SmsApplication'][_0x4d4f('0x4a')]({'where':{'id':_0x1c290b['params']['id']}})[_0x4d4f('0x26')](handleEntityNotFound(_0x5c7a41,null))[_0x4d4f('0x26')](saveUpdates(_0x1c290b['body'],null))[_0x4d4f('0x26')](respondWithResult(_0x5c7a41,null))[_0x4d4f('0x47')](handleError(_0x5c7a41,null));};exports[_0x4d4f('0x4b')]=function(_0x21d0d6,_0x7f22f2){return db[_0x4d4f('0x2c')][_0x4d4f('0x4a')]({'where':{'id':_0x21d0d6[_0x4d4f('0x44')]['id']}})[_0x4d4f('0x26')](handleEntityNotFound(_0x7f22f2,null))[_0x4d4f('0x26')](removeEntity(_0x7f22f2,null))[_0x4d4f('0x47')](handleError(_0x7f22f2,null));};
\ No newline at end of file
+var _0x36ee=['nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SmsApplication','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x5a3467,_0x4269f9){var _0x427bd0=function(_0x3d9531){while(--_0x3d9531){_0x5a3467['push'](_0x5a3467['shift']());}};_0x427bd0(++_0x4269f9);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe36e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe36e('0x1'));var rp=require(_0xe36e('0x2'));var moment=require(_0xe36e('0x3'));var BPromise=require(_0xe36e('0x4'));var Mustache=require(_0xe36e('0x5'));var util=require(_0xe36e('0x6'));var path=require(_0xe36e('0x7'));var sox=require(_0xe36e('0x8'));var csv=require(_0xe36e('0x9'));var ejs=require(_0xe36e('0xa'));var fs=require('fs');var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x9'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var db=require(_0xe36e('0x17'))['db'];function respondWithStatusCode(_0x265473,_0x4fbdb2){_0x4fbdb2=_0x4fbdb2||0xcc;return function(_0x32981d){if(_0x32981d){return _0x265473[_0xe36e('0x18')](_0x4fbdb2);}return _0x265473[_0xe36e('0x19')](_0x4fbdb2)[_0xe36e('0x1a')]();};}function respondWithResult(_0x5c3f3c,_0x3e264a){_0x3e264a=_0x3e264a||0xc8;return function(_0x521afa){if(_0x521afa){return _0x5c3f3c['status'](_0x3e264a)[_0xe36e('0x1b')](_0x521afa);}};}function respondWithFilteredResult(_0x300f21,_0x26fb37){return function(_0x278135){if(_0x278135){var _0xd6828e=_0x278135[_0xe36e('0x1c')],_0x924cd5=_0x26fb37[_0xe36e('0x1d')],_0x2096f6=_0x26fb37['offset']+_0x26fb37[_0xe36e('0x1e')],_0x39bae8;if(_0x2096f6>=_0xd6828e){_0x2096f6=_0xd6828e;_0x39bae8=0xc8;}else{_0x39bae8=0xce;}_0x300f21[_0xe36e('0x19')](_0x39bae8);return _0x300f21['set'](_0xe36e('0x1f'),_0x924cd5+'-'+_0x2096f6+'/'+_0xd6828e)['json'](_0x278135);}return null;};}function patchUpdates(_0x471400){return function(_0x303784){try{jsonpatch['apply'](_0x303784,_0x471400,!![]);}catch(_0x472825){return BPromise[_0xe36e('0x20')](_0x472825);}return _0x303784[_0xe36e('0x21')]();};}function saveUpdates(_0x597331,_0x21e95e){return function(_0x21bcf9){if(_0x21bcf9){return _0x21bcf9[_0xe36e('0x22')](_0x597331)[_0xe36e('0x23')](function(_0x2c4e30){return _0x2c4e30;});}return null;};}function removeEntity(_0x360b95,_0x4f438a){return function(_0xd71137){if(_0xd71137){return _0xd71137[_0xe36e('0x24')]()[_0xe36e('0x23')](function(){_0x360b95[_0xe36e('0x19')](0xcc)[_0xe36e('0x1a')]();});}};}function handleEntityNotFound(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(!_0x4749a8){_0x53e13a[_0xe36e('0x18')](0x194);}return _0x4749a8;};}function handleError(_0xb0cd85,_0xb32195){_0xb32195=_0xb32195||0x1f4;return function(_0x31c12c){logger[_0xe36e('0x25')](_0x31c12c[_0xe36e('0x26')]);if(_0x31c12c['name']){delete _0x31c12c[_0xe36e('0x27')];}_0xb0cd85[_0xe36e('0x19')](_0xb32195)[_0xe36e('0x28')](_0x31c12c);};}exports[_0xe36e('0x29')]=function(_0x5e58d8,_0x2d757c){var _0x5a3133={},_0xf7b02e={},_0x5993de={'count':0x0,'rows':[]};var _0x19f001=_['map'](db[_0xe36e('0x2a')]['rawAttributes'],function(_0x3b1045){return{'name':_0x3b1045['fieldName'],'type':_0x3b1045['type']['key']};});_0xf7b02e['model']=_[_0xe36e('0x2b')](_0x19f001,_0xe36e('0x27'));_0xf7b02e['query']=_['keys'](_0x5e58d8[_0xe36e('0x2c')]);_0xf7b02e[_0xe36e('0x2d')]=_[_0xe36e('0x2e')](_0xf7b02e[_0xe36e('0x2f')],_0xf7b02e[_0xe36e('0x2c')]);_0x5a3133[_0xe36e('0x30')]=_['intersection'](_0xf7b02e[_0xe36e('0x2f')],qs[_0xe36e('0x31')](_0x5e58d8['query'][_0xe36e('0x31')]));_0x5a3133[_0xe36e('0x30')]=_0x5a3133[_0xe36e('0x30')][_0xe36e('0x32')]?_0x5a3133[_0xe36e('0x30')]:_0xf7b02e[_0xe36e('0x2f')];if(!_0x5e58d8[_0xe36e('0x2c')][_0xe36e('0x33')](_0xe36e('0x34'))){_0x5a3133[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x5e58d8['query'][_0xe36e('0x1e')]);_0x5a3133['offset']=qs['offset'](_0x5e58d8[_0xe36e('0x2c')]['offset']);}_0x5a3133[_0xe36e('0x35')]=qs[_0xe36e('0x36')](_0x5e58d8[_0xe36e('0x2c')][_0xe36e('0x36')]);_0x5a3133['where']=qs['filters'](_[_0xe36e('0x37')](_0x5e58d8[_0xe36e('0x2c')],_0xf7b02e[_0xe36e('0x2d')]),_0x19f001);if(_0x5e58d8[_0xe36e('0x2c')]['filter']){_0x5a3133[_0xe36e('0x38')]=_[_0xe36e('0x39')](_0x5a3133[_0xe36e('0x38')],{'$or':_['map'](_0x19f001,function(_0x2c58d1){if(_0x2c58d1[_0xe36e('0x3a')]!=='VIRTUAL'){var _0x40cbe5={};_0x40cbe5[_0x2c58d1[_0xe36e('0x27')]]={'$like':'%'+_0x5e58d8[_0xe36e('0x2c')][_0xe36e('0x3b')]+'%'};return _0x40cbe5;}})});}_0x5a3133=_[_0xe36e('0x39')]({},_0x5a3133,_0x5e58d8[_0xe36e('0x3c')]);var _0x130edb={'where':_0x5a3133[_0xe36e('0x38')]};return db[_0xe36e('0x2a')][_0xe36e('0x1c')](_0x130edb)[_0xe36e('0x23')](function(_0x39dd9b){_0x5993de[_0xe36e('0x1c')]=_0x39dd9b;if(_0x5e58d8['query'][_0xe36e('0x3d')]){_0x5a3133[_0xe36e('0x3e')]=[{'all':!![]}];}return db[_0xe36e('0x2a')][_0xe36e('0x3f')](_0x5a3133);})[_0xe36e('0x23')](function(_0x4d133b){_0x5993de['rows']=_0x4d133b;return _0x5993de;})[_0xe36e('0x23')](respondWithFilteredResult(_0x2d757c,_0x5a3133))[_0xe36e('0x40')](handleError(_0x2d757c,null));};exports[_0xe36e('0x41')]=function(_0x537e1a,_0x27caff){var _0x34a1ba={'raw':!![],'where':{'id':_0x537e1a[_0xe36e('0x42')]['id']}},_0xff4f63={};_0xff4f63['model']=_[_0xe36e('0x43')](db[_0xe36e('0x2a')]['rawAttributes']);_0xff4f63[_0xe36e('0x2c')]=_['keys'](_0x537e1a[_0xe36e('0x2c')]);_0xff4f63[_0xe36e('0x2d')]=_[_0xe36e('0x2e')](_0xff4f63[_0xe36e('0x2f')],_0xff4f63[_0xe36e('0x2c')]);_0x34a1ba['attributes']=_[_0xe36e('0x2e')](_0xff4f63[_0xe36e('0x2f')],qs[_0xe36e('0x31')](_0x537e1a[_0xe36e('0x2c')][_0xe36e('0x31')]));_0x34a1ba[_0xe36e('0x30')]=_0x34a1ba['attributes'][_0xe36e('0x32')]?_0x34a1ba[_0xe36e('0x30')]:_0xff4f63[_0xe36e('0x2f')];if(_0x537e1a[_0xe36e('0x2c')][_0xe36e('0x3d')]){_0x34a1ba['include']=[{'all':!![]}];}_0x34a1ba=_[_0xe36e('0x39')]({},_0x34a1ba,_0x537e1a[_0xe36e('0x3c')]);return db[_0xe36e('0x2a')][_0xe36e('0x44')](_0x34a1ba)[_0xe36e('0x23')](handleEntityNotFound(_0x27caff,null))[_0xe36e('0x23')](respondWithResult(_0x27caff,null))[_0xe36e('0x40')](handleError(_0x27caff,null));};exports[_0xe36e('0x45')]=function(_0x43c2d4,_0x52e744){return db['SmsApplication'][_0xe36e('0x45')](_0x43c2d4['body'],{})[_0xe36e('0x23')](respondWithResult(_0x52e744,0xc9))[_0xe36e('0x40')](handleError(_0x52e744,null));};exports[_0xe36e('0x22')]=function(_0x25aa09,_0x51641c){if(_0x25aa09[_0xe36e('0x46')]['id']){delete _0x25aa09[_0xe36e('0x46')]['id'];}return db['SmsApplication'][_0xe36e('0x44')]({'where':{'id':_0x25aa09[_0xe36e('0x42')]['id']}})[_0xe36e('0x23')](handleEntityNotFound(_0x51641c,null))[_0xe36e('0x23')](saveUpdates(_0x25aa09[_0xe36e('0x46')],null))[_0xe36e('0x23')](respondWithResult(_0x51641c,null))[_0xe36e('0x40')](handleError(_0x51641c,null));};exports[_0xe36e('0x24')]=function(_0x17555e,_0x3a99aa){return db[_0xe36e('0x2a')][_0xe36e('0x44')]({'where':{'id':_0x17555e[_0xe36e('0x42')]['id']}})[_0xe36e('0x23')](handleEntityNotFound(_0x3a99aa,null))[_0xe36e('0x23')](removeEntity(_0x3a99aa,null))['catch'](handleError(_0x3a99aa,null));};
\ No newline at end of file
index 3856846..06935aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fca=['define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','../../config/environment','exports'];(function(_0x1925e5,_0x24d6b9){var _0x5ea3e6=function(_0x480dad){while(--_0x480dad){_0x1925e5['push'](_0x1925e5['shift']());}};_0x5ea3e6(++_0x24d6b9);}(_0x9fca,0x1a9));var _0xa9fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fca[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xa9fc('0x0'));var logger=require(_0xa9fc('0x1'))('api');var moment=require(_0xa9fc('0x2'));var BPromise=require(_0xa9fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9fc('0x4'));var rimraf=require('rimraf');var config=require(_0xa9fc('0x5'));var attributes=require('./smsApplication.attributes');module[_0xa9fc('0x6')]=function(_0xb89151,_0x35abd5){return _0xb89151[_0xa9fc('0x7')](_0xa9fc('0x8'),attributes,{'tableName':_0xa9fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa9fc('0xa'),'collate':_0xa9fc('0xb')});};
\ No newline at end of file
+var _0x073d=['path','rimraf','../../config/environment','exports','define','sms_applications','utf8mb4','lodash','util','api','moment','bluebird'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x073d,0xeb));var _0xd073=function(_0x4ecd76,_0x79f1f3){_0x4ecd76=_0x4ecd76-0x0;var _0x240f34=_0x073d[_0x4ecd76];return _0x240f34;};'use strict';var _=require(_0xd073('0x0'));var util=require(_0xd073('0x1'));var logger=require('../../config/logger')(_0xd073('0x2'));var moment=require(_0xd073('0x3'));var BPromise=require(_0xd073('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd073('0x5'));var rimraf=require(_0xd073('0x6'));var config=require(_0xd073('0x7'));var attributes=require('./smsApplication.attributes');module[_0xd073('0x8')]=function(_0x53c4d9,_0x5db3f4){return _0x53c4d9[_0xd073('0x9')]('SmsApplication',attributes,{'tableName':_0xd073('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd073('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 8c99943..7a04f35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38d3=['SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xefe181,_0xcb4712){var _0x445cdb=function(_0x15d16f){while(--_0x15d16f){_0xefe181['push'](_0xefe181['shift']());}};_0x445cdb(++_0xcb4712);}(_0x38d3,0x1a7));var _0x338d=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x38d3[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var moment=require('moment');var BPromise=require(_0x338d('0x2'));var rs=require(_0x338d('0x3'));var fs=require('fs');var Redis=require(_0x338d('0x4'));var db=require(_0x338d('0x5'))['db'];var utils=require(_0x338d('0x6'));var logger=require(_0x338d('0x7'))(_0x338d('0x8'));var config=require(_0x338d('0x9'));var jayson=require(_0x338d('0xa'));var client=jayson['client'][_0x338d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2012c3,_0x439f4b,_0x2b7aab){return new BPromise(function(_0x60eaa1,_0x46b758){return client[_0x338d('0xc')](_0x2012c3,_0x2b7aab)['then'](function(_0x264986){logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));logger[_0x338d('0x10')](_0x338d('0x11'),_0x439f4b,'request\x20sent',JSON[_0x338d('0x12')](_0x264986));if(_0x264986[_0x338d('0x13')]){if(_0x264986[_0x338d('0x13')][_0x338d('0x14')]===0x1f4){logger[_0x338d('0x13')](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')][_0x338d('0x15')]);return _0x46b758(_0x264986['error']['message']);}logger['error'](_0x338d('0xe'),_0x439f4b,_0x264986[_0x338d('0x13')]['message']);return _0x60eaa1(_0x264986[_0x338d('0x13')]['message']);}else{logger[_0x338d('0xd')](_0x338d('0xe'),_0x439f4b,_0x338d('0xf'));_0x60eaa1(_0x264986['result']['message']);}})['catch'](function(_0x2b8fd5){logger['error'](_0x338d('0xe'),_0x439f4b,_0x2b8fd5);_0x46b758(_0x2b8fd5);});});}
\ No newline at end of file
+var _0x544f=['info','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x2bcf7c,_0xe39ceb){var _0x1cfb89=function(_0xea05c6){while(--_0xea05c6){_0x2bcf7c['push'](_0x2bcf7c['shift']());}};_0x1cfb89(++_0xe39ceb);}(_0x544f,0x14c));var _0xf544=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x544f[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0xf544('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf544('0x1'));var rs=require(_0xf544('0x2'));var fs=require('fs');var Redis=require(_0xf544('0x3'));var db=require(_0xf544('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf544('0x5'))(_0xf544('0x6'));var config=require('../../config/environment');var jayson=require(_0xf544('0x7'));var client=jayson[_0xf544('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdb52e7,_0x2ce041,_0x1749cc){return new BPromise(function(_0x4dd70e,_0x10cbea){return client['request'](_0xdb52e7,_0x1749cc)[_0xf544('0x9')](function(_0x4fee2e){logger[_0xf544('0xa')]('SmsApplication,\x20%s,\x20%s',_0x2ce041,_0xf544('0xb'));logger['debug'](_0xf544('0xc'),_0x2ce041,_0xf544('0xb'),JSON[_0xf544('0xd')](_0x4fee2e));if(_0x4fee2e[_0xf544('0xe')]){if(_0x4fee2e[_0xf544('0xe')][_0xf544('0xf')]===0x1f4){logger[_0xf544('0xe')](_0xf544('0x10'),_0x2ce041,_0x4fee2e['error'][_0xf544('0x11')]);return _0x10cbea(_0x4fee2e[_0xf544('0xe')]['message']);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x2ce041,_0x4fee2e[_0xf544('0xe')]['message']);return _0x4dd70e(_0x4fee2e[_0xf544('0xe')]['message']);}else{logger[_0xf544('0xa')]('SmsApplication,\x20%s,\x20%s',_0x2ce041,_0xf544('0xb'));_0x4dd70e(_0x4fee2e[_0xf544('0x12')][_0xf544('0x11')]);}})['catch'](function(_0x44a3ee){logger[_0xf544('0xe')](_0xf544('0x10'),_0x2ce041,_0x44a3ee);_0x10cbea(_0x44a3ee);});});}
\ No newline at end of file
index b0ce50d..6fe5f6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbfd=['smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','multer','util','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','index','get','isAuthenticated','describe','/:id','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','addTags','put','sms'];(function(_0x5e74e3,_0x3e1c81){var _0xb694e2=function(_0x1dc2c1){while(--_0x1dc2c1){_0x5e74e3['push'](_0x5e74e3['shift']());}};_0xb694e2(++_0x3e1c81);}(_0xdbfd,0x18b));var _0xddbf=function(_0x1ff572,_0x233663){_0x1ff572=_0x1ff572-0x0;var _0xed6f77=_0xdbfd[_0x1ff572];return _0xed6f77;};'use strict';var multer=require(_0xddbf('0x0'));var util=require(_0xddbf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xddbf('0x2')]();var auth=require(_0xddbf('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xddbf('0x4'));var controller=require(_0xddbf('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xddbf('0x6')]);router[_0xddbf('0x7')]('/describe',auth[_0xddbf('0x8')](),controller[_0xddbf('0x9')]);router[_0xddbf('0x7')](_0xddbf('0xa'),auth[_0xddbf('0x8')](),controller['show']);router[_0xddbf('0x7')]('/:id/messages',auth[_0xddbf('0x8')](),controller['getMessages']);router[_0xddbf('0x7')]('/:id/download',auth[_0xddbf('0x8')](),controller[_0xddbf('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xddbf('0xc')]);router[_0xddbf('0xd')](_0xddbf('0xe'),auth[_0xddbf('0x8')](),controller[_0xddbf('0xf')]);router[_0xddbf('0xd')](_0xddbf('0x10'),auth[_0xddbf('0x8')](),interaction[_0xddbf('0x11')]('sms','smsinteraction:addtags'),controller[_0xddbf('0x12')]);router[_0xddbf('0x13')]('/:id',auth[_0xddbf('0x8')](),interaction[_0xddbf('0x11')](_0xddbf('0x14'),_0xddbf('0x15')),controller[_0xddbf('0x16')]);router[_0xddbf('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0xddbf('0x11')](_0xddbf('0x14'),_0xddbf('0x18')),controller['destroy']);router[_0xddbf('0x17')](_0xddbf('0x10'),auth[_0xddbf('0x8')](),controller[_0xddbf('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xaf6e=['/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','addTags','put','smsinteraction:update','update','delete','sms','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe'];(function(_0x275ec2,_0x231944){var _0x1e18d4=function(_0x172c90){while(--_0x172c90){_0x275ec2['push'](_0x275ec2['shift']());}};_0x1e18d4(++_0x231944);}(_0xaf6e,0x16e));var _0xeaf6=function(_0x11c195,_0x5ecd25){_0x11c195=_0x11c195-0x0;var _0x26a4b1=_0xaf6e[_0x11c195];return _0x26a4b1;};'use strict';var multer=require(_0xeaf6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeaf6('0x1'));var express=require(_0xeaf6('0x2'));var router=express[_0xeaf6('0x3')]();var auth=require(_0xeaf6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xeaf6('0x5'));var controller=require(_0xeaf6('0x6'));router[_0xeaf6('0x7')]('/',auth[_0xeaf6('0x8')](),controller[_0xeaf6('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xeaf6('0xa')]);router['get'](_0xeaf6('0xb'),auth['isAuthenticated'](),controller[_0xeaf6('0xc')]);router[_0xeaf6('0x7')](_0xeaf6('0xd'),auth[_0xeaf6('0x8')](),controller[_0xeaf6('0xe')]);router[_0xeaf6('0x7')](_0xeaf6('0xf'),auth[_0xeaf6('0x8')](),controller[_0xeaf6('0x10')]);router[_0xeaf6('0x11')]('/',auth[_0xeaf6('0x8')](),controller['create']);router[_0xeaf6('0x11')](_0xeaf6('0xd'),auth[_0xeaf6('0x8')](),controller[_0xeaf6('0x12')]);router[_0xeaf6('0x11')](_0xeaf6('0x13'),auth[_0xeaf6('0x8')](),interaction[_0xeaf6('0x14')]('sms','smsinteraction:addtags'),controller[_0xeaf6('0x15')]);router[_0xeaf6('0x16')](_0xeaf6('0xb'),auth[_0xeaf6('0x8')](),interaction[_0xeaf6('0x14')]('sms',_0xeaf6('0x17')),controller[_0xeaf6('0x18')]);router[_0xeaf6('0x19')](_0xeaf6('0xb'),auth[_0xeaf6('0x8')](),interaction[_0xeaf6('0x14')](_0xeaf6('0x1a'),'smsinteraction:destroy'),controller[_0xeaf6('0x1b')]);router[_0xeaf6('0x19')](_0xeaf6('0x13'),auth['isAuthenticated'](),controller['removeTags']);module[_0xeaf6('0x1c')]=router;
\ No newline at end of file
index a45ccab..efbba29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['out','sequelize','exports','DATE','STRING','ENUM'];(function(_0x3b3bf5,_0x2b124e){var _0xec6339=function(_0x497569){while(--_0x497569){_0x3b3bf5['push'](_0x3b3bf5['shift']());}};_0xec6339(++_0x2b124e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xb7e7[_0x1ae5ab];return _0x1ce001;};'use strict';var Sequelize=require(_0x7b7e('0x0'));var moment=require('moment');module[_0x7b7e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b7e('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7b7e('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7b7e('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x7b7e('0x4')]('in',_0x7b7e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7b7e('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x1f21d5,_0x3182f2){var _0xa8733=function(_0x3e7034){while(--_0x3e7034){_0x1f21d5['push'](_0x1f21d5['shift']());}};_0xa8733(++_0x3182f2);}(_0xb10b,0x12a));var _0xbb10=function(_0x12551a,_0x5af080){_0x12551a=_0x12551a-0x0;var _0x6f8fc0=_0xb10b[_0x12551a];return _0x6f8fc0;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');module[_0xbb10('0x1')]={'closed':{'type':Sequelize[_0xbb10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb10('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbb10('0x4')]},'phone':{'type':Sequelize[_0xbb10('0x4')]},'read1stAt':{'type':Sequelize[_0xbb10('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb10('0x5')]('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 8e7a4a5..db3b6ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04b8=['group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','keys','includeAll','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','firstName','Messages','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','closed','closedAt','disposition','System','out','renderFile','downloadInteraction.html','.pdf','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','status','send','map','fullname','TagIds','Tags','split','forEach','push','catch','index','SmsInteraction','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','value','having','`\x20=\x200','Contact','operator','length','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?','find','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','type','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x04b8,0x159));var _0x804b=function(_0x204b6c,_0x272e3d){_0x204b6c=_0x204b6c-0x0;var _0x331b51=_0x04b8[_0x204b6c];return _0x331b51;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x804b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x804b('0x1'));var jsonpatch=require(_0x804b('0x2'));var rp=require('request-promise');var moment=require(_0x804b('0x3'));var BPromise=require(_0x804b('0x4'));var Mustache=require('mustache');var util=require(_0x804b('0x5'));var path=require(_0x804b('0x6'));var sox=require(_0x804b('0x7'));var csv=require('to-csv');var ejs=require(_0x804b('0x8'));var fs=require('fs');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 db=require(_0x804b('0x17'))['db'];config['redis']=_[_0x804b('0x18')](config['redis'],{'host':_0x804b('0x19'),'port':0x18eb});var socket=require(_0x804b('0x1a'))(new Redis(config[_0x804b('0x1b')]));require(_0x804b('0x1c'))['register'](socket);function respondWithStatusCode(_0x215825,_0x1b01a7){_0x1b01a7=_0x1b01a7||0xcc;return function(_0x274bb8){if(_0x274bb8){return _0x215825[_0x804b('0x1d')](_0x1b01a7);}return _0x215825['status'](_0x1b01a7)[_0x804b('0x1e')]();};}function respondWithResult(_0x8ccbe0,_0x5e1cfe){_0x5e1cfe=_0x5e1cfe||0xc8;return function(_0x3c5986){if(_0x3c5986){return _0x8ccbe0['status'](_0x5e1cfe)[_0x804b('0x1f')](_0x3c5986);}};}function respondWithFilteredResult(_0x301a22,_0x13662e){return function(_0x1760f8){if(_0x1760f8){var _0x3a05c0=_0x1760f8[_0x804b('0x20')],_0x5a0a82=_0x13662e[_0x804b('0x21')],_0x871d6c=_0x13662e[_0x804b('0x21')]+_0x13662e[_0x804b('0x22')],_0x50b4fe;if(_0x871d6c>=_0x3a05c0){_0x871d6c=_0x3a05c0;_0x50b4fe=0xc8;}else{_0x50b4fe=0xce;}_0x301a22['status'](_0x50b4fe);return _0x301a22[_0x804b('0x23')](_0x804b('0x24'),_0x5a0a82+'-'+_0x871d6c+'/'+_0x3a05c0)[_0x804b('0x1f')](_0x1760f8);}return null;};}function patchUpdates(_0x11eaf6){return function(_0x27844b){try{jsonpatch[_0x804b('0x25')](_0x27844b,_0x11eaf6,!![]);}catch(_0x3241a0){return BPromise[_0x804b('0x26')](_0x3241a0);}return _0x27844b[_0x804b('0x27')]();};}function saveUpdates(_0x2b7271,_0x1acc48){return function(_0x5a968b){if(_0x5a968b){return _0x5a968b[_0x804b('0x28')](_0x2b7271)[_0x804b('0x29')](function(_0x5585f8){return _0x5585f8;});}return null;};}function removeEntity(_0x44a921,_0x367024){return function(_0x115b8f){if(_0x115b8f){return _0x115b8f[_0x804b('0x2a')]()[_0x804b('0x29')](function(){_0x44a921['status'](0xcc)[_0x804b('0x1e')]();});}};}function handleEntityNotFound(_0x7d9c33,_0x4e7266){return function(_0x12b6a6){if(!_0x12b6a6){_0x7d9c33[_0x804b('0x1d')](0x194);}return _0x12b6a6;};}function handleError(_0x1117a5,_0x27d5ec){_0x27d5ec=_0x27d5ec||0x1f4;return function(_0x2d88da){logger['error'](_0x2d88da[_0x804b('0x2b')]);if(_0x2d88da[_0x804b('0x2c')]){delete _0x2d88da[_0x804b('0x2c')];}_0x1117a5[_0x804b('0x2d')](_0x27d5ec)[_0x804b('0x2e')](_0x2d88da);};}function getInteractionUsers(_0x4a6079,_0x3eb531){return new BPromise(function(_0x2931ff,_0x410871){try{if(_0x3eb531[_0x4a6079['id']]){_0x4a6079['Users']=_[_0x804b('0x2f')](_0x3eb531[_0x4a6079['id']],function(_0x407357){return{'id':_0x407357['id'],'fullname':_0x407357[_0x804b('0x30')]};});}}catch(_0x57b8da){_0x410871(_0x57b8da);}_0x2931ff(_0x4a6079);});}function getInteractionTags(_0x408857,_0x471c04){return new BPromise(function(_0x5e8f85,_0x391376){try{if(_0x408857[_0x804b('0x31')]){_0x408857[_0x804b('0x32')]=[];_0x408857[_0x804b('0x31')][_0x804b('0x33')](',')[_0x804b('0x34')](function(_0x551792){_0x408857[_0x804b('0x32')][_0x804b('0x35')](_0x471c04[_0x551792]);});}delete _0x408857[_0x804b('0x31')];}catch(_0xa6d897){_0x391376(_0xa6d897);}_0x5e8f85(_0x408857);});}function updateSmsInteraction(_0x3c82a1,_0x2c509a,_0x13ee50){return new BPromise(function(_0x36d3c1,_0x30f25f){return getInteractionUsers(_0x3c82a1,_0x13ee50)[_0x804b('0x29')](function(_0x288382){return getInteractionTags(_0x288382,_0x2c509a);})[_0x804b('0x29')](function(_0x34d5d0){_0x36d3c1(_0x34d5d0);})[_0x804b('0x36')](function(_0x20c50b){_0x30f25f(_0x20c50b);});});}exports[_0x804b('0x37')]=function(_0x3f02ef,_0x1be16f){var _0xf47023={},_0x3cf6df={},_0xa9d773={'count':0x0,'rows':[]};var _0x350387=_[_0x804b('0x2f')](db[_0x804b('0x38')][_0x804b('0x39')],function(_0x5de917){return{'name':_0x5de917['fieldName'],'type':_0x5de917['type'][_0x804b('0x3a')]};});_0x3cf6df[_0x804b('0x3b')]=_[_0x804b('0x2f')](_0x350387,'name');_0x3cf6df['query']=_['keys'](_0x3f02ef[_0x804b('0x3c')]);_0x3cf6df[_0x804b('0x3d')]=_[_0x804b('0x3e')](_0x3cf6df[_0x804b('0x3b')],_0x3cf6df[_0x804b('0x3c')]);_0xf47023[_0x804b('0x3f')]=_[_0x804b('0x3e')](_0x3cf6df[_0x804b('0x3b')],qs[_0x804b('0x40')](_0x3f02ef[_0x804b('0x3c')][_0x804b('0x40')]));_0xf47023[_0x804b('0x3f')]=_0xf47023[_0x804b('0x3f')]['length']?_0xf47023[_0x804b('0x3f')]:_0x3cf6df[_0x804b('0x3b')];if(!_0x3f02ef[_0x804b('0x3c')][_0x804b('0x41')](_0x804b('0x42'))){_0xf47023['limit']=qs['limit'](_0x3f02ef[_0x804b('0x3c')][_0x804b('0x22')]);_0xf47023[_0x804b('0x21')]=qs['offset'](_0x3f02ef[_0x804b('0x3c')]['offset']);}_0xf47023[_0x804b('0x43')]=qs[_0x804b('0x44')](_0x3f02ef[_0x804b('0x3c')][_0x804b('0x44')]);_0xf47023[_0x804b('0x45')]=qs[_0x804b('0x3d')](_[_0x804b('0x46')](_0x3f02ef['query'],_0x3cf6df[_0x804b('0x3d')]),_0x350387);var _0x1c0363=[];var _0x1dcec8=squel[_0x804b('0x47')]()['field']('id')[_0x804b('0x48')](_0x804b('0x2c'))[_0x804b('0x48')](_0x804b('0x49'))[_0x804b('0x4a')](_0x804b('0x4b'));var _0x29c9e6=squel[_0x804b('0x47')]()['field'](_0x804b('0x4c'))['field']('u.fullname')['field'](_0x804b('0x4d'))['from'](_0x804b('0x4e'),'ui')[_0x804b('0x4f')](_0x804b('0x50'),'u',_0x804b('0x51'));var _0x562711=squel[_0x804b('0x47')]()[_0x804b('0x4a')](_0x804b('0x52'),'i')['left_join'](_0x804b('0x53'),'c',_0x804b('0x54'))[_0x804b('0x4f')]('users','o',_0x804b('0x55'))[_0x804b('0x4f')](_0x804b('0x56'),'a',_0x804b('0x57'))[_0x804b('0x4f')](_0x804b('0x58'),'me',_0x804b('0x59'))[_0x804b('0x4f')](_0x804b('0x5a'),'it',_0x804b('0x5b'))[_0x804b('0x4f')](_0x804b('0x4b'),'t',_0x804b('0x5c'));var _0x2c1796=squel['expr']();var _0x52d0a2=[];var _0x44c52d=squel[_0x804b('0x5d')]();var _0x82fc71;if(_0x3f02ef[_0x804b('0x3c')][_0x804b('0x5e')]){_0x82fc71=as['parseSearch'](_0x3f02ef[_0x804b('0x3c')][_0x804b('0x5e')]);var _0xefd796=_0x82fc71[_0x804b('0x5f')];for(var _0x47247c=0x0;_0x47247c<_0x82fc71[_0x804b('0x60')]['length'];_0x47247c++){var _0x47eddc=_0x82fc71[_0x804b('0x60')][_0x47247c];var _0x1f30ed='i';var _0x525f95=_['find'](_0x350387,[_0x804b('0x2c'),_0x47eddc[_0x804b('0x48')]]);if(!_0x525f95){switch(_0x47eddc[_0x804b('0x48')]){case'unreadMessages':if(_0x47eddc[_0x804b('0x61')]==0x1){_0x562711[_0x804b('0x62')]('`'+_0x47eddc['field']+_0x804b('0x63'));}else{_0x562711['having']('`'+_0x47eddc[_0x804b('0x48')]+'`\x20>\x200');}break;case _0x804b('0x64'):if(_0x47eddc[_0x804b('0x65')]==='$substring'){if(_0x47eddc[_0x804b('0x61')]['split']('\x20')[_0x804b('0x66')]>0x1){_0x2c1796[_0xefd796](_0x804b('0x67'),qs[_0x804b('0x68')](_0x47eddc[_0x804b('0x61')]),null);}else{var _0x16cc5f='%'+_0x47eddc[_0x804b('0x61')]+'%';_0x2c1796[_0xefd796](_0x804b('0x69'),_0x16cc5f,_0x16cc5f,_0x16cc5f);}}else{_0x525f95=_[_0x804b('0x6a')](_0x350387,[_0x804b('0x2c'),_0x804b('0x6b')]);_0x47eddc['field']='ContactId';_0x126ae4=as[_0x804b('0x6c')](_0x1f30ed,_0x525f95['type'],_0x47eddc);_0x2c1796[_0xefd796](_0x126ae4['text'],_0x126ae4[_0x804b('0x61')][_0x804b('0x6d')],_0x126ae4[_0x804b('0x61')][_0x804b('0x1e')]);}break;case'Tag':var _0x4f7cc4=_0x47eddc[_0x804b('0x61')][_0x804b('0x33')](',')[_0x804b('0x2f')](function(_0x6005bf){return Number(_0x6005bf);});_0x4f7cc4[_0x804b('0x34')](function(_0xe19c3d){_0x44c52d['or'](_0x804b('0x6e'),'%,'+_0xe19c3d+',%');});_0x52d0a2=_[_0x804b('0x6f')](_0x52d0a2,_0x4f7cc4);break;case _0x804b('0x70'):if(_0x47eddc[_0x804b('0x65')]===_0x804b('0x71')){_0x2c1796[_0xefd796](_0x804b('0x72'),'%'+_0x47eddc[_0x804b('0x61')]+'%',null);}else{_0x525f95=_[_0x804b('0x6a')](_0x350387,[_0x804b('0x2c'),_0x804b('0x73')]);_0x47eddc['field']=_0x804b('0x73');_0x126ae4=as[_0x804b('0x6c')](_0x1f30ed,_0x525f95['type'],_0x47eddc);_0x2c1796[_0xefd796](_0x126ae4[_0x804b('0x74')],_0x126ae4[_0x804b('0x61')][_0x804b('0x6d')],_0x126ae4[_0x804b('0x61')]['end']);}break;case _0x804b('0x75'):_0x126ae4=as[_0x804b('0x6c')]('me',null,_0x47eddc);_0x2c1796[_0xefd796](_0x126ae4['text'],_0x126ae4[_0x804b('0x61')][_0x804b('0x6d')],_0x126ae4[_0x804b('0x61')]['end']);break;}}else{var _0x126ae4=as[_0x804b('0x6c')](_0x1f30ed,_0x525f95[_0x804b('0x76')],_0x47eddc);_0x2c1796[_0xefd796](_0x126ae4[_0x804b('0x74')],_0x126ae4[_0x804b('0x61')]['start'],_0x126ae4[_0x804b('0x61')][_0x804b('0x1e')]);}}}else{var _0x3c043e=_(_0x3f02ef[_0x804b('0x3c')])['keys']()['map'](function(_0x183796){return _['some'](_0x350387,[_0x804b('0x2c'),_0x183796])?_0x183796:undefined;})[_0x804b('0x77')]()[_0x804b('0x61')]();if(!_[_0x804b('0x78')](_0x3c043e)){_0x3c043e[_0x804b('0x34')](function(_0x5d4f6c){if(_0x5d4f6c===_0x804b('0x79')){_0x562711[_0x804b('0x45')](_0x804b('0x7a'),[]['concat'](_0x3f02ef[_0x804b('0x3c')][_0x5d4f6c]));}else if(_0x5d4f6c===_0x804b('0x7b')){var _0x5ce2e7=JSON[_0x804b('0x7c')](_0x3f02ef['query'][_0x5d4f6c])[_0x804b('0x7d')];var _0x45d98f=JSON['parse'](_0x3f02ef[_0x804b('0x3c')][_0x5d4f6c])[_0x804b('0x7e')];_0x562711[_0x804b('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5ce2e7,_0x45d98f);}else{if(_0x3f02ef[_0x804b('0x3c')][_0x5d4f6c]==='null'){_0x562711[_0x804b('0x45')]('i.'+_0x5d4f6c+_0x804b('0x7f'));}else{_0x562711[_0x804b('0x45')]('i.'+_0x5d4f6c+_0x804b('0x80'),_0x3f02ef['query'][_0x5d4f6c]);}}});}if(_0x3f02ef[_0x804b('0x3c')][_0x804b('0x81')]){if(_0x3f02ef[_0x804b('0x3c')][_0x804b('0x81')]==0x1){_0x562711[_0x804b('0x62')](_0x804b('0x82'));}else{_0x562711['having'](_0x804b('0x83'));}}if(_0x3f02ef[_0x804b('0x3c')]['tag']){_0x52d0a2=_[_0x804b('0x84')](_0x3f02ef[_0x804b('0x3c')][_0x804b('0x85')])?_0x3f02ef[_0x804b('0x3c')]['tag']:new Array(_0x3f02ef[_0x804b('0x3c')][_0x804b('0x85')]);_0x52d0a2['forEach'](function(_0x2541cd){_0x44c52d['or'](_0x804b('0x6e'),'%,'+_0x2541cd+',%');});}if(_0x3f02ef['query'][_0x804b('0x86')]){var _0x540d11=_0x3f02ef[_0x804b('0x3c')][_0x804b('0x86')][_0x804b('0x87')]('\x5c','\x5c\x5c')[_0x804b('0x87')]('\x27\x27',_0x804b('0x88'));if(qs[_0x804b('0x89')](_0x540d11)){_0x2c1796['or'](_0x804b('0x8a'),_0x540d11+'%')['or']('i.phone\x20LIKE\x20?',_0x540d11+'%');}else{_0x2c1796['or'](_0x804b('0x8b'),qs['getFullTextValue'](_0x540d11))['or'](_0x804b('0x8c'),_0x540d11+'%');}}}_0x562711[_0x804b('0x45')](_0x2c1796);_0x562711[_0x804b('0x8d')](_0x804b('0x8e'));var _0x226c0d={'type':db[_0x804b('0x8f')][_0x804b('0x90')][_0x804b('0x91')],'raw':!![]};var _0x2e954a=_0x562711[_0x804b('0x92')]();_0x2e954a[_0x804b('0x48')]('i.id');_0x2e954a['field'](_0x804b('0x93'),_0x804b('0x94'));if(_0xf47023[_0x804b('0x43')]){_0xf47023[_0x804b('0x43')]['forEach'](function(_0x119f7d){_0x562711[_0x804b('0x43')]('i.'+_0x119f7d[0x0],_0x119f7d[0x1]===_0x804b('0x95')?![]:!![]);});}if(!_[_0x804b('0x78')](_0x52d0a2)){_0x562711[_0x804b('0x62')](_0x44c52d);_0x2e954a[_0x804b('0x45')](_0x804b('0x96'),_0x52d0a2);}BPromise[_0x804b('0x97')]()[_0x804b('0x29')](function(){if(!_0x82fc71){if(_0x3f02ef[_0x804b('0x3c')]['SmsAccountId']||_0x3f02ef['query'][_0x804b('0x98')])return;_0x2e954a[_0x804b('0x45')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x562711[_0x804b('0x45')](_0x804b('0x99'));return;}return _0x3f02ef['user'][_0x804b('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5e003f){if(_[_0x804b('0x78')](_0x5e003f)){_0x2e954a[_0x804b('0x45')]('i.SmsAccountId\x20IS\x20NULL');_0x562711['where'](_0x804b('0x9b'));}else{_0x2e954a[_0x804b('0x45')]('i.SmsAccountId\x20IN\x20?',_[_0x804b('0x2f')](_0x5e003f,'id'));_0x562711['where'](_0x804b('0x7a'),_[_0x804b('0x2f')](_0x5e003f,'id'));}});})[_0x804b('0x29')](function(){db['sequelize'][_0x804b('0x3c')](_0x2e954a[_0x804b('0x9c')](),_0x226c0d)[_0x804b('0x29')](function(_0x2871e5){_0xa9d773[_0x804b('0x20')]=_0x2871e5[_0x804b('0x66')];if(_0xa9d773[_0x804b('0x20')]===0x0)return[];return db[_0x804b('0x9d')][_0x804b('0x3c')](_0x1dcec8[_0x804b('0x9c')](),_0x226c0d)['then'](function(_0x47c937){_0x1c0363=_[_0x804b('0x9e')](_0x47c937,'id');_0x226c0d=_[_0x804b('0x9f')](_0x226c0d,{'model':db[_0x804b('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f02ef[_0x804b('0x3c')][_0x804b('0x40')]){_0xf47023[_0x804b('0x3f')][_0x804b('0x34')](function(_0x29f6d9){_0x562711[_0x804b('0x48')]('i.'+_0x29f6d9);});}else{_0x562711['field'](_0x804b('0x93'),_0x804b('0x94'));_0x562711[_0x804b('0x48')](_0x804b('0xa0'),_0x804b('0xa1'));_0x562711[_0x804b('0x48')](_0x804b('0xa2'),_0x804b('0xa3'));_0x562711[_0x804b('0x48')](_0x804b('0xa4'));_0x562711[_0x804b('0x48')](_0x804b('0xa5'),_0x804b('0xa6'));_0x562711[_0x804b('0x48')](_0x804b('0xa7'),_0x804b('0xa8'));_0x562711[_0x804b('0x48')](_0x804b('0xa9'),_0x804b('0xaa'));_0x562711[_0x804b('0x48')](_0x804b('0xab'),_0x804b('0xac'));_0x562711[_0x804b('0x48')](_0x804b('0xad'),_0x804b('0xae'));_0x562711['field'](_0x804b('0xaf'),_0x804b('0xb0'));_0x562711[_0x804b('0x48')]('o.fullname',_0x804b('0xb1'));_0x562711[_0x804b('0x48')](_0x804b('0xb2'),_0x804b('0xb3'));_0x562711[_0x804b('0x48')](_0x804b('0xb4'),_0x804b('0x31'));}if(_0xf47023['limit'])_0x562711[_0x804b('0x22')](_0xf47023[_0x804b('0x22')]);if(_0xf47023[_0x804b('0x21')])_0x562711[_0x804b('0x21')](_0xf47023[_0x804b('0x21')]);return db[_0x804b('0x9d')][_0x804b('0x3c')](_0x562711[_0x804b('0x9c')](),_0x226c0d);})[_0x804b('0x29')](function(_0x44fffb){_0x29c9e6[_0x804b('0x45')](_0x804b('0xb5'),_[_0x804b('0x2f')](_0x44fffb,'id'));return db['sequelize'][_0x804b('0x3c')](_0x29c9e6[_0x804b('0x9c')](),_0x226c0d)[_0x804b('0x29')](function(_0x43b050){var _0x15bfe6=_[_0x804b('0xb6')](_0x43b050,_0x804b('0xb7'));var _0x26659c=[];_0x44fffb['forEach'](function(_0x13592f){_0x26659c[_0x804b('0x35')](updateSmsInteraction(_0x13592f,_0x1c0363,_0x15bfe6));});return BPromise[_0x804b('0xb8')](_0x26659c);});});})['then'](function(_0x1c7745){_0xa9d773[_0x804b('0xb9')]=_0x1c7745;return _0xa9d773;})[_0x804b('0x29')](respondWithFilteredResult(_0x1be16f,_0xf47023));})[_0x804b('0x36')](handleError(_0x1be16f,null));};exports[_0x804b('0xba')]=function(_0x4b10a9,_0x2ec841){var _0x51d88a={'raw':![],'where':{'id':_0x4b10a9[_0x804b('0xbb')]['id']}},_0x31bd15={};_0x31bd15[_0x804b('0x3b')]=_['keys'](db[_0x804b('0x38')][_0x804b('0x39')]);_0x31bd15[_0x804b('0x3c')]=_[_0x804b('0xbc')](_0x4b10a9['query']);_0x31bd15[_0x804b('0x3d')]=_[_0x804b('0x3e')](_0x31bd15['model'],_0x31bd15[_0x804b('0x3c')]);_0x51d88a[_0x804b('0x3f')]=_[_0x804b('0x3e')](_0x31bd15['model'],qs[_0x804b('0x40')](_0x4b10a9[_0x804b('0x3c')][_0x804b('0x40')]));_0x51d88a[_0x804b('0x3f')]=_0x51d88a['attributes']['length']?_0x51d88a[_0x804b('0x3f')]:_0x31bd15[_0x804b('0x3b')];if(_0x4b10a9[_0x804b('0x3c')][_0x804b('0xbd')]){_0x51d88a['include']=[{'all':!![]}];}_0x51d88a=_['merge']({},_0x51d88a,_0x4b10a9['options']);return db[_0x804b('0x38')][_0x804b('0x6a')](_0x51d88a)[_0x804b('0x29')](handleEntityNotFound(_0x2ec841,null))[_0x804b('0x29')](respondWithResult(_0x2ec841,null))[_0x804b('0x36')](handleError(_0x2ec841,null));};exports['create']=function(_0x588630,_0x197869){return db['SmsInteraction'][_0x804b('0xbe')](_0x588630[_0x804b('0x75')],{})[_0x804b('0x29')](respondWithResult(_0x197869,0xc9))['catch'](handleError(_0x197869,null));};exports[_0x804b('0x28')]=function(_0x148c32,_0x3d8773){if(_0x148c32[_0x804b('0x75')]['id']){delete _0x148c32[_0x804b('0x75')]['id'];}return db[_0x804b('0x38')][_0x804b('0x6a')]({'where':{'id':_0x148c32[_0x804b('0xbb')]['id']}})[_0x804b('0x29')](handleEntityNotFound(_0x3d8773,null))[_0x804b('0x29')](saveUpdates(_0x148c32[_0x804b('0x75')],null))[_0x804b('0x29')](respondWithResult(_0x3d8773,null))[_0x804b('0x36')](handleError(_0x3d8773,null));};exports[_0x804b('0x2a')]=function(_0x44d9cc,_0x3443ca){return db[_0x804b('0x38')][_0x804b('0x6a')]({'where':{'id':_0x44d9cc[_0x804b('0xbb')]['id']}})['then'](handleEntityNotFound(_0x3443ca,null))[_0x804b('0x29')](removeEntity(_0x3443ca,null))[_0x804b('0x36')](handleError(_0x3443ca,null));};exports[_0x804b('0xbf')]=function(_0x4bf1cc,_0x44d09c){return db[_0x804b('0x38')][_0x804b('0xbf')]()[_0x804b('0x29')](respondWithResult(_0x44d09c,null))[_0x804b('0x36')](handleError(_0x44d09c,null));};exports[_0x804b('0xc0')]=function(_0x250f9d,_0x10b3ac,_0x49a58b){return db[_0x804b('0xc1')][_0x804b('0x6a')]({'where':{'id':_0x250f9d[_0x804b('0xbb')]['id']}})['then'](handleEntityNotFound(_0x10b3ac,null))[_0x804b('0x29')](function(_0x10b673){if(_0x10b673){return _0x10b673[_0x804b('0xc0')](_0x250f9d['body'][_0x804b('0xc2')],_[_0x804b('0xc3')](_0x250f9d[_0x804b('0x75')],['ids','id'])||{});}})['then'](respondWithResult(_0x10b3ac,null))['catch'](handleError(_0x10b3ac,null));};exports[_0x804b('0xc4')]=function(_0x476578,_0x5b809e,_0x141867){var _0x3ca299={'raw':![],'where':{}};var _0x2f0a00={};var _0xb9f39e={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x804b('0xc5')]({'where':{'id':_0x476578[_0x804b('0xbb')]['id']}})[_0x804b('0x29')](handleEntityNotFound(_0x5b809e,null))[_0x804b('0x29')](function(_0x534695){if(_0x534695){_0x2f0a00[_0x804b('0x3b')]=_['keys'](db['SmsMessage']['rawAttributes']);_0x2f0a00['query']=_[_0x804b('0xbc')](_0x476578['query']);_0x2f0a00['filters']=_['intersection'](_0x2f0a00[_0x804b('0x3b')],_0x2f0a00[_0x804b('0x3c')]);_0x3ca299['attributes']=_[_0x804b('0x3e')](_0x2f0a00[_0x804b('0x3b')],qs[_0x804b('0x40')](_0x476578['query'][_0x804b('0x40')]));_0x3ca299[_0x804b('0x3f')]=_0x3ca299[_0x804b('0x3f')][_0x804b('0x66')]?_0x3ca299[_0x804b('0x3f')]:_0x2f0a00['model'];if(!_0x476578['query']['hasOwnProperty'](_0x804b('0x42'))){_0x3ca299[_0x804b('0x22')]=qs[_0x804b('0x22')](_0x476578[_0x804b('0x3c')][_0x804b('0x22')]);_0x3ca299['offset']=qs[_0x804b('0x21')](_0x476578[_0x804b('0x3c')][_0x804b('0x21')]);}_0x3ca299[_0x804b('0x43')]=qs['sort'](_0x476578[_0x804b('0x3c')][_0x804b('0x44')]);_0x3ca299[_0x804b('0x45')]=qs['filters'](_['pick'](_0x476578[_0x804b('0x3c')],_0x2f0a00['filters']));_0x3ca299[_0x804b('0x45')][_0x804b('0xb7')]=_0x534695['id'];if(_0x476578[_0x804b('0x3c')][_0x804b('0x86')]){_0x3ca299['where']=_['merge'](_0x3ca299['where'],{'$or':_['map'](_0x3ca299[_0x804b('0x3f')],function(_0x14c5eb){var _0x406941={};_0x406941[_0x14c5eb]={'$like':'%'+_0x476578['query']['filter']+'%'};return _0x406941;})});}if(_0x476578[_0x804b('0x3c')][_0x804b('0x7d')]){var _0x2c3483=_0x476578[_0x804b('0x3c')][_0x804b('0x7d')][_0x804b('0x33')](',');var _0x204fd7={};_0x204fd7[_0x2c3483[0x0]]={'$gte':moment(_0x2c3483[0x1])['format'](_0x804b('0xc6'))};_0x3ca299['where']=_[_0x804b('0x9f')](_0x3ca299[_0x804b('0x45')],_0x204fd7);}_0x3ca299=_['merge']({},_0x3ca299,_0x476578['options']);return db[_0x804b('0xc1')]['count']({'where':_0x3ca299[_0x804b('0x45')]})[_0x804b('0x29')](function(_0x262807){_0xb9f39e[_0x804b('0x20')]=_0x262807;if(_0x476578[_0x804b('0x3c')]['includeAll']){_0x3ca299[_0x804b('0xc7')]=[{'all':!![]}];}return db['SmsMessage'][_0x804b('0xc8')](_0x3ca299);})['then'](function(_0x33c62f){_0xb9f39e['rows']=_0x33c62f;return _0xb9f39e;});}})[_0x804b('0x29')](respondWithFilteredResult(_0x5b809e,_0x3ca299))['catch'](handleError(_0x5b809e,null));};exports[_0x804b('0xc9')]=function(_0x3b93e2,_0x5cfb9d,_0x500d80){return db['SmsInteraction'][_0x804b('0x6a')]({'where':{'id':_0x3b93e2['params']['id']}})[_0x804b('0x29')](handleEntityNotFound(_0x5cfb9d,null))[_0x804b('0x29')](function(_0x372baf){if(_0x372baf){return _0x372baf[_0x804b('0xca')](_0x3b93e2[_0x804b('0x75')][_0x804b('0xc2')],_[_0x804b('0xc3')](_0x3b93e2[_0x804b('0x75')],[_0x804b('0xc2'),'id'])||{})[_0x804b('0xcb')](function(){return db[_0x804b('0xcc')][_0x804b('0xc8')]({'attributes':['id','name',_0x804b('0x49')],'where':{'id':_0x3b93e2[_0x804b('0x75')][_0x804b('0xc2')]}});})['then'](function(_0x4c10d7){socket[_0x804b('0xcd')](_0x804b('0xce'),{'id':Number(_0x3b93e2[_0x804b('0xbb')]['id']),'tags':_0x4c10d7||[]});return{'id':Number(_0x3b93e2[_0x804b('0xbb')]['id']),'tags':_0x4c10d7||[]};});}})[_0x804b('0x29')](respondWithResult(_0x5cfb9d,null))[_0x804b('0x36')](handleError(_0x5cfb9d,null));};exports['removeTags']=function(_0x3dcd10,_0x381de7,_0x25c76e){return db[_0x804b('0x38')][_0x804b('0x6a')]({'where':{'id':_0x3dcd10[_0x804b('0xbb')]['id']}})['then'](handleEntityNotFound(_0x381de7,null))[_0x804b('0x29')](function(_0xa5ad15){if(_0xa5ad15){return _0xa5ad15[_0x804b('0xcf')](_0x3dcd10[_0x804b('0x3c')][_0x804b('0xc2')]);}})[_0x804b('0x29')](respondWithStatusCode(_0x381de7,null))['catch'](handleError(_0x381de7,null));};exports[_0x804b('0xd0')]=function(_0x42ce08,_0x43affb){var _0x42abd7=moment()[_0x804b('0xd1')]()['toString']();var _0x3b02a3=path[_0x804b('0xd2')](config[_0x804b('0xd3')],_0x804b('0xd4'),'files','tmp');var _0x548ba7=path[_0x804b('0xd2')](config[_0x804b('0xd3')],_0x804b('0xd4'),_0x804b('0xd5'),_0x804b('0xd6'));var _0x2a1a49=path['join'](_0x3b02a3,_0x42abd7);var _0x311271=util[_0x804b('0xd7')](_0x804b('0xd8'),_0x42ce08[_0x804b('0xbb')]['id'],_0x42abd7);var _0x1ac71d=path['join'](_0x3b02a3,_0x311271);var _0x47b3ee=[];_0x47b3ee['push']({'model':db[_0x804b('0x70')],'as':_0x804b('0x70'),'attributes':['id',_0x804b('0x30')],'raw':!![]});_0x47b3ee[_0x804b('0x35')]({'model':db['CmContact'],'as':_0x804b('0x64'),'attributes':['id',_0x804b('0xd9'),'lastName'],'raw':!![]});var _0xcb9834=[{'model':db['SmsMessage'],'as':_0x804b('0xda'),'attributes':['id',_0x804b('0x75'),_0x804b('0x7b'),_0x804b('0xdb'),_0x804b('0xdc'),_0x804b('0x81')],'include':_0x47b3ee}];_0xcb9834[_0x804b('0x35')]({'model':db[_0x804b('0xdd')],'as':_0x804b('0xde'),'attributes':['id',_0x804b('0x2c')]});_0xcb9834[_0x804b('0x35')]({'model':db[_0x804b('0x70')],'as':_0x804b('0xdf'),'attributes':['id',_0x804b('0x30')]});return db[_0x804b('0x38')][_0x804b('0x6a')]({'where':{'id':_0x42ce08[_0x804b('0xbb')]['id']},'include':_0xcb9834})['then'](handleEntityNotFound(_0x43affb,null))[_0x804b('0x29')](function(_0x49e099){if(_0x49e099){var _0x1d431a=_0x49e099[_0x804b('0xe0')]({'plain':!![]});fs[_0x804b('0xe1')](_0x2a1a49);var _0x398a83={'format':'A4','border':_0x804b('0xe2'),'header':{'height':_0x804b('0xe3'),'contents':{'first':_0x804b('0xe4')}},'footer':{'height':'30px','contents':{'default':util[_0x804b('0xd7')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util[_0x804b('0xd7')](_0x804b('0xe5'),_0x804b('0xe6'),_0x1d431a['id']),moment()['format'](_0x804b('0xe7'))['toString']())}}};var _0x448fcc={'channel':_0x804b('0xe6'),'account':_0x1d431a[_0x804b('0xde')][_0x804b('0x2c')],'agent':_0x1d431a[_0x804b('0xdf')]?_0x1d431a[_0x804b('0xdf')][_0x804b('0x30')]:_0x804b('0xe8'),'createdAt':moment(_0x1d431a[_0x804b('0x7b')])[_0x804b('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x804b('0x9c')](),'closedAt':_0x1d431a[_0x804b('0xe9')]?moment(_0x1d431a[_0x804b('0xea')])[_0x804b('0xd7')](_0x804b('0xc6'))['toString']():'','disposition':_0x1d431a[_0x804b('0xeb')],'messages':_(_0x1d431a[_0x804b('0xda')])['filter']({'secret':![]})[_0x804b('0x2f')](function(_0x4faee4){return{'date':moment(_0x4faee4[_0x804b('0x7b')])[_0x804b('0xd7')](_0x804b('0xc6'))['toString'](),'sender':_0x4faee4[_0x804b('0xdb')]==='out'?_0x4faee4[_0x804b('0x70')]?_0x4faee4[_0x804b('0x70')][_0x804b('0x30')]:_0x804b('0xec'):_0x4faee4[_0x804b('0x64')][_0x804b('0xd9')]+(_0x4faee4[_0x804b('0x64')]['lastName']?'\x20'+_0x4faee4[_0x804b('0x64')]['lastName']:''),'body':_0x4faee4[_0x804b('0x75')],'direction':_0x4faee4['direction']===_0x804b('0xed')?'A':'C','secret':_0x4faee4[_0x804b('0xdc')],'read':_0x4faee4[_0x804b('0x81')]};})[_0x804b('0x61')]()};return ejs[_0x804b('0xee')](path[_0x804b('0xd2')](config[_0x804b('0xd3')],_0x804b('0xd4'),'views',_0x804b('0xef')),{'interaction':_0x448fcc})[_0x804b('0x29')](function(_0x483133){return new BPromise(function(_0x3dfad8,_0x25034a){pdf[_0x804b('0xbe')](_0x483133,_0x398a83)['toFile'](path[_0x804b('0xd2')](_0x2a1a49,'transcript-'+_0x1d431a['id']+'-'+_0x42abd7+_0x804b('0xf0')),function(_0x5cc174,_0x37908a){if(_0x5cc174)return _0x25034a(_0x5cc174);_0x3dfad8(_0x37908a);});});})['then'](function(){return new BPromise(function(_0x49e56d,_0x479855){zipdir(_0x2a1a49,{'saveTo':_0x1ac71d},function(_0x1ce08a,_0x378032){if(_0x1ce08a)return _0x479855(_0x1ce08a);return _0x49e56d(_0x378032);});})[_0x804b('0x29')](function(){return new BPromise(function(_0xb08069,_0x5299d5){rimraf(_0x2a1a49,function(_0x50c479){if(_0x50c479)_0x5299d5(_0x50c479);return _0xb08069();});});})[_0x804b('0x29')](function(){return _0x43affb[_0x804b('0xd0')](_0x1ac71d,_0x311271,function(_0x22310b){if(_0x22310b){console['log'](_0x804b('0xf1'),_0x22310b);}else{fs[_0x804b('0xf2')](_0x1ac71d);}});});});}else{return _0x43affb[_0x804b('0x1d')](0xc8);}})[_0x804b('0x36')](handleError(_0x43affb,null));};
\ No newline at end of file
+var _0x3667=['end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','map','fullname','split','forEach','Tags','TagIds','catch','index','SmsInteraction','rawAttributes','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','where','select','field','color','from','tools_tags','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','compact','SmsAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','show','params','include','create','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','sort','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','spread','emit','download','unix','root','tmp','server','files','attachments','join','format','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Messages','direction','secret','Account','Owner','get','mkdirSync','10px','40px','30px','Sms','YYYY-MM-DD','closed','closedAt','disposition','System','Contact','out','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','status'];(function(_0x2a9197,_0x5225eb){var _0x588c8a=function(_0x4698ee){while(--_0x4698ee){_0x2a9197['push'](_0x2a9197['shift']());}};_0x588c8a(++_0x5225eb);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x7366('0x0'));var emlformat=require(_0x7366('0x1'));var rimraf=require(_0x7366('0x2'));var zipdir=require(_0x7366('0x3'));var jsonpatch=require(_0x7366('0x4'));var rp=require('request-promise');var moment=require(_0x7366('0x5'));var BPromise=require(_0x7366('0x6'));var Mustache=require('mustache');var util=require(_0x7366('0x7'));var path=require(_0x7366('0x8'));var sox=require(_0x7366('0x9'));var csv=require(_0x7366('0xa'));var ejs=require(_0x7366('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7366('0xc'));var crypto=require(_0x7366('0xd'));var jsforce=require(_0x7366('0xe'));var deskjs=require(_0x7366('0xf'));var toCsv=require(_0x7366('0xa'));var querystring=require(_0x7366('0x10'));var Papa=require(_0x7366('0x11'));var Redis=require(_0x7366('0x12'));var authService=require(_0x7366('0x13'));var qs=require(_0x7366('0x14'));var as=require(_0x7366('0x15'));var hardwareService=require(_0x7366('0x16'));var logger=require(_0x7366('0x17'))(_0x7366('0x18'));var utils=require(_0x7366('0x19'));var config=require(_0x7366('0x1a'));var db=require(_0x7366('0x1b'))['db'];config[_0x7366('0x1c')]=_[_0x7366('0x1d')](config[_0x7366('0x1c')],{'host':_0x7366('0x1e'),'port':0x18eb});var socket=require(_0x7366('0x1f'))(new Redis(config[_0x7366('0x1c')]));require(_0x7366('0x20'))[_0x7366('0x21')](socket);function respondWithStatusCode(_0x27500c,_0x22562f){_0x22562f=_0x22562f||0xcc;return function(_0xf4114){if(_0xf4114){return _0x27500c['sendStatus'](_0x22562f);}return _0x27500c[_0x7366('0x22')](_0x22562f)[_0x7366('0x23')]();};}function respondWithResult(_0x338719,_0x2c0422){_0x2c0422=_0x2c0422||0xc8;return function(_0xe2c87b){if(_0xe2c87b){return _0x338719[_0x7366('0x22')](_0x2c0422)[_0x7366('0x24')](_0xe2c87b);}};}function respondWithFilteredResult(_0x22d348,_0x83e5d5){return function(_0x41113f){if(_0x41113f){var _0x1a71f5=_0x41113f[_0x7366('0x25')],_0x49e50b=_0x83e5d5[_0x7366('0x26')],_0x208ac8=_0x83e5d5[_0x7366('0x26')]+_0x83e5d5['limit'],_0x4ffbc7;if(_0x208ac8>=_0x1a71f5){_0x208ac8=_0x1a71f5;_0x4ffbc7=0xc8;}else{_0x4ffbc7=0xce;}_0x22d348[_0x7366('0x22')](_0x4ffbc7);return _0x22d348[_0x7366('0x27')](_0x7366('0x28'),_0x49e50b+'-'+_0x208ac8+'/'+_0x1a71f5)['json'](_0x41113f);}return null;};}function patchUpdates(_0x16e038){return function(_0x1946c6){try{jsonpatch['apply'](_0x1946c6,_0x16e038,!![]);}catch(_0x3bfbca){return BPromise[_0x7366('0x29')](_0x3bfbca);}return _0x1946c6[_0x7366('0x2a')]();};}function saveUpdates(_0x1a12d2,_0x3c30a2){return function(_0x1d3139){if(_0x1d3139){return _0x1d3139[_0x7366('0x2b')](_0x1a12d2)[_0x7366('0x2c')](function(_0x2095a1){return _0x2095a1;});}return null;};}function removeEntity(_0x301220,_0x12aed6){return function(_0x1dc875){if(_0x1dc875){return _0x1dc875[_0x7366('0x2d')]()['then'](function(){_0x301220[_0x7366('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x379146,_0x4ab987){return function(_0x5e30fb){if(!_0x5e30fb){_0x379146[_0x7366('0x2e')](0x194);}return _0x5e30fb;};}function handleError(_0x4d4cb5,_0x254374){_0x254374=_0x254374||0x1f4;return function(_0x4ac138){logger[_0x7366('0x2f')](_0x4ac138[_0x7366('0x30')]);if(_0x4ac138['name']){delete _0x4ac138[_0x7366('0x31')];}_0x4d4cb5['status'](_0x254374)[_0x7366('0x32')](_0x4ac138);};}function getInteractionUsers(_0x2b61af,_0x4a4e67){return new BPromise(function(_0x3cef4a,_0x507baf){try{if(_0x4a4e67[_0x2b61af['id']]){_0x2b61af[_0x7366('0x33')]=_[_0x7366('0x34')](_0x4a4e67[_0x2b61af['id']],function(_0x39d6ea){return{'id':_0x39d6ea['id'],'fullname':_0x39d6ea[_0x7366('0x35')]};});}}catch(_0x2dda4b){_0x507baf(_0x2dda4b);}_0x3cef4a(_0x2b61af);});}function getInteractionTags(_0x5e075c,_0x166628){return new BPromise(function(_0x447807,_0x538d42){try{if(_0x5e075c['TagIds']){_0x5e075c['Tags']=[];_0x5e075c['TagIds'][_0x7366('0x36')](',')[_0x7366('0x37')](function(_0x163a29){_0x5e075c[_0x7366('0x38')]['push'](_0x166628[_0x163a29]);});}delete _0x5e075c[_0x7366('0x39')];}catch(_0x2abf10){_0x538d42(_0x2abf10);}_0x447807(_0x5e075c);});}function updateSmsInteraction(_0xdaffd3,_0x21547f,_0x5214bc){return new BPromise(function(_0x3ab373,_0x311dab){return getInteractionUsers(_0xdaffd3,_0x5214bc)['then'](function(_0x2befc7){return getInteractionTags(_0x2befc7,_0x21547f);})[_0x7366('0x2c')](function(_0x1de991){_0x3ab373(_0x1de991);})[_0x7366('0x3a')](function(_0x7779c7){_0x311dab(_0x7779c7);});});}exports[_0x7366('0x3b')]=function(_0x3a69fa,_0x26858b){var _0x437713={},_0x59dead={},_0x45db2a={'count':0x0,'rows':[]};var _0x83b879=_['map'](db[_0x7366('0x3c')][_0x7366('0x3d')],function(_0x3ca8e9){return{'name':_0x3ca8e9['fieldName'],'type':_0x3ca8e9[_0x7366('0x3e')]['key']};});_0x59dead[_0x7366('0x3f')]=_['map'](_0x83b879,'name');_0x59dead[_0x7366('0x40')]=_['keys'](_0x3a69fa[_0x7366('0x40')]);_0x59dead[_0x7366('0x41')]=_['intersection'](_0x59dead[_0x7366('0x3f')],_0x59dead['query']);_0x437713[_0x7366('0x42')]=_[_0x7366('0x43')](_0x59dead[_0x7366('0x3f')],qs[_0x7366('0x44')](_0x3a69fa['query'][_0x7366('0x44')]));_0x437713[_0x7366('0x42')]=_0x437713[_0x7366('0x42')]['length']?_0x437713[_0x7366('0x42')]:_0x59dead[_0x7366('0x3f')];if(!_0x3a69fa[_0x7366('0x40')][_0x7366('0x45')](_0x7366('0x46'))){_0x437713[_0x7366('0x47')]=qs[_0x7366('0x47')](_0x3a69fa['query']['limit']);_0x437713[_0x7366('0x26')]=qs[_0x7366('0x26')](_0x3a69fa['query'][_0x7366('0x26')]);}_0x437713[_0x7366('0x48')]=qs['sort'](_0x3a69fa[_0x7366('0x40')]['sort']);_0x437713[_0x7366('0x49')]=qs[_0x7366('0x41')](_['pick'](_0x3a69fa['query'],_0x59dead[_0x7366('0x41')]),_0x83b879);var _0xedc3c7=[];var _0x2ac2e6=squel[_0x7366('0x4a')]()['field']('id')[_0x7366('0x4b')](_0x7366('0x31'))[_0x7366('0x4b')](_0x7366('0x4c'))[_0x7366('0x4d')](_0x7366('0x4e'));var _0x37fcd6=squel['select']()[_0x7366('0x4b')](_0x7366('0x4f'))[_0x7366('0x4b')]('u.fullname')[_0x7366('0x4b')](_0x7366('0x50'))['from'](_0x7366('0x51'),'ui')[_0x7366('0x52')](_0x7366('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x1909d4=squel[_0x7366('0x4a')]()[_0x7366('0x4d')]('sms_interactions','i')[_0x7366('0x52')](_0x7366('0x54'),'c',_0x7366('0x55'))['left_join'](_0x7366('0x53'),'o',_0x7366('0x56'))[_0x7366('0x52')](_0x7366('0x57'),'a','a.id\x20=\x20i.SmsAccountId')[_0x7366('0x52')](_0x7366('0x58'),'me',_0x7366('0x59'))[_0x7366('0x52')](_0x7366('0x5a'),'it',_0x7366('0x5b'))[_0x7366('0x52')](_0x7366('0x4e'),'t',_0x7366('0x5c'));var _0x59f078=squel[_0x7366('0x5d')]();var _0x1b8dcd=[];var _0x5db903=squel[_0x7366('0x5d')]();var _0x33a804;if(_0x3a69fa['query'][_0x7366('0x5e')]){_0x33a804=as['parseSearch'](_0x3a69fa[_0x7366('0x40')][_0x7366('0x5e')]);var _0x1295ca=_0x33a804[_0x7366('0x5f')];for(var _0x588b31=0x0;_0x588b31<_0x33a804[_0x7366('0x60')][_0x7366('0x61')];_0x588b31++){var _0x390bd7=_0x33a804[_0x7366('0x60')][_0x588b31];var _0x1de0a7='i';var _0x2146dc=_[_0x7366('0x62')](_0x83b879,[_0x7366('0x31'),_0x390bd7[_0x7366('0x4b')]]);if(!_0x2146dc){switch(_0x390bd7[_0x7366('0x4b')]){case _0x7366('0x63'):if(_0x390bd7[_0x7366('0x64')]==0x1){_0x1909d4['having']('`'+_0x390bd7[_0x7366('0x4b')]+'`\x20=\x200');}else{_0x1909d4['having']('`'+_0x390bd7[_0x7366('0x4b')]+_0x7366('0x65'));}break;case'Contact':if(_0x390bd7[_0x7366('0x66')]===_0x7366('0x67')){if(_0x390bd7['value']['split']('\x20')[_0x7366('0x61')]>0x1){_0x59f078[_0x1295ca]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7366('0x68')](_0x390bd7[_0x7366('0x64')]),null);}else{var _0x4ca4f7='%'+_0x390bd7[_0x7366('0x64')]+'%';_0x59f078[_0x1295ca](_0x7366('0x69'),_0x4ca4f7,_0x4ca4f7,_0x4ca4f7);}}else{_0x2146dc=_[_0x7366('0x62')](_0x83b879,['name',_0x7366('0x6a')]);_0x390bd7[_0x7366('0x4b')]=_0x7366('0x6a');_0x523016=as[_0x7366('0x6b')](_0x1de0a7,_0x2146dc['type'],_0x390bd7);_0x59f078[_0x1295ca](_0x523016[_0x7366('0x6c')],_0x523016[_0x7366('0x64')][_0x7366('0x6d')],_0x523016[_0x7366('0x64')][_0x7366('0x23')]);}break;case'Tag':var _0x1249a7=_0x390bd7[_0x7366('0x64')][_0x7366('0x36')](',')[_0x7366('0x34')](function(_0x54c117){return Number(_0x54c117);});_0x1249a7[_0x7366('0x37')](function(_0x5cbefc){_0x5db903['or'](_0x7366('0x6e'),'%,'+_0x5cbefc+',%');});_0x1b8dcd=_[_0x7366('0x6f')](_0x1b8dcd,_0x1249a7);break;case'User':if(_0x390bd7[_0x7366('0x66')]===_0x7366('0x67')){_0x59f078[_0x1295ca](_0x7366('0x70'),'%'+_0x390bd7[_0x7366('0x64')]+'%',null);}else{_0x2146dc=_['find'](_0x83b879,['name',_0x7366('0x71')]);_0x390bd7['field']=_0x7366('0x71');_0x523016=as[_0x7366('0x6b')](_0x1de0a7,_0x2146dc[_0x7366('0x3e')],_0x390bd7);_0x59f078[_0x1295ca](_0x523016[_0x7366('0x6c')],_0x523016[_0x7366('0x64')][_0x7366('0x6d')],_0x523016[_0x7366('0x64')][_0x7366('0x23')]);}break;case _0x7366('0x72'):_0x523016=as['buildExpression']('me',null,_0x390bd7);_0x59f078[_0x1295ca](_0x523016[_0x7366('0x6c')],_0x523016['value']['start'],_0x523016['value'][_0x7366('0x23')]);break;}}else{var _0x523016=as[_0x7366('0x6b')](_0x1de0a7,_0x2146dc['type'],_0x390bd7);_0x59f078[_0x1295ca](_0x523016[_0x7366('0x6c')],_0x523016['value'][_0x7366('0x6d')],_0x523016[_0x7366('0x64')]['end']);}}}else{var _0x4793c6=_(_0x3a69fa[_0x7366('0x40')])[_0x7366('0x73')]()[_0x7366('0x34')](function(_0x37a599){return _['some'](_0x83b879,[_0x7366('0x31'),_0x37a599])?_0x37a599:undefined;})[_0x7366('0x74')]()[_0x7366('0x64')]();if(!_['isEmpty'](_0x4793c6)){_0x4793c6['forEach'](function(_0x26ab9b){if(_0x26ab9b===_0x7366('0x75')){_0x1909d4[_0x7366('0x49')]('i.SmsAccountId\x20IN\x20?',[][_0x7366('0x76')](_0x3a69fa[_0x7366('0x40')][_0x26ab9b]));}else if(_0x26ab9b===_0x7366('0x77')){var _0x236180=JSON[_0x7366('0x78')](_0x3a69fa[_0x7366('0x40')][_0x26ab9b])[_0x7366('0x79')];var _0x38c65b=JSON[_0x7366('0x78')](_0x3a69fa[_0x7366('0x40')][_0x26ab9b])[_0x7366('0x7a')];_0x1909d4['where'](_0x7366('0x7b'),_0x236180,_0x38c65b);}else{if(_0x3a69fa[_0x7366('0x40')][_0x26ab9b]==='null'){_0x1909d4[_0x7366('0x49')]('i.'+_0x26ab9b+'\x20IS\x20NULL');}else{_0x1909d4['where']('i.'+_0x26ab9b+_0x7366('0x7c'),_0x3a69fa[_0x7366('0x40')][_0x26ab9b]);}}});}if(_0x3a69fa[_0x7366('0x40')][_0x7366('0x7d')]){if(_0x3a69fa[_0x7366('0x40')][_0x7366('0x7d')]==0x1){_0x1909d4['having'](_0x7366('0x7e'));}else{_0x1909d4[_0x7366('0x7f')](_0x7366('0x80'));}}if(_0x3a69fa['query'][_0x7366('0x81')]){_0x1b8dcd=_['isArray'](_0x3a69fa['query'][_0x7366('0x81')])?_0x3a69fa['query'][_0x7366('0x81')]:new Array(_0x3a69fa[_0x7366('0x40')][_0x7366('0x81')]);_0x1b8dcd[_0x7366('0x37')](function(_0x4b9045){_0x5db903['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4b9045+',%');});}if(_0x3a69fa[_0x7366('0x40')][_0x7366('0x82')]){var _0x1a2c88=_0x3a69fa[_0x7366('0x40')]['filter'][_0x7366('0x83')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x7366('0x84')](_0x1a2c88)){_0x59f078['or'](_0x7366('0x85'),_0x1a2c88+'%')['or']('i.phone\x20LIKE\x20?',_0x1a2c88+'%');}else{_0x59f078['or'](_0x7366('0x86'),qs[_0x7366('0x68')](_0x1a2c88))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1a2c88+'%');}}}_0x1909d4[_0x7366('0x49')](_0x59f078);_0x1909d4[_0x7366('0x87')](_0x7366('0x88'));var _0x3cad9e={'type':db[_0x7366('0x89')][_0x7366('0x8a')][_0x7366('0x8b')],'raw':!![]};var _0x16b3a=_0x1909d4[_0x7366('0x8c')]();_0x16b3a[_0x7366('0x4b')]('i.id');_0x16b3a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7366('0x63'));if(_0x437713[_0x7366('0x48')]){_0x437713[_0x7366('0x48')]['forEach'](function(_0x2754ae){_0x1909d4[_0x7366('0x48')]('i.'+_0x2754ae[0x0],_0x2754ae[0x1]===_0x7366('0x8d')?![]:!![]);});}if(!_[_0x7366('0x8e')](_0x1b8dcd)){_0x1909d4[_0x7366('0x7f')](_0x5db903);_0x16b3a['where'](_0x7366('0x8f'),_0x1b8dcd);}BPromise[_0x7366('0x90')]()['then'](function(){if(!_0x33a804){if(_0x3a69fa[_0x7366('0x40')][_0x7366('0x75')]||_0x3a69fa[_0x7366('0x40')][_0x7366('0x91')])return;_0x16b3a[_0x7366('0x49')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x1909d4['where'](_0x7366('0x92'));return;}return _0x3a69fa[_0x7366('0x93')][_0x7366('0x94')]({'attributes':['id'],'raw':!![]})[_0x7366('0x2c')](function(_0x3bc663){if(_[_0x7366('0x8e')](_0x3bc663)){_0x16b3a[_0x7366('0x49')](_0x7366('0x95'));_0x1909d4[_0x7366('0x49')](_0x7366('0x95'));}else{_0x16b3a[_0x7366('0x49')](_0x7366('0x96'),_[_0x7366('0x34')](_0x3bc663,'id'));_0x1909d4[_0x7366('0x49')]('i.SmsAccountId\x20IN\x20?',_[_0x7366('0x34')](_0x3bc663,'id'));}});})['then'](function(){db[_0x7366('0x97')]['query'](_0x16b3a[_0x7366('0x98')](),_0x3cad9e)['then'](function(_0x313478){_0x45db2a[_0x7366('0x25')]=_0x313478['length'];if(_0x45db2a[_0x7366('0x25')]===0x0)return[];return db[_0x7366('0x97')]['query'](_0x2ac2e6['toString'](),_0x3cad9e)[_0x7366('0x2c')](function(_0x1821e1){_0xedc3c7=_['keyBy'](_0x1821e1,'id');_0x3cad9e=_[_0x7366('0x99')](_0x3cad9e,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a69fa[_0x7366('0x40')]['fields']){_0x437713['attributes'][_0x7366('0x37')](function(_0x40a7a3){_0x1909d4[_0x7366('0x4b')]('i.'+_0x40a7a3);});}else{_0x1909d4['field'](_0x7366('0x9a'),_0x7366('0x63'));_0x1909d4[_0x7366('0x4b')]('a.key',_0x7366('0x9b'));_0x1909d4[_0x7366('0x4b')](_0x7366('0x9c'),_0x7366('0x9d'));_0x1909d4[_0x7366('0x4b')](_0x7366('0x9e'));_0x1909d4['field'](_0x7366('0x9f'),_0x7366('0xa0'));_0x1909d4[_0x7366('0x4b')]('c.lastName',_0x7366('0xa1'));_0x1909d4['field'](_0x7366('0xa2'),_0x7366('0xa3'));_0x1909d4[_0x7366('0x4b')](_0x7366('0xa4'),_0x7366('0xa5'));_0x1909d4[_0x7366('0x4b')](_0x7366('0xa6'),_0x7366('0xa7'));_0x1909d4[_0x7366('0x4b')](_0x7366('0xa8'),_0x7366('0xa9'));_0x1909d4[_0x7366('0x4b')](_0x7366('0xaa'),'Owner.fullname');_0x1909d4[_0x7366('0x4b')](_0x7366('0xab'),_0x7366('0xac'));_0x1909d4[_0x7366('0x4b')](_0x7366('0xad'),'TagIds');}if(_0x437713[_0x7366('0x47')])_0x1909d4[_0x7366('0x47')](_0x437713['limit']);if(_0x437713[_0x7366('0x26')])_0x1909d4[_0x7366('0x26')](_0x437713[_0x7366('0x26')]);return db['sequelize'][_0x7366('0x40')](_0x1909d4['toString'](),_0x3cad9e);})['then'](function(_0x5d3a75){_0x37fcd6[_0x7366('0x49')](_0x7366('0xae'),_[_0x7366('0x34')](_0x5d3a75,'id'));return db[_0x7366('0x97')][_0x7366('0x40')](_0x37fcd6[_0x7366('0x98')](),_0x3cad9e)['then'](function(_0x506c11){var _0x133be0=_[_0x7366('0xaf')](_0x506c11,_0x7366('0xb0'));var _0xe26771=[];_0x5d3a75['forEach'](function(_0x2c69bf){_0xe26771[_0x7366('0xb1')](updateSmsInteraction(_0x2c69bf,_0xedc3c7,_0x133be0));});return BPromise[_0x7366('0xb2')](_0xe26771);});});})[_0x7366('0x2c')](function(_0x12b3e2){_0x45db2a[_0x7366('0xb3')]=_0x12b3e2;return _0x45db2a;})['then'](respondWithFilteredResult(_0x26858b,_0x437713));})[_0x7366('0x3a')](handleError(_0x26858b,null));};exports[_0x7366('0xb4')]=function(_0x2e52a7,_0x33ae81){var _0x108dba={'raw':![],'where':{'id':_0x2e52a7[_0x7366('0xb5')]['id']}},_0x123d0a={};_0x123d0a['model']=_[_0x7366('0x73')](db[_0x7366('0x3c')]['rawAttributes']);_0x123d0a[_0x7366('0x40')]=_[_0x7366('0x73')](_0x2e52a7[_0x7366('0x40')]);_0x123d0a[_0x7366('0x41')]=_[_0x7366('0x43')](_0x123d0a['model'],_0x123d0a['query']);_0x108dba['attributes']=_[_0x7366('0x43')](_0x123d0a[_0x7366('0x3f')],qs[_0x7366('0x44')](_0x2e52a7[_0x7366('0x40')][_0x7366('0x44')]));_0x108dba[_0x7366('0x42')]=_0x108dba[_0x7366('0x42')][_0x7366('0x61')]?_0x108dba['attributes']:_0x123d0a[_0x7366('0x3f')];if(_0x2e52a7[_0x7366('0x40')]['includeAll']){_0x108dba[_0x7366('0xb6')]=[{'all':!![]}];}_0x108dba=_['merge']({},_0x108dba,_0x2e52a7['options']);return db['SmsInteraction'][_0x7366('0x62')](_0x108dba)[_0x7366('0x2c')](handleEntityNotFound(_0x33ae81,null))[_0x7366('0x2c')](respondWithResult(_0x33ae81,null))[_0x7366('0x3a')](handleError(_0x33ae81,null));};exports[_0x7366('0xb7')]=function(_0x29640b,_0x313ea8){return db[_0x7366('0x3c')][_0x7366('0xb7')](_0x29640b[_0x7366('0x72')],{})['then'](respondWithResult(_0x313ea8,0xc9))[_0x7366('0x3a')](handleError(_0x313ea8,null));};exports[_0x7366('0x2b')]=function(_0x5e0556,_0x57df7b){if(_0x5e0556[_0x7366('0x72')]['id']){delete _0x5e0556[_0x7366('0x72')]['id'];}return db[_0x7366('0x3c')][_0x7366('0x62')]({'where':{'id':_0x5e0556[_0x7366('0xb5')]['id']}})['then'](handleEntityNotFound(_0x57df7b,null))[_0x7366('0x2c')](saveUpdates(_0x5e0556[_0x7366('0x72')],null))[_0x7366('0x2c')](respondWithResult(_0x57df7b,null))[_0x7366('0x3a')](handleError(_0x57df7b,null));};exports[_0x7366('0x2d')]=function(_0x57a6b7,_0x18c2bf){return db[_0x7366('0x3c')][_0x7366('0x62')]({'where':{'id':_0x57a6b7[_0x7366('0xb5')]['id']}})[_0x7366('0x2c')](handleEntityNotFound(_0x18c2bf,null))[_0x7366('0x2c')](removeEntity(_0x18c2bf,null))[_0x7366('0x3a')](handleError(_0x18c2bf,null));};exports[_0x7366('0xb8')]=function(_0x5c1ec2,_0x544935){return db[_0x7366('0x3c')][_0x7366('0xb8')]()[_0x7366('0x2c')](respondWithResult(_0x544935,null))[_0x7366('0x3a')](handleError(_0x544935,null));};exports[_0x7366('0xb9')]=function(_0x36fdb0,_0x1844f8,_0x31138d){return db['SmsMessage'][_0x7366('0x62')]({'where':{'id':_0x36fdb0['params']['id']}})[_0x7366('0x2c')](handleEntityNotFound(_0x1844f8,null))[_0x7366('0x2c')](function(_0x172ee4){if(_0x172ee4){return _0x172ee4[_0x7366('0xb9')](_0x36fdb0[_0x7366('0x72')][_0x7366('0xba')],_[_0x7366('0xbb')](_0x36fdb0[_0x7366('0x72')],[_0x7366('0xba'),'id'])||{});}})[_0x7366('0x2c')](respondWithResult(_0x1844f8,null))[_0x7366('0x3a')](handleError(_0x1844f8,null));};exports[_0x7366('0xbc')]=function(_0x576751,_0x1acf3b,_0xd4246a){var _0x2ff830={'raw':![],'where':{}};var _0x145519={};var _0x3c36db={'count':0x0,'rows':[]};return db[_0x7366('0x3c')][_0x7366('0xbd')]({'where':{'id':_0x576751[_0x7366('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1acf3b,null))[_0x7366('0x2c')](function(_0x2e0ccb){if(_0x2e0ccb){_0x145519[_0x7366('0x3f')]=_[_0x7366('0x73')](db[_0x7366('0xbe')][_0x7366('0x3d')]);_0x145519[_0x7366('0x40')]=_[_0x7366('0x73')](_0x576751[_0x7366('0x40')]);_0x145519[_0x7366('0x41')]=_[_0x7366('0x43')](_0x145519[_0x7366('0x3f')],_0x145519[_0x7366('0x40')]);_0x2ff830['attributes']=_[_0x7366('0x43')](_0x145519[_0x7366('0x3f')],qs['fields'](_0x576751['query']['fields']));_0x2ff830['attributes']=_0x2ff830[_0x7366('0x42')]['length']?_0x2ff830[_0x7366('0x42')]:_0x145519[_0x7366('0x3f')];if(!_0x576751['query'][_0x7366('0x45')](_0x7366('0x46'))){_0x2ff830[_0x7366('0x47')]=qs['limit'](_0x576751[_0x7366('0x40')][_0x7366('0x47')]);_0x2ff830['offset']=qs[_0x7366('0x26')](_0x576751[_0x7366('0x40')][_0x7366('0x26')]);}_0x2ff830[_0x7366('0x48')]=qs[_0x7366('0xbf')](_0x576751[_0x7366('0x40')]['sort']);_0x2ff830[_0x7366('0x49')]=qs[_0x7366('0x41')](_['pick'](_0x576751[_0x7366('0x40')],_0x145519[_0x7366('0x41')]));_0x2ff830[_0x7366('0x49')]['SmsInteractionId']=_0x2e0ccb['id'];if(_0x576751[_0x7366('0x40')][_0x7366('0x82')]){_0x2ff830['where']=_[_0x7366('0x99')](_0x2ff830[_0x7366('0x49')],{'$or':_[_0x7366('0x34')](_0x2ff830[_0x7366('0x42')],function(_0x54d697){var _0x4aaba8={};_0x4aaba8[_0x54d697]={'$like':'%'+_0x576751[_0x7366('0x40')][_0x7366('0x82')]+'%'};return _0x4aaba8;})});}if(_0x576751['query']['$gte']){var _0x4f0e41=_0x576751[_0x7366('0x40')][_0x7366('0x79')]['split'](',');var _0x20930e={};_0x20930e[_0x4f0e41[0x0]]={'$gte':moment(_0x4f0e41[0x1])['format'](_0x7366('0xc0'))};_0x2ff830[_0x7366('0x49')]=_[_0x7366('0x99')](_0x2ff830['where'],_0x20930e);}_0x2ff830=_[_0x7366('0x99')]({},_0x2ff830,_0x576751[_0x7366('0xc1')]);return db[_0x7366('0xbe')]['count']({'where':_0x2ff830[_0x7366('0x49')]})[_0x7366('0x2c')](function(_0x20a10b){_0x3c36db[_0x7366('0x25')]=_0x20a10b;if(_0x576751[_0x7366('0x40')][_0x7366('0xc2')]){_0x2ff830[_0x7366('0xb6')]=[{'all':!![]}];}return db[_0x7366('0xbe')][_0x7366('0xc3')](_0x2ff830);})[_0x7366('0x2c')](function(_0x58a5b5){_0x3c36db[_0x7366('0xb3')]=_0x58a5b5;return _0x3c36db;});}})['then'](respondWithFilteredResult(_0x1acf3b,_0x2ff830))[_0x7366('0x3a')](handleError(_0x1acf3b,null));};exports[_0x7366('0xc4')]=function(_0x26ef04,_0x328b4a,_0x17b9e5){return db[_0x7366('0x3c')][_0x7366('0x62')]({'where':{'id':_0x26ef04['params']['id']}})[_0x7366('0x2c')](handleEntityNotFound(_0x328b4a,null))[_0x7366('0x2c')](function(_0x540c12){if(_0x540c12){return _0x540c12[_0x7366('0xc5')](_0x26ef04[_0x7366('0x72')][_0x7366('0xba')],_[_0x7366('0xbb')](_0x26ef04[_0x7366('0x72')],[_0x7366('0xba'),'id'])||{})[_0x7366('0xc6')](function(){return db['Tag'][_0x7366('0xc3')]({'attributes':['id',_0x7366('0x31'),'color'],'where':{'id':_0x26ef04[_0x7366('0x72')][_0x7366('0xba')]}});})[_0x7366('0x2c')](function(_0x49139e){socket[_0x7366('0xc7')]('smsInteractionTags:save',{'id':Number(_0x26ef04[_0x7366('0xb5')]['id']),'tags':_0x49139e||[]});return{'id':Number(_0x26ef04[_0x7366('0xb5')]['id']),'tags':_0x49139e||[]};});}})[_0x7366('0x2c')](respondWithResult(_0x328b4a,null))['catch'](handleError(_0x328b4a,null));};exports['removeTags']=function(_0x19414f,_0x432daf,_0x1d5a79){return db[_0x7366('0x3c')][_0x7366('0x62')]({'where':{'id':_0x19414f[_0x7366('0xb5')]['id']}})[_0x7366('0x2c')](handleEntityNotFound(_0x432daf,null))[_0x7366('0x2c')](function(_0x433172){if(_0x433172){return _0x433172['removeTags'](_0x19414f[_0x7366('0x40')][_0x7366('0xba')]);}})[_0x7366('0x2c')](respondWithStatusCode(_0x432daf,null))['catch'](handleError(_0x432daf,null));};exports[_0x7366('0xc8')]=function(_0x1f21e7,_0x652bd2){var _0x4c42fa=moment()[_0x7366('0xc9')]()['toString']();var _0x3a9cdd=path['join'](config[_0x7366('0xca')],'server','files',_0x7366('0xcb'));var _0x368452=path['join'](config[_0x7366('0xca')],_0x7366('0xcc'),_0x7366('0xcd'),_0x7366('0xce'));var _0x3774be=path[_0x7366('0xcf')](_0x3a9cdd,_0x4c42fa);var _0x41d8ae=util[_0x7366('0xd0')](_0x7366('0xd1'),_0x1f21e7[_0x7366('0xb5')]['id'],_0x4c42fa);var _0xbeb315=path['join'](_0x3a9cdd,_0x41d8ae);var _0x3dd418=[];_0x3dd418['push']({'model':db[_0x7366('0xd2')],'as':_0x7366('0xd2'),'attributes':['id',_0x7366('0x35')],'raw':!![]});_0x3dd418[_0x7366('0xb1')]({'model':db[_0x7366('0xd3')],'as':'Contact','attributes':['id',_0x7366('0xd4'),_0x7366('0xd5')],'raw':!![]});var _0x237485=[{'model':db[_0x7366('0xbe')],'as':_0x7366('0xd6'),'attributes':['id',_0x7366('0x72'),_0x7366('0x77'),_0x7366('0xd7'),_0x7366('0xd8'),'read'],'include':_0x3dd418}];_0x237485['push']({'model':db['SmsAccount'],'as':_0x7366('0xd9'),'attributes':['id','name']});_0x237485['push']({'model':db[_0x7366('0xd2')],'as':_0x7366('0xda'),'attributes':['id',_0x7366('0x35')]});return db[_0x7366('0x3c')][_0x7366('0x62')]({'where':{'id':_0x1f21e7[_0x7366('0xb5')]['id']},'include':_0x237485})['then'](handleEntityNotFound(_0x652bd2,null))[_0x7366('0x2c')](function(_0x5ed9eb){if(_0x5ed9eb){var _0x4c6f72=_0x5ed9eb[_0x7366('0xdb')]({'plain':!![]});fs[_0x7366('0xdc')](_0x3774be);var _0x17571a={'format':'A4','border':_0x7366('0xdd'),'header':{'height':_0x7366('0xde'),'contents':{'first':'<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>'}},'footer':{'height':_0x7366('0xdf'),'contents':{'default':util[_0x7366('0xd0')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util[_0x7366('0xd0')]('%s\x20#%d',_0x7366('0xe0'),_0x4c6f72['id']),moment()[_0x7366('0xd0')](_0x7366('0xe1'))[_0x7366('0x98')]())}}};var _0x402781={'channel':_0x7366('0xe0'),'account':_0x4c6f72[_0x7366('0xd9')]['name'],'agent':_0x4c6f72[_0x7366('0xda')]?_0x4c6f72[_0x7366('0xda')]['fullname']:'N.A.','createdAt':moment(_0x4c6f72[_0x7366('0x77')])[_0x7366('0xd0')](_0x7366('0xc0'))[_0x7366('0x98')](),'closedAt':_0x4c6f72[_0x7366('0xe2')]?moment(_0x4c6f72[_0x7366('0xe3')])['format'](_0x7366('0xc0'))[_0x7366('0x98')]():'','disposition':_0x4c6f72[_0x7366('0xe4')],'messages':_(_0x4c6f72[_0x7366('0xd6')])['filter']({'secret':![]})[_0x7366('0x34')](function(_0x33d651){return{'date':moment(_0x33d651[_0x7366('0x77')])[_0x7366('0xd0')](_0x7366('0xc0'))[_0x7366('0x98')](),'sender':_0x33d651[_0x7366('0xd7')]==='out'?_0x33d651[_0x7366('0xd2')]?_0x33d651['User']['fullname']:_0x7366('0xe5'):_0x33d651['Contact'][_0x7366('0xd4')]+(_0x33d651[_0x7366('0xe6')]['lastName']?'\x20'+_0x33d651[_0x7366('0xe6')][_0x7366('0xd5')]:''),'body':_0x33d651[_0x7366('0x72')],'direction':_0x33d651[_0x7366('0xd7')]===_0x7366('0xe7')?'A':'C','secret':_0x33d651['secret'],'read':_0x33d651['read']};})[_0x7366('0x64')]()};return ejs[_0x7366('0xe8')](path['join'](config['root'],_0x7366('0xcc'),_0x7366('0xe9'),_0x7366('0xea')),{'interaction':_0x402781})[_0x7366('0x2c')](function(_0x286bb4){return new BPromise(function(_0x5c264f,_0x2e9f64){pdf['create'](_0x286bb4,_0x17571a)[_0x7366('0xeb')](path[_0x7366('0xcf')](_0x3774be,_0x7366('0xec')+_0x4c6f72['id']+'-'+_0x4c42fa+'.pdf'),function(_0x28096d,_0x1d8808){if(_0x28096d)return _0x2e9f64(_0x28096d);_0x5c264f(_0x1d8808);});});})[_0x7366('0x2c')](function(){return new BPromise(function(_0x5660cf,_0x42e7ad){zipdir(_0x3774be,{'saveTo':_0xbeb315},function(_0x37c6b2,_0x56e058){if(_0x37c6b2)return _0x42e7ad(_0x37c6b2);return _0x5660cf(_0x56e058);});})[_0x7366('0x2c')](function(){return new BPromise(function(_0x581897,_0x3de2a6){rimraf(_0x3774be,function(_0x5073d9){if(_0x5073d9)_0x3de2a6(_0x5073d9);return _0x581897();});});})[_0x7366('0x2c')](function(){return _0x652bd2[_0x7366('0xc8')](_0xbeb315,_0x41d8ae,function(_0x35e024){if(_0x35e024){console[_0x7366('0xed')](_0x7366('0xee'),_0x35e024);}else{fs[_0x7366('0xef')](_0xbeb315);}});});});}else{return _0x652bd2[_0x7366('0x2e')](0xc8);}})[_0x7366('0x3a')](handleError(_0x652bd2,null));};
\ No newline at end of file
index 476fe84..fe15dc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab86=['SmsInteraction','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0xab86,0x13e));var _0x6ab8=function(_0x56a3b1,_0x1c59b5){_0x56a3b1=_0x56a3b1-0x0;var _0x3b8897=_0xab86[_0x56a3b1];return _0x3b8897;};'use strict';var EventEmitter=require(_0x6ab8('0x0'));var SmsInteraction=require(_0x6ab8('0x1'))['db'][_0x6ab8('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6ab8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ab8('0x4'),'afterDestroy':'remove'};function emitEvent(_0xf27ba7){return function(_0x40e2ad,_0x420a9f,_0x154d17){_0x40e2ad[_0x6ab8('0x5')]({'attributes':['id'],'raw':!![]})[_0x6ab8('0x6')](function(_0x2b6295){_0x40e2ad[_0x6ab8('0x7')](_0x6ab8('0x8'),_0x2b6295[_0x6ab8('0x9')](function(_0x2b429d){return{'id':_0x2b429d['id']};}));return SmsMessage[_0x6ab8('0xa')]({'where':{'SmsInteractionId':_0x40e2ad['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6ab8('0x6')](function(_0x5127eb){_0x40e2ad['setDataValue'](_0x6ab8('0xb'),_0x5127eb['length']);SmsInteractionEvents[_0x6ab8('0xc')](_0xf27ba7+':'+_0x40e2ad['id'],_0x40e2ad);SmsInteractionEvents[_0x6ab8('0xc')](_0xf27ba7,_0x40e2ad);_0x154d17(null);})[_0x6ab8('0xd')](_0x154d17(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x6ab8('0xe')](e,emitEvent(event));}}module[_0x6ab8('0xf')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x02a7=['then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02a7,0x7a));var _0x702a=function(_0x5421ff,_0x37bbd4){_0x5421ff=_0x5421ff-0x0;var _0x231337=_0x02a7[_0x5421ff];return _0x231337;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x702a('0x0'))['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0x702a('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x702a('0x2')](0x0);var events={'afterCreate':_0x702a('0x3'),'afterUpdate':_0x702a('0x4'),'afterDestroy':_0x702a('0x5')};function emitEvent(_0x1fc26b){return function(_0x3fb65a,_0x4a1d02,_0x1bcfe5){_0x3fb65a['getUsers']({'attributes':['id'],'raw':!![]})[_0x702a('0x6')](function(_0x1aa2c2){_0x3fb65a[_0x702a('0x7')](_0x702a('0x8'),_0x1aa2c2[_0x702a('0x9')](function(_0x20c009){return{'id':_0x20c009['id']};}));return SmsMessage[_0x702a('0xa')]({'where':{'SmsInteractionId':_0x3fb65a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x15acfb){_0x3fb65a['setDataValue']('unreadMessages',_0x15acfb[_0x702a('0xb')]);SmsInteractionEvents[_0x702a('0xc')](_0x1fc26b+':'+_0x3fb65a['id'],_0x3fb65a);SmsInteractionEvents[_0x702a('0xc')](_0x1fc26b,_0x3fb65a);_0x1bcfe5(null);})[_0x702a('0xd')](_0x1bcfe5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x702a('0xe')](e,emitEvent(event));}}module[_0x702a('0xf')]=SmsInteractionEvents;
\ No newline at end of file
index b69b021..7347baf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb34a=['exports','define','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x8c9741,_0x1362c8){var _0x580e3e=function(_0x31ee83){while(--_0x31ee83){_0x8c9741['push'](_0x8c9741['shift']());}};_0x580e3e(++_0x1362c8);}(_0xb34a,0xd3));var _0xab34=function(_0xbae3a3,_0xe9a07b){_0xbae3a3=_0xbae3a3-0x0;var _0x251e5a=_0xb34a[_0xbae3a3];return _0x251e5a;};'use strict';var _=require('lodash');var util=require(_0xab34('0x0'));var logger=require(_0xab34('0x1'))(_0xab34('0x2'));var moment=require(_0xab34('0x3'));var BPromise=require(_0xab34('0x4'));var rp=require(_0xab34('0x5'));var fs=require('fs');var path=require(_0xab34('0x6'));var rimraf=require(_0xab34('0x7'));var config=require(_0xab34('0x8'));var attributes=require(_0xab34('0x9'));module[_0xab34('0xa')]=function(_0x5f9815,_0x265827){return _0x5f9815[_0xab34('0xb')](_0xab34('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2aafbd,_0x2773b5,_0x4a0cac){if(_0x2aafbd[_0xab34('0xd')]('closed')){_0x2aafbd[_0xab34('0xe')]=moment()[_0xab34('0xf')](_0xab34('0x10'));}_0x4a0cac(null,_0x2aafbd);}}});};
\ No newline at end of file
+var _0xded4=['SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xded4,0x14a));var _0x4ded=function(_0x1301f1,_0x3312e6){_0x1301f1=_0x1301f1-0x0;var _0xa740e0=_0xded4[_0x1301f1];return _0xa740e0;};'use strict';var _=require(_0x4ded('0x0'));var util=require('util');var logger=require(_0x4ded('0x1'))(_0x4ded('0x2'));var moment=require(_0x4ded('0x3'));var BPromise=require(_0x4ded('0x4'));var rp=require(_0x4ded('0x5'));var fs=require('fs');var path=require(_0x4ded('0x6'));var rimraf=require(_0x4ded('0x7'));var config=require(_0x4ded('0x8'));var attributes=require(_0x4ded('0x9'));module[_0x4ded('0xa')]=function(_0x21dbd5,_0x36c543){return _0x21dbd5[_0x4ded('0xb')](_0x4ded('0xc'),attributes,{'tableName':_0x4ded('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x416343,_0xfe36fb,_0x5db14a){if(_0x416343[_0x4ded('0xe')]('closed')){_0x416343[_0x4ded('0xf')]=moment()[_0x4ded('0x10')](_0x4ded('0x11'));}_0x5db14a(null,_0x416343);}}});};
\ No newline at end of file
index 740042f..696adfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d09=['raw','limit','AddTagsToSmsInteraction','find','where','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./smsInteraction.socket','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options'];(function(_0x234514,_0x3f077d){var _0x16c5a2=function(_0xa0ef16){while(--_0xa0ef16){_0x234514['push'](_0x234514['shift']());}};_0x16c5a2(++_0x3f077d);}(_0x4d09,0x18f));var _0x94d0=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x4d09[_0x48b810];return _0x23c17d;};'use strict';var _=require(_0x94d0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x94d0('0x1'));var rs=require(_0x94d0('0x2'));var fs=require('fs');var Redis=require(_0x94d0('0x3'));var db=require(_0x94d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x94d0('0x5'))(_0x94d0('0x6'));var config=require('../../config/environment');var jayson=require(_0x94d0('0x7'));var client=jayson[_0x94d0('0x8')][_0x94d0('0x9')]({'port':0x232a});config[_0x94d0('0xa')]=_['defaults'](config[_0x94d0('0xa')],{'host':_0x94d0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x94d0('0xa')]));require(_0x94d0('0xc'))['register'](socket);function respondWithRpcPromise(_0x486695,_0x5813ef,_0x3e325e){return new BPromise(function(_0x5aab78,_0x969ca6){return client[_0x94d0('0xd')](_0x486695,_0x3e325e)[_0x94d0('0xe')](function(_0x50436b){logger['info'](_0x94d0('0xf'),_0x5813ef,_0x94d0('0x10'));logger[_0x94d0('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x5813ef,_0x94d0('0x10'),JSON[_0x94d0('0x12')](_0x50436b));if(_0x50436b['error']){if(_0x50436b[_0x94d0('0x13')][_0x94d0('0x14')]===0x1f4){logger[_0x94d0('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x5813ef,_0x50436b[_0x94d0('0x13')]['message']);return _0x969ca6(_0x50436b[_0x94d0('0x13')][_0x94d0('0x15')]);}logger[_0x94d0('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x5813ef,_0x50436b['error']['message']);return _0x5aab78(_0x50436b[_0x94d0('0x13')][_0x94d0('0x15')]);}else{logger[_0x94d0('0x16')](_0x94d0('0xf'),_0x5813ef,_0x94d0('0x10'));_0x5aab78(_0x50436b[_0x94d0('0x17')]['message']);}})[_0x94d0('0x18')](function(_0x38efb3){logger[_0x94d0('0x13')](_0x94d0('0xf'),_0x5813ef,_0x38efb3);_0x969ca6(_0x38efb3);});});}exports[_0x94d0('0x19')]=function(_0x51154c){var _0x2813d3=this;return new Promise(function(_0x522a8b,_0x58beda){return db[_0x94d0('0x1a')][_0x94d0('0x1b')](_0x51154c[_0x94d0('0x1c')],{'raw':_0x51154c[_0x94d0('0x1d')]?_0x51154c[_0x94d0('0x1d')][_0x94d0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51154c[_0x94d0('0x1d')]?_0x51154c[_0x94d0('0x1d')]['where']||null:null,'attributes':_0x51154c[_0x94d0('0x1d')]?_0x51154c[_0x94d0('0x1d')]['attributes']||null:null,'limit':_0x51154c['options']?_0x51154c[_0x94d0('0x1d')][_0x94d0('0x1f')]||null:null})['then'](function(_0x429ae9){logger[_0x94d0('0x16')](_0x94d0('0x19'),_0x51154c);logger['debug'](_0x94d0('0x19'),_0x51154c,JSON[_0x94d0('0x12')](_0x429ae9));_0x522a8b(_0x429ae9);})[_0x94d0('0x18')](function(_0x2e4cbd){logger[_0x94d0('0x13')]('UpdateSmsInteraction',_0x2e4cbd[_0x94d0('0x15')],_0x51154c);_0x58beda(_0x2813d3[_0x94d0('0x13')](0x1f4,_0x2e4cbd[_0x94d0('0x15')]));});});};exports[_0x94d0('0x20')]=function(_0x3d0a81){return new Promise(function(_0x529a2b,_0x3e024b){return db[_0x94d0('0x1a')][_0x94d0('0x21')]({'where':_0x3d0a81[_0x94d0('0x1d')]?_0x3d0a81[_0x94d0('0x1d')][_0x94d0('0x22')]||null:null})[_0x94d0('0xe')](function(_0x383791){if(_0x383791){return _0x383791['addTags'](_0x3d0a81['body'][_0x94d0('0x23')],_[_0x94d0('0x24')](_0x3d0a81[_0x94d0('0x1c')],[_0x94d0('0x23'),'id'])||{});}})[_0x94d0('0x25')](function(_0x2eb5a0){logger[_0x94d0('0x16')](_0x94d0('0x26'),_0x3d0a81);logger['debug']('AddTags',_0x3d0a81,JSON[_0x94d0('0x12')](_0x2eb5a0));_0x529a2b(_0x2eb5a0);})[_0x94d0('0x18')](function(_0x185ac4){logger[_0x94d0('0x13')](_0x94d0('0x26'),_0x185ac4['message'],_0x3d0a81);_0x3e024b(_this['error'](0x1f4,_0x185ac4[_0x94d0('0x15')]));});});};
\ No newline at end of file
+var _0x8b2d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./smsInteraction.socket','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','util','bluebird'];(function(_0x4991d6,_0x348deb){var _0x50faf7=function(_0x14c7f8){while(--_0x14c7f8){_0x4991d6['push'](_0x4991d6['shift']());}};_0x50faf7(++_0x348deb);}(_0x8b2d,0x1cc));var _0xd8b2=function(_0x5114aa,_0x4596b9){_0x5114aa=_0x5114aa-0x0;var _0x1841bc=_0x8b2d[_0x5114aa];return _0x1841bc;};'use strict';var _=require('lodash');var util=require(_0xd8b2('0x0'));var moment=require('moment');var BPromise=require(_0xd8b2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8b2('0x2'));var db=require(_0xd8b2('0x3'))['db'];var utils=require(_0xd8b2('0x4'));var logger=require(_0xd8b2('0x5'))(_0xd8b2('0x6'));var config=require(_0xd8b2('0x7'));var jayson=require(_0xd8b2('0x8'));var client=jayson[_0xd8b2('0x9')][_0xd8b2('0xa')]({'port':0x232a});config['redis']=_[_0xd8b2('0xb')](config[_0xd8b2('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8b2('0xc')]));require(_0xd8b2('0xd'))['register'](socket);function respondWithRpcPromise(_0x56cdd7,_0x20c917,_0x5de257){return new BPromise(function(_0x1702fa,_0x311042){return client[_0xd8b2('0xe')](_0x56cdd7,_0x5de257)[_0xd8b2('0xf')](function(_0x808e7a){logger[_0xd8b2('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x20c917,_0xd8b2('0x11'));logger[_0xd8b2('0x12')](_0xd8b2('0x13'),_0x20c917,_0xd8b2('0x11'),JSON[_0xd8b2('0x14')](_0x808e7a));if(_0x808e7a[_0xd8b2('0x15')]){if(_0x808e7a[_0xd8b2('0x15')][_0xd8b2('0x16')]===0x1f4){logger[_0xd8b2('0x15')](_0xd8b2('0x17'),_0x20c917,_0x808e7a[_0xd8b2('0x15')][_0xd8b2('0x18')]);return _0x311042(_0x808e7a['error'][_0xd8b2('0x18')]);}logger[_0xd8b2('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x20c917,_0x808e7a[_0xd8b2('0x15')][_0xd8b2('0x18')]);return _0x1702fa(_0x808e7a[_0xd8b2('0x15')][_0xd8b2('0x18')]);}else{logger['info'](_0xd8b2('0x17'),_0x20c917,_0xd8b2('0x11'));_0x1702fa(_0x808e7a[_0xd8b2('0x19')][_0xd8b2('0x18')]);}})[_0xd8b2('0x1a')](function(_0x3e9901){logger[_0xd8b2('0x15')](_0xd8b2('0x17'),_0x20c917,_0x3e9901);_0x311042(_0x3e9901);});});}exports[_0xd8b2('0x1b')]=function(_0x246ed6){var _0x2754fb=this;return new Promise(function(_0x4851bd,_0x585b4c){return db[_0xd8b2('0x1c')][_0xd8b2('0x1d')](_0x246ed6['body'],{'raw':_0x246ed6[_0xd8b2('0x1e')]?_0x246ed6[_0xd8b2('0x1e')][_0xd8b2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x246ed6[_0xd8b2('0x1e')]?_0x246ed6[_0xd8b2('0x1e')][_0xd8b2('0x20')]||null:null,'attributes':_0x246ed6['options']?_0x246ed6[_0xd8b2('0x1e')][_0xd8b2('0x21')]||null:null,'limit':_0x246ed6['options']?_0x246ed6[_0xd8b2('0x1e')]['limit']||null:null})[_0xd8b2('0xf')](function(_0x2a3d8f){logger[_0xd8b2('0x10')]('UpdateSmsInteraction',_0x246ed6);logger[_0xd8b2('0x12')](_0xd8b2('0x1b'),_0x246ed6,JSON[_0xd8b2('0x14')](_0x2a3d8f));_0x4851bd(_0x2a3d8f);})[_0xd8b2('0x1a')](function(_0x3d0474){logger['error']('UpdateSmsInteraction',_0x3d0474[_0xd8b2('0x18')],_0x246ed6);_0x585b4c(_0x2754fb['error'](0x1f4,_0x3d0474[_0xd8b2('0x18')]));});});};exports[_0xd8b2('0x22')]=function(_0x5bb382){return new Promise(function(_0x4a212c,_0x4e95f9){return db[_0xd8b2('0x1c')][_0xd8b2('0x23')]({'where':_0x5bb382[_0xd8b2('0x1e')]?_0x5bb382['options']['where']||null:null})[_0xd8b2('0xf')](function(_0x455c18){if(_0x455c18){return _0x455c18[_0xd8b2('0x24')](_0x5bb382[_0xd8b2('0x25')][_0xd8b2('0x26')],_[_0xd8b2('0x27')](_0x5bb382[_0xd8b2('0x25')],[_0xd8b2('0x26'),'id'])||{});}})[_0xd8b2('0x28')](function(_0x2112b3){logger[_0xd8b2('0x10')](_0xd8b2('0x29'),_0x5bb382);logger['debug'](_0xd8b2('0x29'),_0x5bb382,JSON[_0xd8b2('0x14')](_0x2112b3));_0x4a212c(_0x2112b3);})[_0xd8b2('0x1a')](function(_0x486215){logger['error'](_0xd8b2('0x29'),_0x486215[_0xd8b2('0x18')],_0x5bb382);_0x4e95f9(_this[_0xd8b2('0x15')](0x1f4,_0x486215['message']));});});};
\ No newline at end of file
index 6716d2b..a1d08ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['removeListener','register','length','smsInteraction:','save','remove','update'];(function(_0x1ddaa7,_0x3f903c){var _0x27931e=function(_0xf9db91){while(--_0xf9db91){_0x1ddaa7['push'](_0x1ddaa7['shift']());}};_0x27931e(++_0x3f903c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){SmsInteractionEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);SmsInteractionEvents['on'](_0x1d0a0d,_0x5f5030);}};
\ No newline at end of file
+var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x2a7eb2,_0x30192e){var _0x592201=function(_0xfbe6ef){while(--_0xfbe6ef){_0x2a7eb2['push'](_0x2a7eb2['shift']());}};_0x592201(++_0x30192e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}};
\ No newline at end of file
index c135c4a..9a72292 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb451=['destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete'];(function(_0x191be9,_0x46f788){var _0x5c6f3b=function(_0x1b225e){while(--_0x1b225e){_0x191be9['push'](_0x191be9['shift']());}};_0x5c6f3b(++_0x46f788);}(_0xb451,0x12b));var _0x1b45=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0xb451[_0x416cdc];return _0x1931ce;};'use strict';var multer=require(_0x1b45('0x0'));var util=require(_0x1b45('0x1'));var path=require('path');var timeout=require(_0x1b45('0x2'));var express=require(_0x1b45('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1b45('0x4'));var config=require(_0x1b45('0x5'));var controller=require(_0x1b45('0x6'));router[_0x1b45('0x7')]('/',auth[_0x1b45('0x8')](),controller['index']);router[_0x1b45('0x7')](_0x1b45('0x9'),auth[_0x1b45('0x8')](),controller[_0x1b45('0xa')]);router[_0x1b45('0x7')](_0x1b45('0xb'),auth[_0x1b45('0x8')](),controller[_0x1b45('0xc')]);router[_0x1b45('0xd')]('/',auth[_0x1b45('0x8')](),interaction[_0x1b45('0xe')](_0x1b45('0xf'),_0x1b45('0x10')),controller[_0x1b45('0x11')]);router['post']('/:id/status',controller['status']);router['put'](_0x1b45('0xb'),auth['isAuthenticated'](),controller[_0x1b45('0x12')]);router['put'](_0x1b45('0x13'),auth[_0x1b45('0x8')](),controller[_0x1b45('0x14')]);router[_0x1b45('0x15')](_0x1b45('0x16'),auth['isAuthenticated'](),controller[_0x1b45('0x17')]);router[_0x1b45('0x18')](_0x1b45('0xb'),auth[_0x1b45('0x8')](),controller[_0x1b45('0x19')]);module[_0x1b45('0x1a')]=router;
\ No newline at end of file
+var _0xf713=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','describe','/:id','post','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','/:id/reject','destroy','exports','multer','util'];(function(_0x294c30,_0x4fc9d9){var _0x4e20c9=function(_0x5e3727){while(--_0x5e3727){_0x294c30['push'](_0x294c30['shift']());}};_0x4e20c9(++_0x4fc9d9);}(_0xf713,0x1c9));var _0x3f71=function(_0x2067e3,_0x19bcb2){_0x2067e3=_0x2067e3-0x0;var _0x180c44=_0xf713[_0x2067e3];return _0x180c44;};'use strict';var multer=require(_0x3f71('0x0'));var util=require(_0x3f71('0x1'));var path=require(_0x3f71('0x2'));var timeout=require(_0x3f71('0x3'));var express=require(_0x3f71('0x4'));var router=express[_0x3f71('0x5')]();var auth=require(_0x3f71('0x6'));var interaction=require(_0x3f71('0x7'));var config=require(_0x3f71('0x8'));var controller=require(_0x3f71('0x9'));router['get']('/',auth[_0x3f71('0xa')](),controller[_0x3f71('0xb')]);router[_0x3f71('0xc')]('/describe',auth[_0x3f71('0xa')](),controller[_0x3f71('0xd')]);router[_0x3f71('0xc')](_0x3f71('0xe'),auth[_0x3f71('0xa')](),controller['show']);router[_0x3f71('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x3f71('0x10'),_0x3f71('0x11')),controller[_0x3f71('0x12')]);router[_0x3f71('0xf')](_0x3f71('0x13'),controller[_0x3f71('0x14')]);router[_0x3f71('0x15')](_0x3f71('0xe'),auth['isAuthenticated'](),controller[_0x3f71('0x16')]);router[_0x3f71('0x15')](_0x3f71('0x17'),auth['isAuthenticated'](),controller['accept']);router[_0x3f71('0x15')](_0x3f71('0x18'),auth[_0x3f71('0xa')](),controller['reject']);router['delete'](_0x3f71('0xe'),auth['isAuthenticated'](),controller[_0x3f71('0x19')]);module[_0x3f71('0x1a')]=router;
\ No newline at end of file
index f3e34c5..77032c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3645=['sequelize','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x4580af,_0x49257a){var _0x58a956=function(_0x596913){while(--_0x596913){_0x4580af['push'](_0x4580af['shift']());}};_0x58a956(++_0x49257a);}(_0x3645,0x157));var _0x5364=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0x3645[_0x2601b4];return _0x3e3661;};'use strict';var Sequelize=require(_0x5364('0x0'));module['exports']={'body':{'type':Sequelize[_0x5364('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5364('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5364('0x3')]('in',_0x5364('0x4')),'defaultValue':_0x5364('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x5364('0x5')]},'readAt':{'type':Sequelize[_0x5364('0x6')]},'secret':{'type':Sequelize[_0x5364('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3140=['exports','TEXT','medium','out','STRING','DATE','BOOLEAN','sequelize'];(function(_0x28a554,_0x29662f){var _0x4d8724=function(_0x8f5e7a){while(--_0x8f5e7a){_0x28a554['push'](_0x28a554['shift']());}};_0x4d8724(++_0x29662f);}(_0x3140,0xaf));var _0x0314=function(_0x4947e3,_0x21f2ee){_0x4947e3=_0x4947e3-0x0;var _0x1911e5=_0x3140[_0x4947e3];return _0x1911e5;};'use strict';var Sequelize=require(_0x0314('0x0'));module[_0x0314('0x1')]={'body':{'type':Sequelize[_0x0314('0x2')](_0x0314('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0314('0x4')),'defaultValue':_0x0314('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0314('0x5')](0xbe)},'phone':{'type':Sequelize[_0x0314('0x5')]},'readAt':{'type':Sequelize[_0x0314('0x6')]},'secret':{'type':Sequelize[_0x0314('0x7')],'defaultValue':![]}};
\ No newline at end of file
index 43894eb..0dc70e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6075=['create','body','find','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','channel','event','EventManager','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','indexOf','sent','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./smsMessage.socket','jayson/promise','http','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params'];(function(_0x4a0576,_0x494636){var _0x2bf159=function(_0x57f842){while(--_0x57f842){_0x4a0576['push'](_0x4a0576['shift']());}};_0x2bf159(++_0x494636);}(_0x6075,0x142));var _0x5607=function(_0xf094f1,_0x4aa960){_0xf094f1=_0xf094f1-0x0;var _0x85738d=_0x6075[_0xf094f1];return _0x85738d;};'use strict';var pdf=require(_0x5607('0x0'));var emlformat=require(_0x5607('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5607('0x2'));var jsonpatch=require(_0x5607('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5607('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5607('0x5'));var sox=require('sox');var csv=require(_0x5607('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5607('0x7'));var squel=require('squel');var crypto=require(_0x5607('0x8'));var jsforce=require(_0x5607('0x9'));var deskjs=require(_0x5607('0xa'));var toCsv=require(_0x5607('0x6'));var querystring=require(_0x5607('0xb'));var Papa=require(_0x5607('0xc'));var Redis=require(_0x5607('0xd'));var authService=require(_0x5607('0xe'));var qs=require(_0x5607('0xf'));var as=require(_0x5607('0x10'));var hardwareService=require(_0x5607('0x11'));var logger=require(_0x5607('0x12'))(_0x5607('0x13'));var utils=require('../../config/utils');var config=require(_0x5607('0x14'));var db=require(_0x5607('0x15'))['db'];config[_0x5607('0x16')]=_['defaults'](config[_0x5607('0x16')],{'host':_0x5607('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5607('0x16')]));require(_0x5607('0x18'))['register'](socket);var jayson=require(_0x5607('0x19'));var client=jayson['client'][_0x5607('0x1a')]({'port':0x232c});var client9002=jayson[_0x5607('0x1b')][_0x5607('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x381634,_0x5ba100,_0x17ede4){if(_0x17ede4){var _0x127f46=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x127f46[_0x5607('0x1c')](_0x5ba100)){return _0x381634;}else{throw new db[(_0x5607('0x1d'))][(_0x5607('0x1e'))](_0x5607('0x1f'));}}else{return _0x381634;}}function respondWithRpcPromise(_0x1ec815,_0xe089,_0xf3ca5e,_0x4295b5){return new BPromise(function(_0xb5d5d1,_0x19f817){var _0x5d2eb0=_0x4295b5||client;return _0x5d2eb0['request'](_0x1ec815,_0xf3ca5e)['then'](function(_0x5e8cce){logger[_0x5607('0x20')](_0x5607('0x21'),_0xe089,_0x5607('0x22'));logger[_0x5607('0x23')](_0x5607('0x24'),_0xe089,_0x5607('0x22'),JSON[_0x5607('0x25')](_0x5e8cce));if(_0x5e8cce[_0x5607('0x26')]){if(_0x5e8cce['error']['code']===0x1f4){logger[_0x5607('0x26')](_0x5607('0x21'),_0xe089,_0x5e8cce[_0x5607('0x26')]['message']);return _0x19f817(_0x5e8cce[_0x5607('0x26')][_0x5607('0x27')]);}logger[_0x5607('0x26')](_0x5607('0x21'),_0xe089,_0x5e8cce[_0x5607('0x26')][_0x5607('0x27')]);return _0xb5d5d1(_0x5e8cce['error']['message']);}else{logger[_0x5607('0x20')](_0x5607('0x21'),_0xe089,_0x5607('0x22'));_0xb5d5d1(_0x5e8cce['result']['message']);}})[_0x5607('0x28')](function(_0x55e623){logger[_0x5607('0x26')](_0x5607('0x21'),_0xe089,_0x55e623);_0x19f817(_0x55e623);});});}function respondWithStatusCode(_0x3d9120,_0xded87e){_0xded87e=_0xded87e||0xcc;return function(_0xbb9584){if(_0xbb9584){return _0x3d9120['sendStatus'](_0xded87e);}return _0x3d9120['status'](_0xded87e)[_0x5607('0x29')]();};}function respondWithResult(_0x261b36,_0x207b11){_0x207b11=_0x207b11||0xc8;return function(_0x464ffa){if(_0x464ffa){return _0x261b36[_0x5607('0x2a')](_0x207b11)[_0x5607('0x2b')](_0x464ffa);}};}function respondWithFilteredResult(_0xb29aff,_0x352724){return function(_0x4ebf35){if(_0x4ebf35){var _0x29d16e=_0x4ebf35[_0x5607('0x2c')],_0xc96c3a=_0x352724[_0x5607('0x2d')],_0x3bc280=_0x352724[_0x5607('0x2d')]+_0x352724[_0x5607('0x2e')],_0x145d75;if(_0x3bc280>=_0x29d16e){_0x3bc280=_0x29d16e;_0x145d75=0xc8;}else{_0x145d75=0xce;}_0xb29aff[_0x5607('0x2a')](_0x145d75);return _0xb29aff[_0x5607('0x2f')]('Content-Range',_0xc96c3a+'-'+_0x3bc280+'/'+_0x29d16e)[_0x5607('0x2b')](_0x4ebf35);}return null;};}function patchUpdates(_0x5f2f64){return function(_0x1449f8){try{jsonpatch[_0x5607('0x30')](_0x1449f8,_0x5f2f64,!![]);}catch(_0x22ab1b){return BPromise[_0x5607('0x31')](_0x22ab1b);}return _0x1449f8[_0x5607('0x32')]();};}function saveUpdates(_0x4db623,_0x1df55f){return function(_0x313c1f){if(_0x313c1f){return _0x313c1f[_0x5607('0x33')](_0x4db623)[_0x5607('0x34')](function(_0x304279){return _0x304279;});}return null;};}function removeEntity(_0x2029a8,_0x69b896){return function(_0x46851a){if(_0x46851a){return _0x46851a[_0x5607('0x35')]()['then'](function(){_0x2029a8[_0x5607('0x2a')](0xcc)[_0x5607('0x29')]();});}};}function handleEntityNotFound(_0x1c8049,_0x160995){return function(_0x593858){if(!_0x593858){_0x1c8049['sendStatus'](0x194);}return _0x593858;};}function handleError(_0xfbfe28,_0x32e02d){_0x32e02d=_0x32e02d||0x1f4;return function(_0x3be35b){logger[_0x5607('0x26')](_0x3be35b['stack']);if(_0x3be35b[_0x5607('0x36')]){delete _0x3be35b[_0x5607('0x36')];}_0xfbfe28[_0x5607('0x2a')](_0x32e02d)['send'](_0x3be35b);};}exports[_0x5607('0x37')]=function(_0x5e3792,_0x301b13){var _0x52b177={},_0x1e9f47={},_0x45c95a={'count':0x0,'rows':[]};var _0xf69d5b=_[_0x5607('0x38')](db[_0x5607('0x39')][_0x5607('0x3a')],function(_0x2a2176){return{'name':_0x2a2176[_0x5607('0x3b')],'type':_0x2a2176[_0x5607('0x3c')][_0x5607('0x3d')]};});_0x1e9f47[_0x5607('0x3e')]=_['map'](_0xf69d5b,_0x5607('0x36'));_0x1e9f47['query']=_[_0x5607('0x3f')](_0x5e3792[_0x5607('0x40')]);_0x1e9f47[_0x5607('0x41')]=_[_0x5607('0x42')](_0x1e9f47[_0x5607('0x3e')],_0x1e9f47[_0x5607('0x40')]);_0x52b177[_0x5607('0x43')]=_[_0x5607('0x42')](_0x1e9f47['model'],qs[_0x5607('0x44')](_0x5e3792['query']['fields']));_0x52b177['attributes']=_0x52b177[_0x5607('0x43')][_0x5607('0x45')]?_0x52b177['attributes']:_0x1e9f47[_0x5607('0x3e')];if(!_0x5e3792[_0x5607('0x40')][_0x5607('0x46')](_0x5607('0x47'))){_0x52b177[_0x5607('0x2e')]=qs[_0x5607('0x2e')](_0x5e3792[_0x5607('0x40')][_0x5607('0x2e')]);_0x52b177['offset']=qs[_0x5607('0x2d')](_0x5e3792['query'][_0x5607('0x2d')]);}_0x52b177[_0x5607('0x48')]=qs[_0x5607('0x49')](_0x5e3792[_0x5607('0x40')][_0x5607('0x49')]);_0x52b177[_0x5607('0x4a')]=qs[_0x5607('0x41')](_[_0x5607('0x4b')](_0x5e3792[_0x5607('0x40')],_0x1e9f47[_0x5607('0x41')]),_0xf69d5b);if(_0x5e3792[_0x5607('0x40')]['filter']){_0x52b177[_0x5607('0x4a')]=_[_0x5607('0x4c')](_0x52b177[_0x5607('0x4a')],{'$or':_[_0x5607('0x38')](_0xf69d5b,function(_0x5a01e2){if(_0x5a01e2[_0x5607('0x3c')]!==_0x5607('0x4d')){var _0x541905={};_0x541905[_0x5a01e2[_0x5607('0x36')]]={'$like':'%'+_0x5e3792[_0x5607('0x40')][_0x5607('0x4e')]+'%'};return _0x541905;}})});}_0x52b177=_['merge']({},_0x52b177,_0x5e3792[_0x5607('0x4f')]);var _0x25ae5d={'where':_0x52b177[_0x5607('0x4a')]};return db[_0x5607('0x39')][_0x5607('0x2c')](_0x25ae5d)['then'](function(_0x1d2b5c){_0x45c95a['count']=_0x1d2b5c;if(_0x5e3792[_0x5607('0x40')][_0x5607('0x50')]){_0x52b177[_0x5607('0x51')]=[{'all':!![]}];}return db['SmsMessage'][_0x5607('0x52')](_0x52b177);})[_0x5607('0x34')](function(_0x1d6145){_0x45c95a[_0x5607('0x53')]=_0x1d6145;return _0x45c95a;})[_0x5607('0x34')](respondWithFilteredResult(_0x301b13,_0x52b177))[_0x5607('0x28')](handleError(_0x301b13,null));};exports[_0x5607('0x54')]=function(_0xae251f,_0x32f31e){var _0x34417f={'raw':!![],'where':{'id':_0xae251f[_0x5607('0x55')]['id']}},_0x24860b={};_0x24860b[_0x5607('0x3e')]=_['keys'](db[_0x5607('0x39')]['rawAttributes']);_0x24860b[_0x5607('0x40')]=_['keys'](_0xae251f[_0x5607('0x40')]);_0x24860b[_0x5607('0x41')]=_[_0x5607('0x42')](_0x24860b[_0x5607('0x3e')],_0x24860b[_0x5607('0x40')]);_0x34417f[_0x5607('0x43')]=_[_0x5607('0x42')](_0x24860b[_0x5607('0x3e')],qs[_0x5607('0x44')](_0xae251f[_0x5607('0x40')][_0x5607('0x44')]));_0x34417f[_0x5607('0x43')]=_0x34417f[_0x5607('0x43')][_0x5607('0x45')]?_0x34417f[_0x5607('0x43')]:_0x24860b[_0x5607('0x3e')];if(_0xae251f['query']['includeAll']){_0x34417f[_0x5607('0x51')]=[{'all':!![]}];}_0x34417f=_['merge']({},_0x34417f,_0xae251f[_0x5607('0x4f')]);return db[_0x5607('0x39')]['find'](_0x34417f)[_0x5607('0x34')](handleEntityNotFound(_0x32f31e,null))['then'](respondWithResult(_0x32f31e,null))[_0x5607('0x28')](handleError(_0x32f31e,null));};exports[_0x5607('0x56')]=function(_0x2eafaa,_0x59c29c){return db[_0x5607('0x39')][_0x5607('0x56')](_0x2eafaa['body'],{})[_0x5607('0x34')](respondWithResult(_0x59c29c,0xc9))['catch'](handleError(_0x59c29c,null));};exports['update']=function(_0x4b5180,_0x379f35){if(_0x4b5180[_0x5607('0x57')]['id']){delete _0x4b5180[_0x5607('0x57')]['id'];}return db[_0x5607('0x39')][_0x5607('0x58')]({'where':{'id':_0x4b5180['params']['id']}})[_0x5607('0x34')](handleEntityNotFound(_0x379f35,null))[_0x5607('0x34')](saveUpdates(_0x4b5180[_0x5607('0x57')],null))[_0x5607('0x34')](respondWithResult(_0x379f35,null))[_0x5607('0x28')](handleError(_0x379f35,null));};exports[_0x5607('0x35')]=function(_0x4a4303,_0x2c5b29){return db[_0x5607('0x39')][_0x5607('0x58')]({'where':{'id':_0x4a4303['params']['id']}})[_0x5607('0x34')](handleEntityNotFound(_0x2c5b29,null))[_0x5607('0x34')](removeEntity(_0x2c5b29,null))[_0x5607('0x28')](handleError(_0x2c5b29,null));};exports['describe']=function(_0x5cf5d9,_0x103149){return db[_0x5607('0x39')][_0x5607('0x59')]()[_0x5607('0x34')](respondWithResult(_0x103149,null))['catch'](handleError(_0x103149,null));};var interaction_log=require('../../config/logger')(_0x5607('0x5a'));exports['accept']=function(_0x13f134,_0x534b7a,_0xfa76f7){var _0x52d71a={'channel':_0x5607('0x5b')};if(_0x13f134[_0x5607('0x57')]['id']){delete _0x13f134[_0x5607('0x57')]['id'];}_0x13f134['body'][_0x5607('0x5c')]=!![];_0x13f134[_0x5607('0x57')][_0x5607('0x5d')]=moment()[_0x5607('0x5e')](_0x5607('0x5f'));_0x13f134['body'][_0x5607('0x60')]=_0x13f134[_0x5607('0x57')][_0x5607('0x60')]||_0x13f134[_0x5607('0x61')]['id'];return db['SmsMessage'][_0x5607('0x58')]({'where':{'id':_0x13f134[_0x5607('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x5607('0x62')],'as':_0x5607('0x63')}]})[_0x5607('0x34')](handleEntityNotFound(_0x534b7a,null))[_0x5607('0x34')](saveUpdates(_0x13f134[_0x5607('0x57')],null))[_0x5607('0x34')](function(_0x499747){if(_0x499747){_0x52d71a[_0x5607('0x27')]=_0x499747[_0x5607('0x64')]({'plain':!![]});return db[_0x5607('0x65')][_0x5607('0x58')]({'where':{'id':_0x499747[_0x5607('0x66')]}});}return null;})[_0x5607('0x34')](handleEntityNotFound(_0x534b7a,null))[_0x5607('0x34')](function(_0x44d294){if(_0x44d294){return _0x44d294[_0x5607('0x33')]({'UserId':_0x13f134[_0x5607('0x57')][_0x5607('0x60')],'read1stAt':_[_0x5607('0x67')](_0x44d294['read1stAt'])?moment()[_0x5607('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5607('0x34')](function(_0x1fcd10){if(_0x1fcd10){_0x52d71a[_0x5607('0x68')]=_0x1fcd10[_0x5607('0x64')]({'plain':!![]});interaction_log['info'](_0x5607('0x69'),_0x13f134['user']['id'],_0x13f134[_0x5607('0x61')]['name'],_0x13f134[_0x5607('0x61')][_0x5607('0x6a')],_0x52d71a[_0x5607('0x68')]['id'],_0x13f134['body']?JSON[_0x5607('0x25')](_0x13f134['body']):_0x5607('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x5607('0x6c'),_0x52d71a);}return null;})[_0x5607('0x34')](function(_0x30964d){if(_0x30964d){if(_0x13f134['body']['manual']){_0x52d71a[_0x5607('0x27')]['interface']=util[_0x5607('0x5e')]('SIP/%s',_0x13f134[_0x5607('0x61')][_0x5607('0x36')]);_0x52d71a[_0x5607('0x27')][_0x5607('0x6d')]=_0x52d71a[_0x5607('0x6d')];_0x52d71a[_0x5607('0x27')][_0x5607('0x6e')]='accept';return respondWithRpcPromise(_0x5607('0x6f'),_0x5607('0x6f'),{'event':'acceptmessage','message':_0x52d71a[_0x5607('0x27')]},client9002)[_0x5607('0x34')](function(){return _0x52d71a;});}return _0x52d71a;}return null;})['then'](respondWithResult(_0x534b7a,null))[_0x5607('0x28')](handleError(_0x534b7a,null));};var interaction_log=require(_0x5607('0x12'))(_0x5607('0x5a'));exports['reject']=function(_0x2c13a3,_0x57fead,_0x3c690d){var _0x4462f3={'agent':{},'channel':_0x5607('0x5b')};if(_0x2c13a3['body']['id']){delete _0x2c13a3[_0x5607('0x57')]['id'];}_0x2c13a3['body'][_0x5607('0x60')]=_0x2c13a3[_0x5607('0x57')][_0x5607('0x60')]||_0x2c13a3[_0x5607('0x61')]['id'];_0x4462f3[_0x5607('0x70')]['id']=_0x2c13a3[_0x5607('0x57')][_0x5607('0x60')];return db[_0x5607('0x39')]['find']({'where':{'id':_0x2c13a3[_0x5607('0x55')]['id'],'UserId':null}})[_0x5607('0x34')](handleEntityNotFound(_0x57fead,null))[_0x5607('0x34')](function(_0xd61bd5){if(_0xd61bd5){_0x4462f3[_0x5607('0x27')]=_0xd61bd5[_0x5607('0x64')]({'plain':!![]});return db[_0x5607('0x65')][_0x5607('0x58')]({'where':{'id':_0xd61bd5[_0x5607('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x57fead,null))[_0x5607('0x34')](function(_0x5f4547){if(_0x5f4547){_0x4462f3['interaction']=_0x5f4547[_0x5607('0x64')]({'plain':!![]});interaction_log[_0x5607('0x20')](_0x5607('0x71'),_0x2c13a3[_0x5607('0x61')]['id'],_0x2c13a3[_0x5607('0x61')][_0x5607('0x36')],_0x2c13a3[_0x5607('0x61')][_0x5607('0x6a')],_0x4462f3[_0x5607('0x68')]['id'],_0x2c13a3[_0x5607('0x57')]?JSON[_0x5607('0x25')](_0x2c13a3['body']):_0x5607('0x6b'));return respondWithRpcPromise(_0x5607('0x72'),_0x5607('0x73'),_0x4462f3);}return null;})[_0x5607('0x34')](function(_0x3fb72a){if(_0x3fb72a){_0x3fb72a['message'][_0x5607('0x74')]=util[_0x5607('0x5e')](_0x5607('0x75'),_0x2c13a3[_0x5607('0x61')]['name']);_0x3fb72a[_0x5607('0x27')][_0x5607('0x6d')]=_0x4462f3[_0x5607('0x6d')];_0x3fb72a[_0x5607('0x27')][_0x5607('0x6e')]=_0x5607('0x31');respondWithRpcPromise(_0x5607('0x6f'),'EventManager',{'event':_0x5607('0x76'),'message':_0x3fb72a[_0x5607('0x27')]},client9002);return _0x4462f3;}return null;})[_0x5607('0x34')](respondWithResult(_0x57fead,null))[_0x5607('0x28')](handleError(_0x57fead,null));};exports[_0x5607('0x2a')]=function(_0x223910,_0x4a2489,_0xed65f8){if(_0x223910[_0x5607('0x57')]['id']){delete _0x223910[_0x5607('0x57')]['id'];}var _0x20363c;return db['SmsMessage'][_0x5607('0x58')]({'where':{'id':_0x223910[_0x5607('0x55')]['id']}})[_0x5607('0x34')](handleEntityNotFound(_0x4a2489,null))[_0x5607('0x34')](function(_0x1862f9){if(_0x1862f9){_0x20363c=_0x1862f9;return db[_0x5607('0x77')][_0x5607('0x58')]({'where':{'id':_0x1862f9[_0x5607('0x78')]}});}})['then'](handleEntityNotFound(_0x4a2489,null))[_0x5607('0x34')](function(_0x3c81d5){if(_0x3c81d5){logger[_0x5607('0x23')](_0x5607('0x24'),'status',_0x5607('0x79'),_0x3c81d5[_0x5607('0x3c')],util[_0x5607('0x7a')](_0x223910[_0x5607('0x57')],{'showHidden':![],'depth':null}));switch(_0x3c81d5[_0x5607('0x3c')]){case _0x5607('0x7b'):if(_0x223910['body'][_0x5607('0x7c')]&&_0x223910[_0x5607('0x57')][_0x5607('0x7c')]===_0x20363c[_0x5607('0x7d')]){return _0x20363c[_0x5607('0x33')]({'read':!![]});}else{logger[_0x5607('0x26')](_0x5607('0x7e'),'status','twilio',util['inspect'](_0x223910[_0x5607('0x57')],{'showHidden':![],'depth':null}));}break;case _0x5607('0x7f'):if(_0x223910[_0x5607('0x57')]['MessageUUID']&&_0x223910[_0x5607('0x57')]['MessageUUID']===_0x20363c[_0x5607('0x7d')]&&_[_0x5607('0x80')]([_0x5607('0x81'),'delivered'],_0x223910[_0x5607('0x57')][_0x5607('0x82')])>=0x0){return _0x20363c[_0x5607('0x33')]({'read':!![]});}else{logger[_0x5607('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5607('0x2a'),_0x5607('0x83'),util[_0x5607('0x7a')](_0x223910[_0x5607('0x57')],{'showHidden':![],'depth':null}));}break;case _0x5607('0x84'):var _0x59dd86=_0x223910[_0x5607('0x57')][_0x5607('0x85')][0x0];if(_0x59dd86[_0x5607('0x2a')][_0x5607('0x86')]===_0x5607('0x87')){return _0x20363c[_0x5607('0x33')]({'read':!![]});}else{logger[_0x5607('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5607('0x84'),util[_0x5607('0x7a')](_0x223910['body'],{'showHidden':![],'depth':null}));}break;}return _0x20363c;}})[_0x5607('0x34')](respondWithResult(_0x4a2489,null))[_0x5607('0x28')](handleError(_0x4a2489,null));};
\ No newline at end of file
+var _0xeffd=['redis','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','stack','name','index','map','SmsMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','options','find','body','describe','accept','sms','read','format','UserId','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','MessageUUID','indexOf','delivered','Status','infobip','results','groupName','DELIVERED','html-pdf','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults'];(function(_0x5f5885,_0x43cb55){var _0x28c70c=function(_0x4dd24f){while(--_0x4dd24f){_0x5f5885['push'](_0x5f5885['shift']());}};_0x28c70c(++_0x43cb55);}(_0xeffd,0x6b));var _0xdeff=function(_0x21bc29,_0xae5a13){_0x21bc29=_0x21bc29-0x0;var _0x39f1e7=_0xeffd[_0x21bc29];return _0x39f1e7;};'use strict';var pdf=require(_0xdeff('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdeff('0x1'));var zipdir=require(_0xdeff('0x2'));var jsonpatch=require(_0xdeff('0x3'));var rp=require(_0xdeff('0x4'));var moment=require(_0xdeff('0x5'));var BPromise=require(_0xdeff('0x6'));var Mustache=require(_0xdeff('0x7'));var util=require(_0xdeff('0x8'));var path=require(_0xdeff('0x9'));var sox=require(_0xdeff('0xa'));var csv=require(_0xdeff('0xb'));var ejs=require(_0xdeff('0xc'));var fs=require('fs');var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var db=require(_0xdeff('0x1c'))['db'];config['redis']=_[_0xdeff('0x1d')](config[_0xdeff('0x1e')],{'host':'localhost','port':0x18eb});var socket=require(_0xdeff('0x1f'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xdeff('0x20')](socket);var jayson=require(_0xdeff('0x21'));var client=jayson[_0xdeff('0x22')][_0xdeff('0x23')]({'port':0x232c});var client9002=jayson['client'][_0xdeff('0x23')]({'port':0x232a});function checkPasswordPattern(_0x314ded,_0xea6c4,_0x391633){if(_0x391633){var _0x3dbba1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3dbba1[_0xdeff('0x24')](_0xea6c4)){return _0x314ded;}else{throw new db['Sequelize']['ValidationError'](_0xdeff('0x25'));}}else{return _0x314ded;}}function respondWithRpcPromise(_0x4cf724,_0x5c9837,_0x35635f,_0x369e13){return new BPromise(function(_0x4b14b6,_0x2de203){var _0x42e98e=_0x369e13||client;return _0x42e98e[_0xdeff('0x26')](_0x4cf724,_0x35635f)[_0xdeff('0x27')](function(_0x18f2e2){logger[_0xdeff('0x28')](_0xdeff('0x29'),_0x5c9837,_0xdeff('0x2a'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5c9837,'request\x20sent',JSON[_0xdeff('0x2b')](_0x18f2e2));if(_0x18f2e2['error']){if(_0x18f2e2[_0xdeff('0x2c')][_0xdeff('0x2d')]===0x1f4){logger['error'](_0xdeff('0x29'),_0x5c9837,_0x18f2e2[_0xdeff('0x2c')]['message']);return _0x2de203(_0x18f2e2['error'][_0xdeff('0x2e')]);}logger[_0xdeff('0x2c')](_0xdeff('0x29'),_0x5c9837,_0x18f2e2[_0xdeff('0x2c')][_0xdeff('0x2e')]);return _0x4b14b6(_0x18f2e2['error'][_0xdeff('0x2e')]);}else{logger[_0xdeff('0x28')](_0xdeff('0x29'),_0x5c9837,_0xdeff('0x2a'));_0x4b14b6(_0x18f2e2[_0xdeff('0x2f')][_0xdeff('0x2e')]);}})[_0xdeff('0x30')](function(_0x52ea5d){logger[_0xdeff('0x2c')](_0xdeff('0x29'),_0x5c9837,_0x52ea5d);_0x2de203(_0x52ea5d);});});}function respondWithStatusCode(_0x53b168,_0x4dd366){_0x4dd366=_0x4dd366||0xcc;return function(_0x830be4){if(_0x830be4){return _0x53b168[_0xdeff('0x31')](_0x4dd366);}return _0x53b168[_0xdeff('0x32')](_0x4dd366)[_0xdeff('0x33')]();};}function respondWithResult(_0x533069,_0xf9b278){_0xf9b278=_0xf9b278||0xc8;return function(_0xbc75ee){if(_0xbc75ee){return _0x533069['status'](_0xf9b278)[_0xdeff('0x34')](_0xbc75ee);}};}function respondWithFilteredResult(_0x167e07,_0x34e258){return function(_0x5045b8){if(_0x5045b8){var _0x59f7a0=_0x5045b8[_0xdeff('0x35')],_0x346743=_0x34e258[_0xdeff('0x36')],_0x505e3f=_0x34e258['offset']+_0x34e258[_0xdeff('0x37')],_0x69842a;if(_0x505e3f>=_0x59f7a0){_0x505e3f=_0x59f7a0;_0x69842a=0xc8;}else{_0x69842a=0xce;}_0x167e07['status'](_0x69842a);return _0x167e07['set'](_0xdeff('0x38'),_0x346743+'-'+_0x505e3f+'/'+_0x59f7a0)[_0xdeff('0x34')](_0x5045b8);}return null;};}function patchUpdates(_0x4764c0){return function(_0x240459){try{jsonpatch['apply'](_0x240459,_0x4764c0,!![]);}catch(_0x3f91d8){return BPromise[_0xdeff('0x39')](_0x3f91d8);}return _0x240459[_0xdeff('0x3a')]();};}function saveUpdates(_0xfcfc54,_0x1ae013){return function(_0x78382e){if(_0x78382e){return _0x78382e[_0xdeff('0x3b')](_0xfcfc54)['then'](function(_0x471614){return _0x471614;});}return null;};}function removeEntity(_0x5cef77,_0x1923bf){return function(_0x2b38b0){if(_0x2b38b0){return _0x2b38b0[_0xdeff('0x3c')]()[_0xdeff('0x27')](function(){_0x5cef77[_0xdeff('0x32')](0xcc)[_0xdeff('0x33')]();});}};}function handleEntityNotFound(_0x52baf5,_0x25801b){return function(_0x3bf462){if(!_0x3bf462){_0x52baf5['sendStatus'](0x194);}return _0x3bf462;};}function handleError(_0x133f02,_0x38e41e){_0x38e41e=_0x38e41e||0x1f4;return function(_0x1c6d4c){logger[_0xdeff('0x2c')](_0x1c6d4c[_0xdeff('0x3d')]);if(_0x1c6d4c[_0xdeff('0x3e')]){delete _0x1c6d4c[_0xdeff('0x3e')];}_0x133f02[_0xdeff('0x32')](_0x38e41e)['send'](_0x1c6d4c);};}exports[_0xdeff('0x3f')]=function(_0x4ad39d,_0x231893){var _0x345032={},_0x30f442={},_0x5f368d={'count':0x0,'rows':[]};var _0x443550=_[_0xdeff('0x40')](db[_0xdeff('0x41')][_0xdeff('0x42')],function(_0x226028){return{'name':_0x226028['fieldName'],'type':_0x226028[_0xdeff('0x43')]['key']};});_0x30f442[_0xdeff('0x44')]=_[_0xdeff('0x40')](_0x443550,'name');_0x30f442[_0xdeff('0x45')]=_[_0xdeff('0x46')](_0x4ad39d[_0xdeff('0x45')]);_0x30f442[_0xdeff('0x47')]=_[_0xdeff('0x48')](_0x30f442['model'],_0x30f442[_0xdeff('0x45')]);_0x345032[_0xdeff('0x49')]=_[_0xdeff('0x48')](_0x30f442[_0xdeff('0x44')],qs[_0xdeff('0x4a')](_0x4ad39d['query']['fields']));_0x345032[_0xdeff('0x49')]=_0x345032[_0xdeff('0x49')][_0xdeff('0x4b')]?_0x345032[_0xdeff('0x49')]:_0x30f442[_0xdeff('0x44')];if(!_0x4ad39d[_0xdeff('0x45')][_0xdeff('0x4c')]('nolimit')){_0x345032[_0xdeff('0x37')]=qs[_0xdeff('0x37')](_0x4ad39d[_0xdeff('0x45')]['limit']);_0x345032[_0xdeff('0x36')]=qs[_0xdeff('0x36')](_0x4ad39d[_0xdeff('0x45')][_0xdeff('0x36')]);}_0x345032['order']=qs[_0xdeff('0x4d')](_0x4ad39d[_0xdeff('0x45')][_0xdeff('0x4d')]);_0x345032[_0xdeff('0x4e')]=qs[_0xdeff('0x47')](_[_0xdeff('0x4f')](_0x4ad39d[_0xdeff('0x45')],_0x30f442[_0xdeff('0x47')]),_0x443550);if(_0x4ad39d['query'][_0xdeff('0x50')]){_0x345032[_0xdeff('0x4e')]=_[_0xdeff('0x51')](_0x345032[_0xdeff('0x4e')],{'$or':_[_0xdeff('0x40')](_0x443550,function(_0x4d2dd3){if(_0x4d2dd3[_0xdeff('0x43')]!==_0xdeff('0x52')){var _0x2bf4b0={};_0x2bf4b0[_0x4d2dd3[_0xdeff('0x3e')]]={'$like':'%'+_0x4ad39d[_0xdeff('0x45')]['filter']+'%'};return _0x2bf4b0;}})});}_0x345032=_[_0xdeff('0x51')]({},_0x345032,_0x4ad39d['options']);var _0x42c435={'where':_0x345032[_0xdeff('0x4e')]};return db[_0xdeff('0x41')][_0xdeff('0x35')](_0x42c435)[_0xdeff('0x27')](function(_0x15b02c){_0x5f368d['count']=_0x15b02c;if(_0x4ad39d['query'][_0xdeff('0x53')]){_0x345032[_0xdeff('0x54')]=[{'all':!![]}];}return db[_0xdeff('0x41')]['findAll'](_0x345032);})['then'](function(_0x443bc6){_0x5f368d[_0xdeff('0x55')]=_0x443bc6;return _0x5f368d;})['then'](respondWithFilteredResult(_0x231893,_0x345032))[_0xdeff('0x30')](handleError(_0x231893,null));};exports[_0xdeff('0x56')]=function(_0xb84cfa,_0x4dc2ff){var _0x28fa6c={'raw':!![],'where':{'id':_0xb84cfa[_0xdeff('0x57')]['id']}},_0x2dea17={};_0x2dea17['model']=_[_0xdeff('0x46')](db[_0xdeff('0x41')][_0xdeff('0x42')]);_0x2dea17[_0xdeff('0x45')]=_[_0xdeff('0x46')](_0xb84cfa[_0xdeff('0x45')]);_0x2dea17[_0xdeff('0x47')]=_['intersection'](_0x2dea17[_0xdeff('0x44')],_0x2dea17[_0xdeff('0x45')]);_0x28fa6c['attributes']=_[_0xdeff('0x48')](_0x2dea17[_0xdeff('0x44')],qs[_0xdeff('0x4a')](_0xb84cfa[_0xdeff('0x45')][_0xdeff('0x4a')]));_0x28fa6c[_0xdeff('0x49')]=_0x28fa6c[_0xdeff('0x49')][_0xdeff('0x4b')]?_0x28fa6c['attributes']:_0x2dea17[_0xdeff('0x44')];if(_0xb84cfa[_0xdeff('0x45')][_0xdeff('0x53')]){_0x28fa6c['include']=[{'all':!![]}];}_0x28fa6c=_['merge']({},_0x28fa6c,_0xb84cfa[_0xdeff('0x58')]);return db[_0xdeff('0x41')][_0xdeff('0x59')](_0x28fa6c)[_0xdeff('0x27')](handleEntityNotFound(_0x4dc2ff,null))[_0xdeff('0x27')](respondWithResult(_0x4dc2ff,null))[_0xdeff('0x30')](handleError(_0x4dc2ff,null));};exports['create']=function(_0x486619,_0x38338b){return db[_0xdeff('0x41')]['create'](_0x486619['body'],{})[_0xdeff('0x27')](respondWithResult(_0x38338b,0xc9))[_0xdeff('0x30')](handleError(_0x38338b,null));};exports['update']=function(_0x4107cf,_0x2ac44c){if(_0x4107cf['body']['id']){delete _0x4107cf[_0xdeff('0x5a')]['id'];}return db[_0xdeff('0x41')]['find']({'where':{'id':_0x4107cf[_0xdeff('0x57')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x2ac44c,null))['then'](saveUpdates(_0x4107cf[_0xdeff('0x5a')],null))[_0xdeff('0x27')](respondWithResult(_0x2ac44c,null))[_0xdeff('0x30')](handleError(_0x2ac44c,null));};exports['destroy']=function(_0x47e86d,_0x661d27){return db['SmsMessage'][_0xdeff('0x59')]({'where':{'id':_0x47e86d[_0xdeff('0x57')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x661d27,null))[_0xdeff('0x27')](removeEntity(_0x661d27,null))[_0xdeff('0x30')](handleError(_0x661d27,null));};exports['describe']=function(_0x4d4f85,_0x98d18c){return db[_0xdeff('0x41')][_0xdeff('0x5b')]()[_0xdeff('0x27')](respondWithResult(_0x98d18c,null))[_0xdeff('0x30')](handleError(_0x98d18c,null));};var interaction_log=require(_0xdeff('0x18'))('sms-interactions');exports[_0xdeff('0x5c')]=function(_0x47b946,_0x10253e,_0x184c9d){var _0x2f92dd={'channel':_0xdeff('0x5d')};if(_0x47b946[_0xdeff('0x5a')]['id']){delete _0x47b946[_0xdeff('0x5a')]['id'];}_0x47b946[_0xdeff('0x5a')][_0xdeff('0x5e')]=!![];_0x47b946[_0xdeff('0x5a')]['readAt']=moment()[_0xdeff('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x47b946[_0xdeff('0x5a')][_0xdeff('0x60')]=_0x47b946['body'][_0xdeff('0x60')]||_0x47b946['user']['id'];return db[_0xdeff('0x41')]['find']({'where':{'id':_0x47b946['params']['id'],'UserId':null},'include':[{'model':db[_0xdeff('0x61')],'as':_0xdeff('0x62')}]})['then'](handleEntityNotFound(_0x10253e,null))[_0xdeff('0x27')](saveUpdates(_0x47b946[_0xdeff('0x5a')],null))[_0xdeff('0x27')](function(_0x3a04fd){if(_0x3a04fd){_0x2f92dd[_0xdeff('0x2e')]=_0x3a04fd[_0xdeff('0x63')]({'plain':!![]});return db[_0xdeff('0x64')][_0xdeff('0x59')]({'where':{'id':_0x3a04fd[_0xdeff('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x10253e,null))[_0xdeff('0x27')](function(_0x198aea){if(_0x198aea){return _0x198aea['update']({'UserId':_0x47b946['body'][_0xdeff('0x60')],'read1stAt':_[_0xdeff('0x66')](_0x198aea['read1stAt'])?moment()[_0xdeff('0x5f')](_0xdeff('0x67')):undefined});}return null;})[_0xdeff('0x27')](function(_0x1d3d2b){if(_0x1d3d2b){_0x2f92dd[_0xdeff('0x68')]=_0x1d3d2b[_0xdeff('0x63')]({'plain':!![]});interaction_log[_0xdeff('0x28')](_0xdeff('0x69'),_0x47b946[_0xdeff('0x6a')]['id'],_0x47b946[_0xdeff('0x6a')]['name'],_0x47b946[_0xdeff('0x6a')][_0xdeff('0x6b')],_0x2f92dd[_0xdeff('0x68')]['id'],_0x47b946[_0xdeff('0x5a')]?JSON[_0xdeff('0x2b')](_0x47b946['body']):'null');return respondWithRpcPromise('AcceptMessage',_0xdeff('0x6c'),_0x2f92dd);}return null;})[_0xdeff('0x27')](function(_0x2e801b){if(_0x2e801b){if(_0x47b946[_0xdeff('0x5a')]['manual']){_0x2f92dd['message'][_0xdeff('0x6d')]=util[_0xdeff('0x5f')](_0xdeff('0x6e'),_0x47b946[_0xdeff('0x6a')][_0xdeff('0x3e')]);_0x2f92dd[_0xdeff('0x2e')][_0xdeff('0x6f')]=_0x2f92dd[_0xdeff('0x6f')];_0x2f92dd['message'][_0xdeff('0x70')]=_0xdeff('0x5c');return respondWithRpcPromise(_0xdeff('0x71'),_0xdeff('0x71'),{'event':_0xdeff('0x72'),'message':_0x2f92dd[_0xdeff('0x2e')]},client9002)[_0xdeff('0x27')](function(){return _0x2f92dd;});}return _0x2f92dd;}return null;})[_0xdeff('0x27')](respondWithResult(_0x10253e,null))[_0xdeff('0x30')](handleError(_0x10253e,null));};var interaction_log=require(_0xdeff('0x18'))(_0xdeff('0x73'));exports[_0xdeff('0x39')]=function(_0x5b60e4,_0xdc88e8,_0xa46f6c){var _0x1fa20b={'agent':{},'channel':'sms'};if(_0x5b60e4[_0xdeff('0x5a')]['id']){delete _0x5b60e4[_0xdeff('0x5a')]['id'];}_0x5b60e4[_0xdeff('0x5a')][_0xdeff('0x60')]=_0x5b60e4['body'][_0xdeff('0x60')]||_0x5b60e4[_0xdeff('0x6a')]['id'];_0x1fa20b['agent']['id']=_0x5b60e4[_0xdeff('0x5a')][_0xdeff('0x60')];return db[_0xdeff('0x41')][_0xdeff('0x59')]({'where':{'id':_0x5b60e4[_0xdeff('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xdc88e8,null))[_0xdeff('0x27')](function(_0x452711){if(_0x452711){_0x1fa20b[_0xdeff('0x2e')]=_0x452711[_0xdeff('0x63')]({'plain':!![]});return db[_0xdeff('0x64')]['find']({'where':{'id':_0x452711[_0xdeff('0x65')]}});}return null;})[_0xdeff('0x27')](handleEntityNotFound(_0xdc88e8,null))['then'](function(_0x22d2fb){if(_0x22d2fb){_0x1fa20b[_0xdeff('0x68')]=_0x22d2fb[_0xdeff('0x63')]({'plain':!![]});interaction_log['info'](_0xdeff('0x74'),_0x5b60e4[_0xdeff('0x6a')]['id'],_0x5b60e4['user'][_0xdeff('0x3e')],_0x5b60e4[_0xdeff('0x6a')][_0xdeff('0x6b')],_0x1fa20b[_0xdeff('0x68')]['id'],_0x5b60e4['body']?JSON[_0xdeff('0x2b')](_0x5b60e4[_0xdeff('0x5a')]):_0xdeff('0x75'));return respondWithRpcPromise(_0xdeff('0x76'),_0xdeff('0x77'),_0x1fa20b);}return null;})[_0xdeff('0x27')](function(_0x7b5b7b){if(_0x7b5b7b){_0x7b5b7b[_0xdeff('0x2e')][_0xdeff('0x6d')]=util['format'](_0xdeff('0x6e'),_0x5b60e4['user'][_0xdeff('0x3e')]);_0x7b5b7b['message']['channel']=_0x1fa20b[_0xdeff('0x6f')];_0x7b5b7b[_0xdeff('0x2e')]['event']=_0xdeff('0x39');respondWithRpcPromise(_0xdeff('0x71'),_0xdeff('0x71'),{'event':_0xdeff('0x78'),'message':_0x7b5b7b['message']},client9002);return _0x1fa20b;}return null;})[_0xdeff('0x27')](respondWithResult(_0xdc88e8,null))[_0xdeff('0x30')](handleError(_0xdc88e8,null));};exports['status']=function(_0x3dca7f,_0xd597c7,_0x3eeb2d){if(_0x3dca7f[_0xdeff('0x5a')]['id']){delete _0x3dca7f[_0xdeff('0x5a')]['id'];}var _0x377733;return db[_0xdeff('0x41')][_0xdeff('0x59')]({'where':{'id':_0x3dca7f['params']['id']}})['then'](handleEntityNotFound(_0xd597c7,null))[_0xdeff('0x27')](function(_0x4cb6a6){if(_0x4cb6a6){_0x377733=_0x4cb6a6;return db[_0xdeff('0x79')][_0xdeff('0x59')]({'where':{'id':_0x4cb6a6['SmsAccountId']}});}})[_0xdeff('0x27')](handleEntityNotFound(_0xd597c7,null))[_0xdeff('0x27')](function(_0x232d7e){if(_0x232d7e){logger['debug'](_0xdeff('0x7a'),_0xdeff('0x32'),_0xdeff('0x7b'),_0x232d7e[_0xdeff('0x43')],util['inspect'](_0x3dca7f[_0xdeff('0x5a')],{'showHidden':![],'depth':null}));switch(_0x232d7e['type']){case _0xdeff('0x7c'):if(_0x3dca7f['body'][_0xdeff('0x7d')]&&_0x3dca7f['body'][_0xdeff('0x7d')]===_0x377733[_0xdeff('0x7e')]){return _0x377733[_0xdeff('0x3b')]({'read':!![]});}else{logger['error'](_0xdeff('0x7f'),_0xdeff('0x32'),_0xdeff('0x7c'),util[_0xdeff('0x80')](_0x3dca7f['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3dca7f[_0xdeff('0x5a')][_0xdeff('0x81')]&&_0x3dca7f[_0xdeff('0x5a')][_0xdeff('0x81')]===_0x377733[_0xdeff('0x7e')]&&_[_0xdeff('0x82')](['sent',_0xdeff('0x83')],_0x3dca7f[_0xdeff('0x5a')][_0xdeff('0x84')])>=0x0){return _0x377733['update']({'read':!![]});}else{logger['error'](_0xdeff('0x7f'),_0xdeff('0x32'),'plivio',util[_0xdeff('0x80')](_0x3dca7f[_0xdeff('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdeff('0x85'):var _0x38bf78=_0x3dca7f[_0xdeff('0x5a')][_0xdeff('0x86')][0x0];if(_0x38bf78['status'][_0xdeff('0x87')]===_0xdeff('0x88')){return _0x377733[_0xdeff('0x3b')]({'read':!![]});}else{logger['error'](_0xdeff('0x7f'),'status',_0xdeff('0x85'),util[_0xdeff('0x80')](_0x3dca7f['body'],{'showHidden':![],'depth':null}));}break;}return _0x377733;}})[_0xdeff('0x27')](respondWithResult(_0xd597c7,null))[_0xdeff('0x30')](handleError(_0xd597c7,null));};
\ No newline at end of file
index 68731e3..7b1c6ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe9f=['remove','emit','hasOwnProperty','hook','exports','events','SmsMessage','update'];(function(_0x5e5382,_0x4ee0ea){var _0x30eb45=function(_0x3d514c){while(--_0x3d514c){_0x5e5382['push'](_0x5e5382['shift']());}};_0x30eb45(++_0x4ee0ea);}(_0xfe9f,0xcd));var _0xffe9=function(_0x2d8074,_0x1acd95){_0x2d8074=_0x2d8074-0x0;var _0x448797=_0xfe9f[_0x2d8074];return _0x448797;};'use strict';var EventEmitter=require(_0xffe9('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xffe9('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xffe9('0x2'),'afterDestroy':_0xffe9('0x3')};function emitEvent(_0x160b74){return function(_0xa30c29,_0x215e01,_0x5a51d3){SmsMessageEvents[_0xffe9('0x4')](_0x160b74+':'+_0xa30c29['id'],_0xa30c29);SmsMessageEvents[_0xffe9('0x4')](_0x160b74,_0xa30c29);_0x5a51d3(null);};}for(var e in events){if(events[_0xffe9('0x5')](e)){var event=events[e];SmsMessage[_0xffe9('0x6')](e,emitEvent(event));}}module[_0xffe9('0x7')]=SmsMessageEvents;
\ No newline at end of file
+var _0xb416=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2c534a,_0x18a19e){var _0x3f5c99=function(_0x4c085f){while(--_0x4c085f){_0x2c534a['push'](_0x2c534a['shift']());}};_0x3f5c99(++_0x18a19e);}(_0xb416,0x1ec));var _0x6b41=function(_0x9fa59,_0x200fe9){_0x9fa59=_0x9fa59-0x0;var _0x24cd76=_0xb416[_0x9fa59];return _0x24cd76;};'use strict';var EventEmitter=require(_0x6b41('0x0'));var SmsMessage=require(_0x6b41('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6b41('0x2')](0x0);var events={'afterCreate':_0x6b41('0x3'),'afterUpdate':_0x6b41('0x4'),'afterDestroy':_0x6b41('0x5')};function emitEvent(_0x52f592){return function(_0x4c464b,_0x3efcad,_0xe64d89){SmsMessageEvents[_0x6b41('0x6')](_0x52f592+':'+_0x4c464b['id'],_0x4c464b);SmsMessageEvents[_0x6b41('0x6')](_0x52f592,_0x4c464b);_0xe64d89(null);};}for(var e in events){if(events[_0x6b41('0x7')](e)){var event=events[e];SmsMessage[_0x6b41('0x8')](e,emitEvent(event));}}module[_0x6b41('0x9')]=SmsMessageEvents;
\ No newline at end of file
index 5e492a2..6293f8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32c3=['toLowerCase','out','secret','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','find','type','accountSid','authToken','phone','messages','create','/api/sms/messages/','token','sid','afterCreate','inspect','error','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','/status?token=','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','remote','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','digest','hex','GET','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','message','refid','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','define','SmsMessage','sms_messages','messageId','body','get','direction'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x32c3,0x13e));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x332c('0x0'));var util=require(_0x332c('0x1'));var logger=require('../../config/logger')(_0x332c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x332c('0x3'));var fs=require('fs');var path=require(_0x332c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x4a8e23,_0x2019dd){return _0x4a8e23[_0x332c('0x5')](_0x332c('0x6'),attributes,{'tableName':_0x332c('0x7'),'paranoid':![],'indexes':[{'name':_0x332c('0x8'),'fields':[_0x332c('0x8')]},{'name':'fti_sms_messages','fields':[_0x332c('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f8ab8,_0x3e2dc5,_0x43e407){var _0x3a4286=_0x4a8e23['models'];var _0x27e2f6=_0x1f8ab8[_0x332c('0xa')]({'plain':!![]});if(_0x27e2f6[_0x332c('0xb')][_0x332c('0xc')]()==='in'||_0x27e2f6[_0x332c('0xb')][_0x332c('0xc')]()===_0x332c('0xd')&&!_0x27e2f6[_0x332c('0xe')]&&!_['isNil'](_0x27e2f6[_0x332c('0xf')])){_0x3a4286['SmsInteraction'][_0x332c('0x10')]({'where':{'id':_0x27e2f6[_0x332c('0x11')]}})[_0x332c('0x12')](function(_0x10fed3){if(_0x10fed3){_0x10fed3[_0x332c('0x13')]({'lastMsgAt':_0x27e2f6[_0x332c('0x14')],'lastMsgDirection':_0x27e2f6[_0x332c('0xb')]['toLowerCase']()});}})[_0x332c('0x15')](function(_0x1c6b3a){console['error'](_0x1c6b3a);});}if(_0x27e2f6[_0x332c('0xb')]==='out'&&!_0x27e2f6['secret']){var _0x490d02;_0x3a4286['SmsAccount'][_0x332c('0x16')]({'where':{'id':_0x27e2f6['SmsAccountId']},'raw':!![]})[_0x332c('0x12')](function(_0x5d942b){_0x490d02=_0x5d942b;if(_0x490d02&&_0x490d02[_0x332c('0x17')]){switch(_0x490d02[_0x332c('0x17')]){case'twilio':var _0x2f9cd6=require('twilio');if(_0x490d02[_0x332c('0x18')]&&_0x490d02[_0x332c('0x19')]&&_0x490d02[_0x332c('0x1a')]){var _0x30b994=new _0x2f9cd6(_0x490d02[_0x332c('0x18')],_0x490d02[_0x332c('0x19')]);_0x30b994[_0x332c('0x1b')][_0x332c('0x1c')]({'body':_0x27e2f6[_0x332c('0x9')],'to':_0x27e2f6[_0x332c('0x1a')],'from':_0x490d02[_0x332c('0x1a')],'statusCallback':_0x490d02['remote']+_0x332c('0x1d')+_0x27e2f6['id']+'/status?token='+_0x490d02[_0x332c('0x1e')]})[_0x332c('0x12')](function(_0x17572a){if(_0x17572a[_0x332c('0x1f')]){return _0x1f8ab8['update']({'messageId':_0x17572a[_0x332c('0x1f')]});}})[_0x332c('0x15')](function(_0x11b1bf){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x332c('0x20'),'twilio',util[_0x332c('0x21')](_0x11b1bf,{'showHidden':![],'depth':null}));});}else{logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x24'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x332c('0x25'):var _0x431c23=_0x332c('0x26');if(_0x490d02[_0x332c('0x27')]&&_0x490d02[_0x332c('0x28')]){var _0x35ea84={'recipient':[_0x27e2f6[_0x332c('0x1a')]],'message':_0x27e2f6[_0x332c('0x9')],'message_type':_0x490d02[_0x332c('0x29')]};if(_0x490d02[_0x332c('0x29')]&&_0x490d02[_0x332c('0x29')]!=='SI'){_0x35ea84[_0x332c('0x2a')]=_0x490d02[_0x332c('0x1a')];}var _0x24c0aa={'url':_0x431c23+_0x332c('0x2b')+_0x490d02['username']+'&password='+_0x490d02[_0x332c('0x28')],'method':'GET'};rp(_0x24c0aa)[_0x332c('0x12')](function(_0x416f54){var _0x53a171=_0x416f54[_0x332c('0x2c')](';');var _0x16edd7={'user_key':_0x53a171[0x0],'session_key':_0x53a171[0x1]};_0x24c0aa={'url':_0x431c23+_0x332c('0x2d'),'method':_0x332c('0x2e'),'headers':{'user_key':_0x16edd7[_0x332c('0x2f')],'Session_key':_0x16edd7[_0x332c('0x30')]},'json':!![],'body':_0x35ea84};return rp(_0x24c0aa);})[_0x332c('0x12')](function(_0x565d45){if(_0x565d45[_0x332c('0x31')]>=0x1){var _0x14b1f2={'messageId':_0x565d45[_0x332c('0x32')]};if(_0x490d02['smsMethod']!=='GP'||!_0x490d02[_0x332c('0x33')]){_0x14b1f2[_0x332c('0x34')]=!![];}return _0x1f8ab8[_0x332c('0x13')](_0x14b1f2);}else{return logger['error'](_0x332c('0x23'),_0x332c('0x20'),'skebby',util[_0x332c('0x21')](_0x565d45,{'showHidden':![],'depth':null}));}})[_0x332c('0x15')](function(_0x54775b){return logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x25'),util[_0x332c('0x21')](_0x54775b,{'showHidden':![],'depth':null}));});}else{logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x25'),_0x332c('0x35'));}break;case _0x332c('0x36'):if(_0x490d02['authToken']){var _0x19eb06={'recipient':_0x27e2f6[_0x332c('0x1a')],'message':_0x27e2f6['body'],'sender':_0x490d02[_0x332c('0x37')]||_0x490d02[_0x332c('0x1a')],'authorization':_0x490d02['authToken']};var _0x3e2dc5={'method':'POST','uri':'https://smsapi.connectel.se/api/send/','body':_0x19eb06,'json':!![]};rp(_0x3e2dc5)[_0x332c('0x12')](function(_0xe23172){var _0x49bfda={'messageId':_0xe23172[_0x332c('0x38')]};if(!_0x490d02[_0x332c('0x33')]){_0x49bfda[_0x332c('0x34')]=!![];}return _0x1f8ab8[_0x332c('0x13')](_0x49bfda);})['catch'](function(_0x392c0f){logger[_0x332c('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x332c('0x20'),'connectel',util[_0x332c('0x21')](_0x392c0f,{'showHidden':![],'depth':null}));});}else{logger[_0x332c('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x332c('0x20'),'connectel',_0x332c('0x39'));}break;case _0x332c('0x3a'):if(_0x490d02[_0x332c('0x27')]&&_0x490d02[_0x332c('0x28')]){var _0x19eb06={'messages':[{'source':'xCALLY\x20Motion','to':_0x27e2f6[_0x332c('0x1a')],'body':_0x27e2f6[_0x332c('0x9')],'from':_0x490d02[_0x332c('0x37')]||_0x490d02[_0x332c('0x1a')]}]};var _0x57e9c4=util[_0x332c('0x3b')](_0x332c('0x3c'),_0x490d02[_0x332c('0x27')],_0x490d02[_0x332c('0x28')]);var _0x3e2dc5={'method':'POST','uri':_0x332c('0x3d'),'body':_0x19eb06,'headers':{'Authorization':util['format'](_0x332c('0x3e'),new Buffer(_0x57e9c4)[_0x332c('0x3f')]('base64'))},'json':!![]};rp(_0x3e2dc5)[_0x332c('0x12')](function(_0xb24031){if(_0xb24031[_0x332c('0x40')]>=0xc8&&_0xb24031[_0x332c('0x40')]<=0xce){if(_0xb24031[_0x332c('0x41')]&&_0xb24031[_0x332c('0x41')][_0x332c('0x42')]>0x0){var _0x147aeb=_[_0x332c('0x43')](_0xb24031[_0x332c('0x41')][_0x332c('0x1b')]);var _0x185479={'messageId':_0x147aeb[_0x332c('0x44')]};if(!_0x490d02['deliveryReport']){_0x185479[_0x332c('0x34')]=!![];}return _0x1f8ab8[_0x332c('0x13')](_0x185479);}else{logger[_0x332c('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x332c('0x20'),_0x332c('0x45'),util[_0x332c('0x21')](_0xb24031,{'showHidden':![],'depth':null}));}}else{logger[_0x332c('0x22')](_0x332c('0x23'),'afterCreate',_0x332c('0x45'),util[_0x332c('0x21')](_0xb24031,{'showHidden':![],'depth':null}));}})[_0x332c('0x15')](function(_0xae12e1){logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x45'),util[_0x332c('0x21')](_0xae12e1,{'showHidden':![],'depth':null}));});}else{logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x45'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x332c('0x46'):if(_0x490d02[_0x332c('0x47')]&&_0x490d02['authToken']){var _0x19eb06={'dst':_0x27e2f6[_0x332c('0x1a')],'text':_0x27e2f6[_0x332c('0x9')],'src':_0x490d02['senderString']||_0x490d02['phone'],'url':_0x490d02['remote']+_0x332c('0x1d')+_0x27e2f6['id']+_0x332c('0x48')+_0x490d02[_0x332c('0x1e')]};var _0x57e9c4=util[_0x332c('0x3b')](_0x332c('0x3c'),_0x490d02[_0x332c('0x47')],_0x490d02[_0x332c('0x19')]);var _0x3e2dc5={'method':'POST','uri':util[_0x332c('0x3b')]('https://api.plivo.com/v1/Account/%s/Message/',_0x490d02[_0x332c('0x47')]),'body':_0x19eb06,'headers':{'Authorization':util[_0x332c('0x3b')](_0x332c('0x3e'),new Buffer(_0x57e9c4)[_0x332c('0x3f')](_0x332c('0x49')))},'json':!![]};rp(_0x3e2dc5)[_0x332c('0x12')](function(_0x1a40b5){var _0x380b91={'messageId':_0x1a40b5[_0x332c('0x4a')][0x0]};return _0x1f8ab8[_0x332c('0x13')](_0x380b91);})[_0x332c('0x15')](function(_0xf661dd){logger[_0x332c('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util[_0x332c('0x21')](_0xf661dd,{'showHidden':![],'depth':null}));});}else{logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x46'),_0x332c('0x4b'));}break;case _0x332c('0x4c'):if(_0x490d02[_0x332c('0x27')]&&_0x490d02['password']){if(_0x490d02[_0x332c('0x4d')]){var _0x4564d2={'method':_0x332c('0x2e'),'uri':_0x490d02['baseUrl']+'/auth/1/session','body':{'username':_0x490d02[_0x332c('0x27')],'password':_0x490d02['password']},'json':!![]};return rp(_0x4564d2)[_0x332c('0x12')](function(_0x2a42f0){var _0x5b8dd8={'method':_0x332c('0x2e'),'uri':_0x490d02[_0x332c('0x4d')]+_0x332c('0x4e'),'body':{'messages':[{'from':_0x490d02[_0x332c('0x1a')],'destinations':[{'to':_0x27e2f6[_0x332c('0x1a')]}],'text':_0x27e2f6['body'],'notifyUrl':_0x490d02[_0x332c('0x4f')]+_0x332c('0x1d')+_0x27e2f6['id']+_0x332c('0x48')+_0x490d02[_0x332c('0x1e')],'notifyContentType':_0x332c('0x50'),'callbackData':_0x490d02[_0x332c('0x1a')]+';'+_0x27e2f6[_0x332c('0x9')]}]},'headers':{'Authorization':_0x332c('0x51')+_0x2a42f0[_0x332c('0x1e')]},'json':!![]};return rp(_0x5b8dd8)['then'](function(_0x3cdf3e){if(_0x3cdf3e[_0x332c('0x1b')]){var _0x59999e={'messageId':_0x3cdf3e[_0x332c('0x1b')][0x0]['messageId']};if(!_0x490d02[_0x332c('0x33')]){_0x59999e['read']=!![];}return _0x1f8ab8['update'](_0x59999e);}else{return logger[_0x332c('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x332c('0x20'),_0x332c('0x4c'),util[_0x332c('0x21')](_0x3cdf3e,{'showHidden':![],'depth':null}));}});})[_0x332c('0x15')](function(_0x5fee83){return logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x4c'),util['inspect'](_0x5fee83,{'showHidden':![],'depth':null}));});}else{logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x4c'),_0x332c('0x52'));}}else{logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),'infobip',_0x332c('0x35'));}break;case _0x332c('0x53'):var _0x2ba297=require(_0x332c('0x54'));if(_0x490d02[_0x332c('0x55')]){var _0x24daea={};_0x24daea['login']=_0x490d02['username'];_0x24daea['phone']=_0x27e2f6['phone'];_0x24daea[_0x332c('0x2a')]=_0x490d02[_0x332c('0x1a')];_0x24daea[_0x332c('0x56')]=_0x27e2f6[_0x332c('0x9')];_0x24daea[_0x332c('0x57')]=+new Date();var _0x57dbe9='';var _0x4611df='';var _0x3914cf=Object[_0x332c('0x58')](_0x24daea);_0x3914cf[_0x332c('0x59')]();for(var _0x460e4d=0x0;_0x460e4d<_0x3914cf['length'];_0x460e4d++){if(_0x57dbe9!=''){_0x57dbe9+='&';}_0x57dbe9+=_0x3914cf[_0x460e4d]+'='+encodeURIComponent(_0x24daea[_0x3914cf[_0x460e4d]]);_0x4611df+=_0x24daea[_0x3914cf[_0x460e4d]];}_0x4611df+=_0x490d02[_0x332c('0x55')];_0x4611df=_0x2ba297['createHash']('md5')[_0x332c('0x13')](_0x4611df)[_0x332c('0x5a')](_0x332c('0x5b'));if(_0x57dbe9!==''){_0x57dbe9+='&';}_0x57dbe9+='signature='+_0x4611df;var _0x24c0aa={'method':_0x332c('0x5c'),'uri':_0x490d02['baseUrl']+'/external/get/send.php?'+_0x57dbe9,'json':!![]};return rp(_0x24c0aa)[_0x332c('0x12')](function(_0x46f611){var _0x550cdd=Object[_0x332c('0x58')](_0x46f611);if(_0x46f611[_0x550cdd[0x0]]['error']&&parseInt(_0x46f611[_0x550cdd[0x0]][_0x332c('0x22')])===0x0){var _0x46d668={'messageId':_0x46f611[_0x550cdd[0x0]][_0x332c('0x5d')]};if(!_0x490d02[_0x332c('0x33')]){_0x46d668[_0x332c('0x34')]=!![];}return _0x1f8ab8['update'](_0x46d668);}else{return logger['error'](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x53'),util[_0x332c('0x21')](_0x46f611['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x8bb812){return logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x53'),util[_0x332c('0x21')](_0x8bb812,{'showHidden':![],'depth':null}));});}else{logger[_0x332c('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',_0x332c('0x5e'));}break;case _0x332c('0x5f'):if(_0x490d02['apiKey']){var _0x3b8e26={'method':_0x332c('0x2e'),'uri':_0x332c('0x60'),'headers':{'Authorization':_0x490d02[_0x332c('0x55')]},'body':{'content':_0x27e2f6[_0x332c('0x9')],'to':[_0x27e2f6['phone']],'from':_0x490d02[_0x332c('0x1a')],'binary':![],'clientMessageId':_0x332c('0x61'),'charset':_0x332c('0x62')},'json':!![]};rp(_0x3b8e26)[_0x332c('0x12')](function(_0x52064d){if(!_0x52064d[_0x332c('0x22')]){var _0x2162ae={'messageId':_0x52064d[_0x332c('0x1b')][0x0][_0x332c('0x63')]};if(!_0x490d02['deliveryReport']){_0x2162ae[_0x332c('0x34')]=!![];}return _0x1f8ab8[_0x332c('0x13')](_0x2162ae);}else{return logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x5f'),util[_0x332c('0x21')](_0x52064d['error'],{'showHidden':![],'depth':null}));}})[_0x332c('0x15')](function(_0x7af427){return logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x5f'),util[_0x332c('0x21')](_0x7af427,{'showHidden':![],'depth':null}));});}else{logger[_0x332c('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x332c('0x20'),_0x332c('0x5f'),_0x332c('0x5e'));}break;case _0x332c('0x64'):if(_0x490d02[_0x332c('0x55')]){var _0x93d074={};var _0x24c0aa={'method':_0x332c('0x2e'),'uri':_0x332c('0x65'),'headers':{'Authorization':'Bearer\x20'+_0x490d02[_0x332c('0x55')],'Content-Type':_0x332c('0x50')},'body':{'from':_0x490d02['phone'],'to':_0x27e2f6[_0x332c('0x1a')],'text':_0x27e2f6[_0x332c('0x9')]},'json':!![]};return rp(_0x24c0aa)[_0x332c('0x12')](function(_0x4a9dc8){if(_0x4a9dc8[_0x332c('0x66')]==0xca){_0x93d074['message']=_0x4a9dc8;var _0x487714={'method':_0x332c('0x2e'),'uri':_0x332c('0x67'),'headers':{'Authorization':_0x332c('0x68')+_0x490d02[_0x332c('0x55')],'Content-Type':'application/json'},'body':{'refid':_0x93d074[_0x332c('0x69')][_0x332c('0x6a')]},'json':!![]};return rp(_0x487714)[_0x332c('0x12')](function(_0x1f9e3f){_0x93d074['status']=_0x1f9e3f;var _0x2b8416={'messageId':_0x93d074[_0x332c('0x69')]['refid'],'read':!![]};return _0x1f8ab8['update'](_0x2b8416);});}else{return logger[_0x332c('0x22')](_0x332c('0x23'),_0x332c('0x20'),_0x332c('0x64'),util['inspect'](_0x4a9dc8,{'showHidden':![],'depth':null}));}})[_0x332c('0x15')](function(_0x32df6f){return logger[_0x332c('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x332c('0x64'),util[_0x332c('0x21')](_0x32df6f,{'showHidden':![],'depth':null}));});}else{return logger[_0x332c('0x22')](_0x332c('0x23'),'afterCreate','intelepeer',_0x332c('0x6b'));}break;}}})['finally'](function(){_0x43e407();});}else{_0x43e407();}}},'charset':_0x332c('0x6c'),'collate':_0x332c('0x6d')});};
\ No newline at end of file
+var _0x4978=['format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','message_id','clickSend','authId','token','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','deliveryReport','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','user_key','total_sent','internal_order_id','read','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','POST','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString'];(function(_0x7a68b,_0x964789){var _0x110d37=function(_0x482401){while(--_0x482401){_0x7a68b['push'](_0x7a68b['shift']());}};_0x110d37(++_0x964789);}(_0x4978,0x12d));var _0x8497=function(_0x41aaa5,_0x5d880b){_0x41aaa5=_0x41aaa5-0x0;var _0x35c60f=_0x4978[_0x41aaa5];return _0x35c60f;};'use strict';var _=require('lodash');var util=require(_0x8497('0x0'));var logger=require(_0x8497('0x1'))(_0x8497('0x2'));var moment=require(_0x8497('0x3'));var BPromise=require('bluebird');var rp=require(_0x8497('0x4'));var fs=require('fs');var path=require(_0x8497('0x5'));var rimraf=require(_0x8497('0x6'));var config=require(_0x8497('0x7'));var attributes=require(_0x8497('0x8'));module[_0x8497('0x9')]=function(_0x1ab83c,_0x31501c){return _0x1ab83c[_0x8497('0xa')](_0x8497('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x8497('0xc'),'fields':[_0x8497('0xc')]},{'name':'fti_sms_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4266a3,_0x670e4a,_0x30496a){var _0x430e24=_0x1ab83c[_0x8497('0xd')];var _0x30e05a=_0x4266a3[_0x8497('0xe')]({'plain':!![]});if(_0x30e05a[_0x8497('0xf')]['toLowerCase']()==='in'||_0x30e05a[_0x8497('0xf')][_0x8497('0x10')]()===_0x8497('0x11')&&!_0x30e05a[_0x8497('0x12')]&&!_[_0x8497('0x13')](_0x30e05a[_0x8497('0x14')])){_0x430e24['SmsInteraction'][_0x8497('0x15')]({'where':{'id':_0x30e05a[_0x8497('0x16')]}})['then'](function(_0x2c8d5c){if(_0x2c8d5c){_0x2c8d5c['update']({'lastMsgAt':_0x30e05a[_0x8497('0x17')],'lastMsgDirection':_0x30e05a[_0x8497('0xf')][_0x8497('0x10')]()});}})[_0x8497('0x18')](function(_0x503583){console[_0x8497('0x19')](_0x503583);});}if(_0x30e05a[_0x8497('0xf')]===_0x8497('0x11')&&!_0x30e05a['secret']){var _0xe85054;_0x430e24[_0x8497('0x1a')][_0x8497('0x1b')]({'where':{'id':_0x30e05a[_0x8497('0x1c')]},'raw':!![]})[_0x8497('0x1d')](function(_0x3ceb16){_0xe85054=_0x3ceb16;if(_0xe85054&&_0xe85054[_0x8497('0x1e')]){switch(_0xe85054['type']){case _0x8497('0x1f'):var _0x21cc10=require('twilio');if(_0xe85054[_0x8497('0x20')]&&_0xe85054[_0x8497('0x21')]&&_0xe85054[_0x8497('0x22')]){var _0x30829f=new _0x21cc10(_0xe85054['accountSid'],_0xe85054[_0x8497('0x21')]);_0x30829f[_0x8497('0x23')][_0x8497('0x24')]({'body':_0x30e05a[_0x8497('0x25')],'to':_0x30e05a[_0x8497('0x22')],'from':_0xe85054['phone'],'statusCallback':_0xe85054[_0x8497('0x26')]+_0x8497('0x27')+_0x30e05a['id']+_0x8497('0x28')+_0xe85054['token']})[_0x8497('0x1d')](function(_0x269afc){if(_0x269afc[_0x8497('0x29')]){return _0x4266a3[_0x8497('0x2a')]({'messageId':_0x269afc[_0x8497('0x29')]});}})['catch'](function(_0x298f4f){logger[_0x8497('0x19')](_0x8497('0x2b'),'afterCreate',_0x8497('0x1f'),util[_0x8497('0x2c')](_0x298f4f,{'showHidden':![],'depth':null}));});}else{logger[_0x8497('0x19')](_0x8497('0x2b'),'afterCreate',_0x8497('0x1f'),_0x8497('0x2d'));}break;case _0x8497('0x2e'):var _0x10991b=_0x8497('0x2f');if(_0xe85054[_0x8497('0x30')]&&_0xe85054[_0x8497('0x31')]){var _0x33e538={'recipient':[_0x30e05a[_0x8497('0x22')]],'message':_0x30e05a[_0x8497('0x25')],'message_type':_0xe85054[_0x8497('0x32')]};if(_0xe85054['smsMethod']&&_0xe85054[_0x8497('0x32')]!=='SI'){_0x33e538['sender']=_0xe85054[_0x8497('0x22')];}var _0x478c15={'url':_0x10991b+_0x8497('0x33')+_0xe85054[_0x8497('0x30')]+_0x8497('0x34')+_0xe85054[_0x8497('0x31')],'method':_0x8497('0x35')};rp(_0x478c15)[_0x8497('0x1d')](function(_0x24fda2){var _0x40c1da=_0x24fda2[_0x8497('0x36')](';');var _0x17e73d={'user_key':_0x40c1da[0x0],'session_key':_0x40c1da[0x1]};_0x478c15={'url':_0x10991b+'sms','method':'POST','headers':{'user_key':_0x17e73d[_0x8497('0x37')],'Session_key':_0x17e73d['session_key']},'json':!![],'body':_0x33e538};return rp(_0x478c15);})[_0x8497('0x1d')](function(_0x1717a5){if(_0x1717a5[_0x8497('0x38')]>=0x1){var _0x5e254c={'messageId':_0x1717a5[_0x8497('0x39')]};if(_0xe85054[_0x8497('0x32')]!=='GP'||!_0xe85054['deliveryReport']){_0x5e254c[_0x8497('0x3a')]=!![];}return _0x4266a3[_0x8497('0x2a')](_0x5e254c);}else{return logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x2e'),util['inspect'](_0x1717a5,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2a1909){return logger['error'](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x2e'),util[_0x8497('0x2c')](_0x2a1909,{'showHidden':![],'depth':null}));});}else{logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x2e'),_0x8497('0x3c'));}break;case _0x8497('0x3d'):if(_0xe85054['authToken']){var _0x58f143={'recipient':_0x30e05a['phone'],'message':_0x30e05a['body'],'sender':_0xe85054['senderString']||_0xe85054[_0x8497('0x22')],'authorization':_0xe85054[_0x8497('0x21')]};var _0x670e4a={'method':_0x8497('0x3e'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x58f143,'json':!![]};rp(_0x670e4a)[_0x8497('0x1d')](function(_0x500334){var _0x1290f7={'messageId':_0x500334[_0x8497('0x3f')]};if(!_0xe85054['deliveryReport']){_0x1290f7[_0x8497('0x3a')]=!![];}return _0x4266a3[_0x8497('0x2a')](_0x1290f7);})[_0x8497('0x18')](function(_0x4cfc45){logger['error'](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x3d'),util['inspect'](_0x4cfc45,{'showHidden':![],'depth':null}));});}else{logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x3d'),_0x8497('0x40'));}break;case _0x8497('0x41'):if(_0xe85054[_0x8497('0x30')]&&_0xe85054[_0x8497('0x31')]){var _0x58f143={'messages':[{'source':_0x8497('0x42'),'to':_0x30e05a[_0x8497('0x22')],'body':_0x30e05a['body'],'from':_0xe85054[_0x8497('0x43')]||_0xe85054[_0x8497('0x22')]}]};var _0x3a0b54=util[_0x8497('0x44')](_0x8497('0x45'),_0xe85054[_0x8497('0x30')],_0xe85054['password']);var _0x670e4a={'method':'POST','uri':_0x8497('0x46'),'body':_0x58f143,'headers':{'Authorization':util[_0x8497('0x44')](_0x8497('0x47'),new Buffer(_0x3a0b54)[_0x8497('0x48')](_0x8497('0x49')))},'json':!![]};rp(_0x670e4a)[_0x8497('0x1d')](function(_0x4376d1){if(_0x4376d1[_0x8497('0x4a')]>=0xc8&&_0x4376d1[_0x8497('0x4a')]<=0xce){if(_0x4376d1[_0x8497('0x4b')]&&_0x4376d1[_0x8497('0x4b')]['queued_count']>0x0){var _0x108417=_[_0x8497('0x4c')](_0x4376d1[_0x8497('0x4b')]['messages']);var _0x344b61={'messageId':_0x108417[_0x8497('0x4d')]};if(!_0xe85054['deliveryReport']){_0x344b61['read']=!![];}return _0x4266a3[_0x8497('0x2a')](_0x344b61);}else{logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x4e'),util['inspect'](_0x4376d1,{'showHidden':![],'depth':null}));}}else{logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x4e'),util[_0x8497('0x2c')](_0x4376d1,{'showHidden':![],'depth':null}));}})[_0x8497('0x18')](function(_0x43f24d){logger[_0x8497('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8497('0x3b'),_0x8497('0x4e'),util['inspect'](_0x43f24d,{'showHidden':![],'depth':null}));});}else{logger[_0x8497('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8497('0x4e'),_0x8497('0x3c'));}break;case'plivo':if(_0xe85054[_0x8497('0x4f')]&&_0xe85054['authToken']){var _0x58f143={'dst':_0x30e05a[_0x8497('0x22')],'text':_0x30e05a['body'],'src':_0xe85054[_0x8497('0x43')]||_0xe85054[_0x8497('0x22')],'url':_0xe85054[_0x8497('0x26')]+_0x8497('0x27')+_0x30e05a['id']+_0x8497('0x28')+_0xe85054[_0x8497('0x50')]};var _0x3a0b54=util[_0x8497('0x44')](_0x8497('0x45'),_0xe85054[_0x8497('0x4f')],_0xe85054[_0x8497('0x21')]);var _0x670e4a={'method':'POST','uri':util[_0x8497('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0xe85054[_0x8497('0x4f')]),'body':_0x58f143,'headers':{'Authorization':util[_0x8497('0x44')](_0x8497('0x47'),new Buffer(_0x3a0b54)['toString']('base64'))},'json':!![]};rp(_0x670e4a)[_0x8497('0x1d')](function(_0x55ca6a){var _0x16fbfb={'messageId':_0x55ca6a['message_uuid'][0x0]};return _0x4266a3[_0x8497('0x2a')](_0x16fbfb);})[_0x8497('0x18')](function(_0x7244dd){logger[_0x8497('0x19')](_0x8497('0x2b'),'afterCreate',_0x8497('0x51'),util[_0x8497('0x2c')](_0x7244dd,{'showHidden':![],'depth':null}));});}else{logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x51'),_0x8497('0x52'));}break;case _0x8497('0x53'):if(_0xe85054['username']&&_0xe85054[_0x8497('0x31')]){if(_0xe85054[_0x8497('0x54')]){var _0x1a5886={'method':'POST','uri':_0xe85054[_0x8497('0x54')]+_0x8497('0x55'),'body':{'username':_0xe85054[_0x8497('0x30')],'password':_0xe85054[_0x8497('0x31')]},'json':!![]};return rp(_0x1a5886)[_0x8497('0x1d')](function(_0x5a28f3){var _0x117607={'method':_0x8497('0x3e'),'uri':_0xe85054['baseUrl']+_0x8497('0x56'),'body':{'messages':[{'from':_0xe85054['phone'],'destinations':[{'to':_0x30e05a[_0x8497('0x22')]}],'text':_0x30e05a['body'],'notifyUrl':_0xe85054['remote']+_0x8497('0x27')+_0x30e05a['id']+_0x8497('0x28')+_0xe85054[_0x8497('0x50')],'notifyContentType':_0x8497('0x57'),'callbackData':_0xe85054[_0x8497('0x22')]+';'+_0x30e05a[_0x8497('0x25')]}]},'headers':{'Authorization':_0x8497('0x58')+_0x5a28f3[_0x8497('0x50')]},'json':!![]};return rp(_0x117607)[_0x8497('0x1d')](function(_0x20084f){if(_0x20084f[_0x8497('0x23')]){var _0xed3bc={'messageId':_0x20084f[_0x8497('0x23')][0x0][_0x8497('0xc')]};if(!_0xe85054[_0x8497('0x59')]){_0xed3bc[_0x8497('0x3a')]=!![];}return _0x4266a3['update'](_0xed3bc);}else{return logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x53'),util['inspect'](_0x20084f,{'showHidden':![],'depth':null}));}});})[_0x8497('0x18')](function(_0x20b37c){return logger[_0x8497('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8497('0x3b'),_0x8497('0x53'),util[_0x8497('0x2c')](_0x20b37c,{'showHidden':![],'depth':null}));});}else{logger[_0x8497('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8497('0x3b'),_0x8497('0x53'),_0x8497('0x5a'));}}else{logger[_0x8497('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8497('0x3b'),_0x8497('0x53'),_0x8497('0x3c'));}break;case _0x8497('0x5b'):var _0x3201b2=require(_0x8497('0x5c'));if(_0xe85054[_0x8497('0x5d')]){var _0x17a052={};_0x17a052[_0x8497('0x5e')]=_0xe85054[_0x8497('0x30')];_0x17a052['phone']=_0x30e05a[_0x8497('0x22')];_0x17a052[_0x8497('0x5f')]=_0xe85054[_0x8497('0x22')];_0x17a052[_0x8497('0x60')]=_0x30e05a[_0x8497('0x25')];_0x17a052['timestamp']=+new Date();var _0x4c2d82='';var _0x15a8a7='';var _0x173361=Object[_0x8497('0x61')](_0x17a052);_0x173361[_0x8497('0x62')]();for(var _0xb77b1c=0x0;_0xb77b1c<_0x173361[_0x8497('0x63')];_0xb77b1c++){if(_0x4c2d82!=''){_0x4c2d82+='&';}_0x4c2d82+=_0x173361[_0xb77b1c]+'='+encodeURIComponent(_0x17a052[_0x173361[_0xb77b1c]]);_0x15a8a7+=_0x17a052[_0x173361[_0xb77b1c]];}_0x15a8a7+=_0xe85054[_0x8497('0x5d')];_0x15a8a7=_0x3201b2[_0x8497('0x64')](_0x8497('0x65'))['update'](_0x15a8a7)[_0x8497('0x66')](_0x8497('0x67'));if(_0x4c2d82!==''){_0x4c2d82+='&';}_0x4c2d82+=_0x8497('0x68')+_0x15a8a7;var _0x478c15={'method':'GET','uri':_0xe85054[_0x8497('0x54')]+_0x8497('0x69')+_0x4c2d82,'json':!![]};return rp(_0x478c15)[_0x8497('0x1d')](function(_0x593183){var _0x2a29d6=Object[_0x8497('0x61')](_0x593183);if(_0x593183[_0x2a29d6[0x0]][_0x8497('0x19')]&&parseInt(_0x593183[_0x2a29d6[0x0]][_0x8497('0x19')])===0x0){var _0x5aa14e={'messageId':_0x593183[_0x2a29d6[0x0]][_0x8497('0x6a')]};if(!_0xe85054[_0x8497('0x59')]){_0x5aa14e['read']=!![];}return _0x4266a3['update'](_0x5aa14e);}else{return logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x5b'),util['inspect'](_0x593183['error'],{'showHidden':![],'depth':null}));}})[_0x8497('0x18')](function(_0x542470){return logger[_0x8497('0x19')](_0x8497('0x2b'),'afterCreate',_0x8497('0x5b'),util['inspect'](_0x542470,{'showHidden':![],'depth':null}));});}else{logger[_0x8497('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8497('0x5b'),_0x8497('0x6b'));}break;case _0x8497('0x6c'):if(_0xe85054[_0x8497('0x5d')]){var _0x2ac4ab={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xe85054[_0x8497('0x5d')]},'body':{'content':_0x30e05a[_0x8497('0x25')],'to':[_0x30e05a['phone']],'from':_0xe85054[_0x8497('0x22')],'binary':![],'clientMessageId':_0x8497('0x6d'),'charset':_0x8497('0x6e')},'json':!![]};rp(_0x2ac4ab)[_0x8497('0x1d')](function(_0x1be4aa){if(!_0x1be4aa[_0x8497('0x19')]){var _0x3aceb6={'messageId':_0x1be4aa['messages'][0x0][_0x8497('0x6f')]};if(!_0xe85054[_0x8497('0x59')]){_0x3aceb6[_0x8497('0x3a')]=!![];}return _0x4266a3[_0x8497('0x2a')](_0x3aceb6);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x8497('0x6c'),util[_0x8497('0x2c')](_0x1be4aa['error'],{'showHidden':![],'depth':null}));}})[_0x8497('0x18')](function(_0x37fef8){return logger['error'](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x6c'),util[_0x8497('0x2c')](_0x37fef8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x6c'),_0x8497('0x6b'));}break;case _0x8497('0x70'):if(_0xe85054[_0x8497('0x5d')]){var _0x42ccc6={};var _0x478c15={'method':_0x8497('0x3e'),'uri':_0x8497('0x71'),'headers':{'Authorization':_0x8497('0x72')+_0xe85054[_0x8497('0x5d')],'Content-Type':_0x8497('0x57')},'body':{'from':_0xe85054[_0x8497('0x22')],'to':_0x30e05a[_0x8497('0x22')],'text':_0x30e05a[_0x8497('0x25')]},'json':!![]};return rp(_0x478c15)[_0x8497('0x1d')](function(_0x136090){if(_0x136090['code']==0xca){_0x42ccc6[_0x8497('0x73')]=_0x136090;var _0x2be15f={'method':_0x8497('0x3e'),'uri':_0x8497('0x74'),'headers':{'Authorization':'Bearer\x20'+_0xe85054['apiKey'],'Content-Type':_0x8497('0x57')},'body':{'refid':_0x42ccc6[_0x8497('0x73')][_0x8497('0x75')]},'json':!![]};return rp(_0x2be15f)[_0x8497('0x1d')](function(_0x2f704d){_0x42ccc6[_0x8497('0x76')]=_0x2f704d;var _0x29bfbc={'messageId':_0x42ccc6[_0x8497('0x73')]['refid'],'read':!![]};return _0x4266a3['update'](_0x29bfbc);});}else{return logger[_0x8497('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8497('0x3b'),_0x8497('0x70'),util['inspect'](_0x136090,{'showHidden':![],'depth':null}));}})[_0x8497('0x18')](function(_0x4648c1){return logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x70'),util[_0x8497('0x2c')](_0x4648c1,{'showHidden':![],'depth':null}));});}else{return logger[_0x8497('0x19')](_0x8497('0x2b'),_0x8497('0x3b'),_0x8497('0x70'),_0x8497('0x77'));}break;}}})[_0x8497('0x78')](function(){_0x30496a();});}else{_0x30496a();}}},'charset':_0x8497('0x79'),'collate':_0x8497('0x7a')});};
\ No newline at end of file
index 7601337..0dfd7c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x1a85,0x178));var _0x51a8=function(_0x317b2e,_0x165181){_0x317b2e=_0x317b2e-0x0;var _0x1a30d6=_0x1a85[_0x317b2e];return _0x1a30d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});config['redis']=_[_0x51a8('0x8')](config[_0x51a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a8('0xa'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x51a8('0xb')](socket);function respondWithRpcPromise(_0x2f276b,_0x1a476d,_0x45a3f4){return new BPromise(function(_0x418f06,_0x421fa4){return client[_0x51a8('0xc')](_0x2f276b,_0x45a3f4)[_0x51a8('0xd')](function(_0x34c887){logger[_0x51a8('0xe')](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));logger[_0x51a8('0x11')](_0x51a8('0x12'),_0x1a476d,_0x51a8('0x10'),JSON[_0x51a8('0x13')](_0x34c887));if(_0x34c887[_0x51a8('0x14')]){if(_0x34c887['error'][_0x51a8('0x15')]===0x1f4){logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887['error'][_0x51a8('0x16')]);return _0x421fa4(_0x34c887['error'][_0x51a8('0x16')]);}logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);return _0x418f06(_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);}else{logger['info'](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));_0x418f06(_0x34c887[_0x51a8('0x17')][_0x51a8('0x16')]);}})[_0x51a8('0x18')](function(_0x544886){logger['error'](_0x51a8('0xf'),_0x1a476d,_0x544886);_0x421fa4(_0x544886);});});}exports[_0x51a8('0x19')]=function(_0x2217ce){var _0x2f2681=this;return new Promise(function(_0x2a4c4c,_0x3bc044){return db[_0x51a8('0x1a')][_0x51a8('0x1b')](_0x2217ce['body'],{'raw':_0x2217ce[_0x51a8('0x1c')]?_0x2217ce['options'][_0x51a8('0x1d')]===undefined?!![]:![]:!![]})[_0x51a8('0xd')](function(_0x8bda40){logger[_0x51a8('0xe')]('CreateSmsMessage',_0x2217ce);logger[_0x51a8('0x11')]('CreateSmsMessage',_0x2217ce,JSON['stringify'](_0x8bda40));_0x2a4c4c(_0x8bda40);})[_0x51a8('0x18')](function(_0x52e503){logger[_0x51a8('0x14')](_0x51a8('0x19'),_0x52e503[_0x51a8('0x16')],_0x2217ce);_0x3bc044(_0x2f2681[_0x51a8('0x14')](0x1f4,_0x52e503[_0x51a8('0x16')]));});});};
\ No newline at end of file
+var _0x0b0e=['message','result','SmsMessage','create','body','options','CreateSmsMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s'];(function(_0x302547,_0x4196b2){var _0x3a9ae8=function(_0xa9fe57){while(--_0xa9fe57){_0x302547['push'](_0x302547['shift']());}};_0x3a9ae8(++_0x4196b2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0x0b0e[_0x5976f8];return _0x179715;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateSmsMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateSmsMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});};
\ No newline at end of file
index 995a341..0bfc8e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb96f=['remove','update','emit','removeListener','register','length','smsMessage:','save'];(function(_0x2fb128,_0x12d2f2){var _0x5494c8=function(_0x5b8bb7){while(--_0x5b8bb7){_0x2fb128['push'](_0x2fb128['shift']());}};_0x5494c8(++_0x12d2f2);}(_0xb96f,0xe7));var _0xfb96=function(_0x5d9793,_0x2300a3){_0x5d9793=_0x5d9793-0x0;var _0x20adbd=_0xb96f[_0x5d9793];return _0x20adbd;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xfb96('0x0'),_0xfb96('0x1'),_0xfb96('0x2')];function createListener(_0x3b2a0f,_0xf3dd27){return function(_0x26f79b){_0xf3dd27[_0xfb96('0x3')](_0x3b2a0f,_0x26f79b);};}function removeListener(_0x31997e,_0x725444){return function(){SmsMessageEvents[_0xfb96('0x4')](_0x31997e,_0x725444);};}exports[_0xfb96('0x5')]=function(_0x685b0a){for(var _0x556c53=0x0,_0x39a4d1=events[_0xfb96('0x6')];_0x556c53<_0x39a4d1;_0x556c53++){var _0x3556e1=events[_0x556c53];var _0x22ce24=createListener(_0xfb96('0x7')+_0x3556e1,_0x685b0a);SmsMessageEvents['on'](_0x3556e1,_0x22ce24);}};
\ No newline at end of file
+var _0x12dd=['save','remove','update','removeListener','length','smsMessage:'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x12dd,0xa8));var _0xd12d=function(_0x1cc3ce,_0x43791e){_0x1cc3ce=_0x1cc3ce-0x0;var _0x4ac6ac=_0x12dd[_0x1cc3ce];return _0x4ac6ac;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xd12d('0x0'),_0xd12d('0x1'),_0xd12d('0x2')];function createListener(_0x37e464,_0x3b0725){return function(_0x374b2b){_0x3b0725['emit'](_0x37e464,_0x374b2b);};}function removeListener(_0x41abb4,_0x27bf14){return function(){SmsMessageEvents[_0xd12d('0x3')](_0x41abb4,_0x27bf14);};}exports['register']=function(_0x1ecf87){for(var _0x495d21=0x0,_0x270904=events[_0xd12d('0x4')];_0x495d21<_0x270904;_0x495d21++){var _0x4d7a95=events[_0x495d21];var _0x56a252=createListener(_0xd12d('0x5')+_0x4d7a95,_0x1ecf87);SmsMessageEvents['on'](_0x4d7a95,_0x56a252);}};
\ No newline at end of file
index a5649aa..6d98489 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d49=['/:id/users','getAgents','post','addAgents','destroy','removeTeams','delete','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams'];(function(_0x2d0d28,_0x3bb917){var _0x22c9eb=function(_0x465bce){while(--_0x465bce){_0x2d0d28['push'](_0x2d0d28['shift']());}};_0x22c9eb(++_0x3bb917);}(_0x4d49,0x141));var _0x94d4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4d49[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0x94d4('0x0'));var path=require('path');var timeout=require(_0x94d4('0x1'));var express=require(_0x94d4('0x2'));var router=express[_0x94d4('0x3')]();var auth=require(_0x94d4('0x4'));var interaction=require(_0x94d4('0x5'));var config=require(_0x94d4('0x6'));var controller=require(_0x94d4('0x7'));router[_0x94d4('0x8')]('/',auth[_0x94d4('0x9')](),controller['index']);router[_0x94d4('0x8')](_0x94d4('0xa'),auth[_0x94d4('0x9')](),controller[_0x94d4('0xb')]);router[_0x94d4('0x8')](_0x94d4('0xc'),auth['isAuthenticated'](),controller[_0x94d4('0xd')]);router[_0x94d4('0x8')]('/:id/members',auth[_0x94d4('0x9')](),controller[_0x94d4('0xe')]);router[_0x94d4('0x8')](_0x94d4('0xf'),auth['isAuthenticated'](),controller[_0x94d4('0x10')]);router[_0x94d4('0x8')](_0x94d4('0x11'),auth[_0x94d4('0x9')](),controller[_0x94d4('0x12')]);router[_0x94d4('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x94d4('0xf'),auth[_0x94d4('0x9')](),controller['addTeams']);router[_0x94d4('0x13')](_0x94d4('0x11'),auth['isAuthenticated'](),controller[_0x94d4('0x14')]);router['put'](_0x94d4('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x94d4('0xc'),auth[_0x94d4('0x9')](),controller[_0x94d4('0x15')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x94d4('0x16')]);router[_0x94d4('0x17')](_0x94d4('0x11'),auth[_0x94d4('0x9')](),controller[_0x94d4('0x18')]);module[_0x94d4('0x19')]=router;
\ No newline at end of file
+var _0x9f02=['destroy','delete','removeTeams','removeAgents','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','show','/:id/members','/:id/users','getAgents','isAuthenticated','create','post','/:id/teams','addTeams','put','update'];(function(_0x5d8f42,_0x44e3ed){var _0x22f1c3=function(_0x1eceeb){while(--_0x1eceeb){_0x5d8f42['push'](_0x5d8f42['shift']());}};_0x22f1c3(++_0x44e3ed);}(_0x9f02,0x68));var _0x29f0=function(_0xcbb7f7,_0x299988){_0xcbb7f7=_0xcbb7f7-0x0;var _0x1b6927=_0x9f02[_0xcbb7f7];return _0x1b6927;};'use strict';var multer=require(_0x29f0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x29f0('0x1'));var router=express[_0x29f0('0x2')]();var auth=require(_0x29f0('0x3'));var interaction=require(_0x29f0('0x4'));var config=require(_0x29f0('0x5'));var controller=require('./smsQueue.controller');router[_0x29f0('0x6')]('/',auth['isAuthenticated'](),controller[_0x29f0('0x7')]);router[_0x29f0('0x6')](_0x29f0('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x29f0('0x9'),auth['isAuthenticated'](),controller[_0x29f0('0xa')]);router[_0x29f0('0x6')](_0x29f0('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0x29f0('0x6')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x29f0('0xc'),auth['isAuthenticated'](),controller[_0x29f0('0xd')]);router['post']('/',auth[_0x29f0('0xe')](),controller[_0x29f0('0xf')]);router[_0x29f0('0x10')](_0x29f0('0x11'),auth['isAuthenticated'](),controller[_0x29f0('0x12')]);router[_0x29f0('0x10')]('/:id/users',auth[_0x29f0('0xe')](),controller['addAgents']);router[_0x29f0('0x13')]('/:id',auth[_0x29f0('0xe')](),controller[_0x29f0('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x29f0('0x15')]);router[_0x29f0('0x16')](_0x29f0('0x11'),auth['isAuthenticated'](),controller[_0x29f0('0x17')]);router[_0x29f0('0x16')](_0x29f0('0xc'),auth[_0x29f0('0xe')](),controller[_0x29f0('0x18')]);module['exports']=router;
\ No newline at end of file
index fd84aca..8966757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e39=['ENUM','rrmemory','roundrobin','exports','STRING','name','INTEGER'];(function(_0x1fd622,_0x96bedc){var _0x490623=function(_0x54627f){while(--_0x54627f){_0x1fd622['push'](_0x1fd622['shift']());}};_0x490623(++_0x96bedc);}(_0x1e39,0x145));var _0x91e3=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0x1e39[_0x8560d3];return _0x33b1b5;};'use strict';var Sequelize=require('sequelize');module[_0x91e3('0x0')]={'name':{'type':Sequelize[_0x91e3('0x1')],'unique':_0x91e3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x91e3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x91e3('0x4')](_0x91e3('0x5'),'beepall',_0x91e3('0x6'))}};
\ No newline at end of file
+var _0x935e=['exports','STRING','INTEGER','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x935e,0x163));var _0xe935=function(_0x151a0c,_0x3d382b){_0x151a0c=_0x151a0c-0x0;var _0x25a73e=_0x935e[_0x151a0c];return _0x25a73e;};'use strict';var Sequelize=require(_0xe935('0x0'));module[_0xe935('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe935('0x2')]},'timeout':{'type':Sequelize[_0xe935('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}};
\ No newline at end of file
index 36fac31..e331017 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x805b=['updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','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?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','fieldName','key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','offset','sort','where','merge','type','filter','includeAll','SmsQueue','findAll','rows','catch','show','rawAttributes','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','order','pick','SmsQueueId','User','findAndCountAll','agent','format','%s/%s','SIP','smsPause','createdAt'];(function(_0x45e13f,_0x145000){var _0x572fb9=function(_0xd9f757){while(--_0xd9f757){_0x45e13f['push'](_0x45e13f['shift']());}};_0x572fb9(++_0x145000);}(_0x805b,0x1d5));var _0xb805=function(_0xf1cb2f,_0xcec434){_0xf1cb2f=_0xf1cb2f-0x0;var _0x1c2b02=_0x805b[_0xf1cb2f];return _0x1c2b02;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb805('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb805('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb805('0x2'));var moment=require('moment');var BPromise=require(_0xb805('0x3'));var Mustache=require(_0xb805('0x4'));var util=require(_0xb805('0x5'));var path=require(_0xb805('0x6'));var sox=require(_0xb805('0x7'));var csv=require(_0xb805('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb805('0x9'));var squel=require(_0xb805('0xa'));var crypto=require('crypto');var jsforce=require(_0xb805('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb805('0x8'));var querystring=require(_0xb805('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb805('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xb805('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb805('0xf'))('api');var utils=require(_0xb805('0x10'));var config=require('../../config/environment');var db=require(_0xb805('0x11'))['db'];config[_0xb805('0x12')]=_['defaults'](config[_0xb805('0x12')],{'host':_0xb805('0x13'),'port':0x18eb});var socket=require(_0xb805('0x14'))(new Redis(config[_0xb805('0x12')]));require('./smsQueue.socket')[_0xb805('0x15')](socket);function respondWithStatusCode(_0x2bebaa,_0x45cfb0){_0x45cfb0=_0x45cfb0||0xcc;return function(_0x35f063){if(_0x35f063){return _0x2bebaa['sendStatus'](_0x45cfb0);}return _0x2bebaa[_0xb805('0x16')](_0x45cfb0)[_0xb805('0x17')]();};}function respondWithResult(_0x461c0d,_0x408219){_0x408219=_0x408219||0xc8;return function(_0x12da7d){if(_0x12da7d){return _0x461c0d[_0xb805('0x16')](_0x408219)['json'](_0x12da7d);}};}function respondWithFilteredResult(_0x4c9758,_0x288785){return function(_0x45902e){if(_0x45902e){var _0x338f00=_0x45902e[_0xb805('0x18')],_0xdf3de3=_0x288785['offset'],_0x35e22b=_0x288785['offset']+_0x288785[_0xb805('0x19')],_0x1b597c;if(_0x35e22b>=_0x338f00){_0x35e22b=_0x338f00;_0x1b597c=0xc8;}else{_0x1b597c=0xce;}_0x4c9758[_0xb805('0x16')](_0x1b597c);return _0x4c9758['set'](_0xb805('0x1a'),_0xdf3de3+'-'+_0x35e22b+'/'+_0x338f00)[_0xb805('0x1b')](_0x45902e);}return null;};}function patchUpdates(_0x979b45){return function(_0x90c788){try{jsonpatch[_0xb805('0x1c')](_0x90c788,_0x979b45,!![]);}catch(_0x2fb0a9){return BPromise[_0xb805('0x1d')](_0x2fb0a9);}return _0x90c788[_0xb805('0x1e')]();};}function saveUpdates(_0xbd2db3,_0x3fa38f){return function(_0xf00845){if(_0xf00845){return _0xf00845[_0xb805('0x1f')](_0xbd2db3)[_0xb805('0x20')](function(_0x577768){return _0x577768;});}return null;};}function removeEntity(_0x456175,_0x22e242){return function(_0xea848b){if(_0xea848b){return _0xea848b[_0xb805('0x21')]()[_0xb805('0x20')](function(){var _0x42afe6=_0xea848b[_0xb805('0x22')]({'plain':!![]});var _0x48f052='SmsQueues';return db[_0xb805('0x23')][_0xb805('0x21')]({'where':{'type':_0x48f052,'resourceId':_0x42afe6['id']}})[_0xb805('0x20')](function(){return _0xea848b;});})[_0xb805('0x20')](function(){_0x456175['status'](0xcc)[_0xb805('0x17')]();});}};}function handleEntityNotFound(_0x56f058,_0x4c9939){return function(_0x1a8007){if(!_0x1a8007){_0x56f058['sendStatus'](0x194);}return _0x1a8007;};}function handleError(_0xb2a064,_0x3c65c7){_0x3c65c7=_0x3c65c7||0x1f4;return function(_0x393128){logger[_0xb805('0x24')](_0x393128[_0xb805('0x25')]);if(_0x393128[_0xb805('0x26')]){delete _0x393128[_0xb805('0x26')];}_0xb2a064[_0xb805('0x16')](_0x3c65c7)[_0xb805('0x27')](_0x393128);};}exports[_0xb805('0x28')]=function(_0x6cbdbf,_0x4eaa3b){var _0x5d1627={},_0x480fab={},_0x1a2444={'count':0x0,'rows':[]};var _0x291380=_[_0xb805('0x29')](db['SmsQueue']['rawAttributes'],function(_0x5bd284){return{'name':_0x5bd284[_0xb805('0x2a')],'type':_0x5bd284['type'][_0xb805('0x2b')]};});_0x480fab[_0xb805('0x2c')]=_[_0xb805('0x29')](_0x291380,'name');_0x480fab['query']=_[_0xb805('0x2d')](_0x6cbdbf['query']);_0x480fab[_0xb805('0x2e')]=_[_0xb805('0x2f')](_0x480fab['model'],_0x480fab['query']);_0x5d1627['attributes']=_[_0xb805('0x2f')](_0x480fab[_0xb805('0x2c')],qs[_0xb805('0x30')](_0x6cbdbf[_0xb805('0x31')][_0xb805('0x30')]));_0x5d1627[_0xb805('0x32')]=_0x5d1627[_0xb805('0x32')][_0xb805('0x33')]?_0x5d1627[_0xb805('0x32')]:_0x480fab[_0xb805('0x2c')];if(!_0x6cbdbf[_0xb805('0x31')][_0xb805('0x34')](_0xb805('0x35'))){_0x5d1627[_0xb805('0x19')]=qs[_0xb805('0x19')](_0x6cbdbf[_0xb805('0x31')][_0xb805('0x19')]);_0x5d1627[_0xb805('0x36')]=qs['offset'](_0x6cbdbf['query'][_0xb805('0x36')]);}_0x5d1627['order']=qs[_0xb805('0x37')](_0x6cbdbf[_0xb805('0x31')]['sort']);_0x5d1627[_0xb805('0x38')]=qs[_0xb805('0x2e')](_['pick'](_0x6cbdbf[_0xb805('0x31')],_0x480fab['filters']),_0x291380);if(_0x6cbdbf[_0xb805('0x31')]['filter']){_0x5d1627[_0xb805('0x38')]=_[_0xb805('0x39')](_0x5d1627[_0xb805('0x38')],{'$or':_[_0xb805('0x29')](_0x291380,function(_0x86b113){if(_0x86b113[_0xb805('0x3a')]!=='VIRTUAL'){var _0x51a822={};_0x51a822[_0x86b113[_0xb805('0x26')]]={'$like':'%'+_0x6cbdbf[_0xb805('0x31')][_0xb805('0x3b')]+'%'};return _0x51a822;}})});}_0x5d1627=_[_0xb805('0x39')]({},_0x5d1627,_0x6cbdbf['options']);var _0x49f14c={'where':_0x5d1627['where']};return db['SmsQueue'][_0xb805('0x18')](_0x49f14c)[_0xb805('0x20')](function(_0x48f444){_0x1a2444[_0xb805('0x18')]=_0x48f444;if(_0x6cbdbf['query'][_0xb805('0x3c')]){_0x5d1627['include']=[{'all':!![]}];}return db[_0xb805('0x3d')][_0xb805('0x3e')](_0x5d1627);})[_0xb805('0x20')](function(_0x15e417){_0x1a2444[_0xb805('0x3f')]=_0x15e417;return _0x1a2444;})[_0xb805('0x20')](respondWithFilteredResult(_0x4eaa3b,_0x5d1627))[_0xb805('0x40')](handleError(_0x4eaa3b,null));};exports[_0xb805('0x41')]=function(_0x2c6e3b,_0x127197){var _0x9ee36d={'raw':!![],'where':{'id':_0x2c6e3b['params']['id']}},_0x4251ad={};_0x4251ad[_0xb805('0x2c')]=_[_0xb805('0x2d')](db[_0xb805('0x3d')][_0xb805('0x42')]);_0x4251ad[_0xb805('0x31')]=_[_0xb805('0x2d')](_0x2c6e3b[_0xb805('0x31')]);_0x4251ad['filters']=_[_0xb805('0x2f')](_0x4251ad[_0xb805('0x2c')],_0x4251ad[_0xb805('0x31')]);_0x9ee36d[_0xb805('0x32')]=_['intersection'](_0x4251ad[_0xb805('0x2c')],qs[_0xb805('0x30')](_0x2c6e3b[_0xb805('0x31')]['fields']));_0x9ee36d[_0xb805('0x32')]=_0x9ee36d[_0xb805('0x32')][_0xb805('0x33')]?_0x9ee36d[_0xb805('0x32')]:_0x4251ad[_0xb805('0x2c')];if(_0x2c6e3b['query'][_0xb805('0x3c')]){_0x9ee36d[_0xb805('0x43')]=[{'all':!![]}];}_0x9ee36d=_[_0xb805('0x39')]({},_0x9ee36d,_0x2c6e3b[_0xb805('0x44')]);return db[_0xb805('0x3d')][_0xb805('0x45')](_0x9ee36d)[_0xb805('0x20')](handleEntityNotFound(_0x127197,null))[_0xb805('0x20')](respondWithResult(_0x127197,null))[_0xb805('0x40')](handleError(_0x127197,null));};exports[_0xb805('0x46')]=function(_0x42d654,_0x2f9868){return db[_0xb805('0x3d')][_0xb805('0x46')](_0x42d654[_0xb805('0x47')],{})['then'](function(_0x4e2cb){var _0x300ef1=_0x42d654[_0xb805('0x48')][_0xb805('0x22')]({'plain':!![]});if(!_0x300ef1)throw new Error(_0xb805('0x49'));if(_0x300ef1[_0xb805('0x4a')]==='user'){var _0x2ffc4b=_0x4e2cb[_0xb805('0x22')]({'plain':!![]});var _0x3606ad=_0xb805('0x4b');return db[_0xb805('0x4c')][_0xb805('0x45')]({'where':{'name':_0x3606ad,'userProfileId':_0x300ef1[_0xb805('0x4d')]},'raw':!![]})[_0xb805('0x20')](function(_0xa0d099){if(_0xa0d099&&_0xa0d099['autoAssociation']===0x0){return db['UserProfileResource'][_0xb805('0x46')]({'name':_0x2ffc4b[_0xb805('0x26')],'resourceId':_0x2ffc4b['id'],'type':_0xa0d099[_0xb805('0x26')],'sectionId':_0xa0d099['id']},{})[_0xb805('0x20')](function(){return _0x4e2cb;});}else{return _0x4e2cb;}})['catch'](function(_0x508044){logger[_0xb805('0x24')](_0xb805('0x4e'),_0x508044);throw _0x508044;});}return _0x4e2cb;})['then'](respondWithResult(_0x2f9868,0xc9))[_0xb805('0x40')](handleError(_0x2f9868,null));};exports[_0xb805('0x1f')]=function(_0x4a436f,_0x422817){if(_0x4a436f['body']['id']){delete _0x4a436f[_0xb805('0x47')]['id'];}return db[_0xb805('0x3d')][_0xb805('0x45')]({'where':{'id':_0x4a436f[_0xb805('0x4f')]['id']}})[_0xb805('0x20')](handleEntityNotFound(_0x422817,null))[_0xb805('0x20')](saveUpdates(_0x4a436f[_0xb805('0x47')],null))[_0xb805('0x20')](respondWithResult(_0x422817,null))[_0xb805('0x40')](handleError(_0x422817,null));};exports[_0xb805('0x21')]=function(_0xbaed79,_0xa6e602){return db[_0xb805('0x3d')]['find']({'where':{'id':_0xbaed79[_0xb805('0x4f')]['id']}})[_0xb805('0x20')](handleEntityNotFound(_0xa6e602,null))[_0xb805('0x20')](removeEntity(_0xa6e602,null))[_0xb805('0x40')](handleError(_0xa6e602,null));};exports[_0xb805('0x50')]=function(_0x153c19,_0x2b1b09){return db['SmsQueue'][_0xb805('0x50')]()['then'](respondWithResult(_0x2b1b09,null))[_0xb805('0x40')](handleError(_0x2b1b09,null));};exports[_0xb805('0x51')]=function(_0x525281,_0x23c4ce,_0x55d6ca){var _0x3970e6={'raw':!![],'where':{}},_0x327f8a={},_0x313f4e;return db[_0xb805('0x3d')][_0xb805('0x52')]({'where':{'id':_0x525281[_0xb805('0x4f')]['id']}})['then'](handleEntityNotFound(_0x23c4ce,null))[_0xb805('0x20')](function(_0x1eedad){if(_0x1eedad){_0x313f4e=_0x1eedad[_0xb805('0x22')]({'plain':!![]});_0x327f8a[_0xb805('0x2c')]=_[_0xb805('0x2d')](db[_0xb805('0x53')][_0xb805('0x42')]);_0x327f8a[_0xb805('0x31')]=_[_0xb805('0x2d')](_0x525281[_0xb805('0x31')]);_0x327f8a[_0xb805('0x2e')]=_[_0xb805('0x2f')](_0x327f8a[_0xb805('0x2c')],_0x327f8a[_0xb805('0x31')]);_0x3970e6['attributes']=_[_0xb805('0x2f')](_0x327f8a[_0xb805('0x2c')],qs[_0xb805('0x30')](_0x525281[_0xb805('0x31')][_0xb805('0x30')]));_0x3970e6['attributes']=_0x3970e6[_0xb805('0x32')][_0xb805('0x33')]?_0x3970e6[_0xb805('0x32')]:_0x327f8a['model'];if(!_0x525281['query'][_0xb805('0x34')](_0xb805('0x35'))){_0x3970e6[_0xb805('0x19')]=qs[_0xb805('0x19')](_0x525281[_0xb805('0x31')][_0xb805('0x19')]);_0x3970e6[_0xb805('0x36')]=qs['offset'](_0x525281['query'][_0xb805('0x36')]);}_0x3970e6[_0xb805('0x54')]=qs['sort'](_0x525281['query'][_0xb805('0x37')]);_0x3970e6['where']=qs[_0xb805('0x2e')](_[_0xb805('0x55')](_0x525281[_0xb805('0x31')],_0x327f8a[_0xb805('0x2e')]));_0x3970e6[_0xb805('0x38')][_0xb805('0x56')]=_0x1eedad['id'];if(_0x525281[_0xb805('0x31')]['filter']){_0x3970e6['where']=_[_0xb805('0x39')](_0x3970e6[_0xb805('0x38')],{'$or':_[_0xb805('0x29')](_0x3970e6[_0xb805('0x32')],function(_0x224932){var _0x265f82={};_0x265f82[_0x224932]={'$like':'%'+_0x525281['query'][_0xb805('0x3b')]+'%'};return _0x265f82;})});}_0x3970e6=_['merge']({},_0x3970e6,_0x525281[_0xb805('0x44')]);return db[_0xb805('0x53')][_0xb805('0x3e')](_0x3970e6);}})['then'](function(_0x588ef3){if(_0x588ef3){return db[_0xb805('0x57')][_0xb805('0x58')]({'where':{'id':_[_0xb805('0x29')](_0x588ef3,'UserId'),'role':_0xb805('0x59')},'attributes':['id',_0xb805('0x26'),'smsPause','updatedAt','createdAt']});}})[_0xb805('0x20')](function(_0x32eab0){if(_0x32eab0){return{'count':_0x32eab0[_0xb805('0x18')],'rows':_['map'](_0x32eab0[_0xb805('0x3f')],function(_0x8b2b81){return{'membername':_0x8b2b81[_0xb805('0x26')],'UserId':_0x8b2b81['id'],'queue_name':_0x313f4e['name'],'SmsQueueId':_0x313f4e['id'],'interface':util[_0xb805('0x5a')](_0xb805('0x5b'),_0xb805('0x5c'),_0x8b2b81[_0xb805('0x26')]),'penalty':0x0,'paused':_0x8b2b81[_0xb805('0x5d')],'createdAt':_0x8b2b81[_0xb805('0x5e')],'updatedAt':_0x8b2b81[_0xb805('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x23c4ce,_0x3970e6))['catch'](handleError(_0x23c4ce,null));};exports[_0xb805('0x60')]=function(_0x345448,_0x3f20c7,_0xb5caea){var _0x57a477={};var _0x4dec6c={};var _0x36f83c;var _0x5de8f8;return db[_0xb805('0x3d')][_0xb805('0x52')]({'where':{'id':_0x345448[_0xb805('0x4f')]['id']}})[_0xb805('0x20')](handleEntityNotFound(_0x3f20c7,null))[_0xb805('0x20')](function(_0x3795e9){if(_0x3795e9){_0x36f83c=_0x3795e9;_0x4dec6c[_0xb805('0x2c')]=_[_0xb805('0x2d')](db[_0xb805('0x61')]['rawAttributes']);_0x4dec6c[_0xb805('0x31')]=_[_0xb805('0x2d')](_0x345448[_0xb805('0x31')]);_0x4dec6c[_0xb805('0x2e')]=_[_0xb805('0x2f')](_0x4dec6c[_0xb805('0x2c')],_0x4dec6c[_0xb805('0x31')]);_0x57a477[_0xb805('0x32')]=_[_0xb805('0x2f')](_0x4dec6c['model'],qs[_0xb805('0x30')](_0x345448[_0xb805('0x31')][_0xb805('0x30')]));_0x57a477[_0xb805('0x32')]=_0x57a477[_0xb805('0x32')]['length']?_0x57a477[_0xb805('0x32')]:_0x4dec6c[_0xb805('0x2c')];_0x57a477[_0xb805('0x54')]=qs[_0xb805('0x37')](_0x345448[_0xb805('0x31')][_0xb805('0x37')]);_0x57a477['where']=qs[_0xb805('0x2e')](_[_0xb805('0x55')](_0x345448['query'],_0x4dec6c[_0xb805('0x2e')]));if(_0x345448['query'][_0xb805('0x3b')]){_0x57a477['where']=_[_0xb805('0x39')](_0x57a477[_0xb805('0x38')],{'$or':_['map'](_0x57a477[_0xb805('0x32')],function(_0x47b95e){var _0x45fcbf={};_0x45fcbf[_0x47b95e]={'$like':'%'+_0x345448['query']['filter']+'%'};return _0x45fcbf;})});}_0x57a477=_[_0xb805('0x39')]({},_0x57a477,_0x345448[_0xb805('0x44')]);return _0x36f83c[_0xb805('0x60')](_0x57a477);}})[_0xb805('0x20')](function(_0x220b60){if(_0x220b60){_0x5de8f8=_0x220b60[_0xb805('0x33')];if(!_0x345448['query'][_0xb805('0x34')](_0xb805('0x35'))){_0x57a477[_0xb805('0x19')]=qs[_0xb805('0x19')](_0x345448[_0xb805('0x31')][_0xb805('0x19')]);_0x57a477['offset']=qs[_0xb805('0x36')](_0x345448[_0xb805('0x31')][_0xb805('0x36')]);}return _0x36f83c[_0xb805('0x60')](_0x57a477);}})[_0xb805('0x20')](function(_0x287e65){if(_0x287e65){return _0x287e65?{'count':_0x5de8f8,'rows':_0x287e65}:null;}})[_0xb805('0x20')](respondWithResult(_0x3f20c7,null))[_0xb805('0x40')](handleError(_0x3f20c7,null));};exports[_0xb805('0x62')]=function(_0x4728fb,_0x2087cc,_0x65c473){var _0x9754e8=_0x4728fb[_0xb805('0x47')][_0xb805('0x63')];return db[_0xb805('0x61')]['findAll']({'where':{'id':_0x9754e8},'attributes':['id'],'include':[{'model':db[_0xb805('0x57')],'as':_0xb805('0x64'),'attributes':['id',_0xb805('0x26'),_0xb805('0x65'),_0xb805('0x66'),_0xb805('0x67')],'raw':!![]}]})[_0xb805('0x20')](function(_0x1fbabf){if(_0x1fbabf){var _0x5ea819=_[_0xb805('0x68')](_0x1fbabf,function(_0x81e465){var _0x528f30=_0x81e465[_0xb805('0x22')]({'plain':!![]});return _0x528f30[_0xb805('0x64')];});return db[_0xb805('0x3d')]['find']({'where':{'id':_0x4728fb[_0xb805('0x4f')]['id']}})['then'](function(_0x77d9f7){return db[_0xb805('0x69')][_0xb805('0x6a')](function(_0x33c5a3){return _0x77d9f7[_0xb805('0x62')](_0x9754e8,{'transaction':_0x33c5a3})[_0xb805('0x20')](function(){return BPromise['each'](_0x5ea819,function(_0x381dd0){return db[_0xb805('0x53')][_0xb805('0x6b')]({'where':{'UserId':_0x381dd0['id'],'SmsQueueId':_0x4728fb[_0xb805('0x4f')]['id']},'transaction':_0x33c5a3});});})[_0xb805('0x20')](function(){_0x5ea819[_0xb805('0x6c')](function(_0x1d9232){socket[_0xb805('0x6d')](_0xb805('0x6e'),{'UserId':_0x1d9232['id'],'SmsQueueId':_0x77d9f7['id']});});});});});}})[_0xb805('0x20')](respondWithStatusCode(_0x2087cc,null))['catch'](handleError(_0x2087cc,null));};exports[_0xb805('0x6f')]=function(_0x3a6363,_0x44db32,_0x4bc828){return db['Team'][_0xb805('0x3e')]({'where':{'id':_0x3a6363['query'][_0xb805('0x63')]},'attributes':['id'],'include':[{'model':db[_0xb805('0x57')],'as':_0xb805('0x64'),'attributes':['id'],'raw':!![]}]})[_0xb805('0x20')](handleEntityNotFound(_0x44db32,null))['then'](function(_0x140383){var _0x66c1bb=_[_0xb805('0x29')](_0x140383,'id');var _0x15f296=[];var _0x4f025c=[];var _0x4e96f9=squel[_0xb805('0x70')]();_0x4e96f9[_0xb805('0x71')]('tq.TeamId')[_0xb805('0x72')](_0xb805('0x73'),'tq')[_0xb805('0x74')](_0xb805('0x75'),'ut',_0xb805('0x76'))['where'](_0xb805('0x77'),_0x3a6363[_0xb805('0x4f')]['id']);for(var _0x49cb0b=0x0;_0x49cb0b<_0x140383[_0xb805('0x33')];_0x49cb0b+=0x1){let _0x457de6=_0x140383[_0x49cb0b];for(var _0x23e27f=0x0;_0x23e27f<_0x457de6[_0xb805('0x64')][_0xb805('0x33')];_0x23e27f+=0x1){let _0x1264cd=_0x457de6[_0xb805('0x64')][_0x23e27f];var _0x58e90c=_0x4e96f9[_0xb805('0x78')]();_0x58e90c[_0xb805('0x38')](_0xb805('0x79'),_0x1264cd['id']);_0x4f025c[_0xb805('0x7a')](db[_0xb805('0x69')][_0xb805('0x31')](_0x58e90c[_0xb805('0x7b')](),{'type':db[_0xb805('0x69')][_0xb805('0x7c')][_0xb805('0x7d')]})[_0xb805('0x20')](function(_0x427ce2){if(_0x427ce2[_0xb805('0x33')]===0x1){return _0x1264cd['id'];}else{var _0x2f81e8=_[_0xb805('0x7e')](_['map'](_0x427ce2,_0xb805('0x7f')),function(_0x3049c6){return _[_0xb805('0x80')](_0x66c1bb,_0x3049c6);});if(_0x2f81e8){return _0x1264cd['id'];}}}));}}return BPromise[_0xb805('0x81')](_0x4f025c)['then'](function(_0x535bab){_0x15f296=_(_0x15f296)[_0xb805('0x82')](_0x535bab)[_0xb805('0x83')]()[_0xb805('0x84')]();return db[_0xb805('0x3d')][_0xb805('0x45')]({'where':{'id':_0x3a6363[_0xb805('0x4f')]['id']}})['then'](function(_0x4963b9){return db['sequelize'][_0xb805('0x6a')](function(_0x528170){return _0x4963b9[_0xb805('0x6f')](_0x3a6363[_0xb805('0x31')][_0xb805('0x63')],{'transaction':_0x528170})[_0xb805('0x20')](function(){if(!_[_0xb805('0x85')](_0x15f296)){return _0x4963b9['removeAgents'](_0x15f296,{'transaction':_0x528170});}})[_0xb805('0x20')](function(){_0x15f296[_0xb805('0x6c')](function(_0x435593){socket[_0xb805('0x6d')](_0xb805('0x86'),{'UserId':_0x435593,'SmsQueueId':_0x4963b9['id']});});});});});});})[_0xb805('0x20')](respondWithStatusCode(_0x44db32,null))[_0xb805('0x40')](handleError(_0x44db32,null));};exports[_0xb805('0x87')]=function(_0xf39379,_0x47b26c,_0x124cba){return db[_0xb805('0x3d')]['find']({'where':{'id':_0xf39379[_0xb805('0x4f')]['id']}})[_0xb805('0x20')](handleEntityNotFound(_0x47b26c,null))[_0xb805('0x20')](function(_0x10ffe5){if(_0x10ffe5){return _0x10ffe5[_0xb805('0x87')](_0xf39379[_0xb805('0x47')][_0xb805('0x63')],_[_0xb805('0x88')](_0xf39379[_0xb805('0x47')],[_0xb805('0x63'),'id'])||{})[_0xb805('0x89')](function(_0x4dd1bd){for(var _0x4595c6=0x0;_0x4595c6<_0xf39379['body'][_0xb805('0x63')][_0xb805('0x33')];_0x4595c6+=0x1){socket['emit'](_0xb805('0x6e'),{'UserId':_0xf39379[_0xb805('0x47')][_0xb805('0x63')][_0x4595c6],'SmsQueueId':_0xf39379[_0xb805('0x4f')]['id']});}return _0x4dd1bd;});}})['then'](respondWithResult(_0x47b26c,null))[_0xb805('0x40')](handleError(_0x47b26c,null));};exports[_0xb805('0x8a')]=function(_0x23dc6e,_0x599796,_0x5eb458){return db[_0xb805('0x3d')][_0xb805('0x45')]({'where':{'id':_0x23dc6e[_0xb805('0x4f')]['id']}})[_0xb805('0x20')](handleEntityNotFound(_0x599796,null))[_0xb805('0x20')](function(_0x1c0b58){if(_0x1c0b58){return _0x1c0b58[_0xb805('0x8a')](_0x23dc6e[_0xb805('0x31')][_0xb805('0x63')])[_0xb805('0x20')](function(){if(_[_0xb805('0x8b')](_0x23dc6e[_0xb805('0x31')]['ids'])){for(var _0x344a9e=0x0;_0x344a9e<_0x23dc6e[_0xb805('0x31')]['ids'][_0xb805('0x33')];_0x344a9e+=0x1){socket[_0xb805('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x23dc6e[_0xb805('0x31')]['ids'][_0x344a9e]),'SmsQueueId':Number(_0x23dc6e['params']['id'])});}}else{socket[_0xb805('0x6d')](_0xb805('0x86'),{'UserId':Number(_0x23dc6e[_0xb805('0x31')]['ids']),'SmsQueueId':Number(_0x23dc6e['params']['id'])});}});}})[_0xb805('0x20')](respondWithStatusCode(_0x599796,null))[_0xb805('0x40')](handleError(_0x599796,null));};exports[_0xb805('0x8c')]=function(_0x17d7a5,_0x2bacf2,_0x480788){var _0x33d87d={};var _0x4135af={};var _0x517399;var _0xb6cedd;return db['SmsQueue']['findOne']({'where':{'id':_0x17d7a5[_0xb805('0x4f')]['id']}})[_0xb805('0x20')](handleEntityNotFound(_0x2bacf2,null))[_0xb805('0x20')](function(_0x25864e){if(_0x25864e){_0x517399=_0x25864e;_0x4135af[_0xb805('0x2c')]=_[_0xb805('0x2d')](db[_0xb805('0x57')][_0xb805('0x42')]);_0x4135af['query']=_[_0xb805('0x2d')](_0x17d7a5['query']);_0x4135af['filters']=_['intersection'](_0x4135af['model'],_0x4135af[_0xb805('0x31')]);_0x33d87d[_0xb805('0x32')]=_[_0xb805('0x2f')](_0x4135af['model'],qs['fields'](_0x17d7a5[_0xb805('0x31')][_0xb805('0x30')]));_0x33d87d[_0xb805('0x32')]=_0x33d87d[_0xb805('0x32')]['length']?_0x33d87d[_0xb805('0x32')]:_0x4135af[_0xb805('0x2c')];_0x33d87d[_0xb805('0x54')]=qs['sort'](_0x17d7a5[_0xb805('0x31')][_0xb805('0x37')]);_0x33d87d[_0xb805('0x38')]=qs[_0xb805('0x2e')](_[_0xb805('0x55')](_0x17d7a5[_0xb805('0x31')],_0x4135af[_0xb805('0x2e')]));if(_0x17d7a5[_0xb805('0x31')]['filter']){_0x33d87d[_0xb805('0x38')]=_[_0xb805('0x39')](_0x33d87d[_0xb805('0x38')],{'$or':_['map'](_0x33d87d[_0xb805('0x32')],function(_0x171a3d){var _0x2a9a69={};_0x2a9a69[_0x171a3d]={'$like':'%'+_0x17d7a5[_0xb805('0x31')][_0xb805('0x3b')]+'%'};return _0x2a9a69;})});}_0x33d87d=_['merge']({},_0x33d87d,_0x17d7a5[_0xb805('0x44')]);return _0x517399[_0xb805('0x8c')](_0x33d87d);}})[_0xb805('0x20')](function(_0x7ea6cb){if(_0x7ea6cb){_0xb6cedd=_0x7ea6cb['length'];if(!_0x17d7a5[_0xb805('0x31')][_0xb805('0x34')](_0xb805('0x35'))){_0x33d87d[_0xb805('0x19')]=qs[_0xb805('0x19')](_0x17d7a5['query'][_0xb805('0x19')]);_0x33d87d[_0xb805('0x36')]=qs[_0xb805('0x36')](_0x17d7a5['query']['offset']);}return _0x517399[_0xb805('0x8c')](_0x33d87d);}})[_0xb805('0x20')](function(_0x2ce67d){if(_0x2ce67d){return _0x2ce67d?{'count':_0xb6cedd,'rows':_0x2ce67d}:null;}})[_0xb805('0x20')](respondWithResult(_0x2bacf2,null))[_0xb805('0x40')](handleError(_0x2bacf2,null));};
\ No newline at end of file
+var _0x2497=['reject','save','update','destroy','get','SmsQueues','then','end','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','includeAll','include','SmsQueue','rows','catch','show','params','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','keys','order','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','smsPause','getTeams','Team','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','UserSmsQueue','forEach','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','ids','isEmpty','removeAgents','emit','addAgents','spread','userSmsQueue:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','count','offset','limit','Content-Range','json','apply'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x2497,0xee));var _0x7249=function(_0x500d61,_0x57f530){_0x500d61=_0x500d61-0x0;var _0x500395=_0x2497[_0x500d61];return _0x500395;};'use strict';var pdf=require(_0x7249('0x0'));var emlformat=require(_0x7249('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7249('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7249('0x3'));var moment=require(_0x7249('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7249('0x5'));var util=require('util');var path=require(_0x7249('0x6'));var sox=require(_0x7249('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7249('0x8'));var squel=require('squel');var crypto=require(_0x7249('0x9'));var jsforce=require(_0x7249('0xa'));var deskjs=require(_0x7249('0xb'));var toCsv=require(_0x7249('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7249('0xd'));var authService=require(_0x7249('0xe'));var qs=require(_0x7249('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7249('0x10'));var logger=require(_0x7249('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x7249('0x12'));var db=require(_0x7249('0x13'))['db'];config[_0x7249('0x14')]=_['defaults'](config[_0x7249('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x7249('0x15'))(new Redis(config[_0x7249('0x14')]));require(_0x7249('0x16'))[_0x7249('0x17')](socket);function respondWithStatusCode(_0x1f1dd0,_0x44d6a2){_0x44d6a2=_0x44d6a2||0xcc;return function(_0x596ee8){if(_0x596ee8){return _0x1f1dd0[_0x7249('0x18')](_0x44d6a2);}return _0x1f1dd0[_0x7249('0x19')](_0x44d6a2)['end']();};}function respondWithResult(_0x2c16e2,_0x2e07bc){_0x2e07bc=_0x2e07bc||0xc8;return function(_0xdfae34){if(_0xdfae34){return _0x2c16e2[_0x7249('0x19')](_0x2e07bc)['json'](_0xdfae34);}};}function respondWithFilteredResult(_0x18a9c3,_0x288b81){return function(_0x569e98){if(_0x569e98){var _0xf02b7f=_0x569e98[_0x7249('0x1a')],_0x198dba=_0x288b81[_0x7249('0x1b')],_0x243152=_0x288b81['offset']+_0x288b81[_0x7249('0x1c')],_0x1285cd;if(_0x243152>=_0xf02b7f){_0x243152=_0xf02b7f;_0x1285cd=0xc8;}else{_0x1285cd=0xce;}_0x18a9c3[_0x7249('0x19')](_0x1285cd);return _0x18a9c3['set'](_0x7249('0x1d'),_0x198dba+'-'+_0x243152+'/'+_0xf02b7f)[_0x7249('0x1e')](_0x569e98);}return null;};}function patchUpdates(_0x3690b6){return function(_0x39837f){try{jsonpatch[_0x7249('0x1f')](_0x39837f,_0x3690b6,!![]);}catch(_0x3642d5){return BPromise[_0x7249('0x20')](_0x3642d5);}return _0x39837f[_0x7249('0x21')]();};}function saveUpdates(_0x5d5144,_0x26ad7c){return function(_0x21d147){if(_0x21d147){return _0x21d147[_0x7249('0x22')](_0x5d5144)['then'](function(_0x32e384){return _0x32e384;});}return null;};}function removeEntity(_0x2ba5fa,_0x1a8322){return function(_0xcdb2d8){if(_0xcdb2d8){return _0xcdb2d8[_0x7249('0x23')]()['then'](function(){var _0x487612=_0xcdb2d8[_0x7249('0x24')]({'plain':!![]});var _0x48b941=_0x7249('0x25');return db['UserProfileResource'][_0x7249('0x23')]({'where':{'type':_0x48b941,'resourceId':_0x487612['id']}})[_0x7249('0x26')](function(){return _0xcdb2d8;});})['then'](function(){_0x2ba5fa[_0x7249('0x19')](0xcc)[_0x7249('0x27')]();});}};}function handleEntityNotFound(_0x838629,_0x1762d7){return function(_0x1055f9){if(!_0x1055f9){_0x838629[_0x7249('0x18')](0x194);}return _0x1055f9;};}function handleError(_0x3a7c6a,_0x1b171f){_0x1b171f=_0x1b171f||0x1f4;return function(_0x18a049){logger['error'](_0x18a049[_0x7249('0x28')]);if(_0x18a049['name']){delete _0x18a049['name'];}_0x3a7c6a[_0x7249('0x19')](_0x1b171f)[_0x7249('0x29')](_0x18a049);};}exports['index']=function(_0x3ac855,_0x2e111d){var _0x1531d6={},_0x46a854={},_0x5044a0={'count':0x0,'rows':[]};var _0x2d264b=_[_0x7249('0x2a')](db['SmsQueue'][_0x7249('0x2b')],function(_0x162ba5){return{'name':_0x162ba5[_0x7249('0x2c')],'type':_0x162ba5[_0x7249('0x2d')][_0x7249('0x2e')]};});_0x46a854[_0x7249('0x2f')]=_[_0x7249('0x2a')](_0x2d264b,_0x7249('0x30'));_0x46a854[_0x7249('0x31')]=_['keys'](_0x3ac855[_0x7249('0x31')]);_0x46a854['filters']=_[_0x7249('0x32')](_0x46a854[_0x7249('0x2f')],_0x46a854[_0x7249('0x31')]);_0x1531d6[_0x7249('0x33')]=_[_0x7249('0x32')](_0x46a854['model'],qs['fields'](_0x3ac855[_0x7249('0x31')]['fields']));_0x1531d6[_0x7249('0x33')]=_0x1531d6[_0x7249('0x33')]['length']?_0x1531d6[_0x7249('0x33')]:_0x46a854[_0x7249('0x2f')];if(!_0x3ac855[_0x7249('0x31')][_0x7249('0x34')](_0x7249('0x35'))){_0x1531d6[_0x7249('0x1c')]=qs['limit'](_0x3ac855[_0x7249('0x31')]['limit']);_0x1531d6[_0x7249('0x1b')]=qs[_0x7249('0x1b')](_0x3ac855['query'][_0x7249('0x1b')]);}_0x1531d6['order']=qs[_0x7249('0x36')](_0x3ac855[_0x7249('0x31')]['sort']);_0x1531d6[_0x7249('0x37')]=qs['filters'](_[_0x7249('0x38')](_0x3ac855['query'],_0x46a854[_0x7249('0x39')]),_0x2d264b);if(_0x3ac855[_0x7249('0x31')]['filter']){_0x1531d6[_0x7249('0x37')]=_[_0x7249('0x3a')](_0x1531d6[_0x7249('0x37')],{'$or':_[_0x7249('0x2a')](_0x2d264b,function(_0x3abfe3){if(_0x3abfe3['type']!==_0x7249('0x3b')){var _0x4cdd29={};_0x4cdd29[_0x3abfe3[_0x7249('0x30')]]={'$like':'%'+_0x3ac855[_0x7249('0x31')][_0x7249('0x3c')]+'%'};return _0x4cdd29;}})});}_0x1531d6=_[_0x7249('0x3a')]({},_0x1531d6,_0x3ac855['options']);var _0x2f6673={'where':_0x1531d6['where']};return db['SmsQueue'][_0x7249('0x1a')](_0x2f6673)[_0x7249('0x26')](function(_0x19a94d){_0x5044a0[_0x7249('0x1a')]=_0x19a94d;if(_0x3ac855[_0x7249('0x31')][_0x7249('0x3d')]){_0x1531d6[_0x7249('0x3e')]=[{'all':!![]}];}return db[_0x7249('0x3f')]['findAll'](_0x1531d6);})[_0x7249('0x26')](function(_0x166abe){_0x5044a0[_0x7249('0x40')]=_0x166abe;return _0x5044a0;})[_0x7249('0x26')](respondWithFilteredResult(_0x2e111d,_0x1531d6))[_0x7249('0x41')](handleError(_0x2e111d,null));};exports[_0x7249('0x42')]=function(_0x441ddc,_0x2e9905){var _0x280eac={'raw':!![],'where':{'id':_0x441ddc[_0x7249('0x43')]['id']}},_0xaaa364={};_0xaaa364[_0x7249('0x2f')]=_['keys'](db['SmsQueue']['rawAttributes']);_0xaaa364['query']=_['keys'](_0x441ddc['query']);_0xaaa364[_0x7249('0x39')]=_[_0x7249('0x32')](_0xaaa364['model'],_0xaaa364[_0x7249('0x31')]);_0x280eac[_0x7249('0x33')]=_[_0x7249('0x32')](_0xaaa364[_0x7249('0x2f')],qs[_0x7249('0x44')](_0x441ddc[_0x7249('0x31')][_0x7249('0x44')]));_0x280eac['attributes']=_0x280eac[_0x7249('0x33')][_0x7249('0x45')]?_0x280eac[_0x7249('0x33')]:_0xaaa364[_0x7249('0x2f')];if(_0x441ddc['query'][_0x7249('0x3d')]){_0x280eac[_0x7249('0x3e')]=[{'all':!![]}];}_0x280eac=_[_0x7249('0x3a')]({},_0x280eac,_0x441ddc[_0x7249('0x46')]);return db[_0x7249('0x3f')][_0x7249('0x47')](_0x280eac)['then'](handleEntityNotFound(_0x2e9905,null))[_0x7249('0x26')](respondWithResult(_0x2e9905,null))[_0x7249('0x41')](handleError(_0x2e9905,null));};exports[_0x7249('0x48')]=function(_0xf94e4,_0x5225e8){return db[_0x7249('0x3f')]['create'](_0xf94e4[_0x7249('0x49')],{})['then'](function(_0x358385){var _0x5e1b8b=_0xf94e4[_0x7249('0x4a')][_0x7249('0x24')]({'plain':!![]});if(!_0x5e1b8b)throw new Error(_0x7249('0x4b'));if(_0x5e1b8b[_0x7249('0x4c')]===_0x7249('0x4a')){var _0xb2fc65=_0x358385['get']({'plain':!![]});var _0x53c4e7=_0x7249('0x25');return db[_0x7249('0x4d')]['find']({'where':{'name':_0x53c4e7,'userProfileId':_0x5e1b8b[_0x7249('0x4e')]},'raw':!![]})[_0x7249('0x26')](function(_0x25cfef){if(_0x25cfef&&_0x25cfef[_0x7249('0x4f')]===0x0){return db[_0x7249('0x50')][_0x7249('0x48')]({'name':_0xb2fc65[_0x7249('0x30')],'resourceId':_0xb2fc65['id'],'type':_0x25cfef['name'],'sectionId':_0x25cfef['id']},{})[_0x7249('0x26')](function(){return _0x358385;});}else{return _0x358385;}})[_0x7249('0x41')](function(_0x5f1e2e){logger[_0x7249('0x51')](_0x7249('0x52'),_0x5f1e2e);throw _0x5f1e2e;});}return _0x358385;})[_0x7249('0x26')](respondWithResult(_0x5225e8,0xc9))[_0x7249('0x41')](handleError(_0x5225e8,null));};exports['update']=function(_0x3c5f73,_0x31288a){if(_0x3c5f73['body']['id']){delete _0x3c5f73[_0x7249('0x49')]['id'];}return db[_0x7249('0x3f')]['find']({'where':{'id':_0x3c5f73['params']['id']}})[_0x7249('0x26')](handleEntityNotFound(_0x31288a,null))[_0x7249('0x26')](saveUpdates(_0x3c5f73[_0x7249('0x49')],null))[_0x7249('0x26')](respondWithResult(_0x31288a,null))['catch'](handleError(_0x31288a,null));};exports['destroy']=function(_0x27c6ee,_0x158a30){return db[_0x7249('0x3f')][_0x7249('0x47')]({'where':{'id':_0x27c6ee[_0x7249('0x43')]['id']}})[_0x7249('0x26')](handleEntityNotFound(_0x158a30,null))['then'](removeEntity(_0x158a30,null))[_0x7249('0x41')](handleError(_0x158a30,null));};exports[_0x7249('0x53')]=function(_0x42879c,_0x244b1a){return db[_0x7249('0x3f')][_0x7249('0x53')]()[_0x7249('0x26')](respondWithResult(_0x244b1a,null))[_0x7249('0x41')](handleError(_0x244b1a,null));};exports[_0x7249('0x54')]=function(_0x2cc5ad,_0x3beeac,_0x3fc84a){var _0x574f82={'raw':!![],'where':{}},_0x1b1e4f={},_0x1bff2f;return db[_0x7249('0x3f')][_0x7249('0x55')]({'where':{'id':_0x2cc5ad[_0x7249('0x43')]['id']}})[_0x7249('0x26')](handleEntityNotFound(_0x3beeac,null))['then'](function(_0x311f1b){if(_0x311f1b){_0x1bff2f=_0x311f1b[_0x7249('0x24')]({'plain':!![]});_0x1b1e4f[_0x7249('0x2f')]=_['keys'](db['UserSmsQueue'][_0x7249('0x2b')]);_0x1b1e4f[_0x7249('0x31')]=_[_0x7249('0x56')](_0x2cc5ad[_0x7249('0x31')]);_0x1b1e4f[_0x7249('0x39')]=_[_0x7249('0x32')](_0x1b1e4f[_0x7249('0x2f')],_0x1b1e4f[_0x7249('0x31')]);_0x574f82['attributes']=_[_0x7249('0x32')](_0x1b1e4f[_0x7249('0x2f')],qs[_0x7249('0x44')](_0x2cc5ad[_0x7249('0x31')][_0x7249('0x44')]));_0x574f82[_0x7249('0x33')]=_0x574f82[_0x7249('0x33')][_0x7249('0x45')]?_0x574f82['attributes']:_0x1b1e4f[_0x7249('0x2f')];if(!_0x2cc5ad['query'][_0x7249('0x34')]('nolimit')){_0x574f82['limit']=qs[_0x7249('0x1c')](_0x2cc5ad[_0x7249('0x31')][_0x7249('0x1c')]);_0x574f82['offset']=qs[_0x7249('0x1b')](_0x2cc5ad[_0x7249('0x31')][_0x7249('0x1b')]);}_0x574f82[_0x7249('0x57')]=qs[_0x7249('0x36')](_0x2cc5ad[_0x7249('0x31')][_0x7249('0x36')]);_0x574f82[_0x7249('0x37')]=qs[_0x7249('0x39')](_['pick'](_0x2cc5ad['query'],_0x1b1e4f[_0x7249('0x39')]));_0x574f82['where'][_0x7249('0x58')]=_0x311f1b['id'];if(_0x2cc5ad[_0x7249('0x31')][_0x7249('0x3c')]){_0x574f82['where']=_[_0x7249('0x3a')](_0x574f82[_0x7249('0x37')],{'$or':_[_0x7249('0x2a')](_0x574f82[_0x7249('0x33')],function(_0x78ce2e){var _0x3a2a27={};_0x3a2a27[_0x78ce2e]={'$like':'%'+_0x2cc5ad[_0x7249('0x31')][_0x7249('0x3c')]+'%'};return _0x3a2a27;})});}_0x574f82=_[_0x7249('0x3a')]({},_0x574f82,_0x2cc5ad['options']);return db['UserSmsQueue'][_0x7249('0x59')](_0x574f82);}})[_0x7249('0x26')](function(_0x2cd45c){if(_0x2cd45c){return db[_0x7249('0x5a')][_0x7249('0x5b')]({'where':{'id':_['map'](_0x2cd45c,_0x7249('0x5c')),'role':_0x7249('0x5d')},'attributes':['id','name','smsPause',_0x7249('0x5e'),_0x7249('0x5f')]});}})[_0x7249('0x26')](function(_0x1b14d5){if(_0x1b14d5){return{'count':_0x1b14d5[_0x7249('0x1a')],'rows':_[_0x7249('0x2a')](_0x1b14d5[_0x7249('0x40')],function(_0x1c4c5f){return{'membername':_0x1c4c5f[_0x7249('0x30')],'UserId':_0x1c4c5f['id'],'queue_name':_0x1bff2f[_0x7249('0x30')],'SmsQueueId':_0x1bff2f['id'],'interface':util[_0x7249('0x60')](_0x7249('0x61'),'SIP',_0x1c4c5f[_0x7249('0x30')]),'penalty':0x0,'paused':_0x1c4c5f[_0x7249('0x62')],'createdAt':_0x1c4c5f[_0x7249('0x5f')],'updatedAt':_0x1c4c5f[_0x7249('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3beeac,_0x574f82))[_0x7249('0x41')](handleError(_0x3beeac,null));};exports[_0x7249('0x63')]=function(_0x1e26f8,_0x34f222,_0x1ff19){var _0x57cbe1={};var _0x16cfe2={};var _0x78ed64;var _0x30723e;return db[_0x7249('0x3f')][_0x7249('0x55')]({'where':{'id':_0x1e26f8['params']['id']}})[_0x7249('0x26')](handleEntityNotFound(_0x34f222,null))[_0x7249('0x26')](function(_0x50be0a){if(_0x50be0a){_0x78ed64=_0x50be0a;_0x16cfe2['model']=_[_0x7249('0x56')](db[_0x7249('0x64')][_0x7249('0x2b')]);_0x16cfe2[_0x7249('0x31')]=_[_0x7249('0x56')](_0x1e26f8[_0x7249('0x31')]);_0x16cfe2[_0x7249('0x39')]=_[_0x7249('0x32')](_0x16cfe2[_0x7249('0x2f')],_0x16cfe2[_0x7249('0x31')]);_0x57cbe1[_0x7249('0x33')]=_['intersection'](_0x16cfe2[_0x7249('0x2f')],qs[_0x7249('0x44')](_0x1e26f8['query'][_0x7249('0x44')]));_0x57cbe1['attributes']=_0x57cbe1[_0x7249('0x33')]['length']?_0x57cbe1[_0x7249('0x33')]:_0x16cfe2[_0x7249('0x2f')];_0x57cbe1[_0x7249('0x57')]=qs['sort'](_0x1e26f8[_0x7249('0x31')][_0x7249('0x36')]);_0x57cbe1[_0x7249('0x37')]=qs[_0x7249('0x39')](_[_0x7249('0x38')](_0x1e26f8[_0x7249('0x31')],_0x16cfe2[_0x7249('0x39')]));if(_0x1e26f8[_0x7249('0x31')]['filter']){_0x57cbe1[_0x7249('0x37')]=_[_0x7249('0x3a')](_0x57cbe1[_0x7249('0x37')],{'$or':_['map'](_0x57cbe1[_0x7249('0x33')],function(_0x5c4a94){var _0x392588={};_0x392588[_0x5c4a94]={'$like':'%'+_0x1e26f8[_0x7249('0x31')][_0x7249('0x3c')]+'%'};return _0x392588;})});}_0x57cbe1=_[_0x7249('0x3a')]({},_0x57cbe1,_0x1e26f8[_0x7249('0x46')]);return _0x78ed64[_0x7249('0x63')](_0x57cbe1);}})[_0x7249('0x26')](function(_0x345f60){if(_0x345f60){_0x30723e=_0x345f60[_0x7249('0x45')];if(!_0x1e26f8[_0x7249('0x31')][_0x7249('0x34')](_0x7249('0x35'))){_0x57cbe1[_0x7249('0x1c')]=qs[_0x7249('0x1c')](_0x1e26f8[_0x7249('0x31')]['limit']);_0x57cbe1[_0x7249('0x1b')]=qs['offset'](_0x1e26f8[_0x7249('0x31')]['offset']);}return _0x78ed64[_0x7249('0x63')](_0x57cbe1);}})[_0x7249('0x26')](function(_0x33130b){if(_0x33130b){return _0x33130b?{'count':_0x30723e,'rows':_0x33130b}:null;}})[_0x7249('0x26')](respondWithResult(_0x34f222,null))[_0x7249('0x41')](handleError(_0x34f222,null));};exports['addTeams']=function(_0x406013,_0x557828,_0x2b04e9){var _0x594acf=_0x406013[_0x7249('0x49')]['ids'];return db[_0x7249('0x64')][_0x7249('0x59')]({'where':{'id':_0x594acf},'attributes':['id'],'include':[{'model':db[_0x7249('0x5a')],'as':'Agents','attributes':['id','name','online',_0x7249('0x65'),_0x7249('0x66')],'raw':!![]}]})[_0x7249('0x26')](function(_0x5a30cf){if(_0x5a30cf){var _0x673b26=_[_0x7249('0x67')](_0x5a30cf,function(_0x33221a){var _0x22a5e1=_0x33221a[_0x7249('0x24')]({'plain':!![]});return _0x22a5e1[_0x7249('0x68')];});return db[_0x7249('0x3f')][_0x7249('0x47')]({'where':{'id':_0x406013[_0x7249('0x43')]['id']}})['then'](function(_0x1f7d5c){return db[_0x7249('0x69')][_0x7249('0x6a')](function(_0x39b629){return _0x1f7d5c[_0x7249('0x6b')](_0x594acf,{'transaction':_0x39b629})[_0x7249('0x26')](function(){return BPromise['each'](_0x673b26,function(_0xd12b2d){return db[_0x7249('0x6c')]['findOrCreate']({'where':{'UserId':_0xd12b2d['id'],'SmsQueueId':_0x406013['params']['id']},'transaction':_0x39b629});});})[_0x7249('0x26')](function(){_0x673b26[_0x7249('0x6d')](function(_0x38d891){socket['emit'](_0x7249('0x6e'),{'UserId':_0x38d891['id'],'SmsQueueId':_0x1f7d5c['id']});});});});});}})[_0x7249('0x26')](respondWithStatusCode(_0x557828,null))[_0x7249('0x41')](handleError(_0x557828,null));};exports[_0x7249('0x6f')]=function(_0x411d05,_0x10a9dc,_0x1b0c8f){return db['Team'][_0x7249('0x59')]({'where':{'id':_0x411d05[_0x7249('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7249('0x5a')],'as':_0x7249('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x10a9dc,null))[_0x7249('0x26')](function(_0x5b6f4d){var _0x100028=_['map'](_0x5b6f4d,'id');var _0x1034bc=[];var _0x19bba7=[];var _0x3bf005=squel[_0x7249('0x70')]();_0x3bf005['field'](_0x7249('0x71'))[_0x7249('0x72')](_0x7249('0x73'),'tq')['join']('user_has_teams','ut',_0x7249('0x74'))[_0x7249('0x37')](_0x7249('0x75'),_0x411d05['params']['id']);for(var _0xfb520f=0x0;_0xfb520f<_0x5b6f4d[_0x7249('0x45')];_0xfb520f+=0x1){let _0x15f2b7=_0x5b6f4d[_0xfb520f];for(var _0x2e6017=0x0;_0x2e6017<_0x15f2b7[_0x7249('0x68')][_0x7249('0x45')];_0x2e6017+=0x1){let _0x23b6f1=_0x15f2b7[_0x7249('0x68')][_0x2e6017];var _0x5ec094=_0x3bf005['clone']();_0x5ec094[_0x7249('0x37')]('ut.UserId\x20=\x20?',_0x23b6f1['id']);_0x19bba7[_0x7249('0x76')](db[_0x7249('0x69')][_0x7249('0x31')](_0x5ec094[_0x7249('0x77')](),{'type':db['sequelize'][_0x7249('0x78')][_0x7249('0x79')]})[_0x7249('0x26')](function(_0x3d9735){if(_0x3d9735[_0x7249('0x45')]===0x1){return _0x23b6f1['id'];}else{var _0xeb4c18=_[_0x7249('0x7a')](_[_0x7249('0x2a')](_0x3d9735,_0x7249('0x7b')),function(_0x243f6e){return _['includes'](_0x100028,_0x243f6e);});if(_0xeb4c18){return _0x23b6f1['id'];}}}));}}return BPromise[_0x7249('0x7c')](_0x19bba7)[_0x7249('0x26')](function(_0x1d4ba4){_0x1034bc=_(_0x1034bc)[_0x7249('0x7d')](_0x1d4ba4)['compact']()[_0x7249('0x7e')]();return db[_0x7249('0x3f')][_0x7249('0x47')]({'where':{'id':_0x411d05[_0x7249('0x43')]['id']}})['then'](function(_0x161b07){return db[_0x7249('0x69')][_0x7249('0x6a')](function(_0x184382){return _0x161b07[_0x7249('0x6f')](_0x411d05['query'][_0x7249('0x7f')],{'transaction':_0x184382})['then'](function(){if(!_[_0x7249('0x80')](_0x1034bc)){return _0x161b07[_0x7249('0x81')](_0x1034bc,{'transaction':_0x184382});}})[_0x7249('0x26')](function(){_0x1034bc[_0x7249('0x6d')](function(_0x1b8e25){socket[_0x7249('0x82')]('userSmsQueue:remove',{'UserId':_0x1b8e25,'SmsQueueId':_0x161b07['id']});});});});});});})[_0x7249('0x26')](respondWithStatusCode(_0x10a9dc,null))['catch'](handleError(_0x10a9dc,null));};exports[_0x7249('0x83')]=function(_0x250a40,_0x4367ee,_0x3a3108){return db[_0x7249('0x3f')][_0x7249('0x47')]({'where':{'id':_0x250a40[_0x7249('0x43')]['id']}})['then'](handleEntityNotFound(_0x4367ee,null))[_0x7249('0x26')](function(_0x172e91){if(_0x172e91){return _0x172e91[_0x7249('0x83')](_0x250a40[_0x7249('0x49')][_0x7249('0x7f')],_['omit'](_0x250a40[_0x7249('0x49')],[_0x7249('0x7f'),'id'])||{})[_0x7249('0x84')](function(_0x597bd5){for(var _0x53411f=0x0;_0x53411f<_0x250a40['body'][_0x7249('0x7f')][_0x7249('0x45')];_0x53411f+=0x1){socket[_0x7249('0x82')]('userSmsQueue:save',{'UserId':_0x250a40[_0x7249('0x49')][_0x7249('0x7f')][_0x53411f],'SmsQueueId':_0x250a40[_0x7249('0x43')]['id']});}return _0x597bd5;});}})[_0x7249('0x26')](respondWithResult(_0x4367ee,null))['catch'](handleError(_0x4367ee,null));};exports[_0x7249('0x81')]=function(_0x29f28c,_0x341e76,_0xb388c6){return db[_0x7249('0x3f')][_0x7249('0x47')]({'where':{'id':_0x29f28c[_0x7249('0x43')]['id']}})[_0x7249('0x26')](handleEntityNotFound(_0x341e76,null))[_0x7249('0x26')](function(_0xf9094c){if(_0xf9094c){return _0xf9094c[_0x7249('0x81')](_0x29f28c[_0x7249('0x31')]['ids'])[_0x7249('0x26')](function(){if(_['isArray'](_0x29f28c[_0x7249('0x31')]['ids'])){for(var _0x4109fb=0x0;_0x4109fb<_0x29f28c[_0x7249('0x31')][_0x7249('0x7f')][_0x7249('0x45')];_0x4109fb+=0x1){socket['emit'](_0x7249('0x85'),{'UserId':Number(_0x29f28c[_0x7249('0x31')][_0x7249('0x7f')][_0x4109fb]),'SmsQueueId':Number(_0x29f28c[_0x7249('0x43')]['id'])});}}else{socket[_0x7249('0x82')](_0x7249('0x85'),{'UserId':Number(_0x29f28c[_0x7249('0x31')][_0x7249('0x7f')]),'SmsQueueId':Number(_0x29f28c[_0x7249('0x43')]['id'])});}});}})[_0x7249('0x26')](respondWithStatusCode(_0x341e76,null))['catch'](handleError(_0x341e76,null));};exports[_0x7249('0x86')]=function(_0x2d626f,_0x147a06,_0x785b01){var _0x16828f={};var _0x157e2b={};var _0x2feb04;var _0x420c35;return db[_0x7249('0x3f')][_0x7249('0x55')]({'where':{'id':_0x2d626f[_0x7249('0x43')]['id']}})[_0x7249('0x26')](handleEntityNotFound(_0x147a06,null))[_0x7249('0x26')](function(_0x313c0a){if(_0x313c0a){_0x2feb04=_0x313c0a;_0x157e2b[_0x7249('0x2f')]=_[_0x7249('0x56')](db['User'][_0x7249('0x2b')]);_0x157e2b[_0x7249('0x31')]=_[_0x7249('0x56')](_0x2d626f[_0x7249('0x31')]);_0x157e2b[_0x7249('0x39')]=_['intersection'](_0x157e2b[_0x7249('0x2f')],_0x157e2b[_0x7249('0x31')]);_0x16828f[_0x7249('0x33')]=_['intersection'](_0x157e2b[_0x7249('0x2f')],qs['fields'](_0x2d626f[_0x7249('0x31')][_0x7249('0x44')]));_0x16828f[_0x7249('0x33')]=_0x16828f['attributes']['length']?_0x16828f[_0x7249('0x33')]:_0x157e2b['model'];_0x16828f[_0x7249('0x57')]=qs[_0x7249('0x36')](_0x2d626f[_0x7249('0x31')][_0x7249('0x36')]);_0x16828f['where']=qs[_0x7249('0x39')](_[_0x7249('0x38')](_0x2d626f['query'],_0x157e2b[_0x7249('0x39')]));if(_0x2d626f['query'][_0x7249('0x3c')]){_0x16828f[_0x7249('0x37')]=_[_0x7249('0x3a')](_0x16828f['where'],{'$or':_[_0x7249('0x2a')](_0x16828f[_0x7249('0x33')],function(_0x42da54){var _0x2582a6={};_0x2582a6[_0x42da54]={'$like':'%'+_0x2d626f[_0x7249('0x31')][_0x7249('0x3c')]+'%'};return _0x2582a6;})});}_0x16828f=_[_0x7249('0x3a')]({},_0x16828f,_0x2d626f[_0x7249('0x46')]);return _0x2feb04[_0x7249('0x86')](_0x16828f);}})[_0x7249('0x26')](function(_0x4dcd6f){if(_0x4dcd6f){_0x420c35=_0x4dcd6f[_0x7249('0x45')];if(!_0x2d626f['query']['hasOwnProperty'](_0x7249('0x35'))){_0x16828f[_0x7249('0x1c')]=qs['limit'](_0x2d626f[_0x7249('0x31')]['limit']);_0x16828f[_0x7249('0x1b')]=qs[_0x7249('0x1b')](_0x2d626f[_0x7249('0x31')][_0x7249('0x1b')]);}return _0x2feb04[_0x7249('0x86')](_0x16828f);}})[_0x7249('0x26')](function(_0x1592ba){if(_0x1592ba){return _0x1592ba?{'count':_0x420c35,'rows':_0x1592ba}:null;}})[_0x7249('0x26')](respondWithResult(_0x147a06,null))[_0x7249('0x41')](handleError(_0x147a06,null));};
\ No newline at end of file
index 86d7649..2a6ac88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dce=['save','update','remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x15c0e5,_0x3591eb){var _0xcaeafd=function(_0x3f9309){while(--_0x3f9309){_0x15c0e5['push'](_0x15c0e5['shift']());}};_0xcaeafd(++_0x3591eb);}(_0x9dce,0xbe));var _0xe9dc=function(_0x268a3f,_0x413598){_0x268a3f=_0x268a3f-0x0;var _0x10221c=_0x9dce[_0x268a3f];return _0x10221c;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xe9dc('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe9dc('0x1')](0x0);var events={'afterCreate':_0xe9dc('0x2'),'afterUpdate':_0xe9dc('0x3'),'afterDestroy':_0xe9dc('0x4')};function emitEvent(_0x40d9e1){return function(_0x4f30cd,_0x40774d,_0x2cfc31){SmsQueueEvents[_0xe9dc('0x5')](_0x40d9e1+':'+_0x4f30cd['id'],_0x4f30cd);SmsQueueEvents[_0xe9dc('0x5')](_0x40d9e1,_0x4f30cd);_0x2cfc31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xe9dc('0x6')](e,emitEvent(event));}}module[_0xe9dc('0x7')]=SmsQueueEvents;
\ No newline at end of file
+var _0x0f49=['hasOwnProperty','hook','../../mysqldb','SmsQueue','save','update','remove','emit'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x0f49,0xb2));var _0x90f4=function(_0x112e2a,_0x364486){_0x112e2a=_0x112e2a-0x0;var _0x4f8af9=_0x0f49[_0x112e2a];return _0x4f8af9;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x90f4('0x0'))['db'][_0x90f4('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90f4('0x2'),'afterUpdate':_0x90f4('0x3'),'afterDestroy':_0x90f4('0x4')};function emitEvent(_0x357112){return function(_0xc45c9f,_0x26930c,_0x458a5d){SmsQueueEvents[_0x90f4('0x5')](_0x357112+':'+_0xc45c9f['id'],_0xc45c9f);SmsQueueEvents[_0x90f4('0x5')](_0x357112,_0xc45c9f);_0x458a5d(null);};}for(var e in events){if(events[_0x90f4('0x6')](e)){var event=events[e];SmsQueue[_0x90f4('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index 5957dc2..d7a14ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e5f=['path','rimraf','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0x6e5f,0x17f));var _0xf6e5=function(_0x3fb50b,_0x1e9bee){_0x3fb50b=_0x3fb50b-0x0;var _0x4b0282=_0x6e5f[_0x3fb50b];return _0x4b0282;};'use strict';var _=require(_0xf6e5('0x0'));var util=require(_0xf6e5('0x1'));var logger=require(_0xf6e5('0x2'))(_0xf6e5('0x3'));var moment=require(_0xf6e5('0x4'));var BPromise=require(_0xf6e5('0x5'));var rp=require(_0xf6e5('0x6'));var fs=require('fs');var path=require(_0xf6e5('0x7'));var rimraf=require(_0xf6e5('0x8'));var config=require('../../config/environment');var attributes=require(_0xf6e5('0x9'));module[_0xf6e5('0xa')]=function(_0xc30e38,_0x569a0b){return _0xc30e38['define'](_0xf6e5('0xb'),attributes,{'tableName':_0xf6e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc09f=['lodash','util','api','moment','bluebird','path','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues'];(function(_0x5541b7,_0x2cdaaf){var _0x302b66=function(_0x3e7e33){while(--_0x3e7e33){_0x5541b7['push'](_0x5541b7['shift']());}};_0x302b66(++_0x2cdaaf);}(_0xc09f,0xe4));var _0xfc09=function(_0x430095,_0x122722){_0x430095=_0x430095-0x0;var _0x115f8a=_0xc09f[_0x430095];return _0x115f8a;};'use strict';var _=require(_0xfc09('0x0'));var util=require(_0xfc09('0x1'));var logger=require('../../config/logger')(_0xfc09('0x2'));var moment=require(_0xfc09('0x3'));var BPromise=require(_0xfc09('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc09('0x5'));var rimraf=require('rimraf');var config=require(_0xfc09('0x6'));var attributes=require(_0xfc09('0x7'));module[_0xfc09('0x8')]=function(_0x391a64,_0x4c1fe1){return _0x391a64[_0xfc09('0x9')](_0xfc09('0xa'),attributes,{'tableName':_0xfc09('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aee7503..fc97766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd14c=['message','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','SmsQueue','find','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x1edbae,_0x11f86d){var _0x3dcbb6=function(_0x246006){while(--_0x246006){_0x1edbae['push'](_0x1edbae['shift']());}};_0x3dcbb6(++_0x11f86d);}(_0xd14c,0x135));var _0xcd14=function(_0x43f9fb,_0x21b514){_0x43f9fb=_0x43f9fb-0x0;var _0x235df9=_0xd14c[_0x43f9fb];return _0x235df9;};'use strict';var _=require(_0xcd14('0x0'));var util=require(_0xcd14('0x1'));var moment=require(_0xcd14('0x2'));var BPromise=require(_0xcd14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd14('0x4'));var db=require(_0xcd14('0x5'))['db'];var utils=require(_0xcd14('0x6'));var logger=require('../../config/logger')(_0xcd14('0x7'));var config=require(_0xcd14('0x8'));var jayson=require(_0xcd14('0x9'));var client=jayson[_0xcd14('0xa')][_0xcd14('0xb')]({'port':0x232a});config[_0xcd14('0xc')]=_['defaults'](config[_0xcd14('0xc')],{'host':_0xcd14('0xd'),'port':0x18eb});var socket=require(_0xcd14('0xe'))(new Redis(config['redis']));require(_0xcd14('0xf'))[_0xcd14('0x10')](socket);function respondWithRpcPromise(_0xf56f39,_0x329b68,_0x4431e5){return new BPromise(function(_0x270c08,_0x6e02c4){return client[_0xcd14('0x11')](_0xf56f39,_0x4431e5)[_0xcd14('0x12')](function(_0x12f88c){logger[_0xcd14('0x13')](_0xcd14('0x14'),_0x329b68,_0xcd14('0x15'));logger[_0xcd14('0x16')](_0xcd14('0x17'),_0x329b68,'request\x20sent',JSON[_0xcd14('0x18')](_0x12f88c));if(_0x12f88c['error']){if(_0x12f88c['error'][_0xcd14('0x19')]===0x1f4){logger['error'](_0xcd14('0x14'),_0x329b68,_0x12f88c[_0xcd14('0x1a')][_0xcd14('0x1b')]);return _0x6e02c4(_0x12f88c['error'][_0xcd14('0x1b')]);}logger[_0xcd14('0x1a')](_0xcd14('0x14'),_0x329b68,_0x12f88c['error'][_0xcd14('0x1b')]);return _0x270c08(_0x12f88c[_0xcd14('0x1a')]['message']);}else{logger[_0xcd14('0x13')]('SmsQueue,\x20%s,\x20%s',_0x329b68,_0xcd14('0x15'));_0x270c08(_0x12f88c['result']['message']);}})['catch'](function(_0x19b1db){logger['error']('SmsQueue,\x20%s,\x20%s',_0x329b68,_0x19b1db);_0x6e02c4(_0x19b1db);});});}exports[_0xcd14('0x1c')]=function(_0x14bb77){var _0x57ddf8=this;return new Promise(function(_0x4e345b,_0x5a9cbe){return db['SmsQueue'][_0xcd14('0x1d')]({'raw':_0x14bb77[_0xcd14('0x1e')]?_0x14bb77[_0xcd14('0x1e')][_0xcd14('0x1f')]===undefined?!![]:![]:!![],'where':_0x14bb77[_0xcd14('0x1e')]?_0x14bb77['options'][_0xcd14('0x20')]||null:null,'attributes':_0x14bb77[_0xcd14('0x1e')]?_0x14bb77[_0xcd14('0x1e')][_0xcd14('0x21')]||null:null,'limit':_0x14bb77[_0xcd14('0x1e')]?_0x14bb77[_0xcd14('0x1e')][_0xcd14('0x22')]||null:null,'include':_0x14bb77[_0xcd14('0x1e')]?_0x14bb77['options'][_0xcd14('0x23')]?_[_0xcd14('0x24')](_0x14bb77[_0xcd14('0x1e')][_0xcd14('0x23')],function(_0x322c73){return{'model':db[_0x322c73[_0xcd14('0x25')]],'as':_0x322c73['as'],'attributes':_0x322c73[_0xcd14('0x21')],'include':_0x322c73[_0xcd14('0x23')]?_[_0xcd14('0x24')](_0x322c73[_0xcd14('0x23')],function(_0x5acb19){return{'model':db[_0x5acb19[_0xcd14('0x25')]],'as':_0x5acb19['as'],'attributes':_0x5acb19[_0xcd14('0x21')],'include':_0x5acb19[_0xcd14('0x23')]?_[_0xcd14('0x24')](_0x5acb19['include'],function(_0x3c7bc3){return{'model':db[_0x3c7bc3[_0xcd14('0x25')]],'as':_0x3c7bc3['as'],'attributes':_0x3c7bc3[_0xcd14('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48f3d9){logger[_0xcd14('0x13')](_0xcd14('0x1c'),_0x14bb77);logger['debug'](_0xcd14('0x1c'),_0x14bb77,JSON[_0xcd14('0x18')](_0x48f3d9));_0x4e345b(_0x48f3d9);})['catch'](function(_0x32d739){logger['error'](_0xcd14('0x1c'),_0x32d739[_0xcd14('0x1b')],_0x14bb77);_0x5a9cbe(_0x57ddf8[_0xcd14('0x1a')](0x1f4,_0x32d739[_0xcd14('0x1b')]));});});};exports[_0xcd14('0x26')]=function(_0x2e6599){var _0x4ed5df=this;return new Promise(function(_0x30f813,_0x5d55ef){return db[_0xcd14('0x27')][_0xcd14('0x28')]({'raw':_0x2e6599[_0xcd14('0x1e')]?_0x2e6599[_0xcd14('0x1e')][_0xcd14('0x1f')]===undefined?!![]:![]:!![],'where':_0x2e6599[_0xcd14('0x1e')]?_0x2e6599[_0xcd14('0x1e')][_0xcd14('0x20')]||null:null,'attributes':_0x2e6599['options']?_0x2e6599[_0xcd14('0x1e')]['attributes']||null:null,'include':_0x2e6599[_0xcd14('0x1e')]?_0x2e6599[_0xcd14('0x1e')]['include']?_[_0xcd14('0x24')](_0x2e6599[_0xcd14('0x1e')][_0xcd14('0x23')],function(_0x5a1989){return{'model':db[_0x5a1989[_0xcd14('0x25')]],'as':_0x5a1989['as'],'attributes':_0x5a1989[_0xcd14('0x21')],'include':_0x5a1989[_0xcd14('0x23')]?_[_0xcd14('0x24')](_0x5a1989['include'],function(_0x35bd40){return{'model':db[_0x35bd40[_0xcd14('0x25')]],'as':_0x35bd40['as'],'attributes':_0x35bd40[_0xcd14('0x21')],'include':_0x35bd40[_0xcd14('0x23')]?_[_0xcd14('0x24')](_0x35bd40[_0xcd14('0x23')],function(_0xe5dd66){return{'model':db[_0xe5dd66[_0xcd14('0x25')]],'as':_0xe5dd66['as'],'attributes':_0xe5dd66[_0xcd14('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcd14('0x12')](function(_0x2f34dc){logger[_0xcd14('0x13')](_0xcd14('0x26'),_0x2e6599);logger['debug']('ShowSmsQueue',_0x2e6599,JSON[_0xcd14('0x18')](_0x2f34dc));_0x30f813(_0x2f34dc);})[_0xcd14('0x29')](function(_0x12b38c){logger['error'](_0xcd14('0x26'),_0x12b38c['message'],_0x2e6599);_0x5d55ef(_0x4ed5df[_0xcd14('0x1a')](0x1f4,_0x12b38c[_0xcd14('0x1b')]));});});};
\ No newline at end of file
+var _0xde89=['map','model','attributes','GetSmsQueue','ShowSmsQueue','SmsQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','limit','include'];(function(_0x5485e2,_0x7cc95e){var _0x5153ef=function(_0x26b77a){while(--_0x26b77a){_0x5485e2['push'](_0x5485e2['shift']());}};_0x5153ef(++_0x7cc95e);}(_0xde89,0x10f));var _0x9de8=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xde89[_0x9cfe28];return _0x54a1d0;};'use strict';var _=require(_0x9de8('0x0'));var util=require(_0x9de8('0x1'));var moment=require(_0x9de8('0x2'));var BPromise=require(_0x9de8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9de8('0x4'));var db=require(_0x9de8('0x5'))['db'];var utils=require(_0x9de8('0x6'));var logger=require(_0x9de8('0x7'))('rpc');var config=require(_0x9de8('0x8'));var jayson=require(_0x9de8('0x9'));var client=jayson[_0x9de8('0xa')][_0x9de8('0xb')]({'port':0x232a});config[_0x9de8('0xc')]=_[_0x9de8('0xd')](config[_0x9de8('0xc')],{'host':_0x9de8('0xe'),'port':0x18eb});var socket=require(_0x9de8('0xf'))(new Redis(config[_0x9de8('0xc')]));require(_0x9de8('0x10'))[_0x9de8('0x11')](socket);function respondWithRpcPromise(_0xe7336f,_0x4ea94a,_0x68754e){return new BPromise(function(_0x445c36,_0x2e44df){return client[_0x9de8('0x12')](_0xe7336f,_0x68754e)[_0x9de8('0x13')](function(_0x482a7a){logger[_0x9de8('0x14')](_0x9de8('0x15'),_0x4ea94a,_0x9de8('0x16'));logger[_0x9de8('0x17')](_0x9de8('0x18'),_0x4ea94a,_0x9de8('0x16'),JSON[_0x9de8('0x19')](_0x482a7a));if(_0x482a7a[_0x9de8('0x1a')]){if(_0x482a7a[_0x9de8('0x1a')][_0x9de8('0x1b')]===0x1f4){logger[_0x9de8('0x1a')]('SmsQueue,\x20%s,\x20%s',_0x4ea94a,_0x482a7a['error'][_0x9de8('0x1c')]);return _0x2e44df(_0x482a7a[_0x9de8('0x1a')][_0x9de8('0x1c')]);}logger[_0x9de8('0x1a')](_0x9de8('0x15'),_0x4ea94a,_0x482a7a[_0x9de8('0x1a')][_0x9de8('0x1c')]);return _0x445c36(_0x482a7a[_0x9de8('0x1a')][_0x9de8('0x1c')]);}else{logger['info'](_0x9de8('0x15'),_0x4ea94a,'request\x20sent');_0x445c36(_0x482a7a[_0x9de8('0x1d')]['message']);}})[_0x9de8('0x1e')](function(_0x499ecb){logger['error'](_0x9de8('0x15'),_0x4ea94a,_0x499ecb);_0x2e44df(_0x499ecb);});});}exports['GetSmsQueue']=function(_0x38b90f){var _0x35ddcf=this;return new Promise(function(_0x3c304d,_0x4c03bf){return db['SmsQueue'][_0x9de8('0x1f')]({'raw':_0x38b90f['options']?_0x38b90f[_0x9de8('0x20')][_0x9de8('0x21')]===undefined?!![]:![]:!![],'where':_0x38b90f[_0x9de8('0x20')]?_0x38b90f[_0x9de8('0x20')][_0x9de8('0x22')]||null:null,'attributes':_0x38b90f['options']?_0x38b90f['options']['attributes']||null:null,'limit':_0x38b90f['options']?_0x38b90f['options'][_0x9de8('0x23')]||null:null,'include':_0x38b90f['options']?_0x38b90f[_0x9de8('0x20')][_0x9de8('0x24')]?_[_0x9de8('0x25')](_0x38b90f[_0x9de8('0x20')][_0x9de8('0x24')],function(_0x25dd9e){return{'model':db[_0x25dd9e[_0x9de8('0x26')]],'as':_0x25dd9e['as'],'attributes':_0x25dd9e[_0x9de8('0x27')],'include':_0x25dd9e[_0x9de8('0x24')]?_[_0x9de8('0x25')](_0x25dd9e['include'],function(_0x566e84){return{'model':db[_0x566e84[_0x9de8('0x26')]],'as':_0x566e84['as'],'attributes':_0x566e84['attributes'],'include':_0x566e84[_0x9de8('0x24')]?_[_0x9de8('0x25')](_0x566e84['include'],function(_0x294663){return{'model':db[_0x294663[_0x9de8('0x26')]],'as':_0x294663['as'],'attributes':_0x294663['attributes']};}):[]};}):[]};}):[]:[]})[_0x9de8('0x13')](function(_0x536015){logger[_0x9de8('0x14')](_0x9de8('0x28'),_0x38b90f);logger[_0x9de8('0x17')](_0x9de8('0x28'),_0x38b90f,JSON[_0x9de8('0x19')](_0x536015));_0x3c304d(_0x536015);})[_0x9de8('0x1e')](function(_0x29f161){logger[_0x9de8('0x1a')]('GetSmsQueue',_0x29f161[_0x9de8('0x1c')],_0x38b90f);_0x4c03bf(_0x35ddcf[_0x9de8('0x1a')](0x1f4,_0x29f161[_0x9de8('0x1c')]));});});};exports[_0x9de8('0x29')]=function(_0x48d776){var _0x4fdcf4=this;return new Promise(function(_0x362a37,_0x43a9cb){return db[_0x9de8('0x2a')][_0x9de8('0x2b')]({'raw':_0x48d776[_0x9de8('0x20')]?_0x48d776[_0x9de8('0x20')][_0x9de8('0x21')]===undefined?!![]:![]:!![],'where':_0x48d776['options']?_0x48d776[_0x9de8('0x20')][_0x9de8('0x22')]||null:null,'attributes':_0x48d776[_0x9de8('0x20')]?_0x48d776[_0x9de8('0x20')][_0x9de8('0x27')]||null:null,'include':_0x48d776[_0x9de8('0x20')]?_0x48d776[_0x9de8('0x20')][_0x9de8('0x24')]?_[_0x9de8('0x25')](_0x48d776[_0x9de8('0x20')][_0x9de8('0x24')],function(_0x56bba2){return{'model':db[_0x56bba2[_0x9de8('0x26')]],'as':_0x56bba2['as'],'attributes':_0x56bba2[_0x9de8('0x27')],'include':_0x56bba2[_0x9de8('0x24')]?_[_0x9de8('0x25')](_0x56bba2[_0x9de8('0x24')],function(_0x87499){return{'model':db[_0x87499[_0x9de8('0x26')]],'as':_0x87499['as'],'attributes':_0x87499[_0x9de8('0x27')],'include':_0x87499['include']?_[_0x9de8('0x25')](_0x87499[_0x9de8('0x24')],function(_0x5895a5){return{'model':db[_0x5895a5['model']],'as':_0x5895a5['as'],'attributes':_0x5895a5[_0x9de8('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d3338){logger[_0x9de8('0x14')]('ShowSmsQueue',_0x48d776);logger[_0x9de8('0x17')](_0x9de8('0x29'),_0x48d776,JSON[_0x9de8('0x19')](_0x2d3338));_0x362a37(_0x2d3338);})[_0x9de8('0x1e')](function(_0x5e6bda){logger[_0x9de8('0x1a')](_0x9de8('0x29'),_0x5e6bda['message'],_0x48d776);_0x43a9cb(_0x4fdcf4[_0x9de8('0x1a')](0x1f4,_0x5e6bda[_0x9de8('0x1c')]));});});};
\ No newline at end of file
index 5d72dce..7b33fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aab=['remove','update','emit','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x0aab,0x1c7));var _0xb0aa=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x0aab[_0x587fb5];return _0x551105;};'use strict';var SmsQueueEvents=require(_0xb0aa('0x0'));var events=['save',_0xb0aa('0x1'),_0xb0aa('0x2')];function createListener(_0x29f4f5,_0x433999){return function(_0x174efa){_0x433999[_0xb0aa('0x3')](_0x29f4f5,_0x174efa);};}function removeListener(_0x43351c,_0x11fb4e){return function(){SmsQueueEvents[_0xb0aa('0x4')](_0x43351c,_0x11fb4e);};}exports[_0xb0aa('0x5')]=function(_0x4f0d77){for(var _0x24aac3=0x0,_0x537cef=events[_0xb0aa('0x6')];_0x24aac3<_0x537cef;_0x24aac3++){var _0x4f3dca=events[_0x24aac3];var _0x3a9a6f=createListener(_0xb0aa('0x7')+_0x4f3dca,_0x4f0d77);SmsQueueEvents['on'](_0x4f3dca,_0x3a9a6f);}};
\ No newline at end of file
+var _0x9128=['./smsQueue.events','save','remove','emit','register','smsQueue:'];(function(_0x2e4a0f,_0x3a9bb6){var _0x25a3cd=function(_0x1c614f){while(--_0x1c614f){_0x2e4a0f['push'](_0x2e4a0f['shift']());}};_0x25a3cd(++_0x3a9bb6);}(_0x9128,0x11a));var _0x8912=function(_0x53417c,_0x126dee){_0x53417c=_0x53417c-0x0;var _0x49407d=_0x9128[_0x53417c];return _0x49407d;};'use strict';var SmsQueueEvents=require(_0x8912('0x0'));var events=[_0x8912('0x1'),_0x8912('0x2'),'update'];function createListener(_0x578acf,_0x82fad7){return function(_0x2a41ef){_0x82fad7[_0x8912('0x3')](_0x578acf,_0x2a41ef);};}function removeListener(_0x5d7700,_0x394a65){return function(){SmsQueueEvents['removeListener'](_0x5d7700,_0x394a65);};}exports[_0x8912('0x4')]=function(_0x5f5c67){for(var _0x487074=0x0,_0x4a3bb0=events['length'];_0x487074<_0x4a3bb0;_0x487074++){var _0x66f0b=events[_0x487074];var _0x7d2d19=createListener(_0x8912('0x5')+_0x66f0b,_0x5f5c67);SmsQueueEvents['on'](_0x66f0b,_0x7d2d19);}};
\ No newline at end of file
index d94ca0e..d170810 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa10b=['get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa10b,0x187));var _0xba10=function(_0x1d2db0,_0x7f1e4){_0x1d2db0=_0x1d2db0-0x0;var _0x4da805=_0xa10b[_0x1d2db0];return _0x4da805;};'use strict';var multer=require('multer');var util=require(_0xba10('0x0'));var path=require(_0xba10('0x1'));var timeout=require(_0xba10('0x2'));var express=require(_0xba10('0x3'));var router=express[_0xba10('0x4')]();var auth=require(_0xba10('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xba10('0x6'));var controller=require(_0xba10('0x7'));router[_0xba10('0x8')]('/',auth[_0xba10('0x9')](),controller[_0xba10('0xa')]);router['get'](_0xba10('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xba10('0x8')](_0xba10('0xc'),auth[_0xba10('0x9')](),controller[_0xba10('0xd')]);router[_0xba10('0xe')]('/',auth['isAuthenticated'](),controller[_0xba10('0xf')]);router[_0xba10('0x10')](_0xba10('0xc'),auth[_0xba10('0x9')](),controller[_0xba10('0x11')]);router['delete'](_0xba10('0xc'),auth[_0xba10('0x9')](),controller[_0xba10('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
index 6ddd633..ebd5a75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['moment','sequelize','exports','STRING','DATE'];(function(_0x37cee1,_0x4d9912){var _0xc5362f=function(_0x39fea7){while(--_0x39fea7){_0x37cee1['push'](_0x37cee1['shift']());}};_0xc5362f(++_0x4d9912);}(_0x81bd,0x127));var _0xd81b=function(_0x64a51,_0x1c61b7){_0x64a51=_0x64a51-0x0;var _0x1eba45=_0x81bd[_0x64a51];return _0x1eba45;};'use strict';var moment=require(_0xd81b('0x0'));var Sequelize=require(_0xd81b('0x1'));module[_0xd81b('0x2')]={'uniqueid':{'type':Sequelize[_0xd81b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd81b('0x3')]},'joinAt':{'type':Sequelize[_0xd81b('0x4')]},'leaveAt':{'type':Sequelize[_0xd81b('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd81b('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8819=['sequelize','exports','STRING','DATE'];(function(_0x8f633e,_0x54ea00){var _0x4d2778=function(_0x45d315){while(--_0x45d315){_0x8f633e['push'](_0x8f633e['shift']());}};_0x4d2778(++_0x54ea00);}(_0x8819,0x134));var _0x9881=function(_0x48772c,_0xcd4549){_0x48772c=_0x48772c-0x0;var _0x49be0f=_0x8819[_0x48772c];return _0x49be0f;};'use strict';var moment=require('moment');var Sequelize=require(_0x9881('0x0'));module[_0x9881('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x9881('0x2')]},'joinAt':{'type':Sequelize[_0x9881('0x3')]},'leaveAt':{'type':Sequelize[_0x9881('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9881('0x2')]}};
\ No newline at end of file
index 21bd67f..c1a90ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SmsQueueReport','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x21399e,_0xbc6101){var _0x3b7be4=function(_0x2b5747){while(--_0x2b5747){_0x21399e['push'](_0x21399e['shift']());}};_0x3b7be4(++_0xbc6101);}(_0x814b,0x1a2));var _0xb814=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0x814b[_0x420d8d];return _0x4865d7;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SmsQueueReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SmsQueueReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SmsQueueReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','SmsQueueReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x1ed2e2,_0x13e06c){var _0x1c089e=function(_0x347556){while(--_0x347556){_0x1ed2e2['push'](_0x1ed2e2['shift']());}};_0x1c089e(++_0x13e06c);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['SmsQueueReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]),_0x132a42);if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['SmsQueueReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));};
\ No newline at end of file
index fef9e12..9dbd2c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0bc=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x1b1da5,_0x437fc2){var _0x2f7a97=function(_0xd7ce82){while(--_0xd7ce82){_0x1b1da5['push'](_0x1b1da5['shift']());}};_0x2f7a97(++_0x437fc2);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var logger=require(_0xca0b('0x1'))('api');var moment=require(_0xca0b('0x2'));var BPromise=require(_0xca0b('0x3'));var rp=require(_0xca0b('0x4'));var fs=require('fs');var path=require(_0xca0b('0x5'));var rimraf=require(_0xca0b('0x6'));var config=require(_0xca0b('0x7'));var attributes=require(_0xca0b('0x8'));module[_0xca0b('0x9')]=function(_0x3cb084,_0x1aac00){return _0x3cb084[_0xca0b('0xa')](_0xca0b('0xb'),attributes,{'tableName':_0xca0b('0xc'),'paranoid':![],'indexes':[{'name':_0xca0b('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0849=['moment','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0849,0xca));var _0x9084=function(_0x33a919,_0x271e2c){_0x33a919=_0x33a919-0x0;var _0x5cf348=_0x0849[_0x33a919];return _0x5cf348;};'use strict';var _=require(_0x9084('0x0'));var util=require(_0x9084('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9084('0x2'));var BPromise=require(_0x9084('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9084('0x4'));var rimraf=require(_0x9084('0x5'));var config=require(_0x9084('0x6'));var attributes=require(_0x9084('0x7'));module['exports']=function(_0x321e2e,_0x42288f){return _0x321e2e[_0x9084('0x8')](_0x9084('0x9'),attributes,{'tableName':_0x9084('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9084('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index b7a5a59..34b3959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31ac=['body','options','then','UpdateSmsQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create'];(function(_0xef6dd7,_0x5eda26){var _0x421ef4=function(_0x9547fe){while(--_0x9547fe){_0xef6dd7['push'](_0xef6dd7['shift']());}};_0x421ef4(++_0x5eda26);}(_0x31ac,0x173));var _0xc31a=function(_0x376ddb,_0x5c43ca){_0x376ddb=_0x376ddb-0x0;var _0x4ba9fa=_0x31ac[_0x376ddb];return _0x4ba9fa;};'use strict';var _=require(_0xc31a('0x0'));var util=require(_0xc31a('0x1'));var moment=require(_0xc31a('0x2'));var BPromise=require(_0xc31a('0x3'));var rs=require(_0xc31a('0x4'));var fs=require('fs');var Redis=require(_0xc31a('0x5'));var db=require(_0xc31a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc31a('0x7'))('rpc');var config=require(_0xc31a('0x8'));var jayson=require(_0xc31a('0x9'));var client=jayson[_0xc31a('0xa')][_0xc31a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x395f1b,_0x5c0c7a,_0x5b6012){return new BPromise(function(_0x9b8424,_0x239f2e){return client['request'](_0x395f1b,_0x5b6012)['then'](function(_0x3b20fa){logger[_0xc31a('0xc')](_0xc31a('0xd'),_0x5c0c7a,_0xc31a('0xe'));logger[_0xc31a('0xf')](_0xc31a('0x10'),_0x5c0c7a,_0xc31a('0xe'),JSON[_0xc31a('0x11')](_0x3b20fa));if(_0x3b20fa[_0xc31a('0x12')]){if(_0x3b20fa[_0xc31a('0x12')]['code']===0x1f4){logger[_0xc31a('0x12')](_0xc31a('0xd'),_0x5c0c7a,_0x3b20fa[_0xc31a('0x12')][_0xc31a('0x13')]);return _0x239f2e(_0x3b20fa['error'][_0xc31a('0x13')]);}logger[_0xc31a('0x12')](_0xc31a('0xd'),_0x5c0c7a,_0x3b20fa['error'][_0xc31a('0x13')]);return _0x9b8424(_0x3b20fa[_0xc31a('0x12')]['message']);}else{logger[_0xc31a('0xc')](_0xc31a('0xd'),_0x5c0c7a,_0xc31a('0xe'));_0x9b8424(_0x3b20fa[_0xc31a('0x14')][_0xc31a('0x13')]);}})[_0xc31a('0x15')](function(_0x16a294){logger[_0xc31a('0x12')](_0xc31a('0xd'),_0x5c0c7a,_0x16a294);_0x239f2e(_0x16a294);});});}exports[_0xc31a('0x16')]=function(_0x28cf20){var _0x1b6356=this;return new Promise(function(_0x391187,_0x469310){return db[_0xc31a('0x17')][_0xc31a('0x18')](_0x28cf20[_0xc31a('0x19')],{'raw':_0x28cf20[_0xc31a('0x1a')]?_0x28cf20[_0xc31a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xc31a('0x1b')](function(_0x56b396){logger['info'](_0xc31a('0x16'),_0x28cf20);logger[_0xc31a('0xf')](_0xc31a('0x16'),_0x28cf20,JSON[_0xc31a('0x11')](_0x56b396));_0x391187(_0x56b396);})['catch'](function(_0x302c8a){logger[_0xc31a('0x12')](_0xc31a('0x16'),_0x302c8a[_0xc31a('0x13')],_0x28cf20);_0x469310(_0x1b6356[_0xc31a('0x12')](0x1f4,_0x302c8a['message']));});});};exports[_0xc31a('0x1c')]=function(_0x1371a9){var _0x7ea296=this;return new Promise(function(_0x259ffc,_0x407f4b){return db[_0xc31a('0x17')][_0xc31a('0x1d')](_0x1371a9[_0xc31a('0x19')],{'raw':_0x1371a9[_0xc31a('0x1a')]?_0x1371a9[_0xc31a('0x1a')][_0xc31a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1371a9[_0xc31a('0x1a')]?_0x1371a9[_0xc31a('0x1a')][_0xc31a('0x1f')]||null:null,'attributes':_0x1371a9[_0xc31a('0x1a')]?_0x1371a9[_0xc31a('0x1a')]['attributes']||null:null,'limit':_0x1371a9[_0xc31a('0x1a')]?_0x1371a9[_0xc31a('0x1a')][_0xc31a('0x20')]||null:null})[_0xc31a('0x1b')](function(_0x48b8a7){logger[_0xc31a('0xc')](_0xc31a('0x1c'),_0x1371a9);logger[_0xc31a('0xf')]('UpdateSmsQueueReport',_0x1371a9,JSON[_0xc31a('0x11')](_0x48b8a7));_0x259ffc(_0x48b8a7);})[_0xc31a('0x15')](function(_0xfa5c46){logger[_0xc31a('0x12')](_0xc31a('0x1c'),_0xfa5c46[_0xc31a('0x13')],_0x1371a9);_0x407f4b(_0x7ea296[_0xc31a('0x12')](0x1f4,_0xfa5c46['message']));});});};
\ No newline at end of file
+var _0xae0a=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','update','raw','where','attributes','limit','lodash','util','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x2923c4,_0x4dc92d){var _0x26cae9=function(_0x4d40dd){while(--_0x4d40dd){_0x2923c4['push'](_0x2923c4['shift']());}};_0x26cae9(++_0x4dc92d);}(_0xae0a,0x154));var _0xaae0=function(_0x3c52c2,_0x2bb299){_0x3c52c2=_0x3c52c2-0x0;var _0x45289a=_0xae0a[_0x3c52c2];return _0x45289a;};'use strict';var _=require(_0xaae0('0x0'));var util=require(_0xaae0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaae0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xaae0('0x3'));var logger=require('../../config/logger')(_0xaae0('0x4'));var config=require(_0xaae0('0x5'));var jayson=require(_0xaae0('0x6'));var client=jayson[_0xaae0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545527,_0x3ed9fe,_0x4e922b){return new BPromise(function(_0x5e2afa,_0x816593){return client[_0xaae0('0x8')](_0x545527,_0x4e922b)[_0xaae0('0x9')](function(_0x157d1f){logger[_0xaae0('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x3ed9fe,_0xaae0('0xb'));logger[_0xaae0('0xc')](_0xaae0('0xd'),_0x3ed9fe,_0xaae0('0xb'),JSON[_0xaae0('0xe')](_0x157d1f));if(_0x157d1f[_0xaae0('0xf')]){if(_0x157d1f[_0xaae0('0xf')][_0xaae0('0x10')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x3ed9fe,_0x157d1f[_0xaae0('0xf')][_0xaae0('0x11')]);return _0x816593(_0x157d1f[_0xaae0('0xf')]['message']);}logger['error'](_0xaae0('0x12'),_0x3ed9fe,_0x157d1f[_0xaae0('0xf')]['message']);return _0x5e2afa(_0x157d1f[_0xaae0('0xf')]['message']);}else{logger['info'](_0xaae0('0x12'),_0x3ed9fe,_0xaae0('0xb'));_0x5e2afa(_0x157d1f[_0xaae0('0x13')][_0xaae0('0x11')]);}})[_0xaae0('0x14')](function(_0x19eac8){logger[_0xaae0('0xf')](_0xaae0('0x12'),_0x3ed9fe,_0x19eac8);_0x816593(_0x19eac8);});});}exports[_0xaae0('0x15')]=function(_0x3c5711){var _0x122ee7=this;return new Promise(function(_0x553351,_0x4e16b5){return db[_0xaae0('0x16')][_0xaae0('0x17')](_0x3c5711[_0xaae0('0x18')],{'raw':_0x3c5711[_0xaae0('0x19')]?_0x3c5711[_0xaae0('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xaae0('0x9')](function(_0x309217){logger[_0xaae0('0xa')](_0xaae0('0x15'),_0x3c5711);logger['debug'](_0xaae0('0x15'),_0x3c5711,JSON[_0xaae0('0xe')](_0x309217));_0x553351(_0x309217);})[_0xaae0('0x14')](function(_0x57e1a7){logger[_0xaae0('0xf')]('CreateSmsQueueReport',_0x57e1a7[_0xaae0('0x11')],_0x3c5711);_0x4e16b5(_0x122ee7[_0xaae0('0xf')](0x1f4,_0x57e1a7['message']));});});};exports[_0xaae0('0x1a')]=function(_0x3eeff9){var _0x2fdea2=this;return new Promise(function(_0x4a2ffd,_0x3d86d5){return db[_0xaae0('0x16')][_0xaae0('0x1b')](_0x3eeff9[_0xaae0('0x18')],{'raw':_0x3eeff9[_0xaae0('0x19')]?_0x3eeff9['options'][_0xaae0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eeff9[_0xaae0('0x19')]?_0x3eeff9[_0xaae0('0x19')][_0xaae0('0x1d')]||null:null,'attributes':_0x3eeff9[_0xaae0('0x19')]?_0x3eeff9[_0xaae0('0x19')][_0xaae0('0x1e')]||null:null,'limit':_0x3eeff9['options']?_0x3eeff9[_0xaae0('0x19')][_0xaae0('0x1f')]||null:null})['then'](function(_0x3e67da){logger[_0xaae0('0xa')]('UpdateSmsQueueReport',_0x3eeff9);logger['debug']('UpdateSmsQueueReport',_0x3eeff9,JSON[_0xaae0('0xe')](_0x3e67da));_0x4a2ffd(_0x3e67da);})[_0xaae0('0x14')](function(_0x5d09e5){logger[_0xaae0('0xf')](_0xaae0('0x1a'),_0x5d09e5[_0xaae0('0x11')],_0x3eeff9);_0x3d86d5(_0x2fdea2['error'](0x1f4,_0x5d09e5[_0xaae0('0x11')]));});});};
\ No newline at end of file
index 24a3196..50822f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7916=['index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x50d57a,_0x57cdf9){var _0x6b44ba=function(_0x570c8b){while(--_0x570c8b){_0x50d57a['push'](_0x50d57a['shift']());}};_0x6b44ba(++_0x57cdf9);}(_0x7916,0x128));var _0x6791=function(_0x8e4da2,_0x2fc2ab){_0x8e4da2=_0x8e4da2-0x0;var _0xb88369=_0x7916[_0x8e4da2];return _0xb88369;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var auth=require(_0x6791('0x4'));var interaction=require(_0x6791('0x5'));var config=require(_0x6791('0x6'));var controller=require('./smsTransferReport.controller');router[_0x6791('0x7')]('/',auth['isAuthenticated'](),controller[_0x6791('0x8')]);router[_0x6791('0x7')]('/describe',auth[_0x6791('0x9')](),controller['describe']);router[_0x6791('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6791('0xa')]);router[_0x6791('0xb')]('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xd')](_0x6791('0xe'),auth['isAuthenticated'](),controller[_0x6791('0xf')]);router[_0x6791('0x10')](_0x6791('0xe'),auth[_0x6791('0x9')](),controller[_0x6791('0x11')]);module[_0x6791('0x12')]=router;
\ No newline at end of file
+var _0x757a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','util','path'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x757a,0xde));var _0xa757=function(_0x1eacdd,_0x25af70){_0x1eacdd=_0x1eacdd-0x0;var _0x528a7d=_0x757a[_0x1eacdd];return _0x528a7d;};'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 auth=require(_0xa757('0x2'));var interaction=require(_0xa757('0x3'));var config=require(_0xa757('0x4'));var controller=require(_0xa757('0x5'));router[_0xa757('0x6')]('/',auth[_0xa757('0x7')](),controller['index']);router[_0xa757('0x6')](_0xa757('0x8'),auth['isAuthenticated'](),controller[_0xa757('0x9')]);router[_0xa757('0x6')](_0xa757('0xa'),auth[_0xa757('0x7')](),controller[_0xa757('0xb')]);router['post']('/',auth[_0xa757('0x7')](),controller[_0xa757('0xc')]);router[_0xa757('0xd')](_0xa757('0xa'),auth[_0xa757('0x7')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 890efb0..a924fdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78e9=['exports','STRING','ENUM','account','queue','DATE','NOW','sequelize'];(function(_0xca1f2f,_0x2f97fd){var _0x2952d8=function(_0x3e4c5d){while(--_0x3e4c5d){_0xca1f2f['push'](_0xca1f2f['shift']());}};_0x2952d8(++_0x2f97fd);}(_0x78e9,0xc7));var _0x978e=function(_0x1257d8,_0x124b8e){_0x1257d8=_0x1257d8-0x0;var _0x49feda=_0x78e9[_0x1257d8];return _0x49feda;};'use strict';var moment=require('moment');var Sequelize=require(_0x978e('0x0'));module[_0x978e('0x1')]={'uniqueid':{'type':Sequelize[_0x978e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x978e('0x3')](_0x978e('0x4'),'agent',_0x978e('0x5')),'allowNull':![],'defaultValue':_0x978e('0x5')},'transferredAt':{'type':Sequelize[_0x978e('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x978e('0x7')]}};
\ No newline at end of file
+var _0x0d2b=['ENUM','account','agent','queue','moment','sequelize','exports','STRING'];(function(_0x5a0383,_0x312ffe){var _0x1adda7=function(_0x1a0cf5){while(--_0x1a0cf5){_0x5a0383['push'](_0x5a0383['shift']());}};_0x1adda7(++_0x312ffe);}(_0x0d2b,0xec));var _0xb0d2=function(_0x2d7b77,_0x2476df){_0x2d7b77=_0x2d7b77-0x0;var _0x3e96ae=_0x0d2b[_0x2d7b77];return _0x3e96ae;};'use strict';var moment=require(_0xb0d2('0x0'));var Sequelize=require(_0xb0d2('0x1'));module[_0xb0d2('0x2')]={'uniqueid':{'type':Sequelize[_0xb0d2('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb0d2('0x4')](_0xb0d2('0x5'),_0xb0d2('0x6'),'queue'),'allowNull':![],'defaultValue':_0xb0d2('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index fe0ba46..dbdfedd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','name','merge','options','count','includeAll','findAll','rows','catch','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','keys','query','filters'];(function(_0x4d8524,_0x1e8925){var _0xbdb413=function(_0x1e70d7){while(--_0x1e70d7){_0x4d8524['push'](_0x4d8524['shift']());}};_0xbdb413(++_0x1e8925);}(_0x70e0,0x17b));var _0x070e=function(_0x17f824,_0x35998e){_0x17f824=_0x17f824-0x0;var _0x402a26=_0x70e0[_0x17f824];return _0x402a26;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={},_0x374c54={},_0x219e48={'count':0x0,'rows':[]};var _0x1d72d6=_[_0x070e('0x26')](db[_0x070e('0x27')][_0x070e('0x28')],function(_0x1a1892){return{'name':_0x1a1892[_0x070e('0x29')],'type':_0x1a1892['type'][_0x070e('0x2a')]};});_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x26')](_0x1d72d6,'name');_0x374c54['query']=_[_0x070e('0x2c')](_0x1743cc[_0x070e('0x2d')]);_0x374c54[_0x070e('0x2e')]=_['intersection'](_0x374c54[_0x070e('0x2b')],_0x374c54[_0x070e('0x2d')]);_0x497f58[_0x070e('0x2f')]=_[_0x070e('0x30')](_0x374c54['model'],qs['fields'](_0x1743cc['query']['fields']));_0x497f58[_0x070e('0x2f')]=_0x497f58['attributes'][_0x070e('0x31')]?_0x497f58[_0x070e('0x2f')]:_0x374c54['model'];if(!_0x1743cc['query'][_0x070e('0x32')](_0x070e('0x33'))){_0x497f58['limit']=qs['limit'](_0x1743cc[_0x070e('0x2d')][_0x070e('0x19')]);_0x497f58[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x1743cc[_0x070e('0x2d')]['offset']);}_0x497f58['order']=qs[_0x070e('0x34')](_0x1743cc[_0x070e('0x2d')][_0x070e('0x34')]);_0x497f58[_0x070e('0x35')]=qs[_0x070e('0x2e')](_['pick'](_0x1743cc[_0x070e('0x2d')],_0x374c54[_0x070e('0x2e')]),_0x1d72d6);if(_0x1743cc['query'][_0x070e('0x36')]){_0x497f58[_0x070e('0x35')]=_['merge'](_0x497f58['where'],{'$or':_['map'](_0x1d72d6,function(_0x363bff){if(_0x363bff[_0x070e('0x37')]!==_0x070e('0x38')){var _0x334733={};_0x334733[_0x363bff[_0x070e('0x39')]]={'$like':'%'+_0x1743cc['query'][_0x070e('0x36')]+'%'};return _0x334733;}})});}_0x497f58=_[_0x070e('0x3a')]({},_0x497f58,_0x1743cc[_0x070e('0x3b')]);var _0x487276={'where':_0x497f58[_0x070e('0x35')]};return db[_0x070e('0x27')][_0x070e('0x3c')](_0x487276)['then'](function(_0x13982f){_0x219e48[_0x070e('0x3c')]=_0x13982f;if(_0x1743cc['query'][_0x070e('0x3d')]){_0x497f58['include']=[{'all':!![]}];}return db[_0x070e('0x27')][_0x070e('0x3e')](_0x497f58);})[_0x070e('0x20')](function(_0x30319c){_0x219e48[_0x070e('0x3f')]=_0x30319c;return _0x219e48;})['then'](respondWithFilteredResult(_0x4763c6,_0x497f58))[_0x070e('0x40')](handleError(_0x4763c6,null));};exports['show']=function(_0x5bd39a,_0x398168){var _0x42c448={'raw':!![],'where':{'id':_0x5bd39a['params']['id']}},_0x38879f={};_0x38879f[_0x070e('0x2b')]=_[_0x070e('0x2c')](db[_0x070e('0x27')][_0x070e('0x28')]);_0x38879f['query']=_[_0x070e('0x2c')](_0x5bd39a['query']);_0x38879f['filters']=_['intersection'](_0x38879f[_0x070e('0x2b')],_0x38879f[_0x070e('0x2d')]);_0x42c448[_0x070e('0x2f')]=_[_0x070e('0x30')](_0x38879f[_0x070e('0x2b')],qs['fields'](_0x5bd39a[_0x070e('0x2d')]['fields']));_0x42c448[_0x070e('0x2f')]=_0x42c448[_0x070e('0x2f')][_0x070e('0x31')]?_0x42c448['attributes']:_0x38879f['model'];if(_0x5bd39a[_0x070e('0x2d')]['includeAll']){_0x42c448[_0x070e('0x41')]=[{'all':!![]}];}_0x42c448=_[_0x070e('0x3a')]({},_0x42c448,_0x5bd39a[_0x070e('0x3b')]);return db['SmsTransferReport'][_0x070e('0x42')](_0x42c448)[_0x070e('0x20')](handleEntityNotFound(_0x398168,null))['then'](respondWithResult(_0x398168,null))['catch'](handleError(_0x398168,null));};exports[_0x070e('0x43')]=function(_0x945901,_0x2d43ce){return db[_0x070e('0x27')][_0x070e('0x43')](_0x945901['body'],{})[_0x070e('0x20')](respondWithResult(_0x2d43ce,0xc9))[_0x070e('0x40')](handleError(_0x2d43ce,null));};exports[_0x070e('0x1f')]=function(_0x391dee,_0x79eaa0){if(_0x391dee[_0x070e('0x44')]['id']){delete _0x391dee[_0x070e('0x44')]['id'];}return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x391dee[_0x070e('0x45')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x79eaa0,null))[_0x070e('0x20')](saveUpdates(_0x391dee[_0x070e('0x44')],null))[_0x070e('0x20')](respondWithResult(_0x79eaa0,null))[_0x070e('0x40')](handleError(_0x79eaa0,null));};exports['destroy']=function(_0x171621,_0xa7a41b){return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x171621[_0x070e('0x45')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0xa7a41b,null))[_0x070e('0x20')](removeEntity(_0xa7a41b,null))[_0x070e('0x40')](handleError(_0xa7a41b,null));};exports[_0x070e('0x46')]=function(_0x5744c5,_0x251696){return db['SmsTransferReport'][_0x070e('0x46')]()[_0x070e('0x20')](respondWithResult(_0x251696,null))['catch'](handleError(_0x251696,null));};
\ No newline at end of file
+var _0xe706=['catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','SmsTransferReport','include','findAll','rows','params','includeAll','options','find'];(function(_0x404654,_0x19e0c4){var _0x6ad82c=function(_0x46fbb4){while(--_0x46fbb4){_0x404654['push'](_0x404654['shift']());}};_0x6ad82c(++_0x19e0c4);}(_0xe706,0xa3));var _0x6e70=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xe706[_0x1e7b16];return _0x37fadc;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=_[_0x6e70('0x2c')](db['SmsTransferReport'][_0x6e70('0x2d')],function(_0x406f29){return{'name':_0x406f29[_0x6e70('0x2e')],'type':_0x406f29[_0x6e70('0x2f')][_0x6e70('0x30')]};});_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x2c')](_0x114344,_0x6e70('0x29'));_0x3af17f[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x4a67ac['query']);_0x3af17f[_0x6e70('0x34')]=_['intersection'](_0x3af17f[_0x6e70('0x31')],_0x3af17f['query']);_0x2c4d37[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x3af17f[_0x6e70('0x31')],qs['fields'](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x37')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x31')];if(!_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x39')](_0x6e70('0x3a'))){_0x2c4d37[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x3b')]=qs[_0x6e70('0x3b')](_0x4a67ac['query'][_0x6e70('0x3b')]);}_0x2c4d37['order']=qs[_0x6e70('0x3c')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3c')]);_0x2c4d37[_0x6e70('0x3d')]=qs[_0x6e70('0x34')](_[_0x6e70('0x3e')](_0x4a67ac[_0x6e70('0x32')],_0x3af17f[_0x6e70('0x34')]),_0x114344);if(_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]){_0x2c4d37[_0x6e70('0x3d')]=_[_0x6e70('0x40')](_0x2c4d37[_0x6e70('0x3d')],{'$or':_['map'](_0x114344,function(_0x5446a2){if(_0x5446a2['type']!==_0x6e70('0x41')){var _0x3841a0={};_0x3841a0[_0x5446a2[_0x6e70('0x29')]]={'$like':'%'+_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]+'%'};return _0x3841a0;}})});}_0x2c4d37=_[_0x6e70('0x40')]({},_0x2c4d37,_0x4a67ac['options']);var _0x3b508c={'where':_0x2c4d37[_0x6e70('0x3d')]};return db[_0x6e70('0x42')][_0x6e70('0x1f')](_0x3b508c)[_0x6e70('0x27')](function(_0x37bf46){_0x83c836[_0x6e70('0x1f')]=_0x37bf46;if(_0x4a67ac[_0x6e70('0x32')]['includeAll']){_0x2c4d37[_0x6e70('0x43')]=[{'all':!![]}];}return db[_0x6e70('0x42')][_0x6e70('0x44')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x201da9){_0x83c836[_0x6e70('0x45')]=_0x201da9;return _0x83c836;})[_0x6e70('0x27')](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))['catch'](handleError(_0x54a5fe,null));};exports['show']=function(_0x5ae898,_0x154e0c){var _0x2b63cc={'raw':!![],'where':{'id':_0x5ae898[_0x6e70('0x46')]['id']}},_0x83847b={};_0x83847b[_0x6e70('0x31')]=_['keys'](db[_0x6e70('0x42')][_0x6e70('0x2d')]);_0x83847b[_0x6e70('0x32')]=_['keys'](_0x5ae898['query']);_0x83847b['filters']=_[_0x6e70('0x36')](_0x83847b['model'],_0x83847b[_0x6e70('0x32')]);_0x2b63cc[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x83847b[_0x6e70('0x31')],qs['fields'](_0x5ae898[_0x6e70('0x32')]['fields']));_0x2b63cc[_0x6e70('0x35')]=_0x2b63cc[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2b63cc[_0x6e70('0x35')]:_0x83847b['model'];if(_0x5ae898[_0x6e70('0x32')][_0x6e70('0x47')]){_0x2b63cc[_0x6e70('0x43')]=[{'all':!![]}];}_0x2b63cc=_[_0x6e70('0x40')]({},_0x2b63cc,_0x5ae898[_0x6e70('0x48')]);return db[_0x6e70('0x42')][_0x6e70('0x49')](_0x2b63cc)['then'](handleEntityNotFound(_0x154e0c,null))[_0x6e70('0x27')](respondWithResult(_0x154e0c,null))[_0x6e70('0x4a')](handleError(_0x154e0c,null));};exports[_0x6e70('0x4b')]=function(_0x2f99cb,_0x3f86cf){return db[_0x6e70('0x42')][_0x6e70('0x4b')](_0x2f99cb['body'],{})[_0x6e70('0x27')](respondWithResult(_0x3f86cf,0xc9))['catch'](handleError(_0x3f86cf,null));};exports[_0x6e70('0x26')]=function(_0x3836e4,_0x4b351e){if(_0x3836e4['body']['id']){delete _0x3836e4[_0x6e70('0x4c')]['id'];}return db[_0x6e70('0x42')][_0x6e70('0x49')]({'where':{'id':_0x3836e4['params']['id']}})['then'](handleEntityNotFound(_0x4b351e,null))[_0x6e70('0x27')](saveUpdates(_0x3836e4[_0x6e70('0x4c')],null))[_0x6e70('0x27')](respondWithResult(_0x4b351e,null))[_0x6e70('0x4a')](handleError(_0x4b351e,null));};exports[_0x6e70('0x4d')]=function(_0x340674,_0x4ad5a9){return db[_0x6e70('0x42')][_0x6e70('0x49')]({'where':{'id':_0x340674[_0x6e70('0x46')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x4ad5a9,null))[_0x6e70('0x27')](removeEntity(_0x4ad5a9,null))['catch'](handleError(_0x4ad5a9,null));};exports['describe']=function(_0x2c5538,_0x2e3ea6){return db[_0x6e70('0x42')][_0x6e70('0x4e')]()[_0x6e70('0x27')](respondWithResult(_0x2e3ea6,null))['catch'](handleError(_0x2e3ea6,null));};
\ No newline at end of file
index a33931a..6d912ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd3=['SmsTransferReport','uniqueid','lodash','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x61a1d0,_0x1f8917){var _0xd7c02=function(_0x9c5aa6){while(--_0x9c5aa6){_0x61a1d0['push'](_0x61a1d0['shift']());}};_0xd7c02(++_0x1f8917);}(_0x4bd3,0x174));var _0x34bd=function(_0x183ccf,_0x520361){_0x183ccf=_0x183ccf-0x0;var _0x228613=_0x4bd3[_0x183ccf];return _0x228613;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var logger=require(_0x34bd('0x1'))(_0x34bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bd('0x3'));var rimraf=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var attributes=require('./smsTransferReport.attributes');module[_0x34bd('0x6')]=function(_0x2a15a2,_0x5c2a7a){return _0x2a15a2[_0x34bd('0x7')](_0x34bd('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x34bd('0x9'),'fields':[_0x34bd('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6455=['request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','lodash','../../config/logger','api','moment','bluebird'];(function(_0xa9010e,_0x253a72){var _0x2c7982=function(_0x131bc4){while(--_0x131bc4){_0xa9010e['push'](_0xa9010e['shift']());}};_0x2c7982(++_0x253a72);}(_0x6455,0x97));var _0x5645=function(_0x477827,_0x54430c){_0x477827=_0x477827-0x0;var _0x4cdff4=_0x6455[_0x477827];return _0x4cdff4;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));module[_0x5645('0x9')]=function(_0x9400a8,_0x3a635d){return _0x9400a8[_0x5645('0xa')](_0x5645('0xb'),attributes,{'tableName':_0x5645('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 3b7474b..2a292ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98bf=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x569b5c,_0x2bb790){var _0x86c7ff=function(_0xc07d6a){while(--_0xc07d6a){_0x569b5c['push'](_0x569b5c['shift']());}};_0x86c7ff(++_0x2bb790);}(_0x98bf,0x1b9));var _0xf98b=function(_0x3c498f,_0x1a9eef){_0x3c498f=_0x3c498f-0x0;var _0x2104b8=_0x98bf[_0x3c498f];return _0x2104b8;};'use strict';var _=require('lodash');var util=require(_0xf98b('0x0'));var moment=require(_0xf98b('0x1'));var BPromise=require(_0xf98b('0x2'));var rs=require(_0xf98b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf98b('0x4'))['db'];var utils=require(_0xf98b('0x5'));var logger=require(_0xf98b('0x6'))(_0xf98b('0x7'));var config=require('../../config/environment');var jayson=require(_0xf98b('0x8'));var client=jayson[_0xf98b('0x9')][_0xf98b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ad175,_0x488d6c,_0x3ebde8){return new BPromise(function(_0x2e27ed,_0xb9b226){return client[_0xf98b('0xb')](_0x5ad175,_0x3ebde8)['then'](function(_0x4640ff){logger[_0xf98b('0xc')](_0xf98b('0xd'),_0x488d6c,_0xf98b('0xe'));logger[_0xf98b('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x488d6c,_0xf98b('0xe'),JSON[_0xf98b('0x10')](_0x4640ff));if(_0x4640ff[_0xf98b('0x11')]){if(_0x4640ff['error'][_0xf98b('0x12')]===0x1f4){logger['error'](_0xf98b('0xd'),_0x488d6c,_0x4640ff[_0xf98b('0x11')][_0xf98b('0x13')]);return _0xb9b226(_0x4640ff['error'][_0xf98b('0x13')]);}logger[_0xf98b('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x488d6c,_0x4640ff['error']['message']);return _0x2e27ed(_0x4640ff[_0xf98b('0x11')][_0xf98b('0x13')]);}else{logger[_0xf98b('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x488d6c,_0xf98b('0xe'));_0x2e27ed(_0x4640ff[_0xf98b('0x14')][_0xf98b('0x13')]);}})['catch'](function(_0x5703fa){logger[_0xf98b('0x11')](_0xf98b('0xd'),_0x488d6c,_0x5703fa);_0xb9b226(_0x5703fa);});});}
\ No newline at end of file
+var _0x9352=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','SmsTransferReport,\x20%s,\x20%s','message','catch'];(function(_0x274426,_0xb42258){var _0x59620d=function(_0x4a2ade){while(--_0x4a2ade){_0x274426['push'](_0x274426['shift']());}};_0x59620d(++_0xb42258);}(_0x9352,0xe7));var _0x2935=function(_0x47e5c4,_0x1b3770){_0x47e5c4=_0x47e5c4-0x0;var _0x4c1f1b=_0x9352[_0x47e5c4];return _0x4c1f1b;};'use strict';var _=require(_0x2935('0x0'));var util=require('util');var moment=require(_0x2935('0x1'));var BPromise=require(_0x2935('0x2'));var rs=require(_0x2935('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2935('0x4'))['db'];var utils=require(_0x2935('0x5'));var logger=require(_0x2935('0x6'))(_0x2935('0x7'));var config=require(_0x2935('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2935('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34b2ce,_0x49deea,_0x23bb8f){return new BPromise(function(_0x4b46d1,_0x3ad31a){return client[_0x2935('0xa')](_0x34b2ce,_0x23bb8f)[_0x2935('0xb')](function(_0xb529eb){logger[_0x2935('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x49deea,_0x2935('0xd'));logger[_0x2935('0xe')](_0x2935('0xf'),_0x49deea,_0x2935('0xd'),JSON['stringify'](_0xb529eb));if(_0xb529eb[_0x2935('0x10')]){if(_0xb529eb[_0x2935('0x10')][_0x2935('0x11')]===0x1f4){logger[_0x2935('0x10')](_0x2935('0x12'),_0x49deea,_0xb529eb[_0x2935('0x10')]['message']);return _0x3ad31a(_0xb529eb['error'][_0x2935('0x13')]);}logger[_0x2935('0x10')](_0x2935('0x12'),_0x49deea,_0xb529eb[_0x2935('0x10')][_0x2935('0x13')]);return _0x4b46d1(_0xb529eb[_0x2935('0x10')][_0x2935('0x13')]);}else{logger['info'](_0x2935('0x12'),_0x49deea,_0x2935('0xd'));_0x4b46d1(_0xb529eb['result']['message']);}})[_0x2935('0x14')](function(_0x1b6b09){logger[_0x2935('0x10')](_0x2935('0x12'),_0x49deea,_0x1b6b09);_0x3ad31a(_0x1b6b09);});});}
\ No newline at end of file
index e0e78d0..f8b14ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc05c=['isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get'];(function(_0x56a7a5,_0x3f9444){var _0x19e54d=function(_0x4543a){while(--_0x4543a){_0x56a7a5['push'](_0x56a7a5['shift']());}};_0x19e54d(++_0x3f9444);}(_0xc05c,0xef));var _0xcc05=function(_0x568db6,_0xa9f0c7){_0x568db6=_0x568db6-0x0;var _0x576546=_0xc05c[_0x568db6];return _0x576546;};'use strict';var multer=require('multer');var util=require(_0xcc05('0x0'));var path=require(_0xcc05('0x1'));var timeout=require(_0xcc05('0x2'));var express=require(_0xcc05('0x3'));var router=express[_0xcc05('0x4')]();var auth=require(_0xcc05('0x5'));var interaction=require(_0xcc05('0x6'));var config=require('../../config/environment');var controller=require(_0xcc05('0x7'));router[_0xcc05('0x8')]('/',auth[_0xcc05('0x9')](),controller[_0xcc05('0xa')]);router['get'](_0xcc05('0xb'),auth[_0xcc05('0x9')](),controller[_0xcc05('0xc')]);router['get'](_0xcc05('0xd'),auth['isAuthenticated'](),controller[_0xcc05('0xe')]);var upload=multer({'storage':multer[_0xcc05('0xf')]({'destination':function(_0x3178f4,_0x2a7618,_0x257459){_0x257459(null,path[_0xcc05('0x10')](config['root'],_0xcc05('0x11')));},'filename':function(_0x16d730,_0x20d055,_0x34047b){_0x20d055['originalname']=_0x20d055[_0xcc05('0x12')][_0xcc05('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x34047b(null,util[_0xcc05('0x14')](_0xcc05('0x15'),path[_0xcc05('0x16')](_0x20d055[_0xcc05('0x12')],path[_0xcc05('0x17')](_0x20d055['originalname'])),Date[_0xcc05('0x18')](),path[_0xcc05('0x17')](_0x20d055[_0xcc05('0x12')])));}})});router[_0xcc05('0x19')]('/',upload[_0xcc05('0x1a')]('file'),controller['create']);router[_0xcc05('0x1b')](_0xcc05('0xb'),auth[_0xcc05('0x9')](),controller[_0xcc05('0x1c')]);router[_0xcc05('0x1d')](_0xcc05('0xb'),auth[_0xcc05('0x9')](),controller[_0xcc05('0x1d')]);module[_0xcc05('0x1e')]=router;
\ No newline at end of file
+var _0x99b7=['put','/:id','update','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','file','create'];(function(_0x209180,_0x4ef262){var _0x359174=function(_0x59be0f){while(--_0x59be0f){_0x209180['push'](_0x209180['shift']());}};_0x359174(++_0x4ef262);}(_0x99b7,0x193));var _0x799b=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x99b7[_0x261522];return _0x98a25a;};'use strict';var multer=require('multer');var util=require(_0x799b('0x0'));var path=require('path');var timeout=require(_0x799b('0x1'));var express=require(_0x799b('0x2'));var router=express['Router']();var auth=require(_0x799b('0x3'));var interaction=require(_0x799b('0x4'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x799b('0x5')]('/',auth[_0x799b('0x6')](),controller[_0x799b('0x7')]);router[_0x799b('0x5')]('/:id',auth[_0x799b('0x6')](),controller[_0x799b('0x8')]);router[_0x799b('0x5')](_0x799b('0x9'),auth[_0x799b('0x6')](),controller[_0x799b('0xa')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x300081,_0x261a5e,_0x4518cb){_0x4518cb(null,path[_0x799b('0xb')](config['root'],_0x799b('0xc')));},'filename':function(_0x52611f,_0x311a6c,_0x5a36e6){_0x311a6c[_0x799b('0xd')]=_0x311a6c[_0x799b('0xd')][_0x799b('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a36e6(null,util[_0x799b('0xf')](_0x799b('0x10'),path['basename'](_0x311a6c[_0x799b('0xd')],path[_0x799b('0x11')](_0x311a6c[_0x799b('0xd')])),Date[_0x799b('0x12')](),path[_0x799b('0x11')](_0x311a6c[_0x799b('0xd')])));}})});router[_0x799b('0x13')]('/',upload['single'](_0x799b('0x14')),controller[_0x799b('0x15')]);router[_0x799b('0x16')](_0x799b('0x17'),auth[_0x799b('0x6')](),controller[_0x799b('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module['exports']=router;
\ No newline at end of file
index ae463c5..dc9af72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x158e=['INTEGER','sequelize','exports','STRING','name','FLOAT','BIGINT'];(function(_0x3fba06,_0x3c0243){var _0x4ec6a2=function(_0x166c93){while(--_0x166c93){_0x3fba06['push'](_0x3fba06['shift']());}};_0x4ec6a2(++_0x3c0243);}(_0x158e,0x1a5));var _0xe158=function(_0x408086,_0x4ce9a3){_0x408086=_0x408086-0x0;var _0x2fa65b=_0x158e[_0x408086];return _0x2fa65b;};'use strict';var Sequelize=require(_0xe158('0x0'));module[_0xe158('0x1')]={'name':{'type':Sequelize[_0xe158('0x2')],'unique':_0xe158('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe158('0x2')]},'display_name':{'type':Sequelize[_0xe158('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xe158('0x4')]},'original_sampleCount':{'type':Sequelize[_0xe158('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xe158('0x5')]},'original_sampleRate':{'type':Sequelize[_0xe158('0x6')]},'converted_format':{'type':Sequelize[_0xe158('0x2')]},'converted_duration':{'type':Sequelize[_0xe158('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xe158('0x5')]},'converted_channelCount':{'type':Sequelize[_0xe158('0x6')]},'converted_bitRate':{'type':Sequelize[_0xe158('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xe158('0x6')]}};
\ No newline at end of file
+var _0x8534=['sequelize','exports','STRING','BIGINT','INTEGER'];(function(_0x32d113,_0x283c9d){var _0x5b2ab1=function(_0x556c77){while(--_0x556c77){_0x32d113['push'](_0x32d113['shift']());}};_0x5b2ab1(++_0x283c9d);}(_0x8534,0x145));var _0x4853=function(_0x173585,_0x2286c7){_0x173585=_0x173585-0x0;var _0x5e0672=_0x8534[_0x173585];return _0x5e0672;};'use strict';var Sequelize=require(_0x4853('0x0'));module[_0x4853('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x4853('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x4853('0x2')]},'original_format':{'type':Sequelize[_0x4853('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x4853('0x3')]},'original_channelCount':{'type':Sequelize[_0x4853('0x4')]},'original_bitRate':{'type':Sequelize[_0x4853('0x3')]},'original_sampleRate':{'type':Sequelize[_0x4853('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x4853('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x4853('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x4853('0x4')]}};
\ No newline at end of file
index e3fe1dc..ecfa3c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9682=['get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','Sound','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','includeAll','find','download','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','save_name','create','basename','file','originalname','extname','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','wav','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_sampleRate','body','role','user'];(function(_0x57267d,_0x44976d){var _0x2cab22=function(_0x2dac5e){while(--_0x2dac5e){_0x57267d['push'](_0x57267d['shift']());}};_0x2cab22(++_0x44976d);}(_0x9682,0x1e8));var _0x2968=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9682[_0x3b380d];return _0x54502b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2968('0x0'));var rimraf=require(_0x2968('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2968('0x2'));var moment=require(_0x2968('0x3'));var BPromise=require(_0x2968('0x4'));var Mustache=require(_0x2968('0x5'));var util=require(_0x2968('0x6'));var path=require(_0x2968('0x7'));var sox=require(_0x2968('0x8'));var csv=require(_0x2968('0x9'));var ejs=require(_0x2968('0xa'));var fs=require('fs');var _=require(_0x2968('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2968('0xc'));var toCsv=require(_0x2968('0x9'));var querystring=require(_0x2968('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2968('0xe'));var logger=require(_0x2968('0xf'))('api');var utils=require(_0x2968('0x10'));var config=require(_0x2968('0x11'));var db=require(_0x2968('0x12'))['db'];function respondWithStatusCode(_0x1b07a4,_0x5ac595){_0x5ac595=_0x5ac595||0xcc;return function(_0x2bb37f){if(_0x2bb37f){return _0x1b07a4[_0x2968('0x13')](_0x5ac595);}return _0x1b07a4[_0x2968('0x14')](_0x5ac595)[_0x2968('0x15')]();};}function respondWithResult(_0x297b16,_0xfcf36c){_0xfcf36c=_0xfcf36c||0xc8;return function(_0xb760cf){if(_0xb760cf){return _0x297b16[_0x2968('0x14')](_0xfcf36c)[_0x2968('0x16')](_0xb760cf);}};}function respondWithFilteredResult(_0x2eee15,_0x92e611){return function(_0x562068){if(_0x562068){var _0x38e540=_0x562068[_0x2968('0x17')],_0x3b5f48=_0x92e611['offset'],_0x19ad91=_0x92e611[_0x2968('0x18')]+_0x92e611[_0x2968('0x19')],_0x2655b2;if(_0x19ad91>=_0x38e540){_0x19ad91=_0x38e540;_0x2655b2=0xc8;}else{_0x2655b2=0xce;}_0x2eee15[_0x2968('0x14')](_0x2655b2);return _0x2eee15[_0x2968('0x1a')](_0x2968('0x1b'),_0x3b5f48+'-'+_0x19ad91+'/'+_0x38e540)[_0x2968('0x16')](_0x562068);}return null;};}function patchUpdates(_0x51b132){return function(_0x4468af){try{jsonpatch[_0x2968('0x1c')](_0x4468af,_0x51b132,!![]);}catch(_0x3af08d){return BPromise[_0x2968('0x1d')](_0x3af08d);}return _0x4468af[_0x2968('0x1e')]();};}function saveUpdates(_0x5313bb,_0x257ce4){return function(_0x51a396){if(_0x51a396){return _0x51a396[_0x2968('0x1f')](_0x5313bb)[_0x2968('0x20')](function(_0x353387){return _0x353387;});}return null;};}function removeEntity(_0x55fdf6,_0x226bdd){return function(_0x14fe14){if(_0x14fe14){return _0x14fe14[_0x2968('0x21')]()[_0x2968('0x20')](function(){var _0x4bea6d=_0x14fe14['get']({'plain':!![]});var _0x4bec85=_0x2968('0x22');return db[_0x2968('0x23')][_0x2968('0x21')]({'where':{'type':_0x4bec85,'resourceId':_0x4bea6d['id']}})[_0x2968('0x20')](function(){return _0x14fe14;});})['then'](function(){_0x55fdf6[_0x2968('0x14')](0xcc)[_0x2968('0x15')]();});}};}function handleEntityNotFound(_0x30ea74,_0x1b37f2){return function(_0x34566d){if(!_0x34566d){_0x30ea74[_0x2968('0x13')](0x194);}return _0x34566d;};}function handleError(_0x3fb6c1,_0x1b85fa){_0x1b85fa=_0x1b85fa||0x1f4;return function(_0x1efd27){logger[_0x2968('0x24')](_0x1efd27[_0x2968('0x25')]);if(_0x1efd27[_0x2968('0x26')]){delete _0x1efd27[_0x2968('0x26')];}_0x3fb6c1['status'](_0x1b85fa)[_0x2968('0x27')](_0x1efd27);};}exports[_0x2968('0x28')]=function(_0x59ea28,_0xed57b0){var _0x33dbb5={},_0x16eb42={},_0x528e6e={'count':0x0,'rows':[]};var _0x830613=_['map'](db[_0x2968('0x29')][_0x2968('0x2a')],function(_0x2e13d5){return{'name':_0x2e13d5[_0x2968('0x2b')],'type':_0x2e13d5[_0x2968('0x2c')][_0x2968('0x2d')]};});_0x16eb42[_0x2968('0x2e')]=_[_0x2968('0x2f')](_0x830613,'name');_0x16eb42['query']=_[_0x2968('0x30')](_0x59ea28[_0x2968('0x31')]);_0x16eb42[_0x2968('0x32')]=_[_0x2968('0x33')](_0x16eb42[_0x2968('0x2e')],_0x16eb42[_0x2968('0x31')]);_0x33dbb5[_0x2968('0x34')]=_[_0x2968('0x33')](_0x16eb42[_0x2968('0x2e')],qs[_0x2968('0x35')](_0x59ea28[_0x2968('0x31')]['fields']));_0x33dbb5['attributes']=_0x33dbb5[_0x2968('0x34')][_0x2968('0x36')]?_0x33dbb5[_0x2968('0x34')]:_0x16eb42[_0x2968('0x2e')];if(!_0x59ea28['query'][_0x2968('0x37')](_0x2968('0x38'))){_0x33dbb5[_0x2968('0x19')]=qs[_0x2968('0x19')](_0x59ea28['query']['limit']);_0x33dbb5[_0x2968('0x18')]=qs['offset'](_0x59ea28[_0x2968('0x31')][_0x2968('0x18')]);}_0x33dbb5[_0x2968('0x39')]=qs[_0x2968('0x3a')](_0x59ea28[_0x2968('0x31')][_0x2968('0x3a')]);_0x33dbb5[_0x2968('0x3b')]=qs[_0x2968('0x32')](_[_0x2968('0x3c')](_0x59ea28['query'],_0x16eb42[_0x2968('0x32')]),_0x830613);if(_0x59ea28[_0x2968('0x31')]['filter']){_0x33dbb5[_0x2968('0x3b')]=_[_0x2968('0x3d')](_0x33dbb5[_0x2968('0x3b')],{'$or':_[_0x2968('0x2f')](_0x830613,function(_0xdd93f3){if(_0xdd93f3[_0x2968('0x2c')]!=='VIRTUAL'){var _0x4d401={};_0x4d401[_0xdd93f3['name']]={'$like':'%'+_0x59ea28[_0x2968('0x31')][_0x2968('0x3e')]+'%'};return _0x4d401;}})});}_0x33dbb5=_[_0x2968('0x3d')]({},_0x33dbb5,_0x59ea28[_0x2968('0x3f')]);var _0x18fd70={'where':_0x33dbb5[_0x2968('0x3b')]};return db[_0x2968('0x29')][_0x2968('0x17')](_0x18fd70)[_0x2968('0x20')](function(_0x1c9d71){_0x528e6e['count']=_0x1c9d71;if(_0x59ea28[_0x2968('0x31')]['includeAll']){_0x33dbb5[_0x2968('0x40')]=[{'all':!![]}];}return db[_0x2968('0x29')][_0x2968('0x41')](_0x33dbb5);})[_0x2968('0x20')](function(_0x2ee977){_0x528e6e[_0x2968('0x42')]=_0x2ee977;return _0x528e6e;})['then'](respondWithFilteredResult(_0xed57b0,_0x33dbb5))[_0x2968('0x43')](handleError(_0xed57b0,null));};exports[_0x2968('0x44')]=function(_0x1a5e2e,_0x5ec422){var _0x153c10={'raw':!![],'where':{'id':_0x1a5e2e[_0x2968('0x45')]['id']}},_0xbb60c={};_0xbb60c['model']=_[_0x2968('0x30')](db[_0x2968('0x29')][_0x2968('0x2a')]);_0xbb60c[_0x2968('0x31')]=_[_0x2968('0x30')](_0x1a5e2e[_0x2968('0x31')]);_0xbb60c[_0x2968('0x32')]=_[_0x2968('0x33')](_0xbb60c[_0x2968('0x2e')],_0xbb60c['query']);_0x153c10['attributes']=_['intersection'](_0xbb60c['model'],qs[_0x2968('0x35')](_0x1a5e2e['query'][_0x2968('0x35')]));_0x153c10[_0x2968('0x34')]=_0x153c10[_0x2968('0x34')][_0x2968('0x36')]?_0x153c10[_0x2968('0x34')]:_0xbb60c[_0x2968('0x2e')];if(_0x1a5e2e[_0x2968('0x31')][_0x2968('0x46')]){_0x153c10[_0x2968('0x40')]=[{'all':!![]}];}_0x153c10=_['merge']({},_0x153c10,_0x1a5e2e[_0x2968('0x3f')]);return db[_0x2968('0x29')][_0x2968('0x47')](_0x153c10)[_0x2968('0x20')](handleEntityNotFound(_0x5ec422,null))[_0x2968('0x20')](respondWithResult(_0x5ec422,null))[_0x2968('0x43')](handleError(_0x5ec422,null));};exports[_0x2968('0x48')]=function(_0x4edd6a,_0x41d514,_0x36dae1){return db['Sound'][_0x2968('0x47')]({'where':{'id':_0x4edd6a[_0x2968('0x45')]['id']},'attributes':[_0x2968('0x26'),'save_name',_0x2968('0x49')],'raw':!![]})[_0x2968('0x20')](handleEntityNotFound(_0x41d514,null))[_0x2968('0x20')](function(_0x4741cc){if(_0x4741cc){if(!fs[_0x2968('0x4a')](path[_0x2968('0x4b')](config[_0x2968('0x4c')],'server/files/sounds/converted',_0x4741cc['save_name']+'.'+_0x4741cc[_0x2968('0x49')]))){throw new db[(_0x2968('0x4d'))][(_0x2968('0x4e'))](_0x2968('0x4f'));}return _0x41d514[_0x2968('0x48')](path['join'](config[_0x2968('0x4c')],_0x2968('0x50'),util[_0x2968('0x51')](_0x2968('0x52'),_0x4741cc[_0x2968('0x53')],_0x4741cc[_0x2968('0x49')])),util[_0x2968('0x51')](_0x2968('0x52'),_0x4741cc[_0x2968('0x26')],_0x4741cc['converted_format']));}return null;})['catch'](handleError(_0x41d514,null));};exports[_0x2968('0x54')]=function(_0x252e54,_0x4450f0,_0x31a672){var _0x41dc0d={'name':path[_0x2968('0x55')](_0x252e54[_0x2968('0x56')][_0x2968('0x57')],path[_0x2968('0x58')](_0x252e54[_0x2968('0x56')][_0x2968('0x57')])),'save_name':path['basename'](_0x252e54[_0x2968('0x56')][_0x2968('0x59')],path[_0x2968('0x58')](_0x252e54[_0x2968('0x56')][_0x2968('0x59')])),'original_format':path[_0x2968('0x58')](_0x252e54['file'][_0x2968('0x57')])['substring'](0x1),'converted_format':'wav'};var _0x6f164e=path[_0x2968('0x4b')](config[_0x2968('0x4c')],_0x2968('0x5a'),_0x252e54['file'][_0x2968('0x59')]);var _0x521830=path[_0x2968('0x4b')](config[_0x2968('0x4c')],_0x2968('0x50'),util[_0x2968('0x51')](_0x2968('0x52'),path[_0x2968('0x55')](_0x252e54[_0x2968('0x56')][_0x2968('0x59')],path[_0x2968('0x58')](_0x252e54[_0x2968('0x56')][_0x2968('0x59')])),_0x41dc0d[_0x2968('0x49')]));logger[_0x2968('0x5b')](_0x2968('0x5c'),_0x6f164e);logger[_0x2968('0x5b')]('Sound\x20upload\x20destination:\x20%s',_0x521830);try{fs[_0x2968('0x5d')](_0x6f164e,parseInt('0777',0x8));var _0x564a18=sox[_0x2968('0x5e')](_0x6f164e,_0x521830,{'sampleRate':0x1f40,'format':_0x2968('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x564a18['on'](_0x2968('0x24'),function(_0x283bd0){fs['unlinkSync'](_0x6f164e);_0x4450f0[_0x2968('0x14')](0x1f4)[_0x2968('0x27')](_0x283bd0);});_0x564a18['on'](_0x2968('0x60'),function(_0x4e75f0){_0x41dc0d[_0x2968('0x61')]=isNaN(_0x4e75f0[_0x2968('0x62')])?null:_0x4e75f0[_0x2968('0x62')]*0x3e8;_0x41dc0d[_0x2968('0x63')]=isNaN(_0x4e75f0[_0x2968('0x64')])?null:_0x4e75f0['sampleCount'];_0x41dc0d[_0x2968('0x65')]=isNaN(_0x4e75f0[_0x2968('0x66')])?null:_0x4e75f0[_0x2968('0x66')];_0x41dc0d[_0x2968('0x67')]=isNaN(_0x4e75f0[_0x2968('0x68')])?null:_0x4e75f0[_0x2968('0x68')];_0x41dc0d[_0x2968('0x69')]=isNaN(_0x4e75f0['sampleRate'])?null:_0x4e75f0[_0x2968('0x6a')];});_0x564a18['on']('dest',function(_0x1a8486){_0x41dc0d['converted_duration']=isNaN(_0x1a8486['duration'])?null:_0x1a8486['duration']*0x3e8;_0x41dc0d[_0x2968('0x6b')]=isNaN(_0x1a8486[_0x2968('0x64')])?null:_0x1a8486[_0x2968('0x64')];_0x41dc0d['converted_channelCount']=isNaN(_0x1a8486[_0x2968('0x66')])?null:_0x1a8486[_0x2968('0x66')];_0x41dc0d['converted_bitRate']=isNaN(_0x1a8486[_0x2968('0x68')])?null:_0x1a8486['bitRate'];_0x41dc0d[_0x2968('0x6c')]=isNaN(_0x1a8486[_0x2968('0x6a')])?null:_0x1a8486['sampleRate'];});_0x564a18['on'](_0x2968('0x15'),function(){fs[_0x2968('0x5d')](_0x521830,parseInt('0777',0x8));return db['Sound'][_0x2968('0x54')](_0x41dc0d)['then'](function(_0x1bc99f){var _0x4b15d7={'role':_0x252e54[_0x2968('0x6d')][_0x2968('0x6e')],'userProfileId':_0x252e54['body']['userProfileId']};if(!_0x4b15d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b15d7[_0x2968('0x6e')]===_0x2968('0x6f')){var _0x23b012=_0x1bc99f[_0x2968('0x70')]({'plain':!![]});return db[_0x2968('0x71')]['find']({'where':{'name':_0x2968('0x22'),'userProfileId':_0x4b15d7['userProfileId']},'raw':!![]})['then'](function(_0x20144c){if(_0x20144c&&_0x20144c[_0x2968('0x72')]===0x0){return db['UserProfileResource'][_0x2968('0x54')]({'name':_0x23b012[_0x2968('0x26')],'resourceId':_0x23b012['id'],'type':_0x20144c[_0x2968('0x26')],'sectionId':_0x20144c['id']},{})[_0x2968('0x20')](function(){return _0x1bc99f;});}else{return _0x1bc99f;}})['catch'](function(_0x3ef550){logger[_0x2968('0x24')](_0x2968('0x73'),_0x3ef550);throw _0x3ef550;});}return _0x1bc99f;})[_0x2968('0x20')](respondWithResult(_0x4450f0,null))['catch'](handleError(_0x4450f0,null));});_0x564a18[_0x2968('0x74')]();}catch(_0x37801d){_0x4450f0['status'](0x1f4)[_0x2968('0x27')](_0x37801d);}};exports[_0x2968('0x1f')]=function(_0x1ea369,_0x6fee1f,_0x4e32a1){return db['Sound'][_0x2968('0x47')]({'where':{'id':_0x1ea369[_0x2968('0x45')]['id']}})['then'](handleEntityNotFound(_0x6fee1f,null))[_0x2968('0x20')](saveUpdates(_['pick'](_0x1ea369[_0x2968('0x6d')],[_0x2968('0x26'),_0x2968('0x75')]),null))[_0x2968('0x20')](respondWithResult(_0x6fee1f,null))['catch'](handleError(_0x6fee1f,null));};exports[_0x2968('0x76')]=function(_0x4930eb,_0x25ff8a,_0x4b8e0a){return db[_0x2968('0x29')][_0x2968('0x47')]({'where':{'id':_0x4930eb['params']['id']}})[_0x2968('0x20')](function(_0x279ca8){if(_0x279ca8){return _0x279ca8[_0x2968('0x21')]();}})[_0x2968('0x20')](function(_0x56adbf){var _0x484f7c=path['join'](config['root'],_0x2968('0x5a'),util[_0x2968('0x51')]('%s.%s',_0x56adbf[_0x2968('0x53')],_0x56adbf['original_format']));var _0x2ff68f=path[_0x2968('0x4b')](config[_0x2968('0x4c')],_0x2968('0x50'),util['format'](_0x2968('0x52'),_0x56adbf[_0x2968('0x53')],_0x56adbf['converted_format']));fs[_0x2968('0x77')](_0x484f7c);fs[_0x2968('0x77')](_0x2ff68f);return _0x56adbf;})[_0x2968('0x20')](function(_0x1736fe){if(_0x1736fe){return _0x25ff8a[_0x2968('0x14')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x25ff8a,null))['catch'](handleError(_0x25ff8a,null));};
\ No newline at end of file
+var _0x4576=['sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','Sound','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','findAll','rows','catch','params','length','include','merge','find','save_name','converted_format','join','root','server/files/sounds/converted','Sound\x20not\x20found','download','format','%s.%s','create','file','originalname','extname','filename','substring','basename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','error','unlinkSync','original_duration','duration','original_sampleCount'];(function(_0x532e3c,_0x54fd19){var _0x76d74b=function(_0x33c005){while(--_0x33c005){_0x532e3c['push'](_0x532e3c['shift']());}};_0x76d74b(++_0x54fd19);}(_0x4576,0x17f));var _0x6457=function(_0xa75cb1,_0x3c4b1f){_0xa75cb1=_0xa75cb1-0x0;var _0xe6f1a3=_0x4576[_0xa75cb1];return _0xe6f1a3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6457('0x0'));var rimraf=require(_0x6457('0x1'));var zipdir=require(_0x6457('0x2'));var jsonpatch=require(_0x6457('0x3'));var rp=require(_0x6457('0x4'));var moment=require(_0x6457('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6457('0x6'));var util=require(_0x6457('0x7'));var path=require('path');var sox=require(_0x6457('0x8'));var csv=require('to-csv');var ejs=require(_0x6457('0x9'));var fs=require('fs');var _=require(_0x6457('0xa'));var squel=require('squel');var crypto=require(_0x6457('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6457('0xc'));var toCsv=require(_0x6457('0xd'));var querystring=require(_0x6457('0xe'));var Papa=require(_0x6457('0xf'));var Redis=require(_0x6457('0x10'));var authService=require(_0x6457('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6457('0x12'));var logger=require(_0x6457('0x13'))('api');var utils=require(_0x6457('0x14'));var config=require('../../config/environment');var db=require(_0x6457('0x15'))['db'];function respondWithStatusCode(_0x3bb5dd,_0x3e3150){_0x3e3150=_0x3e3150||0xcc;return function(_0x43988a){if(_0x43988a){return _0x3bb5dd[_0x6457('0x16')](_0x3e3150);}return _0x3bb5dd[_0x6457('0x17')](_0x3e3150)[_0x6457('0x18')]();};}function respondWithResult(_0xa8f9cf,_0x126564){_0x126564=_0x126564||0xc8;return function(_0x586a7f){if(_0x586a7f){return _0xa8f9cf[_0x6457('0x17')](_0x126564)[_0x6457('0x19')](_0x586a7f);}};}function respondWithFilteredResult(_0xa7075,_0xb2f2c5){return function(_0x1dc9e1){if(_0x1dc9e1){var _0x2b68dc=_0x1dc9e1[_0x6457('0x1a')],_0x29b967=_0xb2f2c5[_0x6457('0x1b')],_0x2ab8cb=_0xb2f2c5[_0x6457('0x1b')]+_0xb2f2c5[_0x6457('0x1c')],_0x1d8ec8;if(_0x2ab8cb>=_0x2b68dc){_0x2ab8cb=_0x2b68dc;_0x1d8ec8=0xc8;}else{_0x1d8ec8=0xce;}_0xa7075[_0x6457('0x17')](_0x1d8ec8);return _0xa7075[_0x6457('0x1d')](_0x6457('0x1e'),_0x29b967+'-'+_0x2ab8cb+'/'+_0x2b68dc)[_0x6457('0x19')](_0x1dc9e1);}return null;};}function patchUpdates(_0x47be6b){return function(_0x4b89c4){try{jsonpatch[_0x6457('0x1f')](_0x4b89c4,_0x47be6b,!![]);}catch(_0x82f905){return BPromise[_0x6457('0x20')](_0x82f905);}return _0x4b89c4[_0x6457('0x21')]();};}function saveUpdates(_0x5561b4,_0xae9679){return function(_0x765068){if(_0x765068){return _0x765068[_0x6457('0x22')](_0x5561b4)[_0x6457('0x23')](function(_0x466d01){return _0x466d01;});}return null;};}function removeEntity(_0x574dc1,_0x32d00c){return function(_0x1c06a8){if(_0x1c06a8){return _0x1c06a8[_0x6457('0x24')]()['then'](function(){var _0x1a82d1=_0x1c06a8[_0x6457('0x25')]({'plain':!![]});var _0x5497a0='Sounds';return db[_0x6457('0x26')][_0x6457('0x24')]({'where':{'type':_0x5497a0,'resourceId':_0x1a82d1['id']}})[_0x6457('0x23')](function(){return _0x1c06a8;});})[_0x6457('0x23')](function(){_0x574dc1[_0x6457('0x17')](0xcc)[_0x6457('0x18')]();});}};}function handleEntityNotFound(_0xe9a619,_0x5a8c52){return function(_0x580e96){if(!_0x580e96){_0xe9a619[_0x6457('0x16')](0x194);}return _0x580e96;};}function handleError(_0x5876d6,_0xfc8c0){_0xfc8c0=_0xfc8c0||0x1f4;return function(_0x1243b1){logger['error'](_0x1243b1[_0x6457('0x27')]);if(_0x1243b1[_0x6457('0x28')]){delete _0x1243b1[_0x6457('0x28')];}_0x5876d6[_0x6457('0x17')](_0xfc8c0)[_0x6457('0x29')](_0x1243b1);};}exports[_0x6457('0x2a')]=function(_0x454bf7,_0x242c59){var _0x462e13={},_0x49a783={},_0x2edf7d={'count':0x0,'rows':[]};var _0x5095b8=_['map'](db[_0x6457('0x2b')][_0x6457('0x2c')],function(_0x48273b){return{'name':_0x48273b['fieldName'],'type':_0x48273b[_0x6457('0x2d')][_0x6457('0x2e')]};});_0x49a783[_0x6457('0x2f')]=_['map'](_0x5095b8,_0x6457('0x28'));_0x49a783[_0x6457('0x30')]=_[_0x6457('0x31')](_0x454bf7[_0x6457('0x30')]);_0x49a783[_0x6457('0x32')]=_[_0x6457('0x33')](_0x49a783['model'],_0x49a783[_0x6457('0x30')]);_0x462e13[_0x6457('0x34')]=_[_0x6457('0x33')](_0x49a783[_0x6457('0x2f')],qs[_0x6457('0x35')](_0x454bf7[_0x6457('0x30')][_0x6457('0x35')]));_0x462e13[_0x6457('0x34')]=_0x462e13[_0x6457('0x34')]['length']?_0x462e13[_0x6457('0x34')]:_0x49a783[_0x6457('0x2f')];if(!_0x454bf7['query'][_0x6457('0x36')](_0x6457('0x37'))){_0x462e13['limit']=qs[_0x6457('0x1c')](_0x454bf7['query'][_0x6457('0x1c')]);_0x462e13[_0x6457('0x1b')]=qs['offset'](_0x454bf7[_0x6457('0x30')][_0x6457('0x1b')]);}_0x462e13[_0x6457('0x38')]=qs[_0x6457('0x39')](_0x454bf7['query'][_0x6457('0x39')]);_0x462e13[_0x6457('0x3a')]=qs['filters'](_['pick'](_0x454bf7[_0x6457('0x30')],_0x49a783[_0x6457('0x32')]),_0x5095b8);if(_0x454bf7['query'][_0x6457('0x3b')]){_0x462e13[_0x6457('0x3a')]=_['merge'](_0x462e13[_0x6457('0x3a')],{'$or':_['map'](_0x5095b8,function(_0x4468f6){if(_0x4468f6['type']!=='VIRTUAL'){var _0x703f55={};_0x703f55[_0x4468f6['name']]={'$like':'%'+_0x454bf7[_0x6457('0x30')][_0x6457('0x3b')]+'%'};return _0x703f55;}})});}_0x462e13=_['merge']({},_0x462e13,_0x454bf7[_0x6457('0x3c')]);var _0x10bd9e={'where':_0x462e13[_0x6457('0x3a')]};return db[_0x6457('0x2b')]['count'](_0x10bd9e)[_0x6457('0x23')](function(_0x3fd0d8){_0x2edf7d['count']=_0x3fd0d8;if(_0x454bf7[_0x6457('0x30')][_0x6457('0x3d')]){_0x462e13['include']=[{'all':!![]}];}return db[_0x6457('0x2b')][_0x6457('0x3e')](_0x462e13);})[_0x6457('0x23')](function(_0x28636e){_0x2edf7d[_0x6457('0x3f')]=_0x28636e;return _0x2edf7d;})['then'](respondWithFilteredResult(_0x242c59,_0x462e13))[_0x6457('0x40')](handleError(_0x242c59,null));};exports['show']=function(_0x23aae0,_0x5ac4b1){var _0xb1540e={'raw':!![],'where':{'id':_0x23aae0[_0x6457('0x41')]['id']}},_0x52178c={};_0x52178c['model']=_['keys'](db[_0x6457('0x2b')][_0x6457('0x2c')]);_0x52178c[_0x6457('0x30')]=_[_0x6457('0x31')](_0x23aae0['query']);_0x52178c['filters']=_['intersection'](_0x52178c['model'],_0x52178c[_0x6457('0x30')]);_0xb1540e[_0x6457('0x34')]=_['intersection'](_0x52178c['model'],qs['fields'](_0x23aae0[_0x6457('0x30')][_0x6457('0x35')]));_0xb1540e['attributes']=_0xb1540e['attributes'][_0x6457('0x42')]?_0xb1540e['attributes']:_0x52178c['model'];if(_0x23aae0[_0x6457('0x30')][_0x6457('0x3d')]){_0xb1540e[_0x6457('0x43')]=[{'all':!![]}];}_0xb1540e=_[_0x6457('0x44')]({},_0xb1540e,_0x23aae0[_0x6457('0x3c')]);return db['Sound'][_0x6457('0x45')](_0xb1540e)[_0x6457('0x23')](handleEntityNotFound(_0x5ac4b1,null))['then'](respondWithResult(_0x5ac4b1,null))[_0x6457('0x40')](handleError(_0x5ac4b1,null));};exports['download']=function(_0xb9f3b3,_0x51bcbf,_0x601c98){return db[_0x6457('0x2b')]['find']({'where':{'id':_0xb9f3b3['params']['id']},'attributes':['name',_0x6457('0x46'),_0x6457('0x47')],'raw':!![]})[_0x6457('0x23')](handleEntityNotFound(_0x51bcbf,null))[_0x6457('0x23')](function(_0x1195ef){if(_0x1195ef){if(!fs['existsSync'](path[_0x6457('0x48')](config[_0x6457('0x49')],_0x6457('0x4a'),_0x1195ef['save_name']+'.'+_0x1195ef[_0x6457('0x47')]))){throw new db['Sequelize']['ValidationError'](_0x6457('0x4b'));}return _0x51bcbf[_0x6457('0x4c')](path['join'](config[_0x6457('0x49')],_0x6457('0x4a'),util['format']('%s.%s',_0x1195ef[_0x6457('0x46')],_0x1195ef['converted_format'])),util[_0x6457('0x4d')](_0x6457('0x4e'),_0x1195ef[_0x6457('0x28')],_0x1195ef[_0x6457('0x47')]));}return null;})[_0x6457('0x40')](handleError(_0x51bcbf,null));};exports[_0x6457('0x4f')]=function(_0x2af34b,_0x2a8c7b,_0x4b1d69){var _0x3c9b9d={'name':path['basename'](_0x2af34b[_0x6457('0x50')][_0x6457('0x51')],path[_0x6457('0x52')](_0x2af34b[_0x6457('0x50')][_0x6457('0x51')])),'save_name':path['basename'](_0x2af34b[_0x6457('0x50')]['filename'],path[_0x6457('0x52')](_0x2af34b[_0x6457('0x50')][_0x6457('0x53')])),'original_format':path[_0x6457('0x52')](_0x2af34b[_0x6457('0x50')][_0x6457('0x51')])[_0x6457('0x54')](0x1),'converted_format':'wav'};var _0x3874b6=path[_0x6457('0x48')](config[_0x6457('0x49')],'server/files/sounds/original',_0x2af34b[_0x6457('0x50')][_0x6457('0x53')]);var _0x3e307d=path[_0x6457('0x48')](config[_0x6457('0x49')],_0x6457('0x4a'),util[_0x6457('0x4d')](_0x6457('0x4e'),path[_0x6457('0x55')](_0x2af34b['file'][_0x6457('0x53')],path['extname'](_0x2af34b['file'][_0x6457('0x53')])),_0x3c9b9d[_0x6457('0x47')]));logger[_0x6457('0x56')]('Sound\x20upload\x20filepath:\x20%s',_0x3874b6);logger[_0x6457('0x56')](_0x6457('0x57'),_0x3e307d);try{fs[_0x6457('0x58')](_0x3874b6,parseInt(_0x6457('0x59'),0x8));var _0x29b800=sox[_0x6457('0x5a')](_0x3874b6,_0x3e307d,{'sampleRate':0x1f40,'format':_0x6457('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x29b800['on'](_0x6457('0x5c'),function(_0x3c570a){fs[_0x6457('0x5d')](_0x3874b6);_0x2a8c7b[_0x6457('0x17')](0x1f4)[_0x6457('0x29')](_0x3c570a);});_0x29b800['on']('src',function(_0x22097c){_0x3c9b9d[_0x6457('0x5e')]=isNaN(_0x22097c[_0x6457('0x5f')])?null:_0x22097c[_0x6457('0x5f')]*0x3e8;_0x3c9b9d[_0x6457('0x60')]=isNaN(_0x22097c[_0x6457('0x61')])?null:_0x22097c[_0x6457('0x61')];_0x3c9b9d[_0x6457('0x62')]=isNaN(_0x22097c[_0x6457('0x63')])?null:_0x22097c[_0x6457('0x63')];_0x3c9b9d[_0x6457('0x64')]=isNaN(_0x22097c[_0x6457('0x65')])?null:_0x22097c[_0x6457('0x65')];_0x3c9b9d[_0x6457('0x66')]=isNaN(_0x22097c[_0x6457('0x67')])?null:_0x22097c[_0x6457('0x67')];});_0x29b800['on'](_0x6457('0x68'),function(_0x50e498){_0x3c9b9d[_0x6457('0x69')]=isNaN(_0x50e498[_0x6457('0x5f')])?null:_0x50e498[_0x6457('0x5f')]*0x3e8;_0x3c9b9d[_0x6457('0x6a')]=isNaN(_0x50e498[_0x6457('0x61')])?null:_0x50e498['sampleCount'];_0x3c9b9d['converted_channelCount']=isNaN(_0x50e498[_0x6457('0x63')])?null:_0x50e498[_0x6457('0x63')];_0x3c9b9d[_0x6457('0x6b')]=isNaN(_0x50e498[_0x6457('0x65')])?null:_0x50e498['bitRate'];_0x3c9b9d['converted_sampleRate']=isNaN(_0x50e498[_0x6457('0x67')])?null:_0x50e498[_0x6457('0x67')];});_0x29b800['on']('end',function(){fs[_0x6457('0x58')](_0x3e307d,parseInt(_0x6457('0x59'),0x8));return db[_0x6457('0x2b')][_0x6457('0x4f')](_0x3c9b9d)[_0x6457('0x23')](function(_0x2e1ad1){var _0x159a06={'role':_0x2af34b['body'][_0x6457('0x6c')],'userProfileId':_0x2af34b[_0x6457('0x6d')]['userProfileId']};if(!_0x159a06)throw new Error(_0x6457('0x6e'));if(_0x159a06[_0x6457('0x6c')]===_0x6457('0x6f')){var _0x24248c=_0x2e1ad1[_0x6457('0x25')]({'plain':!![]});return db[_0x6457('0x70')][_0x6457('0x45')]({'where':{'name':'Sounds','userProfileId':_0x159a06['userProfileId']},'raw':!![]})[_0x6457('0x23')](function(_0x2cca03){if(_0x2cca03&&_0x2cca03[_0x6457('0x71')]===0x0){return db[_0x6457('0x26')][_0x6457('0x4f')]({'name':_0x24248c[_0x6457('0x28')],'resourceId':_0x24248c['id'],'type':_0x2cca03['name'],'sectionId':_0x2cca03['id']},{})[_0x6457('0x23')](function(){return _0x2e1ad1;});}else{return _0x2e1ad1;}})['catch'](function(_0x183424){logger[_0x6457('0x5c')](_0x6457('0x72'),_0x183424);throw _0x183424;});}return _0x2e1ad1;})[_0x6457('0x23')](respondWithResult(_0x2a8c7b,null))[_0x6457('0x40')](handleError(_0x2a8c7b,null));});_0x29b800[_0x6457('0x73')]();}catch(_0x54379d){_0x2a8c7b['status'](0x1f4)[_0x6457('0x29')](_0x54379d);}};exports[_0x6457('0x22')]=function(_0x2b4e38,_0x57e376,_0x3fb499){return db[_0x6457('0x2b')][_0x6457('0x45')]({'where':{'id':_0x2b4e38[_0x6457('0x41')]['id']}})[_0x6457('0x23')](handleEntityNotFound(_0x57e376,null))[_0x6457('0x23')](saveUpdates(_[_0x6457('0x74')](_0x2b4e38[_0x6457('0x6d')],[_0x6457('0x28'),_0x6457('0x75')]),null))[_0x6457('0x23')](respondWithResult(_0x57e376,null))['catch'](handleError(_0x57e376,null));};exports[_0x6457('0x76')]=function(_0x38683b,_0x2df244,_0x134feb){return db['Sound']['find']({'where':{'id':_0x38683b[_0x6457('0x41')]['id']}})[_0x6457('0x23')](function(_0x17540d){if(_0x17540d){return _0x17540d[_0x6457('0x24')]();}})[_0x6457('0x23')](function(_0x659669){var _0x53eb0a=path[_0x6457('0x48')](config[_0x6457('0x49')],'server/files/sounds/original',util['format'](_0x6457('0x4e'),_0x659669[_0x6457('0x46')],_0x659669[_0x6457('0x77')]));var _0x55dfd5=path['join'](config[_0x6457('0x49')],'server/files/sounds/converted',util[_0x6457('0x4d')]('%s.%s',_0x659669[_0x6457('0x46')],_0x659669[_0x6457('0x47')]));fs['unlinkSync'](_0x53eb0a);fs[_0x6457('0x5d')](_0x55dfd5);return _0x659669;})['then'](function(_0x3a6275){if(_0x3a6275){return _0x2df244['status'](0xcc)[_0x6457('0x18')]();}})['then'](handleEntityNotFound(_0x2df244,null))['catch'](handleError(_0x2df244,null));};
\ No newline at end of file
index cc70a22..8671d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13b5=['../../config/environment','exports','define','Sound','tools_sounds','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x35cabc,_0xc0f89a){var _0x2af2b9=function(_0x7490fb){while(--_0x7490fb){_0x35cabc['push'](_0x35cabc['shift']());}};_0x2af2b9(++_0xc0f89a);}(_0x13b5,0x185));var _0x513b=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x13b5[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x513b('0x0'));var util=require(_0x513b('0x1'));var logger=require('../../config/logger')(_0x513b('0x2'));var moment=require(_0x513b('0x3'));var BPromise=require(_0x513b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x513b('0x5'));var rimraf=require(_0x513b('0x6'));var config=require(_0x513b('0x7'));var attributes=require('./sound.attributes');module[_0x513b('0x8')]=function(_0x7d93fa,_0xc4735b){return _0x7d93fa[_0x513b('0x9')](_0x513b('0xa'),attributes,{'tableName':_0x513b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xddac=['tools_sounds','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x3f85e8,_0x21f569){var _0x4ed379=function(_0x467741){while(--_0x467741){_0x3f85e8['push'](_0x3f85e8['shift']());}};_0x4ed379(++_0x21f569);}(_0xddac,0x6d));var _0xcdda=function(_0x369cc9,_0x2b10f1){_0x369cc9=_0x369cc9-0x0;var _0x535156=_0xddac[_0x369cc9];return _0x535156;};'use strict';var _=require(_0xcdda('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcdda('0x1'));var moment=require('moment');var BPromise=require(_0xcdda('0x2'));var rp=require(_0xcdda('0x3'));var fs=require('fs');var path=require(_0xcdda('0x4'));var rimraf=require(_0xcdda('0x5'));var config=require(_0xcdda('0x6'));var attributes=require(_0xcdda('0x7'));module[_0xcdda('0x8')]=function(_0x54e347,_0x48adaf){return _0x54e347[_0xcdda('0x9')](_0xcdda('0xa'),attributes,{'tableName':_0xcdda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc86db8..30e2e8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f3=['include','map','model','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSound','Sound','find','options','raw','where','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04f3,0x67));var _0x304f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x04f3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x304f('0x0'));var util=require('util');var moment=require(_0x304f('0x1'));var BPromise=require(_0x304f('0x2'));var rs=require(_0x304f('0x3'));var fs=require('fs');var Redis=require(_0x304f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x304f('0x5'));var logger=require(_0x304f('0x6'))(_0x304f('0x7'));var config=require('../../config/environment');var jayson=require(_0x304f('0x8'));var client=jayson[_0x304f('0x9')][_0x304f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4915df,_0x5bba8d,_0x34735d){return new BPromise(function(_0x3e4418,_0x44ea9c){return client[_0x304f('0xb')](_0x4915df,_0x34735d)[_0x304f('0xc')](function(_0x346992){logger[_0x304f('0xd')](_0x304f('0xe'),_0x5bba8d,_0x304f('0xf'));logger[_0x304f('0x10')](_0x304f('0x11'),_0x5bba8d,_0x304f('0xf'),JSON['stringify'](_0x346992));if(_0x346992[_0x304f('0x12')]){if(_0x346992[_0x304f('0x12')][_0x304f('0x13')]===0x1f4){logger[_0x304f('0x12')]('Sound,\x20%s,\x20%s',_0x5bba8d,_0x346992[_0x304f('0x12')][_0x304f('0x14')]);return _0x44ea9c(_0x346992[_0x304f('0x12')]['message']);}logger[_0x304f('0x12')](_0x304f('0xe'),_0x5bba8d,_0x346992[_0x304f('0x12')]['message']);return _0x3e4418(_0x346992['error']['message']);}else{logger['info'](_0x304f('0xe'),_0x5bba8d,_0x304f('0xf'));_0x3e4418(_0x346992['result']['message']);}})[_0x304f('0x15')](function(_0x1d128a){logger[_0x304f('0x12')](_0x304f('0xe'),_0x5bba8d,_0x1d128a);_0x44ea9c(_0x1d128a);});});}exports[_0x304f('0x16')]=function(_0x4ce2cc){var _0x43c608=this;return new Promise(function(_0x3a46b1,_0x1e4746){return db[_0x304f('0x17')][_0x304f('0x18')]({'raw':_0x4ce2cc['options']?_0x4ce2cc[_0x304f('0x19')][_0x304f('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ce2cc[_0x304f('0x19')]?_0x4ce2cc[_0x304f('0x19')][_0x304f('0x1b')]||null:null,'attributes':_0x4ce2cc[_0x304f('0x19')]?_0x4ce2cc['options'][_0x304f('0x1c')]||null:null,'include':_0x4ce2cc[_0x304f('0x19')]?_0x4ce2cc['options'][_0x304f('0x1d')]?_[_0x304f('0x1e')](_0x4ce2cc[_0x304f('0x19')][_0x304f('0x1d')],function(_0x2a3f2b){return{'model':db[_0x2a3f2b['model']],'as':_0x2a3f2b['as'],'attributes':_0x2a3f2b[_0x304f('0x1c')],'include':_0x2a3f2b[_0x304f('0x1d')]?_[_0x304f('0x1e')](_0x2a3f2b['include'],function(_0x4d0340){return{'model':db[_0x4d0340[_0x304f('0x1f')]],'as':_0x4d0340['as'],'attributes':_0x4d0340[_0x304f('0x1c')],'include':_0x4d0340[_0x304f('0x1d')]?_[_0x304f('0x1e')](_0x4d0340[_0x304f('0x1d')],function(_0x5405e2){return{'model':db[_0x5405e2[_0x304f('0x1f')]],'as':_0x5405e2['as'],'attributes':_0x5405e2[_0x304f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x304f('0xc')](function(_0x33c3cb){logger[_0x304f('0xd')](_0x304f('0x16'),_0x4ce2cc);logger[_0x304f('0x10')](_0x304f('0x16'),_0x4ce2cc,JSON[_0x304f('0x20')](_0x33c3cb));_0x3a46b1(_0x33c3cb);})[_0x304f('0x15')](function(_0x10a536){logger[_0x304f('0x12')]('ShowSound',_0x10a536[_0x304f('0x14')],_0x4ce2cc);_0x1e4746(_0x43c608[_0x304f('0x12')](0x1f4,_0x10a536[_0x304f('0x14')]));});});};
\ No newline at end of file
+var _0xd213=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSound','Sound','find','options','raw','include','map','model','attributes','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s'];(function(_0x2cae99,_0x2c4acb){var _0x2748b6=function(_0x277351){while(--_0x277351){_0x2cae99['push'](_0x2cae99['shift']());}};_0x2748b6(++_0x2c4acb);}(_0xd213,0xd8));var _0x3d21=function(_0x4f93a9,_0x2793c3){_0x4f93a9=_0x4f93a9-0x0;var _0x8fab33=_0xd213[_0x4f93a9];return _0x8fab33;};'use strict';var _=require(_0x3d21('0x0'));var util=require(_0x3d21('0x1'));var moment=require('moment');var BPromise=require(_0x3d21('0x2'));var rs=require(_0x3d21('0x3'));var fs=require('fs');var Redis=require(_0x3d21('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d21('0x5'));var logger=require(_0x3d21('0x6'))(_0x3d21('0x7'));var config=require(_0x3d21('0x8'));var jayson=require(_0x3d21('0x9'));var client=jayson[_0x3d21('0xa')][_0x3d21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x348705,_0x207390,_0x4dad54){return new BPromise(function(_0x37161c,_0x1bb65c){return client[_0x3d21('0xc')](_0x348705,_0x4dad54)[_0x3d21('0xd')](function(_0x3d62e2){logger['info'](_0x3d21('0xe'),_0x207390,_0x3d21('0xf'));logger[_0x3d21('0x10')](_0x3d21('0x11'),_0x207390,_0x3d21('0xf'),JSON['stringify'](_0x3d62e2));if(_0x3d62e2[_0x3d21('0x12')]){if(_0x3d62e2[_0x3d21('0x12')][_0x3d21('0x13')]===0x1f4){logger[_0x3d21('0x12')](_0x3d21('0xe'),_0x207390,_0x3d62e2['error'][_0x3d21('0x14')]);return _0x1bb65c(_0x3d62e2[_0x3d21('0x12')][_0x3d21('0x14')]);}logger[_0x3d21('0x12')]('Sound,\x20%s,\x20%s',_0x207390,_0x3d62e2[_0x3d21('0x12')]['message']);return _0x37161c(_0x3d62e2[_0x3d21('0x12')][_0x3d21('0x14')]);}else{logger[_0x3d21('0x15')]('Sound,\x20%s,\x20%s',_0x207390,'request\x20sent');_0x37161c(_0x3d62e2[_0x3d21('0x16')][_0x3d21('0x14')]);}})[_0x3d21('0x17')](function(_0x1f265f){logger[_0x3d21('0x12')]('Sound,\x20%s,\x20%s',_0x207390,_0x1f265f);_0x1bb65c(_0x1f265f);});});}exports[_0x3d21('0x18')]=function(_0x2ef54c){var _0x1c65aa=this;return new Promise(function(_0x3dacc4,_0x5313e5){return db[_0x3d21('0x19')][_0x3d21('0x1a')]({'raw':_0x2ef54c[_0x3d21('0x1b')]?_0x2ef54c[_0x3d21('0x1b')][_0x3d21('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ef54c[_0x3d21('0x1b')]?_0x2ef54c['options']['where']||null:null,'attributes':_0x2ef54c['options']?_0x2ef54c[_0x3d21('0x1b')]['attributes']||null:null,'include':_0x2ef54c[_0x3d21('0x1b')]?_0x2ef54c['options'][_0x3d21('0x1d')]?_[_0x3d21('0x1e')](_0x2ef54c[_0x3d21('0x1b')][_0x3d21('0x1d')],function(_0x5bc589){return{'model':db[_0x5bc589[_0x3d21('0x1f')]],'as':_0x5bc589['as'],'attributes':_0x5bc589[_0x3d21('0x20')],'include':_0x5bc589[_0x3d21('0x1d')]?_[_0x3d21('0x1e')](_0x5bc589[_0x3d21('0x1d')],function(_0x467692){return{'model':db[_0x467692[_0x3d21('0x1f')]],'as':_0x467692['as'],'attributes':_0x467692[_0x3d21('0x20')],'include':_0x467692[_0x3d21('0x1d')]?_[_0x3d21('0x1e')](_0x467692[_0x3d21('0x1d')],function(_0x21e1d3){return{'model':db[_0x21e1d3[_0x3d21('0x1f')]],'as':_0x21e1d3['as'],'attributes':_0x21e1d3[_0x3d21('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x265fbc){logger[_0x3d21('0x15')](_0x3d21('0x18'),_0x2ef54c);logger['debug'](_0x3d21('0x18'),_0x2ef54c,JSON['stringify'](_0x265fbc));_0x3dacc4(_0x265fbc);})[_0x3d21('0x17')](function(_0x3bace7){logger['error'](_0x3d21('0x18'),_0x3bace7[_0x3d21('0x14')],_0x2ef54c);_0x5313e5(_0x1c65aa[_0x3d21('0x12')](0x1f4,_0x3bace7[_0x3d21('0x14')]));});});};
\ No newline at end of file
index d22cd3c..3c6dc26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9773=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1b97ce,_0x417495){var _0x4aff26=function(_0x4c3d95){while(--_0x4c3d95){_0x1b97ce['push'](_0x1b97ce['shift']());}};_0x4aff26(++_0x417495);}(_0x9773,0xe2));var _0x3977=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9773[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3977('0x0'));var util=require(_0x3977('0x1'));var path=require('path');var timeout=require(_0x3977('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3977('0x3'));var interaction=require(_0x3977('0x4'));var config=require(_0x3977('0x5'));var controller=require(_0x3977('0x6'));router[_0x3977('0x7')]('/',auth[_0x3977('0x8')](),controller[_0x3977('0x9')]);router[_0x3977('0x7')](_0x3977('0xa'),auth[_0x3977('0x8')](),controller[_0x3977('0xb')]);router[_0x3977('0xc')]('/',auth['isAuthenticated'](),controller[_0x3977('0xd')]);router[_0x3977('0xe')](_0x3977('0xa'),auth[_0x3977('0x8')](),controller[_0x3977('0xf')]);router[_0x3977('0x10')](_0x3977('0xa'),auth[_0x3977('0x8')](),controller[_0x3977('0x11')]);module[_0x3977('0x12')]=router;
\ No newline at end of file
+var _0x4f89=['index','/:id','show','post','put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x121e18,_0x581f6c){var _0x16bd33=function(_0x105958){while(--_0x105958){_0x121e18['push'](_0x121e18['shift']());}};_0x16bd33(++_0x581f6c);}(_0x4f89,0x138));var _0x94f8=function(_0x26b6f7,_0x38416a){_0x26b6f7=_0x26b6f7-0x0;var _0x11f763=_0x4f89[_0x26b6f7];return _0x11f763;};'use strict';var multer=require(_0x94f8('0x0'));var util=require(_0x94f8('0x1'));var path=require(_0x94f8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x94f8('0x3')]();var auth=require(_0x94f8('0x4'));var interaction=require(_0x94f8('0x5'));var config=require('../../config/environment');var controller=require('./squareMessage.controller');router[_0x94f8('0x6')]('/',auth[_0x94f8('0x7')](),controller[_0x94f8('0x8')]);router[_0x94f8('0x6')](_0x94f8('0x9'),auth[_0x94f8('0x7')](),controller[_0x94f8('0xa')]);router[_0x94f8('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x94f8('0xc')](_0x94f8('0x9'),auth['isAuthenticated'](),controller[_0x94f8('0xd')]);router['delete'](_0x94f8('0x9'),auth[_0x94f8('0x7')](),controller[_0x94f8('0xe')]);module[_0x94f8('0xf')]=router;
\ No newline at end of file
index 44d959d..0a560b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddf5=['TEXT','medium','ENUM','out','STRING'];(function(_0x836c43,_0x5a3808){var _0x3f9fef=function(_0x2a32dc){while(--_0x2a32dc){_0x836c43['push'](_0x836c43['shift']());}};_0x3f9fef(++_0x5a3808);}(_0xddf5,0x135));var _0x5ddf=function(_0x5ad9aa,_0x428fb0){_0x5ad9aa=_0x5ad9aa-0x0;var _0x3d49e9=_0xddf5[_0x5ad9aa];return _0x3d49e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5ddf('0x0')]},'body':{'type':Sequelize[_0x5ddf('0x1')](_0x5ddf('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x5ddf('0x3')]('in',_0x5ddf('0x4')),'defaultValue':_0x5ddf('0x4'),'allowNull':![]}};
\ No newline at end of file
+var _0x4929=['out','exports','STRING','TEXT','medium','ENUM'];(function(_0x53fff4,_0xed22df){var _0x3069b4=function(_0x402be4){while(--_0x402be4){_0x53fff4['push'](_0x53fff4['shift']());}};_0x3069b4(++_0xed22df);}(_0x4929,0xeb));var _0x9492=function(_0x4343c8,_0x4dd6ad){_0x4343c8=_0x4343c8-0x0;var _0x4c2b31=_0x4929[_0x4343c8];return _0x4c2b31;};'use strict';var Sequelize=require('sequelize');module[_0x9492('0x0')]={'uniqueid':{'type':Sequelize[_0x9492('0x1')]},'body':{'type':Sequelize[_0x9492('0x2')](_0x9492('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9492('0x4')]('in',_0x9492('0x5')),'defaultValue':_0x9492('0x5'),'allowNull':![]}};
\ No newline at end of file
index 5b1486c..c9dd318 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe57=['params','keys','include','options','find','create','body','html-pdf','rimraf','zip-dir','moment','mustache','path','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','merge','count','includeAll','SquareMessage','findAll','rows','catch','show'];(function(_0x379abb,_0x399a14){var _0x19abf1=function(_0x435386){while(--_0x435386){_0x379abb['push'](_0x379abb['shift']());}};_0x19abf1(++_0x399a14);}(_0xfe57,0xd3));var _0x7fe5=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xfe57[_0x3e6d5d];return _0x238923;};'use strict';var pdf=require(_0x7fe5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7fe5('0x1'));var zipdir=require(_0x7fe5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7fe5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7fe5('0x4'));var util=require('util');var path=require(_0x7fe5('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7fe5('0x6'));var fs=require('fs');var _=require(_0x7fe5('0x7'));var squel=require('squel');var crypto=require(_0x7fe5('0x8'));var jsforce=require(_0x7fe5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x7fe5('0xa'));var querystring=require('querystring');var Papa=require(_0x7fe5('0xb'));var Redis=require(_0x7fe5('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7fe5('0xd'));var hardwareService=require(_0x7fe5('0xe'));var logger=require(_0x7fe5('0xf'))(_0x7fe5('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x140e5c,_0x4de40a){_0x4de40a=_0x4de40a||0xcc;return function(_0x26b067){if(_0x26b067){return _0x140e5c['sendStatus'](_0x4de40a);}return _0x140e5c[_0x7fe5('0x11')](_0x4de40a)[_0x7fe5('0x12')]();};}function respondWithResult(_0x42d0fc,_0x4fc183){_0x4fc183=_0x4fc183||0xc8;return function(_0x554350){if(_0x554350){return _0x42d0fc['status'](_0x4fc183)[_0x7fe5('0x13')](_0x554350);}};}function respondWithFilteredResult(_0x596e97,_0x54d36b){return function(_0x5b4c5a){if(_0x5b4c5a){var _0x495eeb=_0x5b4c5a['count'],_0xca2463=_0x54d36b[_0x7fe5('0x14')],_0x4d2437=_0x54d36b[_0x7fe5('0x14')]+_0x54d36b['limit'],_0x9a9bc8;if(_0x4d2437>=_0x495eeb){_0x4d2437=_0x495eeb;_0x9a9bc8=0xc8;}else{_0x9a9bc8=0xce;}_0x596e97[_0x7fe5('0x11')](_0x9a9bc8);return _0x596e97[_0x7fe5('0x15')](_0x7fe5('0x16'),_0xca2463+'-'+_0x4d2437+'/'+_0x495eeb)['json'](_0x5b4c5a);}return null;};}function patchUpdates(_0x38ae13){return function(_0x3a56cd){try{jsonpatch['apply'](_0x3a56cd,_0x38ae13,!![]);}catch(_0x5e401c){return BPromise[_0x7fe5('0x17')](_0x5e401c);}return _0x3a56cd[_0x7fe5('0x18')]();};}function saveUpdates(_0x379da4,_0x239631){return function(_0x4078c5){if(_0x4078c5){return _0x4078c5[_0x7fe5('0x19')](_0x379da4)[_0x7fe5('0x1a')](function(_0x47e2c6){return _0x47e2c6;});}return null;};}function removeEntity(_0x11ae93,_0x2e6f38){return function(_0x5192e7){if(_0x5192e7){return _0x5192e7[_0x7fe5('0x1b')]()['then'](function(){_0x11ae93[_0x7fe5('0x11')](0xcc)[_0x7fe5('0x12')]();});}};}function handleEntityNotFound(_0x37dba2,_0x435c3f){return function(_0x2f1b78){if(!_0x2f1b78){_0x37dba2['sendStatus'](0x194);}return _0x2f1b78;};}function handleError(_0x32afbf,_0x4ecbb8){_0x4ecbb8=_0x4ecbb8||0x1f4;return function(_0x227313){logger[_0x7fe5('0x1c')](_0x227313[_0x7fe5('0x1d')]);if(_0x227313[_0x7fe5('0x1e')]){delete _0x227313[_0x7fe5('0x1e')];}_0x32afbf[_0x7fe5('0x11')](_0x4ecbb8)[_0x7fe5('0x1f')](_0x227313);};}exports[_0x7fe5('0x20')]=function(_0x123598,_0x3148f8){var _0x588863={},_0x47c4d8={},_0x1528f4={'count':0x0,'rows':[]};var _0x300b09=_[_0x7fe5('0x21')](db['SquareMessage'][_0x7fe5('0x22')],function(_0x5dde90){return{'name':_0x5dde90[_0x7fe5('0x23')],'type':_0x5dde90[_0x7fe5('0x24')][_0x7fe5('0x25')]};});_0x47c4d8['model']=_[_0x7fe5('0x21')](_0x300b09,_0x7fe5('0x1e'));_0x47c4d8[_0x7fe5('0x26')]=_['keys'](_0x123598[_0x7fe5('0x26')]);_0x47c4d8['filters']=_[_0x7fe5('0x27')](_0x47c4d8[_0x7fe5('0x28')],_0x47c4d8[_0x7fe5('0x26')]);_0x588863[_0x7fe5('0x29')]=_[_0x7fe5('0x27')](_0x47c4d8[_0x7fe5('0x28')],qs[_0x7fe5('0x2a')](_0x123598[_0x7fe5('0x26')][_0x7fe5('0x2a')]));_0x588863[_0x7fe5('0x29')]=_0x588863[_0x7fe5('0x29')][_0x7fe5('0x2b')]?_0x588863[_0x7fe5('0x29')]:_0x47c4d8[_0x7fe5('0x28')];if(!_0x123598['query'][_0x7fe5('0x2c')](_0x7fe5('0x2d'))){_0x588863[_0x7fe5('0x2e')]=qs[_0x7fe5('0x2e')](_0x123598[_0x7fe5('0x26')][_0x7fe5('0x2e')]);_0x588863['offset']=qs[_0x7fe5('0x14')](_0x123598['query']['offset']);}_0x588863[_0x7fe5('0x2f')]=qs[_0x7fe5('0x30')](_0x123598['query'][_0x7fe5('0x30')]);_0x588863[_0x7fe5('0x31')]=qs[_0x7fe5('0x32')](_[_0x7fe5('0x33')](_0x123598[_0x7fe5('0x26')],_0x47c4d8['filters']),_0x300b09);if(_0x123598['query']['filter']){_0x588863[_0x7fe5('0x31')]=_['merge'](_0x588863[_0x7fe5('0x31')],{'$or':_['map'](_0x300b09,function(_0x3555c4){if(_0x3555c4['type']!==_0x7fe5('0x34')){var _0x4a14bb={};_0x4a14bb[_0x3555c4[_0x7fe5('0x1e')]]={'$like':'%'+_0x123598[_0x7fe5('0x26')]['filter']+'%'};return _0x4a14bb;}})});}_0x588863=_[_0x7fe5('0x35')]({},_0x588863,_0x123598['options']);var _0x597a44={'where':_0x588863[_0x7fe5('0x31')]};return db['SquareMessage'][_0x7fe5('0x36')](_0x597a44)['then'](function(_0x101c59){_0x1528f4['count']=_0x101c59;if(_0x123598[_0x7fe5('0x26')][_0x7fe5('0x37')]){_0x588863['include']=[{'all':!![]}];}return db[_0x7fe5('0x38')][_0x7fe5('0x39')](_0x588863);})[_0x7fe5('0x1a')](function(_0xe250ac){_0x1528f4[_0x7fe5('0x3a')]=_0xe250ac;return _0x1528f4;})[_0x7fe5('0x1a')](respondWithFilteredResult(_0x3148f8,_0x588863))[_0x7fe5('0x3b')](handleError(_0x3148f8,null));};exports[_0x7fe5('0x3c')]=function(_0x13738f,_0x391319){var _0x1ba3a3={'raw':!![],'where':{'id':_0x13738f[_0x7fe5('0x3d')]['id']}},_0x23e038={};_0x23e038[_0x7fe5('0x28')]=_['keys'](db['SquareMessage'][_0x7fe5('0x22')]);_0x23e038[_0x7fe5('0x26')]=_[_0x7fe5('0x3e')](_0x13738f['query']);_0x23e038[_0x7fe5('0x32')]=_[_0x7fe5('0x27')](_0x23e038[_0x7fe5('0x28')],_0x23e038[_0x7fe5('0x26')]);_0x1ba3a3[_0x7fe5('0x29')]=_[_0x7fe5('0x27')](_0x23e038[_0x7fe5('0x28')],qs[_0x7fe5('0x2a')](_0x13738f['query']['fields']));_0x1ba3a3['attributes']=_0x1ba3a3[_0x7fe5('0x29')]['length']?_0x1ba3a3['attributes']:_0x23e038[_0x7fe5('0x28')];if(_0x13738f[_0x7fe5('0x26')][_0x7fe5('0x37')]){_0x1ba3a3[_0x7fe5('0x3f')]=[{'all':!![]}];}_0x1ba3a3=_['merge']({},_0x1ba3a3,_0x13738f[_0x7fe5('0x40')]);return db[_0x7fe5('0x38')][_0x7fe5('0x41')](_0x1ba3a3)['then'](handleEntityNotFound(_0x391319,null))[_0x7fe5('0x1a')](respondWithResult(_0x391319,null))[_0x7fe5('0x3b')](handleError(_0x391319,null));};exports[_0x7fe5('0x42')]=function(_0x4d2f25,_0xd7c5d2){return db[_0x7fe5('0x38')][_0x7fe5('0x42')](_0x4d2f25[_0x7fe5('0x43')],{})[_0x7fe5('0x1a')](respondWithResult(_0xd7c5d2,0xc9))['catch'](handleError(_0xd7c5d2,null));};exports[_0x7fe5('0x19')]=function(_0x3e6eb5,_0x369ab9){if(_0x3e6eb5[_0x7fe5('0x43')]['id']){delete _0x3e6eb5[_0x7fe5('0x43')]['id'];}return db[_0x7fe5('0x38')]['find']({'where':{'id':_0x3e6eb5[_0x7fe5('0x3d')]['id']}})[_0x7fe5('0x1a')](handleEntityNotFound(_0x369ab9,null))[_0x7fe5('0x1a')](saveUpdates(_0x3e6eb5[_0x7fe5('0x43')],null))['then'](respondWithResult(_0x369ab9,null))[_0x7fe5('0x3b')](handleError(_0x369ab9,null));};exports[_0x7fe5('0x1b')]=function(_0x327f4b,_0x55b0ab){return db['SquareMessage'][_0x7fe5('0x41')]({'where':{'id':_0x327f4b[_0x7fe5('0x3d')]['id']}})[_0x7fe5('0x1a')](handleEntityNotFound(_0x55b0ab,null))[_0x7fe5('0x1a')](removeEntity(_0x55b0ab,null))['catch'](handleError(_0x55b0ab,null));};
\ No newline at end of file
+var _0xef5d=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','filter','merge','options','includeAll','catch','show','include','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x512980,_0x401e50){var _0x571f0a=function(_0x456237){while(--_0x456237){_0x512980['push'](_0x512980['shift']());}};_0x571f0a(++_0x401e50);}(_0xef5d,0x19a));var _0xdef5=function(_0x3dfbcf,_0x138164){_0x3dfbcf=_0x3dfbcf-0x0;var _0x3c9987=_0xef5d[_0x3dfbcf];return _0x3c9987;};'use strict';var pdf=require(_0xdef5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdef5('0x1'));var zipdir=require(_0xdef5('0x2'));var jsonpatch=require(_0xdef5('0x3'));var rp=require('request-promise');var moment=require(_0xdef5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdef5('0x5'));var util=require(_0xdef5('0x6'));var path=require('path');var sox=require(_0xdef5('0x7'));var csv=require(_0xdef5('0x8'));var ejs=require(_0xdef5('0x9'));var fs=require('fs');var _=require(_0xdef5('0xa'));var squel=require(_0xdef5('0xb'));var crypto=require('crypto');var jsforce=require(_0xdef5('0xc'));var deskjs=require(_0xdef5('0xd'));var toCsv=require(_0xdef5('0x8'));var querystring=require(_0xdef5('0xe'));var Papa=require(_0xdef5('0xf'));var Redis=require(_0xdef5('0x10'));var authService=require(_0xdef5('0x11'));var qs=require(_0xdef5('0x12'));var as=require(_0xdef5('0x13'));var hardwareService=require(_0xdef5('0x14'));var logger=require(_0xdef5('0x15'))(_0xdef5('0x16'));var utils=require(_0xdef5('0x17'));var config=require(_0xdef5('0x18'));var db=require(_0xdef5('0x19'))['db'];function respondWithStatusCode(_0x3f2654,_0x3373e0){_0x3373e0=_0x3373e0||0xcc;return function(_0x750216){if(_0x750216){return _0x3f2654[_0xdef5('0x1a')](_0x3373e0);}return _0x3f2654['status'](_0x3373e0)[_0xdef5('0x1b')]();};}function respondWithResult(_0x419cdb,_0x2d3134){_0x2d3134=_0x2d3134||0xc8;return function(_0x4f902c){if(_0x4f902c){return _0x419cdb[_0xdef5('0x1c')](_0x2d3134)[_0xdef5('0x1d')](_0x4f902c);}};}function respondWithFilteredResult(_0x5de514,_0x10434d){return function(_0x499a72){if(_0x499a72){var _0x737866=_0x499a72[_0xdef5('0x1e')],_0x11740c=_0x10434d[_0xdef5('0x1f')],_0x40f447=_0x10434d['offset']+_0x10434d[_0xdef5('0x20')],_0x2bfce6;if(_0x40f447>=_0x737866){_0x40f447=_0x737866;_0x2bfce6=0xc8;}else{_0x2bfce6=0xce;}_0x5de514[_0xdef5('0x1c')](_0x2bfce6);return _0x5de514[_0xdef5('0x21')](_0xdef5('0x22'),_0x11740c+'-'+_0x40f447+'/'+_0x737866)['json'](_0x499a72);}return null;};}function patchUpdates(_0x4e0dc1){return function(_0xeb8358){try{jsonpatch[_0xdef5('0x23')](_0xeb8358,_0x4e0dc1,!![]);}catch(_0x102123){return BPromise[_0xdef5('0x24')](_0x102123);}return _0xeb8358[_0xdef5('0x25')]();};}function saveUpdates(_0x2730b1,_0xf80f7f){return function(_0x2bc408){if(_0x2bc408){return _0x2bc408[_0xdef5('0x26')](_0x2730b1)[_0xdef5('0x27')](function(_0x526f63){return _0x526f63;});}return null;};}function removeEntity(_0x52497d,_0x431d0c){return function(_0x60a4f6){if(_0x60a4f6){return _0x60a4f6[_0xdef5('0x28')]()[_0xdef5('0x27')](function(){_0x52497d['status'](0xcc)[_0xdef5('0x1b')]();});}};}function handleEntityNotFound(_0x203b79,_0x234e19){return function(_0x30d8ab){if(!_0x30d8ab){_0x203b79[_0xdef5('0x1a')](0x194);}return _0x30d8ab;};}function handleError(_0x3aba29,_0x57975b){_0x57975b=_0x57975b||0x1f4;return function(_0xaed864){logger[_0xdef5('0x29')](_0xaed864['stack']);if(_0xaed864[_0xdef5('0x2a')]){delete _0xaed864[_0xdef5('0x2a')];}_0x3aba29['status'](_0x57975b)[_0xdef5('0x2b')](_0xaed864);};}exports[_0xdef5('0x2c')]=function(_0x5783a6,_0x69f92a){var _0x45e536={},_0x3927f1={},_0x18e2ba={'count':0x0,'rows':[]};var _0x2e24e8=_[_0xdef5('0x2d')](db[_0xdef5('0x2e')][_0xdef5('0x2f')],function(_0x57235c){return{'name':_0x57235c[_0xdef5('0x30')],'type':_0x57235c[_0xdef5('0x31')][_0xdef5('0x32')]};});_0x3927f1['model']=_[_0xdef5('0x2d')](_0x2e24e8,'name');_0x3927f1[_0xdef5('0x33')]=_[_0xdef5('0x34')](_0x5783a6[_0xdef5('0x33')]);_0x3927f1[_0xdef5('0x35')]=_['intersection'](_0x3927f1[_0xdef5('0x36')],_0x3927f1[_0xdef5('0x33')]);_0x45e536[_0xdef5('0x37')]=_[_0xdef5('0x38')](_0x3927f1['model'],qs[_0xdef5('0x39')](_0x5783a6[_0xdef5('0x33')][_0xdef5('0x39')]));_0x45e536[_0xdef5('0x37')]=_0x45e536['attributes'][_0xdef5('0x3a')]?_0x45e536['attributes']:_0x3927f1['model'];if(!_0x5783a6['query']['hasOwnProperty']('nolimit')){_0x45e536['limit']=qs[_0xdef5('0x20')](_0x5783a6[_0xdef5('0x33')][_0xdef5('0x20')]);_0x45e536[_0xdef5('0x1f')]=qs[_0xdef5('0x1f')](_0x5783a6[_0xdef5('0x33')][_0xdef5('0x1f')]);}_0x45e536[_0xdef5('0x3b')]=qs[_0xdef5('0x3c')](_0x5783a6['query'][_0xdef5('0x3c')]);_0x45e536[_0xdef5('0x3d')]=qs['filters'](_['pick'](_0x5783a6[_0xdef5('0x33')],_0x3927f1[_0xdef5('0x35')]),_0x2e24e8);if(_0x5783a6[_0xdef5('0x33')][_0xdef5('0x3e')]){_0x45e536['where']=_[_0xdef5('0x3f')](_0x45e536[_0xdef5('0x3d')],{'$or':_[_0xdef5('0x2d')](_0x2e24e8,function(_0xb20a0f){if(_0xb20a0f[_0xdef5('0x31')]!=='VIRTUAL'){var _0x1c0767={};_0x1c0767[_0xb20a0f[_0xdef5('0x2a')]]={'$like':'%'+_0x5783a6['query'][_0xdef5('0x3e')]+'%'};return _0x1c0767;}})});}_0x45e536=_[_0xdef5('0x3f')]({},_0x45e536,_0x5783a6[_0xdef5('0x40')]);var _0x3334c2={'where':_0x45e536[_0xdef5('0x3d')]};return db['SquareMessage']['count'](_0x3334c2)['then'](function(_0x1f0d3c){_0x18e2ba[_0xdef5('0x1e')]=_0x1f0d3c;if(_0x5783a6['query'][_0xdef5('0x41')]){_0x45e536['include']=[{'all':!![]}];}return db[_0xdef5('0x2e')]['findAll'](_0x45e536);})[_0xdef5('0x27')](function(_0x114c7f){_0x18e2ba['rows']=_0x114c7f;return _0x18e2ba;})[_0xdef5('0x27')](respondWithFilteredResult(_0x69f92a,_0x45e536))[_0xdef5('0x42')](handleError(_0x69f92a,null));};exports[_0xdef5('0x43')]=function(_0x41afa8,_0x1a8005){var _0x2ecea1={'raw':!![],'where':{'id':_0x41afa8['params']['id']}},_0xfe58f1={};_0xfe58f1[_0xdef5('0x36')]=_[_0xdef5('0x34')](db[_0xdef5('0x2e')][_0xdef5('0x2f')]);_0xfe58f1[_0xdef5('0x33')]=_[_0xdef5('0x34')](_0x41afa8[_0xdef5('0x33')]);_0xfe58f1[_0xdef5('0x35')]=_[_0xdef5('0x38')](_0xfe58f1[_0xdef5('0x36')],_0xfe58f1[_0xdef5('0x33')]);_0x2ecea1[_0xdef5('0x37')]=_['intersection'](_0xfe58f1[_0xdef5('0x36')],qs[_0xdef5('0x39')](_0x41afa8[_0xdef5('0x33')]['fields']));_0x2ecea1[_0xdef5('0x37')]=_0x2ecea1[_0xdef5('0x37')][_0xdef5('0x3a')]?_0x2ecea1[_0xdef5('0x37')]:_0xfe58f1[_0xdef5('0x36')];if(_0x41afa8[_0xdef5('0x33')][_0xdef5('0x41')]){_0x2ecea1[_0xdef5('0x44')]=[{'all':!![]}];}_0x2ecea1=_[_0xdef5('0x3f')]({},_0x2ecea1,_0x41afa8[_0xdef5('0x40')]);return db[_0xdef5('0x2e')][_0xdef5('0x45')](_0x2ecea1)[_0xdef5('0x27')](handleEntityNotFound(_0x1a8005,null))[_0xdef5('0x27')](respondWithResult(_0x1a8005,null))['catch'](handleError(_0x1a8005,null));};exports['create']=function(_0xc31876,_0x2b00ea){return db['SquareMessage'][_0xdef5('0x46')](_0xc31876[_0xdef5('0x47')],{})[_0xdef5('0x27')](respondWithResult(_0x2b00ea,0xc9))[_0xdef5('0x42')](handleError(_0x2b00ea,null));};exports['update']=function(_0x36190b,_0x445e2b){if(_0x36190b['body']['id']){delete _0x36190b[_0xdef5('0x47')]['id'];}return db['SquareMessage'][_0xdef5('0x45')]({'where':{'id':_0x36190b['params']['id']}})['then'](handleEntityNotFound(_0x445e2b,null))[_0xdef5('0x27')](saveUpdates(_0x36190b[_0xdef5('0x47')],null))[_0xdef5('0x27')](respondWithResult(_0x445e2b,null))['catch'](handleError(_0x445e2b,null));};exports[_0xdef5('0x28')]=function(_0x1a0f6b,_0x3ecfdc){return db[_0xdef5('0x2e')]['find']({'where':{'id':_0x1a0f6b['params']['id']}})[_0xdef5('0x27')](handleEntityNotFound(_0x3ecfdc,null))[_0xdef5('0x27')](removeEntity(_0x3ecfdc,null))['catch'](handleError(_0x3ecfdc,null));};
\ No newline at end of file
index e771d37..63b927c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3470=['../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x143ce6,_0x46e089){var _0x33ed64=function(_0x5a6856){while(--_0x5a6856){_0x143ce6['push'](_0x143ce6['shift']());}};_0x33ed64(++_0x46e089);}(_0x3470,0x1c8));var _0x0347=function(_0x3a9c01,_0x149452){_0x3a9c01=_0x3a9c01-0x0;var _0x4d676e=_0x3470[_0x3a9c01];return _0x4d676e;};'use strict';var _=require(_0x0347('0x0'));var util=require(_0x0347('0x1'));var logger=require(_0x0347('0x2'))(_0x0347('0x3'));var moment=require(_0x0347('0x4'));var BPromise=require(_0x0347('0x5'));var rp=require(_0x0347('0x6'));var fs=require('fs');var path=require(_0x0347('0x7'));var rimraf=require(_0x0347('0x8'));var config=require(_0x0347('0x9'));var attributes=require(_0x0347('0xa'));module[_0x0347('0xb')]=function(_0x4f2807,_0x5b7c09){return _0x4f2807[_0x0347('0xc')](_0x0347('0xd'),attributes,{'tableName':_0x0347('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x500f=['square_messages','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x5279cb,_0x1601be){var _0x55785a=function(_0x33fd36){while(--_0x33fd36){_0x5279cb['push'](_0x5279cb['shift']());}};_0x55785a(++_0x1601be);}(_0x500f,0x198));var _0xf500=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0x500f[_0x4c7d8b];return _0x187158;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf500('0x0'))(_0xf500('0x1'));var moment=require(_0xf500('0x2'));var BPromise=require('bluebird');var rp=require(_0xf500('0x3'));var fs=require('fs');var path=require(_0xf500('0x4'));var rimraf=require(_0xf500('0x5'));var config=require(_0xf500('0x6'));var attributes=require(_0xf500('0x7'));module[_0xf500('0x8')]=function(_0x225e91,_0x2d97b8){return _0x225e91[_0xf500('0x9')]('SquareMessage',attributes,{'tableName':_0xf500('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 00c6132..127a9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1d3=['message','catch','SquareMessage','create','options','then','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5e709e,_0x510374){var _0x27581c=function(_0x27f36b){while(--_0x27f36b){_0x5e709e['push'](_0x5e709e['shift']());}};_0x27581c(++_0x510374);}(_0xe1d3,0x159));var _0x3e1d=function(_0x7632f3,_0x33ad82){_0x7632f3=_0x7632f3-0x0;var _0xfdb431=_0xe1d3[_0x7632f3];return _0xfdb431;};'use strict';var _=require(_0x3e1d('0x0'));var util=require(_0x3e1d('0x1'));var moment=require(_0x3e1d('0x2'));var BPromise=require(_0x3e1d('0x3'));var rs=require(_0x3e1d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1d('0x6'))(_0x3e1d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3e1d('0x8')][_0x3e1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2caae6,_0x2b58a1,_0x2b5c34){return new BPromise(function(_0x4bf63b,_0xf4e7ca){return client[_0x3e1d('0xa')](_0x2caae6,_0x2b5c34)['then'](function(_0x3a7aab){logger[_0x3e1d('0xb')](_0x3e1d('0xc'),_0x2b58a1,_0x3e1d('0xd'));logger[_0x3e1d('0xe')](_0x3e1d('0xf'),_0x2b58a1,_0x3e1d('0xd'),JSON[_0x3e1d('0x10')](_0x3a7aab));if(_0x3a7aab[_0x3e1d('0x11')]){if(_0x3a7aab[_0x3e1d('0x11')][_0x3e1d('0x12')]===0x1f4){logger[_0x3e1d('0x11')](_0x3e1d('0xc'),_0x2b58a1,_0x3a7aab[_0x3e1d('0x11')]['message']);return _0xf4e7ca(_0x3a7aab[_0x3e1d('0x11')][_0x3e1d('0x13')]);}logger['error'](_0x3e1d('0xc'),_0x2b58a1,_0x3a7aab[_0x3e1d('0x11')]['message']);return _0x4bf63b(_0x3a7aab[_0x3e1d('0x11')][_0x3e1d('0x13')]);}else{logger[_0x3e1d('0xb')](_0x3e1d('0xc'),_0x2b58a1,_0x3e1d('0xd'));_0x4bf63b(_0x3a7aab['result'][_0x3e1d('0x13')]);}})[_0x3e1d('0x14')](function(_0x5549be){logger[_0x3e1d('0x11')](_0x3e1d('0xc'),_0x2b58a1,_0x5549be);_0xf4e7ca(_0x5549be);});});}exports['CreateSquareMessage']=function(_0x38a13f){var _0x46062f=this;return new Promise(function(_0x2e0007,_0x201482){return db[_0x3e1d('0x15')][_0x3e1d('0x16')](_0x38a13f['body'],{'raw':_0x38a13f[_0x3e1d('0x17')]?_0x38a13f[_0x3e1d('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3e1d('0x18')](function(_0x17a64a){logger[_0x3e1d('0xb')]('CreateSquareMessage',_0x38a13f);logger[_0x3e1d('0xe')]('CreateSquareMessage',_0x38a13f,JSON[_0x3e1d('0x10')](_0x17a64a));_0x2e0007(_0x17a64a);})[_0x3e1d('0x14')](function(_0x296d3b){logger[_0x3e1d('0x11')](_0x3e1d('0x19'),_0x296d3b[_0x3e1d('0x13')],_0x38a13f);_0x201482(_0x46062f[_0x3e1d('0x11')](0x1f4,_0x296d3b[_0x3e1d('0x13')]));});});};
\ No newline at end of file
+var _0x8d0a=['rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8d0a,0x172));var _0xa8d0=function(_0x50d9b8,_0x99855f){_0x50d9b8=_0x50d9b8-0x0;var _0x2b9e4a=_0x8d0a[_0x50d9b8];return _0x2b9e4a;};'use strict';var _=require(_0xa8d0('0x0'));var util=require(_0xa8d0('0x1'));var moment=require(_0xa8d0('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8d0('0x3'));var fs=require('fs');var Redis=require(_0xa8d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8d0('0x5'));var logger=require(_0xa8d0('0x6'))(_0xa8d0('0x7'));var config=require('../../config/environment');var jayson=require(_0xa8d0('0x8'));var client=jayson[_0xa8d0('0x9')][_0xa8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40c0b3,_0xeef6d9,_0x1032ed){return new BPromise(function(_0x14b0a0,_0x3d6cce){return client[_0xa8d0('0xb')](_0x40c0b3,_0x1032ed)[_0xa8d0('0xc')](function(_0x4550cf){logger[_0xa8d0('0xd')](_0xa8d0('0xe'),_0xeef6d9,_0xa8d0('0xf'));logger[_0xa8d0('0x10')](_0xa8d0('0x11'),_0xeef6d9,_0xa8d0('0xf'),JSON[_0xa8d0('0x12')](_0x4550cf));if(_0x4550cf[_0xa8d0('0x13')]){if(_0x4550cf[_0xa8d0('0x13')]['code']===0x1f4){logger['error'](_0xa8d0('0xe'),_0xeef6d9,_0x4550cf[_0xa8d0('0x13')]['message']);return _0x3d6cce(_0x4550cf['error'][_0xa8d0('0x14')]);}logger[_0xa8d0('0x13')](_0xa8d0('0xe'),_0xeef6d9,_0x4550cf[_0xa8d0('0x13')][_0xa8d0('0x14')]);return _0x14b0a0(_0x4550cf[_0xa8d0('0x13')][_0xa8d0('0x14')]);}else{logger[_0xa8d0('0xd')](_0xa8d0('0xe'),_0xeef6d9,_0xa8d0('0xf'));_0x14b0a0(_0x4550cf[_0xa8d0('0x15')]['message']);}})[_0xa8d0('0x16')](function(_0x3a3528){logger['error'](_0xa8d0('0xe'),_0xeef6d9,_0x3a3528);_0x3d6cce(_0x3a3528);});});}exports[_0xa8d0('0x17')]=function(_0x2899fb){var _0x434ad5=this;return new Promise(function(_0x34ce5d,_0x48e8c5){return db[_0xa8d0('0x18')][_0xa8d0('0x19')](_0x2899fb[_0xa8d0('0x1a')],{'raw':_0x2899fb[_0xa8d0('0x1b')]?_0x2899fb[_0xa8d0('0x1b')][_0xa8d0('0x1c')]===undefined?!![]:![]:!![]})[_0xa8d0('0xc')](function(_0x595452){logger[_0xa8d0('0xd')](_0xa8d0('0x17'),_0x2899fb);logger[_0xa8d0('0x10')](_0xa8d0('0x17'),_0x2899fb,JSON['stringify'](_0x595452));_0x34ce5d(_0x595452);})[_0xa8d0('0x16')](function(_0x31216e){logger[_0xa8d0('0x13')](_0xa8d0('0x17'),_0x31216e['message'],_0x2899fb);_0x48e8c5(_0x434ad5[_0xa8d0('0x13')](0x1f4,_0x31216e[_0xa8d0('0x14')]));});});};
\ No newline at end of file
index 0a3593f..c066b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab53=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','test'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xab53,0x12d));var _0x3ab5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xab53[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x3ab5('0x0'));var util=require(_0x3ab5('0x1'));var path=require(_0x3ab5('0x2'));var timeout=require(_0x3ab5('0x3'));var express=require(_0x3ab5('0x4'));var router=express[_0x3ab5('0x5')]();var auth=require(_0x3ab5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3ab5('0x7'));var controller=require(_0x3ab5('0x8'));router['get']('/',auth[_0x3ab5('0x9')](),controller[_0x3ab5('0xa')]);router[_0x3ab5('0xb')](_0x3ab5('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/test',auth[_0x3ab5('0x9')](),timeout('15s'),controller[_0x3ab5('0xd')]);router[_0x3ab5('0xe')]('/',auth[_0x3ab5('0x9')](),controller[_0x3ab5('0xf')]);router[_0x3ab5('0x10')]('/:id',auth[_0x3ab5('0x9')](),controller[_0x3ab5('0x11')]);router[_0x3ab5('0x12')](_0x3ab5('0xc'),auth[_0x3ab5('0x9')](),controller[_0x3ab5('0x13')]);module[_0x3ab5('0x14')]=router;
\ No newline at end of file
+var _0x207a=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','/:id','show','/:id/test','isAuthenticated','15s','post'];(function(_0x335fe2,_0x32e58a){var _0x1ac963=function(_0x525b6b){while(--_0x525b6b){_0x335fe2['push'](_0x335fe2['shift']());}};_0x1ac963(++_0x32e58a);}(_0x207a,0x180));var _0xa207=function(_0x1e2040,_0x3a134c){_0x1e2040=_0x1e2040-0x0;var _0x5ab109=_0x207a[_0x1e2040];return _0x5ab109;};'use strict';var multer=require(_0xa207('0x0'));var util=require('util');var path=require(_0xa207('0x1'));var timeout=require(_0xa207('0x2'));var express=require(_0xa207('0x3'));var router=express[_0xa207('0x4')]();var auth=require(_0xa207('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa207('0x6'));var controller=require(_0xa207('0x7'));router[_0xa207('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa207('0x8')](_0xa207('0x9'),auth['isAuthenticated'](),controller[_0xa207('0xa')]);router['get'](_0xa207('0xb'),auth[_0xa207('0xc')](),timeout(_0xa207('0xd')),controller['test']);router[_0xa207('0xe')]('/',auth[_0xa207('0xc')](),controller[_0xa207('0xf')]);router[_0xa207('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa207('0x11')]);router[_0xa207('0x12')](_0xa207('0x9'),auth['isAuthenticated'](),controller[_0xa207('0x13')]);module[_0xa207('0x14')]=router;
\ No newline at end of file
index 4587742..f603138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x998a=['STRING','name','sequelize','exports'];(function(_0x9b6ac6,_0x45fb62){var _0x3ebbd2=function(_0x5a6bfc){while(--_0x5a6bfc){_0x9b6ac6['push'](_0x9b6ac6['shift']());}};_0x3ebbd2(++_0x45fb62);}(_0x998a,0x1f2));var _0xa998=function(_0x381f26,_0x37ea7a){_0x381f26=_0x381f26-0x0;var _0x517c4e=_0x998a[_0x381f26];return _0x517c4e;};'use strict';var Sequelize=require(_0xa998('0x0'));module[_0xa998('0x1')]={'name':{'type':Sequelize[_0xa998('0x2')],'unique':_0xa998('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa998('0x2')]}};
\ No newline at end of file
+var _0xac09=['exports','STRING','name','sequelize'];(function(_0x466092,_0x2606ef){var _0x319cad=function(_0x59da5b){while(--_0x59da5b){_0x466092['push'](_0x466092['shift']());}};_0x319cad(++_0x2606ef);}(_0xac09,0x153));var _0x9ac0=function(_0xb84fc5,_0x281b53){_0xb84fc5=_0xb84fc5-0x0;var _0x26bbe3=_0xac09[_0xb84fc5];return _0x26bbe3;};'use strict';var Sequelize=require(_0x9ac0('0x0'));module[_0x9ac0('0x1')]={'name':{'type':Sequelize[_0x9ac0('0x2')],'unique':_0x9ac0('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x9ac0('0x2')]},'description':{'type':Sequelize[_0x9ac0('0x2')]}};
\ No newline at end of file
index 5f8d0fd..d6e0ea2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc80a=['limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','SquareOdbc','findAll','rows','show','length','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','catch','update','params','test','dsn','odbc','openSync','closeSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','get','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x1b697c,_0x247157){var _0x1e1949=function(_0x3efba9){while(--_0x3efba9){_0x1b697c['push'](_0x1b697c['shift']());}};_0x1e1949(++_0x247157);}(_0xc80a,0x1c3));var _0xac80=function(_0x57a158,_0x17651f){_0x57a158=_0x57a158-0x0;var _0x43049b=_0xc80a[_0x57a158];return _0x43049b;};'use strict';var pdf=require(_0xac80('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xac80('0x1'));var zipdir=require(_0xac80('0x2'));var jsonpatch=require(_0xac80('0x3'));var rp=require(_0xac80('0x4'));var moment=require('moment');var BPromise=require(_0xac80('0x5'));var Mustache=require(_0xac80('0x6'));var util=require(_0xac80('0x7'));var path=require(_0xac80('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac80('0x9'));var fs=require('fs');var _=require(_0xac80('0xa'));var squel=require(_0xac80('0xb'));var crypto=require(_0xac80('0xc'));var jsforce=require(_0xac80('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xac80('0xe'));var Redis=require(_0xac80('0xf'));var authService=require(_0xac80('0x10'));var qs=require(_0xac80('0x11'));var as=require(_0xac80('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac80('0x13'))(_0xac80('0x14'));var utils=require(_0xac80('0x15'));var config=require(_0xac80('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33a37d,_0x202d9f){_0x202d9f=_0x202d9f||0xcc;return function(_0x1a9269){if(_0x1a9269){return _0x33a37d[_0xac80('0x17')](_0x202d9f);}return _0x33a37d[_0xac80('0x18')](_0x202d9f)['end']();};}function respondWithResult(_0x24c64f,_0x41f331){_0x41f331=_0x41f331||0xc8;return function(_0x10e685){if(_0x10e685){return _0x24c64f[_0xac80('0x18')](_0x41f331)['json'](_0x10e685);}};}function respondWithFilteredResult(_0x1e4516,_0x273d6c){return function(_0x332541){if(_0x332541){var _0x440073=_0x332541[_0xac80('0x19')],_0x4250b1=_0x273d6c[_0xac80('0x1a')],_0x1ccd30=_0x273d6c[_0xac80('0x1a')]+_0x273d6c['limit'],_0x5d79a9;if(_0x1ccd30>=_0x440073){_0x1ccd30=_0x440073;_0x5d79a9=0xc8;}else{_0x5d79a9=0xce;}_0x1e4516[_0xac80('0x18')](_0x5d79a9);return _0x1e4516[_0xac80('0x1b')](_0xac80('0x1c'),_0x4250b1+'-'+_0x1ccd30+'/'+_0x440073)[_0xac80('0x1d')](_0x332541);}return null;};}function patchUpdates(_0x1b2393){return function(_0x292d57){try{jsonpatch[_0xac80('0x1e')](_0x292d57,_0x1b2393,!![]);}catch(_0x1f1be9){return BPromise[_0xac80('0x1f')](_0x1f1be9);}return _0x292d57[_0xac80('0x20')]();};}function saveUpdates(_0x196ab1,_0x302454){return function(_0x3cc570){if(_0x3cc570){return _0x3cc570['update'](_0x196ab1)[_0xac80('0x21')](function(_0x5a9730){return _0x5a9730;});}return null;};}function removeEntity(_0x56f757,_0x150ebf){return function(_0x21ad25){if(_0x21ad25){return _0x21ad25[_0xac80('0x22')]()[_0xac80('0x21')](function(){var _0x52f578=_0x21ad25[_0xac80('0x23')]({'plain':!![]});var _0x5034e7='ODBC';return db['UserProfileResource'][_0xac80('0x22')]({'where':{'type':_0x5034e7,'resourceId':_0x52f578['id']}})[_0xac80('0x21')](function(){return _0x21ad25;});})[_0xac80('0x21')](function(){_0x56f757[_0xac80('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ea6c,_0x7c5c25){return function(_0x5b1ced){if(!_0x5b1ced){_0x20ea6c['sendStatus'](0x194);}return _0x5b1ced;};}function handleError(_0xa14cd5,_0x2c7c4b){_0x2c7c4b=_0x2c7c4b||0x1f4;return function(_0x339b92){logger[_0xac80('0x24')](_0x339b92[_0xac80('0x25')]);if(_0x339b92[_0xac80('0x26')]){delete _0x339b92[_0xac80('0x26')];}_0xa14cd5[_0xac80('0x18')](_0x2c7c4b)[_0xac80('0x27')](_0x339b92);};}exports['index']=function(_0x27ced1,_0x18cd0b){var _0x217d1e={},_0x34a9d6={},_0x205d52={'count':0x0,'rows':[]};var _0x14f3ff=_[_0xac80('0x28')](db['SquareOdbc'][_0xac80('0x29')],function(_0x2b869a){return{'name':_0x2b869a[_0xac80('0x2a')],'type':_0x2b869a[_0xac80('0x2b')]['key']};});_0x34a9d6[_0xac80('0x2c')]=_[_0xac80('0x28')](_0x14f3ff,_0xac80('0x26'));_0x34a9d6[_0xac80('0x2d')]=_[_0xac80('0x2e')](_0x27ced1[_0xac80('0x2d')]);_0x34a9d6[_0xac80('0x2f')]=_[_0xac80('0x30')](_0x34a9d6[_0xac80('0x2c')],_0x34a9d6['query']);_0x217d1e['attributes']=_[_0xac80('0x30')](_0x34a9d6[_0xac80('0x2c')],qs[_0xac80('0x31')](_0x27ced1[_0xac80('0x2d')]['fields']));_0x217d1e['attributes']=_0x217d1e['attributes']['length']?_0x217d1e[_0xac80('0x32')]:_0x34a9d6['model'];if(!_0x27ced1[_0xac80('0x2d')][_0xac80('0x33')](_0xac80('0x34'))){_0x217d1e['limit']=qs[_0xac80('0x35')](_0x27ced1[_0xac80('0x2d')][_0xac80('0x35')]);_0x217d1e[_0xac80('0x1a')]=qs['offset'](_0x27ced1[_0xac80('0x2d')][_0xac80('0x1a')]);}_0x217d1e[_0xac80('0x36')]=qs[_0xac80('0x37')](_0x27ced1[_0xac80('0x2d')][_0xac80('0x37')]);_0x217d1e[_0xac80('0x38')]=qs['filters'](_['pick'](_0x27ced1['query'],_0x34a9d6[_0xac80('0x2f')]),_0x14f3ff);if(_0x27ced1[_0xac80('0x2d')][_0xac80('0x39')]){_0x217d1e[_0xac80('0x38')]=_[_0xac80('0x3a')](_0x217d1e[_0xac80('0x38')],{'$or':_[_0xac80('0x28')](_0x14f3ff,function(_0x42978a){if(_0x42978a[_0xac80('0x2b')]!==_0xac80('0x3b')){var _0x531f12={};_0x531f12[_0x42978a[_0xac80('0x26')]]={'$like':'%'+_0x27ced1[_0xac80('0x2d')][_0xac80('0x39')]+'%'};return _0x531f12;}})});}_0x217d1e=_['merge']({},_0x217d1e,_0x27ced1['options']);var _0x4d96d5={'where':_0x217d1e[_0xac80('0x38')]};return db['SquareOdbc'][_0xac80('0x19')](_0x4d96d5)[_0xac80('0x21')](function(_0x4239b2){_0x205d52[_0xac80('0x19')]=_0x4239b2;if(_0x27ced1[_0xac80('0x2d')][_0xac80('0x3c')]){_0x217d1e[_0xac80('0x3d')]=[{'all':!![]}];}return db[_0xac80('0x3e')][_0xac80('0x3f')](_0x217d1e);})[_0xac80('0x21')](function(_0x435cfd){_0x205d52[_0xac80('0x40')]=_0x435cfd;return _0x205d52;})['then'](respondWithFilteredResult(_0x18cd0b,_0x217d1e))['catch'](handleError(_0x18cd0b,null));};exports[_0xac80('0x41')]=function(_0x4f716e,_0x384a82){var _0x2b9985={'raw':!![],'where':{'id':_0x4f716e['params']['id']}},_0x472cc3={};_0x472cc3[_0xac80('0x2c')]=_[_0xac80('0x2e')](db['SquareOdbc'][_0xac80('0x29')]);_0x472cc3[_0xac80('0x2d')]=_[_0xac80('0x2e')](_0x4f716e[_0xac80('0x2d')]);_0x472cc3[_0xac80('0x2f')]=_[_0xac80('0x30')](_0x472cc3['model'],_0x472cc3[_0xac80('0x2d')]);_0x2b9985[_0xac80('0x32')]=_[_0xac80('0x30')](_0x472cc3[_0xac80('0x2c')],qs[_0xac80('0x31')](_0x4f716e[_0xac80('0x2d')][_0xac80('0x31')]));_0x2b9985[_0xac80('0x32')]=_0x2b9985[_0xac80('0x32')][_0xac80('0x42')]?_0x2b9985['attributes']:_0x472cc3[_0xac80('0x2c')];if(_0x4f716e[_0xac80('0x2d')]['includeAll']){_0x2b9985[_0xac80('0x3d')]=[{'all':!![]}];}_0x2b9985=_[_0xac80('0x3a')]({},_0x2b9985,_0x4f716e[_0xac80('0x43')]);return db['SquareOdbc']['find'](_0x2b9985)[_0xac80('0x21')](handleEntityNotFound(_0x384a82,null))['then'](respondWithResult(_0x384a82,null))['catch'](handleError(_0x384a82,null));};exports[_0xac80('0x44')]=function(_0x2dfb42,_0x57a87f){return db[_0xac80('0x3e')]['create'](_0x2dfb42[_0xac80('0x45')],{})[_0xac80('0x21')](function(_0x5d69ac){var _0x53561c=_0x2dfb42['user']['get']({'plain':!![]});if(!_0x53561c)throw new Error(_0xac80('0x46'));if(_0x53561c['role']===_0xac80('0x47')){var _0x38c74a=_0x5d69ac[_0xac80('0x23')]({'plain':!![]});var _0x443917='ODBC';return db[_0xac80('0x48')][_0xac80('0x49')]({'where':{'name':_0x443917,'userProfileId':_0x53561c[_0xac80('0x4a')]},'raw':!![]})[_0xac80('0x21')](function(_0x5cf5a5){if(_0x5cf5a5&&_0x5cf5a5[_0xac80('0x4b')]===0x0){return db['UserProfileResource'][_0xac80('0x44')]({'name':_0x38c74a[_0xac80('0x26')],'resourceId':_0x38c74a['id'],'type':_0x5cf5a5[_0xac80('0x26')],'sectionId':_0x5cf5a5['id']},{})[_0xac80('0x21')](function(){return _0x5d69ac;});}else{return _0x5d69ac;}})[_0xac80('0x4c')](function(_0x2e0a5a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e0a5a);throw _0x2e0a5a;});}return _0x5d69ac;})[_0xac80('0x21')](respondWithResult(_0x57a87f,0xc9))[_0xac80('0x4c')](handleError(_0x57a87f,null));};exports[_0xac80('0x4d')]=function(_0x33b7b8,_0x17fd48){if(_0x33b7b8[_0xac80('0x45')]['id']){delete _0x33b7b8[_0xac80('0x45')]['id'];}return db[_0xac80('0x3e')][_0xac80('0x49')]({'where':{'id':_0x33b7b8[_0xac80('0x4e')]['id']}})[_0xac80('0x21')](handleEntityNotFound(_0x17fd48,null))[_0xac80('0x21')](saveUpdates(_0x33b7b8[_0xac80('0x45')],null))[_0xac80('0x21')](respondWithResult(_0x17fd48,null))[_0xac80('0x4c')](handleError(_0x17fd48,null));};exports['destroy']=function(_0x8ad707,_0x206a4c){return db[_0xac80('0x3e')][_0xac80('0x49')]({'where':{'id':_0x8ad707[_0xac80('0x4e')]['id']}})[_0xac80('0x21')](handleEntityNotFound(_0x206a4c,null))[_0xac80('0x21')](removeEntity(_0x206a4c,null))[_0xac80('0x4c')](handleError(_0x206a4c,null));};exports[_0xac80('0x4f')]=function(_0x5a834f,_0x5d872f,_0x5732d7){var _0x2e4596;return db[_0xac80('0x3e')][_0xac80('0x49')]({'where':{'id':_0x5a834f['params']['id']},'attributes':['id',_0xac80('0x50')]})[_0xac80('0x21')](handleEntityNotFound(_0x5d872f,null))[_0xac80('0x21')](function(_0xcd69c0){if(_0xcd69c0){var _0x3fe959=require(_0xac80('0x51'))();_0x3fe959[_0xac80('0x52')](_0xcd69c0[_0xac80('0x50')]);_0x3fe959[_0xac80('0x53')]();return _0xcd69c0;}})['then'](respondWithResult(_0x5d872f,null))[_0xac80('0x4c')](handleError(_0x5d872f,null));};
\ No newline at end of file
+var _0xe2fc=['sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','ODBC','UserProfileResource','destroy','end','error','stack','name','send','index','map','SquareOdbc','rawAttributes','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','length','find','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb'];(function(_0x579ef5,_0x1cea81){var _0x3674bb=function(_0x2d1d35){while(--_0x2d1d35){_0x579ef5['push'](_0x579ef5['shift']());}};_0x3674bb(++_0x1cea81);}(_0xe2fc,0x136));var _0xce2f=function(_0x4507a3,_0x394817){_0x4507a3=_0x4507a3-0x0;var _0x558bc4=_0xe2fc[_0x4507a3];return _0x558bc4;};'use strict';var pdf=require(_0xce2f('0x0'));var emlformat=require(_0xce2f('0x1'));var rimraf=require(_0xce2f('0x2'));var zipdir=require(_0xce2f('0x3'));var jsonpatch=require(_0xce2f('0x4'));var rp=require(_0xce2f('0x5'));var moment=require(_0xce2f('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xce2f('0x7'));var path=require(_0xce2f('0x8'));var sox=require(_0xce2f('0x9'));var csv=require(_0xce2f('0xa'));var ejs=require(_0xce2f('0xb'));var fs=require('fs');var _=require(_0xce2f('0xc'));var squel=require(_0xce2f('0xd'));var crypto=require(_0xce2f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xce2f('0xf'));var Papa=require(_0xce2f('0x10'));var Redis=require('ioredis');var authService=require(_0xce2f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce2f('0x12'));var logger=require('../../config/logger')(_0xce2f('0x13'));var utils=require(_0xce2f('0x14'));var config=require('../../config/environment');var db=require(_0xce2f('0x15'))['db'];function respondWithStatusCode(_0x5a2d8f,_0x2ae369){_0x2ae369=_0x2ae369||0xcc;return function(_0x328960){if(_0x328960){return _0x5a2d8f[_0xce2f('0x16')](_0x2ae369);}return _0x5a2d8f[_0xce2f('0x17')](_0x2ae369)['end']();};}function respondWithResult(_0xd703c7,_0x3172aa){_0x3172aa=_0x3172aa||0xc8;return function(_0x51539b){if(_0x51539b){return _0xd703c7[_0xce2f('0x17')](_0x3172aa)[_0xce2f('0x18')](_0x51539b);}};}function respondWithFilteredResult(_0x84973,_0x262cc7){return function(_0x210f3b){if(_0x210f3b){var _0x550ac5=_0x210f3b[_0xce2f('0x19')],_0x5f32bc=_0x262cc7[_0xce2f('0x1a')],_0x1b8659=_0x262cc7[_0xce2f('0x1a')]+_0x262cc7[_0xce2f('0x1b')],_0x5119b6;if(_0x1b8659>=_0x550ac5){_0x1b8659=_0x550ac5;_0x5119b6=0xc8;}else{_0x5119b6=0xce;}_0x84973[_0xce2f('0x17')](_0x5119b6);return _0x84973[_0xce2f('0x1c')](_0xce2f('0x1d'),_0x5f32bc+'-'+_0x1b8659+'/'+_0x550ac5)[_0xce2f('0x18')](_0x210f3b);}return null;};}function patchUpdates(_0x353aa1){return function(_0x2ee99e){try{jsonpatch['apply'](_0x2ee99e,_0x353aa1,!![]);}catch(_0x397ab7){return BPromise[_0xce2f('0x1e')](_0x397ab7);}return _0x2ee99e[_0xce2f('0x1f')]();};}function saveUpdates(_0x60caf2,_0x1ba4bb){return function(_0x16dec2){if(_0x16dec2){return _0x16dec2[_0xce2f('0x20')](_0x60caf2)[_0xce2f('0x21')](function(_0x160067){return _0x160067;});}return null;};}function removeEntity(_0x35c2ba,_0x429aa7){return function(_0xabf8df){if(_0xabf8df){return _0xabf8df['destroy']()[_0xce2f('0x21')](function(){var _0x2b0f30=_0xabf8df[_0xce2f('0x22')]({'plain':!![]});var _0x1596fe=_0xce2f('0x23');return db[_0xce2f('0x24')][_0xce2f('0x25')]({'where':{'type':_0x1596fe,'resourceId':_0x2b0f30['id']}})['then'](function(){return _0xabf8df;});})[_0xce2f('0x21')](function(){_0x35c2ba[_0xce2f('0x17')](0xcc)[_0xce2f('0x26')]();});}};}function handleEntityNotFound(_0x50b010,_0xab3d96){return function(_0x196cdc){if(!_0x196cdc){_0x50b010['sendStatus'](0x194);}return _0x196cdc;};}function handleError(_0x538af0,_0x2cc21e){_0x2cc21e=_0x2cc21e||0x1f4;return function(_0x384232){logger[_0xce2f('0x27')](_0x384232[_0xce2f('0x28')]);if(_0x384232[_0xce2f('0x29')]){delete _0x384232[_0xce2f('0x29')];}_0x538af0[_0xce2f('0x17')](_0x2cc21e)[_0xce2f('0x2a')](_0x384232);};}exports[_0xce2f('0x2b')]=function(_0x2ff31a,_0x5d793a){var _0x3fbd61={},_0x56a05a={},_0x1cf279={'count':0x0,'rows':[]};var _0x220a2e=_[_0xce2f('0x2c')](db[_0xce2f('0x2d')][_0xce2f('0x2e')],function(_0xe0a677){return{'name':_0xe0a677['fieldName'],'type':_0xe0a677['type'][_0xce2f('0x2f')]};});_0x56a05a['model']=_[_0xce2f('0x2c')](_0x220a2e,_0xce2f('0x29'));_0x56a05a['query']=_[_0xce2f('0x30')](_0x2ff31a['query']);_0x56a05a[_0xce2f('0x31')]=_[_0xce2f('0x32')](_0x56a05a[_0xce2f('0x33')],_0x56a05a[_0xce2f('0x34')]);_0x3fbd61[_0xce2f('0x35')]=_[_0xce2f('0x32')](_0x56a05a['model'],qs[_0xce2f('0x36')](_0x2ff31a[_0xce2f('0x34')][_0xce2f('0x36')]));_0x3fbd61['attributes']=_0x3fbd61[_0xce2f('0x35')]['length']?_0x3fbd61[_0xce2f('0x35')]:_0x56a05a[_0xce2f('0x33')];if(!_0x2ff31a[_0xce2f('0x34')][_0xce2f('0x37')](_0xce2f('0x38'))){_0x3fbd61[_0xce2f('0x1b')]=qs[_0xce2f('0x1b')](_0x2ff31a['query'][_0xce2f('0x1b')]);_0x3fbd61[_0xce2f('0x1a')]=qs[_0xce2f('0x1a')](_0x2ff31a['query']['offset']);}_0x3fbd61[_0xce2f('0x39')]=qs[_0xce2f('0x3a')](_0x2ff31a[_0xce2f('0x34')][_0xce2f('0x3a')]);_0x3fbd61[_0xce2f('0x3b')]=qs['filters'](_[_0xce2f('0x3c')](_0x2ff31a[_0xce2f('0x34')],_0x56a05a[_0xce2f('0x31')]),_0x220a2e);if(_0x2ff31a[_0xce2f('0x34')][_0xce2f('0x3d')]){_0x3fbd61[_0xce2f('0x3b')]=_[_0xce2f('0x3e')](_0x3fbd61['where'],{'$or':_[_0xce2f('0x2c')](_0x220a2e,function(_0x456eef){if(_0x456eef[_0xce2f('0x3f')]!==_0xce2f('0x40')){var _0xbc16c={};_0xbc16c[_0x456eef['name']]={'$like':'%'+_0x2ff31a[_0xce2f('0x34')][_0xce2f('0x3d')]+'%'};return _0xbc16c;}})});}_0x3fbd61=_[_0xce2f('0x3e')]({},_0x3fbd61,_0x2ff31a[_0xce2f('0x41')]);var _0x5ce977={'where':_0x3fbd61[_0xce2f('0x3b')]};return db[_0xce2f('0x2d')]['count'](_0x5ce977)['then'](function(_0x541cdd){_0x1cf279[_0xce2f('0x19')]=_0x541cdd;if(_0x2ff31a[_0xce2f('0x34')][_0xce2f('0x42')]){_0x3fbd61[_0xce2f('0x43')]=[{'all':!![]}];}return db[_0xce2f('0x2d')][_0xce2f('0x44')](_0x3fbd61);})[_0xce2f('0x21')](function(_0x4ac8b9){_0x1cf279['rows']=_0x4ac8b9;return _0x1cf279;})[_0xce2f('0x21')](respondWithFilteredResult(_0x5d793a,_0x3fbd61))[_0xce2f('0x45')](handleError(_0x5d793a,null));};exports['show']=function(_0x51888d,_0x36b581){var _0x23b320={'raw':!![],'where':{'id':_0x51888d[_0xce2f('0x46')]['id']}},_0x6ceaef={};_0x6ceaef['model']=_[_0xce2f('0x30')](db['SquareOdbc']['rawAttributes']);_0x6ceaef[_0xce2f('0x34')]=_['keys'](_0x51888d[_0xce2f('0x34')]);_0x6ceaef[_0xce2f('0x31')]=_[_0xce2f('0x32')](_0x6ceaef[_0xce2f('0x33')],_0x6ceaef[_0xce2f('0x34')]);_0x23b320[_0xce2f('0x35')]=_[_0xce2f('0x32')](_0x6ceaef[_0xce2f('0x33')],qs['fields'](_0x51888d['query'][_0xce2f('0x36')]));_0x23b320[_0xce2f('0x35')]=_0x23b320[_0xce2f('0x35')][_0xce2f('0x47')]?_0x23b320[_0xce2f('0x35')]:_0x6ceaef['model'];if(_0x51888d[_0xce2f('0x34')][_0xce2f('0x42')]){_0x23b320[_0xce2f('0x43')]=[{'all':!![]}];}_0x23b320=_[_0xce2f('0x3e')]({},_0x23b320,_0x51888d['options']);return db[_0xce2f('0x2d')][_0xce2f('0x48')](_0x23b320)['then'](handleEntityNotFound(_0x36b581,null))[_0xce2f('0x21')](respondWithResult(_0x36b581,null))[_0xce2f('0x45')](handleError(_0x36b581,null));};exports['create']=function(_0xb6e7a3,_0x70f0c4){return db[_0xce2f('0x2d')][_0xce2f('0x49')](_0xb6e7a3['body'],{})[_0xce2f('0x21')](function(_0x19ebfc){var _0x3323e9=_0xb6e7a3[_0xce2f('0x4a')][_0xce2f('0x22')]({'plain':!![]});if(!_0x3323e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3323e9[_0xce2f('0x4b')]===_0xce2f('0x4a')){var _0x287eb3=_0x19ebfc[_0xce2f('0x22')]({'plain':!![]});var _0x7dee79=_0xce2f('0x23');return db['UserProfileSection'][_0xce2f('0x48')]({'where':{'name':_0x7dee79,'userProfileId':_0x3323e9[_0xce2f('0x4c')]},'raw':!![]})['then'](function(_0x41be72){if(_0x41be72&&_0x41be72[_0xce2f('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x287eb3[_0xce2f('0x29')],'resourceId':_0x287eb3['id'],'type':_0x41be72['name'],'sectionId':_0x41be72['id']},{})[_0xce2f('0x21')](function(){return _0x19ebfc;});}else{return _0x19ebfc;}})[_0xce2f('0x45')](function(_0xf0019d){logger[_0xce2f('0x27')](_0xce2f('0x4e'),_0xf0019d);throw _0xf0019d;});}return _0x19ebfc;})[_0xce2f('0x21')](respondWithResult(_0x70f0c4,0xc9))[_0xce2f('0x45')](handleError(_0x70f0c4,null));};exports[_0xce2f('0x20')]=function(_0x4e0e25,_0x88447c){if(_0x4e0e25[_0xce2f('0x4f')]['id']){delete _0x4e0e25['body']['id'];}return db[_0xce2f('0x2d')][_0xce2f('0x48')]({'where':{'id':_0x4e0e25[_0xce2f('0x46')]['id']}})[_0xce2f('0x21')](handleEntityNotFound(_0x88447c,null))[_0xce2f('0x21')](saveUpdates(_0x4e0e25[_0xce2f('0x4f')],null))['then'](respondWithResult(_0x88447c,null))[_0xce2f('0x45')](handleError(_0x88447c,null));};exports['destroy']=function(_0x3ce82d,_0x5348db){return db['SquareOdbc'][_0xce2f('0x48')]({'where':{'id':_0x3ce82d['params']['id']}})[_0xce2f('0x21')](handleEntityNotFound(_0x5348db,null))[_0xce2f('0x21')](removeEntity(_0x5348db,null))[_0xce2f('0x45')](handleError(_0x5348db,null));};exports[_0xce2f('0x50')]=function(_0x1e312e,_0x54bc93,_0x14cb24){var _0x125684;return db['SquareOdbc']['find']({'where':{'id':_0x1e312e['params']['id']},'attributes':['id',_0xce2f('0x51')]})['then'](handleEntityNotFound(_0x54bc93,null))[_0xce2f('0x21')](function(_0x13ddb6){if(_0x13ddb6){var _0x4d986d=require('odbc')();_0x4d986d['openSync'](_0x13ddb6[_0xce2f('0x51')]);_0x4d986d[_0xce2f('0x52')]();return _0x13ddb6;}})['then'](respondWithResult(_0x54bc93,null))[_0xce2f('0x45')](handleError(_0x54bc93,null));};
\ No newline at end of file
index 9b59ac0..0724752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d3a=['../../config/environment','./squareOdbc.attributes','SquareOdbc','lodash','util','moment','bluebird','path','rimraf'];(function(_0xebebc,_0x2480e9){var _0x2495da=function(_0x12e0cd){while(--_0x12e0cd){_0xebebc['push'](_0xebebc['shift']());}};_0x2495da(++_0x2480e9);}(_0x1d3a,0x18f));var _0xa1d3=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x1d3a[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xa1d3('0x0'));var util=require(_0xa1d3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa1d3('0x2'));var BPromise=require(_0xa1d3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1d3('0x4'));var rimraf=require(_0xa1d3('0x5'));var config=require(_0xa1d3('0x6'));var attributes=require(_0xa1d3('0x7'));module['exports']=function(_0x548a04,_0x223c8d){return _0x548a04['define'](_0xa1d3('0x8'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa702=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','SquareOdbc','square_odbc'];(function(_0x45e83a,_0x430070){var _0x2e46e9=function(_0x24c909){while(--_0x24c909){_0x45e83a['push'](_0x45e83a['shift']());}};_0x2e46e9(++_0x430070);}(_0xa702,0x1ae));var _0x2a70=function(_0x4ee098,_0x577ffd){_0x4ee098=_0x4ee098-0x0;var _0x10fa69=_0xa702[_0x4ee098];return _0x10fa69;};'use strict';var _=require(_0x2a70('0x0'));var util=require(_0x2a70('0x1'));var logger=require(_0x2a70('0x2'))(_0x2a70('0x3'));var moment=require(_0x2a70('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a70('0x6'));var attributes=require('./squareOdbc.attributes');module[_0x2a70('0x7')]=function(_0x16cdc3,_0x4b2915){return _0x16cdc3['define'](_0x2a70('0x8'),attributes,{'tableName':_0x2a70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5528498..99a6e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','ShowSquareOdbc','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','SquareOdbc,\x20%s,\x20%s','message','info'];(function(_0x3b0d12,_0x581b78){var _0x44eb08=function(_0x40632d){while(--_0x40632d){_0x3b0d12['push'](_0x3b0d12['shift']());}};_0x44eb08(++_0x581b78);}(_0x3e74,0x175));var _0x43e7=function(_0x20ed77,_0x3fbae6){_0x20ed77=_0x20ed77-0x0;var _0x5b60b7=_0x3e74[_0x20ed77];return _0x5b60b7;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowSquareOdbc']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});};
\ No newline at end of file
+var _0x3e74=['catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','ShowSquareOdbc','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','SquareOdbc,\x20%s,\x20%s','message','info'];(function(_0x8550ba,_0x57c10d){var _0x432399=function(_0x33ab8a){while(--_0x33ab8a){_0x8550ba['push'](_0x8550ba['shift']());}};_0x432399(++_0x57c10d);}(_0x3e74,0x175));var _0x43e7=function(_0x46d91f,_0x733fb7){_0x46d91f=_0x46d91f-0x0;var _0x1d9053=_0x3e74[_0x46d91f];return _0x1d9053;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowSquareOdbc']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});};
\ No newline at end of file
index f2fc268..59468c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c00=['getUsers','post','create','put','update','delete','removeUsers','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5c00,0x17e));var _0x05c0=function(_0x17f2b7,_0x32a8b0){_0x17f2b7=_0x17f2b7-0x0;var _0x4164f6=_0x5c00[_0x17f2b7];return _0x4164f6;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x9')]);router[_0x05c0('0xa')](_0x05c0('0xb'),auth['isAuthenticated'](),controller[_0x05c0('0xc')]);router[_0x05c0('0xa')](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0xe')]);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x10')]);router[_0x05c0('0xf')](_0x05c0('0xd'),auth['isAuthenticated'](),controller['addUsers']);router[_0x05c0('0x11')]('/:id',auth[_0x05c0('0x8')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')]('/:id',auth[_0x05c0('0x8')](),controller['destroy']);router[_0x05c0('0x13')](_0x05c0('0xd'),auth[_0x05c0('0x8')](),controller[_0x05c0('0x14')]);module[_0x05c0('0x15')]=router;
\ No newline at end of file
+var _0x02ce=['getUsers','post','create','addUsers','put','update','delete','removeUsers','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','/:id/users'];(function(_0x160fb9,_0x4b82ff){var _0x43f06d=function(_0x1b0f93){while(--_0x1b0f93){_0x160fb9['push'](_0x160fb9['shift']());}};_0x43f06d(++_0x4b82ff);}(_0x02ce,0x1ac));var _0xe02c=function(_0x414902,_0x19cb58){_0x414902=_0x414902-0x0;var _0x5b00a3=_0x02ce[_0x414902];return _0x5b00a3;};'use strict';var multer=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var path=require(_0xe02c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe02c('0x3'));var router=express['Router']();var auth=require(_0xe02c('0x4'));var interaction=require(_0xe02c('0x5'));var config=require(_0xe02c('0x6'));var controller=require(_0xe02c('0x7'));router[_0xe02c('0x8')]('/',auth[_0xe02c('0x9')](),controller[_0xe02c('0xa')]);router[_0xe02c('0x8')](_0xe02c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe02c('0x8')](_0xe02c('0xc'),auth[_0xe02c('0x9')](),controller[_0xe02c('0xd')]);router[_0xe02c('0xe')]('/',auth[_0xe02c('0x9')](),controller[_0xe02c('0xf')]);router[_0xe02c('0xe')](_0xe02c('0xc'),auth[_0xe02c('0x9')](),controller[_0xe02c('0x10')]);router[_0xe02c('0x11')](_0xe02c('0xb'),auth[_0xe02c('0x9')](),controller[_0xe02c('0x12')]);router[_0xe02c('0x13')](_0xe02c('0xb'),auth[_0xe02c('0x9')](),controller['destroy']);router[_0xe02c('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0xe02c('0x14')]);module['exports']=router;
\ No newline at end of file
index d8b2c9a..98a7313 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc45e=['sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','utf8','production','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc45e,0x1e0));var _0xec45=function(_0x1933fe,_0x4dd1d2){_0x1933fe=_0x1933fe-0x0;var _0x3ccf9c=_0xc45e[_0x1933fe];return _0x3ccf9c;};'use strict';var Sequelize=require(_0xec45('0x0'));module[_0xec45('0x1')]={'name':{'type':Sequelize[_0xec45('0x2')],'unique':_0xec45('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xec45('0x2')]},'notes':{'type':Sequelize[_0xec45('0x4')]},'preproduction':{'type':Sequelize[_0xec45('0x5')](_0xec45('0x6')),'get':function(){if(this[_0xec45('0x7')](_0xec45('0x8'))){return this[_0xec45('0x7')](_0xec45('0x8'))['toString'](_0xec45('0x9'));}}},'production':{'type':Sequelize[_0xec45('0x5')](_0xec45('0x6')),'get':function(){if(this[_0xec45('0x7')](_0xec45('0xa'))){return this[_0xec45('0x7')]('production')[_0xec45('0xb')](_0xec45('0x9'));}}}};
\ No newline at end of file
+var _0xa065=['getDataValue','preproduction','toString','utf8','production','sequelize','exports','name','BLOB','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa065,0x16d));var _0x5a06=function(_0x12ff06,_0x3e8a84){_0x12ff06=_0x12ff06-0x0;var _0x4522b9=_0xa065[_0x12ff06];return _0x4522b9;};'use strict';var Sequelize=require(_0x5a06('0x0'));module[_0x5a06('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5a06('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x5a06('0x3')](_0x5a06('0x4')),'get':function(){if(this[_0x5a06('0x5')](_0x5a06('0x6'))){return this['getDataValue'](_0x5a06('0x6'))[_0x5a06('0x7')](_0x5a06('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x5a06('0x5')](_0x5a06('0x9'))){return this[_0x5a06('0x5')](_0x5a06('0x9'))['toString']('utf8');}}}};
\ No newline at end of file
index 821d3fb..896deda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36d7=['eml-format','rimraf','fast-json-patch','request-promise','mustache','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./squareProject.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','SquareProjects','end','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','SquareProject','include','rows','catch','show','rawAttributes','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','pick','nolimit'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x36d7,0x1d1));var _0x736d=function(_0x477ffc,_0x58d9db){_0x477ffc=_0x477ffc-0x0;var _0x1fe1c3=_0x36d7[_0x477ffc];return _0x1fe1c3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x736d('0x0'));var rimraf=require(_0x736d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x736d('0x2'));var rp=require(_0x736d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x736d('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x736d('0x5'));var ejs=require(_0x736d('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x736d('0x7'));var crypto=require('crypto');var jsforce=require(_0x736d('0x8'));var deskjs=require(_0x736d('0x9'));var toCsv=require(_0x736d('0x5'));var querystring=require(_0x736d('0xa'));var Papa=require(_0x736d('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x736d('0xc'));var as=require(_0x736d('0xd'));var hardwareService=require(_0x736d('0xe'));var logger=require(_0x736d('0xf'))('api');var utils=require(_0x736d('0x10'));var config=require(_0x736d('0x11'));var db=require(_0x736d('0x12'))['db'];config[_0x736d('0x13')]=_[_0x736d('0x14')](config[_0x736d('0x13')],{'host':_0x736d('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x736d('0x16'))['register'](socket);function respondWithStatusCode(_0x16de31,_0x8bd116){_0x8bd116=_0x8bd116||0xcc;return function(_0x56f39a){if(_0x56f39a){return _0x16de31[_0x736d('0x17')](_0x8bd116);}return _0x16de31[_0x736d('0x18')](_0x8bd116)['end']();};}function respondWithResult(_0x138efc,_0x2501dd){_0x2501dd=_0x2501dd||0xc8;return function(_0x43f3e2){if(_0x43f3e2){return _0x138efc[_0x736d('0x18')](_0x2501dd)[_0x736d('0x19')](_0x43f3e2);}};}function respondWithFilteredResult(_0xa87a48,_0x5a80ec){return function(_0x398608){if(_0x398608){var _0x36b939=_0x398608[_0x736d('0x1a')],_0x249fbc=_0x5a80ec['offset'],_0x21a70d=_0x5a80ec[_0x736d('0x1b')]+_0x5a80ec[_0x736d('0x1c')],_0x493e0a;if(_0x21a70d>=_0x36b939){_0x21a70d=_0x36b939;_0x493e0a=0xc8;}else{_0x493e0a=0xce;}_0xa87a48[_0x736d('0x18')](_0x493e0a);return _0xa87a48[_0x736d('0x1d')](_0x736d('0x1e'),_0x249fbc+'-'+_0x21a70d+'/'+_0x36b939)['json'](_0x398608);}return null;};}function patchUpdates(_0x946f08){return function(_0x4786e5){try{jsonpatch[_0x736d('0x1f')](_0x4786e5,_0x946f08,!![]);}catch(_0x11d505){return BPromise[_0x736d('0x20')](_0x11d505);}return _0x4786e5[_0x736d('0x21')]();};}function saveUpdates(_0x47537e,_0x3a1801){return function(_0x2bc41a){if(_0x2bc41a){return _0x2bc41a[_0x736d('0x22')](_0x47537e)['then'](function(_0x5d3f61){return _0x5d3f61;});}return null;};}function removeEntity(_0x450ead,_0x440c99){return function(_0x49a56){if(_0x49a56){return _0x49a56[_0x736d('0x23')]()[_0x736d('0x24')](function(){var _0x39beed=_0x49a56[_0x736d('0x25')]({'plain':!![]});var _0x8724ec=_0x736d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x8724ec,'resourceId':_0x39beed['id']}})['then'](function(){return _0x49a56;});})[_0x736d('0x24')](function(){_0x450ead[_0x736d('0x18')](0xcc)[_0x736d('0x27')]();});}};}function handleEntityNotFound(_0x1a1671,_0x46ae7d){return function(_0x38f968){if(!_0x38f968){_0x1a1671[_0x736d('0x17')](0x194);}return _0x38f968;};}function handleError(_0x4d677c,_0x633a10){_0x633a10=_0x633a10||0x1f4;return function(_0x4a34f4){logger[_0x736d('0x28')](_0x4a34f4[_0x736d('0x29')]);if(_0x4a34f4[_0x736d('0x2a')]){delete _0x4a34f4[_0x736d('0x2a')];}_0x4d677c['status'](_0x633a10)[_0x736d('0x2b')](_0x4a34f4);};}exports['index']=function(_0x194efe,_0x15ec31){var _0x3cdce5={},_0x508d4a={},_0x446077={'count':0x0,'rows':[]};var _0x11cdbf=_[_0x736d('0x2c')](db['SquareProject']['rawAttributes'],function(_0x195774){return{'name':_0x195774[_0x736d('0x2d')],'type':_0x195774[_0x736d('0x2e')][_0x736d('0x2f')]};});_0x508d4a[_0x736d('0x30')]=_['map'](_0x11cdbf,_0x736d('0x2a'));_0x508d4a[_0x736d('0x31')]=_[_0x736d('0x32')](_0x194efe['query']);_0x508d4a[_0x736d('0x33')]=_['intersection'](_0x508d4a[_0x736d('0x30')],_0x508d4a[_0x736d('0x31')]);_0x3cdce5['attributes']=_[_0x736d('0x34')](_0x508d4a[_0x736d('0x30')],qs[_0x736d('0x35')](_0x194efe[_0x736d('0x31')][_0x736d('0x35')]));_0x3cdce5[_0x736d('0x36')]=_0x3cdce5[_0x736d('0x36')][_0x736d('0x37')]?_0x3cdce5[_0x736d('0x36')]:_0x508d4a['model'];if(!_0x194efe[_0x736d('0x31')][_0x736d('0x38')]('nolimit')){_0x3cdce5[_0x736d('0x1c')]=qs[_0x736d('0x1c')](_0x194efe[_0x736d('0x31')][_0x736d('0x1c')]);_0x3cdce5[_0x736d('0x1b')]=qs[_0x736d('0x1b')](_0x194efe[_0x736d('0x31')][_0x736d('0x1b')]);}_0x3cdce5[_0x736d('0x39')]=qs[_0x736d('0x3a')](_0x194efe[_0x736d('0x31')][_0x736d('0x3a')]);_0x3cdce5[_0x736d('0x3b')]=qs['filters'](_['pick'](_0x194efe[_0x736d('0x31')],_0x508d4a[_0x736d('0x33')]),_0x11cdbf);if(_0x194efe['query'][_0x736d('0x3c')]){_0x3cdce5[_0x736d('0x3b')]=_[_0x736d('0x3d')](_0x3cdce5[_0x736d('0x3b')],{'$or':_['map'](_0x11cdbf,function(_0x47b894){if(_0x47b894[_0x736d('0x2e')]!=='VIRTUAL'){var _0x4b89d0={};_0x4b89d0[_0x47b894[_0x736d('0x2a')]]={'$like':'%'+_0x194efe[_0x736d('0x31')][_0x736d('0x3c')]+'%'};return _0x4b89d0;}})});}_0x3cdce5=_[_0x736d('0x3d')]({},_0x3cdce5,_0x194efe[_0x736d('0x3e')]);var _0x13c9c1={'where':_0x3cdce5['where']};return db[_0x736d('0x3f')]['count'](_0x13c9c1)['then'](function(_0x5652ae){_0x446077[_0x736d('0x1a')]=_0x5652ae;if(_0x194efe[_0x736d('0x31')]['includeAll']){_0x3cdce5[_0x736d('0x40')]=[{'all':!![]}];}return db[_0x736d('0x3f')]['findAll'](_0x3cdce5);})[_0x736d('0x24')](function(_0x66d383){_0x446077[_0x736d('0x41')]=_0x66d383;return _0x446077;})[_0x736d('0x24')](respondWithFilteredResult(_0x15ec31,_0x3cdce5))[_0x736d('0x42')](handleError(_0x15ec31,null));};exports[_0x736d('0x43')]=function(_0x3452e1,_0x4cbe81){var _0x250190={'raw':![],'where':{'id':_0x3452e1['params']['id']}},_0x2ff13a={};_0x2ff13a[_0x736d('0x30')]=_['keys'](db['SquareProject'][_0x736d('0x44')]);_0x2ff13a['query']=_[_0x736d('0x32')](_0x3452e1[_0x736d('0x31')]);_0x2ff13a[_0x736d('0x33')]=_['intersection'](_0x2ff13a[_0x736d('0x30')],_0x2ff13a[_0x736d('0x31')]);_0x250190[_0x736d('0x36')]=_[_0x736d('0x34')](_0x2ff13a['model'],qs['fields'](_0x3452e1[_0x736d('0x31')][_0x736d('0x35')]));_0x250190[_0x736d('0x36')]=_0x250190[_0x736d('0x36')][_0x736d('0x37')]?_0x250190['attributes']:_0x2ff13a[_0x736d('0x30')];if(_0x3452e1[_0x736d('0x31')][_0x736d('0x45')]){_0x250190[_0x736d('0x40')]=[{'all':!![]}];}_0x250190=_[_0x736d('0x3d')]({},_0x250190,_0x3452e1[_0x736d('0x3e')]);return db[_0x736d('0x3f')]['find'](_0x250190)[_0x736d('0x24')](handleEntityNotFound(_0x4cbe81,null))[_0x736d('0x24')](respondWithResult(_0x4cbe81,null))[_0x736d('0x42')](handleError(_0x4cbe81,null));};exports[_0x736d('0x46')]=function(_0x2e9d71,_0x1ba582){return db['SquareProject']['create'](_0x2e9d71[_0x736d('0x47')],{})[_0x736d('0x24')](function(_0x22e7a0){var _0x589233=_0x2e9d71[_0x736d('0x48')]['get']({'plain':!![]});if(!_0x589233)throw new Error(_0x736d('0x49'));if(_0x589233[_0x736d('0x4a')]===_0x736d('0x48')){var _0xd02e30=_0x22e7a0['get']({'plain':!![]});var _0x217c8e=_0x736d('0x26');return db[_0x736d('0x4b')]['find']({'where':{'name':_0x217c8e,'userProfileId':_0x589233[_0x736d('0x4c')]},'raw':!![]})['then'](function(_0x18f259){if(_0x18f259&&_0x18f259[_0x736d('0x4d')]===0x0){return db['UserProfileResource'][_0x736d('0x46')]({'name':_0xd02e30[_0x736d('0x2a')],'resourceId':_0xd02e30['id'],'type':_0x18f259[_0x736d('0x2a')],'sectionId':_0x18f259['id']},{})[_0x736d('0x24')](function(){return _0x22e7a0;});}else{return _0x22e7a0;}})[_0x736d('0x42')](function(_0x424516){logger['error'](_0x736d('0x4e'),_0x424516);throw _0x424516;});}return _0x22e7a0;})[_0x736d('0x24')](respondWithResult(_0x1ba582,0xc9))[_0x736d('0x42')](handleError(_0x1ba582,null));};exports['update']=function(_0x5cb1e7,_0x3b1c92){if(_0x5cb1e7[_0x736d('0x47')]['id']){delete _0x5cb1e7[_0x736d('0x47')]['id'];}return db[_0x736d('0x3f')][_0x736d('0x4f')]({'where':{'id':_0x5cb1e7[_0x736d('0x50')]['id']}})['then'](handleEntityNotFound(_0x3b1c92,null))[_0x736d('0x24')](saveUpdates(_0x5cb1e7[_0x736d('0x47')],null))[_0x736d('0x24')](respondWithResult(_0x3b1c92,null))[_0x736d('0x42')](handleError(_0x3b1c92,null));};exports[_0x736d('0x23')]=function(_0x5824f9,_0x35c460){return db[_0x736d('0x3f')][_0x736d('0x4f')]({'where':{'id':_0x5824f9[_0x736d('0x50')]['id']}})[_0x736d('0x24')](handleEntityNotFound(_0x35c460,null))[_0x736d('0x24')](removeEntity(_0x35c460,null))['catch'](handleError(_0x35c460,null));};exports[_0x736d('0x51')]=function(_0x2dbc8b,_0x17db97,_0x52c17b){return db['SquareProject'][_0x736d('0x4f')]({'where':{'id':_0x2dbc8b['params']['id']}})[_0x736d('0x24')](handleEntityNotFound(_0x17db97,null))[_0x736d('0x24')](function(_0x386b6d){if(_0x386b6d){return _0x386b6d[_0x736d('0x51')](_0x2dbc8b[_0x736d('0x47')]['ids'],_[_0x736d('0x52')](_0x2dbc8b[_0x736d('0x47')],[_0x736d('0x53'),'id'])||{});}})[_0x736d('0x24')](respondWithResult(_0x17db97,null))['catch'](handleError(_0x17db97,null));};exports[_0x736d('0x54')]=function(_0x173fcd,_0x585da2,_0x25ac0a){return db['SquareProject'][_0x736d('0x4f')]({'where':{'id':_0x173fcd['params']['id']}})['then'](handleEntityNotFound(_0x585da2,null))[_0x736d('0x24')](function(_0x1fa69b){if(_0x1fa69b){return _0x1fa69b[_0x736d('0x54')](_0x173fcd[_0x736d('0x31')]['ids'])[_0x736d('0x24')](function(){if(_[_0x736d('0x55')](_0x173fcd['query'][_0x736d('0x53')])){for(var _0x1eecc6=0x0;_0x1eecc6<_0x173fcd[_0x736d('0x31')][_0x736d('0x53')][_0x736d('0x37')];_0x1eecc6+=0x1){socket[_0x736d('0x56')](_0x736d('0x57'),{'UserId':Number(_0x173fcd['query'][_0x736d('0x53')][_0x1eecc6]),'SquareProjectId':Number(_0x173fcd['params']['id'])});}}else{socket[_0x736d('0x56')](_0x736d('0x57'),{'UserId':Number(_0x173fcd[_0x736d('0x31')][_0x736d('0x53')]),'SquareProjectId':Number(_0x173fcd[_0x736d('0x50')]['id'])});}});}})[_0x736d('0x24')](respondWithStatusCode(_0x585da2,null))[_0x736d('0x42')](handleError(_0x585da2,null));};exports[_0x736d('0x58')]=function(_0x7b7661,_0x5508a1,_0x1ccd6b){var _0x59aa5a={};var _0x21e864={};var _0x56a696;var _0x4ebdc3;return db[_0x736d('0x3f')][_0x736d('0x59')]({'where':{'id':_0x7b7661['params']['id']}})[_0x736d('0x24')](handleEntityNotFound(_0x5508a1,null))[_0x736d('0x24')](function(_0x37790f){if(_0x37790f){_0x56a696=_0x37790f;_0x21e864[_0x736d('0x30')]=_['keys'](db[_0x736d('0x5a')][_0x736d('0x44')]);_0x21e864[_0x736d('0x31')]=_[_0x736d('0x32')](_0x7b7661[_0x736d('0x31')]);_0x21e864[_0x736d('0x33')]=_[_0x736d('0x34')](_0x21e864[_0x736d('0x30')],_0x21e864[_0x736d('0x31')]);_0x59aa5a[_0x736d('0x36')]=_[_0x736d('0x34')](_0x21e864[_0x736d('0x30')],qs[_0x736d('0x35')](_0x7b7661[_0x736d('0x31')]['fields']));_0x59aa5a[_0x736d('0x36')]=_0x59aa5a[_0x736d('0x36')][_0x736d('0x37')]?_0x59aa5a[_0x736d('0x36')]:_0x21e864['model'];_0x59aa5a['order']=qs['sort'](_0x7b7661[_0x736d('0x31')]['sort']);_0x59aa5a[_0x736d('0x3b')]=qs[_0x736d('0x33')](_[_0x736d('0x5b')](_0x7b7661['query'],_0x21e864[_0x736d('0x33')]));if(_0x7b7661[_0x736d('0x31')]['filter']){_0x59aa5a[_0x736d('0x3b')]=_[_0x736d('0x3d')](_0x59aa5a[_0x736d('0x3b')],{'$or':_[_0x736d('0x2c')](_0x59aa5a[_0x736d('0x36')],function(_0x2b572d){var _0xc37cda={};_0xc37cda[_0x2b572d]={'$like':'%'+_0x7b7661[_0x736d('0x31')][_0x736d('0x3c')]+'%'};return _0xc37cda;})});}_0x59aa5a=_['merge']({},_0x59aa5a,_0x7b7661[_0x736d('0x3e')]);return _0x56a696[_0x736d('0x58')](_0x59aa5a);}})[_0x736d('0x24')](function(_0x26388e){if(_0x26388e){_0x4ebdc3=_0x26388e[_0x736d('0x37')];if(!_0x7b7661[_0x736d('0x31')]['hasOwnProperty'](_0x736d('0x5c'))){_0x59aa5a['limit']=qs[_0x736d('0x1c')](_0x7b7661[_0x736d('0x31')][_0x736d('0x1c')]);_0x59aa5a[_0x736d('0x1b')]=qs[_0x736d('0x1b')](_0x7b7661[_0x736d('0x31')][_0x736d('0x1b')]);}return _0x56a696['getUsers'](_0x59aa5a);}})[_0x736d('0x24')](function(_0x51787b){if(_0x51787b){return _0x51787b?{'count':_0x4ebdc3,'rows':_0x51787b}:null;}})[_0x736d('0x24')](respondWithResult(_0x5508a1,null))[_0x736d('0x42')](handleError(_0x5508a1,null));};
\ No newline at end of file
+var _0xbadb=['SquareProjects','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','length','nolimit','limit','order','sort','filters','filter','where','VIRTUAL','options','SquareProject','includeAll','include','rows','catch','show','params','intersection','merge','find','body','user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','User','pick','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','papaparse','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','./squareProject.socket','register','sendStatus','status','json','count','offset','apply','reject','save','update','then','destroy','get'];(function(_0x4e8d22,_0x562642){var _0x3c2411=function(_0x37cb1f){while(--_0x37cb1f){_0x4e8d22['push'](_0x4e8d22['shift']());}};_0x3c2411(++_0x562642);}(_0xbadb,0x14e));var _0xbbad=function(_0x55cab6,_0x4c1c08){_0x55cab6=_0x55cab6-0x0;var _0x541ba4=_0xbadb[_0x55cab6];return _0x541ba4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbbad('0x0'));var rimraf=require(_0xbbad('0x1'));var zipdir=require(_0xbbad('0x2'));var jsonpatch=require(_0xbbad('0x3'));var rp=require(_0xbbad('0x4'));var moment=require(_0xbbad('0x5'));var BPromise=require(_0xbbad('0x6'));var Mustache=require(_0xbbad('0x7'));var util=require(_0xbbad('0x8'));var path=require(_0xbbad('0x9'));var sox=require('sox');var csv=require(_0xbbad('0xa'));var ejs=require(_0xbbad('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbbad('0xc'));var crypto=require('crypto');var jsforce=require(_0xbbad('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbbad('0xa'));var querystring=require('querystring');var Papa=require(_0xbbad('0xe'));var Redis=require(_0xbbad('0xf'));var authService=require(_0xbbad('0x10'));var qs=require(_0xbbad('0x11'));var as=require(_0xbbad('0x12'));var hardwareService=require(_0xbbad('0x13'));var logger=require('../../config/logger')(_0xbbad('0x14'));var utils=require(_0xbbad('0x15'));var config=require(_0xbbad('0x16'));var db=require(_0xbbad('0x17'))['db'];config[_0xbbad('0x18')]=_[_0xbbad('0x19')](config[_0xbbad('0x18')],{'host':_0xbbad('0x1a'),'port':0x18eb});var socket=require(_0xbbad('0x1b'))(new Redis(config[_0xbbad('0x18')]));require(_0xbbad('0x1c'))[_0xbbad('0x1d')](socket);function respondWithStatusCode(_0x465553,_0x3f6ed3){_0x3f6ed3=_0x3f6ed3||0xcc;return function(_0x398dbd){if(_0x398dbd){return _0x465553[_0xbbad('0x1e')](_0x3f6ed3);}return _0x465553[_0xbbad('0x1f')](_0x3f6ed3)['end']();};}function respondWithResult(_0x10586d,_0x313f3f){_0x313f3f=_0x313f3f||0xc8;return function(_0x4d17f8){if(_0x4d17f8){return _0x10586d[_0xbbad('0x1f')](_0x313f3f)[_0xbbad('0x20')](_0x4d17f8);}};}function respondWithFilteredResult(_0x593e39,_0x5ecab9){return function(_0x191cfd){if(_0x191cfd){var _0x215379=_0x191cfd[_0xbbad('0x21')],_0xe1da94=_0x5ecab9['offset'],_0x442f03=_0x5ecab9[_0xbbad('0x22')]+_0x5ecab9['limit'],_0x517849;if(_0x442f03>=_0x215379){_0x442f03=_0x215379;_0x517849=0xc8;}else{_0x517849=0xce;}_0x593e39[_0xbbad('0x1f')](_0x517849);return _0x593e39['set']('Content-Range',_0xe1da94+'-'+_0x442f03+'/'+_0x215379)[_0xbbad('0x20')](_0x191cfd);}return null;};}function patchUpdates(_0x40b1cc){return function(_0x127d5e){try{jsonpatch[_0xbbad('0x23')](_0x127d5e,_0x40b1cc,!![]);}catch(_0x346507){return BPromise[_0xbbad('0x24')](_0x346507);}return _0x127d5e[_0xbbad('0x25')]();};}function saveUpdates(_0x42030e,_0x17d8aa){return function(_0x249aef){if(_0x249aef){return _0x249aef[_0xbbad('0x26')](_0x42030e)[_0xbbad('0x27')](function(_0x86b690){return _0x86b690;});}return null;};}function removeEntity(_0x538aaf,_0x375d5b){return function(_0xe1e00b){if(_0xe1e00b){return _0xe1e00b[_0xbbad('0x28')]()[_0xbbad('0x27')](function(){var _0x3c18fa=_0xe1e00b[_0xbbad('0x29')]({'plain':!![]});var _0x4ebfea=_0xbbad('0x2a');return db[_0xbbad('0x2b')][_0xbbad('0x28')]({'where':{'type':_0x4ebfea,'resourceId':_0x3c18fa['id']}})[_0xbbad('0x27')](function(){return _0xe1e00b;});})[_0xbbad('0x27')](function(){_0x538aaf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d301f,_0x5661fe){return function(_0x5c0c07){if(!_0x5c0c07){_0x1d301f['sendStatus'](0x194);}return _0x5c0c07;};}function handleError(_0x2ace9e,_0x3d9dbc){_0x3d9dbc=_0x3d9dbc||0x1f4;return function(_0xe1bef1){logger['error'](_0xe1bef1[_0xbbad('0x2c')]);if(_0xe1bef1['name']){delete _0xe1bef1[_0xbbad('0x2d')];}_0x2ace9e[_0xbbad('0x1f')](_0x3d9dbc)[_0xbbad('0x2e')](_0xe1bef1);};}exports[_0xbbad('0x2f')]=function(_0x3f4cdd,_0x17cc5e){var _0x30e0b0={},_0x3b13cc={},_0x24e836={'count':0x0,'rows':[]};var _0x4ce049=_[_0xbbad('0x30')](db['SquareProject'][_0xbbad('0x31')],function(_0x2af8d6){return{'name':_0x2af8d6[_0xbbad('0x32')],'type':_0x2af8d6[_0xbbad('0x33')][_0xbbad('0x34')]};});_0x3b13cc[_0xbbad('0x35')]=_[_0xbbad('0x30')](_0x4ce049,_0xbbad('0x2d'));_0x3b13cc['query']=_[_0xbbad('0x36')](_0x3f4cdd[_0xbbad('0x37')]);_0x3b13cc['filters']=_['intersection'](_0x3b13cc[_0xbbad('0x35')],_0x3b13cc['query']);_0x30e0b0[_0xbbad('0x38')]=_['intersection'](_0x3b13cc[_0xbbad('0x35')],qs[_0xbbad('0x39')](_0x3f4cdd[_0xbbad('0x37')][_0xbbad('0x39')]));_0x30e0b0['attributes']=_0x30e0b0[_0xbbad('0x38')][_0xbbad('0x3a')]?_0x30e0b0['attributes']:_0x3b13cc[_0xbbad('0x35')];if(!_0x3f4cdd[_0xbbad('0x37')]['hasOwnProperty'](_0xbbad('0x3b'))){_0x30e0b0['limit']=qs[_0xbbad('0x3c')](_0x3f4cdd[_0xbbad('0x37')][_0xbbad('0x3c')]);_0x30e0b0[_0xbbad('0x22')]=qs[_0xbbad('0x22')](_0x3f4cdd[_0xbbad('0x37')][_0xbbad('0x22')]);}_0x30e0b0[_0xbbad('0x3d')]=qs[_0xbbad('0x3e')](_0x3f4cdd[_0xbbad('0x37')]['sort']);_0x30e0b0['where']=qs['filters'](_['pick'](_0x3f4cdd[_0xbbad('0x37')],_0x3b13cc[_0xbbad('0x3f')]),_0x4ce049);if(_0x3f4cdd['query'][_0xbbad('0x40')]){_0x30e0b0['where']=_['merge'](_0x30e0b0[_0xbbad('0x41')],{'$or':_[_0xbbad('0x30')](_0x4ce049,function(_0x5bb5f3){if(_0x5bb5f3[_0xbbad('0x33')]!==_0xbbad('0x42')){var _0x46159a={};_0x46159a[_0x5bb5f3[_0xbbad('0x2d')]]={'$like':'%'+_0x3f4cdd['query'][_0xbbad('0x40')]+'%'};return _0x46159a;}})});}_0x30e0b0=_['merge']({},_0x30e0b0,_0x3f4cdd[_0xbbad('0x43')]);var _0x1ffdd5={'where':_0x30e0b0[_0xbbad('0x41')]};return db[_0xbbad('0x44')]['count'](_0x1ffdd5)['then'](function(_0x26bdb9){_0x24e836['count']=_0x26bdb9;if(_0x3f4cdd[_0xbbad('0x37')][_0xbbad('0x45')]){_0x30e0b0[_0xbbad('0x46')]=[{'all':!![]}];}return db[_0xbbad('0x44')]['findAll'](_0x30e0b0);})[_0xbbad('0x27')](function(_0x147a5e){_0x24e836[_0xbbad('0x47')]=_0x147a5e;return _0x24e836;})['then'](respondWithFilteredResult(_0x17cc5e,_0x30e0b0))[_0xbbad('0x48')](handleError(_0x17cc5e,null));};exports[_0xbbad('0x49')]=function(_0x4b2de8,_0x34371b){var _0x65b4d8={'raw':![],'where':{'id':_0x4b2de8[_0xbbad('0x4a')]['id']}},_0x53ad65={};_0x53ad65[_0xbbad('0x35')]=_[_0xbbad('0x36')](db[_0xbbad('0x44')][_0xbbad('0x31')]);_0x53ad65[_0xbbad('0x37')]=_[_0xbbad('0x36')](_0x4b2de8[_0xbbad('0x37')]);_0x53ad65[_0xbbad('0x3f')]=_['intersection'](_0x53ad65[_0xbbad('0x35')],_0x53ad65[_0xbbad('0x37')]);_0x65b4d8[_0xbbad('0x38')]=_[_0xbbad('0x4b')](_0x53ad65[_0xbbad('0x35')],qs['fields'](_0x4b2de8[_0xbbad('0x37')][_0xbbad('0x39')]));_0x65b4d8[_0xbbad('0x38')]=_0x65b4d8['attributes']['length']?_0x65b4d8[_0xbbad('0x38')]:_0x53ad65[_0xbbad('0x35')];if(_0x4b2de8[_0xbbad('0x37')][_0xbbad('0x45')]){_0x65b4d8[_0xbbad('0x46')]=[{'all':!![]}];}_0x65b4d8=_[_0xbbad('0x4c')]({},_0x65b4d8,_0x4b2de8[_0xbbad('0x43')]);return db['SquareProject'][_0xbbad('0x4d')](_0x65b4d8)[_0xbbad('0x27')](handleEntityNotFound(_0x34371b,null))[_0xbbad('0x27')](respondWithResult(_0x34371b,null))[_0xbbad('0x48')](handleError(_0x34371b,null));};exports['create']=function(_0x253b0d,_0x21f249){return db[_0xbbad('0x44')]['create'](_0x253b0d[_0xbbad('0x4e')],{})['then'](function(_0x193a04){var _0x59632a=_0x253b0d[_0xbbad('0x4f')][_0xbbad('0x29')]({'plain':!![]});if(!_0x59632a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59632a[_0xbbad('0x50')]===_0xbbad('0x4f')){var _0x2a0f04=_0x193a04[_0xbbad('0x29')]({'plain':!![]});var _0x17350f=_0xbbad('0x2a');return db[_0xbbad('0x51')][_0xbbad('0x4d')]({'where':{'name':_0x17350f,'userProfileId':_0x59632a[_0xbbad('0x52')]},'raw':!![]})[_0xbbad('0x27')](function(_0x54d68b){if(_0x54d68b&&_0x54d68b['autoAssociation']===0x0){return db['UserProfileResource'][_0xbbad('0x53')]({'name':_0x2a0f04[_0xbbad('0x2d')],'resourceId':_0x2a0f04['id'],'type':_0x54d68b[_0xbbad('0x2d')],'sectionId':_0x54d68b['id']},{})['then'](function(){return _0x193a04;});}else{return _0x193a04;}})[_0xbbad('0x48')](function(_0x21c0ca){logger['error'](_0xbbad('0x54'),_0x21c0ca);throw _0x21c0ca;});}return _0x193a04;})[_0xbbad('0x27')](respondWithResult(_0x21f249,0xc9))[_0xbbad('0x48')](handleError(_0x21f249,null));};exports[_0xbbad('0x26')]=function(_0x40dd8e,_0x3cddf9){if(_0x40dd8e[_0xbbad('0x4e')]['id']){delete _0x40dd8e[_0xbbad('0x4e')]['id'];}return db['SquareProject'][_0xbbad('0x4d')]({'where':{'id':_0x40dd8e['params']['id']}})[_0xbbad('0x27')](handleEntityNotFound(_0x3cddf9,null))[_0xbbad('0x27')](saveUpdates(_0x40dd8e['body'],null))[_0xbbad('0x27')](respondWithResult(_0x3cddf9,null))[_0xbbad('0x48')](handleError(_0x3cddf9,null));};exports[_0xbbad('0x28')]=function(_0xa4ca66,_0x22bdf8){return db['SquareProject'][_0xbbad('0x4d')]({'where':{'id':_0xa4ca66['params']['id']}})['then'](handleEntityNotFound(_0x22bdf8,null))['then'](removeEntity(_0x22bdf8,null))[_0xbbad('0x48')](handleError(_0x22bdf8,null));};exports[_0xbbad('0x55')]=function(_0x12f017,_0x26db92,_0x569090){return db[_0xbbad('0x44')]['find']({'where':{'id':_0x12f017['params']['id']}})[_0xbbad('0x27')](handleEntityNotFound(_0x26db92,null))[_0xbbad('0x27')](function(_0x49b179){if(_0x49b179){return _0x49b179['addUsers'](_0x12f017[_0xbbad('0x4e')][_0xbbad('0x56')],_['omit'](_0x12f017[_0xbbad('0x4e')],[_0xbbad('0x56'),'id'])||{});}})['then'](respondWithResult(_0x26db92,null))[_0xbbad('0x48')](handleError(_0x26db92,null));};exports[_0xbbad('0x57')]=function(_0x5d93fd,_0x1e8d18,_0x4da10e){return db[_0xbbad('0x44')][_0xbbad('0x4d')]({'where':{'id':_0x5d93fd[_0xbbad('0x4a')]['id']}})[_0xbbad('0x27')](handleEntityNotFound(_0x1e8d18,null))[_0xbbad('0x27')](function(_0x2d5463){if(_0x2d5463){return _0x2d5463['removeUsers'](_0x5d93fd['query'][_0xbbad('0x56')])[_0xbbad('0x27')](function(){if(_['isArray'](_0x5d93fd[_0xbbad('0x37')]['ids'])){for(var _0x34000b=0x0;_0x34000b<_0x5d93fd[_0xbbad('0x37')][_0xbbad('0x56')][_0xbbad('0x3a')];_0x34000b+=0x1){socket[_0xbbad('0x58')](_0xbbad('0x59'),{'UserId':Number(_0x5d93fd['query']['ids'][_0x34000b]),'SquareProjectId':Number(_0x5d93fd[_0xbbad('0x4a')]['id'])});}}else{socket['emit'](_0xbbad('0x59'),{'UserId':Number(_0x5d93fd[_0xbbad('0x37')][_0xbbad('0x56')]),'SquareProjectId':Number(_0x5d93fd[_0xbbad('0x4a')]['id'])});}});}})[_0xbbad('0x27')](respondWithStatusCode(_0x1e8d18,null))[_0xbbad('0x48')](handleError(_0x1e8d18,null));};exports[_0xbbad('0x5a')]=function(_0x3db2db,_0x499a3f,_0xe0d03c){var _0x26505a={};var _0x35a0cb={};var _0x1190e0;var _0x4f7f82;return db[_0xbbad('0x44')]['findOne']({'where':{'id':_0x3db2db[_0xbbad('0x4a')]['id']}})[_0xbbad('0x27')](handleEntityNotFound(_0x499a3f,null))[_0xbbad('0x27')](function(_0x1458aa){if(_0x1458aa){_0x1190e0=_0x1458aa;_0x35a0cb['model']=_[_0xbbad('0x36')](db[_0xbbad('0x5b')][_0xbbad('0x31')]);_0x35a0cb['query']=_['keys'](_0x3db2db[_0xbbad('0x37')]);_0x35a0cb[_0xbbad('0x3f')]=_['intersection'](_0x35a0cb[_0xbbad('0x35')],_0x35a0cb['query']);_0x26505a[_0xbbad('0x38')]=_[_0xbbad('0x4b')](_0x35a0cb['model'],qs[_0xbbad('0x39')](_0x3db2db[_0xbbad('0x37')][_0xbbad('0x39')]));_0x26505a['attributes']=_0x26505a[_0xbbad('0x38')][_0xbbad('0x3a')]?_0x26505a['attributes']:_0x35a0cb[_0xbbad('0x35')];_0x26505a[_0xbbad('0x3d')]=qs[_0xbbad('0x3e')](_0x3db2db[_0xbbad('0x37')][_0xbbad('0x3e')]);_0x26505a['where']=qs[_0xbbad('0x3f')](_[_0xbbad('0x5c')](_0x3db2db[_0xbbad('0x37')],_0x35a0cb[_0xbbad('0x3f')]));if(_0x3db2db['query'][_0xbbad('0x40')]){_0x26505a[_0xbbad('0x41')]=_[_0xbbad('0x4c')](_0x26505a['where'],{'$or':_[_0xbbad('0x30')](_0x26505a['attributes'],function(_0x3f6cf0){var _0x2724d2={};_0x2724d2[_0x3f6cf0]={'$like':'%'+_0x3db2db[_0xbbad('0x37')][_0xbbad('0x40')]+'%'};return _0x2724d2;})});}_0x26505a=_[_0xbbad('0x4c')]({},_0x26505a,_0x3db2db[_0xbbad('0x43')]);return _0x1190e0[_0xbbad('0x5a')](_0x26505a);}})[_0xbbad('0x27')](function(_0x27e416){if(_0x27e416){_0x4f7f82=_0x27e416[_0xbbad('0x3a')];if(!_0x3db2db['query'][_0xbbad('0x5d')](_0xbbad('0x3b'))){_0x26505a[_0xbbad('0x3c')]=qs[_0xbbad('0x3c')](_0x3db2db['query'][_0xbbad('0x3c')]);_0x26505a[_0xbbad('0x22')]=qs[_0xbbad('0x22')](_0x3db2db[_0xbbad('0x37')][_0xbbad('0x22')]);}return _0x1190e0['getUsers'](_0x26505a);}})[_0xbbad('0x27')](function(_0x46a75e){if(_0x46a75e){return _0x46a75e?{'count':_0x4f7f82,'rows':_0x46a75e}:null;}})[_0xbbad('0x27')](respondWithResult(_0x499a3f,null))['catch'](handleError(_0x499a3f,null));};
\ No newline at end of file
index c6ad4a4..e57feca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e8e=['hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x35603b,_0x3217fe){var _0x3d9309=function(_0x54ce96){while(--_0x54ce96){_0x35603b['push'](_0x35603b['shift']());}};_0x3d9309(++_0x3217fe);}(_0x3e8e,0x106));var _0xe3e8=function(_0x2d2487,_0x2704fd){_0x2d2487=_0x2d2487-0x0;var _0x345a8f=_0x3e8e[_0x2d2487];return _0x345a8f;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xe3e8('0x0'))['db'][_0xe3e8('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe3e8('0x2')](0x0);var events={'afterCreate':_0xe3e8('0x3'),'afterUpdate':_0xe3e8('0x4'),'afterDestroy':_0xe3e8('0x5')};function emitEvent(_0x3c14fe){return function(_0x53e635,_0x57b791,_0xe4e984){SquareProjectEvents[_0xe3e8('0x6')](_0x3c14fe+':'+_0x53e635['id'],_0x53e635);SquareProjectEvents[_0xe3e8('0x6')](_0x3c14fe,_0x53e635);_0xe4e984(null);};}for(var e in events){if(events[_0xe3e8('0x7')](e)){var event=events[e];SquareProject[_0xe3e8('0x8')](e,emitEvent(event));}}module[_0xe3e8('0x9')]=SquareProjectEvents;
\ No newline at end of file
+var _0x363b=['emit','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x363b,0x17c));var _0xb363=function(_0x265596,_0x23947a){_0x265596=_0x265596-0x0;var _0x3f8d6b=_0x363b[_0x265596];return _0x3f8d6b;};'use strict';var EventEmitter=require(_0xb363('0x0'));var SquareProject=require(_0xb363('0x1'))['db'][_0xb363('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb363('0x3')](0x0);var events={'afterCreate':_0xb363('0x4'),'afterUpdate':_0xb363('0x5'),'afterDestroy':_0xb363('0x6')};function emitEvent(_0x356393){return function(_0x18d5fb,_0x1e9bca,_0x49e77c){SquareProjectEvents[_0xb363('0x7')](_0x356393+':'+_0x18d5fb['id'],_0x18d5fb);SquareProjectEvents[_0xb363('0x7')](_0x356393,_0x18d5fb);_0x49e77c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xb363('0x8')]=SquareProjectEvents;
\ No newline at end of file
index 0ce0f48..15bcc3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ccb=['exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0x6ccb,0xb5));var _0xb6cc=function(_0x1ed0a4,_0x5c80f5){_0x1ed0a4=_0x1ed0a4-0x0;var _0x427b2e=_0x6ccb[_0x1ed0a4];return _0x427b2e;};'use strict';var _=require(_0xb6cc('0x0'));var util=require(_0xb6cc('0x1'));var logger=require(_0xb6cc('0x2'))(_0xb6cc('0x3'));var moment=require(_0xb6cc('0x4'));var BPromise=require(_0xb6cc('0x5'));var rp=require(_0xb6cc('0x6'));var fs=require('fs');var path=require(_0xb6cc('0x7'));var rimraf=require(_0xb6cc('0x8'));var config=require(_0xb6cc('0x9'));var attributes=require(_0xb6cc('0xa'));module[_0xb6cc('0xb')]=function(_0x4daf44,_0x4f9963){return _0x4daf44['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x378f=['square_projects','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x378f,0xd9));var _0xf378=function(_0x9e6711,_0x1a86f2){_0x9e6711=_0x9e6711-0x0;var _0x29e620=_0x378f[_0x9e6711];return _0x29e620;};'use strict';var _=require(_0xf378('0x0'));var util=require('util');var logger=require(_0xf378('0x1'))(_0xf378('0x2'));var moment=require(_0xf378('0x3'));var BPromise=require(_0xf378('0x4'));var rp=require(_0xf378('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf378('0x6'));var attributes=require(_0xf378('0x7'));module[_0xf378('0x8')]=function(_0x14d50d,_0x59a70d){return _0x14d50d[_0xf378('0x9')](_0xf378('0xa'),attributes,{'tableName':_0xf378('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bcb770d..9aa4ef2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46a1=['options','where','attributes','include','map','model','then','debug','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ShowSquareProject','SquareProject'];(function(_0x7dd102,_0x4f2739){var _0x2c1036=function(_0x40acc7){while(--_0x40acc7){_0x7dd102['push'](_0x7dd102['shift']());}};_0x2c1036(++_0x4f2739);}(_0x46a1,0x15f));var _0x146a=function(_0x247cc5,_0x2d972b){_0x247cc5=_0x247cc5-0x0;var _0x8ce986=_0x46a1[_0x247cc5];return _0x8ce986;};'use strict';var _=require(_0x146a('0x0'));var util=require(_0x146a('0x1'));var moment=require(_0x146a('0x2'));var BPromise=require(_0x146a('0x3'));var rs=require(_0x146a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x146a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x146a('0x6'))(_0x146a('0x7'));var config=require(_0x146a('0x8'));var jayson=require(_0x146a('0x9'));var client=jayson[_0x146a('0xa')][_0x146a('0xb')]({'port':0x232a});config[_0x146a('0xc')]=_[_0x146a('0xd')](config['redis'],{'host':_0x146a('0xe'),'port':0x18eb});var socket=require(_0x146a('0xf'))(new Redis(config[_0x146a('0xc')]));require(_0x146a('0x10'))[_0x146a('0x11')](socket);function respondWithRpcPromise(_0x3ddd27,_0x31fc05,_0xcc8029){return new BPromise(function(_0xb34598,_0x2373d8){return client['request'](_0x3ddd27,_0xcc8029)['then'](function(_0x3839ee){logger['info'](_0x146a('0x12'),_0x31fc05,_0x146a('0x13'));logger['debug'](_0x146a('0x14'),_0x31fc05,'request\x20sent',JSON[_0x146a('0x15')](_0x3839ee));if(_0x3839ee[_0x146a('0x16')]){if(_0x3839ee[_0x146a('0x16')][_0x146a('0x17')]===0x1f4){logger[_0x146a('0x16')](_0x146a('0x12'),_0x31fc05,_0x3839ee['error']['message']);return _0x2373d8(_0x3839ee[_0x146a('0x16')]['message']);}logger[_0x146a('0x16')](_0x146a('0x12'),_0x31fc05,_0x3839ee[_0x146a('0x16')][_0x146a('0x18')]);return _0xb34598(_0x3839ee[_0x146a('0x16')][_0x146a('0x18')]);}else{logger[_0x146a('0x19')](_0x146a('0x12'),_0x31fc05,_0x146a('0x13'));_0xb34598(_0x3839ee[_0x146a('0x1a')]['message']);}})['catch'](function(_0x47e171){logger[_0x146a('0x16')](_0x146a('0x12'),_0x31fc05,_0x47e171);_0x2373d8(_0x47e171);});});}exports[_0x146a('0x1b')]=function(_0x374355){var _0x54530d=this;return new Promise(function(_0x28735f,_0x25fba4){return db[_0x146a('0x1c')]['find']({'raw':_0x374355['options']?_0x374355[_0x146a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x374355[_0x146a('0x1d')]?_0x374355[_0x146a('0x1d')][_0x146a('0x1e')]||null:null,'attributes':_0x374355[_0x146a('0x1d')]?_0x374355[_0x146a('0x1d')][_0x146a('0x1f')]||null:null,'include':_0x374355[_0x146a('0x1d')]?_0x374355[_0x146a('0x1d')][_0x146a('0x20')]?_[_0x146a('0x21')](_0x374355[_0x146a('0x1d')]['include'],function(_0x1ee3f4){return{'model':db[_0x1ee3f4['model']],'as':_0x1ee3f4['as'],'attributes':_0x1ee3f4['attributes'],'include':_0x1ee3f4['include']?_[_0x146a('0x21')](_0x1ee3f4['include'],function(_0x4fbce3){return{'model':db[_0x4fbce3['model']],'as':_0x4fbce3['as'],'attributes':_0x4fbce3[_0x146a('0x1f')],'include':_0x4fbce3[_0x146a('0x20')]?_[_0x146a('0x21')](_0x4fbce3[_0x146a('0x20')],function(_0x3862a9){return{'model':db[_0x3862a9[_0x146a('0x22')]],'as':_0x3862a9['as'],'attributes':_0x3862a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x146a('0x23')](function(_0x19ec38){logger[_0x146a('0x19')]('ShowSquareProject',_0x374355);logger[_0x146a('0x24')](_0x146a('0x1b'),_0x374355,JSON[_0x146a('0x15')](_0x19ec38));_0x28735f(_0x19ec38);})[_0x146a('0x25')](function(_0x1e04ff){logger[_0x146a('0x16')](_0x146a('0x1b'),_0x1e04ff['message'],_0x374355);_0x25fba4(_0x54530d[_0x146a('0x16')](0x1f4,_0x1e04ff['message']));});});};
\ No newline at end of file
+var _0x78e8=['ShowSquareProject','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','find','options','raw','where','include','map','model','attributes'];(function(_0x3d9565,_0x5db973){var _0x546f66=function(_0x137352){while(--_0x137352){_0x3d9565['push'](_0x3d9565['shift']());}};_0x546f66(++_0x5db973);}(_0x78e8,0xef));var _0x878e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x78e8[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x878e('0x0'));var moment=require(_0x878e('0x1'));var BPromise=require(_0x878e('0x2'));var rs=require(_0x878e('0x3'));var fs=require('fs');var Redis=require(_0x878e('0x4'));var db=require(_0x878e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x878e('0x6'));var config=require(_0x878e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x878e('0x8')]({'port':0x232a});config['redis']=_[_0x878e('0x9')](config[_0x878e('0xa')],{'host':_0x878e('0xb'),'port':0x18eb});var socket=require(_0x878e('0xc'))(new Redis(config['redis']));require(_0x878e('0xd'))['register'](socket);function respondWithRpcPromise(_0x4eca77,_0xfbb629,_0x9371de){return new BPromise(function(_0x8c579,_0x37b5f9){return client[_0x878e('0xe')](_0x4eca77,_0x9371de)[_0x878e('0xf')](function(_0x14d821){logger[_0x878e('0x10')](_0x878e('0x11'),_0xfbb629,'request\x20sent');logger[_0x878e('0x12')](_0x878e('0x13'),_0xfbb629,_0x878e('0x14'),JSON['stringify'](_0x14d821));if(_0x14d821[_0x878e('0x15')]){if(_0x14d821[_0x878e('0x15')][_0x878e('0x16')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0xfbb629,_0x14d821[_0x878e('0x15')][_0x878e('0x17')]);return _0x37b5f9(_0x14d821[_0x878e('0x15')][_0x878e('0x17')]);}logger[_0x878e('0x15')](_0x878e('0x11'),_0xfbb629,_0x14d821[_0x878e('0x15')][_0x878e('0x17')]);return _0x8c579(_0x14d821[_0x878e('0x15')][_0x878e('0x17')]);}else{logger[_0x878e('0x10')](_0x878e('0x11'),_0xfbb629,_0x878e('0x14'));_0x8c579(_0x14d821['result']['message']);}})[_0x878e('0x18')](function(_0x10aba0){logger[_0x878e('0x15')](_0x878e('0x11'),_0xfbb629,_0x10aba0);_0x37b5f9(_0x10aba0);});});}exports['ShowSquareProject']=function(_0x563b45){var _0x2cc5f3=this;return new Promise(function(_0x4ac10,_0x32568e){return db['SquareProject'][_0x878e('0x19')]({'raw':_0x563b45[_0x878e('0x1a')]?_0x563b45[_0x878e('0x1a')][_0x878e('0x1b')]===undefined?!![]:![]:!![],'where':_0x563b45[_0x878e('0x1a')]?_0x563b45['options'][_0x878e('0x1c')]||null:null,'attributes':_0x563b45[_0x878e('0x1a')]?_0x563b45[_0x878e('0x1a')]['attributes']||null:null,'include':_0x563b45['options']?_0x563b45[_0x878e('0x1a')][_0x878e('0x1d')]?_[_0x878e('0x1e')](_0x563b45[_0x878e('0x1a')][_0x878e('0x1d')],function(_0x1660b2){return{'model':db[_0x1660b2[_0x878e('0x1f')]],'as':_0x1660b2['as'],'attributes':_0x1660b2['attributes'],'include':_0x1660b2[_0x878e('0x1d')]?_[_0x878e('0x1e')](_0x1660b2[_0x878e('0x1d')],function(_0x217ce5){return{'model':db[_0x217ce5[_0x878e('0x1f')]],'as':_0x217ce5['as'],'attributes':_0x217ce5[_0x878e('0x20')],'include':_0x217ce5[_0x878e('0x1d')]?_[_0x878e('0x1e')](_0x217ce5[_0x878e('0x1d')],function(_0x471959){return{'model':db[_0x471959[_0x878e('0x1f')]],'as':_0x471959['as'],'attributes':_0x471959[_0x878e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x878e('0xf')](function(_0x6b9d62){logger[_0x878e('0x10')](_0x878e('0x21'),_0x563b45);logger[_0x878e('0x12')](_0x878e('0x21'),_0x563b45,JSON['stringify'](_0x6b9d62));_0x4ac10(_0x6b9d62);})['catch'](function(_0x48527b){logger[_0x878e('0x15')]('ShowSquareProject',_0x48527b[_0x878e('0x17')],_0x563b45);_0x32568e(_0x2cc5f3['error'](0x1f4,_0x48527b['message']));});});};
\ No newline at end of file
index 373e71b..fd06f3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fb=['./squareProject.events','save','remove','update','emit','removeListener','register','length','squareProject:'];(function(_0x5d0813,_0x57cc54){var _0x2db6da=function(_0x2eff89){while(--_0x2eff89){_0x5d0813['push'](_0x5d0813['shift']());}};_0x2db6da(++_0x57cc54);}(_0xd8fb,0x99));var _0xbd8f=function(_0x33b221,_0x5f3de5){_0x33b221=_0x33b221-0x0;var _0x1f2613=_0xd8fb[_0x33b221];return _0x1f2613;};'use strict';var SquareProjectEvents=require(_0xbd8f('0x0'));var events=[_0xbd8f('0x1'),_0xbd8f('0x2'),_0xbd8f('0x3')];function createListener(_0x52724c,_0x5ea933){return function(_0x4e9545){_0x5ea933[_0xbd8f('0x4')](_0x52724c,_0x4e9545);};}function removeListener(_0x43d177,_0x53cccc){return function(){SquareProjectEvents[_0xbd8f('0x5')](_0x43d177,_0x53cccc);};}exports[_0xbd8f('0x6')]=function(_0x5543b2){for(var _0x33d541=0x0,_0x4e97cf=events[_0xbd8f('0x7')];_0x33d541<_0x4e97cf;_0x33d541++){var _0x578499=events[_0x33d541];var _0x197827=createListener(_0xbd8f('0x8')+_0x578499,_0x5543b2);SquareProjectEvents['on'](_0x578499,_0x197827);}};
\ No newline at end of file
+var _0x3f8a=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register','length'];(function(_0x7026aa,_0x174e96){var _0x35a685=function(_0xf607ef){while(--_0xf607ef){_0x7026aa['push'](_0x7026aa['shift']());}};_0x35a685(++_0x174e96);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x412774,_0x3b6fde){_0x412774=_0x412774-0x0;var _0x2cf781=_0x3f8a[_0x412774];return _0x2cf781;};'use strict';var SquareProjectEvents=require(_0xa3f8('0x0'));var events=[_0xa3f8('0x1'),_0xa3f8('0x2'),_0xa3f8('0x3')];function createListener(_0x512b4c,_0x467a6c){return function(_0x143375){_0x467a6c[_0xa3f8('0x4')](_0x512b4c,_0x143375);};}function removeListener(_0x15b6aa,_0x2553fd){return function(){SquareProjectEvents[_0xa3f8('0x5')](_0x15b6aa,_0x2553fd);};}exports[_0xa3f8('0x6')]=function(_0x471464){for(var _0x1f160a=0x0,_0xf895d9=events[_0xa3f8('0x7')];_0x1f160a<_0xf895d9;_0x1f160a++){var _0x268332=events[_0x1f160a];var _0x2faf2e=createListener(_0xa3f8('0x8')+_0x268332,_0x471464);SquareProjectEvents['on'](_0x268332,_0x2faf2e);}};
\ No newline at end of file
index cb6aa50..dd17477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfbb=['create','put','/:id/delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcfbb,0x137));var _0xbcfb=function(_0xdbac11,_0x4aff44){_0xdbac11=_0xdbac11-0x0;var _0x5a262a=_0xcfbb[_0xdbac11];return _0x5a262a;};'use strict';var multer=require(_0xbcfb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbcfb('0x1'));var express=require(_0xbcfb('0x2'));var router=express[_0xbcfb('0x3')]();var auth=require(_0xbcfb('0x4'));var interaction=require(_0xbcfb('0x5'));var config=require(_0xbcfb('0x6'));var controller=require('./squareRecording.controller');router[_0xbcfb('0x7')]('/',auth['isAuthenticated'](),controller[_0xbcfb('0x8')]);router['get'](_0xbcfb('0x9'),auth['isAuthenticated'](),controller[_0xbcfb('0xa')]);router[_0xbcfb('0x7')]('/:id/download',auth[_0xbcfb('0xb')](),controller['download']);router[_0xbcfb('0xc')]('/',auth[_0xbcfb('0xb')](),controller[_0xbcfb('0xd')]);router[_0xbcfb('0xe')](_0xbcfb('0x9'),auth[_0xbcfb('0xb')](),controller['update']);router['delete'](_0xbcfb('0xf'),auth[_0xbcfb('0xb')](),controller[_0xbcfb('0x10')]);module[_0xbcfb('0x11')]=router;
\ No newline at end of file
+var _0xdc04=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/download','download','put','update','delete','/:id/delete','destroy','exports','multer','util'];(function(_0x378a56,_0x31885a){var _0x149db0=function(_0x33eb59){while(--_0x33eb59){_0x378a56['push'](_0x378a56['shift']());}};_0x149db0(++_0x31885a);}(_0xdc04,0x108));var _0x4dc0=function(_0x57a41b,_0x280ae0){_0x57a41b=_0x57a41b-0x0;var _0x21b55f=_0xdc04[_0x57a41b];return _0x21b55f;};'use strict';var multer=require(_0x4dc0('0x0'));var util=require(_0x4dc0('0x1'));var path=require('path');var timeout=require(_0x4dc0('0x2'));var express=require(_0x4dc0('0x3'));var router=express['Router']();var auth=require(_0x4dc0('0x4'));var interaction=require(_0x4dc0('0x5'));var config=require('../../config/environment');var controller=require('./squareRecording.controller');router[_0x4dc0('0x6')]('/',auth['isAuthenticated'](),controller[_0x4dc0('0x7')]);router['get'](_0x4dc0('0x8'),auth[_0x4dc0('0x9')](),controller[_0x4dc0('0xa')]);router[_0x4dc0('0x6')](_0x4dc0('0xb'),auth['isAuthenticated'](),controller[_0x4dc0('0xc')]);router['post']('/',auth[_0x4dc0('0x9')](),controller['create']);router[_0x4dc0('0xd')](_0x4dc0('0x8'),auth[_0x4dc0('0x9')](),controller[_0x4dc0('0xe')]);router[_0x4dc0('0xf')](_0x4dc0('0x10'),auth['isAuthenticated'](),controller[_0x4dc0('0x11')]);module[_0x4dc0('0x12')]=router;
\ No newline at end of file
index 4886e62..5e74d2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe34d=['STRING','VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports'];(function(_0x528904,_0x45d397){var _0x1ec058=function(_0x1b363c){while(--_0x1b363c){_0x528904['push'](_0x528904['shift']());}};_0x1ec058(++_0x45d397);}(_0xe34d,0xd0));var _0xde34=function(_0x2a1b2e,_0x2e5fd0){_0x2a1b2e=_0x2a1b2e-0x0;var _0x4a463a=_0xe34d[_0x2a1b2e];return _0x4a463a;};'use strict';var Sequelize=require(_0xde34('0x0'));module[_0xde34('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xde34('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xde34('0x2')]},'extension':{'type':Sequelize[_0xde34('0x2')]},'priority':{'type':Sequelize[_0xde34('0x2')]},'accountcode':{'type':Sequelize[_0xde34('0x2')]},'dnid':{'type':Sequelize[_0xde34('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xde34('0x2')]},'format':{'type':Sequelize[_0xde34('0x3')],'get':function(){var _0x2b091d='';var _0x3550e5=this[_0xde34('0x4')](_0xde34('0x5'));if(_0x3550e5){_0x2b091d=_0x3550e5['substring'](_0x3550e5[_0xde34('0x6')]('.'));}return _0x2b091d;}}};
\ No newline at end of file
+var _0x079b=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x1ed878,_0x1cd3e7){var _0x236e54=function(_0xc7e43c){while(--_0xc7e43c){_0x1ed878['push'](_0x1ed878['shift']());}};_0x236e54(++_0x1cd3e7);}(_0x079b,0x165));var _0xb079=function(_0x2b70df,_0x224881){_0x2b70df=_0x2b70df-0x0;var _0x44b705=_0x079b[_0x2b70df];return _0x44b705;};'use strict';var Sequelize=require(_0xb079('0x0'));module[_0xb079('0x1')]={'uniqueid':{'type':Sequelize[_0xb079('0x2')]},'callerid':{'type':Sequelize[_0xb079('0x2')]},'calleridname':{'type':Sequelize[_0xb079('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb079('0x2')]},'accountcode':{'type':Sequelize[_0xb079('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xb079('0x2')]},'saveName':{'type':Sequelize[_0xb079('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xb079('0x2')]},'format':{'type':Sequelize[_0xb079('0x3')],'get':function(){var _0xec7d79='';var _0x1ce51d=this[_0xb079('0x4')](_0xb079('0x5'));if(_0x1ce51d){_0xec7d79=_0x1ce51d[_0xb079('0x6')](_0x1ce51d[_0xb079('0x7')]('.'));}return _0xec7d79;}}};
\ No newline at end of file
index 5982876..79d29a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74c8=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SquareRecording','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','catch','create','body','download','../../components/encryptor','uniqueid','find','format','%s.cypher','decryptFile','secrets','recording','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','existsSync','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','rimraf','zip-dir','request-promise','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x2ec650,_0x24b011){var _0xdb00de=function(_0x3244e6){while(--_0x3244e6){_0x2ec650['push'](_0x2ec650['shift']());}};_0xdb00de(++_0x24b011);}(_0x74c8,0x1c9));var _0x874c=function(_0x39304b,_0x30a033){_0x39304b=_0x39304b-0x0;var _0x21160c=_0x74c8[_0x39304b];return _0x21160c;};'use strict';var pdf=require(_0x874c('0x0'));var emlformat=require(_0x874c('0x1'));var rimraf=require(_0x874c('0x2'));var zipdir=require(_0x874c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x874c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x874c('0x5'));var path=require('path');var sox=require(_0x874c('0x6'));var csv=require(_0x874c('0x7'));var ejs=require(_0x874c('0x8'));var fs=require('fs');var _=require(_0x874c('0x9'));var squel=require('squel');var crypto=require(_0x874c('0xa'));var jsforce=require(_0x874c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x874c('0x7'));var querystring=require(_0x874c('0xc'));var Papa=require(_0x874c('0xd'));var Redis=require('ioredis');var authService=require(_0x874c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x874c('0xf'));var hardwareService=require(_0x874c('0x10'));var logger=require('../../config/logger')(_0x874c('0x11'));var utils=require(_0x874c('0x12'));var config=require(_0x874c('0x13'));var db=require(_0x874c('0x14'))['db'];function respondWithStatusCode(_0x3ae875,_0x4b62dd){_0x4b62dd=_0x4b62dd||0xcc;return function(_0x2ffab8){if(_0x2ffab8){return _0x3ae875[_0x874c('0x15')](_0x4b62dd);}return _0x3ae875[_0x874c('0x16')](_0x4b62dd)[_0x874c('0x17')]();};}function respondWithResult(_0x38bb01,_0x4c2b86){_0x4c2b86=_0x4c2b86||0xc8;return function(_0x40ecf6){if(_0x40ecf6){return _0x38bb01['status'](_0x4c2b86)[_0x874c('0x18')](_0x40ecf6);}};}function respondWithFilteredResult(_0xb7af7b,_0x3558d6){return function(_0x4d2d8e){if(_0x4d2d8e){var _0xdf900=_0x4d2d8e[_0x874c('0x19')],_0x36be83=_0x3558d6[_0x874c('0x1a')],_0x9fe8db=_0x3558d6[_0x874c('0x1a')]+_0x3558d6[_0x874c('0x1b')],_0x52d154;if(_0x9fe8db>=_0xdf900){_0x9fe8db=_0xdf900;_0x52d154=0xc8;}else{_0x52d154=0xce;}_0xb7af7b['status'](_0x52d154);return _0xb7af7b[_0x874c('0x1c')](_0x874c('0x1d'),_0x36be83+'-'+_0x9fe8db+'/'+_0xdf900)[_0x874c('0x18')](_0x4d2d8e);}return null;};}function patchUpdates(_0x459ead){return function(_0x1ef2c6){try{jsonpatch[_0x874c('0x1e')](_0x1ef2c6,_0x459ead,!![]);}catch(_0x4952e4){return BPromise[_0x874c('0x1f')](_0x4952e4);}return _0x1ef2c6[_0x874c('0x20')]();};}function saveUpdates(_0x2cbbc0,_0xe8f0db){return function(_0x350716){if(_0x350716){return _0x350716[_0x874c('0x21')](_0x2cbbc0)[_0x874c('0x22')](function(_0x218f05){return _0x218f05;});}return null;};}function removeEntity(_0x26243a,_0x5a55b9){return function(_0xfc578e){if(_0xfc578e){return _0xfc578e[_0x874c('0x23')]()[_0x874c('0x22')](function(){_0x26243a[_0x874c('0x16')](0xcc)[_0x874c('0x17')]();});}};}function handleEntityNotFound(_0x35cc66,_0x3534de){return function(_0x50e232){if(!_0x50e232){_0x35cc66[_0x874c('0x15')](0x194);}return _0x50e232;};}function handleError(_0x5c5b68,_0x5df3cc){_0x5df3cc=_0x5df3cc||0x1f4;return function(_0x29110a){logger[_0x874c('0x24')](_0x29110a['stack']);if(_0x29110a[_0x874c('0x25')]){delete _0x29110a[_0x874c('0x25')];}_0x5c5b68[_0x874c('0x16')](_0x5df3cc)[_0x874c('0x26')](_0x29110a);};}exports[_0x874c('0x27')]=function(_0x50b06a,_0x3c9927){var _0x19c34f={},_0x22e196={},_0x100b19={'count':0x0,'rows':[]};var _0x278a8d=_['map'](db[_0x874c('0x28')][_0x874c('0x29')],function(_0x314f65){return{'name':_0x314f65['fieldName'],'type':_0x314f65[_0x874c('0x2a')][_0x874c('0x2b')]};});_0x22e196[_0x874c('0x2c')]=_[_0x874c('0x2d')](_0x278a8d,_0x874c('0x25'));_0x22e196[_0x874c('0x2e')]=_[_0x874c('0x2f')](_0x50b06a[_0x874c('0x2e')]);_0x22e196[_0x874c('0x30')]=_[_0x874c('0x31')](_0x22e196[_0x874c('0x2c')],_0x22e196[_0x874c('0x2e')]);_0x19c34f[_0x874c('0x32')]=_[_0x874c('0x31')](_0x22e196[_0x874c('0x2c')],qs[_0x874c('0x33')](_0x50b06a[_0x874c('0x2e')]['fields']));_0x19c34f[_0x874c('0x32')]=_0x19c34f['attributes'][_0x874c('0x34')]?_0x19c34f['attributes']:_0x22e196[_0x874c('0x2c')];if(!_0x50b06a[_0x874c('0x2e')][_0x874c('0x35')](_0x874c('0x36'))){_0x19c34f[_0x874c('0x1b')]=qs[_0x874c('0x1b')](_0x50b06a[_0x874c('0x2e')]['limit']);_0x19c34f[_0x874c('0x1a')]=qs[_0x874c('0x1a')](_0x50b06a[_0x874c('0x2e')][_0x874c('0x1a')]);}_0x19c34f[_0x874c('0x37')]=qs[_0x874c('0x38')](_0x50b06a[_0x874c('0x2e')][_0x874c('0x38')]);_0x19c34f['where']=qs['filters'](_['pick'](_0x50b06a[_0x874c('0x2e')],_0x22e196['filters']),_0x278a8d);if(_0x50b06a[_0x874c('0x2e')][_0x874c('0x39')]){_0x19c34f[_0x874c('0x3a')]=_['merge'](_0x19c34f['where'],{'$or':_['map'](_0x278a8d,function(_0x5615dd){if(_0x5615dd[_0x874c('0x2a')]!==_0x874c('0x3b')){var _0x5779a6={};_0x5779a6[_0x5615dd[_0x874c('0x25')]]={'$like':'%'+_0x50b06a['query'][_0x874c('0x39')]+'%'};return _0x5779a6;}})});}_0x19c34f=_[_0x874c('0x3c')]({},_0x19c34f,_0x50b06a[_0x874c('0x3d')]);var _0x21497e={'where':_0x19c34f[_0x874c('0x3a')]};return db[_0x874c('0x28')][_0x874c('0x19')](_0x21497e)[_0x874c('0x22')](function(_0x2df6e7){_0x100b19[_0x874c('0x19')]=_0x2df6e7;if(_0x50b06a['query'][_0x874c('0x3e')]){_0x19c34f[_0x874c('0x3f')]=[{'all':!![]}];}return db[_0x874c('0x28')][_0x874c('0x40')](_0x19c34f);})['then'](function(_0x342a0b){_0x100b19[_0x874c('0x41')]=_0x342a0b;return _0x100b19;})[_0x874c('0x22')](respondWithFilteredResult(_0x3c9927,_0x19c34f))['catch'](handleError(_0x3c9927,null));};exports['show']=function(_0x3bc7dd,_0x1953b6){var _0x38c8ae={'raw':!![],'where':{'id':_0x3bc7dd[_0x874c('0x42')]['id']}},_0x3f004a={};_0x3f004a[_0x874c('0x2c')]=_[_0x874c('0x2f')](db[_0x874c('0x28')]['rawAttributes']);_0x3f004a[_0x874c('0x2e')]=_[_0x874c('0x2f')](_0x3bc7dd[_0x874c('0x2e')]);_0x3f004a[_0x874c('0x30')]=_[_0x874c('0x31')](_0x3f004a[_0x874c('0x2c')],_0x3f004a[_0x874c('0x2e')]);_0x38c8ae[_0x874c('0x32')]=_[_0x874c('0x31')](_0x3f004a[_0x874c('0x2c')],qs[_0x874c('0x33')](_0x3bc7dd['query'][_0x874c('0x33')]));_0x38c8ae[_0x874c('0x32')]=_0x38c8ae[_0x874c('0x32')]['length']?_0x38c8ae[_0x874c('0x32')]:_0x3f004a[_0x874c('0x2c')];if(_0x3bc7dd[_0x874c('0x2e')][_0x874c('0x3e')]){_0x38c8ae[_0x874c('0x3f')]=[{'all':!![]}];}_0x38c8ae=_[_0x874c('0x3c')]({},_0x38c8ae,_0x3bc7dd[_0x874c('0x3d')]);return db[_0x874c('0x28')]['find'](_0x38c8ae)[_0x874c('0x22')](handleEntityNotFound(_0x1953b6,null))[_0x874c('0x22')](respondWithResult(_0x1953b6,null))[_0x874c('0x43')](handleError(_0x1953b6,null));};exports[_0x874c('0x44')]=function(_0x18c417,_0x3d5824){return db[_0x874c('0x28')]['create'](_0x18c417[_0x874c('0x45')],{})[_0x874c('0x22')](respondWithResult(_0x3d5824,0xc9))[_0x874c('0x43')](handleError(_0x3d5824,null));};exports[_0x874c('0x21')]=function(_0x5cf940,_0x30dc62){if(_0x5cf940[_0x874c('0x45')]['id']){delete _0x5cf940[_0x874c('0x45')]['id'];}return db[_0x874c('0x28')]['find']({'where':{'id':_0x5cf940[_0x874c('0x42')]['id']}})['then'](handleEntityNotFound(_0x30dc62,null))['then'](saveUpdates(_0x5cf940[_0x874c('0x45')],null))['then'](respondWithResult(_0x30dc62,null))[_0x874c('0x43')](handleError(_0x30dc62,null));};exports[_0x874c('0x46')]=function(_0x480c03,_0x5ad097,_0x228698){var _0x18384a=require(_0x874c('0x47'));var _0x310d18=![];var _0x5e87e9={};if(_0x480c03[_0x874c('0x2e')][_0x874c('0x2a')]&&_0x480c03[_0x874c('0x2e')][_0x874c('0x2a')]===_0x874c('0x48')){_0x5e87e9[_0x874c('0x48')]=_0x480c03['params']['id'];}else{_0x5e87e9['id']=_0x480c03[_0x874c('0x42')]['id'];}return db['SquareRecording'][_0x874c('0x49')]({'where':_0x5e87e9,'attributes':['id','savePath','filename'],'raw':!![]})[_0x874c('0x22')](handleEntityNotFound(_0x5ad097,null))[_0x874c('0x22')](function(_0xe9f8c){if(_0xe9f8c){var _0x21be89=_0xe9f8c['savePath'];var _0x7d319=util[_0x874c('0x4a')](_0x874c('0x4b'),_0x21be89);if(fs['existsSync'](_0x7d319)){_0x310d18=!![];return _0x18384a[_0x874c('0x4c')](_0x7d319,_0x21be89,config[_0x874c('0x4d')][_0x874c('0x4e')])[_0x874c('0x22')](function(){return _0xe9f8c;});}return _0xe9f8c;}})[_0x874c('0x22')](function(_0x18cd6f){if(_0x18cd6f){var _0x24a6a7=_0x18cd6f[_0x874c('0x4f')];if(!fs['existsSync'](_0x24a6a7)){throw new db[(_0x874c('0x50'))][(_0x874c('0x51'))](_0x874c('0x52'));}if(_0x18cd6f[_0x874c('0x53')]){return _0x5ad097[_0x874c('0x46')](_0x24a6a7,_0x18cd6f[_0x874c('0x53')]+path[_0x874c('0x54')](_0x24a6a7),function(){if(_0x310d18){fs['unlink'](_0x24a6a7);}});}else{return _0x5ad097[_0x874c('0x46')](_0x24a6a7,function(_0x36d70b){if(_0x310d18){fs[_0x874c('0x55')](_0x24a6a7);}});}}})[_0x874c('0x43')](function(_0x4e40d9){if(_0x4e40d9['message']===_0x874c('0x52')){_0x5ad097[_0x874c('0x16')](0x194)['send']('Not\x20found');}else{return handleError(_0x5ad097,null);}});};exports[_0x874c('0x23')]=function(_0xecf199,_0x318db6){return db[_0x874c('0x28')][_0x874c('0x49')]({'where':{'id':_0xecf199[_0x874c('0x42')]['id']}})[_0x874c('0x22')](function(_0x1e6096){if(!_0x1e6096)throw new ReferenceError(_0x874c('0x56'));return _0x1e6096;})[_0x874c('0x22')](function(_0x10500b){var _0x5f1430=_0x10500b[_0x874c('0x4f')];logger['info'](_0x874c('0x57'),_0x5f1430);if(!_[_0x874c('0x58')](_0x10500b['savePath'])&&fs[_0x874c('0x59')](_0x5f1430)){logger[_0x874c('0x5a')](_0x874c('0x5b')+_0x5f1430+_0x874c('0x5c'));fs[_0x874c('0x5d')](_0x5f1430);}_0x5f1430=_0x5f1430+_0x874c('0x5e');if(!_[_0x874c('0x58')](_0x10500b[_0x874c('0x4f')])&&fs[_0x874c('0x59')](_0x5f1430)){logger[_0x874c('0x5a')](_0x874c('0x5b')+_0x5f1430+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x874c('0x5d')](_0x5f1430);}return _0x10500b;})[_0x874c('0x22')](function(_0x3f2c4f){if(!_0x3f2c4f)throw new InternalError();return _0x3f2c4f[_0x874c('0x23')]();})[_0x874c('0x22')](function(){_0x318db6[_0x874c('0x16')](0xcc)['end']();})[_0x874c('0x43')](handleError(_0x318db6,null));};
\ No newline at end of file
+var _0x64f3=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','destroy','then','error','stack','send','map','SquareRecording','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','name','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','../../components/encryptor','uniqueid','savePath','filename','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs'];(function(_0x18a203,_0x10430e){var _0x1b0743=function(_0x283fe9){while(--_0x283fe9){_0x18a203['push'](_0x18a203['shift']());}};_0x1b0743(++_0x10430e);}(_0x64f3,0x160));var _0x364f=function(_0x36e3cd,_0x4ff225){_0x36e3cd=_0x36e3cd-0x0;var _0x19f9d6=_0x64f3[_0x36e3cd];return _0x19f9d6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x364f('0x0'));var rimraf=require(_0x364f('0x1'));var zipdir=require('zip-dir');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(_0x364f('0x2'));var path=require('path');var sox=require(_0x364f('0x3'));var csv=require(_0x364f('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x364f('0x5'));var squel=require(_0x364f('0x6'));var crypto=require(_0x364f('0x7'));var jsforce=require(_0x364f('0x8'));var deskjs=require(_0x364f('0x9'));var toCsv=require(_0x364f('0x4'));var querystring=require('querystring');var Papa=require(_0x364f('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x364f('0xb'));var as=require(_0x364f('0xc'));var hardwareService=require(_0x364f('0xd'));var logger=require(_0x364f('0xe'))('api');var utils=require(_0x364f('0xf'));var config=require(_0x364f('0x10'));var db=require(_0x364f('0x11'))['db'];function respondWithStatusCode(_0x20ff84,_0x3c47b2){_0x3c47b2=_0x3c47b2||0xcc;return function(_0x5d341f){if(_0x5d341f){return _0x20ff84[_0x364f('0x12')](_0x3c47b2);}return _0x20ff84[_0x364f('0x13')](_0x3c47b2)[_0x364f('0x14')]();};}function respondWithResult(_0x56d9ab,_0x5e5f9b){_0x5e5f9b=_0x5e5f9b||0xc8;return function(_0x5ee894){if(_0x5ee894){return _0x56d9ab[_0x364f('0x13')](_0x5e5f9b)[_0x364f('0x15')](_0x5ee894);}};}function respondWithFilteredResult(_0x228df1,_0x1890fa){return function(_0x25a8f5){if(_0x25a8f5){var _0xce7505=_0x25a8f5[_0x364f('0x16')],_0x3ed3af=_0x1890fa[_0x364f('0x17')],_0x3e1d74=_0x1890fa[_0x364f('0x17')]+_0x1890fa[_0x364f('0x18')],_0x4b55ab;if(_0x3e1d74>=_0xce7505){_0x3e1d74=_0xce7505;_0x4b55ab=0xc8;}else{_0x4b55ab=0xce;}_0x228df1[_0x364f('0x13')](_0x4b55ab);return _0x228df1[_0x364f('0x19')]('Content-Range',_0x3ed3af+'-'+_0x3e1d74+'/'+_0xce7505)[_0x364f('0x15')](_0x25a8f5);}return null;};}function patchUpdates(_0x5a1654){return function(_0x22c437){try{jsonpatch[_0x364f('0x1a')](_0x22c437,_0x5a1654,!![]);}catch(_0x5da2ff){return BPromise['reject'](_0x5da2ff);}return _0x22c437[_0x364f('0x1b')]();};}function saveUpdates(_0x2437a3,_0x5db011){return function(_0x36422c){if(_0x36422c){return _0x36422c['update'](_0x2437a3)['then'](function(_0x4b1abe){return _0x4b1abe;});}return null;};}function removeEntity(_0x4cf407,_0x47e4a3){return function(_0x1dc799){if(_0x1dc799){return _0x1dc799[_0x364f('0x1c')]()[_0x364f('0x1d')](function(){_0x4cf407[_0x364f('0x13')](0xcc)[_0x364f('0x14')]();});}};}function handleEntityNotFound(_0x4ea6ae,_0x2103a2){return function(_0x1dae8f){if(!_0x1dae8f){_0x4ea6ae[_0x364f('0x12')](0x194);}return _0x1dae8f;};}function handleError(_0x36838b,_0x4fe691){_0x4fe691=_0x4fe691||0x1f4;return function(_0x3d384d){logger[_0x364f('0x1e')](_0x3d384d[_0x364f('0x1f')]);if(_0x3d384d['name']){delete _0x3d384d['name'];}_0x36838b['status'](_0x4fe691)[_0x364f('0x20')](_0x3d384d);};}exports['index']=function(_0x400cb9,_0x57d81e){var _0x46b641={},_0x261b33={},_0x20b437={'count':0x0,'rows':[]};var _0x244798=_[_0x364f('0x21')](db[_0x364f('0x22')]['rawAttributes'],function(_0x33ecae){return{'name':_0x33ecae[_0x364f('0x23')],'type':_0x33ecae[_0x364f('0x24')]['key']};});_0x261b33['model']=_['map'](_0x244798,'name');_0x261b33[_0x364f('0x25')]=_['keys'](_0x400cb9[_0x364f('0x25')]);_0x261b33[_0x364f('0x26')]=_[_0x364f('0x27')](_0x261b33[_0x364f('0x28')],_0x261b33[_0x364f('0x25')]);_0x46b641['attributes']=_[_0x364f('0x27')](_0x261b33[_0x364f('0x28')],qs[_0x364f('0x29')](_0x400cb9[_0x364f('0x25')][_0x364f('0x29')]));_0x46b641[_0x364f('0x2a')]=_0x46b641[_0x364f('0x2a')][_0x364f('0x2b')]?_0x46b641[_0x364f('0x2a')]:_0x261b33['model'];if(!_0x400cb9[_0x364f('0x25')][_0x364f('0x2c')](_0x364f('0x2d'))){_0x46b641[_0x364f('0x18')]=qs[_0x364f('0x18')](_0x400cb9[_0x364f('0x25')]['limit']);_0x46b641['offset']=qs[_0x364f('0x17')](_0x400cb9[_0x364f('0x25')]['offset']);}_0x46b641[_0x364f('0x2e')]=qs[_0x364f('0x2f')](_0x400cb9[_0x364f('0x25')][_0x364f('0x2f')]);_0x46b641[_0x364f('0x30')]=qs['filters'](_[_0x364f('0x31')](_0x400cb9['query'],_0x261b33['filters']),_0x244798);if(_0x400cb9['query']['filter']){_0x46b641[_0x364f('0x30')]=_['merge'](_0x46b641[_0x364f('0x30')],{'$or':_[_0x364f('0x21')](_0x244798,function(_0x24e826){if(_0x24e826[_0x364f('0x24')]!==_0x364f('0x32')){var _0x3e5903={};_0x3e5903[_0x24e826[_0x364f('0x33')]]={'$like':'%'+_0x400cb9['query'][_0x364f('0x34')]+'%'};return _0x3e5903;}})});}_0x46b641=_[_0x364f('0x35')]({},_0x46b641,_0x400cb9[_0x364f('0x36')]);var _0x454197={'where':_0x46b641[_0x364f('0x30')]};return db[_0x364f('0x22')][_0x364f('0x16')](_0x454197)[_0x364f('0x1d')](function(_0xdd7130){_0x20b437[_0x364f('0x16')]=_0xdd7130;if(_0x400cb9[_0x364f('0x25')][_0x364f('0x37')]){_0x46b641[_0x364f('0x38')]=[{'all':!![]}];}return db[_0x364f('0x22')][_0x364f('0x39')](_0x46b641);})[_0x364f('0x1d')](function(_0x412bed){_0x20b437[_0x364f('0x3a')]=_0x412bed;return _0x20b437;})[_0x364f('0x1d')](respondWithFilteredResult(_0x57d81e,_0x46b641))['catch'](handleError(_0x57d81e,null));};exports[_0x364f('0x3b')]=function(_0x2bd58d,_0x5e2e36){var _0x1b6173={'raw':!![],'where':{'id':_0x2bd58d[_0x364f('0x3c')]['id']}},_0x4dfd04={};_0x4dfd04[_0x364f('0x28')]=_[_0x364f('0x3d')](db['SquareRecording'][_0x364f('0x3e')]);_0x4dfd04[_0x364f('0x25')]=_[_0x364f('0x3d')](_0x2bd58d['query']);_0x4dfd04[_0x364f('0x26')]=_[_0x364f('0x27')](_0x4dfd04[_0x364f('0x28')],_0x4dfd04['query']);_0x1b6173[_0x364f('0x2a')]=_[_0x364f('0x27')](_0x4dfd04[_0x364f('0x28')],qs[_0x364f('0x29')](_0x2bd58d[_0x364f('0x25')][_0x364f('0x29')]));_0x1b6173[_0x364f('0x2a')]=_0x1b6173['attributes']['length']?_0x1b6173[_0x364f('0x2a')]:_0x4dfd04[_0x364f('0x28')];if(_0x2bd58d[_0x364f('0x25')][_0x364f('0x37')]){_0x1b6173[_0x364f('0x38')]=[{'all':!![]}];}_0x1b6173=_['merge']({},_0x1b6173,_0x2bd58d[_0x364f('0x36')]);return db[_0x364f('0x22')][_0x364f('0x3f')](_0x1b6173)['then'](handleEntityNotFound(_0x5e2e36,null))[_0x364f('0x1d')](respondWithResult(_0x5e2e36,null))[_0x364f('0x40')](handleError(_0x5e2e36,null));};exports[_0x364f('0x41')]=function(_0xdc0bc9,_0x291f4a){return db[_0x364f('0x22')]['create'](_0xdc0bc9[_0x364f('0x42')],{})['then'](respondWithResult(_0x291f4a,0xc9))['catch'](handleError(_0x291f4a,null));};exports['update']=function(_0x143f39,_0x1445e6){if(_0x143f39[_0x364f('0x42')]['id']){delete _0x143f39[_0x364f('0x42')]['id'];}return db[_0x364f('0x22')][_0x364f('0x3f')]({'where':{'id':_0x143f39[_0x364f('0x3c')]['id']}})[_0x364f('0x1d')](handleEntityNotFound(_0x1445e6,null))['then'](saveUpdates(_0x143f39[_0x364f('0x42')],null))[_0x364f('0x1d')](respondWithResult(_0x1445e6,null))[_0x364f('0x40')](handleError(_0x1445e6,null));};exports['download']=function(_0x9372ef,_0x323aa6,_0x337890){var _0x3514e4=require(_0x364f('0x43'));var _0x58542b=![];var _0x279d31={};if(_0x9372ef['query']['type']&&_0x9372ef[_0x364f('0x25')][_0x364f('0x24')]===_0x364f('0x44')){_0x279d31[_0x364f('0x44')]=_0x9372ef[_0x364f('0x3c')]['id'];}else{_0x279d31['id']=_0x9372ef['params']['id'];}return db[_0x364f('0x22')][_0x364f('0x3f')]({'where':_0x279d31,'attributes':['id',_0x364f('0x45'),_0x364f('0x46')],'raw':!![]})[_0x364f('0x1d')](handleEntityNotFound(_0x323aa6,null))[_0x364f('0x1d')](function(_0xf3328){if(_0xf3328){var _0x2969a4=_0xf3328[_0x364f('0x45')];var _0x3999fc=util[_0x364f('0x47')]('%s.cypher',_0x2969a4);if(fs['existsSync'](_0x3999fc)){_0x58542b=!![];return _0x3514e4[_0x364f('0x48')](_0x3999fc,_0x2969a4,config[_0x364f('0x49')][_0x364f('0x4a')])[_0x364f('0x1d')](function(){return _0xf3328;});}return _0xf3328;}})[_0x364f('0x1d')](function(_0x47617e){if(_0x47617e){var _0x102e9e=_0x47617e[_0x364f('0x45')];if(!fs[_0x364f('0x4b')](_0x102e9e)){throw new db[(_0x364f('0x4c'))][(_0x364f('0x4d'))](_0x364f('0x4e'));}if(_0x47617e[_0x364f('0x46')]){return _0x323aa6[_0x364f('0x4f')](_0x102e9e,_0x47617e[_0x364f('0x46')]+path[_0x364f('0x50')](_0x102e9e),function(){if(_0x58542b){fs[_0x364f('0x51')](_0x102e9e);}});}else{return _0x323aa6['download'](_0x102e9e,function(_0x9d3d03){if(_0x58542b){fs[_0x364f('0x51')](_0x102e9e);}});}}})[_0x364f('0x40')](function(_0x284c53){if(_0x284c53[_0x364f('0x52')]===_0x364f('0x4e')){_0x323aa6['status'](0x194)[_0x364f('0x20')](_0x364f('0x53'));}else{return handleError(_0x323aa6,null);}});};exports['destroy']=function(_0x15078e,_0x5533af){return db[_0x364f('0x22')]['find']({'where':{'id':_0x15078e[_0x364f('0x3c')]['id']}})[_0x364f('0x1d')](function(_0x1efe3a){if(!_0x1efe3a)throw new ReferenceError(_0x364f('0x54'));return _0x1efe3a;})[_0x364f('0x1d')](function(_0x111611){var _0x302448=_0x111611['savePath'];logger[_0x364f('0x55')](_0x364f('0x56'),_0x302448);if(!_[_0x364f('0x57')](_0x111611[_0x364f('0x45')])&&fs[_0x364f('0x4b')](_0x302448)){logger[_0x364f('0x55')](_0x364f('0x58')+_0x302448+_0x364f('0x59'));fs['unlinkSync'](_0x302448);}_0x302448=_0x302448+_0x364f('0x5a');if(!_[_0x364f('0x57')](_0x111611[_0x364f('0x45')])&&fs['existsSync'](_0x302448)){logger['info'](_0x364f('0x58')+_0x302448+_0x364f('0x59'));fs['unlinkSync'](_0x302448);}return _0x111611;})[_0x364f('0x1d')](function(_0xb0d01a){if(!_0xb0d01a)throw new InternalError();return _0xb0d01a[_0x364f('0x1c')]();})[_0x364f('0x1d')](function(){_0x5533af[_0x364f('0x13')](0xcc)[_0x364f('0x14')]();})[_0x364f('0x40')](handleError(_0x5533af,null));};
\ No newline at end of file
index 43f3464..211b61e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19e1=['define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./squareRecording.attributes'];(function(_0x4d94cb,_0x9f5844){var _0x129c9e=function(_0x320da7){while(--_0x320da7){_0x4d94cb['push'](_0x4d94cb['shift']());}};_0x129c9e(++_0x9f5844);}(_0x19e1,0x163));var _0x119e=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0x19e1[_0x3c81b5];return _0x5888c4;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var logger=require(_0x119e('0x2'))(_0x119e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x119e('0x4'));var fs=require('fs');var path=require(_0x119e('0x5'));var rimraf=require('rimraf');var config=require(_0x119e('0x6'));var attributes=require(_0x119e('0x7'));module['exports']=function(_0x2ce0a3,_0x5a6b88){return _0x2ce0a3[_0x119e('0x8')](_0x119e('0x9'),attributes,{'tableName':_0x119e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf846=['SquareRecording','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports','define'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xf846,0x85));var _0x6f84=function(_0x28ddc8,_0x296e71){_0x28ddc8=_0x28ddc8-0x0;var _0x1d0a89=_0xf846[_0x28ddc8];return _0x1d0a89;};'use strict';var _=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var logger=require(_0x6f84('0x2'))(_0x6f84('0x3'));var moment=require('moment');var BPromise=require(_0x6f84('0x4'));var rp=require(_0x6f84('0x5'));var fs=require('fs');var path=require(_0x6f84('0x6'));var rimraf=require(_0x6f84('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f84('0x8'));module[_0x6f84('0x9')]=function(_0x2963cd,_0x25e3c2){return _0x2963cd[_0x6f84('0xa')](_0x6f84('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cad60e0..7f5fe64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01dc=['SquareRecording,\x20%s,\x20%s,\x20%s','error','message','catch','CreateSquareRecording','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x117c36,_0x424316){var _0x2e8573=function(_0xa21e14){while(--_0xa21e14){_0x117c36['push'](_0x117c36['shift']());}};_0x2e8573(++_0x424316);}(_0x01dc,0x1cc));var _0xc01d=function(_0x4c22f1,_0x4c2f70){_0x4c22f1=_0x4c22f1-0x0;var _0x16cff3=_0x01dc[_0x4c22f1];return _0x16cff3;};'use strict';var _=require(_0xc01d('0x0'));var util=require(_0xc01d('0x1'));var moment=require(_0xc01d('0x2'));var BPromise=require(_0xc01d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc01d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc01d('0x5'));var logger=require(_0xc01d('0x6'))('rpc');var config=require(_0xc01d('0x7'));var jayson=require(_0xc01d('0x8'));var client=jayson['client'][_0xc01d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a3f2b,_0x225846,_0x505371){return new BPromise(function(_0x59bdb2,_0x553da3){return client['request'](_0x1a3f2b,_0x505371)[_0xc01d('0xa')](function(_0x7599f9){logger[_0xc01d('0xb')](_0xc01d('0xc'),_0x225846,_0xc01d('0xd'));logger[_0xc01d('0xe')](_0xc01d('0xf'),_0x225846,'request\x20sent',JSON['stringify'](_0x7599f9));if(_0x7599f9[_0xc01d('0x10')]){if(_0x7599f9[_0xc01d('0x10')]['code']===0x1f4){logger[_0xc01d('0x10')]('SquareRecording,\x20%s,\x20%s',_0x225846,_0x7599f9[_0xc01d('0x10')][_0xc01d('0x11')]);return _0x553da3(_0x7599f9['error'][_0xc01d('0x11')]);}logger[_0xc01d('0x10')](_0xc01d('0xc'),_0x225846,_0x7599f9[_0xc01d('0x10')][_0xc01d('0x11')]);return _0x59bdb2(_0x7599f9['error'][_0xc01d('0x11')]);}else{logger[_0xc01d('0xb')](_0xc01d('0xc'),_0x225846,_0xc01d('0xd'));_0x59bdb2(_0x7599f9['result']['message']);}})[_0xc01d('0x12')](function(_0x5c23fc){logger[_0xc01d('0x10')](_0xc01d('0xc'),_0x225846,_0x5c23fc);_0x553da3(_0x5c23fc);});});}exports[_0xc01d('0x13')]=function(_0x5615ba){var _0x1c9db8=this;return new Promise(function(_0x1b79f2,_0x14be66){return db['SquareRecording'][_0xc01d('0x14')](_0x5615ba[_0xc01d('0x15')],{'raw':_0x5615ba[_0xc01d('0x16')]?_0x5615ba[_0xc01d('0x16')][_0xc01d('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x590afe){logger['info']('CreateSquareRecording',_0x5615ba);logger[_0xc01d('0xe')](_0xc01d('0x13'),_0x5615ba,JSON[_0xc01d('0x18')](_0x590afe));_0x1b79f2(_0x590afe);})[_0xc01d('0x12')](function(_0x704efd){logger['error'](_0xc01d('0x13'),_0x704efd[_0xc01d('0x11')],_0x5615ba);_0x14be66(_0x1c9db8[_0xc01d('0x10')](0x1f4,_0x704efd['message']));});});};
\ No newline at end of file
+var _0xb55f=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','create','body','lodash','moment','bluebird','randomstring'];(function(_0x2438ed,_0x1ddf78){var _0x19cc9b=function(_0x37fcb0){while(--_0x37fcb0){_0x2438ed['push'](_0x2438ed['shift']());}};_0x19cc9b(++_0x1ddf78);}(_0xb55f,0x18c));var _0xfb55=function(_0x1a041c,_0x2e8684){_0x1a041c=_0x1a041c-0x0;var _0x5d40e2=_0xb55f[_0x1a041c];return _0x5d40e2;};'use strict';var _=require(_0xfb55('0x0'));var util=require('util');var moment=require(_0xfb55('0x1'));var BPromise=require(_0xfb55('0x2'));var rs=require(_0xfb55('0x3'));var fs=require('fs');var Redis=require(_0xfb55('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb55('0x5'));var logger=require(_0xfb55('0x6'))(_0xfb55('0x7'));var config=require('../../config/environment');var jayson=require(_0xfb55('0x8'));var client=jayson[_0xfb55('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210f40,_0x52f287,_0xb63422){return new BPromise(function(_0x41b1ea,_0xe28ed9){return client[_0xfb55('0xa')](_0x210f40,_0xb63422)[_0xfb55('0xb')](function(_0x5729d9){logger[_0xfb55('0xc')](_0xfb55('0xd'),_0x52f287,_0xfb55('0xe'));logger[_0xfb55('0xf')](_0xfb55('0x10'),_0x52f287,'request\x20sent',JSON[_0xfb55('0x11')](_0x5729d9));if(_0x5729d9[_0xfb55('0x12')]){if(_0x5729d9[_0xfb55('0x12')][_0xfb55('0x13')]===0x1f4){logger[_0xfb55('0x12')](_0xfb55('0xd'),_0x52f287,_0x5729d9[_0xfb55('0x12')][_0xfb55('0x14')]);return _0xe28ed9(_0x5729d9[_0xfb55('0x12')][_0xfb55('0x14')]);}logger[_0xfb55('0x12')](_0xfb55('0xd'),_0x52f287,_0x5729d9[_0xfb55('0x12')][_0xfb55('0x14')]);return _0x41b1ea(_0x5729d9[_0xfb55('0x12')]['message']);}else{logger[_0xfb55('0xc')](_0xfb55('0xd'),_0x52f287,_0xfb55('0xe'));_0x41b1ea(_0x5729d9['result'][_0xfb55('0x14')]);}})[_0xfb55('0x15')](function(_0x253449){logger[_0xfb55('0x12')](_0xfb55('0xd'),_0x52f287,_0x253449);_0xe28ed9(_0x253449);});});}exports[_0xfb55('0x16')]=function(_0xb9f565){var _0x11c217=this;return new Promise(function(_0x5aa017,_0xa86d07){return db['SquareRecording'][_0xfb55('0x17')](_0xb9f565[_0xfb55('0x18')],{'raw':_0xb9f565['options']?_0xb9f565['options']['raw']===undefined?!![]:![]:!![]})[_0xfb55('0xb')](function(_0xe2206f){logger[_0xfb55('0xc')](_0xfb55('0x16'),_0xb9f565);logger[_0xfb55('0xf')](_0xfb55('0x16'),_0xb9f565,JSON[_0xfb55('0x11')](_0xe2206f));_0x5aa017(_0xe2206f);})[_0xfb55('0x15')](function(_0x324158){logger[_0xfb55('0x12')](_0xfb55('0x16'),_0x324158['message'],_0xb9f565);_0xa86d07(_0x11c217[_0xfb55('0x12')](0x1f4,_0x324158[_0xfb55('0x14')]));});});};
\ No newline at end of file
index 8d7bca9..b6b65f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98cf=['delete','destroy','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x53dc04,_0x3d7fbd){var _0x16af29=function(_0x554623){while(--_0x554623){_0x53dc04['push'](_0x53dc04['shift']());}};_0x16af29(++_0x3d7fbd);}(_0x98cf,0x111));var _0xf98c=function(_0x44cdb8,_0x431645){_0x44cdb8=_0x44cdb8-0x0;var _0x6c05a7=_0x98cf[_0x44cdb8];return _0x6c05a7;};'use strict';var multer=require('multer');var util=require(_0xf98c('0x0'));var path=require(_0xf98c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf98c('0x2')]();var auth=require(_0xf98c('0x3'));var interaction=require(_0xf98c('0x4'));var config=require(_0xf98c('0x5'));var controller=require('./squareReport.controller');router[_0xf98c('0x6')]('/',auth[_0xf98c('0x7')](),controller[_0xf98c('0x8')]);router[_0xf98c('0x6')](_0xf98c('0x9'),auth[_0xf98c('0x7')](),controller[_0xf98c('0xa')]);router[_0xf98c('0x6')](_0xf98c('0xb'),auth[_0xf98c('0x7')](),controller[_0xf98c('0xc')]);router[_0xf98c('0xd')]('/',auth[_0xf98c('0x7')](),controller[_0xf98c('0xe')]);router['put'](_0xf98c('0xb'),auth[_0xf98c('0x7')](),controller['update']);router[_0xf98c('0xf')](_0xf98c('0xb'),auth['isAuthenticated'](),controller[_0xf98c('0x10')]);module[_0xf98c('0x11')]=router;
\ No newline at end of file
+var _0x2cb9=['/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./squareReport.controller','isAuthenticated','index','get','/describe'];(function(_0x33d07d,_0x318cfd){var _0x34cc94=function(_0x176cb2){while(--_0x176cb2){_0x33d07d['push'](_0x33d07d['shift']());}};_0x34cc94(++_0x318cfd);}(_0x2cb9,0x67));var _0x92cb=function(_0x14b3bb,_0x56c278){_0x14b3bb=_0x14b3bb-0x0;var _0x4c7d00=_0x2cb9[_0x14b3bb];return _0x4c7d00;};'use strict';var multer=require(_0x92cb('0x0'));var util=require('util');var path=require(_0x92cb('0x1'));var timeout=require(_0x92cb('0x2'));var express=require(_0x92cb('0x3'));var router=express[_0x92cb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x92cb('0x5'));var config=require('../../config/environment');var controller=require(_0x92cb('0x6'));router['get']('/',auth[_0x92cb('0x7')](),controller[_0x92cb('0x8')]);router[_0x92cb('0x9')](_0x92cb('0xa'),auth[_0x92cb('0x7')](),controller['describe']);router[_0x92cb('0x9')](_0x92cb('0xb'),auth['isAuthenticated'](),controller[_0x92cb('0xc')]);router[_0x92cb('0xd')]('/',auth['isAuthenticated'](),controller[_0x92cb('0xe')]);router[_0x92cb('0xf')](_0x92cb('0xb'),auth['isAuthenticated'](),controller[_0x92cb('0x10')]);router['delete'](_0x92cb('0xb'),auth[_0x92cb('0x7')](),controller[_0x92cb('0x11')]);module[_0x92cb('0x12')]=router;
\ No newline at end of file
index 9a32143..2e546ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d77=['DATE','sequelize','STRING'];(function(_0x4532fb,_0xa41e94){var _0x20e421=function(_0x28c1ce){while(--_0x28c1ce){_0x4532fb['push'](_0x4532fb['shift']());}};_0x20e421(++_0xa41e94);}(_0x7d77,0x73));var _0x77d7=function(_0x3d7022,_0x59dfd5){_0x3d7022=_0x3d7022-0x0;var _0x40870b=_0x7d77[_0x3d7022];return _0x40870b;};'use strict';var Sequelize=require(_0x77d7('0x0'));module['exports']={'network':{'type':Sequelize[_0x77d7('0x1')]},'network_script':{'type':Sequelize[_0x77d7('0x1')]},'request':{'type':Sequelize[_0x77d7('0x1')]},'channel':{'type':Sequelize[_0x77d7('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x77d7('0x1')]},'uniqueid':{'type':Sequelize[_0x77d7('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x77d7('0x1')]},'calleridname':{'type':Sequelize[_0x77d7('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x77d7('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x77d7('0x1')]},'dnid':{'type':Sequelize[_0x77d7('0x1')]},'rdnis':{'type':Sequelize[_0x77d7('0x1')]},'context':{'type':Sequelize[_0x77d7('0x1')]},'extension':{'type':Sequelize[_0x77d7('0x1')]},'priority':{'type':Sequelize[_0x77d7('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x77d7('0x1')]},'threadid':{'type':Sequelize[_0x77d7('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x77d7('0x2')]},'leaveAt':{'type':Sequelize[_0x77d7('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x2090=['STRING','DATE','sequelize'];(function(_0x4ef433,_0x234b50){var _0x1a517f=function(_0x48d9c4){while(--_0x48d9c4){_0x4ef433['push'](_0x4ef433['shift']());}};_0x1a517f(++_0x234b50);}(_0x2090,0x10d));var _0x0209=function(_0x3d361c,_0x27e13a){_0x3d361c=_0x3d361c-0x0;var _0x3b62ec=_0x2090[_0x3d361c];return _0x3b62ec;};'use strict';var Sequelize=require(_0x0209('0x0'));module['exports']={'network':{'type':Sequelize[_0x0209('0x1')]},'network_script':{'type':Sequelize[_0x0209('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0209('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0209('0x1')]},'uniqueid':{'type':Sequelize[_0x0209('0x1')]},'version':{'type':Sequelize[_0x0209('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0209('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x0209('0x1')]},'dnid':{'type':Sequelize[_0x0209('0x1')]},'rdnis':{'type':Sequelize[_0x0209('0x1')]},'context':{'type':Sequelize[_0x0209('0x1')]},'extension':{'type':Sequelize[_0x0209('0x1')]},'priority':{'type':Sequelize[_0x0209('0x1')]},'enhanced':{'type':Sequelize[_0x0209('0x1')]},'accountcode':{'type':Sequelize[_0x0209('0x1')]},'threadid':{'type':Sequelize[_0x0209('0x1')]},'project_name':{'type':Sequelize[_0x0209('0x1')]},'joinAt':{'type':Sequelize[_0x0209('0x2')]},'leaveAt':{'type':Sequelize[_0x0209('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index c436754..6363061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf354=['fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','Content-Range','apply','save','update','destroy','then','error','stack','name','index','SquareReport','type','key','model','map','query','keys','filters','attributes','intersection'];(function(_0x221ba2,_0x79208){var _0x47d08e=function(_0xaf14ee){while(--_0xaf14ee){_0x221ba2['push'](_0x221ba2['shift']());}};_0x47d08e(++_0x79208);}(_0xf354,0xae));var _0x4f35=function(_0xe75f2a,_0x40c195){_0xe75f2a=_0xe75f2a-0x0;var _0x5e5cb2=_0xf354[_0xe75f2a];return _0x5e5cb2;};'use strict';var pdf=require(_0x4f35('0x0'));var emlformat=require(_0x4f35('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4f35('0x2'));var jsonpatch=require(_0x4f35('0x3'));var rp=require(_0x4f35('0x4'));var moment=require(_0x4f35('0x5'));var BPromise=require(_0x4f35('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f35('0x7'));var sox=require(_0x4f35('0x8'));var csv=require(_0x4f35('0x9'));var ejs=require(_0x4f35('0xa'));var fs=require('fs');var _=require(_0x4f35('0xb'));var squel=require(_0x4f35('0xc'));var crypto=require(_0x4f35('0xd'));var jsforce=require(_0x4f35('0xe'));var deskjs=require(_0x4f35('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f35('0x10'));var Papa=require('papaparse');var Redis=require(_0x4f35('0x11'));var authService=require(_0x4f35('0x12'));var qs=require(_0x4f35('0x13'));var as=require(_0x4f35('0x14'));var hardwareService=require(_0x4f35('0x15'));var logger=require(_0x4f35('0x16'))(_0x4f35('0x17'));var utils=require('../../config/utils');var config=require(_0x4f35('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8d23,_0x5be91d){_0x5be91d=_0x5be91d||0xcc;return function(_0x73e476){if(_0x73e476){return _0x3d8d23[_0x4f35('0x19')](_0x5be91d);}return _0x3d8d23['status'](_0x5be91d)[_0x4f35('0x1a')]();};}function respondWithResult(_0x8767d9,_0x5f9105){_0x5f9105=_0x5f9105||0xc8;return function(_0x5d5296){if(_0x5d5296){return _0x8767d9[_0x4f35('0x1b')](_0x5f9105)[_0x4f35('0x1c')](_0x5d5296);}};}function respondWithFilteredResult(_0x150607,_0x977751){return function(_0x459a94){if(_0x459a94){var _0x25d0e9=_0x459a94[_0x4f35('0x1d')],_0x138cd3=_0x977751[_0x4f35('0x1e')],_0xb707c7=_0x977751[_0x4f35('0x1e')]+_0x977751['limit'],_0x2634bd;if(_0xb707c7>=_0x25d0e9){_0xb707c7=_0x25d0e9;_0x2634bd=0xc8;}else{_0x2634bd=0xce;}_0x150607[_0x4f35('0x1b')](_0x2634bd);return _0x150607['set'](_0x4f35('0x1f'),_0x138cd3+'-'+_0xb707c7+'/'+_0x25d0e9)[_0x4f35('0x1c')](_0x459a94);}return null;};}function patchUpdates(_0x26079a){return function(_0x490d10){try{jsonpatch[_0x4f35('0x20')](_0x490d10,_0x26079a,!![]);}catch(_0x16c75e){return BPromise['reject'](_0x16c75e);}return _0x490d10[_0x4f35('0x21')]();};}function saveUpdates(_0x5812a6,_0x26078a){return function(_0x5c65f9){if(_0x5c65f9){return _0x5c65f9[_0x4f35('0x22')](_0x5812a6)['then'](function(_0x5b3f0b){return _0x5b3f0b;});}return null;};}function removeEntity(_0x16c0ff,_0x32b784){return function(_0x264bc1){if(_0x264bc1){return _0x264bc1[_0x4f35('0x23')]()[_0x4f35('0x24')](function(){_0x16c0ff[_0x4f35('0x1b')](0xcc)[_0x4f35('0x1a')]();});}};}function handleEntityNotFound(_0x21c90e,_0x57f3f4){return function(_0x199745){if(!_0x199745){_0x21c90e[_0x4f35('0x19')](0x194);}return _0x199745;};}function handleError(_0x53c8eb,_0x7730c3){_0x7730c3=_0x7730c3||0x1f4;return function(_0x1d38d5){logger[_0x4f35('0x25')](_0x1d38d5[_0x4f35('0x26')]);if(_0x1d38d5[_0x4f35('0x27')]){delete _0x1d38d5[_0x4f35('0x27')];}_0x53c8eb[_0x4f35('0x1b')](_0x7730c3)['send'](_0x1d38d5);};}exports[_0x4f35('0x28')]=function(_0x51d409,_0x48e66d){var _0x1cb624={},_0x2dc339={},_0xd2db6b={'count':0x0,'rows':[]};var _0x5e2bf1=_['map'](db[_0x4f35('0x29')]['rawAttributes'],function(_0x11d2ba){return{'name':_0x11d2ba['fieldName'],'type':_0x11d2ba[_0x4f35('0x2a')][_0x4f35('0x2b')]};});_0x2dc339[_0x4f35('0x2c')]=_[_0x4f35('0x2d')](_0x5e2bf1,'name');_0x2dc339[_0x4f35('0x2e')]=_[_0x4f35('0x2f')](_0x51d409['query']);_0x2dc339[_0x4f35('0x30')]=_['intersection'](_0x2dc339[_0x4f35('0x2c')],_0x2dc339['query']);_0x1cb624[_0x4f35('0x31')]=_[_0x4f35('0x32')](_0x2dc339[_0x4f35('0x2c')],qs[_0x4f35('0x33')](_0x51d409['query'][_0x4f35('0x33')]));_0x1cb624['attributes']=_0x1cb624['attributes'][_0x4f35('0x34')]?_0x1cb624[_0x4f35('0x31')]:_0x2dc339[_0x4f35('0x2c')];if(!_0x51d409[_0x4f35('0x2e')][_0x4f35('0x35')](_0x4f35('0x36'))){_0x1cb624[_0x4f35('0x37')]=qs[_0x4f35('0x37')](_0x51d409[_0x4f35('0x2e')]['limit']);_0x1cb624[_0x4f35('0x1e')]=qs[_0x4f35('0x1e')](_0x51d409[_0x4f35('0x2e')]['offset']);}_0x1cb624[_0x4f35('0x38')]=qs[_0x4f35('0x39')](_0x51d409['query'][_0x4f35('0x39')]);_0x1cb624[_0x4f35('0x3a')]=qs['filters'](_[_0x4f35('0x3b')](_0x51d409[_0x4f35('0x2e')],_0x2dc339[_0x4f35('0x30')]),_0x5e2bf1);if(_0x51d409[_0x4f35('0x2e')][_0x4f35('0x3c')]){_0x1cb624['where']=_[_0x4f35('0x3d')](_0x1cb624[_0x4f35('0x3a')],{'$or':_[_0x4f35('0x2d')](_0x5e2bf1,function(_0x43ff04){if(_0x43ff04[_0x4f35('0x2a')]!==_0x4f35('0x3e')){var _0x39525c={};_0x39525c[_0x43ff04[_0x4f35('0x27')]]={'$like':'%'+_0x51d409[_0x4f35('0x2e')][_0x4f35('0x3c')]+'%'};return _0x39525c;}})});}_0x1cb624=_[_0x4f35('0x3d')]({},_0x1cb624,_0x51d409[_0x4f35('0x3f')]);var _0x522ca8={'where':_0x1cb624[_0x4f35('0x3a')]};return db[_0x4f35('0x29')][_0x4f35('0x1d')](_0x522ca8)[_0x4f35('0x24')](function(_0x4d8edf){_0xd2db6b[_0x4f35('0x1d')]=_0x4d8edf;if(_0x51d409['query'][_0x4f35('0x40')]){_0x1cb624[_0x4f35('0x41')]=[{'all':!![]}];}return db[_0x4f35('0x29')][_0x4f35('0x42')](_0x1cb624);})[_0x4f35('0x24')](function(_0x563e19){_0xd2db6b[_0x4f35('0x43')]=_0x563e19;return _0xd2db6b;})[_0x4f35('0x24')](respondWithFilteredResult(_0x48e66d,_0x1cb624))['catch'](handleError(_0x48e66d,null));};exports[_0x4f35('0x44')]=function(_0x5d5f68,_0x6b8848){var _0x5a9a32={'raw':!![],'where':{'id':_0x5d5f68['params']['id']}},_0x1a061d={};_0x1a061d['model']=_[_0x4f35('0x2f')](db['SquareReport']['rawAttributes']);_0x1a061d['query']=_[_0x4f35('0x2f')](_0x5d5f68['query']);_0x1a061d[_0x4f35('0x30')]=_[_0x4f35('0x32')](_0x1a061d['model'],_0x1a061d['query']);_0x5a9a32[_0x4f35('0x31')]=_[_0x4f35('0x32')](_0x1a061d[_0x4f35('0x2c')],qs[_0x4f35('0x33')](_0x5d5f68[_0x4f35('0x2e')]['fields']));_0x5a9a32[_0x4f35('0x31')]=_0x5a9a32[_0x4f35('0x31')]['length']?_0x5a9a32[_0x4f35('0x31')]:_0x1a061d[_0x4f35('0x2c')];if(_0x5d5f68[_0x4f35('0x2e')]['includeAll']){_0x5a9a32[_0x4f35('0x41')]=[{'all':!![]}];}_0x5a9a32=_[_0x4f35('0x3d')]({},_0x5a9a32,_0x5d5f68[_0x4f35('0x3f')]);return db[_0x4f35('0x29')][_0x4f35('0x45')](_0x5a9a32)[_0x4f35('0x24')](handleEntityNotFound(_0x6b8848,null))['then'](respondWithResult(_0x6b8848,null))[_0x4f35('0x46')](handleError(_0x6b8848,null));};exports['create']=function(_0x1c8f2e,_0x3d081c){return db[_0x4f35('0x29')][_0x4f35('0x47')](_0x1c8f2e['body'],{})[_0x4f35('0x24')](respondWithResult(_0x3d081c,0xc9))[_0x4f35('0x46')](handleError(_0x3d081c,null));};exports['update']=function(_0x5acac3,_0x38c360){if(_0x5acac3['body']['id']){delete _0x5acac3[_0x4f35('0x48')]['id'];}return db['SquareReport'][_0x4f35('0x45')]({'where':{'id':_0x5acac3[_0x4f35('0x49')]['id']}})['then'](handleEntityNotFound(_0x38c360,null))[_0x4f35('0x24')](saveUpdates(_0x5acac3['body'],null))['then'](respondWithResult(_0x38c360,null))[_0x4f35('0x46')](handleError(_0x38c360,null));};exports[_0x4f35('0x23')]=function(_0x274b8b,_0xe995c){return db[_0x4f35('0x29')][_0x4f35('0x45')]({'where':{'id':_0x274b8b['params']['id']}})[_0x4f35('0x24')](handleEntityNotFound(_0xe995c,null))[_0x4f35('0x24')](removeEntity(_0xe995c,null))['catch'](handleError(_0xe995c,null));};exports['describe']=function(_0x47f083,_0x28e63c){return db[_0x4f35('0x29')][_0x4f35('0x4a')]()['then'](respondWithResult(_0x28e63c,null))['catch'](handleError(_0x28e63c,null));};
\ No newline at end of file
+var _0xfbdc=['save','update','then','end','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','find','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject'];(function(_0x22b0fe,_0x272c42){var _0x524663=function(_0x27ef71){while(--_0x27ef71){_0x22b0fe['push'](_0x22b0fe['shift']());}};_0x524663(++_0x272c42);}(_0xfbdc,0x1f2));var _0xcfbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbdc[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xcfbd('0x0'));var emlformat=require(_0xcfbd('0x1'));var rimraf=require(_0xcfbd('0x2'));var zipdir=require(_0xcfbd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfbd('0x4'));var moment=require(_0xcfbd('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcfbd('0x6'));var path=require(_0xcfbd('0x7'));var sox=require(_0xcfbd('0x8'));var csv=require(_0xcfbd('0x9'));var ejs=require(_0xcfbd('0xa'));var fs=require('fs');var _=require(_0xcfbd('0xb'));var squel=require(_0xcfbd('0xc'));var crypto=require(_0xcfbd('0xd'));var jsforce=require(_0xcfbd('0xe'));var deskjs=require(_0xcfbd('0xf'));var toCsv=require(_0xcfbd('0x9'));var querystring=require(_0xcfbd('0x10'));var Papa=require(_0xcfbd('0x11'));var Redis=require('ioredis');var authService=require(_0xcfbd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcfbd('0x13'));var hardwareService=require(_0xcfbd('0x14'));var logger=require(_0xcfbd('0x15'))(_0xcfbd('0x16'));var utils=require(_0xcfbd('0x17'));var config=require(_0xcfbd('0x18'));var db=require(_0xcfbd('0x19'))['db'];function respondWithStatusCode(_0x219ddd,_0x5ec254){_0x5ec254=_0x5ec254||0xcc;return function(_0x4e7d6c){if(_0x4e7d6c){return _0x219ddd[_0xcfbd('0x1a')](_0x5ec254);}return _0x219ddd[_0xcfbd('0x1b')](_0x5ec254)['end']();};}function respondWithResult(_0x4a0972,_0x13f535){_0x13f535=_0x13f535||0xc8;return function(_0x1fa55b){if(_0x1fa55b){return _0x4a0972[_0xcfbd('0x1b')](_0x13f535)[_0xcfbd('0x1c')](_0x1fa55b);}};}function respondWithFilteredResult(_0x3c3fbe,_0x5ab8be){return function(_0x4f9721){if(_0x4f9721){var _0x5dbd3b=_0x4f9721['count'],_0x2ebd28=_0x5ab8be[_0xcfbd('0x1d')],_0x2a6d1f=_0x5ab8be['offset']+_0x5ab8be[_0xcfbd('0x1e')],_0x23f621;if(_0x2a6d1f>=_0x5dbd3b){_0x2a6d1f=_0x5dbd3b;_0x23f621=0xc8;}else{_0x23f621=0xce;}_0x3c3fbe[_0xcfbd('0x1b')](_0x23f621);return _0x3c3fbe[_0xcfbd('0x1f')]('Content-Range',_0x2ebd28+'-'+_0x2a6d1f+'/'+_0x5dbd3b)['json'](_0x4f9721);}return null;};}function patchUpdates(_0x388f55){return function(_0x584adb){try{jsonpatch[_0xcfbd('0x20')](_0x584adb,_0x388f55,!![]);}catch(_0x5c20ac){return BPromise[_0xcfbd('0x21')](_0x5c20ac);}return _0x584adb[_0xcfbd('0x22')]();};}function saveUpdates(_0x1e3179,_0x2b2a23){return function(_0x3cd750){if(_0x3cd750){return _0x3cd750[_0xcfbd('0x23')](_0x1e3179)[_0xcfbd('0x24')](function(_0x1cd51c){return _0x1cd51c;});}return null;};}function removeEntity(_0x354e1a,_0x5d1bd3){return function(_0x660627){if(_0x660627){return _0x660627['destroy']()[_0xcfbd('0x24')](function(){_0x354e1a[_0xcfbd('0x1b')](0xcc)[_0xcfbd('0x25')]();});}};}function handleEntityNotFound(_0xbe9dc8,_0x55b46b){return function(_0x4573d5){if(!_0x4573d5){_0xbe9dc8[_0xcfbd('0x1a')](0x194);}return _0x4573d5;};}function handleError(_0x3bc7c3,_0x21b3e8){_0x21b3e8=_0x21b3e8||0x1f4;return function(_0x3e4e0d){logger[_0xcfbd('0x26')](_0x3e4e0d[_0xcfbd('0x27')]);if(_0x3e4e0d[_0xcfbd('0x28')]){delete _0x3e4e0d[_0xcfbd('0x28')];}_0x3bc7c3['status'](_0x21b3e8)[_0xcfbd('0x29')](_0x3e4e0d);};}exports[_0xcfbd('0x2a')]=function(_0x480310,_0x1a16e0){var _0x146d38={},_0x10cf7b={},_0x412117={'count':0x0,'rows':[]};var _0x57e7a9=_[_0xcfbd('0x2b')](db[_0xcfbd('0x2c')][_0xcfbd('0x2d')],function(_0x5a532b){return{'name':_0x5a532b[_0xcfbd('0x2e')],'type':_0x5a532b[_0xcfbd('0x2f')][_0xcfbd('0x30')]};});_0x10cf7b[_0xcfbd('0x31')]=_[_0xcfbd('0x2b')](_0x57e7a9,'name');_0x10cf7b[_0xcfbd('0x32')]=_[_0xcfbd('0x33')](_0x480310[_0xcfbd('0x32')]);_0x10cf7b['filters']=_[_0xcfbd('0x34')](_0x10cf7b['model'],_0x10cf7b[_0xcfbd('0x32')]);_0x146d38['attributes']=_[_0xcfbd('0x34')](_0x10cf7b[_0xcfbd('0x31')],qs[_0xcfbd('0x35')](_0x480310[_0xcfbd('0x32')][_0xcfbd('0x35')]));_0x146d38[_0xcfbd('0x36')]=_0x146d38['attributes']['length']?_0x146d38[_0xcfbd('0x36')]:_0x10cf7b[_0xcfbd('0x31')];if(!_0x480310['query'][_0xcfbd('0x37')](_0xcfbd('0x38'))){_0x146d38[_0xcfbd('0x1e')]=qs['limit'](_0x480310[_0xcfbd('0x32')][_0xcfbd('0x1e')]);_0x146d38[_0xcfbd('0x1d')]=qs['offset'](_0x480310[_0xcfbd('0x32')][_0xcfbd('0x1d')]);}_0x146d38[_0xcfbd('0x39')]=qs[_0xcfbd('0x3a')](_0x480310['query'][_0xcfbd('0x3a')]);_0x146d38[_0xcfbd('0x3b')]=qs[_0xcfbd('0x3c')](_[_0xcfbd('0x3d')](_0x480310['query'],_0x10cf7b['filters']),_0x57e7a9);if(_0x480310[_0xcfbd('0x32')][_0xcfbd('0x3e')]){_0x146d38[_0xcfbd('0x3b')]=_[_0xcfbd('0x3f')](_0x146d38['where'],{'$or':_[_0xcfbd('0x2b')](_0x57e7a9,function(_0x4e63fc){if(_0x4e63fc[_0xcfbd('0x2f')]!=='VIRTUAL'){var _0x11b553={};_0x11b553[_0x4e63fc[_0xcfbd('0x28')]]={'$like':'%'+_0x480310[_0xcfbd('0x32')][_0xcfbd('0x3e')]+'%'};return _0x11b553;}})});}_0x146d38=_[_0xcfbd('0x3f')]({},_0x146d38,_0x480310[_0xcfbd('0x40')]);var _0x5998bb={'where':_0x146d38['where']};return db[_0xcfbd('0x2c')][_0xcfbd('0x41')](_0x5998bb)[_0xcfbd('0x24')](function(_0x1683d4){_0x412117[_0xcfbd('0x41')]=_0x1683d4;if(_0x480310[_0xcfbd('0x32')][_0xcfbd('0x42')]){_0x146d38[_0xcfbd('0x43')]=[{'all':!![]}];}return db['SquareReport'][_0xcfbd('0x44')](_0x146d38);})['then'](function(_0x2f5c31){_0x412117['rows']=_0x2f5c31;return _0x412117;})[_0xcfbd('0x24')](respondWithFilteredResult(_0x1a16e0,_0x146d38))[_0xcfbd('0x45')](handleError(_0x1a16e0,null));};exports[_0xcfbd('0x46')]=function(_0x36f97d,_0x4d765f){var _0x1faed1={'raw':!![],'where':{'id':_0x36f97d[_0xcfbd('0x47')]['id']}},_0x3de256={};_0x3de256[_0xcfbd('0x31')]=_[_0xcfbd('0x33')](db[_0xcfbd('0x2c')][_0xcfbd('0x2d')]);_0x3de256[_0xcfbd('0x32')]=_[_0xcfbd('0x33')](_0x36f97d['query']);_0x3de256['filters']=_['intersection'](_0x3de256[_0xcfbd('0x31')],_0x3de256[_0xcfbd('0x32')]);_0x1faed1[_0xcfbd('0x36')]=_[_0xcfbd('0x34')](_0x3de256[_0xcfbd('0x31')],qs[_0xcfbd('0x35')](_0x36f97d[_0xcfbd('0x32')][_0xcfbd('0x35')]));_0x1faed1[_0xcfbd('0x36')]=_0x1faed1[_0xcfbd('0x36')]['length']?_0x1faed1[_0xcfbd('0x36')]:_0x3de256[_0xcfbd('0x31')];if(_0x36f97d['query'][_0xcfbd('0x42')]){_0x1faed1['include']=[{'all':!![]}];}_0x1faed1=_[_0xcfbd('0x3f')]({},_0x1faed1,_0x36f97d['options']);return db['SquareReport'][_0xcfbd('0x48')](_0x1faed1)[_0xcfbd('0x24')](handleEntityNotFound(_0x4d765f,null))[_0xcfbd('0x24')](respondWithResult(_0x4d765f,null))['catch'](handleError(_0x4d765f,null));};exports['create']=function(_0x9dd107,_0x1845e){return db[_0xcfbd('0x2c')]['create'](_0x9dd107[_0xcfbd('0x49')],{})['then'](respondWithResult(_0x1845e,0xc9))[_0xcfbd('0x45')](handleError(_0x1845e,null));};exports[_0xcfbd('0x23')]=function(_0x59bf34,_0x11ec77){if(_0x59bf34['body']['id']){delete _0x59bf34['body']['id'];}return db[_0xcfbd('0x2c')][_0xcfbd('0x48')]({'where':{'id':_0x59bf34[_0xcfbd('0x47')]['id']}})[_0xcfbd('0x24')](handleEntityNotFound(_0x11ec77,null))[_0xcfbd('0x24')](saveUpdates(_0x59bf34[_0xcfbd('0x49')],null))['then'](respondWithResult(_0x11ec77,null))[_0xcfbd('0x45')](handleError(_0x11ec77,null));};exports[_0xcfbd('0x4a')]=function(_0xab72f6,_0x15088a){return db['SquareReport']['find']({'where':{'id':_0xab72f6[_0xcfbd('0x47')]['id']}})[_0xcfbd('0x24')](handleEntityNotFound(_0x15088a,null))[_0xcfbd('0x24')](removeEntity(_0x15088a,null))['catch'](handleError(_0x15088a,null));};exports['describe']=function(_0x5291b4,_0x155831){return db[_0xcfbd('0x2c')][_0xcfbd('0x4b')]()['then'](respondWithResult(_0x155831,null))['catch'](handleError(_0x155831,null));};
\ No newline at end of file
index 14a0ee0..d501a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f1a=['report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment','request-promise','path','../../config/environment','exports','SquareReport'];(function(_0x510246,_0x6f2d18){var _0x19707e=function(_0x4834e7){while(--_0x4834e7){_0x510246['push'](_0x510246['shift']());}};_0x19707e(++_0x6f2d18);}(_0x1f1a,0x19b));var _0xa1f1=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1f1a[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xa1f1('0x0'));var util=require(_0xa1f1('0x1'));var logger=require('../../config/logger')(_0xa1f1('0x2'));var moment=require(_0xa1f1('0x3'));var BPromise=require('bluebird');var rp=require(_0xa1f1('0x4'));var fs=require('fs');var path=require(_0xa1f1('0x5'));var rimraf=require('rimraf');var config=require(_0xa1f1('0x6'));var attributes=require('./squareReport.attributes');module[_0xa1f1('0x7')]=function(_0x3fb4ce,_0x563cfe){return _0x3fb4ce['define'](_0xa1f1('0x8'),attributes,{'tableName':_0xa1f1('0x9'),'paranoid':![],'indexes':[{'name':_0xa1f1('0xa'),'fields':[_0xa1f1('0xb'),_0xa1f1('0xc')]},{'name':'leaveAt','fields':[_0xa1f1('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x616e=['define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment','request-promise','rimraf','./squareReport.attributes'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x616e,0x19d));var _0xe616=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0x616e[_0x40927b];return _0x2635e8;};'use strict';var _=require(_0xe616('0x0'));var util=require(_0xe616('0x1'));var logger=require('../../config/logger')(_0xe616('0x2'));var moment=require(_0xe616('0x3'));var BPromise=require('bluebird');var rp=require(_0xe616('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe616('0x5'));var config=require('../../config/environment');var attributes=require(_0xe616('0x6'));module['exports']=function(_0x6da7d1,_0x444534){return _0x6da7d1[_0xe616('0x7')](_0xe616('0x8'),attributes,{'tableName':_0xe616('0x9'),'paranoid':![],'indexes':[{'name':_0xe616('0xa'),'fields':[_0xe616('0xb'),_0xe616('0xc')]},{'name':_0xe616('0xd'),'fields':[_0xe616('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 68d3013..b79d929 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa01=['where','attributes','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfa01,0xa2));var _0x1fa0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfa01[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x1fa0('0x0'));var moment=require(_0x1fa0('0x1'));var BPromise=require(_0x1fa0('0x2'));var rs=require(_0x1fa0('0x3'));var fs=require('fs');var Redis=require(_0x1fa0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1fa0('0x5'))(_0x1fa0('0x6'));var config=require('../../config/environment');var jayson=require(_0x1fa0('0x7'));var client=jayson['client'][_0x1fa0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3134d2,_0x27f2d1,_0x3e0481){return new BPromise(function(_0x1edc20,_0x150a12){return client[_0x1fa0('0x9')](_0x3134d2,_0x3e0481)[_0x1fa0('0xa')](function(_0x59a72a){logger['info'](_0x1fa0('0xb'),_0x27f2d1,_0x1fa0('0xc'));logger[_0x1fa0('0xd')](_0x1fa0('0xe'),_0x27f2d1,'request\x20sent',JSON[_0x1fa0('0xf')](_0x59a72a));if(_0x59a72a[_0x1fa0('0x10')]){if(_0x59a72a[_0x1fa0('0x10')][_0x1fa0('0x11')]===0x1f4){logger[_0x1fa0('0x10')](_0x1fa0('0xb'),_0x27f2d1,_0x59a72a['error'][_0x1fa0('0x12')]);return _0x150a12(_0x59a72a['error'][_0x1fa0('0x12')]);}logger['error'](_0x1fa0('0xb'),_0x27f2d1,_0x59a72a[_0x1fa0('0x10')][_0x1fa0('0x12')]);return _0x1edc20(_0x59a72a[_0x1fa0('0x10')][_0x1fa0('0x12')]);}else{logger[_0x1fa0('0x13')](_0x1fa0('0xb'),_0x27f2d1,_0x1fa0('0xc'));_0x1edc20(_0x59a72a[_0x1fa0('0x14')][_0x1fa0('0x12')]);}})[_0x1fa0('0x15')](function(_0x1f5147){logger[_0x1fa0('0x10')](_0x1fa0('0xb'),_0x27f2d1,_0x1f5147);_0x150a12(_0x1f5147);});});}exports[_0x1fa0('0x16')]=function(_0x4e9b0f){var _0x1af804=this;return new Promise(function(_0x3d3260,_0xc750fd){return db['SquareReport'][_0x1fa0('0x17')](_0x4e9b0f[_0x1fa0('0x18')],{'raw':_0x4e9b0f[_0x1fa0('0x19')]?_0x4e9b0f['options'][_0x1fa0('0x1a')]===undefined?!![]:![]:!![]})[_0x1fa0('0xa')](function(_0x469529){logger['info'](_0x1fa0('0x16'),_0x4e9b0f);logger[_0x1fa0('0xd')](_0x1fa0('0x16'),_0x4e9b0f,JSON[_0x1fa0('0xf')](_0x469529));_0x3d3260(_0x469529);})['catch'](function(_0x28cc89){logger[_0x1fa0('0x10')]('CreateSquareReport',_0x28cc89['message'],_0x4e9b0f);_0xc750fd(_0x1af804[_0x1fa0('0x10')](0x1f4,_0x28cc89['message']));});});};exports[_0x1fa0('0x1b')]=function(_0x2e2c23){var _0x12bc31=this;return new Promise(function(_0x347698,_0x2f2726){return db[_0x1fa0('0x1c')][_0x1fa0('0x1d')](_0x2e2c23[_0x1fa0('0x18')],{'raw':_0x2e2c23[_0x1fa0('0x19')]?_0x2e2c23[_0x1fa0('0x19')][_0x1fa0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e2c23[_0x1fa0('0x19')]?_0x2e2c23['options'][_0x1fa0('0x1e')]||null:null,'attributes':_0x2e2c23[_0x1fa0('0x19')]?_0x2e2c23['options'][_0x1fa0('0x1f')]||null:null,'limit':_0x2e2c23[_0x1fa0('0x19')]?_0x2e2c23[_0x1fa0('0x19')]['limit']||null:null})[_0x1fa0('0xa')](function(_0x140552){logger[_0x1fa0('0x13')]('UpdateSquareReport',_0x2e2c23);logger[_0x1fa0('0xd')](_0x1fa0('0x1b'),_0x2e2c23,JSON[_0x1fa0('0xf')](_0x140552));_0x347698(_0x140552);})['catch'](function(_0x42975d){logger[_0x1fa0('0x10')](_0x1fa0('0x1b'),_0x42975d[_0x1fa0('0x12')],_0x2e2c23);_0x2f2726(_0x12bc31[_0x1fa0('0x10')](0x1f4,_0x42975d['message']));});});};
\ No newline at end of file
+var _0xa203=['update','where','attributes','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','create','options','raw','UpdateSquareReport','SquareReport'];(function(_0x17302a,_0x1af632){var _0x70f938=function(_0x25a995){while(--_0x25a995){_0x17302a['push'](_0x17302a['shift']());}};_0x70f938(++_0x1af632);}(_0xa203,0x1e3));var _0x3a20=function(_0x5c967a,_0x254ae5){_0x5c967a=_0x5c967a-0x0;var _0x412b4a=_0xa203[_0x5c967a];return _0x412b4a;};'use strict';var _=require(_0x3a20('0x0'));var util=require(_0x3a20('0x1'));var moment=require(_0x3a20('0x2'));var BPromise=require(_0x3a20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a20('0x4'))['db'];var utils=require(_0x3a20('0x5'));var logger=require(_0x3a20('0x6'))(_0x3a20('0x7'));var config=require(_0x3a20('0x8'));var jayson=require(_0x3a20('0x9'));var client=jayson[_0x3a20('0xa')][_0x3a20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x540320,_0x4b4d30,_0x3ae88e){return new BPromise(function(_0x201299,_0x3cf2c2){return client['request'](_0x540320,_0x3ae88e)[_0x3a20('0xc')](function(_0x26a578){logger[_0x3a20('0xd')](_0x3a20('0xe'),_0x4b4d30,_0x3a20('0xf'));logger[_0x3a20('0x10')](_0x3a20('0x11'),_0x4b4d30,_0x3a20('0xf'),JSON[_0x3a20('0x12')](_0x26a578));if(_0x26a578[_0x3a20('0x13')]){if(_0x26a578[_0x3a20('0x13')][_0x3a20('0x14')]===0x1f4){logger['error'](_0x3a20('0xe'),_0x4b4d30,_0x26a578[_0x3a20('0x13')][_0x3a20('0x15')]);return _0x3cf2c2(_0x26a578[_0x3a20('0x13')][_0x3a20('0x15')]);}logger[_0x3a20('0x13')](_0x3a20('0xe'),_0x4b4d30,_0x26a578[_0x3a20('0x13')]['message']);return _0x201299(_0x26a578[_0x3a20('0x13')][_0x3a20('0x15')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x4b4d30,'request\x20sent');_0x201299(_0x26a578['result'][_0x3a20('0x15')]);}})[_0x3a20('0x16')](function(_0x5dad9f){logger[_0x3a20('0x13')]('SquareReport,\x20%s,\x20%s',_0x4b4d30,_0x5dad9f);_0x3cf2c2(_0x5dad9f);});});}exports[_0x3a20('0x17')]=function(_0x37065c){var _0xdcabff=this;return new Promise(function(_0x573dbe,_0x1b5fa0){return db['SquareReport'][_0x3a20('0x18')](_0x37065c['body'],{'raw':_0x37065c[_0x3a20('0x19')]?_0x37065c[_0x3a20('0x19')][_0x3a20('0x1a')]===undefined?!![]:![]:!![]})[_0x3a20('0xc')](function(_0x3c5829){logger[_0x3a20('0xd')](_0x3a20('0x17'),_0x37065c);logger[_0x3a20('0x10')](_0x3a20('0x17'),_0x37065c,JSON['stringify'](_0x3c5829));_0x573dbe(_0x3c5829);})[_0x3a20('0x16')](function(_0x3a195f){logger[_0x3a20('0x13')](_0x3a20('0x17'),_0x3a195f[_0x3a20('0x15')],_0x37065c);_0x1b5fa0(_0xdcabff[_0x3a20('0x13')](0x1f4,_0x3a195f[_0x3a20('0x15')]));});});};exports[_0x3a20('0x1b')]=function(_0x2b2606){var _0x3a21cb=this;return new Promise(function(_0x3417c2,_0x33d2e3){return db[_0x3a20('0x1c')][_0x3a20('0x1d')](_0x2b2606['body'],{'raw':_0x2b2606['options']?_0x2b2606[_0x3a20('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b2606[_0x3a20('0x19')]?_0x2b2606[_0x3a20('0x19')][_0x3a20('0x1e')]||null:null,'attributes':_0x2b2606['options']?_0x2b2606['options'][_0x3a20('0x1f')]||null:null,'limit':_0x2b2606[_0x3a20('0x19')]?_0x2b2606[_0x3a20('0x19')]['limit']||null:null})[_0x3a20('0xc')](function(_0x4bafe4){logger[_0x3a20('0xd')](_0x3a20('0x1b'),_0x2b2606);logger[_0x3a20('0x10')](_0x3a20('0x1b'),_0x2b2606,JSON[_0x3a20('0x12')](_0x4bafe4));_0x3417c2(_0x4bafe4);})['catch'](function(_0x50e668){logger[_0x3a20('0x13')](_0x3a20('0x1b'),_0x50e668[_0x3a20('0x15')],_0x2b2606);_0x33d2e3(_0x3a21cb['error'](0x1f4,_0x50e668[_0x3a20('0x15')]));});});};
\ No newline at end of file
index 2227384..c38aec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x3b4d9e,_0x50544e){var _0x226d99=function(_0x3222a7){while(--_0x3222a7){_0x3b4d9e['push'](_0x3b4d9e['shift']());}};_0x226d99(++_0x50544e);}(_0x7a54,0x106));var _0x47a5=function(_0x496622,_0x28d192){_0x496622=_0x496622-0x0;var _0x5cbc4f=_0x7a54[_0x496622];return _0x5cbc4f;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router;
\ No newline at end of file
+var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x1185fa,_0x12f4a1){var _0xa6dcf6=function(_0x351edb){while(--_0x351edb){_0x1185fa['push'](_0x1185fa['shift']());}};_0xa6dcf6(++_0x12f4a1);}(_0x7a54,0x106));var _0x47a5=function(_0x1a44e3,_0x2d7e7c){_0x1a44e3=_0x1a44e3-0x0;var _0x867079=_0x7a54[_0x1a44e3];return _0x867079;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router;
\ No newline at end of file
index c082137..88081dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8051=['sequelize','exports','STRING'];(function(_0x44c8bc,_0x4b8f9c){var _0x17e4d9=function(_0x16f56b){while(--_0x16f56b){_0x44c8bc['push'](_0x44c8bc['shift']());}};_0x17e4d9(++_0x4b8f9c);}(_0x8051,0x195));var _0x1805=function(_0x280e10,_0x47a365){_0x280e10=_0x280e10-0x0;var _0xa134f2=_0x8051[_0x280e10];return _0xa134f2;};'use strict';var Sequelize=require(_0x1805('0x0'));module[_0x1805('0x1')]={'uniqueid':{'type':Sequelize[_0x1805('0x2')]},'node':{'type':Sequelize[_0x1805('0x2')]},'application':{'type':Sequelize[_0x1805('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x1805('0x2')]},'callerid':{'type':Sequelize[_0x1805('0x2')]}};
\ No newline at end of file
+var _0xc834=['STRING','TEXT','sequelize'];(function(_0x1749d4,_0x257a91){var _0xdc5f0d=function(_0x808f6b){while(--_0x808f6b){_0x1749d4['push'](_0x1749d4['shift']());}};_0xdc5f0d(++_0x257a91);}(_0xc834,0xf2));var _0x4c83=function(_0x21481c,_0x1b51ba){_0x21481c=_0x21481c-0x0;var _0x5dd77a=_0xc834[_0x21481c];return _0x5dd77a;};'use strict';var Sequelize=require(_0x4c83('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x4c83('0x1')]},'application':{'type':Sequelize[_0x4c83('0x1')]},'data':{'type':Sequelize[_0x4c83('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4c83('0x1')]}};
\ No newline at end of file
index c3bd75e..4ec4654 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd17d=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','rawAttributes','options','create','body','find','params','describe','html-pdf','rimraf','zip-dir','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x20ad5f,_0x16f7d9){var _0x2ba935=function(_0x158c95){while(--_0x158c95){_0x20ad5f['push'](_0x20ad5f['shift']());}};_0x2ba935(++_0x16f7d9);}(_0xd17d,0x151));var _0xdd17=function(_0xd1a6e0,_0x4617ff){_0xd1a6e0=_0xd1a6e0-0x0;var _0x15682e=_0xd17d[_0xd1a6e0];return _0x15682e;};'use strict';var pdf=require(_0xdd17('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdd17('0x1'));var zipdir=require(_0xdd17('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd17('0x3'));var util=require('util');var path=require(_0xdd17('0x4'));var sox=require(_0xdd17('0x5'));var csv=require('to-csv');var ejs=require(_0xdd17('0x6'));var fs=require('fs');var _=require(_0xdd17('0x7'));var squel=require(_0xdd17('0x8'));var crypto=require(_0xdd17('0x9'));var jsforce=require(_0xdd17('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdd17('0xb'));var querystring=require(_0xdd17('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdd17('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xdd17('0xe'));var hardwareService=require(_0xdd17('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xdd17('0x10'));var config=require(_0xdd17('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dc8e4,_0x4a89c8){_0x4a89c8=_0x4a89c8||0xcc;return function(_0x3858e2){if(_0x3858e2){return _0x5dc8e4[_0xdd17('0x12')](_0x4a89c8);}return _0x5dc8e4[_0xdd17('0x13')](_0x4a89c8)[_0xdd17('0x14')]();};}function respondWithResult(_0x39c064,_0x2a6509){_0x2a6509=_0x2a6509||0xc8;return function(_0x4ab9bf){if(_0x4ab9bf){return _0x39c064[_0xdd17('0x13')](_0x2a6509)[_0xdd17('0x15')](_0x4ab9bf);}};}function respondWithFilteredResult(_0x4be344,_0x315796){return function(_0x1aa735){if(_0x1aa735){var _0x13e349=_0x1aa735[_0xdd17('0x16')],_0x2dbd2b=_0x315796[_0xdd17('0x17')],_0x1e2fdb=_0x315796['offset']+_0x315796[_0xdd17('0x18')],_0x47ca67;if(_0x1e2fdb>=_0x13e349){_0x1e2fdb=_0x13e349;_0x47ca67=0xc8;}else{_0x47ca67=0xce;}_0x4be344[_0xdd17('0x13')](_0x47ca67);return _0x4be344[_0xdd17('0x19')](_0xdd17('0x1a'),_0x2dbd2b+'-'+_0x1e2fdb+'/'+_0x13e349)['json'](_0x1aa735);}return null;};}function patchUpdates(_0x4aacbf){return function(_0x1805fc){try{jsonpatch[_0xdd17('0x1b')](_0x1805fc,_0x4aacbf,!![]);}catch(_0x10d4b1){return BPromise['reject'](_0x10d4b1);}return _0x1805fc[_0xdd17('0x1c')]();};}function saveUpdates(_0x3d6994,_0x4b570d){return function(_0x492bd3){if(_0x492bd3){return _0x492bd3[_0xdd17('0x1d')](_0x3d6994)[_0xdd17('0x1e')](function(_0x551b5b){return _0x551b5b;});}return null;};}function removeEntity(_0x3435dc,_0x411e3b){return function(_0x18cce3){if(_0x18cce3){return _0x18cce3[_0xdd17('0x1f')]()[_0xdd17('0x1e')](function(){_0x3435dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c3523,_0x4dc53a){return function(_0x58af98){if(!_0x58af98){_0x3c3523[_0xdd17('0x12')](0x194);}return _0x58af98;};}function handleError(_0x566dcf,_0x1c0f2d){_0x1c0f2d=_0x1c0f2d||0x1f4;return function(_0x5dff5b){logger[_0xdd17('0x20')](_0x5dff5b[_0xdd17('0x21')]);if(_0x5dff5b[_0xdd17('0x22')]){delete _0x5dff5b[_0xdd17('0x22')];}_0x566dcf[_0xdd17('0x13')](_0x1c0f2d)[_0xdd17('0x23')](_0x5dff5b);};}exports[_0xdd17('0x24')]=function(_0x4c87ea,_0x459a07){var _0xccde3={},_0x2b87f8={},_0xa2e055={'count':0x0,'rows':[]};var _0x5c3edf=_[_0xdd17('0x25')](db[_0xdd17('0x26')]['rawAttributes'],function(_0x4d412d){return{'name':_0x4d412d[_0xdd17('0x27')],'type':_0x4d412d[_0xdd17('0x28')][_0xdd17('0x29')]};});_0x2b87f8[_0xdd17('0x2a')]=_[_0xdd17('0x25')](_0x5c3edf,'name');_0x2b87f8[_0xdd17('0x2b')]=_['keys'](_0x4c87ea[_0xdd17('0x2b')]);_0x2b87f8['filters']=_[_0xdd17('0x2c')](_0x2b87f8[_0xdd17('0x2a')],_0x2b87f8['query']);_0xccde3['attributes']=_[_0xdd17('0x2c')](_0x2b87f8[_0xdd17('0x2a')],qs[_0xdd17('0x2d')](_0x4c87ea[_0xdd17('0x2b')][_0xdd17('0x2d')]));_0xccde3[_0xdd17('0x2e')]=_0xccde3[_0xdd17('0x2e')][_0xdd17('0x2f')]?_0xccde3['attributes']:_0x2b87f8[_0xdd17('0x2a')];if(!_0x4c87ea[_0xdd17('0x2b')][_0xdd17('0x30')](_0xdd17('0x31'))){_0xccde3[_0xdd17('0x18')]=qs['limit'](_0x4c87ea[_0xdd17('0x2b')]['limit']);_0xccde3[_0xdd17('0x17')]=qs[_0xdd17('0x17')](_0x4c87ea[_0xdd17('0x2b')][_0xdd17('0x17')]);}_0xccde3['order']=qs[_0xdd17('0x32')](_0x4c87ea[_0xdd17('0x2b')][_0xdd17('0x32')]);_0xccde3[_0xdd17('0x33')]=qs[_0xdd17('0x34')](_[_0xdd17('0x35')](_0x4c87ea[_0xdd17('0x2b')],_0x2b87f8['filters']),_0x5c3edf);if(_0x4c87ea[_0xdd17('0x2b')][_0xdd17('0x36')]){_0xccde3['where']=_[_0xdd17('0x37')](_0xccde3[_0xdd17('0x33')],{'$or':_[_0xdd17('0x25')](_0x5c3edf,function(_0x189aba){if(_0x189aba[_0xdd17('0x28')]!==_0xdd17('0x38')){var _0xb47f05={};_0xb47f05[_0x189aba['name']]={'$like':'%'+_0x4c87ea[_0xdd17('0x2b')][_0xdd17('0x36')]+'%'};return _0xb47f05;}})});}_0xccde3=_[_0xdd17('0x37')]({},_0xccde3,_0x4c87ea['options']);var _0x11333d={'where':_0xccde3[_0xdd17('0x33')]};return db[_0xdd17('0x26')][_0xdd17('0x16')](_0x11333d)[_0xdd17('0x1e')](function(_0x282004){_0xa2e055[_0xdd17('0x16')]=_0x282004;if(_0x4c87ea['query'][_0xdd17('0x39')]){_0xccde3[_0xdd17('0x3a')]=[{'all':!![]}];}return db[_0xdd17('0x26')]['findAll'](_0xccde3);})[_0xdd17('0x1e')](function(_0x5ac458){_0xa2e055[_0xdd17('0x3b')]=_0x5ac458;return _0xa2e055;})[_0xdd17('0x1e')](respondWithFilteredResult(_0x459a07,_0xccde3))[_0xdd17('0x3c')](handleError(_0x459a07,null));};exports[_0xdd17('0x3d')]=function(_0x5ad44d,_0x1a631b){var _0x3b4ee8={'raw':!![],'where':{'id':_0x5ad44d['params']['id']}},_0x303d45={};_0x303d45[_0xdd17('0x2a')]=_[_0xdd17('0x3e')](db[_0xdd17('0x26')][_0xdd17('0x3f')]);_0x303d45[_0xdd17('0x2b')]=_['keys'](_0x5ad44d[_0xdd17('0x2b')]);_0x303d45['filters']=_[_0xdd17('0x2c')](_0x303d45['model'],_0x303d45[_0xdd17('0x2b')]);_0x3b4ee8['attributes']=_[_0xdd17('0x2c')](_0x303d45[_0xdd17('0x2a')],qs[_0xdd17('0x2d')](_0x5ad44d[_0xdd17('0x2b')][_0xdd17('0x2d')]));_0x3b4ee8[_0xdd17('0x2e')]=_0x3b4ee8[_0xdd17('0x2e')]['length']?_0x3b4ee8[_0xdd17('0x2e')]:_0x303d45['model'];if(_0x5ad44d[_0xdd17('0x2b')][_0xdd17('0x39')]){_0x3b4ee8[_0xdd17('0x3a')]=[{'all':!![]}];}_0x3b4ee8=_[_0xdd17('0x37')]({},_0x3b4ee8,_0x5ad44d[_0xdd17('0x40')]);return db[_0xdd17('0x26')]['find'](_0x3b4ee8)['then'](handleEntityNotFound(_0x1a631b,null))[_0xdd17('0x1e')](respondWithResult(_0x1a631b,null))[_0xdd17('0x3c')](handleError(_0x1a631b,null));};exports[_0xdd17('0x41')]=function(_0x397a7b,_0x38178f){return db['SquareDetailsReport']['create'](_0x397a7b[_0xdd17('0x42')],{})[_0xdd17('0x1e')](respondWithResult(_0x38178f,0xc9))[_0xdd17('0x3c')](handleError(_0x38178f,null));};exports[_0xdd17('0x1d')]=function(_0x18c414,_0x51dd0c){if(_0x18c414[_0xdd17('0x42')]['id']){delete _0x18c414[_0xdd17('0x42')]['id'];}return db[_0xdd17('0x26')][_0xdd17('0x43')]({'where':{'id':_0x18c414[_0xdd17('0x44')]['id']}})['then'](handleEntityNotFound(_0x51dd0c,null))[_0xdd17('0x1e')](saveUpdates(_0x18c414[_0xdd17('0x42')],null))[_0xdd17('0x1e')](respondWithResult(_0x51dd0c,null))[_0xdd17('0x3c')](handleError(_0x51dd0c,null));};exports[_0xdd17('0x1f')]=function(_0x3dcd61,_0x1976dd){return db[_0xdd17('0x26')][_0xdd17('0x43')]({'where':{'id':_0x3dcd61['params']['id']}})[_0xdd17('0x1e')](handleEntityNotFound(_0x1976dd,null))[_0xdd17('0x1e')](removeEntity(_0x1976dd,null))[_0xdd17('0x3c')](handleError(_0x1976dd,null));};exports[_0xdd17('0x45')]=function(_0x1a77e6,_0x55153c){return db['SquareDetailsReport'][_0xdd17('0x45')]()[_0xdd17('0x1e')](respondWithResult(_0x55153c,null))[_0xdd17('0x3c')](handleError(_0x55153c,null));};
\ No newline at end of file
+var _0xa0d8=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','SquareDetailsReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','include','findAll','params','rawAttributes','includeAll','find','catch','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xa0d8,0x10a));var _0x8a0d=function(_0x368e85,_0x5c6050){_0x368e85=_0x368e85-0x0;var _0x2a7d25=_0xa0d8[_0x368e85];return _0x2a7d25;};'use strict';var pdf=require(_0x8a0d('0x0'));var emlformat=require(_0x8a0d('0x1'));var rimraf=require(_0x8a0d('0x2'));var zipdir=require(_0x8a0d('0x3'));var jsonpatch=require(_0x8a0d('0x4'));var rp=require(_0x8a0d('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8a0d('0x6'));var util=require(_0x8a0d('0x7'));var path=require(_0x8a0d('0x8'));var sox=require(_0x8a0d('0x9'));var csv=require(_0x8a0d('0xa'));var ejs=require(_0x8a0d('0xb'));var fs=require('fs');var _=require(_0x8a0d('0xc'));var squel=require(_0x8a0d('0xd'));var crypto=require(_0x8a0d('0xe'));var jsforce=require(_0x8a0d('0xf'));var deskjs=require(_0x8a0d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a0d('0x11'));var Redis=require('ioredis');var authService=require(_0x8a0d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a0d('0x13'));var logger=require(_0x8a0d('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8a0d('0x15'))['db'];function respondWithStatusCode(_0x14f698,_0x3df5e5){_0x3df5e5=_0x3df5e5||0xcc;return function(_0x19e694){if(_0x19e694){return _0x14f698[_0x8a0d('0x16')](_0x3df5e5);}return _0x14f698['status'](_0x3df5e5)['end']();};}function respondWithResult(_0x160c1e,_0x531a42){_0x531a42=_0x531a42||0xc8;return function(_0x23a894){if(_0x23a894){return _0x160c1e[_0x8a0d('0x17')](_0x531a42)[_0x8a0d('0x18')](_0x23a894);}};}function respondWithFilteredResult(_0x29e2bb,_0x452117){return function(_0x224ad8){if(_0x224ad8){var _0x5862d3=_0x224ad8[_0x8a0d('0x19')],_0x38195a=_0x452117[_0x8a0d('0x1a')],_0x3a670a=_0x452117[_0x8a0d('0x1a')]+_0x452117[_0x8a0d('0x1b')],_0x28cf16;if(_0x3a670a>=_0x5862d3){_0x3a670a=_0x5862d3;_0x28cf16=0xc8;}else{_0x28cf16=0xce;}_0x29e2bb['status'](_0x28cf16);return _0x29e2bb[_0x8a0d('0x1c')](_0x8a0d('0x1d'),_0x38195a+'-'+_0x3a670a+'/'+_0x5862d3)['json'](_0x224ad8);}return null;};}function patchUpdates(_0x8ccbba){return function(_0x3514cf){try{jsonpatch['apply'](_0x3514cf,_0x8ccbba,!![]);}catch(_0x4a80be){return BPromise[_0x8a0d('0x1e')](_0x4a80be);}return _0x3514cf[_0x8a0d('0x1f')]();};}function saveUpdates(_0x39fbf6,_0x2a9e56){return function(_0x1ca8a3){if(_0x1ca8a3){return _0x1ca8a3['update'](_0x39fbf6)[_0x8a0d('0x20')](function(_0x35d90f){return _0x35d90f;});}return null;};}function removeEntity(_0x5e3288,_0xc0bdc0){return function(_0x337eaf){if(_0x337eaf){return _0x337eaf[_0x8a0d('0x21')]()[_0x8a0d('0x20')](function(){_0x5e3288['status'](0xcc)[_0x8a0d('0x22')]();});}};}function handleEntityNotFound(_0x2f4eed,_0x374228){return function(_0x472404){if(!_0x472404){_0x2f4eed[_0x8a0d('0x16')](0x194);}return _0x472404;};}function handleError(_0x270732,_0x1ff2fd){_0x1ff2fd=_0x1ff2fd||0x1f4;return function(_0x1d9042){logger[_0x8a0d('0x23')](_0x1d9042[_0x8a0d('0x24')]);if(_0x1d9042[_0x8a0d('0x25')]){delete _0x1d9042[_0x8a0d('0x25')];}_0x270732['status'](_0x1ff2fd)[_0x8a0d('0x26')](_0x1d9042);};}exports[_0x8a0d('0x27')]=function(_0x5ea4c7,_0x518352){var _0x43a062={},_0x1ea6d3={},_0x36bf18={'count':0x0,'rows':[]};var _0x3001cd=_['map'](db[_0x8a0d('0x28')]['rawAttributes'],function(_0x9842a5){return{'name':_0x9842a5[_0x8a0d('0x29')],'type':_0x9842a5[_0x8a0d('0x2a')]['key']};});_0x1ea6d3[_0x8a0d('0x2b')]=_[_0x8a0d('0x2c')](_0x3001cd,'name');_0x1ea6d3[_0x8a0d('0x2d')]=_[_0x8a0d('0x2e')](_0x5ea4c7[_0x8a0d('0x2d')]);_0x1ea6d3[_0x8a0d('0x2f')]=_[_0x8a0d('0x30')](_0x1ea6d3[_0x8a0d('0x2b')],_0x1ea6d3[_0x8a0d('0x2d')]);_0x43a062[_0x8a0d('0x31')]=_[_0x8a0d('0x30')](_0x1ea6d3['model'],qs['fields'](_0x5ea4c7[_0x8a0d('0x2d')][_0x8a0d('0x32')]));_0x43a062['attributes']=_0x43a062[_0x8a0d('0x31')][_0x8a0d('0x33')]?_0x43a062['attributes']:_0x1ea6d3[_0x8a0d('0x2b')];if(!_0x5ea4c7[_0x8a0d('0x2d')][_0x8a0d('0x34')]('nolimit')){_0x43a062[_0x8a0d('0x1b')]=qs['limit'](_0x5ea4c7['query']['limit']);_0x43a062[_0x8a0d('0x1a')]=qs[_0x8a0d('0x1a')](_0x5ea4c7[_0x8a0d('0x2d')]['offset']);}_0x43a062[_0x8a0d('0x35')]=qs[_0x8a0d('0x36')](_0x5ea4c7[_0x8a0d('0x2d')]['sort']);_0x43a062['where']=qs[_0x8a0d('0x2f')](_['pick'](_0x5ea4c7[_0x8a0d('0x2d')],_0x1ea6d3[_0x8a0d('0x2f')]),_0x3001cd);if(_0x5ea4c7[_0x8a0d('0x2d')]['filter']){_0x43a062[_0x8a0d('0x37')]=_[_0x8a0d('0x38')](_0x43a062[_0x8a0d('0x37')],{'$or':_[_0x8a0d('0x2c')](_0x3001cd,function(_0x40ff77){if(_0x40ff77[_0x8a0d('0x2a')]!==_0x8a0d('0x39')){var _0x2b4a8d={};_0x2b4a8d[_0x40ff77[_0x8a0d('0x25')]]={'$like':'%'+_0x5ea4c7[_0x8a0d('0x2d')]['filter']+'%'};return _0x2b4a8d;}})});}_0x43a062=_[_0x8a0d('0x38')]({},_0x43a062,_0x5ea4c7[_0x8a0d('0x3a')]);var _0x4c1fd4={'where':_0x43a062[_0x8a0d('0x37')]};return db[_0x8a0d('0x28')]['count'](_0x4c1fd4)[_0x8a0d('0x20')](function(_0x29b4d0){_0x36bf18['count']=_0x29b4d0;if(_0x5ea4c7[_0x8a0d('0x2d')]['includeAll']){_0x43a062[_0x8a0d('0x3b')]=[{'all':!![]}];}return db[_0x8a0d('0x28')][_0x8a0d('0x3c')](_0x43a062);})['then'](function(_0x402405){_0x36bf18['rows']=_0x402405;return _0x36bf18;})[_0x8a0d('0x20')](respondWithFilteredResult(_0x518352,_0x43a062))['catch'](handleError(_0x518352,null));};exports['show']=function(_0x40f59a,_0xe37709){var _0x11a3c2={'raw':!![],'where':{'id':_0x40f59a[_0x8a0d('0x3d')]['id']}},_0x137f58={};_0x137f58[_0x8a0d('0x2b')]=_[_0x8a0d('0x2e')](db[_0x8a0d('0x28')][_0x8a0d('0x3e')]);_0x137f58['query']=_[_0x8a0d('0x2e')](_0x40f59a['query']);_0x137f58[_0x8a0d('0x2f')]=_['intersection'](_0x137f58[_0x8a0d('0x2b')],_0x137f58[_0x8a0d('0x2d')]);_0x11a3c2[_0x8a0d('0x31')]=_[_0x8a0d('0x30')](_0x137f58[_0x8a0d('0x2b')],qs[_0x8a0d('0x32')](_0x40f59a['query'][_0x8a0d('0x32')]));_0x11a3c2[_0x8a0d('0x31')]=_0x11a3c2[_0x8a0d('0x31')][_0x8a0d('0x33')]?_0x11a3c2[_0x8a0d('0x31')]:_0x137f58[_0x8a0d('0x2b')];if(_0x40f59a[_0x8a0d('0x2d')][_0x8a0d('0x3f')]){_0x11a3c2['include']=[{'all':!![]}];}_0x11a3c2=_[_0x8a0d('0x38')]({},_0x11a3c2,_0x40f59a['options']);return db['SquareDetailsReport'][_0x8a0d('0x40')](_0x11a3c2)[_0x8a0d('0x20')](handleEntityNotFound(_0xe37709,null))['then'](respondWithResult(_0xe37709,null))[_0x8a0d('0x41')](handleError(_0xe37709,null));};exports['create']=function(_0x5bb44b,_0x4cd373){return db[_0x8a0d('0x28')][_0x8a0d('0x42')](_0x5bb44b['body'],{})[_0x8a0d('0x20')](respondWithResult(_0x4cd373,0xc9))[_0x8a0d('0x41')](handleError(_0x4cd373,null));};exports[_0x8a0d('0x43')]=function(_0x35f66b,_0x3531f1){if(_0x35f66b[_0x8a0d('0x44')]['id']){delete _0x35f66b[_0x8a0d('0x44')]['id'];}return db[_0x8a0d('0x28')]['find']({'where':{'id':_0x35f66b['params']['id']}})['then'](handleEntityNotFound(_0x3531f1,null))[_0x8a0d('0x20')](saveUpdates(_0x35f66b[_0x8a0d('0x44')],null))['then'](respondWithResult(_0x3531f1,null))[_0x8a0d('0x41')](handleError(_0x3531f1,null));};exports[_0x8a0d('0x21')]=function(_0x37a6e0,_0x48f15d){return db[_0x8a0d('0x28')][_0x8a0d('0x40')]({'where':{'id':_0x37a6e0['params']['id']}})[_0x8a0d('0x20')](handleEntityNotFound(_0x48f15d,null))[_0x8a0d('0x20')](removeEntity(_0x48f15d,null))['catch'](handleError(_0x48f15d,null));};exports[_0x8a0d('0x45')]=function(_0x1c69bf,_0x4c1d04){return db[_0x8a0d('0x28')][_0x8a0d('0x45')]()[_0x8a0d('0x20')](respondWithResult(_0x4c1d04,null))[_0x8a0d('0x41')](handleError(_0x4c1d04,null));};
\ No newline at end of file
index 867fbf0..d7c3c9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30e9=['exports','define','report_square_details','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x25904d,_0x36b24a){var _0x168529=function(_0xce33d4){while(--_0xce33d4){_0x25904d['push'](_0x25904d['shift']());}};_0x168529(++_0x36b24a);}(_0x30e9,0x121));var _0x930e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x30e9[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x930e('0x0'));var util=require(_0x930e('0x1'));var logger=require(_0x930e('0x2'))('api');var moment=require(_0x930e('0x3'));var BPromise=require(_0x930e('0x4'));var rp=require(_0x930e('0x5'));var fs=require('fs');var path=require(_0x930e('0x6'));var rimraf=require(_0x930e('0x7'));var config=require(_0x930e('0x8'));var attributes=require(_0x930e('0x9'));module[_0x930e('0xa')]=function(_0x45fd3b,_0xf4758b){return _0x45fd3b[_0x930e('0xb')]('SquareDetailsReport',attributes,{'tableName':_0x930e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d6f=['api','bluebird','path','exports','define','report_square_details','lodash','util','../../config/logger'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x0d6f,0xb1));var _0xf0d6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0d6f[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xf0d6('0x0'));var util=require(_0xf0d6('0x1'));var logger=require(_0xf0d6('0x2'))(_0xf0d6('0x3'));var moment=require('moment');var BPromise=require(_0xf0d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0d6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xf0d6('0x6')]=function(_0x5ef764,_0x1060d2){return _0x5ef764[_0xf0d6('0x7')]('SquareDetailsReport',attributes,{'tableName':_0xf0d6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 47fc7bd..acab6a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f57=['body','options','raw','stringify','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x47abbe,_0x159fb4){var _0x3c2f3e=function(_0x3f3e70){while(--_0x3f3e70){_0x47abbe['push'](_0x47abbe['shift']());}};_0x3c2f3e(++_0x159fb4);}(_0x8f57,0x1a9));var _0x78f5=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0x8f57[_0x5192de];return _0x4e287e;};'use strict';var _=require(_0x78f5('0x0'));var util=require('util');var moment=require(_0x78f5('0x1'));var BPromise=require('bluebird');var rs=require(_0x78f5('0x2'));var fs=require('fs');var Redis=require(_0x78f5('0x3'));var db=require(_0x78f5('0x4'))['db'];var utils=require(_0x78f5('0x5'));var logger=require(_0x78f5('0x6'))(_0x78f5('0x7'));var config=require(_0x78f5('0x8'));var jayson=require(_0x78f5('0x9'));var client=jayson[_0x78f5('0xa')][_0x78f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x350fef,_0x3c0baa,_0x3318af){return new BPromise(function(_0x259e3d,_0x3f4245){return client[_0x78f5('0xc')](_0x350fef,_0x3318af)[_0x78f5('0xd')](function(_0x45fdfc){logger[_0x78f5('0xe')](_0x78f5('0xf'),_0x3c0baa,_0x78f5('0x10'));logger[_0x78f5('0x11')](_0x78f5('0x12'),_0x3c0baa,_0x78f5('0x10'),JSON['stringify'](_0x45fdfc));if(_0x45fdfc[_0x78f5('0x13')]){if(_0x45fdfc[_0x78f5('0x13')][_0x78f5('0x14')]===0x1f4){logger[_0x78f5('0x13')](_0x78f5('0xf'),_0x3c0baa,_0x45fdfc[_0x78f5('0x13')][_0x78f5('0x15')]);return _0x3f4245(_0x45fdfc[_0x78f5('0x13')][_0x78f5('0x15')]);}logger[_0x78f5('0x13')](_0x78f5('0xf'),_0x3c0baa,_0x45fdfc[_0x78f5('0x13')][_0x78f5('0x15')]);return _0x259e3d(_0x45fdfc[_0x78f5('0x13')][_0x78f5('0x15')]);}else{logger[_0x78f5('0xe')](_0x78f5('0xf'),_0x3c0baa,_0x78f5('0x10'));_0x259e3d(_0x45fdfc['result'][_0x78f5('0x15')]);}})['catch'](function(_0x575b5d){logger['error'](_0x78f5('0xf'),_0x3c0baa,_0x575b5d);_0x3f4245(_0x575b5d);});});}exports[_0x78f5('0x16')]=function(_0x395c79){var _0x27d020=this;return new Promise(function(_0x2603ac,_0x2e7ff1){return db[_0x78f5('0x17')][_0x78f5('0x18')](_0x395c79[_0x78f5('0x19')],{'raw':_0x395c79[_0x78f5('0x1a')]?_0x395c79[_0x78f5('0x1a')][_0x78f5('0x1b')]===undefined?!![]:![]:!![]})[_0x78f5('0xd')](function(_0x4756a8){logger['info'](_0x78f5('0x16'),_0x395c79);logger[_0x78f5('0x11')](_0x78f5('0x16'),_0x395c79,JSON[_0x78f5('0x1c')](_0x4756a8));_0x2603ac(_0x4756a8);})[_0x78f5('0x1d')](function(_0xb794b4){logger[_0x78f5('0x13')](_0x78f5('0x16'),_0xb794b4[_0x78f5('0x15')],_0x395c79);_0x2e7ff1(_0x27d020[_0x78f5('0x13')](0x1f4,_0xb794b4['message']));});});};
\ No newline at end of file
+var _0xea26=['request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSquareDetailsReport','create','options','raw','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x6cf5ec,_0x194d2e){var _0x271c4f=function(_0x206fee){while(--_0x206fee){_0x6cf5ec['push'](_0x6cf5ec['shift']());}};_0x271c4f(++_0x194d2e);}(_0xea26,0x17c));var _0x6ea2=function(_0x37fbf5,_0x4f80fb){_0x37fbf5=_0x37fbf5-0x0;var _0x155886=_0xea26[_0x37fbf5];return _0x155886;};'use strict';var _=require(_0x6ea2('0x0'));var util=require('util');var moment=require(_0x6ea2('0x1'));var BPromise=require(_0x6ea2('0x2'));var rs=require(_0x6ea2('0x3'));var fs=require('fs');var Redis=require(_0x6ea2('0x4'));var db=require(_0x6ea2('0x5'))['db'];var utils=require(_0x6ea2('0x6'));var logger=require(_0x6ea2('0x7'))(_0x6ea2('0x8'));var config=require(_0x6ea2('0x9'));var jayson=require(_0x6ea2('0xa'));var client=jayson[_0x6ea2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42bc59,_0x1e272e,_0x940827){return new BPromise(function(_0x13d9ae,_0x6b8322){return client[_0x6ea2('0xc')](_0x42bc59,_0x940827)[_0x6ea2('0xd')](function(_0x4bf5a4){logger[_0x6ea2('0xe')](_0x6ea2('0xf'),_0x1e272e,'request\x20sent');logger['debug'](_0x6ea2('0x10'),_0x1e272e,_0x6ea2('0x11'),JSON['stringify'](_0x4bf5a4));if(_0x4bf5a4[_0x6ea2('0x12')]){if(_0x4bf5a4[_0x6ea2('0x12')]['code']===0x1f4){logger[_0x6ea2('0x12')](_0x6ea2('0xf'),_0x1e272e,_0x4bf5a4[_0x6ea2('0x12')][_0x6ea2('0x13')]);return _0x6b8322(_0x4bf5a4[_0x6ea2('0x12')][_0x6ea2('0x13')]);}logger[_0x6ea2('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x1e272e,_0x4bf5a4[_0x6ea2('0x12')]['message']);return _0x13d9ae(_0x4bf5a4[_0x6ea2('0x12')]['message']);}else{logger['info'](_0x6ea2('0xf'),_0x1e272e,_0x6ea2('0x11'));_0x13d9ae(_0x4bf5a4[_0x6ea2('0x14')][_0x6ea2('0x13')]);}})[_0x6ea2('0x15')](function(_0x122283){logger[_0x6ea2('0x12')](_0x6ea2('0xf'),_0x1e272e,_0x122283);_0x6b8322(_0x122283);});});}exports[_0x6ea2('0x16')]=function(_0x1d5bc3){var _0x457769=this;return new Promise(function(_0x23a2f7,_0x3bdd8f){return db['SquareDetailsReport'][_0x6ea2('0x17')](_0x1d5bc3['body'],{'raw':_0x1d5bc3[_0x6ea2('0x18')]?_0x1d5bc3['options'][_0x6ea2('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2173c8){logger['info'](_0x6ea2('0x16'),_0x1d5bc3);logger[_0x6ea2('0x1a')](_0x6ea2('0x16'),_0x1d5bc3,JSON[_0x6ea2('0x1b')](_0x2173c8));_0x23a2f7(_0x2173c8);})[_0x6ea2('0x15')](function(_0x30302e){logger[_0x6ea2('0x12')](_0x6ea2('0x16'),_0x30302e[_0x6ea2('0x13')],_0x1d5bc3);_0x3bdd8f(_0x457769[_0x6ea2('0x12')](0x1f4,_0x30302e['message']));});});};
\ No newline at end of file
index fb42d7d..82ea795 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3711=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x8a1ba2,_0x83689c){var _0x1eb48d=function(_0x3fd16e){while(--_0x3fd16e){_0x8a1ba2['push'](_0x8a1ba2['shift']());}};_0x1eb48d(++_0x83689c);}(_0x3711,0x198));var _0x1371=function(_0x57c1c2,_0x48b93b){_0x57c1c2=_0x57c1c2-0x0;var _0x4ccc5d=_0x3711[_0x57c1c2];return _0x4ccc5d;};'use strict';var express=require(_0x1371('0x0'));var router=express[_0x1371('0x1')]();var auth=require(_0x1371('0x2'));var controller=require(_0x1371('0x3'));router[_0x1371('0x4')]('/',auth[_0x1371('0x5')](),controller[_0x1371('0x6')]);router[_0x1371('0x4')](_0x1371('0x7'),auth[_0x1371('0x5')](),controller[_0x1371('0x8')]);module[_0x1371('0x9')]=router;
\ No newline at end of file
+var _0xdd23=['get','killProcess','exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x27f847,_0x37591b){var _0x4c19c7=function(_0x28f310){while(--_0x28f310){_0x27f847['push'](_0x27f847['shift']());}};_0x4c19c7(++_0x37591b);}(_0xdd23,0xab));var _0x3dd2=function(_0x123d23,_0x2b6282){_0x123d23=_0x123d23-0x0;var _0x183491=_0xdd23[_0x123d23];return _0x183491;};'use strict';var express=require(_0x3dd2('0x0'));var router=express[_0x3dd2('0x1')]();var auth=require(_0x3dd2('0x2'));var controller=require(_0x3dd2('0x3'));router['get']('/',auth[_0x3dd2('0x4')](),controller['index']);router[_0x3dd2('0x5')]('/process/:pid/kill',auth[_0x3dd2('0x4')](),controller[_0x3dd2('0x6')]);module[_0x3dd2('0x7')]=router;
\ No newline at end of file
index 4635279..684d785 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc592=['status','send','index','getAllData','then','catch','json','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','util','bluebird','lodash','error','inspect','name'];(function(_0x5aca83,_0xf8ceb0){var _0x387288=function(_0x2823ee){while(--_0x2823ee){_0x5aca83['push'](_0x5aca83['shift']());}};_0x387288(++_0xf8ceb0);}(_0xc592,0x18c));var _0x2c59=function(_0x2b3816,_0xf0f73c){_0x2b3816=_0x2b3816-0x0;var _0x50e286=_0xc592[_0x2b3816];return _0x50e286;};'use strict';var info=require(_0x2c59('0x0'));var exec=require(_0x2c59('0x1'))['exec'];var logger=require(_0x2c59('0x2'))('api');var util=require(_0x2c59('0x3'));var BPromise=require(_0x2c59('0x4'));var _=require(_0x2c59('0x5'));function handleError(_0x20923a,_0x2244f1,_0xcb96ea){_0x2244f1=_0x2244f1||0x1f4;return function(_0x4f71b3){logger[_0x2c59('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0xcb96ea,_0x2244f1,util[_0x2c59('0x7')](_0x4f71b3,{'showHidden':![],'depth':null}));delete _0x4f71b3[_0x2c59('0x8')];_0x20923a[_0x2c59('0x9')](_0x2244f1)[_0x2c59('0xa')](_0x4f71b3);};}exports[_0x2c59('0xb')]=function(_0x49906f,_0x5576a7){return info[_0x2c59('0xc')]()[_0x2c59('0xd')](function(_0x8c95f8){return _0x5576a7[_0x2c59('0x9')](0xc8)['json'](_0x8c95f8);})[_0x2c59('0xe')](function(_0x16850b){return _0x5576a7['status'](0x1f4)[_0x2c59('0xf')](_0x16850b);});};exports[_0x2c59('0x10')]=function(_0xe5641f,_0x2e181e){var _0x14f73d=['components/import/cm'];return new BPromise(function(_0x4a247a,_0x3dd4cb){return exec(util['format'](_0x2c59('0x11'),_0xe5641f[_0x2c59('0x12')][_0x2c59('0x13')]),function(_0x3d9faf,_0x48ba4b,_0x325e5b){if(_0x3d9faf){return _0x3dd4cb(_0x3d9faf);}return _0x4a247a(_0x48ba4b);});})[_0x2c59('0xd')](function(_0x14bdb9){var _0xb6ff7a=![];var _0x30036a=_0x14bdb9[_0x2c59('0x14')](/\n/);for(var _0x54febf=0x0,_0x20a003=_0x14f73d[_0x2c59('0x15')];_0x54febf<_0x20a003,_0xb6ff7a===![];_0x54febf+=0x1){if(_0x14bdb9[_0x2c59('0x16')](_0x14f73d[_0x54febf])>=0x0){_0xb6ff7a=!![];}}if(!_0xb6ff7a){throw new Error(util[_0x2c59('0x17')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xe5641f[_0x2c59('0x12')][_0x2c59('0x13')]));}process[_0x2c59('0x18')](_0xe5641f[_0x2c59('0x12')][_0x2c59('0x13')],_0x2c59('0x19'));return _0x2e181e[_0x2c59('0x9')](0xc8)[_0x2c59('0xf')]({'message':util[_0x2c59('0x17')](_0x2c59('0x1a'),_0xe5641f[_0x2c59('0x12')][_0x2c59('0x13')])});})[_0x2c59('0xe')](handleError(_0x2e181e,null,_0x2c59('0x10')));};
\ No newline at end of file
+var _0x7785=['exec','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','catch','json','killProcess','components/import/cm','format','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x1cd7bb,_0x470ef2){var _0x8a027a=function(_0x1e91cb){while(--_0x1e91cb){_0x1cd7bb['push'](_0x1cd7bb['shift']());}};_0x8a027a(++_0x470ef2);}(_0x7785,0x104));var _0x5778=function(_0x23e2f7,_0x3d7f7d){_0x23e2f7=_0x23e2f7-0x0;var _0x36641f=_0x7785[_0x23e2f7];return _0x36641f;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x5778('0x0')];var logger=require(_0x5778('0x1'))('api');var util=require(_0x5778('0x2'));var BPromise=require(_0x5778('0x3'));var _=require('lodash');function handleError(_0x49020d,_0x4e9b45,_0x45ee54){_0x4e9b45=_0x4e9b45||0x1f4;return function(_0x49b279){logger[_0x5778('0x4')](_0x5778('0x5'),_0x45ee54,_0x4e9b45,util[_0x5778('0x6')](_0x49b279,{'showHidden':![],'depth':null}));delete _0x49b279[_0x5778('0x7')];_0x49020d[_0x5778('0x8')](_0x4e9b45)[_0x5778('0x9')](_0x49b279);};}exports[_0x5778('0xa')]=function(_0x24f14d,_0x22e243){return info['getAllData']()[_0x5778('0xb')](function(_0x55d1b8){return _0x22e243[_0x5778('0x8')](0xc8)['json'](_0x55d1b8);})[_0x5778('0xc')](function(_0x18aa8c){return _0x22e243['status'](0x1f4)[_0x5778('0xd')](_0x18aa8c);});};exports[_0x5778('0xe')]=function(_0x3a8391,_0x59f377){var _0x19c079=[_0x5778('0xf')];return new BPromise(function(_0x2e992d,_0x278fb6){return exec(util[_0x5778('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x3a8391[_0x5778('0x11')][_0x5778('0x12')]),function(_0x3539db,_0x34ab27,_0x3b5c45){if(_0x3539db){return _0x278fb6(_0x3539db);}return _0x2e992d(_0x34ab27);});})['then'](function(_0x15e860){var _0x1111e7=![];var _0x51c62a=_0x15e860[_0x5778('0x13')](/\n/);for(var _0x265ba3=0x0,_0x236ec1=_0x19c079[_0x5778('0x14')];_0x265ba3<_0x236ec1,_0x1111e7===![];_0x265ba3+=0x1){if(_0x15e860[_0x5778('0x15')](_0x19c079[_0x265ba3])>=0x0){_0x1111e7=!![];}}if(!_0x1111e7){throw new Error(util['format'](_0x5778('0x16'),_0x3a8391[_0x5778('0x11')][_0x5778('0x12')]));}process[_0x5778('0x17')](_0x3a8391[_0x5778('0x11')][_0x5778('0x12')],_0x5778('0x18'));return _0x59f377[_0x5778('0x8')](0xc8)[_0x5778('0xd')]({'message':util[_0x5778('0x10')](_0x5778('0x19'),_0x3a8391[_0x5778('0x11')][_0x5778('0x12')])});})['catch'](handleError(_0x59f377,null,_0x5778('0xe')));};
\ No newline at end of file
index f4dc8e3..997fa10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['/:id','isAuthenticated','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x2dfb77,_0x9b4e41){var _0x12ad92=function(_0x5d87f5){while(--_0x5d87f5){_0x2dfb77['push'](_0x2dfb77['shift']());}};_0x12ad92(++_0x9b4e41);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['post']('/',auth[_0x49c4('0x9')](),controller[_0x49c4('0xb')]);router[_0x49c4('0xc')](_0x49c4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x49c4('0xd')](_0x49c4('0x8'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router;
\ No newline at end of file
+var _0x55e0=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55e0,0xdc));var _0x055e=function(_0x4880fc,_0x407738){_0x4880fc=_0x4880fc-0x0;var _0x22d8e8=_0x55e0[_0x4880fc];return _0x22d8e8;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x055e('0x4'));var interaction=require(_0x055e('0x5'));var config=require(_0x055e('0x6'));var controller=require(_0x055e('0x7'));router[_0x055e('0x8')]('/',auth[_0x055e('0x9')](),controller['index']);router['get'](_0x055e('0xa'),auth['isAuthenticated'](),controller[_0x055e('0xb')]);router[_0x055e('0xc')]('/',auth[_0x055e('0x9')](),controller[_0x055e('0xd')]);router[_0x055e('0xe')]('/:id',auth[_0x055e('0x9')](),controller[_0x055e('0xf')]);router[_0x055e('0x10')](_0x055e('0xa'),auth[_0x055e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index a9bcfb1..dd092aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['name','#0091EA','STRING'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3342('0x0')],'defaultValue':_0x3342('0x2')},'description':{'type':Sequelize[_0x3342('0x0')]}};
\ No newline at end of file
+var _0xea28=['exports','STRING','name','#0091EA','sequelize'];(function(_0x5966e8,_0x347554){var _0x2ec39f=function(_0x339c2e){while(--_0x339c2e){_0x5966e8['push'](_0x5966e8['shift']());}};_0x2ec39f(++_0x347554);}(_0xea28,0x13a));var _0x8ea2=function(_0x51c516,_0xb48835){_0x51c516=_0x51c516-0x0;var _0x41ce48=_0xea28[_0x51c516];return _0x41ce48;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'name':{'type':Sequelize[_0x8ea2('0x2')],'unique':_0x8ea2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':_0x8ea2('0x4')},'description':{'type':Sequelize[_0x8ea2('0x2')]}};
\ No newline at end of file
index efe8d7e..555255e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cdb=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','findAll','rows','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir','request-promise','moment','bluebird','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','map','Tag','rawAttributes','fieldName','type','key'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0cdb,0x1aa));var _0xb0cd=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0x0cdb[_0x53f608];return _0x495b7d;};'use strict';var pdf=require(_0xb0cd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb0cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0cd('0x2'));var moment=require(_0xb0cd('0x3'));var BPromise=require(_0xb0cd('0x4'));var Mustache=require('mustache');var util=require(_0xb0cd('0x5'));var path=require(_0xb0cd('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb0cd('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb0cd('0x8'));var crypto=require(_0xb0cd('0x9'));var jsforce=require(_0xb0cd('0xa'));var deskjs=require(_0xb0cd('0xb'));var toCsv=require(_0xb0cd('0xc'));var querystring=require(_0xb0cd('0xd'));var Papa=require(_0xb0cd('0xe'));var Redis=require(_0xb0cd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb0cd('0x10'));var as=require(_0xb0cd('0x11'));var hardwareService=require(_0xb0cd('0x12'));var logger=require(_0xb0cd('0x13'))('api');var utils=require(_0xb0cd('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d71ea,_0x491eaa){_0x491eaa=_0x491eaa||0xcc;return function(_0x2d9298){if(_0x2d9298){return _0x1d71ea[_0xb0cd('0x15')](_0x491eaa);}return _0x1d71ea['status'](_0x491eaa)[_0xb0cd('0x16')]();};}function respondWithResult(_0x1742e0,_0x3da0d2){_0x3da0d2=_0x3da0d2||0xc8;return function(_0x1ab0be){if(_0x1ab0be){return _0x1742e0[_0xb0cd('0x17')](_0x3da0d2)[_0xb0cd('0x18')](_0x1ab0be);}};}function respondWithFilteredResult(_0x43d2e4,_0x2a9ac0){return function(_0x2f234d){if(_0x2f234d){var _0x59ccb6=_0x2f234d[_0xb0cd('0x19')],_0x3db6d6=_0x2a9ac0['offset'],_0x3528fd=_0x2a9ac0[_0xb0cd('0x1a')]+_0x2a9ac0[_0xb0cd('0x1b')],_0xbe8ee9;if(_0x3528fd>=_0x59ccb6){_0x3528fd=_0x59ccb6;_0xbe8ee9=0xc8;}else{_0xbe8ee9=0xce;}_0x43d2e4[_0xb0cd('0x17')](_0xbe8ee9);return _0x43d2e4['set'](_0xb0cd('0x1c'),_0x3db6d6+'-'+_0x3528fd+'/'+_0x59ccb6)[_0xb0cd('0x18')](_0x2f234d);}return null;};}function patchUpdates(_0x5eb0da){return function(_0x18c9e5){try{jsonpatch[_0xb0cd('0x1d')](_0x18c9e5,_0x5eb0da,!![]);}catch(_0xd275cf){return BPromise[_0xb0cd('0x1e')](_0xd275cf);}return _0x18c9e5[_0xb0cd('0x1f')]();};}function saveUpdates(_0x29c667,_0x342f21){return function(_0x419e1b){if(_0x419e1b){return _0x419e1b[_0xb0cd('0x20')](_0x29c667)[_0xb0cd('0x21')](function(_0x4b952e){return _0x4b952e;});}return null;};}function removeEntity(_0x5e5341,_0x153996){return function(_0x134479){if(_0x134479){return _0x134479[_0xb0cd('0x22')]()[_0xb0cd('0x21')](function(){var _0x31c5bd=_0x134479[_0xb0cd('0x23')]({'plain':!![]});var _0x341e52=_0xb0cd('0x24');return db[_0xb0cd('0x25')]['destroy']({'where':{'type':_0x341e52,'resourceId':_0x31c5bd['id']}})[_0xb0cd('0x21')](function(){return _0x134479;});})[_0xb0cd('0x21')](function(){_0x5e5341['status'](0xcc)[_0xb0cd('0x16')]();});}};}function handleEntityNotFound(_0xaa0b89,_0x393472){return function(_0x24fb25){if(!_0x24fb25){_0xaa0b89[_0xb0cd('0x15')](0x194);}return _0x24fb25;};}function handleError(_0x5cfb80,_0x4d021e){_0x4d021e=_0x4d021e||0x1f4;return function(_0x483c4b){logger[_0xb0cd('0x26')](_0x483c4b[_0xb0cd('0x27')]);if(_0x483c4b[_0xb0cd('0x28')]){delete _0x483c4b[_0xb0cd('0x28')];}_0x5cfb80[_0xb0cd('0x17')](_0x4d021e)[_0xb0cd('0x29')](_0x483c4b);};}exports['index']=function(_0x58ee02,_0x52ee74){var _0x1eb0d3={},_0x714652={},_0x4820ff={'count':0x0,'rows':[]};var _0x2672ae=_[_0xb0cd('0x2a')](db[_0xb0cd('0x2b')][_0xb0cd('0x2c')],function(_0x3cce9e){return{'name':_0x3cce9e[_0xb0cd('0x2d')],'type':_0x3cce9e[_0xb0cd('0x2e')][_0xb0cd('0x2f')]};});_0x714652[_0xb0cd('0x30')]=_[_0xb0cd('0x2a')](_0x2672ae,_0xb0cd('0x28'));_0x714652[_0xb0cd('0x31')]=_[_0xb0cd('0x32')](_0x58ee02['query']);_0x714652[_0xb0cd('0x33')]=_[_0xb0cd('0x34')](_0x714652[_0xb0cd('0x30')],_0x714652[_0xb0cd('0x31')]);_0x1eb0d3['attributes']=_[_0xb0cd('0x34')](_0x714652[_0xb0cd('0x30')],qs[_0xb0cd('0x35')](_0x58ee02['query'][_0xb0cd('0x35')]));_0x1eb0d3[_0xb0cd('0x36')]=_0x1eb0d3['attributes'][_0xb0cd('0x37')]?_0x1eb0d3['attributes']:_0x714652[_0xb0cd('0x30')];if(!_0x58ee02[_0xb0cd('0x31')][_0xb0cd('0x38')](_0xb0cd('0x39'))){_0x1eb0d3[_0xb0cd('0x1b')]=qs[_0xb0cd('0x1b')](_0x58ee02[_0xb0cd('0x31')][_0xb0cd('0x1b')]);_0x1eb0d3[_0xb0cd('0x1a')]=qs[_0xb0cd('0x1a')](_0x58ee02['query'][_0xb0cd('0x1a')]);}_0x1eb0d3['order']=qs[_0xb0cd('0x3a')](_0x58ee02['query'][_0xb0cd('0x3a')]);_0x1eb0d3['where']=qs[_0xb0cd('0x33')](_[_0xb0cd('0x3b')](_0x58ee02['query'],_0x714652[_0xb0cd('0x33')]),_0x2672ae);if(_0x58ee02[_0xb0cd('0x31')][_0xb0cd('0x3c')]){_0x1eb0d3['where']=_[_0xb0cd('0x3d')](_0x1eb0d3[_0xb0cd('0x3e')],{'$or':_[_0xb0cd('0x2a')](_0x2672ae,function(_0x179826){if(_0x179826['type']!==_0xb0cd('0x3f')){var _0x226b7d={};_0x226b7d[_0x179826[_0xb0cd('0x28')]]={'$like':'%'+_0x58ee02[_0xb0cd('0x31')][_0xb0cd('0x3c')]+'%'};return _0x226b7d;}})});}_0x1eb0d3=_[_0xb0cd('0x3d')]({},_0x1eb0d3,_0x58ee02['options']);var _0x208523={'where':_0x1eb0d3[_0xb0cd('0x3e')]};return db[_0xb0cd('0x2b')][_0xb0cd('0x19')](_0x208523)['then'](function(_0x36e05b){_0x4820ff[_0xb0cd('0x19')]=_0x36e05b;if(_0x58ee02['query']['includeAll']){_0x1eb0d3['include']=[{'all':!![]}];}return db[_0xb0cd('0x2b')][_0xb0cd('0x40')](_0x1eb0d3);})[_0xb0cd('0x21')](function(_0x14fbe5){_0x4820ff[_0xb0cd('0x41')]=_0x14fbe5;return _0x4820ff;})['then'](respondWithFilteredResult(_0x52ee74,_0x1eb0d3))[_0xb0cd('0x42')](handleError(_0x52ee74,null));};exports[_0xb0cd('0x43')]=function(_0xb1c7d5,_0x154245){var _0x3d4090={'raw':!![],'where':{'id':_0xb1c7d5[_0xb0cd('0x44')]['id']}},_0x291a9a={};_0x291a9a[_0xb0cd('0x30')]=_[_0xb0cd('0x32')](db[_0xb0cd('0x2b')][_0xb0cd('0x2c')]);_0x291a9a['query']=_['keys'](_0xb1c7d5[_0xb0cd('0x31')]);_0x291a9a[_0xb0cd('0x33')]=_[_0xb0cd('0x34')](_0x291a9a[_0xb0cd('0x30')],_0x291a9a['query']);_0x3d4090['attributes']=_[_0xb0cd('0x34')](_0x291a9a['model'],qs[_0xb0cd('0x35')](_0xb1c7d5[_0xb0cd('0x31')]['fields']));_0x3d4090[_0xb0cd('0x36')]=_0x3d4090[_0xb0cd('0x36')]['length']?_0x3d4090[_0xb0cd('0x36')]:_0x291a9a[_0xb0cd('0x30')];if(_0xb1c7d5[_0xb0cd('0x31')]['includeAll']){_0x3d4090['include']=[{'all':!![]}];}_0x3d4090=_[_0xb0cd('0x3d')]({},_0x3d4090,_0xb1c7d5[_0xb0cd('0x45')]);return db[_0xb0cd('0x2b')][_0xb0cd('0x46')](_0x3d4090)[_0xb0cd('0x21')](handleEntityNotFound(_0x154245,null))[_0xb0cd('0x21')](respondWithResult(_0x154245,null))[_0xb0cd('0x42')](handleError(_0x154245,null));};exports[_0xb0cd('0x47')]=function(_0x15321c,_0x39b915){return db[_0xb0cd('0x2b')][_0xb0cd('0x47')](_0x15321c[_0xb0cd('0x48')],{})[_0xb0cd('0x21')](function(_0x356a5b){var _0x595125=_0x15321c[_0xb0cd('0x49')][_0xb0cd('0x23')]({'plain':!![]});if(!_0x595125)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x595125[_0xb0cd('0x4a')]===_0xb0cd('0x49')){var _0x5e3131=_0x356a5b[_0xb0cd('0x23')]({'plain':!![]});var _0x4794c8=_0xb0cd('0x24');return db[_0xb0cd('0x4b')]['find']({'where':{'name':_0x4794c8,'userProfileId':_0x595125[_0xb0cd('0x4c')]},'raw':!![]})[_0xb0cd('0x21')](function(_0x419f34){if(_0x419f34&&_0x419f34[_0xb0cd('0x4d')]===0x0){return db[_0xb0cd('0x25')][_0xb0cd('0x47')]({'name':_0x5e3131['name'],'resourceId':_0x5e3131['id'],'type':_0x419f34[_0xb0cd('0x28')],'sectionId':_0x419f34['id']},{})[_0xb0cd('0x21')](function(){return _0x356a5b;});}else{return _0x356a5b;}})[_0xb0cd('0x42')](function(_0x4d26e7){logger[_0xb0cd('0x26')](_0xb0cd('0x4e'),_0x4d26e7);throw _0x4d26e7;});}return _0x356a5b;})[_0xb0cd('0x21')](respondWithResult(_0x39b915,0xc9))[_0xb0cd('0x42')](handleError(_0x39b915,null));};exports['update']=function(_0x57d828,_0x178005){if(_0x57d828[_0xb0cd('0x48')]['id']){delete _0x57d828[_0xb0cd('0x48')]['id'];}return db[_0xb0cd('0x2b')]['find']({'where':{'id':_0x57d828[_0xb0cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x178005,null))[_0xb0cd('0x21')](saveUpdates(_0x57d828[_0xb0cd('0x48')],null))[_0xb0cd('0x21')](respondWithResult(_0x178005,null))[_0xb0cd('0x42')](handleError(_0x178005,null));};exports['destroy']=function(_0x3c404f,_0x476eb7){return db['Tag'][_0xb0cd('0x46')]({'where':{'id':_0x3c404f[_0xb0cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x476eb7,null))[_0xb0cd('0x21')](removeEntity(_0x476eb7,null))[_0xb0cd('0x42')](handleError(_0x476eb7,null));};
\ No newline at end of file
+var _0xe69d=['index','map','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Tag','includeAll','include','findAll','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','destroy','then','get','Tags','sendStatus','error','stack','name','send'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe69d,0x11d));var _0xde69=function(_0x36f6c8,_0x1a6406){_0x36f6c8=_0x36f6c8-0x0;var _0x533cb5=_0xe69d[_0x36f6c8];return _0x533cb5;};'use strict';var pdf=require(_0xde69('0x0'));var emlformat=require(_0xde69('0x1'));var rimraf=require(_0xde69('0x2'));var zipdir=require(_0xde69('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde69('0x4'));var moment=require(_0xde69('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xde69('0x6'));var sox=require(_0xde69('0x7'));var csv=require(_0xde69('0x8'));var ejs=require(_0xde69('0x9'));var fs=require('fs');var _=require(_0xde69('0xa'));var squel=require('squel');var crypto=require(_0xde69('0xb'));var jsforce=require(_0xde69('0xc'));var deskjs=require(_0xde69('0xd'));var toCsv=require(_0xde69('0x8'));var querystring=require(_0xde69('0xe'));var Papa=require(_0xde69('0xf'));var Redis=require('ioredis');var authService=require(_0xde69('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xde69('0x11'));var hardwareService=require(_0xde69('0x12'));var logger=require(_0xde69('0x13'))(_0xde69('0x14'));var utils=require(_0xde69('0x15'));var config=require('../../config/environment');var db=require(_0xde69('0x16'))['db'];function respondWithStatusCode(_0x3bc771,_0x12e075){_0x12e075=_0x12e075||0xcc;return function(_0x3b13aa){if(_0x3b13aa){return _0x3bc771['sendStatus'](_0x12e075);}return _0x3bc771['status'](_0x12e075)[_0xde69('0x17')]();};}function respondWithResult(_0x4a5ef7,_0x396d33){_0x396d33=_0x396d33||0xc8;return function(_0x42a690){if(_0x42a690){return _0x4a5ef7['status'](_0x396d33)[_0xde69('0x18')](_0x42a690);}};}function respondWithFilteredResult(_0x48abb3,_0x5b7b68){return function(_0x40d089){if(_0x40d089){var _0x1e99c3=_0x40d089[_0xde69('0x19')],_0x43f998=_0x5b7b68[_0xde69('0x1a')],_0x5be0c7=_0x5b7b68[_0xde69('0x1a')]+_0x5b7b68[_0xde69('0x1b')],_0x56edff;if(_0x5be0c7>=_0x1e99c3){_0x5be0c7=_0x1e99c3;_0x56edff=0xc8;}else{_0x56edff=0xce;}_0x48abb3[_0xde69('0x1c')](_0x56edff);return _0x48abb3['set'](_0xde69('0x1d'),_0x43f998+'-'+_0x5be0c7+'/'+_0x1e99c3)['json'](_0x40d089);}return null;};}function patchUpdates(_0x36b640){return function(_0x515268){try{jsonpatch[_0xde69('0x1e')](_0x515268,_0x36b640,!![]);}catch(_0x52e709){return BPromise[_0xde69('0x1f')](_0x52e709);}return _0x515268[_0xde69('0x20')]();};}function saveUpdates(_0x319665,_0x92abc){return function(_0x4ceaac){if(_0x4ceaac){return _0x4ceaac[_0xde69('0x21')](_0x319665)['then'](function(_0x407bcb){return _0x407bcb;});}return null;};}function removeEntity(_0x527f6a,_0xa20637){return function(_0x245d44){if(_0x245d44){return _0x245d44[_0xde69('0x22')]()[_0xde69('0x23')](function(){var _0x3f498e=_0x245d44[_0xde69('0x24')]({'plain':!![]});var _0x42124f=_0xde69('0x25');return db['UserProfileResource'][_0xde69('0x22')]({'where':{'type':_0x42124f,'resourceId':_0x3f498e['id']}})['then'](function(){return _0x245d44;});})[_0xde69('0x23')](function(){_0x527f6a['status'](0xcc)[_0xde69('0x17')]();});}};}function handleEntityNotFound(_0xdc205a,_0x1dd569){return function(_0x454216){if(!_0x454216){_0xdc205a[_0xde69('0x26')](0x194);}return _0x454216;};}function handleError(_0x359a7a,_0x251150){_0x251150=_0x251150||0x1f4;return function(_0x3be486){logger[_0xde69('0x27')](_0x3be486[_0xde69('0x28')]);if(_0x3be486[_0xde69('0x29')]){delete _0x3be486['name'];}_0x359a7a['status'](_0x251150)[_0xde69('0x2a')](_0x3be486);};}exports[_0xde69('0x2b')]=function(_0x4f5a0e,_0x1f6daf){var _0x217012={},_0x46ddfd={},_0x3cbaae={'count':0x0,'rows':[]};var _0x40688b=_[_0xde69('0x2c')](db['Tag']['rawAttributes'],function(_0x4b2ff5){return{'name':_0x4b2ff5[_0xde69('0x2d')],'type':_0x4b2ff5['type'][_0xde69('0x2e')]};});_0x46ddfd['model']=_[_0xde69('0x2c')](_0x40688b,_0xde69('0x29'));_0x46ddfd['query']=_[_0xde69('0x2f')](_0x4f5a0e[_0xde69('0x30')]);_0x46ddfd[_0xde69('0x31')]=_[_0xde69('0x32')](_0x46ddfd['model'],_0x46ddfd[_0xde69('0x30')]);_0x217012[_0xde69('0x33')]=_['intersection'](_0x46ddfd[_0xde69('0x34')],qs[_0xde69('0x35')](_0x4f5a0e[_0xde69('0x30')][_0xde69('0x35')]));_0x217012['attributes']=_0x217012[_0xde69('0x33')][_0xde69('0x36')]?_0x217012[_0xde69('0x33')]:_0x46ddfd[_0xde69('0x34')];if(!_0x4f5a0e[_0xde69('0x30')][_0xde69('0x37')](_0xde69('0x38'))){_0x217012[_0xde69('0x1b')]=qs[_0xde69('0x1b')](_0x4f5a0e[_0xde69('0x30')][_0xde69('0x1b')]);_0x217012[_0xde69('0x1a')]=qs[_0xde69('0x1a')](_0x4f5a0e[_0xde69('0x30')][_0xde69('0x1a')]);}_0x217012[_0xde69('0x39')]=qs['sort'](_0x4f5a0e[_0xde69('0x30')][_0xde69('0x3a')]);_0x217012[_0xde69('0x3b')]=qs[_0xde69('0x31')](_[_0xde69('0x3c')](_0x4f5a0e[_0xde69('0x30')],_0x46ddfd[_0xde69('0x31')]),_0x40688b);if(_0x4f5a0e[_0xde69('0x30')][_0xde69('0x3d')]){_0x217012[_0xde69('0x3b')]=_[_0xde69('0x3e')](_0x217012[_0xde69('0x3b')],{'$or':_[_0xde69('0x2c')](_0x40688b,function(_0x1702d1){if(_0x1702d1['type']!==_0xde69('0x3f')){var _0x53306d={};_0x53306d[_0x1702d1[_0xde69('0x29')]]={'$like':'%'+_0x4f5a0e[_0xde69('0x30')]['filter']+'%'};return _0x53306d;}})});}_0x217012=_['merge']({},_0x217012,_0x4f5a0e[_0xde69('0x40')]);var _0x212c26={'where':_0x217012[_0xde69('0x3b')]};return db[_0xde69('0x41')]['count'](_0x212c26)[_0xde69('0x23')](function(_0x3b11a2){_0x3cbaae[_0xde69('0x19')]=_0x3b11a2;if(_0x4f5a0e[_0xde69('0x30')][_0xde69('0x42')]){_0x217012[_0xde69('0x43')]=[{'all':!![]}];}return db[_0xde69('0x41')][_0xde69('0x44')](_0x217012);})[_0xde69('0x23')](function(_0x579080){_0x3cbaae['rows']=_0x579080;return _0x3cbaae;})[_0xde69('0x23')](respondWithFilteredResult(_0x1f6daf,_0x217012))['catch'](handleError(_0x1f6daf,null));};exports[_0xde69('0x45')]=function(_0x5308d6,_0x3626fa){var _0x11fc9c={'raw':!![],'where':{'id':_0x5308d6[_0xde69('0x46')]['id']}},_0x5aa2bb={};_0x5aa2bb[_0xde69('0x34')]=_[_0xde69('0x2f')](db[_0xde69('0x41')][_0xde69('0x47')]);_0x5aa2bb[_0xde69('0x30')]=_[_0xde69('0x2f')](_0x5308d6[_0xde69('0x30')]);_0x5aa2bb['filters']=_[_0xde69('0x32')](_0x5aa2bb[_0xde69('0x34')],_0x5aa2bb['query']);_0x11fc9c[_0xde69('0x33')]=_[_0xde69('0x32')](_0x5aa2bb[_0xde69('0x34')],qs[_0xde69('0x35')](_0x5308d6['query'][_0xde69('0x35')]));_0x11fc9c[_0xde69('0x33')]=_0x11fc9c['attributes']['length']?_0x11fc9c[_0xde69('0x33')]:_0x5aa2bb[_0xde69('0x34')];if(_0x5308d6[_0xde69('0x30')]['includeAll']){_0x11fc9c[_0xde69('0x43')]=[{'all':!![]}];}_0x11fc9c=_['merge']({},_0x11fc9c,_0x5308d6['options']);return db[_0xde69('0x41')][_0xde69('0x48')](_0x11fc9c)['then'](handleEntityNotFound(_0x3626fa,null))[_0xde69('0x23')](respondWithResult(_0x3626fa,null))['catch'](handleError(_0x3626fa,null));};exports[_0xde69('0x49')]=function(_0x32ea0c,_0x3d718e){return db[_0xde69('0x41')][_0xde69('0x49')](_0x32ea0c[_0xde69('0x4a')],{})[_0xde69('0x23')](function(_0xef2cbf){var _0x59f819=_0x32ea0c[_0xde69('0x4b')][_0xde69('0x24')]({'plain':!![]});if(!_0x59f819)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59f819[_0xde69('0x4c')]===_0xde69('0x4b')){var _0x29bf79=_0xef2cbf[_0xde69('0x24')]({'plain':!![]});var _0x1d6d11=_0xde69('0x25');return db[_0xde69('0x4d')]['find']({'where':{'name':_0x1d6d11,'userProfileId':_0x59f819[_0xde69('0x4e')]},'raw':!![]})['then'](function(_0x1e9cb3){if(_0x1e9cb3&&_0x1e9cb3[_0xde69('0x4f')]===0x0){return db['UserProfileResource'][_0xde69('0x49')]({'name':_0x29bf79[_0xde69('0x29')],'resourceId':_0x29bf79['id'],'type':_0x1e9cb3['name'],'sectionId':_0x1e9cb3['id']},{})['then'](function(){return _0xef2cbf;});}else{return _0xef2cbf;}})[_0xde69('0x50')](function(_0x11d247){logger[_0xde69('0x27')](_0xde69('0x51'),_0x11d247);throw _0x11d247;});}return _0xef2cbf;})[_0xde69('0x23')](respondWithResult(_0x3d718e,0xc9))['catch'](handleError(_0x3d718e,null));};exports[_0xde69('0x21')]=function(_0x574643,_0x58a93d){if(_0x574643[_0xde69('0x4a')]['id']){delete _0x574643[_0xde69('0x4a')]['id'];}return db[_0xde69('0x41')][_0xde69('0x48')]({'where':{'id':_0x574643[_0xde69('0x46')]['id']}})[_0xde69('0x23')](handleEntityNotFound(_0x58a93d,null))[_0xde69('0x23')](saveUpdates(_0x574643[_0xde69('0x4a')],null))['then'](respondWithResult(_0x58a93d,null))[_0xde69('0x50')](handleError(_0x58a93d,null));};exports[_0xde69('0x22')]=function(_0x1d0af0,_0x5b4bbe){return db[_0xde69('0x41')][_0xde69('0x48')]({'where':{'id':_0x1d0af0[_0xde69('0x46')]['id']}})[_0xde69('0x23')](handleEntityNotFound(_0x5b4bbe,null))[_0xde69('0x23')](removeEntity(_0x5b4bbe,null))[_0xde69('0x50')](handleError(_0x5b4bbe,null));};
\ No newline at end of file
index 59c8dc1..fa9a1f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc013=['../../config/environment','exports','define','tools_tags','lodash','request-promise','path','rimraf'];(function(_0x432af8,_0x477b3d){var _0x228f4f=function(_0x2110c0){while(--_0x2110c0){_0x432af8['push'](_0x432af8['shift']());}};_0x228f4f(++_0x477b3d);}(_0xc013,0x1bc));var _0x3c01=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0xc013[_0x10b48a];return _0x2c4533;};'use strict';var _=require(_0x3c01('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c01('0x1'));var fs=require('fs');var path=require(_0x3c01('0x2'));var rimraf=require(_0x3c01('0x3'));var config=require(_0x3c01('0x4'));var attributes=require('./tag.attributes');module[_0x3c01('0x5')]=function(_0x591d5c,_0x4c2449){return _0x591d5c[_0x3c01('0x6')]('Tag',attributes,{'tableName':_0x3c01('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa91a=['request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','util','../../config/logger','api','moment','bluebird'];(function(_0x5c034a,_0x131fd6){var _0x176d53=function(_0x1d6a20){while(--_0x1d6a20){_0x5c034a['push'](_0x5c034a['shift']());}};_0x176d53(++_0x131fd6);}(_0xa91a,0x167));var _0xaa91=function(_0x1e8061,_0x4b37ce){_0x1e8061=_0x1e8061-0x0;var _0x43eb9f=_0xa91a[_0x1e8061];return _0x43eb9f;};'use strict';var _=require('lodash');var util=require(_0xaa91('0x0'));var logger=require(_0xaa91('0x1'))(_0xaa91('0x2'));var moment=require(_0xaa91('0x3'));var BPromise=require(_0xaa91('0x4'));var rp=require(_0xaa91('0x5'));var fs=require('fs');var path=require(_0xaa91('0x6'));var rimraf=require(_0xaa91('0x7'));var config=require(_0xaa91('0x8'));var attributes=require(_0xaa91('0x9'));module[_0xaa91('0xa')]=function(_0x149ea8,_0x155d0a){return _0x149ea8[_0xaa91('0xb')](_0xaa91('0xc'),attributes,{'tableName':_0xaa91('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 04e432c..e1eea11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb903=['http','request','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','Tag,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3b6e79,_0x42a57b){var _0x1c0612=function(_0x592246){while(--_0x592246){_0x3b6e79['push'](_0x3b6e79['shift']());}};_0x1c0612(++_0x42a57b);}(_0xb903,0x185));var _0x3b90=function(_0xcb8bcb,_0xf63b6){_0xcb8bcb=_0xcb8bcb-0x0;var _0x57c6df=_0xb903[_0xcb8bcb];return _0x57c6df;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('Tag,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('Tag,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});}
\ No newline at end of file
+var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x192ff8,_0x177818){var _0x44948c=function(_0x4ee9e1){while(--_0x4ee9e1){_0x192ff8['push'](_0x192ff8['shift']());}};_0x44948c(++_0x177818);}(_0x54ef,0x112));var _0xf54e=function(_0x4f58ef,_0x17a6d2){_0x4f58ef=_0x4f58ef-0x0;var _0x3fcb46=_0x54ef[_0x4f58ef];return _0x3fcb46;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('Tag,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('Tag,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});}
\ No newline at end of file
index 2e46e62..0a40daa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9341=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','show','/:id/queues','/:id/users','post','create','addQueues','update','delete','/:id','destroy','removeQueues','exports','multer','util','connect-timeout'];(function(_0x590d6b,_0x560cd2){var _0xdee91a=function(_0x530bb5){while(--_0x530bb5){_0x590d6b['push'](_0x590d6b['shift']());}};_0xdee91a(++_0x560cd2);}(_0x9341,0x184));var _0x1934=function(_0x51488b,_0x49ad19){_0x51488b=_0x51488b-0x0;var _0x42e160=_0x9341[_0x51488b];return _0x42e160;};'use strict';var multer=require(_0x1934('0x0'));var util=require(_0x1934('0x1'));var path=require('path');var timeout=require(_0x1934('0x2'));var express=require('express');var router=express[_0x1934('0x3')]();var auth=require(_0x1934('0x4'));var interaction=require(_0x1934('0x5'));var config=require(_0x1934('0x6'));var controller=require(_0x1934('0x7'));router[_0x1934('0x8')]('/',auth[_0x1934('0x9')](),controller[_0x1934('0xa')]);router[_0x1934('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1934('0xb')]);router[_0x1934('0x8')](_0x1934('0xc'),auth[_0x1934('0x9')](),controller['getQueues']);router['get'](_0x1934('0xd'),auth[_0x1934('0x9')](),controller['getAgents']);router[_0x1934('0xe')]('/',auth[_0x1934('0x9')](),controller[_0x1934('0xf')]);router[_0x1934('0xe')]('/:id/queues',auth[_0x1934('0x9')](),controller[_0x1934('0x10')]);router[_0x1934('0xe')](_0x1934('0xd'),auth[_0x1934('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x1934('0x9')](),controller[_0x1934('0x11')]);router[_0x1934('0x12')](_0x1934('0x13'),auth[_0x1934('0x9')](),controller[_0x1934('0x14')]);router[_0x1934('0x12')](_0x1934('0xc'),auth[_0x1934('0x9')](),controller[_0x1934('0x15')]);router[_0x1934('0x12')](_0x1934('0xd'),auth[_0x1934('0x9')](),controller['removeAgents']);module[_0x1934('0x16')]=router;
\ No newline at end of file
+var _0xaf86=['show','/:id/queues','/:id/users','getAgents','create','post','addAgents','put','/:id','update','delete','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./team.controller','get','index','isAuthenticated'];(function(_0x5a6cef,_0x1697df){var _0x37f76f=function(_0x17dc71){while(--_0x17dc71){_0x5a6cef['push'](_0x5a6cef['shift']());}};_0x37f76f(++_0x1697df);}(_0xaf86,0x8b));var _0x6af8=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xaf86[_0x2b9b7f];return _0x4ed19a;};'use strict';var multer=require(_0x6af8('0x0'));var util=require(_0x6af8('0x1'));var path=require(_0x6af8('0x2'));var timeout=require(_0x6af8('0x3'));var express=require(_0x6af8('0x4'));var router=express['Router']();var auth=require(_0x6af8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6af8('0x6'));var controller=require(_0x6af8('0x7'));router[_0x6af8('0x8')]('/',auth['isAuthenticated'](),controller[_0x6af8('0x9')]);router[_0x6af8('0x8')]('/:id',auth[_0x6af8('0xa')](),controller[_0x6af8('0xb')]);router[_0x6af8('0x8')](_0x6af8('0xc'),auth[_0x6af8('0xa')](),controller['getQueues']);router[_0x6af8('0x8')](_0x6af8('0xd'),auth[_0x6af8('0xa')](),controller[_0x6af8('0xe')]);router['post']('/',auth[_0x6af8('0xa')](),controller[_0x6af8('0xf')]);router[_0x6af8('0x10')](_0x6af8('0xc'),auth[_0x6af8('0xa')](),controller['addQueues']);router[_0x6af8('0x10')]('/:id/users',auth[_0x6af8('0xa')](),controller[_0x6af8('0x11')]);router[_0x6af8('0x12')](_0x6af8('0x13'),auth['isAuthenticated'](),controller[_0x6af8('0x14')]);router[_0x6af8('0x15')](_0x6af8('0x13'),auth[_0x6af8('0xa')](),controller['destroy']);router[_0x6af8('0x15')](_0x6af8('0xc'),auth[_0x6af8('0xa')](),controller[_0x6af8('0x16')]);router[_0x6af8('0x15')](_0x6af8('0xd'),auth[_0x6af8('0xa')](),controller[_0x6af8('0x17')]);module[_0x6af8('0x18')]=router;
\ No newline at end of file
index 1333f7d..ad63b28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7488=['sequelize','STRING'];(function(_0x1e357e,_0x372e44){var _0x2635b9=function(_0x567739){while(--_0x567739){_0x1e357e['push'](_0x1e357e['shift']());}};_0x2635b9(++_0x372e44);}(_0x7488,0x8e));var _0x8748=function(_0x5e7832,_0x5db744){_0x5e7832=_0x5e7832-0x0;var _0x265781=_0x7488[_0x5e7832];return _0x265781;};'use strict';var Sequelize=require(_0x8748('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x8748('0x1')]}};
\ No newline at end of file
+var _0x5a64=['name','sequelize','exports','STRING'];(function(_0x2ecdbb,_0xb11c30){var _0x3e315a=function(_0x526e6c){while(--_0x526e6c){_0x2ecdbb['push'](_0x2ecdbb['shift']());}};_0x3e315a(++_0xb11c30);}(_0x5a64,0x1b1));var _0x45a6=function(_0x345df5,_0x2ecc84){_0x345df5=_0x345df5-0x0;var _0x28c96b=_0x5a64[_0x345df5];return _0x28c96b;};'use strict';var Sequelize=require(_0x45a6('0x0'));module[_0x45a6('0x1')]={'name':{'type':Sequelize[_0x45a6('0x2')],'allowNull':![],'unique':_0x45a6('0x3')},'description':{'type':Sequelize[_0x45a6('0x2')]}};
\ No newline at end of file
index 734121a..75ad497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d85=['ids','removeQueues','remove','addAgents','Mail','Sms','Fax','each','Voice','User','findAll','online','voicePause','UserVoiceQueueRt','isNil','interface','SIP/%s','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','sms','fax','openchannel','userTeam:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./team.socket','register','status','end','offset','limit','set','Content-Range','json','apply','reject','then','destroy','get','Teams','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','VIRTUAL','filter','merge','count','includeAll','include','rows','show','params','Team','options','find','catch','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','toLowerCase','Queue','order','pick','capitalize','Queues','addQueues','Unknown\x20channel','add'];(function(_0x12cf33,_0x2b9e9e){var _0x5a1376=function(_0x9c6281){while(--_0x9c6281){_0x12cf33['push'](_0x12cf33['shift']());}};_0x5a1376(++_0x2b9e9e);}(_0x4d85,0x99));var _0x54d8=function(_0x30d326,_0x56c832){_0x30d326=_0x30d326-0x0;var _0x2fa1ba=_0x4d85[_0x30d326];return _0x2fa1ba;};'use strict';var pdf=require(_0x54d8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x54d8('0x1'));var zipdir=require(_0x54d8('0x2'));var jsonpatch=require(_0x54d8('0x3'));var rp=require(_0x54d8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x54d8('0x5'));var util=require(_0x54d8('0x6'));var path=require(_0x54d8('0x7'));var sox=require(_0x54d8('0x8'));var csv=require(_0x54d8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x54d8('0xa'));var jsforce=require(_0x54d8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x54d8('0x9'));var querystring=require(_0x54d8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x54d8('0xd'));var qs=require(_0x54d8('0xe'));var as=require(_0x54d8('0xf'));var hardwareService=require(_0x54d8('0x10'));var logger=require(_0x54d8('0x11'))(_0x54d8('0x12'));var utils=require(_0x54d8('0x13'));var config=require('../../config/environment');var db=require(_0x54d8('0x14'))['db'];config[_0x54d8('0x15')]=_['defaults'](config[_0x54d8('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x54d8('0x16'))(new Redis(config[_0x54d8('0x15')]));require(_0x54d8('0x17'))[_0x54d8('0x18')](socket);function respondWithStatusCode(_0x5a1231,_0x1c6859){_0x1c6859=_0x1c6859||0xcc;return function(_0x177c90){if(_0x177c90){return _0x5a1231['sendStatus'](_0x1c6859);}return _0x5a1231[_0x54d8('0x19')](_0x1c6859)[_0x54d8('0x1a')]();};}function respondWithResult(_0x25aad0,_0x58d3dc){_0x58d3dc=_0x58d3dc||0xc8;return function(_0xddf8be){if(_0xddf8be){return _0x25aad0[_0x54d8('0x19')](_0x58d3dc)['json'](_0xddf8be);}};}function respondWithFilteredResult(_0x302ce9,_0x3fab94){return function(_0x30c6c0){if(_0x30c6c0){var _0x3c0802=_0x30c6c0['count'],_0x3d4dbb=_0x3fab94[_0x54d8('0x1b')],_0x2221ae=_0x3fab94[_0x54d8('0x1b')]+_0x3fab94[_0x54d8('0x1c')],_0x50c3c6;if(_0x2221ae>=_0x3c0802){_0x2221ae=_0x3c0802;_0x50c3c6=0xc8;}else{_0x50c3c6=0xce;}_0x302ce9['status'](_0x50c3c6);return _0x302ce9[_0x54d8('0x1d')](_0x54d8('0x1e'),_0x3d4dbb+'-'+_0x2221ae+'/'+_0x3c0802)[_0x54d8('0x1f')](_0x30c6c0);}return null;};}function patchUpdates(_0xfe2df8){return function(_0x3fdff5){try{jsonpatch[_0x54d8('0x20')](_0x3fdff5,_0xfe2df8,!![]);}catch(_0x3ff86d){return BPromise[_0x54d8('0x21')](_0x3ff86d);}return _0x3fdff5['save']();};}function saveUpdates(_0x52789f,_0x322203){return function(_0x378bc8){if(_0x378bc8){return _0x378bc8['update'](_0x52789f)[_0x54d8('0x22')](function(_0x1d86eb){return _0x1d86eb;});}return null;};}function removeEntity(_0x2948de,_0x31f2c4){return function(_0x3dfb2d){if(_0x3dfb2d){return _0x3dfb2d[_0x54d8('0x23')]()[_0x54d8('0x22')](function(){var _0xb21042=_0x3dfb2d[_0x54d8('0x24')]({'plain':!![]});var _0x336c34=_0x54d8('0x25');return db[_0x54d8('0x26')]['destroy']({'where':{'type':_0x336c34,'resourceId':_0xb21042['id']}})['then'](function(){return _0x3dfb2d;});})['then'](function(){_0x2948de[_0x54d8('0x19')](0xcc)[_0x54d8('0x1a')]();});}};}function handleEntityNotFound(_0x3bad15,_0x16b70f){return function(_0x175862){if(!_0x175862){_0x3bad15['sendStatus'](0x194);}return _0x175862;};}function handleError(_0x133c86,_0x43ca81){_0x43ca81=_0x43ca81||0x1f4;return function(_0x10526f){logger[_0x54d8('0x27')](_0x10526f['stack']);if(_0x10526f[_0x54d8('0x28')]){delete _0x10526f[_0x54d8('0x28')];}_0x133c86[_0x54d8('0x19')](_0x43ca81)[_0x54d8('0x29')](_0x10526f);};}exports[_0x54d8('0x2a')]=function(_0x1db1e2,_0x3e43fc){var _0xaf1c69={},_0x1c7ec9={},_0x36871f={'count':0x0,'rows':[]};var _0x1348dd=_[_0x54d8('0x2b')](db['Team'][_0x54d8('0x2c')],function(_0x541104){return{'name':_0x541104[_0x54d8('0x2d')],'type':_0x541104[_0x54d8('0x2e')][_0x54d8('0x2f')]};});_0x1c7ec9[_0x54d8('0x30')]=_[_0x54d8('0x2b')](_0x1348dd,'name');_0x1c7ec9[_0x54d8('0x31')]=_[_0x54d8('0x32')](_0x1db1e2['query']);_0x1c7ec9[_0x54d8('0x33')]=_[_0x54d8('0x34')](_0x1c7ec9[_0x54d8('0x30')],_0x1c7ec9[_0x54d8('0x31')]);_0xaf1c69[_0x54d8('0x35')]=_[_0x54d8('0x34')](_0x1c7ec9[_0x54d8('0x30')],qs[_0x54d8('0x36')](_0x1db1e2[_0x54d8('0x31')][_0x54d8('0x36')]));_0xaf1c69[_0x54d8('0x35')]=_0xaf1c69['attributes'][_0x54d8('0x37')]?_0xaf1c69[_0x54d8('0x35')]:_0x1c7ec9[_0x54d8('0x30')];if(!_0x1db1e2[_0x54d8('0x31')]['hasOwnProperty'](_0x54d8('0x38'))){_0xaf1c69['limit']=qs[_0x54d8('0x1c')](_0x1db1e2['query'][_0x54d8('0x1c')]);_0xaf1c69[_0x54d8('0x1b')]=qs[_0x54d8('0x1b')](_0x1db1e2[_0x54d8('0x31')][_0x54d8('0x1b')]);}_0xaf1c69['order']=qs[_0x54d8('0x39')](_0x1db1e2['query'][_0x54d8('0x39')]);_0xaf1c69[_0x54d8('0x3a')]=qs[_0x54d8('0x33')](_['pick'](_0x1db1e2[_0x54d8('0x31')],_0x1c7ec9[_0x54d8('0x33')]),_0x1348dd);if(_0x1db1e2[_0x54d8('0x31')]['filter']){_0xaf1c69[_0x54d8('0x3a')]=_['merge'](_0xaf1c69[_0x54d8('0x3a')],{'$or':_[_0x54d8('0x2b')](_0x1348dd,function(_0xb04f48){if(_0xb04f48['type']!==_0x54d8('0x3b')){var _0x5aaac5={};_0x5aaac5[_0xb04f48[_0x54d8('0x28')]]={'$like':'%'+_0x1db1e2[_0x54d8('0x31')][_0x54d8('0x3c')]+'%'};return _0x5aaac5;}})});}_0xaf1c69=_[_0x54d8('0x3d')]({},_0xaf1c69,_0x1db1e2['options']);var _0x375e6e={'where':_0xaf1c69[_0x54d8('0x3a')]};return db['Team']['count'](_0x375e6e)['then'](function(_0x412fd8){_0x36871f[_0x54d8('0x3e')]=_0x412fd8;if(_0x1db1e2['query'][_0x54d8('0x3f')]){_0xaf1c69[_0x54d8('0x40')]=[{'all':!![]}];}return db['Team']['findAll'](_0xaf1c69);})['then'](function(_0x30301a){_0x36871f[_0x54d8('0x41')]=_0x30301a;return _0x36871f;})[_0x54d8('0x22')](respondWithFilteredResult(_0x3e43fc,_0xaf1c69))['catch'](handleError(_0x3e43fc,null));};exports[_0x54d8('0x42')]=function(_0x467f4f,_0x1a15da){var _0x53fc57={'raw':![],'where':{'id':_0x467f4f[_0x54d8('0x43')]['id']}},_0x40cded={};_0x40cded[_0x54d8('0x30')]=_[_0x54d8('0x32')](db[_0x54d8('0x44')][_0x54d8('0x2c')]);_0x40cded[_0x54d8('0x31')]=_['keys'](_0x467f4f[_0x54d8('0x31')]);_0x40cded[_0x54d8('0x33')]=_[_0x54d8('0x34')](_0x40cded['model'],_0x40cded[_0x54d8('0x31')]);_0x53fc57[_0x54d8('0x35')]=_[_0x54d8('0x34')](_0x40cded[_0x54d8('0x30')],qs[_0x54d8('0x36')](_0x467f4f[_0x54d8('0x31')]['fields']));_0x53fc57[_0x54d8('0x35')]=_0x53fc57[_0x54d8('0x35')][_0x54d8('0x37')]?_0x53fc57['attributes']:_0x40cded[_0x54d8('0x30')];if(_0x467f4f[_0x54d8('0x31')][_0x54d8('0x3f')]){_0x53fc57[_0x54d8('0x40')]=[{'all':!![]}];}_0x53fc57=_[_0x54d8('0x3d')]({},_0x53fc57,_0x467f4f[_0x54d8('0x45')]);return db[_0x54d8('0x44')][_0x54d8('0x46')](_0x53fc57)['then'](handleEntityNotFound(_0x1a15da,null))[_0x54d8('0x22')](respondWithResult(_0x1a15da,null))[_0x54d8('0x47')](handleError(_0x1a15da,null));};exports[_0x54d8('0x48')]=function(_0x3c9d10,_0x378fcc){return db[_0x54d8('0x44')][_0x54d8('0x48')](_0x3c9d10['body'],{})['then'](function(_0x456d3f){var _0x47559b=_0x3c9d10[_0x54d8('0x49')][_0x54d8('0x24')]({'plain':!![]});if(!_0x47559b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47559b['role']===_0x54d8('0x49')){var _0x290714=_0x456d3f['get']({'plain':!![]});var _0x14e35a=_0x54d8('0x25');return db[_0x54d8('0x4a')]['find']({'where':{'name':_0x14e35a,'userProfileId':_0x47559b['userProfileId']},'raw':!![]})[_0x54d8('0x22')](function(_0x37dc58){if(_0x37dc58&&_0x37dc58[_0x54d8('0x4b')]===0x0){return db[_0x54d8('0x26')][_0x54d8('0x48')]({'name':_0x290714['name'],'resourceId':_0x290714['id'],'type':_0x37dc58['name'],'sectionId':_0x37dc58['id']},{})[_0x54d8('0x22')](function(){return _0x456d3f;});}else{return _0x456d3f;}})[_0x54d8('0x47')](function(_0x41f053){logger['error'](_0x54d8('0x4c'),_0x41f053);throw _0x41f053;});}return _0x456d3f;})[_0x54d8('0x22')](respondWithResult(_0x378fcc,0xc9))[_0x54d8('0x47')](handleError(_0x378fcc,null));};exports['update']=function(_0x21892e,_0x44bde1){if(_0x21892e[_0x54d8('0x4d')]['id']){delete _0x21892e['body']['id'];}return db['Team'][_0x54d8('0x46')]({'where':{'id':_0x21892e[_0x54d8('0x43')]['id']}})[_0x54d8('0x22')](handleEntityNotFound(_0x44bde1,null))[_0x54d8('0x22')](saveUpdates(_0x21892e[_0x54d8('0x4d')],null))[_0x54d8('0x22')](respondWithResult(_0x44bde1,null))[_0x54d8('0x47')](handleError(_0x44bde1,null));};exports['destroy']=function(_0x4a2cb2,_0xbb4451){return db[_0x54d8('0x44')]['find']({'where':{'id':_0x4a2cb2[_0x54d8('0x43')]['id']}})[_0x54d8('0x22')](handleEntityNotFound(_0xbb4451,null))[_0x54d8('0x22')](removeEntity(_0xbb4451,null))['catch'](handleError(_0xbb4451,null));};exports[_0x54d8('0x4e')]=function(_0x13ec1b,_0x1ca45f,_0x483681){return db['Team'][_0x54d8('0x4f')]({'where':{'id':_0x13ec1b[_0x54d8('0x43')]['id']}})[_0x54d8('0x22')](handleEntityNotFound(_0x1ca45f,null))[_0x54d8('0x22')](function(_0x53faf0){if(!_0x13ec1b[_0x54d8('0x31')][_0x54d8('0x50')]||!utils[_0x54d8('0x51')](_0x13ec1b[_0x54d8('0x31')][_0x54d8('0x50')])){throw new db[(_0x54d8('0x52'))][(_0x54d8('0x53'))]('Unknown\x20channel');}var _0x28e463={};var _0x259ada={};_0x259ada[_0x54d8('0x30')]=_[_0x54d8('0x32')](db[_['capitalize'](_0x13ec1b[_0x54d8('0x31')]['channel'][_0x54d8('0x54')]())+_0x54d8('0x55')]['rawAttributes']);_0x259ada[_0x54d8('0x31')]=_[_0x54d8('0x32')](_0x13ec1b[_0x54d8('0x31')]);_0x259ada['filters']=_[_0x54d8('0x34')](_0x259ada[_0x54d8('0x30')],_0x259ada['query']);_0x28e463[_0x54d8('0x35')]=_[_0x54d8('0x34')](_0x259ada[_0x54d8('0x30')],qs[_0x54d8('0x36')](_0x13ec1b['query']['fields']));_0x28e463[_0x54d8('0x35')]=_0x28e463[_0x54d8('0x35')]['length']?_0x28e463[_0x54d8('0x35')]:_0x259ada[_0x54d8('0x30')];_0x28e463[_0x54d8('0x1c')]=qs['limit'](_0x13ec1b[_0x54d8('0x31')][_0x54d8('0x1c')]);_0x28e463['offset']=qs[_0x54d8('0x1b')](_0x13ec1b['query'][_0x54d8('0x1b')]);_0x28e463[_0x54d8('0x56')]=qs[_0x54d8('0x39')](_0x13ec1b['query'][_0x54d8('0x39')]);_0x28e463[_0x54d8('0x3a')]=qs[_0x54d8('0x33')](_[_0x54d8('0x57')](_0x13ec1b[_0x54d8('0x31')],_0x259ada[_0x54d8('0x33')]));_0x28e463=_['merge']({},_0x28e463,_0x13ec1b[_0x54d8('0x45')]);return _0x53faf0[_0x54d8('0x24')+_[_0x54d8('0x58')](_0x13ec1b['query'][_0x54d8('0x50')]['toLowerCase']())+_0x54d8('0x59')](_0x28e463);})[_0x54d8('0x22')](respondWithResult(_0x1ca45f,null))[_0x54d8('0x47')](handleError(_0x1ca45f,null));};exports[_0x54d8('0x5a')]=function(_0x42ff0e,_0x44b2d8,_0x1d6b31){return db[_0x54d8('0x44')][_0x54d8('0x4f')]({'where':{'id':_0x42ff0e[_0x54d8('0x43')]['id']}})[_0x54d8('0x22')](function(_0x3263bb){if(_0x3263bb){if(!_0x42ff0e[_0x54d8('0x4d')][_0x54d8('0x50')]||!utils[_0x54d8('0x51')](_0x42ff0e[_0x54d8('0x4d')]['channel'])){throw new db[(_0x54d8('0x52'))][(_0x54d8('0x53'))](_0x54d8('0x5b'));}return _0x3263bb[_0x54d8('0x5c')+_[_0x54d8('0x58')](_0x42ff0e[_0x54d8('0x4d')]['channel'][_0x54d8('0x54')]())+_0x54d8('0x59')](_0x42ff0e['body'][_0x54d8('0x5d')]);}return null;})[_0x54d8('0x22')](handleEntityNotFound(_0x44b2d8,null))[_0x54d8('0x22')](respondWithStatusCode(_0x44b2d8,null))[_0x54d8('0x47')](handleError(_0x44b2d8,null));};exports[_0x54d8('0x5e')]=function(_0x84a880,_0x3b898e,_0x56d172){return db[_0x54d8('0x44')]['findOne']({'where':{'id':_0x84a880[_0x54d8('0x43')]['id']}})[_0x54d8('0x22')](function(_0x36e8d0){if(_0x36e8d0){if(!_0x84a880['query'][_0x54d8('0x50')]||!utils[_0x54d8('0x51')](_0x84a880[_0x54d8('0x31')][_0x54d8('0x50')])){throw new db[(_0x54d8('0x52'))][(_0x54d8('0x53'))](_0x54d8('0x5b'));}return _0x36e8d0[_0x54d8('0x5f')+_['capitalize'](_0x84a880[_0x54d8('0x31')]['channel']['toLowerCase']())+_0x54d8('0x59')](_0x84a880[_0x54d8('0x31')][_0x54d8('0x5d')]);}return null;})[_0x54d8('0x22')](handleEntityNotFound(_0x3b898e,null))[_0x54d8('0x22')](respondWithStatusCode(_0x3b898e,null))[_0x54d8('0x47')](handleError(_0x3b898e,null));};exports[_0x54d8('0x60')]=function(_0x25281c,_0x47318c,_0x14f393){return db[_0x54d8('0x44')]['find']({'where':{'id':_0x25281c['params']['id']}})[_0x54d8('0x22')](handleEntityNotFound(_0x47318c,null))[_0x54d8('0x22')](function(_0x506352){if(_0x506352){var _0x1d11be=['Voice','Chat',_0x54d8('0x61'),_0x54d8('0x62'),_0x54d8('0x63'),'Openchannel','Whatsapp'];return BPromise[_0x54d8('0x64')](_0x1d11be,function(_0x24e44f){return _0x506352[_0x54d8('0x24')+_0x24e44f+_0x54d8('0x59')]({'attributes':['id',_0x54d8('0x28')]})[_0x54d8('0x22')](function(_0x519960){return BPromise[_0x54d8('0x64')](_0x519960,function(_0x5ab3f9){return _0x5ab3f9[_0x54d8('0x60')](_0x25281c[_0x54d8('0x4d')][_0x54d8('0x5d')])[_0x54d8('0x22')](function(){if(_0x24e44f===_0x54d8('0x65')){return db[_0x54d8('0x66')][_0x54d8('0x67')]({'where':{'id':_0x25281c[_0x54d8('0x4d')][_0x54d8('0x5d')]},'attributes':['id',_0x54d8('0x28'),_0x54d8('0x68'),_0x54d8('0x69'),'interface'],'raw':!![]})['then'](function(_0x222437){return BPromise[_0x54d8('0x64')](_[_0x54d8('0x3c')](_0x222437,{'online':0x1}),function(_0x5a23c7){return db[_0x54d8('0x6a')]['upsert']({'membername':_0x5a23c7[_0x54d8('0x28')],'UserId':_0x5a23c7['id'],'queue_name':_0x5ab3f9[_0x54d8('0x28')],'VoiceQueueId':_0x5ab3f9['id'],'interface':_[_0x54d8('0x6b')](_0x5a23c7[_0x54d8('0x6c')])?util['format'](_0x54d8('0x6d'),_0x5a23c7[_0x54d8('0x28')]):_0x5a23c7[_0x54d8('0x6c')],'paused':_0x5a23c7['voicePause']||![],'penalty':0x0});});});}});});})['then'](function(){return _0x506352;});})[_0x54d8('0x22')](function(){return _0x506352;});}})['then'](function(_0x2bb42a){if(_0x2bb42a){return _0x2bb42a[_0x54d8('0x60')](_0x25281c['body'][_0x54d8('0x5d')],_[_0x54d8('0x6e')](_0x25281c[_0x54d8('0x4d')],['ids','id'])||{})[_0x54d8('0x6f')](function(_0x2060c5){for(var _0x48663f=0x0;_0x48663f<_0x25281c[_0x54d8('0x4d')][_0x54d8('0x5d')][_0x54d8('0x37')];_0x48663f+=0x1){socket[_0x54d8('0x70')](_0x54d8('0x71'),{'UserId':_0x25281c[_0x54d8('0x4d')][_0x54d8('0x5d')][_0x48663f],'TeamId':_0x25281c[_0x54d8('0x43')]['id']});}return _0x2060c5;});}})[_0x54d8('0x22')](respondWithResult(_0x47318c,null))[_0x54d8('0x47')](handleError(_0x47318c,null));};exports[_0x54d8('0x72')]=function(_0x340b54,_0x221db4,_0x198a0f){return db['Team'][_0x54d8('0x46')]({'where':{'id':_0x340b54[_0x54d8('0x43')]['id']}})[_0x54d8('0x22')](handleEntityNotFound(_0x221db4,null))[_0x54d8('0x22')](function(_0xfd3795){if(_0xfd3795){return BPromise[_0x54d8('0x64')]([_0x54d8('0x73'),_0x54d8('0x74'),_0x54d8('0x75'),_0x54d8('0x76'),_0x54d8('0x77'),_0x54d8('0x78'),'whatsapp'],function(_0xa278ab){return _0xfd3795[_0x54d8('0x24')+_['capitalize'](_0xa278ab)+_0x54d8('0x59')]({'attributes':['id',_0x54d8('0x28')]})['then'](function(_0x1fd95f){return BPromise[_0x54d8('0x64')](_0x1fd95f,function(_0x5ec9f7){return _0x5ec9f7['removeAgents'](_0x340b54[_0x54d8('0x31')][_0x54d8('0x5d')])[_0x54d8('0x22')](function(){if(_0xa278ab===_0x54d8('0x73')){return db['UserVoiceQueueRt'][_0x54d8('0x23')]({'where':{'VoiceQueueId':_0x5ec9f7['id'],'UserId':_0x340b54[_0x54d8('0x31')][_0x54d8('0x5d')]}});}});});})['then'](function(){return _0xfd3795;});})[_0x54d8('0x22')](function(){return _0xfd3795;});}})[_0x54d8('0x22')](function(_0x5d99f9){if(_0x5d99f9){return _0x5d99f9[_0x54d8('0x72')](_0x340b54[_0x54d8('0x31')][_0x54d8('0x5d')])[_0x54d8('0x22')](function(){if(_['isArray'](_0x340b54[_0x54d8('0x31')][_0x54d8('0x5d')])){for(var _0x4080c7=0x0;_0x4080c7<_0x340b54['query'][_0x54d8('0x5d')][_0x54d8('0x37')];_0x4080c7+=0x1){socket[_0x54d8('0x70')](_0x54d8('0x79'),{'UserId':Number(_0x340b54[_0x54d8('0x31')][_0x54d8('0x5d')][_0x4080c7]),'TeamId':Number(_0x340b54[_0x54d8('0x43')]['id'])});}}else{socket[_0x54d8('0x70')]('userTeam:remove',{'UserId':Number(_0x340b54[_0x54d8('0x31')]['ids']),'TeamId':Number(_0x340b54[_0x54d8('0x43')]['id'])});}});}})[_0x54d8('0x22')](respondWithStatusCode(_0x221db4,null))[_0x54d8('0x47')](handleError(_0x221db4,null));};exports['getAgents']=function(_0x2caed4,_0x20ebb6,_0x396d7){var _0x111a50={};var _0x59659b={};var _0x2eb804;var _0x4af7c4;return db['Team']['findOne']({'where':{'id':_0x2caed4['params']['id']}})[_0x54d8('0x22')](handleEntityNotFound(_0x20ebb6,null))['then'](function(_0x1ca8df){if(_0x1ca8df){_0x2eb804=_0x1ca8df;_0x59659b[_0x54d8('0x30')]=_[_0x54d8('0x32')](db[_0x54d8('0x66')]['rawAttributes']);_0x59659b[_0x54d8('0x31')]=_[_0x54d8('0x32')](_0x2caed4['query']);_0x59659b[_0x54d8('0x33')]=_[_0x54d8('0x34')](_0x59659b['model'],_0x59659b[_0x54d8('0x31')]);_0x111a50[_0x54d8('0x35')]=_[_0x54d8('0x34')](_0x59659b[_0x54d8('0x30')],qs[_0x54d8('0x36')](_0x2caed4[_0x54d8('0x31')][_0x54d8('0x36')]));_0x111a50[_0x54d8('0x35')]=_0x111a50[_0x54d8('0x35')][_0x54d8('0x37')]?_0x111a50['attributes']:_0x59659b[_0x54d8('0x30')];_0x111a50[_0x54d8('0x56')]=qs[_0x54d8('0x39')](_0x2caed4[_0x54d8('0x31')][_0x54d8('0x39')]);_0x111a50[_0x54d8('0x3a')]=qs['filters'](_[_0x54d8('0x57')](_0x2caed4[_0x54d8('0x31')],_0x59659b['filters']));if(_0x2caed4[_0x54d8('0x31')][_0x54d8('0x3c')]){_0x111a50[_0x54d8('0x3a')]=_['merge'](_0x111a50[_0x54d8('0x3a')],{'$or':_[_0x54d8('0x2b')](_0x111a50[_0x54d8('0x35')],function(_0x278370){var _0x71a06={};_0x71a06[_0x278370]={'$like':'%'+_0x2caed4[_0x54d8('0x31')][_0x54d8('0x3c')]+'%'};return _0x71a06;})});}_0x111a50=_[_0x54d8('0x3d')]({},_0x111a50,_0x2caed4[_0x54d8('0x45')]);return _0x2eb804['getAgents'](_0x111a50);}})['then'](function(_0x455d93){if(_0x455d93){_0x4af7c4=_0x455d93['length'];if(!_0x2caed4[_0x54d8('0x31')]['hasOwnProperty'](_0x54d8('0x38'))){_0x111a50[_0x54d8('0x1c')]=qs[_0x54d8('0x1c')](_0x2caed4[_0x54d8('0x31')]['limit']);_0x111a50[_0x54d8('0x1b')]=qs[_0x54d8('0x1b')](_0x2caed4[_0x54d8('0x31')][_0x54d8('0x1b')]);}return _0x2eb804[_0x54d8('0x7a')](_0x111a50);}})['then'](function(_0x366186){if(_0x366186){return _0x366186?{'count':_0x4af7c4,'rows':_0x366186}:null;}})['then'](respondWithResult(_0x20ebb6,null))[_0x54d8('0x47')](handleError(_0x20ebb6,null));};
\ No newline at end of file
+var _0x05bc=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getQueues','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','addQueues','findOne','ids','removeQueues','Queues','Mail','Sms','Fax','Openchannel','Whatsapp','each','addAgents','Voice','User','online','voicePause','interface','UserVoiceQueueRt','format','SIP/%s','userTeam:save','removeAgents','voice','mail','fax','openchannel','isArray','emit','userTeam:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','map','Team','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll'];(function(_0x5b8ff2,_0x23898c){var _0x533be2=function(_0x119b29){while(--_0x119b29){_0x5b8ff2['push'](_0x5b8ff2['shift']());}};_0x533be2(++_0x23898c);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc05b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc05b('0x1'));var jsonpatch=require(_0xc05b('0x2'));var rp=require('request-promise');var moment=require(_0xc05b('0x3'));var BPromise=require(_0xc05b('0x4'));var Mustache=require(_0xc05b('0x5'));var util=require(_0xc05b('0x6'));var path=require(_0xc05b('0x7'));var sox=require(_0xc05b('0x8'));var csv=require(_0xc05b('0x9'));var ejs=require(_0xc05b('0xa'));var fs=require('fs');var _=require(_0xc05b('0xb'));var squel=require(_0xc05b('0xc'));var crypto=require(_0xc05b('0xd'));var jsforce=require(_0xc05b('0xe'));var deskjs=require(_0xc05b('0xf'));var toCsv=require(_0xc05b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc05b('0x10'));var authService=require(_0xc05b('0x11'));var qs=require(_0xc05b('0x12'));var as=require(_0xc05b('0x13'));var hardwareService=require(_0xc05b('0x14'));var logger=require(_0xc05b('0x15'))(_0xc05b('0x16'));var utils=require(_0xc05b('0x17'));var config=require(_0xc05b('0x18'));var db=require('../../mysqldb')['db'];config[_0xc05b('0x19')]=_[_0xc05b('0x1a')](config[_0xc05b('0x19')],{'host':_0xc05b('0x1b'),'port':0x18eb});var socket=require(_0xc05b('0x1c'))(new Redis(config[_0xc05b('0x19')]));require('./team.socket')[_0xc05b('0x1d')](socket);function respondWithStatusCode(_0x6b1880,_0x55ec04){_0x55ec04=_0x55ec04||0xcc;return function(_0x4d4698){if(_0x4d4698){return _0x6b1880[_0xc05b('0x1e')](_0x55ec04);}return _0x6b1880[_0xc05b('0x1f')](_0x55ec04)[_0xc05b('0x20')]();};}function respondWithResult(_0xcceda9,_0x387036){_0x387036=_0x387036||0xc8;return function(_0x21435e){if(_0x21435e){return _0xcceda9[_0xc05b('0x1f')](_0x387036)['json'](_0x21435e);}};}function respondWithFilteredResult(_0x42395b,_0x13c79f){return function(_0xee4d8){if(_0xee4d8){var _0x421cb=_0xee4d8[_0xc05b('0x21')],_0x1cba94=_0x13c79f['offset'],_0x403290=_0x13c79f[_0xc05b('0x22')]+_0x13c79f[_0xc05b('0x23')],_0x58224d;if(_0x403290>=_0x421cb){_0x403290=_0x421cb;_0x58224d=0xc8;}else{_0x58224d=0xce;}_0x42395b[_0xc05b('0x1f')](_0x58224d);return _0x42395b[_0xc05b('0x24')](_0xc05b('0x25'),_0x1cba94+'-'+_0x403290+'/'+_0x421cb)['json'](_0xee4d8);}return null;};}function patchUpdates(_0x10eb99){return function(_0x40de30){try{jsonpatch[_0xc05b('0x26')](_0x40de30,_0x10eb99,!![]);}catch(_0x311fcb){return BPromise['reject'](_0x311fcb);}return _0x40de30[_0xc05b('0x27')]();};}function saveUpdates(_0x456930,_0x2692c2){return function(_0x1edaa0){if(_0x1edaa0){return _0x1edaa0[_0xc05b('0x28')](_0x456930)[_0xc05b('0x29')](function(_0x4938d9){return _0x4938d9;});}return null;};}function removeEntity(_0x585447,_0x2699fb){return function(_0x382743){if(_0x382743){return _0x382743['destroy']()[_0xc05b('0x29')](function(){var _0x5b9e1f=_0x382743['get']({'plain':!![]});var _0x19cadd='Teams';return db['UserProfileResource']['destroy']({'where':{'type':_0x19cadd,'resourceId':_0x5b9e1f['id']}})[_0xc05b('0x29')](function(){return _0x382743;});})['then'](function(){_0x585447[_0xc05b('0x1f')](0xcc)[_0xc05b('0x20')]();});}};}function handleEntityNotFound(_0x4d1fd4,_0x337cc1){return function(_0x395baa){if(!_0x395baa){_0x4d1fd4[_0xc05b('0x1e')](0x194);}return _0x395baa;};}function handleError(_0x3e26c4,_0x23a937){_0x23a937=_0x23a937||0x1f4;return function(_0xeb6d8b){logger[_0xc05b('0x2a')](_0xeb6d8b[_0xc05b('0x2b')]);if(_0xeb6d8b[_0xc05b('0x2c')]){delete _0xeb6d8b[_0xc05b('0x2c')];}_0x3e26c4[_0xc05b('0x1f')](_0x23a937)[_0xc05b('0x2d')](_0xeb6d8b);};}exports['index']=function(_0x3ca295,_0x56cc4a){var _0x370d05={},_0x54286a={},_0x580d43={'count':0x0,'rows':[]};var _0x78333=_[_0xc05b('0x2e')](db[_0xc05b('0x2f')]['rawAttributes'],function(_0x884fcb){return{'name':_0x884fcb['fieldName'],'type':_0x884fcb['type']['key']};});_0x54286a[_0xc05b('0x30')]=_[_0xc05b('0x2e')](_0x78333,_0xc05b('0x2c'));_0x54286a['query']=_[_0xc05b('0x31')](_0x3ca295[_0xc05b('0x32')]);_0x54286a[_0xc05b('0x33')]=_[_0xc05b('0x34')](_0x54286a['model'],_0x54286a[_0xc05b('0x32')]);_0x370d05[_0xc05b('0x35')]=_[_0xc05b('0x34')](_0x54286a['model'],qs[_0xc05b('0x36')](_0x3ca295[_0xc05b('0x32')]['fields']));_0x370d05[_0xc05b('0x35')]=_0x370d05[_0xc05b('0x35')]['length']?_0x370d05['attributes']:_0x54286a[_0xc05b('0x30')];if(!_0x3ca295[_0xc05b('0x32')][_0xc05b('0x37')](_0xc05b('0x38'))){_0x370d05['limit']=qs[_0xc05b('0x23')](_0x3ca295['query'][_0xc05b('0x23')]);_0x370d05[_0xc05b('0x22')]=qs[_0xc05b('0x22')](_0x3ca295[_0xc05b('0x32')]['offset']);}_0x370d05[_0xc05b('0x39')]=qs[_0xc05b('0x3a')](_0x3ca295['query']['sort']);_0x370d05[_0xc05b('0x3b')]=qs[_0xc05b('0x33')](_[_0xc05b('0x3c')](_0x3ca295[_0xc05b('0x32')],_0x54286a[_0xc05b('0x33')]),_0x78333);if(_0x3ca295['query'][_0xc05b('0x3d')]){_0x370d05[_0xc05b('0x3b')]=_[_0xc05b('0x3e')](_0x370d05[_0xc05b('0x3b')],{'$or':_['map'](_0x78333,function(_0x58a796){if(_0x58a796[_0xc05b('0x3f')]!=='VIRTUAL'){var _0xbeeded={};_0xbeeded[_0x58a796['name']]={'$like':'%'+_0x3ca295[_0xc05b('0x32')][_0xc05b('0x3d')]+'%'};return _0xbeeded;}})});}_0x370d05=_[_0xc05b('0x3e')]({},_0x370d05,_0x3ca295[_0xc05b('0x40')]);var _0x5bf0b5={'where':_0x370d05['where']};return db[_0xc05b('0x2f')]['count'](_0x5bf0b5)[_0xc05b('0x29')](function(_0x482770){_0x580d43[_0xc05b('0x21')]=_0x482770;if(_0x3ca295[_0xc05b('0x32')]['includeAll']){_0x370d05[_0xc05b('0x41')]=[{'all':!![]}];}return db[_0xc05b('0x2f')][_0xc05b('0x42')](_0x370d05);})[_0xc05b('0x29')](function(_0x6d9709){_0x580d43[_0xc05b('0x43')]=_0x6d9709;return _0x580d43;})[_0xc05b('0x29')](respondWithFilteredResult(_0x56cc4a,_0x370d05))[_0xc05b('0x44')](handleError(_0x56cc4a,null));};exports[_0xc05b('0x45')]=function(_0x30ea24,_0x426231){var _0x4b6ef9={'raw':![],'where':{'id':_0x30ea24[_0xc05b('0x46')]['id']}},_0x122aa2={};_0x122aa2[_0xc05b('0x30')]=_['keys'](db[_0xc05b('0x2f')][_0xc05b('0x47')]);_0x122aa2[_0xc05b('0x32')]=_[_0xc05b('0x31')](_0x30ea24['query']);_0x122aa2[_0xc05b('0x33')]=_[_0xc05b('0x34')](_0x122aa2['model'],_0x122aa2[_0xc05b('0x32')]);_0x4b6ef9[_0xc05b('0x35')]=_[_0xc05b('0x34')](_0x122aa2['model'],qs[_0xc05b('0x36')](_0x30ea24[_0xc05b('0x32')][_0xc05b('0x36')]));_0x4b6ef9[_0xc05b('0x35')]=_0x4b6ef9[_0xc05b('0x35')][_0xc05b('0x48')]?_0x4b6ef9[_0xc05b('0x35')]:_0x122aa2['model'];if(_0x30ea24[_0xc05b('0x32')][_0xc05b('0x49')]){_0x4b6ef9[_0xc05b('0x41')]=[{'all':!![]}];}_0x4b6ef9=_[_0xc05b('0x3e')]({},_0x4b6ef9,_0x30ea24[_0xc05b('0x40')]);return db['Team'][_0xc05b('0x4a')](_0x4b6ef9)[_0xc05b('0x29')](handleEntityNotFound(_0x426231,null))[_0xc05b('0x29')](respondWithResult(_0x426231,null))[_0xc05b('0x44')](handleError(_0x426231,null));};exports[_0xc05b('0x4b')]=function(_0x45467,_0xe7e2a3){return db['Team'][_0xc05b('0x4b')](_0x45467[_0xc05b('0x4c')],{})[_0xc05b('0x29')](function(_0x227a4f){var _0x3a0f9d=_0x45467[_0xc05b('0x4d')]['get']({'plain':!![]});if(!_0x3a0f9d)throw new Error(_0xc05b('0x4e'));if(_0x3a0f9d[_0xc05b('0x4f')]==='user'){var _0xc2dc13=_0x227a4f[_0xc05b('0x50')]({'plain':!![]});var _0x115283=_0xc05b('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x115283,'userProfileId':_0x3a0f9d[_0xc05b('0x52')]},'raw':!![]})[_0xc05b('0x29')](function(_0x210adf){if(_0x210adf&&_0x210adf[_0xc05b('0x53')]===0x0){return db['UserProfileResource'][_0xc05b('0x4b')]({'name':_0xc2dc13['name'],'resourceId':_0xc2dc13['id'],'type':_0x210adf['name'],'sectionId':_0x210adf['id']},{})[_0xc05b('0x29')](function(){return _0x227a4f;});}else{return _0x227a4f;}})[_0xc05b('0x44')](function(_0x12fb0b){logger[_0xc05b('0x2a')](_0xc05b('0x54'),_0x12fb0b);throw _0x12fb0b;});}return _0x227a4f;})['then'](respondWithResult(_0xe7e2a3,0xc9))[_0xc05b('0x44')](handleError(_0xe7e2a3,null));};exports['update']=function(_0x117cb9,_0x28a670){if(_0x117cb9[_0xc05b('0x4c')]['id']){delete _0x117cb9['body']['id'];}return db[_0xc05b('0x2f')][_0xc05b('0x4a')]({'where':{'id':_0x117cb9[_0xc05b('0x46')]['id']}})[_0xc05b('0x29')](handleEntityNotFound(_0x28a670,null))[_0xc05b('0x29')](saveUpdates(_0x117cb9[_0xc05b('0x4c')],null))[_0xc05b('0x29')](respondWithResult(_0x28a670,null))['catch'](handleError(_0x28a670,null));};exports[_0xc05b('0x55')]=function(_0x12db76,_0x2d2085){return db[_0xc05b('0x2f')]['find']({'where':{'id':_0x12db76[_0xc05b('0x46')]['id']}})[_0xc05b('0x29')](handleEntityNotFound(_0x2d2085,null))['then'](removeEntity(_0x2d2085,null))[_0xc05b('0x44')](handleError(_0x2d2085,null));};exports[_0xc05b('0x56')]=function(_0x36810e,_0x1c01fe,_0x506db6){return db[_0xc05b('0x2f')]['findOne']({'where':{'id':_0x36810e['params']['id']}})[_0xc05b('0x29')](handleEntityNotFound(_0x1c01fe,null))['then'](function(_0x297ca9){if(!_0x36810e[_0xc05b('0x32')][_0xc05b('0x57')]||!utils[_0xc05b('0x58')](_0x36810e[_0xc05b('0x32')][_0xc05b('0x57')])){throw new db[(_0xc05b('0x59'))][(_0xc05b('0x5a'))](_0xc05b('0x5b'));}var _0x211c90={};var _0x147444={};_0x147444[_0xc05b('0x30')]=_[_0xc05b('0x31')](db[_[_0xc05b('0x5c')](_0x36810e['query'][_0xc05b('0x57')][_0xc05b('0x5d')]())+'Queue']['rawAttributes']);_0x147444[_0xc05b('0x32')]=_[_0xc05b('0x31')](_0x36810e[_0xc05b('0x32')]);_0x147444[_0xc05b('0x33')]=_[_0xc05b('0x34')](_0x147444[_0xc05b('0x30')],_0x147444[_0xc05b('0x32')]);_0x211c90[_0xc05b('0x35')]=_[_0xc05b('0x34')](_0x147444[_0xc05b('0x30')],qs[_0xc05b('0x36')](_0x36810e[_0xc05b('0x32')][_0xc05b('0x36')]));_0x211c90[_0xc05b('0x35')]=_0x211c90[_0xc05b('0x35')]['length']?_0x211c90[_0xc05b('0x35')]:_0x147444[_0xc05b('0x30')];_0x211c90[_0xc05b('0x23')]=qs[_0xc05b('0x23')](_0x36810e[_0xc05b('0x32')][_0xc05b('0x23')]);_0x211c90['offset']=qs[_0xc05b('0x22')](_0x36810e['query'][_0xc05b('0x22')]);_0x211c90[_0xc05b('0x39')]=qs[_0xc05b('0x3a')](_0x36810e[_0xc05b('0x32')][_0xc05b('0x3a')]);_0x211c90[_0xc05b('0x3b')]=qs[_0xc05b('0x33')](_[_0xc05b('0x3c')](_0x36810e[_0xc05b('0x32')],_0x147444['filters']));_0x211c90=_[_0xc05b('0x3e')]({},_0x211c90,_0x36810e[_0xc05b('0x40')]);return _0x297ca9[_0xc05b('0x50')+_[_0xc05b('0x5c')](_0x36810e[_0xc05b('0x32')][_0xc05b('0x57')][_0xc05b('0x5d')]())+'Queues'](_0x211c90);})[_0xc05b('0x29')](respondWithResult(_0x1c01fe,null))[_0xc05b('0x44')](handleError(_0x1c01fe,null));};exports[_0xc05b('0x5e')]=function(_0xe2ba4c,_0x2efc30,_0xd25cb3){return db['Team'][_0xc05b('0x5f')]({'where':{'id':_0xe2ba4c[_0xc05b('0x46')]['id']}})[_0xc05b('0x29')](function(_0x1a0600){if(_0x1a0600){if(!_0xe2ba4c['body']['channel']||!utils[_0xc05b('0x58')](_0xe2ba4c[_0xc05b('0x4c')][_0xc05b('0x57')])){throw new db[(_0xc05b('0x59'))][(_0xc05b('0x5a'))]('Unknown\x20channel');}return _0x1a0600['add'+_[_0xc05b('0x5c')](_0xe2ba4c[_0xc05b('0x4c')][_0xc05b('0x57')][_0xc05b('0x5d')]())+'Queues'](_0xe2ba4c[_0xc05b('0x4c')][_0xc05b('0x60')]);}return null;})['then'](handleEntityNotFound(_0x2efc30,null))[_0xc05b('0x29')](respondWithStatusCode(_0x2efc30,null))[_0xc05b('0x44')](handleError(_0x2efc30,null));};exports[_0xc05b('0x61')]=function(_0x2446b8,_0x423685,_0x5c2895){return db[_0xc05b('0x2f')][_0xc05b('0x5f')]({'where':{'id':_0x2446b8[_0xc05b('0x46')]['id']}})[_0xc05b('0x29')](function(_0x5e1df8){if(_0x5e1df8){if(!_0x2446b8['query'][_0xc05b('0x57')]||!utils[_0xc05b('0x58')](_0x2446b8[_0xc05b('0x32')][_0xc05b('0x57')])){throw new db[(_0xc05b('0x59'))][(_0xc05b('0x5a'))](_0xc05b('0x5b'));}return _0x5e1df8['remove'+_[_0xc05b('0x5c')](_0x2446b8['query']['channel'][_0xc05b('0x5d')]())+_0xc05b('0x62')](_0x2446b8[_0xc05b('0x32')]['ids']);}return null;})[_0xc05b('0x29')](handleEntityNotFound(_0x423685,null))[_0xc05b('0x29')](respondWithStatusCode(_0x423685,null))[_0xc05b('0x44')](handleError(_0x423685,null));};exports['addAgents']=function(_0x2aaf45,_0x1abe24,_0x5c77b6){return db[_0xc05b('0x2f')]['find']({'where':{'id':_0x2aaf45[_0xc05b('0x46')]['id']}})[_0xc05b('0x29')](handleEntityNotFound(_0x1abe24,null))[_0xc05b('0x29')](function(_0x1b2acc){if(_0x1b2acc){var _0x5dd1c2=['Voice','Chat',_0xc05b('0x63'),_0xc05b('0x64'),_0xc05b('0x65'),_0xc05b('0x66'),_0xc05b('0x67')];return BPromise['each'](_0x5dd1c2,function(_0x200daa){return _0x1b2acc[_0xc05b('0x50')+_0x200daa+_0xc05b('0x62')]({'attributes':['id',_0xc05b('0x2c')]})[_0xc05b('0x29')](function(_0xc3b2cc){return BPromise[_0xc05b('0x68')](_0xc3b2cc,function(_0x1a2ec2){return _0x1a2ec2[_0xc05b('0x69')](_0x2aaf45[_0xc05b('0x4c')][_0xc05b('0x60')])[_0xc05b('0x29')](function(){if(_0x200daa===_0xc05b('0x6a')){return db[_0xc05b('0x6b')]['findAll']({'where':{'id':_0x2aaf45[_0xc05b('0x4c')][_0xc05b('0x60')]},'attributes':['id',_0xc05b('0x2c'),_0xc05b('0x6c'),_0xc05b('0x6d'),_0xc05b('0x6e')],'raw':!![]})['then'](function(_0x5df82e){return BPromise[_0xc05b('0x68')](_[_0xc05b('0x3d')](_0x5df82e,{'online':0x1}),function(_0x249478){return db[_0xc05b('0x6f')]['upsert']({'membername':_0x249478[_0xc05b('0x2c')],'UserId':_0x249478['id'],'queue_name':_0x1a2ec2[_0xc05b('0x2c')],'VoiceQueueId':_0x1a2ec2['id'],'interface':_['isNil'](_0x249478[_0xc05b('0x6e')])?util[_0xc05b('0x70')](_0xc05b('0x71'),_0x249478[_0xc05b('0x2c')]):_0x249478[_0xc05b('0x6e')],'paused':_0x249478['voicePause']||![],'penalty':0x0});});});}});});})['then'](function(){return _0x1b2acc;});})[_0xc05b('0x29')](function(){return _0x1b2acc;});}})[_0xc05b('0x29')](function(_0x54c731){if(_0x54c731){return _0x54c731['addAgents'](_0x2aaf45[_0xc05b('0x4c')]['ids'],_['omit'](_0x2aaf45['body'],['ids','id'])||{})['spread'](function(_0x37a2a5){for(var _0x50244d=0x0;_0x50244d<_0x2aaf45['body']['ids'][_0xc05b('0x48')];_0x50244d+=0x1){socket['emit'](_0xc05b('0x72'),{'UserId':_0x2aaf45[_0xc05b('0x4c')][_0xc05b('0x60')][_0x50244d],'TeamId':_0x2aaf45['params']['id']});}return _0x37a2a5;});}})[_0xc05b('0x29')](respondWithResult(_0x1abe24,null))[_0xc05b('0x44')](handleError(_0x1abe24,null));};exports[_0xc05b('0x73')]=function(_0xe40d91,_0x137ade,_0x939122){return db['Team'][_0xc05b('0x4a')]({'where':{'id':_0xe40d91['params']['id']}})[_0xc05b('0x29')](handleEntityNotFound(_0x137ade,null))['then'](function(_0x3285d3){if(_0x3285d3){return BPromise[_0xc05b('0x68')]([_0xc05b('0x74'),'chat',_0xc05b('0x75'),'sms',_0xc05b('0x76'),_0xc05b('0x77'),'whatsapp'],function(_0x56c855){return _0x3285d3[_0xc05b('0x50')+_[_0xc05b('0x5c')](_0x56c855)+_0xc05b('0x62')]({'attributes':['id',_0xc05b('0x2c')]})[_0xc05b('0x29')](function(_0x1bd6c2){return BPromise[_0xc05b('0x68')](_0x1bd6c2,function(_0x20f19a){return _0x20f19a['removeAgents'](_0xe40d91[_0xc05b('0x32')]['ids'])[_0xc05b('0x29')](function(){if(_0x56c855==='voice'){return db[_0xc05b('0x6f')][_0xc05b('0x55')]({'where':{'VoiceQueueId':_0x20f19a['id'],'UserId':_0xe40d91[_0xc05b('0x32')][_0xc05b('0x60')]}});}});});})[_0xc05b('0x29')](function(){return _0x3285d3;});})[_0xc05b('0x29')](function(){return _0x3285d3;});}})[_0xc05b('0x29')](function(_0x16875f){if(_0x16875f){return _0x16875f['removeAgents'](_0xe40d91[_0xc05b('0x32')][_0xc05b('0x60')])[_0xc05b('0x29')](function(){if(_[_0xc05b('0x78')](_0xe40d91[_0xc05b('0x32')][_0xc05b('0x60')])){for(var _0x4300da=0x0;_0x4300da<_0xe40d91[_0xc05b('0x32')][_0xc05b('0x60')]['length'];_0x4300da+=0x1){socket[_0xc05b('0x79')](_0xc05b('0x7a'),{'UserId':Number(_0xe40d91[_0xc05b('0x32')][_0xc05b('0x60')][_0x4300da]),'TeamId':Number(_0xe40d91[_0xc05b('0x46')]['id'])});}}else{socket['emit']('userTeam:remove',{'UserId':Number(_0xe40d91['query'][_0xc05b('0x60')]),'TeamId':Number(_0xe40d91[_0xc05b('0x46')]['id'])});}});}})[_0xc05b('0x29')](respondWithStatusCode(_0x137ade,null))[_0xc05b('0x44')](handleError(_0x137ade,null));};exports[_0xc05b('0x7b')]=function(_0x20cbb9,_0x179335,_0x2ac375){var _0x4818d2={};var _0x517846={};var _0x4bdb5c;var _0x4ca728;return db[_0xc05b('0x2f')]['findOne']({'where':{'id':_0x20cbb9[_0xc05b('0x46')]['id']}})[_0xc05b('0x29')](handleEntityNotFound(_0x179335,null))[_0xc05b('0x29')](function(_0x1e7dfa){if(_0x1e7dfa){_0x4bdb5c=_0x1e7dfa;_0x517846[_0xc05b('0x30')]=_[_0xc05b('0x31')](db[_0xc05b('0x6b')][_0xc05b('0x47')]);_0x517846['query']=_[_0xc05b('0x31')](_0x20cbb9[_0xc05b('0x32')]);_0x517846[_0xc05b('0x33')]=_[_0xc05b('0x34')](_0x517846[_0xc05b('0x30')],_0x517846['query']);_0x4818d2[_0xc05b('0x35')]=_[_0xc05b('0x34')](_0x517846[_0xc05b('0x30')],qs['fields'](_0x20cbb9[_0xc05b('0x32')][_0xc05b('0x36')]));_0x4818d2[_0xc05b('0x35')]=_0x4818d2[_0xc05b('0x35')]['length']?_0x4818d2[_0xc05b('0x35')]:_0x517846['model'];_0x4818d2[_0xc05b('0x39')]=qs['sort'](_0x20cbb9[_0xc05b('0x32')]['sort']);_0x4818d2[_0xc05b('0x3b')]=qs[_0xc05b('0x33')](_[_0xc05b('0x3c')](_0x20cbb9[_0xc05b('0x32')],_0x517846[_0xc05b('0x33')]));if(_0x20cbb9[_0xc05b('0x32')]['filter']){_0x4818d2[_0xc05b('0x3b')]=_['merge'](_0x4818d2[_0xc05b('0x3b')],{'$or':_[_0xc05b('0x2e')](_0x4818d2[_0xc05b('0x35')],function(_0x4d6659){var _0x36f32b={};_0x36f32b[_0x4d6659]={'$like':'%'+_0x20cbb9[_0xc05b('0x32')][_0xc05b('0x3d')]+'%'};return _0x36f32b;})});}_0x4818d2=_[_0xc05b('0x3e')]({},_0x4818d2,_0x20cbb9[_0xc05b('0x40')]);return _0x4bdb5c[_0xc05b('0x7b')](_0x4818d2);}})[_0xc05b('0x29')](function(_0x2a022f){if(_0x2a022f){_0x4ca728=_0x2a022f[_0xc05b('0x48')];if(!_0x20cbb9[_0xc05b('0x32')]['hasOwnProperty'](_0xc05b('0x38'))){_0x4818d2[_0xc05b('0x23')]=qs[_0xc05b('0x23')](_0x20cbb9[_0xc05b('0x32')][_0xc05b('0x23')]);_0x4818d2[_0xc05b('0x22')]=qs['offset'](_0x20cbb9[_0xc05b('0x32')][_0xc05b('0x22')]);}return _0x4bdb5c[_0xc05b('0x7b')](_0x4818d2);}})[_0xc05b('0x29')](function(_0x258ad0){if(_0x258ad0){return _0x258ad0?{'count':_0x4ca728,'rows':_0x258ad0}:null;}})[_0xc05b('0x29')](respondWithResult(_0x179335,null))['catch'](handleError(_0x179335,null));};
\ No newline at end of file
index 874c5d0..04a1d7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0255=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','Team'];(function(_0x5e336a,_0x437adb){var _0x141091=function(_0x26550c){while(--_0x26550c){_0x5e336a['push'](_0x5e336a['shift']());}};_0x141091(++_0x437adb);}(_0x0255,0xf1));var _0x5025=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0255[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var Team=require(_0x5025('0x0'))['db'][_0x5025('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x5025('0x2')](0x0);var events={'afterCreate':_0x5025('0x3'),'afterUpdate':_0x5025('0x4'),'afterDestroy':_0x5025('0x5')};function emitEvent(_0x249443){return function(_0x13da25,_0x4896a8,_0x309a27){TeamEvents[_0x5025('0x6')](_0x249443+':'+_0x13da25['id'],_0x13da25);TeamEvents[_0x5025('0x6')](_0x249443,_0x13da25);_0x309a27(null);};}for(var e in events){if(events[_0x5025('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x5025('0x8')]=TeamEvents;
\ No newline at end of file
+var _0x61b1=['remove','emit','hook','exports','../../mysqldb','Team','setMaxListeners'];(function(_0x11dbbe,_0x7b04d3){var _0x475061=function(_0x3677d3){while(--_0x3677d3){_0x11dbbe['push'](_0x11dbbe['shift']());}};_0x475061(++_0x7b04d3);}(_0x61b1,0x1e7));var _0x161b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x61b1[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var Team=require(_0x161b('0x0'))['db'][_0x161b('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x161b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x161b('0x3')};function emitEvent(_0x28c884){return function(_0x5e185e,_0x321d9a,_0x57d877){TeamEvents[_0x161b('0x4')](_0x28c884+':'+_0x5e185e['id'],_0x5e185e);TeamEvents[_0x161b('0x4')](_0x28c884,_0x5e185e);_0x57d877(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x161b('0x5')](e,emitEvent(event));}}module[_0x161b('0x6')]=TeamEvents;
\ No newline at end of file
index eaaad3d..67a3645 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x911f=['request-promise','rimraf','../../config/environment','./team.attributes','exports','define','teams','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x46d223,_0x501c93){var _0x4918e8=function(_0x26e222){while(--_0x26e222){_0x46d223['push'](_0x46d223['shift']());}};_0x4918e8(++_0x501c93);}(_0x911f,0x7c));var _0xf911=function(_0x1109b0,_0x548e2c){_0x1109b0=_0x1109b0-0x0;var _0x3d8d95=_0x911f[_0x1109b0];return _0x3d8d95;};'use strict';var _=require(_0xf911('0x0'));var util=require(_0xf911('0x1'));var logger=require(_0xf911('0x2'))(_0xf911('0x3'));var moment=require(_0xf911('0x4'));var BPromise=require(_0xf911('0x5'));var rp=require(_0xf911('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf911('0x7'));var config=require(_0xf911('0x8'));var attributes=require(_0xf911('0x9'));module[_0xf911('0xa')]=function(_0x5daa52,_0x334395){return _0x5daa52[_0xf911('0xb')]('Team',attributes,{'tableName':_0xf911('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe678=['Team','teams','lodash','../../config/logger','bluebird','path','../../config/environment','./team.attributes','define'];(function(_0x12c926,_0x158d01){var _0x14ba0f=function(_0x39fb1f){while(--_0x39fb1f){_0x12c926['push'](_0x12c926['shift']());}};_0x14ba0f(++_0x158d01);}(_0xe678,0x1a9));var _0x8e67=function(_0x27fd39,_0x500539){_0x27fd39=_0x27fd39-0x0;var _0x32d4c6=_0xe678[_0x27fd39];return _0x32d4c6;};'use strict';var _=require(_0x8e67('0x0'));var util=require('util');var logger=require(_0x8e67('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8e67('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e67('0x3'));var rimraf=require('rimraf');var config=require(_0x8e67('0x4'));var attributes=require(_0x8e67('0x5'));module['exports']=function(_0x379262,_0x22d178){return _0x379262[_0x8e67('0x6')](_0x8e67('0x7'),attributes,{'tableName':_0x8e67('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a37c673..a141734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f1a=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x3b6279,_0x2c07ee){var _0x179052=function(_0x5c7312){while(--_0x5c7312){_0x3b6279['push'](_0x3b6279['shift']());}};_0x179052(++_0x2c07ee);}(_0x9f1a,0xd0));var _0xa9f1=function(_0x5d9832,_0x49bfd5){_0x5d9832=_0x5d9832-0x0;var _0x36dbb0=_0x9f1a[_0x5d9832];return _0x36dbb0;};'use strict';var _=require(_0xa9f1('0x0'));var util=require(_0xa9f1('0x1'));var moment=require(_0xa9f1('0x2'));var BPromise=require(_0xa9f1('0x3'));var rs=require(_0xa9f1('0x4'));var fs=require('fs');var Redis=require(_0xa9f1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9f1('0x6'));var logger=require(_0xa9f1('0x7'))(_0xa9f1('0x8'));var config=require(_0xa9f1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9f1('0xa')][_0xa9f1('0xb')]({'port':0x232a});config[_0xa9f1('0xc')]=_[_0xa9f1('0xd')](config['redis'],{'host':_0xa9f1('0xe'),'port':0x18eb});var socket=require(_0xa9f1('0xf'))(new Redis(config[_0xa9f1('0xc')]));require(_0xa9f1('0x10'))[_0xa9f1('0x11')](socket);function respondWithRpcPromise(_0x43241e,_0x4000d3,_0x29e124){return new BPromise(function(_0x2ded73,_0x213871){return client[_0xa9f1('0x12')](_0x43241e,_0x29e124)[_0xa9f1('0x13')](function(_0x383903){logger[_0xa9f1('0x14')](_0xa9f1('0x15'),_0x4000d3,_0xa9f1('0x16'));logger[_0xa9f1('0x17')](_0xa9f1('0x18'),_0x4000d3,'request\x20sent',JSON[_0xa9f1('0x19')](_0x383903));if(_0x383903[_0xa9f1('0x1a')]){if(_0x383903['error'][_0xa9f1('0x1b')]===0x1f4){logger[_0xa9f1('0x1a')](_0xa9f1('0x15'),_0x4000d3,_0x383903[_0xa9f1('0x1a')]['message']);return _0x213871(_0x383903[_0xa9f1('0x1a')]['message']);}logger[_0xa9f1('0x1a')](_0xa9f1('0x15'),_0x4000d3,_0x383903[_0xa9f1('0x1a')]['message']);return _0x2ded73(_0x383903['error'][_0xa9f1('0x1c')]);}else{logger[_0xa9f1('0x14')](_0xa9f1('0x15'),_0x4000d3,'request\x20sent');_0x2ded73(_0x383903['result'][_0xa9f1('0x1c')]);}})[_0xa9f1('0x1d')](function(_0x4ae341){logger[_0xa9f1('0x1a')](_0xa9f1('0x15'),_0x4000d3,_0x4ae341);_0x213871(_0x4ae341);});});}
\ No newline at end of file
+var _0x357b=['error','Team,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1e0972,_0x2912a9){var _0x456ab8=function(_0x2b8c8b){while(--_0x2b8c8b){_0x1e0972['push'](_0x1e0972['shift']());}};_0x456ab8(++_0x2912a9);}(_0x357b,0x1e6));var _0xb357=function(_0x10f92c,_0x341dbf){_0x10f92c=_0x10f92c-0x0;var _0x10f4b3=_0x357b[_0x10f92c];return _0x10f4b3;};'use strict';var _=require(_0xb357('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb357('0x1'));var rs=require(_0xb357('0x2'));var fs=require('fs');var Redis=require(_0xb357('0x3'));var db=require(_0xb357('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb357('0x5'));var config=require('../../config/environment');var jayson=require(_0xb357('0x6'));var client=jayson[_0xb357('0x7')][_0xb357('0x8')]({'port':0x232a});config[_0xb357('0x9')]=_['defaults'](config[_0xb357('0x9')],{'host':_0xb357('0xa'),'port':0x18eb});var socket=require(_0xb357('0xb'))(new Redis(config[_0xb357('0x9')]));require('./team.socket')[_0xb357('0xc')](socket);function respondWithRpcPromise(_0x1febd7,_0x460cab,_0x55ce05){return new BPromise(function(_0x2a7321,_0x17d67f){return client[_0xb357('0xd')](_0x1febd7,_0x55ce05)[_0xb357('0xe')](function(_0x492e98){logger['info']('Team,\x20%s,\x20%s',_0x460cab,'request\x20sent');logger['debug'](_0xb357('0xf'),_0x460cab,_0xb357('0x10'),JSON[_0xb357('0x11')](_0x492e98));if(_0x492e98['error']){if(_0x492e98[_0xb357('0x12')]['code']===0x1f4){logger['error'](_0xb357('0x13'),_0x460cab,_0x492e98[_0xb357('0x12')]['message']);return _0x17d67f(_0x492e98[_0xb357('0x12')][_0xb357('0x14')]);}logger['error']('Team,\x20%s,\x20%s',_0x460cab,_0x492e98[_0xb357('0x12')][_0xb357('0x14')]);return _0x2a7321(_0x492e98[_0xb357('0x12')][_0xb357('0x14')]);}else{logger[_0xb357('0x15')](_0xb357('0x13'),_0x460cab,'request\x20sent');_0x2a7321(_0x492e98[_0xb357('0x16')][_0xb357('0x14')]);}})[_0xb357('0x17')](function(_0x5a64c6){logger[_0xb357('0x12')](_0xb357('0x13'),_0x460cab,_0x5a64c6);_0x17d67f(_0x5a64c6);});});}
\ No newline at end of file
index 64042fa..e3c849c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c16=['register','length','./team.events','save','remove','emit','removeListener'];(function(_0x287b81,_0x34db46){var _0x246acb=function(_0x13b052){while(--_0x13b052){_0x287b81['push'](_0x287b81['shift']());}};_0x246acb(++_0x34db46);}(_0x2c16,0xf0));var _0x62c1=function(_0x3a2bea,_0x438a33){_0x3a2bea=_0x3a2bea-0x0;var _0x593ebe=_0x2c16[_0x3a2bea];return _0x593ebe;};'use strict';var TeamEvents=require(_0x62c1('0x0'));var events=[_0x62c1('0x1'),_0x62c1('0x2'),'update'];function createListener(_0x20809a,_0x19cff5){return function(_0x6ab2ff){_0x19cff5[_0x62c1('0x3')](_0x20809a,_0x6ab2ff);};}function removeListener(_0x8b3478,_0x4521ed){return function(){TeamEvents[_0x62c1('0x4')](_0x8b3478,_0x4521ed);};}exports[_0x62c1('0x5')]=function(_0x34eca5){for(var _0x24f289=0x0,_0x527671=events[_0x62c1('0x6')];_0x24f289<_0x527671;_0x24f289++){var _0x4bcc7b=events[_0x24f289];var _0x236518=createListener('team:'+_0x4bcc7b,_0x34eca5);TeamEvents['on'](_0x4bcc7b,_0x236518);}};
\ No newline at end of file
+var _0xbedb=['update','emit','removeListener','register','length','team:','./team.events','remove'];(function(_0x32cce8,_0x18762f){var _0x4a732b=function(_0x5a3a21){while(--_0x5a3a21){_0x32cce8['push'](_0x32cce8['shift']());}};_0x4a732b(++_0x18762f);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0xbbed('0x0'));var events=['save',_0xbbed('0x1'),_0xbbed('0x2')];function createListener(_0x3e475c,_0x57817e){return function(_0x4e6b39){_0x57817e[_0xbbed('0x3')](_0x3e475c,_0x4e6b39);};}function removeListener(_0x1096c8,_0x6b20a4){return function(){TeamEvents[_0xbbed('0x4')](_0x1096c8,_0x6b20a4);};}exports[_0xbbed('0x5')]=function(_0x281e33){for(var _0x1c8c9a=0x0,_0x3a3d9c=events[_0xbbed('0x6')];_0x1c8c9a<_0x3a3d9c;_0x1c8c9a++){var _0x42f499=events[_0x1c8c9a];var _0x51d8c6=createListener(_0xbbed('0x7')+_0x42f499,_0x281e33);TeamEvents['on'](_0x42f499,_0x51d8c6);}};
\ No newline at end of file
index 1d012b1..4be2baa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9059=['/:id','show','post','isAuthenticated','create','put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','index','get'];(function(_0x247b8f,_0x1f1b17){var _0x276bcb=function(_0x2904a9){while(--_0x2904a9){_0x247b8f['push'](_0x247b8f['shift']());}};_0x276bcb(++_0x1f1b17);}(_0x9059,0x8d));var _0x9905=function(_0x5ad13a,_0x2a2744){_0x5ad13a=_0x5ad13a-0x0;var _0x67da24=_0x9059[_0x5ad13a];return _0x67da24;};'use strict';var multer=require(_0x9905('0x0'));var util=require(_0x9905('0x1'));var path=require(_0x9905('0x2'));var timeout=require(_0x9905('0x3'));var express=require(_0x9905('0x4'));var router=express['Router']();var auth=require(_0x9905('0x5'));var interaction=require(_0x9905('0x6'));var config=require(_0x9905('0x7'));var controller=require(_0x9905('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9905('0x9')]);router[_0x9905('0xa')](_0x9905('0xb'),auth['isAuthenticated'](),controller[_0x9905('0xc')]);router[_0x9905('0xd')]('/',auth[_0x9905('0xe')](),controller[_0x9905('0xf')]);router[_0x9905('0x10')](_0x9905('0xb'),auth[_0x9905('0xe')](),controller['update']);router['delete'](_0x9905('0xb'),auth[_0x9905('0xe')](),controller[_0x9905('0x11')]);module[_0x9905('0x12')]=router;
\ No newline at end of file
+var _0xb0de=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x291dfb,_0x8de8cd){var _0x352673=function(_0xc76cd7){while(--_0xc76cd7){_0x291dfb['push'](_0x291dfb['shift']());}};_0x352673(++_0x8de8cd);}(_0xb0de,0x1ba));var _0xeb0d=function(_0xf7eba2,_0x16caf4){_0xf7eba2=_0xf7eba2-0x0;var _0x1cffa6=_0xb0de[_0xf7eba2];return _0x1cffa6;};'use strict';var multer=require(_0xeb0d('0x0'));var util=require('util');var path=require(_0xeb0d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeb0d('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xeb0d('0x3'));var config=require(_0xeb0d('0x4'));var controller=require(_0xeb0d('0x5'));router[_0xeb0d('0x6')]('/',auth[_0xeb0d('0x7')](),controller[_0xeb0d('0x8')]);router[_0xeb0d('0x6')](_0xeb0d('0x9'),auth[_0xeb0d('0x7')](),controller[_0xeb0d('0xa')]);router[_0xeb0d('0xb')]('/',auth[_0xeb0d('0x7')](),controller[_0xeb0d('0xc')]);router[_0xeb0d('0xd')](_0xeb0d('0x9'),auth[_0xeb0d('0x7')](),controller[_0xeb0d('0xe')]);router[_0xeb0d('0xf')](_0xeb0d('0x9'),auth[_0xeb0d('0x7')](),controller[_0xeb0d('0x10')]);module[_0xeb0d('0x11')]=router;
\ No newline at end of file
index 817d13c..bcc0f8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaa6=['TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaaa6,0xd9));var _0x6aaa=function(_0x319036,_0x1bc987){_0x319036=_0x319036-0x0;var _0x356faf=_0xaaa6[_0x319036];return _0x356faf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6aaa('0x0')]},'description':{'type':Sequelize[_0x6aaa('0x0')]},'html':{'type':Sequelize[_0x6aaa('0x1')]}};
\ No newline at end of file
+var _0x2f61=['sequelize','exports','STRING','TEXT'];(function(_0x2b6593,_0x616eca){var _0x2b95f6=function(_0x1ec974){while(--_0x1ec974){_0x2b6593['push'](_0x2b6593['shift']());}};_0x2b95f6(++_0x616eca);}(_0x2f61,0x15c));var _0x12f6=function(_0x567760,_0x282c85){_0x567760=_0x567760-0x0;var _0xbfbb92=_0x2f61[_0x567760];return _0xbfbb92;};'use strict';var Sequelize=require(_0x12f6('0x0'));module[_0x12f6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x12f6('0x2')]},'html':{'type':Sequelize[_0x12f6('0x3')]}};
\ No newline at end of file
index de50b0d..ae2bb5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d16=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','index','map','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','Template','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x0d16,0xe9));var _0x60d1=function(_0x323f8e,_0x3bc389){_0x323f8e=_0x323f8e-0x0;var _0xeeab06=_0x0d16[_0x323f8e];return _0xeeab06;};'use strict';var pdf=require(_0x60d1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x60d1('0x1'));var zipdir=require(_0x60d1('0x2'));var jsonpatch=require(_0x60d1('0x3'));var rp=require(_0x60d1('0x4'));var moment=require(_0x60d1('0x5'));var BPromise=require(_0x60d1('0x6'));var Mustache=require(_0x60d1('0x7'));var util=require(_0x60d1('0x8'));var path=require(_0x60d1('0x9'));var sox=require(_0x60d1('0xa'));var csv=require('to-csv');var ejs=require(_0x60d1('0xb'));var fs=require('fs');var _=require(_0x60d1('0xc'));var squel=require(_0x60d1('0xd'));var crypto=require(_0x60d1('0xe'));var jsforce=require(_0x60d1('0xf'));var deskjs=require(_0x60d1('0x10'));var toCsv=require(_0x60d1('0x11'));var querystring=require(_0x60d1('0x12'));var Papa=require('papaparse');var Redis=require(_0x60d1('0x13'));var authService=require(_0x60d1('0x14'));var qs=require(_0x60d1('0x15'));var as=require(_0x60d1('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60d1('0x17'))(_0x60d1('0x18'));var utils=require(_0x60d1('0x19'));var config=require(_0x60d1('0x1a'));var db=require(_0x60d1('0x1b'))['db'];function respondWithStatusCode(_0x47ba31,_0x21e3c7){_0x21e3c7=_0x21e3c7||0xcc;return function(_0x4d184a){if(_0x4d184a){return _0x47ba31[_0x60d1('0x1c')](_0x21e3c7);}return _0x47ba31[_0x60d1('0x1d')](_0x21e3c7)[_0x60d1('0x1e')]();};}function respondWithResult(_0x54379c,_0x386f14){_0x386f14=_0x386f14||0xc8;return function(_0x539c7b){if(_0x539c7b){return _0x54379c['status'](_0x386f14)[_0x60d1('0x1f')](_0x539c7b);}};}function respondWithFilteredResult(_0x5382f4,_0x17de0a){return function(_0x363196){if(_0x363196){var _0x50ec68=_0x363196[_0x60d1('0x20')],_0x2c88ff=_0x17de0a[_0x60d1('0x21')],_0x1a7aa6=_0x17de0a[_0x60d1('0x21')]+_0x17de0a['limit'],_0x1aacbc;if(_0x1a7aa6>=_0x50ec68){_0x1a7aa6=_0x50ec68;_0x1aacbc=0xc8;}else{_0x1aacbc=0xce;}_0x5382f4['status'](_0x1aacbc);return _0x5382f4[_0x60d1('0x22')](_0x60d1('0x23'),_0x2c88ff+'-'+_0x1a7aa6+'/'+_0x50ec68)[_0x60d1('0x1f')](_0x363196);}return null;};}function patchUpdates(_0x318ef7){return function(_0x22c812){try{jsonpatch[_0x60d1('0x24')](_0x22c812,_0x318ef7,!![]);}catch(_0x3820e0){return BPromise[_0x60d1('0x25')](_0x3820e0);}return _0x22c812[_0x60d1('0x26')]();};}function saveUpdates(_0x102941,_0x34defb){return function(_0x5bb172){if(_0x5bb172){return _0x5bb172[_0x60d1('0x27')](_0x102941)[_0x60d1('0x28')](function(_0x4483cf){return _0x4483cf;});}return null;};}function removeEntity(_0x6caeea,_0xfb88f8){return function(_0x43e1f7){if(_0x43e1f7){return _0x43e1f7[_0x60d1('0x29')]()[_0x60d1('0x28')](function(){var _0x4a4421=_0x43e1f7[_0x60d1('0x2a')]({'plain':!![]});var _0x4f3570='Templates';return db['UserProfileResource'][_0x60d1('0x29')]({'where':{'type':_0x4f3570,'resourceId':_0x4a4421['id']}})[_0x60d1('0x28')](function(){return _0x43e1f7;});})[_0x60d1('0x28')](function(){_0x6caeea[_0x60d1('0x1d')](0xcc)[_0x60d1('0x1e')]();});}};}function handleEntityNotFound(_0x5165bc,_0x2d97be){return function(_0x4831d2){if(!_0x4831d2){_0x5165bc[_0x60d1('0x1c')](0x194);}return _0x4831d2;};}function handleError(_0x4a6ac9,_0x27ae0c){_0x27ae0c=_0x27ae0c||0x1f4;return function(_0x100e28){logger[_0x60d1('0x2b')](_0x100e28[_0x60d1('0x2c')]);if(_0x100e28['name']){delete _0x100e28[_0x60d1('0x2d')];}_0x4a6ac9[_0x60d1('0x1d')](_0x27ae0c)['send'](_0x100e28);};}exports[_0x60d1('0x2e')]=function(_0x30fadd,_0x5b25b1){var _0x1bb9da={},_0x44c0e9={},_0x399405={'count':0x0,'rows':[]};var _0x51cf73=_[_0x60d1('0x2f')](db['Template'][_0x60d1('0x30')],function(_0x221da0){return{'name':_0x221da0[_0x60d1('0x31')],'type':_0x221da0['type']['key']};});_0x44c0e9[_0x60d1('0x32')]=_[_0x60d1('0x2f')](_0x51cf73,'name');_0x44c0e9[_0x60d1('0x33')]=_['keys'](_0x30fadd['query']);_0x44c0e9['filters']=_[_0x60d1('0x34')](_0x44c0e9[_0x60d1('0x32')],_0x44c0e9[_0x60d1('0x33')]);_0x1bb9da[_0x60d1('0x35')]=_[_0x60d1('0x34')](_0x44c0e9[_0x60d1('0x32')],qs['fields'](_0x30fadd['query'][_0x60d1('0x36')]));_0x1bb9da['attributes']=_0x1bb9da[_0x60d1('0x35')][_0x60d1('0x37')]?_0x1bb9da[_0x60d1('0x35')]:_0x44c0e9[_0x60d1('0x32')];if(!_0x30fadd[_0x60d1('0x33')][_0x60d1('0x38')](_0x60d1('0x39'))){_0x1bb9da[_0x60d1('0x3a')]=qs['limit'](_0x30fadd[_0x60d1('0x33')][_0x60d1('0x3a')]);_0x1bb9da[_0x60d1('0x21')]=qs[_0x60d1('0x21')](_0x30fadd[_0x60d1('0x33')][_0x60d1('0x21')]);}_0x1bb9da[_0x60d1('0x3b')]=qs[_0x60d1('0x3c')](_0x30fadd['query'][_0x60d1('0x3c')]);_0x1bb9da[_0x60d1('0x3d')]=qs[_0x60d1('0x3e')](_[_0x60d1('0x3f')](_0x30fadd[_0x60d1('0x33')],_0x44c0e9[_0x60d1('0x3e')]),_0x51cf73);if(_0x30fadd[_0x60d1('0x33')][_0x60d1('0x40')]){_0x1bb9da[_0x60d1('0x3d')]=_[_0x60d1('0x41')](_0x1bb9da[_0x60d1('0x3d')],{'$or':_[_0x60d1('0x2f')](_0x51cf73,function(_0x14e29d){if(_0x14e29d['type']!=='VIRTUAL'){var _0x2b2685={};_0x2b2685[_0x14e29d['name']]={'$like':'%'+_0x30fadd[_0x60d1('0x33')][_0x60d1('0x40')]+'%'};return _0x2b2685;}})});}_0x1bb9da=_['merge']({},_0x1bb9da,_0x30fadd[_0x60d1('0x42')]);var _0x571782={'where':_0x1bb9da[_0x60d1('0x3d')]};return db[_0x60d1('0x43')][_0x60d1('0x20')](_0x571782)[_0x60d1('0x28')](function(_0x4bbab9){_0x399405[_0x60d1('0x20')]=_0x4bbab9;if(_0x30fadd['query'][_0x60d1('0x44')]){_0x1bb9da[_0x60d1('0x45')]=[{'all':!![]}];}return db[_0x60d1('0x43')][_0x60d1('0x46')](_0x1bb9da);})['then'](function(_0xc92500){_0x399405[_0x60d1('0x47')]=_0xc92500;return _0x399405;})[_0x60d1('0x28')](respondWithFilteredResult(_0x5b25b1,_0x1bb9da))[_0x60d1('0x48')](handleError(_0x5b25b1,null));};exports[_0x60d1('0x49')]=function(_0x51724c,_0x1fc914){var _0x27a8d3={'raw':!![],'where':{'id':_0x51724c[_0x60d1('0x4a')]['id']}},_0x4c641f={};_0x4c641f[_0x60d1('0x32')]=_[_0x60d1('0x4b')](db[_0x60d1('0x43')]['rawAttributes']);_0x4c641f[_0x60d1('0x33')]=_[_0x60d1('0x4b')](_0x51724c[_0x60d1('0x33')]);_0x4c641f[_0x60d1('0x3e')]=_['intersection'](_0x4c641f[_0x60d1('0x32')],_0x4c641f[_0x60d1('0x33')]);_0x27a8d3[_0x60d1('0x35')]=_[_0x60d1('0x34')](_0x4c641f['model'],qs[_0x60d1('0x36')](_0x51724c[_0x60d1('0x33')][_0x60d1('0x36')]));_0x27a8d3[_0x60d1('0x35')]=_0x27a8d3[_0x60d1('0x35')][_0x60d1('0x37')]?_0x27a8d3[_0x60d1('0x35')]:_0x4c641f['model'];if(_0x51724c[_0x60d1('0x33')][_0x60d1('0x44')]){_0x27a8d3[_0x60d1('0x45')]=[{'all':!![]}];}_0x27a8d3=_[_0x60d1('0x41')]({},_0x27a8d3,_0x51724c[_0x60d1('0x42')]);return db[_0x60d1('0x43')][_0x60d1('0x4c')](_0x27a8d3)[_0x60d1('0x28')](handleEntityNotFound(_0x1fc914,null))[_0x60d1('0x28')](respondWithResult(_0x1fc914,null))[_0x60d1('0x48')](handleError(_0x1fc914,null));};exports[_0x60d1('0x4d')]=function(_0x203fac,_0x37e635){return db[_0x60d1('0x43')]['create'](_0x203fac[_0x60d1('0x4e')],{})[_0x60d1('0x28')](function(_0xe95b95){var _0x191bae=_0x203fac['user'][_0x60d1('0x2a')]({'plain':!![]});if(!_0x191bae)throw new Error(_0x60d1('0x4f'));if(_0x191bae[_0x60d1('0x50')]==='user'){var _0x15ab20=_0xe95b95[_0x60d1('0x2a')]({'plain':!![]});var _0x24d8aa='Templates';return db[_0x60d1('0x51')][_0x60d1('0x4c')]({'where':{'name':_0x24d8aa,'userProfileId':_0x191bae['userProfileId']},'raw':!![]})[_0x60d1('0x28')](function(_0x386c6e){if(_0x386c6e&&_0x386c6e[_0x60d1('0x52')]===0x0){return db[_0x60d1('0x53')][_0x60d1('0x4d')]({'name':_0x15ab20[_0x60d1('0x2d')],'resourceId':_0x15ab20['id'],'type':_0x386c6e[_0x60d1('0x2d')],'sectionId':_0x386c6e['id']},{})[_0x60d1('0x28')](function(){return _0xe95b95;});}else{return _0xe95b95;}})[_0x60d1('0x48')](function(_0x13a077){logger[_0x60d1('0x2b')](_0x60d1('0x54'),_0x13a077);throw _0x13a077;});}return _0xe95b95;})[_0x60d1('0x28')](respondWithResult(_0x37e635,0xc9))[_0x60d1('0x48')](handleError(_0x37e635,null));};exports[_0x60d1('0x27')]=function(_0x180de5,_0x17598e){if(_0x180de5[_0x60d1('0x4e')]['id']){delete _0x180de5[_0x60d1('0x4e')]['id'];}return db[_0x60d1('0x43')][_0x60d1('0x4c')]({'where':{'id':_0x180de5[_0x60d1('0x4a')]['id']}})[_0x60d1('0x28')](handleEntityNotFound(_0x17598e,null))[_0x60d1('0x28')](saveUpdates(_0x180de5[_0x60d1('0x4e')],null))[_0x60d1('0x28')](respondWithResult(_0x17598e,null))[_0x60d1('0x48')](handleError(_0x17598e,null));};exports[_0x60d1('0x29')]=function(_0x33ff83,_0x1e4c24){return db[_0x60d1('0x43')][_0x60d1('0x4c')]({'where':{'id':_0x33ff83[_0x60d1('0x4a')]['id']}})[_0x60d1('0x28')](handleEntityNotFound(_0x1e4c24,null))[_0x60d1('0x28')](removeEntity(_0x1e4c24,null))[_0x60d1('0x48')](handleError(_0x1e4c24,null));};
\ No newline at end of file
+var _0x65dd=['limit','sort','where','filters','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','get','role','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','then','destroy','UserProfileResource','error','name','send','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty'];(function(_0x536a04,_0x158d1d){var _0x592eeb=function(_0x51b2a3){while(--_0x51b2a3){_0x536a04['push'](_0x536a04['shift']());}};_0x592eeb(++_0x158d1d);}(_0x65dd,0x6c));var _0xd65d=function(_0x2d6763,_0x16571b){_0x2d6763=_0x2d6763-0x0;var _0x449678=_0x65dd[_0x2d6763];return _0x449678;};'use strict';var pdf=require(_0xd65d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd65d('0x1'));var zipdir=require(_0xd65d('0x2'));var jsonpatch=require(_0xd65d('0x3'));var rp=require(_0xd65d('0x4'));var moment=require('moment');var BPromise=require(_0xd65d('0x5'));var Mustache=require(_0xd65d('0x6'));var util=require(_0xd65d('0x7'));var path=require(_0xd65d('0x8'));var sox=require(_0xd65d('0x9'));var csv=require(_0xd65d('0xa'));var ejs=require(_0xd65d('0xb'));var fs=require('fs');var _=require(_0xd65d('0xc'));var squel=require(_0xd65d('0xd'));var crypto=require(_0xd65d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd65d('0xf'));var toCsv=require(_0xd65d('0xa'));var querystring=require(_0xd65d('0x10'));var Papa=require('papaparse');var Redis=require(_0xd65d('0x11'));var authService=require(_0xd65d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd65d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd65d('0x14'))(_0xd65d('0x15'));var utils=require('../../config/utils');var config=require(_0xd65d('0x16'));var db=require(_0xd65d('0x17'))['db'];function respondWithStatusCode(_0x2759f2,_0x245402){_0x245402=_0x245402||0xcc;return function(_0x17cf14){if(_0x17cf14){return _0x2759f2[_0xd65d('0x18')](_0x245402);}return _0x2759f2[_0xd65d('0x19')](_0x245402)[_0xd65d('0x1a')]();};}function respondWithResult(_0x3625be,_0x83bce6){_0x83bce6=_0x83bce6||0xc8;return function(_0x2fce75){if(_0x2fce75){return _0x3625be[_0xd65d('0x19')](_0x83bce6)[_0xd65d('0x1b')](_0x2fce75);}};}function respondWithFilteredResult(_0x5a7219,_0x5d8d5b){return function(_0x3da298){if(_0x3da298){var _0x2d655c=_0x3da298[_0xd65d('0x1c')],_0x2b58d1=_0x5d8d5b[_0xd65d('0x1d')],_0x505866=_0x5d8d5b[_0xd65d('0x1d')]+_0x5d8d5b['limit'],_0x5002e1;if(_0x505866>=_0x2d655c){_0x505866=_0x2d655c;_0x5002e1=0xc8;}else{_0x5002e1=0xce;}_0x5a7219['status'](_0x5002e1);return _0x5a7219[_0xd65d('0x1e')]('Content-Range',_0x2b58d1+'-'+_0x505866+'/'+_0x2d655c)[_0xd65d('0x1b')](_0x3da298);}return null;};}function patchUpdates(_0x12c8b9){return function(_0x2e688a){try{jsonpatch[_0xd65d('0x1f')](_0x2e688a,_0x12c8b9,!![]);}catch(_0x235b6c){return BPromise['reject'](_0x235b6c);}return _0x2e688a[_0xd65d('0x20')]();};}function saveUpdates(_0x539c46,_0x572b16){return function(_0x1fdfa8){if(_0x1fdfa8){return _0x1fdfa8['update'](_0x539c46)[_0xd65d('0x21')](function(_0x3fefa7){return _0x3fefa7;});}return null;};}function removeEntity(_0x3448cd,_0x4eca18){return function(_0xb0e21d){if(_0xb0e21d){return _0xb0e21d[_0xd65d('0x22')]()[_0xd65d('0x21')](function(){var _0x1ec80c=_0xb0e21d['get']({'plain':!![]});var _0x1d909f='Templates';return db[_0xd65d('0x23')]['destroy']({'where':{'type':_0x1d909f,'resourceId':_0x1ec80c['id']}})['then'](function(){return _0xb0e21d;});})[_0xd65d('0x21')](function(){_0x3448cd['status'](0xcc)[_0xd65d('0x1a')]();});}};}function handleEntityNotFound(_0x35ae0e,_0x5b6100){return function(_0x38ac99){if(!_0x38ac99){_0x35ae0e[_0xd65d('0x18')](0x194);}return _0x38ac99;};}function handleError(_0x30283a,_0x14a7ce){_0x14a7ce=_0x14a7ce||0x1f4;return function(_0x575c8d){logger[_0xd65d('0x24')](_0x575c8d['stack']);if(_0x575c8d[_0xd65d('0x25')]){delete _0x575c8d[_0xd65d('0x25')];}_0x30283a[_0xd65d('0x19')](_0x14a7ce)[_0xd65d('0x26')](_0x575c8d);};}exports['index']=function(_0x39ea50,_0x512f84){var _0x4f3064={},_0x40989a={},_0x424151={'count':0x0,'rows':[]};var _0x575384=_[_0xd65d('0x27')](db[_0xd65d('0x28')][_0xd65d('0x29')],function(_0x2cd8df){return{'name':_0x2cd8df[_0xd65d('0x2a')],'type':_0x2cd8df[_0xd65d('0x2b')][_0xd65d('0x2c')]};});_0x40989a[_0xd65d('0x2d')]=_[_0xd65d('0x27')](_0x575384,_0xd65d('0x25'));_0x40989a[_0xd65d('0x2e')]=_[_0xd65d('0x2f')](_0x39ea50[_0xd65d('0x2e')]);_0x40989a['filters']=_[_0xd65d('0x30')](_0x40989a[_0xd65d('0x2d')],_0x40989a[_0xd65d('0x2e')]);_0x4f3064['attributes']=_[_0xd65d('0x30')](_0x40989a[_0xd65d('0x2d')],qs[_0xd65d('0x31')](_0x39ea50['query'][_0xd65d('0x31')]));_0x4f3064[_0xd65d('0x32')]=_0x4f3064[_0xd65d('0x32')]['length']?_0x4f3064[_0xd65d('0x32')]:_0x40989a[_0xd65d('0x2d')];if(!_0x39ea50[_0xd65d('0x2e')][_0xd65d('0x33')]('nolimit')){_0x4f3064[_0xd65d('0x34')]=qs[_0xd65d('0x34')](_0x39ea50[_0xd65d('0x2e')]['limit']);_0x4f3064['offset']=qs[_0xd65d('0x1d')](_0x39ea50[_0xd65d('0x2e')][_0xd65d('0x1d')]);}_0x4f3064['order']=qs[_0xd65d('0x35')](_0x39ea50[_0xd65d('0x2e')][_0xd65d('0x35')]);_0x4f3064[_0xd65d('0x36')]=qs[_0xd65d('0x37')](_[_0xd65d('0x38')](_0x39ea50[_0xd65d('0x2e')],_0x40989a[_0xd65d('0x37')]),_0x575384);if(_0x39ea50['query'][_0xd65d('0x39')]){_0x4f3064[_0xd65d('0x36')]=_['merge'](_0x4f3064[_0xd65d('0x36')],{'$or':_[_0xd65d('0x27')](_0x575384,function(_0x750c56){if(_0x750c56[_0xd65d('0x2b')]!==_0xd65d('0x3a')){var _0x25ba24={};_0x25ba24[_0x750c56[_0xd65d('0x25')]]={'$like':'%'+_0x39ea50[_0xd65d('0x2e')]['filter']+'%'};return _0x25ba24;}})});}_0x4f3064=_['merge']({},_0x4f3064,_0x39ea50[_0xd65d('0x3b')]);var _0x7bbbc3={'where':_0x4f3064['where']};return db[_0xd65d('0x28')]['count'](_0x7bbbc3)[_0xd65d('0x21')](function(_0x52949f){_0x424151[_0xd65d('0x1c')]=_0x52949f;if(_0x39ea50[_0xd65d('0x2e')]['includeAll']){_0x4f3064[_0xd65d('0x3c')]=[{'all':!![]}];}return db[_0xd65d('0x28')][_0xd65d('0x3d')](_0x4f3064);})[_0xd65d('0x21')](function(_0x488626){_0x424151[_0xd65d('0x3e')]=_0x488626;return _0x424151;})['then'](respondWithFilteredResult(_0x512f84,_0x4f3064))[_0xd65d('0x3f')](handleError(_0x512f84,null));};exports[_0xd65d('0x40')]=function(_0x5b01d3,_0x58aae8){var _0x1fbc9e={'raw':!![],'where':{'id':_0x5b01d3[_0xd65d('0x41')]['id']}},_0x253fde={};_0x253fde[_0xd65d('0x2d')]=_[_0xd65d('0x2f')](db[_0xd65d('0x28')][_0xd65d('0x29')]);_0x253fde[_0xd65d('0x2e')]=_[_0xd65d('0x2f')](_0x5b01d3[_0xd65d('0x2e')]);_0x253fde[_0xd65d('0x37')]=_[_0xd65d('0x30')](_0x253fde[_0xd65d('0x2d')],_0x253fde[_0xd65d('0x2e')]);_0x1fbc9e[_0xd65d('0x32')]=_[_0xd65d('0x30')](_0x253fde[_0xd65d('0x2d')],qs['fields'](_0x5b01d3['query']['fields']));_0x1fbc9e['attributes']=_0x1fbc9e['attributes'][_0xd65d('0x42')]?_0x1fbc9e['attributes']:_0x253fde[_0xd65d('0x2d')];if(_0x5b01d3['query'][_0xd65d('0x43')]){_0x1fbc9e[_0xd65d('0x3c')]=[{'all':!![]}];}_0x1fbc9e=_['merge']({},_0x1fbc9e,_0x5b01d3[_0xd65d('0x3b')]);return db[_0xd65d('0x28')][_0xd65d('0x44')](_0x1fbc9e)[_0xd65d('0x21')](handleEntityNotFound(_0x58aae8,null))[_0xd65d('0x21')](respondWithResult(_0x58aae8,null))[_0xd65d('0x3f')](handleError(_0x58aae8,null));};exports[_0xd65d('0x45')]=function(_0x210135,_0x15616e){return db[_0xd65d('0x28')][_0xd65d('0x45')](_0x210135[_0xd65d('0x46')],{})[_0xd65d('0x21')](function(_0x3abecd){var _0xd1da1=_0x210135[_0xd65d('0x47')][_0xd65d('0x48')]({'plain':!![]});if(!_0xd1da1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd1da1[_0xd65d('0x49')]===_0xd65d('0x47')){var _0x315002=_0x3abecd['get']({'plain':!![]});var _0x30bdee=_0xd65d('0x4a');return db[_0xd65d('0x4b')]['find']({'where':{'name':_0x30bdee,'userProfileId':_0xd1da1[_0xd65d('0x4c')]},'raw':!![]})[_0xd65d('0x21')](function(_0x3c3441){if(_0x3c3441&&_0x3c3441[_0xd65d('0x4d')]===0x0){return db[_0xd65d('0x23')][_0xd65d('0x45')]({'name':_0x315002[_0xd65d('0x25')],'resourceId':_0x315002['id'],'type':_0x3c3441['name'],'sectionId':_0x3c3441['id']},{})[_0xd65d('0x21')](function(){return _0x3abecd;});}else{return _0x3abecd;}})[_0xd65d('0x3f')](function(_0x244e13){logger[_0xd65d('0x24')](_0xd65d('0x4e'),_0x244e13);throw _0x244e13;});}return _0x3abecd;})[_0xd65d('0x21')](respondWithResult(_0x15616e,0xc9))[_0xd65d('0x3f')](handleError(_0x15616e,null));};exports[_0xd65d('0x4f')]=function(_0x23c032,_0x5c710d){if(_0x23c032[_0xd65d('0x46')]['id']){delete _0x23c032[_0xd65d('0x46')]['id'];}return db[_0xd65d('0x28')][_0xd65d('0x44')]({'where':{'id':_0x23c032[_0xd65d('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c710d,null))[_0xd65d('0x21')](saveUpdates(_0x23c032[_0xd65d('0x46')],null))[_0xd65d('0x21')](respondWithResult(_0x5c710d,null))['catch'](handleError(_0x5c710d,null));};exports[_0xd65d('0x22')]=function(_0x1440dc,_0x23e797){return db['Template'][_0xd65d('0x44')]({'where':{'id':_0x1440dc[_0xd65d('0x41')]['id']}})[_0xd65d('0x21')](handleEntityNotFound(_0x23e797,null))['then'](removeEntity(_0x23e797,null))[_0xd65d('0x3f')](handleError(_0x23e797,null));};
\ No newline at end of file
index 1b7375e..f2d3beb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d34=['bluebird','request-promise','path','./template.attributes','exports','define','lodash','util','moment'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x4d34,0x11d));var _0x44d3=function(_0x148677,_0x524be1){_0x148677=_0x148677-0x0;var _0x1c3a24=_0x4d34[_0x148677];return _0x1c3a24;};'use strict';var _=require(_0x44d3('0x0'));var util=require(_0x44d3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44d3('0x2'));var BPromise=require(_0x44d3('0x3'));var rp=require(_0x44d3('0x4'));var fs=require('fs');var path=require(_0x44d3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44d3('0x6'));module[_0x44d3('0x7')]=function(_0x5a1f21,_0xdd64e3){return _0x5a1f21[_0x44d3('0x8')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69de=['path','../../config/environment','define','Template','tools_templates','../../config/logger','moment','request-promise'];(function(_0x56ef99,_0x44ef07){var _0x4c6929=function(_0x28e455){while(--_0x28e455){_0x56ef99['push'](_0x56ef99['shift']());}};_0x4c6929(++_0x44ef07);}(_0x69de,0x19d));var _0xe69d=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x69de[_0x24259d];return _0x5a701;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe69d('0x0'))('api');var moment=require(_0xe69d('0x1'));var BPromise=require('bluebird');var rp=require(_0xe69d('0x2'));var fs=require('fs');var path=require(_0xe69d('0x3'));var rimraf=require('rimraf');var config=require(_0xe69d('0x4'));var attributes=require('./template.attributes');module['exports']=function(_0x3e29ec,_0x187cd2){return _0x3e29ec[_0xe69d('0x5')](_0xe69d('0x6'),attributes,{'tableName':_0xe69d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 91053d8..22d8bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e7b=['options','raw','where','limit','include','attributes','model','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetTemplate','Template','findAll'];(function(_0x50e104,_0x3fe5ac){var _0x54eff9=function(_0x4c97a2){while(--_0x4c97a2){_0x50e104['push'](_0x50e104['shift']());}};_0x54eff9(++_0x3fe5ac);}(_0x1e7b,0xae));var _0xb1e7=function(_0x4e0403,_0x23bb0a){_0x4e0403=_0x4e0403-0x0;var _0xb4ab4f=_0x1e7b[_0x4e0403];return _0xb4ab4f;};'use strict';var _=require(_0xb1e7('0x0'));var util=require(_0xb1e7('0x1'));var moment=require(_0xb1e7('0x2'));var BPromise=require(_0xb1e7('0x3'));var rs=require(_0xb1e7('0x4'));var fs=require('fs');var Redis=require(_0xb1e7('0x5'));var db=require(_0xb1e7('0x6'))['db'];var utils=require(_0xb1e7('0x7'));var logger=require(_0xb1e7('0x8'))(_0xb1e7('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb1e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3810d8,_0x25a93f,_0x18c143){return new BPromise(function(_0x5894a7,_0xcc1622){return client[_0xb1e7('0xb')](_0x3810d8,_0x18c143)[_0xb1e7('0xc')](function(_0x3d0092){logger[_0xb1e7('0xd')](_0xb1e7('0xe'),_0x25a93f,_0xb1e7('0xf'));logger['debug'](_0xb1e7('0x10'),_0x25a93f,_0xb1e7('0xf'),JSON['stringify'](_0x3d0092));if(_0x3d0092[_0xb1e7('0x11')]){if(_0x3d0092[_0xb1e7('0x11')]['code']===0x1f4){logger[_0xb1e7('0x11')](_0xb1e7('0xe'),_0x25a93f,_0x3d0092['error']['message']);return _0xcc1622(_0x3d0092[_0xb1e7('0x11')][_0xb1e7('0x12')]);}logger[_0xb1e7('0x11')](_0xb1e7('0xe'),_0x25a93f,_0x3d0092[_0xb1e7('0x11')][_0xb1e7('0x12')]);return _0x5894a7(_0x3d0092[_0xb1e7('0x11')][_0xb1e7('0x12')]);}else{logger['info'](_0xb1e7('0xe'),_0x25a93f,'request\x20sent');_0x5894a7(_0x3d0092[_0xb1e7('0x13')][_0xb1e7('0x12')]);}})[_0xb1e7('0x14')](function(_0x2e6bbc){logger[_0xb1e7('0x11')](_0xb1e7('0xe'),_0x25a93f,_0x2e6bbc);_0xcc1622(_0x2e6bbc);});});}exports[_0xb1e7('0x15')]=function(_0x17a720){var _0x3f9056=this;return new Promise(function(_0x2b173e,_0x257f31){return db[_0xb1e7('0x16')][_0xb1e7('0x17')]({'raw':_0x17a720[_0xb1e7('0x18')]?_0x17a720['options'][_0xb1e7('0x19')]===undefined?!![]:![]:!![],'where':_0x17a720[_0xb1e7('0x18')]?_0x17a720[_0xb1e7('0x18')][_0xb1e7('0x1a')]||null:null,'attributes':_0x17a720[_0xb1e7('0x18')]?_0x17a720[_0xb1e7('0x18')]['attributes']||null:null,'limit':_0x17a720[_0xb1e7('0x18')]?_0x17a720[_0xb1e7('0x18')][_0xb1e7('0x1b')]||null:null,'include':_0x17a720[_0xb1e7('0x18')]?_0x17a720[_0xb1e7('0x18')]['include']?_['map'](_0x17a720[_0xb1e7('0x18')][_0xb1e7('0x1c')],function(_0x17c325){return{'model':db[_0x17c325['model']],'as':_0x17c325['as'],'attributes':_0x17c325[_0xb1e7('0x1d')],'include':_0x17c325[_0xb1e7('0x1c')]?_['map'](_0x17c325[_0xb1e7('0x1c')],function(_0x1e1e92){return{'model':db[_0x1e1e92[_0xb1e7('0x1e')]],'as':_0x1e1e92['as'],'attributes':_0x1e1e92[_0xb1e7('0x1d')],'include':_0x1e1e92[_0xb1e7('0x1c')]?_[_0xb1e7('0x1f')](_0x1e1e92[_0xb1e7('0x1c')],function(_0x146b64){return{'model':db[_0x146b64[_0xb1e7('0x1e')]],'as':_0x146b64['as'],'attributes':_0x146b64[_0xb1e7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb1e7('0xc')](function(_0x23fbf9){logger[_0xb1e7('0xd')](_0xb1e7('0x15'),_0x17a720);logger[_0xb1e7('0x20')](_0xb1e7('0x15'),_0x17a720,JSON['stringify'](_0x23fbf9));_0x2b173e(_0x23fbf9);})[_0xb1e7('0x14')](function(_0x51f1af){logger[_0xb1e7('0x11')]('GetTemplate',_0x51f1af['message'],_0x17a720);_0x257f31(_0x3f9056[_0xb1e7('0x11')](0x1f4,_0x51f1af[_0xb1e7('0x12')]));});});};
\ No newline at end of file
+var _0x6207=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetTemplate','Template','findAll','options','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x9e3340,_0x24882b){var _0x33b2f8=function(_0x127846){while(--_0x127846){_0x9e3340['push'](_0x9e3340['shift']());}};_0x33b2f8(++_0x24882b);}(_0x6207,0xc0));var _0x7620=function(_0x238dc7,_0x4152ae){_0x238dc7=_0x238dc7-0x0;var _0x274da2=_0x6207[_0x238dc7];return _0x274da2;};'use strict';var _=require(_0x7620('0x0'));var util=require(_0x7620('0x1'));var moment=require(_0x7620('0x2'));var BPromise=require(_0x7620('0x3'));var rs=require(_0x7620('0x4'));var fs=require('fs');var Redis=require(_0x7620('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7620('0x6'));var logger=require(_0x7620('0x7'))(_0x7620('0x8'));var config=require(_0x7620('0x9'));var jayson=require(_0x7620('0xa'));var client=jayson[_0x7620('0xb')][_0x7620('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5499aa,_0x17f7b0,_0x45f3a3){return new BPromise(function(_0x5885dd,_0x1d8af3){return client[_0x7620('0xd')](_0x5499aa,_0x45f3a3)[_0x7620('0xe')](function(_0x4d9b5d){logger[_0x7620('0xf')](_0x7620('0x10'),_0x17f7b0,_0x7620('0x11'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x17f7b0,_0x7620('0x11'),JSON[_0x7620('0x12')](_0x4d9b5d));if(_0x4d9b5d[_0x7620('0x13')]){if(_0x4d9b5d[_0x7620('0x13')]['code']===0x1f4){logger[_0x7620('0x13')](_0x7620('0x10'),_0x17f7b0,_0x4d9b5d[_0x7620('0x13')][_0x7620('0x14')]);return _0x1d8af3(_0x4d9b5d[_0x7620('0x13')][_0x7620('0x14')]);}logger[_0x7620('0x13')](_0x7620('0x10'),_0x17f7b0,_0x4d9b5d[_0x7620('0x13')]['message']);return _0x5885dd(_0x4d9b5d[_0x7620('0x13')][_0x7620('0x14')]);}else{logger[_0x7620('0xf')]('Template,\x20%s,\x20%s',_0x17f7b0,'request\x20sent');_0x5885dd(_0x4d9b5d[_0x7620('0x15')][_0x7620('0x14')]);}})[_0x7620('0x16')](function(_0x58ad9a){logger['error']('Template,\x20%s,\x20%s',_0x17f7b0,_0x58ad9a);_0x1d8af3(_0x58ad9a);});});}exports[_0x7620('0x17')]=function(_0x31eff7){var _0xfb373e=this;return new Promise(function(_0x304dc5,_0x25aa31){return db[_0x7620('0x18')][_0x7620('0x19')]({'raw':_0x31eff7[_0x7620('0x1a')]?_0x31eff7['options']['raw']===undefined?!![]:![]:!![],'where':_0x31eff7['options']?_0x31eff7[_0x7620('0x1a')][_0x7620('0x1b')]||null:null,'attributes':_0x31eff7[_0x7620('0x1a')]?_0x31eff7[_0x7620('0x1a')][_0x7620('0x1c')]||null:null,'limit':_0x31eff7['options']?_0x31eff7['options'][_0x7620('0x1d')]||null:null,'include':_0x31eff7[_0x7620('0x1a')]?_0x31eff7[_0x7620('0x1a')][_0x7620('0x1e')]?_[_0x7620('0x1f')](_0x31eff7[_0x7620('0x1a')][_0x7620('0x1e')],function(_0x171f94){return{'model':db[_0x171f94[_0x7620('0x20')]],'as':_0x171f94['as'],'attributes':_0x171f94[_0x7620('0x1c')],'include':_0x171f94[_0x7620('0x1e')]?_[_0x7620('0x1f')](_0x171f94['include'],function(_0x36aa12){return{'model':db[_0x36aa12[_0x7620('0x20')]],'as':_0x36aa12['as'],'attributes':_0x36aa12[_0x7620('0x1c')],'include':_0x36aa12[_0x7620('0x1e')]?_['map'](_0x36aa12[_0x7620('0x1e')],function(_0x43c885){return{'model':db[_0x43c885[_0x7620('0x20')]],'as':_0x43c885['as'],'attributes':_0x43c885['attributes']};}):[]};}):[]};}):[]:[]})[_0x7620('0xe')](function(_0x444168){logger[_0x7620('0xf')]('GetTemplate',_0x31eff7);logger['debug'](_0x7620('0x17'),_0x31eff7,JSON[_0x7620('0x12')](_0x444168));_0x304dc5(_0x444168);})[_0x7620('0x16')](function(_0xe8d208){logger[_0x7620('0x13')](_0x7620('0x17'),_0xe8d208[_0x7620('0x14')],_0x31eff7);_0x25aa31(_0xfb373e[_0x7620('0x13')](0x1f4,_0xe8d208[_0x7620('0x14')]));});});};
\ No newline at end of file
index d137987..49c5645 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe790=['getActions','post','addAllCondition','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x248c5e,_0x5719e4){var _0x3ceefb=function(_0x44b3d0){while(--_0x44b3d0){_0x248c5e['push'](_0x248c5e['shift']());}};_0x3ceefb(++_0x5719e4);}(_0xe790,0xb3));var _0x0e79=function(_0x1dd8a4,_0x57f9a){_0x1dd8a4=_0x1dd8a4-0x0;var _0x13fb51=_0xe790[_0x1dd8a4];return _0x13fb51;};'use strict';var multer=require(_0x0e79('0x0'));var util=require('util');var path=require(_0x0e79('0x1'));var timeout=require(_0x0e79('0x2'));var express=require(_0x0e79('0x3'));var router=express[_0x0e79('0x4')]();var auth=require(_0x0e79('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0e79('0x6'));var controller=require(_0x0e79('0x7'));router['get']('/',auth[_0x0e79('0x8')](),controller[_0x0e79('0x9')]);router[_0x0e79('0xa')]('/:id',auth[_0x0e79('0x8')](),controller[_0x0e79('0xb')]);router[_0x0e79('0xa')](_0x0e79('0xc'),auth['isAuthenticated'](),controller[_0x0e79('0xd')]);router[_0x0e79('0xa')](_0x0e79('0xe'),auth['isAuthenticated'](),controller[_0x0e79('0xf')]);router['get'](_0x0e79('0x10'),auth['isAuthenticated'](),controller[_0x0e79('0x11')]);router['post']('/',auth[_0x0e79('0x8')](),controller['create']);router[_0x0e79('0x12')](_0x0e79('0xc'),auth[_0x0e79('0x8')](),controller[_0x0e79('0x13')]);router[_0x0e79('0x12')](_0x0e79('0xe'),auth[_0x0e79('0x8')](),controller[_0x0e79('0x14')]);router['post'](_0x0e79('0x10'),auth['isAuthenticated'](),controller[_0x0e79('0x15')]);router[_0x0e79('0x16')](_0x0e79('0x17'),auth[_0x0e79('0x8')](),controller[_0x0e79('0x18')]);router[_0x0e79('0x19')](_0x0e79('0x17'),auth[_0x0e79('0x8')](),controller[_0x0e79('0x1a')]);module[_0x0e79('0x1b')]=router;
\ No newline at end of file
+var _0xa419=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','index','/:id','isAuthenticated','show','get','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','post','create','addAnyCondition','addAction','put','destroy','exports','util','path','connect-timeout'];(function(_0xd70515,_0x50cfb3){var _0x1e9a3a=function(_0xbb7d0c){while(--_0xbb7d0c){_0xd70515['push'](_0xd70515['shift']());}};_0x1e9a3a(++_0x50cfb3);}(_0xa419,0x1dd));var _0x9a41=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xa419[_0x4bb581];return _0x316bf5;};'use strict';var multer=require('multer');var util=require(_0x9a41('0x0'));var path=require(_0x9a41('0x1'));var timeout=require(_0x9a41('0x2'));var express=require('express');var router=express[_0x9a41('0x3')]();var auth=require(_0x9a41('0x4'));var interaction=require(_0x9a41('0x5'));var config=require(_0x9a41('0x6'));var controller=require(_0x9a41('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9a41('0x8')]);router['get'](_0x9a41('0x9'),auth[_0x9a41('0xa')](),controller[_0x9a41('0xb')]);router[_0x9a41('0xc')](_0x9a41('0xd'),auth[_0x9a41('0xa')](),controller[_0x9a41('0xe')]);router[_0x9a41('0xc')](_0x9a41('0xf'),auth[_0x9a41('0xa')](),controller['getAnyConditions']);router[_0x9a41('0xc')](_0x9a41('0x10'),auth[_0x9a41('0xa')](),controller['getActions']);router[_0x9a41('0x11')]('/',auth[_0x9a41('0xa')](),controller[_0x9a41('0x12')]);router[_0x9a41('0x11')]('/:id/all_conditions',auth[_0x9a41('0xa')](),controller['addAllCondition']);router['post']('/:id/any_conditions',auth[_0x9a41('0xa')](),controller[_0x9a41('0x13')]);router[_0x9a41('0x11')]('/:id/actions',auth[_0x9a41('0xa')](),controller[_0x9a41('0x14')]);router[_0x9a41('0x15')](_0x9a41('0x9'),auth[_0x9a41('0xa')](),controller['update']);router['delete'](_0x9a41('0x9'),auth[_0x9a41('0xa')](),controller[_0x9a41('0x16')]);module[_0x9a41('0x17')]=router;
\ No newline at end of file
index e7c1335..e700012 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0745=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0745,0x75));var _0x5074=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x0745[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x5074('0x0'));module[_0x5074('0x1')]={'name':{'type':Sequelize[_0x5074('0x2')]},'channel':{'type':Sequelize[_0x5074('0x2')]},'description':{'type':Sequelize[_0x5074('0x2')]},'status':{'type':Sequelize[_0x5074('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8505=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2433dc,_0x21c096){var _0x2a3716=function(_0x26ee5e){while(--_0x26ee5e){_0x2433dc['push'](_0x2433dc['shift']());}};_0x2a3716(++_0x21c096);}(_0x8505,0xa1));var _0x5850=function(_0x288804,_0x91ab8f){_0x288804=_0x288804-0x0;var _0x3b86ba=_0x8505[_0x288804];return _0x3b86ba;};'use strict';var Sequelize=require(_0x5850('0x0'));module[_0x5850('0x1')]={'name':{'type':Sequelize[_0x5850('0x2')]},'channel':{'type':Sequelize[_0x5850('0x2')]},'description':{'type':Sequelize[_0x5850('0x2')]},'status':{'type':Sequelize[_0x5850('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 683dde6..7d1c198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f34=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','rawAttributes','getAnyConditions','order','addAction','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','Triggers','UserProfileResource','sendStatus','error','name','index','map','Trigger','fieldName','type'];(function(_0x189ef3,_0x859816){var _0x582508=function(_0x3f610b){while(--_0x3f610b){_0x189ef3['push'](_0x189ef3['shift']());}};_0x582508(++_0x859816);}(_0x1f34,0xee));var _0x41f3=function(_0x349d4f,_0x3b2274){_0x349d4f=_0x349d4f-0x0;var _0x1de422=_0x1f34[_0x349d4f];return _0x1de422;};'use strict';var pdf=require(_0x41f3('0x0'));var emlformat=require(_0x41f3('0x1'));var rimraf=require(_0x41f3('0x2'));var zipdir=require(_0x41f3('0x3'));var jsonpatch=require(_0x41f3('0x4'));var rp=require(_0x41f3('0x5'));var moment=require(_0x41f3('0x6'));var BPromise=require(_0x41f3('0x7'));var Mustache=require(_0x41f3('0x8'));var util=require(_0x41f3('0x9'));var path=require(_0x41f3('0xa'));var sox=require(_0x41f3('0xb'));var csv=require(_0x41f3('0xc'));var ejs=require(_0x41f3('0xd'));var fs=require('fs');var _=require(_0x41f3('0xe'));var squel=require(_0x41f3('0xf'));var crypto=require(_0x41f3('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x41f3('0x11'));var toCsv=require(_0x41f3('0xc'));var querystring=require(_0x41f3('0x12'));var Papa=require(_0x41f3('0x13'));var Redis=require(_0x41f3('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x41f3('0x15'));var as=require(_0x41f3('0x16'));var hardwareService=require(_0x41f3('0x17'));var logger=require(_0x41f3('0x18'))(_0x41f3('0x19'));var utils=require('../../config/utils');var config=require(_0x41f3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa58950,_0x3d3aa5){_0x3d3aa5=_0x3d3aa5||0xcc;return function(_0x51c7de){if(_0x51c7de){return _0xa58950['sendStatus'](_0x3d3aa5);}return _0xa58950[_0x41f3('0x1b')](_0x3d3aa5)[_0x41f3('0x1c')]();};}function respondWithResult(_0x3065e9,_0x346d35){_0x346d35=_0x346d35||0xc8;return function(_0x51802a){if(_0x51802a){return _0x3065e9[_0x41f3('0x1b')](_0x346d35)['json'](_0x51802a);}};}function respondWithFilteredResult(_0x16a3e5,_0x4d5978){return function(_0x4d8c84){if(_0x4d8c84){var _0x12f4a1=_0x4d8c84[_0x41f3('0x1d')],_0x250035=_0x4d5978['offset'],_0x18260c=_0x4d5978[_0x41f3('0x1e')]+_0x4d5978[_0x41f3('0x1f')],_0x5f7b19;if(_0x18260c>=_0x12f4a1){_0x18260c=_0x12f4a1;_0x5f7b19=0xc8;}else{_0x5f7b19=0xce;}_0x16a3e5[_0x41f3('0x1b')](_0x5f7b19);return _0x16a3e5[_0x41f3('0x20')](_0x41f3('0x21'),_0x250035+'-'+_0x18260c+'/'+_0x12f4a1)[_0x41f3('0x22')](_0x4d8c84);}return null;};}function patchUpdates(_0x16fb63){return function(_0x5704e1){try{jsonpatch[_0x41f3('0x23')](_0x5704e1,_0x16fb63,!![]);}catch(_0x35aae4){return BPromise['reject'](_0x35aae4);}return _0x5704e1[_0x41f3('0x24')]();};}function saveUpdates(_0x10199c,_0x4938aa){return function(_0x236be3){if(_0x236be3){return _0x236be3[_0x41f3('0x25')](_0x10199c)['then'](function(_0x5abd49){return _0x5abd49;});}return null;};}function removeEntity(_0x3abe97,_0x3d468d){return function(_0x41fb3c){if(_0x41fb3c){return _0x41fb3c[_0x41f3('0x26')]()[_0x41f3('0x27')](function(){var _0x4e316c=_0x41fb3c['get']({'plain':!![]});var _0x1fc912=_0x41f3('0x28');return db[_0x41f3('0x29')]['destroy']({'where':{'type':_0x1fc912,'resourceId':_0x4e316c['id']}})['then'](function(){return _0x41fb3c;});})[_0x41f3('0x27')](function(){_0x3abe97[_0x41f3('0x1b')](0xcc)[_0x41f3('0x1c')]();});}};}function handleEntityNotFound(_0x180d51,_0xb492d5){return function(_0x3a68f1){if(!_0x3a68f1){_0x180d51[_0x41f3('0x2a')](0x194);}return _0x3a68f1;};}function handleError(_0xc0df6c,_0x489899){_0x489899=_0x489899||0x1f4;return function(_0x434332){logger[_0x41f3('0x2b')](_0x434332['stack']);if(_0x434332[_0x41f3('0x2c')]){delete _0x434332[_0x41f3('0x2c')];}_0xc0df6c[_0x41f3('0x1b')](_0x489899)['send'](_0x434332);};}exports[_0x41f3('0x2d')]=function(_0x358ca5,_0x94e81f){var _0x21293f={},_0x207750={},_0x25e5bd={'count':0x0,'rows':[]};var _0x19de06=_[_0x41f3('0x2e')](db[_0x41f3('0x2f')]['rawAttributes'],function(_0x1e9c00){return{'name':_0x1e9c00[_0x41f3('0x30')],'type':_0x1e9c00[_0x41f3('0x31')]['key']};});_0x207750[_0x41f3('0x32')]=_['map'](_0x19de06,'name');_0x207750[_0x41f3('0x33')]=_[_0x41f3('0x34')](_0x358ca5[_0x41f3('0x33')]);_0x207750[_0x41f3('0x35')]=_[_0x41f3('0x36')](_0x207750[_0x41f3('0x32')],_0x207750[_0x41f3('0x33')]);_0x21293f[_0x41f3('0x37')]=_['intersection'](_0x207750['model'],qs['fields'](_0x358ca5['query'][_0x41f3('0x38')]));_0x21293f[_0x41f3('0x37')]=_0x21293f['attributes'][_0x41f3('0x39')]?_0x21293f[_0x41f3('0x37')]:_0x207750[_0x41f3('0x32')];if(!_0x358ca5['query'][_0x41f3('0x3a')](_0x41f3('0x3b'))){_0x21293f[_0x41f3('0x1f')]=qs[_0x41f3('0x1f')](_0x358ca5['query'][_0x41f3('0x1f')]);_0x21293f[_0x41f3('0x1e')]=qs[_0x41f3('0x1e')](_0x358ca5['query']['offset']);}_0x21293f['order']=qs[_0x41f3('0x3c')](_0x358ca5[_0x41f3('0x33')][_0x41f3('0x3c')]);_0x21293f[_0x41f3('0x3d')]=qs[_0x41f3('0x35')](_[_0x41f3('0x3e')](_0x358ca5[_0x41f3('0x33')],_0x207750['filters']),_0x19de06);if(_0x358ca5[_0x41f3('0x33')][_0x41f3('0x3f')]){_0x21293f[_0x41f3('0x3d')]=_[_0x41f3('0x40')](_0x21293f['where'],{'$or':_['map'](_0x19de06,function(_0x363712){if(_0x363712[_0x41f3('0x31')]!==_0x41f3('0x41')){var _0xefa3a3={};_0xefa3a3[_0x363712['name']]={'$like':'%'+_0x358ca5[_0x41f3('0x33')][_0x41f3('0x3f')]+'%'};return _0xefa3a3;}})});}_0x21293f=_[_0x41f3('0x40')]({},_0x21293f,_0x358ca5[_0x41f3('0x42')]);var _0x36f08f={'where':_0x21293f[_0x41f3('0x3d')]};return db[_0x41f3('0x2f')][_0x41f3('0x1d')](_0x36f08f)[_0x41f3('0x27')](function(_0x53c08d){_0x25e5bd[_0x41f3('0x1d')]=_0x53c08d;if(_0x358ca5[_0x41f3('0x33')][_0x41f3('0x43')]){_0x21293f[_0x41f3('0x44')]=[{'all':!![]}];}return db['Trigger'][_0x41f3('0x45')](_0x21293f);})[_0x41f3('0x27')](function(_0x33525d){_0x25e5bd[_0x41f3('0x46')]=_0x33525d;return _0x25e5bd;})['then'](respondWithFilteredResult(_0x94e81f,_0x21293f))[_0x41f3('0x47')](handleError(_0x94e81f,null));};exports[_0x41f3('0x48')]=function(_0x46e29d,_0x2ee03a){var _0x5a054d={'raw':![],'where':{'id':_0x46e29d[_0x41f3('0x49')]['id']}},_0x2088cb={};_0x2088cb['model']=_[_0x41f3('0x34')](db['Trigger']['rawAttributes']);_0x2088cb[_0x41f3('0x33')]=_[_0x41f3('0x34')](_0x46e29d[_0x41f3('0x33')]);_0x2088cb['filters']=_[_0x41f3('0x36')](_0x2088cb[_0x41f3('0x32')],_0x2088cb[_0x41f3('0x33')]);_0x5a054d['attributes']=_[_0x41f3('0x36')](_0x2088cb[_0x41f3('0x32')],qs[_0x41f3('0x38')](_0x46e29d['query'][_0x41f3('0x38')]));_0x5a054d[_0x41f3('0x37')]=_0x5a054d[_0x41f3('0x37')][_0x41f3('0x39')]?_0x5a054d['attributes']:_0x2088cb[_0x41f3('0x32')];if(_0x46e29d[_0x41f3('0x33')][_0x41f3('0x43')]){_0x5a054d[_0x41f3('0x44')]=[{'all':!![]}];}_0x5a054d=_['merge']({},_0x5a054d,_0x46e29d[_0x41f3('0x42')]);return db['Trigger'][_0x41f3('0x4a')](_0x5a054d)['then'](handleEntityNotFound(_0x2ee03a,null))[_0x41f3('0x27')](respondWithResult(_0x2ee03a,null))[_0x41f3('0x47')](handleError(_0x2ee03a,null));};exports['create']=function(_0x35795d,_0x1ad95b){return db[_0x41f3('0x2f')]['create'](_0x35795d['body'],{})[_0x41f3('0x27')](function(_0xb363fa){var _0x2f705c=_0x35795d['user'][_0x41f3('0x4b')]({'plain':!![]});if(!_0x2f705c)throw new Error(_0x41f3('0x4c'));if(_0x2f705c[_0x41f3('0x4d')]===_0x41f3('0x4e')){var _0xa8e1f0=_0xb363fa['get']({'plain':!![]});var _0x2c886c=_0x41f3('0x28');return db['UserProfileSection'][_0x41f3('0x4a')]({'where':{'name':_0x2c886c,'userProfileId':_0x2f705c[_0x41f3('0x4f')]},'raw':!![]})[_0x41f3('0x27')](function(_0x1ac8b1){if(_0x1ac8b1&&_0x1ac8b1[_0x41f3('0x50')]===0x0){return db['UserProfileResource'][_0x41f3('0x51')]({'name':_0xa8e1f0[_0x41f3('0x2c')],'resourceId':_0xa8e1f0['id'],'type':_0x1ac8b1['name'],'sectionId':_0x1ac8b1['id']},{})[_0x41f3('0x27')](function(){return _0xb363fa;});}else{return _0xb363fa;}})[_0x41f3('0x47')](function(_0x16244e){logger[_0x41f3('0x2b')](_0x41f3('0x52'),_0x16244e);throw _0x16244e;});}return _0xb363fa;})[_0x41f3('0x27')](respondWithResult(_0x1ad95b,0xc9))[_0x41f3('0x47')](handleError(_0x1ad95b,null));};exports[_0x41f3('0x25')]=function(_0x4bbbeb,_0x183b62){if(_0x4bbbeb[_0x41f3('0x53')]['id']){delete _0x4bbbeb[_0x41f3('0x53')]['id'];}return db['Trigger'][_0x41f3('0x4a')]({'where':{'id':_0x4bbbeb[_0x41f3('0x49')]['id']}})[_0x41f3('0x27')](handleEntityNotFound(_0x183b62,null))[_0x41f3('0x27')](saveUpdates(_0x4bbbeb[_0x41f3('0x53')],null))[_0x41f3('0x27')](respondWithResult(_0x183b62,null))[_0x41f3('0x47')](handleError(_0x183b62,null));};exports[_0x41f3('0x26')]=function(_0x512de3,_0x56ec49){return db[_0x41f3('0x2f')][_0x41f3('0x4a')]({'where':{'id':_0x512de3[_0x41f3('0x49')]['id']}})[_0x41f3('0x27')](handleEntityNotFound(_0x56ec49,null))[_0x41f3('0x27')](removeEntity(_0x56ec49,null))['catch'](handleError(_0x56ec49,null));};exports[_0x41f3('0x54')]=function(_0x51658f,_0x116c4f,_0x478a0f){if(_0x51658f['body']['id']){delete _0x51658f[_0x41f3('0x53')]['id'];}return db['Trigger'][_0x41f3('0x4a')]({'where':{'id':_0x51658f['params']['id']}})[_0x41f3('0x27')](handleEntityNotFound(_0x116c4f,null))[_0x41f3('0x27')](function(_0x34dde9){if(_0x34dde9){_0x51658f['body']['TriggerAllId']=_0x34dde9['id'];return db[_0x41f3('0x55')][_0x41f3('0x51')](_0x51658f[_0x41f3('0x53')]);}})['then'](respondWithResult(_0x116c4f,null))[_0x41f3('0x47')](handleError(_0x116c4f,null));};exports[_0x41f3('0x56')]=function(_0x5b793b,_0x41a79d,_0x33e8c5){if(_0x5b793b[_0x41f3('0x53')]['id']){delete _0x5b793b['body']['id'];}return db[_0x41f3('0x2f')][_0x41f3('0x4a')]({'where':{'id':_0x5b793b[_0x41f3('0x49')]['id']}})[_0x41f3('0x27')](handleEntityNotFound(_0x41a79d,null))[_0x41f3('0x27')](function(_0x1eaff8){if(_0x1eaff8){_0x5b793b['body'][_0x41f3('0x57')]=_0x1eaff8['id'];return db['Condition'][_0x41f3('0x51')](_0x5b793b[_0x41f3('0x53')]);}})[_0x41f3('0x27')](respondWithResult(_0x41a79d,null))[_0x41f3('0x47')](handleError(_0x41a79d,null));};exports[_0x41f3('0x58')]=function(_0x5f1d35,_0x315cab,_0x48d24a){var _0x5dd844={};var _0x2b3d3a={};var _0x14d3db;var _0x12f558;return db[_0x41f3('0x2f')][_0x41f3('0x59')]({'where':{'id':_0x5f1d35[_0x41f3('0x49')]['id']}})[_0x41f3('0x27')](handleEntityNotFound(_0x315cab,null))[_0x41f3('0x27')](function(_0x4eeaec){if(_0x4eeaec){_0x14d3db=_0x4eeaec;_0x2b3d3a[_0x41f3('0x32')]=_[_0x41f3('0x34')](db['Condition'][_0x41f3('0x5a')]);_0x2b3d3a[_0x41f3('0x33')]=_[_0x41f3('0x34')](_0x5f1d35[_0x41f3('0x33')]);_0x2b3d3a[_0x41f3('0x35')]=_[_0x41f3('0x36')](_0x2b3d3a[_0x41f3('0x32')],_0x2b3d3a[_0x41f3('0x33')]);_0x5dd844[_0x41f3('0x37')]=_[_0x41f3('0x36')](_0x2b3d3a[_0x41f3('0x32')],qs[_0x41f3('0x38')](_0x5f1d35[_0x41f3('0x33')]['fields']));_0x5dd844[_0x41f3('0x37')]=_0x5dd844[_0x41f3('0x37')][_0x41f3('0x39')]?_0x5dd844[_0x41f3('0x37')]:_0x2b3d3a[_0x41f3('0x32')];_0x5dd844['order']=qs['sort'](_0x5f1d35[_0x41f3('0x33')]['sort']);_0x5dd844['where']=qs['filters'](_[_0x41f3('0x3e')](_0x5f1d35[_0x41f3('0x33')],_0x2b3d3a[_0x41f3('0x35')]));if(_0x5f1d35['query'][_0x41f3('0x3f')]){_0x5dd844['where']=_['merge'](_0x5dd844[_0x41f3('0x3d')],{'$or':_['map'](_0x5dd844[_0x41f3('0x37')],function(_0xa430c8){var _0x30ce1c={};_0x30ce1c[_0xa430c8]={'$like':'%'+_0x5f1d35[_0x41f3('0x33')][_0x41f3('0x3f')]+'%'};return _0x30ce1c;})});}_0x5dd844=_[_0x41f3('0x40')]({},_0x5dd844,_0x5f1d35[_0x41f3('0x42')]);return _0x14d3db[_0x41f3('0x58')](_0x5dd844);}})[_0x41f3('0x27')](function(_0x3c5009){if(_0x3c5009){_0x12f558=_0x3c5009['length'];if(!_0x5f1d35[_0x41f3('0x33')][_0x41f3('0x3a')](_0x41f3('0x3b'))){_0x5dd844['limit']=qs[_0x41f3('0x1f')](_0x5f1d35[_0x41f3('0x33')][_0x41f3('0x1f')]);_0x5dd844[_0x41f3('0x1e')]=qs[_0x41f3('0x1e')](_0x5f1d35[_0x41f3('0x33')][_0x41f3('0x1e')]);}return _0x14d3db[_0x41f3('0x58')](_0x5dd844);}})[_0x41f3('0x27')](function(_0xbccbcf){if(_0xbccbcf){return _0xbccbcf?{'count':_0x12f558,'rows':_0xbccbcf}:null;}})['then'](respondWithResult(_0x315cab,null))[_0x41f3('0x47')](handleError(_0x315cab,null));};exports[_0x41f3('0x5b')]=function(_0x3a2fbe,_0x1c6f7c,_0x5ae2d1){var _0x53106c={};var _0x862977={};var _0x4ff123;var _0x53c336;return db[_0x41f3('0x2f')][_0x41f3('0x59')]({'where':{'id':_0x3a2fbe['params']['id']}})[_0x41f3('0x27')](handleEntityNotFound(_0x1c6f7c,null))[_0x41f3('0x27')](function(_0x397bdb){if(_0x397bdb){_0x4ff123=_0x397bdb;_0x862977[_0x41f3('0x32')]=_[_0x41f3('0x34')](db[_0x41f3('0x55')][_0x41f3('0x5a')]);_0x862977[_0x41f3('0x33')]=_[_0x41f3('0x34')](_0x3a2fbe['query']);_0x862977[_0x41f3('0x35')]=_['intersection'](_0x862977[_0x41f3('0x32')],_0x862977[_0x41f3('0x33')]);_0x53106c[_0x41f3('0x37')]=_['intersection'](_0x862977[_0x41f3('0x32')],qs[_0x41f3('0x38')](_0x3a2fbe[_0x41f3('0x33')]['fields']));_0x53106c[_0x41f3('0x37')]=_0x53106c[_0x41f3('0x37')][_0x41f3('0x39')]?_0x53106c[_0x41f3('0x37')]:_0x862977[_0x41f3('0x32')];_0x53106c[_0x41f3('0x5c')]=qs['sort'](_0x3a2fbe[_0x41f3('0x33')][_0x41f3('0x3c')]);_0x53106c[_0x41f3('0x3d')]=qs[_0x41f3('0x35')](_[_0x41f3('0x3e')](_0x3a2fbe['query'],_0x862977['filters']));if(_0x3a2fbe[_0x41f3('0x33')][_0x41f3('0x3f')]){_0x53106c[_0x41f3('0x3d')]=_['merge'](_0x53106c['where'],{'$or':_[_0x41f3('0x2e')](_0x53106c[_0x41f3('0x37')],function(_0x1c4d1e){var _0xfae8ff={};_0xfae8ff[_0x1c4d1e]={'$like':'%'+_0x3a2fbe[_0x41f3('0x33')][_0x41f3('0x3f')]+'%'};return _0xfae8ff;})});}_0x53106c=_['merge']({},_0x53106c,_0x3a2fbe[_0x41f3('0x42')]);return _0x4ff123[_0x41f3('0x5b')](_0x53106c);}})['then'](function(_0x3bfab9){if(_0x3bfab9){_0x53c336=_0x3bfab9[_0x41f3('0x39')];if(!_0x3a2fbe[_0x41f3('0x33')][_0x41f3('0x3a')](_0x41f3('0x3b'))){_0x53106c[_0x41f3('0x1f')]=qs[_0x41f3('0x1f')](_0x3a2fbe[_0x41f3('0x33')][_0x41f3('0x1f')]);_0x53106c[_0x41f3('0x1e')]=qs[_0x41f3('0x1e')](_0x3a2fbe['query'][_0x41f3('0x1e')]);}return _0x4ff123['getAnyConditions'](_0x53106c);}})[_0x41f3('0x27')](function(_0x2a8c78){if(_0x2a8c78){return _0x2a8c78?{'count':_0x53c336,'rows':_0x2a8c78}:null;}})[_0x41f3('0x27')](respondWithResult(_0x1c6f7c,null))[_0x41f3('0x47')](handleError(_0x1c6f7c,null));};exports[_0x41f3('0x5d')]=function(_0xcd5ea1,_0x5d08cb,_0x51098f){if(_0xcd5ea1[_0x41f3('0x53')]['id']){delete _0xcd5ea1[_0x41f3('0x53')]['id'];}return db['Trigger']['find']({'where':{'id':_0xcd5ea1[_0x41f3('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d08cb,null))[_0x41f3('0x27')](function(_0x4d9067){if(_0x4d9067){_0xcd5ea1['body']['TriggerId']=_0x4d9067['id'];return db[_0x41f3('0x5e')][_0x41f3('0x51')](_0xcd5ea1[_0x41f3('0x53')]);}})[_0x41f3('0x27')](respondWithResult(_0x5d08cb,null))['catch'](handleError(_0x5d08cb,null));};exports[_0x41f3('0x5f')]=function(_0x10c3cc,_0x5e98a2,_0x51510d){var _0x115f13={};var _0xa3e0ad={};var _0x400f7e;var _0x1c9c6d;return db['Trigger'][_0x41f3('0x59')]({'where':{'id':_0x10c3cc[_0x41f3('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e98a2,null))[_0x41f3('0x27')](function(_0x5085d9){if(_0x5085d9){_0x400f7e=_0x5085d9;_0xa3e0ad[_0x41f3('0x32')]=_[_0x41f3('0x34')](db['Action'][_0x41f3('0x5a')]);_0xa3e0ad[_0x41f3('0x33')]=_[_0x41f3('0x34')](_0x10c3cc[_0x41f3('0x33')]);_0xa3e0ad[_0x41f3('0x35')]=_[_0x41f3('0x36')](_0xa3e0ad[_0x41f3('0x32')],_0xa3e0ad[_0x41f3('0x33')]);_0x115f13[_0x41f3('0x37')]=_['intersection'](_0xa3e0ad['model'],qs[_0x41f3('0x38')](_0x10c3cc[_0x41f3('0x33')]['fields']));_0x115f13[_0x41f3('0x37')]=_0x115f13[_0x41f3('0x37')][_0x41f3('0x39')]?_0x115f13[_0x41f3('0x37')]:_0xa3e0ad[_0x41f3('0x32')];_0x115f13['order']=qs['sort'](_0x10c3cc[_0x41f3('0x33')][_0x41f3('0x3c')]);_0x115f13['where']=qs['filters'](_[_0x41f3('0x3e')](_0x10c3cc[_0x41f3('0x33')],_0xa3e0ad[_0x41f3('0x35')]));if(_0x10c3cc[_0x41f3('0x33')]['filter']){_0x115f13[_0x41f3('0x3d')]=_[_0x41f3('0x40')](_0x115f13['where'],{'$or':_[_0x41f3('0x2e')](_0x115f13['attributes'],function(_0x1a63df){var _0x139b98={};_0x139b98[_0x1a63df]={'$like':'%'+_0x10c3cc[_0x41f3('0x33')]['filter']+'%'};return _0x139b98;})});}_0x115f13=_[_0x41f3('0x40')]({},_0x115f13,_0x10c3cc[_0x41f3('0x42')]);return _0x400f7e[_0x41f3('0x5f')](_0x115f13);}})['then'](function(_0x37d9cf){if(_0x37d9cf){_0x1c9c6d=_0x37d9cf[_0x41f3('0x39')];if(!_0x10c3cc[_0x41f3('0x33')][_0x41f3('0x3a')](_0x41f3('0x3b'))){_0x115f13[_0x41f3('0x1f')]=qs[_0x41f3('0x1f')](_0x10c3cc[_0x41f3('0x33')][_0x41f3('0x1f')]);_0x115f13[_0x41f3('0x1e')]=qs[_0x41f3('0x1e')](_0x10c3cc['query'][_0x41f3('0x1e')]);}return _0x400f7e[_0x41f3('0x5f')](_0x115f13);}})[_0x41f3('0x27')](function(_0x422c5f){if(_0x422c5f){return _0x422c5f?{'count':_0x1c9c6d,'rows':_0x422c5f}:null;}})['then'](respondWithResult(_0x5e98a2,null))['catch'](handleError(_0x5e98a2,null));};
\ No newline at end of file
+var _0x29cd=['filter','merge','options','Trigger','includeAll','include','findAll','rows','show','params','fields','length','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','sort','getAnyConditions','addAction','TriggerId','getActions','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','set','json','apply','reject','then','destroy','get','Triggers','error','name','send','rawAttributes','type','key','map','keys','query','model','attributes','intersection','hasOwnProperty','nolimit','limit','where','filters'];(function(_0x381c80,_0x3bc995){var _0x93916c=function(_0xc8e323){while(--_0xc8e323){_0x381c80['push'](_0x381c80['shift']());}};_0x93916c(++_0x3bc995);}(_0x29cd,0x18f));var _0xd29c=function(_0x5c103f,_0x3fc776){_0x5c103f=_0x5c103f-0x0;var _0x5eb4e8=_0x29cd[_0x5c103f];return _0x5eb4e8;};'use strict';var pdf=require(_0xd29c('0x0'));var emlformat=require(_0xd29c('0x1'));var rimraf=require(_0xd29c('0x2'));var zipdir=require(_0xd29c('0x3'));var jsonpatch=require(_0xd29c('0x4'));var rp=require(_0xd29c('0x5'));var moment=require('moment');var BPromise=require(_0xd29c('0x6'));var Mustache=require(_0xd29c('0x7'));var util=require(_0xd29c('0x8'));var path=require(_0xd29c('0x9'));var sox=require(_0xd29c('0xa'));var csv=require(_0xd29c('0xb'));var ejs=require(_0xd29c('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd29c('0xd'));var crypto=require(_0xd29c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd29c('0xf'));var toCsv=require(_0xd29c('0xb'));var querystring=require(_0xd29c('0x10'));var Papa=require(_0xd29c('0x11'));var Redis=require(_0xd29c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd29c('0x13'));var as=require(_0xd29c('0x14'));var hardwareService=require(_0xd29c('0x15'));var logger=require(_0xd29c('0x16'))(_0xd29c('0x17'));var utils=require(_0xd29c('0x18'));var config=require(_0xd29c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d7b6a,_0x2525e4){_0x2525e4=_0x2525e4||0xcc;return function(_0x42629b){if(_0x42629b){return _0x2d7b6a[_0xd29c('0x1a')](_0x2525e4);}return _0x2d7b6a[_0xd29c('0x1b')](_0x2525e4)[_0xd29c('0x1c')]();};}function respondWithResult(_0x3327cf,_0x34e72b){_0x34e72b=_0x34e72b||0xc8;return function(_0x3e0385){if(_0x3e0385){return _0x3327cf[_0xd29c('0x1b')](_0x34e72b)['json'](_0x3e0385);}};}function respondWithFilteredResult(_0x170574,_0x22a538){return function(_0x1763a1){if(_0x1763a1){var _0x2a9515=_0x1763a1[_0xd29c('0x1d')],_0x2653be=_0x22a538[_0xd29c('0x1e')],_0x10a78c=_0x22a538[_0xd29c('0x1e')]+_0x22a538['limit'],_0x18a503;if(_0x10a78c>=_0x2a9515){_0x10a78c=_0x2a9515;_0x18a503=0xc8;}else{_0x18a503=0xce;}_0x170574[_0xd29c('0x1b')](_0x18a503);return _0x170574[_0xd29c('0x1f')]('Content-Range',_0x2653be+'-'+_0x10a78c+'/'+_0x2a9515)[_0xd29c('0x20')](_0x1763a1);}return null;};}function patchUpdates(_0x193b20){return function(_0x153cfe){try{jsonpatch[_0xd29c('0x21')](_0x153cfe,_0x193b20,!![]);}catch(_0x26baeb){return BPromise[_0xd29c('0x22')](_0x26baeb);}return _0x153cfe['save']();};}function saveUpdates(_0x1b07e4,_0x3d2283){return function(_0x6fce04){if(_0x6fce04){return _0x6fce04['update'](_0x1b07e4)[_0xd29c('0x23')](function(_0x5e029d){return _0x5e029d;});}return null;};}function removeEntity(_0x1bf42f,_0x499482){return function(_0x564fa0){if(_0x564fa0){return _0x564fa0[_0xd29c('0x24')]()[_0xd29c('0x23')](function(){var _0x3504a8=_0x564fa0[_0xd29c('0x25')]({'plain':!![]});var _0x464628=_0xd29c('0x26');return db['UserProfileResource'][_0xd29c('0x24')]({'where':{'type':_0x464628,'resourceId':_0x3504a8['id']}})[_0xd29c('0x23')](function(){return _0x564fa0;});})[_0xd29c('0x23')](function(){_0x1bf42f[_0xd29c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x433620,_0x506042){return function(_0x10f0bb){if(!_0x10f0bb){_0x433620[_0xd29c('0x1a')](0x194);}return _0x10f0bb;};}function handleError(_0x49d124,_0x2e2529){_0x2e2529=_0x2e2529||0x1f4;return function(_0x47929c){logger[_0xd29c('0x27')](_0x47929c['stack']);if(_0x47929c['name']){delete _0x47929c[_0xd29c('0x28')];}_0x49d124[_0xd29c('0x1b')](_0x2e2529)[_0xd29c('0x29')](_0x47929c);};}exports['index']=function(_0x2fd0bf,_0x3b5ed4){var _0x17fb40={},_0x166f8f={},_0x4ee2f0={'count':0x0,'rows':[]};var _0x23dbc8=_['map'](db['Trigger'][_0xd29c('0x2a')],function(_0x2d4ebc){return{'name':_0x2d4ebc['fieldName'],'type':_0x2d4ebc[_0xd29c('0x2b')][_0xd29c('0x2c')]};});_0x166f8f['model']=_[_0xd29c('0x2d')](_0x23dbc8,'name');_0x166f8f['query']=_[_0xd29c('0x2e')](_0x2fd0bf[_0xd29c('0x2f')]);_0x166f8f['filters']=_['intersection'](_0x166f8f[_0xd29c('0x30')],_0x166f8f[_0xd29c('0x2f')]);_0x17fb40[_0xd29c('0x31')]=_[_0xd29c('0x32')](_0x166f8f[_0xd29c('0x30')],qs['fields'](_0x2fd0bf[_0xd29c('0x2f')]['fields']));_0x17fb40['attributes']=_0x17fb40[_0xd29c('0x31')]['length']?_0x17fb40['attributes']:_0x166f8f[_0xd29c('0x30')];if(!_0x2fd0bf[_0xd29c('0x2f')][_0xd29c('0x33')](_0xd29c('0x34'))){_0x17fb40['limit']=qs[_0xd29c('0x35')](_0x2fd0bf['query'][_0xd29c('0x35')]);_0x17fb40[_0xd29c('0x1e')]=qs[_0xd29c('0x1e')](_0x2fd0bf[_0xd29c('0x2f')][_0xd29c('0x1e')]);}_0x17fb40['order']=qs['sort'](_0x2fd0bf['query']['sort']);_0x17fb40[_0xd29c('0x36')]=qs[_0xd29c('0x37')](_['pick'](_0x2fd0bf['query'],_0x166f8f[_0xd29c('0x37')]),_0x23dbc8);if(_0x2fd0bf[_0xd29c('0x2f')][_0xd29c('0x38')]){_0x17fb40[_0xd29c('0x36')]=_[_0xd29c('0x39')](_0x17fb40[_0xd29c('0x36')],{'$or':_[_0xd29c('0x2d')](_0x23dbc8,function(_0x575063){if(_0x575063[_0xd29c('0x2b')]!=='VIRTUAL'){var _0xd63b6a={};_0xd63b6a[_0x575063[_0xd29c('0x28')]]={'$like':'%'+_0x2fd0bf[_0xd29c('0x2f')][_0xd29c('0x38')]+'%'};return _0xd63b6a;}})});}_0x17fb40=_[_0xd29c('0x39')]({},_0x17fb40,_0x2fd0bf[_0xd29c('0x3a')]);var _0x3cb8cf={'where':_0x17fb40[_0xd29c('0x36')]};return db[_0xd29c('0x3b')][_0xd29c('0x1d')](_0x3cb8cf)[_0xd29c('0x23')](function(_0x4f6117){_0x4ee2f0['count']=_0x4f6117;if(_0x2fd0bf[_0xd29c('0x2f')][_0xd29c('0x3c')]){_0x17fb40[_0xd29c('0x3d')]=[{'all':!![]}];}return db['Trigger'][_0xd29c('0x3e')](_0x17fb40);})['then'](function(_0x21b568){_0x4ee2f0[_0xd29c('0x3f')]=_0x21b568;return _0x4ee2f0;})[_0xd29c('0x23')](respondWithFilteredResult(_0x3b5ed4,_0x17fb40))['catch'](handleError(_0x3b5ed4,null));};exports[_0xd29c('0x40')]=function(_0x412a1c,_0xf49681){var _0x9b2b1e={'raw':![],'where':{'id':_0x412a1c[_0xd29c('0x41')]['id']}},_0x16fecf={};_0x16fecf[_0xd29c('0x30')]=_[_0xd29c('0x2e')](db[_0xd29c('0x3b')][_0xd29c('0x2a')]);_0x16fecf[_0xd29c('0x2f')]=_[_0xd29c('0x2e')](_0x412a1c[_0xd29c('0x2f')]);_0x16fecf['filters']=_[_0xd29c('0x32')](_0x16fecf[_0xd29c('0x30')],_0x16fecf[_0xd29c('0x2f')]);_0x9b2b1e[_0xd29c('0x31')]=_[_0xd29c('0x32')](_0x16fecf[_0xd29c('0x30')],qs[_0xd29c('0x42')](_0x412a1c[_0xd29c('0x2f')][_0xd29c('0x42')]));_0x9b2b1e[_0xd29c('0x31')]=_0x9b2b1e['attributes'][_0xd29c('0x43')]?_0x9b2b1e['attributes']:_0x16fecf[_0xd29c('0x30')];if(_0x412a1c['query'][_0xd29c('0x3c')]){_0x9b2b1e[_0xd29c('0x3d')]=[{'all':!![]}];}_0x9b2b1e=_[_0xd29c('0x39')]({},_0x9b2b1e,_0x412a1c[_0xd29c('0x3a')]);return db[_0xd29c('0x3b')]['find'](_0x9b2b1e)[_0xd29c('0x23')](handleEntityNotFound(_0xf49681,null))[_0xd29c('0x23')](respondWithResult(_0xf49681,null))[_0xd29c('0x44')](handleError(_0xf49681,null));};exports[_0xd29c('0x45')]=function(_0x142807,_0x572272){return db[_0xd29c('0x3b')][_0xd29c('0x45')](_0x142807['body'],{})['then'](function(_0x235035){var _0x48d918=_0x142807[_0xd29c('0x46')][_0xd29c('0x25')]({'plain':!![]});if(!_0x48d918)throw new Error(_0xd29c('0x47'));if(_0x48d918['role']===_0xd29c('0x46')){var _0x35f1ff=_0x235035['get']({'plain':!![]});var _0x7791d=_0xd29c('0x26');return db['UserProfileSection'][_0xd29c('0x48')]({'where':{'name':_0x7791d,'userProfileId':_0x48d918[_0xd29c('0x49')]},'raw':!![]})[_0xd29c('0x23')](function(_0x140b14){if(_0x140b14&&_0x140b14['autoAssociation']===0x0){return db[_0xd29c('0x4a')][_0xd29c('0x45')]({'name':_0x35f1ff[_0xd29c('0x28')],'resourceId':_0x35f1ff['id'],'type':_0x140b14[_0xd29c('0x28')],'sectionId':_0x140b14['id']},{})[_0xd29c('0x23')](function(){return _0x235035;});}else{return _0x235035;}})[_0xd29c('0x44')](function(_0x45a4db){logger[_0xd29c('0x27')](_0xd29c('0x4b'),_0x45a4db);throw _0x45a4db;});}return _0x235035;})[_0xd29c('0x23')](respondWithResult(_0x572272,0xc9))['catch'](handleError(_0x572272,null));};exports[_0xd29c('0x4c')]=function(_0x35cc01,_0x52df24){if(_0x35cc01[_0xd29c('0x4d')]['id']){delete _0x35cc01['body']['id'];}return db['Trigger'][_0xd29c('0x48')]({'where':{'id':_0x35cc01[_0xd29c('0x41')]['id']}})[_0xd29c('0x23')](handleEntityNotFound(_0x52df24,null))['then'](saveUpdates(_0x35cc01[_0xd29c('0x4d')],null))['then'](respondWithResult(_0x52df24,null))[_0xd29c('0x44')](handleError(_0x52df24,null));};exports[_0xd29c('0x24')]=function(_0x13bc80,_0x2c9afc){return db[_0xd29c('0x3b')][_0xd29c('0x48')]({'where':{'id':_0x13bc80[_0xd29c('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c9afc,null))['then'](removeEntity(_0x2c9afc,null))[_0xd29c('0x44')](handleError(_0x2c9afc,null));};exports['addAllCondition']=function(_0x21a5cf,_0x143820,_0x57021a){if(_0x21a5cf[_0xd29c('0x4d')]['id']){delete _0x21a5cf[_0xd29c('0x4d')]['id'];}return db[_0xd29c('0x3b')][_0xd29c('0x48')]({'where':{'id':_0x21a5cf[_0xd29c('0x41')]['id']}})[_0xd29c('0x23')](handleEntityNotFound(_0x143820,null))[_0xd29c('0x23')](function(_0x28a2cd){if(_0x28a2cd){_0x21a5cf[_0xd29c('0x4d')][_0xd29c('0x4e')]=_0x28a2cd['id'];return db[_0xd29c('0x4f')][_0xd29c('0x45')](_0x21a5cf[_0xd29c('0x4d')]);}})[_0xd29c('0x23')](respondWithResult(_0x143820,null))[_0xd29c('0x44')](handleError(_0x143820,null));};exports[_0xd29c('0x50')]=function(_0x42dca5,_0x16f662,_0x5b603f){if(_0x42dca5[_0xd29c('0x4d')]['id']){delete _0x42dca5[_0xd29c('0x4d')]['id'];}return db['Trigger']['find']({'where':{'id':_0x42dca5[_0xd29c('0x41')]['id']}})[_0xd29c('0x23')](handleEntityNotFound(_0x16f662,null))[_0xd29c('0x23')](function(_0x280269){if(_0x280269){_0x42dca5[_0xd29c('0x4d')][_0xd29c('0x51')]=_0x280269['id'];return db['Condition']['create'](_0x42dca5[_0xd29c('0x4d')]);}})[_0xd29c('0x23')](respondWithResult(_0x16f662,null))[_0xd29c('0x44')](handleError(_0x16f662,null));};exports[_0xd29c('0x52')]=function(_0x54a478,_0xe128ac,_0x3c3edf){var _0x4bd492={};var _0x34025d={};var _0x478cc6;var _0x2490d2;return db[_0xd29c('0x3b')][_0xd29c('0x53')]({'where':{'id':_0x54a478['params']['id']}})[_0xd29c('0x23')](handleEntityNotFound(_0xe128ac,null))[_0xd29c('0x23')](function(_0x5aaebc){if(_0x5aaebc){_0x478cc6=_0x5aaebc;_0x34025d[_0xd29c('0x30')]=_[_0xd29c('0x2e')](db['Condition'][_0xd29c('0x2a')]);_0x34025d[_0xd29c('0x2f')]=_[_0xd29c('0x2e')](_0x54a478[_0xd29c('0x2f')]);_0x34025d[_0xd29c('0x37')]=_['intersection'](_0x34025d[_0xd29c('0x30')],_0x34025d[_0xd29c('0x2f')]);_0x4bd492['attributes']=_['intersection'](_0x34025d[_0xd29c('0x30')],qs[_0xd29c('0x42')](_0x54a478['query']['fields']));_0x4bd492[_0xd29c('0x31')]=_0x4bd492[_0xd29c('0x31')][_0xd29c('0x43')]?_0x4bd492[_0xd29c('0x31')]:_0x34025d[_0xd29c('0x30')];_0x4bd492[_0xd29c('0x54')]=qs[_0xd29c('0x55')](_0x54a478[_0xd29c('0x2f')][_0xd29c('0x55')]);_0x4bd492[_0xd29c('0x36')]=qs['filters'](_['pick'](_0x54a478[_0xd29c('0x2f')],_0x34025d[_0xd29c('0x37')]));if(_0x54a478['query'][_0xd29c('0x38')]){_0x4bd492['where']=_[_0xd29c('0x39')](_0x4bd492[_0xd29c('0x36')],{'$or':_['map'](_0x4bd492[_0xd29c('0x31')],function(_0xff3423){var _0x102c85={};_0x102c85[_0xff3423]={'$like':'%'+_0x54a478['query'][_0xd29c('0x38')]+'%'};return _0x102c85;})});}_0x4bd492=_[_0xd29c('0x39')]({},_0x4bd492,_0x54a478[_0xd29c('0x3a')]);return _0x478cc6[_0xd29c('0x52')](_0x4bd492);}})[_0xd29c('0x23')](function(_0x4194af){if(_0x4194af){_0x2490d2=_0x4194af['length'];if(!_0x54a478[_0xd29c('0x2f')][_0xd29c('0x33')](_0xd29c('0x34'))){_0x4bd492[_0xd29c('0x35')]=qs[_0xd29c('0x35')](_0x54a478['query'][_0xd29c('0x35')]);_0x4bd492[_0xd29c('0x1e')]=qs[_0xd29c('0x1e')](_0x54a478['query'][_0xd29c('0x1e')]);}return _0x478cc6['getAllConditions'](_0x4bd492);}})[_0xd29c('0x23')](function(_0x4c5ebc){if(_0x4c5ebc){return _0x4c5ebc?{'count':_0x2490d2,'rows':_0x4c5ebc}:null;}})[_0xd29c('0x23')](respondWithResult(_0xe128ac,null))[_0xd29c('0x44')](handleError(_0xe128ac,null));};exports[_0xd29c('0x56')]=function(_0xdbd075,_0x455f01,_0x2d43dc){var _0x5d3a20={};var _0x2d1143={};var _0x4c4b4a;var _0x4f19db;return db[_0xd29c('0x3b')][_0xd29c('0x53')]({'where':{'id':_0xdbd075[_0xd29c('0x41')]['id']}})[_0xd29c('0x23')](handleEntityNotFound(_0x455f01,null))[_0xd29c('0x23')](function(_0xb0d4f4){if(_0xb0d4f4){_0x4c4b4a=_0xb0d4f4;_0x2d1143[_0xd29c('0x30')]=_[_0xd29c('0x2e')](db[_0xd29c('0x4f')][_0xd29c('0x2a')]);_0x2d1143[_0xd29c('0x2f')]=_[_0xd29c('0x2e')](_0xdbd075[_0xd29c('0x2f')]);_0x2d1143[_0xd29c('0x37')]=_[_0xd29c('0x32')](_0x2d1143[_0xd29c('0x30')],_0x2d1143[_0xd29c('0x2f')]);_0x5d3a20[_0xd29c('0x31')]=_['intersection'](_0x2d1143[_0xd29c('0x30')],qs[_0xd29c('0x42')](_0xdbd075[_0xd29c('0x2f')][_0xd29c('0x42')]));_0x5d3a20[_0xd29c('0x31')]=_0x5d3a20['attributes'][_0xd29c('0x43')]?_0x5d3a20['attributes']:_0x2d1143[_0xd29c('0x30')];_0x5d3a20[_0xd29c('0x54')]=qs['sort'](_0xdbd075[_0xd29c('0x2f')][_0xd29c('0x55')]);_0x5d3a20[_0xd29c('0x36')]=qs[_0xd29c('0x37')](_['pick'](_0xdbd075['query'],_0x2d1143[_0xd29c('0x37')]));if(_0xdbd075[_0xd29c('0x2f')]['filter']){_0x5d3a20['where']=_[_0xd29c('0x39')](_0x5d3a20[_0xd29c('0x36')],{'$or':_[_0xd29c('0x2d')](_0x5d3a20[_0xd29c('0x31')],function(_0x3cd6c6){var _0x3eb0cd={};_0x3eb0cd[_0x3cd6c6]={'$like':'%'+_0xdbd075['query'][_0xd29c('0x38')]+'%'};return _0x3eb0cd;})});}_0x5d3a20=_[_0xd29c('0x39')]({},_0x5d3a20,_0xdbd075[_0xd29c('0x3a')]);return _0x4c4b4a[_0xd29c('0x56')](_0x5d3a20);}})[_0xd29c('0x23')](function(_0x5c8fa7){if(_0x5c8fa7){_0x4f19db=_0x5c8fa7['length'];if(!_0xdbd075[_0xd29c('0x2f')]['hasOwnProperty'](_0xd29c('0x34'))){_0x5d3a20['limit']=qs[_0xd29c('0x35')](_0xdbd075[_0xd29c('0x2f')][_0xd29c('0x35')]);_0x5d3a20[_0xd29c('0x1e')]=qs[_0xd29c('0x1e')](_0xdbd075['query'][_0xd29c('0x1e')]);}return _0x4c4b4a['getAnyConditions'](_0x5d3a20);}})[_0xd29c('0x23')](function(_0x8a2056){if(_0x8a2056){return _0x8a2056?{'count':_0x4f19db,'rows':_0x8a2056}:null;}})[_0xd29c('0x23')](respondWithResult(_0x455f01,null))[_0xd29c('0x44')](handleError(_0x455f01,null));};exports[_0xd29c('0x57')]=function(_0x2be0fd,_0x5a72a8,_0x378d93){if(_0x2be0fd[_0xd29c('0x4d')]['id']){delete _0x2be0fd[_0xd29c('0x4d')]['id'];}return db[_0xd29c('0x3b')]['find']({'where':{'id':_0x2be0fd[_0xd29c('0x41')]['id']}})[_0xd29c('0x23')](handleEntityNotFound(_0x5a72a8,null))[_0xd29c('0x23')](function(_0x1c2a69){if(_0x1c2a69){_0x2be0fd[_0xd29c('0x4d')][_0xd29c('0x58')]=_0x1c2a69['id'];return db['Action'][_0xd29c('0x45')](_0x2be0fd[_0xd29c('0x4d')]);}})[_0xd29c('0x23')](respondWithResult(_0x5a72a8,null))[_0xd29c('0x44')](handleError(_0x5a72a8,null));};exports[_0xd29c('0x59')]=function(_0x3e66b5,_0x5d383c,_0x2b3d94){var _0x1a926b={};var _0x4d1294={};var _0x39013c;var _0x3927ee;return db[_0xd29c('0x3b')][_0xd29c('0x53')]({'where':{'id':_0x3e66b5['params']['id']}})[_0xd29c('0x23')](handleEntityNotFound(_0x5d383c,null))[_0xd29c('0x23')](function(_0x1b26f0){if(_0x1b26f0){_0x39013c=_0x1b26f0;_0x4d1294[_0xd29c('0x30')]=_[_0xd29c('0x2e')](db['Action'][_0xd29c('0x2a')]);_0x4d1294[_0xd29c('0x2f')]=_[_0xd29c('0x2e')](_0x3e66b5[_0xd29c('0x2f')]);_0x4d1294[_0xd29c('0x37')]=_['intersection'](_0x4d1294[_0xd29c('0x30')],_0x4d1294[_0xd29c('0x2f')]);_0x1a926b[_0xd29c('0x31')]=_[_0xd29c('0x32')](_0x4d1294['model'],qs[_0xd29c('0x42')](_0x3e66b5[_0xd29c('0x2f')][_0xd29c('0x42')]));_0x1a926b[_0xd29c('0x31')]=_0x1a926b[_0xd29c('0x31')]['length']?_0x1a926b[_0xd29c('0x31')]:_0x4d1294[_0xd29c('0x30')];_0x1a926b['order']=qs[_0xd29c('0x55')](_0x3e66b5['query'][_0xd29c('0x55')]);_0x1a926b[_0xd29c('0x36')]=qs[_0xd29c('0x37')](_[_0xd29c('0x5a')](_0x3e66b5['query'],_0x4d1294['filters']));if(_0x3e66b5[_0xd29c('0x2f')][_0xd29c('0x38')]){_0x1a926b['where']=_[_0xd29c('0x39')](_0x1a926b['where'],{'$or':_[_0xd29c('0x2d')](_0x1a926b[_0xd29c('0x31')],function(_0x38618f){var _0x2e6fb8={};_0x2e6fb8[_0x38618f]={'$like':'%'+_0x3e66b5[_0xd29c('0x2f')][_0xd29c('0x38')]+'%'};return _0x2e6fb8;})});}_0x1a926b=_[_0xd29c('0x39')]({},_0x1a926b,_0x3e66b5['options']);return _0x39013c[_0xd29c('0x59')](_0x1a926b);}})[_0xd29c('0x23')](function(_0x5130a1){if(_0x5130a1){_0x3927ee=_0x5130a1[_0xd29c('0x43')];if(!_0x3e66b5[_0xd29c('0x2f')][_0xd29c('0x33')]('nolimit')){_0x1a926b['limit']=qs[_0xd29c('0x35')](_0x3e66b5[_0xd29c('0x2f')][_0xd29c('0x35')]);_0x1a926b[_0xd29c('0x1e')]=qs['offset'](_0x3e66b5['query']['offset']);}return _0x39013c['getActions'](_0x1a926b);}})[_0xd29c('0x23')](function(_0x107fb9){if(_0x107fb9){return _0x107fb9?{'count':_0x3927ee,'rows':_0x107fb9}:null;}})['then'](respondWithResult(_0x5d383c,null))[_0xd29c('0x44')](handleError(_0x5d383c,null));};
\ No newline at end of file
index eba1c5a..38b34bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e66=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','tools_triggers','../../config/logger','api','moment','bluebird'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x9e66,0xcd));var _0x69e6=function(_0x2a0d03,_0x3dbb41){_0x2a0d03=_0x2a0d03-0x0;var _0x30db51=_0x9e66[_0x2a0d03];return _0x30db51;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x69e6('0x0'))(_0x69e6('0x1'));var moment=require(_0x69e6('0x2'));var BPromise=require(_0x69e6('0x3'));var rp=require(_0x69e6('0x4'));var fs=require('fs');var path=require(_0x69e6('0x5'));var rimraf=require(_0x69e6('0x6'));var config=require(_0x69e6('0x7'));var attributes=require(_0x69e6('0x8'));module[_0x69e6('0x9')]=function(_0x4758f8,_0x51c5d3){return _0x4758f8['define']('Trigger',attributes,{'tableName':_0x69e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e01=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers'];(function(_0x53e802,_0x2caee4){var _0x764bad=function(_0x1d6aee){while(--_0x1d6aee){_0x53e802['push'](_0x53e802['shift']());}};_0x764bad(++_0x2caee4);}(_0x0e01,0x68));var _0x10e0=function(_0xe41ba8,_0xfd2419){_0xe41ba8=_0xe41ba8-0x0;var _0x4872f6=_0x0e01[_0xe41ba8];return _0x4872f6;};'use strict';var _=require(_0x10e0('0x0'));var util=require(_0x10e0('0x1'));var logger=require(_0x10e0('0x2'))(_0x10e0('0x3'));var moment=require(_0x10e0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10e0('0x5'));var rimraf=require(_0x10e0('0x6'));var config=require(_0x10e0('0x7'));var attributes=require(_0x10e0('0x8'));module[_0x10e0('0x9')]=function(_0x679c86,_0x46a619){return _0x679c86[_0x10e0('0xa')](_0x10e0('0xb'),attributes,{'tableName':_0x10e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5e0165..78fa344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b20=['../../config/environment','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetTrigger','Trigger','findAll','options','raw','where','limit','map','attributes','include','model','then','debug','stringify','catch','ShowTrigger','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x6b20,0xd1));var _0x06b2=function(_0x1c6cf3,_0x4c31da){_0x1c6cf3=_0x1c6cf3-0x0;var _0x249111=_0x6b20[_0x1c6cf3];return _0x249111;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('Trigger,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}exports[_0x06b2('0x14')]=function(_0x594b48){var _0x4c9cae=this;return new Promise(function(_0x192270,_0x1b4ab0){return db[_0x06b2('0x15')][_0x06b2('0x16')]({'raw':_0x594b48['options']?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')]['attributes']||null:null,'limit':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x1a')]||null:null,'include':_0x594b48[_0x06b2('0x17')]?_0x594b48['options']['include']?_[_0x06b2('0x1b')](_0x594b48[_0x06b2('0x17')]['include'],function(_0x39659f){return{'model':db[_0x39659f['model']],'as':_0x39659f['as'],'attributes':_0x39659f[_0x06b2('0x1c')],'include':_0x39659f[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x39659f['include'],function(_0x4382ce){return{'model':db[_0x4382ce[_0x06b2('0x1e')]],'as':_0x4382ce['as'],'attributes':_0x4382ce[_0x06b2('0x1c')],'include':_0x4382ce[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x4382ce['include'],function(_0xbb00ea){return{'model':db[_0xbb00ea[_0x06b2('0x1e')]],'as':_0xbb00ea['as'],'attributes':_0xbb00ea[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x1976ac){logger[_0x06b2('0x12')]('GetTrigger',_0x594b48);logger[_0x06b2('0x20')](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x21')](_0x1976ac));_0x192270(_0x1976ac);})[_0x06b2('0x22')](function(_0x1f02d8){logger[_0x06b2('0xf')](_0x06b2('0x14'),_0x1f02d8['message'],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x1f02d8[_0x06b2('0x11')]));});});};exports[_0x06b2('0x23')]=function(_0x15a78b){var _0x1cc725=this;return new Promise(function(_0x37d391,_0x401551){return db[_0x06b2('0x15')]['find']({'raw':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x15a78b[_0x06b2('0x17')]?_0x15a78b['options']['attributes']||null:null,'include':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')]?_['map'](_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')],function(_0x37bfb5){return{'model':db[_0x37bfb5[_0x06b2('0x1e')]],'as':_0x37bfb5['as'],'attributes':_0x37bfb5[_0x06b2('0x1c')],'include':_0x37bfb5[_0x06b2('0x1d')]?_['map'](_0x37bfb5[_0x06b2('0x1d')],function(_0x1e66f1){return{'model':db[_0x1e66f1[_0x06b2('0x1e')]],'as':_0x1e66f1['as'],'attributes':_0x1e66f1['attributes'],'include':_0x1e66f1[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x1e66f1['include'],function(_0x45ea67){return{'model':db[_0x45ea67[_0x06b2('0x1e')]],'as':_0x45ea67['as'],'attributes':_0x45ea67[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x2e49df){logger[_0x06b2('0x12')](_0x06b2('0x23'),_0x15a78b);logger[_0x06b2('0x20')](_0x06b2('0x23'),_0x15a78b,JSON[_0x06b2('0x21')](_0x2e49df));_0x37d391(_0x2e49df);})[_0x06b2('0x22')](function(_0x1cc7b6){logger['error'](_0x06b2('0x23'),_0x1cc7b6['message'],_0x15a78b);_0x401551(_0x1cc725['error'](0x1f4,_0x1cc7b6[_0x06b2('0x11')]));});});};
\ No newline at end of file
+var _0x84a0=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','raw','where','attributes','limit','include','model','map','GetTrigger','ShowTrigger','find','lodash','util','moment'];(function(_0x46fa95,_0x50a76f){var _0x1b0c9f=function(_0x1003b4){while(--_0x1003b4){_0x46fa95['push'](_0x46fa95['shift']());}};_0x1b0c9f(++_0x50a76f);}(_0x84a0,0x66));var _0x084a=function(_0x5b6a6f,_0x1610a3){_0x5b6a6f=_0x5b6a6f-0x0;var _0x184768=_0x84a0[_0x5b6a6f];return _0x184768;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e6810,_0x373d2,_0x2b30bc){return new BPromise(function(_0x58d419,_0x1051a9){return client[_0x084a('0xa')](_0x2e6810,_0x2b30bc)[_0x084a('0xb')](function(_0x2888e3){logger[_0x084a('0xc')]('Trigger,\x20%s,\x20%s',_0x373d2,'request\x20sent');logger[_0x084a('0xd')](_0x084a('0xe'),_0x373d2,_0x084a('0xf'),JSON[_0x084a('0x10')](_0x2888e3));if(_0x2888e3[_0x084a('0x11')]){if(_0x2888e3['error']['code']===0x1f4){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);return _0x1051a9(_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);}logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3['error'][_0x084a('0x13')]);return _0x58d419(_0x2888e3['error'][_0x084a('0x13')]);}else{logger[_0x084a('0xc')](_0x084a('0x12'),_0x373d2,_0x084a('0xf'));_0x58d419(_0x2888e3[_0x084a('0x14')]['message']);}})[_0x084a('0x15')](function(_0x4abd81){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x4abd81);_0x1051a9(_0x4abd81);});});}exports['GetTrigger']=function(_0xf2c333){var _0x32c729=this;return new Promise(function(_0x4134b9,_0x14bb19){return db[_0x084a('0x16')][_0x084a('0x17')]({'raw':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'limit':_0xf2c333['options']?_0xf2c333[_0x084a('0x18')][_0x084a('0x1c')]||null:null,'include':_0xf2c333[_0x084a('0x18')]?_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')]?_['map'](_0xf2c333[_0x084a('0x18')][_0x084a('0x1d')],function(_0x6346a5){return{'model':db[_0x6346a5[_0x084a('0x1e')]],'as':_0x6346a5['as'],'attributes':_0x6346a5[_0x084a('0x1b')],'include':_0x6346a5[_0x084a('0x1d')]?_['map'](_0x6346a5[_0x084a('0x1d')],function(_0x2af138){return{'model':db[_0x2af138[_0x084a('0x1e')]],'as':_0x2af138['as'],'attributes':_0x2af138['attributes'],'include':_0x2af138[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x2af138[_0x084a('0x1d')],function(_0x4c5658){return{'model':db[_0x4c5658['model']],'as':_0x4c5658['as'],'attributes':_0x4c5658['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b88f){logger['info']('GetTrigger',_0xf2c333);logger['debug'](_0x084a('0x20'),_0xf2c333,JSON[_0x084a('0x10')](_0x33b88f));_0x4134b9(_0x33b88f);})[_0x084a('0x15')](function(_0x2c4149){logger[_0x084a('0x11')](_0x084a('0x20'),_0x2c4149[_0x084a('0x13')],_0xf2c333);_0x14bb19(_0x32c729[_0x084a('0x11')](0x1f4,_0x2c4149['message']));});});};exports[_0x084a('0x21')]=function(_0x3b2b38){var _0x501a16=this;return new Promise(function(_0xe1980b,_0x24bcf5){return db[_0x084a('0x16')][_0x084a('0x22')]({'raw':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x19')]===undefined?!![]:![]:!![],'where':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1a')]||null:null,'attributes':_0x3b2b38[_0x084a('0x18')]?_0x3b2b38[_0x084a('0x18')][_0x084a('0x1b')]||null:null,'include':_0x3b2b38['options']?_0x3b2b38['options'][_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x3b2b38[_0x084a('0x18')][_0x084a('0x1d')],function(_0x83f94f){return{'model':db[_0x83f94f['model']],'as':_0x83f94f['as'],'attributes':_0x83f94f[_0x084a('0x1b')],'include':_0x83f94f[_0x084a('0x1d')]?_[_0x084a('0x1f')](_0x83f94f['include'],function(_0x109593){return{'model':db[_0x109593[_0x084a('0x1e')]],'as':_0x109593['as'],'attributes':_0x109593[_0x084a('0x1b')],'include':_0x109593['include']?_['map'](_0x109593['include'],function(_0xf97d1b){return{'model':db[_0xf97d1b[_0x084a('0x1e')]],'as':_0xf97d1b['as'],'attributes':_0xf97d1b[_0x084a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c09c3){logger[_0x084a('0xc')](_0x084a('0x21'),_0x3b2b38);logger[_0x084a('0xd')](_0x084a('0x21'),_0x3b2b38,JSON[_0x084a('0x10')](_0x3c09c3));_0xe1980b(_0x3c09c3);})[_0x084a('0x15')](function(_0x19354f){logger[_0x084a('0x11')](_0x084a('0x21'),_0x19354f[_0x084a('0x13')],_0x3b2b38);_0x24bcf5(_0x501a16[_0x084a('0x11')](0x1f4,_0x19354f[_0x084a('0x13')]));});});};
\ No newline at end of file
index 43d4704..e6e068d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a9a=['clone','post','create','put','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','/:id/clone'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0x0a9a,0x183));var _0xa0a9=function(_0x276c45,_0x4cc326){_0x276c45=_0x276c45-0x0;var _0x294bd5=_0x0a9a[_0x276c45];return _0x294bd5;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var auth=require(_0xa0a9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa0a9('0x5'));var controller=require(_0xa0a9('0x6'));router['get']('/',auth[_0xa0a9('0x7')](),controller[_0xa0a9('0x8')]);router[_0xa0a9('0x9')](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xb')]);router['post'](_0xa0a9('0xc'),auth[_0xa0a9('0x7')](),controller[_0xa0a9('0xd')]);router[_0xa0a9('0xe')]('/',auth['isAuthenticated'](),controller[_0xa0a9('0xf')]);router[_0xa0a9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa0a9('0x11')]);router[_0xa0a9('0x12')]('/:id',auth[_0xa0a9('0x7')](),controller['destroy']);module[_0xa0a9('0x13')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','post','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x3ac921,_0x464683){var _0x13f1c9=function(_0x123c83){while(--_0x123c83){_0x3ac921['push'](_0x3ac921['shift']());}};_0x13f1c9(++_0x464683);}(_0x008c,0x188));var _0xc008=function(_0x28c870,_0x1bf349){_0x28c870=_0x28c870-0x0;var _0x5e4de6=_0x008c[_0x28c870];return _0x5e4de6;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller['clone']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['put']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['delete'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x11')]);module[_0xc008('0x12')]=router;
\ No newline at end of file
index 8358fc2..ef55197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb434=['ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','originate','uac','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb434,0x171));var _0x4b43=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0xb434[_0x3daa8c];return _0x2b1bd7;};'use strict';var Sequelize=require(_0x4b43('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b43('0x1')],'allowNull':![],'unique':_0x4b43('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x4b43('0x3'),_0x4b43('0x4'),_0x4b43('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4b43('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x4b43('0x7'),_0x4b43('0x8'),_0x4b43('0x9'),_0x4b43('0xa'),'PROHIB_NOT_SCREENED',_0x4b43('0xb'),_0x4b43('0xc'),_0x4b43('0xd'))},'deny':{'type':Sequelize[_0x4b43('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x4b43('0x1')]},'md5secret':{'type':Sequelize[_0x4b43('0x1')]},'remotesecret':{'type':Sequelize[_0x4b43('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x4b43('0xe'),'set':function(_0x5b0a94){this[_0x4b43('0xf')](_0x4b43('0x10'),_0x5b0a94?_0x5b0a94[_0x4b43('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x4b43('0x10'))?this[_0x4b43('0x12')]('transport')[_0x4b43('0x13')](','):null;},'comment':_0x4b43('0x14')},'dtmfmode':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x16'),_0x4b43('0x17'),'shortinfo',_0x4b43('0x18'),_0x4b43('0x19')),'defaultValue':_0x4b43('0x16')},'directmedia':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no',_0x4b43('0x1b'),_0x4b43('0x1c'),_0x4b43('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4b43('0x1')]},'directmediadeny':{'type':Sequelize[_0x4b43('0x1')]},'nat':{'type':Sequelize[_0x4b43('0x1')],'defaultValue':_0x4b43('0x1e'),'set':function(_0x531257){this[_0x4b43('0xf')](_0x4b43('0x1f'),_0x531257?_0x531257[_0x4b43('0x11')](','):null);},'get':function(){return this[_0x4b43('0x12')]('nat')?this[_0x4b43('0x12')](_0x4b43('0x1f'))['split'](','):null;},'comment':_0x4b43('0x20')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x4b43('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x4b43('0x1')]},'language':{'type':Sequelize[_0x4b43('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4b43('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4b43('0x1')],'defaultValue':_0x4b43('0x21')},'allow':{'type':Sequelize[_0x4b43('0x1')],'allowNull':![],'defaultValue':_0x4b43('0x22'),'set':function(_0x3313fc){this['setDataValue'](_0x4b43('0x23'),_0x3313fc?_0x3313fc[_0x4b43('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x4b43('0x23'))?this[_0x4b43('0x12')](_0x4b43('0x23'))[_0x4b43('0x13')](';'):null;},'comment':_0x4b43('0x24')},'autoframing':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'insecure':{'type':Sequelize[_0x4b43('0x1')],'defaultValue':_0x4b43('0x25'),'set':function(_0x2a0044){this['setDataValue'](_0x4b43('0x26'),_0x2a0044?_0x2a0044[_0x4b43('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x4b43('0x26'))?this['getDataValue'](_0x4b43('0x26'))[_0x4b43('0x13')](','):null;},'comment':_0x4b43('0x27')},'trustrpid':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4b43('0x15')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x4b43('0x1a'),'no',_0x4b43('0x28'))},'promiscredir':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x4b43('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x4b43('0x29')](0xb)},'setvar':{'type':Sequelize[_0x4b43('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x4b43('0x1')]},'callcounter':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no'),'defaultValue':_0x4b43('0x1a')},'busylevel':{'type':Sequelize[_0x4b43('0x29')](0xb)},'allowoverlap':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x4b43('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x4b43('0x1')]},'template':{'type':Sequelize[_0x4b43('0x1')]},'videosupport':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no',_0x4b43('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4b43('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4b43('0x15')]('yes','no')},'mailbox':{'type':Sequelize[_0x4b43('0x1')]},'session_timers':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x2b'),'refuse',_0x4b43('0x2c'))},'session_expires':{'type':Sequelize[_0x4b43('0x29')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x2d'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x4b43('0x1')]},'regexten':{'type':Sequelize[_0x4b43('0x1')]},'fromdomain':{'type':Sequelize[_0x4b43('0x1')]},'fromuser':{'type':Sequelize[_0x4b43('0x1')]},'port':{'type':Sequelize[_0x4b43('0x29')](0x5)},'qualify':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no'),'defaultValue':_0x4b43('0x1a')},'keepalive':{'type':Sequelize[_0x4b43('0x29')](0xb)},'defaultip':{'type':Sequelize[_0x4b43('0x1')]},'defaultuser':{'type':Sequelize[_0x4b43('0x1')]},'rtptimeout':{'type':Sequelize[_0x4b43('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4b43('0x29')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x4b43('0x1a'),'no',_0x4b43('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4b43('0x1')]},'callbackextension':{'type':Sequelize[_0x4b43('0x1')]},'timert1':{'type':Sequelize[_0x4b43('0x29')](0xb)},'timerb':{'type':Sequelize[_0x4b43('0x29')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x4b43('0x1')]},'contactacl':{'type':Sequelize[_0x4b43('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x4b43('0x1')]},'use_q850_reason':{'type':Sequelize[_0x4b43('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x4b43('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x4b43('0x15')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no',_0x4b43('0x2f'),_0x4b43('0x30'))},'dtlsrekey':{'type':Sequelize[_0x4b43('0x29')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x4b43('0x1')]},'dtlscipher':{'type':Sequelize[_0x4b43('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x4b43('0x1')]},'dtlssetup':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x31'),_0x4b43('0x32'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4b43('0x1')]},'usereqphone':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4b43('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x4b43('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0x4b43('0x15')](_0x4b43('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x4b43('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x4b43('0x1')]},'description':{'type':Sequelize[_0x4b43('0x1')]},'host':{'type':Sequelize[_0x4b43('0x1')],'defaultValue':_0x4b43('0x33')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x4b43('0x1b'),_0x4b43('0x1c'),_0x4b43('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x4b43('0x1')]},'active':{'type':Sequelize[_0x4b43('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
+var _0x8d67=['user','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','auto','rfc2833','yes','nonat','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint','certificate','actpass','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend'];(function(_0x162802,_0x555c15){var _0x24d606=function(_0x4eff2f){while(--_0x4eff2f){_0x162802['push'](_0x162802['shift']());}};_0x24d606(++_0x555c15);}(_0x8d67,0xea));var _0x78d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8d67[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x78d6('0x0'));module[_0x78d6('0x1')]={'name':{'type':Sequelize[_0x78d6('0x2')],'allowNull':![],'unique':_0x78d6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x5'),_0x78d6('0x6'),'peer'),'allowNull':![],'defaultValue':_0x78d6('0x5')},'context':{'type':Sequelize[_0x78d6('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x78d6('0x4')]('ALLOWED_NOT_SCREENED',_0x78d6('0x7'),_0x78d6('0x8'),_0x78d6('0x9'),_0x78d6('0xa'),_0x78d6('0xb'),_0x78d6('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0x78d6('0x2')]},'permit':{'type':Sequelize[_0x78d6('0x2')]},'secret':{'type':Sequelize[_0x78d6('0x2')]},'md5secret':{'type':Sequelize[_0x78d6('0x2')]},'remotesecret':{'type':Sequelize[_0x78d6('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x283d09){this['setDataValue'](_0x78d6('0xd'),_0x283d09?_0x283d09['join'](','):null);},'get':function(){return this['getDataValue'](_0x78d6('0xd'))?this[_0x78d6('0xe')](_0x78d6('0xd'))[_0x78d6('0xf')](','):null;},'comment':_0x78d6('0x10')},'dtmfmode':{'type':Sequelize[_0x78d6('0x4')]('rfc2833','info',_0x78d6('0x11'),'inband',_0x78d6('0x12')),'defaultValue':_0x78d6('0x13')},'directmedia':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no',_0x78d6('0x15'),'update',_0x78d6('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x78d6('0x2')]},'directmediadeny':{'type':Sequelize[_0x78d6('0x2')]},'nat':{'type':Sequelize[_0x78d6('0x2')],'defaultValue':_0x78d6('0x17'),'set':function(_0x3c957d){this[_0x78d6('0x18')]('nat',_0x3c957d?_0x3c957d['join'](','):null);},'get':function(){return this[_0x78d6('0xe')](_0x78d6('0x19'))?this['getDataValue'](_0x78d6('0x19'))[_0x78d6('0xf')](','):null;},'comment':_0x78d6('0x1a')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x78d6('0x2')]},'pickupgroup':{'type':Sequelize[_0x78d6('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x78d6('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x78d6('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x78d6('0x2')],'defaultValue':_0x78d6('0x1b')},'allow':{'type':Sequelize[_0x78d6('0x2')],'allowNull':![],'defaultValue':_0x78d6('0x1c'),'set':function(_0x2ce0d0){this['setDataValue'](_0x78d6('0x1d'),_0x2ce0d0?_0x2ce0d0[_0x78d6('0x1e')](';'):_0x78d6('0x1c'));},'get':function(){return this[_0x78d6('0xe')](_0x78d6('0x1d'))?this[_0x78d6('0xe')](_0x78d6('0x1d'))[_0x78d6('0xf')](';'):null;},'comment':_0x78d6('0x1f')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x78d6('0x2')],'defaultValue':_0x78d6('0x20'),'set':function(_0x493902){this[_0x78d6('0x18')](_0x78d6('0x21'),_0x493902?_0x493902[_0x78d6('0x1e')](','):null);},'get':function(){return this[_0x78d6('0xe')](_0x78d6('0x21'))?this[_0x78d6('0xe')](_0x78d6('0x21'))[_0x78d6('0xf')](','):null;},'comment':_0x78d6('0x22')},'trustrpid':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x78d6('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x78d6('0x14'),'no',_0x78d6('0x23'))},'promiscredir':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'useclientcode':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'accountcode':{'type':Sequelize[_0x78d6('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x78d6('0x2')],'defaultValue':_0x78d6('0x25')},'amaflags':{'type':Sequelize[_0x78d6('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x78d6('0x14'),'no'),'defaultValue':_0x78d6('0x14')},'busylevel':{'type':Sequelize[_0x78d6('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x78d6('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0x78d6('0x2')]},'template':{'type':Sequelize[_0x78d6('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x78d6('0x14'),'no',_0x78d6('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x78d6('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x78d6('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x78d6('0x2')]},'session_timers':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x27'),'refuse',_0x78d6('0x28'))},'session_expires':{'type':Sequelize[_0x78d6('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x78d6('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x29'),_0x78d6('0x2a')),'defaultValue':_0x78d6('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0x78d6('0x2')]},'regexten':{'type':Sequelize[_0x78d6('0x2')]},'fromdomain':{'type':Sequelize[_0x78d6('0x2')]},'fromuser':{'type':Sequelize[_0x78d6('0x2')]},'port':{'type':Sequelize[_0x78d6('0x24')](0x5)},'qualify':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no'),'defaultValue':_0x78d6('0x14')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x78d6('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x78d6('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no',_0x78d6('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x78d6('0x2')]},'callbackextension':{'type':Sequelize[_0x78d6('0x2')]},'timert1':{'type':Sequelize[_0x78d6('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x78d6('0x2')]},'contactdeny':{'type':Sequelize[_0x78d6('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x78d6('0x2')]},'use_q850_reason':{'type':Sequelize[_0x78d6('0x2')]},'maxforwards':{'type':Sequelize[_0x78d6('0x24')](0xb)},'encryption':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'force_avp':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'icesupport':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x78d6('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no',_0x78d6('0x2c'),_0x78d6('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x78d6('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x78d6('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x78d6('0x2')]},'dtlscipher':{'type':Sequelize[_0x78d6('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x78d6('0x2')]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0x78d6('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x78d6('0x2')]},'usereqphone':{'type':Sequelize[_0x78d6('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x78d6('0x2')]},'recordofffeature':{'type':Sequelize[_0x78d6('0x2')]},'call_limit':{'type':Sequelize[_0x78d6('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0x78d6('0x4')](_0x78d6('0x14'),'no')},'vmexten':{'type':Sequelize[_0x78d6('0x2')]},'mohinterpret':{'type':Sequelize[_0x78d6('0x2')]},'mohsuggest':{'type':Sequelize[_0x78d6('0x2')]},'parkinglot':{'type':Sequelize[_0x78d6('0x2')]},'description':{'type':Sequelize[_0x78d6('0x2')]},'host':{'type':Sequelize[_0x78d6('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x78d6('0x4')]('yes','no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x78d6('0x2')]},'otherFields':{'type':Sequelize[_0x78d6('0x2')]},'active':{'type':Sequelize[_0x78d6('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x78d6('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index 9267d0a..ccff932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x574d=['message','result','catch','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','fields','attributes','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','show','params','intersection','options','find','clone','updatedAt','body','createdAt','create','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','join','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x159f8e,_0x258d08){var _0x458e17=function(_0xafee19){while(--_0xafee19){_0x159f8e['push'](_0x159f8e['shift']());}};_0x458e17(++_0x258d08);}(_0x574d,0xc0));var _0xd574=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x574d[_0x8c43de];return _0xa6591b;};'use strict';var pdf=require(_0xd574('0x0'));var emlformat=require(_0xd574('0x1'));var rimraf=require(_0xd574('0x2'));var zipdir=require(_0xd574('0x3'));var jsonpatch=require(_0xd574('0x4'));var rp=require(_0xd574('0x5'));var moment=require(_0xd574('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd574('0x7'));var util=require(_0xd574('0x8'));var path=require(_0xd574('0x9'));var sox=require(_0xd574('0xa'));var csv=require('to-csv');var ejs=require(_0xd574('0xb'));var fs=require('fs');var _=require(_0xd574('0xc'));var squel=require(_0xd574('0xd'));var crypto=require(_0xd574('0xe'));var jsforce=require(_0xd574('0xf'));var deskjs=require(_0xd574('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd574('0x11'));var Redis=require(_0xd574('0x12'));var authService=require(_0xd574('0x13'));var qs=require(_0xd574('0x14'));var as=require(_0xd574('0x15'));var hardwareService=require(_0xd574('0x16'));var logger=require(_0xd574('0x17'))('api');var utils=require(_0xd574('0x18'));var config=require(_0xd574('0x19'));var db=require(_0xd574('0x1a'))['db'];var jayson=require(_0xd574('0x1b'));var client=jayson[_0xd574('0x1c')][_0xd574('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x8dd760,_0x2a4dd4,_0x24cf77){if(_0x24cf77){var _0x460c2f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x460c2f[_0xd574('0x1e')](_0x2a4dd4)){return _0x8dd760;}else{throw new db[(_0xd574('0x1f'))]['ValidationError'](_0xd574('0x20'));}}else{return _0x8dd760;}}function respondWithRpcPromise(_0x147cdf,_0x2d66be,_0x1537f4,_0x46fb4c){return new BPromise(function(_0x341463,_0x137917){var _0x2fcdfe=_0x46fb4c||client;return _0x2fcdfe['request'](_0x147cdf,_0x1537f4)['then'](function(_0x1486c7){logger[_0xd574('0x21')](_0xd574('0x22'),_0x2d66be,'request\x20sent');logger['debug'](_0xd574('0x23'),_0x2d66be,_0xd574('0x24'),JSON[_0xd574('0x25')](_0x1486c7));if(_0x1486c7[_0xd574('0x26')]){if(_0x1486c7[_0xd574('0x26')][_0xd574('0x27')]===0x1f4){logger[_0xd574('0x26')](_0xd574('0x22'),_0x2d66be,_0x1486c7[_0xd574('0x26')][_0xd574('0x28')]);return _0x137917(_0x1486c7[_0xd574('0x26')]['message']);}logger[_0xd574('0x26')](_0xd574('0x22'),_0x2d66be,_0x1486c7['error'][_0xd574('0x28')]);return _0x341463(_0x1486c7['error'][_0xd574('0x28')]);}else{logger[_0xd574('0x21')](_0xd574('0x22'),_0x2d66be,_0xd574('0x24'));_0x341463(_0x1486c7[_0xd574('0x29')][_0xd574('0x28')]);}})[_0xd574('0x2a')](function(_0x37d229){logger[_0xd574('0x26')](_0xd574('0x22'),_0x2d66be,_0x37d229);_0x137917(_0x37d229);});});}function respondWithStatusCode(_0x1fbd81,_0x44ddae){_0x44ddae=_0x44ddae||0xcc;return function(_0x3e0501){if(_0x3e0501){return _0x1fbd81[_0xd574('0x2b')](_0x44ddae);}return _0x1fbd81['status'](_0x44ddae)[_0xd574('0x2c')]();};}function respondWithResult(_0x53142f,_0x1dcd2f){_0x1dcd2f=_0x1dcd2f||0xc8;return function(_0x5c9224){if(_0x5c9224){return _0x53142f['status'](_0x1dcd2f)[_0xd574('0x2d')](_0x5c9224);}};}function respondWithFilteredResult(_0x17078c,_0x2153d0){return function(_0x5a36cc){if(_0x5a36cc){var _0x2a8e86=_0x5a36cc['count'],_0x30e49e=_0x2153d0['offset'],_0x8eefda=_0x2153d0[_0xd574('0x2e')]+_0x2153d0[_0xd574('0x2f')],_0x9761f5;if(_0x8eefda>=_0x2a8e86){_0x8eefda=_0x2a8e86;_0x9761f5=0xc8;}else{_0x9761f5=0xce;}_0x17078c[_0xd574('0x30')](_0x9761f5);return _0x17078c[_0xd574('0x31')](_0xd574('0x32'),_0x30e49e+'-'+_0x8eefda+'/'+_0x2a8e86)[_0xd574('0x2d')](_0x5a36cc);}return null;};}function patchUpdates(_0x5b66eb){return function(_0x5575a8){try{jsonpatch[_0xd574('0x33')](_0x5575a8,_0x5b66eb,!![]);}catch(_0x472485){return BPromise[_0xd574('0x34')](_0x472485);}return _0x5575a8[_0xd574('0x35')]();};}function saveUpdates(_0xd6d9c0,_0x2d17c7){return function(_0x32466d){if(_0x32466d){return _0x32466d[_0xd574('0x36')](_0xd6d9c0)['then'](function(_0x535b49){return _0x535b49;});}return null;};}function removeEntity(_0x189946,_0x601382){return function(_0xd4b730){if(_0xd4b730){return _0xd4b730[_0xd574('0x37')]()[_0xd574('0x38')](function(){var _0x5d787e=_0xd4b730[_0xd574('0x39')]({'plain':!![]});var _0x1421d6=_0xd574('0x3a');return db[_0xd574('0x3b')][_0xd574('0x37')]({'where':{'type':_0x1421d6,'resourceId':_0x5d787e['id']}})[_0xd574('0x38')](function(){return _0xd4b730;});})[_0xd574('0x38')](function(){_0x189946['status'](0xcc)[_0xd574('0x2c')]();});}};}function handleEntityNotFound(_0x5dc0cf,_0x35594e){return function(_0x3c6649){if(!_0x3c6649){_0x5dc0cf[_0xd574('0x2b')](0x194);}return _0x3c6649;};}function handleError(_0x2d27ea,_0x45e3d0){_0x45e3d0=_0x45e3d0||0x1f4;return function(_0x162385){logger[_0xd574('0x26')](_0x162385[_0xd574('0x3c')]);if(_0x162385[_0xd574('0x3d')]){delete _0x162385[_0xd574('0x3d')];}_0x2d27ea[_0xd574('0x30')](_0x45e3d0)['send'](_0x162385);};}exports[_0xd574('0x3e')]=function(_0x41391a,_0xe652de){var _0x538721={},_0x19fcc6={},_0x349e84={'count':0x0,'rows':[]};var _0x2ee4a8=_[_0xd574('0x3f')](db[_0xd574('0x40')][_0xd574('0x41')],function(_0x5d32ce){return{'name':_0x5d32ce[_0xd574('0x42')],'type':_0x5d32ce[_0xd574('0x43')][_0xd574('0x44')]};});_0x19fcc6[_0xd574('0x45')]=_[_0xd574('0x3f')](_0x2ee4a8,'name');_0x19fcc6[_0xd574('0x46')]=_[_0xd574('0x47')](_0x41391a[_0xd574('0x46')]);_0x19fcc6['filters']=_['intersection'](_0x19fcc6['model'],_0x19fcc6[_0xd574('0x46')]);_0x538721['attributes']=_['intersection'](_0x19fcc6['model'],qs[_0xd574('0x48')](_0x41391a[_0xd574('0x46')][_0xd574('0x48')]));_0x538721[_0xd574('0x49')]=_0x538721['attributes'][_0xd574('0x4a')]?_0x538721[_0xd574('0x49')]:_0x19fcc6[_0xd574('0x45')];if(!_0x41391a[_0xd574('0x46')]['hasOwnProperty'](_0xd574('0x4b'))){_0x538721['limit']=qs[_0xd574('0x2f')](_0x41391a[_0xd574('0x46')][_0xd574('0x2f')]);_0x538721[_0xd574('0x2e')]=qs[_0xd574('0x2e')](_0x41391a[_0xd574('0x46')][_0xd574('0x2e')]);}_0x538721[_0xd574('0x4c')]=qs[_0xd574('0x4d')](_0x41391a[_0xd574('0x46')][_0xd574('0x4d')]);_0x538721[_0xd574('0x4e')]=qs[_0xd574('0x4f')](_['pick'](_0x41391a[_0xd574('0x46')],_0x19fcc6['filters']),_0x2ee4a8);if(_0x41391a['query'][_0xd574('0x50')]){_0x538721[_0xd574('0x4e')]=_['merge'](_0x538721[_0xd574('0x4e')],{'$or':_[_0xd574('0x3f')](_0x2ee4a8,function(_0x3cb9b9){if(_0x3cb9b9['type']!==_0xd574('0x51')){var _0x398bf2={};_0x398bf2[_0x3cb9b9[_0xd574('0x3d')]]={'$like':'%'+_0x41391a[_0xd574('0x46')][_0xd574('0x50')]+'%'};return _0x398bf2;}})});}_0x538721=_[_0xd574('0x52')]({},_0x538721,_0x41391a['options']);var _0x21c13b={'where':_0x538721[_0xd574('0x4e')]};return db[_0xd574('0x40')][_0xd574('0x53')](_0x21c13b)[_0xd574('0x38')](function(_0x2a56a1){_0x349e84[_0xd574('0x53')]=_0x2a56a1;if(_0x41391a[_0xd574('0x46')][_0xd574('0x54')]){_0x538721[_0xd574('0x55')]=[{'all':!![]}];}return db[_0xd574('0x40')][_0xd574('0x56')](_0x538721);})[_0xd574('0x38')](function(_0x44c4c6){_0x349e84[_0xd574('0x57')]=_0x44c4c6;return _0x349e84;})[_0xd574('0x38')](respondWithFilteredResult(_0xe652de,_0x538721))['catch'](handleError(_0xe652de,null));};exports[_0xd574('0x58')]=function(_0x3be45f,_0x536cce){var _0x21b50b={'raw':![],'where':{'id':_0x3be45f[_0xd574('0x59')]['id']}},_0xaf09e={};_0xaf09e[_0xd574('0x45')]=_[_0xd574('0x47')](db[_0xd574('0x40')][_0xd574('0x41')]);_0xaf09e[_0xd574('0x46')]=_[_0xd574('0x47')](_0x3be45f[_0xd574('0x46')]);_0xaf09e['filters']=_[_0xd574('0x5a')](_0xaf09e[_0xd574('0x45')],_0xaf09e[_0xd574('0x46')]);_0x21b50b[_0xd574('0x49')]=_[_0xd574('0x5a')](_0xaf09e[_0xd574('0x45')],qs[_0xd574('0x48')](_0x3be45f[_0xd574('0x46')][_0xd574('0x48')]));_0x21b50b[_0xd574('0x49')]=_0x21b50b[_0xd574('0x49')][_0xd574('0x4a')]?_0x21b50b[_0xd574('0x49')]:_0xaf09e[_0xd574('0x45')];if(_0x3be45f[_0xd574('0x46')][_0xd574('0x54')]){_0x21b50b[_0xd574('0x55')]=[{'all':!![]}];}_0x21b50b=_[_0xd574('0x52')]({},_0x21b50b,_0x3be45f[_0xd574('0x5b')]);return db[_0xd574('0x40')][_0xd574('0x5c')](_0x21b50b)[_0xd574('0x38')](handleEntityNotFound(_0x536cce,null))[_0xd574('0x38')](respondWithResult(_0x536cce,null))[_0xd574('0x2a')](handleError(_0x536cce,null));};exports[_0xd574('0x5d')]=function(_0x5e92d3,_0x21f0f7){var _0x1de788={'where':{'id':_0x5e92d3[_0xd574('0x59')]['id']}},_0x2ec166={};_0x2ec166[_0xd574('0x45')]=_[_0xd574('0x47')](db[_0xd574('0x40')][_0xd574('0x41')]);_0x1de788[_0xd574('0x49')]=_['intersection'](_0x2ec166['model'],qs[_0xd574('0x48')](_0x5e92d3[_0xd574('0x46')]['fields']));_0x1de788[_0xd574('0x49')]=_0x1de788[_0xd574('0x49')][_0xd574('0x4a')]?_0x1de788[_0xd574('0x49')]:_0x2ec166['model'];if(_0x5e92d3[_0xd574('0x46')][_0xd574('0x54')]){_0x1de788[_0xd574('0x55')]=[{'all':!![]}];}_0x1de788=_[_0xd574('0x52')]({},_0x1de788,_0x5e92d3[_0xd574('0x5b')]);return db[_0xd574('0x40')]['find'](_0x1de788)['then'](handleEntityNotFound(_0x21f0f7,null))[_0xd574('0x38')](function(_0x257a5f){if(_0x257a5f){var _0x483490=_0x257a5f[_0xd574('0x39')]({'plain':!![]});_0x483490=qs['omit'](_0x483490,['id','createdAt',_0xd574('0x5e')]);_0x5e92d3[_0xd574('0x5f')]=_['omit'](_0x5e92d3['body'],['id',_0xd574('0x60'),_0xd574('0x5e')]);return db[_0xd574('0x40')][_0xd574('0x61')](_[_0xd574('0x52')](_0x483490,_0x5e92d3['body']),{'include':_0x5e92d3[_0xd574('0x46')][_0xd574('0x54')]?[{'all':!![]}]:undefined})['then'](function(_0x172f5c){var _0xd46eea=_0x5e92d3[_0xd574('0x62')][_0xd574('0x39')]({'plain':!![]});if(!_0xd46eea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd46eea[_0xd574('0x63')]===_0xd574('0x62')){var _0x4fc35d=_0x172f5c[_0xd574('0x39')]({'plain':!![]});var _0x43cd92=_0xd574('0x3a');return db['UserProfileSection'][_0xd574('0x5c')]({'where':{'name':_0x43cd92,'userProfileId':_0xd46eea['userProfileId']},'raw':!![]})[_0xd574('0x38')](function(_0x405897){if(_0x405897&&_0x405897['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4fc35d[_0xd574('0x3d')],'resourceId':_0x4fc35d['id'],'type':_0x405897[_0xd574('0x3d')],'sectionId':_0x405897['id']},{})[_0xd574('0x38')](function(){return _0x172f5c;});}else{return _0x172f5c;}})[_0xd574('0x2a')](function(_0x523d6b){logger[_0xd574('0x26')](_0xd574('0x64'),_0x523d6b);throw _0x523d6b;});}return _0x172f5c;});}})[_0xd574('0x38')](respondWithResult(_0x21f0f7,0xc9))[_0xd574('0x2a')](handleError(_0x21f0f7,null));};exports[_0xd574('0x61')]=function(_0x446f4d,_0x7d3569,_0x121ddf){var _0x452d87;return db['Trunk']['create'](_0x446f4d[_0xd574('0x5f')],{'raw':!![]})[_0xd574('0x38')](function(_0x23e557){_0x452d87=_0x23e557;return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x25d928){var _0x7d471a=fs[_0xd574('0x65')](path['join'](config[_0xd574('0x66')],_0xd574('0x67')),_0xd574('0x68'));var _0x353c74=fs[_0xd574('0x65')](path['join'](config[_0xd574('0x66')],_0xd574('0x69')),_0xd574('0x68'));var _0x2ba5b8=ejs[_0xd574('0x6a')](_0x7d471a,{'trunks':_0x25d928||[]});fs[_0xd574('0x6b')](_0xd574('0x6c'),_0x2ba5b8);if(_0x452d87[_0xd574('0x6d')]){var _0x3c9943=ejs[_0xd574('0x6a')](_0x353c74,{'trunks':_0x25d928||[]});fs[_0xd574('0x6b')](_0xd574('0x6e'),_0x3c9943);}})[_0xd574('0x38')](function(){return respondWithRpcPromise(_0xd574('0x6f'),'create',{'module':'chan_sip.so'});})[_0xd574('0x38')](function(){var _0x2add36=_0x446f4d[_0xd574('0x62')][_0xd574('0x39')]({'plain':!![]});if(!_0x2add36)throw new Error(_0xd574('0x70'));if(_0x2add36['role']===_0xd574('0x62')){var _0x2c58ff=_0x452d87[_0xd574('0x39')]({'plain':!![]});return db['UserProfileSection'][_0xd574('0x5c')]({'where':{'name':_0xd574('0x3a'),'userProfileId':_0x2add36['userProfileId']},'raw':!![]})[_0xd574('0x38')](function(_0x287dda){if(_0x287dda&&_0x287dda[_0xd574('0x71')]===0x0){return db[_0xd574('0x3b')][_0xd574('0x61')]({'name':_0x2c58ff[_0xd574('0x3d')],'resourceId':_0x2c58ff['id'],'type':_0x287dda[_0xd574('0x3d')],'sectionId':_0x287dda['id']},{})[_0xd574('0x38')](function(){return _0x452d87;});}else{return _0x452d87;}})[_0xd574('0x2a')](function(_0x151b66){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x151b66);throw _0x151b66;});}return _0x452d87;})[_0xd574('0x38')](respondWithResult(_0x7d3569,0xc9))[_0xd574('0x2a')](handleError(_0x7d3569,null));};exports['update']=function(_0xf5abd4,_0x5bc161,_0x2721c4){var _0x4e84d5;return db[_0xd574('0x40')][_0xd574('0x5c')]({'where':{'id':_0xf5abd4['params']['id']}})[_0xd574('0x38')](handleEntityNotFound(_0x5bc161,null))[_0xd574('0x38')](saveUpdates(_0xf5abd4[_0xd574('0x5f')],null))[_0xd574('0x38')](function(_0x498a0d){if(_0x498a0d){_0x4e84d5=_0x498a0d;return db[_0xd574('0x40')][_0xd574('0x56')]({'raw':!![]});}})[_0xd574('0x38')](function(_0x358c20){if(_0x358c20){var _0x150c7a=fs[_0xd574('0x65')](path[_0xd574('0x72')](config[_0xd574('0x66')],_0xd574('0x67')),_0xd574('0x68'));var _0x4ad8d0=fs[_0xd574('0x65')](path[_0xd574('0x72')](config[_0xd574('0x66')],_0xd574('0x69')),'utf8');var _0x40e911=ejs['render'](_0x150c7a,{'trunks':_0x358c20||[]});fs[_0xd574('0x6b')](_0xd574('0x6c'),_0x40e911);var _0x517383=ejs[_0xd574('0x6a')](_0x4ad8d0,{'trunks':_0x358c20||[]});fs['writeFileSync'](_0xd574('0x6e'),_0x517383);return respondWithRpcPromise('Reload',_0xd574('0x36'),{'module':_0xd574('0x73')});}return null;})['then'](function(_0x189449){if(_0x189449){return _0x4e84d5;}})[_0xd574('0x38')](respondWithResult(_0x5bc161,null))[_0xd574('0x2a')](handleError(_0x5bc161,null));};exports[_0xd574('0x37')]=function(_0x23bff3,_0x5ea76e,_0x1b3cc6){var _0x44f293;return db[_0xd574('0x40')][_0xd574('0x5c')]({'where':{'id':_0x23bff3[_0xd574('0x59')]['id']}})[_0xd574('0x38')](handleEntityNotFound(_0x5ea76e,null))[_0xd574('0x38')](removeEntity(_0x5ea76e,null))[_0xd574('0x38')](function(){return db[_0xd574('0x40')][_0xd574('0x56')]({'raw':!![]});})[_0xd574('0x38')](function(_0x3deaf1){var _0x586681=fs['readFileSync'](path['join'](config[_0xd574('0x66')],'server/files/templates/trunk.ejs'),'utf8');var _0x47fb61=fs[_0xd574('0x65')](path[_0xd574('0x72')](config['root'],_0xd574('0x69')),_0xd574('0x68'));var _0x5014b2=ejs[_0xd574('0x6a')](_0x586681,{'trunks':_0x3deaf1});var _0x46ece6=ejs['render'](_0x47fb61,{'trunks':_0x3deaf1});fs['writeFileSync'](_0xd574('0x6c'),_0x5014b2);fs['writeFileSync'](_0xd574('0x6e'),_0x46ece6);return respondWithRpcPromise('Reload',_0xd574('0x37'),{'module':_0xd574('0x73')});})[_0xd574('0x2a')](handleError(_0x5ea76e,null));};
\ No newline at end of file
+var _0xcf66=['/etc/asterisk/sip_xcally_registers.conf','Reload','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','set','Content-Range','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','clone','find','createdAt','updatedAt','body','omit','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','root','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x58ed82,_0x26d569){var _0x2df0a1=function(_0x1d7994){while(--_0x1d7994){_0x58ed82['push'](_0x58ed82['shift']());}};_0x2df0a1(++_0x26d569);}(_0xcf66,0x71));var _0x6cf6=function(_0x7da053,_0x35e1ac){_0x7da053=_0x7da053-0x0;var _0x2d9ce5=_0xcf66[_0x7da053];return _0x2d9ce5;};'use strict';var pdf=require(_0x6cf6('0x0'));var emlformat=require(_0x6cf6('0x1'));var rimraf=require(_0x6cf6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6cf6('0x3'));var rp=require(_0x6cf6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6cf6('0x5'));var util=require(_0x6cf6('0x6'));var path=require('path');var sox=require(_0x6cf6('0x7'));var csv=require(_0x6cf6('0x8'));var ejs=require(_0x6cf6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x8'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x6cf6('0x14')][_0x6cf6('0x15')]({'port':0x232a});function checkPasswordPattern(_0x372d12,_0x39e8c3,_0x3e62a7){if(_0x3e62a7){var _0x114c2c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x114c2c['test'](_0x39e8c3)){return _0x372d12;}else{throw new db[(_0x6cf6('0x16'))]['ValidationError'](_0x6cf6('0x17'));}}else{return _0x372d12;}}function respondWithRpcPromise(_0x18360e,_0x4b073f,_0x40e413,_0x1b40f8){return new BPromise(function(_0x2d23ab,_0x74486a){var _0x2b6d7b=_0x1b40f8||client;return _0x2b6d7b[_0x6cf6('0x18')](_0x18360e,_0x40e413)[_0x6cf6('0x19')](function(_0x39ec25){logger[_0x6cf6('0x1a')](_0x6cf6('0x1b'),_0x4b073f,'request\x20sent');logger[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x4b073f,_0x6cf6('0x1e'),JSON['stringify'](_0x39ec25));if(_0x39ec25[_0x6cf6('0x1f')]){if(_0x39ec25[_0x6cf6('0x1f')][_0x6cf6('0x20')]===0x1f4){logger[_0x6cf6('0x1f')](_0x6cf6('0x1b'),_0x4b073f,_0x39ec25[_0x6cf6('0x1f')][_0x6cf6('0x21')]);return _0x74486a(_0x39ec25['error'][_0x6cf6('0x21')]);}logger[_0x6cf6('0x1f')](_0x6cf6('0x1b'),_0x4b073f,_0x39ec25[_0x6cf6('0x1f')][_0x6cf6('0x21')]);return _0x2d23ab(_0x39ec25[_0x6cf6('0x1f')][_0x6cf6('0x21')]);}else{logger[_0x6cf6('0x1a')]('Trunk,\x20%s,\x20%s',_0x4b073f,'request\x20sent');_0x2d23ab(_0x39ec25[_0x6cf6('0x22')]['message']);}})[_0x6cf6('0x23')](function(_0x18c8cd){logger[_0x6cf6('0x1f')](_0x6cf6('0x1b'),_0x4b073f,_0x18c8cd);_0x74486a(_0x18c8cd);});});}function respondWithStatusCode(_0x3f9871,_0x565fad){_0x565fad=_0x565fad||0xcc;return function(_0x1c966e){if(_0x1c966e){return _0x3f9871['sendStatus'](_0x565fad);}return _0x3f9871[_0x6cf6('0x24')](_0x565fad)[_0x6cf6('0x25')]();};}function respondWithResult(_0x3eaa31,_0x558405){_0x558405=_0x558405||0xc8;return function(_0xf4eec5){if(_0xf4eec5){return _0x3eaa31[_0x6cf6('0x24')](_0x558405)[_0x6cf6('0x26')](_0xf4eec5);}};}function respondWithFilteredResult(_0x1f5a88,_0x5c9236){return function(_0x584594){if(_0x584594){var _0x2afe84=_0x584594['count'],_0x4521af=_0x5c9236[_0x6cf6('0x27')],_0x57099f=_0x5c9236['offset']+_0x5c9236['limit'],_0x5869e9;if(_0x57099f>=_0x2afe84){_0x57099f=_0x2afe84;_0x5869e9=0xc8;}else{_0x5869e9=0xce;}_0x1f5a88['status'](_0x5869e9);return _0x1f5a88[_0x6cf6('0x28')](_0x6cf6('0x29'),_0x4521af+'-'+_0x57099f+'/'+_0x2afe84)[_0x6cf6('0x26')](_0x584594);}return null;};}function patchUpdates(_0x42f488){return function(_0x11c848){try{jsonpatch['apply'](_0x11c848,_0x42f488,!![]);}catch(_0x348d9e){return BPromise[_0x6cf6('0x2a')](_0x348d9e);}return _0x11c848[_0x6cf6('0x2b')]();};}function saveUpdates(_0x535b28,_0x3c4b7a){return function(_0x145363){if(_0x145363){return _0x145363[_0x6cf6('0x2c')](_0x535b28)[_0x6cf6('0x19')](function(_0x197c7e){return _0x197c7e;});}return null;};}function removeEntity(_0x1339a2,_0x11f66d){return function(_0xb77709){if(_0xb77709){return _0xb77709[_0x6cf6('0x2d')]()[_0x6cf6('0x19')](function(){var _0x16d34f=_0xb77709[_0x6cf6('0x2e')]({'plain':!![]});var _0x4620b6=_0x6cf6('0x2f');return db[_0x6cf6('0x30')][_0x6cf6('0x2d')]({'where':{'type':_0x4620b6,'resourceId':_0x16d34f['id']}})[_0x6cf6('0x19')](function(){return _0xb77709;});})[_0x6cf6('0x19')](function(){_0x1339a2['status'](0xcc)[_0x6cf6('0x25')]();});}};}function handleEntityNotFound(_0x3314a3,_0x19e94d){return function(_0xa1f482){if(!_0xa1f482){_0x3314a3[_0x6cf6('0x31')](0x194);}return _0xa1f482;};}function handleError(_0x2cf3a3,_0x2bf5d0){_0x2bf5d0=_0x2bf5d0||0x1f4;return function(_0xac8f82){logger[_0x6cf6('0x1f')](_0xac8f82[_0x6cf6('0x32')]);if(_0xac8f82[_0x6cf6('0x33')]){delete _0xac8f82['name'];}_0x2cf3a3[_0x6cf6('0x24')](_0x2bf5d0)[_0x6cf6('0x34')](_0xac8f82);};}exports[_0x6cf6('0x35')]=function(_0x43f2bf,_0x31c822){var _0xe329e3={},_0x2f0120={},_0x42d9e9={'count':0x0,'rows':[]};var _0x3a962a=_['map'](db[_0x6cf6('0x36')][_0x6cf6('0x37')],function(_0x3a0cb1){return{'name':_0x3a0cb1[_0x6cf6('0x38')],'type':_0x3a0cb1[_0x6cf6('0x39')][_0x6cf6('0x3a')]};});_0x2f0120[_0x6cf6('0x3b')]=_[_0x6cf6('0x3c')](_0x3a962a,_0x6cf6('0x33'));_0x2f0120['query']=_[_0x6cf6('0x3d')](_0x43f2bf['query']);_0x2f0120[_0x6cf6('0x3e')]=_[_0x6cf6('0x3f')](_0x2f0120[_0x6cf6('0x3b')],_0x2f0120[_0x6cf6('0x40')]);_0xe329e3[_0x6cf6('0x41')]=_[_0x6cf6('0x3f')](_0x2f0120[_0x6cf6('0x3b')],qs[_0x6cf6('0x42')](_0x43f2bf['query'][_0x6cf6('0x42')]));_0xe329e3[_0x6cf6('0x41')]=_0xe329e3['attributes'][_0x6cf6('0x43')]?_0xe329e3[_0x6cf6('0x41')]:_0x2f0120[_0x6cf6('0x3b')];if(!_0x43f2bf['query'][_0x6cf6('0x44')](_0x6cf6('0x45'))){_0xe329e3['limit']=qs[_0x6cf6('0x46')](_0x43f2bf[_0x6cf6('0x40')][_0x6cf6('0x46')]);_0xe329e3[_0x6cf6('0x27')]=qs[_0x6cf6('0x27')](_0x43f2bf[_0x6cf6('0x40')][_0x6cf6('0x27')]);}_0xe329e3['order']=qs[_0x6cf6('0x47')](_0x43f2bf['query'][_0x6cf6('0x47')]);_0xe329e3[_0x6cf6('0x48')]=qs['filters'](_[_0x6cf6('0x49')](_0x43f2bf[_0x6cf6('0x40')],_0x2f0120[_0x6cf6('0x3e')]),_0x3a962a);if(_0x43f2bf[_0x6cf6('0x40')][_0x6cf6('0x4a')]){_0xe329e3['where']=_[_0x6cf6('0x4b')](_0xe329e3[_0x6cf6('0x48')],{'$or':_[_0x6cf6('0x3c')](_0x3a962a,function(_0x4833d5){if(_0x4833d5[_0x6cf6('0x39')]!==_0x6cf6('0x4c')){var _0xa322b4={};_0xa322b4[_0x4833d5['name']]={'$like':'%'+_0x43f2bf[_0x6cf6('0x40')]['filter']+'%'};return _0xa322b4;}})});}_0xe329e3=_['merge']({},_0xe329e3,_0x43f2bf[_0x6cf6('0x4d')]);var _0x37edba={'where':_0xe329e3[_0x6cf6('0x48')]};return db[_0x6cf6('0x36')][_0x6cf6('0x4e')](_0x37edba)[_0x6cf6('0x19')](function(_0x28629d){_0x42d9e9[_0x6cf6('0x4e')]=_0x28629d;if(_0x43f2bf[_0x6cf6('0x40')][_0x6cf6('0x4f')]){_0xe329e3[_0x6cf6('0x50')]=[{'all':!![]}];}return db[_0x6cf6('0x36')][_0x6cf6('0x51')](_0xe329e3);})['then'](function(_0x26a6ff){_0x42d9e9[_0x6cf6('0x52')]=_0x26a6ff;return _0x42d9e9;})['then'](respondWithFilteredResult(_0x31c822,_0xe329e3))['catch'](handleError(_0x31c822,null));};exports[_0x6cf6('0x53')]=function(_0x17dd6e,_0x1db524){var _0x20a106={'raw':![],'where':{'id':_0x17dd6e[_0x6cf6('0x54')]['id']}},_0x459ca3={};_0x459ca3['model']=_[_0x6cf6('0x3d')](db[_0x6cf6('0x36')][_0x6cf6('0x37')]);_0x459ca3['query']=_['keys'](_0x17dd6e[_0x6cf6('0x40')]);_0x459ca3[_0x6cf6('0x3e')]=_[_0x6cf6('0x3f')](_0x459ca3[_0x6cf6('0x3b')],_0x459ca3[_0x6cf6('0x40')]);_0x20a106[_0x6cf6('0x41')]=_[_0x6cf6('0x3f')](_0x459ca3[_0x6cf6('0x3b')],qs[_0x6cf6('0x42')](_0x17dd6e[_0x6cf6('0x40')]['fields']));_0x20a106[_0x6cf6('0x41')]=_0x20a106[_0x6cf6('0x41')][_0x6cf6('0x43')]?_0x20a106[_0x6cf6('0x41')]:_0x459ca3[_0x6cf6('0x3b')];if(_0x17dd6e[_0x6cf6('0x40')][_0x6cf6('0x4f')]){_0x20a106[_0x6cf6('0x50')]=[{'all':!![]}];}_0x20a106=_[_0x6cf6('0x4b')]({},_0x20a106,_0x17dd6e[_0x6cf6('0x4d')]);return db[_0x6cf6('0x36')]['find'](_0x20a106)[_0x6cf6('0x19')](handleEntityNotFound(_0x1db524,null))['then'](respondWithResult(_0x1db524,null))[_0x6cf6('0x23')](handleError(_0x1db524,null));};exports[_0x6cf6('0x55')]=function(_0x498539,_0x1fa5b0){var _0x399dc0={'where':{'id':_0x498539[_0x6cf6('0x54')]['id']}},_0x4699d5={};_0x4699d5[_0x6cf6('0x3b')]=_[_0x6cf6('0x3d')](db['Trunk'][_0x6cf6('0x37')]);_0x399dc0[_0x6cf6('0x41')]=_[_0x6cf6('0x3f')](_0x4699d5['model'],qs['fields'](_0x498539[_0x6cf6('0x40')][_0x6cf6('0x42')]));_0x399dc0['attributes']=_0x399dc0[_0x6cf6('0x41')][_0x6cf6('0x43')]?_0x399dc0[_0x6cf6('0x41')]:_0x4699d5[_0x6cf6('0x3b')];if(_0x498539[_0x6cf6('0x40')]['includeAll']){_0x399dc0[_0x6cf6('0x50')]=[{'all':!![]}];}_0x399dc0=_[_0x6cf6('0x4b')]({},_0x399dc0,_0x498539['options']);return db['Trunk'][_0x6cf6('0x56')](_0x399dc0)[_0x6cf6('0x19')](handleEntityNotFound(_0x1fa5b0,null))[_0x6cf6('0x19')](function(_0x32a6c6){if(_0x32a6c6){var _0x26dfc7=_0x32a6c6['get']({'plain':!![]});_0x26dfc7=qs['omit'](_0x26dfc7,['id',_0x6cf6('0x57'),_0x6cf6('0x58')]);_0x498539[_0x6cf6('0x59')]=_[_0x6cf6('0x5a')](_0x498539[_0x6cf6('0x59')],['id','createdAt','updatedAt']);return db['Trunk'][_0x6cf6('0x5b')](_[_0x6cf6('0x4b')](_0x26dfc7,_0x498539[_0x6cf6('0x59')]),{'include':_0x498539[_0x6cf6('0x40')]['includeAll']?[{'all':!![]}]:undefined})[_0x6cf6('0x19')](function(_0x5487b5){var _0x179b3d=_0x498539['user'][_0x6cf6('0x2e')]({'plain':!![]});if(!_0x179b3d)throw new Error(_0x6cf6('0x5c'));if(_0x179b3d[_0x6cf6('0x5d')]===_0x6cf6('0x5e')){var _0x38ebcc=_0x5487b5['get']({'plain':!![]});var _0x21ea76='Trunks';return db[_0x6cf6('0x5f')]['find']({'where':{'name':_0x21ea76,'userProfileId':_0x179b3d[_0x6cf6('0x60')]},'raw':!![]})['then'](function(_0x5b19a7){if(_0x5b19a7&&_0x5b19a7[_0x6cf6('0x61')]===0x0){return db['UserProfileResource'][_0x6cf6('0x5b')]({'name':_0x38ebcc[_0x6cf6('0x33')],'resourceId':_0x38ebcc['id'],'type':_0x5b19a7[_0x6cf6('0x33')],'sectionId':_0x5b19a7['id']},{})[_0x6cf6('0x19')](function(){return _0x5487b5;});}else{return _0x5487b5;}})[_0x6cf6('0x23')](function(_0x124d23){logger[_0x6cf6('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x124d23);throw _0x124d23;});}return _0x5487b5;});}})['then'](respondWithResult(_0x1fa5b0,0xc9))[_0x6cf6('0x23')](handleError(_0x1fa5b0,null));};exports[_0x6cf6('0x5b')]=function(_0x5cfc55,_0xd96f46,_0x565efc){var _0x581e78;return db[_0x6cf6('0x36')]['create'](_0x5cfc55['body'],{'raw':!![]})[_0x6cf6('0x19')](function(_0x29a446){_0x581e78=_0x29a446;return db[_0x6cf6('0x36')]['findAll']({'raw':!![]});})[_0x6cf6('0x19')](function(_0x4a2451){var _0x2dedba=fs[_0x6cf6('0x62')](path['join'](config[_0x6cf6('0x63')],_0x6cf6('0x64')),_0x6cf6('0x65'));var _0x421819=fs[_0x6cf6('0x62')](path[_0x6cf6('0x66')](config['root'],_0x6cf6('0x67')),_0x6cf6('0x65'));var _0x177a1c=ejs[_0x6cf6('0x68')](_0x2dedba,{'trunks':_0x4a2451||[]});fs[_0x6cf6('0x69')](_0x6cf6('0x6a'),_0x177a1c);if(_0x581e78['registry']){var _0x5be914=ejs['render'](_0x421819,{'trunks':_0x4a2451||[]});fs[_0x6cf6('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x5be914);}})[_0x6cf6('0x19')](function(){return respondWithRpcPromise('Reload',_0x6cf6('0x5b'),{'module':_0x6cf6('0x6b')});})['then'](function(){var _0x3048a2=_0x5cfc55[_0x6cf6('0x5e')][_0x6cf6('0x2e')]({'plain':!![]});if(!_0x3048a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3048a2[_0x6cf6('0x5d')]==='user'){var _0xaaa702=_0x581e78[_0x6cf6('0x2e')]({'plain':!![]});return db[_0x6cf6('0x5f')][_0x6cf6('0x56')]({'where':{'name':_0x6cf6('0x2f'),'userProfileId':_0x3048a2[_0x6cf6('0x60')]},'raw':!![]})[_0x6cf6('0x19')](function(_0x4df5a8){if(_0x4df5a8&&_0x4df5a8[_0x6cf6('0x61')]===0x0){return db['UserProfileResource'][_0x6cf6('0x5b')]({'name':_0xaaa702[_0x6cf6('0x33')],'resourceId':_0xaaa702['id'],'type':_0x4df5a8[_0x6cf6('0x33')],'sectionId':_0x4df5a8['id']},{})[_0x6cf6('0x19')](function(){return _0x581e78;});}else{return _0x581e78;}})['catch'](function(_0x4ab759){logger[_0x6cf6('0x1f')](_0x6cf6('0x6c'),_0x4ab759);throw _0x4ab759;});}return _0x581e78;})[_0x6cf6('0x19')](respondWithResult(_0xd96f46,0xc9))[_0x6cf6('0x23')](handleError(_0xd96f46,null));};exports[_0x6cf6('0x2c')]=function(_0x43f5bb,_0x5527d6,_0x517c8e){var _0x1c73bf;return db['Trunk'][_0x6cf6('0x56')]({'where':{'id':_0x43f5bb[_0x6cf6('0x54')]['id']}})[_0x6cf6('0x19')](handleEntityNotFound(_0x5527d6,null))[_0x6cf6('0x19')](saveUpdates(_0x43f5bb['body'],null))[_0x6cf6('0x19')](function(_0x4c5f0d){if(_0x4c5f0d){_0x1c73bf=_0x4c5f0d;return db[_0x6cf6('0x36')][_0x6cf6('0x51')]({'raw':!![]});}})[_0x6cf6('0x19')](function(_0x51fe69){if(_0x51fe69){var _0xc509d3=fs[_0x6cf6('0x62')](path[_0x6cf6('0x66')](config['root'],_0x6cf6('0x64')),_0x6cf6('0x65'));var _0x31f59b=fs['readFileSync'](path['join'](config[_0x6cf6('0x63')],'server/files/templates/registry.ejs'),'utf8');var _0x1f1cbb=ejs[_0x6cf6('0x68')](_0xc509d3,{'trunks':_0x51fe69||[]});fs[_0x6cf6('0x69')](_0x6cf6('0x6a'),_0x1f1cbb);var _0x46cad8=ejs[_0x6cf6('0x68')](_0x31f59b,{'trunks':_0x51fe69||[]});fs[_0x6cf6('0x69')](_0x6cf6('0x6d'),_0x46cad8);return respondWithRpcPromise(_0x6cf6('0x6e'),'update',{'module':_0x6cf6('0x6b')});}return null;})[_0x6cf6('0x19')](function(_0x27cfe7){if(_0x27cfe7){return _0x1c73bf;}})['then'](respondWithResult(_0x5527d6,null))['catch'](handleError(_0x5527d6,null));};exports[_0x6cf6('0x2d')]=function(_0x169a33,_0x204f3d,_0x1c254d){var _0x38652f;return db[_0x6cf6('0x36')]['find']({'where':{'id':_0x169a33[_0x6cf6('0x54')]['id']}})[_0x6cf6('0x19')](handleEntityNotFound(_0x204f3d,null))[_0x6cf6('0x19')](removeEntity(_0x204f3d,null))[_0x6cf6('0x19')](function(){return db[_0x6cf6('0x36')][_0x6cf6('0x51')]({'raw':!![]});})[_0x6cf6('0x19')](function(_0x592d53){var _0x316b82=fs[_0x6cf6('0x62')](path['join'](config[_0x6cf6('0x63')],_0x6cf6('0x64')),_0x6cf6('0x65'));var _0x4dca82=fs[_0x6cf6('0x62')](path[_0x6cf6('0x66')](config[_0x6cf6('0x63')],_0x6cf6('0x67')),_0x6cf6('0x65'));var _0x1f2b47=ejs['render'](_0x316b82,{'trunks':_0x592d53});var _0x5073e3=ejs['render'](_0x4dca82,{'trunks':_0x592d53});fs[_0x6cf6('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1f2b47);fs[_0x6cf6('0x69')](_0x6cf6('0x6d'),_0x5073e3);return respondWithRpcPromise('Reload',_0x6cf6('0x2d'),{'module':_0x6cf6('0x6b')});})[_0x6cf6('0x23')](handleError(_0x204f3d,null));};
\ No newline at end of file
index 60a2430..305f589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f11=['path','rimraf','./trunk.attributes','exports','define','lodash','util','../../config/logger','api','request-promise'];(function(_0x5d4364,_0x4a6c71){var _0x460809=function(_0x420c17){while(--_0x420c17){_0x5d4364['push'](_0x5d4364['shift']());}};_0x460809(++_0x4a6c71);}(_0x8f11,0x69));var _0x18f1=function(_0x71773f,_0x1cdeb9){_0x71773f=_0x71773f-0x0;var _0x5cfb5e=_0x8f11[_0x71773f];return _0x5cfb5e;};'use strict';var _=require(_0x18f1('0x0'));var util=require(_0x18f1('0x1'));var logger=require(_0x18f1('0x2'))(_0x18f1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x18f1('0x4'));var fs=require('fs');var path=require(_0x18f1('0x5'));var rimraf=require(_0x18f1('0x6'));var config=require('../../config/environment');var attributes=require(_0x18f1('0x7'));module[_0x18f1('0x8')]=function(_0x3bcc0f,_0x655ba){return _0x3bcc0f[_0x18f1('0x9')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12e9=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x2bc35a,_0x4da8fd){var _0x26b765=function(_0x4d0db2){while(--_0x4d0db2){_0x2bc35a['push'](_0x2bc35a['shift']());}};_0x26b765(++_0x4da8fd);}(_0x12e9,0x9e));var _0x912e=function(_0x43f570,_0x26496a){_0x43f570=_0x43f570-0x0;var _0x4b44b8=_0x12e9[_0x43f570];return _0x4b44b8;};'use strict';var _=require(_0x912e('0x0'));var util=require(_0x912e('0x1'));var logger=require('../../config/logger')(_0x912e('0x2'));var moment=require(_0x912e('0x3'));var BPromise=require(_0x912e('0x4'));var rp=require(_0x912e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x912e('0x6'));var config=require(_0x912e('0x7'));var attributes=require('./trunk.attributes');module[_0x912e('0x8')]=function(_0x423fca,_0x358b04){return _0x423fca[_0x912e('0x9')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 06acb08..5b4d8e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','include','model','map','GetTrunk','Trunk','find','raw','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x402baa,_0x713d8d){var _0x11fcaa=function(_0x598088){while(--_0x598088){_0x402baa['push'](_0x402baa['shift']());}};_0x11fcaa(++_0x713d8d);}(_0x4fc2,0x111));var _0x24fc=function(_0x1f69a2,_0x5ebeb8){_0x1f69a2=_0x1f69a2-0x0;var _0x899ef4=_0x4fc2[_0x1f69a2];return _0x899ef4;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('Trunk,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('Trunk,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['GetTrunk']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['Trunk'][_0x24fc('0x17')]({'raw':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x23873c[_0x24fc('0x18')]?_0x23873c['options'][_0x24fc('0x1a')]||null:null,'limit':_0x23873c['options']?_0x23873c[_0x24fc('0x18')]['limit']||null:null,'include':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x23873c[_0x24fc('0x18')]['include'],function(_0x35a9c7){return{'model':db[_0x35a9c7[_0x24fc('0x1c')]],'as':_0x35a9c7['as'],'attributes':_0x35a9c7[_0x24fc('0x1a')],'include':_0x35a9c7[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x35a9c7[_0x24fc('0x1b')],function(_0x3f0875){return{'model':db[_0x3f0875[_0x24fc('0x1c')]],'as':_0x3f0875['as'],'attributes':_0x3f0875[_0x24fc('0x1a')],'include':_0x3f0875[_0x24fc('0x1b')]?_['map'](_0x3f0875[_0x24fc('0x1b')],function(_0x16f27f){return{'model':db[_0x16f27f[_0x24fc('0x1c')]],'as':_0x16f27f['as'],'attributes':_0x16f27f['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x3d1ec8){logger[_0x24fc('0xd')](_0x24fc('0x1e'),_0x23873c);logger[_0x24fc('0x10')](_0x24fc('0x1e'),_0x23873c,JSON['stringify'](_0x3d1ec8));_0x6cfa0a(_0x3d1ec8);})[_0x24fc('0x16')](function(_0x29a461){logger[_0x24fc('0x13')](_0x24fc('0x1e'),_0x29a461[_0x24fc('0x15')],_0x23873c);_0x8ac114(_0x1cb3d0['error'](0x1f4,_0x29a461['message']));});});};exports['ShowTrunk']=function(_0x3df6f4){var _0x574ba3=this;return new Promise(function(_0x3f2464,_0x3e6389){return db[_0x24fc('0x1f')][_0x24fc('0x20')]({'raw':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x21')]===undefined?!![]:![]:!![],'where':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x3df6f4['options']?_0x3df6f4['options'][_0x24fc('0x1a')]||null:null,'include':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')],function(_0x3b2862){return{'model':db[_0x3b2862[_0x24fc('0x1c')]],'as':_0x3b2862['as'],'attributes':_0x3b2862[_0x24fc('0x1a')],'include':_0x3b2862[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x3b2862[_0x24fc('0x1b')],function(_0x379a4a){return{'model':db[_0x379a4a['model']],'as':_0x379a4a['as'],'attributes':_0x379a4a[_0x24fc('0x1a')],'include':_0x379a4a[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x379a4a[_0x24fc('0x1b')],function(_0x242bd5){return{'model':db[_0x242bd5['model']],'as':_0x242bd5['as'],'attributes':_0x242bd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x5d48fe){logger[_0x24fc('0xd')](_0x24fc('0x22'),_0x3df6f4);logger[_0x24fc('0x10')](_0x24fc('0x22'),_0x3df6f4,JSON['stringify'](_0x5d48fe));_0x3f2464(_0x5d48fe);})[_0x24fc('0x16')](function(_0x4f4ec8){logger[_0x24fc('0x13')](_0x24fc('0x22'),_0x4f4ec8[_0x24fc('0x15')],_0x3df6f4);_0x3e6389(_0x574ba3[_0x24fc('0x13')](0x1f4,_0x4f4ec8[_0x24fc('0x15')]));});});};
\ No newline at end of file
+var _0x0b0e=['model','GetTrunk','Trunk','find','where','include','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','raw','options','attributes','map'];(function(_0x433613,_0x58e1b4){var _0x167334=function(_0x3d076c){while(--_0x3d076c){_0x433613['push'](_0x433613['shift']());}};_0x167334(++_0x58e1b4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x0b0e[_0x15ea09];return _0x3e9c78;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Trunk,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}exports['GetTrunk']=function(_0x54a3eb){var _0x46bb44=this;return new Promise(function(_0x50a441,_0x4df8da){return db['Trunk'][_0xe0b0('0x18')]({'raw':_0x54a3eb['options']?_0x54a3eb['options'][_0xe0b0('0x19')]===undefined?!![]:![]:!![],'where':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x1a')]['where']||null:null,'attributes':_0x54a3eb[_0xe0b0('0x1a')]?_0x54a3eb[_0xe0b0('0x1a')][_0xe0b0('0x1b')]||null:null,'limit':_0x54a3eb[_0xe0b0('0x1a')]?_0x54a3eb[_0xe0b0('0x1a')]['limit']||null:null,'include':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x1a')]['include']?_[_0xe0b0('0x1c')](_0x54a3eb[_0xe0b0('0x1a')]['include'],function(_0x170ad8){return{'model':db[_0x170ad8['model']],'as':_0x170ad8['as'],'attributes':_0x170ad8[_0xe0b0('0x1b')],'include':_0x170ad8['include']?_[_0xe0b0('0x1c')](_0x170ad8['include'],function(_0x3e5c88){return{'model':db[_0x3e5c88['model']],'as':_0x3e5c88['as'],'attributes':_0x3e5c88[_0xe0b0('0x1b')],'include':_0x3e5c88['include']?_[_0xe0b0('0x1c')](_0x3e5c88['include'],function(_0x362aba){return{'model':db[_0x362aba[_0xe0b0('0x1d')]],'as':_0x362aba['as'],'attributes':_0x362aba[_0xe0b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0xd')](function(_0x3ec2){logger[_0xe0b0('0xe')]('GetTrunk',_0x54a3eb);logger[_0xe0b0('0x10')](_0xe0b0('0x1e'),_0x54a3eb,JSON['stringify'](_0x3ec2));_0x50a441(_0x3ec2);})[_0xe0b0('0x17')](function(_0x419b1f){logger[_0xe0b0('0x13')](_0xe0b0('0x1e'),_0x419b1f[_0xe0b0('0x14')],_0x54a3eb);_0x4df8da(_0x46bb44[_0xe0b0('0x13')](0x1f4,_0x419b1f[_0xe0b0('0x14')]));});});};exports['ShowTrunk']=function(_0x1854b8){var _0x3c0109=this;return new Promise(function(_0x48a9b5,_0x4fe400){return db[_0xe0b0('0x1f')][_0xe0b0('0x20')]({'raw':_0x1854b8[_0xe0b0('0x1a')]?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x19')]===undefined?!![]:![]:!![],'where':_0x1854b8['options']?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x21')]||null:null,'attributes':_0x1854b8[_0xe0b0('0x1a')]?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x1b')]||null:null,'include':_0x1854b8['options']?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x22')]?_[_0xe0b0('0x1c')](_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x22')],function(_0x12eeb8){return{'model':db[_0x12eeb8[_0xe0b0('0x1d')]],'as':_0x12eeb8['as'],'attributes':_0x12eeb8[_0xe0b0('0x1b')],'include':_0x12eeb8[_0xe0b0('0x22')]?_[_0xe0b0('0x1c')](_0x12eeb8[_0xe0b0('0x22')],function(_0x1a0c90){return{'model':db[_0x1a0c90[_0xe0b0('0x1d')]],'as':_0x1a0c90['as'],'attributes':_0x1a0c90[_0xe0b0('0x1b')],'include':_0x1a0c90[_0xe0b0('0x22')]?_['map'](_0x1a0c90[_0xe0b0('0x22')],function(_0x135be5){return{'model':db[_0x135be5[_0xe0b0('0x1d')]],'as':_0x135be5['as'],'attributes':_0x135be5[_0xe0b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0xd')](function(_0x2c6e60){logger[_0xe0b0('0xe')]('ShowTrunk',_0x1854b8);logger['debug']('ShowTrunk',_0x1854b8,JSON['stringify'](_0x2c6e60));_0x48a9b5(_0x2c6e60);})[_0xe0b0('0x17')](function(_0xc3d967){logger[_0xe0b0('0x13')]('ShowTrunk',_0xc3d967[_0xe0b0('0x14')],_0x1854b8);_0x4fe400(_0x3c0109[_0xe0b0('0x13')](0x1f4,_0xc3d967[_0xe0b0('0x14')]));});});};
\ No newline at end of file
index e0502e4..96687c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c86=['index','get','/describe','isAuthenticated','describe','/whoami','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getGroups','/:id/recordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','create','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','unpause','/:id/teams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/whatsapp_accounts','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./user.controller'];(function(_0xc7348b,_0x145880){var _0x307cec=function(_0x4f1554){while(--_0x4f1554){_0xc7348b['push'](_0xc7348b['shift']());}};_0x307cec(++_0x145880);}(_0x8c86,0xd8));var _0x68c8=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8c86[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x68c8('0x0'));var util=require(_0x68c8('0x1'));var path=require(_0x68c8('0x2'));var timeout=require(_0x68c8('0x3'));var express=require('express');var router=express[_0x68c8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x68c8('0x5'));var config=require(_0x68c8('0x6'));var controller=require(_0x68c8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x68c8('0x8')]);router[_0x68c8('0x9')](_0x68c8('0xa'),auth[_0x68c8('0xb')](),controller[_0x68c8('0xc')]);router[_0x68c8('0x9')](_0x68c8('0xd'),auth['isAuthenticated'](),controller['whoami']);router['get'](_0x68c8('0xe'),auth[_0x68c8('0xb')](),controller[_0x68c8('0xf')]);router[_0x68c8('0x9')]('/:id/avatar',controller[_0x68c8('0x10')]);router[_0x68c8('0x9')](_0x68c8('0x11'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x12')]);router[_0x68c8('0x9')](_0x68c8('0x13'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x14')]);router[_0x68c8('0x9')](_0x68c8('0x15'),auth[_0x68c8('0xb')](),controller['getVoiceQueuesRt']);router[_0x68c8('0x9')]('/:id/groups',auth[_0x68c8('0xb')](),controller[_0x68c8('0x16')]);router[_0x68c8('0x9')](_0x68c8('0x17'),auth[_0x68c8('0xb')](),controller['getRecordings']);router[_0x68c8('0x9')](_0x68c8('0x18'),auth[_0x68c8('0xb')](),controller['getScreenRecordings']);router[_0x68c8('0x9')](_0x68c8('0x19'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x1a')]);router[_0x68c8('0x9')](_0x68c8('0x1b'),auth[_0x68c8('0xb')](),controller['getOpenchannelInteractions']);router[_0x68c8('0x9')](_0x68c8('0x1c'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x1d')]);router['get'](_0x68c8('0x1e'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x1f')]);router[_0x68c8('0x9')](_0x68c8('0x20'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x21')]);router[_0x68c8('0x9')](_0x68c8('0x22'),auth[_0x68c8('0xb')](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0x68c8('0xb')](),controller[_0x68c8('0x23')]);router['get'](_0x68c8('0x24'),auth['isAuthenticated'](),controller[_0x68c8('0x25')]);router[_0x68c8('0x9')](_0x68c8('0x26'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x27')]);router[_0x68c8('0x9')](_0x68c8('0x28'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x29')]);router[_0x68c8('0x9')]('/:id/fax_accounts',auth[_0x68c8('0xb')](),controller[_0x68c8('0x2a')]);router[_0x68c8('0x9')](_0x68c8('0x2b'),auth['isAuthenticated'](),controller[_0x68c8('0x2c')]);router[_0x68c8('0x9')](_0x68c8('0x2d'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x2e')]);router[_0x68c8('0x9')](_0x68c8('0x2f'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x30')]);router[_0x68c8('0x9')](_0x68c8('0x31'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x68c8('0x9')]('/:id/whatsapp_accounts',auth[_0x68c8('0xb')](),controller['getWhatsappAccounts']);router[_0x68c8('0x9')](_0x68c8('0x32'),auth[_0x68c8('0xb')](),controller['getSquareProjects']);router[_0x68c8('0x9')]('/:id/scheduled_calls',auth[_0x68c8('0xb')](),controller[_0x68c8('0x33')]);router[_0x68c8('0x9')](_0x68c8('0x34'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x35')]);router[_0x68c8('0x36')](_0x68c8('0x37'),auth[_0x68c8('0xb')](),controller['bulkCreate']);router[_0x68c8('0x36')]('/:id/contacts',auth[_0x68c8('0xb')](),controller['addContacts']);router[_0x68c8('0x36')]('/',auth[_0x68c8('0xb')](),controller[_0x68c8('0x38')]);router['post'](_0x68c8('0x13'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x39')]);var upload=multer({'storage':multer[_0x68c8('0x3a')]({'destination':function(_0x4a0ba1,_0x20a44c,_0x1c591d){_0x1c591d(null,path[_0x68c8('0x3b')](config[_0x68c8('0x3c')],_0x68c8('0x3d')));},'filename':function(_0x20796e,_0x52fc83,_0x20c634){_0x20c634(null,util[_0x68c8('0x3e')](_0x68c8('0x3f'),Date[_0x68c8('0x40')](),_0x52fc83[_0x68c8('0x41')]));}})});router[_0x68c8('0x36')]('/:id/avatar',upload[_0x68c8('0x42')]('file'),controller[_0x68c8('0x43')]);router[_0x68c8('0x36')](_0x68c8('0x44'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x45')]);router[_0x68c8('0x36')](_0x68c8('0x46'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x47')]);router['post'](_0x68c8('0x48'),auth['isAuthenticated'](),controller['pause']);router['post']('/:id/unpause',auth[_0x68c8('0xb')](),controller[_0x68c8('0x49')]);router[_0x68c8('0x36')](_0x68c8('0x4a'),auth[_0x68c8('0xb')](),controller['addTeams']);router[_0x68c8('0x36')](_0x68c8('0x4b'),auth[_0x68c8('0xb')](),controller['addChatInteractions']);router[_0x68c8('0x36')](_0x68c8('0x4c'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x4d')]);router[_0x68c8('0x36')]('/:id/fax_interactions',auth[_0x68c8('0xb')](),controller['addFaxInteractions']);router['post'](_0x68c8('0x4e'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x4f')]);router[_0x68c8('0x36')](_0x68c8('0x50'),auth[_0x68c8('0xb')](),controller['addOpenchannelInteractions']);router['post'](_0x68c8('0x51'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x52')]);router[_0x68c8('0x36')](_0x68c8('0x53'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x54')]);router[_0x68c8('0x36')](_0x68c8('0x2b'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x55')]);router[_0x68c8('0x36')]('/:id/openchannel_accounts',auth[_0x68c8('0xb')](),controller[_0x68c8('0x56')]);router[_0x68c8('0x36')](_0x68c8('0x2f'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x57')]);router[_0x68c8('0x36')](_0x68c8('0x31'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x68c8('0x36')](_0x68c8('0x58'),auth[_0x68c8('0xb')](),controller['addWhatsappAccounts']);router[_0x68c8('0x36')](_0x68c8('0x32'),auth[_0x68c8('0xb')](),controller['addSquareProjects']);router[_0x68c8('0x36')](_0x68c8('0x34'),auth[_0x68c8('0xb')](),controller['createApiKey']);router[_0x68c8('0x59')](_0x68c8('0xe'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x5a')]);router[_0x68c8('0x59')](_0x68c8('0x5b'),auth['isAuthenticated'](),controller[_0x68c8('0x5c')]);router[_0x68c8('0x5d')](_0x68c8('0x13'),auth['isAuthenticated'](),controller[_0x68c8('0x5e')]);router[_0x68c8('0x5d')]('/:id/teams',auth[_0x68c8('0xb')](),controller[_0x68c8('0x5f')]);router[_0x68c8('0x5d')]('/:id',auth[_0x68c8('0xb')](),controller[_0x68c8('0x60')]);router[_0x68c8('0x5d')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x68c8('0x61')]);router[_0x68c8('0x5d')](_0x68c8('0x4c'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x62')]);router[_0x68c8('0x5d')](_0x68c8('0x63'),auth['isAuthenticated'](),controller[_0x68c8('0x64')]);router['delete'](_0x68c8('0x4e'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x65')]);router[_0x68c8('0x5d')](_0x68c8('0x50'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x66')]);router['delete']('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x68c8('0x67')]);router['delete'](_0x68c8('0x53'),auth[_0x68c8('0xb')](),controller['removeFaxAccounts']);router[_0x68c8('0x5d')](_0x68c8('0x2b'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x68')]);router[_0x68c8('0x5d')](_0x68c8('0x2d'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x69')]);router[_0x68c8('0x5d')](_0x68c8('0x2f'),auth['isAuthenticated'](),controller[_0x68c8('0x6a')]);router[_0x68c8('0x5d')]('/:id/chat_websites',auth[_0x68c8('0xb')](),controller[_0x68c8('0x6b')]);router[_0x68c8('0x5d')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x68c8('0x6c')]);router[_0x68c8('0x5d')](_0x68c8('0x32'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x6d')]);router[_0x68c8('0x5d')](_0x68c8('0x34'),auth[_0x68c8('0xb')](),controller[_0x68c8('0x6e')]);module[_0x68c8('0x6f')]=router;
\ No newline at end of file
+var _0xdd11=['/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','/:id/contacts','addContacts','create','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','logout','pause','addTeams','/:id/chat_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','/:id/chat_websites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','delete','removeTeams','destroy','removeChatInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeMailAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/:id','show','/:id/avatar','getAvatar','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','getGroups','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions'];(function(_0x16e688,_0x4bd3da){var _0x131955=function(_0x58f782){while(--_0x58f782){_0x16e688['push'](_0x16e688['shift']());}};_0x131955(++_0x4bd3da);}(_0xdd11,0x119));var _0x1dd1=function(_0x2baca1,_0x2f3557){_0x2baca1=_0x2baca1-0x0;var _0x9aa62a=_0xdd11[_0x2baca1];return _0x9aa62a;};'use strict';var multer=require(_0x1dd1('0x0'));var util=require('util');var path=require(_0x1dd1('0x1'));var timeout=require(_0x1dd1('0x2'));var express=require(_0x1dd1('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1dd1('0x4'));var config=require(_0x1dd1('0x5'));var controller=require(_0x1dd1('0x6'));router['get']('/',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x8')]);router[_0x1dd1('0x9')](_0x1dd1('0xa'),auth['isAuthenticated'](),controller[_0x1dd1('0xb')]);router[_0x1dd1('0x9')](_0x1dd1('0xc'),auth['isAuthenticated'](),controller[_0x1dd1('0xd')]);router[_0x1dd1('0x9')](_0x1dd1('0xe'),auth['isAuthenticated'](),controller[_0x1dd1('0xf')]);router[_0x1dd1('0x9')](_0x1dd1('0x10'),controller[_0x1dd1('0x11')]);router['get']('/:id/contacts',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x12')]);router[_0x1dd1('0x9')](_0x1dd1('0x13'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x14')]);router[_0x1dd1('0x9')]('/:id/queues_rt',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x15')]);router[_0x1dd1('0x9')]('/:id/groups',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x16')]);router[_0x1dd1('0x9')]('/:id/recordings',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x17')]);router['get']('/:id/screen_recordings',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x18')]);router[_0x1dd1('0x9')](_0x1dd1('0x19'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x1a')]);router[_0x1dd1('0x9')](_0x1dd1('0x1b'),auth[_0x1dd1('0x7')](),controller['getOpenchannelInteractions']);router[_0x1dd1('0x9')](_0x1dd1('0x1c'),auth[_0x1dd1('0x7')](),controller['getMailInteractions']);router[_0x1dd1('0x9')](_0x1dd1('0x1d'),auth['isAuthenticated'](),controller[_0x1dd1('0x1e')]);router[_0x1dd1('0x9')](_0x1dd1('0x1f'),auth['isAuthenticated'](),controller[_0x1dd1('0x20')]);router[_0x1dd1('0x9')](_0x1dd1('0x21'),auth['isAuthenticated'](),controller[_0x1dd1('0x22')]);router[_0x1dd1('0x9')](_0x1dd1('0x23'),auth['isAuthenticated'](),controller[_0x1dd1('0x24')]);router[_0x1dd1('0x9')](_0x1dd1('0x25'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x26')]);router[_0x1dd1('0x9')](_0x1dd1('0x27'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x28')]);router[_0x1dd1('0x9')]('/:id/prefixes',auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x1dd1('0x9')](_0x1dd1('0x29'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x2a')]);router[_0x1dd1('0x9')](_0x1dd1('0x2b'),auth['isAuthenticated'](),controller[_0x1dd1('0x2c')]);router[_0x1dd1('0x9')](_0x1dd1('0x2d'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x2e')]);router[_0x1dd1('0x9')](_0x1dd1('0x2f'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x1dd1('0x9')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x1dd1('0x30')]);router[_0x1dd1('0x9')](_0x1dd1('0x31'),auth[_0x1dd1('0x7')](),controller['getWhatsappAccounts']);router[_0x1dd1('0x9')](_0x1dd1('0x32'),auth['isAuthenticated'](),controller[_0x1dd1('0x33')]);router[_0x1dd1('0x9')](_0x1dd1('0x34'),auth[_0x1dd1('0x7')](),controller['getScheduledCalls']);router[_0x1dd1('0x9')](_0x1dd1('0x35'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x36')]);router[_0x1dd1('0x37')](_0x1dd1('0x38'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x39')]);router['post'](_0x1dd1('0x3a'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x3b')]);router['post']('/',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x3c')]);router[_0x1dd1('0x37')](_0x1dd1('0x13'),auth[_0x1dd1('0x7')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1dd1('0x3d')]({'destination':function(_0x2f303b,_0x1914ad,_0x1e6b0a){_0x1e6b0a(null,path[_0x1dd1('0x3e')](config[_0x1dd1('0x3f')],_0x1dd1('0x40')));},'filename':function(_0x5d2a51,_0x36d17d,_0x4935df){_0x4935df(null,util[_0x1dd1('0x41')](_0x1dd1('0x42'),Date[_0x1dd1('0x43')](),_0x36d17d[_0x1dd1('0x44')]));}})});router['post'](_0x1dd1('0x10'),upload[_0x1dd1('0x45')](_0x1dd1('0x46')),controller['addAvatar']);router['post'](_0x1dd1('0x47'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x48')]);router[_0x1dd1('0x37')](_0x1dd1('0x49'),auth['isAuthenticated'](),controller[_0x1dd1('0x4a')]);router[_0x1dd1('0x37')]('/:id/pause',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x4b')]);router[_0x1dd1('0x37')]('/:id/unpause',auth[_0x1dd1('0x7')](),controller['unpause']);router[_0x1dd1('0x37')]('/:id/teams',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x4c')]);router[_0x1dd1('0x37')](_0x1dd1('0x4d'),auth[_0x1dd1('0x7')](),controller['addChatInteractions']);router[_0x1dd1('0x37')]('/:id/mail_interactions',auth[_0x1dd1('0x7')](),controller['addMailInteractions']);router[_0x1dd1('0x37')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x1dd1('0x4e')]);router['post'](_0x1dd1('0x4f'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x50')]);router[_0x1dd1('0x37')]('/:id/openchannel_interactions',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x51')]);router['post'](_0x1dd1('0x52'),auth[_0x1dd1('0x7')](),controller['addWhatsappInteractions']);router[_0x1dd1('0x37')](_0x1dd1('0x29'),auth['isAuthenticated'](),controller[_0x1dd1('0x53')]);router[_0x1dd1('0x37')](_0x1dd1('0x2b'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x54')]);router[_0x1dd1('0x37')](_0x1dd1('0x2d'),auth[_0x1dd1('0x7')](),controller['addOpenchannelAccounts']);router['post'](_0x1dd1('0x2f'),auth[_0x1dd1('0x7')](),controller['addSmsAccounts']);router[_0x1dd1('0x37')](_0x1dd1('0x55'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x1dd1('0x37')](_0x1dd1('0x31'),auth['isAuthenticated'](),controller[_0x1dd1('0x56')]);router['post'](_0x1dd1('0x32'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x57')]);router[_0x1dd1('0x37')](_0x1dd1('0x35'),auth['isAuthenticated'](),controller[_0x1dd1('0x58')]);router[_0x1dd1('0x59')](_0x1dd1('0xe'),auth['isAuthenticated'](),controller[_0x1dd1('0x5a')]);router[_0x1dd1('0x59')]('/:id/password',auth[_0x1dd1('0x7')](),controller['changePassword']);router[_0x1dd1('0x5b')]('/:id/queues',auth[_0x1dd1('0x7')](),controller['removeQueues']);router[_0x1dd1('0x5b')](_0x1dd1('0x23'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x5c')]);router[_0x1dd1('0x5b')](_0x1dd1('0xe'),auth['isAuthenticated'](),controller[_0x1dd1('0x5d')]);router['delete']('/:id/chat_interactions',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x5e')]);router[_0x1dd1('0x5b')]('/:id/mail_interactions',auth[_0x1dd1('0x7')](),controller['removeMailInteractions']);router[_0x1dd1('0x5b')]('/:id/fax_interactions',auth[_0x1dd1('0x7')](),controller['removeFaxInteractions']);router[_0x1dd1('0x5b')](_0x1dd1('0x4f'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x5f')]);router[_0x1dd1('0x5b')](_0x1dd1('0x60'),auth['isAuthenticated'](),controller[_0x1dd1('0x61')]);router[_0x1dd1('0x5b')](_0x1dd1('0x52'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x1dd1('0x5b')](_0x1dd1('0x29'),auth[_0x1dd1('0x7')](),controller['removeFaxAccounts']);router[_0x1dd1('0x5b')](_0x1dd1('0x2b'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x62')]);router[_0x1dd1('0x5b')](_0x1dd1('0x2d'),auth[_0x1dd1('0x7')](),controller['removeOpenchannelAccounts']);router[_0x1dd1('0x5b')](_0x1dd1('0x2f'),auth[_0x1dd1('0x7')](),controller['removeSmsAccounts']);router[_0x1dd1('0x5b')](_0x1dd1('0x55'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x63')]);router[_0x1dd1('0x5b')]('/:id/whatsapp_accounts',auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x64')]);router[_0x1dd1('0x5b')](_0x1dd1('0x32'),auth[_0x1dd1('0x7')](),controller['removeSquareProjects']);router[_0x1dd1('0x5b')](_0x1dd1('0x35'),auth[_0x1dd1('0x7')](),controller[_0x1dd1('0x65')]);module[_0x1dd1('0x66')]=router;
\ No newline at end of file
index 0ca8545..14a654d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0504=['peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','update','outgoing','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','originate','uas','certificate','passive','nonat','update,nonat','showWebBar','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsverify','actpass','/etc/pki/tls/private/motion.key','TEXT','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','sequelize','util','lodash','exports','STRING','setDataValue','name','defaultuser','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','user','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend'];(function(_0x1b8b81,_0x2fdf32){var _0x5d55bd=function(_0x579dc1){while(--_0x579dc1){_0x1b8b81['push'](_0x1b8b81['shift']());}};_0x5d55bd(++_0x2fdf32);}(_0x0504,0x186));var _0x4050=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x0504[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0x4050('0x0'));var moment=require('moment');var util=require(_0x4050('0x1'));var _=require(_0x4050('0x2'));module[_0x4050('0x3')]={'name':{'type':Sequelize[_0x4050('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1c5a7d){this[_0x4050('0x5')](_0x4050('0x6'),_0x1c5a7d);this[_0x4050('0x5')](_0x4050('0x7'),_0x1c5a7d);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4f5287){this[_0x4050('0x5')](_0x4050('0x8'),_0x4f5287);this[_0x4050('0x5')]('callerid',util['format'](_0x4050('0x9'),_0x4f5287,this[_0x4050('0xa')](_0x4050('0xb'))));}},'alias':{'type':Sequelize[_0x4050('0x4')]},'email':{'type':Sequelize[_0x4050('0x4')],'allowNull':![],'unique':_0x4050('0xc'),'validate':{'isEmail':!![]},'set':function(_0x3e9b59){if(_0x3e9b59){this[_0x4050('0x5')](_0x4050('0xc'),_0x3e9b59[_0x4050('0xd')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x4050('0xe'),_0x4050('0xf'),_0x4050('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':![],'unique':_0x4050('0xb'),'set':function(_0x361d7a){this[_0x4050('0x5')](_0x4050('0xb'),_0x361d7a);this[_0x4050('0x5')](_0x4050('0x12'),_0x361d7a);this[_0x4050('0x5')]('callerid',util['format']('\x22%s\x22\x20<%s>',this[_0x4050('0xa')](_0x4050('0x8')),_0x361d7a));}},'salt':{'type':Sequelize[_0x4050('0x4')]},'phone':{'type':Sequelize[_0x4050('0x4')]},'mobile':{'type':Sequelize[_0x4050('0x4')]},'address':{'type':Sequelize[_0x4050('0x4')]},'zipcode':{'type':Sequelize[_0x4050('0x4')]},'userpic':{'type':Sequelize[_0x4050('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x4050('0x4')]},'online':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x4050('0x14')]},'voicePause':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x4050('0x4')],'defaultValue':_0x4050('0x15')},'lastPauseAt':{'type':Sequelize[_0x4050('0x14')]},'chatCapacity':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x4050('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x4050('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x4050('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![],'defaultValue':_0x4050('0x16')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x4050('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x18'),'user',_0x4050('0x19')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![],'defaultValue':_0x4050('0x1a')},'callingpres':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x1b'),_0x4050('0x1c'),_0x4050('0x1d'),'ALLOWED','PROHIB_NOT_SCREENED',_0x4050('0x1e'),'PROHIB_FAILED_SCREEN',_0x4050('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![],'defaultValue':_0x4050('0x20'),'set':function(_0x55d9a9){this[_0x4050('0x5')](_0x4050('0x21'),_0x55d9a9?_0x55d9a9[_0x4050('0x22')](','):null);},'get':function(){return this[_0x4050('0xa')](_0x4050('0x21'))?this[_0x4050('0xa')]('transport')[_0x4050('0x23')](','):null;},'comment':_0x4050('0x24')},'dtmfmode':{'type':Sequelize[_0x4050('0x17')]('rfc2833',_0x4050('0x25'),_0x4050('0x26'),_0x4050('0x27'),_0x4050('0x28')),'allowNull':!![],'defaultValue':_0x4050('0x29')},'directmedia':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no','nonat',_0x4050('0x2b'),_0x4050('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x314e8e){this[_0x4050('0x5')](_0x4050('0x2d'),_0x314e8e?_0x314e8e[_0x4050('0x22')](','):null);},'get':function(){return this[_0x4050('0xa')](_0x4050('0x2d'))?this[_0x4050('0xa')]('nat')[_0x4050('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x4050('0x4')]},'namedcallgroup':{'type':Sequelize[_0x4050('0x4')]},'pickupgroup':{'type':Sequelize[_0x4050('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x4050('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4050('0x4')]},'disallow':{'type':Sequelize[_0x4050('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x4050('0x4')],'allowNull':![],'defaultValue':_0x4050('0x2e'),'set':function(_0x106efa){this[_0x4050('0x5')]('allow',_0x106efa?_0x106efa[_0x4050('0x22')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x4050('0xa')]('allow')?this[_0x4050('0xa')](_0x4050('0x2f'))[_0x4050('0x23')](';'):null;},'comment':_0x4050('0x30')},'autoframing':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![],'set':function(_0x55d697){this['setDataValue'](_0x4050('0x31'),_0x55d697?_0x55d697['join'](','):null);},'get':function(){return this['getDataValue'](_0x4050('0x31'))?this[_0x4050('0xa')](_0x4050('0x31'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x4050('0x2a'),'no',_0x4050('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x4050('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![],'defaultValue':_0x4050('0x33')},'amaflags':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x4050('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x4050('0x17')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x4050('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x4050('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x4050('0x17')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x35'),'refuse',_0x4050('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x4050('0x37')),'allowNull':!![],'defaultValue':_0x4050('0x37')},'t38pt_usertpsource':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x4050('0x2a')},'keepalive':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x4050('0x17')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x4050('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x4050('0x2a'),'no','fingerprint',_0x4050('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x4050('0x17')]('active',_0x4050('0x39'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x4050('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no',_0x4050('0x3a'),_0x4050('0x2b'),_0x4050('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x4050('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x4050('0x14')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1ab46d){this['setDataValue'](_0x4050('0x3c'),_0x1ab46d);var _0x48f0b8=this['get']({'plain':!![]});switch(_0x1ab46d){case 0x0:case 0x1:var _0x204c78=_0x48f0b8[_0x4050('0x21')]?_['isArray'](_0x48f0b8['transport'])?_0x48f0b8[_0x4050('0x21')]['join']():_0x48f0b8[_0x4050('0x21')]:_0x4050('0x20');if(_0x204c78===_0x4050('0x3d')){_0x204c78='udp';}this['setDataValue'](_0x4050('0x21'),_0x204c78);this[_0x4050('0x5')](_0x4050('0x3e'),'no');this[_0x4050('0x5')](_0x4050('0x3f'),null);this[_0x4050('0x5')](_0x4050('0x40'),null);this[_0x4050('0x5')](_0x4050('0x41'),null);this[_0x4050('0x5')](_0x4050('0x42'),null);this['setDataValue']('dtlsverify',null);this[_0x4050('0x5')](_0x4050('0x43'),null);this[_0x4050('0x5')](_0x4050('0x44'),null);this[_0x4050('0x5')](_0x4050('0x45'),null);this['setDataValue'](_0x4050('0x46'),'no');break;case 0x2:this[_0x4050('0x5')](_0x4050('0x21'),_0x4050('0x3d'));this['setDataValue'](_0x4050('0x3e'),_0x4050('0x2a'));this[_0x4050('0x5')](_0x4050('0x3f'),'yes');this[_0x4050('0x5')](_0x4050('0x40'),_0x4050('0x2a'));this[_0x4050('0x5')](_0x4050('0x41'),_0x4050('0x2a'));this[_0x4050('0x5')]('dtlsenable',_0x4050('0x2a'));this[_0x4050('0x5')](_0x4050('0x47'),'no');this[_0x4050('0x5')](_0x4050('0x43'),_0x4050('0x48'));this['setDataValue'](_0x4050('0x44'),_0x48f0b8['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0x4050('0x45'),_0x48f0b8[_0x4050('0x45')]||_0x4050('0x49'));this[_0x4050('0x5')]('rtcp_mux',_0x4050('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x4050('0x4a')],'set':function(_0x45edc0){this[_0x4050('0x5')](_0x4050('0x4b'),_0x45edc0?_0x45edc0[_0x4050('0x22')](','):[]);},'get':function(){return this[_0x4050('0xa')]('permissions')?_['map'](this[_0x4050('0xa')]('permissions')[_0x4050('0x23')](','),function(_0x2c9a6f){return parseInt(_0x2c9a6f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x4050('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x4050('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x4050('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x4050('0x17')](_0x4050('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x4050('0x14')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x4050('0x4c'))?this[_0x4050('0xa')](_0x4050('0x4c')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x4050('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x4050('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xec5d7c){if(typeof _0xec5d7c===_0x4050('0x4d')){var _0x395e4b=_0xec5d7c==='1'?!![]:_0xec5d7c==='0'?![]:_0xec5d7c===_0x4050('0x4e')?!![]:_0xec5d7c===_0x4050('0x4f')?![]:![];this[_0x4050('0x5')](_0x4050('0x50'),_0x395e4b);}else{this['setDataValue'](_0x4050('0x50'),_0xec5d7c);}}},'blocked':{'type':Sequelize[_0x4050('0x13')],'defaultValue':![],'set':function(_0x1e94e2){this[_0x4050('0x5')]('blocked',_0x1e94e2);if(_0x1e94e2===!![]){this[_0x4050('0x5')](_0x4050('0x51'),moment());this[_0x4050('0x5')](_0x4050('0x52'),0x0);}else{this[_0x4050('0x5')](_0x4050('0x51'),null);}}},'blockedAt':{'type':Sequelize[_0x4050('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x4050('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa1be=['from-sip','ALLOWED_NOT_SCREENED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','shortinfo','inband','rfc2833','yes','nonat','outgoing','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','active','actpass','update','update,nonat','showWebBar','get','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','map','phoneBarEnableScreenRecordingByAgent','screenrecording','blocked','blockedAt','loginAttempts','sequelize','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer'];(function(_0x542fd8,_0x56e82b){var _0x5ae1f4=function(_0x57e6eb){while(--_0x57e6eb){_0x542fd8['push'](_0x542fd8['shift']());}};_0x5ae1f4(++_0x56e82b);}(_0xa1be,0xd8));var _0xea1b=function(_0x37115c,_0x281549){_0x37115c=_0x37115c-0x0;var _0x2c73fa=_0xa1be[_0x37115c];return _0x2c73fa;};'use strict';var Sequelize=require(_0xea1b('0x0'));var moment=require('moment');var util=require(_0xea1b('0x1'));var _=require(_0xea1b('0x2'));module['exports']={'name':{'type':Sequelize[_0xea1b('0x3')],'allowNull':![],'unique':_0xea1b('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x14d76e){this[_0xea1b('0x5')]('name',_0x14d76e);this[_0xea1b('0x5')](_0xea1b('0x6'),_0x14d76e);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xea1b('0x3')],'allowNull':![],'set':function(_0x3677a0){this[_0xea1b('0x5')](_0xea1b('0x7'),_0x3677a0);this['setDataValue'](_0xea1b('0x8'),util[_0xea1b('0x9')](_0xea1b('0xa'),_0x3677a0,this[_0xea1b('0xb')](_0xea1b('0xc'))));}},'alias':{'type':Sequelize[_0xea1b('0x3')]},'email':{'type':Sequelize[_0xea1b('0x3')],'allowNull':![],'unique':_0xea1b('0xd'),'validate':{'isEmail':!![]},'set':function(_0x19addd){if(_0x19addd){this[_0xea1b('0x5')](_0xea1b('0xd'),_0x19addd['toLowerCase']());}}},'role':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0xf'),_0xea1b('0x10'),_0xea1b('0x11'),_0xea1b('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xea1b('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xea1b('0xc'),'set':function(_0x1eb94f){this['setDataValue']('internal',_0x1eb94f);this[_0xea1b('0x5')](_0xea1b('0x14'),_0x1eb94f);this['setDataValue'](_0xea1b('0x8'),util[_0xea1b('0x9')]('\x22%s\x22\x20<%s>',this[_0xea1b('0xb')](_0xea1b('0x7')),_0x1eb94f));}},'salt':{'type':Sequelize[_0xea1b('0x3')]},'phone':{'type':Sequelize[_0xea1b('0x3')]},'mobile':{'type':Sequelize[_0xea1b('0x3')]},'address':{'type':Sequelize[_0xea1b('0x3')]},'zipcode':{'type':Sequelize[_0xea1b('0x3')]},'userpic':{'type':Sequelize[_0xea1b('0x3')]},'city':{'type':Sequelize[_0xea1b('0x3')]},'country':{'type':Sequelize[_0xea1b('0x3')]},'online':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xea1b('0x16')]},'voicePause':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xea1b('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xea1b('0x16')]},'chatCapacity':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xea1b('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xea1b('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xea1b('0x18')},'ipaddr':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xea1b('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x19'),_0xea1b('0x10'),_0xea1b('0x1a')),'allowNull':!![],'defaultValue':_0xea1b('0x19')},'context':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![],'defaultValue':_0xea1b('0x1b')},'callingpres':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x1c'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0xea1b('0x1d'),_0xea1b('0x1e'),'PROHIB_FAILED_SCREEN',_0xea1b('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![],'defaultValue':_0xea1b('0x20'),'set':function(_0x33235b){this[_0xea1b('0x5')](_0xea1b('0x21'),_0x33235b?_0x33235b[_0xea1b('0x22')](','):null);},'get':function(){return this[_0xea1b('0xb')](_0xea1b('0x21'))?this[_0xea1b('0xb')]('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xea1b('0xe')]('rfc2833','info',_0xea1b('0x23'),_0xea1b('0x24'),'auto'),'allowNull':!![],'defaultValue':_0xea1b('0x25')},'directmedia':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no',_0xea1b('0x27'),'update',_0xea1b('0x28')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x23a265){this[_0xea1b('0x5')](_0xea1b('0x29'),_0x23a265?_0x23a265[_0xea1b('0x22')](','):null);},'get':function(){return this[_0xea1b('0xb')]('nat')?this[_0xea1b('0xb')]('nat')[_0xea1b('0x2a')](','):null;},'comment':_0xea1b('0x2b')},'callgroup':{'type':Sequelize[_0xea1b('0x3')]},'namedcallgroup':{'type':Sequelize[_0xea1b('0x3')]},'pickupgroup':{'type':Sequelize[_0xea1b('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xea1b('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xea1b('0x3')]},'disallow':{'type':Sequelize[_0xea1b('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xea1b('0x3')],'allowNull':![],'defaultValue':_0xea1b('0x2c'),'set':function(_0x44769e){this[_0xea1b('0x5')](_0xea1b('0x2d'),_0x44769e?_0x44769e[_0xea1b('0x22')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xea1b('0xb')](_0xea1b('0x2d'))?this[_0xea1b('0xb')]('allow')['split'](';'):null;},'comment':_0xea1b('0x2e')},'autoframing':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![],'set':function(_0x31a9ad){this[_0xea1b('0x5')]('insecure',_0x31a9ad?_0x31a9ad[_0xea1b('0x22')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0xea1b('0xb')](_0xea1b('0x2f'))[_0xea1b('0x2a')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no',_0xea1b('0x30')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xea1b('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xea1b('0x31')},'amaflags':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![],'defaultValue':_0xea1b('0x26')},'busylevel':{'type':Sequelize[_0xea1b('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xea1b('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xea1b('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xea1b('0x26'),'no',_0xea1b('0x32')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xea1b('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x33'),_0xea1b('0x34'),_0xea1b('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xea1b('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x36'),_0xea1b('0x37')),'allowNull':!![],'defaultValue':_0xea1b('0x37')},'t38pt_usertpsource':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xea1b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xea1b('0x17')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xea1b('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xea1b('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xea1b('0xe')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xea1b('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xea1b('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no',_0xea1b('0x38'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xea1b('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xea1b('0x39'),'passive',_0xea1b('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xea1b('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xea1b('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xea1b('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no',_0xea1b('0x27'),_0xea1b('0x3b'),_0xea1b('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xea1b('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xea1b('0x16')]},'showWebBar':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0,'set':function(_0x5e9a5a){this[_0xea1b('0x5')](_0xea1b('0x3d'),_0x5e9a5a);var _0x4fdfda=this[_0xea1b('0x3e')]({'plain':!![]});switch(_0x5e9a5a){case 0x0:case 0x1:var _0x10d989=_0x4fdfda['transport']?_['isArray'](_0x4fdfda[_0xea1b('0x21')])?_0x4fdfda['transport']['join']():_0x4fdfda[_0xea1b('0x21')]:_0xea1b('0x20');if(_0x10d989===_0xea1b('0x3f')){_0x10d989='udp';}this[_0xea1b('0x5')](_0xea1b('0x21'),_0x10d989);this['setDataValue'](_0xea1b('0x40'),'no');this[_0xea1b('0x5')]('avpf',null);this['setDataValue'](_0xea1b('0x41'),null);this['setDataValue'](_0xea1b('0x42'),null);this['setDataValue'](_0xea1b('0x43'),null);this['setDataValue'](_0xea1b('0x44'),null);this[_0xea1b('0x5')](_0xea1b('0x45'),null);this['setDataValue']('dtlscertfile',null);this[_0xea1b('0x5')](_0xea1b('0x46'),null);this[_0xea1b('0x5')](_0xea1b('0x47'),'no');break;case 0x2:this[_0xea1b('0x5')](_0xea1b('0x21'),'wss');this[_0xea1b('0x5')](_0xea1b('0x40'),'yes');this[_0xea1b('0x5')]('avpf',_0xea1b('0x26'));this['setDataValue'](_0xea1b('0x41'),'yes');this[_0xea1b('0x5')](_0xea1b('0x42'),'yes');this[_0xea1b('0x5')](_0xea1b('0x43'),_0xea1b('0x26'));this[_0xea1b('0x5')](_0xea1b('0x44'),'no');this[_0xea1b('0x5')](_0xea1b('0x45'),_0xea1b('0x3a'));this['setDataValue']('dtlscertfile',_0x4fdfda[_0xea1b('0x48')]||_0xea1b('0x49'));this['setDataValue'](_0xea1b('0x46'),_0x4fdfda[_0xea1b('0x46')]||_0xea1b('0x4a'));this[_0xea1b('0x5')](_0xea1b('0x47'),_0xea1b('0x26'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x2cdb16){this[_0xea1b('0x5')]('permissions',_0x2cdb16?_0x2cdb16[_0xea1b('0x22')](','):[]);},'get':function(){return this[_0xea1b('0xb')]('permissions')?_[_0xea1b('0x4b')](this[_0xea1b('0xb')]('permissions')['split'](','),function(_0x28a63e){return parseInt(_0x28a63e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xea1b('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xea1b('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xea1b('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xea1b('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xea1b('0xe')](_0xea1b('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xea1b('0x3')]},'passwordResetAt':{'type':Sequelize[_0xea1b('0x16')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0xea1b('0x4c')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xea1b('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x140812){if(typeof _0x140812==='string'){var _0x31dcc0=_0x140812==='1'?!![]:_0x140812==='0'?![]:_0x140812==='true'?!![]:_0x140812==='false'?![]:![];this['setDataValue'](_0xea1b('0x4d'),_0x31dcc0);}else{this[_0xea1b('0x5')]('screenrecording',_0x140812);}}},'blocked':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![],'set':function(_0x378d76){this[_0xea1b('0x5')](_0xea1b('0x4e'),_0x378d76);if(_0x378d76===!![]){this[_0xea1b('0x5')](_0xea1b('0x4f'),moment());this[_0xea1b('0x5')](_0xea1b('0x50'),0x0);}else{this[_0xea1b('0x5')](_0xea1b('0x4f'),null);}}},'blockedAt':{'type':Sequelize[_0xea1b('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xea1b('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xea1b('0x15')],'defaultValue':![]}};
\ No newline at end of file
index f314d1a..803405c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c5=['manual','getTeams','addTeams','Team','setDataValue','Voice','getChatQueues','Chat','getMailQueues','getSmsQueues','Sms','getFaxQueues','Fax','Openchannel','flatten','addAgent','getDataValue','removeTeams','Mail','getWhatsappQueues','Whatsapp','getOpenchannelQueues','transaction','removeAgent','online','getLists','getAgents','values','addChatInteractions','omit','spread','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./user.socket','register','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','apply','reject','destroy','Users','Agents','Telephones','filter','ignore','value','includes','name','UserProfileResource','end','stack','send','index','User','rawAttributes','type','key','model','password','query','keys','intersection','attributes','fields','limit','offset','order','sort','where','filters','merge','VIRTUAL','sequelize','lower','col','includeAll','include','show','differenceBy','salt','length','options','find','bulkCreate','body','update','role','params','describe','ids','agent','telephone','user','getLicense','telephones','isNil','License\x20limit\x20reached','format','create','internal','Setting','findById','securePassword','min_internal','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','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','113','110','104','105','107','109','100','111','114','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','capitalize','QueueId','Queue:save','voice','VoiceQueue','findAll','push','SIP/%s','each','UserVoiceQueueRt','upsert','removeQueues','remove','emit','Queue:remove','addAvatar','userpic','file','filename','getAvatar','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','join','getContacts','CmContact','pick','map','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Unknown\x20role','Queue','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','rows','getScreenRecordings','UserId','ScreenRecording','ChatInteraction','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','mail','chat','sms','whatsapp','openchannel','set','%s%s','Pause','unpause'];(function(_0x8439c0,_0x165d2f){var _0xed6895=function(_0x274887){while(--_0x274887){_0x8439c0['push'](_0x8439c0['shift']());}};_0xed6895(++_0x165d2f);}(_0xc1c5,0x75));var _0x5c1c=function(_0x26b825,_0x419d40){_0x26b825=_0x26b825-0x0;var _0x28073b=_0xc1c5[_0x26b825];return _0x28073b;};'use strict';var pdf=require(_0x5c1c('0x0'));var emlformat=require(_0x5c1c('0x1'));var rimraf=require(_0x5c1c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c1c('0x3'));var rp=require(_0x5c1c('0x4'));var moment=require(_0x5c1c('0x5'));var BPromise=require(_0x5c1c('0x6'));var Mustache=require(_0x5c1c('0x7'));var util=require(_0x5c1c('0x8'));var path=require(_0x5c1c('0x9'));var sox=require(_0x5c1c('0xa'));var csv=require(_0x5c1c('0xb'));var ejs=require(_0x5c1c('0xc'));var fs=require('fs');var _=require(_0x5c1c('0xd'));var squel=require(_0x5c1c('0xe'));var crypto=require('crypto');var jsforce=require(_0x5c1c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5c1c('0xb'));var querystring=require(_0x5c1c('0x10'));var Papa=require(_0x5c1c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c1c('0x12'));var as=require(_0x5c1c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c1c('0x14'))(_0x5c1c('0x15'));var utils=require('../../config/utils');var config=require(_0x5c1c('0x16'));var db=require(_0x5c1c('0x17'))['db'];config[_0x5c1c('0x18')]=_['defaults'](config[_0x5c1c('0x18')],{'host':_0x5c1c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c1c('0x18')]));require(_0x5c1c('0x1a'))[_0x5c1c('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5c1c('0x1c')][_0x5c1c('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x5ed7b3,_0x4275f3,_0x330deb){if(_0x330deb){var _0x244ab0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x244ab0[_0x5c1c('0x1e')](_0x4275f3)){return _0x5ed7b3;}else{throw new db[(_0x5c1c('0x1f'))]['ValidationError'](_0x5c1c('0x20'));}}else{return _0x5ed7b3;}}function respondWithRpcPromise(_0x45395f,_0x59a28d,_0x3f3fb3,_0x29a6c2){return new BPromise(function(_0xaa4554,_0x53e8d0){var _0x182718=_0x29a6c2||client;return _0x182718['request'](_0x45395f,_0x3f3fb3)[_0x5c1c('0x21')](function(_0x2db55b){logger[_0x5c1c('0x22')]('User,\x20%s,\x20%s',_0x59a28d,_0x5c1c('0x23'));logger[_0x5c1c('0x24')](_0x5c1c('0x25'),_0x59a28d,'request\x20sent',JSON['stringify'](_0x2db55b));if(_0x2db55b[_0x5c1c('0x26')]){if(_0x2db55b[_0x5c1c('0x26')][_0x5c1c('0x27')]===0x1f4){logger[_0x5c1c('0x26')](_0x5c1c('0x28'),_0x59a28d,_0x2db55b[_0x5c1c('0x26')]['message']);return _0x53e8d0(_0x2db55b[_0x5c1c('0x26')][_0x5c1c('0x29')]);}logger[_0x5c1c('0x26')](_0x5c1c('0x28'),_0x59a28d,_0x2db55b[_0x5c1c('0x26')][_0x5c1c('0x29')]);return _0xaa4554(_0x2db55b[_0x5c1c('0x26')]['message']);}else{logger[_0x5c1c('0x22')](_0x5c1c('0x28'),_0x59a28d,'request\x20sent');_0xaa4554(_0x2db55b['result']['message']);}})[_0x5c1c('0x2a')](function(_0x922568){logger[_0x5c1c('0x26')](_0x5c1c('0x28'),_0x59a28d,_0x922568);_0x53e8d0(_0x922568);});});}function respondWithStatusCode(_0x3a55e6,_0x23d8bf){_0x23d8bf=_0x23d8bf||0xcc;return function(_0x2c3aff){if(_0x2c3aff){return _0x3a55e6[_0x5c1c('0x2b')](_0x23d8bf);}return _0x3a55e6['status'](_0x23d8bf)['end']();};}function respondWithResult(_0x2777da,_0x31e6e9){_0x31e6e9=_0x31e6e9||0xc8;return function(_0x281f0e){if(_0x281f0e){return _0x2777da[_0x5c1c('0x2c')](_0x31e6e9)[_0x5c1c('0x2d')](_0x281f0e);}};}function respondWithFilteredResult(_0x1420a9,_0x2557a5){return function(_0x2677a5){if(_0x2677a5){var _0x28bb6d=_0x2677a5[_0x5c1c('0x2e')],_0x4e2aa2=_0x2557a5['offset'],_0x4b176c=_0x2557a5['offset']+_0x2557a5['limit'],_0x126c32;if(_0x4b176c>=_0x28bb6d){_0x4b176c=_0x28bb6d;_0x126c32=0xc8;}else{_0x126c32=0xce;}_0x1420a9[_0x5c1c('0x2c')](_0x126c32);return _0x1420a9['set']('Content-Range',_0x4e2aa2+'-'+_0x4b176c+'/'+_0x28bb6d)[_0x5c1c('0x2d')](_0x2677a5);}return null;};}function patchUpdates(_0x34c5bd){return function(_0x24496d){try{jsonpatch[_0x5c1c('0x2f')](_0x24496d,_0x34c5bd,!![]);}catch(_0x14ef3b){return BPromise[_0x5c1c('0x30')](_0x14ef3b);}return _0x24496d['save']();};}function saveUpdates(_0x1d8091,_0x1c5f0d){return function(_0x376ea6){if(_0x376ea6){return _0x376ea6['update'](_0x1d8091)['then'](function(_0x3c8eeb){return _0x3c8eeb;});}return null;};}function removeEntity(_0x239bee,_0x2eecbb){return function(_0x535e45){if(_0x535e45){return _0x535e45[_0x5c1c('0x31')]()[_0x5c1c('0x21')](function(){var _0x263935=_0x535e45['get']({'plain':!![]});var _0x316e8d=[{'name':_0x5c1c('0x32'),'value':'user','ignore':!![]},{'name':_0x5c1c('0x33'),'value':'agent','ignore':![]},{'name':_0x5c1c('0x34'),'value':'telephone','ignore':![]}];var _0x1ea492=_(_0x316e8d)[_0x5c1c('0x35')](_0x5c1c('0x36'))['map']('value')[_0x5c1c('0x37')]();if(_[_0x5c1c('0x38')](_0x1ea492,_0x263935['role'])){return;}var _0x19ed43=_['find'](_0x316e8d,['value',_0x263935['role']])[_0x5c1c('0x39')];return db[_0x5c1c('0x3a')][_0x5c1c('0x31')]({'where':{'type':_0x19ed43,'resourceId':_0x263935['id']}})[_0x5c1c('0x21')](function(){return _0x535e45;});})[_0x5c1c('0x21')](function(){_0x239bee['status'](0xcc)[_0x5c1c('0x3b')]();});}};}function handleEntityNotFound(_0x3b4472,_0x5ecab0){return function(_0x35d1cb){if(!_0x35d1cb){_0x3b4472[_0x5c1c('0x2b')](0x194);}return _0x35d1cb;};}function handleError(_0x3b74c3,_0x5ed787){_0x5ed787=_0x5ed787||0x1f4;return function(_0x42d9ea){logger['error'](_0x42d9ea[_0x5c1c('0x3c')]);if(_0x42d9ea[_0x5c1c('0x39')]){delete _0x42d9ea[_0x5c1c('0x39')];}_0x3b74c3[_0x5c1c('0x2c')](_0x5ed787)[_0x5c1c('0x3d')](_0x42d9ea);};}exports[_0x5c1c('0x3e')]=function(_0x285937,_0x4e3f21){var _0x5d916c={},_0x305b11={},_0x50f24b={'count':0x0,'rows':[]};var _0x47f04f=_['map'](db[_0x5c1c('0x3f')][_0x5c1c('0x40')],function(_0x36ebba){return{'name':_0x36ebba['fieldName'],'type':_0x36ebba[_0x5c1c('0x41')][_0x5c1c('0x42')]};});_0x305b11[_0x5c1c('0x43')]=_['differenceBy'](_['map'](_0x47f04f,'name'),[_0x5c1c('0x44'),'salt']);_0x305b11[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x285937[_0x5c1c('0x45')]);_0x305b11['filters']=_[_0x5c1c('0x47')](_0x305b11['model'],_0x305b11['query']);_0x5d916c[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x305b11[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x285937['query'][_0x5c1c('0x49')]));_0x5d916c[_0x5c1c('0x48')]=_0x5d916c['attributes']['length']?_0x5d916c[_0x5c1c('0x48')]:_0x305b11[_0x5c1c('0x43')];if(!_0x285937[_0x5c1c('0x45')]['hasOwnProperty']('nolimit')){_0x5d916c['limit']=qs[_0x5c1c('0x4a')](_0x285937[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x5d916c[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x285937[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}_0x5d916c[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x285937[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x5d916c[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_['pick'](_0x285937[_0x5c1c('0x45')],_0x305b11[_0x5c1c('0x4f')]),_0x47f04f);if(_0x285937[_0x5c1c('0x45')]['filter']){_0x5d916c[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x5d916c['where'],{'$or':_['map'](_0x47f04f,function(_0x5c686e){if(_0x5c686e['type']!==_0x5c1c('0x51')){return db[_0x5c1c('0x52')][_0x5c1c('0x4e')](db['sequelize']['fn'](_0x5c1c('0x53'),db[_0x5c1c('0x52')][_0x5c1c('0x54')](_0x5c686e[_0x5c1c('0x39')])),{'$like':db['sequelize']['fn']('lower','%'+_0x285937[_0x5c1c('0x45')]['filter']+'%')});}})});}_0x5d916c=_[_0x5c1c('0x50')]({},_0x5d916c,_0x285937['options']);var _0x568335={'where':_0x5d916c[_0x5c1c('0x4e')]};return db[_0x5c1c('0x3f')][_0x5c1c('0x2e')](_0x568335)[_0x5c1c('0x21')](function(_0xd213bf){_0x50f24b[_0x5c1c('0x2e')]=_0xd213bf;if(_0x285937['query'][_0x5c1c('0x55')]){_0x5d916c[_0x5c1c('0x56')]=[{'all':!![]}];}return db['User']['findAll'](_0x5d916c);})['then'](function(_0x4dde70){_0x50f24b['rows']=_0x4dde70;return _0x50f24b;})[_0x5c1c('0x21')](respondWithFilteredResult(_0x4e3f21,_0x5d916c))['catch'](handleError(_0x4e3f21,null));};exports[_0x5c1c('0x57')]=function(_0xc5e9df,_0x9708f8){var _0x4a5b21={'raw':![],'where':{'id':_0xc5e9df['params']['id']}},_0x5bed2a={};_0x5bed2a[_0x5c1c('0x43')]=_[_0x5c1c('0x58')](_[_0x5c1c('0x46')](db[_0x5c1c('0x3f')][_0x5c1c('0x40')]),[_0x5c1c('0x44'),_0x5c1c('0x59')]);_0x5bed2a[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0xc5e9df[_0x5c1c('0x45')]);_0x5bed2a[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x5bed2a['model'],_0x5bed2a[_0x5c1c('0x45')]);_0x4a5b21[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x5bed2a[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0xc5e9df[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x4a5b21[_0x5c1c('0x48')]=_0x4a5b21[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x4a5b21[_0x5c1c('0x48')]:_0x5bed2a['model'];if(_0xc5e9df[_0x5c1c('0x45')][_0x5c1c('0x55')]){_0x4a5b21[_0x5c1c('0x56')]=[{'all':!![]}];}_0x4a5b21=_[_0x5c1c('0x50')]({},_0x4a5b21,_0xc5e9df[_0x5c1c('0x5b')]);return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')](_0x4a5b21)['then'](handleEntityNotFound(_0x9708f8,null))[_0x5c1c('0x21')](respondWithResult(_0x9708f8,null))[_0x5c1c('0x2a')](handleError(_0x9708f8,null));};exports[_0x5c1c('0x5d')]=function(_0x5c7758,_0x4cae60){return db[_0x5c1c('0x3f')][_0x5c1c('0x5d')](_0x5c7758[_0x5c1c('0x5e')],{'raw':![],'individualHooks':!![]})[_0x5c1c('0x21')](respondWithResult(_0x4cae60,0xc9))[_0x5c1c('0x2a')](handleError(_0x4cae60,null));};exports[_0x5c1c('0x5f')]=function(_0x32c1bf,_0xa48e50){if(_0x32c1bf[_0x5c1c('0x5e')]['id']){delete _0x32c1bf[_0x5c1c('0x5e')]['id'];}delete _0x32c1bf[_0x5c1c('0x5e')][_0x5c1c('0x60')];return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x32c1bf[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0xa48e50,null))['then'](saveUpdates(_0x32c1bf['body'],null))[_0x5c1c('0x21')](respondWithResult(_0xa48e50,null))[_0x5c1c('0x2a')](handleError(_0xa48e50,null));};exports[_0x5c1c('0x62')]=function(_0x113d85,_0x1a8808){return db[_0x5c1c('0x3f')]['describe']()['then'](respondWithResult(_0x1a8808,null))[_0x5c1c('0x2a')](handleError(_0x1a8808,null));};exports['addContacts']=function(_0x2429ed,_0x147345,_0x1aae28){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x2429ed[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x147345,null))[_0x5c1c('0x21')](function(_0x576138){if(_0x576138){return _0x576138['addContacts'](_0x2429ed[_0x5c1c('0x5e')]['ids'],_['omit'](_0x2429ed['body'],[_0x5c1c('0x63'),'id'])||{});}})[_0x5c1c('0x21')](respondWithResult(_0x147345,null))[_0x5c1c('0x2a')](handleError(_0x147345,null));};var getLicense=function(_0x32161e){return new BPromise(function(_0x4315c8,_0x5c7dca){var _0x645083=0x0;_0x32161e[_0x5c1c('0x5e')][_0x5c1c('0x60')]===_0x5c1c('0x64')&&_0x4315c8('agent\x20role');return db[_0x5c1c('0x3f')][_0x5c1c('0x2e')]({'where':{'$or':[{'role':_0x32161e[_0x5c1c('0x5e')][_0x5c1c('0x60')]==='telephone'?_0x5c1c('0x65'):['admin',_0x5c1c('0x66')]}]}})['then'](function(_0xcc910d){_0x645083=_0xcc910d;return require('../../config/license/util')[_0x5c1c('0x67')]();})[_0x5c1c('0x21')](function(_0x344c61){var _0x696bfc=_0x32161e[_0x5c1c('0x5e')][_0x5c1c('0x60')]===_0x5c1c('0x65')?_0x5c1c('0x68'):'users';if(!_[_0x5c1c('0x69')](_0x344c61[_0x696bfc])&&_0x645083>=_0x344c61[_0x696bfc]){return _0x5c7dca({'message':_0x5c1c('0x6a')});}return _0x4315c8(util[_0x5c1c('0x6b')]('count\x20%s:\x20%s',_0x696bfc,_0x645083));})[_0x5c1c('0x2a')](function(_0x1e9923){return _0x5c7dca(_0x1e9923);});});};exports[_0x5c1c('0x6c')]=function(_0x3d69e9,_0x135f5e){return getLicense(_0x3d69e9)[_0x5c1c('0x21')](function(_0x36cb12){if(!_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x6d')]){var _0x36dc30;return db[_0x5c1c('0x6e')][_0x5c1c('0x6f')](0x1)['then'](function(_0x1d1e85){return checkPasswordPattern(_0x1d1e85,_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x44')],_0x1d1e85[_0x5c1c('0x70')]);})[_0x5c1c('0x21')](function(_0x19251c){_0x36dc30=_0x19251c[_0x5c1c('0x71')];return db['User']['max'](_0x5c1c('0x6d'));})['then'](function(_0x244ffc){if(_[_0x5c1c('0x69')](_0x244ffc)){if(_0x36dc30){_0x3d69e9[_0x5c1c('0x5e')]['internal']=_0x36dc30;}else{_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x6d')]=0x1;}}else{if(_[_0x5c1c('0x69')](_0x36dc30)||_0x36dc30==_0x244ffc){_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x6d')]=_0x244ffc+0x1;}else if(_0x36dc30>_0x244ffc){_0x3d69e9[_0x5c1c('0x5e')]['internal']=_0x36dc30;}else{return db[_0x5c1c('0x52')][_0x5c1c('0x45')](_0x5c1c('0x72'),{'type':db['sequelize'][_0x5c1c('0x73')]['SELECT']})[_0x5c1c('0x21')](function(_0x438660){if(_0x438660&&_0x438660[_0x5c1c('0x5a')]){for(var _0x283149=0x0,_0x1d04f0=_0x438660[_0x5c1c('0x5a')];_0x283149<_0x1d04f0&&_[_0x5c1c('0x69')](_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x6d')]);_0x283149++){if(_0x36dc30<=_0x438660[_0x283149][_0x5c1c('0x74')]){_0x3d69e9[_0x5c1c('0x5e')]['internal']=_0x438660[_0x283149][_0x5c1c('0x74')];}else if(_0x36dc30>_0x438660[_0x283149][_0x5c1c('0x74')]&&_0x36dc30<=_0x438660[_0x283149]['to']){_0x3d69e9['body'][_0x5c1c('0x6d')]=_0x36dc30;}}}if(_[_0x5c1c('0x69')](_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x6d')])){_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x6d')]=_0x244ffc+0x1;}});}}});}})[_0x5c1c('0x21')](function(){if(_0x3d69e9['body'][_0x5c1c('0x75')]){_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x76')]=_0x3d69e9['body']['internal'];_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x77')]={'mailbox':_0x3d69e9[_0x5c1c('0x5e')]['internal'],'password':_0x3d69e9['body'][_0x5c1c('0x44')],'fullname':_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x78')],'email':_0x3d69e9[_0x5c1c('0x5e')]['email']};}if(_0x3d69e9[_0x5c1c('0x5e')]&&_0x3d69e9['body'][_0x5c1c('0x60')]===_0x5c1c('0x64')){if(!_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x79')]){_0x3d69e9[_0x5c1c('0x5e')][_0x5c1c('0x79')]=[_0x5c1c('0x7a'),_0x5c1c('0x7b'),'103',_0x5c1c('0x7c'),_0x5c1c('0x7d'),_0x5c1c('0x7e'),_0x5c1c('0x7f'),'106',_0x5c1c('0x80'),'108',_0x5c1c('0x81'),_0x5c1c('0x82'),_0x5c1c('0x83'),_0x5c1c('0x84')];}}return db[_0x5c1c('0x3f')][_0x5c1c('0x6c')](_0x3d69e9['body'],{'include':[{'model':db[_0x5c1c('0x77')],'as':_0x5c1c('0x77')}]});})['then'](function(_0xeb21bc){if(_0x3d69e9[_0x5c1c('0x5e')]['role']===_0x5c1c('0x66'))return _0xeb21bc;var _0x4980ad=_0x3d69e9[_0x5c1c('0x66')][_0x5c1c('0x85')]({'plain':!![]});if(!_0x4980ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4980ad['role']==='user'){var _0xc40fe5=_0xeb21bc[_0x5c1c('0x85')]({'plain':!![]});var _0x161ea0=[{'name':_0x5c1c('0x33'),'value':_0x5c1c('0x64')},{'name':_0x5c1c('0x34'),'value':'telephone'}];var _0x435aa6=_[_0x5c1c('0x5c')](_0x161ea0,['value',_0xc40fe5[_0x5c1c('0x60')]])[_0x5c1c('0x39')];return db[_0x5c1c('0x86')][_0x5c1c('0x5c')]({'where':{'name':_0x435aa6,'userProfileId':_0x4980ad[_0x5c1c('0x87')]},'raw':!![]})[_0x5c1c('0x21')](function(_0x54cdc3){if(_0x54cdc3&&_0x54cdc3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xc40fe5[_0x5c1c('0x39')],'resourceId':_0xc40fe5['id'],'type':_0x54cdc3[_0x5c1c('0x39')],'sectionId':_0x54cdc3['id']},{})['then'](function(){return _0xeb21bc;});}else{return _0xeb21bc;}})[_0x5c1c('0x2a')](function(_0x37cce7){logger[_0x5c1c('0x26')](_0x5c1c('0x88'),_0x37cce7);throw _0x37cce7;});}return _0xeb21bc;})[_0x5c1c('0x21')](respondWithResult(_0x135f5e,0xc9))[_0x5c1c('0x2a')](handleError(_0x135f5e,null));};exports[_0x5c1c('0x89')]=function(_0x1742ab,_0x1fb16f,_0x299fdd){var _0x1d9eae=![];if(_0x1742ab[_0x5c1c('0x5e')]['id']){delete _0x1742ab[_0x5c1c('0x5e')]['id'];}return db['Setting'][_0x5c1c('0x8a')]({'attributes':['id',_0x5c1c('0x70')]})[_0x5c1c('0x21')](function(_0x1cca84){_0x1d9eae=_0x1cca84[_0x5c1c('0x70')];return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x1742ab[_0x5c1c('0x61')]['id']}});})[_0x5c1c('0x21')](function(_0x3fbe16){if(_0x3fbe16){if(_0x3fbe16['id']==_0x1742ab[_0x5c1c('0x66')]['id']){if(!_0x1742ab[_0x5c1c('0x5e')]['oldPassword']||!_0x1742ab[_0x5c1c('0x5e')][_0x5c1c('0x8b')]){throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0x8d'));}if(!_0x3fbe16[_0x5c1c('0x8e')](_0x1742ab[_0x5c1c('0x5e')][_0x5c1c('0x8f')])){throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0x90'));}if(_0x1742ab['body']['oldPassword']==_0x1742ab[_0x5c1c('0x5e')][_0x5c1c('0x8b')]){throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0x91'));}return _0x3fbe16;}else if(_0x1742ab[_0x5c1c('0x66')][_0x5c1c('0x60')]==_0x5c1c('0x92')){if(!_0x1742ab[_0x5c1c('0x5e')][_0x5c1c('0x8b')]){throw new db[(_0x5c1c('0x1f'))]['ValidationError'](_0x5c1c('0x93'));}return _0x3fbe16;}else if(_0x1742ab[_0x5c1c('0x66')][_0x5c1c('0x60')]==_0x5c1c('0x66')){if(!_0x1742ab['body'][_0x5c1c('0x8b')]){throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0x93'));}if(_0x3fbe16[_0x5c1c('0x60')]!=_0x5c1c('0x64')){throw new db['Sequelize']['ValidationError'](_0x5c1c('0x94'));}return _0x3fbe16;}else{throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0x94'));}}return null;})[_0x5c1c('0x21')](handleEntityNotFound(_0x1fb16f,null))[_0x5c1c('0x21')](function(_0x52ed90){return checkPasswordPattern(_0x52ed90,_0x1742ab[_0x5c1c('0x5e')]['newPassword'],_0x1d9eae);})[_0x5c1c('0x21')](saveUpdates({'password':_0x1742ab['body'][_0x5c1c('0x8b')],'passwordResetAt':_0x1742ab[_0x5c1c('0x66')]['id']==_0x1742ab[_0x5c1c('0x61')]['id']?moment():null},null))[_0x5c1c('0x21')](respondWithResult(_0x1fb16f,null))[_0x5c1c('0x2a')](handleError(_0x1fb16f,null));};exports[_0x5c1c('0x95')]=function(_0x6d519c,_0x35d119,_0x19c4a2){var _0x8d37c1=_0x6d519c[_0x5c1c('0x5e')][_0x5c1c('0x96')];return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x6d519c[_0x5c1c('0x61')]['id']},'attributes':['id',_0x5c1c('0x39'),_0x5c1c('0x60'),'online',_0x5c1c('0x97'),_0x5c1c('0x98'),_0x5c1c('0x99')]})['then'](handleEntityNotFound(_0x35d119,null))[_0x5c1c('0x21')](function(_0x35472d){if(_0x35472d){if(!utils[_0x5c1c('0x9a')](_0x8d37c1)){throw new db['Sequelize'][(_0x5c1c('0x8c'))](_0x5c1c('0x9b'));}return _0x35472d[_0x5c1c('0x9c')+_['capitalize'](_0x8d37c1[_0x5c1c('0x9d')]())+_0x5c1c('0x9e')](_0x6d519c[_0x5c1c('0x5e')][_0x5c1c('0x63')],{'penalty':_0x6d519c[_0x5c1c('0x5e')][_0x5c1c('0x9f')]||0x0})['spread'](function(_0x5bf731){for(var _0x3a0d2f=0x0;_0x3a0d2f<_0x6d519c[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x3a0d2f+=0x1){var _0x4138dc={'UserId':_0x6d519c[_0x5c1c('0x61')]['id']};_0x4138dc[_[_0x5c1c('0xa0')](_0x8d37c1[_0x5c1c('0x9d')]())+_0x5c1c('0xa1')]=_0x6d519c[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x3a0d2f];socket['emit']('user'+_[_0x5c1c('0xa0')](_0x8d37c1['toLowerCase']())+_0x5c1c('0xa2'),_0x4138dc);}return _0x5bf731;})[_0x5c1c('0x21')](function(){if(_0x8d37c1===_0x5c1c('0xa3')){return db[_0x5c1c('0xa4')][_0x5c1c('0xa5')]({'where':{'id':_0x6d519c[_0x5c1c('0x5e')]['ids']||[]},'raw':!![],'attributes':['id',_0x5c1c('0x39')]});}})['then'](function(_0x114951){var _0x432245=_0x35472d['get']({'plain':!![]});var _0x167423=[];if(_0x8d37c1===_0x5c1c('0xa3')&&_0x432245[_0x5c1c('0x60')]===_0x5c1c('0x64')&&_0x432245['online']){for(var _0x4ecab5=0x0;_0x4ecab5<_0x114951['length'];_0x4ecab5+=0x1){_0x167423[_0x5c1c('0xa6')]({'membername':_0x432245['name'],'UserId':_0x432245['id'],'queue_name':_0x114951[_0x4ecab5][_0x5c1c('0x39')],'VoiceQueueId':_0x114951[_0x4ecab5]['id'],'interface':_['isNil'](_0x432245[_0x5c1c('0x99')])?util[_0x5c1c('0x6b')](_0x5c1c('0xa7'),_0x432245[_0x5c1c('0x39')]):_0x432245[_0x5c1c('0x99')],'paused':_0x432245[_0x5c1c('0x98')]||![],'penalty':_0x6d519c['body']['penalty']||0x0});}return BPromise[_0x5c1c('0xa8')](_0x167423,function(_0x1fb909){return db[_0x5c1c('0xa9')][_0x5c1c('0xaa')](_0x1fb909);});}return _0x35472d;});}})[_0x5c1c('0x21')](respondWithStatusCode(_0x35d119,null))[_0x5c1c('0x2a')](handleError(_0x35d119,null));};exports[_0x5c1c('0xab')]=function(_0x3af0e1,_0x46cb8c,_0x3bab42){var _0x41da88;return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x3af0e1[_0x5c1c('0x61')]['id']},'attributes':['id',_0x5c1c('0x39'),_0x5c1c('0x60')]})[_0x5c1c('0x21')](handleEntityNotFound(_0x46cb8c,null))[_0x5c1c('0x21')](function(_0x5d7135){if(_0x5d7135){_0x41da88=_0x5d7135;if(!_0x3af0e1[_0x5c1c('0x45')][_0x5c1c('0x96')]||!utils[_0x5c1c('0x9a')](_0x3af0e1['query']['channel'])){throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0x9b'));}return _0x5d7135[_0x5c1c('0xac')+_['capitalize'](_0x3af0e1[_0x5c1c('0x45')][_0x5c1c('0x96')][_0x5c1c('0x9d')]())+_0x5c1c('0x9e')](_0x3af0e1[_0x5c1c('0x45')][_0x5c1c('0x63')]);}})[_0x5c1c('0x21')](function(_0x4f314a){for(var _0x5ec237=0x0;_0x5ec237<_0x3af0e1[_0x5c1c('0x45')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x5ec237+=0x1){var _0x141f1c={'UserId':_0x3af0e1[_0x5c1c('0x61')]['id']};_0x141f1c[_[_0x5c1c('0xa0')](_0x3af0e1[_0x5c1c('0x45')]['channel'][_0x5c1c('0x9d')]())+_0x5c1c('0xa1')]=_0x3af0e1[_0x5c1c('0x45')][_0x5c1c('0x63')][_0x5ec237];socket[_0x5c1c('0xad')](_0x5c1c('0x66')+_[_0x5c1c('0xa0')](_0x3af0e1['query'][_0x5c1c('0x96')]['toLowerCase']())+_0x5c1c('0xae'),_0x141f1c);}return _0x4f314a;})[_0x5c1c('0x21')](function(){if(_0x3af0e1[_0x5c1c('0x45')][_0x5c1c('0x96')]===_0x5c1c('0xa3')){return db[_0x5c1c('0xa9')][_0x5c1c('0x31')]({'where':{'UserId':_0x3af0e1[_0x5c1c('0x61')]['id'],'VoiceQueueId':_0x3af0e1[_0x5c1c('0x45')][_0x5c1c('0x63')]},'individualHooks':!![]})[_0x5c1c('0x21')](function(){return _0x41da88;});}return _0x41da88;})[_0x5c1c('0x21')](respondWithStatusCode(_0x46cb8c,null))['catch'](handleError(_0x46cb8c,null));};exports[_0x5c1c('0xaf')]=function(_0x3dd88f,_0x4d994f,_0x31323b){_0x3dd88f[_0x5c1c('0x5e')][_0x5c1c('0xb0')]=_0x3dd88f[_0x5c1c('0xb1')][_0x5c1c('0xb2')];return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x3dd88f[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x4d994f,null))[_0x5c1c('0x21')](saveUpdates(_0x3dd88f[_0x5c1c('0x5e')],null))[_0x5c1c('0x21')](respondWithResult(_0x4d994f,null))[_0x5c1c('0x2a')](handleError(_0x4d994f,null));};exports[_0x5c1c('0xb3')]=function(_0x546ac5,_0x5d4187,_0x257447){var _0x393528=path['join'](config['root'],_0x5c1c('0xb4'));return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x546ac5['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x5d4187,null))['then'](function(_0x11b8b7){if(_0x11b8b7){if(_[_0x5c1c('0x69')](_0x11b8b7['userpic'])){return _0x5d4187[_0x5c1c('0xb5')](_0x393528);}else{if(!fs[_0x5c1c('0xb6')](path['join'](config[_0x5c1c('0xb7')],_0x5c1c('0xb8'),_0x11b8b7[_0x5c1c('0xb0')]))){return _0x5d4187['download'](_0x393528);}return _0x5d4187['download'](path[_0x5c1c('0xb9')](config[_0x5c1c('0xb7')],'server/files/images/',_0x11b8b7[_0x5c1c('0xb0')]));}}})[_0x5c1c('0x2a')](handleError(_0x5d4187,null));};exports[_0x5c1c('0xba')]=function(_0x446a12,_0x14fad3,_0x2af566){var _0x30798a={};var _0x5c25a9={};var _0x18f6e4;var _0x253456;return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x446a12[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x14fad3,null))[_0x5c1c('0x21')](function(_0x1f9539){if(_0x1f9539){_0x18f6e4=_0x1f9539;_0x5c25a9[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db[_0x5c1c('0xbb')][_0x5c1c('0x40')]);_0x5c25a9[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x446a12[_0x5c1c('0x45')]);_0x5c25a9['filters']=_[_0x5c1c('0x47')](_0x5c25a9['model'],_0x5c25a9['query']);_0x30798a[_0x5c1c('0x48')]=_['intersection'](_0x5c25a9[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x446a12[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x30798a[_0x5c1c('0x48')]=_0x30798a[_0x5c1c('0x48')]['length']?_0x30798a[_0x5c1c('0x48')]:_0x5c25a9[_0x5c1c('0x43')];_0x30798a['order']=qs[_0x5c1c('0x4d')](_0x446a12['query'][_0x5c1c('0x4d')]);_0x30798a[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x446a12[_0x5c1c('0x45')],_0x5c25a9[_0x5c1c('0x4f')]));if(_0x446a12[_0x5c1c('0x45')]['filter']){_0x30798a[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x30798a[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x30798a['attributes'],function(_0x3209be){var _0x22a5a9={};_0x22a5a9[_0x3209be]={'$like':'%'+_0x446a12[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x22a5a9;})});}_0x30798a=_['merge']({},_0x30798a,_0x446a12[_0x5c1c('0x5b')]);return _0x18f6e4[_0x5c1c('0xba')](_0x30798a);}})[_0x5c1c('0x21')](function(_0x2c18a9){if(_0x2c18a9){_0x253456=_0x2c18a9[_0x5c1c('0x5a')];if(_0x446a12[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0x55'))){_0x30798a[_0x5c1c('0x56')]=[{'model':db[_0x5c1c('0xbf')],'as':_0x5c1c('0xc0'),'required':![]},{'model':db[_0x5c1c('0xc1')],'as':_0x5c1c('0xc2'),'attributes':['id','name',_0x5c1c('0xc3')],'where':_0x446a12[_0x5c1c('0x45')][_0x5c1c('0xc4')]?{'id':_0x446a12[_0x5c1c('0x45')]['tag']}:undefined,'required':_0x446a12[_0x5c1c('0x45')]['tag']?!![]:![]}];}if(!_0x446a12[_0x5c1c('0x45')]['hasOwnProperty'](_0x5c1c('0xc5'))){_0x30798a[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x446a12[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x30798a[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x446a12[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x18f6e4[_0x5c1c('0xba')](_0x30798a);}})[_0x5c1c('0x21')](function(_0x1acb2d){if(_0x1acb2d){return _0x1acb2d?{'count':_0x253456,'rows':_0x1acb2d}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x14fad3,null))[_0x5c1c('0x2a')](handleError(_0x14fad3,null));};exports[_0x5c1c('0xc6')]=function(_0x24ed5e,_0x2f2a30,_0x4ea567){var _0x4b814c;var _0x4f0e70;var _0x5e23c6={};var _0xf2aa5a;return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x24ed5e[_0x5c1c('0x61')]['id']},'attributes':['id','name',_0x5c1c('0x60')]})['then'](handleEntityNotFound(_0x2f2a30,null))[_0x5c1c('0x21')](function(_0x14338e){if(!utils[_0x5c1c('0x9a')](_0x24ed5e[_0x5c1c('0x45')][_0x5c1c('0x96')])){throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0x9b'));}_0x4b814c=_0x14338e;var _0x265c12={};_0x265c12[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db[_['capitalize'](_0x24ed5e[_0x5c1c('0x45')][_0x5c1c('0x96')])+'Queue'][_0x5c1c('0x40')]);_0x265c12[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x24ed5e[_0x5c1c('0x45')]);_0x265c12[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x265c12[_0x5c1c('0x43')],_0x265c12[_0x5c1c('0x45')]);_0x5e23c6[_0x5c1c('0x48')]=_['intersection'](_0x265c12[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x24ed5e[_0x5c1c('0x45')]['fields']));_0x5e23c6['attributes']=_0x5e23c6[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x5e23c6[_0x5c1c('0x48')]:_0x265c12[_0x5c1c('0x43')];_0x5e23c6[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x24ed5e[_0x5c1c('0x45')]['sort']);_0x5e23c6[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x24ed5e[_0x5c1c('0x45')],_0x265c12[_0x5c1c('0x4f')]));if(_0x24ed5e[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x5e23c6[_0x5c1c('0x4e')]=_['merge'](_0x5e23c6[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x5e23c6[_0x5c1c('0x48')],function(_0x2723e0){var _0x339428={};_0x339428[_0x2723e0]={'$like':'%'+_0x24ed5e[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x339428;})});}_0x5e23c6=_[_0x5c1c('0x50')]({},_0x5e23c6,_0x24ed5e[_0x5c1c('0x5b')]);switch(_0x4b814c[_0x5c1c('0x60')]){case _0x5c1c('0x92'):return db[_[_0x5c1c('0xa0')](_0x24ed5e[_0x5c1c('0x45')]['channel'])+'Queue'][_0x5c1c('0xa5')](_0x5e23c6);case _0x5c1c('0x66'):case _0x5c1c('0x64'):return _0x4b814c[_0x5c1c('0x85')+_['capitalize'](_0x24ed5e['query'][_0x5c1c('0x96')])+_0x5c1c('0x9e')](_0x5e23c6);default:throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0xc7'));}})[_0x5c1c('0x21')](function(_0x185b9e){_0xf2aa5a=_0x185b9e['length'];if(!_0x24ed5e['query'][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x5e23c6[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x24ed5e[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x5e23c6['offset']=qs[_0x5c1c('0x4b')](_0x24ed5e[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}switch(_0x4b814c['role']){case _0x5c1c('0x92'):return db[_[_0x5c1c('0xa0')](_0x24ed5e[_0x5c1c('0x45')][_0x5c1c('0x96')])+_0x5c1c('0xc8')][_0x5c1c('0xa5')](_0x5e23c6);case _0x5c1c('0x66'):case _0x5c1c('0x64'):return _0x4b814c[_0x5c1c('0x85')+_[_0x5c1c('0xa0')](_0x24ed5e[_0x5c1c('0x45')]['channel'])+_0x5c1c('0x9e')](_0x5e23c6);}})['then'](function(_0x37a668){return{'count':_0xf2aa5a,'rows':_0x37a668};})['then'](respondWithResult(_0x2f2a30,null))[_0x5c1c('0x2a')](handleError(_0x2f2a30,null));};exports[_0x5c1c('0xc9')]=function(_0x2a6002,_0xeac5e3,_0xba8fa1){var _0x225973={};var _0x249e9e={};var _0x1cef21;var _0xcb17c;return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x2a6002['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0xeac5e3,null))[_0x5c1c('0x21')](function(_0x38bc9b){if(_0x38bc9b){_0x1cef21=_0x38bc9b;_0x249e9e[_0x5c1c('0x43')]=_['keys'](db['UserVoiceQueueRt'][_0x5c1c('0x40')]);_0x249e9e[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x2a6002[_0x5c1c('0x45')]);_0x249e9e['filters']=_[_0x5c1c('0x47')](_0x249e9e[_0x5c1c('0x43')],_0x249e9e[_0x5c1c('0x45')]);_0x225973[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x249e9e['model'],qs[_0x5c1c('0x49')](_0x2a6002[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x225973['attributes']=_0x225973[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x225973[_0x5c1c('0x48')]:_0x249e9e[_0x5c1c('0x43')];_0x225973[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x2a6002[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x225973[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x2a6002[_0x5c1c('0x45')],_0x249e9e[_0x5c1c('0x4f')]));if(_0x2a6002[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x225973[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x225973['where'],{'$or':_[_0x5c1c('0xbd')](_0x225973['attributes'],function(_0x8c9fd6){var _0x43c9cd={};_0x43c9cd[_0x8c9fd6]={'$like':'%'+_0x2a6002[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x43c9cd;})});}_0x225973=_[_0x5c1c('0x50')]({},_0x225973,_0x2a6002[_0x5c1c('0x5b')]);return _0x1cef21[_0x5c1c('0xc9')](_0x225973);}})[_0x5c1c('0x21')](function(_0x493c1e){if(_0x493c1e){_0xcb17c=_0x493c1e['length'];if(!_0x2a6002['query'][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x225973[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x2a6002[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x225973[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x2a6002[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x1cef21['getVoiceQueuesRt'](_0x225973);}})[_0x5c1c('0x21')](function(_0x4a468e){if(_0x4a468e){return _0x4a468e?{'count':_0xcb17c,'rows':_0x4a468e}:null;}})[_0x5c1c('0x21')](respondWithResult(_0xeac5e3,null))[_0x5c1c('0x2a')](handleError(_0xeac5e3,null));};exports[_0x5c1c('0xca')]=function(_0x1d5fd8,_0x4ee47c,_0x1cc0c6){var _0x4194b7={};var _0x50390b={};var _0x34da24;var _0x4d327a;return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x1d5fd8[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x4ee47c,null))[_0x5c1c('0x21')](function(_0x1c2ae0){if(_0x1c2ae0){_0x34da24=_0x1c2ae0;_0x50390b[_0x5c1c('0x43')]=_['keys'](db[_0x5c1c('0xcb')][_0x5c1c('0x40')]);_0x50390b[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x1d5fd8[_0x5c1c('0x45')]);_0x50390b['filters']=_[_0x5c1c('0x47')](_0x50390b[_0x5c1c('0x43')],_0x50390b['query']);_0x4194b7['attributes']=_[_0x5c1c('0x47')](_0x50390b[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x1d5fd8[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x4194b7['attributes']=_0x4194b7[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x4194b7[_0x5c1c('0x48')]:_0x50390b[_0x5c1c('0x43')];_0x4194b7['order']=qs[_0x5c1c('0x4d')](_0x1d5fd8[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x4194b7['where']=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x1d5fd8[_0x5c1c('0x45')],_0x50390b['filters']));if(_0x1d5fd8[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x4194b7[_0x5c1c('0x4e')]=_['merge'](_0x4194b7[_0x5c1c('0x4e')],{'$or':_['map'](_0x4194b7[_0x5c1c('0x48')],function(_0x2b5b25){var _0x16168f={};_0x16168f[_0x2b5b25]={'$like':'%'+_0x1d5fd8['query'][_0x5c1c('0x35')]+'%'};return _0x16168f;})});}_0x4194b7=_['merge']({},_0x4194b7,_0x1d5fd8['options']);return _0x34da24[_0x5c1c('0xca')](_0x4194b7);}})[_0x5c1c('0x21')](function(_0xc25f2d){if(_0xc25f2d){_0x4d327a=_0xc25f2d['length'];if(!_0x1d5fd8[_0x5c1c('0x45')]['hasOwnProperty'](_0x5c1c('0xc5'))){_0x4194b7[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x1d5fd8[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x4194b7[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x1d5fd8['query'][_0x5c1c('0x4b')]);}return _0x34da24[_0x5c1c('0xca')](_0x4194b7);}})[_0x5c1c('0x21')](function(_0x4610f1){if(_0x4610f1){return _0x4610f1?{'count':_0x4d327a,'rows':_0x4610f1}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x4ee47c,null))[_0x5c1c('0x2a')](handleError(_0x4ee47c,null));};exports['getRecordings']=function(_0x50623c,_0x1f3f90,_0x1a79da){var _0x20eb60={'raw':!![],'where':{}};var _0x5b48a6={};var _0x44a5c0={'count':0x0,'rows':[]};return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x50623c[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x1f3f90,null))[_0x5c1c('0x21')](function(_0x35a308){if(_0x35a308){_0x5b48a6['model']=_[_0x5c1c('0x46')](db[_0x5c1c('0xcc')][_0x5c1c('0x40')]);_0x5b48a6[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x50623c[_0x5c1c('0x45')]);_0x5b48a6[_0x5c1c('0x4f')]=_['intersection'](_0x5b48a6['model'],_0x5b48a6[_0x5c1c('0x45')]);_0x20eb60[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x5b48a6[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x50623c[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x20eb60[_0x5c1c('0x48')]=_0x20eb60[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x20eb60[_0x5c1c('0x48')]:_0x5b48a6['model'];if(!_0x50623c['query']['hasOwnProperty'](_0x5c1c('0xc5'))){_0x20eb60[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x50623c[_0x5c1c('0x45')]['limit']);_0x20eb60['offset']=qs[_0x5c1c('0x4b')](_0x50623c[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}_0x20eb60[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x50623c[_0x5c1c('0x45')]['sort']);_0x20eb60[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x50623c[_0x5c1c('0x45')],_0x5b48a6['filters']));_0x20eb60['where']['UserId']=_0x35a308['id'];if(_0x50623c[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x20eb60[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x20eb60[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x20eb60[_0x5c1c('0x48')],function(_0x2ca377){var _0x5892f6={};_0x5892f6[_0x2ca377]={'$like':'%'+_0x50623c[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x5892f6;})});}_0x20eb60=_[_0x5c1c('0x50')]({},_0x20eb60,_0x50623c[_0x5c1c('0x5b')]);return db['VoiceRecording']['count']({'where':_0x20eb60['where']})[_0x5c1c('0x21')](function(_0x5870f5){_0x44a5c0[_0x5c1c('0x2e')]=_0x5870f5;if(_0x50623c[_0x5c1c('0x45')][_0x5c1c('0x55')]){_0x20eb60[_0x5c1c('0x56')]=[{'all':!![]}];}return db[_0x5c1c('0xcc')]['findAll'](_0x20eb60);})['then'](function(_0x25c6f1){_0x44a5c0[_0x5c1c('0xcd')]=_0x25c6f1;return _0x44a5c0;});}})['then'](respondWithFilteredResult(_0x1f3f90,_0x20eb60))['catch'](handleError(_0x1f3f90,null));};exports[_0x5c1c('0xce')]=function(_0x13aaeb,_0x394bac,_0x212f3){var _0x54875d={'raw':!![],'where':{}};var _0x23f0fc={};var _0x57feca={'count':0x0,'rows':[]};return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x13aaeb[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x394bac,null))['then'](function(_0x1518c7){if(_0x1518c7){_0x23f0fc[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db['ScreenRecording'][_0x5c1c('0x40')]);_0x23f0fc[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x13aaeb[_0x5c1c('0x45')]);_0x23f0fc[_0x5c1c('0x4f')]=_['intersection'](_0x23f0fc[_0x5c1c('0x43')],_0x23f0fc['query']);_0x54875d[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x23f0fc['model'],qs['fields'](_0x13aaeb[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x54875d['attributes']=_0x54875d['attributes']['length']?_0x54875d[_0x5c1c('0x48')]:_0x23f0fc[_0x5c1c('0x43')];if(!_0x13aaeb[_0x5c1c('0x45')]['hasOwnProperty']('nolimit')){_0x54875d['limit']=qs['limit'](_0x13aaeb[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x54875d['offset']=qs[_0x5c1c('0x4b')](_0x13aaeb[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}_0x54875d[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x13aaeb['query'][_0x5c1c('0x4d')]);_0x54875d[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x13aaeb[_0x5c1c('0x45')],_0x23f0fc[_0x5c1c('0x4f')]));_0x54875d['where'][_0x5c1c('0xcf')]=_0x1518c7['id'];if(_0x13aaeb[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x54875d['where']=_[_0x5c1c('0x50')](_0x54875d[_0x5c1c('0x4e')],{'$or':_['map'](_0x54875d['attributes'],function(_0x3f965a){var _0x2a2558={};_0x2a2558[_0x3f965a]={'$like':'%'+_0x13aaeb['query'][_0x5c1c('0x35')]+'%'};return _0x2a2558;})});}_0x54875d=_[_0x5c1c('0x50')]({},_0x54875d,_0x13aaeb['options']);return db[_0x5c1c('0xd0')][_0x5c1c('0x2e')]({'where':_0x54875d[_0x5c1c('0x4e')]})[_0x5c1c('0x21')](function(_0x4e91c9){_0x57feca['count']=_0x4e91c9;if(_0x13aaeb[_0x5c1c('0x45')]['includeAll']){_0x54875d[_0x5c1c('0x56')]=[{'all':!![]}];}return db[_0x5c1c('0xd0')][_0x5c1c('0xa5')](_0x54875d);})['then'](function(_0x285846){_0x57feca[_0x5c1c('0xcd')]=_0x285846;return _0x57feca;});}})[_0x5c1c('0x21')](respondWithFilteredResult(_0x394bac,_0x54875d))[_0x5c1c('0x2a')](handleError(_0x394bac,null));};exports['getChatInteractions']=function(_0x2fb59f,_0x3939f7,_0x5059e7){var _0x45190c={};var _0x5b44a3={};var _0x58ff6a;var _0x20a906;return db[_0x5c1c('0x3f')]['findOne']({'where':{'id':_0x2fb59f[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x3939f7,null))[_0x5c1c('0x21')](function(_0x1efea6){if(_0x1efea6){_0x58ff6a=_0x1efea6;_0x5b44a3[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db[_0x5c1c('0xd1')][_0x5c1c('0x40')]);_0x5b44a3['query']=_['keys'](_0x2fb59f[_0x5c1c('0x45')]);_0x5b44a3[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x5b44a3['model'],_0x5b44a3[_0x5c1c('0x45')]);_0x45190c[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x5b44a3[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x2fb59f['query'][_0x5c1c('0x49')]));_0x45190c[_0x5c1c('0x48')]=_0x45190c['attributes'][_0x5c1c('0x5a')]?_0x45190c['attributes']:_0x5b44a3[_0x5c1c('0x43')];_0x45190c[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x2fb59f[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x45190c[_0x5c1c('0x4e')]=qs['filters'](_[_0x5c1c('0xbc')](_0x2fb59f[_0x5c1c('0x45')],_0x5b44a3['filters']));if(_0x2fb59f[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x45190c[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x45190c['where'],{'$or':_[_0x5c1c('0xbd')](_0x45190c[_0x5c1c('0x48')],function(_0x14b82b){var _0x1f1134={};_0x1f1134[_0x14b82b]={'$like':'%'+_0x2fb59f['query'][_0x5c1c('0x35')]+'%'};return _0x1f1134;})});}_0x45190c=_[_0x5c1c('0x50')]({},_0x45190c,_0x2fb59f[_0x5c1c('0x5b')]);return _0x58ff6a[_0x5c1c('0xd2')](_0x45190c);}})[_0x5c1c('0x21')](function(_0x23fd99){if(_0x23fd99){_0x20a906=_0x23fd99[_0x5c1c('0x5a')];if(!_0x2fb59f['query'][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x45190c[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x2fb59f[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x45190c[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x2fb59f[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x58ff6a[_0x5c1c('0xd2')](_0x45190c);}})[_0x5c1c('0x21')](function(_0x59bf37){if(_0x59bf37){return _0x59bf37?{'count':_0x20a906,'rows':_0x59bf37}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x3939f7,null))['catch'](handleError(_0x3939f7,null));};exports['getOpenchannelInteractions']=function(_0x5163d4,_0x42d3e4,_0x417a0c){var _0x516e24={};var _0x17380d={};var _0x1813e8;var _0x14323e;return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x5163d4[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x42d3e4,null))['then'](function(_0x4e62d8){if(_0x4e62d8){_0x1813e8=_0x4e62d8;_0x17380d['model']=_[_0x5c1c('0x46')](db[_0x5c1c('0xd3')][_0x5c1c('0x40')]);_0x17380d[_0x5c1c('0x45')]=_['keys'](_0x5163d4[_0x5c1c('0x45')]);_0x17380d[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x17380d[_0x5c1c('0x43')],_0x17380d[_0x5c1c('0x45')]);_0x516e24[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x17380d[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x5163d4['query'][_0x5c1c('0x49')]));_0x516e24[_0x5c1c('0x48')]=_0x516e24[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x516e24[_0x5c1c('0x48')]:_0x17380d[_0x5c1c('0x43')];_0x516e24[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x5163d4[_0x5c1c('0x45')]['sort']);_0x516e24[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x5163d4[_0x5c1c('0x45')],_0x17380d['filters']));if(_0x5163d4[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x516e24[_0x5c1c('0x4e')]=_['merge'](_0x516e24[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x516e24['attributes'],function(_0x18d839){var _0x72d2af={};_0x72d2af[_0x18d839]={'$like':'%'+_0x5163d4['query'][_0x5c1c('0x35')]+'%'};return _0x72d2af;})});}_0x516e24=_[_0x5c1c('0x50')]({},_0x516e24,_0x5163d4[_0x5c1c('0x5b')]);return _0x1813e8['getOpenchannelInteractions'](_0x516e24);}})[_0x5c1c('0x21')](function(_0x5947ab){if(_0x5947ab){_0x14323e=_0x5947ab[_0x5c1c('0x5a')];if(!_0x5163d4[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x516e24['limit']=qs[_0x5c1c('0x4a')](_0x5163d4[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x516e24[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x5163d4[_0x5c1c('0x45')]['offset']);}return _0x1813e8[_0x5c1c('0xd4')](_0x516e24);}})[_0x5c1c('0x21')](function(_0x57d75a){if(_0x57d75a){return _0x57d75a?{'count':_0x14323e,'rows':_0x57d75a}:null;}})['then'](respondWithResult(_0x42d3e4,null))['catch'](handleError(_0x42d3e4,null));};exports['getMailInteractions']=function(_0x3e127c,_0x53e875,_0x353961){var _0x323b0e={'raw':!![],'where':{}};var _0x408806={};var _0x53a8ef={'count':0x0,'rows':[]};return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x3e127c['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x53e875,null))[_0x5c1c('0x21')](function(_0x1c4476){if(_0x1c4476){_0x408806['model']=_[_0x5c1c('0x46')](db['MailInteraction']['rawAttributes']);_0x408806[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x3e127c[_0x5c1c('0x45')]);_0x408806[_0x5c1c('0x4f')]=_['intersection'](_0x408806[_0x5c1c('0x43')],_0x408806['query']);_0x323b0e[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x408806[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x3e127c['query'][_0x5c1c('0x49')]));_0x323b0e[_0x5c1c('0x48')]=_0x323b0e[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x323b0e[_0x5c1c('0x48')]:_0x408806[_0x5c1c('0x43')];if(!_0x3e127c[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x323b0e[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x3e127c[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x323b0e['offset']=qs[_0x5c1c('0x4b')](_0x3e127c[_0x5c1c('0x45')]['offset']);}_0x323b0e['order']=qs[_0x5c1c('0x4d')](_0x3e127c[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x323b0e[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x3e127c[_0x5c1c('0x45')],_0x408806[_0x5c1c('0x4f')]));_0x323b0e['where'][_0x5c1c('0xcf')]=_0x1c4476['id'];if(_0x3e127c[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x323b0e['where']=_['merge'](_0x323b0e[_0x5c1c('0x4e')],{'$or':_['map'](_0x323b0e[_0x5c1c('0x48')],function(_0x475df7){var _0x39edfe={};_0x39edfe[_0x475df7]={'$like':'%'+_0x3e127c[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x39edfe;})});}_0x323b0e=_[_0x5c1c('0x50')]({},_0x323b0e,_0x3e127c[_0x5c1c('0x5b')]);return db[_0x5c1c('0xd5')]['count']({'where':_0x323b0e[_0x5c1c('0x4e')]})[_0x5c1c('0x21')](function(_0x257379){_0x53a8ef[_0x5c1c('0x2e')]=_0x257379;if(_0x3e127c[_0x5c1c('0x45')][_0x5c1c('0x55')]){_0x323b0e['include']=[{'all':!![]}];}return db[_0x5c1c('0xd5')][_0x5c1c('0xa5')](_0x323b0e);})['then'](function(_0x7ff609){_0x53a8ef[_0x5c1c('0xcd')]=_0x7ff609;return _0x53a8ef;});}})[_0x5c1c('0x21')](respondWithFilteredResult(_0x53e875,_0x323b0e))['catch'](handleError(_0x53e875,null));};exports[_0x5c1c('0xd6')]=function(_0x27062b,_0x5707d9,_0x19b706){var _0x3cbc97={};var _0x517f36={};var _0x1134ec;var _0xdfeeb6;return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x27062b[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x5707d9,null))[_0x5c1c('0x21')](function(_0x27d944){if(_0x27d944){_0x1134ec=_0x27d944;_0x517f36[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db['SmsInteraction'][_0x5c1c('0x40')]);_0x517f36[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x27062b[_0x5c1c('0x45')]);_0x517f36[_0x5c1c('0x4f')]=_['intersection'](_0x517f36[_0x5c1c('0x43')],_0x517f36['query']);_0x3cbc97[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x517f36[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x27062b['query']['fields']));_0x3cbc97['attributes']=_0x3cbc97['attributes'][_0x5c1c('0x5a')]?_0x3cbc97[_0x5c1c('0x48')]:_0x517f36['model'];_0x3cbc97[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x27062b[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x3cbc97[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x27062b[_0x5c1c('0x45')],_0x517f36[_0x5c1c('0x4f')]));if(_0x27062b[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x3cbc97[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x3cbc97[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x3cbc97['attributes'],function(_0x1429b6){var _0x38b9e5={};_0x38b9e5[_0x1429b6]={'$like':'%'+_0x27062b[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x38b9e5;})});}_0x3cbc97=_[_0x5c1c('0x50')]({},_0x3cbc97,_0x27062b[_0x5c1c('0x5b')]);return _0x1134ec[_0x5c1c('0xd6')](_0x3cbc97);}})[_0x5c1c('0x21')](function(_0x4955ad){if(_0x4955ad){_0xdfeeb6=_0x4955ad['length'];if(!_0x27062b[_0x5c1c('0x45')]['hasOwnProperty'](_0x5c1c('0xc5'))){_0x3cbc97[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x27062b[_0x5c1c('0x45')]['limit']);_0x3cbc97[_0x5c1c('0x4b')]=qs['offset'](_0x27062b[_0x5c1c('0x45')]['offset']);}return _0x1134ec[_0x5c1c('0xd6')](_0x3cbc97);}})['then'](function(_0x5c3b40){if(_0x5c3b40){return _0x5c3b40?{'count':_0xdfeeb6,'rows':_0x5c3b40}:null;}})['then'](respondWithResult(_0x5707d9,null))[_0x5c1c('0x2a')](handleError(_0x5707d9,null));};exports['getFaxInteractions']=function(_0x42991c,_0x35a348,_0x3503c0){var _0x4aeb11={};var _0x131ba5={};var _0x9cd692;var _0x1c7ee6;return db[_0x5c1c('0x3f')]['findOne']({'where':{'id':_0x42991c['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x35a348,null))[_0x5c1c('0x21')](function(_0x279fe5){if(_0x279fe5){_0x9cd692=_0x279fe5;_0x131ba5['model']=_[_0x5c1c('0x46')](db['FaxInteraction']['rawAttributes']);_0x131ba5[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x42991c[_0x5c1c('0x45')]);_0x131ba5[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x131ba5[_0x5c1c('0x43')],_0x131ba5[_0x5c1c('0x45')]);_0x4aeb11[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x131ba5[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x42991c['query']['fields']));_0x4aeb11[_0x5c1c('0x48')]=_0x4aeb11[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x4aeb11[_0x5c1c('0x48')]:_0x131ba5[_0x5c1c('0x43')];_0x4aeb11[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x42991c[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x4aeb11[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_['pick'](_0x42991c[_0x5c1c('0x45')],_0x131ba5[_0x5c1c('0x4f')]));if(_0x42991c['query'][_0x5c1c('0x35')]){_0x4aeb11['where']=_[_0x5c1c('0x50')](_0x4aeb11[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x4aeb11[_0x5c1c('0x48')],function(_0x1b8c0a){var _0x3a7e56={};_0x3a7e56[_0x1b8c0a]={'$like':'%'+_0x42991c[_0x5c1c('0x45')]['filter']+'%'};return _0x3a7e56;})});}_0x4aeb11=_[_0x5c1c('0x50')]({},_0x4aeb11,_0x42991c[_0x5c1c('0x5b')]);return _0x9cd692[_0x5c1c('0xd7')](_0x4aeb11);}})[_0x5c1c('0x21')](function(_0x1d9fd0){if(_0x1d9fd0){_0x1c7ee6=_0x1d9fd0[_0x5c1c('0x5a')];if(!_0x42991c[_0x5c1c('0x45')][_0x5c1c('0xbe')]('nolimit')){_0x4aeb11[_0x5c1c('0x4a')]=qs['limit'](_0x42991c[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x4aeb11[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x42991c[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x9cd692[_0x5c1c('0xd7')](_0x4aeb11);}})[_0x5c1c('0x21')](function(_0x200964){if(_0x200964){return _0x200964?{'count':_0x1c7ee6,'rows':_0x200964}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x35a348,null))[_0x5c1c('0x2a')](handleError(_0x35a348,null));};exports[_0x5c1c('0xd8')]=function(_0x19fb29,_0x12d933,_0x27a729){var _0x1c7217={};var _0x47e0f1={};var _0x387d77;var _0x3ee392;return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x19fb29[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x12d933,null))[_0x5c1c('0x21')](function(_0x495f66){if(_0x495f66){_0x387d77=_0x495f66;_0x47e0f1['model']=_[_0x5c1c('0x46')](db[_0x5c1c('0xd9')][_0x5c1c('0x40')]);_0x47e0f1['query']=_[_0x5c1c('0x46')](_0x19fb29[_0x5c1c('0x45')]);_0x47e0f1[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x47e0f1[_0x5c1c('0x43')],_0x47e0f1[_0x5c1c('0x45')]);_0x1c7217[_0x5c1c('0x48')]=_['intersection'](_0x47e0f1[_0x5c1c('0x43')],qs['fields'](_0x19fb29[_0x5c1c('0x45')]['fields']));_0x1c7217['attributes']=_0x1c7217[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x1c7217[_0x5c1c('0x48')]:_0x47e0f1[_0x5c1c('0x43')];_0x1c7217[_0x5c1c('0x4c')]=qs['sort'](_0x19fb29[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x1c7217[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_['pick'](_0x19fb29[_0x5c1c('0x45')],_0x47e0f1[_0x5c1c('0x4f')]));if(_0x19fb29[_0x5c1c('0x45')]['filter']){_0x1c7217['where']=_[_0x5c1c('0x50')](_0x1c7217[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x1c7217[_0x5c1c('0x48')],function(_0x14cbf5){var _0x2cea0e={};_0x2cea0e[_0x14cbf5]={'$like':'%'+_0x19fb29[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x2cea0e;})});}_0x1c7217=_[_0x5c1c('0x50')]({},_0x1c7217,_0x19fb29[_0x5c1c('0x5b')]);return _0x387d77['getWhatsappInteractions'](_0x1c7217);}})[_0x5c1c('0x21')](function(_0x40e130){if(_0x40e130){_0x3ee392=_0x40e130[_0x5c1c('0x5a')];if(!_0x19fb29[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x1c7217[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x19fb29['query']['limit']);_0x1c7217[_0x5c1c('0x4b')]=qs['offset'](_0x19fb29[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x387d77['getWhatsappInteractions'](_0x1c7217);}})['then'](function(_0x18a4c5){if(_0x18a4c5){return _0x18a4c5?{'count':_0x3ee392,'rows':_0x18a4c5}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x12d933,null))[_0x5c1c('0x2a')](handleError(_0x12d933,null));};exports[_0x5c1c('0xda')]=function(_0x3b3f84,_0x45cba9,_0x4834de){var _0x3e6342;var _0x543254;var _0x2b4a31;var _0x14e581=!_[_0x5c1c('0x69')](_0x3b3f84[_0x5c1c('0x61')]['id'])?_0x3b3f84[_0x5c1c('0x61')]['id']:!_['isNil'](_0x3b3f84[_0x5c1c('0x66')]['id'])?_0x3b3f84[_0x5c1c('0x66')]['id']:null;return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x14e581,'role':{'$or':['admin','user','agent']}},'attributes':['id',_0x5c1c('0x39'),_0x5c1c('0xdb'),'mobile',_0x5c1c('0x60'),'internal',_0x5c1c('0x97')]})[_0x5c1c('0x21')](function(_0x2cb63d){if(_0x2cb63d){if(_0x2cb63d[_0x5c1c('0x60')]===_0x5c1c('0x64')){_0x3e6342=_0x2cb63d;if(_0x3b3f84[_0x5c1c('0x5e')][_0x5c1c('0x99')]){_0x2b4a31=util[_0x5c1c('0x6b')](_0x5c1c('0xdc'),_0x3e6342[_0x3b3f84[_0x5c1c('0x5e')]['interface']]);}else if(_0x3b3f84['body']['intrf']){_0x2b4a31=util['format'](_0x5c1c('0xa7'),_0x3b3f84[_0x5c1c('0x5e')][_0x5c1c('0xdd')]);}else{_0x2b4a31=util[_0x5c1c('0x6b')](_0x5c1c('0xa7'),_0x3e6342[_0x5c1c('0x39')]);}socket['to'](util[_0x5c1c('0x6b')](_0x5c1c('0xde'),_0x3e6342['name']))['emit'](_0x5c1c('0xdf'),{'ip':_0x3b3f84[_0x5c1c('0xe0')][_0x5c1c('0xe1')]||_0x3b3f84['connection'][_0x5c1c('0xe2')]||_0x3b3f84['socket']['remoteAddress']||_0x3b3f84['connection'][_0x5c1c('0xe3')][_0x5c1c('0xe2')]});return db[_0x5c1c('0xa9')]['destroy']({'where':{'membername':_0x3e6342['name']},'individualHooks':!![]});}}else{throw new db[(_0x5c1c('0x1f'))][(_0x5c1c('0x8c'))](_0x5c1c('0xe4'));}})[_0x5c1c('0x21')](function(){if(_0x3e6342){return _0x3e6342[_0x5c1c('0xe5')]({'raw':!![]});}})[_0x5c1c('0x21')](function(_0x25cdeb){if(_0x3e6342){var _0x3d3b1=[];if(_0x25cdeb){_0x543254=_0x25cdeb;if(_0x543254[_0x5c1c('0x5a')]){for(var _0xfe572e=0x0;_0xfe572e<_0x543254['length'];_0xfe572e++){_0x3d3b1[_0x5c1c('0xa6')]({'membername':_0x3e6342['name'],'UserId':_0x3e6342['id'],'queue_name':_0x543254[_0xfe572e][_0x5c1c('0x39')],'VoiceQueueId':_0x543254[_0xfe572e]['id'],'interface':_0x2b4a31,'paused':_0x3e6342['loginInPause']||![],'penalty':_0x543254[_0xfe572e][_0x5c1c('0xe6')]||0x0});}return BPromise[_0x5c1c('0xa8')](_0x3d3b1,function(_0x248adb){return db[_0x5c1c('0xa9')]['upsert'](_0x248adb);});}}}})[_0x5c1c('0x21')](function(){if(_0x3e6342){return db[_0x5c1c('0xe7')][_0x5c1c('0xa5')]({'where':{'membername':_0x3e6342['name'],'exitAt':null}});}})[_0x5c1c('0x21')](function(_0x4e0c56){if(_0x3e6342){var _0x42bcc8=[];_0x4e0c56[_0x5c1c('0xe8')](function(_0x570369){_0x42bcc8[_0x5c1c('0xa6')](_0x570369[_0x5c1c('0x5f')]({'exitAt':moment()[_0x5c1c('0x6b')](_0x5c1c('0xe9'))}));});return BPromise[_0x5c1c('0xea')](_0x42bcc8);}})[_0x5c1c('0x21')](function(){if(_0x3e6342){var _0x390506=[];var _0xefc61c=[];var _0x6da88a=utils[_0x5c1c('0xeb')]();var _0x57eb33={'membername':_0x3e6342[_0x5c1c('0x39')],'interface':_0x2b4a31,'enterAt':moment()[_0x5c1c('0x6b')](_0x5c1c('0xe9')),'role':_0x3e6342[_0x5c1c('0x60')],'internal':_0x3e6342[_0x5c1c('0x6d')]};_0x6da88a[_0x5c1c('0xe8')](function(_0x34200c){_0x390506[_0x5c1c('0xa6')](_[_0x5c1c('0x50')]({'channel':_0x34200c,'type':_0x5c1c('0xec'),'data1':_0x3b3f84[_0x5c1c('0x5e')][_0x5c1c('0xed')],'data2':_0x2b4a31},_0x57eb33));if(_0x3e6342['loginInPause']){_0xefc61c[_0x5c1c('0xa6')](_['merge']({'channel':_0x34200c,'type':_0x5c1c('0xee'),'data1':_0x5c1c('0xef')},_0x57eb33));}});return db[_0x5c1c('0xe7')]['bulkCreate'](_0x390506[_0x5c1c('0xf0')](_0xefc61c),{'individualHooks':!![]});}})['then'](function(){if(_0x3e6342){return _0x3e6342['update']({'online':!![],'lastLoginAt':moment()[_0x5c1c('0x6b')](_0x5c1c('0xe9')),'voicePause':_0x3e6342['loginInPause']||![],'mailPause':_0x3e6342[_0x5c1c('0x97')]||![],'chatPause':_0x3e6342['loginInPause']||![],'faxPause':_0x3e6342['loginInPause']||![],'smsPause':_0x3e6342[_0x5c1c('0x97')]||![],'openchannelPause':_0x3e6342[_0x5c1c('0x97')]||![],'whatsappPause':_0x3e6342[_0x5c1c('0x97')]||![],'pauseType':_0x3e6342[_0x5c1c('0x97')]?_0x5c1c('0xef'):null,'interface':_0x2b4a31,'lastPauseAt':moment()['format'](_0x5c1c('0xe9'))});}})[_0x5c1c('0x21')](function(_0x30acb3){if(_0x3b3f84[_0x5c1c('0xf1')]){return _0x4834de();}else{return BPromise[_0x5c1c('0xf2')](_0x30acb3)[_0x5c1c('0x21')](respondWithResult(_0x45cba9,null));}})[_0x5c1c('0x2a')](handleError(_0x45cba9,null));};exports[_0x5c1c('0xf3')]=function(_0x2c2439,_0x31f5b9,_0x3a8613){var _0x1f60bb;return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x2c2439[_0x5c1c('0x61')]['id'],'role':_0x5c1c('0x64')},'attributes':['id',_0x5c1c('0x39'),_0x5c1c('0x60')]})[_0x5c1c('0x21')](handleEntityNotFound(_0x31f5b9,null))[_0x5c1c('0x21')](function(_0x262ce9){if(_0x262ce9){_0x1f60bb=_0x262ce9;return db['UserVoiceQueueRt'][_0x5c1c('0x31')]({'where':{'membername':_0x1f60bb[_0x5c1c('0x39')]},'individualHooks':!![]});}})[_0x5c1c('0x21')](function(){return db[_0x5c1c('0xe7')][_0x5c1c('0xa5')]({'where':{'membername':_0x1f60bb[_0x5c1c('0x39')],'exitAt':null}});})[_0x5c1c('0x21')](function(_0x3dc36f){var _0x224cc6=[];_0x3dc36f[_0x5c1c('0xe8')](function(_0x5532d0){_0x224cc6[_0x5c1c('0xa6')](_0x5532d0[_0x5c1c('0x5f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x5c1c('0xea')](_0x224cc6);})[_0x5c1c('0x21')](function(){return _0x1f60bb[_0x5c1c('0x5f')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x31f5b9,null))['catch'](handleError(_0x31f5b9,null));};exports[_0x5c1c('0xf4')]=function(_0x347647,_0x248651,_0x1372ff){var _0x1c5a8f;return db[_0x5c1c('0xa9')][_0x5c1c('0x5f')]({'paused':0x1},{'where':{'UserId':_0x347647[_0x5c1c('0x61')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x347647['params']['id'],'role':'agent'},'attributes':['id',_0x5c1c('0x39'),_0x5c1c('0x60'),_0x5c1c('0x6d'),_0x5c1c('0x99')]});})[_0x5c1c('0x21')](handleEntityNotFound(_0x248651,null))['then'](function(_0x718f00){if(_0x718f00){_0x1c5a8f=_0x718f00;return respondWithRpcPromise(_0x5c1c('0xf5'),'pause',{'id':_0x1c5a8f['id'],'name':_0x1c5a8f[_0x5c1c('0x39')],'pause':!![]});}})['then'](function(){if(_0x1c5a8f){return db['MemberReport'][_0x5c1c('0xa5')]({'where':{'membername':_0x1c5a8f[_0x5c1c('0x39')],'type':_0x5c1c('0xee'),'exitAt':null}});}})[_0x5c1c('0x21')](function(_0x5905f4){if(_0x5905f4[_0x5c1c('0x5a')]){var _0x435b3a=moment()[_0x5c1c('0x6b')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2a8aef=0x0,_0x52b97d=_0x5905f4['length'];_0x2a8aef<_0x52b97d;_0x2a8aef++){_0x5905f4[_0x2a8aef]['updateAttributes']({'exitAt':_0x435b3a});}}})[_0x5c1c('0x21')](function(){var _0x49b177=[];var _0x325f76=utils[_0x5c1c('0xeb')]();_0x325f76[_0x5c1c('0xe8')](function(_0x4cffe0){_0x49b177[_0x5c1c('0xa6')]({'channel':_0x4cffe0,'membername':_0x1c5a8f['name'],'interface':_['isNil'](_0x1c5a8f[_0x5c1c('0x99')])?util[_0x5c1c('0x6b')](_0x5c1c('0xa7'),_0x1c5a8f[_0x5c1c('0x39')]):_0x1c5a8f[_0x5c1c('0x99')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x347647[_0x5c1c('0x5e')]['type']||_0x5c1c('0xf6'),'role':_0x1c5a8f[_0x5c1c('0x60')],'internal':_0x1c5a8f[_0x5c1c('0x6d')]});});return db[_0x5c1c('0xe7')]['bulkCreate'](_0x49b177,{'individualHooks':!![]});})[_0x5c1c('0x21')](function(){return _0x1c5a8f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x347647[_0x5c1c('0x5e')]['type']||_0x5c1c('0xf6'),'lastPauseAt':moment()[_0x5c1c('0x6b')](_0x5c1c('0xe9'))});})[_0x5c1c('0x21')](respondWithResult(_0x248651,null))[_0x5c1c('0x2a')](handleError(_0x248651,null));};exports['unpause']=function(_0x37eb27,_0x331bc2,_0x18a863){var _0x2fab21;return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x37eb27['params']['id']},'attributes':['id',_0x5c1c('0x39'),_0x5c1c('0x60'),_0x5c1c('0x98'),'mailPause',_0x5c1c('0xf7'),_0x5c1c('0xf8'),_0x5c1c('0xf9'),_0x5c1c('0xfa'),_0x5c1c('0xfb'),_0x5c1c('0xfc'),_0x5c1c('0xfd')]})[_0x5c1c('0x21')](handleEntityNotFound(_0x331bc2,null))[_0x5c1c('0x21')](function(_0x5a607b){if(_0x5a607b){_0x2fab21=_0x5a607b;if(_0x37eb27['body'][_0x5c1c('0x96')]&&!utils[_0x5c1c('0x9a')](_0x37eb27[_0x5c1c('0x5e')]['channel'])){throw new db['Sequelize'][(_0x5c1c('0x8c'))](_0x5c1c('0x9b'));}switch(_0x37eb27['body'][_0x5c1c('0x96')]){case _0x5c1c('0xa3'):return respondWithRpcPromise(_0x5c1c('0xf5'),'unpause',{'id':_0x2fab21['id'],'name':_0x2fab21[_0x5c1c('0x39')],'pause':![]})[_0x5c1c('0x21')](function(){return db['UserVoiceQueueRt'][_0x5c1c('0x5f')]({'paused':0x0},{'where':{'UserId':_0x2fab21['id']},'individualHooks':!![]});})[_0x5c1c('0x21')](function(){return db[_0x5c1c('0xe7')]['find']({'where':{'channel':_0x37eb27[_0x5c1c('0x5e')][_0x5c1c('0x96')],'membername':_0x2fab21[_0x5c1c('0x39')],'type':_0x5c1c('0xee'),'exitAt':null}});})[_0x5c1c('0x21')](function(_0x55ea31){if(_0x55ea31){return _0x55ea31['update']({'exitAt':moment()['format'](_0x5c1c('0xe9')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x5c1c('0x21')](function(){return _0x2fab21['update']({'voicePause':![]});});case _0x5c1c('0xfe'):case _0x5c1c('0xff'):case'fax':case _0x5c1c('0x100'):case _0x5c1c('0x101'):case _0x5c1c('0x102'):return db[_0x5c1c('0xe7')][_0x5c1c('0x5c')]({'where':{'channel':_0x37eb27['body'][_0x5c1c('0x96')],'membername':_0x2fab21[_0x5c1c('0x39')],'type':'PAUSE','exitAt':null}})[_0x5c1c('0x21')](function(_0x4df297){if(_0x4df297){return _0x4df297[_0x5c1c('0x5f')]({'exitAt':moment()['format'](_0x5c1c('0xe9')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x5c1c('0x21')](function(){var _0x17ba2c={};_[_0x5c1c('0x103')](_0x17ba2c,util[_0x5c1c('0x6b')](_0x5c1c('0x104'),_0x37eb27[_0x5c1c('0x5e')][_0x5c1c('0x96')],_0x5c1c('0x105')),![]);return _0x2fab21[_0x5c1c('0x5f')](_0x17ba2c);});default:return respondWithRpcPromise(_0x5c1c('0xf5'),_0x5c1c('0x106'),{'id':_0x2fab21['id'],'name':_0x2fab21[_0x5c1c('0x39')],'pause':![]})['then'](function(){return db[_0x5c1c('0xa9')][_0x5c1c('0x5f')]({'paused':0x0},{'where':{'UserId':_0x2fab21['id']}});})['then'](function(){return db[_0x5c1c('0xe7')]['findAll']({'where':{'membername':_0x2fab21[_0x5c1c('0x39')],'type':'PAUSE','exitAt':null}});})[_0x5c1c('0x21')](function(_0x30f10f){var _0x8428bf=[];_0x30f10f[_0x5c1c('0xe8')](function(_0x5599f3){_0x8428bf[_0x5c1c('0xa6')](_0x5599f3[_0x5c1c('0x5f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5c1c('0x107')}));});return BPromise[_0x5c1c('0xea')](_0x8428bf);})[_0x5c1c('0x21')](function(){return _0x2fab21[_0x5c1c('0x5f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x5c1c('0x21')](respondWithResult(_0x331bc2,null))[_0x5c1c('0x2a')](handleError(_0x331bc2,null));};exports['getTeams']=function(_0x46b4cf,_0x5a306e,_0x4e34f0){var _0x4f9fee={};var _0x3e124f={};var _0x424121;var _0x4824f5;return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x46b4cf['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x5a306e,null))[_0x5c1c('0x21')](function(_0x4b37e7){if(_0x4b37e7){_0x424121=_0x4b37e7;_0x3e124f['model']=_[_0x5c1c('0x46')](db['Team']['rawAttributes']);_0x3e124f[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x46b4cf[_0x5c1c('0x45')]);_0x3e124f[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x3e124f[_0x5c1c('0x43')],_0x3e124f[_0x5c1c('0x45')]);_0x4f9fee[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x3e124f[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x46b4cf[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x4f9fee[_0x5c1c('0x48')]=_0x4f9fee[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x4f9fee[_0x5c1c('0x48')]:_0x3e124f[_0x5c1c('0x43')];_0x4f9fee[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x46b4cf[_0x5c1c('0x45')]['sort']);_0x4f9fee[_0x5c1c('0x4e')]=qs['filters'](_[_0x5c1c('0xbc')](_0x46b4cf[_0x5c1c('0x45')],_0x3e124f[_0x5c1c('0x4f')]));if(_0x46b4cf[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x4f9fee[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x4f9fee[_0x5c1c('0x4e')],{'$or':_['map'](_0x4f9fee[_0x5c1c('0x48')],function(_0x3826f7){var _0x319a32={};_0x319a32[_0x3826f7]={'$like':'%'+_0x46b4cf[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x319a32;})});}_0x4f9fee=_[_0x5c1c('0x50')]({},_0x4f9fee,_0x46b4cf['options']);return _0x424121['getTeams'](_0x4f9fee);}})[_0x5c1c('0x21')](function(_0x4c747e){if(_0x4c747e){_0x4824f5=_0x4c747e[_0x5c1c('0x5a')];if(!_0x46b4cf[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x4f9fee['limit']=qs[_0x5c1c('0x4a')](_0x46b4cf[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x4f9fee[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x46b4cf[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x424121[_0x5c1c('0x108')](_0x4f9fee);}})[_0x5c1c('0x21')](function(_0xc8673a){if(_0xc8673a){return _0xc8673a?{'count':_0x4824f5,'rows':_0xc8673a}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x5a306e,null))[_0x5c1c('0x2a')](handleError(_0x5a306e,null));};exports[_0x5c1c('0x109')]=function(_0x498c10,_0x1a47b6){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x498c10['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x1a47b6,null))[_0x5c1c('0x21')](function(_0x255ece){if(_0x255ece){var _0x3efb87=_0x255ece[_0x5c1c('0x85')]({'plain':!![]});return _0x255ece['addTeams'](_0x498c10[_0x5c1c('0x5e')][_0x5c1c('0x63')],_['omit'](_0x498c10['body'],[_0x5c1c('0x63'),'id'])||{})['then'](function(){for(var _0xcd640c=0x0;_0xcd640c<_0x498c10[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0xcd640c++){var _0x1c6e5c=[];db[_0x5c1c('0x10a')]['findOne']({'where':{'id':_0x498c10[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0xcd640c]}})[_0x5c1c('0x21')](function(_0x55cc62){_0x1c6e5c[_0x5c1c('0xa6')](_0x55cc62[_0x5c1c('0xe5')]()[_0x5c1c('0x21')](function(_0x186d86){for(var _0xc95108=0x0;_0xc95108<_0x186d86[_0x5c1c('0x5a')];_0xc95108++){_0x186d86[_0xc95108][_0x5c1c('0x10b')]('channel',_0x5c1c('0x10c'));}return _0x186d86;}));_0x1c6e5c[_0x5c1c('0xa6')](_0x55cc62[_0x5c1c('0x10d')]()[_0x5c1c('0x21')](function(_0x41aa9e){for(var _0x22cb2a=0x0;_0x22cb2a<_0x41aa9e[_0x5c1c('0x5a')];_0x22cb2a++){_0x41aa9e[_0x22cb2a][_0x5c1c('0x10b')](_0x5c1c('0x96'),_0x5c1c('0x10e'));}return _0x41aa9e;}));_0x1c6e5c[_0x5c1c('0xa6')](_0x55cc62[_0x5c1c('0x10f')]()[_0x5c1c('0x21')](function(_0x5ca20e){for(var _0x16291b=0x0;_0x16291b<_0x5ca20e[_0x5c1c('0x5a')];_0x16291b++){_0x5ca20e[_0x16291b]['setDataValue'](_0x5c1c('0x96'),'Mail');}return _0x5ca20e;}));_0x1c6e5c['push'](_0x55cc62[_0x5c1c('0x110')]()[_0x5c1c('0x21')](function(_0x648a5f){for(var _0x5814ec=0x0;_0x5814ec<_0x648a5f[_0x5c1c('0x5a')];_0x5814ec++){_0x648a5f[_0x5814ec][_0x5c1c('0x10b')](_0x5c1c('0x96'),_0x5c1c('0x111'));}return _0x648a5f;}));_0x1c6e5c[_0x5c1c('0xa6')](_0x55cc62['getWhatsappQueues']()[_0x5c1c('0x21')](function(_0x4f4a6b){for(var _0x3af68a=0x0;_0x3af68a<_0x4f4a6b[_0x5c1c('0x5a')];_0x3af68a++){_0x4f4a6b[_0x3af68a][_0x5c1c('0x10b')](_0x5c1c('0x96'),'Whatsapp');}return _0x4f4a6b;}));_0x1c6e5c[_0x5c1c('0xa6')](_0x55cc62[_0x5c1c('0x112')]()['then'](function(_0x4ea892){for(var _0x811e6c=0x0;_0x811e6c<_0x4ea892[_0x5c1c('0x5a')];_0x811e6c++){_0x4ea892[_0x811e6c][_0x5c1c('0x10b')](_0x5c1c('0x96'),_0x5c1c('0x113'));}return _0x4ea892;}));_0x1c6e5c[_0x5c1c('0xa6')](_0x55cc62['getOpenchannelQueues']()[_0x5c1c('0x21')](function(_0x604b59){for(var _0x51f7a7=0x0;_0x51f7a7<_0x604b59['length'];_0x51f7a7++){_0x604b59[_0x51f7a7][_0x5c1c('0x10b')](_0x5c1c('0x96'),_0x5c1c('0x114'));}return _0x604b59;}));return BPromise[_0x5c1c('0xea')](_0x1c6e5c);})[_0x5c1c('0x21')](function(_0x9a959e){var _0x4f5164=_[_0x5c1c('0x115')](_0x9a959e);_0x1c6e5c=[];return db[_0x5c1c('0x52')]['transaction'](function(_0x329e4a){for(var _0x3129d0=0x0;_0x3129d0<_0x4f5164[_0x5c1c('0x5a')];_0x3129d0++){_0x1c6e5c[_0x5c1c('0xa6')](_0x4f5164[_0x3129d0][_0x5c1c('0x116')](_0x3efb87['id']),{'transaction':_0x329e4a});}return BPromise[_0x5c1c('0xea')](_0x1c6e5c)[_0x5c1c('0x21')](function(){if(_0x3efb87['online']){return BPromise[_0x5c1c('0xa8')](_[_0x5c1c('0x35')](_0x4f5164,function(_0x3ca135){return _0x3ca135[_0x5c1c('0x117')](_0x5c1c('0x96'))===_0x5c1c('0x10c');}),function(_0x1360e7){return db['UserVoiceQueueRt'][_0x5c1c('0xaa')]({'membername':_0x3efb87[_0x5c1c('0x39')],'UserId':_0x3efb87['id'],'queue_name':_0x1360e7['name'],'VoiceQueueId':_0x1360e7['id'],'interface':_['isNil'](_0x3efb87[_0x5c1c('0x99')])?util['format'](_0x5c1c('0xa7'),_0x3efb87[_0x5c1c('0x39')]):_0x3efb87[_0x5c1c('0x99')],'paused':_0x3efb87[_0x5c1c('0x98')]||![],'penalty':_0x3efb87[_0x5c1c('0x9f')]},{'transaction':_0x329e4a});});}else{return;}})[_0x5c1c('0x21')](function(){for(var _0x4c59aa=0x0;_0x4c59aa<_0x4f5164['length'];_0x4c59aa++){var _0x1b0a4b=_0x4f5164[_0x4c59aa]['getDataValue'](_0x5c1c('0x96'));var _0x1b15dd=_0x1b0a4b+'QueueId';socket['emit']('user'+_0x1b0a4b+_0x5c1c('0xa2'),{'UserId':_0x3efb87['id'],['queueField']:_0x4f5164[_0x4c59aa]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x1a47b6,null))[_0x5c1c('0x2a')](handleError(_0x1a47b6,null));};exports[_0x5c1c('0x118')]=function(_0x1b7c18,_0x54e14a){return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x1b7c18['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x54e14a,null))[_0x5c1c('0x21')](function(_0x2976aa){if(_0x2976aa){var _0x4bd490=_0x2976aa['get']({'plain':!![]});var _0x2a9d58=_0x1b7c18[_0x5c1c('0x45')][_0x5c1c('0x63')];return _0x2976aa[_0x5c1c('0x118')](_0x2a9d58)[_0x5c1c('0x21')](function(){for(var _0x4a8cc4=0x0;_0x4a8cc4<_0x2a9d58['length'];_0x4a8cc4++){var _0x5e8756=[];db['Team'][_0x5c1c('0x8a')]({'where':{'id':_0x2a9d58[_0x4a8cc4]}})['then'](function(_0x43de77){_0x5e8756[_0x5c1c('0xa6')](_0x43de77['getVoiceQueues']()[_0x5c1c('0x21')](function(_0xe2c5e3){for(var _0x21e4c4=0x0;_0x21e4c4<_0xe2c5e3[_0x5c1c('0x5a')];_0x21e4c4++){_0xe2c5e3[_0x21e4c4][_0x5c1c('0x10b')]('channel','Voice');}return _0xe2c5e3;}));_0x5e8756[_0x5c1c('0xa6')](_0x43de77[_0x5c1c('0x10d')]()[_0x5c1c('0x21')](function(_0x377df1){for(var _0x41b210=0x0;_0x41b210<_0x377df1[_0x5c1c('0x5a')];_0x41b210++){_0x377df1[_0x41b210]['setDataValue'](_0x5c1c('0x96'),_0x5c1c('0x10e'));}return _0x377df1;}));_0x5e8756[_0x5c1c('0xa6')](_0x43de77[_0x5c1c('0x10f')]()[_0x5c1c('0x21')](function(_0x1ef345){for(var _0x304f11=0x0;_0x304f11<_0x1ef345[_0x5c1c('0x5a')];_0x304f11++){_0x1ef345[_0x304f11][_0x5c1c('0x10b')](_0x5c1c('0x96'),_0x5c1c('0x119'));}return _0x1ef345;}));_0x5e8756['push'](_0x43de77[_0x5c1c('0x110')]()[_0x5c1c('0x21')](function(_0x140318){for(var _0x5b68db=0x0;_0x5b68db<_0x140318[_0x5c1c('0x5a')];_0x5b68db++){_0x140318[_0x5b68db][_0x5c1c('0x10b')](_0x5c1c('0x96'),_0x5c1c('0x111'));}return _0x140318;}));_0x5e8756[_0x5c1c('0xa6')](_0x43de77[_0x5c1c('0x11a')]()[_0x5c1c('0x21')](function(_0x51923a){for(var _0x28e9b9=0x0;_0x28e9b9<_0x51923a['length'];_0x28e9b9++){_0x51923a[_0x28e9b9][_0x5c1c('0x10b')](_0x5c1c('0x96'),_0x5c1c('0x11b'));}return _0x51923a;}));_0x5e8756['push'](_0x43de77[_0x5c1c('0x112')]()['then'](function(_0x14f294){for(var _0x1efcc5=0x0;_0x1efcc5<_0x14f294[_0x5c1c('0x5a')];_0x1efcc5++){_0x14f294[_0x1efcc5]['setDataValue'](_0x5c1c('0x96'),'Fax');}return _0x14f294;}));_0x5e8756[_0x5c1c('0xa6')](_0x43de77[_0x5c1c('0x11c')]()['then'](function(_0x38e339){for(var _0x1e2f7d=0x0;_0x1e2f7d<_0x38e339[_0x5c1c('0x5a')];_0x1e2f7d++){_0x38e339[_0x1e2f7d]['setDataValue'](_0x5c1c('0x96'),'Openchannel');}return _0x38e339;}));return BPromise[_0x5c1c('0xea')](_0x5e8756);})[_0x5c1c('0x21')](function(_0x147294){var _0x17396b=_[_0x5c1c('0x115')](_0x147294);_0x5e8756=[];return db[_0x5c1c('0x52')][_0x5c1c('0x11d')](function(_0x1b1922){for(var _0x4941ab=0x0;_0x4941ab<_0x17396b[_0x5c1c('0x5a')];_0x4941ab++){_0x5e8756[_0x5c1c('0xa6')](_0x17396b[_0x4941ab][_0x5c1c('0x11e')](_0x4bd490['id']),{'transaction':_0x1b1922});}return BPromise[_0x5c1c('0xea')](_0x5e8756)['then'](function(){if(_0x4bd490[_0x5c1c('0x11f')]){return BPromise[_0x5c1c('0xa8')](_[_0x5c1c('0x35')](_0x17396b,function(_0xf492d8){return _0xf492d8[_0x5c1c('0x117')]('channel')===_0x5c1c('0x10c');}),function(_0x583f61){return db[_0x5c1c('0xa9')][_0x5c1c('0x31')]({'where':{'VoiceQueueId':_0x583f61['id'],'UserId':_0x4bd490['id']},'transaction':_0x1b1922});});}else{return;}})[_0x5c1c('0x21')](function(){for(var _0x5a7ee5=0x0;_0x5a7ee5<_0x17396b[_0x5c1c('0x5a')];_0x5a7ee5++){var _0x594930=_0x17396b[_0x5a7ee5]['getDataValue'](_0x5c1c('0x96'));var _0x387073=_0x594930+_0x5c1c('0xa1');socket[_0x5c1c('0xad')](_0x5c1c('0x66')+_0x594930+_0x5c1c('0xae'),{'UserId':_0x4bd490['id'],['queueField']:_0x17396b[_0x5a7ee5]['id']});}});});});}});}})[_0x5c1c('0x21')](respondWithStatusCode(_0x54e14a,null))[_0x5c1c('0x2a')](handleError(_0x54e14a,null));};exports[_0x5c1c('0x120')]=function(_0x1cbd89,_0x27ef4b,_0x1646f0){var _0x5b6c00={};var _0x1f3b11={};var _0x5f4ca0;var _0x30c86d;return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x1cbd89[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x27ef4b,null))[_0x5c1c('0x21')](function(_0x512ab1){if(_0x512ab1){_0x5f4ca0=_0x512ab1;_0x1f3b11[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db['CmList']['rawAttributes']);_0x1f3b11[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x1cbd89[_0x5c1c('0x45')]);_0x1f3b11['filters']=_['intersection'](_0x1f3b11[_0x5c1c('0x43')],_0x1f3b11['query']);_0x5b6c00[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x1f3b11[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x1cbd89[_0x5c1c('0x45')]['fields']));_0x5b6c00['attributes']=_0x5b6c00[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x5b6c00[_0x5c1c('0x48')]:_0x1f3b11[_0x5c1c('0x43')];_0x5b6c00[_0x5c1c('0x4c')]=qs['sort'](_0x1cbd89[_0x5c1c('0x45')]['sort']);_0x5b6c00[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x1cbd89[_0x5c1c('0x45')],_0x1f3b11['filters']));if(_0x1cbd89[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x5b6c00[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x5b6c00[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x5b6c00[_0x5c1c('0x48')],function(_0x59ace4){var _0x4165a5={};_0x4165a5[_0x59ace4]={'$like':'%'+_0x1cbd89[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x4165a5;})});}_0x5b6c00=_[_0x5c1c('0x50')]({},_0x5b6c00,_0x1cbd89[_0x5c1c('0x5b')]);return _0x5f4ca0['getLists'](_0x5b6c00);}})[_0x5c1c('0x21')](function(_0x25f84f){if(_0x25f84f){_0x30c86d=_0x25f84f[_0x5c1c('0x5a')];if(!_0x1cbd89[_0x5c1c('0x45')][_0x5c1c('0xbe')]('nolimit')){_0x5b6c00['limit']=qs[_0x5c1c('0x4a')](_0x1cbd89[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x5b6c00[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x1cbd89['query'][_0x5c1c('0x4b')]);}return _0x5f4ca0['getLists'](_0x5b6c00);}})[_0x5c1c('0x21')](function(_0x558587){if(_0x558587){return _0x558587?{'count':_0x30c86d,'rows':_0x558587}:null;}})['then'](respondWithResult(_0x27ef4b,null))[_0x5c1c('0x2a')](handleError(_0x27ef4b,null));};exports[_0x5c1c('0x121')]=function(_0x4e0ae6,_0x46670d,_0x407031){var _0x1bc668={};var _0x4a4f9b={};var _0x5e7b21;var _0x4c146c;return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x4e0ae6[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x46670d,null))['then'](function(_0x5db906){if(_0x5db906){_0x5e7b21=_0x5db906;_0x4a4f9b[_0x5c1c('0x43')]=_['keys'](db['User']['rawAttributes']);_0x4a4f9b['query']=_[_0x5c1c('0x46')](_0x4e0ae6['query']);_0x4a4f9b['filters']=_[_0x5c1c('0x47')](_0x4a4f9b[_0x5c1c('0x43')],_0x4a4f9b[_0x5c1c('0x45')]);_0x1bc668['attributes']=_['intersection'](_0x4a4f9b[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x4e0ae6[_0x5c1c('0x45')]['fields']));_0x1bc668[_0x5c1c('0x48')]=_0x1bc668['attributes'][_0x5c1c('0x5a')]?_0x1bc668[_0x5c1c('0x48')]:_0x4a4f9b[_0x5c1c('0x43')];_0x1bc668['order']=qs[_0x5c1c('0x4d')](_0x4e0ae6[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x1bc668['where']=qs['filters'](_[_0x5c1c('0xbc')](_0x4e0ae6['query'],_0x4a4f9b['filters']));if(_0x4e0ae6[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x1bc668[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x1bc668[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x1bc668['attributes'],function(_0x415723){var _0x5f3deb={};_0x5f3deb[_0x415723]={'$like':'%'+_0x4e0ae6[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x5f3deb;})});}_0x1bc668['model']=db[_0x5c1c('0x3f')];_0x1bc668['as']='Agents';_0x1bc668=_[_0x5c1c('0x50')]({},_0x1bc668,_0x4e0ae6[_0x5c1c('0x5b')]);return _0x5e7b21[_0x5c1c('0xe5')]({'include':[_0x1bc668]});}})[_0x5c1c('0x21')](function(_0x4e5db1){if(_0x4e5db1){var _0x5b07f8={},_0x344652=[],_0x1a7a2f=0x0;for(var _0x21a51c=0x0;_0x21a51c<_0x4e5db1['length'];_0x21a51c+=0x1){for(var _0x4fecaa=0x0,_0x49624d;_0x4fecaa<_0x4e5db1[_0x21a51c][_0x5c1c('0x33')]['length'];_0x4fecaa+=0x1){_0x49624d=_0x4e5db1[_0x21a51c][_0x5c1c('0x33')][_0x4fecaa][_0x5c1c('0x85')]({'plain':!![]});_0x5b07f8[_0x49624d['id']]=_0x49624d;}}_0x5b07f8=_[_0x5c1c('0x122')](_0x5b07f8);for(var _0x52998b=qs[_0x5c1c('0x4b')](_0x4e0ae6[_0x5c1c('0x45')][_0x5c1c('0x4b')]);_0x52998b<_0x5b07f8[_0x5c1c('0x5a')]&&_0x344652['length']<qs['limit'](_0x4e0ae6[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x52998b+=0x1){if(_0x5b07f8[_0x52998b]){_0x344652[_0x5c1c('0xa6')](_0x5b07f8[_0x52998b]);}}return{'count':_0x5b07f8['length'],'rows':_0x344652};}})[_0x5c1c('0x21')](respondWithResult(_0x46670d,null))['catch'](handleError(_0x46670d,null));};exports[_0x5c1c('0x31')]=function(_0x1248eb,_0x5d18b2){if(_0x1248eb[_0x5c1c('0x66')]['id']==_0x1248eb[_0x5c1c('0x61')]['id']){return _0x5d18b2[_0x5c1c('0x2c')](0x1f4)[_0x5c1c('0x3d')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x1248eb[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x5d18b2,null))[_0x5c1c('0x21')](removeEntity(_0x5d18b2,null))[_0x5c1c('0x2a')](handleError(_0x5d18b2,null));};exports[_0x5c1c('0x123')]=function(_0x1317d1,_0x34ac06,_0x5cc698){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x1317d1[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x34ac06,null))[_0x5c1c('0x21')](function(_0x18632d){if(_0x18632d){return _0x18632d[_0x5c1c('0x123')](_0x1317d1[_0x5c1c('0x5e')][_0x5c1c('0x63')],_[_0x5c1c('0x124')](_0x1317d1['body'],[_0x5c1c('0x63'),'id'])||{})[_0x5c1c('0x125')](function(){for(var _0x57f41d=0x0;_0x57f41d<_0x1317d1[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x57f41d+=0x1){socket[_0x5c1c('0xad')](_0x5c1c('0x126'),{'ChatInteractionId':Number(_0x1317d1[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x57f41d]),'UserId':Number(_0x1317d1['params']['id'])});}return _0x1317d1[_0x5c1c('0x5e')]['ids'];});}})[_0x5c1c('0x21')](respondWithResult(_0x34ac06,null))['catch'](handleError(_0x34ac06,null));};exports[_0x5c1c('0x127')]=function(_0x3aad25,_0x2795da,_0x22dcc3){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x3aad25[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x2795da,null))[_0x5c1c('0x21')](function(_0xba1104){if(_0xba1104){return _0xba1104[_0x5c1c('0x127')](_0x3aad25[_0x5c1c('0x45')]['ids'])['then'](function(){if(_[_0x5c1c('0x128')](_0x3aad25[_0x5c1c('0x45')][_0x5c1c('0x63')])){for(var _0x480aa1=0x0;_0x480aa1<_0x3aad25[_0x5c1c('0x45')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x480aa1+=0x1){socket[_0x5c1c('0xad')](_0x5c1c('0x129'),{'ChatInteractionId':Number(_0x3aad25[_0x5c1c('0x45')][_0x5c1c('0x63')][_0x480aa1]),'UserId':Number(_0x3aad25['params']['id'])});}}else{socket[_0x5c1c('0xad')](_0x5c1c('0x129'),{'ChatInteractionId':Number(_0x3aad25[_0x5c1c('0x45')]['ids']),'UserId':Number(_0x3aad25[_0x5c1c('0x61')]['id'])});}});}})[_0x5c1c('0x21')](respondWithStatusCode(_0x2795da,null))[_0x5c1c('0x2a')](handleError(_0x2795da,null));};exports[_0x5c1c('0x12a')]=function(_0x50d68f,_0xe590c3,_0x12948f){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x50d68f['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0xe590c3,null))[_0x5c1c('0x21')](function(_0x24a92e){if(_0x24a92e){return _0x24a92e[_0x5c1c('0x12a')](_0x50d68f[_0x5c1c('0x5e')][_0x5c1c('0x63')],_[_0x5c1c('0x124')](_0x50d68f[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{})[_0x5c1c('0x125')](function(){for(var _0x4f8384=0x0;_0x4f8384<_0x50d68f[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x4f8384+=0x1){socket[_0x5c1c('0xad')](_0x5c1c('0x12b'),{'MailInteractionId':Number(_0x50d68f['body'][_0x5c1c('0x63')][_0x4f8384]),'UserId':Number(_0x50d68f['params']['id'])});}return _0x50d68f[_0x5c1c('0x5e')][_0x5c1c('0x63')];});}})['then'](respondWithResult(_0xe590c3,null))['catch'](handleError(_0xe590c3,null));};exports[_0x5c1c('0x12c')]=function(_0x51b27a,_0x44e012,_0xb9eaba){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x51b27a[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x44e012,null))[_0x5c1c('0x21')](function(_0x274b82){if(_0x274b82){return _0x274b82[_0x5c1c('0x12c')](_0x51b27a['query'][_0x5c1c('0x63')])[_0x5c1c('0x21')](function(){if(_['isArray'](_0x51b27a[_0x5c1c('0x45')][_0x5c1c('0x63')])){for(var _0x23b307=0x0;_0x23b307<_0x51b27a['query'][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x23b307+=0x1){socket[_0x5c1c('0xad')](_0x5c1c('0x12d'),{'MailInteractionId':Number(_0x51b27a[_0x5c1c('0x45')]['ids'][_0x23b307]),'UserId':Number(_0x51b27a[_0x5c1c('0x61')]['id'])});}}else{socket['emit'](_0x5c1c('0x12d'),{'MailInteractionId':Number(_0x51b27a[_0x5c1c('0x45')][_0x5c1c('0x63')]),'UserId':Number(_0x51b27a[_0x5c1c('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x44e012,null))[_0x5c1c('0x2a')](handleError(_0x44e012,null));};exports['addFaxInteractions']=function(_0xb3402f,_0x37aec0,_0x43f6e3){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0xb3402f[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x37aec0,null))[_0x5c1c('0x21')](function(_0x397991){if(_0x397991){return _0x397991['addFaxInteractions'](_0xb3402f[_0x5c1c('0x5e')]['ids'],_[_0x5c1c('0x124')](_0xb3402f[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{})[_0x5c1c('0x125')](function(){for(var _0x326187=0x0;_0x326187<_0xb3402f[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x326187+=0x1){socket[_0x5c1c('0xad')](_0x5c1c('0x12e'),{'FaxInteractionId':Number(_0xb3402f[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x326187]),'UserId':Number(_0xb3402f['params']['id'])});}return _0xb3402f[_0x5c1c('0x5e')][_0x5c1c('0x63')];});}})[_0x5c1c('0x21')](respondWithResult(_0x37aec0,null))[_0x5c1c('0x2a')](handleError(_0x37aec0,null));};exports[_0x5c1c('0x12f')]=function(_0x40ce53,_0x27caa6,_0x557a88){return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x40ce53[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x27caa6,null))[_0x5c1c('0x21')](function(_0x53d17d){if(_0x53d17d){return _0x53d17d[_0x5c1c('0x12f')](_0x40ce53['query']['ids'])[_0x5c1c('0x21')](function(){if(_[_0x5c1c('0x128')](_0x40ce53[_0x5c1c('0x45')][_0x5c1c('0x63')])){for(var _0x1c3cc2=0x0;_0x1c3cc2<_0x40ce53[_0x5c1c('0x45')]['ids']['length'];_0x1c3cc2+=0x1){socket[_0x5c1c('0xad')](_0x5c1c('0x130'),{'FaxInteractionId':Number(_0x40ce53[_0x5c1c('0x45')][_0x5c1c('0x63')][_0x1c3cc2]),'UserId':Number(_0x40ce53[_0x5c1c('0x61')]['id'])});}}else{socket[_0x5c1c('0xad')](_0x5c1c('0x130'),{'FaxInteractionId':Number(_0x40ce53['query'][_0x5c1c('0x63')]),'UserId':Number(_0x40ce53[_0x5c1c('0x61')]['id'])});}});}})[_0x5c1c('0x21')](respondWithStatusCode(_0x27caa6,null))[_0x5c1c('0x2a')](handleError(_0x27caa6,null));};exports[_0x5c1c('0x131')]=function(_0x4b58ce,_0x36c485,_0x2fdaaf){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x4b58ce[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x36c485,null))[_0x5c1c('0x21')](function(_0x2d9d1a){if(_0x2d9d1a){return _0x2d9d1a[_0x5c1c('0x131')](_0x4b58ce['body']['ids'],_[_0x5c1c('0x124')](_0x4b58ce[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{})[_0x5c1c('0x125')](function(){for(var _0x2951a=0x0;_0x2951a<_0x4b58ce[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x2951a+=0x1){socket['emit'](_0x5c1c('0x132'),{'SmsInteractionId':Number(_0x4b58ce[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x2951a]),'UserId':Number(_0x4b58ce[_0x5c1c('0x61')]['id'])});}return _0x4b58ce[_0x5c1c('0x5e')][_0x5c1c('0x63')];});}})[_0x5c1c('0x21')](respondWithResult(_0x36c485,null))[_0x5c1c('0x2a')](handleError(_0x36c485,null));};exports[_0x5c1c('0x133')]=function(_0x4653ff,_0x5a3f84,_0x3018de){return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x4653ff[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x5a3f84,null))[_0x5c1c('0x21')](function(_0x40bfdf){if(_0x40bfdf){return _0x40bfdf[_0x5c1c('0x133')](_0x4653ff[_0x5c1c('0x45')][_0x5c1c('0x63')])[_0x5c1c('0x21')](function(){if(_[_0x5c1c('0x128')](_0x4653ff[_0x5c1c('0x45')][_0x5c1c('0x63')])){for(var _0x493f4a=0x0;_0x493f4a<_0x4653ff['query'][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x493f4a+=0x1){socket['emit'](_0x5c1c('0x134'),{'SmsInteractionId':Number(_0x4653ff[_0x5c1c('0x45')]['ids'][_0x493f4a]),'UserId':Number(_0x4653ff[_0x5c1c('0x61')]['id'])});}}else{socket['emit'](_0x5c1c('0x134'),{'SmsInteractionId':Number(_0x4653ff[_0x5c1c('0x45')][_0x5c1c('0x63')]),'UserId':Number(_0x4653ff[_0x5c1c('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a3f84,null))[_0x5c1c('0x2a')](handleError(_0x5a3f84,null));};exports[_0x5c1c('0x135')]=function(_0xd3b6b,_0x39fde0,_0x1c305b){return db[_0x5c1c('0x3f')]['find']({'where':{'id':_0xd3b6b[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x39fde0,null))[_0x5c1c('0x21')](function(_0x423cf2){if(_0x423cf2){return _0x423cf2['addOpenchannelInteractions'](_0xd3b6b['body'][_0x5c1c('0x63')],_[_0x5c1c('0x124')](_0xd3b6b[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{})[_0x5c1c('0x125')](function(){for(var _0x4f79b8=0x0;_0x4f79b8<_0xd3b6b[_0x5c1c('0x5e')]['ids']['length'];_0x4f79b8+=0x1){socket['emit']('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0xd3b6b[_0x5c1c('0x5e')]['ids'][_0x4f79b8]),'UserId':Number(_0xd3b6b['params']['id'])});}return _0xd3b6b[_0x5c1c('0x5e')]['ids'];});}})[_0x5c1c('0x21')](respondWithResult(_0x39fde0,null))[_0x5c1c('0x2a')](handleError(_0x39fde0,null));};exports[_0x5c1c('0x136')]=function(_0x2c6c26,_0x21675d,_0x55524c){return db['User']['find']({'where':{'id':_0x2c6c26[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x21675d,null))[_0x5c1c('0x21')](function(_0x2b3ac9){if(_0x2b3ac9){return _0x2b3ac9[_0x5c1c('0x136')](_0x2c6c26[_0x5c1c('0x45')][_0x5c1c('0x63')])[_0x5c1c('0x21')](function(){if(_['isArray'](_0x2c6c26['query'][_0x5c1c('0x63')])){for(var _0x8bcb4=0x0;_0x8bcb4<_0x2c6c26[_0x5c1c('0x45')][_0x5c1c('0x63')][_0x5c1c('0x5a')];_0x8bcb4+=0x1){socket['emit'](_0x5c1c('0x137'),{'OpenchannelInteractionId':Number(_0x2c6c26[_0x5c1c('0x45')][_0x5c1c('0x63')][_0x8bcb4]),'UserId':Number(_0x2c6c26[_0x5c1c('0x61')]['id'])});}}else{socket[_0x5c1c('0xad')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x2c6c26[_0x5c1c('0x45')][_0x5c1c('0x63')]),'UserId':Number(_0x2c6c26[_0x5c1c('0x61')]['id'])});}});}})[_0x5c1c('0x21')](respondWithStatusCode(_0x21675d,null))[_0x5c1c('0x2a')](handleError(_0x21675d,null));};exports[_0x5c1c('0x138')]=function(_0x4685fc,_0x1665af,_0x652e7a){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x4685fc['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x1665af,null))['then'](function(_0x17a7fb){if(_0x17a7fb){return _0x17a7fb['addWhatsappInteractions'](_0x4685fc[_0x5c1c('0x5e')][_0x5c1c('0x63')],_['omit'](_0x4685fc[_0x5c1c('0x5e')],['ids','id'])||{})[_0x5c1c('0x125')](function(){for(var _0x11c591=0x0;_0x11c591<_0x4685fc[_0x5c1c('0x5e')][_0x5c1c('0x63')]['length'];_0x11c591+=0x1){socket['emit'](_0x5c1c('0x139'),{'WhatsappInteractionId':Number(_0x4685fc[_0x5c1c('0x5e')][_0x5c1c('0x63')][_0x11c591]),'UserId':Number(_0x4685fc[_0x5c1c('0x61')]['id'])});}return _0x4685fc[_0x5c1c('0x5e')][_0x5c1c('0x63')];});}})[_0x5c1c('0x21')](respondWithResult(_0x1665af,null))[_0x5c1c('0x2a')](handleError(_0x1665af,null));};exports[_0x5c1c('0x13a')]=function(_0x981a29,_0x488ec1,_0xa14592){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x981a29[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x488ec1,null))[_0x5c1c('0x21')](function(_0x5869d0){if(_0x5869d0){return _0x5869d0[_0x5c1c('0x13a')](_0x981a29[_0x5c1c('0x45')][_0x5c1c('0x63')]);}})[_0x5c1c('0x21')](respondWithStatusCode(_0x488ec1,null))[_0x5c1c('0x2a')](handleError(_0x488ec1,null));};exports['getVoicePrefixes']=function(_0x40d3f5,_0x2428a2,_0x556a51){var _0x3ec7d3={};var _0x188c2a={};var _0x1ea6c4;var _0x50568e;return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x40d3f5[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x2428a2,null))[_0x5c1c('0x21')](function(_0x52c969){if(_0x52c969){_0x1ea6c4=_0x52c969;_0x188c2a[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db[_0x5c1c('0x13b')][_0x5c1c('0x40')]);_0x188c2a[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x40d3f5[_0x5c1c('0x45')]);_0x188c2a[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x188c2a[_0x5c1c('0x43')],_0x188c2a['query']);_0x3ec7d3['attributes']=_[_0x5c1c('0x47')](_0x188c2a['model'],qs[_0x5c1c('0x49')](_0x40d3f5[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x3ec7d3['attributes']=_0x3ec7d3[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x3ec7d3['attributes']:_0x188c2a['model'];_0x3ec7d3[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x40d3f5[_0x5c1c('0x45')]['sort']);_0x3ec7d3[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_['pick'](_0x40d3f5[_0x5c1c('0x45')],_0x188c2a['filters']));if(_0x40d3f5[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x3ec7d3[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x3ec7d3[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x3ec7d3[_0x5c1c('0x48')],function(_0x331d57){var _0x2e3a60={};_0x2e3a60[_0x331d57]={'$like':'%'+_0x40d3f5[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x2e3a60;})});}_0x3ec7d3=_[_0x5c1c('0x50')]({},_0x3ec7d3,_0x40d3f5[_0x5c1c('0x5b')]);return _0x1ea6c4[_0x5c1c('0x13c')](_0x3ec7d3);}})[_0x5c1c('0x21')](function(_0x200a82){if(_0x200a82){_0x50568e=_0x200a82[_0x5c1c('0x5a')];if(!_0x40d3f5[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x3ec7d3[_0x5c1c('0x4a')]=qs['limit'](_0x40d3f5[_0x5c1c('0x45')]['limit']);_0x3ec7d3[_0x5c1c('0x4b')]=qs['offset'](_0x40d3f5['query'][_0x5c1c('0x4b')]);}return _0x1ea6c4[_0x5c1c('0x13c')](_0x3ec7d3);}})[_0x5c1c('0x21')](function(_0x12d3fd){if(_0x12d3fd){return _0x12d3fd?{'count':_0x50568e,'rows':_0x12d3fd}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x2428a2,null))['catch'](handleError(_0x2428a2,null));};exports[_0x5c1c('0x13d')]=function(_0xecc94e,_0x4306bc,_0x483512){var _0x1d564b={};var _0x322b65={};var _0x244c54;var _0x1b0782;return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0xecc94e[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x4306bc,null))[_0x5c1c('0x21')](function(_0x1f0f22){if(_0x1f0f22){_0x244c54=_0x1f0f22;_0x322b65['model']=_[_0x5c1c('0x46')](db[_0x5c1c('0x13e')]['rawAttributes']);_0x322b65[_0x5c1c('0x45')]=_['keys'](_0xecc94e[_0x5c1c('0x45')]);_0x322b65[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x322b65['model'],_0x322b65[_0x5c1c('0x45')]);_0x1d564b[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x322b65[_0x5c1c('0x43')],qs['fields'](_0xecc94e['query'][_0x5c1c('0x49')]));_0x1d564b['attributes']=_0x1d564b[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x1d564b[_0x5c1c('0x48')]:_0x322b65[_0x5c1c('0x43')];_0x1d564b['order']=qs[_0x5c1c('0x4d')](_0xecc94e[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x1d564b['where']=qs[_0x5c1c('0x4f')](_['pick'](_0xecc94e[_0x5c1c('0x45')],_0x322b65['filters']));if(_0xecc94e[_0x5c1c('0x45')]['filter']){_0x1d564b[_0x5c1c('0x4e')]=_['merge'](_0x1d564b[_0x5c1c('0x4e')],{'$or':_['map'](_0x1d564b[_0x5c1c('0x48')],function(_0x5abc7b){var _0x5bf075={};_0x5bf075[_0x5abc7b]={'$like':'%'+_0xecc94e[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x5bf075;})});}_0x1d564b=_[_0x5c1c('0x50')]({},_0x1d564b,_0xecc94e[_0x5c1c('0x5b')]);return _0x244c54[_0x5c1c('0x13d')](_0x1d564b);}})[_0x5c1c('0x21')](function(_0x5c105a){if(_0x5c105a){_0x1b0782=_0x5c105a[_0x5c1c('0x5a')];if(!_0xecc94e[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x1d564b[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0xecc94e['query'][_0x5c1c('0x4a')]);_0x1d564b[_0x5c1c('0x4b')]=qs['offset'](_0xecc94e['query']['offset']);}return _0x244c54['getFaxAccounts'](_0x1d564b);}})[_0x5c1c('0x21')](function(_0x150b22){if(_0x150b22){return _0x150b22?{'count':_0x1b0782,'rows':_0x150b22}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x4306bc,null))['catch'](handleError(_0x4306bc,null));};exports['addFaxAccounts']=function(_0x531537,_0x21748d,_0x2ef460){return db[_0x5c1c('0x3f')]['find']({'where':{'id':_0x531537['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x21748d,null))['then'](function(_0x3e49d2){if(_0x3e49d2){return _0x3e49d2[_0x5c1c('0x13f')](_0x531537[_0x5c1c('0x5e')][_0x5c1c('0x63')],_[_0x5c1c('0x124')](_0x531537[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{});}})['then'](respondWithResult(_0x21748d,null))['catch'](handleError(_0x21748d,null));};exports[_0x5c1c('0x140')]=function(_0x2fd904,_0x46a577,_0x2ae510){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x2fd904['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x46a577,null))[_0x5c1c('0x21')](function(_0x25e995){if(_0x25e995){return _0x25e995[_0x5c1c('0x140')](_0x2fd904['query']['ids']);}})[_0x5c1c('0x21')](respondWithStatusCode(_0x46a577,null))[_0x5c1c('0x2a')](handleError(_0x46a577,null));};exports[_0x5c1c('0x141')]=function(_0x592c6d,_0x23b2ec,_0x391797){var _0x3342d6={};var _0x33aac5={};var _0x149296;var _0x261d61;return db[_0x5c1c('0x3f')]['findOne']({'where':{'id':_0x592c6d['params']['id']}})['then'](handleEntityNotFound(_0x23b2ec,null))[_0x5c1c('0x21')](function(_0x87572d){if(_0x87572d){_0x149296=_0x87572d;_0x33aac5[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db['MailAccount'][_0x5c1c('0x40')]);_0x33aac5[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x592c6d['query']);_0x33aac5[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x33aac5[_0x5c1c('0x43')],_0x33aac5['query']);_0x3342d6[_0x5c1c('0x48')]=_['intersection'](_0x33aac5[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x592c6d[_0x5c1c('0x45')]['fields']));_0x3342d6[_0x5c1c('0x48')]=_0x3342d6[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x3342d6[_0x5c1c('0x48')]:_0x33aac5[_0x5c1c('0x43')];_0x3342d6[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x592c6d[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x3342d6[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x592c6d[_0x5c1c('0x45')],_0x33aac5['filters']));if(_0x592c6d[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x3342d6['where']=_[_0x5c1c('0x50')](_0x3342d6[_0x5c1c('0x4e')],{'$or':_['map'](_0x3342d6['attributes'],function(_0x52cbe7){var _0x19e3c5={};_0x19e3c5[_0x52cbe7]={'$like':'%'+_0x592c6d[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x19e3c5;})});}_0x3342d6=_[_0x5c1c('0x50')]({},_0x3342d6,_0x592c6d['options']);return _0x149296[_0x5c1c('0x141')](_0x3342d6);}})[_0x5c1c('0x21')](function(_0x46e54c){if(_0x46e54c){_0x261d61=_0x46e54c[_0x5c1c('0x5a')];if(!_0x592c6d[_0x5c1c('0x45')]['hasOwnProperty'](_0x5c1c('0xc5'))){_0x3342d6[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x592c6d['query'][_0x5c1c('0x4a')]);_0x3342d6['offset']=qs[_0x5c1c('0x4b')](_0x592c6d[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x149296['getMailAccounts'](_0x3342d6);}})[_0x5c1c('0x21')](function(_0x3aee98){if(_0x3aee98){return _0x3aee98?{'count':_0x261d61,'rows':_0x3aee98}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x23b2ec,null))[_0x5c1c('0x2a')](handleError(_0x23b2ec,null));};exports[_0x5c1c('0x142')]=function(_0x302a0c,_0x326dfa,_0x4ae378){return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x302a0c['params']['id']}})['then'](handleEntityNotFound(_0x326dfa,null))[_0x5c1c('0x21')](function(_0x1acc19){if(_0x1acc19){return _0x1acc19['addMailAccounts'](_0x302a0c[_0x5c1c('0x5e')]['ids'],_['omit'](_0x302a0c[_0x5c1c('0x5e')],['ids','id'])||{});}})[_0x5c1c('0x21')](respondWithResult(_0x326dfa,null))[_0x5c1c('0x2a')](handleError(_0x326dfa,null));};exports['removeMailAccounts']=function(_0x1f29a2,_0x3e39e2,_0x224f18){return db[_0x5c1c('0x3f')]['find']({'where':{'id':_0x1f29a2[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x3e39e2,null))['then'](function(_0x1c3e70){if(_0x1c3e70){return _0x1c3e70[_0x5c1c('0x143')](_0x1f29a2[_0x5c1c('0x45')]['ids']);}})[_0x5c1c('0x21')](respondWithStatusCode(_0x3e39e2,null))[_0x5c1c('0x2a')](handleError(_0x3e39e2,null));};exports[_0x5c1c('0x144')]=function(_0x555d77,_0x393069,_0x6fee79){var _0xe81522={};var _0x19f31c={};var _0x36c60f;var _0x3fbff8;return db[_0x5c1c('0x3f')][_0x5c1c('0x8a')]({'where':{'id':_0x555d77[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x393069,null))[_0x5c1c('0x21')](function(_0x45841c){if(_0x45841c){_0x36c60f=_0x45841c;_0x19f31c['model']=_[_0x5c1c('0x46')](db[_0x5c1c('0x145')][_0x5c1c('0x40')]);_0x19f31c[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x555d77[_0x5c1c('0x45')]);_0x19f31c[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x19f31c[_0x5c1c('0x43')],_0x19f31c[_0x5c1c('0x45')]);_0xe81522[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x19f31c[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x555d77[_0x5c1c('0x45')]['fields']));_0xe81522[_0x5c1c('0x48')]=_0xe81522[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0xe81522[_0x5c1c('0x48')]:_0x19f31c[_0x5c1c('0x43')];_0xe81522['order']=qs[_0x5c1c('0x4d')](_0x555d77[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0xe81522[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x555d77[_0x5c1c('0x45')],_0x19f31c[_0x5c1c('0x4f')]));if(_0x555d77['query']['filter']){_0xe81522['where']=_[_0x5c1c('0x50')](_0xe81522[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0xe81522['attributes'],function(_0x86efd0){var _0x31c5cd={};_0x31c5cd[_0x86efd0]={'$like':'%'+_0x555d77[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x31c5cd;})});}_0xe81522=_['merge']({},_0xe81522,_0x555d77[_0x5c1c('0x5b')]);return _0x36c60f['getOpenchannelAccounts'](_0xe81522);}})['then'](function(_0xc0ff0c){if(_0xc0ff0c){_0x3fbff8=_0xc0ff0c[_0x5c1c('0x5a')];if(!_0x555d77[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0xe81522[_0x5c1c('0x4a')]=qs['limit'](_0x555d77[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0xe81522[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x555d77['query'][_0x5c1c('0x4b')]);}return _0x36c60f['getOpenchannelAccounts'](_0xe81522);}})['then'](function(_0x34d87d){if(_0x34d87d){return _0x34d87d?{'count':_0x3fbff8,'rows':_0x34d87d}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x393069,null))[_0x5c1c('0x2a')](handleError(_0x393069,null));};exports['addOpenchannelAccounts']=function(_0x34c5e5,_0x3045ca,_0x56f75e){return db[_0x5c1c('0x3f')]['find']({'where':{'id':_0x34c5e5[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x3045ca,null))[_0x5c1c('0x21')](function(_0x4cb44c){if(_0x4cb44c){return _0x4cb44c[_0x5c1c('0x146')](_0x34c5e5['body'][_0x5c1c('0x63')],_[_0x5c1c('0x124')](_0x34c5e5[_0x5c1c('0x5e')],['ids','id'])||{});}})[_0x5c1c('0x21')](respondWithResult(_0x3045ca,null))[_0x5c1c('0x2a')](handleError(_0x3045ca,null));};exports[_0x5c1c('0x147')]=function(_0x1a247b,_0xdcc79b,_0x4abbf4){return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x1a247b[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0xdcc79b,null))['then'](function(_0x56748c){if(_0x56748c){return _0x56748c[_0x5c1c('0x147')](_0x1a247b[_0x5c1c('0x45')]['ids']);}})[_0x5c1c('0x21')](respondWithStatusCode(_0xdcc79b,null))['catch'](handleError(_0xdcc79b,null));};exports[_0x5c1c('0x148')]=function(_0x3062de,_0x5538ec,_0x2ac454){var _0x149ede={};var _0x3d100f={};var _0x592c5f;var _0x3e017a;return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x3062de['params']['id']}})['then'](handleEntityNotFound(_0x5538ec,null))[_0x5c1c('0x21')](function(_0x5f4732){if(_0x5f4732){_0x592c5f=_0x5f4732;_0x3d100f['model']=_[_0x5c1c('0x46')](db[_0x5c1c('0x149')][_0x5c1c('0x40')]);_0x3d100f[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x3062de[_0x5c1c('0x45')]);_0x3d100f[_0x5c1c('0x4f')]=_['intersection'](_0x3d100f[_0x5c1c('0x43')],_0x3d100f[_0x5c1c('0x45')]);_0x149ede[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x3d100f['model'],qs[_0x5c1c('0x49')](_0x3062de[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x149ede['attributes']=_0x149ede[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x149ede[_0x5c1c('0x48')]:_0x3d100f[_0x5c1c('0x43')];_0x149ede[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x3062de[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x149ede[_0x5c1c('0x4e')]=qs[_0x5c1c('0x4f')](_['pick'](_0x3062de[_0x5c1c('0x45')],_0x3d100f[_0x5c1c('0x4f')]));if(_0x3062de[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x149ede['where']=_[_0x5c1c('0x50')](_0x149ede['where'],{'$or':_['map'](_0x149ede[_0x5c1c('0x48')],function(_0x1f6dd2){var _0x3662de={};_0x3662de[_0x1f6dd2]={'$like':'%'+_0x3062de[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x3662de;})});}_0x149ede=_[_0x5c1c('0x50')]({},_0x149ede,_0x3062de[_0x5c1c('0x5b')]);return _0x592c5f['getSmsAccounts'](_0x149ede);}})[_0x5c1c('0x21')](function(_0x2930c3){if(_0x2930c3){_0x3e017a=_0x2930c3[_0x5c1c('0x5a')];if(!_0x3062de[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x149ede[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x3062de['query']['limit']);_0x149ede[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x3062de[_0x5c1c('0x45')]['offset']);}return _0x592c5f[_0x5c1c('0x148')](_0x149ede);}})[_0x5c1c('0x21')](function(_0x4a0a5a){if(_0x4a0a5a){return _0x4a0a5a?{'count':_0x3e017a,'rows':_0x4a0a5a}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x5538ec,null))[_0x5c1c('0x2a')](handleError(_0x5538ec,null));};exports[_0x5c1c('0x14a')]=function(_0x1e2c7f,_0x188507,_0x4dee48){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x1e2c7f[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x188507,null))[_0x5c1c('0x21')](function(_0x3850a5){if(_0x3850a5){return _0x3850a5['addSmsAccounts'](_0x1e2c7f[_0x5c1c('0x5e')]['ids'],_[_0x5c1c('0x124')](_0x1e2c7f[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{});}})[_0x5c1c('0x21')](respondWithResult(_0x188507,null))[_0x5c1c('0x2a')](handleError(_0x188507,null));};exports[_0x5c1c('0x14b')]=function(_0x2f9329,_0x285563,_0x787744){return db['User']['find']({'where':{'id':_0x2f9329[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x285563,null))[_0x5c1c('0x21')](function(_0xe7e092){if(_0xe7e092){return _0xe7e092[_0x5c1c('0x14b')](_0x2f9329[_0x5c1c('0x45')][_0x5c1c('0x63')]);}})[_0x5c1c('0x21')](respondWithStatusCode(_0x285563,null))['catch'](handleError(_0x285563,null));};exports['getChatWebsites']=function(_0x4481e8,_0x571e0f,_0x14e4ea){var _0x4e6352={};var _0x5670b2={};var _0x44eee7;var _0x369836;return db[_0x5c1c('0x3f')]['findOne']({'where':{'id':_0x4481e8[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x571e0f,null))[_0x5c1c('0x21')](function(_0x1b52ee){if(_0x1b52ee){_0x44eee7=_0x1b52ee;_0x5670b2[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db[_0x5c1c('0x14c')][_0x5c1c('0x40')]);_0x5670b2[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x4481e8[_0x5c1c('0x45')]);_0x5670b2[_0x5c1c('0x4f')]=_['intersection'](_0x5670b2['model'],_0x5670b2[_0x5c1c('0x45')]);_0x4e6352[_0x5c1c('0x48')]=_['intersection'](_0x5670b2[_0x5c1c('0x43')],qs[_0x5c1c('0x49')](_0x4481e8['query'][_0x5c1c('0x49')]));_0x4e6352['attributes']=_0x4e6352[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x4e6352[_0x5c1c('0x48')]:_0x5670b2[_0x5c1c('0x43')];_0x4e6352[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x4481e8[_0x5c1c('0x45')]['sort']);_0x4e6352[_0x5c1c('0x4e')]=qs['filters'](_[_0x5c1c('0xbc')](_0x4481e8['query'],_0x5670b2[_0x5c1c('0x4f')]));if(_0x4481e8[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x4e6352[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x4e6352[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x4e6352[_0x5c1c('0x48')],function(_0xb448ca){var _0x267028={};_0x267028[_0xb448ca]={'$like':'%'+_0x4481e8[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x267028;})});}_0x4e6352=_['merge']({},_0x4e6352,_0x4481e8[_0x5c1c('0x5b')]);return _0x44eee7[_0x5c1c('0x14d')](_0x4e6352);}})[_0x5c1c('0x21')](function(_0x3b7e72){if(_0x3b7e72){_0x369836=_0x3b7e72[_0x5c1c('0x5a')];if(!_0x4481e8['query'][_0x5c1c('0xbe')]('nolimit')){_0x4e6352['limit']=qs[_0x5c1c('0x4a')](_0x4481e8['query']['limit']);_0x4e6352['offset']=qs['offset'](_0x4481e8['query'][_0x5c1c('0x4b')]);}return _0x44eee7[_0x5c1c('0x14d')](_0x4e6352);}})['then'](function(_0x5a612e){if(_0x5a612e){return _0x5a612e?{'count':_0x369836,'rows':_0x5a612e}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x571e0f,null))[_0x5c1c('0x2a')](handleError(_0x571e0f,null));};exports[_0x5c1c('0x14e')]=function(_0x31b38c,_0x353204,_0x5f49ec){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x31b38c[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x353204,null))['then'](function(_0x340612){if(_0x340612){return _0x340612[_0x5c1c('0x14e')](_0x31b38c[_0x5c1c('0x5e')][_0x5c1c('0x63')],_[_0x5c1c('0x124')](_0x31b38c[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{});}})['then'](respondWithResult(_0x353204,null))[_0x5c1c('0x2a')](handleError(_0x353204,null));};exports['removeChatWebsites']=function(_0x3a3b5f,_0x3d6044,_0x372375){return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x3a3b5f[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x3d6044,null))['then'](function(_0x4a5a9d){if(_0x4a5a9d){return _0x4a5a9d[_0x5c1c('0x14f')](_0x3a3b5f[_0x5c1c('0x45')]['ids']);}})[_0x5c1c('0x21')](respondWithStatusCode(_0x3d6044,null))['catch'](handleError(_0x3d6044,null));};exports[_0x5c1c('0x150')]=function(_0x3614fc,_0x5a3a3e,_0x2263b1){var _0x303690={};var _0x304754={};var _0x345297;var _0x39b2af;return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x3614fc[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x5a3a3e,null))[_0x5c1c('0x21')](function(_0x1f7240){if(_0x1f7240){_0x345297=_0x1f7240;_0x304754['model']=_[_0x5c1c('0x46')](db['WhatsappAccount'][_0x5c1c('0x40')]);_0x304754[_0x5c1c('0x45')]=_[_0x5c1c('0x46')](_0x3614fc[_0x5c1c('0x45')]);_0x304754[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x304754[_0x5c1c('0x43')],_0x304754[_0x5c1c('0x45')]);_0x303690['attributes']=_[_0x5c1c('0x47')](_0x304754[_0x5c1c('0x43')],qs['fields'](_0x3614fc['query']['fields']));_0x303690[_0x5c1c('0x48')]=_0x303690[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x303690[_0x5c1c('0x48')]:_0x304754[_0x5c1c('0x43')];_0x303690['order']=qs[_0x5c1c('0x4d')](_0x3614fc[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x303690['where']=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x3614fc['query'],_0x304754[_0x5c1c('0x4f')]));if(_0x3614fc[_0x5c1c('0x45')]['filter']){_0x303690[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x303690['where'],{'$or':_[_0x5c1c('0xbd')](_0x303690[_0x5c1c('0x48')],function(_0x13c4ef){var _0x16e1a3={};_0x16e1a3[_0x13c4ef]={'$like':'%'+_0x3614fc['query']['filter']+'%'};return _0x16e1a3;})});}_0x303690=_[_0x5c1c('0x50')]({},_0x303690,_0x3614fc[_0x5c1c('0x5b')]);return _0x345297['getWhatsappAccounts'](_0x303690);}})[_0x5c1c('0x21')](function(_0x1a0534){if(_0x1a0534){_0x39b2af=_0x1a0534[_0x5c1c('0x5a')];if(!_0x3614fc[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x303690['limit']=qs[_0x5c1c('0x4a')](_0x3614fc[_0x5c1c('0x45')]['limit']);_0x303690['offset']=qs[_0x5c1c('0x4b')](_0x3614fc[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x345297['getWhatsappAccounts'](_0x303690);}})[_0x5c1c('0x21')](function(_0x1f4c57){if(_0x1f4c57){return _0x1f4c57?{'count':_0x39b2af,'rows':_0x1f4c57}:null;}})['then'](respondWithResult(_0x5a3a3e,null))[_0x5c1c('0x2a')](handleError(_0x5a3a3e,null));};exports[_0x5c1c('0x151')]=function(_0x2b65d9,_0x3b4451,_0x52db6f){return db['User']['find']({'where':{'id':_0x2b65d9[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x3b4451,null))[_0x5c1c('0x21')](function(_0x18db80){if(_0x18db80){return _0x18db80[_0x5c1c('0x151')](_0x2b65d9[_0x5c1c('0x5e')][_0x5c1c('0x63')],_['omit'](_0x2b65d9[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{});}})[_0x5c1c('0x21')](respondWithResult(_0x3b4451,null))[_0x5c1c('0x2a')](handleError(_0x3b4451,null));};exports[_0x5c1c('0x152')]=function(_0x5bf673,_0x33ecbf,_0x4ecbd9){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x5bf673['params']['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x33ecbf,null))[_0x5c1c('0x21')](function(_0x346bef){if(_0x346bef){return _0x346bef['removeWhatsappAccounts'](_0x5bf673[_0x5c1c('0x45')][_0x5c1c('0x63')]);}})[_0x5c1c('0x21')](respondWithStatusCode(_0x33ecbf,null))[_0x5c1c('0x2a')](handleError(_0x33ecbf,null));};exports[_0x5c1c('0x153')]=function(_0x5ac8f9,_0x571072,_0x70beb6){var _0x5d172d={};var _0x859b2={};var _0x437903;var _0x4e6b0a;return db[_0x5c1c('0x3f')]['findOne']({'where':{'id':_0x5ac8f9[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x571072,null))[_0x5c1c('0x21')](function(_0x205e7f){if(_0x205e7f){_0x437903=_0x205e7f;_0x859b2[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](db[_0x5c1c('0x154')]['rawAttributes']);_0x859b2[_0x5c1c('0x45')]=_['keys'](_0x5ac8f9['query']);_0x859b2[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x859b2[_0x5c1c('0x43')],_0x859b2['query']);_0x5d172d[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x859b2['model'],qs[_0x5c1c('0x49')](_0x5ac8f9[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x5d172d['attributes']=_0x5d172d[_0x5c1c('0x48')]['length']?_0x5d172d[_0x5c1c('0x48')]:_0x859b2['model'];_0x5d172d['order']=qs[_0x5c1c('0x4d')](_0x5ac8f9[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x5d172d[_0x5c1c('0x4e')]=qs['filters'](_[_0x5c1c('0xbc')](_0x5ac8f9[_0x5c1c('0x45')],_0x859b2[_0x5c1c('0x4f')]));if(_0x5ac8f9[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x5d172d['where']=_[_0x5c1c('0x50')](_0x5d172d['where'],{'$or':_['map'](_0x5d172d[_0x5c1c('0x48')],function(_0x28366e){var _0x4da581={};_0x4da581[_0x28366e]={'$like':'%'+_0x5ac8f9[_0x5c1c('0x45')][_0x5c1c('0x35')]+'%'};return _0x4da581;})});}_0x5d172d=_[_0x5c1c('0x50')]({},_0x5d172d,_0x5ac8f9[_0x5c1c('0x5b')]);return _0x437903[_0x5c1c('0x153')](_0x5d172d);}})[_0x5c1c('0x21')](function(_0xa49a0b){if(_0xa49a0b){_0x4e6b0a=_0xa49a0b[_0x5c1c('0x5a')];if(!_0x5ac8f9[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x5d172d[_0x5c1c('0x4a')]=qs[_0x5c1c('0x4a')](_0x5ac8f9[_0x5c1c('0x45')][_0x5c1c('0x4a')]);_0x5d172d[_0x5c1c('0x4b')]=qs[_0x5c1c('0x4b')](_0x5ac8f9[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}return _0x437903[_0x5c1c('0x153')](_0x5d172d);}})['then'](function(_0x1182e0){if(_0x1182e0){return _0x1182e0?{'count':_0x4e6b0a,'rows':_0x1182e0}:null;}})[_0x5c1c('0x21')](respondWithResult(_0x571072,null))[_0x5c1c('0x2a')](handleError(_0x571072,null));};exports['addSquareProjects']=function(_0x111bfb,_0x5476bd,_0x1ca80b){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x111bfb[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](handleEntityNotFound(_0x5476bd,null))[_0x5c1c('0x21')](function(_0x4378f9){if(_0x4378f9){return _0x4378f9[_0x5c1c('0x155')](_0x111bfb[_0x5c1c('0x5e')][_0x5c1c('0x63')],_[_0x5c1c('0x124')](_0x111bfb[_0x5c1c('0x5e')],[_0x5c1c('0x63'),'id'])||{});}})[_0x5c1c('0x21')](respondWithResult(_0x5476bd,null))[_0x5c1c('0x2a')](handleError(_0x5476bd,null));};exports['removeSquareProjects']=function(_0x74624e,_0x44c6de,_0x382009){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x74624e[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x44c6de,null))[_0x5c1c('0x21')](function(_0x2726c3){if(_0x2726c3){return _0x2726c3[_0x5c1c('0x156')](_0x74624e[_0x5c1c('0x45')][_0x5c1c('0x63')]);}})[_0x5c1c('0x21')](respondWithStatusCode(_0x44c6de,null))[_0x5c1c('0x2a')](handleError(_0x44c6de,null));};exports[_0x5c1c('0x157')]=function(_0x39a45e,_0x19a904){var _0x281b2f={},_0x4a04dc={},_0x5ae2ec={'count':0x0,'rows':[]};var _0x3b47ac=db[_0x5c1c('0x158')][_0x5c1c('0x40')];_0x4a04dc[_0x5c1c('0x43')]=_[_0x5c1c('0x46')](_0x3b47ac);_0x4a04dc[_0x5c1c('0x45')]=_['keys'](_0x39a45e[_0x5c1c('0x45')]);_0x4a04dc[_0x5c1c('0x4f')]=_[_0x5c1c('0x47')](_0x4a04dc[_0x5c1c('0x43')],_0x4a04dc['query']);_0x4a04dc[_0x5c1c('0x4f')]=_[_0x5c1c('0xf0')](_0x4a04dc[_0x5c1c('0x4f')],[_0x5c1c('0x159'),_0x5c1c('0x15a'),_0x5c1c('0x15b'),_0x5c1c('0x15c'),_0x5c1c('0x15d'),_0x5c1c('0x15e'),_0x5c1c('0x15f'),_0x5c1c('0x160'),'$not',_0x5c1c('0x161'),_0x5c1c('0x162'),_0x5c1c('0x163'),_0x5c1c('0x164'),_0x5c1c('0x165'),_0x5c1c('0x166'),'$iLike',_0x5c1c('0x167'),'$like','$overlap',_0x5c1c('0x168'),_0x5c1c('0x169'),_0x5c1c('0x16a')]);_0x281b2f[_0x5c1c('0x48')]=_[_0x5c1c('0x47')](_0x4a04dc[_0x5c1c('0x43')],qs['fields'](_0x39a45e[_0x5c1c('0x45')][_0x5c1c('0x49')]));_0x281b2f['attributes']=_0x281b2f[_0x5c1c('0x48')][_0x5c1c('0x5a')]?_0x281b2f[_0x5c1c('0x48')]:_0x4a04dc['model'];if(!_0x39a45e[_0x5c1c('0x45')][_0x5c1c('0xbe')](_0x5c1c('0xc5'))){_0x281b2f[_0x5c1c('0x4a')]=qs['limit'](_0x39a45e[_0x5c1c('0x45')]['limit']);_0x281b2f['offset']=qs[_0x5c1c('0x4b')](_0x39a45e[_0x5c1c('0x45')][_0x5c1c('0x4b')]);}_0x281b2f[_0x5c1c('0x4c')]=qs[_0x5c1c('0x4d')](_0x39a45e[_0x5c1c('0x45')][_0x5c1c('0x4d')]);_0x281b2f['where']=qs[_0x5c1c('0x4f')](_[_0x5c1c('0xbc')](_0x39a45e[_0x5c1c('0x45')],_0x4a04dc['filters']));if(_0x39a45e[_0x5c1c('0x45')][_0x5c1c('0x35')]){_0x281b2f[_0x5c1c('0x4e')]=_[_0x5c1c('0x50')](_0x281b2f[_0x5c1c('0x4e')],{'$or':_[_0x5c1c('0xbd')](_0x281b2f[_0x5c1c('0x48')],function(_0x248c66){var _0x3abfd2={};_0x3abfd2[_0x248c66]={'$like':'%'+_0x39a45e['query'][_0x5c1c('0x35')]+'%'};return _0x3abfd2;})});}_0x281b2f[_0x5c1c('0x4e')]={'$and':[_0x281b2f[_0x5c1c('0x4e')],{'$or':[{'UserId':_0x39a45e[_0x5c1c('0x61')]['id']},{'OwnerId':_0x39a45e[_0x5c1c('0x61')]['id']}]}]};_0x281b2f=_[_0x5c1c('0x50')]({},_0x281b2f,_0x39a45e[_0x5c1c('0x5b')]);var _0x329b9a={'where':_0x281b2f[_0x5c1c('0x4e')]};return db[_0x5c1c('0x158')]['count'](_0x329b9a)[_0x5c1c('0x21')](function(_0x40d21f){_0x5ae2ec['count']=_0x40d21f;if(_0x39a45e[_0x5c1c('0x45')][_0x5c1c('0x55')]){_0x281b2f[_0x5c1c('0x56')]=[{'attributes':['id',_0x5c1c('0x16b'),_0x5c1c('0x16c'),'phone'],'model':db[_0x5c1c('0xbb')],'as':_0x5c1c('0x16d')},{'attributes':['id',_0x5c1c('0x39'),_0x5c1c('0x16e')],'model':db[_0x5c1c('0xa4')],'as':_0x5c1c('0xc8')}];}return db[_0x5c1c('0x158')]['findAll'](_0x281b2f);})[_0x5c1c('0x21')](function(_0x3a4555){_0x5ae2ec[_0x5c1c('0xcd')]=_0x3a4555;return _0x5ae2ec;})['then'](respondWithFilteredResult(_0x19a904,_0x281b2f))[_0x5c1c('0x2a')](handleError(_0x19a904,null));};exports[_0x5c1c('0x16f')]=function(_0x35317f,_0x40384c,_0x318460){if(!_['isNil'](_0x35317f['user']['id'])&&(_0x35317f[_0x5c1c('0x66')]['role']==_0x5c1c('0x92')||_0x35317f[_0x5c1c('0x66')]['role']==_0x5c1c('0x66'))){return db['User'][_0x5c1c('0x8a')]({'where':{'id':_0x35317f['params']['id']},'raw':!![]})[_0x5c1c('0x21')](function(_0x4e84fb){return authService[_0x5c1c('0x170')](_0x4e84fb);})['then'](function(_0x42f575){if(_0x42f575){return _0x40384c[_0x5c1c('0x2c')](0xc8)[_0x5c1c('0x2d')]({'api_key':_0x42f575[_0x5c1c('0x171')]});}else{return _0x40384c[_0x5c1c('0x2c')](0xcc)[_0x5c1c('0x2d')]({'message':_0x5c1c('0x172')});}})[_0x5c1c('0x2a')](handleError(_0x40384c,0x193));}else{return _0x40384c[_0x5c1c('0x2c')](0x191)['json']({'message':_0x5c1c('0x173')});}};exports[_0x5c1c('0x174')]=function(_0x461273,_0x19d6c0,_0x5d60fd){if(!_[_0x5c1c('0x69')](_0x461273[_0x5c1c('0x66')]['id'])&&(_0x461273[_0x5c1c('0x66')][_0x5c1c('0x60')]==_0x5c1c('0x92')||_0x461273[_0x5c1c('0x66')][_0x5c1c('0x60')]=='user')){return db[_0x5c1c('0x3f')][_0x5c1c('0x5c')]({'where':{'id':_0x461273[_0x5c1c('0x61')]['id']}})[_0x5c1c('0x21')](function(_0x37e04d){return authService[_0x5c1c('0x175')](_0x37e04d);})[_0x5c1c('0x21')](function(_0x586c38){return db[_0x5c1c('0x3f')][_0x5c1c('0x5f')]({'apiKeyIat':_0x586c38[_0x5c1c('0x176')],'apiKeyNonce':_0x586c38[_0x5c1c('0x177')]},{'where':{'id':_0x461273['params']['id']}})[_0x5c1c('0x21')](function(){return _0x19d6c0[_0x5c1c('0x2c')](0xc8)[_0x5c1c('0x2d')]({'api_key':_0x586c38[_0x5c1c('0x171')]});});})[_0x5c1c('0x2a')](handleError(_0x19d6c0,0x193));}else{return _0x19d6c0[_0x5c1c('0x2c')](0x191)[_0x5c1c('0x2d')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['removeApiKey']=function(_0x4240ce,_0x216c73,_0x208b35){if(!_['isNil'](_0x4240ce[_0x5c1c('0x66')]['id'])&&(_0x4240ce['user'][_0x5c1c('0x60')]==_0x5c1c('0x92')||_0x4240ce[_0x5c1c('0x66')][_0x5c1c('0x60')]=='user')){return db['User'][_0x5c1c('0x5c')]({'where':{'id':_0x4240ce[_0x5c1c('0x61')]['id']}})['then'](handleEntityNotFound(_0x216c73,null))['then'](function(_0x10ca2b){if(_0x10ca2b&&_0x10ca2b['apiKeyNonce']&&_0x10ca2b[_0x5c1c('0x178')])return _0x10ca2b;else throw{'message':_0x5c1c('0x179')};})[_0x5c1c('0x21')](function(_0x59afeb){return db['User'][_0x5c1c('0x5f')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x4240ce[_0x5c1c('0x61')]['id']}});})[_0x5c1c('0x21')](respondWithStatusCode(_0x216c73,0xc8))['catch'](handleError(_0x216c73,0x193));}else{return _0x216c73[_0x5c1c('0x2c')](0x191)[_0x5c1c('0x2d')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x5c1c('0x17a')]=function(_0x554b79,_0x4ab84b){var _0x407090=_0x554b79['user'][_0x5c1c('0x85')]({'plain':!![]});if(!_0x407090){return _0x4ab84b[_0x5c1c('0x2c')](0x191)[_0x5c1c('0x3d')](_0x5c1c('0x17b'));}else{return _0x4ab84b[_0x5c1c('0x2c')](0xc8)['json'](_0x407090);}};
\ No newline at end of file
+var _0x923a=['mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','manual','mail','chat','sms','whatsapp','openchannel','%s%s','getTeams','Team','addTeams','omit','setDataValue','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','transaction','getDataValue','Voice','removeTeams','getChatQueues','Chat','flatten','Queue:remove','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$eq','$between','$notBetween','$in','$like','$notLike','$iLike','$contains','$contained','$any','firstName','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.socket','register','client','http','test','Sequelize','ValidationError','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','save','update','Users','user','Agents','telephone','filter','value','role','find','name','UserProfileResource','destroy','stack','send','index','map','User','fieldName','key','model','password','salt','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','sequelize','lower','col','options','count','include','params','differenceBy','rawAttributes','includeAll','bulkCreate','body','describe','addContacts','ids','agent','agent\x20role','admin','telephones','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','Setting','findById','securePassword','min_internal','max','internal','QueryTypes','SELECT','from','VoiceMail','fullname','permissions','102','103','113','110','104','105','106','107','108','109','100','111','114','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Telephones','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','voicePause','isValidChannel','Unknown\x20channel','add','penalty','spread','capitalize','toLowerCase','QueueId','emit','Queue:save','voice','VoiceQueue','online','push','interface','each','UserVoiceQueueRt','upsert','removeQueues','Queues','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','server/files/images/','download','CmContact','hasOwnProperty','CmList','List','Tag','Tags','color','tag','getContacts','Queue','findAll','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','rows','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','SIP/%s','headers','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','all','getChannels','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause'];(function(_0x35324e,_0x3e9c63){var _0x426e6b=function(_0x2a30b5){while(--_0x2a30b5){_0x35324e['push'](_0x35324e['shift']());}};_0x426e6b(++_0x3e9c63);}(_0x923a,0x1de));var _0xa923=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x923a[_0x178e48];return _0x440d7e;};'use strict';var pdf=require(_0xa923('0x0'));var emlformat=require(_0xa923('0x1'));var rimraf=require(_0xa923('0x2'));var zipdir=require(_0xa923('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa923('0x4'));var moment=require('moment');var BPromise=require(_0xa923('0x5'));var Mustache=require(_0xa923('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa923('0x7'));var fs=require('fs');var _=require(_0xa923('0x8'));var squel=require('squel');var crypto=require(_0xa923('0x9'));var jsforce=require(_0xa923('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa923('0xb'));var querystring=require(_0xa923('0xc'));var Papa=require('papaparse');var Redis=require(_0xa923('0xd'));var authService=require(_0xa923('0xe'));var qs=require(_0xa923('0xf'));var as=require(_0xa923('0x10'));var hardwareService=require(_0xa923('0x11'));var logger=require(_0xa923('0x12'))(_0xa923('0x13'));var utils=require('../../config/utils');var config=require(_0xa923('0x14'));var db=require(_0xa923('0x15'))['db'];config[_0xa923('0x16')]=_[_0xa923('0x17')](config[_0xa923('0x16')],{'host':_0xa923('0x18'),'port':0x18eb});var socket=require(_0xa923('0x19'))(new Redis(config[_0xa923('0x16')]));require(_0xa923('0x1a'))[_0xa923('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa923('0x1c')][_0xa923('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3076d3,_0x2ed7aa,_0x1d52a0){if(_0x1d52a0){var _0x4a14fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a14fc[_0xa923('0x1e')](_0x2ed7aa)){return _0x3076d3;}else{throw new db[(_0xa923('0x1f'))][(_0xa923('0x20'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3076d3;}}function respondWithRpcPromise(_0x1dda94,_0x50dd83,_0x104880,_0x5a30c1){return new BPromise(function(_0x4ec809,_0x561c62){var _0x1945a4=_0x5a30c1||client;return _0x1945a4[_0xa923('0x21')](_0x1dda94,_0x104880)[_0xa923('0x22')](function(_0x4099bf){logger[_0xa923('0x23')](_0xa923('0x24'),_0x50dd83,_0xa923('0x25'));logger['debug'](_0xa923('0x26'),_0x50dd83,_0xa923('0x25'),JSON[_0xa923('0x27')](_0x4099bf));if(_0x4099bf[_0xa923('0x28')]){if(_0x4099bf[_0xa923('0x28')][_0xa923('0x29')]===0x1f4){logger[_0xa923('0x28')]('User,\x20%s,\x20%s',_0x50dd83,_0x4099bf['error'][_0xa923('0x2a')]);return _0x561c62(_0x4099bf[_0xa923('0x28')][_0xa923('0x2a')]);}logger[_0xa923('0x28')](_0xa923('0x24'),_0x50dd83,_0x4099bf[_0xa923('0x28')][_0xa923('0x2a')]);return _0x4ec809(_0x4099bf[_0xa923('0x28')][_0xa923('0x2a')]);}else{logger[_0xa923('0x23')](_0xa923('0x24'),_0x50dd83,_0xa923('0x25'));_0x4ec809(_0x4099bf[_0xa923('0x2b')][_0xa923('0x2a')]);}})[_0xa923('0x2c')](function(_0x1b526a){logger[_0xa923('0x28')](_0xa923('0x24'),_0x50dd83,_0x1b526a);_0x561c62(_0x1b526a);});});}function respondWithStatusCode(_0x3ff34f,_0x3352c7){_0x3352c7=_0x3352c7||0xcc;return function(_0xcd0df0){if(_0xcd0df0){return _0x3ff34f[_0xa923('0x2d')](_0x3352c7);}return _0x3ff34f['status'](_0x3352c7)[_0xa923('0x2e')]();};}function respondWithResult(_0x400813,_0x38674c){_0x38674c=_0x38674c||0xc8;return function(_0x3be5f8){if(_0x3be5f8){return _0x400813[_0xa923('0x2f')](_0x38674c)[_0xa923('0x30')](_0x3be5f8);}};}function respondWithFilteredResult(_0x20a1bd,_0x347f04){return function(_0x5130b3){if(_0x5130b3){var _0x551e50=_0x5130b3['count'],_0x68af9b=_0x347f04['offset'],_0x104627=_0x347f04[_0xa923('0x31')]+_0x347f04[_0xa923('0x32')],_0x389171;if(_0x104627>=_0x551e50){_0x104627=_0x551e50;_0x389171=0xc8;}else{_0x389171=0xce;}_0x20a1bd[_0xa923('0x2f')](_0x389171);return _0x20a1bd[_0xa923('0x33')](_0xa923('0x34'),_0x68af9b+'-'+_0x104627+'/'+_0x551e50)[_0xa923('0x30')](_0x5130b3);}return null;};}function patchUpdates(_0x1bcc02){return function(_0x35b616){try{jsonpatch['apply'](_0x35b616,_0x1bcc02,!![]);}catch(_0x4a5f38){return BPromise['reject'](_0x4a5f38);}return _0x35b616[_0xa923('0x35')]();};}function saveUpdates(_0xb79333,_0x450d47){return function(_0x4f8aa0){if(_0x4f8aa0){return _0x4f8aa0[_0xa923('0x36')](_0xb79333)['then'](function(_0x28707){return _0x28707;});}return null;};}function removeEntity(_0x474936,_0x484e8f){return function(_0x301fb2){if(_0x301fb2){return _0x301fb2['destroy']()[_0xa923('0x22')](function(){var _0x25708b=_0x301fb2['get']({'plain':!![]});var _0x2b4121=[{'name':_0xa923('0x37'),'value':_0xa923('0x38'),'ignore':!![]},{'name':_0xa923('0x39'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0xa923('0x3a'),'ignore':![]}];var _0x18c0a6=_(_0x2b4121)[_0xa923('0x3b')]('ignore')['map'](_0xa923('0x3c'))[_0xa923('0x3c')]();if(_['includes'](_0x18c0a6,_0x25708b[_0xa923('0x3d')])){return;}var _0x2f6039=_[_0xa923('0x3e')](_0x2b4121,[_0xa923('0x3c'),_0x25708b['role']])[_0xa923('0x3f')];return db[_0xa923('0x40')][_0xa923('0x41')]({'where':{'type':_0x2f6039,'resourceId':_0x25708b['id']}})[_0xa923('0x22')](function(){return _0x301fb2;});})[_0xa923('0x22')](function(){_0x474936[_0xa923('0x2f')](0xcc)[_0xa923('0x2e')]();});}};}function handleEntityNotFound(_0x25d5cc,_0x28a500){return function(_0x324b42){if(!_0x324b42){_0x25d5cc['sendStatus'](0x194);}return _0x324b42;};}function handleError(_0x490f2a,_0x5a2cbf){_0x5a2cbf=_0x5a2cbf||0x1f4;return function(_0x591784){logger[_0xa923('0x28')](_0x591784[_0xa923('0x42')]);if(_0x591784[_0xa923('0x3f')]){delete _0x591784['name'];}_0x490f2a[_0xa923('0x2f')](_0x5a2cbf)[_0xa923('0x43')](_0x591784);};}exports[_0xa923('0x44')]=function(_0x52db90,_0x360198){var _0x108837={},_0x1a4dc3={},_0x1a7e9c={'count':0x0,'rows':[]};var _0x59f129=_[_0xa923('0x45')](db[_0xa923('0x46')]['rawAttributes'],function(_0x14cae8){return{'name':_0x14cae8[_0xa923('0x47')],'type':_0x14cae8['type'][_0xa923('0x48')]};});_0x1a4dc3[_0xa923('0x49')]=_['differenceBy'](_[_0xa923('0x45')](_0x59f129,_0xa923('0x3f')),[_0xa923('0x4a'),_0xa923('0x4b')]);_0x1a4dc3[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x52db90[_0xa923('0x4c')]);_0x1a4dc3[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x1a4dc3['model'],_0x1a4dc3['query']);_0x108837['attributes']=_['intersection'](_0x1a4dc3['model'],qs[_0xa923('0x50')](_0x52db90[_0xa923('0x4c')][_0xa923('0x50')]));_0x108837[_0xa923('0x51')]=_0x108837[_0xa923('0x51')][_0xa923('0x52')]?_0x108837[_0xa923('0x51')]:_0x1a4dc3[_0xa923('0x49')];if(!_0x52db90[_0xa923('0x4c')]['hasOwnProperty'](_0xa923('0x53'))){_0x108837[_0xa923('0x32')]=qs['limit'](_0x52db90[_0xa923('0x4c')]['limit']);_0x108837[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x52db90[_0xa923('0x4c')][_0xa923('0x31')]);}_0x108837[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x52db90[_0xa923('0x4c')]['sort']);_0x108837[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x52db90[_0xa923('0x4c')],_0x1a4dc3[_0xa923('0x4e')]),_0x59f129);if(_0x52db90[_0xa923('0x4c')]['filter']){_0x108837[_0xa923('0x56')]=_[_0xa923('0x58')](_0x108837[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x59f129,function(_0x156ca7){if(_0x156ca7[_0xa923('0x59')]!==_0xa923('0x5a')){return db[_0xa923('0x5b')]['where'](db[_0xa923('0x5b')]['fn'](_0xa923('0x5c'),db[_0xa923('0x5b')][_0xa923('0x5d')](_0x156ca7[_0xa923('0x3f')])),{'$like':db[_0xa923('0x5b')]['fn'](_0xa923('0x5c'),'%'+_0x52db90[_0xa923('0x4c')][_0xa923('0x3b')]+'%')});}})});}_0x108837=_[_0xa923('0x58')]({},_0x108837,_0x52db90[_0xa923('0x5e')]);var _0x155ac1={'where':_0x108837[_0xa923('0x56')]};return db[_0xa923('0x46')]['count'](_0x155ac1)[_0xa923('0x22')](function(_0x2576a3){_0x1a7e9c[_0xa923('0x5f')]=_0x2576a3;if(_0x52db90['query']['includeAll']){_0x108837[_0xa923('0x60')]=[{'all':!![]}];}return db[_0xa923('0x46')]['findAll'](_0x108837);})[_0xa923('0x22')](function(_0x2fe4da){_0x1a7e9c['rows']=_0x2fe4da;return _0x1a7e9c;})[_0xa923('0x22')](respondWithFilteredResult(_0x360198,_0x108837))['catch'](handleError(_0x360198,null));};exports['show']=function(_0x21ef25,_0x544d74){var _0x3043cf={'raw':![],'where':{'id':_0x21ef25[_0xa923('0x61')]['id']}},_0x1d2996={};_0x1d2996[_0xa923('0x49')]=_[_0xa923('0x62')](_[_0xa923('0x4d')](db[_0xa923('0x46')][_0xa923('0x63')]),['password','salt']);_0x1d2996['query']=_[_0xa923('0x4d')](_0x21ef25[_0xa923('0x4c')]);_0x1d2996['filters']=_[_0xa923('0x4f')](_0x1d2996['model'],_0x1d2996[_0xa923('0x4c')]);_0x3043cf[_0xa923('0x51')]=_['intersection'](_0x1d2996[_0xa923('0x49')],qs[_0xa923('0x50')](_0x21ef25[_0xa923('0x4c')][_0xa923('0x50')]));_0x3043cf[_0xa923('0x51')]=_0x3043cf[_0xa923('0x51')][_0xa923('0x52')]?_0x3043cf[_0xa923('0x51')]:_0x1d2996[_0xa923('0x49')];if(_0x21ef25['query'][_0xa923('0x64')]){_0x3043cf[_0xa923('0x60')]=[{'all':!![]}];}_0x3043cf=_[_0xa923('0x58')]({},_0x3043cf,_0x21ef25[_0xa923('0x5e')]);return db[_0xa923('0x46')][_0xa923('0x3e')](_0x3043cf)[_0xa923('0x22')](handleEntityNotFound(_0x544d74,null))[_0xa923('0x22')](respondWithResult(_0x544d74,null))[_0xa923('0x2c')](handleError(_0x544d74,null));};exports[_0xa923('0x65')]=function(_0x357e85,_0x1d3067){return db[_0xa923('0x46')]['bulkCreate'](_0x357e85[_0xa923('0x66')],{'raw':![],'individualHooks':!![]})[_0xa923('0x22')](respondWithResult(_0x1d3067,0xc9))[_0xa923('0x2c')](handleError(_0x1d3067,null));};exports[_0xa923('0x36')]=function(_0x50e99f,_0x48e388){if(_0x50e99f['body']['id']){delete _0x50e99f['body']['id'];}delete _0x50e99f[_0xa923('0x66')][_0xa923('0x3d')];return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x50e99f['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x48e388,null))[_0xa923('0x22')](saveUpdates(_0x50e99f[_0xa923('0x66')],null))[_0xa923('0x22')](respondWithResult(_0x48e388,null))[_0xa923('0x2c')](handleError(_0x48e388,null));};exports[_0xa923('0x67')]=function(_0x397ae2,_0x123242){return db[_0xa923('0x46')][_0xa923('0x67')]()[_0xa923('0x22')](respondWithResult(_0x123242,null))[_0xa923('0x2c')](handleError(_0x123242,null));};exports[_0xa923('0x68')]=function(_0x3cab31,_0x404d51,_0x4a05e7){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x3cab31[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x404d51,null))['then'](function(_0x50e0b1){if(_0x50e0b1){return _0x50e0b1[_0xa923('0x68')](_0x3cab31[_0xa923('0x66')][_0xa923('0x69')],_['omit'](_0x3cab31['body'],['ids','id'])||{});}})[_0xa923('0x22')](respondWithResult(_0x404d51,null))[_0xa923('0x2c')](handleError(_0x404d51,null));};var getLicense=function(_0x41e28){return new BPromise(function(_0x204b9c,_0x21b950){var _0xe2d2f1=0x0;_0x41e28[_0xa923('0x66')][_0xa923('0x3d')]===_0xa923('0x6a')&&_0x204b9c(_0xa923('0x6b'));return db[_0xa923('0x46')]['count']({'where':{'$or':[{'role':_0x41e28[_0xa923('0x66')][_0xa923('0x3d')]==='telephone'?_0xa923('0x3a'):[_0xa923('0x6c'),_0xa923('0x38')]}]}})[_0xa923('0x22')](function(_0x99c37){_0xe2d2f1=_0x99c37;return require('../../config/license/util')['getLicense']();})['then'](function(_0x4e7433){var _0x51d16b=_0x41e28['body']['role']===_0xa923('0x3a')?_0xa923('0x6d'):_0xa923('0x6e');if(!_[_0xa923('0x6f')](_0x4e7433[_0x51d16b])&&_0xe2d2f1>=_0x4e7433[_0x51d16b]){return _0x21b950({'message':_0xa923('0x70')});}return _0x204b9c(util[_0xa923('0x71')](_0xa923('0x72'),_0x51d16b,_0xe2d2f1));})[_0xa923('0x2c')](function(_0x4dc7a3){return _0x21b950(_0x4dc7a3);});});};exports[_0xa923('0x73')]=function(_0x10fa79,_0x5d9a6d){return getLicense(_0x10fa79)['then'](function(_0xbb7d78){if(!_0x10fa79[_0xa923('0x66')]['internal']){var _0x4b5427;return db[_0xa923('0x74')][_0xa923('0x75')](0x1)[_0xa923('0x22')](function(_0xe74368){return checkPasswordPattern(_0xe74368,_0x10fa79[_0xa923('0x66')][_0xa923('0x4a')],_0xe74368[_0xa923('0x76')]);})['then'](function(_0x33efd9){_0x4b5427=_0x33efd9[_0xa923('0x77')];return db[_0xa923('0x46')][_0xa923('0x78')]('internal');})['then'](function(_0x17db43){if(_[_0xa923('0x6f')](_0x17db43)){if(_0x4b5427){_0x10fa79[_0xa923('0x66')][_0xa923('0x79')]=_0x4b5427;}else{_0x10fa79[_0xa923('0x66')][_0xa923('0x79')]=0x1;}}else{if(_[_0xa923('0x6f')](_0x4b5427)||_0x4b5427==_0x17db43){_0x10fa79[_0xa923('0x66')][_0xa923('0x79')]=_0x17db43+0x1;}else if(_0x4b5427>_0x17db43){_0x10fa79[_0xa923('0x66')][_0xa923('0x79')]=_0x4b5427;}else{return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xa923('0x5b')][_0xa923('0x7a')][_0xa923('0x7b')]})[_0xa923('0x22')](function(_0x3c2124){if(_0x3c2124&&_0x3c2124[_0xa923('0x52')]){for(var _0x3d5d83=0x0,_0x490af7=_0x3c2124[_0xa923('0x52')];_0x3d5d83<_0x490af7&&_[_0xa923('0x6f')](_0x10fa79[_0xa923('0x66')][_0xa923('0x79')]);_0x3d5d83++){if(_0x4b5427<=_0x3c2124[_0x3d5d83]['from']){_0x10fa79[_0xa923('0x66')][_0xa923('0x79')]=_0x3c2124[_0x3d5d83][_0xa923('0x7c')];}else if(_0x4b5427>_0x3c2124[_0x3d5d83][_0xa923('0x7c')]&&_0x4b5427<=_0x3c2124[_0x3d5d83]['to']){_0x10fa79['body']['internal']=_0x4b5427;}}}if(_['isNil'](_0x10fa79[_0xa923('0x66')]['internal'])){_0x10fa79[_0xa923('0x66')]['internal']=_0x17db43+0x1;}});}}});}})['then'](function(){if(_0x10fa79[_0xa923('0x66')]['voicemail']){_0x10fa79[_0xa923('0x66')]['mailbox']=_0x10fa79[_0xa923('0x66')]['internal'];_0x10fa79['body'][_0xa923('0x7d')]={'mailbox':_0x10fa79[_0xa923('0x66')][_0xa923('0x79')],'password':_0x10fa79[_0xa923('0x66')][_0xa923('0x4a')],'fullname':_0x10fa79[_0xa923('0x66')][_0xa923('0x7e')],'email':_0x10fa79[_0xa923('0x66')]['email']};}if(_0x10fa79[_0xa923('0x66')]&&_0x10fa79[_0xa923('0x66')][_0xa923('0x3d')]===_0xa923('0x6a')){if(!_0x10fa79[_0xa923('0x66')][_0xa923('0x7f')]){_0x10fa79[_0xa923('0x66')]['permissions']=['101',_0xa923('0x80'),_0xa923('0x81'),_0xa923('0x82'),_0xa923('0x83'),_0xa923('0x84'),_0xa923('0x85'),_0xa923('0x86'),_0xa923('0x87'),_0xa923('0x88'),_0xa923('0x89'),_0xa923('0x8a'),_0xa923('0x8b'),_0xa923('0x8c')];}}return db[_0xa923('0x46')][_0xa923('0x73')](_0x10fa79[_0xa923('0x66')],{'include':[{'model':db[_0xa923('0x7d')],'as':_0xa923('0x7d')}]});})[_0xa923('0x22')](function(_0x25ebc5){if(_0x10fa79[_0xa923('0x66')][_0xa923('0x3d')]===_0xa923('0x38'))return _0x25ebc5;var _0x596660=_0x10fa79['user'][_0xa923('0x8d')]({'plain':!![]});if(!_0x596660)throw new Error(_0xa923('0x8e'));if(_0x596660[_0xa923('0x3d')]==='user'){var _0x4cb278=_0x25ebc5[_0xa923('0x8d')]({'plain':!![]});var _0x132e1d=[{'name':'Agents','value':_0xa923('0x6a')},{'name':_0xa923('0x8f'),'value':_0xa923('0x3a')}];var _0x5da3e3=_[_0xa923('0x3e')](_0x132e1d,[_0xa923('0x3c'),_0x4cb278[_0xa923('0x3d')]])['name'];return db['UserProfileSection'][_0xa923('0x3e')]({'where':{'name':_0x5da3e3,'userProfileId':_0x596660[_0xa923('0x90')]},'raw':!![]})[_0xa923('0x22')](function(_0x4ab3a5){if(_0x4ab3a5&&_0x4ab3a5['autoAssociation']===0x0){return db[_0xa923('0x40')]['create']({'name':_0x4cb278['name'],'resourceId':_0x4cb278['id'],'type':_0x4ab3a5[_0xa923('0x3f')],'sectionId':_0x4ab3a5['id']},{})[_0xa923('0x22')](function(){return _0x25ebc5;});}else{return _0x25ebc5;}})[_0xa923('0x2c')](function(_0x57fc44){logger[_0xa923('0x28')](_0xa923('0x91'),_0x57fc44);throw _0x57fc44;});}return _0x25ebc5;})[_0xa923('0x22')](respondWithResult(_0x5d9a6d,0xc9))['catch'](handleError(_0x5d9a6d,null));};exports[_0xa923('0x92')]=function(_0x395828,_0x5e0d57,_0x2f3f8c){var _0x8124e2=![];if(_0x395828['body']['id']){delete _0x395828[_0xa923('0x66')]['id'];}return db[_0xa923('0x74')][_0xa923('0x93')]({'attributes':['id',_0xa923('0x76')]})[_0xa923('0x22')](function(_0x4b455a){_0x8124e2=_0x4b455a[_0xa923('0x76')];return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x395828[_0xa923('0x61')]['id']}});})[_0xa923('0x22')](function(_0x1a6615){if(_0x1a6615){if(_0x1a6615['id']==_0x395828['user']['id']){if(!_0x395828[_0xa923('0x66')][_0xa923('0x94')]||!_0x395828[_0xa923('0x66')][_0xa923('0x95')]){throw new db['Sequelize']['ValidationError'](_0xa923('0x96'));}if(!_0x1a6615[_0xa923('0x97')](_0x395828[_0xa923('0x66')][_0xa923('0x94')])){throw new db[(_0xa923('0x1f'))][(_0xa923('0x20'))](_0xa923('0x98'));}if(_0x395828['body']['oldPassword']==_0x395828[_0xa923('0x66')][_0xa923('0x95')]){throw new db[(_0xa923('0x1f'))][(_0xa923('0x20'))](_0xa923('0x99'));}return _0x1a6615;}else if(_0x395828['user'][_0xa923('0x3d')]==_0xa923('0x6c')){if(!_0x395828[_0xa923('0x66')]['newPassword']){throw new db[(_0xa923('0x1f'))][(_0xa923('0x20'))](_0xa923('0x9a'));}return _0x1a6615;}else if(_0x395828[_0xa923('0x38')]['role']==_0xa923('0x38')){if(!_0x395828[_0xa923('0x66')][_0xa923('0x95')]){throw new db[(_0xa923('0x1f'))]['ValidationError'](_0xa923('0x9a'));}if(_0x1a6615[_0xa923('0x3d')]!=_0xa923('0x6a')){throw new db['Sequelize'][(_0xa923('0x20'))](_0xa923('0x9b'));}return _0x1a6615;}else{throw new db['Sequelize'][(_0xa923('0x20'))](_0xa923('0x9b'));}}return null;})['then'](handleEntityNotFound(_0x5e0d57,null))['then'](function(_0x11ecc4){return checkPasswordPattern(_0x11ecc4,_0x395828[_0xa923('0x66')][_0xa923('0x95')],_0x8124e2);})['then'](saveUpdates({'password':_0x395828['body'][_0xa923('0x95')],'passwordResetAt':_0x395828[_0xa923('0x38')]['id']==_0x395828['params']['id']?moment():null},null))[_0xa923('0x22')](respondWithResult(_0x5e0d57,null))[_0xa923('0x2c')](handleError(_0x5e0d57,null));};exports['addQueues']=function(_0x1863d2,_0x183b51,_0x14aa62){var _0x35c67c=_0x1863d2[_0xa923('0x66')][_0xa923('0x9c')];return db['User']['find']({'where':{'id':_0x1863d2['params']['id']},'attributes':['id',_0xa923('0x3f'),'role','online','loginInPause',_0xa923('0x9d'),'interface']})['then'](handleEntityNotFound(_0x183b51,null))[_0xa923('0x22')](function(_0x5ebe9f){if(_0x5ebe9f){if(!utils[_0xa923('0x9e')](_0x35c67c)){throw new db[(_0xa923('0x1f'))][(_0xa923('0x20'))](_0xa923('0x9f'));}return _0x5ebe9f[_0xa923('0xa0')+_['capitalize'](_0x35c67c['toLowerCase']())+'Queues'](_0x1863d2['body'][_0xa923('0x69')],{'penalty':_0x1863d2[_0xa923('0x66')][_0xa923('0xa1')]||0x0})[_0xa923('0xa2')](function(_0x23e4fe){for(var _0x3eafe4=0x0;_0x3eafe4<_0x1863d2[_0xa923('0x66')][_0xa923('0x69')][_0xa923('0x52')];_0x3eafe4+=0x1){var _0x5e9f05={'UserId':_0x1863d2[_0xa923('0x61')]['id']};_0x5e9f05[_[_0xa923('0xa3')](_0x35c67c[_0xa923('0xa4')]())+_0xa923('0xa5')]=_0x1863d2['body']['ids'][_0x3eafe4];socket[_0xa923('0xa6')](_0xa923('0x38')+_[_0xa923('0xa3')](_0x35c67c[_0xa923('0xa4')]())+_0xa923('0xa7'),_0x5e9f05);}return _0x23e4fe;})[_0xa923('0x22')](function(){if(_0x35c67c===_0xa923('0xa8')){return db[_0xa923('0xa9')]['findAll']({'where':{'id':_0x1863d2['body'][_0xa923('0x69')]||[]},'raw':!![],'attributes':['id',_0xa923('0x3f')]});}})[_0xa923('0x22')](function(_0x59ef4a){var _0x571a32=_0x5ebe9f[_0xa923('0x8d')]({'plain':!![]});var _0x11a26a=[];if(_0x35c67c===_0xa923('0xa8')&&_0x571a32['role']==='agent'&&_0x571a32[_0xa923('0xaa')]){for(var _0x5e22db=0x0;_0x5e22db<_0x59ef4a['length'];_0x5e22db+=0x1){_0x11a26a[_0xa923('0xab')]({'membername':_0x571a32['name'],'UserId':_0x571a32['id'],'queue_name':_0x59ef4a[_0x5e22db]['name'],'VoiceQueueId':_0x59ef4a[_0x5e22db]['id'],'interface':_[_0xa923('0x6f')](_0x571a32[_0xa923('0xac')])?util[_0xa923('0x71')]('SIP/%s',_0x571a32[_0xa923('0x3f')]):_0x571a32[_0xa923('0xac')],'paused':_0x571a32[_0xa923('0x9d')]||![],'penalty':_0x1863d2[_0xa923('0x66')][_0xa923('0xa1')]||0x0});}return BPromise[_0xa923('0xad')](_0x11a26a,function(_0x34a819){return db[_0xa923('0xae')][_0xa923('0xaf')](_0x34a819);});}return _0x5ebe9f;});}})['then'](respondWithStatusCode(_0x183b51,null))['catch'](handleError(_0x183b51,null));};exports[_0xa923('0xb0')]=function(_0x29a716,_0x1022c2,_0x3081d5){var _0x431f01;return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x29a716[_0xa923('0x61')]['id']},'attributes':['id',_0xa923('0x3f'),_0xa923('0x3d')]})[_0xa923('0x22')](handleEntityNotFound(_0x1022c2,null))[_0xa923('0x22')](function(_0x3fe7b2){if(_0x3fe7b2){_0x431f01=_0x3fe7b2;if(!_0x29a716[_0xa923('0x4c')]['channel']||!utils[_0xa923('0x9e')](_0x29a716[_0xa923('0x4c')]['channel'])){throw new db[(_0xa923('0x1f'))]['ValidationError']('Unknown\x20channel');}return _0x3fe7b2['remove'+_[_0xa923('0xa3')](_0x29a716['query'][_0xa923('0x9c')][_0xa923('0xa4')]())+_0xa923('0xb1')](_0x29a716[_0xa923('0x4c')][_0xa923('0x69')]);}})[_0xa923('0x22')](function(_0x5753e3){for(var _0x3ccf07=0x0;_0x3ccf07<_0x29a716['query'][_0xa923('0x69')][_0xa923('0x52')];_0x3ccf07+=0x1){var _0x439ca0={'UserId':_0x29a716[_0xa923('0x61')]['id']};_0x439ca0[_['capitalize'](_0x29a716[_0xa923('0x4c')]['channel'][_0xa923('0xa4')]())+_0xa923('0xa5')]=_0x29a716['query'][_0xa923('0x69')][_0x3ccf07];socket[_0xa923('0xa6')](_0xa923('0x38')+_[_0xa923('0xa3')](_0x29a716[_0xa923('0x4c')][_0xa923('0x9c')][_0xa923('0xa4')]())+'Queue:remove',_0x439ca0);}return _0x5753e3;})[_0xa923('0x22')](function(){if(_0x29a716[_0xa923('0x4c')][_0xa923('0x9c')]==='voice'){return db[_0xa923('0xae')]['destroy']({'where':{'UserId':_0x29a716[_0xa923('0x61')]['id'],'VoiceQueueId':_0x29a716[_0xa923('0x4c')][_0xa923('0x69')]},'individualHooks':!![]})[_0xa923('0x22')](function(){return _0x431f01;});}return _0x431f01;})[_0xa923('0x22')](respondWithStatusCode(_0x1022c2,null))[_0xa923('0x2c')](handleError(_0x1022c2,null));};exports['addAvatar']=function(_0x15a603,_0x1007d6,_0x4e40e9){_0x15a603['body'][_0xa923('0xb2')]=_0x15a603[_0xa923('0xb3')][_0xa923('0xb4')];return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x15a603[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x1007d6,null))['then'](saveUpdates(_0x15a603['body'],null))[_0xa923('0x22')](respondWithResult(_0x1007d6,null))[_0xa923('0x2c')](handleError(_0x1007d6,null));};exports['getAvatar']=function(_0x55fef6,_0x22cc60,_0x1aed31){var _0x4694a9=path[_0xa923('0xb5')](config[_0xa923('0xb6')],_0xa923('0xb7'));return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x55fef6[_0xa923('0x61')]['id']},'attributes':['id',_0xa923('0xb2')],'raw':!![]})[_0xa923('0x22')](handleEntityNotFound(_0x22cc60,null))[_0xa923('0x22')](function(_0xcd59e2){if(_0xcd59e2){if(_[_0xa923('0x6f')](_0xcd59e2[_0xa923('0xb2')])){return _0x22cc60['download'](_0x4694a9);}else{if(!fs['existsSync'](path[_0xa923('0xb5')](config['root'],_0xa923('0xb8'),_0xcd59e2[_0xa923('0xb2')]))){return _0x22cc60[_0xa923('0xb9')](_0x4694a9);}return _0x22cc60[_0xa923('0xb9')](path[_0xa923('0xb5')](config[_0xa923('0xb6')],'server/files/images/',_0xcd59e2['userpic']));}}})[_0xa923('0x2c')](handleError(_0x22cc60,null));};exports['getContacts']=function(_0x4216d7,_0x4240c1,_0x359dae){var _0x1a9637={};var _0x4530a6={};var _0x5cedb1;var _0x750713;return db[_0xa923('0x46')]['findOne']({'where':{'id':_0x4216d7[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x4240c1,null))[_0xa923('0x22')](function(_0x100cd7){if(_0x100cd7){_0x5cedb1=_0x100cd7;_0x4530a6['model']=_['keys'](db[_0xa923('0xba')][_0xa923('0x63')]);_0x4530a6[_0xa923('0x4c')]=_['keys'](_0x4216d7['query']);_0x4530a6[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x4530a6[_0xa923('0x49')],_0x4530a6[_0xa923('0x4c')]);_0x1a9637[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x4530a6[_0xa923('0x49')],qs[_0xa923('0x50')](_0x4216d7[_0xa923('0x4c')]['fields']));_0x1a9637[_0xa923('0x51')]=_0x1a9637['attributes'][_0xa923('0x52')]?_0x1a9637['attributes']:_0x4530a6['model'];_0x1a9637[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x4216d7['query'][_0xa923('0x55')]);_0x1a9637[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x4216d7[_0xa923('0x4c')],_0x4530a6[_0xa923('0x4e')]));if(_0x4216d7[_0xa923('0x4c')][_0xa923('0x3b')]){_0x1a9637['where']=_[_0xa923('0x58')](_0x1a9637['where'],{'$or':_[_0xa923('0x45')](_0x1a9637[_0xa923('0x51')],function(_0x54685e){var _0x1cfea0={};_0x1cfea0[_0x54685e]={'$like':'%'+_0x4216d7['query'][_0xa923('0x3b')]+'%'};return _0x1cfea0;})});}_0x1a9637=_[_0xa923('0x58')]({},_0x1a9637,_0x4216d7[_0xa923('0x5e')]);return _0x5cedb1['getContacts'](_0x1a9637);}})[_0xa923('0x22')](function(_0x1f826e){if(_0x1f826e){_0x750713=_0x1f826e[_0xa923('0x52')];if(_0x4216d7['query'][_0xa923('0xbb')]('includeAll')){_0x1a9637[_0xa923('0x60')]=[{'model':db[_0xa923('0xbc')],'as':_0xa923('0xbd'),'required':![]},{'model':db[_0xa923('0xbe')],'as':_0xa923('0xbf'),'attributes':['id','name',_0xa923('0xc0')],'where':_0x4216d7[_0xa923('0x4c')][_0xa923('0xc1')]?{'id':_0x4216d7[_0xa923('0x4c')][_0xa923('0xc1')]}:undefined,'required':_0x4216d7[_0xa923('0x4c')]['tag']?!![]:![]}];}if(!_0x4216d7[_0xa923('0x4c')][_0xa923('0xbb')]('nolimit')){_0x1a9637['limit']=qs[_0xa923('0x32')](_0x4216d7[_0xa923('0x4c')][_0xa923('0x32')]);_0x1a9637['offset']=qs['offset'](_0x4216d7[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x5cedb1[_0xa923('0xc2')](_0x1a9637);}})[_0xa923('0x22')](function(_0x52948d){if(_0x52948d){return _0x52948d?{'count':_0x750713,'rows':_0x52948d}:null;}})['then'](respondWithResult(_0x4240c1,null))['catch'](handleError(_0x4240c1,null));};exports['getQueues']=function(_0x40d0c5,_0x119738,_0x1517b4){var _0x4494da;var _0x96c64;var _0x29a931={};var _0xb4e47f;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x40d0c5[_0xa923('0x61')]['id']},'attributes':['id','name',_0xa923('0x3d')]})['then'](handleEntityNotFound(_0x119738,null))['then'](function(_0x8e5800){if(!utils[_0xa923('0x9e')](_0x40d0c5[_0xa923('0x4c')][_0xa923('0x9c')])){throw new db[(_0xa923('0x1f'))][(_0xa923('0x20'))](_0xa923('0x9f'));}_0x4494da=_0x8e5800;var _0x191772={};_0x191772['model']=_[_0xa923('0x4d')](db[_[_0xa923('0xa3')](_0x40d0c5[_0xa923('0x4c')][_0xa923('0x9c')])+_0xa923('0xc3')][_0xa923('0x63')]);_0x191772['query']=_[_0xa923('0x4d')](_0x40d0c5[_0xa923('0x4c')]);_0x191772[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x191772[_0xa923('0x49')],_0x191772[_0xa923('0x4c')]);_0x29a931[_0xa923('0x51')]=_['intersection'](_0x191772[_0xa923('0x49')],qs['fields'](_0x40d0c5[_0xa923('0x4c')][_0xa923('0x50')]));_0x29a931[_0xa923('0x51')]=_0x29a931[_0xa923('0x51')]['length']?_0x29a931[_0xa923('0x51')]:_0x191772[_0xa923('0x49')];_0x29a931[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x40d0c5[_0xa923('0x4c')][_0xa923('0x55')]);_0x29a931[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x40d0c5['query'],_0x191772[_0xa923('0x4e')]));if(_0x40d0c5[_0xa923('0x4c')][_0xa923('0x3b')]){_0x29a931[_0xa923('0x56')]=_[_0xa923('0x58')](_0x29a931[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x29a931['attributes'],function(_0x5996e8){var _0x18da9c={};_0x18da9c[_0x5996e8]={'$like':'%'+_0x40d0c5[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x18da9c;})});}_0x29a931=_[_0xa923('0x58')]({},_0x29a931,_0x40d0c5[_0xa923('0x5e')]);switch(_0x4494da['role']){case'admin':return db[_[_0xa923('0xa3')](_0x40d0c5[_0xa923('0x4c')][_0xa923('0x9c')])+_0xa923('0xc3')][_0xa923('0xc4')](_0x29a931);case'user':case _0xa923('0x6a'):return _0x4494da[_0xa923('0x8d')+_[_0xa923('0xa3')](_0x40d0c5[_0xa923('0x4c')][_0xa923('0x9c')])+'Queues'](_0x29a931);default:throw new db[(_0xa923('0x1f'))][(_0xa923('0x20'))]('Unknown\x20role');}})[_0xa923('0x22')](function(_0x45e117){_0xb4e47f=_0x45e117[_0xa923('0x52')];if(!_0x40d0c5[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x29a931[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x40d0c5[_0xa923('0x4c')][_0xa923('0x32')]);_0x29a931['offset']=qs['offset'](_0x40d0c5[_0xa923('0x4c')]['offset']);}switch(_0x4494da['role']){case _0xa923('0x6c'):return db[_[_0xa923('0xa3')](_0x40d0c5['query'][_0xa923('0x9c')])+_0xa923('0xc3')][_0xa923('0xc4')](_0x29a931);case _0xa923('0x38'):case _0xa923('0x6a'):return _0x4494da['get'+_[_0xa923('0xa3')](_0x40d0c5[_0xa923('0x4c')][_0xa923('0x9c')])+_0xa923('0xb1')](_0x29a931);}})[_0xa923('0x22')](function(_0x3b943d){return{'count':_0xb4e47f,'rows':_0x3b943d};})[_0xa923('0x22')](respondWithResult(_0x119738,null))[_0xa923('0x2c')](handleError(_0x119738,null));};exports[_0xa923('0xc5')]=function(_0x312817,_0xe3b846,_0x18da26){var _0x2530eb={};var _0x346dca={};var _0x25697d;var _0x4fcbff;return db['User'][_0xa923('0x93')]({'where':{'id':_0x312817[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0xe3b846,null))[_0xa923('0x22')](function(_0xbf09a3){if(_0xbf09a3){_0x25697d=_0xbf09a3;_0x346dca[_0xa923('0x49')]=_[_0xa923('0x4d')](db['UserVoiceQueueRt'][_0xa923('0x63')]);_0x346dca['query']=_[_0xa923('0x4d')](_0x312817[_0xa923('0x4c')]);_0x346dca['filters']=_[_0xa923('0x4f')](_0x346dca[_0xa923('0x49')],_0x346dca['query']);_0x2530eb[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x346dca[_0xa923('0x49')],qs[_0xa923('0x50')](_0x312817[_0xa923('0x4c')][_0xa923('0x50')]));_0x2530eb[_0xa923('0x51')]=_0x2530eb[_0xa923('0x51')][_0xa923('0x52')]?_0x2530eb[_0xa923('0x51')]:_0x346dca['model'];_0x2530eb[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x312817[_0xa923('0x4c')][_0xa923('0x55')]);_0x2530eb['where']=qs['filters'](_[_0xa923('0x57')](_0x312817['query'],_0x346dca[_0xa923('0x4e')]));if(_0x312817[_0xa923('0x4c')]['filter']){_0x2530eb[_0xa923('0x56')]=_['merge'](_0x2530eb[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x2530eb['attributes'],function(_0x5588ee){var _0x31423f={};_0x31423f[_0x5588ee]={'$like':'%'+_0x312817['query']['filter']+'%'};return _0x31423f;})});}_0x2530eb=_[_0xa923('0x58')]({},_0x2530eb,_0x312817['options']);return _0x25697d['getVoiceQueuesRt'](_0x2530eb);}})['then'](function(_0x42935b){if(_0x42935b){_0x4fcbff=_0x42935b[_0xa923('0x52')];if(!_0x312817[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x2530eb[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x312817[_0xa923('0x4c')][_0xa923('0x32')]);_0x2530eb[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x312817[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x25697d[_0xa923('0xc5')](_0x2530eb);}})[_0xa923('0x22')](function(_0x4666be){if(_0x4666be){return _0x4666be?{'count':_0x4fcbff,'rows':_0x4666be}:null;}})[_0xa923('0x22')](respondWithResult(_0xe3b846,null))[_0xa923('0x2c')](handleError(_0xe3b846,null));};exports[_0xa923('0xc6')]=function(_0xfe573a,_0x3e2cb3,_0x1557f8){var _0x5dddce={};var _0x2ef5b8={};var _0x85e3f3;var _0x12af32;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0xfe573a['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x3e2cb3,null))[_0xa923('0x22')](function(_0x5eeb3d){if(_0x5eeb3d){_0x85e3f3=_0x5eeb3d;_0x2ef5b8['model']=_['keys'](db[_0xa923('0xc7')][_0xa923('0x63')]);_0x2ef5b8[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0xfe573a[_0xa923('0x4c')]);_0x2ef5b8[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x2ef5b8[_0xa923('0x49')],_0x2ef5b8[_0xa923('0x4c')]);_0x5dddce[_0xa923('0x51')]=_['intersection'](_0x2ef5b8['model'],qs[_0xa923('0x50')](_0xfe573a['query']['fields']));_0x5dddce[_0xa923('0x51')]=_0x5dddce[_0xa923('0x51')][_0xa923('0x52')]?_0x5dddce[_0xa923('0x51')]:_0x2ef5b8[_0xa923('0x49')];_0x5dddce[_0xa923('0x54')]=qs['sort'](_0xfe573a[_0xa923('0x4c')]['sort']);_0x5dddce[_0xa923('0x56')]=qs[_0xa923('0x4e')](_['pick'](_0xfe573a[_0xa923('0x4c')],_0x2ef5b8[_0xa923('0x4e')]));if(_0xfe573a[_0xa923('0x4c')]['filter']){_0x5dddce[_0xa923('0x56')]=_['merge'](_0x5dddce[_0xa923('0x56')],{'$or':_['map'](_0x5dddce['attributes'],function(_0x44319e){var _0x471aad={};_0x471aad[_0x44319e]={'$like':'%'+_0xfe573a['query'][_0xa923('0x3b')]+'%'};return _0x471aad;})});}_0x5dddce=_[_0xa923('0x58')]({},_0x5dddce,_0xfe573a[_0xa923('0x5e')]);return _0x85e3f3[_0xa923('0xc6')](_0x5dddce);}})[_0xa923('0x22')](function(_0x5d2a96){if(_0x5d2a96){_0x12af32=_0x5d2a96[_0xa923('0x52')];if(!_0xfe573a[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x5dddce[_0xa923('0x32')]=qs[_0xa923('0x32')](_0xfe573a[_0xa923('0x4c')][_0xa923('0x32')]);_0x5dddce[_0xa923('0x31')]=qs[_0xa923('0x31')](_0xfe573a[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x85e3f3[_0xa923('0xc6')](_0x5dddce);}})['then'](function(_0x572e87){if(_0x572e87){return _0x572e87?{'count':_0x12af32,'rows':_0x572e87}:null;}})['then'](respondWithResult(_0x3e2cb3,null))[_0xa923('0x2c')](handleError(_0x3e2cb3,null));};exports['getRecordings']=function(_0x103643,_0x8f9a6e,_0x51d4b7){var _0x5cd175={'raw':!![],'where':{}};var _0x3a80b8={};var _0x37fdca={'count':0x0,'rows':[]};return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x103643[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x8f9a6e,null))[_0xa923('0x22')](function(_0x1c6a59){if(_0x1c6a59){_0x3a80b8[_0xa923('0x49')]=_['keys'](db[_0xa923('0xc8')][_0xa923('0x63')]);_0x3a80b8['query']=_[_0xa923('0x4d')](_0x103643[_0xa923('0x4c')]);_0x3a80b8[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x3a80b8[_0xa923('0x49')],_0x3a80b8[_0xa923('0x4c')]);_0x5cd175[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x3a80b8[_0xa923('0x49')],qs[_0xa923('0x50')](_0x103643[_0xa923('0x4c')]['fields']));_0x5cd175[_0xa923('0x51')]=_0x5cd175[_0xa923('0x51')][_0xa923('0x52')]?_0x5cd175['attributes']:_0x3a80b8['model'];if(!_0x103643[_0xa923('0x4c')]['hasOwnProperty'](_0xa923('0x53'))){_0x5cd175['limit']=qs[_0xa923('0x32')](_0x103643['query'][_0xa923('0x32')]);_0x5cd175[_0xa923('0x31')]=qs['offset'](_0x103643['query']['offset']);}_0x5cd175['order']=qs[_0xa923('0x55')](_0x103643[_0xa923('0x4c')][_0xa923('0x55')]);_0x5cd175['where']=qs[_0xa923('0x4e')](_['pick'](_0x103643[_0xa923('0x4c')],_0x3a80b8[_0xa923('0x4e')]));_0x5cd175['where'][_0xa923('0xc9')]=_0x1c6a59['id'];if(_0x103643['query']['filter']){_0x5cd175[_0xa923('0x56')]=_[_0xa923('0x58')](_0x5cd175['where'],{'$or':_[_0xa923('0x45')](_0x5cd175[_0xa923('0x51')],function(_0xaa9a96){var _0xe4f169={};_0xe4f169[_0xaa9a96]={'$like':'%'+_0x103643[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0xe4f169;})});}_0x5cd175=_[_0xa923('0x58')]({},_0x5cd175,_0x103643[_0xa923('0x5e')]);return db[_0xa923('0xc8')][_0xa923('0x5f')]({'where':_0x5cd175['where']})[_0xa923('0x22')](function(_0xf010e8){_0x37fdca['count']=_0xf010e8;if(_0x103643['query'][_0xa923('0x64')]){_0x5cd175[_0xa923('0x60')]=[{'all':!![]}];}return db[_0xa923('0xc8')][_0xa923('0xc4')](_0x5cd175);})['then'](function(_0x20e7db){_0x37fdca[_0xa923('0xca')]=_0x20e7db;return _0x37fdca;});}})[_0xa923('0x22')](respondWithFilteredResult(_0x8f9a6e,_0x5cd175))[_0xa923('0x2c')](handleError(_0x8f9a6e,null));};exports[_0xa923('0xcb')]=function(_0x32f1e6,_0x482d02,_0x22cf39){var _0xf00023={'raw':!![],'where':{}};var _0x2ab8ee={};var _0x211276={'count':0x0,'rows':[]};return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x32f1e6[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x482d02,null))[_0xa923('0x22')](function(_0x4f3ffe){if(_0x4f3ffe){_0x2ab8ee[_0xa923('0x49')]=_[_0xa923('0x4d')](db[_0xa923('0xcc')][_0xa923('0x63')]);_0x2ab8ee['query']=_[_0xa923('0x4d')](_0x32f1e6['query']);_0x2ab8ee[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x2ab8ee[_0xa923('0x49')],_0x2ab8ee[_0xa923('0x4c')]);_0xf00023[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x2ab8ee[_0xa923('0x49')],qs['fields'](_0x32f1e6[_0xa923('0x4c')][_0xa923('0x50')]));_0xf00023[_0xa923('0x51')]=_0xf00023[_0xa923('0x51')][_0xa923('0x52')]?_0xf00023[_0xa923('0x51')]:_0x2ab8ee[_0xa923('0x49')];if(!_0x32f1e6['query'][_0xa923('0xbb')](_0xa923('0x53'))){_0xf00023[_0xa923('0x32')]=qs['limit'](_0x32f1e6[_0xa923('0x4c')][_0xa923('0x32')]);_0xf00023[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x32f1e6[_0xa923('0x4c')]['offset']);}_0xf00023['order']=qs['sort'](_0x32f1e6[_0xa923('0x4c')]['sort']);_0xf00023[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x32f1e6[_0xa923('0x4c')],_0x2ab8ee[_0xa923('0x4e')]));_0xf00023[_0xa923('0x56')]['UserId']=_0x4f3ffe['id'];if(_0x32f1e6[_0xa923('0x4c')][_0xa923('0x3b')]){_0xf00023[_0xa923('0x56')]=_[_0xa923('0x58')](_0xf00023[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0xf00023[_0xa923('0x51')],function(_0x199b51){var _0x3b2665={};_0x3b2665[_0x199b51]={'$like':'%'+_0x32f1e6[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x3b2665;})});}_0xf00023=_[_0xa923('0x58')]({},_0xf00023,_0x32f1e6[_0xa923('0x5e')]);return db[_0xa923('0xcc')]['count']({'where':_0xf00023[_0xa923('0x56')]})['then'](function(_0x262e9e){_0x211276[_0xa923('0x5f')]=_0x262e9e;if(_0x32f1e6[_0xa923('0x4c')]['includeAll']){_0xf00023['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xa923('0xc4')](_0xf00023);})[_0xa923('0x22')](function(_0x1b92a0){_0x211276['rows']=_0x1b92a0;return _0x211276;});}})[_0xa923('0x22')](respondWithFilteredResult(_0x482d02,_0xf00023))[_0xa923('0x2c')](handleError(_0x482d02,null));};exports['getChatInteractions']=function(_0x53df29,_0x11e036,_0xe85b18){var _0x2d4b16={};var _0x2ca552={};var _0x554d1;var _0x3341e6;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x53df29['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x11e036,null))[_0xa923('0x22')](function(_0x5e9850){if(_0x5e9850){_0x554d1=_0x5e9850;_0x2ca552[_0xa923('0x49')]=_[_0xa923('0x4d')](db[_0xa923('0xcd')]['rawAttributes']);_0x2ca552['query']=_[_0xa923('0x4d')](_0x53df29[_0xa923('0x4c')]);_0x2ca552[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x2ca552[_0xa923('0x49')],_0x2ca552[_0xa923('0x4c')]);_0x2d4b16[_0xa923('0x51')]=_['intersection'](_0x2ca552['model'],qs[_0xa923('0x50')](_0x53df29[_0xa923('0x4c')]['fields']));_0x2d4b16[_0xa923('0x51')]=_0x2d4b16['attributes'][_0xa923('0x52')]?_0x2d4b16[_0xa923('0x51')]:_0x2ca552[_0xa923('0x49')];_0x2d4b16['order']=qs['sort'](_0x53df29['query']['sort']);_0x2d4b16['where']=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x53df29[_0xa923('0x4c')],_0x2ca552[_0xa923('0x4e')]));if(_0x53df29['query'][_0xa923('0x3b')]){_0x2d4b16[_0xa923('0x56')]=_['merge'](_0x2d4b16[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x2d4b16[_0xa923('0x51')],function(_0x324654){var _0x5d2bad={};_0x5d2bad[_0x324654]={'$like':'%'+_0x53df29[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x5d2bad;})});}_0x2d4b16=_[_0xa923('0x58')]({},_0x2d4b16,_0x53df29[_0xa923('0x5e')]);return _0x554d1[_0xa923('0xce')](_0x2d4b16);}})['then'](function(_0x210c5b){if(_0x210c5b){_0x3341e6=_0x210c5b[_0xa923('0x52')];if(!_0x53df29[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x2d4b16[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x53df29[_0xa923('0x4c')][_0xa923('0x32')]);_0x2d4b16[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x53df29[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x554d1[_0xa923('0xce')](_0x2d4b16);}})[_0xa923('0x22')](function(_0x14d41c){if(_0x14d41c){return _0x14d41c?{'count':_0x3341e6,'rows':_0x14d41c}:null;}})[_0xa923('0x22')](respondWithResult(_0x11e036,null))[_0xa923('0x2c')](handleError(_0x11e036,null));};exports['getOpenchannelInteractions']=function(_0x24031c,_0x2e9002,_0x44d8fe){var _0x1ec0a1={};var _0x29f887={};var _0x47f14c;var _0x488f01;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x24031c['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x2e9002,null))[_0xa923('0x22')](function(_0x2c695e){if(_0x2c695e){_0x47f14c=_0x2c695e;_0x29f887[_0xa923('0x49')]=_[_0xa923('0x4d')](db['OpenchannelInteraction'][_0xa923('0x63')]);_0x29f887['query']=_[_0xa923('0x4d')](_0x24031c[_0xa923('0x4c')]);_0x29f887[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x29f887['model'],_0x29f887['query']);_0x1ec0a1[_0xa923('0x51')]=_['intersection'](_0x29f887['model'],qs[_0xa923('0x50')](_0x24031c[_0xa923('0x4c')][_0xa923('0x50')]));_0x1ec0a1[_0xa923('0x51')]=_0x1ec0a1['attributes'][_0xa923('0x52')]?_0x1ec0a1[_0xa923('0x51')]:_0x29f887['model'];_0x1ec0a1[_0xa923('0x54')]=qs['sort'](_0x24031c['query']['sort']);_0x1ec0a1[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x24031c[_0xa923('0x4c')],_0x29f887['filters']));if(_0x24031c[_0xa923('0x4c')][_0xa923('0x3b')]){_0x1ec0a1[_0xa923('0x56')]=_[_0xa923('0x58')](_0x1ec0a1[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x1ec0a1['attributes'],function(_0x4d5d75){var _0x129827={};_0x129827[_0x4d5d75]={'$like':'%'+_0x24031c['query'][_0xa923('0x3b')]+'%'};return _0x129827;})});}_0x1ec0a1=_[_0xa923('0x58')]({},_0x1ec0a1,_0x24031c[_0xa923('0x5e')]);return _0x47f14c[_0xa923('0xcf')](_0x1ec0a1);}})[_0xa923('0x22')](function(_0x4c3a53){if(_0x4c3a53){_0x488f01=_0x4c3a53[_0xa923('0x52')];if(!_0x24031c['query']['hasOwnProperty'](_0xa923('0x53'))){_0x1ec0a1[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x24031c[_0xa923('0x4c')][_0xa923('0x32')]);_0x1ec0a1[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x24031c[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x47f14c[_0xa923('0xcf')](_0x1ec0a1);}})['then'](function(_0x4b5687){if(_0x4b5687){return _0x4b5687?{'count':_0x488f01,'rows':_0x4b5687}:null;}})[_0xa923('0x22')](respondWithResult(_0x2e9002,null))['catch'](handleError(_0x2e9002,null));};exports['getMailInteractions']=function(_0x517d9f,_0x362a20,_0x5c439f){var _0x4b4220={'raw':!![],'where':{}};var _0x2f1876={};var _0x423b39={'count':0x0,'rows':[]};return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x517d9f[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x362a20,null))[_0xa923('0x22')](function(_0x10bf67){if(_0x10bf67){_0x2f1876[_0xa923('0x49')]=_[_0xa923('0x4d')](db[_0xa923('0xd0')][_0xa923('0x63')]);_0x2f1876['query']=_[_0xa923('0x4d')](_0x517d9f[_0xa923('0x4c')]);_0x2f1876['filters']=_['intersection'](_0x2f1876[_0xa923('0x49')],_0x2f1876[_0xa923('0x4c')]);_0x4b4220[_0xa923('0x51')]=_['intersection'](_0x2f1876[_0xa923('0x49')],qs[_0xa923('0x50')](_0x517d9f[_0xa923('0x4c')][_0xa923('0x50')]));_0x4b4220[_0xa923('0x51')]=_0x4b4220['attributes'][_0xa923('0x52')]?_0x4b4220['attributes']:_0x2f1876[_0xa923('0x49')];if(!_0x517d9f[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x4b4220[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x517d9f[_0xa923('0x4c')][_0xa923('0x32')]);_0x4b4220[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x517d9f[_0xa923('0x4c')]['offset']);}_0x4b4220['order']=qs[_0xa923('0x55')](_0x517d9f[_0xa923('0x4c')][_0xa923('0x55')]);_0x4b4220[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x517d9f[_0xa923('0x4c')],_0x2f1876[_0xa923('0x4e')]));_0x4b4220[_0xa923('0x56')]['UserId']=_0x10bf67['id'];if(_0x517d9f['query'][_0xa923('0x3b')]){_0x4b4220['where']=_[_0xa923('0x58')](_0x4b4220[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x4b4220[_0xa923('0x51')],function(_0x1658a4){var _0x243bcf={};_0x243bcf[_0x1658a4]={'$like':'%'+_0x517d9f['query'][_0xa923('0x3b')]+'%'};return _0x243bcf;})});}_0x4b4220=_[_0xa923('0x58')]({},_0x4b4220,_0x517d9f[_0xa923('0x5e')]);return db['MailInteraction'][_0xa923('0x5f')]({'where':_0x4b4220[_0xa923('0x56')]})[_0xa923('0x22')](function(_0x583c79){_0x423b39[_0xa923('0x5f')]=_0x583c79;if(_0x517d9f['query']['includeAll']){_0x4b4220[_0xa923('0x60')]=[{'all':!![]}];}return db[_0xa923('0xd0')][_0xa923('0xc4')](_0x4b4220);})[_0xa923('0x22')](function(_0x25e22e){_0x423b39[_0xa923('0xca')]=_0x25e22e;return _0x423b39;});}})[_0xa923('0x22')](respondWithFilteredResult(_0x362a20,_0x4b4220))[_0xa923('0x2c')](handleError(_0x362a20,null));};exports[_0xa923('0xd1')]=function(_0x5e8a24,_0x25af9e,_0x1a48a7){var _0x2a05c2={};var _0x58eb64={};var _0x45d4be;var _0xce74f6;return db[_0xa923('0x46')]['findOne']({'where':{'id':_0x5e8a24[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x25af9e,null))[_0xa923('0x22')](function(_0x1b3ae6){if(_0x1b3ae6){_0x45d4be=_0x1b3ae6;_0x58eb64[_0xa923('0x49')]=_[_0xa923('0x4d')](db['SmsInteraction'][_0xa923('0x63')]);_0x58eb64[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x5e8a24[_0xa923('0x4c')]);_0x58eb64['filters']=_[_0xa923('0x4f')](_0x58eb64['model'],_0x58eb64['query']);_0x2a05c2[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x58eb64[_0xa923('0x49')],qs[_0xa923('0x50')](_0x5e8a24['query']['fields']));_0x2a05c2[_0xa923('0x51')]=_0x2a05c2[_0xa923('0x51')][_0xa923('0x52')]?_0x2a05c2[_0xa923('0x51')]:_0x58eb64[_0xa923('0x49')];_0x2a05c2[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x5e8a24['query'][_0xa923('0x55')]);_0x2a05c2['where']=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x5e8a24['query'],_0x58eb64[_0xa923('0x4e')]));if(_0x5e8a24['query'][_0xa923('0x3b')]){_0x2a05c2[_0xa923('0x56')]=_[_0xa923('0x58')](_0x2a05c2[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x2a05c2[_0xa923('0x51')],function(_0x402e37){var _0x1ffb33={};_0x1ffb33[_0x402e37]={'$like':'%'+_0x5e8a24['query']['filter']+'%'};return _0x1ffb33;})});}_0x2a05c2=_[_0xa923('0x58')]({},_0x2a05c2,_0x5e8a24[_0xa923('0x5e')]);return _0x45d4be[_0xa923('0xd1')](_0x2a05c2);}})[_0xa923('0x22')](function(_0xd75181){if(_0xd75181){_0xce74f6=_0xd75181[_0xa923('0x52')];if(!_0x5e8a24[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x2a05c2[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x5e8a24[_0xa923('0x4c')][_0xa923('0x32')]);_0x2a05c2['offset']=qs[_0xa923('0x31')](_0x5e8a24['query']['offset']);}return _0x45d4be[_0xa923('0xd1')](_0x2a05c2);}})[_0xa923('0x22')](function(_0x2b1a3c){if(_0x2b1a3c){return _0x2b1a3c?{'count':_0xce74f6,'rows':_0x2b1a3c}:null;}})[_0xa923('0x22')](respondWithResult(_0x25af9e,null))[_0xa923('0x2c')](handleError(_0x25af9e,null));};exports[_0xa923('0xd2')]=function(_0x228f74,_0x59e53c,_0x51bcc6){var _0x105110={};var _0x196947={};var _0x1f8e31;var _0x1548b3;return db['User']['findOne']({'where':{'id':_0x228f74[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x59e53c,null))[_0xa923('0x22')](function(_0xfb195d){if(_0xfb195d){_0x1f8e31=_0xfb195d;_0x196947[_0xa923('0x49')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x196947[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x228f74[_0xa923('0x4c')]);_0x196947[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x196947[_0xa923('0x49')],_0x196947[_0xa923('0x4c')]);_0x105110[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x196947[_0xa923('0x49')],qs[_0xa923('0x50')](_0x228f74[_0xa923('0x4c')][_0xa923('0x50')]));_0x105110[_0xa923('0x51')]=_0x105110['attributes'][_0xa923('0x52')]?_0x105110[_0xa923('0x51')]:_0x196947[_0xa923('0x49')];_0x105110[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x228f74[_0xa923('0x4c')]['sort']);_0x105110[_0xa923('0x56')]=qs[_0xa923('0x4e')](_['pick'](_0x228f74[_0xa923('0x4c')],_0x196947['filters']));if(_0x228f74['query'][_0xa923('0x3b')]){_0x105110[_0xa923('0x56')]=_[_0xa923('0x58')](_0x105110[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x105110[_0xa923('0x51')],function(_0x5d63be){var _0x505568={};_0x505568[_0x5d63be]={'$like':'%'+_0x228f74['query']['filter']+'%'};return _0x505568;})});}_0x105110=_[_0xa923('0x58')]({},_0x105110,_0x228f74[_0xa923('0x5e')]);return _0x1f8e31[_0xa923('0xd2')](_0x105110);}})['then'](function(_0xe33d0b){if(_0xe33d0b){_0x1548b3=_0xe33d0b[_0xa923('0x52')];if(!_0x228f74[_0xa923('0x4c')][_0xa923('0xbb')]('nolimit')){_0x105110['limit']=qs[_0xa923('0x32')](_0x228f74[_0xa923('0x4c')][_0xa923('0x32')]);_0x105110[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x228f74[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x1f8e31['getFaxInteractions'](_0x105110);}})[_0xa923('0x22')](function(_0x48f006){if(_0x48f006){return _0x48f006?{'count':_0x1548b3,'rows':_0x48f006}:null;}})['then'](respondWithResult(_0x59e53c,null))[_0xa923('0x2c')](handleError(_0x59e53c,null));};exports[_0xa923('0xd3')]=function(_0x56708b,_0x4da813,_0x10289e){var _0x1207cb={};var _0x44607c={};var _0x411c84;var _0x52f85f;return db['User'][_0xa923('0x93')]({'where':{'id':_0x56708b[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x4da813,null))[_0xa923('0x22')](function(_0x256d72){if(_0x256d72){_0x411c84=_0x256d72;_0x44607c['model']=_[_0xa923('0x4d')](db['WhatsappInteraction'][_0xa923('0x63')]);_0x44607c[_0xa923('0x4c')]=_['keys'](_0x56708b[_0xa923('0x4c')]);_0x44607c[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x44607c[_0xa923('0x49')],_0x44607c[_0xa923('0x4c')]);_0x1207cb['attributes']=_[_0xa923('0x4f')](_0x44607c[_0xa923('0x49')],qs['fields'](_0x56708b[_0xa923('0x4c')][_0xa923('0x50')]));_0x1207cb['attributes']=_0x1207cb[_0xa923('0x51')][_0xa923('0x52')]?_0x1207cb['attributes']:_0x44607c['model'];_0x1207cb[_0xa923('0x54')]=qs['sort'](_0x56708b[_0xa923('0x4c')][_0xa923('0x55')]);_0x1207cb['where']=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x56708b[_0xa923('0x4c')],_0x44607c['filters']));if(_0x56708b[_0xa923('0x4c')][_0xa923('0x3b')]){_0x1207cb[_0xa923('0x56')]=_['merge'](_0x1207cb[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x1207cb[_0xa923('0x51')],function(_0x7859ed){var _0x49e0c5={};_0x49e0c5[_0x7859ed]={'$like':'%'+_0x56708b['query'][_0xa923('0x3b')]+'%'};return _0x49e0c5;})});}_0x1207cb=_['merge']({},_0x1207cb,_0x56708b['options']);return _0x411c84[_0xa923('0xd3')](_0x1207cb);}})[_0xa923('0x22')](function(_0x2e1c8f){if(_0x2e1c8f){_0x52f85f=_0x2e1c8f[_0xa923('0x52')];if(!_0x56708b[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x1207cb[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x56708b[_0xa923('0x4c')]['limit']);_0x1207cb[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x56708b[_0xa923('0x4c')]['offset']);}return _0x411c84['getWhatsappInteractions'](_0x1207cb);}})[_0xa923('0x22')](function(_0x5939af){if(_0x5939af){return _0x5939af?{'count':_0x52f85f,'rows':_0x5939af}:null;}})[_0xa923('0x22')](respondWithResult(_0x4da813,null))[_0xa923('0x2c')](handleError(_0x4da813,null));};exports['login']=function(_0xfa760,_0x1b7d89,_0x273241){var _0x11d393;var _0x42677c;var _0x194f1f;var _0x25384e=!_[_0xa923('0x6f')](_0xfa760[_0xa923('0x61')]['id'])?_0xfa760[_0xa923('0x61')]['id']:!_[_0xa923('0x6f')](_0xfa760[_0xa923('0x38')]['id'])?_0xfa760[_0xa923('0x38')]['id']:null;return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x25384e,'role':{'$or':[_0xa923('0x6c'),_0xa923('0x38'),_0xa923('0x6a')]}},'attributes':['id',_0xa923('0x3f'),_0xa923('0xd4'),_0xa923('0xd5'),_0xa923('0x3d'),'internal',_0xa923('0xd6')]})[_0xa923('0x22')](function(_0x5efb27){if(_0x5efb27){if(_0x5efb27[_0xa923('0x3d')]==='agent'){_0x11d393=_0x5efb27;if(_0xfa760[_0xa923('0x66')][_0xa923('0xac')]){_0x194f1f=util[_0xa923('0x71')](_0xa923('0xd7'),_0x11d393[_0xfa760[_0xa923('0x66')][_0xa923('0xac')]]);}else if(_0xfa760[_0xa923('0x66')][_0xa923('0xd8')]){_0x194f1f=util[_0xa923('0x71')]('SIP/%s',_0xfa760['body'][_0xa923('0xd8')]);}else{_0x194f1f=util[_0xa923('0x71')](_0xa923('0xd9'),_0x11d393[_0xa923('0x3f')]);}socket['to'](util[_0xa923('0x71')]('user:%s',_0x11d393[_0xa923('0x3f')]))[_0xa923('0xa6')]('user:forcelogout',{'ip':_0xfa760[_0xa923('0xda')][_0xa923('0xdb')]||_0xfa760[_0xa923('0xdc')][_0xa923('0xdd')]||_0xfa760[_0xa923('0xde')][_0xa923('0xdd')]||_0xfa760[_0xa923('0xdc')][_0xa923('0xde')]['remoteAddress']});return db[_0xa923('0xae')][_0xa923('0x41')]({'where':{'membername':_0x11d393['name']},'individualHooks':!![]});}}else{throw new db[(_0xa923('0x1f'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xa923('0x22')](function(){if(_0x11d393){return _0x11d393[_0xa923('0xdf')]({'raw':!![]});}})['then'](function(_0x28b772){if(_0x11d393){var _0x5d3f1f=[];if(_0x28b772){_0x42677c=_0x28b772;if(_0x42677c[_0xa923('0x52')]){for(var _0x653de6=0x0;_0x653de6<_0x42677c[_0xa923('0x52')];_0x653de6++){_0x5d3f1f[_0xa923('0xab')]({'membername':_0x11d393[_0xa923('0x3f')],'UserId':_0x11d393['id'],'queue_name':_0x42677c[_0x653de6][_0xa923('0x3f')],'VoiceQueueId':_0x42677c[_0x653de6]['id'],'interface':_0x194f1f,'paused':_0x11d393[_0xa923('0xd6')]||![],'penalty':_0x42677c[_0x653de6][_0xa923('0xe0')]||0x0});}return BPromise['each'](_0x5d3f1f,function(_0x416a5f){return db[_0xa923('0xae')][_0xa923('0xaf')](_0x416a5f);});}}}})[_0xa923('0x22')](function(){if(_0x11d393){return db[_0xa923('0xe1')][_0xa923('0xc4')]({'where':{'membername':_0x11d393['name'],'exitAt':null}});}})[_0xa923('0x22')](function(_0x34ae31){if(_0x11d393){var _0x26506e=[];_0x34ae31[_0xa923('0xe2')](function(_0x5ef89e){_0x26506e[_0xa923('0xab')](_0x5ef89e[_0xa923('0x36')]({'exitAt':moment()[_0xa923('0x71')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xa923('0xe3')](_0x26506e);}})['then'](function(){if(_0x11d393){var _0x256b28=[];var _0x331c26=[];var _0x123ad6=utils[_0xa923('0xe4')]();var _0x39b243={'membername':_0x11d393[_0xa923('0x3f')],'interface':_0x194f1f,'enterAt':moment()[_0xa923('0x71')](_0xa923('0xe5')),'role':_0x11d393['role'],'internal':_0x11d393[_0xa923('0x79')]};_0x123ad6[_0xa923('0xe2')](function(_0x775642){_0x256b28[_0xa923('0xab')](_[_0xa923('0x58')]({'channel':_0x775642,'type':'LOGIN','data1':_0xfa760[_0xa923('0x66')][_0xa923('0xe6')],'data2':_0x194f1f},_0x39b243));if(_0x11d393[_0xa923('0xd6')]){_0x331c26['push'](_[_0xa923('0x58')]({'channel':_0x775642,'type':_0xa923('0xe7'),'data1':_0xa923('0xe8')},_0x39b243));}});return db['MemberReport'][_0xa923('0x65')](_0x256b28['concat'](_0x331c26),{'individualHooks':!![]});}})[_0xa923('0x22')](function(){if(_0x11d393){return _0x11d393[_0xa923('0x36')]({'online':!![],'lastLoginAt':moment()['format'](_0xa923('0xe5')),'voicePause':_0x11d393[_0xa923('0xd6')]||![],'mailPause':_0x11d393[_0xa923('0xd6')]||![],'chatPause':_0x11d393['loginInPause']||![],'faxPause':_0x11d393[_0xa923('0xd6')]||![],'smsPause':_0x11d393[_0xa923('0xd6')]||![],'openchannelPause':_0x11d393[_0xa923('0xd6')]||![],'whatsappPause':_0x11d393['loginInPause']||![],'pauseType':_0x11d393[_0xa923('0xd6')]?'LOGININPAUSE':null,'interface':_0x194f1f,'lastPauseAt':moment()[_0xa923('0x71')](_0xa923('0xe5'))});}})['then'](function(_0x535592){if(_0xfa760['isMiddleware']){return _0x273241();}else{return BPromise[_0xa923('0xe9')](_0x535592)[_0xa923('0x22')](respondWithResult(_0x1b7d89,null));}})['catch'](handleError(_0x1b7d89,null));};exports[_0xa923('0xea')]=function(_0x2cb9bf,_0xb6ed24,_0x38ac44){var _0x17fce8;return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x2cb9bf[_0xa923('0x61')]['id'],'role':_0xa923('0x6a')},'attributes':['id',_0xa923('0x3f'),_0xa923('0x3d')]})[_0xa923('0x22')](handleEntityNotFound(_0xb6ed24,null))[_0xa923('0x22')](function(_0x2ff5e4){if(_0x2ff5e4){_0x17fce8=_0x2ff5e4;return db[_0xa923('0xae')][_0xa923('0x41')]({'where':{'membername':_0x17fce8[_0xa923('0x3f')]},'individualHooks':!![]});}})[_0xa923('0x22')](function(){return db[_0xa923('0xe1')][_0xa923('0xc4')]({'where':{'membername':_0x17fce8[_0xa923('0x3f')],'exitAt':null}});})['then'](function(_0x2b1be3){var _0x1af3cf=[];_0x2b1be3['forEach'](function(_0x3a7bcd){_0x1af3cf[_0xa923('0xab')](_0x3a7bcd[_0xa923('0x36')]({'exitAt':moment()[_0xa923('0x71')](_0xa923('0xe5'))}));});return BPromise[_0xa923('0xe3')](_0x1af3cf);})[_0xa923('0x22')](function(){return _0x17fce8[_0xa923('0x36')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa923('0x22')](respondWithResult(_0xb6ed24,null))[_0xa923('0x2c')](handleError(_0xb6ed24,null));};exports[_0xa923('0xeb')]=function(_0x1eb5d0,_0x165663,_0x45c90c){var _0x297d40;return db['UserVoiceQueueRt'][_0xa923('0x36')]({'paused':0x1},{'where':{'UserId':_0x1eb5d0[_0xa923('0x61')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xa923('0x46')]['find']({'where':{'id':_0x1eb5d0[_0xa923('0x61')]['id'],'role':'agent'},'attributes':['id',_0xa923('0x3f'),_0xa923('0x3d'),_0xa923('0x79'),_0xa923('0xac')]});})[_0xa923('0x22')](handleEntityNotFound(_0x165663,null))['then'](function(_0x32eb41){if(_0x32eb41){_0x297d40=_0x32eb41;return respondWithRpcPromise(_0xa923('0xec'),'pause',{'id':_0x297d40['id'],'name':_0x297d40[_0xa923('0x3f')],'pause':!![]});}})[_0xa923('0x22')](function(){if(_0x297d40){return db['MemberReport'][_0xa923('0xc4')]({'where':{'membername':_0x297d40[_0xa923('0x3f')],'type':'PAUSE','exitAt':null}});}})[_0xa923('0x22')](function(_0xe1c2f6){if(_0xe1c2f6[_0xa923('0x52')]){var _0xa37e37=moment()[_0xa923('0x71')](_0xa923('0xe5'));for(var _0x5a8cd4=0x0,_0x5d7ff5=_0xe1c2f6[_0xa923('0x52')];_0x5a8cd4<_0x5d7ff5;_0x5a8cd4++){_0xe1c2f6[_0x5a8cd4][_0xa923('0xed')]({'exitAt':_0xa37e37});}}})[_0xa923('0x22')](function(){var _0x14152=[];var _0x57e4d1=utils[_0xa923('0xe4')]();_0x57e4d1[_0xa923('0xe2')](function(_0xa7aa19){_0x14152[_0xa923('0xab')]({'channel':_0xa7aa19,'membername':_0x297d40[_0xa923('0x3f')],'interface':_['isNil'](_0x297d40[_0xa923('0xac')])?util['format'](_0xa923('0xd9'),_0x297d40[_0xa923('0x3f')]):_0x297d40[_0xa923('0xac')],'type':_0xa923('0xe7'),'enterAt':moment()[_0xa923('0x71')](_0xa923('0xe5')),'data1':_0x1eb5d0[_0xa923('0x66')][_0xa923('0x59')]||_0xa923('0xee'),'role':_0x297d40[_0xa923('0x3d')],'internal':_0x297d40[_0xa923('0x79')]});});return db[_0xa923('0xe1')][_0xa923('0x65')](_0x14152,{'individualHooks':!![]});})[_0xa923('0x22')](function(){return _0x297d40[_0xa923('0x36')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1eb5d0[_0xa923('0x66')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xa923('0x71')](_0xa923('0xe5'))});})['then'](respondWithResult(_0x165663,null))[_0xa923('0x2c')](handleError(_0x165663,null));};exports[_0xa923('0xef')]=function(_0x2ec2d7,_0x3bfeec,_0xf064a2){var _0x2a393d;return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x2ec2d7[_0xa923('0x61')]['id']},'attributes':['id',_0xa923('0x3f'),_0xa923('0x3d'),_0xa923('0x9d'),_0xa923('0xf0'),_0xa923('0xf1'),_0xa923('0xf2'),_0xa923('0xf3'),_0xa923('0xf4'),'whatsapppause',_0xa923('0xf5'),_0xa923('0xf6')]})[_0xa923('0x22')](handleEntityNotFound(_0x3bfeec,null))['then'](function(_0x4f4788){if(_0x4f4788){_0x2a393d=_0x4f4788;if(_0x2ec2d7[_0xa923('0x66')]['channel']&&!utils['isValidChannel'](_0x2ec2d7[_0xa923('0x66')]['channel'])){throw new db[(_0xa923('0x1f'))][(_0xa923('0x20'))](_0xa923('0x9f'));}switch(_0x2ec2d7[_0xa923('0x66')]['channel']){case _0xa923('0xa8'):return respondWithRpcPromise('QueuePause',_0xa923('0xef'),{'id':_0x2a393d['id'],'name':_0x2a393d['name'],'pause':![]})[_0xa923('0x22')](function(){return db[_0xa923('0xae')]['update']({'paused':0x0},{'where':{'UserId':_0x2a393d['id']},'individualHooks':!![]});})['then'](function(){return db[_0xa923('0xe1')]['find']({'where':{'channel':_0x2ec2d7[_0xa923('0x66')]['channel'],'membername':_0x2a393d[_0xa923('0x3f')],'type':_0xa923('0xe7'),'exitAt':null}});})[_0xa923('0x22')](function(_0x596e1d){if(_0x596e1d){return _0x596e1d[_0xa923('0x36')]({'exitAt':moment()[_0xa923('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xa923('0xf7')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x2a393d['update']({'voicePause':![]});});case _0xa923('0xf8'):case _0xa923('0xf9'):case'fax':case _0xa923('0xfa'):case _0xa923('0xfb'):case _0xa923('0xfc'):return db['MemberReport'][_0xa923('0x3e')]({'where':{'channel':_0x2ec2d7['body'][_0xa923('0x9c')],'membername':_0x2a393d[_0xa923('0x3f')],'type':_0xa923('0xe7'),'exitAt':null}})[_0xa923('0x22')](function(_0xb84a48){if(_0xb84a48){return _0xb84a48['update']({'exitAt':moment()[_0xa923('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x295a47={};_['set'](_0x295a47,util['format'](_0xa923('0xfd'),_0x2ec2d7['body'][_0xa923('0x9c')],'Pause'),![]);return _0x2a393d[_0xa923('0x36')](_0x295a47);});default:return respondWithRpcPromise('QueuePause',_0xa923('0xef'),{'id':_0x2a393d['id'],'name':_0x2a393d[_0xa923('0x3f')],'pause':![]})[_0xa923('0x22')](function(){return db['UserVoiceQueueRt'][_0xa923('0x36')]({'paused':0x0},{'where':{'UserId':_0x2a393d['id']}});})['then'](function(){return db['MemberReport'][_0xa923('0xc4')]({'where':{'membername':_0x2a393d[_0xa923('0x3f')],'type':_0xa923('0xe7'),'exitAt':null}});})[_0xa923('0x22')](function(_0x3c888b){var _0x48fb73=[];_0x3c888b[_0xa923('0xe2')](function(_0x26fd3c){_0x48fb73[_0xa923('0xab')](_0x26fd3c[_0xa923('0x36')]({'exitAt':moment()[_0xa923('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xa923('0xf7')}));});return BPromise[_0xa923('0xe3')](_0x48fb73);})['then'](function(){return _0x2a393d['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x3bfeec,null))[_0xa923('0x2c')](handleError(_0x3bfeec,null));};exports[_0xa923('0xfe')]=function(_0x33cd95,_0x318727,_0x549506){var _0x12f957={};var _0x3bf9a5={};var _0x457cc8;var _0x3f4287;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x33cd95[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x318727,null))[_0xa923('0x22')](function(_0x448e29){if(_0x448e29){_0x457cc8=_0x448e29;_0x3bf9a5[_0xa923('0x49')]=_['keys'](db[_0xa923('0xff')][_0xa923('0x63')]);_0x3bf9a5['query']=_[_0xa923('0x4d')](_0x33cd95['query']);_0x3bf9a5[_0xa923('0x4e')]=_['intersection'](_0x3bf9a5[_0xa923('0x49')],_0x3bf9a5[_0xa923('0x4c')]);_0x12f957[_0xa923('0x51')]=_['intersection'](_0x3bf9a5['model'],qs[_0xa923('0x50')](_0x33cd95['query'][_0xa923('0x50')]));_0x12f957[_0xa923('0x51')]=_0x12f957[_0xa923('0x51')][_0xa923('0x52')]?_0x12f957['attributes']:_0x3bf9a5[_0xa923('0x49')];_0x12f957[_0xa923('0x54')]=qs['sort'](_0x33cd95[_0xa923('0x4c')][_0xa923('0x55')]);_0x12f957['where']=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x33cd95[_0xa923('0x4c')],_0x3bf9a5[_0xa923('0x4e')]));if(_0x33cd95[_0xa923('0x4c')][_0xa923('0x3b')]){_0x12f957[_0xa923('0x56')]=_[_0xa923('0x58')](_0x12f957[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x12f957[_0xa923('0x51')],function(_0x581fa6){var _0x3f7a37={};_0x3f7a37[_0x581fa6]={'$like':'%'+_0x33cd95['query'][_0xa923('0x3b')]+'%'};return _0x3f7a37;})});}_0x12f957=_[_0xa923('0x58')]({},_0x12f957,_0x33cd95[_0xa923('0x5e')]);return _0x457cc8[_0xa923('0xfe')](_0x12f957);}})[_0xa923('0x22')](function(_0x3f326c){if(_0x3f326c){_0x3f4287=_0x3f326c[_0xa923('0x52')];if(!_0x33cd95[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x12f957[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x33cd95['query'][_0xa923('0x32')]);_0x12f957['offset']=qs['offset'](_0x33cd95['query']['offset']);}return _0x457cc8[_0xa923('0xfe')](_0x12f957);}})[_0xa923('0x22')](function(_0x15bd78){if(_0x15bd78){return _0x15bd78?{'count':_0x3f4287,'rows':_0x15bd78}:null;}})['then'](respondWithResult(_0x318727,null))[_0xa923('0x2c')](handleError(_0x318727,null));};exports['addTeams']=function(_0xa48b0c,_0x36ff5d){return db['User'][_0xa923('0x3e')]({'where':{'id':_0xa48b0c[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x36ff5d,null))['then'](function(_0x9f5489){if(_0x9f5489){var _0x377ba2=_0x9f5489[_0xa923('0x8d')]({'plain':!![]});return _0x9f5489[_0xa923('0x100')](_0xa48b0c['body'][_0xa923('0x69')],_[_0xa923('0x101')](_0xa48b0c[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{})['then'](function(){for(var _0x43c286=0x0;_0x43c286<_0xa48b0c['body'][_0xa923('0x69')]['length'];_0x43c286++){var _0x2f57ea=[];db['Team'][_0xa923('0x93')]({'where':{'id':_0xa48b0c['body'][_0xa923('0x69')][_0x43c286]}})[_0xa923('0x22')](function(_0x1056f4){_0x2f57ea[_0xa923('0xab')](_0x1056f4['getVoiceQueues']()[_0xa923('0x22')](function(_0x24441f){for(var _0xd634a0=0x0;_0xd634a0<_0x24441f[_0xa923('0x52')];_0xd634a0++){_0x24441f[_0xd634a0][_0xa923('0x102')]('channel','Voice');}return _0x24441f;}));_0x2f57ea[_0xa923('0xab')](_0x1056f4['getChatQueues']()['then'](function(_0x3847aa){for(var _0x5ef000=0x0;_0x5ef000<_0x3847aa[_0xa923('0x52')];_0x5ef000++){_0x3847aa[_0x5ef000][_0xa923('0x102')](_0xa923('0x9c'),'Chat');}return _0x3847aa;}));_0x2f57ea[_0xa923('0xab')](_0x1056f4[_0xa923('0x103')]()[_0xa923('0x22')](function(_0x3f3c4b){for(var _0x57ff78=0x0;_0x57ff78<_0x3f3c4b[_0xa923('0x52')];_0x57ff78++){_0x3f3c4b[_0x57ff78]['setDataValue']('channel',_0xa923('0x104'));}return _0x3f3c4b;}));_0x2f57ea[_0xa923('0xab')](_0x1056f4[_0xa923('0x105')]()[_0xa923('0x22')](function(_0x2b119b){for(var _0x4e0585=0x0;_0x4e0585<_0x2b119b['length'];_0x4e0585++){_0x2b119b[_0x4e0585][_0xa923('0x102')]('channel',_0xa923('0x106'));}return _0x2b119b;}));_0x2f57ea[_0xa923('0xab')](_0x1056f4[_0xa923('0x107')]()['then'](function(_0x292900){for(var _0x2fecba=0x0;_0x2fecba<_0x292900[_0xa923('0x52')];_0x2fecba++){_0x292900[_0x2fecba][_0xa923('0x102')](_0xa923('0x9c'),_0xa923('0x108'));}return _0x292900;}));_0x2f57ea[_0xa923('0xab')](_0x1056f4[_0xa923('0x109')]()[_0xa923('0x22')](function(_0x53ef02){for(var _0x11bb30=0x0;_0x11bb30<_0x53ef02[_0xa923('0x52')];_0x11bb30++){_0x53ef02[_0x11bb30]['setDataValue']('channel',_0xa923('0x10a'));}return _0x53ef02;}));_0x2f57ea[_0xa923('0xab')](_0x1056f4[_0xa923('0x10b')]()[_0xa923('0x22')](function(_0x50e475){for(var _0x5d1377=0x0;_0x5d1377<_0x50e475[_0xa923('0x52')];_0x5d1377++){_0x50e475[_0x5d1377][_0xa923('0x102')](_0xa923('0x9c'),_0xa923('0x10c'));}return _0x50e475;}));return BPromise[_0xa923('0xe3')](_0x2f57ea);})[_0xa923('0x22')](function(_0x3370a9){var _0x4827ed=_['flatten'](_0x3370a9);_0x2f57ea=[];return db['sequelize'][_0xa923('0x10d')](function(_0x556f6f){for(var _0x38af8c=0x0;_0x38af8c<_0x4827ed[_0xa923('0x52')];_0x38af8c++){_0x2f57ea[_0xa923('0xab')](_0x4827ed[_0x38af8c]['addAgent'](_0x377ba2['id']),{'transaction':_0x556f6f});}return BPromise[_0xa923('0xe3')](_0x2f57ea)[_0xa923('0x22')](function(){if(_0x377ba2['online']){return BPromise[_0xa923('0xad')](_[_0xa923('0x3b')](_0x4827ed,function(_0x23e53c){return _0x23e53c[_0xa923('0x10e')](_0xa923('0x9c'))===_0xa923('0x10f');}),function(_0x393641){return db[_0xa923('0xae')][_0xa923('0xaf')]({'membername':_0x377ba2[_0xa923('0x3f')],'UserId':_0x377ba2['id'],'queue_name':_0x393641['name'],'VoiceQueueId':_0x393641['id'],'interface':_['isNil'](_0x377ba2[_0xa923('0xac')])?util[_0xa923('0x71')](_0xa923('0xd9'),_0x377ba2[_0xa923('0x3f')]):_0x377ba2[_0xa923('0xac')],'paused':_0x377ba2['voicePause']||![],'penalty':_0x377ba2[_0xa923('0xa1')]},{'transaction':_0x556f6f});});}else{return;}})[_0xa923('0x22')](function(){for(var _0x4acc09=0x0;_0x4acc09<_0x4827ed[_0xa923('0x52')];_0x4acc09++){var _0x57f6df=_0x4827ed[_0x4acc09]['getDataValue'](_0xa923('0x9c'));var _0xf41514=_0x57f6df+'QueueId';socket[_0xa923('0xa6')](_0xa923('0x38')+_0x57f6df+_0xa923('0xa7'),{'UserId':_0x377ba2['id'],['queueField']:_0x4827ed[_0x4acc09]['id']});}});});});}});}})[_0xa923('0x22')](respondWithStatusCode(_0x36ff5d,null))['catch'](handleError(_0x36ff5d,null));};exports[_0xa923('0x110')]=function(_0x4f882f,_0x2981de){return db[_0xa923('0x46')]['findOne']({'where':{'id':_0x4f882f[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x2981de,null))[_0xa923('0x22')](function(_0x566c03){if(_0x566c03){var _0x25d60e=_0x566c03[_0xa923('0x8d')]({'plain':!![]});var _0x5d68cb=_0x4f882f[_0xa923('0x4c')][_0xa923('0x69')];return _0x566c03[_0xa923('0x110')](_0x5d68cb)['then'](function(){for(var _0x2233c8=0x0;_0x2233c8<_0x5d68cb[_0xa923('0x52')];_0x2233c8++){var _0x33bc55=[];db[_0xa923('0xff')][_0xa923('0x93')]({'where':{'id':_0x5d68cb[_0x2233c8]}})[_0xa923('0x22')](function(_0x405d44){_0x33bc55['push'](_0x405d44[_0xa923('0xdf')]()[_0xa923('0x22')](function(_0x37de4f){for(var _0x55ce7a=0x0;_0x55ce7a<_0x37de4f[_0xa923('0x52')];_0x55ce7a++){_0x37de4f[_0x55ce7a]['setDataValue']('channel',_0xa923('0x10f'));}return _0x37de4f;}));_0x33bc55['push'](_0x405d44[_0xa923('0x111')]()['then'](function(_0x31c616){for(var _0x5ea40f=0x0;_0x5ea40f<_0x31c616[_0xa923('0x52')];_0x5ea40f++){_0x31c616[_0x5ea40f][_0xa923('0x102')](_0xa923('0x9c'),_0xa923('0x112'));}return _0x31c616;}));_0x33bc55[_0xa923('0xab')](_0x405d44[_0xa923('0x103')]()[_0xa923('0x22')](function(_0x1ac2ee){for(var _0xdcdcab=0x0;_0xdcdcab<_0x1ac2ee[_0xa923('0x52')];_0xdcdcab++){_0x1ac2ee[_0xdcdcab][_0xa923('0x102')](_0xa923('0x9c'),_0xa923('0x104'));}return _0x1ac2ee;}));_0x33bc55[_0xa923('0xab')](_0x405d44[_0xa923('0x105')]()[_0xa923('0x22')](function(_0x560140){for(var _0x24133e=0x0;_0x24133e<_0x560140[_0xa923('0x52')];_0x24133e++){_0x560140[_0x24133e][_0xa923('0x102')](_0xa923('0x9c'),_0xa923('0x106'));}return _0x560140;}));_0x33bc55['push'](_0x405d44[_0xa923('0x107')]()[_0xa923('0x22')](function(_0x36226c){for(var _0x12a761=0x0;_0x12a761<_0x36226c[_0xa923('0x52')];_0x12a761++){_0x36226c[_0x12a761][_0xa923('0x102')](_0xa923('0x9c'),'Whatsapp');}return _0x36226c;}));_0x33bc55[_0xa923('0xab')](_0x405d44[_0xa923('0x109')]()['then'](function(_0x10e3fa){for(var _0x18e53d=0x0;_0x18e53d<_0x10e3fa[_0xa923('0x52')];_0x18e53d++){_0x10e3fa[_0x18e53d]['setDataValue'](_0xa923('0x9c'),_0xa923('0x10a'));}return _0x10e3fa;}));_0x33bc55[_0xa923('0xab')](_0x405d44[_0xa923('0x10b')]()[_0xa923('0x22')](function(_0x43f11b){for(var _0x207bbb=0x0;_0x207bbb<_0x43f11b[_0xa923('0x52')];_0x207bbb++){_0x43f11b[_0x207bbb]['setDataValue']('channel',_0xa923('0x10c'));}return _0x43f11b;}));return BPromise[_0xa923('0xe3')](_0x33bc55);})[_0xa923('0x22')](function(_0x3c46b9){var _0x2706d6=_[_0xa923('0x113')](_0x3c46b9);_0x33bc55=[];return db[_0xa923('0x5b')]['transaction'](function(_0xcd1818){for(var _0x3b6bdf=0x0;_0x3b6bdf<_0x2706d6['length'];_0x3b6bdf++){_0x33bc55[_0xa923('0xab')](_0x2706d6[_0x3b6bdf]['removeAgent'](_0x25d60e['id']),{'transaction':_0xcd1818});}return BPromise[_0xa923('0xe3')](_0x33bc55)[_0xa923('0x22')](function(){if(_0x25d60e['online']){return BPromise[_0xa923('0xad')](_[_0xa923('0x3b')](_0x2706d6,function(_0x251c56){return _0x251c56['getDataValue'](_0xa923('0x9c'))===_0xa923('0x10f');}),function(_0x2e5ec0){return db[_0xa923('0xae')]['destroy']({'where':{'VoiceQueueId':_0x2e5ec0['id'],'UserId':_0x25d60e['id']},'transaction':_0xcd1818});});}else{return;}})['then'](function(){for(var _0x5de8c1=0x0;_0x5de8c1<_0x2706d6[_0xa923('0x52')];_0x5de8c1++){var _0x418a18=_0x2706d6[_0x5de8c1][_0xa923('0x10e')](_0xa923('0x9c'));var _0x27e7e6=_0x418a18+_0xa923('0xa5');socket['emit'](_0xa923('0x38')+_0x418a18+_0xa923('0x114'),{'UserId':_0x25d60e['id'],['queueField']:_0x2706d6[_0x5de8c1]['id']});}});});});}});}})[_0xa923('0x22')](respondWithStatusCode(_0x2981de,null))[_0xa923('0x2c')](handleError(_0x2981de,null));};exports[_0xa923('0x115')]=function(_0x366dcf,_0x5f52ca,_0x38a07c){var _0x56132e={};var _0xee7925={};var _0x2dc1dc;var _0x4a0313;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x366dcf['params']['id']}})['then'](handleEntityNotFound(_0x5f52ca,null))[_0xa923('0x22')](function(_0x2cea59){if(_0x2cea59){_0x2dc1dc=_0x2cea59;_0xee7925[_0xa923('0x49')]=_['keys'](db[_0xa923('0xbc')][_0xa923('0x63')]);_0xee7925[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x366dcf['query']);_0xee7925[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0xee7925[_0xa923('0x49')],_0xee7925[_0xa923('0x4c')]);_0x56132e[_0xa923('0x51')]=_[_0xa923('0x4f')](_0xee7925[_0xa923('0x49')],qs[_0xa923('0x50')](_0x366dcf['query']['fields']));_0x56132e[_0xa923('0x51')]=_0x56132e[_0xa923('0x51')][_0xa923('0x52')]?_0x56132e['attributes']:_0xee7925[_0xa923('0x49')];_0x56132e['order']=qs[_0xa923('0x55')](_0x366dcf['query'][_0xa923('0x55')]);_0x56132e[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x366dcf['query'],_0xee7925[_0xa923('0x4e')]));if(_0x366dcf['query'][_0xa923('0x3b')]){_0x56132e[_0xa923('0x56')]=_[_0xa923('0x58')](_0x56132e[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x56132e[_0xa923('0x51')],function(_0xbccb5){var _0x33a844={};_0x33a844[_0xbccb5]={'$like':'%'+_0x366dcf['query']['filter']+'%'};return _0x33a844;})});}_0x56132e=_[_0xa923('0x58')]({},_0x56132e,_0x366dcf[_0xa923('0x5e')]);return _0x2dc1dc[_0xa923('0x115')](_0x56132e);}})['then'](function(_0x550332){if(_0x550332){_0x4a0313=_0x550332[_0xa923('0x52')];if(!_0x366dcf[_0xa923('0x4c')]['hasOwnProperty'](_0xa923('0x53'))){_0x56132e['limit']=qs['limit'](_0x366dcf['query']['limit']);_0x56132e[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x366dcf[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x2dc1dc['getLists'](_0x56132e);}})[_0xa923('0x22')](function(_0x5aab43){if(_0x5aab43){return _0x5aab43?{'count':_0x4a0313,'rows':_0x5aab43}:null;}})['then'](respondWithResult(_0x5f52ca,null))[_0xa923('0x2c')](handleError(_0x5f52ca,null));};exports[_0xa923('0x116')]=function(_0x345391,_0x37c4e5,_0x28cd46){var _0x37a3f2={};var _0x21cbfe={};var _0x2cf6ba;var _0x266941;return db['User'][_0xa923('0x93')]({'where':{'id':_0x345391[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x37c4e5,null))[_0xa923('0x22')](function(_0x31b9d8){if(_0x31b9d8){_0x2cf6ba=_0x31b9d8;_0x21cbfe[_0xa923('0x49')]=_[_0xa923('0x4d')](db[_0xa923('0x46')][_0xa923('0x63')]);_0x21cbfe[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x345391[_0xa923('0x4c')]);_0x21cbfe[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x21cbfe[_0xa923('0x49')],_0x21cbfe[_0xa923('0x4c')]);_0x37a3f2[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x21cbfe[_0xa923('0x49')],qs['fields'](_0x345391[_0xa923('0x4c')][_0xa923('0x50')]));_0x37a3f2[_0xa923('0x51')]=_0x37a3f2[_0xa923('0x51')][_0xa923('0x52')]?_0x37a3f2[_0xa923('0x51')]:_0x21cbfe['model'];_0x37a3f2[_0xa923('0x54')]=qs['sort'](_0x345391[_0xa923('0x4c')][_0xa923('0x55')]);_0x37a3f2[_0xa923('0x56')]=qs[_0xa923('0x4e')](_['pick'](_0x345391[_0xa923('0x4c')],_0x21cbfe[_0xa923('0x4e')]));if(_0x345391[_0xa923('0x4c')][_0xa923('0x3b')]){_0x37a3f2['where']=_['merge'](_0x37a3f2['where'],{'$or':_['map'](_0x37a3f2['attributes'],function(_0x261cdf){var _0x5546fa={};_0x5546fa[_0x261cdf]={'$like':'%'+_0x345391['query'][_0xa923('0x3b')]+'%'};return _0x5546fa;})});}_0x37a3f2[_0xa923('0x49')]=db[_0xa923('0x46')];_0x37a3f2['as']='Agents';_0x37a3f2=_[_0xa923('0x58')]({},_0x37a3f2,_0x345391['options']);return _0x2cf6ba[_0xa923('0xdf')]({'include':[_0x37a3f2]});}})['then'](function(_0x1c1597){if(_0x1c1597){var _0x10dedc={},_0x1941fb=[],_0xb856c4=0x0;for(var _0xfe9c5d=0x0;_0xfe9c5d<_0x1c1597['length'];_0xfe9c5d+=0x1){for(var _0x635930=0x0,_0x29879d;_0x635930<_0x1c1597[_0xfe9c5d]['Agents'][_0xa923('0x52')];_0x635930+=0x1){_0x29879d=_0x1c1597[_0xfe9c5d]['Agents'][_0x635930][_0xa923('0x8d')]({'plain':!![]});_0x10dedc[_0x29879d['id']]=_0x29879d;}}_0x10dedc=_[_0xa923('0x117')](_0x10dedc);for(var _0x33e944=qs[_0xa923('0x31')](_0x345391[_0xa923('0x4c')]['offset']);_0x33e944<_0x10dedc['length']&&_0x1941fb[_0xa923('0x52')]<qs[_0xa923('0x32')](_0x345391[_0xa923('0x4c')][_0xa923('0x32')]);_0x33e944+=0x1){if(_0x10dedc[_0x33e944]){_0x1941fb[_0xa923('0xab')](_0x10dedc[_0x33e944]);}}return{'count':_0x10dedc['length'],'rows':_0x1941fb};}})[_0xa923('0x22')](respondWithResult(_0x37c4e5,null))['catch'](handleError(_0x37c4e5,null));};exports[_0xa923('0x41')]=function(_0x3a9484,_0x4d98a3){if(_0x3a9484[_0xa923('0x38')]['id']==_0x3a9484[_0xa923('0x61')]['id']){return _0x4d98a3[_0xa923('0x2f')](0x1f4)[_0xa923('0x43')]({'message':_0xa923('0x118')});}return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x3a9484['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x4d98a3,null))['then'](removeEntity(_0x4d98a3,null))['catch'](handleError(_0x4d98a3,null));};exports['addChatInteractions']=function(_0x2142b4,_0x23c68f,_0x304ac4){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x2142b4['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x23c68f,null))[_0xa923('0x22')](function(_0x93dada){if(_0x93dada){return _0x93dada['addChatInteractions'](_0x2142b4['body'][_0xa923('0x69')],_[_0xa923('0x101')](_0x2142b4[_0xa923('0x66')],['ids','id'])||{})[_0xa923('0xa2')](function(){for(var _0x5d3bd9=0x0;_0x5d3bd9<_0x2142b4[_0xa923('0x66')]['ids'][_0xa923('0x52')];_0x5d3bd9+=0x1){socket[_0xa923('0xa6')](_0xa923('0x119'),{'ChatInteractionId':Number(_0x2142b4[_0xa923('0x66')]['ids'][_0x5d3bd9]),'UserId':Number(_0x2142b4[_0xa923('0x61')]['id'])});}return _0x2142b4[_0xa923('0x66')][_0xa923('0x69')];});}})['then'](respondWithResult(_0x23c68f,null))['catch'](handleError(_0x23c68f,null));};exports[_0xa923('0x11a')]=function(_0x4a60f7,_0x9a389b,_0x32f346){return db['User']['find']({'where':{'id':_0x4a60f7[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x9a389b,null))[_0xa923('0x22')](function(_0x5e82e4){if(_0x5e82e4){return _0x5e82e4[_0xa923('0x11a')](_0x4a60f7[_0xa923('0x4c')]['ids'])[_0xa923('0x22')](function(){if(_[_0xa923('0x11b')](_0x4a60f7[_0xa923('0x4c')][_0xa923('0x69')])){for(var _0x432f1b=0x0;_0x432f1b<_0x4a60f7[_0xa923('0x4c')][_0xa923('0x69')][_0xa923('0x52')];_0x432f1b+=0x1){socket['emit'](_0xa923('0x11c'),{'ChatInteractionId':Number(_0x4a60f7[_0xa923('0x4c')][_0xa923('0x69')][_0x432f1b]),'UserId':Number(_0x4a60f7[_0xa923('0x61')]['id'])});}}else{socket[_0xa923('0xa6')](_0xa923('0x11c'),{'ChatInteractionId':Number(_0x4a60f7[_0xa923('0x4c')][_0xa923('0x69')]),'UserId':Number(_0x4a60f7[_0xa923('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x9a389b,null))[_0xa923('0x2c')](handleError(_0x9a389b,null));};exports[_0xa923('0x11d')]=function(_0x3c0f56,_0xe63685,_0x2d06d2){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x3c0f56[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0xe63685,null))[_0xa923('0x22')](function(_0x27a26e){if(_0x27a26e){return _0x27a26e[_0xa923('0x11d')](_0x3c0f56['body'][_0xa923('0x69')],_['omit'](_0x3c0f56[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{})[_0xa923('0xa2')](function(){for(var _0x271885=0x0;_0x271885<_0x3c0f56[_0xa923('0x66')][_0xa923('0x69')][_0xa923('0x52')];_0x271885+=0x1){socket[_0xa923('0xa6')](_0xa923('0x11e'),{'MailInteractionId':Number(_0x3c0f56['body'][_0xa923('0x69')][_0x271885]),'UserId':Number(_0x3c0f56[_0xa923('0x61')]['id'])});}return _0x3c0f56[_0xa923('0x66')]['ids'];});}})[_0xa923('0x22')](respondWithResult(_0xe63685,null))[_0xa923('0x2c')](handleError(_0xe63685,null));};exports['removeMailInteractions']=function(_0xed9b13,_0x58f85a,_0x10d37f){return db['User']['find']({'where':{'id':_0xed9b13[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x58f85a,null))['then'](function(_0x1f940c){if(_0x1f940c){return _0x1f940c[_0xa923('0x11f')](_0xed9b13[_0xa923('0x4c')][_0xa923('0x69')])[_0xa923('0x22')](function(){if(_[_0xa923('0x11b')](_0xed9b13[_0xa923('0x4c')]['ids'])){for(var _0x5b7f32=0x0;_0x5b7f32<_0xed9b13[_0xa923('0x4c')][_0xa923('0x69')][_0xa923('0x52')];_0x5b7f32+=0x1){socket[_0xa923('0xa6')](_0xa923('0x120'),{'MailInteractionId':Number(_0xed9b13[_0xa923('0x4c')][_0xa923('0x69')][_0x5b7f32]),'UserId':Number(_0xed9b13[_0xa923('0x61')]['id'])});}}else{socket[_0xa923('0xa6')](_0xa923('0x120'),{'MailInteractionId':Number(_0xed9b13[_0xa923('0x4c')]['ids']),'UserId':Number(_0xed9b13[_0xa923('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x58f85a,null))['catch'](handleError(_0x58f85a,null));};exports[_0xa923('0x121')]=function(_0x4bf0e4,_0x55af0a,_0x2768c5){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x4bf0e4[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x55af0a,null))[_0xa923('0x22')](function(_0x4bb346){if(_0x4bb346){return _0x4bb346[_0xa923('0x121')](_0x4bf0e4['body']['ids'],_[_0xa923('0x101')](_0x4bf0e4[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{})[_0xa923('0xa2')](function(){for(var _0x2160af=0x0;_0x2160af<_0x4bf0e4[_0xa923('0x66')][_0xa923('0x69')][_0xa923('0x52')];_0x2160af+=0x1){socket[_0xa923('0xa6')](_0xa923('0x122'),{'FaxInteractionId':Number(_0x4bf0e4[_0xa923('0x66')]['ids'][_0x2160af]),'UserId':Number(_0x4bf0e4[_0xa923('0x61')]['id'])});}return _0x4bf0e4['body']['ids'];});}})[_0xa923('0x22')](respondWithResult(_0x55af0a,null))[_0xa923('0x2c')](handleError(_0x55af0a,null));};exports[_0xa923('0x123')]=function(_0x425b5c,_0x50e8fb,_0x4aa08c){return db['User']['find']({'where':{'id':_0x425b5c[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x50e8fb,null))[_0xa923('0x22')](function(_0x58e6c8){if(_0x58e6c8){return _0x58e6c8[_0xa923('0x123')](_0x425b5c[_0xa923('0x4c')][_0xa923('0x69')])[_0xa923('0x22')](function(){if(_[_0xa923('0x11b')](_0x425b5c[_0xa923('0x4c')]['ids'])){for(var _0x4d64ef=0x0;_0x4d64ef<_0x425b5c[_0xa923('0x4c')][_0xa923('0x69')][_0xa923('0x52')];_0x4d64ef+=0x1){socket['emit'](_0xa923('0x124'),{'FaxInteractionId':Number(_0x425b5c[_0xa923('0x4c')]['ids'][_0x4d64ef]),'UserId':Number(_0x425b5c['params']['id'])});}}else{socket[_0xa923('0xa6')](_0xa923('0x124'),{'FaxInteractionId':Number(_0x425b5c[_0xa923('0x4c')]['ids']),'UserId':Number(_0x425b5c[_0xa923('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x50e8fb,null))[_0xa923('0x2c')](handleError(_0x50e8fb,null));};exports['addSmsInteractions']=function(_0x528d9c,_0x5a1ed3,_0x5e2c26){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x528d9c[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x5a1ed3,null))['then'](function(_0x3c9db9){if(_0x3c9db9){return _0x3c9db9[_0xa923('0x125')](_0x528d9c[_0xa923('0x66')][_0xa923('0x69')],_[_0xa923('0x101')](_0x528d9c[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{})[_0xa923('0xa2')](function(){for(var _0x32f1f0=0x0;_0x32f1f0<_0x528d9c[_0xa923('0x66')]['ids'][_0xa923('0x52')];_0x32f1f0+=0x1){socket[_0xa923('0xa6')](_0xa923('0x126'),{'SmsInteractionId':Number(_0x528d9c[_0xa923('0x66')][_0xa923('0x69')][_0x32f1f0]),'UserId':Number(_0x528d9c[_0xa923('0x61')]['id'])});}return _0x528d9c['body'][_0xa923('0x69')];});}})[_0xa923('0x22')](respondWithResult(_0x5a1ed3,null))[_0xa923('0x2c')](handleError(_0x5a1ed3,null));};exports[_0xa923('0x127')]=function(_0x1a9e53,_0x4493b4,_0x19ed8c){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x1a9e53[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x4493b4,null))[_0xa923('0x22')](function(_0x17c4e3){if(_0x17c4e3){return _0x17c4e3[_0xa923('0x127')](_0x1a9e53[_0xa923('0x4c')][_0xa923('0x69')])[_0xa923('0x22')](function(){if(_[_0xa923('0x11b')](_0x1a9e53['query'][_0xa923('0x69')])){for(var _0x43aa6b=0x0;_0x43aa6b<_0x1a9e53[_0xa923('0x4c')][_0xa923('0x69')]['length'];_0x43aa6b+=0x1){socket[_0xa923('0xa6')](_0xa923('0x128'),{'SmsInteractionId':Number(_0x1a9e53[_0xa923('0x4c')]['ids'][_0x43aa6b]),'UserId':Number(_0x1a9e53[_0xa923('0x61')]['id'])});}}else{socket[_0xa923('0xa6')](_0xa923('0x128'),{'SmsInteractionId':Number(_0x1a9e53[_0xa923('0x4c')][_0xa923('0x69')]),'UserId':Number(_0x1a9e53[_0xa923('0x61')]['id'])});}});}})[_0xa923('0x22')](respondWithStatusCode(_0x4493b4,null))[_0xa923('0x2c')](handleError(_0x4493b4,null));};exports[_0xa923('0x129')]=function(_0x3e592e,_0x3239b2,_0x3397ab){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x3e592e[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x3239b2,null))[_0xa923('0x22')](function(_0x41bd7c){if(_0x41bd7c){return _0x41bd7c[_0xa923('0x129')](_0x3e592e[_0xa923('0x66')][_0xa923('0x69')],_[_0xa923('0x101')](_0x3e592e[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{})['spread'](function(){for(var _0x389ec6=0x0;_0x389ec6<_0x3e592e['body'][_0xa923('0x69')][_0xa923('0x52')];_0x389ec6+=0x1){socket[_0xa923('0xa6')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x3e592e['body'][_0xa923('0x69')][_0x389ec6]),'UserId':Number(_0x3e592e[_0xa923('0x61')]['id'])});}return _0x3e592e[_0xa923('0x66')][_0xa923('0x69')];});}})[_0xa923('0x22')](respondWithResult(_0x3239b2,null))[_0xa923('0x2c')](handleError(_0x3239b2,null));};exports[_0xa923('0x12a')]=function(_0x146932,_0x4a530c,_0x292677){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x146932[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x4a530c,null))[_0xa923('0x22')](function(_0x324804){if(_0x324804){return _0x324804[_0xa923('0x12a')](_0x146932[_0xa923('0x4c')][_0xa923('0x69')])['then'](function(){if(_[_0xa923('0x11b')](_0x146932[_0xa923('0x4c')][_0xa923('0x69')])){for(var _0x1cdf7e=0x0;_0x1cdf7e<_0x146932[_0xa923('0x4c')]['ids']['length'];_0x1cdf7e+=0x1){socket[_0xa923('0xa6')](_0xa923('0x12b'),{'OpenchannelInteractionId':Number(_0x146932['query']['ids'][_0x1cdf7e]),'UserId':Number(_0x146932['params']['id'])});}}else{socket[_0xa923('0xa6')](_0xa923('0x12b'),{'OpenchannelInteractionId':Number(_0x146932['query'][_0xa923('0x69')]),'UserId':Number(_0x146932['params']['id'])});}});}})[_0xa923('0x22')](respondWithStatusCode(_0x4a530c,null))[_0xa923('0x2c')](handleError(_0x4a530c,null));};exports[_0xa923('0x12c')]=function(_0x13d8a6,_0xc10101,_0x334b4e){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x13d8a6[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0xc10101,null))[_0xa923('0x22')](function(_0xafdebf){if(_0xafdebf){return _0xafdebf[_0xa923('0x12c')](_0x13d8a6[_0xa923('0x66')][_0xa923('0x69')],_[_0xa923('0x101')](_0x13d8a6[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{})[_0xa923('0xa2')](function(){for(var _0x5efbeb=0x0;_0x5efbeb<_0x13d8a6['body'][_0xa923('0x69')][_0xa923('0x52')];_0x5efbeb+=0x1){socket[_0xa923('0xa6')](_0xa923('0x12d'),{'WhatsappInteractionId':Number(_0x13d8a6[_0xa923('0x66')][_0xa923('0x69')][_0x5efbeb]),'UserId':Number(_0x13d8a6[_0xa923('0x61')]['id'])});}return _0x13d8a6[_0xa923('0x66')]['ids'];});}})[_0xa923('0x22')](respondWithResult(_0xc10101,null))[_0xa923('0x2c')](handleError(_0xc10101,null));};exports['removeWhatsappInteractions']=function(_0x344b34,_0x3e0682,_0x5e4fb8){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x344b34[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x3e0682,null))[_0xa923('0x22')](function(_0x54b06b){if(_0x54b06b){return _0x54b06b['removeWhatsappInteractions'](_0x344b34[_0xa923('0x4c')][_0xa923('0x69')]);}})[_0xa923('0x22')](respondWithStatusCode(_0x3e0682,null))['catch'](handleError(_0x3e0682,null));};exports[_0xa923('0x12e')]=function(_0x59c567,_0x5b8064,_0x85ab6){var _0x51e5d1={};var _0x1ee3ef={};var _0x7d2c58;var _0xca5f89;return db[_0xa923('0x46')]['findOne']({'where':{'id':_0x59c567[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x5b8064,null))[_0xa923('0x22')](function(_0x1c99a7){if(_0x1c99a7){_0x7d2c58=_0x1c99a7;_0x1ee3ef[_0xa923('0x49')]=_[_0xa923('0x4d')](db[_0xa923('0x12f')][_0xa923('0x63')]);_0x1ee3ef[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x59c567['query']);_0x1ee3ef[_0xa923('0x4e')]=_['intersection'](_0x1ee3ef[_0xa923('0x49')],_0x1ee3ef[_0xa923('0x4c')]);_0x51e5d1[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x1ee3ef[_0xa923('0x49')],qs[_0xa923('0x50')](_0x59c567[_0xa923('0x4c')][_0xa923('0x50')]));_0x51e5d1['attributes']=_0x51e5d1['attributes']['length']?_0x51e5d1[_0xa923('0x51')]:_0x1ee3ef[_0xa923('0x49')];_0x51e5d1[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x59c567[_0xa923('0x4c')]['sort']);_0x51e5d1[_0xa923('0x56')]=qs['filters'](_[_0xa923('0x57')](_0x59c567[_0xa923('0x4c')],_0x1ee3ef[_0xa923('0x4e')]));if(_0x59c567['query'][_0xa923('0x3b')]){_0x51e5d1[_0xa923('0x56')]=_['merge'](_0x51e5d1[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x51e5d1[_0xa923('0x51')],function(_0x2db7ca){var _0x472657={};_0x472657[_0x2db7ca]={'$like':'%'+_0x59c567[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x472657;})});}_0x51e5d1=_[_0xa923('0x58')]({},_0x51e5d1,_0x59c567[_0xa923('0x5e')]);return _0x7d2c58[_0xa923('0x12e')](_0x51e5d1);}})[_0xa923('0x22')](function(_0x2e111d){if(_0x2e111d){_0xca5f89=_0x2e111d[_0xa923('0x52')];if(!_0x59c567[_0xa923('0x4c')][_0xa923('0xbb')]('nolimit')){_0x51e5d1[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x59c567['query']['limit']);_0x51e5d1[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x59c567[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x7d2c58[_0xa923('0x12e')](_0x51e5d1);}})['then'](function(_0x4f6e80){if(_0x4f6e80){return _0x4f6e80?{'count':_0xca5f89,'rows':_0x4f6e80}:null;}})[_0xa923('0x22')](respondWithResult(_0x5b8064,null))[_0xa923('0x2c')](handleError(_0x5b8064,null));};exports[_0xa923('0x130')]=function(_0x1f8559,_0x54d7e2,_0x21bb6f){var _0x3e6e65={};var _0x262f5d={};var _0x4b084c;var _0x4362d3;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x1f8559['params']['id']}})['then'](handleEntityNotFound(_0x54d7e2,null))['then'](function(_0x354ff0){if(_0x354ff0){_0x4b084c=_0x354ff0;_0x262f5d[_0xa923('0x49')]=_[_0xa923('0x4d')](db[_0xa923('0x131')]['rawAttributes']);_0x262f5d[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x1f8559[_0xa923('0x4c')]);_0x262f5d['filters']=_[_0xa923('0x4f')](_0x262f5d[_0xa923('0x49')],_0x262f5d[_0xa923('0x4c')]);_0x3e6e65[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x262f5d[_0xa923('0x49')],qs[_0xa923('0x50')](_0x1f8559['query'][_0xa923('0x50')]));_0x3e6e65[_0xa923('0x51')]=_0x3e6e65[_0xa923('0x51')][_0xa923('0x52')]?_0x3e6e65[_0xa923('0x51')]:_0x262f5d[_0xa923('0x49')];_0x3e6e65['order']=qs[_0xa923('0x55')](_0x1f8559[_0xa923('0x4c')][_0xa923('0x55')]);_0x3e6e65[_0xa923('0x56')]=qs['filters'](_['pick'](_0x1f8559['query'],_0x262f5d[_0xa923('0x4e')]));if(_0x1f8559['query'][_0xa923('0x3b')]){_0x3e6e65[_0xa923('0x56')]=_[_0xa923('0x58')](_0x3e6e65[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x3e6e65['attributes'],function(_0x9856f7){var _0x43a8fe={};_0x43a8fe[_0x9856f7]={'$like':'%'+_0x1f8559[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x43a8fe;})});}_0x3e6e65=_[_0xa923('0x58')]({},_0x3e6e65,_0x1f8559[_0xa923('0x5e')]);return _0x4b084c[_0xa923('0x130')](_0x3e6e65);}})[_0xa923('0x22')](function(_0x55b404){if(_0x55b404){_0x4362d3=_0x55b404[_0xa923('0x52')];if(!_0x1f8559[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x3e6e65[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x1f8559['query'][_0xa923('0x32')]);_0x3e6e65[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x1f8559[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x4b084c[_0xa923('0x130')](_0x3e6e65);}})[_0xa923('0x22')](function(_0x1bdb1c){if(_0x1bdb1c){return _0x1bdb1c?{'count':_0x4362d3,'rows':_0x1bdb1c}:null;}})[_0xa923('0x22')](respondWithResult(_0x54d7e2,null))['catch'](handleError(_0x54d7e2,null));};exports['addFaxAccounts']=function(_0x44ea7e,_0x15e419,_0x33c8d9){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x44ea7e['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x15e419,null))[_0xa923('0x22')](function(_0x41ae8c){if(_0x41ae8c){return _0x41ae8c['addFaxAccounts'](_0x44ea7e[_0xa923('0x66')]['ids'],_[_0xa923('0x101')](_0x44ea7e[_0xa923('0x66')],['ids','id'])||{});}})['then'](respondWithResult(_0x15e419,null))['catch'](handleError(_0x15e419,null));};exports[_0xa923('0x132')]=function(_0x4f2e66,_0x37d3fe,_0x434b00){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x4f2e66[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x37d3fe,null))['then'](function(_0x3c705d){if(_0x3c705d){return _0x3c705d[_0xa923('0x132')](_0x4f2e66['query'][_0xa923('0x69')]);}})[_0xa923('0x22')](respondWithStatusCode(_0x37d3fe,null))[_0xa923('0x2c')](handleError(_0x37d3fe,null));};exports[_0xa923('0x133')]=function(_0x2a7250,_0x20979d,_0x334da9){var _0x3ed723={};var _0x10af17={};var _0x4ca775;var _0x3d1fcc;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x2a7250[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x20979d,null))['then'](function(_0x328d37){if(_0x328d37){_0x4ca775=_0x328d37;_0x10af17[_0xa923('0x49')]=_[_0xa923('0x4d')](db['MailAccount']['rawAttributes']);_0x10af17[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x2a7250[_0xa923('0x4c')]);_0x10af17[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x10af17['model'],_0x10af17[_0xa923('0x4c')]);_0x3ed723['attributes']=_['intersection'](_0x10af17[_0xa923('0x49')],qs[_0xa923('0x50')](_0x2a7250[_0xa923('0x4c')][_0xa923('0x50')]));_0x3ed723[_0xa923('0x51')]=_0x3ed723['attributes'][_0xa923('0x52')]?_0x3ed723[_0xa923('0x51')]:_0x10af17[_0xa923('0x49')];_0x3ed723[_0xa923('0x54')]=qs['sort'](_0x2a7250[_0xa923('0x4c')][_0xa923('0x55')]);_0x3ed723[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x2a7250['query'],_0x10af17[_0xa923('0x4e')]));if(_0x2a7250['query'][_0xa923('0x3b')]){_0x3ed723[_0xa923('0x56')]=_[_0xa923('0x58')](_0x3ed723[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x3ed723[_0xa923('0x51')],function(_0x51cad5){var _0x2bcfd0={};_0x2bcfd0[_0x51cad5]={'$like':'%'+_0x2a7250[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x2bcfd0;})});}_0x3ed723=_[_0xa923('0x58')]({},_0x3ed723,_0x2a7250[_0xa923('0x5e')]);return _0x4ca775[_0xa923('0x133')](_0x3ed723);}})[_0xa923('0x22')](function(_0x460e39){if(_0x460e39){_0x3d1fcc=_0x460e39[_0xa923('0x52')];if(!_0x2a7250[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x3ed723[_0xa923('0x32')]=qs['limit'](_0x2a7250[_0xa923('0x4c')]['limit']);_0x3ed723[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x2a7250[_0xa923('0x4c')]['offset']);}return _0x4ca775[_0xa923('0x133')](_0x3ed723);}})[_0xa923('0x22')](function(_0x18083d){if(_0x18083d){return _0x18083d?{'count':_0x3d1fcc,'rows':_0x18083d}:null;}})[_0xa923('0x22')](respondWithResult(_0x20979d,null))['catch'](handleError(_0x20979d,null));};exports[_0xa923('0x134')]=function(_0x467c6c,_0x25c678,_0x32841a){return db[_0xa923('0x46')]['find']({'where':{'id':_0x467c6c[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x25c678,null))[_0xa923('0x22')](function(_0x224211){if(_0x224211){return _0x224211[_0xa923('0x134')](_0x467c6c[_0xa923('0x66')][_0xa923('0x69')],_[_0xa923('0x101')](_0x467c6c[_0xa923('0x66')],['ids','id'])||{});}})[_0xa923('0x22')](respondWithResult(_0x25c678,null))[_0xa923('0x2c')](handleError(_0x25c678,null));};exports[_0xa923('0x135')]=function(_0x4af8e2,_0x40a611,_0xd3787f){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x4af8e2[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x40a611,null))['then'](function(_0x5ce2bb){if(_0x5ce2bb){return _0x5ce2bb[_0xa923('0x135')](_0x4af8e2[_0xa923('0x4c')]['ids']);}})[_0xa923('0x22')](respondWithStatusCode(_0x40a611,null))[_0xa923('0x2c')](handleError(_0x40a611,null));};exports[_0xa923('0x136')]=function(_0x2158b6,_0x5a9685,_0x21f7c0){var _0x2c7251={};var _0x3dca4e={};var _0x5ea9fc;var _0x5e308e;return db[_0xa923('0x46')]['findOne']({'where':{'id':_0x2158b6[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x5a9685,null))[_0xa923('0x22')](function(_0xa37add){if(_0xa37add){_0x5ea9fc=_0xa37add;_0x3dca4e[_0xa923('0x49')]=_[_0xa923('0x4d')](db[_0xa923('0x137')][_0xa923('0x63')]);_0x3dca4e[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x2158b6['query']);_0x3dca4e[_0xa923('0x4e')]=_['intersection'](_0x3dca4e['model'],_0x3dca4e['query']);_0x2c7251['attributes']=_[_0xa923('0x4f')](_0x3dca4e['model'],qs[_0xa923('0x50')](_0x2158b6[_0xa923('0x4c')][_0xa923('0x50')]));_0x2c7251['attributes']=_0x2c7251[_0xa923('0x51')][_0xa923('0x52')]?_0x2c7251[_0xa923('0x51')]:_0x3dca4e[_0xa923('0x49')];_0x2c7251[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x2158b6[_0xa923('0x4c')][_0xa923('0x55')]);_0x2c7251['where']=qs['filters'](_[_0xa923('0x57')](_0x2158b6['query'],_0x3dca4e['filters']));if(_0x2158b6[_0xa923('0x4c')][_0xa923('0x3b')]){_0x2c7251[_0xa923('0x56')]=_[_0xa923('0x58')](_0x2c7251['where'],{'$or':_[_0xa923('0x45')](_0x2c7251[_0xa923('0x51')],function(_0x5b633e){var _0x4bd47a={};_0x4bd47a[_0x5b633e]={'$like':'%'+_0x2158b6[_0xa923('0x4c')]['filter']+'%'};return _0x4bd47a;})});}_0x2c7251=_[_0xa923('0x58')]({},_0x2c7251,_0x2158b6['options']);return _0x5ea9fc[_0xa923('0x136')](_0x2c7251);}})[_0xa923('0x22')](function(_0x1adee0){if(_0x1adee0){_0x5e308e=_0x1adee0[_0xa923('0x52')];if(!_0x2158b6['query']['hasOwnProperty']('nolimit')){_0x2c7251['limit']=qs['limit'](_0x2158b6['query'][_0xa923('0x32')]);_0x2c7251[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x2158b6[_0xa923('0x4c')]['offset']);}return _0x5ea9fc[_0xa923('0x136')](_0x2c7251);}})['then'](function(_0x1e7124){if(_0x1e7124){return _0x1e7124?{'count':_0x5e308e,'rows':_0x1e7124}:null;}})[_0xa923('0x22')](respondWithResult(_0x5a9685,null))['catch'](handleError(_0x5a9685,null));};exports[_0xa923('0x138')]=function(_0x593908,_0x31b52d,_0x18e655){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x593908['params']['id']}})['then'](handleEntityNotFound(_0x31b52d,null))['then'](function(_0x55dca0){if(_0x55dca0){return _0x55dca0[_0xa923('0x138')](_0x593908[_0xa923('0x66')]['ids'],_[_0xa923('0x101')](_0x593908[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{});}})[_0xa923('0x22')](respondWithResult(_0x31b52d,null))[_0xa923('0x2c')](handleError(_0x31b52d,null));};exports[_0xa923('0x139')]=function(_0x50eb6d,_0x3d8561,_0x57fa27){return db['User']['find']({'where':{'id':_0x50eb6d['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x3d8561,null))['then'](function(_0x4581b9){if(_0x4581b9){return _0x4581b9['removeOpenchannelAccounts'](_0x50eb6d[_0xa923('0x4c')][_0xa923('0x69')]);}})[_0xa923('0x22')](respondWithStatusCode(_0x3d8561,null))[_0xa923('0x2c')](handleError(_0x3d8561,null));};exports[_0xa923('0x13a')]=function(_0x581a52,_0x8395ad,_0x4c97e4){var _0x713179={};var _0x168b12={};var _0x344d2b;var _0x380c35;return db['User'][_0xa923('0x93')]({'where':{'id':_0x581a52[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x8395ad,null))['then'](function(_0x278813){if(_0x278813){_0x344d2b=_0x278813;_0x168b12[_0xa923('0x49')]=_[_0xa923('0x4d')](db['SmsAccount']['rawAttributes']);_0x168b12[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x581a52['query']);_0x168b12[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x168b12['model'],_0x168b12[_0xa923('0x4c')]);_0x713179[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x168b12[_0xa923('0x49')],qs[_0xa923('0x50')](_0x581a52[_0xa923('0x4c')]['fields']));_0x713179[_0xa923('0x51')]=_0x713179[_0xa923('0x51')][_0xa923('0x52')]?_0x713179['attributes']:_0x168b12[_0xa923('0x49')];_0x713179[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x581a52[_0xa923('0x4c')][_0xa923('0x55')]);_0x713179[_0xa923('0x56')]=qs[_0xa923('0x4e')](_['pick'](_0x581a52[_0xa923('0x4c')],_0x168b12[_0xa923('0x4e')]));if(_0x581a52[_0xa923('0x4c')][_0xa923('0x3b')]){_0x713179[_0xa923('0x56')]=_['merge'](_0x713179[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x713179['attributes'],function(_0x3bf311){var _0x250373={};_0x250373[_0x3bf311]={'$like':'%'+_0x581a52[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x250373;})});}_0x713179=_[_0xa923('0x58')]({},_0x713179,_0x581a52['options']);return _0x344d2b[_0xa923('0x13a')](_0x713179);}})[_0xa923('0x22')](function(_0x17d5ad){if(_0x17d5ad){_0x380c35=_0x17d5ad[_0xa923('0x52')];if(!_0x581a52['query'][_0xa923('0xbb')](_0xa923('0x53'))){_0x713179[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x581a52[_0xa923('0x4c')][_0xa923('0x32')]);_0x713179[_0xa923('0x31')]=qs['offset'](_0x581a52['query'][_0xa923('0x31')]);}return _0x344d2b[_0xa923('0x13a')](_0x713179);}})[_0xa923('0x22')](function(_0x414f4e){if(_0x414f4e){return _0x414f4e?{'count':_0x380c35,'rows':_0x414f4e}:null;}})['then'](respondWithResult(_0x8395ad,null))['catch'](handleError(_0x8395ad,null));};exports[_0xa923('0x13b')]=function(_0x79144,_0xf99671,_0x435f29){return db[_0xa923('0x46')]['find']({'where':{'id':_0x79144[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0xf99671,null))[_0xa923('0x22')](function(_0x2121c9){if(_0x2121c9){return _0x2121c9['addSmsAccounts'](_0x79144['body'][_0xa923('0x69')],_['omit'](_0x79144[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{});}})[_0xa923('0x22')](respondWithResult(_0xf99671,null))['catch'](handleError(_0xf99671,null));};exports[_0xa923('0x13c')]=function(_0x3cb7a0,_0x40674e,_0x3bf1b4){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x3cb7a0[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x40674e,null))[_0xa923('0x22')](function(_0xe669e8){if(_0xe669e8){return _0xe669e8['removeSmsAccounts'](_0x3cb7a0['query']['ids']);}})[_0xa923('0x22')](respondWithStatusCode(_0x40674e,null))[_0xa923('0x2c')](handleError(_0x40674e,null));};exports[_0xa923('0x13d')]=function(_0x21f59f,_0x233cfd,_0x386e20){var _0x2edac0={};var _0x1f0ecf={};var _0x1a32b6;var _0x45630c;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x21f59f[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x233cfd,null))['then'](function(_0x42f2e0){if(_0x42f2e0){_0x1a32b6=_0x42f2e0;_0x1f0ecf['model']=_[_0xa923('0x4d')](db[_0xa923('0x13e')][_0xa923('0x63')]);_0x1f0ecf[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x21f59f[_0xa923('0x4c')]);_0x1f0ecf[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x1f0ecf[_0xa923('0x49')],_0x1f0ecf[_0xa923('0x4c')]);_0x2edac0[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x1f0ecf[_0xa923('0x49')],qs[_0xa923('0x50')](_0x21f59f[_0xa923('0x4c')][_0xa923('0x50')]));_0x2edac0[_0xa923('0x51')]=_0x2edac0[_0xa923('0x51')]['length']?_0x2edac0[_0xa923('0x51')]:_0x1f0ecf['model'];_0x2edac0[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x21f59f['query']['sort']);_0x2edac0[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x21f59f[_0xa923('0x4c')],_0x1f0ecf[_0xa923('0x4e')]));if(_0x21f59f[_0xa923('0x4c')][_0xa923('0x3b')]){_0x2edac0[_0xa923('0x56')]=_['merge'](_0x2edac0[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x2edac0['attributes'],function(_0x9e49c6){var _0x1fcc5d={};_0x1fcc5d[_0x9e49c6]={'$like':'%'+_0x21f59f[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x1fcc5d;})});}_0x2edac0=_['merge']({},_0x2edac0,_0x21f59f[_0xa923('0x5e')]);return _0x1a32b6[_0xa923('0x13d')](_0x2edac0);}})[_0xa923('0x22')](function(_0x106d2b){if(_0x106d2b){_0x45630c=_0x106d2b[_0xa923('0x52')];if(!_0x21f59f[_0xa923('0x4c')][_0xa923('0xbb')]('nolimit')){_0x2edac0[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x21f59f[_0xa923('0x4c')][_0xa923('0x32')]);_0x2edac0['offset']=qs['offset'](_0x21f59f['query']['offset']);}return _0x1a32b6[_0xa923('0x13d')](_0x2edac0);}})[_0xa923('0x22')](function(_0x128359){if(_0x128359){return _0x128359?{'count':_0x45630c,'rows':_0x128359}:null;}})[_0xa923('0x22')](respondWithResult(_0x233cfd,null))[_0xa923('0x2c')](handleError(_0x233cfd,null));};exports[_0xa923('0x13f')]=function(_0x44e30a,_0x1ac6fe,_0x1ba444){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x44e30a['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x1ac6fe,null))['then'](function(_0x160d7f){if(_0x160d7f){return _0x160d7f[_0xa923('0x13f')](_0x44e30a[_0xa923('0x66')][_0xa923('0x69')],_['omit'](_0x44e30a[_0xa923('0x66')],['ids','id'])||{});}})[_0xa923('0x22')](respondWithResult(_0x1ac6fe,null))[_0xa923('0x2c')](handleError(_0x1ac6fe,null));};exports['removeChatWebsites']=function(_0x2929be,_0x2e55dd,_0x300f9e){return db['User'][_0xa923('0x3e')]({'where':{'id':_0x2929be[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x2e55dd,null))[_0xa923('0x22')](function(_0x531bd1){if(_0x531bd1){return _0x531bd1['removeChatWebsites'](_0x2929be['query'][_0xa923('0x69')]);}})[_0xa923('0x22')](respondWithStatusCode(_0x2e55dd,null))[_0xa923('0x2c')](handleError(_0x2e55dd,null));};exports[_0xa923('0x140')]=function(_0x6510cc,_0x444022,_0x2e06e5){var _0x5dc433={};var _0x191d66={};var _0x528609;var _0x33d774;return db['User'][_0xa923('0x93')]({'where':{'id':_0x6510cc[_0xa923('0x61')]['id']}})['then'](handleEntityNotFound(_0x444022,null))[_0xa923('0x22')](function(_0x2df41b){if(_0x2df41b){_0x528609=_0x2df41b;_0x191d66['model']=_['keys'](db['WhatsappAccount']['rawAttributes']);_0x191d66[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x6510cc[_0xa923('0x4c')]);_0x191d66[_0xa923('0x4e')]=_[_0xa923('0x4f')](_0x191d66['model'],_0x191d66[_0xa923('0x4c')]);_0x5dc433[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x191d66[_0xa923('0x49')],qs[_0xa923('0x50')](_0x6510cc[_0xa923('0x4c')][_0xa923('0x50')]));_0x5dc433[_0xa923('0x51')]=_0x5dc433['attributes'][_0xa923('0x52')]?_0x5dc433[_0xa923('0x51')]:_0x191d66[_0xa923('0x49')];_0x5dc433['order']=qs['sort'](_0x6510cc[_0xa923('0x4c')][_0xa923('0x55')]);_0x5dc433[_0xa923('0x56')]=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x6510cc[_0xa923('0x4c')],_0x191d66['filters']));if(_0x6510cc[_0xa923('0x4c')][_0xa923('0x3b')]){_0x5dc433['where']=_[_0xa923('0x58')](_0x5dc433[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x5dc433[_0xa923('0x51')],function(_0x3f0e41){var _0x2c5cb4={};_0x2c5cb4[_0x3f0e41]={'$like':'%'+_0x6510cc[_0xa923('0x4c')][_0xa923('0x3b')]+'%'};return _0x2c5cb4;})});}_0x5dc433=_[_0xa923('0x58')]({},_0x5dc433,_0x6510cc[_0xa923('0x5e')]);return _0x528609[_0xa923('0x140')](_0x5dc433);}})['then'](function(_0x52ea25){if(_0x52ea25){_0x33d774=_0x52ea25['length'];if(!_0x6510cc[_0xa923('0x4c')][_0xa923('0xbb')](_0xa923('0x53'))){_0x5dc433[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x6510cc[_0xa923('0x4c')][_0xa923('0x32')]);_0x5dc433[_0xa923('0x31')]=qs['offset'](_0x6510cc[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x528609[_0xa923('0x140')](_0x5dc433);}})[_0xa923('0x22')](function(_0x456315){if(_0x456315){return _0x456315?{'count':_0x33d774,'rows':_0x456315}:null;}})[_0xa923('0x22')](respondWithResult(_0x444022,null))[_0xa923('0x2c')](handleError(_0x444022,null));};exports[_0xa923('0x141')]=function(_0x1c730e,_0x593867,_0x5dba2a){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x1c730e['params']['id']}})['then'](handleEntityNotFound(_0x593867,null))['then'](function(_0x4d965a){if(_0x4d965a){return _0x4d965a['addWhatsappAccounts'](_0x1c730e[_0xa923('0x66')][_0xa923('0x69')],_[_0xa923('0x101')](_0x1c730e[_0xa923('0x66')],[_0xa923('0x69'),'id'])||{});}})[_0xa923('0x22')](respondWithResult(_0x593867,null))[_0xa923('0x2c')](handleError(_0x593867,null));};exports[_0xa923('0x142')]=function(_0x5e1002,_0x2806ab,_0x514f1f){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x5e1002[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x2806ab,null))[_0xa923('0x22')](function(_0x38e853){if(_0x38e853){return _0x38e853[_0xa923('0x142')](_0x5e1002[_0xa923('0x4c')][_0xa923('0x69')]);}})[_0xa923('0x22')](respondWithStatusCode(_0x2806ab,null))['catch'](handleError(_0x2806ab,null));};exports[_0xa923('0x143')]=function(_0x3338d7,_0x433651,_0x303dfc){var _0x555b93={};var _0x119254={};var _0x1f4757;var _0x5512e0;return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x3338d7[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x433651,null))[_0xa923('0x22')](function(_0x393de5){if(_0x393de5){_0x1f4757=_0x393de5;_0x119254[_0xa923('0x49')]=_[_0xa923('0x4d')](db[_0xa923('0x144')][_0xa923('0x63')]);_0x119254[_0xa923('0x4c')]=_[_0xa923('0x4d')](_0x3338d7['query']);_0x119254['filters']=_[_0xa923('0x4f')](_0x119254[_0xa923('0x49')],_0x119254[_0xa923('0x4c')]);_0x555b93['attributes']=_[_0xa923('0x4f')](_0x119254[_0xa923('0x49')],qs[_0xa923('0x50')](_0x3338d7[_0xa923('0x4c')][_0xa923('0x50')]));_0x555b93[_0xa923('0x51')]=_0x555b93['attributes']['length']?_0x555b93[_0xa923('0x51')]:_0x119254[_0xa923('0x49')];_0x555b93[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x3338d7[_0xa923('0x4c')][_0xa923('0x55')]);_0x555b93[_0xa923('0x56')]=qs['filters'](_['pick'](_0x3338d7[_0xa923('0x4c')],_0x119254[_0xa923('0x4e')]));if(_0x3338d7[_0xa923('0x4c')][_0xa923('0x3b')]){_0x555b93['where']=_[_0xa923('0x58')](_0x555b93[_0xa923('0x56')],{'$or':_['map'](_0x555b93[_0xa923('0x51')],function(_0x3ad736){var _0x2b05b3={};_0x2b05b3[_0x3ad736]={'$like':'%'+_0x3338d7['query']['filter']+'%'};return _0x2b05b3;})});}_0x555b93=_['merge']({},_0x555b93,_0x3338d7[_0xa923('0x5e')]);return _0x1f4757[_0xa923('0x143')](_0x555b93);}})[_0xa923('0x22')](function(_0x3bc66f){if(_0x3bc66f){_0x5512e0=_0x3bc66f[_0xa923('0x52')];if(!_0x3338d7[_0xa923('0x4c')][_0xa923('0xbb')]('nolimit')){_0x555b93[_0xa923('0x32')]=qs['limit'](_0x3338d7[_0xa923('0x4c')][_0xa923('0x32')]);_0x555b93[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x3338d7[_0xa923('0x4c')][_0xa923('0x31')]);}return _0x1f4757[_0xa923('0x143')](_0x555b93);}})[_0xa923('0x22')](function(_0x4dc30e){if(_0x4dc30e){return _0x4dc30e?{'count':_0x5512e0,'rows':_0x4dc30e}:null;}})[_0xa923('0x22')](respondWithResult(_0x433651,null))[_0xa923('0x2c')](handleError(_0x433651,null));};exports[_0xa923('0x145')]=function(_0x2b5000,_0x533c7e,_0x535ffd){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x2b5000['params']['id']}})['then'](handleEntityNotFound(_0x533c7e,null))[_0xa923('0x22')](function(_0x25678a){if(_0x25678a){return _0x25678a[_0xa923('0x145')](_0x2b5000[_0xa923('0x66')][_0xa923('0x69')],_[_0xa923('0x101')](_0x2b5000[_0xa923('0x66')],['ids','id'])||{});}})[_0xa923('0x22')](respondWithResult(_0x533c7e,null))['catch'](handleError(_0x533c7e,null));};exports[_0xa923('0x146')]=function(_0x1b3593,_0x148436,_0x43dd41){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x1b3593['params']['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x148436,null))[_0xa923('0x22')](function(_0x191c6c){if(_0x191c6c){return _0x191c6c[_0xa923('0x146')](_0x1b3593[_0xa923('0x4c')][_0xa923('0x69')]);}})[_0xa923('0x22')](respondWithStatusCode(_0x148436,null))[_0xa923('0x2c')](handleError(_0x148436,null));};exports[_0xa923('0x147')]=function(_0x2e1a52,_0x7e9159){var _0x98e9c1={},_0x41c1cf={},_0x56b73b={'count':0x0,'rows':[]};var _0x2d2157=db[_0xa923('0x148')]['rawAttributes'];_0x41c1cf[_0xa923('0x49')]=_['keys'](_0x2d2157);_0x41c1cf[_0xa923('0x4c')]=_['keys'](_0x2e1a52[_0xa923('0x4c')]);_0x41c1cf['filters']=_['intersection'](_0x41c1cf[_0xa923('0x49')],_0x41c1cf[_0xa923('0x4c')]);_0x41c1cf[_0xa923('0x4e')]=_['concat'](_0x41c1cf[_0xa923('0x4e')],[_0xa923('0x149'),_0xa923('0x14a'),_0xa923('0x14b'),_0xa923('0x14c'),_0xa923('0x14d'),'$lte','$ne',_0xa923('0x14e'),'$not',_0xa923('0x14f'),_0xa923('0x150'),_0xa923('0x151'),'$notIn',_0xa923('0x152'),_0xa923('0x153'),_0xa923('0x154'),'$notILike',_0xa923('0x152'),'$overlap',_0xa923('0x155'),_0xa923('0x156'),_0xa923('0x157')]);_0x98e9c1[_0xa923('0x51')]=_[_0xa923('0x4f')](_0x41c1cf[_0xa923('0x49')],qs[_0xa923('0x50')](_0x2e1a52[_0xa923('0x4c')][_0xa923('0x50')]));_0x98e9c1[_0xa923('0x51')]=_0x98e9c1[_0xa923('0x51')]['length']?_0x98e9c1[_0xa923('0x51')]:_0x41c1cf['model'];if(!_0x2e1a52[_0xa923('0x4c')]['hasOwnProperty'](_0xa923('0x53'))){_0x98e9c1[_0xa923('0x32')]=qs[_0xa923('0x32')](_0x2e1a52[_0xa923('0x4c')][_0xa923('0x32')]);_0x98e9c1[_0xa923('0x31')]=qs[_0xa923('0x31')](_0x2e1a52['query']['offset']);}_0x98e9c1[_0xa923('0x54')]=qs[_0xa923('0x55')](_0x2e1a52[_0xa923('0x4c')][_0xa923('0x55')]);_0x98e9c1['where']=qs[_0xa923('0x4e')](_[_0xa923('0x57')](_0x2e1a52['query'],_0x41c1cf[_0xa923('0x4e')]));if(_0x2e1a52[_0xa923('0x4c')]['filter']){_0x98e9c1[_0xa923('0x56')]=_[_0xa923('0x58')](_0x98e9c1[_0xa923('0x56')],{'$or':_[_0xa923('0x45')](_0x98e9c1[_0xa923('0x51')],function(_0x216f08){var _0xecf2f4={};_0xecf2f4[_0x216f08]={'$like':'%'+_0x2e1a52['query'][_0xa923('0x3b')]+'%'};return _0xecf2f4;})});}_0x98e9c1[_0xa923('0x56')]={'$and':[_0x98e9c1[_0xa923('0x56')],{'$or':[{'UserId':_0x2e1a52['params']['id']},{'OwnerId':_0x2e1a52['params']['id']}]}]};_0x98e9c1=_[_0xa923('0x58')]({},_0x98e9c1,_0x2e1a52['options']);var _0x18954b={'where':_0x98e9c1[_0xa923('0x56')]};return db[_0xa923('0x148')][_0xa923('0x5f')](_0x18954b)[_0xa923('0x22')](function(_0x1e84a2){_0x56b73b[_0xa923('0x5f')]=_0x1e84a2;if(_0x2e1a52[_0xa923('0x4c')][_0xa923('0x64')]){_0x98e9c1['include']=[{'attributes':['id',_0xa923('0x158'),'lastName',_0xa923('0xd4')],'model':db[_0xa923('0xba')],'as':'Contact'},{'attributes':['id',_0xa923('0x3f'),_0xa923('0x159')],'model':db[_0xa923('0xa9')],'as':_0xa923('0xc3')}];}return db[_0xa923('0x148')][_0xa923('0xc4')](_0x98e9c1);})[_0xa923('0x22')](function(_0x5d6fd6){_0x56b73b[_0xa923('0xca')]=_0x5d6fd6;return _0x56b73b;})['then'](respondWithFilteredResult(_0x7e9159,_0x98e9c1))[_0xa923('0x2c')](handleError(_0x7e9159,null));};exports[_0xa923('0x15a')]=function(_0x42b9b4,_0x5c65a3,_0x460987){if(!_[_0xa923('0x6f')](_0x42b9b4[_0xa923('0x38')]['id'])&&(_0x42b9b4['user'][_0xa923('0x3d')]==_0xa923('0x6c')||_0x42b9b4['user'][_0xa923('0x3d')]==_0xa923('0x38'))){return db[_0xa923('0x46')][_0xa923('0x93')]({'where':{'id':_0x42b9b4[_0xa923('0x61')]['id']},'raw':!![]})['then'](function(_0x2bfb64){return authService[_0xa923('0x15b')](_0x2bfb64);})[_0xa923('0x22')](function(_0x387b74){if(_0x387b74){return _0x5c65a3['status'](0xc8)[_0xa923('0x30')]({'api_key':_0x387b74[_0xa923('0x15c')]});}else{return _0x5c65a3[_0xa923('0x2f')](0xcc)[_0xa923('0x30')]({'message':_0xa923('0x15d')});}})[_0xa923('0x2c')](handleError(_0x5c65a3,0x193));}else{return _0x5c65a3[_0xa923('0x2f')](0x191)[_0xa923('0x30')]({'message':_0xa923('0x15e')});}};exports[_0xa923('0x15f')]=function(_0x125223,_0x4e7039,_0x1827ee){if(!_[_0xa923('0x6f')](_0x125223[_0xa923('0x38')]['id'])&&(_0x125223[_0xa923('0x38')][_0xa923('0x3d')]==_0xa923('0x6c')||_0x125223[_0xa923('0x38')][_0xa923('0x3d')]==_0xa923('0x38'))){return db['User']['find']({'where':{'id':_0x125223[_0xa923('0x61')]['id']}})[_0xa923('0x22')](function(_0x3aafa9){return authService[_0xa923('0x160')](_0x3aafa9);})['then'](function(_0x359432){return db[_0xa923('0x46')][_0xa923('0x36')]({'apiKeyIat':_0x359432[_0xa923('0x161')],'apiKeyNonce':_0x359432['nonce']},{'where':{'id':_0x125223[_0xa923('0x61')]['id']}})[_0xa923('0x22')](function(){return _0x4e7039[_0xa923('0x2f')](0xc8)['json']({'api_key':_0x359432[_0xa923('0x15c')]});});})['catch'](handleError(_0x4e7039,0x193));}else{return _0x4e7039[_0xa923('0x2f')](0x191)[_0xa923('0x30')]({'message':_0xa923('0x15e')});}};exports[_0xa923('0x162')]=function(_0x5a976a,_0x5170a3,_0x2d0145){if(!_[_0xa923('0x6f')](_0x5a976a[_0xa923('0x38')]['id'])&&(_0x5a976a[_0xa923('0x38')][_0xa923('0x3d')]==_0xa923('0x6c')||_0x5a976a[_0xa923('0x38')][_0xa923('0x3d')]==_0xa923('0x38'))){return db[_0xa923('0x46')][_0xa923('0x3e')]({'where':{'id':_0x5a976a[_0xa923('0x61')]['id']}})[_0xa923('0x22')](handleEntityNotFound(_0x5170a3,null))[_0xa923('0x22')](function(_0x198cd3){if(_0x198cd3&&_0x198cd3[_0xa923('0x163')]&&_0x198cd3[_0xa923('0x164')])return _0x198cd3;else throw{'message':_0xa923('0x165')};})[_0xa923('0x22')](function(_0x18d653){return db['User'][_0xa923('0x36')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x5a976a['params']['id']}});})[_0xa923('0x22')](respondWithStatusCode(_0x5170a3,0xc8))['catch'](handleError(_0x5170a3,0x193));}else{return _0x5170a3[_0xa923('0x2f')](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xa923('0x166')]=function(_0xbdb30c,_0x27e904){var _0x27d4d5=_0xbdb30c[_0xa923('0x38')][_0xa923('0x8d')]({'plain':!![]});if(!_0x27d4d5){return _0x27e904[_0xa923('0x2f')](0x191)[_0xa923('0x43')](_0xa923('0x8e'));}else{return _0x27e904[_0xa923('0x2f')](0xc8)['json'](_0x27d4d5);}};
\ No newline at end of file
index 671ea55..41ceb38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef4d=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','User'];(function(_0x41bea0,_0x161b39){var _0x25186a=function(_0x539d05){while(--_0x539d05){_0x41bea0['push'](_0x41bea0['shift']());}};_0x25186a(++_0x161b39);}(_0xef4d,0x165));var _0xdef4=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xef4d[_0x39d544];return _0x5a5ff2;};'use strict';var EventEmitter=require(_0xdef4('0x0'));var User=require(_0xdef4('0x1'))['db'][_0xdef4('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xdef4('0x3')](0x0);var events={'afterCreate':_0xdef4('0x4'),'afterUpdate':_0xdef4('0x5'),'afterDestroy':_0xdef4('0x6')};function emitEvent(_0x313693){return function(_0x71c4c5,_0x267244,_0x2f501c){UserEvents[_0xdef4('0x7')](_0x313693+':'+_0x71c4c5['id'],_0x71c4c5);UserEvents[_0xdef4('0x7')](_0x313693,_0x71c4c5);_0x2f501c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0xdef4('0x8')](e,emitEvent(event));}}module[_0xdef4('0x9')]=UserEvents;
\ No newline at end of file
+var _0xe08b=['events','User','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe08b,0x10e));var _0xbe08=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xe08b[_0x487b0c];return _0x1adbdc;};'use strict';var EventEmitter=require(_0xbe08('0x0'));var User=require('../../mysqldb')['db'][_0xbe08('0x1')];var UserEvents=new EventEmitter();UserEvents[_0xbe08('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe08('0x3'),'afterDestroy':_0xbe08('0x4')};function emitEvent(_0x27b8f8){return function(_0x469522,_0x41edfb,_0x1ba7e6){UserEvents[_0xbe08('0x5')](_0x27b8f8+':'+_0x469522['id'],_0x469522);UserEvents[_0xbe08('0x5')](_0x27b8f8,_0x469522);_0x1ba7e6(null);};}for(var e in events){if(events[_0xbe08('0x6')](e)){var event=events[e];User[_0xbe08('0x7')](e,emitEvent(event));}}module[_0xbe08('0x8')]=UserEvents;
\ No newline at end of file
index c692311..eae4792 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x857b=['users','utf8','utf8_bin','updateMd5Password','updatePassword','VoiceExtension','bulkCreate','changed','context','destroy','encryptPassword','function','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','md5secret',':asterisk:','util','md5','lodash','google','length','from-sip','system','%s%s','prefix','push','merge','format','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','WAV','gsm','Set','CDR(type)=internal','includes','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Dial','SIP/%s,,tTxX','Hangup','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','exports','define','User'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0x857b,0x12b));var _0xb857=function(_0x40e443,_0x7c1f0e){_0x40e443=_0x40e443-0x0;var _0x24ae6c=_0x857b[_0x40e443];return _0x24ae6c;};'use strict';var BPromise=require('bluebird');var crypto=require('crypto');var util=require(_0xb857('0x0'));var md5=require(_0xb857('0x1'));var _=require(_0xb857('0x2'));var attributes=require('./user.attributes');var authTypes=[_0xb857('0x3')];var validatePresenceOf=function(_0x369e26){return _0x369e26&&_0x369e26[_0xb857('0x4')];};var getChanSpyApplications=function(_0xc0b3b7,_0x45be34,_0x3d558f){var _0x1c2805={'context':_0xc0b3b7['context']||_0xb857('0x5'),'type':_0xb857('0x6'),'isApp':![],'UserId':_0xc0b3b7['id']};var _0x6354b1=[];for(var _0x317a39=0x0,_0x5ed2be=0x1;_0x317a39<_0x3d558f[_0xb857('0x4')];_0x317a39++,_0x5ed2be=0x1){var _0x4ad9d2={'exten':util['format'](_0xb857('0x7'),_0x3d558f[_0x317a39][_0xb857('0x8')],_0x45be34),'ChanSpyId':_0x3d558f[_0x317a39]['id']};_0x6354b1[_0xb857('0x9')](_[_0xb857('0xa')]({'app':'Set','appdata':util[_0xb857('0xb')]('CDR(type)=%s',_0xb857('0xc')),'priority':_0x5ed2be++},_0x1c2805,_0x4ad9d2));if(_0x3d558f[_0x317a39][_0xb857('0xd')]){_0x6354b1[_0xb857('0x9')](_[_0xb857('0xa')]({'app':'MixMonitor','appdata':util[_0xb857('0xb')](_0xb857('0xe'),_0x3d558f[_0x317a39][_0xb857('0xf')]),'priority':_0x5ed2be++},_0x1c2805,_0x4ad9d2));}if(_0x3d558f[_0x317a39][_0xb857('0x10')]){_0x6354b1[_0xb857('0x9')](_[_0xb857('0xa')]({'app':_0xb857('0x11'),'appdata':_0x3d558f[_0x317a39][_0xb857('0x12')],'priority':_0x5ed2be++},_0x1c2805,_0x4ad9d2));}_0x6354b1[_0xb857('0x9')](_['merge']({'app':_0xb857('0x13'),'appdata':util[_0xb857('0xb')](_0xb857('0x14'),_0xc0b3b7[_0xb857('0x15')],_0x3d558f[_0x317a39][_0xb857('0x16')]?_0x3d558f[_0x317a39][_0xb857('0x16')][_0xb857('0x17')](''):''),'priority':_0x5ed2be++},_0x1c2805,_0x4ad9d2));if(_0x3d558f[_0x317a39][_0xb857('0xd')]){_0x6354b1[_0xb857('0x9')](_['merge']({'app':_0xb857('0x18'),'priority':_0x5ed2be++},_0x1c2805,_0x4ad9d2));}}return _0x6354b1;};var getUserApplications=function(_0x2ad682,_0x336f32){var _0xd7d403=['wav',_0xb857('0x19'),_0xb857('0x1a')];var _0x17ed00={'context':_0x2ad682['context']||_0xb857('0x5'),'exten':_0x336f32,'type':_0xb857('0x6'),'isApp':![],'UserId':_0x2ad682['id']};var _0x564cfa=[{'app':_0xb857('0x1b'),'appdata':_0xb857('0x1c')}];if(_0x2ad682['extensionMonitor']&&_[_0xb857('0x1d')](_0xd7d403,_0x2ad682[_0xb857('0x1e')])){_0x564cfa[_0xb857('0x9')]({'app':'Set','appdata':_0xb857('0x1f')});_0x564cfa['push']({'app':_0xb857('0x1b'),'appdata':util[_0xb857('0xb')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x2ad682['extensionMonitor'])});_0x564cfa[_0xb857('0x9')]({'app':'Dial','appdata':util[_0xb857('0xb')](_0xb857('0x20'),_0x2ad682[_0xb857('0x15')])});}else{_0x564cfa[_0xb857('0x9')]({'app':_0xb857('0x21'),'appdata':util['format'](_0xb857('0x22'),_0x2ad682[_0xb857('0x15')])});}_0x564cfa[_0xb857('0x9')]({'app':_0xb857('0x23')});for(var _0xd570ec=0x0;_0xd570ec<_0x564cfa['length'];_0xd570ec++){_0x564cfa[_0xd570ec]['priority']=_0xd570ec+0x1;_0x564cfa[_0xd570ec]=_[_0xb857('0x24')](_0x564cfa[_0xd570ec],_0x17ed00);}return _0x564cfa;};var getChanSpyPromise=function(_0x13ab25,_0x40ff1e){return new BPromise(function(_0x3dee70,_0x5e4451){return _0x13ab25[_0xb857('0x25')][_0xb857('0x26')]()[_0xb857('0x27')](function(_0x2791fe){if(_0x2791fe){var _0x1a16a8=getChanSpyApplications(_0x40ff1e,_0x40ff1e['internal'],_0x2791fe);if(_0x40ff1e[_0xb857('0x28')]!=_0x40ff1e[_0xb857('0x15')]){_0x1a16a8=_0x1a16a8[_0xb857('0x29')](getChanSpyApplications(_0x40ff1e,_0x40ff1e[_0xb857('0x15')],_0x2791fe));}return _0x3dee70(_0x1a16a8);}return _0x3dee70([]);})[_0xb857('0x2a')](function(_0x3eeb9d){_0x5e4451(_0x3eeb9d);});});};module[_0xb857('0x2b')]=function(_0x1bb592,_0x58c6d2){var _0x4f3b50=_0x1bb592['models'];return _0x1bb592[_0xb857('0x2c')](_0xb857('0x2d'),attributes,{'tableName':_0xb857('0x2e'),'charset':_0xb857('0x2f'),'collate':_0xb857('0x30'),'hooks':{'beforeCreate':function(_0x5bc084,_0x2d9257,_0x5598dc){_0x5bc084[_0xb857('0x31')]();_0x5bc084[_0xb857('0x32')](_0x5598dc);},'beforeUpdate':function(_0x2f45b8,_0x459dfe,_0x3a7bef){if(_0x2f45b8['changed'](_0xb857('0x12'))){_0x2f45b8[_0xb857('0x31')]();return _0x2f45b8[_0xb857('0x32')](_0x3a7bef);}_0x3a7bef();},'afterCreate':function(_0x1bae3e,_0x44e435,_0x342ef8){var _0x59db62=getUserApplications(_0x1bae3e,_0x1bae3e['internal']);if(_0x1bae3e[_0xb857('0x28')]!=_0x1bae3e[_0xb857('0x15')]){_0x59db62=_0x59db62[_0xb857('0x29')](getUserApplications(_0x1bae3e,_0x1bae3e[_0xb857('0x15')]));}return _0x4f3b50[_0xb857('0x33')][_0xb857('0x34')](_0x59db62)[_0xb857('0x27')](function(){if(_0x1bae3e[_0xb857('0xc')]){return getChanSpyPromise(_0x4f3b50,_0x1bae3e);}})['then'](function(_0x5b7b38){if(_0x5b7b38&&_0x5b7b38[_0xb857('0x4')]){return _0x4f3b50[_0xb857('0x33')][_0xb857('0x34')](_0x5b7b38);}})[_0xb857('0x27')](function(){_0x342ef8();})[_0xb857('0x2a')](function(_0x4e8074){_0x342ef8(_0x4e8074);});},'afterUpdate':function(_0x3313ef,_0x3b2597,_0x2b5bff){return BPromise['resolve']()['then'](function(){if(_0x3313ef[_0xb857('0x35')](_0xb857('0xc'))||_0x3313ef[_0xb857('0x35')](_0xb857('0x36'))){return _0x4f3b50[_0xb857('0x33')][_0xb857('0x37')]({'where':{'UserId':_0x3313ef['id'],'type':_0xb857('0x6'),'ChanSpyId':{'$ne':null}}})[_0xb857('0x27')](function(){if(_0x3313ef[_0xb857('0xc')]){return getChanSpyPromise(_0x4f3b50,_0x3313ef)[_0xb857('0x27')](function(_0x157f48){if(_0x157f48&&_0x157f48[_0xb857('0x4')]){return _0x4f3b50['VoiceExtension'][_0xb857('0x34')](_0x157f48);}});}});}})[_0xb857('0x27')](function(){if(_0x3313ef[_0xb857('0x35')](_0xb857('0x1e'))||_0x3313ef[_0xb857('0x35')](_0xb857('0x36'))){return _0x4f3b50[_0xb857('0x33')]['destroy']({'where':{'UserId':_0x3313ef['id'],'type':_0xb857('0x6'),'ChanSpyId':null}})[_0xb857('0x27')](function(){var _0x2fbfb0=getUserApplications(_0x3313ef,_0x3313ef['internal']);if(_0x3313ef['internal']!=_0x3313ef['name']){_0x2fbfb0=_0x2fbfb0[_0xb857('0x29')](getUserApplications(_0x3313ef,_0x3313ef[_0xb857('0x15')]));}return _0x4f3b50[_0xb857('0x33')][_0xb857('0x34')](_0x2fbfb0);});}})[_0xb857('0x27')](function(){_0x2b5bff();})['catch'](function(_0x4995fd){_0x2b5bff(_0x4995fd);});},'afterDestroy':function(_0x394d8a,_0x16d1b3){return _0x4f3b50[_0xb857('0x33')][_0xb857('0x37')]({'where':{'UserId':_0x394d8a['id'],'type':_0xb857('0x6')}});}},'instanceMethods':{'authenticate':function(_0x4f6257,_0x403a9a){if(!_0x403a9a){return this[_0xb857('0x12')]===this[_0xb857('0x38')](_0x4f6257);}var _0x147607=this;this[_0xb857('0x38')](_0x4f6257,function(_0x5a21f5,_0x31150b){if(_0x5a21f5){_0x403a9a(_0x5a21f5);}if(_0x147607[_0xb857('0x12')]===_0x31150b){_0x403a9a(null,!![]);}else{_0x403a9a(null,![]);}});},'makeSalt':function(_0x43943e,_0x3d3cae){var _0x46a3cf=0x10;if(typeof arguments[0x0]===_0xb857('0x39')){_0x3d3cae=arguments[0x0];_0x43943e=_0x46a3cf;}else if(typeof arguments[0x1]===_0xb857('0x39')){_0x3d3cae=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x43943e){_0x43943e=_0x46a3cf;}return crypto['randomBytes'](_0x43943e,function(_0x2dbe39,_0x52d033){if(_0x2dbe39){_0x3d3cae(_0x2dbe39);}return _0x3d3cae(null,_0x52d033[_0xb857('0x3a')](_0xb857('0x3b')));});},'encryptPassword':function(_0x85a2d4,_0x5a9872){if(!_0x85a2d4||!this[_0xb857('0x3c')]){return _0x5a9872?_0x5a9872(null):null;}var _0x1351e9=0x2710;var _0x2fe247=0x40;var _0x1dfc7e=new Buffer(this[_0xb857('0x3c')],'base64');if(!_0x5a9872){return crypto[_0xb857('0x3d')](_0x85a2d4,_0x1dfc7e,_0x1351e9,_0x2fe247,_0xb857('0x3e'))[_0xb857('0x3a')](_0xb857('0x3b'));}return crypto[_0xb857('0x3f')](_0x85a2d4,_0x1dfc7e,_0x1351e9,_0x2fe247,'sha1',function(_0x37336e,_0x32c327){if(_0x37336e){_0x5a9872(_0x37336e);}return _0x5a9872(null,_0x32c327['toString'](_0xb857('0x3b')));});},'updatePassword':function(_0x2eba5b){if(!this[_0xb857('0x12')]){return _0x2eba5b(null);}if(!validatePresenceOf(this[_0xb857('0x12')])&&authTypes[_0xb857('0x40')](this['provider'])===-0x1){_0x2eba5b(new Error(_0xb857('0x41')));}var _0x4285be=this;this[_0xb857('0x42')](function(_0xaca25a,_0x5364ae){if(_0xaca25a){return _0x2eba5b(_0xaca25a);}_0x4285be[_0xb857('0x3c')]=_0x5364ae;_0x4285be['encryptPassword'](_0x4285be[_0xb857('0x12')],function(_0x3f23f6,_0x2d8418){if(_0x3f23f6){_0x2eba5b(_0x3f23f6);}_0x4285be[_0xb857('0x12')]=_0x2d8418;_0x2eba5b(null);});});},'updateMd5Password':function(){this[_0xb857('0x43')]=md5(this[_0xb857('0x15')]+_0xb857('0x44')+this[_0xb857('0x12')]);return this[_0xb857('0x43')];}}});};
\ No newline at end of file
+var _0xdf58=['bulkCreate','changed','destroy','encryptPassword','randomBytes','toString','salt','base64','pbkdf2Sync','pbkdf2','sha1','provider','Invalid\x20password','md5secret',':asterisk:','bluebird','crypto','util','md5','./user.attributes','context','from-sip','system','format','%s%s','prefix','merge','Set','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','options','join','wav','WAV','gsm','CDR(type)=internal','extensionMonitor','includes','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','name','Hangup','length','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','exports','models','define','User','users','utf8_bin','updateMd5Password','updatePassword','VoiceExtension','chanspy'];(function(_0x411c4a,_0x1769a5){var _0xdca442=function(_0x4f916b){while(--_0x4f916b){_0x411c4a['push'](_0x411c4a['shift']());}};_0xdca442(++_0x1769a5);}(_0xdf58,0x1e4));var _0x8df5=function(_0x3a9d8e,_0x2dc411){_0x3a9d8e=_0x3a9d8e-0x0;var _0x1554c4=_0xdf58[_0x3a9d8e];return _0x1554c4;};'use strict';var BPromise=require(_0x8df5('0x0'));var crypto=require(_0x8df5('0x1'));var util=require(_0x8df5('0x2'));var md5=require(_0x8df5('0x3'));var _=require('lodash');var attributes=require(_0x8df5('0x4'));var authTypes=['google'];var validatePresenceOf=function(_0x3143e0){return _0x3143e0&&_0x3143e0['length'];};var getChanSpyApplications=function(_0x1ec770,_0xab022e,_0x5c999f){var _0x2cf50d={'context':_0x1ec770[_0x8df5('0x5')]||_0x8df5('0x6'),'type':_0x8df5('0x7'),'isApp':![],'UserId':_0x1ec770['id']};var _0x41a21a=[];for(var _0x10149d=0x0,_0x50568f=0x1;_0x10149d<_0x5c999f['length'];_0x10149d++,_0x50568f=0x1){var _0x1f8f25={'exten':util[_0x8df5('0x8')](_0x8df5('0x9'),_0x5c999f[_0x10149d][_0x8df5('0xa')],_0xab022e),'ChanSpyId':_0x5c999f[_0x10149d]['id']};_0x41a21a['push'](_[_0x8df5('0xb')]({'app':_0x8df5('0xc'),'appdata':util[_0x8df5('0x8')]('CDR(type)=%s','chanspy'),'priority':_0x50568f++},_0x2cf50d,_0x1f8f25));if(_0x5c999f[_0x10149d][_0x8df5('0xd')]){_0x41a21a[_0x8df5('0xe')](_[_0x8df5('0xb')]({'app':_0x8df5('0xf'),'appdata':util[_0x8df5('0x8')](_0x8df5('0x10'),_0x5c999f[_0x10149d][_0x8df5('0x11')]),'priority':_0x50568f++},_0x2cf50d,_0x1f8f25));}if(_0x5c999f[_0x10149d][_0x8df5('0x12')]){_0x41a21a[_0x8df5('0xe')](_[_0x8df5('0xb')]({'app':'Authenticate','appdata':_0x5c999f[_0x10149d][_0x8df5('0x13')],'priority':_0x50568f++},_0x2cf50d,_0x1f8f25));}_0x41a21a[_0x8df5('0xe')](_[_0x8df5('0xb')]({'app':_0x8df5('0x14'),'appdata':util[_0x8df5('0x8')](_0x8df5('0x15'),_0x1ec770['name'],_0x5c999f[_0x10149d][_0x8df5('0x16')]?_0x5c999f[_0x10149d]['options'][_0x8df5('0x17')](''):''),'priority':_0x50568f++},_0x2cf50d,_0x1f8f25));if(_0x5c999f[_0x10149d][_0x8df5('0xd')]){_0x41a21a[_0x8df5('0xe')](_['merge']({'app':'StopMixMonitor','priority':_0x50568f++},_0x2cf50d,_0x1f8f25));}}return _0x41a21a;};var getUserApplications=function(_0x5d54a1,_0x2a4d79){var _0x289caa=[_0x8df5('0x18'),_0x8df5('0x19'),_0x8df5('0x1a')];var _0x466c18={'context':_0x5d54a1[_0x8df5('0x5')]||_0x8df5('0x6'),'exten':_0x2a4d79,'type':_0x8df5('0x7'),'isApp':![],'UserId':_0x5d54a1['id']};var _0x163b58=[{'app':_0x8df5('0xc'),'appdata':_0x8df5('0x1b')}];if(_0x5d54a1[_0x8df5('0x1c')]&&_[_0x8df5('0x1d')](_0x289caa,_0x5d54a1[_0x8df5('0x1c')])){_0x163b58['push']({'app':_0x8df5('0xc'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x163b58[_0x8df5('0xe')]({'app':'Set','appdata':util[_0x8df5('0x8')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x5d54a1['extensionMonitor'])});_0x163b58[_0x8df5('0xe')]({'app':_0x8df5('0x1e'),'appdata':util[_0x8df5('0x8')](_0x8df5('0x1f'),_0x5d54a1['name'])});}else{_0x163b58[_0x8df5('0xe')]({'app':_0x8df5('0x1e'),'appdata':util['format']('SIP/%s,,tTxX',_0x5d54a1[_0x8df5('0x20')])});}_0x163b58[_0x8df5('0xe')]({'app':_0x8df5('0x21')});for(var _0x59662d=0x0;_0x59662d<_0x163b58[_0x8df5('0x22')];_0x59662d++){_0x163b58[_0x59662d]['priority']=_0x59662d+0x1;_0x163b58[_0x59662d]=_[_0x8df5('0x23')](_0x163b58[_0x59662d],_0x466c18);}return _0x163b58;};var getChanSpyPromise=function(_0x42c528,_0x58bb62){return new BPromise(function(_0x44a5ad,_0x45fc2a){return _0x42c528[_0x8df5('0x24')][_0x8df5('0x25')]()[_0x8df5('0x26')](function(_0x16e737){if(_0x16e737){var _0x24d0fc=getChanSpyApplications(_0x58bb62,_0x58bb62['internal'],_0x16e737);if(_0x58bb62[_0x8df5('0x27')]!=_0x58bb62[_0x8df5('0x20')]){_0x24d0fc=_0x24d0fc[_0x8df5('0x28')](getChanSpyApplications(_0x58bb62,_0x58bb62[_0x8df5('0x20')],_0x16e737));}return _0x44a5ad(_0x24d0fc);}return _0x44a5ad([]);})[_0x8df5('0x29')](function(_0x14135d){_0x45fc2a(_0x14135d);});});};module[_0x8df5('0x2a')]=function(_0x14c408,_0x576f63){var _0x536272=_0x14c408[_0x8df5('0x2b')];return _0x14c408[_0x8df5('0x2c')](_0x8df5('0x2d'),attributes,{'tableName':_0x8df5('0x2e'),'charset':'utf8','collate':_0x8df5('0x2f'),'hooks':{'beforeCreate':function(_0x4e843b,_0x50144c,_0x1e733b){_0x4e843b['updateMd5Password']();_0x4e843b['updatePassword'](_0x1e733b);},'beforeUpdate':function(_0x3a8b7a,_0x30d708,_0x13616b){if(_0x3a8b7a['changed'](_0x8df5('0x13'))){_0x3a8b7a[_0x8df5('0x30')]();return _0x3a8b7a[_0x8df5('0x31')](_0x13616b);}_0x13616b();},'afterCreate':function(_0x31cdb6,_0xe42c89,_0x4b93e8){var _0x3105a0=getUserApplications(_0x31cdb6,_0x31cdb6[_0x8df5('0x27')]);if(_0x31cdb6[_0x8df5('0x27')]!=_0x31cdb6[_0x8df5('0x20')]){_0x3105a0=_0x3105a0[_0x8df5('0x28')](getUserApplications(_0x31cdb6,_0x31cdb6[_0x8df5('0x20')]));}return _0x536272[_0x8df5('0x32')]['bulkCreate'](_0x3105a0)['then'](function(){if(_0x31cdb6[_0x8df5('0x33')]){return getChanSpyPromise(_0x536272,_0x31cdb6);}})[_0x8df5('0x26')](function(_0x579726){if(_0x579726&&_0x579726['length']){return _0x536272[_0x8df5('0x32')][_0x8df5('0x34')](_0x579726);}})[_0x8df5('0x26')](function(){_0x4b93e8();})[_0x8df5('0x29')](function(_0x513d33){_0x4b93e8(_0x513d33);});},'afterUpdate':function(_0x5b5889,_0x54606c,_0x4726aa){return BPromise['resolve']()[_0x8df5('0x26')](function(){if(_0x5b5889['changed']('chanspy')||_0x5b5889[_0x8df5('0x35')](_0x8df5('0x5'))){return _0x536272[_0x8df5('0x32')][_0x8df5('0x36')]({'where':{'UserId':_0x5b5889['id'],'type':_0x8df5('0x7'),'ChanSpyId':{'$ne':null}}})[_0x8df5('0x26')](function(){if(_0x5b5889[_0x8df5('0x33')]){return getChanSpyPromise(_0x536272,_0x5b5889)[_0x8df5('0x26')](function(_0x36ca29){if(_0x36ca29&&_0x36ca29[_0x8df5('0x22')]){return _0x536272[_0x8df5('0x32')][_0x8df5('0x34')](_0x36ca29);}});}});}})[_0x8df5('0x26')](function(){if(_0x5b5889[_0x8df5('0x35')]('extensionMonitor')||_0x5b5889[_0x8df5('0x35')](_0x8df5('0x5'))){return _0x536272[_0x8df5('0x32')]['destroy']({'where':{'UserId':_0x5b5889['id'],'type':_0x8df5('0x7'),'ChanSpyId':null}})[_0x8df5('0x26')](function(){var _0x23a5b5=getUserApplications(_0x5b5889,_0x5b5889[_0x8df5('0x27')]);if(_0x5b5889[_0x8df5('0x27')]!=_0x5b5889[_0x8df5('0x20')]){_0x23a5b5=_0x23a5b5[_0x8df5('0x28')](getUserApplications(_0x5b5889,_0x5b5889[_0x8df5('0x20')]));}return _0x536272[_0x8df5('0x32')][_0x8df5('0x34')](_0x23a5b5);});}})[_0x8df5('0x26')](function(){_0x4726aa();})[_0x8df5('0x29')](function(_0x130353){_0x4726aa(_0x130353);});},'afterDestroy':function(_0x1cb51f,_0x3f070e){return _0x536272[_0x8df5('0x32')]['destroy']({'where':{'UserId':_0x1cb51f['id'],'type':_0x8df5('0x7')}});}},'instanceMethods':{'authenticate':function(_0x5a9906,_0x101a98){if(!_0x101a98){return this['password']===this[_0x8df5('0x37')](_0x5a9906);}var _0x17da45=this;this[_0x8df5('0x37')](_0x5a9906,function(_0x3841c3,_0x3ea0d8){if(_0x3841c3){_0x101a98(_0x3841c3);}if(_0x17da45[_0x8df5('0x13')]===_0x3ea0d8){_0x101a98(null,!![]);}else{_0x101a98(null,![]);}});},'makeSalt':function(_0x24e6d7,_0x205e05){var _0x26dceb=0x10;if(typeof arguments[0x0]==='function'){_0x205e05=arguments[0x0];_0x24e6d7=_0x26dceb;}else if(typeof arguments[0x1]==='function'){_0x205e05=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x24e6d7){_0x24e6d7=_0x26dceb;}return crypto[_0x8df5('0x38')](_0x24e6d7,function(_0x5dab45,_0x272069){if(_0x5dab45){_0x205e05(_0x5dab45);}return _0x205e05(null,_0x272069[_0x8df5('0x39')]('base64'));});},'encryptPassword':function(_0x5ebaba,_0x196f8b){if(!_0x5ebaba||!this[_0x8df5('0x3a')]){return _0x196f8b?_0x196f8b(null):null;}var _0x20248b=0x2710;var _0x2cdb34=0x40;var _0xd262b9=new Buffer(this[_0x8df5('0x3a')],_0x8df5('0x3b'));if(!_0x196f8b){return crypto[_0x8df5('0x3c')](_0x5ebaba,_0xd262b9,_0x20248b,_0x2cdb34,'sha1')[_0x8df5('0x39')](_0x8df5('0x3b'));}return crypto[_0x8df5('0x3d')](_0x5ebaba,_0xd262b9,_0x20248b,_0x2cdb34,_0x8df5('0x3e'),function(_0x491f8d,_0x1e2e85){if(_0x491f8d){_0x196f8b(_0x491f8d);}return _0x196f8b(null,_0x1e2e85['toString'](_0x8df5('0x3b')));});},'updatePassword':function(_0x4a2bae){if(!this[_0x8df5('0x13')]){return _0x4a2bae(null);}if(!validatePresenceOf(this[_0x8df5('0x13')])&&authTypes['indexOf'](this[_0x8df5('0x3f')])===-0x1){_0x4a2bae(new Error(_0x8df5('0x40')));}var _0x1fac9e=this;this['makeSalt'](function(_0x367314,_0x1612cd){if(_0x367314){return _0x4a2bae(_0x367314);}_0x1fac9e['salt']=_0x1612cd;_0x1fac9e[_0x8df5('0x37')](_0x1fac9e[_0x8df5('0x13')],function(_0x49dcbb,_0x3de6ce){if(_0x49dcbb){_0x4a2bae(_0x49dcbb);}_0x1fac9e[_0x8df5('0x13')]=_0x3de6ce;_0x4a2bae(null);});});},'updateMd5Password':function(){this[_0x8df5('0x41')]=md5(this[_0x8df5('0x20')]+_0x8df5('0x42')+this[_0x8df5('0x13')]);return this[_0x8df5('0x41')];}}});};
\ No newline at end of file
index 4f32cca..b201296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fa4=['where','stringify','role','internal','interface','findAll','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','getChannels','forEach','push','name','isNil','body','type','DEFAULT\x20PAUSE','MemberReport','findOne','isValidChannel','Unknown\x20channel','channel','voice','UserVoiceQueueRt','update','system','mail','chat','fax','set','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','LOGIN','LOGININPAUSE','bulkCreate','concat','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','User','options','raw','attributes','limit','include','model','map','GetUser','ShowUser','find'];(function(_0x5bfbe1,_0x1c69cb){var _0x45500c=function(_0x42f9d2){while(--_0x42f9d2){_0x5bfbe1['push'](_0x5bfbe1['shift']());}};_0x45500c(++_0x1c69cb);}(_0x7fa4,0xdd));var _0x47fa=function(_0x49b7bd,_0x4d7d4a){_0x49b7bd=_0x49b7bd-0x0;var _0x22ca23=_0x7fa4[_0x49b7bd];return _0x22ca23;};'use strict';var _=require(_0x47fa('0x0'));var util=require(_0x47fa('0x1'));var moment=require(_0x47fa('0x2'));var BPromise=require(_0x47fa('0x3'));var rs=require(_0x47fa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47fa('0x5'))['db'];var utils=require(_0x47fa('0x6'));var logger=require('../../config/logger')(_0x47fa('0x7'));var config=require('../../config/environment');var jayson=require(_0x47fa('0x8'));var client=jayson['client'][_0x47fa('0x9')]({'port':0x232a});config[_0x47fa('0xa')]=_['defaults'](config[_0x47fa('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x47fa('0xb'))[_0x47fa('0xc')](socket);function respondWithRpcPromise(_0x2bce88,_0x5de533,_0x3920e9){return new BPromise(function(_0x2db5e5,_0x2e4388){return client['request'](_0x2bce88,_0x3920e9)[_0x47fa('0xd')](function(_0x4fdf5d){logger[_0x47fa('0xe')](_0x47fa('0xf'),_0x5de533,_0x47fa('0x10'));logger[_0x47fa('0x11')](_0x47fa('0x12'),_0x5de533,'request\x20sent',JSON['stringify'](_0x4fdf5d));if(_0x4fdf5d[_0x47fa('0x13')]){if(_0x4fdf5d[_0x47fa('0x13')]['code']===0x1f4){logger[_0x47fa('0x13')](_0x47fa('0xf'),_0x5de533,_0x4fdf5d[_0x47fa('0x13')]['message']);return _0x2e4388(_0x4fdf5d[_0x47fa('0x13')][_0x47fa('0x14')]);}logger['error'](_0x47fa('0xf'),_0x5de533,_0x4fdf5d['error'][_0x47fa('0x14')]);return _0x2db5e5(_0x4fdf5d[_0x47fa('0x13')][_0x47fa('0x14')]);}else{logger['info'](_0x47fa('0xf'),_0x5de533,_0x47fa('0x10'));_0x2db5e5(_0x4fdf5d[_0x47fa('0x15')][_0x47fa('0x14')]);}})[_0x47fa('0x16')](function(_0x34cac9){logger[_0x47fa('0x13')](_0x47fa('0xf'),_0x5de533,_0x34cac9);_0x2e4388(_0x34cac9);});});}exports['GetUser']=function(_0x13e211){var _0x5016ce=this;return new Promise(function(_0x1770ed,_0x4e85d0){return db[_0x47fa('0x17')]['findAll']({'raw':_0x13e211[_0x47fa('0x18')]?_0x13e211['options'][_0x47fa('0x19')]===undefined?!![]:![]:!![],'where':_0x13e211[_0x47fa('0x18')]?_0x13e211[_0x47fa('0x18')]['where']||null:null,'attributes':_0x13e211[_0x47fa('0x18')]?_0x13e211['options'][_0x47fa('0x1a')]||null:null,'limit':_0x13e211[_0x47fa('0x18')]?_0x13e211[_0x47fa('0x18')][_0x47fa('0x1b')]||null:null,'include':_0x13e211[_0x47fa('0x18')]?_0x13e211['options']['include']?_['map'](_0x13e211[_0x47fa('0x18')][_0x47fa('0x1c')],function(_0x53f333){return{'model':db[_0x53f333[_0x47fa('0x1d')]],'as':_0x53f333['as'],'attributes':_0x53f333[_0x47fa('0x1a')],'include':_0x53f333[_0x47fa('0x1c')]?_[_0x47fa('0x1e')](_0x53f333[_0x47fa('0x1c')],function(_0x5d78c7){return{'model':db[_0x5d78c7[_0x47fa('0x1d')]],'as':_0x5d78c7['as'],'attributes':_0x5d78c7[_0x47fa('0x1a')],'include':_0x5d78c7['include']?_[_0x47fa('0x1e')](_0x5d78c7['include'],function(_0x232fbc){return{'model':db[_0x232fbc[_0x47fa('0x1d')]],'as':_0x232fbc['as'],'attributes':_0x232fbc[_0x47fa('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x435bd9){logger[_0x47fa('0xe')](_0x47fa('0x1f'),_0x13e211);logger['debug'](_0x47fa('0x1f'),_0x13e211,JSON['stringify'](_0x435bd9));_0x1770ed(_0x435bd9);})[_0x47fa('0x16')](function(_0x4a7220){logger[_0x47fa('0x13')](_0x47fa('0x1f'),_0x4a7220[_0x47fa('0x14')],_0x13e211);_0x4e85d0(_0x5016ce[_0x47fa('0x13')](0x1f4,_0x4a7220[_0x47fa('0x14')]));});});};exports[_0x47fa('0x20')]=function(_0x3af00b){var _0xbbbe83=this;return new Promise(function(_0x2ebe38,_0x20cb6e){return db[_0x47fa('0x17')][_0x47fa('0x21')]({'raw':_0x3af00b[_0x47fa('0x18')]?_0x3af00b['options'][_0x47fa('0x19')]===undefined?!![]:![]:!![],'where':_0x3af00b['options']?_0x3af00b[_0x47fa('0x18')][_0x47fa('0x22')]||null:null,'attributes':_0x3af00b[_0x47fa('0x18')]?_0x3af00b[_0x47fa('0x18')][_0x47fa('0x1a')]||null:null,'include':_0x3af00b['options']?_0x3af00b[_0x47fa('0x18')]['include']?_['map'](_0x3af00b[_0x47fa('0x18')][_0x47fa('0x1c')],function(_0x4f78df){return{'model':db[_0x4f78df[_0x47fa('0x1d')]],'as':_0x4f78df['as'],'attributes':_0x4f78df[_0x47fa('0x1a')],'include':_0x4f78df[_0x47fa('0x1c')]?_[_0x47fa('0x1e')](_0x4f78df['include'],function(_0x2fa2df){return{'model':db[_0x2fa2df[_0x47fa('0x1d')]],'as':_0x2fa2df['as'],'attributes':_0x2fa2df[_0x47fa('0x1a')],'include':_0x2fa2df[_0x47fa('0x1c')]?_[_0x47fa('0x1e')](_0x2fa2df[_0x47fa('0x1c')],function(_0x327a3b){return{'model':db[_0x327a3b[_0x47fa('0x1d')]],'as':_0x327a3b['as'],'attributes':_0x327a3b['attributes']};}):[]};}):[]};}):[]:[]})[_0x47fa('0xd')](function(_0x527d31){logger[_0x47fa('0xe')]('ShowUser',_0x3af00b);logger[_0x47fa('0x11')](_0x47fa('0x20'),_0x3af00b,JSON[_0x47fa('0x23')](_0x527d31));_0x2ebe38(_0x527d31);})[_0x47fa('0x16')](function(_0xa0531f){logger['error']('ShowUser',_0xa0531f[_0x47fa('0x14')],_0x3af00b);_0x20cb6e(_0xbbbe83['error'](0x1f4,_0xa0531f[_0x47fa('0x14')]));});});};exports['PauseUser']=function(_0x4b1ae7){var _0x495f9e=this;return new Promise(function(_0x54cc40,_0x1101aa){var _0x3c6cef;return db[_0x47fa('0x17')][_0x47fa('0x21')]({'where':_0x4b1ae7['options']['where']||{},'attributes':['id','name',_0x47fa('0x24'),_0x47fa('0x25'),_0x47fa('0x26')]})['then'](function(_0x3fe17b){if(_0x3fe17b){_0x3c6cef=_0x3fe17b;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x3c6cef['id']},'individualHooks':!![]});}})[_0x47fa('0xd')](function(){if(_0x3c6cef){return db['MemberReport'][_0x47fa('0x27')]({'where':{'membername':_0x3c6cef['name'],'type':_0x47fa('0x28'),'exitAt':null}});}})[_0x47fa('0xd')](function(_0x221f67){if(_0x3c6cef){if(_0x221f67&&_0x221f67['length']){var _0x3a9f6a=moment()[_0x47fa('0x29')](_0x47fa('0x2a'));for(var _0x17dd51=0x0,_0x4dd8a5=_0x221f67[_0x47fa('0x2b')];_0x17dd51<_0x4dd8a5;_0x17dd51++){_0x221f67[_0x17dd51]['updateAttributes']({'exitAt':_0x3a9f6a});}}}})[_0x47fa('0xd')](function(){if(_0x3c6cef){var _0x5597e4=[];var _0x447b82=utils[_0x47fa('0x2c')]();_0x447b82[_0x47fa('0x2d')](function(_0x5e3964){_0x5597e4[_0x47fa('0x2e')]({'channel':_0x5e3964,'membername':_0x3c6cef[_0x47fa('0x2f')],'interface':_[_0x47fa('0x30')](_0x3c6cef[_0x47fa('0x26')])?util[_0x47fa('0x29')]('SIP/%s',_0x3c6cef[_0x47fa('0x2f')]):_0x3c6cef[_0x47fa('0x26')],'type':_0x47fa('0x28'),'enterAt':moment()[_0x47fa('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4b1ae7[_0x47fa('0x31')][_0x47fa('0x32')]||_0x47fa('0x33'),'role':_0x3c6cef[_0x47fa('0x24')],'internal':_0x3c6cef[_0x47fa('0x25')],'uniqueid':_0x4b1ae7[_0x47fa('0x31')]['uniqueid']||null});});return db[_0x47fa('0x34')]['bulkCreate'](_0x5597e4,{'individualHooks':!![]});}})['then'](function(){if(_0x3c6cef){return _0x3c6cef['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x4b1ae7[_0x47fa('0x31')]['type']||_0x47fa('0x33'),'lastPauseAt':moment()[_0x47fa('0x29')](_0x47fa('0x2a'))});}})[_0x47fa('0xd')](function(_0x56f955){_0x54cc40(_0x56f955);})['catch'](function(_0x306a60){_0x1101aa(_0x495f9e[_0x47fa('0x13')](0x1f4,_0x306a60['message']));});});};exports['UnpauseUser']=function(_0x1df404){var _0x322820=this;return new Promise(function(_0x5826a6,_0x1c5a1b){var _0x3a8ce3;return db[_0x47fa('0x17')][_0x47fa('0x35')]({'where':_0x1df404[_0x47fa('0x18')][_0x47fa('0x22')]||{},'attributes':['id',_0x47fa('0x2f')]})[_0x47fa('0xd')](function(_0x44b80d){if(_0x44b80d){_0x3a8ce3=_0x44b80d;if(_0x1df404[_0x47fa('0x31')]['channel']&&!utils[_0x47fa('0x36')](_0x1df404[_0x47fa('0x31')]['channel'])){throw new Error(_0x47fa('0x37'));}switch(_0x1df404['body'][_0x47fa('0x38')]){case _0x47fa('0x39'):return db[_0x47fa('0x3a')][_0x47fa('0x3b')]({'paused':0x0},{'where':{'UserId':_0x3a8ce3['id']}})[_0x47fa('0xd')](function(){return db[_0x47fa('0x34')][_0x47fa('0x21')]({'where':{'channel':_0x1df404[_0x47fa('0x31')]['channel'],'membername':_0x3a8ce3[_0x47fa('0x2f')],'type':_0x47fa('0x28'),'exitAt':null}});})[_0x47fa('0xd')](function(_0x3fe921){if(_0x3fe921){return _0x3fe921[_0x47fa('0x3b')]({'exitAt':moment()[_0x47fa('0x29')](_0x47fa('0x2a')),'data2':_0x47fa('0x3c')},{'individualHooks':!![]});}return null;})[_0x47fa('0xd')](function(){return _0x3a8ce3[_0x47fa('0x3b')]({'voicePause':![]});});case _0x47fa('0x3d'):case _0x47fa('0x3e'):case _0x47fa('0x3f'):case'sms':case'openchannel':return db['MemberReport'][_0x47fa('0x21')]({'where':{'channel':_0x1df404[_0x47fa('0x31')]['channel'],'membername':_0x3a8ce3[_0x47fa('0x2f')],'type':_0x47fa('0x28'),'exitAt':null}})['then'](function(_0x269bbf){return _0x269bbf[_0x47fa('0x3b')]({'exitAt':moment()['format'](_0x47fa('0x2a')),'data2':_0x47fa('0x3c')},{'individualHooks':!![]});})[_0x47fa('0xd')](function(){var _0x2d766a={};_[_0x47fa('0x40')](_0x2d766a,util[_0x47fa('0x29')]('%s%s',_0x1df404['body'][_0x47fa('0x38')],'Pause'),![]);return _0x3a8ce3[_0x47fa('0x3b')](_0x2d766a);});default:return db[_0x47fa('0x3a')][_0x47fa('0x3b')]({'paused':0x0},{'where':{'UserId':_0x3a8ce3['id']}})[_0x47fa('0xd')](function(){return db['MemberReport'][_0x47fa('0x27')]({'where':{'membername':_0x3a8ce3['name'],'type':_0x47fa('0x28'),'exitAt':null}});})[_0x47fa('0xd')](function(_0x1292f1){var _0x41f68a=[];_0x1292f1[_0x47fa('0x2d')](function(_0x1f649f){_0x41f68a[_0x47fa('0x2e')](_0x1f649f[_0x47fa('0x3b')]({'exitAt':moment()[_0x47fa('0x29')](_0x47fa('0x2a')),'data2':'system'}));});return BPromise[_0x47fa('0x41')](_0x41f68a);})[_0x47fa('0xd')](function(){return _0x3a8ce3[_0x47fa('0x3b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x47fa('0xd')](function(_0x4aa1a6){_0x5826a6(_0x4aa1a6);})[_0x47fa('0x16')](function(_0x414cf0){_0x1c5a1b(_0x322820['error'](0x1f4,_0x414cf0[_0x47fa('0x14')]));});});};exports[_0x47fa('0x42')]=function(_0x370580){var _0x3624b5=this;return new Promise(function(_0x30b307,_0x2911cb){var _0x3b8a56;return db[_0x47fa('0x17')][_0x47fa('0x35')]({'where':_0x370580[_0x47fa('0x18')]['where']||{},'attributes':['id',_0x47fa('0x2f')]})[_0x47fa('0xd')](function(_0x5abbf6){if(_0x5abbf6){_0x3b8a56=_0x5abbf6;return db['UserVoiceQueueRt'][_0x47fa('0x43')]({'where':{'membername':_0x3b8a56[_0x47fa('0x2f')]},'individualHooks':!![]});}})[_0x47fa('0xd')](function(){if(_0x3b8a56){return db['MemberReport'][_0x47fa('0x27')]({'where':{'membername':_0x3b8a56[_0x47fa('0x2f')],'exitAt':null}});}})[_0x47fa('0xd')](function(_0x286692){if(_0x3b8a56){if(_0x286692&&_0x286692['length']){var _0xd14cbc=[];_0x286692[_0x47fa('0x2d')](function(_0x4c7a34){_0xd14cbc['push'](_0x4c7a34['update']({'exitAt':moment()['format'](_0x47fa('0x2a'))}));});return BPromise[_0x47fa('0x41')](_0xd14cbc);}}})['then'](function(){if(_0x3b8a56){return _0x3b8a56[_0x47fa('0x3b')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x47fa('0xd')](function(_0x29b2fb){_0x30b307(_0x29b2fb);})[_0x47fa('0x16')](function(_0x44f805){_0x2911cb(_0x3624b5[_0x47fa('0x13')](0x1f4,_0x44f805[_0x47fa('0x14')]));});});};exports[_0x47fa('0x44')]=function(_0x1dff0a){var _0x548a9a=this;return new Promise(function(_0x12458e,_0x307bfa){var _0x5f215c;var _0x44ebf9;var _0xd6d849;var _0xb1ba60;return db['User'][_0x47fa('0x35')]({'where':_0x1dff0a[_0x47fa('0x18')][_0x47fa('0x22')]||{},'attributes':['id',_0x47fa('0x2f'),_0x47fa('0x24'),_0x47fa('0x45'),_0x47fa('0x46'),_0x47fa('0x25'),_0x47fa('0x47'),'interface']})[_0x47fa('0xd')](function(_0x543a1f){if(_0x543a1f){_0x5f215c=_0x543a1f;_0xb1ba60=_0x1dff0a[_0x47fa('0x31')][_0x47fa('0x26')]?_0x1dff0a[_0x47fa('0x31')]['interface']:util['format'](_0x47fa('0x48'),_0x5f215c['name']);return db[_0x47fa('0x17')][_0x47fa('0x49')]({'where':{'role':_0x47fa('0x4a'),'online':!![],'id':{'$ne':_0x5f215c['id']}}});}})['then'](function(_0x310593){if(_0x310593){_0xd6d849=_0x310593;return require(_0x47fa('0x4b'))[_0x47fa('0x4c')]();}})[_0x47fa('0xd')](function(_0x11b6ee){if(_0x11b6ee&&_0x11b6ee[_0x47fa('0x4d')]&&_0xd6d849>=_0x11b6ee[_0x47fa('0x4d')]){throw new Error(_0x47fa('0x4e'));}})[_0x47fa('0xd')](function(){if(_0x5f215c){return db[_0x47fa('0x3a')][_0x47fa('0x43')]({'where':{'membername':_0x5f215c[_0x47fa('0x2f')]},'individualHooks':!![]});}})['then'](function(){if(_0x5f215c){return _0x5f215c['getVoiceQueues']({'raw':!![]});}})[_0x47fa('0xd')](function(_0x117cc3){if(_0x5f215c){if(_0x117cc3){var _0x55fdd4=[];_0x44ebf9=_0x117cc3;if(_0x44ebf9['length']){for(var _0x121d0d=0x0;_0x121d0d<_0x44ebf9[_0x47fa('0x2b')];_0x121d0d++){_0x55fdd4[_0x47fa('0x2e')](db[_0x47fa('0x3a')][_0x47fa('0x4f')]({'membername':_0x5f215c[_0x47fa('0x2f')],'UserId':_0x5f215c['id'],'queue_name':_0x44ebf9[_0x121d0d]['name'],'VoiceQueueId':_0x44ebf9[_0x121d0d]['id'],'interface':_0xb1ba60,'paused':_0x5f215c['loginInPause']||![],'penalty':_0x44ebf9[_0x121d0d][_0x47fa('0x50')]||0x0}));}return BPromise[_0x47fa('0x41')](_0x55fdd4);}}}})[_0x47fa('0xd')](function(){if(_0x5f215c){return db[_0x47fa('0x34')][_0x47fa('0x27')]({'where':{'membername':_0x5f215c[_0x47fa('0x2f')],'exitAt':null}});}})[_0x47fa('0xd')](function(_0x2c02bf){if(_0x5f215c){if(_0x2c02bf&&_0x2c02bf[_0x47fa('0x2b')]){var _0x58ed17=[];_0x2c02bf[_0x47fa('0x2d')](function(_0xb4c943){_0x58ed17[_0x47fa('0x2e')](_0xb4c943[_0x47fa('0x3b')]({'exitAt':moment()[_0x47fa('0x29')](_0x47fa('0x2a'))}));});return BPromise['all'](_0x58ed17);}}})[_0x47fa('0xd')](function(_0xdfee04){if(_0x5f215c){var _0x30f17d=[];var _0x565c11=[];var _0x158e21=utils[_0x47fa('0x2c')]();var _0xcca775={'membername':_0x5f215c[_0x47fa('0x2f')],'interface':_0xb1ba60,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5f215c[_0x47fa('0x24')],'internal':_0x5f215c[_0x47fa('0x25')]};_0x158e21[_0x47fa('0x2d')](function(_0x306eb4){_0x30f17d[_0x47fa('0x2e')](_['merge']({'channel':_0x306eb4,'type':_0x47fa('0x51'),'data1':'callysquare','data2':_0xb1ba60},_0xcca775));if(_0x5f215c[_0x47fa('0x47')]){_0x565c11[_0x47fa('0x2e')](_['merge']({'channel':_0x306eb4,'type':'PAUSE','data1':_0x47fa('0x52')},_0xcca775));}});return db[_0x47fa('0x34')][_0x47fa('0x53')](_0x30f17d[_0x47fa('0x54')](_0x565c11),{'individualHooks':!![]});}})[_0x47fa('0xd')](function(){if(_0x5f215c){return _0x5f215c[_0x47fa('0x3b')]({'online':!![],'lastLoginAt':moment()[_0x47fa('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5f215c[_0x47fa('0x47')]||![],'mailPause':_0x5f215c[_0x47fa('0x47')]||![],'chatPause':_0x5f215c[_0x47fa('0x47')]||![],'faxPause':_0x5f215c[_0x47fa('0x47')]||![],'smsPause':_0x5f215c['loginInPause']||![],'openchannelPause':_0x5f215c[_0x47fa('0x47')]||![],'pauseType':_0x5f215c[_0x47fa('0x47')]?_0x47fa('0x52'):null,'lastPauseAt':moment()['format'](_0x47fa('0x2a')),'interface':_0xb1ba60});}})[_0x47fa('0xd')](function(_0x2c0d28){_0x12458e(_0x2c0d28);})[_0x47fa('0x16')](function(_0x4e21c4){_0x307bfa(_0x548a9a[_0x47fa('0x13')](0x1f4,_0x4e21c4[_0x47fa('0x14')]));});});};
\ No newline at end of file
+var _0x5b01=['map','model','then','debug','GetUser','ShowUser','where','PauseUser','find','name','role','internal','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','interface','SIP/%s','format','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','findOne','body','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','Pause','findAll','push','destroy','LoginUser','mobile','phone','loginInPause','count','agent','getLicense','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','all','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','request','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','User','options','raw','attributes','limit','include'];(function(_0x4add6d,_0x33bb94){var _0x4a3927=function(_0x5e1c88){while(--_0x5e1c88){_0x4add6d['push'](_0x4add6d['shift']());}};_0x4a3927(++_0x33bb94);}(_0x5b01,0x1ae));var _0x15b0=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x5b01[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x15b0('0x0'));var util=require('util');var moment=require(_0x15b0('0x1'));var BPromise=require(_0x15b0('0x2'));var rs=require(_0x15b0('0x3'));var fs=require('fs');var Redis=require(_0x15b0('0x4'));var db=require(_0x15b0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15b0('0x6'))(_0x15b0('0x7'));var config=require(_0x15b0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x15b0('0x9')]['http']({'port':0x232a});config['redis']=_[_0x15b0('0xa')](config[_0x15b0('0xb')],{'host':_0x15b0('0xc'),'port':0x18eb});var socket=require(_0x15b0('0xd'))(new Redis(config[_0x15b0('0xb')]));require('./user.socket')['register'](socket);function respondWithRpcPromise(_0x596586,_0x422fe3,_0x4db22e){return new BPromise(function(_0x3b2719,_0x15c2a2){return client[_0x15b0('0xe')](_0x596586,_0x4db22e)['then'](function(_0x1df0d8){logger[_0x15b0('0xf')](_0x15b0('0x10'),_0x422fe3,_0x15b0('0x11'));logger['debug'](_0x15b0('0x12'),_0x422fe3,_0x15b0('0x11'),JSON[_0x15b0('0x13')](_0x1df0d8));if(_0x1df0d8['error']){if(_0x1df0d8[_0x15b0('0x14')]['code']===0x1f4){logger['error'](_0x15b0('0x10'),_0x422fe3,_0x1df0d8[_0x15b0('0x14')][_0x15b0('0x15')]);return _0x15c2a2(_0x1df0d8['error'][_0x15b0('0x15')]);}logger[_0x15b0('0x14')](_0x15b0('0x10'),_0x422fe3,_0x1df0d8[_0x15b0('0x14')][_0x15b0('0x15')]);return _0x3b2719(_0x1df0d8[_0x15b0('0x14')][_0x15b0('0x15')]);}else{logger[_0x15b0('0xf')]('User,\x20%s,\x20%s',_0x422fe3,_0x15b0('0x11'));_0x3b2719(_0x1df0d8[_0x15b0('0x16')][_0x15b0('0x15')]);}})[_0x15b0('0x17')](function(_0xa196aa){logger[_0x15b0('0x14')](_0x15b0('0x10'),_0x422fe3,_0xa196aa);_0x15c2a2(_0xa196aa);});});}exports['GetUser']=function(_0x35359a){var _0xad4615=this;return new Promise(function(_0x119c0d,_0x4df978){return db[_0x15b0('0x18')]['findAll']({'raw':_0x35359a[_0x15b0('0x19')]?_0x35359a[_0x15b0('0x19')][_0x15b0('0x1a')]===undefined?!![]:![]:!![],'where':_0x35359a['options']?_0x35359a[_0x15b0('0x19')]['where']||null:null,'attributes':_0x35359a[_0x15b0('0x19')]?_0x35359a['options'][_0x15b0('0x1b')]||null:null,'limit':_0x35359a[_0x15b0('0x19')]?_0x35359a['options'][_0x15b0('0x1c')]||null:null,'include':_0x35359a[_0x15b0('0x19')]?_0x35359a[_0x15b0('0x19')][_0x15b0('0x1d')]?_[_0x15b0('0x1e')](_0x35359a['options']['include'],function(_0x5dd681){return{'model':db[_0x5dd681['model']],'as':_0x5dd681['as'],'attributes':_0x5dd681[_0x15b0('0x1b')],'include':_0x5dd681[_0x15b0('0x1d')]?_[_0x15b0('0x1e')](_0x5dd681[_0x15b0('0x1d')],function(_0x20d9e7){return{'model':db[_0x20d9e7['model']],'as':_0x20d9e7['as'],'attributes':_0x20d9e7[_0x15b0('0x1b')],'include':_0x20d9e7[_0x15b0('0x1d')]?_[_0x15b0('0x1e')](_0x20d9e7[_0x15b0('0x1d')],function(_0x29ddcc){return{'model':db[_0x29ddcc[_0x15b0('0x1f')]],'as':_0x29ddcc['as'],'attributes':_0x29ddcc['attributes']};}):[]};}):[]};}):[]:[]})[_0x15b0('0x20')](function(_0x47d908){logger[_0x15b0('0xf')]('GetUser',_0x35359a);logger[_0x15b0('0x21')](_0x15b0('0x22'),_0x35359a,JSON[_0x15b0('0x13')](_0x47d908));_0x119c0d(_0x47d908);})[_0x15b0('0x17')](function(_0x81fccf){logger[_0x15b0('0x14')]('GetUser',_0x81fccf[_0x15b0('0x15')],_0x35359a);_0x4df978(_0xad4615[_0x15b0('0x14')](0x1f4,_0x81fccf['message']));});});};exports[_0x15b0('0x23')]=function(_0x1c8671){var _0x360cd6=this;return new Promise(function(_0x594843,_0x258196){return db[_0x15b0('0x18')]['find']({'raw':_0x1c8671['options']?_0x1c8671[_0x15b0('0x19')][_0x15b0('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c8671[_0x15b0('0x19')]?_0x1c8671['options'][_0x15b0('0x24')]||null:null,'attributes':_0x1c8671[_0x15b0('0x19')]?_0x1c8671[_0x15b0('0x19')][_0x15b0('0x1b')]||null:null,'include':_0x1c8671[_0x15b0('0x19')]?_0x1c8671[_0x15b0('0x19')]['include']?_['map'](_0x1c8671[_0x15b0('0x19')][_0x15b0('0x1d')],function(_0x26bcff){return{'model':db[_0x26bcff[_0x15b0('0x1f')]],'as':_0x26bcff['as'],'attributes':_0x26bcff[_0x15b0('0x1b')],'include':_0x26bcff[_0x15b0('0x1d')]?_['map'](_0x26bcff[_0x15b0('0x1d')],function(_0x4067b0){return{'model':db[_0x4067b0[_0x15b0('0x1f')]],'as':_0x4067b0['as'],'attributes':_0x4067b0[_0x15b0('0x1b')],'include':_0x4067b0['include']?_[_0x15b0('0x1e')](_0x4067b0[_0x15b0('0x1d')],function(_0x150c8f){return{'model':db[_0x150c8f[_0x15b0('0x1f')]],'as':_0x150c8f['as'],'attributes':_0x150c8f[_0x15b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x15b0('0x20')](function(_0x15d92d){logger[_0x15b0('0xf')](_0x15b0('0x23'),_0x1c8671);logger[_0x15b0('0x21')](_0x15b0('0x23'),_0x1c8671,JSON[_0x15b0('0x13')](_0x15d92d));_0x594843(_0x15d92d);})['catch'](function(_0x44b27a){logger[_0x15b0('0x14')](_0x15b0('0x23'),_0x44b27a[_0x15b0('0x15')],_0x1c8671);_0x258196(_0x360cd6[_0x15b0('0x14')](0x1f4,_0x44b27a[_0x15b0('0x15')]));});});};exports[_0x15b0('0x25')]=function(_0x13eaa7){var _0x42584d=this;return new Promise(function(_0x184f39,_0x5ad550){var _0x442022;return db['User'][_0x15b0('0x26')]({'where':_0x13eaa7[_0x15b0('0x19')]['where']||{},'attributes':['id',_0x15b0('0x27'),_0x15b0('0x28'),_0x15b0('0x29'),'interface']})['then'](function(_0x7da226){if(_0x7da226){_0x442022=_0x7da226;return db['UserVoiceQueueRt'][_0x15b0('0x2a')]({'paused':0x1},{'where':{'UserId':_0x442022['id']},'individualHooks':!![]});}})['then'](function(){if(_0x442022){return db[_0x15b0('0x2b')]['findAll']({'where':{'membername':_0x442022[_0x15b0('0x27')],'type':_0x15b0('0x2c'),'exitAt':null}});}})[_0x15b0('0x20')](function(_0x26e1cc){if(_0x442022){if(_0x26e1cc&&_0x26e1cc[_0x15b0('0x2d')]){var _0x11c7a5=moment()['format'](_0x15b0('0x2e'));for(var _0x490f28=0x0,_0xa77b1d=_0x26e1cc['length'];_0x490f28<_0xa77b1d;_0x490f28++){_0x26e1cc[_0x490f28][_0x15b0('0x2f')]({'exitAt':_0x11c7a5});}}}})[_0x15b0('0x20')](function(){if(_0x442022){var _0x5c098f=[];var _0x4d5cee=utils[_0x15b0('0x30')]();_0x4d5cee[_0x15b0('0x31')](function(_0x5685f9){_0x5c098f['push']({'channel':_0x5685f9,'membername':_0x442022[_0x15b0('0x27')],'interface':_[_0x15b0('0x32')](_0x442022[_0x15b0('0x33')])?util['format'](_0x15b0('0x34'),_0x442022[_0x15b0('0x27')]):_0x442022['interface'],'type':_0x15b0('0x2c'),'enterAt':moment()[_0x15b0('0x35')](_0x15b0('0x2e')),'data1':_0x13eaa7['body'][_0x15b0('0x36')]||_0x15b0('0x37'),'role':_0x442022[_0x15b0('0x28')],'internal':_0x442022[_0x15b0('0x29')],'uniqueid':_0x13eaa7['body'][_0x15b0('0x38')]||null});});return db[_0x15b0('0x2b')][_0x15b0('0x39')](_0x5c098f,{'individualHooks':!![]});}})[_0x15b0('0x20')](function(){if(_0x442022){return _0x442022[_0x15b0('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x13eaa7['body']['type']||_0x15b0('0x37'),'lastPauseAt':moment()[_0x15b0('0x35')](_0x15b0('0x2e'))});}})[_0x15b0('0x20')](function(_0x412813){_0x184f39(_0x412813);})['catch'](function(_0x156f27){_0x5ad550(_0x42584d['error'](0x1f4,_0x156f27[_0x15b0('0x15')]));});});};exports[_0x15b0('0x3a')]=function(_0x33316d){var _0x3e3a87=this;return new Promise(function(_0x1dec15,_0x1e9db5){var _0x58bf09;return db['User'][_0x15b0('0x3b')]({'where':_0x33316d[_0x15b0('0x19')]['where']||{},'attributes':['id',_0x15b0('0x27')]})[_0x15b0('0x20')](function(_0x587ecc){if(_0x587ecc){_0x58bf09=_0x587ecc;if(_0x33316d[_0x15b0('0x3c')][_0x15b0('0x3d')]&&!utils[_0x15b0('0x3e')](_0x33316d[_0x15b0('0x3c')][_0x15b0('0x3d')])){throw new Error(_0x15b0('0x3f'));}switch(_0x33316d[_0x15b0('0x3c')][_0x15b0('0x3d')]){case _0x15b0('0x40'):return db[_0x15b0('0x41')][_0x15b0('0x2a')]({'paused':0x0},{'where':{'UserId':_0x58bf09['id']}})['then'](function(){return db[_0x15b0('0x2b')][_0x15b0('0x26')]({'where':{'channel':_0x33316d[_0x15b0('0x3c')][_0x15b0('0x3d')],'membername':_0x58bf09[_0x15b0('0x27')],'type':_0x15b0('0x2c'),'exitAt':null}});})[_0x15b0('0x20')](function(_0x1c46c4){if(_0x1c46c4){return _0x1c46c4[_0x15b0('0x2a')]({'exitAt':moment()['format'](_0x15b0('0x2e')),'data2':_0x15b0('0x42')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x58bf09['update']({'voicePause':![]});});case _0x15b0('0x43'):case _0x15b0('0x44'):case _0x15b0('0x45'):case _0x15b0('0x46'):case _0x15b0('0x47'):return db['MemberReport'][_0x15b0('0x26')]({'where':{'channel':_0x33316d[_0x15b0('0x3c')][_0x15b0('0x3d')],'membername':_0x58bf09['name'],'type':_0x15b0('0x2c'),'exitAt':null}})[_0x15b0('0x20')](function(_0x4978fc){return _0x4978fc[_0x15b0('0x2a')]({'exitAt':moment()[_0x15b0('0x35')](_0x15b0('0x2e')),'data2':_0x15b0('0x42')},{'individualHooks':!![]});})[_0x15b0('0x20')](function(){var _0x578d1f={};_['set'](_0x578d1f,util[_0x15b0('0x35')]('%s%s',_0x33316d[_0x15b0('0x3c')]['channel'],_0x15b0('0x48')),![]);return _0x58bf09[_0x15b0('0x2a')](_0x578d1f);});default:return db['UserVoiceQueueRt'][_0x15b0('0x2a')]({'paused':0x0},{'where':{'UserId':_0x58bf09['id']}})[_0x15b0('0x20')](function(){return db[_0x15b0('0x2b')][_0x15b0('0x49')]({'where':{'membername':_0x58bf09[_0x15b0('0x27')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x580e87){var _0x24f526=[];_0x580e87['forEach'](function(_0x2609d4){_0x24f526[_0x15b0('0x4a')](_0x2609d4[_0x15b0('0x2a')]({'exitAt':moment()[_0x15b0('0x35')](_0x15b0('0x2e')),'data2':_0x15b0('0x42')}));});return BPromise['all'](_0x24f526);})[_0x15b0('0x20')](function(){return _0x58bf09['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x15b0('0x20')](function(_0x2387b6){_0x1dec15(_0x2387b6);})[_0x15b0('0x17')](function(_0x5c431f){_0x1e9db5(_0x3e3a87[_0x15b0('0x14')](0x1f4,_0x5c431f[_0x15b0('0x15')]));});});};exports['LogoutUser']=function(_0x5c5bf5){var _0xba6641=this;return new Promise(function(_0x315d76,_0x483ef9){var _0x525155;return db[_0x15b0('0x18')][_0x15b0('0x3b')]({'where':_0x5c5bf5[_0x15b0('0x19')]['where']||{},'attributes':['id',_0x15b0('0x27')]})[_0x15b0('0x20')](function(_0x340af9){if(_0x340af9){_0x525155=_0x340af9;return db['UserVoiceQueueRt'][_0x15b0('0x4b')]({'where':{'membername':_0x525155[_0x15b0('0x27')]},'individualHooks':!![]});}})[_0x15b0('0x20')](function(){if(_0x525155){return db[_0x15b0('0x2b')][_0x15b0('0x49')]({'where':{'membername':_0x525155[_0x15b0('0x27')],'exitAt':null}});}})[_0x15b0('0x20')](function(_0x9bf5d0){if(_0x525155){if(_0x9bf5d0&&_0x9bf5d0['length']){var _0x5304a6=[];_0x9bf5d0['forEach'](function(_0x5e5f07){_0x5304a6[_0x15b0('0x4a')](_0x5e5f07[_0x15b0('0x2a')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x5304a6);}}})['then'](function(){if(_0x525155){return _0x525155[_0x15b0('0x2a')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x15b0('0x20')](function(_0x31f512){_0x315d76(_0x31f512);})[_0x15b0('0x17')](function(_0x38cc0b){_0x483ef9(_0xba6641[_0x15b0('0x14')](0x1f4,_0x38cc0b['message']));});});};exports[_0x15b0('0x4c')]=function(_0x1c58b4){var _0x328803=this;return new Promise(function(_0x222095,_0x1b65ed){var _0x5ba1f7;var _0x2ea7e0;var _0x50b769;var _0x1fc7e8;return db[_0x15b0('0x18')]['findOne']({'where':_0x1c58b4['options']['where']||{},'attributes':['id','name',_0x15b0('0x28'),_0x15b0('0x4d'),_0x15b0('0x4e'),_0x15b0('0x29'),_0x15b0('0x4f'),_0x15b0('0x33')]})[_0x15b0('0x20')](function(_0x159fab){if(_0x159fab){_0x5ba1f7=_0x159fab;_0x1fc7e8=_0x1c58b4[_0x15b0('0x3c')][_0x15b0('0x33')]?_0x1c58b4[_0x15b0('0x3c')][_0x15b0('0x33')]:util['format'](_0x15b0('0x34'),_0x5ba1f7[_0x15b0('0x27')]);return db[_0x15b0('0x18')][_0x15b0('0x50')]({'where':{'role':_0x15b0('0x51'),'online':!![],'id':{'$ne':_0x5ba1f7['id']}}});}})[_0x15b0('0x20')](function(_0x5e9681){if(_0x5e9681){_0x50b769=_0x5e9681;return require('../../config/license/util')[_0x15b0('0x52')]();}})[_0x15b0('0x20')](function(_0xaf58d2){if(_0xaf58d2&&_0xaf58d2['agents']&&_0x50b769>=_0xaf58d2['agents']){throw new Error(_0x15b0('0x53'));}})[_0x15b0('0x20')](function(){if(_0x5ba1f7){return db[_0x15b0('0x41')][_0x15b0('0x4b')]({'where':{'membername':_0x5ba1f7[_0x15b0('0x27')]},'individualHooks':!![]});}})[_0x15b0('0x20')](function(){if(_0x5ba1f7){return _0x5ba1f7[_0x15b0('0x54')]({'raw':!![]});}})['then'](function(_0x22ad7e){if(_0x5ba1f7){if(_0x22ad7e){var _0x3e5eb1=[];_0x2ea7e0=_0x22ad7e;if(_0x2ea7e0[_0x15b0('0x2d')]){for(var _0x14521e=0x0;_0x14521e<_0x2ea7e0[_0x15b0('0x2d')];_0x14521e++){_0x3e5eb1[_0x15b0('0x4a')](db[_0x15b0('0x41')][_0x15b0('0x55')]({'membername':_0x5ba1f7['name'],'UserId':_0x5ba1f7['id'],'queue_name':_0x2ea7e0[_0x14521e][_0x15b0('0x27')],'VoiceQueueId':_0x2ea7e0[_0x14521e]['id'],'interface':_0x1fc7e8,'paused':_0x5ba1f7['loginInPause']||![],'penalty':_0x2ea7e0[_0x14521e]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x15b0('0x56')](_0x3e5eb1);}}}})[_0x15b0('0x20')](function(){if(_0x5ba1f7){return db['MemberReport']['findAll']({'where':{'membername':_0x5ba1f7[_0x15b0('0x27')],'exitAt':null}});}})[_0x15b0('0x20')](function(_0x18c69e){if(_0x5ba1f7){if(_0x18c69e&&_0x18c69e[_0x15b0('0x2d')]){var _0xae960e=[];_0x18c69e[_0x15b0('0x31')](function(_0x7184d4){_0xae960e[_0x15b0('0x4a')](_0x7184d4['update']({'exitAt':moment()[_0x15b0('0x35')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0xae960e);}}})['then'](function(_0x5182a0){if(_0x5ba1f7){var _0x13ef30=[];var _0x52c846=[];var _0x21517f=utils['getChannels']();var _0x2edcd9={'membername':_0x5ba1f7[_0x15b0('0x27')],'interface':_0x1fc7e8,'enterAt':moment()[_0x15b0('0x35')](_0x15b0('0x2e')),'role':_0x5ba1f7[_0x15b0('0x28')],'internal':_0x5ba1f7[_0x15b0('0x29')]};_0x21517f[_0x15b0('0x31')](function(_0x49cbea){_0x13ef30[_0x15b0('0x4a')](_['merge']({'channel':_0x49cbea,'type':_0x15b0('0x57'),'data1':_0x15b0('0x58'),'data2':_0x1fc7e8},_0x2edcd9));if(_0x5ba1f7[_0x15b0('0x4f')]){_0x52c846[_0x15b0('0x4a')](_[_0x15b0('0x59')]({'channel':_0x49cbea,'type':_0x15b0('0x2c'),'data1':_0x15b0('0x5a')},_0x2edcd9));}});return db[_0x15b0('0x2b')]['bulkCreate'](_0x13ef30[_0x15b0('0x5b')](_0x52c846),{'individualHooks':!![]});}})[_0x15b0('0x20')](function(){if(_0x5ba1f7){return _0x5ba1f7[_0x15b0('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x15b0('0x35')](_0x15b0('0x2e')),'voicePause':_0x5ba1f7['loginInPause']||![],'mailPause':_0x5ba1f7[_0x15b0('0x4f')]||![],'chatPause':_0x5ba1f7['loginInPause']||![],'faxPause':_0x5ba1f7[_0x15b0('0x4f')]||![],'smsPause':_0x5ba1f7[_0x15b0('0x4f')]||![],'openchannelPause':_0x5ba1f7[_0x15b0('0x4f')]||![],'pauseType':_0x5ba1f7[_0x15b0('0x4f')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x15b0('0x35')](_0x15b0('0x2e')),'interface':_0x1fc7e8});}})['then'](function(_0xc6bb6e){_0x222095(_0xc6bb6e);})[_0x15b0('0x17')](function(_0x146e12){_0x1b65ed(_0x328803[_0x15b0('0x14')](0x1f4,_0x146e12[_0x15b0('0x15')]));});});};
\ No newline at end of file
index bb8bfd1..a4fe26f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a3f=['removeListener','register','length','user:','./user.events','remove','update','emit'];(function(_0x146f3a,_0x373e03){var _0x4ebd8a=function(_0x2b4ea9){while(--_0x2b4ea9){_0x146f3a['push'](_0x146f3a['shift']());}};_0x4ebd8a(++_0x373e03);}(_0x8a3f,0x1b4));var _0xf8a3=function(_0x22cd0c,_0x20ebbf){_0x22cd0c=_0x22cd0c-0x0;var _0x4dd65b=_0x8a3f[_0x22cd0c];return _0x4dd65b;};'use strict';var UserEvents=require(_0xf8a3('0x0'));var events=['save',_0xf8a3('0x1'),_0xf8a3('0x2')];function createListener(_0x193bdc,_0x31a369){return function(_0x34fa9b){_0x31a369[_0xf8a3('0x3')](_0x193bdc,_0x34fa9b);};}function removeListener(_0x5d7833,_0x1683d7){return function(){UserEvents[_0xf8a3('0x4')](_0x5d7833,_0x1683d7);};}exports[_0xf8a3('0x5')]=function(_0x28f014){for(var _0x16d829=0x0,_0x51156f=events[_0xf8a3('0x6')];_0x16d829<_0x51156f;_0x16d829++){var _0x42b789=events[_0x16d829];var _0x31c606=createListener(_0xf8a3('0x7')+_0x42b789,_0x28f014);UserEvents['on'](_0x42b789,_0x31c606);}};
\ No newline at end of file
+var _0xd53f=['emit','removeListener','register','save','remove'];(function(_0x3ba2a5,_0x47935d){var _0x3fc7e5=function(_0x293607){while(--_0x293607){_0x3ba2a5['push'](_0x3ba2a5['shift']());}};_0x3fc7e5(++_0x47935d);}(_0xd53f,0xa8));var _0xfd53=function(_0x2cfb79,_0x4221a2){_0x2cfb79=_0x2cfb79-0x0;var _0x51a50e=_0xd53f[_0x2cfb79];return _0x51a50e;};'use strict';var UserEvents=require('./user.events');var events=[_0xfd53('0x0'),_0xfd53('0x1'),'update'];function createListener(_0xe5ee28,_0x1955df){return function(_0x962a30){_0x1955df[_0xfd53('0x2')](_0xe5ee28,_0x962a30);};}function removeListener(_0x375b35,_0x3b1405){return function(){UserEvents[_0xfd53('0x3')](_0x375b35,_0x3b1405);};}exports[_0xfd53('0x4')]=function(_0x4a1b78){for(var _0x4c6d5d=0x0,_0x54b5a3=events['length'];_0x4c6d5d<_0x54b5a3;_0x4c6d5d++){var _0x397d96=events[_0x4c6d5d];var _0x546934=createListener('user:'+_0x397d96,_0x4a1b78);UserEvents['on'](_0x397d96,_0x546934);}};
\ No newline at end of file
index 2d6c166..2d63310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcc2=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x18cee2,_0x24684c){var _0x43b2d5=function(_0x1552f8){while(--_0x1552f8){_0x18cee2['push'](_0x18cee2['shift']());}};_0x43b2d5(++_0x24684c);}(_0xfcc2,0x1db));var _0x2fcc=function(_0x4a942d,_0xad19b){_0x4a942d=_0x4a942d-0x0;var _0xb363cb=_0xfcc2[_0x4a942d];return _0xb363cb;};'use strict';var multer=require(_0x2fcc('0x0'));var util=require(_0x2fcc('0x1'));var path=require(_0x2fcc('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fcc('0x3'));var router=express[_0x2fcc('0x4')]();var auth=require(_0x2fcc('0x5'));var interaction=require(_0x2fcc('0x6'));var config=require(_0x2fcc('0x7'));module[_0x2fcc('0x8')]=router;
\ No newline at end of file
+var _0x56d0=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x3d84de,_0x1d84df){var _0x263536=function(_0xbae6bc){while(--_0xbae6bc){_0x3d84de['push'](_0x3d84de['shift']());}};_0x263536(++_0x1d84df);}(_0x56d0,0x1a7));var _0x056d=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0x56d0[_0x888385];return _0x22d5c2;};'use strict';var multer=require('multer');var util=require(_0x056d('0x0'));var path=require(_0x056d('0x1'));var timeout=require(_0x056d('0x2'));var express=require(_0x056d('0x3'));var router=express['Router']();var auth=require(_0x056d('0x4'));var interaction=require(_0x056d('0x5'));var config=require(_0x056d('0x6'));module[_0x056d('0x7')]=router;
\ No newline at end of file
index 553f130..6fe68ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x39de0f,_0xd3a92c){var _0x569e34=function(_0x536761){while(--_0x536761){_0x39de0f['push'](_0x39de0f['shift']());}};_0x569e34(++_0xd3a92c);}(_0xe706,0xa3));var _0x6e70=function(_0x5e1248,_0x42b862){_0x5e1248=_0x5e1248-0x0;var _0x1b4201=_0xe706[_0x5e1248];return _0x1b4201;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x2b42b7,_0x474daa){var _0x41644d=function(_0x953868){while(--_0x953868){_0x2b42b7['push'](_0x2b42b7['shift']());}};_0x41644d(++_0x474daa);}(_0xe706,0xa3));var _0x6e70=function(_0x31c68e,_0x5f0385){_0x31c68e=_0x31c68e-0x0;var _0x159e5d=_0xe706[_0x31c68e];return _0x159e5d;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index bb744a8..2ba436d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d03=['path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','bluebird','request-promise'];(function(_0x43ed38,_0x507af1){var _0x181497=function(_0x153d8e){while(--_0x153d8e){_0x43ed38['push'](_0x43ed38['shift']());}};_0x181497(++_0x507af1);}(_0x2d03,0x1e7));var _0x32d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d03[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x32d0('0x0'));var logger=require(_0x32d0('0x1'))(_0x32d0('0x2'));var moment=require('moment');var BPromise=require(_0x32d0('0x3'));var rp=require(_0x32d0('0x4'));var fs=require('fs');var path=require(_0x32d0('0x5'));var rimraf=require(_0x32d0('0x6'));var config=require('../../config/environment');var attributes=require(_0x32d0('0x7'));module[_0x32d0('0x8')]=function(_0x1b1d74,_0x3af965){return _0x1b1d74[_0x32d0('0x9')](_0x32d0('0xa'),attributes,{'tableName':_0x32d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5686=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x5686,0x1be));var _0x6568=function(_0x4b9a62,_0x528ba3){_0x4b9a62=_0x4b9a62-0x0;var _0x45c582=_0x5686[_0x4b9a62];return _0x45c582;};'use strict';var _=require(_0x6568('0x0'));var util=require(_0x6568('0x1'));var logger=require(_0x6568('0x2'))(_0x6568('0x3'));var moment=require(_0x6568('0x4'));var BPromise=require(_0x6568('0x5'));var rp=require(_0x6568('0x6'));var fs=require('fs');var path=require(_0x6568('0x7'));var rimraf=require(_0x6568('0x8'));var config=require(_0x6568('0x9'));var attributes=require(_0x6568('0xa'));module['exports']=function(_0x1f3a97,_0x25b5b4){return _0x1f3a97[_0x6568('0xb')](_0x6568('0xc'),attributes,{'tableName':_0x6568('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 67eaeae..978fa3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fa1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','UserChatQueue,\x20%s,\x20%s','message','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1fa1,0xd4));var _0x11fa=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x1fa1[_0x469a3c];return _0x968f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x11fa('0x0'));var rs=require(_0x11fa('0x1'));var fs=require('fs');var Redis=require(_0x11fa('0x2'));var db=require(_0x11fa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x11fa('0x4'))(_0x11fa('0x5'));var config=require(_0x11fa('0x6'));var jayson=require(_0x11fa('0x7'));var client=jayson[_0x11fa('0x8')][_0x11fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b70e,_0x448fba,_0x4ae3d7){return new BPromise(function(_0x31b854,_0xb7d5a1){return client['request'](_0x36b70e,_0x4ae3d7)[_0x11fa('0xa')](function(_0x280116){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x448fba,_0x11fa('0xb'));logger[_0x11fa('0xc')](_0x11fa('0xd'),_0x448fba,_0x11fa('0xb'),JSON['stringify'](_0x280116));if(_0x280116[_0x11fa('0xe')]){if(_0x280116['error'][_0x11fa('0xf')]===0x1f4){logger[_0x11fa('0xe')](_0x11fa('0x10'),_0x448fba,_0x280116[_0x11fa('0xe')][_0x11fa('0x11')]);return _0xb7d5a1(_0x280116[_0x11fa('0xe')][_0x11fa('0x11')]);}logger[_0x11fa('0xe')](_0x11fa('0x10'),_0x448fba,_0x280116[_0x11fa('0xe')]['message']);return _0x31b854(_0x280116[_0x11fa('0xe')][_0x11fa('0x11')]);}else{logger['info'](_0x11fa('0x10'),_0x448fba,_0x11fa('0xb'));_0x31b854(_0x280116['result'][_0x11fa('0x11')]);}})['catch'](function(_0x758578){logger[_0x11fa('0xe')](_0x11fa('0x10'),_0x448fba,_0x758578);_0xb7d5a1(_0x758578);});});}
\ No newline at end of file
+var _0x50c5=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','request','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x420ec0,_0x42834b){var _0x1c4a5d=function(_0x45ccb7){while(--_0x45ccb7){_0x420ec0['push'](_0x420ec0['shift']());}};_0x1c4a5d(++_0x42834b);}(_0x50c5,0x18c));var _0x550c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50c5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x550c('0x0'));var util=require('util');var moment=require(_0x550c('0x1'));var BPromise=require(_0x550c('0x2'));var rs=require(_0x550c('0x3'));var fs=require('fs');var Redis=require(_0x550c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x550c('0x5'));var logger=require(_0x550c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x550c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x367eb3,_0x13a3a6,_0x35d750){return new BPromise(function(_0x401743,_0xbf7908){return client[_0x550c('0x8')](_0x367eb3,_0x35d750)['then'](function(_0xd0a508){logger['info'](_0x550c('0x9'),_0x13a3a6,'request\x20sent');logger[_0x550c('0xa')](_0x550c('0xb'),_0x13a3a6,_0x550c('0xc'),JSON[_0x550c('0xd')](_0xd0a508));if(_0xd0a508[_0x550c('0xe')]){if(_0xd0a508[_0x550c('0xe')]['code']===0x1f4){logger[_0x550c('0xe')](_0x550c('0x9'),_0x13a3a6,_0xd0a508[_0x550c('0xe')][_0x550c('0xf')]);return _0xbf7908(_0xd0a508['error'][_0x550c('0xf')]);}logger[_0x550c('0xe')](_0x550c('0x9'),_0x13a3a6,_0xd0a508[_0x550c('0xe')]['message']);return _0x401743(_0xd0a508['error'][_0x550c('0xf')]);}else{logger[_0x550c('0x10')](_0x550c('0x9'),_0x13a3a6,_0x550c('0xc'));_0x401743(_0xd0a508[_0x550c('0x11')][_0x550c('0xf')]);}})['catch'](function(_0x5eeec9){logger[_0x550c('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x13a3a6,_0x5eeec9);_0xbf7908(_0x5eeec9);});});}
\ No newline at end of file
index 07806e6..b72e328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x880b=['../../config/environment','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xb08045,_0x32397e){var _0x52928d=function(_0x498c19){while(--_0x498c19){_0xb08045['push'](_0xb08045['shift']());}};_0x52928d(++_0x32397e);}(_0x880b,0x1bb));var _0xb880=function(_0x5ecd41,_0x1de7ea){_0x5ecd41=_0x5ecd41-0x0;var _0x26a9b6=_0x880b[_0x5ecd41];return _0x26a9b6;};'use strict';var multer=require('multer');var util=require(_0xb880('0x0'));var path=require('path');var timeout=require(_0xb880('0x1'));var express=require('express');var router=express[_0xb880('0x2')]();var auth=require(_0xb880('0x3'));var interaction=require(_0xb880('0x4'));var config=require(_0xb880('0x5'));module[_0xb880('0x6')]=router;
\ No newline at end of file
+var _0x063d=['path','express','Router','../../components/auth/service','../../config/environment','exports','util'];(function(_0x25ed4c,_0x3b3d52){var _0x430468=function(_0x5287fa){while(--_0x5287fa){_0x25ed4c['push'](_0x25ed4c['shift']());}};_0x430468(++_0x3b3d52);}(_0x063d,0xbc));var _0xd063=function(_0x426986,_0x360d22){_0x426986=_0x426986-0x0;var _0x43e656=_0x063d[_0x426986];return _0x43e656;};'use strict';var multer=require('multer');var util=require(_0xd063('0x0'));var path=require(_0xd063('0x1'));var timeout=require('connect-timeout');var express=require(_0xd063('0x2'));var router=express[_0xd063('0x3')]();var auth=require(_0xd063('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd063('0x5'));module[_0xd063('0x6')]=router;
\ No newline at end of file
index 97ab6a3..44ba8b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03e=['INTEGER','STRING','exports'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xb03e,0x1eb));var _0xeb03=function(_0x457780,_0x2edb72){_0x457780=_0x457780-0x0;var _0x201ec1=_0xb03e[_0x457780];return _0x201ec1;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'penalty':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xeb03('0x2')]}};
\ No newline at end of file
+var _0x5c00=['INTEGER','STRING','sequelize','exports'];(function(_0x2bc2a2,_0x51e95f){var _0x20de67=function(_0x27f2d2){while(--_0x27f2d2){_0x2bc2a2['push'](_0x2bc2a2['shift']());}};_0x20de67(++_0x51e95f);}(_0x5c00,0x17e));var _0x05c0=function(_0x5efbd0,_0x299553){_0x5efbd0=_0x5efbd0-0x0;var _0x475ec9=_0x5c00[_0x5efbd0];return _0x475ec9;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'penalty':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x05c0('0x3')]}};
\ No newline at end of file
index cd5a77e..e23a1b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4333=['define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','moment','path','exports'];(function(_0x3b7245,_0x3d14bf){var _0x4b56a0=function(_0x128474){while(--_0x128474){_0x3b7245['push'](_0x3b7245['shift']());}};_0x4b56a0(++_0x3d14bf);}(_0x4333,0x1eb));var _0x3433=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4333[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0x3433('0x0'));var logger=require(_0x3433('0x1'))('api');var moment=require(_0x3433('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3433('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x3433('0x4')]=function(_0x439188,_0x583276){return _0x439188[_0x3433('0x5')](_0x3433('0x6'),attributes,{'tableName':_0x3433('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x40fb=['moment','bluebird','request-promise','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','api'];(function(_0x2d3d1e,_0x37bb2d){var _0x3c045e=function(_0x237447){while(--_0x237447){_0x2d3d1e['push'](_0x2d3d1e['shift']());}};_0x3c045e(++_0x37bb2d);}(_0x40fb,0xb1));var _0xb40f=function(_0x4e0417,_0x574fd4){_0x4e0417=_0x4e0417-0x0;var _0x5d6909=_0x40fb[_0x4e0417];return _0x5d6909;};'use strict';var _=require(_0xb40f('0x0'));var util=require(_0xb40f('0x1'));var logger=require('../../config/logger')(_0xb40f('0x2'));var moment=require(_0xb40f('0x3'));var BPromise=require(_0xb40f('0x4'));var rp=require(_0xb40f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb40f('0x6'));var config=require('../../config/environment');var attributes=require(_0xb40f('0x7'));module[_0xb40f('0x8')]=function(_0x12c365,_0x26dfe4){return _0x12c365[_0xb40f('0x9')](_0xb40f('0xa'),attributes,{'tableName':_0xb40f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cbb324c..b626963 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ef7=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x35a3e5,_0x16c390){var _0x452214=function(_0x5eb53c){while(--_0x5eb53c){_0x35a3e5['push'](_0x35a3e5['shift']());}};_0x452214(++_0x16c390);}(_0x3ef7,0xa2));var _0x73ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ef7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var moment=require(_0x73ef('0x1'));var BPromise=require(_0x73ef('0x2'));var rs=require(_0x73ef('0x3'));var fs=require('fs');var Redis=require(_0x73ef('0x4'));var db=require(_0x73ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ef('0x6'))(_0x73ef('0x7'));var config=require(_0x73ef('0x8'));var jayson=require(_0x73ef('0x9'));var client=jayson['client'][_0x73ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x137f35,_0x1bc285,_0x1b2802){return new BPromise(function(_0xe938e1,_0x4cd5ce){return client[_0x73ef('0xb')](_0x137f35,_0x1b2802)[_0x73ef('0xc')](function(_0x50098a){logger[_0x73ef('0xd')](_0x73ef('0xe'),_0x1bc285,_0x73ef('0xf'));logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x1bc285,'request\x20sent',JSON[_0x73ef('0x12')](_0x50098a));if(_0x50098a[_0x73ef('0x13')]){if(_0x50098a[_0x73ef('0x13')][_0x73ef('0x14')]===0x1f4){logger[_0x73ef('0x13')](_0x73ef('0xe'),_0x1bc285,_0x50098a[_0x73ef('0x13')][_0x73ef('0x15')]);return _0x4cd5ce(_0x50098a[_0x73ef('0x13')][_0x73ef('0x15')]);}logger[_0x73ef('0x13')](_0x73ef('0xe'),_0x1bc285,_0x50098a[_0x73ef('0x13')]['message']);return _0xe938e1(_0x50098a[_0x73ef('0x13')]['message']);}else{logger[_0x73ef('0xd')](_0x73ef('0xe'),_0x1bc285,_0x73ef('0xf'));_0xe938e1(_0x50098a['result'][_0x73ef('0x15')]);}})[_0x73ef('0x16')](function(_0x4bccf6){logger[_0x73ef('0x13')](_0x73ef('0xe'),_0x1bc285,_0x4bccf6);_0x4cd5ce(_0x4bccf6);});});}
\ No newline at end of file
+var _0xad1b=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x369217,_0x25bbdd){var _0x238cc2=function(_0x4869b0){while(--_0x4869b0){_0x369217['push'](_0x369217['shift']());}};_0x238cc2(++_0x25bbdd);}(_0xad1b,0x131));var _0xbad1=function(_0x5d754f,_0x518cae){_0x5d754f=_0x5d754f-0x0;var _0x31ad90=_0xad1b[_0x5d754f];return _0x31ad90;};'use strict';var _=require(_0xbad1('0x0'));var util=require(_0xbad1('0x1'));var moment=require(_0xbad1('0x2'));var BPromise=require(_0xbad1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbad1('0x4'));var db=require(_0xbad1('0x5'))['db'];var utils=require(_0xbad1('0x6'));var logger=require('../../config/logger')(_0xbad1('0x7'));var config=require('../../config/environment');var jayson=require(_0xbad1('0x8'));var client=jayson['client'][_0xbad1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10fbed,_0x4f148a,_0x49612a){return new BPromise(function(_0x4d7a8b,_0x52dae0){return client[_0xbad1('0xa')](_0x10fbed,_0x49612a)['then'](function(_0x559116){logger[_0xbad1('0xb')](_0xbad1('0xc'),_0x4f148a,_0xbad1('0xd'));logger[_0xbad1('0xe')](_0xbad1('0xf'),_0x4f148a,'request\x20sent',JSON[_0xbad1('0x10')](_0x559116));if(_0x559116[_0xbad1('0x11')]){if(_0x559116[_0xbad1('0x11')]['code']===0x1f4){logger[_0xbad1('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x4f148a,_0x559116['error'][_0xbad1('0x12')]);return _0x52dae0(_0x559116['error']['message']);}logger[_0xbad1('0x11')](_0xbad1('0xc'),_0x4f148a,_0x559116['error'][_0xbad1('0x12')]);return _0x4d7a8b(_0x559116[_0xbad1('0x11')]['message']);}else{logger[_0xbad1('0xb')](_0xbad1('0xc'),_0x4f148a,'request\x20sent');_0x4d7a8b(_0x559116['result']['message']);}})[_0xbad1('0x13')](function(_0x1fe2e5){logger['error'](_0xbad1('0xc'),_0x4f148a,_0x1fe2e5);_0x52dae0(_0x1fe2e5);});});}
\ No newline at end of file
index 706cae9..6db22f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c33=['../../components/interaction/service','../../config/environment','exports','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x7eeeea,_0x344e47){var _0x3f0625=function(_0x20ab95){while(--_0x20ab95){_0x7eeeea['push'](_0x7eeeea['shift']());}};_0x3f0625(++_0x344e47);}(_0x1c33,0x83));var _0x31c3=function(_0x20b5a9,_0x80a352){_0x20b5a9=_0x20b5a9-0x0;var _0x58398a=_0x1c33[_0x20b5a9];return _0x58398a;};'use strict';var multer=require(_0x31c3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x31c3('0x1'));var express=require(_0x31c3('0x2'));var router=express[_0x31c3('0x3')]();var auth=require(_0x31c3('0x4'));var interaction=require(_0x31c3('0x5'));var config=require(_0x31c3('0x6'));module[_0x31c3('0x7')]=router;
\ No newline at end of file
+var _0x8f8e=['express','Router','../../config/environment','multer','util','connect-timeout'];(function(_0x3cc4c8,_0x114636){var _0xdc0123=function(_0x1c3078){while(--_0x1c3078){_0x3cc4c8['push'](_0x3cc4c8['shift']());}};_0xdc0123(++_0x114636);}(_0x8f8e,0xf9));var _0xe8f8=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x8f8e[_0xbb9dbf];return _0x30223c;};'use strict';var multer=require(_0xe8f8('0x0'));var util=require(_0xe8f8('0x1'));var path=require('path');var timeout=require(_0xe8f8('0x2'));var express=require(_0xe8f8('0x3'));var router=express[_0xe8f8('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe8f8('0x5'));module['exports']=router;
\ No newline at end of file
index d1442ea..d668808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['exports','sequelize'];(function(_0x4f7e5b,_0x452c65){var _0x13ea34=function(_0x3f04c0){while(--_0x3f04c0){_0x4f7e5b['push'](_0x4f7e5b['shift']());}};_0x13ea34(++_0x452c65);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbaf0=['exports','INTEGER'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 795634e..126bd87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','../../config/logger','api'];(function(_0x137a14,_0x3d693c){var _0x23f85a=function(_0x40f6e1){while(--_0x40f6e1){_0x137a14['push'](_0x137a14['shift']());}};_0x23f85a(++_0x3d693c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['define','user_has_mail_queues','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x54d5c8,_0x344ce5){var _0x525e2e=function(_0x4581b7){while(--_0x4581b7){_0x54d5c8['push'](_0x54d5c8['shift']());}};_0x525e2e(++_0x344ce5);}(_0x757a,0xde));var _0xa757=function(_0x113af8,_0x1c95e4){_0x113af8=_0x113af8-0x0;var _0x26a104=_0x757a[_0x113af8];return _0x26a104;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('UserMailQueue',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8afa61e..72cdddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88c6=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0xb03c3,_0x46c612){var _0x21501f=function(_0x40fbe4){while(--_0x40fbe4){_0xb03c3['push'](_0xb03c3['shift']());}};_0x21501f(++_0x46c612);}(_0x88c6,0x163));var _0x688c=function(_0x8cd1ae,_0x24d8aa){_0x8cd1ae=_0x8cd1ae-0x0;var _0x8b27fa=_0x88c6[_0x8cd1ae];return _0x8b27fa;};'use strict';var _=require(_0x688c('0x0'));var util=require(_0x688c('0x1'));var moment=require(_0x688c('0x2'));var BPromise=require(_0x688c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x688c('0x4'))['db'];var utils=require(_0x688c('0x5'));var logger=require(_0x688c('0x6'))('rpc');var config=require(_0x688c('0x7'));var jayson=require(_0x688c('0x8'));var client=jayson[_0x688c('0x9')][_0x688c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1be494,_0x44bf8b,_0x4cd706){return new BPromise(function(_0x9f8059,_0xec2731){return client[_0x688c('0xb')](_0x1be494,_0x4cd706)['then'](function(_0x30ab68){logger[_0x688c('0xc')](_0x688c('0xd'),_0x44bf8b,'request\x20sent');logger[_0x688c('0xe')](_0x688c('0xf'),_0x44bf8b,'request\x20sent',JSON[_0x688c('0x10')](_0x30ab68));if(_0x30ab68[_0x688c('0x11')]){if(_0x30ab68['error'][_0x688c('0x12')]===0x1f4){logger[_0x688c('0x11')](_0x688c('0xd'),_0x44bf8b,_0x30ab68['error']['message']);return _0xec2731(_0x30ab68[_0x688c('0x11')]['message']);}logger['error'](_0x688c('0xd'),_0x44bf8b,_0x30ab68['error']['message']);return _0x9f8059(_0x30ab68[_0x688c('0x11')][_0x688c('0x13')]);}else{logger[_0x688c('0xc')](_0x688c('0xd'),_0x44bf8b,'request\x20sent');_0x9f8059(_0x30ab68['result'][_0x688c('0x13')]);}})[_0x688c('0x14')](function(_0x470b8f){logger['error'](_0x688c('0xd'),_0x44bf8b,_0x470b8f);_0xec2731(_0x470b8f);});});}
\ No newline at end of file
+var _0x483f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserMailQueue,\x20%s,\x20%s','info','result','catch','lodash','util'];(function(_0x4d886a,_0x1980d3){var _0x3fa895=function(_0x3731f8){while(--_0x3731f8){_0x4d886a['push'](_0x4d886a['shift']());}};_0x3fa895(++_0x1980d3);}(_0x483f,0x11c));var _0xf483=function(_0x144b18,_0x423cfa){_0x144b18=_0x144b18-0x0;var _0x46494d=_0x483f[_0x144b18];return _0x46494d;};'use strict';var _=require(_0xf483('0x0'));var util=require(_0xf483('0x1'));var moment=require(_0xf483('0x2'));var BPromise=require(_0xf483('0x3'));var rs=require(_0xf483('0x4'));var fs=require('fs');var Redis=require(_0xf483('0x5'));var db=require(_0xf483('0x6'))['db'];var utils=require(_0xf483('0x7'));var logger=require(_0xf483('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf483('0x9')][_0xf483('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43ec99,_0x2266b5,_0x39761e){return new BPromise(function(_0x44791c,_0x313f61){return client[_0xf483('0xb')](_0x43ec99,_0x39761e)['then'](function(_0x42372a){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x2266b5,_0xf483('0xc'));logger[_0xf483('0xd')](_0xf483('0xe'),_0x2266b5,_0xf483('0xc'),JSON['stringify'](_0x42372a));if(_0x42372a[_0xf483('0xf')]){if(_0x42372a['error'][_0xf483('0x10')]===0x1f4){logger[_0xf483('0xf')]('UserMailQueue,\x20%s,\x20%s',_0x2266b5,_0x42372a[_0xf483('0xf')][_0xf483('0x11')]);return _0x313f61(_0x42372a['error']['message']);}logger[_0xf483('0xf')](_0xf483('0x12'),_0x2266b5,_0x42372a[_0xf483('0xf')][_0xf483('0x11')]);return _0x44791c(_0x42372a[_0xf483('0xf')]['message']);}else{logger[_0xf483('0x13')](_0xf483('0x12'),_0x2266b5,'request\x20sent');_0x44791c(_0x42372a[_0xf483('0x14')][_0xf483('0x11')]);}})[_0xf483('0x15')](function(_0xaaab8f){logger[_0xf483('0xf')](_0xf483('0x12'),_0x2266b5,_0xaaab8f);_0x313f61(_0xaaab8f);});});}
\ No newline at end of file
index 01d765e..c37cd16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7f1=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc7f1,0x165));var _0x1c7f=function(_0x1cc3dd,_0x522160){_0x1cc3dd=_0x1cc3dd-0x0;var _0x439ba9=_0xc7f1[_0x1cc3dd];return _0x439ba9;};'use strict';var multer=require(_0x1c7f('0x0'));var util=require(_0x1c7f('0x1'));var path=require(_0x1c7f('0x2'));var timeout=require(_0x1c7f('0x3'));var express=require(_0x1c7f('0x4'));var router=express[_0x1c7f('0x5')]();var auth=require(_0x1c7f('0x6'));var interaction=require(_0x1c7f('0x7'));var config=require(_0x1c7f('0x8'));module[_0x1c7f('0x9')]=router;
\ No newline at end of file
+var _0x3d11=['../../components/auth/service','multer','util','path','Router'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x3d11,0x1a5));var _0x13d1=function(_0xec18aa,_0x181a50){_0xec18aa=_0xec18aa-0x0;var _0x51fd4b=_0x3d11[_0xec18aa];return _0x51fd4b;};'use strict';var multer=require(_0x13d1('0x0'));var util=require(_0x13d1('0x1'));var path=require(_0x13d1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x13d1('0x3')]();var auth=require(_0x13d1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
index a794731..007c8ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x3cf4cd,_0x2e6bb9){var _0x44a40b=function(_0x358b5e){while(--_0x358b5e){_0x3cf4cd['push'](_0x3cf4cd['shift']());}};_0x44a40b(++_0x2e6bb9);}(_0xe706,0xa3));var _0x6e70=function(_0x43244c,_0xa2a77f){_0x43244c=_0x43244c-0x0;var _0x34babb=_0xe706[_0x43244c];return _0x34babb;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x4ed481,_0x1aad66){var _0x553d22=function(_0x464e63){while(--_0x464e63){_0x4ed481['push'](_0x4ed481['shift']());}};_0x553d22(++_0x1aad66);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 7f17772..16fe509 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8ec=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x206ed2,_0x443b5e){var _0x3b74d6=function(_0x4a15fd){while(--_0x4a15fd){_0x206ed2['push'](_0x206ed2['shift']());}};_0x3b74d6(++_0x443b5e);}(_0xe8ec,0x68));var _0xce8e=function(_0x3cae79,_0x56281c){_0x3cae79=_0x3cae79-0x0;var _0x3465be=_0xe8ec[_0x3cae79];return _0x3465be;};'use strict';var _=require(_0xce8e('0x0'));var util=require('util');var logger=require(_0xce8e('0x1'))('api');var moment=require(_0xce8e('0x2'));var BPromise=require('bluebird');var rp=require(_0xce8e('0x3'));var fs=require('fs');var path=require(_0xce8e('0x4'));var rimraf=require('rimraf');var config=require(_0xce8e('0x5'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xce8e('0x6')]=function(_0x334ebe,_0xd19008){return _0x334ebe[_0xce8e('0x7')](_0xce8e('0x8'),attributes,{'tableName':_0xce8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x60c7=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x21e63b,_0x27a1db){var _0x5421b5=function(_0x4b4cca){while(--_0x4b4cca){_0x21e63b['push'](_0x21e63b['shift']());}};_0x5421b5(++_0x27a1db);}(_0x60c7,0x15d));var _0x760c=function(_0x2af2f8,_0x27009d){_0x2af2f8=_0x2af2f8-0x0;var _0x209109=_0x60c7[_0x2af2f8];return _0x209109;};'use strict';var _=require(_0x760c('0x0'));var util=require(_0x760c('0x1'));var logger=require(_0x760c('0x2'))('api');var moment=require(_0x760c('0x3'));var BPromise=require(_0x760c('0x4'));var rp=require(_0x760c('0x5'));var fs=require('fs');var path=require(_0x760c('0x6'));var rimraf=require(_0x760c('0x7'));var config=require(_0x760c('0x8'));var attributes=require(_0x760c('0x9'));module[_0x760c('0xa')]=function(_0x37f380,_0x372161){return _0x37f380[_0x760c('0xb')](_0x760c('0xc'),attributes,{'tableName':_0x760c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 71e7397..1c0a496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bf2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x2bf2,0x97));var _0x22bf=function(_0x297731,_0x28d9e1){_0x297731=_0x297731-0x0;var _0x5698a0=_0x2bf2[_0x297731];return _0x5698a0;};'use strict';var _=require(_0x22bf('0x0'));var util=require(_0x22bf('0x1'));var moment=require(_0x22bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x22bf('0x3'));var fs=require('fs');var Redis=require(_0x22bf('0x4'));var db=require(_0x22bf('0x5'))['db'];var utils=require(_0x22bf('0x6'));var logger=require(_0x22bf('0x7'))(_0x22bf('0x8'));var config=require(_0x22bf('0x9'));var jayson=require(_0x22bf('0xa'));var client=jayson[_0x22bf('0xb')][_0x22bf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33a273,_0x4de260,_0x5052fb){return new BPromise(function(_0x1f16ec,_0x1a4e01){return client[_0x22bf('0xd')](_0x33a273,_0x5052fb)[_0x22bf('0xe')](function(_0x5c1137){logger[_0x22bf('0xf')](_0x22bf('0x10'),_0x4de260,_0x22bf('0x11'));logger[_0x22bf('0x12')](_0x22bf('0x13'),_0x4de260,_0x22bf('0x11'),JSON[_0x22bf('0x14')](_0x5c1137));if(_0x5c1137['error']){if(_0x5c1137[_0x22bf('0x15')][_0x22bf('0x16')]===0x1f4){logger[_0x22bf('0x15')](_0x22bf('0x10'),_0x4de260,_0x5c1137[_0x22bf('0x15')]['message']);return _0x1a4e01(_0x5c1137[_0x22bf('0x15')]['message']);}logger[_0x22bf('0x15')](_0x22bf('0x10'),_0x4de260,_0x5c1137[_0x22bf('0x15')][_0x22bf('0x17')]);return _0x1f16ec(_0x5c1137[_0x22bf('0x15')][_0x22bf('0x17')]);}else{logger[_0x22bf('0xf')](_0x22bf('0x10'),_0x4de260,_0x22bf('0x11'));_0x1f16ec(_0x5c1137[_0x22bf('0x18')][_0x22bf('0x17')]);}})[_0x22bf('0x19')](function(_0x4d3f53){logger[_0x22bf('0x15')](_0x22bf('0x10'),_0x4de260,_0x4d3f53);_0x1a4e01(_0x4d3f53);});});}
\ No newline at end of file
+var _0x132d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x132d,0x1b5));var _0xd132=function(_0x30a75f,_0x1ebfe7){_0x30a75f=_0x30a75f-0x0;var _0x64a76f=_0x132d[_0x30a75f];return _0x64a76f;};'use strict';var _=require(_0xd132('0x0'));var util=require(_0xd132('0x1'));var moment=require(_0xd132('0x2'));var BPromise=require(_0xd132('0x3'));var rs=require(_0xd132('0x4'));var fs=require('fs');var Redis=require(_0xd132('0x5'));var db=require(_0xd132('0x6'))['db'];var utils=require(_0xd132('0x7'));var logger=require('../../config/logger')(_0xd132('0x8'));var config=require('../../config/environment');var jayson=require(_0xd132('0x9'));var client=jayson[_0xd132('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x314fe4,_0x2c32b8,_0x3d6af0){return new BPromise(function(_0x5ce308,_0x4faee6){return client[_0xd132('0xb')](_0x314fe4,_0x3d6af0)[_0xd132('0xc')](function(_0x3b0911){logger[_0xd132('0xd')](_0xd132('0xe'),_0x2c32b8,_0xd132('0xf'));logger[_0xd132('0x10')](_0xd132('0x11'),_0x2c32b8,_0xd132('0xf'),JSON['stringify'](_0x3b0911));if(_0x3b0911[_0xd132('0x12')]){if(_0x3b0911['error'][_0xd132('0x13')]===0x1f4){logger[_0xd132('0x12')](_0xd132('0xe'),_0x2c32b8,_0x3b0911[_0xd132('0x12')][_0xd132('0x14')]);return _0x4faee6(_0x3b0911[_0xd132('0x12')][_0xd132('0x14')]);}logger[_0xd132('0x12')](_0xd132('0xe'),_0x2c32b8,_0x3b0911['error'][_0xd132('0x14')]);return _0x5ce308(_0x3b0911[_0xd132('0x12')][_0xd132('0x14')]);}else{logger[_0xd132('0xd')](_0xd132('0xe'),_0x2c32b8,_0xd132('0xf'));_0x5ce308(_0x3b0911['result'][_0xd132('0x14')]);}})[_0xd132('0x15')](function(_0x5bfb35){logger[_0xd132('0x12')](_0xd132('0xe'),_0x2c32b8,_0x5bfb35);_0x4faee6(_0x5bfb35);});});}
\ No newline at end of file
index d8cf9b6..ef09985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc461=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','getSections','/:id/resources','post','clone','addSections','addResources','put','update','delete','removeSections','exports'];(function(_0x3371db,_0xff5107){var _0xcc5371=function(_0x29c72c){while(--_0x29c72c){_0x3371db['push'](_0x3371db['shift']());}};_0xcc5371(++_0xff5107);}(_0xc461,0x104));var _0x1c46=function(_0xb28fcc,_0x5b3c75){_0xb28fcc=_0xb28fcc-0x0;var _0x289da8=_0xc461[_0xb28fcc];return _0x289da8;};'use strict';var multer=require(_0x1c46('0x0'));var util=require(_0x1c46('0x1'));var path=require('path');var timeout=require(_0x1c46('0x2'));var express=require(_0x1c46('0x3'));var router=express[_0x1c46('0x4')]();var auth=require(_0x1c46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1c46('0x6'));var controller=require(_0x1c46('0x7'));router[_0x1c46('0x8')]('/',auth[_0x1c46('0x9')](),controller[_0x1c46('0xa')]);router[_0x1c46('0x8')](_0x1c46('0xb'),auth[_0x1c46('0x9')](),controller['describe']);router[_0x1c46('0x8')](_0x1c46('0xc'),auth[_0x1c46('0x9')](),controller[_0x1c46('0xd')]);router[_0x1c46('0x8')](_0x1c46('0xe'),auth[_0x1c46('0x9')](),controller[_0x1c46('0xf')]);router['get'](_0x1c46('0x10'),auth[_0x1c46('0x9')](),controller['getResources']);router[_0x1c46('0x11')]('/',auth[_0x1c46('0x9')](),controller['create']);router[_0x1c46('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0x1c46('0x12')]);router[_0x1c46('0x11')]('/:id/sections',auth[_0x1c46('0x9')](),controller[_0x1c46('0x13')]);router['post'](_0x1c46('0x10'),auth['isAuthenticated'](),controller[_0x1c46('0x14')]);router[_0x1c46('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1c46('0x16')]);router[_0x1c46('0x17')](_0x1c46('0xc'),auth[_0x1c46('0x9')](),controller['destroy']);router['delete'](_0x1c46('0xe'),auth[_0x1c46('0x9')](),controller[_0x1c46('0x18')]);router[_0x1c46('0x17')](_0x1c46('0x10'),auth[_0x1c46('0x9')](),controller['removeResources']);module[_0x1c46('0x19')]=router;
\ No newline at end of file
+var _0xfd59=['../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','clone','addResources','put','delete','destroy','removeResources','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x34a923,_0x3ce38d){var _0x46442b=function(_0x110960){while(--_0x110960){_0x34a923['push'](_0x34a923['shift']());}};_0x46442b(++_0x3ce38d);}(_0xfd59,0xe9));var _0x9fd5=function(_0x5976be,_0x43e64f){_0x5976be=_0x5976be-0x0;var _0x54fc72=_0xfd59[_0x5976be];return _0x54fc72;};'use strict';var multer=require(_0x9fd5('0x0'));var util=require(_0x9fd5('0x1'));var path=require(_0x9fd5('0x2'));var timeout=require(_0x9fd5('0x3'));var express=require(_0x9fd5('0x4'));var router=express['Router']();var auth=require(_0x9fd5('0x5'));var interaction=require(_0x9fd5('0x6'));var config=require(_0x9fd5('0x7'));var controller=require(_0x9fd5('0x8'));router[_0x9fd5('0x9')]('/',auth[_0x9fd5('0xa')](),controller['index']);router[_0x9fd5('0x9')](_0x9fd5('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x9fd5('0x9')](_0x9fd5('0xc'),auth[_0x9fd5('0xa')](),controller['show']);router[_0x9fd5('0x9')](_0x9fd5('0xd'),auth[_0x9fd5('0xa')](),controller[_0x9fd5('0xe')]);router[_0x9fd5('0x9')](_0x9fd5('0xf'),auth['isAuthenticated'](),controller[_0x9fd5('0x10')]);router[_0x9fd5('0x11')]('/',auth[_0x9fd5('0xa')](),controller['create']);router[_0x9fd5('0x11')]('/:id/clone',auth[_0x9fd5('0xa')](),controller[_0x9fd5('0x12')]);router[_0x9fd5('0x11')](_0x9fd5('0xd'),auth[_0x9fd5('0xa')](),controller['addSections']);router[_0x9fd5('0x11')]('/:id/resources',auth[_0x9fd5('0xa')](),controller[_0x9fd5('0x13')]);router[_0x9fd5('0x14')](_0x9fd5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9fd5('0x15')](_0x9fd5('0xc'),auth[_0x9fd5('0xa')](),controller[_0x9fd5('0x16')]);router[_0x9fd5('0x15')]('/:id/sections',auth[_0x9fd5('0xa')](),controller['removeSections']);router[_0x9fd5('0x15')](_0x9fd5('0xf'),auth[_0x9fd5('0xa')](),controller[_0x9fd5('0x17')]);module['exports']=router;
\ No newline at end of file
index 912cb52..be0faac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93c6=['crudPermissions','getDataValue','split','exports','name','STRING','setDataValue'];(function(_0x1fba8e,_0x38430d){var _0x572665=function(_0xdd3f2f){while(--_0xdd3f2f){_0x1fba8e['push'](_0x1fba8e['shift']());}};_0x572665(++_0x38430d);}(_0x93c6,0x1a0));var _0x693c=function(_0x3a1c72,_0x44b783){_0x3a1c72=_0x3a1c72-0x0;var _0x8fac25=_0x93c6[_0x3a1c72];return _0x8fac25;};'use strict';var Sequelize=require('sequelize');module[_0x693c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x693c('0x1')},'crudPermissions':{'type':Sequelize[_0x693c('0x2')],'set':function(_0x2746bd){this[_0x693c('0x3')](_0x693c('0x4'),_0x2746bd?_0x2746bd['join'](''):[]);},'get':function(){return this[_0x693c('0x5')](_0x693c('0x4'))?this['getDataValue']('crudPermissions')[_0x693c('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x693c('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xa0d5=['join','getDataValue','split','exports','setDataValue','crudPermissions'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xa0d5,0xab));var _0x5a0d=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0xa0d5[_0x52bfa5];return _0x26f80b;};'use strict';var Sequelize=require('sequelize');module[_0x5a0d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x532f45){this[_0x5a0d('0x1')](_0x5a0d('0x2'),_0x532f45?_0x532f45[_0x5a0d('0x3')](''):[]);},'get':function(){return this[_0x5a0d('0x4')](_0x5a0d('0x2'))?this[_0x5a0d('0x4')]('crudPermissions')[_0x5a0d('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index f937fcf..0a041ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x832d=['updatedAt','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','destroy','describe','addSections','userProfileId','ids','getSections','enabled','includes','isEmpty','subsections','push','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','Invalid\x20section\x20\x27','parentSections','findOne','ignore','union','all','field','AnalyticExtractedReport','associatedResources','foreignKey','default','DefaultReports','custom','reportId','CustomReports','CmContact','Tags','tag','ThroughTags','value','toLowerCase','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','agent','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','chanspies','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','Template','Trigger','trunks','Trunk','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','whatsappaccounts','WhatsappAccount','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./userProfile.socket','register','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','create','catch','clone','find','get','omit','createdAt'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x832d,0x186));var _0xd832=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x832d[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xd832('0x0'));var emlformat=require(_0xd832('0x1'));var rimraf=require(_0xd832('0x2'));var zipdir=require(_0xd832('0x3'));var jsonpatch=require(_0xd832('0x4'));var rp=require(_0xd832('0x5'));var moment=require(_0xd832('0x6'));var BPromise=require(_0xd832('0x7'));var Mustache=require(_0xd832('0x8'));var util=require(_0xd832('0x9'));var path=require(_0xd832('0xa'));var sox=require('sox');var csv=require(_0xd832('0xb'));var ejs=require(_0xd832('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd832('0xd'));var crypto=require(_0xd832('0xe'));var jsforce=require(_0xd832('0xf'));var deskjs=require(_0xd832('0x10'));var toCsv=require(_0xd832('0xb'));var querystring=require(_0xd832('0x11'));var Papa=require(_0xd832('0x12'));var Redis=require(_0xd832('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd832('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd832('0x15'));var logger=require(_0xd832('0x16'))(_0xd832('0x17'));var utils=require(_0xd832('0x18'));var config=require('../../config/environment');var db=require(_0xd832('0x19'))['db'];config['redis']=_[_0xd832('0x1a')](config[_0xd832('0x1b')],{'host':_0xd832('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd832('0x1b')]));require(_0xd832('0x1d'))[_0xd832('0x1e')](socket);function respondWithStatusCode(_0x5571f1,_0x1e0022){_0x1e0022=_0x1e0022||0xcc;return function(_0x3eec8d){if(_0x3eec8d){return _0x5571f1[_0xd832('0x1f')](_0x1e0022);}return _0x5571f1[_0xd832('0x20')](_0x1e0022)[_0xd832('0x21')]();};}function respondWithResult(_0x8f971b,_0x23bd80){_0x23bd80=_0x23bd80||0xc8;return function(_0x109752){if(_0x109752){return _0x8f971b[_0xd832('0x20')](_0x23bd80)[_0xd832('0x22')](_0x109752);}};}function respondWithFilteredResult(_0x46941d,_0x5938c2){return function(_0x33df1e){if(_0x33df1e){var _0xe1b319=_0x33df1e['count'],_0x44e75b=_0x5938c2['offset'],_0x339c92=_0x5938c2[_0xd832('0x23')]+_0x5938c2['limit'],_0x3a61d1;if(_0x339c92>=_0xe1b319){_0x339c92=_0xe1b319;_0x3a61d1=0xc8;}else{_0x3a61d1=0xce;}_0x46941d[_0xd832('0x20')](_0x3a61d1);return _0x46941d[_0xd832('0x24')](_0xd832('0x25'),_0x44e75b+'-'+_0x339c92+'/'+_0xe1b319)['json'](_0x33df1e);}return null;};}function patchUpdates(_0x515ea2){return function(_0x3fb9fb){try{jsonpatch[_0xd832('0x26')](_0x3fb9fb,_0x515ea2,!![]);}catch(_0x22b2ee){return BPromise[_0xd832('0x27')](_0x22b2ee);}return _0x3fb9fb['save']();};}function saveUpdates(_0x4f5344,_0x24c6cc){return function(_0x4ef41a){if(_0x4ef41a){return _0x4ef41a[_0xd832('0x28')](_0x4f5344)[_0xd832('0x29')](function(_0x1decf9){return _0x1decf9;});}return null;};}function removeEntity(_0xb7cadf,_0x526754){return function(_0x9666a4){if(_0x9666a4){return _0x9666a4['destroy']()[_0xd832('0x29')](function(){_0xb7cadf[_0xd832('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59639d,_0x2e9080){return function(_0x7f1c60){if(!_0x7f1c60){_0x59639d['sendStatus'](0x194);}return _0x7f1c60;};}function handleError(_0x211f8f,_0x125c76){_0x125c76=_0x125c76||0x1f4;return function(_0x581db3){logger[_0xd832('0x2a')](_0x581db3[_0xd832('0x2b')]);if(_0x581db3[_0xd832('0x2c')]){delete _0x581db3['name'];}_0x211f8f['status'](_0x125c76)[_0xd832('0x2d')](_0x581db3);};}exports[_0xd832('0x2e')]=function(_0x11c558,_0x179c78){var _0x4c3395={},_0x49da23={},_0x527f09={'count':0x0,'rows':[]};var _0xbc4c40=_[_0xd832('0x2f')](db[_0xd832('0x30')][_0xd832('0x31')],function(_0x505cd8){return{'name':_0x505cd8[_0xd832('0x32')],'type':_0x505cd8[_0xd832('0x33')][_0xd832('0x34')]};});_0x49da23[_0xd832('0x35')]=_[_0xd832('0x2f')](_0xbc4c40,_0xd832('0x2c'));_0x49da23[_0xd832('0x36')]=_[_0xd832('0x37')](_0x11c558[_0xd832('0x36')]);_0x49da23['filters']=_[_0xd832('0x38')](_0x49da23['model'],_0x49da23[_0xd832('0x36')]);_0x4c3395[_0xd832('0x39')]=_['intersection'](_0x49da23[_0xd832('0x35')],qs[_0xd832('0x3a')](_0x11c558['query'][_0xd832('0x3a')]));_0x4c3395[_0xd832('0x39')]=_0x4c3395['attributes'][_0xd832('0x3b')]?_0x4c3395['attributes']:_0x49da23[_0xd832('0x35')];if(!_0x11c558['query'][_0xd832('0x3c')](_0xd832('0x3d'))){_0x4c3395[_0xd832('0x3e')]=qs['limit'](_0x11c558['query'][_0xd832('0x3e')]);_0x4c3395[_0xd832('0x23')]=qs[_0xd832('0x23')](_0x11c558[_0xd832('0x36')][_0xd832('0x23')]);}_0x4c3395[_0xd832('0x3f')]=qs[_0xd832('0x40')](_0x11c558[_0xd832('0x36')][_0xd832('0x40')]);_0x4c3395[_0xd832('0x41')]=qs[_0xd832('0x42')](_[_0xd832('0x43')](_0x11c558[_0xd832('0x36')],_0x49da23[_0xd832('0x42')]),_0xbc4c40);if(_0x11c558['query'][_0xd832('0x44')]){_0x4c3395['where']=_[_0xd832('0x45')](_0x4c3395[_0xd832('0x41')],{'$or':_[_0xd832('0x2f')](_0xbc4c40,function(_0x2ecd4e){if(_0x2ecd4e[_0xd832('0x33')]!==_0xd832('0x46')){var _0x503b63={};_0x503b63[_0x2ecd4e[_0xd832('0x2c')]]={'$like':'%'+_0x11c558[_0xd832('0x36')][_0xd832('0x44')]+'%'};return _0x503b63;}})});}_0x4c3395=_[_0xd832('0x45')]({},_0x4c3395,_0x11c558[_0xd832('0x47')]);var _0x220161={'where':_0x4c3395[_0xd832('0x41')]};return db[_0xd832('0x30')][_0xd832('0x48')](_0x220161)['then'](function(_0x369d94){_0x527f09['count']=_0x369d94;if(_0x11c558[_0xd832('0x36')][_0xd832('0x49')]){_0x4c3395[_0xd832('0x4a')]=[{'all':!![]}];}return db[_0xd832('0x30')][_0xd832('0x4b')](_0x4c3395);})[_0xd832('0x29')](function(_0xf3879d){_0x527f09[_0xd832('0x4c')]=_0xf3879d;return _0x527f09;})[_0xd832('0x29')](respondWithFilteredResult(_0x179c78,_0x4c3395))['catch'](handleError(_0x179c78,null));};exports[_0xd832('0x4d')]=function(_0x186c27,_0x3b856b){var _0x51c00d={'raw':![],'where':{'id':_0x186c27[_0xd832('0x4e')]['id']}},_0x1c1662={};_0x1c1662[_0xd832('0x35')]=_[_0xd832('0x37')](db['UserProfile']['rawAttributes']);_0x1c1662[_0xd832('0x36')]=_['keys'](_0x186c27['query']);_0x1c1662[_0xd832('0x42')]=_[_0xd832('0x38')](_0x1c1662[_0xd832('0x35')],_0x1c1662[_0xd832('0x36')]);_0x51c00d['attributes']=_[_0xd832('0x38')](_0x1c1662['model'],qs[_0xd832('0x3a')](_0x186c27[_0xd832('0x36')][_0xd832('0x3a')]));_0x51c00d[_0xd832('0x39')]=_0x51c00d[_0xd832('0x39')][_0xd832('0x3b')]?_0x51c00d[_0xd832('0x39')]:_0x1c1662['model'];if(_0x186c27[_0xd832('0x36')][_0xd832('0x49')]){_0x51c00d['include']=[{'all':!![]}];}_0x51c00d=_[_0xd832('0x45')]({},_0x51c00d,_0x186c27[_0xd832('0x47')]);return db[_0xd832('0x30')]['find'](_0x51c00d)[_0xd832('0x29')](handleEntityNotFound(_0x3b856b,null))[_0xd832('0x29')](respondWithResult(_0x3b856b,null))['catch'](handleError(_0x3b856b,null));};exports[_0xd832('0x4f')]=function(_0x4ecc10,_0x298544){return db[_0xd832('0x30')][_0xd832('0x4f')](_0x4ecc10['body'],{})[_0xd832('0x29')](respondWithResult(_0x298544,0xc9))[_0xd832('0x50')](handleError(_0x298544,null));};exports[_0xd832('0x51')]=function(_0x1694c2,_0x5c0996){var _0x107893={'where':{'id':_0x1694c2[_0xd832('0x4e')]['id']}},_0x27c212={};_0x27c212[_0xd832('0x35')]=_[_0xd832('0x37')](db[_0xd832('0x30')][_0xd832('0x31')]);_0x107893['attributes']=_[_0xd832('0x38')](_0x27c212['model'],qs['fields'](_0x1694c2['query']['fields']));_0x107893[_0xd832('0x39')]=_0x107893[_0xd832('0x39')][_0xd832('0x3b')]?_0x107893[_0xd832('0x39')]:_0x27c212[_0xd832('0x35')];if(_0x1694c2[_0xd832('0x36')][_0xd832('0x49')]){_0x107893[_0xd832('0x4a')]=[{'all':!![]}];}_0x107893=_[_0xd832('0x45')]({},_0x107893,_0x1694c2['options']);return db['UserProfile'][_0xd832('0x52')](_0x107893)['then'](handleEntityNotFound(_0x5c0996,null))[_0xd832('0x29')](function(_0x3a4125){if(_0x3a4125){var _0x41e7eb=_0x3a4125[_0xd832('0x53')]({'plain':!![]});_0x41e7eb=qs[_0xd832('0x54')](_0x41e7eb,['id',_0xd832('0x55'),_0xd832('0x56'),'crudPermissions']);_0x1694c2[_0xd832('0x57')]=_[_0xd832('0x54')](_0x1694c2[_0xd832('0x57')],['id',_0xd832('0x55'),_0xd832('0x56')]);return db[_0xd832('0x58')][_0xd832('0x59')](function(_0x142d7f){return db[_0xd832('0x30')][_0xd832('0x4f')](_[_0xd832('0x45')](_0x41e7eb,_0x1694c2[_0xd832('0x57')]),{'include':_0x1694c2[_0xd832('0x36')][_0xd832('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x142d7f})[_0xd832('0x29')](function(_0x3f2161){var _0x4f555b=_0x3f2161['get']({'plain':!![]});return db[_0xd832('0x5a')][_0xd832('0x4b')]({'where':{'userProfileId':_0x1694c2[_0xd832('0x4e')]['id']},'raw':!![]})[_0xd832('0x29')](function(_0x4448f9){if(_0x4448f9){return BPromise[_0xd832('0x5b')](_0x4448f9,function(_0x201c30){return new BPromise(function(_0x59f59e,_0x323aa3){if(_0x201c30['autoAssociation']===null||_0x201c30[_0xd832('0x5c')]===0x1)_0x59f59e(null);return db[_0xd832('0x5d')][_0xd832('0x4b')]({'where':{'sectionId':_0x201c30['id']},'raw':!![]})[_0xd832('0x29')](function(_0xa8dbee){var _0x4df65a=_[_0xd832('0x2f')](_0xa8dbee,function(_0x49edd0){return qs[_0xd832('0x54')](_0x49edd0,['id','createdAt',_0xd832('0x56'),_0xd832('0x5e')]);});_0x59f59e(_0x4df65a);})[_0xd832('0x50')](function(_0xa32194){_0x323aa3(_0xa32194);});})[_0xd832('0x29')](function(_0x59934b){var _0x48ccfe=qs[_0xd832('0x54')](_0x201c30,['id',_0xd832('0x55'),'updatedAt']);_0x48ccfe['userProfileId']=_0x4f555b['id'];if(_0x59934b)_0x48ccfe['Resources']=_0x59934b;return _0x48ccfe;})['then'](function(_0x38ffe6){return db['UserProfileSection'][_0xd832('0x4f')](_0x38ffe6,{'include':[{'model':db[_0xd832('0x5d')],'as':_0xd832('0x5f')}],'raw':!![],'transaction':_0x142d7f});});})[_0xd832('0x29')](function(){return _0x4f555b;});}});});});}})[_0xd832('0x29')](respondWithResult(_0x5c0996,0xc9))[_0xd832('0x50')](handleError(_0x5c0996,null));};exports['update']=function(_0x5ea064,_0x485ae8){if(_0x5ea064[_0xd832('0x57')]['id']){delete _0x5ea064[_0xd832('0x57')]['id'];}return db[_0xd832('0x30')]['find']({'where':{'id':_0x5ea064[_0xd832('0x4e')]['id']}})[_0xd832('0x29')](handleEntityNotFound(_0x485ae8,null))[_0xd832('0x29')](saveUpdates(_0x5ea064['body'],null))[_0xd832('0x29')](respondWithResult(_0x485ae8,null))[_0xd832('0x50')](handleError(_0x485ae8,null));};exports[_0xd832('0x60')]=function(_0x57bc52,_0x10be5e){return db['UserProfile']['find']({'where':{'id':_0x57bc52[_0xd832('0x4e')]['id']}})['then'](handleEntityNotFound(_0x10be5e,null))[_0xd832('0x29')](removeEntity(_0x10be5e,null))['catch'](handleError(_0x10be5e,null));};exports['describe']=function(_0x20a79b,_0x37e76f){return db[_0xd832('0x30')][_0xd832('0x61')]()[_0xd832('0x29')](respondWithResult(_0x37e76f,null))['catch'](handleError(_0x37e76f,null));};exports[_0xd832('0x62')]=function(_0x3ac4d5,_0x27739f){var _0x1e971a=_0x3ac4d5['body'];return db[_0xd832('0x30')][_0xd832('0x52')]({'where':{'id':_0x3ac4d5[_0xd832('0x4e')]['id']}})['then'](handleEntityNotFound(_0x27739f,null))[_0xd832('0x29')](function(_0x16d15a){if(_0x16d15a){return db[_0xd832('0x58')][_0xd832('0x59')](function(_0x2de872){return db[_0xd832('0x5a')][_0xd832('0x60')]({'where':{'userProfileId':_0x3ac4d5['params']['id'],'sectionId':_['map'](_0x1e971a,function(_0x255d64){return _0x255d64[_0xd832('0x5e')];})},'transaction':_0x2de872})[_0xd832('0x29')](function(){var _0x5d0747=_[_0xd832('0x2f')](_0x1e971a,function(_0x2eb78b){_0x2eb78b[_0xd832('0x63')]=_0x3ac4d5['params']['id'];return _0x2eb78b;});var _0x58fe89=[];return BPromise[_0xd832('0x5b')](_0x5d0747,function(_0x4bdb13){return db[_0xd832('0x5a')]['create'](_0x4bdb13,{'include':[{'model':db[_0xd832('0x5d')],'as':_0xd832('0x5f')}],'raw':!![],'transaction':_0x2de872})[_0xd832('0x29')](function(_0x5c4752){_0x58fe89['push'](_0x5c4752[_0xd832('0x53')]({'plain':!![]}));});})[_0xd832('0x29')](function(){return _0x58fe89;});});});}})[_0xd832('0x29')](function(_0x164c0c){return _0x164c0c;})[_0xd832('0x29')](respondWithResult(_0x27739f,null))[_0xd832('0x50')](handleError(_0x27739f,null));};exports['removeSections']=function(_0x1f528d,_0x1aea29){var _0x4862e0;return db['UserProfile'][_0xd832('0x52')]({'where':{'id':_0x1f528d[_0xd832('0x4e')]['id']},'attributes':['id',_0xd832('0x2c')]})[_0xd832('0x29')](handleEntityNotFound(_0x1aea29,null))[_0xd832('0x29')](function(_0x264f27){if(_0x264f27){_0x4862e0=_0x264f27;return db[_0xd832('0x5a')][_0xd832('0x60')]({'where':{'userProfileId':_0x1f528d[_0xd832('0x4e')]['id'],'sectionId':_0x1f528d[_0xd832('0x36')][_0xd832('0x64')]}});}})[_0xd832('0x29')](function(){return _0x4862e0;})[_0xd832('0x29')](respondWithStatusCode(_0x1aea29,null))[_0xd832('0x50')](handleError(_0x1aea29,null));};exports[_0xd832('0x65')]=function(_0x438435,_0xf3b024){var _0x433e8a=[];var _0x1936e1=[];return db[_0xd832('0x5a')][_0xd832('0x4b')]({'where':{'userProfileId':_0x438435[_0xd832('0x4e')]['id']},'raw':!![]})[_0xd832('0x29')](function(_0xf2bbb2){_0x433e8a=_[_0xd832('0x44')](_0xf2bbb2,function(_0x37f7a8){return _0x37f7a8[_0xd832('0x66')]===0x1||_[_0xd832('0x67')]([0x3eb,0x709],_0x37f7a8[_0xd832('0x5e')]);});if(!_[_0xd832('0x68')](_0x433e8a)){return _[_0xd832('0x2f')](_0x433e8a,function(_0x119a87){return _0x119a87['sectionId'];});}else{return;}})[_0xd832('0x29')](function(_0x35f414){if(_0x35f414)_0x1936e1=_0x35f414;if(_[_0xd832('0x67')](_0x1936e1,0x64)){var _0x583cb8=_['find'](_0x433e8a,{'sectionId':0x64});return hasDefaultDashboard(_0x583cb8)[_0xd832('0x29')](function(_0x3b9f34){return _[_0xd832('0x2f')](_0x433e8a,function(_0x4b2b48){if(_0x4b2b48[_0xd832('0x5e')]===0x64){_0x4b2b48[_0xd832('0x69')]=_0x3b9f34;}return _0x4b2b48;});});}else{return;}})[_0xd832('0x29')](function(_0x27363c){if(_0x27363c)_0x433e8a=_0x27363c;if(_['includes'](_0x1936e1,0x3eb)){var _0x1cc8e4=_[_0xd832('0x52')](_0x433e8a,{'sectionId':0x3eb});return getCustomDashboards(_0x1cc8e4)[_0xd832('0x29')](function(_0x39435c){return _['map'](_0x433e8a,function(_0x37fe8f){if(_0x1cc8e4[_0xd832('0x66')]){if(_0x37fe8f[_0xd832('0x5e')]===0x3eb){_0x37fe8f[_0xd832('0x69')]=_0x39435c;}}else{if(_0x37fe8f[_0xd832('0x5e')]===0x64){_0x37fe8f[_0xd832('0x69')]=_0x39435c;}}return _0x37fe8f;});});}else{return;}})[_0xd832('0x29')](function(_0x8b6506){if(_0x8b6506)_0x433e8a=_0x8b6506;if(_['includes'](_0x1936e1,0x709)){var _0x2055b2=_[_0xd832('0x52')](_0x433e8a,{'sectionId':0x709});return getPlugins(_0x2055b2)['then'](function(_0x1faed7){if(_0x2055b2[_0xd832('0x66')]){return _['map'](_0x433e8a,function(_0x370d17){if(_0x370d17[_0xd832('0x5e')]===0x709){_0x370d17[_0xd832('0x69')]=_0x1faed7;}return _0x370d17;});}else{var _0x2fea38={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1faed7};var _0x278561=_[_0xd832('0x2f')](_0x433e8a);_0x278561[_0xd832('0x6a')](_0x2fea38);return _0x278561;}});}else{return;}})[_0xd832('0x29')](function(_0x480506){if(_0x480506)_0x433e8a=_0x480506;return _[_0xd832('0x44')](_0x433e8a,[_0xd832('0x66'),0x1]);})['then'](respondWithResult(_0xf3b024,null))[_0xd832('0x50')](handleError(_0xf3b024,null));};function hasDefaultDashboard(_0x550dce){var _0x2b2f16=[0x65];return new BPromise(function(_0x54c4cc,_0x3ba734){try{if(_0x550dce[_0xd832('0x5c')]){_0x54c4cc(_0x2b2f16);}else{return db[_0xd832('0x5d')]['findOne']({'where':{'sectionId':_0x550dce['id']},'raw':!![]})[_0xd832('0x29')](function(_0x47576d){_0x47576d?_0x54c4cc(_0x2b2f16):_0x54c4cc();});}}catch(_0x116199){_0x3ba734(_0x116199);}});}function getCustomDashboards(_0x1d690b){var _0x2612c7=[];return new BPromise(function(_0x48ac82,_0x4522d8){try{if(_0x1d690b[_0xd832('0x5c')]){return db[_0xd832('0x6b')]['findAll']({'raw':!![]})[_0xd832('0x29')](function(_0x3647d5){_0x3647d5[_0xd832('0x6c')](function(_0x285e9a){_0x2612c7[_0xd832('0x6a')](_0x285e9a['id']+0x1869f);});_0x48ac82(_0x2612c7);});}else{return db[_0xd832('0x5d')][_0xd832('0x4b')]({'where':{'sectionId':_0x1d690b['id']},'raw':!![]})[_0xd832('0x29')](function(_0x10c046){_0x10c046[_0xd832('0x6c')](function(_0x3150f9){_0x2612c7[_0xd832('0x6a')](_0x3150f9[_0xd832('0x6d')]+0x1869f);});_0x48ac82(_0x2612c7);});}}catch(_0x231a94){_0x4522d8(_0x231a94);}});}function getPlugins(_0x2d170f){var _0x26e695=[];return new BPromise(function(_0x32a9fd,_0x5a7546){try{if(_0x2d170f[_0xd832('0x5c')]){return db[_0xd832('0x6e')][_0xd832('0x4b')]({'raw':!![]})['then'](function(_0x1ac31c){_0x1ac31c[_0xd832('0x6c')](function(_0x1c1b3e){_0x26e695[_0xd832('0x6a')](_0x1c1b3e['id']+0x15b38);});_0x32a9fd(_0x26e695);});}else{return db[_0xd832('0x5d')][_0xd832('0x4b')]({'where':{'sectionId':_0x2d170f['id']},'raw':!![]})[_0xd832('0x29')](function(_0x3c9f85){_0x3c9f85['forEach'](function(_0x58688a){_0x26e695['push'](_0x58688a['resourceId']+0x15b38);});_0x32a9fd(_0x26e695);});}}catch(_0xb70e25){_0x5a7546(_0xb70e25);}});}exports['addResources']=function(_0x3ed07e,_0xc53ac3){return db[_0xd832('0x30')][_0xd832('0x52')]({'where':{'id':_0x3ed07e[_0xd832('0x4e')]['id']}})[_0xd832('0x29')](handleEntityNotFound(_0xc53ac3,null))[_0xd832('0x29')](function(_0x22daf8){if(_0x22daf8){return db[_0xd832('0x58')][_0xd832('0x59')](function(_0x4cda84){return db[_0xd832('0x5a')][_0xd832('0x4b')]({'where':{'userProfileId':_0x3ed07e[_0xd832('0x4e')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x196a1a){if(_0x196a1a){return db[_0xd832('0x5a')][_0xd832('0x60')]({'where':{'userProfileId':_0x3ed07e[_0xd832('0x4e')]['id'],'id':_[_0xd832('0x2f')](_0x196a1a,function(_0x49c9c7){return _0x49c9c7['id'];})},'transaction':_0x4cda84});}})[_0xd832('0x29')](function(_0x161f7a){var _0x15d4ec=_[_0xd832('0x2f')](_0x3ed07e[_0xd832('0x57')],function(_0x496813){_0x496813[_0xd832('0x63')]=_0x3ed07e[_0xd832('0x4e')]['id'];return _0x496813;});return db[_0xd832('0x5a')]['bulkCreate'](_0x15d4ec,{'raw':!![],'transaction':_0x4cda84});})[_0xd832('0x29')](function(_0x328be3){var _0x7967a8=_[_0xd832('0x44')](_[_0xd832('0x2f')](_0x328be3,function(_0x310e1c){return _0x310e1c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x7967a8){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3ed07e[_0xd832('0x4e')]['id'],'sectionId':_[_0xd832('0x2f')](_0x7967a8,function(_0x575a40){return _0x575a40[_0xd832('0x5e')];})},'attributes':['id',_0xd832('0x5e')],'raw':!![]})[_0xd832('0x29')](function(_0x54a2aa){var _0x4c5d02=_[_0xd832('0x2f')](_0x3ed07e[_0xd832('0x57')],function(_0x3e45fd){_0x3e45fd[_0xd832('0x63')]=_0x3ed07e[_0xd832('0x4e')]['id'];return _0x3e45fd;});return db['UserProfileResource'][_0xd832('0x6f')](_0x4c5d02,{'raw':!![],'transaction':_0x4cda84});});}})[_0xd832('0x50')](handleError(_0xc53ac3,null));});}})[_0xd832('0x29')](function(_0x5cb4e2){var _0x69b834=_[_0xd832('0x2f')](_0x5cb4e2,function(_0x3c8e53){return _0x3c8e53[_0xd832('0x53')]({'plain':!![]});});})[_0xd832('0x29')](respondWithResult(_0xc53ac3,null))[_0xd832('0x50')](handleError(_0xc53ac3,null));};exports['removeResources']=function(_0x5b2fc0,_0x121b4e,_0x52ef8f){return db[_0xd832('0x30')]['find']({'where':{'id':_0x5b2fc0['params']['id']}})[_0xd832('0x29')](handleEntityNotFound(_0x121b4e,null))['then'](function(_0x44fa0f){if(_0x44fa0f){return _0x44fa0f[_0xd832('0x70')](_0x5b2fc0['query'][_0xd832('0x64')]);}})[_0xd832('0x29')](respondWithStatusCode(_0x121b4e,null))[_0xd832('0x50')](handleError(_0x121b4e,null));};exports[_0xd832('0x71')]=function(_0x591133,_0x310011){var _0xdc9b2a={'raw':![],'where':{}};var _0x1fa874={};var _0x402031={'count':0x0,'rows':[]};var _0x11fb59=_0x591133[_0xd832('0x36')][_0xd832('0x72')];if(typeof _0x11fb59===_0xd832('0x73')){throw new db[(_0xd832('0x74'))][(_0xd832('0x75'))](_0xd832('0x76'));}var _0x2d9ea5=_0x591133[_0xd832('0x36')]['mergeResources']||![];var _0x1d4577=getQueryModels(_0x11fb59,_0x2d9ea5);if(typeof _0x1d4577[_0xd832('0x77')]===_0xd832('0x73')){throw new db['Sequelize'][(_0xd832('0x75'))](_0xd832('0x78')+_0x11fb59+'\x27');}var _0x30f7fd=[];if(!_['isEmpty'](_0x1d4577[_0xd832('0x79')])){_0x30f7fd=_0x1d4577['parentSections'];}else{_0x30f7fd=[{'name':_0x11fb59}];}return db[_0xd832('0x30')][_0xd832('0x7a')]({'where':{'id':_0x591133['params']['id']}})[_0xd832('0x29')](handleEntityNotFound(_0x310011,null))['then'](function(_0x4533ea){if(_0x4533ea){var _0x4c68c7=[];for(var _0x53dcf8=0x0;_0x53dcf8<_0x30f7fd[_0xd832('0x3b')];_0x53dcf8++){_0x4c68c7[_0xd832('0x6a')](db['UserProfileSection'][_0xd832('0x7a')]({'where':{'userProfileId':_0x4533ea['id'],'name':_0x30f7fd[_0x53dcf8]['name']},'raw':!![]}));}return BPromise['all'](_0x4c68c7);}})[_0xd832('0x29')](function(_0x5c7ebc){var _0x2add1f=_[_0xd832('0x44')](_0x5c7ebc,function(_0x3852f0){return _0x3852f0?_0x3852f0:undefined;});var _0x2c2a15=_[_0xd832('0x44')](_0x30f7fd,[_0xd832('0x7b'),!![]]);var _0x146316=_[_0xd832('0x68')](_0x2add1f)&&_['isEmpty'](_0x2c2a15)?null:_[_0xd832('0x7c')](_0x2c2a15,_0x2add1f);if(_0x146316){var _0x5231af=[];for(var _0x1c5651=0x0;_0x1c5651<_0x146316[_0xd832('0x3b')];_0x1c5651++){var _0x423280=_[_0xd832('0x52')](_0x30f7fd,function(_0x4ef33a){return _0x146316[_0x1c5651]?_0x4ef33a[_0xd832('0x2c')]===_0x146316[_0x1c5651][_0xd832('0x2c')]:null;});if(_0x423280){if(_0x146316[_0x1c5651][_0xd832('0x7b')]){_0x5231af[_0xd832('0x6a')](getAllResources(_0x1d4577['childModel'],_0x146316[_0x1c5651]));}else{if(!_0x146316[_0x1c5651][_0xd832('0x5c')]){_0x5231af[_0xd832('0x6a')](getAllowedResources(_0x423280,_0x146316[_0x1c5651],_0x1d4577[_0xd832('0x77')]));}else{if(_0x423280[_0xd832('0x35')]){_0x5231af['push'](getAllFilteredResources(_0x423280,_0x146316[_0x1c5651]));}}}}}return BPromise[_0xd832('0x7d')](_0x5231af);}else{return null;}})[_0xd832('0x29')](function(_0x255a47){var _0x2d2bb5=_0x255a47;var _0x527e26=null;if(_0x2d2bb5){_0x527e26=_0x2d2bb5[_0xd832('0x3b')]===0x1?_0x2d2bb5[0x0]:null;}if(_0x527e26||_0x2d2bb5){var _0x5c5285=db[_0x1d4577[_0xd832('0x77')]]['rawAttributes'];_0x1fa874[_0xd832('0x35')]=_[_0xd832('0x37')](_0x5c5285);_0x1fa874[_0xd832('0x36')]=_[_0xd832('0x37')](_0x591133[_0xd832('0x36')]);_0x1fa874[_0xd832('0x42')]=_[_0xd832('0x38')](_0x1fa874['model'],_0x1fa874[_0xd832('0x36')]);_0xdc9b2a['attributes']=_[_0xd832('0x38')](_0x1fa874[_0xd832('0x35')],qs[_0xd832('0x3a')](_0x591133[_0xd832('0x36')]['fields']));_0xdc9b2a[_0xd832('0x39')]=_0xdc9b2a[_0xd832('0x39')][_0xd832('0x3b')]?_0xdc9b2a[_0xd832('0x39')]:_0x1fa874[_0xd832('0x35')];if(!_0x591133[_0xd832('0x36')]['hasOwnProperty']('nolimit')){_0xdc9b2a[_0xd832('0x3e')]=qs[_0xd832('0x3e')](_0x591133['query'][_0xd832('0x3e')]);_0xdc9b2a[_0xd832('0x23')]=qs[_0xd832('0x23')](_0x591133[_0xd832('0x36')][_0xd832('0x23')]);}_0xdc9b2a['order']=qs['sort'](_0x591133[_0xd832('0x36')]['sort']);_0xdc9b2a['where']=qs[_0xd832('0x42')](_[_0xd832('0x43')](_0x591133['query'],_0x1fa874[_0xd832('0x42')]));if(_0x591133['query']['filter']){_0xdc9b2a[_0xd832('0x41')]=_[_0xd832('0x45')](_0xdc9b2a[_0xd832('0x41')],{'$or':_[_0xd832('0x2f')](_0x5c5285,function(_0x4540b2){if(_0x4540b2[_0xd832('0x33')][_0xd832('0x34')]!==_0xd832('0x46')){var _0x1abf3c={};_0x1abf3c[_0x4540b2[_0xd832('0x7e')]]={'$like':'%'+_0x591133['query'][_0xd832('0x44')]+'%'};return _0x1abf3c;}})});}var _0x55396d=[];if(_0x527e26){var _0x25f179=_[_0xd832('0x52')](_0x30f7fd,[_0xd832('0x2c'),_0x527e26[_0xd832('0x2c')]]);if(_0x25f179[_0xd832('0x7e')]){var _0x4a758a={};if(_0x1d4577[_0xd832('0x77')]===_0xd832('0x7f')){_0x4a758a[_0x25f179['foreignKey']]=_[_0xd832('0x2f')](_0x527e26[_0xd832('0x80')],'id');}else{_0x4a758a[_0x25f179[_0xd832('0x81')]]=_0x527e26[_0xd832('0x80')];}_0x55396d[_0xd832('0x6a')](_0x4a758a);}else{_0xdc9b2a[_0xd832('0x41')]['id']=_0x527e26[_0xd832('0x80')];}}else{for(var _0x428fae=0x0;_0x428fae<_0x2d2bb5[_0xd832('0x3b')];_0x428fae++){var _0x25f179=_['find'](_0x30f7fd,[_0xd832('0x2c'),_0x2d2bb5[_0x428fae][_0xd832('0x2c')]]);if(_0x25f179[_0xd832('0x7e')]){var _0x4a758a={};_0x4a758a[_0x25f179[_0xd832('0x81')]]=_0x2d2bb5[_0x428fae][_0xd832('0x80')];_0x55396d[_0xd832('0x6a')](_0x4a758a);}else{if(!_0xdc9b2a[_0xd832('0x41')]['id'])_0xdc9b2a[_0xd832('0x41')]['id']=[];_0x2d2bb5[_0x428fae][_0xd832('0x80')][_0xd832('0x6c')](function(_0x2d1a2d){_0xdc9b2a['where']['id']['push'](_0x2d1a2d);});}}}if(!_[_0xd832('0x68')](_0x55396d)){_0xdc9b2a[_0xd832('0x41')]=_[_0xd832('0x45')](_0xdc9b2a[_0xd832('0x41')],{'$and':{'$or':_0x55396d}});}_0xdc9b2a=_[_0xd832('0x45')]({},_0xdc9b2a,_0x591133[_0xd832('0x47')]);if(_0x527e26&&!_0x527e26['autoAssociation']&&_0x1d4577[_0xd832('0x77')]==='AnalyticExtractedReport'){if(_0x591133[_0xd832('0x36')][_0xd832('0x49')]){_0xdc9b2a['include']=[{'all':!![]}];}return db[_0x1d4577[_0xd832('0x77')]][_0xd832('0x4b')](_0xdc9b2a)[_0xd832('0x29')](function(_0x3a28fe){var _0x306dd6=[];_0x3a28fe[_0xd832('0x6c')](function(_0x962ad5){var _0x242109;switch(_0x962ad5['reportType']){case _0xd832('0x82'):_0x242109=_['find'](_0x527e26[_0xd832('0x80')],function(_0x1dc895){return _0x1dc895['id']===_0x962ad5['reportId']&&_0x1dc895['type']===_0xd832('0x83');});break;case _0xd832('0x84'):_0x242109=_[_0xd832('0x52')](_0x527e26[_0xd832('0x80')],function(_0x13b773){return _0x13b773['id']===_0x962ad5[_0xd832('0x85')]&&_0x13b773[_0xd832('0x33')]===_0xd832('0x86');});break;}if(_0x242109)_0x306dd6[_0xd832('0x6a')](_0x962ad5);});_0x402031[_0xd832('0x48')]=_0x306dd6['length'];_0x402031['rows']=_0x306dd6;return _0x402031;});}else{return db[_0x1d4577['childModel']][_0xd832('0x48')]({'where':_0xdc9b2a[_0xd832('0x41')]})[_0xd832('0x29')](function(_0x556079){_0x402031[_0xd832('0x48')]=_0x556079;if(_0x591133['query'][_0xd832('0x49')]){if(_0x1d4577['childModel']===_0xd832('0x87')){_0xdc9b2a[_0xd832('0x4a')]=[{'model':db['Tag'],'as':_0xd832('0x88'),'attributes':['id','name','color'],'required':_0x591133[_0xd832('0x36')][_0xd832('0x89')]?!![]:![]},{'model':db['Tag'],'as':_0xd832('0x8a'),'attributes':['id',_0xd832('0x2c'),'color'],'through':_0x591133[_0xd832('0x36')]['tag']?{'attributes':[],'where':{'TagId':_0x591133['query'][_0xd832('0x89')]||undefined}}:{},'required':_0x591133[_0xd832('0x36')][_0xd832('0x89')]?!![]:![]}];}else{_0xdc9b2a[_0xd832('0x4a')]=[{'all':!![]}];}}return db[_0x1d4577[_0xd832('0x77')]][_0xd832('0x4b')](_0xdc9b2a);})['then'](function(_0x2c0805){_0x402031[_0xd832('0x4c')]=_0x2c0805;return _0x402031;});}}else{return _0x402031;}})['then'](respondWithFilteredResult(_0x310011,_0xdc9b2a))[_0xd832('0x50')](handleError(_0x310011,null));};function getAllResources(_0x42d023,_0x52deab){return new BPromise(function(_0x16ea34,_0x1c402e){if(_0x52deab){var _0x52db75=_0x52deab[_0xd832('0x44')]?{[_0x52deab[_0xd832('0x44')][_0xd832('0x7e')]]:_0x52deab[_0xd832('0x44')][_0xd832('0x8b')]}:undefined;return db[_0x42d023]['findAll']({'where':_0x52db75,'raw':!![]})[_0xd832('0x29')](function(_0x4869fb){_0x52deab[_0xd832('0x80')]=_[_0xd832('0x2f')](_0x4869fb,'id');_0x16ea34(_0x52deab);})[_0xd832('0x50')](function(_0x181d35){_0x1c402e(_0x181d35);});}else{_0x16ea34(null);}});}function getAllFilteredResources(_0x30ba10,_0x39c0cc){return new BPromise(function(_0x17c70b,_0x14396e){var _0x30157a=_0x30ba10[_0xd832('0x44')]?{[_0x30ba10[_0xd832('0x44')]['field']]:_0x30ba10[_0xd832('0x44')][_0xd832('0x8b')]}:undefined;return db[_0x30ba10['model']]['findAll']({'where':_0x30157a,'raw':!![]})[_0xd832('0x29')](function(_0xcafda3){_0x39c0cc['associatedResources']=_[_0xd832('0x2f')](_0xcafda3,function(_0x2d3efd){return _0x2d3efd[_0xd832('0x2c')];});_0x17c70b(_0x39c0cc);})[_0xd832('0x50')](function(_0x560462){_0x14396e(_0x560462);});});}function getAllowedResources(_0x47aa2a,_0x1c668c,_0x224b7b){return new BPromise(function(_0x385a96,_0x15e40c){if(_0x1c668c){return db[_0xd832('0x5d')][_0xd832('0x4b')]({'where':{'sectionId':_0x1c668c['id']},'raw':!![]})['then'](function(_0x52d728){if(_0x47aa2a[_0xd832('0x7e')]&&_0x47aa2a['field']!=='id'){_0x1c668c[_0xd832('0x80')]=_[_0xd832('0x2f')](_0x52d728,function(_0x24a222){return _0x24a222[_0x47aa2a['field']];});}else{if(_0x224b7b===_0xd832('0x7f')){_0x1c668c['associatedResources']=_[_0xd832('0x2f')](_0x52d728,function(_0xbb4e2c){return{'id':_0xbb4e2c['resourceId'],'type':_0xbb4e2c['type']};});}else{_0x1c668c['associatedResources']=_['map'](_0x52d728,function(_0x4c2c23){return _0x4c2c23[_0xd832('0x6d')];});}}_0x385a96(_0x1c668c);})[_0xd832('0x50')](function(_0xcf0bd3){_0x15e40c(_0xcf0bd3);});}else{_0x385a96(null);}});}function getQueryModels(_0x27a115,_0x3a1427){var _0x3caf09=_0x27a115[_0xd832('0x8c')]();var _0x49eac9={'childModel':undefined,'parentSections':[]};switch(_0x3caf09){case'squareprojects':_0x49eac9[_0xd832('0x77')]=_0xd832('0x8d');break;case _0xd832('0x8e'):_0x49eac9['childModel']=_0xd832('0x8f');break;case _0xd832('0x90'):_0x49eac9[_0xd832('0x77')]=_0xd832('0x91');_0x49eac9[_0xd832('0x79')]=[{'name':_0xd832('0x92'),'field':'name','foreignKey':_0xd832('0x93')}];break;case _0xd832('0x94'):_0x49eac9[_0xd832('0x77')]=_0xd832('0x95');break;case _0xd832('0x96'):_0x49eac9[_0xd832('0x77')]=_0xd832('0x87');_0x49eac9['parentSections']=[{'name':_0xd832('0x97'),'field':'id','foreignKey':_0xd832('0x98')}];break;case _0xd832('0x99'):_0x49eac9['childModel']=_0xd832('0x9a');break;case'companies':_0x49eac9[_0xd832('0x77')]='CmCompany';break;case'globalcustomfields':_0x49eac9['childModel']=_0xd832('0x9b');break;case _0xd832('0x9c'):_0x49eac9[_0xd832('0x77')]='ChatQueue';break;case _0xd832('0x9d'):_0x49eac9[_0xd832('0x77')]=_0xd832('0x9e');break;case _0xd832('0x9f'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xa0');break;case _0xd832('0xa1'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xa2');break;case _0xd832('0xa3'):case'internalroutes':case _0xd832('0xa4'):_0x49eac9['childModel']='VoiceExtension';break;case _0xd832('0xa5'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xa6');break;case _0xd832('0xa7'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xa8');break;case _0xd832('0xa9'):_0x49eac9[_0xd832('0x77')]='VoiceRecording';_0x49eac9['parentSections']=[{'name':_0xd832('0xaa'),'field':'name','foreignKey':_0xd832('0xab'),'model':_0xd832('0xac'),'filter':{'field':'role','value':[_0xd832('0xad')]}},{'name':'Telephones','field':_0xd832('0x2c'),'foreignKey':'membername','model':_0xd832('0xac'),'filter':{'field':_0xd832('0xae'),'value':[_0xd832('0xaf')]}},{'name':_0xd832('0xb0'),'field':_0xd832('0x2c'),'foreignKey':_0xd832('0xb1'),'model':_0xd832('0xb2'),'filter':{'field':_0xd832('0x33'),'value':[_0xd832('0xb3')]}},{'name':_0xd832('0xb4'),'field':'name','foreignKey':_0xd832('0xb1'),'model':_0xd832('0xb2'),'filter':{'field':_0xd832('0x33'),'value':['outbound']}}];break;case _0xd832('0xb5'):_0x49eac9['childModel']='VoiceMusicOnHold';break;case _0xd832('0xb6'):_0x49eac9[_0xd832('0x77')]='VoiceChanSpy';break;case _0xd832('0xb7'):_0x49eac9['childModel']='VoicePrefix';break;case _0xd832('0xb8'):_0x49eac9['childModel']=_0xd832('0xb9');break;case _0xd832('0xba'):_0x49eac9['childModel']=_0xd832('0xbb');break;case _0xd832('0xbc'):_0x49eac9[_0xd832('0x77')]='MailAccount';break;case _0xd832('0xbd'):_0x49eac9[_0xd832('0x77')]='MailSubstatus';break;case _0xd832('0xbe'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xbf');break;case'openchannelaccounts':_0x49eac9[_0xd832('0x77')]=_0xd832('0xc0');break;case _0xd832('0xc1'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xc2');break;case _0xd832('0xc3'):_0x49eac9['childModel']=_0xd832('0xc4');break;case _0xd832('0xc5'):_0x49eac9['childModel']=_0xd832('0xc6');break;case'whatsappaccounts':_0x49eac9['childModel']='WhatsappAccount';break;case'teams':_0x49eac9[_0xd832('0x77')]=_0xd832('0xc7');break;case _0xd832('0xc8'):case _0xd832('0xc9'):_0x49eac9['childModel']=_0xd832('0xb2');if(_0x3a1427){_0x49eac9[_0xd832('0x79')]=[{'name':_0xd832('0xb0')},{'name':_0xd832('0xb4')}];}break;case _0xd832('0xca'):case _0xd832('0xcb'):case _0xd832('0xcc'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xac');if(_0x3a1427){_0x49eac9[_0xd832('0x79')]=[{'name':_0xd832('0xcd'),'filter':{'field':'role','value':[_0xd832('0xce'),_0xd832('0xcf')]},'ignore':!![]},{'name':_0xd832('0xaa')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x49eac9[_0xd832('0x77')]=_0xd832('0xd0');break;case'salesforceaccounts':_0x49eac9['childModel']=_0xd832('0xd1');break;case _0xd832('0xd2'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xd3');break;case'sugarcrmaccounts':_0x49eac9[_0xd832('0x77')]='SugarcrmAccount';break;case _0xd832('0xd4'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xd5');break;case'zohoaccounts':_0x49eac9[_0xd832('0x77')]=_0xd832('0xd6');break;case _0xd832('0xd7'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xac');break;case _0xd832('0xd8'):_0x49eac9[_0xd832('0x77')]='CannedAnswer';break;case'dispositions':_0x49eac9[_0xd832('0x77')]='Disposition';break;case'customdashboards':_0x49eac9[_0xd832('0x77')]='Dashboard';break;case'intervals':_0x49eac9[_0xd832('0x77')]=_0xd832('0xd9');break;case _0xd832('0xda'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xdb');break;case _0xd832('0xdc'):_0x49eac9['childModel']=_0xd832('0xdd');break;case _0xd832('0xde'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xdf');break;case _0xd832('0xe0'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xe1');break;case'templates':_0x49eac9[_0xd832('0x77')]=_0xd832('0xe2');break;case'triggers':_0x49eac9[_0xd832('0x77')]=_0xd832('0xe3');break;case _0xd832('0xe4'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xe5');break;case'variables':_0x49eac9[_0xd832('0x77')]=_0xd832('0xe6');break;case _0xd832('0xe7'):_0x49eac9['childModel']='Plugin';break;case _0xd832('0xe8'):_0x49eac9[_0xd832('0x77')]=_0xd832('0x7f');_0x49eac9[_0xd832('0x79')]=[{'name':_0xd832('0xe9'),'field':'id','foreignKey':'reportId'}];break;case _0xd832('0xea'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xeb');break;case _0xd832('0xec'):_0x49eac9[_0xd832('0x77')]=_0xd832('0xed');break;default:return _0x49eac9;}return _0x49eac9;}
\ No newline at end of file
+var _0xccd0=['voicequeues','queuecampaigns','Users','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','variables','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','then','error','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','clone','get','omit','createdAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','updatedAt','sectionId','userProfileId','Resources','describe','addSections','destroy','ids','enabled','includes','subsections','push','forEach','resourceId','bulkCreate','removeResources','getResources','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','isEmpty','parentSections','findOne','ignore','union','childModel','all','field','foreignKey','associatedResources','AnalyticExtractedReport','reportType','DefaultReports','custom','CustomReports','rows','CmContact','Tag','Tags','color','tag','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams'];(function(_0x88b8bb,_0x471e65){var _0x5b814d=function(_0x39fbb1){while(--_0x39fbb1){_0x88b8bb['push'](_0x88b8bb['shift']());}};_0x5b814d(++_0x471e65);}(_0xccd0,0x114));var _0x0ccd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xccd0[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x0ccd('0x0'));var emlformat=require(_0x0ccd('0x1'));var rimraf=require(_0x0ccd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ccd('0x3'));var rp=require(_0x0ccd('0x4'));var moment=require(_0x0ccd('0x5'));var BPromise=require(_0x0ccd('0x6'));var Mustache=require(_0x0ccd('0x7'));var util=require(_0x0ccd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x0ccd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0ccd('0xa'));var crypto=require('crypto');var jsforce=require(_0x0ccd('0xb'));var deskjs=require(_0x0ccd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0ccd('0xd'));var Papa=require(_0x0ccd('0xe'));var Redis=require(_0x0ccd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ccd('0x10'));var logger=require(_0x0ccd('0x11'))(_0x0ccd('0x12'));var utils=require(_0x0ccd('0x13'));var config=require(_0x0ccd('0x14'));var db=require('../../mysqldb')['db'];config[_0x0ccd('0x15')]=_[_0x0ccd('0x16')](config[_0x0ccd('0x15')],{'host':_0x0ccd('0x17'),'port':0x18eb});var socket=require(_0x0ccd('0x18'))(new Redis(config[_0x0ccd('0x15')]));require(_0x0ccd('0x19'))[_0x0ccd('0x1a')](socket);function respondWithStatusCode(_0x5e9cb7,_0x4be7f5){_0x4be7f5=_0x4be7f5||0xcc;return function(_0x5e4c1d){if(_0x5e4c1d){return _0x5e9cb7[_0x0ccd('0x1b')](_0x4be7f5);}return _0x5e9cb7[_0x0ccd('0x1c')](_0x4be7f5)[_0x0ccd('0x1d')]();};}function respondWithResult(_0x59f341,_0x5d4844){_0x5d4844=_0x5d4844||0xc8;return function(_0x597b4e){if(_0x597b4e){return _0x59f341['status'](_0x5d4844)['json'](_0x597b4e);}};}function respondWithFilteredResult(_0x5b5857,_0x496a19){return function(_0x11c7db){if(_0x11c7db){var _0x372164=_0x11c7db[_0x0ccd('0x1e')],_0x784e68=_0x496a19[_0x0ccd('0x1f')],_0x434b45=_0x496a19['offset']+_0x496a19[_0x0ccd('0x20')],_0x490796;if(_0x434b45>=_0x372164){_0x434b45=_0x372164;_0x490796=0xc8;}else{_0x490796=0xce;}_0x5b5857[_0x0ccd('0x1c')](_0x490796);return _0x5b5857[_0x0ccd('0x21')](_0x0ccd('0x22'),_0x784e68+'-'+_0x434b45+'/'+_0x372164)[_0x0ccd('0x23')](_0x11c7db);}return null;};}function patchUpdates(_0x2ec886){return function(_0x53211f){try{jsonpatch['apply'](_0x53211f,_0x2ec886,!![]);}catch(_0x466a0b){return BPromise['reject'](_0x466a0b);}return _0x53211f[_0x0ccd('0x24')]();};}function saveUpdates(_0x15ac4d,_0x19f2ef){return function(_0x390148){if(_0x390148){return _0x390148[_0x0ccd('0x25')](_0x15ac4d)[_0x0ccd('0x26')](function(_0x18d346){return _0x18d346;});}return null;};}function removeEntity(_0x237e93,_0x33efe1){return function(_0xca250){if(_0xca250){return _0xca250['destroy']()[_0x0ccd('0x26')](function(){_0x237e93['status'](0xcc)[_0x0ccd('0x1d')]();});}};}function handleEntityNotFound(_0x1ec2cb,_0x390f4d){return function(_0x5f213d){if(!_0x5f213d){_0x1ec2cb[_0x0ccd('0x1b')](0x194);}return _0x5f213d;};}function handleError(_0x3fd1d8,_0x534265){_0x534265=_0x534265||0x1f4;return function(_0x362572){logger[_0x0ccd('0x27')](_0x362572['stack']);if(_0x362572[_0x0ccd('0x28')]){delete _0x362572['name'];}_0x3fd1d8[_0x0ccd('0x1c')](_0x534265)[_0x0ccd('0x29')](_0x362572);};}exports[_0x0ccd('0x2a')]=function(_0x508927,_0x44152c){var _0xe2692c={},_0x22e451={},_0x4d8f9a={'count':0x0,'rows':[]};var _0x50fea2=_['map'](db[_0x0ccd('0x2b')][_0x0ccd('0x2c')],function(_0x109da8){return{'name':_0x109da8[_0x0ccd('0x2d')],'type':_0x109da8[_0x0ccd('0x2e')][_0x0ccd('0x2f')]};});_0x22e451[_0x0ccd('0x30')]=_[_0x0ccd('0x31')](_0x50fea2,_0x0ccd('0x28'));_0x22e451['query']=_['keys'](_0x508927['query']);_0x22e451[_0x0ccd('0x32')]=_[_0x0ccd('0x33')](_0x22e451['model'],_0x22e451[_0x0ccd('0x34')]);_0xe2692c[_0x0ccd('0x35')]=_[_0x0ccd('0x33')](_0x22e451[_0x0ccd('0x30')],qs[_0x0ccd('0x36')](_0x508927[_0x0ccd('0x34')][_0x0ccd('0x36')]));_0xe2692c['attributes']=_0xe2692c[_0x0ccd('0x35')][_0x0ccd('0x37')]?_0xe2692c['attributes']:_0x22e451['model'];if(!_0x508927[_0x0ccd('0x34')][_0x0ccd('0x38')](_0x0ccd('0x39'))){_0xe2692c[_0x0ccd('0x20')]=qs[_0x0ccd('0x20')](_0x508927[_0x0ccd('0x34')]['limit']);_0xe2692c[_0x0ccd('0x1f')]=qs[_0x0ccd('0x1f')](_0x508927[_0x0ccd('0x34')][_0x0ccd('0x1f')]);}_0xe2692c[_0x0ccd('0x3a')]=qs[_0x0ccd('0x3b')](_0x508927[_0x0ccd('0x34')]['sort']);_0xe2692c['where']=qs[_0x0ccd('0x32')](_[_0x0ccd('0x3c')](_0x508927[_0x0ccd('0x34')],_0x22e451[_0x0ccd('0x32')]),_0x50fea2);if(_0x508927[_0x0ccd('0x34')][_0x0ccd('0x3d')]){_0xe2692c[_0x0ccd('0x3e')]=_[_0x0ccd('0x3f')](_0xe2692c[_0x0ccd('0x3e')],{'$or':_[_0x0ccd('0x31')](_0x50fea2,function(_0x34e895){if(_0x34e895[_0x0ccd('0x2e')]!==_0x0ccd('0x40')){var _0x453ba6={};_0x453ba6[_0x34e895[_0x0ccd('0x28')]]={'$like':'%'+_0x508927[_0x0ccd('0x34')][_0x0ccd('0x3d')]+'%'};return _0x453ba6;}})});}_0xe2692c=_['merge']({},_0xe2692c,_0x508927[_0x0ccd('0x41')]);var _0x5dbac9={'where':_0xe2692c[_0x0ccd('0x3e')]};return db['UserProfile'][_0x0ccd('0x1e')](_0x5dbac9)[_0x0ccd('0x26')](function(_0x36d2b7){_0x4d8f9a[_0x0ccd('0x1e')]=_0x36d2b7;if(_0x508927[_0x0ccd('0x34')][_0x0ccd('0x42')]){_0xe2692c[_0x0ccd('0x43')]=[{'all':!![]}];}return db[_0x0ccd('0x2b')][_0x0ccd('0x44')](_0xe2692c);})[_0x0ccd('0x26')](function(_0x3b3015){_0x4d8f9a['rows']=_0x3b3015;return _0x4d8f9a;})['then'](respondWithFilteredResult(_0x44152c,_0xe2692c))[_0x0ccd('0x45')](handleError(_0x44152c,null));};exports[_0x0ccd('0x46')]=function(_0x2fca8d,_0x4098f8){var _0x9342b9={'raw':![],'where':{'id':_0x2fca8d[_0x0ccd('0x47')]['id']}},_0x3e0e63={};_0x3e0e63[_0x0ccd('0x30')]=_[_0x0ccd('0x48')](db[_0x0ccd('0x2b')][_0x0ccd('0x2c')]);_0x3e0e63[_0x0ccd('0x34')]=_[_0x0ccd('0x48')](_0x2fca8d[_0x0ccd('0x34')]);_0x3e0e63[_0x0ccd('0x32')]=_[_0x0ccd('0x33')](_0x3e0e63[_0x0ccd('0x30')],_0x3e0e63[_0x0ccd('0x34')]);_0x9342b9[_0x0ccd('0x35')]=_['intersection'](_0x3e0e63['model'],qs['fields'](_0x2fca8d['query'][_0x0ccd('0x36')]));_0x9342b9['attributes']=_0x9342b9[_0x0ccd('0x35')][_0x0ccd('0x37')]?_0x9342b9[_0x0ccd('0x35')]:_0x3e0e63[_0x0ccd('0x30')];if(_0x2fca8d['query']['includeAll']){_0x9342b9['include']=[{'all':!![]}];}_0x9342b9=_[_0x0ccd('0x3f')]({},_0x9342b9,_0x2fca8d[_0x0ccd('0x41')]);return db[_0x0ccd('0x2b')][_0x0ccd('0x49')](_0x9342b9)['then'](handleEntityNotFound(_0x4098f8,null))[_0x0ccd('0x26')](respondWithResult(_0x4098f8,null))[_0x0ccd('0x45')](handleError(_0x4098f8,null));};exports['create']=function(_0x30def2,_0x218c78){return db['UserProfile'][_0x0ccd('0x4a')](_0x30def2[_0x0ccd('0x4b')],{})[_0x0ccd('0x26')](respondWithResult(_0x218c78,0xc9))[_0x0ccd('0x45')](handleError(_0x218c78,null));};exports[_0x0ccd('0x4c')]=function(_0xdb3c6d,_0x1ed9ba){var _0x15a61c={'where':{'id':_0xdb3c6d[_0x0ccd('0x47')]['id']}},_0x6002e={};_0x6002e[_0x0ccd('0x30')]=_[_0x0ccd('0x48')](db[_0x0ccd('0x2b')][_0x0ccd('0x2c')]);_0x15a61c[_0x0ccd('0x35')]=_[_0x0ccd('0x33')](_0x6002e[_0x0ccd('0x30')],qs[_0x0ccd('0x36')](_0xdb3c6d[_0x0ccd('0x34')][_0x0ccd('0x36')]));_0x15a61c['attributes']=_0x15a61c[_0x0ccd('0x35')][_0x0ccd('0x37')]?_0x15a61c['attributes']:_0x6002e[_0x0ccd('0x30')];if(_0xdb3c6d['query'][_0x0ccd('0x42')]){_0x15a61c[_0x0ccd('0x43')]=[{'all':!![]}];}_0x15a61c=_[_0x0ccd('0x3f')]({},_0x15a61c,_0xdb3c6d['options']);return db[_0x0ccd('0x2b')][_0x0ccd('0x49')](_0x15a61c)[_0x0ccd('0x26')](handleEntityNotFound(_0x1ed9ba,null))[_0x0ccd('0x26')](function(_0x2f9272){if(_0x2f9272){var _0x3153cd=_0x2f9272[_0x0ccd('0x4d')]({'plain':!![]});_0x3153cd=qs[_0x0ccd('0x4e')](_0x3153cd,['id',_0x0ccd('0x4f'),'updatedAt',_0x0ccd('0x50')]);_0xdb3c6d['body']=_[_0x0ccd('0x4e')](_0xdb3c6d[_0x0ccd('0x4b')],['id',_0x0ccd('0x4f'),'updatedAt']);return db[_0x0ccd('0x51')][_0x0ccd('0x52')](function(_0x18fc91){return db[_0x0ccd('0x2b')]['create'](_[_0x0ccd('0x3f')](_0x3153cd,_0xdb3c6d[_0x0ccd('0x4b')]),{'include':_0xdb3c6d[_0x0ccd('0x34')][_0x0ccd('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x18fc91})[_0x0ccd('0x26')](function(_0x340c10){var _0x496653=_0x340c10[_0x0ccd('0x4d')]({'plain':!![]});return db[_0x0ccd('0x53')][_0x0ccd('0x44')]({'where':{'userProfileId':_0xdb3c6d[_0x0ccd('0x47')]['id']},'raw':!![]})[_0x0ccd('0x26')](function(_0x336af5){if(_0x336af5){return BPromise[_0x0ccd('0x54')](_0x336af5,function(_0x445056){return new BPromise(function(_0xff21bb,_0x57e5f3){if(_0x445056[_0x0ccd('0x55')]===null||_0x445056['autoAssociation']===0x1)_0xff21bb(null);return db[_0x0ccd('0x56')][_0x0ccd('0x44')]({'where':{'sectionId':_0x445056['id']},'raw':!![]})[_0x0ccd('0x26')](function(_0x504541){var _0x477284=_['map'](_0x504541,function(_0x217ed4){return qs[_0x0ccd('0x4e')](_0x217ed4,['id',_0x0ccd('0x4f'),_0x0ccd('0x57'),_0x0ccd('0x58')]);});_0xff21bb(_0x477284);})[_0x0ccd('0x45')](function(_0x3e41c2){_0x57e5f3(_0x3e41c2);});})[_0x0ccd('0x26')](function(_0xed8b51){var _0xeaa8d6=qs[_0x0ccd('0x4e')](_0x445056,['id',_0x0ccd('0x4f'),_0x0ccd('0x57')]);_0xeaa8d6[_0x0ccd('0x59')]=_0x496653['id'];if(_0xed8b51)_0xeaa8d6[_0x0ccd('0x5a')]=_0xed8b51;return _0xeaa8d6;})['then'](function(_0x22398b){return db[_0x0ccd('0x53')][_0x0ccd('0x4a')](_0x22398b,{'include':[{'model':db[_0x0ccd('0x56')],'as':_0x0ccd('0x5a')}],'raw':!![],'transaction':_0x18fc91});});})[_0x0ccd('0x26')](function(){return _0x496653;});}});});});}})[_0x0ccd('0x26')](respondWithResult(_0x1ed9ba,0xc9))[_0x0ccd('0x45')](handleError(_0x1ed9ba,null));};exports['update']=function(_0x2d232a,_0x1bd093){if(_0x2d232a[_0x0ccd('0x4b')]['id']){delete _0x2d232a[_0x0ccd('0x4b')]['id'];}return db['UserProfile'][_0x0ccd('0x49')]({'where':{'id':_0x2d232a[_0x0ccd('0x47')]['id']}})['then'](handleEntityNotFound(_0x1bd093,null))[_0x0ccd('0x26')](saveUpdates(_0x2d232a['body'],null))[_0x0ccd('0x26')](respondWithResult(_0x1bd093,null))[_0x0ccd('0x45')](handleError(_0x1bd093,null));};exports['destroy']=function(_0xf1b24a,_0x42c05f){return db[_0x0ccd('0x2b')][_0x0ccd('0x49')]({'where':{'id':_0xf1b24a['params']['id']}})['then'](handleEntityNotFound(_0x42c05f,null))['then'](removeEntity(_0x42c05f,null))[_0x0ccd('0x45')](handleError(_0x42c05f,null));};exports[_0x0ccd('0x5b')]=function(_0x11e3f9,_0x7302dd){return db[_0x0ccd('0x2b')]['describe']()[_0x0ccd('0x26')](respondWithResult(_0x7302dd,null))[_0x0ccd('0x45')](handleError(_0x7302dd,null));};exports[_0x0ccd('0x5c')]=function(_0x25147b,_0x3bd5c0){var _0x3f8e24=_0x25147b[_0x0ccd('0x4b')];return db[_0x0ccd('0x2b')][_0x0ccd('0x49')]({'where':{'id':_0x25147b['params']['id']}})[_0x0ccd('0x26')](handleEntityNotFound(_0x3bd5c0,null))[_0x0ccd('0x26')](function(_0x7004b9){if(_0x7004b9){return db['sequelize']['transaction'](function(_0x3b21f1){return db[_0x0ccd('0x53')][_0x0ccd('0x5d')]({'where':{'userProfileId':_0x25147b[_0x0ccd('0x47')]['id'],'sectionId':_[_0x0ccd('0x31')](_0x3f8e24,function(_0x34072c){return _0x34072c['sectionId'];})},'transaction':_0x3b21f1})[_0x0ccd('0x26')](function(){var _0x2bb016=_['map'](_0x3f8e24,function(_0x2c303b){_0x2c303b['userProfileId']=_0x25147b[_0x0ccd('0x47')]['id'];return _0x2c303b;});var _0x10308=[];return BPromise['each'](_0x2bb016,function(_0x1e5f7c){return db[_0x0ccd('0x53')][_0x0ccd('0x4a')](_0x1e5f7c,{'include':[{'model':db[_0x0ccd('0x56')],'as':_0x0ccd('0x5a')}],'raw':!![],'transaction':_0x3b21f1})[_0x0ccd('0x26')](function(_0x3d88b0){_0x10308['push'](_0x3d88b0[_0x0ccd('0x4d')]({'plain':!![]}));});})[_0x0ccd('0x26')](function(){return _0x10308;});});});}})[_0x0ccd('0x26')](function(_0x52e569){return _0x52e569;})['then'](respondWithResult(_0x3bd5c0,null))[_0x0ccd('0x45')](handleError(_0x3bd5c0,null));};exports['removeSections']=function(_0x3a6383,_0x1c86fd){var _0x47fc0;return db[_0x0ccd('0x2b')][_0x0ccd('0x49')]({'where':{'id':_0x3a6383[_0x0ccd('0x47')]['id']},'attributes':['id',_0x0ccd('0x28')]})[_0x0ccd('0x26')](handleEntityNotFound(_0x1c86fd,null))[_0x0ccd('0x26')](function(_0x55c52a){if(_0x55c52a){_0x47fc0=_0x55c52a;return db[_0x0ccd('0x53')][_0x0ccd('0x5d')]({'where':{'userProfileId':_0x3a6383[_0x0ccd('0x47')]['id'],'sectionId':_0x3a6383[_0x0ccd('0x34')][_0x0ccd('0x5e')]}});}})[_0x0ccd('0x26')](function(){return _0x47fc0;})[_0x0ccd('0x26')](respondWithStatusCode(_0x1c86fd,null))[_0x0ccd('0x45')](handleError(_0x1c86fd,null));};exports['getSections']=function(_0x3d4f91,_0x455c5b){var _0x447143=[];var _0x49510d=[];return db['UserProfileSection'][_0x0ccd('0x44')]({'where':{'userProfileId':_0x3d4f91[_0x0ccd('0x47')]['id']},'raw':!![]})[_0x0ccd('0x26')](function(_0x4aa1b1){_0x447143=_['filter'](_0x4aa1b1,function(_0x2d21ee){return _0x2d21ee[_0x0ccd('0x5f')]===0x1||_[_0x0ccd('0x60')]([0x3eb,0x709],_0x2d21ee[_0x0ccd('0x58')]);});if(!_['isEmpty'](_0x447143)){return _['map'](_0x447143,function(_0x57f641){return _0x57f641['sectionId'];});}else{return;}})[_0x0ccd('0x26')](function(_0xc59907){if(_0xc59907)_0x49510d=_0xc59907;if(_[_0x0ccd('0x60')](_0x49510d,0x64)){var _0x25c195=_[_0x0ccd('0x49')](_0x447143,{'sectionId':0x64});return hasDefaultDashboard(_0x25c195)[_0x0ccd('0x26')](function(_0x3326ec){return _[_0x0ccd('0x31')](_0x447143,function(_0x165e59){if(_0x165e59[_0x0ccd('0x58')]===0x64){_0x165e59[_0x0ccd('0x61')]=_0x3326ec;}return _0x165e59;});});}else{return;}})[_0x0ccd('0x26')](function(_0x3fe868){if(_0x3fe868)_0x447143=_0x3fe868;if(_['includes'](_0x49510d,0x3eb)){var _0x24a8d7=_[_0x0ccd('0x49')](_0x447143,{'sectionId':0x3eb});return getCustomDashboards(_0x24a8d7)[_0x0ccd('0x26')](function(_0x5c7a53){return _[_0x0ccd('0x31')](_0x447143,function(_0x437307){if(_0x24a8d7[_0x0ccd('0x5f')]){if(_0x437307[_0x0ccd('0x58')]===0x3eb){_0x437307[_0x0ccd('0x61')]=_0x5c7a53;}}else{if(_0x437307[_0x0ccd('0x58')]===0x64){_0x437307[_0x0ccd('0x61')]=_0x5c7a53;}}return _0x437307;});});}else{return;}})[_0x0ccd('0x26')](function(_0x3c9196){if(_0x3c9196)_0x447143=_0x3c9196;if(_['includes'](_0x49510d,0x709)){var _0x1f2928=_[_0x0ccd('0x49')](_0x447143,{'sectionId':0x709});return getPlugins(_0x1f2928)[_0x0ccd('0x26')](function(_0x3762b6){if(_0x1f2928[_0x0ccd('0x5f')]){return _['map'](_0x447143,function(_0x166caa){if(_0x166caa[_0x0ccd('0x58')]===0x709){_0x166caa['subsections']=_0x3762b6;}return _0x166caa;});}else{var _0x42c4ac={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3762b6};var _0x20bfe8=_[_0x0ccd('0x31')](_0x447143);_0x20bfe8[_0x0ccd('0x62')](_0x42c4ac);return _0x20bfe8;}});}else{return;}})[_0x0ccd('0x26')](function(_0x224681){if(_0x224681)_0x447143=_0x224681;return _[_0x0ccd('0x3d')](_0x447143,[_0x0ccd('0x5f'),0x1]);})['then'](respondWithResult(_0x455c5b,null))[_0x0ccd('0x45')](handleError(_0x455c5b,null));};function hasDefaultDashboard(_0x5c45c2){var _0x1fe635=[0x65];return new BPromise(function(_0x28f74c,_0x170ad7){try{if(_0x5c45c2[_0x0ccd('0x55')]){_0x28f74c(_0x1fe635);}else{return db[_0x0ccd('0x56')]['findOne']({'where':{'sectionId':_0x5c45c2['id']},'raw':!![]})[_0x0ccd('0x26')](function(_0x1288e3){_0x1288e3?_0x28f74c(_0x1fe635):_0x28f74c();});}}catch(_0x11e551){_0x170ad7(_0x11e551);}});}function getCustomDashboards(_0x54da11){var _0x5c2746=[];return new BPromise(function(_0x56c9cb,_0x16d6a3){try{if(_0x54da11['autoAssociation']){return db['Dashboard'][_0x0ccd('0x44')]({'raw':!![]})[_0x0ccd('0x26')](function(_0x3e1398){_0x3e1398[_0x0ccd('0x63')](function(_0x22daec){_0x5c2746['push'](_0x22daec['id']+0x1869f);});_0x56c9cb(_0x5c2746);});}else{return db[_0x0ccd('0x56')][_0x0ccd('0x44')]({'where':{'sectionId':_0x54da11['id']},'raw':!![]})['then'](function(_0x251143){_0x251143[_0x0ccd('0x63')](function(_0x568808){_0x5c2746[_0x0ccd('0x62')](_0x568808[_0x0ccd('0x64')]+0x1869f);});_0x56c9cb(_0x5c2746);});}}catch(_0xe34c39){_0x16d6a3(_0xe34c39);}});}function getPlugins(_0x1e1e72){var _0x23b373=[];return new BPromise(function(_0x960d73,_0x43bcec){try{if(_0x1e1e72[_0x0ccd('0x55')]){return db['Plugin'][_0x0ccd('0x44')]({'raw':!![]})['then'](function(_0x2963d4){_0x2963d4[_0x0ccd('0x63')](function(_0x57a784){_0x23b373[_0x0ccd('0x62')](_0x57a784['id']+0x15b38);});_0x960d73(_0x23b373);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1e1e72['id']},'raw':!![]})[_0x0ccd('0x26')](function(_0xad5e76){_0xad5e76['forEach'](function(_0xab2fd0){_0x23b373[_0x0ccd('0x62')](_0xab2fd0[_0x0ccd('0x64')]+0x15b38);});_0x960d73(_0x23b373);});}}catch(_0x35f1d3){_0x43bcec(_0x35f1d3);}});}exports['addResources']=function(_0x234074,_0x5e19be){return db[_0x0ccd('0x2b')][_0x0ccd('0x49')]({'where':{'id':_0x234074[_0x0ccd('0x47')]['id']}})[_0x0ccd('0x26')](handleEntityNotFound(_0x5e19be,null))['then'](function(_0x1aa5e2){if(_0x1aa5e2){return db[_0x0ccd('0x51')][_0x0ccd('0x52')](function(_0x46374a){return db[_0x0ccd('0x53')][_0x0ccd('0x44')]({'where':{'userProfileId':_0x234074[_0x0ccd('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x0ccd('0x26')](function(_0x4a9c63){if(_0x4a9c63){return db['UserProfileSection'][_0x0ccd('0x5d')]({'where':{'userProfileId':_0x234074['params']['id'],'id':_[_0x0ccd('0x31')](_0x4a9c63,function(_0x1eda11){return _0x1eda11['id'];})},'transaction':_0x46374a});}})[_0x0ccd('0x26')](function(_0x3a8170){var _0x289848=_[_0x0ccd('0x31')](_0x234074[_0x0ccd('0x4b')],function(_0x421c0c){_0x421c0c[_0x0ccd('0x59')]=_0x234074[_0x0ccd('0x47')]['id'];return _0x421c0c;});return db[_0x0ccd('0x53')]['bulkCreate'](_0x289848,{'raw':!![],'transaction':_0x46374a});})[_0x0ccd('0x26')](function(_0x34ec39){var _0x580aa0=_[_0x0ccd('0x3d')](_[_0x0ccd('0x31')](_0x34ec39,function(_0x39d30c){return _0x39d30c[_0x0ccd('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x580aa0){return db[_0x0ccd('0x53')]['findAll']({'where':{'userProfileId':_0x234074['params']['id'],'sectionId':_[_0x0ccd('0x31')](_0x580aa0,function(_0x334bda){return _0x334bda['sectionId'];})},'attributes':['id',_0x0ccd('0x58')],'raw':!![]})[_0x0ccd('0x26')](function(_0x3bb9da){var _0x26e51f=_['map'](_0x234074[_0x0ccd('0x4b')],function(_0x2e9dda){_0x2e9dda[_0x0ccd('0x59')]=_0x234074[_0x0ccd('0x47')]['id'];return _0x2e9dda;});return db[_0x0ccd('0x56')][_0x0ccd('0x65')](_0x26e51f,{'raw':!![],'transaction':_0x46374a});});}})[_0x0ccd('0x45')](handleError(_0x5e19be,null));});}})['then'](function(_0x4e52c7){var _0x19fe38=_['map'](_0x4e52c7,function(_0x4a4a75){return _0x4a4a75[_0x0ccd('0x4d')]({'plain':!![]});});})[_0x0ccd('0x26')](respondWithResult(_0x5e19be,null))[_0x0ccd('0x45')](handleError(_0x5e19be,null));};exports[_0x0ccd('0x66')]=function(_0x4c28a8,_0x5c1e5d,_0x2cf2ca){return db[_0x0ccd('0x2b')]['find']({'where':{'id':_0x4c28a8['params']['id']}})[_0x0ccd('0x26')](handleEntityNotFound(_0x5c1e5d,null))['then'](function(_0x31d4da){if(_0x31d4da){return _0x31d4da['removeResources'](_0x4c28a8[_0x0ccd('0x34')][_0x0ccd('0x5e')]);}})[_0x0ccd('0x26')](respondWithStatusCode(_0x5c1e5d,null))[_0x0ccd('0x45')](handleError(_0x5c1e5d,null));};exports[_0x0ccd('0x67')]=function(_0x17b4c1,_0x3b576e){var _0x3122e7={'raw':![],'where':{}};var _0x562c5f={};var _0x53d325={'count':0x0,'rows':[]};var _0x5089c2=_0x17b4c1[_0x0ccd('0x34')]['section'];if(typeof _0x5089c2===_0x0ccd('0x68')){throw new db[(_0x0ccd('0x69'))][(_0x0ccd('0x6a'))](_0x0ccd('0x6b'));}var _0x23b74f=_0x17b4c1['query'][_0x0ccd('0x6c')]||![];var _0x42379b=getQueryModels(_0x5089c2,_0x23b74f);if(typeof _0x42379b['childModel']===_0x0ccd('0x68')){throw new db['Sequelize'][(_0x0ccd('0x6a'))]('Invalid\x20section\x20\x27'+_0x5089c2+'\x27');}var _0x554d78=[];if(!_[_0x0ccd('0x6d')](_0x42379b[_0x0ccd('0x6e')])){_0x554d78=_0x42379b[_0x0ccd('0x6e')];}else{_0x554d78=[{'name':_0x5089c2}];}return db[_0x0ccd('0x2b')][_0x0ccd('0x6f')]({'where':{'id':_0x17b4c1[_0x0ccd('0x47')]['id']}})[_0x0ccd('0x26')](handleEntityNotFound(_0x3b576e,null))[_0x0ccd('0x26')](function(_0x3924c9){if(_0x3924c9){var _0x11f0d8=[];for(var _0x4213d0=0x0;_0x4213d0<_0x554d78[_0x0ccd('0x37')];_0x4213d0++){_0x11f0d8[_0x0ccd('0x62')](db[_0x0ccd('0x53')][_0x0ccd('0x6f')]({'where':{'userProfileId':_0x3924c9['id'],'name':_0x554d78[_0x4213d0][_0x0ccd('0x28')]},'raw':!![]}));}return BPromise['all'](_0x11f0d8);}})[_0x0ccd('0x26')](function(_0x315c1f){var _0x295472=_[_0x0ccd('0x3d')](_0x315c1f,function(_0x2f84be){return _0x2f84be?_0x2f84be:undefined;});var _0x3c56b7=_[_0x0ccd('0x3d')](_0x554d78,[_0x0ccd('0x70'),!![]]);var _0x4d92d7=_['isEmpty'](_0x295472)&&_[_0x0ccd('0x6d')](_0x3c56b7)?null:_[_0x0ccd('0x71')](_0x3c56b7,_0x295472);if(_0x4d92d7){var _0x4e2315=[];for(var _0x38b2be=0x0;_0x38b2be<_0x4d92d7[_0x0ccd('0x37')];_0x38b2be++){var _0x4ed197=_[_0x0ccd('0x49')](_0x554d78,function(_0x4c1ec7){return _0x4d92d7[_0x38b2be]?_0x4c1ec7[_0x0ccd('0x28')]===_0x4d92d7[_0x38b2be]['name']:null;});if(_0x4ed197){if(_0x4d92d7[_0x38b2be][_0x0ccd('0x70')]){_0x4e2315['push'](getAllResources(_0x42379b[_0x0ccd('0x72')],_0x4d92d7[_0x38b2be]));}else{if(!_0x4d92d7[_0x38b2be]['autoAssociation']){_0x4e2315['push'](getAllowedResources(_0x4ed197,_0x4d92d7[_0x38b2be],_0x42379b[_0x0ccd('0x72')]));}else{if(_0x4ed197[_0x0ccd('0x30')]){_0x4e2315[_0x0ccd('0x62')](getAllFilteredResources(_0x4ed197,_0x4d92d7[_0x38b2be]));}}}}}return BPromise[_0x0ccd('0x73')](_0x4e2315);}else{return null;}})[_0x0ccd('0x26')](function(_0x262487){var _0x2ab3ca=_0x262487;var _0x6d15cd=null;if(_0x2ab3ca){_0x6d15cd=_0x2ab3ca[_0x0ccd('0x37')]===0x1?_0x2ab3ca[0x0]:null;}if(_0x6d15cd||_0x2ab3ca){var _0x93518c=db[_0x42379b[_0x0ccd('0x72')]]['rawAttributes'];_0x562c5f['model']=_['keys'](_0x93518c);_0x562c5f['query']=_['keys'](_0x17b4c1['query']);_0x562c5f[_0x0ccd('0x32')]=_[_0x0ccd('0x33')](_0x562c5f[_0x0ccd('0x30')],_0x562c5f[_0x0ccd('0x34')]);_0x3122e7['attributes']=_[_0x0ccd('0x33')](_0x562c5f[_0x0ccd('0x30')],qs['fields'](_0x17b4c1[_0x0ccd('0x34')]['fields']));_0x3122e7['attributes']=_0x3122e7['attributes']['length']?_0x3122e7[_0x0ccd('0x35')]:_0x562c5f[_0x0ccd('0x30')];if(!_0x17b4c1[_0x0ccd('0x34')][_0x0ccd('0x38')](_0x0ccd('0x39'))){_0x3122e7[_0x0ccd('0x20')]=qs[_0x0ccd('0x20')](_0x17b4c1['query'][_0x0ccd('0x20')]);_0x3122e7[_0x0ccd('0x1f')]=qs[_0x0ccd('0x1f')](_0x17b4c1[_0x0ccd('0x34')][_0x0ccd('0x1f')]);}_0x3122e7[_0x0ccd('0x3a')]=qs[_0x0ccd('0x3b')](_0x17b4c1[_0x0ccd('0x34')][_0x0ccd('0x3b')]);_0x3122e7[_0x0ccd('0x3e')]=qs[_0x0ccd('0x32')](_[_0x0ccd('0x3c')](_0x17b4c1['query'],_0x562c5f['filters']));if(_0x17b4c1['query'][_0x0ccd('0x3d')]){_0x3122e7[_0x0ccd('0x3e')]=_[_0x0ccd('0x3f')](_0x3122e7[_0x0ccd('0x3e')],{'$or':_[_0x0ccd('0x31')](_0x93518c,function(_0x163276){if(_0x163276[_0x0ccd('0x2e')][_0x0ccd('0x2f')]!==_0x0ccd('0x40')){var _0x241ebc={};_0x241ebc[_0x163276[_0x0ccd('0x74')]]={'$like':'%'+_0x17b4c1[_0x0ccd('0x34')][_0x0ccd('0x3d')]+'%'};return _0x241ebc;}})});}var _0x1ed3db=[];if(_0x6d15cd){var _0x6ba2d8=_[_0x0ccd('0x49')](_0x554d78,[_0x0ccd('0x28'),_0x6d15cd[_0x0ccd('0x28')]]);if(_0x6ba2d8[_0x0ccd('0x74')]){var _0x4080d8={};if(_0x42379b['childModel']==='AnalyticExtractedReport'){_0x4080d8[_0x6ba2d8[_0x0ccd('0x75')]]=_[_0x0ccd('0x31')](_0x6d15cd[_0x0ccd('0x76')],'id');}else{_0x4080d8[_0x6ba2d8['foreignKey']]=_0x6d15cd[_0x0ccd('0x76')];}_0x1ed3db['push'](_0x4080d8);}else{_0x3122e7[_0x0ccd('0x3e')]['id']=_0x6d15cd[_0x0ccd('0x76')];}}else{for(var _0x3cb628=0x0;_0x3cb628<_0x2ab3ca[_0x0ccd('0x37')];_0x3cb628++){var _0x6ba2d8=_[_0x0ccd('0x49')](_0x554d78,['name',_0x2ab3ca[_0x3cb628]['name']]);if(_0x6ba2d8[_0x0ccd('0x74')]){var _0x4080d8={};_0x4080d8[_0x6ba2d8[_0x0ccd('0x75')]]=_0x2ab3ca[_0x3cb628][_0x0ccd('0x76')];_0x1ed3db[_0x0ccd('0x62')](_0x4080d8);}else{if(!_0x3122e7['where']['id'])_0x3122e7[_0x0ccd('0x3e')]['id']=[];_0x2ab3ca[_0x3cb628][_0x0ccd('0x76')][_0x0ccd('0x63')](function(_0x2d0599){_0x3122e7['where']['id'][_0x0ccd('0x62')](_0x2d0599);});}}}if(!_[_0x0ccd('0x6d')](_0x1ed3db)){_0x3122e7[_0x0ccd('0x3e')]=_[_0x0ccd('0x3f')](_0x3122e7[_0x0ccd('0x3e')],{'$and':{'$or':_0x1ed3db}});}_0x3122e7=_['merge']({},_0x3122e7,_0x17b4c1[_0x0ccd('0x41')]);if(_0x6d15cd&&!_0x6d15cd[_0x0ccd('0x55')]&&_0x42379b[_0x0ccd('0x72')]===_0x0ccd('0x77')){if(_0x17b4c1[_0x0ccd('0x34')][_0x0ccd('0x42')]){_0x3122e7[_0x0ccd('0x43')]=[{'all':!![]}];}return db[_0x42379b[_0x0ccd('0x72')]][_0x0ccd('0x44')](_0x3122e7)[_0x0ccd('0x26')](function(_0x3116b5){var _0x146380=[];_0x3116b5[_0x0ccd('0x63')](function(_0x226716){var _0x30766d;switch(_0x226716[_0x0ccd('0x78')]){case'default':_0x30766d=_[_0x0ccd('0x49')](_0x6d15cd[_0x0ccd('0x76')],function(_0x206cd8){return _0x206cd8['id']===_0x226716['reportId']&&_0x206cd8[_0x0ccd('0x2e')]===_0x0ccd('0x79');});break;case _0x0ccd('0x7a'):_0x30766d=_[_0x0ccd('0x49')](_0x6d15cd['associatedResources'],function(_0x30158d){return _0x30158d['id']===_0x226716['reportId']&&_0x30158d[_0x0ccd('0x2e')]===_0x0ccd('0x7b');});break;}if(_0x30766d)_0x146380['push'](_0x226716);});_0x53d325[_0x0ccd('0x1e')]=_0x146380[_0x0ccd('0x37')];_0x53d325[_0x0ccd('0x7c')]=_0x146380;return _0x53d325;});}else{return db[_0x42379b[_0x0ccd('0x72')]][_0x0ccd('0x1e')]({'where':_0x3122e7['where']})[_0x0ccd('0x26')](function(_0x1ab262){_0x53d325[_0x0ccd('0x1e')]=_0x1ab262;if(_0x17b4c1[_0x0ccd('0x34')]['includeAll']){if(_0x42379b[_0x0ccd('0x72')]===_0x0ccd('0x7d')){_0x3122e7[_0x0ccd('0x43')]=[{'model':db[_0x0ccd('0x7e')],'as':_0x0ccd('0x7f'),'attributes':['id',_0x0ccd('0x28'),_0x0ccd('0x80')],'required':_0x17b4c1[_0x0ccd('0x34')][_0x0ccd('0x81')]?!![]:![]},{'model':db[_0x0ccd('0x7e')],'as':'ThroughTags','attributes':['id',_0x0ccd('0x28'),_0x0ccd('0x80')],'through':_0x17b4c1[_0x0ccd('0x34')][_0x0ccd('0x81')]?{'attributes':[],'where':{'TagId':_0x17b4c1[_0x0ccd('0x34')][_0x0ccd('0x81')]||undefined}}:{},'required':_0x17b4c1[_0x0ccd('0x34')]['tag']?!![]:![]}];}else{_0x3122e7[_0x0ccd('0x43')]=[{'all':!![]}];}}return db[_0x42379b[_0x0ccd('0x72')]][_0x0ccd('0x44')](_0x3122e7);})[_0x0ccd('0x26')](function(_0x2d10f8){_0x53d325[_0x0ccd('0x7c')]=_0x2d10f8;return _0x53d325;});}}else{return _0x53d325;}})[_0x0ccd('0x26')](respondWithFilteredResult(_0x3b576e,_0x3122e7))[_0x0ccd('0x45')](handleError(_0x3b576e,null));};function getAllResources(_0xd1fff9,_0x2c9c51){return new BPromise(function(_0x14c654,_0x2f86e8){if(_0x2c9c51){var _0x43cd4b=_0x2c9c51[_0x0ccd('0x3d')]?{[_0x2c9c51[_0x0ccd('0x3d')][_0x0ccd('0x74')]]:_0x2c9c51[_0x0ccd('0x3d')]['value']}:undefined;return db[_0xd1fff9][_0x0ccd('0x44')]({'where':_0x43cd4b,'raw':!![]})[_0x0ccd('0x26')](function(_0x5a49b5){_0x2c9c51[_0x0ccd('0x76')]=_['map'](_0x5a49b5,'id');_0x14c654(_0x2c9c51);})[_0x0ccd('0x45')](function(_0x5aeae4){_0x2f86e8(_0x5aeae4);});}else{_0x14c654(null);}});}function getAllFilteredResources(_0x226bde,_0x3f9839){return new BPromise(function(_0x212694,_0x43caf7){var _0x93a656=_0x226bde['filter']?{[_0x226bde[_0x0ccd('0x3d')][_0x0ccd('0x74')]]:_0x226bde[_0x0ccd('0x3d')]['value']}:undefined;return db[_0x226bde[_0x0ccd('0x30')]][_0x0ccd('0x44')]({'where':_0x93a656,'raw':!![]})[_0x0ccd('0x26')](function(_0x27fd03){_0x3f9839[_0x0ccd('0x76')]=_[_0x0ccd('0x31')](_0x27fd03,function(_0x6741b1){return _0x6741b1[_0x0ccd('0x28')];});_0x212694(_0x3f9839);})[_0x0ccd('0x45')](function(_0x292b3b){_0x43caf7(_0x292b3b);});});}function getAllowedResources(_0x2580b8,_0x1c705c,_0x3bae7f){return new BPromise(function(_0x40edf4,_0x2aca08){if(_0x1c705c){return db[_0x0ccd('0x56')][_0x0ccd('0x44')]({'where':{'sectionId':_0x1c705c['id']},'raw':!![]})[_0x0ccd('0x26')](function(_0x4579d8){if(_0x2580b8['field']&&_0x2580b8[_0x0ccd('0x74')]!=='id'){_0x1c705c[_0x0ccd('0x76')]=_[_0x0ccd('0x31')](_0x4579d8,function(_0x48f938){return _0x48f938[_0x2580b8[_0x0ccd('0x74')]];});}else{if(_0x3bae7f===_0x0ccd('0x77')){_0x1c705c[_0x0ccd('0x76')]=_[_0x0ccd('0x31')](_0x4579d8,function(_0x361730){return{'id':_0x361730[_0x0ccd('0x64')],'type':_0x361730[_0x0ccd('0x2e')]};});}else{_0x1c705c[_0x0ccd('0x76')]=_['map'](_0x4579d8,function(_0x2541f6){return _0x2541f6[_0x0ccd('0x64')];});}}_0x40edf4(_0x1c705c);})[_0x0ccd('0x45')](function(_0x51f00f){_0x2aca08(_0x51f00f);});}else{_0x40edf4(null);}});}function getQueryModels(_0x4d572b,_0x1b6f91){var _0x1db831=_0x4d572b[_0x0ccd('0x82')]();var _0x553cdf={'childModel':undefined,'parentSections':[]};switch(_0x1db831){case _0x0ccd('0x83'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x84');break;case _0x0ccd('0x85'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x86');break;case _0x0ccd('0x87'):_0x553cdf['childModel']=_0x0ccd('0x88');_0x553cdf['parentSections']=[{'name':_0x0ccd('0x89'),'field':_0x0ccd('0x28'),'foreignKey':_0x0ccd('0x8a')}];break;case _0x0ccd('0x8b'):_0x553cdf[_0x0ccd('0x72')]='JscriptyProject';break;case _0x0ccd('0x8c'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x7d');_0x553cdf[_0x0ccd('0x6e')]=[{'name':_0x0ccd('0x8d'),'field':'id','foreignKey':_0x0ccd('0x8e')}];break;case'lists':_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x8f');break;case _0x0ccd('0x90'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x91');break;case _0x0ccd('0x92'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x93');break;case'chatqueues':_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x94');break;case _0x0ccd('0x95'):_0x553cdf[_0x0ccd('0x72')]='ChatWebsite';break;case _0x0ccd('0x96'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x97');break;case _0x0ccd('0x98'):_0x553cdf['childModel']=_0x0ccd('0x99');break;case _0x0ccd('0x9a'):case _0x0ccd('0x9b'):case _0x0ccd('0x9c'):_0x553cdf['childModel']=_0x0ccd('0x9d');break;case _0x0ccd('0x9e'):_0x553cdf[_0x0ccd('0x72')]='VoiceContext';break;case'voicemails':_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x9f');break;case _0x0ccd('0xa0'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xa1');_0x553cdf[_0x0ccd('0x6e')]=[{'name':_0x0ccd('0xa2'),'field':'name','foreignKey':'membername','model':_0x0ccd('0xa3'),'filter':{'field':_0x0ccd('0xa4'),'value':[_0x0ccd('0xa5')]}},{'name':_0x0ccd('0xa6'),'field':_0x0ccd('0x28'),'foreignKey':_0x0ccd('0xa7'),'model':_0x0ccd('0xa3'),'filter':{'field':_0x0ccd('0xa4'),'value':[_0x0ccd('0xa8')]}},{'name':_0x0ccd('0xa9'),'field':'name','foreignKey':_0x0ccd('0xaa'),'model':_0x0ccd('0xab'),'filter':{'field':_0x0ccd('0x2e'),'value':[_0x0ccd('0xac')]}},{'name':_0x0ccd('0xad'),'field':'name','foreignKey':_0x0ccd('0xaa'),'model':_0x0ccd('0xab'),'filter':{'field':_0x0ccd('0x2e'),'value':[_0x0ccd('0xae')]}}];break;case _0x0ccd('0xaf'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xb0');break;case _0x0ccd('0xb1'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xb2');break;case'voiceprefixes':_0x553cdf[_0x0ccd('0x72')]='VoicePrefix';break;case _0x0ccd('0xb3'):_0x553cdf['childModel']=_0x0ccd('0xb4');break;case _0x0ccd('0xb5'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xb6');break;case'mailaccounts':_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xb7');break;case _0x0ccd('0xb8'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xb9');break;case _0x0ccd('0xba'):_0x553cdf[_0x0ccd('0x72')]='OpenchannelQueue';break;case _0x0ccd('0xbb'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xbc');break;case _0x0ccd('0xbd'):_0x553cdf['childModel']=_0x0ccd('0xbe');break;case _0x0ccd('0xbf'):_0x553cdf[_0x0ccd('0x72')]='SmsAccount';break;case'whatsappqueues':_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xc0');break;case _0x0ccd('0xc1'):_0x553cdf['childModel']=_0x0ccd('0xc2');break;case _0x0ccd('0xc3'):_0x553cdf['childModel']='Team';break;case _0x0ccd('0xc4'):case _0x0ccd('0xc5'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xab');if(_0x1b6f91){_0x553cdf[_0x0ccd('0x6e')]=[{'name':_0x0ccd('0xa9')},{'name':_0x0ccd('0xad')}];}break;case'users':case'agents':case'telephones':_0x553cdf[_0x0ccd('0x72')]='User';if(_0x1b6f91){_0x553cdf[_0x0ccd('0x6e')]=[{'name':_0x0ccd('0xc6'),'filter':{'field':'role','value':['admin',_0x0ccd('0xc7')]},'ignore':!![]},{'name':_0x0ccd('0xa2')},{'name':'Telephones'}];}break;case _0x0ccd('0xc8'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xc9');break;case _0x0ccd('0xca'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xcb');break;case _0x0ccd('0xcc'):_0x553cdf['childModel']=_0x0ccd('0xcd');break;case _0x0ccd('0xce'):_0x553cdf['childModel']='SugarcrmAccount';break;case _0x0ccd('0xcf'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xd0');break;case _0x0ccd('0xd1'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xd2');break;case _0x0ccd('0xd3'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xa3');break;case _0x0ccd('0xd4'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xd5');break;case _0x0ccd('0xd6'):_0x553cdf['childModel']=_0x0ccd('0xd7');break;case'customdashboards':_0x553cdf['childModel']=_0x0ccd('0xd8');break;case'intervals':_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xd9');break;case _0x0ccd('0xda'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xdb');break;case _0x0ccd('0xdc'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xdd');break;case _0x0ccd('0xde'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xdf');break;case _0x0ccd('0xe0'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0x7e');break;case _0x0ccd('0xe1'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xe2');break;case _0x0ccd('0xe3'):_0x553cdf[_0x0ccd('0x72')]='Trigger';break;case'trunks':_0x553cdf[_0x0ccd('0x72')]='Trunk';break;case _0x0ccd('0xe4'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xe5');break;case _0x0ccd('0xe6'):_0x553cdf['childModel']=_0x0ccd('0xe7');break;case _0x0ccd('0xe8'):_0x553cdf[_0x0ccd('0x72')]='AnalyticExtractedReport';_0x553cdf[_0x0ccd('0x6e')]=[{'name':'Reports','field':'id','foreignKey':_0x0ccd('0xe9')}];break;case _0x0ccd('0xea'):_0x553cdf[_0x0ccd('0x72')]=_0x0ccd('0xeb');break;case _0x0ccd('0xc1'):_0x553cdf['childModel']=_0x0ccd('0xc2');break;default:return _0x553cdf;}return _0x553cdf;}
\ No newline at end of file
index d9189fe..ca715b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6da7=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6da7,0xb9));var _0x76da=function(_0x3ac1b3,_0x559f50){_0x3ac1b3=_0x3ac1b3-0x0;var _0x233d14=_0x6da7[_0x3ac1b3];return _0x233d14;};'use strict';var EventEmitter=require(_0x76da('0x0'));var UserProfile=require(_0x76da('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x76da('0x2')](0x0);var events={'afterCreate':_0x76da('0x3'),'afterUpdate':_0x76da('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1e04a2){return function(_0x3d730e,_0x4262f6,_0x22aa02){UserProfileEvents['emit'](_0x1e04a2+':'+_0x3d730e['id'],_0x3d730e);UserProfileEvents[_0x76da('0x5')](_0x1e04a2,_0x3d730e);_0x22aa02(null);};}for(var e in events){if(events[_0x76da('0x6')](e)){var event=events[e];UserProfile[_0x76da('0x7')](e,emitEvent(event));}}module[_0x76da('0x8')]=UserProfileEvents;
\ No newline at end of file
+var _0x2cb1=['update','remove','emit','hook','events','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x2cb1,0x148));var _0x12cb=function(_0x71e33,_0x525f63){_0x71e33=_0x71e33-0x0;var _0x375f15=_0x2cb1[_0x71e33];return _0x375f15;};'use strict';var EventEmitter=require(_0x12cb('0x0'));var UserProfile=require(_0x12cb('0x1'))['db'][_0x12cb('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x12cb('0x3')](0x0);var events={'afterCreate':_0x12cb('0x4'),'afterUpdate':_0x12cb('0x5'),'afterDestroy':_0x12cb('0x6')};function emitEvent(_0x50ca5d){return function(_0x37befc,_0x3e0d17,_0x34aca1){UserProfileEvents[_0x12cb('0x7')](_0x50ca5d+':'+_0x37befc['id'],_0x37befc);UserProfileEvents[_0x12cb('0x7')](_0x50ca5d,_0x37befc);_0x34aca1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x12cb('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 1d839bc..8b7c918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebd2=['UserProfile','user_profiles','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfile.attributes','exports'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xebd2,0x7b));var _0x2ebd=function(_0x2e595a,_0x358bb9){_0x2e595a=_0x2e595a-0x0;var _0x5139ee=_0xebd2[_0x2e595a];return _0x5139ee;};'use strict';var _=require(_0x2ebd('0x0'));var util=require(_0x2ebd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2ebd('0x2'));var BPromise=require(_0x2ebd('0x3'));var rp=require(_0x2ebd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ebd('0x5'));var config=require(_0x2ebd('0x6'));var attributes=require(_0x2ebd('0x7'));module[_0x2ebd('0x8')]=function(_0x47a3f7,_0xab3167){return _0x47a3f7['define'](_0x2ebd('0x9'),attributes,{'tableName':_0x2ebd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2b5=['rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile','user_profiles','lodash','util','api','moment','path'];(function(_0x4d91b4,_0x3d9e10){var _0x3e4be9=function(_0x43d10f){while(--_0x43d10f){_0x4d91b4['push'](_0x4d91b4['shift']());}};_0x3e4be9(++_0x3d9e10);}(_0xc2b5,0x187));var _0x5c2b=function(_0x3e2d71,_0x2eef5a){_0x3e2d71=_0x3e2d71-0x0;var _0x6c8bc5=_0xc2b5[_0x3e2d71];return _0x6c8bc5;};'use strict';var _=require(_0x5c2b('0x0'));var util=require(_0x5c2b('0x1'));var logger=require('../../config/logger')(_0x5c2b('0x2'));var moment=require(_0x5c2b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c2b('0x4'));var rimraf=require(_0x5c2b('0x5'));var config=require(_0x5c2b('0x6'));var attributes=require(_0x5c2b('0x7'));module[_0x5c2b('0x8')]=function(_0x26a670,_0x25d44a){return _0x26a670[_0x5c2b('0x9')](_0x5c2b('0xa'),attributes,{'tableName':_0x5c2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e0e2637..fccf408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2b8b5d,_0x5c6891){var _0x13b0ea=function(_0x5aa260){while(--_0x5aa260){_0x2b8b5d['push'](_0x2b8b5d['shift']());}};_0x13b0ea(++_0x5c6891);}(_0x2675,0x75));var _0x5267=function(_0x46307f,_0x55db2f){_0x46307f=_0x46307f-0x0;var _0x5a3320=_0x2675[_0x46307f];return _0x5a3320;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});config[_0x5267('0x9')]=_[_0x5267('0xa')](config['redis'],{'host':_0x5267('0xb'),'port':0x18eb});var socket=require(_0x5267('0xc'))(new Redis(config['redis']));require(_0x5267('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ff4e9,_0x207d47,_0x26e22b){return new BPromise(function(_0x534c2b,_0x3e6964){return client['request'](_0x3ff4e9,_0x26e22b)[_0x5267('0xe')](function(_0x5bbf00){logger[_0x5267('0xf')](_0x5267('0x10'),_0x207d47,_0x5267('0x11'));logger[_0x5267('0x12')](_0x5267('0x13'),_0x207d47,_0x5267('0x11'),JSON[_0x5267('0x14')](_0x5bbf00));if(_0x5bbf00[_0x5267('0x15')]){if(_0x5bbf00[_0x5267('0x15')][_0x5267('0x16')]===0x1f4){logger[_0x5267('0x15')](_0x5267('0x10'),_0x207d47,_0x5bbf00[_0x5267('0x15')]['message']);return _0x3e6964(_0x5bbf00['error'][_0x5267('0x17')]);}logger[_0x5267('0x15')](_0x5267('0x10'),_0x207d47,_0x5bbf00[_0x5267('0x15')][_0x5267('0x17')]);return _0x534c2b(_0x5bbf00[_0x5267('0x15')][_0x5267('0x17')]);}else{logger[_0x5267('0xf')](_0x5267('0x10'),_0x207d47,_0x5267('0x11'));_0x534c2b(_0x5bbf00[_0x5267('0x18')][_0x5267('0x17')]);}})['catch'](function(_0x18f32e){logger[_0x5267('0x15')]('UserProfile,\x20%s,\x20%s',_0x207d47,_0x18f32e);_0x3e6964(_0x18f32e);});});}
\ No newline at end of file
+var _0xac9d=['./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x503ea4,_0xfd61d9){var _0x33bbf9=function(_0x80b101){while(--_0x80b101){_0x503ea4['push'](_0x503ea4['shift']());}};_0x33bbf9(++_0xfd61d9);}(_0xac9d,0x14d));var _0xdac9=function(_0x450aaf,_0x1c1a8c){_0x450aaf=_0x450aaf-0x0;var _0x199a88=_0xac9d[_0x450aaf];return _0x199a88;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('UserProfile,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}
\ No newline at end of file
index a2ee647..e9b974d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda9f=['length','userProfile:','./userProfile.events','update','emit','register'];(function(_0x56293b,_0x2d3e87){var _0x57722a=function(_0x13bfb9){while(--_0x13bfb9){_0x56293b['push'](_0x56293b['shift']());}};_0x57722a(++_0x2d3e87);}(_0xda9f,0x86));var _0xfda9=function(_0x293ac9,_0x1ab615){_0x293ac9=_0x293ac9-0x0;var _0x58bd0c=_0xda9f[_0x293ac9];return _0x58bd0c;};'use strict';var UserProfileEvents=require(_0xfda9('0x0'));var events=['save','remove',_0xfda9('0x1')];function createListener(_0x44e0f4,_0x25b40f){return function(_0x4528e6){_0x25b40f[_0xfda9('0x2')](_0x44e0f4,_0x4528e6);};}function removeListener(_0x440326,_0x2a2d7c){return function(){UserProfileEvents['removeListener'](_0x440326,_0x2a2d7c);};}exports[_0xfda9('0x3')]=function(_0x1cb84b){for(var _0x34895f=0x0,_0x3d8450=events[_0xfda9('0x4')];_0x34895f<_0x3d8450;_0x34895f++){var _0x5a4cee=events[_0x34895f];var _0x3b1f1c=createListener(_0xfda9('0x5')+_0x5a4cee,_0x1cb84b);UserProfileEvents['on'](_0x5a4cee,_0x3b1f1c);}};
\ No newline at end of file
+var _0x746c=['remove','update','emit','register','length','userProfile:','./userProfile.events'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x746c,0x195));var _0xc746=function(_0x36cb22,_0x340b23){_0x36cb22=_0x36cb22-0x0;var _0x5f8af7=_0x746c[_0x36cb22];return _0x5f8af7;};'use strict';var UserProfileEvents=require(_0xc746('0x0'));var events=['save',_0xc746('0x1'),_0xc746('0x2')];function createListener(_0x19ecb3,_0x4765e2){return function(_0x2b8664){_0x4765e2[_0xc746('0x3')](_0x19ecb3,_0x2b8664);};}function removeListener(_0x36fb3f,_0x26776e){return function(){UserProfileEvents['removeListener'](_0x36fb3f,_0x26776e);};}exports[_0xc746('0x4')]=function(_0x329029){for(var _0x2fe4d4=0x0,_0x2ee8e2=events[_0xc746('0x5')];_0x2fe4d4<_0x2ee8e2;_0x2fe4d4++){var _0x3220d4=events[_0x2fe4d4];var _0x561ad8=createListener(_0xc746('0x6')+_0x3220d4,_0x329029);UserProfileEvents['on'](_0x3220d4,_0x561ad8);}};
\ No newline at end of file
index 7508d1c..b322513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9aa=['destroy','exports','multer','express','Router','../../components/auth/service','./userProfileResource.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x64977e,_0x475b98){var _0x22223c=function(_0x575b80){while(--_0x575b80){_0x64977e['push'](_0x64977e['shift']());}};_0x22223c(++_0x475b98);}(_0xb9aa,0x9a));var _0xab9a=function(_0x2b9efa,_0x1af483){_0x2b9efa=_0x2b9efa-0x0;var _0x48d857=_0xb9aa[_0x2b9efa];return _0x48d857;};'use strict';var multer=require(_0xab9a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xab9a('0x1'));var router=express[_0xab9a('0x2')]();var auth=require(_0xab9a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab9a('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xab9a('0x5')]);router[_0xab9a('0x6')](_0xab9a('0x7'),auth[_0xab9a('0x8')](),controller[_0xab9a('0x9')]);router[_0xab9a('0x6')](_0xab9a('0xa'),auth[_0xab9a('0x8')](),controller[_0xab9a('0xb')]);router[_0xab9a('0xc')]('/',auth['isAuthenticated'](),controller[_0xab9a('0xd')]);router[_0xab9a('0xe')](_0xab9a('0xa'),auth[_0xab9a('0x8')](),controller[_0xab9a('0xf')]);router[_0xab9a('0x10')](_0xab9a('0xa'),auth[_0xab9a('0x8')](),controller[_0xab9a('0x11')]);module[_0xab9a('0x12')]=router;
\ No newline at end of file
+var _0x9e38=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x529902,_0x1c9253){var _0x6f4be6=function(_0x35ddd7){while(--_0x35ddd7){_0x529902['push'](_0x529902['shift']());}};_0x6f4be6(++_0x1c9253);}(_0x9e38,0x155));var _0x89e3=function(_0x270dba,_0x1817d2){_0x270dba=_0x270dba-0x0;var _0x36b83b=_0x9e38[_0x270dba];return _0x36b83b;};'use strict';var multer=require(_0x89e3('0x0'));var util=require(_0x89e3('0x1'));var path=require(_0x89e3('0x2'));var timeout=require(_0x89e3('0x3'));var express=require(_0x89e3('0x4'));var router=express[_0x89e3('0x5')]();var auth=require(_0x89e3('0x6'));var interaction=require(_0x89e3('0x7'));var config=require(_0x89e3('0x8'));var controller=require(_0x89e3('0x9'));router[_0x89e3('0xa')]('/',auth[_0x89e3('0xb')](),controller[_0x89e3('0xc')]);router['get'](_0x89e3('0xd'),auth[_0x89e3('0xb')](),controller[_0x89e3('0xe')]);router[_0x89e3('0xa')](_0x89e3('0xf'),auth[_0x89e3('0xb')](),controller[_0x89e3('0x10')]);router[_0x89e3('0x11')]('/',auth[_0x89e3('0xb')](),controller[_0x89e3('0x12')]);router['put'](_0x89e3('0xf'),auth[_0x89e3('0xb')](),controller[_0x89e3('0x13')]);router[_0x89e3('0x14')]('/:id',auth[_0x89e3('0xb')](),controller[_0x89e3('0x15')]);module[_0x89e3('0x16')]=router;
\ No newline at end of file
index 8969308..3f1b106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe120=['STRING','exports'];(function(_0xce9b0c,_0x4b9b7a){var _0x403208=function(_0xd48959){while(--_0xd48959){_0xce9b0c['push'](_0xce9b0c['shift']());}};_0x403208(++_0x4b9b7a);}(_0xe120,0x137));var _0x0e12=function(_0x3ad3f1,_0x263c97){_0x3ad3f1=_0x3ad3f1-0x0;var _0x40ef7f=_0xe120[_0x3ad3f1];return _0x40ef7f;};'use strict';var Sequelize=require('sequelize');module[_0x0e12('0x0')]={'name':{'type':Sequelize[_0x0e12('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x0e12('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xdbf7=['exports','STRING','INTEGER'];(function(_0x3485c5,_0x46872c){var _0x14fd8a=function(_0x3b968c){while(--_0x3b968c){_0x3485c5['push'](_0x3485c5['shift']());}};_0x14fd8a(++_0x46872c);}(_0xdbf7,0xcf));var _0x7dbf=function(_0x4f5a2d,_0x3c2eb4){_0x4f5a2d=_0x4f5a2d-0x0;var _0x46ca10=_0xdbf7[_0x4f5a2d];return _0x46ca10;};'use strict';var Sequelize=require('sequelize');module[_0x7dbf('0x0')]={'name':{'type':Sequelize[_0x7dbf('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7dbf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7dbf('0x1')],'allowNull':![]}};
\ No newline at end of file
index 4b850d6..4901e09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['UserProfileResource','fieldName','type','key','map','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','end','count','offset','limit','status','apply','save','update','then','destroy','sendStatus','error','name','send','index'];(function(_0x3a4543,_0x54c004){var _0x10baf0=function(_0x256e00){while(--_0x256e00){_0x3a4543['push'](_0x3a4543['shift']());}};_0x10baf0(++_0x54c004);}(_0xed1f,0x6a));var _0xfed1=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xed1f[_0x411017];return _0x2adeea;};'use strict';var pdf=require(_0xfed1('0x0'));var emlformat=require(_0xfed1('0x1'));var rimraf=require(_0xfed1('0x2'));var zipdir=require(_0xfed1('0x3'));var jsonpatch=require(_0xfed1('0x4'));var rp=require(_0xfed1('0x5'));var moment=require(_0xfed1('0x6'));var BPromise=require(_0xfed1('0x7'));var Mustache=require(_0xfed1('0x8'));var util=require(_0xfed1('0x9'));var path=require(_0xfed1('0xa'));var sox=require(_0xfed1('0xb'));var csv=require(_0xfed1('0xc'));var ejs=require(_0xfed1('0xd'));var fs=require('fs');var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xc'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfed1('0x18'))['db'];function respondWithStatusCode(_0xe84ba6,_0x569a6e){_0x569a6e=_0x569a6e||0xcc;return function(_0x17f4fe){if(_0x17f4fe){return _0xe84ba6['sendStatus'](_0x569a6e);}return _0xe84ba6['status'](_0x569a6e)[_0xfed1('0x19')]();};}function respondWithResult(_0x397af9,_0x532537){_0x532537=_0x532537||0xc8;return function(_0x2dde3a){if(_0x2dde3a){return _0x397af9['status'](_0x532537)['json'](_0x2dde3a);}};}function respondWithFilteredResult(_0xde25db,_0x39aa0c){return function(_0x1fbb7a){if(_0x1fbb7a){var _0x123c46=_0x1fbb7a[_0xfed1('0x1a')],_0x582e67=_0x39aa0c[_0xfed1('0x1b')],_0x1a00f6=_0x39aa0c['offset']+_0x39aa0c[_0xfed1('0x1c')],_0x4af928;if(_0x1a00f6>=_0x123c46){_0x1a00f6=_0x123c46;_0x4af928=0xc8;}else{_0x4af928=0xce;}_0xde25db[_0xfed1('0x1d')](_0x4af928);return _0xde25db['set']('Content-Range',_0x582e67+'-'+_0x1a00f6+'/'+_0x123c46)['json'](_0x1fbb7a);}return null;};}function patchUpdates(_0x1e5afb){return function(_0x51f12a){try{jsonpatch[_0xfed1('0x1e')](_0x51f12a,_0x1e5afb,!![]);}catch(_0x34fa04){return BPromise['reject'](_0x34fa04);}return _0x51f12a[_0xfed1('0x1f')]();};}function saveUpdates(_0x65f14b,_0x59ee9d){return function(_0x3ce944){if(_0x3ce944){return _0x3ce944[_0xfed1('0x20')](_0x65f14b)[_0xfed1('0x21')](function(_0x92b92d){return _0x92b92d;});}return null;};}function removeEntity(_0x4bac79,_0x203cec){return function(_0x59333e){if(_0x59333e){return _0x59333e[_0xfed1('0x22')]()[_0xfed1('0x21')](function(){_0x4bac79[_0xfed1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41d22c,_0x594917){return function(_0x460555){if(!_0x460555){_0x41d22c[_0xfed1('0x23')](0x194);}return _0x460555;};}function handleError(_0x1b7b22,_0x365bae){_0x365bae=_0x365bae||0x1f4;return function(_0x186ecc){logger[_0xfed1('0x24')](_0x186ecc['stack']);if(_0x186ecc[_0xfed1('0x25')]){delete _0x186ecc[_0xfed1('0x25')];}_0x1b7b22['status'](_0x365bae)[_0xfed1('0x26')](_0x186ecc);};}exports[_0xfed1('0x27')]=function(_0x1b871a,_0x1d62c5){var _0x3b9122={},_0x1761d1={},_0x583953={'count':0x0,'rows':[]};var _0x4607e9=_['map'](db[_0xfed1('0x28')]['rawAttributes'],function(_0x53b0c9){return{'name':_0x53b0c9[_0xfed1('0x29')],'type':_0x53b0c9[_0xfed1('0x2a')][_0xfed1('0x2b')]};});_0x1761d1['model']=_[_0xfed1('0x2c')](_0x4607e9,_0xfed1('0x25'));_0x1761d1[_0xfed1('0x2d')]=_[_0xfed1('0x2e')](_0x1b871a[_0xfed1('0x2d')]);_0x1761d1[_0xfed1('0x2f')]=_['intersection'](_0x1761d1[_0xfed1('0x30')],_0x1761d1[_0xfed1('0x2d')]);_0x3b9122['attributes']=_['intersection'](_0x1761d1[_0xfed1('0x30')],qs[_0xfed1('0x31')](_0x1b871a[_0xfed1('0x2d')][_0xfed1('0x31')]));_0x3b9122[_0xfed1('0x32')]=_0x3b9122['attributes'][_0xfed1('0x33')]?_0x3b9122[_0xfed1('0x32')]:_0x1761d1[_0xfed1('0x30')];if(!_0x1b871a[_0xfed1('0x2d')][_0xfed1('0x34')]('nolimit')){_0x3b9122[_0xfed1('0x1c')]=qs['limit'](_0x1b871a[_0xfed1('0x2d')][_0xfed1('0x1c')]);_0x3b9122[_0xfed1('0x1b')]=qs[_0xfed1('0x1b')](_0x1b871a[_0xfed1('0x2d')][_0xfed1('0x1b')]);}_0x3b9122[_0xfed1('0x35')]=qs[_0xfed1('0x36')](_0x1b871a['query'][_0xfed1('0x36')]);_0x3b9122[_0xfed1('0x37')]=qs[_0xfed1('0x2f')](_[_0xfed1('0x38')](_0x1b871a['query'],_0x1761d1['filters']),_0x4607e9);if(_0x1b871a[_0xfed1('0x2d')][_0xfed1('0x39')]){_0x3b9122[_0xfed1('0x37')]=_[_0xfed1('0x3a')](_0x3b9122[_0xfed1('0x37')],{'$or':_[_0xfed1('0x2c')](_0x4607e9,function(_0x46a150){if(_0x46a150[_0xfed1('0x2a')]!=='VIRTUAL'){var _0x52c7b8={};_0x52c7b8[_0x46a150[_0xfed1('0x25')]]={'$like':'%'+_0x1b871a[_0xfed1('0x2d')]['filter']+'%'};return _0x52c7b8;}})});}_0x3b9122=_[_0xfed1('0x3a')]({},_0x3b9122,_0x1b871a[_0xfed1('0x3b')]);var _0x3b0973={'where':_0x3b9122[_0xfed1('0x37')]};return db[_0xfed1('0x28')][_0xfed1('0x1a')](_0x3b0973)[_0xfed1('0x21')](function(_0x4118d4){_0x583953[_0xfed1('0x1a')]=_0x4118d4;if(_0x1b871a['query']['includeAll']){_0x3b9122['include']=[{'all':!![]}];}return db[_0xfed1('0x28')][_0xfed1('0x3c')](_0x3b9122);})[_0xfed1('0x21')](function(_0x496a5d){_0x583953[_0xfed1('0x3d')]=_0x496a5d;return _0x583953;})['then'](respondWithFilteredResult(_0x1d62c5,_0x3b9122))[_0xfed1('0x3e')](handleError(_0x1d62c5,null));};exports[_0xfed1('0x3f')]=function(_0x2f4e0f,_0x4f042a){var _0x20bdae={'raw':![],'where':{'id':_0x2f4e0f[_0xfed1('0x40')]['id']}},_0x6f1647={};_0x6f1647['model']=_[_0xfed1('0x2e')](db['UserProfileResource'][_0xfed1('0x41')]);_0x6f1647[_0xfed1('0x2d')]=_[_0xfed1('0x2e')](_0x2f4e0f[_0xfed1('0x2d')]);_0x6f1647[_0xfed1('0x2f')]=_[_0xfed1('0x42')](_0x6f1647[_0xfed1('0x30')],_0x6f1647[_0xfed1('0x2d')]);_0x20bdae[_0xfed1('0x32')]=_['intersection'](_0x6f1647[_0xfed1('0x30')],qs[_0xfed1('0x31')](_0x2f4e0f[_0xfed1('0x2d')]['fields']));_0x20bdae['attributes']=_0x20bdae[_0xfed1('0x32')][_0xfed1('0x33')]?_0x20bdae[_0xfed1('0x32')]:_0x6f1647[_0xfed1('0x30')];if(_0x2f4e0f[_0xfed1('0x2d')][_0xfed1('0x43')]){_0x20bdae[_0xfed1('0x44')]=[{'all':!![]}];}_0x20bdae=_[_0xfed1('0x3a')]({},_0x20bdae,_0x2f4e0f[_0xfed1('0x3b')]);return db[_0xfed1('0x28')][_0xfed1('0x45')](_0x20bdae)[_0xfed1('0x21')](handleEntityNotFound(_0x4f042a,null))['then'](respondWithResult(_0x4f042a,null))[_0xfed1('0x3e')](handleError(_0x4f042a,null));};exports[_0xfed1('0x46')]=function(_0x280d6e,_0x24c786){return db[_0xfed1('0x28')][_0xfed1('0x46')](_0x280d6e['body'],{})[_0xfed1('0x21')](respondWithResult(_0x24c786,0xc9))[_0xfed1('0x3e')](handleError(_0x24c786,null));};exports[_0xfed1('0x20')]=function(_0x4afcc1,_0x22874a){if(_0x4afcc1[_0xfed1('0x47')]['id']){delete _0x4afcc1[_0xfed1('0x47')]['id'];}return db[_0xfed1('0x28')]['find']({'where':{'id':_0x4afcc1[_0xfed1('0x40')]['id']}})[_0xfed1('0x21')](handleEntityNotFound(_0x22874a,null))[_0xfed1('0x21')](saveUpdates(_0x4afcc1[_0xfed1('0x47')],null))[_0xfed1('0x21')](respondWithResult(_0x22874a,null))[_0xfed1('0x3e')](handleError(_0x22874a,null));};exports[_0xfed1('0x22')]=function(_0x18d761,_0x2365db){return db[_0xfed1('0x28')][_0xfed1('0x45')]({'where':{'id':_0x18d761[_0xfed1('0x40')]['id']}})[_0xfed1('0x21')](handleEntityNotFound(_0x2365db,null))[_0xfed1('0x21')](removeEntity(_0x2365db,null))[_0xfed1('0x3e')](handleError(_0x2365db,null));};exports[_0xfed1('0x48')]=function(_0xd1f984,_0x270321){return db['UserProfileResource']['describe']()[_0xfed1('0x21')](respondWithResult(_0x270321,null))[_0xfed1('0x3e')](handleError(_0x270321,null));};
\ No newline at end of file
+var _0x7da7=['api','../../config/utils','../../mysqldb','status','end','json','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','offset','sort','pick','filter','where','VIRTUAL','merge','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','options','UserProfileResource','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2d47c0,_0x1cca4){var _0xfcffdb=function(_0x2273ca){while(--_0x2273ca){_0x2d47c0['push'](_0x2d47c0['shift']());}};_0xfcffdb(++_0x1cca4);}(_0x7da7,0x10d));var _0x77da=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0x7da7[_0x5ac1e5];return _0x1bccc6;};'use strict';var pdf=require(_0x77da('0x0'));var emlformat=require(_0x77da('0x1'));var rimraf=require(_0x77da('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x77da('0x3'));var moment=require(_0x77da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77da('0x5'));var util=require(_0x77da('0x6'));var path=require('path');var sox=require(_0x77da('0x7'));var csv=require(_0x77da('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x8'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var db=require(_0x77da('0x15'))['db'];function respondWithStatusCode(_0x3bcea0,_0x2acc65){_0x2acc65=_0x2acc65||0xcc;return function(_0x5d6e2f){if(_0x5d6e2f){return _0x3bcea0['sendStatus'](_0x2acc65);}return _0x3bcea0[_0x77da('0x16')](_0x2acc65)[_0x77da('0x17')]();};}function respondWithResult(_0x589aa1,_0x3b0ff2){_0x3b0ff2=_0x3b0ff2||0xc8;return function(_0x369df0){if(_0x369df0){return _0x589aa1[_0x77da('0x16')](_0x3b0ff2)[_0x77da('0x18')](_0x369df0);}};}function respondWithFilteredResult(_0x519253,_0x2172d0){return function(_0x4e130c){if(_0x4e130c){var _0x29cd7b=_0x4e130c['count'],_0x366443=_0x2172d0['offset'],_0x1b0e17=_0x2172d0['offset']+_0x2172d0['limit'],_0x4500c4;if(_0x1b0e17>=_0x29cd7b){_0x1b0e17=_0x29cd7b;_0x4500c4=0xc8;}else{_0x4500c4=0xce;}_0x519253[_0x77da('0x16')](_0x4500c4);return _0x519253[_0x77da('0x19')](_0x77da('0x1a'),_0x366443+'-'+_0x1b0e17+'/'+_0x29cd7b)[_0x77da('0x18')](_0x4e130c);}return null;};}function patchUpdates(_0x19a00c){return function(_0x12d2b1){try{jsonpatch[_0x77da('0x1b')](_0x12d2b1,_0x19a00c,!![]);}catch(_0x3b6dde){return BPromise['reject'](_0x3b6dde);}return _0x12d2b1['save']();};}function saveUpdates(_0xd5a809,_0x4d1512){return function(_0x507979){if(_0x507979){return _0x507979[_0x77da('0x1c')](_0xd5a809)[_0x77da('0x1d')](function(_0x24aa8a){return _0x24aa8a;});}return null;};}function removeEntity(_0x5ab79a,_0x58270c){return function(_0x3e6cfe){if(_0x3e6cfe){return _0x3e6cfe['destroy']()[_0x77da('0x1d')](function(){_0x5ab79a[_0x77da('0x16')](0xcc)[_0x77da('0x17')]();});}};}function handleEntityNotFound(_0x27b6c7,_0x10399a){return function(_0x270318){if(!_0x270318){_0x27b6c7[_0x77da('0x1e')](0x194);}return _0x270318;};}function handleError(_0x50799d,_0x4885ec){_0x4885ec=_0x4885ec||0x1f4;return function(_0xfd160){logger[_0x77da('0x1f')](_0xfd160[_0x77da('0x20')]);if(_0xfd160[_0x77da('0x21')]){delete _0xfd160['name'];}_0x50799d[_0x77da('0x16')](_0x4885ec)[_0x77da('0x22')](_0xfd160);};}exports[_0x77da('0x23')]=function(_0x36115b,_0x446ae7){var _0x5997b6={},_0xce24b8={},_0x3e090d={'count':0x0,'rows':[]};var _0x1f2279=_[_0x77da('0x24')](db['UserProfileResource']['rawAttributes'],function(_0x4d395a){return{'name':_0x4d395a[_0x77da('0x25')],'type':_0x4d395a[_0x77da('0x26')][_0x77da('0x27')]};});_0xce24b8[_0x77da('0x28')]=_[_0x77da('0x24')](_0x1f2279,'name');_0xce24b8[_0x77da('0x29')]=_[_0x77da('0x2a')](_0x36115b[_0x77da('0x29')]);_0xce24b8[_0x77da('0x2b')]=_[_0x77da('0x2c')](_0xce24b8[_0x77da('0x28')],_0xce24b8['query']);_0x5997b6[_0x77da('0x2d')]=_[_0x77da('0x2c')](_0xce24b8[_0x77da('0x28')],qs[_0x77da('0x2e')](_0x36115b[_0x77da('0x29')][_0x77da('0x2e')]));_0x5997b6[_0x77da('0x2d')]=_0x5997b6[_0x77da('0x2d')]['length']?_0x5997b6['attributes']:_0xce24b8[_0x77da('0x28')];if(!_0x36115b[_0x77da('0x29')]['hasOwnProperty'](_0x77da('0x2f'))){_0x5997b6[_0x77da('0x30')]=qs[_0x77da('0x30')](_0x36115b[_0x77da('0x29')][_0x77da('0x30')]);_0x5997b6[_0x77da('0x31')]=qs[_0x77da('0x31')](_0x36115b['query'][_0x77da('0x31')]);}_0x5997b6['order']=qs['sort'](_0x36115b['query'][_0x77da('0x32')]);_0x5997b6['where']=qs[_0x77da('0x2b')](_[_0x77da('0x33')](_0x36115b[_0x77da('0x29')],_0xce24b8[_0x77da('0x2b')]),_0x1f2279);if(_0x36115b[_0x77da('0x29')][_0x77da('0x34')]){_0x5997b6[_0x77da('0x35')]=_['merge'](_0x5997b6[_0x77da('0x35')],{'$or':_[_0x77da('0x24')](_0x1f2279,function(_0x1ca53a){if(_0x1ca53a[_0x77da('0x26')]!==_0x77da('0x36')){var _0x188284={};_0x188284[_0x1ca53a['name']]={'$like':'%'+_0x36115b[_0x77da('0x29')][_0x77da('0x34')]+'%'};return _0x188284;}})});}_0x5997b6=_[_0x77da('0x37')]({},_0x5997b6,_0x36115b['options']);var _0xc5f0b8={'where':_0x5997b6['where']};return db['UserProfileResource']['count'](_0xc5f0b8)['then'](function(_0x19f9f7){_0x3e090d[_0x77da('0x38')]=_0x19f9f7;if(_0x36115b[_0x77da('0x29')]['includeAll']){_0x5997b6[_0x77da('0x39')]=[{'all':!![]}];}return db['UserProfileResource'][_0x77da('0x3a')](_0x5997b6);})['then'](function(_0x3c216f){_0x3e090d[_0x77da('0x3b')]=_0x3c216f;return _0x3e090d;})[_0x77da('0x1d')](respondWithFilteredResult(_0x446ae7,_0x5997b6))[_0x77da('0x3c')](handleError(_0x446ae7,null));};exports[_0x77da('0x3d')]=function(_0x5ecf12,_0x759b86){var _0x1f48bd={'raw':![],'where':{'id':_0x5ecf12[_0x77da('0x3e')]['id']}},_0x44717a={};_0x44717a[_0x77da('0x28')]=_[_0x77da('0x2a')](db['UserProfileResource'][_0x77da('0x3f')]);_0x44717a[_0x77da('0x29')]=_[_0x77da('0x2a')](_0x5ecf12[_0x77da('0x29')]);_0x44717a[_0x77da('0x2b')]=_[_0x77da('0x2c')](_0x44717a['model'],_0x44717a[_0x77da('0x29')]);_0x1f48bd['attributes']=_[_0x77da('0x2c')](_0x44717a[_0x77da('0x28')],qs[_0x77da('0x2e')](_0x5ecf12['query'][_0x77da('0x2e')]));_0x1f48bd[_0x77da('0x2d')]=_0x1f48bd[_0x77da('0x2d')][_0x77da('0x40')]?_0x1f48bd[_0x77da('0x2d')]:_0x44717a[_0x77da('0x28')];if(_0x5ecf12[_0x77da('0x29')][_0x77da('0x41')]){_0x1f48bd[_0x77da('0x39')]=[{'all':!![]}];}_0x1f48bd=_['merge']({},_0x1f48bd,_0x5ecf12[_0x77da('0x42')]);return db[_0x77da('0x43')][_0x77da('0x44')](_0x1f48bd)[_0x77da('0x1d')](handleEntityNotFound(_0x759b86,null))[_0x77da('0x1d')](respondWithResult(_0x759b86,null))[_0x77da('0x3c')](handleError(_0x759b86,null));};exports['create']=function(_0x54f88c,_0x240d7b){return db[_0x77da('0x43')][_0x77da('0x45')](_0x54f88c[_0x77da('0x46')],{})[_0x77da('0x1d')](respondWithResult(_0x240d7b,0xc9))[_0x77da('0x3c')](handleError(_0x240d7b,null));};exports['update']=function(_0x6ccb8f,_0x357ee4){if(_0x6ccb8f[_0x77da('0x46')]['id']){delete _0x6ccb8f[_0x77da('0x46')]['id'];}return db['UserProfileResource'][_0x77da('0x44')]({'where':{'id':_0x6ccb8f['params']['id']}})['then'](handleEntityNotFound(_0x357ee4,null))[_0x77da('0x1d')](saveUpdates(_0x6ccb8f[_0x77da('0x46')],null))[_0x77da('0x1d')](respondWithResult(_0x357ee4,null))[_0x77da('0x3c')](handleError(_0x357ee4,null));};exports['destroy']=function(_0x16bf4b,_0x1e36ee){return db['UserProfileResource'][_0x77da('0x44')]({'where':{'id':_0x16bf4b[_0x77da('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1e36ee,null))[_0x77da('0x1d')](removeEntity(_0x1e36ee,null))[_0x77da('0x3c')](handleError(_0x1e36ee,null));};exports[_0x77da('0x47')]=function(_0xef2496,_0xfc13ed){return db[_0x77da('0x43')][_0x77da('0x47')]()[_0x77da('0x1d')](respondWithResult(_0xfc13ed,null))[_0x77da('0x3c')](handleError(_0xfc13ed,null));};
\ No newline at end of file
index 83e2e50..27008ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed7=['exports','UserProfileResource','resourceId','sectionId','lodash','util','bluebird','request-promise','path','../../config/environment'];(function(_0x3e3301,_0x37f291){var _0x1602e5=function(_0x5e8055){while(--_0x5e8055){_0x3e3301['push'](_0x3e3301['shift']());}};_0x1602e5(++_0x37f291);}(_0xfed7,0x11c));var _0x7fed=function(_0x5adfa9,_0x4b835d){_0x5adfa9=_0x5adfa9-0x0;var _0x458f41=_0xfed7[_0x5adfa9];return _0x458f41;};'use strict';var _=require(_0x7fed('0x0'));var util=require(_0x7fed('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7fed('0x2'));var rp=require(_0x7fed('0x3'));var fs=require('fs');var path=require(_0x7fed('0x4'));var rimraf=require('rimraf');var config=require(_0x7fed('0x5'));var attributes=require('./userProfileResource.attributes');module[_0x7fed('0x6')]=function(_0x494600,_0x3440ad){return _0x494600['define'](_0x7fed('0x7'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7fed('0x8'),_0x7fed('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f5b=['util','../../config/logger','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x8f5b,0x141));var _0xb8f5=function(_0x226b68,_0x3d22fe){_0x226b68=_0x226b68-0x0;var _0x579e0f=_0x8f5b[_0x226b68];return _0x579e0f;};'use strict';var _=require(_0xb8f5('0x0'));var util=require(_0xb8f5('0x1'));var logger=require(_0xb8f5('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb8f5('0x3'));var fs=require('fs');var path=require(_0xb8f5('0x4'));var rimraf=require('rimraf');var config=require(_0xb8f5('0x5'));var attributes=require(_0xb8f5('0x6'));module[_0xb8f5('0x7')]=function(_0x158867,_0x4b5925){return _0x158867[_0xb8f5('0x8')](_0xb8f5('0x9'),attributes,{'tableName':_0xb8f5('0xa'),'paranoid':![],'indexes':[{'name':_0xb8f5('0xb'),'fields':[_0xb8f5('0xc'),_0xb8f5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index e8e5f62..fc325c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ad0=['http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3bae15,_0x2dc199){var _0x183dc1=function(_0x1715af){while(--_0x1715af){_0x3bae15['push'](_0x3bae15['shift']());}};_0x183dc1(++_0x2dc199);}(_0x5ad0,0x16b));var _0x05ad=function(_0xc7bb43,_0x30bede){_0xc7bb43=_0xc7bb43-0x0;var _0x2f2f08=_0x5ad0[_0xc7bb43];return _0x2f2f08;};'use strict';var _=require(_0x05ad('0x0'));var util=require('util');var moment=require(_0x05ad('0x1'));var BPromise=require('bluebird');var rs=require(_0x05ad('0x2'));var fs=require('fs');var Redis=require(_0x05ad('0x3'));var db=require(_0x05ad('0x4'))['db'];var utils=require(_0x05ad('0x5'));var logger=require(_0x05ad('0x6'))(_0x05ad('0x7'));var config=require(_0x05ad('0x8'));var jayson=require(_0x05ad('0x9'));var client=jayson[_0x05ad('0xa')][_0x05ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eabeb,_0x4ba189,_0x441fdf){return new BPromise(function(_0x5454d6,_0x41841f){return client['request'](_0x2eabeb,_0x441fdf)[_0x05ad('0xc')](function(_0x2ce9b0){logger[_0x05ad('0xd')](_0x05ad('0xe'),_0x4ba189,_0x05ad('0xf'));logger[_0x05ad('0x10')](_0x05ad('0x11'),_0x4ba189,_0x05ad('0xf'),JSON['stringify'](_0x2ce9b0));if(_0x2ce9b0[_0x05ad('0x12')]){if(_0x2ce9b0[_0x05ad('0x12')][_0x05ad('0x13')]===0x1f4){logger[_0x05ad('0x12')](_0x05ad('0xe'),_0x4ba189,_0x2ce9b0['error'][_0x05ad('0x14')]);return _0x41841f(_0x2ce9b0[_0x05ad('0x12')][_0x05ad('0x14')]);}logger[_0x05ad('0x12')](_0x05ad('0xe'),_0x4ba189,_0x2ce9b0[_0x05ad('0x12')][_0x05ad('0x14')]);return _0x5454d6(_0x2ce9b0[_0x05ad('0x12')]['message']);}else{logger[_0x05ad('0xd')](_0x05ad('0xe'),_0x4ba189,_0x05ad('0xf'));_0x5454d6(_0x2ce9b0[_0x05ad('0x15')][_0x05ad('0x14')]);}})['catch'](function(_0x3754b3){logger['error'](_0x05ad('0xe'),_0x4ba189,_0x3754b3);_0x41841f(_0x3754b3);});});}
\ No newline at end of file
+var _0x3e53=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x15523b,_0x388fe6){var _0x409eed=function(_0x2e79c4){while(--_0x2e79c4){_0x15523b['push'](_0x15523b['shift']());}};_0x409eed(++_0x388fe6);}(_0x3e53,0x130));var _0x33e5=function(_0x2a8686,_0x4cb393){_0x2a8686=_0x2a8686-0x0;var _0x3b2917=_0x3e53[_0x2a8686];return _0x3b2917;};'use strict';var _=require(_0x33e5('0x0'));var util=require('util');var moment=require(_0x33e5('0x1'));var BPromise=require(_0x33e5('0x2'));var rs=require(_0x33e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33e5('0x4'))['db'];var utils=require(_0x33e5('0x5'));var logger=require(_0x33e5('0x6'))(_0x33e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x33e5('0x8'));var client=jayson[_0x33e5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20c04c,_0x1953d6,_0x5168ab){return new BPromise(function(_0x5286b8,_0x540c6b){return client[_0x33e5('0xa')](_0x20c04c,_0x5168ab)[_0x33e5('0xb')](function(_0x3e69fb){logger[_0x33e5('0xc')](_0x33e5('0xd'),_0x1953d6,'request\x20sent');logger[_0x33e5('0xe')](_0x33e5('0xf'),_0x1953d6,_0x33e5('0x10'),JSON[_0x33e5('0x11')](_0x3e69fb));if(_0x3e69fb[_0x33e5('0x12')]){if(_0x3e69fb[_0x33e5('0x12')][_0x33e5('0x13')]===0x1f4){logger['error'](_0x33e5('0xd'),_0x1953d6,_0x3e69fb['error']['message']);return _0x540c6b(_0x3e69fb['error'][_0x33e5('0x14')]);}logger[_0x33e5('0x12')](_0x33e5('0xd'),_0x1953d6,_0x3e69fb[_0x33e5('0x12')][_0x33e5('0x14')]);return _0x5286b8(_0x3e69fb[_0x33e5('0x12')][_0x33e5('0x14')]);}else{logger['info'](_0x33e5('0xd'),_0x1953d6,'request\x20sent');_0x5286b8(_0x3e69fb[_0x33e5('0x15')]['message']);}})[_0x33e5('0x16')](function(_0x310f08){logger[_0x33e5('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x1953d6,_0x310f08);_0x540c6b(_0x310f08);});});}
\ No newline at end of file
index b9dfb58..50504a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd1f=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','exports','multer','util','path'];(function(_0x164093,_0x524f6e){var _0x491b42=function(_0x53f386){while(--_0x53f386){_0x164093['push'](_0x164093['shift']());}};_0x491b42(++_0x524f6e);}(_0xcd1f,0x162));var _0xfcd1=function(_0x1dd482,_0xff56a9){_0x1dd482=_0x1dd482-0x0;var _0x589954=_0xcd1f[_0x1dd482];return _0x589954;};'use strict';var multer=require(_0xfcd1('0x0'));var util=require(_0xfcd1('0x1'));var path=require(_0xfcd1('0x2'));var timeout=require(_0xfcd1('0x3'));var express=require(_0xfcd1('0x4'));var router=express['Router']();var auth=require(_0xfcd1('0x5'));var interaction=require(_0xfcd1('0x6'));var config=require(_0xfcd1('0x7'));var controller=require(_0xfcd1('0x8'));router['get']('/',auth[_0xfcd1('0x9')](),controller[_0xfcd1('0xa')]);router[_0xfcd1('0xb')](_0xfcd1('0xc'),auth[_0xfcd1('0x9')](),controller[_0xfcd1('0xd')]);router[_0xfcd1('0xb')](_0xfcd1('0xe'),auth[_0xfcd1('0x9')](),controller[_0xfcd1('0xf')]);router[_0xfcd1('0x10')]('/',auth['isAuthenticated'](),controller[_0xfcd1('0x11')]);router[_0xfcd1('0x12')](_0xfcd1('0xe'),auth['isAuthenticated'](),controller[_0xfcd1('0x13')]);router['delete']('/:id',auth[_0xfcd1('0x9')](),controller['destroy']);module[_0xfcd1('0x14')]=router;
\ No newline at end of file
+var _0x95ca=['../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x359124,_0xf0a2e7){var _0x164466=function(_0x24712c){while(--_0x24712c){_0x359124['push'](_0x359124['shift']());}};_0x164466(++_0xf0a2e7);}(_0x95ca,0x1ac));var _0xa95c=function(_0x183365,_0x138de6){_0x183365=_0x183365-0x0;var _0x63579e=_0x95ca[_0x183365];return _0x63579e;};'use strict';var multer=require(_0xa95c('0x0'));var util=require(_0xa95c('0x1'));var path=require(_0xa95c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa95c('0x3')]();var auth=require(_0xa95c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa95c('0x5'));var controller=require('./userProfileSection.controller');router[_0xa95c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa95c('0x6')](_0xa95c('0x7'),auth[_0xa95c('0x8')](),controller['describe']);router[_0xa95c('0x6')](_0xa95c('0x9'),auth[_0xa95c('0x8')](),controller[_0xa95c('0xa')]);router[_0xa95c('0xb')]('/',auth[_0xa95c('0x8')](),controller[_0xa95c('0xc')]);router[_0xa95c('0xd')]('/:id',auth[_0xa95c('0x8')](),controller[_0xa95c('0xe')]);router[_0xa95c('0xf')](_0xa95c('0x9'),auth[_0xa95c('0x8')](),controller[_0xa95c('0x10')]);module[_0xa95c('0x11')]=router;
\ No newline at end of file
index bf2ad97..e5f4e8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x851e=['sequelize','exports','STRING','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x4349bb,_0x558965){var _0x46837c=function(_0x37742f){while(--_0x37742f){_0x4349bb['push'](_0x4349bb['shift']());}};_0x46837c(++_0x558965);}(_0x851e,0x1e8));var _0xe851=function(_0x9733df,_0x450c75){_0x9733df=_0x9733df-0x0;var _0x1abfad=_0x851e[_0x9733df];return _0x1abfad;};'use strict';var Sequelize=require(_0xe851('0x0'));module[_0xe851('0x1')]={'name':{'type':Sequelize[_0xe851('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xe851('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe851('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe851('0x2')],'set':function(_0x326b34){this[_0xe851('0x4')]('crudPermissions',_0x326b34?_0x326b34[_0xe851('0x5')](''):[]);},'get':function(){return this[_0xe851('0x6')](_0xe851('0x7'))?this[_0xe851('0x6')](_0xe851('0x7'))['split'](''):[];}}};
\ No newline at end of file
+var _0x5643=['BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER'];(function(_0x35aad4,_0x34e491){var _0x348052=function(_0x50a139){while(--_0x50a139){_0x35aad4['push'](_0x35aad4['shift']());}};_0x348052(++_0x34e491);}(_0x5643,0x1a3));var _0x3564=function(_0x4a513f,_0x2321c0){_0x4a513f=_0x4a513f-0x0;var _0x27adce=_0x5643[_0x4a513f];return _0x27adce;};'use strict';var Sequelize=require(_0x3564('0x0'));module[_0x3564('0x1')]={'name':{'type':Sequelize[_0x3564('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3564('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3564('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3564('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3564('0x2')],'set':function(_0x22a27d){this[_0x3564('0x5')](_0x3564('0x6'),_0x22a27d?_0x22a27d['join'](''):[]);},'get':function(){return this[_0x3564('0x7')](_0x3564('0x6'))?this[_0x3564('0x7')](_0x3564('0x6'))[_0x3564('0x8')](''):[];}}};
\ No newline at end of file
index 8ec0348..45fc0f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d62=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','body','update','find','describe','eml-format'];(function(_0x3ce964,_0x5da88c){var _0x3ffc6c=function(_0x485b74){while(--_0x485b74){_0x3ce964['push'](_0x3ce964['shift']());}};_0x3ffc6c(++_0x5da88c);}(_0x0d62,0x10f));var _0x20d6=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x0d62[_0x349367];return _0x14179b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x20d6('0x0'));var rimraf=require(_0x20d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20d6('0x2'));var rp=require(_0x20d6('0x3'));var moment=require(_0x20d6('0x4'));var BPromise=require(_0x20d6('0x5'));var Mustache=require(_0x20d6('0x6'));var util=require('util');var path=require(_0x20d6('0x7'));var sox=require(_0x20d6('0x8'));var csv=require(_0x20d6('0x9'));var ejs=require(_0x20d6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x20d6('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20d6('0x9'));var querystring=require('querystring');var Papa=require(_0x20d6('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x20d6('0xd'));var hardwareService=require(_0x20d6('0xe'));var logger=require(_0x20d6('0xf'))(_0x20d6('0x10'));var utils=require(_0x20d6('0x11'));var config=require('../../config/environment');var db=require(_0x20d6('0x12'))['db'];function respondWithStatusCode(_0x416345,_0x3bf2e8){_0x3bf2e8=_0x3bf2e8||0xcc;return function(_0xd92c50){if(_0xd92c50){return _0x416345['sendStatus'](_0x3bf2e8);}return _0x416345['status'](_0x3bf2e8)[_0x20d6('0x13')]();};}function respondWithResult(_0x3798c6,_0x44b4fb){_0x44b4fb=_0x44b4fb||0xc8;return function(_0x5ebff9){if(_0x5ebff9){return _0x3798c6[_0x20d6('0x14')](_0x44b4fb)[_0x20d6('0x15')](_0x5ebff9);}};}function respondWithFilteredResult(_0x431bfa,_0x28d802){return function(_0x1aa7cb){if(_0x1aa7cb){var _0x4f089d=_0x1aa7cb[_0x20d6('0x16')],_0x5ea89c=_0x28d802[_0x20d6('0x17')],_0x3822fe=_0x28d802[_0x20d6('0x17')]+_0x28d802[_0x20d6('0x18')],_0x2507cd;if(_0x3822fe>=_0x4f089d){_0x3822fe=_0x4f089d;_0x2507cd=0xc8;}else{_0x2507cd=0xce;}_0x431bfa[_0x20d6('0x14')](_0x2507cd);return _0x431bfa[_0x20d6('0x19')](_0x20d6('0x1a'),_0x5ea89c+'-'+_0x3822fe+'/'+_0x4f089d)[_0x20d6('0x15')](_0x1aa7cb);}return null;};}function patchUpdates(_0x432b89){return function(_0x229a4d){try{jsonpatch[_0x20d6('0x1b')](_0x229a4d,_0x432b89,!![]);}catch(_0x4b5229){return BPromise[_0x20d6('0x1c')](_0x4b5229);}return _0x229a4d[_0x20d6('0x1d')]();};}function saveUpdates(_0x35f48b,_0x26d6e3){return function(_0xf31fa){if(_0xf31fa){return _0xf31fa['update'](_0x35f48b)[_0x20d6('0x1e')](function(_0x4ea238){return _0x4ea238;});}return null;};}function removeEntity(_0x4425da,_0x22bfc5){return function(_0xc7649c){if(_0xc7649c){return _0xc7649c[_0x20d6('0x1f')]()['then'](function(){_0x4425da[_0x20d6('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x306cec,_0x44aaec){return function(_0x2b0d52){if(!_0x2b0d52){_0x306cec['sendStatus'](0x194);}return _0x2b0d52;};}function handleError(_0x9523e3,_0x5eadbb){_0x5eadbb=_0x5eadbb||0x1f4;return function(_0x54d6e3){logger[_0x20d6('0x20')](_0x54d6e3[_0x20d6('0x21')]);if(_0x54d6e3['name']){delete _0x54d6e3[_0x20d6('0x22')];}_0x9523e3[_0x20d6('0x14')](_0x5eadbb)['send'](_0x54d6e3);};}exports[_0x20d6('0x23')]=function(_0x12af58,_0x1b159d){var _0x26b04e={},_0x2fef91={},_0x560f06={'count':0x0,'rows':[]};var _0x4fc91a=_[_0x20d6('0x24')](db['UserProfileSection'][_0x20d6('0x25')],function(_0x11a39e){return{'name':_0x11a39e[_0x20d6('0x26')],'type':_0x11a39e['type'][_0x20d6('0x27')]};});_0x2fef91['model']=_[_0x20d6('0x24')](_0x4fc91a,_0x20d6('0x22'));_0x2fef91[_0x20d6('0x28')]=_[_0x20d6('0x29')](_0x12af58['query']);_0x2fef91[_0x20d6('0x2a')]=_[_0x20d6('0x2b')](_0x2fef91[_0x20d6('0x2c')],_0x2fef91[_0x20d6('0x28')]);_0x26b04e[_0x20d6('0x2d')]=_['intersection'](_0x2fef91[_0x20d6('0x2c')],qs[_0x20d6('0x2e')](_0x12af58[_0x20d6('0x28')]['fields']));_0x26b04e[_0x20d6('0x2d')]=_0x26b04e[_0x20d6('0x2d')][_0x20d6('0x2f')]?_0x26b04e[_0x20d6('0x2d')]:_0x2fef91[_0x20d6('0x2c')];if(!_0x12af58['query']['hasOwnProperty'](_0x20d6('0x30'))){_0x26b04e[_0x20d6('0x18')]=qs[_0x20d6('0x18')](_0x12af58[_0x20d6('0x28')][_0x20d6('0x18')]);_0x26b04e[_0x20d6('0x17')]=qs[_0x20d6('0x17')](_0x12af58['query'][_0x20d6('0x17')]);}_0x26b04e[_0x20d6('0x31')]=qs[_0x20d6('0x32')](_0x12af58['query'][_0x20d6('0x32')]);_0x26b04e['where']=qs[_0x20d6('0x2a')](_['pick'](_0x12af58['query'],_0x2fef91[_0x20d6('0x2a')]),_0x4fc91a);if(_0x12af58['query'][_0x20d6('0x33')]){_0x26b04e[_0x20d6('0x34')]=_[_0x20d6('0x35')](_0x26b04e[_0x20d6('0x34')],{'$or':_['map'](_0x4fc91a,function(_0x3d9471){if(_0x3d9471['type']!==_0x20d6('0x36')){var _0xa4d808={};_0xa4d808[_0x3d9471[_0x20d6('0x22')]]={'$like':'%'+_0x12af58[_0x20d6('0x28')]['filter']+'%'};return _0xa4d808;}})});}_0x26b04e=_[_0x20d6('0x35')]({},_0x26b04e,_0x12af58[_0x20d6('0x37')]);var _0x3ac47b={'where':_0x26b04e['where']};return db[_0x20d6('0x38')]['count'](_0x3ac47b)[_0x20d6('0x1e')](function(_0x2edb80){_0x560f06[_0x20d6('0x16')]=_0x2edb80;if(_0x12af58[_0x20d6('0x28')][_0x20d6('0x39')]){_0x26b04e[_0x20d6('0x3a')]=[{'all':!![]}];}return db[_0x20d6('0x38')][_0x20d6('0x3b')](_0x26b04e);})[_0x20d6('0x1e')](function(_0x270c39){_0x560f06[_0x20d6('0x3c')]=_0x270c39;return _0x560f06;})[_0x20d6('0x1e')](respondWithFilteredResult(_0x1b159d,_0x26b04e))[_0x20d6('0x3d')](handleError(_0x1b159d,null));};exports[_0x20d6('0x3e')]=function(_0x14b304,_0xf3c368){var _0x20662f={'raw':![],'where':{'id':_0x14b304[_0x20d6('0x3f')]['id']}},_0x1c12c7={};_0x1c12c7[_0x20d6('0x2c')]=_[_0x20d6('0x29')](db[_0x20d6('0x38')]['rawAttributes']);_0x1c12c7[_0x20d6('0x28')]=_[_0x20d6('0x29')](_0x14b304[_0x20d6('0x28')]);_0x1c12c7[_0x20d6('0x2a')]=_[_0x20d6('0x2b')](_0x1c12c7[_0x20d6('0x2c')],_0x1c12c7[_0x20d6('0x28')]);_0x20662f['attributes']=_[_0x20d6('0x2b')](_0x1c12c7[_0x20d6('0x2c')],qs[_0x20d6('0x2e')](_0x14b304['query'][_0x20d6('0x2e')]));_0x20662f[_0x20d6('0x2d')]=_0x20662f[_0x20d6('0x2d')][_0x20d6('0x2f')]?_0x20662f[_0x20d6('0x2d')]:_0x1c12c7[_0x20d6('0x2c')];if(_0x14b304[_0x20d6('0x28')][_0x20d6('0x39')]){_0x20662f[_0x20d6('0x3a')]=[{'all':!![]}];}_0x20662f=_[_0x20d6('0x35')]({},_0x20662f,_0x14b304[_0x20d6('0x37')]);return db['UserProfileSection']['find'](_0x20662f)[_0x20d6('0x1e')](handleEntityNotFound(_0xf3c368,null))[_0x20d6('0x1e')](respondWithResult(_0xf3c368,null))[_0x20d6('0x3d')](handleError(_0xf3c368,null));};exports['create']=function(_0x440c4f,_0x75ab61){return db['UserProfileSection']['create'](_0x440c4f[_0x20d6('0x40')],{})[_0x20d6('0x1e')](respondWithResult(_0x75ab61,0xc9))[_0x20d6('0x3d')](handleError(_0x75ab61,null));};exports[_0x20d6('0x41')]=function(_0x288178,_0x127f8f){if(_0x288178['body']['id']){delete _0x288178['body']['id'];}return db[_0x20d6('0x38')][_0x20d6('0x42')]({'where':{'id':_0x288178['params']['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x127f8f,null))[_0x20d6('0x1e')](saveUpdates(_0x288178[_0x20d6('0x40')],null))['then'](respondWithResult(_0x127f8f,null))['catch'](handleError(_0x127f8f,null));};exports[_0x20d6('0x1f')]=function(_0x1031fa,_0x319b78){return db[_0x20d6('0x38')][_0x20d6('0x42')]({'where':{'id':_0x1031fa[_0x20d6('0x3f')]['id']}})[_0x20d6('0x1e')](handleEntityNotFound(_0x319b78,null))[_0x20d6('0x1e')](removeEntity(_0x319b78,null))['catch'](handleError(_0x319b78,null));};exports[_0x20d6('0x43')]=function(_0x5af5b0,_0xb4bfb9){return db[_0x20d6('0x38')][_0x20d6('0x43')]()[_0x20d6('0x1e')](respondWithResult(_0xb4bfb9,null))['catch'](handleError(_0xb4bfb9,null));};
\ No newline at end of file
+var _0xcea2=['../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','count','offset','status','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1681eb,_0xe4240f){var _0x41422a=function(_0x1ec184){while(--_0x1ec184){_0x1681eb['push'](_0x1681eb['shift']());}};_0x41422a(++_0xe4240f);}(_0xcea2,0x15a));var _0x2cea=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcea2[_0x525c7b];return _0x27b33e;};'use strict';var pdf=require(_0x2cea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2cea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cea('0x2'));var rp=require(_0x2cea('0x3'));var moment=require(_0x2cea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2cea('0x5'));var util=require(_0x2cea('0x6'));var path=require(_0x2cea('0x7'));var sox=require('sox');var csv=require(_0x2cea('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2cea('0x9'));var squel=require(_0x2cea('0xa'));var crypto=require(_0x2cea('0xb'));var jsforce=require(_0x2cea('0xc'));var deskjs=require(_0x2cea('0xd'));var toCsv=require(_0x2cea('0x8'));var querystring=require('querystring');var Papa=require(_0x2cea('0xe'));var Redis=require(_0x2cea('0xf'));var authService=require(_0x2cea('0x10'));var qs=require(_0x2cea('0x11'));var as=require(_0x2cea('0x12'));var hardwareService=require(_0x2cea('0x13'));var logger=require(_0x2cea('0x14'))(_0x2cea('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2cea('0x16'))['db'];function respondWithStatusCode(_0x2db0ff,_0x528c1d){_0x528c1d=_0x528c1d||0xcc;return function(_0x4bd265){if(_0x4bd265){return _0x2db0ff[_0x2cea('0x17')](_0x528c1d);}return _0x2db0ff['status'](_0x528c1d)[_0x2cea('0x18')]();};}function respondWithResult(_0xc5d08e,_0x4377b1){_0x4377b1=_0x4377b1||0xc8;return function(_0x5cf805){if(_0x5cf805){return _0xc5d08e['status'](_0x4377b1)['json'](_0x5cf805);}};}function respondWithFilteredResult(_0x369c72,_0x586ad5){return function(_0x3c7130){if(_0x3c7130){var _0x338669=_0x3c7130[_0x2cea('0x19')],_0x981e3f=_0x586ad5[_0x2cea('0x1a')],_0x17322c=_0x586ad5[_0x2cea('0x1a')]+_0x586ad5['limit'],_0x232dad;if(_0x17322c>=_0x338669){_0x17322c=_0x338669;_0x232dad=0xc8;}else{_0x232dad=0xce;}_0x369c72[_0x2cea('0x1b')](_0x232dad);return _0x369c72[_0x2cea('0x1c')](_0x2cea('0x1d'),_0x981e3f+'-'+_0x17322c+'/'+_0x338669)[_0x2cea('0x1e')](_0x3c7130);}return null;};}function patchUpdates(_0xa1d749){return function(_0x17dc48){try{jsonpatch['apply'](_0x17dc48,_0xa1d749,!![]);}catch(_0x27375b){return BPromise['reject'](_0x27375b);}return _0x17dc48[_0x2cea('0x1f')]();};}function saveUpdates(_0x5516c8,_0xa73bea){return function(_0x4fd3d5){if(_0x4fd3d5){return _0x4fd3d5[_0x2cea('0x20')](_0x5516c8)[_0x2cea('0x21')](function(_0x210d7e){return _0x210d7e;});}return null;};}function removeEntity(_0x1b389b,_0x3246bc){return function(_0x3f6f0e){if(_0x3f6f0e){return _0x3f6f0e[_0x2cea('0x22')]()['then'](function(){_0x1b389b[_0x2cea('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7d88b9,_0x4926ff){return function(_0x3966d5){if(!_0x3966d5){_0x7d88b9[_0x2cea('0x17')](0x194);}return _0x3966d5;};}function handleError(_0x56807e,_0x41d272){_0x41d272=_0x41d272||0x1f4;return function(_0xd4bd54){logger[_0x2cea('0x23')](_0xd4bd54[_0x2cea('0x24')]);if(_0xd4bd54[_0x2cea('0x25')]){delete _0xd4bd54[_0x2cea('0x25')];}_0x56807e['status'](_0x41d272)[_0x2cea('0x26')](_0xd4bd54);};}exports[_0x2cea('0x27')]=function(_0x2bbe9b,_0x32af98){var _0x46ef5a={},_0x3ea40c={},_0xe99cca={'count':0x0,'rows':[]};var _0x2741cb=_['map'](db[_0x2cea('0x28')][_0x2cea('0x29')],function(_0x5f3fb4){return{'name':_0x5f3fb4[_0x2cea('0x2a')],'type':_0x5f3fb4[_0x2cea('0x2b')][_0x2cea('0x2c')]};});_0x3ea40c[_0x2cea('0x2d')]=_['map'](_0x2741cb,_0x2cea('0x25'));_0x3ea40c[_0x2cea('0x2e')]=_['keys'](_0x2bbe9b[_0x2cea('0x2e')]);_0x3ea40c[_0x2cea('0x2f')]=_[_0x2cea('0x30')](_0x3ea40c[_0x2cea('0x2d')],_0x3ea40c[_0x2cea('0x2e')]);_0x46ef5a[_0x2cea('0x31')]=_[_0x2cea('0x30')](_0x3ea40c[_0x2cea('0x2d')],qs[_0x2cea('0x32')](_0x2bbe9b[_0x2cea('0x2e')][_0x2cea('0x32')]));_0x46ef5a['attributes']=_0x46ef5a[_0x2cea('0x31')][_0x2cea('0x33')]?_0x46ef5a[_0x2cea('0x31')]:_0x3ea40c[_0x2cea('0x2d')];if(!_0x2bbe9b['query']['hasOwnProperty'](_0x2cea('0x34'))){_0x46ef5a[_0x2cea('0x35')]=qs['limit'](_0x2bbe9b[_0x2cea('0x2e')]['limit']);_0x46ef5a[_0x2cea('0x1a')]=qs['offset'](_0x2bbe9b[_0x2cea('0x2e')]['offset']);}_0x46ef5a[_0x2cea('0x36')]=qs[_0x2cea('0x37')](_0x2bbe9b['query'][_0x2cea('0x37')]);_0x46ef5a[_0x2cea('0x38')]=qs['filters'](_[_0x2cea('0x39')](_0x2bbe9b[_0x2cea('0x2e')],_0x3ea40c[_0x2cea('0x2f')]),_0x2741cb);if(_0x2bbe9b[_0x2cea('0x2e')][_0x2cea('0x3a')]){_0x46ef5a['where']=_[_0x2cea('0x3b')](_0x46ef5a[_0x2cea('0x38')],{'$or':_['map'](_0x2741cb,function(_0x53c088){if(_0x53c088[_0x2cea('0x2b')]!=='VIRTUAL'){var _0x4e6bb4={};_0x4e6bb4[_0x53c088['name']]={'$like':'%'+_0x2bbe9b['query'][_0x2cea('0x3a')]+'%'};return _0x4e6bb4;}})});}_0x46ef5a=_[_0x2cea('0x3b')]({},_0x46ef5a,_0x2bbe9b['options']);var _0x219560={'where':_0x46ef5a[_0x2cea('0x38')]};return db[_0x2cea('0x28')]['count'](_0x219560)[_0x2cea('0x21')](function(_0xcc11b6){_0xe99cca[_0x2cea('0x19')]=_0xcc11b6;if(_0x2bbe9b[_0x2cea('0x2e')][_0x2cea('0x3c')]){_0x46ef5a[_0x2cea('0x3d')]=[{'all':!![]}];}return db[_0x2cea('0x28')][_0x2cea('0x3e')](_0x46ef5a);})[_0x2cea('0x21')](function(_0x27677c){_0xe99cca[_0x2cea('0x3f')]=_0x27677c;return _0xe99cca;})[_0x2cea('0x21')](respondWithFilteredResult(_0x32af98,_0x46ef5a))[_0x2cea('0x40')](handleError(_0x32af98,null));};exports[_0x2cea('0x41')]=function(_0x190a29,_0x28bb35){var _0x36efa8={'raw':![],'where':{'id':_0x190a29['params']['id']}},_0xa0692d={};_0xa0692d[_0x2cea('0x2d')]=_['keys'](db[_0x2cea('0x28')][_0x2cea('0x29')]);_0xa0692d[_0x2cea('0x2e')]=_[_0x2cea('0x42')](_0x190a29[_0x2cea('0x2e')]);_0xa0692d[_0x2cea('0x2f')]=_[_0x2cea('0x30')](_0xa0692d[_0x2cea('0x2d')],_0xa0692d[_0x2cea('0x2e')]);_0x36efa8[_0x2cea('0x31')]=_['intersection'](_0xa0692d['model'],qs[_0x2cea('0x32')](_0x190a29[_0x2cea('0x2e')]['fields']));_0x36efa8[_0x2cea('0x31')]=_0x36efa8['attributes'][_0x2cea('0x33')]?_0x36efa8['attributes']:_0xa0692d[_0x2cea('0x2d')];if(_0x190a29[_0x2cea('0x2e')][_0x2cea('0x3c')]){_0x36efa8[_0x2cea('0x3d')]=[{'all':!![]}];}_0x36efa8=_[_0x2cea('0x3b')]({},_0x36efa8,_0x190a29[_0x2cea('0x43')]);return db[_0x2cea('0x28')][_0x2cea('0x44')](_0x36efa8)[_0x2cea('0x21')](handleEntityNotFound(_0x28bb35,null))[_0x2cea('0x21')](respondWithResult(_0x28bb35,null))['catch'](handleError(_0x28bb35,null));};exports[_0x2cea('0x45')]=function(_0x4771a0,_0x123520){return db[_0x2cea('0x28')]['create'](_0x4771a0['body'],{})[_0x2cea('0x21')](respondWithResult(_0x123520,0xc9))[_0x2cea('0x40')](handleError(_0x123520,null));};exports[_0x2cea('0x20')]=function(_0x510e0f,_0x2a5e20){if(_0x510e0f[_0x2cea('0x46')]['id']){delete _0x510e0f[_0x2cea('0x46')]['id'];}return db[_0x2cea('0x28')]['find']({'where':{'id':_0x510e0f[_0x2cea('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a5e20,null))['then'](saveUpdates(_0x510e0f[_0x2cea('0x46')],null))[_0x2cea('0x21')](respondWithResult(_0x2a5e20,null))[_0x2cea('0x40')](handleError(_0x2a5e20,null));};exports[_0x2cea('0x22')]=function(_0x542c10,_0x492fcf){return db[_0x2cea('0x28')][_0x2cea('0x44')]({'where':{'id':_0x542c10[_0x2cea('0x47')]['id']}})[_0x2cea('0x21')](handleEntityNotFound(_0x492fcf,null))['then'](removeEntity(_0x492fcf,null))['catch'](handleError(_0x492fcf,null));};exports['describe']=function(_0x31c559,_0x3e7d11){return db[_0x2cea('0x28')][_0x2cea('0x48')]()[_0x2cea('0x21')](respondWithResult(_0x3e7d11,null))[_0x2cea('0x40')](handleError(_0x3e7d11,null));};
\ No newline at end of file
index c28d1b1..b37ae84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dd5=['lodash','util','../../config/logger','moment','request-promise','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x5db3dc,_0x11452a){var _0x1052ba=function(_0x360601){while(--_0x360601){_0x5db3dc['push'](_0x5db3dc['shift']());}};_0x1052ba(++_0x11452a);}(_0x1dd5,0x1bc));var _0x51dd=function(_0x112ddb,_0x259b69){_0x112ddb=_0x112ddb-0x0;var _0x51fff1=_0x1dd5[_0x112ddb];return _0x51fff1;};'use strict';var _=require(_0x51dd('0x0'));var util=require(_0x51dd('0x1'));var logger=require(_0x51dd('0x2'))('api');var moment=require(_0x51dd('0x3'));var BPromise=require('bluebird');var rp=require(_0x51dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x51dd('0x5'));module[_0x51dd('0x6')]=function(_0x1aa4a0,_0x2292ea){return _0x1aa4a0['define'](_0x51dd('0x7'),attributes,{'tableName':_0x51dd('0x8'),'paranoid':![],'indexes':[{'name':_0x51dd('0x9'),'fields':[_0x51dd('0xa'),_0x51dd('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa641=['compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x53bc38,_0x5a425f){var _0x475614=function(_0x28eba3){while(--_0x28eba3){_0x53bc38['push'](_0x53bc38['shift']());}};_0x475614(++_0x5a425f);}(_0xa641,0x188));var _0x1a64=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xa641[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x1a64('0x0'));var util=require(_0x1a64('0x1'));var logger=require(_0x1a64('0x2'))(_0x1a64('0x3'));var moment=require(_0x1a64('0x4'));var BPromise=require(_0x1a64('0x5'));var rp=require(_0x1a64('0x6'));var fs=require('fs');var path=require(_0x1a64('0x7'));var rimraf=require(_0x1a64('0x8'));var config=require(_0x1a64('0x9'));var attributes=require(_0x1a64('0xa'));module[_0x1a64('0xb')]=function(_0x76c84a,_0x304cdc){return _0x76c84a[_0x1a64('0xc')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x1a64('0xd'),'fields':[_0x1a64('0xe'),'userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
index 6e6042d..f981944 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2c2=['client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','code','message','error','catch','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1f063b,_0x321a3c){var _0x4d864b=function(_0x173dfe){while(--_0x173dfe){_0x1f063b['push'](_0x1f063b['shift']());}};_0x4d864b(++_0x321a3c);}(_0xd2c2,0xae));var _0x2d2c=function(_0x48f9b0,_0x2cc463){_0x48f9b0=_0x48f9b0-0x0;var _0xcba895=_0xd2c2[_0x48f9b0];return _0xcba895;};'use strict';var _=require('lodash');var util=require(_0x2d2c('0x0'));var moment=require('moment');var BPromise=require(_0x2d2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d2c('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d2c('0x3'))(_0x2d2c('0x4'));var config=require(_0x2d2c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2d2c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eb627,_0x1a0d02,_0x5a7b04){return new BPromise(function(_0x2009d9,_0x255d41){return client[_0x2d2c('0x7')](_0x2eb627,_0x5a7b04)[_0x2d2c('0x8')](function(_0x1a7a49){logger[_0x2d2c('0x9')](_0x2d2c('0xa'),_0x1a0d02,_0x2d2c('0xb'));logger[_0x2d2c('0xc')](_0x2d2c('0xd'),_0x1a0d02,_0x2d2c('0xb'),JSON['stringify'](_0x1a7a49));if(_0x1a7a49['error']){if(_0x1a7a49['error'][_0x2d2c('0xe')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x1a0d02,_0x1a7a49['error'][_0x2d2c('0xf')]);return _0x255d41(_0x1a7a49[_0x2d2c('0x10')]['message']);}logger[_0x2d2c('0x10')](_0x2d2c('0xa'),_0x1a0d02,_0x1a7a49['error']['message']);return _0x2009d9(_0x1a7a49[_0x2d2c('0x10')]['message']);}else{logger['info'](_0x2d2c('0xa'),_0x1a0d02,_0x2d2c('0xb'));_0x2009d9(_0x1a7a49['result'][_0x2d2c('0xf')]);}})[_0x2d2c('0x11')](function(_0x2bc299){logger[_0x2d2c('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x1a0d02,_0x2bc299);_0x255d41(_0x2bc299);});});}
\ No newline at end of file
+var _0x653e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','UserProfileSection,\x20%s,\x20%s','message'];(function(_0x48cc4a,_0x4de959){var _0xe5cb20=function(_0x1af55c){while(--_0x1af55c){_0x48cc4a['push'](_0x48cc4a['shift']());}};_0xe5cb20(++_0x4de959);}(_0x653e,0xba));var _0xe653=function(_0x3ccc44,_0x207b0c){_0x3ccc44=_0x3ccc44-0x0;var _0x5d74bb=_0x653e[_0x3ccc44];return _0x5d74bb;};'use strict';var _=require(_0xe653('0x0'));var util=require(_0xe653('0x1'));var moment=require(_0xe653('0x2'));var BPromise=require(_0xe653('0x3'));var rs=require(_0xe653('0x4'));var fs=require('fs');var Redis=require(_0xe653('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe653('0x6'));var logger=require(_0xe653('0x7'))(_0xe653('0x8'));var config=require(_0xe653('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe653('0xa')][_0xe653('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x294765,_0x428d94,_0x298453){return new BPromise(function(_0x169ee0,_0x4436b8){return client[_0xe653('0xc')](_0x294765,_0x298453)[_0xe653('0xd')](function(_0x2d0aa5){logger[_0xe653('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x428d94,'request\x20sent');logger[_0xe653('0xf')](_0xe653('0x10'),_0x428d94,_0xe653('0x11'),JSON['stringify'](_0x2d0aa5));if(_0x2d0aa5[_0xe653('0x12')]){if(_0x2d0aa5[_0xe653('0x12')]['code']===0x1f4){logger[_0xe653('0x12')](_0xe653('0x13'),_0x428d94,_0x2d0aa5[_0xe653('0x12')][_0xe653('0x14')]);return _0x4436b8(_0x2d0aa5['error'][_0xe653('0x14')]);}logger[_0xe653('0x12')](_0xe653('0x13'),_0x428d94,_0x2d0aa5['error']['message']);return _0x169ee0(_0x2d0aa5[_0xe653('0x12')]['message']);}else{logger[_0xe653('0xe')](_0xe653('0x13'),_0x428d94,'request\x20sent');_0x169ee0(_0x2d0aa5[_0xe653('0x15')][_0xe653('0x14')]);}})[_0xe653('0x16')](function(_0x5415dd){logger[_0xe653('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x428d94,_0x5415dd);_0x4436b8(_0x5415dd);});});}
\ No newline at end of file
index 7f56fef..828ffb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2129=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3fb467,_0x774a89){var _0x3b1c2f=function(_0x250229){while(--_0x250229){_0x3fb467['push'](_0x3fb467['shift']());}};_0x3b1c2f(++_0x774a89);}(_0x2129,0x90));var _0x9212=function(_0x521049,_0xb06cd3){_0x521049=_0x521049-0x0;var _0x466daa=_0x2129[_0x521049];return _0x466daa;};'use strict';var multer=require(_0x9212('0x0'));var util=require(_0x9212('0x1'));var path=require(_0x9212('0x2'));var timeout=require(_0x9212('0x3'));var express=require('express');var router=express[_0x9212('0x4')]();var auth=require(_0x9212('0x5'));var interaction=require(_0x9212('0x6'));var config=require(_0x9212('0x7'));module['exports']=router;
\ No newline at end of file
+var _0x1670=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5d0f24,_0xb8072f){var _0x4fb7d1=function(_0x4eace1){while(--_0x4eace1){_0x5d0f24['push'](_0x5d0f24['shift']());}};_0x4fb7d1(++_0xb8072f);}(_0x1670,0x9a));var _0x0167=function(_0x3c595a,_0x516743){_0x3c595a=_0x3c595a-0x0;var _0x89be42=_0x1670[_0x3c595a];return _0x89be42;};'use strict';var multer=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var path=require('path');var timeout=require(_0x0167('0x2'));var express=require('express');var router=express[_0x0167('0x3')]();var auth=require(_0x0167('0x4'));var interaction=require(_0x0167('0x5'));var config=require(_0x0167('0x6'));module['exports']=router;
\ No newline at end of file
index b585e93..57d2721 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['exports','sequelize'];(function(_0x1f6a60,_0x1465de){var _0x526310=function(_0x18fef2){while(--_0x18fef2){_0x1f6a60['push'](_0x1f6a60['shift']());}};_0x526310(++_0x1465de);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x160e3c,_0x50f7cb){var _0x4aaf9c=function(_0x26d562){while(--_0x26d562){_0x160e3c['push'](_0x160e3c['shift']());}};_0x4aaf9c(++_0x50f7cb);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index ac68d81..1f16f3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f5a=['lodash','util','api','bluebird','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0x282316,_0x18e6fa){var _0x12cb0d=function(_0x1996f2){while(--_0x1996f2){_0x282316['push'](_0x282316['shift']());}};_0x12cb0d(++_0x18e6fa);}(_0x6f5a,0x168));var _0xa6f5=function(_0x6a92eb,_0x5a2f77){_0x6a92eb=_0x6a92eb-0x0;var _0x3c627b=_0x6f5a[_0x6a92eb];return _0x3c627b;};'use strict';var _=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var logger=require('../../config/logger')(_0xa6f5('0x2'));var moment=require('moment');var BPromise=require(_0xa6f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa6f5('0x4'));var attributes=require(_0xa6f5('0x5'));module[_0xa6f5('0x6')]=function(_0x195569,_0x168ba0){return _0x195569[_0xa6f5('0x7')]('UserSmsQueue',attributes,{'tableName':_0xa6f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e95=['define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x3b37cb,_0x427328){var _0x1c4933=function(_0x41f8d6){while(--_0x41f8d6){_0x3b37cb['push'](_0x3b37cb['shift']());}};_0x1c4933(++_0x427328);}(_0x5e95,0x13b));var _0x55e9=function(_0x38b2d8,_0x39ce86){_0x38b2d8=_0x38b2d8-0x0;var _0x492c43=_0x5e95[_0x38b2d8];return _0x492c43;};'use strict';var _=require(_0x55e9('0x0'));var util=require(_0x55e9('0x1'));var logger=require(_0x55e9('0x2'))('api');var moment=require(_0x55e9('0x3'));var BPromise=require(_0x55e9('0x4'));var rp=require(_0x55e9('0x5'));var fs=require('fs');var path=require(_0x55e9('0x6'));var rimraf=require('rimraf');var config=require(_0x55e9('0x7'));var attributes=require(_0x55e9('0x8'));module[_0x55e9('0x9')]=function(_0x14f849,_0x56363a){return _0x14f849[_0x55e9('0xa')](_0x55e9('0xb'),attributes,{'tableName':_0x55e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3b62a13..3f4cc2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a86=['request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2b68bf,_0x1eee6b){var _0x4fa327=function(_0x5ea7ee){while(--_0x5ea7ee){_0x2b68bf['push'](_0x2b68bf['shift']());}};_0x4fa327(++_0x1eee6b);}(_0x1a86,0x89));var _0x61a8=function(_0x7f018c,_0x309959){_0x7f018c=_0x7f018c-0x0;var _0x2538cb=_0x1a86[_0x7f018c];return _0x2538cb;};'use strict';var _=require(_0x61a8('0x0'));var util=require(_0x61a8('0x1'));var moment=require(_0x61a8('0x2'));var BPromise=require(_0x61a8('0x3'));var rs=require(_0x61a8('0x4'));var fs=require('fs');var Redis=require(_0x61a8('0x5'));var db=require(_0x61a8('0x6'))['db'];var utils=require(_0x61a8('0x7'));var logger=require(_0x61a8('0x8'))(_0x61a8('0x9'));var config=require(_0x61a8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x61a8('0xb')][_0x61a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ed4c4,_0x121c42,_0x15f8fe){return new BPromise(function(_0x34c052,_0xd046eb){return client[_0x61a8('0xd')](_0x5ed4c4,_0x15f8fe)[_0x61a8('0xe')](function(_0x4e5534){logger[_0x61a8('0xf')](_0x61a8('0x10'),_0x121c42,_0x61a8('0x11'));logger[_0x61a8('0x12')](_0x61a8('0x13'),_0x121c42,_0x61a8('0x11'),JSON[_0x61a8('0x14')](_0x4e5534));if(_0x4e5534['error']){if(_0x4e5534[_0x61a8('0x15')][_0x61a8('0x16')]===0x1f4){logger[_0x61a8('0x15')](_0x61a8('0x10'),_0x121c42,_0x4e5534['error'][_0x61a8('0x17')]);return _0xd046eb(_0x4e5534[_0x61a8('0x15')]['message']);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x121c42,_0x4e5534[_0x61a8('0x15')][_0x61a8('0x17')]);return _0x34c052(_0x4e5534[_0x61a8('0x15')][_0x61a8('0x17')]);}else{logger[_0x61a8('0xf')](_0x61a8('0x10'),_0x121c42,_0x61a8('0x11'));_0x34c052(_0x4e5534[_0x61a8('0x18')]['message']);}})['catch'](function(_0x4098d0){logger[_0x61a8('0x15')](_0x61a8('0x10'),_0x121c42,_0x4098d0);_0xd046eb(_0x4098d0);});});}
\ No newline at end of file
+var _0xaa0e=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xeda6fe,_0x1231e5){var _0x4bda28=function(_0x32ec36){while(--_0x32ec36){_0xeda6fe['push'](_0xeda6fe['shift']());}};_0x4bda28(++_0x1231e5);}(_0xaa0e,0xd1));var _0xeaa0=function(_0x1b5a05,_0x2c80de){_0x1b5a05=_0x1b5a05-0x0;var _0x347931=_0xaa0e[_0x1b5a05];return _0x347931;};'use strict';var _=require(_0xeaa0('0x0'));var util=require(_0xeaa0('0x1'));var moment=require('moment');var BPromise=require(_0xeaa0('0x2'));var rs=require(_0xeaa0('0x3'));var fs=require('fs');var Redis=require(_0xeaa0('0x4'));var db=require(_0xeaa0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeaa0('0x6'))(_0xeaa0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeaa0('0x8')][_0xeaa0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d5520,_0x5b40a0,_0x4a4a5a){return new BPromise(function(_0x328581,_0x356962){return client[_0xeaa0('0xa')](_0x2d5520,_0x4a4a5a)[_0xeaa0('0xb')](function(_0xea90f8){logger[_0xeaa0('0xc')](_0xeaa0('0xd'),_0x5b40a0,_0xeaa0('0xe'));logger[_0xeaa0('0xf')](_0xeaa0('0x10'),_0x5b40a0,_0xeaa0('0xe'),JSON[_0xeaa0('0x11')](_0xea90f8));if(_0xea90f8[_0xeaa0('0x12')]){if(_0xea90f8[_0xeaa0('0x12')][_0xeaa0('0x13')]===0x1f4){logger[_0xeaa0('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x5b40a0,_0xea90f8[_0xeaa0('0x12')][_0xeaa0('0x14')]);return _0x356962(_0xea90f8[_0xeaa0('0x12')][_0xeaa0('0x14')]);}logger[_0xeaa0('0x12')](_0xeaa0('0xd'),_0x5b40a0,_0xea90f8[_0xeaa0('0x12')][_0xeaa0('0x14')]);return _0x328581(_0xea90f8[_0xeaa0('0x12')]['message']);}else{logger[_0xeaa0('0xc')](_0xeaa0('0xd'),_0x5b40a0,'request\x20sent');_0x328581(_0xea90f8[_0xeaa0('0x15')]['message']);}})[_0xeaa0('0x16')](function(_0x29a142){logger[_0xeaa0('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x5b40a0,_0x29a142);_0x356962(_0x29a142);});});}
\ No newline at end of file
index 53483d4..06d5a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce50=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x257d79,_0x22c679){var _0x450417=function(_0x3a846b){while(--_0x3a846b){_0x257d79['push'](_0x257d79['shift']());}};_0x450417(++_0x22c679);}(_0xce50,0x12b));var _0x0ce5=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xce50[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0x0ce5('0x0'));var util=require(_0x0ce5('0x1'));var path=require('path');var timeout=require(_0x0ce5('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0ce5('0x3'));var interaction=require(_0x0ce5('0x4'));var config=require(_0x0ce5('0x5'));module[_0x0ce5('0x6')]=router;
\ No newline at end of file
+var _0xb878=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb878,0x1aa));var _0x8b87=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb878[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x8b87('0x0'));var util=require('util');var path=require(_0x8b87('0x1'));var timeout=require(_0x8b87('0x2'));var express=require('express');var router=express[_0x8b87('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8b87('0x4'));var config=require(_0x8b87('0x5'));module[_0x8b87('0x6')]=router;
\ No newline at end of file
index ac589b0..aa2d03f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x35f36d,_0x3c2b41){var _0x322cd1=function(_0xb764dc){while(--_0xb764dc){_0x35f36d['push'](_0x35f36d['shift']());}};_0x322cd1(++_0x3c2b41);}(_0xe706,0xa3));var _0x6e70=function(_0x550ef9,_0x3a9b13){_0x550ef9=_0x550ef9-0x0;var _0x252d95=_0xe706[_0x550ef9];return _0x252d95;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x5d8afd,_0xd7f769){var _0x336c61=function(_0x539e58){while(--_0x539e58){_0x5d8afd['push'](_0x5d8afd['shift']());}};_0x336c61(++_0xd7f769);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index a3021af..dc9efd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x303a=['bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','../../config/logger','api','moment'];(function(_0x31a0bb,_0x2feebd){var _0x2972b1=function(_0x5ea2da){while(--_0x5ea2da){_0x31a0bb['push'](_0x31a0bb['shift']());}};_0x2972b1(++_0x2feebd);}(_0x303a,0x1a0));var _0xa303=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x303a[_0x3a833e];return _0xdff445;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var moment=require(_0xa303('0x3'));var BPromise=require(_0xa303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa303('0x5'));var rimraf=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var attributes=require(_0xa303('0x8'));module[_0xa303('0x9')]=function(_0x1c7ee9,_0x2bc3d7){return _0x1c7ee9[_0xa303('0xa')](_0xa303('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac31=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','UserVoiceQueue','user_has_voice_queues','lodash','util'];(function(_0x405c31,_0x3e7409){var _0x758b03=function(_0x216202){while(--_0x216202){_0x405c31['push'](_0x405c31['shift']());}};_0x758b03(++_0x3e7409);}(_0xac31,0xca));var _0x1ac3=function(_0x1cf551,_0x5cdc5a){_0x1cf551=_0x1cf551-0x0;var _0x4965d0=_0xac31[_0x1cf551];return _0x4965d0;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0xbe22b7,_0x20027f){return _0xbe22b7[_0x1ac3('0x9')](_0x1ac3('0xa'),attributes,{'tableName':_0x1ac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c974271..5dd3997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe36e=['message','UserVoiceQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d995d,_0x4e835b){var _0x4c97c0=function(_0x5c6378){while(--_0x5c6378){_0x5d995d['push'](_0x5d995d['shift']());}};_0x4c97c0(++_0x4e835b);}(_0xe36e,0x164));var _0xee36=function(_0x356f4d,_0x43457f){_0x356f4d=_0x356f4d-0x0;var _0x5c322e=_0xe36e[_0x356f4d];return _0x5c322e;};'use strict';var _=require(_0xee36('0x0'));var util=require(_0xee36('0x1'));var moment=require(_0xee36('0x2'));var BPromise=require(_0xee36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee36('0x4'))['db'];var utils=require(_0xee36('0x5'));var logger=require('../../config/logger')(_0xee36('0x6'));var config=require(_0xee36('0x7'));var jayson=require(_0xee36('0x8'));var client=jayson[_0xee36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x135376,_0xada95b,_0x4a26cb){return new BPromise(function(_0x5c2840,_0x5aae6c){return client[_0xee36('0xa')](_0x135376,_0x4a26cb)[_0xee36('0xb')](function(_0x2ac4d6){logger[_0xee36('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0xada95b,_0xee36('0xd'));logger[_0xee36('0xe')](_0xee36('0xf'),_0xada95b,_0xee36('0xd'),JSON[_0xee36('0x10')](_0x2ac4d6));if(_0x2ac4d6[_0xee36('0x11')]){if(_0x2ac4d6[_0xee36('0x11')]['code']===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0xada95b,_0x2ac4d6['error']['message']);return _0x5aae6c(_0x2ac4d6['error'][_0xee36('0x12')]);}logger[_0xee36('0x11')](_0xee36('0x13'),_0xada95b,_0x2ac4d6[_0xee36('0x11')][_0xee36('0x12')]);return _0x5c2840(_0x2ac4d6['error'][_0xee36('0x12')]);}else{logger[_0xee36('0xc')](_0xee36('0x13'),_0xada95b,_0xee36('0xd'));_0x5c2840(_0x2ac4d6[_0xee36('0x14')][_0xee36('0x12')]);}})[_0xee36('0x15')](function(_0x4e96b1){logger['error'](_0xee36('0x13'),_0xada95b,_0x4e96b1);_0x5aae6c(_0x4e96b1);});});}
\ No newline at end of file
+var _0x472d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x417911,_0x45f9bf){var _0xf6fcb3=function(_0x86a81a){while(--_0x86a81a){_0x417911['push'](_0x417911['shift']());}};_0xf6fcb3(++_0x45f9bf);}(_0x472d,0xaf));var _0xd472=function(_0x5e99ac,_0x41ba67){_0x5e99ac=_0x5e99ac-0x0;var _0x3a73ac=_0x472d[_0x5e99ac];return _0x3a73ac;};'use strict';var _=require(_0xd472('0x0'));var util=require('util');var moment=require(_0xd472('0x1'));var BPromise=require(_0xd472('0x2'));var rs=require(_0xd472('0x3'));var fs=require('fs');var Redis=require(_0xd472('0x4'));var db=require(_0xd472('0x5'))['db'];var utils=require(_0xd472('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd472('0x7'));var jayson=require(_0xd472('0x8'));var client=jayson[_0xd472('0x9')][_0xd472('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x536d67,_0x453550,_0x26f9b0){return new BPromise(function(_0x1e4c44,_0x2bd816){return client[_0xd472('0xb')](_0x536d67,_0x26f9b0)['then'](function(_0x23d650){logger[_0xd472('0xc')](_0xd472('0xd'),_0x453550,_0xd472('0xe'));logger[_0xd472('0xf')](_0xd472('0x10'),_0x453550,_0xd472('0xe'),JSON[_0xd472('0x11')](_0x23d650));if(_0x23d650[_0xd472('0x12')]){if(_0x23d650[_0xd472('0x12')][_0xd472('0x13')]===0x1f4){logger['error'](_0xd472('0xd'),_0x453550,_0x23d650['error'][_0xd472('0x14')]);return _0x2bd816(_0x23d650[_0xd472('0x12')][_0xd472('0x14')]);}logger['error'](_0xd472('0xd'),_0x453550,_0x23d650['error'][_0xd472('0x14')]);return _0x1e4c44(_0x23d650[_0xd472('0x12')]['message']);}else{logger['info'](_0xd472('0xd'),_0x453550,_0xd472('0xe'));_0x1e4c44(_0x23d650[_0xd472('0x15')][_0xd472('0x14')]);}})['catch'](function(_0x3b23e9){logger[_0xd472('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x453550,_0x3b23e9);_0x2bd816(_0x3b23e9);});});}
\ No newline at end of file
index 62eea55..d31cba9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7bb=['express','../../components/interaction/service','exports','util','connect-timeout'];(function(_0x8c8176,_0x5360a1){var _0x4dc47b=function(_0x1a7f65){while(--_0x1a7f65){_0x8c8176['push'](_0x8c8176['shift']());}};_0x4dc47b(++_0x5360a1);}(_0xe7bb,0x1bb));var _0xbe7b=function(_0x478bf0,_0xd31796){_0x478bf0=_0x478bf0-0x0;var _0x53cae0=_0xe7bb[_0x478bf0];return _0x53cae0;};'use strict';var multer=require('multer');var util=require(_0xbe7b('0x0'));var path=require('path');var timeout=require(_0xbe7b('0x1'));var express=require(_0xbe7b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbe7b('0x3'));var config=require('../../config/environment');module[_0xbe7b('0x4')]=router;
\ No newline at end of file
+var _0x277f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','express'];(function(_0x271b80,_0x3d59a5){var _0x3a1d0a=function(_0x16a0b9){while(--_0x16a0b9){_0x271b80['push'](_0x271b80['shift']());}};_0x3a1d0a(++_0x3d59a5);}(_0x277f,0x11c));var _0xf277=function(_0x2794c4,_0xda1d01){_0x2794c4=_0x2794c4-0x0;var _0x17c8d3=_0x277f[_0x2794c4];return _0x17c8d3;};'use strict';var multer=require(_0xf277('0x0'));var util=require(_0xf277('0x1'));var path=require(_0xf277('0x2'));var timeout=require('connect-timeout');var express=require(_0xf277('0x3'));var router=express[_0xf277('0x4')]();var auth=require(_0xf277('0x5'));var interaction=require(_0xf277('0x6'));var config=require(_0xf277('0x7'));module[_0xf277('0x8')]=router;
\ No newline at end of file
index 08fe287..ece405f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6855=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x48cdf0,_0x160502){var _0x2192cb=function(_0x34cbb9){while(--_0x34cbb9){_0x48cdf0['push'](_0x48cdf0['shift']());}};_0x2192cb(++_0x160502);}(_0x6855,0xff));var _0x5685=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x6855[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x5685('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5685('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x5685('0x2')},'membername':{'type':Sequelize[_0x5685('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x5685('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x5685('0x3')],'allowNull':![],'unique':_0x5685('0x4'),'comment':_0x5685('0x2')},'VoiceQueueId':{'type':Sequelize[_0x5685('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x5685('0x3')],'allowNull':![],'unique':_0x5685('0x4'),'comment':_0x5685('0x2')},'penalty':{'type':Sequelize[_0x5685('0x1')](0xb),'defaultValue':0x0,'comment':_0x5685('0x2')},'paused':{'type':Sequelize[_0x5685('0x1')](0xb),'defaultValue':0x0,'comment':_0x5685('0x2')}};
\ No newline at end of file
+var _0x44b7=['exports','STRING','Required\x20by\x20Asterisk','INTEGER','queue_interface','sequelize'];(function(_0x3a7854,_0x344616){var _0x2552c3=function(_0x151027){while(--_0x151027){_0x3a7854['push'](_0x3a7854['shift']());}};_0x2552c3(++_0x344616);}(_0x44b7,0x83));var _0x744b=function(_0x59a0d2,_0x4e0f17){_0x59a0d2=_0x59a0d2-0x0;var _0x55bed2=_0x44b7[_0x59a0d2];return _0x55bed2;};'use strict';var Sequelize=require(_0x744b('0x0'));module[_0x744b('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x744b('0x2')],'allowNull':![],'comment':_0x744b('0x3')},'UserId':{'type':Sequelize[_0x744b('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x744b('0x2')],'allowNull':![],'unique':_0x744b('0x5'),'comment':_0x744b('0x3')},'VoiceQueueId':{'type':Sequelize[_0x744b('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x744b('0x2')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x744b('0x4')](0xb),'defaultValue':0x0,'comment':_0x744b('0x3')},'paused':{'type':Sequelize[_0x744b('0x4')](0xb),'defaultValue':0x0,'comment':_0x744b('0x3')}};
\ No newline at end of file
index 727dfcb..c232442 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4bd=['UserVoiceQueueRt','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2d6d0f,_0x3cf2a5){var _0xd2bee6=function(_0x2fc9cd){while(--_0x2fc9cd){_0x2d6d0f['push'](_0x2d6d0f['shift']());}};_0xd2bee6(++_0x3cf2a5);}(_0xa4bd,0x7c));var _0xda4b=function(_0x203664,_0x1536a4){_0x203664=_0x203664-0x0;var _0x992217=_0xa4bd[_0x203664];return _0x992217;};'use strict';var EventEmitter=require(_0xda4b('0x0'));var UserVoiceQueueRt=require(_0xda4b('0x1'))['db'][_0xda4b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xda4b('0x3')](0x0);var events={'afterCreate':_0xda4b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x53617a){return function(_0xf83c1e,_0x2b84ea,_0x43e8bc){UserVoiceQueueRtEvents[_0xda4b('0x5')](_0x53617a+':'+_0xf83c1e['id'],_0xf83c1e);UserVoiceQueueRtEvents[_0xda4b('0x5')](_0x53617a,_0xf83c1e);_0x43e8bc(null);};}for(var e in events){if(events[_0xda4b('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xda4b('0x7')](e,emitEvent(event));}}module[_0xda4b('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x1e56=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove','emit','exports','events'];(function(_0x3737ce,_0xf0b190){var _0xef4f6e=function(_0x1d5951){while(--_0x1d5951){_0x3737ce['push'](_0x3737ce['shift']());}};_0xef4f6e(++_0xf0b190);}(_0x1e56,0x18f));var _0x61e5=function(_0x49ab2c,_0x409d2f){_0x49ab2c=_0x49ab2c-0x0;var _0xb4a7c3=_0x1e56[_0x49ab2c];return _0xb4a7c3;};'use strict';var EventEmitter=require(_0x61e5('0x0'));var UserVoiceQueueRt=require(_0x61e5('0x1'))['db'][_0x61e5('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x61e5('0x3')](0x0);var events={'afterCreate':_0x61e5('0x4'),'afterUpdate':'update','afterDestroy':_0x61e5('0x5')};function emitEvent(_0x3ef6d6){return function(_0x185cbd,_0x3dc494,_0x4d858a){UserVoiceQueueRtEvents[_0x61e5('0x6')](_0x3ef6d6+':'+_0x185cbd['id'],_0x185cbd);UserVoiceQueueRtEvents['emit'](_0x3ef6d6,_0x185cbd);_0x4d858a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x61e5('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index fd0e96b..38c975b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x183e=['request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','lodash','util','bluebird'];(function(_0x3779e6,_0x57b812){var _0x1f8670=function(_0xc6e1a0){while(--_0xc6e1a0){_0x3779e6['push'](_0x3779e6['shift']());}};_0x1f8670(++_0x57b812);}(_0x183e,0xd5));var _0xe183=function(_0x4ffe57,_0x4f695e){_0x4ffe57=_0x4ffe57-0x0;var _0x4fb19c=_0x183e[_0x4ffe57];return _0x4fb19c;};'use strict';var _=require(_0xe183('0x0'));var util=require(_0xe183('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe183('0x2'));var rp=require(_0xe183('0x3'));var fs=require('fs');var path=require(_0xe183('0x4'));var rimraf=require(_0xe183('0x5'));var config=require('../../config/environment');var attributes=require(_0xe183('0x6'));module[_0xe183('0x7')]=function(_0x375ebd,_0x139b92){return _0x375ebd['define'](_0xe183('0x8'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8c3=['path','../../config/environment','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xd8c3,0x119));var _0x3d8c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd8c3[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x3d8c('0x0'));var util=require(_0x3d8c('0x1'));var logger=require(_0x3d8c('0x2'))(_0x3d8c('0x3'));var moment=require(_0x3d8c('0x4'));var BPromise=require(_0x3d8c('0x5'));var rp=require(_0x3d8c('0x6'));var fs=require('fs');var path=require(_0x3d8c('0x7'));var rimraf=require('rimraf');var config=require(_0x3d8c('0x8'));var attributes=require(_0x3d8c('0x9'));module['exports']=function(_0x16ff87,_0x2ebf59){return _0x16ff87['define'](_0x3d8c('0xa'),attributes,{'tableName':_0x3d8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3b0d101..79a882d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f2=['then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request'];(function(_0x1055b8,_0x3937e8){var _0x168906=function(_0x4d8919){while(--_0x4d8919){_0x1055b8['push'](_0x1055b8['shift']());}};_0x168906(++_0x3937e8);}(_0x73f2,0x1ad));var _0x273f=function(_0x518aaf,_0x4b3876){_0x518aaf=_0x518aaf-0x0;var _0x13dba8=_0x73f2[_0x518aaf];return _0x13dba8;};'use strict';var _=require('lodash');var util=require(_0x273f('0x0'));var moment=require(_0x273f('0x1'));var BPromise=require(_0x273f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x273f('0x3'));var db=require(_0x273f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x273f('0x5'))(_0x273f('0x6'));var config=require('../../config/environment');var jayson=require(_0x273f('0x7'));var client=jayson['client'][_0x273f('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x273f('0x9')],{'host':_0x273f('0xa'),'port':0x18eb});var socket=require(_0x273f('0xb'))(new Redis(config['redis']));require(_0x273f('0xc'))[_0x273f('0xd')](socket);function respondWithRpcPromise(_0x35d120,_0x4e1260,_0x3743b3){return new BPromise(function(_0x5a4188,_0x57b926){return client[_0x273f('0xe')](_0x35d120,_0x3743b3)[_0x273f('0xf')](function(_0x3840f2){logger[_0x273f('0x10')](_0x273f('0x11'),_0x4e1260,_0x273f('0x12'));logger[_0x273f('0x13')](_0x273f('0x14'),_0x4e1260,_0x273f('0x12'),JSON[_0x273f('0x15')](_0x3840f2));if(_0x3840f2[_0x273f('0x16')]){if(_0x3840f2[_0x273f('0x16')][_0x273f('0x17')]===0x1f4){logger['error'](_0x273f('0x11'),_0x4e1260,_0x3840f2[_0x273f('0x16')]['message']);return _0x57b926(_0x3840f2[_0x273f('0x16')][_0x273f('0x18')]);}logger[_0x273f('0x16')](_0x273f('0x11'),_0x4e1260,_0x3840f2['error'][_0x273f('0x18')]);return _0x5a4188(_0x3840f2['error'][_0x273f('0x18')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4e1260,_0x273f('0x12'));_0x5a4188(_0x3840f2[_0x273f('0x19')][_0x273f('0x18')]);}})[_0x273f('0x1a')](function(_0x4ef738){logger['error'](_0x273f('0x11'),_0x4e1260,_0x4ef738);_0x57b926(_0x4ef738);});});}exports['GetVoiceQueueRtPauses']=function(_0x4e740f){var _0x410d61=this;return new Promise(function(_0x3fffb2,_0x21dabc){return db[_0x273f('0x1b')]['findAll']({'raw':_0x4e740f[_0x273f('0x1c')]?_0x4e740f[_0x273f('0x1c')][_0x273f('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e740f['options']?_0x4e740f[_0x273f('0x1c')][_0x273f('0x1e')]||null:null,'attributes':[[db[_0x273f('0x1f')]['fn'](_0x273f('0x20'),db[_0x273f('0x1f')]['fn']('IF',db[_0x273f('0x1f')][_0x273f('0x21')](_0x273f('0x22')))),_0x273f('0x23')]]})[_0x273f('0xf')](function(_0x3d499d){logger[_0x273f('0x10')](_0x273f('0x24'),_0x4e740f);logger[_0x273f('0x13')](_0x273f('0x24'),_0x4e740f,JSON['stringify'](_0x3d499d));_0x3fffb2(_0x3d499d);})[_0x273f('0x1a')](function(_0x5c9a47){logger['error'](_0x273f('0x24'),_0x5c9a47['message'],_0x4e740f);_0x21dabc(_0x410d61[_0x273f('0x16')](0x1f4,_0x5c9a47[_0x273f('0x18')]));});});};
\ No newline at end of file
+var _0xb499=['outboundQueuePauses','debug','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xb499,0x150));var _0x9b49=function(_0x58d08f,_0x53fdfd){_0x58d08f=_0x58d08f-0x0;var _0x1f447f=_0xb499[_0x58d08f];return _0x1f447f;};'use strict';var _=require(_0x9b49('0x0'));var util=require(_0x9b49('0x1'));var moment=require(_0x9b49('0x2'));var BPromise=require(_0x9b49('0x3'));var rs=require(_0x9b49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b49('0x5'))['db'];var utils=require(_0x9b49('0x6'));var logger=require(_0x9b49('0x7'))(_0x9b49('0x8'));var config=require(_0x9b49('0x9'));var jayson=require(_0x9b49('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x9b49('0xb')]=_[_0x9b49('0xc')](config[_0x9b49('0xb')],{'host':_0x9b49('0xd'),'port':0x18eb});var socket=require(_0x9b49('0xe'))(new Redis(config[_0x9b49('0xb')]));require('./userVoiceQueueRt.socket')[_0x9b49('0xf')](socket);function respondWithRpcPromise(_0xa198c0,_0x31f87a,_0x3a02db){return new BPromise(function(_0x367143,_0x2a6351){return client['request'](_0xa198c0,_0x3a02db)[_0x9b49('0x10')](function(_0x2828c3){logger[_0x9b49('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x31f87a,_0x9b49('0x12'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x31f87a,_0x9b49('0x12'),JSON[_0x9b49('0x13')](_0x2828c3));if(_0x2828c3['error']){if(_0x2828c3[_0x9b49('0x14')][_0x9b49('0x15')]===0x1f4){logger[_0x9b49('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x31f87a,_0x2828c3[_0x9b49('0x14')]['message']);return _0x2a6351(_0x2828c3[_0x9b49('0x14')][_0x9b49('0x16')]);}logger[_0x9b49('0x14')](_0x9b49('0x17'),_0x31f87a,_0x2828c3[_0x9b49('0x14')][_0x9b49('0x16')]);return _0x367143(_0x2828c3['error'][_0x9b49('0x16')]);}else{logger[_0x9b49('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x31f87a,_0x9b49('0x12'));_0x367143(_0x2828c3[_0x9b49('0x18')][_0x9b49('0x16')]);}})['catch'](function(_0x37f685){logger[_0x9b49('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x31f87a,_0x37f685);_0x2a6351(_0x37f685);});});}exports[_0x9b49('0x19')]=function(_0x5dbdd3){var _0x931827=this;return new Promise(function(_0x38c17c,_0x2544fa){return db[_0x9b49('0x1a')][_0x9b49('0x1b')]({'raw':_0x5dbdd3[_0x9b49('0x1c')]?_0x5dbdd3['options'][_0x9b49('0x1d')]===undefined?!![]:![]:!![],'where':_0x5dbdd3[_0x9b49('0x1c')]?_0x5dbdd3[_0x9b49('0x1c')][_0x9b49('0x1e')]||null:null,'attributes':[[db[_0x9b49('0x1f')]['fn'](_0x9b49('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x9b49('0x21')))),_0x9b49('0x22')]]})['then'](function(_0x29e58a){logger['info'](_0x9b49('0x19'),_0x5dbdd3);logger[_0x9b49('0x23')](_0x9b49('0x19'),_0x5dbdd3,JSON['stringify'](_0x29e58a));_0x38c17c(_0x29e58a);})[_0x9b49('0x24')](function(_0x4b75bd){logger['error'](_0x9b49('0x19'),_0x4b75bd['message'],_0x5dbdd3);_0x2544fa(_0x931827[_0x9b49('0x14')](0x1f4,_0x4b75bd[_0x9b49('0x16')]));});});};
\ No newline at end of file
index ab6e70f..45d2560 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e44=['save','remove','update','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x4e44,0x197));var _0x44e4=function(_0x34b20c,_0x580aac){_0x34b20c=_0x34b20c-0x0;var _0xa847d9=_0x4e44[_0x34b20c];return _0xa847d9;};'use strict';var UserVoiceQueueRtEvents=require(_0x44e4('0x0'));var events=[_0x44e4('0x1'),_0x44e4('0x2'),_0x44e4('0x3')];function createListener(_0x596139,_0xebe6a1){return function(_0x152b27){_0xebe6a1[_0x44e4('0x4')](_0x596139,_0x152b27);};}function removeListener(_0x1f4e6e,_0x1e2a18){return function(){UserVoiceQueueRtEvents[_0x44e4('0x5')](_0x1f4e6e,_0x1e2a18);};}exports['register']=function(_0x2f9796){for(var _0x2bd50e=0x0,_0x45fd4f=events[_0x44e4('0x6')];_0x2bd50e<_0x45fd4f;_0x2bd50e++){var _0x14955d=events[_0x2bd50e];var _0xa0eca6=createListener(_0x44e4('0x7')+_0x14955d,_0x2f9796);UserVoiceQueueRtEvents['on'](_0x14955d,_0xa0eca6);}};
\ No newline at end of file
+var _0x5811=['save','remove','emit','register','./userVoiceQueueRt.events'];(function(_0x3937e7,_0x91712b){var _0x197ad7=function(_0x16e5b2){while(--_0x16e5b2){_0x3937e7['push'](_0x3937e7['shift']());}};_0x197ad7(++_0x91712b);}(_0x5811,0x185));var _0x1581=function(_0x28e3d5,_0xe3971c){_0x28e3d5=_0x28e3d5-0x0;var _0x3b0327=_0x5811[_0x28e3d5];return _0x3b0327;};'use strict';var UserVoiceQueueRtEvents=require(_0x1581('0x0'));var events=[_0x1581('0x1'),_0x1581('0x2'),'update'];function createListener(_0x2a16e9,_0x5025c3){return function(_0x141255){_0x5025c3[_0x1581('0x3')](_0x2a16e9,_0x141255);};}function removeListener(_0x4a3e6e,_0x477bcb){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4a3e6e,_0x477bcb);};}exports[_0x1581('0x4')]=function(_0x42c35d){for(var _0x599737=0x0,_0x43d9d5=events['length'];_0x599737<_0x43d9d5;_0x599737++){var _0x19bb77=events[_0x599737];var _0x1ec38d=createListener('userVoiceQueueRt:'+_0x19bb77,_0x42c35d);UserVoiceQueueRtEvents['on'](_0x19bb77,_0x1ec38d);}};
\ No newline at end of file
index ceb94a8..f37cabe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f9=['../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x3b5b63,_0x155b5c){var _0x5cb42a=function(_0x42c17e){while(--_0x42c17e){_0x3b5b63['push'](_0x3b5b63['shift']());}};_0x5cb42a(++_0x155b5c);}(_0x04f9,0xb3));var _0x904f=function(_0x51e2ed,_0x1f5c16){_0x51e2ed=_0x51e2ed-0x0;var _0x490743=_0x04f9[_0x51e2ed];return _0x490743;};'use strict';var multer=require('multer');var util=require(_0x904f('0x0'));var path=require(_0x904f('0x1'));var timeout=require(_0x904f('0x2'));var express=require('express');var router=express[_0x904f('0x3')]();var auth=require(_0x904f('0x4'));var interaction=require(_0x904f('0x5'));var config=require(_0x904f('0x6'));module[_0x904f('0x7')]=router;
\ No newline at end of file
+var _0x0324=['express','Router','../../components/interaction/service','../../config/environment','multer','util','connect-timeout'];(function(_0x268a71,_0x320096){var _0xd456b3=function(_0x200e01){while(--_0x200e01){_0x268a71['push'](_0x268a71['shift']());}};_0xd456b3(++_0x320096);}(_0x0324,0x1e0));var _0x4032=function(_0xd93baf,_0x587151){_0xd93baf=_0xd93baf-0x0;var _0x534fb9=_0x0324[_0xd93baf];return _0x534fb9;};'use strict';var multer=require(_0x4032('0x0'));var util=require(_0x4032('0x1'));var path=require('path');var timeout=require(_0x4032('0x2'));var express=require(_0x4032('0x3'));var router=express[_0x4032('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4032('0x5'));var config=require(_0x4032('0x6'));module['exports']=router;
\ No newline at end of file
index 909bba9..14430a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['exports','sequelize'];(function(_0x96d8bb,_0x59e193){var _0x296ef2=function(_0x1735cc){while(--_0x1735cc){_0x96d8bb['push'](_0x96d8bb['shift']());}};_0x296ef2(++_0x59e193);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x4f6c97,_0x188640){var _0x1a0cc6=function(_0x44d983){while(--_0x44d983){_0x4f6c97['push'](_0x4f6c97['shift']());}};_0x1a0cc6(++_0x188640);}(_0xe706,0xa3));var _0x6e70=function(_0xd3da2a,_0x22241c){_0xd3da2a=_0xd3da2a-0x0;var _0x10ab61=_0xe706[_0xd3da2a];return _0x10ab61;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 6bdad25..de517db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4024=['define','user_has_whatsapp_queues','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x2fe87e,_0x556627){var _0x263bb8=function(_0x4bd3fd){while(--_0x4bd3fd){_0x2fe87e['push'](_0x2fe87e['shift']());}};_0x263bb8(++_0x556627);}(_0x4024,0x89));var _0x4402=function(_0x52ff77,_0x51ab49){_0x52ff77=_0x52ff77-0x0;var _0x280dae=_0x4024[_0x52ff77];return _0x280dae;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var logger=require('../../config/logger')(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var BPromise=require('bluebird');var rp=require(_0x4402('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x17699b,_0x346ddc){return _0x17699b[_0x4402('0x7')]('UserWhatsappQueue',attributes,{'tableName':_0x4402('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2f223,_0x32a7e5){_0x2f223=_0x2f223-0x0;var _0x4994aa=_0xd7d1[_0x2f223];return _0x4994aa;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 576fd4c..cc18f4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0xffd1f,_0x2deee6){var _0x1096f2=function(_0x2dd9a8){while(--_0x2dd9a8){_0xffd1f['push'](_0xffd1f['shift']());}};_0x1096f2(++_0x2deee6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x3ee71b,_0x56466){var _0x4010a8=function(_0x1a8350){while(--_0x1a8350){_0x3ee71b['push'](_0x3ee71b['shift']());}};_0x4010a8(++_0x56466);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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
index c6a6ac8..4e77790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f0=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57f0,0x169));var _0x057f=function(_0x565b76,_0x1d150b){_0x565b76=_0x565b76-0x0;var _0x80f363=_0x57f0[_0x565b76];return _0x80f363;};'use strict';var multer=require(_0x057f('0x0'));var util=require(_0x057f('0x1'));var path=require(_0x057f('0x2'));var timeout=require(_0x057f('0x3'));var express=require(_0x057f('0x4'));var router=express[_0x057f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x057f('0x6'));var config=require(_0x057f('0x7'));var controller=require(_0x057f('0x8'));router[_0x057f('0x9')]('/',auth[_0x057f('0xa')](),controller[_0x057f('0xb')]);router[_0x057f('0x9')](_0x057f('0xc'),auth[_0x057f('0xa')](),controller['show']);router[_0x057f('0xd')]('/',auth[_0x057f('0xa')](),controller[_0x057f('0xe')]);router[_0x057f('0xf')](_0x057f('0xc'),auth[_0x057f('0xa')](),controller[_0x057f('0x10')]);router[_0x057f('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x057f('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x2153=['isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','show','post'];(function(_0x792e6b,_0x1949c4){var _0x1627c2=function(_0xa89bb1){while(--_0xa89bb1){_0x792e6b['push'](_0x792e6b['shift']());}};_0x1627c2(++_0x1949c4);}(_0x2153,0xf6));var _0x3215=function(_0x38cc16,_0x4678bf){_0x38cc16=_0x38cc16-0x0;var _0x5b6753=_0x2153[_0x38cc16];return _0x5b6753;};'use strict';var multer=require(_0x3215('0x0'));var util=require(_0x3215('0x1'));var path=require(_0x3215('0x2'));var timeout=require(_0x3215('0x3'));var express=require(_0x3215('0x4'));var router=express['Router']();var auth=require(_0x3215('0x5'));var interaction=require(_0x3215('0x6'));var config=require(_0x3215('0x7'));var controller=require(_0x3215('0x8'));router[_0x3215('0x9')]('/',auth['isAuthenticated'](),controller[_0x3215('0xa')]);router[_0x3215('0x9')](_0x3215('0xb'),auth['isAuthenticated'](),controller[_0x3215('0xc')]);router[_0x3215('0xd')]('/',auth[_0x3215('0xe')](),controller['create']);router[_0x3215('0xf')](_0x3215('0xb'),auth[_0x3215('0xe')](),controller[_0x3215('0x10')]);router[_0x3215('0x11')](_0x3215('0xb'),auth['isAuthenticated'](),controller[_0x3215('0x12')]);module[_0x3215('0x13')]=router;
\ No newline at end of file
index 5b7fdd0..a4f621f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b49=['STRING','sequelize','exports','name'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0x5b49,0x155));var _0x95b4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5b49[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x95b4('0x0'));module[_0x95b4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x95b4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x95b4('0x3')]}};
\ No newline at end of file
+var _0xac70=['exports','sequelize'];(function(_0x5ee062,_0x2628d7){var _0x40b065=function(_0x390f0e){while(--_0x390f0e){_0x5ee062['push'](_0x5ee062['shift']());}};_0x40b065(++_0x2628d7);}(_0xac70,0x1c7));var _0x0ac7=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xac70[_0xe0b81f];return _0x290e5e;};'use strict';var Sequelize=require(_0x0ac7('0x0'));module[_0x0ac7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 007ba55..386904c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca39=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','count','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','find','userProfileId','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x382549,_0x3f9b49){var _0x320c66=function(_0x399ce2){while(--_0x399ce2){_0x382549['push'](_0x382549['shift']());}};_0x320c66(++_0x3f9b49);}(_0xca39,0xf0));var _0x9ca3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xca39[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0x9ca3('0x0'));var emlformat=require(_0x9ca3('0x1'));var rimraf=require(_0x9ca3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ca3('0x3'));var rp=require(_0x9ca3('0x4'));var moment=require(_0x9ca3('0x5'));var BPromise=require(_0x9ca3('0x6'));var Mustache=require(_0x9ca3('0x7'));var util=require(_0x9ca3('0x8'));var path=require('path');var sox=require(_0x9ca3('0x9'));var csv=require(_0x9ca3('0xa'));var ejs=require(_0x9ca3('0xb'));var fs=require('fs');var _=require(_0x9ca3('0xc'));var squel=require(_0x9ca3('0xd'));var crypto=require(_0x9ca3('0xe'));var jsforce=require(_0x9ca3('0xf'));var deskjs=require(_0x9ca3('0x10'));var toCsv=require(_0x9ca3('0xa'));var querystring=require(_0x9ca3('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9ca3('0x12'));var qs=require(_0x9ca3('0x13'));var as=require(_0x9ca3('0x14'));var hardwareService=require(_0x9ca3('0x15'));var logger=require(_0x9ca3('0x16'))(_0x9ca3('0x17'));var utils=require(_0x9ca3('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8c628f,_0x107af2){_0x107af2=_0x107af2||0xcc;return function(_0x4919db){if(_0x4919db){return _0x8c628f[_0x9ca3('0x19')](_0x107af2);}return _0x8c628f[_0x9ca3('0x1a')](_0x107af2)[_0x9ca3('0x1b')]();};}function respondWithResult(_0x4ff6fa,_0x24210b){_0x24210b=_0x24210b||0xc8;return function(_0x344c2c){if(_0x344c2c){return _0x4ff6fa[_0x9ca3('0x1a')](_0x24210b)[_0x9ca3('0x1c')](_0x344c2c);}};}function respondWithFilteredResult(_0x336bed,_0x28b868){return function(_0x322662){if(_0x322662){var _0x1912e8=_0x322662['count'],_0x4217e0=_0x28b868[_0x9ca3('0x1d')],_0x24153e=_0x28b868[_0x9ca3('0x1d')]+_0x28b868['limit'],_0x558171;if(_0x24153e>=_0x1912e8){_0x24153e=_0x1912e8;_0x558171=0xc8;}else{_0x558171=0xce;}_0x336bed[_0x9ca3('0x1a')](_0x558171);return _0x336bed['set'](_0x9ca3('0x1e'),_0x4217e0+'-'+_0x24153e+'/'+_0x1912e8)['json'](_0x322662);}return null;};}function patchUpdates(_0xd4be3a){return function(_0x2a579c){try{jsonpatch[_0x9ca3('0x1f')](_0x2a579c,_0xd4be3a,!![]);}catch(_0xef7948){return BPromise[_0x9ca3('0x20')](_0xef7948);}return _0x2a579c[_0x9ca3('0x21')]();};}function saveUpdates(_0x23839d,_0x13eeb1){return function(_0x49bfbd){if(_0x49bfbd){return _0x49bfbd[_0x9ca3('0x22')](_0x23839d)['then'](function(_0x2bcae1){return _0x2bcae1;});}return null;};}function removeEntity(_0x3d374d,_0x15a3be){return function(_0x84c019){if(_0x84c019){return _0x84c019[_0x9ca3('0x23')]()['then'](function(){var _0x3ea053=_0x84c019[_0x9ca3('0x24')]({'plain':!![]});var _0x13aecb='Variables';return db[_0x9ca3('0x25')][_0x9ca3('0x23')]({'where':{'type':_0x13aecb,'resourceId':_0x3ea053['id']}})[_0x9ca3('0x26')](function(){return _0x84c019;});})[_0x9ca3('0x26')](function(){_0x3d374d[_0x9ca3('0x1a')](0xcc)[_0x9ca3('0x1b')]();});}};}function handleEntityNotFound(_0xff7217,_0x217ddf){return function(_0x19ef24){if(!_0x19ef24){_0xff7217[_0x9ca3('0x19')](0x194);}return _0x19ef24;};}function handleError(_0x17e071,_0x68a00d){_0x68a00d=_0x68a00d||0x1f4;return function(_0x5e5346){logger[_0x9ca3('0x27')](_0x5e5346[_0x9ca3('0x28')]);if(_0x5e5346[_0x9ca3('0x29')]){delete _0x5e5346[_0x9ca3('0x29')];}_0x17e071['status'](_0x68a00d)[_0x9ca3('0x2a')](_0x5e5346);};}exports['index']=function(_0x56a5d5,_0x447480){var _0x367885={},_0x3f3b34={},_0x2dbf5b={'count':0x0,'rows':[]};var _0x3382cc=_[_0x9ca3('0x2b')](db[_0x9ca3('0x2c')][_0x9ca3('0x2d')],function(_0x3ed259){return{'name':_0x3ed259[_0x9ca3('0x2e')],'type':_0x3ed259[_0x9ca3('0x2f')][_0x9ca3('0x30')]};});_0x3f3b34[_0x9ca3('0x31')]=_[_0x9ca3('0x2b')](_0x3382cc,_0x9ca3('0x29'));_0x3f3b34[_0x9ca3('0x32')]=_[_0x9ca3('0x33')](_0x56a5d5[_0x9ca3('0x32')]);_0x3f3b34[_0x9ca3('0x34')]=_['intersection'](_0x3f3b34[_0x9ca3('0x31')],_0x3f3b34['query']);_0x367885[_0x9ca3('0x35')]=_[_0x9ca3('0x36')](_0x3f3b34['model'],qs['fields'](_0x56a5d5[_0x9ca3('0x32')][_0x9ca3('0x37')]));_0x367885[_0x9ca3('0x35')]=_0x367885[_0x9ca3('0x35')][_0x9ca3('0x38')]?_0x367885[_0x9ca3('0x35')]:_0x3f3b34[_0x9ca3('0x31')];if(!_0x56a5d5['query'][_0x9ca3('0x39')]('nolimit')){_0x367885['limit']=qs['limit'](_0x56a5d5[_0x9ca3('0x32')]['limit']);_0x367885['offset']=qs[_0x9ca3('0x1d')](_0x56a5d5[_0x9ca3('0x32')][_0x9ca3('0x1d')]);}_0x367885[_0x9ca3('0x3a')]=qs[_0x9ca3('0x3b')](_0x56a5d5[_0x9ca3('0x32')][_0x9ca3('0x3b')]);_0x367885['where']=qs[_0x9ca3('0x34')](_[_0x9ca3('0x3c')](_0x56a5d5[_0x9ca3('0x32')],_0x3f3b34[_0x9ca3('0x34')]),_0x3382cc);if(_0x56a5d5[_0x9ca3('0x32')][_0x9ca3('0x3d')]){_0x367885['where']=_[_0x9ca3('0x3e')](_0x367885[_0x9ca3('0x3f')],{'$or':_['map'](_0x3382cc,function(_0x4853b6){if(_0x4853b6[_0x9ca3('0x2f')]!==_0x9ca3('0x40')){var _0x2cf93b={};_0x2cf93b[_0x4853b6[_0x9ca3('0x29')]]={'$like':'%'+_0x56a5d5[_0x9ca3('0x32')][_0x9ca3('0x3d')]+'%'};return _0x2cf93b;}})});}_0x367885=_['merge']({},_0x367885,_0x56a5d5[_0x9ca3('0x41')]);var _0x1dd46b={'where':_0x367885[_0x9ca3('0x3f')]};return db['Variable'][_0x9ca3('0x42')](_0x1dd46b)[_0x9ca3('0x26')](function(_0x541798){_0x2dbf5b[_0x9ca3('0x42')]=_0x541798;if(_0x56a5d5[_0x9ca3('0x32')]['includeAll']){_0x367885[_0x9ca3('0x43')]=[{'all':!![]}];}return db[_0x9ca3('0x2c')][_0x9ca3('0x44')](_0x367885);})['then'](function(_0x2c1dbe){_0x2dbf5b[_0x9ca3('0x45')]=_0x2c1dbe;return _0x2dbf5b;})[_0x9ca3('0x26')](respondWithFilteredResult(_0x447480,_0x367885))[_0x9ca3('0x46')](handleError(_0x447480,null));};exports[_0x9ca3('0x47')]=function(_0x3017d5,_0xc86a15){var _0x4884fd={'raw':!![],'where':{'id':_0x3017d5[_0x9ca3('0x48')]['id']}},_0x3acc4a={};_0x3acc4a[_0x9ca3('0x31')]=_[_0x9ca3('0x33')](db['Variable'][_0x9ca3('0x2d')]);_0x3acc4a[_0x9ca3('0x32')]=_[_0x9ca3('0x33')](_0x3017d5[_0x9ca3('0x32')]);_0x3acc4a['filters']=_[_0x9ca3('0x36')](_0x3acc4a['model'],_0x3acc4a[_0x9ca3('0x32')]);_0x4884fd['attributes']=_[_0x9ca3('0x36')](_0x3acc4a[_0x9ca3('0x31')],qs[_0x9ca3('0x37')](_0x3017d5[_0x9ca3('0x32')][_0x9ca3('0x37')]));_0x4884fd[_0x9ca3('0x35')]=_0x4884fd[_0x9ca3('0x35')]['length']?_0x4884fd[_0x9ca3('0x35')]:_0x3acc4a[_0x9ca3('0x31')];if(_0x3017d5['query'][_0x9ca3('0x49')]){_0x4884fd['include']=[{'all':!![]}];}_0x4884fd=_['merge']({},_0x4884fd,_0x3017d5[_0x9ca3('0x41')]);return db[_0x9ca3('0x2c')]['find'](_0x4884fd)[_0x9ca3('0x26')](handleEntityNotFound(_0xc86a15,null))[_0x9ca3('0x26')](respondWithResult(_0xc86a15,null))['catch'](handleError(_0xc86a15,null));};exports[_0x9ca3('0x4a')]=function(_0x38f9fa,_0x5c6fe2){return db['Variable'][_0x9ca3('0x4a')](_0x38f9fa[_0x9ca3('0x4b')],{})[_0x9ca3('0x26')](function(_0x36c40f){var _0x4c08f4=_0x38f9fa[_0x9ca3('0x4c')]['get']({'plain':!![]});if(!_0x4c08f4)throw new Error(_0x9ca3('0x4d'));if(_0x4c08f4[_0x9ca3('0x4e')]===_0x9ca3('0x4c')){var _0x359fa3=_0x36c40f[_0x9ca3('0x24')]({'plain':!![]});var _0x535f4a=_0x9ca3('0x4f');return db[_0x9ca3('0x50')][_0x9ca3('0x51')]({'where':{'name':_0x535f4a,'userProfileId':_0x4c08f4[_0x9ca3('0x52')]},'raw':!![]})[_0x9ca3('0x26')](function(_0x5f2a59){if(_0x5f2a59&&_0x5f2a59['autoAssociation']===0x0){return db[_0x9ca3('0x25')][_0x9ca3('0x4a')]({'name':_0x359fa3[_0x9ca3('0x29')],'resourceId':_0x359fa3['id'],'type':_0x5f2a59['name'],'sectionId':_0x5f2a59['id']},{})[_0x9ca3('0x26')](function(){return _0x36c40f;});}else{return _0x36c40f;}})[_0x9ca3('0x46')](function(_0x237a4c){logger[_0x9ca3('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x237a4c);throw _0x237a4c;});}return _0x36c40f;})[_0x9ca3('0x26')](respondWithResult(_0x5c6fe2,0xc9))[_0x9ca3('0x46')](handleError(_0x5c6fe2,null));};exports[_0x9ca3('0x22')]=function(_0x87c3a9,_0x5ede26){if(_0x87c3a9[_0x9ca3('0x4b')]['id']){delete _0x87c3a9[_0x9ca3('0x4b')]['id'];}return db['Variable'][_0x9ca3('0x51')]({'where':{'id':_0x87c3a9[_0x9ca3('0x48')]['id']}})[_0x9ca3('0x26')](handleEntityNotFound(_0x5ede26,null))['then'](saveUpdates(_0x87c3a9[_0x9ca3('0x4b')],null))[_0x9ca3('0x26')](respondWithResult(_0x5ede26,null))[_0x9ca3('0x46')](handleError(_0x5ede26,null));};exports[_0x9ca3('0x23')]=function(_0x37ea13,_0x26ef58){return db[_0x9ca3('0x2c')]['find']({'where':{'id':_0x37ea13[_0x9ca3('0x48')]['id']}})[_0x9ca3('0x26')](handleEntityNotFound(_0x26ef58,null))['then'](removeEntity(_0x26ef58,null))[_0x9ca3('0x46')](handleError(_0x26ef58,null));};
\ No newline at end of file
+var _0xd5f4=['path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','update','then','get','Variables','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Variable','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x56c64a,_0x2a2cde){var _0x16fb84=function(_0x84ec03){while(--_0x84ec03){_0x56c64a['push'](_0x56c64a['shift']());}};_0x16fb84(++_0x2a2cde);}(_0xd5f4,0x192));var _0x4d5f=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xd5f4[_0x4ff09b];return _0x3f5c2e;};'use strict';var pdf=require(_0x4d5f('0x0'));var emlformat=require(_0x4d5f('0x1'));var rimraf=require(_0x4d5f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d5f('0x3'));var rp=require(_0x4d5f('0x4'));var moment=require('moment');var BPromise=require(_0x4d5f('0x5'));var Mustache=require(_0x4d5f('0x6'));var util=require(_0x4d5f('0x7'));var path=require(_0x4d5f('0x8'));var sox=require(_0x4d5f('0x9'));var csv=require(_0x4d5f('0xa'));var ejs=require(_0x4d5f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4d5f('0xc'));var crypto=require(_0x4d5f('0xd'));var jsforce=require(_0x4d5f('0xe'));var deskjs=require(_0x4d5f('0xf'));var toCsv=require(_0x4d5f('0xa'));var querystring=require('querystring');var Papa=require(_0x4d5f('0x10'));var Redis=require(_0x4d5f('0x11'));var authService=require(_0x4d5f('0x12'));var qs=require(_0x4d5f('0x13'));var as=require(_0x4d5f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4d5f('0x15'));var utils=require(_0x4d5f('0x16'));var config=require(_0x4d5f('0x17'));var db=require(_0x4d5f('0x18'))['db'];function respondWithStatusCode(_0x5e3b8d,_0x67a276){_0x67a276=_0x67a276||0xcc;return function(_0x540896){if(_0x540896){return _0x5e3b8d[_0x4d5f('0x19')](_0x67a276);}return _0x5e3b8d[_0x4d5f('0x1a')](_0x67a276)[_0x4d5f('0x1b')]();};}function respondWithResult(_0x51963b,_0x88d78e){_0x88d78e=_0x88d78e||0xc8;return function(_0x453b17){if(_0x453b17){return _0x51963b[_0x4d5f('0x1a')](_0x88d78e)[_0x4d5f('0x1c')](_0x453b17);}};}function respondWithFilteredResult(_0x4247bb,_0x175c8e){return function(_0x310feb){if(_0x310feb){var _0x15f391=_0x310feb[_0x4d5f('0x1d')],_0x2243cb=_0x175c8e['offset'],_0x466566=_0x175c8e[_0x4d5f('0x1e')]+_0x175c8e['limit'],_0x578d69;if(_0x466566>=_0x15f391){_0x466566=_0x15f391;_0x578d69=0xc8;}else{_0x578d69=0xce;}_0x4247bb[_0x4d5f('0x1a')](_0x578d69);return _0x4247bb['set']('Content-Range',_0x2243cb+'-'+_0x466566+'/'+_0x15f391)[_0x4d5f('0x1c')](_0x310feb);}return null;};}function patchUpdates(_0x54a07c){return function(_0x273a75){try{jsonpatch['apply'](_0x273a75,_0x54a07c,!![]);}catch(_0x5558f8){return BPromise['reject'](_0x5558f8);}return _0x273a75['save']();};}function saveUpdates(_0x5c7765,_0x1beb65){return function(_0x48fab4){if(_0x48fab4){return _0x48fab4[_0x4d5f('0x1f')](_0x5c7765)[_0x4d5f('0x20')](function(_0x3bbaf2){return _0x3bbaf2;});}return null;};}function removeEntity(_0x1b640c,_0x5d5505){return function(_0x53ea2e){if(_0x53ea2e){return _0x53ea2e['destroy']()[_0x4d5f('0x20')](function(){var _0x2bb651=_0x53ea2e[_0x4d5f('0x21')]({'plain':!![]});var _0x323dae=_0x4d5f('0x22');return db[_0x4d5f('0x23')][_0x4d5f('0x24')]({'where':{'type':_0x323dae,'resourceId':_0x2bb651['id']}})[_0x4d5f('0x20')](function(){return _0x53ea2e;});})[_0x4d5f('0x20')](function(){_0x1b640c[_0x4d5f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x430c14,_0x420691){return function(_0x3e1b03){if(!_0x3e1b03){_0x430c14['sendStatus'](0x194);}return _0x3e1b03;};}function handleError(_0x4ad4b3,_0x4866f6){_0x4866f6=_0x4866f6||0x1f4;return function(_0xc5d10){logger['error'](_0xc5d10[_0x4d5f('0x25')]);if(_0xc5d10['name']){delete _0xc5d10[_0x4d5f('0x26')];}_0x4ad4b3[_0x4d5f('0x1a')](_0x4866f6)[_0x4d5f('0x27')](_0xc5d10);};}exports[_0x4d5f('0x28')]=function(_0x3d55cb,_0x49f3c1){var _0x29df25={},_0x1ec797={},_0x4e9ca2={'count':0x0,'rows':[]};var _0x355873=_['map'](db['Variable'][_0x4d5f('0x29')],function(_0x226976){return{'name':_0x226976[_0x4d5f('0x2a')],'type':_0x226976['type'][_0x4d5f('0x2b')]};});_0x1ec797[_0x4d5f('0x2c')]=_[_0x4d5f('0x2d')](_0x355873,'name');_0x1ec797[_0x4d5f('0x2e')]=_[_0x4d5f('0x2f')](_0x3d55cb[_0x4d5f('0x2e')]);_0x1ec797['filters']=_[_0x4d5f('0x30')](_0x1ec797[_0x4d5f('0x2c')],_0x1ec797[_0x4d5f('0x2e')]);_0x29df25[_0x4d5f('0x31')]=_[_0x4d5f('0x30')](_0x1ec797['model'],qs['fields'](_0x3d55cb[_0x4d5f('0x2e')][_0x4d5f('0x32')]));_0x29df25[_0x4d5f('0x31')]=_0x29df25[_0x4d5f('0x31')][_0x4d5f('0x33')]?_0x29df25[_0x4d5f('0x31')]:_0x1ec797['model'];if(!_0x3d55cb[_0x4d5f('0x2e')][_0x4d5f('0x34')](_0x4d5f('0x35'))){_0x29df25[_0x4d5f('0x36')]=qs[_0x4d5f('0x36')](_0x3d55cb[_0x4d5f('0x2e')]['limit']);_0x29df25[_0x4d5f('0x1e')]=qs[_0x4d5f('0x1e')](_0x3d55cb['query'][_0x4d5f('0x1e')]);}_0x29df25[_0x4d5f('0x37')]=qs[_0x4d5f('0x38')](_0x3d55cb[_0x4d5f('0x2e')][_0x4d5f('0x38')]);_0x29df25[_0x4d5f('0x39')]=qs[_0x4d5f('0x3a')](_[_0x4d5f('0x3b')](_0x3d55cb[_0x4d5f('0x2e')],_0x1ec797['filters']),_0x355873);if(_0x3d55cb['query'][_0x4d5f('0x3c')]){_0x29df25[_0x4d5f('0x39')]=_[_0x4d5f('0x3d')](_0x29df25['where'],{'$or':_[_0x4d5f('0x2d')](_0x355873,function(_0x511d3e){if(_0x511d3e[_0x4d5f('0x3e')]!==_0x4d5f('0x3f')){var _0x1d17c6={};_0x1d17c6[_0x511d3e[_0x4d5f('0x26')]]={'$like':'%'+_0x3d55cb[_0x4d5f('0x2e')][_0x4d5f('0x3c')]+'%'};return _0x1d17c6;}})});}_0x29df25=_['merge']({},_0x29df25,_0x3d55cb[_0x4d5f('0x40')]);var _0x1a1024={'where':_0x29df25[_0x4d5f('0x39')]};return db[_0x4d5f('0x41')][_0x4d5f('0x1d')](_0x1a1024)[_0x4d5f('0x20')](function(_0x2f213d){_0x4e9ca2[_0x4d5f('0x1d')]=_0x2f213d;if(_0x3d55cb[_0x4d5f('0x2e')][_0x4d5f('0x42')]){_0x29df25[_0x4d5f('0x43')]=[{'all':!![]}];}return db[_0x4d5f('0x41')][_0x4d5f('0x44')](_0x29df25);})[_0x4d5f('0x20')](function(_0x3b186d){_0x4e9ca2[_0x4d5f('0x45')]=_0x3b186d;return _0x4e9ca2;})[_0x4d5f('0x20')](respondWithFilteredResult(_0x49f3c1,_0x29df25))[_0x4d5f('0x46')](handleError(_0x49f3c1,null));};exports['show']=function(_0x2642a3,_0x6453cb){var _0xb50443={'raw':!![],'where':{'id':_0x2642a3[_0x4d5f('0x47')]['id']}},_0x6575d6={};_0x6575d6[_0x4d5f('0x2c')]=_[_0x4d5f('0x2f')](db[_0x4d5f('0x41')][_0x4d5f('0x29')]);_0x6575d6[_0x4d5f('0x2e')]=_['keys'](_0x2642a3[_0x4d5f('0x2e')]);_0x6575d6['filters']=_[_0x4d5f('0x30')](_0x6575d6[_0x4d5f('0x2c')],_0x6575d6[_0x4d5f('0x2e')]);_0xb50443[_0x4d5f('0x31')]=_[_0x4d5f('0x30')](_0x6575d6[_0x4d5f('0x2c')],qs['fields'](_0x2642a3[_0x4d5f('0x2e')][_0x4d5f('0x32')]));_0xb50443[_0x4d5f('0x31')]=_0xb50443[_0x4d5f('0x31')]['length']?_0xb50443[_0x4d5f('0x31')]:_0x6575d6['model'];if(_0x2642a3['query'][_0x4d5f('0x42')]){_0xb50443['include']=[{'all':!![]}];}_0xb50443=_['merge']({},_0xb50443,_0x2642a3[_0x4d5f('0x40')]);return db[_0x4d5f('0x41')][_0x4d5f('0x48')](_0xb50443)[_0x4d5f('0x20')](handleEntityNotFound(_0x6453cb,null))[_0x4d5f('0x20')](respondWithResult(_0x6453cb,null))[_0x4d5f('0x46')](handleError(_0x6453cb,null));};exports[_0x4d5f('0x49')]=function(_0x2078e9,_0x2a59d8){return db[_0x4d5f('0x41')][_0x4d5f('0x49')](_0x2078e9[_0x4d5f('0x4a')],{})[_0x4d5f('0x20')](function(_0x39b277){var _0x29ed63=_0x2078e9[_0x4d5f('0x4b')]['get']({'plain':!![]});if(!_0x29ed63)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29ed63[_0x4d5f('0x4c')]===_0x4d5f('0x4b')){var _0x3fe3aa=_0x39b277['get']({'plain':!![]});var _0x4f81c0=_0x4d5f('0x22');return db[_0x4d5f('0x4d')]['find']({'where':{'name':_0x4f81c0,'userProfileId':_0x29ed63[_0x4d5f('0x4e')]},'raw':!![]})['then'](function(_0x19de7f){if(_0x19de7f&&_0x19de7f[_0x4d5f('0x4f')]===0x0){return db[_0x4d5f('0x23')][_0x4d5f('0x49')]({'name':_0x3fe3aa['name'],'resourceId':_0x3fe3aa['id'],'type':_0x19de7f[_0x4d5f('0x26')],'sectionId':_0x19de7f['id']},{})[_0x4d5f('0x20')](function(){return _0x39b277;});}else{return _0x39b277;}})[_0x4d5f('0x46')](function(_0x51a3cf){logger[_0x4d5f('0x50')](_0x4d5f('0x51'),_0x51a3cf);throw _0x51a3cf;});}return _0x39b277;})[_0x4d5f('0x20')](respondWithResult(_0x2a59d8,0xc9))[_0x4d5f('0x46')](handleError(_0x2a59d8,null));};exports[_0x4d5f('0x1f')]=function(_0x16cf62,_0x281ec1){if(_0x16cf62[_0x4d5f('0x4a')]['id']){delete _0x16cf62['body']['id'];}return db['Variable'][_0x4d5f('0x48')]({'where':{'id':_0x16cf62['params']['id']}})[_0x4d5f('0x20')](handleEntityNotFound(_0x281ec1,null))['then'](saveUpdates(_0x16cf62[_0x4d5f('0x4a')],null))[_0x4d5f('0x20')](respondWithResult(_0x281ec1,null))[_0x4d5f('0x46')](handleError(_0x281ec1,null));};exports[_0x4d5f('0x24')]=function(_0x3c915e,_0x4c0630){return db[_0x4d5f('0x41')][_0x4d5f('0x48')]({'where':{'id':_0x3c915e[_0x4d5f('0x47')]['id']}})[_0x4d5f('0x20')](handleEntityNotFound(_0x4c0630,null))['then'](removeEntity(_0x4c0630,null))[_0x4d5f('0x46')](handleError(_0x4c0630,null));};
\ No newline at end of file
index 9247dd9..d80b0a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad53=['bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','lodash','util','../../config/logger','api','moment'];(function(_0x31afca,_0x4b4bab){var _0x2ce458=function(_0x4fa673){while(--_0x4fa673){_0x31afca['push'](_0x31afca['shift']());}};_0x2ce458(++_0x4b4bab);}(_0xad53,0x1ea));var _0x3ad5=function(_0x2ee029,_0x464fcd){_0x2ee029=_0x2ee029-0x0;var _0x619ca3=_0xad53[_0x2ee029];return _0x619ca3;};'use strict';var _=require(_0x3ad5('0x0'));var util=require(_0x3ad5('0x1'));var logger=require(_0x3ad5('0x2'))(_0x3ad5('0x3'));var moment=require(_0x3ad5('0x4'));var BPromise=require(_0x3ad5('0x5'));var rp=require(_0x3ad5('0x6'));var fs=require('fs');var path=require(_0x3ad5('0x7'));var rimraf=require('rimraf');var config=require(_0x3ad5('0x8'));var attributes=require(_0x3ad5('0x9'));module[_0x3ad5('0xa')]=function(_0x2f75b5,_0x371fbd){return _0x2f75b5['define']('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7333=['define','Variable','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes'];(function(_0x47e216,_0x3740bd){var _0x360aa2=function(_0x41ffac){while(--_0x41ffac){_0x47e216['push'](_0x47e216['shift']());}};_0x360aa2(++_0x3740bd);}(_0x7333,0xfc));var _0x3733=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7333[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var logger=require(_0x3733('0x1'))('api');var moment=require(_0x3733('0x2'));var BPromise=require(_0x3733('0x3'));var rp=require(_0x3733('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3733('0x5'));var config=require(_0x3733('0x6'));var attributes=require(_0x3733('0x7'));module['exports']=function(_0xa51fdb,_0x27c9b7){return _0xa51fdb[_0x3733('0x8')](_0x3733('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a24e6d..4e80d54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4093=['attributes','map','info','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowVariable','Variable','find','options','raw','where','include','model'];(function(_0x44ca27,_0x81f0da){var _0x38bc17=function(_0x476f85){while(--_0x476f85){_0x44ca27['push'](_0x44ca27['shift']());}};_0x38bc17(++_0x81f0da);}(_0x4093,0x103));var _0x3409=function(_0x3e02ec,_0x2e6e5c){_0x3e02ec=_0x3e02ec-0x0;var _0x9d595=_0x4093[_0x3e02ec];return _0x9d595;};'use strict';var _=require(_0x3409('0x0'));var util=require(_0x3409('0x1'));var moment=require(_0x3409('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3409('0x3'));var db=require(_0x3409('0x4'))['db'];var utils=require(_0x3409('0x5'));var logger=require(_0x3409('0x6'))(_0x3409('0x7'));var config=require(_0x3409('0x8'));var jayson=require(_0x3409('0x9'));var client=jayson[_0x3409('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a74d0,_0x14d178,_0x3a6169){return new BPromise(function(_0x8b3cd2,_0x44c505){return client[_0x3409('0xb')](_0x3a74d0,_0x3a6169)[_0x3409('0xc')](function(_0x54934c){logger['info'](_0x3409('0xd'),_0x14d178,_0x3409('0xe'));logger[_0x3409('0xf')](_0x3409('0x10'),_0x14d178,'request\x20sent',JSON[_0x3409('0x11')](_0x54934c));if(_0x54934c[_0x3409('0x12')]){if(_0x54934c[_0x3409('0x12')][_0x3409('0x13')]===0x1f4){logger[_0x3409('0x12')](_0x3409('0xd'),_0x14d178,_0x54934c['error']['message']);return _0x44c505(_0x54934c[_0x3409('0x12')][_0x3409('0x14')]);}logger[_0x3409('0x12')](_0x3409('0xd'),_0x14d178,_0x54934c[_0x3409('0x12')][_0x3409('0x14')]);return _0x8b3cd2(_0x54934c[_0x3409('0x12')][_0x3409('0x14')]);}else{logger['info'](_0x3409('0xd'),_0x14d178,_0x3409('0xe'));_0x8b3cd2(_0x54934c['result'][_0x3409('0x14')]);}})['catch'](function(_0x6346a5){logger[_0x3409('0x12')](_0x3409('0xd'),_0x14d178,_0x6346a5);_0x44c505(_0x6346a5);});});}exports[_0x3409('0x15')]=function(_0x51ead7){var _0x4e6534=this;return new Promise(function(_0xe01ab4,_0x2b426e){return db[_0x3409('0x16')][_0x3409('0x17')]({'raw':_0x51ead7[_0x3409('0x18')]?_0x51ead7['options'][_0x3409('0x19')]===undefined?!![]:![]:!![],'where':_0x51ead7['options']?_0x51ead7['options'][_0x3409('0x1a')]||null:null,'attributes':_0x51ead7[_0x3409('0x18')]?_0x51ead7[_0x3409('0x18')]['attributes']||null:null,'include':_0x51ead7[_0x3409('0x18')]?_0x51ead7[_0x3409('0x18')][_0x3409('0x1b')]?_['map'](_0x51ead7['options']['include'],function(_0x22dec0){return{'model':db[_0x22dec0[_0x3409('0x1c')]],'as':_0x22dec0['as'],'attributes':_0x22dec0[_0x3409('0x1d')],'include':_0x22dec0['include']?_[_0x3409('0x1e')](_0x22dec0[_0x3409('0x1b')],function(_0x127d0b){return{'model':db[_0x127d0b[_0x3409('0x1c')]],'as':_0x127d0b['as'],'attributes':_0x127d0b[_0x3409('0x1d')],'include':_0x127d0b[_0x3409('0x1b')]?_[_0x3409('0x1e')](_0x127d0b['include'],function(_0xd5b097){return{'model':db[_0xd5b097[_0x3409('0x1c')]],'as':_0xd5b097['as'],'attributes':_0xd5b097[_0x3409('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3409('0xc')](function(_0x5643a5){logger[_0x3409('0x1f')]('ShowVariable',_0x51ead7);logger[_0x3409('0xf')]('ShowVariable',_0x51ead7,JSON[_0x3409('0x11')](_0x5643a5));_0xe01ab4(_0x5643a5);})['catch'](function(_0x4c3c76){logger[_0x3409('0x12')]('ShowVariable',_0x4c3c76[_0x3409('0x14')],_0x51ead7);_0x2b426e(_0x4e6534[_0x3409('0x12')](0x1f4,_0x4c3c76[_0x3409('0x14')]));});});};
\ No newline at end of file
+var _0x831d=['where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','ShowVariable','Variable','find','options'];(function(_0x87f362,_0x3ea682){var _0x31f9fb=function(_0x3e7593){while(--_0x3e7593){_0x87f362['push'](_0x87f362['shift']());}};_0x31f9fb(++_0x3ea682);}(_0x831d,0x1a6));var _0xd831=function(_0x49d77e,_0x47b0ca){_0x49d77e=_0x49d77e-0x0;var _0x37895e=_0x831d[_0x49d77e];return _0x37895e;};'use strict';var _=require(_0xd831('0x0'));var util=require(_0xd831('0x1'));var moment=require(_0xd831('0x2'));var BPromise=require(_0xd831('0x3'));var rs=require(_0xd831('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd831('0x5'));var logger=require(_0xd831('0x6'))(_0xd831('0x7'));var config=require(_0xd831('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd831('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x470549,_0x18dc18,_0xd42474){return new BPromise(function(_0x439af0,_0x3a5b03){return client[_0xd831('0xa')](_0x470549,_0xd42474)[_0xd831('0xb')](function(_0x374057){logger[_0xd831('0xc')](_0xd831('0xd'),_0x18dc18,'request\x20sent');logger[_0xd831('0xe')](_0xd831('0xf'),_0x18dc18,'request\x20sent',JSON['stringify'](_0x374057));if(_0x374057[_0xd831('0x10')]){if(_0x374057['error'][_0xd831('0x11')]===0x1f4){logger[_0xd831('0x10')]('Variable,\x20%s,\x20%s',_0x18dc18,_0x374057[_0xd831('0x10')][_0xd831('0x12')]);return _0x3a5b03(_0x374057[_0xd831('0x10')][_0xd831('0x12')]);}logger[_0xd831('0x10')](_0xd831('0xd'),_0x18dc18,_0x374057[_0xd831('0x10')][_0xd831('0x12')]);return _0x439af0(_0x374057['error']['message']);}else{logger[_0xd831('0xc')](_0xd831('0xd'),_0x18dc18,_0xd831('0x13'));_0x439af0(_0x374057[_0xd831('0x14')]['message']);}})[_0xd831('0x15')](function(_0xc3a51e){logger[_0xd831('0x10')](_0xd831('0xd'),_0x18dc18,_0xc3a51e);_0x3a5b03(_0xc3a51e);});});}exports[_0xd831('0x16')]=function(_0x107e22){var _0x101e1c=this;return new Promise(function(_0x34894c,_0x30581a){return db[_0xd831('0x17')][_0xd831('0x18')]({'raw':_0x107e22['options']?_0x107e22[_0xd831('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x107e22['options']?_0x107e22['options'][_0xd831('0x1a')]||null:null,'attributes':_0x107e22[_0xd831('0x19')]?_0x107e22[_0xd831('0x19')][_0xd831('0x1b')]||null:null,'include':_0x107e22['options']?_0x107e22[_0xd831('0x19')][_0xd831('0x1c')]?_[_0xd831('0x1d')](_0x107e22[_0xd831('0x19')][_0xd831('0x1c')],function(_0x508384){return{'model':db[_0x508384[_0xd831('0x1e')]],'as':_0x508384['as'],'attributes':_0x508384[_0xd831('0x1b')],'include':_0x508384[_0xd831('0x1c')]?_['map'](_0x508384[_0xd831('0x1c')],function(_0x26731f){return{'model':db[_0x26731f[_0xd831('0x1e')]],'as':_0x26731f['as'],'attributes':_0x26731f[_0xd831('0x1b')],'include':_0x26731f[_0xd831('0x1c')]?_[_0xd831('0x1d')](_0x26731f[_0xd831('0x1c')],function(_0x88c6cd){return{'model':db[_0x88c6cd[_0xd831('0x1e')]],'as':_0x88c6cd['as'],'attributes':_0x88c6cd[_0xd831('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd831('0xb')](function(_0x3b0f86){logger[_0xd831('0xc')](_0xd831('0x16'),_0x107e22);logger[_0xd831('0xe')](_0xd831('0x16'),_0x107e22,JSON[_0xd831('0x1f')](_0x3b0f86));_0x34894c(_0x3b0f86);})[_0xd831('0x15')](function(_0x17e78d){logger[_0xd831('0x10')](_0xd831('0x16'),_0x17e78d[_0xd831('0x12')],_0x107e22);_0x30581a(_0x101e1c[_0xd831('0x10')](0x1f4,_0x17e78d[_0xd831('0x12')]));});});};
\ No newline at end of file
index 7de6aab..0541dcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe409=['../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','reset','/pull','pull','/restart','migrations','exports','express'];(function(_0x5c1146,_0x8230){var _0x5bb3e6=function(_0x10f881){while(--_0x10f881){_0x5c1146['push'](_0x5c1146['shift']());}};_0x5bb3e6(++_0x8230);}(_0xe409,0x195));var _0x9e40=function(_0x35db94,_0x2c04f1){_0x35db94=_0x35db94-0x0;var _0x495953=_0xe409[_0x35db94];return _0x495953;};'use strict';var express=require(_0x9e40('0x0'));var router=express['Router']();var auth=require(_0x9e40('0x1'));var controller=require(_0x9e40('0x2'));router[_0x9e40('0x3')]('/',controller[_0x9e40('0x4')]);router[_0x9e40('0x3')](_0x9e40('0x5'),auth[_0x9e40('0x6')](),auth[_0x9e40('0x7')](),controller['fetch']);router[_0x9e40('0x3')]('/reset',auth[_0x9e40('0x6')](),auth[_0x9e40('0x7')](),controller[_0x9e40('0x8')]);router[_0x9e40('0x3')](_0x9e40('0x9'),auth[_0x9e40('0x6')](),auth[_0x9e40('0x7')](),controller[_0x9e40('0xa')]);router[_0x9e40('0x3')](_0x9e40('0xb'),auth[_0x9e40('0x6')](),controller['restart']);router[_0x9e40('0x3')]('/migrations',controller[_0x9e40('0xc')]);module[_0x9e40('0xd')]=router;
\ No newline at end of file
+var _0x0e38=['reset','/pull','pull','restart','/migrations','migrations','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch','/reset','isAuthenticated'];(function(_0x4fb035,_0x2bd514){var _0x442b7b=function(_0x199c4f){while(--_0x199c4f){_0x4fb035['push'](_0x4fb035['shift']());}};_0x442b7b(++_0x2bd514);}(_0x0e38,0x1f3));var _0x80e3=function(_0x3468d1,_0x5bd808){_0x3468d1=_0x3468d1-0x0;var _0x3d9f1d=_0x0e38[_0x3468d1];return _0x3d9f1d;};'use strict';var express=require(_0x80e3('0x0'));var router=express[_0x80e3('0x1')]();var auth=require(_0x80e3('0x2'));var controller=require(_0x80e3('0x3'));router[_0x80e3('0x4')]('/',controller[_0x80e3('0x5')]);router['get'](_0x80e3('0x6'),auth['isAuthenticated'](),auth[_0x80e3('0x7')](),controller[_0x80e3('0x8')]);router[_0x80e3('0x4')](_0x80e3('0x9'),auth[_0x80e3('0xa')](),auth[_0x80e3('0x7')](),controller[_0x80e3('0xb')]);router['get'](_0x80e3('0xc'),auth['isAuthenticated'](),auth[_0x80e3('0x7')](),controller[_0x80e3('0xd')]);router[_0x80e3('0x4')]('/restart',auth[_0x80e3('0xa')](),controller[_0x80e3('0xe')]);router[_0x80e3('0x4')](_0x80e3('0xf'),controller[_0x80e3('0x10')]);module['exports']=router;
\ No newline at end of file
index 6420dbc..b2e1c84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20de=['../../config/logger','update','root','exports','query','latest','tags','json','status','fetch','origin','master','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','server','migrations','replace','.js','push','length','Migration','sequelize','getQueryInterface','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2'];(function(_0x397de4,_0x38ac08){var _0x1ace8e=function(_0x4653d1){while(--_0x4653d1){_0x397de4['push'](_0x397de4['shift']());}};_0x1ace8e(++_0x38ac08);}(_0x20de,0x134));var _0xe20d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x20de[_0x57b54c];return _0x59cc19;};'use strict';var Umzug=require(_0xe20d('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xe20d('0x1'));var pkginfo=require(_0xe20d('0x2'))(module,_0xe20d('0x3'));var compareVersions=require(_0xe20d('0x4'));var exec=require(_0xe20d('0x5'))[_0xe20d('0x6')];var db=require(_0xe20d('0x7'))['db'];var config=require(_0xe20d('0x8'));var pm2=require(_0xe20d('0x9'));var logger=require(_0xe20d('0xa'))(_0xe20d('0xb'));var git=require('simple-git')(config[_0xe20d('0xc')]);exports['index']=function(_0x4e1fb9,_0x4909c9){var _0x110ff5={'current':module[_0xe20d('0xd')][_0xe20d('0x3')],'phonebar':0x2};if(_0x4e1fb9['query']&&_0x4e1fb9[_0xe20d('0xe')][_0xe20d('0xf')]){return git['fetch']()[_0xe20d('0x10')](function(_0x337c85,_0x49913b){_0x110ff5[_0xe20d('0xf')]=(_0x337c85?module[_0xe20d('0xd')][_0xe20d('0x3')]:_0x49913b[_0xe20d('0xf')])||'2.0.0';return _0x4909c9['status'](0xc8)[_0xe20d('0x11')](_0x110ff5);});}else{return _0x4909c9[_0xe20d('0x12')](0xc8)[_0xe20d('0x11')](_0x110ff5);}};exports[_0xe20d('0x13')]=function(_0x1b2c37,_0x26f1dd){return git[_0xe20d('0x13')]([_0xe20d('0x14'),_0xe20d('0x15')],function(_0x56eeea){if(_0x56eeea){logger[_0xe20d('0x16')](_0x56eeea);return _0x26f1dd['status'](0x1f4)[_0xe20d('0x11')](_0x56eeea);}logger[_0xe20d('0x17')](_0xe20d('0x18'));return _0x26f1dd['status'](0xc8)[_0xe20d('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xe20d('0x19')]=function(_0x1f2058,_0x285916){return git['reset']([_0xe20d('0x1a'),_0xe20d('0x1b')],function(_0xd96fa7){if(_0xd96fa7){logger[_0xe20d('0x16')](_0xd96fa7);return _0x285916['status'](0x1f4)[_0xe20d('0x11')](_0xd96fa7);}logger[_0xe20d('0x17')](_0xe20d('0x1c'));return _0x285916[_0xe20d('0x12')](0xc8)['json']({'output':_0xe20d('0x1d')});});};exports['pull']=function(_0x4ac635,_0x1fae60){exec(_0xe20d('0x1e'),function(_0x4baa28,_0x5e7237,_0x1552d8){logger[_0xe20d('0x17')](_0x5e7237);logger['info'](_0x1552d8);if(_0x4baa28){logger[_0xe20d('0x16')](_0x4baa28);return _0x1fae60[_0xe20d('0x12')](0x1f4)[_0xe20d('0x11')](_0x4baa28);}return _0x1fae60[_0xe20d('0x12')](0xc8)[_0xe20d('0x11')]({'output':_0x5e7237});});};exports['restart']=function(_0x1d88fd,_0x292fa0){return pm2[_0xe20d('0x1f')](_0xe20d('0x20'))[_0xe20d('0x21')](function(_0x51f395){logger['info'](_0xe20d('0x22'),_0x51f395);return _0x292fa0['status'](0xc8)[_0xe20d('0x11')]({'output':_0xe20d('0x23')});})[_0xe20d('0x24')](function(_0x46fc0e){logger[_0xe20d('0x16')](_0x46fc0e);return _0x292fa0[_0xe20d('0x12')](0x1f4)[_0xe20d('0x11')](_0x46fc0e);});};exports['migrations']=function(_0x8b7386,_0x5ecc55){var _0x555eb5=fs['readdirSync'](path['join'](config['root'],_0xe20d('0x25'),_0xe20d('0x26')));var _0x41e140=[];for(var _0x4f2d27=0x0;_0x4f2d27<_0x555eb5['length'];_0x4f2d27++){var _0x243311=_0x555eb5[_0x4f2d27][_0xe20d('0x27')](_0xe20d('0x28'),'');if(compareVersions(module[_0xe20d('0xd')][_0xe20d('0x3')],_0x243311)===-0x1){_0x41e140[_0xe20d('0x29')](_0x243311);}}if(_0x41e140[_0xe20d('0x2a')]){var _0x3a1dcb=_0x41e140['sort'](compareVersions);var _0x3772b5=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0xe20d('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0xe20d('0x2c')][_0xe20d('0x2d')](),db['sequelize']['constructor'],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[_0xe20d('0x2e')](config[_0xe20d('0xc')],_0xe20d('0x25'),_0xe20d('0x26')),'pattern':/\.js$/}});_0x3772b5['up']({'migrations':_[_0xe20d('0x2f')](_0x3a1dcb,function(_0x298b85){return _0x298b85+'.js';})})[_0xe20d('0x21')](function(){return _0x5ecc55[_0xe20d('0x12')](0xc8)[_0xe20d('0x11')]({'output':_0xe20d('0x30')+module['exports'][_0xe20d('0x3')]+_0xe20d('0x31')+_[_0xe20d('0x32')](_0x3a1dcb),'migrations':_[_0xe20d('0x2e')](_0x3a1dcb)});})['catch'](function(_0x5c4ccf){if(_0x5c4ccf instanceof db[_0xe20d('0x2c')][_0xe20d('0x33')]){return _0x5ecc55['status'](0xc8)[_0xe20d('0x11')]({'output':_0xe20d('0x34')});}else{return _0x5ecc55[_0xe20d('0x12')](0x1f4)[_0xe20d('0x11')](_0x5c4ccf);}});}else{return _0x5ecc55[_0xe20d('0x12')](0xc8)[_0xe20d('0x11')]({'output':_0xe20d('0x34')});}};
\ No newline at end of file
+var _0x7096=['constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','version','query','latest','fetch','tags','exports','2.0.0','status','json','master','error','info','git\x20fetch','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','catch','migrations','join','length','.js','push','sort','sequelize','Migration','getQueryInterface'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x7096,0x10c));var _0x6709=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7096[_0x1035c1];return _0x308d67;};'use strict';var Umzug=require('umzug');var path=require(_0x6709('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x6709('0x1'))(module,'version');var compareVersions=require(_0x6709('0x2'));var exec=require(_0x6709('0x3'))[_0x6709('0x4')];var db=require(_0x6709('0x5'))['db'];var config=require(_0x6709('0x6'));var pm2=require(_0x6709('0x7'));var logger=require(_0x6709('0x8'))(_0x6709('0x9'));var git=require(_0x6709('0xa'))(config[_0x6709('0xb')]);exports[_0x6709('0xc')]=function(_0x985814,_0x30147f){var _0x513ab6={'current':module['exports'][_0x6709('0xd')],'phonebar':0x2};if(_0x985814[_0x6709('0xe')]&&_0x985814[_0x6709('0xe')][_0x6709('0xf')]){return git[_0x6709('0x10')]()[_0x6709('0x11')](function(_0x5de1fa,_0x5b9f26){_0x513ab6[_0x6709('0xf')]=(_0x5de1fa?module[_0x6709('0x12')][_0x6709('0xd')]:_0x5b9f26[_0x6709('0xf')])||_0x6709('0x13');return _0x30147f[_0x6709('0x14')](0xc8)[_0x6709('0x15')](_0x513ab6);});}else{return _0x30147f[_0x6709('0x14')](0xc8)['json'](_0x513ab6);}};exports[_0x6709('0x10')]=function(_0xf59b6e,_0x4d5255){return git[_0x6709('0x10')](['origin',_0x6709('0x16')],function(_0x5c667c){if(_0x5c667c){logger[_0x6709('0x17')](_0x5c667c);return _0x4d5255['status'](0x1f4)[_0x6709('0x15')](_0x5c667c);}logger[_0x6709('0x18')](_0x6709('0x19'));return _0x4d5255[_0x6709('0x14')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x3fa5b1,_0x235a54){return git['reset']([_0x6709('0x1a'),_0x6709('0x1b')],function(_0xf1a70d){if(_0xf1a70d){logger['error'](_0xf1a70d);return _0x235a54[_0x6709('0x14')](0x1f4)[_0x6709('0x15')](_0xf1a70d);}logger[_0x6709('0x18')](_0x6709('0x1c'));return _0x235a54['status'](0xc8)[_0x6709('0x15')]({'output':_0x6709('0x1d')});});};exports[_0x6709('0x1e')]=function(_0x3cf882,_0x78f61a){exec(_0x6709('0x1f'),function(_0x45921e,_0x17763d,_0x386224){logger[_0x6709('0x18')](_0x17763d);logger[_0x6709('0x18')](_0x386224);if(_0x45921e){logger[_0x6709('0x17')](_0x45921e);return _0x78f61a['status'](0x1f4)[_0x6709('0x15')](_0x45921e);}return _0x78f61a[_0x6709('0x14')](0xc8)[_0x6709('0x15')]({'output':_0x17763d});});};exports['restart']=function(_0x2e3483,_0x32d346){return pm2[_0x6709('0x20')](_0x6709('0x21'))['then'](function(_0x241428){logger[_0x6709('0x18')]('pm2\x20restart\x20motion\x20%s',_0x241428);return _0x32d346[_0x6709('0x14')](0xc8)[_0x6709('0x15')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x6709('0x22')](function(_0x2499a2){logger['error'](_0x2499a2);return _0x32d346[_0x6709('0x14')](0x1f4)['json'](_0x2499a2);});};exports[_0x6709('0x23')]=function(_0x3cd555,_0x5b6906){var _0x137137=fs['readdirSync'](path[_0x6709('0x24')](config[_0x6709('0xb')],'server',_0x6709('0x23')));var _0x5deff5=[];for(var _0x138318=0x0;_0x138318<_0x137137[_0x6709('0x25')];_0x138318++){var _0x4b93b2=_0x137137[_0x138318]['replace'](_0x6709('0x26'),'');if(compareVersions(module[_0x6709('0x12')][_0x6709('0xd')],_0x4b93b2)===-0x1){_0x5deff5[_0x6709('0x27')](_0x4b93b2);}}if(_0x5deff5[_0x6709('0x25')]){var _0x12d8d1=_0x5deff5[_0x6709('0x28')](compareVersions);var _0x402e45=new Umzug({'storage':_0x6709('0x29'),'storageOptions':{'model':db['Migration'],'modelName':_0x6709('0x2a'),'columnName':_0x6709('0xd')},'migrations':{'params':[db[_0x6709('0x29')][_0x6709('0x2b')](),db['sequelize'][_0x6709('0x2c')],function(){throw new Error(_0x6709('0x2d'));}],'path':path[_0x6709('0x24')](config[_0x6709('0xb')],'server',_0x6709('0x23')),'pattern':/\.js$/}});_0x402e45['up']({'migrations':_[_0x6709('0x2e')](_0x12d8d1,function(_0x530973){return _0x530973+_0x6709('0x26');})})[_0x6709('0x2f')](function(){return _0x5b6906['status'](0xc8)[_0x6709('0x15')]({'output':_0x6709('0x30')+module[_0x6709('0x12')][_0x6709('0xd')]+_0x6709('0x31')+_[_0x6709('0x32')](_0x12d8d1),'migrations':_[_0x6709('0x24')](_0x12d8d1)});})['catch'](function(_0x1cd361){if(_0x1cd361 instanceof db[_0x6709('0x29')]['UniqueConstraintError']){return _0x5b6906[_0x6709('0x14')](0xc8)[_0x6709('0x15')]({'output':_0x6709('0x33')});}else{return _0x5b6906[_0x6709('0x14')](0x1f4)[_0x6709('0x15')](_0x1cd361);}});}else{return _0x5b6906[_0x6709('0x14')](0xc8)['json']({'output':_0x6709('0x33')});}};
\ No newline at end of file
index 35b263e..d5be09b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6786=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x6786,0xa2));var _0x6678=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x6786[_0x4de9e8];return _0x4db0de;};'use strict';var multer=require(_0x6678('0x0'));var util=require('util');var path=require(_0x6678('0x1'));var timeout=require(_0x6678('0x2'));var express=require(_0x6678('0x3'));var router=express[_0x6678('0x4')]();var auth=require(_0x6678('0x5'));var interaction=require(_0x6678('0x6'));var config=require(_0x6678('0x7'));var controller=require(_0x6678('0x8'));router[_0x6678('0x9')]('/',auth[_0x6678('0xa')](),controller[_0x6678('0xb')]);router['get'](_0x6678('0xc'),auth[_0x6678('0xa')](),controller[_0x6678('0xd')]);router['get'](_0x6678('0xe'),auth[_0x6678('0xa')](),controller[_0x6678('0xf')]);router[_0x6678('0x10')]('/',auth['isAuthenticated'](),controller[_0x6678('0x11')]);router[_0x6678('0x12')](_0x6678('0xe'),auth[_0x6678('0xa')](),controller['update']);router[_0x6678('0x13')](_0x6678('0xe'),auth[_0x6678('0xa')](),controller[_0x6678('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1b85=['isAuthenticated','index','/describe','show','post','create','/:id','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x1b85,0xe2));var _0x51b8=function(_0x3c5e8b,_0x17513d){_0x3c5e8b=_0x3c5e8b-0x0;var _0x1784b6=_0x1b85[_0x3c5e8b];return _0x1784b6;};'use strict';var multer=require('multer');var util=require(_0x51b8('0x0'));var path=require(_0x51b8('0x1'));var timeout=require('connect-timeout');var express=require(_0x51b8('0x2'));var router=express['Router']();var auth=require(_0x51b8('0x3'));var interaction=require(_0x51b8('0x4'));var config=require(_0x51b8('0x5'));var controller=require(_0x51b8('0x6'));router[_0x51b8('0x7')]('/',auth[_0x51b8('0x8')](),controller[_0x51b8('0x9')]);router[_0x51b8('0x7')](_0x51b8('0xa'),auth[_0x51b8('0x8')](),controller['describe']);router[_0x51b8('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x51b8('0xb')]);router[_0x51b8('0xc')]('/',auth[_0x51b8('0x8')](),controller[_0x51b8('0xd')]);router['put'](_0x51b8('0xe'),auth[_0x51b8('0x8')](),controller['update']);router[_0x51b8('0xf')](_0x51b8('0xe'),auth[_0x51b8('0x8')](),controller[_0x51b8('0x10')]);module[_0x51b8('0x11')]=router;
\ No newline at end of file
index d706b44..747c567 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c09=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c09,0x102));var _0x97c0=function(_0x581be3,_0x2eba87){_0x581be3=_0x581be3-0x0;var _0x40f732=_0x7c09[_0x581be3];return _0x40f732;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'type':{'type':Sequelize[_0x97c0('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x97c0('0x1')]},'calleridname':{'type':Sequelize[_0x97c0('0x1')]},'queue':{'type':Sequelize[_0x97c0('0x1')]},'interface':{'type':Sequelize[_0x97c0('0x1')]},'membername':{'type':Sequelize[_0x97c0('0x1')]},'agentcalledAt':{'type':Sequelize[_0x97c0('0x2')]},'agentconnectAt':{'type':Sequelize[_0x97c0('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x97c0('0x3')]},'agentcomplete':{'type':Sequelize[_0x97c0('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x97c0('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x97c0('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x97c0('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x97c0('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x97c0('0x1')]},'channel':{'type':Sequelize[_0x97c0('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x97c0('0x1')]},'connectedlinename':{'type':Sequelize[_0x97c0('0x1')]},'language':{'type':Sequelize[_0x97c0('0x1')]},'accountcode':{'type':Sequelize[_0x97c0('0x1')]},'context':{'type':Sequelize[_0x97c0('0x1')]},'exten':{'type':Sequelize[_0x97c0('0x1')]},'priority':{'type':Sequelize[_0x97c0('0x1')]},'destchannel':{'type':Sequelize[_0x97c0('0x1')]},'destchannelstate':{'type':Sequelize[_0x97c0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x97c0('0x1')]},'destcalleridnum':{'type':Sequelize[_0x97c0('0x1')]},'destcalleridname':{'type':Sequelize[_0x97c0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x97c0('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x97c0('0x1')]},'destaccountcode':{'type':Sequelize[_0x97c0('0x1')]},'destcontext':{'type':Sequelize[_0x97c0('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x97c0('0x1')]},'destuniqueid':{'type':Sequelize[_0x97c0('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x97c0('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x97c0('0x1')]},'transfer':{'type':Sequelize[_0x97c0('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x97c0('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x97c0('0x1')]},'transferuniqueid':{'type':Sequelize[_0x97c0('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa630=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xa630,0xbe));var _0x0a63=function(_0x33840e,_0x45b058){_0x33840e=_0x33840e-0x0;var _0x3bf4ec=_0xa630[_0x33840e];return _0x3bf4ec;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0a63('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0a63('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0a63('0x2')]},'agentcalledAt':{'type':Sequelize[_0x0a63('0x3')]},'agentconnectAt':{'type':Sequelize[_0x0a63('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x0a63('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x0a63('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x0a63('0x4')]},'agentcomplete':{'type':Sequelize[_0x0a63('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x0a63('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x0a63('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x0a63('0x4')]},'agentacw':{'type':Sequelize[_0x0a63('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x0a63('0x2')]},'lastevent':{'type':Sequelize[_0x0a63('0x2')]},'channel':{'type':Sequelize[_0x0a63('0x2')]},'channelstate':{'type':Sequelize[_0x0a63('0x4')]},'channelstatedesc':{'type':Sequelize[_0x0a63('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0a63('0x2')]},'connectedlinename':{'type':Sequelize[_0x0a63('0x2')]},'language':{'type':Sequelize[_0x0a63('0x2')]},'accountcode':{'type':Sequelize[_0x0a63('0x2')]},'context':{'type':Sequelize[_0x0a63('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0a63('0x2')]},'destchannel':{'type':Sequelize[_0x0a63('0x2')]},'destchannelstate':{'type':Sequelize[_0x0a63('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x0a63('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x0a63('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x0a63('0x2')]},'destlanguage':{'type':Sequelize[_0x0a63('0x2')]},'destaccountcode':{'type':Sequelize[_0x0a63('0x2')]},'destcontext':{'type':Sequelize[_0x0a63('0x2')]},'destexten':{'type':Sequelize[_0x0a63('0x2')]},'destpriority':{'type':Sequelize[_0x0a63('0x2')]},'destuniqueid':{'type':Sequelize[_0x0a63('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x0a63('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x0a63('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x0a63('0x6')},'transferexten':{'type':Sequelize[_0x0a63('0x2')]},'transferuniqueid':{'type':Sequelize[_0x0a63('0x2')]},'agententerreason':{'type':Sequelize[_0x0a63('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 4b5ef2e..5e3e1c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6d8=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','VIRTUAL','filter','merge','include','VoiceAgentReport','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','type'];(function(_0x2a4902,_0x3e035b){var _0x677b1a=function(_0x32c297){while(--_0x32c297){_0x2a4902['push'](_0x2a4902['shift']());}};_0x677b1a(++_0x3e035b);}(_0xb6d8,0x69));var _0x8b6d=function(_0x5f1fe2,_0xed9898){_0x5f1fe2=_0x5f1fe2-0x0;var _0x127d17=_0xb6d8[_0x5f1fe2];return _0x127d17;};'use strict';var pdf=require(_0x8b6d('0x0'));var emlformat=require(_0x8b6d('0x1'));var rimraf=require(_0x8b6d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b6d('0x3'));var rp=require(_0x8b6d('0x4'));var moment=require(_0x8b6d('0x5'));var BPromise=require(_0x8b6d('0x6'));var Mustache=require(_0x8b6d('0x7'));var util=require(_0x8b6d('0x8'));var path=require(_0x8b6d('0x9'));var sox=require(_0x8b6d('0xa'));var csv=require(_0x8b6d('0xb'));var ejs=require(_0x8b6d('0xc'));var fs=require('fs');var _=require(_0x8b6d('0xd'));var squel=require(_0x8b6d('0xe'));var crypto=require(_0x8b6d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8b6d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8b6d('0x11'));var Redis=require(_0x8b6d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8b6d('0x13'));var as=require(_0x8b6d('0x14'));var hardwareService=require(_0x8b6d('0x15'));var logger=require(_0x8b6d('0x16'))(_0x8b6d('0x17'));var utils=require('../../config/utils');var config=require(_0x8b6d('0x18'));var db=require(_0x8b6d('0x19'))['db'];function respondWithStatusCode(_0x18bde7,_0x367087){_0x367087=_0x367087||0xcc;return function(_0x23e7c7){if(_0x23e7c7){return _0x18bde7['sendStatus'](_0x367087);}return _0x18bde7['status'](_0x367087)[_0x8b6d('0x1a')]();};}function respondWithResult(_0x116f6a,_0x466c2b){_0x466c2b=_0x466c2b||0xc8;return function(_0x12da1d){if(_0x12da1d){return _0x116f6a[_0x8b6d('0x1b')](_0x466c2b)[_0x8b6d('0x1c')](_0x12da1d);}};}function respondWithFilteredResult(_0x590bee,_0x1b1030){return function(_0x50ab23){if(_0x50ab23){var _0x30be20=_0x50ab23[_0x8b6d('0x1d')],_0x53f953=_0x1b1030['offset'],_0xf62019=_0x1b1030[_0x8b6d('0x1e')]+_0x1b1030[_0x8b6d('0x1f')],_0x1570d9;if(_0xf62019>=_0x30be20){_0xf62019=_0x30be20;_0x1570d9=0xc8;}else{_0x1570d9=0xce;}_0x590bee[_0x8b6d('0x1b')](_0x1570d9);return _0x590bee[_0x8b6d('0x20')](_0x8b6d('0x21'),_0x53f953+'-'+_0xf62019+'/'+_0x30be20)[_0x8b6d('0x1c')](_0x50ab23);}return null;};}function patchUpdates(_0x7cec11){return function(_0x5c2f4f){try{jsonpatch[_0x8b6d('0x22')](_0x5c2f4f,_0x7cec11,!![]);}catch(_0x1b1cd9){return BPromise[_0x8b6d('0x23')](_0x1b1cd9);}return _0x5c2f4f[_0x8b6d('0x24')]();};}function saveUpdates(_0x331512,_0x5edfcc){return function(_0x444c40){if(_0x444c40){return _0x444c40[_0x8b6d('0x25')](_0x331512)[_0x8b6d('0x26')](function(_0x34e326){return _0x34e326;});}return null;};}function removeEntity(_0xddc8c3,_0x440820){return function(_0x3f4fb5){if(_0x3f4fb5){return _0x3f4fb5[_0x8b6d('0x27')]()[_0x8b6d('0x26')](function(){_0xddc8c3['status'](0xcc)[_0x8b6d('0x1a')]();});}};}function handleEntityNotFound(_0x34a7f9,_0x2e9fb6){return function(_0x2b3df5){if(!_0x2b3df5){_0x34a7f9[_0x8b6d('0x28')](0x194);}return _0x2b3df5;};}function handleError(_0x5cd4f5,_0x435775){_0x435775=_0x435775||0x1f4;return function(_0x5841e8){logger['error'](_0x5841e8[_0x8b6d('0x29')]);if(_0x5841e8['name']){delete _0x5841e8[_0x8b6d('0x2a')];}_0x5cd4f5[_0x8b6d('0x1b')](_0x435775)[_0x8b6d('0x2b')](_0x5841e8);};}exports['index']=function(_0x2cba4f,_0x4b4098){var _0x4d83ba={},_0x9eba2={},_0x5c770a={'count':0x0,'rows':[]};var _0x34b849=_['map'](db['VoiceAgentReport'][_0x8b6d('0x2c')],function(_0x15510c){return{'name':_0x15510c[_0x8b6d('0x2d')],'type':_0x15510c[_0x8b6d('0x2e')][_0x8b6d('0x2f')]};});_0x9eba2[_0x8b6d('0x30')]=_[_0x8b6d('0x31')](_0x34b849,_0x8b6d('0x2a'));_0x9eba2[_0x8b6d('0x32')]=_[_0x8b6d('0x33')](_0x2cba4f['query']);_0x9eba2[_0x8b6d('0x34')]=_[_0x8b6d('0x35')](_0x9eba2[_0x8b6d('0x30')],_0x9eba2[_0x8b6d('0x32')]);_0x4d83ba[_0x8b6d('0x36')]=_[_0x8b6d('0x35')](_0x9eba2['model'],qs[_0x8b6d('0x37')](_0x2cba4f[_0x8b6d('0x32')][_0x8b6d('0x37')]));_0x4d83ba[_0x8b6d('0x36')]=_0x4d83ba[_0x8b6d('0x36')][_0x8b6d('0x38')]?_0x4d83ba[_0x8b6d('0x36')]:_0x9eba2[_0x8b6d('0x30')];if(!_0x2cba4f['query'][_0x8b6d('0x39')](_0x8b6d('0x3a'))){_0x4d83ba[_0x8b6d('0x1f')]=qs['limit'](_0x2cba4f[_0x8b6d('0x32')][_0x8b6d('0x1f')]);_0x4d83ba['offset']=qs[_0x8b6d('0x1e')](_0x2cba4f[_0x8b6d('0x32')]['offset']);}_0x4d83ba['order']=qs['sort'](_0x2cba4f[_0x8b6d('0x32')]['sort']);_0x4d83ba[_0x8b6d('0x3b')]=qs[_0x8b6d('0x34')](_['pick'](_0x2cba4f[_0x8b6d('0x32')],_0x9eba2[_0x8b6d('0x34')]),_0x34b849);if(_0x2cba4f['query']['filter']){_0x4d83ba['where']=_['merge'](_0x4d83ba[_0x8b6d('0x3b')],{'$or':_[_0x8b6d('0x31')](_0x34b849,function(_0x44ec16){if(_0x44ec16[_0x8b6d('0x2e')]!==_0x8b6d('0x3c')){var _0x187452={};_0x187452[_0x44ec16[_0x8b6d('0x2a')]]={'$like':'%'+_0x2cba4f[_0x8b6d('0x32')][_0x8b6d('0x3d')]+'%'};return _0x187452;}})});}_0x4d83ba=_[_0x8b6d('0x3e')]({},_0x4d83ba,_0x2cba4f['options']);var _0x37ef84={'where':_0x4d83ba['where']};return db['VoiceAgentReport'][_0x8b6d('0x1d')](_0x37ef84)['then'](function(_0x5a4ac3){_0x5c770a[_0x8b6d('0x1d')]=_0x5a4ac3;if(_0x2cba4f[_0x8b6d('0x32')]['includeAll']){_0x4d83ba[_0x8b6d('0x3f')]=[{'all':!![]}];}return db[_0x8b6d('0x40')][_0x8b6d('0x41')](_0x4d83ba);})[_0x8b6d('0x26')](function(_0x522a23){_0x5c770a[_0x8b6d('0x42')]=_0x522a23;return _0x5c770a;})[_0x8b6d('0x26')](respondWithFilteredResult(_0x4b4098,_0x4d83ba))[_0x8b6d('0x43')](handleError(_0x4b4098,null));};exports[_0x8b6d('0x44')]=function(_0x5f2896,_0x343613){var _0x144c8a={'raw':![],'where':{'id':_0x5f2896[_0x8b6d('0x45')]['id']}},_0x21d293={};_0x21d293[_0x8b6d('0x30')]=_['keys'](db['VoiceAgentReport'][_0x8b6d('0x2c')]);_0x21d293[_0x8b6d('0x32')]=_[_0x8b6d('0x33')](_0x5f2896[_0x8b6d('0x32')]);_0x21d293[_0x8b6d('0x34')]=_[_0x8b6d('0x35')](_0x21d293[_0x8b6d('0x30')],_0x21d293[_0x8b6d('0x32')]);_0x144c8a[_0x8b6d('0x36')]=_[_0x8b6d('0x35')](_0x21d293['model'],qs[_0x8b6d('0x37')](_0x5f2896[_0x8b6d('0x32')][_0x8b6d('0x37')]));_0x144c8a[_0x8b6d('0x36')]=_0x144c8a['attributes']['length']?_0x144c8a['attributes']:_0x21d293['model'];if(_0x5f2896[_0x8b6d('0x32')][_0x8b6d('0x46')]){_0x144c8a['include']=[{'all':!![]}];}_0x144c8a=_['merge']({},_0x144c8a,_0x5f2896[_0x8b6d('0x47')]);return db[_0x8b6d('0x40')][_0x8b6d('0x48')](_0x144c8a)[_0x8b6d('0x26')](handleEntityNotFound(_0x343613,null))[_0x8b6d('0x26')](respondWithResult(_0x343613,null))[_0x8b6d('0x43')](handleError(_0x343613,null));};exports['create']=function(_0x27ee8b,_0x505364){return db[_0x8b6d('0x40')][_0x8b6d('0x49')](_0x27ee8b[_0x8b6d('0x4a')],{})[_0x8b6d('0x26')](respondWithResult(_0x505364,0xc9))[_0x8b6d('0x43')](handleError(_0x505364,null));};exports[_0x8b6d('0x25')]=function(_0x402b9e,_0x5abb52){if(_0x402b9e[_0x8b6d('0x4a')]['id']){delete _0x402b9e[_0x8b6d('0x4a')]['id'];}return db[_0x8b6d('0x40')][_0x8b6d('0x48')]({'where':{'id':_0x402b9e['params']['id']}})[_0x8b6d('0x26')](handleEntityNotFound(_0x5abb52,null))[_0x8b6d('0x26')](saveUpdates(_0x402b9e[_0x8b6d('0x4a')],null))['then'](respondWithResult(_0x5abb52,null))[_0x8b6d('0x43')](handleError(_0x5abb52,null));};exports[_0x8b6d('0x27')]=function(_0x3d5342,_0x149775){return db['VoiceAgentReport']['find']({'where':{'id':_0x3d5342['params']['id']}})[_0x8b6d('0x26')](handleEntityNotFound(_0x149775,null))['then'](removeEntity(_0x149775,null))[_0x8b6d('0x43')](handleError(_0x149775,null));};exports['describe']=function(_0x5217c2,_0x48d134){return db['VoiceAgentReport'][_0x8b6d('0x4b')]()[_0x8b6d('0x26')](respondWithResult(_0x48d134,null))[_0x8b6d('0x43')](handleError(_0x48d134,null));};
\ No newline at end of file
+var _0xbbe6=['crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','VoiceAgentReport','rows','catch','keys','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs'];(function(_0xc4f906,_0x2076b0){var _0xed62b8=function(_0x327491){while(--_0x327491){_0xc4f906['push'](_0xc4f906['shift']());}};_0xed62b8(++_0x2076b0);}(_0xbbe6,0x10f));var _0x6bbe=function(_0x266d17,_0x1278b8){_0x266d17=_0x266d17-0x0;var _0x9f39b8=_0xbbe6[_0x266d17];return _0x9f39b8;};'use strict';var pdf=require(_0x6bbe('0x0'));var emlformat=require(_0x6bbe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6bbe('0x2'));var jsonpatch=require(_0x6bbe('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6bbe('0x4'));var Mustache=require('mustache');var util=require(_0x6bbe('0x5'));var path=require(_0x6bbe('0x6'));var sox=require('sox');var csv=require(_0x6bbe('0x7'));var ejs=require(_0x6bbe('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6bbe('0x9'));var jsforce=require(_0x6bbe('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6bbe('0xb'));var Papa=require(_0x6bbe('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6bbe('0xd'));var as=require(_0x6bbe('0xe'));var hardwareService=require(_0x6bbe('0xf'));var logger=require(_0x6bbe('0x10'))(_0x6bbe('0x11'));var utils=require('../../config/utils');var config=require(_0x6bbe('0x12'));var db=require(_0x6bbe('0x13'))['db'];function respondWithStatusCode(_0x2a67fb,_0x263c95){_0x263c95=_0x263c95||0xcc;return function(_0x15b8c7){if(_0x15b8c7){return _0x2a67fb[_0x6bbe('0x14')](_0x263c95);}return _0x2a67fb[_0x6bbe('0x15')](_0x263c95)['end']();};}function respondWithResult(_0x2969b,_0x1fcdbc){_0x1fcdbc=_0x1fcdbc||0xc8;return function(_0x3ad6e7){if(_0x3ad6e7){return _0x2969b[_0x6bbe('0x15')](_0x1fcdbc)[_0x6bbe('0x16')](_0x3ad6e7);}};}function respondWithFilteredResult(_0x4defed,_0x1c792f){return function(_0x39ded2){if(_0x39ded2){var _0x85a593=_0x39ded2[_0x6bbe('0x17')],_0x52ef73=_0x1c792f[_0x6bbe('0x18')],_0x16c400=_0x1c792f['offset']+_0x1c792f[_0x6bbe('0x19')],_0x4555ce;if(_0x16c400>=_0x85a593){_0x16c400=_0x85a593;_0x4555ce=0xc8;}else{_0x4555ce=0xce;}_0x4defed[_0x6bbe('0x15')](_0x4555ce);return _0x4defed[_0x6bbe('0x1a')](_0x6bbe('0x1b'),_0x52ef73+'-'+_0x16c400+'/'+_0x85a593)[_0x6bbe('0x16')](_0x39ded2);}return null;};}function patchUpdates(_0x1652a7){return function(_0x2871ae){try{jsonpatch[_0x6bbe('0x1c')](_0x2871ae,_0x1652a7,!![]);}catch(_0x3bd33c){return BPromise[_0x6bbe('0x1d')](_0x3bd33c);}return _0x2871ae[_0x6bbe('0x1e')]();};}function saveUpdates(_0x59e4d6,_0xe2be38){return function(_0x864705){if(_0x864705){return _0x864705[_0x6bbe('0x1f')](_0x59e4d6)[_0x6bbe('0x20')](function(_0x5e6d28){return _0x5e6d28;});}return null;};}function removeEntity(_0x30a6aa,_0x2bd3cb){return function(_0x25a460){if(_0x25a460){return _0x25a460['destroy']()[_0x6bbe('0x20')](function(){_0x30a6aa[_0x6bbe('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a079,_0x654b40){return function(_0x34de8e){if(!_0x34de8e){_0x28a079['sendStatus'](0x194);}return _0x34de8e;};}function handleError(_0x33ec08,_0x3f5c77){_0x3f5c77=_0x3f5c77||0x1f4;return function(_0x26a5e7){logger[_0x6bbe('0x21')](_0x26a5e7[_0x6bbe('0x22')]);if(_0x26a5e7[_0x6bbe('0x23')]){delete _0x26a5e7['name'];}_0x33ec08[_0x6bbe('0x15')](_0x3f5c77)[_0x6bbe('0x24')](_0x26a5e7);};}exports[_0x6bbe('0x25')]=function(_0x37b9c2,_0x45ee3a){var _0x404c9c={},_0x3e8d8b={},_0x635fd4={'count':0x0,'rows':[]};var _0x4422f9=_[_0x6bbe('0x26')](db['VoiceAgentReport'][_0x6bbe('0x27')],function(_0x485dc2){return{'name':_0x485dc2[_0x6bbe('0x28')],'type':_0x485dc2[_0x6bbe('0x29')][_0x6bbe('0x2a')]};});_0x3e8d8b['model']=_[_0x6bbe('0x26')](_0x4422f9,_0x6bbe('0x23'));_0x3e8d8b[_0x6bbe('0x2b')]=_['keys'](_0x37b9c2['query']);_0x3e8d8b[_0x6bbe('0x2c')]=_[_0x6bbe('0x2d')](_0x3e8d8b['model'],_0x3e8d8b[_0x6bbe('0x2b')]);_0x404c9c['attributes']=_['intersection'](_0x3e8d8b[_0x6bbe('0x2e')],qs[_0x6bbe('0x2f')](_0x37b9c2[_0x6bbe('0x2b')][_0x6bbe('0x2f')]));_0x404c9c[_0x6bbe('0x30')]=_0x404c9c[_0x6bbe('0x30')][_0x6bbe('0x31')]?_0x404c9c[_0x6bbe('0x30')]:_0x3e8d8b[_0x6bbe('0x2e')];if(!_0x37b9c2[_0x6bbe('0x2b')][_0x6bbe('0x32')]('nolimit')){_0x404c9c[_0x6bbe('0x19')]=qs[_0x6bbe('0x19')](_0x37b9c2[_0x6bbe('0x2b')][_0x6bbe('0x19')]);_0x404c9c[_0x6bbe('0x18')]=qs['offset'](_0x37b9c2[_0x6bbe('0x2b')][_0x6bbe('0x18')]);}_0x404c9c[_0x6bbe('0x33')]=qs[_0x6bbe('0x34')](_0x37b9c2[_0x6bbe('0x2b')][_0x6bbe('0x34')]);_0x404c9c['where']=qs['filters'](_[_0x6bbe('0x35')](_0x37b9c2[_0x6bbe('0x2b')],_0x3e8d8b[_0x6bbe('0x2c')]),_0x4422f9);if(_0x37b9c2[_0x6bbe('0x2b')][_0x6bbe('0x36')]){_0x404c9c[_0x6bbe('0x37')]=_['merge'](_0x404c9c[_0x6bbe('0x37')],{'$or':_[_0x6bbe('0x26')](_0x4422f9,function(_0x10f1b7){if(_0x10f1b7[_0x6bbe('0x29')]!==_0x6bbe('0x38')){var _0x2c77f0={};_0x2c77f0[_0x10f1b7['name']]={'$like':'%'+_0x37b9c2['query'][_0x6bbe('0x36')]+'%'};return _0x2c77f0;}})});}_0x404c9c=_[_0x6bbe('0x39')]({},_0x404c9c,_0x37b9c2[_0x6bbe('0x3a')]);var _0x211263={'where':_0x404c9c[_0x6bbe('0x37')]};return db['VoiceAgentReport'][_0x6bbe('0x17')](_0x211263)[_0x6bbe('0x20')](function(_0x54de7f){_0x635fd4['count']=_0x54de7f;if(_0x37b9c2[_0x6bbe('0x2b')][_0x6bbe('0x3b')]){_0x404c9c[_0x6bbe('0x3c')]=[{'all':!![]}];}return db[_0x6bbe('0x3d')]['findAll'](_0x404c9c);})[_0x6bbe('0x20')](function(_0x1d7e23){_0x635fd4[_0x6bbe('0x3e')]=_0x1d7e23;return _0x635fd4;})['then'](respondWithFilteredResult(_0x45ee3a,_0x404c9c))[_0x6bbe('0x3f')](handleError(_0x45ee3a,null));};exports['show']=function(_0x885de8,_0x8d9b12){var _0x21cf73={'raw':![],'where':{'id':_0x885de8['params']['id']}},_0x3f888f={};_0x3f888f[_0x6bbe('0x2e')]=_[_0x6bbe('0x40')](db[_0x6bbe('0x3d')][_0x6bbe('0x27')]);_0x3f888f[_0x6bbe('0x2b')]=_['keys'](_0x885de8['query']);_0x3f888f[_0x6bbe('0x2c')]=_['intersection'](_0x3f888f['model'],_0x3f888f['query']);_0x21cf73[_0x6bbe('0x30')]=_[_0x6bbe('0x2d')](_0x3f888f[_0x6bbe('0x2e')],qs[_0x6bbe('0x2f')](_0x885de8[_0x6bbe('0x2b')][_0x6bbe('0x2f')]));_0x21cf73[_0x6bbe('0x30')]=_0x21cf73[_0x6bbe('0x30')]['length']?_0x21cf73[_0x6bbe('0x30')]:_0x3f888f[_0x6bbe('0x2e')];if(_0x885de8['query']['includeAll']){_0x21cf73[_0x6bbe('0x3c')]=[{'all':!![]}];}_0x21cf73=_['merge']({},_0x21cf73,_0x885de8[_0x6bbe('0x3a')]);return db['VoiceAgentReport'][_0x6bbe('0x41')](_0x21cf73)[_0x6bbe('0x20')](handleEntityNotFound(_0x8d9b12,null))[_0x6bbe('0x20')](respondWithResult(_0x8d9b12,null))['catch'](handleError(_0x8d9b12,null));};exports[_0x6bbe('0x42')]=function(_0x339d4f,_0x496853){return db[_0x6bbe('0x3d')]['create'](_0x339d4f[_0x6bbe('0x43')],{})[_0x6bbe('0x20')](respondWithResult(_0x496853,0xc9))[_0x6bbe('0x3f')](handleError(_0x496853,null));};exports['update']=function(_0xa4b3bf,_0xd768a){if(_0xa4b3bf['body']['id']){delete _0xa4b3bf[_0x6bbe('0x43')]['id'];}return db[_0x6bbe('0x3d')]['find']({'where':{'id':_0xa4b3bf[_0x6bbe('0x44')]['id']}})[_0x6bbe('0x20')](handleEntityNotFound(_0xd768a,null))[_0x6bbe('0x20')](saveUpdates(_0xa4b3bf[_0x6bbe('0x43')],null))['then'](respondWithResult(_0xd768a,null))[_0x6bbe('0x3f')](handleError(_0xd768a,null));};exports['destroy']=function(_0x33e602,_0xcb4635){return db[_0x6bbe('0x3d')][_0x6bbe('0x41')]({'where':{'id':_0x33e602[_0x6bbe('0x44')]['id']}})[_0x6bbe('0x20')](handleEntityNotFound(_0xcb4635,null))[_0x6bbe('0x20')](removeEntity(_0xcb4635,null))[_0x6bbe('0x3f')](handleError(_0xcb4635,null));};exports[_0x6bbe('0x45')]=function(_0x46e63b,_0x5698c1){return db[_0x6bbe('0x3d')]['describe']()[_0x6bbe('0x20')](respondWithResult(_0x5698c1,null))['catch'](handleError(_0x5698c1,null));};
\ No newline at end of file
index 793957a..a19a2d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2212=['path','../../config/environment','./voiceAgentReport.attributes','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x13b593,_0x85a736){var _0x1d2958=function(_0x371387){while(--_0x371387){_0x13b593['push'](_0x13b593['shift']());}};_0x1d2958(++_0x85a736);}(_0x2212,0x163));var _0x2221=function(_0x21f9db,_0x4c033b){_0x21f9db=_0x21f9db-0x0;var _0x42aac5=_0x2212[_0x21f9db];return _0x42aac5;};'use strict';var _=require(_0x2221('0x0'));var util=require(_0x2221('0x1'));var logger=require(_0x2221('0x2'))('api');var moment=require(_0x2221('0x3'));var BPromise=require(_0x2221('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2221('0x5'));var rimraf=require('rimraf');var config=require(_0x2221('0x6'));var attributes=require(_0x2221('0x7'));module['exports']=function(_0x596c4e,_0x3885b3){return _0x596c4e[_0x2221('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x2221('0x9'),'paranoid':![],'indexes':[{'fields':[_0x2221('0xa'),_0x2221('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0519=['exports','define','uniqueid','destuniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2f28ee,_0x100f4e){var _0x3bedf7=function(_0x258b12){while(--_0x258b12){_0x2f28ee['push'](_0x2f28ee['shift']());}};_0x3bedf7(++_0x100f4e);}(_0x0519,0xa0));var _0x9051=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x0519[_0x34325b];return _0x3da348;};'use strict';var _=require(_0x9051('0x0'));var util=require(_0x9051('0x1'));var logger=require(_0x9051('0x2'))(_0x9051('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9051('0x4'));var fs=require('fs');var path=require(_0x9051('0x5'));var rimraf=require(_0x9051('0x6'));var config=require(_0x9051('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x9051('0x8')]=function(_0xf953d2,_0x35931f){return _0xf953d2[_0x9051('0x9')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x9051('0xa'),_0x9051('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 10aeb5e..498c15e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc79=['VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','debug','update','where','attributes','UpdateVoiceAgentReport','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x7bf6be,_0x3aaffd){var _0x16f259=function(_0x6b7462){while(--_0x6b7462){_0x7bf6be['push'](_0x7bf6be['shift']());}};_0x16f259(++_0x3aaffd);}(_0xdc79,0x17f));var _0x9dc7=function(_0x1ee706,_0x139663){_0x1ee706=_0x1ee706-0x0;var _0x31cf53=_0xdc79[_0x1ee706];return _0x31cf53;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9dc7('0x0'));var fs=require('fs');var Redis=require(_0x9dc7('0x1'));var db=require(_0x9dc7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x9dc7('0x3'))(_0x9dc7('0x4'));var config=require('../../config/environment');var jayson=require(_0x9dc7('0x5'));var client=jayson[_0x9dc7('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bf33c,_0x191b25,_0x4ba422){return new BPromise(function(_0x3d9810,_0x37aeb3){return client[_0x9dc7('0x7')](_0x3bf33c,_0x4ba422)[_0x9dc7('0x8')](function(_0x21490a){logger['info'](_0x9dc7('0x9'),_0x191b25,'request\x20sent');logger['debug'](_0x9dc7('0xa'),_0x191b25,_0x9dc7('0xb'),JSON[_0x9dc7('0xc')](_0x21490a));if(_0x21490a[_0x9dc7('0xd')]){if(_0x21490a['error'][_0x9dc7('0xe')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x191b25,_0x21490a[_0x9dc7('0xd')][_0x9dc7('0xf')]);return _0x37aeb3(_0x21490a['error']['message']);}logger[_0x9dc7('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x191b25,_0x21490a['error'][_0x9dc7('0xf')]);return _0x3d9810(_0x21490a['error'][_0x9dc7('0xf')]);}else{logger[_0x9dc7('0x10')](_0x9dc7('0x9'),_0x191b25,_0x9dc7('0xb'));_0x3d9810(_0x21490a['result']['message']);}})[_0x9dc7('0x11')](function(_0x44db24){logger[_0x9dc7('0xd')](_0x9dc7('0x9'),_0x191b25,_0x44db24);_0x37aeb3(_0x44db24);});});}exports[_0x9dc7('0x12')]=function(_0x34123b){var _0x4de801=this;return new Promise(function(_0x513b1b,_0x1d75e8){return db[_0x9dc7('0x13')]['create'](_0x34123b[_0x9dc7('0x14')],{'raw':_0x34123b[_0x9dc7('0x15')]?_0x34123b[_0x9dc7('0x15')][_0x9dc7('0x16')]===undefined?!![]:![]:!![]})[_0x9dc7('0x8')](function(_0x16ff29){logger[_0x9dc7('0x10')]('CreateVoiceAgentReport',_0x34123b);logger[_0x9dc7('0x17')](_0x9dc7('0x12'),_0x34123b,JSON[_0x9dc7('0xc')](_0x16ff29));_0x513b1b(_0x16ff29);})[_0x9dc7('0x11')](function(_0x296e5a){logger['error'](_0x9dc7('0x12'),_0x296e5a['message'],_0x34123b);_0x1d75e8(_0x4de801[_0x9dc7('0xd')](0x1f4,_0x296e5a[_0x9dc7('0xf')]));});});};exports['UpdateVoiceAgentReport']=function(_0x2d4b5a){var _0x2463b3=this;return new Promise(function(_0x1d3b91,_0x51d146){return db[_0x9dc7('0x13')][_0x9dc7('0x18')](_0x2d4b5a['body'],{'raw':_0x2d4b5a[_0x9dc7('0x15')]?_0x2d4b5a[_0x9dc7('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d4b5a[_0x9dc7('0x15')]?_0x2d4b5a[_0x9dc7('0x15')][_0x9dc7('0x19')]||null:null,'attributes':_0x2d4b5a['options']?_0x2d4b5a[_0x9dc7('0x15')][_0x9dc7('0x1a')]||null:null,'limit':_0x2d4b5a['options']?_0x2d4b5a[_0x9dc7('0x15')]['limit']||null:null})[_0x9dc7('0x8')](function(_0x1927d1){logger[_0x9dc7('0x10')](_0x9dc7('0x1b'),_0x2d4b5a);logger['debug'](_0x9dc7('0x1b'),_0x2d4b5a,JSON[_0x9dc7('0xc')](_0x1927d1));_0x1d3b91(_0x1927d1);})['catch'](function(_0x4bbc29){logger[_0x9dc7('0xd')](_0x9dc7('0x1b'),_0x4bbc29[_0x9dc7('0xf')],_0x2d4b5a);_0x51d146(_0x2463b3[_0x9dc7('0xd')](0x1f4,_0x4bbc29[_0x9dc7('0xf')]));});});};
\ No newline at end of file
+var _0x8438=['request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceAgentReport','create','body','options','CreateVoiceAgentReport','debug','UpdateVoiceAgentReport','update','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','then','info','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x1f2d47,_0x553f32){var _0x46a512=function(_0xe3f200){while(--_0xe3f200){_0x1f2d47['push'](_0x1f2d47['shift']());}};_0x46a512(++_0x553f32);}(_0x8438,0x12b));var _0x8843=function(_0x24c272,_0x1d08fa){_0x24c272=_0x24c272-0x0;var _0x30debd=_0x8438[_0x24c272];return _0x30debd;};'use strict';var _=require(_0x8843('0x0'));var util=require(_0x8843('0x1'));var moment=require(_0x8843('0x2'));var BPromise=require(_0x8843('0x3'));var rs=require(_0x8843('0x4'));var fs=require('fs');var Redis=require(_0x8843('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8843('0x6'));var config=require('../../config/environment');var jayson=require(_0x8843('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19281a,_0x1f5a20,_0x547c85){return new BPromise(function(_0x2a30f1,_0x6aa221){return client['request'](_0x19281a,_0x547c85)[_0x8843('0x8')](function(_0x115a07){logger[_0x8843('0x9')](_0x8843('0xa'),_0x1f5a20,_0x8843('0xb'));logger['debug'](_0x8843('0xc'),_0x1f5a20,'request\x20sent',JSON[_0x8843('0xd')](_0x115a07));if(_0x115a07[_0x8843('0xe')]){if(_0x115a07[_0x8843('0xe')][_0x8843('0xf')]===0x1f4){logger[_0x8843('0xe')](_0x8843('0xa'),_0x1f5a20,_0x115a07[_0x8843('0xe')][_0x8843('0x10')]);return _0x6aa221(_0x115a07[_0x8843('0xe')]['message']);}logger[_0x8843('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x1f5a20,_0x115a07[_0x8843('0xe')][_0x8843('0x10')]);return _0x2a30f1(_0x115a07[_0x8843('0xe')][_0x8843('0x10')]);}else{logger[_0x8843('0x9')](_0x8843('0xa'),_0x1f5a20,'request\x20sent');_0x2a30f1(_0x115a07[_0x8843('0x11')][_0x8843('0x10')]);}})['catch'](function(_0x2b07c5){logger[_0x8843('0xe')](_0x8843('0xa'),_0x1f5a20,_0x2b07c5);_0x6aa221(_0x2b07c5);});});}exports['CreateVoiceAgentReport']=function(_0x3d8138){var _0x9ad105=this;return new Promise(function(_0x2f861b,_0x19bf21){return db[_0x8843('0x12')][_0x8843('0x13')](_0x3d8138[_0x8843('0x14')],{'raw':_0x3d8138[_0x8843('0x15')]?_0x3d8138[_0x8843('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x8843('0x8')](function(_0x122b75){logger[_0x8843('0x9')](_0x8843('0x16'),_0x3d8138);logger[_0x8843('0x17')](_0x8843('0x16'),_0x3d8138,JSON['stringify'](_0x122b75));_0x2f861b(_0x122b75);})['catch'](function(_0x1c7caa){logger[_0x8843('0xe')](_0x8843('0x16'),_0x1c7caa[_0x8843('0x10')],_0x3d8138);_0x19bf21(_0x9ad105[_0x8843('0xe')](0x1f4,_0x1c7caa[_0x8843('0x10')]));});});};exports[_0x8843('0x18')]=function(_0x4b6e6a){var _0xbcd265=this;return new Promise(function(_0x3d9ac9,_0xb1998d){return db[_0x8843('0x12')][_0x8843('0x19')](_0x4b6e6a[_0x8843('0x14')],{'raw':_0x4b6e6a[_0x8843('0x15')]?_0x4b6e6a[_0x8843('0x15')][_0x8843('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6e6a['options']?_0x4b6e6a['options'][_0x8843('0x1b')]||null:null,'attributes':_0x4b6e6a['options']?_0x4b6e6a[_0x8843('0x15')][_0x8843('0x1c')]||null:null,'limit':_0x4b6e6a[_0x8843('0x15')]?_0x4b6e6a['options'][_0x8843('0x1d')]||null:null})[_0x8843('0x8')](function(_0x1b4c49){logger[_0x8843('0x9')]('UpdateVoiceAgentReport',_0x4b6e6a);logger[_0x8843('0x17')]('UpdateVoiceAgentReport',_0x4b6e6a,JSON['stringify'](_0x1b4c49));_0x3d9ac9(_0x1b4c49);})[_0x8843('0x1e')](function(_0x138a69){logger[_0x8843('0xe')]('UpdateVoiceAgentReport',_0x138a69['message'],_0x4b6e6a);_0xb1998d(_0xbcd265['error'](0x1f4,_0x138a69[_0x8843('0x10')]));});});};
\ No newline at end of file
index 2c7337e..4b92b53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9382=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9382,0x12e));var _0x2938=function(_0x331ce8,_0x57ec88){_0x331ce8=_0x331ce8-0x0;var _0x380183=_0x9382[_0x331ce8];return _0x380183;};'use strict';var multer=require(_0x2938('0x0'));var util=require('util');var path=require(_0x2938('0x1'));var timeout=require(_0x2938('0x2'));var express=require(_0x2938('0x3'));var router=express[_0x2938('0x4')]();var auth=require(_0x2938('0x5'));var interaction=require(_0x2938('0x6'));var config=require(_0x2938('0x7'));var controller=require(_0x2938('0x8'));router[_0x2938('0x9')]('/',auth[_0x2938('0xa')](),controller[_0x2938('0xb')]);router[_0x2938('0x9')](_0x2938('0xc'),auth['isAuthenticated'](),controller[_0x2938('0xd')]);router[_0x2938('0x9')](_0x2938('0xe'),auth[_0x2938('0xa')](),controller[_0x2938('0xf')]);router[_0x2938('0x10')]('/',auth[_0x2938('0xa')](),controller[_0x2938('0x11')]);router[_0x2938('0x12')](_0x2938('0xe'),auth[_0x2938('0xa')](),controller[_0x2938('0x13')]);router[_0x2938('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2938('0x15')]=router;
\ No newline at end of file
+var _0x70c2=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x70c2,0x67));var _0x270c=function(_0x760e49,_0x11daff){_0x760e49=_0x760e49-0x0;var _0x564b9d=_0x70c2[_0x760e49];return _0x564b9d;};'use strict';var multer=require('multer');var util=require(_0x270c('0x0'));var path=require(_0x270c('0x1'));var timeout=require(_0x270c('0x2'));var express=require(_0x270c('0x3'));var router=express[_0x270c('0x4')]();var auth=require(_0x270c('0x5'));var interaction=require(_0x270c('0x6'));var config=require(_0x270c('0x7'));var controller=require(_0x270c('0x8'));router[_0x270c('0x9')]('/',auth[_0x270c('0xa')](),controller['index']);router[_0x270c('0x9')](_0x270c('0xb'),auth[_0x270c('0xa')](),controller[_0x270c('0xc')]);router['get'](_0x270c('0xd'),auth[_0x270c('0xa')](),controller[_0x270c('0xe')]);router[_0x270c('0xf')]('/',auth[_0x270c('0xa')](),controller['create']);router[_0x270c('0x10')](_0x270c('0xd'),auth[_0x270c('0xa')](),controller[_0x270c('0x11')]);router[_0x270c('0x12')](_0x270c('0xd'),auth[_0x270c('0xa')](),controller[_0x270c('0x13')]);module[_0x270c('0x14')]=router;
\ No newline at end of file
index 909743f..0e1568b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x7128ac,_0x598d86){var _0x31b48=function(_0x16dc95){while(--_0x16dc95){_0x7128ac['push'](_0x7128ac['shift']());}};_0x31b48(++_0x598d86);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x55caf1,_0x4a1c35){var _0x47c7d5=function(_0x283072){while(--_0x283072){_0x55caf1['push'](_0x55caf1['shift']());}};_0x47c7d5(++_0x4a1c35);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
index 3f478d4..795d412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf403=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','fullname','alias','User','catch','show','params','find','create','body','describe','user','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','type'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xf403,0x1e5));var _0x3f40=function(_0x4fbee0,_0x45f69c){_0x4fbee0=_0x4fbee0-0x0;var _0x465779=_0xf403[_0x4fbee0];return _0x465779;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3f40('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f40('0x1'));var rp=require(_0x3f40('0x2'));var moment=require(_0x3f40('0x3'));var BPromise=require(_0x3f40('0x4'));var Mustache=require('mustache');var util=require(_0x3f40('0x5'));var path=require(_0x3f40('0x6'));var sox=require(_0x3f40('0x7'));var csv=require(_0x3f40('0x8'));var ejs=require(_0x3f40('0x9'));var fs=require('fs');var _=require(_0x3f40('0xa'));var squel=require(_0x3f40('0xb'));var crypto=require('crypto');var jsforce=require(_0x3f40('0xc'));var deskjs=require(_0x3f40('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3f40('0xe'));var Papa=require(_0x3f40('0xf'));var Redis=require(_0x3f40('0x10'));var authService=require(_0x3f40('0x11'));var qs=require(_0x3f40('0x12'));var as=require(_0x3f40('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3f40('0x14'));var utils=require(_0x3f40('0x15'));var config=require(_0x3f40('0x16'));var db=require(_0x3f40('0x17'))['db'];function respondWithStatusCode(_0x3a8629,_0x43f618){_0x43f618=_0x43f618||0xcc;return function(_0x2360ea){if(_0x2360ea){return _0x3a8629['sendStatus'](_0x43f618);}return _0x3a8629[_0x3f40('0x18')](_0x43f618)[_0x3f40('0x19')]();};}function respondWithResult(_0x36e3e4,_0x2f32a1){_0x2f32a1=_0x2f32a1||0xc8;return function(_0x3cd4bd){if(_0x3cd4bd){return _0x36e3e4[_0x3f40('0x18')](_0x2f32a1)['json'](_0x3cd4bd);}};}function respondWithFilteredResult(_0x311dcb,_0x3e2654){return function(_0x44ce34){if(_0x44ce34){var _0x106fcf=_0x44ce34[_0x3f40('0x1a')],_0x11b538=_0x3e2654['offset'],_0x49514e=_0x3e2654[_0x3f40('0x1b')]+_0x3e2654[_0x3f40('0x1c')],_0x1a3539;if(_0x49514e>=_0x106fcf){_0x49514e=_0x106fcf;_0x1a3539=0xc8;}else{_0x1a3539=0xce;}_0x311dcb['status'](_0x1a3539);return _0x311dcb[_0x3f40('0x1d')](_0x3f40('0x1e'),_0x11b538+'-'+_0x49514e+'/'+_0x106fcf)['json'](_0x44ce34);}return null;};}function patchUpdates(_0x6af5aa){return function(_0xde3f8d){try{jsonpatch[_0x3f40('0x1f')](_0xde3f8d,_0x6af5aa,!![]);}catch(_0x47fca3){return BPromise['reject'](_0x47fca3);}return _0xde3f8d[_0x3f40('0x20')]();};}function saveUpdates(_0x31e24f,_0x13e619){return function(_0x5d0945){if(_0x5d0945){return _0x5d0945[_0x3f40('0x21')](_0x31e24f)[_0x3f40('0x22')](function(_0x4fd49a){return _0x4fd49a;});}return null;};}function removeEntity(_0x5ede22,_0x5dcf0e){return function(_0x3b915e){if(_0x3b915e){return _0x3b915e[_0x3f40('0x23')]()['then'](function(){_0x5ede22[_0x3f40('0x18')](0xcc)[_0x3f40('0x19')]();});}};}function handleEntityNotFound(_0x3604ff,_0x7c2d32){return function(_0x3731be){if(!_0x3731be){_0x3604ff[_0x3f40('0x24')](0x194);}return _0x3731be;};}function handleError(_0x3c98cd,_0x38db80){_0x38db80=_0x38db80||0x1f4;return function(_0x2c6845){logger[_0x3f40('0x25')](_0x2c6845[_0x3f40('0x26')]);if(_0x2c6845[_0x3f40('0x27')]){delete _0x2c6845[_0x3f40('0x27')];}_0x3c98cd['status'](_0x38db80)[_0x3f40('0x28')](_0x2c6845);};}exports[_0x3f40('0x29')]=function(_0x3e4c1c,_0x4e8642){var _0x42094b={},_0x24dcb0={},_0x533964={'count':0x0,'rows':[]};var _0x338e45=_[_0x3f40('0x2a')](db[_0x3f40('0x2b')][_0x3f40('0x2c')],function(_0x13f584){return{'name':_0x13f584[_0x3f40('0x2d')],'type':_0x13f584[_0x3f40('0x2e')][_0x3f40('0x2f')]};});_0x24dcb0[_0x3f40('0x30')]=_[_0x3f40('0x2a')](_0x338e45,_0x3f40('0x27'));_0x24dcb0[_0x3f40('0x31')]=_[_0x3f40('0x32')](_0x3e4c1c[_0x3f40('0x31')]);_0x24dcb0[_0x3f40('0x33')]=_[_0x3f40('0x34')](_0x24dcb0[_0x3f40('0x30')],_0x24dcb0[_0x3f40('0x31')]);_0x42094b[_0x3f40('0x35')]=_[_0x3f40('0x34')](_0x24dcb0[_0x3f40('0x30')],qs[_0x3f40('0x36')](_0x3e4c1c[_0x3f40('0x31')][_0x3f40('0x36')]));_0x42094b['attributes']=_0x42094b[_0x3f40('0x35')][_0x3f40('0x37')]?_0x42094b[_0x3f40('0x35')]:_0x24dcb0[_0x3f40('0x30')];if(!_0x3e4c1c['query']['hasOwnProperty'](_0x3f40('0x38'))){_0x42094b[_0x3f40('0x1c')]=qs[_0x3f40('0x1c')](_0x3e4c1c['query'][_0x3f40('0x1c')]);_0x42094b['offset']=qs[_0x3f40('0x1b')](_0x3e4c1c['query'][_0x3f40('0x1b')]);}_0x42094b['order']=qs['sort'](_0x3e4c1c[_0x3f40('0x31')][_0x3f40('0x39')]);_0x42094b[_0x3f40('0x3a')]=qs['filters'](_[_0x3f40('0x3b')](_0x3e4c1c['query'],_0x24dcb0[_0x3f40('0x33')]),_0x338e45);if(_0x3e4c1c[_0x3f40('0x31')][_0x3f40('0x3c')]){_0x42094b[_0x3f40('0x3a')]=_[_0x3f40('0x3d')](_0x42094b[_0x3f40('0x3a')],{'$or':_[_0x3f40('0x2a')](_0x338e45,function(_0x17cf6f){if(_0x17cf6f[_0x3f40('0x2e')]!=='VIRTUAL'){var _0x46282e={};_0x46282e[_0x17cf6f[_0x3f40('0x27')]]={'$like':'%'+_0x3e4c1c['query']['filter']+'%'};return _0x46282e;}})});}_0x42094b=_[_0x3f40('0x3d')]({},_0x42094b,_0x3e4c1c[_0x3f40('0x3e')]);var _0x534be1={'where':_0x42094b[_0x3f40('0x3a')]};return db[_0x3f40('0x2b')][_0x3f40('0x1a')](_0x534be1)[_0x3f40('0x22')](function(_0x4fa69b){_0x533964[_0x3f40('0x1a')]=_0x4fa69b;if(_0x3e4c1c['query'][_0x3f40('0x3f')]){_0x42094b[_0x3f40('0x40')]=[{'attributes':['id',_0x3f40('0x27'),_0x3f40('0x41'),_0x3f40('0x42')],'model':db[_0x3f40('0x43')],'as':_0x3f40('0x43')}];}return db[_0x3f40('0x2b')]['findAll'](_0x42094b);})[_0x3f40('0x22')](function(_0x35f877){_0x533964['rows']=_0x35f877;return _0x533964;})[_0x3f40('0x22')](respondWithFilteredResult(_0x4e8642,_0x42094b))[_0x3f40('0x44')](handleError(_0x4e8642,null));};exports[_0x3f40('0x45')]=function(_0x199edc,_0x3fba07){var _0x3e4810={'raw':!![],'where':{'id':_0x199edc[_0x3f40('0x46')]['id']}},_0x406507={};_0x406507['model']=_[_0x3f40('0x32')](db['VoiceCallReport'][_0x3f40('0x2c')]);_0x406507[_0x3f40('0x31')]=_[_0x3f40('0x32')](_0x199edc['query']);_0x406507['filters']=_[_0x3f40('0x34')](_0x406507['model'],_0x406507['query']);_0x3e4810[_0x3f40('0x35')]=_[_0x3f40('0x34')](_0x406507[_0x3f40('0x30')],qs[_0x3f40('0x36')](_0x199edc['query'][_0x3f40('0x36')]));_0x3e4810[_0x3f40('0x35')]=_0x3e4810[_0x3f40('0x35')][_0x3f40('0x37')]?_0x3e4810[_0x3f40('0x35')]:_0x406507[_0x3f40('0x30')];if(_0x199edc[_0x3f40('0x31')][_0x3f40('0x3f')]){_0x3e4810['include']=[{'all':!![]}];}_0x3e4810=_[_0x3f40('0x3d')]({},_0x3e4810,_0x199edc[_0x3f40('0x3e')]);return db['VoiceCallReport'][_0x3f40('0x47')](_0x3e4810)['then'](handleEntityNotFound(_0x3fba07,null))['then'](respondWithResult(_0x3fba07,null))[_0x3f40('0x44')](handleError(_0x3fba07,null));};exports[_0x3f40('0x48')]=function(_0x589119,_0x29ca08){return db[_0x3f40('0x2b')][_0x3f40('0x48')](_0x589119[_0x3f40('0x49')],{})[_0x3f40('0x22')](respondWithResult(_0x29ca08,0xc9))['catch'](handleError(_0x29ca08,null));};exports[_0x3f40('0x23')]=function(_0x254e19,_0x5e97d8){return db[_0x3f40('0x2b')]['find']({'where':{'id':_0x254e19[_0x3f40('0x46')]['id']}})[_0x3f40('0x22')](handleEntityNotFound(_0x5e97d8,null))['then'](removeEntity(_0x5e97d8,null))[_0x3f40('0x44')](handleError(_0x5e97d8,null));};exports[_0x3f40('0x4a')]=function(_0x1677c9,_0x3bbc3a){return db[_0x3f40('0x2b')][_0x3f40('0x4a')]()['then'](respondWithResult(_0x3bbc3a,null))[_0x3f40('0x44')](handleError(_0x3bbc3a,null));};exports['update']=function(_0x1c9378,_0x441429){if(_0x1c9378[_0x3f40('0x49')]['uniqueid']){delete _0x1c9378[_0x3f40('0x49')]['uniqueid'];}return db[_0x3f40('0x2b')][_0x3f40('0x47')]({'where':{'uniqueid':_0x1c9378[_0x3f40('0x46')]['id'],'UserId':{'$or':[null,_0x1c9378[_0x3f40('0x4b')]['id']]}}})[_0x3f40('0x22')](handleEntityNotFound(_0x441429,null))[_0x3f40('0x22')](saveUpdates(_0x1c9378[_0x3f40('0x49')],null))[_0x3f40('0x22')](respondWithResult(_0x441429,null))['catch'](handleError(_0x441429,null));};
\ No newline at end of file
+var _0x8fbc=['bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','then','includeAll','include','fullname','User','VoiceCallReport','findAll','show','params','find','catch','create','body','describe','update','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x8fbc,0xf3));var _0xc8fb=function(_0x1ddd84,_0x1edaba){_0x1ddd84=_0x1ddd84-0x0;var _0x48b212=_0x8fbc[_0x1ddd84];return _0x48b212;};'use strict';var pdf=require(_0xc8fb('0x0'));var emlformat=require(_0xc8fb('0x1'));var rimraf=require(_0xc8fb('0x2'));var zipdir=require(_0xc8fb('0x3'));var jsonpatch=require(_0xc8fb('0x4'));var rp=require(_0xc8fb('0x5'));var moment=require('moment');var BPromise=require(_0xc8fb('0x6'));var Mustache=require('mustache');var util=require(_0xc8fb('0x7'));var path=require(_0xc8fb('0x8'));var sox=require(_0xc8fb('0x9'));var csv=require(_0xc8fb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc8fb('0xb'));var squel=require(_0xc8fb('0xc'));var crypto=require(_0xc8fb('0xd'));var jsforce=require(_0xc8fb('0xe'));var deskjs=require(_0xc8fb('0xf'));var toCsv=require(_0xc8fb('0xa'));var querystring=require(_0xc8fb('0x10'));var Papa=require(_0xc8fb('0x11'));var Redis=require(_0xc8fb('0x12'));var authService=require(_0xc8fb('0x13'));var qs=require(_0xc8fb('0x14'));var as=require(_0xc8fb('0x15'));var hardwareService=require(_0xc8fb('0x16'));var logger=require(_0xc8fb('0x17'))(_0xc8fb('0x18'));var utils=require(_0xc8fb('0x19'));var config=require('../../config/environment');var db=require(_0xc8fb('0x1a'))['db'];function respondWithStatusCode(_0x366af7,_0x4f1684){_0x4f1684=_0x4f1684||0xcc;return function(_0x4d7617){if(_0x4d7617){return _0x366af7[_0xc8fb('0x1b')](_0x4f1684);}return _0x366af7[_0xc8fb('0x1c')](_0x4f1684)['end']();};}function respondWithResult(_0x4c560f,_0x236d98){_0x236d98=_0x236d98||0xc8;return function(_0x52ff5c){if(_0x52ff5c){return _0x4c560f['status'](_0x236d98)[_0xc8fb('0x1d')](_0x52ff5c);}};}function respondWithFilteredResult(_0x1bff83,_0x353dde){return function(_0x4e5aa2){if(_0x4e5aa2){var _0x4e2990=_0x4e5aa2['count'],_0x1de2fd=_0x353dde['offset'],_0x36b740=_0x353dde[_0xc8fb('0x1e')]+_0x353dde['limit'],_0x4903cf;if(_0x36b740>=_0x4e2990){_0x36b740=_0x4e2990;_0x4903cf=0xc8;}else{_0x4903cf=0xce;}_0x1bff83[_0xc8fb('0x1c')](_0x4903cf);return _0x1bff83['set'](_0xc8fb('0x1f'),_0x1de2fd+'-'+_0x36b740+'/'+_0x4e2990)[_0xc8fb('0x1d')](_0x4e5aa2);}return null;};}function patchUpdates(_0x15a7fa){return function(_0x47b951){try{jsonpatch[_0xc8fb('0x20')](_0x47b951,_0x15a7fa,!![]);}catch(_0xa60a7f){return BPromise[_0xc8fb('0x21')](_0xa60a7f);}return _0x47b951[_0xc8fb('0x22')]();};}function saveUpdates(_0x28d8e1,_0x4c0383){return function(_0x4a00d1){if(_0x4a00d1){return _0x4a00d1['update'](_0x28d8e1)['then'](function(_0x54f72d){return _0x54f72d;});}return null;};}function removeEntity(_0xbd4529,_0x4d0fc9){return function(_0x1d866b){if(_0x1d866b){return _0x1d866b[_0xc8fb('0x23')]()['then'](function(){_0xbd4529[_0xc8fb('0x1c')](0xcc)[_0xc8fb('0x24')]();});}};}function handleEntityNotFound(_0x1b0b65,_0x38c84b){return function(_0x58e2e4){if(!_0x58e2e4){_0x1b0b65[_0xc8fb('0x1b')](0x194);}return _0x58e2e4;};}function handleError(_0x752c77,_0x5912ac){_0x5912ac=_0x5912ac||0x1f4;return function(_0x4991e8){logger[_0xc8fb('0x25')](_0x4991e8[_0xc8fb('0x26')]);if(_0x4991e8[_0xc8fb('0x27')]){delete _0x4991e8['name'];}_0x752c77[_0xc8fb('0x1c')](_0x5912ac)[_0xc8fb('0x28')](_0x4991e8);};}exports[_0xc8fb('0x29')]=function(_0x2fc21c,_0x31e719){var _0x45a001={},_0x26fcbe={},_0x4e6c42={'count':0x0,'rows':[]};var _0x263209=_[_0xc8fb('0x2a')](db['VoiceCallReport'][_0xc8fb('0x2b')],function(_0x4a945c){return{'name':_0x4a945c[_0xc8fb('0x2c')],'type':_0x4a945c[_0xc8fb('0x2d')][_0xc8fb('0x2e')]};});_0x26fcbe[_0xc8fb('0x2f')]=_['map'](_0x263209,_0xc8fb('0x27'));_0x26fcbe['query']=_[_0xc8fb('0x30')](_0x2fc21c[_0xc8fb('0x31')]);_0x26fcbe['filters']=_[_0xc8fb('0x32')](_0x26fcbe['model'],_0x26fcbe['query']);_0x45a001[_0xc8fb('0x33')]=_[_0xc8fb('0x32')](_0x26fcbe[_0xc8fb('0x2f')],qs[_0xc8fb('0x34')](_0x2fc21c['query'][_0xc8fb('0x34')]));_0x45a001[_0xc8fb('0x33')]=_0x45a001[_0xc8fb('0x33')][_0xc8fb('0x35')]?_0x45a001[_0xc8fb('0x33')]:_0x26fcbe[_0xc8fb('0x2f')];if(!_0x2fc21c['query'][_0xc8fb('0x36')](_0xc8fb('0x37'))){_0x45a001[_0xc8fb('0x38')]=qs[_0xc8fb('0x38')](_0x2fc21c[_0xc8fb('0x31')]['limit']);_0x45a001[_0xc8fb('0x1e')]=qs[_0xc8fb('0x1e')](_0x2fc21c[_0xc8fb('0x31')][_0xc8fb('0x1e')]);}_0x45a001[_0xc8fb('0x39')]=qs[_0xc8fb('0x3a')](_0x2fc21c[_0xc8fb('0x31')][_0xc8fb('0x3a')]);_0x45a001[_0xc8fb('0x3b')]=qs[_0xc8fb('0x3c')](_['pick'](_0x2fc21c['query'],_0x26fcbe[_0xc8fb('0x3c')]),_0x263209);if(_0x2fc21c[_0xc8fb('0x31')][_0xc8fb('0x3d')]){_0x45a001[_0xc8fb('0x3b')]=_[_0xc8fb('0x3e')](_0x45a001['where'],{'$or':_[_0xc8fb('0x2a')](_0x263209,function(_0x59056f){if(_0x59056f['type']!==_0xc8fb('0x3f')){var _0x106327={};_0x106327[_0x59056f[_0xc8fb('0x27')]]={'$like':'%'+_0x2fc21c[_0xc8fb('0x31')][_0xc8fb('0x3d')]+'%'};return _0x106327;}})});}_0x45a001=_['merge']({},_0x45a001,_0x2fc21c[_0xc8fb('0x40')]);var _0x5223f2={'where':_0x45a001[_0xc8fb('0x3b')]};return db['VoiceCallReport'][_0xc8fb('0x41')](_0x5223f2)[_0xc8fb('0x42')](function(_0x22146e){_0x4e6c42[_0xc8fb('0x41')]=_0x22146e;if(_0x2fc21c[_0xc8fb('0x31')][_0xc8fb('0x43')]){_0x45a001[_0xc8fb('0x44')]=[{'attributes':['id',_0xc8fb('0x27'),_0xc8fb('0x45'),'alias'],'model':db['User'],'as':_0xc8fb('0x46')}];}return db[_0xc8fb('0x47')][_0xc8fb('0x48')](_0x45a001);})[_0xc8fb('0x42')](function(_0x3f24c0){_0x4e6c42['rows']=_0x3f24c0;return _0x4e6c42;})[_0xc8fb('0x42')](respondWithFilteredResult(_0x31e719,_0x45a001))['catch'](handleError(_0x31e719,null));};exports[_0xc8fb('0x49')]=function(_0x4143c5,_0x2f6387){var _0x68b3a1={'raw':!![],'where':{'id':_0x4143c5[_0xc8fb('0x4a')]['id']}},_0x2b2d6a={};_0x2b2d6a[_0xc8fb('0x2f')]=_[_0xc8fb('0x30')](db['VoiceCallReport']['rawAttributes']);_0x2b2d6a[_0xc8fb('0x31')]=_[_0xc8fb('0x30')](_0x4143c5[_0xc8fb('0x31')]);_0x2b2d6a[_0xc8fb('0x3c')]=_[_0xc8fb('0x32')](_0x2b2d6a[_0xc8fb('0x2f')],_0x2b2d6a[_0xc8fb('0x31')]);_0x68b3a1[_0xc8fb('0x33')]=_[_0xc8fb('0x32')](_0x2b2d6a[_0xc8fb('0x2f')],qs[_0xc8fb('0x34')](_0x4143c5['query'][_0xc8fb('0x34')]));_0x68b3a1['attributes']=_0x68b3a1['attributes'][_0xc8fb('0x35')]?_0x68b3a1[_0xc8fb('0x33')]:_0x2b2d6a[_0xc8fb('0x2f')];if(_0x4143c5[_0xc8fb('0x31')][_0xc8fb('0x43')]){_0x68b3a1[_0xc8fb('0x44')]=[{'all':!![]}];}_0x68b3a1=_['merge']({},_0x68b3a1,_0x4143c5[_0xc8fb('0x40')]);return db['VoiceCallReport'][_0xc8fb('0x4b')](_0x68b3a1)[_0xc8fb('0x42')](handleEntityNotFound(_0x2f6387,null))[_0xc8fb('0x42')](respondWithResult(_0x2f6387,null))[_0xc8fb('0x4c')](handleError(_0x2f6387,null));};exports[_0xc8fb('0x4d')]=function(_0x4929c7,_0x4e109b){return db[_0xc8fb('0x47')]['create'](_0x4929c7[_0xc8fb('0x4e')],{})[_0xc8fb('0x42')](respondWithResult(_0x4e109b,0xc9))[_0xc8fb('0x4c')](handleError(_0x4e109b,null));};exports[_0xc8fb('0x23')]=function(_0x4be8b7,_0xa4aef3){return db['VoiceCallReport'][_0xc8fb('0x4b')]({'where':{'id':_0x4be8b7[_0xc8fb('0x4a')]['id']}})[_0xc8fb('0x42')](handleEntityNotFound(_0xa4aef3,null))[_0xc8fb('0x42')](removeEntity(_0xa4aef3,null))[_0xc8fb('0x4c')](handleError(_0xa4aef3,null));};exports[_0xc8fb('0x4f')]=function(_0x2cbc9e,_0x3bdc2c){return db[_0xc8fb('0x47')][_0xc8fb('0x4f')]()[_0xc8fb('0x42')](respondWithResult(_0x3bdc2c,null))[_0xc8fb('0x4c')](handleError(_0x3bdc2c,null));};exports[_0xc8fb('0x50')]=function(_0x45e112,_0x30cf92){if(_0x45e112[_0xc8fb('0x4e')][_0xc8fb('0x51')]){delete _0x45e112[_0xc8fb('0x4e')][_0xc8fb('0x51')];}return db['VoiceCallReport'][_0xc8fb('0x4b')]({'where':{'uniqueid':_0x45e112['params']['id'],'UserId':{'$or':[null,_0x45e112[_0xc8fb('0x52')]['id']]}}})[_0xc8fb('0x42')](handleEntityNotFound(_0x30cf92,null))[_0xc8fb('0x42')](saveUpdates(_0x45e112[_0xc8fb('0x4e')],null))[_0xc8fb('0x42')](respondWithResult(_0x30cf92,null))['catch'](handleError(_0x30cf92,null));};
\ No newline at end of file
index 78592aa..6595949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd62a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','lodash','util'];(function(_0x47341e,_0x341983){var _0x2a8ae4=function(_0x266dbc){while(--_0x266dbc){_0x47341e['push'](_0x47341e['shift']());}};_0x2a8ae4(++_0x341983);}(_0xd62a,0x136));var _0xad62=function(_0x2c12d9,_0x32cc28){_0x2c12d9=_0x2c12d9-0x0;var _0x1f2cb1=_0xd62a[_0x2c12d9];return _0x1f2cb1;};'use strict';var _=require(_0xad62('0x0'));var util=require(_0xad62('0x1'));var logger=require(_0xad62('0x2'))(_0xad62('0x3'));var moment=require(_0xad62('0x4'));var BPromise=require('bluebird');var rp=require(_0xad62('0x5'));var fs=require('fs');var path=require(_0xad62('0x6'));var rimraf=require(_0xad62('0x7'));var config=require(_0xad62('0x8'));var attributes=require(_0xad62('0x9'));module[_0xad62('0xa')]=function(_0x3caa97,_0x51d872){return _0x3caa97['define'](_0xad62('0xb'),attributes,{'tableName':_0xad62('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd900=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','report_call'];(function(_0x2ea461,_0x1db7ec){var _0xacc818=function(_0xe1a57f){while(--_0xe1a57f){_0x2ea461['push'](_0x2ea461['shift']());}};_0xacc818(++_0x1db7ec);}(_0xd900,0x112));var _0x0d90=function(_0x343308,_0x500535){_0x343308=_0x343308-0x0;var _0x1504f1=_0xd900[_0x343308];return _0x1504f1;};'use strict';var _=require(_0x0d90('0x0'));var util=require('util');var logger=require(_0x0d90('0x1'))(_0x0d90('0x2'));var moment=require(_0x0d90('0x3'));var BPromise=require(_0x0d90('0x4'));var rp=require(_0x0d90('0x5'));var fs=require('fs');var path=require(_0x0d90('0x6'));var rimraf=require(_0x0d90('0x7'));var config=require(_0x0d90('0x8'));var attributes=require(_0x0d90('0x9'));module['exports']=function(_0x1adf1e,_0x879281){return _0x1adf1e[_0x0d90('0xa')]('VoiceCallReport',attributes,{'tableName':_0x0d90('0xb'),'paranoid':![],'indexes':[{'fields':[_0x0d90('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index eab9e4f..033d036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea3f=['client','http','then','info','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','map','include','model','debug','body','raw','CreateVoiceCallReport','UpdateVoiceCallReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ccd24,_0x5a65ea){var _0x4c5bf2=function(_0x4490a5){while(--_0x4490a5){_0x2ccd24['push'](_0x2ccd24['shift']());}};_0x4c5bf2(++_0x5a65ea);}(_0xea3f,0xdf));var _0xfea3=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xea3f[_0x58a4fe];return _0x697de2;};'use strict';var _=require(_0xfea3('0x0'));var util=require(_0xfea3('0x1'));var moment=require(_0xfea3('0x2'));var BPromise=require(_0xfea3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfea3('0x4'));var db=require(_0xfea3('0x5'))['db'];var utils=require(_0xfea3('0x6'));var logger=require(_0xfea3('0x7'))(_0xfea3('0x8'));var config=require(_0xfea3('0x9'));var jayson=require(_0xfea3('0xa'));var client=jayson[_0xfea3('0xb')][_0xfea3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33d462,_0xe01267,_0x4476d4){return new BPromise(function(_0x42be16,_0x3b1097){return client['request'](_0x33d462,_0x4476d4)[_0xfea3('0xd')](function(_0x48c4a9){logger[_0xfea3('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0xe01267,_0xfea3('0xf'));logger['debug'](_0xfea3('0x10'),_0xe01267,_0xfea3('0xf'),JSON[_0xfea3('0x11')](_0x48c4a9));if(_0x48c4a9['error']){if(_0x48c4a9[_0xfea3('0x12')][_0xfea3('0x13')]===0x1f4){logger[_0xfea3('0x12')](_0xfea3('0x14'),_0xe01267,_0x48c4a9[_0xfea3('0x12')]['message']);return _0x3b1097(_0x48c4a9[_0xfea3('0x12')][_0xfea3('0x15')]);}logger[_0xfea3('0x12')](_0xfea3('0x14'),_0xe01267,_0x48c4a9[_0xfea3('0x12')][_0xfea3('0x15')]);return _0x42be16(_0x48c4a9[_0xfea3('0x12')][_0xfea3('0x15')]);}else{logger[_0xfea3('0xe')](_0xfea3('0x14'),_0xe01267,'request\x20sent');_0x42be16(_0x48c4a9[_0xfea3('0x16')][_0xfea3('0x15')]);}})[_0xfea3('0x17')](function(_0x568d75){logger[_0xfea3('0x12')](_0xfea3('0x14'),_0xe01267,_0x568d75);_0x3b1097(_0x568d75);});});}exports[_0xfea3('0x18')]=function(_0x4641fb){var _0x5e78fc=this;return new Promise(function(_0x13ed50,_0xc5518b){return db[_0xfea3('0x19')][_0xfea3('0x1a')]({'raw':_0x4641fb[_0xfea3('0x1b')]?_0x4641fb[_0xfea3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4641fb[_0xfea3('0x1b')]?_0x4641fb[_0xfea3('0x1b')][_0xfea3('0x1c')]||null:null,'attributes':_0x4641fb[_0xfea3('0x1b')]?_0x4641fb['options'][_0xfea3('0x1d')]||null:null,'limit':_0x4641fb[_0xfea3('0x1b')]?_0x4641fb[_0xfea3('0x1b')][_0xfea3('0x1e')]||null:null,'include':_0x4641fb[_0xfea3('0x1b')]?_0x4641fb[_0xfea3('0x1b')]['include']?_[_0xfea3('0x1f')](_0x4641fb['options'][_0xfea3('0x20')],function(_0x22c59d){return{'model':db[_0x22c59d[_0xfea3('0x21')]],'as':_0x22c59d['as'],'attributes':_0x22c59d[_0xfea3('0x1d')],'include':_0x22c59d[_0xfea3('0x20')]?_[_0xfea3('0x1f')](_0x22c59d['include'],function(_0x4d4887){return{'model':db[_0x4d4887[_0xfea3('0x21')]],'as':_0x4d4887['as'],'attributes':_0x4d4887['attributes'],'include':_0x4d4887[_0xfea3('0x20')]?_['map'](_0x4d4887[_0xfea3('0x20')],function(_0x5d6f52){return{'model':db[_0x5d6f52[_0xfea3('0x21')]],'as':_0x5d6f52['as'],'attributes':_0x5d6f52[_0xfea3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfea3('0xd')](function(_0x4bbf11){logger[_0xfea3('0xe')](_0xfea3('0x18'),_0x4641fb);logger[_0xfea3('0x22')](_0xfea3('0x18'),_0x4641fb,JSON[_0xfea3('0x11')](_0x4bbf11));_0x13ed50(_0x4bbf11);})[_0xfea3('0x17')](function(_0x358f24){logger[_0xfea3('0x12')](_0xfea3('0x18'),_0x358f24[_0xfea3('0x15')],_0x4641fb);_0xc5518b(_0x5e78fc['error'](0x1f4,_0x358f24[_0xfea3('0x15')]));});});};exports['CreateVoiceCallReport']=function(_0x46f15f){var _0xcb650d=this;return new Promise(function(_0xb333b5,_0x5d0537){return db[_0xfea3('0x19')]['create'](_0x46f15f[_0xfea3('0x23')],{'raw':_0x46f15f[_0xfea3('0x1b')]?_0x46f15f[_0xfea3('0x1b')][_0xfea3('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x4c09bc){logger['info'](_0xfea3('0x25'),_0x46f15f);logger[_0xfea3('0x22')](_0xfea3('0x25'),_0x46f15f,JSON[_0xfea3('0x11')](_0x4c09bc));_0xb333b5(_0x4c09bc);})[_0xfea3('0x17')](function(_0x5f037f){logger['error'](_0xfea3('0x25'),_0x5f037f[_0xfea3('0x15')],_0x46f15f);_0x5d0537(_0xcb650d[_0xfea3('0x12')](0x1f4,_0x5f037f[_0xfea3('0x15')]));});});};exports[_0xfea3('0x26')]=function(_0x2e0983){var _0x29eaf8=this;return new Promise(function(_0xf7dfaf,_0x266872){return db[_0xfea3('0x19')]['update'](_0x2e0983[_0xfea3('0x23')],{'raw':_0x2e0983['options']?_0x2e0983['options'][_0xfea3('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e0983[_0xfea3('0x1b')]?_0x2e0983['options'][_0xfea3('0x1c')]||null:null,'attributes':_0x2e0983['options']?_0x2e0983[_0xfea3('0x1b')][_0xfea3('0x1d')]||null:null,'limit':_0x2e0983[_0xfea3('0x1b')]?_0x2e0983[_0xfea3('0x1b')][_0xfea3('0x1e')]||null:null})[_0xfea3('0xd')](function(_0x2b1898){logger[_0xfea3('0xe')](_0xfea3('0x26'),_0x2e0983);logger[_0xfea3('0x22')](_0xfea3('0x26'),_0x2e0983,JSON[_0xfea3('0x11')](_0x2b1898));_0xf7dfaf(_0x2b1898);})[_0xfea3('0x17')](function(_0x14e912){logger[_0xfea3('0x12')]('UpdateVoiceCallReport',_0x14e912[_0xfea3('0x15')],_0x2e0983);_0x266872(_0x29eaf8[_0xfea3('0x12')](0x1f4,_0x14e912[_0xfea3('0x15')]));});});};
\ No newline at end of file
+var _0x32d2=['client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','create','body','raw','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','util','bluebird','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x2931a0,_0x4a28c6){var _0x509e62=function(_0x2a8247){while(--_0x2a8247){_0x2931a0['push'](_0x2931a0['shift']());}};_0x509e62(++_0x4a28c6);}(_0x32d2,0x1d7));var _0x232d=function(_0x26351f,_0x1c93e7){_0x26351f=_0x26351f-0x0;var _0x4f2f7c=_0x32d2[_0x26351f];return _0x4f2f7c;};'use strict';var _=require('lodash');var util=require(_0x232d('0x0'));var moment=require('moment');var BPromise=require(_0x232d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x232d('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x232d('0x3'));var jayson=require(_0x232d('0x4'));var client=jayson[_0x232d('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cd866,_0x4539be,_0xe879bd){return new BPromise(function(_0x2bed10,_0x54e573){return client['request'](_0x4cd866,_0xe879bd)[_0x232d('0x6')](function(_0x2e923a){logger[_0x232d('0x7')](_0x232d('0x8'),_0x4539be,_0x232d('0x9'));logger[_0x232d('0xa')](_0x232d('0xb'),_0x4539be,_0x232d('0x9'),JSON['stringify'](_0x2e923a));if(_0x2e923a['error']){if(_0x2e923a[_0x232d('0xc')][_0x232d('0xd')]===0x1f4){logger['error'](_0x232d('0x8'),_0x4539be,_0x2e923a[_0x232d('0xc')][_0x232d('0xe')]);return _0x54e573(_0x2e923a['error'][_0x232d('0xe')]);}logger[_0x232d('0xc')](_0x232d('0x8'),_0x4539be,_0x2e923a['error']['message']);return _0x2bed10(_0x2e923a['error'][_0x232d('0xe')]);}else{logger[_0x232d('0x7')](_0x232d('0x8'),_0x4539be,'request\x20sent');_0x2bed10(_0x2e923a[_0x232d('0xf')][_0x232d('0xe')]);}})[_0x232d('0x10')](function(_0x321c38){logger[_0x232d('0xc')](_0x232d('0x8'),_0x4539be,_0x321c38);_0x54e573(_0x321c38);});});}exports[_0x232d('0x11')]=function(_0x2aa474){var _0x5e9a9b=this;return new Promise(function(_0x2ed6bd,_0x5cae6c){return db[_0x232d('0x12')][_0x232d('0x13')]({'raw':_0x2aa474[_0x232d('0x14')]?_0x2aa474[_0x232d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2aa474['options']?_0x2aa474[_0x232d('0x14')][_0x232d('0x15')]||null:null,'attributes':_0x2aa474[_0x232d('0x14')]?_0x2aa474['options'][_0x232d('0x16')]||null:null,'limit':_0x2aa474[_0x232d('0x14')]?_0x2aa474[_0x232d('0x14')][_0x232d('0x17')]||null:null,'include':_0x2aa474[_0x232d('0x14')]?_0x2aa474[_0x232d('0x14')][_0x232d('0x18')]?_[_0x232d('0x19')](_0x2aa474['options'][_0x232d('0x18')],function(_0x1287cd){return{'model':db[_0x1287cd[_0x232d('0x1a')]],'as':_0x1287cd['as'],'attributes':_0x1287cd[_0x232d('0x16')],'include':_0x1287cd[_0x232d('0x18')]?_[_0x232d('0x19')](_0x1287cd[_0x232d('0x18')],function(_0x4bdc46){return{'model':db[_0x4bdc46[_0x232d('0x1a')]],'as':_0x4bdc46['as'],'attributes':_0x4bdc46[_0x232d('0x16')],'include':_0x4bdc46[_0x232d('0x18')]?_[_0x232d('0x19')](_0x4bdc46['include'],function(_0xd8c670){return{'model':db[_0xd8c670[_0x232d('0x1a')]],'as':_0xd8c670['as'],'attributes':_0xd8c670[_0x232d('0x16')]};}):[]};}):[]};}):[]:[]})[_0x232d('0x6')](function(_0x333ad5){logger[_0x232d('0x7')]('GetVoiceCallReport',_0x2aa474);logger[_0x232d('0xa')](_0x232d('0x11'),_0x2aa474,JSON['stringify'](_0x333ad5));_0x2ed6bd(_0x333ad5);})[_0x232d('0x10')](function(_0x4f757b){logger[_0x232d('0xc')](_0x232d('0x11'),_0x4f757b[_0x232d('0xe')],_0x2aa474);_0x5cae6c(_0x5e9a9b[_0x232d('0xc')](0x1f4,_0x4f757b['message']));});});};exports['CreateVoiceCallReport']=function(_0x4a509b){var _0x5e982d=this;return new Promise(function(_0x4b55aa,_0x43e81e){return db[_0x232d('0x12')][_0x232d('0x1b')](_0x4a509b[_0x232d('0x1c')],{'raw':_0x4a509b[_0x232d('0x14')]?_0x4a509b[_0x232d('0x14')][_0x232d('0x1d')]===undefined?!![]:![]:!![]})[_0x232d('0x6')](function(_0x1c1c54){logger[_0x232d('0x7')](_0x232d('0x1e'),_0x4a509b);logger[_0x232d('0xa')](_0x232d('0x1e'),_0x4a509b,JSON[_0x232d('0x1f')](_0x1c1c54));_0x4b55aa(_0x1c1c54);})[_0x232d('0x10')](function(_0x5f4f6b){logger[_0x232d('0xc')]('CreateVoiceCallReport',_0x5f4f6b[_0x232d('0xe')],_0x4a509b);_0x43e81e(_0x5e982d['error'](0x1f4,_0x5f4f6b[_0x232d('0xe')]));});});};exports[_0x232d('0x20')]=function(_0x5f88f7){var _0x6b66c5=this;return new Promise(function(_0x413df6,_0x8ef785){return db[_0x232d('0x12')][_0x232d('0x21')](_0x5f88f7[_0x232d('0x1c')],{'raw':_0x5f88f7[_0x232d('0x14')]?_0x5f88f7[_0x232d('0x14')][_0x232d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f88f7['options']?_0x5f88f7[_0x232d('0x14')]['where']||null:null,'attributes':_0x5f88f7[_0x232d('0x14')]?_0x5f88f7[_0x232d('0x14')]['attributes']||null:null,'limit':_0x5f88f7[_0x232d('0x14')]?_0x5f88f7[_0x232d('0x14')]['limit']||null:null})[_0x232d('0x6')](function(_0x2eb27d){logger['info'](_0x232d('0x20'),_0x5f88f7);logger[_0x232d('0xa')](_0x232d('0x20'),_0x5f88f7,JSON[_0x232d('0x1f')](_0x2eb27d));_0x413df6(_0x2eb27d);})[_0x232d('0x10')](function(_0x27f166){logger['error']('UpdateVoiceCallReport',_0x27f166[_0x232d('0xe')],_0x5f88f7);_0x8ef785(_0x6b66c5['error'](0x1f4,_0x27f166[_0x232d('0xe')]));});});};
\ No newline at end of file
index c0b0c15..6694633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fb7=['isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xb24e8e,_0x3b0dc1){var _0x36ff4b=function(_0x408d81){while(--_0x408d81){_0xb24e8e['push'](_0xb24e8e['shift']());}};_0x36ff4b(++_0x3b0dc1);}(_0x2fb7,0x90));var _0x72fb=function(_0x38f2bd,_0x704ad9){_0x38f2bd=_0x38f2bd-0x0;var _0x5ddbb6=_0x2fb7[_0x38f2bd];return _0x5ddbb6;};'use strict';var multer=require('multer');var util=require(_0x72fb('0x0'));var path=require(_0x72fb('0x1'));var timeout=require(_0x72fb('0x2'));var express=require(_0x72fb('0x3'));var router=express['Router']();var auth=require(_0x72fb('0x4'));var interaction=require(_0x72fb('0x5'));var config=require(_0x72fb('0x6'));var controller=require('./voiceChanSpy.controller');router[_0x72fb('0x7')]('/',auth[_0x72fb('0x8')](),controller[_0x72fb('0x9')]);router[_0x72fb('0x7')]('/:id',auth[_0x72fb('0x8')](),controller[_0x72fb('0xa')]);router[_0x72fb('0xb')]('/',auth['isAuthenticated'](),controller[_0x72fb('0xc')]);router[_0x72fb('0xd')](_0x72fb('0xe'),auth[_0x72fb('0x8')](),controller[_0x72fb('0xf')]);router[_0x72fb('0x10')](_0x72fb('0xe'),auth[_0x72fb('0x8')](),controller[_0x72fb('0x11')]);module[_0x72fb('0x12')]=router;
\ No newline at end of file
+var _0xc83b=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','/:id','post','put','update','multer'];(function(_0x455dd2,_0x56e6ef){var _0x13d632=function(_0x4f5a00){while(--_0x4f5a00){_0x455dd2['push'](_0x455dd2['shift']());}};_0x13d632(++_0x56e6ef);}(_0xc83b,0xa4));var _0xbc83=function(_0x51d2bb,_0x58e3ad){_0x51d2bb=_0x51d2bb-0x0;var _0xc3d3de=_0xc83b[_0x51d2bb];return _0xc3d3de;};'use strict';var multer=require(_0xbc83('0x0'));var util=require(_0xbc83('0x1'));var path=require(_0xbc83('0x2'));var timeout=require(_0xbc83('0x3'));var express=require('express');var router=express[_0xbc83('0x4')]();var auth=require(_0xbc83('0x5'));var interaction=require(_0xbc83('0x6'));var config=require(_0xbc83('0x7'));var controller=require(_0xbc83('0x8'));router['get']('/',auth[_0xbc83('0x9')](),controller[_0xbc83('0xa')]);router['get'](_0xbc83('0xb'),auth[_0xbc83('0x9')](),controller['show']);router[_0xbc83('0xc')]('/',auth[_0xbc83('0x9')](),controller['create']);router[_0xbc83('0xd')](_0xbc83('0xb'),auth[_0xbc83('0x9')](),controller[_0xbc83('0xe')]);router['delete'](_0xbc83('0xb'),auth[_0xbc83('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4129d1d..a7f0440 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3836=['STRING','setDataValue','options','join','getDataValue','BOOLEAN','sequelize','exports'];(function(_0x2e4e3e,_0x75ae94){var _0x51476b=function(_0x53afdc){while(--_0x53afdc){_0x2e4e3e['push'](_0x2e4e3e['shift']());}};_0x51476b(++_0x75ae94);}(_0x3836,0x66));var _0x6383=function(_0x458ff5,_0x2d30e4){_0x458ff5=_0x458ff5-0x0;var _0x1fc145=_0x3836[_0x458ff5];return _0x1fc145;};'use strict';var Sequelize=require(_0x6383('0x0'));module[_0x6383('0x1')]={'name':{'type':Sequelize[_0x6383('0x2')]},'prefix':{'type':Sequelize[_0x6383('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x420188){this[_0x6383('0x3')](_0x6383('0x4'),_0x420188?_0x420188[_0x6383('0x5')](''):[]);},'get':function(){return this[_0x6383('0x6')](_0x6383('0x4'))?this[_0x6383('0x6')](_0x6383('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x6383('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x6383('0x2')]},'record':{'type':Sequelize[_0x6383('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6383('0x2')]},'description':{'type':Sequelize[_0x6383('0x2')]}};
\ No newline at end of file
+var _0x7192=['options','join','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x7192,0xef));var _0x2719=function(_0x4b3312,_0x485b89){_0x4b3312=_0x4b3312-0x0;var _0x4e6ca7=_0x7192[_0x4b3312];return _0x4e6ca7;};'use strict';var Sequelize=require('sequelize');module[_0x2719('0x0')]={'name':{'type':Sequelize[_0x2719('0x1')]},'prefix':{'type':Sequelize[_0x2719('0x1')],'unique':_0x2719('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x37ab86){this[_0x2719('0x3')](_0x2719('0x4'),_0x37ab86?_0x37ab86[_0x2719('0x5')](''):[]);},'get':function(){return this[_0x2719('0x6')](_0x2719('0x4'))?this[_0x2719('0x6')](_0x2719('0x4'))[_0x2719('0x7')](''):[];}},'auth':{'type':Sequelize[_0x2719('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x2719('0x1')]},'record':{'type':Sequelize[_0x2719('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2719('0x1')]},'description':{'type':Sequelize[_0x2719('0x1')]}};
\ No newline at end of file
index ec461f4..ca48806 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x722e=['mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','name','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filters','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','ChanSpies','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0x722e,0x1f2));var _0xe722=function(_0x274cc6,_0x24cf64){_0x274cc6=_0x274cc6-0x0;var _0xaf1272=_0x722e[_0x274cc6];return _0xaf1272;};'use strict';var pdf=require(_0xe722('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe722('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe722('0x2'));var rp=require(_0xe722('0x3'));var moment=require(_0xe722('0x4'));var BPromise=require(_0xe722('0x5'));var Mustache=require(_0xe722('0x6'));var util=require(_0xe722('0x7'));var path=require(_0xe722('0x8'));var sox=require(_0xe722('0x9'));var csv=require(_0xe722('0xa'));var ejs=require(_0xe722('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe722('0xc'));var crypto=require(_0xe722('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe722('0xa'));var querystring=require(_0xe722('0xe'));var Papa=require(_0xe722('0xf'));var Redis=require(_0xe722('0x10'));var authService=require(_0xe722('0x11'));var qs=require(_0xe722('0x12'));var as=require(_0xe722('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe722('0x14'))('api');var utils=require(_0xe722('0x15'));var config=require(_0xe722('0x16'));var db=require(_0xe722('0x17'))['db'];function respondWithStatusCode(_0x17778f,_0x20130f){_0x20130f=_0x20130f||0xcc;return function(_0xabede3){if(_0xabede3){return _0x17778f[_0xe722('0x18')](_0x20130f);}return _0x17778f[_0xe722('0x19')](_0x20130f)['end']();};}function respondWithResult(_0x500dca,_0x115ee8){_0x115ee8=_0x115ee8||0xc8;return function(_0x37f502){if(_0x37f502){return _0x500dca[_0xe722('0x19')](_0x115ee8)[_0xe722('0x1a')](_0x37f502);}};}function respondWithFilteredResult(_0x42af88,_0x1d7f51){return function(_0x9f109a){if(_0x9f109a){var _0x1acf64=_0x9f109a[_0xe722('0x1b')],_0x1e2eaa=_0x1d7f51[_0xe722('0x1c')],_0x57eb29=_0x1d7f51[_0xe722('0x1c')]+_0x1d7f51[_0xe722('0x1d')],_0x2305df;if(_0x57eb29>=_0x1acf64){_0x57eb29=_0x1acf64;_0x2305df=0xc8;}else{_0x2305df=0xce;}_0x42af88['status'](_0x2305df);return _0x42af88[_0xe722('0x1e')](_0xe722('0x1f'),_0x1e2eaa+'-'+_0x57eb29+'/'+_0x1acf64)[_0xe722('0x1a')](_0x9f109a);}return null;};}function patchUpdates(_0x40e705){return function(_0x35e9cc){try{jsonpatch[_0xe722('0x20')](_0x35e9cc,_0x40e705,!![]);}catch(_0x18107c){return BPromise[_0xe722('0x21')](_0x18107c);}return _0x35e9cc[_0xe722('0x22')]();};}function saveUpdates(_0x38be55,_0x99f8d){return function(_0x51a2ea){if(_0x51a2ea){return _0x51a2ea[_0xe722('0x23')](_0x38be55)[_0xe722('0x24')](function(_0xab7318){return _0xab7318;});}return null;};}function removeEntity(_0x1b595a,_0x1dc48f){return function(_0x21d06b){if(_0x21d06b){return _0x21d06b[_0xe722('0x25')]()[_0xe722('0x24')](function(){var _0x3b6734=_0x21d06b['get']({'plain':!![]});var _0x334b71='ChanSpies';return db[_0xe722('0x26')][_0xe722('0x25')]({'where':{'type':_0x334b71,'resourceId':_0x3b6734['id']}})[_0xe722('0x24')](function(){return _0x21d06b;});})['then'](function(){_0x1b595a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1620a5,_0x2498f4){return function(_0x56e896){if(!_0x56e896){_0x1620a5[_0xe722('0x18')](0x194);}return _0x56e896;};}function handleError(_0x3cf974,_0x250b1a){_0x250b1a=_0x250b1a||0x1f4;return function(_0x2df173){logger[_0xe722('0x27')](_0x2df173[_0xe722('0x28')]);if(_0x2df173['name']){delete _0x2df173['name'];}_0x3cf974[_0xe722('0x19')](_0x250b1a)[_0xe722('0x29')](_0x2df173);};}exports[_0xe722('0x2a')]=function(_0x20db93,_0x4f322c){var _0x2bd822={},_0x166d2f={},_0x569d5a={'count':0x0,'rows':[]};var _0x73b771=_[_0xe722('0x2b')](db[_0xe722('0x2c')][_0xe722('0x2d')],function(_0x37e631){return{'name':_0x37e631[_0xe722('0x2e')],'type':_0x37e631[_0xe722('0x2f')][_0xe722('0x30')]};});_0x166d2f['model']=_['map'](_0x73b771,_0xe722('0x31'));_0x166d2f[_0xe722('0x32')]=_['keys'](_0x20db93['query']);_0x166d2f['filters']=_[_0xe722('0x33')](_0x166d2f['model'],_0x166d2f[_0xe722('0x32')]);_0x2bd822[_0xe722('0x34')]=_['intersection'](_0x166d2f[_0xe722('0x35')],qs['fields'](_0x20db93[_0xe722('0x32')][_0xe722('0x36')]));_0x2bd822[_0xe722('0x34')]=_0x2bd822[_0xe722('0x34')][_0xe722('0x37')]?_0x2bd822[_0xe722('0x34')]:_0x166d2f[_0xe722('0x35')];if(!_0x20db93[_0xe722('0x32')][_0xe722('0x38')](_0xe722('0x39'))){_0x2bd822[_0xe722('0x1d')]=qs[_0xe722('0x1d')](_0x20db93['query'][_0xe722('0x1d')]);_0x2bd822['offset']=qs[_0xe722('0x1c')](_0x20db93[_0xe722('0x32')][_0xe722('0x1c')]);}_0x2bd822['order']=qs[_0xe722('0x3a')](_0x20db93[_0xe722('0x32')][_0xe722('0x3a')]);_0x2bd822['where']=qs['filters'](_['pick'](_0x20db93[_0xe722('0x32')],_0x166d2f[_0xe722('0x3b')]),_0x73b771);if(_0x20db93[_0xe722('0x32')][_0xe722('0x3c')]){_0x2bd822['where']=_[_0xe722('0x3d')](_0x2bd822[_0xe722('0x3e')],{'$or':_[_0xe722('0x2b')](_0x73b771,function(_0x3760d3){if(_0x3760d3[_0xe722('0x2f')]!==_0xe722('0x3f')){var _0x25759b={};_0x25759b[_0x3760d3['name']]={'$like':'%'+_0x20db93[_0xe722('0x32')][_0xe722('0x3c')]+'%'};return _0x25759b;}})});}_0x2bd822=_[_0xe722('0x3d')]({},_0x2bd822,_0x20db93[_0xe722('0x40')]);var _0x322ef1={'where':_0x2bd822[_0xe722('0x3e')]};return db[_0xe722('0x2c')][_0xe722('0x1b')](_0x322ef1)['then'](function(_0x447e56){_0x569d5a['count']=_0x447e56;if(_0x20db93['query'][_0xe722('0x41')]){_0x2bd822[_0xe722('0x42')]=[{'all':!![]}];}return db[_0xe722('0x2c')][_0xe722('0x43')](_0x2bd822);})[_0xe722('0x24')](function(_0x3a307d){_0x569d5a[_0xe722('0x44')]=_0x3a307d;return _0x569d5a;})[_0xe722('0x24')](respondWithFilteredResult(_0x4f322c,_0x2bd822))[_0xe722('0x45')](handleError(_0x4f322c,null));};exports[_0xe722('0x46')]=function(_0x1c7be9,_0x5d3653){var _0x1fcf0b={'raw':![],'where':{'id':_0x1c7be9['params']['id']}},_0x53291e={};_0x53291e[_0xe722('0x35')]=_[_0xe722('0x47')](db[_0xe722('0x2c')][_0xe722('0x2d')]);_0x53291e[_0xe722('0x32')]=_[_0xe722('0x47')](_0x1c7be9['query']);_0x53291e['filters']=_['intersection'](_0x53291e[_0xe722('0x35')],_0x53291e[_0xe722('0x32')]);_0x1fcf0b[_0xe722('0x34')]=_[_0xe722('0x33')](_0x53291e[_0xe722('0x35')],qs['fields'](_0x1c7be9[_0xe722('0x32')][_0xe722('0x36')]));_0x1fcf0b[_0xe722('0x34')]=_0x1fcf0b['attributes'][_0xe722('0x37')]?_0x1fcf0b[_0xe722('0x34')]:_0x53291e['model'];if(_0x1c7be9[_0xe722('0x32')]['includeAll']){_0x1fcf0b[_0xe722('0x42')]=[{'all':!![]}];}_0x1fcf0b=_[_0xe722('0x3d')]({},_0x1fcf0b,_0x1c7be9[_0xe722('0x40')]);return db[_0xe722('0x2c')]['find'](_0x1fcf0b)[_0xe722('0x24')](handleEntityNotFound(_0x5d3653,null))[_0xe722('0x24')](respondWithResult(_0x5d3653,null))[_0xe722('0x45')](handleError(_0x5d3653,null));};exports[_0xe722('0x48')]=function(_0x502199,_0x4d6139){return db[_0xe722('0x2c')]['create'](_0x502199[_0xe722('0x49')],{})[_0xe722('0x24')](function(_0x3c2513){var _0x2f9c2b=_0x502199['user']['get']({'plain':!![]});if(!_0x2f9c2b)throw new Error(_0xe722('0x4a'));if(_0x2f9c2b[_0xe722('0x4b')]===_0xe722('0x4c')){var _0x1978a4=_0x3c2513[_0xe722('0x4d')]({'plain':!![]});var _0x22be22=_0xe722('0x4e');return db[_0xe722('0x4f')][_0xe722('0x50')]({'where':{'name':_0x22be22,'userProfileId':_0x2f9c2b[_0xe722('0x51')]},'raw':!![]})[_0xe722('0x24')](function(_0x51cf2d){if(_0x51cf2d&&_0x51cf2d['autoAssociation']===0x0){return db['UserProfileResource'][_0xe722('0x48')]({'name':_0x1978a4['name'],'resourceId':_0x1978a4['id'],'type':_0x51cf2d['name'],'sectionId':_0x51cf2d['id']},{})['then'](function(){return _0x3c2513;});}else{return _0x3c2513;}})[_0xe722('0x45')](function(_0x54ef6d){logger[_0xe722('0x27')](_0xe722('0x52'),_0x54ef6d);throw _0x54ef6d;});}return _0x3c2513;})[_0xe722('0x24')](respondWithResult(_0x4d6139,0xc9))[_0xe722('0x45')](handleError(_0x4d6139,null));};exports['update']=function(_0x3012e5,_0x363d4c){if(_0x3012e5[_0xe722('0x49')]['id']){delete _0x3012e5[_0xe722('0x49')]['id'];}return db[_0xe722('0x2c')][_0xe722('0x50')]({'where':{'id':_0x3012e5[_0xe722('0x53')]['id']}})[_0xe722('0x24')](handleEntityNotFound(_0x363d4c,null))['then'](saveUpdates(_0x3012e5[_0xe722('0x49')],null))[_0xe722('0x24')](respondWithResult(_0x363d4c,null))['catch'](handleError(_0x363d4c,null));};exports[_0xe722('0x25')]=function(_0xb46d13,_0x15ca11){return db[_0xe722('0x2c')][_0xe722('0x50')]({'where':{'id':_0xb46d13[_0xe722('0x53')]['id']}})[_0xe722('0x24')](handleEntityNotFound(_0x15ca11,null))[_0xe722('0x24')](removeEntity(_0x15ca11,null))[_0xe722('0x45')](handleError(_0x15ca11,null));};
\ No newline at end of file
+var _0xd752=['lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','update','then','destroy','ChanSpies','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','VoiceChanSpy','includeAll','include','findAll','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs'];(function(_0x2b7675,_0x5969c9){var _0x4c4f97=function(_0x233188){while(--_0x233188){_0x2b7675['push'](_0x2b7675['shift']());}};_0x4c4f97(++_0x5969c9);}(_0xd752,0x92));var _0x2d75=function(_0x5bce33,_0x4a4b06){_0x5bce33=_0x5bce33-0x0;var _0x15bc20=_0xd752[_0x5bce33];return _0x15bc20;};'use strict';var pdf=require(_0x2d75('0x0'));var emlformat=require(_0x2d75('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2d75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d75('0x3'));var moment=require(_0x2d75('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2d75('0x5'));var path=require(_0x2d75('0x6'));var sox=require(_0x2d75('0x7'));var csv=require(_0x2d75('0x8'));var ejs=require(_0x2d75('0x9'));var fs=require('fs');var _=require(_0x2d75('0xa'));var squel=require('squel');var crypto=require(_0x2d75('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2d75('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2d75('0xd'));var Papa=require(_0x2d75('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d75('0xf'));var as=require(_0x2d75('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d75('0x11'))(_0x2d75('0x12'));var utils=require(_0x2d75('0x13'));var config=require(_0x2d75('0x14'));var db=require(_0x2d75('0x15'))['db'];function respondWithStatusCode(_0xb104b5,_0x5dc398){_0x5dc398=_0x5dc398||0xcc;return function(_0x455034){if(_0x455034){return _0xb104b5[_0x2d75('0x16')](_0x5dc398);}return _0xb104b5[_0x2d75('0x17')](_0x5dc398)[_0x2d75('0x18')]();};}function respondWithResult(_0x57690a,_0x59fa5e){_0x59fa5e=_0x59fa5e||0xc8;return function(_0x3cbf44){if(_0x3cbf44){return _0x57690a['status'](_0x59fa5e)['json'](_0x3cbf44);}};}function respondWithFilteredResult(_0x5d0594,_0x241daf){return function(_0x468a93){if(_0x468a93){var _0x400e8c=_0x468a93[_0x2d75('0x19')],_0x108010=_0x241daf[_0x2d75('0x1a')],_0x50407c=_0x241daf[_0x2d75('0x1a')]+_0x241daf[_0x2d75('0x1b')],_0x1190f6;if(_0x50407c>=_0x400e8c){_0x50407c=_0x400e8c;_0x1190f6=0xc8;}else{_0x1190f6=0xce;}_0x5d0594[_0x2d75('0x17')](_0x1190f6);return _0x5d0594['set'](_0x2d75('0x1c'),_0x108010+'-'+_0x50407c+'/'+_0x400e8c)['json'](_0x468a93);}return null;};}function patchUpdates(_0x24df2f){return function(_0x567bf1){try{jsonpatch[_0x2d75('0x1d')](_0x567bf1,_0x24df2f,!![]);}catch(_0xda837f){return BPromise[_0x2d75('0x1e')](_0xda837f);}return _0x567bf1['save']();};}function saveUpdates(_0x21a487,_0x403a72){return function(_0x2deb75){if(_0x2deb75){return _0x2deb75[_0x2d75('0x1f')](_0x21a487)[_0x2d75('0x20')](function(_0x278f17){return _0x278f17;});}return null;};}function removeEntity(_0x3b06d7,_0x36b9c5){return function(_0x1a5ee2){if(_0x1a5ee2){return _0x1a5ee2[_0x2d75('0x21')]()[_0x2d75('0x20')](function(){var _0x52d5d3=_0x1a5ee2['get']({'plain':!![]});var _0x4160a3=_0x2d75('0x22');return db[_0x2d75('0x23')][_0x2d75('0x21')]({'where':{'type':_0x4160a3,'resourceId':_0x52d5d3['id']}})[_0x2d75('0x20')](function(){return _0x1a5ee2;});})[_0x2d75('0x20')](function(){_0x3b06d7[_0x2d75('0x17')](0xcc)[_0x2d75('0x18')]();});}};}function handleEntityNotFound(_0x1559c7,_0x13e198){return function(_0x15e3d9){if(!_0x15e3d9){_0x1559c7[_0x2d75('0x16')](0x194);}return _0x15e3d9;};}function handleError(_0x156e2d,_0x23303a){_0x23303a=_0x23303a||0x1f4;return function(_0x3d2017){logger[_0x2d75('0x24')](_0x3d2017[_0x2d75('0x25')]);if(_0x3d2017['name']){delete _0x3d2017[_0x2d75('0x26')];}_0x156e2d[_0x2d75('0x17')](_0x23303a)[_0x2d75('0x27')](_0x3d2017);};}exports[_0x2d75('0x28')]=function(_0x453447,_0x99152d){var _0x15da9e={},_0x89fc59={},_0x54e488={'count':0x0,'rows':[]};var _0x979050=_[_0x2d75('0x29')](db['VoiceChanSpy'][_0x2d75('0x2a')],function(_0x3a2cf7){return{'name':_0x3a2cf7[_0x2d75('0x2b')],'type':_0x3a2cf7[_0x2d75('0x2c')][_0x2d75('0x2d')]};});_0x89fc59[_0x2d75('0x2e')]=_[_0x2d75('0x29')](_0x979050,_0x2d75('0x26'));_0x89fc59['query']=_['keys'](_0x453447['query']);_0x89fc59[_0x2d75('0x2f')]=_[_0x2d75('0x30')](_0x89fc59['model'],_0x89fc59[_0x2d75('0x31')]);_0x15da9e[_0x2d75('0x32')]=_[_0x2d75('0x30')](_0x89fc59[_0x2d75('0x2e')],qs[_0x2d75('0x33')](_0x453447['query'][_0x2d75('0x33')]));_0x15da9e[_0x2d75('0x32')]=_0x15da9e[_0x2d75('0x32')][_0x2d75('0x34')]?_0x15da9e['attributes']:_0x89fc59[_0x2d75('0x2e')];if(!_0x453447[_0x2d75('0x31')][_0x2d75('0x35')]('nolimit')){_0x15da9e[_0x2d75('0x1b')]=qs[_0x2d75('0x1b')](_0x453447['query'][_0x2d75('0x1b')]);_0x15da9e['offset']=qs['offset'](_0x453447[_0x2d75('0x31')][_0x2d75('0x1a')]);}_0x15da9e[_0x2d75('0x36')]=qs[_0x2d75('0x37')](_0x453447[_0x2d75('0x31')][_0x2d75('0x37')]);_0x15da9e[_0x2d75('0x38')]=qs[_0x2d75('0x2f')](_[_0x2d75('0x39')](_0x453447['query'],_0x89fc59[_0x2d75('0x2f')]),_0x979050);if(_0x453447[_0x2d75('0x31')][_0x2d75('0x3a')]){_0x15da9e[_0x2d75('0x38')]=_[_0x2d75('0x3b')](_0x15da9e[_0x2d75('0x38')],{'$or':_[_0x2d75('0x29')](_0x979050,function(_0x95604f){if(_0x95604f[_0x2d75('0x2c')]!=='VIRTUAL'){var _0xdeac88={};_0xdeac88[_0x95604f[_0x2d75('0x26')]]={'$like':'%'+_0x453447[_0x2d75('0x31')][_0x2d75('0x3a')]+'%'};return _0xdeac88;}})});}_0x15da9e=_[_0x2d75('0x3b')]({},_0x15da9e,_0x453447[_0x2d75('0x3c')]);var _0x16bf0f={'where':_0x15da9e[_0x2d75('0x38')]};return db[_0x2d75('0x3d')][_0x2d75('0x19')](_0x16bf0f)[_0x2d75('0x20')](function(_0x1891e2){_0x54e488[_0x2d75('0x19')]=_0x1891e2;if(_0x453447['query'][_0x2d75('0x3e')]){_0x15da9e[_0x2d75('0x3f')]=[{'all':!![]}];}return db[_0x2d75('0x3d')][_0x2d75('0x40')](_0x15da9e);})[_0x2d75('0x20')](function(_0x32a494){_0x54e488['rows']=_0x32a494;return _0x54e488;})[_0x2d75('0x20')](respondWithFilteredResult(_0x99152d,_0x15da9e))[_0x2d75('0x41')](handleError(_0x99152d,null));};exports[_0x2d75('0x42')]=function(_0x6da36c,_0x16f85e){var _0x626cb2={'raw':![],'where':{'id':_0x6da36c['params']['id']}},_0x50c204={};_0x50c204[_0x2d75('0x2e')]=_[_0x2d75('0x43')](db[_0x2d75('0x3d')][_0x2d75('0x2a')]);_0x50c204[_0x2d75('0x31')]=_[_0x2d75('0x43')](_0x6da36c[_0x2d75('0x31')]);_0x50c204['filters']=_['intersection'](_0x50c204[_0x2d75('0x2e')],_0x50c204['query']);_0x626cb2[_0x2d75('0x32')]=_[_0x2d75('0x30')](_0x50c204[_0x2d75('0x2e')],qs[_0x2d75('0x33')](_0x6da36c[_0x2d75('0x31')][_0x2d75('0x33')]));_0x626cb2[_0x2d75('0x32')]=_0x626cb2['attributes'][_0x2d75('0x34')]?_0x626cb2[_0x2d75('0x32')]:_0x50c204[_0x2d75('0x2e')];if(_0x6da36c['query'][_0x2d75('0x3e')]){_0x626cb2[_0x2d75('0x3f')]=[{'all':!![]}];}_0x626cb2=_[_0x2d75('0x3b')]({},_0x626cb2,_0x6da36c[_0x2d75('0x3c')]);return db['VoiceChanSpy'][_0x2d75('0x44')](_0x626cb2)[_0x2d75('0x20')](handleEntityNotFound(_0x16f85e,null))['then'](respondWithResult(_0x16f85e,null))[_0x2d75('0x41')](handleError(_0x16f85e,null));};exports[_0x2d75('0x45')]=function(_0x2ea0e9,_0x38bb2b){return db[_0x2d75('0x3d')][_0x2d75('0x45')](_0x2ea0e9[_0x2d75('0x46')],{})[_0x2d75('0x20')](function(_0x144240){var _0x5b7446=_0x2ea0e9[_0x2d75('0x47')][_0x2d75('0x48')]({'plain':!![]});if(!_0x5b7446)throw new Error(_0x2d75('0x49'));if(_0x5b7446['role']===_0x2d75('0x47')){var _0x41f0cb=_0x144240[_0x2d75('0x48')]({'plain':!![]});var _0x5a7ae7=_0x2d75('0x22');return db['UserProfileSection'][_0x2d75('0x44')]({'where':{'name':_0x5a7ae7,'userProfileId':_0x5b7446[_0x2d75('0x4a')]},'raw':!![]})[_0x2d75('0x20')](function(_0x36c935){if(_0x36c935&&_0x36c935[_0x2d75('0x4b')]===0x0){return db[_0x2d75('0x23')][_0x2d75('0x45')]({'name':_0x41f0cb[_0x2d75('0x26')],'resourceId':_0x41f0cb['id'],'type':_0x36c935['name'],'sectionId':_0x36c935['id']},{})[_0x2d75('0x20')](function(){return _0x144240;});}else{return _0x144240;}})[_0x2d75('0x41')](function(_0x5721f6){logger[_0x2d75('0x24')](_0x2d75('0x4c'),_0x5721f6);throw _0x5721f6;});}return _0x144240;})['then'](respondWithResult(_0x38bb2b,0xc9))[_0x2d75('0x41')](handleError(_0x38bb2b,null));};exports[_0x2d75('0x1f')]=function(_0x5dbd19,_0x198771){if(_0x5dbd19[_0x2d75('0x46')]['id']){delete _0x5dbd19[_0x2d75('0x46')]['id'];}return db[_0x2d75('0x3d')]['find']({'where':{'id':_0x5dbd19[_0x2d75('0x4d')]['id']}})[_0x2d75('0x20')](handleEntityNotFound(_0x198771,null))[_0x2d75('0x20')](saveUpdates(_0x5dbd19[_0x2d75('0x46')],null))[_0x2d75('0x20')](respondWithResult(_0x198771,null))[_0x2d75('0x41')](handleError(_0x198771,null));};exports['destroy']=function(_0x1681d5,_0x5c879d){return db[_0x2d75('0x3d')]['find']({'where':{'id':_0x1681d5[_0x2d75('0x4d')]['id']}})[_0x2d75('0x20')](handleEntityNotFound(_0x5c879d,null))[_0x2d75('0x20')](removeEntity(_0x5c879d,null))['catch'](handleError(_0x5c879d,null));};
\ No newline at end of file
index 2a4b963..6d59c1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56ce=['auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','length','internal','name','concat','findAll','agent','catch','exports','models','VoiceChanSpy','then','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','format','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat'];(function(_0xc9d302,_0x459ed2){var _0xcf03b4=function(_0x293816){while(--_0x293816){_0xc9d302['push'](_0xc9d302['shift']());}};_0xcf03b4(++_0x459ed2);}(_0x56ce,0x1e9));var _0xe56c=function(_0x50cd0e,_0xac7c3){_0x50cd0e=_0x50cd0e-0x0;var _0x2173a2=_0x56ce[_0x50cd0e];return _0x2173a2;};'use strict';var _=require(_0xe56c('0x0'));var util=require('util');var BPromise=require(_0xe56c('0x1'));var attributes=require(_0xe56c('0x2'));var getUserApplications=function(_0x2b0014,_0x3fec56,_0x30c9d0){var _0x26eeaa=0x1;var _0x19b86c=[];var _0x2913fd={'context':_0x3fec56['context']||'from-sip','exten':util[_0xe56c('0x3')]('%s%s',_0x2b0014[_0xe56c('0x4')],_0x30c9d0),'type':_0xe56c('0x5'),'isApp':![],'ChanSpyId':_0x2b0014['id'],'UserId':_0x3fec56['id']};_0x19b86c[_0xe56c('0x6')](_[_0xe56c('0x7')]({'app':_0xe56c('0x8'),'appdata':util[_0xe56c('0x3')](_0xe56c('0x9'),_0xe56c('0xa')),'priority':_0x26eeaa++},_0x2913fd));if(_0x2b0014[_0xe56c('0xb')]){_0x19b86c['push'](_['merge']({'app':_0xe56c('0xc'),'appdata':util[_0xe56c('0x3')](_0xe56c('0xd'),_0x2b0014[_0xe56c('0xe')]),'priority':_0x26eeaa++},_0x2913fd));}if(_0x2b0014[_0xe56c('0xf')]){_0x19b86c[_0xe56c('0x6')](_[_0xe56c('0x7')]({'app':_0xe56c('0x10'),'appdata':_0x2b0014[_0xe56c('0x11')],'priority':_0x26eeaa++},_0x2913fd));}_0x19b86c[_0xe56c('0x6')](_[_0xe56c('0x7')]({'app':_0xe56c('0x12'),'appdata':util[_0xe56c('0x3')](_0xe56c('0x13'),_0x3fec56['name'],_0x2b0014['options']?_0x2b0014[_0xe56c('0x14')][_0xe56c('0x15')](''):''),'priority':_0x26eeaa++},_0x2913fd));if(_0x2b0014[_0xe56c('0xb')]){_0x19b86c[_0xe56c('0x6')](_['merge']({'app':'StopMixMonitor','priority':_0x26eeaa++},_0x2913fd));}return _0x19b86c;};var getChanSpyApplications=function(_0x46f350,_0x58a8c8){var _0x173669=[];for(var _0x499f8a=0x0,_0x57e410=0x1;_0x499f8a<_0x58a8c8[_0xe56c('0x16')];_0x499f8a++,_0x57e410=0x1){_0x173669=_0x173669['concat'](getUserApplications(_0x46f350,_0x58a8c8[_0x499f8a],_0x58a8c8[_0x499f8a][_0xe56c('0x17')]));if(_0x58a8c8[_0x499f8a][_0xe56c('0x17')]!=_0x58a8c8[_0x499f8a][_0xe56c('0x18')]){_0x173669=_0x173669[_0xe56c('0x19')](getUserApplications(_0x46f350,_0x58a8c8[_0x499f8a],_0x58a8c8[_0x499f8a][_0xe56c('0x18')]));}}return _0x173669;};var getChanSpyPromise=function(_0xba96dd,_0x27870c){return new BPromise(function(_0x9ea9bf,_0x8c0afd){return _0xba96dd['User'][_0xe56c('0x1a')]({'attributes':['id',_0xe56c('0x18'),_0xe56c('0x17')],'where':{'role':_0xe56c('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x37a22b){if(_0x37a22b){return _0x9ea9bf(getChanSpyApplications(_0x27870c,_0x37a22b));}return _0x9ea9bf([]);})[_0xe56c('0x1c')](function(_0x4f9c62){_0x8c0afd(_0x4f9c62);});});};module[_0xe56c('0x1d')]=function(_0x34d36c,_0x26b862){var _0x511c77=_0x34d36c[_0xe56c('0x1e')];return _0x34d36c['define'](_0xe56c('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x17432f,_0x40dbc6,_0x55813a){return getChanSpyPromise(_0x511c77,_0x17432f)[_0xe56c('0x20')](function(_0xd96297){if(_0xd96297&&_0xd96297[_0xe56c('0x16')]){return _0x511c77[_0xe56c('0x21')][_0xe56c('0x22')](_0xd96297);}})[_0xe56c('0x20')](function(){_0x55813a();})[_0xe56c('0x1c')](function(_0x33fc5d){_0x55813a(_0x33fc5d);});},'afterUpdate':function(_0x5609be,_0x2e7e70,_0x1047fd){return _0x511c77['VoiceExtension'][_0xe56c('0x23')]({'where':{'ChanSpyId':_0x5609be['id']}})[_0xe56c('0x20')](function(){return getChanSpyPromise(_0x511c77,_0x5609be);})[_0xe56c('0x20')](function(_0x2a6ff8){if(_0x2a6ff8&&_0x2a6ff8[_0xe56c('0x16')]){return _0x511c77[_0xe56c('0x21')][_0xe56c('0x22')](_0x2a6ff8);}})['then'](function(){_0x1047fd();})['catch'](function(_0x486608){_0x1047fd(_0x486608);});},'afterDestroy':function(_0x321ab0,_0x232ea0,_0x10bb20){return _0x511c77[_0xe56c('0x21')][_0xe56c('0x23')]({'where':{'ChanSpyId':_0x321ab0['id']}})['then'](function(){_0x10bb20();})[_0xe56c('0x1c')](function(_0x41d161){_0x10bb20(_0x41d161);});}}});};
\ No newline at end of file
+var _0xa179=['length','bulkCreate','VoiceExtension','destroy','catch','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','internal','concat','User','findAll','exports','models','voice_chanspy','then'];(function(_0x1f4698,_0x178766){var _0x558451=function(_0x3e566a){while(--_0x3e566a){_0x1f4698['push'](_0x1f4698['shift']());}};_0x558451(++_0x178766);}(_0xa179,0x1c1));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a17('0x0'));var util=require(_0x9a17('0x1'));var BPromise=require('bluebird');var attributes=require(_0x9a17('0x2'));var getUserApplications=function(_0x284497,_0x5d512b,_0x304e18){var _0x4a8798=0x1;var _0x139d1a=[];var _0x249e13={'context':_0x5d512b[_0x9a17('0x3')]||_0x9a17('0x4'),'exten':util[_0x9a17('0x5')]('%s%s',_0x284497[_0x9a17('0x6')],_0x304e18),'type':_0x9a17('0x7'),'isApp':![],'ChanSpyId':_0x284497['id'],'UserId':_0x5d512b['id']};_0x139d1a[_0x9a17('0x8')](_[_0x9a17('0x9')]({'app':_0x9a17('0xa'),'appdata':util[_0x9a17('0x5')](_0x9a17('0xb'),_0x9a17('0xc')),'priority':_0x4a8798++},_0x249e13));if(_0x284497[_0x9a17('0xd')]){_0x139d1a[_0x9a17('0x8')](_['merge']({'app':_0x9a17('0xe'),'appdata':util[_0x9a17('0x5')]('${UNIQUEID}.%s,a',_0x284497[_0x9a17('0xf')]),'priority':_0x4a8798++},_0x249e13));}if(_0x284497[_0x9a17('0x10')]){_0x139d1a[_0x9a17('0x8')](_[_0x9a17('0x9')]({'app':_0x9a17('0x11'),'appdata':_0x284497['password'],'priority':_0x4a8798++},_0x249e13));}_0x139d1a['push'](_[_0x9a17('0x9')]({'app':_0x9a17('0x12'),'appdata':util['format'](_0x9a17('0x13'),_0x5d512b[_0x9a17('0x14')],_0x284497[_0x9a17('0x15')]?_0x284497[_0x9a17('0x15')][_0x9a17('0x16')](''):''),'priority':_0x4a8798++},_0x249e13));if(_0x284497[_0x9a17('0xd')]){_0x139d1a[_0x9a17('0x8')](_[_0x9a17('0x9')]({'app':_0x9a17('0x17'),'priority':_0x4a8798++},_0x249e13));}return _0x139d1a;};var getChanSpyApplications=function(_0x3ad23e,_0x131611){var _0x4f2460=[];for(var _0x2c3731=0x0,_0x898d0=0x1;_0x2c3731<_0x131611['length'];_0x2c3731++,_0x898d0=0x1){_0x4f2460=_0x4f2460['concat'](getUserApplications(_0x3ad23e,_0x131611[_0x2c3731],_0x131611[_0x2c3731][_0x9a17('0x18')]));if(_0x131611[_0x2c3731][_0x9a17('0x18')]!=_0x131611[_0x2c3731][_0x9a17('0x14')]){_0x4f2460=_0x4f2460[_0x9a17('0x19')](getUserApplications(_0x3ad23e,_0x131611[_0x2c3731],_0x131611[_0x2c3731][_0x9a17('0x14')]));}}return _0x4f2460;};var getChanSpyPromise=function(_0x26daf1,_0x21aac2){return new BPromise(function(_0x406d39,_0x3d91df){return _0x26daf1[_0x9a17('0x1a')][_0x9a17('0x1b')]({'attributes':['id',_0x9a17('0x14'),_0x9a17('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x25d24c){if(_0x25d24c){return _0x406d39(getChanSpyApplications(_0x21aac2,_0x25d24c));}return _0x406d39([]);})['catch'](function(_0xe71ac0){_0x3d91df(_0xe71ac0);});});};module[_0x9a17('0x1c')]=function(_0x178c50,_0x1218d2){var _0x43c0e4=_0x178c50[_0x9a17('0x1d')];return _0x178c50['define']('VoiceChanSpy',attributes,{'tableName':_0x9a17('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c2812,_0x2a21d7,_0x628ffa){return getChanSpyPromise(_0x43c0e4,_0x2c2812)[_0x9a17('0x1f')](function(_0x6a1923){if(_0x6a1923&&_0x6a1923[_0x9a17('0x20')]){return _0x43c0e4['VoiceExtension'][_0x9a17('0x21')](_0x6a1923);}})[_0x9a17('0x1f')](function(){_0x628ffa();})['catch'](function(_0x4831bc){_0x628ffa(_0x4831bc);});},'afterUpdate':function(_0x5da153,_0x56b46f,_0x355f5a){return _0x43c0e4[_0x9a17('0x22')][_0x9a17('0x23')]({'where':{'ChanSpyId':_0x5da153['id']}})[_0x9a17('0x1f')](function(){return getChanSpyPromise(_0x43c0e4,_0x5da153);})['then'](function(_0x4e7473){if(_0x4e7473&&_0x4e7473[_0x9a17('0x20')]){return _0x43c0e4[_0x9a17('0x22')][_0x9a17('0x21')](_0x4e7473);}})[_0x9a17('0x1f')](function(){_0x355f5a();})['catch'](function(_0x3b16ff){_0x355f5a(_0x3b16ff);});},'afterDestroy':function(_0x1db848,_0x105a79,_0x4d0b6f){return _0x43c0e4[_0x9a17('0x22')]['destroy']({'where':{'ChanSpyId':_0x1db848['id']}})[_0x9a17('0x1f')](function(){_0x4d0b6f();})[_0x9a17('0x24')](function(_0x290627){_0x4d0b6f(_0x290627);});}}});};
\ No newline at end of file
index 347a35b..bb5f1e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1066=['message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2aa848,_0x5a12bc){var _0x3dd61e=function(_0x33b16b){while(--_0x33b16b){_0x2aa848['push'](_0x2aa848['shift']());}};_0x3dd61e(++_0x5a12bc);}(_0x1066,0x9d));var _0x6106=function(_0x4860f5,_0x1a1819){_0x4860f5=_0x4860f5-0x0;var _0x55b7de=_0x1066[_0x4860f5];return _0x55b7de;};'use strict';var _=require(_0x6106('0x0'));var util=require(_0x6106('0x1'));var moment=require(_0x6106('0x2'));var BPromise=require(_0x6106('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6106('0x4'));var db=require(_0x6106('0x5'))['db'];var utils=require(_0x6106('0x6'));var logger=require(_0x6106('0x7'))(_0x6106('0x8'));var config=require('../../config/environment');var jayson=require(_0x6106('0x9'));var client=jayson[_0x6106('0xa')][_0x6106('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x794fa7,_0x5c821b,_0x529319){return new BPromise(function(_0x333ecd,_0x6c9cc6){return client['request'](_0x794fa7,_0x529319)[_0x6106('0xc')](function(_0x274b4d){logger['info'](_0x6106('0xd'),_0x5c821b,_0x6106('0xe'));logger[_0x6106('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x5c821b,_0x6106('0xe'),JSON[_0x6106('0x10')](_0x274b4d));if(_0x274b4d[_0x6106('0x11')]){if(_0x274b4d['error'][_0x6106('0x12')]===0x1f4){logger[_0x6106('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x5c821b,_0x274b4d['error'][_0x6106('0x13')]);return _0x6c9cc6(_0x274b4d[_0x6106('0x11')][_0x6106('0x13')]);}logger['error'](_0x6106('0xd'),_0x5c821b,_0x274b4d[_0x6106('0x11')][_0x6106('0x13')]);return _0x333ecd(_0x274b4d['error'][_0x6106('0x13')]);}else{logger[_0x6106('0x14')](_0x6106('0xd'),_0x5c821b,_0x6106('0xe'));_0x333ecd(_0x274b4d[_0x6106('0x15')]['message']);}})['catch'](function(_0x5f2d6a){logger[_0x6106('0x11')](_0x6106('0xd'),_0x5c821b,_0x5f2d6a);_0x6c9cc6(_0x5f2d6a);});});}
\ No newline at end of file
+var _0x63f7=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2bf6be,_0x5b23f1){var _0x532ef4=function(_0x3760df){while(--_0x3760df){_0x2bf6be['push'](_0x2bf6be['shift']());}};_0x532ef4(++_0x5b23f1);}(_0x63f7,0x91));var _0x763f=function(_0x5cbc77,_0x50a049){_0x5cbc77=_0x5cbc77-0x0;var _0x1e6c64=_0x63f7[_0x5cbc77];return _0x1e6c64;};'use strict';var _=require(_0x763f('0x0'));var util=require(_0x763f('0x1'));var moment=require('moment');var BPromise=require(_0x763f('0x2'));var rs=require(_0x763f('0x3'));var fs=require('fs');var Redis=require(_0x763f('0x4'));var db=require(_0x763f('0x5'))['db'];var utils=require(_0x763f('0x6'));var logger=require(_0x763f('0x7'))(_0x763f('0x8'));var config=require(_0x763f('0x9'));var jayson=require(_0x763f('0xa'));var client=jayson[_0x763f('0xb')][_0x763f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x550197,_0x161596,_0x5857f1){return new BPromise(function(_0x3c6d76,_0x2748e3){return client[_0x763f('0xd')](_0x550197,_0x5857f1)[_0x763f('0xe')](function(_0x135aab){logger[_0x763f('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x161596,'request\x20sent');logger['debug'](_0x763f('0x10'),_0x161596,_0x763f('0x11'),JSON['stringify'](_0x135aab));if(_0x135aab[_0x763f('0x12')]){if(_0x135aab['error']['code']===0x1f4){logger[_0x763f('0x12')](_0x763f('0x13'),_0x161596,_0x135aab['error'][_0x763f('0x14')]);return _0x2748e3(_0x135aab[_0x763f('0x12')][_0x763f('0x14')]);}logger[_0x763f('0x12')](_0x763f('0x13'),_0x161596,_0x135aab[_0x763f('0x12')][_0x763f('0x14')]);return _0x3c6d76(_0x135aab[_0x763f('0x12')][_0x763f('0x14')]);}else{logger[_0x763f('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x161596,_0x763f('0x11'));_0x3c6d76(_0x135aab[_0x763f('0x15')][_0x763f('0x14')]);}})[_0x763f('0x16')](function(_0x2fc54b){logger[_0x763f('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x161596,_0x2fc54b);_0x2748e3(_0x2fc54b);});});}
\ No newline at end of file
index d1673db..465f90c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9d9=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','delete','destroy','multer'];(function(_0x339d17,_0x380641){var _0x20b731=function(_0x258933){while(--_0x258933){_0x339d17['push'](_0x339d17['shift']());}};_0x20b731(++_0x380641);}(_0xb9d9,0x11f));var _0x9b9d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb9d9[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x9b9d('0x0'));var util=require('util');var path=require(_0x9b9d('0x1'));var timeout=require(_0x9b9d('0x2'));var express=require(_0x9b9d('0x3'));var router=express['Router']();var auth=require(_0x9b9d('0x4'));var interaction=require(_0x9b9d('0x5'));var config=require(_0x9b9d('0x6'));var controller=require('./voiceContext.controller');router[_0x9b9d('0x7')]('/',auth[_0x9b9d('0x8')](),controller[_0x9b9d('0x9')]);router[_0x9b9d('0x7')]('/:id',auth[_0x9b9d('0x8')](),controller[_0x9b9d('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9b9d('0xb')]);router[_0x9b9d('0xc')](_0x9b9d('0xd'),auth[_0x9b9d('0x8')](),controller['update']);router[_0x9b9d('0xe')](_0x9b9d('0xd'),auth['isAuthenticated'](),controller[_0x9b9d('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x6766=['get','show','post','create','put','/:id','update','delete','destroy','multer','path','express','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated'];(function(_0x1bd1d1,_0x177176){var _0x178b20=function(_0x42f762){while(--_0x42f762){_0x1bd1d1['push'](_0x1bd1d1['shift']());}};_0x178b20(++_0x177176);}(_0x6766,0x119));var _0x6676=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x6766[_0x199bc4];return _0x136ffb;};'use strict';var multer=require(_0x6676('0x0'));var util=require('util');var path=require(_0x6676('0x1'));var timeout=require('connect-timeout');var express=require(_0x6676('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6676('0x3'));var config=require(_0x6676('0x4'));var controller=require(_0x6676('0x5'));router['get']('/',auth[_0x6676('0x6')](),controller['index']);router[_0x6676('0x7')]('/:id',auth[_0x6676('0x6')](),controller[_0x6676('0x8')]);router[_0x6676('0x9')]('/',auth[_0x6676('0x6')](),controller[_0x6676('0xa')]);router[_0x6676('0xb')](_0x6676('0xc'),auth[_0x6676('0x6')](),controller[_0x6676('0xd')]);router[_0x6676('0xe')](_0x6676('0xc'),auth[_0x6676('0x6')](),controller[_0x6676('0xf')]);module['exports']=router;
\ No newline at end of file
index 646e745..2dfb57f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['name','sequelize','STRING'];(function(_0x2b9b5f,_0x24c34b){var _0xfab9e=function(_0x58c0f6){while(--_0x58c0f6){_0x2b9b5f['push'](_0x2b9b5f['shift']());}};_0xfab9e(++_0x24c34b);}(_0x3e74,0x175));var _0x43e7=function(_0x4d0025,_0x438e3e){_0x4d0025=_0x4d0025-0x0;var _0x2e4051=_0x3e74[_0x4d0025];return _0x2e4051;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3e74=['name','sequelize','STRING'];(function(_0x72d7d,_0x132bd7){var _0x13f3c2=function(_0x37fb41){while(--_0x37fb41){_0x72d7d['push'](_0x72d7d['shift']());}};_0x13f3c2(++_0x132bd7);}(_0x3e74,0x175));var _0x43e7=function(_0x28840c,_0x3b9297){_0x28840c=_0x28840c-0x0;var _0x2b0a4c=_0x3e74[_0x28840c];return _0x2b0a4c;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index 08629b7..5529069 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','readFileSync','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','server/files/templates/context.ejs','utf8','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','get','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('VoiceContext,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('VoiceContext,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){var _0x577412=_0x33e24e[_0x7995('0x36')]({'plain':!![]});var _0x3acfc3='Contexts';return db[_0x7995('0x37')]['destroy']({'where':{'type':_0x3acfc3,'resourceId':_0x577412['id']}})[_0x7995('0x20')](function(){return _0x33e24e;});})[_0x7995('0x20')](function(){_0x510841[_0x7995('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52d76d,_0x36d057){return function(_0x5e67fe){if(!_0x5e67fe){_0x52d76d['sendStatus'](0x194);}return _0x5e67fe;};}function handleError(_0x3e99cd,_0xe328b1){_0xe328b1=_0xe328b1||0x1f4;return function(_0x5212ff){logger[_0x7995('0x27')](_0x5212ff[_0x7995('0x38')]);if(_0x5212ff[_0x7995('0x39')]){delete _0x5212ff[_0x7995('0x39')];}_0x3e99cd[_0x7995('0x2c')](_0xe328b1)['send'](_0x5212ff);};}exports[_0x7995('0x3a')]=function(_0x242713,_0xf612e6){var _0x1d60b8={},_0x4b1541={},_0x2be2c0={'count':0x0,'rows':[]};var _0x235df7=_[_0x7995('0x3b')](db[_0x7995('0x3c')][_0x7995('0x3d')],function(_0x1035dc){return{'name':_0x1035dc['fieldName'],'type':_0x1035dc[_0x7995('0x3e')][_0x7995('0x3f')]};});_0x4b1541[_0x7995('0x40')]=_[_0x7995('0x3b')](_0x235df7,_0x7995('0x39'));_0x4b1541[_0x7995('0x41')]=_[_0x7995('0x42')](_0x242713[_0x7995('0x41')]);_0x4b1541[_0x7995('0x43')]=_[_0x7995('0x44')](_0x4b1541[_0x7995('0x40')],_0x4b1541[_0x7995('0x41')]);_0x1d60b8[_0x7995('0x45')]=_['intersection'](_0x4b1541['model'],qs[_0x7995('0x46')](_0x242713[_0x7995('0x41')]['fields']));_0x1d60b8['attributes']=_0x1d60b8[_0x7995('0x45')]['length']?_0x1d60b8['attributes']:_0x4b1541[_0x7995('0x40')];if(!_0x242713[_0x7995('0x41')][_0x7995('0x47')]('nolimit')){_0x1d60b8[_0x7995('0x48')]=qs['limit'](_0x242713[_0x7995('0x41')]['limit']);_0x1d60b8['offset']=qs[_0x7995('0x30')](_0x242713[_0x7995('0x41')][_0x7995('0x30')]);}_0x1d60b8[_0x7995('0x49')]=qs['sort'](_0x242713[_0x7995('0x41')][_0x7995('0x4a')]);_0x1d60b8[_0x7995('0x4b')]=qs[_0x7995('0x43')](_['pick'](_0x242713['query'],_0x4b1541[_0x7995('0x43')]),_0x235df7);if(_0x242713['query'][_0x7995('0x4c')]){_0x1d60b8['where']=_[_0x7995('0x4d')](_0x1d60b8['where'],{'$or':_[_0x7995('0x3b')](_0x235df7,function(_0x1b0373){if(_0x1b0373['type']!==_0x7995('0x4e')){var _0x336ff2={};_0x336ff2[_0x1b0373[_0x7995('0x39')]]={'$like':'%'+_0x242713[_0x7995('0x41')]['filter']+'%'};return _0x336ff2;}})});}_0x1d60b8=_[_0x7995('0x4d')]({},_0x1d60b8,_0x242713[_0x7995('0x4f')]);var _0x237270={'where':_0x1d60b8['where']};return db[_0x7995('0x3c')][_0x7995('0x2f')](_0x237270)[_0x7995('0x20')](function(_0x3d8ae3){_0x2be2c0[_0x7995('0x2f')]=_0x3d8ae3;if(_0x242713['query'][_0x7995('0x50')]){_0x1d60b8[_0x7995('0x51')]=[{'all':!![]}];}return db['VoiceContext'][_0x7995('0x52')](_0x1d60b8);})['then'](function(_0x1d87f9){_0x2be2c0[_0x7995('0x53')]=_0x1d87f9;return _0x2be2c0;})[_0x7995('0x20')](respondWithFilteredResult(_0xf612e6,_0x1d60b8))[_0x7995('0x2a')](handleError(_0xf612e6,null));};exports[_0x7995('0x54')]=function(_0x14b537,_0x1579b9){var _0x4d46bc={'raw':![],'where':{'id':_0x14b537[_0x7995('0x55')]['id']}},_0x427dcf={};_0x427dcf[_0x7995('0x40')]=_['keys'](db[_0x7995('0x3c')][_0x7995('0x3d')]);_0x427dcf[_0x7995('0x41')]=_['keys'](_0x14b537['query']);_0x427dcf['filters']=_[_0x7995('0x44')](_0x427dcf[_0x7995('0x40')],_0x427dcf['query']);_0x4d46bc[_0x7995('0x45')]=_[_0x7995('0x44')](_0x427dcf[_0x7995('0x40')],qs[_0x7995('0x46')](_0x14b537[_0x7995('0x41')]['fields']));_0x4d46bc[_0x7995('0x45')]=_0x4d46bc['attributes'][_0x7995('0x56')]?_0x4d46bc[_0x7995('0x45')]:_0x427dcf[_0x7995('0x40')];if(_0x14b537['query']['includeAll']){_0x4d46bc['include']=[{'all':!![]}];}_0x4d46bc=_['merge']({},_0x4d46bc,_0x14b537[_0x7995('0x4f')]);return db[_0x7995('0x3c')][_0x7995('0x57')](_0x4d46bc)[_0x7995('0x20')](handleEntityNotFound(_0x1579b9,null))[_0x7995('0x20')](respondWithResult(_0x1579b9,null))[_0x7995('0x2a')](handleError(_0x1579b9,null));};exports[_0x7995('0x58')]=function(_0xda6ce8,_0x328671,_0x17ecd3){var _0xa7af8c;return db[_0x7995('0x3c')][_0x7995('0x58')](_0xda6ce8[_0x7995('0x59')],{'raw':!![]})[_0x7995('0x20')](function(_0x416133){_0xa7af8c=_0x416133;return db[_0x7995('0x3c')][_0x7995('0x52')]({'raw':!![]});})[_0x7995('0x20')](function(_0x50b7c2){var _0x56a374=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x402fa0=ejs[_0x7995('0x5d')](_0x56a374,{'contexts':_0x50b7c2||[]});fs[_0x7995('0x5e')](_0x7995('0x5f'),_0x402fa0);})['then'](function(){return respondWithRpcPromise(_0x7995('0x60'),_0x7995('0x58'),{'module':_0x7995('0x61')});})[_0x7995('0x20')](function(){var _0x502d43=_0xda6ce8['user'][_0x7995('0x36')]({'plain':!![]});if(!_0x502d43)throw new Error(_0x7995('0x62'));if(_0x502d43[_0x7995('0x63')]===_0x7995('0x64')){var _0x37072=_0xa7af8c[_0x7995('0x36')]({'plain':!![]});return db[_0x7995('0x65')][_0x7995('0x57')]({'where':{'name':_0x7995('0x66'),'userProfileId':_0x502d43['userProfileId']},'raw':!![]})[_0x7995('0x20')](function(_0x3ec5a8){if(_0x3ec5a8&&_0x3ec5a8[_0x7995('0x67')]===0x0){return db[_0x7995('0x37')]['create']({'name':_0x37072['name'],'resourceId':_0x37072['id'],'type':_0x3ec5a8[_0x7995('0x39')],'sectionId':_0x3ec5a8['id']},{})[_0x7995('0x20')](function(){return _0xa7af8c;});}else{return _0xa7af8c;}})['catch'](function(_0x971a23){logger[_0x7995('0x27')](_0x7995('0x68'),_0x971a23);throw _0x971a23;});}return _0xa7af8c;})[_0x7995('0x20')](respondWithResult(_0x328671,0xc9))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['update']=function(_0x457d09,_0x564fca,_0x3e0a46){var _0xe31dcb;return db[_0x7995('0x3c')][_0x7995('0x57')]({'where':{'id':_0x457d09[_0x7995('0x55')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x564fca,null))[_0x7995('0x20')](saveUpdates(_0x457d09[_0x7995('0x59')],null))[_0x7995('0x20')](function(_0x3f2bde){if(_0x3f2bde){_0xe31dcb=_0x3f2bde;return db[_0x7995('0x3c')][_0x7995('0x52')]({'raw':!![]});}})['then'](function(_0x45351d){var _0x23bbc1=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x268fde=ejs[_0x7995('0x5d')](_0x23bbc1,{'contexts':_0x45351d||[]});fs[_0x7995('0x5e')](_0x7995('0x5f'),_0x268fde);})['then'](function(){return respondWithRpcPromise(_0x7995('0x60'),'update',{'module':'chan_sip.so'});})[_0x7995('0x20')](function(){return _0xe31dcb;})[_0x7995('0x20')](respondWithResult(_0x564fca,null))[_0x7995('0x2a')](handleError(_0x564fca,null));};exports[_0x7995('0x69')]=function(_0x290eae,_0x25d9a4,_0x32a52f){var _0x13dc73;return db[_0x7995('0x3c')][_0x7995('0x57')]({'where':{'id':_0x290eae['params']['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x25d9a4,null))[_0x7995('0x20')](removeEntity(_0x25d9a4,null))[_0x7995('0x20')](function(){return db['VoiceContext'][_0x7995('0x52')]({'raw':!![]});})[_0x7995('0x20')](function(_0x705f0){var _0x3a7d9d=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x1fdff6=ejs[_0x7995('0x5d')](_0x3a7d9d,{'contexts':_0x705f0});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x1fdff6);return respondWithRpcPromise(_0x7995('0x60'),_0x7995('0x69'),{'module':_0x7995('0x61')});})[_0x7995('0x2a')](handleError(_0x25d9a4,null));};
\ No newline at end of file
+var _0x008c=['../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','VoiceContext,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','status','end','count','offset','limit','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','stack','name','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','/etc/asterisk/extensions_xcally_contexts.conf','readFileSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger'];(function(_0xc6a72f,_0x1ac77c){var _0x3728f7=function(_0x3d1427){while(--_0x3d1427){_0xc6a72f['push'](_0xc6a72f['shift']());}};_0x3728f7(++_0x1ac77c);}(_0x008c,0x188));var _0xc008=function(_0x32665e,_0x12740e){_0x32665e=_0x32665e-0x0;var _0x10be45=_0x008c[_0x32665e];return _0x10be45;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var jayson=require(_0xc008('0x17'));var client=jayson[_0xc008('0x18')][_0xc008('0x19')]({'port':0x232a});function checkPasswordPattern(_0x69726e,_0x593f7a,_0x560e28){if(_0x560e28){var _0x33f44c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f44c['test'](_0x593f7a)){return _0x69726e;}else{throw new db[(_0xc008('0x1a'))][(_0xc008('0x1b'))](_0xc008('0x1c'));}}else{return _0x69726e;}}function respondWithRpcPromise(_0x339ffc,_0x3f0ecf,_0x5ee00b,_0x5e894e){return new BPromise(function(_0x4bd0f4,_0x11ef38){var _0x15a6ad=_0x5e894e||client;return _0x15a6ad[_0xc008('0x1d')](_0x339ffc,_0x5ee00b)[_0xc008('0x1e')](function(_0x4fe771){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent');logger[_0xc008('0x1f')](_0xc008('0x20'),_0x3f0ecf,'request\x20sent',JSON[_0xc008('0x21')](_0x4fe771));if(_0x4fe771['error']){if(_0x4fe771['error']['code']===0x1f4){logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771['error']['message']);return _0x11ef38(_0x4fe771['error']['message']);}logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);return _0x4bd0f4(_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);}else{logger[_0xc008('0x25')]('VoiceContext,\x20%s,\x20%s',_0x3f0ecf,_0xc008('0x26'));_0x4bd0f4(_0x4fe771['result']['message']);}})[_0xc008('0x27')](function(_0x36f358){logger[_0xc008('0x23')](_0xc008('0x22'),_0x3f0ecf,_0x36f358);_0x11ef38(_0x36f358);});});}function respondWithStatusCode(_0x5410f5,_0x48582b){_0x48582b=_0x48582b||0xcc;return function(_0x5de1e9){if(_0x5de1e9){return _0x5410f5[_0xc008('0x28')](_0x48582b);}return _0x5410f5[_0xc008('0x29')](_0x48582b)[_0xc008('0x2a')]();};}function respondWithResult(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0xc8;return function(_0x5e2aca){if(_0x5e2aca){return _0x2e31c2['status'](_0x5bebd9)['json'](_0x5e2aca);}};}function respondWithFilteredResult(_0x4caaf4,_0x3865c0){return function(_0x29ba43){if(_0x29ba43){var _0x25eae4=_0x29ba43[_0xc008('0x2b')],_0x529961=_0x3865c0[_0xc008('0x2c')],_0x24c14c=_0x3865c0['offset']+_0x3865c0[_0xc008('0x2d')],_0x32390d;if(_0x24c14c>=_0x25eae4){_0x24c14c=_0x25eae4;_0x32390d=0xc8;}else{_0x32390d=0xce;}_0x4caaf4[_0xc008('0x29')](_0x32390d);return _0x4caaf4['set']('Content-Range',_0x529961+'-'+_0x24c14c+'/'+_0x25eae4)['json'](_0x29ba43);}return null;};}function patchUpdates(_0x1032b2){return function(_0x267abd){try{jsonpatch[_0xc008('0x2e')](_0x267abd,_0x1032b2,!![]);}catch(_0x10889f){return BPromise[_0xc008('0x2f')](_0x10889f);}return _0x267abd[_0xc008('0x30')]();};}function saveUpdates(_0x294f97,_0x22d8e8){return function(_0x1fe1e1){if(_0x1fe1e1){return _0x1fe1e1[_0xc008('0x31')](_0x294f97)[_0xc008('0x1e')](function(_0x1ac7c8){return _0x1ac7c8;});}return null;};}function removeEntity(_0x596ee8,_0x334a09){return function(_0x4b7fd4){if(_0x4b7fd4){return _0x4b7fd4['destroy']()[_0xc008('0x1e')](function(){var _0x165a7b=_0x4b7fd4[_0xc008('0x32')]({'plain':!![]});var _0xca0520=_0xc008('0x33');return db[_0xc008('0x34')][_0xc008('0x35')]({'where':{'type':_0xca0520,'resourceId':_0x165a7b['id']}})[_0xc008('0x1e')](function(){return _0x4b7fd4;});})[_0xc008('0x1e')](function(){_0x596ee8['status'](0xcc)[_0xc008('0x2a')]();});}};}function handleEntityNotFound(_0x389a40,_0x459df4){return function(_0x344bad){if(!_0x344bad){_0x389a40[_0xc008('0x28')](0x194);}return _0x344bad;};}function handleError(_0x315562,_0x1667a0){_0x1667a0=_0x1667a0||0x1f4;return function(_0x5d0e06){logger[_0xc008('0x23')](_0x5d0e06[_0xc008('0x36')]);if(_0x5d0e06['name']){delete _0x5d0e06[_0xc008('0x37')];}_0x315562[_0xc008('0x29')](_0x1667a0)['send'](_0x5d0e06);};}exports[_0xc008('0x38')]=function(_0x2e4ae1,_0x280e9b){var _0x55ff48={},_0x53b353={},_0x478810={'count':0x0,'rows':[]};var _0x234f2a=_['map'](db[_0xc008('0x39')][_0xc008('0x3a')],function(_0x6a4ccb){return{'name':_0x6a4ccb[_0xc008('0x3b')],'type':_0x6a4ccb[_0xc008('0x3c')][_0xc008('0x3d')]};});_0x53b353[_0xc008('0x3e')]=_[_0xc008('0x3f')](_0x234f2a,_0xc008('0x37'));_0x53b353[_0xc008('0x40')]=_[_0xc008('0x41')](_0x2e4ae1[_0xc008('0x40')]);_0x53b353[_0xc008('0x42')]=_[_0xc008('0x43')](_0x53b353['model'],_0x53b353[_0xc008('0x40')]);_0x55ff48[_0xc008('0x44')]=_[_0xc008('0x43')](_0x53b353[_0xc008('0x3e')],qs['fields'](_0x2e4ae1[_0xc008('0x40')][_0xc008('0x45')]));_0x55ff48[_0xc008('0x44')]=_0x55ff48[_0xc008('0x44')][_0xc008('0x46')]?_0x55ff48['attributes']:_0x53b353[_0xc008('0x3e')];if(!_0x2e4ae1[_0xc008('0x40')][_0xc008('0x47')](_0xc008('0x48'))){_0x55ff48[_0xc008('0x2d')]=qs['limit'](_0x2e4ae1[_0xc008('0x40')][_0xc008('0x2d')]);_0x55ff48[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x2e4ae1['query'][_0xc008('0x2c')]);}_0x55ff48[_0xc008('0x49')]=qs[_0xc008('0x4a')](_0x2e4ae1['query'][_0xc008('0x4a')]);_0x55ff48['where']=qs[_0xc008('0x42')](_['pick'](_0x2e4ae1[_0xc008('0x40')],_0x53b353[_0xc008('0x42')]),_0x234f2a);if(_0x2e4ae1['query'][_0xc008('0x4b')]){_0x55ff48[_0xc008('0x4c')]=_[_0xc008('0x4d')](_0x55ff48['where'],{'$or':_[_0xc008('0x3f')](_0x234f2a,function(_0x2a9b5c){if(_0x2a9b5c[_0xc008('0x3c')]!==_0xc008('0x4e')){var _0x347629={};_0x347629[_0x2a9b5c[_0xc008('0x37')]]={'$like':'%'+_0x2e4ae1['query']['filter']+'%'};return _0x347629;}})});}_0x55ff48=_['merge']({},_0x55ff48,_0x2e4ae1[_0xc008('0x4f')]);var _0x36417a={'where':_0x55ff48[_0xc008('0x4c')]};return db[_0xc008('0x39')][_0xc008('0x2b')](_0x36417a)[_0xc008('0x1e')](function(_0x2cf641){_0x478810[_0xc008('0x2b')]=_0x2cf641;if(_0x2e4ae1['query']['includeAll']){_0x55ff48['include']=[{'all':!![]}];}return db[_0xc008('0x39')][_0xc008('0x50')](_0x55ff48);})[_0xc008('0x1e')](function(_0x511383){_0x478810[_0xc008('0x51')]=_0x511383;return _0x478810;})[_0xc008('0x1e')](respondWithFilteredResult(_0x280e9b,_0x55ff48))[_0xc008('0x27')](handleError(_0x280e9b,null));};exports[_0xc008('0x52')]=function(_0x4981b4,_0x56e4ac){var _0x17ec90={'raw':![],'where':{'id':_0x4981b4[_0xc008('0x53')]['id']}},_0x405e87={};_0x405e87[_0xc008('0x3e')]=_['keys'](db['VoiceContext'][_0xc008('0x3a')]);_0x405e87['query']=_[_0xc008('0x41')](_0x4981b4[_0xc008('0x40')]);_0x405e87[_0xc008('0x42')]=_['intersection'](_0x405e87[_0xc008('0x3e')],_0x405e87[_0xc008('0x40')]);_0x17ec90[_0xc008('0x44')]=_[_0xc008('0x43')](_0x405e87[_0xc008('0x3e')],qs['fields'](_0x4981b4[_0xc008('0x40')][_0xc008('0x45')]));_0x17ec90['attributes']=_0x17ec90[_0xc008('0x44')][_0xc008('0x46')]?_0x17ec90['attributes']:_0x405e87['model'];if(_0x4981b4[_0xc008('0x40')][_0xc008('0x54')]){_0x17ec90[_0xc008('0x55')]=[{'all':!![]}];}_0x17ec90=_[_0xc008('0x4d')]({},_0x17ec90,_0x4981b4[_0xc008('0x4f')]);return db['VoiceContext']['find'](_0x17ec90)[_0xc008('0x1e')](handleEntityNotFound(_0x56e4ac,null))['then'](respondWithResult(_0x56e4ac,null))[_0xc008('0x27')](handleError(_0x56e4ac,null));};exports[_0xc008('0x56')]=function(_0xf94fcb,_0x2f1105,_0x44f42d){var _0x27a167;return db['VoiceContext'][_0xc008('0x56')](_0xf94fcb[_0xc008('0x57')],{'raw':!![]})[_0xc008('0x1e')](function(_0x2b350c){_0x27a167=_0x2b350c;return db[_0xc008('0x39')]['findAll']({'raw':!![]});})[_0xc008('0x1e')](function(_0x4fdab4){var _0x535e6e=fs['readFileSync'](path[_0xc008('0x58')](config[_0xc008('0x59')],_0xc008('0x5a')),'utf8');var _0x3aeeab=ejs[_0xc008('0x5b')](_0x535e6e,{'contexts':_0x4fdab4||[]});fs[_0xc008('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3aeeab);})[_0xc008('0x1e')](function(){return respondWithRpcPromise(_0xc008('0x5d'),_0xc008('0x56'),{'module':_0xc008('0x5e')});})['then'](function(){var _0x4022dd=_0xf94fcb['user'][_0xc008('0x32')]({'plain':!![]});if(!_0x4022dd)throw new Error(_0xc008('0x5f'));if(_0x4022dd[_0xc008('0x60')]===_0xc008('0x61')){var _0x192c87=_0x27a167[_0xc008('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xc008('0x62')]({'where':{'name':'Contexts','userProfileId':_0x4022dd['userProfileId']},'raw':!![]})[_0xc008('0x1e')](function(_0x30aa1e){if(_0x30aa1e&&_0x30aa1e['autoAssociation']===0x0){return db[_0xc008('0x34')][_0xc008('0x56')]({'name':_0x192c87[_0xc008('0x37')],'resourceId':_0x192c87['id'],'type':_0x30aa1e[_0xc008('0x37')],'sectionId':_0x30aa1e['id']},{})[_0xc008('0x1e')](function(){return _0x27a167;});}else{return _0x27a167;}})[_0xc008('0x27')](function(_0x12973b){logger['error'](_0xc008('0x63'),_0x12973b);throw _0x12973b;});}return _0x27a167;})[_0xc008('0x1e')](respondWithResult(_0x2f1105,0xc9))[_0xc008('0x27')](handleError(_0x2f1105,null));};exports[_0xc008('0x31')]=function(_0xb3ca0f,_0x167425,_0x249898){var _0x280249;return db[_0xc008('0x39')][_0xc008('0x62')]({'where':{'id':_0xb3ca0f[_0xc008('0x53')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x167425,null))[_0xc008('0x1e')](saveUpdates(_0xb3ca0f[_0xc008('0x57')],null))['then'](function(_0x36a08e){if(_0x36a08e){_0x280249=_0x36a08e;return db[_0xc008('0x39')][_0xc008('0x50')]({'raw':!![]});}})['then'](function(_0xd7d020){var _0x3214df=fs['readFileSync'](path['join'](config[_0xc008('0x59')],_0xc008('0x5a')),_0xc008('0x64'));var _0x39083c=ejs[_0xc008('0x5b')](_0x3214df,{'contexts':_0xd7d020||[]});fs[_0xc008('0x5c')](_0xc008('0x65'),_0x39083c);})[_0xc008('0x1e')](function(){return respondWithRpcPromise(_0xc008('0x5d'),_0xc008('0x31'),{'module':_0xc008('0x5e')});})['then'](function(){return _0x280249;})[_0xc008('0x1e')](respondWithResult(_0x167425,null))[_0xc008('0x27')](handleError(_0x167425,null));};exports[_0xc008('0x35')]=function(_0x27dc80,_0x521e67,_0x17ffb1){var _0x5975de;return db[_0xc008('0x39')][_0xc008('0x62')]({'where':{'id':_0x27dc80[_0xc008('0x53')]['id']}})['then'](handleEntityNotFound(_0x521e67,null))[_0xc008('0x1e')](removeEntity(_0x521e67,null))[_0xc008('0x1e')](function(){return db[_0xc008('0x39')]['findAll']({'raw':!![]});})[_0xc008('0x1e')](function(_0x539fc8){var _0x50ee03=fs[_0xc008('0x66')](path[_0xc008('0x58')](config[_0xc008('0x59')],_0xc008('0x5a')),'utf8');var _0x3c30db=ejs[_0xc008('0x5b')](_0x50ee03,{'contexts':_0x539fc8});fs['writeFileSync'](_0xc008('0x65'),_0x3c30db);return respondWithRpcPromise('Reload',_0xc008('0x35'),{'module':'chan_sip.so'});})[_0xc008('0x27')](handleError(_0x521e67,null));};
\ No newline at end of file
index 5a162ce..8f46474 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe064=['path','rimraf','../../config/environment','./voiceContext.attributes','define','voice_contexts','util','moment','bluebird','request-promise'];(function(_0x5bcd74,_0x55ce3e){var _0x153259=function(_0x10594e){while(--_0x10594e){_0x5bcd74['push'](_0x5bcd74['shift']());}};_0x153259(++_0x55ce3e);}(_0xe064,0x114));var _0x4e06=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xe064[_0x1b1a3b];return _0x385347;};'use strict';var _=require('lodash');var util=require(_0x4e06('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4e06('0x1'));var BPromise=require(_0x4e06('0x2'));var rp=require(_0x4e06('0x3'));var fs=require('fs');var path=require(_0x4e06('0x4'));var rimraf=require(_0x4e06('0x5'));var config=require(_0x4e06('0x6'));var attributes=require(_0x4e06('0x7'));module['exports']=function(_0xa5a064,_0x41ff81){return _0xa5a064[_0x4e06('0x8')]('VoiceContext',attributes,{'tableName':_0x4e06('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe83f=['exports','define','VoiceContext','voice_contexts','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x58155f,_0x2f989f){var _0xfef168=function(_0x3d77f4){while(--_0x3d77f4){_0x58155f['push'](_0x58155f['shift']());}};_0xfef168(++_0x2f989f);}(_0xe83f,0xeb));var _0xfe83=function(_0x181ef7,_0x4bb8db){_0x181ef7=_0x181ef7-0x0;var _0x766086=_0xe83f[_0x181ef7];return _0x766086;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfe83('0x0'))('api');var moment=require(_0xfe83('0x1'));var BPromise=require(_0xfe83('0x2'));var rp=require(_0xfe83('0x3'));var fs=require('fs');var path=require(_0xfe83('0x4'));var rimraf=require(_0xfe83('0x5'));var config=require(_0xfe83('0x6'));var attributes=require('./voiceContext.attributes');module[_0xfe83('0x7')]=function(_0x14abe3,_0x2f7f9a){return _0x14abe3[_0xfe83('0x8')](_0xfe83('0x9'),attributes,{'tableName':_0xfe83('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9cf1693..1124696 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05d9=['code','VoiceContext,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x7c0b62,_0x47bd77){var _0x32011e=function(_0x368f79){while(--_0x368f79){_0x7c0b62['push'](_0x7c0b62['shift']());}};_0x32011e(++_0x47bd77);}(_0x05d9,0xc1));var _0x905d=function(_0x41bb10,_0x36ee3f){_0x41bb10=_0x41bb10-0x0;var _0x14ee26=_0x05d9[_0x41bb10];return _0x14ee26;};'use strict';var _=require(_0x905d('0x0'));var util=require(_0x905d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x905d('0x2'));var fs=require('fs');var Redis=require(_0x905d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x905d('0x4'));var logger=require('../../config/logger')(_0x905d('0x5'));var config=require(_0x905d('0x6'));var jayson=require(_0x905d('0x7'));var client=jayson['client'][_0x905d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cee5f,_0x11856d,_0x22192d){return new BPromise(function(_0x3bb995,_0x345ecc){return client[_0x905d('0x9')](_0x1cee5f,_0x22192d)[_0x905d('0xa')](function(_0xb0701d){logger[_0x905d('0xb')]('VoiceContext,\x20%s,\x20%s',_0x11856d,'request\x20sent');logger[_0x905d('0xc')](_0x905d('0xd'),_0x11856d,_0x905d('0xe'),JSON[_0x905d('0xf')](_0xb0701d));if(_0xb0701d[_0x905d('0x10')]){if(_0xb0701d[_0x905d('0x10')][_0x905d('0x11')]===0x1f4){logger['error'](_0x905d('0x12'),_0x11856d,_0xb0701d[_0x905d('0x10')][_0x905d('0x13')]);return _0x345ecc(_0xb0701d[_0x905d('0x10')][_0x905d('0x13')]);}logger['error'](_0x905d('0x12'),_0x11856d,_0xb0701d['error'][_0x905d('0x13')]);return _0x3bb995(_0xb0701d['error']['message']);}else{logger[_0x905d('0xb')](_0x905d('0x12'),_0x11856d,_0x905d('0xe'));_0x3bb995(_0xb0701d['result']['message']);}})[_0x905d('0x14')](function(_0x28acab){logger[_0x905d('0x10')](_0x905d('0x12'),_0x11856d,_0x28acab);_0x345ecc(_0x28acab);});});}
\ No newline at end of file
+var _0xdbfe=['http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client'];(function(_0x477cdc,_0x396970){var _0x3fec08=function(_0x554027){while(--_0x554027){_0x477cdc['push'](_0x477cdc['shift']());}};_0x3fec08(++_0x396970);}(_0xdbfe,0x1b0));var _0xedbf=function(_0x4439d7,_0x4153c4){_0x4439d7=_0x4439d7-0x0;var _0xfdf117=_0xdbfe[_0x4439d7];return _0xfdf117;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xedbf('0x0'));var BPromise=require(_0xedbf('0x1'));var rs=require(_0xedbf('0x2'));var fs=require('fs');var Redis=require(_0xedbf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xedbf('0x4'));var logger=require('../../config/logger')(_0xedbf('0x5'));var config=require(_0xedbf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xedbf('0x7')][_0xedbf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168ab4,_0x4892d8,_0x5642f5){return new BPromise(function(_0x422609,_0xe52211){return client[_0xedbf('0x9')](_0x168ab4,_0x5642f5)[_0xedbf('0xa')](function(_0x228585){logger[_0xedbf('0xb')]('VoiceContext,\x20%s,\x20%s',_0x4892d8,_0xedbf('0xc'));logger[_0xedbf('0xd')](_0xedbf('0xe'),_0x4892d8,_0xedbf('0xc'),JSON[_0xedbf('0xf')](_0x228585));if(_0x228585[_0xedbf('0x10')]){if(_0x228585[_0xedbf('0x10')]['code']===0x1f4){logger[_0xedbf('0x10')](_0xedbf('0x11'),_0x4892d8,_0x228585[_0xedbf('0x10')][_0xedbf('0x12')]);return _0xe52211(_0x228585['error']['message']);}logger['error'](_0xedbf('0x11'),_0x4892d8,_0x228585[_0xedbf('0x10')][_0xedbf('0x12')]);return _0x422609(_0x228585[_0xedbf('0x10')][_0xedbf('0x12')]);}else{logger[_0xedbf('0xb')]('VoiceContext,\x20%s,\x20%s',_0x4892d8,_0xedbf('0xc'));_0x422609(_0x228585['result'][_0xedbf('0x12')]);}})[_0xedbf('0x13')](function(_0x331dd9){logger[_0xedbf('0x10')](_0xedbf('0x11'),_0x4892d8,_0x331dd9);_0xe52211(_0x331dd9);});});}
\ No newline at end of file
index 7b5160f..83e7412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf5e=['multer','connect-timeout','Router','../../components/auth/service','./voiceDialReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xdf5e,0x1db));var _0xedf5=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0xdf5e[_0x31e5cb];return _0x4170df;};'use strict';var multer=require(_0xedf5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xedf5('0x1'));var express=require('express');var router=express[_0xedf5('0x2')]();var auth=require(_0xedf5('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xedf5('0x4'));router['get']('/',auth[_0xedf5('0x5')](),controller[_0xedf5('0x6')]);router['get'](_0xedf5('0x7'),auth['isAuthenticated'](),controller[_0xedf5('0x8')]);router[_0xedf5('0x9')](_0xedf5('0xa'),auth['isAuthenticated'](),controller[_0xedf5('0xb')]);router[_0xedf5('0xc')]('/',auth[_0xedf5('0x5')](),controller[_0xedf5('0xd')]);router[_0xedf5('0xe')]('/:id',auth[_0xedf5('0x5')](),controller[_0xedf5('0xf')]);router[_0xedf5('0x10')](_0xedf5('0xa'),auth[_0xedf5('0x5')](),controller[_0xedf5('0x11')]);module[_0xedf5('0x12')]=router;
\ No newline at end of file
+var _0x0be2=['../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','put','delete','exports','multer','express'];(function(_0x3a1333,_0x1d439c){var _0x4bf4fb=function(_0x4f9905){while(--_0x4f9905){_0x3a1333['push'](_0x3a1333['shift']());}};_0x4bf4fb(++_0x1d439c);}(_0x0be2,0x108));var _0x20be=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0x0be2[_0x1f7996];return _0x584609;};'use strict';var multer=require(_0x20be('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x20be('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x20be('0x2'));var controller=require(_0x20be('0x3'));router['get']('/',auth[_0x20be('0x4')](),controller[_0x20be('0x5')]);router[_0x20be('0x6')](_0x20be('0x7'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x20be('0x8'),auth['isAuthenticated'](),controller[_0x20be('0x9')]);router[_0x20be('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x20be('0xb')](_0x20be('0x8'),auth[_0x20be('0x4')](),controller['update']);router[_0x20be('0xc')](_0x20be('0x8'),auth[_0x20be('0x4')](),controller['destroy']);module[_0x20be('0xd')]=router;
\ No newline at end of file
index 71413ac..5a6d2f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe3c=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x8dec19,_0x18d430){var _0x4982b8=function(_0xe8492d){while(--_0xe8492d){_0x8dec19['push'](_0x8dec19['shift']());}};_0x4982b8(++_0x18d430);}(_0xfe3c,0x1b7));var _0xcfe3=function(_0x14739c,_0x3d0b09){_0x14739c=_0x14739c-0x0;var _0x16e1cf=_0xfe3c[_0x14739c];return _0x16e1cf;};'use strict';var Sequelize=require('sequelize');module[_0xcfe3('0x0')]={'privilege':{'type':Sequelize[_0xcfe3('0x1')]},'channel':{'type':Sequelize[_0xcfe3('0x1')]},'channelstate':{'type':Sequelize[_0xcfe3('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcfe3('0x1')]},'calleridname':{'type':Sequelize[_0xcfe3('0x1')]},'connectedlinenum':{'type':Sequelize[_0xcfe3('0x1')]},'connectedlinename':{'type':Sequelize[_0xcfe3('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xcfe3('0x1')]},'exten':{'type':Sequelize[_0xcfe3('0x1')]},'priority':{'type':Sequelize[_0xcfe3('0x2')]},'uniqueid':{'type':Sequelize[_0xcfe3('0x1')]},'linkedid':{'type':Sequelize[_0xcfe3('0x1')]},'destchannel':{'type':Sequelize[_0xcfe3('0x1')]},'destchannelstate':{'type':Sequelize[_0xcfe3('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xcfe3('0x1')]},'destcalleridnum':{'type':Sequelize[_0xcfe3('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xcfe3('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xcfe3('0x1')]},'destlanguage':{'type':Sequelize[_0xcfe3('0x1')]},'destaccountcode':{'type':Sequelize[_0xcfe3('0x1')]},'destcontext':{'type':Sequelize[_0xcfe3('0x1')]},'destexten':{'type':Sequelize[_0xcfe3('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xcfe3('0x1')]},'dialstatus':{'type':Sequelize[_0xcfe3('0x1')]},'starttime':{'type':Sequelize[_0xcfe3('0x3')]},'answertime':{'type':Sequelize[_0xcfe3('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xcfe3('0x1')],'comment':_0xcfe3('0x4')},'routeId':{'type':Sequelize[_0xcfe3('0x2')]},'duration':{'type':Sequelize[_0xcfe3('0x2')]},'holdtime':{'type':Sequelize[_0xcfe3('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4bbe=['called,connect,complete','exports','STRING','INTEGER','DATE'];(function(_0x47888a,_0x7d2f3a){var _0x2b15a4=function(_0x12a3e9){while(--_0x12a3e9){_0x47888a['push'](_0x47888a['shift']());}};_0x2b15a4(++_0x7d2f3a);}(_0x4bbe,0x16e));var _0xe4bb=function(_0x3081c6,_0x5e6879){_0x3081c6=_0x3081c6-0x0;var _0x437ccf=_0x4bbe[_0x3081c6];return _0x437ccf;};'use strict';var Sequelize=require('sequelize');module[_0xe4bb('0x0')]={'privilege':{'type':Sequelize[_0xe4bb('0x1')]},'channel':{'type':Sequelize[_0xe4bb('0x1')]},'channelstate':{'type':Sequelize[_0xe4bb('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe4bb('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe4bb('0x1')]},'language':{'type':Sequelize[_0xe4bb('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe4bb('0x1')]},'exten':{'type':Sequelize[_0xe4bb('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xe4bb('0x1')]},'linkedid':{'type':Sequelize[_0xe4bb('0x1')]},'destchannel':{'type':Sequelize[_0xe4bb('0x1')]},'destchannelstate':{'type':Sequelize[_0xe4bb('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe4bb('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe4bb('0x1')]},'destcalleridname':{'type':Sequelize[_0xe4bb('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe4bb('0x1')]},'destlanguage':{'type':Sequelize[_0xe4bb('0x1')]},'destaccountcode':{'type':Sequelize[_0xe4bb('0x1')]},'destcontext':{'type':Sequelize[_0xe4bb('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe4bb('0x1')]},'destlinkedid':{'type':Sequelize[_0xe4bb('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xe4bb('0x1')]},'starttime':{'type':Sequelize[_0xe4bb('0x3')]},'answertime':{'type':Sequelize[_0xe4bb('0x3')]},'endtime':{'type':Sequelize[_0xe4bb('0x3')]},'lastevent':{'type':Sequelize[_0xe4bb('0x1')],'comment':_0xe4bb('0x4')},'routeId':{'type':Sequelize[_0xe4bb('0x2')]},'duration':{'type':Sequelize[_0xe4bb('0x2')]},'holdtime':{'type':Sequelize[_0xe4bb('0x2')]},'billableseconds':{'type':Sequelize[_0xe4bb('0x2')]}};
\ No newline at end of file
index 4378dcf..99a32f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3378=['reject','save','update','then','error','stack','name','send','map','VoiceDialReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','catch','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply'];(function(_0x5d180a,_0x403fba){var _0x3089eb=function(_0x4d76bd){while(--_0x4d76bd){_0x5d180a['push'](_0x5d180a['shift']());}};_0x3089eb(++_0x403fba);}(_0x3378,0xc2));var _0x8337=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0x3378[_0x4c98b9];return _0x3a257a;};'use strict';var pdf=require(_0x8337('0x0'));var emlformat=require(_0x8337('0x1'));var rimraf=require(_0x8337('0x2'));var zipdir=require(_0x8337('0x3'));var jsonpatch=require(_0x8337('0x4'));var rp=require(_0x8337('0x5'));var moment=require(_0x8337('0x6'));var BPromise=require(_0x8337('0x7'));var Mustache=require(_0x8337('0x8'));var util=require(_0x8337('0x9'));var path=require(_0x8337('0xa'));var sox=require(_0x8337('0xb'));var csv=require(_0x8337('0xc'));var ejs=require(_0x8337('0xd'));var fs=require('fs');var _=require(_0x8337('0xe'));var squel=require(_0x8337('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8337('0xc'));var querystring=require('querystring');var Papa=require(_0x8337('0x10'));var Redis=require('ioredis');var authService=require(_0x8337('0x11'));var qs=require(_0x8337('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8337('0x13'));var logger=require(_0x8337('0x14'))(_0x8337('0x15'));var utils=require(_0x8337('0x16'));var config=require(_0x8337('0x17'));var db=require(_0x8337('0x18'))['db'];function respondWithStatusCode(_0x293e54,_0x5c15c9){_0x5c15c9=_0x5c15c9||0xcc;return function(_0x3bf5b1){if(_0x3bf5b1){return _0x293e54[_0x8337('0x19')](_0x5c15c9);}return _0x293e54[_0x8337('0x1a')](_0x5c15c9)[_0x8337('0x1b')]();};}function respondWithResult(_0xbe8991,_0x1cc2c7){_0x1cc2c7=_0x1cc2c7||0xc8;return function(_0x268bd9){if(_0x268bd9){return _0xbe8991[_0x8337('0x1a')](_0x1cc2c7)['json'](_0x268bd9);}};}function respondWithFilteredResult(_0x38bf82,_0x5a509f){return function(_0x2a5492){if(_0x2a5492){var _0x384d23=_0x2a5492[_0x8337('0x1c')],_0x32c858=_0x5a509f[_0x8337('0x1d')],_0x3e34ba=_0x5a509f['offset']+_0x5a509f['limit'],_0x53b6c5;if(_0x3e34ba>=_0x384d23){_0x3e34ba=_0x384d23;_0x53b6c5=0xc8;}else{_0x53b6c5=0xce;}_0x38bf82[_0x8337('0x1a')](_0x53b6c5);return _0x38bf82[_0x8337('0x1e')](_0x8337('0x1f'),_0x32c858+'-'+_0x3e34ba+'/'+_0x384d23)[_0x8337('0x20')](_0x2a5492);}return null;};}function patchUpdates(_0x2ad247){return function(_0x5c0d95){try{jsonpatch[_0x8337('0x21')](_0x5c0d95,_0x2ad247,!![]);}catch(_0x8db73){return BPromise[_0x8337('0x22')](_0x8db73);}return _0x5c0d95[_0x8337('0x23')]();};}function saveUpdates(_0x56ce84,_0x1a9cff){return function(_0x15f8ff){if(_0x15f8ff){return _0x15f8ff[_0x8337('0x24')](_0x56ce84)[_0x8337('0x25')](function(_0x396872){return _0x396872;});}return null;};}function removeEntity(_0x421b20,_0x3974db){return function(_0x52e49c){if(_0x52e49c){return _0x52e49c['destroy']()['then'](function(){_0x421b20[_0x8337('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xda250d,_0xfa33de){return function(_0x464238){if(!_0x464238){_0xda250d['sendStatus'](0x194);}return _0x464238;};}function handleError(_0x439901,_0x31afde){_0x31afde=_0x31afde||0x1f4;return function(_0x594e68){logger[_0x8337('0x26')](_0x594e68[_0x8337('0x27')]);if(_0x594e68[_0x8337('0x28')]){delete _0x594e68[_0x8337('0x28')];}_0x439901[_0x8337('0x1a')](_0x31afde)[_0x8337('0x29')](_0x594e68);};}exports['index']=function(_0x470141,_0x4d3ead){var _0x1f4335={},_0x4e4cad={},_0x1145c5={'count':0x0,'rows':[]};var _0x42d3ae=_[_0x8337('0x2a')](db[_0x8337('0x2b')][_0x8337('0x2c')],function(_0x26d62a){return{'name':_0x26d62a['fieldName'],'type':_0x26d62a[_0x8337('0x2d')][_0x8337('0x2e')]};});_0x4e4cad[_0x8337('0x2f')]=_[_0x8337('0x2a')](_0x42d3ae,_0x8337('0x28'));_0x4e4cad['query']=_[_0x8337('0x30')](_0x470141[_0x8337('0x31')]);_0x4e4cad[_0x8337('0x32')]=_[_0x8337('0x33')](_0x4e4cad[_0x8337('0x2f')],_0x4e4cad[_0x8337('0x31')]);_0x1f4335[_0x8337('0x34')]=_[_0x8337('0x33')](_0x4e4cad[_0x8337('0x2f')],qs[_0x8337('0x35')](_0x470141[_0x8337('0x31')][_0x8337('0x35')]));_0x1f4335[_0x8337('0x34')]=_0x1f4335[_0x8337('0x34')][_0x8337('0x36')]?_0x1f4335[_0x8337('0x34')]:_0x4e4cad['model'];if(!_0x470141[_0x8337('0x31')]['hasOwnProperty'](_0x8337('0x37'))){_0x1f4335['limit']=qs[_0x8337('0x38')](_0x470141[_0x8337('0x31')]['limit']);_0x1f4335[_0x8337('0x1d')]=qs[_0x8337('0x1d')](_0x470141[_0x8337('0x31')][_0x8337('0x1d')]);}_0x1f4335[_0x8337('0x39')]=qs[_0x8337('0x3a')](_0x470141[_0x8337('0x31')][_0x8337('0x3a')]);_0x1f4335['where']=qs[_0x8337('0x32')](_['pick'](_0x470141['query'],_0x4e4cad[_0x8337('0x32')]),_0x42d3ae);if(_0x470141['query'][_0x8337('0x3b')]){_0x1f4335[_0x8337('0x3c')]=_[_0x8337('0x3d')](_0x1f4335[_0x8337('0x3c')],{'$or':_['map'](_0x42d3ae,function(_0x4c5c0d){if(_0x4c5c0d[_0x8337('0x2d')]!==_0x8337('0x3e')){var _0x3fb06a={};_0x3fb06a[_0x4c5c0d[_0x8337('0x28')]]={'$like':'%'+_0x470141[_0x8337('0x31')]['filter']+'%'};return _0x3fb06a;}})});}_0x1f4335=_[_0x8337('0x3d')]({},_0x1f4335,_0x470141[_0x8337('0x3f')]);var _0x5150ae={'where':_0x1f4335[_0x8337('0x3c')]};return db[_0x8337('0x2b')][_0x8337('0x1c')](_0x5150ae)[_0x8337('0x25')](function(_0x3f015f){_0x1145c5[_0x8337('0x1c')]=_0x3f015f;if(_0x470141[_0x8337('0x31')]['includeAll']){_0x1f4335[_0x8337('0x40')]=[{'all':!![]}];}return db[_0x8337('0x2b')][_0x8337('0x41')](_0x1f4335);})[_0x8337('0x25')](function(_0x936cfc){_0x1145c5[_0x8337('0x42')]=_0x936cfc;return _0x1145c5;})[_0x8337('0x25')](respondWithFilteredResult(_0x4d3ead,_0x1f4335))['catch'](handleError(_0x4d3ead,null));};exports[_0x8337('0x43')]=function(_0x1f2e06,_0x4a914f){var _0x39eabe={'raw':!![],'where':{'id':_0x1f2e06['params']['id']}},_0x2246cb={};_0x2246cb[_0x8337('0x2f')]=_[_0x8337('0x30')](db['VoiceDialReport'][_0x8337('0x2c')]);_0x2246cb['query']=_[_0x8337('0x30')](_0x1f2e06[_0x8337('0x31')]);_0x2246cb[_0x8337('0x32')]=_[_0x8337('0x33')](_0x2246cb[_0x8337('0x2f')],_0x2246cb[_0x8337('0x31')]);_0x39eabe[_0x8337('0x34')]=_[_0x8337('0x33')](_0x2246cb['model'],qs[_0x8337('0x35')](_0x1f2e06[_0x8337('0x31')]['fields']));_0x39eabe[_0x8337('0x34')]=_0x39eabe['attributes'][_0x8337('0x36')]?_0x39eabe[_0x8337('0x34')]:_0x2246cb[_0x8337('0x2f')];if(_0x1f2e06[_0x8337('0x31')][_0x8337('0x44')]){_0x39eabe[_0x8337('0x40')]=[{'all':!![]}];}_0x39eabe=_[_0x8337('0x3d')]({},_0x39eabe,_0x1f2e06['options']);return db[_0x8337('0x2b')][_0x8337('0x45')](_0x39eabe)[_0x8337('0x25')](handleEntityNotFound(_0x4a914f,null))[_0x8337('0x25')](respondWithResult(_0x4a914f,null))[_0x8337('0x46')](handleError(_0x4a914f,null));};exports[_0x8337('0x47')]=function(_0x290663,_0x479a13){return db[_0x8337('0x2b')][_0x8337('0x47')](_0x290663[_0x8337('0x48')],{})[_0x8337('0x25')](respondWithResult(_0x479a13,0xc9))[_0x8337('0x46')](handleError(_0x479a13,null));};exports['update']=function(_0x2b70fb,_0x10d371){if(_0x2b70fb['body']['id']){delete _0x2b70fb[_0x8337('0x48')]['id'];}return db[_0x8337('0x2b')][_0x8337('0x45')]({'where':{'id':_0x2b70fb[_0x8337('0x49')]['id']}})[_0x8337('0x25')](handleEntityNotFound(_0x10d371,null))[_0x8337('0x25')](saveUpdates(_0x2b70fb[_0x8337('0x48')],null))[_0x8337('0x25')](respondWithResult(_0x10d371,null))[_0x8337('0x46')](handleError(_0x10d371,null));};exports[_0x8337('0x4a')]=function(_0x19c79d,_0x2e9f99){return db['VoiceDialReport'][_0x8337('0x45')]({'where':{'id':_0x19c79d[_0x8337('0x49')]['id']}})[_0x8337('0x25')](handleEntityNotFound(_0x2e9f99,null))['then'](removeEntity(_0x2e9f99,null))[_0x8337('0x46')](handleError(_0x2e9f99,null));};exports[_0x8337('0x4b')]=function(_0x46a5bf,_0x3355c1){return db[_0x8337('0x2b')][_0x8337('0x4b')]()[_0x8337('0x25')](respondWithResult(_0x3355c1,null))[_0x8337('0x46')](handleError(_0x3355c1,null));};
\ No newline at end of file
+var _0x0a24=['includeAll','include','find','create','body','update','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','name','send','index','map','VoiceDialReport','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','catch','params'];(function(_0xe2d4dd,_0x1d90a5){var _0x99195f=function(_0x488a34){while(--_0x488a34){_0xe2d4dd['push'](_0xe2d4dd['shift']());}};_0x99195f(++_0x1d90a5);}(_0x0a24,0xd0));var _0x40a2=function(_0xa81926,_0x38e368){_0xa81926=_0xa81926-0x0;var _0x8177ef=_0x0a24[_0xa81926];return _0x8177ef;};'use strict';var pdf=require(_0x40a2('0x0'));var emlformat=require(_0x40a2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x40a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40a2('0x3'));var moment=require(_0x40a2('0x4'));var BPromise=require(_0x40a2('0x5'));var Mustache=require('mustache');var util=require(_0x40a2('0x6'));var path=require(_0x40a2('0x7'));var sox=require(_0x40a2('0x8'));var csv=require(_0x40a2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x40a2('0xa'));var crypto=require(_0x40a2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x40a2('0xc'));var toCsv=require(_0x40a2('0x9'));var querystring=require(_0x40a2('0xd'));var Papa=require(_0x40a2('0xe'));var Redis=require('ioredis');var authService=require(_0x40a2('0xf'));var qs=require(_0x40a2('0x10'));var as=require(_0x40a2('0x11'));var hardwareService=require(_0x40a2('0x12'));var logger=require(_0x40a2('0x13'))(_0x40a2('0x14'));var utils=require(_0x40a2('0x15'));var config=require(_0x40a2('0x16'));var db=require(_0x40a2('0x17'))['db'];function respondWithStatusCode(_0x32d9ab,_0x567d51){_0x567d51=_0x567d51||0xcc;return function(_0x278931){if(_0x278931){return _0x32d9ab[_0x40a2('0x18')](_0x567d51);}return _0x32d9ab['status'](_0x567d51)['end']();};}function respondWithResult(_0x19b3a5,_0x5cebe2){_0x5cebe2=_0x5cebe2||0xc8;return function(_0x934bbf){if(_0x934bbf){return _0x19b3a5['status'](_0x5cebe2)[_0x40a2('0x19')](_0x934bbf);}};}function respondWithFilteredResult(_0x858e4,_0x5e1302){return function(_0x493af5){if(_0x493af5){var _0x48b157=_0x493af5[_0x40a2('0x1a')],_0xea6413=_0x5e1302[_0x40a2('0x1b')],_0x90f725=_0x5e1302[_0x40a2('0x1b')]+_0x5e1302[_0x40a2('0x1c')],_0x334f78;if(_0x90f725>=_0x48b157){_0x90f725=_0x48b157;_0x334f78=0xc8;}else{_0x334f78=0xce;}_0x858e4[_0x40a2('0x1d')](_0x334f78);return _0x858e4[_0x40a2('0x1e')](_0x40a2('0x1f'),_0xea6413+'-'+_0x90f725+'/'+_0x48b157)[_0x40a2('0x19')](_0x493af5);}return null;};}function patchUpdates(_0x21323f){return function(_0x223e20){try{jsonpatch[_0x40a2('0x20')](_0x223e20,_0x21323f,!![]);}catch(_0x222f79){return BPromise[_0x40a2('0x21')](_0x222f79);}return _0x223e20[_0x40a2('0x22')]();};}function saveUpdates(_0x1ab1ee,_0x326937){return function(_0x3c3ac2){if(_0x3c3ac2){return _0x3c3ac2['update'](_0x1ab1ee)[_0x40a2('0x23')](function(_0x17e1d2){return _0x17e1d2;});}return null;};}function removeEntity(_0x5209cc,_0x385315){return function(_0x7031cd){if(_0x7031cd){return _0x7031cd['destroy']()[_0x40a2('0x23')](function(){_0x5209cc[_0x40a2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4682de,_0x34c790){return function(_0x39bfe3){if(!_0x39bfe3){_0x4682de['sendStatus'](0x194);}return _0x39bfe3;};}function handleError(_0x19dc83,_0x4add54){_0x4add54=_0x4add54||0x1f4;return function(_0x2011bd){logger['error'](_0x2011bd['stack']);if(_0x2011bd[_0x40a2('0x24')]){delete _0x2011bd['name'];}_0x19dc83[_0x40a2('0x1d')](_0x4add54)[_0x40a2('0x25')](_0x2011bd);};}exports[_0x40a2('0x26')]=function(_0x44970c,_0x583f5e){var _0x5f0ffd={},_0x9aa020={},_0x1f2ea3={'count':0x0,'rows':[]};var _0x5da3d4=_[_0x40a2('0x27')](db[_0x40a2('0x28')]['rawAttributes'],function(_0x49cefa){return{'name':_0x49cefa['fieldName'],'type':_0x49cefa[_0x40a2('0x29')][_0x40a2('0x2a')]};});_0x9aa020[_0x40a2('0x2b')]=_[_0x40a2('0x27')](_0x5da3d4,_0x40a2('0x24'));_0x9aa020['query']=_[_0x40a2('0x2c')](_0x44970c[_0x40a2('0x2d')]);_0x9aa020[_0x40a2('0x2e')]=_[_0x40a2('0x2f')](_0x9aa020[_0x40a2('0x2b')],_0x9aa020[_0x40a2('0x2d')]);_0x5f0ffd[_0x40a2('0x30')]=_[_0x40a2('0x2f')](_0x9aa020[_0x40a2('0x2b')],qs[_0x40a2('0x31')](_0x44970c['query']['fields']));_0x5f0ffd['attributes']=_0x5f0ffd['attributes'][_0x40a2('0x32')]?_0x5f0ffd[_0x40a2('0x30')]:_0x9aa020[_0x40a2('0x2b')];if(!_0x44970c[_0x40a2('0x2d')][_0x40a2('0x33')](_0x40a2('0x34'))){_0x5f0ffd['limit']=qs[_0x40a2('0x1c')](_0x44970c[_0x40a2('0x2d')][_0x40a2('0x1c')]);_0x5f0ffd[_0x40a2('0x1b')]=qs[_0x40a2('0x1b')](_0x44970c[_0x40a2('0x2d')]['offset']);}_0x5f0ffd[_0x40a2('0x35')]=qs[_0x40a2('0x36')](_0x44970c[_0x40a2('0x2d')][_0x40a2('0x36')]);_0x5f0ffd[_0x40a2('0x37')]=qs[_0x40a2('0x2e')](_['pick'](_0x44970c[_0x40a2('0x2d')],_0x9aa020[_0x40a2('0x2e')]),_0x5da3d4);if(_0x44970c['query'][_0x40a2('0x38')]){_0x5f0ffd['where']=_[_0x40a2('0x39')](_0x5f0ffd[_0x40a2('0x37')],{'$or':_[_0x40a2('0x27')](_0x5da3d4,function(_0x57c59d){if(_0x57c59d[_0x40a2('0x29')]!=='VIRTUAL'){var _0x2c0ce2={};_0x2c0ce2[_0x57c59d[_0x40a2('0x24')]]={'$like':'%'+_0x44970c['query'][_0x40a2('0x38')]+'%'};return _0x2c0ce2;}})});}_0x5f0ffd=_[_0x40a2('0x39')]({},_0x5f0ffd,_0x44970c['options']);var _0x5ee0e4={'where':_0x5f0ffd[_0x40a2('0x37')]};return db[_0x40a2('0x28')][_0x40a2('0x1a')](_0x5ee0e4)[_0x40a2('0x23')](function(_0x96297){_0x1f2ea3[_0x40a2('0x1a')]=_0x96297;if(_0x44970c[_0x40a2('0x2d')]['includeAll']){_0x5f0ffd['include']=[{'all':!![]}];}return db[_0x40a2('0x28')]['findAll'](_0x5f0ffd);})[_0x40a2('0x23')](function(_0x29eb97){_0x1f2ea3['rows']=_0x29eb97;return _0x1f2ea3;})[_0x40a2('0x23')](respondWithFilteredResult(_0x583f5e,_0x5f0ffd))[_0x40a2('0x3a')](handleError(_0x583f5e,null));};exports['show']=function(_0x383507,_0x4df181){var _0x13c5e3={'raw':!![],'where':{'id':_0x383507[_0x40a2('0x3b')]['id']}},_0x3ccff6={};_0x3ccff6[_0x40a2('0x2b')]=_[_0x40a2('0x2c')](db[_0x40a2('0x28')]['rawAttributes']);_0x3ccff6[_0x40a2('0x2d')]=_[_0x40a2('0x2c')](_0x383507[_0x40a2('0x2d')]);_0x3ccff6[_0x40a2('0x2e')]=_[_0x40a2('0x2f')](_0x3ccff6[_0x40a2('0x2b')],_0x3ccff6[_0x40a2('0x2d')]);_0x13c5e3[_0x40a2('0x30')]=_[_0x40a2('0x2f')](_0x3ccff6[_0x40a2('0x2b')],qs['fields'](_0x383507['query']['fields']));_0x13c5e3[_0x40a2('0x30')]=_0x13c5e3[_0x40a2('0x30')][_0x40a2('0x32')]?_0x13c5e3[_0x40a2('0x30')]:_0x3ccff6['model'];if(_0x383507['query'][_0x40a2('0x3c')]){_0x13c5e3[_0x40a2('0x3d')]=[{'all':!![]}];}_0x13c5e3=_[_0x40a2('0x39')]({},_0x13c5e3,_0x383507['options']);return db['VoiceDialReport'][_0x40a2('0x3e')](_0x13c5e3)[_0x40a2('0x23')](handleEntityNotFound(_0x4df181,null))['then'](respondWithResult(_0x4df181,null))['catch'](handleError(_0x4df181,null));};exports[_0x40a2('0x3f')]=function(_0xf111f,_0x32dd5d){return db[_0x40a2('0x28')][_0x40a2('0x3f')](_0xf111f[_0x40a2('0x40')],{})['then'](respondWithResult(_0x32dd5d,0xc9))['catch'](handleError(_0x32dd5d,null));};exports[_0x40a2('0x41')]=function(_0x53c2db,_0x2a0d9f){if(_0x53c2db[_0x40a2('0x40')]['id']){delete _0x53c2db[_0x40a2('0x40')]['id'];}return db[_0x40a2('0x28')][_0x40a2('0x3e')]({'where':{'id':_0x53c2db[_0x40a2('0x3b')]['id']}})[_0x40a2('0x23')](handleEntityNotFound(_0x2a0d9f,null))[_0x40a2('0x23')](saveUpdates(_0x53c2db[_0x40a2('0x40')],null))['then'](respondWithResult(_0x2a0d9f,null))[_0x40a2('0x3a')](handleError(_0x2a0d9f,null));};exports['destroy']=function(_0x321470,_0x2c3a52){return db[_0x40a2('0x28')][_0x40a2('0x3e')]({'where':{'id':_0x321470[_0x40a2('0x3b')]['id']}})[_0x40a2('0x23')](handleEntityNotFound(_0x2c3a52,null))[_0x40a2('0x23')](removeEntity(_0x2c3a52,null))[_0x40a2('0x3a')](handleError(_0x2c3a52,null));};exports[_0x40a2('0x42')]=function(_0x4e4c05,_0x49fa76){return db['VoiceDialReport'][_0x40a2('0x42')]()[_0x40a2('0x23')](respondWithResult(_0x49fa76,null))[_0x40a2('0x3a')](handleError(_0x49fa76,null));};
\ No newline at end of file
index 7be5fb3..5da903f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88bb=['report_dial','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0xfe7db6,_0xe870c1){var _0xcd814a=function(_0x18c9aa){while(--_0x18c9aa){_0xfe7db6['push'](_0xfe7db6['shift']());}};_0xcd814a(++_0xe870c1);}(_0x88bb,0xc6));var _0xb88b=function(_0x5f0517,_0x45a090){_0x5f0517=_0x5f0517-0x0;var _0x58e88f=_0x88bb[_0x5f0517];return _0x58e88f;};'use strict';var _=require(_0xb88b('0x0'));var util=require(_0xb88b('0x1'));var logger=require('../../config/logger')(_0xb88b('0x2'));var moment=require(_0xb88b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb88b('0x4'));var fs=require('fs');var path=require(_0xb88b('0x5'));var rimraf=require(_0xb88b('0x6'));var config=require(_0xb88b('0x7'));var attributes=require(_0xb88b('0x8'));module[_0xb88b('0x9')]=function(_0xa38ba1,_0x3a9320){return _0xa38ba1[_0xb88b('0xa')](_0xb88b('0xb'),attributes,{'tableName':_0xb88b('0xc'),'paranoid':![],'indexes':[{'fields':[_0xb88b('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc95f=['VoiceDialReport','report_dial','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xc95f,0x176));var _0xfc95=function(_0x27b7be,_0x538e2d){_0x27b7be=_0x27b7be-0x0;var _0x1aa77e=_0xc95f[_0x27b7be];return _0x1aa77e;};'use strict';var _=require(_0xfc95('0x0'));var util=require(_0xfc95('0x1'));var logger=require(_0xfc95('0x2'))(_0xfc95('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc95('0x4'));var fs=require('fs');var path=require(_0xfc95('0x5'));var rimraf=require('rimraf');var config=require(_0xfc95('0x6'));var attributes=require(_0xfc95('0x7'));module[_0xfc95('0x8')]=function(_0x54d4b3,_0x377133){return _0x54d4b3[_0xfc95('0x9')](_0xfc95('0xa'),attributes,{'tableName':_0xfc95('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 8b0f18f..f031a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81d5=['../../config/environment','jayson/promise','client','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','body','options','raw','then','catch','update','where','attributes','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x81d5,0x1ab));var _0x581d=function(_0xae993e,_0x3dbea5){_0xae993e=_0xae993e-0x0;var _0x5a9d63=_0x81d5[_0xae993e];return _0x5a9d63;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});}exports[_0x581d('0x14')]=function(_0x1e059d){var _0x42f7db=this;return new Promise(function(_0x1f790f,_0x2cff0d){return db[_0x581d('0x15')]['create'](_0x1e059d[_0x581d('0x16')],{'raw':_0x1e059d[_0x581d('0x17')]?_0x1e059d[_0x581d('0x17')][_0x581d('0x18')]===undefined?!![]:![]:!![]})[_0x581d('0x19')](function(_0x2a2aba){logger[_0x581d('0xa')](_0x581d('0x14'),_0x1e059d);logger[_0x581d('0xd')](_0x581d('0x14'),_0x1e059d,JSON[_0x581d('0xf')](_0x2a2aba));_0x1f790f(_0x2a2aba);})[_0x581d('0x1a')](function(_0x5add13){logger[_0x581d('0x10')](_0x581d('0x14'),_0x5add13[_0x581d('0x12')],_0x1e059d);_0x2cff0d(_0x42f7db[_0x581d('0x10')](0x1f4,_0x5add13[_0x581d('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0x36cc8a){var _0x4fd113=this;return new Promise(function(_0x5a6d49,_0x2822ba){return db[_0x581d('0x15')][_0x581d('0x1b')](_0x36cc8a['body'],{'raw':_0x36cc8a[_0x581d('0x17')]?_0x36cc8a[_0x581d('0x17')][_0x581d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36cc8a[_0x581d('0x17')]?_0x36cc8a[_0x581d('0x17')][_0x581d('0x1c')]||null:null,'attributes':_0x36cc8a['options']?_0x36cc8a[_0x581d('0x17')][_0x581d('0x1d')]||null:null,'limit':_0x36cc8a[_0x581d('0x17')]?_0x36cc8a['options']['limit']||null:null})['then'](function(_0x489682){logger[_0x581d('0xa')](_0x581d('0x1e'),_0x36cc8a);logger[_0x581d('0xd')](_0x581d('0x1e'),_0x36cc8a,JSON[_0x581d('0xf')](_0x489682));_0x5a6d49(_0x489682);})[_0x581d('0x1a')](function(_0x16026f){logger[_0x581d('0x10')](_0x581d('0x1e'),_0x16026f[_0x581d('0x12')],_0x36cc8a);_0x2822ba(_0x4fd113[_0x581d('0x10')](0x1f4,_0x16026f['message']));});});};
\ No newline at end of file
+var _0x867f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','body','options','CreateVoiceDialReport','stringify','VoiceDialReport','update','raw','where','attributes','limit','UpdateVoiceDialReport','lodash'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x867f,0xe6));var _0xf867=function(_0x2d86f2,_0x5e1b5c){_0x2d86f2=_0x2d86f2-0x0;var _0x4d2124=_0x867f[_0x2d86f2];return _0x4d2124;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf867('0x9'));var client=jayson[_0xf867('0xa')][_0xf867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2841d1,_0x3fe5d1,_0x5c35f9){return new BPromise(function(_0x583f87,_0x26cfba){return client['request'](_0x2841d1,_0x5c35f9)[_0xf867('0xc')](function(_0x2b1c12){logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));logger[_0xf867('0x10')](_0xf867('0x11'),_0x3fe5d1,_0xf867('0xf'),JSON['stringify'](_0x2b1c12));if(_0x2b1c12[_0xf867('0x12')]){if(_0x2b1c12['error']['code']===0x1f4){logger[_0xf867('0x12')](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12[_0xf867('0x12')]['message']);return _0x26cfba(_0x2b1c12['error'][_0xf867('0x13')]);}logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12['error']['message']);return _0x583f87(_0x2b1c12[_0xf867('0x12')][_0xf867('0x13')]);}else{logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));_0x583f87(_0x2b1c12[_0xf867('0x14')][_0xf867('0x13')]);}})[_0xf867('0x15')](function(_0x33c10b){logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x33c10b);_0x26cfba(_0x33c10b);});});}exports['CreateVoiceDialReport']=function(_0x39f9e8){var _0x47dfa7=this;return new Promise(function(_0x51bdb3,_0x1a5592){return db['VoiceDialReport']['create'](_0x39f9e8[_0xf867('0x16')],{'raw':_0x39f9e8[_0xf867('0x17')]?_0x39f9e8['options']['raw']===undefined?!![]:![]:!![]})[_0xf867('0xc')](function(_0x23e7dd){logger[_0xf867('0xd')](_0xf867('0x18'),_0x39f9e8);logger[_0xf867('0x10')](_0xf867('0x18'),_0x39f9e8,JSON[_0xf867('0x19')](_0x23e7dd));_0x51bdb3(_0x23e7dd);})[_0xf867('0x15')](function(_0x586a25){logger['error'](_0xf867('0x18'),_0x586a25['message'],_0x39f9e8);_0x1a5592(_0x47dfa7[_0xf867('0x12')](0x1f4,_0x586a25[_0xf867('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x419b6f){var _0x169f15=this;return new Promise(function(_0x53dc5a,_0x231076){return db[_0xf867('0x1a')][_0xf867('0x1b')](_0x419b6f[_0xf867('0x16')],{'raw':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1d')]||null:null,'attributes':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1e')]||null:null,'limit':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1f')]||null:null})['then'](function(_0xb6d069){logger[_0xf867('0xd')](_0xf867('0x20'),_0x419b6f);logger[_0xf867('0x10')](_0xf867('0x20'),_0x419b6f,JSON[_0xf867('0x19')](_0xb6d069));_0x53dc5a(_0xb6d069);})[_0xf867('0x15')](function(_0x517b9c){logger[_0xf867('0x12')](_0xf867('0x20'),_0x517b9c[_0xf867('0x13')],_0x419b6f);_0x231076(_0x169f15[_0xf867('0x12')](0x1f4,_0x517b9c[_0xf867('0x13')]));});});};
\ No newline at end of file
index 7b56c5e..3e2ad68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0da5=['index','get','show','post','create','/:id/applications','put','/:id','update','destroy','multer','express','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0da5,0xea));var _0x50da=function(_0x2b662d,_0x591560){_0x2b662d=_0x2b662d-0x0;var _0x3dc75f=_0x0da5[_0x2b662d];return _0x3dc75f;};'use strict';var multer=require(_0x50da('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50da('0x1'));var router=express['Router']();var auth=require(_0x50da('0x2'));var interaction=require(_0x50da('0x3'));var config=require('../../config/environment');var controller=require(_0x50da('0x4'));router['get']('/',auth[_0x50da('0x5')](),controller[_0x50da('0x6')]);router[_0x50da('0x7')]('/:id',auth[_0x50da('0x5')](),controller[_0x50da('0x8')]);router[_0x50da('0x9')]('/',auth[_0x50da('0x5')](),controller[_0x50da('0xa')]);router['post'](_0x50da('0xb'),auth['isAuthenticated'](),controller['addApplications']);router[_0x50da('0xc')](_0x50da('0xd'),auth[_0x50da('0x5')](),controller[_0x50da('0xe')]);router['delete'](_0x50da('0xd'),auth[_0x50da('0x5')](),controller[_0x50da('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x4f3d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','show','create','/:id/applications','isAuthenticated','addApplications','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3cc751,_0x38b8ff){var _0x3956a2=function(_0x237cbc){while(--_0x237cbc){_0x3cc751['push'](_0x3cc751['shift']());}};_0x3956a2(++_0x38b8ff);}(_0x4f3d,0x18a));var _0xd4f3=function(_0xc24780,_0x53c1a7){_0xc24780=_0xc24780-0x0;var _0x1c160d=_0x4f3d[_0xc24780];return _0x1c160d;};'use strict';var multer=require(_0xd4f3('0x0'));var util=require(_0xd4f3('0x1'));var path=require(_0xd4f3('0x2'));var timeout=require(_0xd4f3('0x3'));var express=require(_0xd4f3('0x4'));var router=express[_0xd4f3('0x5')]();var auth=require(_0xd4f3('0x6'));var interaction=require(_0xd4f3('0x7'));var config=require(_0xd4f3('0x8'));var controller=require('./voiceExtension.controller');router[_0xd4f3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd4f3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd4f3('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd4f3('0xb')]);router['post'](_0xd4f3('0xc'),auth[_0xd4f3('0xd')](),controller[_0xd4f3('0xe')]);router[_0xd4f3('0xf')](_0xd4f3('0x10'),auth[_0xd4f3('0xd')](),controller[_0xd4f3('0x11')]);router[_0xd4f3('0x12')]('/:id',auth[_0xd4f3('0xd')](),controller[_0xd4f3('0x13')]);module[_0xd4f3('0x14')]=router;
\ No newline at end of file
index 29fb2b9..f18e5ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x1836aa,_0x527f4a){var _0x200819=function(_0x1ab3c1){while(--_0x1ab3c1){_0x1836aa['push'](_0x1836aa['shift']());}};_0x200819(++_0x527f4a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}};
\ No newline at end of file
+var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x405e13,_0x3f4f0e){var _0x23bf3b=function(_0x95148f){while(--_0x95148f){_0x405e13['push'](_0x405e13['shift']());}};_0x23bf3b(++_0x3f4f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}};
\ No newline at end of file
index 801ad04..8155582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','find','type','name','UserProfileResource','error','stack','send','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','sort','pick','merge','where','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','options','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','count','offset','json','apply','reject','save','update'];(function(_0xba5815,_0x46050f){var _0x20b8bc=function(_0x57d481){while(--_0x57d481){_0xba5815['push'](_0xba5815['shift']());}};_0x20b8bc(++_0x46050f);}(_0x57ca,0x108));var _0xa57c=function(_0x2dc9f8,_0x445fe3){_0x2dc9f8=_0x2dc9f8-0x0;var _0x3598a0=_0x57ca[_0x2dc9f8];return _0x3598a0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa57c('0x0'));var rimraf=require(_0xa57c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57c('0x2'));var rp=require(_0xa57c('0x3'));var moment=require(_0xa57c('0x4'));var BPromise=require(_0xa57c('0x5'));var Mustache=require(_0xa57c('0x6'));var util=require('util');var path=require(_0xa57c('0x7'));var sox=require(_0xa57c('0x8'));var csv=require(_0xa57c('0x9'));var ejs=require(_0xa57c('0xa'));var fs=require('fs');var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x9'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var db=require(_0xa57c('0x15'))['db'];config[_0xa57c('0x16')]=_[_0xa57c('0x17')](config[_0xa57c('0x16')],{'host':_0xa57c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa57c('0x16')]));require('./voiceExtension.socket')[_0xa57c('0x19')](socket);function respondWithStatusCode(_0x3d5995,_0x30940d){_0x30940d=_0x30940d||0xcc;return function(_0x3821d2){if(_0x3821d2){return _0x3d5995[_0xa57c('0x1a')](_0x30940d);}return _0x3d5995[_0xa57c('0x1b')](_0x30940d)[_0xa57c('0x1c')]();};}function respondWithResult(_0x4b4bdb,_0x26607a){_0x26607a=_0x26607a||0xc8;return function(_0xdf7ff6){if(_0xdf7ff6){return _0x4b4bdb[_0xa57c('0x1b')](_0x26607a)['json'](_0xdf7ff6);}};}function respondWithFilteredResult(_0x2746a0,_0x5f33f1){return function(_0x3e7afa){if(_0x3e7afa){var _0x3d781d=_0x3e7afa[_0xa57c('0x1d')],_0x93462c=_0x5f33f1[_0xa57c('0x1e')],_0xe3d505=_0x5f33f1[_0xa57c('0x1e')]+_0x5f33f1['limit'],_0x1fd0d8;if(_0xe3d505>=_0x3d781d){_0xe3d505=_0x3d781d;_0x1fd0d8=0xc8;}else{_0x1fd0d8=0xce;}_0x2746a0[_0xa57c('0x1b')](_0x1fd0d8);return _0x2746a0['set']('Content-Range',_0x93462c+'-'+_0xe3d505+'/'+_0x3d781d)[_0xa57c('0x1f')](_0x3e7afa);}return null;};}function patchUpdates(_0xa5b314){return function(_0x3eee75){try{jsonpatch[_0xa57c('0x20')](_0x3eee75,_0xa5b314,!![]);}catch(_0x49242c){return BPromise[_0xa57c('0x21')](_0x49242c);}return _0x3eee75[_0xa57c('0x22')]();};}function saveUpdates(_0x34d1bc,_0x2213b2){return function(_0x3bb969){if(_0x3bb969){return _0x3bb969[_0xa57c('0x23')](_0x34d1bc)[_0xa57c('0x24')](function(_0x42038e){return _0x42038e;});}return null;};}function removeEntity(_0x2e99ed,_0xdf65dd){return function(_0x382a26){if(_0x382a26){return _0x382a26[_0xa57c('0x25')]()[_0xa57c('0x24')](function(){var _0x10a33d=_0x382a26[_0xa57c('0x26')]({'plain':!![]});var _0x511a26=[{'name':_0xa57c('0x27'),'value':_0xa57c('0x28'),'ignore':![]},{'name':_0xa57c('0x29'),'value':_0xa57c('0x2a'),'ignore':![]},{'name':_0xa57c('0x2b'),'value':_0xa57c('0x2c'),'ignore':![]}];var _0x8ee1c0=_(_0x511a26)[_0xa57c('0x2d')](_0xa57c('0x2e'))[_0xa57c('0x2f')]('value')[_0xa57c('0x30')]();if(_['includes'](_0x8ee1c0,_0x10a33d['type'])){return;}var _0x257661=_[_0xa57c('0x31')](_0x511a26,['value',_0x10a33d[_0xa57c('0x32')]])[_0xa57c('0x33')];return db[_0xa57c('0x34')]['destroy']({'where':{'type':_0x257661,'resourceId':_0x10a33d['id']}})[_0xa57c('0x24')](function(){return _0x382a26;});})['then'](function(){_0x2e99ed[_0xa57c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3bbe,_0x51ad09){return function(_0xd4c5d4){if(!_0xd4c5d4){_0x2a3bbe['sendStatus'](0x194);}return _0xd4c5d4;};}function handleError(_0x9e02bb,_0x1d82d9){_0x1d82d9=_0x1d82d9||0x1f4;return function(_0x43c8f3){logger[_0xa57c('0x35')](_0x43c8f3[_0xa57c('0x36')]);if(_0x43c8f3[_0xa57c('0x33')]){delete _0x43c8f3[_0xa57c('0x33')];}_0x9e02bb['status'](_0x1d82d9)[_0xa57c('0x37')](_0x43c8f3);};}exports['index']=function(_0xbece0a,_0x315787){var _0x27ada0={},_0x587ce1={},_0x289174={'count':0x0,'rows':[]};var _0x4901a8=_[_0xa57c('0x2f')](db['VoiceExtension'][_0xa57c('0x38')],function(_0x494b8a){return{'name':_0x494b8a[_0xa57c('0x39')],'type':_0x494b8a[_0xa57c('0x32')]['key']};});_0x587ce1[_0xa57c('0x3a')]=_['map'](_0x4901a8,_0xa57c('0x33'));_0x587ce1['query']=_[_0xa57c('0x3b')](_0xbece0a[_0xa57c('0x3c')]);_0x587ce1[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x587ce1[_0xa57c('0x3a')],_0x587ce1[_0xa57c('0x3c')]);_0x27ada0['attributes']=_['intersection'](_0x587ce1[_0xa57c('0x3a')],qs[_0xa57c('0x3f')](_0xbece0a[_0xa57c('0x3c')]['fields']));_0x27ada0[_0xa57c('0x40')]=_0x27ada0['attributes'][_0xa57c('0x41')]?_0x27ada0[_0xa57c('0x40')]:_0x587ce1['model'];if(!_0xbece0a['query']['hasOwnProperty'](_0xa57c('0x42'))){_0x27ada0[_0xa57c('0x43')]=qs[_0xa57c('0x43')](_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x43')]);_0x27ada0[_0xa57c('0x1e')]=qs['offset'](_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x1e')]);}_0x27ada0['order']=qs['sort'](_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x44')]);_0x27ada0['where']=qs[_0xa57c('0x3d')](_[_0xa57c('0x45')](_0xbece0a[_0xa57c('0x3c')],_0x587ce1[_0xa57c('0x3d')]),_0x4901a8);if(_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x2d')]){_0x27ada0['where']=_[_0xa57c('0x46')](_0x27ada0['where'],{'$or':_['map'](_0x4901a8,function(_0x5b3300){if(_0x5b3300['type']!=='VIRTUAL'){var _0x39b20f={};_0x39b20f[_0x5b3300[_0xa57c('0x33')]]={'$like':'%'+_0xbece0a[_0xa57c('0x3c')]['filter']+'%'};return _0x39b20f;}})});}_0x27ada0=_['merge']({},_0x27ada0,_0xbece0a['options']);var _0x44f1e8={'where':_0x27ada0[_0xa57c('0x47')]};return db[_0xa57c('0x48')][_0xa57c('0x1d')](_0x44f1e8)[_0xa57c('0x24')](function(_0x17c5dd){_0x289174['count']=_0x17c5dd;if(_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x49')]){_0x27ada0[_0xa57c('0x4a')]=[{'all':!![]}];}return db[_0xa57c('0x48')][_0xa57c('0x4b')](_0x27ada0);})[_0xa57c('0x24')](function(_0x4f2997){_0x289174[_0xa57c('0x4c')]=_0x4f2997;return _0x289174;})[_0xa57c('0x24')](respondWithFilteredResult(_0x315787,_0x27ada0))[_0xa57c('0x4d')](handleError(_0x315787,null));};exports[_0xa57c('0x4e')]=function(_0x269dfd,_0x4eb51e){var _0x209c67={'raw':![],'where':{'id':_0x269dfd[_0xa57c('0x4f')]['id']}},_0x13ede7={};_0x13ede7[_0xa57c('0x3a')]=_[_0xa57c('0x3b')](db[_0xa57c('0x48')]['rawAttributes']);_0x13ede7[_0xa57c('0x3c')]=_[_0xa57c('0x3b')](_0x269dfd[_0xa57c('0x3c')]);_0x13ede7[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x13ede7[_0xa57c('0x3a')],_0x13ede7['query']);_0x209c67['attributes']=_['intersection'](_0x13ede7['model'],qs[_0xa57c('0x3f')](_0x269dfd['query'][_0xa57c('0x3f')]));_0x209c67[_0xa57c('0x40')]=_0x209c67['attributes'][_0xa57c('0x41')]?_0x209c67[_0xa57c('0x40')]:_0x13ede7[_0xa57c('0x3a')];if(_0x269dfd[_0xa57c('0x3c')][_0xa57c('0x49')]){_0x209c67['include']=[{'all':!![]}];}_0x209c67=_[_0xa57c('0x46')]({},_0x209c67,_0x269dfd[_0xa57c('0x50')]);return db[_0xa57c('0x48')][_0xa57c('0x31')](_0x209c67)[_0xa57c('0x24')](handleEntityNotFound(_0x4eb51e,null))['then'](respondWithResult(_0x4eb51e,null))[_0xa57c('0x4d')](handleError(_0x4eb51e,null));};exports['destroy']=function(_0x5be160,_0x464233){return db[_0xa57c('0x48')][_0xa57c('0x31')]({'where':{'id':_0x5be160['params']['id']}})['then'](handleEntityNotFound(_0x464233,null))[_0xa57c('0x24')](removeEntity(_0x464233,null))[_0xa57c('0x4d')](handleError(_0x464233,null));};exports[_0xa57c('0x51')]=function(_0x33d451,_0x4d2899){if(_0x33d451[_0xa57c('0x52')][_0xa57c('0x32')]===_0xa57c('0x2a')&&!_['startsWith'](_0x33d451['body'][_0xa57c('0x53')],'_')){_0x33d451[_0xa57c('0x52')]['exten']='_'[_0xa57c('0x54')](_0x33d451[_0xa57c('0x52')][_0xa57c('0x53')]);}return db[_0xa57c('0x48')][_0xa57c('0x51')](_0x33d451[_0xa57c('0x52')],{'raw':![]})[_0xa57c('0x24')](function(_0x4ee02a){var _0x523a79=_0x33d451[_0xa57c('0x55')][_0xa57c('0x26')]({'plain':!![]});if(!_0x523a79)throw new Error(_0xa57c('0x56'));if(_0x523a79[_0xa57c('0x57')]===_0xa57c('0x55')){var _0x3804a3=_0x4ee02a[_0xa57c('0x26')]({'plain':!![]});var _0x4519a0=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xa57c('0x29'),'value':'outbound'},{'name':_0xa57c('0x2b'),'value':_0xa57c('0x2c')}];var _0x6c56db=_['find'](_0x4519a0,[_0xa57c('0x30'),_0x3804a3['type']])[_0xa57c('0x33')];return db['UserProfileSection'][_0xa57c('0x31')]({'where':{'name':_0x6c56db,'userProfileId':_0x523a79[_0xa57c('0x58')]},'raw':!![]})[_0xa57c('0x24')](function(_0x26a8e1){if(_0x26a8e1&&_0x26a8e1['autoAssociation']===0x0){return db[_0xa57c('0x34')][_0xa57c('0x51')]({'name':_0x3804a3[_0xa57c('0x33')],'resourceId':_0x3804a3['id'],'type':_0x26a8e1[_0xa57c('0x33')],'sectionId':_0x26a8e1['id']},{})[_0xa57c('0x24')](function(){return _0x4ee02a;});}else{return _0x4ee02a;}})['catch'](function(_0x13afd0){logger[_0xa57c('0x35')](_0xa57c('0x59'),_0x13afd0);throw _0x13afd0;});}return _0x4ee02a;})[_0xa57c('0x24')](respondWithResult(_0x4d2899,0xc9))[_0xa57c('0x4d')](handleError(_0x4d2899,null));};exports[_0xa57c('0x23')]=function(_0x143ec3,_0x419527){if(_0x143ec3[_0xa57c('0x52')]['id']){delete _0x143ec3[_0xa57c('0x52')]['id'];}return db['VoiceExtension'][_0xa57c('0x31')]({'where':{'id':_0x143ec3[_0xa57c('0x4f')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x419527,null))[_0xa57c('0x24')](function(_0x2d4fe3){if(_0x2d4fe3){return db[_0xa57c('0x48')]['update'](_[_0xa57c('0x45')](_0x143ec3[_0xa57c('0x52')],['exten',_0xa57c('0x5a'),_0xa57c('0x5b'),_0xa57c('0x5c'),_0xa57c('0x5d'),_0xa57c('0x5e')]),{'where':{'context':_0x2d4fe3[_0xa57c('0x5a')],'exten':_0x2d4fe3[_0xa57c('0x53')]},'individualHooks':!![]})['then'](function(_0xaa82e1){return _0xaa82e1;});}return null;})['then'](respondWithStatusCode(_0x419527,null))[_0xa57c('0x4d')](handleError(_0x419527,null));};exports['addApplications']=function(_0x1a8686,_0x5a0e62,_0x3ef1f1){return db[_0xa57c('0x48')]['findOne']({'where':{'id':_0x1a8686[_0xa57c('0x4f')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x5a0e62,null))[_0xa57c('0x24')](function(_0x144a5d){if(_0x144a5d){return db['sequelize'][_0xa57c('0x5f')](function(_0x13524b){return db[_0xa57c('0x48')][_0xa57c('0x25')]({'where':{'VoiceExtensionId':_0x1a8686[_0xa57c('0x4f')]['id']},'transaction':_0x13524b})[_0xa57c('0x24')](function(_0x308ce5){var _0x2a5983=_[_0xa57c('0x2f')](_0x1a8686[_0xa57c('0x52')],function(_0x1c8b97){_0x1c8b97[_0xa57c('0x60')]=_0x1a8686[_0xa57c('0x4f')]['id'];return _0x1c8b97;});return db[_0xa57c('0x48')][_0xa57c('0x61')](_0x2a5983,{'transaction':_0x13524b});});})[_0xa57c('0x24')](function(){return db['VoiceExtension'][_0xa57c('0x62')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1a8686['params']['id']},'order':_0xa57c('0x63')});});}})[_0xa57c('0x24')](respondWithResult(_0x5a0e62,null))[_0xa57c('0x4d')](handleError(_0x5a0e62,null));};
\ No newline at end of file
+var _0xc6ac=['mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','options','VoiceExtension','includeAll','include','rows','catch','show','params','find','create','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context'];(function(_0x1ae417,_0x2838fb){var _0x4821dd=function(_0x2bc6a2){while(--_0x2bc6a2){_0x1ae417['push'](_0x1ae417['shift']());}};_0x4821dd(++_0x2838fb);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x30e7a2,_0x3d2864){_0x30e7a2=_0x30e7a2-0x0;var _0x5e7ffc=_0xc6ac[_0x30e7a2];return _0x5e7ffc;};'use strict';var pdf=require(_0xcc6a('0x0'));var emlformat=require(_0xcc6a('0x1'));var rimraf=require(_0xcc6a('0x2'));var zipdir=require(_0xcc6a('0x3'));var jsonpatch=require(_0xcc6a('0x4'));var rp=require(_0xcc6a('0x5'));var moment=require(_0xcc6a('0x6'));var BPromise=require(_0xcc6a('0x7'));var Mustache=require(_0xcc6a('0x8'));var util=require(_0xcc6a('0x9'));var path=require(_0xcc6a('0xa'));var sox=require(_0xcc6a('0xb'));var csv=require(_0xcc6a('0xc'));var ejs=require(_0xcc6a('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xc'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var db=require(_0xcc6a('0x1a'))['db'];config['redis']=_['defaults'](config[_0xcc6a('0x1b')],{'host':_0xcc6a('0x1c'),'port':0x18eb});var socket=require(_0xcc6a('0x1d'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0xcc6a('0x1e')](socket);function respondWithStatusCode(_0xcb9e2e,_0x43710d){_0x43710d=_0x43710d||0xcc;return function(_0x348af7){if(_0x348af7){return _0xcb9e2e[_0xcc6a('0x1f')](_0x43710d);}return _0xcb9e2e[_0xcc6a('0x20')](_0x43710d)[_0xcc6a('0x21')]();};}function respondWithResult(_0x403b18,_0x56ffb0){_0x56ffb0=_0x56ffb0||0xc8;return function(_0x4e628f){if(_0x4e628f){return _0x403b18['status'](_0x56ffb0)[_0xcc6a('0x22')](_0x4e628f);}};}function respondWithFilteredResult(_0x44910f,_0x307f2a){return function(_0x3e63d9){if(_0x3e63d9){var _0x33079c=_0x3e63d9[_0xcc6a('0x23')],_0x12ef33=_0x307f2a[_0xcc6a('0x24')],_0x2d9585=_0x307f2a[_0xcc6a('0x24')]+_0x307f2a['limit'],_0x412bc7;if(_0x2d9585>=_0x33079c){_0x2d9585=_0x33079c;_0x412bc7=0xc8;}else{_0x412bc7=0xce;}_0x44910f[_0xcc6a('0x20')](_0x412bc7);return _0x44910f[_0xcc6a('0x25')](_0xcc6a('0x26'),_0x12ef33+'-'+_0x2d9585+'/'+_0x33079c)[_0xcc6a('0x22')](_0x3e63d9);}return null;};}function patchUpdates(_0x1495d8){return function(_0x30b8ed){try{jsonpatch[_0xcc6a('0x27')](_0x30b8ed,_0x1495d8,!![]);}catch(_0x43f510){return BPromise[_0xcc6a('0x28')](_0x43f510);}return _0x30b8ed[_0xcc6a('0x29')]();};}function saveUpdates(_0x329d17,_0x845088){return function(_0x51be9a){if(_0x51be9a){return _0x51be9a[_0xcc6a('0x2a')](_0x329d17)[_0xcc6a('0x2b')](function(_0x38f812){return _0x38f812;});}return null;};}function removeEntity(_0x581aae,_0x10016a){return function(_0x294486){if(_0x294486){return _0x294486[_0xcc6a('0x2c')]()[_0xcc6a('0x2b')](function(){var _0x432c23=_0x294486[_0xcc6a('0x2d')]({'plain':!![]});var _0x50abc1=[{'name':_0xcc6a('0x2e'),'value':_0xcc6a('0x2f'),'ignore':![]},{'name':_0xcc6a('0x30'),'value':'outbound','ignore':![]},{'name':_0xcc6a('0x31'),'value':_0xcc6a('0x32'),'ignore':![]}];var _0x4da301=_(_0x50abc1)[_0xcc6a('0x33')](_0xcc6a('0x34'))[_0xcc6a('0x35')](_0xcc6a('0x36'))['value']();if(_[_0xcc6a('0x37')](_0x4da301,_0x432c23[_0xcc6a('0x38')])){return;}var _0x2c6d88=_['find'](_0x50abc1,[_0xcc6a('0x36'),_0x432c23['type']])['name'];return db[_0xcc6a('0x39')][_0xcc6a('0x2c')]({'where':{'type':_0x2c6d88,'resourceId':_0x432c23['id']}})[_0xcc6a('0x2b')](function(){return _0x294486;});})[_0xcc6a('0x2b')](function(){_0x581aae[_0xcc6a('0x20')](0xcc)[_0xcc6a('0x21')]();});}};}function handleEntityNotFound(_0x4e2de4,_0x7b2b54){return function(_0x28e3c3){if(!_0x28e3c3){_0x4e2de4[_0xcc6a('0x1f')](0x194);}return _0x28e3c3;};}function handleError(_0x2faeb5,_0x211a8c){_0x211a8c=_0x211a8c||0x1f4;return function(_0x152ebd){logger[_0xcc6a('0x3a')](_0x152ebd[_0xcc6a('0x3b')]);if(_0x152ebd['name']){delete _0x152ebd[_0xcc6a('0x3c')];}_0x2faeb5[_0xcc6a('0x20')](_0x211a8c)[_0xcc6a('0x3d')](_0x152ebd);};}exports[_0xcc6a('0x3e')]=function(_0x30d6e1,_0x711a58){var _0x28b16e={},_0x5afbbc={},_0x5d2287={'count':0x0,'rows':[]};var _0x5a41b4=_['map'](db['VoiceExtension'][_0xcc6a('0x3f')],function(_0x2a3e93){return{'name':_0x2a3e93[_0xcc6a('0x40')],'type':_0x2a3e93[_0xcc6a('0x38')][_0xcc6a('0x41')]};});_0x5afbbc['model']=_['map'](_0x5a41b4,_0xcc6a('0x3c'));_0x5afbbc[_0xcc6a('0x42')]=_[_0xcc6a('0x43')](_0x30d6e1['query']);_0x5afbbc[_0xcc6a('0x44')]=_[_0xcc6a('0x45')](_0x5afbbc[_0xcc6a('0x46')],_0x5afbbc[_0xcc6a('0x42')]);_0x28b16e[_0xcc6a('0x47')]=_[_0xcc6a('0x45')](_0x5afbbc[_0xcc6a('0x46')],qs[_0xcc6a('0x48')](_0x30d6e1[_0xcc6a('0x42')][_0xcc6a('0x48')]));_0x28b16e[_0xcc6a('0x47')]=_0x28b16e[_0xcc6a('0x47')][_0xcc6a('0x49')]?_0x28b16e[_0xcc6a('0x47')]:_0x5afbbc[_0xcc6a('0x46')];if(!_0x30d6e1[_0xcc6a('0x42')][_0xcc6a('0x4a')](_0xcc6a('0x4b'))){_0x28b16e['limit']=qs['limit'](_0x30d6e1[_0xcc6a('0x42')][_0xcc6a('0x4c')]);_0x28b16e[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x30d6e1[_0xcc6a('0x42')][_0xcc6a('0x24')]);}_0x28b16e[_0xcc6a('0x4d')]=qs[_0xcc6a('0x4e')](_0x30d6e1['query']['sort']);_0x28b16e[_0xcc6a('0x4f')]=qs['filters'](_['pick'](_0x30d6e1['query'],_0x5afbbc[_0xcc6a('0x44')]),_0x5a41b4);if(_0x30d6e1[_0xcc6a('0x42')][_0xcc6a('0x33')]){_0x28b16e[_0xcc6a('0x4f')]=_[_0xcc6a('0x50')](_0x28b16e['where'],{'$or':_[_0xcc6a('0x35')](_0x5a41b4,function(_0xfbb079){if(_0xfbb079[_0xcc6a('0x38')]!==_0xcc6a('0x51')){var _0x14ca90={};_0x14ca90[_0xfbb079[_0xcc6a('0x3c')]]={'$like':'%'+_0x30d6e1['query'][_0xcc6a('0x33')]+'%'};return _0x14ca90;}})});}_0x28b16e=_[_0xcc6a('0x50')]({},_0x28b16e,_0x30d6e1[_0xcc6a('0x52')]);var _0x11c137={'where':_0x28b16e['where']};return db[_0xcc6a('0x53')]['count'](_0x11c137)[_0xcc6a('0x2b')](function(_0x3f280a){_0x5d2287[_0xcc6a('0x23')]=_0x3f280a;if(_0x30d6e1['query'][_0xcc6a('0x54')]){_0x28b16e[_0xcc6a('0x55')]=[{'all':!![]}];}return db[_0xcc6a('0x53')]['findAll'](_0x28b16e);})['then'](function(_0x3467b1){_0x5d2287[_0xcc6a('0x56')]=_0x3467b1;return _0x5d2287;})[_0xcc6a('0x2b')](respondWithFilteredResult(_0x711a58,_0x28b16e))[_0xcc6a('0x57')](handleError(_0x711a58,null));};exports[_0xcc6a('0x58')]=function(_0x5e59af,_0x16b83b){var _0xff1166={'raw':![],'where':{'id':_0x5e59af[_0xcc6a('0x59')]['id']}},_0x50ef8c={};_0x50ef8c[_0xcc6a('0x46')]=_[_0xcc6a('0x43')](db[_0xcc6a('0x53')][_0xcc6a('0x3f')]);_0x50ef8c[_0xcc6a('0x42')]=_['keys'](_0x5e59af['query']);_0x50ef8c['filters']=_[_0xcc6a('0x45')](_0x50ef8c[_0xcc6a('0x46')],_0x50ef8c[_0xcc6a('0x42')]);_0xff1166[_0xcc6a('0x47')]=_['intersection'](_0x50ef8c[_0xcc6a('0x46')],qs['fields'](_0x5e59af[_0xcc6a('0x42')][_0xcc6a('0x48')]));_0xff1166[_0xcc6a('0x47')]=_0xff1166[_0xcc6a('0x47')][_0xcc6a('0x49')]?_0xff1166[_0xcc6a('0x47')]:_0x50ef8c['model'];if(_0x5e59af[_0xcc6a('0x42')][_0xcc6a('0x54')]){_0xff1166[_0xcc6a('0x55')]=[{'all':!![]}];}_0xff1166=_[_0xcc6a('0x50')]({},_0xff1166,_0x5e59af[_0xcc6a('0x52')]);return db[_0xcc6a('0x53')][_0xcc6a('0x5a')](_0xff1166)[_0xcc6a('0x2b')](handleEntityNotFound(_0x16b83b,null))[_0xcc6a('0x2b')](respondWithResult(_0x16b83b,null))[_0xcc6a('0x57')](handleError(_0x16b83b,null));};exports['destroy']=function(_0x1c8470,_0x3197b5){return db[_0xcc6a('0x53')][_0xcc6a('0x5a')]({'where':{'id':_0x1c8470[_0xcc6a('0x59')]['id']}})[_0xcc6a('0x2b')](handleEntityNotFound(_0x3197b5,null))['then'](removeEntity(_0x3197b5,null))['catch'](handleError(_0x3197b5,null));};exports[_0xcc6a('0x5b')]=function(_0x5eeca6,_0x1ac0f0){if(_0x5eeca6[_0xcc6a('0x5c')][_0xcc6a('0x38')]===_0xcc6a('0x5d')&&!_[_0xcc6a('0x5e')](_0x5eeca6[_0xcc6a('0x5c')][_0xcc6a('0x5f')],'_')){_0x5eeca6[_0xcc6a('0x5c')][_0xcc6a('0x5f')]='_'[_0xcc6a('0x60')](_0x5eeca6[_0xcc6a('0x5c')]['exten']);}return db[_0xcc6a('0x53')]['create'](_0x5eeca6[_0xcc6a('0x5c')],{'raw':![]})[_0xcc6a('0x2b')](function(_0x22acfb){var _0x571a0a=_0x5eeca6[_0xcc6a('0x61')]['get']({'plain':!![]});if(!_0x571a0a)throw new Error(_0xcc6a('0x62'));if(_0x571a0a['role']===_0xcc6a('0x61')){var _0x271d07=_0x22acfb[_0xcc6a('0x2d')]({'plain':!![]});var _0xe212e8=[{'name':_0xcc6a('0x2e'),'value':_0xcc6a('0x2f')},{'name':_0xcc6a('0x30'),'value':_0xcc6a('0x5d')},{'name':'InternalRoutes','value':_0xcc6a('0x32')}];var _0x56d512=_[_0xcc6a('0x5a')](_0xe212e8,['value',_0x271d07[_0xcc6a('0x38')]])[_0xcc6a('0x3c')];return db[_0xcc6a('0x63')]['find']({'where':{'name':_0x56d512,'userProfileId':_0x571a0a[_0xcc6a('0x64')]},'raw':!![]})['then'](function(_0x5e53e4){if(_0x5e53e4&&_0x5e53e4[_0xcc6a('0x65')]===0x0){return db[_0xcc6a('0x39')][_0xcc6a('0x5b')]({'name':_0x271d07[_0xcc6a('0x3c')],'resourceId':_0x271d07['id'],'type':_0x5e53e4[_0xcc6a('0x3c')],'sectionId':_0x5e53e4['id']},{})[_0xcc6a('0x2b')](function(){return _0x22acfb;});}else{return _0x22acfb;}})[_0xcc6a('0x57')](function(_0x5668d1){logger[_0xcc6a('0x3a')](_0xcc6a('0x66'),_0x5668d1);throw _0x5668d1;});}return _0x22acfb;})[_0xcc6a('0x2b')](respondWithResult(_0x1ac0f0,0xc9))[_0xcc6a('0x57')](handleError(_0x1ac0f0,null));};exports[_0xcc6a('0x2a')]=function(_0x483aa4,_0x2a3745){if(_0x483aa4[_0xcc6a('0x5c')]['id']){delete _0x483aa4[_0xcc6a('0x5c')]['id'];}return db[_0xcc6a('0x53')]['find']({'where':{'id':_0x483aa4[_0xcc6a('0x59')]['id']}})[_0xcc6a('0x2b')](handleEntityNotFound(_0x2a3745,null))[_0xcc6a('0x2b')](function(_0x2ffe07){if(_0x2ffe07){return db[_0xcc6a('0x53')][_0xcc6a('0x2a')](_[_0xcc6a('0x67')](_0x483aa4[_0xcc6a('0x5c')],[_0xcc6a('0x5f'),_0xcc6a('0x68'),'description','recordingFormat','cutdigits',_0xcc6a('0x69')]),{'where':{'context':_0x2ffe07[_0xcc6a('0x68')],'exten':_0x2ffe07[_0xcc6a('0x5f')]},'individualHooks':!![]})['then'](function(_0x2f7787){return _0x2f7787;});}return null;})[_0xcc6a('0x2b')](respondWithStatusCode(_0x2a3745,null))[_0xcc6a('0x57')](handleError(_0x2a3745,null));};exports[_0xcc6a('0x6a')]=function(_0x5e1c69,_0x481d25,_0xaec5e8){return db[_0xcc6a('0x53')][_0xcc6a('0x6b')]({'where':{'id':_0x5e1c69[_0xcc6a('0x59')]['id']}})['then'](handleEntityNotFound(_0x481d25,null))[_0xcc6a('0x2b')](function(_0x2e9a9f){if(_0x2e9a9f){return db[_0xcc6a('0x6c')][_0xcc6a('0x6d')](function(_0x3a0d36){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x5e1c69[_0xcc6a('0x59')]['id']},'transaction':_0x3a0d36})[_0xcc6a('0x2b')](function(_0x2d9f02){var _0x144495=_['map'](_0x5e1c69['body'],function(_0x43827c){_0x43827c[_0xcc6a('0x6e')]=_0x5e1c69[_0xcc6a('0x59')]['id'];return _0x43827c;});return db[_0xcc6a('0x53')]['bulkCreate'](_0x144495,{'transaction':_0x3a0d36});});})['then'](function(){return db['VoiceExtension'][_0xcc6a('0x6f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5e1c69[_0xcc6a('0x59')]['id']},'order':_0xcc6a('0x70')});});}})[_0xcc6a('0x2b')](respondWithResult(_0x481d25,null))['catch'](handleError(_0x481d25,null));};
\ No newline at end of file
index e0a60fc..16a5be6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bba=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x154443,_0x3b5284){var _0x4fd99e=function(_0x343f59){while(--_0x343f59){_0x154443['push'](_0x154443['shift']());}};_0x4fd99e(++_0x3b5284);}(_0x1bba,0xa7));var _0xa1bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bba[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa1bb('0x0'));var VoiceExtension=require(_0xa1bb('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa1bb('0x2')](0x0);var events={'afterCreate':_0xa1bb('0x3'),'afterUpdate':_0xa1bb('0x4'),'afterDestroy':_0xa1bb('0x5')};function emitEvent(_0x212704){return function(_0x3214a6,_0x13c923,_0x380b45){VoiceExtensionEvents[_0xa1bb('0x6')](_0x212704+':'+_0x3214a6['id'],_0x3214a6);VoiceExtensionEvents[_0xa1bb('0x6')](_0x212704,_0x3214a6);_0x380b45(null);};}for(var e in events){if(events[_0xa1bb('0x7')](e)){var event=events[e];VoiceExtension[_0xa1bb('0x8')](e,emitEvent(event));}}module[_0xa1bb('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xf484=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','remove','emit','hook'];(function(_0x418caf,_0x26611c){var _0x2f05ac=function(_0x1cee8f){while(--_0x1cee8f){_0x418caf['push'](_0x418caf['shift']());}};_0x2f05ac(++_0x26611c);}(_0xf484,0x1e9));var _0x4f48=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf484[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4f48('0x0'));var VoiceExtension=require(_0x4f48('0x1'))['db'][_0x4f48('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4f48('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4f48('0x4')};function emitEvent(_0x410a50){return function(_0x359cf0,_0x291cf5,_0x39fb75){VoiceExtensionEvents[_0x4f48('0x5')](_0x410a50+':'+_0x359cf0['id'],_0x359cf0);VoiceExtensionEvents[_0x4f48('0x5')](_0x410a50,_0x359cf0);_0x39fb75(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x4f48('0x6')](e,emitEvent(event));}}module[_0x4f48('0x7')]=VoiceExtensionEvents;
\ No newline at end of file
index 0e05941..19259cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26e7=['util','api','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceExtension','lodash'];(function(_0x295870,_0x1ab2ce){var _0x35a5af=function(_0x223e48){while(--_0x223e48){_0x295870['push'](_0x295870['shift']());}};_0x35a5af(++_0x1ab2ce);}(_0x26e7,0x11f));var _0x726e=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x26e7[_0x12e3e3];return _0x26602e;};'use strict';var _=require(_0x726e('0x0'));var util=require(_0x726e('0x1'));var logger=require('../../config/logger')(_0x726e('0x2'));var moment=require('moment');var BPromise=require(_0x726e('0x3'));var rp=require(_0x726e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x726e('0x5'));var config=require(_0x726e('0x6'));var attributes=require('./voiceExtension.attributes');module[_0x726e('0x7')]=function(_0x5bcc65,_0x410416){return _0x5bcc65['define'](_0x726e('0x8'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe7ce=['bluebird','request-promise','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0xe7ce,0x168));var _0xee7c=function(_0x596c16,_0x2dc7f2){_0x596c16=_0x596c16-0x0;var _0x40823b=_0xe7ce[_0x596c16];return _0x40823b;};'use strict';var _=require(_0xee7c('0x0'));var util=require(_0xee7c('0x1'));var logger=require(_0xee7c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xee7c('0x3'));var rp=require(_0xee7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xee7c('0x5'));var attributes=require(_0xee7c('0x6'));module[_0xee7c('0x7')]=function(_0x196f66,_0x190ab1){return _0x196f66[_0xee7c('0x8')](_0xee7c('0x9'),attributes,{'tableName':_0xee7c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd3c637..7f92eea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe66a=['raw','where','attributes','limit','map','include','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','findAll','options'];(function(_0x4b262d,_0x2a2240){var _0x2ca50f=function(_0x1ea967){while(--_0x1ea967){_0x4b262d['push'](_0x4b262d['shift']());}};_0x2ca50f(++_0x2a2240);}(_0xe66a,0xc0));var _0xae66=function(_0x33d88e,_0x18a299){_0x33d88e=_0x33d88e-0x0;var _0x4a83ca=_0xe66a[_0x33d88e];return _0x4a83ca;};'use strict';var _=require(_0xae66('0x0'));var util=require(_0xae66('0x1'));var moment=require('moment');var BPromise=require(_0xae66('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae66('0x3'));var db=require(_0xae66('0x4'))['db'];var utils=require(_0xae66('0x5'));var logger=require('../../config/logger')(_0xae66('0x6'));var config=require(_0xae66('0x7'));var jayson=require(_0xae66('0x8'));var client=jayson[_0xae66('0x9')][_0xae66('0xa')]({'port':0x232a});config[_0xae66('0xb')]=_[_0xae66('0xc')](config['redis'],{'host':_0xae66('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae66('0xb')]));require(_0xae66('0xe'))['register'](socket);function respondWithRpcPromise(_0x4c15e6,_0x11b320,_0x3c803b){return new BPromise(function(_0x35f049,_0xef892){return client['request'](_0x4c15e6,_0x3c803b)[_0xae66('0xf')](function(_0x25b4d1){logger[_0xae66('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x11b320,_0xae66('0x11'));logger[_0xae66('0x12')](_0xae66('0x13'),_0x11b320,_0xae66('0x11'),JSON[_0xae66('0x14')](_0x25b4d1));if(_0x25b4d1[_0xae66('0x15')]){if(_0x25b4d1[_0xae66('0x15')][_0xae66('0x16')]===0x1f4){logger['error'](_0xae66('0x17'),_0x11b320,_0x25b4d1[_0xae66('0x15')][_0xae66('0x18')]);return _0xef892(_0x25b4d1[_0xae66('0x15')][_0xae66('0x18')]);}logger[_0xae66('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x11b320,_0x25b4d1[_0xae66('0x15')][_0xae66('0x18')]);return _0x35f049(_0x25b4d1[_0xae66('0x15')][_0xae66('0x18')]);}else{logger[_0xae66('0x10')](_0xae66('0x17'),_0x11b320,'request\x20sent');_0x35f049(_0x25b4d1[_0xae66('0x19')][_0xae66('0x18')]);}})[_0xae66('0x1a')](function(_0x27d4a6){logger[_0xae66('0x15')](_0xae66('0x17'),_0x11b320,_0x27d4a6);_0xef892(_0x27d4a6);});});}exports[_0xae66('0x1b')]=function(_0x3ecae6){var _0x2ec549=this;return new Promise(function(_0x43f012,_0x4c26b8){return db['VoiceExtension'][_0xae66('0x1c')]({'raw':_0x3ecae6[_0xae66('0x1d')]?_0x3ecae6[_0xae66('0x1d')][_0xae66('0x1e')]===undefined?!![]:![]:!![],'where':_0x3ecae6[_0xae66('0x1d')]?_0x3ecae6[_0xae66('0x1d')][_0xae66('0x1f')]||null:null,'attributes':_0x3ecae6[_0xae66('0x1d')]?_0x3ecae6['options'][_0xae66('0x20')]||null:null,'limit':_0x3ecae6[_0xae66('0x1d')]?_0x3ecae6['options'][_0xae66('0x21')]||null:null,'include':_0x3ecae6[_0xae66('0x1d')]?_0x3ecae6[_0xae66('0x1d')]['include']?_[_0xae66('0x22')](_0x3ecae6[_0xae66('0x1d')]['include'],function(_0x1891b8){return{'model':db[_0x1891b8['model']],'as':_0x1891b8['as'],'attributes':_0x1891b8['attributes'],'include':_0x1891b8[_0xae66('0x23')]?_[_0xae66('0x22')](_0x1891b8[_0xae66('0x23')],function(_0x4a7e5d){return{'model':db[_0x4a7e5d[_0xae66('0x24')]],'as':_0x4a7e5d['as'],'attributes':_0x4a7e5d[_0xae66('0x20')],'include':_0x4a7e5d['include']?_['map'](_0x4a7e5d[_0xae66('0x23')],function(_0x270b5b){return{'model':db[_0x270b5b[_0xae66('0x24')]],'as':_0x270b5b['as'],'attributes':_0x270b5b[_0xae66('0x20')]};}):[]};}):[]};}):[]:[]})[_0xae66('0xf')](function(_0xe141e){logger[_0xae66('0x10')](_0xae66('0x1b'),_0x3ecae6);logger[_0xae66('0x12')](_0xae66('0x1b'),_0x3ecae6,JSON[_0xae66('0x14')](_0xe141e));_0x43f012(_0xe141e);})[_0xae66('0x1a')](function(_0x2a2a75){logger[_0xae66('0x15')](_0xae66('0x1b'),_0x2a2a75[_0xae66('0x18')],_0x3ecae6);_0x4c26b8(_0x2ec549[_0xae66('0x15')](0x1f4,_0x2a2a75[_0xae66('0x18')]));});});};
\ No newline at end of file
+var _0x667e=['../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','findAll','options','raw','where','limit','include','model','attributes','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x185445,_0x1879a4){var _0x300c0f=function(_0x525253){while(--_0x525253){_0x185445['push'](_0x185445['shift']());}};_0x300c0f(++_0x1879a4);}(_0x667e,0x139));var _0xe667=function(_0x1fedd5,_0x3da7d3){_0x1fedd5=_0x1fedd5-0x0;var _0x16c57b=_0x667e[_0x1fedd5];return _0x16c57b;};'use strict';var _=require(_0xe667('0x0'));var util=require(_0xe667('0x1'));var moment=require(_0xe667('0x2'));var BPromise=require(_0xe667('0x3'));var rs=require(_0xe667('0x4'));var fs=require('fs');var Redis=require(_0xe667('0x5'));var db=require(_0xe667('0x6'))['db'];var utils=require(_0xe667('0x7'));var logger=require('../../config/logger')(_0xe667('0x8'));var config=require(_0xe667('0x9'));var jayson=require(_0xe667('0xa'));var client=jayson['client'][_0xe667('0xb')]({'port':0x232a});config[_0xe667('0xc')]=_['defaults'](config[_0xe667('0xc')],{'host':_0xe667('0xd'),'port':0x18eb});var socket=require(_0xe667('0xe'))(new Redis(config['redis']));require(_0xe667('0xf'))[_0xe667('0x10')](socket);function respondWithRpcPromise(_0x55fa7e,_0x3c8fd0,_0x3a1807){return new BPromise(function(_0x27c1d5,_0xb34f71){return client[_0xe667('0x11')](_0x55fa7e,_0x3a1807)[_0xe667('0x12')](function(_0x47c6c1){logger[_0xe667('0x13')](_0xe667('0x14'),_0x3c8fd0,'request\x20sent');logger['debug'](_0xe667('0x15'),_0x3c8fd0,_0xe667('0x16'),JSON[_0xe667('0x17')](_0x47c6c1));if(_0x47c6c1[_0xe667('0x18')]){if(_0x47c6c1[_0xe667('0x18')][_0xe667('0x19')]===0x1f4){logger[_0xe667('0x18')](_0xe667('0x14'),_0x3c8fd0,_0x47c6c1[_0xe667('0x18')][_0xe667('0x1a')]);return _0xb34f71(_0x47c6c1[_0xe667('0x18')][_0xe667('0x1a')]);}logger[_0xe667('0x18')](_0xe667('0x14'),_0x3c8fd0,_0x47c6c1[_0xe667('0x18')][_0xe667('0x1a')]);return _0x27c1d5(_0x47c6c1[_0xe667('0x18')][_0xe667('0x1a')]);}else{logger[_0xe667('0x13')](_0xe667('0x14'),_0x3c8fd0,_0xe667('0x16'));_0x27c1d5(_0x47c6c1[_0xe667('0x1b')]['message']);}})[_0xe667('0x1c')](function(_0x243cba){logger[_0xe667('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x3c8fd0,_0x243cba);_0xb34f71(_0x243cba);});});}exports[_0xe667('0x1d')]=function(_0x4acbd0){var _0x43d735=this;return new Promise(function(_0x254502,_0x328a94){return db['VoiceExtension'][_0xe667('0x1e')]({'raw':_0x4acbd0[_0xe667('0x1f')]?_0x4acbd0[_0xe667('0x1f')][_0xe667('0x20')]===undefined?!![]:![]:!![],'where':_0x4acbd0[_0xe667('0x1f')]?_0x4acbd0[_0xe667('0x1f')][_0xe667('0x21')]||null:null,'attributes':_0x4acbd0[_0xe667('0x1f')]?_0x4acbd0[_0xe667('0x1f')]['attributes']||null:null,'limit':_0x4acbd0[_0xe667('0x1f')]?_0x4acbd0[_0xe667('0x1f')][_0xe667('0x22')]||null:null,'include':_0x4acbd0[_0xe667('0x1f')]?_0x4acbd0[_0xe667('0x1f')]['include']?_['map'](_0x4acbd0['options'][_0xe667('0x23')],function(_0x16ddc8){return{'model':db[_0x16ddc8[_0xe667('0x24')]],'as':_0x16ddc8['as'],'attributes':_0x16ddc8[_0xe667('0x25')],'include':_0x16ddc8[_0xe667('0x23')]?_[_0xe667('0x26')](_0x16ddc8[_0xe667('0x23')],function(_0x181c07){return{'model':db[_0x181c07[_0xe667('0x24')]],'as':_0x181c07['as'],'attributes':_0x181c07[_0xe667('0x25')],'include':_0x181c07[_0xe667('0x23')]?_[_0xe667('0x26')](_0x181c07[_0xe667('0x23')],function(_0x13a16f){return{'model':db[_0x13a16f[_0xe667('0x24')]],'as':_0x13a16f['as'],'attributes':_0x13a16f[_0xe667('0x25')]};}):[]};}):[]};}):[]:[]})[_0xe667('0x12')](function(_0x47cdc6){logger[_0xe667('0x13')]('GetVoiceExtension',_0x4acbd0);logger[_0xe667('0x27')](_0xe667('0x1d'),_0x4acbd0,JSON[_0xe667('0x17')](_0x47cdc6));_0x254502(_0x47cdc6);})['catch'](function(_0xf4488d){logger[_0xe667('0x18')](_0xe667('0x1d'),_0xf4488d[_0xe667('0x1a')],_0x4acbd0);_0x328a94(_0x43d735[_0xe667('0x18')](0x1f4,_0xf4488d['message']));});});};
\ No newline at end of file
index c9ddb3a..748ea5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12be=['voiceExtension:','update','emit','removeListener','length'];(function(_0x3db9a,_0x47e5f8){var _0x18dd37=function(_0x16910d){while(--_0x16910d){_0x3db9a['push'](_0x3db9a['shift']());}};_0x18dd37(++_0x47e5f8);}(_0x12be,0x74));var _0xe12b=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x12be[_0x263f9d];return _0x4c4efa;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save','remove',_0xe12b('0x0')];function createListener(_0x1196a9,_0x56ff8f){return function(_0x4165fc){_0x56ff8f[_0xe12b('0x1')](_0x1196a9,_0x4165fc);};}function removeListener(_0x5e738e,_0x52d087){return function(){VoiceExtensionEvents[_0xe12b('0x2')](_0x5e738e,_0x52d087);};}exports['register']=function(_0x5d7b4b){for(var _0x4b932a=0x0,_0x22a4aa=events[_0xe12b('0x3')];_0x4b932a<_0x22a4aa;_0x4b932a++){var _0x38e811=events[_0x4b932a];var _0x57f708=createListener(_0xe12b('0x4')+_0x38e811,_0x5d7b4b);VoiceExtensionEvents['on'](_0x38e811,_0x57f708);}};
\ No newline at end of file
+var _0x0619=['register','length','voiceExtension:','./voiceExtension.events','save','update','emit'];(function(_0x4d1ac9,_0x37e63a){var _0x41c2d9=function(_0x108354){while(--_0x108354){_0x4d1ac9['push'](_0x4d1ac9['shift']());}};_0x41c2d9(++_0x37e63a);}(_0x0619,0x199));var _0x9061=function(_0x45eba6,_0x4156b3){_0x45eba6=_0x45eba6-0x0;var _0x212dbe=_0x0619[_0x45eba6];return _0x212dbe;};'use strict';var VoiceExtensionEvents=require(_0x9061('0x0'));var events=[_0x9061('0x1'),'remove',_0x9061('0x2')];function createListener(_0x4e5aa7,_0x124fe4){return function(_0x2212b2){_0x124fe4[_0x9061('0x3')](_0x4e5aa7,_0x2212b2);};}function removeListener(_0x4b2b1f,_0x3cf30b){return function(){VoiceExtensionEvents['removeListener'](_0x4b2b1f,_0x3cf30b);};}exports[_0x9061('0x4')]=function(_0x540b9c){for(var _0x4cc75c=0x0,_0x5b42ed=events[_0x9061('0x5')];_0x4cc75c<_0x5b42ed;_0x4cc75c++){var _0x20eb29=events[_0x4cc75c];var _0x4df3de=createListener(_0x9061('0x6')+_0x20eb29,_0x540b9c);VoiceExtensionEvents['on'](_0x20eb29,_0x4df3de);}};
\ No newline at end of file
index b5e489f..8f7182c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d7a=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','put','update'];(function(_0x2bf835,_0x1f8013){var _0x3f3568=function(_0x36018c){while(--_0x36018c){_0x2bf835['push'](_0x2bf835['shift']());}};_0x3f3568(++_0x1f8013);}(_0x6d7a,0x169));var _0xa6d7=function(_0x56ffb4,_0xe7da83){_0x56ffb4=_0x56ffb4-0x0;var _0x86f6d3=_0x6d7a[_0x56ffb4];return _0x86f6d3;};'use strict';var multer=require(_0xa6d7('0x0'));var util=require(_0xa6d7('0x1'));var path=require(_0xa6d7('0x2'));var timeout=require(_0xa6d7('0x3'));var express=require(_0xa6d7('0x4'));var router=express[_0xa6d7('0x5')]();var auth=require(_0xa6d7('0x6'));var interaction=require(_0xa6d7('0x7'));var config=require('../../config/environment');var controller=require(_0xa6d7('0x8'));router[_0xa6d7('0x9')]('/',auth[_0xa6d7('0xa')](),controller[_0xa6d7('0xb')]);router[_0xa6d7('0x9')](_0xa6d7('0xc'),auth[_0xa6d7('0xa')](),controller[_0xa6d7('0xd')]);router[_0xa6d7('0x9')](_0xa6d7('0xe'),auth[_0xa6d7('0xa')](),controller[_0xa6d7('0xf')]);router[_0xa6d7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa6d7('0x11')](_0xa6d7('0xc'),auth[_0xa6d7('0xa')](),controller[_0xa6d7('0x12')]);router['delete'](_0xa6d7('0xc'),auth[_0xa6d7('0xa')](),controller['destroy']);module[_0xa6d7('0x13')]=router;
\ No newline at end of file
+var _0x76ca=['put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','post','create'];(function(_0x3d0104,_0x2ba6ff){var _0x995a45=function(_0x4a9503){while(--_0x4a9503){_0x3d0104['push'](_0x3d0104['shift']());}};_0x995a45(++_0x2ba6ff);}(_0x76ca,0x98));var _0xa76c=function(_0xc543e2,_0x57016e){_0xc543e2=_0xc543e2-0x0;var _0x310c8a=_0x76ca[_0xc543e2];return _0x310c8a;};'use strict';var multer=require('multer');var util=require(_0xa76c('0x0'));var path=require(_0xa76c('0x1'));var timeout=require(_0xa76c('0x2'));var express=require(_0xa76c('0x3'));var router=express[_0xa76c('0x4')]();var auth=require(_0xa76c('0x5'));var interaction=require(_0xa76c('0x6'));var config=require('../../config/environment');var controller=require(_0xa76c('0x7'));router[_0xa76c('0x8')]('/',auth[_0xa76c('0x9')](),controller[_0xa76c('0xa')]);router[_0xa76c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa76c('0xb')]);router[_0xa76c('0x8')](_0xa76c('0xc'),auth[_0xa76c('0x9')](),controller[_0xa76c('0xd')]);router[_0xa76c('0xe')]('/',auth[_0xa76c('0x9')](),controller[_0xa76c('0xf')]);router[_0xa76c('0x10')](_0xa76c('0x11'),auth[_0xa76c('0x9')](),controller[_0xa76c('0x12')]);router[_0xa76c('0x13')](_0xa76c('0x11'),auth[_0xa76c('0x9')](),controller['destroy']);module[_0xa76c('0x14')]=router;
\ No newline at end of file
index da3963b..2cdbf4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','string','trim','central'];(function(_0x2c5231,_0x51913c){var _0x569090=function(_0x3a3db9){while(--_0x3a3db9){_0x2c5231['push'](_0x2c5231['shift']());}};_0x569090(++_0x51913c);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c2995,_0x9e2edf){_0x1c2995=_0x1c2995-0x0;var _0x1acd48=_0xb10b[_0x1c2995];return _0x1acd48;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xbb10('0x1')]},'context':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'','allowNull':![],'unique':_0xbb10('0x3')},'password':{'type':Sequelize[_0xbb10('0x1')]},'fullname':{'type':Sequelize[_0xbb10('0x1')]},'email':{'type':Sequelize[_0xbb10('0x1')],'validate':{'isEmail':!![]},'set':function(_0x312b72){this['setDataValue'](_0xbb10('0x4'),typeof _0x312b72===_0xbb10('0x5')&&_0x312b72['trim']()?_0x312b72[_0xbb10('0x6')]():null);}},'pager':{'type':Sequelize[_0xbb10('0x1')]},'tz':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x7')},'attach':{'type':Sequelize[_0xbb10('0x8')](_0xbb10('0x9'),'no'),'defaultValue':_0xbb10('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xbb10('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xbb10('0x1')]},'callback':{'type':Sequelize[_0xbb10('0x1')]},'review':{'type':Sequelize[_0xbb10('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xbb10('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xbb10('0x8')](_0xbb10('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xbb10('0x8')](_0xbb10('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xbb10('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xbb10('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xbb10('0x8')](_0xbb10('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xbb10('0x8')](_0xbb10('0x9'),'no'),'defaultValue':_0xbb10('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xbb10('0x8')](_0xbb10('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xbb10('0x8')](_0xbb10('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xbb10('0x8')]('yes','no'),'defaultValue':_0xbb10('0x9'),'allowNull':![]},'stamp':{'type':_0xbb10('0xb')},'emailsubject':{'type':Sequelize[_0xbb10('0x1')]},'emailbody':{'type':Sequelize[_0xbb10('0x1')]},'maxsecs':{'type':Sequelize[_0xbb10('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xbb10('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xbb10('0xd')],'get':function(){return this[_0xbb10('0xe')](_0xbb10('0xf'))+_0xbb10('0x10')+this['getDataValue'](_0xbb10('0x11'));}}};
\ No newline at end of file
+var _0xda3f=['fullname','\x20-\x20','exports','STRING','setDataValue','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue'];(function(_0x22710d,_0x182d5f){var _0x3ff8f8=function(_0x40398c){while(--_0x40398c){_0x22710d['push'](_0x22710d['shift']());}};_0x3ff8f8(++_0x182d5f);}(_0xda3f,0xec));var _0xfda3=function(_0x1b8a16,_0x4c2a73){_0x1b8a16=_0x1b8a16-0x0;var _0x934fd2=_0xda3f[_0x1b8a16];return _0x934fd2;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'customer_id':{'type':Sequelize[_0xfda3('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xfda3('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xfda3('0x1')]},'fullname':{'type':Sequelize[_0xfda3('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x42bd74){this[_0xfda3('0x2')]('email',typeof _0x42bd74==='string'&&_0x42bd74[_0xfda3('0x3')]()?_0x42bd74[_0xfda3('0x3')]():null);}},'pager':{'type':Sequelize[_0xfda3('0x1')]},'tz':{'type':Sequelize[_0xfda3('0x1')],'defaultValue':_0xfda3('0x4')},'attach':{'type':Sequelize[_0xfda3('0x5')](_0xfda3('0x6'),'no'),'defaultValue':_0xfda3('0x6'),'allowNull':![]},'saycid':{'type':Sequelize[_0xfda3('0x5')](_0xfda3('0x6'),'no'),'defaultValue':_0xfda3('0x6'),'allowNull':![]},'dialout':{'type':Sequelize[_0xfda3('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xfda3('0x5')](_0xfda3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xfda3('0x5')](_0xfda3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xfda3('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xfda3('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xfda3('0x7'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xfda3('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xfda3('0x5')](_0xfda3('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xfda3('0x5')](_0xfda3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xfda3('0x5')](_0xfda3('0x6'),'no'),'defaultValue':_0xfda3('0x6'),'allowNull':![]},'stamp':{'type':_0xfda3('0x8')},'emailsubject':{'type':Sequelize[_0xfda3('0x1')]},'emailbody':{'type':Sequelize[_0xfda3('0x1')]},'maxsecs':{'type':Sequelize[_0xfda3('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xfda3('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfda3('0xa')](_0xfda3('0xb'))+_0xfda3('0xc')+this[_0xfda3('0xa')]('mailbox');}}};
\ No newline at end of file
index c4383d9..1071167 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27fa=['crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','map','VoiceMail','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','update','body','getMessages','findOne','VoiceMailMessage','mailbox','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x27fa,0x1af));var _0xa27f=function(_0x11dacb,_0x5ae29c){_0x11dacb=_0x11dacb-0x0;var _0x30db75=_0x27fa[_0x11dacb];return _0x30db75;};'use strict';var pdf=require(_0xa27f('0x0'));var emlformat=require(_0xa27f('0x1'));var rimraf=require(_0xa27f('0x2'));var zipdir=require(_0xa27f('0x3'));var jsonpatch=require(_0xa27f('0x4'));var rp=require(_0xa27f('0x5'));var moment=require(_0xa27f('0x6'));var BPromise=require(_0xa27f('0x7'));var Mustache=require(_0xa27f('0x8'));var util=require(_0xa27f('0x9'));var path=require(_0xa27f('0xa'));var sox=require(_0xa27f('0xb'));var csv=require('to-csv');var ejs=require(_0xa27f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa27f('0xd'));var crypto=require(_0xa27f('0xe'));var jsforce=require(_0xa27f('0xf'));var deskjs=require(_0xa27f('0x10'));var toCsv=require(_0xa27f('0x11'));var querystring=require('querystring');var Papa=require(_0xa27f('0x12'));var Redis=require('ioredis');var authService=require(_0xa27f('0x13'));var qs=require(_0xa27f('0x14'));var as=require(_0xa27f('0x15'));var hardwareService=require(_0xa27f('0x16'));var logger=require(_0xa27f('0x17'))(_0xa27f('0x18'));var utils=require(_0xa27f('0x19'));var config=require(_0xa27f('0x1a'));var db=require(_0xa27f('0x1b'))['db'];function respondWithStatusCode(_0x1606a8,_0x1451da){_0x1451da=_0x1451da||0xcc;return function(_0x50549f){if(_0x50549f){return _0x1606a8[_0xa27f('0x1c')](_0x1451da);}return _0x1606a8[_0xa27f('0x1d')](_0x1451da)[_0xa27f('0x1e')]();};}function respondWithResult(_0x432180,_0x4ea994){_0x4ea994=_0x4ea994||0xc8;return function(_0x558478){if(_0x558478){return _0x432180['status'](_0x4ea994)['json'](_0x558478);}};}function respondWithFilteredResult(_0x11060d,_0x295f6c){return function(_0x2a2b43){if(_0x2a2b43){var _0x4ddac0=_0x2a2b43[_0xa27f('0x1f')],_0x13418c=_0x295f6c[_0xa27f('0x20')],_0x5cfc70=_0x295f6c[_0xa27f('0x20')]+_0x295f6c[_0xa27f('0x21')],_0x446a12;if(_0x5cfc70>=_0x4ddac0){_0x5cfc70=_0x4ddac0;_0x446a12=0xc8;}else{_0x446a12=0xce;}_0x11060d[_0xa27f('0x1d')](_0x446a12);return _0x11060d['set'](_0xa27f('0x22'),_0x13418c+'-'+_0x5cfc70+'/'+_0x4ddac0)[_0xa27f('0x23')](_0x2a2b43);}return null;};}function patchUpdates(_0x3a3402){return function(_0x40aef9){try{jsonpatch[_0xa27f('0x24')](_0x40aef9,_0x3a3402,!![]);}catch(_0x5c7cfc){return BPromise[_0xa27f('0x25')](_0x5c7cfc);}return _0x40aef9[_0xa27f('0x26')]();};}function saveUpdates(_0x108323,_0xa0438f){return function(_0x1a48c0){if(_0x1a48c0){return _0x1a48c0['update'](_0x108323)[_0xa27f('0x27')](function(_0x87e2ac){return _0x87e2ac;});}return null;};}function removeEntity(_0x3b44d4,_0x1ba798){return function(_0x3b5147){if(_0x3b5147){return _0x3b5147[_0xa27f('0x28')]()['then'](function(){var _0x5a122a=_0x3b5147[_0xa27f('0x29')]({'plain':!![]});var _0x15925f=_0xa27f('0x2a');return db[_0xa27f('0x2b')][_0xa27f('0x28')]({'where':{'type':_0x15925f,'resourceId':_0x5a122a['id']}})[_0xa27f('0x27')](function(){return _0x3b5147;});})['then'](function(){_0x3b44d4[_0xa27f('0x1d')](0xcc)[_0xa27f('0x1e')]();});}};}function handleEntityNotFound(_0x5bd639,_0x54d358){return function(_0x1f494d){if(!_0x1f494d){_0x5bd639['sendStatus'](0x194);}return _0x1f494d;};}function handleError(_0x2b0b26,_0x50c35d){_0x50c35d=_0x50c35d||0x1f4;return function(_0x17218c){logger[_0xa27f('0x2c')](_0x17218c[_0xa27f('0x2d')]);if(_0x17218c[_0xa27f('0x2e')]){delete _0x17218c[_0xa27f('0x2e')];}_0x2b0b26['status'](_0x50c35d)['send'](_0x17218c);};}exports['index']=function(_0x154008,_0x457f25){var _0x31d1b2={},_0x58cf38={},_0x396465={'count':0x0,'rows':[]};var _0x3fcb9a=_[_0xa27f('0x2f')](db[_0xa27f('0x30')][_0xa27f('0x31')],function(_0x174f9e){return{'name':_0x174f9e['fieldName'],'type':_0x174f9e[_0xa27f('0x32')][_0xa27f('0x33')]};});_0x58cf38[_0xa27f('0x34')]=_['map'](_0x3fcb9a,_0xa27f('0x2e'));_0x58cf38[_0xa27f('0x35')]=_[_0xa27f('0x36')](_0x154008['query']);_0x58cf38[_0xa27f('0x37')]=_[_0xa27f('0x38')](_0x58cf38['model'],_0x58cf38[_0xa27f('0x35')]);_0x31d1b2['attributes']=_[_0xa27f('0x38')](_0x58cf38[_0xa27f('0x34')],qs[_0xa27f('0x39')](_0x154008[_0xa27f('0x35')][_0xa27f('0x39')]));_0x31d1b2[_0xa27f('0x3a')]=_0x31d1b2[_0xa27f('0x3a')]['length']?_0x31d1b2['attributes']:_0x58cf38[_0xa27f('0x34')];if(!_0x154008[_0xa27f('0x35')][_0xa27f('0x3b')](_0xa27f('0x3c'))){_0x31d1b2[_0xa27f('0x21')]=qs[_0xa27f('0x21')](_0x154008[_0xa27f('0x35')]['limit']);_0x31d1b2['offset']=qs[_0xa27f('0x20')](_0x154008[_0xa27f('0x35')][_0xa27f('0x20')]);}_0x31d1b2[_0xa27f('0x3d')]=qs[_0xa27f('0x3e')](_0x154008[_0xa27f('0x35')][_0xa27f('0x3e')]);_0x31d1b2[_0xa27f('0x3f')]=qs[_0xa27f('0x37')](_[_0xa27f('0x40')](_0x154008[_0xa27f('0x35')],_0x58cf38[_0xa27f('0x37')]),_0x3fcb9a);if(_0x154008[_0xa27f('0x35')][_0xa27f('0x41')]){_0x31d1b2[_0xa27f('0x3f')]=_[_0xa27f('0x42')](_0x31d1b2[_0xa27f('0x3f')],{'$or':_['map'](_0x3fcb9a,function(_0x202e89){if(_0x202e89[_0xa27f('0x32')]!==_0xa27f('0x43')){var _0x10b8b2={};_0x10b8b2[_0x202e89[_0xa27f('0x2e')]]={'$like':'%'+_0x154008['query'][_0xa27f('0x41')]+'%'};return _0x10b8b2;}})});}_0x31d1b2=_['merge']({},_0x31d1b2,_0x154008[_0xa27f('0x44')]);var _0x2b1ad6={'where':_0x31d1b2[_0xa27f('0x3f')]};return db[_0xa27f('0x30')][_0xa27f('0x1f')](_0x2b1ad6)[_0xa27f('0x27')](function(_0x357ec8){_0x396465[_0xa27f('0x1f')]=_0x357ec8;if(_0x154008['query'][_0xa27f('0x45')]){_0x31d1b2[_0xa27f('0x46')]=[{'all':!![]}];}return db['VoiceMail'][_0xa27f('0x47')](_0x31d1b2);})[_0xa27f('0x27')](function(_0x168089){_0x396465['rows']=_0x168089;return _0x396465;})[_0xa27f('0x27')](respondWithFilteredResult(_0x457f25,_0x31d1b2))['catch'](handleError(_0x457f25,null));};exports[_0xa27f('0x48')]=function(_0x164ee3,_0xb9bbc2){var _0x1ea6a7={'raw':!![],'where':{'id':_0x164ee3[_0xa27f('0x49')]['id']}},_0x130553={};_0x130553['model']=_['keys'](db[_0xa27f('0x30')]['rawAttributes']);_0x130553['query']=_[_0xa27f('0x36')](_0x164ee3[_0xa27f('0x35')]);_0x130553['filters']=_['intersection'](_0x130553[_0xa27f('0x34')],_0x130553[_0xa27f('0x35')]);_0x1ea6a7[_0xa27f('0x3a')]=_[_0xa27f('0x38')](_0x130553['model'],qs[_0xa27f('0x39')](_0x164ee3[_0xa27f('0x35')][_0xa27f('0x39')]));_0x1ea6a7[_0xa27f('0x3a')]=_0x1ea6a7['attributes'][_0xa27f('0x4a')]?_0x1ea6a7[_0xa27f('0x3a')]:_0x130553[_0xa27f('0x34')];if(_0x164ee3[_0xa27f('0x35')][_0xa27f('0x45')]){_0x1ea6a7[_0xa27f('0x46')]=[{'all':!![]}];}_0x1ea6a7=_[_0xa27f('0x42')]({},_0x1ea6a7,_0x164ee3[_0xa27f('0x44')]);return db[_0xa27f('0x30')][_0xa27f('0x4b')](_0x1ea6a7)[_0xa27f('0x27')](handleEntityNotFound(_0xb9bbc2,null))['then'](respondWithResult(_0xb9bbc2,null))['catch'](handleError(_0xb9bbc2,null));};exports[_0xa27f('0x4c')]=function(_0x299aa4,_0x5c7882){return db['VoiceMail'][_0xa27f('0x4c')](_0x299aa4['body'],{})['then'](function(_0xda080b){var _0x292e44=_0x299aa4[_0xa27f('0x4d')]['get']({'plain':!![]});if(!_0x292e44)throw new Error(_0xa27f('0x4e'));if(_0x292e44['role']===_0xa27f('0x4d')){var _0x44dc23=_0xda080b[_0xa27f('0x29')]({'plain':!![]});var _0xd4084e=_0xa27f('0x2a');return db[_0xa27f('0x4f')]['find']({'where':{'name':_0xd4084e,'userProfileId':_0x292e44[_0xa27f('0x50')]},'raw':!![]})[_0xa27f('0x27')](function(_0x40ef4e){if(_0x40ef4e&&_0x40ef4e[_0xa27f('0x51')]===0x0){return db[_0xa27f('0x2b')][_0xa27f('0x4c')]({'name':_0x44dc23[_0xa27f('0x2e')],'resourceId':_0x44dc23['id'],'type':_0x40ef4e[_0xa27f('0x2e')],'sectionId':_0x40ef4e['id']},{})[_0xa27f('0x27')](function(){return _0xda080b;});}else{return _0xda080b;}})['catch'](function(_0x30d056){logger[_0xa27f('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30d056);throw _0x30d056;});}return _0xda080b;})[_0xa27f('0x27')](respondWithResult(_0x5c7882,0xc9))[_0xa27f('0x52')](handleError(_0x5c7882,null));};exports[_0xa27f('0x53')]=function(_0x560c78,_0xb3a9ee){if(_0x560c78[_0xa27f('0x54')]['id']){delete _0x560c78['body']['id'];}return db[_0xa27f('0x30')][_0xa27f('0x4b')]({'where':{'id':_0x560c78[_0xa27f('0x49')]['id']}})[_0xa27f('0x27')](handleEntityNotFound(_0xb3a9ee,null))['then'](saveUpdates(_0x560c78[_0xa27f('0x54')],null))[_0xa27f('0x27')](respondWithResult(_0xb3a9ee,null))[_0xa27f('0x52')](handleError(_0xb3a9ee,null));};exports[_0xa27f('0x28')]=function(_0xcaabf,_0xee180d){return db[_0xa27f('0x30')]['find']({'where':{'id':_0xcaabf[_0xa27f('0x49')]['id']}})[_0xa27f('0x27')](handleEntityNotFound(_0xee180d,null))[_0xa27f('0x27')](removeEntity(_0xee180d,null))[_0xa27f('0x52')](handleError(_0xee180d,null));};exports[_0xa27f('0x55')]=function(_0x4cb65a,_0x523714,_0x1952fc){return db[_0xa27f('0x30')][_0xa27f('0x56')]({'where':{'id':_0x4cb65a[_0xa27f('0x49')]['id']}})[_0xa27f('0x27')](handleEntityNotFound(_0x523714,null))[_0xa27f('0x27')](function(_0x3a772f){var _0x3cda22;var _0x37bb4d={},_0x5d8fe5={};_0x5d8fe5[_0xa27f('0x34')]=_[_0xa27f('0x36')](db[_0xa27f('0x57')][_0xa27f('0x31')]);_0x5d8fe5[_0xa27f('0x35')]=_[_0xa27f('0x36')](_0x4cb65a[_0xa27f('0x35')]);_0x5d8fe5[_0xa27f('0x37')]=_[_0xa27f('0x38')](_0x5d8fe5['model'],_0x5d8fe5[_0xa27f('0x35')]);_0x37bb4d[_0xa27f('0x3a')]=_[_0xa27f('0x38')](_0x5d8fe5['model'],qs[_0xa27f('0x39')](_0x4cb65a[_0xa27f('0x35')][_0xa27f('0x39')]));_0x37bb4d[_0xa27f('0x3a')]=_0x37bb4d[_0xa27f('0x3a')][_0xa27f('0x4a')]?_0x37bb4d[_0xa27f('0x3a')]:_0x5d8fe5['model'];if(!_0x4cb65a['query'][_0xa27f('0x3b')](_0xa27f('0x3c'))){_0x37bb4d['limit']=qs[_0xa27f('0x21')](_0x4cb65a[_0xa27f('0x35')][_0xa27f('0x21')]);_0x37bb4d[_0xa27f('0x20')]=qs[_0xa27f('0x20')](_0x4cb65a['query'][_0xa27f('0x20')]);}_0x37bb4d[_0xa27f('0x3d')]=qs[_0xa27f('0x3e')](_0x4cb65a['query']['sort']);_0x37bb4d[_0xa27f('0x3f')]=qs[_0xa27f('0x37')](_[_0xa27f('0x40')](_0x4cb65a[_0xa27f('0x35')],_0x5d8fe5[_0xa27f('0x37')]));if(_0x4cb65a[_0xa27f('0x35')][_0xa27f('0x41')]){_0x37bb4d[_0xa27f('0x3f')]=_[_0xa27f('0x42')](_0x37bb4d[_0xa27f('0x3f')],{'$or':_[_0xa27f('0x2f')](_0x37bb4d[_0xa27f('0x3a')],function(_0x3190b7){var _0x3a24ac={};_0x3a24ac[_0x3190b7]={'$like':'%'+_0x4cb65a[_0xa27f('0x35')][_0xa27f('0x41')]+'%'};return _0x3a24ac;})});}_0x37bb4d[_0xa27f('0x3f')]=_[_0xa27f('0x42')](_0x37bb4d[_0xa27f('0x3f')],{'mailboxuser':_0x3a772f[_0xa27f('0x58')]});_0x37bb4d=_['merge']({},_0x37bb4d,_0x4cb65a['options']);return db[_0xa27f('0x57')]['findAndCountAll'](_0x37bb4d)[_0xa27f('0x27')](respondWithFilteredResult(_0x523714,_0x37bb4d));})[_0xa27f('0x52')](handleError(_0x523714,null));};
\ No newline at end of file
+var _0x0cdc=['VoiceMail','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','update','getMessages','findOne','hasOwnProperty','sort','mailbox','html-pdf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','send','index','map'];(function(_0x28e22c,_0x2743f7){var _0x46fd29=function(_0x30949b){while(--_0x30949b){_0x28e22c['push'](_0x28e22c['shift']());}};_0x46fd29(++_0x2743f7);}(_0x0cdc,0xc4));var _0xc0cd=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x0cdc[_0x547456];return _0xc1fd7b;};'use strict';var pdf=require(_0xc0cd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc0cd('0x1'));var BPromise=require(_0xc0cd('0x2'));var Mustache=require(_0xc0cd('0x3'));var util=require(_0xc0cd('0x4'));var path=require(_0xc0cd('0x5'));var sox=require(_0xc0cd('0x6'));var csv=require(_0xc0cd('0x7'));var ejs=require(_0xc0cd('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc0cd('0x9'));var crypto=require(_0xc0cd('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc0cd('0x7'));var querystring=require(_0xc0cd('0xb'));var Papa=require(_0xc0cd('0xc'));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(_0xc0cd('0xd'));var logger=require(_0xc0cd('0xe'))('api');var utils=require(_0xc0cd('0xf'));var config=require('../../config/environment');var db=require(_0xc0cd('0x10'))['db'];function respondWithStatusCode(_0x239e9a,_0x39f1a3){_0x39f1a3=_0x39f1a3||0xcc;return function(_0x1389b8){if(_0x1389b8){return _0x239e9a['sendStatus'](_0x39f1a3);}return _0x239e9a[_0xc0cd('0x11')](_0x39f1a3)[_0xc0cd('0x12')]();};}function respondWithResult(_0x18f681,_0x1cfdd6){_0x1cfdd6=_0x1cfdd6||0xc8;return function(_0x544283){if(_0x544283){return _0x18f681[_0xc0cd('0x11')](_0x1cfdd6)[_0xc0cd('0x13')](_0x544283);}};}function respondWithFilteredResult(_0x88c8b5,_0x308e19){return function(_0x3f6dc4){if(_0x3f6dc4){var _0x209fd9=_0x3f6dc4[_0xc0cd('0x14')],_0x11cfe6=_0x308e19['offset'],_0x5e26e6=_0x308e19[_0xc0cd('0x15')]+_0x308e19[_0xc0cd('0x16')],_0x43f1ab;if(_0x5e26e6>=_0x209fd9){_0x5e26e6=_0x209fd9;_0x43f1ab=0xc8;}else{_0x43f1ab=0xce;}_0x88c8b5['status'](_0x43f1ab);return _0x88c8b5[_0xc0cd('0x17')](_0xc0cd('0x18'),_0x11cfe6+'-'+_0x5e26e6+'/'+_0x209fd9)[_0xc0cd('0x13')](_0x3f6dc4);}return null;};}function patchUpdates(_0x3384c0){return function(_0x1a03f4){try{jsonpatch['apply'](_0x1a03f4,_0x3384c0,!![]);}catch(_0x5b3a6a){return BPromise['reject'](_0x5b3a6a);}return _0x1a03f4[_0xc0cd('0x19')]();};}function saveUpdates(_0x4e4f59,_0x54bb9b){return function(_0x21d591){if(_0x21d591){return _0x21d591['update'](_0x4e4f59)[_0xc0cd('0x1a')](function(_0x2b95d6){return _0x2b95d6;});}return null;};}function removeEntity(_0x6e4403,_0x3dc556){return function(_0xcc1d37){if(_0xcc1d37){return _0xcc1d37[_0xc0cd('0x1b')]()['then'](function(){var _0x3750fd=_0xcc1d37[_0xc0cd('0x1c')]({'plain':!![]});var _0x44fba5=_0xc0cd('0x1d');return db[_0xc0cd('0x1e')][_0xc0cd('0x1b')]({'where':{'type':_0x44fba5,'resourceId':_0x3750fd['id']}})[_0xc0cd('0x1a')](function(){return _0xcc1d37;});})['then'](function(){_0x6e4403['status'](0xcc)[_0xc0cd('0x12')]();});}};}function handleEntityNotFound(_0x5dab42,_0x33c7a9){return function(_0x32f04c){if(!_0x32f04c){_0x5dab42[_0xc0cd('0x1f')](0x194);}return _0x32f04c;};}function handleError(_0x24f007,_0x5d9e8f){_0x5d9e8f=_0x5d9e8f||0x1f4;return function(_0x5b2535){logger[_0xc0cd('0x20')](_0x5b2535[_0xc0cd('0x21')]);if(_0x5b2535['name']){delete _0x5b2535[_0xc0cd('0x22')];}_0x24f007[_0xc0cd('0x11')](_0x5d9e8f)[_0xc0cd('0x23')](_0x5b2535);};}exports[_0xc0cd('0x24')]=function(_0x4d3678,_0x57b569){var _0x35b447={},_0x32b27b={},_0x35e8e9={'count':0x0,'rows':[]};var _0x3d546b=_[_0xc0cd('0x25')](db[_0xc0cd('0x26')]['rawAttributes'],function(_0x5007f0){return{'name':_0x5007f0['fieldName'],'type':_0x5007f0[_0xc0cd('0x27')][_0xc0cd('0x28')]};});_0x32b27b[_0xc0cd('0x29')]=_[_0xc0cd('0x25')](_0x3d546b,_0xc0cd('0x22'));_0x32b27b[_0xc0cd('0x2a')]=_[_0xc0cd('0x2b')](_0x4d3678[_0xc0cd('0x2a')]);_0x32b27b[_0xc0cd('0x2c')]=_[_0xc0cd('0x2d')](_0x32b27b[_0xc0cd('0x29')],_0x32b27b[_0xc0cd('0x2a')]);_0x35b447[_0xc0cd('0x2e')]=_['intersection'](_0x32b27b[_0xc0cd('0x29')],qs[_0xc0cd('0x2f')](_0x4d3678[_0xc0cd('0x2a')]['fields']));_0x35b447[_0xc0cd('0x2e')]=_0x35b447[_0xc0cd('0x2e')][_0xc0cd('0x30')]?_0x35b447[_0xc0cd('0x2e')]:_0x32b27b[_0xc0cd('0x29')];if(!_0x4d3678['query']['hasOwnProperty'](_0xc0cd('0x31'))){_0x35b447[_0xc0cd('0x16')]=qs[_0xc0cd('0x16')](_0x4d3678[_0xc0cd('0x2a')][_0xc0cd('0x16')]);_0x35b447[_0xc0cd('0x15')]=qs['offset'](_0x4d3678[_0xc0cd('0x2a')][_0xc0cd('0x15')]);}_0x35b447[_0xc0cd('0x32')]=qs['sort'](_0x4d3678[_0xc0cd('0x2a')]['sort']);_0x35b447[_0xc0cd('0x33')]=qs[_0xc0cd('0x2c')](_[_0xc0cd('0x34')](_0x4d3678['query'],_0x32b27b[_0xc0cd('0x2c')]),_0x3d546b);if(_0x4d3678[_0xc0cd('0x2a')][_0xc0cd('0x35')]){_0x35b447[_0xc0cd('0x33')]=_['merge'](_0x35b447['where'],{'$or':_[_0xc0cd('0x25')](_0x3d546b,function(_0x50b5f3){if(_0x50b5f3[_0xc0cd('0x27')]!=='VIRTUAL'){var _0x17572c={};_0x17572c[_0x50b5f3['name']]={'$like':'%'+_0x4d3678[_0xc0cd('0x2a')][_0xc0cd('0x35')]+'%'};return _0x17572c;}})});}_0x35b447=_[_0xc0cd('0x36')]({},_0x35b447,_0x4d3678['options']);var _0x22c711={'where':_0x35b447[_0xc0cd('0x33')]};return db['VoiceMail']['count'](_0x22c711)['then'](function(_0x3a79a2){_0x35e8e9['count']=_0x3a79a2;if(_0x4d3678[_0xc0cd('0x2a')][_0xc0cd('0x37')]){_0x35b447[_0xc0cd('0x38')]=[{'all':!![]}];}return db[_0xc0cd('0x26')][_0xc0cd('0x39')](_0x35b447);})[_0xc0cd('0x1a')](function(_0x2d4a19){_0x35e8e9[_0xc0cd('0x3a')]=_0x2d4a19;return _0x35e8e9;})[_0xc0cd('0x1a')](respondWithFilteredResult(_0x57b569,_0x35b447))['catch'](handleError(_0x57b569,null));};exports[_0xc0cd('0x3b')]=function(_0x3f7e13,_0x4b0b0f){var _0x5123aa={'raw':!![],'where':{'id':_0x3f7e13[_0xc0cd('0x3c')]['id']}},_0xc150c7={};_0xc150c7[_0xc0cd('0x29')]=_['keys'](db[_0xc0cd('0x26')][_0xc0cd('0x3d')]);_0xc150c7['query']=_[_0xc0cd('0x2b')](_0x3f7e13[_0xc0cd('0x2a')]);_0xc150c7[_0xc0cd('0x2c')]=_[_0xc0cd('0x2d')](_0xc150c7[_0xc0cd('0x29')],_0xc150c7[_0xc0cd('0x2a')]);_0x5123aa['attributes']=_[_0xc0cd('0x2d')](_0xc150c7[_0xc0cd('0x29')],qs[_0xc0cd('0x2f')](_0x3f7e13['query'][_0xc0cd('0x2f')]));_0x5123aa[_0xc0cd('0x2e')]=_0x5123aa[_0xc0cd('0x2e')][_0xc0cd('0x30')]?_0x5123aa['attributes']:_0xc150c7['model'];if(_0x3f7e13['query']['includeAll']){_0x5123aa['include']=[{'all':!![]}];}_0x5123aa=_['merge']({},_0x5123aa,_0x3f7e13[_0xc0cd('0x3e')]);return db[_0xc0cd('0x26')][_0xc0cd('0x3f')](_0x5123aa)[_0xc0cd('0x1a')](handleEntityNotFound(_0x4b0b0f,null))[_0xc0cd('0x1a')](respondWithResult(_0x4b0b0f,null))['catch'](handleError(_0x4b0b0f,null));};exports[_0xc0cd('0x40')]=function(_0x331168,_0x20f3a2){return db[_0xc0cd('0x26')]['create'](_0x331168[_0xc0cd('0x41')],{})['then'](function(_0x169c79){var _0x3f1d58=_0x331168[_0xc0cd('0x42')]['get']({'plain':!![]});if(!_0x3f1d58)throw new Error(_0xc0cd('0x43'));if(_0x3f1d58[_0xc0cd('0x44')]==='user'){var _0x416275=_0x169c79[_0xc0cd('0x1c')]({'plain':!![]});var _0x233b7c='Voicemails';return db[_0xc0cd('0x45')]['find']({'where':{'name':_0x233b7c,'userProfileId':_0x3f1d58[_0xc0cd('0x46')]},'raw':!![]})['then'](function(_0x1e5fbb){if(_0x1e5fbb&&_0x1e5fbb['autoAssociation']===0x0){return db[_0xc0cd('0x1e')][_0xc0cd('0x40')]({'name':_0x416275[_0xc0cd('0x22')],'resourceId':_0x416275['id'],'type':_0x1e5fbb[_0xc0cd('0x22')],'sectionId':_0x1e5fbb['id']},{})[_0xc0cd('0x1a')](function(){return _0x169c79;});}else{return _0x169c79;}})[_0xc0cd('0x47')](function(_0xb358f5){logger[_0xc0cd('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb358f5);throw _0xb358f5;});}return _0x169c79;})[_0xc0cd('0x1a')](respondWithResult(_0x20f3a2,0xc9))[_0xc0cd('0x47')](handleError(_0x20f3a2,null));};exports[_0xc0cd('0x48')]=function(_0x4db322,_0x374ba5){if(_0x4db322[_0xc0cd('0x41')]['id']){delete _0x4db322['body']['id'];}return db[_0xc0cd('0x26')][_0xc0cd('0x3f')]({'where':{'id':_0x4db322[_0xc0cd('0x3c')]['id']}})[_0xc0cd('0x1a')](handleEntityNotFound(_0x374ba5,null))['then'](saveUpdates(_0x4db322['body'],null))[_0xc0cd('0x1a')](respondWithResult(_0x374ba5,null))[_0xc0cd('0x47')](handleError(_0x374ba5,null));};exports[_0xc0cd('0x1b')]=function(_0x144c84,_0x4a47aa){return db[_0xc0cd('0x26')]['find']({'where':{'id':_0x144c84[_0xc0cd('0x3c')]['id']}})[_0xc0cd('0x1a')](handleEntityNotFound(_0x4a47aa,null))['then'](removeEntity(_0x4a47aa,null))[_0xc0cd('0x47')](handleError(_0x4a47aa,null));};exports[_0xc0cd('0x49')]=function(_0x264d6c,_0x57bb36,_0x545c42){return db[_0xc0cd('0x26')][_0xc0cd('0x4a')]({'where':{'id':_0x264d6c['params']['id']}})[_0xc0cd('0x1a')](handleEntityNotFound(_0x57bb36,null))[_0xc0cd('0x1a')](function(_0x3e84a4){var _0x2f1ef5;var _0x442284={},_0x3c8f3d={};_0x3c8f3d[_0xc0cd('0x29')]=_[_0xc0cd('0x2b')](db['VoiceMailMessage'][_0xc0cd('0x3d')]);_0x3c8f3d['query']=_[_0xc0cd('0x2b')](_0x264d6c[_0xc0cd('0x2a')]);_0x3c8f3d[_0xc0cd('0x2c')]=_[_0xc0cd('0x2d')](_0x3c8f3d['model'],_0x3c8f3d[_0xc0cd('0x2a')]);_0x442284[_0xc0cd('0x2e')]=_[_0xc0cd('0x2d')](_0x3c8f3d['model'],qs[_0xc0cd('0x2f')](_0x264d6c['query'][_0xc0cd('0x2f')]));_0x442284[_0xc0cd('0x2e')]=_0x442284[_0xc0cd('0x2e')][_0xc0cd('0x30')]?_0x442284['attributes']:_0x3c8f3d[_0xc0cd('0x29')];if(!_0x264d6c['query'][_0xc0cd('0x4b')]('nolimit')){_0x442284[_0xc0cd('0x16')]=qs[_0xc0cd('0x16')](_0x264d6c['query'][_0xc0cd('0x16')]);_0x442284[_0xc0cd('0x15')]=qs['offset'](_0x264d6c[_0xc0cd('0x2a')][_0xc0cd('0x15')]);}_0x442284[_0xc0cd('0x32')]=qs[_0xc0cd('0x4c')](_0x264d6c['query'][_0xc0cd('0x4c')]);_0x442284[_0xc0cd('0x33')]=qs['filters'](_[_0xc0cd('0x34')](_0x264d6c['query'],_0x3c8f3d['filters']));if(_0x264d6c[_0xc0cd('0x2a')]['filter']){_0x442284[_0xc0cd('0x33')]=_[_0xc0cd('0x36')](_0x442284[_0xc0cd('0x33')],{'$or':_['map'](_0x442284[_0xc0cd('0x2e')],function(_0x105754){var _0x27136b={};_0x27136b[_0x105754]={'$like':'%'+_0x264d6c['query'][_0xc0cd('0x35')]+'%'};return _0x27136b;})});}_0x442284[_0xc0cd('0x33')]=_[_0xc0cd('0x36')](_0x442284[_0xc0cd('0x33')],{'mailboxuser':_0x3e84a4[_0xc0cd('0x4d')]});_0x442284=_['merge']({},_0x442284,_0x264d6c[_0xc0cd('0x3e')]);return db['VoiceMailMessage']['findAndCountAll'](_0x442284)[_0xc0cd('0x1a')](respondWithFilteredResult(_0x57bb36,_0x442284));})[_0xc0cd('0x47')](handleError(_0x57bb36,null));};
\ No newline at end of file
index 771bf31..2979161 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3310=['../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','context','lodash','moment','bluebird','path'];(function(_0x434368,_0x35a3cd){var _0x373a31=function(_0x34cdab){while(--_0x34cdab){_0x434368['push'](_0x434368['shift']());}};_0x373a31(++_0x35a3cd);}(_0x3310,0xf8));var _0x0331=function(_0x375598,_0x2d445e){_0x375598=_0x375598-0x0;var _0xcb536f=_0x3310[_0x375598];return _0xcb536f;};'use strict';var _=require(_0x0331('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0331('0x1'));var BPromise=require(_0x0331('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0331('0x3'));var rimraf=require('rimraf');var config=require(_0x0331('0x4'));var attributes=require(_0x0331('0x5'));module[_0x0331('0x6')]=function(_0x11cbfb,_0xed6d8d){return _0x11cbfb[_0x0331('0x7')]('VoiceMail',attributes,{'tableName':_0x0331('0x8'),'paranoid':![],'indexes':[{'name':_0x0331('0x9'),'fields':[_0x0331('0xa'),_0x0331('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f0d=['request-promise','path','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','util','../../config/logger','api','moment','bluebird'];(function(_0x4d5b90,_0x2ae3ab){var _0x5d1364=function(_0x5943d1){while(--_0x5943d1){_0x4d5b90['push'](_0x4d5b90['shift']());}};_0x5d1364(++_0x2ae3ab);}(_0x6f0d,0xeb));var _0xd6f0=function(_0x3d290f,_0x2b422c){_0x3d290f=_0x3d290f-0x0;var _0xaf436c=_0x6f0d[_0x3d290f];return _0xaf436c;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require(_0xd6f0('0x4'));var rp=require(_0xd6f0('0x5'));var fs=require('fs');var path=require(_0xd6f0('0x6'));var rimraf=require('rimraf');var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module[_0xd6f0('0x9')]=function(_0x2af15b,_0xe5cd34){return _0x2af15b['define'](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[{'name':_0xd6f0('0xc'),'fields':[_0xd6f0('0xd'),_0xd6f0('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 4652969..1eadbf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ea=['info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x511f0d,_0x1d7215){var _0x590065=function(_0x1c01ea){while(--_0x1c01ea){_0x511f0d['push'](_0x511f0d['shift']());}};_0x590065(++_0x1d7215);}(_0x54ea,0xba));var _0xa54e=function(_0x2848cc,_0x505792){_0x2848cc=_0x2848cc-0x0;var _0xc1b8e5=_0x54ea[_0x2848cc];return _0xc1b8e5;};'use strict';var _=require(_0xa54e('0x0'));var util=require('util');var moment=require(_0xa54e('0x1'));var BPromise=require(_0xa54e('0x2'));var rs=require(_0xa54e('0x3'));var fs=require('fs');var Redis=require(_0xa54e('0x4'));var db=require(_0xa54e('0x5'))['db'];var utils=require(_0xa54e('0x6'));var logger=require(_0xa54e('0x7'))(_0xa54e('0x8'));var config=require(_0xa54e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa54e('0xa')][_0xa54e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d73fc,_0x2e43ed,_0x5acbbb){return new BPromise(function(_0xafce3b,_0x145dd9){return client['request'](_0x1d73fc,_0x5acbbb)['then'](function(_0x3d9506){logger[_0xa54e('0xc')](_0xa54e('0xd'),_0x2e43ed,_0xa54e('0xe'));logger[_0xa54e('0xf')](_0xa54e('0x10'),_0x2e43ed,'request\x20sent',JSON[_0xa54e('0x11')](_0x3d9506));if(_0x3d9506[_0xa54e('0x12')]){if(_0x3d9506[_0xa54e('0x12')]['code']===0x1f4){logger[_0xa54e('0x12')]('VoiceMail,\x20%s,\x20%s',_0x2e43ed,_0x3d9506[_0xa54e('0x12')][_0xa54e('0x13')]);return _0x145dd9(_0x3d9506[_0xa54e('0x12')][_0xa54e('0x13')]);}logger[_0xa54e('0x12')](_0xa54e('0xd'),_0x2e43ed,_0x3d9506[_0xa54e('0x12')][_0xa54e('0x13')]);return _0xafce3b(_0x3d9506[_0xa54e('0x12')]['message']);}else{logger['info'](_0xa54e('0xd'),_0x2e43ed,'request\x20sent');_0xafce3b(_0x3d9506[_0xa54e('0x14')][_0xa54e('0x13')]);}})[_0xa54e('0x15')](function(_0x10e1f4){logger[_0xa54e('0x12')]('VoiceMail,\x20%s,\x20%s',_0x2e43ed,_0x10e1f4);_0x145dd9(_0x10e1f4);});});}
\ No newline at end of file
+var _0x6d17=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x59ae4f,_0x13d7cf){var _0x31e795=function(_0x25e22c){while(--_0x25e22c){_0x59ae4f['push'](_0x59ae4f['shift']());}};_0x31e795(++_0x13d7cf);}(_0x6d17,0x14e));var _0x76d1=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0x6d17[_0x18b191];return _0x43e146;};'use strict';var _=require(_0x76d1('0x0'));var util=require(_0x76d1('0x1'));var moment=require(_0x76d1('0x2'));var BPromise=require(_0x76d1('0x3'));var rs=require(_0x76d1('0x4'));var fs=require('fs');var Redis=require(_0x76d1('0x5'));var db=require(_0x76d1('0x6'))['db'];var utils=require(_0x76d1('0x7'));var logger=require(_0x76d1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x76d1('0x9'));var client=jayson[_0x76d1('0xa')][_0x76d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cae00,_0x334e82,_0x52371c){return new BPromise(function(_0x68c5,_0x39ba17){return client[_0x76d1('0xc')](_0x5cae00,_0x52371c)[_0x76d1('0xd')](function(_0x254fea){logger[_0x76d1('0xe')](_0x76d1('0xf'),_0x334e82,_0x76d1('0x10'));logger[_0x76d1('0x11')](_0x76d1('0x12'),_0x334e82,_0x76d1('0x10'),JSON['stringify'](_0x254fea));if(_0x254fea[_0x76d1('0x13')]){if(_0x254fea[_0x76d1('0x13')][_0x76d1('0x14')]===0x1f4){logger[_0x76d1('0x13')](_0x76d1('0xf'),_0x334e82,_0x254fea[_0x76d1('0x13')][_0x76d1('0x15')]);return _0x39ba17(_0x254fea[_0x76d1('0x13')][_0x76d1('0x15')]);}logger[_0x76d1('0x13')](_0x76d1('0xf'),_0x334e82,_0x254fea['error'][_0x76d1('0x15')]);return _0x68c5(_0x254fea[_0x76d1('0x13')][_0x76d1('0x15')]);}else{logger[_0x76d1('0xe')](_0x76d1('0xf'),_0x334e82,_0x76d1('0x10'));_0x68c5(_0x254fea[_0x76d1('0x16')][_0x76d1('0x15')]);}})[_0x76d1('0x17')](function(_0x22b4c4){logger[_0x76d1('0x13')]('VoiceMail,\x20%s,\x20%s',_0x334e82,_0x22b4c4);_0x39ba17(_0x22b4c4);});});}
\ No newline at end of file
index 4c72503..8faad68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x2f21f4,_0x5b1cf4){var _0x897dc6=function(_0x1fdbc1){while(--_0x1fdbc1){_0x2f21f4['push'](_0x2f21f4['shift']());}};_0x897dc6(++_0x5b1cf4);}(_0xf494,0x1c6));var _0x4f49=function(_0x529992,_0x5576bd){_0x529992=_0x529992-0x0;var _0x588bc0=_0xf494[_0x529992];return _0x588bc0;};'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 auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xb')]);router[_0x4f49('0x9')](_0x4f49('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4f49('0x9')](_0x4f49('0xd'),auth[_0x4f49('0xa')](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')]('/:id',auth[_0x4f49('0xa')](),controller[_0x4f49('0x12')]);router['delete'](_0x4f49('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f49('0x13')]=router;
\ No newline at end of file
+var _0x9c5a=['get','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated'];(function(_0x1dc222,_0x25bf17){var _0xc55cb1=function(_0x51386f){while(--_0x51386f){_0x1dc222['push'](_0x1dc222['shift']());}};_0xc55cb1(++_0x25bf17);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x115fe1,_0x1cc16c){_0x115fe1=_0x115fe1-0x0;var _0x551882=_0x9c5a[_0x115fe1];return _0x551882;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa9c5('0x9')](_0xa9c5('0xb'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0xd')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa9c5('0x10')]);router[_0xa9c5('0x11')](_0xa9c5('0xa'),auth[_0xa9c5('0x8')](),controller[_0xa9c5('0x12')]);module[_0xa9c5('0x13')]=router;
\ No newline at end of file
index 9884e98..fa14029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63cb=['TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','long'];(function(_0x5b0aca,_0x2818c4){var _0x87a603=function(_0x1a46a4){while(--_0x1a46a4){_0x5b0aca['push'](_0x5b0aca['shift']());}};_0x87a603(++_0x2818c4);}(_0x63cb,0xfd));var _0xb63c=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x63cb[_0xe73080];return _0x12cbc4;};'use strict';var Sequelize=require(_0xb63c('0x0'));module[_0xb63c('0x1')]={'name':{'type':Sequelize[_0xb63c('0x2')],'get':function(_0x1eec1b){return this[_0xb63c('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xb63c('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':''},'stamp':{'type':_0xb63c('0x6'),'allowNull':![]}};
\ No newline at end of file
+var _0x35c8=['STRING','BLOB','long','TIMESTAMP','sequelize','exports','getDataValue'];(function(_0x49b8c0,_0x1afa25){var _0x58c608=function(_0x40409b){while(--_0x40409b){_0x49b8c0['push'](_0x49b8c0['shift']());}};_0x58c608(++_0x1afa25);}(_0x35c8,0x154));var _0x835c=function(_0x18a779,_0x15dd46){_0x18a779=_0x18a779-0x0;var _0x2ed1bd=_0x35c8[_0x18a779];return _0x2ed1bd;};'use strict';var Sequelize=require(_0x835c('0x0'));module[_0x835c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x27bd95){return this[_0x835c('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x835c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x835c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x835c('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x835c('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x835c('0x4')](_0x835c('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x835c('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x835c('0x3')],'defaultValue':''},'stamp':{'type':_0x835c('0x6'),'allowNull':![]}};
\ No newline at end of file
index 6072945..f163244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96cc=['fields','length','nolimit','offset','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','download','recording','msg_id','Sequelize','ValidationError','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','attributes','intersection'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x96cc,0x16c));var _0xc96c=function(_0x39c8f2,_0x23df6c){_0x39c8f2=_0x39c8f2-0x0;var _0x445526=_0x96cc[_0x39c8f2];return _0x445526;};'use strict';var pdf=require(_0xc96c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc96c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc96c('0x2'));var rp=require(_0xc96c('0x3'));var moment=require(_0xc96c('0x4'));var BPromise=require(_0xc96c('0x5'));var Mustache=require(_0xc96c('0x6'));var util=require(_0xc96c('0x7'));var path=require(_0xc96c('0x8'));var sox=require(_0xc96c('0x9'));var csv=require(_0xc96c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0xa'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var db=require(_0xc96c('0x17'))['db'];function respondWithStatusCode(_0x3ef47a,_0x246a95){_0x246a95=_0x246a95||0xcc;return function(_0x5f27f3){if(_0x5f27f3){return _0x3ef47a[_0xc96c('0x18')](_0x246a95);}return _0x3ef47a[_0xc96c('0x19')](_0x246a95)[_0xc96c('0x1a')]();};}function respondWithResult(_0x3f65fd,_0x48de8d){_0x48de8d=_0x48de8d||0xc8;return function(_0x35da94){if(_0x35da94){return _0x3f65fd[_0xc96c('0x19')](_0x48de8d)[_0xc96c('0x1b')](_0x35da94);}};}function respondWithFilteredResult(_0x32e640,_0x377dbc){return function(_0x46455a){if(_0x46455a){var _0x1765d9=_0x46455a[_0xc96c('0x1c')],_0x23e357=_0x377dbc['offset'],_0x174852=_0x377dbc['offset']+_0x377dbc[_0xc96c('0x1d')],_0x4248c9;if(_0x174852>=_0x1765d9){_0x174852=_0x1765d9;_0x4248c9=0xc8;}else{_0x4248c9=0xce;}_0x32e640[_0xc96c('0x19')](_0x4248c9);return _0x32e640[_0xc96c('0x1e')](_0xc96c('0x1f'),_0x23e357+'-'+_0x174852+'/'+_0x1765d9)['json'](_0x46455a);}return null;};}function patchUpdates(_0x2c4c83){return function(_0x100fdb){try{jsonpatch[_0xc96c('0x20')](_0x100fdb,_0x2c4c83,!![]);}catch(_0x3c0864){return BPromise[_0xc96c('0x21')](_0x3c0864);}return _0x100fdb[_0xc96c('0x22')]();};}function saveUpdates(_0x43cc22,_0x41daba){return function(_0x28d762){if(_0x28d762){return _0x28d762[_0xc96c('0x23')](_0x43cc22)[_0xc96c('0x24')](function(_0x1203a1){return _0x1203a1;});}return null;};}function removeEntity(_0x3f9603,_0x45edee){return function(_0x325c54){if(_0x325c54){return _0x325c54[_0xc96c('0x25')]()[_0xc96c('0x24')](function(){_0x3f9603['status'](0xcc)[_0xc96c('0x1a')]();});}};}function handleEntityNotFound(_0x4be783,_0x4456bf){return function(_0x10ae21){if(!_0x10ae21){_0x4be783[_0xc96c('0x18')](0x194);}return _0x10ae21;};}function handleError(_0x35f480,_0x40f23d){_0x40f23d=_0x40f23d||0x1f4;return function(_0x415d33){logger[_0xc96c('0x26')](_0x415d33[_0xc96c('0x27')]);if(_0x415d33['name']){delete _0x415d33[_0xc96c('0x28')];}_0x35f480[_0xc96c('0x19')](_0x40f23d)[_0xc96c('0x29')](_0x415d33);};}exports[_0xc96c('0x2a')]=function(_0x58fab3,_0x5c00b6){var _0x39c191={},_0x12c293={},_0x3ef02c={'count':0x0,'rows':[]};var _0x1ef845=_[_0xc96c('0x2b')](db[_0xc96c('0x2c')][_0xc96c('0x2d')],function(_0x1c911b){return{'name':_0x1c911b[_0xc96c('0x2e')],'type':_0x1c911b[_0xc96c('0x2f')][_0xc96c('0x30')]};});_0x12c293[_0xc96c('0x31')]=_[_0xc96c('0x32')](_[_0xc96c('0x2b')](_0x1ef845,'name'),[_0xc96c('0x28')]);_0x12c293['query']=_[_0xc96c('0x33')](_0x58fab3[_0xc96c('0x34')]);_0x12c293[_0xc96c('0x35')]=_['intersection'](_0x12c293[_0xc96c('0x31')],_0x12c293[_0xc96c('0x34')]);_0x39c191[_0xc96c('0x36')]=_[_0xc96c('0x37')](_0x12c293['model'],qs['fields'](_0x58fab3[_0xc96c('0x34')][_0xc96c('0x38')]));_0x39c191[_0xc96c('0x36')]=_0x39c191['attributes'][_0xc96c('0x39')]?_0x39c191[_0xc96c('0x36')]:_0x12c293[_0xc96c('0x31')];if(!_0x58fab3[_0xc96c('0x34')]['hasOwnProperty'](_0xc96c('0x3a'))){_0x39c191[_0xc96c('0x1d')]=qs['limit'](_0x58fab3[_0xc96c('0x34')][_0xc96c('0x1d')]);_0x39c191[_0xc96c('0x3b')]=qs[_0xc96c('0x3b')](_0x58fab3[_0xc96c('0x34')][_0xc96c('0x3b')]);}_0x39c191['order']=qs[_0xc96c('0x3c')](_0x58fab3[_0xc96c('0x34')][_0xc96c('0x3c')]);_0x39c191[_0xc96c('0x3d')]=qs[_0xc96c('0x35')](_[_0xc96c('0x3e')](_0x58fab3['query'],_0x12c293['filters']),_0x1ef845);if(_0x58fab3[_0xc96c('0x34')][_0xc96c('0x3f')]){_0x39c191['where']=_['merge'](_0x39c191[_0xc96c('0x3d')],{'$or':_[_0xc96c('0x2b')](_0x1ef845,function(_0x2eedc4){if(_0x2eedc4[_0xc96c('0x2f')]!==_0xc96c('0x40')){var _0x298331={};_0x298331[_0x2eedc4[_0xc96c('0x28')]]={'$like':'%'+_0x58fab3[_0xc96c('0x34')][_0xc96c('0x3f')]+'%'};return _0x298331;}})});}_0x39c191=_[_0xc96c('0x41')]({},_0x39c191,_0x58fab3[_0xc96c('0x42')]);var _0x5ed343={'where':_0x39c191[_0xc96c('0x3d')]};return db[_0xc96c('0x2c')][_0xc96c('0x1c')](_0x5ed343)[_0xc96c('0x24')](function(_0x4eb180){_0x3ef02c[_0xc96c('0x1c')]=_0x4eb180;if(_0x58fab3[_0xc96c('0x34')][_0xc96c('0x43')]){_0x39c191['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xc96c('0x44')](_0x39c191);})[_0xc96c('0x24')](function(_0x2e3bc3){_0x3ef02c['rows']=_0x2e3bc3;return _0x3ef02c;})[_0xc96c('0x24')](respondWithFilteredResult(_0x5c00b6,_0x39c191))[_0xc96c('0x45')](handleError(_0x5c00b6,null));};exports[_0xc96c('0x46')]=function(_0x2a8ea7,_0x1790a8){var _0x8a0009={'raw':!![],'where':{'id':_0x2a8ea7[_0xc96c('0x47')]['id']}},_0x21aec1={};_0x21aec1[_0xc96c('0x31')]=_['keys'](db['VoiceMailMessage'][_0xc96c('0x2d')]);_0x21aec1[_0xc96c('0x34')]=_[_0xc96c('0x33')](_0x2a8ea7[_0xc96c('0x34')]);_0x21aec1['filters']=_['intersection'](_0x21aec1[_0xc96c('0x31')],_0x21aec1[_0xc96c('0x34')]);_0x8a0009[_0xc96c('0x36')]=_[_0xc96c('0x37')](_0x21aec1[_0xc96c('0x31')],qs[_0xc96c('0x38')](_0x2a8ea7[_0xc96c('0x34')]['fields']));_0x8a0009[_0xc96c('0x36')]=_0x8a0009[_0xc96c('0x36')][_0xc96c('0x39')]?_0x8a0009[_0xc96c('0x36')]:_0x21aec1['model'];if(_0x2a8ea7['query'][_0xc96c('0x43')]){_0x8a0009[_0xc96c('0x48')]=[{'all':!![]}];}_0x8a0009=_[_0xc96c('0x41')]({},_0x8a0009,_0x2a8ea7[_0xc96c('0x42')]);return db[_0xc96c('0x2c')][_0xc96c('0x49')](_0x8a0009)[_0xc96c('0x24')](handleEntityNotFound(_0x1790a8,null))[_0xc96c('0x24')](respondWithResult(_0x1790a8,null))[_0xc96c('0x45')](handleError(_0x1790a8,null));};exports[_0xc96c('0x4a')]=function(_0x2257ab,_0x152397){return db[_0xc96c('0x2c')]['create'](_0x2257ab[_0xc96c('0x4b')],{})[_0xc96c('0x24')](respondWithResult(_0x152397,0xc9))[_0xc96c('0x45')](handleError(_0x152397,null));};exports[_0xc96c('0x23')]=function(_0x56bce1,_0x26f629){if(_0x56bce1['body']['id']){delete _0x56bce1[_0xc96c('0x4b')]['id'];}return db[_0xc96c('0x2c')]['find']({'where':{'id':_0x56bce1[_0xc96c('0x47')]['id']}})[_0xc96c('0x24')](handleEntityNotFound(_0x26f629,null))[_0xc96c('0x24')](saveUpdates(_0x56bce1[_0xc96c('0x4b')],null))[_0xc96c('0x24')](respondWithResult(_0x26f629,null))[_0xc96c('0x45')](handleError(_0x26f629,null));};exports['destroy']=function(_0x5a1989,_0x557511){return db[_0xc96c('0x2c')]['find']({'where':{'id':_0x5a1989[_0xc96c('0x47')]['id']}})[_0xc96c('0x24')](handleEntityNotFound(_0x557511,null))[_0xc96c('0x24')](removeEntity(_0x557511,null))[_0xc96c('0x45')](handleError(_0x557511,null));};exports[_0xc96c('0x4c')]=function(_0x1ffc56,_0x456dbc,_0x2a7687){return db[_0xc96c('0x2c')][_0xc96c('0x49')]({'where':{'id':_0x1ffc56['params']['id']},'attributes':['id',_0xc96c('0x4d'),_0xc96c('0x4e')]})[_0xc96c('0x24')](handleEntityNotFound(_0x456dbc,null))[_0xc96c('0x24')](function(_0x1c7ea7){if(_0x1c7ea7){if(!_0x1c7ea7[_0xc96c('0x4d')]){throw new db[(_0xc96c('0x4f'))][(_0xc96c('0x50'))]('VoiceMailMessage\x20not\x20found');}var _0x4c15e3={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x1c7ea7[_0xc96c('0x4e')]){_0x4c15e3[_0xc96c('0x51')]=_0xc96c('0x52')+_0x1c7ea7[_0xc96c('0x4e')]+_0xc96c('0x53');}_0x456dbc[_0xc96c('0x1e')](_0x4c15e3);return _0x456dbc[_0xc96c('0x29')](new Buffer(_0x1c7ea7['recording']));}})[_0xc96c('0x45')](handleError(_0x456dbc,null));};
\ No newline at end of file
+var _0x693f=['mustache','util','path','sox','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','download','msg_id','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x20e06e,_0x15a44a){var _0x2b2387=function(_0x590bc5){while(--_0x590bc5){_0x20e06e['push'](_0x20e06e['shift']());}};_0x2b2387(++_0x15a44a);}(_0x693f,0x9d));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xf693('0x0'));var emlformat=require(_0xf693('0x1'));var rimraf=require(_0xf693('0x2'));var zipdir=require(_0xf693('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf693('0x4'));var moment=require(_0xf693('0x5'));var BPromise=require(_0xf693('0x6'));var Mustache=require(_0xf693('0x7'));var util=require(_0xf693('0x8'));var path=require(_0xf693('0x9'));var sox=require(_0xf693('0xa'));var csv=require('to-csv');var ejs=require(_0xf693('0xb'));var fs=require('fs');var _=require(_0xf693('0xc'));var squel=require('squel');var crypto=require(_0xf693('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf693('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf693('0xf'));var Papa=require(_0xf693('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf693('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf693('0x12'))(_0xf693('0x13'));var utils=require(_0xf693('0x14'));var config=require(_0xf693('0x15'));var db=require(_0xf693('0x16'))['db'];function respondWithStatusCode(_0x5a5a35,_0x5d0d4c){_0x5d0d4c=_0x5d0d4c||0xcc;return function(_0xd08be1){if(_0xd08be1){return _0x5a5a35[_0xf693('0x17')](_0x5d0d4c);}return _0x5a5a35['status'](_0x5d0d4c)[_0xf693('0x18')]();};}function respondWithResult(_0x1bfd8d,_0x5a5f86){_0x5a5f86=_0x5a5f86||0xc8;return function(_0x5c42f0){if(_0x5c42f0){return _0x1bfd8d[_0xf693('0x19')](_0x5a5f86)[_0xf693('0x1a')](_0x5c42f0);}};}function respondWithFilteredResult(_0xbd92c6,_0x208f32){return function(_0x36d92c){if(_0x36d92c){var _0x5541a7=_0x36d92c[_0xf693('0x1b')],_0x1d9278=_0x208f32[_0xf693('0x1c')],_0x1c0dfc=_0x208f32[_0xf693('0x1c')]+_0x208f32['limit'],_0x3c8084;if(_0x1c0dfc>=_0x5541a7){_0x1c0dfc=_0x5541a7;_0x3c8084=0xc8;}else{_0x3c8084=0xce;}_0xbd92c6['status'](_0x3c8084);return _0xbd92c6['set'](_0xf693('0x1d'),_0x1d9278+'-'+_0x1c0dfc+'/'+_0x5541a7)[_0xf693('0x1a')](_0x36d92c);}return null;};}function patchUpdates(_0x3f4d4d){return function(_0x4543a1){try{jsonpatch[_0xf693('0x1e')](_0x4543a1,_0x3f4d4d,!![]);}catch(_0x58f0f0){return BPromise[_0xf693('0x1f')](_0x58f0f0);}return _0x4543a1[_0xf693('0x20')]();};}function saveUpdates(_0x5f89c8,_0x31b887){return function(_0x1d20fc){if(_0x1d20fc){return _0x1d20fc[_0xf693('0x21')](_0x5f89c8)[_0xf693('0x22')](function(_0x38f209){return _0x38f209;});}return null;};}function removeEntity(_0x50b20e,_0x505ada){return function(_0x1188c6){if(_0x1188c6){return _0x1188c6[_0xf693('0x23')]()[_0xf693('0x22')](function(){_0x50b20e[_0xf693('0x19')](0xcc)[_0xf693('0x18')]();});}};}function handleEntityNotFound(_0x200c95,_0x5407f5){return function(_0x179e25){if(!_0x179e25){_0x200c95[_0xf693('0x17')](0x194);}return _0x179e25;};}function handleError(_0xc5c088,_0x414a3f){_0x414a3f=_0x414a3f||0x1f4;return function(_0x4840e2){logger[_0xf693('0x24')](_0x4840e2[_0xf693('0x25')]);if(_0x4840e2[_0xf693('0x26')]){delete _0x4840e2[_0xf693('0x26')];}_0xc5c088[_0xf693('0x19')](_0x414a3f)[_0xf693('0x27')](_0x4840e2);};}exports[_0xf693('0x28')]=function(_0x423cda,_0x3b3bfc){var _0x1b5f98={},_0x4ca818={},_0x79c2b9={'count':0x0,'rows':[]};var _0xaccce0=_[_0xf693('0x29')](db[_0xf693('0x2a')][_0xf693('0x2b')],function(_0x7fdc22){return{'name':_0x7fdc22[_0xf693('0x2c')],'type':_0x7fdc22[_0xf693('0x2d')]['key']};});_0x4ca818[_0xf693('0x2e')]=_[_0xf693('0x2f')](_[_0xf693('0x29')](_0xaccce0,_0xf693('0x26')),['name']);_0x4ca818['query']=_[_0xf693('0x30')](_0x423cda[_0xf693('0x31')]);_0x4ca818['filters']=_[_0xf693('0x32')](_0x4ca818[_0xf693('0x2e')],_0x4ca818[_0xf693('0x31')]);_0x1b5f98[_0xf693('0x33')]=_['intersection'](_0x4ca818[_0xf693('0x2e')],qs[_0xf693('0x34')](_0x423cda[_0xf693('0x31')][_0xf693('0x34')]));_0x1b5f98[_0xf693('0x33')]=_0x1b5f98[_0xf693('0x33')][_0xf693('0x35')]?_0x1b5f98[_0xf693('0x33')]:_0x4ca818['model'];if(!_0x423cda[_0xf693('0x31')][_0xf693('0x36')](_0xf693('0x37'))){_0x1b5f98[_0xf693('0x38')]=qs[_0xf693('0x38')](_0x423cda[_0xf693('0x31')]['limit']);_0x1b5f98['offset']=qs[_0xf693('0x1c')](_0x423cda[_0xf693('0x31')][_0xf693('0x1c')]);}_0x1b5f98['order']=qs[_0xf693('0x39')](_0x423cda[_0xf693('0x31')][_0xf693('0x39')]);_0x1b5f98[_0xf693('0x3a')]=qs[_0xf693('0x3b')](_['pick'](_0x423cda[_0xf693('0x31')],_0x4ca818[_0xf693('0x3b')]),_0xaccce0);if(_0x423cda[_0xf693('0x31')]['filter']){_0x1b5f98[_0xf693('0x3a')]=_['merge'](_0x1b5f98[_0xf693('0x3a')],{'$or':_[_0xf693('0x29')](_0xaccce0,function(_0x1ec098){if(_0x1ec098[_0xf693('0x2d')]!==_0xf693('0x3c')){var _0x5a5580={};_0x5a5580[_0x1ec098[_0xf693('0x26')]]={'$like':'%'+_0x423cda[_0xf693('0x31')][_0xf693('0x3d')]+'%'};return _0x5a5580;}})});}_0x1b5f98=_[_0xf693('0x3e')]({},_0x1b5f98,_0x423cda[_0xf693('0x3f')]);var _0x24c5d4={'where':_0x1b5f98[_0xf693('0x3a')]};return db[_0xf693('0x2a')][_0xf693('0x1b')](_0x24c5d4)['then'](function(_0x244b29){_0x79c2b9['count']=_0x244b29;if(_0x423cda['query'][_0xf693('0x40')]){_0x1b5f98[_0xf693('0x41')]=[{'all':!![]}];}return db[_0xf693('0x2a')]['findAll'](_0x1b5f98);})[_0xf693('0x22')](function(_0x51ef9a){_0x79c2b9[_0xf693('0x42')]=_0x51ef9a;return _0x79c2b9;})['then'](respondWithFilteredResult(_0x3b3bfc,_0x1b5f98))[_0xf693('0x43')](handleError(_0x3b3bfc,null));};exports[_0xf693('0x44')]=function(_0x3391e7,_0xb597a8){var _0x307bdf={'raw':!![],'where':{'id':_0x3391e7['params']['id']}},_0x47bc1b={};_0x47bc1b['model']=_['keys'](db[_0xf693('0x2a')][_0xf693('0x2b')]);_0x47bc1b['query']=_['keys'](_0x3391e7['query']);_0x47bc1b[_0xf693('0x3b')]=_[_0xf693('0x32')](_0x47bc1b[_0xf693('0x2e')],_0x47bc1b[_0xf693('0x31')]);_0x307bdf['attributes']=_[_0xf693('0x32')](_0x47bc1b[_0xf693('0x2e')],qs[_0xf693('0x34')](_0x3391e7['query'][_0xf693('0x34')]));_0x307bdf[_0xf693('0x33')]=_0x307bdf['attributes'][_0xf693('0x35')]?_0x307bdf[_0xf693('0x33')]:_0x47bc1b['model'];if(_0x3391e7[_0xf693('0x31')][_0xf693('0x40')]){_0x307bdf['include']=[{'all':!![]}];}_0x307bdf=_[_0xf693('0x3e')]({},_0x307bdf,_0x3391e7[_0xf693('0x3f')]);return db[_0xf693('0x2a')][_0xf693('0x45')](_0x307bdf)['then'](handleEntityNotFound(_0xb597a8,null))[_0xf693('0x22')](respondWithResult(_0xb597a8,null))[_0xf693('0x43')](handleError(_0xb597a8,null));};exports[_0xf693('0x46')]=function(_0x1a1efa,_0x2ceb64){return db[_0xf693('0x2a')]['create'](_0x1a1efa[_0xf693('0x47')],{})[_0xf693('0x22')](respondWithResult(_0x2ceb64,0xc9))[_0xf693('0x43')](handleError(_0x2ceb64,null));};exports[_0xf693('0x21')]=function(_0x16dd1b,_0x4f0e31){if(_0x16dd1b[_0xf693('0x47')]['id']){delete _0x16dd1b[_0xf693('0x47')]['id'];}return db['VoiceMailMessage'][_0xf693('0x45')]({'where':{'id':_0x16dd1b['params']['id']}})['then'](handleEntityNotFound(_0x4f0e31,null))['then'](saveUpdates(_0x16dd1b[_0xf693('0x47')],null))[_0xf693('0x22')](respondWithResult(_0x4f0e31,null))[_0xf693('0x43')](handleError(_0x4f0e31,null));};exports[_0xf693('0x23')]=function(_0x4c5beb,_0x4f01ae){return db[_0xf693('0x2a')]['find']({'where':{'id':_0x4c5beb[_0xf693('0x48')]['id']}})[_0xf693('0x22')](handleEntityNotFound(_0x4f01ae,null))[_0xf693('0x22')](removeEntity(_0x4f01ae,null))['catch'](handleError(_0x4f01ae,null));};exports[_0xf693('0x49')]=function(_0x3e9bf4,_0x43cf4f,_0x393555){return db[_0xf693('0x2a')][_0xf693('0x45')]({'where':{'id':_0x3e9bf4['params']['id']},'attributes':['id','recording',_0xf693('0x4a')]})['then'](handleEntityNotFound(_0x43cf4f,null))['then'](function(_0x3bd401){if(_0x3bd401){if(!_0x3bd401[_0xf693('0x4b')]){throw new db['Sequelize'][(_0xf693('0x4c'))](_0xf693('0x4d'));}var _0x2e08d2={'Content-Type':_0xf693('0x4e'),'Content-Disposition':'attachment'};if(_0x3bd401['msg_id']){_0x2e08d2[_0xf693('0x4f')]=_0xf693('0x50')+_0x3bd401[_0xf693('0x4a')]+_0xf693('0x51');}_0x43cf4f['set'](_0x2e08d2);return _0x43cf4f[_0xf693('0x27')](new Buffer(_0x3bd401[_0xf693('0x4b')]));}})['catch'](handleError(_0x43cf4f,null));};
\ No newline at end of file
index 5bf7066..a70ba06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0e9=['request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','../../config/logger','api','moment','bluebird'];(function(_0x44ad4e,_0x5a6ce7){var _0x536ca8=function(_0x51d0cf){while(--_0x51d0cf){_0x44ad4e['push'](_0x44ad4e['shift']());}};_0x536ca8(++_0x5a6ce7);}(_0xa0e9,0x170));var _0x9a0e=function(_0x6b8c30,_0x41e61a){_0x6b8c30=_0x6b8c30-0x0;var _0x2dd085=_0xa0e9[_0x6b8c30];return _0x2dd085;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a0e('0x0'))(_0x9a0e('0x1'));var moment=require(_0x9a0e('0x2'));var BPromise=require(_0x9a0e('0x3'));var rp=require(_0x9a0e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a0e('0x5'));var config=require(_0x9a0e('0x6'));var attributes=require(_0x9a0e('0x7'));module[_0x9a0e('0x8')]=function(_0x1f9cfa,_0x31d059){return _0x1f9cfa[_0x9a0e('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x9a0e('0xa'),'paranoid':![],'indexes':[{'name':_0x9a0e('0xb'),'fields':[_0x9a0e('0xb')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x33c3=['bluebird','request-promise','path','rimraf','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','moment'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0x33c3,0xd4));var _0x333c=function(_0x6f40c,_0x5b0329){_0x6f40c=_0x6f40c-0x0;var _0x2a29d8=_0x33c3[_0x6f40c];return _0x2a29d8;};'use strict';var _=require(_0x333c('0x0'));var util=require(_0x333c('0x1'));var logger=require(_0x333c('0x2'))('api');var moment=require(_0x333c('0x3'));var BPromise=require(_0x333c('0x4'));var rp=require(_0x333c('0x5'));var fs=require('fs');var path=require(_0x333c('0x6'));var rimraf=require(_0x333c('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x333c('0x8')]=function(_0x2b9d0d,_0x5d6e22){return _0x2b9d0d[_0x333c('0x9')](_0x333c('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x333c('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index 713b8c1..d9b10d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x1967,0x173));var _0x7196=function(_0x175b82,_0x499028){_0x175b82=_0x175b82-0x0;var _0x200af4=_0x1967[_0x175b82];return _0x200af4;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1a25a5,_0xcbd392){var _0x211f6b=function(_0x228cb2){while(--_0x228cb2){_0x1a25a5['push'](_0x1a25a5['shift']());}};_0x211f6b(++_0xcbd392);}(_0xdb28,0x106));var _0x8db2=function(_0x45d78e,_0x2ed1ae){_0x45d78e=_0x45d78e-0x0;var _0x2daf38=_0xdb28[_0x45d78e];return _0x2daf38;};'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')]('VoiceMailMessage,\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
index 1c8e81c..01f17bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x211e=['create','addSound','put','delete','/:id/sounds/:id2','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/sounds','isAuthenticated','getSounds','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x211e,0x1e6));var _0xe211=function(_0x219ab5,_0x143062){_0x219ab5=_0x219ab5-0x0;var _0x55704f=_0x211e[_0x219ab5];return _0x55704f;};'use strict';var multer=require(_0xe211('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe211('0x1'));var express=require(_0xe211('0x2'));var router=express[_0xe211('0x3')]();var auth=require(_0xe211('0x4'));var interaction=require(_0xe211('0x5'));var config=require(_0xe211('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xe211('0x7')]('/',auth['isAuthenticated'](),controller[_0xe211('0x8')]);router[_0xe211('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe211('0x9')]);router[_0xe211('0x7')](_0xe211('0xa'),auth[_0xe211('0xb')](),controller[_0xe211('0xc')]);router[_0xe211('0xd')]('/',auth[_0xe211('0xb')](),controller[_0xe211('0xe')]);router[_0xe211('0xd')](_0xe211('0xa'),auth['isAuthenticated'](),controller[_0xe211('0xf')]);router[_0xe211('0x10')]('/:id',auth[_0xe211('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xe211('0x11')](_0xe211('0x12'),auth[_0xe211('0xb')](),controller['removeSound']);module[_0xe211('0x13')]=router;
\ No newline at end of file
+var _0xab7e=['create','put','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/sounds','getSounds','post'];(function(_0x28de57,_0x464fdb){var _0x3252f6=function(_0x159f83){while(--_0x159f83){_0x28de57['push'](_0x28de57['shift']());}};_0x3252f6(++_0x464fdb);}(_0xab7e,0x11b));var _0xeab7=function(_0x3b0f6f,_0x2931e4){_0x3b0f6f=_0x3b0f6f-0x0;var _0x2739a1=_0xab7e[_0x3b0f6f];return _0x2739a1;};'use strict';var multer=require(_0xeab7('0x0'));var util=require(_0xeab7('0x1'));var path=require(_0xeab7('0x2'));var timeout=require('connect-timeout');var express=require(_0xeab7('0x3'));var router=express[_0xeab7('0x4')]();var auth=require(_0xeab7('0x5'));var interaction=require(_0xeab7('0x6'));var config=require(_0xeab7('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0xeab7('0x8')]('/',auth['isAuthenticated'](),controller[_0xeab7('0x9')]);router[_0xeab7('0x8')](_0xeab7('0xa'),auth[_0xeab7('0xb')](),controller[_0xeab7('0xc')]);router[_0xeab7('0x8')](_0xeab7('0xd'),auth['isAuthenticated'](),controller[_0xeab7('0xe')]);router[_0xeab7('0xf')]('/',auth[_0xeab7('0xb')](),controller[_0xeab7('0x10')]);router[_0xeab7('0xf')](_0xeab7('0xd'),auth[_0xeab7('0xb')](),controller['addSound']);router[_0xeab7('0x11')](_0xeab7('0xa'),auth['isAuthenticated'](),controller[_0xeab7('0x12')]);router[_0xeab7('0x13')]('/:id',auth[_0xeab7('0xb')](),controller[_0xeab7('0x14')]);router[_0xeab7('0x13')](_0xeab7('0x15'),auth['isAuthenticated'](),controller['removeSound']);module[_0xeab7('0x16')]=router;
\ No newline at end of file
index 7fc2256..4938338 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x376c=['custom','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','ENUM'];(function(_0xc34e78,_0x19638f){var _0x205de5=function(_0x41dcfd){while(--_0x41dcfd){_0xc34e78['push'](_0xc34e78['shift']());}};_0x205de5(++_0x19638f);}(_0x376c,0xce));var _0xc376=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x376c[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xc376('0x0'));module[_0xc376('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc376('0x2')},'mode':{'type':Sequelize[_0xc376('0x3')](_0xc376('0x4'),_0xc376('0x5'),_0xc376('0x6'),_0xc376('0x7'),_0xc376('0x8'),_0xc376('0x9')),'allowNull':!![],'defaultValue':_0xc376('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xc376('0xa')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xc376('0xa')],'allowNull':!![],'defaultValue':_0xc376('0xb')},'format':{'type':Sequelize[_0xc376('0xa')],'allowNull':!![]},'stamp':{'type':_0xc376('0xc')},'defaultEntry':{'type':Sequelize[_0xc376('0xd')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3af2=['custom','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3af2,0xef));var _0x23af=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0x3af2[_0x18f152];return _0xa10b34;};'use strict';var Sequelize=require(_0x23af('0x0'));module['exports']={'name':{'type':Sequelize[_0x23af('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x23af('0x2')](_0x23af('0x3'),_0x23af('0x4'),_0x23af('0x5'),_0x23af('0x6'),_0x23af('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x23af('0x4')},'directory':{'type':Sequelize[_0x23af('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x23af('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x23af('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x23af('0x8')},'format':{'type':Sequelize[_0x23af('0x1')],'allowNull':!![]},'stamp':{'type':_0x23af('0x9')},'defaultEntry':{'type':Sequelize[_0x23af('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index dd52155..6c89a6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['getSounds','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','MusicOnHolds','UserProfileResource','then','end','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','body','catch','transaction','mode','directory','server/files/moh','create','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','sequelize','readdirSync','forEach','unlinkSync','join','rmdirSync','message','addSound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','Sequelize','ValidationError','removeSound','id2','Sound'];(function(_0x5ea1c6,_0x1fe324){var _0x18f0d0=function(_0x2f3677){while(--_0x2f3677){_0x5ea1c6['push'](_0x5ea1c6['shift']());}};_0x18f0d0(++_0x1fe324);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4234be,_0x4c4fca){_0x4234be=_0x4234be-0x0;var _0x33ec61=_0x5f2f[_0x4234be];return _0x33ec61;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){var _0x21cd91=_0x39c024[_0xf5f2('0x24')]({'plain':!![]});var _0x4e8bda=_0xf5f2('0x25');return db[_0xf5f2('0x26')]['destroy']({'where':{'type':_0x4e8bda,'resourceId':_0x21cd91['id']}})['then'](function(){return _0x39c024;});})[_0xf5f2('0x27')](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x28')]();});}};}function handleEntityNotFound(_0x1a5bb3,_0xf6c58d){return function(_0x788a8d){if(!_0x788a8d){_0x1a5bb3[_0xf5f2('0x17')](0x194);}return _0x788a8d;};}function handleError(_0x281ec8,_0x294414){_0x294414=_0x294414||0x1f4;return function(_0x4ab014){logger[_0xf5f2('0x29')](_0x4ab014[_0xf5f2('0x2a')]);if(_0x4ab014[_0xf5f2('0x2b')]){delete _0x4ab014[_0xf5f2('0x2b')];}_0x281ec8[_0xf5f2('0x18')](_0x294414)[_0xf5f2('0x2c')](_0x4ab014);};}exports['index']=function(_0x53cb96,_0x22c826){var _0x14c829={},_0x11c771={},_0x5027ab={'count':0x0,'rows':[]};var _0x5a2c7e=_[_0xf5f2('0x2d')](db[_0xf5f2('0x2e')][_0xf5f2('0x2f')],function(_0x153924){return{'name':_0x153924[_0xf5f2('0x30')],'type':_0x153924['type']['key']};});_0x11c771[_0xf5f2('0x31')]=_['map'](_0x5a2c7e,_0xf5f2('0x2b'));_0x11c771['query']=_[_0xf5f2('0x32')](_0x53cb96[_0xf5f2('0x33')]);_0x11c771[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x11c771[_0xf5f2('0x31')],_0x11c771[_0xf5f2('0x33')]);_0x14c829[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x11c771['model'],qs[_0xf5f2('0x37')](_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x37')]));_0x14c829[_0xf5f2('0x36')]=_0x14c829[_0xf5f2('0x36')][_0xf5f2('0x38')]?_0x14c829[_0xf5f2('0x36')]:_0x11c771['model'];if(!_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x39')]('nolimit')){_0x14c829[_0xf5f2('0x1c')]=qs['limit'](_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x1c')]);_0x14c829[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x53cb96['query']['offset']);}_0x14c829[_0xf5f2('0x3a')]=qs[_0xf5f2('0x3b')](_0x53cb96[_0xf5f2('0x33')]['sort']);_0x14c829[_0xf5f2('0x3c')]=qs['filters'](_[_0xf5f2('0x3d')](_0x53cb96['query'],_0x11c771[_0xf5f2('0x34')]),_0x5a2c7e);if(_0x53cb96[_0xf5f2('0x33')]['filter']){_0x14c829[_0xf5f2('0x3c')]=_[_0xf5f2('0x3e')](_0x14c829[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x2d')](_0x5a2c7e,function(_0x542cd6){if(_0x542cd6['type']!==_0xf5f2('0x3f')){var _0x140a11={};_0x140a11[_0x542cd6[_0xf5f2('0x2b')]]={'$like':'%'+_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x40')]+'%'};return _0x140a11;}})});}_0x14c829=_[_0xf5f2('0x3e')]({},_0x14c829,_0x53cb96[_0xf5f2('0x41')]);var _0x4c0ac7={'where':_0x14c829[_0xf5f2('0x3c')]};return db[_0xf5f2('0x2e')]['count'](_0x4c0ac7)[_0xf5f2('0x27')](function(_0x3f3895){_0x5027ab[_0xf5f2('0x1a')]=_0x3f3895;if(_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x42')]){_0x14c829[_0xf5f2('0x43')]=[{'all':!![]}];}return db[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0x14c829);})['then'](function(_0x31c3c){_0x5027ab[_0xf5f2('0x45')]=_0x31c3c;return _0x5027ab;})[_0xf5f2('0x27')](respondWithFilteredResult(_0x22c826,_0x14c829))['catch'](handleError(_0x22c826,null));};exports['show']=function(_0x59eb00,_0x76d21b){var _0x2ad13c={'raw':![],'where':{'id':_0x59eb00[_0xf5f2('0x46')]['id']}},_0x4c8d8e={};_0x4c8d8e[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x2e')][_0xf5f2('0x2f')]);_0x4c8d8e[_0xf5f2('0x33')]=_[_0xf5f2('0x32')](_0x59eb00[_0xf5f2('0x33')]);_0x4c8d8e[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x4c8d8e[_0xf5f2('0x31')],_0x4c8d8e[_0xf5f2('0x33')]);_0x2ad13c[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x4c8d8e['model'],qs[_0xf5f2('0x37')](_0x59eb00['query'][_0xf5f2('0x37')]));_0x2ad13c[_0xf5f2('0x36')]=_0x2ad13c[_0xf5f2('0x36')][_0xf5f2('0x38')]?_0x2ad13c[_0xf5f2('0x36')]:_0x4c8d8e[_0xf5f2('0x31')];if(_0x59eb00['query'][_0xf5f2('0x42')]){_0x2ad13c[_0xf5f2('0x43')]=[{'all':!![]}];}_0x2ad13c=_[_0xf5f2('0x3e')]({},_0x2ad13c,_0x59eb00[_0xf5f2('0x41')]);return db[_0xf5f2('0x2e')][_0xf5f2('0x47')](_0x2ad13c)[_0xf5f2('0x27')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x27')](respondWithResult(_0x76d21b,null))['catch'](handleError(_0x76d21b,null));};exports[_0xf5f2('0x22')]=function(_0x33ec29,_0x45db9a){if(_0x33ec29['body']['id']){delete _0x33ec29[_0xf5f2('0x48')]['id'];}return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0x33ec29['params']['id']}})['then'](handleEntityNotFound(_0x45db9a,null))[_0xf5f2('0x27')](saveUpdates(_0x33ec29[_0xf5f2('0x48')],null))['then'](respondWithResult(_0x45db9a,null))[_0xf5f2('0x49')](handleError(_0x45db9a,null));};exports['create']=function(_0x740321,_0x497eb8,_0x2cbd9d){return db['sequelize'][_0xf5f2('0x4a')](function(_0xb8ea3a){if(_0x740321[_0xf5f2('0x48')][_0xf5f2('0x4b')]==='files'){_0x740321[_0xf5f2('0x48')][_0xf5f2('0x4c')]=path['join'](config['root'],_0xf5f2('0x4d'),_0x740321[_0xf5f2('0x48')]['name']);}return db[_0xf5f2('0x2e')][_0xf5f2('0x4e')](_0x740321[_0xf5f2('0x48')],{'transaction':_0xb8ea3a})[_0xf5f2('0x27')](function(_0x5d0db0){if(_0x740321['body'][_0xf5f2('0x4b')]===_0xf5f2('0x4f')){fs['mkdirSync'](_0x5d0db0[_0xf5f2('0x4c')],parseInt(_0xf5f2('0x50'),0x8));}var _0x255125=_0x740321[_0xf5f2('0x51')][_0xf5f2('0x24')]({'plain':!![]});if(!_0x255125)throw new Error(_0xf5f2('0x52'));if(_0x255125[_0xf5f2('0x53')]==='user'){var _0x59e8ef=_0x5d0db0[_0xf5f2('0x24')]({'plain':!![]});return db[_0xf5f2('0x54')][_0xf5f2('0x47')]({'where':{'name':_0xf5f2('0x25'),'userProfileId':_0x255125[_0xf5f2('0x55')]},'raw':!![]})['then'](function(_0xdb1106){if(_0xdb1106&&_0xdb1106[_0xf5f2('0x56')]===0x0){return db[_0xf5f2('0x26')]['create']({'name':_0x59e8ef[_0xf5f2('0x2b')],'resourceId':_0x59e8ef['id'],'type':_0xdb1106['name'],'sectionId':_0xdb1106['id']},{})[_0xf5f2('0x27')](function(){return _0x5d0db0;});}else{return _0x5d0db0;}})[_0xf5f2('0x49')](function(_0x28cce5){logger[_0xf5f2('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28cce5);});}return _0x5d0db0;});})['then'](respondWithResult(_0x497eb8,0xc9))[_0xf5f2('0x49')](handleError(_0x497eb8,null));};exports['destroy']=function(_0xa39c65,_0x1f1916,_0x572ec1){var _0x3f0579;return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0xa39c65['params']['id']}})[_0xf5f2('0x27')](function(_0xcf7a50){if(_0xcf7a50){return db[_0xf5f2('0x57')][_0xf5f2('0x4a')](function(_0x51fa7e){return _0xcf7a50[_0xf5f2('0x23')]({'transaction':_0x51fa7e,'raw':!![]})['then'](function(_0x2cbe1e){if(_0x2cbe1e[_0xf5f2('0x4c')]){fs[_0xf5f2('0x58')](_0x2cbe1e[_0xf5f2('0x4c')])[_0xf5f2('0x59')](function(_0x5583c2){fs[_0xf5f2('0x5a')](path[_0xf5f2('0x5b')](_0x2cbe1e[_0xf5f2('0x4c')],_0x5583c2));});fs[_0xf5f2('0x5c')](_0x2cbe1e[_0xf5f2('0x4c')]);}return _0x2cbe1e;});})['catch'](function(_0x31e16b){throw new db['Sequelize']['ValidationError'](_0x31e16b[_0xf5f2('0x5d')]);});}})['then'](handleEntityNotFound(_0x1f1916,null))[_0xf5f2('0x27')](removeEntity(_0x1f1916,null))[_0xf5f2('0x49')](handleError(_0x1f1916,null));};exports[_0xf5f2('0x5e')]=function(_0x123b93,_0x5767fc,_0x15d0c2){return db[_0xf5f2('0x57')][_0xf5f2('0x4a')](function(_0x18c41f){var _0x15b680;return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0x123b93['params']['id']}})[_0xf5f2('0x27')](function(_0x2d171d){if(_0x2d171d){_0x15b680=_0x2d171d;return _0x2d171d[_0xf5f2('0x5e')](_0x123b93[_0xf5f2('0x48')]['id'],{'transaction':_0x18c41f});}})['then'](function(_0x1de396){if(_0x1de396){return db['Sound'][_0xf5f2('0x5f')]({'where':{'id':_0x123b93[_0xf5f2('0x48')]['id']},'attributes':['id','name',_0xf5f2('0x60'),_0xf5f2('0x61'),_0xf5f2('0x62')],'raw':!![]});}})[_0xf5f2('0x27')](function(_0x146462){if(_0x146462){var _0x4bd113=path[_0xf5f2('0x5b')](config[_0xf5f2('0x63')],_0xf5f2('0x64'),util[_0xf5f2('0x65')](_0xf5f2('0x66'),path[_0xf5f2('0x67')](_0x146462['save_name'],path[_0xf5f2('0x68')](_0x146462[_0xf5f2('0x60')])),_0x146462['converted_format']));var _0x3f677e=path[_0xf5f2('0x5b')](config[_0xf5f2('0x63')],'server/files/moh',_0x15b680['name'],util['format'](_0xf5f2('0x66'),_0x146462[_0xf5f2('0x2b')],_0x146462[_0xf5f2('0x61')]));fs[_0xf5f2('0x69')](_0x4bd113,_0x3f677e);return _0x146462;}})[_0xf5f2('0x49')](function(_0x4d878e){throw new db[(_0xf5f2('0x6a'))][(_0xf5f2('0x6b'))](_0x4d878e[_0xf5f2('0x5d')]);});})[_0xf5f2('0x27')](handleEntityNotFound(_0x5767fc,null))[_0xf5f2('0x27')](respondWithResult(_0x5767fc,0xc9))[_0xf5f2('0x49')](handleError(_0x5767fc,null));};exports[_0xf5f2('0x6c')]=function(_0x3cce11,_0x155f45,_0x1f35ef){return db[_0xf5f2('0x57')]['transaction'](function(_0x5e4e07){var _0x5a143f;return db[_0xf5f2('0x2e')][_0xf5f2('0x5f')]({'where':{'id':_0x3cce11[_0xf5f2('0x46')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x155f45,null))[_0xf5f2('0x27')](function(_0x5c6959){if(_0x5c6959){_0x5a143f=_0x5c6959;return _0x5c6959[_0xf5f2('0x6c')](_0x3cce11[_0xf5f2('0x46')][_0xf5f2('0x6d')]);}})[_0xf5f2('0x27')](function(_0x44d119){if(_0x44d119){return db['Sound'][_0xf5f2('0x5f')]({'where':{'id':_0x3cce11[_0xf5f2('0x46')]['id2']},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x60'),_0xf5f2('0x61'),_0xf5f2('0x62')],'raw':!![]});}})['then'](function(_0x40b36e){if(_0x40b36e){fs[_0xf5f2('0x5a')](path[_0xf5f2('0x5b')](_0x5a143f[_0xf5f2('0x4c')],util[_0xf5f2('0x65')]('%s.%s',_0x40b36e['name'],_0x40b36e[_0xf5f2('0x61')])));return _0x40b36e;}})[_0xf5f2('0x49')](function(_0x17eb69){throw new db[(_0xf5f2('0x6a'))]['ValidationError'](_0x17eb69['message']);});})[_0xf5f2('0x27')](handleEntityNotFound(_0x155f45,null))['then'](respondWithStatusCode(_0x155f45,0xcc))['catch'](handleError(_0x155f45,null));};exports['getSounds']=function(_0x57cb18,_0xad4554,_0x543434){var _0x18eb83={};var _0x168092={};var _0x3de508;var _0x9f941e;return db[_0xf5f2('0x2e')][_0xf5f2('0x5f')]({'where':{'id':_0x57cb18[_0xf5f2('0x46')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0xad4554,null))[_0xf5f2('0x27')](function(_0x2afeac){if(_0x2afeac){_0x3de508=_0x2afeac;_0x168092[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x6e')][_0xf5f2('0x2f')]);_0x168092[_0xf5f2('0x33')]=_[_0xf5f2('0x32')](_0x57cb18['query']);_0x168092[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x168092[_0xf5f2('0x31')],_0x168092[_0xf5f2('0x33')]);_0x18eb83[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x168092[_0xf5f2('0x31')],qs[_0xf5f2('0x37')](_0x57cb18['query'][_0xf5f2('0x37')]));_0x18eb83['attributes']=_0x18eb83['attributes']['length']?_0x18eb83['attributes']:_0x168092['model'];_0x18eb83['order']=qs[_0xf5f2('0x3b')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x3b')]);_0x18eb83[_0xf5f2('0x3c')]=qs[_0xf5f2('0x34')](_[_0xf5f2('0x3d')](_0x57cb18['query'],_0x168092['filters']));if(_0x57cb18[_0xf5f2('0x33')]['filter']){_0x18eb83[_0xf5f2('0x3c')]=_[_0xf5f2('0x3e')](_0x18eb83['where'],{'$or':_['map'](_0x18eb83[_0xf5f2('0x36')],function(_0x274aa3){var _0x5a23c7={};_0x5a23c7[_0x274aa3]={'$like':'%'+_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x40')]+'%'};return _0x5a23c7;})});}_0x18eb83=_['merge']({},_0x18eb83,_0x57cb18[_0xf5f2('0x41')]);return _0x3de508[_0xf5f2('0x6f')](_0x18eb83);}})[_0xf5f2('0x27')](function(_0x4c1678){if(_0x4c1678){_0x9f941e=_0x4c1678[_0xf5f2('0x38')];if(!_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x39')](_0xf5f2('0x70'))){_0x18eb83[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x1c')]);_0x18eb83[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x1b')]);}return _0x3de508[_0xf5f2('0x6f')](_0x18eb83);}})[_0xf5f2('0x27')](function(_0xe900ea){if(_0xe900ea){return _0xe900ea?{'count':_0x9f941e,'rows':_0xe900ea}:null;}})[_0xf5f2('0x27')](respondWithResult(_0xad4554,null))[_0xf5f2('0x49')](handleError(_0xad4554,null));};
\ No newline at end of file
+var _0xb10b=['stack','name','send','VoiceMusicOnHold','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','Sequelize','removeSound','Sound','getSounds','rawAttributes','pick','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error'];(function(_0x3969a7,_0x14f977){var _0x3262c2=function(_0x4a4eba){while(--_0x4a4eba){_0x3969a7['push'](_0x3969a7['shift']());}};_0x3262c2(++_0x14f977);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d6e56,_0x1959b9){_0x1d6e56=_0x1d6e56-0x0;var _0xef8e84=_0xb10b[_0x1d6e56];return _0xef8e84;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x317da4=_0x8e2b97[_0xbb10('0x25')]({'plain':!![]});var _0x1824b7=_0xbb10('0x26');return db[_0xbb10('0x27')][_0xbb10('0x24')]({'where':{'type':_0x1824b7,'resourceId':_0x317da4['id']}})[_0xbb10('0x23')](function(){return _0x8e2b97;});})[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x18')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x28')](_0x2fdde9[_0xbb10('0x29')]);if(_0x2fdde9[_0xbb10('0x2a')]){delete _0x2fdde9[_0xbb10('0x2a')];}_0x2c89b9[_0xbb10('0x19')](_0x4e25ff)[_0xbb10('0x2b')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2c')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2d')][_0xbb10('0x2e')]};});_0x2e0249[_0xbb10('0x2f')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],qs['fields'](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x35')]));_0xfc3595[_0xbb10('0x34')]=_0xfc3595[_0xbb10('0x34')][_0xbb10('0x36')]?_0xfc3595[_0xbb10('0x34')]:_0x2e0249[_0xbb10('0x2f')];if(!_0x3796c7[_0xbb10('0x30')][_0xbb10('0x37')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x1d')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x39')]);_0xfc3595[_0xbb10('0x3a')]=qs[_0xbb10('0x32')](_['pick'](_0x3796c7[_0xbb10('0x30')],_0x2e0249[_0xbb10('0x32')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3b')](_0xfc3595[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3c')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2d')]!==_0xbb10('0x3d')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3b')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3f')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x3a')]};return db[_0xbb10('0x2c')]['count'](_0x4f1cdd)[_0xbb10('0x23')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1c')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x30')][_0xbb10('0x40')]){_0xfc3595[_0xbb10('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbb10('0x42')](_0xfc3595);})[_0xbb10('0x23')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x43')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x44')](handleError(_0x21ac54,null));};exports[_0xbb10('0x45')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x46')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2c')]['rawAttributes']);_0x351484[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x23dc18['query']);_0x351484[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],qs[_0xbb10('0x35')](_0x23dc18[_0xbb10('0x30')][_0xbb10('0x35')]));_0x5e2cfa[_0xbb10('0x34')]=_0x5e2cfa[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5e2cfa[_0xbb10('0x34')]:_0x351484[_0xbb10('0x2f')];if(_0x23dc18[_0xbb10('0x30')]['includeAll']){_0x5e2cfa[_0xbb10('0x41')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3b')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2c')][_0xbb10('0x47')](_0x5e2cfa)[_0xbb10('0x23')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x23')](respondWithResult(_0x403beb,null))[_0xbb10('0x44')](handleError(_0x403beb,null));};exports[_0xbb10('0x48')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x44')](handleError(_0x5be85e,null));};exports[_0xbb10('0x4a')]=function(_0x22b315,_0x2f2552,_0x460788){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x550111){if(_0x22b315['body'][_0xbb10('0x4d')]===_0xbb10('0x4e')){_0x22b315[_0xbb10('0x49')][_0xbb10('0x4f')]=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x52'),_0x22b315[_0xbb10('0x49')][_0xbb10('0x2a')]);}return db[_0xbb10('0x2c')][_0xbb10('0x4a')](_0x22b315[_0xbb10('0x49')],{'transaction':_0x550111})[_0xbb10('0x23')](function(_0x2e6fd9){if(_0x22b315[_0xbb10('0x49')]['mode']===_0xbb10('0x4e')){fs['mkdirSync'](_0x2e6fd9[_0xbb10('0x4f')],parseInt(_0xbb10('0x53'),0x8));}var _0x1ffe20=_0x22b315[_0xbb10('0x54')][_0xbb10('0x25')]({'plain':!![]});if(!_0x1ffe20)throw new Error(_0xbb10('0x55'));if(_0x1ffe20[_0xbb10('0x56')]===_0xbb10('0x54')){var _0x180400=_0x2e6fd9[_0xbb10('0x25')]({'plain':!![]});return db[_0xbb10('0x57')][_0xbb10('0x47')]({'where':{'name':_0xbb10('0x26'),'userProfileId':_0x1ffe20[_0xbb10('0x58')]},'raw':!![]})[_0xbb10('0x23')](function(_0x5de0cc){if(_0x5de0cc&&_0x5de0cc[_0xbb10('0x59')]===0x0){return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'name':_0x180400[_0xbb10('0x2a')],'resourceId':_0x180400['id'],'type':_0x5de0cc[_0xbb10('0x2a')],'sectionId':_0x5de0cc['id']},{})[_0xbb10('0x23')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})['catch'](function(_0x120bda){logger[_0xbb10('0x28')](_0xbb10('0x5a'),_0x120bda);});}return _0x2e6fd9;});})[_0xbb10('0x23')](respondWithResult(_0x2f2552,0xc9))[_0xbb10('0x44')](handleError(_0x2f2552,null));};exports[_0xbb10('0x24')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb;return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x175872[_0xbb10('0x46')]['id']}})['then'](function(_0x4ea1a6){if(_0x4ea1a6){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x3d0cb7){return _0x4ea1a6[_0xbb10('0x24')]({'transaction':_0x3d0cb7,'raw':!![]})['then'](function(_0x506498){if(_0x506498[_0xbb10('0x4f')]){fs[_0xbb10('0x5b')](_0x506498[_0xbb10('0x4f')])[_0xbb10('0x5c')](function(_0x412f13){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x506498['directory'],_0x412f13));});fs[_0xbb10('0x5e')](_0x506498[_0xbb10('0x4f')]);}return _0x506498;});})['catch'](function(_0x5e03cb){throw new db['Sequelize'][(_0xbb10('0x5f'))](_0x5e03cb[_0xbb10('0x60')]);});}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))['then'](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['addSound']=function(_0x3ebc5f,_0x249b33,_0x45167a){return db['sequelize'][_0xbb10('0x4c')](function(_0x13131c){var _0x5a6538;return db['VoiceMusicOnHold'][_0xbb10('0x47')]({'where':{'id':_0x3ebc5f[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x5a6538=_0x237246;return _0x237246['addSound'](_0x3ebc5f[_0xbb10('0x49')]['id'],{'transaction':_0x13131c});}})[_0xbb10('0x23')](function(_0xa7179d){if(_0xa7179d){return db['Sound'][_0xbb10('0x61')]({'where':{'id':_0x3ebc5f[_0xbb10('0x49')]['id']},'attributes':['id',_0xbb10('0x2a'),'save_name',_0xbb10('0x62'),_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x37b65f){if(_0x37b65f){var _0x5e4a6e=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x64'),util[_0xbb10('0x65')]('%s.%s',path[_0xbb10('0x66')](_0x37b65f[_0xbb10('0x67')],path[_0xbb10('0x68')](_0x37b65f[_0xbb10('0x67')])),_0x37b65f[_0xbb10('0x62')]));var _0x17807e=path[_0xbb10('0x50')](config['root'],'server/files/moh',_0x5a6538['name'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x37b65f[_0xbb10('0x2a')],_0x37b65f['converted_format']));fs['symlinkSync'](_0x5e4a6e,_0x17807e);return _0x37b65f;}})[_0xbb10('0x44')](function(_0x1b11c0){throw new db[(_0xbb10('0x6a'))][(_0xbb10('0x5f'))](_0x1b11c0[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x249b33,null))['then'](respondWithResult(_0x249b33,0xc9))[_0xbb10('0x44')](handleError(_0x249b33,null));};exports[_0xbb10('0x6b')]=function(_0x270fdb,_0x14f16b,_0x2aaaa6){return db['sequelize']['transaction'](function(_0x5ad6ad){var _0x329da7;return db[_0xbb10('0x2c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](function(_0x5d942d){if(_0x5d942d){_0x329da7=_0x5d942d;return _0x5d942d[_0xbb10('0x6b')](_0x270fdb['params']['id2']);}})['then'](function(_0xdf634f){if(_0xdf634f){return db[_0xbb10('0x6c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id2']},'attributes':['id',_0xbb10('0x2a'),'save_name','converted_format',_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x29529c){if(_0x29529c){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x329da7['directory'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x29529c[_0xbb10('0x2a')],_0x29529c[_0xbb10('0x62')])));return _0x29529c;}})[_0xbb10('0x44')](function(_0x27f42f){throw new db[(_0xbb10('0x6a'))]['ValidationError'](_0x27f42f[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](respondWithStatusCode(_0x14f16b,0xcc))[_0xbb10('0x44')](handleError(_0x14f16b,null));};exports[_0xbb10('0x6d')]=function(_0x172be3,_0xa3b23,_0x312a08){var _0x5a4429={};var _0x428146={};var _0x218690;var _0x145baf;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x172be3['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xa3b23,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){_0x218690=_0x4e3d6a;_0x428146[_0xbb10('0x2f')]=_[_0xbb10('0x31')](db[_0xbb10('0x6c')][_0xbb10('0x6e')]);_0x428146[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x172be3[_0xbb10('0x30')]);_0x428146[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x428146['model'],_0x428146[_0xbb10('0x30')]);_0x5a4429[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x428146[_0xbb10('0x2f')],qs['fields'](_0x172be3['query'][_0xbb10('0x35')]));_0x5a4429[_0xbb10('0x34')]=_0x5a4429[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5a4429['attributes']:_0x428146[_0xbb10('0x2f')];_0x5a4429[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x39')]);_0x5a4429['where']=qs['filters'](_[_0xbb10('0x6f')](_0x172be3[_0xbb10('0x30')],_0x428146[_0xbb10('0x32')]));if(_0x172be3['query'][_0xbb10('0x3e')]){_0x5a4429[_0xbb10('0x3a')]=_['merge'](_0x5a4429['where'],{'$or':_[_0xbb10('0x3c')](_0x5a4429[_0xbb10('0x34')],function(_0x177f77){var _0x4d64ff={};_0x4d64ff[_0x177f77]={'$like':'%'+_0x172be3[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4d64ff;})});}_0x5a4429=_[_0xbb10('0x3b')]({},_0x5a4429,_0x172be3[_0xbb10('0x3f')]);return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x45bd4e){if(_0x45bd4e){_0x145baf=_0x45bd4e[_0xbb10('0x36')];if(!_0x172be3[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x70'))){_0x5a4429[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x5a4429[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1d')]);}return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x2a4278){if(_0x2a4278){return _0x2a4278?{'count':_0x145baf,'rows':_0x2a4278}:null;}})['then'](respondWithResult(_0xa3b23,null))['catch'](handleError(_0xa3b23,null));};
\ No newline at end of file
index c4dbdcb..6fcbc0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb027=['voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define'];(function(_0xff54f2,_0x4bcb15){var _0x42b151=function(_0x1e3063){while(--_0x1e3063){_0xff54f2['push'](_0xff54f2['shift']());}};_0x42b151(++_0x4bcb15);}(_0xb027,0x9d));var _0x7b02=function(_0x1fa41c,_0x1cfb55){_0x1fa41c=_0x1fa41c-0x0;var _0x56aff7=_0xb027[_0x1fa41c];return _0x56aff7;};'use strict';var _=require(_0x7b02('0x0'));var util=require(_0x7b02('0x1'));var logger=require(_0x7b02('0x2'))(_0x7b02('0x3'));var moment=require(_0x7b02('0x4'));var BPromise=require(_0x7b02('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b02('0x6'));var rimraf=require('rimraf');var config=require(_0x7b02('0x7'));var attributes=require(_0x7b02('0x8'));module[_0x7b02('0x9')]=function(_0x1836dc,_0x4b16da){return _0x1836dc[_0x7b02('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x7b02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7985=['bluebird','request-promise','path','rimraf','exports','define','VoiceMusicOnHold','util','api','moment'];(function(_0x17b77a,_0x42fa54){var _0x4d0b13=function(_0x3db76a){while(--_0x3db76a){_0x17b77a['push'](_0x17b77a['shift']());}};_0x4d0b13(++_0x42fa54);}(_0x7985,0x1ab));var _0x5798=function(_0x1951de,_0x173387){_0x1951de=_0x1951de-0x0;var _0x418584=_0x7985[_0x1951de];return _0x418584;};'use strict';var _=require('lodash');var util=require(_0x5798('0x0'));var logger=require('../../config/logger')(_0x5798('0x1'));var moment=require(_0x5798('0x2'));var BPromise=require(_0x5798('0x3'));var rp=require(_0x5798('0x4'));var fs=require('fs');var path=require(_0x5798('0x5'));var rimraf=require(_0x5798('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x5798('0x7')]=function(_0x341bab,_0xa4ea49){return _0x341bab[_0x5798('0x8')](_0x5798('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eb68965..2b77bdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe27d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','../../mysqldb'];(function(_0x357f44,_0x4c0d19){var _0x5d4680=function(_0x2dfc2f){while(--_0x2dfc2f){_0x357f44['push'](_0x357f44['shift']());}};_0x5d4680(++_0x4c0d19);}(_0xe27d,0x1ea));var _0xde27=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0xe27d[_0x413aac];return _0x569b11;};'use strict';var _=require(_0xde27('0x0'));var util=require(_0xde27('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde27('0x2'))['db'];var utils=require(_0xde27('0x3'));var logger=require('../../config/logger')(_0xde27('0x4'));var config=require(_0xde27('0x5'));var jayson=require(_0xde27('0x6'));var client=jayson[_0xde27('0x7')][_0xde27('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x101405,_0x2789ab,_0x3dd208){return new BPromise(function(_0x34f85b,_0xdf9853){return client['request'](_0x101405,_0x3dd208)['then'](function(_0x267438){logger[_0xde27('0x9')](_0xde27('0xa'),_0x2789ab,_0xde27('0xb'));logger['debug'](_0xde27('0xc'),_0x2789ab,_0xde27('0xb'),JSON['stringify'](_0x267438));if(_0x267438['error']){if(_0x267438[_0xde27('0xd')][_0xde27('0xe')]===0x1f4){logger[_0xde27('0xd')](_0xde27('0xa'),_0x2789ab,_0x267438[_0xde27('0xd')][_0xde27('0xf')]);return _0xdf9853(_0x267438['error']['message']);}logger[_0xde27('0xd')](_0xde27('0xa'),_0x2789ab,_0x267438['error'][_0xde27('0xf')]);return _0x34f85b(_0x267438[_0xde27('0xd')][_0xde27('0xf')]);}else{logger[_0xde27('0x9')](_0xde27('0xa'),_0x2789ab,_0xde27('0xb'));_0x34f85b(_0x267438['result'][_0xde27('0xf')]);}})[_0xde27('0x10')](function(_0x54bde1){logger['error'](_0xde27('0xa'),_0x2789ab,_0x54bde1);_0xdf9853(_0x54bde1);});});}
\ No newline at end of file
+var _0x8aec=['info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x8aec,0x1d2));var _0xc8ae=function(_0x200c43,_0x348e17){_0x200c43=_0x200c43-0x0;var _0x32afc7=_0x8aec[_0x200c43];return _0x32afc7;};'use strict';var _=require(_0xc8ae('0x0'));var util=require(_0xc8ae('0x1'));var moment=require('moment');var BPromise=require(_0xc8ae('0x2'));var rs=require(_0xc8ae('0x3'));var fs=require('fs');var Redis=require(_0xc8ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc8ae('0x5'))('rpc');var config=require(_0xc8ae('0x6'));var jayson=require(_0xc8ae('0x7'));var client=jayson['client'][_0xc8ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a24b3,_0x5afddf,_0x141ce8){return new BPromise(function(_0x5b776d,_0x28ea96){return client['request'](_0x5a24b3,_0x141ce8)['then'](function(_0x1903ca){logger[_0xc8ae('0x9')](_0xc8ae('0xa'),_0x5afddf,_0xc8ae('0xb'));logger[_0xc8ae('0xc')](_0xc8ae('0xd'),_0x5afddf,_0xc8ae('0xb'),JSON['stringify'](_0x1903ca));if(_0x1903ca[_0xc8ae('0xe')]){if(_0x1903ca[_0xc8ae('0xe')][_0xc8ae('0xf')]===0x1f4){logger['error'](_0xc8ae('0xa'),_0x5afddf,_0x1903ca[_0xc8ae('0xe')][_0xc8ae('0x10')]);return _0x28ea96(_0x1903ca['error']['message']);}logger[_0xc8ae('0xe')](_0xc8ae('0xa'),_0x5afddf,_0x1903ca[_0xc8ae('0xe')][_0xc8ae('0x10')]);return _0x5b776d(_0x1903ca[_0xc8ae('0xe')][_0xc8ae('0x10')]);}else{logger[_0xc8ae('0x9')](_0xc8ae('0xa'),_0x5afddf,_0xc8ae('0xb'));_0x5b776d(_0x1903ca[_0xc8ae('0x11')][_0xc8ae('0x10')]);}})[_0xc8ae('0x12')](function(_0x2dbfaa){logger[_0xc8ae('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5afddf,_0x2dbfaa);_0x28ea96(_0x2dbfaa);});});}
\ No newline at end of file
index a24b51b..2574a34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa14b=['../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','update','delete','removeAgents','exports','multer','util','path','Router'];(function(_0x1fec1e,_0xce18d2){var _0x31f9ec=function(_0x347a9a){while(--_0x347a9a){_0x1fec1e['push'](_0x1fec1e['shift']());}};_0x31f9ec(++_0xce18d2);}(_0xa14b,0x68));var _0xba14=function(_0x16fdfa,_0x55807d){_0x16fdfa=_0x16fdfa-0x0;var _0x44ab40=_0xa14b[_0x16fdfa];return _0x44ab40;};'use strict';var multer=require(_0xba14('0x0'));var util=require(_0xba14('0x1'));var path=require(_0xba14('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xba14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xba14('0x4'));var config=require('../../config/environment');var controller=require(_0xba14('0x5'));router[_0xba14('0x6')]('/',auth[_0xba14('0x7')](),controller[_0xba14('0x8')]);router[_0xba14('0x6')]('/describe',auth[_0xba14('0x7')](),controller[_0xba14('0x9')]);router[_0xba14('0x6')](_0xba14('0xa'),auth[_0xba14('0x7')](),controller[_0xba14('0xb')]);router['get'](_0xba14('0xc'),auth['isAuthenticated'](),controller[_0xba14('0xd')]);router['post']('/',auth[_0xba14('0x7')](),controller['create']);router['post'](_0xba14('0xc'),auth[_0xba14('0x7')](),controller['addAgents']);router['put'](_0xba14('0xa'),auth[_0xba14('0x7')](),controller[_0xba14('0xe')]);router[_0xba14('0xf')](_0xba14('0xa'),auth[_0xba14('0x7')](),controller['destroy']);router[_0xba14('0xf')](_0xba14('0xc'),auth[_0xba14('0x7')](),controller[_0xba14('0x10')]);module[_0xba14('0x11')]=router;
\ No newline at end of file
+var _0xe6f7=['destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','/:id/users','getAgents','create','post','addAgents','update'];(function(_0x4b8412,_0x235b3d){var _0x1ed9ed=function(_0x455209){while(--_0x455209){_0x4b8412['push'](_0x4b8412['shift']());}};_0x1ed9ed(++_0x235b3d);}(_0xe6f7,0x13c));var _0x7e6f=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0xe6f7[_0x4cf8d4];return _0x2c1beb;};'use strict';var multer=require(_0x7e6f('0x0'));var util=require(_0x7e6f('0x1'));var path=require(_0x7e6f('0x2'));var timeout=require(_0x7e6f('0x3'));var express=require(_0x7e6f('0x4'));var router=express[_0x7e6f('0x5')]();var auth=require(_0x7e6f('0x6'));var interaction=require(_0x7e6f('0x7'));var config=require('../../config/environment');var controller=require(_0x7e6f('0x8'));router[_0x7e6f('0x9')]('/',auth[_0x7e6f('0xa')](),controller['index']);router[_0x7e6f('0x9')](_0x7e6f('0xb'),auth[_0x7e6f('0xa')](),controller[_0x7e6f('0xc')]);router['get'](_0x7e6f('0xd'),auth[_0x7e6f('0xa')](),controller['show']);router[_0x7e6f('0x9')](_0x7e6f('0xe'),auth[_0x7e6f('0xa')](),controller[_0x7e6f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7e6f('0x10')]);router[_0x7e6f('0x11')](_0x7e6f('0xe'),auth[_0x7e6f('0xa')](),controller[_0x7e6f('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7e6f('0x13')]);router['delete'](_0x7e6f('0xd'),auth[_0x7e6f('0xa')](),controller[_0x7e6f('0x14')]);router[_0x7e6f('0x15')](_0x7e6f('0xe'),auth[_0x7e6f('0xa')](),controller[_0x7e6f('0x16')]);module[_0x7e6f('0x17')]=router;
\ No newline at end of file
index ef9901f..195afff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x929a=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0xb9cbcd,_0x8df75d){var _0x1a7102=function(_0x566c28){while(--_0x566c28){_0xb9cbcd['push'](_0xb9cbcd['shift']());}};_0x1a7102(++_0x8df75d);}(_0x929a,0x10a));var _0xa929=function(_0x1f11ea,_0x2e3652){_0x1f11ea=_0x1f11ea-0x0;var _0x4aadd5=_0x929a[_0x1f11ea];return _0x4aadd5;};'use strict';var Sequelize=require(_0xa929('0x0'));module[_0xa929('0x1')]={'name':{'type':Sequelize[_0xa929('0x2')],'allowNull':![],'unique':_0xa929('0x3')},'prefix':{'type':Sequelize[_0xa929('0x4')],'get':function(_0x9b5026){return _0xa929('0x5')+this[_0xa929('0x6')](_0xa929('0x3'))+'-';}},'description':{'type':Sequelize[_0xa929('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xa929('0x7')]}};
\ No newline at end of file
+var _0xc0b4=['sequelize','exports','STRING','VIRTUAL','system-','getDataValue'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc0b4,0x12c));var _0x4c0b=function(_0x432af8,_0x477b3d){_0x432af8=_0x432af8-0x0;var _0x228f4f=_0xc0b4[_0x432af8];return _0x228f4f;};'use strict';var Sequelize=require(_0x4c0b('0x0'));module[_0x4c0b('0x1')]={'name':{'type':Sequelize[_0x4c0b('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x4c0b('0x3')],'get':function(_0x13ff74){return _0x4c0b('0x4')+this[_0x4c0b('0x5')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 7220b99..bb44d45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23ab=['socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','count','limit','set','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','includeAll','include','find','params','describe','create','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','type','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','push','No\x20callerid\x20available','charAt','body','system-','sequelize','transaction','findById','addAgents','ids','spread','emit','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x23ab,0x64));var _0xb23a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x23ab[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0xb23a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb23a('0x1'));var zipdir=require(_0xb23a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb23a('0x3'));var BPromise=require(_0xb23a('0x4'));var Mustache=require(_0xb23a('0x5'));var util=require(_0xb23a('0x6'));var path=require(_0xb23a('0x7'));var sox=require(_0xb23a('0x8'));var csv=require('to-csv');var ejs=require(_0xb23a('0x9'));var fs=require('fs');var _=require(_0xb23a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb23a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb23a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb23a('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb23a('0xe'));var logger=require(_0xb23a('0xf'))(_0xb23a('0x10'));var utils=require('../../config/utils');var config=require(_0xb23a('0x11'));var db=require(_0xb23a('0x12'))['db'];config[_0xb23a('0x13')]=_[_0xb23a('0x14')](config['redis'],{'host':_0xb23a('0x15'),'port':0x18eb});var socket=require(_0xb23a('0x16'))(new Redis(config[_0xb23a('0x13')]));require(_0xb23a('0x17'))[_0xb23a('0x18')](socket);function respondWithStatusCode(_0x29dbe5,_0x5129ea){_0x5129ea=_0x5129ea||0xcc;return function(_0x350dec){if(_0x350dec){return _0x29dbe5[_0xb23a('0x19')](_0x5129ea);}return _0x29dbe5[_0xb23a('0x1a')](_0x5129ea)[_0xb23a('0x1b')]();};}function respondWithResult(_0x2994d3,_0x41a18d){_0x41a18d=_0x41a18d||0xc8;return function(_0x4e8def){if(_0x4e8def){return _0x2994d3[_0xb23a('0x1a')](_0x41a18d)[_0xb23a('0x1c')](_0x4e8def);}};}function respondWithFilteredResult(_0x19d15b,_0x5a4db3){return function(_0x28e72b){if(_0x28e72b){var _0x4ba966=_0x28e72b[_0xb23a('0x1d')],_0x2f9bf1=_0x5a4db3['offset'],_0x31dc54=_0x5a4db3['offset']+_0x5a4db3[_0xb23a('0x1e')],_0x290be5;if(_0x31dc54>=_0x4ba966){_0x31dc54=_0x4ba966;_0x290be5=0xc8;}else{_0x290be5=0xce;}_0x19d15b[_0xb23a('0x1a')](_0x290be5);return _0x19d15b[_0xb23a('0x1f')](_0xb23a('0x20'),_0x2f9bf1+'-'+_0x31dc54+'/'+_0x4ba966)['json'](_0x28e72b);}return null;};}function patchUpdates(_0x53359a){return function(_0x579299){try{jsonpatch[_0xb23a('0x21')](_0x579299,_0x53359a,!![]);}catch(_0x339619){return BPromise['reject'](_0x339619);}return _0x579299[_0xb23a('0x22')]();};}function saveUpdates(_0x1bfe9d,_0x4d7adc){return function(_0x5c2be3){if(_0x5c2be3){return _0x5c2be3[_0xb23a('0x23')](_0x1bfe9d)[_0xb23a('0x24')](function(_0x232d29){return _0x232d29;});}return null;};}function removeEntity(_0xe12179,_0x338afc){return function(_0x5c0b4e){if(_0x5c0b4e){return _0x5c0b4e[_0xb23a('0x25')]()[_0xb23a('0x24')](function(){var _0x186f28=_0x5c0b4e[_0xb23a('0x26')]({'plain':!![]});var _0x685dc6=_0xb23a('0x27');return db[_0xb23a('0x28')][_0xb23a('0x25')]({'where':{'type':_0x685dc6,'resourceId':_0x186f28['id']}})[_0xb23a('0x24')](function(){return _0x5c0b4e;});})[_0xb23a('0x24')](function(){_0xe12179[_0xb23a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x578ea7,_0x2b0ecc){return function(_0x29ba75){if(!_0x29ba75){_0x578ea7['sendStatus'](0x194);}return _0x29ba75;};}function handleError(_0x17041f,_0x24895d){_0x24895d=_0x24895d||0x1f4;return function(_0x1e1649){logger[_0xb23a('0x29')](_0x1e1649[_0xb23a('0x2a')]);if(_0x1e1649['name']){delete _0x1e1649[_0xb23a('0x2b')];}_0x17041f[_0xb23a('0x1a')](_0x24895d)[_0xb23a('0x2c')](_0x1e1649);};}exports[_0xb23a('0x2d')]=function(_0x4cc2f6,_0x3876ee){var _0x16c248={},_0x421cf9={},_0x4f2256={'count':0x0,'rows':[]};var _0xef18d8=_['map'](db[_0xb23a('0x2e')][_0xb23a('0x2f')],function(_0x76c98a){return{'name':_0x76c98a[_0xb23a('0x30')],'type':_0x76c98a['type'][_0xb23a('0x31')]};});_0x421cf9[_0xb23a('0x32')]=_[_0xb23a('0x33')](_0xef18d8,_0xb23a('0x2b'));_0x421cf9[_0xb23a('0x34')]=_[_0xb23a('0x35')](_0x4cc2f6[_0xb23a('0x34')]);_0x421cf9[_0xb23a('0x36')]=_[_0xb23a('0x37')](_0x421cf9[_0xb23a('0x32')],_0x421cf9[_0xb23a('0x34')]);_0x16c248[_0xb23a('0x38')]=_[_0xb23a('0x37')](_0x421cf9[_0xb23a('0x32')],qs[_0xb23a('0x39')](_0x4cc2f6[_0xb23a('0x34')][_0xb23a('0x39')]));_0x16c248[_0xb23a('0x38')]=_0x16c248[_0xb23a('0x38')][_0xb23a('0x3a')]?_0x16c248[_0xb23a('0x38')]:_0x421cf9['model'];if(!_0x4cc2f6[_0xb23a('0x34')]['hasOwnProperty'](_0xb23a('0x3b'))){_0x16c248[_0xb23a('0x1e')]=qs[_0xb23a('0x1e')](_0x4cc2f6[_0xb23a('0x34')][_0xb23a('0x1e')]);_0x16c248[_0xb23a('0x3c')]=qs[_0xb23a('0x3c')](_0x4cc2f6['query']['offset']);}_0x16c248[_0xb23a('0x3d')]=qs[_0xb23a('0x3e')](_0x4cc2f6[_0xb23a('0x34')][_0xb23a('0x3e')]);_0x16c248[_0xb23a('0x3f')]=qs[_0xb23a('0x36')](_[_0xb23a('0x40')](_0x4cc2f6[_0xb23a('0x34')],_0x421cf9[_0xb23a('0x36')]),_0xef18d8);if(_0x4cc2f6[_0xb23a('0x34')][_0xb23a('0x41')]){_0x16c248[_0xb23a('0x3f')]=_['merge'](_0x16c248[_0xb23a('0x3f')],{'$or':_[_0xb23a('0x33')](_0xef18d8,function(_0x5ca25a){if(_0x5ca25a['type']!==_0xb23a('0x42')){var _0x5814ac={};_0x5814ac[_0x5ca25a[_0xb23a('0x2b')]]={'$like':'%'+_0x4cc2f6[_0xb23a('0x34')][_0xb23a('0x41')]+'%'};return _0x5814ac;}})});}_0x16c248=_[_0xb23a('0x43')]({},_0x16c248,_0x4cc2f6[_0xb23a('0x44')]);var _0x43da19={'where':_0x16c248[_0xb23a('0x3f')]};return db[_0xb23a('0x2e')][_0xb23a('0x1d')](_0x43da19)[_0xb23a('0x24')](function(_0x27a88f){_0x4f2256[_0xb23a('0x1d')]=_0x27a88f;if(_0x4cc2f6[_0xb23a('0x34')]['includeAll']){_0x16c248['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xb23a('0x45')](_0x16c248);})[_0xb23a('0x24')](function(_0x38bda0){_0x4f2256[_0xb23a('0x46')]=_0x38bda0;return _0x4f2256;})[_0xb23a('0x24')](respondWithFilteredResult(_0x3876ee,_0x16c248))[_0xb23a('0x47')](handleError(_0x3876ee,null));};exports[_0xb23a('0x48')]=function(_0x2c0beb,_0x8e8d5b){var _0x252e45={'raw':![],'where':{'id':_0x2c0beb['params']['id']}},_0x4582e2={};_0x4582e2[_0xb23a('0x32')]=_['keys'](db[_0xb23a('0x2e')][_0xb23a('0x2f')]);_0x4582e2[_0xb23a('0x34')]=_[_0xb23a('0x35')](_0x2c0beb[_0xb23a('0x34')]);_0x4582e2['filters']=_[_0xb23a('0x37')](_0x4582e2[_0xb23a('0x32')],_0x4582e2[_0xb23a('0x34')]);_0x252e45[_0xb23a('0x38')]=_[_0xb23a('0x37')](_0x4582e2[_0xb23a('0x32')],qs[_0xb23a('0x39')](_0x2c0beb['query']['fields']));_0x252e45['attributes']=_0x252e45[_0xb23a('0x38')]['length']?_0x252e45[_0xb23a('0x38')]:_0x4582e2[_0xb23a('0x32')];if(_0x2c0beb[_0xb23a('0x34')][_0xb23a('0x49')]){_0x252e45[_0xb23a('0x4a')]=[{'all':!![]}];}_0x252e45=_[_0xb23a('0x43')]({},_0x252e45,_0x2c0beb['options']);return db['VoicePrefix']['find'](_0x252e45)[_0xb23a('0x24')](handleEntityNotFound(_0x8e8d5b,null))[_0xb23a('0x24')](respondWithResult(_0x8e8d5b,null))[_0xb23a('0x47')](handleError(_0x8e8d5b,null));};exports[_0xb23a('0x25')]=function(_0x3998cc,_0x18c7a1){return db['VoicePrefix'][_0xb23a('0x4b')]({'where':{'id':_0x3998cc[_0xb23a('0x4c')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0x18c7a1,null))[_0xb23a('0x24')](removeEntity(_0x18c7a1,null))['catch'](handleError(_0x18c7a1,null));};exports[_0xb23a('0x4d')]=function(_0x58c9ba,_0x1938a0){return db[_0xb23a('0x2e')][_0xb23a('0x4d')]()[_0xb23a('0x24')](respondWithResult(_0x1938a0,null))['catch'](handleError(_0x1938a0,null));};exports[_0xb23a('0x4e')]=function(_0x4d679b,_0x211e50){var _0x416dd1;return db['sequelize']['transaction'](function(_0x2c9951){return db[_0xb23a('0x2e')]['create'](_0x4d679b['body'],{'transaction':_0x2c9951})[_0xb23a('0x24')](function(_0x415fec){_0x416dd1=_0x415fec[_0xb23a('0x26')]({'plain':!![]});return db['VoiceExtension'][_0xb23a('0x4b')]({'where':{'id':_0x416dd1[_0xb23a('0x4f')]},'raw':!![]})[_0xb23a('0x24')](function(_0xda651c){return createVoicePrefixExtensions(_0x416dd1,_0xda651c,_0x2c9951);});});})[_0xb23a('0x24')](function(){var _0x213305=_0x4d679b[_0xb23a('0x50')][_0xb23a('0x26')]({'plain':!![]});if(!_0x213305)throw new Error(_0xb23a('0x51'));if(_0x213305['role']===_0xb23a('0x50')){var _0x4fc2c4=_0x416dd1;return db[_0xb23a('0x52')][_0xb23a('0x4b')]({'where':{'name':'VoicePrefixes','userProfileId':_0x213305[_0xb23a('0x53')]},'raw':!![]})[_0xb23a('0x24')](function(_0x19ab54){if(_0x19ab54&&_0x19ab54[_0xb23a('0x54')]===0x0){return db['UserProfileResource'][_0xb23a('0x4e')]({'name':_0x4fc2c4[_0xb23a('0x2b')],'resourceId':_0x4fc2c4['id'],'type':_0x19ab54[_0xb23a('0x2b')],'sectionId':_0x19ab54['id']},{})[_0xb23a('0x24')](function(){return _0x416dd1;});}else{return _0x416dd1;}})['catch'](function(_0x279e81){logger[_0xb23a('0x29')](_0xb23a('0x55'),_0x279e81);throw _0x279e81;});}return _0x416dd1;})[_0xb23a('0x24')](respondWithResult(_0x211e50,null))[_0xb23a('0x47')](handleError(_0x211e50,null));};function Extension(_0x215d40,_0x533ba4,_0x338301,_0x1d9901){this[_0xb23a('0x56')]=_0xb23a('0x57');this['exten']=_0x215d40;this[_0xb23a('0x58')]=_0x338301;this[_0xb23a('0x59')]='system';this[_0xb23a('0x5a')]=_0xb23a('0x5b');this[_0xb23a('0x5c')]=_0x533ba4;this['appdata']=_0x1d9901;}function createVoicePrefixExtensions(_0x113ff3,_0x2028f2,_0xc04801){return new BPromise(function(_0x4c0bff,_0x2bdd9e){var _0x18494e=new Extension(formatPrefixName(_0x113ff3['prefix']),0x1,_0xb23a('0x5d'),_0xb23a('0x5e'));_0x18494e[_0xb23a('0x5f')]=_0x113ff3['id'];return db[_0xb23a('0x60')][_0xb23a('0x4e')](_0x18494e,{'transaction':_0xc04801})[_0xb23a('0x24')](function(_0x587f25){var _0x1b5c2d=_0x587f25['get']({'plain':!![]});var _0x1327f1=_[_0xb23a('0x33')](addVoicePrefixExtensions(_0x113ff3,_0x2028f2),function(_0x4ccaad){_0x4ccaad[_0xb23a('0x4f')]=_0x1b5c2d['id'];_0x4ccaad[_0xb23a('0x5f')]=_0x113ff3['id'];return _0x4ccaad;});return db[_0xb23a('0x60')][_0xb23a('0x61')](_0x1327f1,{'transaction':_0xc04801})[_0xb23a('0x24')](function(_0x5539ee){if(!_0x5539ee){return _0x2bdd9e(_0xb23a('0x62'));}else{return _0x4c0bff(_0x5539ee);}})[_0xb23a('0x47')](function(_0x31dbb0){return _0x2bdd9e(_0x31dbb0);});});;});};function addVoicePrefixExtensions(_0x2020f6,_0x41eea7){var _0xdd3a9b=[];var _0x3b6a2d=formatPrefixName(_0x2020f6[_0xb23a('0x63')]);_0xdd3a9b['push'](new Extension(_0x3b6a2d,0x2,_0xb23a('0x64'),_0xb23a('0x65')+_0x2020f6[_0xb23a('0x2b')]));if(_0x2020f6[_0xb23a('0x66')]){_0xdd3a9b['push'](new Extension(_0x3b6a2d,0x3,_0xb23a('0x64'),_0xb23a('0x67')+_0x2020f6['callerIdAll']));}else{_0xdd3a9b[_0xb23a('0x68')](new Extension(_0x3b6a2d,0x3,_0xb23a('0x5d'),_0xb23a('0x69')));}_0xdd3a9b['push'](new Extension(_0x3b6a2d,0x4,'goto',_0x41eea7['context']+','+'${EXTEN:'+(0x8+_0x2020f6[_0xb23a('0x2b')]['length'])+'}'+','+0x1));return _0xdd3a9b;}function formatPrefixName(_0x213695){var _0x4ced1b='_';for(var _0x16523e=0x0;_0x16523e<_0x213695[_0xb23a('0x3a')];_0x16523e++){if(_0x213695[_0xb23a('0x6a')](_0x16523e)=='-'){_0x4ced1b+=_0x213695[_0xb23a('0x6a')](_0x16523e);}else{_0x4ced1b+='['+_0x213695[_0xb23a('0x6a')](_0x16523e)+']';}}_0x4ced1b+='.';return _0x4ced1b;}exports['update']=function(_0x2fe899,_0x1ababd,_0x18e781){var _0x1ad017=_0x2fe899[_0xb23a('0x6b')];_0x1ad017[_0xb23a('0x63')]=_0xb23a('0x6c')+_0x1ad017[_0xb23a('0x2b')]+'-';return db[_0xb23a('0x6d')][_0xb23a('0x6e')](function(_0x5d4806){return db[_0xb23a('0x2e')]['update'](_0x1ad017,{'where':{'id':_0x1ad017['id']},'transaction':_0x5d4806})[_0xb23a('0x24')](function(){return db['VoiceExtension'][_0xb23a('0x25')]({'where':{'VoicePrefixId':_0x1ad017['id']},'transaction':_0x5d4806})[_0xb23a('0x24')](function(){return db[_0xb23a('0x60')][_0xb23a('0x4b')]({'where':{'id':_0x1ad017[_0xb23a('0x4f')]},'raw':!![]})['then'](function(_0x705c54){return createVoicePrefixExtensions(_0x1ad017,_0x705c54,_0x5d4806);});});});})[_0xb23a('0x24')](function(){return db[_0xb23a('0x2e')][_0xb23a('0x6f')](_0x1ad017['id']);})[_0xb23a('0x24')](respondWithResult(_0x1ababd,null))['catch'](handleError(_0x1ababd,null));};exports['addAgents']=function(_0x4b7f47,_0x36e210,_0x159ab8){return db[_0xb23a('0x2e')][_0xb23a('0x4b')]({'where':{'id':_0x4b7f47[_0xb23a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36e210,null))[_0xb23a('0x24')](function(_0x5f51d2){if(_0x5f51d2){return _0x5f51d2[_0xb23a('0x70')](_0x4b7f47[_0xb23a('0x6b')][_0xb23a('0x71')],_['omit'](_0x4b7f47[_0xb23a('0x6b')],[_0xb23a('0x71'),'id'])||{})[_0xb23a('0x72')](function(_0x54e586){for(var _0x4d4157=0x0;_0x4d4157<_0x4b7f47[_0xb23a('0x6b')]['ids'][_0xb23a('0x3a')];_0x4d4157+=0x1){socket[_0xb23a('0x73')]('userVoicePrefix:save',{'UserId':_0x4b7f47[_0xb23a('0x6b')]['ids'][_0x4d4157],'VoicePrefixId':_0x4b7f47['params']['id']});}return _0x54e586;});}})[_0xb23a('0x24')](respondWithResult(_0x36e210,null))[_0xb23a('0x47')](handleError(_0x36e210,null));};exports[_0xb23a('0x74')]=function(_0x864fae,_0xbdd4a7,_0x4b490b){return db[_0xb23a('0x2e')][_0xb23a('0x4b')]({'where':{'id':_0x864fae[_0xb23a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xbdd4a7,null))[_0xb23a('0x24')](function(_0x2ce038){if(_0x2ce038){return _0x2ce038['removeAgents'](_0x864fae[_0xb23a('0x34')][_0xb23a('0x71')])['then'](function(){if(_[_0xb23a('0x75')](_0x864fae[_0xb23a('0x34')][_0xb23a('0x71')])){for(var _0x3c267f=0x0;_0x3c267f<_0x864fae[_0xb23a('0x34')][_0xb23a('0x71')]['length'];_0x3c267f+=0x1){socket[_0xb23a('0x73')](_0xb23a('0x76'),{'UserId':Number(_0x864fae[_0xb23a('0x34')][_0xb23a('0x71')][_0x3c267f]),'VoicePrefixId':Number(_0x864fae[_0xb23a('0x4c')]['id'])});}}else{socket[_0xb23a('0x73')](_0xb23a('0x76'),{'UserId':Number(_0x864fae[_0xb23a('0x34')]['ids']),'VoicePrefixId':Number(_0x864fae['params']['id'])});}});}})[_0xb23a('0x24')](respondWithStatusCode(_0xbdd4a7,null))[_0xb23a('0x47')](handleError(_0xbdd4a7,null));};exports['getAgents']=function(_0x344764,_0x386ba8,_0xa50be2){var _0x2274e2={};var _0x1bdd08={};var _0x478496;var _0x5d7ffe;return db[_0xb23a('0x2e')][_0xb23a('0x77')]({'where':{'id':_0x344764[_0xb23a('0x4c')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0x386ba8,null))[_0xb23a('0x24')](function(_0x2a2f03){if(_0x2a2f03){_0x478496=_0x2a2f03;_0x1bdd08[_0xb23a('0x32')]=_[_0xb23a('0x35')](db[_0xb23a('0x78')][_0xb23a('0x2f')]);_0x1bdd08[_0xb23a('0x34')]=_[_0xb23a('0x35')](_0x344764[_0xb23a('0x34')]);_0x1bdd08[_0xb23a('0x36')]=_[_0xb23a('0x37')](_0x1bdd08['model'],_0x1bdd08[_0xb23a('0x34')]);_0x2274e2[_0xb23a('0x38')]=_['intersection'](_0x1bdd08[_0xb23a('0x32')],qs[_0xb23a('0x39')](_0x344764['query'][_0xb23a('0x39')]));_0x2274e2[_0xb23a('0x38')]=_0x2274e2['attributes']['length']?_0x2274e2[_0xb23a('0x38')]:_0x1bdd08['model'];_0x2274e2[_0xb23a('0x3d')]=qs[_0xb23a('0x3e')](_0x344764['query'][_0xb23a('0x3e')]);_0x2274e2[_0xb23a('0x3f')]=qs[_0xb23a('0x36')](_[_0xb23a('0x40')](_0x344764[_0xb23a('0x34')],_0x1bdd08[_0xb23a('0x36')]));if(_0x344764[_0xb23a('0x34')][_0xb23a('0x41')]){_0x2274e2[_0xb23a('0x3f')]=_[_0xb23a('0x43')](_0x2274e2['where'],{'$or':_[_0xb23a('0x33')](_0x2274e2['attributes'],function(_0x5d8056){var _0x153214={};_0x153214[_0x5d8056]={'$like':'%'+_0x344764[_0xb23a('0x34')]['filter']+'%'};return _0x153214;})});}_0x2274e2=_['merge']({},_0x2274e2,_0x344764['options']);return _0x478496[_0xb23a('0x79')](_0x2274e2);}})[_0xb23a('0x24')](function(_0x58ae69){if(_0x58ae69){_0x5d7ffe=_0x58ae69['length'];if(!_0x344764[_0xb23a('0x34')]['hasOwnProperty'](_0xb23a('0x3b'))){_0x2274e2[_0xb23a('0x1e')]=qs[_0xb23a('0x1e')](_0x344764[_0xb23a('0x34')][_0xb23a('0x1e')]);_0x2274e2[_0xb23a('0x3c')]=qs[_0xb23a('0x3c')](_0x344764[_0xb23a('0x34')][_0xb23a('0x3c')]);}return _0x478496[_0xb23a('0x79')](_0x2274e2);}})['then'](function(_0x1da16f){if(_0x1da16f){return _0x1da16f?{'count':_0x5d7ffe,'rows':_0x1da16f}:null;}})['then'](respondWithResult(_0x386ba8,null))['catch'](handleError(_0x386ba8,null));};
\ No newline at end of file
+var _0x4f93=['PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','length','charAt','system-','transaction','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','User','pick','hasOwnProperty','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','status','end','offset','limit','set','apply','reject','save','update','then','destroy','get','sendStatus','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','filter','where','merge','type','count','includeAll','include','findAll','rows','catch','show','params','options','find','sequelize','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4f93,0x93));var _0x34f9=function(_0x589a21,_0x3bfe2a){_0x589a21=_0x589a21-0x0;var _0x1582f6=_0x4f93[_0x589a21];return _0x1582f6;};'use strict';var pdf=require(_0x34f9('0x0'));var emlformat=require(_0x34f9('0x1'));var rimraf=require(_0x34f9('0x2'));var zipdir=require(_0x34f9('0x3'));var jsonpatch=require(_0x34f9('0x4'));var rp=require('request-promise');var moment=require(_0x34f9('0x5'));var BPromise=require(_0x34f9('0x6'));var Mustache=require(_0x34f9('0x7'));var util=require(_0x34f9('0x8'));var path=require(_0x34f9('0x9'));var sox=require(_0x34f9('0xa'));var csv=require(_0x34f9('0xb'));var ejs=require(_0x34f9('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x34f9('0xd'));var crypto=require(_0x34f9('0xe'));var jsforce=require(_0x34f9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x34f9('0xb'));var querystring=require(_0x34f9('0x10'));var Papa=require('papaparse');var Redis=require(_0x34f9('0x11'));var authService=require(_0x34f9('0x12'));var qs=require(_0x34f9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34f9('0x14'));var logger=require(_0x34f9('0x15'))(_0x34f9('0x16'));var utils=require(_0x34f9('0x17'));var config=require(_0x34f9('0x18'));var db=require(_0x34f9('0x19'))['db'];config['redis']=_['defaults'](config[_0x34f9('0x1a')],{'host':_0x34f9('0x1b'),'port':0x18eb});var socket=require(_0x34f9('0x1c'))(new Redis(config[_0x34f9('0x1a')]));require(_0x34f9('0x1d'))['register'](socket);function respondWithStatusCode(_0x423ae3,_0x10e950){_0x10e950=_0x10e950||0xcc;return function(_0x3be4d6){if(_0x3be4d6){return _0x423ae3['sendStatus'](_0x10e950);}return _0x423ae3[_0x34f9('0x1e')](_0x10e950)[_0x34f9('0x1f')]();};}function respondWithResult(_0x28c893,_0x55026f){_0x55026f=_0x55026f||0xc8;return function(_0x5b10c1){if(_0x5b10c1){return _0x28c893[_0x34f9('0x1e')](_0x55026f)['json'](_0x5b10c1);}};}function respondWithFilteredResult(_0x4fa437,_0x136e40){return function(_0x551b75){if(_0x551b75){var _0x1a841c=_0x551b75['count'],_0x4566ef=_0x136e40[_0x34f9('0x20')],_0xc3d706=_0x136e40['offset']+_0x136e40[_0x34f9('0x21')],_0x37fe9e;if(_0xc3d706>=_0x1a841c){_0xc3d706=_0x1a841c;_0x37fe9e=0xc8;}else{_0x37fe9e=0xce;}_0x4fa437[_0x34f9('0x1e')](_0x37fe9e);return _0x4fa437[_0x34f9('0x22')]('Content-Range',_0x4566ef+'-'+_0xc3d706+'/'+_0x1a841c)['json'](_0x551b75);}return null;};}function patchUpdates(_0x4ef139){return function(_0x36c842){try{jsonpatch[_0x34f9('0x23')](_0x36c842,_0x4ef139,!![]);}catch(_0x9c4d49){return BPromise[_0x34f9('0x24')](_0x9c4d49);}return _0x36c842[_0x34f9('0x25')]();};}function saveUpdates(_0x2f9351,_0x3b8e87){return function(_0x33ebcc){if(_0x33ebcc){return _0x33ebcc[_0x34f9('0x26')](_0x2f9351)[_0x34f9('0x27')](function(_0x45a050){return _0x45a050;});}return null;};}function removeEntity(_0x5ddf58,_0x2b94ac){return function(_0xff899e){if(_0xff899e){return _0xff899e[_0x34f9('0x28')]()[_0x34f9('0x27')](function(){var _0x24110c=_0xff899e[_0x34f9('0x29')]({'plain':!![]});var _0x509bf8='VoicePrefixes';return db['UserProfileResource'][_0x34f9('0x28')]({'where':{'type':_0x509bf8,'resourceId':_0x24110c['id']}})[_0x34f9('0x27')](function(){return _0xff899e;});})[_0x34f9('0x27')](function(){_0x5ddf58['status'](0xcc)[_0x34f9('0x1f')]();});}};}function handleEntityNotFound(_0x599754,_0xa3a1f9){return function(_0xd91277){if(!_0xd91277){_0x599754[_0x34f9('0x2a')](0x194);}return _0xd91277;};}function handleError(_0x4c4a92,_0x3490ba){_0x3490ba=_0x3490ba||0x1f4;return function(_0x21392f){logger['error'](_0x21392f[_0x34f9('0x2b')]);if(_0x21392f[_0x34f9('0x2c')]){delete _0x21392f[_0x34f9('0x2c')];}_0x4c4a92[_0x34f9('0x1e')](_0x3490ba)[_0x34f9('0x2d')](_0x21392f);};}exports[_0x34f9('0x2e')]=function(_0x5341aa,_0x469a9f){var _0x4e37db={},_0x58e3a6={},_0x5bc8d1={'count':0x0,'rows':[]};var _0x269c2a=_[_0x34f9('0x2f')](db[_0x34f9('0x30')][_0x34f9('0x31')],function(_0x4d65e6){return{'name':_0x4d65e6[_0x34f9('0x32')],'type':_0x4d65e6['type'][_0x34f9('0x33')]};});_0x58e3a6[_0x34f9('0x34')]=_[_0x34f9('0x2f')](_0x269c2a,_0x34f9('0x2c'));_0x58e3a6[_0x34f9('0x35')]=_[_0x34f9('0x36')](_0x5341aa[_0x34f9('0x35')]);_0x58e3a6['filters']=_[_0x34f9('0x37')](_0x58e3a6[_0x34f9('0x34')],_0x58e3a6[_0x34f9('0x35')]);_0x4e37db[_0x34f9('0x38')]=_[_0x34f9('0x37')](_0x58e3a6['model'],qs[_0x34f9('0x39')](_0x5341aa[_0x34f9('0x35')][_0x34f9('0x39')]));_0x4e37db[_0x34f9('0x38')]=_0x4e37db[_0x34f9('0x38')]['length']?_0x4e37db[_0x34f9('0x38')]:_0x58e3a6[_0x34f9('0x34')];if(!_0x5341aa[_0x34f9('0x35')]['hasOwnProperty'](_0x34f9('0x3a'))){_0x4e37db['limit']=qs['limit'](_0x5341aa[_0x34f9('0x35')][_0x34f9('0x21')]);_0x4e37db[_0x34f9('0x20')]=qs[_0x34f9('0x20')](_0x5341aa['query'][_0x34f9('0x20')]);}_0x4e37db[_0x34f9('0x3b')]=qs[_0x34f9('0x3c')](_0x5341aa[_0x34f9('0x35')][_0x34f9('0x3c')]);_0x4e37db['where']=qs[_0x34f9('0x3d')](_['pick'](_0x5341aa[_0x34f9('0x35')],_0x58e3a6[_0x34f9('0x3d')]),_0x269c2a);if(_0x5341aa['query'][_0x34f9('0x3e')]){_0x4e37db[_0x34f9('0x3f')]=_[_0x34f9('0x40')](_0x4e37db[_0x34f9('0x3f')],{'$or':_[_0x34f9('0x2f')](_0x269c2a,function(_0x19a314){if(_0x19a314[_0x34f9('0x41')]!=='VIRTUAL'){var _0x574421={};_0x574421[_0x19a314[_0x34f9('0x2c')]]={'$like':'%'+_0x5341aa[_0x34f9('0x35')]['filter']+'%'};return _0x574421;}})});}_0x4e37db=_[_0x34f9('0x40')]({},_0x4e37db,_0x5341aa['options']);var _0x5ebc49={'where':_0x4e37db[_0x34f9('0x3f')]};return db[_0x34f9('0x30')][_0x34f9('0x42')](_0x5ebc49)['then'](function(_0x5d23d1){_0x5bc8d1[_0x34f9('0x42')]=_0x5d23d1;if(_0x5341aa[_0x34f9('0x35')][_0x34f9('0x43')]){_0x4e37db[_0x34f9('0x44')]=[{'all':!![]}];}return db[_0x34f9('0x30')][_0x34f9('0x45')](_0x4e37db);})[_0x34f9('0x27')](function(_0x58c3ab){_0x5bc8d1[_0x34f9('0x46')]=_0x58c3ab;return _0x5bc8d1;})[_0x34f9('0x27')](respondWithFilteredResult(_0x469a9f,_0x4e37db))[_0x34f9('0x47')](handleError(_0x469a9f,null));};exports[_0x34f9('0x48')]=function(_0x38cd3c,_0x128a1f){var _0x593021={'raw':![],'where':{'id':_0x38cd3c[_0x34f9('0x49')]['id']}},_0xa06a0a={};_0xa06a0a[_0x34f9('0x34')]=_[_0x34f9('0x36')](db['VoicePrefix'][_0x34f9('0x31')]);_0xa06a0a[_0x34f9('0x35')]=_['keys'](_0x38cd3c['query']);_0xa06a0a['filters']=_[_0x34f9('0x37')](_0xa06a0a[_0x34f9('0x34')],_0xa06a0a[_0x34f9('0x35')]);_0x593021[_0x34f9('0x38')]=_[_0x34f9('0x37')](_0xa06a0a[_0x34f9('0x34')],qs[_0x34f9('0x39')](_0x38cd3c[_0x34f9('0x35')][_0x34f9('0x39')]));_0x593021[_0x34f9('0x38')]=_0x593021[_0x34f9('0x38')]['length']?_0x593021[_0x34f9('0x38')]:_0xa06a0a[_0x34f9('0x34')];if(_0x38cd3c[_0x34f9('0x35')]['includeAll']){_0x593021['include']=[{'all':!![]}];}_0x593021=_[_0x34f9('0x40')]({},_0x593021,_0x38cd3c[_0x34f9('0x4a')]);return db['VoicePrefix'][_0x34f9('0x4b')](_0x593021)[_0x34f9('0x27')](handleEntityNotFound(_0x128a1f,null))[_0x34f9('0x27')](respondWithResult(_0x128a1f,null))[_0x34f9('0x47')](handleError(_0x128a1f,null));};exports[_0x34f9('0x28')]=function(_0x451ede,_0x1b4913){return db[_0x34f9('0x30')][_0x34f9('0x4b')]({'where':{'id':_0x451ede[_0x34f9('0x49')]['id']}})[_0x34f9('0x27')](handleEntityNotFound(_0x1b4913,null))[_0x34f9('0x27')](removeEntity(_0x1b4913,null))[_0x34f9('0x47')](handleError(_0x1b4913,null));};exports['describe']=function(_0x2a9724,_0x25b641){return db[_0x34f9('0x30')]['describe']()['then'](respondWithResult(_0x25b641,null))[_0x34f9('0x47')](handleError(_0x25b641,null));};exports['create']=function(_0x19ce6d,_0x8d558d){var _0x4505ed;return db[_0x34f9('0x4c')]['transaction'](function(_0x447d20){return db[_0x34f9('0x30')]['create'](_0x19ce6d[_0x34f9('0x4d')],{'transaction':_0x447d20})[_0x34f9('0x27')](function(_0x7b6f47){_0x4505ed=_0x7b6f47[_0x34f9('0x29')]({'plain':!![]});return db[_0x34f9('0x4e')][_0x34f9('0x4b')]({'where':{'id':_0x4505ed[_0x34f9('0x4f')]},'raw':!![]})[_0x34f9('0x27')](function(_0x250c64){return createVoicePrefixExtensions(_0x4505ed,_0x250c64,_0x447d20);});});})['then'](function(){var _0x38f3ea=_0x19ce6d['user'][_0x34f9('0x29')]({'plain':!![]});if(!_0x38f3ea)throw new Error(_0x34f9('0x50'));if(_0x38f3ea[_0x34f9('0x51')]===_0x34f9('0x52')){var _0x53b26d=_0x4505ed;return db[_0x34f9('0x53')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x38f3ea[_0x34f9('0x54')]},'raw':!![]})[_0x34f9('0x27')](function(_0x4a89fa){if(_0x4a89fa&&_0x4a89fa[_0x34f9('0x55')]===0x0){return db[_0x34f9('0x56')][_0x34f9('0x57')]({'name':_0x53b26d['name'],'resourceId':_0x53b26d['id'],'type':_0x4a89fa['name'],'sectionId':_0x4a89fa['id']},{})['then'](function(){return _0x4505ed;});}else{return _0x4505ed;}})[_0x34f9('0x47')](function(_0x35355d){logger[_0x34f9('0x58')](_0x34f9('0x59'),_0x35355d);throw _0x35355d;});}return _0x4505ed;})[_0x34f9('0x27')](respondWithResult(_0x8d558d,null))[_0x34f9('0x47')](handleError(_0x8d558d,null));};function Extension(_0x50b04b,_0x437df9,_0x372c28,_0xa04c40){this['context']=_0x34f9('0x5a');this['exten']=_0x50b04b;this[_0x34f9('0x5b')]=_0x372c28;this[_0x34f9('0x41')]='system';this['description']=_0x34f9('0x5c');this[_0x34f9('0x5d')]=_0x437df9;this['appdata']=_0xa04c40;}function createVoicePrefixExtensions(_0x3fa114,_0x15d17e,_0x371a5c){return new BPromise(function(_0x1dfae2,_0xe99d24){var _0x3b3895=new Extension(formatPrefixName(_0x3fa114[_0x34f9('0x5e')]),0x1,_0x34f9('0x5f'),_0x34f9('0x60'));_0x3b3895['VoicePrefixId']=_0x3fa114['id'];return db['VoiceExtension'][_0x34f9('0x57')](_0x3b3895,{'transaction':_0x371a5c})['then'](function(_0x54c6b2){var _0x382aba=_0x54c6b2[_0x34f9('0x29')]({'plain':!![]});var _0x3804b7=_['map'](addVoicePrefixExtensions(_0x3fa114,_0x15d17e),function(_0x33943e){_0x33943e[_0x34f9('0x4f')]=_0x382aba['id'];_0x33943e['VoicePrefixId']=_0x3fa114['id'];return _0x33943e;});return db['VoiceExtension'][_0x34f9('0x61')](_0x3804b7,{'transaction':_0x371a5c})[_0x34f9('0x27')](function(_0x409498){if(!_0x409498){return _0xe99d24(_0x34f9('0x62'));}else{return _0x1dfae2(_0x409498);}})['catch'](function(_0x2cc493){return _0xe99d24(_0x2cc493);});});;});};function addVoicePrefixExtensions(_0x40f9dc,_0x14fe7c){var _0x541c0d=[];var _0x4c9429=formatPrefixName(_0x40f9dc['prefix']);_0x541c0d['push'](new Extension(_0x4c9429,0x2,_0x34f9('0x63'),_0x34f9('0x64')+_0x40f9dc[_0x34f9('0x2c')]));if(_0x40f9dc[_0x34f9('0x65')]){_0x541c0d[_0x34f9('0x66')](new Extension(_0x4c9429,0x3,'Set',_0x34f9('0x67')+_0x40f9dc[_0x34f9('0x65')]));}else{_0x541c0d[_0x34f9('0x66')](new Extension(_0x4c9429,0x3,_0x34f9('0x5f'),_0x34f9('0x68')));}_0x541c0d['push'](new Extension(_0x4c9429,0x4,_0x34f9('0x69'),_0x14fe7c[_0x34f9('0x6a')]+','+_0x34f9('0x6b')+(0x8+_0x40f9dc[_0x34f9('0x2c')]['length'])+'}'+','+0x1));return _0x541c0d;}function formatPrefixName(_0x18db98){var _0xa6f55b='_';for(var _0x538971=0x0;_0x538971<_0x18db98[_0x34f9('0x6c')];_0x538971++){if(_0x18db98[_0x34f9('0x6d')](_0x538971)=='-'){_0xa6f55b+=_0x18db98[_0x34f9('0x6d')](_0x538971);}else{_0xa6f55b+='['+_0x18db98[_0x34f9('0x6d')](_0x538971)+']';}}_0xa6f55b+='.';return _0xa6f55b;}exports[_0x34f9('0x26')]=function(_0x3c98b1,_0x560afc,_0x578c7a){var _0x1ffb07=_0x3c98b1[_0x34f9('0x4d')];_0x1ffb07[_0x34f9('0x5e')]=_0x34f9('0x6e')+_0x1ffb07[_0x34f9('0x2c')]+'-';return db[_0x34f9('0x4c')][_0x34f9('0x6f')](function(_0x3523f7){return db[_0x34f9('0x30')]['update'](_0x1ffb07,{'where':{'id':_0x1ffb07['id']},'transaction':_0x3523f7})[_0x34f9('0x27')](function(){return db[_0x34f9('0x4e')][_0x34f9('0x28')]({'where':{'VoicePrefixId':_0x1ffb07['id']},'transaction':_0x3523f7})[_0x34f9('0x27')](function(){return db[_0x34f9('0x4e')][_0x34f9('0x4b')]({'where':{'id':_0x1ffb07['VoiceExtensionId']},'raw':!![]})[_0x34f9('0x27')](function(_0x2bdf69){return createVoicePrefixExtensions(_0x1ffb07,_0x2bdf69,_0x3523f7);});});});})[_0x34f9('0x27')](function(){return db[_0x34f9('0x30')]['findById'](_0x1ffb07['id']);})[_0x34f9('0x27')](respondWithResult(_0x560afc,null))[_0x34f9('0x47')](handleError(_0x560afc,null));};exports[_0x34f9('0x70')]=function(_0x148e62,_0x217c56,_0x5f3e49){return db[_0x34f9('0x30')][_0x34f9('0x4b')]({'where':{'id':_0x148e62[_0x34f9('0x49')]['id']}})[_0x34f9('0x27')](handleEntityNotFound(_0x217c56,null))[_0x34f9('0x27')](function(_0x1803de){if(_0x1803de){return _0x1803de[_0x34f9('0x70')](_0x148e62[_0x34f9('0x4d')][_0x34f9('0x71')],_[_0x34f9('0x72')](_0x148e62[_0x34f9('0x4d')],[_0x34f9('0x71'),'id'])||{})[_0x34f9('0x73')](function(_0x21a773){for(var _0x24122e=0x0;_0x24122e<_0x148e62[_0x34f9('0x4d')]['ids'][_0x34f9('0x6c')];_0x24122e+=0x1){socket['emit'](_0x34f9('0x74'),{'UserId':_0x148e62[_0x34f9('0x4d')]['ids'][_0x24122e],'VoicePrefixId':_0x148e62['params']['id']});}return _0x21a773;});}})[_0x34f9('0x27')](respondWithResult(_0x217c56,null))[_0x34f9('0x47')](handleError(_0x217c56,null));};exports[_0x34f9('0x75')]=function(_0x17831f,_0x442097,_0x406fcd){return db[_0x34f9('0x30')][_0x34f9('0x4b')]({'where':{'id':_0x17831f[_0x34f9('0x49')]['id']}})['then'](handleEntityNotFound(_0x442097,null))[_0x34f9('0x27')](function(_0x162423){if(_0x162423){return _0x162423['removeAgents'](_0x17831f[_0x34f9('0x35')][_0x34f9('0x71')])[_0x34f9('0x27')](function(){if(_[_0x34f9('0x76')](_0x17831f[_0x34f9('0x35')][_0x34f9('0x71')])){for(var _0x196d98=0x0;_0x196d98<_0x17831f['query'][_0x34f9('0x71')]['length'];_0x196d98+=0x1){socket[_0x34f9('0x77')](_0x34f9('0x78'),{'UserId':Number(_0x17831f[_0x34f9('0x35')][_0x34f9('0x71')][_0x196d98]),'VoicePrefixId':Number(_0x17831f[_0x34f9('0x49')]['id'])});}}else{socket[_0x34f9('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x17831f['query'][_0x34f9('0x71')]),'VoicePrefixId':Number(_0x17831f[_0x34f9('0x49')]['id'])});}});}})[_0x34f9('0x27')](respondWithStatusCode(_0x442097,null))[_0x34f9('0x47')](handleError(_0x442097,null));};exports['getAgents']=function(_0xd052f9,_0x2f023e,_0x50aa92){var _0x2df1da={};var _0x47b1e7={};var _0x266330;var _0x8c345a;return db[_0x34f9('0x30')]['findOne']({'where':{'id':_0xd052f9[_0x34f9('0x49')]['id']}})['then'](handleEntityNotFound(_0x2f023e,null))[_0x34f9('0x27')](function(_0x323ca2){if(_0x323ca2){_0x266330=_0x323ca2;_0x47b1e7[_0x34f9('0x34')]=_[_0x34f9('0x36')](db[_0x34f9('0x79')]['rawAttributes']);_0x47b1e7['query']=_[_0x34f9('0x36')](_0xd052f9[_0x34f9('0x35')]);_0x47b1e7[_0x34f9('0x3d')]=_[_0x34f9('0x37')](_0x47b1e7[_0x34f9('0x34')],_0x47b1e7['query']);_0x2df1da[_0x34f9('0x38')]=_[_0x34f9('0x37')](_0x47b1e7['model'],qs[_0x34f9('0x39')](_0xd052f9['query'][_0x34f9('0x39')]));_0x2df1da[_0x34f9('0x38')]=_0x2df1da[_0x34f9('0x38')]['length']?_0x2df1da[_0x34f9('0x38')]:_0x47b1e7[_0x34f9('0x34')];_0x2df1da[_0x34f9('0x3b')]=qs[_0x34f9('0x3c')](_0xd052f9['query'][_0x34f9('0x3c')]);_0x2df1da[_0x34f9('0x3f')]=qs[_0x34f9('0x3d')](_[_0x34f9('0x7a')](_0xd052f9[_0x34f9('0x35')],_0x47b1e7[_0x34f9('0x3d')]));if(_0xd052f9['query'][_0x34f9('0x3e')]){_0x2df1da['where']=_[_0x34f9('0x40')](_0x2df1da[_0x34f9('0x3f')],{'$or':_[_0x34f9('0x2f')](_0x2df1da[_0x34f9('0x38')],function(_0x3c54e8){var _0x3d79b2={};_0x3d79b2[_0x3c54e8]={'$like':'%'+_0xd052f9[_0x34f9('0x35')][_0x34f9('0x3e')]+'%'};return _0x3d79b2;})});}_0x2df1da=_['merge']({},_0x2df1da,_0xd052f9['options']);return _0x266330['getAgents'](_0x2df1da);}})[_0x34f9('0x27')](function(_0x4eefc9){if(_0x4eefc9){_0x8c345a=_0x4eefc9['length'];if(!_0xd052f9[_0x34f9('0x35')][_0x34f9('0x7b')](_0x34f9('0x3a'))){_0x2df1da[_0x34f9('0x21')]=qs[_0x34f9('0x21')](_0xd052f9[_0x34f9('0x35')][_0x34f9('0x21')]);_0x2df1da['offset']=qs[_0x34f9('0x20')](_0xd052f9[_0x34f9('0x35')][_0x34f9('0x20')]);}return _0x266330[_0x34f9('0x7c')](_0x2df1da);}})['then'](function(_0x6c06c6){if(_0x6c06c6){return _0x6c06c6?{'count':_0x8c345a,'rows':_0x6c06c6}:null;}})[_0x34f9('0x27')](respondWithResult(_0x2f023e,null))[_0x34f9('0x47')](handleError(_0x2f023e,null));};
\ No newline at end of file
index f291442..91e8555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['emit','events','../../mysqldb','VoicePrefix','update','remove'];(function(_0x1f0525,_0x3d5c8f){var _0x24d63f=function(_0x70c41e){while(--_0x70c41e){_0x1f0525['push'](_0x1f0525['shift']());}};_0x24d63f(++_0x3d5c8f);}(_0x70e0,0x17b));var _0x070e=function(_0x50b152,_0x1f2043){_0x50b152=_0x50b152-0x0;var _0x3c6e01=_0x70e0[_0x50b152];return _0x3c6e01;};'use strict';var EventEmitter=require(_0x070e('0x0'));var VoicePrefix=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){VoicePrefixEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);VoicePrefixEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x34e8,0x12c));var _0x834e=function(_0x6a7788,_0x160633){_0x6a7788=_0x6a7788-0x0;var _0x1cec31=_0x34e8[_0x6a7788];return _0x1cec31;};'use strict';var EventEmitter=require(_0x834e('0x0'));var VoicePrefix=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){VoicePrefixEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);VoicePrefixEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=VoicePrefixEvents;
\ No newline at end of file
index c4c78bc..29a4908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3783=['request-promise','../../config/environment','./voicePrefix.attributes','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','bluebird'];(function(_0xdc299,_0x4b0641){var _0x46ed2f=function(_0x2e2917){while(--_0x2e2917){_0xdc299['push'](_0xdc299['shift']());}};_0x46ed2f(++_0x4b0641);}(_0x3783,0x9b));var _0x3378=function(_0x210f0a,_0x418595){_0x210f0a=_0x210f0a-0x0;var _0x597bfb=_0x3783[_0x210f0a];return _0x597bfb;};'use strict';var _=require(_0x3378('0x0'));var util=require(_0x3378('0x1'));var logger=require(_0x3378('0x2'))(_0x3378('0x3'));var moment=require('moment');var BPromise=require(_0x3378('0x4'));var rp=require(_0x3378('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3378('0x6'));var attributes=require(_0x3378('0x7'));module['exports']=function(_0x539ac2,_0x5b3e61){return _0x539ac2['define'](_0x3378('0x8'),attributes,{'tableName':_0x3378('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3804=['bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','api','moment'];(function(_0x2e3d63,_0xb43a9b){var _0x105946=function(_0x466785){while(--_0x466785){_0x2e3d63['push'](_0x2e3d63['shift']());}};_0x105946(++_0xb43a9b);}(_0x3804,0x1dd));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4380('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4380('0x1'));var moment=require(_0x4380('0x2'));var BPromise=require(_0x4380('0x3'));var rp=require(_0x4380('0x4'));var fs=require('fs');var path=require(_0x4380('0x5'));var rimraf=require('rimraf');var config=require(_0x4380('0x6'));var attributes=require(_0x4380('0x7'));module[_0x4380('0x8')]=function(_0x473ba3,_0x4e7b5a){return _0x473ba3[_0x4380('0x9')](_0x4380('0xa'),attributes,{'tableName':_0x4380('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 980051e..956aae4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeba5=['VoicePrefix,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','error','code'];(function(_0x23cd34,_0xe7e8f7){var _0x1e1e48=function(_0x820992){while(--_0x820992){_0x23cd34['push'](_0x23cd34['shift']());}};_0x1e1e48(++_0xe7e8f7);}(_0xeba5,0xd2));var _0x5eba=function(_0x1a7103,_0x1237a1){_0x1a7103=_0x1a7103-0x0;var _0x285563=_0xeba5[_0x1a7103];return _0x285563;};'use strict';var _=require(_0x5eba('0x0'));var util=require(_0x5eba('0x1'));var moment=require(_0x5eba('0x2'));var BPromise=require(_0x5eba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5eba('0x4'))['db'];var utils=require(_0x5eba('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5eba('0x6'));var client=jayson[_0x5eba('0x7')][_0x5eba('0x8')]({'port':0x232a});config[_0x5eba('0x9')]=_[_0x5eba('0xa')](config[_0x5eba('0x9')],{'host':_0x5eba('0xb'),'port':0x18eb});var socket=require(_0x5eba('0xc'))(new Redis(config[_0x5eba('0x9')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x5819e3,_0x262e88,_0x2497ca){return new BPromise(function(_0x4f0fcf,_0x149831){return client[_0x5eba('0xd')](_0x5819e3,_0x2497ca)[_0x5eba('0xe')](function(_0xeff21b){logger[_0x5eba('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x262e88,_0x5eba('0x10'));logger[_0x5eba('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x262e88,'request\x20sent',JSON['stringify'](_0xeff21b));if(_0xeff21b[_0x5eba('0x12')]){if(_0xeff21b[_0x5eba('0x12')][_0x5eba('0x13')]===0x1f4){logger['error'](_0x5eba('0x14'),_0x262e88,_0xeff21b[_0x5eba('0x12')][_0x5eba('0x15')]);return _0x149831(_0xeff21b['error'][_0x5eba('0x15')]);}logger[_0x5eba('0x12')](_0x5eba('0x14'),_0x262e88,_0xeff21b[_0x5eba('0x12')]['message']);return _0x4f0fcf(_0xeff21b[_0x5eba('0x12')][_0x5eba('0x15')]);}else{logger['info'](_0x5eba('0x14'),_0x262e88,_0x5eba('0x10'));_0x4f0fcf(_0xeff21b['result'][_0x5eba('0x15')]);}})[_0x5eba('0x16')](function(_0x3910e4){logger[_0x5eba('0x12')](_0x5eba('0x14'),_0x262e88,_0x3910e4);_0x149831(_0x3910e4);});});}
\ No newline at end of file
+var _0xda1e=['register','request','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','VoicePrefix,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./voicePrefix.socket'];(function(_0x3fcd33,_0x2fe1ba){var _0x437ebd=function(_0x4ea902){while(--_0x4ea902){_0x3fcd33['push'](_0x3fcd33['shift']());}};_0x437ebd(++_0x2fe1ba);}(_0xda1e,0xeb));var _0xeda1=function(_0x3ab46c,_0x4d26cc){_0x3ab46c=_0x3ab46c-0x0;var _0x2c7e90=_0xda1e[_0x3ab46c];return _0x2c7e90;};'use strict';var _=require(_0xeda1('0x0'));var util=require('util');var moment=require(_0xeda1('0x1'));var BPromise=require(_0xeda1('0x2'));var rs=require(_0xeda1('0x3'));var fs=require('fs');var Redis=require(_0xeda1('0x4'));var db=require(_0xeda1('0x5'))['db'];var utils=require(_0xeda1('0x6'));var logger=require(_0xeda1('0x7'))(_0xeda1('0x8'));var config=require(_0xeda1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeda1('0xa')][_0xeda1('0xb')]({'port':0x232a});config[_0xeda1('0xc')]=_[_0xeda1('0xd')](config[_0xeda1('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xeda1('0xe'))[_0xeda1('0xf')](socket);function respondWithRpcPromise(_0x1f6708,_0x58b013,_0x28bde1){return new BPromise(function(_0x293001,_0x1161e6){return client[_0xeda1('0x10')](_0x1f6708,_0x28bde1)[_0xeda1('0x11')](function(_0x3f01fd){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x58b013,_0xeda1('0x12'));logger[_0xeda1('0x13')](_0xeda1('0x14'),_0x58b013,_0xeda1('0x12'),JSON['stringify'](_0x3f01fd));if(_0x3f01fd['error']){if(_0x3f01fd[_0xeda1('0x15')]['code']===0x1f4){logger['error'](_0xeda1('0x16'),_0x58b013,_0x3f01fd[_0xeda1('0x15')][_0xeda1('0x17')]);return _0x1161e6(_0x3f01fd[_0xeda1('0x15')]['message']);}logger[_0xeda1('0x15')](_0xeda1('0x16'),_0x58b013,_0x3f01fd[_0xeda1('0x15')][_0xeda1('0x17')]);return _0x293001(_0x3f01fd[_0xeda1('0x15')][_0xeda1('0x17')]);}else{logger[_0xeda1('0x18')](_0xeda1('0x16'),_0x58b013,_0xeda1('0x12'));_0x293001(_0x3f01fd['result']['message']);}})['catch'](function(_0xfa39d){logger[_0xeda1('0x15')](_0xeda1('0x16'),_0x58b013,_0xfa39d);_0x1161e6(_0xfa39d);});});}
\ No newline at end of file
index 6de412c..9c73c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e1b=['remove','emit','removeListener','length','voicePrefix:'];(function(_0x2027f5,_0x5a68c1){var _0x346d21=function(_0x28735c){while(--_0x28735c){_0x2027f5['push'](_0x2027f5['shift']());}};_0x346d21(++_0x5a68c1);}(_0x7e1b,0x1ae));var _0xb7e1=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x7e1b[_0x45783c];return _0x1161da;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0xb7e1('0x0'),'update'];function createListener(_0x5d556b,_0x257d58){return function(_0x54eeb1){_0x257d58[_0xb7e1('0x1')](_0x5d556b,_0x54eeb1);};}function removeListener(_0x31495c,_0x4721e0){return function(){VoicePrefixEvents[_0xb7e1('0x2')](_0x31495c,_0x4721e0);};}exports['register']=function(_0x4247d7){for(var _0x338c5c=0x0,_0x3c1aa3=events[_0xb7e1('0x3')];_0x338c5c<_0x3c1aa3;_0x338c5c++){var _0xcd1a3f=events[_0x338c5c];var _0xf88942=createListener(_0xb7e1('0x4')+_0xcd1a3f,_0x4247d7);VoicePrefixEvents['on'](_0xcd1a3f,_0xf88942);}};
\ No newline at end of file
+var _0xa18a=['register','length','voicePrefix:','save','remove','emit','removeListener'];(function(_0x423a86,_0x1bd372){var _0x1a1a53=function(_0x5af463){while(--_0x5af463){_0x423a86['push'](_0x423a86['shift']());}};_0x1a1a53(++_0x1bd372);}(_0xa18a,0xa4));var _0xaa18=function(_0x53f375,_0x1b03b1){_0x53f375=_0x53f375-0x0;var _0x34a443=_0xa18a[_0x53f375];return _0x34a443;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xaa18('0x0'),_0xaa18('0x1'),'update'];function createListener(_0x7b9421,_0x46cb52){return function(_0x2f96b9){_0x46cb52[_0xaa18('0x2')](_0x7b9421,_0x2f96b9);};}function removeListener(_0x59e3ac,_0x241a58){return function(){VoicePrefixEvents[_0xaa18('0x3')](_0x59e3ac,_0x241a58);};}exports[_0xaa18('0x4')]=function(_0x5a2f7c){for(var _0x1399ee=0x0,_0x5983ff=events[_0xaa18('0x5')];_0x1399ee<_0x5983ff;_0x1399ee++){var _0x1e6973=events[_0x1399ee];var _0x4b0ce3=createListener(_0xaa18('0x6')+_0x1e6973,_0x5a2f7c);VoicePrefixEvents['on'](_0x1e6973,_0x4b0ce3);}};
\ No newline at end of file
index 2767ecd..829d8a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb523=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/lists','getLists','post','create','clone','addLists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','/:id/blacklists','removeBlackLists','exports','multer','util','express','../../config/environment','get','/:id','isAuthenticated'];(function(_0x2fb183,_0x57d6a5){var _0x3aebf4=function(_0x1f98ea){while(--_0x1f98ea){_0x2fb183['push'](_0x2fb183['shift']());}};_0x3aebf4(++_0x57d6a5);}(_0xb523,0xe7));var _0x3b52=function(_0x3e3f7b,_0xf851b4){_0x3e3f7b=_0x3e3f7b-0x0;var _0x590c15=_0xb523[_0x3e3f7b];return _0x590c15;};'use strict';var multer=require(_0x3b52('0x0'));var util=require(_0x3b52('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b52('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b52('0x3'));var controller=require('./voiceQueue.controller');router[_0x3b52('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3b52('0x4')](_0x3b52('0x5'),auth[_0x3b52('0x6')](),controller[_0x3b52('0x7')]);router['get'](_0x3b52('0x8'),auth['isAuthenticated'](),controller[_0x3b52('0x9')]);router[_0x3b52('0x4')](_0x3b52('0xa'),auth[_0x3b52('0x6')](),controller[_0x3b52('0xb')]);router[_0x3b52('0x4')]('/:id/hopper_finals',auth[_0x3b52('0x6')](),controller[_0x3b52('0xc')]);router[_0x3b52('0x4')]('/:id/hopper_black',auth[_0x3b52('0x6')](),controller[_0x3b52('0xd')]);router[_0x3b52('0x4')](_0x3b52('0xe'),auth['isAuthenticated'](),controller[_0x3b52('0xf')]);router[_0x3b52('0x4')](_0x3b52('0x10'),auth[_0x3b52('0x6')](),controller[_0x3b52('0x11')]);router[_0x3b52('0x4')]('/:id/members',auth[_0x3b52('0x6')](),controller['getMembers']);router[_0x3b52('0x4')](_0x3b52('0x12'),auth[_0x3b52('0x6')](),controller[_0x3b52('0x13')]);router[_0x3b52('0x4')]('/:id/blacklists',auth[_0x3b52('0x6')](),controller['getBlackLists']);router[_0x3b52('0x14')]('/',auth[_0x3b52('0x6')](),controller[_0x3b52('0x15')]);router[_0x3b52('0x14')]('/:id/clone',auth[_0x3b52('0x6')](),controller[_0x3b52('0x16')]);router[_0x3b52('0x14')](_0x3b52('0xe'),auth[_0x3b52('0x6')](),controller['addTeams']);router[_0x3b52('0x14')]('/:id/users',auth[_0x3b52('0x6')](),controller['addAgents']);router['post']('/:id/lists',auth['isAuthenticated'](),controller[_0x3b52('0x17')]);router['post']('/:id/blacklists',auth[_0x3b52('0x6')](),controller[_0x3b52('0x18')]);router['put'](_0x3b52('0x5'),auth[_0x3b52('0x6')](),controller[_0x3b52('0x19')]);router[_0x3b52('0x1a')](_0x3b52('0x5'),auth[_0x3b52('0x6')](),controller[_0x3b52('0x1b')]);router[_0x3b52('0x1a')](_0x3b52('0xe'),auth[_0x3b52('0x6')](),controller[_0x3b52('0x1c')]);router[_0x3b52('0x1a')]('/:id/users',auth['isAuthenticated'](),controller[_0x3b52('0x1d')]);router[_0x3b52('0x1a')](_0x3b52('0x12'),auth[_0x3b52('0x6')](),controller[_0x3b52('0x1e')]);router['delete'](_0x3b52('0x1f'),auth['isAuthenticated'](),controller[_0x3b52('0x20')]);module[_0x3b52('0x21')]=router;
\ No newline at end of file
+var _0x8561=['getLists','/:id/blacklists','post','create','/:id/clone','addTeams','addAgents','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','/:id/teams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','getMembers'];(function(_0x5d86ee,_0xf6a675){var _0x533120=function(_0x4d0628){while(--_0x4d0628){_0x5d86ee['push'](_0x5d86ee['shift']());}};_0x533120(++_0xf6a675);}(_0x8561,0x1e5));var _0x1856=function(_0x460ab9,_0x3815ac){_0x460ab9=_0x460ab9-0x0;var _0x27ef6e=_0x8561[_0x460ab9];return _0x27ef6e;};'use strict';var multer=require(_0x1856('0x0'));var util=require(_0x1856('0x1'));var path=require(_0x1856('0x2'));var timeout=require(_0x1856('0x3'));var express=require(_0x1856('0x4'));var router=express[_0x1856('0x5')]();var auth=require(_0x1856('0x6'));var interaction=require(_0x1856('0x7'));var config=require(_0x1856('0x8'));var controller=require(_0x1856('0x9'));router[_0x1856('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1856('0xa')](_0x1856('0xb'),auth[_0x1856('0xc')](),controller[_0x1856('0xd')]);router[_0x1856('0xa')](_0x1856('0xe'),auth['isAuthenticated'](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0x1856('0xc')](),controller['getHopperHistories']);router[_0x1856('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x1856('0xf')]);router['get'](_0x1856('0x10'),auth[_0x1856('0xc')](),controller[_0x1856('0x11')]);router[_0x1856('0xa')]('/:id/teams',auth[_0x1856('0xc')](),controller[_0x1856('0x12')]);router[_0x1856('0xa')](_0x1856('0x13'),auth['isAuthenticated'](),controller[_0x1856('0x14')]);router[_0x1856('0xa')]('/:id/members',auth[_0x1856('0xc')](),controller[_0x1856('0x15')]);router[_0x1856('0xa')]('/:id/lists',auth[_0x1856('0xc')](),controller[_0x1856('0x16')]);router[_0x1856('0xa')](_0x1856('0x17'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x1856('0x18')]('/',auth['isAuthenticated'](),controller[_0x1856('0x19')]);router[_0x1856('0x18')](_0x1856('0x1a'),auth[_0x1856('0xc')](),controller['clone']);router[_0x1856('0x18')]('/:id/teams',auth[_0x1856('0xc')](),controller[_0x1856('0x1b')]);router[_0x1856('0x18')](_0x1856('0x13'),auth[_0x1856('0xc')](),controller[_0x1856('0x1c')]);router[_0x1856('0x18')](_0x1856('0x1d'),auth[_0x1856('0xc')](),controller[_0x1856('0x1e')]);router[_0x1856('0x18')](_0x1856('0x17'),auth[_0x1856('0xc')](),controller[_0x1856('0x1f')]);router[_0x1856('0x20')](_0x1856('0xb'),auth['isAuthenticated'](),controller[_0x1856('0x21')]);router[_0x1856('0x22')]('/:id',auth[_0x1856('0xc')](),controller[_0x1856('0x23')]);router['delete'](_0x1856('0x24'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x1856('0x22')](_0x1856('0x13'),auth['isAuthenticated'](),controller[_0x1856('0x25')]);router[_0x1856('0x22')](_0x1856('0x1d'),auth[_0x1856('0xc')](),controller['removeLists']);router[_0x1856('0x22')](_0x1856('0x17'),auth[_0x1856('0xc')](),controller['removeBlackLists']);module[_0x1856('0x26')]=router;
\ No newline at end of file
index 871c501..9dd6869 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','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,<project_name>)','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','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x31ff78,_0x423e2c){var _0x484272=function(_0x33783a){while(--_0x33783a){_0x31ff78['push'](_0x31ff78['shift']());}};_0x484272(++_0x423e2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','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,<project_name>)','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','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x7c7a41,_0x11a170){var _0x5c09d3=function(_0x5dec92){while(--_0x5dec92){_0x7c7a41['push'](_0x7c7a41['shift']());}};_0x5c09d3(++_0x11a170);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index 01f05e0..ac52091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13e1=['addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','./voiceQueue.socket','register','sendStatus','status','json','count','offset','set','apply','reject','then','get','VoiceQueues','inbound','QueueCampaigns','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','end','error','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','compact','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','isArray','getAgents','getMembers','getLists','CmList','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','NOW()','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','insert','fromQuery','COALESCE(phone,\x27\x27)','all','removeLists','getBlackLists'];(function(_0xe6e3e2,_0x2b01da){var _0x126571=function(_0x515ab3){while(--_0x515ab3){_0xe6e3e2['push'](_0xe6e3e2['shift']());}};_0x126571(++_0x2b01da);}(_0x13e1,0x171));var _0x113e=function(_0x552ef4,_0x425665){_0x552ef4=_0x552ef4-0x0;var _0x2c7a44=_0x13e1[_0x552ef4];return _0x2c7a44;};'use strict';var pdf=require(_0x113e('0x0'));var emlformat=require(_0x113e('0x1'));var rimraf=require(_0x113e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x113e('0x3'));var moment=require(_0x113e('0x4'));var BPromise=require(_0x113e('0x5'));var Mustache=require(_0x113e('0x6'));var util=require('util');var path=require(_0x113e('0x7'));var sox=require(_0x113e('0x8'));var csv=require(_0x113e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x113e('0xa'));var squel=require(_0x113e('0xb'));var crypto=require('crypto');var jsforce=require(_0x113e('0xc'));var deskjs=require(_0x113e('0xd'));var toCsv=require(_0x113e('0x9'));var querystring=require(_0x113e('0xe'));var Papa=require(_0x113e('0xf'));var Redis=require(_0x113e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x113e('0x11'));var as=require(_0x113e('0x12'));var hardwareService=require(_0x113e('0x13'));var logger=require(_0x113e('0x14'))(_0x113e('0x15'));var utils=require(_0x113e('0x16'));var config=require('../../config/environment');var db=require(_0x113e('0x17'))['db'];config[_0x113e('0x18')]=_[_0x113e('0x19')](config[_0x113e('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x113e('0x18')]));require(_0x113e('0x1a'))[_0x113e('0x1b')](socket);function respondWithStatusCode(_0x3cfec3,_0x6fe12){_0x6fe12=_0x6fe12||0xcc;return function(_0x5079f0){if(_0x5079f0){return _0x3cfec3[_0x113e('0x1c')](_0x6fe12);}return _0x3cfec3[_0x113e('0x1d')](_0x6fe12)['end']();};}function respondWithResult(_0x41ddf3,_0x5e355b){_0x5e355b=_0x5e355b||0xc8;return function(_0x460cc8){if(_0x460cc8){return _0x41ddf3[_0x113e('0x1d')](_0x5e355b)[_0x113e('0x1e')](_0x460cc8);}};}function respondWithFilteredResult(_0x3a2b2c,_0x5dd413){return function(_0x4ad659){if(_0x4ad659){var _0x4092ea=_0x4ad659[_0x113e('0x1f')],_0x5e3506=_0x5dd413[_0x113e('0x20')],_0x8e263d=_0x5dd413['offset']+_0x5dd413['limit'],_0x143db9;if(_0x8e263d>=_0x4092ea){_0x8e263d=_0x4092ea;_0x143db9=0xc8;}else{_0x143db9=0xce;}_0x3a2b2c[_0x113e('0x1d')](_0x143db9);return _0x3a2b2c[_0x113e('0x21')]('Content-Range',_0x5e3506+'-'+_0x8e263d+'/'+_0x4092ea)[_0x113e('0x1e')](_0x4ad659);}return null;};}function patchUpdates(_0x4c65c9){return function(_0x229305){try{jsonpatch[_0x113e('0x22')](_0x229305,_0x4c65c9,!![]);}catch(_0x845aba){return BPromise[_0x113e('0x23')](_0x845aba);}return _0x229305['save']();};}function saveUpdates(_0x38af02,_0x54f4e5){return function(_0x50b6e0){if(_0x50b6e0){return _0x50b6e0['update'](_0x38af02)['then'](function(_0xe3e033){return _0xe3e033;});}return null;};}function removeEntity(_0x5b98a1,_0x1c4f3e){return function(_0x2463e7){if(_0x2463e7){return _0x2463e7['destroy']()[_0x113e('0x24')](function(){var _0x4fda1e=_0x2463e7[_0x113e('0x25')]({'plain':!![]});var _0x5f322c=[{'name':_0x113e('0x26'),'value':_0x113e('0x27'),'ignore':![]},{'name':_0x113e('0x28'),'value':'outbound','ignore':![]}];var _0x4528eb=_(_0x5f322c)['filter'](_0x113e('0x29'))[_0x113e('0x2a')](_0x113e('0x2b'))[_0x113e('0x2b')]();if(_[_0x113e('0x2c')](_0x4528eb,_0x4fda1e[_0x113e('0x2d')])){return;}var _0x535939=_[_0x113e('0x2e')](_0x5f322c,['value',_0x4fda1e[_0x113e('0x2d')]])[_0x113e('0x2f')];return db[_0x113e('0x30')][_0x113e('0x31')]({'where':{'type':_0x535939,'resourceId':_0x4fda1e['id']}})[_0x113e('0x24')](function(){return _0x2463e7;});})[_0x113e('0x24')](function(){_0x5b98a1['status'](0xcc)[_0x113e('0x32')]();});}};}function handleEntityNotFound(_0x51587f,_0x5b31a9){return function(_0x5338f0){if(!_0x5338f0){_0x51587f[_0x113e('0x1c')](0x194);}return _0x5338f0;};}function handleError(_0x405504,_0x32c0c3){_0x32c0c3=_0x32c0c3||0x1f4;return function(_0x316159){logger[_0x113e('0x33')](_0x316159['stack']);if(_0x316159['name']){delete _0x316159[_0x113e('0x2f')];}_0x405504[_0x113e('0x1d')](_0x32c0c3)[_0x113e('0x34')](_0x316159);};}exports[_0x113e('0x35')]=function(_0x381021,_0x462690){var _0x99e04a={},_0x95b962={},_0x28869e={'count':0x0,'rows':[]};var _0x528d0d=_[_0x113e('0x2a')](db[_0x113e('0x36')][_0x113e('0x37')],function(_0xb3a416){return{'name':_0xb3a416[_0x113e('0x38')],'type':_0xb3a416[_0x113e('0x2d')][_0x113e('0x39')]};});_0x95b962[_0x113e('0x3a')]=_[_0x113e('0x2a')](_0x528d0d,_0x113e('0x2f'));_0x95b962[_0x113e('0x3b')]=_['keys'](_0x381021[_0x113e('0x3b')]);_0x95b962[_0x113e('0x3c')]=_[_0x113e('0x3d')](_0x95b962[_0x113e('0x3a')],_0x95b962[_0x113e('0x3b')]);_0x99e04a[_0x113e('0x3e')]=_['intersection'](_0x95b962[_0x113e('0x3a')],qs[_0x113e('0x3f')](_0x381021[_0x113e('0x3b')]['fields']));_0x99e04a[_0x113e('0x3e')]=_0x99e04a[_0x113e('0x3e')][_0x113e('0x40')]?_0x99e04a[_0x113e('0x3e')]:_0x95b962[_0x113e('0x3a')];if(!_0x381021['query'][_0x113e('0x41')](_0x113e('0x42'))){_0x99e04a['limit']=qs['limit'](_0x381021[_0x113e('0x3b')][_0x113e('0x43')]);_0x99e04a['offset']=qs['offset'](_0x381021[_0x113e('0x3b')][_0x113e('0x20')]);}_0x99e04a[_0x113e('0x44')]=qs[_0x113e('0x45')](_0x381021[_0x113e('0x3b')][_0x113e('0x45')]);_0x99e04a[_0x113e('0x46')]=qs[_0x113e('0x3c')](_[_0x113e('0x47')](_0x381021[_0x113e('0x3b')],_0x95b962[_0x113e('0x3c')]),_0x528d0d);if(_0x381021[_0x113e('0x3b')]['filter']){_0x99e04a['where']=_[_0x113e('0x48')](_0x99e04a[_0x113e('0x46')],{'$or':_['map'](_0x528d0d,function(_0x4525d2){if(_0x4525d2[_0x113e('0x2d')]!==_0x113e('0x49')){var _0x56c9b4={};_0x56c9b4[_0x4525d2['name']]={'$like':'%'+_0x381021[_0x113e('0x3b')][_0x113e('0x4a')]+'%'};return _0x56c9b4;}})});}_0x99e04a=_['merge']({},_0x99e04a,_0x381021[_0x113e('0x4b')]);var _0x5e0923={'where':_0x99e04a[_0x113e('0x46')]};return db[_0x113e('0x36')]['count'](_0x5e0923)['then'](function(_0x2a5af7){_0x28869e['count']=_0x2a5af7;if(_0x381021[_0x113e('0x3b')][_0x113e('0x4c')]){_0x99e04a[_0x113e('0x4d')]=[{'all':!![]}];}return db[_0x113e('0x36')][_0x113e('0x4e')](_0x99e04a);})[_0x113e('0x24')](function(_0x2271ec){_0x28869e[_0x113e('0x4f')]=_0x2271ec;return _0x28869e;})[_0x113e('0x24')](respondWithFilteredResult(_0x462690,_0x99e04a))[_0x113e('0x50')](handleError(_0x462690,null));};exports[_0x113e('0x51')]=function(_0x3ac89a,_0x2f2cb9){var _0x3c9b5d={'raw':![],'where':{'id':_0x3ac89a[_0x113e('0x52')]['id']}},_0x4ac11b={};_0x4ac11b[_0x113e('0x3a')]=_[_0x113e('0x53')](db['VoiceQueue'][_0x113e('0x37')]);_0x4ac11b[_0x113e('0x3b')]=_[_0x113e('0x53')](_0x3ac89a['query']);_0x4ac11b[_0x113e('0x3c')]=_[_0x113e('0x3d')](_0x4ac11b[_0x113e('0x3a')],_0x4ac11b[_0x113e('0x3b')]);_0x3c9b5d[_0x113e('0x3e')]=_[_0x113e('0x3d')](_0x4ac11b['model'],qs[_0x113e('0x3f')](_0x3ac89a['query'][_0x113e('0x3f')]));_0x3c9b5d[_0x113e('0x3e')]=_0x3c9b5d[_0x113e('0x3e')][_0x113e('0x40')]?_0x3c9b5d['attributes']:_0x4ac11b[_0x113e('0x3a')];if(_0x3ac89a['query']['includeAll']){_0x3c9b5d[_0x113e('0x4d')]=[{'all':!![]}];}_0x3c9b5d=_['merge']({},_0x3c9b5d,_0x3ac89a['options']);return db[_0x113e('0x36')][_0x113e('0x2e')](_0x3c9b5d)[_0x113e('0x24')](handleEntityNotFound(_0x2f2cb9,null))[_0x113e('0x24')](respondWithResult(_0x2f2cb9,null))[_0x113e('0x50')](handleError(_0x2f2cb9,null));};exports[_0x113e('0x54')]=function(_0x126d6d,_0x5edd05){return db[_0x113e('0x36')][_0x113e('0x54')](_0x126d6d[_0x113e('0x55')],{})[_0x113e('0x24')](function(_0x2d5d26){var _0x5abe4e=_0x126d6d[_0x113e('0x56')][_0x113e('0x25')]({'plain':!![]});if(!_0x5abe4e)throw new Error(_0x113e('0x57'));if(_0x5abe4e[_0x113e('0x58')]==='user'){var _0x5bc089=_0x2d5d26[_0x113e('0x25')]({'plain':!![]});var _0x49b94d=[{'name':'VoiceQueues','value':_0x113e('0x27')},{'name':_0x113e('0x28'),'value':_0x113e('0x59')}];var _0x40de64=_[_0x113e('0x2e')](_0x49b94d,['value',_0x5bc089[_0x113e('0x2d')]])['name'];return db[_0x113e('0x5a')][_0x113e('0x2e')]({'where':{'name':_0x40de64,'userProfileId':_0x5abe4e[_0x113e('0x5b')]},'raw':!![]})['then'](function(_0x939b36){if(_0x939b36&&_0x939b36[_0x113e('0x5c')]===0x0){return db[_0x113e('0x30')][_0x113e('0x54')]({'name':_0x5bc089[_0x113e('0x2f')],'resourceId':_0x5bc089['id'],'type':_0x939b36[_0x113e('0x2f')],'sectionId':_0x939b36['id']},{})['then'](function(){return _0x2d5d26;});}else{return _0x2d5d26;}})[_0x113e('0x50')](function(_0x4c630c){logger[_0x113e('0x33')](_0x113e('0x5d'),_0x4c630c);throw _0x4c630c;});}return _0x2d5d26;})[_0x113e('0x24')](respondWithResult(_0x5edd05,0xc9))[_0x113e('0x50')](handleError(_0x5edd05,null));};exports[_0x113e('0x5e')]=function(_0x2e8570,_0x3e7f08){var _0x3b6b2c={'where':{'id':_0x2e8570[_0x113e('0x52')]['id']}},_0x49d51a={};_0x49d51a[_0x113e('0x3a')]=_[_0x113e('0x53')](db['VoiceQueue'][_0x113e('0x37')]);_0x3b6b2c[_0x113e('0x3e')]=_['intersection'](_0x49d51a[_0x113e('0x3a')],qs[_0x113e('0x3f')](_0x2e8570[_0x113e('0x3b')]['fields']));_0x3b6b2c[_0x113e('0x3e')]=_0x3b6b2c[_0x113e('0x3e')][_0x113e('0x40')]?_0x3b6b2c[_0x113e('0x3e')]:_0x49d51a['model'];if(_0x2e8570[_0x113e('0x3b')][_0x113e('0x4c')]){_0x3b6b2c[_0x113e('0x4d')]=[{'all':!![]}];}_0x3b6b2c=_[_0x113e('0x48')]({},_0x3b6b2c,_0x2e8570[_0x113e('0x4b')]);return db[_0x113e('0x36')][_0x113e('0x2e')](_0x3b6b2c)['then'](handleEntityNotFound(_0x3e7f08,null))[_0x113e('0x24')](function(_0xbba0a9){if(_0xbba0a9){var _0x2126fb=_0xbba0a9['get']({'plain':!![]});_0x2126fb=qs[_0x113e('0x5f')](_0x2126fb,['id',_0x113e('0x60'),_0x113e('0x61')]);_0x2e8570[_0x113e('0x55')]=_['omit'](_0x2e8570[_0x113e('0x55')],['id',_0x113e('0x60'),_0x113e('0x61')]);return db[_0x113e('0x36')][_0x113e('0x54')](_[_0x113e('0x48')](_0x2126fb,_0x2e8570[_0x113e('0x55')]),{'include':_0x2e8570[_0x113e('0x3b')][_0x113e('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x5b5ec2){var _0x52cd14=_0x2e8570[_0x113e('0x56')][_0x113e('0x25')]({'plain':!![]});if(!_0x52cd14)throw new Error(_0x113e('0x57'));if(_0x52cd14[_0x113e('0x58')]===_0x113e('0x56')){var _0x8761c3=_0x5b5ec2['get']({'plain':!![]});var _0x2c4e84=[{'name':_0x113e('0x26'),'value':'inbound'},{'name':_0x113e('0x28'),'value':'outbound'}];var _0x1602d1=_[_0x113e('0x2e')](_0x2c4e84,[_0x113e('0x2b'),_0x8761c3[_0x113e('0x2d')]])[_0x113e('0x2f')];return db[_0x113e('0x5a')][_0x113e('0x2e')]({'where':{'name':_0x1602d1,'userProfileId':_0x52cd14['userProfileId']},'raw':!![]})['then'](function(_0x4cbcee){if(_0x4cbcee&&_0x4cbcee[_0x113e('0x5c')]===0x0){return db['UserProfileResource'][_0x113e('0x54')]({'name':_0x8761c3['name'],'resourceId':_0x8761c3['id'],'type':_0x4cbcee[_0x113e('0x2f')],'sectionId':_0x4cbcee['id']},{})[_0x113e('0x24')](function(){return _0x5b5ec2;});}else{return _0x5b5ec2;}})[_0x113e('0x50')](function(_0x371948){logger[_0x113e('0x33')](_0x113e('0x5d'),_0x371948);throw _0x371948;});}return _0x5b5ec2;});}})[_0x113e('0x24')](respondWithResult(_0x3e7f08,0xc9))[_0x113e('0x50')](handleError(_0x3e7f08,null));};exports['update']=function(_0x386fa4,_0x1f3ea6){if(_0x386fa4[_0x113e('0x55')]['id']){delete _0x386fa4[_0x113e('0x55')]['id'];}return db['VoiceQueue'][_0x113e('0x2e')]({'where':{'id':_0x386fa4['params']['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x1f3ea6,null))['then'](saveUpdates(_0x386fa4[_0x113e('0x55')],null))['then'](respondWithResult(_0x1f3ea6,null))[_0x113e('0x50')](handleError(_0x1f3ea6,null));};exports[_0x113e('0x31')]=function(_0x2cc78e,_0x30bdea){return db[_0x113e('0x36')][_0x113e('0x2e')]({'where':{'id':_0x2cc78e[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x30bdea,null))[_0x113e('0x24')](removeEntity(_0x30bdea,null))['catch'](handleError(_0x30bdea,null));};exports[_0x113e('0x62')]=function(_0x5214c8,_0x14fc2f,_0x4b4c9d){var _0xf74afb={'raw':![],'where':{}};var _0x46c566={};var _0x3eddcb={'count':0x0,'rows':[]};return db[_0x113e('0x36')][_0x113e('0x63')]({'where':{'id':_0x5214c8[_0x113e('0x52')]['id']}})['then'](handleEntityNotFound(_0x14fc2f,null))['then'](function(_0x549729){if(_0x549729){_0x46c566['model']=_[_0x113e('0x53')](db['CmHopper'][_0x113e('0x37')]);_0x46c566[_0x113e('0x3b')]=_[_0x113e('0x53')](_0x5214c8[_0x113e('0x3b')]);_0x46c566[_0x113e('0x3c')]=_[_0x113e('0x3d')](_0x46c566['model'],_0x46c566[_0x113e('0x3b')]);_0xf74afb[_0x113e('0x3e')]=_['intersection'](_0x46c566['model'],qs[_0x113e('0x3f')](_0x5214c8[_0x113e('0x3b')][_0x113e('0x3f')]));_0xf74afb[_0x113e('0x3e')]=_0xf74afb['attributes'][_0x113e('0x40')]?_0xf74afb[_0x113e('0x3e')]:_0x46c566['model'];if(!_0x5214c8['query'][_0x113e('0x41')](_0x113e('0x42'))){_0xf74afb[_0x113e('0x43')]=qs[_0x113e('0x43')](_0x5214c8['query'][_0x113e('0x43')]);_0xf74afb['offset']=qs[_0x113e('0x20')](_0x5214c8[_0x113e('0x3b')][_0x113e('0x20')]);}_0xf74afb[_0x113e('0x44')]=qs[_0x113e('0x45')](_0x5214c8[_0x113e('0x3b')]['sort']);_0xf74afb[_0x113e('0x46')]=qs['filters'](_[_0x113e('0x47')](_0x5214c8[_0x113e('0x3b')],_0x46c566['filters']));_0xf74afb[_0x113e('0x46')][_0x113e('0x64')]=_0x549729['id'];if(_0x5214c8[_0x113e('0x3b')][_0x113e('0x4a')]){_0xf74afb[_0x113e('0x46')]=_['merge'](_0xf74afb[_0x113e('0x46')],{'$or':_[_0x113e('0x2a')](_0xf74afb[_0x113e('0x3e')],function(_0x59e126){var _0xa6a942={};_0xa6a942[_0x59e126]={'$like':'%'+_0x5214c8['query'][_0x113e('0x4a')]+'%'};return _0xa6a942;})});}_0xf74afb=_[_0x113e('0x48')]({},_0xf74afb,_0x5214c8[_0x113e('0x4b')]);return db[_0x113e('0x65')]['count']({'where':_0xf74afb[_0x113e('0x46')]})[_0x113e('0x24')](function(_0x31b448){_0x3eddcb[_0x113e('0x1f')]=_0x31b448;if(_0x5214c8[_0x113e('0x3b')]['includeAll']){_0xf74afb['include']=[{'all':!![]}];}return db[_0x113e('0x65')]['findAll'](_0xf74afb);})[_0x113e('0x24')](function(_0x3da7af){_0x3eddcb['rows']=_0x3da7af;return _0x3eddcb;});}})[_0x113e('0x24')](respondWithFilteredResult(_0x14fc2f,_0xf74afb))[_0x113e('0x50')](handleError(_0x14fc2f,null));};exports[_0x113e('0x66')]=function(_0x5606ed,_0x2e830b,_0x1e52cc){var _0x1c0ec7={'raw':!![],'where':{}};var _0x11dcd8={};var _0xb6a06d={'count':0x0,'rows':[]};return db[_0x113e('0x36')][_0x113e('0x63')]({'where':{'id':_0x5606ed['params']['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x2e830b,null))[_0x113e('0x24')](function(_0x27b14a){if(_0x27b14a){_0x11dcd8[_0x113e('0x3a')]=_[_0x113e('0x53')](db[_0x113e('0x67')][_0x113e('0x37')]);_0x11dcd8[_0x113e('0x3b')]=_[_0x113e('0x53')](_0x5606ed[_0x113e('0x3b')]);_0x11dcd8['filters']=_[_0x113e('0x3d')](_0x11dcd8['model'],_0x11dcd8[_0x113e('0x3b')]);_0x1c0ec7[_0x113e('0x3e')]=_[_0x113e('0x3d')](_0x11dcd8[_0x113e('0x3a')],qs['fields'](_0x5606ed[_0x113e('0x3b')][_0x113e('0x3f')]));_0x1c0ec7[_0x113e('0x3e')]=_0x1c0ec7[_0x113e('0x3e')][_0x113e('0x40')]?_0x1c0ec7[_0x113e('0x3e')]:_0x11dcd8[_0x113e('0x3a')];if(!_0x5606ed[_0x113e('0x3b')][_0x113e('0x41')](_0x113e('0x42'))){_0x1c0ec7['limit']=qs['limit'](_0x5606ed[_0x113e('0x3b')]['limit']);_0x1c0ec7[_0x113e('0x20')]=qs[_0x113e('0x20')](_0x5606ed[_0x113e('0x3b')][_0x113e('0x20')]);}_0x1c0ec7[_0x113e('0x44')]=qs[_0x113e('0x45')](_0x5606ed[_0x113e('0x3b')][_0x113e('0x45')]);_0x1c0ec7[_0x113e('0x46')]=qs['filters'](_[_0x113e('0x47')](_0x5606ed['query'],_0x11dcd8[_0x113e('0x3c')]));_0x1c0ec7[_0x113e('0x46')][_0x113e('0x64')]=_0x27b14a['id'];if(_0x5606ed[_0x113e('0x3b')][_0x113e('0x4a')]){_0x1c0ec7['where']=_[_0x113e('0x48')](_0x1c0ec7[_0x113e('0x46')],{'$or':_[_0x113e('0x2a')](_0x1c0ec7['attributes'],function(_0x4aaedc){var _0x1ca230={};_0x1ca230[_0x4aaedc]={'$like':'%'+_0x5606ed[_0x113e('0x3b')]['filter']+'%'};return _0x1ca230;})});}_0x1c0ec7=_[_0x113e('0x48')]({},_0x1c0ec7,_0x5606ed[_0x113e('0x4b')]);return db[_0x113e('0x67')][_0x113e('0x1f')]({'where':_0x1c0ec7[_0x113e('0x46')]})[_0x113e('0x24')](function(_0x5084ac){_0xb6a06d[_0x113e('0x1f')]=_0x5084ac;if(_0x5606ed[_0x113e('0x3b')][_0x113e('0x4c')]){_0x1c0ec7['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x113e('0x4e')](_0x1c0ec7);})[_0x113e('0x24')](function(_0x2b5ad6){_0xb6a06d[_0x113e('0x4f')]=_0x2b5ad6;return _0xb6a06d;});}})[_0x113e('0x24')](respondWithFilteredResult(_0x2e830b,_0x1c0ec7))[_0x113e('0x50')](handleError(_0x2e830b,null));};exports[_0x113e('0x68')]=function(_0x49290e,_0x35742d,_0x3611a9){var _0x44357d={'raw':!![],'where':{}};var _0x35f1db={};var _0x3be3d5={'count':0x0,'rows':[]};return db[_0x113e('0x36')][_0x113e('0x63')]({'where':{'id':_0x49290e[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x35742d,null))[_0x113e('0x24')](function(_0x400e69){if(_0x400e69){_0x35f1db[_0x113e('0x3a')]=_['keys'](db[_0x113e('0x69')]['rawAttributes']);_0x35f1db[_0x113e('0x3b')]=_['keys'](_0x49290e[_0x113e('0x3b')]);_0x35f1db[_0x113e('0x3c')]=_['intersection'](_0x35f1db[_0x113e('0x3a')],_0x35f1db[_0x113e('0x3b')]);_0x44357d[_0x113e('0x3e')]=_['intersection'](_0x35f1db['model'],qs[_0x113e('0x3f')](_0x49290e[_0x113e('0x3b')][_0x113e('0x3f')]));_0x44357d['attributes']=_0x44357d[_0x113e('0x3e')][_0x113e('0x40')]?_0x44357d[_0x113e('0x3e')]:_0x35f1db[_0x113e('0x3a')];if(!_0x49290e[_0x113e('0x3b')][_0x113e('0x41')](_0x113e('0x42'))){_0x44357d['limit']=qs[_0x113e('0x43')](_0x49290e[_0x113e('0x3b')][_0x113e('0x43')]);_0x44357d[_0x113e('0x20')]=qs[_0x113e('0x20')](_0x49290e[_0x113e('0x3b')][_0x113e('0x20')]);}_0x44357d['order']=qs[_0x113e('0x45')](_0x49290e['query'][_0x113e('0x45')]);_0x44357d[_0x113e('0x46')]=qs['filters'](_[_0x113e('0x47')](_0x49290e['query'],_0x35f1db[_0x113e('0x3c')]));_0x44357d[_0x113e('0x46')][_0x113e('0x64')]=_0x400e69['id'];if(_0x49290e[_0x113e('0x3b')][_0x113e('0x4a')]){_0x44357d[_0x113e('0x46')]=_[_0x113e('0x48')](_0x44357d[_0x113e('0x46')],{'$or':_[_0x113e('0x2a')](_0x44357d[_0x113e('0x3e')],function(_0x2e0807){var _0x36c12c={};_0x36c12c[_0x2e0807]={'$like':'%'+_0x49290e[_0x113e('0x3b')][_0x113e('0x4a')]+'%'};return _0x36c12c;})});}_0x44357d=_[_0x113e('0x48')]({},_0x44357d,_0x49290e[_0x113e('0x4b')]);return db['CmHopperFinal'][_0x113e('0x1f')]({'where':_0x44357d[_0x113e('0x46')]})[_0x113e('0x24')](function(_0x456558){_0x3be3d5[_0x113e('0x1f')]=_0x456558;if(_0x49290e['query'][_0x113e('0x4c')]){_0x44357d[_0x113e('0x4d')]=[{'all':!![]}];}return db[_0x113e('0x69')][_0x113e('0x4e')](_0x44357d);})[_0x113e('0x24')](function(_0x17cd62){_0x3be3d5[_0x113e('0x4f')]=_0x17cd62;return _0x3be3d5;});}})[_0x113e('0x24')](respondWithFilteredResult(_0x35742d,_0x44357d))[_0x113e('0x50')](handleError(_0x35742d,null));};exports[_0x113e('0x6a')]=function(_0x2568ba,_0x2236c3,_0x314c66){var _0x151402={'raw':!![],'where':{}};var _0x16ddde={};var _0x36267b={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x2568ba[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x2236c3,null))['then'](function(_0x113713){if(_0x113713){_0x16ddde[_0x113e('0x3a')]=_['keys'](db[_0x113e('0x6b')][_0x113e('0x37')]);_0x16ddde[_0x113e('0x3b')]=_[_0x113e('0x53')](_0x2568ba['query']);_0x16ddde['filters']=_['intersection'](_0x16ddde['model'],_0x16ddde[_0x113e('0x3b')]);_0x151402['attributes']=_[_0x113e('0x3d')](_0x16ddde[_0x113e('0x3a')],qs[_0x113e('0x3f')](_0x2568ba['query'][_0x113e('0x3f')]));_0x151402['attributes']=_0x151402['attributes']['length']?_0x151402[_0x113e('0x3e')]:_0x16ddde[_0x113e('0x3a')];if(!_0x2568ba[_0x113e('0x3b')]['hasOwnProperty']('nolimit')){_0x151402[_0x113e('0x43')]=qs[_0x113e('0x43')](_0x2568ba['query']['limit']);_0x151402[_0x113e('0x20')]=qs[_0x113e('0x20')](_0x2568ba['query'][_0x113e('0x20')]);}_0x151402['order']=qs[_0x113e('0x45')](_0x2568ba[_0x113e('0x3b')][_0x113e('0x45')]);_0x151402[_0x113e('0x46')]=qs[_0x113e('0x3c')](_[_0x113e('0x47')](_0x2568ba[_0x113e('0x3b')],_0x16ddde[_0x113e('0x3c')]));_0x151402[_0x113e('0x46')][_0x113e('0x64')]=_0x113713['id'];if(_0x2568ba['query'][_0x113e('0x4a')]){_0x151402[_0x113e('0x46')]=_[_0x113e('0x48')](_0x151402['where'],{'$or':_['map'](_0x151402[_0x113e('0x3e')],function(_0x126199){var _0x3c5acb={};_0x3c5acb[_0x126199]={'$like':'%'+_0x2568ba[_0x113e('0x3b')]['filter']+'%'};return _0x3c5acb;})});}_0x151402=_[_0x113e('0x48')]({},_0x151402,_0x2568ba[_0x113e('0x4b')]);return db['CmHopperBlack'][_0x113e('0x1f')]({'where':_0x151402['where']})['then'](function(_0x4ef8e6){_0x36267b['count']=_0x4ef8e6;if(_0x2568ba[_0x113e('0x3b')][_0x113e('0x4c')]){_0x151402['include']=[{'all':!![]}];}return db[_0x113e('0x6b')][_0x113e('0x4e')](_0x151402);})['then'](function(_0x1e240c){_0x36267b[_0x113e('0x4f')]=_0x1e240c;return _0x36267b;});}})[_0x113e('0x24')](respondWithFilteredResult(_0x2236c3,_0x151402))['catch'](handleError(_0x2236c3,null));};exports[_0x113e('0x6c')]=function(_0x114395,_0x3b0089,_0x44a549){var _0x255102={};var _0xa175d9={};var _0x56c911;var _0x23ed0c;return db['VoiceQueue']['findOne']({'where':{'id':_0x114395[_0x113e('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b0089,null))['then'](function(_0x535990){if(_0x535990){_0x56c911=_0x535990;_0xa175d9[_0x113e('0x3a')]=_[_0x113e('0x53')](db[_0x113e('0x6d')][_0x113e('0x37')]);_0xa175d9[_0x113e('0x3b')]=_['keys'](_0x114395['query']);_0xa175d9[_0x113e('0x3c')]=_[_0x113e('0x3d')](_0xa175d9[_0x113e('0x3a')],_0xa175d9[_0x113e('0x3b')]);_0x255102[_0x113e('0x3e')]=_[_0x113e('0x3d')](_0xa175d9[_0x113e('0x3a')],qs[_0x113e('0x3f')](_0x114395[_0x113e('0x3b')][_0x113e('0x3f')]));_0x255102[_0x113e('0x3e')]=_0x255102[_0x113e('0x3e')][_0x113e('0x40')]?_0x255102[_0x113e('0x3e')]:_0xa175d9[_0x113e('0x3a')];_0x255102['order']=qs['sort'](_0x114395[_0x113e('0x3b')]['sort']);_0x255102[_0x113e('0x46')]=qs['filters'](_[_0x113e('0x47')](_0x114395[_0x113e('0x3b')],_0xa175d9[_0x113e('0x3c')]));if(_0x114395[_0x113e('0x3b')][_0x113e('0x4a')]){_0x255102[_0x113e('0x46')]=_[_0x113e('0x48')](_0x255102['where'],{'$or':_[_0x113e('0x2a')](_0x255102['attributes'],function(_0x1a0eb2){var _0x437598={};_0x437598[_0x1a0eb2]={'$like':'%'+_0x114395[_0x113e('0x3b')][_0x113e('0x4a')]+'%'};return _0x437598;})});}_0x255102=_[_0x113e('0x48')]({},_0x255102,_0x114395[_0x113e('0x4b')]);return _0x56c911[_0x113e('0x6c')](_0x255102);}})['then'](function(_0x9a92ca){if(_0x9a92ca){_0x23ed0c=_0x9a92ca[_0x113e('0x40')];if(!_0x114395['query'][_0x113e('0x41')](_0x113e('0x42'))){_0x255102[_0x113e('0x43')]=qs[_0x113e('0x43')](_0x114395[_0x113e('0x3b')]['limit']);_0x255102[_0x113e('0x20')]=qs[_0x113e('0x20')](_0x114395[_0x113e('0x3b')][_0x113e('0x20')]);}return _0x56c911[_0x113e('0x6c')](_0x255102);}})[_0x113e('0x24')](function(_0x3e78f0){if(_0x3e78f0){return _0x3e78f0?{'count':_0x23ed0c,'rows':_0x3e78f0}:null;}})[_0x113e('0x24')](respondWithResult(_0x3b0089,null))[_0x113e('0x50')](handleError(_0x3b0089,null));};exports[_0x113e('0x6e')]=function(_0x267f6b,_0x2e4d00,_0x569e6b){var _0x77a2c7=_0x267f6b[_0x113e('0x55')][_0x113e('0x6f')];var _0x460a29=_[_0x113e('0x2a')](_0x77a2c7,'id');return db['Team']['findAll']({'where':{'id':_0x460a29},'attributes':['id'],'include':[{'model':db[_0x113e('0x70')],'as':_0x113e('0x71'),'attributes':['id',_0x113e('0x2f'),_0x113e('0x72'),_0x113e('0x73'),_0x113e('0x74')],'raw':!![]}]})[_0x113e('0x24')](function(_0x387e25){if(_0x387e25){var _0x26dbe9=_[_0x113e('0x75')](_0x387e25,function(_0x12b1fe){var _0x3de5db=_0x12b1fe[_0x113e('0x25')]({'plain':!![]});_0x3de5db['Agents'][_0x113e('0x76')](function(_0x37aaf6){_0x37aaf6[_0x113e('0x77')]=_[_0x113e('0x2e')](_0x77a2c7,{'id':_0x3de5db['id']})['penalty'];});return _0x3de5db[_0x113e('0x71')];});return db[_0x113e('0x36')][_0x113e('0x2e')]({'where':{'id':_0x267f6b['params']['id']}})['then'](function(_0x208065){return db['sequelize'][_0x113e('0x78')](function(_0x139263){return _0x208065[_0x113e('0x6e')](_0x460a29,{'transaction':_0x139263})[_0x113e('0x24')](function(){return BPromise[_0x113e('0x79')](_0x26dbe9,function(_0x5da524){return db['UserVoiceQueue'][_0x113e('0x7a')]({'where':{'UserId':_0x5da524['id'],'VoiceQueueId':_0x267f6b[_0x113e('0x52')]['id']},'defaults':{'penalty':_0x5da524[_0x113e('0x77')]},'transaction':_0x139263});});})[_0x113e('0x24')](function(){return BPromise['each'](_[_0x113e('0x4a')](_0x26dbe9,{'online':!![]}),function(_0x522f9b){return db[_0x113e('0x7b')][_0x113e('0x7c')]({'membername':_0x522f9b['name'],'UserId':_0x522f9b['id'],'queue_name':_0x208065['name'],'VoiceQueueId':_0x208065['id'],'interface':_[_0x113e('0x7d')](_0x522f9b[_0x113e('0x74')])?util[_0x113e('0x7e')](_0x113e('0x7f'),_0x522f9b[_0x113e('0x2f')]):_0x522f9b['interface'],'paused':_0x522f9b['voicePause']||![],'penalty':_0x522f9b[_0x113e('0x77')]},{'transaction':_0x139263});});})[_0x113e('0x24')](function(){_0x26dbe9['forEach'](function(_0x2cb710){socket[_0x113e('0x80')](_0x113e('0x81'),{'UserId':_0x2cb710['id'],'VoiceQueueId':_0x208065['id']});});});});});}})[_0x113e('0x24')](respondWithStatusCode(_0x2e4d00,null))[_0x113e('0x50')](handleError(_0x2e4d00,null));};exports[_0x113e('0x82')]=function(_0x5f123f,_0x36f4c9,_0x37af9b){return db[_0x113e('0x6d')]['findAll']({'where':{'id':_0x5f123f[_0x113e('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x113e('0x70')],'as':_0x113e('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x36f4c9,null))['then'](function(_0x3d2fc8){var _0x4c23e6=_[_0x113e('0x2a')](_0x3d2fc8,'id');var _0x14d925=[];var _0x4a0e28=[];var _0x3ef90b=squel[_0x113e('0x83')]();_0x3ef90b[_0x113e('0x84')](_0x113e('0x85'))[_0x113e('0x86')](_0x113e('0x87'),'tq')[_0x113e('0x88')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x113e('0x46')](_0x113e('0x89'),_0x5f123f['params']['id']);for(var _0x56a5a4=0x0;_0x56a5a4<_0x3d2fc8[_0x113e('0x40')];_0x56a5a4+=0x1){let _0x1896f1=_0x3d2fc8[_0x56a5a4];for(var _0x48f420=0x0;_0x48f420<_0x1896f1[_0x113e('0x71')]['length'];_0x48f420+=0x1){let _0x2add85=_0x1896f1[_0x113e('0x71')][_0x48f420];var _0xfb0b0d=_0x3ef90b[_0x113e('0x5e')]();_0xfb0b0d[_0x113e('0x46')](_0x113e('0x8a'),_0x2add85['id']);_0x4a0e28[_0x113e('0x8b')](db['sequelize'][_0x113e('0x3b')](_0xfb0b0d[_0x113e('0x8c')](),{'type':db[_0x113e('0x8d')][_0x113e('0x8e')][_0x113e('0x8f')]})[_0x113e('0x24')](function(_0x40ca28){if(_0x40ca28[_0x113e('0x40')]===0x1){return _0x2add85['id'];}else{var _0x159320=_[_0x113e('0x90')](_[_0x113e('0x2a')](_0x40ca28,'TeamId'),function(_0x2bbf68){return _[_0x113e('0x2c')](_0x4c23e6,_0x2bbf68);});if(_0x159320){return _0x2add85['id'];}}}));}}return BPromise['all'](_0x4a0e28)[_0x113e('0x24')](function(_0x20bef0){_0x14d925=_(_0x14d925)['union'](_0x20bef0)[_0x113e('0x91')]()[_0x113e('0x2b')]();return db[_0x113e('0x36')][_0x113e('0x2e')]({'where':{'id':_0x5f123f[_0x113e('0x52')]['id']}})[_0x113e('0x24')](function(_0x267fb7){return db['sequelize'][_0x113e('0x78')](function(_0x5d358e){return _0x267fb7[_0x113e('0x82')](_0x5f123f[_0x113e('0x3b')][_0x113e('0x92')],{'transaction':_0x5d358e})[_0x113e('0x24')](function(){if(!_[_0x113e('0x93')](_0x14d925)){return _0x267fb7[_0x113e('0x94')](_0x14d925,{'transaction':_0x5d358e})[_0x113e('0x24')](function(){return db[_0x113e('0x7b')][_0x113e('0x31')]({'where':{'VoiceQueueId':_0x5f123f[_0x113e('0x52')]['id'],'UserId':_0x14d925},'transaction':_0x5d358e});});}})[_0x113e('0x24')](function(){_0x14d925[_0x113e('0x76')](function(_0x5e9403){socket[_0x113e('0x80')](_0x113e('0x95'),{'UserId':_0x5e9403,'VoiceQueueId':_0x267fb7['id']});});});});});});})[_0x113e('0x24')](respondWithStatusCode(_0x36f4c9,null))['catch'](handleError(_0x36f4c9,null));};exports[_0x113e('0x96')]=function(_0x43d675,_0x18a14a,_0x409ceb){var _0x529023,_0x154773;return db[_0x113e('0x36')][_0x113e('0x2e')]({'where':{'id':_0x43d675[_0x113e('0x52')]['id']}})['then'](handleEntityNotFound(_0x18a14a,null))['then'](function(_0x412fad){if(_0x412fad){_0x154773=_0x412fad;return _0x412fad[_0x113e('0x96')](_0x43d675[_0x113e('0x55')][_0x113e('0x92')],_[_0x113e('0x5f')](_0x43d675[_0x113e('0x55')],['ids','id'])||{})['spread'](function(_0x1e1e01){for(var _0x398902=0x0;_0x398902<_0x43d675[_0x113e('0x55')]['ids'][_0x113e('0x40')];_0x398902+=0x1){socket[_0x113e('0x80')](_0x113e('0x81'),{'UserId':_0x43d675['body'][_0x113e('0x92')][_0x398902],'VoiceQueueId':_0x43d675[_0x113e('0x52')]['id']});}return _0x1e1e01;});}})[_0x113e('0x24')](function(_0x5f4b49){_0x529023=_0x5f4b49||[];if(_0x154773){return db[_0x113e('0x70')]['findAll']({'where':{'id':_0x43d675[_0x113e('0x55')][_0x113e('0x92')]},'attributes':['id',_0x113e('0x2f'),_0x113e('0x72'),'voicePause',_0x113e('0x74')],'raw':!![]});}})['then'](function(_0x22c748){if(!_[_0x113e('0x93')](_0x22c748)){var _0x7c1f70=[];for(var _0xd37a03=0x0;_0xd37a03<_0x22c748[_0x113e('0x40')];_0xd37a03++){if(_0x22c748[_0xd37a03]['online']){_0x7c1f70[_0x113e('0x8b')](db[_0x113e('0x7b')][_0x113e('0x7c')]({'membername':_0x22c748[_0xd37a03][_0x113e('0x2f')],'UserId':_0x22c748[_0xd37a03]['id'],'queue_name':_0x154773[_0x113e('0x2f')],'VoiceQueueId':_0x154773['id'],'interface':_['isNil'](_0x22c748[_0xd37a03][_0x113e('0x74')])?util[_0x113e('0x7e')]('SIP/%s',_0x22c748[_0xd37a03][_0x113e('0x2f')]):_0x22c748[_0xd37a03][_0x113e('0x74')],'paused':_0x22c748[_0xd37a03][_0x113e('0x73')]||![],'penalty':_0x43d675[_0x113e('0x55')][_0x113e('0x77')]||0x0}));}}return BPromise['all'](_0x7c1f70);}})[_0x113e('0x24')](function(){return _0x529023;})[_0x113e('0x24')](respondWithResult(_0x18a14a,null))[_0x113e('0x50')](handleError(_0x18a14a,null));};exports[_0x113e('0x94')]=function(_0x5d04c6,_0x2b7786,_0x2d5808){return db['VoiceQueue'][_0x113e('0x2e')]({'where':{'id':_0x5d04c6['params']['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x2b7786,null))[_0x113e('0x24')](function(_0x1c67b0){if(_0x1c67b0){return _0x1c67b0['removeAgents'](_0x5d04c6[_0x113e('0x3b')][_0x113e('0x92')])[_0x113e('0x24')](function(){if(_[_0x113e('0x97')](_0x5d04c6[_0x113e('0x3b')][_0x113e('0x92')])){for(var _0x4870dc=0x0;_0x4870dc<_0x5d04c6['query']['ids'][_0x113e('0x40')];_0x4870dc+=0x1){socket[_0x113e('0x80')](_0x113e('0x95'),{'UserId':Number(_0x5d04c6['query'][_0x113e('0x92')][_0x4870dc]),'VoiceQueueId':Number(_0x5d04c6[_0x113e('0x52')]['id'])});}}else{socket[_0x113e('0x80')](_0x113e('0x95'),{'UserId':Number(_0x5d04c6[_0x113e('0x3b')][_0x113e('0x92')]),'VoiceQueueId':Number(_0x5d04c6[_0x113e('0x52')]['id'])});}});}})[_0x113e('0x24')](function(_0x5f149c){return db[_0x113e('0x7b')]['destroy']({'where':{'VoiceQueueId':_0x5d04c6['params']['id'],'UserId':_0x5d04c6[_0x113e('0x3b')][_0x113e('0x92')]}})['then'](function(){return _0x5f149c;});})['then'](respondWithStatusCode(_0x2b7786,null))['catch'](handleError(_0x2b7786,null));};exports[_0x113e('0x98')]=function(_0x1377f1,_0x43ad0c,_0x55fed3){var _0x1f552f={};var _0x4d7345={};var _0x2ee6c8;var _0x37d995;return db['VoiceQueue'][_0x113e('0x63')]({'where':{'id':_0x1377f1[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x43ad0c,null))[_0x113e('0x24')](function(_0x3ca9b1){if(_0x3ca9b1){_0x2ee6c8=_0x3ca9b1;_0x4d7345['model']=_['keys'](db[_0x113e('0x70')][_0x113e('0x37')]);_0x4d7345['query']=_[_0x113e('0x53')](_0x1377f1[_0x113e('0x3b')]);_0x4d7345[_0x113e('0x3c')]=_[_0x113e('0x3d')](_0x4d7345[_0x113e('0x3a')],_0x4d7345['query']);_0x1f552f[_0x113e('0x3e')]=_['intersection'](_0x4d7345[_0x113e('0x3a')],qs[_0x113e('0x3f')](_0x1377f1[_0x113e('0x3b')][_0x113e('0x3f')]));_0x1f552f['attributes']=_0x1f552f['attributes']['length']?_0x1f552f['attributes']:_0x4d7345['model'];_0x1f552f[_0x113e('0x44')]=qs['sort'](_0x1377f1[_0x113e('0x3b')][_0x113e('0x45')]);_0x1f552f[_0x113e('0x46')]=qs[_0x113e('0x3c')](_['pick'](_0x1377f1['query'],_0x4d7345[_0x113e('0x3c')]));if(_0x1377f1[_0x113e('0x3b')][_0x113e('0x4a')]){_0x1f552f[_0x113e('0x46')]=_[_0x113e('0x48')](_0x1f552f[_0x113e('0x46')],{'$or':_[_0x113e('0x2a')](_0x1f552f['attributes'],function(_0x402125){var _0x386629={};_0x386629[_0x402125]={'$like':'%'+_0x1377f1[_0x113e('0x3b')][_0x113e('0x4a')]+'%'};return _0x386629;})});}_0x1f552f=_[_0x113e('0x48')]({},_0x1f552f,_0x1377f1[_0x113e('0x4b')]);return _0x2ee6c8[_0x113e('0x98')](_0x1f552f);}})[_0x113e('0x24')](function(_0x2f6447){if(_0x2f6447){_0x37d995=_0x2f6447['length'];if(!_0x1377f1['query'][_0x113e('0x41')](_0x113e('0x42'))){_0x1f552f['limit']=qs['limit'](_0x1377f1[_0x113e('0x3b')][_0x113e('0x43')]);_0x1f552f[_0x113e('0x20')]=qs[_0x113e('0x20')](_0x1377f1[_0x113e('0x3b')][_0x113e('0x20')]);}return _0x2ee6c8['getAgents'](_0x1f552f);}})[_0x113e('0x24')](function(_0x285538){if(_0x285538){return _0x285538?{'count':_0x37d995,'rows':_0x285538}:null;}})[_0x113e('0x24')](respondWithResult(_0x43ad0c,null))[_0x113e('0x50')](handleError(_0x43ad0c,null));};exports[_0x113e('0x99')]=function(_0x140322,_0x59de2e,_0x10e6dd){var _0x1c2779={};var _0x5dba69={};var _0x50f0b7;var _0x33978a;return db['VoiceQueue']['findOne']({'where':{'id':_0x140322[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x59de2e,null))[_0x113e('0x24')](function(_0x2f0276){if(_0x2f0276){_0x50f0b7=_0x2f0276;_0x5dba69[_0x113e('0x3a')]=_[_0x113e('0x53')](db[_0x113e('0x7b')][_0x113e('0x37')]);_0x5dba69['query']=_['keys'](_0x140322[_0x113e('0x3b')]);_0x5dba69[_0x113e('0x3c')]=_[_0x113e('0x3d')](_0x5dba69[_0x113e('0x3a')],_0x5dba69[_0x113e('0x3b')]);_0x1c2779[_0x113e('0x3e')]=_[_0x113e('0x3d')](_0x5dba69['model'],qs[_0x113e('0x3f')](_0x140322[_0x113e('0x3b')][_0x113e('0x3f')]));_0x1c2779[_0x113e('0x3e')]=_0x1c2779[_0x113e('0x3e')]['length']?_0x1c2779[_0x113e('0x3e')]:_0x5dba69[_0x113e('0x3a')];_0x1c2779[_0x113e('0x44')]=qs['sort'](_0x140322[_0x113e('0x3b')][_0x113e('0x45')]);_0x1c2779['where']=qs[_0x113e('0x3c')](_[_0x113e('0x47')](_0x140322[_0x113e('0x3b')],_0x5dba69[_0x113e('0x3c')]));if(_0x140322[_0x113e('0x3b')][_0x113e('0x4a')]){_0x1c2779[_0x113e('0x46')]=_[_0x113e('0x48')](_0x1c2779['where'],{'$or':_['map'](_0x1c2779[_0x113e('0x3e')],function(_0x134ba6){var _0x139172={};_0x139172[_0x134ba6]={'$like':'%'+_0x140322['query'][_0x113e('0x4a')]+'%'};return _0x139172;})});}_0x1c2779=_[_0x113e('0x48')]({},_0x1c2779,_0x140322[_0x113e('0x4b')]);return _0x50f0b7[_0x113e('0x99')](_0x1c2779);}})[_0x113e('0x24')](function(_0x1d12b6){if(_0x1d12b6){_0x33978a=_0x1d12b6['length'];if(!_0x140322[_0x113e('0x3b')][_0x113e('0x41')](_0x113e('0x42'))){_0x1c2779['limit']=qs[_0x113e('0x43')](_0x140322[_0x113e('0x3b')]['limit']);_0x1c2779[_0x113e('0x20')]=qs['offset'](_0x140322[_0x113e('0x3b')][_0x113e('0x20')]);}return _0x50f0b7[_0x113e('0x99')](_0x1c2779);}})[_0x113e('0x24')](function(_0x3d64e5){return _0x3d64e5?{'count':_0x33978a,'rows':_0x3d64e5}:null;})[_0x113e('0x24')](respondWithResult(_0x59de2e,null))[_0x113e('0x50')](handleError(_0x59de2e,null));};exports[_0x113e('0x9a')]=function(_0x249e05,_0x281311,_0x35bf38){var _0xa61203={};var _0x58682a={};var _0x82a86d;var _0x1ff4f0;return db['VoiceQueue'][_0x113e('0x63')]({'where':{'id':_0x249e05[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x281311,null))[_0x113e('0x24')](function(_0x2f5f7d){if(_0x2f5f7d){_0x82a86d=_0x2f5f7d;_0x58682a[_0x113e('0x3a')]=_['keys'](db[_0x113e('0x9b')][_0x113e('0x37')]);_0x58682a[_0x113e('0x3b')]=_[_0x113e('0x53')](_0x249e05[_0x113e('0x3b')]);_0x58682a['filters']=_['intersection'](_0x58682a[_0x113e('0x3a')],_0x58682a[_0x113e('0x3b')]);_0xa61203[_0x113e('0x3e')]=_[_0x113e('0x3d')](_0x58682a['model'],qs[_0x113e('0x3f')](_0x249e05[_0x113e('0x3b')][_0x113e('0x3f')]));_0xa61203[_0x113e('0x3e')]=_0xa61203[_0x113e('0x3e')][_0x113e('0x40')]?_0xa61203[_0x113e('0x3e')]:_0x58682a[_0x113e('0x3a')];_0xa61203[_0x113e('0x44')]=qs[_0x113e('0x45')](_0x249e05[_0x113e('0x3b')][_0x113e('0x45')]);_0xa61203[_0x113e('0x46')]=qs[_0x113e('0x3c')](_['pick'](_0x249e05[_0x113e('0x3b')],_0x58682a[_0x113e('0x3c')]));if(_0x249e05['query'][_0x113e('0x4a')]){_0xa61203['where']=_[_0x113e('0x48')](_0xa61203['where'],{'$or':_[_0x113e('0x2a')](_0xa61203['attributes'],function(_0x2c12cd){var _0x1a75b4={};_0x1a75b4[_0x2c12cd]={'$like':'%'+_0x249e05[_0x113e('0x3b')][_0x113e('0x4a')]+'%'};return _0x1a75b4;})});}_0xa61203=_[_0x113e('0x48')]({},_0xa61203,_0x249e05[_0x113e('0x4b')]);return _0x82a86d['getLists'](_0xa61203);}})[_0x113e('0x24')](function(_0x536e31){if(_0x536e31){_0x1ff4f0=_0x536e31[_0x113e('0x40')];if(!_0x249e05[_0x113e('0x3b')][_0x113e('0x41')](_0x113e('0x42'))){_0xa61203[_0x113e('0x43')]=qs['limit'](_0x249e05[_0x113e('0x3b')][_0x113e('0x43')]);_0xa61203['offset']=qs['offset'](_0x249e05[_0x113e('0x3b')]['offset']);}return _0x82a86d['getLists'](_0xa61203);}})[_0x113e('0x24')](function(_0x3dbdb8){if(_0x3dbdb8){return _0x3dbdb8?{'count':_0x1ff4f0,'rows':_0x3dbdb8}:null;}})[_0x113e('0x24')](respondWithResult(_0x281311,null))[_0x113e('0x50')](handleError(_0x281311,null));};exports['addLists']=function(_0x382951,_0x524cf4,_0x513328){var _0x4ba346,_0x3162b6;return db[_0x113e('0x36')]['find']({'where':{'id':_0x382951[_0x113e('0x52')]['id']}})['then'](handleEntityNotFound(_0x524cf4,null))[_0x113e('0x24')](function(_0x176204){if(_0x176204){_0x3162b6=_0x176204;return _0x176204['addLists'](_0x382951[_0x113e('0x55')][_0x113e('0x92')],_[_0x113e('0x5f')](_0x382951[_0x113e('0x55')],[_0x113e('0x92'),'id'])||{});}return null;})[_0x113e('0x9c')](function(_0x233274){var _0x5013ad;_0x4ba346=_0x233274||[];var _0x11ba17=[];if(_0x233274){for(var _0x28ab23=0x0;_0x28ab23<_0x233274[_0x113e('0x40')];_0x28ab23+=0x1){var _0x3c7b34=_0x233274[_0x28ab23][_0x113e('0x25')]({'plain':!![]});_0x3162b6[_0x113e('0x9d')]=_0x382951[_0x113e('0x55')][_0x113e('0x9d')]?_0x382951['body'][_0x113e('0x9d')]:_0x3162b6['dialCheckDuplicateType'];switch(_0x3162b6['dialCheckDuplicateType']){case'always':_0x5013ad=squel['insert']()[_0x113e('0x9e')](_0x113e('0x9f'))['fromQuery']([_0x113e('0xa0'),_0x113e('0xa1'),_0x113e('0xa2'),'ListId',_0x113e('0x64'),'createdAt',_0x113e('0x61')],squel['select']()[_0x113e('0x84')]('phone',_0x113e('0xa0'))[_0x113e('0x84')](_0x113e('0xa3'),_0x113e('0xa1'))[_0x113e('0x84')]('id',_0x113e('0xa2'))[_0x113e('0x84')](_0x3c7b34[_0x113e('0xa4')][_0x113e('0x8c')](),_0x113e('0xa5'))[_0x113e('0x84')](_0x382951[_0x113e('0x52')]['id']['toString'](),_0x113e('0x64'))[_0x113e('0x84')](_0x113e('0xa3'),_0x113e('0x60'))[_0x113e('0x84')](_0x113e('0xa3'),_0x113e('0x61'))['from'](_0x113e('0xa6'))['where'](_0x113e('0xa7'))[_0x113e('0x46')](_0x113e('0xa8'),_0x3c7b34[_0x113e('0xa4')][_0x113e('0x8c')]())[_0x113e('0x46')](_0x113e('0xa9'))['where'](_0x113e('0xaa'),squel[_0x113e('0x83')]()[_0x113e('0x84')](_0x113e('0xab'))[_0x113e('0x86')](_0x113e('0xac'))['where'](_0x113e('0x89'),_0x382951[_0x113e('0x52')]['id']['toString']()))[_0x113e('0x46')](_0x113e('0xaa'),squel['select']()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x113e('0x89'),_0x382951[_0x113e('0x52')]['id'][_0x113e('0x8c')]())))[_0x113e('0x8c')]();break;case _0x113e('0xad'):_0x5013ad=squel[_0x113e('0xae')]()[_0x113e('0x9e')](_0x113e('0x9f'))[_0x113e('0xaf')](['phone',_0x113e('0xa1'),'ContactId',_0x113e('0xa5'),_0x113e('0x64'),'createdAt',_0x113e('0x61')],squel[_0x113e('0x83')]()[_0x113e('0x84')](_0x113e('0xa0'),_0x113e('0xa0'))[_0x113e('0x84')](_0x113e('0xa3'),'scheduledAt')[_0x113e('0x84')]('id',_0x113e('0xa2'))[_0x113e('0x84')](_0x3c7b34[_0x113e('0xa4')][_0x113e('0x8c')](),_0x113e('0xa5'))[_0x113e('0x84')](_0x382951['params']['id'][_0x113e('0x8c')](),_0x113e('0x64'))['field'](_0x113e('0xa3'),_0x113e('0x60'))[_0x113e('0x84')](_0x113e('0xa3'),'updatedAt')[_0x113e('0x86')](_0x113e('0xa6'))[_0x113e('0x46')](_0x113e('0xa7'))[_0x113e('0x46')](_0x113e('0xa8'),_0x3c7b34[_0x113e('0xa4')]['toString']())[_0x113e('0x46')](_0x113e('0xa9'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x113e('0x83')]()[_0x113e('0x84')](_0x113e('0xb0'))['from'](_0x113e('0x9f'))[_0x113e('0x46')](_0x113e('0x89'),_0x382951[_0x113e('0x52')]['id'][_0x113e('0x8c')]())))[_0x113e('0x8c')]();break;default:_0x5013ad=squel['insert']()[_0x113e('0x9e')](_0x113e('0x9f'))['fromQuery']([_0x113e('0xa0'),_0x113e('0xa1'),'ContactId','ListId',_0x113e('0x64'),_0x113e('0x60'),_0x113e('0x61')],squel[_0x113e('0x83')]()[_0x113e('0x84')]('phone',_0x113e('0xa0'))['field'](_0x113e('0xa3'),_0x113e('0xa1'))[_0x113e('0x84')]('id',_0x113e('0xa2'))[_0x113e('0x84')](_0x3c7b34[_0x113e('0xa4')][_0x113e('0x8c')](),'ListId')['field'](_0x382951['params']['id'][_0x113e('0x8c')](),_0x113e('0x64'))[_0x113e('0x84')]('NOW()',_0x113e('0x60'))[_0x113e('0x84')](_0x113e('0xa3'),'updatedAt')[_0x113e('0x86')]('cm_contacts')[_0x113e('0x46')](_0x113e('0xa7'))[_0x113e('0x46')]('ListId\x20=\x20?',_0x3c7b34[_0x113e('0xa4')][_0x113e('0x8c')]())['where'](_0x113e('0xa9')))['toString']();}_0x11ba17[_0x113e('0x8b')](db[_0x113e('0x8d')][_0x113e('0x3b')](_0x5013ad));}return BPromise[_0x113e('0xb1')](_0x11ba17);}})[_0x113e('0x24')](function(){return _0x4ba346;})['then'](respondWithResult(_0x524cf4,null))[_0x113e('0x50')](handleError(_0x524cf4,null));};exports[_0x113e('0xb2')]=function(_0xec65cf,_0x35cd9b,_0x17e721){return db[_0x113e('0x36')]['find']({'where':{'id':_0xec65cf[_0x113e('0x52')]['id']}})['then'](handleEntityNotFound(_0x35cd9b,null))[_0x113e('0x24')](function(_0x3a836f){if(_0x3a836f){return _0x3a836f[_0x113e('0xb2')](_0xec65cf[_0x113e('0x3b')][_0x113e('0x92')]);}})[_0x113e('0x24')](function(_0x150431){if(_0x150431){return db[_0x113e('0x65')][_0x113e('0x31')]({'where':{'ListId':_0xec65cf['query'][_0x113e('0x92')],'VoiceQueueId':_0xec65cf['params']['id']}})[_0x113e('0x24')](function(){return _0x150431;});}})[_0x113e('0x24')](respondWithStatusCode(_0x35cd9b,null))[_0x113e('0x50')](handleError(_0x35cd9b,null));};exports[_0x113e('0xb3')]=function(_0x2b19f3,_0x41926c,_0x111869){var _0x43dc27={};var _0x4aab42={};var _0x107086;var _0x46ee9b;return db[_0x113e('0x36')]['findOne']({'where':{'id':_0x2b19f3[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x41926c,null))[_0x113e('0x24')](function(_0x6ca8d){if(_0x6ca8d){_0x107086=_0x6ca8d;_0x4aab42[_0x113e('0x3a')]=_['keys'](db[_0x113e('0x9b')][_0x113e('0x37')]);_0x4aab42['query']=_[_0x113e('0x53')](_0x2b19f3[_0x113e('0x3b')]);_0x4aab42[_0x113e('0x3c')]=_[_0x113e('0x3d')](_0x4aab42['model'],_0x4aab42[_0x113e('0x3b')]);_0x43dc27['attributes']=_['intersection'](_0x4aab42[_0x113e('0x3a')],qs[_0x113e('0x3f')](_0x2b19f3[_0x113e('0x3b')][_0x113e('0x3f')]));_0x43dc27[_0x113e('0x3e')]=_0x43dc27[_0x113e('0x3e')][_0x113e('0x40')]?_0x43dc27['attributes']:_0x4aab42[_0x113e('0x3a')];_0x43dc27['order']=qs[_0x113e('0x45')](_0x2b19f3[_0x113e('0x3b')]['sort']);_0x43dc27[_0x113e('0x46')]=qs['filters'](_['pick'](_0x2b19f3[_0x113e('0x3b')],_0x4aab42[_0x113e('0x3c')]));if(_0x2b19f3['query']['filter']){_0x43dc27[_0x113e('0x46')]=_[_0x113e('0x48')](_0x43dc27[_0x113e('0x46')],{'$or':_['map'](_0x43dc27[_0x113e('0x3e')],function(_0x48f688){var _0x5abdda={};_0x5abdda[_0x48f688]={'$like':'%'+_0x2b19f3[_0x113e('0x3b')]['filter']+'%'};return _0x5abdda;})});}_0x43dc27=_[_0x113e('0x48')]({},_0x43dc27,_0x2b19f3['options']);return _0x107086[_0x113e('0xb3')](_0x43dc27);}})['then'](function(_0x5ab5f4){if(_0x5ab5f4){_0x46ee9b=_0x5ab5f4[_0x113e('0x40')];if(!_0x2b19f3[_0x113e('0x3b')][_0x113e('0x41')](_0x113e('0x42'))){_0x43dc27[_0x113e('0x43')]=qs[_0x113e('0x43')](_0x2b19f3[_0x113e('0x3b')][_0x113e('0x43')]);_0x43dc27[_0x113e('0x20')]=qs[_0x113e('0x20')](_0x2b19f3[_0x113e('0x3b')]['offset']);}return _0x107086[_0x113e('0xb3')](_0x43dc27);}})['then'](function(_0x53cb75){if(_0x53cb75){return _0x53cb75?{'count':_0x46ee9b,'rows':_0x53cb75}:null;}})['then'](respondWithResult(_0x41926c,null))['catch'](handleError(_0x41926c,null));};exports['addBlackLists']=function(_0x18e7e5,_0x132c17,_0x4e136c){var _0x51126f,_0x256f05;return db[_0x113e('0x36')]['find']({'where':{'id':_0x18e7e5[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x132c17,null))[_0x113e('0x24')](function(_0x5b3168){if(_0x5b3168){_0x256f05=_0x5b3168;return _0x5b3168[_0x113e('0xb4')](_0x18e7e5[_0x113e('0x55')][_0x113e('0x92')],_[_0x113e('0x5f')](_0x18e7e5[_0x113e('0x55')],[_0x113e('0x92'),'id'])||{});}return null;})['spread'](function(_0x26028a){var _0x135c59;_0x51126f=_0x26028a||[];var _0x22dd54=[];if(_0x26028a){for(var _0x3c0787=0x0;_0x3c0787<_0x26028a[_0x113e('0x40')];_0x3c0787+=0x1){var _0x55104f=_0x26028a[_0x3c0787][_0x113e('0x25')]({'plain':!![]});_0x135c59=squel[_0x113e('0xae')]()[_0x113e('0x9e')](_0x113e('0xb5'))['fromQuery']([_0x113e('0xa0'),'ContactId','ListId','VoiceQueueId',_0x113e('0x60'),_0x113e('0x61')],squel['select']()['field'](_0x113e('0xa0'),'phone')[_0x113e('0x84')]('id','ContactId')['field'](_0x55104f[_0x113e('0xa4')][_0x113e('0x8c')](),_0x113e('0xa5'))['field'](_0x18e7e5['params']['id'][_0x113e('0x8c')](),_0x113e('0x64'))[_0x113e('0x84')](_0x113e('0xa3'),_0x113e('0x60'))[_0x113e('0x84')](_0x113e('0xa3'),_0x113e('0x61'))[_0x113e('0x86')]('cm_contacts')[_0x113e('0x46')](_0x113e('0xa7'))[_0x113e('0x46')](_0x113e('0xa8'),_0x55104f[_0x113e('0xa4')][_0x113e('0x8c')]())[_0x113e('0x46')]('phone\x20IS\x20NOT\x20NULL'))[_0x113e('0x8c')]();_0x22dd54[_0x113e('0x8b')](db['sequelize'][_0x113e('0x3b')](_0x135c59));}return BPromise[_0x113e('0xb1')](_0x22dd54);}})['then'](function(){return _0x51126f;})[_0x113e('0x24')](respondWithResult(_0x132c17,null))[_0x113e('0x50')](handleError(_0x132c17,null));};exports['removeBlackLists']=function(_0x53f5fd,_0x28993a,_0x19edf6){return db[_0x113e('0x36')][_0x113e('0x2e')]({'where':{'id':_0x53f5fd[_0x113e('0x52')]['id']}})[_0x113e('0x24')](handleEntityNotFound(_0x28993a,null))['then'](function(_0xe75bc6){if(_0xe75bc6){return _0xe75bc6[_0x113e('0xb6')](_0x53f5fd[_0x113e('0x3b')][_0x113e('0x92')]);}})[_0x113e('0x24')](function(_0x7fd778){if(_0x7fd778){return db[_0x113e('0x6b')][_0x113e('0x31')]({'where':{'ListId':_0x53f5fd['query'][_0x113e('0x92')],'VoiceQueueId':_0x53f5fd[_0x113e('0x52')]['id']}})[_0x113e('0x24')](function(){return _0x7fd778;});}})[_0x113e('0x24')](respondWithStatusCode(_0x28993a,null))['catch'](handleError(_0x28993a,null));};
\ No newline at end of file
+var _0xb57d=['scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','phone','ListId\x20=\x20?','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','status','count','offset','set','Content-Range','json','reject','save','update','then','destroy','VoiceQueues','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','UserProfileResource','end','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','VIRTUAL','merge','VoiceQueue','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','clone','omit','createdAt','updatedAt','inbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','hasOwnProperty','pick','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','interface','emit','userVoiceQueue:save','removeTeams','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','compact','removeAgents','userVoiceQueue:remove','addAgents','ids','spread','isEmpty','format','SIP/%s','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery'];(function(_0x451402,_0x561cb8){var _0x4ffb7f=function(_0x1c263a){while(--_0x1c263a){_0x451402['push'](_0x451402['shift']());}};_0x4ffb7f(++_0x561cb8);}(_0xb57d,0x18d));var _0xdb57=function(_0x5815ee,_0x5336e8){_0x5815ee=_0x5815ee-0x0;var _0x5cb8f1=_0xb57d[_0x5815ee];return _0x5cb8f1;};'use strict';var pdf=require(_0xdb57('0x0'));var emlformat=require(_0xdb57('0x1'));var rimraf=require(_0xdb57('0x2'));var zipdir=require(_0xdb57('0x3'));var jsonpatch=require(_0xdb57('0x4'));var rp=require('request-promise');var moment=require(_0xdb57('0x5'));var BPromise=require(_0xdb57('0x6'));var Mustache=require(_0xdb57('0x7'));var util=require(_0xdb57('0x8'));var path=require('path');var sox=require(_0xdb57('0x9'));var csv=require(_0xdb57('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdb57('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdb57('0xc'));var deskjs=require(_0xdb57('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdb57('0xe'));var Redis=require(_0xdb57('0xf'));var authService=require(_0xdb57('0x10'));var qs=require(_0xdb57('0x11'));var as=require(_0xdb57('0x12'));var hardwareService=require(_0xdb57('0x13'));var logger=require('../../config/logger')(_0xdb57('0x14'));var utils=require('../../config/utils');var config=require(_0xdb57('0x15'));var db=require(_0xdb57('0x16'))['db'];config[_0xdb57('0x17')]=_[_0xdb57('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdb57('0x19'))(new Redis(config[_0xdb57('0x17')]));require(_0xdb57('0x1a'))['register'](socket);function respondWithStatusCode(_0x201fde,_0x25a660){_0x25a660=_0x25a660||0xcc;return function(_0x20083e){if(_0x20083e){return _0x201fde[_0xdb57('0x1b')](_0x25a660);}return _0x201fde[_0xdb57('0x1c')](_0x25a660)['end']();};}function respondWithResult(_0x42924f,_0x42f86a){_0x42f86a=_0x42f86a||0xc8;return function(_0x33c36a){if(_0x33c36a){return _0x42924f[_0xdb57('0x1c')](_0x42f86a)['json'](_0x33c36a);}};}function respondWithFilteredResult(_0x178e75,_0x54e7b4){return function(_0x3ca09e){if(_0x3ca09e){var _0x14b4f0=_0x3ca09e[_0xdb57('0x1d')],_0xff26b2=_0x54e7b4[_0xdb57('0x1e')],_0x3858b2=_0x54e7b4[_0xdb57('0x1e')]+_0x54e7b4['limit'],_0x52091b;if(_0x3858b2>=_0x14b4f0){_0x3858b2=_0x14b4f0;_0x52091b=0xc8;}else{_0x52091b=0xce;}_0x178e75['status'](_0x52091b);return _0x178e75[_0xdb57('0x1f')](_0xdb57('0x20'),_0xff26b2+'-'+_0x3858b2+'/'+_0x14b4f0)[_0xdb57('0x21')](_0x3ca09e);}return null;};}function patchUpdates(_0x48b941){return function(_0x605557){try{jsonpatch['apply'](_0x605557,_0x48b941,!![]);}catch(_0x3ffda2){return BPromise[_0xdb57('0x22')](_0x3ffda2);}return _0x605557[_0xdb57('0x23')]();};}function saveUpdates(_0x582607,_0x1f4c0d){return function(_0xaa09d0){if(_0xaa09d0){return _0xaa09d0[_0xdb57('0x24')](_0x582607)[_0xdb57('0x25')](function(_0x3a1755){return _0x3a1755;});}return null;};}function removeEntity(_0x436f76,_0x141768){return function(_0x1dea3d){if(_0x1dea3d){return _0x1dea3d[_0xdb57('0x26')]()['then'](function(){var _0x574796=_0x1dea3d['get']({'plain':!![]});var _0x31e009=[{'name':_0xdb57('0x27'),'value':'inbound','ignore':![]},{'name':_0xdb57('0x28'),'value':_0xdb57('0x29'),'ignore':![]}];var _0x1a5301=_(_0x31e009)[_0xdb57('0x2a')](_0xdb57('0x2b'))['map'](_0xdb57('0x2c'))[_0xdb57('0x2c')]();if(_[_0xdb57('0x2d')](_0x1a5301,_0x574796[_0xdb57('0x2e')])){return;}var _0x51d0f0=_[_0xdb57('0x2f')](_0x31e009,['value',_0x574796[_0xdb57('0x2e')]])['name'];return db[_0xdb57('0x30')][_0xdb57('0x26')]({'where':{'type':_0x51d0f0,'resourceId':_0x574796['id']}})[_0xdb57('0x25')](function(){return _0x1dea3d;});})[_0xdb57('0x25')](function(){_0x436f76[_0xdb57('0x1c')](0xcc)[_0xdb57('0x31')]();});}};}function handleEntityNotFound(_0x563ed9,_0x17af2c){return function(_0x30817e){if(!_0x30817e){_0x563ed9[_0xdb57('0x1b')](0x194);}return _0x30817e;};}function handleError(_0x840739,_0x389877){_0x389877=_0x389877||0x1f4;return function(_0x185499){logger['error'](_0x185499[_0xdb57('0x32')]);if(_0x185499[_0xdb57('0x33')]){delete _0x185499[_0xdb57('0x33')];}_0x840739[_0xdb57('0x1c')](_0x389877)[_0xdb57('0x34')](_0x185499);};}exports['index']=function(_0x61cdf8,_0x1b6027){var _0x5eb11e={},_0xabdad1={},_0x1aee29={'count':0x0,'rows':[]};var _0x3fc32f=_[_0xdb57('0x35')](db['VoiceQueue'][_0xdb57('0x36')],function(_0x83dfba){return{'name':_0x83dfba[_0xdb57('0x37')],'type':_0x83dfba[_0xdb57('0x2e')][_0xdb57('0x38')]};});_0xabdad1[_0xdb57('0x39')]=_[_0xdb57('0x35')](_0x3fc32f,_0xdb57('0x33'));_0xabdad1['query']=_['keys'](_0x61cdf8[_0xdb57('0x3a')]);_0xabdad1[_0xdb57('0x3b')]=_[_0xdb57('0x3c')](_0xabdad1[_0xdb57('0x39')],_0xabdad1[_0xdb57('0x3a')]);_0x5eb11e[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0xabdad1[_0xdb57('0x39')],qs[_0xdb57('0x3e')](_0x61cdf8[_0xdb57('0x3a')][_0xdb57('0x3e')]));_0x5eb11e[_0xdb57('0x3d')]=_0x5eb11e[_0xdb57('0x3d')][_0xdb57('0x3f')]?_0x5eb11e[_0xdb57('0x3d')]:_0xabdad1[_0xdb57('0x39')];if(!_0x61cdf8['query']['hasOwnProperty'](_0xdb57('0x40'))){_0x5eb11e[_0xdb57('0x41')]=qs['limit'](_0x61cdf8[_0xdb57('0x3a')][_0xdb57('0x41')]);_0x5eb11e[_0xdb57('0x1e')]=qs[_0xdb57('0x1e')](_0x61cdf8[_0xdb57('0x3a')]['offset']);}_0x5eb11e[_0xdb57('0x42')]=qs[_0xdb57('0x43')](_0x61cdf8[_0xdb57('0x3a')][_0xdb57('0x43')]);_0x5eb11e[_0xdb57('0x44')]=qs[_0xdb57('0x3b')](_['pick'](_0x61cdf8[_0xdb57('0x3a')],_0xabdad1[_0xdb57('0x3b')]),_0x3fc32f);if(_0x61cdf8[_0xdb57('0x3a')]['filter']){_0x5eb11e[_0xdb57('0x44')]=_['merge'](_0x5eb11e[_0xdb57('0x44')],{'$or':_[_0xdb57('0x35')](_0x3fc32f,function(_0x697595){if(_0x697595[_0xdb57('0x2e')]!==_0xdb57('0x45')){var _0x253304={};_0x253304[_0x697595[_0xdb57('0x33')]]={'$like':'%'+_0x61cdf8[_0xdb57('0x3a')]['filter']+'%'};return _0x253304;}})});}_0x5eb11e=_[_0xdb57('0x46')]({},_0x5eb11e,_0x61cdf8['options']);var _0x2f7474={'where':_0x5eb11e[_0xdb57('0x44')]};return db[_0xdb57('0x47')][_0xdb57('0x1d')](_0x2f7474)[_0xdb57('0x25')](function(_0x40a8a5){_0x1aee29[_0xdb57('0x1d')]=_0x40a8a5;if(_0x61cdf8[_0xdb57('0x3a')][_0xdb57('0x48')]){_0x5eb11e[_0xdb57('0x49')]=[{'all':!![]}];}return db[_0xdb57('0x47')][_0xdb57('0x4a')](_0x5eb11e);})[_0xdb57('0x25')](function(_0x5b4250){_0x1aee29[_0xdb57('0x4b')]=_0x5b4250;return _0x1aee29;})['then'](respondWithFilteredResult(_0x1b6027,_0x5eb11e))[_0xdb57('0x4c')](handleError(_0x1b6027,null));};exports[_0xdb57('0x4d')]=function(_0x2ede9d,_0x33d8a8){var _0x3acebf={'raw':![],'where':{'id':_0x2ede9d[_0xdb57('0x4e')]['id']}},_0x290a32={};_0x290a32[_0xdb57('0x39')]=_[_0xdb57('0x4f')](db['VoiceQueue']['rawAttributes']);_0x290a32[_0xdb57('0x3a')]=_['keys'](_0x2ede9d['query']);_0x290a32[_0xdb57('0x3b')]=_[_0xdb57('0x3c')](_0x290a32[_0xdb57('0x39')],_0x290a32[_0xdb57('0x3a')]);_0x3acebf[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0x290a32['model'],qs['fields'](_0x2ede9d[_0xdb57('0x3a')][_0xdb57('0x3e')]));_0x3acebf['attributes']=_0x3acebf[_0xdb57('0x3d')][_0xdb57('0x3f')]?_0x3acebf[_0xdb57('0x3d')]:_0x290a32[_0xdb57('0x39')];if(_0x2ede9d[_0xdb57('0x3a')][_0xdb57('0x48')]){_0x3acebf[_0xdb57('0x49')]=[{'all':!![]}];}_0x3acebf=_[_0xdb57('0x46')]({},_0x3acebf,_0x2ede9d[_0xdb57('0x50')]);return db[_0xdb57('0x47')][_0xdb57('0x2f')](_0x3acebf)[_0xdb57('0x25')](handleEntityNotFound(_0x33d8a8,null))[_0xdb57('0x25')](respondWithResult(_0x33d8a8,null))[_0xdb57('0x4c')](handleError(_0x33d8a8,null));};exports['create']=function(_0x2da891,_0x290c83){return db['VoiceQueue'][_0xdb57('0x51')](_0x2da891[_0xdb57('0x52')],{})[_0xdb57('0x25')](function(_0x249e59){var _0x3da9fd=_0x2da891[_0xdb57('0x53')][_0xdb57('0x54')]({'plain':!![]});if(!_0x3da9fd)throw new Error(_0xdb57('0x55'));if(_0x3da9fd[_0xdb57('0x56')]===_0xdb57('0x53')){var _0x487405=_0x249e59[_0xdb57('0x54')]({'plain':!![]});var _0x4bd81c=[{'name':_0xdb57('0x27'),'value':'inbound'},{'name':_0xdb57('0x28'),'value':_0xdb57('0x29')}];var _0x22ab41=_['find'](_0x4bd81c,[_0xdb57('0x2c'),_0x487405['type']])[_0xdb57('0x33')];return db[_0xdb57('0x57')][_0xdb57('0x2f')]({'where':{'name':_0x22ab41,'userProfileId':_0x3da9fd[_0xdb57('0x58')]},'raw':!![]})[_0xdb57('0x25')](function(_0x243ba7){if(_0x243ba7&&_0x243ba7['autoAssociation']===0x0){return db[_0xdb57('0x30')][_0xdb57('0x51')]({'name':_0x487405[_0xdb57('0x33')],'resourceId':_0x487405['id'],'type':_0x243ba7['name'],'sectionId':_0x243ba7['id']},{})[_0xdb57('0x25')](function(){return _0x249e59;});}else{return _0x249e59;}})[_0xdb57('0x4c')](function(_0x1c2679){logger[_0xdb57('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c2679);throw _0x1c2679;});}return _0x249e59;})[_0xdb57('0x25')](respondWithResult(_0x290c83,0xc9))[_0xdb57('0x4c')](handleError(_0x290c83,null));};exports[_0xdb57('0x5a')]=function(_0x160050,_0x2aa380){var _0x30fe47={'where':{'id':_0x160050[_0xdb57('0x4e')]['id']}},_0x5f137e={};_0x5f137e[_0xdb57('0x39')]=_[_0xdb57('0x4f')](db[_0xdb57('0x47')][_0xdb57('0x36')]);_0x30fe47[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0x5f137e['model'],qs[_0xdb57('0x3e')](_0x160050[_0xdb57('0x3a')][_0xdb57('0x3e')]));_0x30fe47[_0xdb57('0x3d')]=_0x30fe47['attributes'][_0xdb57('0x3f')]?_0x30fe47[_0xdb57('0x3d')]:_0x5f137e[_0xdb57('0x39')];if(_0x160050['query'][_0xdb57('0x48')]){_0x30fe47['include']=[{'all':!![]}];}_0x30fe47=_['merge']({},_0x30fe47,_0x160050[_0xdb57('0x50')]);return db[_0xdb57('0x47')][_0xdb57('0x2f')](_0x30fe47)[_0xdb57('0x25')](handleEntityNotFound(_0x2aa380,null))[_0xdb57('0x25')](function(_0x49524e){if(_0x49524e){var _0x1fe87f=_0x49524e[_0xdb57('0x54')]({'plain':!![]});_0x1fe87f=qs[_0xdb57('0x5b')](_0x1fe87f,['id',_0xdb57('0x5c'),'updatedAt']);_0x160050['body']=_[_0xdb57('0x5b')](_0x160050[_0xdb57('0x52')],['id',_0xdb57('0x5c'),_0xdb57('0x5d')]);return db[_0xdb57('0x47')][_0xdb57('0x51')](_['merge'](_0x1fe87f,_0x160050[_0xdb57('0x52')]),{'include':_0x160050[_0xdb57('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0xdb57('0x25')](function(_0x5b83a3){var _0x2bc7a0=_0x160050[_0xdb57('0x53')][_0xdb57('0x54')]({'plain':!![]});if(!_0x2bc7a0)throw new Error(_0xdb57('0x55'));if(_0x2bc7a0[_0xdb57('0x56')]===_0xdb57('0x53')){var _0x5f35c9=_0x5b83a3['get']({'plain':!![]});var _0x390bfa=[{'name':_0xdb57('0x27'),'value':_0xdb57('0x5e')},{'name':'QueueCampaigns','value':_0xdb57('0x29')}];var _0x1dc979=_['find'](_0x390bfa,[_0xdb57('0x2c'),_0x5f35c9[_0xdb57('0x2e')]])[_0xdb57('0x33')];return db['UserProfileSection']['find']({'where':{'name':_0x1dc979,'userProfileId':_0x2bc7a0[_0xdb57('0x58')]},'raw':!![]})[_0xdb57('0x25')](function(_0x5e3cf2){if(_0x5e3cf2&&_0x5e3cf2[_0xdb57('0x5f')]===0x0){return db[_0xdb57('0x30')]['create']({'name':_0x5f35c9[_0xdb57('0x33')],'resourceId':_0x5f35c9['id'],'type':_0x5e3cf2[_0xdb57('0x33')],'sectionId':_0x5e3cf2['id']},{})[_0xdb57('0x25')](function(){return _0x5b83a3;});}else{return _0x5b83a3;}})[_0xdb57('0x4c')](function(_0x54411f){logger[_0xdb57('0x59')](_0xdb57('0x60'),_0x54411f);throw _0x54411f;});}return _0x5b83a3;});}})[_0xdb57('0x25')](respondWithResult(_0x2aa380,0xc9))[_0xdb57('0x4c')](handleError(_0x2aa380,null));};exports[_0xdb57('0x24')]=function(_0x5a6acd,_0x51103e){if(_0x5a6acd[_0xdb57('0x52')]['id']){delete _0x5a6acd['body']['id'];}return db['VoiceQueue'][_0xdb57('0x2f')]({'where':{'id':_0x5a6acd[_0xdb57('0x4e')]['id']}})['then'](handleEntityNotFound(_0x51103e,null))['then'](saveUpdates(_0x5a6acd[_0xdb57('0x52')],null))[_0xdb57('0x25')](respondWithResult(_0x51103e,null))[_0xdb57('0x4c')](handleError(_0x51103e,null));};exports[_0xdb57('0x26')]=function(_0x1cf5b4,_0x5d1b05){return db[_0xdb57('0x47')][_0xdb57('0x2f')]({'where':{'id':_0x1cf5b4[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x5d1b05,null))[_0xdb57('0x25')](removeEntity(_0x5d1b05,null))[_0xdb57('0x4c')](handleError(_0x5d1b05,null));};exports[_0xdb57('0x61')]=function(_0x4e78e6,_0x41ca6c,_0x4e8bcb){var _0x49f0d1={'raw':![],'where':{}};var _0x4e2888={};var _0x1424b4={'count':0x0,'rows':[]};return db[_0xdb57('0x47')]['findOne']({'where':{'id':_0x4e78e6[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x41ca6c,null))[_0xdb57('0x25')](function(_0x58df55){if(_0x58df55){_0x4e2888['model']=_['keys'](db['CmHopper'][_0xdb57('0x36')]);_0x4e2888[_0xdb57('0x3a')]=_[_0xdb57('0x4f')](_0x4e78e6[_0xdb57('0x3a')]);_0x4e2888[_0xdb57('0x3b')]=_['intersection'](_0x4e2888[_0xdb57('0x39')],_0x4e2888['query']);_0x49f0d1[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0x4e2888['model'],qs['fields'](_0x4e78e6[_0xdb57('0x3a')][_0xdb57('0x3e')]));_0x49f0d1[_0xdb57('0x3d')]=_0x49f0d1['attributes'][_0xdb57('0x3f')]?_0x49f0d1[_0xdb57('0x3d')]:_0x4e2888[_0xdb57('0x39')];if(!_0x4e78e6[_0xdb57('0x3a')][_0xdb57('0x62')](_0xdb57('0x40'))){_0x49f0d1[_0xdb57('0x41')]=qs['limit'](_0x4e78e6[_0xdb57('0x3a')][_0xdb57('0x41')]);_0x49f0d1[_0xdb57('0x1e')]=qs['offset'](_0x4e78e6[_0xdb57('0x3a')][_0xdb57('0x1e')]);}_0x49f0d1['order']=qs['sort'](_0x4e78e6[_0xdb57('0x3a')][_0xdb57('0x43')]);_0x49f0d1[_0xdb57('0x44')]=qs['filters'](_[_0xdb57('0x63')](_0x4e78e6[_0xdb57('0x3a')],_0x4e2888[_0xdb57('0x3b')]));_0x49f0d1[_0xdb57('0x44')][_0xdb57('0x64')]=_0x58df55['id'];if(_0x4e78e6[_0xdb57('0x3a')][_0xdb57('0x2a')]){_0x49f0d1[_0xdb57('0x44')]=_['merge'](_0x49f0d1['where'],{'$or':_[_0xdb57('0x35')](_0x49f0d1[_0xdb57('0x3d')],function(_0x5271db){var _0x2430aa={};_0x2430aa[_0x5271db]={'$like':'%'+_0x4e78e6[_0xdb57('0x3a')][_0xdb57('0x2a')]+'%'};return _0x2430aa;})});}_0x49f0d1=_[_0xdb57('0x46')]({},_0x49f0d1,_0x4e78e6[_0xdb57('0x50')]);return db[_0xdb57('0x65')][_0xdb57('0x1d')]({'where':_0x49f0d1['where']})[_0xdb57('0x25')](function(_0x57277b){_0x1424b4[_0xdb57('0x1d')]=_0x57277b;if(_0x4e78e6[_0xdb57('0x3a')][_0xdb57('0x48')]){_0x49f0d1[_0xdb57('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0xdb57('0x4a')](_0x49f0d1);})['then'](function(_0x21e347){_0x1424b4[_0xdb57('0x4b')]=_0x21e347;return _0x1424b4;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x41ca6c,_0x49f0d1))['catch'](handleError(_0x41ca6c,null));};exports[_0xdb57('0x66')]=function(_0x33ac8a,_0x41ec06,_0x5ea7c5){var _0x394a66={'raw':!![],'where':{}};var _0x483424={};var _0x188ca9={'count':0x0,'rows':[]};return db[_0xdb57('0x47')]['findOne']({'where':{'id':_0x33ac8a[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x41ec06,null))[_0xdb57('0x25')](function(_0x4288c6){if(_0x4288c6){_0x483424['model']=_[_0xdb57('0x4f')](db[_0xdb57('0x67')][_0xdb57('0x36')]);_0x483424['query']=_[_0xdb57('0x4f')](_0x33ac8a[_0xdb57('0x3a')]);_0x483424[_0xdb57('0x3b')]=_[_0xdb57('0x3c')](_0x483424[_0xdb57('0x39')],_0x483424[_0xdb57('0x3a')]);_0x394a66[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0x483424[_0xdb57('0x39')],qs['fields'](_0x33ac8a[_0xdb57('0x3a')]['fields']));_0x394a66[_0xdb57('0x3d')]=_0x394a66[_0xdb57('0x3d')][_0xdb57('0x3f')]?_0x394a66[_0xdb57('0x3d')]:_0x483424['model'];if(!_0x33ac8a[_0xdb57('0x3a')]['hasOwnProperty'](_0xdb57('0x40'))){_0x394a66['limit']=qs[_0xdb57('0x41')](_0x33ac8a[_0xdb57('0x3a')][_0xdb57('0x41')]);_0x394a66[_0xdb57('0x1e')]=qs[_0xdb57('0x1e')](_0x33ac8a[_0xdb57('0x3a')]['offset']);}_0x394a66[_0xdb57('0x42')]=qs[_0xdb57('0x43')](_0x33ac8a[_0xdb57('0x3a')]['sort']);_0x394a66[_0xdb57('0x44')]=qs[_0xdb57('0x3b')](_[_0xdb57('0x63')](_0x33ac8a['query'],_0x483424[_0xdb57('0x3b')]));_0x394a66[_0xdb57('0x44')][_0xdb57('0x64')]=_0x4288c6['id'];if(_0x33ac8a['query'][_0xdb57('0x2a')]){_0x394a66[_0xdb57('0x44')]=_[_0xdb57('0x46')](_0x394a66[_0xdb57('0x44')],{'$or':_['map'](_0x394a66[_0xdb57('0x3d')],function(_0x5f4387){var _0x352b35={};_0x352b35[_0x5f4387]={'$like':'%'+_0x33ac8a[_0xdb57('0x3a')][_0xdb57('0x2a')]+'%'};return _0x352b35;})});}_0x394a66=_[_0xdb57('0x46')]({},_0x394a66,_0x33ac8a['options']);return db[_0xdb57('0x67')][_0xdb57('0x1d')]({'where':_0x394a66[_0xdb57('0x44')]})[_0xdb57('0x25')](function(_0x1e4711){_0x188ca9[_0xdb57('0x1d')]=_0x1e4711;if(_0x33ac8a[_0xdb57('0x3a')][_0xdb57('0x48')]){_0x394a66[_0xdb57('0x49')]=[{'all':!![]}];}return db[_0xdb57('0x67')]['findAll'](_0x394a66);})[_0xdb57('0x25')](function(_0x6e2827){_0x188ca9[_0xdb57('0x4b')]=_0x6e2827;return _0x188ca9;});}})['then'](respondWithFilteredResult(_0x41ec06,_0x394a66))[_0xdb57('0x4c')](handleError(_0x41ec06,null));};exports[_0xdb57('0x68')]=function(_0x3d273a,_0x571eb1,_0x5ab749){var _0xa58e10={'raw':!![],'where':{}};var _0x775ca1={};var _0x3bdeb1={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdb57('0x69')]({'where':{'id':_0x3d273a[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x571eb1,null))[_0xdb57('0x25')](function(_0x14e6ea){if(_0x14e6ea){_0x775ca1[_0xdb57('0x39')]=_[_0xdb57('0x4f')](db[_0xdb57('0x6a')][_0xdb57('0x36')]);_0x775ca1[_0xdb57('0x3a')]=_[_0xdb57('0x4f')](_0x3d273a['query']);_0x775ca1[_0xdb57('0x3b')]=_['intersection'](_0x775ca1[_0xdb57('0x39')],_0x775ca1['query']);_0xa58e10['attributes']=_[_0xdb57('0x3c')](_0x775ca1[_0xdb57('0x39')],qs[_0xdb57('0x3e')](_0x3d273a[_0xdb57('0x3a')][_0xdb57('0x3e')]));_0xa58e10[_0xdb57('0x3d')]=_0xa58e10[_0xdb57('0x3d')][_0xdb57('0x3f')]?_0xa58e10[_0xdb57('0x3d')]:_0x775ca1[_0xdb57('0x39')];if(!_0x3d273a[_0xdb57('0x3a')][_0xdb57('0x62')](_0xdb57('0x40'))){_0xa58e10['limit']=qs['limit'](_0x3d273a[_0xdb57('0x3a')][_0xdb57('0x41')]);_0xa58e10[_0xdb57('0x1e')]=qs[_0xdb57('0x1e')](_0x3d273a[_0xdb57('0x3a')]['offset']);}_0xa58e10[_0xdb57('0x42')]=qs[_0xdb57('0x43')](_0x3d273a[_0xdb57('0x3a')][_0xdb57('0x43')]);_0xa58e10['where']=qs[_0xdb57('0x3b')](_[_0xdb57('0x63')](_0x3d273a[_0xdb57('0x3a')],_0x775ca1[_0xdb57('0x3b')]));_0xa58e10[_0xdb57('0x44')][_0xdb57('0x64')]=_0x14e6ea['id'];if(_0x3d273a[_0xdb57('0x3a')][_0xdb57('0x2a')]){_0xa58e10['where']=_['merge'](_0xa58e10[_0xdb57('0x44')],{'$or':_[_0xdb57('0x35')](_0xa58e10['attributes'],function(_0x2b868f){var _0x195ccc={};_0x195ccc[_0x2b868f]={'$like':'%'+_0x3d273a[_0xdb57('0x3a')][_0xdb57('0x2a')]+'%'};return _0x195ccc;})});}_0xa58e10=_[_0xdb57('0x46')]({},_0xa58e10,_0x3d273a['options']);return db[_0xdb57('0x6a')][_0xdb57('0x1d')]({'where':_0xa58e10[_0xdb57('0x44')]})['then'](function(_0x346768){_0x3bdeb1['count']=_0x346768;if(_0x3d273a[_0xdb57('0x3a')][_0xdb57('0x48')]){_0xa58e10['include']=[{'all':!![]}];}return db[_0xdb57('0x6a')][_0xdb57('0x4a')](_0xa58e10);})[_0xdb57('0x25')](function(_0xbd24cd){_0x3bdeb1[_0xdb57('0x4b')]=_0xbd24cd;return _0x3bdeb1;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x571eb1,_0xa58e10))[_0xdb57('0x4c')](handleError(_0x571eb1,null));};exports[_0xdb57('0x6b')]=function(_0x53c7d6,_0x6de434,_0x1c0d87){var _0x3dfedb={'raw':!![],'where':{}};var _0x52ddf6={};var _0x30feb1={'count':0x0,'rows':[]};return db[_0xdb57('0x47')][_0xdb57('0x69')]({'where':{'id':_0x53c7d6[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x6de434,null))[_0xdb57('0x25')](function(_0x150b71){if(_0x150b71){_0x52ddf6['model']=_[_0xdb57('0x4f')](db[_0xdb57('0x6c')]['rawAttributes']);_0x52ddf6[_0xdb57('0x3a')]=_[_0xdb57('0x4f')](_0x53c7d6[_0xdb57('0x3a')]);_0x52ddf6[_0xdb57('0x3b')]=_[_0xdb57('0x3c')](_0x52ddf6[_0xdb57('0x39')],_0x52ddf6['query']);_0x3dfedb[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0x52ddf6[_0xdb57('0x39')],qs[_0xdb57('0x3e')](_0x53c7d6[_0xdb57('0x3a')][_0xdb57('0x3e')]));_0x3dfedb['attributes']=_0x3dfedb[_0xdb57('0x3d')][_0xdb57('0x3f')]?_0x3dfedb[_0xdb57('0x3d')]:_0x52ddf6[_0xdb57('0x39')];if(!_0x53c7d6['query'][_0xdb57('0x62')](_0xdb57('0x40'))){_0x3dfedb['limit']=qs[_0xdb57('0x41')](_0x53c7d6[_0xdb57('0x3a')]['limit']);_0x3dfedb[_0xdb57('0x1e')]=qs[_0xdb57('0x1e')](_0x53c7d6['query']['offset']);}_0x3dfedb[_0xdb57('0x42')]=qs['sort'](_0x53c7d6[_0xdb57('0x3a')][_0xdb57('0x43')]);_0x3dfedb[_0xdb57('0x44')]=qs[_0xdb57('0x3b')](_[_0xdb57('0x63')](_0x53c7d6[_0xdb57('0x3a')],_0x52ddf6[_0xdb57('0x3b')]));_0x3dfedb[_0xdb57('0x44')][_0xdb57('0x64')]=_0x150b71['id'];if(_0x53c7d6[_0xdb57('0x3a')][_0xdb57('0x2a')]){_0x3dfedb['where']=_[_0xdb57('0x46')](_0x3dfedb[_0xdb57('0x44')],{'$or':_[_0xdb57('0x35')](_0x3dfedb[_0xdb57('0x3d')],function(_0xb166c9){var _0xeef9e7={};_0xeef9e7[_0xb166c9]={'$like':'%'+_0x53c7d6['query']['filter']+'%'};return _0xeef9e7;})});}_0x3dfedb=_[_0xdb57('0x46')]({},_0x3dfedb,_0x53c7d6[_0xdb57('0x50')]);return db['CmHopperBlack'][_0xdb57('0x1d')]({'where':_0x3dfedb[_0xdb57('0x44')]})[_0xdb57('0x25')](function(_0x467fa8){_0x30feb1[_0xdb57('0x1d')]=_0x467fa8;if(_0x53c7d6[_0xdb57('0x3a')]['includeAll']){_0x3dfedb[_0xdb57('0x49')]=[{'all':!![]}];}return db[_0xdb57('0x6c')][_0xdb57('0x4a')](_0x3dfedb);})[_0xdb57('0x25')](function(_0x1547a6){_0x30feb1[_0xdb57('0x4b')]=_0x1547a6;return _0x30feb1;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x6de434,_0x3dfedb))['catch'](handleError(_0x6de434,null));};exports[_0xdb57('0x6d')]=function(_0x114c70,_0x1780c5,_0x85b895){var _0x17fe36={};var _0x56e1c7={};var _0xa88604;var _0x1a5c14;return db[_0xdb57('0x47')][_0xdb57('0x69')]({'where':{'id':_0x114c70['params']['id']}})['then'](handleEntityNotFound(_0x1780c5,null))['then'](function(_0x2aaa87){if(_0x2aaa87){_0xa88604=_0x2aaa87;_0x56e1c7['model']=_[_0xdb57('0x4f')](db[_0xdb57('0x6e')][_0xdb57('0x36')]);_0x56e1c7['query']=_['keys'](_0x114c70[_0xdb57('0x3a')]);_0x56e1c7[_0xdb57('0x3b')]=_['intersection'](_0x56e1c7[_0xdb57('0x39')],_0x56e1c7[_0xdb57('0x3a')]);_0x17fe36['attributes']=_[_0xdb57('0x3c')](_0x56e1c7['model'],qs[_0xdb57('0x3e')](_0x114c70[_0xdb57('0x3a')]['fields']));_0x17fe36[_0xdb57('0x3d')]=_0x17fe36['attributes'][_0xdb57('0x3f')]?_0x17fe36['attributes']:_0x56e1c7['model'];_0x17fe36[_0xdb57('0x42')]=qs[_0xdb57('0x43')](_0x114c70[_0xdb57('0x3a')]['sort']);_0x17fe36[_0xdb57('0x44')]=qs[_0xdb57('0x3b')](_[_0xdb57('0x63')](_0x114c70[_0xdb57('0x3a')],_0x56e1c7['filters']));if(_0x114c70[_0xdb57('0x3a')][_0xdb57('0x2a')]){_0x17fe36[_0xdb57('0x44')]=_[_0xdb57('0x46')](_0x17fe36['where'],{'$or':_[_0xdb57('0x35')](_0x17fe36[_0xdb57('0x3d')],function(_0x34e895){var _0x554867={};_0x554867[_0x34e895]={'$like':'%'+_0x114c70[_0xdb57('0x3a')][_0xdb57('0x2a')]+'%'};return _0x554867;})});}_0x17fe36=_[_0xdb57('0x46')]({},_0x17fe36,_0x114c70[_0xdb57('0x50')]);return _0xa88604[_0xdb57('0x6d')](_0x17fe36);}})['then'](function(_0x50d4ad){if(_0x50d4ad){_0x1a5c14=_0x50d4ad[_0xdb57('0x3f')];if(!_0x114c70[_0xdb57('0x3a')][_0xdb57('0x62')]('nolimit')){_0x17fe36[_0xdb57('0x41')]=qs[_0xdb57('0x41')](_0x114c70[_0xdb57('0x3a')][_0xdb57('0x41')]);_0x17fe36[_0xdb57('0x1e')]=qs[_0xdb57('0x1e')](_0x114c70[_0xdb57('0x3a')][_0xdb57('0x1e')]);}return _0xa88604['getTeams'](_0x17fe36);}})['then'](function(_0x8d8567){if(_0x8d8567){return _0x8d8567?{'count':_0x1a5c14,'rows':_0x8d8567}:null;}})['then'](respondWithResult(_0x1780c5,null))[_0xdb57('0x4c')](handleError(_0x1780c5,null));};exports[_0xdb57('0x6f')]=function(_0x4b6e67,_0x5e86bf,_0x381a7e){var _0x59e676=_0x4b6e67[_0xdb57('0x52')][_0xdb57('0x70')];var _0x12c082=_['map'](_0x59e676,'id');return db[_0xdb57('0x6e')]['findAll']({'where':{'id':_0x12c082},'attributes':['id'],'include':[{'model':db[_0xdb57('0x71')],'as':_0xdb57('0x72'),'attributes':['id',_0xdb57('0x33'),_0xdb57('0x73'),_0xdb57('0x74'),'interface'],'raw':!![]}]})['then'](function(_0x567ce8){if(_0x567ce8){var _0x22a821=_[_0xdb57('0x75')](_0x567ce8,function(_0x1f8f96){var _0x31a968=_0x1f8f96[_0xdb57('0x54')]({'plain':!![]});_0x31a968['Agents'][_0xdb57('0x76')](function(_0x1cb837){_0x1cb837[_0xdb57('0x77')]=_[_0xdb57('0x2f')](_0x59e676,{'id':_0x31a968['id']})[_0xdb57('0x77')];});return _0x31a968['Agents'];});return db[_0xdb57('0x47')][_0xdb57('0x2f')]({'where':{'id':_0x4b6e67[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](function(_0x65c160){return db[_0xdb57('0x78')][_0xdb57('0x79')](function(_0x36c821){return _0x65c160[_0xdb57('0x6f')](_0x12c082,{'transaction':_0x36c821})['then'](function(){return BPromise[_0xdb57('0x7a')](_0x22a821,function(_0x52ab76){return db[_0xdb57('0x7b')]['findOrCreate']({'where':{'UserId':_0x52ab76['id'],'VoiceQueueId':_0x4b6e67[_0xdb57('0x4e')]['id']},'defaults':{'penalty':_0x52ab76[_0xdb57('0x77')]},'transaction':_0x36c821});});})[_0xdb57('0x25')](function(){return BPromise['each'](_['filter'](_0x22a821,{'online':!![]}),function(_0x7d5fc3){return db[_0xdb57('0x7c')][_0xdb57('0x7d')]({'membername':_0x7d5fc3[_0xdb57('0x33')],'UserId':_0x7d5fc3['id'],'queue_name':_0x65c160['name'],'VoiceQueueId':_0x65c160['id'],'interface':_[_0xdb57('0x7e')](_0x7d5fc3[_0xdb57('0x7f')])?util['format']('SIP/%s',_0x7d5fc3[_0xdb57('0x33')]):_0x7d5fc3['interface'],'paused':_0x7d5fc3[_0xdb57('0x74')]||![],'penalty':_0x7d5fc3[_0xdb57('0x77')]},{'transaction':_0x36c821});});})[_0xdb57('0x25')](function(){_0x22a821[_0xdb57('0x76')](function(_0x1cae78){socket[_0xdb57('0x80')](_0xdb57('0x81'),{'UserId':_0x1cae78['id'],'VoiceQueueId':_0x65c160['id']});});});});});}})[_0xdb57('0x25')](respondWithStatusCode(_0x5e86bf,null))['catch'](handleError(_0x5e86bf,null));};exports[_0xdb57('0x82')]=function(_0x58e98b,_0x19d03f,_0x24b0be){return db[_0xdb57('0x6e')][_0xdb57('0x4a')]({'where':{'id':_0x58e98b['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xdb57('0x71')],'as':_0xdb57('0x72'),'attributes':['id'],'raw':!![]}]})[_0xdb57('0x25')](handleEntityNotFound(_0x19d03f,null))[_0xdb57('0x25')](function(_0x1aaf8e){var _0x57fa9b=_[_0xdb57('0x35')](_0x1aaf8e,'id');var _0x79b3f3=[];var _0x43ee03=[];var _0x370fb5=squel[_0xdb57('0x83')]();_0x370fb5[_0xdb57('0x84')]('tq.TeamId')[_0xdb57('0x85')](_0xdb57('0x86'),'tq')[_0xdb57('0x87')](_0xdb57('0x88'),'ut',_0xdb57('0x89'))[_0xdb57('0x44')]('VoiceQueueId\x20=\x20?',_0x58e98b[_0xdb57('0x4e')]['id']);for(var _0x3c5e11=0x0;_0x3c5e11<_0x1aaf8e[_0xdb57('0x3f')];_0x3c5e11+=0x1){let _0x357efa=_0x1aaf8e[_0x3c5e11];for(var _0x3ea039=0x0;_0x3ea039<_0x357efa[_0xdb57('0x72')][_0xdb57('0x3f')];_0x3ea039+=0x1){let _0x217a35=_0x357efa[_0xdb57('0x72')][_0x3ea039];var _0x2f79e8=_0x370fb5[_0xdb57('0x5a')]();_0x2f79e8[_0xdb57('0x44')](_0xdb57('0x8a'),_0x217a35['id']);_0x43ee03[_0xdb57('0x8b')](db[_0xdb57('0x78')][_0xdb57('0x3a')](_0x2f79e8[_0xdb57('0x8c')](),{'type':db['sequelize']['QueryTypes'][_0xdb57('0x8d')]})[_0xdb57('0x25')](function(_0x146cea){if(_0x146cea[_0xdb57('0x3f')]===0x1){return _0x217a35['id'];}else{var _0x4e5e5e=_[_0xdb57('0x8e')](_[_0xdb57('0x35')](_0x146cea,_0xdb57('0x8f')),function(_0x3187fd){return _[_0xdb57('0x2d')](_0x57fa9b,_0x3187fd);});if(_0x4e5e5e){return _0x217a35['id'];}}}));}}return BPromise['all'](_0x43ee03)['then'](function(_0x5e3295){_0x79b3f3=_(_0x79b3f3)[_0xdb57('0x90')](_0x5e3295)[_0xdb57('0x91')]()[_0xdb57('0x2c')]();return db['VoiceQueue'][_0xdb57('0x2f')]({'where':{'id':_0x58e98b[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](function(_0x467492){return db[_0xdb57('0x78')]['transaction'](function(_0x2164a3){return _0x467492[_0xdb57('0x82')](_0x58e98b[_0xdb57('0x3a')]['ids'],{'transaction':_0x2164a3})[_0xdb57('0x25')](function(){if(!_['isEmpty'](_0x79b3f3)){return _0x467492[_0xdb57('0x92')](_0x79b3f3,{'transaction':_0x2164a3})[_0xdb57('0x25')](function(){return db[_0xdb57('0x7c')][_0xdb57('0x26')]({'where':{'VoiceQueueId':_0x58e98b[_0xdb57('0x4e')]['id'],'UserId':_0x79b3f3},'transaction':_0x2164a3});});}})[_0xdb57('0x25')](function(){_0x79b3f3[_0xdb57('0x76')](function(_0x8ddbf4){socket[_0xdb57('0x80')](_0xdb57('0x93'),{'UserId':_0x8ddbf4,'VoiceQueueId':_0x467492['id']});});});});});});})[_0xdb57('0x25')](respondWithStatusCode(_0x19d03f,null))[_0xdb57('0x4c')](handleError(_0x19d03f,null));};exports[_0xdb57('0x94')]=function(_0x9dcdba,_0x38bf06,_0xb8855){var _0x55cad4,_0x259581;return db[_0xdb57('0x47')][_0xdb57('0x2f')]({'where':{'id':_0x9dcdba[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x38bf06,null))[_0xdb57('0x25')](function(_0x43d84d){if(_0x43d84d){_0x259581=_0x43d84d;return _0x43d84d['addAgents'](_0x9dcdba[_0xdb57('0x52')][_0xdb57('0x95')],_[_0xdb57('0x5b')](_0x9dcdba[_0xdb57('0x52')],[_0xdb57('0x95'),'id'])||{})[_0xdb57('0x96')](function(_0x2f1e07){for(var _0x4a3215=0x0;_0x4a3215<_0x9dcdba[_0xdb57('0x52')][_0xdb57('0x95')][_0xdb57('0x3f')];_0x4a3215+=0x1){socket['emit'](_0xdb57('0x81'),{'UserId':_0x9dcdba[_0xdb57('0x52')]['ids'][_0x4a3215],'VoiceQueueId':_0x9dcdba[_0xdb57('0x4e')]['id']});}return _0x2f1e07;});}})[_0xdb57('0x25')](function(_0x3a5438){_0x55cad4=_0x3a5438||[];if(_0x259581){return db[_0xdb57('0x71')][_0xdb57('0x4a')]({'where':{'id':_0x9dcdba['body'][_0xdb57('0x95')]},'attributes':['id',_0xdb57('0x33'),_0xdb57('0x73'),_0xdb57('0x74'),_0xdb57('0x7f')],'raw':!![]});}})[_0xdb57('0x25')](function(_0x4c0682){if(!_[_0xdb57('0x97')](_0x4c0682)){var _0x9d5a38=[];for(var _0x46156f=0x0;_0x46156f<_0x4c0682['length'];_0x46156f++){if(_0x4c0682[_0x46156f][_0xdb57('0x73')]){_0x9d5a38[_0xdb57('0x8b')](db[_0xdb57('0x7c')][_0xdb57('0x7d')]({'membername':_0x4c0682[_0x46156f][_0xdb57('0x33')],'UserId':_0x4c0682[_0x46156f]['id'],'queue_name':_0x259581['name'],'VoiceQueueId':_0x259581['id'],'interface':_[_0xdb57('0x7e')](_0x4c0682[_0x46156f]['interface'])?util[_0xdb57('0x98')](_0xdb57('0x99'),_0x4c0682[_0x46156f]['name']):_0x4c0682[_0x46156f][_0xdb57('0x7f')],'paused':_0x4c0682[_0x46156f]['voicePause']||![],'penalty':_0x9dcdba[_0xdb57('0x52')][_0xdb57('0x77')]||0x0}));}}return BPromise['all'](_0x9d5a38);}})[_0xdb57('0x25')](function(){return _0x55cad4;})[_0xdb57('0x25')](respondWithResult(_0x38bf06,null))[_0xdb57('0x4c')](handleError(_0x38bf06,null));};exports[_0xdb57('0x92')]=function(_0x5023f9,_0x479ea7,_0x3c0ec1){return db[_0xdb57('0x47')][_0xdb57('0x2f')]({'where':{'id':_0x5023f9[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x479ea7,null))['then'](function(_0x591ddc){if(_0x591ddc){return _0x591ddc[_0xdb57('0x92')](_0x5023f9[_0xdb57('0x3a')][_0xdb57('0x95')])[_0xdb57('0x25')](function(){if(_['isArray'](_0x5023f9[_0xdb57('0x3a')]['ids'])){for(var _0x3286d5=0x0;_0x3286d5<_0x5023f9[_0xdb57('0x3a')][_0xdb57('0x95')][_0xdb57('0x3f')];_0x3286d5+=0x1){socket[_0xdb57('0x80')](_0xdb57('0x93'),{'UserId':Number(_0x5023f9[_0xdb57('0x3a')][_0xdb57('0x95')][_0x3286d5]),'VoiceQueueId':Number(_0x5023f9[_0xdb57('0x4e')]['id'])});}}else{socket[_0xdb57('0x80')](_0xdb57('0x93'),{'UserId':Number(_0x5023f9[_0xdb57('0x3a')][_0xdb57('0x95')]),'VoiceQueueId':Number(_0x5023f9['params']['id'])});}});}})[_0xdb57('0x25')](function(_0x2c7667){return db[_0xdb57('0x7c')][_0xdb57('0x26')]({'where':{'VoiceQueueId':_0x5023f9[_0xdb57('0x4e')]['id'],'UserId':_0x5023f9[_0xdb57('0x3a')][_0xdb57('0x95')]}})[_0xdb57('0x25')](function(){return _0x2c7667;});})[_0xdb57('0x25')](respondWithStatusCode(_0x479ea7,null))[_0xdb57('0x4c')](handleError(_0x479ea7,null));};exports['getAgents']=function(_0x1b07d8,_0x5aa073,_0xf9960f){var _0x3fdc05={};var _0x3d647b={};var _0x281839;var _0x2d0c1f;return db[_0xdb57('0x47')]['findOne']({'where':{'id':_0x1b07d8[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x5aa073,null))[_0xdb57('0x25')](function(_0x53c3c9){if(_0x53c3c9){_0x281839=_0x53c3c9;_0x3d647b[_0xdb57('0x39')]=_[_0xdb57('0x4f')](db[_0xdb57('0x71')][_0xdb57('0x36')]);_0x3d647b[_0xdb57('0x3a')]=_[_0xdb57('0x4f')](_0x1b07d8[_0xdb57('0x3a')]);_0x3d647b[_0xdb57('0x3b')]=_[_0xdb57('0x3c')](_0x3d647b[_0xdb57('0x39')],_0x3d647b[_0xdb57('0x3a')]);_0x3fdc05['attributes']=_[_0xdb57('0x3c')](_0x3d647b[_0xdb57('0x39')],qs[_0xdb57('0x3e')](_0x1b07d8['query'][_0xdb57('0x3e')]));_0x3fdc05[_0xdb57('0x3d')]=_0x3fdc05['attributes'][_0xdb57('0x3f')]?_0x3fdc05[_0xdb57('0x3d')]:_0x3d647b['model'];_0x3fdc05['order']=qs[_0xdb57('0x43')](_0x1b07d8[_0xdb57('0x3a')][_0xdb57('0x43')]);_0x3fdc05[_0xdb57('0x44')]=qs['filters'](_[_0xdb57('0x63')](_0x1b07d8['query'],_0x3d647b[_0xdb57('0x3b')]));if(_0x1b07d8[_0xdb57('0x3a')]['filter']){_0x3fdc05['where']=_[_0xdb57('0x46')](_0x3fdc05[_0xdb57('0x44')],{'$or':_[_0xdb57('0x35')](_0x3fdc05[_0xdb57('0x3d')],function(_0x16b0ab){var _0x2647eb={};_0x2647eb[_0x16b0ab]={'$like':'%'+_0x1b07d8['query'][_0xdb57('0x2a')]+'%'};return _0x2647eb;})});}_0x3fdc05=_['merge']({},_0x3fdc05,_0x1b07d8[_0xdb57('0x50')]);return _0x281839['getAgents'](_0x3fdc05);}})[_0xdb57('0x25')](function(_0xf284b2){if(_0xf284b2){_0x2d0c1f=_0xf284b2[_0xdb57('0x3f')];if(!_0x1b07d8[_0xdb57('0x3a')][_0xdb57('0x62')](_0xdb57('0x40'))){_0x3fdc05['limit']=qs[_0xdb57('0x41')](_0x1b07d8[_0xdb57('0x3a')][_0xdb57('0x41')]);_0x3fdc05[_0xdb57('0x1e')]=qs[_0xdb57('0x1e')](_0x1b07d8['query'][_0xdb57('0x1e')]);}return _0x281839[_0xdb57('0x9a')](_0x3fdc05);}})['then'](function(_0x7adbb0){if(_0x7adbb0){return _0x7adbb0?{'count':_0x2d0c1f,'rows':_0x7adbb0}:null;}})[_0xdb57('0x25')](respondWithResult(_0x5aa073,null))[_0xdb57('0x4c')](handleError(_0x5aa073,null));};exports[_0xdb57('0x9b')]=function(_0x5a6524,_0x2ce12f,_0x17fc2c){var _0x122ab5={};var _0x55222a={};var _0x42a946;var _0x477eb3;return db[_0xdb57('0x47')][_0xdb57('0x69')]({'where':{'id':_0x5a6524[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x2ce12f,null))[_0xdb57('0x25')](function(_0x3d37df){if(_0x3d37df){_0x42a946=_0x3d37df;_0x55222a[_0xdb57('0x39')]=_[_0xdb57('0x4f')](db[_0xdb57('0x7c')][_0xdb57('0x36')]);_0x55222a['query']=_[_0xdb57('0x4f')](_0x5a6524[_0xdb57('0x3a')]);_0x55222a['filters']=_[_0xdb57('0x3c')](_0x55222a['model'],_0x55222a[_0xdb57('0x3a')]);_0x122ab5[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0x55222a[_0xdb57('0x39')],qs['fields'](_0x5a6524['query'][_0xdb57('0x3e')]));_0x122ab5[_0xdb57('0x3d')]=_0x122ab5[_0xdb57('0x3d')][_0xdb57('0x3f')]?_0x122ab5[_0xdb57('0x3d')]:_0x55222a[_0xdb57('0x39')];_0x122ab5[_0xdb57('0x42')]=qs[_0xdb57('0x43')](_0x5a6524[_0xdb57('0x3a')][_0xdb57('0x43')]);_0x122ab5[_0xdb57('0x44')]=qs['filters'](_[_0xdb57('0x63')](_0x5a6524[_0xdb57('0x3a')],_0x55222a[_0xdb57('0x3b')]));if(_0x5a6524['query'][_0xdb57('0x2a')]){_0x122ab5[_0xdb57('0x44')]=_[_0xdb57('0x46')](_0x122ab5[_0xdb57('0x44')],{'$or':_['map'](_0x122ab5['attributes'],function(_0x40babe){var _0x174a1c={};_0x174a1c[_0x40babe]={'$like':'%'+_0x5a6524[_0xdb57('0x3a')][_0xdb57('0x2a')]+'%'};return _0x174a1c;})});}_0x122ab5=_[_0xdb57('0x46')]({},_0x122ab5,_0x5a6524[_0xdb57('0x50')]);return _0x42a946[_0xdb57('0x9b')](_0x122ab5);}})[_0xdb57('0x25')](function(_0x459048){if(_0x459048){_0x477eb3=_0x459048['length'];if(!_0x5a6524['query']['hasOwnProperty'](_0xdb57('0x40'))){_0x122ab5[_0xdb57('0x41')]=qs[_0xdb57('0x41')](_0x5a6524['query'][_0xdb57('0x41')]);_0x122ab5[_0xdb57('0x1e')]=qs[_0xdb57('0x1e')](_0x5a6524['query'][_0xdb57('0x1e')]);}return _0x42a946[_0xdb57('0x9b')](_0x122ab5);}})['then'](function(_0x3c8938){return _0x3c8938?{'count':_0x477eb3,'rows':_0x3c8938}:null;})[_0xdb57('0x25')](respondWithResult(_0x2ce12f,null))[_0xdb57('0x4c')](handleError(_0x2ce12f,null));};exports['getLists']=function(_0x4a6e9f,_0x19f041,_0x3b543b){var _0x248b67={};var _0x1dc152={};var _0x4fcb4d;var _0x1032a6;return db[_0xdb57('0x47')]['findOne']({'where':{'id':_0x4a6e9f[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x19f041,null))[_0xdb57('0x25')](function(_0x27e069){if(_0x27e069){_0x4fcb4d=_0x27e069;_0x1dc152[_0xdb57('0x39')]=_['keys'](db[_0xdb57('0x9c')][_0xdb57('0x36')]);_0x1dc152['query']=_[_0xdb57('0x4f')](_0x4a6e9f['query']);_0x1dc152['filters']=_[_0xdb57('0x3c')](_0x1dc152[_0xdb57('0x39')],_0x1dc152[_0xdb57('0x3a')]);_0x248b67[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0x1dc152[_0xdb57('0x39')],qs[_0xdb57('0x3e')](_0x4a6e9f[_0xdb57('0x3a')]['fields']));_0x248b67['attributes']=_0x248b67[_0xdb57('0x3d')]['length']?_0x248b67[_0xdb57('0x3d')]:_0x1dc152['model'];_0x248b67[_0xdb57('0x42')]=qs[_0xdb57('0x43')](_0x4a6e9f['query'][_0xdb57('0x43')]);_0x248b67[_0xdb57('0x44')]=qs[_0xdb57('0x3b')](_['pick'](_0x4a6e9f['query'],_0x1dc152['filters']));if(_0x4a6e9f[_0xdb57('0x3a')][_0xdb57('0x2a')]){_0x248b67['where']=_[_0xdb57('0x46')](_0x248b67[_0xdb57('0x44')],{'$or':_[_0xdb57('0x35')](_0x248b67[_0xdb57('0x3d')],function(_0x4f63ad){var _0x65a07c={};_0x65a07c[_0x4f63ad]={'$like':'%'+_0x4a6e9f[_0xdb57('0x3a')][_0xdb57('0x2a')]+'%'};return _0x65a07c;})});}_0x248b67=_[_0xdb57('0x46')]({},_0x248b67,_0x4a6e9f['options']);return _0x4fcb4d[_0xdb57('0x9d')](_0x248b67);}})[_0xdb57('0x25')](function(_0x59781d){if(_0x59781d){_0x1032a6=_0x59781d['length'];if(!_0x4a6e9f['query']['hasOwnProperty'](_0xdb57('0x40'))){_0x248b67[_0xdb57('0x41')]=qs[_0xdb57('0x41')](_0x4a6e9f['query'][_0xdb57('0x41')]);_0x248b67[_0xdb57('0x1e')]=qs['offset'](_0x4a6e9f['query']['offset']);}return _0x4fcb4d[_0xdb57('0x9d')](_0x248b67);}})[_0xdb57('0x25')](function(_0x22b20e){if(_0x22b20e){return _0x22b20e?{'count':_0x1032a6,'rows':_0x22b20e}:null;}})['then'](respondWithResult(_0x19f041,null))[_0xdb57('0x4c')](handleError(_0x19f041,null));};exports[_0xdb57('0x9e')]=function(_0xc882f4,_0xb915b2,_0x5e28ac){var _0x5cde90,_0xe3b259;return db['VoiceQueue'][_0xdb57('0x2f')]({'where':{'id':_0xc882f4['params']['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0xb915b2,null))[_0xdb57('0x25')](function(_0x510ecc){if(_0x510ecc){_0xe3b259=_0x510ecc;return _0x510ecc[_0xdb57('0x9e')](_0xc882f4[_0xdb57('0x52')][_0xdb57('0x95')],_['omit'](_0xc882f4[_0xdb57('0x52')],[_0xdb57('0x95'),'id'])||{});}return null;})[_0xdb57('0x96')](function(_0x2fcc52){var _0x33b483;_0x5cde90=_0x2fcc52||[];var _0x143e00=[];if(_0x2fcc52){for(var _0x188dc0=0x0;_0x188dc0<_0x2fcc52[_0xdb57('0x3f')];_0x188dc0+=0x1){var _0x205e1f=_0x2fcc52[_0x188dc0][_0xdb57('0x54')]({'plain':!![]});_0xe3b259['dialCheckDuplicateType']=_0xc882f4[_0xdb57('0x52')][_0xdb57('0x9f')]?_0xc882f4['body']['dialCheckDuplicateType']:_0xe3b259['dialCheckDuplicateType'];switch(_0xe3b259['dialCheckDuplicateType']){case _0xdb57('0xa0'):_0x33b483=squel['insert']()[_0xdb57('0xa1')](_0xdb57('0xa2'))[_0xdb57('0xa3')](['phone',_0xdb57('0xa4'),_0xdb57('0xa5'),_0xdb57('0xa6'),_0xdb57('0x64'),_0xdb57('0x5c'),_0xdb57('0x5d')],squel[_0xdb57('0x83')]()[_0xdb57('0x84')]('phone','phone')['field'](_0xdb57('0xa7'),_0xdb57('0xa4'))[_0xdb57('0x84')]('id',_0xdb57('0xa5'))[_0xdb57('0x84')](_0x205e1f[_0xdb57('0xa8')]['toString'](),_0xdb57('0xa6'))['field'](_0xc882f4['params']['id'][_0xdb57('0x8c')](),_0xdb57('0x64'))[_0xdb57('0x84')]('NOW()','createdAt')[_0xdb57('0x84')](_0xdb57('0xa7'),'updatedAt')[_0xdb57('0x85')](_0xdb57('0xa9'))[_0xdb57('0x44')](_0xdb57('0xaa'))['where']('ListId\x20=\x20?',_0x205e1f['CmListId'][_0xdb57('0x8c')]())['where'](_0xdb57('0xab'))[_0xdb57('0x44')](_0xdb57('0xac'),squel[_0xdb57('0x83')]()[_0xdb57('0x84')](_0xdb57('0xad'))[_0xdb57('0x85')](_0xdb57('0xae'))[_0xdb57('0x44')](_0xdb57('0xaf'),_0xc882f4[_0xdb57('0x4e')]['id']['toString']()))[_0xdb57('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdb57('0x84')](_0xdb57('0xb0'))['from'](_0xdb57('0xa2'))[_0xdb57('0x44')](_0xdb57('0xaf'),_0xc882f4[_0xdb57('0x4e')]['id'][_0xdb57('0x8c')]())))[_0xdb57('0x8c')]();break;case _0xdb57('0xb1'):_0x33b483=squel[_0xdb57('0xb2')]()[_0xdb57('0xa1')](_0xdb57('0xa2'))[_0xdb57('0xa3')](['phone',_0xdb57('0xa4'),_0xdb57('0xa5'),_0xdb57('0xa6'),'VoiceQueueId',_0xdb57('0x5c'),_0xdb57('0x5d')],squel[_0xdb57('0x83')]()[_0xdb57('0x84')](_0xdb57('0xb3'),'phone')['field'](_0xdb57('0xa7'),_0xdb57('0xa4'))[_0xdb57('0x84')]('id',_0xdb57('0xa5'))['field'](_0x205e1f[_0xdb57('0xa8')][_0xdb57('0x8c')](),_0xdb57('0xa6'))[_0xdb57('0x84')](_0xc882f4[_0xdb57('0x4e')]['id'][_0xdb57('0x8c')](),_0xdb57('0x64'))[_0xdb57('0x84')]('NOW()',_0xdb57('0x5c'))[_0xdb57('0x84')](_0xdb57('0xa7'),_0xdb57('0x5d'))[_0xdb57('0x85')](_0xdb57('0xa9'))['where'](_0xdb57('0xaa'))[_0xdb57('0x44')]('ListId\x20=\x20?',_0x205e1f[_0xdb57('0xa8')]['toString']())[_0xdb57('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xdb57('0x44')](_0xdb57('0xac'),squel[_0xdb57('0x83')]()[_0xdb57('0x84')](_0xdb57('0xb0'))['from'](_0xdb57('0xa2'))[_0xdb57('0x44')](_0xdb57('0xaf'),_0xc882f4[_0xdb57('0x4e')]['id'][_0xdb57('0x8c')]())))[_0xdb57('0x8c')]();break;default:_0x33b483=squel['insert']()[_0xdb57('0xa1')](_0xdb57('0xa2'))[_0xdb57('0xa3')](['phone',_0xdb57('0xa4'),'ContactId','ListId',_0xdb57('0x64'),_0xdb57('0x5c'),_0xdb57('0x5d')],squel['select']()[_0xdb57('0x84')](_0xdb57('0xb3'),'phone')['field'](_0xdb57('0xa7'),_0xdb57('0xa4'))['field']('id','ContactId')[_0xdb57('0x84')](_0x205e1f[_0xdb57('0xa8')][_0xdb57('0x8c')](),_0xdb57('0xa6'))[_0xdb57('0x84')](_0xc882f4[_0xdb57('0x4e')]['id'][_0xdb57('0x8c')](),_0xdb57('0x64'))[_0xdb57('0x84')]('NOW()',_0xdb57('0x5c'))[_0xdb57('0x84')]('NOW()',_0xdb57('0x5d'))[_0xdb57('0x85')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xdb57('0x44')](_0xdb57('0xb4'),_0x205e1f[_0xdb57('0xa8')][_0xdb57('0x8c')]())['where'](_0xdb57('0xab')))[_0xdb57('0x8c')]();}_0x143e00[_0xdb57('0x8b')](db[_0xdb57('0x78')]['query'](_0x33b483));}return BPromise[_0xdb57('0xb5')](_0x143e00);}})[_0xdb57('0x25')](function(){return _0x5cde90;})[_0xdb57('0x25')](respondWithResult(_0xb915b2,null))[_0xdb57('0x4c')](handleError(_0xb915b2,null));};exports[_0xdb57('0xb6')]=function(_0xa5449c,_0x4ba207,_0x18fe53){return db[_0xdb57('0x47')][_0xdb57('0x2f')]({'where':{'id':_0xa5449c[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x4ba207,null))[_0xdb57('0x25')](function(_0x32a8a2){if(_0x32a8a2){return _0x32a8a2[_0xdb57('0xb6')](_0xa5449c[_0xdb57('0x3a')][_0xdb57('0x95')]);}})['then'](function(_0x3e97b5){if(_0x3e97b5){return db[_0xdb57('0x65')][_0xdb57('0x26')]({'where':{'ListId':_0xa5449c[_0xdb57('0x3a')][_0xdb57('0x95')],'VoiceQueueId':_0xa5449c['params']['id']}})[_0xdb57('0x25')](function(){return _0x3e97b5;});}})[_0xdb57('0x25')](respondWithStatusCode(_0x4ba207,null))['catch'](handleError(_0x4ba207,null));};exports['getBlackLists']=function(_0x4902d1,_0xb9037f,_0x42dcdd){var _0x400038={};var _0x416a81={};var _0x52905f;var _0x163957;return db[_0xdb57('0x47')][_0xdb57('0x69')]({'where':{'id':_0x4902d1[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0xb9037f,null))['then'](function(_0x1e6534){if(_0x1e6534){_0x52905f=_0x1e6534;_0x416a81[_0xdb57('0x39')]=_[_0xdb57('0x4f')](db[_0xdb57('0x9c')][_0xdb57('0x36')]);_0x416a81['query']=_[_0xdb57('0x4f')](_0x4902d1['query']);_0x416a81['filters']=_[_0xdb57('0x3c')](_0x416a81[_0xdb57('0x39')],_0x416a81[_0xdb57('0x3a')]);_0x400038[_0xdb57('0x3d')]=_[_0xdb57('0x3c')](_0x416a81[_0xdb57('0x39')],qs[_0xdb57('0x3e')](_0x4902d1['query'][_0xdb57('0x3e')]));_0x400038[_0xdb57('0x3d')]=_0x400038[_0xdb57('0x3d')]['length']?_0x400038[_0xdb57('0x3d')]:_0x416a81[_0xdb57('0x39')];_0x400038[_0xdb57('0x42')]=qs[_0xdb57('0x43')](_0x4902d1[_0xdb57('0x3a')][_0xdb57('0x43')]);_0x400038[_0xdb57('0x44')]=qs['filters'](_[_0xdb57('0x63')](_0x4902d1[_0xdb57('0x3a')],_0x416a81[_0xdb57('0x3b')]));if(_0x4902d1['query'][_0xdb57('0x2a')]){_0x400038['where']=_[_0xdb57('0x46')](_0x400038[_0xdb57('0x44')],{'$or':_['map'](_0x400038['attributes'],function(_0x335eb1){var _0x575539={};_0x575539[_0x335eb1]={'$like':'%'+_0x4902d1['query'][_0xdb57('0x2a')]+'%'};return _0x575539;})});}_0x400038=_[_0xdb57('0x46')]({},_0x400038,_0x4902d1['options']);return _0x52905f[_0xdb57('0xb7')](_0x400038);}})[_0xdb57('0x25')](function(_0x208ba0){if(_0x208ba0){_0x163957=_0x208ba0[_0xdb57('0x3f')];if(!_0x4902d1[_0xdb57('0x3a')][_0xdb57('0x62')](_0xdb57('0x40'))){_0x400038['limit']=qs[_0xdb57('0x41')](_0x4902d1['query'][_0xdb57('0x41')]);_0x400038['offset']=qs[_0xdb57('0x1e')](_0x4902d1['query'][_0xdb57('0x1e')]);}return _0x52905f[_0xdb57('0xb7')](_0x400038);}})[_0xdb57('0x25')](function(_0xc188c0){if(_0xc188c0){return _0xc188c0?{'count':_0x163957,'rows':_0xc188c0}:null;}})[_0xdb57('0x25')](respondWithResult(_0xb9037f,null))['catch'](handleError(_0xb9037f,null));};exports[_0xdb57('0xb8')]=function(_0x7a6ff6,_0x1e4fff,_0x409ada){var _0x335714,_0x401552;return db[_0xdb57('0x47')]['find']({'where':{'id':_0x7a6ff6['params']['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x1e4fff,null))[_0xdb57('0x25')](function(_0xd27940){if(_0xd27940){_0x401552=_0xd27940;return _0xd27940['addBlackLists'](_0x7a6ff6[_0xdb57('0x52')][_0xdb57('0x95')],_[_0xdb57('0x5b')](_0x7a6ff6['body'],[_0xdb57('0x95'),'id'])||{});}return null;})['spread'](function(_0x1d728e){var _0x17bc98;_0x335714=_0x1d728e||[];var _0x476325=[];if(_0x1d728e){for(var _0x48449b=0x0;_0x48449b<_0x1d728e['length'];_0x48449b+=0x1){var _0x5100af=_0x1d728e[_0x48449b][_0xdb57('0x54')]({'plain':!![]});_0x17bc98=squel[_0xdb57('0xb2')]()[_0xdb57('0xa1')](_0xdb57('0xb9'))['fromQuery']([_0xdb57('0xb3'),'ContactId',_0xdb57('0xa6'),_0xdb57('0x64'),_0xdb57('0x5c'),_0xdb57('0x5d')],squel[_0xdb57('0x83')]()[_0xdb57('0x84')](_0xdb57('0xb3'),_0xdb57('0xb3'))[_0xdb57('0x84')]('id',_0xdb57('0xa5'))['field'](_0x5100af[_0xdb57('0xa8')][_0xdb57('0x8c')](),_0xdb57('0xa6'))[_0xdb57('0x84')](_0x7a6ff6['params']['id'][_0xdb57('0x8c')](),'VoiceQueueId')[_0xdb57('0x84')](_0xdb57('0xa7'),_0xdb57('0x5c'))[_0xdb57('0x84')](_0xdb57('0xa7'),_0xdb57('0x5d'))[_0xdb57('0x85')](_0xdb57('0xa9'))[_0xdb57('0x44')]('deletedAt\x20IS\x20NULL')[_0xdb57('0x44')](_0xdb57('0xb4'),_0x5100af[_0xdb57('0xa8')]['toString']())[_0xdb57('0x44')](_0xdb57('0xab')))[_0xdb57('0x8c')]();_0x476325[_0xdb57('0x8b')](db[_0xdb57('0x78')]['query'](_0x17bc98));}return BPromise[_0xdb57('0xb5')](_0x476325);}})['then'](function(){return _0x335714;})[_0xdb57('0x25')](respondWithResult(_0x1e4fff,null))[_0xdb57('0x4c')](handleError(_0x1e4fff,null));};exports[_0xdb57('0xba')]=function(_0x6b49b1,_0x301fc0,_0x319093){return db['VoiceQueue'][_0xdb57('0x2f')]({'where':{'id':_0x6b49b1[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x301fc0,null))[_0xdb57('0x25')](function(_0x3bb495){if(_0x3bb495){return _0x3bb495[_0xdb57('0xba')](_0x6b49b1['query']['ids']);}})[_0xdb57('0x25')](function(_0x1cb562){if(_0x1cb562){return db[_0xdb57('0x6c')][_0xdb57('0x26')]({'where':{'ListId':_0x6b49b1[_0xdb57('0x3a')][_0xdb57('0x95')],'VoiceQueueId':_0x6b49b1[_0xdb57('0x4e')]['id']}})[_0xdb57('0x25')](function(){return _0x1cb562;});}})['then'](respondWithStatusCode(_0x301fc0,null))[_0xdb57('0x4c')](handleError(_0x301fc0,null));};
\ No newline at end of file
index 5b1bcc9..6a6a2bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebd1=['hook','events','../../mysqldb','VoiceQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x385137,_0x50cc99){var _0x3537f5=function(_0x3eced9){while(--_0x3eced9){_0x385137['push'](_0x385137['shift']());}};_0x3537f5(++_0x50cc99);}(_0xebd1,0xa3));var _0x1ebd=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xebd1[_0x5216e0];return _0x5b3f40;};'use strict';var EventEmitter=require(_0x1ebd('0x0'));var VoiceQueue=require(_0x1ebd('0x1'))['db'][_0x1ebd('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ebd('0x3'),'afterUpdate':_0x1ebd('0x4'),'afterDestroy':_0x1ebd('0x5')};function emitEvent(_0x2ebb68){return function(_0xfdfbd7,_0x457683,_0x3956f0){VoiceQueueEvents[_0x1ebd('0x6')](_0x2ebb68+':'+_0xfdfbd7['id'],_0xfdfbd7);VoiceQueueEvents[_0x1ebd('0x6')](_0x2ebb68,_0xfdfbd7);_0x3956f0(null);};}for(var e in events){if(events[_0x1ebd('0x7')](e)){var event=events[e];VoiceQueue[_0x1ebd('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0xa449=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x43244f,_0x1929f2){var _0x856cd7=function(_0x354e49){while(--_0x354e49){_0x43244f['push'](_0x43244f['shift']());}};_0x856cd7(++_0x1929f2);}(_0xa449,0x77));var _0x9a44=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa449[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x9a44('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x9a44('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9a44('0x2')](0x0);var events={'afterCreate':_0x9a44('0x3'),'afterUpdate':_0x9a44('0x4'),'afterDestroy':_0x9a44('0x5')};function emitEvent(_0x8222b8){return function(_0x229c7d,_0x4b3270,_0x487f37){VoiceQueueEvents['emit'](_0x8222b8+':'+_0x229c7d['id'],_0x229c7d);VoiceQueueEvents[_0x9a44('0x6')](_0x8222b8,_0x229c7d);_0x487f37(null);};}for(var e in events){if(events[_0x9a44('0x7')](e)){var event=events[e];VoiceQueue[_0x9a44('0x8')](e,emitEvent(event));}}module[_0x9a44('0x9')]=VoiceQueueEvents;
\ No newline at end of file
index 1068aba..affe684 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88f3=['define','VoiceQueue','voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x10c4e5,_0x56af71){var _0x33005d=function(_0x2dc680){while(--_0x2dc680){_0x10c4e5['push'](_0x10c4e5['shift']());}};_0x33005d(++_0x56af71);}(_0x88f3,0x1f1));var _0x388f=function(_0x46663a,_0x181732){_0x46663a=_0x46663a-0x0;var _0x420a7a=_0x88f3[_0x46663a];return _0x420a7a;};'use strict';var _=require('lodash');var util=require(_0x388f('0x0'));var logger=require(_0x388f('0x1'))(_0x388f('0x2'));var moment=require(_0x388f('0x3'));var BPromise=require(_0x388f('0x4'));var rp=require(_0x388f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x388f('0x6'));var config=require(_0x388f('0x7'));var attributes=require(_0x388f('0x8'));module[_0x388f('0x9')]=function(_0x4295e0,_0x469122){return _0x4295e0[_0x388f('0xa')](_0x388f('0xb'),attributes,{'tableName':_0x388f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb44e=['./voiceQueue.attributes','define','voice_queues','util','../../config/logger','api','moment','path','rimraf'];(function(_0x5afb97,_0x42d4ef){var _0xe497fc=function(_0x36cf69){while(--_0x36cf69){_0x5afb97['push'](_0x5afb97['shift']());}};_0xe497fc(++_0x42d4ef);}(_0xb44e,0x93));var _0xeb44=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xb44e[_0x139a3c];return _0x2b375b;};'use strict';var _=require('lodash');var util=require(_0xeb44('0x0'));var logger=require(_0xeb44('0x1'))(_0xeb44('0x2'));var moment=require(_0xeb44('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb44('0x4'));var rimraf=require(_0xeb44('0x5'));var config=require('../../config/environment');var attributes=require(_0xeb44('0x6'));module['exports']=function(_0x23d265,_0x5986a2){return _0x23d265[_0xeb44('0x7')]('VoiceQueue',attributes,{'tableName':_0xeb44('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3eeb010..07cdef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2e5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','request\x20sent','debug','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','info','result','GetVoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowVoiceQueue','VoiceQueue','find'];(function(_0x1d599a,_0x16eb97){var _0x1951bd=function(_0x1cd3a5){while(--_0x1cd3a5){_0x1d599a['push'](_0x1d599a['shift']());}};_0x1951bd(++_0x16eb97);}(_0xa2e5,0x1ec));var _0x5a2e=function(_0x199044,_0x421a7e){_0x199044=_0x199044-0x0;var _0x27f7ce=_0xa2e5[_0x199044];return _0x27f7ce;};'use strict';var _=require('lodash');var util=require(_0x5a2e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a2e('0x1'));var fs=require('fs');var Redis=require(_0x5a2e('0x2'));var db=require(_0x5a2e('0x3'))['db'];var utils=require(_0x5a2e('0x4'));var logger=require(_0x5a2e('0x5'))(_0x5a2e('0x6'));var config=require(_0x5a2e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5a2e('0x8')][_0x5a2e('0x9')]({'port':0x232a});config[_0x5a2e('0xa')]=_[_0x5a2e('0xb')](config[_0x5a2e('0xa')],{'host':_0x5a2e('0xc'),'port':0x18eb});var socket=require(_0x5a2e('0xd'))(new Redis(config[_0x5a2e('0xa')]));require(_0x5a2e('0xe'))[_0x5a2e('0xf')](socket);function respondWithRpcPromise(_0x43e807,_0x57f32e,_0x2fc671){return new BPromise(function(_0x431fb0,_0xbfa6b9){return client[_0x5a2e('0x10')](_0x43e807,_0x2fc671)[_0x5a2e('0x11')](function(_0x5061cb){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x57f32e,_0x5a2e('0x12'));logger[_0x5a2e('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x57f32e,_0x5a2e('0x12'),JSON[_0x5a2e('0x14')](_0x5061cb));if(_0x5061cb[_0x5a2e('0x15')]){if(_0x5061cb['error'][_0x5a2e('0x16')]===0x1f4){logger[_0x5a2e('0x15')](_0x5a2e('0x17'),_0x57f32e,_0x5061cb['error'][_0x5a2e('0x18')]);return _0xbfa6b9(_0x5061cb[_0x5a2e('0x15')][_0x5a2e('0x18')]);}logger[_0x5a2e('0x15')](_0x5a2e('0x17'),_0x57f32e,_0x5061cb[_0x5a2e('0x15')][_0x5a2e('0x18')]);return _0x431fb0(_0x5061cb[_0x5a2e('0x15')][_0x5a2e('0x18')]);}else{logger[_0x5a2e('0x19')](_0x5a2e('0x17'),_0x57f32e,_0x5a2e('0x12'));_0x431fb0(_0x5061cb[_0x5a2e('0x1a')][_0x5a2e('0x18')]);}})['catch'](function(_0x84778c){logger['error'](_0x5a2e('0x17'),_0x57f32e,_0x84778c);_0xbfa6b9(_0x84778c);});});}exports[_0x5a2e('0x1b')]=function(_0x2cb9c6){var _0x458ae1=this;return new Promise(function(_0xe2fb4f,_0x2f909c){return db['VoiceQueue'][_0x5a2e('0x1c')]({'raw':_0x2cb9c6[_0x5a2e('0x1d')]?_0x2cb9c6[_0x5a2e('0x1d')][_0x5a2e('0x1e')]===undefined?!![]:![]:!![],'where':_0x2cb9c6['options']?_0x2cb9c6[_0x5a2e('0x1d')][_0x5a2e('0x1f')]||null:null,'attributes':_0x2cb9c6[_0x5a2e('0x1d')]?_0x2cb9c6[_0x5a2e('0x1d')][_0x5a2e('0x20')]||null:null,'limit':_0x2cb9c6[_0x5a2e('0x1d')]?_0x2cb9c6[_0x5a2e('0x1d')][_0x5a2e('0x21')]||null:null,'include':_0x2cb9c6[_0x5a2e('0x1d')]?_0x2cb9c6[_0x5a2e('0x1d')]['include']?_[_0x5a2e('0x22')](_0x2cb9c6[_0x5a2e('0x1d')][_0x5a2e('0x23')],function(_0x3909d8){return{'model':db[_0x3909d8[_0x5a2e('0x24')]],'as':_0x3909d8['as'],'attributes':_0x3909d8[_0x5a2e('0x20')],'include':_0x3909d8[_0x5a2e('0x23')]?_[_0x5a2e('0x22')](_0x3909d8[_0x5a2e('0x23')],function(_0x4b4e2b){return{'model':db[_0x4b4e2b['model']],'as':_0x4b4e2b['as'],'attributes':_0x4b4e2b['attributes'],'include':_0x4b4e2b[_0x5a2e('0x23')]?_[_0x5a2e('0x22')](_0x4b4e2b[_0x5a2e('0x23')],function(_0x4b8c86){return{'model':db[_0x4b8c86['model']],'as':_0x4b8c86['as'],'attributes':_0x4b8c86['attributes']};}):[]};}):[]};}):[]:[]})[_0x5a2e('0x11')](function(_0x594d69){logger[_0x5a2e('0x19')]('GetVoiceQueue',_0x2cb9c6);logger[_0x5a2e('0x13')](_0x5a2e('0x1b'),_0x2cb9c6,JSON['stringify'](_0x594d69));_0xe2fb4f(_0x594d69);})[_0x5a2e('0x25')](function(_0x24a536){logger[_0x5a2e('0x15')](_0x5a2e('0x1b'),_0x24a536[_0x5a2e('0x18')],_0x2cb9c6);_0x2f909c(_0x458ae1[_0x5a2e('0x15')](0x1f4,_0x24a536[_0x5a2e('0x18')]));});});};exports[_0x5a2e('0x26')]=function(_0x1f2a13){var _0x59f4f5=this;return new Promise(function(_0x2ca961,_0x24827a){return db[_0x5a2e('0x27')][_0x5a2e('0x28')]({'raw':_0x1f2a13[_0x5a2e('0x1d')]?_0x1f2a13['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f2a13[_0x5a2e('0x1d')]?_0x1f2a13[_0x5a2e('0x1d')][_0x5a2e('0x1f')]||null:null,'attributes':_0x1f2a13['options']?_0x1f2a13[_0x5a2e('0x1d')][_0x5a2e('0x20')]||null:null,'include':_0x1f2a13['options']?_0x1f2a13[_0x5a2e('0x1d')]['include']?_[_0x5a2e('0x22')](_0x1f2a13[_0x5a2e('0x1d')][_0x5a2e('0x23')],function(_0x4d73c9){return{'model':db[_0x4d73c9[_0x5a2e('0x24')]],'as':_0x4d73c9['as'],'attributes':_0x4d73c9['attributes'],'include':_0x4d73c9['include']?_['map'](_0x4d73c9[_0x5a2e('0x23')],function(_0x4a34ba){return{'model':db[_0x4a34ba['model']],'as':_0x4a34ba['as'],'attributes':_0x4a34ba[_0x5a2e('0x20')],'include':_0x4a34ba['include']?_[_0x5a2e('0x22')](_0x4a34ba[_0x5a2e('0x23')],function(_0x401ffe){return{'model':db[_0x401ffe['model']],'as':_0x401ffe['as'],'attributes':_0x401ffe[_0x5a2e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5a2e('0x11')](function(_0x333e38){logger['info']('ShowVoiceQueue',_0x1f2a13);logger[_0x5a2e('0x13')](_0x5a2e('0x26'),_0x1f2a13,JSON[_0x5a2e('0x14')](_0x333e38));_0x2ca961(_0x333e38);})['catch'](function(_0x4f143a){logger[_0x5a2e('0x15')](_0x5a2e('0x26'),_0x4f143a[_0x5a2e('0x18')],_0x1f2a13);_0x24827a(_0x59f4f5[_0x5a2e('0x15')](0x1f4,_0x4f143a[_0x5a2e('0x18')]));});});};
\ No newline at end of file
+var _0xec90=['where','ShowVoiceQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetVoiceQueue','findAll','options','limit','include','map','model','attributes','VoiceQueue','find','raw'];(function(_0x5e2a54,_0x424ad7){var _0x1c8b6b=function(_0x718a9b){while(--_0x718a9b){_0x5e2a54['push'](_0x5e2a54['shift']());}};_0x1c8b6b(++_0x424ad7);}(_0xec90,0x19c));var _0x0ec9=function(_0x5db65f,_0xf89cc8){_0x5db65f=_0x5db65f-0x0;var _0x34fb4b=_0xec90[_0x5db65f];return _0x34fb4b;};'use strict';var _=require(_0x0ec9('0x0'));var util=require(_0x0ec9('0x1'));var moment=require('moment');var BPromise=require(_0x0ec9('0x2'));var rs=require(_0x0ec9('0x3'));var fs=require('fs');var Redis=require(_0x0ec9('0x4'));var db=require(_0x0ec9('0x5'))['db'];var utils=require(_0x0ec9('0x6'));var logger=require(_0x0ec9('0x7'))(_0x0ec9('0x8'));var config=require(_0x0ec9('0x9'));var jayson=require(_0x0ec9('0xa'));var client=jayson[_0x0ec9('0xb')][_0x0ec9('0xc')]({'port':0x232a});config[_0x0ec9('0xd')]=_['defaults'](config[_0x0ec9('0xd')],{'host':_0x0ec9('0xe'),'port':0x18eb});var socket=require(_0x0ec9('0xf'))(new Redis(config[_0x0ec9('0xd')]));require(_0x0ec9('0x10'))[_0x0ec9('0x11')](socket);function respondWithRpcPromise(_0x1fa591,_0x3d3553,_0x1d025f){return new BPromise(function(_0x350a2f,_0xfd3ffa){return client['request'](_0x1fa591,_0x1d025f)[_0x0ec9('0x12')](function(_0xd25438){logger['info'](_0x0ec9('0x13'),_0x3d3553,_0x0ec9('0x14'));logger[_0x0ec9('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3d3553,'request\x20sent',JSON[_0x0ec9('0x16')](_0xd25438));if(_0xd25438[_0x0ec9('0x17')]){if(_0xd25438[_0x0ec9('0x17')][_0x0ec9('0x18')]===0x1f4){logger['error'](_0x0ec9('0x13'),_0x3d3553,_0xd25438['error'][_0x0ec9('0x19')]);return _0xfd3ffa(_0xd25438['error'][_0x0ec9('0x19')]);}logger[_0x0ec9('0x17')](_0x0ec9('0x13'),_0x3d3553,_0xd25438['error'][_0x0ec9('0x19')]);return _0x350a2f(_0xd25438[_0x0ec9('0x17')][_0x0ec9('0x19')]);}else{logger[_0x0ec9('0x1a')](_0x0ec9('0x13'),_0x3d3553,_0x0ec9('0x14'));_0x350a2f(_0xd25438['result'][_0x0ec9('0x19')]);}})[_0x0ec9('0x1b')](function(_0x11e60f){logger[_0x0ec9('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x3d3553,_0x11e60f);_0xfd3ffa(_0x11e60f);});});}exports[_0x0ec9('0x1c')]=function(_0x1acd72){var _0x34ca0d=this;return new Promise(function(_0xfad2bc,_0x2a711f){return db['VoiceQueue'][_0x0ec9('0x1d')]({'raw':_0x1acd72[_0x0ec9('0x1e')]?_0x1acd72[_0x0ec9('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1acd72[_0x0ec9('0x1e')]?_0x1acd72[_0x0ec9('0x1e')]['where']||null:null,'attributes':_0x1acd72['options']?_0x1acd72[_0x0ec9('0x1e')]['attributes']||null:null,'limit':_0x1acd72[_0x0ec9('0x1e')]?_0x1acd72[_0x0ec9('0x1e')][_0x0ec9('0x1f')]||null:null,'include':_0x1acd72['options']?_0x1acd72[_0x0ec9('0x1e')][_0x0ec9('0x20')]?_['map'](_0x1acd72['options'][_0x0ec9('0x20')],function(_0x50fb2c){return{'model':db[_0x50fb2c['model']],'as':_0x50fb2c['as'],'attributes':_0x50fb2c['attributes'],'include':_0x50fb2c[_0x0ec9('0x20')]?_[_0x0ec9('0x21')](_0x50fb2c[_0x0ec9('0x20')],function(_0x291b7b){return{'model':db[_0x291b7b[_0x0ec9('0x22')]],'as':_0x291b7b['as'],'attributes':_0x291b7b[_0x0ec9('0x23')],'include':_0x291b7b['include']?_[_0x0ec9('0x21')](_0x291b7b[_0x0ec9('0x20')],function(_0x4ad686){return{'model':db[_0x4ad686['model']],'as':_0x4ad686['as'],'attributes':_0x4ad686[_0x0ec9('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0ec9('0x12')](function(_0x2697cf){logger[_0x0ec9('0x1a')]('GetVoiceQueue',_0x1acd72);logger['debug'](_0x0ec9('0x1c'),_0x1acd72,JSON[_0x0ec9('0x16')](_0x2697cf));_0xfad2bc(_0x2697cf);})[_0x0ec9('0x1b')](function(_0xdc438e){logger[_0x0ec9('0x17')](_0x0ec9('0x1c'),_0xdc438e[_0x0ec9('0x19')],_0x1acd72);_0x2a711f(_0x34ca0d['error'](0x1f4,_0xdc438e[_0x0ec9('0x19')]));});});};exports['ShowVoiceQueue']=function(_0x5a0ef4){var _0x1c142b=this;return new Promise(function(_0x1ed10c,_0xc6855a){return db[_0x0ec9('0x24')][_0x0ec9('0x25')]({'raw':_0x5a0ef4['options']?_0x5a0ef4[_0x0ec9('0x1e')][_0x0ec9('0x26')]===undefined?!![]:![]:!![],'where':_0x5a0ef4[_0x0ec9('0x1e')]?_0x5a0ef4['options'][_0x0ec9('0x27')]||null:null,'attributes':_0x5a0ef4[_0x0ec9('0x1e')]?_0x5a0ef4[_0x0ec9('0x1e')][_0x0ec9('0x23')]||null:null,'include':_0x5a0ef4[_0x0ec9('0x1e')]?_0x5a0ef4[_0x0ec9('0x1e')]['include']?_[_0x0ec9('0x21')](_0x5a0ef4[_0x0ec9('0x1e')]['include'],function(_0x19a0ed){return{'model':db[_0x19a0ed[_0x0ec9('0x22')]],'as':_0x19a0ed['as'],'attributes':_0x19a0ed[_0x0ec9('0x23')],'include':_0x19a0ed[_0x0ec9('0x20')]?_[_0x0ec9('0x21')](_0x19a0ed['include'],function(_0xd7ece4){return{'model':db[_0xd7ece4[_0x0ec9('0x22')]],'as':_0xd7ece4['as'],'attributes':_0xd7ece4[_0x0ec9('0x23')],'include':_0xd7ece4[_0x0ec9('0x20')]?_[_0x0ec9('0x21')](_0xd7ece4['include'],function(_0x110ef6){return{'model':db[_0x110ef6[_0x0ec9('0x22')]],'as':_0x110ef6['as'],'attributes':_0x110ef6[_0x0ec9('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12f780){logger['info'](_0x0ec9('0x28'),_0x5a0ef4);logger[_0x0ec9('0x15')](_0x0ec9('0x28'),_0x5a0ef4,JSON[_0x0ec9('0x16')](_0x12f780));_0x1ed10c(_0x12f780);})[_0x0ec9('0x1b')](function(_0x39ac6f){logger['error']('ShowVoiceQueue',_0x39ac6f[_0x0ec9('0x19')],_0x5a0ef4);_0xc6855a(_0x1c142b['error'](0x1f4,_0x39ac6f[_0x0ec9('0x19')]));});});};
\ No newline at end of file
index 637856c..9985305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1295=['emit','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x51a253,_0x4e1a99){var _0x5b0e64=function(_0x478ff2){while(--_0x478ff2){_0x51a253['push'](_0x51a253['shift']());}};_0x5b0e64(++_0x4e1a99);}(_0x1295,0x154));var _0x5129=function(_0x5e987b,_0x5838c1){_0x5e987b=_0x5e987b-0x0;var _0x1896fe=_0x1295[_0x5e987b];return _0x1896fe;};'use strict';var VoiceQueueEvents=require(_0x5129('0x0'));var events=[_0x5129('0x1'),_0x5129('0x2'),'update'];function createListener(_0x51a159,_0x49af80){return function(_0x1b3560){_0x49af80[_0x5129('0x3')](_0x51a159,_0x1b3560);};}function removeListener(_0x15c673,_0x4d307c){return function(){VoiceQueueEvents['removeListener'](_0x15c673,_0x4d307c);};}exports[_0x5129('0x4')]=function(_0xba256d){for(var _0x5a7d5b=0x0,_0x57f38e=events[_0x5129('0x5')];_0x5a7d5b<_0x57f38e;_0x5a7d5b++){var _0x32d6d5=events[_0x5a7d5b];var _0xbec8c5=createListener(_0x5129('0x6')+_0x32d6d5,_0xba256d);VoiceQueueEvents['on'](_0x32d6d5,_0xbec8c5);}};
\ No newline at end of file
+var _0x7473=['removeListener','register','voiceQueue:','save','remove','update','emit'];(function(_0x14bee3,_0x1fcfb9){var _0x3e9bcc=function(_0x2910b1){while(--_0x2910b1){_0x14bee3['push'](_0x14bee3['shift']());}};_0x3e9bcc(++_0x1fcfb9);}(_0x7473,0xce));var _0x3747=function(_0x4dabd6,_0x488af6){_0x4dabd6=_0x4dabd6-0x0;var _0x2d7ef5=_0x7473[_0x4dabd6];return _0x2d7ef5;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x3747('0x0'),_0x3747('0x1'),_0x3747('0x2')];function createListener(_0x281c34,_0x5e7d10){return function(_0x3c4403){_0x5e7d10[_0x3747('0x3')](_0x281c34,_0x3c4403);};}function removeListener(_0x18ba98,_0x4268d9){return function(){VoiceQueueEvents[_0x3747('0x4')](_0x18ba98,_0x4268d9);};}exports[_0x3747('0x5')]=function(_0x182da1){for(var _0x23e123=0x0,_0xe543e6=events['length'];_0x23e123<_0xe543e6;_0x23e123++){var _0x1d989a=events[_0x23e123];var _0x3cfe1e=createListener(_0x3747('0x6')+_0x1d989a,_0x182da1);VoiceQueueEvents['on'](_0x1d989a,_0x3cfe1e);}};
\ No newline at end of file
index 04c967e..1fd51d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe61c=['multer','path','connect-timeout','express','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','/:id','post','put','update','exports'];(function(_0x2fc2e9,_0x531729){var _0x12247f=function(_0x1e35e0){while(--_0x1e35e0){_0x2fc2e9['push'](_0x2fc2e9['shift']());}};_0x12247f(++_0x531729);}(_0xe61c,0xee));var _0xce61=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xe61c[_0x31a576];return _0x30b1d3;};'use strict';var multer=require(_0xce61('0x0'));var util=require('util');var path=require(_0xce61('0x1'));var timeout=require(_0xce61('0x2'));var express=require(_0xce61('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xce61('0x4'));var config=require('../../config/environment');var controller=require(_0xce61('0x5'));router[_0xce61('0x6')]('/',auth[_0xce61('0x7')](),controller[_0xce61('0x8')]);router[_0xce61('0x6')](_0xce61('0x9'),auth[_0xce61('0x7')](),controller['describe']);router[_0xce61('0x6')](_0xce61('0xa'),auth[_0xce61('0x7')](),controller[_0xce61('0xb')]);router[_0xce61('0x6')](_0xce61('0xc'),auth[_0xce61('0x7')](),controller['show']);router[_0xce61('0xd')]('/',auth[_0xce61('0x7')](),controller['create']);router[_0xce61('0xe')](_0xce61('0xc'),auth['isAuthenticated'](),controller[_0xce61('0xf')]);router['delete'](_0xce61('0xc'),auth[_0xce61('0x7')](),controller['destroy']);module[_0xce61('0x10')]=router;
\ No newline at end of file
+var _0x4819=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','isAuthenticated','describe','/index','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0x4819,0xcd));var _0x9481=function(_0x204a28,_0x359c57){_0x204a28=_0x204a28-0x0;var _0x2d8e3d=_0x4819[_0x204a28];return _0x2d8e3d;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/',auth['isAuthenticated'](),controller[_0x9481('0xa')]);router['get']('/describe',auth[_0x9481('0xb')](),controller[_0x9481('0xc')]);router[_0x9481('0x9')](_0x9481('0xd'),auth[_0x9481('0xb')](),controller['getVoiceQueuesReport']);router[_0x9481('0x9')]('/:id',auth[_0x9481('0xb')](),controller['show']);router[_0x9481('0xe')]('/',auth[_0x9481('0xb')](),controller[_0x9481('0xf')]);router[_0x9481('0x10')](_0x9481('0x11'),auth[_0x9481('0xb')](),controller[_0x9481('0x12')]);router[_0x9481('0x13')](_0x9481('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x9481('0x14')]=router;
\ No newline at end of file
index 389fc6c..e738ec1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a6=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x5a176f,_0x463a3b){var _0x120fc8=function(_0x17e1e4){while(--_0x17e1e4){_0x5a176f['push'](_0x5a176f['shift']());}};_0x120fc8(++_0x463a3b);}(_0x23a6,0x12d));var _0x623a=function(_0x2678c0,_0x2b14de){_0x2678c0=_0x2678c0-0x0;var _0x51c716=_0x23a6[_0x2678c0];return _0x51c716;};'use strict';var Sequelize=require(_0x623a('0x0'));var moment=require(_0x623a('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x623a('0x2')]},'queue':{'type':Sequelize[_0x623a('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x623a('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x19be49){var _0xb0bb49=moment(_0x19be49);var _0x2c17bc=moment(this[_0x623a('0x4')](_0x623a('0x5')))['format'](_0x623a('0x6'));var _0x5d1eff=_0xb0bb49[_0x623a('0x7')](_0x2c17bc,_0x623a('0x8'));this[_0x623a('0x9')](_0x623a('0xa'),_0x19be49);this[_0x623a('0x9')](_0x623a('0xb'),_0x5d1eff||null);}},'position':{'type':Sequelize[_0x623a('0xc')]},'count':{'type':Sequelize[_0x623a('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x623a('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x623a('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x623a('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x623a('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x623a('0xc')]},'channel':{'type':Sequelize[_0x623a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x623a('0x2')]},'connectedlinename':{'type':Sequelize[_0x623a('0x2')]},'accountcode':{'type':Sequelize[_0x623a('0x2')]},'context':{'type':Sequelize[_0x623a('0x2')]},'exten':{'type':Sequelize[_0x623a('0x2')]},'priority':{'type':Sequelize[_0x623a('0x2')]},'holdtime':{'type':Sequelize[_0x623a('0xc')]},'mohtime':{'type':Sequelize[_0x623a('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x623a('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x623a('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x623a('0xe')},'transferexten':{'type':Sequelize[_0x623a('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x623a('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa833=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xa833,0x139));var _0x3a83=function(_0xef243c,_0xcab725){_0xef243c=_0xef243c-0x0;var _0x76a8d7=_0xa833[_0xef243c];return _0x76a8d7;};'use strict';var Sequelize=require(_0x3a83('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x3a83('0x1')]},'uniqueid':{'type':Sequelize[_0x3a83('0x1')]},'calleridnum':{'type':Sequelize[_0x3a83('0x1')]},'calleridname':{'type':Sequelize[_0x3a83('0x1')]},'queue':{'type':Sequelize[_0x3a83('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x3a83('0x2')],'set':function(_0x492929){var _0x18176e=moment(_0x492929);var _0x1a5b41=moment(this['getDataValue']('queuecallerjoinAt'))['format'](_0x3a83('0x3'));var _0x49c9e2=_0x18176e[_0x3a83('0x4')](_0x1a5b41,_0x3a83('0x5'));this[_0x3a83('0x6')](_0x3a83('0x7'),_0x492929);this[_0x3a83('0x6')](_0x3a83('0x8'),_0x49c9e2||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x3a83('0x9')]},'queuecallerabandon':{'type':Sequelize[_0x3a83('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3a83('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x3a83('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3a83('0x2')]},'queuecallerexit':{'type':Sequelize[_0x3a83('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3a83('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x3a83('0x1')],'comment':_0x3a83('0xb')},'originalposition':{'type':Sequelize[_0x3a83('0x9')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x3a83('0x1')]},'connectedlinename':{'type':Sequelize[_0x3a83('0x1')]},'accountcode':{'type':Sequelize[_0x3a83('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3a83('0x1')]},'priority':{'type':Sequelize[_0x3a83('0x1')]},'holdtime':{'type':Sequelize[_0x3a83('0x9')]},'mohtime':{'type':Sequelize[_0x3a83('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3a83('0x1')]},'transfer':{'type':Sequelize[_0x3a83('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3a83('0x1')],'comment':_0x3a83('0xc')},'transferexten':{'type':Sequelize[_0x3a83('0x1')]},'transferuniqueid':{'type':Sequelize[_0x3a83('0x1')]},'disposition':{'type':Sequelize[_0x3a83('0x1')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 183a947..017d5ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','VoiceQueueReport','count','include','catch','show','params','keys','length','includeAll','find','create','body','describe','getVoiceQueuesReport','fields','limit','rows','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x2b4e94,_0x2233dd){_0x2233dd=_0x2233dd||0xcc;return function(_0x24b5bb){if(_0x24b5bb){return _0x2b4e94[_0x7995('0x1e')](_0x2233dd);}return _0x2b4e94[_0x7995('0x1f')](_0x2233dd)[_0x7995('0x20')]();};}function respondWithResult(_0x2202ce,_0x41cbf0){_0x41cbf0=_0x41cbf0||0xc8;return function(_0x5377e5){if(_0x5377e5){return _0x2202ce[_0x7995('0x1f')](_0x41cbf0)['json'](_0x5377e5);}};}function respondWithFilteredResult(_0x2f832e,_0x37f297){return function(_0x43d4b8){if(_0x43d4b8){var _0x291317=_0x43d4b8['count'],_0x1e1415=_0x37f297[_0x7995('0x21')],_0x37a7d4=_0x37f297['offset']+_0x37f297['limit'],_0x4faa60;if(_0x37a7d4>=_0x291317){_0x37a7d4=_0x291317;_0x4faa60=0xc8;}else{_0x4faa60=0xce;}_0x2f832e[_0x7995('0x1f')](_0x4faa60);return _0x2f832e[_0x7995('0x22')]('Content-Range',_0x1e1415+'-'+_0x37a7d4+'/'+_0x291317)[_0x7995('0x23')](_0x43d4b8);}return null;};}function patchUpdates(_0x51f276){return function(_0x4b1a8e){try{jsonpatch[_0x7995('0x24')](_0x4b1a8e,_0x51f276,!![]);}catch(_0x327b1f){return BPromise[_0x7995('0x25')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x26')]();};}function saveUpdates(_0x460924,_0x1c278a){return function(_0x5d40ae){if(_0x5d40ae){return _0x5d40ae[_0x7995('0x27')](_0x460924)[_0x7995('0x28')](function(_0x204507){return _0x204507;});}return null;};}function removeEntity(_0x285437,_0x563799){return function(_0x13bc35){if(_0x13bc35){return _0x13bc35[_0x7995('0x29')]()[_0x7995('0x28')](function(){_0x285437['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1e')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x2a')]);if(_0x47625f[_0x7995('0x2b')]){delete _0x47625f[_0x7995('0x2b')];}_0x2a307e[_0x7995('0x1f')](_0x56691a)[_0x7995('0x2c')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['VoiceQueueReport'][_0x7995('0x2d')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2e')],'type':_0xe6b0b3[_0x7995('0x2f')][_0x7995('0x30')]};});_0x3250e0[_0x7995('0x31')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x32')]=_['keys'](_0x9b2a15[_0x7995('0x32')]);_0x3250e0[_0x7995('0x33')]=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]);_0x456a28['attributes']=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x35')]=_0x456a28[_0x7995('0x35')]['length']?_0x456a28[_0x7995('0x35')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x32')][_0x7995('0x36')](_0x7995('0x37'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x32')]['limit']);_0x456a28['offset']=qs[_0x7995('0x21')](_0x9b2a15[_0x7995('0x32')]['offset']);}_0x456a28[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x9b2a15[_0x7995('0x32')][_0x7995('0x39')]);_0x456a28[_0x7995('0x3a')]=qs['filters'](_[_0x7995('0x3b')](_0x9b2a15[_0x7995('0x32')],_0x3250e0[_0x7995('0x33')]),_0x574574);if(_0x9b2a15[_0x7995('0x32')]['filter']){_0x456a28[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x456a28[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2f')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2b')]]={'$like':'%'+_0x9b2a15[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3c')]({},_0x456a28,_0x9b2a15[_0x7995('0x3f')]);var _0x14d638={'where':_0x456a28[_0x7995('0x3a')]};return db[_0x7995('0x40')][_0x7995('0x41')](_0x14d638)[_0x7995('0x28')](function(_0x270d52){_0x4253e5[_0x7995('0x41')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x42')]=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x43')](handleError(_0x514445,null));};exports[_0x7995('0x44')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':![],'where':{'id':_0x35c8ff[_0x7995('0x45')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x40')][_0x7995('0x2d')]);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x46')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x33')]=_[_0x7995('0x34')](_0x5e85b9[_0x7995('0x31')],_0x5e85b9[_0x7995('0x32')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x31')],qs['fields'](_0x35c8ff[_0x7995('0x32')]['fields']));_0x46ac4f[_0x7995('0x35')]=_0x46ac4f['attributes'][_0x7995('0x47')]?_0x46ac4f[_0x7995('0x35')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x32')][_0x7995('0x48')]){_0x46ac4f[_0x7995('0x42')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3c')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x40')][_0x7995('0x49')](_0x46ac4f)[_0x7995('0x28')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x43')](handleError(_0x576b96,null));};exports[_0x7995('0x4a')]=function(_0x511567,_0x3d8ae3){return db[_0x7995('0x40')]['create'](_0x511567[_0x7995('0x4b')],{})[_0x7995('0x28')](respondWithResult(_0x3d8ae3,0xc9))['catch'](handleError(_0x3d8ae3,null));};exports[_0x7995('0x27')]=function(_0x5843ba,_0x1d87f9){if(_0x5843ba[_0x7995('0x4b')]['id']){delete _0x5843ba[_0x7995('0x4b')]['id'];}return db[_0x7995('0x40')][_0x7995('0x49')]({'where':{'id':_0x5843ba[_0x7995('0x45')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x1d87f9,null))['then'](saveUpdates(_0x5843ba[_0x7995('0x4b')],null))[_0x7995('0x28')](respondWithResult(_0x1d87f9,null))[_0x7995('0x43')](handleError(_0x1d87f9,null));};exports['destroy']=function(_0x19da63,_0x1fe77e){return db[_0x7995('0x40')]['find']({'where':{'id':_0x19da63['params']['id']}})['then'](handleEntityNotFound(_0x1fe77e,null))[_0x7995('0x28')](removeEntity(_0x1fe77e,null))[_0x7995('0x43')](handleError(_0x1fe77e,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x28')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x4d')]=function(_0x4ab09f,_0x14fe7f){var _0x33c801={},_0x206d2a={},_0x50c7b5={'count':0x0,'rows':[]};_0x206d2a['model']=_['keys'](db['VoiceQueueReport'][_0x7995('0x2d')]);_0x206d2a[_0x7995('0x32')]=_[_0x7995('0x46')](_0x4ab09f[_0x7995('0x32')]);_0x206d2a[_0x7995('0x33')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],_0x206d2a[_0x7995('0x32')]);_0x33c801[_0x7995('0x35')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],qs[_0x7995('0x4e')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x4e')]));_0x33c801[_0x7995('0x35')]=_0x33c801[_0x7995('0x35')][_0x7995('0x47')]?_0x33c801[_0x7995('0x35')]:_0x206d2a[_0x7995('0x31')];if(!_0x4ab09f['query'][_0x7995('0x36')](_0x7995('0x37'))){_0x33c801[_0x7995('0x4f')]=qs[_0x7995('0x4f')](_0x4ab09f['query']['limit']);_0x33c801[_0x7995('0x21')]=qs[_0x7995('0x21')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x21')]);}_0x33c801['order']=qs[_0x7995('0x39')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x39')]);_0x33c801[_0x7995('0x3a')]=qs['filters'](_['pick'](_0x4ab09f[_0x7995('0x32')],_0x206d2a[_0x7995('0x33')]));if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]){_0x33c801[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x33c801[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x33c801[_0x7995('0x35')],function(_0x50caf5){var _0x18f230={};_0x18f230[_0x50caf5]={'$like':'%'+_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x18f230;})});}_0x33c801=_[_0x7995('0x3c')]({},_0x33c801,_0x4ab09f['options']);var _0x51bf6a={'where':_0x33c801[_0x7995('0x3a')]};return db[_0x7995('0x40')]['count'](_0x51bf6a)[_0x7995('0x28')](function(_0x375fc9){_0x50c7b5[_0x7995('0x41')]=_0x375fc9;if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x48')]){_0x33c801['include']=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x33c801);})[_0x7995('0x28')](function(_0xe31dcb){_0x50c7b5[_0x7995('0x50')]=_0xe31dcb;return _0x50c7b5;})[_0x7995('0x28')](respondWithFilteredResult(_0x14fe7f,_0x33c801,_0x7995('0x4d')))[_0x7995('0x43')](handleError(_0x14fe7f,null,_0x7995('0x4d')));};
\ No newline at end of file
+var _0x9957=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','VoiceQueueReport','count','include','catch','show','params','keys','length','includeAll','find','create','body','describe','getVoiceQueuesReport','fields','limit','rows','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x2b4e94,_0x2233dd){_0x2233dd=_0x2233dd||0xcc;return function(_0x24b5bb){if(_0x24b5bb){return _0x2b4e94[_0x7995('0x1e')](_0x2233dd);}return _0x2b4e94[_0x7995('0x1f')](_0x2233dd)[_0x7995('0x20')]();};}function respondWithResult(_0x2202ce,_0x41cbf0){_0x41cbf0=_0x41cbf0||0xc8;return function(_0x5377e5){if(_0x5377e5){return _0x2202ce[_0x7995('0x1f')](_0x41cbf0)['json'](_0x5377e5);}};}function respondWithFilteredResult(_0x2f832e,_0x37f297){return function(_0x43d4b8){if(_0x43d4b8){var _0x291317=_0x43d4b8['count'],_0x1e1415=_0x37f297[_0x7995('0x21')],_0x37a7d4=_0x37f297['offset']+_0x37f297['limit'],_0x4faa60;if(_0x37a7d4>=_0x291317){_0x37a7d4=_0x291317;_0x4faa60=0xc8;}else{_0x4faa60=0xce;}_0x2f832e[_0x7995('0x1f')](_0x4faa60);return _0x2f832e[_0x7995('0x22')]('Content-Range',_0x1e1415+'-'+_0x37a7d4+'/'+_0x291317)[_0x7995('0x23')](_0x43d4b8);}return null;};}function patchUpdates(_0x51f276){return function(_0x4b1a8e){try{jsonpatch[_0x7995('0x24')](_0x4b1a8e,_0x51f276,!![]);}catch(_0x327b1f){return BPromise[_0x7995('0x25')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x26')]();};}function saveUpdates(_0x460924,_0x1c278a){return function(_0x5d40ae){if(_0x5d40ae){return _0x5d40ae[_0x7995('0x27')](_0x460924)[_0x7995('0x28')](function(_0x204507){return _0x204507;});}return null;};}function removeEntity(_0x285437,_0x563799){return function(_0x13bc35){if(_0x13bc35){return _0x13bc35[_0x7995('0x29')]()[_0x7995('0x28')](function(){_0x285437['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1e')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x2a')]);if(_0x47625f[_0x7995('0x2b')]){delete _0x47625f[_0x7995('0x2b')];}_0x2a307e[_0x7995('0x1f')](_0x56691a)[_0x7995('0x2c')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['VoiceQueueReport'][_0x7995('0x2d')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2e')],'type':_0xe6b0b3[_0x7995('0x2f')][_0x7995('0x30')]};});_0x3250e0[_0x7995('0x31')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x32')]=_['keys'](_0x9b2a15[_0x7995('0x32')]);_0x3250e0[_0x7995('0x33')]=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]);_0x456a28['attributes']=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x35')]=_0x456a28[_0x7995('0x35')]['length']?_0x456a28[_0x7995('0x35')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x32')][_0x7995('0x36')](_0x7995('0x37'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x32')]['limit']);_0x456a28['offset']=qs[_0x7995('0x21')](_0x9b2a15[_0x7995('0x32')]['offset']);}_0x456a28[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x9b2a15[_0x7995('0x32')][_0x7995('0x39')]);_0x456a28[_0x7995('0x3a')]=qs['filters'](_[_0x7995('0x3b')](_0x9b2a15[_0x7995('0x32')],_0x3250e0[_0x7995('0x33')]),_0x574574);if(_0x9b2a15[_0x7995('0x32')]['filter']){_0x456a28[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x456a28[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2f')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2b')]]={'$like':'%'+_0x9b2a15[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3c')]({},_0x456a28,_0x9b2a15[_0x7995('0x3f')]);var _0x14d638={'where':_0x456a28[_0x7995('0x3a')]};return db[_0x7995('0x40')][_0x7995('0x41')](_0x14d638)[_0x7995('0x28')](function(_0x270d52){_0x4253e5[_0x7995('0x41')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x42')]=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x43')](handleError(_0x514445,null));};exports[_0x7995('0x44')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':![],'where':{'id':_0x35c8ff[_0x7995('0x45')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x40')][_0x7995('0x2d')]);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x46')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x33')]=_[_0x7995('0x34')](_0x5e85b9[_0x7995('0x31')],_0x5e85b9[_0x7995('0x32')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x31')],qs['fields'](_0x35c8ff[_0x7995('0x32')]['fields']));_0x46ac4f[_0x7995('0x35')]=_0x46ac4f['attributes'][_0x7995('0x47')]?_0x46ac4f[_0x7995('0x35')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x32')][_0x7995('0x48')]){_0x46ac4f[_0x7995('0x42')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3c')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x40')][_0x7995('0x49')](_0x46ac4f)[_0x7995('0x28')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x43')](handleError(_0x576b96,null));};exports[_0x7995('0x4a')]=function(_0x511567,_0x3d8ae3){return db[_0x7995('0x40')]['create'](_0x511567[_0x7995('0x4b')],{})[_0x7995('0x28')](respondWithResult(_0x3d8ae3,0xc9))['catch'](handleError(_0x3d8ae3,null));};exports[_0x7995('0x27')]=function(_0x5843ba,_0x1d87f9){if(_0x5843ba[_0x7995('0x4b')]['id']){delete _0x5843ba[_0x7995('0x4b')]['id'];}return db[_0x7995('0x40')][_0x7995('0x49')]({'where':{'id':_0x5843ba[_0x7995('0x45')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x1d87f9,null))['then'](saveUpdates(_0x5843ba[_0x7995('0x4b')],null))[_0x7995('0x28')](respondWithResult(_0x1d87f9,null))[_0x7995('0x43')](handleError(_0x1d87f9,null));};exports['destroy']=function(_0x19da63,_0x1fe77e){return db[_0x7995('0x40')]['find']({'where':{'id':_0x19da63['params']['id']}})['then'](handleEntityNotFound(_0x1fe77e,null))[_0x7995('0x28')](removeEntity(_0x1fe77e,null))[_0x7995('0x43')](handleError(_0x1fe77e,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x28')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x4d')]=function(_0x4ab09f,_0x14fe7f){var _0x33c801={},_0x206d2a={},_0x50c7b5={'count':0x0,'rows':[]};_0x206d2a['model']=_['keys'](db['VoiceQueueReport'][_0x7995('0x2d')]);_0x206d2a[_0x7995('0x32')]=_[_0x7995('0x46')](_0x4ab09f[_0x7995('0x32')]);_0x206d2a[_0x7995('0x33')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],_0x206d2a[_0x7995('0x32')]);_0x33c801[_0x7995('0x35')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],qs[_0x7995('0x4e')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x4e')]));_0x33c801[_0x7995('0x35')]=_0x33c801[_0x7995('0x35')][_0x7995('0x47')]?_0x33c801[_0x7995('0x35')]:_0x206d2a[_0x7995('0x31')];if(!_0x4ab09f['query'][_0x7995('0x36')](_0x7995('0x37'))){_0x33c801[_0x7995('0x4f')]=qs[_0x7995('0x4f')](_0x4ab09f['query']['limit']);_0x33c801[_0x7995('0x21')]=qs[_0x7995('0x21')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x21')]);}_0x33c801['order']=qs[_0x7995('0x39')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x39')]);_0x33c801[_0x7995('0x3a')]=qs['filters'](_['pick'](_0x4ab09f[_0x7995('0x32')],_0x206d2a[_0x7995('0x33')]));if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]){_0x33c801[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x33c801[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x33c801[_0x7995('0x35')],function(_0x50caf5){var _0x18f230={};_0x18f230[_0x50caf5]={'$like':'%'+_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x18f230;})});}_0x33c801=_[_0x7995('0x3c')]({},_0x33c801,_0x4ab09f['options']);var _0x51bf6a={'where':_0x33c801[_0x7995('0x3a')]};return db[_0x7995('0x40')]['count'](_0x51bf6a)[_0x7995('0x28')](function(_0x375fc9){_0x50c7b5[_0x7995('0x41')]=_0x375fc9;if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x48')]){_0x33c801['include']=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x33c801);})[_0x7995('0x28')](function(_0xe31dcb){_0x50c7b5[_0x7995('0x50')]=_0xe31dcb;return _0x50c7b5;})[_0x7995('0x28')](respondWithFilteredResult(_0x14fe7f,_0x33c801,_0x7995('0x4d')))[_0x7995('0x43')](handleError(_0x14fe7f,null,_0x7995('0x4d')));};
\ No newline at end of file
index af71e1b..964cb17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c14=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','VoiceQueueReport'];(function(_0x5cb99e,_0x14fb93){var _0x72ac9c=function(_0x259027){while(--_0x259027){_0x5cb99e['push'](_0x5cb99e['shift']());}};_0x72ac9c(++_0x14fb93);}(_0x4c14,0xde));var _0x44c1=function(_0x4b4d06,_0x4666f4){_0x4b4d06=_0x4b4d06-0x0;var _0x5c541a=_0x4c14[_0x4b4d06];return _0x5c541a;};'use strict';var EventEmitter=require(_0x44c1('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x44c1('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x44c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x44c1('0x3'),'afterDestroy':_0x44c1('0x4')};function emitEvent(_0x2b631d){return function(_0x23404e,_0x37bb22,_0x283745){VoiceQueueReportEvents[_0x44c1('0x5')](_0x2b631d+':'+_0x23404e['id'],_0x23404e);VoiceQueueReportEvents[_0x44c1('0x5')](_0x2b631d,_0x23404e);_0x283745(null);};}for(var e in events){if(events[_0x44c1('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x44c1('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x97d3=['hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x228890,_0x16ba2f){var _0x3b7475=function(_0x5a5ad4){while(--_0x5a5ad4){_0x228890['push'](_0x228890['shift']());}};_0x3b7475(++_0x16ba2f);}(_0x97d3,0x99));var _0x397d=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x97d3[_0x1bc013];return _0x55df36;};'use strict';var EventEmitter=require(_0x397d('0x0'));var VoiceQueueReport=require(_0x397d('0x1'))['db'][_0x397d('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x397d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x397d('0x4')};function emitEvent(_0x13c9ae){return function(_0x133466,_0x302d3c,_0x233add){VoiceQueueReportEvents[_0x397d('0x5')](_0x13c9ae+':'+_0x133466['id'],_0x133466);VoiceQueueReportEvents[_0x397d('0x5')](_0x13c9ae,_0x133466);_0x233add(null);};}for(var e in events){if(events[_0x397d('0x6')](e)){var event=events[e];VoiceQueueReport[_0x397d('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index 4ae8135..bcf45c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0xc2fd47,_0x2987f7){var _0x4370bf=function(_0x4c5986){while(--_0x4c5986){_0xc2fd47['push'](_0xc2fd47['shift']());}};_0x4370bf(++_0x2987f7);}(_0x757a,0xde));var _0xa757=function(_0x53160c,_0x344099){_0x53160c=_0x53160c-0x0;var _0xbea6fa=_0x757a[_0x53160c];return _0xbea6fa;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('VoiceQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa757('0xa')]},{'fields':[_0xa757('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b0e=['calleridnum','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid'];(function(_0x529822,_0x555f7f){var _0x36801d=function(_0x5a3268){while(--_0x5a3268){_0x529822['push'](_0x529822['shift']());}};_0x36801d(++_0x555f7f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x0b0e[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xe0b0('0xb')]},{'fields':[_0xe0b0('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index b22a52b..5156156 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf37=['raw','where','attributes','include','model','map','CreateVoiceQueueReport','body','info','UpdateVoiceQueueReport','VoiceQueueReport','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetVoiceQueueReport','findAll','options'];(function(_0x3f1415,_0x50d79a){var _0xccee18=function(_0x42dc77){while(--_0x42dc77){_0x3f1415['push'](_0x3f1415['shift']());}};_0xccee18(++_0x50d79a);}(_0xcf37,0x174));var _0x7cf3=function(_0x31ac45,_0x3377b2){_0x31ac45=_0x31ac45-0x0;var _0x1504cb=_0xcf37[_0x31ac45];return _0x1504cb;};'use strict';var _=require(_0x7cf3('0x0'));var util=require(_0x7cf3('0x1'));var moment=require(_0x7cf3('0x2'));var BPromise=require(_0x7cf3('0x3'));var rs=require(_0x7cf3('0x4'));var fs=require('fs');var Redis=require(_0x7cf3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cf3('0x6'));var logger=require('../../config/logger')(_0x7cf3('0x7'));var config=require('../../config/environment');var jayson=require(_0x7cf3('0x8'));var client=jayson[_0x7cf3('0x9')][_0x7cf3('0xa')]({'port':0x232a});config['redis']=_[_0x7cf3('0xb')](config[_0x7cf3('0xc')],{'host':_0x7cf3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7cf3('0xc')]));require(_0x7cf3('0xe'))[_0x7cf3('0xf')](socket);function respondWithRpcPromise(_0x4b96ee,_0x568984,_0x1af4f6){return new BPromise(function(_0x5f4393,_0x2dd619){return client[_0x7cf3('0x10')](_0x4b96ee,_0x1af4f6)[_0x7cf3('0x11')](function(_0x4f32b3){logger['info'](_0x7cf3('0x12'),_0x568984,_0x7cf3('0x13'));logger[_0x7cf3('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x568984,_0x7cf3('0x13'),JSON[_0x7cf3('0x15')](_0x4f32b3));if(_0x4f32b3[_0x7cf3('0x16')]){if(_0x4f32b3[_0x7cf3('0x16')]['code']===0x1f4){logger['error'](_0x7cf3('0x12'),_0x568984,_0x4f32b3['error'][_0x7cf3('0x17')]);return _0x2dd619(_0x4f32b3[_0x7cf3('0x16')][_0x7cf3('0x17')]);}logger['error'](_0x7cf3('0x12'),_0x568984,_0x4f32b3[_0x7cf3('0x16')][_0x7cf3('0x17')]);return _0x5f4393(_0x4f32b3[_0x7cf3('0x16')][_0x7cf3('0x17')]);}else{logger['info'](_0x7cf3('0x12'),_0x568984,_0x7cf3('0x13'));_0x5f4393(_0x4f32b3['result'][_0x7cf3('0x17')]);}})[_0x7cf3('0x18')](function(_0x43e207){logger[_0x7cf3('0x16')](_0x7cf3('0x12'),_0x568984,_0x43e207);_0x2dd619(_0x43e207);});});}exports[_0x7cf3('0x19')]=function(_0x774399){var _0x159e39=this;return new Promise(function(_0x19abf4,_0x45d60a){return db['VoiceQueueReport'][_0x7cf3('0x1a')]({'raw':_0x774399['options']?_0x774399[_0x7cf3('0x1b')][_0x7cf3('0x1c')]===undefined?!![]:![]:!![],'where':_0x774399['options']?_0x774399['options'][_0x7cf3('0x1d')]||null:null,'attributes':_0x774399['options']?_0x774399[_0x7cf3('0x1b')][_0x7cf3('0x1e')]||null:null,'limit':_0x774399[_0x7cf3('0x1b')]?_0x774399['options']['limit']||null:null,'include':_0x774399[_0x7cf3('0x1b')]?_0x774399['options'][_0x7cf3('0x1f')]?_['map'](_0x774399[_0x7cf3('0x1b')][_0x7cf3('0x1f')],function(_0x417dd8){return{'model':db[_0x417dd8[_0x7cf3('0x20')]],'as':_0x417dd8['as'],'attributes':_0x417dd8[_0x7cf3('0x1e')],'include':_0x417dd8['include']?_['map'](_0x417dd8[_0x7cf3('0x1f')],function(_0x396380){return{'model':db[_0x396380[_0x7cf3('0x20')]],'as':_0x396380['as'],'attributes':_0x396380[_0x7cf3('0x1e')],'include':_0x396380[_0x7cf3('0x1f')]?_[_0x7cf3('0x21')](_0x396380[_0x7cf3('0x1f')],function(_0x13703d){return{'model':db[_0x13703d[_0x7cf3('0x20')]],'as':_0x13703d['as'],'attributes':_0x13703d[_0x7cf3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7cf3('0x11')](function(_0xff9cd9){logger['info'](_0x7cf3('0x19'),_0x774399);logger[_0x7cf3('0x14')](_0x7cf3('0x19'),_0x774399,JSON[_0x7cf3('0x15')](_0xff9cd9));_0x19abf4(_0xff9cd9);})['catch'](function(_0x36e6f6){logger[_0x7cf3('0x16')](_0x7cf3('0x19'),_0x36e6f6['message'],_0x774399);_0x45d60a(_0x159e39[_0x7cf3('0x16')](0x1f4,_0x36e6f6['message']));});});};exports[_0x7cf3('0x22')]=function(_0x45f0f0){var _0x7effbb=this;return new Promise(function(_0x4e1bf9,_0x5ece3a){return db['VoiceQueueReport']['create'](_0x45f0f0[_0x7cf3('0x23')],{'raw':_0x45f0f0[_0x7cf3('0x1b')]?_0x45f0f0[_0x7cf3('0x1b')][_0x7cf3('0x1c')]===undefined?!![]:![]:!![]})[_0x7cf3('0x11')](function(_0x192cce){logger[_0x7cf3('0x24')](_0x7cf3('0x22'),_0x45f0f0);logger[_0x7cf3('0x14')]('CreateVoiceQueueReport',_0x45f0f0,JSON[_0x7cf3('0x15')](_0x192cce));_0x4e1bf9(_0x192cce);})['catch'](function(_0xc4b339){logger[_0x7cf3('0x16')](_0x7cf3('0x22'),_0xc4b339[_0x7cf3('0x17')],_0x45f0f0);_0x5ece3a(_0x7effbb[_0x7cf3('0x16')](0x1f4,_0xc4b339[_0x7cf3('0x17')]));});});};exports[_0x7cf3('0x25')]=function(_0x44c18e){var _0x484ab7=this;return new Promise(function(_0x4c021e,_0x3a5af5){return db[_0x7cf3('0x26')]['update'](_0x44c18e[_0x7cf3('0x23')],{'raw':_0x44c18e[_0x7cf3('0x1b')]?_0x44c18e['options'][_0x7cf3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44c18e[_0x7cf3('0x1b')]?_0x44c18e['options'][_0x7cf3('0x1d')]||null:null,'attributes':_0x44c18e[_0x7cf3('0x1b')]?_0x44c18e['options'][_0x7cf3('0x1e')]||null:null,'limit':_0x44c18e[_0x7cf3('0x1b')]?_0x44c18e[_0x7cf3('0x1b')][_0x7cf3('0x27')]||null:null})[_0x7cf3('0x11')](function(_0x1166d1){logger['info'](_0x7cf3('0x25'),_0x44c18e);logger[_0x7cf3('0x14')](_0x7cf3('0x25'),_0x44c18e,JSON['stringify'](_0x1166d1));_0x4c021e(_0x1166d1);})['catch'](function(_0x4c1cc5){logger[_0x7cf3('0x16')](_0x7cf3('0x25'),_0x4c1cc5['message'],_0x44c18e);_0x3a5af5(_0x484ab7['error'](0x1f4,_0x4c1cc5[_0x7cf3('0x17')]));});});};
\ No newline at end of file
+var _0x0894=['then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','VoiceQueueReport','UpdateVoiceQueueReport','update','body','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request'];(function(_0x414a93,_0x5226eb){var _0x59d9a0=function(_0x2e7593){while(--_0x2e7593){_0x414a93['push'](_0x414a93['shift']());}};_0x59d9a0(++_0x5226eb);}(_0x0894,0x97));var _0x4089=function(_0x49d90f,_0xa560c4){_0x49d90f=_0x49d90f-0x0;var _0x25d38b=_0x0894[_0x49d90f];return _0x25d38b;};'use strict';var _=require(_0x4089('0x0'));var util=require(_0x4089('0x1'));var moment=require('moment');var BPromise=require(_0x4089('0x2'));var rs=require(_0x4089('0x3'));var fs=require('fs');var Redis=require(_0x4089('0x4'));var db=require(_0x4089('0x5'))['db'];var utils=require(_0x4089('0x6'));var logger=require(_0x4089('0x7'))('rpc');var config=require(_0x4089('0x8'));var jayson=require(_0x4089('0x9'));var client=jayson[_0x4089('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x4089('0xb')],{'host':_0x4089('0xc'),'port':0x18eb});var socket=require(_0x4089('0xd'))(new Redis(config[_0x4089('0xb')]));require(_0x4089('0xe'))[_0x4089('0xf')](socket);function respondWithRpcPromise(_0x40f5bb,_0x1e52b7,_0x3dad8f){return new BPromise(function(_0x14230b,_0x511004){return client[_0x4089('0x10')](_0x40f5bb,_0x3dad8f)[_0x4089('0x11')](function(_0x33d3ae){logger[_0x4089('0x12')](_0x4089('0x13'),_0x1e52b7,_0x4089('0x14'));logger[_0x4089('0x15')](_0x4089('0x16'),_0x1e52b7,_0x4089('0x14'),JSON[_0x4089('0x17')](_0x33d3ae));if(_0x33d3ae[_0x4089('0x18')]){if(_0x33d3ae[_0x4089('0x18')]['code']===0x1f4){logger[_0x4089('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e52b7,_0x33d3ae[_0x4089('0x18')][_0x4089('0x19')]);return _0x511004(_0x33d3ae[_0x4089('0x18')][_0x4089('0x19')]);}logger[_0x4089('0x18')](_0x4089('0x13'),_0x1e52b7,_0x33d3ae[_0x4089('0x18')]['message']);return _0x14230b(_0x33d3ae['error'][_0x4089('0x19')]);}else{logger[_0x4089('0x12')](_0x4089('0x13'),_0x1e52b7,_0x4089('0x14'));_0x14230b(_0x33d3ae['result']['message']);}})[_0x4089('0x1a')](function(_0x56128a){logger[_0x4089('0x18')](_0x4089('0x13'),_0x1e52b7,_0x56128a);_0x511004(_0x56128a);});});}exports['GetVoiceQueueReport']=function(_0x1d30c3){var _0x38c3d5=this;return new Promise(function(_0x27006f,_0x181417){return db['VoiceQueueReport'][_0x4089('0x1b')]({'raw':_0x1d30c3['options']?_0x1d30c3[_0x4089('0x1c')][_0x4089('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d30c3[_0x4089('0x1c')]?_0x1d30c3[_0x4089('0x1c')][_0x4089('0x1e')]||null:null,'attributes':_0x1d30c3[_0x4089('0x1c')]?_0x1d30c3[_0x4089('0x1c')][_0x4089('0x1f')]||null:null,'limit':_0x1d30c3[_0x4089('0x1c')]?_0x1d30c3[_0x4089('0x1c')][_0x4089('0x20')]||null:null,'include':_0x1d30c3[_0x4089('0x1c')]?_0x1d30c3['options'][_0x4089('0x21')]?_[_0x4089('0x22')](_0x1d30c3['options'][_0x4089('0x21')],function(_0x22e263){return{'model':db[_0x22e263[_0x4089('0x23')]],'as':_0x22e263['as'],'attributes':_0x22e263['attributes'],'include':_0x22e263['include']?_[_0x4089('0x22')](_0x22e263['include'],function(_0x549ce2){return{'model':db[_0x549ce2[_0x4089('0x23')]],'as':_0x549ce2['as'],'attributes':_0x549ce2[_0x4089('0x1f')],'include':_0x549ce2[_0x4089('0x21')]?_[_0x4089('0x22')](_0x549ce2['include'],function(_0x240f47){return{'model':db[_0x240f47[_0x4089('0x23')]],'as':_0x240f47['as'],'attributes':_0x240f47[_0x4089('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f2987){logger[_0x4089('0x12')](_0x4089('0x24'),_0x1d30c3);logger['debug'](_0x4089('0x24'),_0x1d30c3,JSON[_0x4089('0x17')](_0x5f2987));_0x27006f(_0x5f2987);})[_0x4089('0x1a')](function(_0x50e93f){logger['error'](_0x4089('0x24'),_0x50e93f[_0x4089('0x19')],_0x1d30c3);_0x181417(_0x38c3d5[_0x4089('0x18')](0x1f4,_0x50e93f[_0x4089('0x19')]));});});};exports[_0x4089('0x25')]=function(_0x2c6021){var _0x134ad4=this;return new Promise(function(_0x5b329f,_0x409ce6){return db[_0x4089('0x26')]['create'](_0x2c6021['body'],{'raw':_0x2c6021[_0x4089('0x1c')]?_0x2c6021[_0x4089('0x1c')][_0x4089('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x582871){logger[_0x4089('0x12')]('CreateVoiceQueueReport',_0x2c6021);logger['debug']('CreateVoiceQueueReport',_0x2c6021,JSON[_0x4089('0x17')](_0x582871));_0x5b329f(_0x582871);})[_0x4089('0x1a')](function(_0x2e45ba){logger['error']('CreateVoiceQueueReport',_0x2e45ba[_0x4089('0x19')],_0x2c6021);_0x409ce6(_0x134ad4[_0x4089('0x18')](0x1f4,_0x2e45ba[_0x4089('0x19')]));});});};exports[_0x4089('0x27')]=function(_0x45a7bd){var _0x294c4b=this;return new Promise(function(_0x4e8eb1,_0x139494){return db[_0x4089('0x26')][_0x4089('0x28')](_0x45a7bd[_0x4089('0x29')],{'raw':_0x45a7bd[_0x4089('0x1c')]?_0x45a7bd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45a7bd[_0x4089('0x1c')]?_0x45a7bd['options'][_0x4089('0x1e')]||null:null,'attributes':_0x45a7bd[_0x4089('0x1c')]?_0x45a7bd[_0x4089('0x1c')]['attributes']||null:null,'limit':_0x45a7bd[_0x4089('0x1c')]?_0x45a7bd[_0x4089('0x1c')]['limit']||null:null})[_0x4089('0x11')](function(_0x3439df){logger[_0x4089('0x12')](_0x4089('0x27'),_0x45a7bd);logger[_0x4089('0x15')](_0x4089('0x27'),_0x45a7bd,JSON[_0x4089('0x17')](_0x3439df));_0x4e8eb1(_0x3439df);})[_0x4089('0x1a')](function(_0x2d1485){logger[_0x4089('0x18')](_0x4089('0x27'),_0x2d1485[_0x4089('0x19')],_0x45a7bd);_0x139494(_0x294c4b[_0x4089('0x18')](0x1f4,_0x2d1485['message']));});});};
\ No newline at end of file
index 46523e1..9317914 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c46=['./voiceQueueReport.events','save','update','removeListener','length','voiceQueueReport:'];(function(_0x109025,_0x928cd0){var _0x2dd054=function(_0x28075f){while(--_0x28075f){_0x109025['push'](_0x109025['shift']());}};_0x2dd054(++_0x928cd0);}(_0x8c46,0x144));var _0x68c4=function(_0x1f7fe3,_0x152a2a){_0x1f7fe3=_0x1f7fe3-0x0;var _0x43b4ab=_0x8c46[_0x1f7fe3];return _0x43b4ab;};'use strict';var VoiceQueueReportEvents=require(_0x68c4('0x0'));var events=[_0x68c4('0x1'),'remove',_0x68c4('0x2')];function createListener(_0x2ef02c,_0x3c82ab){return function(_0x21b896){_0x3c82ab['emit'](_0x2ef02c,_0x21b896);};}function removeListener(_0x5c2710,_0x448397){return function(){VoiceQueueReportEvents[_0x68c4('0x3')](_0x5c2710,_0x448397);};}exports['register']=function(_0x4243e3){for(var _0x328244=0x0,_0x4362c2=events[_0x68c4('0x4')];_0x328244<_0x4362c2;_0x328244++){var _0x5be30c=events[_0x328244];var _0x35c0dd=createListener(_0x68c4('0x5')+_0x5be30c,_0x4243e3);VoiceQueueReportEvents['on'](_0x5be30c,_0x35c0dd);}};
\ No newline at end of file
+var _0x279b=['emit','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x5f5828,_0x1581c0){var _0x20a42b=function(_0x10ada2){while(--_0x10ada2){_0x5f5828['push'](_0x5f5828['shift']());}};_0x20a42b(++_0x1581c0);}(_0x279b,0x137));var _0xb279=function(_0x49f6ae,_0x2f75b6){_0x49f6ae=_0x49f6ae-0x0;var _0x3e4d37=_0x279b[_0x49f6ae];return _0x3e4d37;};'use strict';var VoiceQueueReportEvents=require(_0xb279('0x0'));var events=[_0xb279('0x1'),_0xb279('0x2'),_0xb279('0x3')];function createListener(_0x5c9b8c,_0x4f3e16){return function(_0x591c31){_0x4f3e16[_0xb279('0x4')](_0x5c9b8c,_0x591c31);};}function removeListener(_0x261902,_0x49b710){return function(){VoiceQueueReportEvents['removeListener'](_0x261902,_0x49b710);};}exports[_0xb279('0x5')]=function(_0x4ad6b1){for(var _0x4b1a30=0x0,_0x35ab55=events['length'];_0x4b1a30<_0x35ab55;_0x4b1a30++){var _0x5c611a=events[_0x4b1a30];var _0x76ee5a=createListener(_0xb279('0x6')+_0x5c611a,_0x4ad6b1);VoiceQueueReportEvents['on'](_0x5c611a,_0x76ee5a);}};
\ No newline at end of file
index 041fc6b..06ae97c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd56e=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update'];(function(_0x1136ad,_0x25084f){var _0x4c82c9=function(_0x5530b4){while(--_0x5530b4){_0x1136ad['push'](_0x1136ad['shift']());}};_0x4c82c9(++_0x25084f);}(_0xd56e,0xdf));var _0xed56=function(_0x5c9b8c,_0x3d75f4){_0x5c9b8c=_0x5c9b8c-0x0;var _0x4e4c9f=_0xd56e[_0x5c9b8c];return _0x4e4c9f;};'use strict';var multer=require(_0xed56('0x0'));var util=require(_0xed56('0x1'));var path=require('path');var timeout=require(_0xed56('0x2'));var express=require(_0xed56('0x3'));var router=express[_0xed56('0x4')]();var auth=require(_0xed56('0x5'));var interaction=require(_0xed56('0x6'));var config=require(_0xed56('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0xed56('0x8')]('/',auth[_0xed56('0x9')](),controller[_0xed56('0xa')]);router['get'](_0xed56('0xb'),auth[_0xed56('0x9')](),controller[_0xed56('0xc')]);router[_0xed56('0xd')]('/',auth[_0xed56('0x9')](),controller['create']);router['put']('/:id',auth[_0xed56('0x9')](),controller[_0xed56('0xe')]);router['delete'](_0xed56('0xb'),auth[_0xed56('0x9')](),controller[_0xed56('0xf')]);module[_0xed56('0x10')]=router;
\ No newline at end of file
+var _0xf220=['post','create','update','/:id','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','isAuthenticated','show'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xf220,0x113));var _0x0f22=function(_0x18367b,_0x595e60){_0x18367b=_0x18367b-0x0;var _0x485aa8=_0xf220[_0x18367b];return _0x485aa8;};'use strict';var multer=require('multer');var util=require(_0x0f22('0x0'));var path=require(_0x0f22('0x1'));var timeout=require(_0x0f22('0x2'));var express=require(_0x0f22('0x3'));var router=express[_0x0f22('0x4')]();var auth=require(_0x0f22('0x5'));var interaction=require(_0x0f22('0x6'));var config=require(_0x0f22('0x7'));var controller=require(_0x0f22('0x8'));router[_0x0f22('0x9')]('/',auth['isAuthenticated'](),controller[_0x0f22('0xa')]);router[_0x0f22('0x9')]('/:id',auth[_0x0f22('0xb')](),controller[_0x0f22('0xc')]);router[_0x0f22('0xd')]('/',auth[_0x0f22('0xb')](),controller[_0x0f22('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0f22('0xf')]);router['delete'](_0x0f22('0x10'),auth[_0x0f22('0xb')](),controller[_0x0f22('0x11')]);module['exports']=router;
\ No newline at end of file
index 7874341..6d0d34b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76e8=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x76e8,0x9e));var _0x876e=function(_0x4cd8c6,_0xed8a02){_0x4cd8c6=_0x4cd8c6-0x0;var _0x5b84d8=_0x76e8[_0x4cd8c6];return _0x5b84d8;};'use strict';var Sequelize=require(_0x876e('0x0'));var moment=require(_0x876e('0x1'));module[_0x876e('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x876e('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x876e('0x4')],'allowNull':![],'defaultValue':moment()[_0x876e('0x5')](_0x876e('0x6'))}};
\ No newline at end of file
+var _0x3124=['sequelize','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x52cd71,_0xbc56f1){var _0x340b26=function(_0x499bad){while(--_0x499bad){_0x52cd71['push'](_0x52cd71['shift']());}};_0x340b26(++_0xbc56f1);}(_0x3124,0x149));var _0x4312=function(_0x5f57d5,_0x2674d2){_0x5f57d5=_0x5f57d5-0x0;var _0xae2a65=_0x3124[_0x5f57d5];return _0xae2a65;};'use strict';var Sequelize=require(_0x4312('0x0'));var moment=require(_0x4312('0x1'));module[_0x4312('0x2')]={'time':{'type':Sequelize[_0x4312('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4312('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4312('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4312('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4312('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4312('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x4312('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4312('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4312('0x4')],'allowNull':![],'defaultValue':moment()[_0x4312('0x5')](_0x4312('0x6'))}};
\ No newline at end of file
index 77edd86..ecf8dba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x1d638a,_0x2c4d2b){var _0x59a099=function(_0x33aa18){while(--_0x33aa18){_0x1d638a['push'](_0x1d638a['shift']());}};_0x59a099(++_0x2c4d2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x2ae45f,_0x837a7a){var _0x17cb22=function(_0x3e742a){while(--_0x3e742a){_0x2ae45f['push'](_0x2ae45f['shift']());}};_0x17cb22(++_0x837a7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
index 646003d..3d595c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d6c=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x2d6c,0xea));var _0xc2d6=function(_0x2a80fd,_0x2097b4){_0x2a80fd=_0x2a80fd-0x0;var _0x3e78b1=_0x2d6c[_0x2a80fd];return _0x3e78b1;};'use strict';var _=require(_0xc2d6('0x0'));var util=require(_0xc2d6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc2d6('0x2'));var BPromise=require(_0xc2d6('0x3'));var rp=require(_0xc2d6('0x4'));var fs=require('fs');var path=require(_0xc2d6('0x5'));var rimraf=require('rimraf');var config=require(_0xc2d6('0x6'));var attributes=require(_0xc2d6('0x7'));module[_0xc2d6('0x8')]=function(_0x456392,_0x124996){return _0x456392[_0xc2d6('0x9')](_0xc2d6('0xa'),attributes,{'tableName':_0xc2d6('0xb'),'paranoid':![],'indexes':[{'name':_0xc2d6('0xc'),'fields':['event','dtm']}],'timestamps':![]});};
\ No newline at end of file
+var _0xe459=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','voice_queues_log','event_dtm','dtm','lodash'];(function(_0x49bf38,_0x42c116){var _0xb76377=function(_0x4284b4){while(--_0x4284b4){_0x49bf38['push'](_0x49bf38['shift']());}};_0xb76377(++_0x42c116);}(_0xe459,0xcf));var _0x9e45=function(_0x9d47db,_0x3ec431){_0x9d47db=_0x9d47db-0x0;var _0x1ed6ed=_0xe459[_0x9d47db];return _0x1ed6ed;};'use strict';var _=require(_0x9e45('0x0'));var util=require(_0x9e45('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9e45('0x2'));var BPromise=require(_0x9e45('0x3'));var rp=require(_0x9e45('0x4'));var fs=require('fs');var path=require(_0x9e45('0x5'));var rimraf=require(_0x9e45('0x6'));var config=require(_0x9e45('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x9e45('0x8')]=function(_0x56a44d,_0x3d2440){return _0x56a44d[_0x9e45('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0x9e45('0xa'),'paranoid':![],'indexes':[{'name':_0x9e45('0xb'),'fields':['event',_0x9e45('0xc')]}],'timestamps':![]});};
\ No newline at end of file
index d69b4c0..389c1e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x45b4c7,_0x2f8d4d){var _0x38ae63=function(_0x3adb73){while(--_0x3adb73){_0x45b4c7['push'](_0x45b4c7['shift']());}};_0x38ae63(++_0x2f8d4d);}(_0x58a4,0xbf));var _0x458a=function(_0x166241,_0x227ee2){_0x166241=_0x166241-0x0;var _0x51fd00=_0x58a4[_0x166241];return _0x51fd00;};'use strict';var _=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var moment=require(_0x458a('0x2'));var BPromise=require(_0x458a('0x3'));var rs=require(_0x458a('0x4'));var fs=require('fs');var Redis=require(_0x458a('0x5'));var db=require(_0x458a('0x6'))['db'];var utils=require(_0x458a('0x7'));var logger=require(_0x458a('0x8'))(_0x458a('0x9'));var config=require(_0x458a('0xa'));var jayson=require(_0x458a('0xb'));var client=jayson[_0x458a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5358c2,_0x30b095,_0x11fcaa){return new BPromise(function(_0x2029bc,_0x1e658e){return client[_0x458a('0xd')](_0x5358c2,_0x11fcaa)['then'](function(_0x4bedce){logger[_0x458a('0xe')](_0x458a('0xf'),_0x30b095,_0x458a('0x10'));logger[_0x458a('0x11')](_0x458a('0x12'),_0x30b095,'request\x20sent',JSON[_0x458a('0x13')](_0x4bedce));if(_0x4bedce[_0x458a('0x14')]){if(_0x4bedce['error'][_0x458a('0x15')]===0x1f4){logger[_0x458a('0x14')](_0x458a('0xf'),_0x30b095,_0x4bedce[_0x458a('0x14')][_0x458a('0x16')]);return _0x1e658e(_0x4bedce['error']['message']);}logger[_0x458a('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x30b095,_0x4bedce[_0x458a('0x14')][_0x458a('0x16')]);return _0x2029bc(_0x4bedce[_0x458a('0x14')][_0x458a('0x16')]);}else{logger[_0x458a('0xe')](_0x458a('0xf'),_0x30b095,'request\x20sent');_0x2029bc(_0x4bedce['result']['message']);}})[_0x458a('0x17')](function(_0x3fd6d4){logger[_0x458a('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x30b095,_0x3fd6d4);_0x1e658e(_0x3fd6d4);});});}
\ No newline at end of file
+var _0x6f2f=['lodash','util','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','code','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x6f2f[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6f2('0x3'))(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6f2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c94ad,_0x26cd28,_0x774922){return new BPromise(function(_0x15a71c,_0x1873c8){return client[_0xf6f2('0x7')](_0x1c94ad,_0x774922)[_0xf6f2('0x8')](function(_0x294a85){logger[_0xf6f2('0x9')]('VoiceQueuesLog,\x20%s,\x20%s',_0x26cd28,_0xf6f2('0xa'));logger[_0xf6f2('0xb')](_0xf6f2('0xc'),_0x26cd28,_0xf6f2('0xa'),JSON['stringify'](_0x294a85));if(_0x294a85['error']){if(_0x294a85['error'][_0xf6f2('0xd')]===0x1f4){logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x294a85[_0xf6f2('0xe')][_0xf6f2('0x10')]);return _0x1873c8(_0x294a85[_0xf6f2('0xe')]['message']);}logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x294a85[_0xf6f2('0xe')][_0xf6f2('0x10')]);return _0x15a71c(_0x294a85[_0xf6f2('0xe')]['message']);}else{logger[_0xf6f2('0x9')](_0xf6f2('0xf'),_0x26cd28,_0xf6f2('0xa'));_0x15a71c(_0x294a85[_0xf6f2('0x11')][_0xf6f2('0x10')]);}})[_0xf6f2('0x12')](function(_0x17dec3){logger[_0xf6f2('0xe')](_0xf6f2('0xf'),_0x26cd28,_0x17dec3);_0x1873c8(_0x17dec3);});});}
\ No newline at end of file
index 95a4877..287e9ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x207983,_0x1b7740){var _0x425f15=function(_0x25decc){while(--_0x25decc){_0x207983['push'](_0x207983['shift']());}};_0x425f15(++_0x1b7740);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x2827bc,_0x718200){var _0x179df7=function(_0x4f7b74){while(--_0x4f7b74){_0x2827bc['push'](_0x2827bc['shift']());}};_0x179df7(++_0x718200);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
index 2c2b523..e4bfb8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68c4=['extname','STRING','setDataValue','channel','membername','split','INTEGER','NEW','TEXT','FLOAT','BOOLEAN','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','VIRTUAL','getDataValue','value'];(function(_0xc38da1,_0x173ae2){var _0x3eceb9=function(_0x2d7819){while(--_0x2d7819){_0xc38da1['push'](_0xc38da1['shift']());}};_0x3eceb9(++_0x173ae2);}(_0x68c4,0xe3));var _0x468c=function(_0x25f3e3,_0x207891){_0x25f3e3=_0x25f3e3-0x0;var _0xa89b6d=_0x68c4[_0x25f3e3];return _0xa89b6d;};'use strict';var Sequelize=require(_0x468c('0x0'));var moment=require('moment');var path=require('path');module['exports']={'format':{'type':Sequelize[_0x468c('0x1')],'get':function(){return this[_0x468c('0x2')](_0x468c('0x3'))?path[_0x468c('0x4')](this['getDataValue']('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x468c('0x5')]},'channel':{'type':Sequelize[_0x468c('0x5')],'set':function(_0x508ee1){if(_0x508ee1){this[_0x468c('0x6')](_0x468c('0x7'),_0x508ee1);this['setDataValue'](_0x468c('0x8'),_0x508ee1[_0x468c('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x468c('0x5')]},'calleridnum':{'type':Sequelize[_0x468c('0x5')]},'calleridname':{'type':Sequelize[_0x468c('0x5')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x468c('0x5')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x468c('0x5')]},'exten':{'type':Sequelize[_0x468c('0x5')]},'value':{'type':Sequelize[_0x468c('0x5')]},'type':{'type':Sequelize[_0x468c('0x5')]},'rating':{'type':Sequelize[_0x468c('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x468c('0x5')]},'userDisposition':{'type':Sequelize[_0x468c('0x5')]},'location':{'type':Sequelize['TEXT']},'transcribeName':{'type':Sequelize['STRING']},'transcribeStatus':{'type':Sequelize['STRING'],'defaultValue':_0x468c('0xb')},'fileUri':{'type':Sequelize[_0x468c('0xc')]},'fileText':{'type':Sequelize[_0x468c('0xc')]},'failureReason':{'type':Sequelize[_0x468c('0xc')]},'sentiment':{'type':Sequelize[_0x468c('0x5')]},'sPositive':{'type':Sequelize[_0x468c('0xd')]},'sNegative':{'type':Sequelize[_0x468c('0xd')]},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x468c('0xe')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0x468c('0xf')],'get':function(){return moment(this['getDataValue'](_0x468c('0x10')))[_0x468c('0x11')](_0x468c('0x12'))[_0x468c('0x13')]();}},'updatedAt':{'type':Sequelize[_0x468c('0xf')],'get':function(){return moment(this[_0x468c('0x2')](_0x468c('0x14')))['format'](_0x468c('0x12'))[_0x468c('0x13')]();}}};
\ No newline at end of file
+var _0xe1a5=['FLOAT','BOOLEAN','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','path','exports','VIRTUAL','getDataValue','STRING','setDataValue','membername','split','INTEGER','TEXT','NEW'];(function(_0x50521f,_0x4375b3){var _0x29b4be=function(_0x1cb06e){while(--_0x1cb06e){_0x50521f['push'](_0x50521f['shift']());}};_0x29b4be(++_0x4375b3);}(_0xe1a5,0x120));var _0x5e1a=function(_0x4dde23,_0x520ee2){_0x4dde23=_0x4dde23-0x0;var _0x201d04=_0xe1a5[_0x4dde23];return _0x201d04;};'use strict';var Sequelize=require(_0x5e1a('0x0'));var moment=require('moment');var path=require(_0x5e1a('0x1'));module[_0x5e1a('0x2')]={'format':{'type':Sequelize[_0x5e1a('0x3')],'get':function(){return this['getDataValue']('value')?path['extname'](this[_0x5e1a('0x4')]('value')):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5e1a('0x5')],'set':function(_0x4ed9cc){if(_0x4ed9cc){this[_0x5e1a('0x6')]('channel',_0x4ed9cc);this[_0x5e1a('0x6')](_0x5e1a('0x7'),_0x4ed9cc[_0x5e1a('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x5e1a('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5e1a('0x5')]},'connectedlinename':{'type':Sequelize[_0x5e1a('0x5')]},'accountcode':{'type':Sequelize[_0x5e1a('0x5')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5e1a('0x5')]},'value':{'type':Sequelize[_0x5e1a('0x5')]},'type':{'type':Sequelize[_0x5e1a('0x5')]},'rating':{'type':Sequelize[_0x5e1a('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x5e1a('0x5')]},'userDisposition':{'type':Sequelize[_0x5e1a('0x5')]},'location':{'type':Sequelize[_0x5e1a('0xa')]},'transcribeName':{'type':Sequelize['STRING']},'transcribeStatus':{'type':Sequelize[_0x5e1a('0x5')],'defaultValue':_0x5e1a('0xb')},'fileUri':{'type':Sequelize[_0x5e1a('0xa')]},'fileText':{'type':Sequelize[_0x5e1a('0xa')]},'failureReason':{'type':Sequelize['TEXT']},'sentiment':{'type':Sequelize[_0x5e1a('0x5')]},'sPositive':{'type':Sequelize['FLOAT']},'sNegative':{'type':Sequelize[_0x5e1a('0xc')]},'sNeutral':{'type':Sequelize[_0x5e1a('0xc')]},'sMixed':{'type':Sequelize[_0x5e1a('0xc')]},'tempSentiment':{'type':Sequelize[_0x5e1a('0xd')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0x5e1a('0xe')],'get':function(){return moment(this[_0x5e1a('0x4')](_0x5e1a('0xf')))[_0x5e1a('0x10')](_0x5e1a('0x11'))[_0x5e1a('0x12')]();}},'updatedAt':{'type':Sequelize[_0x5e1a('0xe')],'get':function(){return moment(this[_0x5e1a('0x4')](_0x5e1a('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0x5e1a('0x12')]();}}};
\ No newline at end of file
index d444787..8fdb77c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8068=['[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','decryptFile','recording','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','$and','secrets','Sequelize','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','upload','TranscribeService','startTranscriptionJob','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name'];(function(_0x1af482,_0x1af5b7){var _0x7e7580=function(_0x5ed4a7){while(--_0x5ed4a7){_0x1af482['push'](_0x1af482['shift']());}};_0x7e7580(++_0x1af5b7);}(_0x8068,0x1e1));var _0x8806=function(_0x583bf0,_0x4b59aa){_0x583bf0=_0x583bf0-0x0;var _0x210ec6=_0x8068[_0x583bf0];return _0x210ec6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8806('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8806('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8806('0x2'));var BPromise=require(_0x8806('0x3'));var Mustache=require(_0x8806('0x4'));var util=require('util');var path=require(_0x8806('0x5'));var sox=require(_0x8806('0x6'));var csv=require(_0x8806('0x7'));var ejs=require(_0x8806('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8806('0x9'));var crypto=require(_0x8806('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8806('0xb'));var toCsv=require(_0x8806('0x7'));var querystring=require('querystring');var Papa=require(_0x8806('0xc'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x8806('0xd'));var authService=require(_0x8806('0xe'));var qs=require(_0x8806('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8806('0x10'));var logger=require(_0x8806('0x11'))(_0x8806('0x12'));var utils=require(_0x8806('0x13'));var config=require(_0x8806('0x14'));var db=require(_0x8806('0x15'))['db'];function respondWithStatusCode(_0x32ceb3,_0x3c5fc1){_0x3c5fc1=_0x3c5fc1||0xcc;return function(_0x2cd478){if(_0x2cd478){return _0x32ceb3[_0x8806('0x16')](_0x3c5fc1);}return _0x32ceb3[_0x8806('0x17')](_0x3c5fc1)['end']();};}function respondWithResult(_0x3a9ba5,_0x28a2d3){_0x28a2d3=_0x28a2d3||0xc8;return function(_0x3b3ea6){if(_0x3b3ea6){return _0x3a9ba5['status'](_0x28a2d3)[_0x8806('0x18')](_0x3b3ea6);}};}function respondWithFilteredResult(_0x555f4c,_0x2d6e6d){return function(_0x367cf4){if(_0x367cf4){var _0x2145b0=_0x367cf4[_0x8806('0x19')],_0x1a4570=_0x2d6e6d[_0x8806('0x1a')],_0x177442=_0x2d6e6d[_0x8806('0x1a')]+_0x2d6e6d['limit'],_0x10a500;if(_0x177442>=_0x2145b0){_0x177442=_0x2145b0;_0x10a500=0xc8;}else{_0x10a500=0xce;}_0x555f4c[_0x8806('0x17')](_0x10a500);return _0x555f4c[_0x8806('0x1b')]('Content-Range',_0x1a4570+'-'+_0x177442+'/'+_0x2145b0)[_0x8806('0x18')](_0x367cf4);}return null;};}function patchUpdates(_0x3063b2){return function(_0x555cf6){try{jsonpatch[_0x8806('0x1c')](_0x555cf6,_0x3063b2,!![]);}catch(_0x42e349){return BPromise[_0x8806('0x1d')](_0x42e349);}return _0x555cf6['save']();};}function saveUpdates(_0x1c9975,_0x4c0bef){return function(_0x401669){if(_0x401669){return _0x401669[_0x8806('0x1e')](_0x1c9975)[_0x8806('0x1f')](function(_0x32dcb2){return _0x32dcb2;});}return null;};}function removeEntity(_0x46a45c,_0x1c553b){return function(_0x254d9b){if(_0x254d9b){return _0x254d9b[_0x8806('0x20')]()[_0x8806('0x1f')](function(){_0x46a45c[_0x8806('0x17')](0xcc)[_0x8806('0x21')]();});}};}function handleEntityNotFound(_0x4af502,_0x4b5573){return function(_0xddfa14){if(!_0xddfa14){_0x4af502['sendStatus'](0x194);}return _0xddfa14;};}function handleError(_0x302a48,_0x1634f2){_0x1634f2=_0x1634f2||0x1f4;return function(_0xe7b451){logger[_0x8806('0x22')](_0xe7b451[_0x8806('0x23')]);if(_0xe7b451[_0x8806('0x24')]){delete _0xe7b451[_0x8806('0x24')];}_0x302a48[_0x8806('0x17')](_0x1634f2)[_0x8806('0x25')](_0xe7b451);};}exports[_0x8806('0x26')]=function(_0x52cc3e,_0x41061a){var _0x3bbf41={},_0x5065f5={},_0x31700d={'count':0x0,'rows':[]};var _0x364364=_[_0x8806('0x27')](db[_0x8806('0x28')][_0x8806('0x29')],function(_0x524cc2){return{'name':_0x524cc2[_0x8806('0x2a')],'type':_0x524cc2[_0x8806('0x2b')][_0x8806('0x2c')]};});_0x5065f5[_0x8806('0x2d')]=_[_0x8806('0x2e')](_[_0x8806('0x27')](_0x364364,_0x8806('0x24')),[_0x8806('0x2f')]);_0x5065f5['query']=_[_0x8806('0x30')](_0x52cc3e[_0x8806('0x31')]);_0x5065f5[_0x8806('0x32')]=_[_0x8806('0x33')](_0x5065f5[_0x8806('0x2d')],_0x5065f5[_0x8806('0x31')]);_0x3bbf41[_0x8806('0x34')]=_[_0x8806('0x33')](_0x5065f5[_0x8806('0x2d')],qs[_0x8806('0x35')](_0x52cc3e[_0x8806('0x31')][_0x8806('0x35')]));_0x3bbf41[_0x8806('0x34')]=_0x3bbf41[_0x8806('0x34')][_0x8806('0x36')]?_0x3bbf41[_0x8806('0x34')]:_0x5065f5[_0x8806('0x2d')];if(!_0x52cc3e[_0x8806('0x31')][_0x8806('0x37')](_0x8806('0x38'))){_0x3bbf41[_0x8806('0x39')]=qs['limit'](_0x52cc3e[_0x8806('0x31')][_0x8806('0x39')]);_0x3bbf41[_0x8806('0x1a')]=qs[_0x8806('0x1a')](_0x52cc3e[_0x8806('0x31')]['offset']);}_0x3bbf41[_0x8806('0x3a')]=qs[_0x8806('0x3b')](_0x52cc3e['query']['sort']);_0x3bbf41['where']=qs[_0x8806('0x32')](_[_0x8806('0x3c')](_0x52cc3e['query'],_0x5065f5[_0x8806('0x32')]),_0x364364);if(_0x52cc3e[_0x8806('0x31')]['filter']){_0x3bbf41[_0x8806('0x3d')]=_[_0x8806('0x3e')](_0x3bbf41[_0x8806('0x3d')],{'$or':_[_0x8806('0x27')](_0x364364,function(_0x513050){if(_0x513050[_0x8806('0x2b')]!==_0x8806('0x3f')){var _0x38eab7={};_0x38eab7[_0x513050[_0x8806('0x24')]]={'$like':'%'+_0x52cc3e[_0x8806('0x31')][_0x8806('0x40')]+'%'};return _0x38eab7;}})});}_0x3bbf41=_[_0x8806('0x3e')]({},_0x3bbf41,_0x52cc3e[_0x8806('0x41')]);var _0x31b35e={'where':_0x3bbf41[_0x8806('0x3d')]};return db[_0x8806('0x28')][_0x8806('0x19')](_0x31b35e)[_0x8806('0x1f')](function(_0x124186){_0x31700d['count']=_0x124186;if(_0x52cc3e['query'][_0x8806('0x42')]){_0x3bbf41[_0x8806('0x43')]=[{'all':!![]}];}return db[_0x8806('0x28')][_0x8806('0x44')](_0x3bbf41);})[_0x8806('0x1f')](function(_0x3c4348){_0x31700d[_0x8806('0x45')]=_0x3c4348;return _0x31700d;})['then'](respondWithFilteredResult(_0x41061a,_0x3bbf41))['catch'](handleError(_0x41061a,null));};exports[_0x8806('0x46')]=function(_0x3ed986,_0xfa1a34){var _0x26b752={'raw':![],'where':{'id':_0x3ed986[_0x8806('0x47')]['id']}},_0x246d0d={};_0x246d0d[_0x8806('0x2d')]=_[_0x8806('0x30')](db[_0x8806('0x28')]['rawAttributes']);_0x246d0d['query']=_[_0x8806('0x30')](_0x3ed986[_0x8806('0x31')]);_0x246d0d[_0x8806('0x32')]=_[_0x8806('0x33')](_0x246d0d[_0x8806('0x2d')],_0x246d0d[_0x8806('0x31')]);_0x26b752[_0x8806('0x34')]=_[_0x8806('0x33')](_0x246d0d[_0x8806('0x2d')],qs[_0x8806('0x35')](_0x3ed986['query'][_0x8806('0x35')]));_0x26b752[_0x8806('0x34')]=_0x26b752[_0x8806('0x34')]['length']?_0x26b752[_0x8806('0x34')]:_0x246d0d[_0x8806('0x2d')];if(_0x3ed986[_0x8806('0x31')]['includeAll']){_0x26b752[_0x8806('0x43')]=[{'all':!![]}];}_0x26b752=_[_0x8806('0x3e')]({},_0x26b752,_0x3ed986[_0x8806('0x41')]);return db[_0x8806('0x28')][_0x8806('0x48')](_0x26b752)[_0x8806('0x1f')](handleEntityNotFound(_0xfa1a34,null))['then'](respondWithResult(_0xfa1a34,null))[_0x8806('0x49')](handleError(_0xfa1a34,null));};exports[_0x8806('0x4a')]=function(_0xb6a8ee,_0xd571a0){return db['VoiceRecording'][_0x8806('0x4a')](_0xb6a8ee['body'],{})[_0x8806('0x1f')](respondWithResult(_0xd571a0,0xc9))[_0x8806('0x49')](handleError(_0xd571a0,null));};exports[_0x8806('0x1e')]=function(_0x39e787,_0x13d6de){if(_0x39e787['body']['id']){delete _0x39e787['body']['id'];}return db['VoiceRecording'][_0x8806('0x48')]({'where':{'id':_0x39e787[_0x8806('0x47')]['id']}})[_0x8806('0x1f')](handleEntityNotFound(_0x13d6de,null))['then'](saveUpdates(_0x39e787[_0x8806('0x4b')],null))[_0x8806('0x1f')](respondWithResult(_0x13d6de,null))[_0x8806('0x49')](handleError(_0x13d6de,null));};exports[_0x8806('0x4c')]=function(_0x484d66,_0x52a38d){return db[_0x8806('0x28')]['describe']()['then'](respondWithResult(_0x52a38d,null))[_0x8806('0x49')](handleError(_0x52a38d,null));};exports[_0x8806('0x4d')]=function(_0x3256c4,_0x543c84,_0x27ad3b){var _0x326229=require('../../components/encryptor');var _0x261995=![];var _0x47497e={};if(_0x3256c4[_0x8806('0x31')][_0x8806('0x2b')]&&_0x3256c4[_0x8806('0x31')][_0x8806('0x2b')]===_0x8806('0x4e')){_0x47497e[_0x8806('0x4e')]=_0x3256c4['params']['id'];}else{_0x47497e['id']=_0x3256c4['params']['id'];}return db[_0x8806('0x28')]['find']({'where':_0x47497e,'attributes':['id',_0x8806('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x543c84,null))[_0x8806('0x1f')](function(_0x1efafe){if(_0x1efafe){var _0x37c652=_0x1efafe[_0x8806('0x4f')];var _0x54ea77=util[_0x8806('0x2f')](_0x8806('0x50'),_0x37c652);if(fs['existsSync'](_0x54ea77)){_0x261995=!![];return _0x326229[_0x8806('0x51')](_0x54ea77,_0x37c652,config['secrets'][_0x8806('0x52')])[_0x8806('0x1f')](function(){return _0x1efafe;});}return _0x1efafe;}})[_0x8806('0x1f')](function(_0x45fd91){if(_0x45fd91){var _0x13e927=_0x45fd91[_0x8806('0x4f')];if(!fs[_0x8806('0x53')](_0x13e927)){throw new db['Sequelize'][(_0x8806('0x54'))](_0x8806('0x55'));}if(_0x45fd91[_0x8806('0x56')]){return _0x543c84[_0x8806('0x4d')](_0x13e927,_0x45fd91[_0x8806('0x56')]+path['extname'](_0x13e927),function(){if(_0x261995){fs[_0x8806('0x57')](_0x13e927);}});}else{return _0x543c84['download'](_0x13e927,function(_0x209499){if(_0x261995){fs['unlink'](_0x13e927);}});}}})[_0x8806('0x49')](function(_0x42a866){if(_0x42a866[_0x8806('0x58')]==='VoiceRecording\x20not\x20found'){_0x543c84['status'](0x194)[_0x8806('0x25')](_0x8806('0x59'));}else{return handleError(_0x543c84,null);}});};exports[_0x8806('0x5a')]=function(_0x4160ac,_0x41e4bc,_0x381273){var _0x1259d2=require(_0x8806('0x5b'));var _0x34fccc=![];var _0x516d98={'$and':[db['sequelize'][_0x8806('0x3d')](db[_0x8806('0x5c')]['fn'](_0x8806('0x5d'),db[_0x8806('0x5c')][_0x8806('0x5e')](_0x8806('0x4e'))),_0x4160ac[_0x8806('0x31')]['token'])]};if(_0x4160ac[_0x8806('0x31')][_0x8806('0x2b')]&&_0x4160ac['query'][_0x8806('0x2b')]===_0x8806('0x4e')){_0x516d98[_0x8806('0x5f')]['push']({'uniqueid':_0x4160ac['params']['id']});}else{_0x516d98[_0x8806('0x5f')]['push']({'id':_0x4160ac['params']['id']});}return db[_0x8806('0x28')][_0x8806('0x48')]({'where':_0x516d98,'attributes':['id',_0x8806('0x4f')],'raw':!![]})[_0x8806('0x1f')](handleEntityNotFound(_0x41e4bc,null))[_0x8806('0x1f')](function(_0x3c4097){if(_0x3c4097){var _0x450b43=util['format']('%s.cypher',_0x3c4097[_0x8806('0x4f')]);if(fs[_0x8806('0x53')](_0x450b43)){_0x34fccc=!![];return _0x1259d2['decryptFile'](_0x450b43,_0x3c4097['value'],config[_0x8806('0x60')][_0x8806('0x52')])['then'](function(){return _0x3c4097;});}return _0x3c4097;}})[_0x8806('0x1f')](function(_0x3d5683){if(_0x3d5683){if(!fs[_0x8806('0x53')](_0x3d5683[_0x8806('0x4f')])){throw new db[(_0x8806('0x61'))][(_0x8806('0x54'))](_0x8806('0x55'));}if(_0x3d5683[_0x8806('0x56')]){return _0x41e4bc[_0x8806('0x4d')](_0x3d5683[_0x8806('0x4f')],_0x3d5683[_0x8806('0x56')]+path[_0x8806('0x62')](_0x3d5683[_0x8806('0x4f')]),function(){if(_0x34fccc){fs[_0x8806('0x57')](_0x3d5683[_0x8806('0x4f')]);}});}else{return _0x41e4bc[_0x8806('0x4d')](_0x3d5683['value'],function(_0x1104a1){if(_0x34fccc){fs[_0x8806('0x57')](_0x3d5683['value']);}});}}})[_0x8806('0x49')](handleError(_0x41e4bc,null));};exports['destroy']=function(_0x29c19e,_0x53a00f){return db[_0x8806('0x28')][_0x8806('0x48')]({'where':{'id':_0x29c19e[_0x8806('0x47')]['id']}})[_0x8806('0x1f')](function(_0x534033){if(!_0x534033)throw new ReferenceError(_0x8806('0x63'));return _0x534033;})['then'](function(_0xe217f6){var _0x105f11=_0xe217f6['value'];logger[_0x8806('0x64')](_0x8806('0x65'),_0x105f11);if(!_[_0x8806('0x66')](_0xe217f6[_0x8806('0x4f')])&&fs[_0x8806('0x53')](_0x105f11)){logger[_0x8806('0x64')](_0x8806('0x67')+_0x105f11+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8806('0x68')](_0x105f11);}_0x105f11=_0x105f11+_0x8806('0x69');if(!_[_0x8806('0x66')](_0xe217f6['value'])&&fs[_0x8806('0x53')](_0x105f11)){logger[_0x8806('0x64')](_0x8806('0x67')+_0x105f11+_0x8806('0x6a'));fs[_0x8806('0x68')](_0x105f11);}return _0xe217f6;})['then'](function(_0x56f9fb){if(!_0x56f9fb)throw new InternalError();return _0x56f9fb[_0x8806('0x20')]();})[_0x8806('0x1f')](function(){_0x53a00f['status'](0xcc)[_0x8806('0x21')]();})[_0x8806('0x49')](handleError(_0x53a00f,null));};function getBucketslist(_0x3b5830,_0x5a9922,_0x37518c){return new Promise(function(_0x440b5b,_0x847237){var _0x486dac=new AWS['S3']({'accessKeyId':_0x5a9922,'secretAccessKey':_0x3b5830,'region':_0x37518c});_0x486dac[_0x8806('0x6b')]({},function(_0x36c4d8,_0x27b84b){if(_0x36c4d8){return _0x847237(_0x36c4d8);}else{return _0x440b5b(_0x27b84b);}});});}function createBucket(_0x526f97,_0x173097,_0x502b4f,_0x41f3e7){return new Promise(function(_0x556b3c,_0x24867c){var _0x47aefd=new AWS['S3']({'accessKeyId':_0x173097,'secretAccessKey':_0x526f97,'region':_0x502b4f});_0x47aefd['createBucket']({'Bucket':_0x41f3e7},function(_0x1ca430,_0x2bd189){if(_0x1ca430){return _0x24867c(_0x1ca430);}else{return _0x556b3c(_0x2bd189);}});});}function uploadFile(_0x51146b,_0x51559c,_0xdc8394,_0x45337b,_0xbcf42a,_0x2c2cc5){return new Promise(function(_0x891da6,_0x4e83be){var _0x1f791c=new AWS['S3']({'accessKeyId':_0x51559c,'secretAccessKey':_0x51146b,'region':_0xdc8394});_0x1f791c[_0x8806('0x6c')]({'Bucket':_0x45337b,'Key':_0xbcf42a,'Body':_0x2c2cc5},function(_0x4a0b22,_0x4a94ce){if(_0x4a0b22){return _0x4e83be(_0x4a0b22);}else{return _0x891da6(_0x4a94ce);}});});}function startTranscribe(_0x399f85,_0x5e25ff,_0x45e27e,_0x5edf41,_0xb2d382,_0x55fea8){return new Promise(function(_0x1edb0b,_0x371a1c){var _0xa66a9c=new AWS[(_0x8806('0x6d'))]({'accessKeyId':_0x5e25ff,'secretAccessKey':_0x399f85,'region':_0x45e27e});_0xa66a9c[_0x8806('0x6e')]({'TranscriptionJobName':_0x5edf41,'LanguageCode':_0xb2d382,'Media':{'MediaFileUri':_0x55fea8}},function(_0x146320,_0x4f03cb){if(_0x146320){return _0x371a1c(_0x146320);}else{return _0x1edb0b(_0x4f03cb);}});});}function transcribe(_0xe46e6a,_0x1f5155,_0x5f7288,_0x4a08cd,_0x14f4bd,_0x409564,_0x185456){return new Promise(function(_0x47b10c,_0xdc5bf5){var _0x3475ea={};logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0xe46e6a,_0x14f4bd));return uploadFile(_0x1f5155,_0x5f7288,_0x4a08cd,_0x14f4bd,path['basename'](_0x409564),fs[_0x8806('0x6f')](_0x409564))[_0x8806('0x1f')](function(_0xe78ef7){logger[_0x8806('0x64')](util['format'](_0x8806('0x70'),_0xe46e6a,_0x14f4bd,_0xe78ef7[_0x8806('0x71')]));_0x3475ea[_0x8806('0x72')]=_0xe78ef7['Bucket'];_0x3475ea[_0x8806('0x73')]=_0xe78ef7['Location'];logger[_0x8806('0x64')](util['format'](_0x8806('0x74'),_0xe46e6a));return startTranscribe(_0x1f5155,_0x5f7288,_0x4a08cd,uuidv4(),_0x185456,_0xe78ef7[_0x8806('0x71')]);})[_0x8806('0x1f')](function(_0xb069bd){logger[_0x8806('0x64')](util['format'](_0x8806('0x75'),_0xe46e6a,_0xb069bd[_0x8806('0x76')]['TranscriptionJobName']));_0x3475ea[_0x8806('0x77')]=_0xb069bd['TranscriptionJob'][_0x8806('0x78')];_0x3475ea[_0x8806('0x79')]=_0xb069bd[_0x8806('0x76')]['TranscriptionJobStatus'];return _0x47b10c(_0x3475ea);})[_0x8806('0x49')](function(_0x1b3acc){return _0xdc5bf5(_0x1b3acc);});});}exports[_0x8806('0x7a')]=function(_0x3dd709,_0x34ced4,_0x316c64){var _0xf58d8a;var _0x4611c4;var _0x394aaf;var _0x45a59e=require(_0x8806('0x5b'));return db[_0x8806('0x28')][_0x8806('0x7b')]({'where':{'id':_0x3dd709[_0x8806('0x47')]['id']}})['then'](function(_0x3a7259){if(_0x3a7259){var _0xb4b20e=util[_0x8806('0x2f')](_0x8806('0x50'),_0x3a7259[_0x8806('0x4f')]);if(fs[_0x8806('0x53')](_0xb4b20e)){cypher=!![];return _0x45a59e[_0x8806('0x51')](_0xb4b20e,_0x3a7259[_0x8806('0x4f')],config['secrets'][_0x8806('0x52')])[_0x8806('0x1f')](function(){return _0x3a7259;});}return _0x3a7259;}})[_0x8806('0x1f')](function(_0x592a49){if(!_0x592a49){throw new db[(_0x8806('0x61'))][(_0x8806('0x54'))](_0x8806('0x7c'));}_0x4611c4=_0x592a49;return db[_0x8806('0x7d')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x34ced4,null))[_0x8806('0x1f')](function(_0x311baa){if(_0x311baa){_0xf58d8a=_0x311baa;if(!_0xf58d8a[_0x8806('0x7e')]||!_0xf58d8a[_0x8806('0x7f')]||!_0xf58d8a[_0x8806('0x80')]||!_0xf58d8a['language']||!_0xf58d8a[_0x8806('0x72')]){throw new db[(_0x8806('0x61'))][(_0x8806('0x54'))](_0x8806('0x81'));}if(_0x3dd709[_0x8806('0x4b')][_0x8806('0x82')]&&(!_0xf58d8a[_0x8806('0x83')]||!_0xf58d8a[_0x8806('0x84')]||!_0xf58d8a[_0x8806('0x85')]||!_0xf58d8a[_0x8806('0x86')]||!_0xf58d8a['bucket'])){throw new db[(_0x8806('0x61'))][(_0x8806('0x54'))](_0x8806('0x87'));}return db[_0x8806('0x88')][_0x8806('0x7b')]({'where':{'id':_0xf58d8a[_0x8806('0x7f')]}});}})[_0x8806('0x1f')](function(_0x46be43){if(!_0x46be43){throw new db[(_0x8806('0x61'))]['ValidationError'](_0x8806('0x89'));}if(!_0x46be43['data1']||!_0x46be43[_0x8806('0x8a')]){throw new db[(_0x8806('0x61'))][(_0x8806('0x54'))](_0x8806('0x8b'));}_0x394aaf=_0x46be43;return getBucketslist(_0x394aaf[_0x8806('0x8c')],_0x394aaf[_0x8806('0x8a')],_0xf58d8a[_0x8806('0x80')]);})[_0x8806('0x1f')](function(_0x3cbab0){if(_0x3cbab0&&_0x3cbab0[_0x8806('0x8d')]){var _0x30a51f=_[_0x8806('0x48')](_0x3cbab0[_0x8806('0x8d')],function(_0x119bfd){return _0x119bfd[_0x8806('0x8e')]===_0xf58d8a[_0x8806('0x72')];});if(!_0x30a51f){logger['info'](util[_0x8806('0x2f')](_0x8806('0x8f'),_0x3dd709[_0x8806('0x47')]['id'],_0xf58d8a[_0x8806('0x72')]));return createBucket(_0x394aaf[_0x8806('0x8c')],_0x394aaf[_0x8806('0x8a')],_0xf58d8a[_0x8806('0x80')],_0xf58d8a['bucket']);}logger[_0x8806('0x64')](util['format'](_0x8806('0x90'),_0x3dd709[_0x8806('0x47')]['id'],_0xf58d8a[_0x8806('0x72')]));return;}})[_0x8806('0x1f')](function(_0x138024){if(_0x4611c4[_0x8806('0x79')]===_0x8806('0x91')){return transcribe(_0x3dd709[_0x8806('0x47')]['id'],_0x394aaf['data1'],_0x394aaf[_0x8806('0x8a')],_0xf58d8a[_0x8806('0x80')],_0xf58d8a['bucket'],_0x4611c4[_0x8806('0x4f')],_0xf58d8a[_0x8806('0x86')]);}else{logger['info'](util[_0x8806('0x2f')](_0x8806('0x92'),_0x3dd709['params']['id']));return{'transcribeStatus':_0x8806('0x93')};}})[_0x8806('0x1f')](function(_0x1b5568){if(_0x1b5568){_0x1b5568[_0x8806('0x94')]=_0x3dd709['body'][_0x8806('0x82')];return _0x4611c4['updateAttributes'](_0x1b5568);}})[_0x8806('0x1f')](respondWithResult(_0x34ced4,null))[_0x8806('0x49')](handleError(_0x34ced4,null));};function writeFile(_0x548f27,_0xb85128){return new Promise(function(_0x12588e,_0x448afa){fs[_0x8806('0x95')](_0xb85128,_0x548f27,function(_0x3b8e90,_0x2a169b){if(_0x3b8e90){return _0x448afa(_0x3b8e90);}else{return _0x12588e(_0x2a169b);}});});}exports[_0x8806('0x96')]=function(_0x5823a7,_0x23977f,_0x2cbf41){return db[_0x8806('0x28')]['findOne']({'where':{'id':_0x5823a7[_0x8806('0x47')]['id']}})['then'](handleEntityNotFound(_0x23977f))[_0x8806('0x1f')](function(_0x9a0a6){if(_0x9a0a6&&_0x9a0a6['fileText']){var _0x172c9d=_0x9a0a6[_0x8806('0x97')];var _0x444a52=config[_0x8806('0x98')]+_0x8806('0x99')+_0x9a0a6['id']+_0x8806('0x9a');if(fs['existsSync'](_0x444a52)){return _0x444a52;}return writeFile(_0x172c9d,_0x444a52)['then'](function(){return _0x444a52;});}else{throw new db[(_0x8806('0x61'))][(_0x8806('0x54'))](_0x8806('0x9b'));}})[_0x8806('0x1f')](function(_0x4a8924){return _0x23977f['download'](_0x4a8924);})[_0x8806('0x49')](handleError(_0x23977f));};
\ No newline at end of file
+var _0x069a=['VIRTUAL','options','include','VoiceRecording','findAll','rows','catch','show','params','includeAll','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','extname','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','isNil','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','findOne','recording','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','Transcript\x20not\x20available','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','then','error','stack','name','send','index','map','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge'];(function(_0x5a09f3,_0x3827bb){var _0x5e6ce6=function(_0x3800fc){while(--_0x3800fc){_0x5a09f3['push'](_0x5a09f3['shift']());}};_0x5e6ce6(++_0x3827bb);}(_0x069a,0x18a));var _0xa069=function(_0x614e40,_0x2fbc7d){_0x614e40=_0x614e40-0x0;var _0x4a38b8=_0x069a[_0x614e40];return _0x4a38b8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa069('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa069('0x1'));var rp=require(_0xa069('0x2'));var moment=require(_0xa069('0x3'));var BPromise=require(_0xa069('0x4'));var Mustache=require('mustache');var util=require(_0xa069('0x5'));var path=require(_0xa069('0x6'));var sox=require(_0xa069('0x7'));var csv=require(_0xa069('0x8'));var ejs=require(_0xa069('0x9'));var fs=require('fs');var _=require(_0xa069('0xa'));var squel=require(_0xa069('0xb'));var crypto=require('crypto');var jsforce=require(_0xa069('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa069('0x8'));var querystring=require(_0xa069('0xd'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xa069('0xe'));var Redis=require(_0xa069('0xf'));var authService=require(_0xa069('0x10'));var qs=require(_0xa069('0x11'));var as=require(_0xa069('0x12'));var hardwareService=require(_0xa069('0x13'));var logger=require(_0xa069('0x14'))(_0xa069('0x15'));var utils=require('../../config/utils');var config=require(_0xa069('0x16'));var db=require(_0xa069('0x17'))['db'];function respondWithStatusCode(_0x4d90c6,_0x11866b){_0x11866b=_0x11866b||0xcc;return function(_0x403166){if(_0x403166){return _0x4d90c6[_0xa069('0x18')](_0x11866b);}return _0x4d90c6[_0xa069('0x19')](_0x11866b)[_0xa069('0x1a')]();};}function respondWithResult(_0x149077,_0x3158ef){_0x3158ef=_0x3158ef||0xc8;return function(_0x5be59c){if(_0x5be59c){return _0x149077['status'](_0x3158ef)['json'](_0x5be59c);}};}function respondWithFilteredResult(_0x41f6bc,_0x32bc56){return function(_0x7b009f){if(_0x7b009f){var _0x4eff22=_0x7b009f[_0xa069('0x1b')],_0x3fcee4=_0x32bc56[_0xa069('0x1c')],_0x51bf94=_0x32bc56[_0xa069('0x1c')]+_0x32bc56[_0xa069('0x1d')],_0x1549dc;if(_0x51bf94>=_0x4eff22){_0x51bf94=_0x4eff22;_0x1549dc=0xc8;}else{_0x1549dc=0xce;}_0x41f6bc[_0xa069('0x19')](_0x1549dc);return _0x41f6bc['set'](_0xa069('0x1e'),_0x3fcee4+'-'+_0x51bf94+'/'+_0x4eff22)[_0xa069('0x1f')](_0x7b009f);}return null;};}function patchUpdates(_0xe412b0){return function(_0x18e3a5){try{jsonpatch[_0xa069('0x20')](_0x18e3a5,_0xe412b0,!![]);}catch(_0x283b1){return BPromise[_0xa069('0x21')](_0x283b1);}return _0x18e3a5['save']();};}function saveUpdates(_0x423295,_0x1940b7){return function(_0x384f84){if(_0x384f84){return _0x384f84['update'](_0x423295)['then'](function(_0x29e3f6){return _0x29e3f6;});}return null;};}function removeEntity(_0x469ebb,_0x2a9e8b){return function(_0x51d78e){if(_0x51d78e){return _0x51d78e['destroy']()[_0xa069('0x22')](function(){_0x469ebb[_0xa069('0x19')](0xcc)[_0xa069('0x1a')]();});}};}function handleEntityNotFound(_0x490229,_0x226573){return function(_0x4f50f9){if(!_0x4f50f9){_0x490229[_0xa069('0x18')](0x194);}return _0x4f50f9;};}function handleError(_0x1c70c9,_0x17a43f){_0x17a43f=_0x17a43f||0x1f4;return function(_0x2436b8){logger[_0xa069('0x23')](_0x2436b8[_0xa069('0x24')]);if(_0x2436b8[_0xa069('0x25')]){delete _0x2436b8[_0xa069('0x25')];}_0x1c70c9[_0xa069('0x19')](_0x17a43f)[_0xa069('0x26')](_0x2436b8);};}exports[_0xa069('0x27')]=function(_0x552946,_0x32227c){var _0x4226f5={},_0x281fd3={},_0x3bbea2={'count':0x0,'rows':[]};var _0x204f6e=_[_0xa069('0x28')](db['VoiceRecording']['rawAttributes'],function(_0x1c3a00){return{'name':_0x1c3a00[_0xa069('0x29')],'type':_0x1c3a00[_0xa069('0x2a')][_0xa069('0x2b')]};});_0x281fd3[_0xa069('0x2c')]=_[_0xa069('0x2d')](_[_0xa069('0x28')](_0x204f6e,_0xa069('0x25')),['format']);_0x281fd3[_0xa069('0x2e')]=_[_0xa069('0x2f')](_0x552946[_0xa069('0x2e')]);_0x281fd3['filters']=_[_0xa069('0x30')](_0x281fd3[_0xa069('0x2c')],_0x281fd3['query']);_0x4226f5[_0xa069('0x31')]=_[_0xa069('0x30')](_0x281fd3[_0xa069('0x2c')],qs['fields'](_0x552946[_0xa069('0x2e')][_0xa069('0x32')]));_0x4226f5[_0xa069('0x31')]=_0x4226f5['attributes'][_0xa069('0x33')]?_0x4226f5[_0xa069('0x31')]:_0x281fd3[_0xa069('0x2c')];if(!_0x552946[_0xa069('0x2e')][_0xa069('0x34')]('nolimit')){_0x4226f5[_0xa069('0x1d')]=qs[_0xa069('0x1d')](_0x552946[_0xa069('0x2e')]['limit']);_0x4226f5['offset']=qs['offset'](_0x552946['query'][_0xa069('0x1c')]);}_0x4226f5[_0xa069('0x35')]=qs[_0xa069('0x36')](_0x552946[_0xa069('0x2e')][_0xa069('0x36')]);_0x4226f5[_0xa069('0x37')]=qs[_0xa069('0x38')](_['pick'](_0x552946[_0xa069('0x2e')],_0x281fd3[_0xa069('0x38')]),_0x204f6e);if(_0x552946['query'][_0xa069('0x39')]){_0x4226f5['where']=_[_0xa069('0x3a')](_0x4226f5[_0xa069('0x37')],{'$or':_[_0xa069('0x28')](_0x204f6e,function(_0x5ca793){if(_0x5ca793[_0xa069('0x2a')]!==_0xa069('0x3b')){var _0x3afb8e={};_0x3afb8e[_0x5ca793[_0xa069('0x25')]]={'$like':'%'+_0x552946[_0xa069('0x2e')][_0xa069('0x39')]+'%'};return _0x3afb8e;}})});}_0x4226f5=_['merge']({},_0x4226f5,_0x552946[_0xa069('0x3c')]);var _0x1a42c4={'where':_0x4226f5[_0xa069('0x37')]};return db['VoiceRecording'][_0xa069('0x1b')](_0x1a42c4)['then'](function(_0x29b43b){_0x3bbea2['count']=_0x29b43b;if(_0x552946['query']['includeAll']){_0x4226f5[_0xa069('0x3d')]=[{'all':!![]}];}return db[_0xa069('0x3e')][_0xa069('0x3f')](_0x4226f5);})['then'](function(_0x2419a8){_0x3bbea2[_0xa069('0x40')]=_0x2419a8;return _0x3bbea2;})[_0xa069('0x22')](respondWithFilteredResult(_0x32227c,_0x4226f5))[_0xa069('0x41')](handleError(_0x32227c,null));};exports[_0xa069('0x42')]=function(_0x38ad26,_0x49219e){var _0x517ec7={'raw':![],'where':{'id':_0x38ad26[_0xa069('0x43')]['id']}},_0x5cfd53={};_0x5cfd53[_0xa069('0x2c')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x5cfd53[_0xa069('0x2e')]=_[_0xa069('0x2f')](_0x38ad26[_0xa069('0x2e')]);_0x5cfd53[_0xa069('0x38')]=_[_0xa069('0x30')](_0x5cfd53['model'],_0x5cfd53['query']);_0x517ec7[_0xa069('0x31')]=_[_0xa069('0x30')](_0x5cfd53[_0xa069('0x2c')],qs['fields'](_0x38ad26[_0xa069('0x2e')][_0xa069('0x32')]));_0x517ec7[_0xa069('0x31')]=_0x517ec7['attributes'][_0xa069('0x33')]?_0x517ec7[_0xa069('0x31')]:_0x5cfd53[_0xa069('0x2c')];if(_0x38ad26[_0xa069('0x2e')][_0xa069('0x44')]){_0x517ec7['include']=[{'all':!![]}];}_0x517ec7=_[_0xa069('0x3a')]({},_0x517ec7,_0x38ad26[_0xa069('0x3c')]);return db[_0xa069('0x3e')][_0xa069('0x45')](_0x517ec7)['then'](handleEntityNotFound(_0x49219e,null))[_0xa069('0x22')](respondWithResult(_0x49219e,null))[_0xa069('0x41')](handleError(_0x49219e,null));};exports['create']=function(_0x5aa0da,_0x4e9d61){return db['VoiceRecording'][_0xa069('0x46')](_0x5aa0da[_0xa069('0x47')],{})[_0xa069('0x22')](respondWithResult(_0x4e9d61,0xc9))['catch'](handleError(_0x4e9d61,null));};exports['update']=function(_0x181134,_0x29cce6){if(_0x181134[_0xa069('0x47')]['id']){delete _0x181134['body']['id'];}return db[_0xa069('0x3e')][_0xa069('0x45')]({'where':{'id':_0x181134['params']['id']}})['then'](handleEntityNotFound(_0x29cce6,null))[_0xa069('0x22')](saveUpdates(_0x181134[_0xa069('0x47')],null))[_0xa069('0x22')](respondWithResult(_0x29cce6,null))[_0xa069('0x41')](handleError(_0x29cce6,null));};exports[_0xa069('0x48')]=function(_0x58d252,_0x426242){return db['VoiceRecording'][_0xa069('0x48')]()[_0xa069('0x22')](respondWithResult(_0x426242,null))[_0xa069('0x41')](handleError(_0x426242,null));};exports[_0xa069('0x49')]=function(_0x4011bd,_0x20af49,_0x599986){var _0x62efb1=require(_0xa069('0x4a'));var _0x20d9b1=![];var _0x46c602={};if(_0x4011bd['query'][_0xa069('0x2a')]&&_0x4011bd['query']['type']===_0xa069('0x4b')){_0x46c602[_0xa069('0x4b')]=_0x4011bd[_0xa069('0x43')]['id'];}else{_0x46c602['id']=_0x4011bd[_0xa069('0x43')]['id'];}return db[_0xa069('0x3e')][_0xa069('0x45')]({'where':_0x46c602,'attributes':['id',_0xa069('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x20af49,null))[_0xa069('0x22')](function(_0x26f84a){if(_0x26f84a){var _0x5bbd72=_0x26f84a['value'];var _0x2221b9=util[_0xa069('0x4d')](_0xa069('0x4e'),_0x5bbd72);if(fs[_0xa069('0x4f')](_0x2221b9)){_0x20d9b1=!![];return _0x62efb1[_0xa069('0x50')](_0x2221b9,_0x5bbd72,config[_0xa069('0x51')]['recording'])['then'](function(){return _0x26f84a;});}return _0x26f84a;}})[_0xa069('0x22')](function(_0x45ec5e){if(_0x45ec5e){var _0x17864a=_0x45ec5e[_0xa069('0x4c')];if(!fs[_0xa069('0x4f')](_0x17864a)){throw new db[(_0xa069('0x52'))][(_0xa069('0x53'))](_0xa069('0x54'));}if(_0x45ec5e[_0xa069('0x55')]){return _0x20af49[_0xa069('0x49')](_0x17864a,_0x45ec5e[_0xa069('0x55')]+path['extname'](_0x17864a),function(){if(_0x20d9b1){fs[_0xa069('0x56')](_0x17864a);}});}else{return _0x20af49[_0xa069('0x49')](_0x17864a,function(_0xb9be9){if(_0x20d9b1){fs[_0xa069('0x56')](_0x17864a);}});}}})[_0xa069('0x41')](function(_0x418010){if(_0x418010[_0xa069('0x57')]===_0xa069('0x54')){_0x20af49[_0xa069('0x19')](0x194)[_0xa069('0x26')](_0xa069('0x58'));}else{return handleError(_0x20af49,null);}});};exports[_0xa069('0x59')]=function(_0x3e8301,_0x5ebb8e,_0x58add4){var _0x19670d=require('../../components/encryptor');var _0x4852b2=![];var _0x51e039={'$and':[db[_0xa069('0x5a')][_0xa069('0x37')](db['sequelize']['fn'](_0xa069('0x5b'),db[_0xa069('0x5a')][_0xa069('0x5c')]('uniqueid')),_0x3e8301[_0xa069('0x2e')][_0xa069('0x5d')])]};if(_0x3e8301[_0xa069('0x2e')][_0xa069('0x2a')]&&_0x3e8301[_0xa069('0x2e')][_0xa069('0x2a')]===_0xa069('0x4b')){_0x51e039[_0xa069('0x5e')][_0xa069('0x5f')]({'uniqueid':_0x3e8301[_0xa069('0x43')]['id']});}else{_0x51e039[_0xa069('0x5e')][_0xa069('0x5f')]({'id':_0x3e8301[_0xa069('0x43')]['id']});}return db[_0xa069('0x3e')][_0xa069('0x45')]({'where':_0x51e039,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x5ebb8e,null))[_0xa069('0x22')](function(_0x434abb){if(_0x434abb){var _0x2aba03=util[_0xa069('0x4d')](_0xa069('0x4e'),_0x434abb[_0xa069('0x4c')]);if(fs['existsSync'](_0x2aba03)){_0x4852b2=!![];return _0x19670d[_0xa069('0x50')](_0x2aba03,_0x434abb[_0xa069('0x4c')],config[_0xa069('0x51')]['recording'])[_0xa069('0x22')](function(){return _0x434abb;});}return _0x434abb;}})['then'](function(_0x13196b){if(_0x13196b){if(!fs[_0xa069('0x4f')](_0x13196b[_0xa069('0x4c')])){throw new db[(_0xa069('0x52'))]['ValidationError'](_0xa069('0x54'));}if(_0x13196b[_0xa069('0x55')]){return _0x5ebb8e['download'](_0x13196b['value'],_0x13196b[_0xa069('0x55')]+path[_0xa069('0x60')](_0x13196b['value']),function(){if(_0x4852b2){fs[_0xa069('0x56')](_0x13196b[_0xa069('0x4c')]);}});}else{return _0x5ebb8e[_0xa069('0x49')](_0x13196b[_0xa069('0x4c')],function(_0xac37){if(_0x4852b2){fs[_0xa069('0x56')](_0x13196b[_0xa069('0x4c')]);}});}}})[_0xa069('0x41')](handleError(_0x5ebb8e,null));};exports[_0xa069('0x61')]=function(_0x2beecb,_0x725be8){return db[_0xa069('0x3e')][_0xa069('0x45')]({'where':{'id':_0x2beecb['params']['id']}})[_0xa069('0x22')](function(_0x999192){if(!_0x999192)throw new ReferenceError(_0xa069('0x62'));return _0x999192;})['then'](function(_0x445e77){var _0x59e745=_0x445e77[_0xa069('0x4c')];logger[_0xa069('0x63')](_0xa069('0x64'),_0x59e745);if(!_['isNil'](_0x445e77[_0xa069('0x4c')])&&fs[_0xa069('0x4f')](_0x59e745)){logger[_0xa069('0x63')](_0xa069('0x65')+_0x59e745+_0xa069('0x66'));fs['unlinkSync'](_0x59e745);}_0x59e745=_0x59e745+_0xa069('0x67');if(!_[_0xa069('0x68')](_0x445e77[_0xa069('0x4c')])&&fs[_0xa069('0x4f')](_0x59e745)){logger['info']('File:\x20\x22'+_0x59e745+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa069('0x69')](_0x59e745);}return _0x445e77;})[_0xa069('0x22')](function(_0x2ce6a8){if(!_0x2ce6a8)throw new InternalError();return _0x2ce6a8[_0xa069('0x61')]();})[_0xa069('0x22')](function(){_0x725be8[_0xa069('0x19')](0xcc)[_0xa069('0x1a')]();})[_0xa069('0x41')](handleError(_0x725be8,null));};function getBucketslist(_0x12796b,_0x2c2a24,_0x2b94bb){return new Promise(function(_0x27d7c5,_0x25d1d0){var _0x39bb4a=new AWS['S3']({'accessKeyId':_0x2c2a24,'secretAccessKey':_0x12796b,'region':_0x2b94bb});_0x39bb4a[_0xa069('0x6a')]({},function(_0x5ebd4f,_0x382b56){if(_0x5ebd4f){return _0x25d1d0(_0x5ebd4f);}else{return _0x27d7c5(_0x382b56);}});});}function createBucket(_0x5a66a7,_0x534429,_0x585af5,_0x23ce8e){return new Promise(function(_0x35984e,_0x1396ba){var _0x583ee4=new AWS['S3']({'accessKeyId':_0x534429,'secretAccessKey':_0x5a66a7,'region':_0x585af5});_0x583ee4[_0xa069('0x6b')]({'Bucket':_0x23ce8e},function(_0x544229,_0x21b059){if(_0x544229){return _0x1396ba(_0x544229);}else{return _0x35984e(_0x21b059);}});});}function uploadFile(_0x5d2225,_0x3315c1,_0x5d40d6,_0xf27c66,_0xb65990,_0x4d392c){return new Promise(function(_0x344019,_0x1a92d5){var _0x3e4be3=new AWS['S3']({'accessKeyId':_0x3315c1,'secretAccessKey':_0x5d2225,'region':_0x5d40d6});_0x3e4be3[_0xa069('0x6c')]({'Bucket':_0xf27c66,'Key':_0xb65990,'Body':_0x4d392c},function(_0x586a59,_0x49cfdc){if(_0x586a59){return _0x1a92d5(_0x586a59);}else{return _0x344019(_0x49cfdc);}});});}function startTranscribe(_0x44c81a,_0x3bc943,_0x23da01,_0x36efe8,_0x5e791d,_0x508b80){return new Promise(function(_0x4227b0,_0x106888){var _0x2eadc1=new AWS[(_0xa069('0x6d'))]({'accessKeyId':_0x3bc943,'secretAccessKey':_0x44c81a,'region':_0x23da01});_0x2eadc1[_0xa069('0x6e')]({'TranscriptionJobName':_0x36efe8,'LanguageCode':_0x5e791d,'Media':{'MediaFileUri':_0x508b80}},function(_0x5f1401,_0x343618){if(_0x5f1401){return _0x106888(_0x5f1401);}else{return _0x4227b0(_0x343618);}});});}function transcribe(_0x3c3918,_0xec24ec,_0x12af1e,_0x234d99,_0xb08eea,_0x477eb6,_0x4b24c3){return new Promise(function(_0x4b8308,_0x391a23){var _0x4e3f67={};logger[_0xa069('0x63')](util[_0xa069('0x4d')](_0xa069('0x6f'),_0x3c3918,_0xb08eea));return uploadFile(_0xec24ec,_0x12af1e,_0x234d99,_0xb08eea,path[_0xa069('0x70')](_0x477eb6),fs[_0xa069('0x71')](_0x477eb6))['then'](function(_0x60d941){logger['info'](util[_0xa069('0x4d')](_0xa069('0x72'),_0x3c3918,_0xb08eea,_0x60d941['Location']));_0x4e3f67[_0xa069('0x73')]=_0x60d941['Bucket'];_0x4e3f67[_0xa069('0x74')]=_0x60d941[_0xa069('0x75')];logger[_0xa069('0x63')](util[_0xa069('0x4d')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x3c3918));return startTranscribe(_0xec24ec,_0x12af1e,_0x234d99,uuidv4(),_0x4b24c3,_0x60d941[_0xa069('0x75')]);})[_0xa069('0x22')](function(_0x52d327){logger['info'](util['format'](_0xa069('0x76'),_0x3c3918,_0x52d327[_0xa069('0x77')][_0xa069('0x78')]));_0x4e3f67[_0xa069('0x79')]=_0x52d327[_0xa069('0x77')]['TranscriptionJobName'];_0x4e3f67[_0xa069('0x7a')]=_0x52d327[_0xa069('0x77')]['TranscriptionJobStatus'];return _0x4b8308(_0x4e3f67);})[_0xa069('0x41')](function(_0x3e615a){return _0x391a23(_0x3e615a);});});}exports['runTranscribe']=function(_0x12a560,_0x293ced,_0x4e37c2){var _0x34e2f0;var _0x3e81d8;var _0x159d4a;var _0x2b0e5e=require('../../components/encryptor');return db['VoiceRecording'][_0xa069('0x7b')]({'where':{'id':_0x12a560[_0xa069('0x43')]['id']}})[_0xa069('0x22')](function(_0x11fa65){if(_0x11fa65){var _0x571695=util[_0xa069('0x4d')](_0xa069('0x4e'),_0x11fa65[_0xa069('0x4c')]);if(fs['existsSync'](_0x571695)){cypher=!![];return _0x2b0e5e[_0xa069('0x50')](_0x571695,_0x11fa65[_0xa069('0x4c')],config['secrets'][_0xa069('0x7c')])[_0xa069('0x22')](function(){return _0x11fa65;});}return _0x11fa65;}})[_0xa069('0x22')](function(_0x3beb3e){if(!_0x3beb3e){throw new db[(_0xa069('0x52'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x3e81d8=_0x3beb3e;return db[_0xa069('0x7d')][_0xa069('0x7b')]({'where':{'id':0x1}});})[_0xa069('0x22')](handleEntityNotFound(_0x293ced,null))[_0xa069('0x22')](function(_0x5d9b74){if(_0x5d9b74){_0x34e2f0=_0x5d9b74;if(!_0x34e2f0['transcribe']||!_0x34e2f0[_0xa069('0x7e')]||!_0x34e2f0[_0xa069('0x7f')]||!_0x34e2f0[_0xa069('0x80')]||!_0x34e2f0['bucket']){throw new db[(_0xa069('0x52'))]['ValidationError'](_0xa069('0x81'));}if(_0x12a560[_0xa069('0x47')][_0xa069('0x82')]&&(!_0x34e2f0[_0xa069('0x83')]||!_0x34e2f0[_0xa069('0x84')]||!_0x34e2f0[_0xa069('0x85')]||!_0x34e2f0['language']||!_0x34e2f0[_0xa069('0x73')])){throw new db['Sequelize'][(_0xa069('0x53'))](_0xa069('0x86'));}return db[_0xa069('0x87')][_0xa069('0x7b')]({'where':{'id':_0x34e2f0[_0xa069('0x7e')]}});}})[_0xa069('0x22')](function(_0x35c4cc){if(!_0x35c4cc){throw new db[(_0xa069('0x52'))][(_0xa069('0x53'))](_0xa069('0x88'));}if(!_0x35c4cc[_0xa069('0x89')]||!_0x35c4cc[_0xa069('0x8a')]){throw new db[(_0xa069('0x52'))][(_0xa069('0x53'))]('Cloud\x20Provider\x20not\x20configured');}_0x159d4a=_0x35c4cc;return getBucketslist(_0x159d4a[_0xa069('0x89')],_0x159d4a[_0xa069('0x8a')],_0x34e2f0['transcribeRegion']);})[_0xa069('0x22')](function(_0x3f9bad){if(_0x3f9bad&&_0x3f9bad[_0xa069('0x8b')]){var _0x45b926=_[_0xa069('0x45')](_0x3f9bad[_0xa069('0x8b')],function(_0x1453b8){return _0x1453b8[_0xa069('0x8c')]===_0x34e2f0[_0xa069('0x73')];});if(!_0x45b926){logger[_0xa069('0x63')](util[_0xa069('0x4d')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x12a560[_0xa069('0x43')]['id'],_0x34e2f0['bucket']));return createBucket(_0x159d4a[_0xa069('0x89')],_0x159d4a[_0xa069('0x8a')],_0x34e2f0[_0xa069('0x7f')],_0x34e2f0['bucket']);}logger[_0xa069('0x63')](util[_0xa069('0x4d')](_0xa069('0x8d'),_0x12a560[_0xa069('0x43')]['id'],_0x34e2f0['bucket']));return;}})[_0xa069('0x22')](function(_0x57d9d6){if(_0x3e81d8[_0xa069('0x7a')]===_0xa069('0x8e')){return transcribe(_0x12a560[_0xa069('0x43')]['id'],_0x159d4a[_0xa069('0x89')],_0x159d4a[_0xa069('0x8a')],_0x34e2f0[_0xa069('0x7f')],_0x34e2f0['bucket'],_0x3e81d8[_0xa069('0x4c')],_0x34e2f0[_0xa069('0x80')]);}else{logger[_0xa069('0x63')](util['format'](_0xa069('0x8f'),_0x12a560[_0xa069('0x43')]['id']));return{'transcribeStatus':_0xa069('0x90')};}})[_0xa069('0x22')](function(_0x247756){if(_0x247756){_0x247756[_0xa069('0x91')]=_0x12a560[_0xa069('0x47')][_0xa069('0x82')];return _0x3e81d8[_0xa069('0x92')](_0x247756);}})[_0xa069('0x22')](respondWithResult(_0x293ced,null))['catch'](handleError(_0x293ced,null));};function writeFile(_0x166cfa,_0x1c4eca){return new Promise(function(_0x1f24b6,_0x5c2654){fs[_0xa069('0x93')](_0x1c4eca,_0x166cfa,function(_0x518f94,_0x232c82){if(_0x518f94){return _0x5c2654(_0x518f94);}else{return _0x1f24b6(_0x232c82);}});});}exports[_0xa069('0x94')]=function(_0x473d89,_0x4e3bd1,_0x2c57e2){return db[_0xa069('0x3e')][_0xa069('0x7b')]({'where':{'id':_0x473d89['params']['id']}})[_0xa069('0x22')](handleEntityNotFound(_0x4e3bd1))['then'](function(_0x56fa91){if(_0x56fa91&&_0x56fa91[_0xa069('0x95')]){var _0x2146a4=_0x56fa91['fileText'];var _0xc50a6=config['root']+'/server/files/transcribes/transcribe_'+_0x56fa91['id']+'.txt';if(fs[_0xa069('0x4f')](_0xc50a6)){return _0xc50a6;}return writeFile(_0x2146a4,_0xc50a6)[_0xa069('0x22')](function(){return _0xc50a6;});}else{throw new db['Sequelize'][(_0xa069('0x53'))](_0xa069('0x96'));}})[_0xa069('0x22')](function(_0x3e6cec){return _0x4e3bd1[_0xa069('0x49')](_0x3e6cec);})[_0xa069('0x41')](handleError(_0x4e3bd1));};
\ No newline at end of file
index 5ee6849..8cff122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x811c=['lodash','api','moment','bluebird','path','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid'];(function(_0x11b4ac,_0x163e0e){var _0x486d64=function(_0x30a94d){while(--_0x30a94d){_0x11b4ac['push'](_0x11b4ac['shift']());}};_0x486d64(++_0x163e0e);}(_0x811c,0x181));var _0xc811=function(_0x157c98,_0x39e3bc){_0x157c98=_0x157c98-0x0;var _0x21461d=_0x811c[_0x157c98];return _0x21461d;};'use strict';var _=require(_0xc811('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc811('0x1'));var moment=require(_0xc811('0x2'));var BPromise=require(_0xc811('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc811('0x4'));var rimraf=require('rimraf');var config=require(_0xc811('0x5'));var attributes=require(_0xc811('0x6'));module[_0xc811('0x7')]=function(_0x3fc088,_0x26384c){return _0x3fc088[_0xc811('0x8')]('VoiceRecording',attributes,{'tableName':_0xc811('0x9'),'paranoid':![],'indexes':[{'name':_0xc811('0xa'),'fields':[_0xc811('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf256=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','uniqueid'];(function(_0xd5acfb,_0x1747f8){var _0x3cdb89=function(_0x500377){while(--_0x500377){_0xd5acfb['push'](_0xd5acfb['shift']());}};_0x3cdb89(++_0x1747f8);}(_0xf256,0x1a4));var _0x6f25=function(_0x6e5096,_0x4913da){_0x6e5096=_0x6e5096-0x0;var _0x2a85fc=_0xf256[_0x6e5096];return _0x2a85fc;};'use strict';var _=require(_0x6f25('0x0'));var util=require(_0x6f25('0x1'));var logger=require('../../config/logger')(_0x6f25('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f25('0x3'));var fs=require('fs');var path=require(_0x6f25('0x4'));var rimraf=require(_0x6f25('0x5'));var config=require(_0x6f25('0x6'));var attributes=require(_0x6f25('0x7'));module[_0x6f25('0x8')]=function(_0x4ae4d6,_0x47567e){return _0x4ae4d6['define']('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6f25('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index a2e05cb..1647c00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x53210a,_0x4a49f1){var _0x82411c=function(_0x2208ef){while(--_0x2208ef){_0x53210a['push'](_0x53210a['shift']());}};_0x82411c(++_0x4a49f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x51ec5c,_0x3506ef){var _0x5b04b8=function(_0x2e741f){while(--_0x2e741f){_0x51ec5c['push'](_0x51ec5c['shift']());}};_0x5b04b8(++_0x3506ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});};
\ No newline at end of file
index 5d8ec46..1bf16f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x13de57,_0x265125){_0x13de57=_0x13de57-0x0;var _0x497da7=_0xc6ac[_0x13de57];return _0x497da7;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var auth=require(_0xcc6a('0x6'));var interaction=require(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));var controller=require(_0xcc6a('0x9'));router[_0xcc6a('0xa')]('/',auth[_0xcc6a('0xb')](),controller[_0xcc6a('0xc')]);router[_0xcc6a('0xa')]('/:id',auth[_0xcc6a('0xb')](),controller[_0xcc6a('0xd')]);router[_0xcc6a('0xe')]('/',auth['isAuthenticated'](),controller[_0xcc6a('0xf')]);router[_0xcc6a('0x10')](_0xcc6a('0x11'),auth[_0xcc6a('0xb')](),controller[_0xcc6a('0x12')]);router['delete'](_0xcc6a('0x11'),auth[_0xcc6a('0xb')](),controller[_0xcc6a('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x2542=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy'];(function(_0x4ada50,_0x54757b){var _0x3d85d5=function(_0x359a61){while(--_0x359a61){_0x4ada50['push'](_0x4ada50['shift']());}};_0x3d85d5(++_0x54757b);}(_0x2542,0x169));var _0x2254=function(_0x3e31f9,_0x2fc25e){_0x3e31f9=_0x3e31f9-0x0;var _0x429e15=_0x2542[_0x3e31f9];return _0x429e15;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2254('0x5'));var config=require(_0x2254('0x6'));var controller=require(_0x2254('0x7'));router[_0x2254('0x8')]('/',auth[_0x2254('0x9')](),controller['index']);router[_0x2254('0x8')](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0xb')]);router[_0x2254('0xc')]('/',auth[_0x2254('0x9')](),controller[_0x2254('0xd')]);router[_0x2254('0xe')](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0xf')]);router['delete'](_0x2254('0xa'),auth[_0x2254('0x9')](),controller[_0x2254('0x10')]);module[_0x2254('0x11')]=router;
\ No newline at end of file
index 4b3a7e9..3c3c2b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c19=['exports','blind','attended','STRING','ENUM','sequelize','moment'];(function(_0x1930f7,_0x49aabf){var _0x19d047=function(_0x4a7a8e){while(--_0x4a7a8e){_0x1930f7['push'](_0x1930f7['shift']());}};_0x19d047(++_0x49aabf);}(_0x4c19,0x1da));var _0x94c1=function(_0x4358cb,_0x1f1c23){_0x4358cb=_0x4358cb-0x0;var _0x59a7e4=_0x4c19[_0x4358cb];return _0x59a7e4;};'use strict';var Sequelize=require(_0x94c1('0x0'));var moment=require(_0x94c1('0x1'));module[_0x94c1('0x2')]={'type':{'type':Sequelize['ENUM'](_0x94c1('0x3'),_0x94c1('0x4'))},'result':{'type':Sequelize[_0x94c1('0x5')]},'transfererchannel':{'type':Sequelize[_0x94c1('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x94c1('0x5')]},'transferercalleridname':{'type':Sequelize[_0x94c1('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x94c1('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x94c1('0x5')]},'transferercontext':{'type':Sequelize[_0x94c1('0x5')]},'transfererexten':{'type':Sequelize[_0x94c1('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x94c1('0x5')]},'transfereechannel':{'type':Sequelize[_0x94c1('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x94c1('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x94c1('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x94c1('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x94c1('0x5')]},'transfereecontext':{'type':Sequelize[_0x94c1('0x5')]},'transfereeexten':{'type':Sequelize[_0x94c1('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x94c1('0x6')]('Yes','No')},'context':{'type':Sequelize[_0x94c1('0x5')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x524c=['moment','ENUM','attended','STRING','Yes'];(function(_0x516c00,_0x19f727){var _0x13ef00=function(_0x59d9bb){while(--_0x59d9bb){_0x516c00['push'](_0x516c00['shift']());}};_0x13ef00(++_0x19f727);}(_0x524c,0x6e));var _0xc524=function(_0xf374f3,_0x1d386a){_0xf374f3=_0xf374f3-0x0;var _0x3ed0cf=_0x524c[_0xf374f3];return _0x3ed0cf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc524('0x0'));module['exports']={'type':{'type':Sequelize[_0xc524('0x1')]('blind',_0xc524('0x2'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xc524('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xc524('0x3')]},'transferercalleridname':{'type':Sequelize[_0xc524('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xc524('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xc524('0x3')]},'transfererexten':{'type':Sequelize[_0xc524('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xc524('0x3')]},'transfereechannel':{'type':Sequelize[_0xc524('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xc524('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xc524('0x3')]},'transfereecontext':{'type':Sequelize[_0xc524('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xc524('0x3')]},'isexternal':{'type':Sequelize[_0xc524('0x1')](_0xc524('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xc524('0x3')]}};
\ No newline at end of file
index 6667fd0..002149e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd62=['merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','key','query','model','intersection','attributes','length','order','sort','filters','pick','filter','where'];(function(_0x8f55d9,_0x1b1b8d){var _0x164443=function(_0x496965){while(--_0x496965){_0x8f55d9['push'](_0x8f55d9['shift']());}};_0x164443(++_0x1b1b8d);}(_0xcd62,0x12f));var _0x2cd6=function(_0x4e70b3,_0x2bcddc){_0x4e70b3=_0x4e70b3-0x0;var _0x5e969a=_0xcd62[_0x4e70b3];return _0x5e969a;};'use strict';var pdf=require(_0x2cd6('0x0'));var emlformat=require(_0x2cd6('0x1'));var rimraf=require(_0x2cd6('0x2'));var zipdir=require(_0x2cd6('0x3'));var jsonpatch=require(_0x2cd6('0x4'));var rp=require(_0x2cd6('0x5'));var moment=require(_0x2cd6('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2cd6('0x7'));var sox=require(_0x2cd6('0x8'));var csv=require('to-csv');var ejs=require(_0x2cd6('0x9'));var fs=require('fs');var _=require(_0x2cd6('0xa'));var squel=require(_0x2cd6('0xb'));var crypto=require(_0x2cd6('0xc'));var jsforce=require(_0x2cd6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2cd6('0xe'));var querystring=require(_0x2cd6('0xf'));var Papa=require(_0x2cd6('0x10'));var Redis=require(_0x2cd6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2cd6('0x12'));var as=require(_0x2cd6('0x13'));var hardwareService=require(_0x2cd6('0x14'));var logger=require(_0x2cd6('0x15'))('api');var utils=require(_0x2cd6('0x16'));var config=require(_0x2cd6('0x17'));var db=require(_0x2cd6('0x18'))['db'];function respondWithStatusCode(_0x224fa9,_0x2239e2){_0x2239e2=_0x2239e2||0xcc;return function(_0x2e92d8){if(_0x2e92d8){return _0x224fa9[_0x2cd6('0x19')](_0x2239e2);}return _0x224fa9[_0x2cd6('0x1a')](_0x2239e2)[_0x2cd6('0x1b')]();};}function respondWithResult(_0x30ffb8,_0x5f5aa1){_0x5f5aa1=_0x5f5aa1||0xc8;return function(_0x4efcea){if(_0x4efcea){return _0x30ffb8[_0x2cd6('0x1a')](_0x5f5aa1)[_0x2cd6('0x1c')](_0x4efcea);}};}function respondWithFilteredResult(_0x2422bf,_0x5118ff){return function(_0x42b647){if(_0x42b647){var _0x34d09a=_0x42b647[_0x2cd6('0x1d')],_0x1e4c37=_0x5118ff['offset'],_0x2de60f=_0x5118ff[_0x2cd6('0x1e')]+_0x5118ff[_0x2cd6('0x1f')],_0x4fb7fb;if(_0x2de60f>=_0x34d09a){_0x2de60f=_0x34d09a;_0x4fb7fb=0xc8;}else{_0x4fb7fb=0xce;}_0x2422bf[_0x2cd6('0x1a')](_0x4fb7fb);return _0x2422bf[_0x2cd6('0x20')]('Content-Range',_0x1e4c37+'-'+_0x2de60f+'/'+_0x34d09a)['json'](_0x42b647);}return null;};}function patchUpdates(_0x1ec266){return function(_0x37e656){try{jsonpatch[_0x2cd6('0x21')](_0x37e656,_0x1ec266,!![]);}catch(_0x4f0521){return BPromise['reject'](_0x4f0521);}return _0x37e656['save']();};}function saveUpdates(_0xa138a9,_0x2e92d2){return function(_0x5b1c92){if(_0x5b1c92){return _0x5b1c92[_0x2cd6('0x22')](_0xa138a9)[_0x2cd6('0x23')](function(_0x4936f5){return _0x4936f5;});}return null;};}function removeEntity(_0x5f37a0,_0x5c4173){return function(_0x4dd6bd){if(_0x4dd6bd){return _0x4dd6bd[_0x2cd6('0x24')]()[_0x2cd6('0x23')](function(){_0x5f37a0[_0x2cd6('0x1a')](0xcc)[_0x2cd6('0x1b')]();});}};}function handleEntityNotFound(_0x4fd5f9,_0x48b853){return function(_0x4c10fe){if(!_0x4c10fe){_0x4fd5f9[_0x2cd6('0x19')](0x194);}return _0x4c10fe;};}function handleError(_0x40d8b1,_0x205833){_0x205833=_0x205833||0x1f4;return function(_0x1abee9){logger[_0x2cd6('0x25')](_0x1abee9[_0x2cd6('0x26')]);if(_0x1abee9[_0x2cd6('0x27')]){delete _0x1abee9[_0x2cd6('0x27')];}_0x40d8b1[_0x2cd6('0x1a')](_0x205833)[_0x2cd6('0x28')](_0x1abee9);};}exports[_0x2cd6('0x29')]=function(_0x46744d,_0x36ab83){var _0x3c9936={},_0x195394={},_0x5436e0={'count':0x0,'rows':[]};var _0x2e4a00=_[_0x2cd6('0x2a')](db[_0x2cd6('0x2b')][_0x2cd6('0x2c')],function(_0x22d634){return{'name':_0x22d634['fieldName'],'type':_0x22d634['type'][_0x2cd6('0x2d')]};});_0x195394['model']=_[_0x2cd6('0x2a')](_0x2e4a00,_0x2cd6('0x27'));_0x195394[_0x2cd6('0x2e')]=_['keys'](_0x46744d[_0x2cd6('0x2e')]);_0x195394['filters']=_['intersection'](_0x195394[_0x2cd6('0x2f')],_0x195394[_0x2cd6('0x2e')]);_0x3c9936['attributes']=_[_0x2cd6('0x30')](_0x195394['model'],qs['fields'](_0x46744d[_0x2cd6('0x2e')]['fields']));_0x3c9936[_0x2cd6('0x31')]=_0x3c9936['attributes'][_0x2cd6('0x32')]?_0x3c9936[_0x2cd6('0x31')]:_0x195394['model'];if(!_0x46744d[_0x2cd6('0x2e')]['hasOwnProperty']('nolimit')){_0x3c9936['limit']=qs['limit'](_0x46744d[_0x2cd6('0x2e')][_0x2cd6('0x1f')]);_0x3c9936['offset']=qs['offset'](_0x46744d[_0x2cd6('0x2e')][_0x2cd6('0x1e')]);}_0x3c9936[_0x2cd6('0x33')]=qs[_0x2cd6('0x34')](_0x46744d[_0x2cd6('0x2e')][_0x2cd6('0x34')]);_0x3c9936['where']=qs[_0x2cd6('0x35')](_[_0x2cd6('0x36')](_0x46744d['query'],_0x195394[_0x2cd6('0x35')]),_0x2e4a00);if(_0x46744d[_0x2cd6('0x2e')][_0x2cd6('0x37')]){_0x3c9936[_0x2cd6('0x38')]=_[_0x2cd6('0x39')](_0x3c9936[_0x2cd6('0x38')],{'$or':_[_0x2cd6('0x2a')](_0x2e4a00,function(_0x3b4f77){if(_0x3b4f77[_0x2cd6('0x3a')]!==_0x2cd6('0x3b')){var _0x5b5bc5={};_0x5b5bc5[_0x3b4f77[_0x2cd6('0x27')]]={'$like':'%'+_0x46744d[_0x2cd6('0x2e')]['filter']+'%'};return _0x5b5bc5;}})});}_0x3c9936=_[_0x2cd6('0x39')]({},_0x3c9936,_0x46744d['options']);var _0x5207f1={'where':_0x3c9936[_0x2cd6('0x38')]};return db[_0x2cd6('0x2b')]['count'](_0x5207f1)[_0x2cd6('0x23')](function(_0x4bdbe4){_0x5436e0[_0x2cd6('0x1d')]=_0x4bdbe4;if(_0x46744d[_0x2cd6('0x2e')][_0x2cd6('0x3c')]){_0x3c9936[_0x2cd6('0x3d')]=[{'all':!![]}];}return db[_0x2cd6('0x2b')][_0x2cd6('0x3e')](_0x3c9936);})['then'](function(_0x4b0e65){_0x5436e0[_0x2cd6('0x3f')]=_0x4b0e65;return _0x5436e0;})['then'](respondWithFilteredResult(_0x36ab83,_0x3c9936))[_0x2cd6('0x40')](handleError(_0x36ab83,null));};exports[_0x2cd6('0x41')]=function(_0x4c9f04,_0x194add){var _0x34cb9b={'raw':!![],'where':{'id':_0x4c9f04[_0x2cd6('0x42')]['id']}},_0x98faa1={};_0x98faa1[_0x2cd6('0x2f')]=_[_0x2cd6('0x43')](db[_0x2cd6('0x2b')]['rawAttributes']);_0x98faa1['query']=_[_0x2cd6('0x43')](_0x4c9f04[_0x2cd6('0x2e')]);_0x98faa1[_0x2cd6('0x35')]=_[_0x2cd6('0x30')](_0x98faa1['model'],_0x98faa1['query']);_0x34cb9b[_0x2cd6('0x31')]=_[_0x2cd6('0x30')](_0x98faa1[_0x2cd6('0x2f')],qs[_0x2cd6('0x44')](_0x4c9f04[_0x2cd6('0x2e')][_0x2cd6('0x44')]));_0x34cb9b[_0x2cd6('0x31')]=_0x34cb9b['attributes'][_0x2cd6('0x32')]?_0x34cb9b[_0x2cd6('0x31')]:_0x98faa1[_0x2cd6('0x2f')];if(_0x4c9f04[_0x2cd6('0x2e')][_0x2cd6('0x3c')]){_0x34cb9b[_0x2cd6('0x3d')]=[{'all':!![]}];}_0x34cb9b=_[_0x2cd6('0x39')]({},_0x34cb9b,_0x4c9f04['options']);return db[_0x2cd6('0x2b')][_0x2cd6('0x45')](_0x34cb9b)[_0x2cd6('0x23')](handleEntityNotFound(_0x194add,null))[_0x2cd6('0x23')](respondWithResult(_0x194add,null))[_0x2cd6('0x40')](handleError(_0x194add,null));};exports[_0x2cd6('0x46')]=function(_0x3b637e,_0x296c49){return db['VoiceTransferReport']['create'](_0x3b637e[_0x2cd6('0x47')],{})[_0x2cd6('0x23')](respondWithResult(_0x296c49,0xc9))[_0x2cd6('0x40')](handleError(_0x296c49,null));};exports[_0x2cd6('0x22')]=function(_0x2ac819,_0x234d37){if(_0x2ac819[_0x2cd6('0x47')]['id']){delete _0x2ac819[_0x2cd6('0x47')]['id'];}return db[_0x2cd6('0x2b')][_0x2cd6('0x45')]({'where':{'id':_0x2ac819[_0x2cd6('0x42')]['id']}})['then'](handleEntityNotFound(_0x234d37,null))['then'](saveUpdates(_0x2ac819['body'],null))[_0x2cd6('0x23')](respondWithResult(_0x234d37,null))[_0x2cd6('0x40')](handleError(_0x234d37,null));};exports['destroy']=function(_0x42eac4,_0x4b329b){return db[_0x2cd6('0x2b')][_0x2cd6('0x45')]({'where':{'id':_0x42eac4[_0x2cd6('0x42')]['id']}})[_0x2cd6('0x23')](handleEntityNotFound(_0x4b329b,null))[_0x2cd6('0x23')](removeEntity(_0x4b329b,null))[_0x2cd6('0x40')](handleError(_0x4b329b,null));};
\ No newline at end of file
+var _0x39e2=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','params','find','catch','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceTransferReport','rawAttributes','type','key','model','query','keys','intersection'];(function(_0x5a5f06,_0x18fb01){var _0x3e43ae=function(_0x4b73f7){while(--_0x4b73f7){_0x5a5f06['push'](_0x5a5f06['shift']());}};_0x3e43ae(++_0x18fb01);}(_0x39e2,0x1ae));var _0x239e=function(_0x300191,_0x48ea3b){_0x300191=_0x300191-0x0;var _0x2e9066=_0x39e2[_0x300191];return _0x2e9066;};'use strict';var pdf=require(_0x239e('0x0'));var emlformat=require(_0x239e('0x1'));var rimraf=require(_0x239e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x239e('0x3'));var rp=require(_0x239e('0x4'));var moment=require(_0x239e('0x5'));var BPromise=require(_0x239e('0x6'));var Mustache=require(_0x239e('0x7'));var util=require(_0x239e('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x239e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x239e('0xa'));var crypto=require(_0x239e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x239e('0x9'));var querystring=require(_0x239e('0xc'));var Papa=require('papaparse');var Redis=require(_0x239e('0xd'));var authService=require(_0x239e('0xe'));var qs=require(_0x239e('0xf'));var as=require(_0x239e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x239e('0x11'));var config=require(_0x239e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x487a45,_0x4c9548){_0x4c9548=_0x4c9548||0xcc;return function(_0x4bce5f){if(_0x4bce5f){return _0x487a45[_0x239e('0x13')](_0x4c9548);}return _0x487a45[_0x239e('0x14')](_0x4c9548)[_0x239e('0x15')]();};}function respondWithResult(_0x4edac2,_0x4717c2){_0x4717c2=_0x4717c2||0xc8;return function(_0x59b35b){if(_0x59b35b){return _0x4edac2[_0x239e('0x14')](_0x4717c2)[_0x239e('0x16')](_0x59b35b);}};}function respondWithFilteredResult(_0x53ec8b,_0x56b1f8){return function(_0x27552b){if(_0x27552b){var _0x1573e0=_0x27552b[_0x239e('0x17')],_0x397010=_0x56b1f8[_0x239e('0x18')],_0x4a5374=_0x56b1f8[_0x239e('0x18')]+_0x56b1f8[_0x239e('0x19')],_0x22be86;if(_0x4a5374>=_0x1573e0){_0x4a5374=_0x1573e0;_0x22be86=0xc8;}else{_0x22be86=0xce;}_0x53ec8b['status'](_0x22be86);return _0x53ec8b['set'](_0x239e('0x1a'),_0x397010+'-'+_0x4a5374+'/'+_0x1573e0)[_0x239e('0x16')](_0x27552b);}return null;};}function patchUpdates(_0x205795){return function(_0x34a32b){try{jsonpatch[_0x239e('0x1b')](_0x34a32b,_0x205795,!![]);}catch(_0x1b6d9f){return BPromise[_0x239e('0x1c')](_0x1b6d9f);}return _0x34a32b[_0x239e('0x1d')]();};}function saveUpdates(_0x279aab,_0x5f1427){return function(_0x4a4393){if(_0x4a4393){return _0x4a4393[_0x239e('0x1e')](_0x279aab)[_0x239e('0x1f')](function(_0x451a28){return _0x451a28;});}return null;};}function removeEntity(_0xd2aad0,_0x54414c){return function(_0x1d6f62){if(_0x1d6f62){return _0x1d6f62[_0x239e('0x20')]()[_0x239e('0x1f')](function(){_0xd2aad0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8e94,_0x5b38d7){return function(_0xe552aa){if(!_0xe552aa){_0x2c8e94['sendStatus'](0x194);}return _0xe552aa;};}function handleError(_0x429926,_0x96c540){_0x96c540=_0x96c540||0x1f4;return function(_0xf8589b){logger[_0x239e('0x21')](_0xf8589b[_0x239e('0x22')]);if(_0xf8589b[_0x239e('0x23')]){delete _0xf8589b['name'];}_0x429926[_0x239e('0x14')](_0x96c540)[_0x239e('0x24')](_0xf8589b);};}exports['index']=function(_0x5f3eef,_0x158c46){var _0x12f649={},_0x918d1f={},_0x3fb770={'count':0x0,'rows':[]};var _0xcc4789=_[_0x239e('0x25')](db[_0x239e('0x26')][_0x239e('0x27')],function(_0x231416){return{'name':_0x231416['fieldName'],'type':_0x231416[_0x239e('0x28')][_0x239e('0x29')]};});_0x918d1f[_0x239e('0x2a')]=_[_0x239e('0x25')](_0xcc4789,_0x239e('0x23'));_0x918d1f[_0x239e('0x2b')]=_[_0x239e('0x2c')](_0x5f3eef[_0x239e('0x2b')]);_0x918d1f['filters']=_[_0x239e('0x2d')](_0x918d1f['model'],_0x918d1f[_0x239e('0x2b')]);_0x12f649[_0x239e('0x2e')]=_[_0x239e('0x2d')](_0x918d1f[_0x239e('0x2a')],qs[_0x239e('0x2f')](_0x5f3eef[_0x239e('0x2b')]['fields']));_0x12f649[_0x239e('0x2e')]=_0x12f649[_0x239e('0x2e')][_0x239e('0x30')]?_0x12f649[_0x239e('0x2e')]:_0x918d1f[_0x239e('0x2a')];if(!_0x5f3eef[_0x239e('0x2b')][_0x239e('0x31')](_0x239e('0x32'))){_0x12f649[_0x239e('0x19')]=qs[_0x239e('0x19')](_0x5f3eef[_0x239e('0x2b')]['limit']);_0x12f649[_0x239e('0x18')]=qs[_0x239e('0x18')](_0x5f3eef[_0x239e('0x2b')][_0x239e('0x18')]);}_0x12f649[_0x239e('0x33')]=qs['sort'](_0x5f3eef[_0x239e('0x2b')][_0x239e('0x34')]);_0x12f649[_0x239e('0x35')]=qs[_0x239e('0x36')](_[_0x239e('0x37')](_0x5f3eef[_0x239e('0x2b')],_0x918d1f[_0x239e('0x36')]),_0xcc4789);if(_0x5f3eef['query'][_0x239e('0x38')]){_0x12f649[_0x239e('0x35')]=_['merge'](_0x12f649[_0x239e('0x35')],{'$or':_[_0x239e('0x25')](_0xcc4789,function(_0x10e1c2){if(_0x10e1c2[_0x239e('0x28')]!==_0x239e('0x39')){var _0x14f91={};_0x14f91[_0x10e1c2[_0x239e('0x23')]]={'$like':'%'+_0x5f3eef['query'][_0x239e('0x38')]+'%'};return _0x14f91;}})});}_0x12f649=_[_0x239e('0x3a')]({},_0x12f649,_0x5f3eef[_0x239e('0x3b')]);var _0xd7d090={'where':_0x12f649[_0x239e('0x35')]};return db[_0x239e('0x26')][_0x239e('0x17')](_0xd7d090)[_0x239e('0x1f')](function(_0x7531ec){_0x3fb770[_0x239e('0x17')]=_0x7531ec;if(_0x5f3eef[_0x239e('0x2b')][_0x239e('0x3c')]){_0x12f649[_0x239e('0x3d')]=[{'all':!![]}];}return db[_0x239e('0x26')][_0x239e('0x3e')](_0x12f649);})['then'](function(_0x3dd8b3){_0x3fb770['rows']=_0x3dd8b3;return _0x3fb770;})[_0x239e('0x1f')](respondWithFilteredResult(_0x158c46,_0x12f649))['catch'](handleError(_0x158c46,null));};exports['show']=function(_0x2d8455,_0x45718d){var _0xd4675d={'raw':!![],'where':{'id':_0x2d8455[_0x239e('0x3f')]['id']}},_0x55ac54={};_0x55ac54[_0x239e('0x2a')]=_[_0x239e('0x2c')](db[_0x239e('0x26')]['rawAttributes']);_0x55ac54['query']=_[_0x239e('0x2c')](_0x2d8455['query']);_0x55ac54[_0x239e('0x36')]=_[_0x239e('0x2d')](_0x55ac54[_0x239e('0x2a')],_0x55ac54[_0x239e('0x2b')]);_0xd4675d['attributes']=_[_0x239e('0x2d')](_0x55ac54[_0x239e('0x2a')],qs[_0x239e('0x2f')](_0x2d8455[_0x239e('0x2b')][_0x239e('0x2f')]));_0xd4675d[_0x239e('0x2e')]=_0xd4675d[_0x239e('0x2e')]['length']?_0xd4675d['attributes']:_0x55ac54[_0x239e('0x2a')];if(_0x2d8455['query']['includeAll']){_0xd4675d[_0x239e('0x3d')]=[{'all':!![]}];}_0xd4675d=_[_0x239e('0x3a')]({},_0xd4675d,_0x2d8455[_0x239e('0x3b')]);return db[_0x239e('0x26')][_0x239e('0x40')](_0xd4675d)[_0x239e('0x1f')](handleEntityNotFound(_0x45718d,null))[_0x239e('0x1f')](respondWithResult(_0x45718d,null))[_0x239e('0x41')](handleError(_0x45718d,null));};exports[_0x239e('0x42')]=function(_0x24b561,_0x14b02f){return db[_0x239e('0x26')][_0x239e('0x42')](_0x24b561[_0x239e('0x43')],{})['then'](respondWithResult(_0x14b02f,0xc9))[_0x239e('0x41')](handleError(_0x14b02f,null));};exports[_0x239e('0x1e')]=function(_0x33a57f,_0x567762){if(_0x33a57f[_0x239e('0x43')]['id']){delete _0x33a57f[_0x239e('0x43')]['id'];}return db[_0x239e('0x26')]['find']({'where':{'id':_0x33a57f[_0x239e('0x3f')]['id']}})[_0x239e('0x1f')](handleEntityNotFound(_0x567762,null))[_0x239e('0x1f')](saveUpdates(_0x33a57f['body'],null))[_0x239e('0x1f')](respondWithResult(_0x567762,null))[_0x239e('0x41')](handleError(_0x567762,null));};exports['destroy']=function(_0x52d6c9,_0x5cc9d0){return db[_0x239e('0x26')][_0x239e('0x40')]({'where':{'id':_0x52d6c9['params']['id']}})[_0x239e('0x1f')](handleEntityNotFound(_0x5cc9d0,null))[_0x239e('0x1f')](removeEntity(_0x5cc9d0,null))[_0x239e('0x41')](handleError(_0x5cc9d0,null));};
\ No newline at end of file
index 003b6cc..31f07b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fc9=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer'];(function(_0x52cbf9,_0x59ba19){var _0x4c4471=function(_0x18acc7){while(--_0x18acc7){_0x52cbf9['push'](_0x52cbf9['shift']());}};_0x4c4471(++_0x59ba19);}(_0x0fc9,0x15f));var _0x90fc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0fc9[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x90fc('0x0'));var util=require(_0x90fc('0x1'));var logger=require(_0x90fc('0x2'))('api');var moment=require(_0x90fc('0x3'));var BPromise=require(_0x90fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90fc('0x5'));var rimraf=require(_0x90fc('0x6'));var config=require(_0x90fc('0x7'));var attributes=require(_0x90fc('0x8'));module[_0x90fc('0x9')]=function(_0x477198,_0x4b86d9){return _0x477198[_0x90fc('0xa')](_0x90fc('0xb'),attributes,{'tableName':_0x90fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2470=['rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','util','api','moment','path'];(function(_0x28f3d8,_0x39a459){var _0x5b11d3=function(_0x4f894e){while(--_0x4f894e){_0x28f3d8['push'](_0x28f3d8['shift']());}};_0x5b11d3(++_0x39a459);}(_0x2470,0xb6));var _0x0247=function(_0x2e49fb,_0x2e7ff9){_0x2e49fb=_0x2e49fb-0x0;var _0x31bef1=_0x2470[_0x2e49fb];return _0x31bef1;};'use strict';var _=require(_0x0247('0x0'));var util=require(_0x0247('0x1'));var logger=require('../../config/logger')(_0x0247('0x2'));var moment=require(_0x0247('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0247('0x4'));var rimraf=require(_0x0247('0x5'));var config=require(_0x0247('0x6'));var attributes=require(_0x0247('0x7'));module['exports']=function(_0x4adc99,_0x41ed22){return _0x4adc99[_0x0247('0x8')](_0x0247('0x9'),attributes,{'tableName':_0x0247('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa66a80..b8baa9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d35=['client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','options','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1fb51e,_0x433c7d){var _0x39e3c0=function(_0xd8d5e2){while(--_0xd8d5e2){_0x1fb51e['push'](_0x1fb51e['shift']());}};_0x39e3c0(++_0x433c7d);}(_0x4d35,0x197));var _0x54d3=function(_0x4dc06a,_0x4e4393){_0x4dc06a=_0x4dc06a-0x0;var _0x3d0f60=_0x4d35[_0x4dc06a];return _0x3d0f60;};'use strict';var _=require(_0x54d3('0x0'));var util=require(_0x54d3('0x1'));var moment=require(_0x54d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x54d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x54d3('0x4'));var logger=require(_0x54d3('0x5'))(_0x54d3('0x6'));var config=require(_0x54d3('0x7'));var jayson=require(_0x54d3('0x8'));var client=jayson[_0x54d3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x456600,_0x62b580,_0x507079){return new BPromise(function(_0xa7aee9,_0x55937d){return client[_0x54d3('0xa')](_0x456600,_0x507079)[_0x54d3('0xb')](function(_0x27790b){logger['info'](_0x54d3('0xc'),_0x62b580,_0x54d3('0xd'));logger[_0x54d3('0xe')](_0x54d3('0xf'),_0x62b580,_0x54d3('0xd'),JSON[_0x54d3('0x10')](_0x27790b));if(_0x27790b['error']){if(_0x27790b[_0x54d3('0x11')][_0x54d3('0x12')]===0x1f4){logger[_0x54d3('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x62b580,_0x27790b[_0x54d3('0x11')][_0x54d3('0x13')]);return _0x55937d(_0x27790b[_0x54d3('0x11')][_0x54d3('0x13')]);}logger[_0x54d3('0x11')](_0x54d3('0xc'),_0x62b580,_0x27790b['error'][_0x54d3('0x13')]);return _0xa7aee9(_0x27790b[_0x54d3('0x11')][_0x54d3('0x13')]);}else{logger[_0x54d3('0x14')](_0x54d3('0xc'),_0x62b580,'request\x20sent');_0xa7aee9(_0x27790b[_0x54d3('0x15')][_0x54d3('0x13')]);}})['catch'](function(_0x5dfb1b){logger['error'](_0x54d3('0xc'),_0x62b580,_0x5dfb1b);_0x55937d(_0x5dfb1b);});});}exports[_0x54d3('0x16')]=function(_0x4ec3fd){var _0x51a267=this;return new Promise(function(_0x1d17b0,_0x4afbb9){return db[_0x54d3('0x17')][_0x54d3('0x18')](_0x4ec3fd['body'],{'raw':_0x4ec3fd[_0x54d3('0x19')]?_0x4ec3fd[_0x54d3('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x54d3('0xb')](function(_0x1212a5){logger['info'](_0x54d3('0x16'),_0x4ec3fd);logger[_0x54d3('0xe')](_0x54d3('0x16'),_0x4ec3fd,JSON[_0x54d3('0x10')](_0x1212a5));_0x1d17b0(_0x1212a5);})['catch'](function(_0x8e20d2){logger[_0x54d3('0x11')](_0x54d3('0x16'),_0x8e20d2[_0x54d3('0x13')],_0x4ec3fd);_0x4afbb9(_0x51a267['error'](0x1f4,_0x8e20d2[_0x54d3('0x13')]));});});};
\ No newline at end of file
+var _0x9290=['stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw'];(function(_0x59e10c,_0x35c367){var _0x7ddcd7=function(_0x215bd0){while(--_0x215bd0){_0x59e10c['push'](_0x59e10c['shift']());}};_0x7ddcd7(++_0x35c367);}(_0x9290,0xe1));var _0x0929=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0x9290[_0x1306f3];return _0xc1c7bf;};'use strict';var _=require('lodash');var util=require(_0x0929('0x0'));var moment=require(_0x0929('0x1'));var BPromise=require(_0x0929('0x2'));var rs=require(_0x0929('0x3'));var fs=require('fs');var Redis=require(_0x0929('0x4'));var db=require(_0x0929('0x5'))['db'];var utils=require(_0x0929('0x6'));var logger=require(_0x0929('0x7'))(_0x0929('0x8'));var config=require(_0x0929('0x9'));var jayson=require(_0x0929('0xa'));var client=jayson[_0x0929('0xb')][_0x0929('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd0a695,_0x1cb430,_0x212d69){return new BPromise(function(_0x529911,_0x3feaee){return client[_0x0929('0xd')](_0xd0a695,_0x212d69)[_0x0929('0xe')](function(_0x56d585){logger[_0x0929('0xf')](_0x0929('0x10'),_0x1cb430,_0x0929('0x11'));logger[_0x0929('0x12')](_0x0929('0x13'),_0x1cb430,_0x0929('0x11'),JSON['stringify'](_0x56d585));if(_0x56d585[_0x0929('0x14')]){if(_0x56d585['error'][_0x0929('0x15')]===0x1f4){logger[_0x0929('0x14')](_0x0929('0x10'),_0x1cb430,_0x56d585[_0x0929('0x14')]['message']);return _0x3feaee(_0x56d585[_0x0929('0x14')][_0x0929('0x16')]);}logger[_0x0929('0x14')](_0x0929('0x10'),_0x1cb430,_0x56d585[_0x0929('0x14')][_0x0929('0x16')]);return _0x529911(_0x56d585['error'][_0x0929('0x16')]);}else{logger[_0x0929('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x1cb430,_0x0929('0x11'));_0x529911(_0x56d585[_0x0929('0x17')]['message']);}})[_0x0929('0x18')](function(_0x157b9d){logger[_0x0929('0x14')](_0x0929('0x10'),_0x1cb430,_0x157b9d);_0x3feaee(_0x157b9d);});});}exports[_0x0929('0x19')]=function(_0x26b244){var _0x3640aa=this;return new Promise(function(_0x19b028,_0x1068ec){return db[_0x0929('0x1a')][_0x0929('0x1b')](_0x26b244[_0x0929('0x1c')],{'raw':_0x26b244[_0x0929('0x1d')]?_0x26b244[_0x0929('0x1d')][_0x0929('0x1e')]===undefined?!![]:![]:!![]})[_0x0929('0xe')](function(_0x243022){logger[_0x0929('0xf')](_0x0929('0x19'),_0x26b244);logger['debug'](_0x0929('0x19'),_0x26b244,JSON[_0x0929('0x1f')](_0x243022));_0x19b028(_0x243022);})[_0x0929('0x18')](function(_0x13ae79){logger['error']('CreateVoiceTransferReport',_0x13ae79['message'],_0x26b244);_0x1068ec(_0x3640aa[_0x0929('0x14')](0x1f4,_0x13ae79[_0x0929('0x16')]));});});};
\ No newline at end of file
index d96269d..a4a5666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9090=['Router','../../components/auth/service','./webbar.controller','post','canUpdate','originate','isAuthenticated','hangup','/answer','/hold','/unhold','/calls','/transfer','transfer','exports','express'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x9090,0x17f));var _0x0909=function(_0x1e417f,_0x1f012e){_0x1e417f=_0x1e417f-0x0;var _0x46315f=_0x9090[_0x1e417f];return _0x46315f;};'use strict';var express=require(_0x0909('0x0'));var router=express[_0x0909('0x1')]();var auth=require(_0x0909('0x2'));var controller=require(_0x0909('0x3'));router[_0x0909('0x4')]('/originate',auth['isAuthenticated'](),auth[_0x0909('0x5')](),controller[_0x0909('0x6')]);router[_0x0909('0x4')]('/hangup',auth[_0x0909('0x7')](),auth[_0x0909('0x5')](),controller[_0x0909('0x8')]);router[_0x0909('0x4')](_0x0909('0x9'),auth[_0x0909('0x7')](),auth[_0x0909('0x5')](),controller['answer']);router[_0x0909('0x4')](_0x0909('0xa'),auth['isAuthenticated'](),auth[_0x0909('0x5')](),controller['hold']);router[_0x0909('0x4')](_0x0909('0xb'),auth[_0x0909('0x7')](),auth[_0x0909('0x5')](),controller['unhold']);router[_0x0909('0x4')](_0x0909('0xc'),auth[_0x0909('0x7')](),auth[_0x0909('0x5')](),controller['calls']);router[_0x0909('0x4')](_0x0909('0xd'),auth[_0x0909('0x7')](),auth[_0x0909('0x5')](),controller[_0x0909('0xe')]);module[_0x0909('0xf')]=router;
\ No newline at end of file
+var _0x6ff1=['express','Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','canUpdate','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports'];(function(_0xaf4af7,_0x6a8b6f){var _0x596009=function(_0x563e6f){while(--_0x563e6f){_0xaf4af7['push'](_0xaf4af7['shift']());}};_0x596009(++_0x6a8b6f);}(_0x6ff1,0x10a));var _0x16ff=function(_0x1ba0da,_0x342203){_0x1ba0da=_0x1ba0da-0x0;var _0x2d10ad=_0x6ff1[_0x1ba0da];return _0x2d10ad;};'use strict';var express=require(_0x16ff('0x0'));var router=express[_0x16ff('0x1')]();var auth=require(_0x16ff('0x2'));var controller=require(_0x16ff('0x3'));router['post']('/originate',auth[_0x16ff('0x4')](),auth['canUpdate'](),controller[_0x16ff('0x5')]);router[_0x16ff('0x6')](_0x16ff('0x7'),auth[_0x16ff('0x4')](),auth['canUpdate'](),controller['hangup']);router['post']('/answer',auth[_0x16ff('0x4')](),auth[_0x16ff('0x8')](),controller[_0x16ff('0x9')]);router[_0x16ff('0x6')](_0x16ff('0xa'),auth[_0x16ff('0x4')](),auth[_0x16ff('0x8')](),controller[_0x16ff('0xb')]);router[_0x16ff('0x6')](_0x16ff('0xc'),auth[_0x16ff('0x4')](),auth[_0x16ff('0x8')](),controller[_0x16ff('0xd')]);router[_0x16ff('0x6')](_0x16ff('0xe'),auth[_0x16ff('0x4')](),auth[_0x16ff('0x8')](),controller[_0x16ff('0xf')]);router[_0x16ff('0x6')](_0x16ff('0x10'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x16ff('0x11')]);module[_0x16ff('0x12')]=router;
\ No newline at end of file
index 3269e8b..2b11b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb205=['transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','client','../../config/logger','webbarapi','redis','defaults','socket.io-emitter','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','code','message','result','User','findOne','agent','then','VoiceChannels','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','catch','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','all','filter','conference\x20fired:','conference\x20executed!'];(function(_0x32e018,_0xf3f5de){var _0x567ed7=function(_0x40d4ef){while(--_0x40d4ef){_0x32e018['push'](_0x32e018['shift']());}};_0x567ed7(++_0xf3f5de);}(_0xb205,0xf0));var _0x5b20=function(_0x51be89,_0x364f93){_0x51be89=_0x51be89-0x0;var _0x10bb8a=_0xb205[_0x51be89];return _0x10bb8a;};'use strict';var path=require(_0x5b20('0x0'));var fs=require('fs');var _=require(_0x5b20('0x1'));var db=require(_0x5b20('0x2'))['db'];var config=require(_0x5b20('0x3'));var util=require(_0x5b20('0x4'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0x5b20('0x5')]['http']({'port':0x232a});var logger=require(_0x5b20('0x6'))(_0x5b20('0x7'));var Redis=require('ioredis');config[_0x5b20('0x8')]=_[_0x5b20('0x9')](config[_0x5b20('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x5b20('0xa'))(new Redis(config[_0x5b20('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5b20('0xb')]},'callNumber':{'type':_0x5b20('0xc'),'required':[!![],_0x5b20('0xd')]},'callerId':{'type':_0x5b20('0xc')},'callbackUrl':{'type':_0x5b20('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],_0x5b20('0xb')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],_0x5b20('0xb')]},'sessionId':{'type':_0x5b20('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5b20('0xc'),'required':[!![],_0x5b20('0xf')]},'transferNumber':{'type':_0x5b20('0xc'),'required':[!![],_0x5b20('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5b20('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],_0x5b20('0xb')]},'sessionId':{'type':_0x5b20('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x5b20('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x5ac9db,_0x31b9dd,_0x52042b){logger[_0x5b20('0x11')](_0x5ac9db,_0x31b9dd,JSON[_0x5b20('0x12')](_0x52042b));io['to'](_0x5ac9db)[_0x5b20('0x13')](_0x31b9dd,_0x52042b);}function handleError(_0x498986){return function(_0x44ac15){console[_0x5b20('0x14')](_0x5b20('0x15'),_0x44ac15,_0x44ac15 instanceof RangeError);logger[_0x5b20('0x16')](_0x44ac15['stack']);if(_0x44ac15 instanceof RangeError){if(_0x44ac15[_0x5b20('0x17')]){delete _0x44ac15['name'];}_0x498986[_0x5b20('0x18')](0x194)[_0x5b20('0x19')](_0x44ac15);}else{if(_0x44ac15['name']){delete _0x44ac15[_0x5b20('0x17')];}_0x498986[_0x5b20('0x18')](0x1f4)[_0x5b20('0x19')](_0x44ac15);}};}function checkError(){return function(_0x4e9ae9){if(!_0x4e9ae9){throw new RangeError(_0x5b20('0x1a'));}return _0x4e9ae9;};}function respondWithRpcPromise(_0x28fe6e,_0x59f614){return new BPromise(function(_0x2d404f,_0x52e27f){var _0x4f291e=amiClient;return _0x4f291e[_0x5b20('0x1b')](_0x28fe6e,_0x59f614)['then'](function(_0x4b4076){if(_0x4b4076[_0x5b20('0x16')]){if(_0x4b4076[_0x5b20('0x16')][_0x5b20('0x1c')]===0x1f4){return _0x52e27f(_0x4b4076[_0x5b20('0x16')][_0x5b20('0x1d')]);}return _0x2d404f(_0x4b4076[_0x5b20('0x16')][_0x5b20('0x1d')]);}else{_0x2d404f(_0x4b4076[_0x5b20('0x1e')]);}})['catch'](function(_0x285249){_0x52e27f(_0x285249);});});}function getAgent(_0x102b05){return db[_0x5b20('0x1f')][_0x5b20('0x20')]({'where':{'id':_0x102b05,'role':_0x5b20('0x21')}})[_0x5b20('0x22')](checkError());}function getAgentCheckSession(_0x50d335,_0x16ff2d){return new BPromise(function(_0x49a15d,_0x444195){var _0x1b8965=respondWithRpcPromise(_0x5b20('0x23'));var _0x516f16=getAgent(_0x50d335);Promise['all']([_0x1b8965,_0x516f16])[_0x5b20('0x22')](function(_0x27aefb){var _0x508618=_0x27aefb[0x0];var _0x551224=_0x27aefb[0x1];var _0x38351c=_['filter'](_0x508618[_0x5b20('0x24')],function(_0x13d302){return _0x13d302[_0x5b20('0x25')]==_0x551224['id']&&_0x13d302[_0x5b20('0x26')]==_0x16ff2d;});if(_0x38351c['length']==0x1){_0x49a15d(_0x551224);}else{_0x444195(new RangeError(_0x5b20('0x27')+_0x16ff2d+_0x5b20('0x28')));}});});}exports[_0x5b20('0x29')]=function(_0xf480fd,_0x5ce609){logger[_0x5b20('0x11')](_0x5b20('0x2a'),_0xf480fd[_0x5b20('0x2b')]);var _0xb22b1c=originateValidation[_0x5b20('0x2c')](_0xf480fd[_0x5b20('0x2b')]);if(_0xb22b1c[_0x5b20('0x2d')]>0x0){return _0x5ce609[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0xb22b1c);}var _0x283e00=_0xf480fd[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x199830=_0xf480fd[_0x5b20('0x2b')][_0x5b20('0x30')];var _0x553a20=_0xf480fd['body']['callerId'];var _0x310d26=_0xf480fd[_0x5b20('0x2b')][_0x5b20('0x31')];return getAgent(_0x283e00)[_0x5b20('0x22')](function(_0x5d3e95){logger['info'](_0x5b20('0x32'),_0x5d3e95[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x5d3e95[_0x5b20('0x17')]),_0x5b20('0x35'),{'callNumber':_0x199830,'callerId':_0x553a20,'callbackUrl':_0x310d26});return _0x5ce609[_0x5b20('0x18')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x5ce609));};exports[_0x5b20('0x36')]=function(_0x3ecb37,_0x29c731){logger[_0x5b20('0x11')](_0x5b20('0x37'),_0x3ecb37[_0x5b20('0x2b')]);var _0x492fbb=hangupValidation['validate'](_0x3ecb37[_0x5b20('0x2b')]);if(_0x492fbb[_0x5b20('0x2d')]>0x0){return _0x29c731['status'](0x190)[_0x5b20('0x2e')](_0x492fbb);}var _0xf5babd=_0x3ecb37[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x368990=_0x3ecb37[_0x5b20('0x2b')][_0x5b20('0x26')];return getAgent(_0xf5babd)[_0x5b20('0x22')](function(_0xce0cec){logger[_0x5b20('0x11')](_0x5b20('0x32'),_0xce0cec[_0x5b20('0x17')]);emit(util['format'](_0x5b20('0x34'),_0xce0cec[_0x5b20('0x17')]),_0x5b20('0x38'),{'sessionId':_0x368990});return _0x29c731[_0x5b20('0x18')](0xc8)[_0x5b20('0x2e')]({'error':![],'message':_0x5b20('0x39')});})[_0x5b20('0x3a')](handleError(_0x29c731));};exports[_0x5b20('0x3b')]=function(_0x3ce01d,_0x3e6029){logger[_0x5b20('0x11')](_0x5b20('0x3c'),_0x3ce01d[_0x5b20('0x2b')]);var _0x2ea494=answerValidation[_0x5b20('0x2c')](_0x3ce01d[_0x5b20('0x2b')]);if(_0x2ea494[_0x5b20('0x2d')]>0x0){return _0x3e6029[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0x2ea494);}var _0x106c62=_0x3ce01d[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x13326e=_0x3ce01d[_0x5b20('0x2b')][_0x5b20('0x26')];return getAgent(_0x106c62)[_0x5b20('0x22')](function(_0x1c2134){logger['info'](_0x5b20('0x32'),_0x1c2134[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x1c2134[_0x5b20('0x17')]),_0x5b20('0x3d'),{'sessionId':_0x13326e});return _0x3e6029[_0x5b20('0x18')](0xc8)['json']({'error':![],'message':_0x5b20('0x3e')});})[_0x5b20('0x3a')](handleError(_0x3e6029));};exports[_0x5b20('0x3f')]=function(_0x110774,_0x1197f4){logger[_0x5b20('0x11')](_0x5b20('0x40'),_0x110774['body']);var _0x1f0df8=holdValidation[_0x5b20('0x2c')](_0x110774['body']);if(_0x1f0df8[_0x5b20('0x2d')]>0x0){return _0x1197f4[_0x5b20('0x18')](0x190)['json'](_0x1f0df8);}var _0x2b726c=_0x110774[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x41a6d1=_0x110774[_0x5b20('0x2b')][_0x5b20('0x26')];return getAgent(_0x2b726c)[_0x5b20('0x22')](function(_0x36c204){logger['info'](_0x5b20('0x32'),_0x36c204[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x36c204[_0x5b20('0x17')]),_0x5b20('0x41'),{'sessionId':_0x41a6d1});return _0x1197f4['status'](0xc8)[_0x5b20('0x2e')]({'error':![],'message':_0x5b20('0x42')});})['catch'](handleError(_0x1197f4));};exports[_0x5b20('0x43')]=function(_0x48d5f2,_0x110480){logger[_0x5b20('0x11')](_0x5b20('0x44'),_0x48d5f2[_0x5b20('0x2b')]);var _0x5c8cb2=unholdValidation[_0x5b20('0x2c')](_0x48d5f2[_0x5b20('0x2b')]);if(_0x5c8cb2[_0x5b20('0x2d')]>0x0){return _0x110480[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0x5c8cb2);}var _0x23eea9=_0x48d5f2[_0x5b20('0x2b')]['userId'];var _0x55fc94=_0x48d5f2[_0x5b20('0x2b')][_0x5b20('0x26')];return getAgent(_0x23eea9)[_0x5b20('0x22')](function(_0x4d2326){logger[_0x5b20('0x11')](_0x5b20('0x32'),_0x4d2326[_0x5b20('0x17')]);emit(util['format'](_0x5b20('0x34'),_0x4d2326[_0x5b20('0x17')]),_0x5b20('0x45'),{'sessionId':_0x55fc94});return _0x110480['status'](0xc8)[_0x5b20('0x2e')]({'error':![],'message':'unhold\x20executed!'});})[_0x5b20('0x3a')](handleError(_0x110480));};exports[_0x5b20('0x46')]=function(_0x5fbbe0,_0x3bddbf){logger['info'](_0x5b20('0x47'),_0x3bddbf['body']);var _0x15e8a1=callsValidation['validate'](_0x5fbbe0['body']);if(_0x15e8a1[_0x5b20('0x2d')]>0x0){return _0x3bddbf[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0x15e8a1);}var _0x240ca5=_0x5fbbe0['body']['userId'];var _0x299148=respondWithRpcPromise(_0x5b20('0x23'));var _0x1cca2c=getAgent(_0x240ca5);return Promise[_0x5b20('0x48')]([_0x299148,_0x1cca2c])[_0x5b20('0x22')](function(_0x4bd1fa){var _0x1dca2a=_0x4bd1fa[0x0];var _0x3cf2de=_0x4bd1fa[0x1];var _0x3241a9=_[_0x5b20('0x49')](_0x1dca2a[_0x5b20('0x24')],function(_0x2c5e87){return _0x2c5e87[_0x5b20('0x25')]==_0x3cf2de['id'];});return _0x3bddbf['status'](0xc8)[_0x5b20('0x2e')]({'count':_0x3241a9[_0x5b20('0x2d')],'rows':_0x3241a9});})[_0x5b20('0x3a')](handleError(_0x3bddbf));};exports['conference']=function(_0x1ea503,_0x3449db){logger[_0x5b20('0x11')](_0x5b20('0x4a'),_0x1ea503['body']);var _0x1de6a1=conferenceValidation[_0x5b20('0x2c')](_0x1ea503[_0x5b20('0x2b')]);if(_0x1de6a1[_0x5b20('0x2d')]>0x0){return _0x3449db[_0x5b20('0x18')](0x190)['json'](_0x1de6a1);}var _0x59ee23=_0x1ea503['body']['userId'];return getAgent(_0x59ee23)['then'](function(_0x4ed20b){logger['info'](_0x5b20('0x32'),_0x4ed20b[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x4ed20b['name']),'webbar:conference');return _0x3449db[_0x5b20('0x18')](0xc8)[_0x5b20('0x2e')]({'error':![],'message':_0x5b20('0x4b')});})[_0x5b20('0x3a')](handleError(_0x3449db));};exports['transfer']=function(_0x48a14f,_0x354147){logger[_0x5b20('0x11')](_0x5b20('0x4c'),_0x48a14f[_0x5b20('0x2b')]);var _0x5c3de3=transferValidation[_0x5b20('0x2c')](_0x48a14f[_0x5b20('0x2b')]);if(_0x5c3de3['length']>0x0){return _0x354147[_0x5b20('0x18')](0x190)[_0x5b20('0x2e')](_0x5c3de3);}var _0x143632=_0x48a14f[_0x5b20('0x2b')][_0x5b20('0x2f')];var _0x48fb7a=_0x48a14f[_0x5b20('0x2b')][_0x5b20('0x26')];var _0x2a9964=_0x48a14f[_0x5b20('0x2b')][_0x5b20('0x4d')];return getAgent(_0x143632)['then'](function(_0x215f71){logger[_0x5b20('0x11')](_0x5b20('0x32'),_0x215f71[_0x5b20('0x17')]);emit(util[_0x5b20('0x33')](_0x5b20('0x34'),_0x215f71[_0x5b20('0x17')]),_0x5b20('0x4e'),{'sessionId':_0x48fb7a,'transferNumber':_0x2a9964});return _0x354147['status'](0xc8)[_0x5b20('0x2e')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x354147));};
\ No newline at end of file
+var _0x07b9=['hold','hold\x20fired:','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','filter','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','all','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','format','webbar:originate','originate\x20executed!','hangup','sessionId','entityFound:','user:%s','webbar:hangup','answer','answer\x20fired:','webbar:answer'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x07b9,0x143));var _0x907b=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x07b9[_0x2f1762];return _0x8ab21;};'use strict';var path=require(_0x907b('0x0'));var fs=require('fs');var _=require(_0x907b('0x1'));var db=require(_0x907b('0x2'))['db'];var config=require(_0x907b('0x3'));var util=require('util');var BPromise=require(_0x907b('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x907b('0x5')][_0x907b('0x6')]({'port':0x232a});var logger=require(_0x907b('0x7'))(_0x907b('0x8'));var Redis=require(_0x907b('0x9'));config[_0x907b('0xa')]=_[_0x907b('0xb')](config['redis'],{'host':_0x907b('0xc'),'port':0x18eb});var io=require(_0x907b('0xd'))(new Redis(config[_0x907b('0xa')]));var Schema=require(_0x907b('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x907b('0xf'),'required':[!![],_0x907b('0x10')]},'callerId':{'type':_0x907b('0xf')},'callbackUrl':{'type':_0x907b('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x907b('0x11'),'required':[!![],_0x907b('0x12')]},'sessionId':{'type':_0x907b('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x907b('0x11'),'required':[!![],_0x907b('0x12')]},'sessionId':{'type':_0x907b('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x907b('0x12')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x907b('0xf'),'required':[!![],_0x907b('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x907b('0x11'),'required':[!![],_0x907b('0x12')]},'sessionId':{'type':_0x907b('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x907b('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x907b('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x907b('0x11'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x907b('0x12')]}});function emit(_0x17c314,_0xc9297a,_0x1e1f23){logger[_0x907b('0x14')](_0x17c314,_0xc9297a,JSON['stringify'](_0x1e1f23));io['to'](_0x17c314)[_0x907b('0x15')](_0xc9297a,_0x1e1f23);}function handleError(_0x160a6f){return function(_0x5d7cd3){console[_0x907b('0x16')](_0x907b('0x17'),_0x5d7cd3,_0x5d7cd3 instanceof RangeError);logger[_0x907b('0x18')](_0x5d7cd3[_0x907b('0x19')]);if(_0x5d7cd3 instanceof RangeError){if(_0x5d7cd3[_0x907b('0x1a')]){delete _0x5d7cd3[_0x907b('0x1a')];}_0x160a6f[_0x907b('0x1b')](0x194)[_0x907b('0x1c')](_0x5d7cd3);}else{if(_0x5d7cd3[_0x907b('0x1a')]){delete _0x5d7cd3[_0x907b('0x1a')];}_0x160a6f[_0x907b('0x1b')](0x1f4)[_0x907b('0x1c')](_0x5d7cd3);}};}function checkError(){return function(_0x3fe834){if(!_0x3fe834){throw new RangeError('NotFound');}return _0x3fe834;};}function respondWithRpcPromise(_0x2b1624,_0x103615){return new BPromise(function(_0x2daa51,_0x406e0b){var _0x450f3f=amiClient;return _0x450f3f[_0x907b('0x1d')](_0x2b1624,_0x103615)[_0x907b('0x1e')](function(_0x53beb1){if(_0x53beb1[_0x907b('0x18')]){if(_0x53beb1[_0x907b('0x18')][_0x907b('0x1f')]===0x1f4){return _0x406e0b(_0x53beb1[_0x907b('0x18')][_0x907b('0x20')]);}return _0x2daa51(_0x53beb1[_0x907b('0x18')][_0x907b('0x20')]);}else{_0x2daa51(_0x53beb1[_0x907b('0x21')]);}})[_0x907b('0x22')](function(_0xa28c16){_0x406e0b(_0xa28c16);});});}function getAgent(_0x594fd2){return db[_0x907b('0x23')]['findOne']({'where':{'id':_0x594fd2,'role':_0x907b('0x24')}})[_0x907b('0x1e')](checkError());}function getAgentCheckSession(_0x3bbab7,_0x5adecf){return new BPromise(function(_0x4acd74,_0x29a0f5){var _0x421463=respondWithRpcPromise(_0x907b('0x25'));var _0x8dcd13=getAgent(_0x3bbab7);Promise[_0x907b('0x26')]([_0x421463,_0x8dcd13])[_0x907b('0x1e')](function(_0x100f98){var _0x599099=_0x100f98[0x0];var _0x2b2b08=_0x100f98[0x1];var _0x270cfd=_['filter'](_0x599099[_0x907b('0x27')],function(_0x27d4be){return _0x27d4be[_0x907b('0x28')]==_0x2b2b08['id']&&_0x27d4be['sessionId']==_0x5adecf;});if(_0x270cfd[_0x907b('0x29')]==0x1){_0x4acd74(_0x2b2b08);}else{_0x29a0f5(new RangeError('sessionId\x20'+_0x5adecf+_0x907b('0x2a')));}});});}exports[_0x907b('0x2b')]=function(_0x474c74,_0x38a07d){logger[_0x907b('0x14')](_0x907b('0x2c'),_0x474c74[_0x907b('0x2d')]);var _0x3fd768=originateValidation[_0x907b('0xe')](_0x474c74[_0x907b('0x2d')]);if(_0x3fd768[_0x907b('0x29')]>0x0){return _0x38a07d['status'](0x190)[_0x907b('0x2e')](_0x3fd768);}var _0x481db0=_0x474c74['body'][_0x907b('0x2f')];var _0x5054d6=_0x474c74[_0x907b('0x2d')][_0x907b('0x30')];var _0x21bf85=_0x474c74[_0x907b('0x2d')][_0x907b('0x31')];var _0x2014ec=_0x474c74[_0x907b('0x2d')][_0x907b('0x32')];return getAgent(_0x481db0)[_0x907b('0x1e')](function(_0x16d58c){logger[_0x907b('0x14')]('entityFound:',_0x16d58c['name']);emit(util[_0x907b('0x33')]('user:%s',_0x16d58c['name']),_0x907b('0x34'),{'callNumber':_0x5054d6,'callerId':_0x21bf85,'callbackUrl':_0x2014ec});return _0x38a07d['status'](0xc8)[_0x907b('0x2e')]({'error':![],'message':_0x907b('0x35')});})[_0x907b('0x22')](handleError(_0x38a07d));};exports[_0x907b('0x36')]=function(_0x293a6d,_0x15f89d){logger['info']('hangup\x20fired:',_0x293a6d[_0x907b('0x2d')]);var _0x2e7975=hangupValidation[_0x907b('0xe')](_0x293a6d[_0x907b('0x2d')]);if(_0x2e7975[_0x907b('0x29')]>0x0){return _0x15f89d['status'](0x190)[_0x907b('0x2e')](_0x2e7975);}var _0x43638a=_0x293a6d['body'][_0x907b('0x2f')];var _0x648b6f=_0x293a6d[_0x907b('0x2d')][_0x907b('0x37')];return getAgent(_0x43638a)[_0x907b('0x1e')](function(_0x52f536){logger[_0x907b('0x14')](_0x907b('0x38'),_0x52f536[_0x907b('0x1a')]);emit(util[_0x907b('0x33')](_0x907b('0x39'),_0x52f536['name']),_0x907b('0x3a'),{'sessionId':_0x648b6f});return _0x15f89d[_0x907b('0x1b')](0xc8)[_0x907b('0x2e')]({'error':![],'message':'hangup\x20executed!'});})[_0x907b('0x22')](handleError(_0x15f89d));};exports[_0x907b('0x3b')]=function(_0x2424cb,_0x1af0d7){logger['info'](_0x907b('0x3c'),_0x2424cb[_0x907b('0x2d')]);var _0xa91941=answerValidation[_0x907b('0xe')](_0x2424cb[_0x907b('0x2d')]);if(_0xa91941[_0x907b('0x29')]>0x0){return _0x1af0d7[_0x907b('0x1b')](0x190)['json'](_0xa91941);}var _0x5b55d3=_0x2424cb['body']['userId'];var _0x4a792b=_0x2424cb[_0x907b('0x2d')][_0x907b('0x37')];return getAgent(_0x5b55d3)[_0x907b('0x1e')](function(_0x4b0362){logger['info'](_0x907b('0x38'),_0x4b0362['name']);emit(util['format']('user:%s',_0x4b0362[_0x907b('0x1a')]),_0x907b('0x3d'),{'sessionId':_0x4a792b});return _0x1af0d7[_0x907b('0x1b')](0xc8)[_0x907b('0x2e')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x1af0d7));};exports[_0x907b('0x3e')]=function(_0x4ef7c4,_0x49a35c){logger[_0x907b('0x14')](_0x907b('0x3f'),_0x4ef7c4[_0x907b('0x2d')]);var _0x32ab96=holdValidation[_0x907b('0xe')](_0x4ef7c4[_0x907b('0x2d')]);if(_0x32ab96[_0x907b('0x29')]>0x0){return _0x49a35c[_0x907b('0x1b')](0x190)[_0x907b('0x2e')](_0x32ab96);}var _0x38b5c5=_0x4ef7c4['body'][_0x907b('0x2f')];var _0x48e9c5=_0x4ef7c4[_0x907b('0x2d')]['sessionId'];return getAgent(_0x38b5c5)[_0x907b('0x1e')](function(_0x3bad4f){logger['info'](_0x907b('0x38'),_0x3bad4f[_0x907b('0x1a')]);emit(util['format'](_0x907b('0x39'),_0x3bad4f[_0x907b('0x1a')]),'webbar:hold',{'sessionId':_0x48e9c5});return _0x49a35c['status'](0xc8)[_0x907b('0x2e')]({'error':![],'message':_0x907b('0x40')});})[_0x907b('0x22')](handleError(_0x49a35c));};exports[_0x907b('0x41')]=function(_0x1c6203,_0x41fe10){logger['info']('unhold\x20fired:',_0x1c6203['body']);var _0x387972=unholdValidation['validate'](_0x1c6203[_0x907b('0x2d')]);if(_0x387972[_0x907b('0x29')]>0x0){return _0x41fe10[_0x907b('0x1b')](0x190)[_0x907b('0x2e')](_0x387972);}var _0x54bca3=_0x1c6203[_0x907b('0x2d')][_0x907b('0x2f')];var _0x2d4743=_0x1c6203[_0x907b('0x2d')][_0x907b('0x37')];return getAgent(_0x54bca3)[_0x907b('0x1e')](function(_0x4281c1){logger['info'](_0x907b('0x38'),_0x4281c1[_0x907b('0x1a')]);emit(util[_0x907b('0x33')](_0x907b('0x39'),_0x4281c1[_0x907b('0x1a')]),_0x907b('0x42'),{'sessionId':_0x2d4743});return _0x41fe10[_0x907b('0x1b')](0xc8)[_0x907b('0x2e')]({'error':![],'message':_0x907b('0x43')});})[_0x907b('0x22')](handleError(_0x41fe10));};exports['calls']=function(_0x268e63,_0x59483f){logger[_0x907b('0x14')](_0x907b('0x44'),_0x59483f[_0x907b('0x2d')]);var _0x4e0021=callsValidation[_0x907b('0xe')](_0x268e63[_0x907b('0x2d')]);if(_0x4e0021[_0x907b('0x29')]>0x0){return _0x59483f[_0x907b('0x1b')](0x190)[_0x907b('0x2e')](_0x4e0021);}var _0xf5d65d=_0x268e63['body'][_0x907b('0x2f')];var _0x1474de=respondWithRpcPromise('VoiceChannels');var _0x31f259=getAgent(_0xf5d65d);return Promise[_0x907b('0x26')]([_0x1474de,_0x31f259])[_0x907b('0x1e')](function(_0x53ba44){var _0x2f9870=_0x53ba44[0x0];var _0x20c275=_0x53ba44[0x1];var _0x2ceece=_[_0x907b('0x45')](_0x2f9870[_0x907b('0x27')],function(_0x10fbfa){return _0x10fbfa[_0x907b('0x28')]==_0x20c275['id'];});return _0x59483f[_0x907b('0x1b')](0xc8)[_0x907b('0x2e')]({'count':_0x2ceece['length'],'rows':_0x2ceece});})[_0x907b('0x22')](handleError(_0x59483f));};exports['conference']=function(_0x362716,_0x4a0711){logger['info'](_0x907b('0x46'),_0x362716[_0x907b('0x2d')]);var _0x582794=conferenceValidation[_0x907b('0xe')](_0x362716['body']);if(_0x582794[_0x907b('0x29')]>0x0){return _0x4a0711[_0x907b('0x1b')](0x190)['json'](_0x582794);}var _0xae67c8=_0x362716[_0x907b('0x2d')][_0x907b('0x2f')];return getAgent(_0xae67c8)['then'](function(_0x54dd7a){logger[_0x907b('0x14')](_0x907b('0x38'),_0x54dd7a[_0x907b('0x1a')]);emit(util['format'](_0x907b('0x39'),_0x54dd7a['name']),_0x907b('0x47'));return _0x4a0711[_0x907b('0x1b')](0xc8)['json']({'error':![],'message':_0x907b('0x48')});})['catch'](handleError(_0x4a0711));};exports[_0x907b('0x49')]=function(_0xb28b9b,_0x4f847b){logger['info'](_0x907b('0x4a'),_0xb28b9b['body']);var _0x442b9d=transferValidation[_0x907b('0xe')](_0xb28b9b[_0x907b('0x2d')]);if(_0x442b9d[_0x907b('0x29')]>0x0){return _0x4f847b[_0x907b('0x1b')](0x190)[_0x907b('0x2e')](_0x442b9d);}var _0x36bd29=_0xb28b9b[_0x907b('0x2d')]['userId'];var _0x2cc77d=_0xb28b9b[_0x907b('0x2d')]['sessionId'];var _0x4c0f80=_0xb28b9b[_0x907b('0x2d')][_0x907b('0x4b')];return getAgent(_0x36bd29)[_0x907b('0x1e')](function(_0x2a0bdb){logger[_0x907b('0x14')](_0x907b('0x38'),_0x2a0bdb[_0x907b('0x1a')]);emit(util[_0x907b('0x33')](_0x907b('0x39'),_0x2a0bdb[_0x907b('0x1a')]),'webbar:transfer',{'sessionId':_0x2cc77d,'transferNumber':_0x4c0f80});return _0x4f847b['status'](0xc8)['json']({'error':![],'message':_0x907b('0x4c')});})[_0x907b('0x22')](handleError(_0x4f847b));};
\ No newline at end of file
index d830abb..01dfbc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0751=['removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','create','post','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','/:id/send','send','/:id','update','delete','destroy'];(function(_0x339da3,_0x6cf9a8){var _0x2ed7c4=function(_0x588933){while(--_0x588933){_0x339da3['push'](_0x339da3['shift']());}};_0x2ed7c4(++_0x6cf9a8);}(_0x0751,0x13d));var _0x1075=function(_0x225cc7,_0xeba109){_0x225cc7=_0x225cc7-0x0;var _0x217105=_0x0751[_0x225cc7];return _0x217105;};'use strict';var multer=require(_0x1075('0x0'));var util=require(_0x1075('0x1'));var path=require(_0x1075('0x2'));var timeout=require(_0x1075('0x3'));var express=require(_0x1075('0x4'));var router=express[_0x1075('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1075('0x6'));var config=require(_0x1075('0x7'));var controller=require('./whatsappAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1075('0x8')]);router[_0x1075('0x9')](_0x1075('0xa'),auth[_0x1075('0xb')](),controller['describe']);router[_0x1075('0x9')]('/:id',auth[_0x1075('0xb')](),controller[_0x1075('0xc')]);router[_0x1075('0x9')](_0x1075('0xd'),auth[_0x1075('0xb')](),controller[_0x1075('0xe')]);router[_0x1075('0x9')](_0x1075('0xf'),auth[_0x1075('0xb')](),controller[_0x1075('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x1075('0x9')](_0x1075('0x11'),auth[_0x1075('0xb')](),controller[_0x1075('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1075('0x13')]);router[_0x1075('0x14')](_0x1075('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x1075('0x14')](_0x1075('0xf'),auth[_0x1075('0xb')](),controller[_0x1075('0x15')]);router[_0x1075('0x14')](_0x1075('0x16'),auth['isAuthenticated'](),controller[_0x1075('0x17')]);router[_0x1075('0x14')](_0x1075('0x11'),auth[_0x1075('0xb')](),controller[_0x1075('0x18')]);router[_0x1075('0x14')](_0x1075('0x19'),controller[_0x1075('0x1a')]);router['post'](_0x1075('0x1b'),auth[_0x1075('0xb')](),controller[_0x1075('0x1c')]);router['put'](_0x1075('0x1d'),auth[_0x1075('0xb')](),controller[_0x1075('0x1e')]);router[_0x1075('0x1f')](_0x1075('0x1d'),auth['isAuthenticated'](),controller[_0x1075('0x20')]);router['delete'](_0x1075('0xd'),auth[_0x1075('0xb')](),controller[_0x1075('0x21')]);router['delete'](_0x1075('0xf'),auth[_0x1075('0xb')](),controller['removeAnswers']);router['delete'](_0x1075('0x16'),auth[_0x1075('0xb')](),controller[_0x1075('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0x6f97=['post','addAnswer','/:id/users','/:id/notify','notify','/:id/send','send','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','create'];(function(_0x4d7f6f,_0xfe7678){var _0x51f512=function(_0x2be95f){while(--_0x2be95f){_0x4d7f6f['push'](_0x4d7f6f['shift']());}};_0x51f512(++_0xfe7678);}(_0x6f97,0x159));var _0x76f9=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0x6f97[_0x5b47d9];return _0x4151f0;};'use strict';var multer=require('multer');var util=require(_0x76f9('0x0'));var path=require(_0x76f9('0x1'));var timeout=require(_0x76f9('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x76f9('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x76f9('0x4')]('/',auth[_0x76f9('0x5')](),controller[_0x76f9('0x6')]);router[_0x76f9('0x4')](_0x76f9('0x7'),auth[_0x76f9('0x5')](),controller[_0x76f9('0x8')]);router[_0x76f9('0x4')]('/:id',auth[_0x76f9('0x5')](),controller[_0x76f9('0x9')]);router['get'](_0x76f9('0xa'),auth[_0x76f9('0x5')](),controller['getDispositions']);router[_0x76f9('0x4')](_0x76f9('0xb'),auth[_0x76f9('0x5')](),controller[_0x76f9('0xc')]);router[_0x76f9('0x4')]('/:id/users',auth[_0x76f9('0x5')](),controller['getAgents']);router['get'](_0x76f9('0xd'),auth['isAuthenticated'](),controller['getApplications']);router['post']('/',auth[_0x76f9('0x5')](),controller[_0x76f9('0xe')]);router[_0x76f9('0xf')](_0x76f9('0xa'),auth[_0x76f9('0x5')](),controller['addDisposition']);router[_0x76f9('0xf')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x76f9('0x10')]);router[_0x76f9('0xf')](_0x76f9('0x11'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0x76f9('0xd'),auth[_0x76f9('0x5')](),controller['addApplications']);router[_0x76f9('0xf')](_0x76f9('0x12'),controller[_0x76f9('0x13')]);router[_0x76f9('0xf')](_0x76f9('0x14'),auth[_0x76f9('0x5')](),controller[_0x76f9('0x15')]);router[_0x76f9('0x16')](_0x76f9('0x17'),auth[_0x76f9('0x5')](),controller['update']);router[_0x76f9('0x18')](_0x76f9('0x17'),auth[_0x76f9('0x5')](),controller[_0x76f9('0x19')]);router[_0x76f9('0x18')](_0x76f9('0xa'),auth[_0x76f9('0x5')](),controller[_0x76f9('0x1a')]);router['delete'](_0x76f9('0xb'),auth[_0x76f9('0x5')](),controller[_0x76f9('0x1b')]);router[_0x76f9('0x18')](_0x76f9('0x11'),auth[_0x76f9('0x5')](),controller[_0x76f9('0x1c')]);module[_0x76f9('0x1d')]=router;
\ No newline at end of file
index eea6892..a815e40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a5a=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4cc75e,_0x1b57ee){var _0x4a0ac4=function(_0x221990){while(--_0x221990){_0x4cc75e['push'](_0x4cc75e['shift']());}};_0x4a0ac4(++_0x1b57ee);}(_0x7a5a,0xd3));var _0xa7a5=function(_0x2a3faf,_0x45040a){_0x2a3faf=_0x2a3faf-0x0;var _0x1d5270=_0x7a5a[_0x2a3faf];return _0x1d5270;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa7a5('0x0'));module[_0xa7a5('0x1')]={'name':{'type':Sequelize[_0xa7a5('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa7a5('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa7a5('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa7a5('0x2')],'defaultValue':function(){return rs[_0xa7a5('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa7a5('0x4')](_0xa7a5('0x5'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa7a5('0x6');}},'notificationSound':{'type':Sequelize[_0xa7a5('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa7a5('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa7a5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa7a5('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa7a5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa7a5('0x7')],'defaultValue':![],'comment':_0xa7a5('0x9'),'set':function(_0x19d728){if(!_0x19d728){this[_0xa7a5('0xa')](_0xa7a5('0xb'),null);}this[_0xa7a5('0xa')](_0xa7a5('0xc'),_0x19d728);}},'description':{'type':Sequelize[_0xa7a5('0x2')]}};
\ No newline at end of file
+var _0x6e14=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4b0c6e,_0x3797ce){var _0x2a0ab8=function(_0x1053c4){while(--_0x1053c4){_0x4b0c6e['push'](_0x4b0c6e['shift']());}};_0x2a0ab8(++_0x3797ce);}(_0x6e14,0x6c));var _0x46e1=function(_0x4be9db,_0x4b2c1b){_0x4be9db=_0x4be9db-0x0;var _0x20f265=_0x6e14[_0x4be9db];return _0x20f265;};'use strict';var Sequelize=require(_0x46e1('0x0'));var rs=require(_0x46e1('0x1'));module[_0x46e1('0x2')]={'name':{'type':Sequelize[_0x46e1('0x3')],'unique':_0x46e1('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x46e1('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x46e1('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x46e1('0x3')]},'type':{'type':Sequelize[_0x46e1('0x5')](_0x46e1('0x6'))},'accountSid':{'type':Sequelize[_0x46e1('0x3')]},'authToken':{'type':Sequelize[_0x46e1('0x3')]},'notificationTemplate':{'type':Sequelize[_0x46e1('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x46e1('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x46e1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x46e1('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x46e1('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x46e1('0x8')],'defaultValue':![],'comment':_0x46e1('0xb'),'set':function(_0x2bbc99){if(!_0x2bbc99){this[_0x46e1('0xc')](_0x46e1('0xd'),null);}this[_0x46e1('0xc')](_0x46e1('0xe'),_0x2bbc99);}},'description':{'type':Sequelize[_0x46e1('0x3')]}};
\ No newline at end of file
index 1a8cef2..d099a14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087b=['findOne','nolimit','order','Disposition','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','include','removeAnswers','addAgents','ids','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','whatsapp','Applications','account','applications','orderBy','asc','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','ValidationError','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','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','List','out','dataValues','Messages','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','WhatsappAccount,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','limit','Content-Range','json','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','offset','sort','where','filters','pick','merge','type','filter','WhatsappAccount','includeAll','findAll','params','mandatoryDispositionPause','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','describe','addDisposition','WhatsappAccountId'];(function(_0x1df378,_0x2c4af3){var _0x2cb9fe=function(_0x52c506){while(--_0x52c506){_0x1df378['push'](_0x1df378['shift']());}};_0x2cb9fe(++_0x2c4af3);}(_0x087b,0x11a));var _0xb087=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x087b[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0xb087('0x0'));var emlformat=require(_0xb087('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb087('0x2'));var rp=require('request-promise');var moment=require(_0xb087('0x3'));var BPromise=require(_0xb087('0x4'));var Mustache=require(_0xb087('0x5'));var util=require(_0xb087('0x6'));var path=require(_0xb087('0x7'));var sox=require(_0xb087('0x8'));var csv=require(_0xb087('0x9'));var ejs=require(_0xb087('0xa'));var fs=require('fs');var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x9'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var db=require('../../mysqldb')['db'];config[_0xb087('0x1a')]=_[_0xb087('0x1b')](config[_0xb087('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb087('0x1c'))(new Redis(config[_0xb087('0x1a')]));require(_0xb087('0x1d'))[_0xb087('0x1e')](socket);var jayson=require(_0xb087('0x1f'));var client=jayson[_0xb087('0x20')][_0xb087('0x21')]({'port':0x232c});function checkPasswordPattern(_0x5147e3,_0x24e1a3,_0x16d0b7){if(_0x16d0b7){var _0x5193a4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5193a4[_0xb087('0x22')](_0x24e1a3)){return _0x5147e3;}else{throw new db[(_0xb087('0x23'))]['ValidationError'](_0xb087('0x24'));}}else{return _0x5147e3;}}function respondWithRpcPromise(_0x2b83b7,_0x2e9e74,_0x5bb80b,_0x330005){return new BPromise(function(_0x3c680f,_0x17200d){var _0x45d074=_0x330005||client;return _0x45d074['request'](_0x2b83b7,_0x5bb80b)[_0xb087('0x25')](function(_0x28428e){logger[_0xb087('0x26')](_0xb087('0x27'),_0x2e9e74,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2e9e74,'request\x20sent',JSON[_0xb087('0x28')](_0x28428e));if(_0x28428e[_0xb087('0x29')]){if(_0x28428e[_0xb087('0x29')][_0xb087('0x2a')]===0x1f4){logger[_0xb087('0x29')](_0xb087('0x27'),_0x2e9e74,_0x28428e[_0xb087('0x29')]['message']);return _0x17200d(_0x28428e[_0xb087('0x29')][_0xb087('0x2b')]);}logger[_0xb087('0x29')](_0xb087('0x27'),_0x2e9e74,_0x28428e[_0xb087('0x29')]['message']);return _0x3c680f(_0x28428e[_0xb087('0x29')][_0xb087('0x2b')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x2e9e74,'request\x20sent');_0x3c680f(_0x28428e['result']['message']);}})[_0xb087('0x2c')](function(_0x45685d){logger[_0xb087('0x29')](_0xb087('0x27'),_0x2e9e74,_0x45685d);_0x17200d(_0x45685d);});});}function respondWithStatusCode(_0xd9ec66,_0xb72173){_0xb72173=_0xb72173||0xcc;return function(_0xf3f41f){if(_0xf3f41f){return _0xd9ec66[_0xb087('0x2d')](_0xb72173);}return _0xd9ec66[_0xb087('0x2e')](_0xb72173)[_0xb087('0x2f')]();};}function respondWithResult(_0x18058c,_0x31e3e6){_0x31e3e6=_0x31e3e6||0xc8;return function(_0xb0baf6){if(_0xb0baf6){return _0x18058c[_0xb087('0x2e')](_0x31e3e6)['json'](_0xb0baf6);}};}function respondWithFilteredResult(_0x37393a,_0x1335d9){return function(_0x20183f){if(_0x20183f){var _0x15c9ac=_0x20183f[_0xb087('0x30')],_0x22d441=_0x1335d9['offset'],_0xa6d90c=_0x1335d9['offset']+_0x1335d9[_0xb087('0x31')],_0x2e1c57;if(_0xa6d90c>=_0x15c9ac){_0xa6d90c=_0x15c9ac;_0x2e1c57=0xc8;}else{_0x2e1c57=0xce;}_0x37393a[_0xb087('0x2e')](_0x2e1c57);return _0x37393a['set'](_0xb087('0x32'),_0x22d441+'-'+_0xa6d90c+'/'+_0x15c9ac)[_0xb087('0x33')](_0x20183f);}return null;};}function patchUpdates(_0x2a48d3){return function(_0x32b20d){try{jsonpatch[_0xb087('0x34')](_0x32b20d,_0x2a48d3,!![]);}catch(_0x427905){return BPromise[_0xb087('0x35')](_0x427905);}return _0x32b20d[_0xb087('0x36')]();};}function saveUpdates(_0x8f4f02,_0xdc7033){return function(_0x442a5e){if(_0x442a5e){return _0x442a5e[_0xb087('0x37')](_0x8f4f02)['then'](function(_0x3bec03){return _0x3bec03;});}return null;};}function removeEntity(_0x501ebe,_0x906987){return function(_0x296e9b){if(_0x296e9b){return _0x296e9b[_0xb087('0x38')]()[_0xb087('0x25')](function(){var _0x13cb5d=_0x296e9b[_0xb087('0x39')]({'plain':!![]});var _0x32c3e8=_0xb087('0x3a');return db[_0xb087('0x3b')]['destroy']({'where':{'type':_0x32c3e8,'resourceId':_0x13cb5d['id']}})['then'](function(){return _0x296e9b;});})[_0xb087('0x25')](function(){_0x501ebe[_0xb087('0x2e')](0xcc)[_0xb087('0x2f')]();});}};}function handleEntityNotFound(_0x2d2902,_0x1982a8){return function(_0x5ca9b6){if(!_0x5ca9b6){_0x2d2902[_0xb087('0x2d')](0x194);}return _0x5ca9b6;};}function handleError(_0x1fdc19,_0x48524e){_0x48524e=_0x48524e||0x1f4;return function(_0x480e22){logger[_0xb087('0x29')](_0x480e22[_0xb087('0x3c')]);if(_0x480e22[_0xb087('0x3d')]){delete _0x480e22['name'];}_0x1fdc19[_0xb087('0x2e')](_0x48524e)[_0xb087('0x3e')](_0x480e22);};}exports[_0xb087('0x3f')]=function(_0x1ed2c9,_0x3c8f51){var _0x5db6b9={'include':[{'model':db[_0xb087('0x40')],'as':'mandatoryDispositionPause'}]},_0x7e1315={},_0x5bb6bc={'count':0x0,'rows':[]};var _0x52a98f=_[_0xb087('0x41')](db['WhatsappAccount'][_0xb087('0x42')],function(_0x5aa11d){return{'name':_0x5aa11d[_0xb087('0x43')],'type':_0x5aa11d['type'][_0xb087('0x44')]};});_0x7e1315[_0xb087('0x45')]=_[_0xb087('0x41')](_0x52a98f,_0xb087('0x3d'));_0x7e1315[_0xb087('0x46')]=_[_0xb087('0x47')](_0x1ed2c9[_0xb087('0x46')]);_0x7e1315['filters']=_[_0xb087('0x48')](_0x7e1315['model'],_0x7e1315[_0xb087('0x46')]);_0x5db6b9[_0xb087('0x49')]=_['intersection'](_0x7e1315[_0xb087('0x45')],qs[_0xb087('0x4a')](_0x1ed2c9[_0xb087('0x46')]['fields']));_0x5db6b9[_0xb087('0x49')]=_0x5db6b9['attributes'][_0xb087('0x4b')]?_0x5db6b9[_0xb087('0x49')]:_0x7e1315['model'];if(!_0x1ed2c9[_0xb087('0x46')][_0xb087('0x4c')]('nolimit')){_0x5db6b9[_0xb087('0x31')]=qs[_0xb087('0x31')](_0x1ed2c9['query'][_0xb087('0x31')]);_0x5db6b9[_0xb087('0x4d')]=qs[_0xb087('0x4d')](_0x1ed2c9[_0xb087('0x46')]['offset']);}_0x5db6b9['order']=qs[_0xb087('0x4e')](_0x1ed2c9[_0xb087('0x46')][_0xb087('0x4e')]);_0x5db6b9[_0xb087('0x4f')]=qs[_0xb087('0x50')](_[_0xb087('0x51')](_0x1ed2c9['query'],_0x7e1315['filters']),_0x52a98f);if(_0x1ed2c9[_0xb087('0x46')]['filter']){_0x5db6b9[_0xb087('0x4f')]=_[_0xb087('0x52')](_0x5db6b9[_0xb087('0x4f')],{'$or':_[_0xb087('0x41')](_0x52a98f,function(_0x521018){if(_0x521018[_0xb087('0x53')]!=='VIRTUAL'){var _0x2fe8a0={};_0x2fe8a0[_0x521018[_0xb087('0x3d')]]={'$like':'%'+_0x1ed2c9[_0xb087('0x46')][_0xb087('0x54')]+'%'};return _0x2fe8a0;}})});}_0x5db6b9=_[_0xb087('0x52')]({},_0x5db6b9,_0x1ed2c9['options']);var _0x21506f={'where':_0x5db6b9[_0xb087('0x4f')]};return db[_0xb087('0x55')]['count'](_0x21506f)[_0xb087('0x25')](function(_0x4f0bc3){_0x5bb6bc['count']=_0x4f0bc3;if(_0x1ed2c9[_0xb087('0x46')][_0xb087('0x56')]){_0x5db6b9['include']=[{'all':!![]}];}return db[_0xb087('0x55')][_0xb087('0x57')](_0x5db6b9);})[_0xb087('0x25')](function(_0x48950c){_0x5bb6bc['rows']=_0x48950c;return _0x5bb6bc;})[_0xb087('0x25')](respondWithFilteredResult(_0x3c8f51,_0x5db6b9))['catch'](handleError(_0x3c8f51,null));};exports['show']=function(_0x1e52e4,_0x3bafca){var _0x43635={'raw':![],'where':{'id':_0x1e52e4[_0xb087('0x58')]['id']},'include':[{'model':db[_0xb087('0x40')],'as':_0xb087('0x59')}]},_0x4067cf={};_0x4067cf[_0xb087('0x45')]=_[_0xb087('0x47')](db[_0xb087('0x55')][_0xb087('0x42')]);_0x4067cf[_0xb087('0x46')]=_['keys'](_0x1e52e4[_0xb087('0x46')]);_0x4067cf[_0xb087('0x50')]=_['intersection'](_0x4067cf[_0xb087('0x45')],_0x4067cf[_0xb087('0x46')]);_0x43635[_0xb087('0x49')]=_[_0xb087('0x48')](_0x4067cf[_0xb087('0x45')],qs[_0xb087('0x4a')](_0x1e52e4[_0xb087('0x46')][_0xb087('0x4a')]));_0x43635[_0xb087('0x49')]=_0x43635[_0xb087('0x49')][_0xb087('0x4b')]?_0x43635['attributes']:_0x4067cf[_0xb087('0x45')];if(_0x1e52e4['query'][_0xb087('0x56')]){_0x43635['include']=[{'all':!![]}];}_0x43635=_[_0xb087('0x52')]({},_0x43635,_0x1e52e4[_0xb087('0x5a')]);return db[_0xb087('0x55')][_0xb087('0x5b')](_0x43635)[_0xb087('0x25')](handleEntityNotFound(_0x3bafca,null))[_0xb087('0x25')](respondWithResult(_0x3bafca,null))[_0xb087('0x2c')](handleError(_0x3bafca,null));};exports[_0xb087('0x5c')]=function(_0x3f3091,_0x323e0a){return db[_0xb087('0x55')][_0xb087('0x5c')](_0x3f3091[_0xb087('0x5d')],{})[_0xb087('0x25')](function(_0x3f6fd7){var _0x122103=_0x3f3091[_0xb087('0x5e')][_0xb087('0x39')]({'plain':!![]});if(!_0x122103)throw new Error(_0xb087('0x5f'));if(_0x122103[_0xb087('0x60')]===_0xb087('0x5e')){var _0x459c5b=_0x3f6fd7['get']({'plain':!![]});var _0x43be69=_0xb087('0x3a');return db[_0xb087('0x61')]['find']({'where':{'name':_0x43be69,'userProfileId':_0x122103[_0xb087('0x62')]},'raw':!![]})[_0xb087('0x25')](function(_0x5685b1){if(_0x5685b1&&_0x5685b1[_0xb087('0x63')]===0x0){return db[_0xb087('0x3b')][_0xb087('0x5c')]({'name':_0x459c5b['name'],'resourceId':_0x459c5b['id'],'type':_0x5685b1[_0xb087('0x3d')],'sectionId':_0x5685b1['id']},{})[_0xb087('0x25')](function(){return _0x3f6fd7;});}else{return _0x3f6fd7;}})[_0xb087('0x2c')](function(_0x43ef22){logger[_0xb087('0x29')](_0xb087('0x64'),_0x43ef22);throw _0x43ef22;});}return _0x3f6fd7;})[_0xb087('0x25')](respondWithResult(_0x323e0a,0xc9))[_0xb087('0x2c')](handleError(_0x323e0a,null));};exports['update']=function(_0x3cad9b,_0x11d1d4){if(_0x3cad9b[_0xb087('0x5d')]['id']){delete _0x3cad9b['body']['id'];}return db[_0xb087('0x55')]['find']({'where':{'id':_0x3cad9b['params']['id']},'include':[{'model':db[_0xb087('0x40')],'as':_0xb087('0x59')}]})['then'](handleEntityNotFound(_0x11d1d4,null))[_0xb087('0x25')](saveUpdates(_0x3cad9b['body'],null))[_0xb087('0x25')](respondWithResult(_0x11d1d4,null))[_0xb087('0x2c')](handleError(_0x11d1d4,null));};exports['destroy']=function(_0x5e8530,_0x22219d){return db['WhatsappAccount']['find']({'where':{'id':_0x5e8530[_0xb087('0x58')]['id']}})['then'](handleEntityNotFound(_0x22219d,null))[_0xb087('0x25')](removeEntity(_0x22219d,null))['catch'](handleError(_0x22219d,null));};exports[_0xb087('0x65')]=function(_0x132dd8,_0x1d3efd){return db[_0xb087('0x55')][_0xb087('0x65')]()[_0xb087('0x25')](respondWithResult(_0x1d3efd,null))['catch'](handleError(_0x1d3efd,null));};exports[_0xb087('0x66')]=function(_0x4b8a79,_0x22e010,_0x245efb){if(_0x4b8a79[_0xb087('0x5d')]['id']){delete _0x4b8a79['body']['id'];}return db[_0xb087('0x55')]['find']({'where':{'id':_0x4b8a79[_0xb087('0x58')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x22e010,null))[_0xb087('0x25')](function(_0x2ee63f){if(_0x2ee63f){_0x4b8a79[_0xb087('0x5d')][_0xb087('0x67')]=_0x2ee63f['id'];return db['Disposition'][_0xb087('0x5c')](_0x4b8a79[_0xb087('0x5d')]);}})['then'](respondWithResult(_0x22e010,null))[_0xb087('0x2c')](handleError(_0x22e010,null));};exports['getDispositions']=function(_0x19238d,_0x38f5d2,_0x3bc717){var _0xce221c={'raw':![],'where':{}};var _0x35091b={};var _0x3c260b={'count':0x0,'rows':[]};return db[_0xb087('0x55')][_0xb087('0x68')]({'where':{'id':_0x19238d['params']['id']}})['then'](handleEntityNotFound(_0x38f5d2,null))['then'](function(_0x3a50d6){if(_0x3a50d6){_0x35091b['model']=_[_0xb087('0x47')](db['Disposition'][_0xb087('0x42')]);_0x35091b[_0xb087('0x46')]=_[_0xb087('0x47')](_0x19238d[_0xb087('0x46')]);_0x35091b['filters']=_[_0xb087('0x48')](_0x35091b['model'],_0x35091b[_0xb087('0x46')]);_0xce221c[_0xb087('0x49')]=_[_0xb087('0x48')](_0x35091b[_0xb087('0x45')],qs['fields'](_0x19238d['query'][_0xb087('0x4a')]));_0xce221c['attributes']=_0xce221c[_0xb087('0x49')][_0xb087('0x4b')]?_0xce221c[_0xb087('0x49')]:_0x35091b[_0xb087('0x45')];if(!_0x19238d['query']['hasOwnProperty'](_0xb087('0x69'))){_0xce221c['limit']=qs[_0xb087('0x31')](_0x19238d[_0xb087('0x46')][_0xb087('0x31')]);_0xce221c[_0xb087('0x4d')]=qs[_0xb087('0x4d')](_0x19238d['query'][_0xb087('0x4d')]);}_0xce221c[_0xb087('0x6a')]=qs['sort'](_0x19238d['query']['sort']);_0xce221c[_0xb087('0x4f')]=qs[_0xb087('0x50')](_[_0xb087('0x51')](_0x19238d[_0xb087('0x46')],_0x35091b[_0xb087('0x50')]));_0xce221c[_0xb087('0x4f')]['WhatsappAccountId']=_0x3a50d6['id'];if(_0x19238d[_0xb087('0x46')][_0xb087('0x54')]){_0xce221c[_0xb087('0x4f')]=_[_0xb087('0x52')](_0xce221c[_0xb087('0x4f')],{'$or':_[_0xb087('0x41')](_0xce221c[_0xb087('0x49')],function(_0x50454b){var _0x221808={};_0x221808[_0x50454b]={'$like':'%'+_0x19238d[_0xb087('0x46')][_0xb087('0x54')]+'%'};return _0x221808;})});}_0xce221c=_['merge']({},_0xce221c,_0x19238d[_0xb087('0x5a')]);return db['Disposition'][_0xb087('0x30')]({'where':_0xce221c[_0xb087('0x4f')]})[_0xb087('0x25')](function(_0x267dea){_0x3c260b[_0xb087('0x30')]=_0x267dea;if(_0x19238d[_0xb087('0x46')]['includeAll']){_0xce221c['include']=[{'all':!![]}];}return db[_0xb087('0x6b')][_0xb087('0x57')](_0xce221c);})['then'](function(_0x1e91a1){_0x3c260b[_0xb087('0x6c')]=_0x1e91a1;return _0x3c260b;});}})[_0xb087('0x25')](respondWithFilteredResult(_0x38f5d2,_0xce221c))[_0xb087('0x2c')](handleError(_0x38f5d2,null));};exports[_0xb087('0x6d')]=function(_0x631bc7,_0x4d34e2,_0x15ff29){return db[_0xb087('0x55')][_0xb087('0x5b')]({'where':{'id':_0x631bc7[_0xb087('0x58')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x4d34e2,null))[_0xb087('0x25')](function(_0xf286de){if(_0xf286de){return _0xf286de[_0xb087('0x6d')](_0x631bc7[_0xb087('0x46')]['ids']);}})[_0xb087('0x25')](respondWithStatusCode(_0x4d34e2,null))['catch'](handleError(_0x4d34e2,null));};exports[_0xb087('0x6e')]=function(_0x3a8b25,_0x47ed3c,_0x219e70){if(_0x3a8b25[_0xb087('0x5d')]['id']){delete _0x3a8b25[_0xb087('0x5d')]['id'];}return db[_0xb087('0x55')][_0xb087('0x5b')]({'where':{'id':_0x3a8b25[_0xb087('0x58')]['id']}})['then'](handleEntityNotFound(_0x47ed3c,null))[_0xb087('0x25')](function(_0x28dcea){if(_0x28dcea){_0x3a8b25[_0xb087('0x5d')][_0xb087('0x67')]=_0x28dcea['id'];return db[_0xb087('0x6f')]['create'](_0x3a8b25[_0xb087('0x5d')]);}})[_0xb087('0x25')](respondWithResult(_0x47ed3c,null))[_0xb087('0x2c')](handleError(_0x47ed3c,null));};exports[_0xb087('0x70')]=function(_0x411b00,_0x1f447f,_0xa228cf){var _0x3b970f={'raw':![],'where':{}};var _0x46f9ef={};var _0x4586d7={'count':0x0,'rows':[]};return db[_0xb087('0x55')]['findOne']({'where':{'id':_0x411b00['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x1f447f,null))[_0xb087('0x25')](function(_0x3fbbb6){if(_0x3fbbb6){_0x46f9ef[_0xb087('0x45')]=_[_0xb087('0x47')](db['CannedAnswer'][_0xb087('0x42')]);_0x46f9ef[_0xb087('0x46')]=_[_0xb087('0x47')](_0x411b00[_0xb087('0x46')]);_0x46f9ef[_0xb087('0x50')]=_[_0xb087('0x48')](_0x46f9ef['model'],_0x46f9ef[_0xb087('0x46')]);_0x3b970f['attributes']=_['intersection'](_0x46f9ef[_0xb087('0x45')],qs[_0xb087('0x4a')](_0x411b00[_0xb087('0x46')][_0xb087('0x4a')]));_0x3b970f['attributes']=_0x3b970f[_0xb087('0x49')][_0xb087('0x4b')]?_0x3b970f['attributes']:_0x46f9ef[_0xb087('0x45')];if(!_0x411b00['query']['hasOwnProperty'](_0xb087('0x69'))){_0x3b970f[_0xb087('0x31')]=qs[_0xb087('0x31')](_0x411b00[_0xb087('0x46')][_0xb087('0x31')]);_0x3b970f['offset']=qs[_0xb087('0x4d')](_0x411b00[_0xb087('0x46')][_0xb087('0x4d')]);}_0x3b970f[_0xb087('0x6a')]=qs['sort'](_0x411b00['query']['sort']);_0x3b970f['where']=qs[_0xb087('0x50')](_[_0xb087('0x51')](_0x411b00[_0xb087('0x46')],_0x46f9ef[_0xb087('0x50')]));_0x3b970f[_0xb087('0x4f')][_0xb087('0x67')]=_0x3fbbb6['id'];if(_0x411b00[_0xb087('0x46')]['filter']){_0x3b970f['where']=_[_0xb087('0x52')](_0x3b970f[_0xb087('0x4f')],{'$or':_[_0xb087('0x41')](_0x3b970f[_0xb087('0x49')],function(_0x4e6c80){var _0x35da7c={};_0x35da7c[_0x4e6c80]={'$like':'%'+_0x411b00['query'][_0xb087('0x54')]+'%'};return _0x35da7c;})});}_0x3b970f=_['merge']({},_0x3b970f,_0x411b00[_0xb087('0x5a')]);return db[_0xb087('0x6f')][_0xb087('0x30')]({'where':_0x3b970f[_0xb087('0x4f')]})['then'](function(_0x2c7013){_0x4586d7['count']=_0x2c7013;if(_0x411b00['query']['includeAll']){_0x3b970f[_0xb087('0x71')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb087('0x57')](_0x3b970f);})[_0xb087('0x25')](function(_0x3e0c31){_0x4586d7[_0xb087('0x6c')]=_0x3e0c31;return _0x4586d7;});}})[_0xb087('0x25')](respondWithFilteredResult(_0x1f447f,_0x3b970f))[_0xb087('0x2c')](handleError(_0x1f447f,null));};exports[_0xb087('0x72')]=function(_0x4688ae,_0x3a519a,_0x13b3da){return db[_0xb087('0x55')][_0xb087('0x5b')]({'where':{'id':_0x4688ae[_0xb087('0x58')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x3a519a,null))[_0xb087('0x25')](function(_0x2575c6){if(_0x2575c6){return _0x2575c6[_0xb087('0x72')](_0x4688ae[_0xb087('0x46')]['ids']);}})[_0xb087('0x25')](respondWithStatusCode(_0x3a519a,null))['catch'](handleError(_0x3a519a,null));};exports[_0xb087('0x73')]=function(_0xb6f9d4,_0x3e1c25,_0x2965f1){return db[_0xb087('0x55')][_0xb087('0x5b')]({'where':{'id':_0xb6f9d4[_0xb087('0x58')]['id']}})['then'](handleEntityNotFound(_0x3e1c25,null))['then'](function(_0x5194f2){if(_0x5194f2){return _0x5194f2[_0xb087('0x73')](_0xb6f9d4[_0xb087('0x5d')][_0xb087('0x74')],_[_0xb087('0x75')](_0xb6f9d4[_0xb087('0x5d')],[_0xb087('0x74'),'id'])||{})[_0xb087('0x76')](function(_0x37665a){for(var _0x181c56=0x0;_0x181c56<_0xb6f9d4['body'][_0xb087('0x74')]['length'];_0x181c56+=0x1){socket[_0xb087('0x77')](_0xb087('0x78'),{'UserId':_0xb6f9d4['body']['ids'][_0x181c56],'WhatsappAccountId':_0xb6f9d4[_0xb087('0x58')]['id']});}return _0x37665a;});}})[_0xb087('0x25')](respondWithResult(_0x3e1c25,null))[_0xb087('0x2c')](handleError(_0x3e1c25,null));};exports[_0xb087('0x79')]=function(_0x5069f2,_0x432f0e,_0x385ef7){return db['WhatsappAccount']['find']({'where':{'id':_0x5069f2[_0xb087('0x58')]['id']}})['then'](handleEntityNotFound(_0x432f0e,null))['then'](function(_0x25a113){if(_0x25a113){return _0x25a113['removeAgents'](_0x5069f2[_0xb087('0x46')][_0xb087('0x74')])[_0xb087('0x25')](function(){if(_[_0xb087('0x7a')](_0x5069f2[_0xb087('0x46')][_0xb087('0x74')])){for(var _0x8c334e=0x0;_0x8c334e<_0x5069f2[_0xb087('0x46')]['ids'][_0xb087('0x4b')];_0x8c334e+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x5069f2[_0xb087('0x46')][_0xb087('0x74')][_0x8c334e]),'WhatsappAccountId':Number(_0x5069f2[_0xb087('0x58')]['id'])});}}else{socket['emit'](_0xb087('0x7b'),{'UserId':Number(_0x5069f2[_0xb087('0x46')][_0xb087('0x74')]),'WhatsappAccountId':Number(_0x5069f2[_0xb087('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x432f0e,null))[_0xb087('0x2c')](handleError(_0x432f0e,null));};exports[_0xb087('0x7c')]=function(_0x34695b,_0x46f5e6,_0x38b851){var _0x17a359={};var _0x21fb63={};var _0x4d8fcd;var _0x1de68b;return db[_0xb087('0x55')][_0xb087('0x68')]({'where':{'id':_0x34695b[_0xb087('0x58')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x46f5e6,null))[_0xb087('0x25')](function(_0x4d0b46){if(_0x4d0b46){_0x4d8fcd=_0x4d0b46;_0x21fb63[_0xb087('0x45')]=_[_0xb087('0x47')](db[_0xb087('0x7d')]['rawAttributes']);_0x21fb63['query']=_[_0xb087('0x47')](_0x34695b[_0xb087('0x46')]);_0x21fb63[_0xb087('0x50')]=_[_0xb087('0x48')](_0x21fb63[_0xb087('0x45')],_0x21fb63[_0xb087('0x46')]);_0x17a359[_0xb087('0x49')]=_[_0xb087('0x48')](_0x21fb63[_0xb087('0x45')],qs[_0xb087('0x4a')](_0x34695b['query'][_0xb087('0x4a')]));_0x17a359[_0xb087('0x49')]=_0x17a359[_0xb087('0x49')][_0xb087('0x4b')]?_0x17a359[_0xb087('0x49')]:_0x21fb63['model'];_0x17a359[_0xb087('0x6a')]=qs[_0xb087('0x4e')](_0x34695b[_0xb087('0x46')][_0xb087('0x4e')]);_0x17a359['where']=qs[_0xb087('0x50')](_['pick'](_0x34695b[_0xb087('0x46')],_0x21fb63['filters']));if(_0x34695b['query'][_0xb087('0x54')]){_0x17a359[_0xb087('0x4f')]=_[_0xb087('0x52')](_0x17a359['where'],{'$or':_['map'](_0x17a359[_0xb087('0x49')],function(_0x2a9c59){var _0x169e2b={};_0x169e2b[_0x2a9c59]={'$like':'%'+_0x34695b[_0xb087('0x46')][_0xb087('0x54')]+'%'};return _0x169e2b;})});}_0x17a359=_['merge']({},_0x17a359,_0x34695b[_0xb087('0x5a')]);return _0x4d8fcd[_0xb087('0x7c')](_0x17a359);}})[_0xb087('0x25')](function(_0x1ebaeb){if(_0x1ebaeb){_0x1de68b=_0x1ebaeb[_0xb087('0x4b')];if(!_0x34695b[_0xb087('0x46')]['hasOwnProperty']('nolimit')){_0x17a359[_0xb087('0x31')]=qs[_0xb087('0x31')](_0x34695b['query'][_0xb087('0x31')]);_0x17a359['offset']=qs['offset'](_0x34695b[_0xb087('0x46')][_0xb087('0x4d')]);}return _0x4d8fcd[_0xb087('0x7c')](_0x17a359);}})[_0xb087('0x25')](function(_0xc9faba){if(_0xc9faba){return _0xc9faba?{'count':_0x1de68b,'rows':_0xc9faba}:null;}})[_0xb087('0x25')](respondWithResult(_0x46f5e6,null))[_0xb087('0x2c')](handleError(_0x46f5e6,null));};exports[_0xb087('0x7e')]=function(_0x3916f7,_0xff9c0c,_0x5cbd3a){return db['WhatsappAccount']['findOne']({'where':{'id':_0x3916f7[_0xb087('0x58')]['id']}})['then'](handleEntityNotFound(_0xff9c0c,null))[_0xb087('0x25')](function(_0x53cf73){if(_0x53cf73){return db['sequelize'][_0xb087('0x7f')](function(_0x2e3036){return db[_0xb087('0x80')][_0xb087('0x38')]({'where':{'WhatsappAccountId':_0x3916f7[_0xb087('0x58')]['id']},'transaction':_0x2e3036})[_0xb087('0x25')](function(_0x187df1){var _0x778002=_[_0xb087('0x41')](_0x3916f7[_0xb087('0x5d')],function(_0x5ae13d){_0x5ae13d[_0xb087('0x67')]=_0x3916f7['params']['id'];return _0x5ae13d;});return db[_0xb087('0x80')][_0xb087('0x81')](_0x778002,{'transaction':_0x2e3036});});})['then'](function(){return db[_0xb087('0x80')][_0xb087('0x82')]({'where':{'WhatsappAccountId':_0x3916f7['params']['id']},'order':'priority'});});}})[_0xb087('0x25')](respondWithResult(_0xff9c0c,null))['catch'](handleError(_0xff9c0c,null));};exports[_0xb087('0x83')]=function(_0x4b796b,_0x1e04ff,_0x1a99a3){var _0x153a64={};var _0x59f732={};var _0x140eb0;var _0x10a281;return db[_0xb087('0x55')][_0xb087('0x68')]({'where':{'id':_0x4b796b[_0xb087('0x58')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x1e04ff,null))[_0xb087('0x25')](function(_0x1b6679){if(_0x1b6679){_0x140eb0=_0x1b6679;_0x59f732[_0xb087('0x45')]=_[_0xb087('0x47')](db['WhatsappApplication'][_0xb087('0x42')]);_0x59f732['query']=_[_0xb087('0x47')](_0x4b796b[_0xb087('0x46')]);_0x59f732[_0xb087('0x50')]=_['intersection'](_0x59f732['model'],_0x59f732['query']);_0x153a64[_0xb087('0x49')]=_[_0xb087('0x48')](_0x59f732[_0xb087('0x45')],qs[_0xb087('0x4a')](_0x4b796b[_0xb087('0x46')][_0xb087('0x4a')]));_0x153a64[_0xb087('0x49')]=_0x153a64['attributes'][_0xb087('0x4b')]?_0x153a64['attributes']:_0x59f732['model'];_0x153a64['order']=qs['sort'](_0x4b796b[_0xb087('0x46')][_0xb087('0x4e')]);_0x153a64['where']=qs[_0xb087('0x50')](_[_0xb087('0x51')](_0x4b796b[_0xb087('0x46')],_0x59f732['filters']));if(_0x4b796b[_0xb087('0x46')][_0xb087('0x54')]){_0x153a64['where']=_[_0xb087('0x52')](_0x153a64[_0xb087('0x4f')],{'$or':_[_0xb087('0x41')](_0x153a64[_0xb087('0x49')],function(_0x4ae724){var _0x270e65={};_0x270e65[_0x4ae724]={'$like':'%'+_0x4b796b[_0xb087('0x46')][_0xb087('0x54')]+'%'};return _0x270e65;})});}_0x153a64=_[_0xb087('0x52')]({},_0x153a64,_0x4b796b[_0xb087('0x5a')]);return _0x140eb0[_0xb087('0x83')](_0x153a64);}})['then'](function(_0x3ecac5){if(_0x3ecac5){_0x10a281=_0x3ecac5['length'];if(!_0x4b796b[_0xb087('0x46')][_0xb087('0x4c')]('nolimit')){_0x153a64[_0xb087('0x31')]=qs['limit'](_0x4b796b['query']['limit']);_0x153a64[_0xb087('0x4d')]=qs[_0xb087('0x4d')](_0x4b796b[_0xb087('0x46')][_0xb087('0x4d')]);}return _0x140eb0[_0xb087('0x83')](_0x153a64);}})[_0xb087('0x25')](function(_0x2831b4){if(_0x2831b4){return _0x2831b4?{'count':_0x10a281,'rows':_0x2831b4}:null;}})[_0xb087('0x25')](respondWithResult(_0x1e04ff,null))['catch'](handleError(_0x1e04ff,null));};exports[_0xb087('0x84')]=function(_0x5bda25,_0x50a215,_0x28e67e){var _0x1babd3={'channel':_0xb087('0x85')};var _0x521c00=[];var _0x564c85=[];var _0x307202={};return db[_0xb087('0x55')][_0xb087('0x5b')]({'where':{'id':_0x5bda25[_0xb087('0x58')]['id']},'include':[{'model':db[_0xb087('0x80')],'as':_0xb087('0x86')}]})['then'](handleEntityNotFound(_0x50a215,null))['then'](function(_0x54eed6){_0x1babd3[_0xb087('0x87')]=_0x54eed6;_0x1babd3[_0xb087('0x88')]=_[_0xb087('0x89')](_0x54eed6[_0xb087('0x86')],['priority'],[_0xb087('0x8a')]);if(_0x1babd3[_0xb087('0x87')][_0xb087('0x86')]){delete _0x1babd3[_0xb087('0x87')][_0xb087('0x86')];}return db[_0xb087('0x8b')][_0xb087('0x65')]();})[_0xb087('0x25')](function(_0x120012){if(!_0x120012){throw new db[(_0xb087('0x23'))]['ValidationError']('no\x20available\x20attributes');}_0x521c00=_[_0xb087('0x8c')](_[_0xb087('0x47')](_0x120012),[_0xb087('0x8d'),_0xb087('0x8e')]);_0x564c85=_[_0xb087('0x8c')](_[_0xb087('0x47')](_0x120012),[_0xb087('0x8d'),_0xb087('0x8e'),_0xb087('0x8f'),_0xb087('0x90')]);_0x1babd3[_0xb087('0x5d')]={'mapKey':_0xb087('0x91')};if(_0x1babd3[_0xb087('0x87')][_0xb087('0x53')]&&_0x1babd3[_0xb087('0x87')][_0xb087('0x53')]===_0xb087('0x92')){_0x1babd3[_0xb087('0x5d')][_0xb087('0x93')]=_0x5bda25[_0xb087('0x5d')][_0xb087('0x94')][_0xb087('0x95')](_0xb087('0x96'),'');_0x1babd3[_0xb087('0x5d')][_0xb087('0x5d')]=_0x5bda25[_0xb087('0x5d')][_0xb087('0x97')];_0x1babd3[_0xb087('0x5d')][_0xb087('0x98')]=_0x5bda25[_0xb087('0x5d')][_0xb087('0x99')];}if(_0x1babd3[_0xb087('0x5d')]['id']){delete _0x1babd3[_0xb087('0x5d')]['id'];}if(_[_0xb087('0x9a')](_0x1babd3[_0xb087('0x5d')][_0xb087('0x93')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb087('0x9a')](_0x1babd3[_0xb087('0x5d')]['body'])||_0x1babd3[_0xb087('0x5d')]['body']===''){throw new db[(_0xb087('0x23'))][(_0xb087('0x9b'))](_0xb087('0x9c'));}if(_[_0xb087('0x9a')](_0x1babd3[_0xb087('0x5d')][_0xb087('0x9d')])){throw new db[(_0xb087('0x23'))][(_0xb087('0x9b'))](_0xb087('0x9e')+_0x564c85);}if(!_[_0xb087('0x9f')](_0x564c85,_0x1babd3[_0xb087('0x5d')]['mapKey'])){throw new db[(_0xb087('0x23'))][(_0xb087('0x9b'))](_0xb087('0xa0')+_0x564c85);}_0x307202[_0x1babd3[_0xb087('0x5d')]['mapKey']]=_0x1babd3[_0xb087('0x5d')][_0xb087('0x93')];return db[_0xb087('0xa1')][_0xb087('0x5b')]({'where':{'id':_0x1babd3[_0xb087('0x87')][_0xb087('0x90')]},'include':[{'model':db[_0xb087('0x8b')],'as':_0xb087('0xa2'),'where':_0x307202,'limit':0x1,'order':[[_0xb087('0x8e'),_0xb087('0xa3')]]}]});})[_0xb087('0x25')](handleEntityNotFound(_0x50a215,null))[_0xb087('0x25')](function(_0x157df6){if(_0x157df6){_0x1babd3[_0xb087('0xa4')]=_[_0xb087('0x75')](_0x157df6,[_0xb087('0xa2')]);if(_0x157df6[_0xb087('0xa2')][_0xb087('0x4b')]){return _0x157df6['Contacts'][0x0];}var _0x16647d=_[_0xb087('0x1b')](_0x1babd3[_0xb087('0x5d')],{'firstName':_0x1babd3[_0xb087('0x5d')]['from'],'ListId':_0x157df6['id']});_0x16647d[_0x1babd3[_0xb087('0x5d')][_0xb087('0x9d')]]=_0x1babd3[_0xb087('0x5d')][_0xb087('0x93')];return db[_0xb087('0x8b')]['create'](_0x16647d,{'fields':_0x521c00,'raw':!![]});}})[_0xb087('0x25')](handleEntityNotFound(_0x50a215,null))[_0xb087('0x25')](function(_0x226609){if(_0x226609){_0x1babd3[_0xb087('0xa5')]=_0x226609;var _0x74e7ee={'ContactId':_0x226609['id'],'phone':_0x1babd3[_0xb087('0x5d')][_0xb087('0x93')],'WhatsappAccountId':_0x5bda25[_0xb087('0x58')]['id']};var _0x58a76b={'ContactId':_0x226609['id'],'WhatsappAccountId':_0x5bda25[_0xb087('0x58')]['id'],'closed':![]};return db[_0xb087('0xa6')]['find']({'where':_0x58a76b})[_0xb087('0x25')](function(_0x254726){if(_0x254726){return[_0x254726,![]];}return db['WhatsappInteraction'][_0xb087('0x5c')](_0x74e7ee)[_0xb087('0x25')](function(_0x3a0877){return[_0x3a0877,!![]];});});}})[_0xb087('0x76')](function(_0x457f38,_0x24d014){_0x1babd3[_0xb087('0xa7')]=_0x457f38['get']({'plain':!![]});_0x1babd3[_0xb087('0xa7')][_0xb087('0xa8')]=![];if(_0x24d014){if(_0x1babd3[_0xb087('0x87')][_0xb087('0xa9')]){_0x1babd3[_0xb087('0x88')][_0xb087('0xaa')]({'id':0x0,'priority':_0x1babd3['applications'][_0xb087('0x4b')]+0x1,'app':_0xb087('0xab'),'appdata':_0xb087('0xac'),'interval':_0xb087('0xad')});}_0x1babd3[_0xb087('0xa7')]['created']=!![];}return db[_0xb087('0xae')][_0xb087('0x5c')]({'phone':_0x1babd3[_0xb087('0x5d')]['from'],'messageId':_0x1babd3[_0xb087('0x5d')]['messageId'],'body':_0x1babd3[_0xb087('0x5d')]['body'],'WhatsappAccountId':_0x5bda25[_0xb087('0x58')]['id'],'WhatsappInteractionId':_0x457f38['id'],'direction':'in','ContactId':_0x457f38['ContactId'],'AttachmentId':_0x1babd3[_0xb087('0x5d')][_0xb087('0xaf')]});})['then'](function(_0x1b7450){_0x1babd3['message']=_0x1b7450;if(_0x1babd3['interaction']['UserId']){return db[_0xb087('0x7d')]['find']({'attributes':['id',_0xb087('0x3d')],'where':{'id':_0x1babd3['interaction']['UserId']}})[_0xb087('0x25')](function(_0x3221b8){if(_0x3221b8){_0x1babd3[_0xb087('0x88')][_0xb087('0xb0')]({'id':0x0,'priority':0x0,'app':_0xb087('0xb1'),'appdata':_0x3221b8['name']+','+(_0x1babd3[_0xb087('0x87')][_0xb087('0xb2')]||0xa),'interval':_0xb087('0xad')});}return respondWithRpcPromise(_0xb087('0xb3'),_0xb087('0xb4'),_0x1babd3);});}return respondWithRpcPromise(_0xb087('0xb3'),_0xb087('0xb4'),_0x1babd3);})[_0xb087('0x25')](function(_0x57d42a){if(_0x57d42a){var _0x451c8a=0xc8;var _0x3768db=_0xb087('0xb5');logger['info'](_0xb087('0xb6'),_0x3768db,_0x451c8a,_0xb087('0xb7'));logger[_0xb087('0xb8')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3768db,_0x451c8a,'entity\x20found',JSON[_0xb087('0x28')](_0x57d42a));if(_0x1babd3[_0xb087('0x87')][_0xb087('0x53')]===_0xb087('0x92')){return _0x50a215['status'](_0x451c8a)[_0xb087('0xb9')](_0xb087('0xba'),_0xb087('0xbb'))[_0xb087('0x3e')](_0xb087('0xbc'));}else{return _0x50a215['status'](_0x451c8a)['json'](_0x57d42a);}}})[_0xb087('0x2c')](handleError(_0x50a215,null));};exports[_0xb087('0x3e')]=function(_0x4c0bea,_0x33b714,_0x240905){var _0x2118e5,_0x3ac2ff,_0x286a72;if(_[_0xb087('0x9a')](_0x4c0bea[_0xb087('0x5d')]['body'])||_0x4c0bea[_0xb087('0x5d')][_0xb087('0x5d')]===''){throw new db[(_0xb087('0x23'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb087('0x9a')](_0x4c0bea[_0xb087('0x5d')]['to'])){throw new db[(_0xb087('0x23'))][(_0xb087('0x9b'))]('to\x20is\x20mandatory');}_0x2118e5=_0x4c0bea[_0xb087('0x5d')]['to'];return db[_0xb087('0x55')][_0xb087('0x5b')]({'where':{'id':_0x4c0bea['params']['id']},'include':[{'model':db['CmList'],'as':_0xb087('0xbd'),'include':[{'model':db['CmContact'],'as':_0xb087('0xa2'),'where':{'mobile':_0x2118e5},'limit':0x1,'order':[[_0xb087('0x8e'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x33b714,null))[_0xb087('0x25')](function(_0x258f93){if(_0x258f93&&_0x258f93[_0xb087('0xbd')]){_0x3ac2ff=_0x258f93[_0xb087('0x39')]({'plain':!![]});if(_0x3ac2ff['List']&&_0x3ac2ff[_0xb087('0xbd')]['Contacts']['length']){return _0x3ac2ff[_0xb087('0xbd')][_0xb087('0xa2')][0x0];}return db[_0xb087('0x8b')][_0xb087('0x5c')](_[_0xb087('0x1b')](_0x4c0bea['body'],{'firstName':_0x2118e5,'mobile':_0x2118e5,'phone':_0x2118e5,'ListId':_0x3ac2ff[_0xb087('0x90')]}));}})['then'](handleEntityNotFound(_0x33b714,null))['then'](function(_0x46f8cf){if(_0x46f8cf){_0x286a72=_0x46f8cf;return db[_0xb087('0xa6')]['find']({'where':{'ContactId':_0x286a72['id'],'closed':![],'WhatsappAccountId':_0x3ac2ff['id']}})[_0xb087('0x25')](function(_0x112558){if(_0x112558){return[_0x112558,![]];}return db[_0xb087('0xa6')][_0xb087('0x5c')]({'UserId':_0x4c0bea['user']['id'],'ContactId':_0x286a72['id'],'WhatsappAccountId':_0x3ac2ff['id'],'phone':_0x2118e5,'firstMsgDirection':_0xb087('0xbe'),'Messages':[_[_0xb087('0x52')](_0x4c0bea[_0xb087('0x5d')],{'read':![],'body':_0x4c0bea[_0xb087('0x5d')][_0xb087('0x5d')],'phone':_0x2118e5,'WhatsappAccountId':_0x3ac2ff['id'],'UserId':_0x4c0bea['user']['id'],'ContactId':_0x286a72['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})[_0xb087('0x25')](function(_0x5746f0){return[_0x5746f0,!![]];});});}})[_0xb087('0x76')](function(_0x38a259,_0x4c1577){if(_0x4c1577){return _0x38a259;}return db[_0xb087('0xae')][_0xb087('0x5c')](_[_0xb087('0x52')](_0x4c0bea[_0xb087('0x5d')],{'read':![],'body':_0x4c0bea[_0xb087('0x5d')][_0xb087('0x5d')],'phone':_0x2118e5,'WhatsappAccountId':_0x3ac2ff['id'],'WhatsappInteractionId':_0x38a259['id'],'UserId':_0x4c0bea[_0xb087('0x5e')]['id'],'ContactId':_0x286a72['id']}))[_0xb087('0x25')](function(_0x521e0c){_0x38a259[_0xb087('0xbf')][_0xb087('0xc0')]=[];_0x38a259[_0xb087('0xbf')]['Messages'][_0xb087('0xaa')](_0x521e0c[_0xb087('0xbf')]);return _0x38a259;});})[_0xb087('0x25')](respondWithResult(_0x33b714,null))[_0xb087('0x2c')](handleError(_0x33b714,null));};
\ No newline at end of file
+var _0x5ec6=['destroy','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','WhatsappAccountId','filter','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','addApplications','sequelize','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','whatsapp','account','orderBy','priority','asc','Applications','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','from','From','whatsapp:','Body','messageId','isNil','from\x20is\x20mandatory','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','ListId','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','created','applications','push','*,*,*,*','WhatsappMessage','ContactId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','defaults','out','Messages','dataValues','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','get','WhatsappAccounts','UserProfileResource'];(function(_0xb61c4e,_0x4cc1ca){var _0x2a5cbb=function(_0x132f5b){while(--_0x132f5b){_0xb61c4e['push'](_0xb61c4e['shift']());}};_0x2a5cbb(++_0x4cc1ca);}(_0x5ec6,0x7f));var _0x65ec=function(_0x39992f,_0x244fde){_0x39992f=_0x39992f-0x0;var _0x20711f=_0x5ec6[_0x39992f];return _0x20711f;};'use strict';var pdf=require(_0x65ec('0x0'));var emlformat=require(_0x65ec('0x1'));var rimraf=require(_0x65ec('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65ec('0x3'));var rp=require('request-promise');var moment=require(_0x65ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65ec('0x5'));var util=require('util');var path=require(_0x65ec('0x6'));var sox=require('sox');var csv=require(_0x65ec('0x7'));var ejs=require(_0x65ec('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0x7'));var querystring=require(_0x65ec('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xe'));var hardwareService=require(_0x65ec('0xf'));var logger=require('../../config/logger')(_0x65ec('0x10'));var utils=require(_0x65ec('0x11'));var config=require('../../config/environment');var db=require(_0x65ec('0x12'))['db'];config[_0x65ec('0x13')]=_['defaults'](config[_0x65ec('0x13')],{'host':_0x65ec('0x14'),'port':0x18eb});var socket=require(_0x65ec('0x15'))(new Redis(config[_0x65ec('0x13')]));require(_0x65ec('0x16'))[_0x65ec('0x17')](socket);var jayson=require(_0x65ec('0x18'));var client=jayson[_0x65ec('0x19')]['http']({'port':0x232c});function checkPasswordPattern(_0x28be8b,_0x3ed6f7,_0x35d06b){if(_0x35d06b){var _0x4bbe88=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bbe88['test'](_0x3ed6f7)){return _0x28be8b;}else{throw new db[(_0x65ec('0x1a'))][(_0x65ec('0x1b'))](_0x65ec('0x1c'));}}else{return _0x28be8b;}}function respondWithRpcPromise(_0x4f2c63,_0x25dae7,_0x286eac,_0x1254f8){return new BPromise(function(_0xb4ed90,_0x29ebc4){var _0xd81ed3=_0x1254f8||client;return _0xd81ed3[_0x65ec('0x1d')](_0x4f2c63,_0x286eac)[_0x65ec('0x1e')](function(_0x2127e2){logger[_0x65ec('0x1f')](_0x65ec('0x20'),_0x25dae7,_0x65ec('0x21'));logger[_0x65ec('0x22')](_0x65ec('0x23'),_0x25dae7,_0x65ec('0x21'),JSON[_0x65ec('0x24')](_0x2127e2));if(_0x2127e2[_0x65ec('0x25')]){if(_0x2127e2[_0x65ec('0x25')][_0x65ec('0x26')]===0x1f4){logger['error'](_0x65ec('0x20'),_0x25dae7,_0x2127e2[_0x65ec('0x25')][_0x65ec('0x27')]);return _0x29ebc4(_0x2127e2[_0x65ec('0x25')][_0x65ec('0x27')]);}logger[_0x65ec('0x25')](_0x65ec('0x20'),_0x25dae7,_0x2127e2['error'][_0x65ec('0x27')]);return _0xb4ed90(_0x2127e2[_0x65ec('0x25')][_0x65ec('0x27')]);}else{logger[_0x65ec('0x1f')](_0x65ec('0x20'),_0x25dae7,_0x65ec('0x21'));_0xb4ed90(_0x2127e2[_0x65ec('0x28')][_0x65ec('0x27')]);}})[_0x65ec('0x29')](function(_0x4c846b){logger[_0x65ec('0x25')](_0x65ec('0x20'),_0x25dae7,_0x4c846b);_0x29ebc4(_0x4c846b);});});}function respondWithStatusCode(_0x251831,_0x23b1a3){_0x23b1a3=_0x23b1a3||0xcc;return function(_0x4de451){if(_0x4de451){return _0x251831[_0x65ec('0x2a')](_0x23b1a3);}return _0x251831['status'](_0x23b1a3)[_0x65ec('0x2b')]();};}function respondWithResult(_0x1ada47,_0x1d0b5c){_0x1d0b5c=_0x1d0b5c||0xc8;return function(_0x30366c){if(_0x30366c){return _0x1ada47[_0x65ec('0x2c')](_0x1d0b5c)[_0x65ec('0x2d')](_0x30366c);}};}function respondWithFilteredResult(_0x46bf66,_0x39410f){return function(_0x984a82){if(_0x984a82){var _0xeec5d4=_0x984a82[_0x65ec('0x2e')],_0x3c97e2=_0x39410f['offset'],_0x4b435c=_0x39410f[_0x65ec('0x2f')]+_0x39410f[_0x65ec('0x30')],_0x50d81f;if(_0x4b435c>=_0xeec5d4){_0x4b435c=_0xeec5d4;_0x50d81f=0xc8;}else{_0x50d81f=0xce;}_0x46bf66['status'](_0x50d81f);return _0x46bf66[_0x65ec('0x31')](_0x65ec('0x32'),_0x3c97e2+'-'+_0x4b435c+'/'+_0xeec5d4)[_0x65ec('0x2d')](_0x984a82);}return null;};}function patchUpdates(_0x3c8dd7){return function(_0x491dc6){try{jsonpatch[_0x65ec('0x33')](_0x491dc6,_0x3c8dd7,!![]);}catch(_0x3b9dcb){return BPromise[_0x65ec('0x34')](_0x3b9dcb);}return _0x491dc6[_0x65ec('0x35')]();};}function saveUpdates(_0x3e4f4f,_0x3826fa){return function(_0x38dea3){if(_0x38dea3){return _0x38dea3[_0x65ec('0x36')](_0x3e4f4f)[_0x65ec('0x1e')](function(_0xff3f3c){return _0xff3f3c;});}return null;};}function removeEntity(_0x50db17,_0x6a5861){return function(_0x1e20c4){if(_0x1e20c4){return _0x1e20c4['destroy']()[_0x65ec('0x1e')](function(){var _0x24a242=_0x1e20c4[_0x65ec('0x37')]({'plain':!![]});var _0x2b8aca=_0x65ec('0x38');return db[_0x65ec('0x39')][_0x65ec('0x3a')]({'where':{'type':_0x2b8aca,'resourceId':_0x24a242['id']}})['then'](function(){return _0x1e20c4;});})[_0x65ec('0x1e')](function(){_0x50db17[_0x65ec('0x2c')](0xcc)[_0x65ec('0x2b')]();});}};}function handleEntityNotFound(_0x185447,_0x5028e3){return function(_0x5d8458){if(!_0x5d8458){_0x185447[_0x65ec('0x2a')](0x194);}return _0x5d8458;};}function handleError(_0x398edd,_0x940f13){_0x940f13=_0x940f13||0x1f4;return function(_0x55ac61){logger['error'](_0x55ac61[_0x65ec('0x3b')]);if(_0x55ac61['name']){delete _0x55ac61[_0x65ec('0x3c')];}_0x398edd[_0x65ec('0x2c')](_0x940f13)['send'](_0x55ac61);};}exports[_0x65ec('0x3d')]=function(_0x1fbc2b,_0x13aa56){var _0x5357bf={'include':[{'model':db[_0x65ec('0x3e')],'as':_0x65ec('0x3f')}]},_0x3cffbf={},_0x3b72cf={'count':0x0,'rows':[]};var _0x470bb3=_[_0x65ec('0x40')](db[_0x65ec('0x41')]['rawAttributes'],function(_0x28653a){return{'name':_0x28653a['fieldName'],'type':_0x28653a[_0x65ec('0x42')][_0x65ec('0x43')]};});_0x3cffbf[_0x65ec('0x44')]=_[_0x65ec('0x40')](_0x470bb3,_0x65ec('0x3c'));_0x3cffbf[_0x65ec('0x45')]=_['keys'](_0x1fbc2b[_0x65ec('0x45')]);_0x3cffbf['filters']=_['intersection'](_0x3cffbf[_0x65ec('0x44')],_0x3cffbf[_0x65ec('0x45')]);_0x5357bf[_0x65ec('0x46')]=_[_0x65ec('0x47')](_0x3cffbf[_0x65ec('0x44')],qs['fields'](_0x1fbc2b['query'][_0x65ec('0x48')]));_0x5357bf[_0x65ec('0x46')]=_0x5357bf[_0x65ec('0x46')][_0x65ec('0x49')]?_0x5357bf[_0x65ec('0x46')]:_0x3cffbf['model'];if(!_0x1fbc2b['query'][_0x65ec('0x4a')](_0x65ec('0x4b'))){_0x5357bf[_0x65ec('0x30')]=qs[_0x65ec('0x30')](_0x1fbc2b[_0x65ec('0x45')][_0x65ec('0x30')]);_0x5357bf[_0x65ec('0x2f')]=qs['offset'](_0x1fbc2b[_0x65ec('0x45')][_0x65ec('0x2f')]);}_0x5357bf[_0x65ec('0x4c')]=qs['sort'](_0x1fbc2b[_0x65ec('0x45')][_0x65ec('0x4d')]);_0x5357bf['where']=qs[_0x65ec('0x4e')](_[_0x65ec('0x4f')](_0x1fbc2b[_0x65ec('0x45')],_0x3cffbf[_0x65ec('0x4e')]),_0x470bb3);if(_0x1fbc2b[_0x65ec('0x45')]['filter']){_0x5357bf[_0x65ec('0x50')]=_[_0x65ec('0x51')](_0x5357bf[_0x65ec('0x50')],{'$or':_[_0x65ec('0x40')](_0x470bb3,function(_0x59c182){if(_0x59c182[_0x65ec('0x42')]!=='VIRTUAL'){var _0x1ed0f9={};_0x1ed0f9[_0x59c182[_0x65ec('0x3c')]]={'$like':'%'+_0x1fbc2b[_0x65ec('0x45')]['filter']+'%'};return _0x1ed0f9;}})});}_0x5357bf=_['merge']({},_0x5357bf,_0x1fbc2b[_0x65ec('0x52')]);var _0x45d2bc={'where':_0x5357bf[_0x65ec('0x50')]};return db[_0x65ec('0x41')][_0x65ec('0x2e')](_0x45d2bc)[_0x65ec('0x1e')](function(_0x1c546c){_0x3b72cf[_0x65ec('0x2e')]=_0x1c546c;if(_0x1fbc2b[_0x65ec('0x45')][_0x65ec('0x53')]){_0x5357bf[_0x65ec('0x54')]=[{'all':!![]}];}return db[_0x65ec('0x41')][_0x65ec('0x55')](_0x5357bf);})[_0x65ec('0x1e')](function(_0x11d2d6){_0x3b72cf[_0x65ec('0x56')]=_0x11d2d6;return _0x3b72cf;})[_0x65ec('0x1e')](respondWithFilteredResult(_0x13aa56,_0x5357bf))['catch'](handleError(_0x13aa56,null));};exports[_0x65ec('0x57')]=function(_0x2814f3,_0x4e0da8){var _0x3a474c={'raw':![],'where':{'id':_0x2814f3[_0x65ec('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x65ec('0x3f')}]},_0x7add40={};_0x7add40[_0x65ec('0x44')]=_[_0x65ec('0x59')](db['WhatsappAccount'][_0x65ec('0x5a')]);_0x7add40['query']=_['keys'](_0x2814f3[_0x65ec('0x45')]);_0x7add40[_0x65ec('0x4e')]=_[_0x65ec('0x47')](_0x7add40['model'],_0x7add40[_0x65ec('0x45')]);_0x3a474c[_0x65ec('0x46')]=_[_0x65ec('0x47')](_0x7add40[_0x65ec('0x44')],qs[_0x65ec('0x48')](_0x2814f3[_0x65ec('0x45')][_0x65ec('0x48')]));_0x3a474c[_0x65ec('0x46')]=_0x3a474c[_0x65ec('0x46')]['length']?_0x3a474c['attributes']:_0x7add40[_0x65ec('0x44')];if(_0x2814f3['query'][_0x65ec('0x53')]){_0x3a474c['include']=[{'all':!![]}];}_0x3a474c=_[_0x65ec('0x51')]({},_0x3a474c,_0x2814f3[_0x65ec('0x52')]);return db[_0x65ec('0x41')][_0x65ec('0x5b')](_0x3a474c)[_0x65ec('0x1e')](handleEntityNotFound(_0x4e0da8,null))[_0x65ec('0x1e')](respondWithResult(_0x4e0da8,null))[_0x65ec('0x29')](handleError(_0x4e0da8,null));};exports['create']=function(_0x2c7657,_0x474bc0){return db[_0x65ec('0x41')][_0x65ec('0x5c')](_0x2c7657[_0x65ec('0x5d')],{})['then'](function(_0x20f60f){var _0x318be3=_0x2c7657[_0x65ec('0x5e')][_0x65ec('0x37')]({'plain':!![]});if(!_0x318be3)throw new Error(_0x65ec('0x5f'));if(_0x318be3[_0x65ec('0x60')]===_0x65ec('0x5e')){var _0x2e81ea=_0x20f60f['get']({'plain':!![]});var _0x311e78=_0x65ec('0x38');return db[_0x65ec('0x61')][_0x65ec('0x5b')]({'where':{'name':_0x311e78,'userProfileId':_0x318be3[_0x65ec('0x62')]},'raw':!![]})[_0x65ec('0x1e')](function(_0x192055){if(_0x192055&&_0x192055['autoAssociation']===0x0){return db['UserProfileResource'][_0x65ec('0x5c')]({'name':_0x2e81ea['name'],'resourceId':_0x2e81ea['id'],'type':_0x192055[_0x65ec('0x3c')],'sectionId':_0x192055['id']},{})[_0x65ec('0x1e')](function(){return _0x20f60f;});}else{return _0x20f60f;}})['catch'](function(_0x1baa17){logger[_0x65ec('0x25')](_0x65ec('0x63'),_0x1baa17);throw _0x1baa17;});}return _0x20f60f;})[_0x65ec('0x1e')](respondWithResult(_0x474bc0,0xc9))[_0x65ec('0x29')](handleError(_0x474bc0,null));};exports[_0x65ec('0x36')]=function(_0x2279ff,_0x5df65c){if(_0x2279ff['body']['id']){delete _0x2279ff[_0x65ec('0x5d')]['id'];}return db[_0x65ec('0x41')][_0x65ec('0x5b')]({'where':{'id':_0x2279ff['params']['id']},'include':[{'model':db[_0x65ec('0x3e')],'as':_0x65ec('0x3f')}]})[_0x65ec('0x1e')](handleEntityNotFound(_0x5df65c,null))[_0x65ec('0x1e')](saveUpdates(_0x2279ff[_0x65ec('0x5d')],null))[_0x65ec('0x1e')](respondWithResult(_0x5df65c,null))[_0x65ec('0x29')](handleError(_0x5df65c,null));};exports['destroy']=function(_0x464f67,_0x1e2731){return db[_0x65ec('0x41')][_0x65ec('0x5b')]({'where':{'id':_0x464f67[_0x65ec('0x58')]['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x1e2731,null))[_0x65ec('0x1e')](removeEntity(_0x1e2731,null))[_0x65ec('0x29')](handleError(_0x1e2731,null));};exports[_0x65ec('0x64')]=function(_0x584811,_0x59a690){return db[_0x65ec('0x41')]['describe']()['then'](respondWithResult(_0x59a690,null))[_0x65ec('0x29')](handleError(_0x59a690,null));};exports[_0x65ec('0x65')]=function(_0x39d0ce,_0x547057,_0x501775){if(_0x39d0ce[_0x65ec('0x5d')]['id']){delete _0x39d0ce['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x39d0ce[_0x65ec('0x58')]['id']}})['then'](handleEntityNotFound(_0x547057,null))[_0x65ec('0x1e')](function(_0x1e101c){if(_0x1e101c){_0x39d0ce[_0x65ec('0x5d')]['WhatsappAccountId']=_0x1e101c['id'];return db['Disposition'][_0x65ec('0x5c')](_0x39d0ce['body']);}})[_0x65ec('0x1e')](respondWithResult(_0x547057,null))[_0x65ec('0x29')](handleError(_0x547057,null));};exports[_0x65ec('0x66')]=function(_0x290c68,_0xc47b30,_0x2874ea){var _0xefa74d={'raw':![],'where':{}};var _0x572b15={};var _0x275a42={'count':0x0,'rows':[]};return db[_0x65ec('0x41')]['findOne']({'where':{'id':_0x290c68[_0x65ec('0x58')]['id']}})['then'](handleEntityNotFound(_0xc47b30,null))[_0x65ec('0x1e')](function(_0xf4dbce){if(_0xf4dbce){_0x572b15[_0x65ec('0x44')]=_[_0x65ec('0x59')](db['Disposition'][_0x65ec('0x5a')]);_0x572b15['query']=_[_0x65ec('0x59')](_0x290c68[_0x65ec('0x45')]);_0x572b15[_0x65ec('0x4e')]=_[_0x65ec('0x47')](_0x572b15['model'],_0x572b15['query']);_0xefa74d['attributes']=_[_0x65ec('0x47')](_0x572b15[_0x65ec('0x44')],qs[_0x65ec('0x48')](_0x290c68[_0x65ec('0x45')][_0x65ec('0x48')]));_0xefa74d[_0x65ec('0x46')]=_0xefa74d[_0x65ec('0x46')][_0x65ec('0x49')]?_0xefa74d[_0x65ec('0x46')]:_0x572b15[_0x65ec('0x44')];if(!_0x290c68[_0x65ec('0x45')][_0x65ec('0x4a')](_0x65ec('0x4b'))){_0xefa74d['limit']=qs[_0x65ec('0x30')](_0x290c68[_0x65ec('0x45')][_0x65ec('0x30')]);_0xefa74d[_0x65ec('0x2f')]=qs[_0x65ec('0x2f')](_0x290c68[_0x65ec('0x45')][_0x65ec('0x2f')]);}_0xefa74d[_0x65ec('0x4c')]=qs[_0x65ec('0x4d')](_0x290c68[_0x65ec('0x45')]['sort']);_0xefa74d[_0x65ec('0x50')]=qs['filters'](_['pick'](_0x290c68[_0x65ec('0x45')],_0x572b15[_0x65ec('0x4e')]));_0xefa74d[_0x65ec('0x50')][_0x65ec('0x67')]=_0xf4dbce['id'];if(_0x290c68[_0x65ec('0x45')][_0x65ec('0x68')]){_0xefa74d[_0x65ec('0x50')]=_[_0x65ec('0x51')](_0xefa74d['where'],{'$or':_[_0x65ec('0x40')](_0xefa74d['attributes'],function(_0x3850fd){var _0x1cad36={};_0x1cad36[_0x3850fd]={'$like':'%'+_0x290c68[_0x65ec('0x45')]['filter']+'%'};return _0x1cad36;})});}_0xefa74d=_[_0x65ec('0x51')]({},_0xefa74d,_0x290c68[_0x65ec('0x52')]);return db[_0x65ec('0x69')][_0x65ec('0x2e')]({'where':_0xefa74d[_0x65ec('0x50')]})[_0x65ec('0x1e')](function(_0x1172f3){_0x275a42['count']=_0x1172f3;if(_0x290c68[_0x65ec('0x45')][_0x65ec('0x53')]){_0xefa74d[_0x65ec('0x54')]=[{'all':!![]}];}return db[_0x65ec('0x69')]['findAll'](_0xefa74d);})['then'](function(_0x419e33){_0x275a42[_0x65ec('0x56')]=_0x419e33;return _0x275a42;});}})[_0x65ec('0x1e')](respondWithFilteredResult(_0xc47b30,_0xefa74d))[_0x65ec('0x29')](handleError(_0xc47b30,null));};exports[_0x65ec('0x6a')]=function(_0x277499,_0x5a171c,_0x3b0318){return db[_0x65ec('0x41')][_0x65ec('0x5b')]({'where':{'id':_0x277499[_0x65ec('0x58')]['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x5a171c,null))[_0x65ec('0x1e')](function(_0x44b4e6){if(_0x44b4e6){return _0x44b4e6[_0x65ec('0x6a')](_0x277499['query'][_0x65ec('0x6b')]);}})[_0x65ec('0x1e')](respondWithStatusCode(_0x5a171c,null))['catch'](handleError(_0x5a171c,null));};exports[_0x65ec('0x6c')]=function(_0x2ca85,_0x28731c,_0x2606ea){if(_0x2ca85[_0x65ec('0x5d')]['id']){delete _0x2ca85[_0x65ec('0x5d')]['id'];}return db[_0x65ec('0x41')][_0x65ec('0x5b')]({'where':{'id':_0x2ca85[_0x65ec('0x58')]['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x28731c,null))['then'](function(_0x5030f6){if(_0x5030f6){_0x2ca85[_0x65ec('0x5d')][_0x65ec('0x67')]=_0x5030f6['id'];return db[_0x65ec('0x6d')]['create'](_0x2ca85[_0x65ec('0x5d')]);}})[_0x65ec('0x1e')](respondWithResult(_0x28731c,null))[_0x65ec('0x29')](handleError(_0x28731c,null));};exports[_0x65ec('0x6e')]=function(_0x3d79a8,_0x386eba,_0x1ff60f){var _0x3f9105={'raw':![],'where':{}};var _0x27d5d5={};var _0x4f5e10={'count':0x0,'rows':[]};return db[_0x65ec('0x41')][_0x65ec('0x6f')]({'where':{'id':_0x3d79a8[_0x65ec('0x58')]['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x386eba,null))[_0x65ec('0x1e')](function(_0xba5894){if(_0xba5894){_0x27d5d5['model']=_[_0x65ec('0x59')](db[_0x65ec('0x6d')][_0x65ec('0x5a')]);_0x27d5d5[_0x65ec('0x45')]=_[_0x65ec('0x59')](_0x3d79a8['query']);_0x27d5d5['filters']=_[_0x65ec('0x47')](_0x27d5d5[_0x65ec('0x44')],_0x27d5d5[_0x65ec('0x45')]);_0x3f9105[_0x65ec('0x46')]=_[_0x65ec('0x47')](_0x27d5d5[_0x65ec('0x44')],qs[_0x65ec('0x48')](_0x3d79a8[_0x65ec('0x45')][_0x65ec('0x48')]));_0x3f9105[_0x65ec('0x46')]=_0x3f9105[_0x65ec('0x46')]['length']?_0x3f9105[_0x65ec('0x46')]:_0x27d5d5['model'];if(!_0x3d79a8['query'][_0x65ec('0x4a')]('nolimit')){_0x3f9105[_0x65ec('0x30')]=qs[_0x65ec('0x30')](_0x3d79a8['query']['limit']);_0x3f9105[_0x65ec('0x2f')]=qs[_0x65ec('0x2f')](_0x3d79a8['query'][_0x65ec('0x2f')]);}_0x3f9105[_0x65ec('0x4c')]=qs['sort'](_0x3d79a8[_0x65ec('0x45')][_0x65ec('0x4d')]);_0x3f9105[_0x65ec('0x50')]=qs[_0x65ec('0x4e')](_['pick'](_0x3d79a8[_0x65ec('0x45')],_0x27d5d5[_0x65ec('0x4e')]));_0x3f9105['where'][_0x65ec('0x67')]=_0xba5894['id'];if(_0x3d79a8['query'][_0x65ec('0x68')]){_0x3f9105[_0x65ec('0x50')]=_[_0x65ec('0x51')](_0x3f9105['where'],{'$or':_['map'](_0x3f9105[_0x65ec('0x46')],function(_0x5b26b3){var _0x460044={};_0x460044[_0x5b26b3]={'$like':'%'+_0x3d79a8[_0x65ec('0x45')][_0x65ec('0x68')]+'%'};return _0x460044;})});}_0x3f9105=_['merge']({},_0x3f9105,_0x3d79a8[_0x65ec('0x52')]);return db['CannedAnswer']['count']({'where':_0x3f9105[_0x65ec('0x50')]})['then'](function(_0x102e66){_0x4f5e10[_0x65ec('0x2e')]=_0x102e66;if(_0x3d79a8['query']['includeAll']){_0x3f9105['include']=[{'all':!![]}];}return db[_0x65ec('0x6d')][_0x65ec('0x55')](_0x3f9105);})[_0x65ec('0x1e')](function(_0x596f1c){_0x4f5e10['rows']=_0x596f1c;return _0x4f5e10;});}})['then'](respondWithFilteredResult(_0x386eba,_0x3f9105))[_0x65ec('0x29')](handleError(_0x386eba,null));};exports[_0x65ec('0x70')]=function(_0xc908a7,_0x1c8cd1,_0x1df337){return db[_0x65ec('0x41')][_0x65ec('0x5b')]({'where':{'id':_0xc908a7[_0x65ec('0x58')]['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x1c8cd1,null))[_0x65ec('0x1e')](function(_0x309341){if(_0x309341){return _0x309341['removeAnswers'](_0xc908a7[_0x65ec('0x45')][_0x65ec('0x6b')]);}})[_0x65ec('0x1e')](respondWithStatusCode(_0x1c8cd1,null))[_0x65ec('0x29')](handleError(_0x1c8cd1,null));};exports[_0x65ec('0x71')]=function(_0x47cf0c,_0x5c6a76,_0x44d1a7){return db[_0x65ec('0x41')][_0x65ec('0x5b')]({'where':{'id':_0x47cf0c['params']['id']}})['then'](handleEntityNotFound(_0x5c6a76,null))[_0x65ec('0x1e')](function(_0x3ccb0f){if(_0x3ccb0f){return _0x3ccb0f[_0x65ec('0x71')](_0x47cf0c[_0x65ec('0x5d')][_0x65ec('0x6b')],_[_0x65ec('0x72')](_0x47cf0c[_0x65ec('0x5d')],[_0x65ec('0x6b'),'id'])||{})['spread'](function(_0x6c71a){for(var _0x2d78f4=0x0;_0x2d78f4<_0x47cf0c[_0x65ec('0x5d')][_0x65ec('0x6b')][_0x65ec('0x49')];_0x2d78f4+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':_0x47cf0c['body'][_0x65ec('0x6b')][_0x2d78f4],'WhatsappAccountId':_0x47cf0c[_0x65ec('0x58')]['id']});}return _0x6c71a;});}})[_0x65ec('0x1e')](respondWithResult(_0x5c6a76,null))[_0x65ec('0x29')](handleError(_0x5c6a76,null));};exports[_0x65ec('0x73')]=function(_0x2a065e,_0x5ef5b8,_0x20481e){return db[_0x65ec('0x41')][_0x65ec('0x5b')]({'where':{'id':_0x2a065e['params']['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x5ef5b8,null))[_0x65ec('0x1e')](function(_0x172697){if(_0x172697){return _0x172697[_0x65ec('0x73')](_0x2a065e['query'][_0x65ec('0x6b')])[_0x65ec('0x1e')](function(){if(_[_0x65ec('0x74')](_0x2a065e[_0x65ec('0x45')][_0x65ec('0x6b')])){for(var _0x11e8fe=0x0;_0x11e8fe<_0x2a065e['query'][_0x65ec('0x6b')][_0x65ec('0x49')];_0x11e8fe+=0x1){socket[_0x65ec('0x75')](_0x65ec('0x76'),{'UserId':Number(_0x2a065e[_0x65ec('0x45')][_0x65ec('0x6b')][_0x11e8fe]),'WhatsappAccountId':Number(_0x2a065e[_0x65ec('0x58')]['id'])});}}else{socket[_0x65ec('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x2a065e['query'][_0x65ec('0x6b')]),'WhatsappAccountId':Number(_0x2a065e[_0x65ec('0x58')]['id'])});}});}})[_0x65ec('0x1e')](respondWithStatusCode(_0x5ef5b8,null))['catch'](handleError(_0x5ef5b8,null));};exports[_0x65ec('0x77')]=function(_0x152af1,_0x41daf9,_0x50953a){var _0x437d98={};var _0x2e4efe={};var _0x49a6a2;var _0x4848cc;return db[_0x65ec('0x41')][_0x65ec('0x6f')]({'where':{'id':_0x152af1[_0x65ec('0x58')]['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x41daf9,null))[_0x65ec('0x1e')](function(_0x4587ea){if(_0x4587ea){_0x49a6a2=_0x4587ea;_0x2e4efe[_0x65ec('0x44')]=_['keys'](db['User'][_0x65ec('0x5a')]);_0x2e4efe[_0x65ec('0x45')]=_[_0x65ec('0x59')](_0x152af1[_0x65ec('0x45')]);_0x2e4efe[_0x65ec('0x4e')]=_['intersection'](_0x2e4efe['model'],_0x2e4efe['query']);_0x437d98[_0x65ec('0x46')]=_[_0x65ec('0x47')](_0x2e4efe[_0x65ec('0x44')],qs[_0x65ec('0x48')](_0x152af1['query'][_0x65ec('0x48')]));_0x437d98[_0x65ec('0x46')]=_0x437d98[_0x65ec('0x46')][_0x65ec('0x49')]?_0x437d98[_0x65ec('0x46')]:_0x2e4efe[_0x65ec('0x44')];_0x437d98['order']=qs[_0x65ec('0x4d')](_0x152af1[_0x65ec('0x45')][_0x65ec('0x4d')]);_0x437d98[_0x65ec('0x50')]=qs[_0x65ec('0x4e')](_[_0x65ec('0x4f')](_0x152af1[_0x65ec('0x45')],_0x2e4efe['filters']));if(_0x152af1[_0x65ec('0x45')][_0x65ec('0x68')]){_0x437d98[_0x65ec('0x50')]=_[_0x65ec('0x51')](_0x437d98[_0x65ec('0x50')],{'$or':_['map'](_0x437d98[_0x65ec('0x46')],function(_0x561a3d){var _0x36af99={};_0x36af99[_0x561a3d]={'$like':'%'+_0x152af1[_0x65ec('0x45')][_0x65ec('0x68')]+'%'};return _0x36af99;})});}_0x437d98=_[_0x65ec('0x51')]({},_0x437d98,_0x152af1[_0x65ec('0x52')]);return _0x49a6a2['getAgents'](_0x437d98);}})[_0x65ec('0x1e')](function(_0x23878c){if(_0x23878c){_0x4848cc=_0x23878c[_0x65ec('0x49')];if(!_0x152af1[_0x65ec('0x45')][_0x65ec('0x4a')](_0x65ec('0x4b'))){_0x437d98[_0x65ec('0x30')]=qs[_0x65ec('0x30')](_0x152af1['query'][_0x65ec('0x30')]);_0x437d98[_0x65ec('0x2f')]=qs['offset'](_0x152af1['query'][_0x65ec('0x2f')]);}return _0x49a6a2['getAgents'](_0x437d98);}})[_0x65ec('0x1e')](function(_0x23afc6){if(_0x23afc6){return _0x23afc6?{'count':_0x4848cc,'rows':_0x23afc6}:null;}})[_0x65ec('0x1e')](respondWithResult(_0x41daf9,null))['catch'](handleError(_0x41daf9,null));};exports[_0x65ec('0x78')]=function(_0x297db5,_0x4786be,_0x2203a6){return db[_0x65ec('0x41')][_0x65ec('0x6f')]({'where':{'id':_0x297db5[_0x65ec('0x58')]['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x4786be,null))[_0x65ec('0x1e')](function(_0x586546){if(_0x586546){return db[_0x65ec('0x79')]['transaction'](function(_0x30c1d3){return db[_0x65ec('0x7a')][_0x65ec('0x3a')]({'where':{'WhatsappAccountId':_0x297db5['params']['id']},'transaction':_0x30c1d3})['then'](function(_0x361aa1){var _0x50407d=_['map'](_0x297db5['body'],function(_0x43c177){_0x43c177['WhatsappAccountId']=_0x297db5[_0x65ec('0x58')]['id'];return _0x43c177;});return db[_0x65ec('0x7a')][_0x65ec('0x7b')](_0x50407d,{'transaction':_0x30c1d3});});})[_0x65ec('0x1e')](function(){return db['WhatsappApplication'][_0x65ec('0x7c')]({'where':{'WhatsappAccountId':_0x297db5[_0x65ec('0x58')]['id']},'order':'priority'});});}})[_0x65ec('0x1e')](respondWithResult(_0x4786be,null))['catch'](handleError(_0x4786be,null));};exports[_0x65ec('0x7d')]=function(_0x3bb9df,_0x211085,_0xd1f1d1){var _0x2f3855={};var _0x39e285={};var _0x2f70c3;var _0x39ddfa;return db[_0x65ec('0x41')]['findOne']({'where':{'id':_0x3bb9df[_0x65ec('0x58')]['id']}})[_0x65ec('0x1e')](handleEntityNotFound(_0x211085,null))[_0x65ec('0x1e')](function(_0x7bfdae){if(_0x7bfdae){_0x2f70c3=_0x7bfdae;_0x39e285['model']=_[_0x65ec('0x59')](db[_0x65ec('0x7a')][_0x65ec('0x5a')]);_0x39e285[_0x65ec('0x45')]=_[_0x65ec('0x59')](_0x3bb9df[_0x65ec('0x45')]);_0x39e285[_0x65ec('0x4e')]=_['intersection'](_0x39e285['model'],_0x39e285[_0x65ec('0x45')]);_0x2f3855[_0x65ec('0x46')]=_[_0x65ec('0x47')](_0x39e285[_0x65ec('0x44')],qs[_0x65ec('0x48')](_0x3bb9df[_0x65ec('0x45')][_0x65ec('0x48')]));_0x2f3855[_0x65ec('0x46')]=_0x2f3855[_0x65ec('0x46')]['length']?_0x2f3855[_0x65ec('0x46')]:_0x39e285[_0x65ec('0x44')];_0x2f3855[_0x65ec('0x4c')]=qs[_0x65ec('0x4d')](_0x3bb9df[_0x65ec('0x45')][_0x65ec('0x4d')]);_0x2f3855[_0x65ec('0x50')]=qs[_0x65ec('0x4e')](_['pick'](_0x3bb9df[_0x65ec('0x45')],_0x39e285['filters']));if(_0x3bb9df[_0x65ec('0x45')][_0x65ec('0x68')]){_0x2f3855[_0x65ec('0x50')]=_[_0x65ec('0x51')](_0x2f3855[_0x65ec('0x50')],{'$or':_[_0x65ec('0x40')](_0x2f3855[_0x65ec('0x46')],function(_0x1aa45c){var _0x133d19={};_0x133d19[_0x1aa45c]={'$like':'%'+_0x3bb9df[_0x65ec('0x45')][_0x65ec('0x68')]+'%'};return _0x133d19;})});}_0x2f3855=_[_0x65ec('0x51')]({},_0x2f3855,_0x3bb9df[_0x65ec('0x52')]);return _0x2f70c3[_0x65ec('0x7d')](_0x2f3855);}})[_0x65ec('0x1e')](function(_0xed5827){if(_0xed5827){_0x39ddfa=_0xed5827[_0x65ec('0x49')];if(!_0x3bb9df[_0x65ec('0x45')][_0x65ec('0x4a')](_0x65ec('0x4b'))){_0x2f3855[_0x65ec('0x30')]=qs[_0x65ec('0x30')](_0x3bb9df[_0x65ec('0x45')][_0x65ec('0x30')]);_0x2f3855['offset']=qs[_0x65ec('0x2f')](_0x3bb9df[_0x65ec('0x45')][_0x65ec('0x2f')]);}return _0x2f70c3[_0x65ec('0x7d')](_0x2f3855);}})[_0x65ec('0x1e')](function(_0xc2ad21){if(_0xc2ad21){return _0xc2ad21?{'count':_0x39ddfa,'rows':_0xc2ad21}:null;}})['then'](respondWithResult(_0x211085,null))[_0x65ec('0x29')](handleError(_0x211085,null));};exports[_0x65ec('0x7e')]=function(_0x2577d2,_0x5cb76d,_0x1b2340){var _0x120933={'channel':_0x65ec('0x7f')};var _0x4e5a41=[];var _0x1cdddf=[];var _0x326cc7={};return db[_0x65ec('0x41')]['find']({'where':{'id':_0x2577d2[_0x65ec('0x58')]['id']},'include':[{'model':db[_0x65ec('0x7a')],'as':'Applications'}]})[_0x65ec('0x1e')](handleEntityNotFound(_0x5cb76d,null))[_0x65ec('0x1e')](function(_0x25ecfc){_0x120933[_0x65ec('0x80')]=_0x25ecfc;_0x120933['applications']=_[_0x65ec('0x81')](_0x25ecfc['Applications'],[_0x65ec('0x82')],[_0x65ec('0x83')]);if(_0x120933[_0x65ec('0x80')][_0x65ec('0x84')]){delete _0x120933[_0x65ec('0x80')]['Applications'];}return db[_0x65ec('0x85')][_0x65ec('0x64')]();})[_0x65ec('0x1e')](function(_0x2f60cb){if(!_0x2f60cb){throw new db[(_0x65ec('0x1a'))][(_0x65ec('0x1b'))](_0x65ec('0x86'));}_0x4e5a41=_[_0x65ec('0x87')](_[_0x65ec('0x59')](_0x2f60cb),[_0x65ec('0x88'),_0x65ec('0x89')]);_0x1cdddf=_[_0x65ec('0x87')](_[_0x65ec('0x59')](_0x2f60cb),[_0x65ec('0x88'),_0x65ec('0x89'),_0x65ec('0x8a'),'ListId']);_0x120933['body']={'mapKey':'mobile'};if(_0x120933[_0x65ec('0x80')][_0x65ec('0x42')]&&_0x120933[_0x65ec('0x80')][_0x65ec('0x42')]===_0x65ec('0x8b')){_0x120933['body'][_0x65ec('0x8c')]=_0x2577d2['body'][_0x65ec('0x8d')]['replace'](_0x65ec('0x8e'),'');_0x120933['body'][_0x65ec('0x5d')]=_0x2577d2['body'][_0x65ec('0x8f')];_0x120933['body'][_0x65ec('0x90')]=_0x2577d2[_0x65ec('0x5d')]['MessageSid'];}if(_0x120933[_0x65ec('0x5d')]['id']){delete _0x120933[_0x65ec('0x5d')]['id'];}if(_[_0x65ec('0x91')](_0x120933[_0x65ec('0x5d')][_0x65ec('0x8c')])){throw new db[(_0x65ec('0x1a'))][(_0x65ec('0x1b'))](_0x65ec('0x92'));}if(_[_0x65ec('0x91')](_0x120933['body'][_0x65ec('0x5d')])||_0x120933[_0x65ec('0x5d')]['body']===''){throw new db['Sequelize'][(_0x65ec('0x1b'))](_0x65ec('0x93'));}if(_[_0x65ec('0x91')](_0x120933[_0x65ec('0x5d')]['mapKey'])){throw new db[(_0x65ec('0x1a'))][(_0x65ec('0x1b'))](_0x65ec('0x94')+_0x1cdddf);}if(!_[_0x65ec('0x95')](_0x1cdddf,_0x120933[_0x65ec('0x5d')][_0x65ec('0x96')])){throw new db[(_0x65ec('0x1a'))][(_0x65ec('0x1b'))](_0x65ec('0x97')+_0x1cdddf);}_0x326cc7[_0x120933[_0x65ec('0x5d')][_0x65ec('0x96')]]=_0x120933['body'][_0x65ec('0x8c')];return db[_0x65ec('0x98')][_0x65ec('0x5b')]({'where':{'id':_0x120933[_0x65ec('0x80')][_0x65ec('0x99')]},'include':[{'model':db[_0x65ec('0x85')],'as':_0x65ec('0x9a'),'where':_0x326cc7,'limit':0x1,'order':[[_0x65ec('0x89'),_0x65ec('0x9b')]]}]});})[_0x65ec('0x1e')](handleEntityNotFound(_0x5cb76d,null))[_0x65ec('0x1e')](function(_0x18991a){if(_0x18991a){_0x120933[_0x65ec('0x9c')]=_[_0x65ec('0x72')](_0x18991a,['Contacts']);if(_0x18991a[_0x65ec('0x9a')][_0x65ec('0x49')]){return _0x18991a[_0x65ec('0x9a')][0x0];}var _0x36cbef=_['defaults'](_0x120933['body'],{'firstName':_0x120933['body']['from'],'ListId':_0x18991a['id']});_0x36cbef[_0x120933[_0x65ec('0x5d')][_0x65ec('0x96')]]=_0x120933[_0x65ec('0x5d')][_0x65ec('0x8c')];return db['CmContact'][_0x65ec('0x5c')](_0x36cbef,{'fields':_0x4e5a41,'raw':!![]});}})['then'](handleEntityNotFound(_0x5cb76d,null))[_0x65ec('0x1e')](function(_0x4c7cbb){if(_0x4c7cbb){_0x120933[_0x65ec('0x9d')]=_0x4c7cbb;var _0x4da116={'ContactId':_0x4c7cbb['id'],'phone':_0x120933['body']['from'],'WhatsappAccountId':_0x2577d2['params']['id']};var _0x58bf37={'ContactId':_0x4c7cbb['id'],'WhatsappAccountId':_0x2577d2['params']['id'],'closed':![]};return db[_0x65ec('0x9e')][_0x65ec('0x5b')]({'where':_0x58bf37})[_0x65ec('0x1e')](function(_0x569650){if(_0x569650){return[_0x569650,![]];}return db[_0x65ec('0x9e')][_0x65ec('0x5c')](_0x4da116)['then'](function(_0x285b77){return[_0x285b77,!![]];});});}})[_0x65ec('0x9f')](function(_0x56b3e4,_0x5a1b64){_0x120933[_0x65ec('0xa0')]=_0x56b3e4[_0x65ec('0x37')]({'plain':!![]});_0x120933[_0x65ec('0xa0')][_0x65ec('0xa1')]=![];if(_0x5a1b64){if(_0x120933[_0x65ec('0x80')]['autoclose']){_0x120933[_0x65ec('0xa2')][_0x65ec('0xa3')]({'id':0x0,'priority':_0x120933['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x65ec('0xa4')});}_0x120933[_0x65ec('0xa0')][_0x65ec('0xa1')]=!![];}return db[_0x65ec('0xa5')][_0x65ec('0x5c')]({'phone':_0x120933[_0x65ec('0x5d')][_0x65ec('0x8c')],'messageId':_0x120933[_0x65ec('0x5d')][_0x65ec('0x90')],'body':_0x120933[_0x65ec('0x5d')][_0x65ec('0x5d')],'WhatsappAccountId':_0x2577d2[_0x65ec('0x58')]['id'],'WhatsappInteractionId':_0x56b3e4['id'],'direction':'in','ContactId':_0x56b3e4[_0x65ec('0xa6')],'AttachmentId':_0x120933[_0x65ec('0x5d')]['AttachmentId']});})[_0x65ec('0x1e')](function(_0x1e3b53){_0x120933[_0x65ec('0x27')]=_0x1e3b53;if(_0x120933[_0x65ec('0xa0')]['UserId']){return db[_0x65ec('0xa7')][_0x65ec('0x5b')]({'attributes':['id','name'],'where':{'id':_0x120933['interaction']['UserId']}})[_0x65ec('0x1e')](function(_0x27c361){if(_0x27c361){_0x120933[_0x65ec('0xa2')][_0x65ec('0xa8')]({'id':0x0,'priority':0x0,'app':_0x65ec('0xa9'),'appdata':_0x27c361['name']+','+(_0x120933[_0x65ec('0x80')][_0x65ec('0xaa')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x65ec('0xab'),_0x65ec('0xac'),_0x120933);});}return respondWithRpcPromise(_0x65ec('0xab'),_0x65ec('0xac'),_0x120933);})['then'](function(_0x886c4e){if(_0x886c4e){var _0x235157=0xc8;var _0x1ba87c=_0x65ec('0xad');logger[_0x65ec('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1ba87c,_0x235157,_0x65ec('0xae'));logger['debug'](_0x65ec('0xaf'),_0x1ba87c,_0x235157,_0x65ec('0xae'),JSON[_0x65ec('0x24')](_0x886c4e));if(_0x120933[_0x65ec('0x80')][_0x65ec('0x42')]===_0x65ec('0x8b')){return _0x5cb76d[_0x65ec('0x2c')](_0x235157)[_0x65ec('0x31')](_0x65ec('0xb0'),'text/xml')[_0x65ec('0xb1')](_0x65ec('0xb2'));}else{return _0x5cb76d[_0x65ec('0x2c')](_0x235157)[_0x65ec('0x2d')](_0x886c4e);}}})[_0x65ec('0x29')](handleError(_0x5cb76d,null));};exports['send']=function(_0x36381a,_0x5ac2b0,_0x2fa462){var _0x22528e,_0x1929c7,_0x3af098;if(_[_0x65ec('0x91')](_0x36381a[_0x65ec('0x5d')][_0x65ec('0x5d')])||_0x36381a['body'][_0x65ec('0x5d')]===''){throw new db[(_0x65ec('0x1a'))][(_0x65ec('0x1b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x65ec('0x91')](_0x36381a[_0x65ec('0x5d')]['to'])){throw new db[(_0x65ec('0x1a'))][(_0x65ec('0x1b'))](_0x65ec('0xb3'));}_0x22528e=_0x36381a['body']['to'];return db[_0x65ec('0x41')][_0x65ec('0x5b')]({'where':{'id':_0x36381a[_0x65ec('0x58')]['id']},'include':[{'model':db[_0x65ec('0x98')],'as':_0x65ec('0xb4'),'include':[{'model':db[_0x65ec('0x85')],'as':_0x65ec('0x9a'),'where':{'mobile':_0x22528e},'limit':0x1,'order':[[_0x65ec('0x89'),_0x65ec('0x9b')]]}]}]})[_0x65ec('0x1e')](handleEntityNotFound(_0x5ac2b0,null))['then'](function(_0x4998a){if(_0x4998a&&_0x4998a[_0x65ec('0xb4')]){_0x1929c7=_0x4998a[_0x65ec('0x37')]({'plain':!![]});if(_0x1929c7[_0x65ec('0xb4')]&&_0x1929c7[_0x65ec('0xb4')][_0x65ec('0x9a')]['length']){return _0x1929c7[_0x65ec('0xb4')]['Contacts'][0x0];}return db[_0x65ec('0x85')][_0x65ec('0x5c')](_[_0x65ec('0xb5')](_0x36381a[_0x65ec('0x5d')],{'firstName':_0x22528e,'mobile':_0x22528e,'phone':_0x22528e,'ListId':_0x1929c7[_0x65ec('0x99')]}));}})[_0x65ec('0x1e')](handleEntityNotFound(_0x5ac2b0,null))[_0x65ec('0x1e')](function(_0x205916){if(_0x205916){_0x3af098=_0x205916;return db[_0x65ec('0x9e')][_0x65ec('0x5b')]({'where':{'ContactId':_0x3af098['id'],'closed':![],'WhatsappAccountId':_0x1929c7['id']}})['then'](function(_0x1cb25d){if(_0x1cb25d){return[_0x1cb25d,![]];}return db[_0x65ec('0x9e')][_0x65ec('0x5c')]({'UserId':_0x36381a[_0x65ec('0x5e')]['id'],'ContactId':_0x3af098['id'],'WhatsappAccountId':_0x1929c7['id'],'phone':_0x22528e,'firstMsgDirection':_0x65ec('0xb6'),'Messages':[_['merge'](_0x36381a[_0x65ec('0x5d')],{'read':![],'body':_0x36381a[_0x65ec('0x5d')][_0x65ec('0x5d')],'phone':_0x22528e,'WhatsappAccountId':_0x1929c7['id'],'UserId':_0x36381a[_0x65ec('0x5e')]['id'],'ContactId':_0x3af098['id']})]},{'include':[{'model':db[_0x65ec('0xa5')],'as':_0x65ec('0xb7')}]})[_0x65ec('0x1e')](function(_0x422bd2){return[_0x422bd2,!![]];});});}})[_0x65ec('0x9f')](function(_0x506ccf,_0x16eded){if(_0x16eded){return _0x506ccf;}return db[_0x65ec('0xa5')]['create'](_[_0x65ec('0x51')](_0x36381a['body'],{'read':![],'body':_0x36381a[_0x65ec('0x5d')][_0x65ec('0x5d')],'phone':_0x22528e,'WhatsappAccountId':_0x1929c7['id'],'WhatsappInteractionId':_0x506ccf['id'],'UserId':_0x36381a[_0x65ec('0x5e')]['id'],'ContactId':_0x3af098['id']}))[_0x65ec('0x1e')](function(_0x566320){_0x506ccf[_0x65ec('0xb8')][_0x65ec('0xb7')]=[];_0x506ccf[_0x65ec('0xb8')][_0x65ec('0xb7')]['push'](_0x566320['dataValues']);return _0x506ccf;});})[_0x65ec('0x1e')](respondWithResult(_0x5ac2b0,null))['catch'](handleError(_0x5ac2b0,null));};
\ No newline at end of file
index c6b48ee..ae8f3ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x42bda2,_0x4106ca){var _0x625d2d=function(_0x47b4ba){while(--_0x47b4ba){_0x42bda2['push'](_0x42bda2['shift']());}};_0x625d2d(++_0x4106ca);}(_0x2ef3,0xba));var _0x32ef=function(_0x3bd02d,_0x14fff3){_0x3bd02d=_0x3bd02d-0x0;var _0x62930f=_0x2ef3[_0x3bd02d];return _0x62930f;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var WhatsappAccount=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){WhatsappAccountEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);WhatsappAccountEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x8ace=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x294445,_0x322bb5){var _0x21cc50=function(_0xef1fd3){while(--_0xef1fd3){_0x294445['push'](_0x294445['shift']());}};_0x21cc50(++_0x322bb5);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x8ace[_0x534c8f];return _0x5a57f5;};'use strict';var EventEmitter=require(_0xe8ac('0x0'));var WhatsappAccount=require(_0xe8ac('0x1'))['db'][_0xe8ac('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xe8ac('0x3')](0x0);var events={'afterCreate':_0xe8ac('0x4'),'afterUpdate':_0xe8ac('0x5'),'afterDestroy':_0xe8ac('0x6')};function emitEvent(_0x274d7d){return function(_0x114351,_0xf6af00,_0x199794){WhatsappAccountEvents[_0xe8ac('0x7')](_0x274d7d+':'+_0x114351['id'],_0x114351);WhatsappAccountEvents[_0xe8ac('0x7')](_0x274d7d,_0x114351);_0x199794(null);};}for(var e in events){if(events[_0xe8ac('0x8')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xe8ac('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
index 291b1b1..2a1cefa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dc2=['define','whatsapp_accounts','util','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2f2bbb,_0x1a04c2){var _0x25d94f=function(_0x2e496f){while(--_0x2e496f){_0x2f2bbb['push'](_0x2f2bbb['shift']());}};_0x25d94f(++_0x1a04c2);}(_0x0dc2,0xde));var _0x20dc=function(_0x2a1f9e,_0x1d3eb1){_0x2a1f9e=_0x2a1f9e-0x0;var _0x3a2727=_0x0dc2[_0x2a1f9e];return _0x3a2727;};'use strict';var _=require('lodash');var util=require(_0x20dc('0x0'));var logger=require('../../config/logger')(_0x20dc('0x1'));var moment=require(_0x20dc('0x2'));var BPromise=require(_0x20dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20dc('0x4'));var rimraf=require(_0x20dc('0x5'));var config=require(_0x20dc('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0x20dc('0x7')]=function(_0x168692,_0x79d7a1){return _0x168692[_0x20dc('0x8')]('WhatsappAccount',attributes,{'tableName':_0x20dc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64ba=['request-promise','rimraf','../../config/environment','exports','define','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x64ba,0xde));var _0xa64b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x64ba[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xa64b('0x0'));var util=require(_0xa64b('0x1'));var logger=require(_0xa64b('0x2'))(_0xa64b('0x3'));var moment=require(_0xa64b('0x4'));var BPromise=require(_0xa64b('0x5'));var rp=require(_0xa64b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa64b('0x7'));var config=require(_0xa64b('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0xa64b('0x9')]=function(_0x74f2ad,_0x34eeab){return _0x74f2ad[_0xa64b('0xa')]('WhatsappAccount',attributes,{'tableName':_0xa64b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4fb2563..ebfbe00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8ea=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','map','attributes','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2a9326,_0x39889c){var _0x3fe31e=function(_0x15247e){while(--_0x15247e){_0x2a9326['push'](_0x2a9326['shift']());}};_0x3fe31e(++_0x39889c);}(_0xa8ea,0xfb));var _0xaa8e=function(_0x9533e1,_0x49e60c){_0x9533e1=_0x9533e1-0x0;var _0x3e6efd=_0xa8ea[_0x9533e1];return _0x3e6efd;};'use strict';var _=require(_0xaa8e('0x0'));var util=require(_0xaa8e('0x1'));var moment=require(_0xaa8e('0x2'));var BPromise=require(_0xaa8e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa8e('0x4'));var db=require(_0xaa8e('0x5'))['db'];var utils=require(_0xaa8e('0x6'));var logger=require(_0xaa8e('0x7'))(_0xaa8e('0x8'));var config=require(_0xaa8e('0x9'));var jayson=require(_0xaa8e('0xa'));var client=jayson[_0xaa8e('0xb')][_0xaa8e('0xc')]({'port':0x232a});config[_0xaa8e('0xd')]=_['defaults'](config[_0xaa8e('0xd')],{'host':_0xaa8e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1c953b,_0x57f7e6,_0x3a3511){return new BPromise(function(_0x933d9f,_0x4e5d4e){return client['request'](_0x1c953b,_0x3a3511)[_0xaa8e('0xf')](function(_0x1c4b0c){logger['info'](_0xaa8e('0x10'),_0x57f7e6,_0xaa8e('0x11'));logger[_0xaa8e('0x12')](_0xaa8e('0x13'),_0x57f7e6,_0xaa8e('0x11'),JSON[_0xaa8e('0x14')](_0x1c4b0c));if(_0x1c4b0c['error']){if(_0x1c4b0c['error'][_0xaa8e('0x15')]===0x1f4){logger[_0xaa8e('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x57f7e6,_0x1c4b0c[_0xaa8e('0x16')][_0xaa8e('0x17')]);return _0x4e5d4e(_0x1c4b0c['error']['message']);}logger[_0xaa8e('0x16')](_0xaa8e('0x10'),_0x57f7e6,_0x1c4b0c[_0xaa8e('0x16')][_0xaa8e('0x17')]);return _0x933d9f(_0x1c4b0c[_0xaa8e('0x16')]['message']);}else{logger[_0xaa8e('0x18')](_0xaa8e('0x10'),_0x57f7e6,_0xaa8e('0x11'));_0x933d9f(_0x1c4b0c[_0xaa8e('0x19')]['message']);}})[_0xaa8e('0x1a')](function(_0x43bcc2){logger[_0xaa8e('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x57f7e6,_0x43bcc2);_0x4e5d4e(_0x43bcc2);});});}exports[_0xaa8e('0x1b')]=function(_0x44659e){var _0x2a6dd7=this;return new Promise(function(_0x438efc,_0x47b0cb){return db[_0xaa8e('0x1c')][_0xaa8e('0x1d')]({'raw':_0x44659e[_0xaa8e('0x1e')]?_0x44659e[_0xaa8e('0x1e')][_0xaa8e('0x1f')]===undefined?!![]:![]:!![],'where':_0x44659e[_0xaa8e('0x1e')]?_0x44659e['options'][_0xaa8e('0x20')]||null:null,'attributes':_0x44659e[_0xaa8e('0x1e')]?_0x44659e[_0xaa8e('0x1e')]['attributes']||null:null,'include':_0x44659e[_0xaa8e('0x1e')]?_0x44659e['options'][_0xaa8e('0x21')]?_[_0xaa8e('0x22')](_0x44659e[_0xaa8e('0x1e')]['include'],function(_0x4dfce7){return{'model':db[_0x4dfce7['model']],'as':_0x4dfce7['as'],'attributes':_0x4dfce7[_0xaa8e('0x23')],'include':_0x4dfce7['include']?_[_0xaa8e('0x22')](_0x4dfce7['include'],function(_0x29b6c5){return{'model':db[_0x29b6c5[_0xaa8e('0x24')]],'as':_0x29b6c5['as'],'attributes':_0x29b6c5['attributes'],'include':_0x29b6c5[_0xaa8e('0x21')]?_[_0xaa8e('0x22')](_0x29b6c5['include'],function(_0x3b3b90){return{'model':db[_0x3b3b90[_0xaa8e('0x24')]],'as':_0x3b3b90['as'],'attributes':_0x3b3b90[_0xaa8e('0x23')]};}):[]};}):[]};}):[]:[]})[_0xaa8e('0xf')](function(_0x5ad46c){logger[_0xaa8e('0x18')]('ShowWhatsappAccount',_0x44659e);logger[_0xaa8e('0x12')](_0xaa8e('0x1b'),_0x44659e,JSON[_0xaa8e('0x14')](_0x5ad46c));_0x438efc(_0x5ad46c);})['catch'](function(_0x405d44){logger[_0xaa8e('0x16')](_0xaa8e('0x1b'),_0x405d44[_0xaa8e('0x17')],_0x44659e);_0x47b0cb(_0x2a6dd7[_0xaa8e('0x16')](0x1f4,_0x405d44[_0xaa8e('0x17')]));});});};
\ No newline at end of file
+var _0x905b=['register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','find','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket'];(function(_0x3e2cf1,_0x2294a7){var _0x3796d0=function(_0x469880){while(--_0x469880){_0x3e2cf1['push'](_0x3e2cf1['shift']());}};_0x3796d0(++_0x2294a7);}(_0x905b,0x1a1));var _0xb905=function(_0x4a7e3f,_0x4f0484){_0x4a7e3f=_0x4a7e3f-0x0;var _0x1b526d=_0x905b[_0x4a7e3f];return _0x1b526d;};'use strict';var _=require(_0xb905('0x0'));var util=require('util');var moment=require(_0xb905('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb905('0x2'));var db=require(_0xb905('0x3'))['db'];var utils=require(_0xb905('0x4'));var logger=require(_0xb905('0x5'))(_0xb905('0x6'));var config=require(_0xb905('0x7'));var jayson=require(_0xb905('0x8'));var client=jayson['client'][_0xb905('0x9')]({'port':0x232a});config['redis']=_[_0xb905('0xa')](config[_0xb905('0xb')],{'host':_0xb905('0xc'),'port':0x18eb});var socket=require(_0xb905('0xd'))(new Redis(config[_0xb905('0xb')]));require(_0xb905('0xe'))[_0xb905('0xf')](socket);function respondWithRpcPromise(_0x113423,_0x3c35b1,_0x4c611d){return new BPromise(function(_0x286815,_0x42738b){return client[_0xb905('0x10')](_0x113423,_0x4c611d)[_0xb905('0x11')](function(_0x3d09d9){logger['info'](_0xb905('0x12'),_0x3c35b1,_0xb905('0x13'));logger[_0xb905('0x14')](_0xb905('0x15'),_0x3c35b1,_0xb905('0x13'),JSON[_0xb905('0x16')](_0x3d09d9));if(_0x3d09d9[_0xb905('0x17')]){if(_0x3d09d9['error']['code']===0x1f4){logger[_0xb905('0x17')](_0xb905('0x12'),_0x3c35b1,_0x3d09d9[_0xb905('0x17')][_0xb905('0x18')]);return _0x42738b(_0x3d09d9[_0xb905('0x17')][_0xb905('0x18')]);}logger[_0xb905('0x17')](_0xb905('0x12'),_0x3c35b1,_0x3d09d9[_0xb905('0x17')][_0xb905('0x18')]);return _0x286815(_0x3d09d9[_0xb905('0x17')][_0xb905('0x18')]);}else{logger[_0xb905('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x3c35b1,'request\x20sent');_0x286815(_0x3d09d9['result'][_0xb905('0x18')]);}})[_0xb905('0x1a')](function(_0x33c815){logger[_0xb905('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x3c35b1,_0x33c815);_0x42738b(_0x33c815);});});}exports['ShowWhatsappAccount']=function(_0x527b63){var _0x1f52e3=this;return new Promise(function(_0x5de2ae,_0x59fb4c){return db['WhatsappAccount'][_0xb905('0x1b')]({'raw':_0x527b63[_0xb905('0x1c')]?_0x527b63[_0xb905('0x1c')][_0xb905('0x1d')]===undefined?!![]:![]:!![],'where':_0x527b63[_0xb905('0x1c')]?_0x527b63['options'][_0xb905('0x1e')]||null:null,'attributes':_0x527b63[_0xb905('0x1c')]?_0x527b63[_0xb905('0x1c')][_0xb905('0x1f')]||null:null,'include':_0x527b63['options']?_0x527b63[_0xb905('0x1c')][_0xb905('0x20')]?_[_0xb905('0x21')](_0x527b63['options']['include'],function(_0x5c73bb){return{'model':db[_0x5c73bb[_0xb905('0x22')]],'as':_0x5c73bb['as'],'attributes':_0x5c73bb[_0xb905('0x1f')],'include':_0x5c73bb[_0xb905('0x20')]?_['map'](_0x5c73bb[_0xb905('0x20')],function(_0x38f9e2){return{'model':db[_0x38f9e2[_0xb905('0x22')]],'as':_0x38f9e2['as'],'attributes':_0x38f9e2[_0xb905('0x1f')],'include':_0x38f9e2[_0xb905('0x20')]?_[_0xb905('0x21')](_0x38f9e2[_0xb905('0x20')],function(_0x4e82ed){return{'model':db[_0x4e82ed[_0xb905('0x22')]],'as':_0x4e82ed['as'],'attributes':_0x4e82ed['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e47e0){logger[_0xb905('0x19')](_0xb905('0x23'),_0x527b63);logger['debug']('ShowWhatsappAccount',_0x527b63,JSON[_0xb905('0x16')](_0x3e47e0));_0x5de2ae(_0x3e47e0);})[_0xb905('0x1a')](function(_0x5881f5){logger[_0xb905('0x17')](_0xb905('0x23'),_0x5881f5[_0xb905('0x18')],_0x527b63);_0x59fb4c(_0x1f52e3[_0xb905('0x17')](0x1f4,_0x5881f5[_0xb905('0x18')]));});});};
\ No newline at end of file
index c8a2e67..e05a783 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5db=['./whatsappAccount.events','removeListener','whatsappAccount:'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xe5db,0x186));var _0xbe5d=function(_0xdaaaa3,_0x440049){_0xdaaaa3=_0xdaaaa3-0x0;var _0x3b5819=_0xe5db[_0xdaaaa3];return _0x3b5819;};'use strict';var WhatsappAccountEvents=require(_0xbe5d('0x0'));var events=['save','remove','update'];function createListener(_0x397206,_0x3405f6){return function(_0x3304b7){_0x3405f6['emit'](_0x397206,_0x3304b7);};}function removeListener(_0x4dafc7,_0x27e806){return function(){WhatsappAccountEvents[_0xbe5d('0x1')](_0x4dafc7,_0x27e806);};}exports['register']=function(_0xdac2f6){for(var _0x3715ab=0x0,_0xf49bf5=events['length'];_0x3715ab<_0xf49bf5;_0x3715ab++){var _0x5e629c=events[_0x3715ab];var _0x4d35da=createListener(_0xbe5d('0x2')+_0x5e629c,_0xdac2f6);WhatsappAccountEvents['on'](_0x5e629c,_0x4d35da);}};
\ No newline at end of file
+var _0xb945=['whatsappAccount:','remove','update','emit','removeListener','register'];(function(_0x33ee05,_0x2f7cb7){var _0x349aa0=function(_0x3b1a38){while(--_0x3b1a38){_0x33ee05['push'](_0x33ee05['shift']());}};_0x349aa0(++_0x2f7cb7);}(_0xb945,0xc1));var _0x5b94=function(_0x361e8a,_0x458d1f){_0x361e8a=_0x361e8a-0x0;var _0x4f4f22=_0xb945[_0x361e8a];return _0x4f4f22;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x5b94('0x0'),_0x5b94('0x1')];function createListener(_0x2298c9,_0x35fc8b){return function(_0x59c2f3){_0x35fc8b[_0x5b94('0x2')](_0x2298c9,_0x59c2f3);};}function removeListener(_0x125dbe,_0x474ea0){return function(){WhatsappAccountEvents[_0x5b94('0x3')](_0x125dbe,_0x474ea0);};}exports[_0x5b94('0x4')]=function(_0x3638ee){for(var _0xf523c=0x0,_0x319138=events['length'];_0xf523c<_0x319138;_0xf523c++){var _0x501ead=events[_0xf523c];var _0x4836a9=createListener(_0x5b94('0x5')+_0x501ead,_0x3638ee);WhatsappAccountEvents['on'](_0x501ead,_0x4836a9);}};
\ No newline at end of file
index 0edb08f..ba55d44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x154a=['post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','get','show'];(function(_0xc01e1e,_0x56d433){var _0x3db271=function(_0x46b74b){while(--_0x46b74b){_0xc01e1e['push'](_0xc01e1e['shift']());}};_0x3db271(++_0x56d433);}(_0x154a,0xe0));var _0xa154=function(_0x246411,_0xb24f7c){_0x246411=_0x246411-0x0;var _0x37de93=_0x154a[_0x246411];return _0x37de93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa154('0x0'));var timeout=require(_0xa154('0x1'));var express=require(_0xa154('0x2'));var router=express['Router']();var auth=require(_0xa154('0x3'));var interaction=require(_0xa154('0x4'));var config=require(_0xa154('0x5'));var controller=require(_0xa154('0x6'));router['get']('/',auth[_0xa154('0x7')](),controller['index']);router[_0xa154('0x8')]('/:id',auth[_0xa154('0x7')](),controller[_0xa154('0x9')]);router[_0xa154('0xa')]('/',auth[_0xa154('0x7')](),controller[_0xa154('0xb')]);router[_0xa154('0xc')](_0xa154('0xd'),auth[_0xa154('0x7')](),controller[_0xa154('0xe')]);router[_0xa154('0xf')]('/:id',auth[_0xa154('0x7')](),controller[_0xa154('0x10')]);module[_0xa154('0x11')]=router;
\ No newline at end of file
+var _0xfdcc=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x121fa7,_0x14d948){var _0x2888d9=function(_0x441293){while(--_0x441293){_0x121fa7['push'](_0x121fa7['shift']());}};_0x2888d9(++_0x14d948);}(_0xfdcc,0xb9));var _0xcfdc=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0xfdcc[_0x2442b9];return _0x31b571;};'use strict';var multer=require(_0xcfdc('0x0'));var util=require(_0xcfdc('0x1'));var path=require(_0xcfdc('0x2'));var timeout=require(_0xcfdc('0x3'));var express=require(_0xcfdc('0x4'));var router=express['Router']();var auth=require(_0xcfdc('0x5'));var interaction=require(_0xcfdc('0x6'));var config=require(_0xcfdc('0x7'));var controller=require(_0xcfdc('0x8'));router[_0xcfdc('0x9')]('/',auth['isAuthenticated'](),controller[_0xcfdc('0xa')]);router[_0xcfdc('0x9')](_0xcfdc('0xb'),auth[_0xcfdc('0xc')](),controller['show']);router[_0xcfdc('0xd')]('/',auth[_0xcfdc('0xc')](),controller[_0xcfdc('0xe')]);router['put'](_0xcfdc('0xb'),auth[_0xcfdc('0xc')](),controller[_0xcfdc('0xf')]);router[_0xcfdc('0x10')](_0xcfdc('0xb'),auth[_0xcfdc('0xc')](),controller[_0xcfdc('0x11')]);module['exports']=router;
\ No newline at end of file
index 63144d4..232a7d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc97a=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x5734e1,_0x3e1d75){var _0x22c784=function(_0x4fe1eb){while(--_0x4fe1eb){_0x5734e1['push'](_0x5734e1['shift']());}};_0x22c784(++_0x3e1d75);}(_0xc97a,0x183));var _0xac97=function(_0x16ede8,_0x915e0f){_0x16ede8=_0x16ede8-0x0;var _0x329088=_0xc97a[_0x16ede8];return _0x329088;};'use strict';var Sequelize=require(_0xac97('0x0'));module[_0xac97('0x1')]={'priority':{'type':Sequelize[_0xac97('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xac97('0x3')]()},'description':{'type':Sequelize[_0xac97('0x4')]},'interval':{'type':Sequelize[_0xac97('0x4')],'defaultValue':_0xac97('0x5')}};
\ No newline at end of file
+var _0xde75=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xde75,0x64));var _0x5de7=function(_0x208b0a,_0x1eefb5){_0x208b0a=_0x208b0a-0x0;var _0x437711=_0xde75[_0x208b0a];return _0x437711;};'use strict';var Sequelize=require(_0x5de7('0x0'));module[_0x5de7('0x1')]={'priority':{'type':Sequelize[_0x5de7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5de7('0x3')],'allowNull':![],'defaultValue':_0x5de7('0x4')},'appdata':{'type':Sequelize[_0x5de7('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5de7('0x3')],'defaultValue':_0x5de7('0x6')}};
\ No newline at end of file
index e0734a0..30d0bd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30c5=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','error','name','send','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','WhatsappApplication','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto'];(function(_0x27ddc9,_0x4c2636){var _0x1c791e=function(_0x35d29f){while(--_0x35d29f){_0x27ddc9['push'](_0x27ddc9['shift']());}};_0x1c791e(++_0x4c2636);}(_0x30c5,0x163));var _0x530c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x30c5[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x530c('0x0'));var emlformat=require(_0x530c('0x1'));var rimraf=require(_0x530c('0x2'));var zipdir=require(_0x530c('0x3'));var jsonpatch=require(_0x530c('0x4'));var rp=require(_0x530c('0x5'));var moment=require(_0x530c('0x6'));var BPromise=require(_0x530c('0x7'));var Mustache=require(_0x530c('0x8'));var util=require(_0x530c('0x9'));var path=require(_0x530c('0xa'));var sox=require(_0x530c('0xb'));var csv=require(_0x530c('0xc'));var ejs=require(_0x530c('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x530c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x530c('0xf'));var toCsv=require(_0x530c('0xc'));var querystring=require(_0x530c('0x10'));var Papa=require(_0x530c('0x11'));var Redis=require(_0x530c('0x12'));var authService=require(_0x530c('0x13'));var qs=require(_0x530c('0x14'));var as=require(_0x530c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x530c('0x16'))(_0x530c('0x17'));var utils=require('../../config/utils');var config=require(_0x530c('0x18'));var db=require(_0x530c('0x19'))['db'];function respondWithStatusCode(_0x3a966f,_0x159d67){_0x159d67=_0x159d67||0xcc;return function(_0x1c0041){if(_0x1c0041){return _0x3a966f[_0x530c('0x1a')](_0x159d67);}return _0x3a966f[_0x530c('0x1b')](_0x159d67)[_0x530c('0x1c')]();};}function respondWithResult(_0x543491,_0x3183e2){_0x3183e2=_0x3183e2||0xc8;return function(_0x38527b){if(_0x38527b){return _0x543491[_0x530c('0x1b')](_0x3183e2)[_0x530c('0x1d')](_0x38527b);}};}function respondWithFilteredResult(_0x7878f6,_0x1761f0){return function(_0x15dfea){if(_0x15dfea){var _0x654a3b=_0x15dfea[_0x530c('0x1e')],_0xef4fcb=_0x1761f0[_0x530c('0x1f')],_0x28525a=_0x1761f0[_0x530c('0x1f')]+_0x1761f0['limit'],_0x28274f;if(_0x28525a>=_0x654a3b){_0x28525a=_0x654a3b;_0x28274f=0xc8;}else{_0x28274f=0xce;}_0x7878f6['status'](_0x28274f);return _0x7878f6['set'](_0x530c('0x20'),_0xef4fcb+'-'+_0x28525a+'/'+_0x654a3b)['json'](_0x15dfea);}return null;};}function patchUpdates(_0x37757a){return function(_0x260577){try{jsonpatch[_0x530c('0x21')](_0x260577,_0x37757a,!![]);}catch(_0x439cfc){return BPromise[_0x530c('0x22')](_0x439cfc);}return _0x260577[_0x530c('0x23')]();};}function saveUpdates(_0x23da25,_0xe960d9){return function(_0x203b7b){if(_0x203b7b){return _0x203b7b[_0x530c('0x24')](_0x23da25)[_0x530c('0x25')](function(_0x37ee4b){return _0x37ee4b;});}return null;};}function removeEntity(_0x41eae9,_0x52f4fc){return function(_0x4a744a){if(_0x4a744a){return _0x4a744a['destroy']()[_0x530c('0x25')](function(){_0x41eae9[_0x530c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bda16,_0x15cdf1){return function(_0x5e7f93){if(!_0x5e7f93){_0x5bda16[_0x530c('0x1a')](0x194);}return _0x5e7f93;};}function handleError(_0x31e0f8,_0x483162){_0x483162=_0x483162||0x1f4;return function(_0x13e391){logger[_0x530c('0x26')](_0x13e391['stack']);if(_0x13e391[_0x530c('0x27')]){delete _0x13e391[_0x530c('0x27')];}_0x31e0f8['status'](_0x483162)[_0x530c('0x28')](_0x13e391);};}exports['index']=function(_0x4598f6,_0x419e4a){var _0x27eade={},_0x20d808={},_0x22bf14={'count':0x0,'rows':[]};var _0xa66577=_[_0x530c('0x29')](db['WhatsappApplication'][_0x530c('0x2a')],function(_0x11eefa){return{'name':_0x11eefa[_0x530c('0x2b')],'type':_0x11eefa['type'][_0x530c('0x2c')]};});_0x20d808[_0x530c('0x2d')]=_[_0x530c('0x29')](_0xa66577,'name');_0x20d808[_0x530c('0x2e')]=_['keys'](_0x4598f6[_0x530c('0x2e')]);_0x20d808[_0x530c('0x2f')]=_['intersection'](_0x20d808[_0x530c('0x2d')],_0x20d808[_0x530c('0x2e')]);_0x27eade[_0x530c('0x30')]=_[_0x530c('0x31')](_0x20d808[_0x530c('0x2d')],qs[_0x530c('0x32')](_0x4598f6[_0x530c('0x2e')][_0x530c('0x32')]));_0x27eade[_0x530c('0x30')]=_0x27eade[_0x530c('0x30')]['length']?_0x27eade[_0x530c('0x30')]:_0x20d808[_0x530c('0x2d')];if(!_0x4598f6[_0x530c('0x2e')][_0x530c('0x33')]('nolimit')){_0x27eade[_0x530c('0x34')]=qs[_0x530c('0x34')](_0x4598f6[_0x530c('0x2e')][_0x530c('0x34')]);_0x27eade['offset']=qs[_0x530c('0x1f')](_0x4598f6['query']['offset']);}_0x27eade[_0x530c('0x35')]=qs[_0x530c('0x36')](_0x4598f6[_0x530c('0x2e')][_0x530c('0x36')]);_0x27eade[_0x530c('0x37')]=qs[_0x530c('0x2f')](_[_0x530c('0x38')](_0x4598f6[_0x530c('0x2e')],_0x20d808[_0x530c('0x2f')]),_0xa66577);if(_0x4598f6['query'][_0x530c('0x39')]){_0x27eade[_0x530c('0x37')]=_[_0x530c('0x3a')](_0x27eade['where'],{'$or':_[_0x530c('0x29')](_0xa66577,function(_0x5bb9bb){if(_0x5bb9bb[_0x530c('0x3b')]!==_0x530c('0x3c')){var _0x182e02={};_0x182e02[_0x5bb9bb[_0x530c('0x27')]]={'$like':'%'+_0x4598f6[_0x530c('0x2e')][_0x530c('0x39')]+'%'};return _0x182e02;}})});}_0x27eade=_['merge']({},_0x27eade,_0x4598f6[_0x530c('0x3d')]);var _0x10e97a={'where':_0x27eade['where']};return db['WhatsappApplication']['count'](_0x10e97a)['then'](function(_0x385c68){_0x22bf14[_0x530c('0x1e')]=_0x385c68;if(_0x4598f6[_0x530c('0x2e')][_0x530c('0x3e')]){_0x27eade[_0x530c('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x27eade);})[_0x530c('0x25')](function(_0x36c7c6){_0x22bf14[_0x530c('0x40')]=_0x36c7c6;return _0x22bf14;})[_0x530c('0x25')](respondWithFilteredResult(_0x419e4a,_0x27eade))[_0x530c('0x41')](handleError(_0x419e4a,null));};exports[_0x530c('0x42')]=function(_0x57ca19,_0x2f7706){var _0x1f8858={'raw':!![],'where':{'id':_0x57ca19[_0x530c('0x43')]['id']}},_0x5a8f50={};_0x5a8f50[_0x530c('0x2d')]=_[_0x530c('0x44')](db['WhatsappApplication'][_0x530c('0x2a')]);_0x5a8f50[_0x530c('0x2e')]=_[_0x530c('0x44')](_0x57ca19[_0x530c('0x2e')]);_0x5a8f50['filters']=_[_0x530c('0x31')](_0x5a8f50[_0x530c('0x2d')],_0x5a8f50[_0x530c('0x2e')]);_0x1f8858['attributes']=_[_0x530c('0x31')](_0x5a8f50['model'],qs[_0x530c('0x32')](_0x57ca19[_0x530c('0x2e')][_0x530c('0x32')]));_0x1f8858[_0x530c('0x30')]=_0x1f8858[_0x530c('0x30')]['length']?_0x1f8858[_0x530c('0x30')]:_0x5a8f50['model'];if(_0x57ca19[_0x530c('0x2e')]['includeAll']){_0x1f8858[_0x530c('0x3f')]=[{'all':!![]}];}_0x1f8858=_[_0x530c('0x3a')]({},_0x1f8858,_0x57ca19[_0x530c('0x3d')]);return db['WhatsappApplication'][_0x530c('0x45')](_0x1f8858)[_0x530c('0x25')](handleEntityNotFound(_0x2f7706,null))[_0x530c('0x25')](respondWithResult(_0x2f7706,null))[_0x530c('0x41')](handleError(_0x2f7706,null));};exports['create']=function(_0x16dc28,_0x1feaca){return db['WhatsappApplication'][_0x530c('0x46')](_0x16dc28[_0x530c('0x47')],{})[_0x530c('0x25')](respondWithResult(_0x1feaca,0xc9))[_0x530c('0x41')](handleError(_0x1feaca,null));};exports[_0x530c('0x24')]=function(_0x13dba4,_0x34be4f){if(_0x13dba4['body']['id']){delete _0x13dba4[_0x530c('0x47')]['id'];}return db[_0x530c('0x48')]['find']({'where':{'id':_0x13dba4['params']['id']}})[_0x530c('0x25')](handleEntityNotFound(_0x34be4f,null))[_0x530c('0x25')](saveUpdates(_0x13dba4[_0x530c('0x47')],null))[_0x530c('0x25')](respondWithResult(_0x34be4f,null))[_0x530c('0x41')](handleError(_0x34be4f,null));};exports[_0x530c('0x49')]=function(_0x1ce5f2,_0x4e2fd3){return db['WhatsappApplication']['find']({'where':{'id':_0x1ce5f2[_0x530c('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e2fd3,null))[_0x530c('0x25')](removeEntity(_0x4e2fd3,null))[_0x530c('0x41')](handleError(_0x4e2fd3,null));};
\ No newline at end of file
+var _0x5096=['merge','VIRTUAL','filter','options','includeAll','WhatsappApplication','findAll','rows','catch','params','keys','include','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0xb6ea89,_0x14a899){var _0x3d5ab5=function(_0xc010d9){while(--_0xc010d9){_0xb6ea89['push'](_0xb6ea89['shift']());}};_0x3d5ab5(++_0x14a899);}(_0x5096,0x9d));var _0x6509=function(_0x1aad88,_0x551794){_0x1aad88=_0x1aad88-0x0;var _0x1bbfe9=_0x5096[_0x1aad88];return _0x1bbfe9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6509('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6509('0x1'));var moment=require(_0x6509('0x2'));var BPromise=require(_0x6509('0x3'));var Mustache=require(_0x6509('0x4'));var util=require(_0x6509('0x5'));var path=require(_0x6509('0x6'));var sox=require(_0x6509('0x7'));var csv=require(_0x6509('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6509('0x9'));var squel=require('squel');var crypto=require(_0x6509('0xa'));var jsforce=require(_0x6509('0xb'));var deskjs=require(_0x6509('0xc'));var toCsv=require(_0x6509('0x8'));var querystring=require(_0x6509('0xd'));var Papa=require(_0x6509('0xe'));var Redis=require(_0x6509('0xf'));var authService=require(_0x6509('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6509('0x11'));var hardwareService=require(_0x6509('0x12'));var logger=require('../../config/logger')(_0x6509('0x13'));var utils=require(_0x6509('0x14'));var config=require('../../config/environment');var db=require(_0x6509('0x15'))['db'];function respondWithStatusCode(_0x7ef080,_0x376c9f){_0x376c9f=_0x376c9f||0xcc;return function(_0x35e576){if(_0x35e576){return _0x7ef080[_0x6509('0x16')](_0x376c9f);}return _0x7ef080['status'](_0x376c9f)['end']();};}function respondWithResult(_0x4a0bbd,_0x407a5a){_0x407a5a=_0x407a5a||0xc8;return function(_0x3f1107){if(_0x3f1107){return _0x4a0bbd[_0x6509('0x17')](_0x407a5a)['json'](_0x3f1107);}};}function respondWithFilteredResult(_0xd01a90,_0x1c7311){return function(_0xacff7e){if(_0xacff7e){var _0x4217f2=_0xacff7e[_0x6509('0x18')],_0x2fd0b3=_0x1c7311[_0x6509('0x19')],_0xb32c23=_0x1c7311[_0x6509('0x19')]+_0x1c7311[_0x6509('0x1a')],_0x90f7da;if(_0xb32c23>=_0x4217f2){_0xb32c23=_0x4217f2;_0x90f7da=0xc8;}else{_0x90f7da=0xce;}_0xd01a90['status'](_0x90f7da);return _0xd01a90[_0x6509('0x1b')]('Content-Range',_0x2fd0b3+'-'+_0xb32c23+'/'+_0x4217f2)[_0x6509('0x1c')](_0xacff7e);}return null;};}function patchUpdates(_0x2bfe1e){return function(_0x37b189){try{jsonpatch[_0x6509('0x1d')](_0x37b189,_0x2bfe1e,!![]);}catch(_0x524cef){return BPromise[_0x6509('0x1e')](_0x524cef);}return _0x37b189[_0x6509('0x1f')]();};}function saveUpdates(_0x25720c,_0x462021){return function(_0x1b4c46){if(_0x1b4c46){return _0x1b4c46[_0x6509('0x20')](_0x25720c)['then'](function(_0x569b26){return _0x569b26;});}return null;};}function removeEntity(_0x26d9c4,_0x157ea0){return function(_0x4816ff){if(_0x4816ff){return _0x4816ff[_0x6509('0x21')]()[_0x6509('0x22')](function(){_0x26d9c4[_0x6509('0x17')](0xcc)[_0x6509('0x23')]();});}};}function handleEntityNotFound(_0x43ead3,_0x5f5a70){return function(_0x25c517){if(!_0x25c517){_0x43ead3['sendStatus'](0x194);}return _0x25c517;};}function handleError(_0x5ddcba,_0x5762cf){_0x5762cf=_0x5762cf||0x1f4;return function(_0x3d590b){logger[_0x6509('0x24')](_0x3d590b['stack']);if(_0x3d590b[_0x6509('0x25')]){delete _0x3d590b['name'];}_0x5ddcba['status'](_0x5762cf)[_0x6509('0x26')](_0x3d590b);};}exports[_0x6509('0x27')]=function(_0x542c61,_0x869542){var _0x16f4c7={},_0x15b9c0={},_0x143289={'count':0x0,'rows':[]};var _0x5f23e6=_[_0x6509('0x28')](db['WhatsappApplication'][_0x6509('0x29')],function(_0x2c2a04){return{'name':_0x2c2a04[_0x6509('0x2a')],'type':_0x2c2a04[_0x6509('0x2b')]['key']};});_0x15b9c0[_0x6509('0x2c')]=_[_0x6509('0x28')](_0x5f23e6,'name');_0x15b9c0[_0x6509('0x2d')]=_['keys'](_0x542c61['query']);_0x15b9c0[_0x6509('0x2e')]=_[_0x6509('0x2f')](_0x15b9c0[_0x6509('0x2c')],_0x15b9c0[_0x6509('0x2d')]);_0x16f4c7[_0x6509('0x30')]=_[_0x6509('0x2f')](_0x15b9c0['model'],qs[_0x6509('0x31')](_0x542c61[_0x6509('0x2d')][_0x6509('0x31')]));_0x16f4c7[_0x6509('0x30')]=_0x16f4c7[_0x6509('0x30')][_0x6509('0x32')]?_0x16f4c7['attributes']:_0x15b9c0[_0x6509('0x2c')];if(!_0x542c61[_0x6509('0x2d')][_0x6509('0x33')](_0x6509('0x34'))){_0x16f4c7[_0x6509('0x1a')]=qs[_0x6509('0x1a')](_0x542c61[_0x6509('0x2d')]['limit']);_0x16f4c7[_0x6509('0x19')]=qs[_0x6509('0x19')](_0x542c61[_0x6509('0x2d')][_0x6509('0x19')]);}_0x16f4c7[_0x6509('0x35')]=qs[_0x6509('0x36')](_0x542c61[_0x6509('0x2d')][_0x6509('0x36')]);_0x16f4c7[_0x6509('0x37')]=qs['filters'](_['pick'](_0x542c61[_0x6509('0x2d')],_0x15b9c0[_0x6509('0x2e')]),_0x5f23e6);if(_0x542c61['query']['filter']){_0x16f4c7['where']=_[_0x6509('0x38')](_0x16f4c7[_0x6509('0x37')],{'$or':_[_0x6509('0x28')](_0x5f23e6,function(_0x98a20f){if(_0x98a20f[_0x6509('0x2b')]!==_0x6509('0x39')){var _0x6af36b={};_0x6af36b[_0x98a20f[_0x6509('0x25')]]={'$like':'%'+_0x542c61[_0x6509('0x2d')][_0x6509('0x3a')]+'%'};return _0x6af36b;}})});}_0x16f4c7=_[_0x6509('0x38')]({},_0x16f4c7,_0x542c61[_0x6509('0x3b')]);var _0x5633e9={'where':_0x16f4c7['where']};return db['WhatsappApplication'][_0x6509('0x18')](_0x5633e9)[_0x6509('0x22')](function(_0x5d991d){_0x143289['count']=_0x5d991d;if(_0x542c61['query'][_0x6509('0x3c')]){_0x16f4c7['include']=[{'all':!![]}];}return db[_0x6509('0x3d')][_0x6509('0x3e')](_0x16f4c7);})[_0x6509('0x22')](function(_0x5a7088){_0x143289[_0x6509('0x3f')]=_0x5a7088;return _0x143289;})[_0x6509('0x22')](respondWithFilteredResult(_0x869542,_0x16f4c7))[_0x6509('0x40')](handleError(_0x869542,null));};exports['show']=function(_0x5a6d3c,_0x4cea75){var _0x53c1aa={'raw':!![],'where':{'id':_0x5a6d3c[_0x6509('0x41')]['id']}},_0x150a34={};_0x150a34[_0x6509('0x2c')]=_[_0x6509('0x42')](db[_0x6509('0x3d')][_0x6509('0x29')]);_0x150a34[_0x6509('0x2d')]=_['keys'](_0x5a6d3c[_0x6509('0x2d')]);_0x150a34[_0x6509('0x2e')]=_[_0x6509('0x2f')](_0x150a34['model'],_0x150a34['query']);_0x53c1aa[_0x6509('0x30')]=_[_0x6509('0x2f')](_0x150a34[_0x6509('0x2c')],qs[_0x6509('0x31')](_0x5a6d3c[_0x6509('0x2d')][_0x6509('0x31')]));_0x53c1aa[_0x6509('0x30')]=_0x53c1aa[_0x6509('0x30')][_0x6509('0x32')]?_0x53c1aa['attributes']:_0x150a34[_0x6509('0x2c')];if(_0x5a6d3c[_0x6509('0x2d')]['includeAll']){_0x53c1aa[_0x6509('0x43')]=[{'all':!![]}];}_0x53c1aa=_['merge']({},_0x53c1aa,_0x5a6d3c[_0x6509('0x3b')]);return db['WhatsappApplication'][_0x6509('0x44')](_0x53c1aa)[_0x6509('0x22')](handleEntityNotFound(_0x4cea75,null))[_0x6509('0x22')](respondWithResult(_0x4cea75,null))[_0x6509('0x40')](handleError(_0x4cea75,null));};exports[_0x6509('0x45')]=function(_0x1e150c,_0x187e3e){return db[_0x6509('0x3d')][_0x6509('0x45')](_0x1e150c[_0x6509('0x46')],{})[_0x6509('0x22')](respondWithResult(_0x187e3e,0xc9))['catch'](handleError(_0x187e3e,null));};exports['update']=function(_0x3f1667,_0x3e59e1){if(_0x3f1667[_0x6509('0x46')]['id']){delete _0x3f1667[_0x6509('0x46')]['id'];}return db['WhatsappApplication'][_0x6509('0x44')]({'where':{'id':_0x3f1667['params']['id']}})[_0x6509('0x22')](handleEntityNotFound(_0x3e59e1,null))['then'](saveUpdates(_0x3f1667[_0x6509('0x46')],null))['then'](respondWithResult(_0x3e59e1,null))[_0x6509('0x40')](handleError(_0x3e59e1,null));};exports[_0x6509('0x21')]=function(_0x4909db,_0x2fe144){return db[_0x6509('0x3d')][_0x6509('0x44')]({'where':{'id':_0x4909db['params']['id']}})[_0x6509('0x22')](handleEntityNotFound(_0x2fe144,null))[_0x6509('0x22')](removeEntity(_0x2fe144,null))[_0x6509('0x40')](handleError(_0x2fe144,null));};
\ No newline at end of file
index f40a1d5..1507875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd16a=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','whatsapp_applications'];(function(_0x37f32d,_0x1c55f5){var _0x580007=function(_0x5825a7){while(--_0x5825a7){_0x37f32d['push'](_0x37f32d['shift']());}};_0x580007(++_0x1c55f5);}(_0xd16a,0x161));var _0xad16=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd16a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xad16('0x0'));var util=require(_0xad16('0x1'));var logger=require(_0xad16('0x2'))(_0xad16('0x3'));var moment=require(_0xad16('0x4'));var BPromise=require(_0xad16('0x5'));var rp=require(_0xad16('0x6'));var fs=require('fs');var path=require(_0xad16('0x7'));var rimraf=require('rimraf');var config=require(_0xad16('0x8'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x1ccba3,_0x34eb49){return _0x1ccba3[_0xad16('0x9')]('WhatsappApplication',attributes,{'tableName':_0xad16('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad16('0xb'),'collate':_0xad16('0xc')});};
\ No newline at end of file
+var _0xd3a0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x29fcea,_0x257199){var _0x243673=function(_0x182f2c){while(--_0x182f2c){_0x29fcea['push'](_0x29fcea['shift']());}};_0x243673(++_0x257199);}(_0xd3a0,0xde));var _0x0d3a=function(_0x252eb5,_0x585fc5){_0x252eb5=_0x252eb5-0x0;var _0xc3e372=_0xd3a0[_0x252eb5];return _0xc3e372;};'use strict';var _=require(_0x0d3a('0x0'));var util=require('util');var logger=require(_0x0d3a('0x1'))(_0x0d3a('0x2'));var moment=require(_0x0d3a('0x3'));var BPromise=require(_0x0d3a('0x4'));var rp=require(_0x0d3a('0x5'));var fs=require('fs');var path=require(_0x0d3a('0x6'));var rimraf=require(_0x0d3a('0x7'));var config=require(_0x0d3a('0x8'));var attributes=require(_0x0d3a('0x9'));module['exports']=function(_0x1000df,_0xbb01ff){return _0x1000df[_0x0d3a('0xa')](_0x0d3a('0xb'),attributes,{'tableName':_0x0d3a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0d3a('0xd')});};
\ No newline at end of file
index e445138..82be707 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e4b=['lodash','util','moment','randomstring','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4505ff,_0x279eac){var _0x589f3f=function(_0x4dc73f){while(--_0x4dc73f){_0x4505ff['push'](_0x4505ff['shift']());}};_0x589f3f(++_0x279eac);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x294457,_0x4aa173){_0x294457=_0x294457-0x0;var _0x30ce79=_0x0e4b[_0x294457];return _0x30ce79;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var moment=require(_0xb0e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb0e4('0x4'));var config=require(_0xb0e4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0e4('0x6')][_0xb0e4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x78e4ed,_0x3dff2f,_0x35aa64){return new BPromise(function(_0x57f45d,_0x5192f0){return client[_0xb0e4('0x8')](_0x78e4ed,_0x35aa64)[_0xb0e4('0x9')](function(_0x1d6452){logger[_0xb0e4('0xa')](_0xb0e4('0xb'),_0x3dff2f,_0xb0e4('0xc'));logger[_0xb0e4('0xd')](_0xb0e4('0xe'),_0x3dff2f,_0xb0e4('0xc'),JSON[_0xb0e4('0xf')](_0x1d6452));if(_0x1d6452[_0xb0e4('0x10')]){if(_0x1d6452[_0xb0e4('0x10')][_0xb0e4('0x11')]===0x1f4){logger[_0xb0e4('0x10')](_0xb0e4('0xb'),_0x3dff2f,_0x1d6452['error'][_0xb0e4('0x12')]);return _0x5192f0(_0x1d6452[_0xb0e4('0x10')]['message']);}logger[_0xb0e4('0x10')](_0xb0e4('0xb'),_0x3dff2f,_0x1d6452[_0xb0e4('0x10')][_0xb0e4('0x12')]);return _0x57f45d(_0x1d6452[_0xb0e4('0x10')]['message']);}else{logger['info'](_0xb0e4('0xb'),_0x3dff2f,_0xb0e4('0xc'));_0x57f45d(_0x1d6452['result'][_0xb0e4('0x12')]);}})[_0xb0e4('0x13')](function(_0xc12df2){logger[_0xb0e4('0x10')](_0xb0e4('0xb'),_0x3dff2f,_0xc12df2);_0x5192f0(_0xc12df2);});});}
\ No newline at end of file
+var _0x04f9=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04f9,0xb3));var _0x904f=function(_0x10e5c4,_0x4800f3){_0x10e5c4=_0x10e5c4-0x0;var _0x2b522a=_0x04f9[_0x10e5c4];return _0x2b522a;};'use strict';var _=require('lodash');var util=require(_0x904f('0x0'));var moment=require(_0x904f('0x1'));var BPromise=require(_0x904f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x904f('0x3'));var db=require(_0x904f('0x4'))['db'];var utils=require(_0x904f('0x5'));var logger=require(_0x904f('0x6'))(_0x904f('0x7'));var config=require(_0x904f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x904f('0x9')][_0x904f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175c38,_0x21dce4,_0x34cbd7){return new BPromise(function(_0x506239,_0xa90c3f){return client[_0x904f('0xb')](_0x175c38,_0x34cbd7)[_0x904f('0xc')](function(_0x4f8d32){logger[_0x904f('0xd')](_0x904f('0xe'),_0x21dce4,_0x904f('0xf'));logger[_0x904f('0x10')](_0x904f('0x11'),_0x21dce4,_0x904f('0xf'),JSON[_0x904f('0x12')](_0x4f8d32));if(_0x4f8d32[_0x904f('0x13')]){if(_0x4f8d32[_0x904f('0x13')][_0x904f('0x14')]===0x1f4){logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0xa90c3f(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0x506239(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}else{logger[_0x904f('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x21dce4,'request\x20sent');_0x506239(_0x4f8d32[_0x904f('0x16')][_0x904f('0x15')]);}})['catch'](function(_0x58c4d6){logger['error'](_0x904f('0xe'),_0x21dce4,_0x58c4d6);_0xa90c3f(_0x58c4d6);});});}
\ No newline at end of file
index 66a8f65..4301077 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7f4=['tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags'];(function(_0x26aaf1,_0x40e000){var _0x532bb6=function(_0x157d6b){while(--_0x157d6b){_0x26aaf1['push'](_0x26aaf1['shift']());}};_0x532bb6(++_0x40e000);}(_0xc7f4,0x161));var _0x4c7f=function(_0x25980b,_0x163c35){_0x25980b=_0x25980b-0x0;var _0x508ee5=_0xc7f4[_0x25980b];return _0x508ee5;};'use strict';var multer=require(_0x4c7f('0x0'));var util=require(_0x4c7f('0x1'));var path=require(_0x4c7f('0x2'));var timeout=require(_0x4c7f('0x3'));var express=require('express');var router=express[_0x4c7f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4c7f('0x5'));var config=require(_0x4c7f('0x6'));var controller=require('./whatsappInteraction.controller');router[_0x4c7f('0x7')]('/',auth[_0x4c7f('0x8')](),controller[_0x4c7f('0x9')]);router[_0x4c7f('0x7')](_0x4c7f('0xa'),auth[_0x4c7f('0x8')](),controller['describe']);router[_0x4c7f('0x7')]('/:id',auth[_0x4c7f('0x8')](),controller['show']);router[_0x4c7f('0x7')](_0x4c7f('0xb'),auth[_0x4c7f('0x8')](),controller[_0x4c7f('0xc')]);router[_0x4c7f('0x7')](_0x4c7f('0xd'),auth[_0x4c7f('0x8')](),controller[_0x4c7f('0xe')]);router['post']('/',auth[_0x4c7f('0x8')](),controller[_0x4c7f('0xf')]);router['post'](_0x4c7f('0xb'),auth[_0x4c7f('0x8')](),controller[_0x4c7f('0x10')]);router[_0x4c7f('0x11')](_0x4c7f('0x12'),auth[_0x4c7f('0x8')](),interaction[_0x4c7f('0x13')](_0x4c7f('0x14'),_0x4c7f('0x15')),controller['addTags']);router[_0x4c7f('0x16')](_0x4c7f('0x17'),auth['isAuthenticated'](),interaction[_0x4c7f('0x13')]('whatsapp',_0x4c7f('0x18')),controller[_0x4c7f('0x19')]);router[_0x4c7f('0x1a')](_0x4c7f('0x17'),auth[_0x4c7f('0x8')](),interaction[_0x4c7f('0x13')]('whatsapp',_0x4c7f('0x1b')),controller[_0x4c7f('0x1c')]);router[_0x4c7f('0x1a')](_0x4c7f('0x12'),auth[_0x4c7f('0x8')](),controller[_0x4c7f('0x1d')]);module[_0x4c7f('0x1e')]=router;
\ No newline at end of file
+var _0x3e84=['destroy','removeTags','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','delete','whatsappinteraction:destroy'];(function(_0x566438,_0x3abb6a){var _0x2d8c26=function(_0x9ac951){while(--_0x9ac951){_0x566438['push'](_0x566438['shift']());}};_0x2d8c26(++_0x3abb6a);}(_0x3e84,0xd4));var _0x43e8=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x3e84[_0x173d7e];return _0x2220d6;};'use strict';var multer=require('multer');var util=require(_0x43e8('0x0'));var path=require(_0x43e8('0x1'));var timeout=require(_0x43e8('0x2'));var express=require(_0x43e8('0x3'));var router=express[_0x43e8('0x4')]();var auth=require(_0x43e8('0x5'));var interaction=require(_0x43e8('0x6'));var config=require(_0x43e8('0x7'));var controller=require(_0x43e8('0x8'));router[_0x43e8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x43e8('0x9')]('/describe',auth[_0x43e8('0xa')](),controller[_0x43e8('0xb')]);router[_0x43e8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x43e8('0xc')]);router[_0x43e8('0x9')](_0x43e8('0xd'),auth[_0x43e8('0xa')](),controller['getMessages']);router[_0x43e8('0x9')](_0x43e8('0xe'),auth[_0x43e8('0xa')](),controller[_0x43e8('0xf')]);router[_0x43e8('0x10')]('/',auth[_0x43e8('0xa')](),controller[_0x43e8('0x11')]);router['post'](_0x43e8('0xd'),auth[_0x43e8('0xa')](),controller[_0x43e8('0x12')]);router[_0x43e8('0x10')](_0x43e8('0x13'),auth['isAuthenticated'](),interaction[_0x43e8('0x14')](_0x43e8('0x15'),_0x43e8('0x16')),controller[_0x43e8('0x17')]);router[_0x43e8('0x18')](_0x43e8('0x19'),auth[_0x43e8('0xa')](),interaction[_0x43e8('0x14')](_0x43e8('0x15'),'whatsappinteraction:update'),controller['update']);router[_0x43e8('0x1a')](_0x43e8('0x19'),auth[_0x43e8('0xa')](),interaction['tracked'](_0x43e8('0x15'),_0x43e8('0x1b')),controller[_0x43e8('0x1c')]);router[_0x43e8('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x43e8('0x1d')]);module['exports']=router;
\ No newline at end of file
index 90a356c..f76984f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43e3=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x2b4895,_0x20c70a){var _0x569215=function(_0x26ddf4){while(--_0x26ddf4){_0x2b4895['push'](_0x2b4895['shift']());}};_0x569215(++_0x20c70a);}(_0x43e3,0x19d));var _0x343e=function(_0x2460d9,_0x15da87){_0x2460d9=_0x2460d9-0x0;var _0x4bc204=_0x43e3[_0x2460d9];return _0x4bc204;};'use strict';var Sequelize=require(_0x343e('0x0'));var moment=require(_0x343e('0x1'));module[_0x343e('0x2')]={'closed':{'type':Sequelize[_0x343e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x343e('0x4')]},'disposition':{'type':Sequelize[_0x343e('0x5')]},'note':{'type':Sequelize[_0x343e('0x5')]},'phone':{'type':Sequelize[_0x343e('0x5')]},'read1stAt':{'type':Sequelize[_0x343e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x343e('0x6')]('in',_0x343e('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x343e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x343e('0x6')]('in',_0x343e('0x7')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xd791=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd791,0xc7));var _0x1d79=function(_0x25c57f,_0x30ca62){_0x25c57f=_0x25c57f-0x0;var _0x1e77d2=_0xd791[_0x25c57f];return _0x1e77d2;};'use strict';var Sequelize=require(_0x1d79('0x0'));var moment=require(_0x1d79('0x1'));module[_0x1d79('0x2')]={'closed':{'type':Sequelize[_0x1d79('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1d79('0x4')]},'disposition':{'type':Sequelize[_0x1d79('0x5')]},'note':{'type':Sequelize[_0x1d79('0x5')]},'phone':{'type':Sequelize[_0x1d79('0x5')]},'read1stAt':{'type':Sequelize[_0x1d79('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1d79('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1d79('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1d79('0x6')]('in',_0x1d79('0x7')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 701ab91..49d31f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['index','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','toString','count','sequelize','fields','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','WhatsappInteraction','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','10px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','%s\x20#%d','Whatsapp','YYYY-MM-DD','closedAt','disposition','existsSync','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','TagIds','split','forEach','push','catch'];(function(_0x51e10e,_0x57f2a6){var _0x1cfe29=function(_0x26c206){while(--_0x26c206){_0x51e10e['push'](_0x51e10e['shift']());}};_0x1cfe29(++_0x57f2a6);}(_0x814b,0x1a2));var _0xb814=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x814b[_0x2b737c];return _0x466ed5;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}function getInteractionUsers(_0x52ed64,_0x9008b2){return new BPromise(function(_0x37d24d,_0x530744){try{if(_0x9008b2[_0x52ed64['id']]){_0x52ed64['Users']=_[_0xb814('0x30')](_0x9008b2[_0x52ed64['id']],function(_0x2051d0){return{'id':_0x2051d0['id'],'fullname':_0x2051d0['fullname']};});}}catch(_0x338a28){_0x530744(_0x338a28);}_0x37d24d(_0x52ed64);});}function getInteractionTags(_0x526610,_0x6efe9a){return new BPromise(function(_0x5f3e9b,_0x4cfc58){try{if(_0x526610[_0xb814('0x31')]){_0x526610['Tags']=[];_0x526610[_0xb814('0x31')][_0xb814('0x32')](',')[_0xb814('0x33')](function(_0x599f9f){_0x526610['Tags'][_0xb814('0x34')](_0x6efe9a[_0x599f9f]);});}delete _0x526610[_0xb814('0x31')];}catch(_0x523566){_0x4cfc58(_0x523566);}_0x5f3e9b(_0x526610);});}function updateWhatsappInteraction(_0x2c8943,_0xe558d5,_0x692c72){return new BPromise(function(_0x217b7e,_0x1b78de){return getInteractionUsers(_0x2c8943,_0x692c72)[_0xb814('0x2b')](function(_0x3672f3){return getInteractionTags(_0x3672f3,_0xe558d5);})['then'](function(_0x3207ec){_0x217b7e(_0x3207ec);})[_0xb814('0x35')](function(_0x30de5a){_0x1b78de(_0x30de5a);});});}exports[_0xb814('0x36')]=function(_0x14100d,_0x4ff31a){var _0x16ef82={},_0x57e6e6={},_0x43db67={'count':0x0,'rows':[]};var _0x16e21c=_[_0xb814('0x30')](db['WhatsappInteraction'][_0xb814('0x37')],function(_0xbdb3e9){return{'name':_0xbdb3e9['fieldName'],'type':_0xbdb3e9[_0xb814('0x38')][_0xb814('0x39')]};});_0x57e6e6[_0xb814('0x3a')]=_[_0xb814('0x30')](_0x16e21c,_0xb814('0x2e'));_0x57e6e6[_0xb814('0x3b')]=_['keys'](_0x14100d[_0xb814('0x3b')]);_0x57e6e6['filters']=_[_0xb814('0x3c')](_0x57e6e6['model'],_0x57e6e6[_0xb814('0x3b')]);_0x16ef82['attributes']=_[_0xb814('0x3c')](_0x57e6e6[_0xb814('0x3a')],qs['fields'](_0x14100d['query']['fields']));_0x16ef82['attributes']=_0x16ef82[_0xb814('0x3d')][_0xb814('0x3e')]?_0x16ef82[_0xb814('0x3d')]:_0x57e6e6[_0xb814('0x3a')];if(!_0x14100d['query']['hasOwnProperty'](_0xb814('0x3f'))){_0x16ef82['limit']=qs[_0xb814('0x40')](_0x14100d[_0xb814('0x3b')][_0xb814('0x40')]);_0x16ef82[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x14100d[_0xb814('0x3b')][_0xb814('0x24')]);}_0x16ef82[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x14100d['query']['sort']);_0x16ef82['where']=qs[_0xb814('0x43')](_['pick'](_0x14100d[_0xb814('0x3b')],_0x57e6e6['filters']),_0x16e21c);var _0x411723=[];var _0x44ff56=squel[_0xb814('0x44')]()[_0xb814('0x45')]('id')['field'](_0xb814('0x2e'))[_0xb814('0x45')](_0xb814('0x46'))[_0xb814('0x47')](_0xb814('0x48'));var _0x450a08=squel['select']()[_0xb814('0x45')](_0xb814('0x49'))[_0xb814('0x45')](_0xb814('0x4a'))[_0xb814('0x45')](_0xb814('0x4b'))[_0xb814('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb814('0x4c'),'u',_0xb814('0x4d'));var _0x4c08d6=squel[_0xb814('0x44')]()[_0xb814('0x47')](_0xb814('0x4e'),'i')[_0xb814('0x4f')](_0xb814('0x50'),'c',_0xb814('0x51'))[_0xb814('0x4f')](_0xb814('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xb814('0x4f')](_0xb814('0x52'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb814('0x4f')]('whatsapp_messages','me',_0xb814('0x53'))[_0xb814('0x4f')](_0xb814('0x54'),'it',_0xb814('0x55'))[_0xb814('0x4f')](_0xb814('0x48'),'t',_0xb814('0x56'));var _0x45480e=squel[_0xb814('0x57')]();var _0x2a422a=[];var _0x5e6df7=squel['expr']();var _0x32eca6;if(_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]){_0x32eca6=as[_0xb814('0x59')](_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]);var _0x135208=_0x32eca6['sqlOperator'];for(var _0x26fd0b=0x0;_0x26fd0b<_0x32eca6[_0xb814('0x5a')][_0xb814('0x3e')];_0x26fd0b++){var _0x5a916d=_0x32eca6[_0xb814('0x5a')][_0x26fd0b];var _0x4e6f3c='i';var _0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),_0x5a916d[_0xb814('0x45')]]);if(!_0x252293){switch(_0x5a916d['field']){case _0xb814('0x5b'):if(_0x5a916d[_0xb814('0x5c')]==0x1){_0x4c08d6[_0xb814('0x5d')]('`'+_0x5a916d['field']+_0xb814('0x5e'));}else{_0x4c08d6['having']('`'+_0x5a916d[_0xb814('0x45')]+_0xb814('0x5f'));}break;case'Contact':if(_0x5a916d[_0xb814('0x60')]==='$substring'){if(_0x5a916d['value'][_0xb814('0x32')]('\x20')[_0xb814('0x3e')]>0x1){_0x45480e[_0x135208](_0xb814('0x61'),qs['getFullTextValue'](_0x5a916d[_0xb814('0x5c')]),null);}else{var _0x538b0f='%'+_0x5a916d[_0xb814('0x5c')]+'%';_0x45480e[_0x135208](_0xb814('0x62'),_0x538b0f,_0x538b0f,_0x538b0f);}}else{_0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),'ContactId']);_0x5a916d[_0xb814('0x45')]=_0xb814('0x63');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x67'):var _0x5441c5=_0x5a916d['value'][_0xb814('0x32')](',')[_0xb814('0x30')](function(_0x4d13db){return Number(_0x4d13db);});_0x5441c5[_0xb814('0x33')](function(_0x58b9a6){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58b9a6+',%');});_0x2a422a=_[_0xb814('0x68')](_0x2a422a,_0x5441c5);break;case'User':if(_0x5a916d[_0xb814('0x60')]===_0xb814('0x69')){_0x45480e[_0x135208](_0xb814('0x6a'),'%'+_0x5a916d['value']+'%',null);}else{_0x252293=_[_0xb814('0x6b')](_0x16e21c,['name',_0xb814('0x6c')]);_0x5a916d[_0xb814('0x45')]=_0xb814('0x6c');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x6d'):_0x135e13=as[_0xb814('0x64')]('me',null,_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);break;}}else{var _0x135e13=as['buildExpression'](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')]['start'],_0x135e13[_0xb814('0x5c')]['end']);}}}else{var _0x37e9c5=_(_0x14100d['query'])[_0xb814('0x6e')]()[_0xb814('0x30')](function(_0xa03cd2){return _[_0xb814('0x6f')](_0x16e21c,[_0xb814('0x2e'),_0xa03cd2])?_0xa03cd2:undefined;})[_0xb814('0x70')]()[_0xb814('0x5c')]();if(!_['isEmpty'](_0x37e9c5)){_0x37e9c5[_0xb814('0x33')](function(_0x51ca51){if(_0x51ca51===_0xb814('0x71')){_0x4c08d6[_0xb814('0x72')](_0xb814('0x73'),[][_0xb814('0x74')](_0x14100d[_0xb814('0x3b')][_0x51ca51]));}else if(_0x51ca51===_0xb814('0x75')){var _0x514dab=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])['$gte'];var _0x3bb2b4=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])[_0xb814('0x77')];_0x4c08d6[_0xb814('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514dab,_0x3bb2b4);}else{if(_0x14100d[_0xb814('0x3b')][_0x51ca51]==='null'){_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x78'));}else{_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x79'),_0x14100d[_0xb814('0x3b')][_0x51ca51]);}}});}if(_0x14100d[_0xb814('0x3b')]['read']){if(_0x14100d['query']['read']==0x1){_0x4c08d6[_0xb814('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4c08d6[_0xb814('0x5d')](_0xb814('0x7a'));}}if(_0x14100d[_0xb814('0x3b')]['tag']){_0x2a422a=_[_0xb814('0x7b')](_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')])?_0x14100d['query'][_0xb814('0x7c')]:new Array(_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')]);_0x2a422a[_0xb814('0x33')](function(_0x555be0){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x555be0+',%');});}if(_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')]){var _0x39863d=_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')][_0xb814('0x7e')]('\x5c','\x5c\x5c')[_0xb814('0x7e')]('\x27\x27',_0xb814('0x7f'));if(qs[_0xb814('0x80')](_0x39863d)){_0x45480e['or'](_0xb814('0x81'),_0x39863d+'%')['or'](_0xb814('0x82'),_0x39863d+'%');}else{_0x45480e['or'](_0xb814('0x83'),qs[_0xb814('0x84')](_0x39863d))['or'](_0xb814('0x85'),_0x39863d+'%');}}}_0x4c08d6[_0xb814('0x72')](_0x45480e);_0x4c08d6['group'](_0xb814('0x86'));var _0x33cfc4={'type':db[_0xb814('0x87')][_0xb814('0x88')][_0xb814('0x89')],'raw':!![]};var _0x283b0f=_0x4c08d6['clone']();_0x283b0f[_0xb814('0x45')]('i.id');_0x283b0f[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));if(_0x16ef82[_0xb814('0x41')]){_0x16ef82[_0xb814('0x41')]['forEach'](function(_0x4c44ee){_0x4c08d6[_0xb814('0x41')]('i.'+_0x4c44ee[0x0],_0x4c44ee[0x1]===_0xb814('0x8b')?![]:!![]);});}if(!_[_0xb814('0x8c')](_0x2a422a)){_0x4c08d6[_0xb814('0x5d')](_0x5e6df7);_0x283b0f['where'](_0xb814('0x8d'),_0x2a422a);}BPromise['resolve']()[_0xb814('0x2b')](function(){if(!_0x32eca6){if(_0x14100d[_0xb814('0x3b')]['WhatsappAccountId']||_0x14100d['query'][_0xb814('0x8e')])return;_0x283b0f['where'](_0xb814('0x8f'));_0x4c08d6[_0xb814('0x72')](_0xb814('0x8f'));return;}return _0x14100d[_0xb814('0x90')][_0xb814('0x91')]({'attributes':['id'],'raw':!![]})[_0xb814('0x2b')](function(_0x40fe4a){if(_['isEmpty'](_0x40fe4a)){_0x283b0f[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x283b0f[_0xb814('0x72')](_0xb814('0x73'),_['map'](_0x40fe4a,'id'));_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb814('0x30')](_0x40fe4a,'id'));}});})[_0xb814('0x2b')](function(){db['sequelize']['query'](_0x283b0f[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x3309c5){_0x43db67[_0xb814('0x93')]=_0x3309c5[_0xb814('0x3e')];if(_0x43db67[_0xb814('0x93')]===0x0)return[];return db[_0xb814('0x94')][_0xb814('0x3b')](_0x44ff56[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x53e705){_0x411723=_['keyBy'](_0x53e705,'id');_0x33cfc4=_['merge'](_0x33cfc4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14100d['query'][_0xb814('0x95')]){_0x16ef82[_0xb814('0x3d')][_0xb814('0x33')](function(_0x59f3ff){_0x4c08d6[_0xb814('0x45')]('i.'+_0x59f3ff);});}else{_0x4c08d6[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x96'),_0xb814('0x97'));_0x4c08d6[_0xb814('0x45')]('a.mandatoryDisposition',_0xb814('0x98'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x99'));_0x4c08d6[_0xb814('0x45')]('c.firstName',_0xb814('0x9a'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x9b'),_0xb814('0x9c'));_0x4c08d6[_0xb814('0x45')]('c.email','Contact.email');_0x4c08d6[_0xb814('0x45')]('c.phone',_0xb814('0x9d'));_0x4c08d6[_0xb814('0x45')]('c.mobile',_0xb814('0x9e'));_0x4c08d6['field'](_0xb814('0x9f'),'Contact.fax');_0x4c08d6[_0xb814('0x45')](_0xb814('0xa0'),_0xb814('0xa1'));_0x4c08d6[_0xb814('0x45')](_0xb814('0xa2'),_0xb814('0xa3'));_0x4c08d6[_0xb814('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16ef82[_0xb814('0x40')])_0x4c08d6['limit'](_0x16ef82['limit']);if(_0x16ef82[_0xb814('0x24')])_0x4c08d6[_0xb814('0x24')](_0x16ef82[_0xb814('0x24')]);return db['sequelize'][_0xb814('0x3b')](_0x4c08d6['toString'](),_0x33cfc4);})[_0xb814('0x2b')](function(_0x19d508){_0x450a08[_0xb814('0x72')](_0xb814('0xa4'),_['map'](_0x19d508,'id'));return db[_0xb814('0x94')][_0xb814('0x3b')](_0x450a08[_0xb814('0x92')](),_0x33cfc4)['then'](function(_0x1ebbf6){var _0x3fc77d=_[_0xb814('0xa5')](_0x1ebbf6,'WhatsappInteractionId');var _0x5d8626=[];_0x19d508[_0xb814('0x33')](function(_0x9dc06b){_0x5d8626[_0xb814('0x34')](updateWhatsappInteraction(_0x9dc06b,_0x411723,_0x3fc77d));});return BPromise[_0xb814('0xa6')](_0x5d8626);});});})[_0xb814('0x2b')](function(_0x37a7ab){_0x43db67[_0xb814('0xa7')]=_0x37a7ab;return _0x43db67;})[_0xb814('0x2b')](respondWithFilteredResult(_0x4ff31a,_0x16ef82));})[_0xb814('0x35')](handleError(_0x4ff31a,null));};exports[_0xb814('0xa8')]=function(_0x2569a5,_0x2a13fb){var _0x5b8d2e={'raw':![],'where':{'id':_0x2569a5[_0xb814('0xa9')]['id']}},_0x5416dc={};_0x5416dc['model']=_[_0xb814('0x6e')](db[_0xb814('0xaa')][_0xb814('0x37')]);_0x5416dc[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x2569a5[_0xb814('0x3b')]);_0x5416dc[_0xb814('0x43')]=_['intersection'](_0x5416dc['model'],_0x5416dc[_0xb814('0x3b')]);_0x5b8d2e['attributes']=_[_0xb814('0x3c')](_0x5416dc[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x2569a5['query'][_0xb814('0x95')]));_0x5b8d2e[_0xb814('0x3d')]=_0x5b8d2e[_0xb814('0x3d')][_0xb814('0x3e')]?_0x5b8d2e[_0xb814('0x3d')]:_0x5416dc['model'];if(_0x2569a5[_0xb814('0x3b')][_0xb814('0xab')]){_0x5b8d2e['include']=[{'all':!![]}];}_0x5b8d2e=_[_0xb814('0xac')]({},_0x5b8d2e,_0x2569a5[_0xb814('0xad')]);return db[_0xb814('0xaa')]['find'](_0x5b8d2e)[_0xb814('0x2b')](handleEntityNotFound(_0x2a13fb,null))[_0xb814('0x2b')](respondWithResult(_0x2a13fb,null))['catch'](handleError(_0x2a13fb,null));};exports[_0xb814('0xae')]=function(_0x171f83,_0x5b5634){return db[_0xb814('0xaa')][_0xb814('0xae')](_0x171f83[_0xb814('0x6d')],{})[_0xb814('0x2b')](respondWithResult(_0x5b5634,0xc9))[_0xb814('0x35')](handleError(_0x5b5634,null));};exports[_0xb814('0x29')]=function(_0x40ae0b,_0x336a8f){if(_0x40ae0b[_0xb814('0x6d')]['id']){delete _0x40ae0b[_0xb814('0x6d')]['id'];}return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x40ae0b['params']['id']}})['then'](handleEntityNotFound(_0x336a8f,null))[_0xb814('0x2b')](saveUpdates(_0x40ae0b['body'],null))['then'](respondWithResult(_0x336a8f,null))[_0xb814('0x35')](handleError(_0x336a8f,null));};exports['destroy']=function(_0x4f0427,_0x50cb34){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x4f0427[_0xb814('0xa9')]['id']}})['then'](handleEntityNotFound(_0x50cb34,null))[_0xb814('0x2b')](removeEntity(_0x50cb34,null))['catch'](handleError(_0x50cb34,null));};exports[_0xb814('0xaf')]=function(_0x2e6660,_0x49a8de){return db[_0xb814('0xaa')]['describe']()[_0xb814('0x2b')](respondWithResult(_0x49a8de,null))[_0xb814('0x35')](handleError(_0x49a8de,null));};exports[_0xb814('0xb0')]=function(_0x39ce17,_0x11efb8,_0xaf705d){return db[_0xb814('0xb1')][_0xb814('0x6b')]({'where':{'id':_0x39ce17[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x11efb8,null))[_0xb814('0x2b')](function(_0x3e7a9a){if(_0x3e7a9a){return _0x3e7a9a[_0xb814('0xb0')](_0x39ce17[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x39ce17[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x11efb8,null))[_0xb814('0x35')](handleError(_0x11efb8,null));};exports[_0xb814('0xb3')]=function(_0x1868d9,_0x570191,_0x56b2aa){var _0x473b30={'raw':![],'where':{}};var _0x4af71e={};var _0x2d40e6={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb814('0xb4')]({'where':{'id':_0x1868d9['params']['id']}})['then'](handleEntityNotFound(_0x570191,null))[_0xb814('0x2b')](function(_0x32c956){if(_0x32c956){_0x4af71e[_0xb814('0x3a')]=_[_0xb814('0x6e')](db[_0xb814('0xb1')][_0xb814('0x37')]);_0x4af71e[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x1868d9[_0xb814('0x3b')]);_0x4af71e[_0xb814('0x43')]=_[_0xb814('0x3c')](_0x4af71e['model'],_0x4af71e[_0xb814('0x3b')]);_0x473b30['attributes']=_[_0xb814('0x3c')](_0x4af71e[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x1868d9['query'][_0xb814('0x95')]));_0x473b30[_0xb814('0x3d')]=_0x473b30[_0xb814('0x3d')][_0xb814('0x3e')]?_0x473b30[_0xb814('0x3d')]:_0x4af71e[_0xb814('0x3a')];if(!_0x1868d9[_0xb814('0x3b')][_0xb814('0xb5')](_0xb814('0x3f'))){_0x473b30[_0xb814('0x40')]=qs[_0xb814('0x40')](_0x1868d9[_0xb814('0x3b')][_0xb814('0x40')]);_0x473b30[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x1868d9['query'][_0xb814('0x24')]);}_0x473b30[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x1868d9['query']['sort']);_0x473b30[_0xb814('0x72')]=qs['filters'](_['pick'](_0x1868d9['query'],_0x4af71e['filters']));_0x473b30[_0xb814('0x72')][_0xb814('0xb6')]=_0x32c956['id'];if(_0x1868d9['query'][_0xb814('0x7d')]){_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],{'$or':_[_0xb814('0x30')](_0x473b30[_0xb814('0x3d')],function(_0x20e608){var _0x7b9948={};_0x7b9948[_0x20e608]={'$like':'%'+_0x1868d9[_0xb814('0x3b')][_0xb814('0x7d')]+'%'};return _0x7b9948;})});}if(_0x1868d9[_0xb814('0x3b')]['$gte']){var _0x2a5dff=_0x1868d9['query'][_0xb814('0xb7')][_0xb814('0x32')](',');var _0x35e8f7={};_0x35e8f7[_0x2a5dff[0x0]]={'$gte':moment(_0x2a5dff[0x1])[_0xb814('0xb8')](_0xb814('0xb9'))};_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],_0x35e8f7);}_0x473b30=_['merge']({},_0x473b30,_0x1868d9['options']);return db['WhatsappMessage'][_0xb814('0x93')]({'where':_0x473b30[_0xb814('0x72')]})[_0xb814('0x2b')](function(_0x3b7bee){_0x2d40e6[_0xb814('0x93')]=_0x3b7bee;if(_0x1868d9[_0xb814('0x3b')][_0xb814('0xab')]){_0x473b30[_0xb814('0xba')]=[{'all':!![]}];}return db[_0xb814('0xb1')][_0xb814('0xbb')](_0x473b30);})['then'](function(_0x5c989a){_0x2d40e6[_0xb814('0xa7')]=_0x5c989a;return _0x2d40e6;});}})[_0xb814('0x2b')](respondWithFilteredResult(_0x570191,_0x473b30))[_0xb814('0x35')](handleError(_0x570191,null));};exports[_0xb814('0xbc')]=function(_0x3f0c9c,_0x2642ab,_0x48358c){return db[_0xb814('0xaa')]['find']({'where':{'id':_0x3f0c9c[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x2642ab,null))[_0xb814('0x2b')](function(_0x94aa05){if(_0x94aa05){return _0x94aa05[_0xb814('0xbd')](_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x3f0c9c[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{})[_0xb814('0xbe')](function(){return db[_0xb814('0x67')]['findAll']({'attributes':['id',_0xb814('0x2e'),_0xb814('0x46')],'where':{'id':_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')]}});})[_0xb814('0x2b')](function(_0x4a2aa5){socket[_0xb814('0xbf')](_0xb814('0xc0'),{'id':Number(_0x3f0c9c[_0xb814('0xa9')]['id']),'tags':_0x4a2aa5||[]});return{'id':Number(_0x3f0c9c['params']['id']),'tags':_0x4a2aa5||[]};});}})[_0xb814('0x2b')](respondWithResult(_0x2642ab,null))['catch'](handleError(_0x2642ab,null));};exports[_0xb814('0xc1')]=function(_0x5b4315,_0x22f6f1,_0x3467bd){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x5b4315['params']['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x22f6f1,null))[_0xb814('0x2b')](function(_0x3fda0d){if(_0x3fda0d){return _0x3fda0d[_0xb814('0xc1')](_0x5b4315[_0xb814('0x3b')][_0xb814('0xb2')]);}})[_0xb814('0x2b')](respondWithStatusCode(_0x22f6f1,null))[_0xb814('0x35')](handleError(_0x22f6f1,null));};exports[_0xb814('0xc2')]=function(_0x152260,_0x3bc03a){var _0x368696=moment()[_0xb814('0xc3')]()[_0xb814('0x92')]();var _0x8e882a=path['join'](config[_0xb814('0xc4')],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc7'));var _0x4017b6=path[_0xb814('0xc8')](config['root'],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc9'));var _0x31b4f5=path['join'](_0x8e882a,_0x368696);var _0x5b5a26=util[_0xb814('0xb8')](_0xb814('0xca'),_0x152260[_0xb814('0xa9')]['id'],_0x368696);var _0x667ca1=path[_0xb814('0xc8')](_0x8e882a,_0x5b5a26);var _0x2c510a=[];_0x2c510a['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xcb'),'attributes':['id',_0xb814('0xcc')],'raw':!![]});_0x2c510a[_0xb814('0x34')]({'model':db['CmContact'],'as':_0xb814('0xcd'),'attributes':['id',_0xb814('0xce'),_0xb814('0xcf')],'raw':!![]});if(_0x152260[_0xb814('0x3b')][_0xb814('0xc9')]){_0x2c510a['push']({'model':db[_0xb814('0xd0')],'as':_0xb814('0xd0'),'raw':!![]});}var _0x371dd7=[{'model':db[_0xb814('0xb1')],'as':_0xb814('0xd1'),'attributes':['id',_0xb814('0x6d'),_0xb814('0x75'),_0xb814('0xd2'),_0xb814('0xd3'),_0xb814('0xd4')],'include':_0x2c510a}];_0x371dd7[_0xb814('0x34')]({'model':db[_0xb814('0xd5')],'as':_0xb814('0xd6'),'attributes':['id','name']});_0x371dd7['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xd7'),'attributes':['id',_0xb814('0xcc')]});return db['WhatsappInteraction'][_0xb814('0x6b')]({'where':{'id':_0x152260[_0xb814('0xa9')]['id']},'include':_0x371dd7})[_0xb814('0x2b')](handleEntityNotFound(_0x3bc03a,null))['then'](function(_0x10537d){if(_0x10537d){var _0xa651a=_0x10537d[_0xb814('0xd8')]({'plain':!![]});fs[_0xb814('0xd9')](_0x31b4f5);var _0x6ec0f5={'format':'A4','border':_0xb814('0xda'),'header':{'height':'40px','contents':{'first':_0xb814('0xdb')}},'footer':{'height':'30px','contents':{'default':util[_0xb814('0xb8')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util[_0xb814('0xb8')](_0xb814('0xdc'),_0xb814('0xdd'),_0xa651a['id']),moment()['format'](_0xb814('0xde'))[_0xb814('0x92')]())}}};var _0x164304={'channel':'Whatsapp','account':_0xa651a[_0xb814('0xd6')]['name'],'agent':_0xa651a[_0xb814('0xd7')]?_0xa651a[_0xb814('0xd7')][_0xb814('0xcc')]:'N.A.','createdAt':moment(_0xa651a[_0xb814('0x75')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')](),'closedAt':_0xa651a['closed']?moment(_0xa651a[_0xb814('0xdf')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')]():'','disposition':_0xa651a[_0xb814('0xe0')],'messages':_(_0xa651a[_0xb814('0xd1')])[_0xb814('0x7d')]({'secret':![]})[_0xb814('0x30')](function(_0x9a33d0){if(_0x9a33d0['Attachment']){var _0x2fe47b=path[_0xb814('0xc8')](_0x4017b6,_0x9a33d0[_0xb814('0xd0')]['basename']);if(fs[_0xb814('0xe1')](_0x2fe47b)){fs['createReadStream'](_0x2fe47b)['pipe'](fs['createWriteStream'](path[_0xb814('0xc8')](_0x31b4f5,_0x9a33d0['Attachment'][_0xb814('0xe2')])));}}return{'date':moment(_0x9a33d0[_0xb814('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb814('0x92')](),'sender':_0x9a33d0['direction']===_0xb814('0xe3')?_0x9a33d0['User']?_0x9a33d0[_0xb814('0xcb')][_0xb814('0xcc')]:_0xb814('0xe4'):_0x9a33d0['Contact']['firstName']+(_0x9a33d0['Contact'][_0xb814('0xcf')]?'\x20'+_0x9a33d0['Contact']['lastName']:''),'body':_0x9a33d0[_0xb814('0xd0')]?_0x9a33d0['Attachment']['basename']:_0x9a33d0['body'],'direction':_0x9a33d0[_0xb814('0xd2')]===_0xb814('0xe3')?'A':'C','secret':_0x9a33d0[_0xb814('0xd3')],'read':_0x9a33d0['read'],'attachment':_0x9a33d0[_0xb814('0xd0')]};})[_0xb814('0x5c')]()};return ejs[_0xb814('0xe5')](path[_0xb814('0xc8')](config[_0xb814('0xc4')],_0xb814('0xc5'),'views',_0xb814('0xe6')),{'interaction':_0x164304})[_0xb814('0x2b')](function(_0x28b818){return new BPromise(function(_0x171845,_0x4f2db2){pdf[_0xb814('0xae')](_0x28b818,_0x6ec0f5)[_0xb814('0xe7')](path[_0xb814('0xc8')](_0x31b4f5,_0xb814('0xe8')+_0xa651a['id']+'-'+_0x368696+_0xb814('0xe9')),function(_0x2cb01d,_0x1f4540){if(_0x2cb01d)return _0x4f2db2(_0x2cb01d);_0x171845(_0x1f4540);});});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x81ebc0,_0x2e7959){zipdir(_0x31b4f5,{'saveTo':_0x667ca1},function(_0x47f054,_0x1aa70b){if(_0x47f054)return _0x2e7959(_0x47f054);return _0x81ebc0(_0x1aa70b);});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x5706ad,_0x3b8438){rimraf(_0x31b4f5,function(_0x56e231){if(_0x56e231)_0x3b8438(_0x56e231);return _0x5706ad();});});})[_0xb814('0x2b')](function(){return _0x3bc03a[_0xb814('0xc2')](_0x667ca1,_0x5b5a26,function(_0x5e2273){if(_0x5e2273){console[_0xb814('0xea')]('err',_0x5e2273);}else{fs[_0xb814('0xeb')](_0x667ca1);}});});});}else{return _0x3bc03a[_0xb814('0x20')](0xc8);}})[_0xb814('0x35')](handleError(_0x3bc03a,null));};
\ No newline at end of file
+var _0x814b=['index','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','toString','count','sequelize','fields','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','WhatsappInteraction','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','10px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','%s\x20#%d','Whatsapp','YYYY-MM-DD','closedAt','disposition','existsSync','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','TagIds','split','forEach','push','catch'];(function(_0xdcca9a,_0x3822d9){var _0x6052fe=function(_0x5227a1){while(--_0x5227a1){_0xdcca9a['push'](_0xdcca9a['shift']());}};_0x6052fe(++_0x3822d9);}(_0x814b,0x1a2));var _0xb814=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x814b[_0x115d5b];return _0x6cfc50;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}function getInteractionUsers(_0x52ed64,_0x9008b2){return new BPromise(function(_0x37d24d,_0x530744){try{if(_0x9008b2[_0x52ed64['id']]){_0x52ed64['Users']=_[_0xb814('0x30')](_0x9008b2[_0x52ed64['id']],function(_0x2051d0){return{'id':_0x2051d0['id'],'fullname':_0x2051d0['fullname']};});}}catch(_0x338a28){_0x530744(_0x338a28);}_0x37d24d(_0x52ed64);});}function getInteractionTags(_0x526610,_0x6efe9a){return new BPromise(function(_0x5f3e9b,_0x4cfc58){try{if(_0x526610[_0xb814('0x31')]){_0x526610['Tags']=[];_0x526610[_0xb814('0x31')][_0xb814('0x32')](',')[_0xb814('0x33')](function(_0x599f9f){_0x526610['Tags'][_0xb814('0x34')](_0x6efe9a[_0x599f9f]);});}delete _0x526610[_0xb814('0x31')];}catch(_0x523566){_0x4cfc58(_0x523566);}_0x5f3e9b(_0x526610);});}function updateWhatsappInteraction(_0x2c8943,_0xe558d5,_0x692c72){return new BPromise(function(_0x217b7e,_0x1b78de){return getInteractionUsers(_0x2c8943,_0x692c72)[_0xb814('0x2b')](function(_0x3672f3){return getInteractionTags(_0x3672f3,_0xe558d5);})['then'](function(_0x3207ec){_0x217b7e(_0x3207ec);})[_0xb814('0x35')](function(_0x30de5a){_0x1b78de(_0x30de5a);});});}exports[_0xb814('0x36')]=function(_0x14100d,_0x4ff31a){var _0x16ef82={},_0x57e6e6={},_0x43db67={'count':0x0,'rows':[]};var _0x16e21c=_[_0xb814('0x30')](db['WhatsappInteraction'][_0xb814('0x37')],function(_0xbdb3e9){return{'name':_0xbdb3e9['fieldName'],'type':_0xbdb3e9[_0xb814('0x38')][_0xb814('0x39')]};});_0x57e6e6[_0xb814('0x3a')]=_[_0xb814('0x30')](_0x16e21c,_0xb814('0x2e'));_0x57e6e6[_0xb814('0x3b')]=_['keys'](_0x14100d[_0xb814('0x3b')]);_0x57e6e6['filters']=_[_0xb814('0x3c')](_0x57e6e6['model'],_0x57e6e6[_0xb814('0x3b')]);_0x16ef82['attributes']=_[_0xb814('0x3c')](_0x57e6e6[_0xb814('0x3a')],qs['fields'](_0x14100d['query']['fields']));_0x16ef82['attributes']=_0x16ef82[_0xb814('0x3d')][_0xb814('0x3e')]?_0x16ef82[_0xb814('0x3d')]:_0x57e6e6[_0xb814('0x3a')];if(!_0x14100d['query']['hasOwnProperty'](_0xb814('0x3f'))){_0x16ef82['limit']=qs[_0xb814('0x40')](_0x14100d[_0xb814('0x3b')][_0xb814('0x40')]);_0x16ef82[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x14100d[_0xb814('0x3b')][_0xb814('0x24')]);}_0x16ef82[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x14100d['query']['sort']);_0x16ef82['where']=qs[_0xb814('0x43')](_['pick'](_0x14100d[_0xb814('0x3b')],_0x57e6e6['filters']),_0x16e21c);var _0x411723=[];var _0x44ff56=squel[_0xb814('0x44')]()[_0xb814('0x45')]('id')['field'](_0xb814('0x2e'))[_0xb814('0x45')](_0xb814('0x46'))[_0xb814('0x47')](_0xb814('0x48'));var _0x450a08=squel['select']()[_0xb814('0x45')](_0xb814('0x49'))[_0xb814('0x45')](_0xb814('0x4a'))[_0xb814('0x45')](_0xb814('0x4b'))[_0xb814('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb814('0x4c'),'u',_0xb814('0x4d'));var _0x4c08d6=squel[_0xb814('0x44')]()[_0xb814('0x47')](_0xb814('0x4e'),'i')[_0xb814('0x4f')](_0xb814('0x50'),'c',_0xb814('0x51'))[_0xb814('0x4f')](_0xb814('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xb814('0x4f')](_0xb814('0x52'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb814('0x4f')]('whatsapp_messages','me',_0xb814('0x53'))[_0xb814('0x4f')](_0xb814('0x54'),'it',_0xb814('0x55'))[_0xb814('0x4f')](_0xb814('0x48'),'t',_0xb814('0x56'));var _0x45480e=squel[_0xb814('0x57')]();var _0x2a422a=[];var _0x5e6df7=squel['expr']();var _0x32eca6;if(_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]){_0x32eca6=as[_0xb814('0x59')](_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]);var _0x135208=_0x32eca6['sqlOperator'];for(var _0x26fd0b=0x0;_0x26fd0b<_0x32eca6[_0xb814('0x5a')][_0xb814('0x3e')];_0x26fd0b++){var _0x5a916d=_0x32eca6[_0xb814('0x5a')][_0x26fd0b];var _0x4e6f3c='i';var _0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),_0x5a916d[_0xb814('0x45')]]);if(!_0x252293){switch(_0x5a916d['field']){case _0xb814('0x5b'):if(_0x5a916d[_0xb814('0x5c')]==0x1){_0x4c08d6[_0xb814('0x5d')]('`'+_0x5a916d['field']+_0xb814('0x5e'));}else{_0x4c08d6['having']('`'+_0x5a916d[_0xb814('0x45')]+_0xb814('0x5f'));}break;case'Contact':if(_0x5a916d[_0xb814('0x60')]==='$substring'){if(_0x5a916d['value'][_0xb814('0x32')]('\x20')[_0xb814('0x3e')]>0x1){_0x45480e[_0x135208](_0xb814('0x61'),qs['getFullTextValue'](_0x5a916d[_0xb814('0x5c')]),null);}else{var _0x538b0f='%'+_0x5a916d[_0xb814('0x5c')]+'%';_0x45480e[_0x135208](_0xb814('0x62'),_0x538b0f,_0x538b0f,_0x538b0f);}}else{_0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),'ContactId']);_0x5a916d[_0xb814('0x45')]=_0xb814('0x63');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x67'):var _0x5441c5=_0x5a916d['value'][_0xb814('0x32')](',')[_0xb814('0x30')](function(_0x4d13db){return Number(_0x4d13db);});_0x5441c5[_0xb814('0x33')](function(_0x58b9a6){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58b9a6+',%');});_0x2a422a=_[_0xb814('0x68')](_0x2a422a,_0x5441c5);break;case'User':if(_0x5a916d[_0xb814('0x60')]===_0xb814('0x69')){_0x45480e[_0x135208](_0xb814('0x6a'),'%'+_0x5a916d['value']+'%',null);}else{_0x252293=_[_0xb814('0x6b')](_0x16e21c,['name',_0xb814('0x6c')]);_0x5a916d[_0xb814('0x45')]=_0xb814('0x6c');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x6d'):_0x135e13=as[_0xb814('0x64')]('me',null,_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);break;}}else{var _0x135e13=as['buildExpression'](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')]['start'],_0x135e13[_0xb814('0x5c')]['end']);}}}else{var _0x37e9c5=_(_0x14100d['query'])[_0xb814('0x6e')]()[_0xb814('0x30')](function(_0xa03cd2){return _[_0xb814('0x6f')](_0x16e21c,[_0xb814('0x2e'),_0xa03cd2])?_0xa03cd2:undefined;})[_0xb814('0x70')]()[_0xb814('0x5c')]();if(!_['isEmpty'](_0x37e9c5)){_0x37e9c5[_0xb814('0x33')](function(_0x51ca51){if(_0x51ca51===_0xb814('0x71')){_0x4c08d6[_0xb814('0x72')](_0xb814('0x73'),[][_0xb814('0x74')](_0x14100d[_0xb814('0x3b')][_0x51ca51]));}else if(_0x51ca51===_0xb814('0x75')){var _0x514dab=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])['$gte'];var _0x3bb2b4=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])[_0xb814('0x77')];_0x4c08d6[_0xb814('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514dab,_0x3bb2b4);}else{if(_0x14100d[_0xb814('0x3b')][_0x51ca51]==='null'){_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x78'));}else{_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x79'),_0x14100d[_0xb814('0x3b')][_0x51ca51]);}}});}if(_0x14100d[_0xb814('0x3b')]['read']){if(_0x14100d['query']['read']==0x1){_0x4c08d6[_0xb814('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4c08d6[_0xb814('0x5d')](_0xb814('0x7a'));}}if(_0x14100d[_0xb814('0x3b')]['tag']){_0x2a422a=_[_0xb814('0x7b')](_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')])?_0x14100d['query'][_0xb814('0x7c')]:new Array(_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')]);_0x2a422a[_0xb814('0x33')](function(_0x555be0){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x555be0+',%');});}if(_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')]){var _0x39863d=_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')][_0xb814('0x7e')]('\x5c','\x5c\x5c')[_0xb814('0x7e')]('\x27\x27',_0xb814('0x7f'));if(qs[_0xb814('0x80')](_0x39863d)){_0x45480e['or'](_0xb814('0x81'),_0x39863d+'%')['or'](_0xb814('0x82'),_0x39863d+'%');}else{_0x45480e['or'](_0xb814('0x83'),qs[_0xb814('0x84')](_0x39863d))['or'](_0xb814('0x85'),_0x39863d+'%');}}}_0x4c08d6[_0xb814('0x72')](_0x45480e);_0x4c08d6['group'](_0xb814('0x86'));var _0x33cfc4={'type':db[_0xb814('0x87')][_0xb814('0x88')][_0xb814('0x89')],'raw':!![]};var _0x283b0f=_0x4c08d6['clone']();_0x283b0f[_0xb814('0x45')]('i.id');_0x283b0f[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));if(_0x16ef82[_0xb814('0x41')]){_0x16ef82[_0xb814('0x41')]['forEach'](function(_0x4c44ee){_0x4c08d6[_0xb814('0x41')]('i.'+_0x4c44ee[0x0],_0x4c44ee[0x1]===_0xb814('0x8b')?![]:!![]);});}if(!_[_0xb814('0x8c')](_0x2a422a)){_0x4c08d6[_0xb814('0x5d')](_0x5e6df7);_0x283b0f['where'](_0xb814('0x8d'),_0x2a422a);}BPromise['resolve']()[_0xb814('0x2b')](function(){if(!_0x32eca6){if(_0x14100d[_0xb814('0x3b')]['WhatsappAccountId']||_0x14100d['query'][_0xb814('0x8e')])return;_0x283b0f['where'](_0xb814('0x8f'));_0x4c08d6[_0xb814('0x72')](_0xb814('0x8f'));return;}return _0x14100d[_0xb814('0x90')][_0xb814('0x91')]({'attributes':['id'],'raw':!![]})[_0xb814('0x2b')](function(_0x40fe4a){if(_['isEmpty'](_0x40fe4a)){_0x283b0f[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x283b0f[_0xb814('0x72')](_0xb814('0x73'),_['map'](_0x40fe4a,'id'));_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb814('0x30')](_0x40fe4a,'id'));}});})[_0xb814('0x2b')](function(){db['sequelize']['query'](_0x283b0f[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x3309c5){_0x43db67[_0xb814('0x93')]=_0x3309c5[_0xb814('0x3e')];if(_0x43db67[_0xb814('0x93')]===0x0)return[];return db[_0xb814('0x94')][_0xb814('0x3b')](_0x44ff56[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x53e705){_0x411723=_['keyBy'](_0x53e705,'id');_0x33cfc4=_['merge'](_0x33cfc4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14100d['query'][_0xb814('0x95')]){_0x16ef82[_0xb814('0x3d')][_0xb814('0x33')](function(_0x59f3ff){_0x4c08d6[_0xb814('0x45')]('i.'+_0x59f3ff);});}else{_0x4c08d6[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x96'),_0xb814('0x97'));_0x4c08d6[_0xb814('0x45')]('a.mandatoryDisposition',_0xb814('0x98'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x99'));_0x4c08d6[_0xb814('0x45')]('c.firstName',_0xb814('0x9a'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x9b'),_0xb814('0x9c'));_0x4c08d6[_0xb814('0x45')]('c.email','Contact.email');_0x4c08d6[_0xb814('0x45')]('c.phone',_0xb814('0x9d'));_0x4c08d6[_0xb814('0x45')]('c.mobile',_0xb814('0x9e'));_0x4c08d6['field'](_0xb814('0x9f'),'Contact.fax');_0x4c08d6[_0xb814('0x45')](_0xb814('0xa0'),_0xb814('0xa1'));_0x4c08d6[_0xb814('0x45')](_0xb814('0xa2'),_0xb814('0xa3'));_0x4c08d6[_0xb814('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16ef82[_0xb814('0x40')])_0x4c08d6['limit'](_0x16ef82['limit']);if(_0x16ef82[_0xb814('0x24')])_0x4c08d6[_0xb814('0x24')](_0x16ef82[_0xb814('0x24')]);return db['sequelize'][_0xb814('0x3b')](_0x4c08d6['toString'](),_0x33cfc4);})[_0xb814('0x2b')](function(_0x19d508){_0x450a08[_0xb814('0x72')](_0xb814('0xa4'),_['map'](_0x19d508,'id'));return db[_0xb814('0x94')][_0xb814('0x3b')](_0x450a08[_0xb814('0x92')](),_0x33cfc4)['then'](function(_0x1ebbf6){var _0x3fc77d=_[_0xb814('0xa5')](_0x1ebbf6,'WhatsappInteractionId');var _0x5d8626=[];_0x19d508[_0xb814('0x33')](function(_0x9dc06b){_0x5d8626[_0xb814('0x34')](updateWhatsappInteraction(_0x9dc06b,_0x411723,_0x3fc77d));});return BPromise[_0xb814('0xa6')](_0x5d8626);});});})[_0xb814('0x2b')](function(_0x37a7ab){_0x43db67[_0xb814('0xa7')]=_0x37a7ab;return _0x43db67;})[_0xb814('0x2b')](respondWithFilteredResult(_0x4ff31a,_0x16ef82));})[_0xb814('0x35')](handleError(_0x4ff31a,null));};exports[_0xb814('0xa8')]=function(_0x2569a5,_0x2a13fb){var _0x5b8d2e={'raw':![],'where':{'id':_0x2569a5[_0xb814('0xa9')]['id']}},_0x5416dc={};_0x5416dc['model']=_[_0xb814('0x6e')](db[_0xb814('0xaa')][_0xb814('0x37')]);_0x5416dc[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x2569a5[_0xb814('0x3b')]);_0x5416dc[_0xb814('0x43')]=_['intersection'](_0x5416dc['model'],_0x5416dc[_0xb814('0x3b')]);_0x5b8d2e['attributes']=_[_0xb814('0x3c')](_0x5416dc[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x2569a5['query'][_0xb814('0x95')]));_0x5b8d2e[_0xb814('0x3d')]=_0x5b8d2e[_0xb814('0x3d')][_0xb814('0x3e')]?_0x5b8d2e[_0xb814('0x3d')]:_0x5416dc['model'];if(_0x2569a5[_0xb814('0x3b')][_0xb814('0xab')]){_0x5b8d2e['include']=[{'all':!![]}];}_0x5b8d2e=_[_0xb814('0xac')]({},_0x5b8d2e,_0x2569a5[_0xb814('0xad')]);return db[_0xb814('0xaa')]['find'](_0x5b8d2e)[_0xb814('0x2b')](handleEntityNotFound(_0x2a13fb,null))[_0xb814('0x2b')](respondWithResult(_0x2a13fb,null))['catch'](handleError(_0x2a13fb,null));};exports[_0xb814('0xae')]=function(_0x171f83,_0x5b5634){return db[_0xb814('0xaa')][_0xb814('0xae')](_0x171f83[_0xb814('0x6d')],{})[_0xb814('0x2b')](respondWithResult(_0x5b5634,0xc9))[_0xb814('0x35')](handleError(_0x5b5634,null));};exports[_0xb814('0x29')]=function(_0x40ae0b,_0x336a8f){if(_0x40ae0b[_0xb814('0x6d')]['id']){delete _0x40ae0b[_0xb814('0x6d')]['id'];}return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x40ae0b['params']['id']}})['then'](handleEntityNotFound(_0x336a8f,null))[_0xb814('0x2b')](saveUpdates(_0x40ae0b['body'],null))['then'](respondWithResult(_0x336a8f,null))[_0xb814('0x35')](handleError(_0x336a8f,null));};exports['destroy']=function(_0x4f0427,_0x50cb34){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x4f0427[_0xb814('0xa9')]['id']}})['then'](handleEntityNotFound(_0x50cb34,null))[_0xb814('0x2b')](removeEntity(_0x50cb34,null))['catch'](handleError(_0x50cb34,null));};exports[_0xb814('0xaf')]=function(_0x2e6660,_0x49a8de){return db[_0xb814('0xaa')]['describe']()[_0xb814('0x2b')](respondWithResult(_0x49a8de,null))[_0xb814('0x35')](handleError(_0x49a8de,null));};exports[_0xb814('0xb0')]=function(_0x39ce17,_0x11efb8,_0xaf705d){return db[_0xb814('0xb1')][_0xb814('0x6b')]({'where':{'id':_0x39ce17[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x11efb8,null))[_0xb814('0x2b')](function(_0x3e7a9a){if(_0x3e7a9a){return _0x3e7a9a[_0xb814('0xb0')](_0x39ce17[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x39ce17[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x11efb8,null))[_0xb814('0x35')](handleError(_0x11efb8,null));};exports[_0xb814('0xb3')]=function(_0x1868d9,_0x570191,_0x56b2aa){var _0x473b30={'raw':![],'where':{}};var _0x4af71e={};var _0x2d40e6={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb814('0xb4')]({'where':{'id':_0x1868d9['params']['id']}})['then'](handleEntityNotFound(_0x570191,null))[_0xb814('0x2b')](function(_0x32c956){if(_0x32c956){_0x4af71e[_0xb814('0x3a')]=_[_0xb814('0x6e')](db[_0xb814('0xb1')][_0xb814('0x37')]);_0x4af71e[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x1868d9[_0xb814('0x3b')]);_0x4af71e[_0xb814('0x43')]=_[_0xb814('0x3c')](_0x4af71e['model'],_0x4af71e[_0xb814('0x3b')]);_0x473b30['attributes']=_[_0xb814('0x3c')](_0x4af71e[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x1868d9['query'][_0xb814('0x95')]));_0x473b30[_0xb814('0x3d')]=_0x473b30[_0xb814('0x3d')][_0xb814('0x3e')]?_0x473b30[_0xb814('0x3d')]:_0x4af71e[_0xb814('0x3a')];if(!_0x1868d9[_0xb814('0x3b')][_0xb814('0xb5')](_0xb814('0x3f'))){_0x473b30[_0xb814('0x40')]=qs[_0xb814('0x40')](_0x1868d9[_0xb814('0x3b')][_0xb814('0x40')]);_0x473b30[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x1868d9['query'][_0xb814('0x24')]);}_0x473b30[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x1868d9['query']['sort']);_0x473b30[_0xb814('0x72')]=qs['filters'](_['pick'](_0x1868d9['query'],_0x4af71e['filters']));_0x473b30[_0xb814('0x72')][_0xb814('0xb6')]=_0x32c956['id'];if(_0x1868d9['query'][_0xb814('0x7d')]){_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],{'$or':_[_0xb814('0x30')](_0x473b30[_0xb814('0x3d')],function(_0x20e608){var _0x7b9948={};_0x7b9948[_0x20e608]={'$like':'%'+_0x1868d9[_0xb814('0x3b')][_0xb814('0x7d')]+'%'};return _0x7b9948;})});}if(_0x1868d9[_0xb814('0x3b')]['$gte']){var _0x2a5dff=_0x1868d9['query'][_0xb814('0xb7')][_0xb814('0x32')](',');var _0x35e8f7={};_0x35e8f7[_0x2a5dff[0x0]]={'$gte':moment(_0x2a5dff[0x1])[_0xb814('0xb8')](_0xb814('0xb9'))};_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],_0x35e8f7);}_0x473b30=_['merge']({},_0x473b30,_0x1868d9['options']);return db['WhatsappMessage'][_0xb814('0x93')]({'where':_0x473b30[_0xb814('0x72')]})[_0xb814('0x2b')](function(_0x3b7bee){_0x2d40e6[_0xb814('0x93')]=_0x3b7bee;if(_0x1868d9[_0xb814('0x3b')][_0xb814('0xab')]){_0x473b30[_0xb814('0xba')]=[{'all':!![]}];}return db[_0xb814('0xb1')][_0xb814('0xbb')](_0x473b30);})['then'](function(_0x5c989a){_0x2d40e6[_0xb814('0xa7')]=_0x5c989a;return _0x2d40e6;});}})[_0xb814('0x2b')](respondWithFilteredResult(_0x570191,_0x473b30))[_0xb814('0x35')](handleError(_0x570191,null));};exports[_0xb814('0xbc')]=function(_0x3f0c9c,_0x2642ab,_0x48358c){return db[_0xb814('0xaa')]['find']({'where':{'id':_0x3f0c9c[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x2642ab,null))[_0xb814('0x2b')](function(_0x94aa05){if(_0x94aa05){return _0x94aa05[_0xb814('0xbd')](_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x3f0c9c[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{})[_0xb814('0xbe')](function(){return db[_0xb814('0x67')]['findAll']({'attributes':['id',_0xb814('0x2e'),_0xb814('0x46')],'where':{'id':_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')]}});})[_0xb814('0x2b')](function(_0x4a2aa5){socket[_0xb814('0xbf')](_0xb814('0xc0'),{'id':Number(_0x3f0c9c[_0xb814('0xa9')]['id']),'tags':_0x4a2aa5||[]});return{'id':Number(_0x3f0c9c['params']['id']),'tags':_0x4a2aa5||[]};});}})[_0xb814('0x2b')](respondWithResult(_0x2642ab,null))['catch'](handleError(_0x2642ab,null));};exports[_0xb814('0xc1')]=function(_0x5b4315,_0x22f6f1,_0x3467bd){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x5b4315['params']['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x22f6f1,null))[_0xb814('0x2b')](function(_0x3fda0d){if(_0x3fda0d){return _0x3fda0d[_0xb814('0xc1')](_0x5b4315[_0xb814('0x3b')][_0xb814('0xb2')]);}})[_0xb814('0x2b')](respondWithStatusCode(_0x22f6f1,null))[_0xb814('0x35')](handleError(_0x22f6f1,null));};exports[_0xb814('0xc2')]=function(_0x152260,_0x3bc03a){var _0x368696=moment()[_0xb814('0xc3')]()[_0xb814('0x92')]();var _0x8e882a=path['join'](config[_0xb814('0xc4')],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc7'));var _0x4017b6=path[_0xb814('0xc8')](config['root'],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc9'));var _0x31b4f5=path['join'](_0x8e882a,_0x368696);var _0x5b5a26=util[_0xb814('0xb8')](_0xb814('0xca'),_0x152260[_0xb814('0xa9')]['id'],_0x368696);var _0x667ca1=path[_0xb814('0xc8')](_0x8e882a,_0x5b5a26);var _0x2c510a=[];_0x2c510a['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xcb'),'attributes':['id',_0xb814('0xcc')],'raw':!![]});_0x2c510a[_0xb814('0x34')]({'model':db['CmContact'],'as':_0xb814('0xcd'),'attributes':['id',_0xb814('0xce'),_0xb814('0xcf')],'raw':!![]});if(_0x152260[_0xb814('0x3b')][_0xb814('0xc9')]){_0x2c510a['push']({'model':db[_0xb814('0xd0')],'as':_0xb814('0xd0'),'raw':!![]});}var _0x371dd7=[{'model':db[_0xb814('0xb1')],'as':_0xb814('0xd1'),'attributes':['id',_0xb814('0x6d'),_0xb814('0x75'),_0xb814('0xd2'),_0xb814('0xd3'),_0xb814('0xd4')],'include':_0x2c510a}];_0x371dd7[_0xb814('0x34')]({'model':db[_0xb814('0xd5')],'as':_0xb814('0xd6'),'attributes':['id','name']});_0x371dd7['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xd7'),'attributes':['id',_0xb814('0xcc')]});return db['WhatsappInteraction'][_0xb814('0x6b')]({'where':{'id':_0x152260[_0xb814('0xa9')]['id']},'include':_0x371dd7})[_0xb814('0x2b')](handleEntityNotFound(_0x3bc03a,null))['then'](function(_0x10537d){if(_0x10537d){var _0xa651a=_0x10537d[_0xb814('0xd8')]({'plain':!![]});fs[_0xb814('0xd9')](_0x31b4f5);var _0x6ec0f5={'format':'A4','border':_0xb814('0xda'),'header':{'height':'40px','contents':{'first':_0xb814('0xdb')}},'footer':{'height':'30px','contents':{'default':util[_0xb814('0xb8')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util[_0xb814('0xb8')](_0xb814('0xdc'),_0xb814('0xdd'),_0xa651a['id']),moment()['format'](_0xb814('0xde'))[_0xb814('0x92')]())}}};var _0x164304={'channel':'Whatsapp','account':_0xa651a[_0xb814('0xd6')]['name'],'agent':_0xa651a[_0xb814('0xd7')]?_0xa651a[_0xb814('0xd7')][_0xb814('0xcc')]:'N.A.','createdAt':moment(_0xa651a[_0xb814('0x75')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')](),'closedAt':_0xa651a['closed']?moment(_0xa651a[_0xb814('0xdf')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')]():'','disposition':_0xa651a[_0xb814('0xe0')],'messages':_(_0xa651a[_0xb814('0xd1')])[_0xb814('0x7d')]({'secret':![]})[_0xb814('0x30')](function(_0x9a33d0){if(_0x9a33d0['Attachment']){var _0x2fe47b=path[_0xb814('0xc8')](_0x4017b6,_0x9a33d0[_0xb814('0xd0')]['basename']);if(fs[_0xb814('0xe1')](_0x2fe47b)){fs['createReadStream'](_0x2fe47b)['pipe'](fs['createWriteStream'](path[_0xb814('0xc8')](_0x31b4f5,_0x9a33d0['Attachment'][_0xb814('0xe2')])));}}return{'date':moment(_0x9a33d0[_0xb814('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb814('0x92')](),'sender':_0x9a33d0['direction']===_0xb814('0xe3')?_0x9a33d0['User']?_0x9a33d0[_0xb814('0xcb')][_0xb814('0xcc')]:_0xb814('0xe4'):_0x9a33d0['Contact']['firstName']+(_0x9a33d0['Contact'][_0xb814('0xcf')]?'\x20'+_0x9a33d0['Contact']['lastName']:''),'body':_0x9a33d0[_0xb814('0xd0')]?_0x9a33d0['Attachment']['basename']:_0x9a33d0['body'],'direction':_0x9a33d0[_0xb814('0xd2')]===_0xb814('0xe3')?'A':'C','secret':_0x9a33d0[_0xb814('0xd3')],'read':_0x9a33d0['read'],'attachment':_0x9a33d0[_0xb814('0xd0')]};})[_0xb814('0x5c')]()};return ejs[_0xb814('0xe5')](path[_0xb814('0xc8')](config[_0xb814('0xc4')],_0xb814('0xc5'),'views',_0xb814('0xe6')),{'interaction':_0x164304})[_0xb814('0x2b')](function(_0x28b818){return new BPromise(function(_0x171845,_0x4f2db2){pdf[_0xb814('0xae')](_0x28b818,_0x6ec0f5)[_0xb814('0xe7')](path[_0xb814('0xc8')](_0x31b4f5,_0xb814('0xe8')+_0xa651a['id']+'-'+_0x368696+_0xb814('0xe9')),function(_0x2cb01d,_0x1f4540){if(_0x2cb01d)return _0x4f2db2(_0x2cb01d);_0x171845(_0x1f4540);});});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x81ebc0,_0x2e7959){zipdir(_0x31b4f5,{'saveTo':_0x667ca1},function(_0x47f054,_0x1aa70b){if(_0x47f054)return _0x2e7959(_0x47f054);return _0x81ebc0(_0x1aa70b);});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x5706ad,_0x3b8438){rimraf(_0x31b4f5,function(_0x56e231){if(_0x56e231)_0x3b8438(_0x56e231);return _0x5706ad();});});})[_0xb814('0x2b')](function(){return _0x3bc03a[_0xb814('0xc2')](_0x667ca1,_0x5b5a26,function(_0x5e2273){if(_0x5e2273){console[_0xb814('0xea')]('err',_0x5e2273);}else{fs[_0xb814('0xeb')](_0x667ca1);}});});});}else{return _0x3bc03a[_0xb814('0x20')](0xc8);}})[_0xb814('0x35')](handleError(_0x3bc03a,null));};
\ No newline at end of file
index fb6a154..9d10116 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aec=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x59f2c5,_0x646a1a){var _0x59a895=function(_0x22021a){while(--_0x22021a){_0x59f2c5['push'](_0x59f2c5['shift']());}};_0x59a895(++_0x646a1a);}(_0x8aec,0x152));var _0xc8ae=function(_0x1b5dfa,_0x3a59d8){_0x1b5dfa=_0x1b5dfa-0x0;var _0x33927a=_0x8aec[_0x1b5dfa];return _0x33927a;};'use strict';var EventEmitter=require(_0xc8ae('0x0'));var WhatsappInteraction=require(_0xc8ae('0x1'))['db'][_0xc8ae('0x2')];var WhatsappMessage=require(_0xc8ae('0x1'))['db'][_0xc8ae('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc8ae('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc8ae('0x5'),'afterDestroy':_0xc8ae('0x6')};function emitEvent(_0x5bb807){return function(_0x1a5e06,_0x478d89,_0x3db611){_0x1a5e06[_0xc8ae('0x7')]({'attributes':['id'],'raw':!![]})[_0xc8ae('0x8')](function(_0x302639){_0x1a5e06[_0xc8ae('0x9')](_0xc8ae('0xa'),_0x302639[_0xc8ae('0xb')](function(_0x234720){return{'id':_0x234720['id']};}));return WhatsappMessage[_0xc8ae('0xc')]({'where':{'WhatsappInteractionId':_0x1a5e06['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc8ae('0x8')](function(_0x1a4f92){_0x1a5e06[_0xc8ae('0x9')](_0xc8ae('0xd'),_0x1a4f92[_0xc8ae('0xe')]);WhatsappInteractionEvents['emit'](_0x5bb807+':'+_0x1a5e06['id'],_0x1a5e06);WhatsappInteractionEvents[_0xc8ae('0xf')](_0x5bb807,_0x1a5e06);_0x3db611(null);})[_0xc8ae('0x10')](_0x3db611(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xc8ae('0x11')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x4d95=['remove','then','Users','map','findAll','unreadMessages','emit','catch','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update'];(function(_0x11d97e,_0x5ada4e){var _0x5f4146=function(_0x1f0282){while(--_0x1f0282){_0x11d97e['push'](_0x11d97e['shift']());}};_0x5f4146(++_0x5ada4e);}(_0x4d95,0x1c9));var _0x54d9=function(_0x25d0c9,_0x593a72){_0x25d0c9=_0x25d0c9-0x0;var _0x30bc7c=_0x4d95[_0x25d0c9];return _0x30bc7c;};'use strict';var EventEmitter=require(_0x54d9('0x0'));var WhatsappInteraction=require(_0x54d9('0x1'))['db'][_0x54d9('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x54d9('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x54d9('0x4')](0x0);var events={'afterCreate':_0x54d9('0x5'),'afterUpdate':_0x54d9('0x6'),'afterDestroy':_0x54d9('0x7')};function emitEvent(_0x240e74){return function(_0x3844b3,_0x402083,_0x407460){_0x3844b3['getUsers']({'attributes':['id'],'raw':!![]})[_0x54d9('0x8')](function(_0x3e690f){_0x3844b3['setDataValue'](_0x54d9('0x9'),_0x3e690f[_0x54d9('0xa')](function(_0x53c342){return{'id':_0x53c342['id']};}));return WhatsappMessage[_0x54d9('0xb')]({'where':{'WhatsappInteractionId':_0x3844b3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x54d9('0x8')](function(_0x51a270){_0x3844b3['setDataValue'](_0x54d9('0xc'),_0x51a270['length']);WhatsappInteractionEvents['emit'](_0x240e74+':'+_0x3844b3['id'],_0x3844b3);WhatsappInteractionEvents[_0x54d9('0xd')](_0x240e74,_0x3844b3);_0x407460(null);})[_0x54d9('0xe')](_0x407460(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x54d9('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
index a7391c8..7a72fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ee=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x216278,_0x55d380){var _0x7973d4=function(_0x103539){while(--_0x103539){_0x216278['push'](_0x216278['shift']());}};_0x7973d4(++_0x55d380);}(_0x24ee,0x1bf));var _0xe24e=function(_0x5e28c2,_0x1e48ab){_0x5e28c2=_0x5e28c2-0x0;var _0x1a8cc6=_0x24ee[_0x5e28c2];return _0x1a8cc6;};'use strict';var _=require('lodash');var util=require(_0xe24e('0x0'));var logger=require(_0xe24e('0x1'))(_0xe24e('0x2'));var moment=require(_0xe24e('0x3'));var BPromise=require(_0xe24e('0x4'));var rp=require(_0xe24e('0x5'));var fs=require('fs');var path=require(_0xe24e('0x6'));var rimraf=require(_0xe24e('0x7'));var config=require(_0xe24e('0x8'));var attributes=require(_0xe24e('0x9'));module[_0xe24e('0xa')]=function(_0x5c01ae,_0x564ba4){return _0x5c01ae[_0xe24e('0xb')](_0xe24e('0xc'),attributes,{'tableName':_0xe24e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xfa925a,_0x260658,_0xb1ae43){if(_0xfa925a[_0xe24e('0xe')](_0xe24e('0xf'))){_0xfa925a[_0xe24e('0x10')]=moment()[_0xe24e('0x11')](_0xe24e('0x12'));}_0xb1ae43(null,_0xfa925a);}}});};
\ No newline at end of file
+var _0x21b7=['./whatsappInteraction.attributes','exports','whatsapp_interactions','changed','closed','closedAt','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2ec47f,_0x2d2d20){var _0xc0e5b5=function(_0x2462df){while(--_0x2462df){_0x2ec47f['push'](_0x2ec47f['shift']());}};_0xc0e5b5(++_0x2d2d20);}(_0x21b7,0x13a));var _0x721b=function(_0x3495a4,_0x5c962d){_0x3495a4=_0x3495a4-0x0;var _0x283ff9=_0x21b7[_0x3495a4];return _0x283ff9;};'use strict';var _=require('lodash');var util=require(_0x721b('0x0'));var logger=require(_0x721b('0x1'))(_0x721b('0x2'));var moment=require(_0x721b('0x3'));var BPromise=require(_0x721b('0x4'));var rp=require(_0x721b('0x5'));var fs=require('fs');var path=require(_0x721b('0x6'));var rimraf=require(_0x721b('0x7'));var config=require('../../config/environment');var attributes=require(_0x721b('0x8'));module[_0x721b('0x9')]=function(_0x4cd026,_0x16c664){return _0x4cd026['define']('WhatsappInteraction',attributes,{'tableName':_0x721b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x72b489,_0x44b097,_0x587b51){if(_0x72b489[_0x721b('0xb')](_0x721b('0xc'))){_0x72b489[_0x721b('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x587b51(null,_0x72b489);}}});};
\ No newline at end of file
index 6eefbaa..67c9e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5598=['WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','defaults','redis','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x5598,0x8f));var _0x8559=function(_0x17cdcc,_0x29d5de){_0x17cdcc=_0x17cdcc-0x0;var _0x38f5f6=_0x5598[_0x17cdcc];return _0x38f5f6;};'use strict';var _=require(_0x8559('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8559('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8559('0x2'));var db=require(_0x8559('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8559('0x4'))(_0x8559('0x5'));var config=require(_0x8559('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8559('0x7')]['http']({'port':0x232a});config['redis']=_[_0x8559('0x8')](config[_0x8559('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8559('0x9')]));require('./whatsappInteraction.socket')[_0x8559('0xa')](socket);function respondWithRpcPromise(_0x418dcb,_0x49ff9f,_0x3852d3){return new BPromise(function(_0x58d0c7,_0x12dad9){return client[_0x8559('0xb')](_0x418dcb,_0x3852d3)[_0x8559('0xc')](function(_0x207a14){logger[_0x8559('0xd')](_0x8559('0xe'),_0x49ff9f,_0x8559('0xf'));logger[_0x8559('0x10')](_0x8559('0x11'),_0x49ff9f,'request\x20sent',JSON[_0x8559('0x12')](_0x207a14));if(_0x207a14[_0x8559('0x13')]){if(_0x207a14[_0x8559('0x13')][_0x8559('0x14')]===0x1f4){logger['error'](_0x8559('0xe'),_0x49ff9f,_0x207a14[_0x8559('0x13')]['message']);return _0x12dad9(_0x207a14[_0x8559('0x13')][_0x8559('0x15')]);}logger[_0x8559('0x13')](_0x8559('0xe'),_0x49ff9f,_0x207a14[_0x8559('0x13')][_0x8559('0x15')]);return _0x58d0c7(_0x207a14[_0x8559('0x13')]['message']);}else{logger['info'](_0x8559('0xe'),_0x49ff9f,_0x8559('0xf'));_0x58d0c7(_0x207a14[_0x8559('0x16')][_0x8559('0x15')]);}})[_0x8559('0x17')](function(_0x34bc7a){logger[_0x8559('0x13')](_0x8559('0xe'),_0x49ff9f,_0x34bc7a);_0x12dad9(_0x34bc7a);});});}exports[_0x8559('0x18')]=function(_0xab72c8){var _0x39923f=this;return new Promise(function(_0x2fa79c,_0x117843){return db[_0x8559('0x19')][_0x8559('0x1a')](_0xab72c8['body'],{'raw':_0xab72c8[_0x8559('0x1b')]?_0xab72c8['options'][_0x8559('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab72c8['options']?_0xab72c8['options'][_0x8559('0x1d')]||null:null,'attributes':_0xab72c8['options']?_0xab72c8['options'][_0x8559('0x1e')]||null:null,'limit':_0xab72c8['options']?_0xab72c8[_0x8559('0x1b')][_0x8559('0x1f')]||null:null})[_0x8559('0xc')](function(_0xe01e2f){logger['info'](_0x8559('0x18'),_0xab72c8);logger[_0x8559('0x10')](_0x8559('0x18'),_0xab72c8,JSON[_0x8559('0x12')](_0xe01e2f));_0x2fa79c(_0xe01e2f);})[_0x8559('0x17')](function(_0x3f17bc){logger['error'](_0x8559('0x18'),_0x3f17bc['message'],_0xab72c8);_0x117843(_0x39923f[_0x8559('0x13')](0x1f4,_0x3f17bc['message']));});});};exports[_0x8559('0x20')]=function(_0x38782e){return new Promise(function(_0x59f734,_0x49ffd0){return db[_0x8559('0x19')][_0x8559('0x21')]({'where':_0x38782e[_0x8559('0x1b')]?_0x38782e[_0x8559('0x1b')][_0x8559('0x1d')]||null:null})[_0x8559('0xc')](function(_0x83df26){if(_0x83df26){return _0x83df26[_0x8559('0x22')](_0x38782e[_0x8559('0x23')][_0x8559('0x24')],_[_0x8559('0x25')](_0x38782e[_0x8559('0x23')],[_0x8559('0x24'),'id'])||{});}})[_0x8559('0x26')](function(_0x42e5bc){logger['info'](_0x8559('0x27'),_0x38782e);logger['debug'](_0x8559('0x27'),_0x38782e,JSON[_0x8559('0x12')](_0x42e5bc));_0x59f734(_0x42e5bc);})['catch'](function(_0xf569d5){logger['error']('AddTags',_0xf569d5['message'],_0x38782e);_0x49ffd0(_this[_0x8559('0x13')](0x1f4,_0xf569d5[_0x8559('0x15')]));});});};
\ No newline at end of file
+var _0x4f30=['catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x4f30,0x113));var _0x04f3=function(_0x38dc4a,_0x4a115d){_0x38dc4a=_0x38dc4a-0x0;var _0x433b9a=_0x4f30[_0x38dc4a];return _0x433b9a;};'use strict';var _=require(_0x04f3('0x0'));var util=require(_0x04f3('0x1'));var moment=require(_0x04f3('0x2'));var BPromise=require(_0x04f3('0x3'));var rs=require(_0x04f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04f3('0x5'))['db'];var utils=require(_0x04f3('0x6'));var logger=require(_0x04f3('0x7'))(_0x04f3('0x8'));var config=require(_0x04f3('0x9'));var jayson=require(_0x04f3('0xa'));var client=jayson[_0x04f3('0xb')][_0x04f3('0xc')]({'port':0x232a});config[_0x04f3('0xd')]=_[_0x04f3('0xe')](config[_0x04f3('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x04f3('0xf'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x04f3('0x10')](socket);function respondWithRpcPromise(_0x580886,_0x16a30b,_0x2c6f78){return new BPromise(function(_0xd4657c,_0x5c3b41){return client[_0x04f3('0x11')](_0x580886,_0x2c6f78)[_0x04f3('0x12')](function(_0x2c55fd){logger[_0x04f3('0x13')](_0x04f3('0x14'),_0x16a30b,'request\x20sent');logger[_0x04f3('0x15')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x16a30b,_0x04f3('0x16'),JSON['stringify'](_0x2c55fd));if(_0x2c55fd[_0x04f3('0x17')]){if(_0x2c55fd[_0x04f3('0x17')][_0x04f3('0x18')]===0x1f4){logger[_0x04f3('0x17')](_0x04f3('0x14'),_0x16a30b,_0x2c55fd['error']['message']);return _0x5c3b41(_0x2c55fd['error'][_0x04f3('0x19')]);}logger[_0x04f3('0x17')](_0x04f3('0x14'),_0x16a30b,_0x2c55fd[_0x04f3('0x17')][_0x04f3('0x19')]);return _0xd4657c(_0x2c55fd['error'][_0x04f3('0x19')]);}else{logger[_0x04f3('0x13')](_0x04f3('0x14'),_0x16a30b,_0x04f3('0x16'));_0xd4657c(_0x2c55fd['result'][_0x04f3('0x19')]);}})[_0x04f3('0x1a')](function(_0x1d9a30){logger[_0x04f3('0x17')](_0x04f3('0x14'),_0x16a30b,_0x1d9a30);_0x5c3b41(_0x1d9a30);});});}exports[_0x04f3('0x1b')]=function(_0x55db88){var _0x447355=this;return new Promise(function(_0x2aa802,_0x4ecef6){return db[_0x04f3('0x1c')][_0x04f3('0x1d')](_0x55db88['body'],{'raw':_0x55db88['options']?_0x55db88[_0x04f3('0x1e')][_0x04f3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55db88[_0x04f3('0x1e')]?_0x55db88[_0x04f3('0x1e')][_0x04f3('0x20')]||null:null,'attributes':_0x55db88[_0x04f3('0x1e')]?_0x55db88[_0x04f3('0x1e')][_0x04f3('0x21')]||null:null,'limit':_0x55db88[_0x04f3('0x1e')]?_0x55db88[_0x04f3('0x1e')][_0x04f3('0x22')]||null:null})['then'](function(_0x4abea3){logger['info'](_0x04f3('0x1b'),_0x55db88);logger[_0x04f3('0x15')]('UpdateWhatsappInteraction',_0x55db88,JSON[_0x04f3('0x23')](_0x4abea3));_0x2aa802(_0x4abea3);})['catch'](function(_0x4c0456){logger[_0x04f3('0x17')](_0x04f3('0x1b'),_0x4c0456[_0x04f3('0x19')],_0x55db88);_0x4ecef6(_0x447355[_0x04f3('0x17')](0x1f4,_0x4c0456[_0x04f3('0x19')]));});});};exports[_0x04f3('0x24')]=function(_0x58c17d){return new Promise(function(_0x6f40d6,_0x4539d2){return db[_0x04f3('0x1c')][_0x04f3('0x25')]({'where':_0x58c17d[_0x04f3('0x1e')]?_0x58c17d['options']['where']||null:null})[_0x04f3('0x12')](function(_0xb13dc6){if(_0xb13dc6){return _0xb13dc6[_0x04f3('0x26')](_0x58c17d[_0x04f3('0x27')][_0x04f3('0x28')],_[_0x04f3('0x29')](_0x58c17d['body'],[_0x04f3('0x28'),'id'])||{});}})['spread'](function(_0x1d0f0a){logger['info']('AddTags',_0x58c17d);logger['debug'](_0x04f3('0x2a'),_0x58c17d,JSON[_0x04f3('0x23')](_0x1d0f0a));_0x6f40d6(_0x1d0f0a);})['catch'](function(_0x5d485b){logger[_0x04f3('0x17')]('AddTags',_0x5d485b[_0x04f3('0x19')],_0x58c17d);_0x4539d2(_this[_0x04f3('0x17')](0x1f4,_0x5d485b['message']));});});};
\ No newline at end of file
index 697b8bb..1a03c4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1503=['remove','update','emit','removeListener','register','length','save'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1503,0x102));var _0x3150=function(_0x1a9fae,_0x7ef576){_0x1a9fae=_0x1a9fae-0x0;var _0x4c55fe=_0x1503[_0x1a9fae];return _0x4c55fe;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x3150('0x0'),_0x3150('0x1'),_0x3150('0x2')];function createListener(_0x3963ae,_0x5dab26){return function(_0x455f53){_0x5dab26[_0x3150('0x3')](_0x3963ae,_0x455f53);};}function removeListener(_0x4429b4,_0x511825){return function(){WhatsappInteractionEvents[_0x3150('0x4')](_0x4429b4,_0x511825);};}exports[_0x3150('0x5')]=function(_0x3bae22){for(var _0x54bc35=0x0,_0x10665d=events[_0x3150('0x6')];_0x54bc35<_0x10665d;_0x54bc35++){var _0x307e39=events[_0x54bc35];var _0x27e91b=createListener('whatsappInteraction:'+_0x307e39,_0x3bae22);WhatsappInteractionEvents['on'](_0x307e39,_0x27e91b);}};
\ No newline at end of file
+var _0x1c78=['save','remove','update','emit','removeListener','whatsappInteraction:'];(function(_0x1024c3,_0x53d986){var _0x4a2054=function(_0x3a5d87){while(--_0x3a5d87){_0x1024c3['push'](_0x1024c3['shift']());}};_0x4a2054(++_0x53d986);}(_0x1c78,0xc6));var _0x81c7=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x1c78[_0x5d4607];return _0x5e4a86;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x81c7('0x0'),_0x81c7('0x1'),_0x81c7('0x2')];function createListener(_0x382cb0,_0x138e07){return function(_0x21715f){_0x138e07[_0x81c7('0x3')](_0x382cb0,_0x21715f);};}function removeListener(_0x422635,_0x46fa20){return function(){WhatsappInteractionEvents[_0x81c7('0x4')](_0x422635,_0x46fa20);};}exports['register']=function(_0x188312){for(var _0x1add6b=0x0,_0xe24b8b=events['length'];_0x1add6b<_0xe24b8b;_0x1add6b++){var _0x51a3f1=events[_0x1add6b];var _0x9b0ede=createListener(_0x81c7('0x5')+_0x51a3f1,_0x188312);WhatsappInteractionEvents['on'](_0x51a3f1,_0x9b0ede);}};
\ No newline at end of file
index 781b32e..4e49f91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9cb=['get','isAuthenticated','/describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id','update','put','/:id/accept','accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5c0bed,_0x178478){var _0x603226=function(_0xe97300){while(--_0xe97300){_0x5c0bed['push'](_0x5c0bed['shift']());}};_0x603226(++_0x178478);}(_0xf9cb,0x1a9));var _0xbf9c=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0xf9cb[_0x19b84f];return _0x18067b;};'use strict';var multer=require(_0xbf9c('0x0'));var util=require(_0xbf9c('0x1'));var path=require(_0xbf9c('0x2'));var timeout=require(_0xbf9c('0x3'));var express=require(_0xbf9c('0x4'));var router=express['Router']();var auth=require(_0xbf9c('0x5'));var interaction=require(_0xbf9c('0x6'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xbf9c('0x7')]('/',auth[_0xbf9c('0x8')](),controller['index']);router['get'](_0xbf9c('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xbf9c('0x7')]('/:id',auth[_0xbf9c('0x8')](),controller[_0xbf9c('0xa')]);router[_0xbf9c('0xb')]('/',auth[_0xbf9c('0x8')](),interaction[_0xbf9c('0xc')](_0xbf9c('0xd'),_0xbf9c('0xe')),controller[_0xbf9c('0xf')]);router['post']('/:id/status',controller['status']);router['put'](_0xbf9c('0x10'),auth[_0xbf9c('0x8')](),controller[_0xbf9c('0x11')]);router[_0xbf9c('0x12')](_0xbf9c('0x13'),auth['isAuthenticated'](),controller[_0xbf9c('0x14')]);router['put'](_0xbf9c('0x15'),auth[_0xbf9c('0x8')](),controller[_0xbf9c('0x16')]);router['delete'](_0xbf9c('0x10'),auth[_0xbf9c('0x8')](),controller['destroy']);module[_0xbf9c('0x17')]=router;
\ No newline at end of file
+var _0xf0d6=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','tracked','whatsapp','/:id/status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf0d6,0x11b));var _0x6f0d=function(_0x24e9fa,_0x4ec604){_0x24e9fa=_0x24e9fa-0x0;var _0x1332d2=_0xf0d6[_0x24e9fa];return _0x1332d2;};'use strict';var multer=require(_0x6f0d('0x0'));var util=require(_0x6f0d('0x1'));var path=require('path');var timeout=require(_0x6f0d('0x2'));var express=require(_0x6f0d('0x3'));var router=express[_0x6f0d('0x4')]();var auth=require(_0x6f0d('0x5'));var interaction=require(_0x6f0d('0x6'));var config=require(_0x6f0d('0x7'));var controller=require('./whatsappMessage.controller');router[_0x6f0d('0x8')]('/',auth[_0x6f0d('0x9')](),controller[_0x6f0d('0xa')]);router['get'](_0x6f0d('0xb'),auth[_0x6f0d('0x9')](),controller[_0x6f0d('0xc')]);router[_0x6f0d('0x8')]('/:id',auth[_0x6f0d('0x9')](),controller['show']);router[_0x6f0d('0xd')]('/',auth['isAuthenticated'](),interaction[_0x6f0d('0xe')](_0x6f0d('0xf'),'whatsappmessage:create'),controller['create']);router[_0x6f0d('0xd')](_0x6f0d('0x10'),controller['status']);router[_0x6f0d('0x11')](_0x6f0d('0x12'),auth[_0x6f0d('0x9')](),controller[_0x6f0d('0x13')]);router['put'](_0x6f0d('0x14'),auth[_0x6f0d('0x9')](),controller[_0x6f0d('0x15')]);router[_0x6f0d('0x11')](_0x6f0d('0x16'),auth[_0x6f0d('0x9')](),controller[_0x6f0d('0x17')]);router[_0x6f0d('0x18')](_0x6f0d('0x12'),auth[_0x6f0d('0x9')](),controller['destroy']);module[_0x6f0d('0x19')]=router;
\ No newline at end of file
index c455d1c..84da1c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f3=['ENUM','STRING','DATE','sequelize','exports','medium','BOOLEAN'];(function(_0x4bbc7f,_0x5b5d34){var _0x31cae7=function(_0x384fe7){while(--_0x384fe7){_0x4bbc7f['push'](_0x4bbc7f['shift']());}};_0x31cae7(++_0x5b5d34);}(_0x28f3,0x9d));var _0x328f=function(_0x221470,_0x227ba5){_0x221470=_0x221470-0x0;var _0x24f819=_0x28f3[_0x221470];return _0x24f819;};'use strict';var Sequelize=require(_0x328f('0x0'));module[_0x328f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x328f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x328f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x328f('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x328f('0x5')]},'readAt':{'type':Sequelize[_0x328f('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbb8b=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','medium'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbb8b,0x1e8));var _0xbbb8=function(_0x573af5,_0x265bd5){_0x573af5=_0x573af5-0x0;var _0x5ad767=_0xbb8b[_0x573af5];return _0x5ad767;};'use strict';var Sequelize=require(_0xbbb8('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xbbb8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xbbb8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbbb8('0x3')]('in',_0xbbb8('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbbb8('0x5')](0xbe)},'phone':{'type':Sequelize[_0xbbb8('0x5')]},'readAt':{'type':Sequelize[_0xbbb8('0x6')]},'secret':{'type':Sequelize[_0xbbb8('0x2')],'defaultValue':![]}};
\ No newline at end of file
index ad1fcba..26c8b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ab=['socket.io-emitter','register','jayson/promise','http','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','WhatsappMessage','includeAll','include','rows','params','find','create','body','describe','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','WhatsappInteraction','isNil','format','interaction','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','whatsapp-interactions','whatsapp','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interface','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0x42ab,0x172));var _0xb42a=function(_0x1d1da3,_0x387863){_0x1d1da3=_0x1d1da3-0x0;var _0x4ea3b1=_0x42ab[_0x1d1da3];return _0x4ea3b1;};'use strict';var pdf=require(_0xb42a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb42a('0x1'));var jsonpatch=require(_0xb42a('0x2'));var rp=require(_0xb42a('0x3'));var moment=require(_0xb42a('0x4'));var BPromise=require(_0xb42a('0x5'));var Mustache=require(_0xb42a('0x6'));var util=require(_0xb42a('0x7'));var path=require(_0xb42a('0x8'));var sox=require(_0xb42a('0x9'));var csv=require(_0xb42a('0xa'));var ejs=require(_0xb42a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb42a('0xc'));var crypto=require(_0xb42a('0xd'));var jsforce=require(_0xb42a('0xe'));var deskjs=require(_0xb42a('0xf'));var toCsv=require(_0xb42a('0xa'));var querystring=require(_0xb42a('0x10'));var Papa=require(_0xb42a('0x11'));var Redis=require('ioredis');var authService=require(_0xb42a('0x12'));var qs=require(_0xb42a('0x13'));var as=require(_0xb42a('0x14'));var hardwareService=require(_0xb42a('0x15'));var logger=require(_0xb42a('0x16'))(_0xb42a('0x17'));var utils=require('../../config/utils');var config=require(_0xb42a('0x18'));var db=require(_0xb42a('0x19'))['db'];config['redis']=_[_0xb42a('0x1a')](config[_0xb42a('0x1b')],{'host':_0xb42a('0x1c'),'port':0x18eb});var socket=require(_0xb42a('0x1d'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xb42a('0x1e')](socket);var jayson=require(_0xb42a('0x1f'));var client=jayson['client'][_0xb42a('0x20')]({'port':0x232c});var client9002=jayson[_0xb42a('0x21')][_0xb42a('0x20')]({'port':0x232a});function checkPasswordPattern(_0x2b6f3a,_0x104586,_0xdd63ec){if(_0xdd63ec){var _0x580380=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x580380[_0xb42a('0x22')](_0x104586)){return _0x2b6f3a;}else{throw new db[(_0xb42a('0x23'))][(_0xb42a('0x24'))](_0xb42a('0x25'));}}else{return _0x2b6f3a;}}function respondWithRpcPromise(_0x3ee186,_0x1b3bac,_0x4878d1,_0x4581bd){return new BPromise(function(_0x54d036,_0x41c670){var _0x43756b=_0x4581bd||client;return _0x43756b[_0xb42a('0x26')](_0x3ee186,_0x4878d1)[_0xb42a('0x27')](function(_0xd93660){logger[_0xb42a('0x28')](_0xb42a('0x29'),_0x1b3bac,_0xb42a('0x2a'));logger['debug'](_0xb42a('0x2b'),_0x1b3bac,_0xb42a('0x2a'),JSON[_0xb42a('0x2c')](_0xd93660));if(_0xd93660[_0xb42a('0x2d')]){if(_0xd93660[_0xb42a('0x2d')]['code']===0x1f4){logger[_0xb42a('0x2d')](_0xb42a('0x29'),_0x1b3bac,_0xd93660[_0xb42a('0x2d')][_0xb42a('0x2e')]);return _0x41c670(_0xd93660[_0xb42a('0x2d')]['message']);}logger[_0xb42a('0x2d')](_0xb42a('0x29'),_0x1b3bac,_0xd93660['error'][_0xb42a('0x2e')]);return _0x54d036(_0xd93660[_0xb42a('0x2d')]['message']);}else{logger[_0xb42a('0x28')](_0xb42a('0x29'),_0x1b3bac,_0xb42a('0x2a'));_0x54d036(_0xd93660['result'][_0xb42a('0x2e')]);}})[_0xb42a('0x2f')](function(_0x547c0){logger[_0xb42a('0x2d')](_0xb42a('0x29'),_0x1b3bac,_0x547c0);_0x41c670(_0x547c0);});});}function respondWithStatusCode(_0x415cdf,_0x5c3afd){_0x5c3afd=_0x5c3afd||0xcc;return function(_0x2e6c40){if(_0x2e6c40){return _0x415cdf[_0xb42a('0x30')](_0x5c3afd);}return _0x415cdf[_0xb42a('0x31')](_0x5c3afd)[_0xb42a('0x32')]();};}function respondWithResult(_0x3d7013,_0x41a3a3){_0x41a3a3=_0x41a3a3||0xc8;return function(_0x492c77){if(_0x492c77){return _0x3d7013[_0xb42a('0x31')](_0x41a3a3)[_0xb42a('0x33')](_0x492c77);}};}function respondWithFilteredResult(_0x55ea5c,_0x46623b){return function(_0x5c0417){if(_0x5c0417){var _0x196405=_0x5c0417[_0xb42a('0x34')],_0x38816f=_0x46623b[_0xb42a('0x35')],_0x50e1f4=_0x46623b[_0xb42a('0x35')]+_0x46623b['limit'],_0x4c27a6;if(_0x50e1f4>=_0x196405){_0x50e1f4=_0x196405;_0x4c27a6=0xc8;}else{_0x4c27a6=0xce;}_0x55ea5c[_0xb42a('0x31')](_0x4c27a6);return _0x55ea5c[_0xb42a('0x36')](_0xb42a('0x37'),_0x38816f+'-'+_0x50e1f4+'/'+_0x196405)['json'](_0x5c0417);}return null;};}function patchUpdates(_0x28bec9){return function(_0x102b52){try{jsonpatch[_0xb42a('0x38')](_0x102b52,_0x28bec9,!![]);}catch(_0x43c62f){return BPromise[_0xb42a('0x39')](_0x43c62f);}return _0x102b52[_0xb42a('0x3a')]();};}function saveUpdates(_0x76a6fa,_0x131591){return function(_0x5bb0f8){if(_0x5bb0f8){return _0x5bb0f8[_0xb42a('0x3b')](_0x76a6fa)[_0xb42a('0x27')](function(_0x30c881){return _0x30c881;});}return null;};}function removeEntity(_0x13f82d,_0xee2b94){return function(_0x2facd1){if(_0x2facd1){return _0x2facd1[_0xb42a('0x3c')]()[_0xb42a('0x27')](function(){_0x13f82d[_0xb42a('0x31')](0xcc)[_0xb42a('0x32')]();});}};}function handleEntityNotFound(_0x12f74c,_0x2c9248){return function(_0x41bea2){if(!_0x41bea2){_0x12f74c[_0xb42a('0x30')](0x194);}return _0x41bea2;};}function handleError(_0x34a489,_0x4e6555){_0x4e6555=_0x4e6555||0x1f4;return function(_0x256515){logger[_0xb42a('0x2d')](_0x256515[_0xb42a('0x3d')]);if(_0x256515[_0xb42a('0x3e')]){delete _0x256515[_0xb42a('0x3e')];}_0x34a489[_0xb42a('0x31')](_0x4e6555)[_0xb42a('0x3f')](_0x256515);};}exports[_0xb42a('0x40')]=function(_0x103dca,_0x404a6b){var _0x3eb6ad={},_0xe25e3b={},_0xcd8163={'count':0x0,'rows':[]};var _0x26c943=_[_0xb42a('0x41')](db['WhatsappMessage'][_0xb42a('0x42')],function(_0x31dce9){return{'name':_0x31dce9['fieldName'],'type':_0x31dce9[_0xb42a('0x43')][_0xb42a('0x44')]};});_0xe25e3b[_0xb42a('0x45')]=_[_0xb42a('0x41')](_0x26c943,_0xb42a('0x3e'));_0xe25e3b[_0xb42a('0x46')]=_['keys'](_0x103dca[_0xb42a('0x46')]);_0xe25e3b['filters']=_[_0xb42a('0x47')](_0xe25e3b[_0xb42a('0x45')],_0xe25e3b['query']);_0x3eb6ad[_0xb42a('0x48')]=_['intersection'](_0xe25e3b['model'],qs[_0xb42a('0x49')](_0x103dca['query'][_0xb42a('0x49')]));_0x3eb6ad[_0xb42a('0x48')]=_0x3eb6ad[_0xb42a('0x48')][_0xb42a('0x4a')]?_0x3eb6ad['attributes']:_0xe25e3b['model'];if(!_0x103dca[_0xb42a('0x46')][_0xb42a('0x4b')](_0xb42a('0x4c'))){_0x3eb6ad[_0xb42a('0x4d')]=qs[_0xb42a('0x4d')](_0x103dca[_0xb42a('0x46')][_0xb42a('0x4d')]);_0x3eb6ad[_0xb42a('0x35')]=qs[_0xb42a('0x35')](_0x103dca[_0xb42a('0x46')][_0xb42a('0x35')]);}_0x3eb6ad[_0xb42a('0x4e')]=qs[_0xb42a('0x4f')](_0x103dca[_0xb42a('0x46')]['sort']);_0x3eb6ad[_0xb42a('0x50')]=qs[_0xb42a('0x51')](_['pick'](_0x103dca[_0xb42a('0x46')],_0xe25e3b[_0xb42a('0x51')]),_0x26c943);if(_0x103dca[_0xb42a('0x46')][_0xb42a('0x52')]){_0x3eb6ad[_0xb42a('0x50')]=_[_0xb42a('0x53')](_0x3eb6ad[_0xb42a('0x50')],{'$or':_[_0xb42a('0x41')](_0x26c943,function(_0x3f5cf9){if(_0x3f5cf9['type']!=='VIRTUAL'){var _0x378158={};_0x378158[_0x3f5cf9['name']]={'$like':'%'+_0x103dca[_0xb42a('0x46')][_0xb42a('0x52')]+'%'};return _0x378158;}})});}_0x3eb6ad=_[_0xb42a('0x53')]({},_0x3eb6ad,_0x103dca[_0xb42a('0x54')]);var _0x46d12c={'where':_0x3eb6ad[_0xb42a('0x50')]};return db[_0xb42a('0x55')][_0xb42a('0x34')](_0x46d12c)[_0xb42a('0x27')](function(_0x274c1b){_0xcd8163[_0xb42a('0x34')]=_0x274c1b;if(_0x103dca[_0xb42a('0x46')][_0xb42a('0x56')]){_0x3eb6ad[_0xb42a('0x57')]=[{'all':!![]}];}return db[_0xb42a('0x55')]['findAll'](_0x3eb6ad);})[_0xb42a('0x27')](function(_0xa2f3ae){_0xcd8163[_0xb42a('0x58')]=_0xa2f3ae;return _0xcd8163;})[_0xb42a('0x27')](respondWithFilteredResult(_0x404a6b,_0x3eb6ad))[_0xb42a('0x2f')](handleError(_0x404a6b,null));};exports['show']=function(_0x3f50b0,_0xb52aed){var _0x53dbd7={'raw':!![],'where':{'id':_0x3f50b0[_0xb42a('0x59')]['id']}},_0x44b014={};_0x44b014[_0xb42a('0x45')]=_['keys'](db[_0xb42a('0x55')]['rawAttributes']);_0x44b014[_0xb42a('0x46')]=_['keys'](_0x3f50b0[_0xb42a('0x46')]);_0x44b014[_0xb42a('0x51')]=_['intersection'](_0x44b014[_0xb42a('0x45')],_0x44b014[_0xb42a('0x46')]);_0x53dbd7[_0xb42a('0x48')]=_[_0xb42a('0x47')](_0x44b014[_0xb42a('0x45')],qs[_0xb42a('0x49')](_0x3f50b0[_0xb42a('0x46')][_0xb42a('0x49')]));_0x53dbd7['attributes']=_0x53dbd7[_0xb42a('0x48')]['length']?_0x53dbd7[_0xb42a('0x48')]:_0x44b014['model'];if(_0x3f50b0[_0xb42a('0x46')][_0xb42a('0x56')]){_0x53dbd7['include']=[{'all':!![]}];}_0x53dbd7=_['merge']({},_0x53dbd7,_0x3f50b0[_0xb42a('0x54')]);return db[_0xb42a('0x55')][_0xb42a('0x5a')](_0x53dbd7)['then'](handleEntityNotFound(_0xb52aed,null))[_0xb42a('0x27')](respondWithResult(_0xb52aed,null))[_0xb42a('0x2f')](handleError(_0xb52aed,null));};exports[_0xb42a('0x5b')]=function(_0x5d15f9,_0x1180aa){return db[_0xb42a('0x55')][_0xb42a('0x5b')](_0x5d15f9[_0xb42a('0x5c')],{})['then'](respondWithResult(_0x1180aa,0xc9))[_0xb42a('0x2f')](handleError(_0x1180aa,null));};exports[_0xb42a('0x3b')]=function(_0x11a8d1,_0xce8915){if(_0x11a8d1[_0xb42a('0x5c')]['id']){delete _0x11a8d1[_0xb42a('0x5c')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x11a8d1[_0xb42a('0x59')]['id']}})[_0xb42a('0x27')](handleEntityNotFound(_0xce8915,null))['then'](saveUpdates(_0x11a8d1['body'],null))['then'](respondWithResult(_0xce8915,null))[_0xb42a('0x2f')](handleError(_0xce8915,null));};exports[_0xb42a('0x3c')]=function(_0x502f95,_0x25ec36){return db[_0xb42a('0x55')][_0xb42a('0x5a')]({'where':{'id':_0x502f95[_0xb42a('0x59')]['id']}})[_0xb42a('0x27')](handleEntityNotFound(_0x25ec36,null))[_0xb42a('0x27')](removeEntity(_0x25ec36,null))[_0xb42a('0x2f')](handleError(_0x25ec36,null));};exports[_0xb42a('0x5d')]=function(_0x5cdaa1,_0x5afb14){return db[_0xb42a('0x55')]['describe']()[_0xb42a('0x27')](respondWithResult(_0x5afb14,null))[_0xb42a('0x2f')](handleError(_0x5afb14,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xb42a('0x5e')]=function(_0x4d3c27,_0x4a2f9f,_0x1782b6){var _0x3817a8={'channel':'whatsapp'};if(_0x4d3c27[_0xb42a('0x5c')]['id']){delete _0x4d3c27[_0xb42a('0x5c')]['id'];}_0x4d3c27[_0xb42a('0x5c')][_0xb42a('0x5f')]=!![];_0x4d3c27[_0xb42a('0x5c')][_0xb42a('0x60')]=moment()['format'](_0xb42a('0x61'));_0x4d3c27['body']['UserId']=_0x4d3c27[_0xb42a('0x5c')][_0xb42a('0x62')]||_0x4d3c27[_0xb42a('0x63')]['id'];return db['WhatsappMessage'][_0xb42a('0x5a')]({'where':{'id':_0x4d3c27[_0xb42a('0x59')]['id'],'UserId':null},'include':[{'model':db[_0xb42a('0x64')],'as':_0xb42a('0x65')}]})[_0xb42a('0x27')](handleEntityNotFound(_0x4a2f9f,null))[_0xb42a('0x27')](saveUpdates(_0x4d3c27[_0xb42a('0x5c')],null))[_0xb42a('0x27')](function(_0x2378fa){if(_0x2378fa){_0x3817a8[_0xb42a('0x2e')]=_0x2378fa[_0xb42a('0x66')]({'plain':!![]});return db[_0xb42a('0x67')][_0xb42a('0x5a')]({'where':{'id':_0x2378fa['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4a2f9f,null))[_0xb42a('0x27')](function(_0x27e6a3){if(_0x27e6a3){return _0x27e6a3['update']({'UserId':_0x4d3c27[_0xb42a('0x5c')][_0xb42a('0x62')],'read1stAt':_[_0xb42a('0x68')](_0x27e6a3['read1stAt'])?moment()[_0xb42a('0x69')](_0xb42a('0x61')):undefined});}return null;})[_0xb42a('0x27')](function(_0x23c805){if(_0x23c805){_0x3817a8[_0xb42a('0x6a')]=_0x23c805[_0xb42a('0x66')]({'plain':!![]});interaction_log[_0xb42a('0x28')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d3c27['user']['id'],_0x4d3c27[_0xb42a('0x63')][_0xb42a('0x3e')],_0x4d3c27['user'][_0xb42a('0x6b')],_0x3817a8[_0xb42a('0x6a')]['id'],_0x4d3c27[_0xb42a('0x5c')]?JSON[_0xb42a('0x2c')](_0x4d3c27['body']):_0xb42a('0x6c'));return respondWithRpcPromise(_0xb42a('0x6d'),_0xb42a('0x6e'),_0x3817a8);}return null;})[_0xb42a('0x27')](function(_0x6da84){if(_0x6da84){if(_0x4d3c27[_0xb42a('0x5c')][_0xb42a('0x6f')]){_0x3817a8[_0xb42a('0x2e')]['interface']=util[_0xb42a('0x69')](_0xb42a('0x70'),_0x4d3c27[_0xb42a('0x63')][_0xb42a('0x3e')]);_0x3817a8[_0xb42a('0x2e')][_0xb42a('0x71')]=_0x3817a8[_0xb42a('0x71')];_0x3817a8[_0xb42a('0x2e')][_0xb42a('0x72')]='accept';return respondWithRpcPromise('EventManager',_0xb42a('0x73'),{'event':_0xb42a('0x74'),'message':_0x3817a8[_0xb42a('0x2e')]},client9002)['then'](function(){return _0x3817a8;});}return _0x3817a8;}return null;})[_0xb42a('0x27')](respondWithResult(_0x4a2f9f,null))[_0xb42a('0x2f')](handleError(_0x4a2f9f,null));};var interaction_log=require(_0xb42a('0x16'))(_0xb42a('0x75'));exports[_0xb42a('0x39')]=function(_0x2f18e0,_0x4081e6,_0x4bbe44){var _0x244e91={'agent':{},'channel':_0xb42a('0x76')};if(_0x2f18e0[_0xb42a('0x5c')]['id']){delete _0x2f18e0[_0xb42a('0x5c')]['id'];}_0x2f18e0[_0xb42a('0x5c')][_0xb42a('0x62')]=_0x2f18e0[_0xb42a('0x5c')][_0xb42a('0x62')]||_0x2f18e0['user']['id'];_0x244e91['agent']['id']=_0x2f18e0[_0xb42a('0x5c')][_0xb42a('0x62')];return db[_0xb42a('0x55')][_0xb42a('0x5a')]({'where':{'id':_0x2f18e0[_0xb42a('0x59')]['id'],'UserId':null}})[_0xb42a('0x27')](handleEntityNotFound(_0x4081e6,null))['then'](function(_0x3193fc){if(_0x3193fc){_0x244e91[_0xb42a('0x2e')]=_0x3193fc['get']({'plain':!![]});return db[_0xb42a('0x67')][_0xb42a('0x5a')]({'where':{'id':_0x3193fc[_0xb42a('0x77')]}});}return null;})[_0xb42a('0x27')](handleEntityNotFound(_0x4081e6,null))['then'](function(_0x73f76d){if(_0x73f76d){_0x244e91[_0xb42a('0x6a')]=_0x73f76d[_0xb42a('0x66')]({'plain':!![]});interaction_log['info'](_0xb42a('0x78'),_0x2f18e0[_0xb42a('0x63')]['id'],_0x2f18e0['user']['name'],_0x2f18e0['user'][_0xb42a('0x6b')],_0x244e91[_0xb42a('0x6a')]['id'],_0x2f18e0[_0xb42a('0x5c')]?JSON[_0xb42a('0x2c')](_0x2f18e0[_0xb42a('0x5c')]):_0xb42a('0x6c'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x244e91);}return null;})[_0xb42a('0x27')](function(_0x14dd3f){if(_0x14dd3f){_0x14dd3f['message'][_0xb42a('0x79')]=util['format'](_0xb42a('0x70'),_0x2f18e0['user']['name']);_0x14dd3f['message'][_0xb42a('0x71')]=_0x244e91['channel'];_0x14dd3f[_0xb42a('0x2e')][_0xb42a('0x72')]=_0xb42a('0x39');respondWithRpcPromise(_0xb42a('0x73'),_0xb42a('0x73'),{'event':_0xb42a('0x7a'),'message':_0x14dd3f[_0xb42a('0x2e')]},client9002);return _0x244e91;}return null;})[_0xb42a('0x27')](respondWithResult(_0x4081e6,null))[_0xb42a('0x2f')](handleError(_0x4081e6,null));};exports['status']=function(_0x46570b,_0x54bdca,_0x2fbf31){if(_0x46570b['body']['id']){delete _0x46570b[_0xb42a('0x5c')]['id'];}var _0x49415b;return db[_0xb42a('0x55')][_0xb42a('0x5a')]({'where':{'id':_0x46570b[_0xb42a('0x59')]['id']}})['then'](handleEntityNotFound(_0x54bdca,null))[_0xb42a('0x27')](function(_0xca5d61){if(_0xca5d61){_0x49415b=_0xca5d61;return db['WhatsappAccount']['find']({'where':{'id':_0xca5d61[_0xb42a('0x7b')]}});}})[_0xb42a('0x27')](handleEntityNotFound(_0x54bdca,null))[_0xb42a('0x27')](function(_0x578780){if(_0x578780){logger[_0xb42a('0x7c')](_0xb42a('0x7d'),_0xb42a('0x31'),_0xb42a('0x7e'),_0x578780[_0xb42a('0x43')],util[_0xb42a('0x7f')](_0x46570b[_0xb42a('0x5c')],{'showHidden':![],'depth':null}));switch(_0x578780[_0xb42a('0x43')]){case _0xb42a('0x80'):if(_0x46570b[_0xb42a('0x5c')][_0xb42a('0x81')]&&_0x46570b[_0xb42a('0x5c')]['MessageSid']===_0x49415b[_0xb42a('0x82')]&&_0x46570b['body']['MessageStatus']&&_0x46570b['body'][_0xb42a('0x83')]===_0xb42a('0x5f')){return _0x49415b[_0xb42a('0x3b')]({'read':!![]});}else{logger[_0xb42a('0x2d')](_0xb42a('0x84'),_0xb42a('0x31'),_0xb42a('0x80'),util[_0xb42a('0x7f')](_0x46570b[_0xb42a('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x49415b;}})[_0xb42a('0x27')](respondWithResult(_0x54bdca,null))['catch'](handleError(_0x54bdca,null));};
\ No newline at end of file
+var _0x6bdd=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','limit','set','apply','reject','update','stack','name','status','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','show','params','create','body','find','destroy','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','event','WhatsappAccount','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x243731,_0x265626){var _0x17b205=function(_0x2a07d1){while(--_0x2a07d1){_0x243731['push'](_0x243731['shift']());}};_0x17b205(++_0x265626);}(_0x6bdd,0x108));var _0xd6bd=function(_0x288536,_0x369b51){_0x288536=_0x288536-0x0;var _0x525e94=_0x6bdd[_0x288536];return _0x525e94;};'use strict';var pdf=require(_0xd6bd('0x0'));var emlformat=require(_0xd6bd('0x1'));var rimraf=require(_0xd6bd('0x2'));var zipdir=require(_0xd6bd('0x3'));var jsonpatch=require(_0xd6bd('0x4'));var rp=require(_0xd6bd('0x5'));var moment=require(_0xd6bd('0x6'));var BPromise=require(_0xd6bd('0x7'));var Mustache=require(_0xd6bd('0x8'));var util=require(_0xd6bd('0x9'));var path=require(_0xd6bd('0xa'));var sox=require(_0xd6bd('0xb'));var csv=require(_0xd6bd('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd6bd('0xd'));var squel=require(_0xd6bd('0xe'));var crypto=require(_0xd6bd('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd6bd('0x10'));var toCsv=require(_0xd6bd('0xc'));var querystring=require(_0xd6bd('0x11'));var Papa=require(_0xd6bd('0x12'));var Redis=require(_0xd6bd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd6bd('0x14'));var as=require(_0xd6bd('0x15'));var hardwareService=require(_0xd6bd('0x16'));var logger=require(_0xd6bd('0x17'))(_0xd6bd('0x18'));var utils=require(_0xd6bd('0x19'));var config=require(_0xd6bd('0x1a'));var db=require('../../mysqldb')['db'];config[_0xd6bd('0x1b')]=_[_0xd6bd('0x1c')](config['redis'],{'host':_0xd6bd('0x1d'),'port':0x18eb});var socket=require(_0xd6bd('0x1e'))(new Redis(config['redis']));require(_0xd6bd('0x1f'))[_0xd6bd('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd6bd('0x21')][_0xd6bd('0x22')]({'port':0x232c});var client9002=jayson[_0xd6bd('0x21')][_0xd6bd('0x22')]({'port':0x232a});function checkPasswordPattern(_0x1f1b77,_0x308b69,_0x37bfec){if(_0x37bfec){var _0x1898c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1898c6[_0xd6bd('0x23')](_0x308b69)){return _0x1f1b77;}else{throw new db[(_0xd6bd('0x24'))][(_0xd6bd('0x25'))](_0xd6bd('0x26'));}}else{return _0x1f1b77;}}function respondWithRpcPromise(_0x415c22,_0x20329b,_0x3bbbff,_0x2dca02){return new BPromise(function(_0x39fd1b,_0x5a9a8f){var _0x546063=_0x2dca02||client;return _0x546063[_0xd6bd('0x27')](_0x415c22,_0x3bbbff)[_0xd6bd('0x28')](function(_0x2133ea){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x20329b,_0xd6bd('0x29'));logger['debug'](_0xd6bd('0x2a'),_0x20329b,_0xd6bd('0x29'),JSON[_0xd6bd('0x2b')](_0x2133ea));if(_0x2133ea[_0xd6bd('0x2c')]){if(_0x2133ea[_0xd6bd('0x2c')]['code']===0x1f4){logger[_0xd6bd('0x2c')](_0xd6bd('0x2d'),_0x20329b,_0x2133ea[_0xd6bd('0x2c')][_0xd6bd('0x2e')]);return _0x5a9a8f(_0x2133ea[_0xd6bd('0x2c')][_0xd6bd('0x2e')]);}logger['error'](_0xd6bd('0x2d'),_0x20329b,_0x2133ea[_0xd6bd('0x2c')][_0xd6bd('0x2e')]);return _0x39fd1b(_0x2133ea[_0xd6bd('0x2c')]['message']);}else{logger['info'](_0xd6bd('0x2d'),_0x20329b,'request\x20sent');_0x39fd1b(_0x2133ea[_0xd6bd('0x2f')][_0xd6bd('0x2e')]);}})[_0xd6bd('0x30')](function(_0x19593e){logger[_0xd6bd('0x2c')](_0xd6bd('0x2d'),_0x20329b,_0x19593e);_0x5a9a8f(_0x19593e);});});}function respondWithStatusCode(_0x2478af,_0x246751){_0x246751=_0x246751||0xcc;return function(_0x4632dd){if(_0x4632dd){return _0x2478af[_0xd6bd('0x31')](_0x246751);}return _0x2478af['status'](_0x246751)[_0xd6bd('0x32')]();};}function respondWithResult(_0x1e031d,_0x3a092e){_0x3a092e=_0x3a092e||0xc8;return function(_0x17cac1){if(_0x17cac1){return _0x1e031d['status'](_0x3a092e)[_0xd6bd('0x33')](_0x17cac1);}};}function respondWithFilteredResult(_0x2f36cd,_0x354362){return function(_0x24764d){if(_0x24764d){var _0x9d1157=_0x24764d['count'],_0x6a69c0=_0x354362[_0xd6bd('0x34')],_0x434faf=_0x354362[_0xd6bd('0x34')]+_0x354362[_0xd6bd('0x35')],_0x82df34;if(_0x434faf>=_0x9d1157){_0x434faf=_0x9d1157;_0x82df34=0xc8;}else{_0x82df34=0xce;}_0x2f36cd['status'](_0x82df34);return _0x2f36cd[_0xd6bd('0x36')]('Content-Range',_0x6a69c0+'-'+_0x434faf+'/'+_0x9d1157)[_0xd6bd('0x33')](_0x24764d);}return null;};}function patchUpdates(_0x5e50c8){return function(_0x566e94){try{jsonpatch[_0xd6bd('0x37')](_0x566e94,_0x5e50c8,!![]);}catch(_0x3754be){return BPromise[_0xd6bd('0x38')](_0x3754be);}return _0x566e94['save']();};}function saveUpdates(_0x29886b,_0x218fa0){return function(_0x4ea5cd){if(_0x4ea5cd){return _0x4ea5cd[_0xd6bd('0x39')](_0x29886b)[_0xd6bd('0x28')](function(_0xb5b3a1){return _0xb5b3a1;});}return null;};}function removeEntity(_0xd486d4,_0x5ac98f){return function(_0x3c866d){if(_0x3c866d){return _0x3c866d['destroy']()['then'](function(){_0xd486d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bb442,_0x4aca3f){return function(_0x2ff4e5){if(!_0x2ff4e5){_0x2bb442[_0xd6bd('0x31')](0x194);}return _0x2ff4e5;};}function handleError(_0x5e1e23,_0x492af2){_0x492af2=_0x492af2||0x1f4;return function(_0x3da8e2){logger[_0xd6bd('0x2c')](_0x3da8e2[_0xd6bd('0x3a')]);if(_0x3da8e2[_0xd6bd('0x3b')]){delete _0x3da8e2[_0xd6bd('0x3b')];}_0x5e1e23[_0xd6bd('0x3c')](_0x492af2)[_0xd6bd('0x3d')](_0x3da8e2);};}exports[_0xd6bd('0x3e')]=function(_0xf29b63,_0x33472e){var _0x409cd3={},_0x661af9={},_0x58ab54={'count':0x0,'rows':[]};var _0x48ee06=_[_0xd6bd('0x3f')](db[_0xd6bd('0x40')][_0xd6bd('0x41')],function(_0x3d64d3){return{'name':_0x3d64d3['fieldName'],'type':_0x3d64d3[_0xd6bd('0x42')][_0xd6bd('0x43')]};});_0x661af9[_0xd6bd('0x44')]=_[_0xd6bd('0x3f')](_0x48ee06,_0xd6bd('0x3b'));_0x661af9[_0xd6bd('0x45')]=_[_0xd6bd('0x46')](_0xf29b63[_0xd6bd('0x45')]);_0x661af9[_0xd6bd('0x47')]=_[_0xd6bd('0x48')](_0x661af9[_0xd6bd('0x44')],_0x661af9['query']);_0x409cd3[_0xd6bd('0x49')]=_[_0xd6bd('0x48')](_0x661af9[_0xd6bd('0x44')],qs['fields'](_0xf29b63[_0xd6bd('0x45')][_0xd6bd('0x4a')]));_0x409cd3[_0xd6bd('0x49')]=_0x409cd3[_0xd6bd('0x49')][_0xd6bd('0x4b')]?_0x409cd3[_0xd6bd('0x49')]:_0x661af9['model'];if(!_0xf29b63['query'][_0xd6bd('0x4c')](_0xd6bd('0x4d'))){_0x409cd3[_0xd6bd('0x35')]=qs[_0xd6bd('0x35')](_0xf29b63[_0xd6bd('0x45')][_0xd6bd('0x35')]);_0x409cd3['offset']=qs[_0xd6bd('0x34')](_0xf29b63[_0xd6bd('0x45')][_0xd6bd('0x34')]);}_0x409cd3['order']=qs[_0xd6bd('0x4e')](_0xf29b63['query'][_0xd6bd('0x4e')]);_0x409cd3[_0xd6bd('0x4f')]=qs[_0xd6bd('0x47')](_[_0xd6bd('0x50')](_0xf29b63[_0xd6bd('0x45')],_0x661af9[_0xd6bd('0x47')]),_0x48ee06);if(_0xf29b63[_0xd6bd('0x45')][_0xd6bd('0x51')]){_0x409cd3[_0xd6bd('0x4f')]=_['merge'](_0x409cd3[_0xd6bd('0x4f')],{'$or':_[_0xd6bd('0x3f')](_0x48ee06,function(_0x9c4fda){if(_0x9c4fda[_0xd6bd('0x42')]!=='VIRTUAL'){var _0x3e1105={};_0x3e1105[_0x9c4fda['name']]={'$like':'%'+_0xf29b63['query'][_0xd6bd('0x51')]+'%'};return _0x3e1105;}})});}_0x409cd3=_[_0xd6bd('0x52')]({},_0x409cd3,_0xf29b63[_0xd6bd('0x53')]);var _0x33225a={'where':_0x409cd3[_0xd6bd('0x4f')]};return db['WhatsappMessage']['count'](_0x33225a)['then'](function(_0x366817){_0x58ab54[_0xd6bd('0x54')]=_0x366817;if(_0xf29b63[_0xd6bd('0x45')][_0xd6bd('0x55')]){_0x409cd3[_0xd6bd('0x56')]=[{'all':!![]}];}return db[_0xd6bd('0x40')][_0xd6bd('0x57')](_0x409cd3);})[_0xd6bd('0x28')](function(_0x33a17f){_0x58ab54['rows']=_0x33a17f;return _0x58ab54;})[_0xd6bd('0x28')](respondWithFilteredResult(_0x33472e,_0x409cd3))[_0xd6bd('0x30')](handleError(_0x33472e,null));};exports[_0xd6bd('0x58')]=function(_0xba680e,_0x5149b){var _0x1c75e9={'raw':!![],'where':{'id':_0xba680e[_0xd6bd('0x59')]['id']}},_0x5bd6b8={};_0x5bd6b8[_0xd6bd('0x44')]=_[_0xd6bd('0x46')](db['WhatsappMessage'][_0xd6bd('0x41')]);_0x5bd6b8[_0xd6bd('0x45')]=_[_0xd6bd('0x46')](_0xba680e['query']);_0x5bd6b8[_0xd6bd('0x47')]=_[_0xd6bd('0x48')](_0x5bd6b8[_0xd6bd('0x44')],_0x5bd6b8[_0xd6bd('0x45')]);_0x1c75e9['attributes']=_[_0xd6bd('0x48')](_0x5bd6b8['model'],qs[_0xd6bd('0x4a')](_0xba680e[_0xd6bd('0x45')][_0xd6bd('0x4a')]));_0x1c75e9[_0xd6bd('0x49')]=_0x1c75e9[_0xd6bd('0x49')]['length']?_0x1c75e9[_0xd6bd('0x49')]:_0x5bd6b8[_0xd6bd('0x44')];if(_0xba680e[_0xd6bd('0x45')][_0xd6bd('0x55')]){_0x1c75e9[_0xd6bd('0x56')]=[{'all':!![]}];}_0x1c75e9=_['merge']({},_0x1c75e9,_0xba680e[_0xd6bd('0x53')]);return db[_0xd6bd('0x40')]['find'](_0x1c75e9)[_0xd6bd('0x28')](handleEntityNotFound(_0x5149b,null))[_0xd6bd('0x28')](respondWithResult(_0x5149b,null))[_0xd6bd('0x30')](handleError(_0x5149b,null));};exports['create']=function(_0x4547b5,_0x2dfab1){return db[_0xd6bd('0x40')][_0xd6bd('0x5a')](_0x4547b5[_0xd6bd('0x5b')],{})[_0xd6bd('0x28')](respondWithResult(_0x2dfab1,0xc9))['catch'](handleError(_0x2dfab1,null));};exports[_0xd6bd('0x39')]=function(_0x12da3c,_0x1ca7fd){if(_0x12da3c[_0xd6bd('0x5b')]['id']){delete _0x12da3c['body']['id'];}return db[_0xd6bd('0x40')][_0xd6bd('0x5c')]({'where':{'id':_0x12da3c['params']['id']}})[_0xd6bd('0x28')](handleEntityNotFound(_0x1ca7fd,null))[_0xd6bd('0x28')](saveUpdates(_0x12da3c[_0xd6bd('0x5b')],null))[_0xd6bd('0x28')](respondWithResult(_0x1ca7fd,null))[_0xd6bd('0x30')](handleError(_0x1ca7fd,null));};exports[_0xd6bd('0x5d')]=function(_0xfe157a,_0x1888f3){return db[_0xd6bd('0x40')][_0xd6bd('0x5c')]({'where':{'id':_0xfe157a[_0xd6bd('0x59')]['id']}})[_0xd6bd('0x28')](handleEntityNotFound(_0x1888f3,null))[_0xd6bd('0x28')](removeEntity(_0x1888f3,null))[_0xd6bd('0x30')](handleError(_0x1888f3,null));};exports[_0xd6bd('0x5e')]=function(_0x52dd98,_0x4570de){return db[_0xd6bd('0x40')][_0xd6bd('0x5e')]()['then'](respondWithResult(_0x4570de,null))[_0xd6bd('0x30')](handleError(_0x4570de,null));};var interaction_log=require(_0xd6bd('0x17'))(_0xd6bd('0x5f'));exports['accept']=function(_0xa0051a,_0x1b30d8,_0x48c067){var _0x3d157a={'channel':_0xd6bd('0x60')};if(_0xa0051a['body']['id']){delete _0xa0051a[_0xd6bd('0x5b')]['id'];}_0xa0051a[_0xd6bd('0x5b')][_0xd6bd('0x61')]=!![];_0xa0051a[_0xd6bd('0x5b')][_0xd6bd('0x62')]=moment()[_0xd6bd('0x63')](_0xd6bd('0x64'));_0xa0051a[_0xd6bd('0x5b')]['UserId']=_0xa0051a[_0xd6bd('0x5b')][_0xd6bd('0x65')]||_0xa0051a['user']['id'];return db['WhatsappMessage'][_0xd6bd('0x5c')]({'where':{'id':_0xa0051a['params']['id'],'UserId':null},'include':[{'model':db[_0xd6bd('0x66')],'as':'Contact'}]})[_0xd6bd('0x28')](handleEntityNotFound(_0x1b30d8,null))['then'](saveUpdates(_0xa0051a['body'],null))[_0xd6bd('0x28')](function(_0x1e9e13){if(_0x1e9e13){_0x3d157a['message']=_0x1e9e13[_0xd6bd('0x67')]({'plain':!![]});return db[_0xd6bd('0x68')][_0xd6bd('0x5c')]({'where':{'id':_0x1e9e13[_0xd6bd('0x69')]}});}return null;})[_0xd6bd('0x28')](handleEntityNotFound(_0x1b30d8,null))[_0xd6bd('0x28')](function(_0x1b1fcb){if(_0x1b1fcb){return _0x1b1fcb['update']({'UserId':_0xa0051a[_0xd6bd('0x5b')][_0xd6bd('0x65')],'read1stAt':_[_0xd6bd('0x6a')](_0x1b1fcb[_0xd6bd('0x6b')])?moment()['format'](_0xd6bd('0x64')):undefined});}return null;})[_0xd6bd('0x28')](function(_0x5f54e8){if(_0x5f54e8){_0x3d157a[_0xd6bd('0x6c')]=_0x5f54e8[_0xd6bd('0x67')]({'plain':!![]});interaction_log[_0xd6bd('0x6d')](_0xd6bd('0x6e'),_0xa0051a[_0xd6bd('0x6f')]['id'],_0xa0051a[_0xd6bd('0x6f')][_0xd6bd('0x3b')],_0xa0051a[_0xd6bd('0x6f')]['role'],_0x3d157a[_0xd6bd('0x6c')]['id'],_0xa0051a['body']?JSON[_0xd6bd('0x2b')](_0xa0051a[_0xd6bd('0x5b')]):_0xd6bd('0x70'));return respondWithRpcPromise(_0xd6bd('0x71'),_0xd6bd('0x72'),_0x3d157a);}return null;})[_0xd6bd('0x28')](function(_0x34ab96){if(_0x34ab96){if(_0xa0051a[_0xd6bd('0x5b')]['manual']){_0x3d157a[_0xd6bd('0x2e')][_0xd6bd('0x73')]=util[_0xd6bd('0x63')](_0xd6bd('0x74'),_0xa0051a[_0xd6bd('0x6f')]['name']);_0x3d157a[_0xd6bd('0x2e')][_0xd6bd('0x75')]=_0x3d157a['channel'];_0x3d157a[_0xd6bd('0x2e')]['event']=_0xd6bd('0x76');return respondWithRpcPromise('EventManager',_0xd6bd('0x77'),{'event':_0xd6bd('0x78'),'message':_0x3d157a[_0xd6bd('0x2e')]},client9002)[_0xd6bd('0x28')](function(){return _0x3d157a;});}return _0x3d157a;}return null;})['then'](respondWithResult(_0x1b30d8,null))[_0xd6bd('0x30')](handleError(_0x1b30d8,null));};var interaction_log=require(_0xd6bd('0x17'))(_0xd6bd('0x5f'));exports[_0xd6bd('0x38')]=function(_0xfe00ef,_0x524326,_0x2067dd){var _0x30afea={'agent':{},'channel':_0xd6bd('0x60')};if(_0xfe00ef['body']['id']){delete _0xfe00ef[_0xd6bd('0x5b')]['id'];}_0xfe00ef[_0xd6bd('0x5b')][_0xd6bd('0x65')]=_0xfe00ef['body'][_0xd6bd('0x65')]||_0xfe00ef['user']['id'];_0x30afea['agent']['id']=_0xfe00ef[_0xd6bd('0x5b')][_0xd6bd('0x65')];return db[_0xd6bd('0x40')][_0xd6bd('0x5c')]({'where':{'id':_0xfe00ef[_0xd6bd('0x59')]['id'],'UserId':null}})[_0xd6bd('0x28')](handleEntityNotFound(_0x524326,null))[_0xd6bd('0x28')](function(_0x4a6a43){if(_0x4a6a43){_0x30afea[_0xd6bd('0x2e')]=_0x4a6a43[_0xd6bd('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0xd6bd('0x5c')]({'where':{'id':_0x4a6a43[_0xd6bd('0x69')]}});}return null;})[_0xd6bd('0x28')](handleEntityNotFound(_0x524326,null))[_0xd6bd('0x28')](function(_0x552d8f){if(_0x552d8f){_0x30afea['interaction']=_0x552d8f[_0xd6bd('0x67')]({'plain':!![]});interaction_log[_0xd6bd('0x6d')](_0xd6bd('0x79'),_0xfe00ef['user']['id'],_0xfe00ef[_0xd6bd('0x6f')][_0xd6bd('0x3b')],_0xfe00ef[_0xd6bd('0x6f')][_0xd6bd('0x7a')],_0x30afea[_0xd6bd('0x6c')]['id'],_0xfe00ef[_0xd6bd('0x5b')]?JSON[_0xd6bd('0x2b')](_0xfe00ef['body']):_0xd6bd('0x70'));return respondWithRpcPromise('RejectMessage',_0xd6bd('0x7b'),_0x30afea);}return null;})['then'](function(_0xadf04c){if(_0xadf04c){_0xadf04c[_0xd6bd('0x2e')][_0xd6bd('0x73')]=util[_0xd6bd('0x63')](_0xd6bd('0x74'),_0xfe00ef[_0xd6bd('0x6f')][_0xd6bd('0x3b')]);_0xadf04c['message'][_0xd6bd('0x75')]=_0x30afea['channel'];_0xadf04c[_0xd6bd('0x2e')][_0xd6bd('0x7c')]=_0xd6bd('0x38');respondWithRpcPromise(_0xd6bd('0x77'),_0xd6bd('0x77'),{'event':'rejectmessage','message':_0xadf04c[_0xd6bd('0x2e')]},client9002);return _0x30afea;}return null;})[_0xd6bd('0x28')](respondWithResult(_0x524326,null))[_0xd6bd('0x30')](handleError(_0x524326,null));};exports[_0xd6bd('0x3c')]=function(_0x1dfd64,_0x2210f8,_0x573d47){if(_0x1dfd64['body']['id']){delete _0x1dfd64[_0xd6bd('0x5b')]['id'];}var _0x13a841;return db[_0xd6bd('0x40')][_0xd6bd('0x5c')]({'where':{'id':_0x1dfd64[_0xd6bd('0x59')]['id']}})['then'](handleEntityNotFound(_0x2210f8,null))['then'](function(_0x124803){if(_0x124803){_0x13a841=_0x124803;return db[_0xd6bd('0x7d')][_0xd6bd('0x5c')]({'where':{'id':_0x124803['WhatsappAccountId']}});}})[_0xd6bd('0x28')](handleEntityNotFound(_0x2210f8,null))['then'](function(_0x1bf37d){if(_0x1bf37d){logger[_0xd6bd('0x7e')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0xd6bd('0x7f'),_0x1bf37d[_0xd6bd('0x42')],util[_0xd6bd('0x80')](_0x1dfd64[_0xd6bd('0x5b')],{'showHidden':![],'depth':null}));switch(_0x1bf37d[_0xd6bd('0x42')]){case _0xd6bd('0x81'):if(_0x1dfd64[_0xd6bd('0x5b')][_0xd6bd('0x82')]&&_0x1dfd64[_0xd6bd('0x5b')]['MessageSid']===_0x13a841[_0xd6bd('0x83')]&&_0x1dfd64[_0xd6bd('0x5b')][_0xd6bd('0x84')]&&_0x1dfd64[_0xd6bd('0x5b')][_0xd6bd('0x84')]===_0xd6bd('0x61')){return _0x13a841[_0xd6bd('0x39')]({'read':!![]});}else{logger[_0xd6bd('0x2c')](_0xd6bd('0x85'),_0xd6bd('0x3c'),_0xd6bd('0x81'),util[_0xd6bd('0x80')](_0x1dfd64[_0xd6bd('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x13a841;}})[_0xd6bd('0x28')](respondWithResult(_0x2210f8,null))[_0xd6bd('0x30')](handleError(_0x2210f8,null));};
\ No newline at end of file
index 15f5680..1ad4491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x3cec34,_0x278f63){var _0x45a0cc=function(_0x25f9e8){while(--_0x25f9e8){_0x3cec34['push'](_0x3cec34['shift']());}};_0x45a0cc(++_0x278f63);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ee52f,_0x22b7c5){_0x1ee52f=_0x1ee52f-0x0;var _0x23776d=_0x5f2f[_0x1ee52f];return _0x23776d;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x210326,_0x45307c){var _0x1c44b0=function(_0x50c341){while(--_0x50c341){_0x210326['push'](_0x210326['shift']());}};_0x1c44b0(++_0x45307c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1e8a3f,_0x5315f6){_0x1e8a3f=_0x1e8a3f-0x0;var _0x33d4ea=_0x5f2f[_0x1e8a3f];return _0x33d4ea;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
index 3eb5904..496a17c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d6e=['toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','then','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','finally','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','get','direction'];(function(_0x5a7242,_0x5bc9e7){var _0x15d862=function(_0x30ea0a){while(--_0x30ea0a){_0x5a7242['push'](_0x5a7242['shift']());}};_0x15d862(++_0x5bc9e7);}(_0x2d6e,0xda));var _0xe2d6=function(_0x6bf15e,_0x31f470){_0x6bf15e=_0x6bf15e-0x0;var _0x5500ce=_0x2d6e[_0x6bf15e];return _0x5500ce;};'use strict';var _=require(_0xe2d6('0x0'));var util=require(_0xe2d6('0x1'));var logger=require(_0xe2d6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe2d6('0x3'));var rp=require(_0xe2d6('0x4'));var fs=require('fs');var path=require(_0xe2d6('0x5'));var rimraf=require(_0xe2d6('0x6'));var config=require(_0xe2d6('0x7'));var attributes=require(_0xe2d6('0x8'));module['exports']=function(_0x2e4fba,_0x605429){return _0x2e4fba[_0xe2d6('0x9')](_0xe2d6('0xa'),attributes,{'tableName':_0xe2d6('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xe2d6('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0xe2d6('0xd')],'type':_0xe2d6('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2740f6,_0x3fb1fa,_0x1090b3){var _0xf17047=_0x2e4fba['models'];var _0x5e0d8d=_0x2740f6[_0xe2d6('0xf')]({'plain':!![]});if(_0x5e0d8d[_0xe2d6('0x10')]['toLowerCase']()==='in'||_0x5e0d8d[_0xe2d6('0x10')][_0xe2d6('0x11')]()===_0xe2d6('0x12')&&!_0x5e0d8d[_0xe2d6('0x13')]&&!_['isNil'](_0x5e0d8d[_0xe2d6('0x14')])){_0xf17047[_0xe2d6('0x15')][_0xe2d6('0x16')]({'where':{'id':_0x5e0d8d[_0xe2d6('0x17')]}})['then'](function(_0x4d2943){if(_0x4d2943){_0x4d2943[_0xe2d6('0x18')]({'lastMsgAt':_0x5e0d8d[_0xe2d6('0x19')],'lastMsgDirection':_0x5e0d8d[_0xe2d6('0x10')][_0xe2d6('0x11')]()});}})[_0xe2d6('0x1a')](function(_0x1c2647){console[_0xe2d6('0x1b')](_0x1c2647);});}if(_0x5e0d8d[_0xe2d6('0x10')]===_0xe2d6('0x12')&&!_0x5e0d8d['secret']){var _0x198e24;_0xf17047[_0xe2d6('0x1c')][_0xe2d6('0x1d')]({'where':{'id':_0x5e0d8d['WhatsappAccountId']},'raw':!![]})[_0xe2d6('0x1e')](function(_0xdf53cb){_0x198e24=_0xdf53cb;if(_0x198e24&&_0x198e24[_0xe2d6('0x1f')]){switch(_0x198e24[_0xe2d6('0x1f')]){case _0xe2d6('0x20'):var _0x2b1a61=require(_0xe2d6('0x20'));if(_0x198e24[_0xe2d6('0x21')]&&_0x198e24[_0xe2d6('0x22')]&&_0x198e24['phone']){var _0xd68f5d=new _0x2b1a61(_0x198e24['accountSid'],_0x198e24['authToken']);_0xd68f5d[_0xe2d6('0x23')][_0xe2d6('0x24')]({'body':_0x5e0d8d[_0xe2d6('0xd')],'to':_0xe2d6('0x25')+_0x5e0d8d[_0xe2d6('0x26')],'from':'whatsapp:'+_0x198e24[_0xe2d6('0x26')],'statusCallback':_0x198e24['remote']+_0xe2d6('0x27')+_0x5e0d8d['id']+_0xe2d6('0x28')+_0x198e24[_0xe2d6('0x29')]})['then'](function(_0x38eb75){if(_0x38eb75[_0xe2d6('0x2a')]){return _0x2740f6[_0xe2d6('0x18')]({'messageId':_0x38eb75[_0xe2d6('0x2a')]});}})[_0xe2d6('0x1a')](function(_0x597787){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe2d6('0x20'),util['inspect'](_0x597787,{'showHidden':![],'depth':null}));});}else{logger[_0xe2d6('0x1b')](_0xe2d6('0x2b'),_0xe2d6('0x2c'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0xe2d6('0x2d')](function(){_0x1090b3();});}else{_0x1090b3();}}},'charset':_0xe2d6('0x2e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7f22=['UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','authToken','phone','accountSid','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','whatsapp_messages','messageId','body','FULLTEXT','get','direction','toLowerCase','out','secret'];(function(_0x445b99,_0x484fda){var _0x4de4f1=function(_0x36bdee){while(--_0x36bdee){_0x445b99['push'](_0x445b99['shift']());}};_0x4de4f1(++_0x484fda);}(_0x7f22,0x72));var _0x27f2=function(_0x3db747,_0x12e007){_0x3db747=_0x3db747-0x0;var _0x23d242=_0x7f22[_0x3db747];return _0x23d242;};'use strict';var _=require(_0x27f2('0x0'));var util=require('util');var logger=require(_0x27f2('0x1'))('api');var moment=require(_0x27f2('0x2'));var BPromise=require(_0x27f2('0x3'));var rp=require(_0x27f2('0x4'));var fs=require('fs');var path=require(_0x27f2('0x5'));var rimraf=require(_0x27f2('0x6'));var config=require(_0x27f2('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x27f2('0x8')]=function(_0x183b23,_0x22800e){return _0x183b23['define']('WhatsappMessage',attributes,{'tableName':_0x27f2('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x27f2('0xa')]},{'name':'fti_whatsapp_messages','fields':[_0x27f2('0xb')],'type':_0x27f2('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x262152,_0x51d89e,_0x136df9){var _0x2c066b=_0x183b23['models'];var _0x34be35=_0x262152[_0x27f2('0xd')]({'plain':!![]});if(_0x34be35[_0x27f2('0xe')][_0x27f2('0xf')]()==='in'||_0x34be35[_0x27f2('0xe')][_0x27f2('0xf')]()===_0x27f2('0x10')&&!_0x34be35[_0x27f2('0x11')]&&!_['isNil'](_0x34be35[_0x27f2('0x12')])){_0x2c066b['WhatsappInteraction'][_0x27f2('0x13')]({'where':{'id':_0x34be35[_0x27f2('0x14')]}})[_0x27f2('0x15')](function(_0x385286){if(_0x385286){_0x385286[_0x27f2('0x16')]({'lastMsgAt':_0x34be35[_0x27f2('0x17')],'lastMsgDirection':_0x34be35[_0x27f2('0xe')][_0x27f2('0xf')]()});}})[_0x27f2('0x18')](function(_0x18f0ea){console[_0x27f2('0x19')](_0x18f0ea);});}if(_0x34be35[_0x27f2('0xe')]===_0x27f2('0x10')&&!_0x34be35['secret']){var _0x29263a;_0x2c066b[_0x27f2('0x1a')]['find']({'where':{'id':_0x34be35[_0x27f2('0x1b')]},'raw':!![]})[_0x27f2('0x15')](function(_0x2f965c){_0x29263a=_0x2f965c;if(_0x29263a&&_0x29263a[_0x27f2('0x1c')]){switch(_0x29263a[_0x27f2('0x1c')]){case _0x27f2('0x1d'):var _0x341ac0=require(_0x27f2('0x1d'));if(_0x29263a['accountSid']&&_0x29263a[_0x27f2('0x1e')]&&_0x29263a[_0x27f2('0x1f')]){var _0x353ceb=new _0x341ac0(_0x29263a[_0x27f2('0x20')],_0x29263a[_0x27f2('0x1e')]);_0x353ceb['messages'][_0x27f2('0x21')]({'body':_0x34be35[_0x27f2('0xb')],'to':'whatsapp:'+_0x34be35['phone'],'from':_0x27f2('0x22')+_0x29263a[_0x27f2('0x1f')],'statusCallback':_0x29263a['remote']+_0x27f2('0x23')+_0x34be35['id']+_0x27f2('0x24')+_0x29263a[_0x27f2('0x25')]})[_0x27f2('0x15')](function(_0x325c33){if(_0x325c33['sid']){return _0x262152['update']({'messageId':_0x325c33[_0x27f2('0x26')]});}})[_0x27f2('0x18')](function(_0xa8f35c){logger[_0x27f2('0x19')](_0x27f2('0x27'),_0x27f2('0x28'),_0x27f2('0x1d'),util['inspect'](_0xa8f35c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x27f2('0x27'),_0x27f2('0x28'),'twilio',_0x27f2('0x29'));}break;}}})[_0x27f2('0x2a')](function(){_0x136df9();});}else{_0x136df9();}}},'charset':_0x27f2('0x2b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d6fb296..1f79939 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1da9=['./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5529d3,_0x584936){var _0x33f352=function(_0x5f3ef8){while(--_0x5f3ef8){_0x5529d3['push'](_0x5529d3['shift']());}};_0x33f352(++_0x584936);}(_0x1da9,0x1d3));var _0x91da=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x1da9[_0x42245d];return _0x4b211a;};'use strict';var _=require('lodash');var util=require(_0x91da('0x0'));var moment=require('moment');var BPromise=require(_0x91da('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91da('0x2'));var db=require(_0x91da('0x3'))['db'];var utils=require(_0x91da('0x4'));var logger=require(_0x91da('0x5'))('rpc');var config=require(_0x91da('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x91da('0x7')][_0x91da('0x8')]({'port':0x232a});config[_0x91da('0x9')]=_[_0x91da('0xa')](config[_0x91da('0x9')],{'host':_0x91da('0xb'),'port':0x18eb});var socket=require(_0x91da('0xc'))(new Redis(config[_0x91da('0x9')]));require(_0x91da('0xd'))[_0x91da('0xe')](socket);function respondWithRpcPromise(_0x363fbd,_0xfae903,_0x4d29a3){return new BPromise(function(_0x4c54a9,_0x298575){return client[_0x91da('0xf')](_0x363fbd,_0x4d29a3)[_0x91da('0x10')](function(_0xc9d1d6){logger[_0x91da('0x11')](_0x91da('0x12'),_0xfae903,_0x91da('0x13'));logger[_0x91da('0x14')](_0x91da('0x15'),_0xfae903,'request\x20sent',JSON[_0x91da('0x16')](_0xc9d1d6));if(_0xc9d1d6[_0x91da('0x17')]){if(_0xc9d1d6['error'][_0x91da('0x18')]===0x1f4){logger[_0x91da('0x17')](_0x91da('0x12'),_0xfae903,_0xc9d1d6[_0x91da('0x17')][_0x91da('0x19')]);return _0x298575(_0xc9d1d6[_0x91da('0x17')][_0x91da('0x19')]);}logger[_0x91da('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0xfae903,_0xc9d1d6[_0x91da('0x17')][_0x91da('0x19')]);return _0x4c54a9(_0xc9d1d6[_0x91da('0x17')][_0x91da('0x19')]);}else{logger[_0x91da('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0xfae903,'request\x20sent');_0x4c54a9(_0xc9d1d6['result']['message']);}})[_0x91da('0x1a')](function(_0x549427){logger['error'](_0x91da('0x12'),_0xfae903,_0x549427);_0x298575(_0x549427);});});}exports[_0x91da('0x1b')]=function(_0x4cf4a7){var _0x15b03a=this;return new Promise(function(_0xe84e4e,_0x3c35ee){return db[_0x91da('0x1c')]['create'](_0x4cf4a7[_0x91da('0x1d')],{'raw':_0x4cf4a7[_0x91da('0x1e')]?_0x4cf4a7[_0x91da('0x1e')][_0x91da('0x1f')]===undefined?!![]:![]:!![]})[_0x91da('0x10')](function(_0x1366f5){logger[_0x91da('0x11')](_0x91da('0x1b'),_0x4cf4a7);logger[_0x91da('0x14')](_0x91da('0x1b'),_0x4cf4a7,JSON[_0x91da('0x16')](_0x1366f5));_0xe84e4e(_0x1366f5);})[_0x91da('0x1a')](function(_0x383bd2){logger[_0x91da('0x17')]('CreateWhatsappMessage',_0x383bd2[_0x91da('0x19')],_0x4cf4a7);_0x3c35ee(_0x15b03a[_0x91da('0x17')](0x1f4,_0x383bd2[_0x91da('0x19')]));});});};
\ No newline at end of file
+var _0x0555=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','info','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','create','options','then','CreateWhatsappMessage','debug'];(function(_0xc66c50,_0x4dfbc1){var _0x48bc6f=function(_0x781d40){while(--_0x781d40){_0xc66c50['push'](_0xc66c50['shift']());}};_0x48bc6f(++_0x4dfbc1);}(_0x0555,0x84));var _0x5055=function(_0x6b4190,_0x4702bf){_0x6b4190=_0x6b4190-0x0;var _0x50e035=_0x0555[_0x6b4190];return _0x50e035;};'use strict';var _=require(_0x5055('0x0'));var util=require(_0x5055('0x1'));var moment=require(_0x5055('0x2'));var BPromise=require(_0x5055('0x3'));var rs=require(_0x5055('0x4'));var fs=require('fs');var Redis=require(_0x5055('0x5'));var db=require(_0x5055('0x6'))['db'];var utils=require(_0x5055('0x7'));var logger=require(_0x5055('0x8'))(_0x5055('0x9'));var config=require(_0x5055('0xa'));var jayson=require(_0x5055('0xb'));var client=jayson[_0x5055('0xc')][_0x5055('0xd')]({'port':0x232a});config[_0x5055('0xe')]=_[_0x5055('0xf')](config[_0x5055('0xe')],{'host':_0x5055('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5055('0xe')]));require('./whatsappMessage.socket')[_0x5055('0x11')](socket);function respondWithRpcPromise(_0x344a62,_0x2ac211,_0x253179){return new BPromise(function(_0x2847dd,_0x5662e3){return client[_0x5055('0x12')](_0x344a62,_0x253179)['then'](function(_0x2667e6){logger[_0x5055('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x2ac211,_0x5055('0x14'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2ac211,_0x5055('0x14'),JSON[_0x5055('0x15')](_0x2667e6));if(_0x2667e6['error']){if(_0x2667e6[_0x5055('0x16')][_0x5055('0x17')]===0x1f4){logger[_0x5055('0x16')](_0x5055('0x18'),_0x2ac211,_0x2667e6[_0x5055('0x16')]['message']);return _0x5662e3(_0x2667e6[_0x5055('0x16')][_0x5055('0x19')]);}logger[_0x5055('0x16')](_0x5055('0x18'),_0x2ac211,_0x2667e6[_0x5055('0x16')]['message']);return _0x2847dd(_0x2667e6['error'][_0x5055('0x19')]);}else{logger['info'](_0x5055('0x18'),_0x2ac211,_0x5055('0x14'));_0x2847dd(_0x2667e6[_0x5055('0x1a')][_0x5055('0x19')]);}})[_0x5055('0x1b')](function(_0x39ff96){logger[_0x5055('0x16')](_0x5055('0x18'),_0x2ac211,_0x39ff96);_0x5662e3(_0x39ff96);});});}exports['CreateWhatsappMessage']=function(_0x38d9db){var _0x59ce55=this;return new Promise(function(_0x4a92bd,_0x241c9f){return db['WhatsappMessage'][_0x5055('0x1c')](_0x38d9db['body'],{'raw':_0x38d9db[_0x5055('0x1d')]?_0x38d9db[_0x5055('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x5055('0x1e')](function(_0x24b695){logger['info'](_0x5055('0x1f'),_0x38d9db);logger[_0x5055('0x20')](_0x5055('0x1f'),_0x38d9db,JSON[_0x5055('0x15')](_0x24b695));_0x4a92bd(_0x24b695);})['catch'](function(_0x41f6c3){logger[_0x5055('0x16')]('CreateWhatsappMessage',_0x41f6c3['message'],_0x38d9db);_0x241c9f(_0x59ce55[_0x5055('0x16')](0x1f4,_0x41f6c3[_0x5055('0x19')]));});});};
\ No newline at end of file
index ca54885..1d841e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70df=['length','whatsappMessage:','update','emit'];(function(_0x214b96,_0x36b1fa){var _0x13e97e=function(_0x41c88a){while(--_0x41c88a){_0x214b96['push'](_0x214b96['shift']());}};_0x13e97e(++_0x36b1fa);}(_0x70df,0xea));var _0xf70d=function(_0x2d723b,_0x3af7d1){_0x2d723b=_0x2d723b-0x0;var _0x4ff9bd=_0x70df[_0x2d723b];return _0x4ff9bd;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save','remove',_0xf70d('0x0')];function createListener(_0x43e736,_0x590648){return function(_0x1c2c57){_0x590648[_0xf70d('0x1')](_0x43e736,_0x1c2c57);};}function removeListener(_0x1075e7,_0x1c8b27){return function(){WhatsappMessageEvents['removeListener'](_0x1075e7,_0x1c8b27);};}exports['register']=function(_0x1b8656){for(var _0x3e25ce=0x0,_0x349020=events[_0xf70d('0x2')];_0x3e25ce<_0x349020;_0x3e25ce++){var _0x3a56e7=events[_0x3e25ce];var _0x2012e4=createListener(_0xf70d('0x3')+_0x3a56e7,_0x1b8656);WhatsappMessageEvents['on'](_0x3a56e7,_0x2012e4);}};
\ No newline at end of file
+var _0xc418=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc418,0xd9));var _0x8c41=function(_0x5b70ff,_0x19e63c){_0x5b70ff=_0x5b70ff-0x0;var _0x2755d3=_0xc418[_0x5b70ff];return _0x2755d3;};'use strict';var WhatsappMessageEvents=require(_0x8c41('0x0'));var events=[_0x8c41('0x1'),_0x8c41('0x2'),_0x8c41('0x3')];function createListener(_0x1b3f85,_0x218800){return function(_0xd10d2d){_0x218800[_0x8c41('0x4')](_0x1b3f85,_0xd10d2d);};}function removeListener(_0x4a0c2f,_0x41aa83){return function(){WhatsappMessageEvents[_0x8c41('0x5')](_0x4a0c2f,_0x41aa83);};}exports[_0x8c41('0x6')]=function(_0x141a52){for(var _0x4b5e4e=0x0,_0x1f2c94=events[_0x8c41('0x7')];_0x4b5e4e<_0x1f2c94;_0x4b5e4e++){var _0x1b7652=events[_0x4b5e4e];var _0x674f5a=createListener(_0x8c41('0x8')+_0x1b7652,_0x141a52);WhatsappMessageEvents['on'](_0x1b7652,_0x674f5a);}};
\ No newline at end of file
index 1499ebc..8065e54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb459=['Router','../../components/auth/service','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','/:id','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout'];(function(_0x3e3c6c,_0x2ef801){var _0x3a9cf8=function(_0x392081){while(--_0x392081){_0x3e3c6c['push'](_0x3e3c6c['shift']());}};_0x3a9cf8(++_0x2ef801);}(_0xb459,0x110));var _0x9b45=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xb459[_0x247fa1];return _0x244f35;};'use strict';var multer=require(_0x9b45('0x0'));var util=require('util');var path=require(_0x9b45('0x1'));var timeout=require(_0x9b45('0x2'));var express=require('express');var router=express[_0x9b45('0x3')]();var auth=require(_0x9b45('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9b45('0x5'));router[_0x9b45('0x6')]('/',auth['isAuthenticated'](),controller[_0x9b45('0x7')]);router['get'](_0x9b45('0x8'),auth[_0x9b45('0x9')](),controller[_0x9b45('0xa')]);router[_0x9b45('0x6')]('/:id',auth[_0x9b45('0x9')](),controller['show']);router[_0x9b45('0x6')]('/:id/members',auth[_0x9b45('0x9')](),controller['getMembers']);router[_0x9b45('0x6')](_0x9b45('0xb'),auth[_0x9b45('0x9')](),controller[_0x9b45('0xc')]);router[_0x9b45('0x6')](_0x9b45('0xd'),auth[_0x9b45('0x9')](),controller[_0x9b45('0xe')]);router['post']('/',auth[_0x9b45('0x9')](),controller[_0x9b45('0xf')]);router[_0x9b45('0x10')](_0x9b45('0xb'),auth['isAuthenticated'](),controller[_0x9b45('0x11')]);router[_0x9b45('0x10')](_0x9b45('0xd'),auth['isAuthenticated'](),controller[_0x9b45('0x12')]);router['put'](_0x9b45('0x13'),auth[_0x9b45('0x9')](),controller['update']);router[_0x9b45('0x14')]('/:id',auth[_0x9b45('0x9')](),controller[_0x9b45('0x15')]);router[_0x9b45('0x14')](_0x9b45('0xb'),auth[_0x9b45('0x9')](),controller[_0x9b45('0x16')]);router['delete'](_0x9b45('0xd'),auth[_0x9b45('0x9')](),controller[_0x9b45('0x17')]);module[_0x9b45('0x18')]=router;
\ No newline at end of file
+var _0xe4a4=['/:id/users','addAgents','put','update','delete','removeTeams','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getAgents','create','post'];(function(_0x4bbfee,_0x5bc430){var _0x36c7b4=function(_0x4b6c27){while(--_0x4b6c27){_0x4bbfee['push'](_0x4bbfee['shift']());}};_0x36c7b4(++_0x5bc430);}(_0xe4a4,0x1e6));var _0x4e4a=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0xe4a4[_0x575b72];return _0x561c57;};'use strict';var multer=require('multer');var util=require(_0x4e4a('0x0'));var path=require(_0x4e4a('0x1'));var timeout=require('connect-timeout');var express=require(_0x4e4a('0x2'));var router=express[_0x4e4a('0x3')]();var auth=require(_0x4e4a('0x4'));var interaction=require(_0x4e4a('0x5'));var config=require('../../config/environment');var controller=require(_0x4e4a('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4e4a('0x7')](_0x4e4a('0x8'),auth[_0x4e4a('0x9')](),controller[_0x4e4a('0xa')]);router[_0x4e4a('0x7')](_0x4e4a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4e4a('0x7')](_0x4e4a('0xc'),auth[_0x4e4a('0x9')](),controller[_0x4e4a('0xd')]);router[_0x4e4a('0x7')](_0x4e4a('0xe'),auth[_0x4e4a('0x9')](),controller['getTeams']);router['get']('/:id/users',auth[_0x4e4a('0x9')](),controller[_0x4e4a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4e4a('0x10')]);router[_0x4e4a('0x11')](_0x4e4a('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0x4e4a('0x11')](_0x4e4a('0x12'),auth['isAuthenticated'](),controller[_0x4e4a('0x13')]);router[_0x4e4a('0x14')]('/:id',auth[_0x4e4a('0x9')](),controller[_0x4e4a('0x15')]);router[_0x4e4a('0x16')](_0x4e4a('0xb'),auth[_0x4e4a('0x9')](),controller['destroy']);router[_0x4e4a('0x16')](_0x4e4a('0xe'),auth['isAuthenticated'](),controller[_0x4e4a('0x17')]);router[_0x4e4a('0x16')](_0x4e4a('0x12'),auth[_0x4e4a('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index a162f8a..55bc4be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd15f=['beepall','roundrobin','STRING','INTEGER','rrmemory'];(function(_0x3a175b,_0x505d13){var _0x9b84fa=function(_0x5533e1){while(--_0x5533e1){_0x3a175b['push'](_0x3a175b['shift']());}};_0x9b84fa(++_0x505d13);}(_0xd15f,0x12a));var _0xfd15=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0xd15f[_0xdbe2de];return _0x2facd7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfd15('0x0')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xfd15('0x1'),_0xfd15('0x2'),_0xfd15('0x3'))},'description':{'type':Sequelize[_0xfd15('0x4')]}};
\ No newline at end of file
+var _0x94f3=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x4f36cc,_0x4c83ec){var _0x232c29=function(_0x5a07e9){while(--_0x5a07e9){_0x4f36cc['push'](_0x4f36cc['shift']());}};_0x232c29(++_0x4c83ec);}(_0x94f3,0x119));var _0x394f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x94f3[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x394f('0x0')]={'name':{'type':Sequelize[_0x394f('0x1')],'unique':_0x394f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x394f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x394f('0x4')](_0x394f('0x5'),_0x394f('0x6'),_0x394f('0x7'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ee74ce8..a90f0dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccc2=['forEach','emit','userWhatsappQueue:save','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','includes','union','compact','value','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','WhatsappQueues','UserProfileResource','error','stack','name','send','index','WhatsappQueue','rawAttributes','model','map','query','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','options','count','includeAll','include','findAll','rows','catch','show','keys','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','UserWhatsappQueue','order','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','User','Agents','flatMap','transaction','findOrCreate'];(function(_0xd0f2a2,_0x3758e9){var _0x28f474=function(_0xfb783d){while(--_0xfb783d){_0xd0f2a2['push'](_0xd0f2a2['shift']());}};_0x28f474(++_0x3758e9);}(_0xccc2,0xa2));var _0x2ccc=function(_0x5ed32c,_0x956025){_0x5ed32c=_0x5ed32c-0x0;var _0x271ea3=_0xccc2[_0x5ed32c];return _0x271ea3;};'use strict';var pdf=require(_0x2ccc('0x0'));var emlformat=require(_0x2ccc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2ccc('0x2'));var jsonpatch=require(_0x2ccc('0x3'));var rp=require(_0x2ccc('0x4'));var moment=require('moment');var BPromise=require(_0x2ccc('0x5'));var Mustache=require(_0x2ccc('0x6'));var util=require('util');var path=require(_0x2ccc('0x7'));var sox=require(_0x2ccc('0x8'));var csv=require(_0x2ccc('0x9'));var ejs=require(_0x2ccc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2ccc('0xb'));var crypto=require(_0x2ccc('0xc'));var jsforce=require(_0x2ccc('0xd'));var deskjs=require(_0x2ccc('0xe'));var toCsv=require(_0x2ccc('0x9'));var querystring=require('querystring');var Papa=require(_0x2ccc('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2ccc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ccc('0x11'));var logger=require(_0x2ccc('0x12'))(_0x2ccc('0x13'));var utils=require('../../config/utils');var config=require(_0x2ccc('0x14'));var db=require('../../mysqldb')['db'];config[_0x2ccc('0x15')]=_[_0x2ccc('0x16')](config[_0x2ccc('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ccc('0x15')]));require(_0x2ccc('0x17'))[_0x2ccc('0x18')](socket);function respondWithStatusCode(_0x4635ed,_0x3949c2){_0x3949c2=_0x3949c2||0xcc;return function(_0x5d52f5){if(_0x5d52f5){return _0x4635ed[_0x2ccc('0x19')](_0x3949c2);}return _0x4635ed[_0x2ccc('0x1a')](_0x3949c2)[_0x2ccc('0x1b')]();};}function respondWithResult(_0x28a199,_0x39d228){_0x39d228=_0x39d228||0xc8;return function(_0x282359){if(_0x282359){return _0x28a199['status'](_0x39d228)[_0x2ccc('0x1c')](_0x282359);}};}function respondWithFilteredResult(_0x4003c3,_0x30b131){return function(_0xe28918){if(_0xe28918){var _0x395691=_0xe28918['count'],_0x1a3db7=_0x30b131[_0x2ccc('0x1d')],_0x2252d4=_0x30b131['offset']+_0x30b131[_0x2ccc('0x1e')],_0x12c7ed;if(_0x2252d4>=_0x395691){_0x2252d4=_0x395691;_0x12c7ed=0xc8;}else{_0x12c7ed=0xce;}_0x4003c3['status'](_0x12c7ed);return _0x4003c3[_0x2ccc('0x1f')](_0x2ccc('0x20'),_0x1a3db7+'-'+_0x2252d4+'/'+_0x395691)['json'](_0xe28918);}return null;};}function patchUpdates(_0xef4ae5){return function(_0x317a9e){try{jsonpatch[_0x2ccc('0x21')](_0x317a9e,_0xef4ae5,!![]);}catch(_0x4d3b7b){return BPromise[_0x2ccc('0x22')](_0x4d3b7b);}return _0x317a9e[_0x2ccc('0x23')]();};}function saveUpdates(_0x4ad2af,_0x50ad6e){return function(_0x4c7897){if(_0x4c7897){return _0x4c7897['update'](_0x4ad2af)[_0x2ccc('0x24')](function(_0x2d76f7){return _0x2d76f7;});}return null;};}function removeEntity(_0x145444,_0x5d739f){return function(_0x4f8bdf){if(_0x4f8bdf){return _0x4f8bdf[_0x2ccc('0x25')]()[_0x2ccc('0x24')](function(){var _0x46ea3f=_0x4f8bdf['get']({'plain':!![]});var _0x190bd6=_0x2ccc('0x26');return db[_0x2ccc('0x27')]['destroy']({'where':{'type':_0x190bd6,'resourceId':_0x46ea3f['id']}})[_0x2ccc('0x24')](function(){return _0x4f8bdf;});})['then'](function(){_0x145444[_0x2ccc('0x1a')](0xcc)[_0x2ccc('0x1b')]();});}};}function handleEntityNotFound(_0x222327,_0x4dca2f){return function(_0x5b69ff){if(!_0x5b69ff){_0x222327[_0x2ccc('0x19')](0x194);}return _0x5b69ff;};}function handleError(_0x5119e0,_0x161d39){_0x161d39=_0x161d39||0x1f4;return function(_0x84f1ef){logger[_0x2ccc('0x28')](_0x84f1ef[_0x2ccc('0x29')]);if(_0x84f1ef[_0x2ccc('0x2a')]){delete _0x84f1ef['name'];}_0x5119e0[_0x2ccc('0x1a')](_0x161d39)[_0x2ccc('0x2b')](_0x84f1ef);};}exports[_0x2ccc('0x2c')]=function(_0x1fed9b,_0x104122){var _0x27af25={},_0x3083e0={},_0x3f8c6f={'count':0x0,'rows':[]};var _0x58f0ff=_['map'](db[_0x2ccc('0x2d')][_0x2ccc('0x2e')],function(_0x72695d){return{'name':_0x72695d['fieldName'],'type':_0x72695d['type']['key']};});_0x3083e0[_0x2ccc('0x2f')]=_[_0x2ccc('0x30')](_0x58f0ff,_0x2ccc('0x2a'));_0x3083e0[_0x2ccc('0x31')]=_['keys'](_0x1fed9b[_0x2ccc('0x31')]);_0x3083e0['filters']=_[_0x2ccc('0x32')](_0x3083e0['model'],_0x3083e0[_0x2ccc('0x31')]);_0x27af25[_0x2ccc('0x33')]=_[_0x2ccc('0x32')](_0x3083e0['model'],qs['fields'](_0x1fed9b['query']['fields']));_0x27af25[_0x2ccc('0x33')]=_0x27af25[_0x2ccc('0x33')][_0x2ccc('0x34')]?_0x27af25[_0x2ccc('0x33')]:_0x3083e0['model'];if(!_0x1fed9b[_0x2ccc('0x31')][_0x2ccc('0x35')](_0x2ccc('0x36'))){_0x27af25[_0x2ccc('0x1e')]=qs[_0x2ccc('0x1e')](_0x1fed9b[_0x2ccc('0x31')][_0x2ccc('0x1e')]);_0x27af25['offset']=qs[_0x2ccc('0x1d')](_0x1fed9b[_0x2ccc('0x31')]['offset']);}_0x27af25['order']=qs[_0x2ccc('0x37')](_0x1fed9b[_0x2ccc('0x31')][_0x2ccc('0x37')]);_0x27af25[_0x2ccc('0x38')]=qs['filters'](_[_0x2ccc('0x39')](_0x1fed9b[_0x2ccc('0x31')],_0x3083e0[_0x2ccc('0x3a')]),_0x58f0ff);if(_0x1fed9b[_0x2ccc('0x31')][_0x2ccc('0x3b')]){_0x27af25[_0x2ccc('0x38')]=_[_0x2ccc('0x3c')](_0x27af25[_0x2ccc('0x38')],{'$or':_[_0x2ccc('0x30')](_0x58f0ff,function(_0xc91926){if(_0xc91926[_0x2ccc('0x3d')]!=='VIRTUAL'){var _0x192661={};_0x192661[_0xc91926['name']]={'$like':'%'+_0x1fed9b[_0x2ccc('0x31')][_0x2ccc('0x3b')]+'%'};return _0x192661;}})});}_0x27af25=_[_0x2ccc('0x3c')]({},_0x27af25,_0x1fed9b[_0x2ccc('0x3e')]);var _0x16f864={'where':_0x27af25[_0x2ccc('0x38')]};return db[_0x2ccc('0x2d')]['count'](_0x16f864)[_0x2ccc('0x24')](function(_0x48e3fb){_0x3f8c6f[_0x2ccc('0x3f')]=_0x48e3fb;if(_0x1fed9b[_0x2ccc('0x31')][_0x2ccc('0x40')]){_0x27af25[_0x2ccc('0x41')]=[{'all':!![]}];}return db[_0x2ccc('0x2d')][_0x2ccc('0x42')](_0x27af25);})[_0x2ccc('0x24')](function(_0x33b96a){_0x3f8c6f[_0x2ccc('0x43')]=_0x33b96a;return _0x3f8c6f;})[_0x2ccc('0x24')](respondWithFilteredResult(_0x104122,_0x27af25))[_0x2ccc('0x44')](handleError(_0x104122,null));};exports[_0x2ccc('0x45')]=function(_0xfdb331,_0x146832){var _0x188968={'raw':!![],'where':{'id':_0xfdb331['params']['id']}},_0x3946ca={};_0x3946ca[_0x2ccc('0x2f')]=_[_0x2ccc('0x46')](db[_0x2ccc('0x2d')][_0x2ccc('0x2e')]);_0x3946ca[_0x2ccc('0x31')]=_[_0x2ccc('0x46')](_0xfdb331[_0x2ccc('0x31')]);_0x3946ca[_0x2ccc('0x3a')]=_[_0x2ccc('0x32')](_0x3946ca[_0x2ccc('0x2f')],_0x3946ca[_0x2ccc('0x31')]);_0x188968[_0x2ccc('0x33')]=_[_0x2ccc('0x32')](_0x3946ca[_0x2ccc('0x2f')],qs[_0x2ccc('0x47')](_0xfdb331[_0x2ccc('0x31')]['fields']));_0x188968[_0x2ccc('0x33')]=_0x188968['attributes'][_0x2ccc('0x34')]?_0x188968[_0x2ccc('0x33')]:_0x3946ca['model'];if(_0xfdb331[_0x2ccc('0x31')][_0x2ccc('0x40')]){_0x188968['include']=[{'all':!![]}];}_0x188968=_[_0x2ccc('0x3c')]({},_0x188968,_0xfdb331[_0x2ccc('0x3e')]);return db[_0x2ccc('0x2d')][_0x2ccc('0x48')](_0x188968)[_0x2ccc('0x24')](handleEntityNotFound(_0x146832,null))[_0x2ccc('0x24')](respondWithResult(_0x146832,null))[_0x2ccc('0x44')](handleError(_0x146832,null));};exports['create']=function(_0x3eb4be,_0x55a805){return db['WhatsappQueue'][_0x2ccc('0x49')](_0x3eb4be[_0x2ccc('0x4a')],{})[_0x2ccc('0x24')](function(_0x5ba47e){var _0x143921=_0x3eb4be[_0x2ccc('0x4b')][_0x2ccc('0x4c')]({'plain':!![]});if(!_0x143921)throw new Error(_0x2ccc('0x4d'));if(_0x143921[_0x2ccc('0x4e')]===_0x2ccc('0x4b')){var _0x11e9aa=_0x5ba47e[_0x2ccc('0x4c')]({'plain':!![]});var _0x851aa0=_0x2ccc('0x26');return db[_0x2ccc('0x4f')][_0x2ccc('0x48')]({'where':{'name':_0x851aa0,'userProfileId':_0x143921[_0x2ccc('0x50')]},'raw':!![]})[_0x2ccc('0x24')](function(_0x4e9e2f){if(_0x4e9e2f&&_0x4e9e2f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x11e9aa[_0x2ccc('0x2a')],'resourceId':_0x11e9aa['id'],'type':_0x4e9e2f['name'],'sectionId':_0x4e9e2f['id']},{})[_0x2ccc('0x24')](function(){return _0x5ba47e;});}else{return _0x5ba47e;}})[_0x2ccc('0x44')](function(_0x41d226){logger[_0x2ccc('0x28')](_0x2ccc('0x51'),_0x41d226);throw _0x41d226;});}return _0x5ba47e;})[_0x2ccc('0x24')](respondWithResult(_0x55a805,0xc9))[_0x2ccc('0x44')](handleError(_0x55a805,null));};exports[_0x2ccc('0x52')]=function(_0x1e45a2,_0x11362c){if(_0x1e45a2['body']['id']){delete _0x1e45a2[_0x2ccc('0x4a')]['id'];}return db[_0x2ccc('0x2d')][_0x2ccc('0x48')]({'where':{'id':_0x1e45a2[_0x2ccc('0x53')]['id']}})['then'](handleEntityNotFound(_0x11362c,null))['then'](saveUpdates(_0x1e45a2['body'],null))['then'](respondWithResult(_0x11362c,null))['catch'](handleError(_0x11362c,null));};exports[_0x2ccc('0x25')]=function(_0x32fa8d,_0x5a12a6){return db[_0x2ccc('0x2d')][_0x2ccc('0x48')]({'where':{'id':_0x32fa8d[_0x2ccc('0x53')]['id']}})[_0x2ccc('0x24')](handleEntityNotFound(_0x5a12a6,null))[_0x2ccc('0x24')](removeEntity(_0x5a12a6,null))['catch'](handleError(_0x5a12a6,null));};exports['describe']=function(_0x1f1781,_0x2afe38){return db[_0x2ccc('0x2d')][_0x2ccc('0x54')]()['then'](respondWithResult(_0x2afe38,null))['catch'](handleError(_0x2afe38,null));};exports['getMembers']=function(_0x3c7e95,_0x5d66e4,_0x459fe2){var _0x1a0476={'raw':!![],'where':{}},_0x33a83e={},_0x332967;return db[_0x2ccc('0x2d')]['findOne']({'where':{'id':_0x3c7e95['params']['id']}})[_0x2ccc('0x24')](handleEntityNotFound(_0x5d66e4,null))[_0x2ccc('0x24')](function(_0x237732){if(_0x237732){_0x332967=_0x237732[_0x2ccc('0x4c')]({'plain':!![]});_0x33a83e[_0x2ccc('0x2f')]=_['keys'](db[_0x2ccc('0x55')][_0x2ccc('0x2e')]);_0x33a83e[_0x2ccc('0x31')]=_['keys'](_0x3c7e95[_0x2ccc('0x31')]);_0x33a83e['filters']=_[_0x2ccc('0x32')](_0x33a83e[_0x2ccc('0x2f')],_0x33a83e[_0x2ccc('0x31')]);_0x1a0476[_0x2ccc('0x33')]=_[_0x2ccc('0x32')](_0x33a83e[_0x2ccc('0x2f')],qs[_0x2ccc('0x47')](_0x3c7e95[_0x2ccc('0x31')][_0x2ccc('0x47')]));_0x1a0476[_0x2ccc('0x33')]=_0x1a0476[_0x2ccc('0x33')][_0x2ccc('0x34')]?_0x1a0476[_0x2ccc('0x33')]:_0x33a83e[_0x2ccc('0x2f')];if(!_0x3c7e95['query'][_0x2ccc('0x35')](_0x2ccc('0x36'))){_0x1a0476[_0x2ccc('0x1e')]=qs[_0x2ccc('0x1e')](_0x3c7e95[_0x2ccc('0x31')][_0x2ccc('0x1e')]);_0x1a0476[_0x2ccc('0x1d')]=qs[_0x2ccc('0x1d')](_0x3c7e95['query'][_0x2ccc('0x1d')]);}_0x1a0476[_0x2ccc('0x56')]=qs[_0x2ccc('0x37')](_0x3c7e95[_0x2ccc('0x31')][_0x2ccc('0x37')]);_0x1a0476[_0x2ccc('0x38')]=qs[_0x2ccc('0x3a')](_[_0x2ccc('0x39')](_0x3c7e95[_0x2ccc('0x31')],_0x33a83e['filters']));_0x1a0476[_0x2ccc('0x38')][_0x2ccc('0x57')]=_0x237732['id'];if(_0x3c7e95[_0x2ccc('0x31')]['filter']){_0x1a0476['where']=_[_0x2ccc('0x3c')](_0x1a0476['where'],{'$or':_[_0x2ccc('0x30')](_0x1a0476[_0x2ccc('0x33')],function(_0x10e6a8){var _0x18deaf={};_0x18deaf[_0x10e6a8]={'$like':'%'+_0x3c7e95[_0x2ccc('0x31')][_0x2ccc('0x3b')]+'%'};return _0x18deaf;})});}_0x1a0476=_[_0x2ccc('0x3c')]({},_0x1a0476,_0x3c7e95['options']);return db[_0x2ccc('0x55')][_0x2ccc('0x42')](_0x1a0476);}})['then'](function(_0x457c36){if(_0x457c36){return db['User'][_0x2ccc('0x58')]({'where':{'id':_[_0x2ccc('0x30')](_0x457c36,_0x2ccc('0x59')),'role':_0x2ccc('0x5a')},'attributes':['id',_0x2ccc('0x2a'),_0x2ccc('0x5b'),_0x2ccc('0x5c'),_0x2ccc('0x5d')]});}})[_0x2ccc('0x24')](function(_0x54341e){if(_0x54341e){return{'count':_0x54341e[_0x2ccc('0x3f')],'rows':_[_0x2ccc('0x30')](_0x54341e[_0x2ccc('0x43')],function(_0x553e5d){return{'membername':_0x553e5d[_0x2ccc('0x2a')],'UserId':_0x553e5d['id'],'queue_name':_0x332967[_0x2ccc('0x2a')],'WhatsappQueueId':_0x332967['id'],'interface':util[_0x2ccc('0x5e')](_0x2ccc('0x5f'),'SIP',_0x553e5d[_0x2ccc('0x2a')]),'penalty':0x0,'paused':_0x553e5d[_0x2ccc('0x5b')],'createdAt':_0x553e5d['createdAt'],'updatedAt':_0x553e5d[_0x2ccc('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2ccc('0x24')](respondWithFilteredResult(_0x5d66e4,_0x1a0476))['catch'](handleError(_0x5d66e4,null));};exports[_0x2ccc('0x60')]=function(_0x4d4d33,_0x4759a0,_0x5854e6){var _0xddf5ee={};var _0x1528ca={};var _0x103d55;var _0x3f2c44;return db[_0x2ccc('0x2d')][_0x2ccc('0x61')]({'where':{'id':_0x4d4d33['params']['id']}})[_0x2ccc('0x24')](handleEntityNotFound(_0x4759a0,null))[_0x2ccc('0x24')](function(_0x140f38){if(_0x140f38){_0x103d55=_0x140f38;_0x1528ca['model']=_[_0x2ccc('0x46')](db[_0x2ccc('0x62')][_0x2ccc('0x2e')]);_0x1528ca[_0x2ccc('0x31')]=_['keys'](_0x4d4d33[_0x2ccc('0x31')]);_0x1528ca[_0x2ccc('0x3a')]=_[_0x2ccc('0x32')](_0x1528ca[_0x2ccc('0x2f')],_0x1528ca['query']);_0xddf5ee[_0x2ccc('0x33')]=_[_0x2ccc('0x32')](_0x1528ca[_0x2ccc('0x2f')],qs[_0x2ccc('0x47')](_0x4d4d33[_0x2ccc('0x31')][_0x2ccc('0x47')]));_0xddf5ee[_0x2ccc('0x33')]=_0xddf5ee[_0x2ccc('0x33')][_0x2ccc('0x34')]?_0xddf5ee[_0x2ccc('0x33')]:_0x1528ca[_0x2ccc('0x2f')];_0xddf5ee[_0x2ccc('0x56')]=qs[_0x2ccc('0x37')](_0x4d4d33[_0x2ccc('0x31')][_0x2ccc('0x37')]);_0xddf5ee[_0x2ccc('0x38')]=qs['filters'](_[_0x2ccc('0x39')](_0x4d4d33[_0x2ccc('0x31')],_0x1528ca[_0x2ccc('0x3a')]));if(_0x4d4d33[_0x2ccc('0x31')][_0x2ccc('0x3b')]){_0xddf5ee[_0x2ccc('0x38')]=_[_0x2ccc('0x3c')](_0xddf5ee[_0x2ccc('0x38')],{'$or':_[_0x2ccc('0x30')](_0xddf5ee[_0x2ccc('0x33')],function(_0x22f305){var _0x2cf4ab={};_0x2cf4ab[_0x22f305]={'$like':'%'+_0x4d4d33[_0x2ccc('0x31')]['filter']+'%'};return _0x2cf4ab;})});}_0xddf5ee=_['merge']({},_0xddf5ee,_0x4d4d33[_0x2ccc('0x3e')]);return _0x103d55[_0x2ccc('0x60')](_0xddf5ee);}})[_0x2ccc('0x24')](function(_0x1ef4a1){if(_0x1ef4a1){_0x3f2c44=_0x1ef4a1['length'];if(!_0x4d4d33[_0x2ccc('0x31')][_0x2ccc('0x35')]('nolimit')){_0xddf5ee['limit']=qs[_0x2ccc('0x1e')](_0x4d4d33[_0x2ccc('0x31')][_0x2ccc('0x1e')]);_0xddf5ee[_0x2ccc('0x1d')]=qs['offset'](_0x4d4d33[_0x2ccc('0x31')][_0x2ccc('0x1d')]);}return _0x103d55[_0x2ccc('0x60')](_0xddf5ee);}})[_0x2ccc('0x24')](function(_0x29b15a){if(_0x29b15a){return _0x29b15a?{'count':_0x3f2c44,'rows':_0x29b15a}:null;}})[_0x2ccc('0x24')](respondWithResult(_0x4759a0,null))[_0x2ccc('0x44')](handleError(_0x4759a0,null));};exports[_0x2ccc('0x63')]=function(_0x22eaf9,_0x5ba0ae,_0x4af1b4){var _0x1f50f3=_0x22eaf9[_0x2ccc('0x4a')][_0x2ccc('0x64')];return db['Team'][_0x2ccc('0x42')]({'where':{'id':_0x1f50f3},'attributes':['id'],'include':[{'model':db[_0x2ccc('0x65')],'as':_0x2ccc('0x66'),'attributes':['id',_0x2ccc('0x2a'),'online','voicePause','interface'],'raw':!![]}]})[_0x2ccc('0x24')](function(_0x2c0b76){if(_0x2c0b76){var _0x353a64=_[_0x2ccc('0x67')](_0x2c0b76,function(_0x122afb){var _0x1ae139=_0x122afb['get']({'plain':!![]});return _0x1ae139['Agents'];});return db[_0x2ccc('0x2d')][_0x2ccc('0x48')]({'where':{'id':_0x22eaf9[_0x2ccc('0x53')]['id']}})[_0x2ccc('0x24')](function(_0x187d13){return db['sequelize'][_0x2ccc('0x68')](function(_0x48675f){return _0x187d13[_0x2ccc('0x63')](_0x1f50f3,{'transaction':_0x48675f})[_0x2ccc('0x24')](function(){return BPromise['each'](_0x353a64,function(_0x241f10){return db[_0x2ccc('0x55')][_0x2ccc('0x69')]({'where':{'UserId':_0x241f10['id'],'WhatsappQueueId':_0x22eaf9['params']['id']},'transaction':_0x48675f});});})[_0x2ccc('0x24')](function(){_0x353a64[_0x2ccc('0x6a')](function(_0x3dcc58){socket[_0x2ccc('0x6b')](_0x2ccc('0x6c'),{'UserId':_0x3dcc58['id'],'WhatsappQueueId':_0x187d13['id']});});});});});}})[_0x2ccc('0x24')](respondWithStatusCode(_0x5ba0ae,null))[_0x2ccc('0x44')](handleError(_0x5ba0ae,null));};exports['removeTeams']=function(_0xcc03f1,_0x50725f,_0x3b1840){return db[_0x2ccc('0x62')][_0x2ccc('0x42')]({'where':{'id':_0xcc03f1[_0x2ccc('0x31')][_0x2ccc('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2ccc('0x66'),'attributes':['id'],'raw':!![]}]})[_0x2ccc('0x24')](handleEntityNotFound(_0x50725f,null))['then'](function(_0xae6845){var _0x2db054=_[_0x2ccc('0x30')](_0xae6845,'id');var _0x4c89d2=[];var _0x5bef7e=[];var _0x4b5c31=squel['select']();_0x4b5c31[_0x2ccc('0x6d')](_0x2ccc('0x6e'))[_0x2ccc('0x6f')](_0x2ccc('0x70'),'tq')[_0x2ccc('0x71')](_0x2ccc('0x72'),'ut',_0x2ccc('0x73'))['where']('WhatsappQueueId\x20=\x20?',_0xcc03f1[_0x2ccc('0x53')]['id']);for(var _0x2616c2=0x0;_0x2616c2<_0xae6845[_0x2ccc('0x34')];_0x2616c2+=0x1){let _0x2b24fc=_0xae6845[_0x2616c2];for(var _0x2edf46=0x0;_0x2edf46<_0x2b24fc[_0x2ccc('0x66')][_0x2ccc('0x34')];_0x2edf46+=0x1){let _0x39b92d=_0x2b24fc[_0x2ccc('0x66')][_0x2edf46];var _0x4618ef=_0x4b5c31[_0x2ccc('0x74')]();_0x4618ef[_0x2ccc('0x38')](_0x2ccc('0x75'),_0x39b92d['id']);_0x5bef7e[_0x2ccc('0x76')](db[_0x2ccc('0x77')][_0x2ccc('0x31')](_0x4618ef[_0x2ccc('0x78')](),{'type':db['sequelize']['QueryTypes'][_0x2ccc('0x79')]})[_0x2ccc('0x24')](function(_0x4087f6){if(_0x4087f6['length']===0x1){return _0x39b92d['id'];}else{var _0x3d5f43=_[_0x2ccc('0x7a')](_[_0x2ccc('0x30')](_0x4087f6,'TeamId'),function(_0x3eb5ad){return _[_0x2ccc('0x7b')](_0x2db054,_0x3eb5ad);});if(_0x3d5f43){return _0x39b92d['id'];}}}));}}return BPromise['all'](_0x5bef7e)[_0x2ccc('0x24')](function(_0x3412eb){_0x4c89d2=_(_0x4c89d2)[_0x2ccc('0x7c')](_0x3412eb)[_0x2ccc('0x7d')]()[_0x2ccc('0x7e')]();return db['WhatsappQueue'][_0x2ccc('0x48')]({'where':{'id':_0xcc03f1[_0x2ccc('0x53')]['id']}})[_0x2ccc('0x24')](function(_0x2179bf){return db['sequelize']['transaction'](function(_0x41f4c1){return _0x2179bf['removeTeams'](_0xcc03f1['query']['ids'],{'transaction':_0x41f4c1})[_0x2ccc('0x24')](function(){if(!_['isEmpty'](_0x4c89d2)){return _0x2179bf['removeAgents'](_0x4c89d2,{'transaction':_0x41f4c1});}})[_0x2ccc('0x24')](function(){_0x4c89d2[_0x2ccc('0x6a')](function(_0x108e86){socket[_0x2ccc('0x6b')](_0x2ccc('0x7f'),{'UserId':_0x108e86,'WhatsappQueueId':_0x2179bf['id']});});});});});});})[_0x2ccc('0x24')](respondWithStatusCode(_0x50725f,null))[_0x2ccc('0x44')](handleError(_0x50725f,null));};exports[_0x2ccc('0x80')]=function(_0x20d969,_0x2aa63e,_0x1e9adb){return db[_0x2ccc('0x2d')][_0x2ccc('0x48')]({'where':{'id':_0x20d969['params']['id']}})[_0x2ccc('0x24')](handleEntityNotFound(_0x2aa63e,null))[_0x2ccc('0x24')](function(_0x3559ea){if(_0x3559ea){return _0x3559ea[_0x2ccc('0x80')](_0x20d969[_0x2ccc('0x4a')][_0x2ccc('0x64')],_[_0x2ccc('0x81')](_0x20d969['body'],[_0x2ccc('0x64'),'id'])||{})[_0x2ccc('0x82')](function(_0x7df22c){for(var _0x5c1ef4=0x0;_0x5c1ef4<_0x20d969[_0x2ccc('0x4a')][_0x2ccc('0x64')]['length'];_0x5c1ef4+=0x1){socket[_0x2ccc('0x6b')](_0x2ccc('0x6c'),{'UserId':_0x20d969['body']['ids'][_0x5c1ef4],'WhatsappQueueId':_0x20d969[_0x2ccc('0x53')]['id']});}return _0x7df22c;});}})[_0x2ccc('0x24')](respondWithResult(_0x2aa63e,null))[_0x2ccc('0x44')](handleError(_0x2aa63e,null));};exports['removeAgents']=function(_0x36fce0,_0x40360a,_0x27f23b){return db[_0x2ccc('0x2d')][_0x2ccc('0x48')]({'where':{'id':_0x36fce0[_0x2ccc('0x53')]['id']}})[_0x2ccc('0x24')](handleEntityNotFound(_0x40360a,null))[_0x2ccc('0x24')](function(_0x123865){if(_0x123865){return _0x123865[_0x2ccc('0x83')](_0x36fce0[_0x2ccc('0x31')][_0x2ccc('0x64')])[_0x2ccc('0x24')](function(){if(_[_0x2ccc('0x84')](_0x36fce0[_0x2ccc('0x31')][_0x2ccc('0x64')])){for(var _0x350e90=0x0;_0x350e90<_0x36fce0[_0x2ccc('0x31')][_0x2ccc('0x64')][_0x2ccc('0x34')];_0x350e90+=0x1){socket[_0x2ccc('0x6b')](_0x2ccc('0x7f'),{'UserId':Number(_0x36fce0[_0x2ccc('0x31')]['ids'][_0x350e90]),'WhatsappQueueId':Number(_0x36fce0[_0x2ccc('0x53')]['id'])});}}else{socket[_0x2ccc('0x6b')](_0x2ccc('0x7f'),{'UserId':Number(_0x36fce0['query'][_0x2ccc('0x64')]),'WhatsappQueueId':Number(_0x36fce0['params']['id'])});}});}})[_0x2ccc('0x24')](respondWithStatusCode(_0x40360a,null))[_0x2ccc('0x44')](handleError(_0x40360a,null));};exports[_0x2ccc('0x85')]=function(_0x2ff474,_0x1c4d1e,_0x259a85){var _0x15f1dc={};var _0x3e1e28={};var _0x34ed54;var _0x42e6f1;return db['WhatsappQueue'][_0x2ccc('0x61')]({'where':{'id':_0x2ff474['params']['id']}})[_0x2ccc('0x24')](handleEntityNotFound(_0x1c4d1e,null))[_0x2ccc('0x24')](function(_0x5681b9){if(_0x5681b9){_0x34ed54=_0x5681b9;_0x3e1e28[_0x2ccc('0x2f')]=_['keys'](db['User'][_0x2ccc('0x2e')]);_0x3e1e28[_0x2ccc('0x31')]=_[_0x2ccc('0x46')](_0x2ff474[_0x2ccc('0x31')]);_0x3e1e28['filters']=_[_0x2ccc('0x32')](_0x3e1e28['model'],_0x3e1e28[_0x2ccc('0x31')]);_0x15f1dc[_0x2ccc('0x33')]=_[_0x2ccc('0x32')](_0x3e1e28[_0x2ccc('0x2f')],qs['fields'](_0x2ff474[_0x2ccc('0x31')]['fields']));_0x15f1dc[_0x2ccc('0x33')]=_0x15f1dc['attributes'][_0x2ccc('0x34')]?_0x15f1dc[_0x2ccc('0x33')]:_0x3e1e28['model'];_0x15f1dc[_0x2ccc('0x56')]=qs[_0x2ccc('0x37')](_0x2ff474[_0x2ccc('0x31')]['sort']);_0x15f1dc[_0x2ccc('0x38')]=qs[_0x2ccc('0x3a')](_[_0x2ccc('0x39')](_0x2ff474[_0x2ccc('0x31')],_0x3e1e28['filters']));if(_0x2ff474[_0x2ccc('0x31')][_0x2ccc('0x3b')]){_0x15f1dc[_0x2ccc('0x38')]=_['merge'](_0x15f1dc[_0x2ccc('0x38')],{'$or':_[_0x2ccc('0x30')](_0x15f1dc[_0x2ccc('0x33')],function(_0x199d8f){var _0x54e567={};_0x54e567[_0x199d8f]={'$like':'%'+_0x2ff474['query'][_0x2ccc('0x3b')]+'%'};return _0x54e567;})});}_0x15f1dc=_['merge']({},_0x15f1dc,_0x2ff474[_0x2ccc('0x3e')]);return _0x34ed54[_0x2ccc('0x85')](_0x15f1dc);}})[_0x2ccc('0x24')](function(_0x374726){if(_0x374726){_0x42e6f1=_0x374726[_0x2ccc('0x34')];if(!_0x2ff474[_0x2ccc('0x31')][_0x2ccc('0x35')](_0x2ccc('0x36'))){_0x15f1dc[_0x2ccc('0x1e')]=qs[_0x2ccc('0x1e')](_0x2ff474[_0x2ccc('0x31')][_0x2ccc('0x1e')]);_0x15f1dc[_0x2ccc('0x1d')]=qs[_0x2ccc('0x1d')](_0x2ff474[_0x2ccc('0x31')]['offset']);}return _0x34ed54['getAgents'](_0x15f1dc);}})[_0x2ccc('0x24')](function(_0x501ead){if(_0x501ead){return _0x501ead?{'count':_0x42e6f1,'rows':_0x501ead}:null;}})[_0x2ccc('0x24')](respondWithResult(_0x1c4d1e,null))[_0x2ccc('0x44')](handleError(_0x1c4d1e,null));};
\ No newline at end of file
+var _0x5d4e=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','find','catch','create','user','UserProfileSection','userProfileId','autoAssociation','body','params','describe','getMembers','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','all','union','compact','value','removeTeams','ids','isEmpty','removeAgents','addAgents','userWhatsappQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','limit','set','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','send','index','WhatsappQueue','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x5d4e,0x15b));var _0xe5d4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5d4e[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0xe5d4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe5d4('0x1'));var zipdir=require(_0xe5d4('0x2'));var jsonpatch=require(_0xe5d4('0x3'));var rp=require(_0xe5d4('0x4'));var moment=require(_0xe5d4('0x5'));var BPromise=require(_0xe5d4('0x6'));var Mustache=require(_0xe5d4('0x7'));var util=require(_0xe5d4('0x8'));var path=require(_0xe5d4('0x9'));var sox=require(_0xe5d4('0xa'));var csv=require(_0xe5d4('0xb'));var ejs=require(_0xe5d4('0xc'));var fs=require('fs');var _=require(_0xe5d4('0xd'));var squel=require('squel');var crypto=require(_0xe5d4('0xe'));var jsforce=require(_0xe5d4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe5d4('0xb'));var querystring=require(_0xe5d4('0x10'));var Papa=require(_0xe5d4('0x11'));var Redis=require('ioredis');var authService=require(_0xe5d4('0x12'));var qs=require(_0xe5d4('0x13'));var as=require(_0xe5d4('0x14'));var hardwareService=require(_0xe5d4('0x15'));var logger=require('../../config/logger')(_0xe5d4('0x16'));var utils=require(_0xe5d4('0x17'));var config=require('../../config/environment');var db=require(_0xe5d4('0x18'))['db'];config[_0xe5d4('0x19')]=_['defaults'](config[_0xe5d4('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe5d4('0x1a'))(new Redis(config[_0xe5d4('0x19')]));require(_0xe5d4('0x1b'))[_0xe5d4('0x1c')](socket);function respondWithStatusCode(_0x4a7d44,_0x104a7c){_0x104a7c=_0x104a7c||0xcc;return function(_0x17fee5){if(_0x17fee5){return _0x4a7d44[_0xe5d4('0x1d')](_0x104a7c);}return _0x4a7d44[_0xe5d4('0x1e')](_0x104a7c)[_0xe5d4('0x1f')]();};}function respondWithResult(_0x512f7d,_0x54f60c){_0x54f60c=_0x54f60c||0xc8;return function(_0x3bcb5b){if(_0x3bcb5b){return _0x512f7d[_0xe5d4('0x1e')](_0x54f60c)[_0xe5d4('0x20')](_0x3bcb5b);}};}function respondWithFilteredResult(_0x143ba7,_0x1b487c){return function(_0x51c432){if(_0x51c432){var _0x98db4a=_0x51c432['count'],_0x4cc550=_0x1b487c[_0xe5d4('0x21')],_0x3492e0=_0x1b487c['offset']+_0x1b487c[_0xe5d4('0x22')],_0x332af7;if(_0x3492e0>=_0x98db4a){_0x3492e0=_0x98db4a;_0x332af7=0xc8;}else{_0x332af7=0xce;}_0x143ba7[_0xe5d4('0x1e')](_0x332af7);return _0x143ba7[_0xe5d4('0x23')]('Content-Range',_0x4cc550+'-'+_0x3492e0+'/'+_0x98db4a)['json'](_0x51c432);}return null;};}function patchUpdates(_0x4bc522){return function(_0x1f536b){try{jsonpatch[_0xe5d4('0x24')](_0x1f536b,_0x4bc522,!![]);}catch(_0x2eab4c){return BPromise['reject'](_0x2eab4c);}return _0x1f536b[_0xe5d4('0x25')]();};}function saveUpdates(_0x165471,_0x4bbc76){return function(_0x576954){if(_0x576954){return _0x576954[_0xe5d4('0x26')](_0x165471)[_0xe5d4('0x27')](function(_0xcea08b){return _0xcea08b;});}return null;};}function removeEntity(_0x832fe4,_0x45282b){return function(_0x392fa0){if(_0x392fa0){return _0x392fa0[_0xe5d4('0x28')]()[_0xe5d4('0x27')](function(){var _0x357433=_0x392fa0[_0xe5d4('0x29')]({'plain':!![]});var _0x2707db=_0xe5d4('0x2a');return db[_0xe5d4('0x2b')][_0xe5d4('0x28')]({'where':{'type':_0x2707db,'resourceId':_0x357433['id']}})[_0xe5d4('0x27')](function(){return _0x392fa0;});})[_0xe5d4('0x27')](function(){_0x832fe4[_0xe5d4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3879,_0x469a64){return function(_0x3f07c1){if(!_0x3f07c1){_0x2d3879['sendStatus'](0x194);}return _0x3f07c1;};}function handleError(_0x84e0e3,_0x37e59a){_0x37e59a=_0x37e59a||0x1f4;return function(_0x3ad402){logger[_0xe5d4('0x2c')](_0x3ad402['stack']);if(_0x3ad402[_0xe5d4('0x2d')]){delete _0x3ad402[_0xe5d4('0x2d')];}_0x84e0e3[_0xe5d4('0x1e')](_0x37e59a)[_0xe5d4('0x2e')](_0x3ad402);};}exports[_0xe5d4('0x2f')]=function(_0x510bca,_0x13b20f){var _0x5a5f54={},_0x1ba10c={},_0x262263={'count':0x0,'rows':[]};var _0x3df043=_['map'](db[_0xe5d4('0x30')][_0xe5d4('0x31')],function(_0x1190a2){return{'name':_0x1190a2[_0xe5d4('0x32')],'type':_0x1190a2['type'][_0xe5d4('0x33')]};});_0x1ba10c[_0xe5d4('0x34')]=_[_0xe5d4('0x35')](_0x3df043,_0xe5d4('0x2d'));_0x1ba10c[_0xe5d4('0x36')]=_[_0xe5d4('0x37')](_0x510bca[_0xe5d4('0x36')]);_0x1ba10c[_0xe5d4('0x38')]=_[_0xe5d4('0x39')](_0x1ba10c[_0xe5d4('0x34')],_0x1ba10c[_0xe5d4('0x36')]);_0x5a5f54['attributes']=_[_0xe5d4('0x39')](_0x1ba10c['model'],qs['fields'](_0x510bca[_0xe5d4('0x36')][_0xe5d4('0x3a')]));_0x5a5f54[_0xe5d4('0x3b')]=_0x5a5f54['attributes'][_0xe5d4('0x3c')]?_0x5a5f54['attributes']:_0x1ba10c['model'];if(!_0x510bca[_0xe5d4('0x36')]['hasOwnProperty'](_0xe5d4('0x3d'))){_0x5a5f54[_0xe5d4('0x22')]=qs[_0xe5d4('0x22')](_0x510bca[_0xe5d4('0x36')][_0xe5d4('0x22')]);_0x5a5f54[_0xe5d4('0x21')]=qs[_0xe5d4('0x21')](_0x510bca[_0xe5d4('0x36')]['offset']);}_0x5a5f54[_0xe5d4('0x3e')]=qs[_0xe5d4('0x3f')](_0x510bca[_0xe5d4('0x36')][_0xe5d4('0x3f')]);_0x5a5f54[_0xe5d4('0x40')]=qs[_0xe5d4('0x38')](_[_0xe5d4('0x41')](_0x510bca[_0xe5d4('0x36')],_0x1ba10c['filters']),_0x3df043);if(_0x510bca[_0xe5d4('0x36')][_0xe5d4('0x42')]){_0x5a5f54[_0xe5d4('0x40')]=_[_0xe5d4('0x43')](_0x5a5f54[_0xe5d4('0x40')],{'$or':_[_0xe5d4('0x35')](_0x3df043,function(_0x18e78c){if(_0x18e78c['type']!==_0xe5d4('0x44')){var _0x27f683={};_0x27f683[_0x18e78c['name']]={'$like':'%'+_0x510bca[_0xe5d4('0x36')]['filter']+'%'};return _0x27f683;}})});}_0x5a5f54=_[_0xe5d4('0x43')]({},_0x5a5f54,_0x510bca[_0xe5d4('0x45')]);var _0xe1d6dc={'where':_0x5a5f54[_0xe5d4('0x40')]};return db[_0xe5d4('0x30')][_0xe5d4('0x46')](_0xe1d6dc)[_0xe5d4('0x27')](function(_0x20617f){_0x262263[_0xe5d4('0x46')]=_0x20617f;if(_0x510bca[_0xe5d4('0x36')][_0xe5d4('0x47')]){_0x5a5f54[_0xe5d4('0x48')]=[{'all':!![]}];}return db[_0xe5d4('0x30')][_0xe5d4('0x49')](_0x5a5f54);})[_0xe5d4('0x27')](function(_0x2f2b25){_0x262263[_0xe5d4('0x4a')]=_0x2f2b25;return _0x262263;})['then'](respondWithFilteredResult(_0x13b20f,_0x5a5f54))['catch'](handleError(_0x13b20f,null));};exports['show']=function(_0x4a828c,_0x404c36){var _0x55cb32={'raw':!![],'where':{'id':_0x4a828c['params']['id']}},_0x58d262={};_0x58d262[_0xe5d4('0x34')]=_[_0xe5d4('0x37')](db[_0xe5d4('0x30')][_0xe5d4('0x31')]);_0x58d262[_0xe5d4('0x36')]=_[_0xe5d4('0x37')](_0x4a828c[_0xe5d4('0x36')]);_0x58d262['filters']=_[_0xe5d4('0x39')](_0x58d262['model'],_0x58d262[_0xe5d4('0x36')]);_0x55cb32[_0xe5d4('0x3b')]=_[_0xe5d4('0x39')](_0x58d262[_0xe5d4('0x34')],qs[_0xe5d4('0x3a')](_0x4a828c[_0xe5d4('0x36')][_0xe5d4('0x3a')]));_0x55cb32[_0xe5d4('0x3b')]=_0x55cb32[_0xe5d4('0x3b')][_0xe5d4('0x3c')]?_0x55cb32[_0xe5d4('0x3b')]:_0x58d262['model'];if(_0x4a828c[_0xe5d4('0x36')][_0xe5d4('0x47')]){_0x55cb32[_0xe5d4('0x48')]=[{'all':!![]}];}_0x55cb32=_[_0xe5d4('0x43')]({},_0x55cb32,_0x4a828c[_0xe5d4('0x45')]);return db[_0xe5d4('0x30')][_0xe5d4('0x4b')](_0x55cb32)[_0xe5d4('0x27')](handleEntityNotFound(_0x404c36,null))[_0xe5d4('0x27')](respondWithResult(_0x404c36,null))[_0xe5d4('0x4c')](handleError(_0x404c36,null));};exports[_0xe5d4('0x4d')]=function(_0x5d60ca,_0x17fd97){return db['WhatsappQueue'][_0xe5d4('0x4d')](_0x5d60ca['body'],{})['then'](function(_0x1855cf){var _0x24d886=_0x5d60ca[_0xe5d4('0x4e')][_0xe5d4('0x29')]({'plain':!![]});if(!_0x24d886)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24d886['role']===_0xe5d4('0x4e')){var _0x2ef27b=_0x1855cf[_0xe5d4('0x29')]({'plain':!![]});var _0x2b800a=_0xe5d4('0x2a');return db[_0xe5d4('0x4f')][_0xe5d4('0x4b')]({'where':{'name':_0x2b800a,'userProfileId':_0x24d886[_0xe5d4('0x50')]},'raw':!![]})[_0xe5d4('0x27')](function(_0x5f87cf){if(_0x5f87cf&&_0x5f87cf[_0xe5d4('0x51')]===0x0){return db[_0xe5d4('0x2b')]['create']({'name':_0x2ef27b['name'],'resourceId':_0x2ef27b['id'],'type':_0x5f87cf['name'],'sectionId':_0x5f87cf['id']},{})[_0xe5d4('0x27')](function(){return _0x1855cf;});}else{return _0x1855cf;}})[_0xe5d4('0x4c')](function(_0x5432a1){logger[_0xe5d4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5432a1);throw _0x5432a1;});}return _0x1855cf;})['then'](respondWithResult(_0x17fd97,0xc9))['catch'](handleError(_0x17fd97,null));};exports[_0xe5d4('0x26')]=function(_0x226ca0,_0x362b36){if(_0x226ca0[_0xe5d4('0x52')]['id']){delete _0x226ca0[_0xe5d4('0x52')]['id'];}return db[_0xe5d4('0x30')][_0xe5d4('0x4b')]({'where':{'id':_0x226ca0[_0xe5d4('0x53')]['id']}})['then'](handleEntityNotFound(_0x362b36,null))[_0xe5d4('0x27')](saveUpdates(_0x226ca0[_0xe5d4('0x52')],null))[_0xe5d4('0x27')](respondWithResult(_0x362b36,null))[_0xe5d4('0x4c')](handleError(_0x362b36,null));};exports[_0xe5d4('0x28')]=function(_0x31b456,_0x83c44e){return db['WhatsappQueue'][_0xe5d4('0x4b')]({'where':{'id':_0x31b456[_0xe5d4('0x53')]['id']}})[_0xe5d4('0x27')](handleEntityNotFound(_0x83c44e,null))[_0xe5d4('0x27')](removeEntity(_0x83c44e,null))['catch'](handleError(_0x83c44e,null));};exports[_0xe5d4('0x54')]=function(_0x186691,_0x1e739b){return db[_0xe5d4('0x30')][_0xe5d4('0x54')]()[_0xe5d4('0x27')](respondWithResult(_0x1e739b,null))[_0xe5d4('0x4c')](handleError(_0x1e739b,null));};exports[_0xe5d4('0x55')]=function(_0x2b1117,_0x3bb4cb,_0x5eb520){var _0xd1a534={'raw':!![],'where':{}},_0x34e2eb={},_0x394580;return db[_0xe5d4('0x30')]['findOne']({'where':{'id':_0x2b1117['params']['id']}})[_0xe5d4('0x27')](handleEntityNotFound(_0x3bb4cb,null))[_0xe5d4('0x27')](function(_0xf032aa){if(_0xf032aa){_0x394580=_0xf032aa[_0xe5d4('0x29')]({'plain':!![]});_0x34e2eb[_0xe5d4('0x34')]=_[_0xe5d4('0x37')](db[_0xe5d4('0x56')][_0xe5d4('0x31')]);_0x34e2eb['query']=_[_0xe5d4('0x37')](_0x2b1117[_0xe5d4('0x36')]);_0x34e2eb['filters']=_[_0xe5d4('0x39')](_0x34e2eb[_0xe5d4('0x34')],_0x34e2eb[_0xe5d4('0x36')]);_0xd1a534[_0xe5d4('0x3b')]=_[_0xe5d4('0x39')](_0x34e2eb[_0xe5d4('0x34')],qs[_0xe5d4('0x3a')](_0x2b1117['query']['fields']));_0xd1a534['attributes']=_0xd1a534[_0xe5d4('0x3b')][_0xe5d4('0x3c')]?_0xd1a534[_0xe5d4('0x3b')]:_0x34e2eb[_0xe5d4('0x34')];if(!_0x2b1117['query'][_0xe5d4('0x57')]('nolimit')){_0xd1a534['limit']=qs[_0xe5d4('0x22')](_0x2b1117['query']['limit']);_0xd1a534[_0xe5d4('0x21')]=qs[_0xe5d4('0x21')](_0x2b1117['query']['offset']);}_0xd1a534[_0xe5d4('0x3e')]=qs[_0xe5d4('0x3f')](_0x2b1117[_0xe5d4('0x36')]['sort']);_0xd1a534[_0xe5d4('0x40')]=qs[_0xe5d4('0x38')](_['pick'](_0x2b1117['query'],_0x34e2eb[_0xe5d4('0x38')]));_0xd1a534[_0xe5d4('0x40')][_0xe5d4('0x58')]=_0xf032aa['id'];if(_0x2b1117[_0xe5d4('0x36')][_0xe5d4('0x42')]){_0xd1a534['where']=_[_0xe5d4('0x43')](_0xd1a534[_0xe5d4('0x40')],{'$or':_[_0xe5d4('0x35')](_0xd1a534[_0xe5d4('0x3b')],function(_0x3563d2){var _0x394c70={};_0x394c70[_0x3563d2]={'$like':'%'+_0x2b1117[_0xe5d4('0x36')][_0xe5d4('0x42')]+'%'};return _0x394c70;})});}_0xd1a534=_[_0xe5d4('0x43')]({},_0xd1a534,_0x2b1117['options']);return db[_0xe5d4('0x56')][_0xe5d4('0x49')](_0xd1a534);}})[_0xe5d4('0x27')](function(_0x27e5d7){if(_0x27e5d7){return db[_0xe5d4('0x59')][_0xe5d4('0x5a')]({'where':{'id':_[_0xe5d4('0x35')](_0x27e5d7,'UserId'),'role':_0xe5d4('0x5b')},'attributes':['id',_0xe5d4('0x2d'),_0xe5d4('0x5c'),_0xe5d4('0x5d'),_0xe5d4('0x5e')]});}})['then'](function(_0x2dbdbd){if(_0x2dbdbd){return{'count':_0x2dbdbd[_0xe5d4('0x46')],'rows':_['map'](_0x2dbdbd[_0xe5d4('0x4a')],function(_0x3415a0){return{'membername':_0x3415a0[_0xe5d4('0x2d')],'UserId':_0x3415a0['id'],'queue_name':_0x394580[_0xe5d4('0x2d')],'WhatsappQueueId':_0x394580['id'],'interface':util[_0xe5d4('0x5f')](_0xe5d4('0x60'),_0xe5d4('0x61'),_0x3415a0['name']),'penalty':0x0,'paused':_0x3415a0[_0xe5d4('0x5c')],'createdAt':_0x3415a0[_0xe5d4('0x5e')],'updatedAt':_0x3415a0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe5d4('0x27')](respondWithFilteredResult(_0x3bb4cb,_0xd1a534))[_0xe5d4('0x4c')](handleError(_0x3bb4cb,null));};exports[_0xe5d4('0x62')]=function(_0xbdd81,_0x41740a,_0x3e252d){var _0x2d0295={};var _0x124c00={};var _0x5bdc93;var _0x31522f;return db['WhatsappQueue'][_0xe5d4('0x63')]({'where':{'id':_0xbdd81[_0xe5d4('0x53')]['id']}})['then'](handleEntityNotFound(_0x41740a,null))[_0xe5d4('0x27')](function(_0xde70bc){if(_0xde70bc){_0x5bdc93=_0xde70bc;_0x124c00[_0xe5d4('0x34')]=_[_0xe5d4('0x37')](db[_0xe5d4('0x64')]['rawAttributes']);_0x124c00[_0xe5d4('0x36')]=_[_0xe5d4('0x37')](_0xbdd81[_0xe5d4('0x36')]);_0x124c00['filters']=_[_0xe5d4('0x39')](_0x124c00['model'],_0x124c00[_0xe5d4('0x36')]);_0x2d0295[_0xe5d4('0x3b')]=_[_0xe5d4('0x39')](_0x124c00[_0xe5d4('0x34')],qs[_0xe5d4('0x3a')](_0xbdd81[_0xe5d4('0x36')][_0xe5d4('0x3a')]));_0x2d0295[_0xe5d4('0x3b')]=_0x2d0295[_0xe5d4('0x3b')][_0xe5d4('0x3c')]?_0x2d0295[_0xe5d4('0x3b')]:_0x124c00['model'];_0x2d0295['order']=qs[_0xe5d4('0x3f')](_0xbdd81[_0xe5d4('0x36')]['sort']);_0x2d0295[_0xe5d4('0x40')]=qs[_0xe5d4('0x38')](_[_0xe5d4('0x41')](_0xbdd81[_0xe5d4('0x36')],_0x124c00[_0xe5d4('0x38')]));if(_0xbdd81[_0xe5d4('0x36')][_0xe5d4('0x42')]){_0x2d0295[_0xe5d4('0x40')]=_[_0xe5d4('0x43')](_0x2d0295[_0xe5d4('0x40')],{'$or':_[_0xe5d4('0x35')](_0x2d0295[_0xe5d4('0x3b')],function(_0x1b0080){var _0x2b5642={};_0x2b5642[_0x1b0080]={'$like':'%'+_0xbdd81['query'][_0xe5d4('0x42')]+'%'};return _0x2b5642;})});}_0x2d0295=_[_0xe5d4('0x43')]({},_0x2d0295,_0xbdd81[_0xe5d4('0x45')]);return _0x5bdc93[_0xe5d4('0x62')](_0x2d0295);}})['then'](function(_0x21b204){if(_0x21b204){_0x31522f=_0x21b204[_0xe5d4('0x3c')];if(!_0xbdd81[_0xe5d4('0x36')][_0xe5d4('0x57')]('nolimit')){_0x2d0295[_0xe5d4('0x22')]=qs[_0xe5d4('0x22')](_0xbdd81[_0xe5d4('0x36')]['limit']);_0x2d0295[_0xe5d4('0x21')]=qs[_0xe5d4('0x21')](_0xbdd81[_0xe5d4('0x36')][_0xe5d4('0x21')]);}return _0x5bdc93[_0xe5d4('0x62')](_0x2d0295);}})[_0xe5d4('0x27')](function(_0xcd93ac){if(_0xcd93ac){return _0xcd93ac?{'count':_0x31522f,'rows':_0xcd93ac}:null;}})[_0xe5d4('0x27')](respondWithResult(_0x41740a,null))[_0xe5d4('0x4c')](handleError(_0x41740a,null));};exports['addTeams']=function(_0x484b8e,_0xa62318,_0x3341da){var _0x2ebbf1=_0x484b8e[_0xe5d4('0x52')]['ids'];return db[_0xe5d4('0x64')]['findAll']({'where':{'id':_0x2ebbf1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe5d4('0x65'),'attributes':['id',_0xe5d4('0x2d'),_0xe5d4('0x66'),_0xe5d4('0x67'),'interface'],'raw':!![]}]})[_0xe5d4('0x27')](function(_0x1327ce){if(_0x1327ce){var _0x218d74=_[_0xe5d4('0x68')](_0x1327ce,function(_0x39cfa5){var _0x53fc36=_0x39cfa5[_0xe5d4('0x29')]({'plain':!![]});return _0x53fc36[_0xe5d4('0x65')];});return db[_0xe5d4('0x30')]['find']({'where':{'id':_0x484b8e[_0xe5d4('0x53')]['id']}})[_0xe5d4('0x27')](function(_0x2d5c07){return db[_0xe5d4('0x69')][_0xe5d4('0x6a')](function(_0x103854){return _0x2d5c07['addTeams'](_0x2ebbf1,{'transaction':_0x103854})[_0xe5d4('0x27')](function(){return BPromise[_0xe5d4('0x6b')](_0x218d74,function(_0x569b31){return db[_0xe5d4('0x56')][_0xe5d4('0x6c')]({'where':{'UserId':_0x569b31['id'],'WhatsappQueueId':_0x484b8e['params']['id']},'transaction':_0x103854});});})[_0xe5d4('0x27')](function(){_0x218d74[_0xe5d4('0x6d')](function(_0x9359ea){socket[_0xe5d4('0x6e')](_0xe5d4('0x6f'),{'UserId':_0x9359ea['id'],'WhatsappQueueId':_0x2d5c07['id']});});});});});}})[_0xe5d4('0x27')](respondWithStatusCode(_0xa62318,null))[_0xe5d4('0x4c')](handleError(_0xa62318,null));};exports['removeTeams']=function(_0x4b8457,_0x56aacb,_0x5d95d8){return db['Team'][_0xe5d4('0x49')]({'where':{'id':_0x4b8457[_0xe5d4('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe5d4('0x59')],'as':_0xe5d4('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x56aacb,null))['then'](function(_0x26b1c9){var _0x580bfd=_[_0xe5d4('0x35')](_0x26b1c9,'id');var _0x1ba15f=[];var _0xb30c7f=[];var _0x3b1fe7=squel[_0xe5d4('0x70')]();_0x3b1fe7['field'](_0xe5d4('0x71'))[_0xe5d4('0x72')](_0xe5d4('0x73'),'tq')[_0xe5d4('0x74')](_0xe5d4('0x75'),'ut',_0xe5d4('0x76'))[_0xe5d4('0x40')]('WhatsappQueueId\x20=\x20?',_0x4b8457[_0xe5d4('0x53')]['id']);for(var _0x1253a6=0x0;_0x1253a6<_0x26b1c9[_0xe5d4('0x3c')];_0x1253a6+=0x1){let _0x13c573=_0x26b1c9[_0x1253a6];for(var _0x767ec0=0x0;_0x767ec0<_0x13c573['Agents'][_0xe5d4('0x3c')];_0x767ec0+=0x1){let _0x40df14=_0x13c573['Agents'][_0x767ec0];var _0x4d7d03=_0x3b1fe7[_0xe5d4('0x77')]();_0x4d7d03[_0xe5d4('0x40')](_0xe5d4('0x78'),_0x40df14['id']);_0xb30c7f[_0xe5d4('0x79')](db[_0xe5d4('0x69')]['query'](_0x4d7d03[_0xe5d4('0x7a')](),{'type':db[_0xe5d4('0x69')]['QueryTypes'][_0xe5d4('0x7b')]})['then'](function(_0x2f35fb){if(_0x2f35fb[_0xe5d4('0x3c')]===0x1){return _0x40df14['id'];}else{var _0x2d1a17=_[_0xe5d4('0x7c')](_['map'](_0x2f35fb,'TeamId'),function(_0x5afaa8){return _['includes'](_0x580bfd,_0x5afaa8);});if(_0x2d1a17){return _0x40df14['id'];}}}));}}return BPromise[_0xe5d4('0x7d')](_0xb30c7f)[_0xe5d4('0x27')](function(_0xbdee7a){_0x1ba15f=_(_0x1ba15f)[_0xe5d4('0x7e')](_0xbdee7a)[_0xe5d4('0x7f')]()[_0xe5d4('0x80')]();return db[_0xe5d4('0x30')][_0xe5d4('0x4b')]({'where':{'id':_0x4b8457['params']['id']}})[_0xe5d4('0x27')](function(_0x503c5b){return db[_0xe5d4('0x69')]['transaction'](function(_0x50c10c){return _0x503c5b[_0xe5d4('0x81')](_0x4b8457[_0xe5d4('0x36')][_0xe5d4('0x82')],{'transaction':_0x50c10c})[_0xe5d4('0x27')](function(){if(!_[_0xe5d4('0x83')](_0x1ba15f)){return _0x503c5b[_0xe5d4('0x84')](_0x1ba15f,{'transaction':_0x50c10c});}})[_0xe5d4('0x27')](function(){_0x1ba15f[_0xe5d4('0x6d')](function(_0x30ef2d){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x30ef2d,'WhatsappQueueId':_0x503c5b['id']});});});});});});})[_0xe5d4('0x27')](respondWithStatusCode(_0x56aacb,null))[_0xe5d4('0x4c')](handleError(_0x56aacb,null));};exports[_0xe5d4('0x85')]=function(_0x3d012c,_0x16de9b,_0x48e546){return db[_0xe5d4('0x30')]['find']({'where':{'id':_0x3d012c[_0xe5d4('0x53')]['id']}})[_0xe5d4('0x27')](handleEntityNotFound(_0x16de9b,null))[_0xe5d4('0x27')](function(_0x467aba){if(_0x467aba){return _0x467aba[_0xe5d4('0x85')](_0x3d012c['body'][_0xe5d4('0x82')],_['omit'](_0x3d012c['body'],[_0xe5d4('0x82'),'id'])||{})['spread'](function(_0x80712b){for(var _0x8df151=0x0;_0x8df151<_0x3d012c[_0xe5d4('0x52')][_0xe5d4('0x82')][_0xe5d4('0x3c')];_0x8df151+=0x1){socket['emit'](_0xe5d4('0x6f'),{'UserId':_0x3d012c[_0xe5d4('0x52')]['ids'][_0x8df151],'WhatsappQueueId':_0x3d012c['params']['id']});}return _0x80712b;});}})[_0xe5d4('0x27')](respondWithResult(_0x16de9b,null))[_0xe5d4('0x4c')](handleError(_0x16de9b,null));};exports[_0xe5d4('0x84')]=function(_0x203f20,_0x125518,_0x330cda){return db['WhatsappQueue'][_0xe5d4('0x4b')]({'where':{'id':_0x203f20[_0xe5d4('0x53')]['id']}})[_0xe5d4('0x27')](handleEntityNotFound(_0x125518,null))[_0xe5d4('0x27')](function(_0x28e779){if(_0x28e779){return _0x28e779[_0xe5d4('0x84')](_0x203f20[_0xe5d4('0x36')][_0xe5d4('0x82')])[_0xe5d4('0x27')](function(){if(_['isArray'](_0x203f20[_0xe5d4('0x36')]['ids'])){for(var _0x29892e=0x0;_0x29892e<_0x203f20['query'][_0xe5d4('0x82')]['length'];_0x29892e+=0x1){socket[_0xe5d4('0x6e')](_0xe5d4('0x86'),{'UserId':Number(_0x203f20[_0xe5d4('0x36')][_0xe5d4('0x82')][_0x29892e]),'WhatsappQueueId':Number(_0x203f20[_0xe5d4('0x53')]['id'])});}}else{socket[_0xe5d4('0x6e')](_0xe5d4('0x86'),{'UserId':Number(_0x203f20['query'][_0xe5d4('0x82')]),'WhatsappQueueId':Number(_0x203f20[_0xe5d4('0x53')]['id'])});}});}})[_0xe5d4('0x27')](respondWithStatusCode(_0x125518,null))['catch'](handleError(_0x125518,null));};exports['getAgents']=function(_0x57fa2f,_0x408981,_0x210ab7){var _0x291cfd={};var _0xc25aff={};var _0x543c4b;var _0x4a50f8;return db[_0xe5d4('0x30')][_0xe5d4('0x63')]({'where':{'id':_0x57fa2f['params']['id']}})['then'](handleEntityNotFound(_0x408981,null))['then'](function(_0x28d733){if(_0x28d733){_0x543c4b=_0x28d733;_0xc25aff[_0xe5d4('0x34')]=_[_0xe5d4('0x37')](db[_0xe5d4('0x59')]['rawAttributes']);_0xc25aff[_0xe5d4('0x36')]=_[_0xe5d4('0x37')](_0x57fa2f[_0xe5d4('0x36')]);_0xc25aff['filters']=_[_0xe5d4('0x39')](_0xc25aff[_0xe5d4('0x34')],_0xc25aff[_0xe5d4('0x36')]);_0x291cfd['attributes']=_[_0xe5d4('0x39')](_0xc25aff[_0xe5d4('0x34')],qs['fields'](_0x57fa2f['query'][_0xe5d4('0x3a')]));_0x291cfd[_0xe5d4('0x3b')]=_0x291cfd[_0xe5d4('0x3b')][_0xe5d4('0x3c')]?_0x291cfd[_0xe5d4('0x3b')]:_0xc25aff[_0xe5d4('0x34')];_0x291cfd['order']=qs[_0xe5d4('0x3f')](_0x57fa2f[_0xe5d4('0x36')][_0xe5d4('0x3f')]);_0x291cfd[_0xe5d4('0x40')]=qs['filters'](_[_0xe5d4('0x41')](_0x57fa2f[_0xe5d4('0x36')],_0xc25aff[_0xe5d4('0x38')]));if(_0x57fa2f['query'][_0xe5d4('0x42')]){_0x291cfd[_0xe5d4('0x40')]=_[_0xe5d4('0x43')](_0x291cfd['where'],{'$or':_[_0xe5d4('0x35')](_0x291cfd['attributes'],function(_0xb314ea){var _0x54f3f3={};_0x54f3f3[_0xb314ea]={'$like':'%'+_0x57fa2f[_0xe5d4('0x36')][_0xe5d4('0x42')]+'%'};return _0x54f3f3;})});}_0x291cfd=_['merge']({},_0x291cfd,_0x57fa2f[_0xe5d4('0x45')]);return _0x543c4b[_0xe5d4('0x87')](_0x291cfd);}})[_0xe5d4('0x27')](function(_0x4eb0b5){if(_0x4eb0b5){_0x4a50f8=_0x4eb0b5[_0xe5d4('0x3c')];if(!_0x57fa2f[_0xe5d4('0x36')][_0xe5d4('0x57')](_0xe5d4('0x3d'))){_0x291cfd['limit']=qs[_0xe5d4('0x22')](_0x57fa2f[_0xe5d4('0x36')]['limit']);_0x291cfd['offset']=qs[_0xe5d4('0x21')](_0x57fa2f[_0xe5d4('0x36')][_0xe5d4('0x21')]);}return _0x543c4b[_0xe5d4('0x87')](_0x291cfd);}})[_0xe5d4('0x27')](function(_0x1478c3){if(_0x1478c3){return _0x1478c3?{'count':_0x4a50f8,'rows':_0x1478c3}:null;}})[_0xe5d4('0x27')](respondWithResult(_0x408981,null))['catch'](handleError(_0x408981,null));};
\ No newline at end of file
index ca79389..34f19a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe229=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x546e86,_0x5aa97c){var _0x21f2c6=function(_0x20e896){while(--_0x20e896){_0x546e86['push'](_0x546e86['shift']());}};_0x21f2c6(++_0x5aa97c);}(_0xe229,0x103));var _0x9e22=function(_0xaa8e64,_0x483213){_0xaa8e64=_0xaa8e64-0x0;var _0x5bbd5=_0xe229[_0xaa8e64];return _0x5bbd5;};'use strict';var EventEmitter=require(_0x9e22('0x0'));var WhatsappQueue=require(_0x9e22('0x1'))['db'][_0x9e22('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9e22('0x3')](0x0);var events={'afterCreate':_0x9e22('0x4'),'afterUpdate':_0x9e22('0x5'),'afterDestroy':_0x9e22('0x6')};function emitEvent(_0x29dd69){return function(_0x2f534b,_0x4b1231,_0x30675b){WhatsappQueueEvents[_0x9e22('0x7')](_0x29dd69+':'+_0x2f534b['id'],_0x2f534b);WhatsappQueueEvents['emit'](_0x29dd69,_0x2f534b);_0x30675b(null);};}for(var e in events){if(events[_0x9e22('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x9e22('0x9')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0xe37e=['exports','events','save','emit','hasOwnProperty','hook'];(function(_0x495df6,_0x332b74){var _0x35f511=function(_0x241ee5){while(--_0x241ee5){_0x495df6['push'](_0x495df6['shift']());}};_0x35f511(++_0x332b74);}(_0xe37e,0xc7));var _0xee37=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xe37e[_0x50aa2e];return _0x5e07f0;};'use strict';var EventEmitter=require(_0xee37('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee37('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3cf935){return function(_0x141cb1,_0x129948,_0x4587c7){WhatsappQueueEvents[_0xee37('0x2')](_0x3cf935+':'+_0x141cb1['id'],_0x141cb1);WhatsappQueueEvents[_0xee37('0x2')](_0x3cf935,_0x141cb1);_0x4587c7(null);};}for(var e in events){if(events[_0xee37('0x3')](e)){var event=events[e];WhatsappQueue[_0xee37('0x4')](e,emitEvent(event));}}module[_0xee37('0x5')]=WhatsappQueueEvents;
\ No newline at end of file
index a5c20bf..9b06b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fb3=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','path','../../config/environment','./whatsappQueue.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3fb3,0x1e8));var _0x33fb=function(_0x545950,_0x338f9b){_0x545950=_0x545950-0x0;var _0x107740=_0x3fb3[_0x545950];return _0x107740;};'use strict';var _=require(_0x33fb('0x0'));var util=require(_0x33fb('0x1'));var logger=require(_0x33fb('0x2'))(_0x33fb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x33fb('0x4'));var rimraf=require('rimraf');var config=require(_0x33fb('0x5'));var attributes=require(_0x33fb('0x6'));module['exports']=function(_0x34fd20,_0x42256e){return _0x34fd20['define'](_0x33fb('0x7'),attributes,{'tableName':_0x33fb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d82=['exports','define','WhatsappQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x5d4c2d,_0xb82f70){var _0x535b88=function(_0x4680a2){while(--_0x4680a2){_0x5d4c2d['push'](_0x5d4c2d['shift']());}};_0x535b88(++_0xb82f70);}(_0x0d82,0x155));var _0x20d8=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x0d82[_0x1694f5];return _0x5b4321;};'use strict';var _=require('lodash');var util=require(_0x20d8('0x0'));var logger=require(_0x20d8('0x1'))(_0x20d8('0x2'));var moment=require(_0x20d8('0x3'));var BPromise=require(_0x20d8('0x4'));var rp=require(_0x20d8('0x5'));var fs=require('fs');var path=require(_0x20d8('0x6'));var rimraf=require(_0x20d8('0x7'));var config=require(_0x20d8('0x8'));var attributes=require(_0x20d8('0x9'));module[_0x20d8('0xa')]=function(_0x2273cd,_0x4856f6){return _0x2273cd[_0x20d8('0xb')](_0x20d8('0xc'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 55f5373..db3c522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f5=['http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','map','include','model','stringify','catch','ShowWhatsappQueue','find','lodash','util','moment','bluebird','../../config/logger','../../config/environment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x57f5,0x10a));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x557f('0x0'));var util=require(_0x557f('0x1'));var moment=require(_0x557f('0x2'));var BPromise=require(_0x557f('0x3'));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(_0x557f('0x4'))('rpc');var config=require(_0x557f('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x557f('0x6')]({'port':0x232a});config[_0x557f('0x7')]=_[_0x557f('0x8')](config[_0x557f('0x7')],{'host':_0x557f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x557f('0x7')]));require(_0x557f('0xa'))[_0x557f('0xb')](socket);function respondWithRpcPromise(_0x4bd55c,_0x378346,_0x5df4d5){return new BPromise(function(_0x363e24,_0x514113){return client[_0x557f('0xc')](_0x4bd55c,_0x5df4d5)[_0x557f('0xd')](function(_0x2fd53c){logger[_0x557f('0xe')](_0x557f('0xf'),_0x378346,_0x557f('0x10'));logger[_0x557f('0x11')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x378346,_0x557f('0x10'),JSON['stringify'](_0x2fd53c));if(_0x2fd53c['error']){if(_0x2fd53c['error']['code']===0x1f4){logger[_0x557f('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x378346,_0x2fd53c['error']['message']);return _0x514113(_0x2fd53c[_0x557f('0x12')]['message']);}logger[_0x557f('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x378346,_0x2fd53c[_0x557f('0x12')][_0x557f('0x13')]);return _0x363e24(_0x2fd53c[_0x557f('0x12')][_0x557f('0x13')]);}else{logger[_0x557f('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x378346,_0x557f('0x10'));_0x363e24(_0x2fd53c['result'][_0x557f('0x13')]);}})['catch'](function(_0x1a56b4){logger[_0x557f('0x12')](_0x557f('0xf'),_0x378346,_0x1a56b4);_0x514113(_0x1a56b4);});});}exports[_0x557f('0x14')]=function(_0x2d185f){var _0x30b394=this;return new Promise(function(_0x3ea223,_0x41b89f){return db[_0x557f('0x15')]['findAll']({'raw':_0x2d185f[_0x557f('0x16')]?_0x2d185f['options'][_0x557f('0x17')]===undefined?!![]:![]:!![],'where':_0x2d185f[_0x557f('0x16')]?_0x2d185f[_0x557f('0x16')][_0x557f('0x18')]||null:null,'attributes':_0x2d185f['options']?_0x2d185f[_0x557f('0x16')][_0x557f('0x19')]||null:null,'limit':_0x2d185f[_0x557f('0x16')]?_0x2d185f[_0x557f('0x16')][_0x557f('0x1a')]||null:null,'include':_0x2d185f['options']?_0x2d185f['options']['include']?_[_0x557f('0x1b')](_0x2d185f[_0x557f('0x16')]['include'],function(_0x8dd9cb){return{'model':db[_0x8dd9cb['model']],'as':_0x8dd9cb['as'],'attributes':_0x8dd9cb[_0x557f('0x19')],'include':_0x8dd9cb[_0x557f('0x1c')]?_[_0x557f('0x1b')](_0x8dd9cb[_0x557f('0x1c')],function(_0x15fd72){return{'model':db[_0x15fd72[_0x557f('0x1d')]],'as':_0x15fd72['as'],'attributes':_0x15fd72[_0x557f('0x19')],'include':_0x15fd72[_0x557f('0x1c')]?_['map'](_0x15fd72[_0x557f('0x1c')],function(_0x1c661a){return{'model':db[_0x1c661a[_0x557f('0x1d')]],'as':_0x1c661a['as'],'attributes':_0x1c661a[_0x557f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x557f('0xd')](function(_0x4354c9){logger['info']('GetWhatsappQueue',_0x2d185f);logger[_0x557f('0x11')](_0x557f('0x14'),_0x2d185f,JSON[_0x557f('0x1e')](_0x4354c9));_0x3ea223(_0x4354c9);})[_0x557f('0x1f')](function(_0x4aa89d){logger[_0x557f('0x12')]('GetWhatsappQueue',_0x4aa89d['message'],_0x2d185f);_0x41b89f(_0x30b394[_0x557f('0x12')](0x1f4,_0x4aa89d[_0x557f('0x13')]));});});};exports[_0x557f('0x20')]=function(_0x42b415){var _0x24309f=this;return new Promise(function(_0x3dcf6d,_0x5a496d){return db[_0x557f('0x15')][_0x557f('0x21')]({'raw':_0x42b415[_0x557f('0x16')]?_0x42b415[_0x557f('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x42b415['options']?_0x42b415[_0x557f('0x16')][_0x557f('0x18')]||null:null,'attributes':_0x42b415[_0x557f('0x16')]?_0x42b415[_0x557f('0x16')][_0x557f('0x19')]||null:null,'include':_0x42b415[_0x557f('0x16')]?_0x42b415[_0x557f('0x16')][_0x557f('0x1c')]?_[_0x557f('0x1b')](_0x42b415[_0x557f('0x16')][_0x557f('0x1c')],function(_0x5445e0){return{'model':db[_0x5445e0[_0x557f('0x1d')]],'as':_0x5445e0['as'],'attributes':_0x5445e0['attributes'],'include':_0x5445e0[_0x557f('0x1c')]?_[_0x557f('0x1b')](_0x5445e0[_0x557f('0x1c')],function(_0x314514){return{'model':db[_0x314514['model']],'as':_0x314514['as'],'attributes':_0x314514[_0x557f('0x19')],'include':_0x314514[_0x557f('0x1c')]?_[_0x557f('0x1b')](_0x314514[_0x557f('0x1c')],function(_0x54c420){return{'model':db[_0x54c420[_0x557f('0x1d')]],'as':_0x54c420['as'],'attributes':_0x54c420[_0x557f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x557f('0xd')](function(_0x258f27){logger[_0x557f('0xe')]('ShowWhatsappQueue',_0x42b415);logger[_0x557f('0x11')](_0x557f('0x20'),_0x42b415,JSON[_0x557f('0x1e')](_0x258f27));_0x3dcf6d(_0x258f27);})[_0x557f('0x1f')](function(_0x4ed17d){logger[_0x557f('0x12')](_0x557f('0x20'),_0x4ed17d['message'],_0x42b415);_0x5a496d(_0x24309f[_0x557f('0x12')](0x1f4,_0x4ed17d[_0x557f('0x13')]));});});};
\ No newline at end of file
+var _0xa6c7=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','redis','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','WhatsappQueue','findAll','options','where','attributes','limit','include','model','GetWhatsappQueue','ShowWhatsappQueue','find','map','lodash','util','moment','bluebird'];(function(_0x4fabc8,_0x327294){var _0x169a16=function(_0x5e6692){while(--_0x5e6692){_0x4fabc8['push'](_0x4fabc8['shift']());}};_0x169a16(++_0x327294);}(_0xa6c7,0x1c4));var _0x7a6c=function(_0x5527f8,_0x341797){_0x5527f8=_0x5527f8-0x0;var _0x5e8889=_0xa6c7[_0x5527f8];return _0x5e8889;};'use strict';var _=require(_0x7a6c('0x0'));var util=require(_0x7a6c('0x1'));var moment=require(_0x7a6c('0x2'));var BPromise=require(_0x7a6c('0x3'));var rs=require(_0x7a6c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7a6c('0x5'));var logger=require(_0x7a6c('0x6'))(_0x7a6c('0x7'));var config=require(_0x7a6c('0x8'));var jayson=require(_0x7a6c('0x9'));var client=jayson[_0x7a6c('0xa')][_0x7a6c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7a6c('0xc'))(new Redis(config[_0x7a6c('0xd')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4d4775,_0x1187fa,_0x38d13c){return new BPromise(function(_0x1076d1,_0x2ec2ea){return client[_0x7a6c('0xe')](_0x4d4775,_0x38d13c)[_0x7a6c('0xf')](function(_0x4ee01c){logger[_0x7a6c('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x1187fa,_0x7a6c('0x11'));logger[_0x7a6c('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1187fa,_0x7a6c('0x11'),JSON[_0x7a6c('0x13')](_0x4ee01c));if(_0x4ee01c[_0x7a6c('0x14')]){if(_0x4ee01c[_0x7a6c('0x14')][_0x7a6c('0x15')]===0x1f4){logger[_0x7a6c('0x14')](_0x7a6c('0x16'),_0x1187fa,_0x4ee01c[_0x7a6c('0x14')]['message']);return _0x2ec2ea(_0x4ee01c[_0x7a6c('0x14')]['message']);}logger['error'](_0x7a6c('0x16'),_0x1187fa,_0x4ee01c[_0x7a6c('0x14')][_0x7a6c('0x17')]);return _0x1076d1(_0x4ee01c['error'][_0x7a6c('0x17')]);}else{logger['info'](_0x7a6c('0x16'),_0x1187fa,'request\x20sent');_0x1076d1(_0x4ee01c[_0x7a6c('0x18')][_0x7a6c('0x17')]);}})[_0x7a6c('0x19')](function(_0x18c726){logger[_0x7a6c('0x14')](_0x7a6c('0x16'),_0x1187fa,_0x18c726);_0x2ec2ea(_0x18c726);});});}exports['GetWhatsappQueue']=function(_0x40d83d){var _0x563d6e=this;return new Promise(function(_0x3bc551,_0x11c6ea){return db[_0x7a6c('0x1a')][_0x7a6c('0x1b')]({'raw':_0x40d83d[_0x7a6c('0x1c')]?_0x40d83d[_0x7a6c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x40d83d[_0x7a6c('0x1c')]?_0x40d83d[_0x7a6c('0x1c')][_0x7a6c('0x1d')]||null:null,'attributes':_0x40d83d[_0x7a6c('0x1c')]?_0x40d83d[_0x7a6c('0x1c')][_0x7a6c('0x1e')]||null:null,'limit':_0x40d83d[_0x7a6c('0x1c')]?_0x40d83d[_0x7a6c('0x1c')][_0x7a6c('0x1f')]||null:null,'include':_0x40d83d['options']?_0x40d83d[_0x7a6c('0x1c')][_0x7a6c('0x20')]?_['map'](_0x40d83d[_0x7a6c('0x1c')][_0x7a6c('0x20')],function(_0x261004){return{'model':db[_0x261004[_0x7a6c('0x21')]],'as':_0x261004['as'],'attributes':_0x261004[_0x7a6c('0x1e')],'include':_0x261004[_0x7a6c('0x20')]?_['map'](_0x261004[_0x7a6c('0x20')],function(_0x10f1b){return{'model':db[_0x10f1b[_0x7a6c('0x21')]],'as':_0x10f1b['as'],'attributes':_0x10f1b[_0x7a6c('0x1e')],'include':_0x10f1b['include']?_['map'](_0x10f1b[_0x7a6c('0x20')],function(_0x12d3ed){return{'model':db[_0x12d3ed[_0x7a6c('0x21')]],'as':_0x12d3ed['as'],'attributes':_0x12d3ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a6c('0xf')](function(_0x9255d4){logger[_0x7a6c('0x10')]('GetWhatsappQueue',_0x40d83d);logger[_0x7a6c('0x12')](_0x7a6c('0x22'),_0x40d83d,JSON[_0x7a6c('0x13')](_0x9255d4));_0x3bc551(_0x9255d4);})[_0x7a6c('0x19')](function(_0x3b64c8){logger['error'](_0x7a6c('0x22'),_0x3b64c8[_0x7a6c('0x17')],_0x40d83d);_0x11c6ea(_0x563d6e[_0x7a6c('0x14')](0x1f4,_0x3b64c8[_0x7a6c('0x17')]));});});};exports[_0x7a6c('0x23')]=function(_0x5bb7ce){var _0x2a1153=this;return new Promise(function(_0x4d03be,_0xb0e8a){return db[_0x7a6c('0x1a')][_0x7a6c('0x24')]({'raw':_0x5bb7ce['options']?_0x5bb7ce[_0x7a6c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5bb7ce[_0x7a6c('0x1c')]?_0x5bb7ce[_0x7a6c('0x1c')][_0x7a6c('0x1d')]||null:null,'attributes':_0x5bb7ce[_0x7a6c('0x1c')]?_0x5bb7ce[_0x7a6c('0x1c')][_0x7a6c('0x1e')]||null:null,'include':_0x5bb7ce['options']?_0x5bb7ce['options'][_0x7a6c('0x20')]?_[_0x7a6c('0x25')](_0x5bb7ce[_0x7a6c('0x1c')][_0x7a6c('0x20')],function(_0x2a04e6){return{'model':db[_0x2a04e6[_0x7a6c('0x21')]],'as':_0x2a04e6['as'],'attributes':_0x2a04e6[_0x7a6c('0x1e')],'include':_0x2a04e6['include']?_['map'](_0x2a04e6['include'],function(_0x33179f){return{'model':db[_0x33179f[_0x7a6c('0x21')]],'as':_0x33179f['as'],'attributes':_0x33179f[_0x7a6c('0x1e')],'include':_0x33179f['include']?_[_0x7a6c('0x25')](_0x33179f[_0x7a6c('0x20')],function(_0x316968){return{'model':db[_0x316968[_0x7a6c('0x21')]],'as':_0x316968['as'],'attributes':_0x316968[_0x7a6c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7a6c('0xf')](function(_0xd75e85){logger['info'](_0x7a6c('0x23'),_0x5bb7ce);logger[_0x7a6c('0x12')](_0x7a6c('0x23'),_0x5bb7ce,JSON[_0x7a6c('0x13')](_0xd75e85));_0x4d03be(_0xd75e85);})['catch'](function(_0x354fb1){logger['error'](_0x7a6c('0x23'),_0x354fb1['message'],_0x5bb7ce);_0xb0e8a(_0x2a1153['error'](0x1f4,_0x354fb1[_0x7a6c('0x17')]));});});};
\ No newline at end of file
index 6addf6f..c6441bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77fa=['register','length','./whatsappQueue.events','remove','emit','removeListener'];(function(_0x349d0c,_0x10987b){var _0x2dce5d=function(_0x6375e9){while(--_0x6375e9){_0x349d0c['push'](_0x349d0c['shift']());}};_0x2dce5d(++_0x10987b);}(_0x77fa,0x1ee));var _0xa77f=function(_0x2caf17,_0x32152d){_0x2caf17=_0x2caf17-0x0;var _0x597787=_0x77fa[_0x2caf17];return _0x597787;};'use strict';var WhatsappQueueEvents=require(_0xa77f('0x0'));var events=['save',_0xa77f('0x1'),'update'];function createListener(_0x3f379a,_0x4a08cb){return function(_0x2065da){_0x4a08cb[_0xa77f('0x2')](_0x3f379a,_0x2065da);};}function removeListener(_0x215fcd,_0x19575c){return function(){WhatsappQueueEvents[_0xa77f('0x3')](_0x215fcd,_0x19575c);};}exports[_0xa77f('0x4')]=function(_0x119d46){for(var _0x642af1=0x0,_0x20bbd8=events[_0xa77f('0x5')];_0x642af1<_0x20bbd8;_0x642af1++){var _0x41b831=events[_0x642af1];var _0x5b431b=createListener('whatsappQueue:'+_0x41b831,_0x119d46);WhatsappQueueEvents['on'](_0x41b831,_0x5b431b);}};
\ No newline at end of file
+var _0xaf3f=['./whatsappQueue.events','save','remove','update','emit','register','length','whatsappQueue:'];(function(_0x56a626,_0x582d3c){var _0x388b44=function(_0xdfd9b1){while(--_0xdfd9b1){_0x56a626['push'](_0x56a626['shift']());}};_0x388b44(++_0x582d3c);}(_0xaf3f,0xa8));var _0xfaf3=function(_0x2f36d5,_0x1b79e0){_0x2f36d5=_0x2f36d5-0x0;var _0x393e6b=_0xaf3f[_0x2f36d5];return _0x393e6b;};'use strict';var WhatsappQueueEvents=require(_0xfaf3('0x0'));var events=[_0xfaf3('0x1'),_0xfaf3('0x2'),_0xfaf3('0x3')];function createListener(_0x24fcc4,_0x3c4b32){return function(_0x75081b){_0x3c4b32[_0xfaf3('0x4')](_0x24fcc4,_0x75081b);};}function removeListener(_0xcaef6c,_0x3f9f05){return function(){WhatsappQueueEvents['removeListener'](_0xcaef6c,_0x3f9f05);};}exports[_0xfaf3('0x5')]=function(_0x39cb26){for(var _0x15a5d9=0x0,_0x3daa9d=events[_0xfaf3('0x6')];_0x15a5d9<_0x3daa9d;_0x15a5d9++){var _0x47ba9b=events[_0x15a5d9];var _0x3b8d92=createListener(_0xfaf3('0x7')+_0x47ba9b,_0x39cb26);WhatsappQueueEvents['on'](_0x47ba9b,_0x3b8d92);}};
\ No newline at end of file
index 8dd2092..08dbc05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x107e=['describe','/:id','show','put','update','delete','destroy','path','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x54db99,_0x2161b4){var _0x5bbac0=function(_0x350f33){while(--_0x350f33){_0x54db99['push'](_0x54db99['shift']());}};_0x5bbac0(++_0x2161b4);}(_0x107e,0xe8));var _0xe107=function(_0x4851a5,_0x14cffd){_0x4851a5=_0x4851a5-0x0;var _0x5ec6fa=_0x107e[_0x4851a5];return _0x5ec6fa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe107('0x0'));var timeout=require(_0xe107('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xe107('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xe107('0x3'));var controller=require('./whatsappQueueReport.controller');router[_0xe107('0x4')]('/',auth[_0xe107('0x5')](),controller[_0xe107('0x6')]);router['get'](_0xe107('0x7'),auth[_0xe107('0x5')](),controller[_0xe107('0x8')]);router[_0xe107('0x4')](_0xe107('0x9'),auth[_0xe107('0x5')](),controller[_0xe107('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe107('0xb')](_0xe107('0x9'),auth[_0xe107('0x5')](),controller[_0xe107('0xc')]);router[_0xe107('0xd')](_0xe107('0x9'),auth[_0xe107('0x5')](),controller[_0xe107('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xa498=['express','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','exports','multer','util','path'];(function(_0x4eb8f6,_0xadd652){var _0x5da2a5=function(_0x1d3396){while(--_0x1d3396){_0x4eb8f6['push'](_0x4eb8f6['shift']());}};_0x5da2a5(++_0xadd652);}(_0xa498,0x179));var _0x8a49=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0xa498[_0x4eaa4c];return _0x15aec6;};'use strict';var multer=require(_0x8a49('0x0'));var util=require(_0x8a49('0x1'));var path=require(_0x8a49('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a49('0x3'));var router=express[_0x8a49('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8a49('0x5'));var config=require(_0x8a49('0x6'));var controller=require(_0x8a49('0x7'));router[_0x8a49('0x8')]('/',auth[_0x8a49('0x9')](),controller[_0x8a49('0xa')]);router['get'](_0x8a49('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8a49('0x8')](_0x8a49('0xc'),auth[_0x8a49('0x9')](),controller[_0x8a49('0xd')]);router[_0x8a49('0xe')]('/',auth[_0x8a49('0x9')](),controller['create']);router[_0x8a49('0xf')](_0x8a49('0xc'),auth[_0x8a49('0x9')](),controller[_0x8a49('0x10')]);router[_0x8a49('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8a49('0x12')]=router;
\ No newline at end of file
index 1ab3e05..d14e1e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['DATE','STRING','sequelize','exports'];(function(_0x4c325c,_0x2b21c6){var _0x1233d3=function(_0x4d4134){while(--_0x4d4134){_0x4c325c['push'](_0x4c325c['shift']());}};_0x1233d3(++_0x2b21c6);}(_0x55ca,0x126));var _0xa55c=function(_0x55eb57,_0x1011e2){_0x55eb57=_0x55eb57-0x0;var _0x55ca29=_0x55ca[_0x55eb57];return _0x55ca29;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa55c('0x2')]},'acceptAt':{'type':Sequelize[_0xa55c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa55c('0x3')]}};
\ No newline at end of file
+var _0x00bb=['sequelize','exports','STRING','DATE'];(function(_0x5c6b3a,_0x50d650){var _0x5d96b4=function(_0x51a0a7){while(--_0x51a0a7){_0x5c6b3a['push'](_0x5c6b3a['shift']());}};_0x5d96b4(++_0x50d650);}(_0x00bb,0x1d8));var _0xb00b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x00bb[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'uniqueid':{'type':Sequelize[_0xb00b('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb00b('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb00b('0x3')]},'exitAt':{'type':Sequelize[_0xb00b('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index beeef96..c6dab4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cad=['query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','count','includeAll','WhatsappQueueReport','findAll','catch','params','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys'];(function(_0x53b29b,_0x5ea75e){var _0x3c2a66=function(_0x4edfbe){while(--_0x4edfbe){_0x53b29b['push'](_0x53b29b['shift']());}};_0x3c2a66(++_0x5ea75e);}(_0x8cad,0xfe));var _0xd8ca=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x8cad[_0x4ae6ef];return _0x3cbb4e;};'use strict';var pdf=require(_0xd8ca('0x0'));var emlformat=require(_0xd8ca('0x1'));var rimraf=require(_0xd8ca('0x2'));var zipdir=require(_0xd8ca('0x3'));var jsonpatch=require(_0xd8ca('0x4'));var rp=require(_0xd8ca('0x5'));var moment=require(_0xd8ca('0x6'));var BPromise=require(_0xd8ca('0x7'));var Mustache=require(_0xd8ca('0x8'));var util=require(_0xd8ca('0x9'));var path=require(_0xd8ca('0xa'));var sox=require(_0xd8ca('0xb'));var csv=require(_0xd8ca('0xc'));var ejs=require(_0xd8ca('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd8ca('0xe'));var crypto=require(_0xd8ca('0xf'));var jsforce=require(_0xd8ca('0x10'));var deskjs=require(_0xd8ca('0x11'));var toCsv=require(_0xd8ca('0xc'));var querystring=require('querystring');var Papa=require(_0xd8ca('0x12'));var Redis=require('ioredis');var authService=require(_0xd8ca('0x13'));var qs=require(_0xd8ca('0x14'));var as=require(_0xd8ca('0x15'));var hardwareService=require(_0xd8ca('0x16'));var logger=require(_0xd8ca('0x17'))(_0xd8ca('0x18'));var utils=require('../../config/utils');var config=require(_0xd8ca('0x19'));var db=require(_0xd8ca('0x1a'))['db'];function respondWithStatusCode(_0x1366d0,_0x102b16){_0x102b16=_0x102b16||0xcc;return function(_0x326272){if(_0x326272){return _0x1366d0[_0xd8ca('0x1b')](_0x102b16);}return _0x1366d0[_0xd8ca('0x1c')](_0x102b16)[_0xd8ca('0x1d')]();};}function respondWithResult(_0x223dc5,_0x52726a){_0x52726a=_0x52726a||0xc8;return function(_0x58969b){if(_0x58969b){return _0x223dc5[_0xd8ca('0x1c')](_0x52726a)[_0xd8ca('0x1e')](_0x58969b);}};}function respondWithFilteredResult(_0x24fb2d,_0x647962){return function(_0x177367){if(_0x177367){var _0x17330a=_0x177367['count'],_0x3013f2=_0x647962[_0xd8ca('0x1f')],_0x229d85=_0x647962[_0xd8ca('0x1f')]+_0x647962[_0xd8ca('0x20')],_0x738557;if(_0x229d85>=_0x17330a){_0x229d85=_0x17330a;_0x738557=0xc8;}else{_0x738557=0xce;}_0x24fb2d[_0xd8ca('0x1c')](_0x738557);return _0x24fb2d['set']('Content-Range',_0x3013f2+'-'+_0x229d85+'/'+_0x17330a)[_0xd8ca('0x1e')](_0x177367);}return null;};}function patchUpdates(_0x570b65){return function(_0x2d43dd){try{jsonpatch[_0xd8ca('0x21')](_0x2d43dd,_0x570b65,!![]);}catch(_0x348482){return BPromise[_0xd8ca('0x22')](_0x348482);}return _0x2d43dd[_0xd8ca('0x23')]();};}function saveUpdates(_0x1cd349,_0x56ea7e){return function(_0xa18ac1){if(_0xa18ac1){return _0xa18ac1[_0xd8ca('0x24')](_0x1cd349)[_0xd8ca('0x25')](function(_0x425df5){return _0x425df5;});}return null;};}function removeEntity(_0x5d9ba3,_0x23854a){return function(_0x3053f0){if(_0x3053f0){return _0x3053f0[_0xd8ca('0x26')]()['then'](function(){_0x5d9ba3[_0xd8ca('0x1c')](0xcc)[_0xd8ca('0x1d')]();});}};}function handleEntityNotFound(_0xb42d0c,_0xbf3254){return function(_0x424d81){if(!_0x424d81){_0xb42d0c[_0xd8ca('0x1b')](0x194);}return _0x424d81;};}function handleError(_0x1bf1dc,_0x508562){_0x508562=_0x508562||0x1f4;return function(_0x2770e4){logger[_0xd8ca('0x27')](_0x2770e4['stack']);if(_0x2770e4[_0xd8ca('0x28')]){delete _0x2770e4[_0xd8ca('0x28')];}_0x1bf1dc[_0xd8ca('0x1c')](_0x508562)[_0xd8ca('0x29')](_0x2770e4);};}exports[_0xd8ca('0x2a')]=function(_0x133579,_0x5e8750){var _0x1a91c9={},_0x49b14c={},_0x411b27={'count':0x0,'rows':[]};var _0x440a6a=_['map'](db['WhatsappQueueReport'][_0xd8ca('0x2b')],function(_0x4641af){return{'name':_0x4641af[_0xd8ca('0x2c')],'type':_0x4641af[_0xd8ca('0x2d')][_0xd8ca('0x2e')]};});_0x49b14c[_0xd8ca('0x2f')]=_[_0xd8ca('0x30')](_0x440a6a,_0xd8ca('0x28'));_0x49b14c['query']=_[_0xd8ca('0x31')](_0x133579[_0xd8ca('0x32')]);_0x49b14c[_0xd8ca('0x33')]=_['intersection'](_0x49b14c['model'],_0x49b14c[_0xd8ca('0x32')]);_0x1a91c9[_0xd8ca('0x34')]=_[_0xd8ca('0x35')](_0x49b14c[_0xd8ca('0x2f')],qs[_0xd8ca('0x36')](_0x133579[_0xd8ca('0x32')][_0xd8ca('0x36')]));_0x1a91c9[_0xd8ca('0x34')]=_0x1a91c9['attributes'][_0xd8ca('0x37')]?_0x1a91c9[_0xd8ca('0x34')]:_0x49b14c[_0xd8ca('0x2f')];if(!_0x133579[_0xd8ca('0x32')][_0xd8ca('0x38')](_0xd8ca('0x39'))){_0x1a91c9[_0xd8ca('0x20')]=qs[_0xd8ca('0x20')](_0x133579['query'][_0xd8ca('0x20')]);_0x1a91c9[_0xd8ca('0x1f')]=qs[_0xd8ca('0x1f')](_0x133579['query'][_0xd8ca('0x1f')]);}_0x1a91c9[_0xd8ca('0x3a')]=qs[_0xd8ca('0x3b')](_0x133579['query'][_0xd8ca('0x3b')]);_0x1a91c9['where']=qs[_0xd8ca('0x33')](_['pick'](_0x133579[_0xd8ca('0x32')],_0x49b14c[_0xd8ca('0x33')]),_0x440a6a);if(_0x133579[_0xd8ca('0x32')]['filter']){_0x1a91c9[_0xd8ca('0x3c')]=_[_0xd8ca('0x3d')](_0x1a91c9['where'],{'$or':_[_0xd8ca('0x30')](_0x440a6a,function(_0x475ee4){if(_0x475ee4['type']!==_0xd8ca('0x3e')){var _0x4203d0={};_0x4203d0[_0x475ee4['name']]={'$like':'%'+_0x133579[_0xd8ca('0x32')][_0xd8ca('0x3f')]+'%'};return _0x4203d0;}})});}_0x1a91c9=_[_0xd8ca('0x3d')]({},_0x1a91c9,_0x133579['options']);var _0x4b440f={'where':_0x1a91c9[_0xd8ca('0x3c')]};return db['WhatsappQueueReport'][_0xd8ca('0x40')](_0x4b440f)['then'](function(_0x214dcf){_0x411b27[_0xd8ca('0x40')]=_0x214dcf;if(_0x133579[_0xd8ca('0x32')][_0xd8ca('0x41')]){_0x1a91c9['include']=[{'all':!![]}];}return db[_0xd8ca('0x42')][_0xd8ca('0x43')](_0x1a91c9);})[_0xd8ca('0x25')](function(_0x50c898){_0x411b27['rows']=_0x50c898;return _0x411b27;})[_0xd8ca('0x25')](respondWithFilteredResult(_0x5e8750,_0x1a91c9))[_0xd8ca('0x44')](handleError(_0x5e8750,null));};exports['show']=function(_0x43d452,_0x349956){var _0x43fcee={'raw':!![],'where':{'id':_0x43d452[_0xd8ca('0x45')]['id']}},_0xa204de={};_0xa204de[_0xd8ca('0x2f')]=_['keys'](db[_0xd8ca('0x42')][_0xd8ca('0x2b')]);_0xa204de[_0xd8ca('0x32')]=_[_0xd8ca('0x31')](_0x43d452[_0xd8ca('0x32')]);_0xa204de[_0xd8ca('0x33')]=_[_0xd8ca('0x35')](_0xa204de[_0xd8ca('0x2f')],_0xa204de['query']);_0x43fcee[_0xd8ca('0x34')]=_[_0xd8ca('0x35')](_0xa204de['model'],qs['fields'](_0x43d452[_0xd8ca('0x32')][_0xd8ca('0x36')]));_0x43fcee[_0xd8ca('0x34')]=_0x43fcee[_0xd8ca('0x34')][_0xd8ca('0x37')]?_0x43fcee[_0xd8ca('0x34')]:_0xa204de[_0xd8ca('0x2f')];if(_0x43d452[_0xd8ca('0x32')]['includeAll']){_0x43fcee[_0xd8ca('0x46')]=[{'all':!![]}];}_0x43fcee=_[_0xd8ca('0x3d')]({},_0x43fcee,_0x43d452[_0xd8ca('0x47')]);return db[_0xd8ca('0x42')][_0xd8ca('0x48')](_0x43fcee)[_0xd8ca('0x25')](handleEntityNotFound(_0x349956,null))[_0xd8ca('0x25')](respondWithResult(_0x349956,null))[_0xd8ca('0x44')](handleError(_0x349956,null));};exports['create']=function(_0x6d7de6,_0x26d2f3){return db['WhatsappQueueReport'][_0xd8ca('0x49')](_0x6d7de6[_0xd8ca('0x4a')],{})[_0xd8ca('0x25')](respondWithResult(_0x26d2f3,0xc9))[_0xd8ca('0x44')](handleError(_0x26d2f3,null));};exports[_0xd8ca('0x24')]=function(_0x31ca73,_0x441d1f){if(_0x31ca73[_0xd8ca('0x4a')]['id']){delete _0x31ca73['body']['id'];}return db[_0xd8ca('0x42')][_0xd8ca('0x48')]({'where':{'id':_0x31ca73[_0xd8ca('0x45')]['id']}})['then'](handleEntityNotFound(_0x441d1f,null))[_0xd8ca('0x25')](saveUpdates(_0x31ca73[_0xd8ca('0x4a')],null))[_0xd8ca('0x25')](respondWithResult(_0x441d1f,null))[_0xd8ca('0x44')](handleError(_0x441d1f,null));};exports[_0xd8ca('0x26')]=function(_0x1c99c0,_0x38949c){return db[_0xd8ca('0x42')][_0xd8ca('0x48')]({'where':{'id':_0x1c99c0[_0xd8ca('0x45')]['id']}})[_0xd8ca('0x25')](handleEntityNotFound(_0x38949c,null))['then'](removeEntity(_0x38949c,null))[_0xd8ca('0x44')](handleError(_0x38949c,null));};exports[_0xd8ca('0x4b')]=function(_0x541307,_0x359cfe){return db[_0xd8ca('0x42')][_0xd8ca('0x4b')]()[_0xd8ca('0x25')](respondWithResult(_0x359cfe,null))[_0xd8ca('0x44')](handleError(_0x359cfe,null));};
\ No newline at end of file
+var _0x3445=['json','offset','limit','save','update','then','end','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','merge','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status'];(function(_0x114adc,_0x1b1c55){var _0x19199a=function(_0x2c9442){while(--_0x2c9442){_0x114adc['push'](_0x114adc['shift']());}};_0x19199a(++_0x1b1c55);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5344('0x0'));var emlformat=require(_0x5344('0x1'));var rimraf=require(_0x5344('0x2'));var zipdir=require(_0x5344('0x3'));var jsonpatch=require(_0x5344('0x4'));var rp=require(_0x5344('0x5'));var moment=require(_0x5344('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5344('0x7'));var path=require(_0x5344('0x8'));var sox=require(_0x5344('0x9'));var csv=require(_0x5344('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5344('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5344('0xc'));var Papa=require(_0x5344('0xd'));var Redis=require(_0x5344('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5344('0xf'));var as=require(_0x5344('0x10'));var hardwareService=require(_0x5344('0x11'));var logger=require(_0x5344('0x12'))(_0x5344('0x13'));var utils=require(_0x5344('0x14'));var config=require('../../config/environment');var db=require(_0x5344('0x15'))['db'];function respondWithStatusCode(_0x167214,_0x53ec8c){_0x53ec8c=_0x53ec8c||0xcc;return function(_0x2b9f5a){if(_0x2b9f5a){return _0x167214['sendStatus'](_0x53ec8c);}return _0x167214[_0x5344('0x16')](_0x53ec8c)['end']();};}function respondWithResult(_0x5e825e,_0x52f150){_0x52f150=_0x52f150||0xc8;return function(_0x9aee50){if(_0x9aee50){return _0x5e825e[_0x5344('0x16')](_0x52f150)[_0x5344('0x17')](_0x9aee50);}};}function respondWithFilteredResult(_0x1a4fca,_0x2cfb71){return function(_0x6eeedc){if(_0x6eeedc){var _0x16f302=_0x6eeedc['count'],_0x307f63=_0x2cfb71[_0x5344('0x18')],_0x41906d=_0x2cfb71[_0x5344('0x18')]+_0x2cfb71[_0x5344('0x19')],_0x405630;if(_0x41906d>=_0x16f302){_0x41906d=_0x16f302;_0x405630=0xc8;}else{_0x405630=0xce;}_0x1a4fca[_0x5344('0x16')](_0x405630);return _0x1a4fca['set']('Content-Range',_0x307f63+'-'+_0x41906d+'/'+_0x16f302)['json'](_0x6eeedc);}return null;};}function patchUpdates(_0x1a48b7){return function(_0x4bb855){try{jsonpatch['apply'](_0x4bb855,_0x1a48b7,!![]);}catch(_0x4a636e){return BPromise['reject'](_0x4a636e);}return _0x4bb855[_0x5344('0x1a')]();};}function saveUpdates(_0xa623c5,_0x228212){return function(_0x2e5511){if(_0x2e5511){return _0x2e5511[_0x5344('0x1b')](_0xa623c5)[_0x5344('0x1c')](function(_0x72a04c){return _0x72a04c;});}return null;};}function removeEntity(_0x373d9e,_0x22caa8){return function(_0xdcf9d1){if(_0xdcf9d1){return _0xdcf9d1['destroy']()['then'](function(){_0x373d9e[_0x5344('0x16')](0xcc)[_0x5344('0x1d')]();});}};}function handleEntityNotFound(_0x2cb34d,_0x434e0d){return function(_0x1f3157){if(!_0x1f3157){_0x2cb34d['sendStatus'](0x194);}return _0x1f3157;};}function handleError(_0x1226c6,_0x1c86fe){_0x1c86fe=_0x1c86fe||0x1f4;return function(_0xe1c211){logger[_0x5344('0x1e')](_0xe1c211['stack']);if(_0xe1c211[_0x5344('0x1f')]){delete _0xe1c211[_0x5344('0x1f')];}_0x1226c6[_0x5344('0x16')](_0x1c86fe)[_0x5344('0x20')](_0xe1c211);};}exports['index']=function(_0x4a9e3d,_0x30a760){var _0x30f6f8={},_0x3471a9={},_0x28b50b={'count':0x0,'rows':[]};var _0x494997=_[_0x5344('0x21')](db[_0x5344('0x22')][_0x5344('0x23')],function(_0x415e6e){return{'name':_0x415e6e[_0x5344('0x24')],'type':_0x415e6e[_0x5344('0x25')][_0x5344('0x26')]};});_0x3471a9['model']=_[_0x5344('0x21')](_0x494997,'name');_0x3471a9[_0x5344('0x27')]=_[_0x5344('0x28')](_0x4a9e3d[_0x5344('0x27')]);_0x3471a9[_0x5344('0x29')]=_[_0x5344('0x2a')](_0x3471a9[_0x5344('0x2b')],_0x3471a9[_0x5344('0x27')]);_0x30f6f8[_0x5344('0x2c')]=_[_0x5344('0x2a')](_0x3471a9['model'],qs[_0x5344('0x2d')](_0x4a9e3d[_0x5344('0x27')][_0x5344('0x2d')]));_0x30f6f8[_0x5344('0x2c')]=_0x30f6f8['attributes'][_0x5344('0x2e')]?_0x30f6f8[_0x5344('0x2c')]:_0x3471a9['model'];if(!_0x4a9e3d[_0x5344('0x27')][_0x5344('0x2f')]('nolimit')){_0x30f6f8[_0x5344('0x19')]=qs[_0x5344('0x19')](_0x4a9e3d['query'][_0x5344('0x19')]);_0x30f6f8[_0x5344('0x18')]=qs['offset'](_0x4a9e3d[_0x5344('0x27')][_0x5344('0x18')]);}_0x30f6f8[_0x5344('0x30')]=qs[_0x5344('0x31')](_0x4a9e3d[_0x5344('0x27')]['sort']);_0x30f6f8['where']=qs[_0x5344('0x29')](_['pick'](_0x4a9e3d['query'],_0x3471a9['filters']),_0x494997);if(_0x4a9e3d[_0x5344('0x27')][_0x5344('0x32')]){_0x30f6f8[_0x5344('0x33')]=_['merge'](_0x30f6f8[_0x5344('0x33')],{'$or':_['map'](_0x494997,function(_0x5c2d1a){if(_0x5c2d1a['type']!==_0x5344('0x34')){var _0x1d855f={};_0x1d855f[_0x5c2d1a[_0x5344('0x1f')]]={'$like':'%'+_0x4a9e3d[_0x5344('0x27')][_0x5344('0x32')]+'%'};return _0x1d855f;}})});}_0x30f6f8=_['merge']({},_0x30f6f8,_0x4a9e3d[_0x5344('0x35')]);var _0x1c314e={'where':_0x30f6f8[_0x5344('0x33')]};return db[_0x5344('0x22')]['count'](_0x1c314e)[_0x5344('0x1c')](function(_0x32e058){_0x28b50b[_0x5344('0x36')]=_0x32e058;if(_0x4a9e3d[_0x5344('0x27')][_0x5344('0x37')]){_0x30f6f8[_0x5344('0x38')]=[{'all':!![]}];}return db[_0x5344('0x22')][_0x5344('0x39')](_0x30f6f8);})['then'](function(_0x3bf6d8){_0x28b50b[_0x5344('0x3a')]=_0x3bf6d8;return _0x28b50b;})[_0x5344('0x1c')](respondWithFilteredResult(_0x30a760,_0x30f6f8))[_0x5344('0x3b')](handleError(_0x30a760,null));};exports['show']=function(_0x155996,_0x3b7fd6){var _0x51720d={'raw':!![],'where':{'id':_0x155996[_0x5344('0x3c')]['id']}},_0x167d2a={};_0x167d2a['model']=_[_0x5344('0x28')](db[_0x5344('0x22')]['rawAttributes']);_0x167d2a[_0x5344('0x27')]=_[_0x5344('0x28')](_0x155996[_0x5344('0x27')]);_0x167d2a[_0x5344('0x29')]=_[_0x5344('0x2a')](_0x167d2a[_0x5344('0x2b')],_0x167d2a[_0x5344('0x27')]);_0x51720d[_0x5344('0x2c')]=_['intersection'](_0x167d2a[_0x5344('0x2b')],qs['fields'](_0x155996[_0x5344('0x27')]['fields']));_0x51720d['attributes']=_0x51720d[_0x5344('0x2c')]['length']?_0x51720d['attributes']:_0x167d2a[_0x5344('0x2b')];if(_0x155996[_0x5344('0x27')]['includeAll']){_0x51720d['include']=[{'all':!![]}];}_0x51720d=_[_0x5344('0x3d')]({},_0x51720d,_0x155996[_0x5344('0x35')]);return db[_0x5344('0x22')][_0x5344('0x3e')](_0x51720d)['then'](handleEntityNotFound(_0x3b7fd6,null))[_0x5344('0x1c')](respondWithResult(_0x3b7fd6,null))['catch'](handleError(_0x3b7fd6,null));};exports[_0x5344('0x3f')]=function(_0x1c4249,_0xefbc2c){return db[_0x5344('0x22')][_0x5344('0x3f')](_0x1c4249['body'],{})[_0x5344('0x1c')](respondWithResult(_0xefbc2c,0xc9))['catch'](handleError(_0xefbc2c,null));};exports[_0x5344('0x1b')]=function(_0xd1d0c2,_0x56d502){if(_0xd1d0c2[_0x5344('0x40')]['id']){delete _0xd1d0c2[_0x5344('0x40')]['id'];}return db[_0x5344('0x22')][_0x5344('0x3e')]({'where':{'id':_0xd1d0c2['params']['id']}})[_0x5344('0x1c')](handleEntityNotFound(_0x56d502,null))[_0x5344('0x1c')](saveUpdates(_0xd1d0c2[_0x5344('0x40')],null))[_0x5344('0x1c')](respondWithResult(_0x56d502,null))[_0x5344('0x3b')](handleError(_0x56d502,null));};exports['destroy']=function(_0x325bf4,_0x2e17da){return db['WhatsappQueueReport'][_0x5344('0x3e')]({'where':{'id':_0x325bf4['params']['id']}})[_0x5344('0x1c')](handleEntityNotFound(_0x2e17da,null))[_0x5344('0x1c')](removeEntity(_0x2e17da,null))[_0x5344('0x3b')](handleError(_0x2e17da,null));};exports[_0x5344('0x41')]=function(_0x4676fa,_0x313d5b){return db[_0x5344('0x22')]['describe']()[_0x5344('0x1c')](respondWithResult(_0x313d5b,null))[_0x5344('0x3b')](handleError(_0x313d5b,null));};
\ No newline at end of file
index 08a4eea..9420ed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x467a=['lodash','util','../../config/logger','api','moment','path','../../config/environment','define','report_whatsapp_queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x467a,0x117));var _0xa467=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x467a[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xa467('0x0'));var util=require(_0xa467('0x1'));var logger=require(_0xa467('0x2'))(_0xa467('0x3'));var moment=require(_0xa467('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa467('0x5'));var rimraf=require('rimraf');var config=require(_0xa467('0x6'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x32afe0,_0x1830dc){return _0x32afe0[_0xa467('0x7')]('WhatsappQueueReport',attributes,{'tableName':_0xa467('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ee9=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappQueueReport.attributes','define','report_whatsapp_queue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ee9,0xbc));var _0x98ee=function(_0x26bf26,_0x5352f4){_0x26bf26=_0x26bf26-0x0;var _0x4e9dfd=_0x8ee9[_0x26bf26];return _0x4e9dfd;};'use strict';var _=require('lodash');var util=require(_0x98ee('0x0'));var logger=require(_0x98ee('0x1'))(_0x98ee('0x2'));var moment=require(_0x98ee('0x3'));var BPromise=require(_0x98ee('0x4'));var rp=require(_0x98ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ee('0x6'));var attributes=require(_0x98ee('0x7'));module['exports']=function(_0x299114,_0x5efac3){return _0x299114[_0x98ee('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x98ee('0x9'),'paranoid':![],'indexes':[{'name':_0x98ee('0xa'),'fields':[_0x98ee('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 44e900c..648b786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2800=['WhatsappQueueReport','create','body','options','raw','stringify','UpdateWhatsappQueueReport','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','CreateWhatsappQueueReport'];(function(_0x147d24,_0x317d71){var _0x279b24=function(_0x331c5f){while(--_0x331c5f){_0x147d24['push'](_0x147d24['shift']());}};_0x279b24(++_0x317d71);}(_0x2800,0x153));var _0x0280=function(_0x3de5ee,_0x2a4771){_0x3de5ee=_0x3de5ee-0x0;var _0x135068=_0x2800[_0x3de5ee];return _0x135068;};'use strict';var _=require(_0x0280('0x0'));var util=require(_0x0280('0x1'));var moment=require(_0x0280('0x2'));var BPromise=require('bluebird');var rs=require(_0x0280('0x3'));var fs=require('fs');var Redis=require(_0x0280('0x4'));var db=require(_0x0280('0x5'))['db'];var utils=require(_0x0280('0x6'));var logger=require(_0x0280('0x7'))(_0x0280('0x8'));var config=require('../../config/environment');var jayson=require(_0x0280('0x9'));var client=jayson[_0x0280('0xa')][_0x0280('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2da606,_0xd5535e,_0x89143){return new BPromise(function(_0x4d1e5a,_0x33a0f1){return client['request'](_0x2da606,_0x89143)[_0x0280('0xc')](function(_0x47f936){logger['info'](_0x0280('0xd'),_0xd5535e,_0x0280('0xe'));logger[_0x0280('0xf')](_0x0280('0x10'),_0xd5535e,'request\x20sent',JSON['stringify'](_0x47f936));if(_0x47f936['error']){if(_0x47f936['error'][_0x0280('0x11')]===0x1f4){logger[_0x0280('0x12')](_0x0280('0xd'),_0xd5535e,_0x47f936['error'][_0x0280('0x13')]);return _0x33a0f1(_0x47f936[_0x0280('0x12')][_0x0280('0x13')]);}logger['error'](_0x0280('0xd'),_0xd5535e,_0x47f936[_0x0280('0x12')][_0x0280('0x13')]);return _0x4d1e5a(_0x47f936[_0x0280('0x12')][_0x0280('0x13')]);}else{logger[_0x0280('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0xd5535e,_0x0280('0xe'));_0x4d1e5a(_0x47f936[_0x0280('0x15')]['message']);}})[_0x0280('0x16')](function(_0xe34e00){logger[_0x0280('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0xd5535e,_0xe34e00);_0x33a0f1(_0xe34e00);});});}exports[_0x0280('0x17')]=function(_0x2cd3fc){var _0x2df476=this;return new Promise(function(_0x50e28a,_0x307e30){return db[_0x0280('0x18')][_0x0280('0x19')](_0x2cd3fc[_0x0280('0x1a')],{'raw':_0x2cd3fc[_0x0280('0x1b')]?_0x2cd3fc[_0x0280('0x1b')][_0x0280('0x1c')]===undefined?!![]:![]:!![]})[_0x0280('0xc')](function(_0x43122e){logger[_0x0280('0x14')]('CreateWhatsappQueueReport',_0x2cd3fc);logger[_0x0280('0xf')](_0x0280('0x17'),_0x2cd3fc,JSON[_0x0280('0x1d')](_0x43122e));_0x50e28a(_0x43122e);})[_0x0280('0x16')](function(_0x3e26f3){logger[_0x0280('0x12')](_0x0280('0x17'),_0x3e26f3['message'],_0x2cd3fc);_0x307e30(_0x2df476[_0x0280('0x12')](0x1f4,_0x3e26f3[_0x0280('0x13')]));});});};exports[_0x0280('0x1e')]=function(_0x396374){var _0x193182=this;return new Promise(function(_0x576e0d,_0x250813){return db[_0x0280('0x18')]['update'](_0x396374[_0x0280('0x1a')],{'raw':_0x396374[_0x0280('0x1b')]?_0x396374['options'][_0x0280('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x396374[_0x0280('0x1b')]?_0x396374[_0x0280('0x1b')]['where']||null:null,'attributes':_0x396374[_0x0280('0x1b')]?_0x396374[_0x0280('0x1b')][_0x0280('0x1f')]||null:null,'limit':_0x396374[_0x0280('0x1b')]?_0x396374[_0x0280('0x1b')][_0x0280('0x20')]||null:null})[_0x0280('0xc')](function(_0x177475){logger[_0x0280('0x14')](_0x0280('0x1e'),_0x396374);logger[_0x0280('0xf')]('UpdateWhatsappQueueReport',_0x396374,JSON['stringify'](_0x177475));_0x576e0d(_0x177475);})[_0x0280('0x16')](function(_0x335ec0){logger[_0x0280('0x12')](_0x0280('0x1e'),_0x335ec0[_0x0280('0x13')],_0x396374);_0x250813(_0x193182[_0x0280('0x12')](0x1f4,_0x335ec0['message']));});});};
\ No newline at end of file
+var _0x4236=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','debug','raw','attributes','limit','UpdateWhatsappQueueReport','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','WhatsappQueueReport,\x20%s,\x20%s'];(function(_0x1a3ab4,_0x40de86){var _0x3167f6=function(_0x49d478){while(--_0x49d478){_0x1a3ab4['push'](_0x1a3ab4['shift']());}};_0x3167f6(++_0x40de86);}(_0x4236,0x152));var _0x6423=function(_0x14a4bf,_0x2c9226){_0x14a4bf=_0x14a4bf-0x0;var _0x53dd1c=_0x4236[_0x14a4bf];return _0x53dd1c;};'use strict';var _=require(_0x6423('0x0'));var util=require('util');var moment=require(_0x6423('0x1'));var BPromise=require(_0x6423('0x2'));var rs=require(_0x6423('0x3'));var fs=require('fs');var Redis=require(_0x6423('0x4'));var db=require(_0x6423('0x5'))['db'];var utils=require(_0x6423('0x6'));var logger=require(_0x6423('0x7'))(_0x6423('0x8'));var config=require(_0x6423('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x410ba0,_0x36a03c,_0x1a2795){return new BPromise(function(_0x1ba7ab,_0x38055f){return client[_0x6423('0xa')](_0x410ba0,_0x1a2795)[_0x6423('0xb')](function(_0x5c95bd){logger[_0x6423('0xc')](_0x6423('0xd'),_0x36a03c,'request\x20sent');logger['debug'](_0x6423('0xe'),_0x36a03c,_0x6423('0xf'),JSON[_0x6423('0x10')](_0x5c95bd));if(_0x5c95bd['error']){if(_0x5c95bd['error'][_0x6423('0x11')]===0x1f4){logger[_0x6423('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x36a03c,_0x5c95bd[_0x6423('0x12')][_0x6423('0x13')]);return _0x38055f(_0x5c95bd['error'][_0x6423('0x13')]);}logger[_0x6423('0x12')](_0x6423('0xd'),_0x36a03c,_0x5c95bd['error'][_0x6423('0x13')]);return _0x1ba7ab(_0x5c95bd[_0x6423('0x12')][_0x6423('0x13')]);}else{logger[_0x6423('0xc')](_0x6423('0xd'),_0x36a03c,_0x6423('0xf'));_0x1ba7ab(_0x5c95bd[_0x6423('0x14')][_0x6423('0x13')]);}})['catch'](function(_0x328908){logger[_0x6423('0x12')](_0x6423('0xd'),_0x36a03c,_0x328908);_0x38055f(_0x328908);});});}exports[_0x6423('0x15')]=function(_0x2e92a9){var _0x2fb216=this;return new Promise(function(_0x3395b5,_0x19e199){return db[_0x6423('0x16')][_0x6423('0x17')](_0x2e92a9[_0x6423('0x18')],{'raw':_0x2e92a9[_0x6423('0x19')]?_0x2e92a9[_0x6423('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x6423('0xb')](function(_0x3f7d15){logger['info']('CreateWhatsappQueueReport',_0x2e92a9);logger[_0x6423('0x1a')](_0x6423('0x15'),_0x2e92a9,JSON[_0x6423('0x10')](_0x3f7d15));_0x3395b5(_0x3f7d15);})['catch'](function(_0x5a04e4){logger[_0x6423('0x12')]('CreateWhatsappQueueReport',_0x5a04e4[_0x6423('0x13')],_0x2e92a9);_0x19e199(_0x2fb216['error'](0x1f4,_0x5a04e4['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x46262e){var _0x43e139=this;return new Promise(function(_0x39d967,_0xd9885f){return db[_0x6423('0x16')]['update'](_0x46262e[_0x6423('0x18')],{'raw':_0x46262e[_0x6423('0x19')]?_0x46262e[_0x6423('0x19')][_0x6423('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46262e[_0x6423('0x19')]?_0x46262e[_0x6423('0x19')]['where']||null:null,'attributes':_0x46262e[_0x6423('0x19')]?_0x46262e[_0x6423('0x19')][_0x6423('0x1c')]||null:null,'limit':_0x46262e[_0x6423('0x19')]?_0x46262e[_0x6423('0x19')][_0x6423('0x1d')]||null:null})['then'](function(_0x27d0f8){logger[_0x6423('0xc')](_0x6423('0x1e'),_0x46262e);logger[_0x6423('0x1a')](_0x6423('0x1e'),_0x46262e,JSON[_0x6423('0x10')](_0x27d0f8));_0x39d967(_0x27d0f8);})[_0x6423('0x1f')](function(_0x292f83){logger[_0x6423('0x12')](_0x6423('0x1e'),_0x292f83[_0x6423('0x13')],_0x46262e);_0xd9885f(_0x43e139[_0x6423('0x12')](0x1f4,_0x292f83[_0x6423('0x13')]));});});};
\ No newline at end of file
index ab076d5..05b04e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ee7=['create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','post'];(function(_0x74f73,_0x2acc98){var _0x3827c2=function(_0x22acbf){while(--_0x22acbf){_0x74f73['push'](_0x74f73['shift']());}};_0x3827c2(++_0x2acc98);}(_0x9ee7,0x196));var _0x79ee=function(_0x2515a3,_0x356de5){_0x2515a3=_0x2515a3-0x0;var _0xe8bbb=_0x9ee7[_0x2515a3];return _0xe8bbb;};'use strict';var multer=require(_0x79ee('0x0'));var util=require(_0x79ee('0x1'));var path=require(_0x79ee('0x2'));var timeout=require(_0x79ee('0x3'));var express=require(_0x79ee('0x4'));var router=express[_0x79ee('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x79ee('0x6'));var config=require(_0x79ee('0x7'));var controller=require(_0x79ee('0x8'));router[_0x79ee('0x9')]('/',auth[_0x79ee('0xa')](),controller['index']);router['get'](_0x79ee('0xb'),auth['isAuthenticated'](),controller[_0x79ee('0xc')]);router[_0x79ee('0x9')]('/:id',auth[_0x79ee('0xa')](),controller['show']);router[_0x79ee('0xd')]('/',auth[_0x79ee('0xa')](),controller[_0x79ee('0xe')]);router[_0x79ee('0xf')](_0x79ee('0x10'),auth[_0x79ee('0xa')](),controller['update']);router[_0x79ee('0x11')](_0x79ee('0x10'),auth[_0x79ee('0xa')](),controller[_0x79ee('0x12')]);module[_0x79ee('0x13')]=router;
\ No newline at end of file
+var _0x1e67=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','put','destroy','exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1e67,0x1dc));var _0x71e6=function(_0x362148,_0x527680){_0x362148=_0x362148-0x0;var _0x5d6ed5=_0x1e67[_0x362148];return _0x5d6ed5;};'use strict';var multer=require('multer');var util=require(_0x71e6('0x0'));var path=require(_0x71e6('0x1'));var timeout=require(_0x71e6('0x2'));var express=require('express');var router=express[_0x71e6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x71e6('0x4'));var config=require(_0x71e6('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0x71e6('0x6')]('/',auth[_0x71e6('0x7')](),controller['index']);router[_0x71e6('0x6')](_0x71e6('0x8'),auth[_0x71e6('0x7')](),controller[_0x71e6('0x9')]);router[_0x71e6('0x6')](_0x71e6('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x71e6('0xb')](_0x71e6('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x71e6('0xa'),auth['isAuthenticated'](),controller[_0x71e6('0xc')]);module[_0x71e6('0xd')]=router;
\ No newline at end of file
index bfc85f2..b4c68c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['agent','queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x199835,_0x199cea){var _0x4ce830=function(_0x48e030){while(--_0x48e030){_0x199835['push'](_0x199835['shift']());}};_0x4ce830(++_0x199cea);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4aee2e,_0x2fc7af){_0x4aee2e=_0x4aee2e-0x0;var _0x2345fa=_0x5f2f[_0x4aee2e];return _0x2345fa;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'uniqueid':{'type':Sequelize[_0xf5f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf5f2('0x3')](_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf5f2('0x7')]}};
\ No newline at end of file
+var _0xb7e7=['queue','sequelize','STRING','account'];(function(_0x2b7730,_0x3e890d){var _0x25c69a=function(_0x860b70){while(--_0x860b70){_0x2b7730['push'](_0x2b7730['shift']());}};_0x25c69a(++_0x3e890d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xb7e7[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7b7e('0x2'),'agent',_0x7b7e('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index ec3dbf5..d21ba9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcabd=['lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','length','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0xab9171,_0x4381b4){var _0x309dd1=function(_0x374b35){while(--_0x374b35){_0xab9171['push'](_0xab9171['shift']());}};_0x309dd1(++_0x4381b4);}(_0xcabd,0x16a));var _0xdcab=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xcabd[_0x1beef3];return _0x5af964;};'use strict';var pdf=require(_0xdcab('0x0'));var emlformat=require(_0xdcab('0x1'));var rimraf=require(_0xdcab('0x2'));var zipdir=require(_0xdcab('0x3'));var jsonpatch=require(_0xdcab('0x4'));var rp=require(_0xdcab('0x5'));var moment=require(_0xdcab('0x6'));var BPromise=require(_0xdcab('0x7'));var Mustache=require(_0xdcab('0x8'));var util=require(_0xdcab('0x9'));var path=require(_0xdcab('0xa'));var sox=require(_0xdcab('0xb'));var csv=require('to-csv');var ejs=require(_0xdcab('0xc'));var fs=require('fs');var _=require(_0xdcab('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdcab('0xe'));var deskjs=require(_0xdcab('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdcab('0x10'));var Papa=require(_0xdcab('0x11'));var Redis=require(_0xdcab('0x12'));var authService=require(_0xdcab('0x13'));var qs=require(_0xdcab('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdcab('0x15'));var logger=require(_0xdcab('0x16'))(_0xdcab('0x17'));var utils=require(_0xdcab('0x18'));var config=require(_0xdcab('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f235c,_0x2d495a){_0x2d495a=_0x2d495a||0xcc;return function(_0x3e4907){if(_0x3e4907){return _0x2f235c[_0xdcab('0x1a')](_0x2d495a);}return _0x2f235c['status'](_0x2d495a)[_0xdcab('0x1b')]();};}function respondWithResult(_0x172c83,_0x58581e){_0x58581e=_0x58581e||0xc8;return function(_0x185e4d){if(_0x185e4d){return _0x172c83[_0xdcab('0x1c')](_0x58581e)['json'](_0x185e4d);}};}function respondWithFilteredResult(_0x4cc05e,_0x10078f){return function(_0x4271f1){if(_0x4271f1){var _0x48eafe=_0x4271f1[_0xdcab('0x1d')],_0x291a0a=_0x10078f['offset'],_0x19e5fb=_0x10078f[_0xdcab('0x1e')]+_0x10078f[_0xdcab('0x1f')],_0x225042;if(_0x19e5fb>=_0x48eafe){_0x19e5fb=_0x48eafe;_0x225042=0xc8;}else{_0x225042=0xce;}_0x4cc05e[_0xdcab('0x1c')](_0x225042);return _0x4cc05e[_0xdcab('0x20')](_0xdcab('0x21'),_0x291a0a+'-'+_0x19e5fb+'/'+_0x48eafe)[_0xdcab('0x22')](_0x4271f1);}return null;};}function patchUpdates(_0x413c90){return function(_0x39bc06){try{jsonpatch[_0xdcab('0x23')](_0x39bc06,_0x413c90,!![]);}catch(_0x53ad4b){return BPromise['reject'](_0x53ad4b);}return _0x39bc06[_0xdcab('0x24')]();};}function saveUpdates(_0x19fcd5,_0x2a3f58){return function(_0x5acc47){if(_0x5acc47){return _0x5acc47[_0xdcab('0x25')](_0x19fcd5)[_0xdcab('0x26')](function(_0xcbdfc2){return _0xcbdfc2;});}return null;};}function removeEntity(_0x377c44,_0x2cd752){return function(_0x121584){if(_0x121584){return _0x121584[_0xdcab('0x27')]()[_0xdcab('0x26')](function(){_0x377c44[_0xdcab('0x1c')](0xcc)[_0xdcab('0x1b')]();});}};}function handleEntityNotFound(_0x55361c,_0x44c9b8){return function(_0x607ab0){if(!_0x607ab0){_0x55361c[_0xdcab('0x1a')](0x194);}return _0x607ab0;};}function handleError(_0x3b22ea,_0x3f6af2){_0x3f6af2=_0x3f6af2||0x1f4;return function(_0x291f48){logger[_0xdcab('0x28')](_0x291f48[_0xdcab('0x29')]);if(_0x291f48[_0xdcab('0x2a')]){delete _0x291f48['name'];}_0x3b22ea[_0xdcab('0x1c')](_0x3f6af2)['send'](_0x291f48);};}exports['index']=function(_0x5f250d,_0xda91d6){var _0x5db3ae={},_0x47a742={},_0xaf4ccf={'count':0x0,'rows':[]};var _0x1dfbd2=_[_0xdcab('0x2b')](db[_0xdcab('0x2c')][_0xdcab('0x2d')],function(_0x3acde2){return{'name':_0x3acde2[_0xdcab('0x2e')],'type':_0x3acde2[_0xdcab('0x2f')][_0xdcab('0x30')]};});_0x47a742[_0xdcab('0x31')]=_[_0xdcab('0x2b')](_0x1dfbd2,_0xdcab('0x2a'));_0x47a742['query']=_[_0xdcab('0x32')](_0x5f250d[_0xdcab('0x33')]);_0x47a742[_0xdcab('0x34')]=_[_0xdcab('0x35')](_0x47a742[_0xdcab('0x31')],_0x47a742[_0xdcab('0x33')]);_0x5db3ae[_0xdcab('0x36')]=_[_0xdcab('0x35')](_0x47a742[_0xdcab('0x31')],qs[_0xdcab('0x37')](_0x5f250d[_0xdcab('0x33')][_0xdcab('0x37')]));_0x5db3ae[_0xdcab('0x36')]=_0x5db3ae[_0xdcab('0x36')]['length']?_0x5db3ae[_0xdcab('0x36')]:_0x47a742[_0xdcab('0x31')];if(!_0x5f250d[_0xdcab('0x33')][_0xdcab('0x38')]('nolimit')){_0x5db3ae[_0xdcab('0x1f')]=qs[_0xdcab('0x1f')](_0x5f250d['query']['limit']);_0x5db3ae['offset']=qs[_0xdcab('0x1e')](_0x5f250d[_0xdcab('0x33')][_0xdcab('0x1e')]);}_0x5db3ae[_0xdcab('0x39')]=qs['sort'](_0x5f250d[_0xdcab('0x33')][_0xdcab('0x3a')]);_0x5db3ae[_0xdcab('0x3b')]=qs[_0xdcab('0x34')](_[_0xdcab('0x3c')](_0x5f250d[_0xdcab('0x33')],_0x47a742[_0xdcab('0x34')]),_0x1dfbd2);if(_0x5f250d[_0xdcab('0x33')][_0xdcab('0x3d')]){_0x5db3ae[_0xdcab('0x3b')]=_[_0xdcab('0x3e')](_0x5db3ae[_0xdcab('0x3b')],{'$or':_[_0xdcab('0x2b')](_0x1dfbd2,function(_0x2c8ca2){if(_0x2c8ca2[_0xdcab('0x2f')]!==_0xdcab('0x3f')){var _0x27e4e1={};_0x27e4e1[_0x2c8ca2[_0xdcab('0x2a')]]={'$like':'%'+_0x5f250d[_0xdcab('0x33')][_0xdcab('0x3d')]+'%'};return _0x27e4e1;}})});}_0x5db3ae=_['merge']({},_0x5db3ae,_0x5f250d[_0xdcab('0x40')]);var _0x57b9b9={'where':_0x5db3ae['where']};return db[_0xdcab('0x2c')]['count'](_0x57b9b9)['then'](function(_0x10eac4){_0xaf4ccf[_0xdcab('0x1d')]=_0x10eac4;if(_0x5f250d['query'][_0xdcab('0x41')]){_0x5db3ae[_0xdcab('0x42')]=[{'all':!![]}];}return db[_0xdcab('0x2c')]['findAll'](_0x5db3ae);})[_0xdcab('0x26')](function(_0x19bdb7){_0xaf4ccf['rows']=_0x19bdb7;return _0xaf4ccf;})[_0xdcab('0x26')](respondWithFilteredResult(_0xda91d6,_0x5db3ae))['catch'](handleError(_0xda91d6,null));};exports[_0xdcab('0x43')]=function(_0x1a2e22,_0x5919a1){var _0x588dac={'raw':!![],'where':{'id':_0x1a2e22[_0xdcab('0x44')]['id']}},_0x1d5611={};_0x1d5611[_0xdcab('0x31')]=_[_0xdcab('0x32')](db['WhatsappTransferReport'][_0xdcab('0x2d')]);_0x1d5611[_0xdcab('0x33')]=_['keys'](_0x1a2e22[_0xdcab('0x33')]);_0x1d5611['filters']=_[_0xdcab('0x35')](_0x1d5611[_0xdcab('0x31')],_0x1d5611[_0xdcab('0x33')]);_0x588dac[_0xdcab('0x36')]=_[_0xdcab('0x35')](_0x1d5611[_0xdcab('0x31')],qs[_0xdcab('0x37')](_0x1a2e22[_0xdcab('0x33')][_0xdcab('0x37')]));_0x588dac['attributes']=_0x588dac['attributes'][_0xdcab('0x45')]?_0x588dac[_0xdcab('0x36')]:_0x1d5611[_0xdcab('0x31')];if(_0x1a2e22[_0xdcab('0x33')][_0xdcab('0x41')]){_0x588dac['include']=[{'all':!![]}];}_0x588dac=_[_0xdcab('0x3e')]({},_0x588dac,_0x1a2e22[_0xdcab('0x40')]);return db['WhatsappTransferReport'][_0xdcab('0x46')](_0x588dac)[_0xdcab('0x26')](handleEntityNotFound(_0x5919a1,null))[_0xdcab('0x26')](respondWithResult(_0x5919a1,null))[_0xdcab('0x47')](handleError(_0x5919a1,null));};exports[_0xdcab('0x48')]=function(_0x312cf3,_0x60b028){return db[_0xdcab('0x2c')][_0xdcab('0x48')](_0x312cf3[_0xdcab('0x49')],{})[_0xdcab('0x26')](respondWithResult(_0x60b028,0xc9))[_0xdcab('0x47')](handleError(_0x60b028,null));};exports[_0xdcab('0x25')]=function(_0x227b6c,_0x4a361b){if(_0x227b6c['body']['id']){delete _0x227b6c[_0xdcab('0x49')]['id'];}return db['WhatsappTransferReport'][_0xdcab('0x46')]({'where':{'id':_0x227b6c[_0xdcab('0x44')]['id']}})[_0xdcab('0x26')](handleEntityNotFound(_0x4a361b,null))['then'](saveUpdates(_0x227b6c[_0xdcab('0x49')],null))['then'](respondWithResult(_0x4a361b,null))[_0xdcab('0x47')](handleError(_0x4a361b,null));};exports['destroy']=function(_0x2dbc36,_0x3f95ea){return db['WhatsappTransferReport'][_0xdcab('0x46')]({'where':{'id':_0x2dbc36[_0xdcab('0x44')]['id']}})[_0xdcab('0x26')](handleEntityNotFound(_0x3f95ea,null))[_0xdcab('0x26')](removeEntity(_0x3f95ea,null))[_0xdcab('0x47')](handleError(_0x3f95ea,null));};exports[_0xdcab('0x4a')]=function(_0x26f116,_0x5cc331){return db[_0xdcab('0x2c')][_0xdcab('0x4a')]()[_0xdcab('0x26')](respondWithResult(_0x5cc331,null))[_0xdcab('0x47')](handleError(_0x5cc331,null));};
\ No newline at end of file
+var _0x42bd=['filter','merge','VIRTUAL','WhatsappTransferReport','count','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x51e52e,_0x255df4){var _0x22f975=function(_0x1a63a5){while(--_0x1a63a5){_0x51e52e['push'](_0x51e52e['shift']());}};_0x22f975(++_0x255df4);}(_0x42bd,0x197));var _0xd42b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x42bd[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0xd42b('0x0'));var emlformat=require(_0xd42b('0x1'));var rimraf=require(_0xd42b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd42b('0x3'));var rp=require(_0xd42b('0x4'));var moment=require(_0xd42b('0x5'));var BPromise=require(_0xd42b('0x6'));var Mustache=require(_0xd42b('0x7'));var util=require(_0xd42b('0x8'));var path=require(_0xd42b('0x9'));var sox=require(_0xd42b('0xa'));var csv=require(_0xd42b('0xb'));var ejs=require(_0xd42b('0xc'));var fs=require('fs');var _=require(_0xd42b('0xd'));var squel=require('squel');var crypto=require(_0xd42b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd42b('0xf'));var toCsv=require(_0xd42b('0xb'));var querystring=require(_0xd42b('0x10'));var Papa=require(_0xd42b('0x11'));var Redis=require('ioredis');var authService=require(_0xd42b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd42b('0x13'));var hardwareService=require(_0xd42b('0x14'));var logger=require(_0xd42b('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd42b('0x16'));var db=require(_0xd42b('0x17'))['db'];function respondWithStatusCode(_0x5f2b1f,_0x3d6b89){_0x3d6b89=_0x3d6b89||0xcc;return function(_0x5bbcd0){if(_0x5bbcd0){return _0x5f2b1f['sendStatus'](_0x3d6b89);}return _0x5f2b1f[_0xd42b('0x18')](_0x3d6b89)[_0xd42b('0x19')]();};}function respondWithResult(_0x3ea620,_0x47be5f){_0x47be5f=_0x47be5f||0xc8;return function(_0x3ff780){if(_0x3ff780){return _0x3ea620[_0xd42b('0x18')](_0x47be5f)[_0xd42b('0x1a')](_0x3ff780);}};}function respondWithFilteredResult(_0x10f4a6,_0x5e1ada){return function(_0x56e590){if(_0x56e590){var _0x46ebad=_0x56e590['count'],_0x2fdf31=_0x5e1ada[_0xd42b('0x1b')],_0x20594e=_0x5e1ada[_0xd42b('0x1b')]+_0x5e1ada[_0xd42b('0x1c')],_0x11cfea;if(_0x20594e>=_0x46ebad){_0x20594e=_0x46ebad;_0x11cfea=0xc8;}else{_0x11cfea=0xce;}_0x10f4a6[_0xd42b('0x18')](_0x11cfea);return _0x10f4a6[_0xd42b('0x1d')](_0xd42b('0x1e'),_0x2fdf31+'-'+_0x20594e+'/'+_0x46ebad)[_0xd42b('0x1a')](_0x56e590);}return null;};}function patchUpdates(_0x3cb45f){return function(_0x3f15e8){try{jsonpatch[_0xd42b('0x1f')](_0x3f15e8,_0x3cb45f,!![]);}catch(_0x3e38ac){return BPromise[_0xd42b('0x20')](_0x3e38ac);}return _0x3f15e8[_0xd42b('0x21')]();};}function saveUpdates(_0x390d3b,_0x5d0a76){return function(_0x42b4cc){if(_0x42b4cc){return _0x42b4cc[_0xd42b('0x22')](_0x390d3b)['then'](function(_0x486f5b){return _0x486f5b;});}return null;};}function removeEntity(_0x232e85,_0x4387d2){return function(_0x297cd1){if(_0x297cd1){return _0x297cd1[_0xd42b('0x23')]()[_0xd42b('0x24')](function(){_0x232e85['status'](0xcc)[_0xd42b('0x19')]();});}};}function handleEntityNotFound(_0x456dc2,_0x10d027){return function(_0x44fecf){if(!_0x44fecf){_0x456dc2[_0xd42b('0x25')](0x194);}return _0x44fecf;};}function handleError(_0x2d1137,_0x121b00){_0x121b00=_0x121b00||0x1f4;return function(_0x47e885){logger[_0xd42b('0x26')](_0x47e885[_0xd42b('0x27')]);if(_0x47e885['name']){delete _0x47e885[_0xd42b('0x28')];}_0x2d1137[_0xd42b('0x18')](_0x121b00)[_0xd42b('0x29')](_0x47e885);};}exports[_0xd42b('0x2a')]=function(_0x21e4d4,_0x405ee0){var _0x3ea743={},_0x32c8a7={},_0x458b83={'count':0x0,'rows':[]};var _0x2417b5=_[_0xd42b('0x2b')](db['WhatsappTransferReport'][_0xd42b('0x2c')],function(_0x10a665){return{'name':_0x10a665[_0xd42b('0x2d')],'type':_0x10a665[_0xd42b('0x2e')][_0xd42b('0x2f')]};});_0x32c8a7[_0xd42b('0x30')]=_[_0xd42b('0x2b')](_0x2417b5,_0xd42b('0x28'));_0x32c8a7['query']=_[_0xd42b('0x31')](_0x21e4d4[_0xd42b('0x32')]);_0x32c8a7[_0xd42b('0x33')]=_[_0xd42b('0x34')](_0x32c8a7['model'],_0x32c8a7[_0xd42b('0x32')]);_0x3ea743[_0xd42b('0x35')]=_['intersection'](_0x32c8a7[_0xd42b('0x30')],qs[_0xd42b('0x36')](_0x21e4d4['query'][_0xd42b('0x36')]));_0x3ea743['attributes']=_0x3ea743['attributes'][_0xd42b('0x37')]?_0x3ea743[_0xd42b('0x35')]:_0x32c8a7[_0xd42b('0x30')];if(!_0x21e4d4[_0xd42b('0x32')][_0xd42b('0x38')](_0xd42b('0x39'))){_0x3ea743['limit']=qs[_0xd42b('0x1c')](_0x21e4d4[_0xd42b('0x32')]['limit']);_0x3ea743[_0xd42b('0x1b')]=qs['offset'](_0x21e4d4[_0xd42b('0x32')][_0xd42b('0x1b')]);}_0x3ea743[_0xd42b('0x3a')]=qs[_0xd42b('0x3b')](_0x21e4d4[_0xd42b('0x32')][_0xd42b('0x3b')]);_0x3ea743[_0xd42b('0x3c')]=qs[_0xd42b('0x33')](_['pick'](_0x21e4d4[_0xd42b('0x32')],_0x32c8a7['filters']),_0x2417b5);if(_0x21e4d4[_0xd42b('0x32')][_0xd42b('0x3d')]){_0x3ea743[_0xd42b('0x3c')]=_[_0xd42b('0x3e')](_0x3ea743[_0xd42b('0x3c')],{'$or':_['map'](_0x2417b5,function(_0xeb7a15){if(_0xeb7a15['type']!==_0xd42b('0x3f')){var _0x4b0ed9={};_0x4b0ed9[_0xeb7a15[_0xd42b('0x28')]]={'$like':'%'+_0x21e4d4[_0xd42b('0x32')][_0xd42b('0x3d')]+'%'};return _0x4b0ed9;}})});}_0x3ea743=_[_0xd42b('0x3e')]({},_0x3ea743,_0x21e4d4['options']);var _0x25fa24={'where':_0x3ea743[_0xd42b('0x3c')]};return db[_0xd42b('0x40')]['count'](_0x25fa24)[_0xd42b('0x24')](function(_0x4a424e){_0x458b83[_0xd42b('0x41')]=_0x4a424e;if(_0x21e4d4[_0xd42b('0x32')][_0xd42b('0x42')]){_0x3ea743[_0xd42b('0x43')]=[{'all':!![]}];}return db[_0xd42b('0x40')][_0xd42b('0x44')](_0x3ea743);})[_0xd42b('0x24')](function(_0x24968c){_0x458b83[_0xd42b('0x45')]=_0x24968c;return _0x458b83;})[_0xd42b('0x24')](respondWithFilteredResult(_0x405ee0,_0x3ea743))[_0xd42b('0x46')](handleError(_0x405ee0,null));};exports[_0xd42b('0x47')]=function(_0x49c0e7,_0x16a9ce){var _0x18f617={'raw':!![],'where':{'id':_0x49c0e7['params']['id']}},_0xfbf234={};_0xfbf234['model']=_[_0xd42b('0x31')](db[_0xd42b('0x40')][_0xd42b('0x2c')]);_0xfbf234['query']=_[_0xd42b('0x31')](_0x49c0e7[_0xd42b('0x32')]);_0xfbf234['filters']=_[_0xd42b('0x34')](_0xfbf234['model'],_0xfbf234['query']);_0x18f617[_0xd42b('0x35')]=_[_0xd42b('0x34')](_0xfbf234[_0xd42b('0x30')],qs[_0xd42b('0x36')](_0x49c0e7['query'][_0xd42b('0x36')]));_0x18f617[_0xd42b('0x35')]=_0x18f617[_0xd42b('0x35')]['length']?_0x18f617[_0xd42b('0x35')]:_0xfbf234[_0xd42b('0x30')];if(_0x49c0e7[_0xd42b('0x32')][_0xd42b('0x42')]){_0x18f617[_0xd42b('0x43')]=[{'all':!![]}];}_0x18f617=_[_0xd42b('0x3e')]({},_0x18f617,_0x49c0e7[_0xd42b('0x48')]);return db[_0xd42b('0x40')]['find'](_0x18f617)[_0xd42b('0x24')](handleEntityNotFound(_0x16a9ce,null))[_0xd42b('0x24')](respondWithResult(_0x16a9ce,null))[_0xd42b('0x46')](handleError(_0x16a9ce,null));};exports[_0xd42b('0x49')]=function(_0x2e908b,_0x203c56){return db[_0xd42b('0x40')][_0xd42b('0x49')](_0x2e908b['body'],{})['then'](respondWithResult(_0x203c56,0xc9))[_0xd42b('0x46')](handleError(_0x203c56,null));};exports[_0xd42b('0x22')]=function(_0x4b595d,_0x218741){if(_0x4b595d[_0xd42b('0x4a')]['id']){delete _0x4b595d[_0xd42b('0x4a')]['id'];}return db[_0xd42b('0x40')][_0xd42b('0x4b')]({'where':{'id':_0x4b595d[_0xd42b('0x4c')]['id']}})[_0xd42b('0x24')](handleEntityNotFound(_0x218741,null))['then'](saveUpdates(_0x4b595d[_0xd42b('0x4a')],null))[_0xd42b('0x24')](respondWithResult(_0x218741,null))[_0xd42b('0x46')](handleError(_0x218741,null));};exports[_0xd42b('0x23')]=function(_0x55da7b,_0x2b89d6){return db[_0xd42b('0x40')][_0xd42b('0x4b')]({'where':{'id':_0x55da7b[_0xd42b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b89d6,null))['then'](removeEntity(_0x2b89d6,null))[_0xd42b('0x46')](handleError(_0x2b89d6,null));};exports[_0xd42b('0x4d')]=function(_0x25b67f,_0x1f2e1c){return db['WhatsappTransferReport']['describe']()[_0xd42b('0x24')](respondWithResult(_0x1f2e1c,null))[_0xd42b('0x46')](handleError(_0x1f2e1c,null));};
\ No newline at end of file
index df618c4..088e7c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03e2=['report_whatsapp_transfer','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','define'];(function(_0x2807a7,_0x5b64d2){var _0x355beb=function(_0x5a0797){while(--_0x5a0797){_0x2807a7['push'](_0x2807a7['shift']());}};_0x355beb(++_0x5b64d2);}(_0x03e2,0x191));var _0x203e=function(_0x1d3470,_0x2657f9){_0x1d3470=_0x1d3470-0x0;var _0x44b296=_0x03e2[_0x1d3470];return _0x44b296;};'use strict';var _=require(_0x203e('0x0'));var util=require(_0x203e('0x1'));var logger=require(_0x203e('0x2'))(_0x203e('0x3'));var moment=require(_0x203e('0x4'));var BPromise=require('bluebird');var rp=require(_0x203e('0x5'));var fs=require('fs');var path=require(_0x203e('0x6'));var rimraf=require('rimraf');var config=require(_0x203e('0x7'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x45d140,_0x1a8c73){return _0x45d140[_0x203e('0x8')]('WhatsappTransferReport',attributes,{'tableName':_0x203e('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xca05=['bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xca05,0x141));var _0x5ca0=function(_0x4ddc7e,_0xcb9b8){_0x4ddc7e=_0x4ddc7e-0x0;var _0xfbf0ec=_0xca05[_0x4ddc7e];return _0xfbf0ec;};'use strict';var _=require(_0x5ca0('0x0'));var util=require(_0x5ca0('0x1'));var logger=require(_0x5ca0('0x2'))(_0x5ca0('0x3'));var moment=require('moment');var BPromise=require(_0x5ca0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ca0('0x5'));var rimraf=require(_0x5ca0('0x6'));var config=require(_0x5ca0('0x7'));var attributes=require(_0x5ca0('0x8'));module[_0x5ca0('0x9')]=function(_0x19f4f8,_0x2c86eb){return _0x19f4f8['define'](_0x5ca0('0xa'),attributes,{'tableName':_0x5ca0('0xb'),'paranoid':![],'indexes':[{'name':_0x5ca0('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 676fb5a..150ebd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x8c350a,_0x4feaa8){var _0x24d594=function(_0x25eab6){while(--_0x25eab6){_0x8c350a['push'](_0x8c350a['shift']());}};_0x24d594(++_0x4feaa8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x4004a0,_0x20a63f){var _0x417fe3=function(_0xa214a7){while(--_0xa214a7){_0x4004a0['push'](_0x4004a0['shift']());}};_0x417fe3(++_0x20a63f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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
index b09764e..8b56228 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8ec=['info','Online\x20apps:','online','name','join','filter','None','./config/seedDB','default','./config/license','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','sync','then','start'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf8ec,0x1d4));var _0xcf8e=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xf8ec[_0x597484];return _0x218e64;};'use strict';var _=require(_0xcf8e('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xcf8e('0x1'));var config=require(_0xcf8e('0x2'));var logger=require(_0xcf8e('0x3'))(_0xcf8e('0x4'));var pm2=require(_0xcf8e('0x5'));var pm2Config=require(_0xcf8e('0x6'));var schedule=require(_0xcf8e('0x7'));var chat=require('./config/schedule/chat');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xcf8e('0x8')][_0xcf8e('0x9')]()['then'](function(){return rpc['listen']();})[_0xcf8e('0xa')](function(_0x43b99e){logger['info'](_0x43b99e);return chat[_0xcf8e('0xb')]();})[_0xcf8e('0xa')](function(){return schedule['start']();})['then'](function(){return transcribe[_0xcf8e('0xb')]();})[_0xcf8e('0xa')](function(_0x17b700){logger[_0xcf8e('0xc')](_0x17b700);return pm2[_0xcf8e('0xb')](pm2Config);})['then'](function(_0x50d52d){logger[_0xcf8e('0xc')](_0xcf8e('0xd'),_['map'](_['filter'](_0x50d52d,{'status':_0xcf8e('0xe')}),_0xcf8e('0xf'))[_0xcf8e('0x10')]());logger['info']('Offline\x20apps:',_['map'](_[_0xcf8e('0x11')](_0x50d52d,function(_0x10a7b6){return _0x10a7b6['status']!==_0xcf8e('0xe');}),_0xcf8e('0xf'))[_0xcf8e('0x10')]()||_0xcf8e('0x12'));config['seedDB']&&require(_0xcf8e('0x13'))[_0xcf8e('0x14')]();require(_0xcf8e('0x15'))['default']();})['catch'](function(_0x45e5ff){logger['error'](_0xcf8e('0x16'),_0x45e5ff);process[_0xcf8e('0x17')](0x1);});}main();
\ No newline at end of file
+var _0xe94c=['seedDB','./config/seedDB','default','catch','error','exit','./mysqldb','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','then','info','start','Online\x20apps:','map','online','join','Offline\x20apps:','filter','status','name','None'];(function(_0x4a9193,_0x5ea9a4){var _0x160be2=function(_0x36cb59){while(--_0x36cb59){_0x4a9193['push'](_0x4a9193['shift']());}};_0x160be2(++_0x5ea9a4);}(_0xe94c,0x1d1));var _0xce94=function(_0xf623b8,_0xd00397){_0xf623b8=_0xf623b8-0x0;var _0x852f78=_0xe94c[_0xf623b8];return _0x852f78;};'use strict';var _=require('lodash');var mysqldb=require(_0xce94('0x0'));var rpc=require('./rpc');var config=require(_0xce94('0x1'));var logger=require(_0xce94('0x2'))(_0xce94('0x3'));var pm2=require(_0xce94('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xce94('0x5'));var chat=require(_0xce94('0x6'));var transcribe=require(_0xce94('0x7'));function main(){return mysqldb['db'][_0xce94('0x8')]['sync']()[_0xce94('0x9')](function(){return rpc['listen']();})[_0xce94('0x9')](function(_0x2b54f1){logger[_0xce94('0xa')](_0x2b54f1);return chat[_0xce94('0xb')]();})[_0xce94('0x9')](function(){return schedule[_0xce94('0xb')]();})[_0xce94('0x9')](function(){return transcribe[_0xce94('0xb')]();})['then'](function(_0x997360){logger['info'](_0x997360);return pm2[_0xce94('0xb')](pm2Config);})[_0xce94('0x9')](function(_0x4376dc){logger[_0xce94('0xa')](_0xce94('0xc'),_[_0xce94('0xd')](_['filter'](_0x4376dc,{'status':_0xce94('0xe')}),'name')[_0xce94('0xf')]());logger['info'](_0xce94('0x10'),_['map'](_[_0xce94('0x11')](_0x4376dc,function(_0x1c50e5){return _0x1c50e5[_0xce94('0x12')]!=='online';}),_0xce94('0x13'))[_0xce94('0xf')]()||_0xce94('0x14'));config[_0xce94('0x15')]&&require(_0xce94('0x16'))[_0xce94('0x17')]();require('./config/license')[_0xce94('0x17')]();})[_0xce94('0x18')](function(_0x52a1df){logger[_0xce94('0x19')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x52a1df);process[_0xce94('0x1a')](0x1);});}main();
\ No newline at end of file
index 7270550..41a321e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e88=['/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','promisify','sign','secret','secrets','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','session','role','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','closed','disposition','then','status','unmanaged','headers','startsWith','authorization','Basic','User','find','authenticate','pass','catch','json','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','apiKeyNonce','nonce','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','motion.token'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0x0e88,0xd7));var _0x80e8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0e88[_0xa464c9];return _0x3d73c4;};'use strict';var db=require(_0x80e8('0x0'))['db'];var config=require(_0x80e8('0x1'));var hardwareConf=require(_0x80e8('0x2'));var _=require('lodash');var jwt=require(_0x80e8('0x3'));var expressJwt=require(_0x80e8('0x4'));var compose=require(_0x80e8('0x5'));var basicAuth=require(_0x80e8('0x6'));var crypto=require(_0x80e8('0x7'));var BPromise=require(_0x80e8('0x8'));var validateJwt=expressJwt({'secret':config['secrets'][_0x80e8('0x9')]});var userAttributes=['id',_0x80e8('0xa'),'fullname',_0x80e8('0xb'),_0x80e8('0xc'),_0x80e8('0xd'),_0x80e8('0xe'),_0x80e8('0xf'),_0x80e8('0x10'),_0x80e8('0x11'),_0x80e8('0x12'),_0x80e8('0x13'),_0x80e8('0x14'),_0x80e8('0x15'),_0x80e8('0x16'),_0x80e8('0x17'),_0x80e8('0x18'),_0x80e8('0x19'),_0x80e8('0x1a'),'crudPermissions',_0x80e8('0x1b'),_0x80e8('0x1c'),_0x80e8('0x1d'),_0x80e8('0x1e'),_0x80e8('0x1f'),'phoneBarDnd',_0x80e8('0x20'),_0x80e8('0x21'),_0x80e8('0x22'),_0x80e8('0x23'),'phoneBarPrefixRequired',_0x80e8('0x24'),_0x80e8('0x25'),_0x80e8('0x26'),_0x80e8('0x27'),_0x80e8('0x28')];exports[_0x80e8('0x29')]=function(){return this[_0x80e8('0x2a')](!![])[_0x80e8('0x2b')](function(_0x1a0539,_0x27b086,_0x47b0df){if(_0x1a0539[_0x80e8('0x2c')]){_0x47b0df();}else{return db['ChatInteraction'][_0x80e8('0x2d')]({'where':{'id':_0x1a0539['params']['id']},'attributes':['id',_0x80e8('0x2e'),_0x80e8('0x2f')],'raw':!![]})[_0x80e8('0x30')](function(_0x544330){if(_0x544330&&_0x544330[_0x80e8('0x2e')]){return _0x27b086[_0x80e8('0x31')](_0x544330[_0x80e8('0x2f')]===_0x80e8('0x32')?0x195:0x193)['json']({'message':_0x544330[_0x80e8('0x2f')]==='unmanaged'?'Unmanaged.':'Forbidden.'});}else{_0x47b0df();}})['catch'](function(_0x6eaa67){_0x47b0df(_0x6eaa67);});}});};exports[_0x80e8('0x2a')]=function isAuthenticated(_0x29839d){return compose()['use'](function(_0x2845a2,_0x3de8a9,_0x195e82){if(_0x2845a2[_0x80e8('0x33')]['authorization']){if(_[_0x80e8('0x34')](_0x2845a2[_0x80e8('0x33')][_0x80e8('0x35')],_0x80e8('0x36'))){var _0x25ae33=basicAuth(_0x2845a2);db[_0x80e8('0x37')][_0x80e8('0x38')]({'where':{'name':_0x25ae33[_0x80e8('0xb')]}})[_0x80e8('0x30')](function(_0x26b27f){if(!_0x26b27f||!_0x26b27f[_0x80e8('0x39')](_0x25ae33[_0x80e8('0x3a')])){return _0x3de8a9[_0x80e8('0x31')](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x2845a2[_0x80e8('0x2c')]={'id':_0x26b27f['id']};_0x195e82();})[_0x80e8('0x3b')](function(_0x562614){_0x195e82(_0x562614);});}else if(_[_0x80e8('0x34')](_0x2845a2[_0x80e8('0x33')][_0x80e8('0x35')],'Bearer')){validateJwt(_0x2845a2,_0x3de8a9,_0x195e82);}else{if(_0x29839d){_0x195e82();}else{return _0x3de8a9['status'](0x193)[_0x80e8('0x3c')]({'message':_0x80e8('0x3d')});}}}else if(_0x2845a2[_0x80e8('0x3e')][_0x80e8('0x3f')]){try{var _0x581153={'audience':hardwareConf[_0x80e8('0x40')](),'issuer':hardwareConf[_0x80e8('0x40')]()};verifyJwt(_0x2845a2[_0x80e8('0x3e')][_0x80e8('0x3f')],_0x581153)[_0x80e8('0x30')](function(_0x46b551){return db[_0x80e8('0x37')]['find']({'where':{'id':_0x46b551[_0x80e8('0x41')]}})['then'](function(_0x68c26c){if(!_0x68c26c||!_['isEqual'](_0x68c26c[_0x80e8('0x42')],_0x46b551[_0x80e8('0x43')])){return _0x3de8a9['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x2845a2['user']={'id':_0x68c26c['id']};_0x195e82();});})[_0x80e8('0x3b')](function(){return _0x3de8a9[_0x80e8('0x31')](0x191)[_0x80e8('0x3c')]({'message':_0x80e8('0x44')});});}catch(_0x2ebead){_0x195e82(_0x2ebead);}}else if(_0x29839d){_0x195e82();}else{return _0x3de8a9[_0x80e8('0x31')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0x80e8('0x2b')](function(_0x50926a,_0x5ed52b,_0x724d39){if(_0x50926a[_0x80e8('0x2c')]){db[_0x80e8('0x37')][_0x80e8('0x38')]({'where':{'id':_0x50926a[_0x80e8('0x2c')]['id']},'attributes':userAttributes})['then'](function(_0xd3c997){if(!_0xd3c997){return _0x5ed52b[_0x80e8('0x31')](0x194)[_0x80e8('0x3c')]({'message':_0x80e8('0x45')});}_0x50926a['user']=_0xd3c997;_0x724d39();})[_0x80e8('0x3b')](function(_0x3eb6e2){_0x724d39(_0x3eb6e2);});}else if(_0x29839d){_0x724d39();}else{return _0x5ed52b['status'](0x194)[_0x80e8('0x3c')]({'message':_0x80e8('0x46')});}});};exports[_0x80e8('0x47')]=function canUpdate(){return compose()[_0x80e8('0x2b')](function(_0x13d2c5,_0x1c75b1,_0x210695){return require(_0x80e8('0x48'))['getLicense']()[_0x80e8('0x30')](function(_0x5db93c){if(_0x5db93c['update']){_0x210695();}else{return _0x1c75b1[_0x80e8('0x31')](0x193)[_0x80e8('0x3c')]({'message':_0x80e8('0x49')});}})[_0x80e8('0x3b')](function(_0x2513a8){_0x210695(_0x2513a8);});});};exports[_0x80e8('0x4a')]=function(_0xbfa15a,_0x53f71a,_0x40de51){_0xbfa15a['isMiddleware']=!![];return _0x40de51();};exports[_0x80e8('0x4b')]=function signToken(_0x42b312){return signJwt(_0x42b312);};exports[_0x80e8('0x4c')]=function(_0x52f1b6,_0x189cf5){if(!_0x52f1b6[_0x80e8('0x2c')]){return _0x189cf5['status'](0x194)[_0x80e8('0x3c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5bb53e={'payload':{'id':_0x52f1b6[_0x80e8('0x2c')]['id'],'role':_0x52f1b6[_0x80e8('0x2c')][_0x80e8('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5bb53e)[_0x80e8('0x30')](function(_0x41a9e8){_0x189cf5[_0x80e8('0x4d')](_0x80e8('0x4e'),_0x41a9e8);_0x189cf5['redirect'](_0x80e8('0x4f'));})['catch'](function(_0x2015de){return _0x189cf5[_0x80e8('0x31')](0x1f4)[_0x80e8('0x50')](_0x2015de);});};exports['retrieveApiKey']=function(_0xa26199){if(_['isNil'](_0xa26199[_0x80e8('0x42')])||_[_0x80e8('0x51')](_0xa26199[_0x80e8('0x52')])){return null;}else{return createJwt(_0xa26199);}};exports[_0x80e8('0x53')]=function(_0xb005b7){_0xb005b7[_0x80e8('0x42')]=generateNonce();_0xb005b7[_0x80e8('0x52')]=generateIssuedAt();return createJwt(_0xb005b7);};exports[_0x80e8('0x54')]=function(_0x1e32a8,_0x2a801a){var _0x53c0d6=_0x1e32a8[_0x80e8('0x3e')][_0x80e8('0x3f')];if(_0x53c0d6){var _0x284896={'nonce':_0x2a801a[_0x80e8('0x42')],'iat':_0x2a801a[_0x80e8('0x52')],'audience':hardwareConf[_0x80e8('0x40')](),'issuer':hardwareConf[_0x80e8('0x40')]()};return verifyJwt(_0x53c0d6,_0x284896)['then'](function(){return generateApiKey(_0x2a801a);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x1c3f96){var _0xe8cd5a=BPromise[_0x80e8('0x55')](jwt[_0x80e8('0x56')],{'context':jwt});var _0x2d435e=_0x1c3f96[_0x80e8('0x57')]||config[_0x80e8('0x58')][_0x80e8('0x9')];return new BPromise(function(_0x422eeb,_0x4aa16f){_0xe8cd5a(_0x1c3f96[_0x80e8('0x59')],_0x2d435e,_0x1c3f96[_0x80e8('0x5a')])[_0x80e8('0x30')](function(_0x340758){_0x422eeb(_0x340758);})['catch'](function(_0x1993ad){_0x4aa16f(_0x1993ad);});});}function verifyJwt(_0x3e1346,_0x3f3a73,_0x3dfa41){var _0x27b74e=BPromise[_0x80e8('0x55')](jwt[_0x80e8('0x5b')],{'context':jwt});var _0x427272=_0x3dfa41||config[_0x80e8('0x58')][_0x80e8('0x9')];return new BPromise(function(_0x313790,_0x4a8cb5){_0x27b74e(_0x3e1346,_0x427272,_0x3f3a73)[_0x80e8('0x30')](function(_0x57d3c7){_0x313790(_0x57d3c7);})[_0x80e8('0x3b')](function(_0x3bd624){_0x4a8cb5(_0x3bd624);});});}function generateNonce(){return crypto[_0x80e8('0x5c')](0x10)[_0x80e8('0x5d')](_0x80e8('0x5e'));}function generateIssuedAt(){return Math[_0x80e8('0x5f')](Date[_0x80e8('0x60')]()/0x3e8)[_0x80e8('0x5d')]();}function createJwt(_0x48fb19){var _0x555cfd={'payload':{'iat':_0x48fb19[_0x80e8('0x52')],'nonce':_0x48fb19[_0x80e8('0x42')]},'options':{'algorithm':_0x80e8('0x61'),'subject':_0x48fb19['id'][_0x80e8('0x5d')](),'issuer':hardwareConf[_0x80e8('0x40')](),'audience':hardwareConf[_0x80e8('0x40')]()}};return signJwt(_0x555cfd)[_0x80e8('0x30')](function(_0x8d737a){return{'iat':_0x48fb19[_0x80e8('0x52')],'nonce':_0x48fb19[_0x80e8('0x42')],'token':_0x8d737a};});}
\ No newline at end of file
+var _0x66c8=['closed','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','use','User\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','secrets','session','role','fullname','name','internal','userpic','md5secret','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','disposition','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x66c8,0x9d));var _0x866c=function(_0x3a6308,_0x16650c){_0x3a6308=_0x3a6308-0x0;var _0x18e3f0=_0x66c8[_0x3a6308];return _0x18e3f0;};'use strict';var db=require(_0x866c('0x0'))['db'];var config=require(_0x866c('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0x866c('0x2'));var expressJwt=require('express-jwt');var compose=require(_0x866c('0x3'));var basicAuth=require(_0x866c('0x4'));var crypto=require(_0x866c('0x5'));var BPromise=require(_0x866c('0x6'));var validateJwt=expressJwt({'secret':config[_0x866c('0x7')][_0x866c('0x8')]});var userAttributes=['id',_0x866c('0x9'),_0x866c('0xa'),_0x866c('0xb'),_0x866c('0xc'),'email',_0x866c('0xd'),'permissions',_0x866c('0xe'),'voicePause','chatPause',_0x866c('0xf'),_0x866c('0x10'),_0x866c('0x11'),_0x866c('0x12'),'pauseType',_0x866c('0x13'),_0x866c('0x14'),_0x866c('0x15'),_0x866c('0x16'),_0x866c('0x17'),_0x866c('0x18'),_0x866c('0x19'),_0x866c('0x1a'),_0x866c('0x1b'),_0x866c('0x1c'),_0x866c('0x1d'),'phoneBarEnableDtmfTone',_0x866c('0x1e'),_0x866c('0x1f'),_0x866c('0x20'),'phoneBarRemoteControl',_0x866c('0x21'),_0x866c('0x22'),_0x866c('0x23'),_0x866c('0x24')];exports[_0x866c('0x25')]=function(){return this[_0x866c('0x26')](!![])['use'](function(_0x1cdf88,_0x5c4c27,_0x375d15){if(_0x1cdf88[_0x866c('0x27')]){_0x375d15();}else{return db[_0x866c('0x28')][_0x866c('0x29')]({'where':{'id':_0x1cdf88[_0x866c('0x2a')]['id']},'attributes':['id','closed',_0x866c('0x2b')],'raw':!![]})[_0x866c('0x2c')](function(_0x3aa516){if(_0x3aa516&&_0x3aa516[_0x866c('0x2d')]){return _0x5c4c27['status'](_0x3aa516[_0x866c('0x2b')]===_0x866c('0x2e')?0x195:0x193)[_0x866c('0x2f')]({'message':_0x3aa516[_0x866c('0x2b')]==='unmanaged'?_0x866c('0x30'):_0x866c('0x31')});}else{_0x375d15();}})[_0x866c('0x32')](function(_0x4f3f08){_0x375d15(_0x4f3f08);});}});};exports[_0x866c('0x26')]=function isAuthenticated(_0x30bfc2){return compose()['use'](function(_0x246995,_0x1728a6,_0x4baa05){if(_0x246995[_0x866c('0x33')][_0x866c('0x34')]){if(_[_0x866c('0x35')](_0x246995[_0x866c('0x33')][_0x866c('0x34')],_0x866c('0x36'))){var _0x59b8e3=basicAuth(_0x246995);db[_0x866c('0x37')]['find']({'where':{'name':_0x59b8e3[_0x866c('0xb')]}})['then'](function(_0x93b4d1){if(!_0x93b4d1||!_0x93b4d1[_0x866c('0x38')](_0x59b8e3[_0x866c('0x39')])){return _0x1728a6[_0x866c('0x3a')](0x191)[_0x866c('0x2f')]({'message':_0x866c('0x3b')});}_0x246995[_0x866c('0x27')]={'id':_0x93b4d1['id']};_0x4baa05();})['catch'](function(_0x20b896){_0x4baa05(_0x20b896);});}else if(_['startsWith'](_0x246995[_0x866c('0x33')]['authorization'],_0x866c('0x3c'))){validateJwt(_0x246995,_0x1728a6,_0x4baa05);}else{if(_0x30bfc2){_0x4baa05();}else{return _0x1728a6[_0x866c('0x3a')](0x193)[_0x866c('0x2f')]({'message':_0x866c('0x3d')});}}}else if(_0x246995[_0x866c('0x3e')][_0x866c('0x3f')]){try{var _0x4fbfd7={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x866c('0x40')]()};verifyJwt(_0x246995['query'][_0x866c('0x3f')],_0x4fbfd7)['then'](function(_0x145da3){return db[_0x866c('0x37')][_0x866c('0x41')]({'where':{'id':_0x145da3[_0x866c('0x42')]}})[_0x866c('0x2c')](function(_0x4d1a34){if(!_0x4d1a34||!_[_0x866c('0x43')](_0x4d1a34[_0x866c('0x44')],_0x145da3['nonce'])){return _0x1728a6[_0x866c('0x3a')](0x191)[_0x866c('0x2f')]({'message':_0x866c('0x45')});}_0x246995[_0x866c('0x27')]={'id':_0x4d1a34['id']};_0x4baa05();});})[_0x866c('0x32')](function(){return _0x1728a6[_0x866c('0x3a')](0x191)['json']({'message':_0x866c('0x46')});});}catch(_0x3aab71){_0x4baa05(_0x3aab71);}}else if(_0x30bfc2){_0x4baa05();}else{return _0x1728a6[_0x866c('0x3a')](0x193)[_0x866c('0x2f')]({'message':_0x866c('0x3d')});}})[_0x866c('0x47')](function(_0x2d3446,_0x4b7863,_0xbcedc5){if(_0x2d3446[_0x866c('0x27')]){db[_0x866c('0x37')][_0x866c('0x41')]({'where':{'id':_0x2d3446[_0x866c('0x27')]['id']},'attributes':userAttributes})[_0x866c('0x2c')](function(_0x3b963c){if(!_0x3b963c){return _0x4b7863['status'](0x194)[_0x866c('0x2f')]({'message':_0x866c('0x48')});}_0x2d3446[_0x866c('0x27')]=_0x3b963c;_0xbcedc5();})[_0x866c('0x32')](function(_0x2d68d8){_0xbcedc5(_0x2d68d8);});}else if(_0x30bfc2){_0xbcedc5();}else{return _0x4b7863[_0x866c('0x3a')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x866c('0x49')]=function canUpdate(){return compose()['use'](function(_0x2fa701,_0x10e401,_0x184d9d){return require(_0x866c('0x4a'))[_0x866c('0x4b')]()['then'](function(_0x30460b){if(_0x30460b[_0x866c('0x4c')]){_0x184d9d();}else{return _0x10e401[_0x866c('0x3a')](0x193)['json']({'message':_0x866c('0x4d')});}})[_0x866c('0x32')](function(_0xb86e84){_0x184d9d(_0xb86e84);});});};exports[_0x866c('0x4e')]=function(_0x3fd4ff,_0x376f52,_0x144a0a){_0x3fd4ff['isMiddleware']=!![];return _0x144a0a();};exports[_0x866c('0x4f')]=function signToken(_0x29f29e){return signJwt(_0x29f29e);};exports[_0x866c('0x50')]=function(_0x4b1677,_0x3a84be){if(!_0x4b1677[_0x866c('0x27')]){return _0x3a84be[_0x866c('0x3a')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x32d205={'payload':{'id':_0x4b1677['user']['id'],'role':_0x4b1677[_0x866c('0x27')][_0x866c('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x32d205)[_0x866c('0x2c')](function(_0x4e04a6){_0x3a84be['cookie'](_0x866c('0x51'),_0x4e04a6);_0x3a84be[_0x866c('0x52')](_0x866c('0x53'));})[_0x866c('0x32')](function(_0x4c19d0){return _0x3a84be[_0x866c('0x3a')](0x1f4)[_0x866c('0x54')](_0x4c19d0);});};exports['retrieveApiKey']=function(_0x241e63){if(_[_0x866c('0x55')](_0x241e63['apiKeyNonce'])||_[_0x866c('0x55')](_0x241e63[_0x866c('0x56')])){return null;}else{return createJwt(_0x241e63);}};exports[_0x866c('0x57')]=function(_0x3ab01b){_0x3ab01b[_0x866c('0x44')]=generateNonce();_0x3ab01b[_0x866c('0x56')]=generateIssuedAt();return createJwt(_0x3ab01b);};exports[_0x866c('0x58')]=function(_0x931043,_0x126bd7){var _0x69523e=_0x931043[_0x866c('0x3e')][_0x866c('0x3f')];if(_0x69523e){var _0x364117={'nonce':_0x126bd7[_0x866c('0x44')],'iat':_0x126bd7[_0x866c('0x56')],'audience':hardwareConf[_0x866c('0x40')](),'issuer':hardwareConf[_0x866c('0x40')]()};return verifyJwt(_0x69523e,_0x364117)[_0x866c('0x2c')](function(){return generateApiKey(_0x126bd7);});}else{throw{'message':_0x866c('0x59')};}};function signJwt(_0x220f18){var _0x4107dc=BPromise[_0x866c('0x5a')](jwt[_0x866c('0x5b')],{'context':jwt});var _0x1c006d=_0x220f18[_0x866c('0x5c')]||config[_0x866c('0x7')]['session'];return new BPromise(function(_0x42c99b,_0xfe7113){_0x4107dc(_0x220f18['payload'],_0x1c006d,_0x220f18[_0x866c('0x5d')])[_0x866c('0x2c')](function(_0x2deafd){_0x42c99b(_0x2deafd);})[_0x866c('0x32')](function(_0x458f97){_0xfe7113(_0x458f97);});});}function verifyJwt(_0x52a849,_0x4076c8,_0x7845b1){var _0x158a81=BPromise['promisify'](jwt[_0x866c('0x5e')],{'context':jwt});var _0x124a97=_0x7845b1||config[_0x866c('0x7')][_0x866c('0x8')];return new BPromise(function(_0x43ab3a,_0x5d0edb){_0x158a81(_0x52a849,_0x124a97,_0x4076c8)[_0x866c('0x2c')](function(_0x321501){_0x43ab3a(_0x321501);})[_0x866c('0x32')](function(_0x3e6f3a){_0x5d0edb(_0x3e6f3a);});});}function generateNonce(){return crypto[_0x866c('0x5f')](0x10)[_0x866c('0x60')](_0x866c('0x61'));}function generateIssuedAt(){return Math[_0x866c('0x62')](Date[_0x866c('0x63')]()/0x3e8)['toString']();}function createJwt(_0x2adcd3){var _0x2d0eaf={'payload':{'iat':_0x2adcd3[_0x866c('0x56')],'nonce':_0x2adcd3[_0x866c('0x44')]},'options':{'algorithm':_0x866c('0x64'),'subject':_0x2adcd3['id'][_0x866c('0x60')](),'issuer':hardwareConf[_0x866c('0x40')](),'audience':hardwareConf[_0x866c('0x40')]()}};return signJwt(_0x2d0eaf)['then'](function(_0x29517c){return{'iat':_0x2adcd3['apiKeyIat'],'nonce':_0x2adcd3['apiKeyNonce'],'token':_0x29517c};});}
\ No newline at end of file
index 3e7697d..4d2bc25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0x5ecdb5,_0x13b120){var _0x5d1d0e=function(_0x98cee0){while(--_0x98cee0){_0x5ecdb5['push'](_0x5ecdb5['shift']());}};_0x5d1d0e(++_0x13b120);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});};
\ No newline at end of file
+var _0xa9e0=['update','close','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createCipher','algorithm','data','final','binary','write','end','unlink','decryptFile'];(function(_0x10e7d4,_0x538ba6){var _0x34de14=function(_0x4f4567){while(--_0x4f4567){_0x10e7d4['push'](_0x10e7d4['shift']());}};_0x34de14(++_0x538ba6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var crypto=require(_0x0a9e('0x0'));var fs=require('fs');var BPromise=require(_0x0a9e('0x1'));var defaultOptions={'algorithm':_0x0a9e('0x2')};function combineOptions(_0x5dd881){var _0x550fbc={};for(var _0x18d5c9 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x18d5c9)){_0x550fbc[_0x18d5c9]=defaultOptions[_0x18d5c9];}}if(_0x5dd881){for(var _0x333808 in _0x5dd881){if(_0x5dd881[_0x0a9e('0x3')](_0x333808)){_0x550fbc[_0x333808]=_0x5dd881[_0x333808];}}}return _0x550fbc;}exports[_0x0a9e('0x4')]=function(_0x991246,_0x981158,_0x57b080,_0x219af0){return new BPromise(function(_0x441e3a,_0x2cc193){_0x219af0=combineOptions(_0x219af0);var _0x5f41ea=new Buffer(_0x57b080);var _0x503809=fs[_0x0a9e('0x5')](_0x991246);var _0x56465b=fs['createWriteStream'](_0x981158);var _0x39753a=crypto[_0x0a9e('0x6')](_0x219af0[_0x0a9e('0x7')],_0x5f41ea);_0x503809['on'](_0x0a9e('0x8'),function(_0xfeb75b){var _0xbd1168=new Buffer(_0x39753a['update'](_0xfeb75b),'binary');_0x56465b['write'](_0xbd1168);});_0x503809['on']('end',function(){try{var _0x273d4d=new Buffer(_0x39753a[_0x0a9e('0x9')](_0x0a9e('0xa')),_0x0a9e('0xa'));_0x56465b[_0x0a9e('0xb')](_0x273d4d);_0x56465b[_0x0a9e('0xc')]();_0x56465b['on']('close',function(){return _0x441e3a(_0x981158);});}catch(_0x4283ce){fs[_0x0a9e('0xd')](_0x981158);return _0x2cc193(_0x4283ce);}});});};exports[_0x0a9e('0xe')]=function(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){_0x52a03d=combineOptions(_0x52a03d);var _0x1985b6=new Buffer(_0x4d5611);var _0x519dfd=fs[_0x0a9e('0x5')](_0x281129);var _0x12066b=fs['createWriteStream'](_0x44dcfd);var _0x225616=crypto['createDecipher'](_0x52a03d[_0x0a9e('0x7')],_0x1985b6);_0x519dfd['on'](_0x0a9e('0x8'),function(_0x106033){var _0x205fd6=new Buffer(_0x225616[_0x0a9e('0xf')](_0x106033),_0x0a9e('0xa'));_0x12066b[_0x0a9e('0xb')](_0x205fd6);});_0x519dfd['on'](_0x0a9e('0xc'),function(){try{var _0x1314ae=new Buffer(_0x225616[_0x0a9e('0x9')](_0x0a9e('0xa')),_0x0a9e('0xa'));_0x12066b['write'](_0x1314ae);_0x12066b[_0x0a9e('0xc')]();_0x12066b['on'](_0x0a9e('0x10'),function(){return _0x22dccb(_0x44dcfd);});}catch(_0x53682f){fs[_0x0a9e('0xd')](_0x44dcfd);return _0x5d0880(_0x53682f);}});});};
\ No newline at end of file
index 7b54f7b..57b407f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['push','QueryTypes','SELECT','dirname','.csv','join','each','%s%d.%s','csv','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','bluebird','../../mysqldb','dbH','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','query','sequelize','num','Empty','length'];(function(_0xe5287b,_0x26b8ab){var _0x346f77=function(_0x4d52d7){while(--_0x4d52d7){_0xe5287b['push'](_0xe5287b['shift']());}};_0x346f77(++_0x26b8ab);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0x4b84[_0x3c858f];return _0x198090;};'use strict';var util=require(_0x44b8('0x0'));var path=require(_0x44b8('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x44b8('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x44b8('0x3'))['db'];var dbH=require(_0x44b8('0x3'))[_0x44b8('0x4')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x44b8('0x5')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x327f59,_0x5947f7){var _0x3e87c5={'status':_0x327f59};var _0x5a2353={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5947f7){_0x3e87c5['savename']=_0x5947f7;}return db[_0x44b8('0x6')][_0x44b8('0x7')](_0x3e87c5,_0x5a2353);}function main(){var _0x30ebc3=0x1388;var _0x48a371;logger[_0x44b8('0x8')](util[_0x44b8('0x9')](_0x44b8('0xa'),EXTRACTED_REPORT_ID,_0x44b8('0xb')));return db[_0x44b8('0xc')][_0x44b8('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x44b8('0xe'),'splitSizeCsv']})[_0x44b8('0xf')](function(_0x4301a6){if(_0x4301a6){_0x48a371=_0x4301a6;_0x30ebc3=_0x48a371['splitSizeCsv']||0x1388;}})[_0x44b8('0xf')](function(){return dbH['sequelize'][_0x44b8('0x10')](util[_0x44b8('0x9')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x44b8('0x11')]['QueryTypes']['SELECT']});})[_0x44b8('0xf')](function(_0x2af0ad){if(!_0x2af0ad[0x0][_0x44b8('0x12')]){return analyticExtractedReport(_0x44b8('0x13'));}var _0x5e52f2=[];var _0x495c74=0x0;var _0x5d6349=!![];if(_0x2af0ad&&_0x2af0ad[_0x44b8('0x14')]){var _0x5b7803=_0x2af0ad[0x0][_0x44b8('0x12')]%(_0x495c74+_0x30ebc3);if(_0x48a371[_0x44b8('0xe')]){for(;_0x5d6349;_0x495c74+=_0x30ebc3,_0x5b7803=_0x2af0ad[0x0]['num']%(_0x495c74+_0x30ebc3)){if(_0x5b7803==0x0||_0x5b7803==_0x2af0ad[0x0][_0x44b8('0x12')]){_0x5d6349=![];}_0x5e52f2[_0x44b8('0x15')](dbH['sequelize'][_0x44b8('0x10')](util[_0x44b8('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x30ebc3,_0x495c74),{'type':dbH[_0x44b8('0x11')][_0x44b8('0x16')][_0x44b8('0x17')]}));}}else{_0x5e52f2[_0x44b8('0x15')](dbH[_0x44b8('0x11')][_0x44b8('0x10')](QUERY,{'type':dbH[_0x44b8('0x11')][_0x44b8('0x16')][_0x44b8('0x17')]}));}}var _0x1e0f2d=path[_0x44b8('0x18')](PATH);var _0x14996c=path['basename'](PATH,_0x44b8('0x19'));var _0x3a8aa4=_0x48a371[_0x44b8('0xe')]&&_0x5e52f2[_0x44b8('0x14')]>0x1;var _0x305a5c=[];if(!fs['existsSync'](path[_0x44b8('0x1a')](_0x1e0f2d,_0x14996c))&&_0x3a8aa4){fs['mkdirSync'](path[_0x44b8('0x1a')](_0x1e0f2d,_0x14996c));}return BPromise[_0x44b8('0x1b')](_0x5e52f2,function(_0x25a0c1){_0x305a5c[_0x44b8('0x15')](_0x25a0c1);})[_0x44b8('0xf')](function(){for(var _0x59acbc=0x0;_0x59acbc<_0x305a5c[_0x44b8('0x14')];_0x59acbc+=0x1){var _0x502acf;var _0x41d673=_0x305a5c[_0x59acbc];if(_0x3a8aa4){_0x502acf=path[_0x44b8('0x1a')](_0x1e0f2d,_0x14996c,util['format'](_0x44b8('0x1c'),_0x14996c,_0x59acbc,_0x44b8('0x1d')));}else{_0x502acf=path[_0x44b8('0x1a')](_0x1e0f2d,util['format'](_0x44b8('0x1e'),_0x14996c,_0x44b8('0x1d')));}fs['writeFileSync'](_0x502acf,csv(_0x41d673));}})[_0x44b8('0xf')](function(){if(_0x3a8aa4){zipdir(path['join'](_0x1e0f2d,_0x14996c),{'saveTo':path[_0x44b8('0x1a')](_0x1e0f2d,util['format']('%s.%s',_0x14996c,'zip'))},function(_0x387293,_0x29b18d){});rimraf(path[_0x44b8('0x1a')](_0x1e0f2d,_0x14996c),function(){});}})[_0x44b8('0xf')](function(){logger[_0x44b8('0x8')](util[_0x44b8('0x9')](_0x44b8('0x1f'),EXTRACTED_REPORT_ID,_0x44b8('0xb')));return analyticExtractedReport(_0x44b8('0x20'),_0x3a8aa4?util[_0x44b8('0x9')](_0x44b8('0x1e'),_0x14996c,_0x3a8aa4?_0x44b8('0x21'):_0x44b8('0x1d')):null);});})['catch'](function(_0x261ff2){logger['info'](util[_0x44b8('0x9')](_0x44b8('0x22'),EXTRACTED_REPORT_ID,_0x44b8('0xb')),util[_0x44b8('0x23')](_0x261ff2,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x44b8('0x24'));});}main();
\ No newline at end of file
+var _0x4522=['Setting','find','split','splitSizeCsv','then','format','sequelize','SELECT','num','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','mkdirSync','join','each','csv','writeFileSync','Completed','%s.%s','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','CSV'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4522,0x1a0));var _0x2452=function(_0x453a05,_0x102018){_0x453a05=_0x453a05-0x0;var _0xc42c7d=_0x4522[_0x453a05];return _0xc42c7d;};'use strict';var util=require('util');var path=require('path');var _=require(_0x2452('0x0'));var csv=require(_0x2452('0x1'));var fs=require('fs');var BPromise=require(_0x2452('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x2452('0x3'));var db=require(_0x2452('0x4'))['db'];var dbH=require(_0x2452('0x4'))[_0x2452('0x5')];var logger=require(_0x2452('0x6'))(_0x2452('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x2452('0x8')][0x2]);var QUERY=process[_0x2452('0x8')][0x3];var PATH=process[_0x2452('0x8')][0x4];function analyticExtractedReport(_0x149807,_0x3bc193){var _0x33b935={'status':_0x149807};var _0x24073f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3bc193){_0x33b935[_0x2452('0x9')]=_0x3bc193;}return db[_0x2452('0xa')][_0x2452('0xb')](_0x33b935,_0x24073f);}function main(){var _0x5a38e0=0x1388;var _0x5dc630;logger[_0x2452('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2452('0xd')));return db[_0x2452('0xe')][_0x2452('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2452('0x10'),_0x2452('0x11')]})[_0x2452('0x12')](function(_0x2c1e0f){if(_0x2c1e0f){_0x5dc630=_0x2c1e0f;_0x5a38e0=_0x5dc630[_0x2452('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0x2452('0x13')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x2452('0x14')]['QueryTypes'][_0x2452('0x15')]});})[_0x2452('0x12')](function(_0x5d0438){if(!_0x5d0438[0x0][_0x2452('0x16')]){return analyticExtractedReport('Empty');}var _0x3dd8cc=[];var _0x734b88=0x0;var _0x461d2b=!![];if(_0x5d0438&&_0x5d0438[_0x2452('0x17')]){var _0x4e1d20=_0x5d0438[0x0][_0x2452('0x16')]%(_0x734b88+_0x5a38e0);if(_0x5dc630[_0x2452('0x10')]){for(;_0x461d2b;_0x734b88+=_0x5a38e0,_0x4e1d20=_0x5d0438[0x0]['num']%(_0x734b88+_0x5a38e0)){if(_0x4e1d20==0x0||_0x4e1d20==_0x5d0438[0x0]['num']){_0x461d2b=![];}_0x3dd8cc[_0x2452('0x18')](dbH[_0x2452('0x14')][_0x2452('0x19')](util['format'](_0x2452('0x1a'),QUERY,_0x5a38e0,_0x734b88),{'type':dbH[_0x2452('0x14')][_0x2452('0x1b')][_0x2452('0x15')]}));}}else{_0x3dd8cc[_0x2452('0x18')](dbH[_0x2452('0x14')][_0x2452('0x19')](QUERY,{'type':dbH[_0x2452('0x14')]['QueryTypes']['SELECT']}));}}var _0x1f060d=path[_0x2452('0x1c')](PATH);var _0x4bb3ff=path[_0x2452('0x1d')](PATH,_0x2452('0x1e'));var _0x1d5720=_0x5dc630[_0x2452('0x10')]&&_0x3dd8cc[_0x2452('0x17')]>0x1;var _0x397f21=[];if(!fs[_0x2452('0x1f')](path['join'](_0x1f060d,_0x4bb3ff))&&_0x1d5720){fs[_0x2452('0x20')](path[_0x2452('0x21')](_0x1f060d,_0x4bb3ff));}return BPromise[_0x2452('0x22')](_0x3dd8cc,function(_0x231410){_0x397f21[_0x2452('0x18')](_0x231410);})['then'](function(){for(var _0x48783a=0x0;_0x48783a<_0x397f21[_0x2452('0x17')];_0x48783a+=0x1){var _0x159ba1;var _0x46fcbb=_0x397f21[_0x48783a];if(_0x1d5720){_0x159ba1=path[_0x2452('0x21')](_0x1f060d,_0x4bb3ff,util[_0x2452('0x13')]('%s%d.%s',_0x4bb3ff,_0x48783a,_0x2452('0x23')));}else{_0x159ba1=path[_0x2452('0x21')](_0x1f060d,util['format']('%s.%s',_0x4bb3ff,_0x2452('0x23')));}fs[_0x2452('0x24')](_0x159ba1,csv(_0x46fcbb));}})[_0x2452('0x12')](function(){if(_0x1d5720){zipdir(path[_0x2452('0x21')](_0x1f060d,_0x4bb3ff),{'saveTo':path[_0x2452('0x21')](_0x1f060d,util[_0x2452('0x13')]('%s.%s',_0x4bb3ff,'zip'))},function(_0x46b611,_0x454e0a){});rimraf(path[_0x2452('0x21')](_0x1f060d,_0x4bb3ff),function(){});}})['then'](function(){logger[_0x2452('0xc')](util[_0x2452('0x13')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2452('0xd')));return analyticExtractedReport(_0x2452('0x25'),_0x1d5720?util[_0x2452('0x13')](_0x2452('0x26'),_0x4bb3ff,_0x1d5720?_0x2452('0x27'):_0x2452('0x23')):null);});})[_0x2452('0x28')](function(_0x115e09){logger[_0x2452('0xc')](util[_0x2452('0x13')](_0x2452('0x29'),EXTRACTED_REPORT_ID,_0x2452('0xd')),util[_0x2452('0x2a')](_0x115e09,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
index 23eebab..7a2c794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','createWriteStream','finish','err','end','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x56481e,_0xdbfb57){var _0x3a4a59=function(_0x30daf6){while(--_0x30daf6){_0x56481e['push'](_0x56481e['shift']());}};_0x3a4a59(++_0xdbfb57);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2beb43,_0x1188d6){_0x2beb43=_0x2beb43-0x0;var _0x540848=_0x5f2f[_0x2beb43];return _0x540848;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x338dd4,_0x5b69fe){var _0x56be5a=function(_0x278108){while(--_0x278108){_0x338dd4['push'](_0x338dd4['shift']());}};_0x56be5a(++_0x5b69fe);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main();
\ No newline at end of file
index 5f84c99..0d65bc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc63e=['.xlsx','join','mkdirSync','each','length','%s%d.%s','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','xlsx','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x4f161d,_0x429373){var _0x3e60a3=function(_0x1c1df1){while(--_0x1c1df1){_0x4f161d['push'](_0x4f161d['shift']());}};_0x3e60a3(++_0x429373);}(_0xc63e,0x1db));var _0xec63=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0xc63e[_0x22eb96];return _0x5e1adf;};'use strict';var util=require(_0xec63('0x0'));var path=require(_0xec63('0x1'));var _=require(_0xec63('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xec63('0x3'));var zipdir=require(_0xec63('0x4'));var rimraf=require(_0xec63('0x5'));var db=require(_0xec63('0x6'))['db'];var dbH=require('../../mysqldb')[_0xec63('0x7')];var logger=require(_0xec63('0x8'))(_0xec63('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xec63('0xa')][0x4];function analyticExtractedReport(_0x3472a5,_0x488a16){var _0x4dba5a={'status':_0x3472a5};var _0x518241={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x488a16){_0x4dba5a[_0xec63('0xb')]=_0x488a16;}return db[_0xec63('0xc')][_0xec63('0xd')](_0x4dba5a,_0x518241);}function main(){var _0x5c268a=0x1388;var _0x182cb7;logger['info'](util[_0xec63('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xec63('0xf')));return db[_0xec63('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xec63('0x11'),_0xec63('0x12')]})[_0xec63('0x13')](function(_0xb1daef){if(_0xb1daef){_0x182cb7=_0xb1daef;_0x5c268a=_0x182cb7[_0xec63('0x12')]||0x1388;}})[_0xec63('0x13')](function(){return dbH[_0xec63('0x14')][_0xec63('0x15')](util[_0xec63('0xe')](_0xec63('0x16'),QUERY),{'type':dbH['sequelize'][_0xec63('0x17')][_0xec63('0x18')]});})[_0xec63('0x13')](function(_0x2806e0){if(!_0x2806e0[0x0][_0xec63('0x19')]){return analyticExtractedReport(_0xec63('0x1a'));}var _0x4cd0f9=[];var _0x366303=0x0;var _0x363e6c=!![];if(_0x182cb7['split']){if(_0x2806e0&&_0x2806e0['length']){var _0x586ccb=_0x2806e0[0x0][_0xec63('0x19')]%(_0x366303+_0x5c268a);for(;_0x363e6c;_0x366303+=_0x5c268a,_0x586ccb=_0x2806e0[0x0][_0xec63('0x19')]%(_0x366303+_0x5c268a)){if(_0x586ccb==0x0||_0x586ccb==_0x2806e0[0x0][_0xec63('0x19')]){_0x363e6c=![];}_0x4cd0f9[_0xec63('0x1b')](dbH[_0xec63('0x14')]['query'](util['format'](_0xec63('0x1c'),QUERY,_0x5c268a,_0x366303),{'type':dbH[_0xec63('0x14')]['QueryTypes'][_0xec63('0x18')]}));}}}else{_0x4cd0f9[_0xec63('0x1b')](dbH[_0xec63('0x14')][_0xec63('0x15')](QUERY,{'type':dbH['sequelize'][_0xec63('0x17')]['SELECT']}));}var _0x3e5611=path[_0xec63('0x1d')](PATH);var _0x7453a3=path[_0xec63('0x1e')](PATH,_0xec63('0x1f'));var _0x27d28b=_0x182cb7[_0xec63('0x11')]&&_0x4cd0f9['length']>0x1;var _0x2576ed=[];if(!fs['existsSync'](path[_0xec63('0x20')](_0x3e5611,_0x7453a3))&&_0x27d28b){fs[_0xec63('0x21')](path[_0xec63('0x20')](_0x3e5611,_0x7453a3));}return BPromise[_0xec63('0x22')](_0x4cd0f9,function(_0x307fb8){_0x2576ed[_0xec63('0x1b')](_0x307fb8);})[_0xec63('0x13')](function(){for(var _0x368726=0x0;_0x368726<_0x2576ed[_0xec63('0x23')];_0x368726+=0x1){var _0x5d4eda;var _0x3731f0=_0x2576ed[_0x368726];if(_0x27d28b){_0x5d4eda=path[_0xec63('0x20')](_0x3e5611,_0x7453a3,util[_0xec63('0xe')](_0xec63('0x24'),_0x7453a3,_0x368726,'xlsx'));}else{_0x5d4eda=path[_0xec63('0x20')](_0x3e5611,util[_0xec63('0xe')](_0xec63('0x25'),_0x7453a3,'xlsx'));}fs[_0xec63('0x26')](_0x5d4eda,json2xls(_0x3731f0),_0xec63('0x27'));}})[_0xec63('0x13')](function(){if(_0x27d28b){zipdir(path[_0xec63('0x20')](_0x3e5611,_0x7453a3),{'saveTo':path[_0xec63('0x20')](_0x3e5611,util['format'](_0xec63('0x25'),_0x7453a3,_0xec63('0x28')))},function(_0x46ca31,_0xbf6761){});rimraf(path[_0xec63('0x20')](_0x3e5611,_0x7453a3),function(){});}})['then'](function(){logger['info'](util[_0xec63('0xe')](_0xec63('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xec63('0x2a'),_0x27d28b?util[_0xec63('0xe')]('%s.%s',_0x7453a3,_0x27d28b?_0xec63('0x28'):_0xec63('0x2b')):null);});})[_0xec63('0x2c')](function(_0x2f1670){logger['info'](util[_0xec63('0xe')](_0xec63('0x2d'),EXTRACTED_REPORT_ID,_0xec63('0xf')),util['inspect'](_0x2f1670,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
+var _0xe6b0=['../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','format','XLSX','Setting','find','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','split','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','query','dirname','basename','join','mkdirSync','xlsx','%s.%s','writeFileSync','binary','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash','json2xls','bluebird'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xe6b0,0x18b));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0e6b('0x0'));var path=require(_0x0e6b('0x1'));var _=require(_0x0e6b('0x2'));var fs=require('fs');var json2xls=require(_0x0e6b('0x3'));var BPromise=require(_0x0e6b('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x0e6b('0x5'))[_0x0e6b('0x6')];var logger=require('../../config/logger')(_0x0e6b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x0e6b('0x8')][0x2]);var QUERY=process[_0x0e6b('0x8')][0x3];var PATH=process[_0x0e6b('0x8')][0x4];function analyticExtractedReport(_0x4a0d14,_0x32c62b){var _0x3250c5={'status':_0x4a0d14};var _0x174a5c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32c62b){_0x3250c5[_0x0e6b('0x9')]=_0x32c62b;}return db[_0x0e6b('0xa')]['update'](_0x3250c5,_0x174a5c);}function main(){var _0x482491=0x1388;var _0x1334b2;logger['info'](util[_0x0e6b('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0e6b('0xc')));return db[_0x0e6b('0xd')][_0x0e6b('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0e6b('0xf')]})[_0x0e6b('0x10')](function(_0x21e4ef){if(_0x21e4ef){_0x1334b2=_0x21e4ef;_0x482491=_0x1334b2[_0x0e6b('0xf')]||0x1388;}})[_0x0e6b('0x10')](function(){return dbH['sequelize']['query'](util[_0x0e6b('0xb')](_0x0e6b('0x11'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x0e6b('0x12')]});})['then'](function(_0x4f1736){if(!_0x4f1736[0x0][_0x0e6b('0x13')]){return analyticExtractedReport(_0x0e6b('0x14'));}var _0x1908e9=[];var _0x263d84=0x0;var _0x38f44c=!![];if(_0x1334b2[_0x0e6b('0x15')]){if(_0x4f1736&&_0x4f1736[_0x0e6b('0x16')]){var _0x52be15=_0x4f1736[0x0]['num']%(_0x263d84+_0x482491);for(;_0x38f44c;_0x263d84+=_0x482491,_0x52be15=_0x4f1736[0x0][_0x0e6b('0x13')]%(_0x263d84+_0x482491)){if(_0x52be15==0x0||_0x52be15==_0x4f1736[0x0]['num']){_0x38f44c=![];}_0x1908e9[_0x0e6b('0x17')](dbH['sequelize']['query'](util[_0x0e6b('0xb')](_0x0e6b('0x18'),QUERY,_0x482491,_0x263d84),{'type':dbH[_0x0e6b('0x19')]['QueryTypes'][_0x0e6b('0x12')]}));}}}else{_0x1908e9[_0x0e6b('0x17')](dbH[_0x0e6b('0x19')][_0x0e6b('0x1a')](QUERY,{'type':dbH[_0x0e6b('0x19')]['QueryTypes']['SELECT']}));}var _0x37a0fb=path[_0x0e6b('0x1b')](PATH);var _0x6f0662=path[_0x0e6b('0x1c')](PATH,'.xlsx');var _0xa9205c=_0x1334b2[_0x0e6b('0x15')]&&_0x1908e9[_0x0e6b('0x16')]>0x1;var _0x3f17dc=[];if(!fs['existsSync'](path[_0x0e6b('0x1d')](_0x37a0fb,_0x6f0662))&&_0xa9205c){fs[_0x0e6b('0x1e')](path[_0x0e6b('0x1d')](_0x37a0fb,_0x6f0662));}return BPromise['each'](_0x1908e9,function(_0x3e8e2a){_0x3f17dc[_0x0e6b('0x17')](_0x3e8e2a);})['then'](function(){for(var _0x3f6057=0x0;_0x3f6057<_0x3f17dc[_0x0e6b('0x16')];_0x3f6057+=0x1){var _0x575b30;var _0x40e916=_0x3f17dc[_0x3f6057];if(_0xa9205c){_0x575b30=path[_0x0e6b('0x1d')](_0x37a0fb,_0x6f0662,util[_0x0e6b('0xb')]('%s%d.%s',_0x6f0662,_0x3f6057,_0x0e6b('0x1f')));}else{_0x575b30=path['join'](_0x37a0fb,util[_0x0e6b('0xb')](_0x0e6b('0x20'),_0x6f0662,_0x0e6b('0x1f')));}fs[_0x0e6b('0x21')](_0x575b30,json2xls(_0x40e916),_0x0e6b('0x22'));}})[_0x0e6b('0x10')](function(){if(_0xa9205c){zipdir(path[_0x0e6b('0x1d')](_0x37a0fb,_0x6f0662),{'saveTo':path[_0x0e6b('0x1d')](_0x37a0fb,util['format']('%s.%s',_0x6f0662,_0x0e6b('0x23')))},function(_0x30621a,_0x3415ce){});rimraf(path[_0x0e6b('0x1d')](_0x37a0fb,_0x6f0662),function(){});}})[_0x0e6b('0x10')](function(){logger['info'](util[_0x0e6b('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x0e6b('0x24'),_0xa9205c?util[_0x0e6b('0xb')](_0x0e6b('0x20'),_0x6f0662,_0xa9205c?'zip':_0x0e6b('0x1f')):null);});})[_0x0e6b('0x25')](function(_0x9cade7){logger['info'](util[_0x0e6b('0xb')](_0x0e6b('0x26'),EXTRACTED_REPORT_ID,_0x0e6b('0xc')),util['inspect'](_0x9cade7,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0e6b('0x27'));});}main();
\ No newline at end of file
index 292b177..18c110b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8623=['then','intervals','IntervalId','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','context','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','map','tag','CDR(tag)=','length','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)','hasOwnProperty','answer','indexOf','app','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','models','Interval','findAll'];(function(_0x2b00fd,_0x5d5ba8){var _0x3774f9=function(_0x3183a9){while(--_0x3183a9){_0x2b00fd['push'](_0x2b00fd['shift']());}};_0x3774f9(++_0x5d5ba8);}(_0x8623,0x194));var _0x3862=function(_0x5db753,_0x188ebe){_0x5db753=_0x5db753-0x0;var _0x47da22=_0x8623[_0x5db753];return _0x47da22;};'use strict';var _=require(_0x3862('0x0'));var util=require('util');function rewrite(_0x46b75d,_0x4ecda8){var _0x4ca652=this;return _0x46b75d[_0x3862('0x1')][_0x3862('0x2')][_0x3862('0x3')]({'raw':!![]})[_0x3862('0x4')](function(_0x2bfd97){_0x4ca652[_0x3862('0x5')]=_0x2bfd97;return _0x46b75d['models']['VoiceExtension'][_0x3862('0x3')]({'where':{'IntervalId':_0x4ecda8[_0x3862('0x6')]},'raw':!![]});})[_0x3862('0x4')](function(_0x379400){return _0x46b75d[_0x3862('0x1')][_0x3862('0x7')][_0x3862('0x3')]({'where':{'exten':{'$in':_[_0x3862('0x8')](_['map'](_0x379400,_0x3862('0x9')))}},'order':[{'raw':_0x3862('0xa')}],'raw':!![]});})[_0x3862('0x4')](function(_0x8f500a){var _0x334abf=_[_0x3862('0xb')](_0x8f500a,{'priority':'1'});var _0x3d58cc=_[_0x3862('0xb')](_0x8f500a,{'isApp':0x1});var _0x32d467=_['groupBy'](_0x3d58cc,_0x3862('0x9'));var _0x1828aa=['queue','playback'];var _0x2b54c9=[];var _0x13c6b6=[];for(var _0x3adfe6 in _0x32d467){if(_0x32d467['hasOwnProperty'](_0x3adfe6)){_0x4ca652[_0x3862('0xc')]=0x2;_0x4ca652[_0x3862('0xd')]=[];_0x4ca652[_0x3862('0xe')]=_[_0x3862('0xf')](_0x334abf,{'exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')]});_0x4ca652['extensions'][_0x3862('0x10')]({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':util['format'](_0x3862('0x13'),_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')]),'context':_0x32d467[_0x3adfe6][0x0]['context'],'exten':_0x32d467[_0x3adfe6][0x0]['exten'],'priority':_0x4ca652['priority']++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});if(_0x32d467[_0x3adfe6][0x0]['type']===_0x3862('0x15')){if(_0x4ca652['extension']){_0x4ca652['extensions'][_0x3862('0x10')]({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':'Set','appdata':_0x3862('0x16')+(_0x4ca652[_0x3862('0xe')][_0x3862('0x17')]?'${EXTEN:'+_0x4ca652['extension'][_0x3862('0x17')]+'}':_0x3862('0x18')),'context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')],'priority':_0x4ca652[_0x3862('0xc')]++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0]['VoiceExtensionId']});}_0x4ca652[_0x3862('0xd')][_0x3862('0x10')]({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':_0x3862('0x1a')+_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')],'context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'exten':_0x32d467[_0x3adfe6][0x0]['exten'],'priority':_0x4ca652[_0x3862('0xc')]++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});var _0x5f5950=_0x4ca652['priority']++;_0x4ca652[_0x3862('0xd')]['push']({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':_0x3862('0x1b'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5f5950+0x2)+_0x3862('0x1c')+(_0x5f5950+0x1)+')','context':_0x32d467[_0x3adfe6][0x0]['context'],'exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')],'priority':_0x5f5950,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});if(_0x4ca652[_0x3862('0xe')]){_0x4ca652['extensions']['push']({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':_0x4ca652['extension'][_0x3862('0x17')]?_0x3862('0x1d')+_0x4ca652['extension'][_0x3862('0x17')]+'}':_0x3862('0x1e'),'context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')],'priority':_0x4ca652['priority']++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});}_0x4ca652['extensions'][_0x3862('0x10')]({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':_0x3862('0x1f')+_0x32d467[_0x3adfe6][0x0]['VoiceExtensionId'],'context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'exten':_0x32d467[_0x3adfe6][0x0]['exten'],'priority':_0x4ca652['priority']++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0]['VoiceExtensionId']});if(_0x4ca652[_0x3862('0xe')]&&_0x4ca652[_0x3862('0xe')]['hasOwnProperty']('recordingFormat')&&_0x4ca652[_0x3862('0xe')][_0x3862('0x20')]!==_0x3862('0x21')){_0x4ca652[_0x3862('0xd')][_0x3862('0x10')]({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')],'priority':_0x4ca652[_0x3862('0xc')]++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});_0x4ca652[_0x3862('0xd')][_0x3862('0x10')]({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':_0x3862('0x22')+_0x4ca652[_0x3862('0xe')][_0x3862('0x20')]||_0x3862('0x23'),'context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')],'priority':_0x4ca652[_0x3862('0xc')]++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0]['VoiceExtensionId']});}}_0x4ca652[_0x3862('0xd')]['push']({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'exten':_0x32d467[_0x3adfe6][0x0]['exten'],'priority':_0x4ca652[_0x3862('0xc')]++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});_0x4ca652[_0x3862('0xd')]['push']({'type':_0x32d467[_0x3adfe6][0x0]['type'],'app':_0x3862('0x12'),'appdata':_0x3862('0x24'),'context':_0x32d467[_0x3adfe6][0x0]['context'],'exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')],'priority':_0x4ca652[_0x3862('0xc')]++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});_0x4ca652[_0x3862('0xd')][_0x3862('0x10')]({'type':_0x32d467[_0x3adfe6][0x0]['type'],'app':_0x3862('0x12'),'appdata':_0x3862('0x25'),'context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')],'priority':_0x4ca652[_0x3862('0xc')]++,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});for(var _0x4a9590=0x0,_0x1d27a2=0x0;_0x4a9590<_0x32d467[_0x3adfe6]['length'];_0x4a9590+=0x1,_0x1d27a2=0x0){var _0x43238e=_0x32d467[_0x3adfe6][_0x4a9590];if(_0x43238e[_0x3862('0x11')]){_0x43238e[_0x3862('0x11')]=_0x43238e[_0x3862('0x11')][_0x3862('0x26')]();}var _0x54182a=[];var _0x56e5c4=[];delete _0x43238e['id'];delete _0x43238e[_0x3862('0x27')];delete _0x43238e[_0x3862('0x28')];var _0x16010b=_0x43238e[_0x3862('0x29')]!==_0x3862('0x2a')?[_0x43238e['interval']]:_0x43238e[_0x3862('0x6')]?_[_0x3862('0x2b')](_[_0x3862('0xb')](_0x4ca652[_0x3862('0x5')],{'IntervalId':_0x43238e[_0x3862('0x6')]}),_0x3862('0x29')):[];if(_0x43238e['hasOwnProperty'](_0x3862('0x2c'))){if(_0x43238e['tag']&&_0x43238e[_0x3862('0x2c')]!=='--'){_0x54182a[_0x3862('0x10')]({'type':_0x43238e[_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':_0x3862('0x2d')+_0x43238e[_0x3862('0x2c')],'context':_0x43238e['context'],'exten':_0x43238e[_0x3862('0x9')],'priority':_0x16010b[_0x3862('0x2e')]+_0x4ca652[_0x3862('0xc')]+_0x1d27a2++,'VoiceExtensionId':_0x43238e['VoiceExtensionId']});}}if(_0x43238e[_0x3862('0x11')]===_0x3862('0x15')&&_0x43238e['hasOwnProperty'](_0x3862('0x2f'))){if(_0x43238e[_0x3862('0x2f')]){_0x54182a['push']({'type':_0x43238e[_0x3862('0x11')],'app':_0x3862('0x1b'),'appdata':_0x3862('0x30')+_0x43238e[_0x3862('0x2f')]+')','context':_0x43238e['context'],'exten':_0x43238e[_0x3862('0x9')],'priority':_0x16010b[_0x3862('0x2e')]+_0x4ca652[_0x3862('0xc')]+_0x1d27a2++,'VoiceExtensionId':_0x43238e[_0x3862('0x14')]});}else{_0x54182a[_0x3862('0x10')]({'type':_0x43238e[_0x3862('0x11')],'app':'ExecIf','appdata':_0x3862('0x31'),'context':_0x43238e['context'],'exten':_0x43238e[_0x3862('0x9')],'priority':_0x16010b['length']+_0x4ca652[_0x3862('0xc')]+_0x1d27a2++,'VoiceExtensionId':_0x43238e[_0x3862('0x14')]});}}if(_0x43238e[_0x3862('0x32')](_0x3862('0x33'))){if(_0x1828aa[_0x3862('0x34')](_0x43238e[_0x3862('0x35')][_0x3862('0x26')]())>=0x0&&_0x43238e['appType']!==_0x3862('0x36')){if(_0x43238e[_0x3862('0x33')]){_0x54182a['push']({'type':_0x43238e['type'],'app':_0x3862('0x1b'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x43238e['context'],'exten':_0x43238e[_0x3862('0x9')],'priority':_0x16010b[_0x3862('0x2e')]+_0x4ca652[_0x3862('0xc')]+_0x1d27a2++,'VoiceExtensionId':_0x43238e[_0x3862('0x14')]});_0x54182a[_0x3862('0x10')]({'type':_0x43238e[_0x3862('0x11')],'app':'Set','appdata':_0x3862('0x37'),'context':_0x43238e[_0x3862('0x19')],'exten':_0x43238e[_0x3862('0x9')],'priority':_0x16010b['length']+_0x4ca652['priority']+_0x1d27a2++,'VoiceExtensionId':_0x43238e['VoiceExtensionId']});}else{_0x54182a[_0x3862('0x10')]({'type':_0x43238e[_0x3862('0x11')],'app':_0x3862('0x1b'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x43238e[_0x3862('0x19')],'exten':_0x43238e[_0x3862('0x9')],'priority':_0x16010b[_0x3862('0x2e')]+_0x4ca652[_0x3862('0xc')]+_0x1d27a2++,'VoiceExtensionId':_0x43238e[_0x3862('0x14')]});_0x54182a[_0x3862('0x10')]({'type':_0x43238e[_0x3862('0x11')],'app':_0x3862('0x12'),'appdata':_0x3862('0x38'),'context':_0x43238e['context'],'exten':_0x43238e['exten'],'priority':_0x16010b[_0x3862('0x2e')]+_0x4ca652[_0x3862('0xc')]+_0x1d27a2++,'VoiceExtensionId':_0x43238e[_0x3862('0x14')]});}}}for(var _0x2163dd=0x0;_0x2163dd<_0x16010b['length'];_0x2163dd+=0x1){var _0x11e9d6=_0x4ca652[_0x3862('0xc')]+_0x16010b[_0x3862('0x2e')];var _0xb12fb0=_0x2163dd===_0x16010b[_0x3862('0x2e')]-0x1?_0x4ca652[_0x3862('0xc')]+_0x54182a[_0x3862('0x2e')]+_0x56e5c4[_0x3862('0x2e')]+0x2:_0x4ca652[_0x3862('0xc')]+_0x2163dd+0x1;_0x54182a[_0x3862('0x39')](_0x2163dd,0x0,{'type':_0x43238e['type'],'app':'GotoIfTime','appdata':_0x16010b[_0x2163dd]+'?'+_0x43238e['context']+_0x3862('0x3a')+_0x11e9d6+':'+_0x43238e['context']+_0x3862('0x3a')+_0xb12fb0,'exten':_0x43238e[_0x3862('0x9')],'context':_0x43238e['context'],'priority':_0x4ca652[_0x3862('0xc')]+_0x2163dd,'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0][_0x3862('0x14')]});}_0x43238e[_0x3862('0xc')]=_0x54182a['length']?_[_0x3862('0x3b')](_0x54182a)['priority']+0x1:_0x4ca652[_0x3862('0xc')];_0x4ca652[_0x3862('0xc')]=(_0x56e5c4[_0x3862('0x2e')]?_[_0x3862('0x3b')](_0x56e5c4)[_0x3862('0xc')]:_0x43238e['priority'])+0x1;_0x4ca652['extensions']=_[_0x3862('0x3c')](_0x4ca652[_0x3862('0xd')],_0x54182a,[_0x43238e],_0x56e5c4);}_0x4ca652[_0x3862('0xd')][_0x3862('0x10')]({'type':_0x32d467[_0x3adfe6][0x0][_0x3862('0x11')],'app':'Hangup','exten':_0x32d467[_0x3adfe6][0x0][_0x3862('0x9')],'context':_0x32d467[_0x3adfe6][0x0][_0x3862('0x19')],'priority':_0x4ca652[_0x3862('0xc')],'VoiceExtensionId':_0x32d467[_0x3adfe6][0x0]['VoiceExtensionId']});_0x2b54c9[_0x3862('0x10')](_0x32d467[_0x3adfe6][0x0]['VoiceExtensionId']);_0x13c6b6=_[_0x3862('0x3c')](_0x13c6b6,_0x4ca652[_0x3862('0xd')]);}}return _0x46b75d[_0x3862('0x3d')](function(_0x44ab47){return _0x46b75d['models']['VoiceExtension'][_0x3862('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x2b54c9}},'transaction':_0x44ab47})[_0x3862('0x4')](function(_0xb8d6ba){return _0x46b75d[_0x3862('0x1')]['VoiceExtension'][_0x3862('0x3f')](_[_0x3862('0x40')](_0x13c6b6,_0x3862('0xc')),{'transaction':_0x44ab47});});});})[_0x3862('0x41')](function(_0x20bcf3){console[_0x3862('0x42')](_0x20bcf3);});}exports[_0x3862('0x43')]=rewrite;
\ No newline at end of file
+var _0xecd7=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','sortBy','catch','error','lodash','util','Interval','findAll','then','intervals','models','VoiceExtension','IntervalId','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','CDR(type)=%s','context','VoiceExtensionId','outbound','Set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf'];(function(_0x2fd504,_0x4d6549){var _0x4fd3cd=function(_0x3b80f4){while(--_0x3b80f4){_0x2fd504['push'](_0x2fd504['shift']());}};_0x4fd3cd(++_0x4d6549);}(_0xecd7,0x18a));var _0x7ecd=function(_0x4c538d,_0x3c41c0){_0x4c538d=_0x4c538d-0x0;var _0x427ce6=_0xecd7[_0x4c538d];return _0x427ce6;};'use strict';var _=require(_0x7ecd('0x0'));var util=require(_0x7ecd('0x1'));function rewrite(_0x38f4c7,_0x270f49){var _0x521ab8=this;return _0x38f4c7['models'][_0x7ecd('0x2')][_0x7ecd('0x3')]({'raw':!![]})[_0x7ecd('0x4')](function(_0x1b25cc){_0x521ab8[_0x7ecd('0x5')]=_0x1b25cc;return _0x38f4c7[_0x7ecd('0x6')][_0x7ecd('0x7')][_0x7ecd('0x3')]({'where':{'IntervalId':_0x270f49[_0x7ecd('0x8')]},'raw':!![]});})[_0x7ecd('0x4')](function(_0x5824ae){return _0x38f4c7[_0x7ecd('0x6')][_0x7ecd('0x7')][_0x7ecd('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x7ecd('0x9')](_0x5824ae,_0x7ecd('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x3d2ab8){var _0x43d661=_[_0x7ecd('0xb')](_0x3d2ab8,{'priority':'1'});var _0x4f037b=_['filter'](_0x3d2ab8,{'isApp':0x1});var _0x1d59d8=_[_0x7ecd('0xc')](_0x4f037b,_0x7ecd('0xa'));var _0x2765e9=[_0x7ecd('0xd'),_0x7ecd('0xe')];var _0x3a5de6=[];var _0x170548=[];for(var _0x8d0c50 in _0x1d59d8){if(_0x1d59d8[_0x7ecd('0xf')](_0x8d0c50)){_0x521ab8[_0x7ecd('0x10')]=0x2;_0x521ab8[_0x7ecd('0x11')]=[];_0x521ab8[_0x7ecd('0x12')]=_[_0x7ecd('0x13')](_0x43d661,{'exten':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0xa')]});_0x521ab8['extensions'][_0x7ecd('0x14')]({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':'Set','appdata':util['format'](_0x7ecd('0x16'),_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')]),'context':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x17')],'exten':_0x1d59d8[_0x8d0c50][0x0]['exten'],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});if(_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')]===_0x7ecd('0x19')){if(_0x521ab8[_0x7ecd('0x12')]){_0x521ab8[_0x7ecd('0x11')]['push']({'type':_0x1d59d8[_0x8d0c50][0x0]['type'],'app':_0x7ecd('0x1a'),'appdata':_0x7ecd('0x1b')+(_0x521ab8[_0x7ecd('0x12')][_0x7ecd('0x1c')]?'${EXTEN:'+_0x521ab8[_0x7ecd('0x12')][_0x7ecd('0x1c')]+'}':_0x7ecd('0x1d')),'context':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x17')],'exten':_0x1d59d8[_0x8d0c50][0x0]['exten'],'priority':_0x521ab8['priority']++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});}_0x521ab8['extensions'][_0x7ecd('0x14')]({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':'Set','appdata':_0x7ecd('0x1e')+_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')],'context':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x17')],'exten':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0xa')],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});var _0x506761=_0x521ab8[_0x7ecd('0x10')]++;_0x521ab8[_0x7ecd('0x11')]['push']({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':_0x7ecd('0x1f'),'appdata':_0x7ecd('0x20')+(_0x506761+0x2)+_0x7ecd('0x21')+(_0x506761+0x1)+')','context':_0x1d59d8[_0x8d0c50][0x0]['context'],'exten':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0xa')],'priority':_0x506761,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});if(_0x521ab8[_0x7ecd('0x12')]){_0x521ab8[_0x7ecd('0x11')][_0x7ecd('0x14')]({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':_0x7ecd('0x1a'),'appdata':_0x521ab8[_0x7ecd('0x12')][_0x7ecd('0x1c')]?_0x7ecd('0x22')+_0x521ab8['extension']['cutdigits']+'}':_0x7ecd('0x23'),'context':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x17')],'exten':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0xa')],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});}_0x521ab8[_0x7ecd('0x11')][_0x7ecd('0x14')]({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':_0x7ecd('0x1a'),'appdata':_0x7ecd('0x24')+_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')],'context':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x17')],'exten':_0x1d59d8[_0x8d0c50][0x0]['exten'],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});if(_0x521ab8[_0x7ecd('0x12')]&&_0x521ab8[_0x7ecd('0x12')][_0x7ecd('0xf')](_0x7ecd('0x25'))&&_0x521ab8[_0x7ecd('0x12')][_0x7ecd('0x25')]!==_0x7ecd('0x26')){_0x521ab8[_0x7ecd('0x11')][_0x7ecd('0x14')]({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':'Set','appdata':_0x7ecd('0x27'),'context':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x17')],'exten':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0xa')],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});_0x521ab8[_0x7ecd('0x11')][_0x7ecd('0x14')]({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':_0x7ecd('0x1a'),'appdata':_0x7ecd('0x28')+_0x521ab8[_0x7ecd('0x12')][_0x7ecd('0x25')]||_0x7ecd('0x29'),'context':_0x1d59d8[_0x8d0c50][0x0]['context'],'exten':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0xa')],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0]['VoiceExtensionId']});}}_0x521ab8[_0x7ecd('0x11')]['push']({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':_0x7ecd('0x1a'),'appdata':_0x7ecd('0x2a'),'context':_0x1d59d8[_0x8d0c50][0x0]['context'],'exten':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0xa')],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});_0x521ab8[_0x7ecd('0x11')]['push']({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':_0x7ecd('0x1a'),'appdata':_0x7ecd('0x2b'),'context':_0x1d59d8[_0x8d0c50][0x0]['context'],'exten':_0x1d59d8[_0x8d0c50][0x0]['exten'],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});_0x521ab8[_0x7ecd('0x11')]['push']({'type':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x15')],'app':_0x7ecd('0x1a'),'appdata':_0x7ecd('0x2c'),'context':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x17')],'exten':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0xa')],'priority':_0x521ab8[_0x7ecd('0x10')]++,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0]['VoiceExtensionId']});for(var _0xd2e3a1=0x0,_0x385cab=0x0;_0xd2e3a1<_0x1d59d8[_0x8d0c50][_0x7ecd('0x2d')];_0xd2e3a1+=0x1,_0x385cab=0x0){var _0x269e13=_0x1d59d8[_0x8d0c50][_0xd2e3a1];if(_0x269e13[_0x7ecd('0x15')]){_0x269e13[_0x7ecd('0x15')]=_0x269e13[_0x7ecd('0x15')]['toLowerCase']();}var _0x668780=[];var _0x2fcca0=[];delete _0x269e13['id'];delete _0x269e13[_0x7ecd('0x2e')];delete _0x269e13['updatedAt'];var _0x5b7a91=_0x269e13[_0x7ecd('0x2f')]!==_0x7ecd('0x30')?[_0x269e13[_0x7ecd('0x2f')]]:_0x269e13[_0x7ecd('0x8')]?_[_0x7ecd('0x9')](_['filter'](_0x521ab8[_0x7ecd('0x5')],{'IntervalId':_0x269e13[_0x7ecd('0x8')]}),'interval'):[];if(_0x269e13[_0x7ecd('0xf')]('tag')){if(_0x269e13[_0x7ecd('0x31')]&&_0x269e13[_0x7ecd('0x31')]!=='--'){_0x668780['push']({'type':_0x269e13['type'],'app':'Set','appdata':_0x7ecd('0x32')+_0x269e13['tag'],'context':_0x269e13['context'],'exten':_0x269e13[_0x7ecd('0xa')],'priority':_0x5b7a91[_0x7ecd('0x2d')]+_0x521ab8[_0x7ecd('0x10')]+_0x385cab++,'VoiceExtensionId':_0x269e13['VoiceExtensionId']});}}if(_0x269e13[_0x7ecd('0x15')]===_0x7ecd('0x19')&&_0x269e13[_0x7ecd('0xf')](_0x7ecd('0x33'))){if(_0x269e13[_0x7ecd('0x33')]){_0x668780[_0x7ecd('0x14')]({'type':_0x269e13[_0x7ecd('0x15')],'app':_0x7ecd('0x1f'),'appdata':_0x7ecd('0x34')+_0x269e13[_0x7ecd('0x33')]+')','context':_0x269e13[_0x7ecd('0x17')],'exten':_0x269e13[_0x7ecd('0xa')],'priority':_0x5b7a91['length']+_0x521ab8['priority']+_0x385cab++,'VoiceExtensionId':_0x269e13['VoiceExtensionId']});}else{_0x668780[_0x7ecd('0x14')]({'type':_0x269e13[_0x7ecd('0x15')],'app':'ExecIf','appdata':_0x7ecd('0x35'),'context':_0x269e13['context'],'exten':_0x269e13[_0x7ecd('0xa')],'priority':_0x5b7a91[_0x7ecd('0x2d')]+_0x521ab8[_0x7ecd('0x10')]+_0x385cab++,'VoiceExtensionId':_0x269e13[_0x7ecd('0x18')]});}}if(_0x269e13[_0x7ecd('0xf')](_0x7ecd('0x36'))){if(_0x2765e9[_0x7ecd('0x37')](_0x269e13[_0x7ecd('0x38')]['toLowerCase']())>=0x0&&_0x269e13[_0x7ecd('0x39')]!==_0x7ecd('0x3a')){if(_0x269e13[_0x7ecd('0x36')]){_0x668780[_0x7ecd('0x14')]({'type':_0x269e13[_0x7ecd('0x15')],'app':_0x7ecd('0x1f'),'appdata':_0x7ecd('0x3b'),'context':_0x269e13[_0x7ecd('0x17')],'exten':_0x269e13[_0x7ecd('0xa')],'priority':_0x5b7a91['length']+_0x521ab8[_0x7ecd('0x10')]+_0x385cab++,'VoiceExtensionId':_0x269e13[_0x7ecd('0x18')]});_0x668780['push']({'type':_0x269e13['type'],'app':_0x7ecd('0x1a'),'appdata':_0x7ecd('0x3c'),'context':_0x269e13[_0x7ecd('0x17')],'exten':_0x269e13[_0x7ecd('0xa')],'priority':_0x5b7a91[_0x7ecd('0x2d')]+_0x521ab8[_0x7ecd('0x10')]+_0x385cab++,'VoiceExtensionId':_0x269e13[_0x7ecd('0x18')]});}else{_0x668780[_0x7ecd('0x14')]({'type':_0x269e13[_0x7ecd('0x15')],'app':_0x7ecd('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x269e13[_0x7ecd('0x17')],'exten':_0x269e13[_0x7ecd('0xa')],'priority':_0x5b7a91['length']+_0x521ab8[_0x7ecd('0x10')]+_0x385cab++,'VoiceExtensionId':_0x269e13['VoiceExtensionId']});_0x668780[_0x7ecd('0x14')]({'type':_0x269e13[_0x7ecd('0x15')],'app':_0x7ecd('0x1a'),'appdata':_0x7ecd('0x3d'),'context':_0x269e13[_0x7ecd('0x17')],'exten':_0x269e13[_0x7ecd('0xa')],'priority':_0x5b7a91[_0x7ecd('0x2d')]+_0x521ab8[_0x7ecd('0x10')]+_0x385cab++,'VoiceExtensionId':_0x269e13[_0x7ecd('0x18')]});}}}for(var _0x4be6bb=0x0;_0x4be6bb<_0x5b7a91[_0x7ecd('0x2d')];_0x4be6bb+=0x1){var _0x56edfb=_0x521ab8[_0x7ecd('0x10')]+_0x5b7a91[_0x7ecd('0x2d')];var _0xc273fa=_0x4be6bb===_0x5b7a91['length']-0x1?_0x521ab8[_0x7ecd('0x10')]+_0x668780[_0x7ecd('0x2d')]+_0x2fcca0['length']+0x2:_0x521ab8[_0x7ecd('0x10')]+_0x4be6bb+0x1;_0x668780['splice'](_0x4be6bb,0x0,{'type':_0x269e13['type'],'app':_0x7ecd('0x3e'),'appdata':_0x5b7a91[_0x4be6bb]+'?'+_0x269e13[_0x7ecd('0x17')]+_0x7ecd('0x3f')+_0x56edfb+':'+_0x269e13[_0x7ecd('0x17')]+_0x7ecd('0x3f')+_0xc273fa,'exten':_0x269e13[_0x7ecd('0xa')],'context':_0x269e13[_0x7ecd('0x17')],'priority':_0x521ab8[_0x7ecd('0x10')]+_0x4be6bb,'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});}_0x269e13['priority']=_0x668780[_0x7ecd('0x2d')]?_['last'](_0x668780)[_0x7ecd('0x10')]+0x1:_0x521ab8[_0x7ecd('0x10')];_0x521ab8[_0x7ecd('0x10')]=(_0x2fcca0[_0x7ecd('0x2d')]?_[_0x7ecd('0x40')](_0x2fcca0)[_0x7ecd('0x10')]:_0x269e13[_0x7ecd('0x10')])+0x1;_0x521ab8[_0x7ecd('0x11')]=_[_0x7ecd('0x41')](_0x521ab8[_0x7ecd('0x11')],_0x668780,[_0x269e13],_0x2fcca0);}_0x521ab8['extensions'][_0x7ecd('0x14')]({'type':_0x1d59d8[_0x8d0c50][0x0]['type'],'app':_0x7ecd('0x42'),'exten':_0x1d59d8[_0x8d0c50][0x0]['exten'],'context':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x17')],'priority':_0x521ab8['priority'],'VoiceExtensionId':_0x1d59d8[_0x8d0c50][0x0][_0x7ecd('0x18')]});_0x3a5de6[_0x7ecd('0x14')](_0x1d59d8[_0x8d0c50][0x0]['VoiceExtensionId']);_0x170548=_['concat'](_0x170548,_0x521ab8[_0x7ecd('0x11')]);}}return _0x38f4c7['transaction'](function(_0x1e202e){return _0x38f4c7['models'][_0x7ecd('0x7')][_0x7ecd('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x3a5de6}},'transaction':_0x1e202e})['then'](function(_0x5375f3){return _0x38f4c7[_0x7ecd('0x6')][_0x7ecd('0x7')]['bulkCreate'](_[_0x7ecd('0x44')](_0x170548,_0x7ecd('0x10')),{'transaction':_0x1e202e});});});})[_0x7ecd('0x45')](function(_0x3eabc9){console[_0x7ecd('0x46')](_0x3eabc9);});}exports['rewrite']=rewrite;
\ No newline at end of file
index a4956c1..4e1d9c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','from','createdAt','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','catch','query','BlackLists','all','Campaign','Lists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CmContact','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','duplicate','Duplicate\x20Contact','keys','then','push','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect'];(function(_0x59f7dc,_0x432e46){var _0xb68838=function(_0x4a1a8d){while(--_0x4a1a8d){_0x59f7dc['push'](_0x59f7dc['shift']());}};_0xb68838(++_0x432e46);}(_0x70e0,0x17b));var _0x070e=function(_0x23d45d,_0x19fdd2){_0x23d45d=_0x23d45d-0x0;var _0x418bad=_0x70e0[_0x23d45d];return _0x418bad;};'use strict';var BPromise=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var _=require(_0x070e('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var config=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('api');config[_0x070e('0x7')]=_['defaults'](config[_0x070e('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x070e('0x8'))[_0x070e('0x9')](socket);try{if(!process[_0x070e('0xa')][0x2]||process[_0x070e('0xa')][0x2]===_0x070e('0xb')||process[_0x070e('0xa')][0x2]===_0x070e('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x070e('0xa')][0x3]||process[_0x070e('0xa')][0x3]===_0x070e('0xb')||process[_0x070e('0xa')][0x3]===_0x070e('0xc')||!process[_0x070e('0xa')][0x4]||process[_0x070e('0xa')][0x4]===_0x070e('0xb')||process[_0x070e('0xa')][0x4]===_0x070e('0xc')){throw new Error(_0x070e('0xd'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x070e('0xe')](','),process['argv'][0x4]['split'](','));if(!process['argv'][0x5]||process[_0x070e('0xa')][0x5]===_0x070e('0xb')||process['argv'][0x5]==='null'){throw new Error(_0x070e('0xf'));}var LISTID=process[_0x070e('0xa')][0x5];var COMPANYID=process[_0x070e('0xa')][0x6]&&process[_0x070e('0xa')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x070e('0xc')?process[_0x070e('0xa')][0x6]:null;var DUPLICATES=process[_0x070e('0xa')][0x7]&&process[_0x070e('0xa')][0x7]!==_0x070e('0xb')&&process['argv'][0x7]!==_0x070e('0xc')?process[_0x070e('0xa')][0x7]:null;if(!process[_0x070e('0xa')][0x8]||process[_0x070e('0xa')][0x8]===_0x070e('0xb')||process['argv'][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x070e('0xa')][0x8];}catch(_0x3004f0){logger[_0x070e('0x10')](_0x3004f0);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(_0x4be0d7,_0x5b184,_0x5dc5d2,_0xf8dd5d){var _0x3f6985={'message':_0x5b184};_0x3f6985[_0x4be0d7]=!![];if(_0x5dc5d2){_0x3f6985[_0x070e('0x11')]=_0x5dc5d2;}if(_0xf8dd5d){_0x3f6985[_0x070e('0x12')]=_0xf8dd5d;}return _0x3f6985;}function isEmail(_0x28a1c3){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))*$/[_0x070e('0x13')](_0x28a1c3);}function checkRow(_0xe405e,_0x164cdf,_0x595c7e){return new BPromise(function(_0x2f8055,_0x270061){if(_[_0x070e('0x14')](_0xe405e)){return _0x270061(handleCheckRowError('error',_0x070e('0x15'),null,_0x595c7e));}if(_0xe405e['errors']&&_0xe405e['errors'][_0x070e('0x16')]){var _0x25f6e=_[_0x070e('0x17')](_0xe405e[_0x070e('0x18')],_0x070e('0x19'))['join'](';');return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x25f6e,null,_0x595c7e));}var _0x219e48={};for(var _0x1d72d6 in FIELDS){if(FIELDS[_0x070e('0x1a')](_0x1d72d6)&&FIELDS[_0x1d72d6]){_0x219e48[_0x1d72d6]=_0xe405e[_0x070e('0x1b')][0x0][FIELDS[_0x1d72d6]]||_0xe405e[_0x070e('0x1b')][0x0]['\ufeff'+FIELDS[_0x1d72d6]];}}if(!_0x219e48[_0x070e('0x1c')]){return _0x270061(handleCheckRowError(_0x070e('0x10'),'firstName\x20not\x20specified!',null,_0x595c7e));}if(!_0x219e48[_0x070e('0x1d')]){return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x070e('0x1e'),null,_0x595c7e));}if(_0x219e48['birthDate']){var _0x5c5f0d=moment(_0x219e48[_0x070e('0x1f')],_0x070e('0x20'));if(!_0x5c5f0d[_0x070e('0x21')]()){return _0x270061(handleCheckRowError('error',_0x070e('0x22'),null,_0x595c7e));}}if(_0x219e48[_0x070e('0x23')]){if(!isEmail(_0x219e48[_0x070e('0x23')])){return _0x270061(handleCheckRowError(_0x070e('0x10'),'email\x20format\x20is\x20not\x20valid!',null,_0x595c7e));}}_0x219e48['ListId']=LISTID;_0x219e48['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x164cdf){var _0xdf8945={};for(var _0x4e0a7d=0x0,_0x1dff97=DUPLICATES[_0x070e('0x16')];_0x4e0a7d<_0x1dff97;_0x4e0a7d+=0x1){_0xdf8945[DUPLICATES[_0x4e0a7d]]=_0x219e48[DUPLICATES[_0x4e0a7d]];}var _0x4f8130=_['find'](_0x164cdf,_0xdf8945);if(_0x4f8130){return _0x270061(handleCheckRowError(_0x070e('0x24'),_0x070e('0x25'),_0x4f8130,_0x595c7e));}}return db['CmContact']['create'](_0x219e48,{'raw':!![],'hooks':![],'fields':_[_0x070e('0x26')](_0x219e48)})[_0x070e('0x27')](function(_0x444d02){if(DUPLICATES&&DUPLICATES[_0x070e('0x16')]&&_0x164cdf){_0x164cdf[_0x070e('0x28')](_['pick'](_0x219e48,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x444d02['id'];return _0x2f8055();})['catch'](function(_0x24d17d){return _0x270061(handleCheckRowError(_0x070e('0x10'),_0x070e('0x29')+(_0x24d17d[_0x070e('0x19')]||JSON[_0x070e('0x2a')](_0x24d17d)),null,_0x595c7e));});});}function checkHopper(){function _0x4deaf8(){return function(_0x22f3a9){logger[_0x070e('0x10')]('cmContact',_0x070e('0x2b'),util[_0x070e('0x2c')](_0x22f3a9,{'showHidden':![],'depth':null}));};}var _0x4ba6f0=function(_0x4d4ee8,_0x5ddbe9){var _0x363bff=squel[_0x070e('0x2d')]()[_0x070e('0x2e')](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),_0x070e('0x33'),_0x5ddbe9,'createdAt',_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')]('phone',_0x070e('0x1d'))[_0x070e('0x36')]('NOW()',_0x070e('0x31'))['field']('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x4d4ee8['id']['toString'](),_0x5ddbe9)[_0x070e('0x36')]('NOW()','createdAt')[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x34'))['from'](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))[_0x070e('0x3a')]('ListId\x20=\x20?',LISTID[_0x070e('0x37')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x070e('0x3c'),squel[_0x070e('0x35')]()[_0x070e('0x36')](_0x070e('0x1d'))[_0x070e('0x3d')]('cm_hopper')[_0x070e('0x3a')](_0x5ddbe9+'\x20=\x20?',_0x4d4ee8['id'][_0x070e('0x37')]())))[_0x070e('0x37')]();return _0x363bff;};var _0xff760c=function(_0x52fcea,_0x54285a){var _0x261a27=squel['insert']()[_0x070e('0x2e')](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),'ListId',_0x54285a,'createdAt',_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')](_0x070e('0x1d'),_0x070e('0x1d'))['field'](_0x070e('0x38'),_0x070e('0x31'))[_0x070e('0x36')]('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x52fcea['id'][_0x070e('0x37')](),_0x54285a)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x34'))['from'](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))[_0x070e('0x3a')](_0x070e('0x3f'),LISTID[_0x070e('0x37')]())[_0x070e('0x3a')](_0x070e('0x40'),squel[_0x070e('0x41')](hopperContacts))['where'](_0x070e('0x42'))['where'](_0x070e('0x3c'),squel[_0x070e('0x35')]()['field'](_0x070e('0x43'))[_0x070e('0x3d')](_0x070e('0x44'))[_0x070e('0x3a')](_0x54285a+_0x070e('0x45'),_0x52fcea['id'][_0x070e('0x37')]()))[_0x070e('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x070e('0x35')]()['field']('phone')[_0x070e('0x3d')](_0x070e('0x2f'))[_0x070e('0x3a')](_0x54285a+_0x070e('0x45'),_0x52fcea['id'][_0x070e('0x37')]())))[_0x070e('0x37')]();return _0x261a27;};function _0x440fa1(_0x343785,_0x53bea1){var _0x477e69=squel['insert']()['into'](_0x070e('0x2f'))[_0x070e('0x30')](['phone',_0x070e('0x31'),_0x070e('0x32'),_0x070e('0x33'),_0x53bea1,_0x070e('0x3e'),_0x070e('0x34')],squel[_0x070e('0x35')]()[_0x070e('0x36')]('phone','phone')['field'](_0x070e('0x38'),_0x070e('0x31'))[_0x070e('0x36')]('id',_0x070e('0x32'))['field'](LISTID[_0x070e('0x37')](),'ListId')[_0x070e('0x36')](_0x343785['id'][_0x070e('0x37')](),_0x53bea1)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')]('NOW()',_0x070e('0x34'))[_0x070e('0x3d')](_0x070e('0x39'))['where'](_0x070e('0x3b'))[_0x070e('0x3a')]('ListId\x20=\x20?',LISTID[_0x070e('0x37')]())['where'](_0x070e('0x40'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x070e('0x37')]();return _0x477e69;}function _0x1ae5cb(_0x1100d8,_0x122198){var _0x3cb9ee=squel[_0x070e('0x2d')]()['into'](_0x070e('0x46'))['fromQuery']([_0x070e('0x1d'),'ContactId',_0x070e('0x33'),_0x122198,_0x070e('0x3e'),'updatedAt'],squel[_0x070e('0x35')]()['field'](_0x070e('0x1d'),_0x070e('0x1d'))[_0x070e('0x36')]('id',_0x070e('0x32'))[_0x070e('0x36')](LISTID[_0x070e('0x37')](),_0x070e('0x33'))[_0x070e('0x36')](_0x1100d8['id'][_0x070e('0x37')](),_0x122198)[_0x070e('0x36')](_0x070e('0x38'),_0x070e('0x3e'))[_0x070e('0x36')](_0x070e('0x38'),'updatedAt')[_0x070e('0x3d')](_0x070e('0x39'))[_0x070e('0x3a')](_0x070e('0x3b'))['where'](_0x070e('0x3f'),LISTID[_0x070e('0x37')]())[_0x070e('0x3a')](_0x070e('0x40'),squel[_0x070e('0x41')](hopperContacts))[_0x070e('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x070e('0x37')]();return _0x3cb9ee;}return db[_0x070e('0x47')][_0x070e('0x48')]({'where':{'type':_0x070e('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x070e('0x4a')],'as':'Lists','where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x36373d){var _0x3a1ad2=[];if(_0x36373d){var _0x150bf6;for(var _0x2a20d4=0x0,_0x50ef9f;_0x2a20d4<_0x36373d[_0x070e('0x16')];_0x2a20d4+=0x1){_0x50ef9f=_0x36373d[_0x2a20d4][_0x070e('0x4b')]({'plain':!![]});switch(_0x50ef9f[_0x070e('0x4c')]){case _0x070e('0x4d'):_0x3a1ad2['push'](db[_0x070e('0x4e')]['query'](_0xff760c(_0x50ef9f,_0x070e('0x4f')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;case'onlyIfOpen':_0x3a1ad2[_0x070e('0x28')](db['sequelize'][_0x070e('0x51')](_0x4ba6f0(_0x50ef9f,'VoiceQueueId'))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;default:_0x3a1ad2['push'](db[_0x070e('0x4e')]['query'](_0x440fa1(_0x50ef9f,_0x070e('0x4f')))[_0x070e('0x27')](function(){})['catch'](_0x4deaf8()));}}}return _0x3a1ad2;})['all']()[_0x070e('0x27')](function(){return db[_0x070e('0x47')][_0x070e('0x48')]({'where':{'type':_0x070e('0x49')},'attributes':['id'],'include':[{'model':db[_0x070e('0x4a')],'as':_0x070e('0x52'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x332c8a){var _0x25b599=[];if(_0x332c8a){var _0x1d1f44;for(var _0x72077d=0x0,_0x25670e;_0x72077d<_0x332c8a[_0x070e('0x16')];_0x72077d+=0x1){_0x25670e=_0x332c8a[_0x72077d]['get']({'plain':!![]});_0x25b599[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0x1ae5cb(_0x25670e,'VoiceQueueId'))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));}}return _0x25b599;})[_0x070e('0x53')]();})[_0x070e('0x27')](function(){return db[_0x070e('0x54')][_0x070e('0x48')]({'attributes':['id',_0x070e('0x4c')],'include':[{'model':db[_0x070e('0x4a')],'as':_0x070e('0x55'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0x62800d){var _0x2084a1=[];if(_0x62800d){for(var _0x46ec49=0x0,_0x595e2e;_0x46ec49<_0x62800d['length'];_0x46ec49+=0x1){_0x595e2e=_0x62800d[_0x46ec49]['get']({'plain':!![]});switch(_0x595e2e[_0x070e('0x4c')]){case _0x070e('0x4d'):_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0xff760c(_0x595e2e,_0x070e('0x56')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));break;case _0x070e('0x57'):_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')]['query'](_0x4ba6f0(_0x595e2e,_0x070e('0x56')))['then'](function(){})[_0x070e('0x50')](_0x4deaf8()));break;default:_0x2084a1[_0x070e('0x28')](db[_0x070e('0x4e')][_0x070e('0x51')](_0x440fa1(_0x595e2e,_0x070e('0x56')))['then'](function(){})[_0x070e('0x50')](_0x4deaf8()));}}}return _0x2084a1;})[_0x070e('0x53')]();})['then'](function(){return db[_0x070e('0x54')][_0x070e('0x48')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x070e('0x52'),'where':{'id':LISTID}}]})[_0x070e('0x27')](function(_0xf0aef8){var _0x4da906=[];if(_0xf0aef8){for(var _0x40d7e6=0x0,_0xe8c476;_0x40d7e6<_0xf0aef8[_0x070e('0x16')];_0x40d7e6+=0x1){_0xe8c476=_0xf0aef8[_0x40d7e6][_0x070e('0x4b')]({'plain':!![]});_0x4da906[_0x070e('0x28')](db[_0x070e('0x4e')][_0x070e('0x51')](_0x1ae5cb(_0xe8c476,_0x070e('0x56')))[_0x070e('0x27')](function(){})[_0x070e('0x50')](_0x4deaf8()));}}return _0x4da906;})[_0x070e('0x53')]();})[_0x070e('0x50')](function(_0x18c27a){logger['error'](_0x070e('0x58'),_0x070e('0x59'),_0x18c27a[_0x070e('0x19')]);});}var processPromises=function(_0x1b71dd){return BPromise[_0x070e('0x53')](promises)[_0x070e('0x27')](function(_0x5c4352){})['catch'](function(_0x4a8563){logger[_0x070e('0x10')](_0x070e('0x5a'),JSON[_0x070e('0x2a')](_0x4a8563));})[_0x070e('0x5b')](function(){socket['emit'](_0x070e('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1b71dd){return _0x1b71dd[_0x070e('0x5d')]();}});};var endCsv=function(){return BPromise[_0x070e('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x070e('0x27')](function(){socket['emit'](_0x070e('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x070e('0x5f')](FILEPATH);}catch(_0x59e6e5){logger['error'](_0x070e('0x60'),JSON[_0x070e('0x2a')](_0x59e6e5));}finally{process['exit'](0x0);}});};process['on'](_0x070e('0x61'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x070e('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x070e('0xe')](',');return db[_0x070e('0x62')][_0x070e('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x070e('0x27')](function(_0x341756){var _0x2a12a1=fs[_0x070e('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x070e('0x64')](_0x2a12a1,{'header':!![],'skipEmptyLines':!![],'step':function(_0xdcc60a,_0x4e0f6e){total+=0x1;var _0x1306e6=total;promises[_0x070e('0x28')](checkRow(_0xdcc60a,_0x341756,_0x1306e6)[_0x070e('0x27')](function(){success+=0x1;})[_0x070e('0x50')](function(_0x3f2bb5){if(_0x3f2bb5[_0x070e('0x10')]){errors+=0x1;delete _0x3f2bb5[_0x070e('0x10')];}else if(_0x3f2bb5[_0x070e('0x24')]){duplicates+=0x1;delete _0x3f2bb5[_0x070e('0x24')];}rows[_0x070e('0x28')](_0x3f2bb5);}));if(total%0xc8===0x0){_0x4e0f6e[_0x070e('0x65')]();return processPromises(_0x4e0f6e);}},'complete':function(){return processPromises()['then'](function(){logger[_0x070e('0x66')](_0x070e('0x67'));endCsv();});},'error':function(_0x449337,_0xe50b1b){logger['info'](_0x070e('0x68'),JSON[_0x070e('0x2a')](_0x449337));endCsv();}});})[_0x070e('0x50')](function(_0x2bad43){logger[_0x070e('0x10')](_0x070e('0x69'),JSON['stringify'](_0x2bad43));});}main();
\ No newline at end of file
+var _0xe706=['toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','insert','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()'];(function(_0x5523e5,_0x1b347c){var _0x585f57=function(_0x4b1418){while(--_0x4b1418){_0x5523e5['push'](_0x5523e5['shift']());}};_0x585f57(++_0x1b347c);}(_0xe706,0xa3));var _0x6e70=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xe706[_0x2aefb6];return _0x202772;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var socket=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));require(_0x6e70('0xd'))[_0x6e70('0xe')](socket);try{if(!process[_0x6e70('0xf')][0x2]||process[_0x6e70('0xf')][0x2]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x2]===_0x6e70('0x11')){throw new Error(_0x6e70('0x12'));}var FILEPATH=process[_0x6e70('0xf')][0x2];if(!process[_0x6e70('0xf')][0x3]||process[_0x6e70('0xf')][0x3]===_0x6e70('0x10')||process['argv'][0x3]==='null'||!process[_0x6e70('0xf')][0x4]||process[_0x6e70('0xf')][0x4]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x4]===_0x6e70('0x11')){throw new Error(_0x6e70('0x13'));}var FIELDS=_[_0x6e70('0x14')](process[_0x6e70('0xf')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x6e70('0xf')][0x5]||process['argv'][0x5]==='undefined'||process[_0x6e70('0xf')][0x5]===_0x6e70('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6e70('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6e70('0xf')][0x6]!==_0x6e70('0x10')&&process['argv'][0x6]!=='null'?process[_0x6e70('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6e70('0xf')][0x7]!==_0x6e70('0x10')&&process['argv'][0x7]!=='null'?process[_0x6e70('0xf')][0x7]:null;if(!process[_0x6e70('0xf')][0x8]||process[_0x6e70('0xf')][0x8]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x8]===_0x6e70('0x11')){throw new Error(_0x6e70('0x15'));}var SOCKET_TIMESTAMP=process[_0x6e70('0xf')][0x8];}catch(_0x29326f){logger[_0x6e70('0x16')](_0x29326f);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x4a0cfe,_0x228350,_0x344b65,_0x27b294){var _0x502b2d={'message':_0x228350};_0x502b2d[_0x4a0cfe]=!![];if(_0x344b65){_0x502b2d[_0x6e70('0x17')]=_0x344b65;}if(_0x27b294){_0x502b2d[_0x6e70('0x18')]=_0x27b294;}return _0x502b2d;}function isEmail(_0x3337a6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3337a6);}function checkRow(_0x10fc91,_0x538b9c,_0x50aec2){return new BPromise(function(_0x4e97c7,_0x41e352){if(_[_0x6e70('0x19')](_0x10fc91)){return _0x41e352(handleCheckRowError('error',_0x6e70('0x1a'),null,_0x50aec2));}if(_0x10fc91[_0x6e70('0x1b')]&&_0x10fc91['errors'][_0x6e70('0x1c')]){var _0x67fb43=_[_0x6e70('0x1d')](_0x10fc91['errors'],'message')[_0x6e70('0x1e')](';');return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x67fb43,null,_0x50aec2));}var _0x83c836={};for(var _0x114344 in FIELDS){if(FIELDS[_0x6e70('0x1f')](_0x114344)&&FIELDS[_0x114344]){_0x83c836[_0x114344]=_0x10fc91['data'][0x0][FIELDS[_0x114344]]||_0x10fc91[_0x6e70('0x20')][0x0]['\ufeff'+FIELDS[_0x114344]];}}if(!_0x83c836[_0x6e70('0x21')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x22'),null,_0x50aec2));}if(!_0x83c836[_0x6e70('0x23')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x24'),null,_0x50aec2));}if(_0x83c836[_0x6e70('0x25')]){var _0x3a0821=moment(_0x83c836[_0x6e70('0x25')],'YYYY-MM-DD');if(!_0x3a0821[_0x6e70('0x26')]()){return _0x41e352(handleCheckRowError('error',_0x6e70('0x27'),null,_0x50aec2));}}if(_0x83c836['email']){if(!isEmail(_0x83c836[_0x6e70('0x28')])){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x29'),null,_0x50aec2));}}_0x83c836['ListId']=LISTID;_0x83c836[_0x6e70('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){var _0x5780a1={};for(var _0x13d673=0x0,_0x154925=DUPLICATES['length'];_0x13d673<_0x154925;_0x13d673+=0x1){_0x5780a1[DUPLICATES[_0x13d673]]=_0x83c836[DUPLICATES[_0x13d673]];}var _0x10d8f6=_[_0x6e70('0x2b')](_0x538b9c,_0x5780a1);if(_0x10d8f6){return _0x41e352(handleCheckRowError(_0x6e70('0x2c'),_0x6e70('0x2d'),_0x10d8f6,_0x50aec2));}}return db[_0x6e70('0x2e')][_0x6e70('0x2f')](_0x83c836,{'raw':!![],'hooks':![],'fields':_[_0x6e70('0x30')](_0x83c836)})[_0x6e70('0x31')](function(_0xf146fd){if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){_0x538b9c['push'](_[_0x6e70('0x32')](_0x83c836,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf146fd['id'];return _0x4e97c7();})['catch'](function(_0x23cd1a){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x33')+(_0x23cd1a[_0x6e70('0x34')]||JSON[_0x6e70('0x35')](_0x23cd1a)),null,_0x50aec2));});});}function checkHopper(){function _0x989b80(){return function(_0x2440be){logger[_0x6e70('0x16')](_0x6e70('0x36'),_0x6e70('0x37'),util[_0x6e70('0x38')](_0x2440be,{'showHidden':![],'depth':null}));};}var _0x23d5e2=function(_0x5594d3,_0x501b53){var _0x5446a2=squel['insert']()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),'ListId',_0x501b53,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x5594d3['id'][_0x6e70('0x43')](),_0x501b53)['field']('NOW()','createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6e70('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x501b53+'\x20=\x20?',_0x5594d3['id'][_0x6e70('0x43')]())))[_0x6e70('0x43')]();return _0x5446a2;};var _0x2dafb5=function(_0x3478e2,_0x5bbc3a){var _0x291de6=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),'ContactId',_0x6e70('0x44'),_0x5bbc3a,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))['field'](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))['field'](LISTID['toString'](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x3478e2['id'][_0x6e70('0x43')](),_0x5bbc3a)['field']('NOW()',_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b'))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()['field'](_0x6e70('0x4d'))[_0x6e70('0x45')](_0x6e70('0x4e'))[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']()))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']())))[_0x6e70('0x43')]();return _0x291de6;};function _0xebe5f7(_0x54efdf,_0x3cfaa9){var _0xb3f06c=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))['fromQuery']([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),_0x6e70('0x44'),_0x3cfaa9,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3c'))[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x54efdf['id'][_0x6e70('0x43')](),_0x3cfaa9)['field'](_0x6e70('0x42'),_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')]('cm_contacts')[_0x6e70('0x48')](_0x6e70('0x47'))['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0xb3f06c;}function _0x41a861(_0x10d299,_0x739946){var _0x30cd88=squel['insert']()['into'](_0x6e70('0x50'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3d'),'ListId',_0x739946,'createdAt',_0x6e70('0x3f')],squel[_0x6e70('0x40')]()['field']('phone',_0x6e70('0x23'))['field']('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x10d299['id'][_0x6e70('0x43')](),_0x739946)[_0x6e70('0x41')](_0x6e70('0x42'),'createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0x30cd88;}return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x55'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x82a9a){var _0x515c0c=[];if(_0x82a9a){var _0xce964b;for(var _0x531097=0x0,_0x5b4046;_0x531097<_0x82a9a[_0x6e70('0x1c')];_0x531097+=0x1){_0x5b4046=_0x82a9a[_0x531097][_0x6e70('0x56')]({'plain':!![]});switch(_0x5b4046[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')]['query'](_0x2dafb5(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;default:_0x515c0c['push'](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x5b4046,_0x6e70('0x5b')))['then'](function(){})['catch'](_0x989b80()));}}}return _0x515c0c;})[_0x6e70('0x5f')]()[_0x6e70('0x31')](function(){return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x241a21){var _0x56d4d9=[];if(_0x241a21){var _0x58666a;for(var _0x1c7c5f=0x0,_0xf7a034;_0x1c7c5f<_0x241a21[_0x6e70('0x1c')];_0x1c7c5f+=0x1){_0xf7a034=_0x241a21[_0x1c7c5f][_0x6e70('0x56')]({'plain':!![]});_0x56d4d9[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x41a861(_0xf7a034,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}return _0x56d4d9;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x4b2d40){var _0x5b5471=[];if(_0x4b2d40){for(var _0x402f6f=0x0,_0x48e04b;_0x402f6f<_0x4b2d40['length'];_0x402f6f+=0x1){_0x48e04b=_0x4b2d40[_0x402f6f][_0x6e70('0x56')]({'plain':!![]});switch(_0x48e04b[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x5b5471['push'](db['sequelize']['query'](_0x2dafb5(_0x48e04b,_0x6e70('0x61')))['then'](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x48e04b,_0x6e70('0x61')))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));break;default:_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x48e04b,'CampaignId'))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}}return _0x5b5471;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')][_0x6e70('0x52')]({'attributes':['id'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x62'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x48f6fd){var _0x463eed=[];if(_0x48f6fd){for(var _0x39e6db=0x0,_0x53acc8;_0x39e6db<_0x48f6fd[_0x6e70('0x1c')];_0x39e6db+=0x1){_0x53acc8=_0x48f6fd[_0x39e6db][_0x6e70('0x56')]({'plain':!![]});_0x463eed['push'](db['sequelize'][_0x6e70('0x5e')](_0x41a861(_0x53acc8,'CampaignId'))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));}}return _0x463eed;})[_0x6e70('0x5f')]();})[_0x6e70('0x5c')](function(_0x106f32){logger[_0x6e70('0x16')](_0x6e70('0x63'),_0x6e70('0x64'),_0x106f32[_0x6e70('0x34')]);});}var processPromises=function(_0x5afbf5){return BPromise['all'](promises)[_0x6e70('0x31')](function(_0x4bf451){})[_0x6e70('0x5c')](function(_0xa2a4d5){logger[_0x6e70('0x16')](_0x6e70('0x65'),JSON['stringify'](_0xa2a4d5));})[_0x6e70('0x66')](function(){socket['emit'](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5afbf5){return _0x5afbf5[_0x6e70('0x68')]();}});};var endCsv=function(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x6e70('0x31')](function(){socket[_0x6e70('0x6a')](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d6acf){logger['error'](_0x6e70('0x6b'),JSON['stringify'](_0x1d6acf));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x6e70('0x6c')](_0x6e70('0x6d'));endCsv();});function main(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e70('0x6e')](',');return db['CmContact'][_0x6e70('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6e70('0x31')](function(_0x48c30c){var _0x3c2d33=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6e70('0x6f')](_0x3c2d33,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d0585,_0x4a87e2){total+=0x1;var _0x25f60c=total;promises[_0x6e70('0x59')](checkRow(_0x5d0585,_0x48c30c,_0x25f60c)[_0x6e70('0x31')](function(){success+=0x1;})[_0x6e70('0x5c')](function(_0x3e6661){if(_0x3e6661[_0x6e70('0x16')]){errors+=0x1;delete _0x3e6661[_0x6e70('0x16')];}else if(_0x3e6661['duplicate']){duplicates+=0x1;delete _0x3e6661[_0x6e70('0x2c')];}rows['push'](_0x3e6661);}));if(total%0xc8===0x0){_0x4a87e2[_0x6e70('0x70')]();return processPromises(_0x4a87e2);}},'complete':function(){return processPromises()[_0x6e70('0x31')](function(){logger[_0x6e70('0x6c')](_0x6e70('0x71'));endCsv();});},'error':function(_0x4764d5,_0x41b7de){logger[_0x6e70('0x6c')]('CSV\x20parse\x20error',JSON[_0x6e70('0x35')](_0x4764d5));endCsv();}});})['catch'](function(_0x27bdf2){logger[_0x6e70('0x16')](_0x6e70('0x72'),JSON[_0x6e70('0x35')](_0x27bdf2));});}main();
\ No newline at end of file
index cebef0f..b0455d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c72=['cm_contacts.createdAt','into','cm_hopper_black','.CmListId','\x20=\x20?','concat','keys','fromQuery',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','query','spread','push','stringify','send','start','binding','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','rows','trim','replace','scheduledat','isValid','isNaN','UserId','isNumber','includes','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','emit','contact:import:','Abort\x20parser','SystemError','duplicates','length','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','finish','affectedRows','unlink','catch','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','localhost','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','ContactId','ListId','createdAt','updatedAt','priority','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id'];(function(_0x27018a,_0x5b1798){var _0x1a449e=function(_0xb32fe1){while(--_0xb32fe1){_0x27018a['push'](_0x27018a['shift']());}};_0x1a449e(++_0x5b1798);}(_0x8c72,0x1da));var _0x28c7=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8c72[_0x5d6456];return _0x4d66c1;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require('papaparse');var util=require(_0x28c7('0x0'));var BPromise=require(_0x28c7('0x1'));var moment=require('moment');var squel=require(_0x28c7('0x2'));var Redis=require(_0x28c7('0x3'));var db=require(_0x28c7('0x4'))['db'];var config=require(_0x28c7('0x5'));var logger=require(_0x28c7('0x6'))(_0x28c7('0x7'));config['redis']=_[_0x28c7('0x8')](config['redis'],{'host':_0x28c7('0x9'),'port':0x18eb});var socket=require(_0x28c7('0xa'))(new Redis(config[_0x28c7('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x28c7('0xc')](_0x28c7('0xd'));function isEmail(_0x4199c7){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))*$/[_0x28c7('0xe')](_0x4199c7);}function selectNotIn(_0x25493c,_0x179ea5,_0x1ea85c,_0x588f29,_0x43a134){return squel['select']()[_0x28c7('0xf')](_0x28c7('0x10'))[_0x28c7('0x11')](_0x588f29)[_0x28c7('0x12')](_0x179ea5,null,_0x179ea5+_0x28c7('0x13')+_0x588f29+'.'+_0x1ea85c)[_0x28c7('0x14')](_0x588f29+'.'+_0x1ea85c+_0x28c7('0x15')+_0x25493c+'.'+_0x1ea85c)['where'](_0x179ea5+'.dialCheckDuplicateType\x20IN\x20('+_0x43a134[_0x28c7('0x12')]()+')');}function insertCmHopper(_0x1fe8d5,_0x23c10d,_0x1ac35e,_0x7733e1,_0xabc233){var _0x23ba19=[_0x28c7('0x16'),_0x28c7('0x17'),'cm_contacts.id',_0x28c7('0x18'),_0x23c10d+'.'+_0x7733e1,'cm_contacts.createdAt',_0x28c7('0x19'),'cm_contacts.priority',_0x28c7('0x1a'),'\x22'+_0xabc233+'\x22'];return squel[_0x28c7('0x1b')]()['into'](_0x28c7('0x1c'))['fromQuery']([_0x28c7('0x10'),'scheduledat',_0x28c7('0x1d'),_0x28c7('0x1e'),_0x7733e1,_0x28c7('0x1f'),_0x28c7('0x20'),_0x28c7('0x21'),'UserId',_0x28c7('0x22')],squel[_0x28c7('0x23')]()[_0x28c7('0x24')](_0x23ba19)['from'](_0x23c10d)[_0x28c7('0x12')](_0x28c7('0x25'),null,_0x28c7('0x26')+_0x23c10d+'.CmListId')[_0x28c7('0x12')](_0x1ac35e,null,_0x1ac35e+_0x28c7('0x13')+_0x23c10d+'.'+_0x7733e1)[_0x28c7('0x14')](_0x23c10d+_0x28c7('0x27'),_0x1fe8d5)[_0x28c7('0x14')](_0x28c7('0x28'),NOW)['where'](_0x28c7('0x29'),selectNotIn(_0x23c10d,_0x1ac35e,_0x7733e1,_0x28c7('0x1c'),[_0x28c7('0x2a'),_0x28c7('0x2b')]))[_0x28c7('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x23c10d,_0x1ac35e,_0x7733e1,'cm_hopper',[_0x28c7('0x2a')])))[_0x28c7('0x2c')]();}function insertCmHopperBlack(_0x51951e,_0x24eded,_0x46604e,_0x15e5a1){var _0x33a5ef=[_0x28c7('0x16'),_0x28c7('0x2d'),_0x28c7('0x18'),_0x24eded+'.'+_0x15e5a1,_0x28c7('0x2e'),'cm_contacts.updatedAt'];return squel['insert']()[_0x28c7('0x2f')](_0x28c7('0x30'))['fromQuery'](['phone',_0x28c7('0x1d'),_0x28c7('0x1e'),_0x15e5a1,'createdAt',_0x28c7('0x20')],squel[_0x28c7('0x23')]()[_0x28c7('0x24')](_0x33a5ef)[_0x28c7('0x11')](_0x24eded)[_0x28c7('0x12')](_0x28c7('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x24eded+_0x28c7('0x31'))['join'](_0x46604e,null,_0x46604e+'.id\x20=\x20'+_0x24eded+'.'+_0x15e5a1)['where'](_0x24eded+_0x28c7('0x27'),_0x51951e)['where'](_0x28c7('0x28'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x28c7('0x23')]()[_0x28c7('0xf')](_0x28c7('0x10'))[_0x28c7('0x11')](_0x28c7('0x30'))[_0x28c7('0x14')]('ListId\x20=\x20?',_0x51951e)[_0x28c7('0x14')](_0x15e5a1+_0x28c7('0x32'),_0x24eded+'.'+_0x15e5a1)))[_0x28c7('0x2c')]();}function insertCmContact(_0x291abe,_0x4e852a,_0x345ba4,_0x25723c){var _0x556b23=_[_0x28c7('0x33')](_[_0x28c7('0x34')](_0x25723c),['ListId','CompanyId',_0x28c7('0x1f'),_0x28c7('0x20')]);return squel[_0x28c7('0x1b')]()['into'](_0x28c7('0x25'))[_0x28c7('0x35')](_0x556b23,squel[_0x28c7('0x23')]()[_0x28c7('0x24')](_0x556b23)[_0x28c7('0x11')](_0x4e852a)[_0x28c7('0x14')]('('+_0x345ba4['join'](',')+_0x28c7('0x36'),squel[_0x28c7('0x23')]()['fields'](_0x345ba4)['from'](_0x28c7('0x25'))['where']('ListId\x20=\x20?',_0x291abe)['where']('deletedAt\x20IS\x20NULL'))[_0x28c7('0x14')](_0x28c7('0x37'),squel[_0x28c7('0x23')]()[_0x28c7('0xf')](_0x28c7('0x38'),_0x28c7('0x39'))['from'](_0x4e852a)[_0x28c7('0x3a')](_0x345ba4[_0x28c7('0x12')](','))))['toString']();}function handleStop(){logger[_0x28c7('0x3b')](_0x28c7('0x3c'));stopped=!![];}function handleUncaughtException(_0x1aff6d){logger[_0x28c7('0x3d')](_0x1aff6d['message']);process[_0x28c7('0x3e')](0x1);}function handleError(_0x791000,_0x5f4d1e){stats[_0x28c7('0x3f')]['push']({'name':_0x5f4d1e[_0x28c7('0x40')],'message':_0x5f4d1e[_0x28c7('0x41')],'row':_0x791000});}function handleQuery(_0x468e48){logger[_0x28c7('0x3b')](_0x468e48);return db['sequelize'][_0x28c7('0x42')](_0x468e48)[_0x28c7('0x43')](function(_0x3f661b){results[_0x28c7('0x44')](_0x3f661b);})['catch'](function(_0x21a8da){logger[_0x28c7('0x3d')](_0x21a8da[_0x28c7('0x41')]);});}function main(_0x3ab7d9,_0x55a7ae,_0x3793f5,_0x4461cc){logger[_0x28c7('0x3b')]('main',_0x3ab7d9,JSON[_0x28c7('0x45')](_0x55a7ae));process[_0x28c7('0x46')](_0x28c7('0x47'));var _0x4099bf=_0x55a7ae[_0x28c7('0x48')];var _0x223f0b=_0x55a7ae['socket_timestamp'];var _0x5656b0=path[_0x28c7('0x12')](config[_0x28c7('0x49')],_0x28c7('0x4a'),_0x223f0b+_0x28c7('0x4b'));var _0x308057=_['keys'](_0x4099bf)[_0x28c7('0x12')]();logger[_0x28c7('0x3b')](_0x28c7('0x4c'),_0x308057);fs[_0x28c7('0x4d')](_0x5656b0,_0x308057+'\x0a');Papa[_0x28c7('0x4e')](fs[_0x28c7('0x4f')](_0x3ab7d9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x548b8b,_0x5bad1f){try{for(var _0x3c6792=0x0,_0x204989=[];_0x3c6792<_0x548b8b[_0x28c7('0x50')]['length'];_0x3c6792++){stats[_0x28c7('0x51')]+=0x1;if(_0x548b8b[_0x28c7('0x3f')][_0x3c6792]){handleError(_0x548b8b[_0x28c7('0x50')][_0x3c6792],_0x548b8b[_0x28c7('0x3f')][_0x3c6792]);}else{var _0x396c41=[];for(var _0x22a276 in _0x4099bf){if(_0x4099bf['hasOwnProperty'](_0x22a276)){if(_0x548b8b[_0x28c7('0x50')][_0x3c6792][_0x4099bf[_0x22a276]]){var _0x24576d=_[_0x28c7('0x52')](_0x548b8b[_0x28c7('0x50')][_0x3c6792][_0x4099bf[_0x22a276]][_0x28c7('0x53')](/"/g,'\x27'));switch(_0x22a276){case _0x28c7('0x54'):var _0x282410=moment(_0x24576d,_0x28c7('0xd'),!![]);if(_0x282410[_0x28c7('0x55')]()){_0x204989[_0x28c7('0x44')]('\x22'+_0x24576d+'\x22');}else{_0x396c41['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x28c7('0x21'):var _0x135467=parseInt(_0x24576d);_0x24576d=_[_0x28c7('0x56')](_0x135467)||_0x135467<0x0||_0x135467>0x4?_0x4461cc?0x3:0x2:_0x135467;_0x204989[_0x28c7('0x44')]('\x22'+_0x24576d+'\x22');break;case _0x28c7('0x57'):var _0x210e2f=parseInt(_0x24576d);if(_[_0x28c7('0x58')](_0x210e2f)&&_[_0x28c7('0x59')](_0x3793f5,_0x210e2f)){_0x204989[_0x28c7('0x44')]('\x22'+_0x210e2f+'\x22');}else{_0x396c41['push']('agent\x20not\x20exists');}break;case _0x28c7('0x5a'):if(isEmail(_0x24576d)){_0x204989['push']('\x22'+_0x24576d+'\x22');}else{_0x396c41[_0x28c7('0x44')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x351d46=moment(_0x24576d,_0x28c7('0x5b'),!![]);if(_0x351d46[_0x28c7('0x55')]()){_0x204989['push']('\x22'+_0x24576d+'\x22');}else{_0x396c41[_0x28c7('0x44')](_0x28c7('0x5c'));}break;default:_0x204989[_0x28c7('0x44')]('\x22'+_0x24576d+'\x22');}}else{switch(_0x22a276){case'firstName':case _0x28c7('0x10'):_0x396c41[_0x28c7('0x44')](_0x22a276+_0x28c7('0x5d'));break;default:_0x204989[_0x28c7('0x44')]('\x22\x22');}}}}if(_0x396c41['length']){handleError(_0x548b8b[_0x28c7('0x50')][_0x3c6792],{'code':_0x28c7('0x5e'),'message':_0x396c41[_0x28c7('0x12')]()});}else{fs['appendFileSync'](_0x5656b0,_0x204989[_0x28c7('0x12')]()+'\x0a');}_0x204989=[];}if(!(stats[_0x28c7('0x51')]%0xc8)){socket[_0x28c7('0x5f')](_0x28c7('0x60')+_0x223f0b,stats);stats[_0x28c7('0x3f')]=[];}}if(stopped){logger['info'](_0x28c7('0x61'));_0x5bad1f['abort']();}}catch(_0x1ea976){handleError(_0x548b8b[_0x28c7('0x50')][_0x3c6792],{'code':_0x28c7('0x62'),'message':_0x1ea976[_0x28c7('0x41')]});logger['error']('step',_0x1ea976['message']);}},'complete':function(){try{var _0x2099bb=[];var _0x34935a=_0x28c7('0x25');if(_0x55a7ae[_0x28c7('0x63')]&&_0x55a7ae['duplicates'][_0x28c7('0x64')]){_0x34935a='cm_contacts_'+_0x223f0b;_0x2099bb['push'](_0x28c7('0x65')+_0x34935a+_0x28c7('0x66'));}var _0x98c10c=util[_0x28c7('0xc')](_0x28c7('0x67'),_0x5656b0,_0x34935a,_0x308057,_0x55a7ae[_0x28c7('0x1e')],_0x55a7ae[_0x28c7('0x68')]||null,NOW,NOW);if(_[_0x28c7('0x69')](_0x4099bf['scheduledat'])){_0x98c10c+=_0x28c7('0x6a');}_0x2099bb['push'](_0x98c10c);if(_0x55a7ae['duplicates']&&_0x55a7ae[_0x28c7('0x63')][_0x28c7('0x64')]){_0x2099bb[_0x28c7('0x44')](insertCmContact(_0x55a7ae[_0x28c7('0x1e')],_0x34935a,_0x55a7ae[_0x28c7('0x63')],_0x4099bf));_0x2099bb[_0x28c7('0x44')](_0x28c7('0x6b')+_0x34935a+';');}_0x2099bb['push'](insertCmHopper(_0x55a7ae[_0x28c7('0x1e')],_0x28c7('0x6c'),_0x28c7('0x6d'),_0x28c7('0x6e'),_0x4461cc));_0x2099bb[_0x28c7('0x44')](insertCmHopperBlack(_0x55a7ae[_0x28c7('0x1e')],'voice_queues_has_cm_blacklists',_0x28c7('0x6d'),_0x28c7('0x6e')));_0x2099bb[_0x28c7('0x44')](insertCmHopper(_0x55a7ae[_0x28c7('0x1e')],_0x28c7('0x6f'),_0x28c7('0x70'),'CampaignId',_0x4461cc));_0x2099bb[_0x28c7('0x44')](insertCmHopperBlack(_0x55a7ae['ListId'],_0x28c7('0x71'),'campaigns',_0x28c7('0x72')));BPromise[_0x28c7('0x73')](_0x2099bb,handleQuery)['then'](function(_0x299d52){stats[_0x28c7('0x74')]=!![];stats[_0x28c7('0x75')]=_0x55a7ae['duplicates']&&_0x55a7ae[_0x28c7('0x63')][_0x28c7('0x64')]?results[0x2][_0x28c7('0x75')]:results[0x0]['affectedRows'];socket[_0x28c7('0x5f')](_0x28c7('0x60')+_0x223f0b,stats);fs[_0x28c7('0x76')](_0x3ab7d9);fs[_0x28c7('0x76')](_0x5656b0);process[_0x28c7('0x3e')](0x0);})[_0x28c7('0x77')](function(_0x595cc8){logger[_0x28c7('0x3d')](_0x595cc8[_0x28c7('0x41')]);process[_0x28c7('0x3e')](0x1);});}catch(_0x515361){logger[_0x28c7('0x3d')]('complete',_0x515361['message']);process['exit'](0x1);}},'error':function(_0xe1d9d3,_0x32a617,_0x22c21b,_0x2f706f){throw new Error(_0x2f706f);}});}function validate(){if(process[_0x28c7('0x78')]&&process['argv'][_0x28c7('0x64')]<0x4){throw new Error(_0x28c7('0x79'));}var _0x48a18b=path[_0x28c7('0x12')](config['root'],'server/files/tmp',process[_0x28c7('0x78')][0x2]);if(!fs[_0x28c7('0x7a')](_0x48a18b)){throw new Error(_0x28c7('0x7b'));}var _0x4598d5={};try{_0x4598d5=JSON['parse'](process[_0x28c7('0x78')][0x3]);if(!_0x4598d5[_0x28c7('0x48')]){throw new Error(_0x28c7('0x7c'));}if(!_0x4598d5[_0x28c7('0x48')][_0x28c7('0x10')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x4598d5[_0x28c7('0x48')]['firstName']){throw new Error(_0x28c7('0x7d'));}var _0x2f5f00=0x0;if(_0x4598d5[_0x28c7('0x48')][_0x28c7('0x57')]){_0x2f5f00=0x1;}if(!_0x4598d5['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x15022d){throw new Error(_0x28c7('0x7e'));}var _0x24bf93=[];try{_0x24bf93=_[_0x28c7('0x7f')](JSON['parse'](process[_0x28c7('0x78')][0x4]),'id');}catch(_0x548f3c){logger['info'](_0x28c7('0x80'));}main(_0x48a18b,_0x4598d5,_0x24bf93,_0x2f5f00);}validate();process['on']('SIGINT',handleStop);process['on'](_0x28c7('0x81'),handleUncaughtException);
\ No newline at end of file
+var _0xfaea=['writeFileSync','parse','createReadStream','data','rows','errors','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','SystemRow','appendFileSync','emit','SystemError','error','duplicates','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','unlink','exit','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','moment','ioredis','../../../mysqldb','import','redis','defaults','localhost','socket.io-emitter','format','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','insert','into','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','ListId\x20=\x20?','ListId','CompanyId','fromQuery','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','push','spread','catch','main','stringify','send','start','binding','socket_timestamp','root','header'];(function(_0x596225,_0x440aee){var _0x17e906=function(_0x47eb2d){while(--_0x47eb2d){_0x596225['push'](_0x596225['shift']());}};_0x17e906(++_0x440aee);}(_0xfaea,0x1a0));var _0xafae=function(_0x35c300,_0x284351){_0x35c300=_0x35c300-0x0;var _0x59e44b=_0xfaea[_0x35c300];return _0x59e44b;};'use strict';var fs=require('fs');var path=require(_0xafae('0x0'));var _=require(_0xafae('0x1'));var Papa=require(_0xafae('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xafae('0x3'));var squel=require('squel');var Redis=require(_0xafae('0x4'));var db=require(_0xafae('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xafae('0x6'));config[_0xafae('0x7')]=_[_0xafae('0x8')](config['redis'],{'host':_0xafae('0x9'),'port':0x18eb});var socket=require(_0xafae('0xa'))(new Redis(config[_0xafae('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xafae('0xb')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x109f88){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'](_0x109f88);}function selectNotIn(_0x124014,_0x2c47b2,_0x41cd87,_0x52506c,_0x4c46b8){return squel[_0xafae('0xc')]()[_0xafae('0xd')](_0xafae('0xe'))[_0xafae('0xf')](_0x52506c)[_0xafae('0x10')](_0x2c47b2,null,_0x2c47b2+_0xafae('0x11')+_0x52506c+'.'+_0x41cd87)[_0xafae('0x12')](_0x52506c+'.'+_0x41cd87+_0xafae('0x13')+_0x124014+'.'+_0x41cd87)[_0xafae('0x12')](_0x2c47b2+_0xafae('0x14')+_0x4c46b8['join']()+')');}function insertCmHopper(_0xf3a033,_0x258bf3,_0x23135c,_0x5f1928,_0x5b2290){var _0x2f63ff=['cm_contacts.phone','cm_contacts.scheduledat',_0xafae('0x15'),_0xafae('0x16'),_0x258bf3+'.'+_0x5f1928,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xafae('0x17'),'cm_contacts.UserId','\x22'+_0x5b2290+'\x22'];return squel[_0xafae('0x18')]()[_0xafae('0x19')](_0xafae('0x1a'))['fromQuery']([_0xafae('0xe'),_0xafae('0x1b'),_0xafae('0x1c'),'ListId',_0x5f1928,_0xafae('0x1d'),_0xafae('0x1e'),_0xafae('0x1f'),_0xafae('0x20'),'recallme'],squel[_0xafae('0xc')]()[_0xafae('0x21')](_0x2f63ff)[_0xafae('0xf')](_0x258bf3)[_0xafae('0x10')](_0xafae('0x22'),null,_0xafae('0x23')+_0x258bf3+_0xafae('0x24'))[_0xafae('0x10')](_0x23135c,null,_0x23135c+_0xafae('0x11')+_0x258bf3+'.'+_0x5f1928)[_0xafae('0x12')](_0x258bf3+'.CmListId\x20=\x20?',_0xf3a033)[_0xafae('0x12')](_0xafae('0x25'),NOW)[_0xafae('0x12')](_0xafae('0x26'),selectNotIn(_0x258bf3,_0x23135c,_0x5f1928,_0xafae('0x1a'),[_0xafae('0x27'),'\x22onlyIfOpen\x22']))['where'](_0xafae('0x26'),selectNotIn(_0x258bf3,_0x23135c,_0x5f1928,_0xafae('0x1a'),[_0xafae('0x27')])))[_0xafae('0x28')]();}function insertCmHopperBlack(_0xd379a3,_0x992ae6,_0x19fa75,_0x4ceb58){var _0x2afc08=[_0xafae('0x29'),_0xafae('0x15'),_0xafae('0x16'),_0x992ae6+'.'+_0x4ceb58,_0xafae('0x2a'),_0xafae('0x2b')];return squel[_0xafae('0x18')]()[_0xafae('0x19')](_0xafae('0x2c'))['fromQuery'](['phone','ContactId','ListId',_0x4ceb58,_0xafae('0x1d'),'updatedAt'],squel[_0xafae('0xc')]()['fields'](_0x2afc08)[_0xafae('0xf')](_0x992ae6)[_0xafae('0x10')]('cm_contacts',null,_0xafae('0x23')+_0x992ae6+'.CmListId')[_0xafae('0x10')](_0x19fa75,null,_0x19fa75+_0xafae('0x11')+_0x992ae6+'.'+_0x4ceb58)[_0xafae('0x12')](_0x992ae6+'.CmListId\x20=\x20?',_0xd379a3)[_0xafae('0x12')](_0xafae('0x25'),NOW)[_0xafae('0x12')](_0xafae('0x26'),squel['select']()['field']('phone')[_0xafae('0xf')](_0xafae('0x2c'))[_0xafae('0x12')](_0xafae('0x2d'),_0xd379a3)[_0xafae('0x12')](_0x4ceb58+'\x20=\x20?',_0x992ae6+'.'+_0x4ceb58)))[_0xafae('0x28')]();}function insertCmContact(_0x1fcc02,_0x18b4f0,_0x155b82,_0x5a7cc2){var _0x29dd0a=_['concat'](_['keys'](_0x5a7cc2),[_0xafae('0x2e'),_0xafae('0x2f'),_0xafae('0x1d'),_0xafae('0x1e')]);return squel[_0xafae('0x18')]()[_0xafae('0x19')](_0xafae('0x22'))[_0xafae('0x30')](_0x29dd0a,squel[_0xafae('0xc')]()['fields'](_0x29dd0a)[_0xafae('0xf')](_0x18b4f0)[_0xafae('0x12')]('('+_0x155b82[_0xafae('0x10')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xafae('0x21')](_0x155b82)['from']('cm_contacts')[_0xafae('0x12')](_0xafae('0x2d'),_0x1fcc02)[_0xafae('0x12')](_0xafae('0x31')))[_0xafae('0x12')](_0xafae('0x32'),squel[_0xafae('0xc')]()['field'](_0xafae('0x33'),_0xafae('0x34'))[_0xafae('0xf')](_0x18b4f0)[_0xafae('0x35')](_0x155b82[_0xafae('0x10')](','))))[_0xafae('0x28')]();}function handleStop(){logger[_0xafae('0x36')](_0xafae('0x37'));stopped=!![];}function handleUncaughtException(_0x4d5522){logger['error'](_0x4d5522[_0xafae('0x38')]);process['exit'](0x1);}function handleError(_0x38c271,_0x164ab5){stats['errors'][_0xafae('0x39')]({'name':_0x164ab5['code'],'message':_0x164ab5[_0xafae('0x38')],'row':_0x38c271});}function handleQuery(_0x4f75a3){logger[_0xafae('0x36')](_0x4f75a3);return db['sequelize']['query'](_0x4f75a3)[_0xafae('0x3a')](function(_0x3f4631){results[_0xafae('0x39')](_0x3f4631);})[_0xafae('0x3b')](function(_0x3902a7){logger['error'](_0x3902a7[_0xafae('0x38')]);});}function main(_0x3c2e87,_0x3596e5,_0x433574,_0x28485f){logger[_0xafae('0x36')](_0xafae('0x3c'),_0x3c2e87,JSON[_0xafae('0x3d')](_0x3596e5));process[_0xafae('0x3e')](_0xafae('0x3f'));var _0x2e12a7=_0x3596e5[_0xafae('0x40')];var _0x2ee821=_0x3596e5[_0xafae('0x41')];var _0x59e6a9=path['join'](config[_0xafae('0x42')],'server/files/tmp',_0x2ee821+'.csv');var _0x3ad308=_['keys'](_0x2e12a7)['join']();logger['info'](_0xafae('0x43'),_0x3ad308);fs[_0xafae('0x44')](_0x59e6a9,_0x3ad308+'\x0a');Papa[_0xafae('0x45')](fs[_0xafae('0x46')](_0x3c2e87),{'header':!![],'skipEmptyLines':!![],'step':function(_0x260b16,_0x518b6b){try{for(var _0x52fe87=0x0,_0x2c10ba=[];_0x52fe87<_0x260b16[_0xafae('0x47')]['length'];_0x52fe87++){stats[_0xafae('0x48')]+=0x1;if(_0x260b16[_0xafae('0x49')][_0x52fe87]){handleError(_0x260b16['data'][_0x52fe87],_0x260b16[_0xafae('0x49')][_0x52fe87]);}else{var _0x2480b3=[];for(var _0x4573b8 in _0x2e12a7){if(_0x2e12a7['hasOwnProperty'](_0x4573b8)){if(_0x260b16[_0xafae('0x47')][_0x52fe87][_0x2e12a7[_0x4573b8]]){var _0xb2c6a2=_[_0xafae('0x4a')](_0x260b16[_0xafae('0x47')][_0x52fe87][_0x2e12a7[_0x4573b8]]['replace'](/"/g,'\x27'));switch(_0x4573b8){case _0xafae('0x1b'):var _0x5e2458=moment(_0xb2c6a2,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5e2458[_0xafae('0x4b')]()){_0x2c10ba['push']('\x22'+_0xb2c6a2+'\x22');}else{_0x2480b3[_0xafae('0x39')](_0xafae('0x4c'));}break;case _0xafae('0x1f'):var _0x14e5e9=parseInt(_0xb2c6a2);_0xb2c6a2=_[_0xafae('0x4d')](_0x14e5e9)||_0x14e5e9<0x0||_0x14e5e9>0x4?_0x28485f?0x3:0x2:_0x14e5e9;_0x2c10ba[_0xafae('0x39')]('\x22'+_0xb2c6a2+'\x22');break;case _0xafae('0x20'):var _0x20810f=parseInt(_0xb2c6a2);if(_[_0xafae('0x4e')](_0x20810f)&&_[_0xafae('0x4f')](_0x433574,_0x20810f)){_0x2c10ba['push']('\x22'+_0x20810f+'\x22');}else{_0x2480b3[_0xafae('0x39')](_0xafae('0x50'));}break;case _0xafae('0x51'):if(isEmail(_0xb2c6a2)){_0x2c10ba[_0xafae('0x39')]('\x22'+_0xb2c6a2+'\x22');}else{_0x2480b3[_0xafae('0x39')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x866ca0=moment(_0xb2c6a2,'YYYY-MM-DD',!![]);if(_0x866ca0[_0xafae('0x4b')]()){_0x2c10ba[_0xafae('0x39')]('\x22'+_0xb2c6a2+'\x22');}else{_0x2480b3[_0xafae('0x39')](_0xafae('0x52'));}break;default:_0x2c10ba[_0xafae('0x39')]('\x22'+_0xb2c6a2+'\x22');}}else{switch(_0x4573b8){case _0xafae('0x53'):case'phone':_0x2480b3[_0xafae('0x39')](_0x4573b8+_0xafae('0x54'));break;default:_0x2c10ba[_0xafae('0x39')]('\x22\x22');}}}}if(_0x2480b3[_0xafae('0x55')]){handleError(_0x260b16[_0xafae('0x47')][_0x52fe87],{'code':_0xafae('0x56'),'message':_0x2480b3['join']()});}else{fs[_0xafae('0x57')](_0x59e6a9,_0x2c10ba[_0xafae('0x10')]()+'\x0a');}_0x2c10ba=[];}if(!(stats['rows']%0xc8)){socket[_0xafae('0x58')]('contact:import:'+_0x2ee821,stats);stats['errors']=[];}}if(stopped){logger[_0xafae('0x36')]('Abort\x20parser');_0x518b6b['abort']();}}catch(_0x167534){handleError(_0x260b16[_0xafae('0x47')][_0x52fe87],{'code':_0xafae('0x59'),'message':_0x167534[_0xafae('0x38')]});logger[_0xafae('0x5a')]('step',_0x167534['message']);}},'complete':function(){try{var _0x4546a3=[];var _0x31824c=_0xafae('0x22');if(_0x3596e5[_0xafae('0x5b')]&&_0x3596e5[_0xafae('0x5b')][_0xafae('0x55')]){_0x31824c='cm_contacts_'+_0x2ee821;_0x4546a3[_0xafae('0x39')](_0xafae('0x5c')+_0x31824c+'\x20LIKE\x20cm_contacts;');}var _0x368b21=util[_0xafae('0xb')](_0xafae('0x5d'),_0x59e6a9,_0x31824c,_0x3ad308,_0x3596e5[_0xafae('0x2e')],_0x3596e5[_0xafae('0x2f')]||null,NOW,NOW);if(_[_0xafae('0x5e')](_0x2e12a7['scheduledat'])){_0x368b21+=_0xafae('0x5f');}_0x4546a3[_0xafae('0x39')](_0x368b21);if(_0x3596e5[_0xafae('0x5b')]&&_0x3596e5['duplicates']['length']){_0x4546a3[_0xafae('0x39')](insertCmContact(_0x3596e5[_0xafae('0x2e')],_0x31824c,_0x3596e5[_0xafae('0x5b')],_0x2e12a7));_0x4546a3['push'](_0xafae('0x60')+_0x31824c+';');}_0x4546a3[_0xafae('0x39')](insertCmHopper(_0x3596e5[_0xafae('0x2e')],_0xafae('0x61'),'voice_queues',_0xafae('0x62'),_0x28485f));_0x4546a3[_0xafae('0x39')](insertCmHopperBlack(_0x3596e5[_0xafae('0x2e')],_0xafae('0x63'),_0xafae('0x64'),_0xafae('0x62')));_0x4546a3[_0xafae('0x39')](insertCmHopper(_0x3596e5[_0xafae('0x2e')],_0xafae('0x65'),_0xafae('0x66'),_0xafae('0x67'),_0x28485f));_0x4546a3[_0xafae('0x39')](insertCmHopperBlack(_0x3596e5[_0xafae('0x2e')],'campaigns_has_cm_blacklists',_0xafae('0x66'),_0xafae('0x67')));BPromise[_0xafae('0x68')](_0x4546a3,handleQuery)[_0xafae('0x69')](function(_0x2c997d){stats[_0xafae('0x6a')]=!![];stats[_0xafae('0x6b')]=_0x3596e5[_0xafae('0x5b')]&&_0x3596e5[_0xafae('0x5b')][_0xafae('0x55')]?results[0x2]['affectedRows']:results[0x0][_0xafae('0x6b')];socket[_0xafae('0x58')]('contact:import:'+_0x2ee821,stats);fs['unlink'](_0x3c2e87);fs[_0xafae('0x6c')](_0x59e6a9);process[_0xafae('0x6d')](0x0);})[_0xafae('0x3b')](function(_0x453d92){logger[_0xafae('0x5a')](_0x453d92[_0xafae('0x38')]);process[_0xafae('0x6d')](0x1);});}catch(_0x5270c8){logger['error']('complete',_0x5270c8[_0xafae('0x38')]);process[_0xafae('0x6d')](0x1);}},'error':function(_0x386182,_0x4f1cef,_0x1edcae,_0x2c6cf1){throw new Error(_0x2c6cf1);}});}function validate(){if(process[_0xafae('0x6e')]&&process[_0xafae('0x6e')][_0xafae('0x55')]<0x4){throw new Error(_0xafae('0x6f'));}var _0x3a3aa7=path[_0xafae('0x10')](config['root'],'server/files/tmp',process[_0xafae('0x6e')][0x2]);if(!fs[_0xafae('0x70')](_0x3a3aa7)){throw new Error(_0xafae('0x71'));}var _0x379cc9={};try{_0x379cc9=JSON[_0xafae('0x45')](process[_0xafae('0x6e')][0x3]);if(!_0x379cc9[_0xafae('0x40')]){throw new Error(_0xafae('0x72'));}if(!_0x379cc9['binding'][_0xafae('0xe')]){throw new Error(_0xafae('0x73'));}if(!_0x379cc9[_0xafae('0x40')]['firstName']){throw new Error(_0xafae('0x74'));}var _0x1220f2=0x0;if(_0x379cc9[_0xafae('0x40')]['UserId']){_0x1220f2=0x1;}if(!_0x379cc9[_0xafae('0x2e')]){throw new Error(_0xafae('0x75'));}}catch(_0x139ce5){throw new Error('body\x20id\x20mandatory');}var _0xe82635=[];try{_0xe82635=_[_0xafae('0x76')](JSON[_0xafae('0x45')](process[_0xafae('0x6e')][0x4]),'id');}catch(_0x37550c){logger[_0xafae('0x36')](_0xafae('0x77'));}main(_0x3a3aa7,_0x379cc9,_0xe82635,_0x1220f2);}validate();process['on'](_0xafae('0x78'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 8276bb9..a2aa22e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f3a=['membername','UniqueId','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','outbound','Outbound\x20Call','variable','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','Caller\x20Number','calleridnum','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','Member\x20Name'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x2c8e0b,_0x2192f6){_0x2c8e0b=_0x2c8e0b-0x0;var _0xb3ad81=_0x2f3a[_0x2c8e0b];return _0xb3ad81;};'use strict';exports[_0xa2f3('0x0')]=function(_0x4fa58d,_0x4ce90c){var _0x18d845=[{'type':_0xa2f3('0x1'),'content':_0xa2f3('0x2'),'variableName':null}];switch(_0x4fa58d[_0xa2f3('0x3')]()){case _0xa2f3('0x4'):switch(_0x4ce90c[_0xa2f3('0x3')]()){case'inbound':_0x18d845[_0xa2f3('0x5')]({'type':'variable','content':'','variableName':_0xa2f3('0x6')});_0x18d845[_0xa2f3('0x5')]({'type':'variable','content':'','variableName':'calleridnum'});break;case _0xa2f3('0x7'):_0x18d845[_0xa2f3('0x5')]({'type':_0xa2f3('0x1'),'content':_0xa2f3('0x8'),'variableName':null});_0x18d845['push']({'type':_0xa2f3('0x9'),'content':'','variableName':_0xa2f3('0xa')});break;}}return _0x18d845;};exports[_0xa2f3('0xb')]=function(_0x41a90c,_0x214f68){var _0x55ff83=[];switch(_0x41a90c[_0xa2f3('0x3')]()){case _0xa2f3('0x4'):switch(_0x214f68['toLowerCase']()){case _0xa2f3('0xc'):_0x55ff83=[{'type':_0xa2f3('0x1'),'content':_0xa2f3('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa2f3('0xe'),'keyType':_0xa2f3('0x9'),'variableName':_0xa2f3('0xf')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x11'),'keyType':_0xa2f3('0x9'),'variableName':_0xa2f3('0x12')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x13'),'keyType':'variable','variableName':_0xa2f3('0x14')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x15'),'keyType':'variable','variableName':_0xa2f3('0x6')},{'type':_0xa2f3('0x10'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0xa2f3('0x16')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x17'),'keyType':_0xa2f3('0x9'),'variableName':_0xa2f3('0x18')},{'type':_0xa2f3('0x1'),'content':_0xa2f3('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xa2f3('0x10'),'content':'','key':'Agent\x20Name','keyType':_0xa2f3('0x9'),'variableName':_0xa2f3('0x1a')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0xa2f3('0x9'),'variableName':'destcalleridnum'},{'type':_0xa2f3('0x1'),'content':_0xa2f3('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa2f3('0x1c'),'keyType':_0xa2f3('0x9'),'variableName':_0xa2f3('0x18')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x1d'),'keyType':_0xa2f3('0x9'),'variableName':_0xa2f3('0x1e')},{'type':_0xa2f3('0x10'),'content':'','key':'Agent\x20Complete','keyType':_0xa2f3('0x9'),'variableName':_0xa2f3('0x1f')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x20'),'keyType':_0xa2f3('0x9'),'variableName':_0xa2f3('0x21')},{'type':_0xa2f3('0x10'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xa2f3('0x22')}];break;case _0xa2f3('0x7'):_0x55ff83=[{'type':_0xa2f3('0x1'),'content':_0xa2f3('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0xa2f3('0x23'),'keyType':_0xa2f3('0x9'),'keyContent':'','variableName':_0xa2f3('0xa')},{'type':'keyValue','content':'','key':_0xa2f3('0x24'),'keyType':'variable','keyContent':'','variableName':_0xa2f3('0x25')},{'type':'keyValue','content':'','key':_0xa2f3('0x26'),'keyType':'variable','keyContent':'','variableName':_0xa2f3('0x16')},{'type':'keyValue','content':'','key':_0xa2f3('0x17'),'keyType':_0xa2f3('0x9'),'keyContent':'','variableName':_0xa2f3('0x27')},{'type':_0xa2f3('0x1'),'content':_0xa2f3('0x1b')},{'type':'keyValue','content':'','key':_0xa2f3('0x28'),'keyType':_0xa2f3('0x9'),'keyContent':'','variableName':_0xa2f3('0x29')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x2a'),'keyType':_0xa2f3('0x9'),'keyContent':'','variableName':_0xa2f3('0x2b')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x2c'),'keyType':'variable','keyContent':'','variableName':_0xa2f3('0x2d')},{'type':_0xa2f3('0x10'),'content':'','key':_0xa2f3('0x2e'),'keyType':_0xa2f3('0x9'),'keyContent':'','variableName':_0xa2f3('0x2f')}];break;}}return _0x55ff83;};
\ No newline at end of file
+var _0x09df=['destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','Date','Answer\x20Time','answertime','Complete\x20Time','Duration','billableseconds','getSubjects','toLowerCase','inbound','push','variable','outbound','string','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','calleridname','destexten','Queue','queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name'];(function(_0x1d5a39,_0x1faf84){var _0x502842=function(_0x51155f){while(--_0x51155f){_0x1d5a39['push'](_0x1d5a39['shift']());}};_0x502842(++_0x1faf84);}(_0x09df,0x164));var _0xf09d=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x09df[_0x1cd47d];return _0x29d52f;};'use strict';exports[_0xf09d('0x0')]=function(_0x28fd89,_0x4f828c){var _0x401dac=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x28fd89[_0xf09d('0x1')]()){case'voice':switch(_0x4f828c['toLowerCase']()){case _0xf09d('0x2'):_0x401dac[_0xf09d('0x3')]({'type':'variable','content':'','variableName':'queue'});_0x401dac['push']({'type':_0xf09d('0x4'),'content':'','variableName':'calleridnum'});break;case _0xf09d('0x5'):_0x401dac[_0xf09d('0x3')]({'type':_0xf09d('0x6'),'content':_0xf09d('0x7'),'variableName':null});_0x401dac[_0xf09d('0x3')]({'type':_0xf09d('0x4'),'content':'','variableName':_0xf09d('0x8')});break;}}return _0x401dac;};exports['getDescriptions']=function(_0x404322,_0x227a55){var _0x56a961=[];switch(_0x404322[_0xf09d('0x1')]()){case'voice':switch(_0x227a55[_0xf09d('0x1')]()){case _0xf09d('0x2'):_0x56a961=[{'type':_0xf09d('0x6'),'content':_0xf09d('0x9'),'key':null,'keyType':null,'variableName':null},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0xb'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0xc')},{'type':_0xf09d('0xa'),'content':'','key':'Caller\x20Name','keyType':_0xf09d('0x4'),'variableName':_0xf09d('0xd')},{'type':_0xf09d('0xa'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0xf09d('0xe')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0xf'),'keyType':'variable','variableName':_0xf09d('0x10')},{'type':'keyValue','content':'','key':_0xf09d('0x11'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x12')},{'type':_0xf09d('0xa'),'content':'','key':'Date','keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x13')},{'type':_0xf09d('0x6'),'content':_0xf09d('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x15'),'keyType':'variable','variableName':_0xf09d('0x16')},{'type':'keyValue','content':'','key':_0xf09d('0x17'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x8')},{'type':_0xf09d('0x6'),'content':_0xf09d('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xf09d('0xa'),'content':'','key':'Agent\x20Ring','keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x13')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x19'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x1a')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x1b'),'keyType':'variable','variableName':_0xf09d('0x1c')},{'type':'keyValue','content':'','key':_0xf09d('0x1d'),'keyType':'variable','variableName':_0xf09d('0x1e')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x1f'),'keyType':_0xf09d('0x4'),'variableName':_0xf09d('0x20')}];break;case _0xf09d('0x5'):_0x56a961=[{'type':'string','content':_0xf09d('0x9'),'variableName':null},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x21'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':_0xf09d('0x22'),'keyType':_0xf09d('0x4'),'keyContent':'','variableName':_0xf09d('0x23')},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x11'),'keyType':_0xf09d('0x4'),'keyContent':'','variableName':_0xf09d('0x12')},{'type':'keyValue','content':'','key':_0xf09d('0x24'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0xf09d('0x6'),'content':_0xf09d('0x18')},{'type':'keyValue','content':'','key':_0xf09d('0x25'),'keyType':_0xf09d('0x4'),'keyContent':'','variableName':_0xf09d('0x26')},{'type':'keyValue','content':'','key':_0xf09d('0x27'),'keyType':_0xf09d('0x4'),'keyContent':'','variableName':'endtime'},{'type':_0xf09d('0xa'),'content':'','key':_0xf09d('0x28'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xf09d('0xa'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0xf09d('0x29')}];break;}}return _0x56a961;};
\ No newline at end of file
index d56cd3d..4341f27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29ae=['user','query','clone','omit','html','fax','mobile','lodash','../../config/logger','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','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x29ae,0x167));var _0xe29a=function(_0x4d4024,_0x1de251){_0x4d4024=_0x4d4024-0x0;var _0x32ae71=_0x29ae[_0x4d4024];return _0x32ae71;};'use strict';var _=require(_0xe29a('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0xe29a('0x1'))(_0xe29a('0x2')),'fax':require('../../config/logger')(_0xe29a('0x3')),'sms':require('../../config/logger')(_0xe29a('0x4')),'chat':require(_0xe29a('0x1'))(_0xe29a('0x5')),'whatsapp':require('../../config/logger')(_0xe29a('0x6'))};function getInteractionId(_0xb003c,_0x5dbd0c,_0x5536b6){if(_0xb003c&&_0xb003c[_[_0xe29a('0x7')](_0x5536b6)+_0xe29a('0x8')]){return _0xb003c[_[_0xe29a('0x7')](_0x5536b6)+_0xe29a('0x8')];}else if(_0xb003c&&_0xb003c['id']){return _0xb003c['id'];}else if(_0x5dbd0c&&_0x5dbd0c['id']){return _0x5dbd0c['id'];}else{return _0xe29a('0x9');}}function log(_0x221430,_0x4d066b,_0x45b177,_0x5ea357,_0x5e7e65,_0x341074){loggers[_0x5e7e65[_0xe29a('0xa')]()][_0x221430](_0xe29a('0xb'),_0x341074[_0xe29a('0xc')](),_0x4d066b?_0x4d066b['id']:null,_0x4d066b?_0x4d066b[_0xe29a('0xd')]:null,_0x4d066b?_0x4d066b[_0xe29a('0xe')]:null,getInteractionId(_0x45b177,_0x5ea357,_0x5e7e65),_0x45b177?JSON[_0xe29a('0xf')](_0x45b177):_0xe29a('0x10'));}function updateUser(_0x26f895,_0x129eb9,_0x3c9bc9,_0x5573bb,_0x5d47de){db[_[_0xe29a('0x7')](_0x5573bb)+_0xe29a('0x11')][_0xe29a('0x12')]({'where':{'id':getInteractionId(_0x129eb9,_0x3c9bc9,_0x5573bb)}})[_0xe29a('0x13')](function(_0x2904aa){if(_0x2904aa){return _0x2904aa[_0xe29a('0x14')]({'UserId':_0x26f895?_0x26f895['id']:null});}})[_0xe29a('0x13')](function(_0x84ba57){if(_0x84ba57){log(_0xe29a('0x15'),_0x26f895,_0x129eb9,_0x3c9bc9,_0x5573bb,_0x5d47de);}})[_0xe29a('0x16')](function(){log(_0xe29a('0x17'),_0x26f895,_0x129eb9,_0x3c9bc9,_0x5573bb,_0x5d47de);});}exports[_0xe29a('0x18')]=function(_0x4ec604,_0x3e411a){return function(_0x61ff63,_0xae774a,_0x17268d){var _0x40d23b=_0x61ff63[_0xe29a('0x19')];var _0x120e81={};var _0xe62dd7=_0x61ff63[_0xe29a('0x1a')];if(_0x120e81){_0x120e81=_[_0xe29a('0x1b')](_0x61ff63['body']);_0x120e81=_[_0xe29a('0x1c')](_0x120e81,['body',_0xe29a('0x1d'),'phone',_0xe29a('0x1e'),_0xe29a('0x1f')]);}updateUser(_0x40d23b,_0x120e81,_0xe62dd7,_0x4ec604,_0x3e411a);_0x17268d(null);};};
\ No newline at end of file
+var _0xcac6=['chat-interactions','whatsapp-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','then','update','info','catch','error','user','clone','omit','body','html','phone','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions'];(function(_0x3669d5,_0x1e3897){var _0x48def1=function(_0x524bb0){while(--_0x524bb0){_0x3669d5['push'](_0x3669d5['shift']());}};_0x48def1(++_0x1e3897);}(_0xcac6,0xa3));var _0x6cac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcac6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var db=require(_0x6cac('0x0'))['db'];var loggers={'openchannel':require(_0x6cac('0x1'))(_0x6cac('0x2')),'mail':require(_0x6cac('0x1'))('mail-interactions'),'fax':require('../../config/logger')(_0x6cac('0x3')),'sms':require(_0x6cac('0x1'))(_0x6cac('0x4')),'chat':require(_0x6cac('0x1'))(_0x6cac('0x5')),'whatsapp':require(_0x6cac('0x1'))(_0x6cac('0x6'))};function getInteractionId(_0x51a850,_0x2abd7b,_0x21c42a){if(_0x51a850&&_0x51a850[_[_0x6cac('0x7')](_0x21c42a)+_0x6cac('0x8')]){return _0x51a850[_[_0x6cac('0x7')](_0x21c42a)+'InteractionId'];}else if(_0x51a850&&_0x51a850['id']){return _0x51a850['id'];}else if(_0x2abd7b&&_0x2abd7b['id']){return _0x2abd7b['id'];}else{return'unknown';}}function log(_0x44654a,_0x58564a,_0x1a0893,_0x31d8a0,_0x9cc09a,_0x275141){loggers[_0x9cc09a['toLowerCase']()][_0x44654a](_0x6cac('0x9'),_0x275141['toUpperCase'](),_0x58564a?_0x58564a['id']:null,_0x58564a?_0x58564a[_0x6cac('0xa')]:null,_0x58564a?_0x58564a[_0x6cac('0xb')]:null,getInteractionId(_0x1a0893,_0x31d8a0,_0x9cc09a),_0x1a0893?JSON[_0x6cac('0xc')](_0x1a0893):_0x6cac('0xd'));}function updateUser(_0x25d5e0,_0x15a71e,_0x544b50,_0x479bf1,_0x4fd561){db[_[_0x6cac('0x7')](_0x479bf1)+_0x6cac('0xe')]['findOne']({'where':{'id':getInteractionId(_0x15a71e,_0x544b50,_0x479bf1)}})[_0x6cac('0xf')](function(_0x47e205){if(_0x47e205){return _0x47e205[_0x6cac('0x10')]({'UserId':_0x25d5e0?_0x25d5e0['id']:null});}})[_0x6cac('0xf')](function(_0x5b002c){if(_0x5b002c){log(_0x6cac('0x11'),_0x25d5e0,_0x15a71e,_0x544b50,_0x479bf1,_0x4fd561);}})[_0x6cac('0x12')](function(){log(_0x6cac('0x13'),_0x25d5e0,_0x15a71e,_0x544b50,_0x479bf1,_0x4fd561);});}exports['tracked']=function(_0x11b86f,_0x4cd6b4){return function(_0x1a392b,_0x45adb0,_0x3c8e59){var _0x1346e4=_0x1a392b[_0x6cac('0x14')];var _0x3188aa={};var _0x1ae1cf=_0x1a392b['query'];if(_0x3188aa){_0x3188aa=_[_0x6cac('0x15')](_0x1a392b['body']);_0x3188aa=_[_0x6cac('0x16')](_0x3188aa,[_0x6cac('0x17'),_0x6cac('0x18'),_0x6cac('0x19'),_0x6cac('0x1a'),_0x6cac('0x1b')]);}updateUser(_0x1346e4,_0x3188aa,_0x1ae1cf,_0x11b86f,_0x4cd6b4);_0x3c8e59(null);};};
\ No newline at end of file
index dca1253..24f544c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8904=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','final','utf8','parse','use','License','findOne','then','count','status','json'];(function(_0x24c3dd,_0x2adfac){var _0x2eabc1=function(_0x40ffef){while(--_0x40ffef){_0x24c3dd['push'](_0x24c3dd['shift']());}};_0x2eabc1(++_0x2adfac);}(_0x8904,0x163));var _0x4890=function(_0x4cdede,_0x308264){_0x4cdede=_0x4cdede-0x0;var _0x19fde7=_0x8904[_0x4cdede];return _0x19fde7;};'use strict';var crypto=require(_0x4890('0x0'));var util=require(_0x4890('0x1'));var compose=require(_0x4890('0x2'));var db=require(_0x4890('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3c6705,_0x57bb64){if(_0x3c6705&&_0x57bb64){if(_0x57bb64[_0x4890('0x4')]&&_0x57bb64[_0x4890('0x5')]){var _0x3c49b6=_0x57bb64[_0x4890('0x4')];var _0x355cd6=_0x57bb64[_0x4890('0x5')];var _0x53f469=_0x3c49b6[_0x4890('0x6')]('-')[0x4];var _0x118db3=_0x3c49b6[_0x4890('0x6')]('-')[0x0];var _0x2ac157=crypto[_0x4890('0x7')](_0x4890('0x8'),util[_0x4890('0x9')](_0x4890('0xa'),_0x53f469,_0x3c49b6,_0x118db3));var _0xe88f95=_0x2ac157[_0x4890('0xb')](_0x355cd6,'base64','utf8');_0xe88f95+=_0x2ac157[_0x4890('0xc')](_0x4890('0xd'));var _0x31ddce=JSON[_0x4890('0xe')](_0xe88f95);return _0x31ddce['hasOwnProperty'](_0x3c6705)?_0x31ddce[_0x3c6705]:null;}}return null;}function isLimit(_0x5b49da,_0x2f2b3f,_0x119033,_0x24bacd){var _0x3a8c54=_0x2f2b3f;return compose()[_0x4890('0xf')](function(_0x29c5f1,_0x373897,_0x1ef310){return db[_0x4890('0x10')][_0x4890('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x4890('0x12')](function(_0x5965ea){var _0xb4be2a=getValueFromLicense(_0x5b49da,_0x5965ea);return _0xb4be2a?_0xb4be2a:_0x3a8c54;})['then'](function(_0x85abf7){_0x3a8c54=_0x85abf7;return _0x119033[_0x4890('0x13')](_0x24bacd);})[_0x4890('0x12')](function(_0x39969c){if(_0x39969c>=_0x3a8c54){return _0x373897[_0x4890('0x14')](0x193)[_0x4890('0x15')]({'message':util[_0x4890('0x9')](_0x4890('0x16'),_0x5b49da)});}_0x1ef310();})[_0x4890('0x17')](function(_0x2fc139){_0x1ef310(_0x2fc139);});});}function isUserLimit(){return isLimit(_0x4890('0x18'),0x1,db[_0x4890('0x19')],{'where':{'$or':[{'role':_0x4890('0x1a')},{'role':_0x4890('0x1b')}]}});}exports[_0x4890('0x1c')]=isUserLimit;
\ No newline at end of file
+var _0x93ee=['%s:%s:%s','update','utf8','parse','use','License','then','count','status','catch','users','admin','user','crypto','util','composable-middleware','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','format'];(function(_0x261a4a,_0x41ec2e){var _0x33da9d=function(_0xc6fafe){while(--_0xc6fafe){_0x261a4a['push'](_0x261a4a['shift']());}};_0x33da9d(++_0x41ec2e);}(_0x93ee,0xc5));var _0xe93e=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x93ee[_0x12e3e3];return _0x26602e;};'use strict';var crypto=require(_0xe93e('0x0'));var util=require(_0xe93e('0x1'));var compose=require(_0xe93e('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xe93e('0x3'));function getValueFromLicense(_0x5b7553,_0x4e0660){if(_0x5b7553&&_0x4e0660){if(_0x4e0660['data1']&&_0x4e0660[_0xe93e('0x4')]){var _0x281f24=_0x4e0660[_0xe93e('0x5')];var _0x2ae245=_0x4e0660['license'];var _0x346c76=_0x281f24[_0xe93e('0x6')]('-')[0x4];var _0x49f5b1=_0x281f24['split']('-')[0x0];var _0x393941=crypto[_0xe93e('0x7')](_0xe93e('0x8'),util[_0xe93e('0x9')](_0xe93e('0xa'),_0x346c76,_0x281f24,_0x49f5b1));var _0x171055=_0x393941[_0xe93e('0xb')](_0x2ae245,'base64','utf8');_0x171055+=_0x393941['final'](_0xe93e('0xc'));var _0x1e4fdd=JSON[_0xe93e('0xd')](_0x171055);return _0x1e4fdd['hasOwnProperty'](_0x5b7553)?_0x1e4fdd[_0x5b7553]:null;}}return null;}function isLimit(_0x1929e9,_0x9bd7d0,_0x3ec577,_0x35f406){var _0x4e7654=_0x9bd7d0;return compose()[_0xe93e('0xe')](function(_0x27e96d,_0x55c7e5,_0x363053){return db[_0xe93e('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xe93e('0x10')](function(_0x3b04de){var _0x44fdd0=getValueFromLicense(_0x1929e9,_0x3b04de);return _0x44fdd0?_0x44fdd0:_0x4e7654;})['then'](function(_0x314abe){_0x4e7654=_0x314abe;return _0x3ec577[_0xe93e('0x11')](_0x35f406);})[_0xe93e('0x10')](function(_0x23fed2){if(_0x23fed2>=_0x4e7654){return _0x55c7e5[_0xe93e('0x12')](0x193)['json']({'message':util[_0xe93e('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1929e9)});}_0x363053();})[_0xe93e('0x13')](function(_0xb02c25){_0x363053(_0xb02c25);});});}function isUserLimit(){return isLimit(_0xe93e('0x14'),0x1,db['User'],{'where':{'$or':[{'role':_0xe93e('0x15')},{'role':_0xe93e('0x16')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index 94acecf..34ef753 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc229=['>=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','hours','add','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','replace','[$and]','length','slice','forEach','shift','match','split','map','conditions','push','buildExpression','DATE','operator','$between','value','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte'];(function(_0x5426e2,_0x5f2968){var _0x920dc=function(_0x3a87c6){while(--_0x3a87c6){_0x5426e2['push'](_0x5426e2['shift']());}};_0x920dc(++_0x5f2968);}(_0xc229,0x14c));var _0x9c22=function(_0x10280c,_0x30f339){_0x10280c=_0x10280c-0x0;var _0x490c46=_0xc229[_0x10280c];return _0x490c46;};'use strict';var _=require(_0x9c22('0x0'));var moment=require('moment');exports[_0x9c22('0x1')]=function(_0x4b2891){var _0x3cca08={'conditions':[]};_0x3cca08[_0x9c22('0x2')]=_[_0x9c22('0x3')](_0x4b2891,'[$or]')?'or':'and';var _0x743a0=_0x4b2891[_0x9c22('0x4')](_0x9c22('0x5'),'')[_0x9c22('0x4')]('[$or]','')['split']('||');for(var _0x45f377=0x0;_0x45f377<_0x743a0[_0x9c22('0x6')];_0x45f377++){var _0x500d90=_0x743a0[_0x45f377]['split'](':=');var _0x122d5a=_0x500d90[0x0];var _0x25a7c9=_0x500d90[_0x9c22('0x7')](0x1);_0x25a7c9[_0x9c22('0x8')](function(_0x53071a){var _0x19256f=_0x53071a['split']('[')[_0x9c22('0x9')]();var _0x28f956=_0x53071a[_0x9c22('0xa')](/\[(.*?)\]/g);_0x28f956[_0x9c22('0x8')](function(_0x445bf4){var _0x2aa9e9=_0x445bf4[_0x9c22('0xb')]('[')['filter'](function(_0x428b49){return _0x428b49['indexOf'](']')>-0x1;})[_0x9c22('0xc')](function(_0x270286){return _0x270286[_0x9c22('0xb')](']')[0x0];})[0x0];_0x3cca08[_0x9c22('0xd')][_0x9c22('0xe')]({'field':_0x122d5a,'operator':_0x19256f,'value':_0x2aa9e9});});});}return _0x3cca08;};exports[_0x9c22('0xf')]=function(_0x26fb56,_0x59cf25,_0x2ec6dd){var _0x39ded5={};if(_0x59cf25===_0x9c22('0x10')){if(_0x2ec6dd['operator']==='$eq'){_0x2ec6dd[_0x9c22('0x11')]=_0x9c22('0x12');_0x2ec6dd[_0x9c22('0x13')]+=','+_0x2ec6dd[_0x9c22('0x13')];}else if(_['includes']([_0x9c22('0x14'),_0x9c22('0x15')],_0x2ec6dd[_0x9c22('0x11')])){_0x2ec6dd[_0x9c22('0x13')]=moment(_0x2ec6dd[_0x9c22('0x13')])['add'](0x1,_0x9c22('0x16'))[_0x9c22('0x17')](_0x9c22('0x18'));}}if(_0x2ec6dd[_0x9c22('0x19')]){_0x59cf25=_0x2ec6dd['castTo'];_0x39ded5[_0x9c22('0x1a')]=_0x9c22('0x1b')+_0x26fb56+'.'+_0x2ec6dd[_0x9c22('0x1c')]+'\x20AS\x20'+_0x2ec6dd['castTo']+')\x20'+parseOperator(_0x2ec6dd[_0x9c22('0x11')]);}else{_0x39ded5['text']=_0x26fb56+'.'+_0x2ec6dd[_0x9c22('0x1c')]+'\x20'+parseOperator(_0x2ec6dd[_0x9c22('0x11')]);}if(_['includes']([_0x9c22('0x1d'),_0x9c22('0x1e')],_0x2ec6dd['operator']))_0x39ded5[_0x9c22('0x1a')]='('+_0x39ded5[_0x9c22('0x1a')]+_0x9c22('0x1f')+_0x26fb56+'.'+_0x2ec6dd['field']+'\x20IS\x20NULL)';_0x39ded5[_0x9c22('0x13')]=parseValue(_0x59cf25,_0x2ec6dd['operator'],_0x2ec6dd[_0x9c22('0x13')]);return _0x39ded5;};function parseOperator(_0x524417){var _0x2814a0;switch(_0x524417){case _0x9c22('0x20'):_0x2814a0=_0x9c22('0x21');break;case _0x9c22('0x1e'):_0x2814a0=_0x9c22('0x22');break;case _0x9c22('0x23'):_0x2814a0=_0x9c22('0x24');break;case _0x9c22('0x1d'):_0x2814a0=_0x9c22('0x25');break;case _0x9c22('0x26'):case _0x9c22('0x27'):case _0x9c22('0x28'):_0x2814a0=_0x9c22('0x29');break;case _0x9c22('0x2a'):_0x2814a0=_0x9c22('0x2b');break;case _0x9c22('0x14'):_0x2814a0=_0x9c22('0x2c');break;case _0x9c22('0x15'):_0x2814a0='<=\x20?';break;case _0x9c22('0x2d'):_0x2814a0=_0x9c22('0x2e');break;case'$between':_0x2814a0=_0x9c22('0x2f');break;}return _0x2814a0;}function parseValue(_0x40ce44,_0x11e046,_0x11fd1e){var _0x4a6e75={'start':undefined,'end':undefined};switch(_0x11e046){case _0x9c22('0x20'):case'$notIn':_0x4a6e75[_0x9c22('0x30')]=_0x11fd1e[_0x9c22('0xb')](',');break;case _0x9c22('0x26'):_0x4a6e75[_0x9c22('0x30')]='%'+_0x11fd1e+'%';break;case'$startsWith':_0x4a6e75[_0x9c22('0x30')]=_0x11fd1e+'%';break;case'$endsWith':_0x4a6e75[_0x9c22('0x30')]='%'+_0x11fd1e;break;case _0x9c22('0x12'):var _0x23cae6=_0x11fd1e[_0x9c22('0xb')](',');var _0x11fd1e=_0x23cae6[_0x9c22('0x9')]();var _0x279f3e=_0x23cae6['pop']();if(_0x40ce44===_0x9c22('0x10')){_0x11fd1e=moment(_0x11fd1e)[_0x9c22('0x31')](0x0,!![])[_0x9c22('0x17')]();_0x279f3e=moment(_0x279f3e)['utcOffset'](0x0,!![])['add'](0x17,_0x9c22('0x32'))[_0x9c22('0x33')](0x3b,_0x9c22('0x34'))['add'](0x3b,_0x9c22('0x35'))[_0x9c22('0x17')]();}_0x4a6e75={'start':_0x11fd1e,'end':_0x279f3e};break;default:_0x4a6e75[_0x9c22('0x30')]=_0x11fd1e;break;}return _0x4a6e75;}
\ No newline at end of file
+var _0x7ad8=['DATE','$eq','$between','includes','$gt','value','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','operator','field','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','utcOffset','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','shift','match','filter','map','push','buildExpression'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7ad8,0x184));var _0x87ad=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x7ad8[_0x8e8ca7];return _0x561381;};'use strict';var _=require(_0x87ad('0x0'));var moment=require(_0x87ad('0x1'));exports[_0x87ad('0x2')]=function(_0x2073a7){var _0x3fc942={'conditions':[]};_0x3fc942[_0x87ad('0x3')]=_[_0x87ad('0x4')](_0x2073a7,_0x87ad('0x5'))?'or':_0x87ad('0x6');var _0x473ad3=_0x2073a7[_0x87ad('0x7')](_0x87ad('0x8'),'')[_0x87ad('0x7')](_0x87ad('0x5'),'')[_0x87ad('0x9')]('||');for(var _0x54c436=0x0;_0x54c436<_0x473ad3['length'];_0x54c436++){var _0x173e3f=_0x473ad3[_0x54c436][_0x87ad('0x9')](':=');var _0x1cced7=_0x173e3f[0x0];var _0x3e6654=_0x173e3f[_0x87ad('0xa')](0x1);_0x3e6654[_0x87ad('0xb')](function(_0x24833d){var _0x4d3897=_0x24833d[_0x87ad('0x9')]('[')[_0x87ad('0xc')]();var _0x51b3f7=_0x24833d[_0x87ad('0xd')](/\[(.*?)\]/g);_0x51b3f7['forEach'](function(_0x4cf51e){var _0x525595=_0x4cf51e[_0x87ad('0x9')]('[')[_0x87ad('0xe')](function(_0xacbe96){return _0xacbe96['indexOf'](']')>-0x1;})[_0x87ad('0xf')](function(_0x3aa2d1){return _0x3aa2d1[_0x87ad('0x9')](']')[0x0];})[0x0];_0x3fc942['conditions'][_0x87ad('0x10')]({'field':_0x1cced7,'operator':_0x4d3897,'value':_0x525595});});});}return _0x3fc942;};exports[_0x87ad('0x11')]=function(_0x3a88f8,_0x491c5e,_0x444015){var _0x242738={};if(_0x491c5e===_0x87ad('0x12')){if(_0x444015['operator']===_0x87ad('0x13')){_0x444015['operator']=_0x87ad('0x14');_0x444015['value']+=','+_0x444015['value'];}else if(_[_0x87ad('0x15')]([_0x87ad('0x16'),'$lte'],_0x444015['operator'])){_0x444015['value']=moment(_0x444015[_0x87ad('0x17')])[_0x87ad('0x18')](0x1,_0x87ad('0x19'))[_0x87ad('0x1a')](_0x87ad('0x1b'));}}if(_0x444015[_0x87ad('0x1c')]){_0x491c5e=_0x444015[_0x87ad('0x1c')];_0x242738[_0x87ad('0x1d')]=_0x87ad('0x1e')+_0x3a88f8+'.'+_0x444015['field']+_0x87ad('0x1f')+_0x444015[_0x87ad('0x1c')]+')\x20'+parseOperator(_0x444015[_0x87ad('0x20')]);}else{_0x242738[_0x87ad('0x1d')]=_0x3a88f8+'.'+_0x444015[_0x87ad('0x21')]+'\x20'+parseOperator(_0x444015[_0x87ad('0x20')]);}if(_[_0x87ad('0x15')]([_0x87ad('0x22'),_0x87ad('0x23')],_0x444015[_0x87ad('0x20')]))_0x242738[_0x87ad('0x1d')]='('+_0x242738[_0x87ad('0x1d')]+'\x20OR\x20'+_0x3a88f8+'.'+_0x444015[_0x87ad('0x21')]+_0x87ad('0x24');_0x242738[_0x87ad('0x17')]=parseValue(_0x491c5e,_0x444015[_0x87ad('0x20')],_0x444015[_0x87ad('0x17')]);return _0x242738;};function parseOperator(_0x5a0f93){var _0x49d6de;switch(_0x5a0f93){case _0x87ad('0x25'):_0x49d6de=_0x87ad('0x26');break;case _0x87ad('0x23'):_0x49d6de=_0x87ad('0x27');break;case'$eq':_0x49d6de=_0x87ad('0x28');break;case'$ne':_0x49d6de=_0x87ad('0x29');break;case _0x87ad('0x2a'):case _0x87ad('0x2b'):case'$endsWith':_0x49d6de=_0x87ad('0x2c');break;case _0x87ad('0x2d'):_0x49d6de='<\x20?';break;case _0x87ad('0x16'):_0x49d6de=_0x87ad('0x2e');break;case _0x87ad('0x2f'):_0x49d6de=_0x87ad('0x30');break;case _0x87ad('0x31'):_0x49d6de=_0x87ad('0x32');break;case'$between':_0x49d6de=_0x87ad('0x33');break;}return _0x49d6de;}function parseValue(_0x35a302,_0x35f945,_0x1e65a5){var _0x1a9c4c={'start':undefined,'end':undefined};switch(_0x35f945){case _0x87ad('0x25'):case _0x87ad('0x23'):_0x1a9c4c[_0x87ad('0x34')]=_0x1e65a5[_0x87ad('0x9')](',');break;case _0x87ad('0x2a'):_0x1a9c4c[_0x87ad('0x34')]='%'+_0x1e65a5+'%';break;case _0x87ad('0x2b'):_0x1a9c4c['start']=_0x1e65a5+'%';break;case _0x87ad('0x35'):_0x1a9c4c['start']='%'+_0x1e65a5;break;case _0x87ad('0x14'):var _0x16404a=_0x1e65a5['split'](',');var _0x1e65a5=_0x16404a[_0x87ad('0xc')]();var _0x1d8cda=_0x16404a[_0x87ad('0x36')]();if(_0x35a302==='DATE'){_0x1e65a5=moment(_0x1e65a5)[_0x87ad('0x37')](0x0,!![])['format']();_0x1d8cda=moment(_0x1d8cda)[_0x87ad('0x37')](0x0,!![])['add'](0x17,_0x87ad('0x38'))['add'](0x3b,'minutes')[_0x87ad('0x18')](0x3b,_0x87ad('0x39'))['format']();}_0x1a9c4c={'start':_0x1e65a5,'end':_0x1d8cda};break;default:_0x1a9c4c['start']=_0x1e65a5;break;}return _0x1a9c4c;}
\ No newline at end of file
index 8b477ef..f134b44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x912f=['ASC','omit','length','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','getFullTextValue','forEach','toString','lodash','sequelize','moment','split','filters','isEmpty','forOwn','find','isPlainObject','parse','format','utc','$lte','subtract','isArray','offset','sort','map','priority','cast','substr','unsigned'];(function(_0x4753b8,_0x3628eb){var _0x5c79f6=function(_0x6b4833){while(--_0x6b4833){_0x4753b8['push'](_0x4753b8['shift']());}};_0x5c79f6(++_0x3628eb);}(_0x912f,0x1d9));var _0xf912=function(_0x1d1681,_0x78ec63){_0x1d1681=_0x1d1681-0x0;var _0x100734=_0x912f[_0x1d1681];return _0x100734;};'use strict';var _=require(_0xf912('0x0'));var sequelize=require(_0xf912('0x1'));var moment=require(_0xf912('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x19c046){var _0x309a02=null;if(_0x19c046){_0x309a02=_0x19c046[_0xf912('0x3')](',');}return _0x309a02;};exports[_0xf912('0x4')]=function(_0x5ce9b5,_0x5d6615){var _0x4e5839={};if(!_[_0xf912('0x5')](_0x5ce9b5)){_[_0xf912('0x6')](_0x5ce9b5,function(_0x5840fc,_0x393532){try{if(_0x5d6615){var _0x3696be=_[_0xf912('0x7')](_0x5d6615,{'name':_0x393532})||{};if(_0x3696be['type']==='DATE'&&_[_0xf912('0x8')](_0x5840fc)){var _0x1fda06=JSON[_0xf912('0x9')](_0x5840fc);var _0x30e483={'$gte':moment(moment(_0x1fda06['$gte'])[_0xf912('0xa')]('YYYY-MM-DD'))[_0xf912('0xb')]()[_0xf912('0xa')](),'$lte':moment(moment(_0x1fda06[_0xf912('0xc')])['format']('YYYY-MM-DD'))['utc']()[_0xf912('0xd')](0x1,'s')[_0xf912('0xa')]()};_0x4e5839[_0x393532]=_0x30e483;}else{_0x4e5839[_0x393532]=_[_0xf912('0xe')](_0x5840fc)?_0x5840fc:JSON[_0xf912('0x9')](_0x5840fc);}}else{_0x4e5839[_0x393532]=_['isArray'](_0x5840fc)?_0x5840fc:JSON[_0xf912('0x9')](_0x5840fc);}}catch(_0x195a5c){_0x4e5839[_0x393532]=_0x5840fc[_0xf912('0x3')](',');}});}return _0x4e5839;};exports['limit']=function(_0x4bfd8c){_0x4bfd8c=parseInt(_0x4bfd8c,0xa);if(!_0x4bfd8c||_0x4bfd8c<0x0){_0x4bfd8c=LIMIT_VALUE;}return _0x4bfd8c;};exports[_0xf912('0xf')]=function(_0x72b137){_0x72b137=parseInt(_0x72b137,0xa);if(!_0x72b137||_0x72b137<0x0){_0x72b137=0x0;}return _0x72b137;};exports[_0xf912('0x10')]=function(_0x68881){var _0x313483,_0x199a62=null;if(_0x68881){_0x313483=_0x68881[_0xf912('0x3')](',');_0x199a62=_[_0xf912('0x11')](_0x313483,function(_0x158826){if(_0x158826['indexOf']('-')===0x0){return[_0x158826===_0xf912('0x12')?sequelize[_0xf912('0x13')](sequelize['col'](_0xf912('0x12')),'unsigned'):_0x158826[_0xf912('0x14')](0x1),'DESC'];}else{return[_0x158826===_0xf912('0x12')?sequelize[_0xf912('0x13')](sequelize['col']('priority'),_0xf912('0x15')):_0x158826,_0xf912('0x16')];}});}return _0x199a62;};exports[_0xf912('0x17')]=function(_0x3f537f,_0xc6423e){if(_['isEmpty'](_0x3f537f)){return _0x3f537f;}if(_[_0xf912('0xe')](_0x3f537f)){for(var _0x35215d=0x0;_0x35215d<_0x3f537f[_0xf912('0x18')];_0x35215d+=0x1){_0x3f537f[_0x35215d]=this[_0xf912('0x17')](_0x3f537f[_0x35215d],_0xc6423e);}return _0x3f537f;}if(!_['isObject'](_0x3f537f)){return _0x3f537f;}if(_['isString'](_0xc6423e)){_0xc6423e=[_0xc6423e];}if(!_['isArray'](_0xc6423e)){return _0x3f537f;}for(var _0x1ce5d2=0x0;_0x1ce5d2<_0xc6423e['length'];_0x1ce5d2+=0x1){_[_0xf912('0x19')](_0x3f537f,_0xc6423e[_0x1ce5d2]);}for(var _0x4fd19f in _0x3f537f){if(_0x3f537f[_0xf912('0x1a')](_0x4fd19f)){_0x3f537f[_0x4fd19f]=this['omit'](_0x3f537f[_0x4fd19f],_0xc6423e);}}return _0x3f537f;};exports[_0xf912('0x1b')]=function(_0x3070fb){return _0x3070fb[_0xf912('0x1c')](RegExp(_0xf912('0x1d')))?!![]:![];};exports['isEmail']=function(_0x48a7f2){return _0x48a7f2[_0xf912('0x1c')](/^\S+@\S+$/)?!![]:![];};exports[_0xf912('0x1e')]=function(_0x24587a){var _0x1a8aef=[];_0x24587a[_0xf912('0x3')]('\x20')[_0xf912('0x1f')](function(_0x4a5004){_0x1a8aef['push']('+'+_0x4a5004[_0xf912('0x20')]()+'*');});return _0x1a8aef['join']('\x20');};
\ No newline at end of file
+var _0xffaa=['unset','hasOwnProperty','isNumeric','^[0-9]*$','isEmail','getFullTextValue','forEach','push','toString','join','lodash','sequelize','moment','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','subtract','limit','offset','sort','map','indexOf','cast','col','priority','unsigned','substr','DESC','ASC','omit','isArray','length'];(function(_0x2ae380,_0x4c7063){var _0x4ece2c=function(_0x2b744e){while(--_0x2b744e){_0x2ae380['push'](_0x2ae380['shift']());}};_0x4ece2c(++_0x4c7063);}(_0xffaa,0x130));var _0xaffa=function(_0x1a092d,_0x5aa939){_0x1a092d=_0x1a092d-0x0;var _0x399d46=_0xffaa[_0x1a092d];return _0x399d46;};'use strict';var _=require(_0xaffa('0x0'));var sequelize=require(_0xaffa('0x1'));var moment=require(_0xaffa('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x5d597a){var _0x124832=null;if(_0x5d597a){_0x124832=_0x5d597a[_0xaffa('0x3')](',');}return _0x124832;};exports[_0xaffa('0x4')]=function(_0xd01185,_0x444eef){var _0x46692a={};if(!_[_0xaffa('0x5')](_0xd01185)){_[_0xaffa('0x6')](_0xd01185,function(_0x4306c0,_0x281191){try{if(_0x444eef){var _0x48320d=_[_0xaffa('0x7')](_0x444eef,{'name':_0x281191})||{};if(_0x48320d[_0xaffa('0x8')]===_0xaffa('0x9')&&_[_0xaffa('0xa')](_0x4306c0)){var _0x5d2ebb=JSON[_0xaffa('0xb')](_0x4306c0);var _0x53c918={'$gte':moment(moment(_0x5d2ebb[_0xaffa('0xc')])[_0xaffa('0xd')](_0xaffa('0xe')))['utc']()[_0xaffa('0xd')](),'$lte':moment(moment(_0x5d2ebb['$lte'])['format']('YYYY-MM-DD'))[_0xaffa('0xf')]()[_0xaffa('0x10')](0x1,'s')[_0xaffa('0xd')]()};_0x46692a[_0x281191]=_0x53c918;}else{_0x46692a[_0x281191]=_['isArray'](_0x4306c0)?_0x4306c0:JSON[_0xaffa('0xb')](_0x4306c0);}}else{_0x46692a[_0x281191]=_['isArray'](_0x4306c0)?_0x4306c0:JSON[_0xaffa('0xb')](_0x4306c0);}}catch(_0x5b238c){_0x46692a[_0x281191]=_0x4306c0[_0xaffa('0x3')](',');}});}return _0x46692a;};exports[_0xaffa('0x11')]=function(_0x255025){_0x255025=parseInt(_0x255025,0xa);if(!_0x255025||_0x255025<0x0){_0x255025=LIMIT_VALUE;}return _0x255025;};exports[_0xaffa('0x12')]=function(_0x14f495){_0x14f495=parseInt(_0x14f495,0xa);if(!_0x14f495||_0x14f495<0x0){_0x14f495=0x0;}return _0x14f495;};exports[_0xaffa('0x13')]=function(_0x11d334){var _0x323a2f,_0x5cc262=null;if(_0x11d334){_0x323a2f=_0x11d334[_0xaffa('0x3')](',');_0x5cc262=_[_0xaffa('0x14')](_0x323a2f,function(_0x4b7d89){if(_0x4b7d89[_0xaffa('0x15')]('-')===0x0){return[_0x4b7d89==='priority'?sequelize[_0xaffa('0x16')](sequelize[_0xaffa('0x17')](_0xaffa('0x18')),_0xaffa('0x19')):_0x4b7d89[_0xaffa('0x1a')](0x1),_0xaffa('0x1b')];}else{return[_0x4b7d89==='priority'?sequelize[_0xaffa('0x16')](sequelize[_0xaffa('0x17')](_0xaffa('0x18')),_0xaffa('0x19')):_0x4b7d89,_0xaffa('0x1c')];}});}return _0x5cc262;};exports[_0xaffa('0x1d')]=function(_0x23e60f,_0x538663){if(_['isEmpty'](_0x23e60f)){return _0x23e60f;}if(_[_0xaffa('0x1e')](_0x23e60f)){for(var _0x256349=0x0;_0x256349<_0x23e60f[_0xaffa('0x1f')];_0x256349+=0x1){_0x23e60f[_0x256349]=this[_0xaffa('0x1d')](_0x23e60f[_0x256349],_0x538663);}return _0x23e60f;}if(!_['isObject'](_0x23e60f)){return _0x23e60f;}if(_['isString'](_0x538663)){_0x538663=[_0x538663];}if(!_[_0xaffa('0x1e')](_0x538663)){return _0x23e60f;}for(var _0x3f7dee=0x0;_0x3f7dee<_0x538663['length'];_0x3f7dee+=0x1){_[_0xaffa('0x20')](_0x23e60f,_0x538663[_0x3f7dee]);}for(var _0x298e2b in _0x23e60f){if(_0x23e60f[_0xaffa('0x21')](_0x298e2b)){_0x23e60f[_0x298e2b]=this[_0xaffa('0x1d')](_0x23e60f[_0x298e2b],_0x538663);}}return _0x23e60f;};exports[_0xaffa('0x22')]=function(_0x2f1320){return _0x2f1320['match'](RegExp(_0xaffa('0x23')))?!![]:![];};exports[_0xaffa('0x24')]=function(_0x4b7994){return _0x4b7994['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xaffa('0x25')]=function(_0x46ac99){var _0x348571=[];_0x46ac99[_0xaffa('0x3')]('\x20')[_0xaffa('0x26')](function(_0x411448){_0x348571[_0xaffa('0x27')]('+'+_0x411448[_0xaffa('0x28')]()+'*');});return _0x348571[_0xaffa('0x29')]('\x20');};
\ No newline at end of file
index 50611d9..1a88c9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf824=['initialize','serve-favicon','method-override','cookie-parser','path','passport','cors','moment','default','get','env','production','appPath','join','root','development','test','use','set','json\x20replacer','toISOString','split','static','/server/views','ejs','renderFile','view\x20engine','html','json','50mb'];(function(_0x5ceb87,_0x1b72e8){var _0x2a654b=function(_0x59cede){while(--_0x59cede){_0x5ceb87['push'](_0x5ceb87['shift']());}};_0x2a654b(++_0x1b72e8);}(_0xf824,0x14b));var _0x4f82=function(_0x40ecd0,_0x27de55){_0x40ecd0=_0x40ecd0-0x0;var _0x5a9953=_0xf824[_0x40ecd0];return _0x5a9953;};'use strict';var express=require('express');var favicon=require(_0x4f82('0x0'));var bodyParser=require('body-parser');var methodOverride=require(_0x4f82('0x1'));var cookieParser=require(_0x4f82('0x2'));var errorHandler=require('errorhandler');var path=require(_0x4f82('0x3'));var passport=require(_0x4f82('0x4'));var cors=require(_0x4f82('0x5'));var moment=require(_0x4f82('0x6'));var config=require('./environment');var db=require('../mysqldb')['db'];exports[_0x4f82('0x7')]=function(_0x1b1991){var _0x520a69=_0x1b1991[_0x4f82('0x8')](_0x4f82('0x9'));if(_0x520a69===_0x4f82('0xa')){_0x1b1991['set'](_0x4f82('0xb'),path[_0x4f82('0xc')](config[_0x4f82('0xd')],'public'));}if(_0x520a69===_0x4f82('0xe')||_0x520a69===_0x4f82('0xf')){_0x1b1991['set'](_0x4f82('0xb'),path['join'](config[_0x4f82('0xd')],'client'));_0x1b1991[_0x4f82('0x10')](errorHandler());}_0x1b1991[_0x4f82('0x11')](_0x4f82('0x12'),function(_0x3c1fdf,_0xc3a9c4){if(this[_0x3c1fdf]instanceof Date){_0xc3a9c4=this[_0x3c1fdf][_0x4f82('0x13')]()[_0x4f82('0x14')]('.')[0x0]+'Z';}return _0xc3a9c4;});_0x1b1991[_0x4f82('0x10')](express[_0x4f82('0x15')](_0x1b1991[_0x4f82('0x8')]('appPath')));_0x1b1991[_0x4f82('0x11')]('views',config[_0x4f82('0xd')]+_0x4f82('0x16'));_0x1b1991['engine']('html',require(_0x4f82('0x17'))[_0x4f82('0x18')]);_0x1b1991[_0x4f82('0x11')](_0x4f82('0x19'),_0x4f82('0x1a'));_0x1b1991[_0x4f82('0x10')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x1b1991[_0x4f82('0x10')](bodyParser[_0x4f82('0x1b')]({'limit':_0x4f82('0x1c')}));_0x1b1991[_0x4f82('0x10')](cors());_0x1b1991[_0x4f82('0x10')](methodOverride());_0x1b1991[_0x4f82('0x10')](cookieParser());_0x1b1991['use'](passport[_0x4f82('0x1d')]());};
\ No newline at end of file
+var _0x100a=['toISOString','split','static','views','engine','html','ejs','view\x20engine','urlencoded','50mb','initialize','express','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','default','get','env','production','set','join','root','public','development','test','appPath','client','use','json\x20replacer'];(function(_0x42baf8,_0x402a8c){var _0x42f10b=function(_0x47e9a9){while(--_0x47e9a9){_0x42baf8['push'](_0x42baf8['shift']());}};_0x42f10b(++_0x402a8c);}(_0x100a,0x13d));var _0xa100=function(_0x3617e2,_0x4e4b18){_0x3617e2=_0x3617e2-0x0;var _0x18220f=_0x100a[_0x3617e2];return _0x18220f;};'use strict';var express=require(_0xa100('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xa100('0x1'));var methodOverride=require(_0xa100('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xa100('0x3'));var path=require(_0xa100('0x4'));var passport=require(_0xa100('0x5'));var cors=require(_0xa100('0x6'));var moment=require(_0xa100('0x7'));var config=require(_0xa100('0x8'));var db=require('../mysqldb')['db'];exports[_0xa100('0x9')]=function(_0x411c93){var _0x52e475=_0x411c93[_0xa100('0xa')](_0xa100('0xb'));if(_0x52e475===_0xa100('0xc')){_0x411c93[_0xa100('0xd')]('appPath',path[_0xa100('0xe')](config[_0xa100('0xf')],_0xa100('0x10')));}if(_0x52e475===_0xa100('0x11')||_0x52e475===_0xa100('0x12')){_0x411c93[_0xa100('0xd')](_0xa100('0x13'),path[_0xa100('0xe')](config[_0xa100('0xf')],_0xa100('0x14')));_0x411c93[_0xa100('0x15')](errorHandler());}_0x411c93['set'](_0xa100('0x16'),function(_0xb9d168,_0x54b569){if(this[_0xb9d168]instanceof Date){_0x54b569=this[_0xb9d168][_0xa100('0x17')]()[_0xa100('0x18')]('.')[0x0]+'Z';}return _0x54b569;});_0x411c93[_0xa100('0x15')](express[_0xa100('0x19')](_0x411c93[_0xa100('0xa')](_0xa100('0x13'))));_0x411c93[_0xa100('0xd')](_0xa100('0x1a'),config[_0xa100('0xf')]+'/server/views');_0x411c93[_0xa100('0x1b')](_0xa100('0x1c'),require(_0xa100('0x1d'))['renderFile']);_0x411c93[_0xa100('0xd')](_0xa100('0x1e'),_0xa100('0x1c'));_0x411c93[_0xa100('0x15')](bodyParser[_0xa100('0x1f')]({'limit':_0xa100('0x20'),'extended':!![]}));_0x411c93[_0xa100('0x15')](bodyParser['json']({'limit':_0xa100('0x20')}));_0x411c93['use'](cors());_0x411c93['use'](methodOverride());_0x411c93[_0xa100('0x15')](cookieParser());_0x411c93['use'](passport[_0xa100('0x21')]());};
\ No newline at end of file
index 06e0fd1..34d6d0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['getFirstInterface','cpus','map','model','createHash','md5','update','hex','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','digest','substring','lodash','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address'];(function(_0x4d0957,_0x524c27){var _0x1299af=function(_0x45c111){while(--_0x45c111){_0x4d0957['push'](_0x4d0957['shift']());}};_0x1299af(++_0x524c27);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe0bd('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xe0bd('0x1'));var exec=require(_0xe0bd('0x2'))['execSync'];function getInterfaces(){var _0x28d5d7=[];var _0x1bb7f7=os[_0xe0bd('0x3')]();var _0x595deb=_[_0xe0bd('0x4')](_[_0xe0bd('0x5')](_0x1bb7f7));for(var _0x17608f=0x0;_0x17608f<_0x595deb[_0xe0bd('0x6')];_0x17608f++){var _0x37289f=_0x1bb7f7[_0x595deb[_0x17608f]][_0xe0bd('0x7')](function(_0x29faee){return _0x29faee[_0xe0bd('0x8')]===_0xe0bd('0x9')&&_0x29faee[_0xe0bd('0xa')]===![];});_0x28d5d7=_0x28d5d7[_0xe0bd('0xb')](_0x37289f);}return _0x28d5d7;}function getFirstInterface(){var _0x3c2ee1=_[_0xe0bd('0xc')](getInterfaces());return{'macAddress':_0x3c2ee1&&_0x3c2ee1['mac']?_0x3c2ee1[_0xe0bd('0xd')]:_0xe0bd('0xe'),'ipAddress':_0x3c2ee1&&_0x3c2ee1['address']?_0x3c2ee1[_0xe0bd('0xf')]:'127.0.0.1'};}exports[_0xe0bd('0x10')]=getFirstInterface;function getCPUhash(){var _0x3b6752=_[_0xe0bd('0x4')](os[_0xe0bd('0x11')]()[_0xe0bd('0x12')](function(_0x16c3a9){return _0x16c3a9[_0xe0bd('0x13')];}))['join'](':');return crypto[_0xe0bd('0x14')](_0xe0bd('0x15'))[_0xe0bd('0x16')](_0x3b6752)['digest'](_0xe0bd('0x17'));}exports['getUuid']=function(){switch(os[_0xe0bd('0x18')]()){case _0xe0bd('0x19'):return exec(_0xe0bd('0x1a'),{'encoding':_0xe0bd('0x1b')})[_0xe0bd('0x1c')]('\x0d\x0a','');default:var _0x302f5f=getFirstInterface();var _0x39e222=getCPUhash();var _0x23e467=_0x39e222+'|'+os['hostname']()+'|'+_0x302f5f['macAddress']+'|'+_0x302f5f[_0xe0bd('0x1d')];var _0xd8746d=crypto[_0xe0bd('0x14')](_0xe0bd('0x15'))[_0xe0bd('0x16')](_0x23e467)[_0xe0bd('0x1e')]('hex');return _0xd8746d['substring'](0x0,0x8)+'-'+_0xd8746d[_0xe0bd('0x1f')](0x8,0xc)+'-'+_0xd8746d[_0xe0bd('0x1f')](0xc,0x10)+'-'+_0xd8746d[_0xe0bd('0x1f')](0x10,0x14)+'-'+_0xd8746d[_0xe0bd('0x1f')](0x14);}};
\ No newline at end of file
+var _0x90b5=['createHash','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','orderBy','length','family','IPv4','internal','concat','head','mac','address','getFirstInterface','cpus','map','join'];(function(_0x36ea12,_0x3bcb0e){var _0x59fb1c=function(_0x3c4d78){while(--_0x3c4d78){_0x36ea12['push'](_0x36ea12['shift']());}};_0x59fb1c(++_0x3bcb0e);}(_0x90b5,0x139));var _0x590b=function(_0x40a20b,_0x45f82d){_0x40a20b=_0x40a20b-0x0;var _0x27897c=_0x90b5[_0x40a20b];return _0x27897c;};'use strict';var _=require(_0x590b('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x590b('0x1'));var exec=require(_0x590b('0x2'))[_0x590b('0x3')];function getInterfaces(){var _0xa7594d=[];var _0x5dd1b2=os['networkInterfaces']();var _0x2318b8=_[_0x590b('0x4')](_['keys'](_0x5dd1b2));for(var _0x208ef2=0x0;_0x208ef2<_0x2318b8[_0x590b('0x5')];_0x208ef2++){var _0x88a5f9=_0x5dd1b2[_0x2318b8[_0x208ef2]]['filter'](function(_0x30bc6e){return _0x30bc6e[_0x590b('0x6')]===_0x590b('0x7')&&_0x30bc6e[_0x590b('0x8')]===![];});_0xa7594d=_0xa7594d[_0x590b('0x9')](_0x88a5f9);}return _0xa7594d;}function getFirstInterface(){var _0x268b0a=_[_0x590b('0xa')](getInterfaces());return{'macAddress':_0x268b0a&&_0x268b0a[_0x590b('0xb')]?_0x268b0a[_0x590b('0xb')]:'00:00:00:00:00:00','ipAddress':_0x268b0a&&_0x268b0a[_0x590b('0xc')]?_0x268b0a[_0x590b('0xc')]:'127.0.0.1'};}exports[_0x590b('0xd')]=getFirstInterface;function getCPUhash(){var _0x4a5939=_[_0x590b('0x4')](os[_0x590b('0xe')]()[_0x590b('0xf')](function(_0x477069){return _0x477069['model'];}))[_0x590b('0x10')](':');return crypto[_0x590b('0x11')](_0x590b('0x12'))[_0x590b('0x13')](_0x4a5939)[_0x590b('0x14')](_0x590b('0x15'));}exports[_0x590b('0x16')]=function(){switch(os[_0x590b('0x17')]()){case _0x590b('0x18'):return exec(_0x590b('0x19'),{'encoding':_0x590b('0x1a')})[_0x590b('0x1b')]('\x0d\x0a','');default:var _0x3e4723=getFirstInterface();var _0x378490=getCPUhash();var _0x3b9601=_0x378490+'|'+os['hostname']()+'|'+_0x3e4723[_0x590b('0x1c')]+'|'+_0x3e4723['ipAddress'];var _0x5c788=crypto[_0x590b('0x11')](_0x590b('0x12'))['update'](_0x3b9601)['digest'](_0x590b('0x15'));return _0x5c788['substring'](0x0,0x8)+'-'+_0x5c788[_0x590b('0x1d')](0x8,0xc)+'-'+_0x5c788[_0x590b('0x1d')](0xc,0x10)+'-'+_0x5c788[_0x590b('0x1d')](0x10,0x14)+'-'+_0x5c788['substring'](0x14);}};
\ No newline at end of file
index 7f12d86..c0a9b68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x073d=['ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','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','diff','days','message','finally','getUuid','License','findOrCreate','spread','error','crypto','moment','request-promise','pkginfo','../../mysqldb','../environment','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','final','base64','||FIELD||VALUE||\x0a','User','admin','fullname','email','|reason|','|machineUuid|','|name|','getFirstInterface'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x073d,0xd2));var _0xd073=function(_0x35c4b6,_0x3f462e){_0x35c4b6=_0x35c4b6-0x0;var _0x444f74=_0x073d[_0x35c4b6];return _0x444f74;};'use strict';var util=require('util');var crypto=require(_0xd073('0x0'));var moment=require(_0xd073('0x1'));var rp=require(_0xd073('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xd073('0x3'))(module,'version');var db=require(_0xd073('0x4'))['db'];var config=require(_0xd073('0x5'));var hardware=require('./hardware');var logger=require(_0xd073('0x6'))(_0xd073('0x7'));var jira=require(_0xd073('0x8'));var HOST=_0xd073('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x2f5792){return new BPromise(function(_0x3541cd,_0x440c91){var _0x409e4a=util[_0xd073('0xa')](_0xd073('0xb'),HOST,_0x2f5792,module[_0xd073('0xc')][_0xd073('0xd')]);if(oldToken){_0x409e4a=util[_0xd073('0xa')](_0xd073('0xe'),HOST,_0x2f5792,module['exports']['version'],oldToken);}var _0xf39d94={'uri':_0x409e4a,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xf39d94)[_0xd073('0xf')](function(_0xf3f0f0){_0x3541cd(_0xf3f0f0);})[_0xd073('0x10')](function(_0x8ec873){_0x440c91(_0x8ec873);});});}function encryptDate(_0x2a3482){var _0x5bb5af=crypto[_0xd073('0x11')](_0xd073('0x12'),config[_0xd073('0x13')][_0xd073('0x14')]);var _0x589073=_0x5bb5af[_0xd073('0x15')](_0x2a3482,_0xd073('0x16'),'base64');_0x589073+=_0x5bb5af[_0xd073('0x17')](_0xd073('0x18'));return _0x589073;}function decryptDate(_0xe3f97){var _0x402b13=crypto['createDecipher'](_0xd073('0x12'),config['secrets']['session']);var _0x195c5d=_0x402b13[_0xd073('0x15')](_0xe3f97,_0xd073('0x18'),'utf8');_0x195c5d+=_0x402b13[_0xd073('0x17')](_0xd073('0x16'));return _0x195c5d;}function sendJiraAlert(_0x2a5c98,_0x51d04b,_0x194db8){var _0x320b48=_0xd073('0x19');return db[_0xd073('0x1a')]['findOne']({'where':{'role':_0xd073('0x1b')},'attributes':[_0xd073('0x1c'),_0xd073('0x1d')],'raw':!![]})['then'](function(_0x1e5145){ADMIN=_0x1e5145;_0x320b48+=_0xd073('0x1e')+_0x194db8+'|\x0a';_0x320b48+='|uuid|'+_0x2a5c98+'|\x0a';_0x320b48+=_0xd073('0x1f')+_0x51d04b+'|\x0a';_0x320b48+=_0xd073('0x20')+ADMIN[_0xd073('0x1c')]+'|\x0a';_0x320b48+='|email|'+ADMIN['email']+'|\x0a';return _0x320b48;})['then'](function(_0x4caa5d){var _0x326bed=hardware[_0xd073('0x21')]()[_0xd073('0x22')];return jira[_0xd073('0x23')]({'key':_0xd073('0x24'),'summary':_0xd073('0x25'),'description':_0x4caa5d,'issuetype':_0xd073('0x26'),'oldToken':_0x2a5c98,'newToken':_0x51d04b,'email':ADMIN[_0xd073('0x1d')],'name':ADMIN[_0xd073('0x1c')],'reason':GRAY_PERIOD_REASON,'ip':_0x326bed});});}function manageLicense(_0x4bc4ad,_0xda2c7d){var _0x5c43f3=_0xda2c7d[_0xd073('0x27')]({'plain':!![]});httpRequest(_0x4bc4ad)[_0xd073('0xf')](function(_0x2ef2e3){if(oldToken){oldToken=undefined;}if(_0x2ef2e3[_0xd073('0x28')]){if(!_0x5c43f3['license']&&_0x5c43f3[_0xd073('0x7')]!=_0x2ef2e3['license']||_0x5c43f3['license']&&_0x5c43f3[_0xd073('0x29')]){logger[_0xd073('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x5c43f3[_0xd073('0x7')]&&!_0x5c43f3['data2']&&_0x5c43f3[_0xd073('0x7')]!=_0x2ef2e3[_0xd073('0x7')]){logger[_0xd073('0x2a')](_0xd073('0x2b'));}if(_0x5c43f3[_0xd073('0x7')]&&!_0x5c43f3[_0xd073('0x29')]&&_0x5c43f3[_0xd073('0x7')]==_0x2ef2e3['license']){return _0xda2c7d;}return _0xda2c7d[_0xd073('0x15')]({'data1':_0x4bc4ad,'data2':null,'license':_0x2ef2e3['license']});}else{if(_0x2ef2e3[_0xd073('0x7')]||_0x5c43f3[_0xd073('0x7')]){if(!_0x5c43f3[_0xd073('0x29')]){if(_0x5c43f3[_0xd073('0x2c')]==_0x4bc4ad){GRAY_PERIOD_REASON=_0xd073('0x2d');logger[_0xd073('0x2a')](_0xd073('0x2e'));}else{GRAY_PERIOD_REASON=_0xd073('0x2f');oldToken=_0x5c43f3[_0xd073('0x2c')];logger[_0xd073('0x2a')](_0xd073('0x30'),_0x5c43f3['data1'],_0x4bc4ad);}sendJiraAlert(_0x5c43f3[_0xd073('0x2c')],_0x2ef2e3['uuid'],GRAY_PERIOD_REASON);logger[_0xd073('0x2a')](_0xd073('0x31'),GRAY_PERIOD_REASON[_0xd073('0x32')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0xda2c7d['update']({'data2':encryptDate(moment()[_0xd073('0xa')](_0xd073('0x33')))});}else{if(moment()[_0xd073('0x34')](decryptDate(_0x5c43f3[_0xd073('0x29')]),_0xd073('0x35'))>DAYS){logger[_0xd073('0x2a')]('DEMO\x20START\x20AT\x20%s',moment()[_0xd073('0xa')](_0xd073('0x33')));return _0xda2c7d['update']({'data1':_0x4bc4ad,'data2':null,'license':null});}}}else{if(_0x5c43f3[_0xd073('0x2c')]!=_0x4bc4ad){logger[_0xd073('0x2a')](_0xd073('0x30'),_0x5c43f3[_0xd073('0x2c')],_0x4bc4ad);return _0xda2c7d[_0xd073('0x15')]({'data1':_0x4bc4ad,'data2':null,'license':null});}}}return _0xda2c7d;})['then'](function(_0x2a18ae){_0xda2c7d=_0x2a18ae;})[_0xd073('0x10')](function(_0x446757){logger['error'](_0x446757[_0xd073('0x36')]);})[_0xd073('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0xd073('0x38')](),_0xda2c7d);},TIME);});}function defaultLicense(){var _0x59a980=hardware[_0xd073('0x38')]();if(_0x59a980){return db[_0xd073('0x39')][_0xd073('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x59a980}})[_0xd073('0x3b')](function(_0xbe12d3,_0x3263f2){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x59a980);manageLicense(_0x59a980,_0xbe12d3);})[_0xd073('0x10')](function(_0x3d7358){logger[_0xd073('0x3c')](_0x3d7358[_0xd073('0x36')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0xd916=['exports','GET','then','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','createDecipher','User','findOne','admin','email','|reason|','|uuid|','|machineUuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','Motion\x20License\x20Alert','Alert','active','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','error','message','finally','getUuid','License','spread','util','crypto','moment','request-promise','bluebird','version','../../mysqldb','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd916,0x18a));var _0x6d91=function(_0xa87db6,_0x7fb711){_0xa87db6=_0xa87db6-0x0;var _0x48ae12=_0xd916[_0xa87db6];return _0x48ae12;};'use strict';var util=require(_0x6d91('0x0'));var crypto=require(_0x6d91('0x1'));var moment=require(_0x6d91('0x2'));var rp=require(_0x6d91('0x3'));var BPromise=require(_0x6d91('0x4'));var pkginfo=require('pkginfo')(module,_0x6d91('0x5'));var db=require(_0x6d91('0x6'))['db'];var config=require('../environment');var hardware=require('./hardware');var logger=require(_0x6d91('0x7'))(_0x6d91('0x8'));var jira=require('../../api/jira/jira.controller');var HOST=_0x6d91('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3fcd82){return new BPromise(function(_0x1fd876,_0x418357){var _0x3b7135=util[_0x6d91('0xa')](_0x6d91('0xb'),HOST,_0x3fcd82,module['exports']['version']);if(oldToken){_0x3b7135=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x3fcd82,module[_0x6d91('0xc')][_0x6d91('0x5')],oldToken);}var _0x2e2cdd={'uri':_0x3b7135,'method':_0x6d91('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x2e2cdd)[_0x6d91('0xe')](function(_0x540ddd){_0x1fd876(_0x540ddd);})[_0x6d91('0xf')](function(_0x25d942){_0x418357(_0x25d942);});});}function encryptDate(_0x342f93){var _0x218c03=crypto[_0x6d91('0x10')](_0x6d91('0x11'),config[_0x6d91('0x12')][_0x6d91('0x13')]);var _0x12cc2b=_0x218c03[_0x6d91('0x14')](_0x342f93,_0x6d91('0x15'),_0x6d91('0x16'));_0x12cc2b+=_0x218c03[_0x6d91('0x17')](_0x6d91('0x16'));return _0x12cc2b;}function decryptDate(_0x2bde07){var _0x4d9a21=crypto[_0x6d91('0x18')](_0x6d91('0x11'),config[_0x6d91('0x12')][_0x6d91('0x13')]);var _0x3602f3=_0x4d9a21[_0x6d91('0x14')](_0x2bde07,'base64',_0x6d91('0x15'));_0x3602f3+=_0x4d9a21['final']('utf8');return _0x3602f3;}function sendJiraAlert(_0x349249,_0x47d359,_0xa8cc9){var _0x535f4c='||FIELD||VALUE||\x0a';return db[_0x6d91('0x19')][_0x6d91('0x1a')]({'where':{'role':_0x6d91('0x1b')},'attributes':['fullname',_0x6d91('0x1c')],'raw':!![]})[_0x6d91('0xe')](function(_0x42e064){ADMIN=_0x42e064;_0x535f4c+=_0x6d91('0x1d')+_0xa8cc9+'|\x0a';_0x535f4c+=_0x6d91('0x1e')+_0x349249+'|\x0a';_0x535f4c+=_0x6d91('0x1f')+_0x47d359+'|\x0a';_0x535f4c+=_0x6d91('0x20')+ADMIN[_0x6d91('0x21')]+'|\x0a';_0x535f4c+=_0x6d91('0x22')+ADMIN[_0x6d91('0x1c')]+'|\x0a';return _0x535f4c;})[_0x6d91('0xe')](function(_0x91ab12){var _0x58e917=hardware[_0x6d91('0x23')]()[_0x6d91('0x24')];return jira[_0x6d91('0x25')]({'key':'MOTLICENSE','summary':_0x6d91('0x26'),'description':_0x91ab12,'issuetype':_0x6d91('0x27'),'oldToken':_0x349249,'newToken':_0x47d359,'email':ADMIN['email'],'name':ADMIN[_0x6d91('0x21')],'reason':GRAY_PERIOD_REASON,'ip':_0x58e917});});}function manageLicense(_0x72505e,_0x3ed163){var _0x1269f4=_0x3ed163['get']({'plain':!![]});httpRequest(_0x72505e)[_0x6d91('0xe')](function(_0x45388a){if(oldToken){oldToken=undefined;}if(_0x45388a[_0x6d91('0x28')]){if(!_0x1269f4['license']&&_0x1269f4[_0x6d91('0x8')]!=_0x45388a[_0x6d91('0x8')]||_0x1269f4[_0x6d91('0x8')]&&_0x1269f4[_0x6d91('0x29')]){logger['info'](_0x6d91('0x2a'));}if(_0x1269f4[_0x6d91('0x8')]&&!_0x1269f4[_0x6d91('0x29')]&&_0x1269f4['license']!=_0x45388a[_0x6d91('0x8')]){logger[_0x6d91('0x2b')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x1269f4[_0x6d91('0x8')]&&!_0x1269f4['data2']&&_0x1269f4['license']==_0x45388a['license']){return _0x3ed163;}return _0x3ed163[_0x6d91('0x14')]({'data1':_0x72505e,'data2':null,'license':_0x45388a[_0x6d91('0x8')]});}else{if(_0x45388a[_0x6d91('0x8')]||_0x1269f4[_0x6d91('0x8')]){if(!_0x1269f4[_0x6d91('0x29')]){if(_0x1269f4[_0x6d91('0x2c')]==_0x72505e){GRAY_PERIOD_REASON=_0x6d91('0x2d');logger[_0x6d91('0x2b')](_0x6d91('0x2e'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x1269f4[_0x6d91('0x2c')];logger[_0x6d91('0x2b')](_0x6d91('0x2f'),_0x1269f4['data1'],_0x72505e);}sendJiraAlert(_0x1269f4[_0x6d91('0x2c')],_0x45388a['uuid'],GRAY_PERIOD_REASON);logger[_0x6d91('0x2b')](_0x6d91('0x30'),GRAY_PERIOD_REASON[_0x6d91('0x31')](),moment()[_0x6d91('0xa')](_0x6d91('0x32')));return _0x3ed163[_0x6d91('0x14')]({'data2':encryptDate(moment()[_0x6d91('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x6d91('0x33')](decryptDate(_0x1269f4['data2']),'days')>DAYS){logger[_0x6d91('0x2b')]('DEMO\x20START\x20AT\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x3ed163['update']({'data1':_0x72505e,'data2':null,'license':null});}}}else{if(_0x1269f4[_0x6d91('0x2c')]!=_0x72505e){logger[_0x6d91('0x2b')](_0x6d91('0x2f'),_0x1269f4['data1'],_0x72505e);return _0x3ed163[_0x6d91('0x14')]({'data1':_0x72505e,'data2':null,'license':null});}}}return _0x3ed163;})[_0x6d91('0xe')](function(_0x345f6c){_0x3ed163=_0x345f6c;})[_0x6d91('0xf')](function(_0x5e8637){logger[_0x6d91('0x34')](_0x5e8637[_0x6d91('0x35')]);})[_0x6d91('0x36')](function(){setTimeout(function(){manageLicense(hardware[_0x6d91('0x37')](),_0x3ed163);},TIME);});}function defaultLicense(){var _0x9d889=hardware[_0x6d91('0x37')]();if(_0x9d889){return db[_0x6d91('0x38')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x9d889}})[_0x6d91('0x39')](function(_0x5f2080,_0x5281d6){logger[_0x6d91('0x2b')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x9d889);manageLicense(_0x9d889,_0x5f2080);})[_0x6d91('0xf')](function(_0x3c0b2b){logger['error'](_0x3c0b2b[_0x6d91('0x35')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
index eaee382..19d1f9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeea=['data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','secrets','session','final','gray','deadline','add','grayReason','uuid','machineUuid','changed','disabled','Breaking\x20license','message','2027-01-01T00:00:00.000Z','Demo\x20license','data1','getUuid','then','checkLicense','crypto','lodash','moment','./hardware','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found'];(function(_0x2e34f8,_0x53a191){var _0x2b147a=function(_0x10003c){while(--_0x10003c){_0x2e34f8['push'](_0x2e34f8['shift']());}};_0x2b147a(++_0x53a191);}(_0xbeea,0xb1));var _0xabee=function(_0x23cc28,_0x357303){_0x23cc28=_0x23cc28-0x0;var _0x31402c=_0xbeea[_0x23cc28];return _0x31402c;};'use strict';var crypto=require(_0xabee('0x0'));var util=require('util');var _=require(_0xabee('0x1'));var moment=require(_0xabee('0x2'));var hardware=require(_0xabee('0x3'));var config=require('../environment');var db=require(_0xabee('0x4'))['db'];function checkLicense(_0x59e264,_0x58afa7){if(_0x59e264){try{var _0x33571e=_0x58afa7||_0x59e264[_0xabee('0x5')];if(_[_0xabee('0x6')](_0x33571e)){throw new Error(_0xabee('0x7'));}var _0x58c9ef=_0x59e264['data1'];var _0x238317=_0x59e264[_0xabee('0x8')];var _0x4a2999=_0x58c9ef[_0xabee('0x9')]('-')[0x4];var _0x507deb=_0x58c9ef[_0xabee('0x9')]('-')[0x0];var _0x11da39=crypto[_0xabee('0xa')](_0xabee('0xb'),util[_0xabee('0xc')](_0xabee('0xd'),_0x4a2999,_0x58c9ef,_0x507deb));var _0x58c43c=_0x11da39[_0xabee('0xe')](_0x33571e,_0xabee('0xf'),_0xabee('0x10'));_0x58c43c+=_0x11da39['final'](_0xabee('0x10'));var _0x168202=JSON[_0xabee('0x11')](_0x58c43c);_0x168202['demo']=![];_0x168202['uuid']=_0x58c9ef;_0x168202['machineUuid']=hardware['getUuid']();if(_0x238317){var _0x57abc2=crypto[_0xabee('0xa')](_0xabee('0xb'),config[_0xabee('0x12')][_0xabee('0x13')]);var _0x38cf66=_0x57abc2['update'](_0x238317,_0xabee('0xf'),_0xabee('0x10'));_0x38cf66+=_0x57abc2[_0xabee('0x14')](_0xabee('0x10'));_0x168202[_0xabee('0x15')]=_0x38cf66;_0x168202[_0xabee('0x16')]=moment(_0x38cf66)[_0xabee('0x17')](0x7,'days')[_0xabee('0xc')]();_0x168202[_0xabee('0x18')]=_0x168202[_0xabee('0x19')]!=_0x168202[_0xabee('0x1a')]?_0xabee('0x1b'):_0xabee('0x1c');}return _0x168202;}catch(_0x4797e9){return{'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':_0xabee('0x1d'),'uuid':_0x59e264['data1'],'machineUuid':hardware['getUuid'](),'message':_0x4797e9[_0xabee('0x1e')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xabee('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xabee('0x20'),'uuid':_0x59e264[_0xabee('0x21')],'machineUuid':hardware[_0xabee('0x22')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports['getLicense']=function(_0x37d2bf){return db['License']['find'](_['defaults'](_0x37d2bf,{'raw':!![],'where':{'id':0x1}}))[_0xabee('0x23')](function(_0x51082a){return checkLicense(_0x51082a,null);});};exports[_0xabee('0x24')]=checkLicense;
\ No newline at end of file
+var _0x0f3c=['../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','demo','uuid','getUuid','secrets','session','update','gray','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','License','defaults','then','crypto','util','../environment'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x0f3c,0x189));var _0xc0f3=function(_0x2d1f62,_0x2ec382){_0x2d1f62=_0x2d1f62-0x0;var _0x3ea32b=_0x0f3c[_0x2d1f62];return _0x3ea32b;};'use strict';var crypto=require(_0xc0f3('0x0'));var util=require(_0xc0f3('0x1'));var _=require('lodash');var moment=require('moment');var hardware=require('./hardware');var config=require(_0xc0f3('0x2'));var db=require(_0xc0f3('0x3'))['db'];function checkLicense(_0xa6a874,_0x2d1f5d){if(_0xa6a874){try{var _0x1be43d=_0x2d1f5d||_0xa6a874[_0xc0f3('0x4')];if(_[_0xc0f3('0x5')](_0x1be43d)){throw new Error(_0xc0f3('0x6'));}var _0x4b76a0=_0xa6a874[_0xc0f3('0x7')];var _0x2c517e=_0xa6a874['data2'];var _0x435864=_0x4b76a0[_0xc0f3('0x8')]('-')[0x4];var _0x5dd244=_0x4b76a0[_0xc0f3('0x8')]('-')[0x0];var _0x31ddbe=crypto[_0xc0f3('0x9')](_0xc0f3('0xa'),util[_0xc0f3('0xb')](_0xc0f3('0xc'),_0x435864,_0x4b76a0,_0x5dd244));var _0x232e04=_0x31ddbe['update'](_0x1be43d,_0xc0f3('0xd'),_0xc0f3('0xe'));_0x232e04+=_0x31ddbe[_0xc0f3('0xf')]('utf8');var _0x6bb993=JSON[_0xc0f3('0x10')](_0x232e04);_0x6bb993[_0xc0f3('0x11')]=![];_0x6bb993[_0xc0f3('0x12')]=_0x4b76a0;_0x6bb993['machineUuid']=hardware[_0xc0f3('0x13')]();if(_0x2c517e){var _0x165e13=crypto[_0xc0f3('0x9')](_0xc0f3('0xa'),config[_0xc0f3('0x14')][_0xc0f3('0x15')]);var _0x311731=_0x165e13[_0xc0f3('0x16')](_0x2c517e,_0xc0f3('0xd'),_0xc0f3('0xe'));_0x311731+=_0x165e13[_0xc0f3('0xf')](_0xc0f3('0xe'));_0x6bb993[_0xc0f3('0x17')]=_0x311731;_0x6bb993['deadline']=moment(_0x311731)[_0xc0f3('0x18')](0x7,_0xc0f3('0x19'))[_0xc0f3('0xb')]();_0x6bb993[_0xc0f3('0x1a')]=_0x6bb993[_0xc0f3('0x12')]!=_0x6bb993['machineUuid']?_0xc0f3('0x1b'):_0xc0f3('0x1c');}return _0x6bb993;}catch(_0x2f107b){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc0f3('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc0f3('0x1e'),'uuid':_0xa6a874[_0xc0f3('0x7')],'machineUuid':hardware['getUuid'](),'message':_0x2f107b[_0xc0f3('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'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':_0xc0f3('0x20'),'uuid':_0xa6a874[_0xc0f3('0x7')],'machineUuid':hardware[_0xc0f3('0x13')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports['getLicense']=function(_0x37a752){return db[_0xc0f3('0x21')]['find'](_[_0xc0f3('0x22')](_0x37a752,{'raw':!![],'where':{'id':0x1}}))[_0xc0f3('0x23')](function(_0x2c32ab){return checkLicense(_0x2c32ab,null);});};exports['checkLicense']=checkLicense;
\ No newline at end of file
index da48e51..aaf8d59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa810=['secret','exports','myappanuglar-secret','app-id'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa810,0x101));var _0x0a81=function(_0x4e0b8c,_0x443f31){_0x4e0b8c=_0x4e0b8c-0x0;var _0x633ecc=_0xa810[_0x4e0b8c];return _0x633ecc;};'use strict';module[_0x0a81('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x0a81('0x1'),'GOOGLE_ID':_0x0a81('0x2'),'GOOGLE_SECRET':_0x0a81('0x3'),'DEBUG':''};
\ No newline at end of file
+var _0xc4be=['myappanuglar-secret','app-id','secret','exports'];(function(_0x497b32,_0x159015){var _0x4c9d3b=function(_0x24dd7d){while(--_0x24dd7d){_0x497b32['push'](_0x497b32['shift']());}};_0x4c9d3b(++_0x159015);}(_0xc4be,0x1bb));var _0xec4b=function(_0x20b67d,_0x4a8505){_0x20b67d=_0x20b67d-0x0;var _0x4dfe4c=_0xc4be[_0x20b67d];return _0x4dfe4c;};'use strict';module[_0xec4b('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xec4b('0x1'),'GOOGLE_ID':_0xec4b('0x2'),'GOOGLE_SECRET':_0xec4b('0x3'),'DEBUG':''};
\ No newline at end of file
index fda606b..3b27b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa35c=['Logger','transports','%s-%s','error','File','info','moment','winston','util','path','INFO','join','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','message','exports'];(function(_0x21d125,_0x56f7a3){var _0x394380=function(_0x115e52){while(--_0x115e52){_0x21d125['push'](_0x21d125['shift']());}};_0x394380(++_0x56f7a3);}(_0xa35c,0x99));var _0xca35=function(_0x21c394,_0x833512){_0x21c394=_0x21c394-0x0;var _0x5ecc98=_0xa35c[_0x21c394];return _0x5ecc98;};'use strict';var moment=require(_0xca35('0x0'));var winston=require(_0xca35('0x1'));var util=require(_0xca35('0x2'));var path=require(_0xca35('0x3'));var debugLevel=_0xca35('0x4');function filename(_0xc2c9fe,_0x4488bf){return path[_0xca35('0x5')]('/var',_0xca35('0x6'),_0xca35('0x7'),util[_0xca35('0x8')](_0xca35('0x9'),_0xc2c9fe,_0x4488bf));}function formatter(_0x438b60,_0x4a2130){return util[_0xca35('0x8')](_0xca35('0xa'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x4a2130[_0xca35('0xb')][_0xca35('0xc')](),_0x438b60,_0x4a2130[_0xca35('0xd')]);}module[_0xca35('0xe')]=function(_0x30e866){return new winston[(_0xca35('0xf'))]({'transports':[new winston[(_0xca35('0x10'))]['File']({'name':util[_0xca35('0x8')](_0xca35('0x11'),_0x30e866,_0xca35('0x12')),'filename':filename(_0x30e866,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x184c74){return formatter(_0x30e866,_0x184c74);}}),new winston['transports'][(_0xca35('0x13'))]({'name':util[_0xca35('0x8')](_0xca35('0x11'),_0x30e866,_0xca35('0x14')),'filename':filename(_0x30e866,_0xca35('0x14')),'level':_0xca35('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x20100e){return formatter(_0x30e866,_0x20100e);}}),new winston[(_0xca35('0x10'))]['Console']({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x5a5fb5){return formatter(_0x30e866,_0x5a5fb5);}})]});};
\ No newline at end of file
+var _0x3be5=['toUpperCase','message','Logger','File','error','transports','%s-%s','info','debugLevel','util','INFO','join','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x8585ff,_0x9232d){var _0x3ff111=function(_0x1c40bc){while(--_0x1c40bc){_0x8585ff['push'](_0x8585ff['shift']());}};_0x3ff111(++_0x9232d);}(_0x3be5,0xed));var _0x53be=function(_0x54d862,_0xc76627){_0x54d862=_0x54d862-0x0;var _0x96263=_0x3be5[_0x54d862];return _0x96263;};'use strict';var moment=require('moment');var winston=require('winston');var util=require(_0x53be('0x0'));var path=require('path');var debugLevel=_0x53be('0x1');function filename(_0xf605a3,_0x168e07){return path[_0x53be('0x2')](_0x53be('0x3'),_0x53be('0x4'),_0x53be('0x5'),util[_0x53be('0x6')](_0x53be('0x7'),_0xf605a3,_0x168e07));}function formatter(_0x2a7c9d,_0x3a9830){return util['format'](_0x53be('0x8'),moment()[_0x53be('0x6')](_0x53be('0x9')),_0x3a9830['level'][_0x53be('0xa')](),_0x2a7c9d,_0x3a9830[_0x53be('0xb')]);}module['exports']=function(_0x2d0d96){return new winston[(_0x53be('0xc'))]({'transports':[new winston['transports'][(_0x53be('0xd'))]({'name':util[_0x53be('0x6')]('%s-%s',_0x2d0d96,'error'),'filename':filename(_0x2d0d96,_0x53be('0xe')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26e936){return formatter(_0x2d0d96,_0x26e936);}}),new winston[(_0x53be('0xf'))][(_0x53be('0xd'))]({'name':util[_0x53be('0x6')](_0x53be('0x10'),_0x2d0d96,_0x53be('0x11')),'filename':filename(_0x2d0d96,_0x53be('0x11')),'level':_0x53be('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3600fb){return formatter(_0x2d0d96,_0x3600fb);}}),new winston[(_0x53be('0xf'))]['Console']({'level':process['env'][_0x53be('0x12')]||debugLevel,'json':![],'formatter':function(_0x1719b1){return formatter(_0x2d0d96,_0x1719b1);}})]});};
\ No newline at end of file
index 242fedf..41d7de8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb555=['agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','../../services/ami/index.js'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb555,0xe5));var _0x5b55=function(_0x28dd28,_0x369ecb){_0x28dd28=_0x28dd28-0x0;var _0x5c3ab4=_0xb555[_0x28dd28];return _0x5c3ab4;};'use strict';var path=require(_0x5b55('0x0'));var os=require('os');var config={'apps':[{'name':_0x5b55('0x1'),'script':path[_0x5b55('0x2')](__dirname,_0x5b55('0x3'))},{'name':'ami','script':path[_0x5b55('0x2')](__dirname,_0x5b55('0x4'))},{'name':_0x5b55('0x5'),'script':path[_0x5b55('0x2')](__dirname,_0x5b55('0x6'))},{'name':_0x5b55('0x7'),'script':path[_0x5b55('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x5b55('0x8'),'script':path[_0x5b55('0x2')](__dirname,_0x5b55('0x9'))},{'name':_0x5b55('0xa'),'script':path[_0x5b55('0x2')](__dirname,_0x5b55('0xb'))}]};module[_0x5b55('0xc')]=config;
\ No newline at end of file
+var _0x92bc=['join','../../services/ami/index.js','agi','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express'];(function(_0x4102a1,_0x2baefd){var _0x443434=function(_0x28591c){while(--_0x28591c){_0x4102a1['push'](_0x4102a1['shift']());}};_0x443434(++_0x2baefd);}(_0x92bc,0x106));var _0xc92b=function(_0x5dcbbb,_0x32b3b2){_0x5dcbbb=_0x5dcbbb-0x0;var _0x3f4e24=_0x92bc[_0x5dcbbb];return _0x3f4e24;};'use strict';var path=require(_0xc92b('0x0'));var os=require('os');var config={'apps':[{'name':_0xc92b('0x1'),'script':path[_0xc92b('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xc92b('0x2')](__dirname,_0xc92b('0x3'))},{'name':_0xc92b('0x4'),'script':path[_0xc92b('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0xc92b('0x5'),'script':path[_0xc92b('0x2')](__dirname,_0xc92b('0x6'))},{'name':'routing','script':path['join'](__dirname,_0xc92b('0x7'))},{'name':_0xc92b('0x8'),'script':path['join'](__dirname,_0xc92b('0x9'))}]};module[_0xc92b('0xa')]=config;
\ No newline at end of file
index e3a5cef..594afa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc063=['pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x5314cb,_0x223ede){var _0x9bf3af=function(_0xc612bf){while(--_0xc612bf){_0x5314cb['push'](_0x5314cb['shift']());}};_0x9bf3af(++_0x223ede);}(_0xc063,0xb6));var _0x3c06=function(_0x37fa4f,_0x379eb2){_0x37fa4f=_0x37fa4f-0x0;var _0x17133f=_0xc063[_0x37fa4f];return _0x17133f;};'use strict';var pm2=require(_0x3c06('0x0'));var BPromise=require(_0x3c06('0x1'));var config=require(_0x3c06('0x2'));function connect(){return new BPromise(function(_0x3c46e7,_0x54585c){return pm2[_0x3c06('0x3')](function(_0x112e98){if(_0x112e98){return _0x54585c(_0x112e98);}return _0x3c46e7(_0x3c06('0x4'));});});};exports[_0x3c06('0x5')]=function(_0x4613c7){return connect()[_0x3c06('0x6')](function(){return new BPromise(function(_0x65ea0d,_0x1df708){return pm2[_0x3c06('0x5')](_0x4613c7,function(_0x4fb041,_0x28db81){if(_0x4fb041){return _0x1df708(_0x4fb041);}pm2[_0x3c06('0x7')]();return _0x65ea0d(_0x28db81);});});});};exports[_0x3c06('0x8')]=function(_0x566fde){return connect()['then'](function(){return new BPromise(function(_0x604ce7,_0x55ece1){return pm2[_0x3c06('0x8')](_0x566fde,function(_0x1c68a8,_0x40a9d0){if(_0x1c68a8){return _0x55ece1(_0x1c68a8);}pm2['disconnect']();return _0x604ce7(_0x40a9d0);});});});};exports['restart']=function(_0x3c7a5a){return connect()['then'](function(){return new BPromise(function(_0x1311d7,_0x19a48c){return pm2[_0x3c06('0x9')](_0x3c7a5a,function(_0x590b3e,_0x7a76a3){if(_0x590b3e){return _0x19a48c(_0x590b3e);}pm2[_0x3c06('0x7')]();return _0x1311d7(_0x7a76a3);});});});};exports[_0x3c06('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x18d4cf,_0x525701){return pm2[_0x3c06('0xa')](function(_0x16a081,_0x29e765){if(_0x16a081){return _0x525701(_0x16a081);}pm2[_0x3c06('0x7')]();return _0x18d4cf(_0x29e765);});});});};exports[_0x3c06('0xb')]=function(_0x2ccb61){return connect()['then'](function(){return new BPromise(function(_0x19df63,_0x4bc79a){return pm2[_0x3c06('0xb')](_0x2ccb61,function(_0x2a7da8,_0x448033){if(_0x2a7da8){return _0x4bc79a(_0x2a7da8);}pm2[_0x3c06('0x7')]();return _0x19df63(_0x448033);});});});};exports[_0x3c06('0xc')]=function(_0x293916){return connect()[_0x3c06('0x6')](function(){return new BPromise(function(_0x4bc871,_0x4f9666){return pm2[_0x3c06('0xc')](_0x293916,function(_0x49e7b3,_0xbc8fdb){if(_0x49e7b3){return _0x4f9666(_0x49e7b3);}pm2[_0x3c06('0x7')]();return _0x4bc871(_0xbc8fdb);});});});};exports[_0x3c06('0xd')]=function(){return connect()[_0x3c06('0x6')](function(){return new BPromise(function(_0x2cbbd2,_0x472004){return pm2[_0x3c06('0xd')](function(_0x7b9d33){if(_0x7b9d33){return _0x472004(_0x7b9d33);}return _0x2cbbd2('saved');});});});};
\ No newline at end of file
+var _0xee14=['dump','saved','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x509b2a,_0xf91802){var _0x59ff9e=function(_0x5af97a){while(--_0x5af97a){_0x509b2a['push'](_0x509b2a['shift']());}};_0x59ff9e(++_0xf91802);}(_0xee14,0x13a));var _0x4ee1=function(_0x20f6ea,_0x2bb61d){_0x20f6ea=_0x20f6ea-0x0;var _0x5d7e8c=_0xee14[_0x20f6ea];return _0x5d7e8c;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x4ee1('0x0'));function connect(){return new BPromise(function(_0x674696,_0x34e49d){return pm2[_0x4ee1('0x1')](function(_0x18e3c4){if(_0x18e3c4){return _0x34e49d(_0x18e3c4);}return _0x674696(_0x4ee1('0x2'));});});};exports[_0x4ee1('0x3')]=function(_0x1e5fb6){return connect()[_0x4ee1('0x4')](function(){return new BPromise(function(_0x4bc729,_0xba6d36){return pm2['start'](_0x1e5fb6,function(_0x327c18,_0x3a45a3){if(_0x327c18){return _0xba6d36(_0x327c18);}pm2[_0x4ee1('0x5')]();return _0x4bc729(_0x3a45a3);});});});};exports[_0x4ee1('0x6')]=function(_0xdfe9c1){return connect()[_0x4ee1('0x4')](function(){return new BPromise(function(_0x58a32f,_0x33dbe6){return pm2[_0x4ee1('0x6')](_0xdfe9c1,function(_0x4e88e8,_0x3fa61b){if(_0x4e88e8){return _0x33dbe6(_0x4e88e8);}pm2[_0x4ee1('0x5')]();return _0x58a32f(_0x3fa61b);});});});};exports[_0x4ee1('0x7')]=function(_0x191da7){return connect()['then'](function(){return new BPromise(function(_0x1b3737,_0x22b251){return pm2[_0x4ee1('0x7')](_0x191da7,function(_0x2d5d3c,_0x2f864e){if(_0x2d5d3c){return _0x22b251(_0x2d5d3c);}pm2[_0x4ee1('0x5')]();return _0x1b3737(_0x2f864e);});});});};exports['list']=function(){return connect()[_0x4ee1('0x4')](function(){return new BPromise(function(_0x461f99,_0x1096a5){return pm2[_0x4ee1('0x8')](function(_0x46d2c2,_0x1c342a){if(_0x46d2c2){return _0x1096a5(_0x46d2c2);}pm2[_0x4ee1('0x5')]();return _0x461f99(_0x1c342a);});});});};exports[_0x4ee1('0x9')]=function(_0xb7eafd){return connect()['then'](function(){return new BPromise(function(_0x2f9194,_0x38008f){return pm2[_0x4ee1('0x9')](_0xb7eafd,function(_0x1b1e0e,_0x123c5e){if(_0x1b1e0e){return _0x38008f(_0x1b1e0e);}pm2[_0x4ee1('0x5')]();return _0x2f9194(_0x123c5e);});});});};exports[_0x4ee1('0xa')]=function(_0x2b8f0e){return connect()[_0x4ee1('0x4')](function(){return new BPromise(function(_0x3a0967,_0x274de5){return pm2['delete'](_0x2b8f0e,function(_0x236215,_0x3db827){if(_0x236215){return _0x274de5(_0x236215);}pm2[_0x4ee1('0x5')]();return _0x3a0967(_0x3db827);});});});};exports[_0x4ee1('0xb')]=function(){return connect()[_0x4ee1('0x4')](function(){return new BPromise(function(_0x383ab0,_0x48a959){return pm2[_0x4ee1('0xb')](function(_0x333e96){if(_0x333e96){return _0x48a959(_0x333e96);}return _0x383ab0(_0x4ee1('0xc'));});});});};
\ No newline at end of file
index 2984545..64e0ac5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dee=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','Setting','findAll','lastMsgAt','subtract','chatTimeout','minutes','then','ChatInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','lodash','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5dee,0x11c));var _0xe5de=function(_0x3d4e02,_0x2bfab8){_0x3d4e02=_0x3d4e02-0x0;var _0x53abaa=_0x5dee[_0x3d4e02];return _0x53abaa;};'use strict';var _=require(_0xe5de('0x0'));var moment=require('moment');var Redis=require(_0xe5de('0x1'));var db=require(_0xe5de('0x2'))['db'];var config=require('../../config/environment');config[_0xe5de('0x3')]=_[_0xe5de('0x4')](config['redis'],{'host':_0xe5de('0x5'),'port':0x18eb});var io=require(_0xe5de('0x6'))(new Redis(config[_0xe5de('0x3')]));function closeInteractions(){var _0x5e11ca=0x0;var _0x4159b5=[];return db[_0xe5de('0x7')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0xf59613){_0x5e11ca=_0xf59613['chatTimeout'];if(_0x5e11ca){return db['ChatInteraction'][_0xe5de('0x8')]({'raw':!![],'attributes':['id',_0xe5de('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe5de('0xa')](_0xf59613[_0xe5de('0xb')],_0xe5de('0xc'))}}});}else{return[];}})[_0xe5de('0xd')](function(_0x544422){_0x4159b5=_0x544422;if(_0x5e11ca){return db[_0xe5de('0xe')][_0xe5de('0xf')]({'closeReason':_0xe5de('0x10'),'disposition':_0xe5de('0x11'),'closed':!![],'closedAt':moment()['format'](_0xe5de('0x12'))},{'where':{'id':_[_0xe5de('0x13')](_0x4159b5||[],'id')}});}})[_0xe5de('0xd')](function(_0x554b11){for(var _0x78a175=0x0;_0x78a175<_0x4159b5[_0xe5de('0x14')];_0x78a175++){io[_0xe5de('0x15')](_0xe5de('0x16'),{'id':_0x4159b5[_0x78a175]['id'],'closed':!![]});}})[_0xe5de('0x17')](function(_0x394c41){console[_0xe5de('0x18')](_0x394c41);});}exports[_0xe5de('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x0b40=['error','start','lodash','moment','ioredis','../../config/environment','defaults','localhost','socket.io-emitter','redis','Setting','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','ChatInteraction','system','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','catch'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x0b40,0xc2));var _0x00b4=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x0b40[_0x4b4f24];return _0x1c13d4;};'use strict';var _=require(_0x00b4('0x0'));var moment=require(_0x00b4('0x1'));var Redis=require(_0x00b4('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x00b4('0x3'));config['redis']=_[_0x00b4('0x4')](config['redis'],{'host':_0x00b4('0x5'),'port':0x18eb});var io=require(_0x00b4('0x6'))(new Redis(config[_0x00b4('0x7')]));function closeInteractions(){var _0x542855=0x0;var _0x228ff7=[];return db[_0x00b4('0x8')]['find']({'raw':!![],'attributes':['id',_0x00b4('0x9')],'where':{'id':0x1}})[_0x00b4('0xa')](function(_0x547aec){_0x542855=_0x547aec[_0x00b4('0x9')];if(_0x542855){return db['ChatInteraction'][_0x00b4('0xb')]({'raw':!![],'attributes':['id',_0x00b4('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x00b4('0xd')](_0x547aec[_0x00b4('0x9')],_0x00b4('0xe'))}}});}else{return[];}})['then'](function(_0x558652){_0x228ff7=_0x558652;if(_0x542855){return db[_0x00b4('0xf')]['update']({'closeReason':_0x00b4('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x00b4('0x11')](_0x00b4('0x12'))},{'where':{'id':_['map'](_0x228ff7||[],'id')}});}})[_0x00b4('0xa')](function(_0x29fa57){for(var _0x4c8ff3=0x0;_0x4c8ff3<_0x228ff7[_0x00b4('0x13')];_0x4c8ff3++){io[_0x00b4('0x14')]('chatInteraction:update',{'id':_0x228ff7[_0x4c8ff3]['id'],'closed':!![]});}})[_0x00b4('0x15')](function(_0x56050d){console[_0x00b4('0x16')](_0x56050d);});}exports[_0x00b4('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index eede967..21b06a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x292c=['exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','jobs','toString','keyBy','intersection','difference','length','exists','stop','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','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','Smtp','service','host','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','savename','extname','zip','existsSync','Sent','message','attachments','text','format','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','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x292c,0x192));var _0xc292=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x292c[_0x5c351c];return _0x26f3b3;};'use strict';var fs=require('fs');var util=require(_0xc292('0x0'));var path=require(_0xc292('0x1'));var _=require(_0xc292('0x2'));var moment=require(_0xc292('0x3'));var CronJobManager=require(_0xc292('0x4'));var jayson=require(_0xc292('0x5'));var BPromise=require(_0xc292('0x6'));var logger=require(_0xc292('0x7'))(_0xc292('0x8'));var db=require(_0xc292('0x9'))['db'];var analyticCustomReportController=require(_0xc292('0xa'));var analyticDefaultReportController=require(_0xc292('0xb'));var client=jayson[_0xc292('0xc')][_0xc292('0xd')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x42a92d,_0xf666c0){return function(){logger[_0xc292('0xe')](_0xc292('0xf'),_0x42a92d[_0xc292('0x10')]);var _0xcab794=!![];var _0x7097ca={'tls':{'rejectUnauthorized':![]}};if(_0x42a92d[_0xc292('0x11')][_0xc292('0x12')][_0xc292('0x13')]){_0x7097ca[_0xc292('0x13')]=_0x42a92d[_0xc292('0x11')]['Smtp'][_0xc292('0x13')];}else{_0x7097ca['host']=_0x42a92d[_0xc292('0x11')][_0xc292('0x12')][_0xc292('0x14')];_0x7097ca['port']=_0x42a92d[_0xc292('0x11')][_0xc292('0x12')]['port'];_0x7097ca[_0xc292('0x15')]=_0x42a92d[_0xc292('0x11')][_0xc292('0x12')][_0xc292('0x15')];}if(_0x42a92d['MailAccount'][_0xc292('0x12')][_0xc292('0x16')]){_0x7097ca[_0xc292('0x17')]={'user':_0x42a92d['MailAccount'][_0xc292('0x12')]['user'],'pass':_0x42a92d[_0xc292('0x11')][_0xc292('0x12')][_0xc292('0x18')]};}var _0x1d97d8={'account':_0x7097ca,'message':{'from':util['format'](_0xc292('0x19'),_0x42a92d['MailAccount'][_0xc292('0x1a')],_0x42a92d[_0xc292('0x11')][_0xc292('0x10')]||_0x42a92d[_0xc292('0x11')][_0xc292('0x12')]['user']),'to':_0x42a92d[_0xc292('0x10')],'cc':_0x42a92d['cc'],'bcc':_0x42a92d['bcc'],'subject':util['format'](_0xc292('0x1b'),_0xf666c0[_0xc292('0x1a')],_0x42a92d[_0xc292('0x1c')],_0x42a92d[_0xc292('0x1d')])}};var _0x417fe5=path[_0xc292('0x1e')](__dirname,_0xc292('0x1f'));var _0x27286a=_0xf666c0['savename'];var _0x52aa92=util['format'](_0xc292('0x20'),path['basename'](_0xf666c0[_0xc292('0x21')],path[_0xc292('0x22')](_0xf666c0[_0xc292('0x21')])),_0xc292('0x23'));var _0xb81a32=path['join'](_0x417fe5,_0x27286a);var _0xca229c=path[_0xc292('0x1e')](_0x417fe5,_0x52aa92);if(fs[_0xc292('0x24')](_0xb81a32)){_0xf666c0['status']=_0xc292('0x25');_0x1d97d8[_0xc292('0x26')][_0xc292('0x27')]=[{'filename':_0x27286a,'path':_0xb81a32}];_0x1d97d8[_0xc292('0x26')][_0xc292('0x28')]=util[_0xc292('0x29')](_0xc292('0x2a'),JSON[_0xc292('0x2b')](_0xf666c0,null,0x2));}else if(fs[_0xc292('0x24')](_0xca229c)){_0xf666c0[_0xc292('0x2c')]=_0xc292('0x25');_0x1d97d8[_0xc292('0x26')][_0xc292('0x27')]=[{'filename':_0x52aa92,'path':_0xca229c}];}else{_0x1d97d8[_0xc292('0x26')][_0xc292('0x28')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x42a92d[_0xc292('0x2d')]){_0xcab794=![];logger[_0xc292('0xe')](_0xc292('0x2e'));}}if(_0xcab794){return client['request'](_0xc292('0x2f'),_0x1d97d8)[_0xc292('0x30')](function(_0x560d57){if(_0x560d57['error']){return logger[_0xc292('0x31')]('error\x20mail',JSON['stringify'](_0x560d57));}return logger[_0xc292('0xe')]('email\x20sent');})[_0xc292('0x32')](function(_0x597031){return logger[_0xc292('0x31')](_0xc292('0x33'),JSON[_0xc292('0x2b')](_0x597031));});}};}function handleError(){return function(_0x55be4b){return logger[_0xc292('0x31')](JSON[_0xc292('0x2b')](_0x55be4b));};}function handleResult(_0x4e1903){return function(_0xe6530){logger[_0xc292('0xe')](_0xc292('0x34'),JSON[_0xc292('0x2b')](_0xe6530));if(_0x4e1903[_0xc292('0x11')]&&_0x4e1903[_0xc292('0x11')][_0xc292('0x12')]&&!_[_0xc292('0x35')](_0x4e1903['email'])){setTimeout(handleSendEmail(_0x4e1903,_0xe6530),0x3c*0x3e8);}};}function handleJob(_0xcdb5bb){return function(){try{if(_[_0xc292('0x35')](_0xcdb5bb[_0xc292('0x1c')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0xcdb5bb[_0xc292('0x1d')])){return logger[_0xc292('0xe')](_0xc292('0x36'));}var _0x5895e4={'startDate':moment()[_0xc292('0x37')](_0xcdb5bb[_0xc292('0x1c')],_0xcdb5bb['subtractUnit'])['format'](_0xc292('0x38')),'endDate':moment()[_0xc292('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xc292('0x39'),'output':_0xcdb5bb[_0xc292('0x3a')],'name':_0xcdb5bb[_0xc292('0x1a')]};if(!_[_0xc292('0x35')](_0xcdb5bb[_0xc292('0x3b')])){logger[_0xc292('0xe')](_0xc292('0x3c'),_0xcdb5bb[_0xc292('0x3b')]);return analyticDefaultReportController[_0xc292('0x3d')]({'id':_0xcdb5bb[_0xc292('0x3b')]},_0x5895e4)[_0xc292('0x30')](handleResult(_0xcdb5bb))[_0xc292('0x32')](handleError());}if(!_[_0xc292('0x35')](_0xcdb5bb[_0xc292('0x3e')])){logger[_0xc292('0xe')](_0xc292('0x3f'),_0xcdb5bb[_0xc292('0x3e')]);return analyticCustomReportController[_0xc292('0x3d')]({'id':_0xcdb5bb[_0xc292('0x3e')]},_0x5895e4)[_0xc292('0x30')](handleResult(_0xcdb5bb))[_0xc292('0x32')](handleError());}}catch(_0x2b29fa){logger[_0xc292('0x31')](JSON[_0xc292('0x2b')](_0x2b29fa));}return logger[_0xc292('0xe')](_0xc292('0x40'));};}function getJobs(_0x47163b){var _0x22ec7b={};if(_0x47163b){_0x22ec7b['id']=_0x47163b;}return db[_0xc292('0x41')][_0xc292('0x42')]({'where':_0x22ec7b,'include':[{'model':db[_0xc292('0x11')],'attributes':['id',_0xc292('0x1a'),_0xc292('0x10')],'include':[{'model':db['MailServerOut'],'as':_0xc292('0x12')}]}]})[_0xc292('0x30')](function(_0xbda257){var _0x2fb5a7=_[_0xc292('0x43')](manager[_0xc292('0x44')]);var _0x24840b=_['map'](_0xbda257,function(_0x5d6711){return _0x5d6711['id'][_0xc292('0x45')]();});var _0x23abcc=_[_0xc292('0x46')](_0xbda257,function(_0x36abe1){return _0x36abe1['id']['toString']();});var _0x22e409=_0x47163b?_0x24840b:_['difference'](_0x24840b,_0x2fb5a7);var _0x19e597=_[_0xc292('0x47')](_0x24840b,_0x2fb5a7);var _0x17d3dc=_[_0xc292('0x48')](_0x2fb5a7,_0x24840b);var _0xcff064;var _0xd65240;for(_0xcff064=0x0;_0xcff064<_0x17d3dc[_0xc292('0x49')]&&!_0x47163b;_0xcff064+=0x1){_0xd65240=_0x17d3dc[_0xcff064]['toString']();if(manager[_0xc292('0x4a')](_0xd65240)){manager[_0xc292('0x4b')](_0xd65240);manager[_0xc292('0x4c')](_0xd65240);logger[_0xc292('0xe')]('delete\x20cron',_0xd65240);}}logger['info'](_0xc292('0x4d'),JSON[_0xc292('0x2b')](_0x22e409));for(_0xcff064=0x0;_0xcff064<_0x22e409[_0xc292('0x49')];_0xcff064+=0x1){_0xd65240=_0x22e409[_0xcff064][_0xc292('0x45')]();logger[_0xc292('0xe')](_0xc292('0x4e'),_0xd65240);if(_0x47163b){logger[_0xc292('0xe')](_0xc292('0x4f'),_0x47163b);logger[_0xc292('0xe')](JSON[_0xc292('0x2b')](_0x23abcc[_0xd65240]));BPromise[_0xc292('0x50')]()['then'](handleJob(_0x23abcc[_0xd65240]));logger['info'](_0xc292('0x51'),_0x23abcc[_0xd65240][_0xc292('0x1a')],_0x23abcc[_0xd65240]['cron']);}else if(_0x23abcc[_0xd65240][_0xc292('0x52')]&&_0x23abcc[_0xd65240][_0xc292('0x53')]&&moment()['isBetween'](_0x23abcc[_0xd65240][_0xc292('0x54')],_0x23abcc[_0xd65240][_0xc292('0x55')])){manager[_0xc292('0x56')](_0xd65240,_0x23abcc[_0xd65240]['cron'],handleJob(_0x23abcc[_0xd65240]));manager[_0xc292('0x57')](_0xd65240);logger[_0xc292('0xe')](_0xc292('0x58'),_0x23abcc[_0xd65240]['name'],_0x23abcc[_0xd65240][_0xc292('0x52')]);}else if(manager[_0xc292('0x4a')](_0xd65240)){manager[_0xc292('0x4b')](_0xd65240);manager[_0xc292('0x4c')](_0xd65240);logger[_0xc292('0xe')]('stop\x20cron',_0x23abcc[_0xd65240]['name'],_0x23abcc[_0xd65240][_0xc292('0x52')]);}}for(_0xcff064=0x0,_0xd65240;_0xcff064<_0x19e597['length']&&!_0x47163b;_0xcff064+=0x1){_0xd65240=_0x19e597[_0xcff064]['toString']();if(manager[_0xc292('0x4a')](_0xd65240)){if(_0x23abcc[_0xd65240][_0xc292('0x52')]&&_0x23abcc[_0xd65240][_0xc292('0x53')]&&moment()['isBetween'](_0x23abcc[_0xd65240]['startAt'],_0x23abcc[_0xd65240][_0xc292('0x55')])){manager[_0xc292('0x59')](_0xd65240,_0x23abcc[_0xd65240][_0xc292('0x52')],handleJob(_0x23abcc[_0xd65240]));logger[_0xc292('0xe')](_0xc292('0x5a'),_0x23abcc[_0xd65240][_0xc292('0x1a')],_0x23abcc[_0xd65240][_0xc292('0x52')]);}else{manager[_0xc292('0x4b')](_0xd65240);manager[_0xc292('0x4c')](_0xd65240);logger[_0xc292('0xe')](_0xc292('0x5b'),_0x23abcc[_0xd65240][_0xc292('0x1a')],_0x23abcc[_0xd65240][_0xc292('0x52')]);}}}})[_0xc292('0x32')](function(_0x498620){logger[_0xc292('0x31')](JSON[_0xc292('0x2b')](_0x498620));});}exports[_0xc292('0x5c')]=function(_0x505f39){return getJobs(_0x505f39);};exports[_0xc292('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x3240=['auth','user','pass','format','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','%s.%s','basename','join','status','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','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','resolve','run\x20job','active','isBetween','startAt','endAt','cron','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','MailAccount','Smtp','service','host','port','secure','authentication'];(function(_0x3fcadd,_0x375953){var _0x538258=function(_0x2cd7f1){while(--_0x2cd7f1){_0x3fcadd['push'](_0x3fcadd['shift']());}};_0x538258(++_0x375953);}(_0x3240,0x1c3));var _0x0324=function(_0x13ec98,_0x461532){_0x13ec98=_0x13ec98-0x0;var _0x175bed=_0x3240[_0x13ec98];return _0x175bed;};'use strict';var fs=require('fs');var util=require(_0x0324('0x0'));var path=require(_0x0324('0x1'));var _=require('lodash');var moment=require(_0x0324('0x2'));var CronJobManager=require(_0x0324('0x3'));var jayson=require(_0x0324('0x4'));var BPromise=require(_0x0324('0x5'));var logger=require(_0x0324('0x6'))('schedule');var db=require(_0x0324('0x7'))['db'];var analyticCustomReportController=require(_0x0324('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x0324('0x9')][_0x0324('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x250810,_0x1c3395){return function(){logger[_0x0324('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x250810['email']);var _0x4ace6e=!![];var _0x3b3d72={'tls':{'rejectUnauthorized':![]}};if(_0x250810[_0x0324('0xc')][_0x0324('0xd')][_0x0324('0xe')]){_0x3b3d72[_0x0324('0xe')]=_0x250810[_0x0324('0xc')][_0x0324('0xd')][_0x0324('0xe')];}else{_0x3b3d72['host']=_0x250810[_0x0324('0xc')][_0x0324('0xd')][_0x0324('0xf')];_0x3b3d72[_0x0324('0x10')]=_0x250810[_0x0324('0xc')][_0x0324('0xd')][_0x0324('0x10')];_0x3b3d72['secure']=_0x250810[_0x0324('0xc')][_0x0324('0xd')][_0x0324('0x11')];}if(_0x250810[_0x0324('0xc')][_0x0324('0xd')][_0x0324('0x12')]){_0x3b3d72[_0x0324('0x13')]={'user':_0x250810[_0x0324('0xc')]['Smtp'][_0x0324('0x14')],'pass':_0x250810[_0x0324('0xc')][_0x0324('0xd')][_0x0324('0x15')]};}var _0x419f13={'account':_0x3b3d72,'message':{'from':util[_0x0324('0x16')]('\x22%s\x22\x20<%s>',_0x250810[_0x0324('0xc')][_0x0324('0x17')],_0x250810[_0x0324('0xc')][_0x0324('0x18')]||_0x250810['MailAccount']['Smtp'][_0x0324('0x14')]),'to':_0x250810['email'],'cc':_0x250810['cc'],'bcc':_0x250810[_0x0324('0x19')],'subject':util[_0x0324('0x16')](_0x0324('0x1a'),_0x1c3395[_0x0324('0x17')],_0x250810['subtractNumber'],_0x250810[_0x0324('0x1b')])}};var _0x33ef87=path['join'](__dirname,_0x0324('0x1c'));var _0x306947=_0x1c3395[_0x0324('0x1d')];var _0x4cc515=util[_0x0324('0x16')](_0x0324('0x1e'),path[_0x0324('0x1f')](_0x1c3395['savename'],path['extname'](_0x1c3395['savename'])),'zip');var _0x191d32=path[_0x0324('0x20')](_0x33ef87,_0x306947);var _0x2ba61f=path[_0x0324('0x20')](_0x33ef87,_0x4cc515);if(fs['existsSync'](_0x191d32)){_0x1c3395[_0x0324('0x21')]=_0x0324('0x22');_0x419f13['message'][_0x0324('0x23')]=[{'filename':_0x306947,'path':_0x191d32}];_0x419f13[_0x0324('0x24')][_0x0324('0x25')]=util[_0x0324('0x16')](_0x0324('0x26'),JSON[_0x0324('0x27')](_0x1c3395,null,0x2));}else if(fs[_0x0324('0x28')](_0x2ba61f)){_0x1c3395[_0x0324('0x21')]=_0x0324('0x22');_0x419f13['message'][_0x0324('0x23')]=[{'filename':_0x4cc515,'path':_0x2ba61f}];}else{_0x419f13[_0x0324('0x24')][_0x0324('0x25')]=_0x0324('0x29');if(!_0x250810[_0x0324('0x2a')]){_0x4ace6e=![];logger[_0x0324('0xb')](_0x0324('0x2b'));}}if(_0x4ace6e){return client[_0x0324('0x2c')](_0x0324('0x2d'),_0x419f13)['then'](function(_0x1b733c){if(_0x1b733c[_0x0324('0x2e')]){return logger['error'](_0x0324('0x2f'),JSON['stringify'](_0x1b733c));}return logger[_0x0324('0xb')](_0x0324('0x30'));})[_0x0324('0x31')](function(_0x3d735a){return logger[_0x0324('0x2e')](_0x0324('0x2f'),JSON[_0x0324('0x27')](_0x3d735a));});}};}function handleError(){return function(_0x146799){return logger['error'](JSON['stringify'](_0x146799));};}function handleResult(_0x4c8475){return function(_0x3e2357){logger[_0x0324('0xb')](_0x0324('0x32'),JSON[_0x0324('0x27')](_0x3e2357));if(_0x4c8475[_0x0324('0xc')]&&_0x4c8475[_0x0324('0xc')][_0x0324('0xd')]&&!_[_0x0324('0x33')](_0x4c8475[_0x0324('0x18')])){setTimeout(handleSendEmail(_0x4c8475,_0x3e2357),0x3c*0x3e8);}};}function handleJob(_0x41318c){return function(){try{if(_[_0x0324('0x33')](_0x41318c[_0x0324('0x34')])){return logger[_0x0324('0xb')](_0x0324('0x35'));}if(_['isNil'](_0x41318c[_0x0324('0x1b')])){return logger[_0x0324('0xb')](_0x0324('0x36'));}var _0x4d37de={'startDate':moment()[_0x0324('0x37')](_0x41318c[_0x0324('0x34')],_0x41318c[_0x0324('0x1b')])[_0x0324('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x0324('0x16')](_0x0324('0x38')),'type':_0x0324('0x39'),'output':_0x41318c[_0x0324('0x3a')],'name':_0x41318c[_0x0324('0x17')]};if(!_[_0x0324('0x33')](_0x41318c['DefaultReportId'])){logger[_0x0324('0xb')](_0x0324('0x3b'),_0x41318c[_0x0324('0x3c')]);return analyticDefaultReportController[_0x0324('0x3d')]({'id':_0x41318c['DefaultReportId']},_0x4d37de)[_0x0324('0x3e')](handleResult(_0x41318c))['catch'](handleError());}if(!_['isNil'](_0x41318c['CustomReportId'])){logger[_0x0324('0xb')](_0x0324('0x3f'),_0x41318c[_0x0324('0x40')]);return analyticCustomReportController[_0x0324('0x3d')]({'id':_0x41318c[_0x0324('0x40')]},_0x4d37de)['then'](handleResult(_0x41318c))[_0x0324('0x31')](handleError());}}catch(_0x22a16f){logger[_0x0324('0x2e')](JSON[_0x0324('0x27')](_0x22a16f));}return logger['info'](_0x0324('0x41'));};}function getJobs(_0x3824fd){var _0xaf2996={};if(_0x3824fd){_0xaf2996['id']=_0x3824fd;}return db[_0x0324('0x42')][_0x0324('0x43')]({'where':_0xaf2996,'include':[{'model':db['MailAccount'],'attributes':['id',_0x0324('0x17'),'email'],'include':[{'model':db[_0x0324('0x44')],'as':_0x0324('0xd')}]}]})[_0x0324('0x3e')](function(_0x2900ee){var _0x5ef3a0=_[_0x0324('0x45')](manager['jobs']);var _0x35d48d=_[_0x0324('0x46')](_0x2900ee,function(_0x5cd020){return _0x5cd020['id'][_0x0324('0x47')]();});var _0x5d87b1=_[_0x0324('0x48')](_0x2900ee,function(_0x15fe8a){return _0x15fe8a['id']['toString']();});var _0x305314=_0x3824fd?_0x35d48d:_[_0x0324('0x49')](_0x35d48d,_0x5ef3a0);var _0x5cd64d=_[_0x0324('0x4a')](_0x35d48d,_0x5ef3a0);var _0xe1b638=_[_0x0324('0x49')](_0x5ef3a0,_0x35d48d);var _0x5196d5;var _0x3e27c9;for(_0x5196d5=0x0;_0x5196d5<_0xe1b638['length']&&!_0x3824fd;_0x5196d5+=0x1){_0x3e27c9=_0xe1b638[_0x5196d5][_0x0324('0x47')]();if(manager[_0x0324('0x4b')](_0x3e27c9)){manager[_0x0324('0x4c')](_0x3e27c9);manager[_0x0324('0x4d')](_0x3e27c9);logger['info'](_0x0324('0x4e'),_0x3e27c9);}}logger[_0x0324('0xb')]('toRun',JSON[_0x0324('0x27')](_0x305314));for(_0x5196d5=0x0;_0x5196d5<_0x305314[_0x0324('0x4f')];_0x5196d5+=0x1){_0x3e27c9=_0x305314[_0x5196d5][_0x0324('0x47')]();logger[_0x0324('0xb')](_0x0324('0x50'),_0x3e27c9);if(_0x3824fd){logger[_0x0324('0xb')]('my\x20id',_0x3824fd);logger[_0x0324('0xb')](JSON[_0x0324('0x27')](_0x5d87b1[_0x3e27c9]));BPromise[_0x0324('0x51')]()['then'](handleJob(_0x5d87b1[_0x3e27c9]));logger[_0x0324('0xb')](_0x0324('0x52'),_0x5d87b1[_0x3e27c9][_0x0324('0x17')],_0x5d87b1[_0x3e27c9]['cron']);}else if(_0x5d87b1[_0x3e27c9]['cron']&&_0x5d87b1[_0x3e27c9][_0x0324('0x53')]&&moment()[_0x0324('0x54')](_0x5d87b1[_0x3e27c9][_0x0324('0x55')],_0x5d87b1[_0x3e27c9][_0x0324('0x56')])){manager['add'](_0x3e27c9,_0x5d87b1[_0x3e27c9][_0x0324('0x57')],handleJob(_0x5d87b1[_0x3e27c9]));manager[_0x0324('0x58')](_0x3e27c9);logger[_0x0324('0xb')](_0x0324('0x59'),_0x5d87b1[_0x3e27c9][_0x0324('0x17')],_0x5d87b1[_0x3e27c9][_0x0324('0x57')]);}else if(manager[_0x0324('0x4b')](_0x3e27c9)){manager['stop'](_0x3e27c9);manager[_0x0324('0x4d')](_0x3e27c9);logger[_0x0324('0xb')](_0x0324('0x5a'),_0x5d87b1[_0x3e27c9]['name'],_0x5d87b1[_0x3e27c9][_0x0324('0x57')]);}}for(_0x5196d5=0x0,_0x3e27c9;_0x5196d5<_0x5cd64d[_0x0324('0x4f')]&&!_0x3824fd;_0x5196d5+=0x1){_0x3e27c9=_0x5cd64d[_0x5196d5][_0x0324('0x47')]();if(manager[_0x0324('0x4b')](_0x3e27c9)){if(_0x5d87b1[_0x3e27c9]['cron']&&_0x5d87b1[_0x3e27c9]['active']&&moment()[_0x0324('0x54')](_0x5d87b1[_0x3e27c9]['startAt'],_0x5d87b1[_0x3e27c9]['endAt'])){manager[_0x0324('0x5b')](_0x3e27c9,_0x5d87b1[_0x3e27c9]['cron'],handleJob(_0x5d87b1[_0x3e27c9]));logger[_0x0324('0xb')](_0x0324('0x5c'),_0x5d87b1[_0x3e27c9][_0x0324('0x17')],_0x5d87b1[_0x3e27c9][_0x0324('0x57')]);}else{manager['stop'](_0x3e27c9);manager[_0x0324('0x4d')](_0x3e27c9);logger[_0x0324('0xb')](_0x0324('0x5a'),_0x5d87b1[_0x3e27c9][_0x0324('0x17')],_0x5d87b1[_0x3e27c9][_0x0324('0x57')]);}}}})['catch'](function(_0x14323d){logger['error'](JSON['stringify'](_0x14323d));});}exports[_0x0324('0x5d')]=function(_0x1586fd){return getJobs(_0x1586fd);};exports[_0x0324('0x58')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 2784c39..bc25283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb77f=['[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','Transcript\x20not\x20available','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','catch','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','info','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Sentiment','SentimentScore','Negative','Neutral','FAILED','FailureReason'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0xb77f,0x1b1));var _0xfb77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb77f[_0x14add3];return _0x4a174f;};var _=require('lodash');var AWS=require(_0xfb77('0x0'));var rp=require('request-promise');var util=require(_0xfb77('0x1'));var BPromise=require(_0xfb77('0x2'));var db=require(_0xfb77('0x3'))['db'];var logger=require(_0xfb77('0x4'))(_0xfb77('0x5'));function getTranscriptionJob(_0x1647cc,_0x4373e6,_0x538043,_0x34c1af){return new Promise(function(_0x54addc,_0x1137e9){var _0x47e7c1=new AWS[(_0xfb77('0x6'))]({'accessKeyId':_0x4373e6,'secretAccessKey':_0x1647cc,'region':_0x538043});_0x47e7c1[_0xfb77('0x7')]({'TranscriptionJobName':_0x34c1af},function(_0x24db6a,_0x3dbc8e){if(_0x24db6a){return _0x1137e9(_0x24db6a);}else{return _0x54addc(_0x3dbc8e);}});});}function sentiment(_0x32935f,_0x3feb82,_0x3b521e,_0x10cbfb,_0x52b28b){return new Promise(function(_0x190868,_0x26c819){var _0x1c907a=new AWS[(_0xfb77('0x8'))]({'accessKeyId':_0x3feb82,'secretAccessKey':_0x32935f,'region':_0x3b521e});_0x1c907a[_0xfb77('0x9')]({'Text':_0x10cbfb,'LanguageCode':_0x52b28b['substring'](0x0,0x2)},function(_0x57c6b2,_0x2bec0f){if(_0x57c6b2){return _0x26c819(_0x57c6b2);}else{return _0x190868(_0x2bec0f);}});});}function checkTranscribeJob(_0x333bf6,_0x33e2ed,_0x2bbd8d){var _0x3ad98a;return new BPromise(function(_0x90f1da,_0x4687a0){logger['info'](util['format'](_0xfb77('0xa'),_0x333bf6['id'],_0x333bf6[_0xfb77('0xb')]));return getTranscriptionJob(_0x2bbd8d['data1'],_0x2bbd8d[_0xfb77('0xc')],_0x33e2ed[_0xfb77('0xd')],_0x333bf6['transcribeName'])[_0xfb77('0xe')](function(_0x4a98e3){logger[_0xfb77('0xf')](util[_0xfb77('0x10')](_0xfb77('0x11'),_0x333bf6['id'],_0x333bf6['transcribeName'],_0x4a98e3[_0xfb77('0x12')][_0xfb77('0x13')]));if(!_0x333bf6[_0xfb77('0x14')]){switch(_0x4a98e3[_0xfb77('0x12')]['TranscriptionJobStatus']){case _0xfb77('0x15'):var _0x482bb7={'transcribeStatus':_0x4a98e3[_0xfb77('0x12')][_0xfb77('0x13')],'fileUri':_0x4a98e3[_0xfb77('0x12')]['Transcript']['TranscriptFileUri']};logger['info'](util[_0xfb77('0x10')](_0xfb77('0x16'),_0x333bf6['id']));return rp({'uri':_0x4a98e3[_0xfb77('0x12')][_0xfb77('0x17')]['TranscriptFileUri'],'json':!![]})['then'](function(_0xd41288){logger['info'](util[_0xfb77('0x10')](_0xfb77('0x18'),_0x333bf6['id']));if(_0xd41288&&_0xd41288[_0xfb77('0x19')]&&_0xd41288[_0xfb77('0x19')][_0xfb77('0x1a')]&&_0xd41288[_0xfb77('0x19')][_0xfb77('0x1a')][_0xfb77('0x1b')]){_0x482bb7['fileText']='';for(var _0x595287=0x0;_0x595287<_0xd41288['results'][_0xfb77('0x1a')][_0xfb77('0x1b')];_0x595287++){_0x482bb7[_0xfb77('0x14')]+=_0xd41288[_0xfb77('0x19')][_0xfb77('0x1a')][_0x595287][_0xfb77('0x1c')]+'';}}return _0x333bf6[_0xfb77('0x1d')](_0x482bb7);})[_0xfb77('0xe')](function(){logger[_0xfb77('0xf')](util[_0xfb77('0x10')](_0xfb77('0x1e'),_0x333bf6['id']));if(!_0x333bf6['tempSentiment']){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x33e2ed[_0xfb77('0x21')]||!_0x33e2ed[_0xfb77('0x22')]||!_0x33e2ed[_0xfb77('0x23')]||!_0x33e2ed[_0xfb77('0x24')]||!_0x33e2ed[_0xfb77('0x25')]){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))](_0xfb77('0x26'));}if(!_0x482bb7[_0xfb77('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0x33e2ed[_0xfb77('0x22')]===_0x2bbd8d['id']){return _0x2bbd8d;}else{return db[_0xfb77('0x27')][_0xfb77('0x28')]({'where':{'id':_settings[_0xfb77('0x22')]}});}})[_0xfb77('0xe')](function(_0x5a9460){if(!_0x5a9460){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))](_0xfb77('0x29'));}if(!_0x5a9460[_0xfb77('0x2a')]||!_0x5a9460[_0xfb77('0xc')]){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))](_0xfb77('0x2b'));}_0x3ad98a=_0x5a9460;logger[_0xfb77('0xf')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x333bf6['id']));return sentiment(_0x3ad98a[_0xfb77('0x2a')],_0x3ad98a[_0xfb77('0xc')],_0x33e2ed[_0xfb77('0x23')],_0x482bb7[_0xfb77('0x14')],_0x33e2ed[_0xfb77('0x24')]);})['then'](function(_0x58d947){logger[_0xfb77('0xf')](util[_0xfb77('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x333bf6['id']));return _0x333bf6['update']({'sentiment':_0x58d947[_0xfb77('0x2c')],'sPositive':_0x58d947[_0xfb77('0x2d')]['Positive'],'sNegative':_0x58d947['SentimentScore'][_0xfb77('0x2e')],'sMixed':_0x58d947[_0xfb77('0x2d')]['Mixed'],'sNeutral':_0x58d947[_0xfb77('0x2d')][_0xfb77('0x2f')]});})[_0xfb77('0xe')](function(){logger[_0xfb77('0xf')](util[_0xfb77('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x333bf6['id']));_0x90f1da();});case _0xfb77('0x30'):return _0x333bf6[_0xfb77('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x4a98e3[_0xfb77('0x12')][_0xfb77('0x31')]})[_0xfb77('0xe')](function(){logger[_0xfb77('0xf')](util[_0xfb77('0x10')](_0xfb77('0x1e'),_0x333bf6['id']));_0x90f1da();});default:logger[_0xfb77('0xf')](util['format'](_0xfb77('0x32'),_0x333bf6['id']));break;}}else{return BPromise[_0xfb77('0x33')]()[_0xfb77('0xe')](function(){if(!_0x333bf6[_0xfb77('0x34')]){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))](_0xfb77('0x35'));}if(!_0x33e2ed[_0xfb77('0x21')]||!_0x33e2ed[_0xfb77('0x22')]||!_0x33e2ed[_0xfb77('0x23')]||!_0x33e2ed[_0xfb77('0x24')]||!_0x33e2ed[_0xfb77('0x25')]){throw new db['Sequelize'][(_0xfb77('0x20'))](_0xfb77('0x26'));}if(!_0x333bf6['fileText']){throw new Error(_0xfb77('0x36'));}if(_0x33e2ed[_0xfb77('0x22')]===_0x2bbd8d['id']){return _0x2bbd8d;}else{return db['CloudProvider'][_0xfb77('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xfb77('0xe')](function(_0x442a88){if(!_0x442a88){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))](_0xfb77('0x29'));}if(!_0x442a88[_0xfb77('0x2a')]||!_0x442a88[_0xfb77('0xc')]){throw new db['Sequelize'][(_0xfb77('0x20'))](_0xfb77('0x2b'));}_0x3ad98a=_0x442a88;logger[_0xfb77('0xf')](util[_0xfb77('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x333bf6['id']));return sentiment(_0x3ad98a[_0xfb77('0x2a')],_0x3ad98a['data2'],_0x33e2ed[_0xfb77('0x23')],_0x333bf6[_0xfb77('0x14')],_0x33e2ed[_0xfb77('0x24')]);})[_0xfb77('0xe')](function(_0x59c0a0){logger[_0xfb77('0xf')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x333bf6['id']));return _0x333bf6[_0xfb77('0x1d')]({'sentiment':_0x59c0a0[_0xfb77('0x2c')],'sPositive':_0x59c0a0[_0xfb77('0x2d')]['Positive'],'sNegative':_0x59c0a0['SentimentScore'][_0xfb77('0x2e')],'sMixed':_0x59c0a0[_0xfb77('0x2d')]['Mixed'],'sNeutral':_0x59c0a0['SentimentScore'][_0xfb77('0x2f')],'transcribeStatus':_0xfb77('0x15')});})[_0xfb77('0xe')](function(){logger[_0xfb77('0xf')](util['format'](_0xfb77('0x1e'),_0x333bf6['id']));_0x90f1da();});}})['catch'](function(_0x2e0097){if(_0x2e0097){if(!_0x2e0097[_0xfb77('0x37')]||_0x2e0097[_0xfb77('0x37')]!==_0xfb77('0x38')){logger[_0xfb77('0x39')](util[_0xfb77('0x10')](_0xfb77('0x3a'),_0x333bf6['id']),util[_0xfb77('0x3b')](_0x2e0097,{'showHidden':![],'depth':null}));}}_0x90f1da();});});}function checkTranscribe(){var _0x20e4c7;var _0x3c9ed9;var _0x16174c;return db[_0xfb77('0x3c')][_0xfb77('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xfb77('0xe')](function(_0x2073fc){if(!_0x2073fc||!_0x2073fc['length']){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))](_0xfb77('0x3e'));}_0x20e4c7=_0x2073fc;return db['Setting'][_0xfb77('0x28')]({'where':{'id':0x1}});})[_0xfb77('0xe')](function(_0x207a6b){if(!_0x207a6b){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))](_0xfb77('0x3f'));}_0x3c9ed9=_0x207a6b;if(!_0x3c9ed9[_0xfb77('0x5')]||!_0x3c9ed9[_0xfb77('0x40')]||!_0x3c9ed9[_0xfb77('0xd')]||!_0x3c9ed9['language']||!_0x3c9ed9[_0xfb77('0x25')]){throw new db['Sequelize']['ValidationError'](_0xfb77('0x41'));}return db[_0xfb77('0x27')][_0xfb77('0x28')]({'where':{'id':_0x3c9ed9['transcribeAccountId']}});})[_0xfb77('0xe')](function(_0x13273e){if(!_0x13273e){throw new db['Sequelize'][(_0xfb77('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x13273e[_0xfb77('0x2a')]||!_0x13273e['data2']){throw new db[(_0xfb77('0x1f'))][(_0xfb77('0x20'))](_0xfb77('0x2b'));}_0x16174c=_0x13273e;var _0x57d557=[];_0x20e4c7[_0xfb77('0x42')](function(_0x1d1651){_0x57d557[_0xfb77('0x43')](checkTranscribeJob(_0x1d1651,_0x3c9ed9,_0x16174c));});return BPromise['all'](_0x57d557);})[_0xfb77('0x44')](function(_0x119bba){if(_0x119bba){if(!_0x119bba[_0xfb77('0x37')]||_0x119bba[_0xfb77('0x37')]!=='SequelizeValidationError'){logger['error'](util[_0xfb77('0x3b')](_0x119bba,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0xe46e=['language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Negative','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20configured','Positive','Mixed','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','push','all','catch','start','lodash','aws-sdk','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0xe46e,0xb5));var _0xee46=function(_0x35c7a8,_0x1ce305){_0x35c7a8=_0x35c7a8-0x0;var _0x231e0f=_0xe46e[_0x35c7a8];return _0x231e0f;};var _=require(_0xee46('0x0'));var AWS=require(_0xee46('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xee46('0x2'))(_0xee46('0x3'));function getTranscriptionJob(_0x5ab396,_0x2a1bbf,_0x27b97a,_0x1b7799){return new Promise(function(_0xfd37a0,_0xbf41ec){var _0x3b978b=new AWS['TranscribeService']({'accessKeyId':_0x2a1bbf,'secretAccessKey':_0x5ab396,'region':_0x27b97a});_0x3b978b[_0xee46('0x4')]({'TranscriptionJobName':_0x1b7799},function(_0x20fc51,_0x2bda67){if(_0x20fc51){return _0xbf41ec(_0x20fc51);}else{return _0xfd37a0(_0x2bda67);}});});}function sentiment(_0x24d6bf,_0x2852ea,_0x18f838,_0x3e0436,_0x48f7be){return new Promise(function(_0x2b3cd3,_0x125864){var _0x1cd218=new AWS[(_0xee46('0x5'))]({'accessKeyId':_0x2852ea,'secretAccessKey':_0x24d6bf,'region':_0x18f838});_0x1cd218[_0xee46('0x6')]({'Text':_0x3e0436,'LanguageCode':_0x48f7be[_0xee46('0x7')](0x0,0x2)},function(_0x20ebe4,_0x54416e){if(_0x20ebe4){return _0x125864(_0x20ebe4);}else{return _0x2b3cd3(_0x54416e);}});});}function checkTranscribeJob(_0x113bf2,_0x568890,_0x43ffe3){var _0x44182b;return new BPromise(function(_0x54e1fe,_0x43d0ab){logger[_0xee46('0x8')](util[_0xee46('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x113bf2['id'],_0x113bf2[_0xee46('0xa')]));return getTranscriptionJob(_0x43ffe3[_0xee46('0xb')],_0x43ffe3['data2'],_0x568890[_0xee46('0xc')],_0x113bf2['transcribeName'])[_0xee46('0xd')](function(_0x861be5){logger[_0xee46('0x8')](util[_0xee46('0x9')](_0xee46('0xe'),_0x113bf2['id'],_0x113bf2[_0xee46('0xa')],_0x861be5[_0xee46('0xf')][_0xee46('0x10')]));if(!_0x113bf2[_0xee46('0x11')]){switch(_0x861be5[_0xee46('0xf')]['TranscriptionJobStatus']){case _0xee46('0x12'):var _0x36ea9c={'transcribeStatus':_0x861be5[_0xee46('0xf')][_0xee46('0x10')],'fileUri':_0x861be5[_0xee46('0xf')][_0xee46('0x13')]['TranscriptFileUri']};logger['info'](util[_0xee46('0x9')](_0xee46('0x14'),_0x113bf2['id']));return rp({'uri':_0x861be5[_0xee46('0xf')]['Transcript'][_0xee46('0x15')],'json':!![]})[_0xee46('0xd')](function(_0xf51210){logger[_0xee46('0x8')](util[_0xee46('0x9')](_0xee46('0x16'),_0x113bf2['id']));if(_0xf51210&&_0xf51210[_0xee46('0x17')]&&_0xf51210[_0xee46('0x17')][_0xee46('0x18')]&&_0xf51210[_0xee46('0x17')][_0xee46('0x18')][_0xee46('0x19')]){_0x36ea9c[_0xee46('0x11')]='';for(var _0x2488d5=0x0;_0x2488d5<_0xf51210['results'][_0xee46('0x18')][_0xee46('0x19')];_0x2488d5++){_0x36ea9c['fileText']+=_0xf51210[_0xee46('0x17')][_0xee46('0x18')][_0x2488d5][_0xee46('0x1a')]+'';}}return _0x113bf2['update'](_0x36ea9c);})[_0xee46('0xd')](function(){logger[_0xee46('0x8')](util[_0xee46('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x113bf2['id']));if(!_0x113bf2[_0xee46('0x1b')]){throw new db[(_0xee46('0x1c'))][(_0xee46('0x1d'))](_0xee46('0x1e'));}if(!_0x568890['sentiment']||!_0x568890[_0xee46('0x1f')]||!_0x568890['sentimentRegion']||!_0x568890[_0xee46('0x20')]||!_0x568890[_0xee46('0x21')]){throw new db[(_0xee46('0x1c'))][(_0xee46('0x1d'))](_0xee46('0x22'));}if(!_0x36ea9c[_0xee46('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x568890[_0xee46('0x1f')]===_0x43ffe3['id']){return _0x43ffe3;}else{return db[_0xee46('0x23')]['findOne']({'where':{'id':_settings[_0xee46('0x1f')]}});}})[_0xee46('0xd')](function(_0x4ab694){if(!_0x4ab694){throw new db[(_0xee46('0x1c'))]['ValidationError'](_0xee46('0x24'));}if(!_0x4ab694[_0xee46('0xb')]||!_0x4ab694[_0xee46('0x25')]){throw new db[(_0xee46('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x44182b=_0x4ab694;logger[_0xee46('0x8')](util[_0xee46('0x9')](_0xee46('0x26'),_0x113bf2['id']));return sentiment(_0x44182b['data1'],_0x44182b[_0xee46('0x25')],_0x568890[_0xee46('0x27')],_0x36ea9c[_0xee46('0x11')],_0x568890['language']);})[_0xee46('0xd')](function(_0x210967){logger[_0xee46('0x8')](util['format'](_0xee46('0x28'),_0x113bf2['id']));return _0x113bf2[_0xee46('0x29')]({'sentiment':_0x210967[_0xee46('0x2a')],'sPositive':_0x210967[_0xee46('0x2b')]['Positive'],'sNegative':_0x210967['SentimentScore'][_0xee46('0x2c')],'sMixed':_0x210967[_0xee46('0x2b')]['Mixed'],'sNeutral':_0x210967[_0xee46('0x2b')][_0xee46('0x2d')]});})[_0xee46('0xd')](function(){logger[_0xee46('0x8')](util['format'](_0xee46('0x2e'),_0x113bf2['id']));_0x54e1fe();});case _0xee46('0x2f'):return _0x113bf2['update']({'transcribeStatus':_0xee46('0x2f'),'failureReason':_0x861be5[_0xee46('0xf')][_0xee46('0x30')]})[_0xee46('0xd')](function(){logger[_0xee46('0x8')](util[_0xee46('0x9')](_0xee46('0x2e'),_0x113bf2['id']));_0x54e1fe();});default:logger[_0xee46('0x8')](util[_0xee46('0x9')](_0xee46('0x31'),_0x113bf2['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x113bf2[_0xee46('0x1b')]){throw new db[(_0xee46('0x1c'))][(_0xee46('0x1d'))](_0xee46('0x1e'));}if(!_0x568890[_0xee46('0x32')]||!_0x568890[_0xee46('0x1f')]||!_0x568890[_0xee46('0x27')]||!_0x568890[_0xee46('0x20')]||!_0x568890[_0xee46('0x21')]){throw new db['Sequelize'][(_0xee46('0x1d'))](_0xee46('0x22'));}if(!_0x113bf2[_0xee46('0x11')]){throw new Error(_0xee46('0x33'));}if(_0x568890['sentimentAccountId']===_0x43ffe3['id']){return _0x43ffe3;}else{return db['CloudProvider'][_0xee46('0x34')]({'where':{'id':_settings[_0xee46('0x1f')]}});}})['then'](function(_0x2d15f6){if(!_0x2d15f6){throw new db['Sequelize'][(_0xee46('0x1d'))](_0xee46('0x24'));}if(!_0x2d15f6[_0xee46('0xb')]||!_0x2d15f6[_0xee46('0x25')]){throw new db[(_0xee46('0x1c'))]['ValidationError'](_0xee46('0x35'));}_0x44182b=_0x2d15f6;logger['info'](util[_0xee46('0x9')](_0xee46('0x26'),_0x113bf2['id']));return sentiment(_0x44182b[_0xee46('0xb')],_0x44182b[_0xee46('0x25')],_0x568890[_0xee46('0x27')],_0x113bf2[_0xee46('0x11')],_0x568890[_0xee46('0x20')]);})[_0xee46('0xd')](function(_0x72f3ce){logger[_0xee46('0x8')](util[_0xee46('0x9')](_0xee46('0x28'),_0x113bf2['id']));return _0x113bf2[_0xee46('0x29')]({'sentiment':_0x72f3ce[_0xee46('0x2a')],'sPositive':_0x72f3ce[_0xee46('0x2b')][_0xee46('0x36')],'sNegative':_0x72f3ce[_0xee46('0x2b')][_0xee46('0x2c')],'sMixed':_0x72f3ce['SentimentScore'][_0xee46('0x37')],'sNeutral':_0x72f3ce['SentimentScore'][_0xee46('0x2d')],'transcribeStatus':_0xee46('0x12')});})['then'](function(){logger[_0xee46('0x8')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x113bf2['id']));_0x54e1fe();});}})['catch'](function(_0x47a2bf){if(_0x47a2bf){if(!_0x47a2bf[_0xee46('0x38')]||_0x47a2bf[_0xee46('0x38')]!==_0xee46('0x39')){logger[_0xee46('0x3a')](util[_0xee46('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x113bf2['id']),util[_0xee46('0x3b')](_0x47a2bf,{'showHidden':![],'depth':null}));}}_0x54e1fe();});});}function checkTranscribe(){var _0x5a1386;var _0x46b30f;var _0xe44195;return db[_0xee46('0x3c')][_0xee46('0x3d')]({'where':{'transcribeStatus':_0xee46('0x3e')}})['then'](function(_0xbca323){if(!_0xbca323||!_0xbca323[_0xee46('0x19')]){throw new db[(_0xee46('0x1c'))][(_0xee46('0x1d'))](_0xee46('0x3f'));}_0x5a1386=_0xbca323;return db[_0xee46('0x40')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x227673){if(!_0x227673){throw new db['Sequelize'][(_0xee46('0x1d'))](_0xee46('0x41'));}_0x46b30f=_0x227673;if(!_0x46b30f[_0xee46('0x3')]||!_0x46b30f[_0xee46('0x42')]||!_0x46b30f['transcribeRegion']||!_0x46b30f[_0xee46('0x20')]||!_0x46b30f[_0xee46('0x21')]){throw new db[(_0xee46('0x1c'))][(_0xee46('0x1d'))]('Transcribe\x20not\x20configured');}return db[_0xee46('0x23')][_0xee46('0x34')]({'where':{'id':_0x46b30f[_0xee46('0x42')]}});})[_0xee46('0xd')](function(_0x3896aa){if(!_0x3896aa){throw new db[(_0xee46('0x1c'))][(_0xee46('0x1d'))](_0xee46('0x24'));}if(!_0x3896aa['data1']||!_0x3896aa[_0xee46('0x25')]){throw new db[(_0xee46('0x1c'))][(_0xee46('0x1d'))](_0xee46('0x35'));}_0xe44195=_0x3896aa;var _0x246f0b=[];_0x5a1386['forEach'](function(_0x518e5d){_0x246f0b[_0xee46('0x43')](checkTranscribeJob(_0x518e5d,_0x46b30f,_0xe44195));});return BPromise[_0xee46('0x44')](_0x246f0b);})[_0xee46('0x45')](function(_0x1cc079){if(_0x1cc079){if(!_0x1cc079['name']||_0x1cc079[_0xee46('0x38')]!==_0xee46('0x39')){logger['error'](util[_0xee46('0x3b')](_0x1cc079,{'showHidden':![],'depth':null}));}}});}exports[_0xee46('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index f85d226..c6dfa61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f47=['catch','util','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','destroy','then','CmContact','bulkCreate','log','finished\x20populating','CmHopper','hopper1','contacts2'];(function(_0x59614e,_0x289431){var _0x84dc0b=function(_0x555d99){while(--_0x555d99){_0x59614e['push'](_0x59614e['shift']());}};_0x84dc0b(++_0x289431);}(_0x5f47,0x133));var _0x75f4=function(_0x15f427,_0x396103){_0x15f427=_0x15f427-0x0;var _0x52294f=_0x5f47[_0x15f427];return _0x52294f;};'use strict';var util=require(_0x75f4('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x75f4('0x1')+i,'lastName':_0x75f4('0x2')+i,'phone':0xf879fb460+i,'email':_0x75f4('0x3')+i+_0x75f4('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x75f4('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x75f4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x75f4('0x6')](),'updatedAt':Date[_0x75f4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x75f4('0x5')]({'id':i,'firstName':_0x75f4('0x1')+i,'lastName':_0x75f4('0x2')+i,'phone':0xf879fb460+i,'email':_0x75f4('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x75f4('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x75f4('0x6')](),'updatedAt':Date[_0x75f4('0x6')]()});}db['CmContact'][_0x75f4('0x7')]({'where':{}})[_0x75f4('0x8')](function(){return db[_0x75f4('0x9')][_0x75f4('0xa')](contacts);})[_0x75f4('0x8')](function(){console[_0x75f4('0xb')](_0x75f4('0xc'),'contacts1');return db[_0x75f4('0xd')][_0x75f4('0x7')]({'where':{}});})[_0x75f4('0x8')](function(){return db[_0x75f4('0xd')][_0x75f4('0xa')](hopper);})['then'](function(){console['log'](_0x75f4('0xc'),_0x75f4('0xe'));return db[_0x75f4('0x9')][_0x75f4('0xa')](contacts2);})[_0x75f4('0x8')](function(){console[_0x75f4('0xb')](_0x75f4('0xc'),_0x75f4('0xf'));return db['CmHopper'][_0x75f4('0xa')](hopper2);})[_0x75f4('0x8')](function(){console['log'](_0x75f4('0xc'),'hopper2');})[_0x75f4('0x10')](function(_0x460bfb){console['log'](_0x460bfb);});
\ No newline at end of file
+var _0x12fc=['hopper2','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2'];(function(_0x256fda,_0x23cb52){var _0x333a5a=function(_0x50754d){while(--_0x50754d){_0x256fda['push'](_0x256fda['shift']());}};_0x333a5a(++_0x23cb52);}(_0x12fc,0x166));var _0xc12f=function(_0x326efa,_0x470335){_0x326efa=_0x326efa-0x0;var _0x529d4f=_0x12fc[_0x326efa];return _0x529d4f;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc12f('0x0')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc12f('0x1')+i,'phone':0xf879fb460+i,'email':_0xc12f('0x2')+i+_0xc12f('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc12f('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xc12f('0x5')+i,'lastName':_0xc12f('0x1')+i,'phone':0xf879fb460+i,'email':_0xc12f('0x2')+i+_0xc12f('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xc12f('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc12f('0x4')](),'updatedAt':Date[_0xc12f('0x4')]()});}db[_0xc12f('0x6')][_0xc12f('0x7')]({'where':{}})['then'](function(){return db[_0xc12f('0x6')][_0xc12f('0x8')](contacts);})[_0xc12f('0x9')](function(){console[_0xc12f('0xa')](_0xc12f('0xb'),_0xc12f('0xc'));return db['CmHopper']['destroy']({'where':{}});})[_0xc12f('0x9')](function(){return db[_0xc12f('0xd')][_0xc12f('0x8')](hopper);})[_0xc12f('0x9')](function(){console['log'](_0xc12f('0xb'),_0xc12f('0xe'));return db[_0xc12f('0x6')][_0xc12f('0x8')](contacts2);})[_0xc12f('0x9')](function(){console['log'](_0xc12f('0xb'),_0xc12f('0xf'));return db[_0xc12f('0xd')]['bulkCreate'](hopper2);})[_0xc12f('0x9')](function(){console['log'](_0xc12f('0xb'),_0xc12f('0x10'));})['catch'](function(_0x6055bf){console[_0xc12f('0xa')](_0x6055bf);});
\ No newline at end of file
index 180b0e5..d1d6fec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd106=['friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password'];(function(_0x337f8b,_0x452e07){var _0x1afaeb=function(_0x50c05e){while(--_0x50c05e){_0x337f8b['push'](_0x337f8b['shift']());}};_0x1afaeb(++_0x452e07);}(_0xd106,0x1c6));var _0x6d10=function(_0x4d10f6,_0x38388b){_0x4d10f6=_0x4d10f6-0x0;var _0x166912=_0xd106[_0x4d10f6];return _0x166912;};'use strict';var util=require(_0x6d10('0x0'));var db=require(_0x6d10('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x6d10('0x2')]({'name':util[_0x6d10('0x3')](_0x6d10('0x4'),_0x6d10('0x5'),i),'fullname':util[_0x6d10('0x3')]('%s%s','agent',i),'email':util[_0x6d10('0x3')](_0x6d10('0x6'),_0x6d10('0x5'),i),'role':_0x6d10('0x5'),'password':_0x6d10('0x7'),'internal':0xfa0+i,'type':_0x6d10('0x8'),'transport':[_0x6d10('0x9'),'ws','wss'],'disallow':[_0x6d10('0xa')],'allow':[_0x6d10('0xb')],'defaultuser':util['format'](_0x6d10('0x4'),_0x6d10('0x5'),i),'encryption':_0x6d10('0xc'),'avpf':_0x6d10('0xc'),'force_avp':_0x6d10('0xc'),'icesupport':_0x6d10('0xc'),'dtlsenable':_0x6d10('0xc'),'dtlsverify':'no','dtlscertfile':_0x6d10('0xd'),'dtlsprivatekey':_0x6d10('0xe'),'dtlssetup':_0x6d10('0xf'),'callerid':util[_0x6d10('0x3')]('\x22%s\x22\x20<%s>',util[_0x6d10('0x3')](_0x6d10('0x4'),_0x6d10('0x5'),i),0xfa0+i)});}db[_0x6d10('0x10')][_0x6d10('0x11')](users)[_0x6d10('0x12')](function(){console['log'](_0x6d10('0x13'));})[_0x6d10('0x14')](function(_0x2189c9){console['log'](_0x2189c9);});
\ No newline at end of file
+var _0xd8ec=['%s%s','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','push','format','agent'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0xd8ec,0x1d7));var _0xcd8e=function(_0x594821,_0x153b6c){_0x594821=_0x594821-0x0;var _0x139112=_0xd8ec[_0x594821];return _0x139112;};'use strict';var util=require('util');var db=require(_0xcd8e('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xcd8e('0x1')]({'name':util[_0xcd8e('0x2')]('%s%s',_0xcd8e('0x3'),i),'fullname':util[_0xcd8e('0x2')](_0xcd8e('0x4'),_0xcd8e('0x3'),i),'email':util[_0xcd8e('0x2')]('%s%s@xcally.com','agent',i),'role':_0xcd8e('0x3'),'password':_0xcd8e('0x5'),'internal':0xfa0+i,'type':_0xcd8e('0x6'),'transport':['udp','ws',_0xcd8e('0x7')],'disallow':[_0xcd8e('0x8')],'allow':[_0xcd8e('0x9')],'defaultuser':util[_0xcd8e('0x2')](_0xcd8e('0x4'),_0xcd8e('0x3'),i),'encryption':'yes','avpf':_0xcd8e('0xa'),'force_avp':_0xcd8e('0xa'),'icesupport':_0xcd8e('0xa'),'dtlsenable':_0xcd8e('0xa'),'dtlsverify':'no','dtlscertfile':_0xcd8e('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util['format'](_0xcd8e('0xc'),util[_0xcd8e('0x2')](_0xcd8e('0x4'),_0xcd8e('0x3'),i),0xfa0+i)});}db[_0xcd8e('0xd')][_0xcd8e('0xe')](users)[_0xcd8e('0xf')](function(){console[_0xcd8e('0x10')](_0xcd8e('0x11'));})[_0xcd8e('0x12')](function(_0xf6b857){console[_0xcd8e('0x10')](_0xf6b857);});
\ No newline at end of file
index edb6911..cf6a399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f4a=['removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','User','role','agent','type','ivr','UserProfileSection','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','then','%s:queue:%s','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','ChatQueue','push','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','VoiceQueue','MailQueue','WhatsappQueue','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','length','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove'];(function(_0x2cb633,_0x5caee0){var _0x4b1a20=function(_0x4ea50f){while(--_0x4ea50f){_0x2cb633['push'](_0x2cb633['shift']());}};_0x4b1a20(++_0x5caee0);}(_0x9f4a,0x13b));var _0xa9f4=function(_0x3bba27,_0x1117a1){_0x3bba27=_0x3bba27-0x0;var _0x1a6480=_0x9f4a[_0x3bba27];return _0x1a6480;};'use strict';var _=require(_0xa9f4('0x0'));var util=require(_0xa9f4('0x1'));var BPromise=require('bluebird');var db=require(_0xa9f4('0x2'))['db'];var config=require(_0xa9f4('0x3'));var queryQueues={'attributes':['id',_0xa9f4('0x4')],'include':[{'as':_0xa9f4('0x5'),'model':db[_0xa9f4('0x6')],'attributes':['id','name',_0xa9f4('0x7')],'raw':!![],'where':{'role':_0xa9f4('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa9f4('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xa9f4('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xa9f4('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xa9f4('0x9')],'where':{'type':_0xa9f4('0xa')}};function getAssociatedResources(_0x40b719,_0xf75834,_0x28ecae){return db[_0xa9f4('0xb')]['findOne']({'where':{'name':_0x40b719,'userProfileId':_0xf75834},'raw':!![]})['then'](function(_0x23d256){if(_0x23d256){if(_0x23d256[_0xa9f4('0xc')]){switch(_0x40b719){case'VoiceQueues':case _0xa9f4('0xd'):case _0xa9f4('0xe'):case _0xa9f4('0xf'):case _0xa9f4('0x10'):case'OpenchannelQueues':case _0xa9f4('0x11'):return db[_0x28ecae][_0xa9f4('0x12')](queryQueues);case _0xa9f4('0x13'):return db[_0x28ecae][_0xa9f4('0x12')](queryTelephones);case _0xa9f4('0x14'):return db[_0x28ecae][_0xa9f4('0x12')](queryTrunks);case _0xa9f4('0x15'):return db[_0x28ecae][_0xa9f4('0x12')](queryCampaigns);}}else{return db[_0xa9f4('0x16')][_0xa9f4('0x12')]({'attributes':[_0xa9f4('0x17')],'where':{'sectionId':_0x23d256['id']},'raw':!![]})['then'](function(_0x1de9b3){if(_0x1de9b3){var _0xb5b642={'where':{'id':_[_0xa9f4('0x18')](_0x1de9b3,_0xa9f4('0x17'))},'raw':!![]};switch(_0x28ecae){case _0xa9f4('0x6'):_0xb5b642['where'][_0xa9f4('0x7')]='telephone';break;case _0xa9f4('0x19'):_0xb5b642[_0xa9f4('0x1a')][_0xa9f4('0x9')]=_0xa9f4('0xa');break;}return db[_0x28ecae]['findAll'](_0xb5b642);}else{return[];}});}}else{return[];}})[_0xa9f4('0x1b')](function(_0x39faad){return _0x39faad;});}function joinOrLeaveQueues(_0x4e8194,_0x3955cb,_0x2b728b,_0x46d158){_0x4e8194[_0x3955cb](util['format'](_0xa9f4('0x1c'),_0x2b728b,_0x46d158['name']));if(_0x46d158[_0xa9f4('0x5')]){for(var _0x1ebf39=0x0;_0x1ebf39<_0x46d158[_0xa9f4('0x5')]['length'];_0x1ebf39+=0x1){_0x4e8194[_0x3955cb](util[_0xa9f4('0x1d')](_0xa9f4('0x1e'),_0x46d158['Agents'][_0x1ebf39]['name']));}}}function joinOrLeave(_0x53a82e,_0x2f2210,_0x2e4f4d){var _0x46e913;if(_0x53a82e[_0xa9f4('0x1f')][_0xa9f4('0x20')]['id']){db[_0xa9f4('0x6')][_0xa9f4('0x21')]({'attributes':['id','name',_0xa9f4('0x7'),_0xa9f4('0x22')],'where':{'id':_0x53a82e[_0xa9f4('0x1f')][_0xa9f4('0x20')]['id']},'include':[{'model':db[_0xa9f4('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xa9f4('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xa9f4('0x25')],'as':_0xa9f4('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xa9f4('0x27')],'as':_0xa9f4('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xa9f4('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xa9f4('0x2a')],'as':_0xa9f4('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xa9f4('0x1b')](function(_0x5dbe41){if(_0x5dbe41){_0x46e913=_0x5dbe41;_0x53a82e[_0x2f2210](util[_0xa9f4('0x1d')](_0xa9f4('0x1e'),_0x5dbe41[_0xa9f4('0x4')]));var _0x88aa77=[];switch(_0x5dbe41[_0xa9f4('0x7')]){case _0xa9f4('0x2c'):_0x53a82e[_0x2f2210](_0xa9f4('0x2d'));_0x53a82e[_0x2f2210](_0xa9f4('0x2e'));if(queryQueues[_0xa9f4('0x2f')](_0xa9f4('0x30'))){delete queryQueues['include'];}_0x88aa77['push'](db['VoiceQueue'][_0xa9f4('0x12')](queryQueues));_0x88aa77['push'](db[_0xa9f4('0x31')][_0xa9f4('0x12')](queryQueues));_0x88aa77[_0xa9f4('0x32')](db[_0xa9f4('0x33')][_0xa9f4('0x12')](queryQueues));_0x88aa77[_0xa9f4('0x32')](db[_0xa9f4('0x34')]['findAll'](queryQueues));_0x88aa77['push'](db['MailQueue'][_0xa9f4('0x12')](queryQueues));_0x88aa77[_0xa9f4('0x32')](db[_0xa9f4('0x35')][_0xa9f4('0x12')](queryQueues));_0x88aa77['push'](db['WhatsappQueue'][_0xa9f4('0x12')](queryQueues));_0x88aa77[_0xa9f4('0x32')](db[_0xa9f4('0x6')][_0xa9f4('0x12')](queryTelephones));_0x88aa77[_0xa9f4('0x32')](db[_0xa9f4('0x36')][_0xa9f4('0x12')](queryTrunks));_0x88aa77[_0xa9f4('0x32')](db[_0xa9f4('0x19')]['findAll'](queryCampaigns));_0x88aa77[_0xa9f4('0x32')](db[_0xa9f4('0x6')][_0xa9f4('0x12')](queryAgents));break;case _0xa9f4('0x37'):_0x53a82e[_0x2f2210](_0xa9f4('0x2d'));_0x53a82e[_0x2f2210](_0xa9f4('0x2e'));_0x88aa77['push'](getAssociatedResources('VoiceQueues',_0x5dbe41[_0xa9f4('0x22')],_0xa9f4('0x38')));_0x88aa77[_0xa9f4('0x32')](getAssociatedResources(_0xa9f4('0xd'),_0x5dbe41['userProfileId'],'ChatQueue'));_0x88aa77['push'](getAssociatedResources(_0xa9f4('0xe'),_0x5dbe41['userProfileId'],_0xa9f4('0x33')));_0x88aa77['push'](getAssociatedResources('SmsQueues',_0x5dbe41['userProfileId'],'SmsQueue'));_0x88aa77[_0xa9f4('0x32')](getAssociatedResources(_0xa9f4('0x10'),_0x5dbe41[_0xa9f4('0x22')],_0xa9f4('0x39')));_0x88aa77[_0xa9f4('0x32')](getAssociatedResources('OpenchannelQueues',_0x5dbe41[_0xa9f4('0x22')],'OpenchannelQueue'));_0x88aa77[_0xa9f4('0x32')](getAssociatedResources(_0xa9f4('0x11'),_0x5dbe41[_0xa9f4('0x22')],_0xa9f4('0x3a')));_0x88aa77[_0xa9f4('0x32')](getAssociatedResources('Telephones',_0x5dbe41['userProfileId'],_0xa9f4('0x6')));_0x88aa77['push'](getAssociatedResources('Trunks',_0x5dbe41[_0xa9f4('0x22')],_0xa9f4('0x36')));_0x88aa77[_0xa9f4('0x32')](getAssociatedResources(_0xa9f4('0x15'),_0x5dbe41[_0xa9f4('0x22')],_0xa9f4('0x19')));_0x88aa77[_0xa9f4('0x32')](db[_0xa9f4('0x6')][_0xa9f4('0x12')](queryAgents));break;case _0xa9f4('0x8'):_0x53a82e[_0x2f2210](_0xa9f4('0x2d'));_0x53a82e[_0x2f2210](_0xa9f4('0x2e'));_0x88aa77[_0xa9f4('0x32')](_0x5dbe41['getVoiceQueues']({'attributes':['id',_0xa9f4('0x4')]}));_0x88aa77['push'](_0x5dbe41[_0xa9f4('0x3b')]({'attributes':['id',_0xa9f4('0x4')]}));_0x88aa77[_0xa9f4('0x32')](_0x5dbe41[_0xa9f4('0x3c')]({'attributes':['id',_0xa9f4('0x4')]}));_0x88aa77[_0xa9f4('0x32')](_0x5dbe41[_0xa9f4('0x3d')]({'attributes':['id','name']}));_0x88aa77[_0xa9f4('0x32')](_0x5dbe41[_0xa9f4('0x3e')]({'attributes':['id',_0xa9f4('0x4')]}));_0x88aa77['push'](_0x5dbe41['getOpenchannelQueues']({'attributes':['id',_0xa9f4('0x4')]}));_0x88aa77[_0xa9f4('0x32')](_0x5dbe41[_0xa9f4('0x3f')]({'attributes':['id',_0xa9f4('0x4')]}));break;}return BPromise['all'](_0x88aa77);}})['then'](function(_0x4d6095){if(_0x4d6095&&_0x4d6095[_0xa9f4('0x40')]){for(var _0x378417=0x0;_0x378417<_0x4d6095['length'];_0x378417+=0x1){for(var _0x71e5a9=0x0;_0x71e5a9<_0x4d6095[_0x378417][_0xa9f4('0x40')];_0x71e5a9+=0x1){switch(_0x378417){case 0x0:joinOrLeaveQueues(_0x53a82e,_0x2f2210,'voice',_0x4d6095[_0x378417][_0x71e5a9]);break;case 0x1:joinOrLeaveQueues(_0x53a82e,_0x2f2210,'chat',_0x4d6095[_0x378417][_0x71e5a9]);break;case 0x2:joinOrLeaveQueues(_0x53a82e,_0x2f2210,_0xa9f4('0x41'),_0x4d6095[_0x378417][_0x71e5a9]);break;case 0x3:joinOrLeaveQueues(_0x53a82e,_0x2f2210,_0xa9f4('0x42'),_0x4d6095[_0x378417][_0x71e5a9]);break;case 0x4:joinOrLeaveQueues(_0x53a82e,_0x2f2210,_0xa9f4('0x43'),_0x4d6095[_0x378417][_0x71e5a9]);break;case 0x5:joinOrLeaveQueues(_0x53a82e,_0x2f2210,'openchannel',_0x4d6095[_0x378417][_0x71e5a9]);break;case 0x6:joinOrLeaveQueues(_0x53a82e,_0x2f2210,_0xa9f4('0x44'),_0x4d6095[_0x378417][_0x71e5a9]);break;case 0x7:_0x53a82e[_0x2f2210](util[_0xa9f4('0x1d')](_0xa9f4('0x45'),_0x4d6095[_0x378417][_0x71e5a9]['name']));break;case 0x8:_0x53a82e[_0x2f2210](util[_0xa9f4('0x1d')](_0xa9f4('0x46'),_0x4d6095[_0x378417][_0x71e5a9][_0xa9f4('0x4')]));break;case 0x9:_0x53a82e[_0x2f2210](util[_0xa9f4('0x1d')](_0xa9f4('0x47'),_0x4d6095[_0x378417][_0x71e5a9][_0xa9f4('0x9')],_0x4d6095[_0x378417][_0x71e5a9]['name']));break;case 0xa:_0x53a82e[_0x2f2210](util[_0xa9f4('0x1d')]('user:%s',_0x4d6095[_0x378417][_0x71e5a9][_0xa9f4('0x4')]));break;}}}}})[_0xa9f4('0x1b')](function(){if(_0x2f2210===_0xa9f4('0x48')){var _0x374dd6=_[_0xa9f4('0x18')](_0x46e913[_0xa9f4('0x49')],'id');return _0x46e913[_0xa9f4('0x4a')](_0x374dd6)['then'](function(){for(var _0x2f3a7d=0x0;_0x2f3a7d<_0x374dd6[_0xa9f4('0x40')];_0x2f3a7d+=0x1){_0x2e4f4d[_0xa9f4('0x4b')](_0xa9f4('0x4c'),{'ChatInteractionId':Number(_0x374dd6[_0x2f3a7d]),'UserId':Number(_0x46e913['id'])});}});}})[_0xa9f4('0x1b')](function(){if(_0x2f2210==='leave'){var _0x2a21ab=_[_0xa9f4('0x18')](_0x46e913[_0xa9f4('0x24')],'id');return _0x46e913[_0xa9f4('0x4d')](_0x2a21ab)[_0xa9f4('0x1b')](function(){for(var _0x5af8e2=0x0;_0x5af8e2<_0x2a21ab[_0xa9f4('0x40')];_0x5af8e2+=0x1){_0x2e4f4d[_0xa9f4('0x4b')](_0xa9f4('0x4e'),{'MailInteractionId':Number(_0x2a21ab[_0x5af8e2]),'UserId':Number(_0x46e913['id'])});}});}})['then'](function(){if(_0x2f2210==='leave'){var _0x55cf4e=_[_0xa9f4('0x18')](_0x46e913[_0xa9f4('0x26')],'id');return _0x46e913[_0xa9f4('0x4f')](_0x55cf4e)[_0xa9f4('0x1b')](function(){for(var _0x44d356=0x0;_0x44d356<_0x55cf4e['length'];_0x44d356+=0x1){_0x2e4f4d[_0xa9f4('0x4b')](_0xa9f4('0x50'),{'FaxInteractionId':Number(_0x55cf4e[_0x44d356]),'UserId':Number(_0x46e913['id'])});}});}})[_0xa9f4('0x1b')](function(){if(_0x2f2210==='leave'){var _0x2a3f8c=_[_0xa9f4('0x18')](_0x46e913['SmsInteractions'],'id');return _0x46e913['removeSmsInteractions'](_0x2a3f8c)[_0xa9f4('0x1b')](function(){for(var _0x2116ae=0x0;_0x2116ae<_0x2a3f8c[_0xa9f4('0x40')];_0x2116ae+=0x1){_0x2e4f4d[_0xa9f4('0x4b')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2a3f8c[_0x2116ae]),'UserId':Number(_0x46e913['id'])});}});}})[_0xa9f4('0x1b')](function(){if(_0x2f2210==='leave'){var _0x17aa42=_[_0xa9f4('0x18')](_0x46e913[_0xa9f4('0x29')],'id');return _0x46e913[_0xa9f4('0x51')](_0x17aa42)[_0xa9f4('0x1b')](function(){for(var _0x1118f3=0x0;_0x1118f3<_0x17aa42['length'];_0x1118f3+=0x1){_0x2e4f4d['emit'](_0xa9f4('0x52'),{'OpenchannelInteractionId':Number(_0x17aa42[_0x1118f3]),'UserId':Number(_0x46e913['id'])});}});}})[_0xa9f4('0x1b')](function(){if(_0x2f2210==='leave'){var _0xdab240=_[_0xa9f4('0x18')](_0x46e913[_0xa9f4('0x2b')],'id');return _0x46e913[_0xa9f4('0x53')](_0xdab240)[_0xa9f4('0x1b')](function(){for(var _0xc52ee6=0x0;_0xc52ee6<_0xdab240[_0xa9f4('0x40')];_0xc52ee6+=0x1){_0x2e4f4d[_0xa9f4('0x4b')](_0xa9f4('0x54'),{'WhatsappInteractionId':Number(_0xdab240[_0xc52ee6]),'UserId':Number(_0x46e913['id'])});}});}})[_0xa9f4('0x55')](function(_0x24ba89){_0x53a82e[_0xa9f4('0x56')](_0x24ba89);});}}function onDisconnect(_0x4abda6,_0x407686){joinOrLeave(_0x4abda6,_0xa9f4('0x48'),_0x407686);}function onConnect(_0x32ebb5){joinOrLeave(_0x32ebb5,_0xa9f4('0x57'));}exports[_0xa9f4('0x58')]=function(_0x4c17c9){_0x4c17c9['on'](_0xa9f4('0x59'),function(_0x2d5414){_0x2d5414[_0xa9f4('0x5a')](0x0);_0x2d5414[_0xa9f4('0x5b')]=_0x2d5414[_0xa9f4('0x5c')][_0xa9f4('0x59')][_0xa9f4('0x5d')]+':'+_0x2d5414['request'][_0xa9f4('0x59')][_0xa9f4('0x5e')];_0x2d5414[_0xa9f4('0x5f')]=new Date();_0x2d5414['log']=function(_0xafca6){console[_0xa9f4('0x56')](_0xa9f4('0x60')+_0x2d5414[_0xa9f4('0x61')]['name']+'['+_0x2d5414['address']+']',_0xafca6);};_0x2d5414['on']('disconnect',function(){onDisconnect(_0x2d5414,_0x4c17c9);_0x2d5414[_0xa9f4('0x56')]('DISCONNECTED');});onConnect(_0x2d5414);_0x2d5414[_0xa9f4('0x56')](_0xa9f4('0x62'));});};
\ No newline at end of file
+var _0x9b23=['remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','findOne','then','autoAssociation','ChatQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','UserProfileResource','resourceId','map','where','Campaign','ivr','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','hasOwnProperty','include','push','FaxQueue','SmsQueue','MailQueue','Trunk','voice:inbound','VoiceQueues','ChatQueue','FaxQueues','OpenchannelQueue','WhatsappQueue','Telephones','IvrCampaigns','voice:outbound','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9b23,0x136));var _0x39b2=function(_0x342db7,_0x162bf0){_0x342db7=_0x342db7-0x0;var _0x4c3b3c=_0x9b23[_0x342db7];return _0x4c3b3c;};'use strict';var _=require(_0x39b2('0x0'));var util=require(_0x39b2('0x1'));var BPromise=require(_0x39b2('0x2'));var db=require(_0x39b2('0x3'))['db'];var config=require(_0x39b2('0x4'));var queryQueues={'attributes':['id',_0x39b2('0x5')],'include':[{'as':_0x39b2('0x6'),'model':db[_0x39b2('0x7')],'attributes':['id',_0x39b2('0x5'),_0x39b2('0x8')],'raw':!![],'where':{'role':_0x39b2('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x39b2('0x5')],'where':{'role':_0x39b2('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x39b2('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x39b2('0x5')],'where':{'role':_0x39b2('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x39b2('0x5'),_0x39b2('0xb')],'where':{'type':'ivr'}};function getAssociatedResources(_0x47f80c,_0x2c8778,_0x4bdba){return db['UserProfileSection'][_0x39b2('0xc')]({'where':{'name':_0x47f80c,'userProfileId':_0x2c8778},'raw':!![]})[_0x39b2('0xd')](function(_0x14bfcb){if(_0x14bfcb){if(_0x14bfcb[_0x39b2('0xe')]){switch(_0x47f80c){case'VoiceQueues':case _0x39b2('0xf'):case'FaxQueues':case'SmsQueues':case _0x39b2('0x10'):case _0x39b2('0x11'):case _0x39b2('0x12'):return db[_0x4bdba][_0x39b2('0x13')](queryQueues);case'Telephones':return db[_0x4bdba][_0x39b2('0x13')](queryTelephones);case _0x39b2('0x14'):return db[_0x4bdba][_0x39b2('0x13')](queryTrunks);case'IvrCampaigns':return db[_0x4bdba][_0x39b2('0x13')](queryCampaigns);}}else{return db[_0x39b2('0x15')][_0x39b2('0x13')]({'attributes':[_0x39b2('0x16')],'where':{'sectionId':_0x14bfcb['id']},'raw':!![]})[_0x39b2('0xd')](function(_0x366e20){if(_0x366e20){var _0x2b1e13={'where':{'id':_[_0x39b2('0x17')](_0x366e20,_0x39b2('0x16'))},'raw':!![]};switch(_0x4bdba){case _0x39b2('0x7'):_0x2b1e13[_0x39b2('0x18')][_0x39b2('0x8')]=_0x39b2('0xa');break;case _0x39b2('0x19'):_0x2b1e13[_0x39b2('0x18')][_0x39b2('0xb')]=_0x39b2('0x1a');break;}return db[_0x4bdba][_0x39b2('0x13')](_0x2b1e13);}else{return[];}});}}else{return[];}})['then'](function(_0x4d026e){return _0x4d026e;});}function joinOrLeaveQueues(_0x116b0a,_0x568174,_0x3d798f,_0x4ef3ff){_0x116b0a[_0x568174](util[_0x39b2('0x1b')]('%s:queue:%s',_0x3d798f,_0x4ef3ff[_0x39b2('0x5')]));if(_0x4ef3ff[_0x39b2('0x6')]){for(var _0xba4a90=0x0;_0xba4a90<_0x4ef3ff['Agents'][_0x39b2('0x1c')];_0xba4a90+=0x1){_0x116b0a[_0x568174](util[_0x39b2('0x1b')](_0x39b2('0x1d'),_0x4ef3ff['Agents'][_0xba4a90][_0x39b2('0x5')]));}}}function joinOrLeave(_0x303ce3,_0x180969,_0x17dddc){var _0x207818;if(_0x303ce3[_0x39b2('0x1e')][_0x39b2('0x1f')]['id']){db[_0x39b2('0x7')][_0x39b2('0x20')]({'attributes':['id',_0x39b2('0x5'),'role',_0x39b2('0x21')],'where':{'id':_0x303ce3[_0x39b2('0x1e')][_0x39b2('0x1f')]['id']},'include':[{'model':db[_0x39b2('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x39b2('0x23')],'as':_0x39b2('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x39b2('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x39b2('0x26')],'as':_0x39b2('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x39b2('0x28')],'as':_0x39b2('0x29'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x39b2('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x39b2('0xd')](function(_0x17f74d){if(_0x17f74d){_0x207818=_0x17f74d;_0x303ce3[_0x180969](util['format'](_0x39b2('0x1d'),_0x17f74d['name']));var _0x3ceee9=[];switch(_0x17f74d[_0x39b2('0x8')]){case _0x39b2('0x2b'):_0x303ce3[_0x180969]('voice:inbound');_0x303ce3[_0x180969]('voice:outbound');if(queryQueues[_0x39b2('0x2c')](_0x39b2('0x2d'))){delete queryQueues[_0x39b2('0x2d')];}_0x3ceee9[_0x39b2('0x2e')](db['VoiceQueue']['findAll'](queryQueues));_0x3ceee9[_0x39b2('0x2e')](db['ChatQueue']['findAll'](queryQueues));_0x3ceee9[_0x39b2('0x2e')](db[_0x39b2('0x2f')][_0x39b2('0x13')](queryQueues));_0x3ceee9['push'](db[_0x39b2('0x30')][_0x39b2('0x13')](queryQueues));_0x3ceee9[_0x39b2('0x2e')](db[_0x39b2('0x31')][_0x39b2('0x13')](queryQueues));_0x3ceee9[_0x39b2('0x2e')](db['OpenchannelQueue']['findAll'](queryQueues));_0x3ceee9['push'](db['WhatsappQueue'][_0x39b2('0x13')](queryQueues));_0x3ceee9['push'](db[_0x39b2('0x7')][_0x39b2('0x13')](queryTelephones));_0x3ceee9['push'](db[_0x39b2('0x32')]['findAll'](queryTrunks));_0x3ceee9[_0x39b2('0x2e')](db[_0x39b2('0x19')][_0x39b2('0x13')](queryCampaigns));_0x3ceee9[_0x39b2('0x2e')](db['User'][_0x39b2('0x13')](queryAgents));break;case'user':_0x303ce3[_0x180969](_0x39b2('0x33'));_0x303ce3[_0x180969]('voice:outbound');_0x3ceee9[_0x39b2('0x2e')](getAssociatedResources(_0x39b2('0x34'),_0x17f74d[_0x39b2('0x21')],'VoiceQueue'));_0x3ceee9[_0x39b2('0x2e')](getAssociatedResources('ChatQueues',_0x17f74d[_0x39b2('0x21')],_0x39b2('0x35')));_0x3ceee9[_0x39b2('0x2e')](getAssociatedResources(_0x39b2('0x36'),_0x17f74d[_0x39b2('0x21')],_0x39b2('0x2f')));_0x3ceee9[_0x39b2('0x2e')](getAssociatedResources('SmsQueues',_0x17f74d[_0x39b2('0x21')],_0x39b2('0x30')));_0x3ceee9[_0x39b2('0x2e')](getAssociatedResources(_0x39b2('0x10'),_0x17f74d[_0x39b2('0x21')],'MailQueue'));_0x3ceee9['push'](getAssociatedResources(_0x39b2('0x11'),_0x17f74d[_0x39b2('0x21')],_0x39b2('0x37')));_0x3ceee9[_0x39b2('0x2e')](getAssociatedResources(_0x39b2('0x12'),_0x17f74d[_0x39b2('0x21')],_0x39b2('0x38')));_0x3ceee9[_0x39b2('0x2e')](getAssociatedResources(_0x39b2('0x39'),_0x17f74d[_0x39b2('0x21')],'User'));_0x3ceee9[_0x39b2('0x2e')](getAssociatedResources(_0x39b2('0x14'),_0x17f74d[_0x39b2('0x21')],_0x39b2('0x32')));_0x3ceee9['push'](getAssociatedResources(_0x39b2('0x3a'),_0x17f74d[_0x39b2('0x21')],_0x39b2('0x19')));_0x3ceee9['push'](db[_0x39b2('0x7')][_0x39b2('0x13')](queryAgents));break;case'agent':_0x303ce3[_0x180969]('voice:inbound');_0x303ce3[_0x180969](_0x39b2('0x3b'));_0x3ceee9[_0x39b2('0x2e')](_0x17f74d['getVoiceQueues']({'attributes':['id','name']}));_0x3ceee9[_0x39b2('0x2e')](_0x17f74d['getChatQueues']({'attributes':['id',_0x39b2('0x5')]}));_0x3ceee9[_0x39b2('0x2e')](_0x17f74d[_0x39b2('0x3c')]({'attributes':['id',_0x39b2('0x5')]}));_0x3ceee9[_0x39b2('0x2e')](_0x17f74d[_0x39b2('0x3d')]({'attributes':['id',_0x39b2('0x5')]}));_0x3ceee9['push'](_0x17f74d[_0x39b2('0x3e')]({'attributes':['id',_0x39b2('0x5')]}));_0x3ceee9[_0x39b2('0x2e')](_0x17f74d[_0x39b2('0x3f')]({'attributes':['id','name']}));_0x3ceee9[_0x39b2('0x2e')](_0x17f74d[_0x39b2('0x40')]({'attributes':['id',_0x39b2('0x5')]}));break;}return BPromise[_0x39b2('0x41')](_0x3ceee9);}})[_0x39b2('0xd')](function(_0x32149a){if(_0x32149a&&_0x32149a[_0x39b2('0x1c')]){for(var _0x48a041=0x0;_0x48a041<_0x32149a[_0x39b2('0x1c')];_0x48a041+=0x1){for(var _0x385d08=0x0;_0x385d08<_0x32149a[_0x48a041]['length'];_0x385d08+=0x1){switch(_0x48a041){case 0x0:joinOrLeaveQueues(_0x303ce3,_0x180969,'voice',_0x32149a[_0x48a041][_0x385d08]);break;case 0x1:joinOrLeaveQueues(_0x303ce3,_0x180969,'chat',_0x32149a[_0x48a041][_0x385d08]);break;case 0x2:joinOrLeaveQueues(_0x303ce3,_0x180969,_0x39b2('0x42'),_0x32149a[_0x48a041][_0x385d08]);break;case 0x3:joinOrLeaveQueues(_0x303ce3,_0x180969,_0x39b2('0x43'),_0x32149a[_0x48a041][_0x385d08]);break;case 0x4:joinOrLeaveQueues(_0x303ce3,_0x180969,'mail',_0x32149a[_0x48a041][_0x385d08]);break;case 0x5:joinOrLeaveQueues(_0x303ce3,_0x180969,_0x39b2('0x44'),_0x32149a[_0x48a041][_0x385d08]);break;case 0x6:joinOrLeaveQueues(_0x303ce3,_0x180969,_0x39b2('0x45'),_0x32149a[_0x48a041][_0x385d08]);break;case 0x7:_0x303ce3[_0x180969](util['format'](_0x39b2('0x46'),_0x32149a[_0x48a041][_0x385d08]['name']));break;case 0x8:_0x303ce3[_0x180969](util[_0x39b2('0x1b')](_0x39b2('0x47'),_0x32149a[_0x48a041][_0x385d08]['name']));break;case 0x9:_0x303ce3[_0x180969](util[_0x39b2('0x1b')](_0x39b2('0x48'),_0x32149a[_0x48a041][_0x385d08][_0x39b2('0xb')],_0x32149a[_0x48a041][_0x385d08][_0x39b2('0x5')]));break;case 0xa:_0x303ce3[_0x180969](util[_0x39b2('0x1b')](_0x39b2('0x1d'),_0x32149a[_0x48a041][_0x385d08][_0x39b2('0x5')]));break;}}}}})[_0x39b2('0xd')](function(){if(_0x180969===_0x39b2('0x49')){var _0x5bc2fc=_[_0x39b2('0x17')](_0x207818[_0x39b2('0x4a')],'id');return _0x207818[_0x39b2('0x4b')](_0x5bc2fc)[_0x39b2('0xd')](function(){for(var _0x2d8d85=0x0;_0x2d8d85<_0x5bc2fc[_0x39b2('0x1c')];_0x2d8d85+=0x1){_0x17dddc[_0x39b2('0x4c')](_0x39b2('0x4d'),{'ChatInteractionId':Number(_0x5bc2fc[_0x2d8d85]),'UserId':Number(_0x207818['id'])});}});}})[_0x39b2('0xd')](function(){if(_0x180969===_0x39b2('0x49')){var _0x325197=_['map'](_0x207818[_0x39b2('0x24')],'id');return _0x207818[_0x39b2('0x4e')](_0x325197)['then'](function(){for(var _0x377cde=0x0;_0x377cde<_0x325197[_0x39b2('0x1c')];_0x377cde+=0x1){_0x17dddc[_0x39b2('0x4c')](_0x39b2('0x4f'),{'MailInteractionId':Number(_0x325197[_0x377cde]),'UserId':Number(_0x207818['id'])});}});}})[_0x39b2('0xd')](function(){if(_0x180969==='leave'){var _0x54ce11=_[_0x39b2('0x17')](_0x207818['FaxInteractions'],'id');return _0x207818[_0x39b2('0x50')](_0x54ce11)[_0x39b2('0xd')](function(){for(var _0x3eb830=0x0;_0x3eb830<_0x54ce11['length'];_0x3eb830+=0x1){_0x17dddc['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x54ce11[_0x3eb830]),'UserId':Number(_0x207818['id'])});}});}})['then'](function(){if(_0x180969===_0x39b2('0x49')){var _0x32b82f=_[_0x39b2('0x17')](_0x207818[_0x39b2('0x27')],'id');return _0x207818[_0x39b2('0x51')](_0x32b82f)[_0x39b2('0xd')](function(){for(var _0x5570df=0x0;_0x5570df<_0x32b82f['length'];_0x5570df+=0x1){_0x17dddc[_0x39b2('0x4c')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x32b82f[_0x5570df]),'UserId':Number(_0x207818['id'])});}});}})[_0x39b2('0xd')](function(){if(_0x180969==='leave'){var _0x5ac039=_['map'](_0x207818['OpenchannelInteractions'],'id');return _0x207818[_0x39b2('0x52')](_0x5ac039)['then'](function(){for(var _0x13ecb2=0x0;_0x13ecb2<_0x5ac039[_0x39b2('0x1c')];_0x13ecb2+=0x1){_0x17dddc[_0x39b2('0x4c')](_0x39b2('0x53'),{'OpenchannelInteractionId':Number(_0x5ac039[_0x13ecb2]),'UserId':Number(_0x207818['id'])});}});}})[_0x39b2('0xd')](function(){if(_0x180969===_0x39b2('0x49')){var _0x97c6a2=_['map'](_0x207818[_0x39b2('0x2a')],'id');return _0x207818[_0x39b2('0x54')](_0x97c6a2)[_0x39b2('0xd')](function(){for(var _0x59db78=0x0;_0x59db78<_0x97c6a2['length'];_0x59db78+=0x1){_0x17dddc[_0x39b2('0x4c')](_0x39b2('0x55'),{'WhatsappInteractionId':Number(_0x97c6a2[_0x59db78]),'UserId':Number(_0x207818['id'])});}});}})[_0x39b2('0x56')](function(_0x1289dc){_0x303ce3[_0x39b2('0x57')](_0x1289dc);});}}function onDisconnect(_0xd0f61f,_0x1fd7d0){joinOrLeave(_0xd0f61f,'leave',_0x1fd7d0);}function onConnect(_0x3a82c2){joinOrLeave(_0x3a82c2,_0x39b2('0x58'));}exports[_0x39b2('0x59')]=function(_0x1202e8){_0x1202e8['on'](_0x39b2('0x5a'),function(_0x3aec73){_0x3aec73['setMaxListeners'](0x0);_0x3aec73[_0x39b2('0x5b')]=_0x3aec73[_0x39b2('0x5c')][_0x39b2('0x5a')][_0x39b2('0x5d')]+':'+_0x3aec73[_0x39b2('0x5c')][_0x39b2('0x5a')][_0x39b2('0x5e')];_0x3aec73[_0x39b2('0x5f')]=new Date();_0x3aec73['log']=function(_0x177213){console[_0x39b2('0x57')](_0x39b2('0x60')+_0x3aec73[_0x39b2('0x61')][_0x39b2('0x5')]+'['+_0x3aec73[_0x39b2('0x5b')]+']',_0x177213);};_0x3aec73['on'](_0x39b2('0x62'),function(){onDisconnect(_0x3aec73,_0x1202e8);_0x3aec73['log'](_0x39b2('0x63'));});onConnect(_0x3aec73);_0x3aec73[_0x39b2('0x57')](_0x39b2('0x64'));});};
\ No newline at end of file
index a5af6bc..c53f10c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d48=['changed','closed','User','default','length','hasOwnProperty','model','callback','condition','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','error','code','Trigger,\x20%s','catch','get','event','direction','find','UserId','name','then','interface','format','SIP/%s','channel','incomingmessage'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0x0d48,0x10d));var _0x80d4=function(_0x363789,_0x285ecd){_0x363789=_0x363789-0x0;var _0x129141=_0x0d48[_0x363789];return _0x129141;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0x80d4('0x0'))(_0x80d4('0x1'));var client=jayson[_0x80d4('0x2')][_0x80d4('0x3')]({'port':0x232a});var triggers=[{'channel':_0x80d4('0x4'),'model':_0x80d4('0x5'),'event':_0x80d4('0x6'),'condition':_0x80d4('0x7'),'callback':afterCreate},{'channel':_0x80d4('0x4'),'model':_0x80d4('0x5'),'event':_0x80d4('0x8'),'condition':_0x80d4('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0x80d4('0xa'),'event':_0x80d4('0x6'),'condition':_0x80d4('0xb'),'callback':afterCreateMessage},{'channel':_0x80d4('0xc'),'model':'SmsInteraction','event':_0x80d4('0x6'),'condition':_0x80d4('0x7'),'callback':afterCreate},{'channel':_0x80d4('0xc'),'model':_0x80d4('0xd'),'event':_0x80d4('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x80d4('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x80d4('0xe'),'model':_0x80d4('0xf'),'event':_0x80d4('0x6'),'condition':_0x80d4('0x7'),'callback':afterCreate},{'channel':_0x80d4('0xe'),'model':_0x80d4('0xf'),'event':_0x80d4('0x8'),'condition':_0x80d4('0x9'),'callback':afterUpdate},{'channel':_0x80d4('0xe'),'model':_0x80d4('0x10'),'event':_0x80d4('0x6'),'condition':_0x80d4('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x80d4('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x80d4('0x11'),'model':'FaxInteraction','event':_0x80d4('0x8'),'condition':_0x80d4('0x9'),'callback':afterUpdate},{'channel':_0x80d4('0x11'),'model':'FaxMessage','event':_0x80d4('0x6'),'condition':_0x80d4('0xb'),'callback':afterCreateMessage},{'channel':_0x80d4('0x12'),'model':_0x80d4('0x13'),'event':_0x80d4('0x6'),'condition':_0x80d4('0x7'),'callback':afterCreate},{'channel':_0x80d4('0x12'),'model':'MailInteraction','event':_0x80d4('0x8'),'condition':_0x80d4('0x9'),'callback':afterUpdate},{'channel':'Mail','model':_0x80d4('0x14'),'event':_0x80d4('0x6'),'condition':_0x80d4('0xb'),'callback':afterCreateMessage},{'channel':_0x80d4('0x15'),'model':'OpenchannelInteraction','event':_0x80d4('0x6'),'condition':_0x80d4('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':_0x80d4('0x16'),'event':_0x80d4('0x8'),'condition':_0x80d4('0x9'),'callback':afterUpdate},{'channel':_0x80d4('0x15'),'model':_0x80d4('0x17'),'event':_0x80d4('0x6'),'condition':_0x80d4('0xb'),'callback':afterCreateMessage}];function request(_0x14fd36){return client[_0x80d4('0x18')](_0x80d4('0x19'),_0x14fd36)['then'](function(_0x41d9a1){logger[_0x80d4('0x1a')]('Trigger,\x20%s',_0x80d4('0x19'),_0x41d9a1);if(_0x41d9a1[_0x80d4('0x1b')]){if(_0x41d9a1[_0x80d4('0x1b')][_0x80d4('0x1c')]===0x1f4){logger[_0x80d4('0x1b')](_0x80d4('0x1d'),_0x80d4('0x19'),_0x41d9a1[_0x80d4('0x1b')]);}}})[_0x80d4('0x1e')](function(_0x21f242){logger['error']('Trigger,\x20%s',_0x80d4('0x19'),_0x21f242);});}function afterCreateMessage(_0x57a827,_0x1dd0c0){return function(_0x4f1dd5,_0x5eb600){_0x4f1dd5=_0x4f1dd5[_0x80d4('0x1f')]({'plain':!![]});_0x4f1dd5['channel']=_0x57a827;_0x4f1dd5[_0x80d4('0x20')]=_0x4f1dd5[_0x80d4('0x21')];if(_0x4f1dd5['UserId']){return db['User'][_0x80d4('0x22')]({'where':{'id':_0x4f1dd5[_0x80d4('0x23')]},'attributes':['id',_0x80d4('0x24')],'raw':!![]})[_0x80d4('0x25')](function(_0x1ab953){_0x4f1dd5[_0x80d4('0x26')]=util[_0x80d4('0x27')](_0x80d4('0x28'),_0x1ab953[_0x80d4('0x24')]);_0x4f1dd5[_0x80d4('0x29')]=_0x57a827;return request({'event':_0x80d4('0x2a'),'message':_0x4f1dd5});})[_0x80d4('0x1e')](function(_0x233c9c){console[_0x80d4('0x1b')](_0x233c9c);});}else{return request({'event':'outgoingmessage','message':_0x4f1dd5});}};}function afterCreate(_0x3d3594,_0x598dbb){return function(_0x5dbb3c,_0x120bf1){_0x5dbb3c=_0x5dbb3c[_0x80d4('0x1f')]({'plain':!![]});_0x5dbb3c[_0x80d4('0x29')]=_0x3d3594;_0x5dbb3c[_0x80d4('0x20')]='opened';return request({'event':_0x598dbb,'message':_0x5dbb3c});};}function afterUpdate(_0x2731c8,_0x12792e){return function(_0x2a1a01,_0x1c3992){if(_0x2a1a01[_0x80d4('0x2b')](_0x80d4('0x2c'))&&_0x2a1a01['closed']){_0x2a1a01=_0x2a1a01[_0x80d4('0x1f')]({'plain':!![]});_0x2a1a01[_0x80d4('0x29')]=_0x2731c8;_0x2a1a01[_0x80d4('0x20')]=_0x80d4('0x2c');if(_0x2a1a01[_0x80d4('0x23')]){return db[_0x80d4('0x2d')][_0x80d4('0x22')]({'where':{'id':_0x2a1a01[_0x80d4('0x23')]},'attributes':['id',_0x80d4('0x24')],'raw':!![]})[_0x80d4('0x25')](function(_0x48e11b){_0x2a1a01[_0x80d4('0x26')]=util[_0x80d4('0x27')](_0x80d4('0x28'),_0x48e11b[_0x80d4('0x24')]);return request({'event':_0x12792e,'message':_0x2a1a01});})[_0x80d4('0x1e')](function(_0x228bc0){console[_0x80d4('0x1b')](_0x228bc0);});}else{return request({'event':_0x12792e,'message':_0x2a1a01});}}};}exports[_0x80d4('0x2e')]=function(){for(var _0x460e7b=0x0;_0x460e7b<triggers[_0x80d4('0x2f')];_0x460e7b+=0x1){if(db[_0x80d4('0x30')](triggers[_0x460e7b][_0x80d4('0x31')])){db[triggers[_0x460e7b][_0x80d4('0x31')]]['hook'](triggers[_0x460e7b][_0x80d4('0x20')],triggers[_0x460e7b][_0x80d4('0x32')](triggers[_0x460e7b][_0x80d4('0x29')]['toLowerCase'](),triggers[_0x460e7b][_0x80d4('0x33')]));}}};
\ No newline at end of file
+var _0x7e7f=['catch','get','channel','event','UserId','User','name','outgoingmessage','closed','find','interface','format','SIP/%s','default','length','hasOwnProperty','model','hook','callback','toLowerCase','../../mysqldb','jayson/promise','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','Whatsapp','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x7e7f,0x152));var _0xf7e7=function(_0x360b48,_0x4915e7){_0x360b48=_0x360b48-0x0;var _0x5bacbb=_0x7e7f[_0x360b48];return _0x5bacbb;};'use strict';var util=require('util');var db=require(_0xf7e7('0x0'))['db'];var jayson=require(_0xf7e7('0x1'));var logger=require('../logger')(_0xf7e7('0x2'));var client=jayson[_0xf7e7('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0xf7e7('0x4'),'model':_0xf7e7('0x5'),'event':_0xf7e7('0x6'),'condition':_0xf7e7('0x7'),'callback':afterCreate},{'channel':_0xf7e7('0x4'),'model':_0xf7e7('0x5'),'event':_0xf7e7('0x8'),'condition':_0xf7e7('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0xf7e7('0xa'),'event':_0xf7e7('0x6'),'condition':_0xf7e7('0xb'),'callback':afterCreateMessage},{'channel':_0xf7e7('0xc'),'model':'SmsInteraction','event':_0xf7e7('0x6'),'condition':_0xf7e7('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0xf7e7('0xd'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf7e7('0xc'),'model':_0xf7e7('0xe'),'event':_0xf7e7('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xf7e7('0xf'),'event':'afterCreate','condition':_0xf7e7('0x7'),'callback':afterCreate},{'channel':_0xf7e7('0x10'),'model':_0xf7e7('0xf'),'event':_0xf7e7('0x8'),'condition':_0xf7e7('0x9'),'callback':afterUpdate},{'channel':_0xf7e7('0x10'),'model':'WhatsappMessage','event':_0xf7e7('0x6'),'condition':_0xf7e7('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xf7e7('0x11'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xf7e7('0x12'),'model':_0xf7e7('0x11'),'event':'afterUpdate','condition':_0xf7e7('0x9'),'callback':afterUpdate},{'channel':_0xf7e7('0x12'),'model':_0xf7e7('0x13'),'event':_0xf7e7('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xf7e7('0x14'),'model':_0xf7e7('0x15'),'event':_0xf7e7('0x6'),'condition':_0xf7e7('0x7'),'callback':afterCreate},{'channel':_0xf7e7('0x14'),'model':_0xf7e7('0x15'),'event':_0xf7e7('0x8'),'condition':_0xf7e7('0x9'),'callback':afterUpdate},{'channel':_0xf7e7('0x14'),'model':_0xf7e7('0x16'),'event':_0xf7e7('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xf7e7('0x17'),'model':_0xf7e7('0x18'),'event':_0xf7e7('0x6'),'condition':_0xf7e7('0x7'),'callback':afterCreate},{'channel':_0xf7e7('0x17'),'model':_0xf7e7('0x18'),'event':_0xf7e7('0x8'),'condition':_0xf7e7('0x9'),'callback':afterUpdate},{'channel':_0xf7e7('0x17'),'model':_0xf7e7('0x19'),'event':_0xf7e7('0x6'),'condition':_0xf7e7('0xb'),'callback':afterCreateMessage}];function request(_0x125cd8){return client[_0xf7e7('0x1a')](_0xf7e7('0x1b'),_0x125cd8)[_0xf7e7('0x1c')](function(_0x4678c5){logger[_0xf7e7('0x1d')]('Trigger,\x20%s','EventManager',_0x4678c5);if(_0x4678c5['error']){if(_0x4678c5[_0xf7e7('0x1e')][_0xf7e7('0x1f')]===0x1f4){logger[_0xf7e7('0x1e')](_0xf7e7('0x20'),_0xf7e7('0x1b'),_0x4678c5[_0xf7e7('0x1e')]);}}})[_0xf7e7('0x21')](function(_0x3c9dc6){logger['error'](_0xf7e7('0x20'),_0xf7e7('0x1b'),_0x3c9dc6);});}function afterCreateMessage(_0x3eba5d,_0xe13dbd){return function(_0x136084,_0x2dfd1c){_0x136084=_0x136084[_0xf7e7('0x22')]({'plain':!![]});_0x136084[_0xf7e7('0x23')]=_0x3eba5d;_0x136084[_0xf7e7('0x24')]=_0x136084['direction'];if(_0x136084[_0xf7e7('0x25')]){return db[_0xf7e7('0x26')]['find']({'where':{'id':_0x136084['UserId']},'attributes':['id','name'],'raw':!![]})[_0xf7e7('0x1c')](function(_0x5b1778){_0x136084['interface']=util['format']('SIP/%s',_0x5b1778[_0xf7e7('0x27')]);_0x136084[_0xf7e7('0x23')]=_0x3eba5d;return request({'event':'incomingmessage','message':_0x136084});})[_0xf7e7('0x21')](function(_0x35c9b0){console[_0xf7e7('0x1e')](_0x35c9b0);});}else{return request({'event':_0xf7e7('0x28'),'message':_0x136084});}};}function afterCreate(_0x2bad99,_0x18c91c){return function(_0x319e95,_0x536a09){_0x319e95=_0x319e95[_0xf7e7('0x22')]({'plain':!![]});_0x319e95['channel']=_0x2bad99;_0x319e95[_0xf7e7('0x24')]='opened';return request({'event':_0x18c91c,'message':_0x319e95});};}function afterUpdate(_0xc94cac,_0x5cd2b9){return function(_0x437051,_0x357a11){if(_0x437051['changed'](_0xf7e7('0x29'))&&_0x437051['closed']){_0x437051=_0x437051['get']({'plain':!![]});_0x437051['channel']=_0xc94cac;_0x437051[_0xf7e7('0x24')]=_0xf7e7('0x29');if(_0x437051['UserId']){return db['User'][_0xf7e7('0x2a')]({'where':{'id':_0x437051[_0xf7e7('0x25')]},'attributes':['id',_0xf7e7('0x27')],'raw':!![]})[_0xf7e7('0x1c')](function(_0x34b525){_0x437051[_0xf7e7('0x2b')]=util[_0xf7e7('0x2c')](_0xf7e7('0x2d'),_0x34b525[_0xf7e7('0x27')]);return request({'event':_0x5cd2b9,'message':_0x437051});})['catch'](function(_0x283281){console[_0xf7e7('0x1e')](_0x283281);});}else{return request({'event':_0x5cd2b9,'message':_0x437051});}}};}exports[_0xf7e7('0x2e')]=function(){for(var _0xe6f150=0x0;_0xe6f150<triggers[_0xf7e7('0x2f')];_0xe6f150+=0x1){if(db[_0xf7e7('0x30')](triggers[_0xe6f150][_0xf7e7('0x31')])){db[triggers[_0xe6f150][_0xf7e7('0x31')]][_0xf7e7('0x32')](triggers[_0xe6f150][_0xf7e7('0x24')],triggers[_0xe6f150][_0xf7e7('0x33')](triggers[_0xe6f150][_0xf7e7('0x23')][_0xf7e7('0x34')](),triggers[_0xe6f150]['condition']));}}};
\ No newline at end of file
index 6c8e024..0f0d2b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea2b=['isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','getLicense','role','agent','then','agents','catch','lodash','voice','mail','chat','fax','sms','getChannels'];(function(_0x1d378e,_0x570dd0){var _0x1795d6=function(_0x2886fb){while(--_0x2886fb){_0x1d378e['push'](_0x1d378e['shift']());}};_0x1795d6(++_0x570dd0);}(_0xea2b,0x1f1));var _0xbea2=function(_0x3c2ad9,_0x16d086){_0x3c2ad9=_0x3c2ad9-0x0;var _0x4123b6=_0xea2b[_0x3c2ad9];return _0x4123b6;};'use strict';var _=require(_0xbea2('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0xbea2('0x1'),_0xbea2('0x2'),_0xbea2('0x3'),_0xbea2('0x4'),_0xbea2('0x5'),'whatsapp','openchannel'];exports[_0xbea2('0x6')]=function(){return channels;};exports[_0xbea2('0x7')]=function(_0x569007){_0x569007=_0x569007[_0xbea2('0x8')]();return _[_0xbea2('0x9')](channels,_0x569007);};exports[_0xbea2('0xa')]=function(_0x822656,_0x412402,_0x75d708,_0x3495c9){var _0x1e8708={'loginAttempts':_0x412402,'blocked':_0x75d708};if(!_['isUndefined'](_0x3495c9)){_0x1e8708[_0xbea2('0xb')]=_0x3495c9;}return _0x822656['updateAttributes'](_0x1e8708);};exports[_0xbea2('0xc')]=function(_0x33c755){return new BPromise(function(_0x345a30,_0x26f184){var _0xe37d70=0x0;if(_0x33c755[_0xbea2('0xd')]!==_0xbea2('0xe')){_0x345a30(_0x33c755);}db['User']['count']({'where':{'role':_0xbea2('0xe'),'online':!![],'id':{'$ne':_0x33c755['id']}}})[_0xbea2('0xf')](function(_0x388ecf){_0xe37d70=_0x388ecf;return util[_0xbea2('0xc')]();})[_0xbea2('0xf')](function(_0x516d47){if(_0x516d47&&_0x516d47[_0xbea2('0x10')]&&_0xe37d70>=_0x516d47['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x345a30(_0x33c755);})[_0xbea2('0x11')](function(_0x146c99){_0x26f184(_0x146c99);});});};
\ No newline at end of file
+var _0x9669=['./license/util','voice','mail','chat','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb'];(function(_0x2b6343,_0x16c27a){var _0x3f9c88=function(_0x50f517){while(--_0x50f517){_0x2b6343['push'](_0x2b6343['shift']());}};_0x3f9c88(++_0x16c27a);}(_0x9669,0x11b));var _0x9966=function(_0x53c3a2,_0x4926c4){_0x53c3a2=_0x53c3a2-0x0;var _0x35ba9f=_0x9669[_0x53c3a2];return _0x35ba9f;};'use strict';var _=require(_0x9966('0x0'));var BPromise=require(_0x9966('0x1'));var db=require(_0x9966('0x2'))['db'];var util=require(_0x9966('0x3'));var channels=[_0x9966('0x4'),_0x9966('0x5'),_0x9966('0x6'),'fax',_0x9966('0x7'),_0x9966('0x8'),_0x9966('0x9')];exports[_0x9966('0xa')]=function(){return channels;};exports[_0x9966('0xb')]=function(_0x552b91){_0x552b91=_0x552b91[_0x9966('0xc')]();return _[_0x9966('0xd')](channels,_0x552b91);};exports[_0x9966('0xe')]=function(_0x440ec7,_0x339899,_0x133338,_0x3df65d){var _0x4377fa={'loginAttempts':_0x339899,'blocked':_0x133338};if(!_[_0x9966('0xf')](_0x3df65d)){_0x4377fa[_0x9966('0x10')]=_0x3df65d;}return _0x440ec7[_0x9966('0x11')](_0x4377fa);};exports[_0x9966('0x12')]=function(_0x5d9f44){return new BPromise(function(_0x490426,_0x28dbb0){var _0x2465a3=0x0;if(_0x5d9f44[_0x9966('0x13')]!==_0x9966('0x14')){_0x490426(_0x5d9f44);}db['User'][_0x9966('0x15')]({'where':{'role':_0x9966('0x14'),'online':!![],'id':{'$ne':_0x5d9f44['id']}}})['then'](function(_0x85be05){_0x2465a3=_0x85be05;return util[_0x9966('0x12')]();})[_0x9966('0x16')](function(_0x272089){if(_0x272089&&_0x272089[_0x9966('0x17')]&&_0x2465a3>=_0x272089[_0x9966('0x17')]){throw Error(_0x9966('0x18'));}_0x490426(_0x5d9f44);})[_0x9966('0x19')](function(_0x5a9c33){_0x28dbb0(_0x5a9c33);});});};
\ No newline at end of file
index f736cf1..4beb159 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b48=['exports','404','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b48,0x195));var _0x89b4=function(_0x1b5607,_0x5fb20f){_0x1b5607=_0x1b5607-0x0;var _0x32b80a=_0x9b48[_0x1b5607];return _0x32b80a;};'use strict';module[_0x89b4('0x0')][0x194]=function pageNotFound(_0x2cc1a1,_0x2d083b){var _0x3f434d=_0x89b4('0x1');var _0x255511=0x194;var _0x5effb7={'status':_0x255511};_0x2d083b[_0x89b4('0x2')](_0x5effb7['status']);_0x2d083b['render'](_0x3f434d,{},function(_0xa0d1dd,_0x55f297){if(_0xa0d1dd){return _0x2d083b[_0x89b4('0x2')](_0x5effb7[_0x89b4('0x2')])['json'](_0x5effb7);}_0x2d083b['send'](_0x55f297);});};
\ No newline at end of file
+var _0xf4e8=['404','status','json','send','exports'];(function(_0x376aab,_0xcecd14){var _0x10881d=function(_0x2bd590){while(--_0x2bd590){_0x376aab['push'](_0x376aab['shift']());}};_0x10881d(++_0xcecd14);}(_0xf4e8,0x1d5));var _0x8f4e=function(_0x465371,_0xc830d0){_0x465371=_0x465371-0x0;var _0x3bfb77=_0xf4e8[_0x465371];return _0x3bfb77;};'use strict';module[_0x8f4e('0x0')][0x194]=function pageNotFound(_0x35cded,_0x1e3aed){var _0x2168e5=_0x8f4e('0x1');var _0x57474c=0x194;var _0x944276={'status':_0x57474c};_0x1e3aed['status'](_0x944276[_0x8f4e('0x2')]);_0x1e3aed['render'](_0x2168e5,{},function(_0x447e51,_0x51076b){if(_0x447e51){return _0x1e3aed['status'](_0x944276[_0x8f4e('0x2')])[_0x8f4e('0x3')](_0x944276);}_0x1e3aed[_0x8f4e('0x4')](_0x51076b);});};
\ No newline at end of file
index 629a6dd..980095c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf767=['FaxAccountId','Exntensions','FaxMessage','TagId','FaxInteractionId','Owner','fax_interaction_has_tags','Interaction','team_has_fax_queues','SmsAccountId','Applications','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','Queue','Website','chat_interaction_has_tags','ChatInteractionId','AttachmentId','team_has_chat_queues','ChatGroupId','chat_group_has_users','Hoppers','Company','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','Any','OneAny','AutomationAnyId','Actions','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Description','Field','SubjectId','Fields','Subject','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZendeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','ToId','SessionId','ProjectId','user_has_square_projects','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToUserId','ToQueue','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Contacts','Queues','cm_user_has_lists','user_has_voice_prefixes','UserProfileSections','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','xC@LL1234','utf8_general_ci','username','password','options','User','../api/user/user.model','import','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../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','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../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','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/voicePrefix/voicePrefix.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','Notification','../api/notification/notification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../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','cascade','UserId','hasMany','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','Notifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','cm_user_has_contacts','CmList','Lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','VoicePrefix','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','VoiceChanSpy','SpiedAgents','VoiceContext','Sound','moh_has_sounds','Members','VoiceQueueId','CmHopper','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','VoiceMailMessage','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','hasOne','Answers','Interactions','List','ListId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','restrict','Items','Disposition','Dispositions'];(function(_0x187798,_0x20ddcf){var _0x1ece0a=function(_0x318a47){while(--_0x318a47){_0x187798['push'](_0x187798['shift']());}};_0x1ece0a(++_0x20ddcf);}(_0xf767,0x76));var _0x7f76=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0xf767[_0x25efdf];return _0x22c495;};'use strict';var path=require('path');var config=require(_0x7f76('0x0'));var Sequelize=require(_0x7f76('0x1'));var _=require(_0x7f76('0x2'));var jstz=require(_0x7f76('0x3'));var timezone=jstz[_0x7f76('0x4')]();config['sequelize']=_[_0x7f76('0x5')](config[_0x7f76('0x1')],{'database':_0x7f76('0x6'),'username':_0x7f76('0x7'),'password':'xC@LL1234','options':{'host':_0x7f76('0x8'),'port':0xcea,'dialect':_0x7f76('0x9'),'dialectOptions':{'charset':_0x7f76('0xa')},'logging':![],'timezone':timezone[_0x7f76('0xb')](),'define':{'charset':_0x7f76('0xc'),'collate':'utf8_general_ci'}}});config[_0x7f76('0xd')]=_[_0x7f76('0x5')](config[_0x7f76('0xd')],{'database':_0x7f76('0x6'),'username':'xcall','password':_0x7f76('0xe'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x7f76('0x9'),'dialectOptions':{'charset':_0x7f76('0xa')},'logging':![],'timezone':timezone[_0x7f76('0xb')](),'define':{'charset':_0x7f76('0xc'),'collate':_0x7f76('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7f76('0x1')]['database'],config[_0x7f76('0x1')][_0x7f76('0x10')],config[_0x7f76('0x1')][_0x7f76('0x11')],config[_0x7f76('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7f76('0xd')]['database'],config[_0x7f76('0xd')][_0x7f76('0x10')],config['sequelizeHistory']['password'],config['sequelizeHistory'][_0x7f76('0x12')])};db[_0x7f76('0x13')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x14'));db['VoiceChanSpy']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x16'));db['VoiceContext']=db['sequelize']['import']('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x17'));db[_0x7f76('0x18')]=db['sequelize'][_0x7f76('0x15')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x7f76('0x19')]=db[_0x7f76('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db[_0x7f76('0x1a')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x1b'));db['ScreenRecording']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x1c'));db[_0x7f76('0x1d')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x1e'));db['VoiceMailMessage']=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x1f'));db[_0x7f76('0x20')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x21'));db[_0x7f76('0x22')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x7f76('0x23')]=db[_0x7f76('0x1')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db[_0x7f76('0x24')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x25'));db[_0x7f76('0x26')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x27'));db['Trunk']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x28'));db[_0x7f76('0x29')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x2a'));db[_0x7f76('0x2b')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x2c'));db[_0x7f76('0x2d')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x2e'));db[_0x7f76('0x2f')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x30'));db[_0x7f76('0x31')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/userMailQueue/userMailQueue.model');db[_0x7f76('0x32')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x33'));db[_0x7f76('0x34')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x35'));db['UserOpenchannelQueue']=db[_0x7f76('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x7f76('0x36')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x37'));db['MailServerIn']=db[_0x7f76('0x1')]['import']('../api/mailServerIn/mailServerIn.model');db[_0x7f76('0x38')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x39'));db[_0x7f76('0x3a')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x3b'));db['MailQueue']=db['sequelize'][_0x7f76('0x15')]('../api/mailQueue/mailQueue.model');db[_0x7f76('0x3c')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/mailSubstatus/mailSubstatus.model');db[_0x7f76('0x3d')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x3e'));db[_0x7f76('0x3f')]=db[_0x7f76('0x1')]['import']('../api/mailMessage/mailMessage.model');db[_0x7f76('0x40')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x41'));db[_0x7f76('0x42')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x43'));db[_0x7f76('0x44')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x45'));db[_0x7f76('0x46')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x47'));db[_0x7f76('0x48')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x49'));db[_0x7f76('0x4a')]=db[_0x7f76('0x1')]['import']('../api/faxApplication/faxApplication.model');db[_0x7f76('0x4b')]=db['sequelize'][_0x7f76('0x15')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x4c'));db[_0x7f76('0x4d')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x4e'));db[_0x7f76('0x4f')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x50'));db[_0x7f76('0x51')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/smsAccount/smsAccount.model');db[_0x7f76('0x52')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x53'));db[_0x7f76('0x54')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x55'));db[_0x7f76('0x56')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/smsMessage/smsMessage.model');db[_0x7f76('0x57')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x58'));db[_0x7f76('0x59')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x5a'));db[_0x7f76('0x5b')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x5c'));db[_0x7f76('0x5d')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x5e'));db[_0x7f76('0x5f')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0x7f76('0x60')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x61'));db[_0x7f76('0x62')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x63'));db['OpenchannelQueueReport']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x64'));db[_0x7f76('0x65')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x66'));db[_0x7f76('0x67')]=db[_0x7f76('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x7f76('0x68')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x69'));db[_0x7f76('0x6a')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x6b'));db[_0x7f76('0x6c')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x6d'));db[_0x7f76('0x6e')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x6f'));db[_0x7f76('0x70')]=db['sequelize'][_0x7f76('0x15')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x7f76('0x71')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x72'));db[_0x7f76('0x73')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x74'));db['CmHopper']=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x75'));db[_0x7f76('0x76')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x77'));db[_0x7f76('0x78')]=db[_0x7f76('0x1')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x7f76('0x79')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x7f76('0x7a')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x7b'));db[_0x7f76('0x7c')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x7d'));db[_0x7f76('0x7e')]=db['sequelize'][_0x7f76('0x15')]('../api/action/action.model');db[_0x7f76('0x7f')]=db['sequelize'][_0x7f76('0x15')]('../api/automation/automation.model');db[_0x7f76('0x80')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x81'));db['Disposition']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x82'));db[_0x7f76('0x83')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x84'));db['Interval']=db[_0x7f76('0x1')]['import'](_0x7f76('0x85'));db[_0x7f76('0x86')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x87'));db[_0x7f76('0x88')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x89'));db[_0x7f76('0x8a')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x8b'));db[_0x7f76('0x8c')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x8d'));db['Sound']=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/sound/sound.model');db[_0x7f76('0x8e')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x8f'));db[_0x7f76('0x90')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x91'));db[_0x7f76('0x92')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x93'));db[_0x7f76('0x94')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x95'));db[_0x7f76('0x96')]=db['sequelize']['import']('../api/integration/integration.model');db[_0x7f76('0x97')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/integrationReport/integrationReport.model');db[_0x7f76('0x98')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x99'));db[_0x7f76('0x9a')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x9b'));db[_0x7f76('0x9c')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x9d'));db[_0x7f76('0x9e')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x9f'));db[_0x7f76('0xa0')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xa1'));db[_0x7f76('0xa2')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x7f76('0xa3')]=db[_0x7f76('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xa4'));db[_0x7f76('0xa5')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0x7f76('0xa6')]=db[_0x7f76('0x1')]['import'](_0x7f76('0xa7'));db[_0x7f76('0xa8')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xa9'));db[_0x7f76('0xaa')]=db[_0x7f76('0x1')]['import'](_0x7f76('0xab'));db[_0x7f76('0xac')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xad'));db['DeskConfiguration']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xae'));db[_0x7f76('0xaf')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xb0'));db[_0x7f76('0xb1')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xb2'));db[_0x7f76('0xb3')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xb4'));db[_0x7f76('0xb5')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xb6'));db[_0x7f76('0xb7')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xb8'));db[_0x7f76('0xb9')]=db['sequelize']['import'](_0x7f76('0xba'));db['ZendeskField']=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xbb'));db[_0x7f76('0xbc')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xbd'));db[_0x7f76('0xbe')]=db[_0x7f76('0x1')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x7f76('0xbf')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xc0'));db['VtigerAccount']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xc1'));db[_0x7f76('0xc2')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xc3'));db['VtigerField']=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xc4'));db[_0x7f76('0xc5')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xc6'));db['ServicenowConfiguration']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xc7'));db[_0x7f76('0xc8')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xc9'));db[_0x7f76('0xca')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xcb'));db[_0x7f76('0xcc')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xcd'));db[_0x7f76('0xce')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x7f76('0xcf')]=db['sequelize'][_0x7f76('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x7f76('0xd0')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xd1'));db[_0x7f76('0xd2')]=db['sequelize'][_0x7f76('0x15')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0x7f76('0x1')]['import'](_0x7f76('0xd3'));db[_0x7f76('0xd4')]=db[_0x7f76('0x1')]['import'](_0x7f76('0xd5'));db[_0x7f76('0xd6')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/chatQueueReport/chatQueueReport.model');db[_0x7f76('0xd7')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xd8'));db[_0x7f76('0xd9')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xda'));db[_0x7f76('0xdb')]=db[_0x7f76('0x1')]['import'](_0x7f76('0xdc'));db[_0x7f76('0xdd')]=db[_0x7f76('0x1')]['import'](_0x7f76('0xde'));db[_0x7f76('0xdf')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xe0'));db['SquareReport']=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/squareReport/squareReport.model');db[_0x7f76('0xe1')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xe2'));db[_0x7f76('0xe3')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0x7f76('0x15')]('../api/setting/setting.model');db[_0x7f76('0xe4')]=db['sequelize']['import'](_0x7f76('0xe5'));db['SquareProject']=db['sequelize']['import'](_0x7f76('0xe6'));db[_0x7f76('0xe7')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xe8'));db['SquareMessage']=db[_0x7f76('0x1')]['import'](_0x7f76('0xe9'));db[_0x7f76('0xea')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/team/team.model');db['License']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xeb'));db[_0x7f76('0xec')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xed'));db['Migration']=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/migration/migration.model');db[_0x7f76('0xee')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xef'));db['Plugin']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xf0'));db[_0x7f76('0xf1')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xf2'));db[_0x7f76('0xf3')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xf4'));db[_0x7f76('0xf5')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xf6'));db[_0x7f76('0xf7')]=db[_0x7f76('0x1')]['import'](_0x7f76('0xf8'));db[_0x7f76('0xf9')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0xfa'));db['CmList']=db['sequelize'][_0x7f76('0x15')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x7f76('0x1')]['import'](_0x7f76('0xfb'));db['UserProfile']=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/userProfile/userProfile.model');db[_0x7f76('0xfc')]=db[_0x7f76('0x1')][_0x7f76('0x15')]('../api/userProfileSection/userProfileSection.model');db[_0x7f76('0xfd')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0xfe'));db[_0x7f76('0xff')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x100'));db[_0x7f76('0x101')]=db['sequelize'][_0x7f76('0x15')](_0x7f76('0x102'));db['WhatsappApplication']=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x103'));db[_0x7f76('0x104')]=db['sequelize']['import'](_0x7f76('0x105'));db[_0x7f76('0x106')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x107'));db[_0x7f76('0x108')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x109'));db[_0x7f76('0x10a')]=db[_0x7f76('0x1')][_0x7f76('0x15')](_0x7f76('0x10b'));db[_0x7f76('0x10c')]=db[_0x7f76('0x1')]['import'](_0x7f76('0x10d'));db[_0x7f76('0x10e')]=db[_0x7f76('0x1')]['import']('../api/cloudProvider/cloudProvider.model');db[_0x7f76('0x13')]['hasOne'](db[_0x7f76('0x1d')],{'as':_0x7f76('0x1d'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x13')][_0x7f76('0x111')](db[_0x7f76('0x1a')],{'as':'Recordings','foreignKey':_0x7f76('0x110')});db['User']['hasMany'](db[_0x7f76('0x2b')],{'as':_0x7f76('0x112'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x13')][_0x7f76('0x111')](db[_0x7f76('0x113')],{'as':_0x7f76('0x114'),'onDelete':_0x7f76('0x10f'),'hooks':!![]});db['User'][_0x7f76('0x111')](db[_0x7f76('0x78')],{'as':_0x7f76('0x115'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x13')][_0x7f76('0x111')](db[_0x7f76('0x79')],{'as':_0x7f76('0x116'),'foreignKey':_0x7f76('0x110')});db['User'][_0x7f76('0x111')](db['ReportAgentPreview'],{'as':_0x7f76('0x7a'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x13')][_0x7f76('0x111')](db[_0x7f76('0x5d')],{'as':_0x7f76('0x117'),'foreignKey':'UserId'});db[_0x7f76('0x13')][_0x7f76('0x111')](db[_0x7f76('0x67')],{'as':'ChatInteractions','foreignKey':'UserId'});db['User'][_0x7f76('0x111')](db[_0x7f76('0x54')],{'as':'SmsInteractions','foreignKey':_0x7f76('0x110')});db[_0x7f76('0x13')][_0x7f76('0x111')](db[_0x7f76('0x4b')],{'as':_0x7f76('0x118'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x13')][_0x7f76('0x111')](db[_0x7f76('0x3d')],{'as':_0x7f76('0x119'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x13')][_0x7f76('0x111')](db['WhatsappInteraction'],{'as':_0x7f76('0x11a'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x13')][_0x7f76('0x111')](db[_0x7f76('0xff')],{'as':_0x7f76('0x11b'),'foreignKey':_0x7f76('0x11c')});db[_0x7f76('0x13')][_0x7f76('0x11d')](db[_0x7f76('0x11e')],{'as':_0x7f76('0x11e'),'foreignKey':_0x7f76('0x11f')});db['User'][_0x7f76('0x120')](db['ChatGroup'],{'as':_0x7f76('0x121'),'through':'chat_group_has_users'});db['User'][_0x7f76('0x120')](db['CmContact'],{'as':'Contacts','through':_0x7f76('0x122')});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x123')],{'as':_0x7f76('0x124'),'through':'cm_user_has_lists'});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0xea')],{'through':_0x7f76('0x125')});db['User']['belongsToMany'](db[_0x7f76('0x3d')],{'as':'MailInteractions','through':_0x7f76('0x126')});db['User'][_0x7f76('0x120')](db[_0x7f76('0x67')],{'as':_0x7f76('0x127'),'through':_0x7f76('0x128')});db[_0x7f76('0x13')]['belongsToMany'](db[_0x7f76('0x4b')],{'as':_0x7f76('0x118'),'through':_0x7f76('0x129')});db[_0x7f76('0x13')]['belongsToMany'](db[_0x7f76('0x54')],{'as':_0x7f76('0x12a'),'through':_0x7f76('0x12b')});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x5d')],{'as':'OpenchannelInteractions','through':_0x7f76('0x12c')});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x104')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x19')],{'as':_0x7f76('0x12d'),'through':_0x7f76('0x2d'),'required':![]});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x12e')],{'as':_0x7f76('0x12f'),'through':'UserMailQueue','required':![]});db['User'][_0x7f76('0x120')](db[_0x7f76('0x6c')],{'as':_0x7f76('0x130'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x7f76('0x13')]['belongsToMany'](db[_0x7f76('0x4d')],{'as':'FaxQueues','through':_0x7f76('0x32'),'required':![]});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x57')],{'as':_0x7f76('0x131'),'through':'UserSmsQueue','required':![]});db['User']['belongsToMany'](db['OpenchannelQueue'],{'as':_0x7f76('0x132'),'through':_0x7f76('0x133'),'required':![]});db['User'][_0x7f76('0x120')](db['WhatsappQueue'],{'as':_0x7f76('0x134'),'through':_0x7f76('0x36'),'required':![]});db[_0x7f76('0x13')]['belongsToMany'](db[_0x7f76('0x123')],{'through':'cm_user_has_lists'});db[_0x7f76('0x13')]['belongsToMany'](db[_0x7f76('0x135')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x7f76('0x13')][_0x7f76('0x120')](db['ChatWebsite'],{'as':_0x7f76('0x136'),'through':_0x7f76('0x137')});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x48')],{'as':_0x7f76('0x138'),'through':_0x7f76('0x139')});db['User'][_0x7f76('0x120')](db['MailAccount'],{'as':_0x7f76('0x13a'),'through':_0x7f76('0x13b')});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x59')],{'as':_0x7f76('0x13c'),'through':_0x7f76('0x13d')});db[_0x7f76('0x13')]['belongsToMany'](db[_0x7f76('0x51')],{'as':_0x7f76('0x13e'),'through':_0x7f76('0x13f')});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x101')],{'as':'WhatsappAccounts','through':_0x7f76('0x140')});db[_0x7f76('0x13')][_0x7f76('0x120')](db[_0x7f76('0x141')],{'as':_0x7f76('0x142'),'through':'user_has_square_projects'});db[_0x7f76('0x143')][_0x7f76('0x111')](db[_0x7f76('0x113')],{'as':_0x7f76('0x144'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x7f76('0x145')][_0x7f76('0x111')](db[_0x7f76('0x113')],{'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x113')][_0x7f76('0x111')](db[_0x7f76('0x113')],{'as':'Applications','onDelete':_0x7f76('0x10f')});db['VoiceMusicOnHold']['belongsToMany'](db[_0x7f76('0x146')],{'as':'Sounds','through':_0x7f76('0x147')});db[_0x7f76('0x19')][_0x7f76('0x111')](db['UserVoiceQueueRt'],{'as':_0x7f76('0x148'),'foreignKey':_0x7f76('0x149')});db[_0x7f76('0x19')][_0x7f76('0x111')](db[_0x7f76('0x14a')],{'as':'Hoppers','foreignKey':_0x7f76('0x149')});db[_0x7f76('0x19')][_0x7f76('0x111')](db[_0x7f76('0x78')],{'as':'HopperFinals','foreignKey':_0x7f76('0x149')});db[_0x7f76('0x19')][_0x7f76('0x111')](db[_0x7f76('0x79')],{'as':_0x7f76('0x14b'),'foreignKey':_0x7f76('0x149')});db[_0x7f76('0x19')]['hasMany'](db[_0x7f76('0x7a')],{'as':_0x7f76('0x7a'),'foreignKey':_0x7f76('0x149')});db['VoiceQueue'][_0x7f76('0x111')](db['CmHopperBlack'],{'as':_0x7f76('0x14c'),'foreignKey':_0x7f76('0x149')});db[_0x7f76('0x19')][_0x7f76('0x111')](db['JscriptySessionReport'],{'as':_0x7f76('0x14d'),'foreignKey':_0x7f76('0x149')});db[_0x7f76('0x19')][_0x7f76('0x11d')](db[_0x7f76('0x14e')],{'as':_0x7f76('0x14e'),'foreignKey':_0x7f76('0x14f')});db[_0x7f76('0x19')][_0x7f76('0x11d')](db[_0x7f76('0x14e')],{'as':_0x7f76('0x150'),'foreignKey':_0x7f76('0x151')});db[_0x7f76('0x19')]['belongsTo'](db[_0x7f76('0x152')],{'as':_0x7f76('0x152'),'foreignKey':_0x7f76('0x153')});db['VoiceQueue']['belongsTo'](db['Pause'],{'as':_0x7f76('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x7f76('0x19')][_0x7f76('0x120')](db['CmList'],{'as':_0x7f76('0x124'),'through':_0x7f76('0x155')});db[_0x7f76('0x19')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x2d')});db[_0x7f76('0x19')][_0x7f76('0x120')](db[_0x7f76('0xea')],{'as':_0x7f76('0x157'),'through':_0x7f76('0x158')});db[_0x7f76('0x19')][_0x7f76('0x120')](db[_0x7f76('0x123')],{'as':'BlackLists','through':_0x7f76('0x159')});db[_0x7f76('0x1a')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':_0x7f76('0x13'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x15a')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':'User','foreignKey':_0x7f76('0x110')});db[_0x7f76('0x1d')][_0x7f76('0x111')](db['VoiceMailMessage'],{'as':_0x7f76('0x15b'),'onDelete':'cascade','foreignKey':_0x7f76('0x15c'),'sourceKey':_0x7f76('0x15d')});db[_0x7f76('0x15e')][_0x7f76('0x11d')](db['VoiceMail'],{'foreignKey':_0x7f76('0x15c'),'targetKey':_0x7f76('0x15d')});db[_0x7f76('0x20')][_0x7f76('0x111')](db[_0x7f76('0x24')],{'as':_0x7f76('0x15f'),'foreignKey':'uniqueid','constraints':![]});db[_0x7f76('0x20')][_0x7f76('0x111')](db['VoiceAgentReport'],{'as':_0x7f76('0x160'),'foreignKey':_0x7f76('0x161'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x7f76('0x13')],{'as':'User','foreignKey':_0x7f76('0x110')});db[_0x7f76('0x20')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x164')][_0x7f76('0x11d')](db['MailAccount'],{'as':_0x7f76('0x3a'),'foreignKey':'MailAccountId'});db[_0x7f76('0x38')][_0x7f76('0x11d')](db[_0x7f76('0x3a')],{'as':_0x7f76('0x3a'),'foreignKey':_0x7f76('0x165')});db[_0x7f76('0x3a')][_0x7f76('0x166')](db['MailServerIn'],{'as':'Imap','onDelete':_0x7f76('0x10f')});db[_0x7f76('0x3a')][_0x7f76('0x166')](db[_0x7f76('0x38')],{'as':'Smtp','onDelete':_0x7f76('0x10f')});db[_0x7f76('0x3a')][_0x7f76('0x111')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x7f76('0x165')});db[_0x7f76('0x3a')][_0x7f76('0x111')](db[_0x7f76('0x80')],{'as':_0x7f76('0x167'),'foreignKey':_0x7f76('0x165')});db['MailAccount'][_0x7f76('0x111')](db[_0x7f76('0x3f')],{'as':_0x7f76('0x15b'),'foreignKey':_0x7f76('0x165')});db[_0x7f76('0x3a')]['hasMany'](db[_0x7f76('0x3d')],{'as':_0x7f76('0x168')});db['MailAccount']['hasMany'](db[_0x7f76('0x40')],{'as':'Applications'});db['MailAccount'][_0x7f76('0x11d')](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db['MailAccount']['belongsTo'](db['Template'],{'as':_0x7f76('0x90'),'foreignKey':'TemplateId'});db[_0x7f76('0x3a')][_0x7f76('0x11d')](db['Pause'],{'as':_0x7f76('0x154'),'foreignKey':_0x7f76('0x16b')});db[_0x7f76('0x3a')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x13b')});db[_0x7f76('0x12e')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':'Agents','through':_0x7f76('0x31')});db[_0x7f76('0x12e')][_0x7f76('0x120')](db[_0x7f76('0xea')],{'through':_0x7f76('0x16c'),'as':_0x7f76('0x157')});db['MailInteraction'][_0x7f76('0x111')](db[_0x7f76('0x3f')],{'as':_0x7f76('0x15b'),'onDelete':'cascade','foreignKey':_0x7f76('0x16d')});db[_0x7f76('0x3d')][_0x7f76('0x11d')](db[_0x7f76('0x3a')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x165')});db[_0x7f76('0x3d')]['belongsTo'](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x3d')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':'Owner','foreignKey':_0x7f76('0x110')});db[_0x7f76('0x3d')][_0x7f76('0x120')](db['Tag'],{'through':_0x7f76('0x16f'),'as':_0x7f76('0x170')});db[_0x7f76('0x3d')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':'mail_interaction_has_tags','as':_0x7f76('0x171')});db['MailInteraction'][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x172'),'through':_0x7f76('0x126'),'foreignKey':'MailInteractionId'});db[_0x7f76('0x3f')][_0x7f76('0x111')](db[_0x7f76('0xee')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':'User'});db[_0x7f76('0x3f')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'onDelete':_0x7f76('0x10f'),'as':_0x7f76('0x162')});db[_0x7f76('0x3f')][_0x7f76('0x11d')](db[_0x7f76('0x3d')],{'as':'Interaction','foreignKey':_0x7f76('0x16d')});db['MailMessage']['belongsTo'](db[_0x7f76('0x3a')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x165')});db[_0x7f76('0x40')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'onDelete':_0x7f76('0x173')});db[_0x7f76('0x40')][_0x7f76('0x11d')](db[_0x7f76('0x12e')],{'onDelete':_0x7f76('0x173')});db[_0x7f76('0x40')]['belongsTo'](db['MailAccount'],{'onDelete':_0x7f76('0x173')});db['MailApplication'][_0x7f76('0x11d')](db[_0x7f76('0x152')],{'onDelete':'restrict','foreignKey':_0x7f76('0x153')});db[_0x7f76('0x40')][_0x7f76('0x11d')](db[_0x7f76('0x8e')],{'onDelete':_0x7f76('0x173'),'foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db[_0x7f76('0x3a')],{});db[_0x7f76('0x42')][_0x7f76('0x11d')](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x42')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':'ContactId'});db[_0x7f76('0x42')][_0x7f76('0x11d')](db[_0x7f76('0x3d')],{});db[_0x7f76('0x42')][_0x7f76('0x11d')](db['MailMessage'],{});db['MailQueueReport'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{});db[_0x7f76('0x42')]['belongsTo'](db['MailQueue'],{});db['Dashboard'][_0x7f76('0x111')](db[_0x7f76('0x46')],{'as':_0x7f76('0x174'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x48')]['hasMany'](db[_0x7f76('0x175')],{'as':_0x7f76('0x176'),'foreignKey':_0x7f76('0x177')});db['FaxAccount'][_0x7f76('0x111')](db['CannedAnswer'],{'as':_0x7f76('0x167'),'foreignKey':'FaxAccountId'});db[_0x7f76('0x48')]['hasMany'](db['FaxInteraction'],{'as':_0x7f76('0x168')});db[_0x7f76('0x48')]['hasMany'](db[_0x7f76('0x4a')],{'as':'Applications'});db[_0x7f76('0x48')][_0x7f76('0x111')](db['VoiceExtension'],{'as':_0x7f76('0x178'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x48')][_0x7f76('0x111')](db[_0x7f76('0x179')],{'as':_0x7f76('0x15b')});db[_0x7f76('0x48')][_0x7f76('0x11d')](db[_0x7f76('0x14e')],{'as':'Trunk'});db[_0x7f76('0x48')]['belongsTo'](db[_0x7f76('0x123')],{'as':'List','foreignKey':_0x7f76('0x16a')});db['FaxAccount'][_0x7f76('0x11d')](db[_0x7f76('0x86')],{'as':_0x7f76('0x154'),'foreignKey':_0x7f76('0x16b')});db[_0x7f76('0x48')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x139')});db['FaxApplication'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'onDelete':_0x7f76('0x173')});db['FaxApplication'][_0x7f76('0x11d')](db[_0x7f76('0x4d')],{'onDelete':_0x7f76('0x173')});db['FaxApplication']['belongsTo'](db[_0x7f76('0x48')],{'onDelete':_0x7f76('0x173')});db[_0x7f76('0x4a')][_0x7f76('0x11d')](db[_0x7f76('0x8e')],{'onDelete':_0x7f76('0x173'),'foreignKey':_0x7f76('0x17a')});db['FaxInteraction']['hasMany'](db[_0x7f76('0x179')],{'as':_0x7f76('0x15b'),'onDelete':'cascade','foreignKey':_0x7f76('0x17b')});db[_0x7f76('0x4b')]['belongsTo'](db[_0x7f76('0x48')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x177')});db[_0x7f76('0x4b')][_0x7f76('0x11d')](db['CmContact'],{'as':'Contact','foreignKey':_0x7f76('0x163')});db[_0x7f76('0x4b')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':_0x7f76('0x17c'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x4b')]['belongsToMany'](db['Tag'],{'through':_0x7f76('0x17d'),'as':_0x7f76('0x170')});db[_0x7f76('0x4b')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':_0x7f76('0x17d'),'as':_0x7f76('0x171')});db['FaxInteraction'][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x172'),'through':_0x7f76('0x129'),'foreignKey':_0x7f76('0x17b')});db[_0x7f76('0x179')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'onDelete':'cascade','as':_0x7f76('0x13')});db[_0x7f76('0x179')][_0x7f76('0x11d')](db[_0x7f76('0x4b')],{'as':_0x7f76('0x17e'),'foreignKey':_0x7f76('0x17b')});db['FaxMessage'][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'onDelete':_0x7f76('0x10f'),'as':_0x7f76('0x162')});db[_0x7f76('0x179')][_0x7f76('0x11d')](db[_0x7f76('0xee')],{'as':_0x7f76('0xee'),'foreignKey':'AttachmentId'});db[_0x7f76('0x179')][_0x7f76('0x11d')](db[_0x7f76('0x48')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x177')});db[_0x7f76('0x4d')]['belongsToMany'](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x32')});db[_0x7f76('0x4d')]['belongsToMany'](db[_0x7f76('0xea')],{'through':_0x7f76('0x17f'),'as':'Teams'});db[_0x7f76('0x4f')][_0x7f76('0x11d')](db[_0x7f76('0x48')],{});db[_0x7f76('0x4f')][_0x7f76('0x11d')](db[_0x7f76('0x123')],{'as':'List','foreignKey':'ListId'});db['FaxQueueReport'][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':'ContactId'});db[_0x7f76('0x4f')][_0x7f76('0x11d')](db[_0x7f76('0x4b')],{});db[_0x7f76('0x4f')]['belongsTo'](db['FaxMessage'],{});db[_0x7f76('0x4f')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{});db[_0x7f76('0x4f')][_0x7f76('0x11d')](db[_0x7f76('0x4d')],{});db['SmsAccount'][_0x7f76('0x111')](db[_0x7f76('0x175')],{'as':_0x7f76('0x176'),'foreignKey':_0x7f76('0x180')});db[_0x7f76('0x51')]['hasMany'](db[_0x7f76('0x80')],{'as':_0x7f76('0x167'),'foreignKey':_0x7f76('0x180')});db['SmsAccount']['hasMany'](db[_0x7f76('0x56')],{'as':_0x7f76('0x15b'),'foreignKey':'SmsAccountId'});db[_0x7f76('0x51')][_0x7f76('0x111')](db['SmsInteraction'],{'as':'Interactions'});db['SmsAccount']['hasMany'](db[_0x7f76('0x52')],{'as':_0x7f76('0x181')});db['SmsAccount']['belongsTo'](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x51')][_0x7f76('0x11d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x7f76('0x16b')});db[_0x7f76('0x51')][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x156'),'through':_0x7f76('0x13f')});db[_0x7f76('0x52')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'onDelete':_0x7f76('0x173')});db[_0x7f76('0x52')][_0x7f76('0x11d')](db[_0x7f76('0x57')],{'onDelete':_0x7f76('0x173')});db[_0x7f76('0x52')][_0x7f76('0x11d')](db[_0x7f76('0x51')],{'onDelete':_0x7f76('0x173')});db[_0x7f76('0x52')][_0x7f76('0x11d')](db[_0x7f76('0x152')],{'onDelete':_0x7f76('0x173'),'foreignKey':_0x7f76('0x153')});db['SmsApplication'][_0x7f76('0x11d')](db[_0x7f76('0x8e')],{'onDelete':'restrict','foreignKey':_0x7f76('0x17a')});db[_0x7f76('0x54')][_0x7f76('0x111')](db[_0x7f76('0x56')],{'as':_0x7f76('0x15b'),'onDelete':'cascade','foreignKey':_0x7f76('0x182')});db[_0x7f76('0x54')][_0x7f76('0x11d')](db[_0x7f76('0x51')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x180')});db['SmsInteraction'][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x54')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':_0x7f76('0x17c'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x54')][_0x7f76('0x120')](db['Tag'],{'through':_0x7f76('0x183'),'as':_0x7f76('0x170')});db[_0x7f76('0x54')]['belongsToMany'](db['Tag'],{'through':_0x7f76('0x183'),'as':_0x7f76('0x171')});db['SmsInteraction'][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x172'),'through':'user_has_sms_interactions','foreignKey':_0x7f76('0x182')});db['SmsMessage'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':_0x7f76('0x13')});db['SmsMessage'][_0x7f76('0x11d')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x7f76('0x56')][_0x7f76('0x11d')](db['SmsInteraction'],{'onDelete':_0x7f76('0x10f'),'as':'Interaction','foreignKey':_0x7f76('0x182')});db[_0x7f76('0x56')][_0x7f76('0x11d')](db[_0x7f76('0x51')],{'as':_0x7f76('0x16e'),'foreignKey':'SmsAccountId'});db[_0x7f76('0x57')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x34'),'foreignKey':_0x7f76('0x184')});db[_0x7f76('0x57')][_0x7f76('0x120')](db[_0x7f76('0xea')],{'through':_0x7f76('0x185'),'as':_0x7f76('0x157')});db['OpenchannelAccount'][_0x7f76('0x111')](db[_0x7f76('0x175')],{'as':_0x7f76('0x176'),'foreignKey':'OpenchannelAccountId'});db[_0x7f76('0x59')][_0x7f76('0x111')](db[_0x7f76('0x80')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x7f76('0x59')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x7f76('0x168'),'foreignKey':_0x7f76('0x186')});db[_0x7f76('0x59')]['hasMany'](db[_0x7f76('0x5f')],{'as':'Messages','foreignKey':_0x7f76('0x186')});db[_0x7f76('0x59')][_0x7f76('0x111')](db[_0x7f76('0x5b')],{'as':_0x7f76('0x181'),'foreignKey':'OpenchannelAccountId'});db[_0x7f76('0x59')]['belongsTo'](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x59')][_0x7f76('0x11d')](db[_0x7f76('0x86')],{'as':_0x7f76('0x154'),'foreignKey':_0x7f76('0x16b')});db[_0x7f76('0x59')][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x156'),'through':_0x7f76('0x13d')});db[_0x7f76('0x5b')]['belongsTo'](db[_0x7f76('0x13')],{'onDelete':_0x7f76('0x173')});db[_0x7f76('0x5b')][_0x7f76('0x11d')](db[_0x7f76('0x60')],{'onDelete':_0x7f76('0x173'),'foreignKey':_0x7f76('0x187')});db['OpenchannelApplication'][_0x7f76('0x11d')](db['OpenchannelAccount'],{'onDelete':_0x7f76('0x173'),'foreignKey':_0x7f76('0x186')});db[_0x7f76('0x5b')][_0x7f76('0x11d')](db['Interval'],{'onDelete':_0x7f76('0x173'),'foreignKey':'IntervalId'});db[_0x7f76('0x5b')][_0x7f76('0x11d')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7f76('0x17a')});db[_0x7f76('0x5d')][_0x7f76('0x111')](db[_0x7f76('0x5f')],{'as':_0x7f76('0x15b'),'onDelete':_0x7f76('0x10f'),'foreignKey':'OpenchannelInteractionId'});db[_0x7f76('0x5d')]['belongsTo'](db[_0x7f76('0x59')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x5d')]['belongsTo'](db['User'],{'as':_0x7f76('0x17c'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x5d')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':_0x7f76('0x188'),'as':_0x7f76('0x170')});db[_0x7f76('0x5d')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':'openchannel_interaction_has_tags','as':_0x7f76('0x171')});db[_0x7f76('0x5d')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':'Users','through':_0x7f76('0x12c'),'foreignKey':_0x7f76('0x189')});db[_0x7f76('0x5f')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'onDelete':_0x7f76('0x10f'),'as':_0x7f76('0x13')});db[_0x7f76('0x5f')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'onDelete':'cascade','as':'Contact'});db[_0x7f76('0x5f')]['belongsTo'](db[_0x7f76('0x5d')],{'onDelete':_0x7f76('0x10f'),'as':_0x7f76('0x17e'),'foreignKey':_0x7f76('0x189')});db['OpenchannelMessage']['belongsTo'](db[_0x7f76('0xee')],{'as':_0x7f76('0xee'),'foreignKey':'AttachmentId'});db[_0x7f76('0x5f')][_0x7f76('0x11d')](db[_0x7f76('0x59')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x186')});db[_0x7f76('0x60')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x133'),'foreignKey':_0x7f76('0x187')});db[_0x7f76('0x60')][_0x7f76('0x120')](db[_0x7f76('0xea')],{'through':_0x7f76('0x18a'),'as':_0x7f76('0x157')});db[_0x7f76('0x62')]['hasMany'](db['Disposition'],{'as':_0x7f76('0x176'),'foreignKey':_0x7f76('0x18b')});db[_0x7f76('0x62')][_0x7f76('0x111')](db['CannedAnswer'],{'as':_0x7f76('0x167'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x7f76('0x111')](db[_0x7f76('0x70')],{'as':_0x7f76('0x18c')});db[_0x7f76('0x62')]['hasMany'](db[_0x7f76('0x67')],{'as':_0x7f76('0x168')});db[_0x7f76('0x62')][_0x7f76('0x111')](db[_0x7f76('0x65')],{'as':_0x7f76('0x181')});db[_0x7f76('0x62')]['hasMany'](db[_0x7f76('0x68')],{'as':'Messages'});db[_0x7f76('0x62')][_0x7f76('0x11d')](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x62')]['belongsTo'](db['Interval'],{'as':_0x7f76('0x152'),'foreignKey':_0x7f76('0x153')});db[_0x7f76('0x62')][_0x7f76('0x11d')](db[_0x7f76('0x86')],{'as':_0x7f76('0x154'),'foreignKey':_0x7f76('0x16b')});db[_0x7f76('0x62')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x137')});db[_0x7f76('0x18d')][_0x7f76('0x11d')](db[_0x7f76('0x59')],{});db[_0x7f76('0x18d')]['belongsTo'](db['CmList'],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x18d')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x18d')][_0x7f76('0x11d')](db[_0x7f76('0x5d')],{});db[_0x7f76('0x18d')][_0x7f76('0x11d')](db[_0x7f76('0x5f')],{});db[_0x7f76('0x18d')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{});db['OpenchannelQueueReport'][_0x7f76('0x11d')](db[_0x7f76('0x60')],{});db[_0x7f76('0x65')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':_0x7f76('0x18e'),'foreignKey':_0x7f76('0x110'),'onDelete':'restrict'});db['ChatApplication'][_0x7f76('0x11d')](db[_0x7f76('0x6c')],{'as':_0x7f76('0x18f'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0x7f76('0x65')][_0x7f76('0x11d')](db[_0x7f76('0x62')],{'as':_0x7f76('0x190'),'foreignKey':_0x7f76('0x18b'),'onDelete':_0x7f76('0x173')});db[_0x7f76('0x65')]['belongsTo'](db['Tag'],{'onDelete':_0x7f76('0x173'),'foreignKey':_0x7f76('0x17a')});db[_0x7f76('0x67')][_0x7f76('0x111')](db[_0x7f76('0x68')],{'as':'Messages','onDelete':_0x7f76('0x10f'),'foreignKey':'ChatInteractionId'});db[_0x7f76('0x67')]['belongsTo'](db[_0x7f76('0x62')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x18b')});db['ChatInteraction'][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db['ChatInteraction'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'as':_0x7f76('0x17c'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x67')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':_0x7f76('0x191'),'as':'Tags'});db[_0x7f76('0x67')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':'chat_interaction_has_tags','as':_0x7f76('0x171')});db[_0x7f76('0x67')][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x172'),'through':_0x7f76('0x128'),'foreignKey':_0x7f76('0x192')});db['ChatMessage'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'onDelete':_0x7f76('0x10f'),'as':_0x7f76('0x13')});db[_0x7f76('0x68')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'onDelete':_0x7f76('0x10f'),'as':_0x7f76('0x162'),'foreignKey':'ContactId'});db[_0x7f76('0x68')]['belongsTo'](db[_0x7f76('0x67')],{'onDelete':'cascade','as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x7f76('0x68')][_0x7f76('0x11d')](db[_0x7f76('0xee')],{'as':_0x7f76('0xee'),'foreignKey':_0x7f76('0x193')});db[_0x7f76('0x68')][_0x7f76('0x11d')](db[_0x7f76('0x62')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x18b')});db['ChatOfflineMessage'][_0x7f76('0x11d')](db['CmContact'],{'onDelete':'cascade','as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x6a')][_0x7f76('0x11d')](db[_0x7f76('0x62')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x18b')});db[_0x7f76('0x6c')][_0x7f76('0x120')](db['User'],{'as':'Agents','through':_0x7f76('0x2f'),'hooks':!![]});db[_0x7f76('0x6c')]['belongsToMany'](db[_0x7f76('0xea')],{'through':_0x7f76('0x194'),'as':'Teams'});db[_0x7f76('0x6e')][_0x7f76('0x111')](db[_0x7f76('0xd7')],{'as':'Messages','foreignKey':_0x7f76('0x195'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x6e')][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x148'),'through':_0x7f76('0x196')});db[_0x7f76('0x70')][_0x7f76('0x11d')](db[_0x7f76('0x62')],{'as':_0x7f76('0x190'),'foreignKey':_0x7f76('0x18b')});db[_0x7f76('0x71')][_0x7f76('0x111')](db['CmContact'],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x7f76('0x73')][_0x7f76('0x111')](db[_0x7f76('0x14a')],{'as':_0x7f76('0x197'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x73')][_0x7f76('0x111')](db[_0x7f76('0x78')],{'as':_0x7f76('0x115'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x73')][_0x7f76('0x111')](db[_0x7f76('0x79')],{'as':_0x7f76('0x14b'),'foreignKey':'ContactId'});db[_0x7f76('0x73')]['hasMany'](db[_0x7f76('0x7a')],{'as':_0x7f76('0x7a'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x73')][_0x7f76('0x111')](db[_0x7f76('0xdd')],{'as':_0x7f76('0x14d'),'foreignKey':'ContactId'});db[_0x7f76('0x73')][_0x7f76('0x111')](db['OpenchannelInteraction'],{'as':_0x7f76('0x117'),'foreignKey':_0x7f76('0x163'),'onDelete':'restrict'});db[_0x7f76('0x73')][_0x7f76('0x111')](db['ChatInteraction'],{'as':_0x7f76('0x127'),'foreignKey':_0x7f76('0x163'),'onDelete':_0x7f76('0x173')});db['CmContact']['hasMany'](db[_0x7f76('0x54')],{'as':'SmsInteractions','foreignKey':_0x7f76('0x163'),'onDelete':_0x7f76('0x173')});db[_0x7f76('0x73')][_0x7f76('0x111')](db['FaxInteraction'],{'as':_0x7f76('0x118'),'foreignKey':_0x7f76('0x163'),'onDelete':_0x7f76('0x173')});db[_0x7f76('0x73')][_0x7f76('0x111')](db[_0x7f76('0x3d')],{'as':_0x7f76('0x119'),'foreignKey':_0x7f76('0x163'),'onDelete':_0x7f76('0x173')});db[_0x7f76('0x73')]['belongsTo'](db[_0x7f76('0x71')],{'as':_0x7f76('0x198'),'foreignKey':_0x7f76('0x199')});db[_0x7f76('0x73')][_0x7f76('0x11d')](db['CmList'],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x73')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x172'),'through':'cm_user_has_contacts'});db[_0x7f76('0x73')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'as':'Tags','through':_0x7f76('0x19a')});db[_0x7f76('0x73')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':'cm_contact_has_tags','as':_0x7f76('0x171')});db[_0x7f76('0x14a')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x14a')]['belongsTo'](db[_0x7f76('0x123')],{'as':'List','foreignKey':_0x7f76('0x16a'),'onDelete':'cascade'});db[_0x7f76('0x14a')]['belongsTo'](db[_0x7f76('0x13')],{'as':'Agent','foreignKey':'UserId'});db[_0x7f76('0x14a')][_0x7f76('0x11d')](db[_0x7f76('0x19')],{'as':_0x7f76('0x18f'),'foreignKey':'VoiceQueueId','onDelete':_0x7f76('0x10f')});db['CmHopper'][_0x7f76('0x11d')](db['Campaign'],{'as':_0x7f76('0xec'),'foreignKey':_0x7f76('0x19b'),'onDelete':'cascade'});db[_0x7f76('0x14a')][_0x7f76('0x11d')](db['User'],{'as':_0x7f76('0x17c'),'foreignKey':_0x7f76('0x19c')});db['CmHopperBlack'][_0x7f76('0x11d')](db['CmContact'],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163'),'onDelete':'cascade'});db[_0x7f76('0x76')][_0x7f76('0x11d')](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x76')][_0x7f76('0x11d')](db[_0x7f76('0x19')],{'as':_0x7f76('0x18f'),'foreignKey':_0x7f76('0x149'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x76')][_0x7f76('0x11d')](db[_0x7f76('0xec')],{'as':_0x7f76('0xec'),'foreignKey':_0x7f76('0x19b'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x7f')][_0x7f76('0x111')](db[_0x7f76('0x83')],{'as':{'plural':_0x7f76('0x19d'),'singular':_0x7f76('0x19e')},'foreignKey':'AutomationAllId','onDelete':_0x7f76('0x10f'),'hooks':!![]});db[_0x7f76('0x7f')][_0x7f76('0x111')](db[_0x7f76('0x83')],{'as':{'plural':_0x7f76('0x19f'),'singular':_0x7f76('0x1a0')},'foreignKey':_0x7f76('0x1a1'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x7f76('0x111')](db[_0x7f76('0x7e')],{'as':_0x7f76('0x1a2'),'foreignKey':'AutomationId','onDelete':_0x7f76('0x10f'),'hooks':!![]});db[_0x7f76('0x152')][_0x7f76('0x111')](db['Interval'],{'as':'Intervals','foreignKey':_0x7f76('0x153'),'onDelete':_0x7f76('0x10f'),'hooks':!![],'required':![]});db['Interval'][_0x7f76('0x111')](db[_0x7f76('0x113')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x7f76('0x173')});db[_0x7f76('0x152')][_0x7f76('0x111')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0x7f76('0x153')});db[_0x7f76('0x152')][_0x7f76('0x111')](db[_0x7f76('0x65')],{'as':'ChatApplications','foreignKey':_0x7f76('0x153')});db['Interval'][_0x7f76('0x111')](db[_0x7f76('0x4a')],{'as':_0x7f76('0x1a3'),'foreignKey':_0x7f76('0x153')});db['Interval']['hasMany'](db[_0x7f76('0x52')],{'as':_0x7f76('0x1a4'),'foreignKey':_0x7f76('0x153')});db[_0x7f76('0x8c')]['belongsTo'](db[_0x7f76('0x3a')],{});db[_0x7f76('0x8c')][_0x7f76('0x11d')](db['AnalyticDefaultReport'],{'foreignKey':_0x7f76('0x1a5')});db[_0x7f76('0x8c')]['belongsTo'](db[_0x7f76('0x98')],{'foreignKey':_0x7f76('0x1a6')});db[_0x7f76('0x146')]['belongsToMany'](db[_0x7f76('0x18')],{'as':_0x7f76('0x1a7'),'through':_0x7f76('0x147'),'onDelete':_0x7f76('0x173')});db[_0x7f76('0x8e')][_0x7f76('0x120')](db[_0x7f76('0x73')],{'through':_0x7f76('0x19a')});db[_0x7f76('0x8e')][_0x7f76('0x120')](db[_0x7f76('0x67')],{'through':_0x7f76('0x191')});db[_0x7f76('0x8e')][_0x7f76('0x120')](db[_0x7f76('0x3d')],{'through':'mail_interaction_has_tags'});db[_0x7f76('0x8e')]['belongsToMany'](db[_0x7f76('0x54')],{'through':'sms_interaction_has_tags'});db[_0x7f76('0x8e')][_0x7f76('0x120')](db[_0x7f76('0x4b')],{'through':'fax_interaction_has_tags'});db[_0x7f76('0x8e')]['belongsToMany'](db[_0x7f76('0x5d')],{'through':_0x7f76('0x188')});db[_0x7f76('0x8e')]['belongsToMany'](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x7f76('0x92')][_0x7f76('0x111')](db[_0x7f76('0x83')],{'as':{'plural':_0x7f76('0x1a8'),'singular':_0x7f76('0x1a9')},'foreignKey':_0x7f76('0x1aa'),'onDelete':_0x7f76('0x10f'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x7f76('0x83')],{'as':{'plural':_0x7f76('0x1ab'),'singular':_0x7f76('0x1ac')},'foreignKey':_0x7f76('0x1ad'),'onDelete':_0x7f76('0x10f'),'hooks':!![]});db[_0x7f76('0x92')]['hasMany'](db['Action'],{'as':_0x7f76('0x1a2'),'foreignKey':_0x7f76('0x1ae'),'onDelete':_0x7f76('0x10f'),'hooks':!![]});db[_0x7f76('0x98')][_0x7f76('0x111')](db[_0x7f76('0xa0')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7f76('0x1a6'),'hooks':!![]});db['AnalyticDefaultReport'][_0x7f76('0x111')](db[_0x7f76('0xa0')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0x7f76('0x111')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7f76('0x1af')});db['AnalyticFieldReport'][_0x7f76('0x11d')](db[_0x7f76('0x9e')],{'foreignKey':'MetricId'});db[_0x7f76('0xa3')]['hasMany'](db[_0x7f76('0x1b0')],{'as':_0x7f76('0x1b1'),'onDelete':'cascade','foreignKey':_0x7f76('0x1b2')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0x7f76('0x1b3'),'onDelete':_0x7f76('0x10f'),'foreignKey':'SubjectId'});db[_0x7f76('0x1b0')][_0x7f76('0x111')](db['SalesforceField'],{'as':_0x7f76('0x1b4'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b5')});db['SalesforceConfiguration'][_0x7f76('0x111')](db[_0x7f76('0xa5')],{'as':'Fields','onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0x1b0')][_0x7f76('0x11d')](db[_0x7f76('0xa3')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xa5')][_0x7f76('0x111')](db['SalesforceField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x7f76('0xa5')][_0x7f76('0x111')](db['SalesforceField'],{'as':_0x7f76('0x1b7'),'foreignKey':_0x7f76('0x1b5')});db['SalesforceField'][_0x7f76('0x111')](db['SalesforceField'],{'as':_0x7f76('0x1b8'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xa5')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['SugarcrmAccount'][_0x7f76('0x111')](db[_0x7f76('0xa8')],{'as':_0x7f76('0x1b1'),'onDelete':'cascade','foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xa8')]['hasMany'](db[_0x7f76('0xaa')],{'as':_0x7f76('0x1b3'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b9')});db[_0x7f76('0xa8')]['hasMany'](db[_0x7f76('0xaa')],{'as':_0x7f76('0x1b4'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0xa8')]['hasMany'](db[_0x7f76('0xaa')],{'as':_0x7f76('0x1ba'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xa8')][_0x7f76('0x11d')](db[_0x7f76('0xa6')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xaa')][_0x7f76('0x111')](db[_0x7f76('0xaa')],{'as':_0x7f76('0x1bb'),'foreignKey':_0x7f76('0x1b9')});db[_0x7f76('0xaa')][_0x7f76('0x111')](db[_0x7f76('0xaa')],{'as':_0x7f76('0x1b7'),'foreignKey':_0x7f76('0x1b5')});db['SugarcrmField'][_0x7f76('0x111')](db['SugarcrmField'],{'as':_0x7f76('0x1b8'),'foreignKey':_0x7f76('0x1b6')});db['SugarcrmField'][_0x7f76('0x11d')](db[_0x7f76('0x94')],{'as':'Variable','foreignKey':_0x7f76('0x1bc')});db[_0x7f76('0xac')][_0x7f76('0x111')](db[_0x7f76('0x1bd')],{'as':_0x7f76('0x1b1'),'onDelete':'cascade','foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0x1bd')]['hasMany'](db[_0x7f76('0xaf')],{'as':_0x7f76('0x1b3'),'onDelete':_0x7f76('0x10f'),'foreignKey':'SubjectId'});db['DeskConfiguration']['hasMany'](db[_0x7f76('0xaf')],{'as':'Descriptions','onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0x1bd')][_0x7f76('0x111')](db[_0x7f76('0xaf')],{'as':_0x7f76('0x1ba'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b6')});db['DeskConfiguration'][_0x7f76('0x11d')](db['DeskAccount'],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0x1bd')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':_0x7f76('0x1be')});db[_0x7f76('0xaf')][_0x7f76('0x111')](db['DeskField'],{'as':_0x7f76('0x1bb'),'foreignKey':_0x7f76('0x1b9')});db[_0x7f76('0xaf')]['hasMany'](db[_0x7f76('0xaf')],{'as':_0x7f76('0x1b7'),'foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0xaf')]['hasMany'](db[_0x7f76('0xaf')],{'as':_0x7f76('0x1b8'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xaf')][_0x7f76('0x11d')](db[_0x7f76('0x94')],{'as':'Variable','foreignKey':_0x7f76('0x1bc')});db['ZohoAccount']['hasMany'](db[_0x7f76('0xb3')],{'as':_0x7f76('0x1b1'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xb3')][_0x7f76('0x111')](db[_0x7f76('0xb5')],{'as':_0x7f76('0x1b3'),'onDelete':'cascade','foreignKey':_0x7f76('0x1b9')});db['ZohoConfiguration'][_0x7f76('0x111')](db[_0x7f76('0xb5')],{'as':_0x7f76('0x1b4'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0xb3')][_0x7f76('0x111')](db[_0x7f76('0xb5')],{'as':_0x7f76('0x1ba'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b6')});db['ZohoConfiguration'][_0x7f76('0x11d')](db[_0x7f76('0xb1')],{'as':'Account','foreignKey':'AccountId'});db[_0x7f76('0xb5')][_0x7f76('0x111')](db[_0x7f76('0xb5')],{'as':_0x7f76('0x1bb'),'foreignKey':_0x7f76('0x1b9')});db['ZohoField'][_0x7f76('0x111')](db[_0x7f76('0xb5')],{'as':_0x7f76('0x1b7'),'foreignKey':'DescriptionId'});db['ZohoField'][_0x7f76('0x111')](db[_0x7f76('0xb5')],{'as':_0x7f76('0x1b8'),'foreignKey':_0x7f76('0x1b6')});db['ZohoField']['belongsTo'](db[_0x7f76('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0x7f76('0xb7')][_0x7f76('0x111')](db[_0x7f76('0xb9')],{'as':'Configurations','onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xb9')][_0x7f76('0x111')](db[_0x7f76('0x1bf')],{'as':'Subjects','foreignKey':_0x7f76('0x1b9')});db[_0x7f76('0xb9')][_0x7f76('0x111')](db['ZendeskField'],{'as':_0x7f76('0x1b4'),'foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0xb9')][_0x7f76('0x111')](db['ZendeskField'],{'as':_0x7f76('0x1ba'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xb9')]['belongsTo'](db[_0x7f76('0xb7')],{'as':'Account','foreignKey':'AccountId'});db[_0x7f76('0xb9')][_0x7f76('0x120')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x7f76('0x1bf')]['hasMany'](db[_0x7f76('0x1bf')],{'as':_0x7f76('0x1bb'),'foreignKey':'SubjectId'});db[_0x7f76('0x1bf')][_0x7f76('0x111')](db['ZendeskField'],{'as':'Description','foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0x1bf')][_0x7f76('0x111')](db[_0x7f76('0x1bf')],{'as':'Field','foreignKey':'FieldId'});db['ZendeskField'][_0x7f76('0x11d')](db[_0x7f76('0x94')],{'as':_0x7f76('0x94'),'foreignKey':'VariableId'});db[_0x7f76('0xbc')][_0x7f76('0x111')](db[_0x7f76('0xbe')],{'as':'Configurations','onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xbe')][_0x7f76('0x111')](db[_0x7f76('0xbf')],{'as':_0x7f76('0x1b3'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b9')});db[_0x7f76('0xbe')][_0x7f76('0x111')](db['FreshdeskField'],{'as':_0x7f76('0x1b4'),'onDelete':_0x7f76('0x10f'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0x7f76('0x111')](db['FreshdeskField'],{'as':_0x7f76('0x1ba'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xbe')]['belongsTo'](db[_0x7f76('0xbc')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xbe')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':_0x7f76('0x1c0')});db[_0x7f76('0xbf')]['hasMany'](db[_0x7f76('0xbf')],{'as':_0x7f76('0x1bb'),'foreignKey':_0x7f76('0x1b9')});db['FreshdeskField'][_0x7f76('0x111')](db[_0x7f76('0xbf')],{'as':_0x7f76('0x1b7'),'foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0xbf')][_0x7f76('0x111')](db['FreshdeskField'],{'as':_0x7f76('0x1b8'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xbf')][_0x7f76('0x11d')](db['Variable'],{'as':_0x7f76('0x94'),'foreignKey':_0x7f76('0x1bc')});db[_0x7f76('0x1c1')]['hasMany'](db['VtigerConfiguration'],{'as':_0x7f76('0x1b1'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xc2')][_0x7f76('0x111')](db['VtigerField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x7f76('0xc2')][_0x7f76('0x111')](db[_0x7f76('0x1c2')],{'as':'Descriptions','foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0xc2')]['hasMany'](db[_0x7f76('0x1c2')],{'as':'Fields','foreignKey':_0x7f76('0x1b6')});db['VtigerConfiguration'][_0x7f76('0x11d')](db[_0x7f76('0x1c1')],{'as':'Account','foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0x1c2')]['hasMany'](db[_0x7f76('0x1c2')],{'as':'Subject','foreignKey':_0x7f76('0x1b9')});db[_0x7f76('0x1c2')][_0x7f76('0x111')](db[_0x7f76('0x1c2')],{'as':_0x7f76('0x1b7'),'foreignKey':'DescriptionId'});db[_0x7f76('0x1c2')][_0x7f76('0x111')](db[_0x7f76('0x1c2')],{'as':_0x7f76('0x1b8'),'foreignKey':_0x7f76('0x1b6')});db['VtigerField'][_0x7f76('0x11d')](db[_0x7f76('0x94')],{'as':_0x7f76('0x94'),'foreignKey':_0x7f76('0x1bc')});db[_0x7f76('0xc5')][_0x7f76('0x111')](db[_0x7f76('0x1c3')],{'as':'Configurations','onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0x1c3')][_0x7f76('0x111')](db[_0x7f76('0xc8')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x7f76('0x1c3')][_0x7f76('0x111')](db[_0x7f76('0xc8')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x7f76('0x1c3')][_0x7f76('0x111')](db[_0x7f76('0xc8')],{'as':_0x7f76('0x1ba'),'foreignKey':'FieldId'});db[_0x7f76('0x1c3')]['belongsTo'](db[_0x7f76('0xc5')],{'as':_0x7f76('0x16e'),'foreignKey':'AccountId'});db['ServicenowField'][_0x7f76('0x111')](db[_0x7f76('0xc8')],{'as':_0x7f76('0x1bb'),'foreignKey':_0x7f76('0x1b9')});db['ServicenowField'][_0x7f76('0x111')](db[_0x7f76('0xc8')],{'as':_0x7f76('0x1b7'),'foreignKey':'DescriptionId'});db[_0x7f76('0xc8')][_0x7f76('0x111')](db[_0x7f76('0xc8')],{'as':_0x7f76('0x1b8'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xc8')][_0x7f76('0x11d')](db[_0x7f76('0x94')],{'as':_0x7f76('0x94'),'foreignKey':'VariableId'});db[_0x7f76('0xca')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x7f76('0x1b1'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xcc')][_0x7f76('0x111')](db[_0x7f76('0xce')],{'as':'Subjects','onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b9')});db['Dynamics365Configuration'][_0x7f76('0x111')](db[_0x7f76('0xce')],{'as':_0x7f76('0x1b4'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b5')});db['Dynamics365Configuration'][_0x7f76('0x111')](db[_0x7f76('0xce')],{'as':'Fields','onDelete':_0x7f76('0x10f'),'foreignKey':'FieldId'});db[_0x7f76('0xcc')][_0x7f76('0x11d')](db['Dynamics365Account'],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xce')][_0x7f76('0x111')](db[_0x7f76('0xce')],{'as':'Subject','foreignKey':_0x7f76('0x1b9')});db[_0x7f76('0xce')][_0x7f76('0x111')](db['Dynamics365Field'],{'as':_0x7f76('0x1b7'),'foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0xce')][_0x7f76('0x111')](db[_0x7f76('0xce')],{'as':'Field','foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xce')][_0x7f76('0x11d')](db[_0x7f76('0x94')],{'as':_0x7f76('0x94'),'foreignKey':_0x7f76('0x1bc')});db[_0x7f76('0xcf')][_0x7f76('0x111')](db['FreshsalesConfiguration'],{'as':_0x7f76('0x1b1'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1b2')});db[_0x7f76('0xd0')][_0x7f76('0x111')](db[_0x7f76('0xd2')],{'as':_0x7f76('0x1b3'),'foreignKey':_0x7f76('0x1b9')});db[_0x7f76('0xd0')][_0x7f76('0x111')](db['FreshsalesField'],{'as':_0x7f76('0x1b4'),'foreignKey':_0x7f76('0x1b5')});db[_0x7f76('0xd0')][_0x7f76('0x111')](db[_0x7f76('0xd2')],{'as':_0x7f76('0x1ba'),'foreignKey':'FieldId'});db[_0x7f76('0xd0')][_0x7f76('0x11d')](db[_0x7f76('0xcf')],{'as':_0x7f76('0x16e'),'foreignKey':'AccountId'});db['FreshsalesField']['hasMany'](db[_0x7f76('0xd2')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshsalesField'][_0x7f76('0x111')](db['FreshsalesField'],{'as':_0x7f76('0x1b7'),'foreignKey':'DescriptionId'});db[_0x7f76('0xd2')][_0x7f76('0x111')](db[_0x7f76('0xd2')],{'as':_0x7f76('0x1b8'),'foreignKey':_0x7f76('0x1b6')});db[_0x7f76('0xd2')][_0x7f76('0x11d')](db[_0x7f76('0x94')],{'as':_0x7f76('0x94'),'foreignKey':_0x7f76('0x1bc')});db[_0x7f76('0xd6')]['belongsTo'](db[_0x7f76('0x62')],{});db[_0x7f76('0xd6')]['belongsTo'](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db['ChatQueueReport'][_0x7f76('0x11d')](db['CmContact'],{'as':'Contact','foreignKey':_0x7f76('0x163')});db[_0x7f76('0xd6')][_0x7f76('0x11d')](db[_0x7f76('0x67')],{});db['ChatQueueReport']['belongsTo'](db[_0x7f76('0x68')],{});db['ChatQueueReport'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{});db[_0x7f76('0xd6')][_0x7f76('0x11d')](db[_0x7f76('0x6c')],{});db['ChatInternalMessage'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x7f76('0xd7')]['belongsTo'](db[_0x7f76('0x13')],{'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1c4')});db[_0x7f76('0xdd')][_0x7f76('0x111')](db[_0x7f76('0xdb')],{'foreignKey':_0x7f76('0x1c5'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0xdd')]['hasMany'](db[_0x7f76('0xd9')],{'foreignKey':_0x7f76('0x1c5'),'onDelete':_0x7f76('0x10f')});db['SmsQueueReport'][_0x7f76('0x11d')](db[_0x7f76('0x51')],{});db['SmsQueueReport'][_0x7f76('0x11d')](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0xdf')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0xdf')][_0x7f76('0x11d')](db[_0x7f76('0x54')],{});db[_0x7f76('0xdf')]['belongsTo'](db[_0x7f76('0x56')],{});db['SmsQueueReport'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{});db[_0x7f76('0xdf')][_0x7f76('0x11d')](db[_0x7f76('0x57')],{});db[_0x7f76('0xe3')][_0x7f76('0x111')](db[_0x7f76('0xdd')],{'foreignKey':_0x7f76('0x1c6')});db['JscriptyProject'][_0x7f76('0x111')](db[_0x7f76('0xdb')],{'foreignKey':_0x7f76('0x1c6')});db[_0x7f76('0xe3')][_0x7f76('0x111')](db['JscriptyAnswerReport'],{'foreignKey':_0x7f76('0x1c6')});db[_0x7f76('0x141')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x172'),'through':_0x7f76('0x1c7')});db[_0x7f76('0xea')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x125')});db[_0x7f76('0xea')][_0x7f76('0x120')](db[_0x7f76('0x19')],{'through':_0x7f76('0x158'),'as':_0x7f76('0x12d')});db[_0x7f76('0xea')][_0x7f76('0x120')](db['MailQueue'],{'through':_0x7f76('0x16c'),'as':_0x7f76('0x12f')});db['Team'][_0x7f76('0x120')](db['ChatQueue'],{'through':_0x7f76('0x194'),'as':_0x7f76('0x130')});db[_0x7f76('0xea')][_0x7f76('0x120')](db[_0x7f76('0x4d')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team'][_0x7f76('0x120')](db[_0x7f76('0x57')],{'through':_0x7f76('0x185'),'as':_0x7f76('0x131')});db[_0x7f76('0xea')][_0x7f76('0x120')](db['OpenchannelQueue'],{'through':_0x7f76('0x18a'),'as':_0x7f76('0x132')});db[_0x7f76('0xea')]['belongsToMany'](db[_0x7f76('0x10c')],{'through':_0x7f76('0x1c8'),'as':_0x7f76('0x134')});db[_0x7f76('0xec')][_0x7f76('0x111')](db[_0x7f76('0x14a')],{'as':_0x7f76('0x197'),'foreignKey':_0x7f76('0x19b')});db[_0x7f76('0xec')][_0x7f76('0x111')](db[_0x7f76('0x78')],{'as':'HopperFinals','foreignKey':_0x7f76('0x19b')});db[_0x7f76('0xec')][_0x7f76('0x111')](db[_0x7f76('0x79')],{'as':_0x7f76('0x14b'),'foreignKey':_0x7f76('0x19b')});db[_0x7f76('0xec')][_0x7f76('0x111')](db[_0x7f76('0x76')],{'as':_0x7f76('0x14c'),'foreignKey':_0x7f76('0x19b')});db['Campaign']['belongsTo'](db[_0x7f76('0x14e')],{'as':_0x7f76('0x14e'),'foreignKey':_0x7f76('0x14f')});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0x7f76('0x150'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x7f76('0x11d')](db[_0x7f76('0x152')],{'as':'Interval','foreignKey':_0x7f76('0x153')});db[_0x7f76('0xec')][_0x7f76('0x11d')](db[_0x7f76('0x141')],{'as':_0x7f76('0x141'),'foreignKey':_0x7f76('0x1c9')});db[_0x7f76('0xec')][_0x7f76('0x120')](db['CmList'],{'as':_0x7f76('0x124'),'through':_0x7f76('0x1ca')});db[_0x7f76('0xec')][_0x7f76('0x120')](db[_0x7f76('0x123')],{'as':_0x7f76('0x1cb'),'through':'campaigns_has_cm_blacklists'});db[_0x7f76('0xf1')][_0x7f76('0x11d')](db[_0x7f76('0x3f')],{});db[_0x7f76('0xf1')][_0x7f76('0x11d')](db[_0x7f76('0x3d')],{});db[_0x7f76('0xf1')]['belongsTo'](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x7f76('0x1cc')});db[_0x7f76('0xf1')][_0x7f76('0x11d')](db['User'],{'foreignKey':_0x7f76('0x1cd'),'as':'FromAgent'});db[_0x7f76('0xf1')]['belongsTo'](db[_0x7f76('0x13')],{'foreignKey':'ToUserId','as':_0x7f76('0x1ce')});db[_0x7f76('0xf1')]['belongsTo'](db[_0x7f76('0x12e')],{'foreignKey':_0x7f76('0x1cf'),'as':'ToQueue'});db[_0x7f76('0xf1')][_0x7f76('0x11d')](db['MailAccount'],{'foreignKey':_0x7f76('0x1d0'),'as':_0x7f76('0x1d1')});db['ChatTransferReport'][_0x7f76('0x11d')](db[_0x7f76('0x68')],{});db[_0x7f76('0xf3')][_0x7f76('0x11d')](db['ChatInteraction'],{});db[_0x7f76('0xf3')][_0x7f76('0x11d')](db['ChatWebsite'],{'foreignKey':_0x7f76('0x1d2'),'as':_0x7f76('0x1cc')});db['ChatTransferReport'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'foreignKey':_0x7f76('0x1cd'),'as':_0x7f76('0x1d3')});db[_0x7f76('0xf3')]['belongsTo'](db['User'],{'foreignKey':_0x7f76('0x1d4'),'as':'ToAgent'});db['ChatTransferReport']['belongsTo'](db[_0x7f76('0x6c')],{'foreignKey':'ToChatQueueId','as':_0x7f76('0x1d5')});db[_0x7f76('0xf3')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x7f76('0x1d6'),'as':_0x7f76('0x1d1')});db['FaxTransferReport'][_0x7f76('0x11d')](db[_0x7f76('0x179')],{});db['FaxTransferReport'][_0x7f76('0x11d')](db['FaxInteraction'],{});db[_0x7f76('0xf5')]['belongsTo'](db[_0x7f76('0x48')],{'foreignKey':'FromFaxAccountId','as':_0x7f76('0x1cc')});db[_0x7f76('0xf5')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'foreignKey':_0x7f76('0x1cd'),'as':_0x7f76('0x1d3')});db['FaxTransferReport'][_0x7f76('0x11d')](db['User'],{'foreignKey':_0x7f76('0x1d4'),'as':_0x7f76('0x1ce')});db[_0x7f76('0xf5')]['belongsTo'](db[_0x7f76('0x4d')],{'foreignKey':_0x7f76('0x1d7'),'as':_0x7f76('0x1d5')});db[_0x7f76('0xf5')][_0x7f76('0x11d')](db[_0x7f76('0x48')],{'foreignKey':_0x7f76('0x1d8'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x7f76('0x11d')](db[_0x7f76('0x5f')],{});db['OpenchannelTransferReport'][_0x7f76('0x11d')](db[_0x7f76('0x5d')],{});db[_0x7f76('0xf7')][_0x7f76('0x11d')](db[_0x7f76('0x59')],{'foreignKey':_0x7f76('0x1d9'),'as':'FromAccount'});db[_0x7f76('0xf7')]['belongsTo'](db[_0x7f76('0x13')],{'foreignKey':_0x7f76('0x1cd'),'as':_0x7f76('0x1d3')});db[_0x7f76('0xf7')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x7f76('0x1ce')});db['OpenchannelTransferReport'][_0x7f76('0x11d')](db[_0x7f76('0x60')],{'foreignKey':'ToOpenchannelQueueId','as':_0x7f76('0x1d5')});db['OpenchannelTransferReport'][_0x7f76('0x11d')](db['OpenchannelAccount'],{'foreignKey':_0x7f76('0x1da'),'as':'ToAccount'});db[_0x7f76('0xf9')]['belongsTo'](db['SmsMessage'],{});db[_0x7f76('0xf9')][_0x7f76('0x11d')](db[_0x7f76('0x54')],{});db[_0x7f76('0xf9')][_0x7f76('0x11d')](db[_0x7f76('0x51')],{'foreignKey':_0x7f76('0x1db'),'as':_0x7f76('0x1cc')});db[_0x7f76('0xf9')][_0x7f76('0x11d')](db['User'],{'foreignKey':_0x7f76('0x1cd'),'as':_0x7f76('0x1d3')});db[_0x7f76('0xf9')]['belongsTo'](db['User'],{'foreignKey':_0x7f76('0x1d4'),'as':_0x7f76('0x1ce')});db['SmsTransferReport'][_0x7f76('0x11d')](db[_0x7f76('0x57')],{'foreignKey':_0x7f76('0x1dc'),'as':_0x7f76('0x1d5')});db[_0x7f76('0xf9')][_0x7f76('0x11d')](db['SmsAccount'],{'foreignKey':_0x7f76('0x1dd'),'as':_0x7f76('0x1d1')});db[_0x7f76('0x123')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x123')][_0x7f76('0x111')](db[_0x7f76('0x7c')],{'as':_0x7f76('0x1de'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x123')][_0x7f76('0x111')](db[_0x7f76('0x73')],{'as':_0x7f76('0x1df'),'onDelete':'cascade','foreignKey':'ListId'});db[_0x7f76('0x123')][_0x7f76('0x111')](db[_0x7f76('0x78')],{'as':_0x7f76('0x115'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x123')][_0x7f76('0x111')](db[_0x7f76('0x79')],{'as':_0x7f76('0x116'),'foreignKey':_0x7f76('0x16a')});db['CmList']['hasMany'](db[_0x7f76('0x7a')],{'as':_0x7f76('0x7a'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x123')]['belongsToMany'](db[_0x7f76('0x19')],{'as':_0x7f76('0x1e0'),'through':_0x7f76('0x155')});db[_0x7f76('0x123')][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x1e1')});db[_0x7f76('0x135')][_0x7f76('0x111')](db['VoiceExtension'],{'as':_0x7f76('0x114'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0x135')][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x156'),'through':_0x7f76('0x1e2')});db[_0x7f76('0x11e')][_0x7f76('0x111')](db[_0x7f76('0x13')],{'as':_0x7f76('0x172'),'foreignKey':_0x7f76('0x11f')});db['UserProfile'][_0x7f76('0x111')](db['UserProfileSection'],{'as':_0x7f76('0x1e3'),'foreignKey':_0x7f76('0x11f'),'onDelete':_0x7f76('0x10f')});db[_0x7f76('0xfc')][_0x7f76('0x111')](db['UserProfileResource'],{'as':_0x7f76('0x1e4'),'foreignKey':'sectionId','onDelete':_0x7f76('0x10f')});db['WhatsappAccount'][_0x7f76('0x111')](db[_0x7f76('0x175')],{'as':_0x7f76('0x176'),'foreignKey':_0x7f76('0x1e5')});db[_0x7f76('0x101')][_0x7f76('0x111')](db[_0x7f76('0x80')],{'as':'Answers','foreignKey':_0x7f76('0x1e5')});db[_0x7f76('0x101')][_0x7f76('0x111')](db[_0x7f76('0x106')],{'as':_0x7f76('0x15b'),'foreignKey':_0x7f76('0x1e5')});db[_0x7f76('0x101')][_0x7f76('0x111')](db[_0x7f76('0x104')],{'as':_0x7f76('0x168')});db[_0x7f76('0x101')][_0x7f76('0x111')](db['WhatsappApplication'],{'as':'Applications'});db['WhatsappAccount'][_0x7f76('0x11d')](db['CmList'],{'as':_0x7f76('0x169'),'foreignKey':_0x7f76('0x16a')});db[_0x7f76('0x101')][_0x7f76('0x11d')](db[_0x7f76('0x86')],{'as':_0x7f76('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0x7f76('0x120')](db[_0x7f76('0x13')],{'as':_0x7f76('0x156'),'through':_0x7f76('0x140')});db[_0x7f76('0x1e6')][_0x7f76('0x11d')](db['User'],{'onDelete':_0x7f76('0x173')});db['WhatsappApplication'][_0x7f76('0x11d')](db[_0x7f76('0x10c')],{'onDelete':_0x7f76('0x173')});db[_0x7f76('0x1e6')][_0x7f76('0x11d')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x7f76('0x1e6')]['belongsTo'](db[_0x7f76('0x152')],{'onDelete':_0x7f76('0x173'),'foreignKey':_0x7f76('0x153')});db[_0x7f76('0x1e6')][_0x7f76('0x11d')](db[_0x7f76('0x8e')],{'onDelete':'restrict','foreignKey':_0x7f76('0x17a')});db[_0x7f76('0x104')][_0x7f76('0x111')](db[_0x7f76('0x106')],{'as':_0x7f76('0x15b'),'onDelete':_0x7f76('0x10f'),'foreignKey':_0x7f76('0x1e7')});db[_0x7f76('0x104')][_0x7f76('0x11d')](db[_0x7f76('0x101')],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x1e5')});db[_0x7f76('0x104')][_0x7f76('0x11d')](db[_0x7f76('0x73')],{'as':_0x7f76('0x162'),'foreignKey':_0x7f76('0x163')});db[_0x7f76('0x104')]['belongsTo'](db[_0x7f76('0x13')],{'as':_0x7f76('0x17c'),'foreignKey':_0x7f76('0x110')});db[_0x7f76('0x104')][_0x7f76('0x120')](db[_0x7f76('0x8e')],{'through':_0x7f76('0x1e8'),'as':_0x7f76('0x170')});db[_0x7f76('0x104')]['belongsToMany'](db[_0x7f76('0x8e')],{'through':_0x7f76('0x1e8'),'as':_0x7f76('0x171')});db['WhatsappInteraction'][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x172'),'through':_0x7f76('0x1e9'),'foreignKey':_0x7f76('0x1e7')});db[_0x7f76('0x106')]['belongsTo'](db['User'],{'as':_0x7f76('0x13')});db['WhatsappMessage'][_0x7f76('0x11d')](db['CmContact'],{'onDelete':_0x7f76('0x10f'),'as':_0x7f76('0x162')});db[_0x7f76('0x106')][_0x7f76('0x11d')](db[_0x7f76('0x104')],{'onDelete':_0x7f76('0x10f'),'as':'Interaction','foreignKey':_0x7f76('0x1e7')});db[_0x7f76('0x106')][_0x7f76('0x11d')](db['WhatsappAccount'],{'as':_0x7f76('0x16e'),'foreignKey':_0x7f76('0x1e5')});db[_0x7f76('0x108')][_0x7f76('0x11d')](db[_0x7f76('0x101')],{});db[_0x7f76('0x108')][_0x7f76('0x11d')](db[_0x7f76('0x123')],{'as':_0x7f76('0x169'),'foreignKey':'ListId'});db[_0x7f76('0x108')]['belongsTo'](db[_0x7f76('0x73')],{'as':'Contact','foreignKey':_0x7f76('0x163')});db['WhatsappQueueReport'][_0x7f76('0x11d')](db[_0x7f76('0x104')],{});db[_0x7f76('0x108')][_0x7f76('0x11d')](db[_0x7f76('0x10c')],{});db[_0x7f76('0x108')][_0x7f76('0x11d')](db[_0x7f76('0x106')],{});db[_0x7f76('0x108')][_0x7f76('0x11d')](db['User'],{});db[_0x7f76('0x10a')]['belongsTo'](db[_0x7f76('0x106')],{});db[_0x7f76('0x10a')][_0x7f76('0x11d')](db[_0x7f76('0x104')],{});db[_0x7f76('0x10a')][_0x7f76('0x11d')](db[_0x7f76('0x101')],{'foreignKey':'FromWhatsappAccountId','as':_0x7f76('0x1cc')});db[_0x7f76('0x10a')]['belongsTo'](db[_0x7f76('0x101')],{'foreignKey':_0x7f76('0x1ea'),'as':_0x7f76('0x1d1')});db['WhatsappTransferReport'][_0x7f76('0x11d')](db['WhatsappQueue'],{'foreignKey':_0x7f76('0x1eb'),'as':_0x7f76('0x1d5')});db['WhatsappTransferReport'][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'foreignKey':_0x7f76('0x1cd'),'as':_0x7f76('0x1d3')});db[_0x7f76('0x10a')][_0x7f76('0x11d')](db[_0x7f76('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x7f76('0x10c')][_0x7f76('0x120')](db['User'],{'as':_0x7f76('0x156'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x7f76('0x10c')][_0x7f76('0x120')](db[_0x7f76('0xea')],{'through':'team_has_whatsapp_queues','as':_0x7f76('0x157')});module[_0x7f76('0x1ec')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x3663=['../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','CannedAnswer','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/notification/notification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteraction','Notifications','SenderId','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','UserVoiceQueue','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','Applications','moh_has_sounds','Members','VoiceQueueId','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccount','MailAccountId','Disposition','Answers','Interactions','List','ListId','mandatoryDispositionPauseId','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','Account','restrict','TagId','MailQueueReport','Items','Dispositions','FaxAccountId','Exntensions','FaxQueue','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','ChatApplication','Agent','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CompanyId','Hoppers','cm_user_has_contacts','cm_contact_has_tags','Queue','OwnerId','CampaignId','Automation','All','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','DefaultReportId','Mohs','whatsapp_interaction_has_tags','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','Subjects','SubjectId','SalesforceConfiguration','Descriptions','DescriptionId','AccountId','Description','Field','FieldId','VariableId','DeskConfiguration','DeskAccount','int_desk_configuration_has_tags','ZohoField','Subject','int_zendesk_configuration_has_tags','FreshdeskField','VtigerField','ServicenowAccount','Dynamics365Configuration','FreshsalesField','ToId','SessionId','ProjectId','VoiceQueues','team_has_mail_queues','team_has_fax_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromUserId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','userProfileId','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','name','username','password','options','User'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x3663,0x1cf));var _0x3366=function(_0x4dfc30,_0x2f8ea3){_0x4dfc30=_0x4dfc30-0x0;var _0x4cabbe=_0x3663[_0x4dfc30];return _0x4cabbe;};'use strict';var path=require(_0x3366('0x0'));var config=require(_0x3366('0x1'));var Sequelize=require(_0x3366('0x2'));var _=require('lodash');var jstz=require(_0x3366('0x3'));var timezone=jstz[_0x3366('0x4')]();config['sequelize']=_[_0x3366('0x5')](config[_0x3366('0x2')],{'database':_0x3366('0x6'),'username':_0x3366('0x7'),'password':_0x3366('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x3366('0x9'),'dialectOptions':{'charset':_0x3366('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x3366('0xb'),'collate':_0x3366('0xc')}}});config[_0x3366('0xd')]=_['defaultsDeep'](config[_0x3366('0xd')],{'database':_0x3366('0x6'),'username':_0x3366('0x7'),'password':'xC@LL1234','options':{'host':_0x3366('0xe'),'port':0xcea,'dialect':_0x3366('0x9'),'dialectOptions':{'charset':_0x3366('0xa')},'logging':![],'timezone':timezone[_0x3366('0xf')](),'define':{'charset':_0x3366('0xb'),'collate':_0x3366('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3366('0x2')]['database'],config['sequelize'][_0x3366('0x10')],config[_0x3366('0x2')][_0x3366('0x11')],config[_0x3366('0x2')][_0x3366('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3366('0xd')]['database'],config['sequelizeHistory'][_0x3366('0x10')],config['sequelizeHistory'][_0x3366('0x11')],config[_0x3366('0xd')][_0x3366('0x12')])};db[_0x3366('0x13')]=db[_0x3366('0x2')]['import'](_0x3366('0x14'));db[_0x3366('0x15')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x17'));db[_0x3366('0x18')]=db['sequelize']['import'](_0x3366('0x19'));db['VoiceExtension']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x1a'));db[_0x3366('0x1b')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x3366('0x1c')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x1d'));db[_0x3366('0x1e')]=db['sequelize']['import'](_0x3366('0x1f'));db[_0x3366('0x20')]=db[_0x3366('0x2')]['import']('../api/screenRecording/screenRecording.model');db[_0x3366('0x21')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/voiceMail/voiceMail.model');db[_0x3366('0x22')]=db['sequelize'][_0x3366('0x16')](_0x3366('0x23'));db[_0x3366('0x24')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x25'));db[_0x3366('0x26')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x27'));db['VoiceAgentReport']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x3366('0x28')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x29'));db[_0x3366('0x2a')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x2b'));db[_0x3366('0x2c')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x2d'));db[_0x3366('0x2e')]=db['sequelize'][_0x3366('0x16')](_0x3366('0x2f'));db['UserVoiceQueue']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x30'));db['UserChatQueue']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x31'));db['UserMailQueue']=db[_0x3366('0x2')]['import'](_0x3366('0x32'));db[_0x3366('0x33')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x34'));db[_0x3366('0x35')]=db[_0x3366('0x2')]['import'](_0x3366('0x36'));db[_0x3366('0x37')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x38'));db[_0x3366('0x39')]=db[_0x3366('0x2')]['import'](_0x3366('0x3a'));db[_0x3366('0x3b')]=db['sequelize'][_0x3366('0x16')](_0x3366('0x3c'));db['MailAccount']=db['sequelize'][_0x3366('0x16')](_0x3366('0x3d'));db[_0x3366('0x3e')]=db[_0x3366('0x2')]['import']('../api/mailQueue/mailQueue.model');db[_0x3366('0x3f')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/mailSubstatus/mailSubstatus.model');db[_0x3366('0x40')]=db[_0x3366('0x2')]['import'](_0x3366('0x41'));db[_0x3366('0x42')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x43'));db[_0x3366('0x44')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x45'));db['MailQueueReport']=db[_0x3366('0x2')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x3366('0x46')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x47'));db[_0x3366('0x48')]=db['sequelize']['import']('../api/dashboardItem/dashboardItem.model');db[_0x3366('0x49')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x4a'));db[_0x3366('0x4b')]=db['sequelize'][_0x3366('0x16')](_0x3366('0x4c'));db[_0x3366('0x4d')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x4e'));db[_0x3366('0x4f')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x50'));db[_0x3366('0x51')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x52'));db[_0x3366('0x53')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/smsAccount/smsAccount.model');db[_0x3366('0x54')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/smsApplication/smsApplication.model');db[_0x3366('0x55')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x56'));db[_0x3366('0x57')]=db[_0x3366('0x2')]['import'](_0x3366('0x58'));db[_0x3366('0x59')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x5a'));db['OpenchannelApplication']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x5b'));db[_0x3366('0x5c')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x5d'));db[_0x3366('0x5e')]=db[_0x3366('0x2')]['import'](_0x3366('0x5f'));db[_0x3366('0x60')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x61'));db[_0x3366('0x62')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x63'));db[_0x3366('0x64')]=db['sequelize'][_0x3366('0x16')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db['sequelize']['import'](_0x3366('0x65'));db[_0x3366('0x66')]=db['sequelize'][_0x3366('0x16')](_0x3366('0x67'));db[_0x3366('0x68')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x69'));db[_0x3366('0x6a')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x6b'));db[_0x3366('0x6c')]=db[_0x3366('0x2')]['import']('../api/chatQueue/chatQueue.model');db[_0x3366('0x6d')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x6e'));db['ChatProactiveAction']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x6f'));db[_0x3366('0x70')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x71'));db[_0x3366('0x72')]=db[_0x3366('0x2')]['import'](_0x3366('0x73'));db[_0x3366('0x74')]=db[_0x3366('0x2')]['import'](_0x3366('0x75'));db[_0x3366('0x76')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x77'));db[_0x3366('0x78')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x3366('0x79')]=db['sequelize']['import'](_0x3366('0x7a'));db['ReportAgentPreview']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x7b'));db['CmCustomField']=db['sequelize'][_0x3366('0x16')](_0x3366('0x7c'));db[_0x3366('0x7d')]=db['sequelize'][_0x3366('0x16')]('../api/action/action.model');db['Automation']=db['sequelize'][_0x3366('0x16')]('../api/automation/automation.model');db[_0x3366('0x7e')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0x3366('0x16')]('../api/disposition/disposition.model');db[_0x3366('0x7f')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x80'));db[_0x3366('0x81')]=db[_0x3366('0x2')]['import'](_0x3366('0x82'));db[_0x3366('0x83')]=db['sequelize'][_0x3366('0x16')](_0x3366('0x84'));db[_0x3366('0x85')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/cdr/cdr.model');db[_0x3366('0x86')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x87'));db[_0x3366('0x88')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/schedule/schedule.model');db[_0x3366('0x89')]=db['sequelize'][_0x3366('0x16')](_0x3366('0x8a'));db[_0x3366('0x8b')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x8c'));db[_0x3366('0x8d')]=db['sequelize'][_0x3366('0x16')](_0x3366('0x8e'));db[_0x3366('0x8f')]=db[_0x3366('0x2')]['import']('../api/trigger/trigger.model');db[_0x3366('0x90')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x91'));db[_0x3366('0x92')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x93'));db['IntegrationReport']=db['sequelize'][_0x3366('0x16')](_0x3366('0x94'));db[_0x3366('0x95')]=db['sequelize']['import'](_0x3366('0x96'));db['AnalyticDefaultReport']=db[_0x3366('0x2')]['import'](_0x3366('0x97'));db[_0x3366('0x98')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import'](_0x3366('0x99'));db[_0x3366('0x9a')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x3366('0x9b')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x9c'));db['SalesforceConfiguration']=db['sequelize'][_0x3366('0x16')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x3366('0x9d')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x9e'));db[_0x3366('0x9f')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xa0'));db[_0x3366('0xa1')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xa2'));db[_0x3366('0xa3')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xa4'));db['DeskAccount']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xa5'));db['DeskConfiguration']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xa6'));db[_0x3366('0xa7')]=db[_0x3366('0x2')]['import']('../api/intDeskField/intDeskField.model');db[_0x3366('0xa8')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/intZohoAccount/intZohoAccount.model');db[_0x3366('0xa9')]=db['sequelize'][_0x3366('0x16')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xaa'));db[_0x3366('0xab')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xac'));db[_0x3366('0xad')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x3366('0xae')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xaf'));db[_0x3366('0xb0')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x3366('0xb1')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xb2'));db['FreshdeskField']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x3366('0xb3')]=db['sequelize']['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x3366('0xb4')]=db['sequelize'][_0x3366('0x16')](_0x3366('0xb5'));db['VtigerField']=db[_0x3366('0x2')]['import'](_0x3366('0xb6'));db['ServicenowAccount']=db[_0x3366('0x2')]['import'](_0x3366('0xb7'));db[_0x3366('0xb8')]=db['sequelize'][_0x3366('0x16')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x3366('0xb9')]=db['sequelize'][_0x3366('0x16')](_0x3366('0xba'));db[_0x3366('0xbb')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xbc'));db[_0x3366('0xbd')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xbe'));db[_0x3366('0xbf')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xc0'));db[_0x3366('0xc1')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xc2'));db['FreshsalesField']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x3366('0x92')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0x93'));db[_0x3366('0xc3')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/network/network.model');db[_0x3366('0xc4')]=db[_0x3366('0x2')]['import'](_0x3366('0xc5'));db[_0x3366('0xc6')]=db['sequelize'][_0x3366('0x16')](_0x3366('0xc7'));db[_0x3366('0xc8')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xc9'));db[_0x3366('0xca')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x3366('0xcb')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xcc'));db[_0x3366('0xcd')]=db[_0x3366('0x2')]['import'](_0x3366('0xce'));db[_0x3366('0xcf')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xd0'));db[_0x3366('0xd1')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xd2'));db['JscriptyProject']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/jscriptyProject/jscriptyProject.model');db[_0x3366('0xd3')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xd4'));db[_0x3366('0xd5')]=db['sequelize'][_0x3366('0x16')](_0x3366('0xd6'));db['SquareProject']=db['sequelize'][_0x3366('0x16')]('../api/squareProject/squareProject.model');db[_0x3366('0xd7')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xd8'));db[_0x3366('0xd9')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xda'));db[_0x3366('0xdb')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/team/team.model');db['License']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/license/license.model');db[_0x3366('0xdc')]=db['sequelize'][_0x3366('0x16')](_0x3366('0xdd'));db[_0x3366('0xde')]=db[_0x3366('0x2')]['import'](_0x3366('0xdf'));db[_0x3366('0xe0')]=db[_0x3366('0x2')]['import']('../api/attachment/attachment.model');db[_0x3366('0xe1')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xe2'));db[_0x3366('0xe3')]=db[_0x3366('0x2')]['import'](_0x3366('0xe4'));db[_0x3366('0xe5')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xe6'));db[_0x3366('0xe7')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xe8'));db['OpenchannelTransferReport']=db['sequelize'][_0x3366('0x16')](_0x3366('0xe9'));db['SmsTransferReport']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/smsTransferReport/smsTransferReport.model');db[_0x3366('0xea')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xeb'));db[_0x3366('0xec')]=db['sequelize'][_0x3366('0x16')](_0x3366('0xed'));db[_0x3366('0xee')]=db['sequelize'][_0x3366('0x16')](_0x3366('0xef'));db['UserProfileSection']=db[_0x3366('0x2')]['import'](_0x3366('0xf0'));db[_0x3366('0xf1')]=db[_0x3366('0x2')][_0x3366('0x16')]('../api/userProfileResource/userProfileResource.model');db['Notification']=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xf2'));db[_0x3366('0xf3')]=db['sequelize'][_0x3366('0x16')](_0x3366('0xf4'));db[_0x3366('0xf5')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xf6'));db['WhatsappInteraction']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x3366('0x2')]['import'](_0x3366('0xf7'));db[_0x3366('0xf8')]=db['sequelize']['import'](_0x3366('0xf9'));db[_0x3366('0xfa')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xfb'));db[_0x3366('0xfc')]=db[_0x3366('0x2')][_0x3366('0x16')](_0x3366('0xfd'));db['CloudProvider']=db[_0x3366('0x2')][_0x3366('0x16')]('../api/cloudProvider/cloudProvider.model');db[_0x3366('0x13')][_0x3366('0xfe')](db[_0x3366('0x21')],{'as':_0x3366('0x21'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x13')][_0x3366('0x101')](db[_0x3366('0x1e')],{'as':_0x3366('0x102'),'foreignKey':_0x3366('0x100')});db['User']['hasMany'](db[_0x3366('0x2e')],{'as':_0x3366('0x103'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x13')][_0x3366('0x101')](db[_0x3366('0x104')],{'as':_0x3366('0x105'),'onDelete':_0x3366('0xff'),'hooks':!![]});db[_0x3366('0x13')][_0x3366('0x101')](db[_0x3366('0x78')],{'as':_0x3366('0x106'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x13')][_0x3366('0x101')](db['CmHopperHistory'],{'as':_0x3366('0x107'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x13')]['hasMany'](db[_0x3366('0x108')],{'as':'ReportAgentPreview','foreignKey':_0x3366('0x100')});db[_0x3366('0x13')][_0x3366('0x101')](db[_0x3366('0x5c')],{'as':_0x3366('0x109'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x13')][_0x3366('0x101')](db[_0x3366('0x66')],{'as':_0x3366('0x10a'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x13')][_0x3366('0x101')](db['SmsInteraction'],{'as':_0x3366('0x10b'),'foreignKey':'UserId'});db['User'][_0x3366('0x101')](db[_0x3366('0x4d')],{'as':'FaxInteractions','foreignKey':_0x3366('0x100')});db[_0x3366('0x13')][_0x3366('0x101')](db[_0x3366('0x40')],{'as':_0x3366('0x10c'),'foreignKey':'UserId'});db['User'][_0x3366('0x101')](db[_0x3366('0x10d')],{'as':'WhatsappInteractions','foreignKey':_0x3366('0x100')});db[_0x3366('0x13')][_0x3366('0x101')](db['Notification'],{'as':_0x3366('0x10e'),'foreignKey':_0x3366('0x10f')});db[_0x3366('0x13')][_0x3366('0x110')](db[_0x3366('0xee')],{'as':_0x3366('0xee'),'foreignKey':'userProfileId'});db['User'][_0x3366('0x111')](db[_0x3366('0x6d')],{'as':_0x3366('0x112'),'through':_0x3366('0x113')});db[_0x3366('0x13')]['belongsToMany'](db['CmContact'],{'as':_0x3366('0x114'),'through':'cm_user_has_contacts'});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0xea')],{'as':_0x3366('0x115'),'through':_0x3366('0x116')});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0xdb')],{'through':_0x3366('0x117')});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0x40')],{'as':_0x3366('0x10c'),'through':_0x3366('0x118')});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0x66')],{'as':_0x3366('0x10a'),'through':'user_has_chat_interactions'});db['User'][_0x3366('0x111')](db[_0x3366('0x4d')],{'as':_0x3366('0x119'),'through':'user_has_fax_interactions'});db[_0x3366('0x13')]['belongsToMany'](db[_0x3366('0x55')],{'as':_0x3366('0x10b'),'through':_0x3366('0x11a')});db[_0x3366('0x13')][_0x3366('0x111')](db['OpenchannelInteraction'],{'as':_0x3366('0x109'),'through':'user_has_openchannel_interactions'});db['User'][_0x3366('0x111')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0x3366('0x11b')});db['User'][_0x3366('0x111')](db[_0x3366('0x1c')],{'as':'VoiceQueues','through':_0x3366('0x11c'),'required':![]});db[_0x3366('0x13')][_0x3366('0x111')](db['MailQueue'],{'as':_0x3366('0x11d'),'through':'UserMailQueue','required':![]});db[_0x3366('0x13')][_0x3366('0x111')](db['ChatQueue'],{'as':_0x3366('0x11e'),'through':_0x3366('0x11f'),'required':![],'hooks':!![]});db[_0x3366('0x13')][_0x3366('0x111')](db['FaxQueue'],{'as':_0x3366('0x120'),'through':'UserFaxQueue','required':![]});db[_0x3366('0x13')][_0x3366('0x111')](db['SmsQueue'],{'as':_0x3366('0x121'),'through':_0x3366('0x122'),'required':![]});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0x60')],{'as':_0x3366('0x123'),'through':_0x3366('0x35'),'required':![]});db['User']['belongsToMany'](db[_0x3366('0xfc')],{'as':_0x3366('0x124'),'through':'UserWhatsappQueue','required':![]});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0xea')],{'through':_0x3366('0x116')});db[_0x3366('0x13')][_0x3366('0x111')](db['VoicePrefix'],{'as':_0x3366('0x125'),'through':_0x3366('0x126'),'required':![]});db['User']['belongsToMany'](db[_0x3366('0x62')],{'as':_0x3366('0x127'),'through':_0x3366('0x128')});db['User'][_0x3366('0x111')](db[_0x3366('0x49')],{'as':_0x3366('0x129'),'through':_0x3366('0x12a')});db[_0x3366('0x13')]['belongsToMany'](db['MailAccount'],{'as':_0x3366('0x12b'),'through':_0x3366('0x12c')});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0x12d')],{'as':_0x3366('0x12e'),'through':_0x3366('0x12f')});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0x53')],{'as':_0x3366('0x130'),'through':_0x3366('0x131')});db[_0x3366('0x13')][_0x3366('0x111')](db[_0x3366('0xf3')],{'as':_0x3366('0x132'),'through':_0x3366('0x133')});db[_0x3366('0x13')]['belongsToMany'](db[_0x3366('0x134')],{'as':_0x3366('0x135'),'through':_0x3366('0x136')});db[_0x3366('0x15')][_0x3366('0x101')](db['VoiceExtension'],{'as':_0x3366('0x137'),'onDelete':_0x3366('0xff'),'foreignKey':'ChanSpyId'});db[_0x3366('0x18')]['hasMany'](db[_0x3366('0x104')],{'onDelete':_0x3366('0xff')});db[_0x3366('0x104')][_0x3366('0x101')](db[_0x3366('0x104')],{'as':_0x3366('0x138'),'onDelete':'cascade'});db[_0x3366('0x1b')][_0x3366('0x111')](db[_0x3366('0x89')],{'as':'Sounds','through':_0x3366('0x139')});db['VoiceQueue']['hasMany'](db[_0x3366('0x2e')],{'as':_0x3366('0x13a'),'foreignKey':_0x3366('0x13b')});db[_0x3366('0x1c')][_0x3366('0x101')](db[_0x3366('0x74')],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x3366('0x1c')][_0x3366('0x101')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x3366('0x13b')});db['VoiceQueue']['hasMany'](db[_0x3366('0x79')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x3366('0x101')](db[_0x3366('0x108')],{'as':_0x3366('0x108'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x3366('0x101')](db[_0x3366('0x76')],{'as':_0x3366('0x13c'),'foreignKey':_0x3366('0x13b')});db[_0x3366('0x1c')][_0x3366('0x101')](db[_0x3366('0xcb')],{'as':'JscriptySessions','foreignKey':_0x3366('0x13b')});db[_0x3366('0x1c')][_0x3366('0x110')](db[_0x3366('0x2c')],{'as':_0x3366('0x2c'),'foreignKey':_0x3366('0x13d')});db[_0x3366('0x1c')][_0x3366('0x110')](db[_0x3366('0x2c')],{'as':_0x3366('0x13e'),'foreignKey':_0x3366('0x13f')});db[_0x3366('0x1c')]['belongsTo'](db[_0x3366('0x81')],{'as':_0x3366('0x81'),'foreignKey':_0x3366('0x140')});db['VoiceQueue'][_0x3366('0x110')](db[_0x3366('0x83')],{'as':_0x3366('0x141'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3366('0x1c')]['belongsToMany'](db[_0x3366('0xea')],{'as':'Lists','through':_0x3366('0x142')});db[_0x3366('0x1c')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x143'),'through':_0x3366('0x11c')});db[_0x3366('0x1c')][_0x3366('0x111')](db[_0x3366('0xdb')],{'as':_0x3366('0x144'),'through':_0x3366('0x145')});db[_0x3366('0x1c')]['belongsToMany'](db['CmList'],{'as':'BlackLists','through':_0x3366('0x146')});db[_0x3366('0x1e')][_0x3366('0x110')](db[_0x3366('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x3366('0x20')]['belongsTo'](db[_0x3366('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x3366('0x21')]['hasMany'](db['VoiceMailMessage'],{'as':_0x3366('0x147'),'onDelete':_0x3366('0xff'),'foreignKey':'mailboxuser','sourceKey':_0x3366('0x148')});db[_0x3366('0x22')][_0x3366('0x110')](db[_0x3366('0x21')],{'foreignKey':_0x3366('0x149'),'targetKey':'mailbox'});db[_0x3366('0x24')][_0x3366('0x101')](db[_0x3366('0x28')],{'as':_0x3366('0x14a'),'foreignKey':_0x3366('0x14b'),'constraints':![]});db[_0x3366('0x24')][_0x3366('0x101')](db[_0x3366('0x14c')],{'as':_0x3366('0x14d'),'foreignKey':_0x3366('0x14b'),'constraints':![]});db['VoiceCallReport'][_0x3366('0x110')](db[_0x3366('0x13')],{'as':_0x3366('0x13'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x24')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0x39')][_0x3366('0x110')](db[_0x3366('0x150')],{'as':_0x3366('0x150'),'foreignKey':_0x3366('0x151')});db[_0x3366('0x3b')]['belongsTo'](db[_0x3366('0x150')],{'as':_0x3366('0x150'),'foreignKey':_0x3366('0x151')});db['MailAccount']['hasOne'](db[_0x3366('0x39')],{'as':'Imap','onDelete':_0x3366('0xff')});db[_0x3366('0x150')][_0x3366('0xfe')](db[_0x3366('0x3b')],{'as':'Smtp','onDelete':_0x3366('0xff')});db[_0x3366('0x150')][_0x3366('0x101')](db[_0x3366('0x152')],{'as':'Dispositions','foreignKey':_0x3366('0x151')});db[_0x3366('0x150')][_0x3366('0x101')](db['CannedAnswer'],{'as':_0x3366('0x153'),'foreignKey':'MailAccountId'});db[_0x3366('0x150')][_0x3366('0x101')](db[_0x3366('0x42')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x3366('0x150')][_0x3366('0x101')](db[_0x3366('0x40')],{'as':_0x3366('0x154')});db[_0x3366('0x150')][_0x3366('0x101')](db[_0x3366('0x44')],{'as':'Applications'});db[_0x3366('0x150')][_0x3366('0x110')](db['CmList'],{'as':_0x3366('0x155'),'foreignKey':_0x3366('0x156')});db['MailAccount']['belongsTo'](db[_0x3366('0x8d')],{'as':_0x3366('0x8d'),'foreignKey':'TemplateId'});db[_0x3366('0x150')][_0x3366('0x110')](db[_0x3366('0x83')],{'as':_0x3366('0x141'),'foreignKey':_0x3366('0x157')});db[_0x3366('0x150')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':'Agents','through':_0x3366('0x12c')});db[_0x3366('0x3e')][_0x3366('0x111')](db['User'],{'as':_0x3366('0x143'),'through':'UserMailQueue'});db[_0x3366('0x3e')][_0x3366('0x111')](db[_0x3366('0xdb')],{'through':'team_has_mail_queues','as':_0x3366('0x144')});db[_0x3366('0x40')][_0x3366('0x101')](db[_0x3366('0x42')],{'as':'Messages','onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x158')});db['MailInteraction']['belongsTo'](db[_0x3366('0x150')],{'as':'Account','foreignKey':_0x3366('0x151')});db['MailInteraction'][_0x3366('0x110')](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0x40')]['belongsTo'](db['User'],{'as':_0x3366('0x159'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x40')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x15a'),'as':_0x3366('0x15b')});db['MailInteraction']['belongsToMany'](db[_0x3366('0x8b')],{'through':_0x3366('0x15a'),'as':_0x3366('0x15c')});db[_0x3366('0x40')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x15d'),'through':'user_has_mail_interactions','foreignKey':_0x3366('0x158')});db[_0x3366('0x42')][_0x3366('0x101')](db[_0x3366('0xe0')],{'as':_0x3366('0x15e'),'onDelete':'cascade'});db['MailMessage']['belongsTo'](db[_0x3366('0x13')],{'as':'User'});db[_0x3366('0x42')][_0x3366('0x110')](db[_0x3366('0x72')],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x14e')});db[_0x3366('0x42')][_0x3366('0x110')](db[_0x3366('0x40')],{'as':_0x3366('0x15f'),'foreignKey':_0x3366('0x158')});db[_0x3366('0x42')][_0x3366('0x110')](db[_0x3366('0x150')],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x151')});db[_0x3366('0x44')][_0x3366('0x110')](db[_0x3366('0x13')],{'onDelete':_0x3366('0x161')});db[_0x3366('0x44')][_0x3366('0x110')](db[_0x3366('0x3e')],{'onDelete':'restrict'});db[_0x3366('0x44')]['belongsTo'](db[_0x3366('0x150')],{'onDelete':_0x3366('0x161')});db[_0x3366('0x44')][_0x3366('0x110')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x3366('0x140')});db['MailApplication']['belongsTo'](db[_0x3366('0x8b')],{'onDelete':'restrict','foreignKey':_0x3366('0x162')});db[_0x3366('0x163')][_0x3366('0x110')](db['MailAccount'],{});db[_0x3366('0x163')][_0x3366('0x110')](db[_0x3366('0xea')],{'as':_0x3366('0x155'),'foreignKey':'ListId'});db[_0x3366('0x163')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport'][_0x3366('0x110')](db[_0x3366('0x40')],{});db[_0x3366('0x163')][_0x3366('0x110')](db[_0x3366('0x42')],{});db[_0x3366('0x163')][_0x3366('0x110')](db[_0x3366('0x13')],{});db[_0x3366('0x163')][_0x3366('0x110')](db[_0x3366('0x3e')],{});db[_0x3366('0x46')][_0x3366('0x101')](db[_0x3366('0x48')],{'as':_0x3366('0x164'),'onDelete':_0x3366('0xff')});db[_0x3366('0x49')][_0x3366('0x101')](db[_0x3366('0x152')],{'as':_0x3366('0x165'),'foreignKey':_0x3366('0x166')});db['FaxAccount'][_0x3366('0x101')](db[_0x3366('0x7e')],{'as':'Answers','foreignKey':_0x3366('0x166')});db[_0x3366('0x49')]['hasMany'](db['FaxInteraction'],{'as':_0x3366('0x154')});db[_0x3366('0x49')]['hasMany'](db[_0x3366('0x4b')],{'as':'Applications'});db[_0x3366('0x49')][_0x3366('0x101')](db[_0x3366('0x104')],{'as':_0x3366('0x167'),'onDelete':_0x3366('0xff')});db[_0x3366('0x49')]['hasMany'](db[_0x3366('0x4f')],{'as':_0x3366('0x147')});db['FaxAccount']['belongsTo'](db[_0x3366('0x2c')],{'as':_0x3366('0x2c')});db[_0x3366('0x49')][_0x3366('0x110')](db[_0x3366('0xea')],{'as':'List','foreignKey':_0x3366('0x156')});db[_0x3366('0x49')][_0x3366('0x110')](db[_0x3366('0x83')],{'as':_0x3366('0x141'),'foreignKey':_0x3366('0x157')});db[_0x3366('0x49')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':'Agents','through':_0x3366('0x12a')});db[_0x3366('0x4b')][_0x3366('0x110')](db[_0x3366('0x13')],{'onDelete':'restrict'});db[_0x3366('0x4b')][_0x3366('0x110')](db[_0x3366('0x168')],{'onDelete':'restrict'});db[_0x3366('0x4b')][_0x3366('0x110')](db['FaxAccount'],{'onDelete':_0x3366('0x161')});db[_0x3366('0x4b')][_0x3366('0x110')](db[_0x3366('0x8b')],{'onDelete':_0x3366('0x161'),'foreignKey':_0x3366('0x162')});db['FaxInteraction'][_0x3366('0x101')](db['FaxMessage'],{'as':_0x3366('0x147'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x169')});db['FaxInteraction']['belongsTo'](db[_0x3366('0x49')],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x166')});db[_0x3366('0x4d')]['belongsTo'](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db['FaxInteraction'][_0x3366('0x110')](db[_0x3366('0x13')],{'as':'Owner','foreignKey':_0x3366('0x100')});db[_0x3366('0x4d')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x16a'),'as':_0x3366('0x15b')});db[_0x3366('0x4d')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':'fax_interaction_has_tags','as':_0x3366('0x15c')});db['FaxInteraction'][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x15d'),'through':_0x3366('0x16b'),'foreignKey':_0x3366('0x169')});db[_0x3366('0x4f')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x3366('0x13')});db[_0x3366('0x4f')][_0x3366('0x110')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x3366('0x169')});db[_0x3366('0x4f')]['belongsTo'](db[_0x3366('0x72')],{'onDelete':'cascade','as':_0x3366('0x14e')});db[_0x3366('0x4f')][_0x3366('0x110')](db['Attachment'],{'as':_0x3366('0xe0'),'foreignKey':'AttachmentId'});db[_0x3366('0x4f')][_0x3366('0x110')](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x3366('0x168')]['belongsToMany'](db['User'],{'as':_0x3366('0x143'),'through':'UserFaxQueue'});db[_0x3366('0x168')][_0x3366('0x111')](db['Team'],{'through':'team_has_fax_queues','as':_0x3366('0x144')});db[_0x3366('0x51')][_0x3366('0x110')](db['FaxAccount'],{});db[_0x3366('0x51')][_0x3366('0x110')](db[_0x3366('0xea')],{'as':_0x3366('0x155'),'foreignKey':_0x3366('0x156')});db[_0x3366('0x51')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0x51')][_0x3366('0x110')](db[_0x3366('0x4d')],{});db[_0x3366('0x51')][_0x3366('0x110')](db[_0x3366('0x4f')],{});db['FaxQueueReport']['belongsTo'](db[_0x3366('0x13')],{});db[_0x3366('0x51')][_0x3366('0x110')](db['FaxQueue'],{});db[_0x3366('0x53')][_0x3366('0x101')](db['Disposition'],{'as':_0x3366('0x165'),'foreignKey':_0x3366('0x16c')});db[_0x3366('0x53')][_0x3366('0x101')](db[_0x3366('0x7e')],{'as':_0x3366('0x153'),'foreignKey':'SmsAccountId'});db[_0x3366('0x53')][_0x3366('0x101')](db['SmsMessage'],{'as':_0x3366('0x147'),'foreignKey':_0x3366('0x16c')});db[_0x3366('0x53')]['hasMany'](db[_0x3366('0x55')],{'as':'Interactions'});db[_0x3366('0x53')][_0x3366('0x101')](db[_0x3366('0x54')],{'as':_0x3366('0x138')});db['SmsAccount'][_0x3366('0x110')](db[_0x3366('0xea')],{'as':'List','foreignKey':'ListId'});db[_0x3366('0x53')][_0x3366('0x110')](db[_0x3366('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x3366('0x157')});db['SmsAccount'][_0x3366('0x111')](db[_0x3366('0x13')],{'as':'Agents','through':_0x3366('0x131')});db[_0x3366('0x54')][_0x3366('0x110')](db[_0x3366('0x13')],{'onDelete':_0x3366('0x161')});db[_0x3366('0x54')][_0x3366('0x110')](db['SmsQueue'],{'onDelete':_0x3366('0x161')});db[_0x3366('0x54')][_0x3366('0x110')](db['SmsAccount'],{'onDelete':_0x3366('0x161')});db[_0x3366('0x54')]['belongsTo'](db[_0x3366('0x81')],{'onDelete':_0x3366('0x161'),'foreignKey':_0x3366('0x140')});db[_0x3366('0x54')]['belongsTo'](db['Tag'],{'onDelete':_0x3366('0x161'),'foreignKey':_0x3366('0x162')});db[_0x3366('0x55')]['hasMany'](db['SmsMessage'],{'as':_0x3366('0x147'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x16d')});db[_0x3366('0x55')][_0x3366('0x110')](db[_0x3366('0x53')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x3366('0x55')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':'Contact','foreignKey':_0x3366('0x14f')});db['SmsInteraction'][_0x3366('0x110')](db[_0x3366('0x13')],{'as':_0x3366('0x159'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x55')]['belongsToMany'](db[_0x3366('0x8b')],{'through':_0x3366('0x16e'),'as':_0x3366('0x15b')});db[_0x3366('0x55')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x16e'),'as':_0x3366('0x15c')});db[_0x3366('0x55')]['belongsToMany'](db[_0x3366('0x13')],{'as':_0x3366('0x15d'),'through':_0x3366('0x11a'),'foreignKey':_0x3366('0x16d')});db[_0x3366('0x57')][_0x3366('0x110')](db[_0x3366('0x13')],{'as':'User'});db[_0x3366('0x57')]['belongsTo'](db[_0x3366('0x72')],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x14e')});db['SmsMessage'][_0x3366('0x110')](db[_0x3366('0x55')],{'onDelete':'cascade','as':_0x3366('0x15f'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x3366('0x110')](db[_0x3366('0x53')],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x16c')});db[_0x3366('0x59')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x143'),'through':_0x3366('0x122'),'foreignKey':'SmsQueueId'});db[_0x3366('0x59')][_0x3366('0x111')](db[_0x3366('0xdb')],{'through':_0x3366('0x16f'),'as':_0x3366('0x144')});db[_0x3366('0x12d')][_0x3366('0x101')](db[_0x3366('0x152')],{'as':_0x3366('0x165'),'foreignKey':_0x3366('0x170')});db[_0x3366('0x12d')][_0x3366('0x101')](db['CannedAnswer'],{'as':_0x3366('0x153'),'foreignKey':_0x3366('0x170')});db['OpenchannelAccount'][_0x3366('0x101')](db[_0x3366('0x5c')],{'as':'Interactions','foreignKey':_0x3366('0x170')});db[_0x3366('0x12d')][_0x3366('0x101')](db[_0x3366('0x5e')],{'as':_0x3366('0x147'),'foreignKey':'OpenchannelAccountId'});db[_0x3366('0x12d')][_0x3366('0x101')](db[_0x3366('0x171')],{'as':'Applications','foreignKey':_0x3366('0x170')});db['OpenchannelAccount'][_0x3366('0x110')](db[_0x3366('0xea')],{'as':_0x3366('0x155'),'foreignKey':_0x3366('0x156')});db[_0x3366('0x12d')][_0x3366('0x110')](db[_0x3366('0x83')],{'as':_0x3366('0x141'),'foreignKey':_0x3366('0x157')});db['OpenchannelAccount'][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x143'),'through':_0x3366('0x12f')});db['OpenchannelApplication'][_0x3366('0x110')](db[_0x3366('0x13')],{'onDelete':_0x3366('0x161')});db[_0x3366('0x171')][_0x3366('0x110')](db[_0x3366('0x60')],{'onDelete':_0x3366('0x161'),'foreignKey':_0x3366('0x172')});db[_0x3366('0x171')][_0x3366('0x110')](db[_0x3366('0x12d')],{'onDelete':'restrict','foreignKey':_0x3366('0x170')});db['OpenchannelApplication'][_0x3366('0x110')](db[_0x3366('0x81')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x3366('0x171')][_0x3366('0x110')](db[_0x3366('0x8b')],{'onDelete':_0x3366('0x161'),'foreignKey':_0x3366('0x162')});db[_0x3366('0x5c')][_0x3366('0x101')](db[_0x3366('0x5e')],{'as':'Messages','onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x173')});db[_0x3366('0x5c')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x170')});db['OpenchannelInteraction'][_0x3366('0x110')](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db['OpenchannelInteraction'][_0x3366('0x110')](db[_0x3366('0x13')],{'as':_0x3366('0x159'),'foreignKey':'UserId'});db[_0x3366('0x5c')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x174'),'as':_0x3366('0x15b')});db[_0x3366('0x5c')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x174'),'as':_0x3366('0x15c')});db[_0x3366('0x5c')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x15d'),'through':_0x3366('0x175'),'foreignKey':_0x3366('0x173')});db[_0x3366('0x5e')][_0x3366('0x110')](db[_0x3366('0x13')],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x13')});db['OpenchannelMessage'][_0x3366('0x110')](db['CmContact'],{'onDelete':'cascade','as':_0x3366('0x14e')});db['OpenchannelMessage'][_0x3366('0x110')](db['OpenchannelInteraction'],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x15f'),'foreignKey':_0x3366('0x173')});db[_0x3366('0x5e')]['belongsTo'](db['Attachment'],{'as':_0x3366('0xe0'),'foreignKey':_0x3366('0x176')});db['OpenchannelMessage']['belongsTo'](db[_0x3366('0x12d')],{'as':'Account','foreignKey':_0x3366('0x170')});db[_0x3366('0x60')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x143'),'through':'UserOpenchannelQueue','foreignKey':_0x3366('0x172')});db[_0x3366('0x60')][_0x3366('0x111')](db[_0x3366('0xdb')],{'through':_0x3366('0x177'),'as':_0x3366('0x144')});db[_0x3366('0x62')][_0x3366('0x101')](db[_0x3366('0x152')],{'as':_0x3366('0x165'),'foreignKey':_0x3366('0x178')});db[_0x3366('0x62')][_0x3366('0x101')](db[_0x3366('0x7e')],{'as':_0x3366('0x153'),'foreignKey':'ChatWebsiteId'});db[_0x3366('0x62')][_0x3366('0x101')](db[_0x3366('0x179')],{'as':_0x3366('0x17a')});db[_0x3366('0x62')][_0x3366('0x101')](db[_0x3366('0x66')],{'as':'Interactions'});db[_0x3366('0x62')][_0x3366('0x101')](db[_0x3366('0x17b')],{'as':'Applications'});db[_0x3366('0x62')][_0x3366('0x101')](db['ChatMessage'],{'as':_0x3366('0x147')});db['ChatWebsite'][_0x3366('0x110')](db[_0x3366('0xea')],{'as':'List','foreignKey':_0x3366('0x156')});db[_0x3366('0x62')][_0x3366('0x110')](db[_0x3366('0x81')],{'as':_0x3366('0x81'),'foreignKey':_0x3366('0x140')});db['ChatWebsite'][_0x3366('0x110')](db[_0x3366('0x83')],{'as':_0x3366('0x141'),'foreignKey':_0x3366('0x157')});db['ChatWebsite'][_0x3366('0x111')](db['User'],{'as':_0x3366('0x143'),'through':_0x3366('0x128')});db[_0x3366('0x64')][_0x3366('0x110')](db['OpenchannelAccount'],{});db[_0x3366('0x64')][_0x3366('0x110')](db['CmList'],{'as':_0x3366('0x155'),'foreignKey':_0x3366('0x156')});db[_0x3366('0x64')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0x64')]['belongsTo'](db[_0x3366('0x5c')],{});db['OpenchannelQueueReport'][_0x3366('0x110')](db[_0x3366('0x5e')],{});db[_0x3366('0x64')][_0x3366('0x110')](db['User'],{});db[_0x3366('0x64')][_0x3366('0x110')](db[_0x3366('0x60')],{});db[_0x3366('0x17b')][_0x3366('0x110')](db[_0x3366('0x13')],{'as':_0x3366('0x17c'),'foreignKey':'UserId','onDelete':_0x3366('0x161')});db[_0x3366('0x17b')]['belongsTo'](db['ChatQueue'],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x3366('0x161')});db[_0x3366('0x17b')]['belongsTo'](db[_0x3366('0x62')],{'as':_0x3366('0x17d'),'foreignKey':_0x3366('0x178'),'onDelete':_0x3366('0x161')});db[_0x3366('0x17b')][_0x3366('0x110')](db[_0x3366('0x8b')],{'onDelete':_0x3366('0x161'),'foreignKey':_0x3366('0x162')});db[_0x3366('0x66')][_0x3366('0x101')](db[_0x3366('0x68')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x3366('0x17e')});db[_0x3366('0x66')][_0x3366('0x110')](db[_0x3366('0x62')],{'as':'Account','foreignKey':_0x3366('0x178')});db[_0x3366('0x66')]['belongsTo'](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':'ContactId'});db['ChatInteraction']['belongsTo'](db[_0x3366('0x13')],{'as':_0x3366('0x159'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x66')]['belongsToMany'](db[_0x3366('0x8b')],{'through':_0x3366('0x17f'),'as':_0x3366('0x15b')});db[_0x3366('0x66')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x17f'),'as':_0x3366('0x15c')});db[_0x3366('0x66')]['belongsToMany'](db[_0x3366('0x13')],{'as':'Users','through':_0x3366('0x180'),'foreignKey':_0x3366('0x17e')});db[_0x3366('0x68')][_0x3366('0x110')](db[_0x3366('0x13')],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x13')});db['ChatMessage'][_0x3366('0x110')](db[_0x3366('0x72')],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0x68')][_0x3366('0x110')](db[_0x3366('0x66')],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x15f'),'foreignKey':_0x3366('0x17e')});db['ChatMessage']['belongsTo'](db[_0x3366('0xe0')],{'as':_0x3366('0xe0'),'foreignKey':_0x3366('0x176')});db[_0x3366('0x68')]['belongsTo'](db[_0x3366('0x62')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x3366('0x6a')][_0x3366('0x110')](db[_0x3366('0x72')],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0x6a')]['belongsTo'](db[_0x3366('0x62')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x3366('0x6c')][_0x3366('0x111')](db['User'],{'as':_0x3366('0x143'),'through':_0x3366('0x11f'),'hooks':!![]});db[_0x3366('0x6c')][_0x3366('0x111')](db[_0x3366('0xdb')],{'through':_0x3366('0x181'),'as':_0x3366('0x144')});db[_0x3366('0x6d')][_0x3366('0x101')](db[_0x3366('0xc6')],{'as':_0x3366('0x147'),'foreignKey':_0x3366('0x182'),'onDelete':_0x3366('0xff')});db[_0x3366('0x6d')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x13a'),'through':_0x3366('0x113')});db['ChatProactiveAction'][_0x3366('0x110')](db[_0x3366('0x62')],{'as':_0x3366('0x17d'),'foreignKey':'ChatWebsiteId'});db[_0x3366('0x70')][_0x3366('0x101')](db[_0x3366('0x72')],{'as':_0x3366('0x114'),'foreignKey':_0x3366('0x183')});db[_0x3366('0x72')][_0x3366('0x101')](db[_0x3366('0x74')],{'as':_0x3366('0x184'),'foreignKey':'ContactId'});db['CmContact'][_0x3366('0x101')](db[_0x3366('0x78')],{'as':_0x3366('0x106'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0x72')][_0x3366('0x101')](db[_0x3366('0x79')],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact'][_0x3366('0x101')](db[_0x3366('0x108')],{'as':_0x3366('0x108'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0x72')]['hasMany'](db[_0x3366('0xcb')],{'as':'JscriptySessions','foreignKey':_0x3366('0x14f')});db['CmContact'][_0x3366('0x101')](db[_0x3366('0x5c')],{'as':_0x3366('0x109'),'foreignKey':_0x3366('0x14f'),'onDelete':_0x3366('0x161')});db[_0x3366('0x72')][_0x3366('0x101')](db[_0x3366('0x66')],{'as':_0x3366('0x10a'),'foreignKey':_0x3366('0x14f'),'onDelete':_0x3366('0x161')});db['CmContact']['hasMany'](db[_0x3366('0x55')],{'as':_0x3366('0x10b'),'foreignKey':_0x3366('0x14f'),'onDelete':'restrict'});db['CmContact'][_0x3366('0x101')](db[_0x3366('0x4d')],{'as':_0x3366('0x119'),'foreignKey':'ContactId','onDelete':_0x3366('0x161')});db['CmContact'][_0x3366('0x101')](db[_0x3366('0x40')],{'as':_0x3366('0x10c'),'foreignKey':_0x3366('0x14f'),'onDelete':'restrict'});db[_0x3366('0x72')][_0x3366('0x110')](db['CmCompany'],{'as':'Company','foreignKey':_0x3366('0x183')});db[_0x3366('0x72')][_0x3366('0x110')](db[_0x3366('0xea')],{'as':_0x3366('0x155'),'foreignKey':_0x3366('0x156'),'onDelete':_0x3366('0xff')});db[_0x3366('0x72')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':'Users','through':_0x3366('0x185')});db[_0x3366('0x72')][_0x3366('0x111')](db[_0x3366('0x8b')],{'as':_0x3366('0x15b'),'through':_0x3366('0x186')});db['CmContact']['belongsToMany'](db[_0x3366('0x8b')],{'through':'cm_contact_has_tags','as':_0x3366('0x15c')});db[_0x3366('0x74')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':'Contact','foreignKey':_0x3366('0x14f'),'onDelete':_0x3366('0xff')});db[_0x3366('0x74')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x3366('0x156'),'onDelete':_0x3366('0xff')});db[_0x3366('0x74')][_0x3366('0x110')](db[_0x3366('0x13')],{'as':_0x3366('0x17c'),'foreignKey':_0x3366('0x100')});db[_0x3366('0x74')][_0x3366('0x110')](db[_0x3366('0x1c')],{'as':_0x3366('0x187'),'foreignKey':_0x3366('0x13b'),'onDelete':'cascade'});db[_0x3366('0x74')][_0x3366('0x110')](db[_0x3366('0xdc')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x3366('0xff')});db['CmHopper'][_0x3366('0x110')](db['User'],{'as':_0x3366('0x159'),'foreignKey':_0x3366('0x188')});db[_0x3366('0x76')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':'Contact','foreignKey':_0x3366('0x14f'),'onDelete':_0x3366('0xff')});db[_0x3366('0x76')]['belongsTo'](db['CmList'],{'as':_0x3366('0x155'),'foreignKey':'ListId','onDelete':_0x3366('0xff')});db[_0x3366('0x76')][_0x3366('0x110')](db[_0x3366('0x1c')],{'as':_0x3366('0x187'),'foreignKey':_0x3366('0x13b'),'onDelete':_0x3366('0xff')});db['CmHopperBlack'][_0x3366('0x110')](db[_0x3366('0xdc')],{'as':_0x3366('0xdc'),'foreignKey':_0x3366('0x189'),'onDelete':'cascade'});db[_0x3366('0x18a')][_0x3366('0x101')](db['Condition'],{'as':{'plural':_0x3366('0x18b'),'singular':'OneAll'},'foreignKey':_0x3366('0x18c'),'onDelete':_0x3366('0xff'),'hooks':!![]});db[_0x3366('0x18a')][_0x3366('0x101')](db[_0x3366('0x7f')],{'as':{'plural':'Any','singular':_0x3366('0x18d')},'foreignKey':_0x3366('0x18e'),'onDelete':_0x3366('0xff'),'hooks':!![]});db[_0x3366('0x18a')][_0x3366('0x101')](db['Action'],{'as':_0x3366('0x18f'),'foreignKey':_0x3366('0x190'),'onDelete':'cascade','hooks':!![]});db[_0x3366('0x81')][_0x3366('0x101')](db[_0x3366('0x81')],{'as':'Intervals','foreignKey':_0x3366('0x140'),'onDelete':_0x3366('0xff'),'hooks':!![],'required':![]});db[_0x3366('0x81')][_0x3366('0x101')](db[_0x3366('0x104')],{'as':_0x3366('0x105'),'foreignKey':_0x3366('0x140'),'onDelete':_0x3366('0x161')});db[_0x3366('0x81')]['hasMany'](db[_0x3366('0x44')],{'as':_0x3366('0x191'),'foreignKey':_0x3366('0x140')});db['Interval']['hasMany'](db['ChatApplication'],{'as':_0x3366('0x192'),'foreignKey':_0x3366('0x140')});db[_0x3366('0x81')][_0x3366('0x101')](db[_0x3366('0x4b')],{'as':_0x3366('0x193'),'foreignKey':_0x3366('0x140')});db[_0x3366('0x81')][_0x3366('0x101')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0x3366('0x140')});db['Schedule']['belongsTo'](db['MailAccount'],{});db[_0x3366('0x88')][_0x3366('0x110')](db[_0x3366('0x194')],{'foreignKey':_0x3366('0x195')});db['Schedule'][_0x3366('0x110')](db[_0x3366('0x95')],{'foreignKey':'CustomReportId'});db['Sound'][_0x3366('0x111')](db[_0x3366('0x1b')],{'as':_0x3366('0x196'),'through':_0x3366('0x139'),'onDelete':_0x3366('0x161')});db[_0x3366('0x8b')]['belongsToMany'](db[_0x3366('0x72')],{'through':_0x3366('0x186')});db[_0x3366('0x8b')][_0x3366('0x111')](db['ChatInteraction'],{'through':_0x3366('0x17f')});db[_0x3366('0x8b')][_0x3366('0x111')](db[_0x3366('0x40')],{'through':_0x3366('0x15a')});db[_0x3366('0x8b')][_0x3366('0x111')](db[_0x3366('0x55')],{'through':_0x3366('0x16e')});db[_0x3366('0x8b')]['belongsToMany'](db[_0x3366('0x4d')],{'through':_0x3366('0x16a')});db[_0x3366('0x8b')]['belongsToMany'](db[_0x3366('0x5c')],{'through':'openchannel_interaction_has_tags'});db[_0x3366('0x8b')]['belongsToMany'](db[_0x3366('0x10d')],{'through':_0x3366('0x197')});db[_0x3366('0x8f')][_0x3366('0x101')](db['Condition'],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0x3366('0x198'),'onDelete':_0x3366('0xff'),'hooks':!![]});db[_0x3366('0x8f')]['hasMany'](db[_0x3366('0x7f')],{'as':{'plural':_0x3366('0x199'),'singular':_0x3366('0x19a')},'foreignKey':'TriggerAnyId','onDelete':_0x3366('0xff'),'hooks':!![]});db['Trigger'][_0x3366('0x101')](db[_0x3366('0x7d')],{'as':'Actions','foreignKey':_0x3366('0x19b'),'onDelete':_0x3366('0xff'),'hooks':!![]});db[_0x3366('0x95')][_0x3366('0x101')](db['AnalyticFieldReport'],{'as':_0x3366('0x19c'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x3366('0x194')][_0x3366('0x101')](db['AnalyticFieldReport'],{'as':_0x3366('0x19c'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x195')});db[_0x3366('0x19d')][_0x3366('0x101')](db[_0x3366('0x9a')],{'as':_0x3366('0x19c'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x19e')});db[_0x3366('0x9a')][_0x3366('0x110')](db['AnalyticMetric'],{'foreignKey':_0x3366('0x19e')});db[_0x3366('0x9b')][_0x3366('0x101')](db['SalesforceConfiguration'],{'as':_0x3366('0x19f'),'onDelete':_0x3366('0xff'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x3366('0x101')](db[_0x3366('0x9d')],{'as':_0x3366('0x1a0'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a1')});db[_0x3366('0x1a2')]['hasMany'](db[_0x3366('0x9d')],{'as':_0x3366('0x1a3'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a4')});db[_0x3366('0x1a2')][_0x3366('0x101')](db['SalesforceField'],{'as':_0x3366('0x19c'),'onDelete':_0x3366('0xff'),'foreignKey':'FieldId'});db[_0x3366('0x1a2')]['belongsTo'](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x3366('0x1a5')});db[_0x3366('0x9d')][_0x3366('0x101')](db[_0x3366('0x9d')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x3366('0x9d')][_0x3366('0x101')](db[_0x3366('0x9d')],{'as':_0x3366('0x1a6'),'foreignKey':'DescriptionId'});db['SalesforceField']['hasMany'](db[_0x3366('0x9d')],{'as':_0x3366('0x1a7'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0x9d')][_0x3366('0x110')](db[_0x3366('0x90')],{'as':'Variable','foreignKey':_0x3366('0x1a9')});db[_0x3366('0x9f')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0x3366('0x19f'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a5')});db[_0x3366('0xa1')][_0x3366('0x101')](db[_0x3366('0xa3')],{'as':_0x3366('0x1a0'),'onDelete':'cascade','foreignKey':_0x3366('0x1a1')});db['SugarcrmConfiguration']['hasMany'](db[_0x3366('0xa3')],{'as':_0x3366('0x1a3'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a4')});db[_0x3366('0xa1')]['hasMany'](db[_0x3366('0xa3')],{'as':_0x3366('0x19c'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0xa1')]['belongsTo'](db[_0x3366('0x9f')],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x1a5')});db['SugarcrmField'][_0x3366('0x101')](db[_0x3366('0xa3')],{'as':'Subject','foreignKey':_0x3366('0x1a1')});db[_0x3366('0xa3')][_0x3366('0x101')](db[_0x3366('0xa3')],{'as':'Description','foreignKey':_0x3366('0x1a4')});db[_0x3366('0xa3')][_0x3366('0x101')](db[_0x3366('0xa3')],{'as':_0x3366('0x1a7'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0xa3')][_0x3366('0x110')](db[_0x3366('0x90')],{'as':_0x3366('0x90'),'foreignKey':_0x3366('0x1a9')});db['DeskAccount'][_0x3366('0x101')](db['DeskConfiguration'],{'as':_0x3366('0x19f'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a5')});db['DeskConfiguration'][_0x3366('0x101')](db[_0x3366('0xa7')],{'as':_0x3366('0x1a0'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a1')});db['DeskConfiguration'][_0x3366('0x101')](db[_0x3366('0xa7')],{'as':'Descriptions','onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a4')});db[_0x3366('0x1aa')][_0x3366('0x101')](db[_0x3366('0xa7')],{'as':_0x3366('0x19c'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0x1aa')][_0x3366('0x110')](db[_0x3366('0x1ab')],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x1a5')});db[_0x3366('0x1aa')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x1ac')});db[_0x3366('0xa7')][_0x3366('0x101')](db[_0x3366('0xa7')],{'as':'Subject','foreignKey':_0x3366('0x1a1')});db['DeskField'][_0x3366('0x101')](db['DeskField'],{'as':'Description','foreignKey':_0x3366('0x1a4')});db[_0x3366('0xa7')]['hasMany'](db[_0x3366('0xa7')],{'as':_0x3366('0x1a7'),'foreignKey':'FieldId'});db[_0x3366('0xa7')]['belongsTo'](db[_0x3366('0x90')],{'as':_0x3366('0x90'),'foreignKey':_0x3366('0x1a9')});db[_0x3366('0xa8')][_0x3366('0x101')](db[_0x3366('0xa9')],{'as':_0x3366('0x19f'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a5')});db['ZohoConfiguration'][_0x3366('0x101')](db['ZohoField'],{'as':'Subjects','onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a1')});db[_0x3366('0xa9')]['hasMany'](db[_0x3366('0x1ad')],{'as':_0x3366('0x1a3'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a4')});db[_0x3366('0xa9')][_0x3366('0x101')](db[_0x3366('0x1ad')],{'as':'Fields','onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0xa9')]['belongsTo'](db[_0x3366('0xa8')],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x1a5')});db[_0x3366('0x1ad')][_0x3366('0x101')](db['ZohoField'],{'as':_0x3366('0x1ae'),'foreignKey':_0x3366('0x1a1')});db[_0x3366('0x1ad')][_0x3366('0x101')](db['ZohoField'],{'as':_0x3366('0x1a6'),'foreignKey':'DescriptionId'});db[_0x3366('0x1ad')][_0x3366('0x101')](db[_0x3366('0x1ad')],{'as':'Field','foreignKey':_0x3366('0x1a8')});db[_0x3366('0x1ad')][_0x3366('0x110')](db[_0x3366('0x90')],{'as':_0x3366('0x90'),'foreignKey':_0x3366('0x1a9')});db[_0x3366('0xab')][_0x3366('0x101')](db[_0x3366('0xad')],{'as':_0x3366('0x19f'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a5')});db[_0x3366('0xad')]['hasMany'](db[_0x3366('0xae')],{'as':'Subjects','foreignKey':_0x3366('0x1a1')});db[_0x3366('0xad')][_0x3366('0x101')](db['ZendeskField'],{'as':_0x3366('0x1a3'),'foreignKey':_0x3366('0x1a4')});db[_0x3366('0xad')][_0x3366('0x101')](db[_0x3366('0xae')],{'as':_0x3366('0x19c'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0xad')]['belongsTo'](db[_0x3366('0xab')],{'as':_0x3366('0x160'),'foreignKey':'AccountId'});db[_0x3366('0xad')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x1af')});db[_0x3366('0xae')][_0x3366('0x101')](db[_0x3366('0xae')],{'as':'Subject','foreignKey':_0x3366('0x1a1')});db['ZendeskField'][_0x3366('0x101')](db[_0x3366('0xae')],{'as':_0x3366('0x1a6'),'foreignKey':_0x3366('0x1a4')});db['ZendeskField']['hasMany'](db[_0x3366('0xae')],{'as':_0x3366('0x1a7'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0xae')][_0x3366('0x110')](db['Variable'],{'as':_0x3366('0x90'),'foreignKey':_0x3366('0x1a9')});db[_0x3366('0xb0')][_0x3366('0x101')](db[_0x3366('0xb1')],{'as':'Configurations','onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a5')});db['FreshdeskConfiguration'][_0x3366('0x101')](db[_0x3366('0x1b0')],{'as':_0x3366('0x1a0'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x3366('0xb1')]['hasMany'](db[_0x3366('0x1b0')],{'as':_0x3366('0x1a3'),'onDelete':'cascade','foreignKey':_0x3366('0x1a4')});db[_0x3366('0xb1')][_0x3366('0x101')](db[_0x3366('0x1b0')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x3366('0x1a8')});db[_0x3366('0xb1')][_0x3366('0x110')](db[_0x3366('0xb0')],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x1a5')});db[_0x3366('0xb1')][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x3366('0x1b0')][_0x3366('0x101')](db[_0x3366('0x1b0')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x3366('0x1b0')][_0x3366('0x101')](db[_0x3366('0x1b0')],{'as':_0x3366('0x1a6'),'foreignKey':_0x3366('0x1a4')});db[_0x3366('0x1b0')]['hasMany'](db[_0x3366('0x1b0')],{'as':_0x3366('0x1a7'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0x1b0')][_0x3366('0x110')](db[_0x3366('0x90')],{'as':_0x3366('0x90'),'foreignKey':_0x3366('0x1a9')});db['VtigerAccount'][_0x3366('0x101')](db['VtigerConfiguration'],{'as':_0x3366('0x19f'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a5')});db[_0x3366('0xb4')][_0x3366('0x101')](db[_0x3366('0x1b1')],{'as':_0x3366('0x1a0'),'foreignKey':_0x3366('0x1a1')});db[_0x3366('0xb4')][_0x3366('0x101')](db[_0x3366('0x1b1')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0x3366('0x101')](db[_0x3366('0x1b1')],{'as':_0x3366('0x19c'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0xb4')][_0x3366('0x110')](db['VtigerAccount'],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x1a5')});db[_0x3366('0x1b1')]['hasMany'](db[_0x3366('0x1b1')],{'as':_0x3366('0x1ae'),'foreignKey':_0x3366('0x1a1')});db[_0x3366('0x1b1')]['hasMany'](db[_0x3366('0x1b1')],{'as':'Description','foreignKey':_0x3366('0x1a4')});db[_0x3366('0x1b1')][_0x3366('0x101')](db[_0x3366('0x1b1')],{'as':_0x3366('0x1a7'),'foreignKey':_0x3366('0x1a8')});db['VtigerField']['belongsTo'](db[_0x3366('0x90')],{'as':_0x3366('0x90'),'foreignKey':_0x3366('0x1a9')});db[_0x3366('0x1b2')][_0x3366('0x101')](db[_0x3366('0xb8')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x3366('0x1a5')});db[_0x3366('0xb8')][_0x3366('0x101')](db[_0x3366('0xb9')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x3366('0xb8')][_0x3366('0x101')](db[_0x3366('0xb9')],{'as':_0x3366('0x1a3'),'foreignKey':'DescriptionId'});db[_0x3366('0xb8')][_0x3366('0x101')](db[_0x3366('0xb9')],{'as':'Fields','foreignKey':_0x3366('0x1a8')});db[_0x3366('0xb8')]['belongsTo'](db['ServicenowAccount'],{'as':_0x3366('0x160'),'foreignKey':'AccountId'});db[_0x3366('0xb9')][_0x3366('0x101')](db['ServicenowField'],{'as':_0x3366('0x1ae'),'foreignKey':_0x3366('0x1a1')});db[_0x3366('0xb9')]['hasMany'](db['ServicenowField'],{'as':_0x3366('0x1a6'),'foreignKey':_0x3366('0x1a4')});db[_0x3366('0xb9')][_0x3366('0x101')](db[_0x3366('0xb9')],{'as':_0x3366('0x1a7'),'foreignKey':_0x3366('0x1a8')});db['ServicenowField'][_0x3366('0x110')](db[_0x3366('0x90')],{'as':'Variable','foreignKey':_0x3366('0x1a9')});db[_0x3366('0xbb')][_0x3366('0x101')](db[_0x3366('0x1b3')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x3366('0x1a5')});db['Dynamics365Configuration'][_0x3366('0x101')](db[_0x3366('0xbd')],{'as':_0x3366('0x1a0'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a1')});db[_0x3366('0x1b3')][_0x3366('0x101')](db[_0x3366('0xbd')],{'as':_0x3366('0x1a3'),'onDelete':'cascade','foreignKey':_0x3366('0x1a4')});db[_0x3366('0x1b3')][_0x3366('0x101')](db[_0x3366('0xbd')],{'as':_0x3366('0x19c'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a8')});db['Dynamics365Configuration'][_0x3366('0x110')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x3366('0x1a5')});db[_0x3366('0xbd')][_0x3366('0x101')](db[_0x3366('0xbd')],{'as':'Subject','foreignKey':_0x3366('0x1a1')});db[_0x3366('0xbd')][_0x3366('0x101')](db[_0x3366('0xbd')],{'as':'Description','foreignKey':_0x3366('0x1a4')});db[_0x3366('0xbd')][_0x3366('0x101')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x3366('0x1a8')});db['Dynamics365Field'][_0x3366('0x110')](db[_0x3366('0x90')],{'as':'Variable','foreignKey':_0x3366('0x1a9')});db['FreshsalesAccount'][_0x3366('0x101')](db[_0x3366('0xc1')],{'as':_0x3366('0x19f'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1a5')});db[_0x3366('0xc1')][_0x3366('0x101')](db[_0x3366('0x1b4')],{'as':_0x3366('0x1a0'),'foreignKey':'SubjectId'});db[_0x3366('0xc1')][_0x3366('0x101')](db[_0x3366('0x1b4')],{'as':'Descriptions','foreignKey':_0x3366('0x1a4')});db['FreshsalesConfiguration'][_0x3366('0x101')](db[_0x3366('0x1b4')],{'as':'Fields','foreignKey':'FieldId'});db[_0x3366('0xc1')][_0x3366('0x110')](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0x3366('0x1a5')});db[_0x3366('0x1b4')][_0x3366('0x101')](db[_0x3366('0x1b4')],{'as':_0x3366('0x1ae'),'foreignKey':'SubjectId'});db[_0x3366('0x1b4')][_0x3366('0x101')](db[_0x3366('0x1b4')],{'as':_0x3366('0x1a6'),'foreignKey':_0x3366('0x1a4')});db['FreshsalesField'][_0x3366('0x101')](db[_0x3366('0x1b4')],{'as':_0x3366('0x1a7'),'foreignKey':_0x3366('0x1a8')});db[_0x3366('0x1b4')][_0x3366('0x110')](db[_0x3366('0x90')],{'as':'Variable','foreignKey':_0x3366('0x1a9')});db[_0x3366('0xc4')][_0x3366('0x110')](db[_0x3366('0x62')],{});db[_0x3366('0xc4')][_0x3366('0x110')](db[_0x3366('0xea')],{'as':_0x3366('0x155'),'foreignKey':'ListId'});db['ChatQueueReport']['belongsTo'](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0xc4')][_0x3366('0x110')](db[_0x3366('0x66')],{});db[_0x3366('0xc4')][_0x3366('0x110')](db[_0x3366('0x68')],{});db[_0x3366('0xc4')][_0x3366('0x110')](db[_0x3366('0x13')],{});db[_0x3366('0xc4')][_0x3366('0x110')](db['ChatQueue'],{});db[_0x3366('0xc6')][_0x3366('0x110')](db['User'],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x3366('0xc6')][_0x3366('0x110')](db[_0x3366('0x13')],{'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1b5')});db['JscriptySessionReport'][_0x3366('0x101')](db[_0x3366('0xca')],{'foreignKey':_0x3366('0x1b6'),'onDelete':_0x3366('0xff')});db[_0x3366('0xcb')][_0x3366('0x101')](db[_0x3366('0xc8')],{'foreignKey':_0x3366('0x1b6'),'onDelete':'cascade'});db['SmsQueueReport'][_0x3366('0x110')](db['SmsAccount'],{});db[_0x3366('0xcd')]['belongsTo'](db['CmList'],{'as':_0x3366('0x155'),'foreignKey':'ListId'});db['SmsQueueReport'][_0x3366('0x110')](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0xcd')][_0x3366('0x110')](db[_0x3366('0x55')],{});db[_0x3366('0xcd')]['belongsTo'](db[_0x3366('0x57')],{});db[_0x3366('0xcd')][_0x3366('0x110')](db[_0x3366('0x13')],{});db[_0x3366('0xcd')][_0x3366('0x110')](db['SmsQueue'],{});db['JscriptyProject'][_0x3366('0x101')](db[_0x3366('0xcb')],{'foreignKey':_0x3366('0x1b7')});db['JscriptyProject'][_0x3366('0x101')](db[_0x3366('0xca')],{'foreignKey':_0x3366('0x1b7')});db['JscriptyProject'][_0x3366('0x101')](db[_0x3366('0xc8')],{'foreignKey':'ProjectId'});db[_0x3366('0x134')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x15d'),'through':_0x3366('0x136')});db[_0x3366('0xdb')]['belongsToMany'](db[_0x3366('0x13')],{'as':_0x3366('0x143'),'through':'user_has_teams'});db['Team'][_0x3366('0x111')](db[_0x3366('0x1c')],{'through':_0x3366('0x145'),'as':_0x3366('0x1b8')});db[_0x3366('0xdb')][_0x3366('0x111')](db[_0x3366('0x3e')],{'through':_0x3366('0x1b9'),'as':'MailQueues'});db[_0x3366('0xdb')][_0x3366('0x111')](db[_0x3366('0x6c')],{'through':_0x3366('0x181'),'as':_0x3366('0x11e')});db['Team'][_0x3366('0x111')](db[_0x3366('0x168')],{'through':_0x3366('0x1ba'),'as':'FaxQueues'});db[_0x3366('0xdb')][_0x3366('0x111')](db[_0x3366('0x59')],{'through':_0x3366('0x16f'),'as':_0x3366('0x121')});db['Team']['belongsToMany'](db[_0x3366('0x60')],{'through':'team_has_openchannel_queues','as':_0x3366('0x123')});db[_0x3366('0xdb')][_0x3366('0x111')](db[_0x3366('0xfc')],{'through':_0x3366('0x1bb'),'as':'WhatsappQueues'});db[_0x3366('0xdc')][_0x3366('0x101')](db[_0x3366('0x74')],{'as':_0x3366('0x184'),'foreignKey':_0x3366('0x189')});db['Campaign'][_0x3366('0x101')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x3366('0x189')});db[_0x3366('0xdc')][_0x3366('0x101')](db[_0x3366('0x79')],{'as':'HopperHistories','foreignKey':_0x3366('0x189')});db['Campaign'][_0x3366('0x101')](db['CmHopperBlack'],{'as':_0x3366('0x13c'),'foreignKey':'CampaignId'});db[_0x3366('0xdc')][_0x3366('0x110')](db['Trunk'],{'as':_0x3366('0x2c'),'foreignKey':_0x3366('0x13d')});db[_0x3366('0xdc')]['belongsTo'](db[_0x3366('0x2c')],{'as':_0x3366('0x13e'),'foreignKey':_0x3366('0x13f')});db['Campaign'][_0x3366('0x110')](db[_0x3366('0x81')],{'as':_0x3366('0x81'),'foreignKey':_0x3366('0x140')});db['Campaign'][_0x3366('0x110')](db[_0x3366('0x134')],{'as':_0x3366('0x134'),'foreignKey':_0x3366('0x1bc')});db['Campaign'][_0x3366('0x111')](db[_0x3366('0xea')],{'as':_0x3366('0x115'),'through':_0x3366('0x1bd')});db[_0x3366('0xdc')][_0x3366('0x111')](db[_0x3366('0xea')],{'as':_0x3366('0x1be'),'through':'campaigns_has_cm_blacklists'});db[_0x3366('0xe3')][_0x3366('0x110')](db['MailMessage'],{});db['MailTransferReport'][_0x3366('0x110')](db[_0x3366('0x40')],{});db[_0x3366('0xe3')][_0x3366('0x110')](db['MailAccount'],{'foreignKey':_0x3366('0x1bf'),'as':_0x3366('0x1c0')});db[_0x3366('0xe3')][_0x3366('0x110')](db['User'],{'foreignKey':'FromUserId','as':_0x3366('0x1c1')});db[_0x3366('0xe3')]['belongsTo'](db[_0x3366('0x13')],{'foreignKey':_0x3366('0x1c2'),'as':'ToAgent'});db[_0x3366('0xe3')]['belongsTo'](db[_0x3366('0x3e')],{'foreignKey':_0x3366('0x1c3'),'as':_0x3366('0x1c4')});db[_0x3366('0xe3')][_0x3366('0x110')](db[_0x3366('0x150')],{'foreignKey':_0x3366('0x1c5'),'as':_0x3366('0x1c6')});db[_0x3366('0xe5')]['belongsTo'](db[_0x3366('0x68')],{});db[_0x3366('0xe5')][_0x3366('0x110')](db[_0x3366('0x66')],{});db[_0x3366('0xe5')][_0x3366('0x110')](db['ChatWebsite'],{'foreignKey':_0x3366('0x1c7'),'as':_0x3366('0x1c0')});db[_0x3366('0xe5')][_0x3366('0x110')](db[_0x3366('0x13')],{'foreignKey':'FromUserId','as':_0x3366('0x1c1')});db[_0x3366('0xe5')]['belongsTo'](db[_0x3366('0x13')],{'foreignKey':'ToUserId','as':_0x3366('0x1c8')});db[_0x3366('0xe5')]['belongsTo'](db[_0x3366('0x6c')],{'foreignKey':_0x3366('0x1c9'),'as':_0x3366('0x1c4')});db[_0x3366('0xe5')]['belongsTo'](db[_0x3366('0x62')],{'foreignKey':_0x3366('0x1ca'),'as':_0x3366('0x1c6')});db[_0x3366('0xe7')][_0x3366('0x110')](db[_0x3366('0x4f')],{});db['FaxTransferReport'][_0x3366('0x110')](db[_0x3366('0x4d')],{});db[_0x3366('0xe7')][_0x3366('0x110')](db[_0x3366('0x49')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0x3366('0xe7')]['belongsTo'](db[_0x3366('0x13')],{'foreignKey':_0x3366('0x1cb'),'as':'FromAgent'});db[_0x3366('0xe7')][_0x3366('0x110')](db['User'],{'foreignKey':_0x3366('0x1c2'),'as':_0x3366('0x1c8')});db[_0x3366('0xe7')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x3366('0x1cc'),'as':_0x3366('0x1c4')});db[_0x3366('0xe7')][_0x3366('0x110')](db[_0x3366('0x49')],{'foreignKey':_0x3366('0x1cd'),'as':_0x3366('0x1c6')});db[_0x3366('0x1ce')][_0x3366('0x110')](db[_0x3366('0x5e')],{});db['OpenchannelTransferReport'][_0x3366('0x110')](db[_0x3366('0x5c')],{});db[_0x3366('0x1ce')][_0x3366('0x110')](db[_0x3366('0x12d')],{'foreignKey':_0x3366('0x1cf'),'as':_0x3366('0x1c0')});db['OpenchannelTransferReport'][_0x3366('0x110')](db[_0x3366('0x13')],{'foreignKey':'FromUserId','as':_0x3366('0x1c1')});db[_0x3366('0x1ce')]['belongsTo'](db[_0x3366('0x13')],{'foreignKey':'ToUserId','as':_0x3366('0x1c8')});db[_0x3366('0x1ce')][_0x3366('0x110')](db[_0x3366('0x60')],{'foreignKey':_0x3366('0x1d0'),'as':_0x3366('0x1c4')});db[_0x3366('0x1ce')][_0x3366('0x110')](db['OpenchannelAccount'],{'foreignKey':_0x3366('0x1d1'),'as':_0x3366('0x1c6')});db[_0x3366('0x1d2')][_0x3366('0x110')](db['SmsMessage'],{});db[_0x3366('0x1d2')]['belongsTo'](db[_0x3366('0x55')],{});db[_0x3366('0x1d2')][_0x3366('0x110')](db[_0x3366('0x53')],{'foreignKey':_0x3366('0x1d3'),'as':'FromAccount'});db[_0x3366('0x1d2')][_0x3366('0x110')](db[_0x3366('0x13')],{'foreignKey':_0x3366('0x1cb'),'as':_0x3366('0x1c1')});db[_0x3366('0x1d2')][_0x3366('0x110')](db[_0x3366('0x13')],{'foreignKey':'ToUserId','as':_0x3366('0x1c8')});db[_0x3366('0x1d2')][_0x3366('0x110')](db[_0x3366('0x59')],{'foreignKey':_0x3366('0x1d4'),'as':_0x3366('0x1c4')});db[_0x3366('0x1d2')][_0x3366('0x110')](db[_0x3366('0x53')],{'foreignKey':_0x3366('0x1d5'),'as':'ToAccount'});db['CmList'][_0x3366('0x101')](db[_0x3366('0x152')],{'as':_0x3366('0x165'),'foreignKey':_0x3366('0x156')});db['CmList']['hasMany'](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0x3366('0x156')});db[_0x3366('0xea')][_0x3366('0x101')](db[_0x3366('0x72')],{'as':_0x3366('0x114'),'onDelete':'cascade','foreignKey':'ListId'});db[_0x3366('0xea')][_0x3366('0x101')](db[_0x3366('0x78')],{'as':_0x3366('0x106'),'foreignKey':'ListId'});db[_0x3366('0xea')][_0x3366('0x101')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x3366('0x156')});db[_0x3366('0xea')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x3366('0x156')});db['CmList']['belongsToMany'](db[_0x3366('0x1c')],{'as':_0x3366('0x1d6'),'through':_0x3366('0x142')});db['CmList'][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x143'),'through':_0x3366('0x116')});db[_0x3366('0xec')][_0x3366('0x101')](db[_0x3366('0x104')],{'as':'Extensions','onDelete':_0x3366('0xff')});db[_0x3366('0xec')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x143'),'through':_0x3366('0x126')});db['UserProfile'][_0x3366('0x101')](db['User'],{'as':_0x3366('0x15d'),'foreignKey':_0x3366('0x1d7')});db[_0x3366('0xee')][_0x3366('0x101')](db[_0x3366('0x1d8')],{'as':_0x3366('0x1d9'),'foreignKey':_0x3366('0x1d7'),'onDelete':_0x3366('0xff')});db[_0x3366('0x1d8')][_0x3366('0x101')](db[_0x3366('0xf1')],{'as':'Resources','foreignKey':_0x3366('0x1da'),'onDelete':'cascade'});db[_0x3366('0xf3')]['hasMany'](db[_0x3366('0x152')],{'as':_0x3366('0x165'),'foreignKey':_0x3366('0x1db')});db['WhatsappAccount'][_0x3366('0x101')](db['CannedAnswer'],{'as':_0x3366('0x153'),'foreignKey':_0x3366('0x1db')});db[_0x3366('0xf3')]['hasMany'](db[_0x3366('0x1dc')],{'as':'Messages','foreignKey':_0x3366('0x1db')});db[_0x3366('0xf3')][_0x3366('0x101')](db[_0x3366('0x10d')],{'as':_0x3366('0x154')});db[_0x3366('0xf3')][_0x3366('0x101')](db[_0x3366('0xf5')],{'as':'Applications'});db['WhatsappAccount'][_0x3366('0x110')](db['CmList'],{'as':_0x3366('0x155'),'foreignKey':'ListId'});db[_0x3366('0xf3')][_0x3366('0x110')](db[_0x3366('0x83')],{'as':_0x3366('0x141'),'foreignKey':_0x3366('0x157')});db[_0x3366('0xf3')][_0x3366('0x111')](db['User'],{'as':_0x3366('0x143'),'through':'user_has_whatsapp_accounts'});db[_0x3366('0xf5')]['belongsTo'](db[_0x3366('0x13')],{'onDelete':_0x3366('0x161')});db[_0x3366('0xf5')][_0x3366('0x110')](db[_0x3366('0xfc')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x3366('0x110')](db[_0x3366('0xf3')],{'onDelete':'restrict'});db[_0x3366('0xf5')][_0x3366('0x110')](db[_0x3366('0x81')],{'onDelete':_0x3366('0x161'),'foreignKey':_0x3366('0x140')});db[_0x3366('0xf5')]['belongsTo'](db[_0x3366('0x8b')],{'onDelete':_0x3366('0x161'),'foreignKey':_0x3366('0x162')});db[_0x3366('0x10d')][_0x3366('0x101')](db['WhatsappMessage'],{'as':_0x3366('0x147'),'onDelete':_0x3366('0xff'),'foreignKey':_0x3366('0x1dd')});db[_0x3366('0x10d')][_0x3366('0x110')](db[_0x3366('0xf3')],{'as':_0x3366('0x160'),'foreignKey':_0x3366('0x1db')});db[_0x3366('0x10d')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':'ContactId'});db[_0x3366('0x10d')]['belongsTo'](db[_0x3366('0x13')],{'as':'Owner','foreignKey':'UserId'});db['WhatsappInteraction'][_0x3366('0x111')](db['Tag'],{'through':_0x3366('0x197'),'as':'Tags'});db['WhatsappInteraction'][_0x3366('0x111')](db[_0x3366('0x8b')],{'through':_0x3366('0x197'),'as':'ThroughTags'});db['WhatsappInteraction'][_0x3366('0x111')](db[_0x3366('0x13')],{'as':_0x3366('0x15d'),'through':_0x3366('0x11b'),'foreignKey':_0x3366('0x1dd')});db[_0x3366('0x1dc')][_0x3366('0x110')](db[_0x3366('0x13')],{'as':_0x3366('0x13')});db[_0x3366('0x1dc')][_0x3366('0x110')](db[_0x3366('0x72')],{'onDelete':_0x3366('0xff'),'as':_0x3366('0x14e')});db[_0x3366('0x1dc')][_0x3366('0x110')](db[_0x3366('0x10d')],{'onDelete':_0x3366('0xff'),'as':'Interaction','foreignKey':_0x3366('0x1dd')});db['WhatsappMessage'][_0x3366('0x110')](db[_0x3366('0xf3')],{'as':'Account','foreignKey':_0x3366('0x1db')});db[_0x3366('0xf8')][_0x3366('0x110')](db[_0x3366('0xf3')],{});db[_0x3366('0xf8')][_0x3366('0x110')](db[_0x3366('0xea')],{'as':_0x3366('0x155'),'foreignKey':_0x3366('0x156')});db[_0x3366('0xf8')][_0x3366('0x110')](db[_0x3366('0x72')],{'as':_0x3366('0x14e'),'foreignKey':_0x3366('0x14f')});db[_0x3366('0xf8')][_0x3366('0x110')](db[_0x3366('0x10d')],{});db[_0x3366('0xf8')][_0x3366('0x110')](db[_0x3366('0xfc')],{});db[_0x3366('0xf8')][_0x3366('0x110')](db[_0x3366('0x1dc')],{});db['WhatsappQueueReport'][_0x3366('0x110')](db[_0x3366('0x13')],{});db['WhatsappTransferReport'][_0x3366('0x110')](db['WhatsappMessage'],{});db['WhatsappTransferReport'][_0x3366('0x110')](db[_0x3366('0x10d')],{});db[_0x3366('0xfa')][_0x3366('0x110')](db[_0x3366('0xf3')],{'foreignKey':_0x3366('0x1de'),'as':'FromAccount'});db['WhatsappTransferReport']['belongsTo'](db[_0x3366('0xf3')],{'foreignKey':_0x3366('0x1df'),'as':_0x3366('0x1c6')});db['WhatsappTransferReport'][_0x3366('0x110')](db['WhatsappQueue'],{'foreignKey':_0x3366('0x1e0'),'as':'ToQueue'});db['WhatsappTransferReport'][_0x3366('0x110')](db['User'],{'foreignKey':_0x3366('0x1cb'),'as':'FromAgent'});db['WhatsappTransferReport'][_0x3366('0x110')](db['User'],{'foreignKey':_0x3366('0x1c2'),'as':_0x3366('0x1c8')});db[_0x3366('0xfc')][_0x3366('0x111')](db[_0x3366('0x13')],{'as':'Agents','through':_0x3366('0x37'),'foreignKey':_0x3366('0x1e1')});db[_0x3366('0xfc')][_0x3366('0x111')](db[_0x3366('0xdb')],{'through':_0x3366('0x1bb'),'as':_0x3366('0x144')});module[_0x3366('0x1e2')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 34862e5..855fd06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1346=['/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/notifications','./api/notification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','root','/demo','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','name','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/screen/recordings','./api/screenRecording','./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/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsApplication','/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/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound'];(function(_0x19ad93,_0x5554c0){var _0x344747=function(_0x4c9872){while(--_0x4c9872){_0x19ad93['push'](_0x19ad93['shift']());}};_0x344747(++_0x5554c0);}(_0x1346,0x1ab));var _0x6134=function(_0x18e6e5,_0x2f6c83){_0x18e6e5=_0x18e6e5-0x0;var _0x4ca27d=_0x1346[_0x18e6e5];return _0x4ca27d;};'use strict';var path=require(_0x6134('0x0'));var express=require(_0x6134('0x1'));var ewinston=require(_0x6134('0x2'));var util=require(_0x6134('0x3'));var errors=require(_0x6134('0x4'));var config=require(_0x6134('0x5'));var logger=require(_0x6134('0x6'))(_0x6134('0x7'));var authLogger=require(_0x6134('0x6'))(_0x6134('0x8'));exports['default']=function(_0x925cd4){_0x925cd4['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2ac074,_0x36d096){return util[_0x6134('0x9')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x2ac074['method'],_0x2ac074[_0x6134('0xa')][_0x6134('0xb')]?_0x2ac074[_0x6134('0xa')][_0x6134('0xb')]:_0x2ac074[_0x6134('0xc')][_0x6134('0xd')]||_0x2ac074['ip'],_0x2ac074[_0x6134('0xe')],_0x36d096[_0x6134('0xf')],_0x36d096[_0x6134('0x10')],_0x2ac074[_0x6134('0x11')]?_0x2ac074[_0x6134('0x11')]['id']:null,_0x2ac074[_0x6134('0x11')]?_0x2ac074[_0x6134('0x11')]['name']:null,_0x2ac074[_0x6134('0x11')]?_0x2ac074[_0x6134('0x11')][_0x6134('0x12')]:null);}}));_0x925cd4[_0x6134('0x13')](ewinston[_0x6134('0x14')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x598dee,_0x222a5a){var _0x46bf9c=_0x6134('0x15');if(_0x598dee['body']&&_0x598dee[_0x6134('0x16')][_0x6134('0x17')]&&_0x598dee[_0x6134('0x16')]['agent_id']){_0x46bf9c=_0x6134('0x18');}return util[_0x6134('0x9')](_0x46bf9c,_0x598dee[_0x6134('0x19')],_0x598dee['headers'][_0x6134('0xb')]?_0x598dee[_0x6134('0xa')][_0x6134('0xb')]:_0x598dee[_0x6134('0xc')]['remoteAddress']||_0x598dee['ip'],_0x598dee['url'],_0x222a5a['statusCode'],_0x222a5a[_0x6134('0x10')],_0x598dee[_0x6134('0x11')]?_0x598dee[_0x6134('0x11')]['id']:null,_0x598dee['user']?_0x598dee[_0x6134('0x11')][_0x6134('0x1a')]:null,_0x598dee[_0x6134('0x11')]?_0x598dee['user'][_0x6134('0x12')]:null,_0x598dee[_0x6134('0x16')]&&_0x598dee[_0x6134('0x16')][_0x6134('0x17')]?_0x598dee['body'][_0x6134('0x17')]:_0x6134('0x1b'),_0x598dee['body']&&_0x598dee[_0x6134('0x16')]['agent_id']?_0x598dee[_0x6134('0x16')]['agent_id']:'',_0x598dee[_0x6134('0x16')]&&_0x598dee['body'][_0x6134('0x1c')]?_0x598dee[_0x6134('0x16')]['agent_name']:'');},'ignoreRoute':function(_0x31d00f){var _0x2e885a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2e885a[_0x6134('0x1d')](_0x31d00f[_0x6134('0xe')]);}}));_0x925cd4['use'](_0x6134('0x1e'),require(_0x6134('0x1f')));_0x925cd4[_0x6134('0x13')](_0x6134('0x20'),require(_0x6134('0x21')));_0x925cd4['use'](_0x6134('0x22'),require(_0x6134('0x23')));_0x925cd4[_0x6134('0x13')](_0x6134('0x24'),require(_0x6134('0x25')));_0x925cd4[_0x6134('0x13')](_0x6134('0x26'),require(_0x6134('0x27')));_0x925cd4[_0x6134('0x13')]('/api/voice/queues',require('./api/voiceQueue'));_0x925cd4[_0x6134('0x13')]('/api/voice/recordings',require('./api/voiceRecording'));_0x925cd4['use'](_0x6134('0x28'),require(_0x6134('0x29')));_0x925cd4[_0x6134('0x13')]('/api/voice/mails',require(_0x6134('0x2a')));_0x925cd4[_0x6134('0x13')](_0x6134('0x2b'),require(_0x6134('0x2c')));_0x925cd4['use'](_0x6134('0x2d'),require(_0x6134('0x2e')));_0x925cd4[_0x6134('0x13')](_0x6134('0x2f'),require(_0x6134('0x30')));_0x925cd4[_0x6134('0x13')](_0x6134('0x31'),require('./api/voiceAgentReport'));_0x925cd4[_0x6134('0x13')](_0x6134('0x32'),require(_0x6134('0x33')));_0x925cd4[_0x6134('0x13')](_0x6134('0x34'),require('./api/memberReport'));_0x925cd4[_0x6134('0x13')](_0x6134('0x35'),require(_0x6134('0x36')));_0x925cd4[_0x6134('0x13')]('/api/voice/transfers/reports',require(_0x6134('0x37')));_0x925cd4[_0x6134('0x13')](_0x6134('0x38'),require(_0x6134('0x39')));_0x925cd4[_0x6134('0x13')](_0x6134('0x3a'),require(_0x6134('0x3b')));_0x925cd4['use'](_0x6134('0x3c'),require(_0x6134('0x3d')));_0x925cd4['use'](_0x6134('0x3e'),require(_0x6134('0x3f')));_0x925cd4[_0x6134('0x13')](_0x6134('0x40'),require(_0x6134('0x41')));_0x925cd4[_0x6134('0x13')](_0x6134('0x42'),require('./api/mailMessage'));_0x925cd4[_0x6134('0x13')](_0x6134('0x43'),require(_0x6134('0x44')));_0x925cd4[_0x6134('0x13')](_0x6134('0x45'),require('./api/mailQueueReport'));_0x925cd4[_0x6134('0x13')](_0x6134('0x46'),require('./api/dashboard'));_0x925cd4[_0x6134('0x13')](_0x6134('0x47'),require('./api/dashboardItem'));_0x925cd4[_0x6134('0x13')]('/api/fax/accounts',require(_0x6134('0x48')));_0x925cd4[_0x6134('0x13')](_0x6134('0x49'),require(_0x6134('0x4a')));_0x925cd4[_0x6134('0x13')](_0x6134('0x4b'),require(_0x6134('0x4c')));_0x925cd4['use']('/api/fax/messages',require(_0x6134('0x4d')));_0x925cd4[_0x6134('0x13')](_0x6134('0x4e'),require(_0x6134('0x4f')));_0x925cd4[_0x6134('0x13')](_0x6134('0x50'),require(_0x6134('0x51')));_0x925cd4['use'](_0x6134('0x52'),require('./api/smsAccount'));_0x925cd4[_0x6134('0x13')]('/api/sms/applications',require(_0x6134('0x53')));_0x925cd4[_0x6134('0x13')](_0x6134('0x54'),require(_0x6134('0x55')));_0x925cd4['use'](_0x6134('0x56'),require('./api/smsMessage'));_0x925cd4['use'](_0x6134('0x57'),require(_0x6134('0x58')));_0x925cd4['use']('/api/openchannel/accounts',require(_0x6134('0x59')));_0x925cd4['use']('/api/openchannel/applications',require(_0x6134('0x5a')));_0x925cd4[_0x6134('0x13')](_0x6134('0x5b'),require('./api/openchannelInteraction'));_0x925cd4[_0x6134('0x13')]('/api/openchannel/messages',require(_0x6134('0x5c')));_0x925cd4[_0x6134('0x13')](_0x6134('0x5d'),require('./api/openchannelQueue'));_0x925cd4[_0x6134('0x13')]('/api/chat/websites',require(_0x6134('0x5e')));_0x925cd4[_0x6134('0x13')](_0x6134('0x5f'),require(_0x6134('0x60')));_0x925cd4[_0x6134('0x13')](_0x6134('0x61'),require(_0x6134('0x62')));_0x925cd4[_0x6134('0x13')]('/api/chat/interactions',require(_0x6134('0x63')));_0x925cd4[_0x6134('0x13')]('/api/chat/messages',require('./api/chatMessage'));_0x925cd4['use'](_0x6134('0x64'),require(_0x6134('0x65')));_0x925cd4[_0x6134('0x13')]('/api/chat/queues',require('./api/chatQueue'));_0x925cd4[_0x6134('0x13')](_0x6134('0x66'),require(_0x6134('0x67')));_0x925cd4[_0x6134('0x13')](_0x6134('0x68'),require(_0x6134('0x69')));_0x925cd4[_0x6134('0x13')](_0x6134('0x6a'),require(_0x6134('0x6b')));_0x925cd4[_0x6134('0x13')](_0x6134('0x6c'),require(_0x6134('0x6d')));_0x925cd4[_0x6134('0x13')](_0x6134('0x6e'),require(_0x6134('0x6f')));_0x925cd4[_0x6134('0x13')]('/api/cm/hopper_black',require(_0x6134('0x70')));_0x925cd4[_0x6134('0x13')](_0x6134('0x71'),require(_0x6134('0x72')));_0x925cd4[_0x6134('0x13')](_0x6134('0x73'),require(_0x6134('0x74')));_0x925cd4[_0x6134('0x13')](_0x6134('0x75'),require(_0x6134('0x76')));_0x925cd4[_0x6134('0x13')](_0x6134('0x77'),require(_0x6134('0x78')));_0x925cd4['use'](_0x6134('0x79'),require(_0x6134('0x7a')));_0x925cd4['use'](_0x6134('0x7b'),require(_0x6134('0x7c')));_0x925cd4[_0x6134('0x13')]('/api/dispositions',require(_0x6134('0x7d')));_0x925cd4[_0x6134('0x13')](_0x6134('0x7e'),require(_0x6134('0x7f')));_0x925cd4[_0x6134('0x13')](_0x6134('0x80'),require('./api/interval'));_0x925cd4['use'](_0x6134('0x81'),require(_0x6134('0x82')));_0x925cd4['use'](_0x6134('0x83'),require('./api/cdr'));_0x925cd4[_0x6134('0x13')]('/api/voiceQueuesLog',require(_0x6134('0x84')));_0x925cd4['use'](_0x6134('0x85'),require(_0x6134('0x86')));_0x925cd4[_0x6134('0x13')](_0x6134('0x87'),require(_0x6134('0x88')));_0x925cd4['use'](_0x6134('0x89'),require(_0x6134('0x8a')));_0x925cd4[_0x6134('0x13')]('/api/templates',require(_0x6134('0x8b')));_0x925cd4[_0x6134('0x13')](_0x6134('0x8c'),require(_0x6134('0x8d')));_0x925cd4[_0x6134('0x13')](_0x6134('0x8e'),require(_0x6134('0x8f')));_0x925cd4[_0x6134('0x13')](_0x6134('0x90'),require('./api/integration'));_0x925cd4[_0x6134('0x13')](_0x6134('0x91'),require(_0x6134('0x92')));_0x925cd4[_0x6134('0x13')](_0x6134('0x93'),require(_0x6134('0x94')));_0x925cd4['use']('/api/analytics/default_reports',require(_0x6134('0x95')));_0x925cd4['use']('/api/analytics/extracted_reports',require(_0x6134('0x96')));_0x925cd4[_0x6134('0x13')](_0x6134('0x97'),require(_0x6134('0x98')));_0x925cd4[_0x6134('0x13')](_0x6134('0x99'),require('./api/analyticFieldReport'));_0x925cd4['use'](_0x6134('0x9a'),require(_0x6134('0x9b')));_0x925cd4[_0x6134('0x13')](_0x6134('0x9c'),require(_0x6134('0x9d')));_0x925cd4[_0x6134('0x13')](_0x6134('0x9e'),require('./api/intSalesforceConfiguration'));_0x925cd4[_0x6134('0x13')](_0x6134('0x9f'),require('./api/intSalesforceField'));_0x925cd4['use'](_0x6134('0xa0'),require('./api/intSugarcrmAccount'));_0x925cd4[_0x6134('0x13')](_0x6134('0xa1'),require(_0x6134('0xa2')));_0x925cd4['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x925cd4[_0x6134('0x13')](_0x6134('0xa3'),require(_0x6134('0xa4')));_0x925cd4[_0x6134('0x13')](_0x6134('0xa5'),require('./api/intDeskConfiguration'));_0x925cd4['use']('/api/integrations/desk/fields',require('./api/intDeskField'));_0x925cd4[_0x6134('0x13')](_0x6134('0xa6'),require('./api/intZohoAccount'));_0x925cd4['use'](_0x6134('0xa7'),require(_0x6134('0xa8')));_0x925cd4[_0x6134('0x13')]('/api/integrations/zoho/fields',require(_0x6134('0xa9')));_0x925cd4[_0x6134('0x13')](_0x6134('0xaa'),require(_0x6134('0xab')));_0x925cd4[_0x6134('0x13')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x925cd4['use']('/api/integrations/zendesk/fields',require(_0x6134('0xac')));_0x925cd4[_0x6134('0x13')](_0x6134('0xad'),require('./api/intFreshdeskAccount'));_0x925cd4['use'](_0x6134('0xae'),require(_0x6134('0xaf')));_0x925cd4[_0x6134('0x13')](_0x6134('0xb0'),require('./api/intFreshdeskField'));_0x925cd4['use']('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x925cd4[_0x6134('0x13')](_0x6134('0xb1'),require('./api/intVtigerConfiguration'));_0x925cd4[_0x6134('0x13')](_0x6134('0xb2'),require(_0x6134('0xb3')));_0x925cd4[_0x6134('0x13')]('/api/integrations/servicenow/accounts',require(_0x6134('0xb4')));_0x925cd4[_0x6134('0x13')](_0x6134('0xb5'),require(_0x6134('0xb6')));_0x925cd4[_0x6134('0x13')](_0x6134('0xb7'),require(_0x6134('0xb8')));_0x925cd4[_0x6134('0x13')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x925cd4[_0x6134('0x13')](_0x6134('0xb9'),require(_0x6134('0xba')));_0x925cd4['use']('/api/integrations/dynamics365/fields',require(_0x6134('0xbb')));_0x925cd4[_0x6134('0x13')](_0x6134('0xbc'),require(_0x6134('0xbd')));_0x925cd4['use'](_0x6134('0xbe'),require(_0x6134('0xbf')));_0x925cd4[_0x6134('0x13')](_0x6134('0xc0'),require(_0x6134('0xc1')));_0x925cd4[_0x6134('0x13')](_0x6134('0xc2'),require(_0x6134('0xc3')));_0x925cd4[_0x6134('0x13')](_0x6134('0xc4'),require('./api/chatQueueReport'));_0x925cd4[_0x6134('0x13')](_0x6134('0xc5'),require(_0x6134('0xc6')));_0x925cd4[_0x6134('0x13')]('/api/jscripty/answers/reports',require(_0x6134('0xc7')));_0x925cd4[_0x6134('0x13')](_0x6134('0xc8'),require(_0x6134('0xc9')));_0x925cd4['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x925cd4[_0x6134('0x13')](_0x6134('0xca'),require(_0x6134('0xcb')));_0x925cd4[_0x6134('0x13')](_0x6134('0xcc'),require(_0x6134('0xcd')));_0x925cd4['use'](_0x6134('0xce'),require(_0x6134('0xcf')));_0x925cd4[_0x6134('0x13')](_0x6134('0xd0'),require('./api/jscriptyProject'));_0x925cd4[_0x6134('0x13')](_0x6134('0xd1'),require(_0x6134('0xd2')));_0x925cd4[_0x6134('0x13')](_0x6134('0xd3'),require(_0x6134('0xd4')));_0x925cd4[_0x6134('0x13')](_0x6134('0xd5'),require(_0x6134('0xd6')));_0x925cd4[_0x6134('0x13')](_0x6134('0xd7'),require('./api/squareRecording'));_0x925cd4['use']('/api/square/messages',require('./api/squareMessage'));_0x925cd4[_0x6134('0x13')](_0x6134('0xd8'),require(_0x6134('0xd9')));_0x925cd4[_0x6134('0x13')](_0x6134('0xda'),require(_0x6134('0xdb')));_0x925cd4[_0x6134('0x13')](_0x6134('0xdc'),require(_0x6134('0xdd')));_0x925cd4['use']('/api/migrations',require(_0x6134('0xde')));_0x925cd4[_0x6134('0x13')]('/api/attachments',require(_0x6134('0xdf')));_0x925cd4[_0x6134('0x13')]('/api/plugins',require(_0x6134('0xe0')));_0x925cd4[_0x6134('0x13')](_0x6134('0xe1'),require(_0x6134('0xe2')));_0x925cd4[_0x6134('0x13')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x925cd4[_0x6134('0x13')]('/api/fax/reports/transfer',require(_0x6134('0xe3')));_0x925cd4[_0x6134('0x13')](_0x6134('0xe4'),require(_0x6134('0xe5')));_0x925cd4[_0x6134('0x13')](_0x6134('0xe6'),require(_0x6134('0xe7')));_0x925cd4[_0x6134('0x13')](_0x6134('0xe8'),require(_0x6134('0xe9')));_0x925cd4['use'](_0x6134('0xea'),require(_0x6134('0xeb')));_0x925cd4[_0x6134('0x13')](_0x6134('0xec'),require(_0x6134('0xed')));_0x925cd4[_0x6134('0x13')](_0x6134('0xee'),require(_0x6134('0xef')));_0x925cd4[_0x6134('0x13')](_0x6134('0xf0'),require(_0x6134('0xf1')));_0x925cd4[_0x6134('0x13')](_0x6134('0xf2'),require(_0x6134('0xf3')));_0x925cd4[_0x6134('0x13')]('/api/whatsapp/accounts',require(_0x6134('0xf4')));_0x925cd4[_0x6134('0x13')](_0x6134('0xf5'),require(_0x6134('0xf6')));_0x925cd4[_0x6134('0x13')]('/api/whatsapp/interactions',require(_0x6134('0xf7')));_0x925cd4[_0x6134('0x13')]('/api/whatsapp/messages',require(_0x6134('0xf8')));_0x925cd4[_0x6134('0x13')](_0x6134('0xf9'),require(_0x6134('0xfa')));_0x925cd4[_0x6134('0x13')](_0x6134('0xfb'),require(_0x6134('0xfc')));_0x925cd4['use'](_0x6134('0xfd'),require(_0x6134('0xfe')));_0x925cd4[_0x6134('0x13')](_0x6134('0xff'),require(_0x6134('0x100')));_0x925cd4['use']('/api/auth/local',require('./api/authLocal'));_0x925cd4[_0x6134('0x13')](_0x6134('0x101'),require(_0x6134('0x102')));_0x925cd4['use'](_0x6134('0x103'),require(_0x6134('0x104')));_0x925cd4['use'](_0x6134('0x105'),require('./api/rpc'));_0x925cd4[_0x6134('0x13')]('/api/version',require('./api/version'));_0x925cd4[_0x6134('0x13')](_0x6134('0x106'),require(_0x6134('0x107')));_0x925cd4[_0x6134('0x13')](_0x6134('0x108'),require(_0x6134('0x109')));_0x925cd4['use'](_0x6134('0x10a'),require(_0x6134('0x10b')));_0x925cd4['use'](_0x6134('0x10c'),express['static'](path[_0x6134('0x10d')](config['root'],_0x6134('0x10c'))));_0x925cd4[_0x6134('0x13')](_0x6134('0x10e'),express[_0x6134('0x10f')](path[_0x6134('0x10d')](config[_0x6134('0x110')],_0x6134('0x10e'))));_0x925cd4[_0x6134('0x13')](_0x6134('0x111'),express['static'](path[_0x6134('0x10d')](config[_0x6134('0x110')],'/demo')));_0x925cd4['use']('/snippet',express[_0x6134('0x10f')](path[_0x6134('0x10d')](config[_0x6134('0x110')],_0x6134('0x112'),'1.0.16')));_0x925cd4[_0x6134('0x13')](_0x6134('0x113'),express[_0x6134('0x10f')](path[_0x6134('0x10d')](config['root'],_0x6134('0x114'))));_0x925cd4[_0x6134('0x115')](_0x6134('0x116'))[_0x6134('0x117')](errors[0x194]);_0x925cd4[_0x6134('0x115')]('/*')[_0x6134('0x117')](function(_0x26e51f,_0x4a8698){_0x4a8698[_0x6134('0x118')](path['resolve'](_0x925cd4[_0x6134('0x117')](_0x6134('0x119'))+'/index.html'));});};
\ No newline at end of file
+var _0x2957=['./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareMessage','/api/teams','/api/license','./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/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/notifications','./api/notification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','/www','static','/demo','/snippet','snippet','1.0.16','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','logger','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','connection','name','other','agent_name','./api/user','./api/voiceChanSpy','./api/voiceContext','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration'];(function(_0x512fe4,_0xcd4205){var _0x87e6b4=function(_0x560234){while(--_0x560234){_0x512fe4['push'](_0x512fe4['shift']());}};_0x87e6b4(++_0xcd4205);}(_0x2957,0x177));var _0x7295=function(_0x14e58e,_0x2d3499){_0x14e58e=_0x14e58e-0x0;var _0x346d74=_0x2957[_0x14e58e];return _0x346d74;};'use strict';var path=require(_0x7295('0x0'));var express=require(_0x7295('0x1'));var ewinston=require(_0x7295('0x2'));var util=require(_0x7295('0x3'));var errors=require(_0x7295('0x4'));var config=require(_0x7295('0x5'));var logger=require(_0x7295('0x6'))(_0x7295('0x7'));var authLogger=require('./config/logger')(_0x7295('0x8'));exports[_0x7295('0x9')]=function(_0x27cd90){_0x27cd90[_0x7295('0xa')](ewinston[_0x7295('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x799b,_0x1708fb){return util[_0x7295('0xc')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x799b[_0x7295('0xd')],_0x799b[_0x7295('0xe')]['x-forwarded-for']?_0x799b['headers'][_0x7295('0xf')]:_0x799b['connection'][_0x7295('0x10')]||_0x799b['ip'],_0x799b[_0x7295('0x11')],_0x1708fb[_0x7295('0x12')],_0x1708fb[_0x7295('0x13')],_0x799b[_0x7295('0x14')]?_0x799b[_0x7295('0x14')]['id']:null,_0x799b[_0x7295('0x14')]?_0x799b['user']['name']:null,_0x799b['user']?_0x799b[_0x7295('0x14')][_0x7295('0x15')]:null);}}));_0x27cd90[_0x7295('0xa')](ewinston[_0x7295('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2387e1,_0x482889){var _0x1d922e=_0x7295('0x16');if(_0x2387e1[_0x7295('0x17')]&&_0x2387e1['body'][_0x7295('0x18')]&&_0x2387e1[_0x7295('0x17')][_0x7295('0x19')]){_0x1d922e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x7295('0xc')](_0x1d922e,_0x2387e1[_0x7295('0xd')],_0x2387e1[_0x7295('0xe')][_0x7295('0xf')]?_0x2387e1[_0x7295('0xe')][_0x7295('0xf')]:_0x2387e1[_0x7295('0x1a')][_0x7295('0x10')]||_0x2387e1['ip'],_0x2387e1['url'],_0x482889[_0x7295('0x12')],_0x482889[_0x7295('0x13')],_0x2387e1[_0x7295('0x14')]?_0x2387e1[_0x7295('0x14')]['id']:null,_0x2387e1[_0x7295('0x14')]?_0x2387e1[_0x7295('0x14')][_0x7295('0x1b')]:null,_0x2387e1[_0x7295('0x14')]?_0x2387e1[_0x7295('0x14')][_0x7295('0x15')]:null,_0x2387e1['body']&&_0x2387e1[_0x7295('0x17')]['device']?_0x2387e1[_0x7295('0x17')][_0x7295('0x18')]:_0x7295('0x1c'),_0x2387e1[_0x7295('0x17')]&&_0x2387e1['body'][_0x7295('0x19')]?_0x2387e1[_0x7295('0x17')][_0x7295('0x19')]:'',_0x2387e1['body']&&_0x2387e1[_0x7295('0x17')][_0x7295('0x1d')]?_0x2387e1[_0x7295('0x17')][_0x7295('0x1d')]:'');},'ignoreRoute':function(_0x2f3caa){var _0x35001d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x35001d['test'](_0x2f3caa[_0x7295('0x11')]);}}));_0x27cd90['use']('/api/users',require(_0x7295('0x1e')));_0x27cd90[_0x7295('0xa')]('/api/voice/chanspy',require(_0x7295('0x1f')));_0x27cd90[_0x7295('0xa')]('/api/voice/contexts',require(_0x7295('0x20')));_0x27cd90[_0x7295('0xa')]('/api/voice/extensions',require(_0x7295('0x21')));_0x27cd90[_0x7295('0xa')]('/api/voice/mohs',require(_0x7295('0x22')));_0x27cd90['use'](_0x7295('0x23'),require(_0x7295('0x24')));_0x27cd90[_0x7295('0xa')](_0x7295('0x25'),require('./api/voiceRecording'));_0x27cd90[_0x7295('0xa')](_0x7295('0x26'),require(_0x7295('0x27')));_0x27cd90[_0x7295('0xa')](_0x7295('0x28'),require('./api/voiceMail'));_0x27cd90[_0x7295('0xa')]('/api/voice/mails/messages',require(_0x7295('0x29')));_0x27cd90[_0x7295('0xa')]('/api/voice/calls/reports',require(_0x7295('0x2a')));_0x27cd90[_0x7295('0xa')](_0x7295('0x2b'),require(_0x7295('0x2c')));_0x27cd90['use']('/api/voice/agents/reports',require(_0x7295('0x2d')));_0x27cd90[_0x7295('0xa')]('/api/voice/queues/reports',require(_0x7295('0x2e')));_0x27cd90[_0x7295('0xa')](_0x7295('0x2f'),require('./api/memberReport'));_0x27cd90[_0x7295('0xa')](_0x7295('0x30'),require(_0x7295('0x31')));_0x27cd90[_0x7295('0xa')]('/api/voice/transfers/reports',require(_0x7295('0x32')));_0x27cd90[_0x7295('0xa')]('/api/mail/out_servers',require(_0x7295('0x33')));_0x27cd90[_0x7295('0xa')](_0x7295('0x34'),require(_0x7295('0x35')));_0x27cd90[_0x7295('0xa')](_0x7295('0x36'),require(_0x7295('0x37')));_0x27cd90[_0x7295('0xa')](_0x7295('0x38'),require(_0x7295('0x39')));_0x27cd90[_0x7295('0xa')](_0x7295('0x3a'),require(_0x7295('0x3b')));_0x27cd90[_0x7295('0xa')](_0x7295('0x3c'),require(_0x7295('0x3d')));_0x27cd90[_0x7295('0xa')](_0x7295('0x3e'),require(_0x7295('0x3f')));_0x27cd90['use'](_0x7295('0x40'),require(_0x7295('0x41')));_0x27cd90['use'](_0x7295('0x42'),require('./api/dashboard'));_0x27cd90[_0x7295('0xa')]('/api/dashboards/items',require('./api/dashboardItem'));_0x27cd90[_0x7295('0xa')](_0x7295('0x43'),require(_0x7295('0x44')));_0x27cd90[_0x7295('0xa')](_0x7295('0x45'),require('./api/faxApplication'));_0x27cd90['use'](_0x7295('0x46'),require(_0x7295('0x47')));_0x27cd90[_0x7295('0xa')](_0x7295('0x48'),require('./api/faxMessage'));_0x27cd90[_0x7295('0xa')](_0x7295('0x49'),require(_0x7295('0x4a')));_0x27cd90[_0x7295('0xa')](_0x7295('0x4b'),require(_0x7295('0x4c')));_0x27cd90[_0x7295('0xa')](_0x7295('0x4d'),require(_0x7295('0x4e')));_0x27cd90[_0x7295('0xa')](_0x7295('0x4f'),require(_0x7295('0x50')));_0x27cd90['use']('/api/sms/interactions',require(_0x7295('0x51')));_0x27cd90[_0x7295('0xa')](_0x7295('0x52'),require('./api/smsMessage'));_0x27cd90['use'](_0x7295('0x53'),require(_0x7295('0x54')));_0x27cd90[_0x7295('0xa')](_0x7295('0x55'),require(_0x7295('0x56')));_0x27cd90[_0x7295('0xa')](_0x7295('0x57'),require(_0x7295('0x58')));_0x27cd90[_0x7295('0xa')](_0x7295('0x59'),require(_0x7295('0x5a')));_0x27cd90[_0x7295('0xa')](_0x7295('0x5b'),require(_0x7295('0x5c')));_0x27cd90[_0x7295('0xa')](_0x7295('0x5d'),require(_0x7295('0x5e')));_0x27cd90['use'](_0x7295('0x5f'),require(_0x7295('0x60')));_0x27cd90[_0x7295('0xa')](_0x7295('0x61'),require(_0x7295('0x62')));_0x27cd90[_0x7295('0xa')](_0x7295('0x63'),require(_0x7295('0x64')));_0x27cd90[_0x7295('0xa')](_0x7295('0x65'),require(_0x7295('0x66')));_0x27cd90[_0x7295('0xa')](_0x7295('0x67'),require(_0x7295('0x68')));_0x27cd90[_0x7295('0xa')](_0x7295('0x69'),require(_0x7295('0x6a')));_0x27cd90[_0x7295('0xa')]('/api/chat/queues',require(_0x7295('0x6b')));_0x27cd90[_0x7295('0xa')](_0x7295('0x6c'),require(_0x7295('0x6d')));_0x27cd90[_0x7295('0xa')]('/api/chat/proactive_actions',require(_0x7295('0x6e')));_0x27cd90['use'](_0x7295('0x6f'),require(_0x7295('0x70')));_0x27cd90[_0x7295('0xa')]('/api/cm/contacts',require('./api/cmContact'));_0x27cd90[_0x7295('0xa')](_0x7295('0x71'),require(_0x7295('0x72')));_0x27cd90['use'](_0x7295('0x73'),require(_0x7295('0x74')));_0x27cd90[_0x7295('0xa')]('/api/cm/hopper_final',require(_0x7295('0x75')));_0x27cd90[_0x7295('0xa')](_0x7295('0x76'),require(_0x7295('0x77')));_0x27cd90[_0x7295('0xa')](_0x7295('0x78'),require(_0x7295('0x79')));_0x27cd90['use']('/api/actions',require(_0x7295('0x7a')));_0x27cd90[_0x7295('0xa')](_0x7295('0x7b'),require(_0x7295('0x7c')));_0x27cd90[_0x7295('0xa')](_0x7295('0x7d'),require(_0x7295('0x7e')));_0x27cd90[_0x7295('0xa')]('/api/dispositions',require('./api/disposition'));_0x27cd90[_0x7295('0xa')](_0x7295('0x7f'),require('./api/condition'));_0x27cd90[_0x7295('0xa')](_0x7295('0x80'),require(_0x7295('0x81')));_0x27cd90['use'](_0x7295('0x82'),require(_0x7295('0x83')));_0x27cd90[_0x7295('0xa')](_0x7295('0x84'),require(_0x7295('0x85')));_0x27cd90[_0x7295('0xa')](_0x7295('0x86'),require(_0x7295('0x87')));_0x27cd90['use']('/api/schedules',require(_0x7295('0x88')));_0x27cd90['use'](_0x7295('0x89'),require(_0x7295('0x8a')));_0x27cd90[_0x7295('0xa')](_0x7295('0x8b'),require('./api/tag'));_0x27cd90[_0x7295('0xa')](_0x7295('0x8c'),require(_0x7295('0x8d')));_0x27cd90[_0x7295('0xa')](_0x7295('0x8e'),require(_0x7295('0x8f')));_0x27cd90['use'](_0x7295('0x90'),require('./api/variable'));_0x27cd90[_0x7295('0xa')](_0x7295('0x91'),require('./api/integration'));_0x27cd90['use']('/api/integrations/reports',require(_0x7295('0x92')));_0x27cd90[_0x7295('0xa')](_0x7295('0x93'),require('./api/analyticCustomReport'));_0x27cd90[_0x7295('0xa')](_0x7295('0x94'),require('./api/analyticDefaultReport'));_0x27cd90[_0x7295('0xa')](_0x7295('0x95'),require(_0x7295('0x96')));_0x27cd90[_0x7295('0xa')](_0x7295('0x97'),require(_0x7295('0x98')));_0x27cd90['use'](_0x7295('0x99'),require(_0x7295('0x9a')));_0x27cd90['use'](_0x7295('0x9b'),require(_0x7295('0x9c')));_0x27cd90['use'](_0x7295('0x9d'),require(_0x7295('0x9e')));_0x27cd90[_0x7295('0xa')](_0x7295('0x9f'),require(_0x7295('0xa0')));_0x27cd90['use'](_0x7295('0xa1'),require(_0x7295('0xa2')));_0x27cd90[_0x7295('0xa')]('/api/integrations/sugarcrm/accounts',require(_0x7295('0xa3')));_0x27cd90[_0x7295('0xa')]('/api/integrations/sugarcrm/configurations',require(_0x7295('0xa4')));_0x27cd90['use']('/api/integrations/sugarcrm/fields',require(_0x7295('0xa5')));_0x27cd90[_0x7295('0xa')]('/api/integrations/desk/accounts',require(_0x7295('0xa6')));_0x27cd90['use'](_0x7295('0xa7'),require(_0x7295('0xa8')));_0x27cd90[_0x7295('0xa')](_0x7295('0xa9'),require(_0x7295('0xaa')));_0x27cd90[_0x7295('0xa')](_0x7295('0xab'),require('./api/intZohoAccount'));_0x27cd90['use']('/api/integrations/zoho/configurations',require(_0x7295('0xac')));_0x27cd90[_0x7295('0xa')]('/api/integrations/zoho/fields',require(_0x7295('0xad')));_0x27cd90[_0x7295('0xa')](_0x7295('0xae'),require('./api/intZendeskAccount'));_0x27cd90['use'](_0x7295('0xaf'),require(_0x7295('0xb0')));_0x27cd90[_0x7295('0xa')](_0x7295('0xb1'),require(_0x7295('0xb2')));_0x27cd90[_0x7295('0xa')](_0x7295('0xb3'),require('./api/intFreshdeskAccount'));_0x27cd90[_0x7295('0xa')]('/api/integrations/freshdesk/configurations',require(_0x7295('0xb4')));_0x27cd90[_0x7295('0xa')](_0x7295('0xb5'),require('./api/intFreshdeskField'));_0x27cd90[_0x7295('0xa')]('/api/integrations/vtiger/accounts',require(_0x7295('0xb6')));_0x27cd90[_0x7295('0xa')](_0x7295('0xb7'),require(_0x7295('0xb8')));_0x27cd90['use'](_0x7295('0xb9'),require(_0x7295('0xba')));_0x27cd90[_0x7295('0xa')](_0x7295('0xbb'),require('./api/intServicenowAccount'));_0x27cd90[_0x7295('0xa')]('/api/integrations/servicenow/configurations',require(_0x7295('0xbc')));_0x27cd90[_0x7295('0xa')]('/api/integrations/servicenow/fields',require(_0x7295('0xbd')));_0x27cd90[_0x7295('0xa')](_0x7295('0xbe'),require(_0x7295('0xbf')));_0x27cd90[_0x7295('0xa')](_0x7295('0xc0'),require(_0x7295('0xc1')));_0x27cd90[_0x7295('0xa')]('/api/integrations/dynamics365/fields',require(_0x7295('0xc2')));_0x27cd90[_0x7295('0xa')](_0x7295('0xc3'),require(_0x7295('0xc4')));_0x27cd90['use'](_0x7295('0xc5'),require(_0x7295('0xc6')));_0x27cd90[_0x7295('0xa')]('/api/integrations/freshsales/fields',require(_0x7295('0xc7')));_0x27cd90[_0x7295('0xa')]('/api/networks',require(_0x7295('0xc8')));_0x27cd90[_0x7295('0xa')](_0x7295('0xc9'),require(_0x7295('0xca')));_0x27cd90[_0x7295('0xa')](_0x7295('0xcb'),require(_0x7295('0xcc')));_0x27cd90['use'](_0x7295('0xcd'),require('./api/jscriptyAnswerReport'));_0x27cd90['use'](_0x7295('0xce'),require('./api/jscriptyQuestionReport'));_0x27cd90['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x27cd90['use'](_0x7295('0xcf'),require(_0x7295('0xd0')));_0x27cd90['use'](_0x7295('0xd1'),require(_0x7295('0xd2')));_0x27cd90[_0x7295('0xa')]('/api/square/details/reports',require(_0x7295('0xd3')));_0x27cd90[_0x7295('0xa')]('/api/jscripty/projects',require(_0x7295('0xd4')));_0x27cd90['use'](_0x7295('0xd5'),require(_0x7295('0xd6')));_0x27cd90[_0x7295('0xa')]('/api/square/odbc',require(_0x7295('0xd7')));_0x27cd90[_0x7295('0xa')](_0x7295('0xd8'),require(_0x7295('0xd9')));_0x27cd90[_0x7295('0xa')]('/api/square/recordings',require('./api/squareRecording'));_0x27cd90[_0x7295('0xa')]('/api/square/messages',require(_0x7295('0xda')));_0x27cd90['use'](_0x7295('0xdb'),require('./api/team'));_0x27cd90[_0x7295('0xa')](_0x7295('0xdc'),require(_0x7295('0xdd')));_0x27cd90[_0x7295('0xa')](_0x7295('0xde'),require(_0x7295('0xdf')));_0x27cd90[_0x7295('0xa')](_0x7295('0xe0'),require(_0x7295('0xe1')));_0x27cd90['use'](_0x7295('0xe2'),require(_0x7295('0xe3')));_0x27cd90[_0x7295('0xa')](_0x7295('0xe4'),require(_0x7295('0xe5')));_0x27cd90[_0x7295('0xa')](_0x7295('0xe6'),require(_0x7295('0xe7')));_0x27cd90[_0x7295('0xa')]('/api/chat/reports/transfer',require(_0x7295('0xe8')));_0x27cd90[_0x7295('0xa')](_0x7295('0xe9'),require(_0x7295('0xea')));_0x27cd90[_0x7295('0xa')](_0x7295('0xeb'),require(_0x7295('0xec')));_0x27cd90[_0x7295('0xa')](_0x7295('0xed'),require(_0x7295('0xee')));_0x27cd90[_0x7295('0xa')](_0x7295('0xef'),require('./api/cmList'));_0x27cd90[_0x7295('0xa')]('/api/voice/prefixes',require(_0x7295('0xf0')));_0x27cd90[_0x7295('0xa')](_0x7295('0xf1'),require(_0x7295('0xf2')));_0x27cd90[_0x7295('0xa')]('/api/userProfile/sections',require(_0x7295('0xf3')));_0x27cd90[_0x7295('0xa')](_0x7295('0xf4'),require(_0x7295('0xf5')));_0x27cd90[_0x7295('0xa')](_0x7295('0xf6'),require(_0x7295('0xf7')));_0x27cd90[_0x7295('0xa')](_0x7295('0xf8'),require(_0x7295('0xf9')));_0x27cd90['use']('/api/whatsapp/applications',require(_0x7295('0xfa')));_0x27cd90[_0x7295('0xa')](_0x7295('0xfb'),require(_0x7295('0xfc')));_0x27cd90['use'](_0x7295('0xfd'),require(_0x7295('0xfe')));_0x27cd90[_0x7295('0xa')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x27cd90[_0x7295('0xa')](_0x7295('0xff'),require('./api/whatsappTransferReport'));_0x27cd90[_0x7295('0xa')](_0x7295('0x100'),require(_0x7295('0x101')));_0x27cd90[_0x7295('0xa')](_0x7295('0x102'),require(_0x7295('0x103')));_0x27cd90[_0x7295('0xa')]('/api/auth/local',require('./api/authLocal'));_0x27cd90['use']('/api/auth/google',require('./api/authGoogle'));_0x27cd90[_0x7295('0xa')]('/api/jira',require(_0x7295('0x104')));_0x27cd90[_0x7295('0xa')](_0x7295('0x105'),require(_0x7295('0x106')));_0x27cd90[_0x7295('0xa')](_0x7295('0x107'),require(_0x7295('0x108')));_0x27cd90[_0x7295('0xa')](_0x7295('0x109'),require(_0x7295('0x10a')));_0x27cd90[_0x7295('0xa')](_0x7295('0x10b'),require(_0x7295('0x10c')));_0x27cd90['use'](_0x7295('0x10d'),require(_0x7295('0x10e')));_0x27cd90[_0x7295('0xa')](_0x7295('0x10f'),express['static'](path[_0x7295('0x110')](config[_0x7295('0x111')],_0x7295('0x10f'))));_0x27cd90[_0x7295('0xa')](_0x7295('0x112'),express[_0x7295('0x113')](path[_0x7295('0x110')](config[_0x7295('0x111')],'/www')));_0x27cd90[_0x7295('0xa')]('/demo',express['static'](path[_0x7295('0x110')](config['root'],_0x7295('0x114'))));_0x27cd90[_0x7295('0xa')](_0x7295('0x115'),express[_0x7295('0x113')](path['join'](config[_0x7295('0x111')],_0x7295('0x116'),_0x7295('0x117'))));_0x27cd90[_0x7295('0xa')](_0x7295('0x118'),express[_0x7295('0x113')](path[_0x7295('0x110')](config['root'],'/server/files/plugins')));_0x27cd90[_0x7295('0x119')](_0x7295('0x11a'))[_0x7295('0x11b')](errors[0x194]);_0x27cd90['route']('/*')['get'](function(_0x3635a7,_0x12ad7d){_0x12ad7d['sendFile'](path[_0x7295('0x11c')](_0x27cd90['get'](_0x7295('0x11d'))+_0x7295('0x11e')));});};
\ No newline at end of file
index ade1d60..fb3e9a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66f8=['error','../config/triggers','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.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/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost'];(function(_0x21a9cf,_0x51f954){var _0x5d4ba7=function(_0x18d186){while(--_0x18d186){_0x21a9cf['push'](_0x21a9cf['shift']());}};_0x5d4ba7(++_0x51f954);}(_0x66f8,0x15c));var _0x866f=function(_0x5eaac1,_0x248092){_0x5eaac1=_0x5eaac1-0x0;var _0x1a4cb7=_0x66f8[_0x5eaac1];return _0x1a4cb7;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x866f('0x0'));var _=require(_0x866f('0x1'));var config=require(_0x866f('0x2'));exports[_0x866f('0x3')]=function(){return new BPromise(function(_0xdf96b6,_0xa7fbbe){var _0x4543f5={};_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x5')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/voiceExtension/voiceExtension.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x6')));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x7')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x8')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x9')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0xa')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0xb')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0xc')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0xd')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0xe')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0xf')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/mailQueue/mailQueue.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x10')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x11')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x12')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x13')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x14')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x15')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x16')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x17')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x18')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x19')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x1a')));_0x4543f5=_['merge'](_0x4543f5,require('../api/smsMessage/smsMessage.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/smsQueue/smsQueue.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x1b')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x1c')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x4543f5=_['merge'](_0x4543f5,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x1d')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x1e')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x1f')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/chatQueue/chatQueue.rpc'));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x20')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x21')));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x22')));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x23')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x24')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x25')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x26')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x27')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/sound/sound.rpc'));_0x4543f5=_['merge'](_0x4543f5,require('../api/template/template.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x28')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x29')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x2a')));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x2b')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x2c')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x2d')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x2e')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x2f')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x30')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x31')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x32')));_0x4543f5=_['merge'](_0x4543f5,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x33')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x34')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/squareOdbc/squareOdbc.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/squareProject/squareProject.rpc'));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x35')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x36')));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x37')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x38')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x39')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require(_0x866f('0x3a')));_0x4543f5=_[_0x866f('0x4')](_0x4543f5,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x3b')));_0x4543f5=_['merge'](_0x4543f5,require(_0x866f('0x3c')));_0x4543f5=_['merge'](_0x4543f5,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x433970=jayson[_0x866f('0x3d')](_0x4543f5)[_0x866f('0x3e')]();var _0x3f4496=config[_0x866f('0x3f')][_0x866f('0x40')]||config[_0x866f('0x40')]+0x1;var _0x57b10a=config[_0x866f('0x3f')]['ip']||_0x866f('0x41');_0x433970['on'](_0x866f('0x42'),function(_0x468b38){return _0xa7fbbe(_0x468b38);});_0x433970[_0x866f('0x3')](_0x3f4496,_0x57b10a,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x57b10a,_0x3f4496);require(_0x866f('0x43'))['default']();return _0xdf96b6(_0x866f('0x44')+_0x57b10a+':'+_0x3f4496);});});};
\ No newline at end of file
+var _0xddd9=['../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.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/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../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/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','jayson/promise','bluebird','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/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc'];(function(_0x596818,_0x357c06){var _0xed04e5=function(_0x114357){while(--_0x114357){_0x596818['push'](_0x596818['shift']());}};_0xed04e5(++_0x357c06);}(_0xddd9,0xb4));var _0x9ddd=function(_0x1e6b78,_0x1d0638){_0x1e6b78=_0x1e6b78-0x0;var _0x590b02=_0xddd9[_0x1e6b78];return _0x590b02;};'use strict';var jayson=require(_0x9ddd('0x0'));var BPromise=require(_0x9ddd('0x1'));var _=require(_0x9ddd('0x2'));var config=require(_0x9ddd('0x3'));exports[_0x9ddd('0x4')]=function(){return new BPromise(function(_0x178c3c,_0x2cdced){var _0x2de2fc={};_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x6')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x7')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x8')));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x9')));_0x2de2fc=_['merge'](_0x2de2fc,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0xa')));_0x2de2fc=_['merge'](_0x2de2fc,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0xb')));_0x2de2fc=_['merge'](_0x2de2fc,require('../api/trunk/trunk.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0xc')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0xd')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0xe')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0xf')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x10')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x11')));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x12')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x13')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x14')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x15')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/faxApplication/faxApplication.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x16')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x17')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/faxQueue/faxQueue.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x18')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x19')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x1a')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x1b')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x1c')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x1d')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x1e')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x1f')));_0x2de2fc=_['merge'](_0x2de2fc,require('../api/chatInteraction/chatInteraction.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/chatMessage/chatMessage.rpc'));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x20')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x21')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/cmHopper/cmHopper.rpc'));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x22')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x23')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x24')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x25')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/interval/interval.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x26')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x27')));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x28')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/trigger/trigger.rpc'));_0x2de2fc=_['merge'](_0x2de2fc,require('../api/variable/variable.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x29')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x2a')));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x2b')));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x2c')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x2d')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x2e')));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x2f')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x30')));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x31')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x32')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x33')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x34')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x35')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/squareOdbc/squareOdbc.rpc'));_0x2de2fc=_['merge'](_0x2de2fc,require(_0x9ddd('0x36')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/squareRecording/squareRecording.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x37')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x38')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x39')));_0x2de2fc=_['merge'](_0x2de2fc,require('../api/plugin/plugin.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x3a')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x3b')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x3c')));_0x2de2fc=_[_0x9ddd('0x5')](_0x2de2fc,require(_0x9ddd('0x3d')));var _0x450455=jayson[_0x9ddd('0x3e')](_0x2de2fc)[_0x9ddd('0x3f')]();var _0x21ef79=config[_0x9ddd('0x40')][_0x9ddd('0x41')]||config[_0x9ddd('0x41')]+0x1;var _0x3edfd9=config['rpc']['ip']||'localhost';_0x450455['on'](_0x9ddd('0x42'),function(_0x212c9b){return _0x2cdced(_0x212c9b);});_0x450455[_0x9ddd('0x4')](_0x21ef79,_0x3edfd9,function(){console[_0x9ddd('0x43')](_0x9ddd('0x44'),_0x3edfd9,_0x21ef79);require('../config/triggers')['default']();return _0x178c3c('RPC\x20listening\x20on\x20'+_0x3edfd9+':'+_0x21ef79);});});};
\ No newline at end of file
index c79f13c..d589439 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','emit','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','sendRequest','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xedd9,0xfc));var _0x9edd=function(_0x5babae,_0x142554){_0x5babae=_0x5babae-0x0;var _0x5539c5=_0xedd9[_0x5babae];return _0x5539c5;};'use strict';var util=require('util');var _=require(_0x9edd('0x0'));var EventEmitter=require(_0x9edd('0x1'))[_0x9edd('0x2')];var AGIReply=require(_0x9edd('0x3'));var AGIError=require(_0x9edd('0x4'));function AGIChannel(_0x127cbe){var _0x3e6d3a=this,_0x36b53f=new AGIReply(),_0x5943b3=![],_0x33679f={};EventEmitter[_0x9edd('0x5')](_0x3e6d3a);_0x127cbe[_0x9edd('0x6')](_0x9edd('0x7'));_0x127cbe['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x36b53f[_0x9edd('0x6')]('utf8');_0x36b53f['on'](_0x9edd('0x8'),function(_0x190185){for(var _0x1355be in _0x190185){_0x3e6d3a[_0x1355be]=_0x190185[_0x1355be];}_0x3e6d3a[_0x9edd('0x9')]('ready');});_0x36b53f['on'](_0x9edd('0xa'),function(_0x5d2f90){if(_0x5d2f90[_0x9edd('0xb')]()==_0x9edd('0xc')){_0x3e6d3a['emit'](_0x9edd('0xc'));return;}if(_0x5d2f90[_0x9edd('0xd')](0x0,0xb)=='520-Invalid'){_0x5943b3=!![];}if(_0x5943b3){_0x33679f['rx']+=_0x5d2f90+'\x0a';if(_0x5d2f90[_0x9edd('0xe')](_0x9edd('0xf'))!=-0x1){_0x5943b3=![];}}else{_0x33679f['rx']=_0x5d2f90;}if(_0x5943b3){return;}if(typeof _0x33679f['cb']==_0x9edd('0x10')){var _0xfd544a=_0x33679f['rx'][_0x9edd('0xd')](0x0,0x3),_0x287ddd=null,_0x3a7b84=null;_0xfd544a=parseInt(_0xfd544a);if(isNaN(_0xfd544a)){_0x33679f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x9edd('0x11')});return;}if(_0xfd544a!=0xc8){_0x33679f['cb'](null,{'code':_0xfd544a,'result':-0x1,'extra':'KO'});return;}_0x287ddd=_0x33679f['rx']['substring'](0x4)[_0x9edd('0x12')](_0x9edd('0x13'),'');if(_0x287ddd[_0x9edd('0x14')]('\x20')!=-0x1){_0x287ddd=_0x287ddd[_0x9edd('0x15')](0x0,_0x287ddd[_0x9edd('0x14')]('\x20'));}if(_[_0x9edd('0x16')](_0x287ddd,'-1')){_0x287ddd=parseInt(_0x287ddd);}_0x3a7b84=_0x33679f['rx'][_0x9edd('0x17')]('\x20');if(_0x3a7b84[_0x9edd('0x18')]==0x3){_0x3a7b84=_0x3a7b84[0x2]['substring'](0x1,_0x3a7b84[0x2][_0x9edd('0x18')]-0x1);}else if(_0x3a7b84[_0x9edd('0x18')]>0x3){var _0x449cee=/\((.+)\)/;var _0x5acf65=_0x33679f['rx'][_0x9edd('0x19')](_0x449cee);if(_0x5acf65){_0x3a7b84=_0x5acf65[0x1];}else{_0x3a7b84=null;}}else{_0x3a7b84=null;}_0x33679f['cb'](null,{'code':_0xfd544a,'result':_0x287ddd,'extra':_0x3a7b84});}});_0x127cbe['on'](_0x9edd('0x1a'),function(_0x40ba32){_0x3e6d3a['emit'](_0x9edd('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x40ba32[_0x9edd('0x1b')]));});_0x127cbe['on'](_0x9edd('0x1c'),function(){_0x3e6d3a['emit']('close',new AGIError(_0x9edd('0x1d')));});_0x127cbe['on']('timeout',function(){_0x3e6d3a[_0x9edd('0x9')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x127cbe[_0x9edd('0x1e')]();});_0x127cbe[_0x9edd('0x1f')](_0x36b53f);this['command']=function(_0x5823bc,_0x341d67){var _0x5823bc=_0x5823bc||'',_0x341d67=typeof _0x341d67=='function'?_0x341d67:new Function();_0x33679f={'tx':_0x5823bc,'rx':'','cb':_0x341d67};_0x127cbe[_0x9edd('0x20')](_0x5823bc+'\x0a');},this[_0x9edd('0x1c')]=function(){_0x127cbe[_0x9edd('0x1e')]();};}util[_0x9edd('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x9edd('0x22')]['sendRequest']=function(_0x46c383){return this[_0x9edd('0x23')][_0x9edd('0x24')](this,_0x46c383);};AGIChannel[_0x9edd('0x22')][_0x9edd('0x25')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x9edd('0x22')][_0x9edd('0x26')]=function(_0x8d67aa,_0x25e135,_0x3c2227){_0x8d67aa=_0x8d67aa===undefined?'beep':_0x8d67aa;_0x25e135=_0x25e135===undefined?'5':_0x25e135;_0x3c2227=_0x3c2227===undefined?'1':_0x3c2227;return this['sendRequest'](util[_0x9edd('0x27')](_0x9edd('0x28'),_0x8d67aa,_0x25e135*0x3e8,_0x3c2227));};AGIChannel[_0x9edd('0x22')]['noop']=function(_0x238b22){_0x238b22=_0x238b22||_0x9edd('0x29');return this[_0x9edd('0x2a')](util[_0x9edd('0x27')]('VERBOSE\x20\x22%s\x22',_0x238b22));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x2b')]=function(_0xbe87e1,_0x12c1bc){if(_[_0x9edd('0x2c')](_0x12c1bc)){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x2d'),_0xbe87e1,_0x12c1bc[_0x9edd('0x2e')](',')));}return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x2d'),_0xbe87e1,_0x12c1bc));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x2f')]=function(_0x1a6c23){return this['sendRequest'](util[_0x9edd('0x27')](_0x9edd('0x30'),_0x1a6c23));};AGIChannel[_0x9edd('0x22')]['setExtension']=function(_0x2d2f88){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x31'),_0x2d2f88));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x32')]=function(_0x473068){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x33'),_0x473068));};AGIChannel[_0x9edd('0x22')][_0x9edd('0xc')]=function(){return this[_0x9edd('0x2a')](_0x9edd('0x34'));};AGIChannel['prototype'][_0x9edd('0x35')]=function(_0x5ed62d,_0x968303){var _0x148630=_[_0x9edd('0x36')](_0x968303)||_[_0x9edd('0x37')](_0x968303)?_0x968303[_0x9edd('0x38')]():_0x968303;return this['sendRequest'](util[_0x9edd('0x27')](_0x9edd('0x39'),_0x5ed62d,_0x148630?_0x148630[_0x9edd('0x38')]()[_0x9edd('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x3a')]=function(_0x5c0627,_0x1cbbac){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')]('SAY\x20NUMBER\x20%s\x20%s',_0x5c0627,_0x1cbbac));};AGIChannel[_0x9edd('0x22')]['sayDigits']=function(_0x3ef1d5,_0x5658d6){return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x3b'),_0x3ef1d5,_0x5658d6));};AGIChannel['prototype'][_0x9edd('0x3c')]=function(_0xcbd0ef,_0x2f8f61){return this['sendRequest'](util[_0x9edd('0x27')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xcbd0ef,_0x2f8f61));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x3d')]=function(_0x50be2c,_0x315f52,_0x40fdfb){_0x315f52=_0x315f52||this[_0x9edd('0x3e')];_0x40fdfb=_0x40fdfb||0x1;this[_0x9edd('0x2f')](_0x50be2c);this['setExtension'](_0x315f52);this[_0x9edd('0x32')](_0x40fdfb);return this['noop'](util[_0x9edd('0x27')](_0x9edd('0x3f'),_0x50be2c,_0x315f52,_0x40fdfb));};AGIChannel['prototype'][_0x9edd('0x40')]=function(_0x49a128){return this['sendRequest'](util[_0x9edd('0x27')](_0x9edd('0x41'),_0x49a128));};AGIChannel[_0x9edd('0x22')][_0x9edd('0x42')]=function(_0x25e6ec,_0x4737ae,_0x3ff512,_0x75efbe,_0x18c149,_0x2b081a){_0x4737ae=_0x4737ae||_0x9edd('0x43');_0x3ff512=_0x3ff512||'';_0x75efbe=_0x75efbe===undefined?-0x1:_0x75efbe==='-1'?-0x1:_0x75efbe*0x3e8;_0x18c149=_0x18c149===undefined?'':'s='+_0x18c149;_0x2b081a=_0x2b081a?_0x9edd('0x44'):'';return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x45'),_0x25e6ec,_0x4737ae,_0x3ff512,_0x75efbe,_0x2b081a,_0x18c149));};AGIChannel['prototype'][_0x9edd('0x46')]=function(_0x2570e3,_0x2231c1){_0x2231c1=_0x2231c1||'';return this[_0x9edd('0x2a')](util[_0x9edd('0x27')](_0x9edd('0x47'),_0x2570e3,_0x2231c1));};AGIChannel[_0x9edd('0x22')]['agi']=function(_0x4a4656){return this['exec'](_0x9edd('0x48'),_0x4a4656);};AGIChannel['prototype'][_0x9edd('0x49')]=function(_0x19b56b){return this[_0x9edd('0x2b')](_0x9edd('0x4a'),_0x19b56b);};AGIChannel[_0x9edd('0x22')]['error']=function(_0x387fb8,_0x35e63c){this[_0x9edd('0x4b')](util['format'](_0x9edd('0x4c'),_0x387fb8['id'],_0x387fb8[_0x9edd('0x4d')],_0x35e63c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9edd('0x4e')]=AGIChannel;
\ No newline at end of file
+var _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0x10b5b5,_0x49e621){var _0x4a6111=function(_0x184ba3){while(--_0x184ba3){_0x10b5b5['push'](_0x10b5b5['shift']());}};_0x4a6111(++_0x49e621);}(_0x70e0,0x17b));var _0x070e=function(_0x4fcf4e,_0x361510){_0x4fcf4e=_0x4fcf4e-0x0;var _0x457555=_0x70e0[_0x4fcf4e];return _0x457555;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=AGIChannel;
\ No newline at end of file
index c7f22e1..1b22be7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde94=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message'];(function(_0x4179b3,_0x2eaff2){var _0x5b5c7e=function(_0x568341){while(--_0x568341){_0x4179b3['push'](_0x4179b3['shift']());}};_0x5b5c7e(++_0x2eaff2);}(_0xde94,0x134));var _0x4de9=function(_0x484d9b,_0x509bf0){_0x484d9b=_0x484d9b-0x0;var _0x241ec3=_0xde94[_0x484d9b];return _0x241ec3;};'use strict';var util=require(_0x4de9('0x0'));var error={'E_AGI_UNDEFINED':_0x4de9('0x1'),'E_AGI_ARGUMENT_PORT':_0x4de9('0x2'),'E_AGI_SERVER_ERROR':_0x4de9('0x3'),'E_AGI_SERVER_CLOSE':_0x4de9('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x4de9('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x4de9('0x6'),'E_AGI_SOCKET_ERROR':_0x4de9('0x7'),'E_AGI_SOCKET_CLOSE':_0x4de9('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x4de9('0x9'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4de9('0xa'),'E_AGI_IVR_ENTRY':_0x4de9('0xb')};function AGIError(_0x204838){var _0x204838=_0x204838||null,_0x411f00=_0x411f00||[],_0x244ea3=0x1,_0x4a65ec='';if(!error[_0x204838]){_0x204838=_0x4de9('0xc');}_0x411f00['push'](error[_0x204838]);while(arguments[_0x244ea3]){_0x411f00[_0x4de9('0xd')](arguments[_0x244ea3]);_0x244ea3++;}_0x4a65ec=util[_0x4de9('0xe')]['apply'](util,_0x411f00);this[_0x4de9('0xf')]=_0x4a65ec;this[_0x4de9('0x10')]=_0x204838;}module[_0x4de9('0x11')]=AGIError;
\ No newline at end of file
+var _0xaab2=['Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.'];(function(_0x3da187,_0x527af0){var _0x18fd45=function(_0x30526a){while(--_0x30526a){_0x3da187['push'](_0x3da187['shift']());}};_0x18fd45(++_0x527af0);}(_0xaab2,0xca));var _0x2aab=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xaab2[_0x543084];return _0x306a57;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x2aab('0x0'),'E_AGI_ARGUMENT_PORT':_0x2aab('0x1'),'E_AGI_SERVER_ERROR':_0x2aab('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x2aab('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x2aab('0x4'),'E_AGI_SOCKET_ERROR':_0x2aab('0x5'),'E_AGI_SOCKET_CLOSE':_0x2aab('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x2aab('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2aab('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3af395){var _0x3af395=_0x3af395||null,_0x4fe8a5=_0x4fe8a5||[],_0x2970cb=0x1,_0x494216='';if(!error[_0x3af395]){_0x3af395=_0x2aab('0x9');}_0x4fe8a5[_0x2aab('0xa')](error[_0x3af395]);while(arguments[_0x2970cb]){_0x4fe8a5[_0x2aab('0xa')](arguments[_0x2970cb]);_0x2970cb++;}_0x494216=util[_0x2aab('0xb')][_0x2aab('0xc')](util,_0x4fe8a5);this[_0x2aab('0xd')]=_0x494216;this['name']=_0x3af395;}module['exports']=AGIError;
\ No newline at end of file
index 4a879ca..a3d49cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5fc=['traverseBFS','agicommand','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','push','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','menu','invalid'];(function(_0x4806cb,_0x47405e){var _0x38dff4=function(_0xe6b248){while(--_0xe6b248){_0x4806cb['push'](_0x4806cb['shift']());}};_0x38dff4(++_0x47405e);}(_0xd5fc,0xae));var _0xcd5f=function(_0x472380,_0x2be408){_0x472380=_0x472380-0x0;var _0x30739f=_0xd5fc[_0x472380];return _0x30739f;};'use strict';var _=require(_0xcd5f('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=['menu',_0xcd5f('0x1'),_0xcd5f('0x2')];var Graph=function(){this[_0xcd5f('0x3')]={};this[_0xcd5f('0x4')]={};this[_0xcd5f('0x5')]=0x0;};Graph[_0xcd5f('0x6')]['addVertex']=function(_0x3eeb6b){this['vertices'][_0x3eeb6b['id']]=_0x3eeb6b;this[_0xcd5f('0x4')][_0x3eeb6b['id']]=[];};Graph[_0xcd5f('0x6')]['addEdge']=function(_0x58d65d,_0x4e668e,_0x102ce9){this['edges'][_0x58d65d][_0xcd5f('0x7')]({'target':_0x4e668e,'condition':_0x102ce9});this[_0xcd5f('0x5')]+=0x1;};Graph['prototype'][_0xcd5f('0x8')]=function(){return _['size'](this[_0xcd5f('0x3')]);};Graph['prototype'][_0xcd5f('0x9')]=function(){return this[_0xcd5f('0x5')];};Graph[_0xcd5f('0x6')][_0xcd5f('0xa')]=function(_0x53a250){return this[_0xcd5f('0x3')][_0x53a250];};Graph[_0xcd5f('0x6')]['traverseBFS']=function(_0x14125f,_0x2c23a7){if(!this[_0xcd5f('0x3')][_0x14125f]){return logger[_0xcd5f('0xb')](_0xcd5f('0xc'));}var _0x4d2d39=_0x2c23a7(this[_0xcd5f('0x3')][_0x14125f]);if(!_0x4d2d39){return logger[_0xcd5f('0xb')](_0xcd5f('0xd'));}if(this[_0xcd5f('0x4')][_0x14125f][_0xcd5f('0xe')]===0x0){return logger[_0xcd5f('0xb')](_0xcd5f('0xf'));}for(var _0x503ab6=0x0,_0x398e16=[],_0x33ab1a=![];_0x503ab6<this[_0xcd5f('0x4')][_0x14125f][_0xcd5f('0xe')];_0x503ab6+=0x1){if(this['edges'][_0x14125f][_0x503ab6][_0xcd5f('0x10')]){_0x398e16=this['edges'][_0x14125f][_0x503ab6][_0xcd5f('0x10')][_0xcd5f('0x11')](',');for(var _0x48d5bb=0x0;_0x48d5bb<_0x398e16[_0xcd5f('0xe')];_0x48d5bb+=0x1){if(this[_0xcd5f('0x3')][_0x14125f]['agicommand']===_0xcd5f('0x12')&&_0x398e16[_0x48d5bb]==='-'){_0x33ab1a=this['edges'][_0x14125f][_0x503ab6][_0xcd5f('0x13')];logger['info']('default',_0x398e16[_0x48d5bb],this[_0xcd5f('0x4')][_0x14125f][_0x503ab6]['target']);}else if(this['vertices'][_0x14125f]['agicommand']===_0xcd5f('0x14')&&_0x398e16[_0x48d5bb]==='i'){_0x33ab1a=this['edges'][_0x14125f][_0x503ab6][_0xcd5f('0x13')];logger[_0xcd5f('0xb')](_0xcd5f('0x15'),_0x398e16[_0x48d5bb],this[_0xcd5f('0x4')][_0x14125f][_0x503ab6][_0xcd5f('0x13')]);}if(_0x398e16[_0x48d5bb]===_0x4d2d39){return this['traverseBFS'](this[_0xcd5f('0x4')][_0x14125f][_0x503ab6][_0xcd5f('0x13')],_0x2c23a7);}}}else{return this[_0xcd5f('0x16')](this[_0xcd5f('0x4')][_0x14125f][_0x503ab6][_0xcd5f('0x13')],_0x2c23a7);}}if(_0x398e16[_0xcd5f('0xe')]){if(this[_0xcd5f('0x3')][_0x14125f][_0xcd5f('0x17')]===_0xcd5f('0x12')){if(_0x33ab1a){return this[_0xcd5f('0x16')](_0x33ab1a,_0x2c23a7);}return logger[_0xcd5f('0xb')](_0xcd5f('0x18'));}else if(_[_0xcd5f('0x19')](verticesWithRetry,this[_0xcd5f('0x3')][_0x14125f][_0xcd5f('0x17')])){if(_0x4d2d39==='-'){return logger[_0xcd5f('0xb')](_0xcd5f('0x1a'));}if(_0x33ab1a&&_0x4d2d39!=='t'){return this['traverseBFS'](_0x33ab1a,_0x2c23a7);}return this[_0xcd5f('0x16')](_0x14125f,_0x2c23a7);}return logger[_0xcd5f('0xb')]('condition\x20not\x20found');}};module[_0xcd5f('0x1b')]=Graph;
\ No newline at end of file
+var _0x0565=['agicommand','vswitch','target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','push','size','relations','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split'];(function(_0x8c49c3,_0x27d179){var _0x2d6e46=function(_0x28661b){while(--_0x28661b){_0x8c49c3['push'](_0x8c49c3['shift']());}};_0x2d6e46(++_0x27d179);}(_0x0565,0xf2));var _0x5056=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x0565[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0x5056('0x0'));var logger=require(_0x5056('0x1'))(_0x5056('0x2'));var verticesWithRetry=[_0x5056('0x3'),_0x5056('0x4'),_0x5056('0x5')];var Graph=function(){this[_0x5056('0x6')]={};this[_0x5056('0x7')]={};this[_0x5056('0x8')]=0x0;};Graph[_0x5056('0x9')]['addVertex']=function(_0x946e96){this[_0x5056('0x6')][_0x946e96['id']]=_0x946e96;this[_0x5056('0x7')][_0x946e96['id']]=[];};Graph[_0x5056('0x9')]['addEdge']=function(_0x52b01f,_0x38f74,_0x223c92){this[_0x5056('0x7')][_0x52b01f][_0x5056('0xa')]({'target':_0x38f74,'condition':_0x223c92});this[_0x5056('0x8')]+=0x1;};Graph[_0x5056('0x9')][_0x5056('0xb')]=function(){return _[_0x5056('0xb')](this['vertices']);};Graph[_0x5056('0x9')][_0x5056('0xc')]=function(){return this[_0x5056('0x8')];};Graph['prototype']['getVertex']=function(_0x17f43e){return this['vertices'][_0x17f43e];};Graph['prototype']['traverseBFS']=function(_0x2d44fb,_0x4b183a){if(!this[_0x5056('0x6')][_0x2d44fb]){return logger[_0x5056('0xd')](_0x5056('0xe'));}var _0x543cee=_0x4b183a(this[_0x5056('0x6')][_0x2d44fb]);if(!_0x543cee){return logger[_0x5056('0xd')](_0x5056('0xf'));}if(this[_0x5056('0x7')][_0x2d44fb][_0x5056('0x10')]===0x0){return logger[_0x5056('0xd')]('no\x20edge/s\x20available');}for(var _0x2b7a17=0x0,_0x560d1e=[],_0x43db77=![];_0x2b7a17<this[_0x5056('0x7')][_0x2d44fb][_0x5056('0x10')];_0x2b7a17+=0x1){if(this[_0x5056('0x7')][_0x2d44fb][_0x2b7a17][_0x5056('0x11')]){_0x560d1e=this['edges'][_0x2d44fb][_0x2b7a17][_0x5056('0x11')][_0x5056('0x12')](',');for(var _0x4f8fa7=0x0;_0x4f8fa7<_0x560d1e['length'];_0x4f8fa7+=0x1){if(this[_0x5056('0x6')][_0x2d44fb][_0x5056('0x13')]===_0x5056('0x14')&&_0x560d1e[_0x4f8fa7]==='-'){_0x43db77=this[_0x5056('0x7')][_0x2d44fb][_0x2b7a17][_0x5056('0x15')];logger[_0x5056('0xd')](_0x5056('0x16'),_0x560d1e[_0x4f8fa7],this['edges'][_0x2d44fb][_0x2b7a17][_0x5056('0x15')]);}else if(this[_0x5056('0x6')][_0x2d44fb]['agicommand']===_0x5056('0x3')&&_0x560d1e[_0x4f8fa7]==='i'){_0x43db77=this[_0x5056('0x7')][_0x2d44fb][_0x2b7a17][_0x5056('0x15')];logger['info'](_0x5056('0x17'),_0x560d1e[_0x4f8fa7],this[_0x5056('0x7')][_0x2d44fb][_0x2b7a17]['target']);}if(_0x560d1e[_0x4f8fa7]===_0x543cee){return this['traverseBFS'](this[_0x5056('0x7')][_0x2d44fb][_0x2b7a17][_0x5056('0x15')],_0x4b183a);}}}else{return this[_0x5056('0x18')](this[_0x5056('0x7')][_0x2d44fb][_0x2b7a17]['target'],_0x4b183a);}}if(_0x560d1e[_0x5056('0x10')]){if(this[_0x5056('0x6')][_0x2d44fb]['agicommand']===_0x5056('0x14')){if(_0x43db77){return this['traverseBFS'](_0x43db77,_0x4b183a);}return logger[_0x5056('0xd')](_0x5056('0x19'));}else if(_[_0x5056('0x1a')](verticesWithRetry,this[_0x5056('0x6')][_0x2d44fb][_0x5056('0x13')])){if(_0x543cee==='-'){return logger['info'](_0x5056('0x1b'));}if(_0x43db77&&_0x543cee!=='t'){return this[_0x5056('0x18')](_0x43db77,_0x4b183a);}return this[_0x5056('0x18')](_0x2d44fb,_0x4b183a);}return logger[_0x5056('0xd')]('condition\x20not\x20found');}};module[_0x5056('0x1c')]=Graph;
\ No newline at end of file
index d52b1ac..338dc4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc03e=['port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','value','getSquareProject','then','createSquareReport','catch','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','toString','finally','vertex','isUndefined','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','connection','xml2json','util','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x58e302,_0x1bb64a){var _0x17306b=function(_0x1ccc63){while(--_0x1ccc63){_0x58e302['push'](_0x58e302['shift']());}};_0x17306b(++_0x1bb64a);}(_0xc03e,0x15a));var _0xec03=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0xc03e[_0x4429e0];return _0x51a5b3;};'use strict';var parser=require(_0xec03('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0xec03('0x1'));var moment=require('moment');var config=require(_0xec03('0x2'));var logger=require('../../config/logger')(_0xec03('0x3'));var utilLicense=require(_0xec03('0x4'));var rpc=require(_0xec03('0x5'));var mailRpc=require(_0xec03('0x6'));var Graph=require(_0xec03('0x7'));var Vertices=require(_0xec03('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xec03('0x3')]=_[_0xec03('0x9')](config[_0xec03('0x3')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x4205e9){process[_0xec03('0xa')](function(){syncho(function(){try{setChannelVariables(_0x4205e9);agiHandler(_0x4205e9);}catch(_0xde3f78){logger[_0xec03('0xb')](_0xde3f78['stack']);}});});}function listeningHandler(){console[_0xec03('0xc')](_0xec03('0xd'),config[_0xec03('0x3')][_0xec03('0xe')]);logger[_0xec03('0xf')](util[_0xec03('0x10')](_0xec03('0x11'),config[_0xec03('0x3')]['ip'],config['agi'][_0xec03('0xe')]));}function errorHandler(_0x190f46){if(_0x190f46&&_0x190f46[_0xec03('0x12')]&&_0x190f46[_0xec03('0x13')]){logger[_0xec03('0xb')](util[_0xec03('0x10')](_0xec03('0x14'),_0x190f46[_0xec03('0x12')],_0x190f46['message']));}else{logger['error'](util['format'](_0xec03('0x15'),_0x190f46[_0xec03('0x16')]));}}function closeHandler(){logger[_0xec03('0xf')](util[_0xec03('0x10')](_0xec03('0x17'),this[_0xec03('0x18')],this[_0xec03('0x19')],this[_0xec03('0x1a')],this['dnid'],this[_0xec03('0x1b')]));try{createSquareReport(this);}catch(_0x52f6ae){logger[_0xec03('0xb')](_0x52f6ae['stack']);}}function timeoutHandler(){logger[_0xec03('0xf')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xec03('0x18')],this[_0xec03('0x19')],this[_0xec03('0x1a')],this[_0xec03('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0xec03('0xf')](util['format'](_0xec03('0x1d'),this[_0xec03('0x18')],this[_0xec03('0x19')],this[_0xec03('0x1a')],this[_0xec03('0x1c')],this[_0xec03('0x1b')]));this[_0xec03('0x1e')]=!![];}function getRoot(_0x3b6ddf){return parser['toJson'](_0x3b6ddf,{'object':!![]})[_0xec03('0x1f')][_0xec03('0x20')];}function addVertex(_0xa16d53,_0x76b813,_0x33de1e){_0x76b813[_0xec03('0x21')]=_0x33de1e;if(_0x76b813['hasOwnProperty'](_0xec03('0x22'))){_0x76b813[_0xec03('0x23')]=parseInt(_0x76b813['retry'],0xa);}_0xa16d53[_0xec03('0x24')](_[_0xec03('0x25')](_0x76b813,_0xec03('0x26')));}function initGraph(_0x445452,_0x1c6870){var _0x581322=new Graph();for(var _0x73cc4f in _0x445452){if(_0x445452[_0xec03('0x27')](_0x73cc4f)){if(_[_0xec03('0x28')](_0x445452[_0x73cc4f])){for(var _0x11a6b6=0x0;_0x11a6b6<_0x445452[_0x73cc4f][_0xec03('0x29')];_0x11a6b6+=0x1){addVertex(_0x581322,_0x445452[_0x73cc4f][_0x11a6b6],_0x73cc4f);}}else{addVertex(_0x581322,_0x445452[_0x73cc4f],_0x73cc4f);}}}for(var _0x58621e=0x0;_0x58621e<_0x1c6870[_0xec03('0x29')];_0x58621e+=0x1){if(_0x1c6870[_0x58621e][_0xec03('0x2a')]&&_0x1c6870[_0x58621e]['target']){_0x581322['addEdge'](_0x1c6870[_0x58621e][_0xec03('0x2a')],_0x1c6870[_0x58621e][_0xec03('0x2b')],_0x1c6870[_0x58621e][_0xec03('0x2c')]);}}return _0x581322;}function getSquareProject(_0x872f98,_0x39f6d8){rpc[_0xec03('0x2d')](_0x872f98)[_0xec03('0x2e')](function(_0x28753c){_0x39f6d8(null,_0x28753c);})['catch'](function(_0x28f60c){_0x39f6d8(null,_0x28f60c);});}function createSquareReport(_0x31c08d,_0x2bd889){rpc[_0xec03('0x2f')](_0x31c08d)[_0xec03('0x2e')](function(_0xa06cb6){if(_0x2bd889){_0x2bd889(null,_0xa06cb6);}})[_0xec03('0x30')](function(_0x30d592){if(_0x2bd889){_0x2bd889(null,_0x30d592);}});}function setChannelVariables(_0x159875){for(var _0x4a4d6a in _0x159875){if(_0x159875['hasOwnProperty'](_0x4a4d6a)){if(_0x4a4d6a['indexOf'](_0xec03('0x31'))===0x0){_0x159875[_0x4a4d6a[_0xec03('0x32')](0x4)]=_0x159875[_0x4a4d6a];delete _0x159875[_0x4a4d6a];}}}}function getLogFromObject(_0xdfd244){return util[_0xec03('0x33')](_0xdfd244,{'showHidden':![],'depth':null});}function agiHandler(_0x5b9549){var _0x576d5e,_0x4c0de1,_0x487b08,_0x356a76,_0x3def6c;logger[_0xec03('0x34')](_0xec03('0x35'),JSON[_0xec03('0x36')](_0x5b9549,null,0x2));logger[_0xec03('0xf')](util[_0xec03('0x10')](_0xec03('0x37'),_0x5b9549[_0xec03('0x18')],_0x5b9549[_0xec03('0x19')],_0x5b9549[_0xec03('0x1a')],_0x5b9549[_0xec03('0x1c')],_0x5b9549['uniqueid']));_0x5b9549['on'](_0xec03('0xb'),errorHandler);_0x5b9549['on'](_0xec03('0x38'),closeHandler);_0x5b9549['on'](_0xec03('0x39'),timeoutHandler);_0x5b9549['evtHangup']=![];_0x5b9549['on'](_0xec03('0x3a'),hangupHandler);var _0x159208=getSquareProject[_0xec03('0x3b')](null,_0x5b9549[_0xec03('0x18')]);if(_0x159208){if(_0x159208[_0xec03('0x3c')]){_0x576d5e=getRoot(_0x159208[_0xec03('0x3c')]);if(_0x576d5e&&_0x576d5e[_0xec03('0x3d')]){logger[_0xec03('0x34')](_0xec03('0x20'),JSON[_0xec03('0x36')](_0x576d5e,null,0x2));_0x5b9549[_0xec03('0x3e')]=moment()['format'](_0xec03('0x3f'));_0x4c0de1=initGraph(_[_0xec03('0x25')](_0x576d5e,_0xec03('0x26')),_0x576d5e[_0xec03('0x26')]);_0x487b08=new Vertices(_0x5b9549,rpc,mailRpc);logger[_0xec03('0xf')](util[_0xec03('0x10')](_0xec03('0x40'),_0x5b9549[_0xec03('0x18')],_0x5b9549['calleridname'],_0x5b9549[_0xec03('0x1a')],_0x5b9549['dnid'],_0x5b9549['uniqueid']));_0x4c0de1[_0xec03('0x41')](_0x576d5e['start']['id'],function(_0x548b81){try{_0x548b81=_0x487b08[_0xec03('0x42')](_0x548b81);logger[_0xec03('0x34')]('vertex',JSON[_0xec03('0x36')](_0x548b81,null,0x2));if(_0x548b81['agicommand']==='gotoc'){logger['info'](_0xec03('0x43'));_0x5b9549[_0xec03('0x44')]=_0x548b81[_0xec03('0x44')]||_0x5b9549[_0xec03('0x44')];_0x5b9549['extension']=_0x548b81[_0xec03('0x45')];_0x5b9549[_0xec03('0x46')]=_0x548b81[_0xec03('0x46')]?_0x548b81[_0xec03('0x46')]-0x1:0x1;return null;}else if(_0x548b81&&_0x487b08[_0x548b81[_0xec03('0x21')]]){_0x3def6c=_0x487b08[_0x548b81[_0xec03('0x21')]](_0x548b81);logger[_0xec03('0xf')](_0xec03('0x47'),JSON[_0xec03('0x36')](_0x3def6c,null,0x2));if(_0x3def6c&&_0x3def6c['code']===AGI_CODE_SUCCESS&&_0x3def6c[_0xec03('0x48')]!==AGI_RESULT_ERROR&&!_0x5b9549[_0xec03('0x1e')]){logger[_0xec03('0x34')](_0xec03('0x47'),getLogFromObject(_0x3def6c));return _['isUndefined'](_0x3def6c[_0xec03('0x48')])?null:_0x3def6c[_0xec03('0x48')][_0xec03('0x49')]();}else{logger[_0xec03('0xb')](_0xec03('0x47'),getLogFromObject(_0x3def6c));return null;}}else{logger[_0xec03('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x5263fd){logger[_0xec03('0xb')](_0x5263fd[_0xec03('0x16')]);return null;}});if(_0x576d5e[_0xec03('0x4a')]){logger[_0xec03('0xf')](util[_0xec03('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5b9549['arg_1'],_0x5b9549[_0xec03('0x19')],_0x5b9549['callerid'],_0x5b9549[_0xec03('0x1c')],_0x5b9549[_0xec03('0x1b')]));_0x4c0de1[_0xec03('0x41')](_0x576d5e[_0xec03('0x4a')]['id'],function(_0x58e200){try{_0x58e200=_0x487b08[_0xec03('0x42')](_0x58e200);logger[_0xec03('0x34')](_0xec03('0x4b'),JSON[_0xec03('0x36')](_0x58e200,null,0x2));if(_0x58e200&&_0x487b08[_0x58e200['agicommand']]){_0x3def6c=_0x487b08[_0x58e200[_0xec03('0x21')]](_0x58e200);if(_0x3def6c){logger['debug'](_0xec03('0x47'),getLogFromObject(_0x3def6c));return _[_0xec03('0x4c')](_0x3def6c[_0xec03('0x48')])?null:_0x3def6c[_0xec03('0x48')][_0xec03('0x49')]();}else{logger[_0xec03('0xb')](_0xec03('0x47'),getLogFromObject(_0x3def6c));return null;}}else{logger['error'](_0xec03('0x4d'));return null;}}catch(_0x177d18){logger[_0xec03('0xb')](_0x177d18[_0xec03('0x16')]);return null;}});}logger['info'](util[_0xec03('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5b9549[_0xec03('0x18')],_0x5b9549[_0xec03('0x19')],_0x5b9549[_0xec03('0x1a')],_0x5b9549[_0xec03('0x1c')],_0x5b9549['uniqueid']));logger[_0xec03('0xf')](util[_0xec03('0x10')](_0xec03('0x4e'),_0x5b9549[_0xec03('0x44')],_0x5b9549[_0xec03('0x45')],parseInt(_0x5b9549['priority'],0xa)+0x1));_0x5b9549[_0xec03('0x4f')](_0x5b9549[_0xec03('0x44')],_0x5b9549[_0xec03('0x45')],parseInt(_0x5b9549['priority'],0xa)+0x1);_0x5b9549['close']();}}else{logger[_0xec03('0xb')](util[_0xec03('0x10')](_0xec03('0x50'),_0x5b9549[_0xec03('0x18')]));_0x5b9549['continueAt'](_0x5b9549[_0xec03('0x44')],_0x5b9549[_0xec03('0x45')],parseInt(_0x5b9549[_0xec03('0x46')],0xa)+0x1);_0x5b9549[_0xec03('0x38')]();}}else{logger['error'](util[_0xec03('0x10')](_0xec03('0x51'),_0x5b9549[_0xec03('0x18')]));_0x5b9549[_0xec03('0x4f')](_0x5b9549[_0xec03('0x44')],_0x5b9549[_0xec03('0x45')],parseInt(_0x5b9549[_0xec03('0x46')],0xa)+0x1);_0x5b9549[_0xec03('0x38')]();}}function main(){var _0x5721b6;return utilLicense[_0xec03('0x52')]()[_0xec03('0x2e')](function(_0x2c6ca9){if(_0x2c6ca9){if(_0x2c6ca9[_0xec03('0x53')]){if(_0x2c6ca9['callysquare']&&_0x2c6ca9[_0xec03('0x54')]>0x0){logger[_0xec03('0xf')](util[_0xec03('0x10')](_0xec03('0x55'),_0x2c6ca9['callysquare']));_0x5721b6=_0x2c6ca9[_0xec03('0x54')];}else{logger[_0xec03('0xf')](_0xec03('0x56'));}}else{logger[_0xec03('0xf')](_0xec03('0x57'));_0x5721b6=-0x1;}}})[_0xec03('0x30')](function(_0x1f9272){logger[_0xec03('0xb')]('[LICENSE]',_0x1f9272[_0xec03('0x16')]);})['finally'](function(){var _0x1c395f=require('./server')(config[_0xec03('0x3')][_0xec03('0xe')],config[_0xec03('0x3')]['ip'],_0x5721b6);_0x1c395f['on'](_0xec03('0xb'),errorHandler);_0x1c395f['on'](_0xec03('0x58'),listeningHandler);_0x1c395f['on'](_0xec03('0x59'),connectionHandler);_0x1c395f['on'](_0xec03('0x38'),closeHandler);});}main();
\ No newline at end of file
+var _0x2494=['value','getSquareProject','then','indexOf','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','finally','./server','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','error','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','arg_1','uniqueid','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source'];(function(_0x2678d6,_0x4e2001){var _0x475503=function(_0x34b23d){while(--_0x34b23d){_0x2678d6['push'](_0x2678d6['shift']());}};_0x475503(++_0x4e2001);}(_0x2494,0x82));var _0x4249=function(_0x1c6de2,_0x42cfa2){_0x1c6de2=_0x1c6de2-0x0;var _0x5450c0=_0x2494[_0x1c6de2];return _0x5450c0;};'use strict';var parser=require(_0x4249('0x0'));var _=require('lodash');var syncho=require(_0x4249('0x1'));var util=require(_0x4249('0x2'));var moment=require(_0x4249('0x3'));var config=require(_0x4249('0x4'));var logger=require(_0x4249('0x5'))(_0x4249('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x4249('0x7'));var Graph=require('./graph');var Vertices=require(_0x4249('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x4249('0x6')]=_[_0x4249('0x9')](config['agi'],{'ip':_0x4249('0xa'),'port':0x11dd});function connectionHandler(_0x2b7934){process[_0x4249('0xb')](function(){syncho(function(){try{setChannelVariables(_0x2b7934);agiHandler(_0x2b7934);}catch(_0x58529b){logger['error'](_0x58529b[_0x4249('0xc')]);}});});}function listeningHandler(){console[_0x4249('0xd')](_0x4249('0xe'),config[_0x4249('0x6')][_0x4249('0xf')]);logger[_0x4249('0x10')](util[_0x4249('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x4249('0x6')]['port']));}function errorHandler(_0xc4ae35){if(_0xc4ae35&&_0xc4ae35[_0x4249('0x12')]&&_0xc4ae35['message']){logger[_0x4249('0x13')](util[_0x4249('0x11')]('[%s]\x20%s',_0xc4ae35[_0x4249('0x12')],_0xc4ae35[_0x4249('0x14')]));}else{logger[_0x4249('0x13')](util[_0x4249('0x11')](_0x4249('0x15'),_0xc4ae35[_0x4249('0xc')]));}}function closeHandler(){logger['info'](util[_0x4249('0x11')](_0x4249('0x16'),this['arg_1'],this[_0x4249('0x17')],this['callerid'],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x39a6df){logger[_0x4249('0x13')](_0x39a6df[_0x4249('0xc')]);}}function timeoutHandler(){logger[_0x4249('0x10')](util[_0x4249('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x4249('0x17')],this[_0x4249('0x18')],this[_0x4249('0x19')],this['uniqueid']));}function hangupHandler(){logger[_0x4249('0x10')](util[_0x4249('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x4249('0x1a')],this['calleridname'],this[_0x4249('0x18')],this[_0x4249('0x19')],this[_0x4249('0x1b')]));this[_0x4249('0x1c')]=!![];}function getRoot(_0x42d0d9){return parser[_0x4249('0x1d')](_0x42d0d9,{'object':!![]})[_0x4249('0x1e')][_0x4249('0x1f')];}function addVertex(_0x4032f7,_0x15561d,_0x9da8){_0x15561d[_0x4249('0x20')]=_0x9da8;if(_0x15561d[_0x4249('0x21')](_0x4249('0x22'))){_0x15561d[_0x4249('0x23')]=parseInt(_0x15561d[_0x4249('0x22')],0xa);}_0x4032f7[_0x4249('0x24')](_[_0x4249('0x25')](_0x15561d,_0x4249('0x26')));}function initGraph(_0x357c84,_0x43dc25){var _0x1d4fb9=new Graph();for(var _0x4ce9af in _0x357c84){if(_0x357c84[_0x4249('0x21')](_0x4ce9af)){if(_[_0x4249('0x27')](_0x357c84[_0x4ce9af])){for(var _0x434160=0x0;_0x434160<_0x357c84[_0x4ce9af][_0x4249('0x28')];_0x434160+=0x1){addVertex(_0x1d4fb9,_0x357c84[_0x4ce9af][_0x434160],_0x4ce9af);}}else{addVertex(_0x1d4fb9,_0x357c84[_0x4ce9af],_0x4ce9af);}}}for(var _0x51e8b4=0x0;_0x51e8b4<_0x43dc25[_0x4249('0x28')];_0x51e8b4+=0x1){if(_0x43dc25[_0x51e8b4]['source']&&_0x43dc25[_0x51e8b4][_0x4249('0x29')]){_0x1d4fb9[_0x4249('0x2a')](_0x43dc25[_0x51e8b4][_0x4249('0x2b')],_0x43dc25[_0x51e8b4]['target'],_0x43dc25[_0x51e8b4][_0x4249('0x2c')]);}}return _0x1d4fb9;}function getSquareProject(_0x3b3cb5,_0x5afc2f){rpc[_0x4249('0x2d')](_0x3b3cb5)['then'](function(_0x4e7761){_0x5afc2f(null,_0x4e7761);})['catch'](function(_0x53182d){_0x5afc2f(null,_0x53182d);});}function createSquareReport(_0x2f51c0,_0x46e92a){rpc['createSquareReport'](_0x2f51c0)[_0x4249('0x2e')](function(_0x42d96a){if(_0x46e92a){_0x46e92a(null,_0x42d96a);}})['catch'](function(_0x2f67b2){if(_0x46e92a){_0x46e92a(null,_0x2f67b2);}});}function setChannelVariables(_0x49f975){for(var _0x4aad35 in _0x49f975){if(_0x49f975[_0x4249('0x21')](_0x4aad35)){if(_0x4aad35[_0x4249('0x2f')](_0x4249('0x30'))===0x0){_0x49f975[_0x4aad35['substring'](0x4)]=_0x49f975[_0x4aad35];delete _0x49f975[_0x4aad35];}}}}function getLogFromObject(_0x30db4e){return util['inspect'](_0x30db4e,{'showHidden':![],'depth':null});}function agiHandler(_0x4dde8a){var _0x3e41a8,_0xaf3ba5,_0x563ac0,_0x492e07,_0x461d97;logger[_0x4249('0x31')](_0x4249('0x32'),JSON[_0x4249('0x33')](_0x4dde8a,null,0x2));logger[_0x4249('0x10')](util[_0x4249('0x11')](_0x4249('0x34'),_0x4dde8a[_0x4249('0x1a')],_0x4dde8a[_0x4249('0x17')],_0x4dde8a[_0x4249('0x18')],_0x4dde8a[_0x4249('0x19')],_0x4dde8a[_0x4249('0x1b')]));_0x4dde8a['on'](_0x4249('0x13'),errorHandler);_0x4dde8a['on'](_0x4249('0x35'),closeHandler);_0x4dde8a['on'](_0x4249('0x36'),timeoutHandler);_0x4dde8a['evtHangup']=![];_0x4dde8a['on']('hangup',hangupHandler);var _0x289f13=getSquareProject[_0x4249('0x37')](null,_0x4dde8a[_0x4249('0x1a')]);if(_0x289f13){if(_0x289f13[_0x4249('0x38')]){_0x3e41a8=getRoot(_0x289f13['production']);if(_0x3e41a8&&_0x3e41a8[_0x4249('0x39')]){logger[_0x4249('0x31')](_0x4249('0x1f'),JSON[_0x4249('0x33')](_0x3e41a8,null,0x2));_0x4dde8a[_0x4249('0x3a')]=moment()[_0x4249('0x11')](_0x4249('0x3b'));_0xaf3ba5=initGraph(_[_0x4249('0x25')](_0x3e41a8,_0x4249('0x26')),_0x3e41a8[_0x4249('0x26')]);_0x563ac0=new Vertices(_0x4dde8a,rpc,mailRpc);logger['info'](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4dde8a[_0x4249('0x1a')],_0x4dde8a[_0x4249('0x17')],_0x4dde8a[_0x4249('0x18')],_0x4dde8a[_0x4249('0x19')],_0x4dde8a['uniqueid']));_0xaf3ba5[_0x4249('0x3c')](_0x3e41a8['start']['id'],function(_0xd71464){try{_0xd71464=_0x563ac0[_0x4249('0x3d')](_0xd71464);logger['debug'](_0x4249('0x3e'),JSON[_0x4249('0x33')](_0xd71464,null,0x2));if(_0xd71464[_0x4249('0x20')]===_0x4249('0x3f')){logger[_0x4249('0x10')](_0x4249('0x40'));_0x4dde8a[_0x4249('0x41')]=_0xd71464[_0x4249('0x41')]||_0x4dde8a[_0x4249('0x41')];_0x4dde8a[_0x4249('0x42')]=_0xd71464['extension'];_0x4dde8a[_0x4249('0x43')]=_0xd71464[_0x4249('0x43')]?_0xd71464[_0x4249('0x43')]-0x1:0x1;return null;}else if(_0xd71464&&_0x563ac0[_0xd71464[_0x4249('0x20')]]){_0x461d97=_0x563ac0[_0xd71464[_0x4249('0x20')]](_0xd71464);logger[_0x4249('0x10')](_0x4249('0x44'),JSON[_0x4249('0x33')](_0x461d97,null,0x2));if(_0x461d97&&_0x461d97[_0x4249('0x45')]===AGI_CODE_SUCCESS&&_0x461d97[_0x4249('0x46')]!==AGI_RESULT_ERROR&&!_0x4dde8a[_0x4249('0x1c')]){logger['debug'](_0x4249('0x44'),getLogFromObject(_0x461d97));return _[_0x4249('0x47')](_0x461d97[_0x4249('0x46')])?null:_0x461d97[_0x4249('0x46')][_0x4249('0x48')]();}else{logger[_0x4249('0x13')]('response',getLogFromObject(_0x461d97));return null;}}else{logger[_0x4249('0x13')](_0x4249('0x49'));return null;}}catch(_0x4e5651){logger[_0x4249('0x13')](_0x4e5651[_0x4249('0xc')]);return null;}});if(_0x3e41a8['finally']){logger[_0x4249('0x10')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4dde8a[_0x4249('0x1a')],_0x4dde8a['calleridname'],_0x4dde8a[_0x4249('0x18')],_0x4dde8a[_0x4249('0x19')],_0x4dde8a[_0x4249('0x1b')]));_0xaf3ba5[_0x4249('0x3c')](_0x3e41a8['finally']['id'],function(_0x474d64){try{_0x474d64=_0x563ac0[_0x4249('0x3d')](_0x474d64);logger['debug'](_0x4249('0x3e'),JSON[_0x4249('0x33')](_0x474d64,null,0x2));if(_0x474d64&&_0x563ac0[_0x474d64[_0x4249('0x20')]]){_0x461d97=_0x563ac0[_0x474d64[_0x4249('0x20')]](_0x474d64);if(_0x461d97){logger[_0x4249('0x31')](_0x4249('0x44'),getLogFromObject(_0x461d97));return _[_0x4249('0x47')](_0x461d97[_0x4249('0x46')])?null:_0x461d97[_0x4249('0x46')][_0x4249('0x48')]();}else{logger[_0x4249('0x13')]('response',getLogFromObject(_0x461d97));return null;}}else{logger[_0x4249('0x13')](_0x4249('0x49'));return null;}}catch(_0x1787f6){logger[_0x4249('0x13')](_0x1787f6['stack']);return null;}});}logger['info'](util[_0x4249('0x11')](_0x4249('0x4a'),_0x4dde8a[_0x4249('0x1a')],_0x4dde8a[_0x4249('0x17')],_0x4dde8a[_0x4249('0x18')],_0x4dde8a[_0x4249('0x19')],_0x4dde8a['uniqueid']));logger['info'](util[_0x4249('0x11')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4dde8a[_0x4249('0x41')],_0x4dde8a['extension'],parseInt(_0x4dde8a[_0x4249('0x43')],0xa)+0x1));_0x4dde8a[_0x4249('0x4b')](_0x4dde8a['context'],_0x4dde8a[_0x4249('0x42')],parseInt(_0x4dde8a[_0x4249('0x43')],0xa)+0x1);_0x4dde8a['close']();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20published',_0x4dde8a[_0x4249('0x1a')]));_0x4dde8a[_0x4249('0x4b')](_0x4dde8a[_0x4249('0x41')],_0x4dde8a[_0x4249('0x42')],parseInt(_0x4dde8a[_0x4249('0x43')],0xa)+0x1);_0x4dde8a[_0x4249('0x35')]();}}else{logger[_0x4249('0x13')](util['format'](_0x4249('0x4c'),_0x4dde8a['arg_1']));_0x4dde8a['continueAt'](_0x4dde8a[_0x4249('0x41')],_0x4dde8a['extension'],parseInt(_0x4dde8a[_0x4249('0x43')],0xa)+0x1);_0x4dde8a[_0x4249('0x35')]();}}function main(){var _0x4cc6ab;return utilLicense['getLicense']()[_0x4249('0x2e')](function(_0x76adc2){if(_0x76adc2){if(_0x76adc2[_0x4249('0x4d')]){if(_0x76adc2[_0x4249('0x4e')]&&_0x76adc2[_0x4249('0x4e')]>0x0){logger[_0x4249('0x10')](util[_0x4249('0x11')](_0x4249('0x4f'),_0x76adc2['callysquare']));_0x4cc6ab=_0x76adc2['callysquare'];}else{logger[_0x4249('0x10')](_0x4249('0x50'));}}else{logger[_0x4249('0x10')](_0x4249('0x51'));_0x4cc6ab=-0x1;}}})[_0x4249('0x52')](function(_0x320da5){logger[_0x4249('0x13')](_0x4249('0x53'),_0x320da5[_0x4249('0xc')]);})[_0x4249('0x54')](function(){var _0x46bdc4=require(_0x4249('0x55'))(config[_0x4249('0x6')][_0x4249('0xf')],config['agi']['ip'],_0x4cc6ab);_0x46bdc4['on']('error',errorHandler);_0x46bdc4['on']('listening',listeningHandler);_0x46bdc4['on'](_0x4249('0x56'),connectionHandler);_0x46bdc4['on'](_0x4249('0x35'),closeHandler);});}main();
\ No newline at end of file
index 0a3a1f7..9a4b945 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x506b1c,_0x42e097){var _0x529b89=function(_0x5ccec1){while(--_0x5ccec1){_0x506b1c['push'](_0x506b1c['shift']());}};_0x529b89(++_0x42e097);}(_0x34e8,0x12c));var _0x834e=function(_0x3261f0,_0x1ab5c8){_0x3261f0=_0x3261f0-0x0;var _0xf61f4a=_0x34e8[_0x3261f0];return _0xf61f4a;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});};
\ No newline at end of file
+var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x1c17a6,_0x599e70){var _0xd95b44=function(_0x77f5a5){while(--_0x77f5a5){_0x1c17a6['push'](_0x1c17a6['shift']());}};_0xd95b44(++_0x599e70);}(_0x34e8,0x12c));var _0x834e=function(_0x34d35e,_0x26f04a){_0x34d35e=_0x34d35e-0x0;var _0x11fe9b=_0x34e8[_0x34d35e];return _0x11fe9b;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});};
\ No newline at end of file
index 5c5dfbd..c96aa5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0xc4c142,_0x392430){var _0x2c825e=function(_0xa91e6){while(--_0xa91e6){_0xc4c142['push'](_0xc4c142['shift']());}};_0x2c825e(++_0x392430);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3e12fe,_0x21cfdb){_0x3e12fe=_0x3e12fe-0x0;var _0x4211e4=_0x5f2f[_0x3e12fe];return _0x4211e4;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply;
\ No newline at end of file
+var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x3f176a,_0x57ab66){var _0x168314=function(_0x143255){while(--_0x143255){_0x3f176a['push'](_0x3f176a['shift']());}};_0x168314(++_0x57ab66);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18371d,_0xf7d926){_0x18371d=_0x18371d-0x0;var _0x48fedb=_0x5f2f[_0x18371d];return _0x48fedb;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply;
\ No newline at end of file
index 79eb7d3..f52417b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa847=['jayson/promise','http','request','then','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util'];(function(_0x3f540d,_0x41f5f4){var _0x3e2133=function(_0x5a11e5){while(--_0x5a11e5){_0x3f540d['push'](_0x3f540d['shift']());}};_0x3e2133(++_0x41f5f4);}(_0xa847,0xf0));var _0x7a84=function(_0x57dcdd,_0x5f56d2){_0x57dcdd=_0x57dcdd-0x0;var _0x252e7a=_0xa847[_0x57dcdd];return _0x252e7a;};'use strict';var BPromise=require(_0x7a84('0x0'));var moment=require(_0x7a84('0x1'));var _=require(_0x7a84('0x2'));var util=require(_0x7a84('0x3'));var jayson=require(_0x7a84('0x4'));var client=jayson['client'][_0x7a84('0x5')]({'port':0x2329});function request(_0x4940fd,_0x4994c6){return new BPromise(function(_0x3fd9d6,_0x47bfab){return client[_0x7a84('0x6')](_0x4940fd,_0x4994c6)[_0x7a84('0x7')](function(_0x1f66f3){if(_0x1f66f3['error']){return _0x47bfab(_0x1f66f3['error'][_0x7a84('0x8')]);}else{return _0x3fd9d6(_0x1f66f3[_0x7a84('0x9')]);}})[_0x7a84('0xa')](function(_0x2ee4bc){return _0x47bfab(_0x2ee4bc);});});}exports['getSquareProject']=function(_0x238ac7){return request(_0x7a84('0xb'),{'options':{'raw':![],'where':{'name':_0x238ac7},'attributes':[_0x7a84('0xc')]}});};exports[_0x7a84('0xd')]=function(_0x387b84){return request(_0x7a84('0xe'),{'options':{'raw':![],'where':{'id':_0x387b84},'include':[{'model':_0x7a84('0xf'),'as':_0x7a84('0x10')}],'attributes':['id',_0x7a84('0x11'),_0x7a84('0x12')]}});};exports[_0x7a84('0x13')]=function(_0x3afcab){return request(_0x7a84('0xb'),{'options':{'where':{'id':_0x3afcab},'attributes':[_0x7a84('0x11')]}});};exports[_0x7a84('0x14')]=function(_0x5a73d7){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5a73d7},'attributes':['name']}});};exports[_0x7a84('0x15')]=function(_0x3f3961){return request(_0x7a84('0x16'),{'options':{'where':{'id':_0x3f3961},'attributes':['name']}});};exports[_0x7a84('0x17')]=function(_0x51b985){return request(_0x7a84('0x18'),{'options':{'where':{'id':_0x51b985},'attributes':[_0x7a84('0x19')]}});};exports[_0x7a84('0x1a')]=function(_0x2caf11){return request('ShowUser',{'options':{'where':{'id':_0x2caf11},'attributes':[_0x7a84('0x11')]}});};exports[_0x7a84('0x1b')]=function(_0x22e14c){return request(_0x7a84('0x1c'),{'options':{'where':{'id':_0x22e14c},'attributes':['name']}});};exports[_0x7a84('0x1d')]=function(_0x27a3bb){return request(_0x7a84('0x1e'),{'options':{'where':{'id':_0x27a3bb},'attributes':['save_name']}});};exports[_0x7a84('0x1f')]=function(_0x277830){return request(_0x7a84('0x20'),{'options':{'raw':![],'where':{'id':_0x277830},'include':[{'model':_0x7a84('0x21'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x57bba0){return request('ShowSmsAccount',{'options':{'where':{'id':_0x57bba0},'attributes':['id','name']}});};exports[_0x7a84('0x22')]=function(_0x3ba5fa){return request(_0x7a84('0x23'),{'body':_0x3ba5fa});};exports[_0x7a84('0x24')]=function(_0x4c5bd9){return request(_0x7a84('0x25'),{'body':_0x4c5bd9});};exports['createSquareReport']=function(_0x2df604){return request(_0x7a84('0x26'),{'body':_['merge'](_0x2df604,{'project_name':_0x2df604[_0x7a84('0x27')],'prev_project_name':_0x2df604[_0x7a84('0x28')]||'','is_subproject':_0x2df604[_0x7a84('0x28')]?!![]:![],'leaveAt':moment()[_0x7a84('0x29')](_0x7a84('0x2a'))})});};exports[_0x7a84('0x2b')]=function(_0x49d209){return request(_0x7a84('0x2c'),{'body':_0x49d209});};exports['createSquareMessage']=function(_0x195439){return request(_0x7a84('0x2d'),{'body':_0x195439});};exports[_0x7a84('0x2e')]=function(_0x26e178){return request(_0x7a84('0x2f'),{'options':{'raw':![],'where':{'phone':_0x26e178[_0x7a84('0x30')],'ListId':_0x26e178[_0x7a84('0x31')]}}})[_0x7a84('0x7')](function(_0x4d5358){if(_0x4d5358){return _0x4d5358;}return request(_0x7a84('0x32'),{'body':_0x26e178});});};exports[_0x7a84('0x33')]=function(_0x5891c2){return request(_0x7a84('0x34'),{'options':{'where':{'id':_0x5891c2},'attributes':['name']}});};exports[_0x7a84('0x35')]=function(_0x2bd7a6,_0x17c8d1){return request(_0x7a84('0x36'),{'body':{'interface':_0x17c8d1},'options':{'where':_0x2bd7a6}});};exports[_0x7a84('0x37')]=function(_0x3281db,_0x4a0aed,_0x798d8b){return request(_0x7a84('0x38'),{'body':{'type':_0x4a0aed,'uniqueid':_0x798d8b},'options':{'where':_0x3281db}});};exports[_0x7a84('0x39')]=function(_0xdef633){return request(_0x7a84('0x3a'),{'body':{},'options':{'where':_0xdef633}});};exports[_0x7a84('0x3b')]=function(_0x338b17){return request(_0x7a84('0x3c'),{'body':{},'options':{'where':_0x338b17}});};
\ No newline at end of file
+var _0x0ad0=['error','result','catch','getSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowUser','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','jayson/promise','client','http','then'];(function(_0x56ba3f,_0x120321){var _0x7fc837=function(_0x236059){while(--_0x236059){_0x56ba3f['push'](_0x56ba3f['shift']());}};_0x7fc837(++_0x120321);}(_0x0ad0,0xa2));var _0x00ad=function(_0x5a6406,_0x394260){_0x5a6406=_0x5a6406-0x0;var _0x4c31d1=_0x0ad0[_0x5a6406];return _0x4c31d1;};'use strict';var BPromise=require(_0x00ad('0x0'));var moment=require(_0x00ad('0x1'));var _=require('lodash');var util=require('util');var jayson=require(_0x00ad('0x2'));var client=jayson[_0x00ad('0x3')][_0x00ad('0x4')]({'port':0x2329});function request(_0x21838e,_0x15d26d){return new BPromise(function(_0x543f1b,_0x2f3c00){return client['request'](_0x21838e,_0x15d26d)[_0x00ad('0x5')](function(_0x45e586){if(_0x45e586['error']){return _0x2f3c00(_0x45e586[_0x00ad('0x6')]['message']);}else{return _0x543f1b(_0x45e586[_0x00ad('0x7')]);}})[_0x00ad('0x8')](function(_0x214f5f){return _0x2f3c00(_0x214f5f);});});}exports[_0x00ad('0x9')]=function(_0x32e7a6){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x32e7a6},'attributes':[_0x00ad('0xa')]}});};exports[_0x00ad('0xb')]=function(_0x1a53ae){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1a53ae},'include':[{'model':_0x00ad('0xc'),'as':_0x00ad('0xd')}],'attributes':['id',_0x00ad('0xe'),_0x00ad('0xf')]}});};exports[_0x00ad('0x10')]=function(_0x5187f5){return request(_0x00ad('0x11'),{'options':{'where':{'id':_0x5187f5},'attributes':[_0x00ad('0xe')]}});};exports[_0x00ad('0x12')]=function(_0x1f5751){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1f5751},'attributes':[_0x00ad('0xe')]}});};exports[_0x00ad('0x13')]=function(_0xc50fc6){return request(_0x00ad('0x14'),{'options':{'where':{'id':_0xc50fc6},'attributes':['name']}});};exports[_0x00ad('0x15')]=function(_0x57d370){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x57d370},'attributes':['dsn']}});};exports['getUserById']=function(_0x9d4064){return request(_0x00ad('0x16'),{'options':{'where':{'id':_0x9d4064},'attributes':['name']}});};exports[_0x00ad('0x17')]=function(_0x56ebc2){return request(_0x00ad('0x18'),{'options':{'where':{'id':_0x56ebc2},'attributes':[_0x00ad('0xe')]}});};exports[_0x00ad('0x19')]=function(_0x58f200){return request('ShowSound',{'options':{'where':{'id':_0x58f200},'attributes':[_0x00ad('0x1a')]}});};exports[_0x00ad('0x1b')]=function(_0x57ad81){return request(_0x00ad('0x1c'),{'options':{'raw':![],'where':{'id':_0x57ad81},'include':[{'model':_0x00ad('0x1d'),'as':_0x00ad('0x1e')}]}});};exports[_0x00ad('0x1f')]=function(_0x42812c){return request('ShowSmsAccount',{'options':{'where':{'id':_0x42812c},'attributes':['id',_0x00ad('0xe')]}});};exports[_0x00ad('0x20')]=function(_0x5dbc93){return request('CreateSmsMessage',{'body':_0x5dbc93});};exports[_0x00ad('0x21')]=function(_0x1cc141){return request(_0x00ad('0x22'),{'body':_0x1cc141});};exports[_0x00ad('0x23')]=function(_0x93fe20){return request(_0x00ad('0x24'),{'body':_[_0x00ad('0x25')](_0x93fe20,{'project_name':_0x93fe20[_0x00ad('0x26')],'prev_project_name':_0x93fe20[_0x00ad('0x27')]||'','is_subproject':_0x93fe20[_0x00ad('0x27')]?!![]:![],'leaveAt':moment()['format'](_0x00ad('0x28'))})});};exports[_0x00ad('0x29')]=function(_0x497463){return request('CreateSquareRecording',{'body':_0x497463});};exports[_0x00ad('0x2a')]=function(_0x2f1714){return request(_0x00ad('0x2b'),{'body':_0x2f1714});};exports[_0x00ad('0x2c')]=function(_0x45424f){return request(_0x00ad('0x2d'),{'options':{'raw':![],'where':{'phone':_0x45424f['phone'],'ListId':_0x45424f['ListId']}}})['then'](function(_0x4b167d){if(_0x4b167d){return _0x4b167d;}return request(_0x00ad('0x2e'),{'body':_0x45424f});});};exports[_0x00ad('0x2f')]=function(_0x3d849c){return request('ShowPause',{'options':{'where':{'id':_0x3d849c},'attributes':[_0x00ad('0xe')]}});};exports[_0x00ad('0x30')]=function(_0x156242,_0x2eebd9){return request(_0x00ad('0x31'),{'body':{'interface':_0x2eebd9},'options':{'where':_0x156242}});};exports[_0x00ad('0x32')]=function(_0xbabe25,_0x1c4fc3,_0x4d2c6e){return request(_0x00ad('0x33'),{'body':{'type':_0x1c4fc3,'uniqueid':_0x4d2c6e},'options':{'where':_0xbabe25}});};exports[_0x00ad('0x34')]=function(_0x512b8a){return request(_0x00ad('0x35'),{'body':{},'options':{'where':_0x512b8a}});};exports[_0x00ad('0x36')]=function(_0x2028e6){return request(_0x00ad('0x37'),{'body':{},'options':{'where':_0x2028e6}});};
\ No newline at end of file
index d4cd82d..a38c6c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['./lex','./polly'];(function(_0x2f6d0d,_0x12fbba){var _0x42817e=function(_0x1ab268){while(--_0x1ab268){_0x2f6d0d['push'](_0x2f6d0d['shift']());}};_0x42817e(++_0x12fbba);}(_0xa41a,0x6b));var _0xaa41=function(_0x43138d,_0x1562f7){_0x43138d=_0x43138d-0x0;var _0x766047=_0xa41a[_0x43138d];return _0x766047;};var polly=require(_0xaa41('0x0'));var lex=require(_0xaa41('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x0ba7=['exports','./polly'];(function(_0x409ddd,_0x49d46c){var _0x1a4bb6=function(_0xf3cceb){while(--_0xf3cceb){_0x409ddd['push'](_0x409ddd['shift']());}};_0x1a4bb6(++_0x49d46c);}(_0x0ba7,0x16d));var _0x70ba=function(_0x29510c,_0x3594dc){_0x29510c=_0x29510c-0x0;var _0x558126=_0x0ba7[_0x29510c];return _0x558126;};var polly=require(_0x70ba('0x0'));var lex=require('./lex');module[_0x70ba('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 919712d..2f9d1a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89f7=['exports','./lib/api'];(function(_0x34ed1b,_0x93f80f){var _0x1f66fc=function(_0x3fc278){while(--_0x3fc278){_0x34ed1b['push'](_0x34ed1b['shift']());}};_0x1f66fc(++_0x93f80f);}(_0x89f7,0x105));var _0x789f=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0x89f7[_0x552fce];return _0x3e27a2;};'use strict';var lex=require(_0x789f('0x0'));module[_0x789f('0x1')]=function(_0x29c2db,_0x4b81a3,_0x2e09ac,_0x564d48,_0x1c55ac,_0x48fa02){return lex(_0x29c2db,_0x4b81a3,_0x2e09ac,_0x564d48,_0x1c55ac,_0x48fa02);};
\ No newline at end of file
+var _0x7794=['exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7794,0x7b));var _0x4779=function(_0x1d7932,_0x5e7bbd){_0x1d7932=_0x1d7932-0x0;var _0x4be1ac=_0x7794[_0x1d7932];return _0x4be1ac;};'use strict';var lex=require('./lib/api');module[_0x4779('0x0')]=function(_0x14e294,_0x330dc8,_0xa47992,_0x493318,_0x309b79,_0x1e9fdc){return lex(_0x14e294,_0x330dc8,_0xa47992,_0x493318,_0x309b79,_0x1e9fdc);};
\ No newline at end of file
index dada16d..729693b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb3=['hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird','postText','slots'];(function(_0x473fe5,_0x5b7c25){var _0x3a9139=function(_0x233c18){while(--_0x233c18){_0x473fe5['push'](_0x473fe5['shift']());}};_0x3a9139(++_0x5b7c25);}(_0xbdb3,0x1cd));var _0x3bdb=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xbdb3[_0x2dadb9];return _0x2f0097;};'use strict';var BPromise=require(_0x3bdb('0x0'));var AWS=require('aws-sdk');function lexResult(_0x41b5cd,_0x41b398){return new BPromise(function(_0x256231,_0x4db990){_0x41b5cd[_0x3bdb('0x1')](_0x41b398,function(_0x38d52d,_0x2aac9c){if(_0x38d52d){_0x4db990(_0x38d52d);}if(_0x2aac9c['slots']){for(const _0x5f1b12 in _0x2aac9c['slots']){if(_0x2aac9c[_0x3bdb('0x2')][_0x3bdb('0x3')](_0x5f1b12)){var _0x52e0c5=_0x2aac9c['slots'][_0x5f1b12];_0x2aac9c[_0x3bdb('0x4')+_0x5f1b12]=_0x52e0c5;}}}_0x256231(_0x2aac9c);});});}module[_0x3bdb('0x5')]=function(_0x86752,_0x117539,_0x3b6a37,_0x1e6404,_0x30156d,_0x579c0f){var _0x34eebb=new AWS[(_0x3bdb('0x6'))]({'accessKeyId':_0x117539,'secretAccessKey':_0x3b6a37,'region':_0x1e6404});var _0x765cd={'botAlias':_0x3bdb('0x7'),'botName':_0x579c0f,'inputText':_0x30156d,'userId':_0x86752};return lexResult(_0x34eebb,_0x765cd);};
\ No newline at end of file
+var _0xaf84=['$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty','LexRuntime'];(function(_0x11518f,_0x367253){var _0x34153f=function(_0x458e6c){while(--_0x458e6c){_0x11518f['push'](_0x11518f['shift']());}};_0x34153f(++_0x367253);}(_0xaf84,0x197));var _0x4af8=function(_0x1a61c1,_0x2f064d){_0x1a61c1=_0x1a61c1-0x0;var _0x2240bf=_0xaf84[_0x1a61c1];return _0x2240bf;};'use strict';var BPromise=require(_0x4af8('0x0'));var AWS=require(_0x4af8('0x1'));function lexResult(_0x500fd6,_0xf8b751){return new BPromise(function(_0x572d6f,_0x6ed413){_0x500fd6[_0x4af8('0x2')](_0xf8b751,function(_0x4d063a,_0x1561a1){if(_0x4d063a){_0x6ed413(_0x4d063a);}if(_0x1561a1[_0x4af8('0x3')]){for(const _0x47aaaa in _0x1561a1['slots']){if(_0x1561a1['slots'][_0x4af8('0x4')](_0x47aaaa)){var _0x52305a=_0x1561a1[_0x4af8('0x3')][_0x47aaaa];_0x1561a1['slot_'+_0x47aaaa]=_0x52305a;}}}_0x572d6f(_0x1561a1);});});}module['exports']=function(_0x1ff781,_0x372a7d,_0x461d82,_0x2b4673,_0x5b30e3,_0x118fc5){var _0x3af5ef=new AWS[(_0x4af8('0x5'))]({'accessKeyId':_0x372a7d,'secretAccessKey':_0x461d82,'region':_0x2b4673});var _0x408741={'botAlias':_0x4af8('0x6'),'botName':_0x118fc5,'inputText':_0x5b30e3,'userId':_0x1ff781};return lexResult(_0x3af5ef,_0x408741);};
\ No newline at end of file
index f445984..743c353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dbb=['exports','./lib/api'];(function(_0x200ded,_0x5cfa0e){var _0x4ed4a0=function(_0x17f1dd){while(--_0x17f1dd){_0x200ded['push'](_0x200ded['shift']());}};_0x4ed4a0(++_0x5cfa0e);}(_0x5dbb,0x177));var _0xb5db=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x5dbb[_0x344adc];return _0x4014b2;};'use strict';var polly=require(_0xb5db('0x0'));module[_0xb5db('0x1')]=function(_0x28bd0b,_0x31cf53,_0x537f96,_0x2bd6b6,_0x276279,_0xe9625b,_0x43f375){return polly(_0x28bd0b,_0x31cf53,_0x537f96,_0x2bd6b6,_0x276279,_0xe9625b,_0x43f375);};
\ No newline at end of file
+var _0x79a8=['./lib/api'];(function(_0x418624,_0x3e8880){var _0x41fc7e=function(_0x176c3b){while(--_0x176c3b){_0x418624['push'](_0x418624['shift']());}};_0x41fc7e(++_0x3e8880);}(_0x79a8,0x1d0));var _0x879a=function(_0x245ff8,_0x2e81f8){_0x245ff8=_0x245ff8-0x0;var _0x5a4faa=_0x79a8[_0x245ff8];return _0x5a4faa;};'use strict';var polly=require(_0x879a('0x0'));module['exports']=function(_0x244704,_0x11da0e,_0x3f1655,_0x5bb4c9,_0x27630f,_0x49b7c0,_0x46ee67){return polly(_0x244704,_0x11da0e,_0x3f1655,_0x5bb4c9,_0x27630f,_0x49b7c0,_0x46ee67);};
\ No newline at end of file
index 7c5107a..c439a11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65e4=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring','aws-sdk'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0x65e4,0x195));var _0x465e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x65e4[_0x3bf83f];return _0x22c4a9;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x465e('0x0'));var rs=require(_0x465e('0x1'));var AWS=require(_0x465e('0x2'));function pollyResult(_0x15b57e,_0x2e25f4,_0x4ed7bf){return new BPromise(function(_0x14ac20,_0x5cf59d){_0x15b57e[_0x465e('0x3')](_0x2e25f4,function(_0x3eff52,_0x55b2df){if(_0x3eff52){_0x5cf59d(_0x3eff52);}else if(_0x55b2df){if(_0x55b2df[_0x465e('0x4')]instanceof Buffer){fs[_0x465e('0x5')](_0x4ed7bf,_0x55b2df[_0x465e('0x4')],function(_0x29d764){if(_0x29d764){_0x5cf59d(_0x29d764);}else{_0x14ac20();}});}else{_0x5cf59d(new Error(_0x465e('0x6')));}}else{_0x5cf59d(new Error(_0x465e('0x7')));}});});}module[_0x465e('0x8')]=function(_0x2ae3b4,_0x1f219f,_0x2f9dfa,_0x5d1b38,_0x58a411,_0x20dd08,_0x39ded8){var _0x295b0d=new AWS[(_0x465e('0x9'))]({'accessKeyId':_0x2ae3b4,'secretAccessKey':_0x1f219f,'region':_0x2f9dfa});var _0x9065ed={'Text':_0x58a411,'TextType':_0x20dd08||_0x465e('0xa'),'OutputFormat':_0x465e('0xb'),'VoiceId':_0x5d1b38};return pollyResult(_0x295b0d,_0x9065ed,_0x39ded8);};
\ No newline at end of file
+var _0x3d44=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring','synthesizeSpeech','writeFile'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3d44,0xf6));var _0x43d4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3d44[_0x4565bf];return _0x5610ba;};'use strict';var fs=require('fs');var path=require(_0x43d4('0x0'));var BPromise=require('bluebird');var rs=require(_0x43d4('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x80fe2d,_0x3c0f3f,_0x1636e0){return new BPromise(function(_0x209ed3,_0x1f6260){_0x80fe2d[_0x43d4('0x2')](_0x3c0f3f,function(_0x3da3d3,_0x33207b){if(_0x3da3d3){_0x1f6260(_0x3da3d3);}else if(_0x33207b){if(_0x33207b['AudioStream']instanceof Buffer){fs[_0x43d4('0x3')](_0x1636e0,_0x33207b[_0x43d4('0x4')],function(_0x1f866a){if(_0x1f866a){_0x1f6260(_0x1f866a);}else{_0x209ed3();}});}else{_0x1f6260(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x1f6260(new Error(_0x43d4('0x5')));}});});}module[_0x43d4('0x6')]=function(_0x8ed82f,_0x2919e0,_0x547c25,_0x4ba334,_0x244881,_0x4bcb28,_0x5f16c6){var _0x244ff8=new AWS[(_0x43d4('0x7'))]({'accessKeyId':_0x8ed82f,'secretAccessKey':_0x2919e0,'region':_0x547c25});var _0x300b5e={'Text':_0x244881,'TextType':_0x4bcb28||_0x43d4('0x8'),'OutputFormat':_0x43d4('0x9'),'VoiceId':_0x4ba334};return pollyResult(_0x244ff8,_0x300b5e,_0x5f16c6);};
\ No newline at end of file
index a6dd70d..7857a88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x321b=['./lib/api','exports'];(function(_0x56a7c6,_0x62ef87){var _0x4fef9a=function(_0x2a81ae){while(--_0x2a81ae){_0x56a7c6['push'](_0x56a7c6['shift']());}};_0x4fef9a(++_0x62ef87);}(_0x321b,0x158));var _0xb321=function(_0x413fa8,_0x3483c5){_0x413fa8=_0x413fa8-0x0;var _0x5a763e=_0x321b[_0x413fa8];return _0x5a763e;};'use strict';var asr=require(_0xb321('0x0'));module[_0xb321('0x1')]=function(_0x3405eb,_0x2ffea2,_0x2f3db9,_0x38a40e){return asr(_0x3405eb,_0x2ffea2,_0x2f3db9);};
\ No newline at end of file
+var _0x734f=['exports','./lib/api'];(function(_0x5de10b,_0x5af540){var _0x477b4a=function(_0x1e0e2b){while(--_0x1e0e2b){_0x5de10b['push'](_0x5de10b['shift']());}};_0x477b4a(++_0x5af540);}(_0x734f,0xfd));var _0xf734=function(_0x4c2b80,_0x2d9078){_0x4c2b80=_0x4c2b80-0x0;var _0x21ecf9=_0x734f[_0x4c2b80];return _0x21ecf9;};'use strict';var asr=require(_0xf734('0x0'));module[_0xf734('0x1')]=function(_0x3f6e9b,_0x564eb7,_0x5142a6,_0x38dda6){return asr(_0x3f6e9b,_0x564eb7,_0x5142a6);};
\ No newline at end of file
index aaf6d1e..eac7b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ec8=['/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','undefined','length','readFileSync','toString','POST'];(function(_0xef6af3,_0x284732){var _0x392d7f=function(_0x3cd278){while(--_0x3cd278){_0xef6af3['push'](_0xef6af3['shift']());}};_0x392d7f(++_0x284732);}(_0x9ec8,0x6a));var _0x89ec=function(_0x8e5e36,_0x1de73d){_0x8e5e36=_0x8e5e36-0x0;var _0x5309fe=_0x9ec8[_0x8e5e36];return _0x5309fe;};'use strict';var url=require(_0x89ec('0x0'));var BPromise=require(_0x89ec('0x1'));var fs=require('fs');var host=_0x89ec('0x2');module[_0x89ec('0x3')]=function(_0x3819b1,_0x9b71a2,_0x222089){return new BPromise(function(_0x361cf5,_0x27e456){var _0x49426;if(typeof _0x3819b1!==_0x89ec('0x4')||_0x3819b1['length']===0x0){return _0x27e456(_0x89ec('0x5'));}if(typeof _0x9b71a2!==_0x89ec('0x4')||_0x9b71a2['length']===0x0){return _0x27e456('key\x20should\x20be\x20a\x20string');}if(typeof _0x222089!==_0x89ec('0x6')&&(typeof _0x222089!==_0x89ec('0x4')||_0x222089[_0x89ec('0x7')]===0x0)){return _0x27e456('lang\x20should\x20be\x20a\x20string');}try{_0x49426=fs[_0x89ec('0x8')](_0x3819b1)[_0x89ec('0x9')]('base64');}catch(_0x562c69){return _0x27e456(_0x562c69);}return _0x361cf5({'method':_0x89ec('0xa'),'uri':host+_0x89ec('0xb')+_0x9b71a2,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x89ec('0xc'),'languageCode':_0x222089},'audio':{'content':_0x49426}},'json':!![]});});};
\ No newline at end of file
+var _0x6afa=['key\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length','string'];(function(_0x5e93be,_0xf4e717){var _0x44bf05=function(_0x7fb1a2){while(--_0x7fb1a2){_0x5e93be['push'](_0x5e93be['shift']());}};_0x44bf05(++_0xf4e717);}(_0x6afa,0xa3));var _0xa6af=function(_0x2cffee,_0x39e146){_0x2cffee=_0x2cffee-0x0;var _0xd5a37b=_0x6afa[_0x2cffee];return _0xd5a37b;};'use strict';var url=require('url');var BPromise=require(_0xa6af('0x0'));var fs=require('fs');var host=_0xa6af('0x1');module[_0xa6af('0x2')]=function(_0x22fa72,_0x25ff50,_0x43c07c){return new BPromise(function(_0x374e10,_0x5ce63c){var _0x5c80cc;if(typeof _0x22fa72!=='string'||_0x22fa72[_0xa6af('0x3')]===0x0){return _0x5ce63c('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x25ff50!==_0xa6af('0x4')||_0x25ff50[_0xa6af('0x3')]===0x0){return _0x5ce63c(_0xa6af('0x5'));}if(typeof _0x43c07c!=='undefined'&&(typeof _0x43c07c!==_0xa6af('0x4')||_0x43c07c[_0xa6af('0x3')]===0x0)){return _0x5ce63c('lang\x20should\x20be\x20a\x20string');}try{_0x5c80cc=fs['readFileSync'](_0x22fa72)[_0xa6af('0x6')](_0xa6af('0x7'));}catch(_0x22eefa){return _0x5ce63c(_0x22eefa);}return _0x374e10({'method':_0xa6af('0x8'),'uri':host+_0xa6af('0x9')+_0x25ff50,'body':{'config':{'encoding':_0xa6af('0xa'),'sampleRateHertz':_0xa6af('0xb'),'languageCode':_0x43c07c},'audio':{'content':_0x5c80cc}},'json':!![]});});};
\ No newline at end of file
index 4f9b7e9..972f623 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d3d=['exports'];(function(_0x5464f8,_0x360877){var _0x8f66da=function(_0x2ad0af){while(--_0x2ad0af){_0x5464f8['push'](_0x5464f8['shift']());}};_0x8f66da(++_0x360877);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};var asr=require('./asr');module[_0xd3d3('0x0')]={'asr':asr};
\ No newline at end of file
+var _0x8553=['./asr','exports'];(function(_0x562bc1,_0x156f40){var _0x1e1e24=function(_0x324a31){while(--_0x324a31){_0x562bc1['push'](_0x562bc1['shift']());}};_0x1e1e24(++_0x156f40);}(_0x8553,0x1d8));var _0x3855=function(_0x4291ed,_0x279a3e){_0x4291ed=_0x4291ed-0x0;var _0x4901bf=_0x8553[_0x4291ed];return _0x4901bf;};var asr=require(_0x3855('0x0'));module[_0x3855('0x1')]={'asr':asr};
\ No newline at end of file
index 70ec430..18395c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda11=['speech','metadata','endConversation','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','channelData','CustomAction','CustomActionData','AudioFromTts','Data','path','http','https','url','parse','randomstring','sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','unlink','download\x20error','end','protocol','wav','resolve','tmp','.wav','writeFileSync','base64','then','chmodSync','777','googleCloudTTS','?key=','input','voice','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','generate','goggleTTS\x20path','googleASR','asr','uri','results','map','transcript','alternatives','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','stringify','result','action'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0xda11,0x136));var _0x1da1=function(_0x5d9f9d,_0x15ed53){_0x5d9f9d=_0x5d9f9d-0x0;var _0x3c6579=_0xda11[_0x5d9f9d];return _0x3c6579;};'use strict';var fs=require('fs');var path=require(_0x1da1('0x0'));var http=require(_0x1da1('0x1'));var https=require(_0x1da1('0x2'));var urlParse=require(_0x1da1('0x3'))[_0x1da1('0x4')];var BPromise=require('bluebird');var rs=require(_0x1da1('0x5'));var sox=require(_0x1da1('0x6'));var rp=require(_0x1da1('0x7'));var util=require(_0x1da1('0x8'));var querystring=require(_0x1da1('0x9'));var tts=require(_0x1da1('0xa'));var apiai=require(_0x1da1('0xb'));var md5=require(_0x1da1('0xc'));var google=require('./google');var aws=require(_0x1da1('0xd'));var tilde=require(_0x1da1('0xe'));var sestek=require(_0x1da1('0xf'));var logger=require(_0x1da1('0x10'))(_0x1da1('0x11'));var ISPEECH_API=_0x1da1('0x12');function downloadFile(_0x98f8b0,_0x8ac07c){return new BPromise(function(_0x559328,_0x218f20){var _0x1486aa=urlParse(_0x98f8b0);var _0x23d5e8=_0x1486aa['protocol']===_0x1da1('0x13')?https:http;var _0x31c7ea={'host':_0x1486aa[_0x1da1('0x14')],'path':_0x1486aa[_0x1da1('0x0')],'headers':{'user-agent':_0x1da1('0x15')}};_0x23d5e8[_0x1da1('0x16')](_0x31c7ea,function(_0x1cfd2b){if(_0x1cfd2b[_0x1da1('0x17')]!==0xc8){logger[_0x1da1('0x18')]('request\x20to\x20'+_0x98f8b0+_0x1da1('0x19')+_0x1cfd2b[_0x1da1('0x17')]+'\x20('+_0x1cfd2b['statusMessage']+')');_0x218f20(new Error(_0x1da1('0x1a')+_0x98f8b0+_0x1da1('0x19')+_0x1cfd2b[_0x1da1('0x17')]+'\x20('+_0x1cfd2b[_0x1da1('0x1b')]+')'));return;}var _0x462702=fs[_0x1da1('0x1c')](_0x8ac07c);_0x462702['on']('finish',function(){logger[_0x1da1('0x1d')](_0x1da1('0x1e'));_0x462702['close'](_0x559328);});_0x462702['on'](_0x1da1('0x18'),function(_0x364210){fs[_0x1da1('0x1f')](_0x8ac07c);logger[_0x1da1('0x18')](_0x1da1('0x20'),_0x364210);_0x218f20(_0x364210);});_0x1cfd2b['pipe'](_0x462702);})['on'](_0x1da1('0x18'),function(_0x329300){logger[_0x1da1('0x18')](_0x329300);_0x218f20(_0x329300);})[_0x1da1('0x21')]();});}function uploadFile(_0x2afd40){return new BPromise(function(_0x3a25e7,_0x5c958f){var _0x5ddc08=urlParse(_0x2afd40);var _0x2104dd=_0x5ddc08[_0x1da1('0x22')]===_0x1da1('0x13')?https:http;var _0x87d49a={'host':_0x5ddc08[_0x1da1('0x14')],'path':_0x5ddc08[_0x1da1('0x0')],'headers':{'user-agent':_0x1da1('0x15')}};_0x2104dd[_0x1da1('0x16')](_0x87d49a,function(_0x33717e){if(_0x33717e[_0x1da1('0x17')]!==0xc8){_0x5c958f(new Error(_0x1da1('0x1a')+_0x2afd40+'\x20failed,\x20status\x20code\x20=\x20'+_0x33717e[_0x1da1('0x17')]+'\x20('+_0x33717e[_0x1da1('0x1b')]+')'));return;}var _0x23643d='';_0x33717e['on']('data',function(_0x1333d7){_0x23643d+=_0x1333d7;});_0x33717e['on'](_0x1da1('0x21'),function(){_0x3a25e7(_0x23643d);});})['on']('error',function(_0x1451a5){_0x5c958f(_0x1451a5);})['end']();});}function convertFile(_0x1eab59,_0x2f4dd1){return new BPromise(function(_0x46f179,_0x1e0585){var _0x4bd21f=sox['transcode'](_0x1eab59,_0x2f4dd1,{'sampleRate':0x1f40,'format':_0x1da1('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4bd21f['on']('error',function(_0x5e7341){logger[_0x1da1('0x18')]('error\x20convert',_0x5e7341);_0x1e0585(_0x5e7341);});_0x4bd21f['on'](_0x1da1('0x21'),function(){logger[_0x1da1('0x1d')]('finish\x20to\x20convert');_0x46f179();});_0x4bd21f['start']();});}function base64Decode(_0x776b06,_0x52747b){var _0x457975=path[_0x1da1('0x24')](__dirname,_0x1da1('0x25'),rs['generate'](0x4)+_0x1da1('0x26'));fs[_0x1da1('0x27')](_0x457975,_0x776b06,_0x1da1('0x28'));return convertFile(_0x457975,_0x52747b)[_0x1da1('0x29')](function(){try{fs[_0x1da1('0x1f')](_0x457975);fs[_0x1da1('0x2a')](_0x52747b,_0x1da1('0x2b'));}catch(_0x5239b5){logger[_0x1da1('0x18')](_0x5239b5);}return _0x52747b['split']('.')[0x0];});}function base64Encode(_0x29ff95){var _0x4cbf15=fs['readFileSync'](_0x29ff95);return new Buffer(_0x4cbf15)['toString'](_0x1da1('0x28'));}exports[_0x1da1('0x2c')]=function(_0x39e7d3,_0x1f6e59,_0x1860aa,_0x26013b,_0x3b3ffe,_0x49c3ee){var _0x25c436,_0x5d7c21;var _0x4fed1f='https://texttospeech.googleapis.com/v1/';var _0x3afc03=_0x1da1('0x2d')+_0x39e7d3;var _0x48c518={};if(_0x1f6e59==='ssml'){_0x48c518[_0x1da1('0x2e')]={'ssml':_0x1860aa};}else{_0x48c518[_0x1da1('0x2e')]={'text':_0x1860aa};};_0x48c518[_0x1da1('0x2f')]={'languageCode':_0x26013b,'ssmlGender':_0x3b3ffe};_0x48c518['audioConfig']={'audioEncoding':_0x1da1('0x30'),'sampleRateHertz':0x1f40};var _0x2339ae={'url':_0x4fed1f+_0x1da1('0x31')+_0x3afc03,'method':_0x1da1('0x32'),'json':!![],'body':_0x48c518};return rp(_0x2339ae)[_0x1da1('0x29')](function(_0x583a39){return new BPromise(function(_0x2533bd,_0x3e80ba){_0x25c436=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x1da1('0x33'));var _0x1f974c=Buffer[_0x1da1('0x34')](_0x583a39[_0x1da1('0x35')],_0x1da1('0x28'));return fs[_0x1da1('0x36')](_0x25c436,_0x1f974c,function(_0x4e6124){_0x3e80ba(_0x4e6124);},function(_0x12c852){fs[_0x1da1('0x2a')](_0x25c436,_0x1da1('0x2b'));_0x2533bd(_0x12c852);});});})[_0x1da1('0x29')](function(_0x336a62){_0x5d7c21=path[_0x1da1('0x24')](__dirname,'tmp',rs['generate'](0x4)+_0x1da1('0x26'));return convertFile(_0x25c436,_0x5d7c21);})[_0x1da1('0x29')](function(){try{fs[_0x1da1('0x1f')](_0x25c436);fs[_0x1da1('0x2a')](_0x5d7c21,_0x1da1('0x2b'));}catch(_0x2fb479){logger[_0x1da1('0x18')](_0x2fb479);}logger[_0x1da1('0x1d')](_0x1da1('0x37'),_0x5d7c21[_0x1da1('0x38')]('.')[0x0]);return _0x5d7c21[_0x1da1('0x38')]('.')[0x0];});};exports[_0x1da1('0x39')]=function(_0x349abc,_0x4b5183){var _0x4bd792,_0x589155;return tts(_0x349abc,_0x4b5183||'en',0x1)['then'](function(_0x457994){logger[_0x1da1('0x1d')](_0x457994);_0x4bd792=path[_0x1da1('0x24')](__dirname,_0x1da1('0x25'),rs[_0x1da1('0x3a')](0x4)+_0x1da1('0x33'));return downloadFile(_0x457994,_0x4bd792);})[_0x1da1('0x29')](function(){_0x589155=path[_0x1da1('0x24')](__dirname,_0x1da1('0x25'),rs[_0x1da1('0x3a')](0x4)+_0x1da1('0x26'));return convertFile(_0x4bd792,_0x589155);})['then'](function(){try{fs[_0x1da1('0x1f')](_0x4bd792);fs[_0x1da1('0x2a')](_0x589155,'777');}catch(_0x2f178e){logger[_0x1da1('0x18')](_0x2f178e);}logger['info'](_0x1da1('0x3b'),_0x589155[_0x1da1('0x38')]('.')[0x0]);return _0x589155[_0x1da1('0x38')]('.')[0x0];});};exports[_0x1da1('0x3c')]=function(_0x31fd26,_0x4fc5dc,_0x3014be){return google[_0x1da1('0x3d')](_0x31fd26,_0x4fc5dc,_0x3014be)['then'](function(_0x4b654e){logger[_0x1da1('0x1d')](_0x4b654e[_0x1da1('0x3e')]);return rp(_0x4b654e);})[_0x1da1('0x29')](function(_0x2b68b6){var _0x469a2c='';var _0xa8586f=0x0;try{fs['unlink'](_0x31fd26);}catch(_0x2692fa){logger[_0x1da1('0x18')](_0x2692fa);}if(_0x2b68b6&&_0x2b68b6[_0x1da1('0x3f')]){_0x469a2c=_0x2b68b6['results'][_0x1da1('0x40')](function(_0x1c6817){return _0x1c6817&&_0x1c6817['alternatives'][0x0]&&_0x1c6817['alternatives'][0x0][_0x1da1('0x41')]?_0x1c6817['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0xa8586f=_0x2b68b6[_0x1da1('0x3f')]['map'](function(_0x44cdd0){return _0x44cdd0&&_0x44cdd0['alternatives'][0x0]&&_0x44cdd0[_0x1da1('0x42')][0x0][_0x1da1('0x43')]?_0x44cdd0['alternatives'][0x0][_0x1da1('0x43')]:0x0;})[_0x1da1('0x44')]('\x0a');}logger[_0x1da1('0x1d')](_0x1da1('0x45'),_0x469a2c);logger[_0x1da1('0x1d')]('googleASR\x20confidence',_0xa8586f);return{'transcript':_0x469a2c,'confidence':_0xa8586f};})[_0x1da1('0x46')](function(_0x2b56f1){logger[_0x1da1('0x18')](_0x1da1('0x47'),_0x2b56f1[_0x1da1('0x17')],_0x2b56f1[_0x1da1('0x48')],_0x2b56f1[_0x1da1('0x49')]);});};exports[_0x1da1('0x4a')]=function(_0x514cef,_0x5087ec,_0xa08fa9,_0x5ab7e5){var _0x4fe4c5=apiai(_0x5087ec,{'language':_0x5ab7e5||'en'});return _0x4fe4c5['textRequest'](_0xa08fa9,{'sessionId':md5(_0x514cef)})[_0x1da1('0x29')](function(_0x894814){logger['info'](JSON[_0x1da1('0x4b')](_0x894814));return{'source':_0x894814['result']['source'],'resolvedQuery':_0x894814[_0x1da1('0x4c')]['resolvedQuery'],'action':_0x894814[_0x1da1('0x4c')][_0x1da1('0x4d')],'actionIncomplete':_0x894814['result']['actionIncomplete'],'speech':_0x894814[_0x1da1('0x4c')]['fulfillment'][_0x1da1('0x4e')],'score':_0x894814[_0x1da1('0x4c')]['score'],'statusCode':_0x894814['status']['code'],'endConversation':_0x894814['result'][_0x1da1('0x4f')][_0x1da1('0x50')]||![],'isFallbackIntent':_0x894814[_0x1da1('0x4c')][_0x1da1('0x4f')]['isFallbackIntent']};});};exports['tildeASR']=function(_0x439fff,_0x4f43d1,_0x506543,_0x1f49e6){return tilde[_0x1da1('0x3d')](_0x439fff,_0x4f43d1,_0x506543,_0x1f49e6)['then'](function(_0x14beb9){try{fs[_0x1da1('0x1f')](_0x439fff);}catch(_0x30821c){logger[_0x1da1('0x18')](_0x30821c);}logger[_0x1da1('0x1d')](_0x1da1('0x51'),_0x14beb9[_0x1da1('0x41')]);logger[_0x1da1('0x1d')](_0x1da1('0x52'),_0x14beb9[_0x1da1('0x43')]);return _0x14beb9;});};exports[_0x1da1('0x53')]=function(_0x4bb0e0,_0x4cd104,_0x259fbf,_0x25e432,_0x304eda,_0x3b4c64){var _0x39ea12=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x1da1('0x33'));var _0x23f0a8;return aws[_0x1da1('0x54')](_0x4bb0e0,_0x4cd104,_0x259fbf,_0x25e432,_0x304eda,_0x3b4c64,_0x39ea12)[_0x1da1('0x29')](function(){_0x23f0a8=path[_0x1da1('0x24')](__dirname,_0x1da1('0x25'),rs[_0x1da1('0x3a')](0x4)+_0x1da1('0x26'));return convertFile(_0x39ea12,_0x23f0a8);})[_0x1da1('0x29')](function(){try{fs[_0x1da1('0x1f')](_0x39ea12);fs[_0x1da1('0x2a')](_0x23f0a8,_0x1da1('0x2b'));}catch(_0x182e34){logger[_0x1da1('0x18')](_0x182e34);}return _0x23f0a8['split']('.')[0x0];});};exports[_0x1da1('0x55')]=function(_0x1fd665,_0x2f7a89,_0x565eec,_0x411da7,_0x12c138,_0x1bc044){return aws[_0x1da1('0x56')](_0x1fd665,_0x2f7a89,_0x565eec,_0x411da7,_0x12c138,_0x1bc044)[_0x1da1('0x29')](function(_0x2f51f8){logger[_0x1da1('0x1d')](JSON[_0x1da1('0x4b')](_0x2f51f8));return _0x2f51f8;});};exports['ispeechTTS']=function(_0x17b20a,_0x631d61,_0x32be66,_0x2dbbab){var _0x268e90=util[_0x1da1('0x57')](_0x1da1('0x58'),ISPEECH_API,_0x17b20a,encodeURIComponent(_0x631d61),_0x32be66,_0x2dbbab);var _0x1fbcf9=path[_0x1da1('0x24')](__dirname,_0x1da1('0x25'),rs[_0x1da1('0x3a')](0x4)+_0x1da1('0x33'));var _0x3f7c0b;return downloadFile(_0x268e90,_0x1fbcf9)[_0x1da1('0x29')](function(){_0x3f7c0b=path[_0x1da1('0x24')](__dirname,_0x1da1('0x25'),rs[_0x1da1('0x3a')](0x4)+_0x1da1('0x26'));return convertFile(_0x1fbcf9,_0x3f7c0b);})[_0x1da1('0x29')](function(){try{fs[_0x1da1('0x1f')](_0x1fbcf9);fs[_0x1da1('0x2a')](_0x3f7c0b,_0x1da1('0x2b'));}catch(_0x493e9a){logger[_0x1da1('0x18')](_0x493e9a);}return _0x3f7c0b['split']('.')[0x0];});};exports[_0x1da1('0x59')]=function(_0x3f8e46,_0x594000,_0x441d3d,_0x91f4e3){var _0x36e362=util[_0x1da1('0x57')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x594000,_0x441d3d,base64Encode(_0x3f8e46),_0x91f4e3?util[_0x1da1('0x57')](_0x1da1('0x5a'),encodeURIComponent(_0x91f4e3)):_0x1da1('0x5b'));return uploadFile(_0x36e362)['then'](function(_0x890b09){return querystring[_0x1da1('0x4')](_0x890b09);});};exports['sestekNDA']=function(_0x3eecf7,_0x72bbd3){return sestek['nda'](_0x3eecf7,_0x72bbd3)['then'](function(_0x7f838d){logger[_0x1da1('0x1d')](JSON[_0x1da1('0x4b')](_0x7f838d));var _0x4b19b7={'speech':_0x7f838d['text'],'action':_0x7f838d[_0x1da1('0x5c')]?_0x7f838d[_0x1da1('0x5c')][_0x1da1('0x5d')]:undefined,'actiondata':_0x7f838d[_0x1da1('0x5c')]?_0x7f838d[_0x1da1('0x5c')][_0x1da1('0x5e')]:undefined};if(_0x7f838d[_0x1da1('0x5c')]&&_0x7f838d[_0x1da1('0x5c')][_0x1da1('0x5f')]){return base64Decode(_0x7f838d[_0x1da1('0x5c')]['AudioFromTts'][_0x1da1('0x60')],path[_0x1da1('0x24')](__dirname,_0x1da1('0x25'),rs[_0x1da1('0x3a')](0x4)+_0x1da1('0x26')))[_0x1da1('0x29')](function(_0x4fc8a3){_0x4b19b7['audiofile']=_0x4fc8a3;return _0x4b19b7;});}return _0x4b19b7;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
+var _0x9a34=['resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https','url','bluebird','randomstring','sox','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./tilde','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','pipe','end','transcode','wav','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','writeFile','googleTTS','googleASR','results','map','transcript','alternatives','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0x9a34,0x16b));var _0x49a3=function(_0x372374,_0x15ad5a){_0x372374=_0x372374-0x0;var _0x409220=_0x9a34[_0x372374];return _0x409220;};'use strict';var fs=require('fs');var path=require(_0x49a3('0x0'));var http=require('http');var https=require(_0x49a3('0x1'));var urlParse=require(_0x49a3('0x2'))['parse'];var BPromise=require(_0x49a3('0x3'));var rs=require(_0x49a3('0x4'));var sox=require(_0x49a3('0x5'));var rp=require('request-promise');var util=require('util');var querystring=require(_0x49a3('0x6'));var tts=require(_0x49a3('0x7'));var apiai=require(_0x49a3('0x8'));var md5=require(_0x49a3('0x9'));var google=require(_0x49a3('0xa'));var aws=require(_0x49a3('0xb'));var tilde=require(_0x49a3('0xc'));var sestek=require(_0x49a3('0xd'));var logger=require(_0x49a3('0xe'))('agi');var ISPEECH_API=_0x49a3('0xf');function downloadFile(_0x2bf3a5,_0x3159f1){return new BPromise(function(_0x30c804,_0x1631cd){var _0x2db79e=urlParse(_0x2bf3a5);var _0x2e36fa=_0x2db79e[_0x49a3('0x10')]===_0x49a3('0x11')?https:http;var _0x4bbc8b={'host':_0x2db79e[_0x49a3('0x12')],'path':_0x2db79e[_0x49a3('0x0')],'headers':{'user-agent':_0x49a3('0x13')}};_0x2e36fa[_0x49a3('0x14')](_0x4bbc8b,function(_0x11c2e7){if(_0x11c2e7[_0x49a3('0x15')]!==0xc8){logger[_0x49a3('0x16')](_0x49a3('0x17')+_0x2bf3a5+_0x49a3('0x18')+_0x11c2e7['statusCode']+'\x20('+_0x11c2e7['statusMessage']+')');_0x1631cd(new Error(_0x49a3('0x17')+_0x2bf3a5+_0x49a3('0x18')+_0x11c2e7[_0x49a3('0x15')]+'\x20('+_0x11c2e7[_0x49a3('0x19')]+')'));return;}var _0x1f887f=fs[_0x49a3('0x1a')](_0x3159f1);_0x1f887f['on'](_0x49a3('0x1b'),function(){logger[_0x49a3('0x1c')]('finish\x20download\x20file');_0x1f887f['close'](_0x30c804);});_0x1f887f['on'](_0x49a3('0x16'),function(_0x3d1442){fs['unlink'](_0x3159f1);logger[_0x49a3('0x16')]('download\x20error',_0x3d1442);_0x1631cd(_0x3d1442);});_0x11c2e7[_0x49a3('0x1d')](_0x1f887f);})['on'](_0x49a3('0x16'),function(_0x53653e){logger[_0x49a3('0x16')](_0x53653e);_0x1631cd(_0x53653e);})['end']();});}function uploadFile(_0x4f36a4){return new BPromise(function(_0x32b65f,_0x273373){var _0x2e1717=urlParse(_0x4f36a4);var _0x23c941=_0x2e1717['protocol']===_0x49a3('0x11')?https:http;var _0xe75e49={'host':_0x2e1717[_0x49a3('0x12')],'path':_0x2e1717[_0x49a3('0x0')],'headers':{'user-agent':_0x49a3('0x13')}};_0x23c941['get'](_0xe75e49,function(_0x2ea71b){if(_0x2ea71b[_0x49a3('0x15')]!==0xc8){_0x273373(new Error(_0x49a3('0x17')+_0x4f36a4+_0x49a3('0x18')+_0x2ea71b[_0x49a3('0x15')]+'\x20('+_0x2ea71b[_0x49a3('0x19')]+')'));return;}var _0x1c315a='';_0x2ea71b['on']('data',function(_0x15f3d6){_0x1c315a+=_0x15f3d6;});_0x2ea71b['on'](_0x49a3('0x1e'),function(){_0x32b65f(_0x1c315a);});})['on'](_0x49a3('0x16'),function(_0x592cf4){_0x273373(_0x592cf4);})['end']();});}function convertFile(_0x510249,_0x53c4a0){return new BPromise(function(_0x5d2ae2,_0x46505c){var _0x2ddc4d=sox[_0x49a3('0x1f')](_0x510249,_0x53c4a0,{'sampleRate':0x1f40,'format':_0x49a3('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2ddc4d['on'](_0x49a3('0x16'),function(_0xfc8364){logger[_0x49a3('0x16')]('error\x20convert',_0xfc8364);_0x46505c(_0xfc8364);});_0x2ddc4d['on']('end',function(){logger[_0x49a3('0x1c')](_0x49a3('0x21'));_0x5d2ae2();});_0x2ddc4d[_0x49a3('0x22')]();});}function base64Decode(_0x3a3fd9,_0x202c41){var _0x1c3977=path[_0x49a3('0x23')](__dirname,'tmp',rs[_0x49a3('0x24')](0x4)+_0x49a3('0x25'));fs[_0x49a3('0x26')](_0x1c3977,_0x3a3fd9,_0x49a3('0x27'));return convertFile(_0x1c3977,_0x202c41)[_0x49a3('0x28')](function(){try{fs[_0x49a3('0x29')](_0x1c3977);fs[_0x49a3('0x2a')](_0x202c41,_0x49a3('0x2b'));}catch(_0x2d357e){logger[_0x49a3('0x16')](_0x2d357e);}return _0x202c41[_0x49a3('0x2c')]('.')[0x0];});}function base64Encode(_0xa7f915){var _0x3510c7=fs['readFileSync'](_0xa7f915);return new Buffer(_0x3510c7)[_0x49a3('0x2d')]('base64');}exports[_0x49a3('0x2e')]=function(_0x3f0d4a,_0x1f6863,_0x3451b5,_0x50825d,_0x3612b1,_0x4ded31){var _0x22aa72,_0x2bd88f;var _0x4fb98a='https://texttospeech.googleapis.com/v1/';var _0x43d07b=_0x49a3('0x2f')+_0x3f0d4a;var _0x442534={};if(_0x1f6863===_0x49a3('0x30')){_0x442534[_0x49a3('0x31')]={'ssml':_0x3451b5};}else{_0x442534[_0x49a3('0x31')]={'text':_0x3451b5};};_0x442534[_0x49a3('0x32')]={'languageCode':_0x50825d,'ssmlGender':_0x3612b1};_0x442534[_0x49a3('0x33')]={'audioEncoding':_0x49a3('0x34'),'sampleRateHertz':0x1f40};var _0x116313={'url':_0x4fb98a+_0x49a3('0x35')+_0x43d07b,'method':_0x49a3('0x36'),'json':!![],'body':_0x442534};return rp(_0x116313)[_0x49a3('0x28')](function(_0x2eccf2){return new BPromise(function(_0xe9925b,_0x784737){_0x22aa72=path[_0x49a3('0x23')](__dirname,_0x49a3('0x37'),rs[_0x49a3('0x24')](0x4)+_0x49a3('0x38'));var _0x5bd6a0=Buffer[_0x49a3('0x39')](_0x2eccf2['audioContent'],'base64');return fs[_0x49a3('0x3a')](_0x22aa72,_0x5bd6a0,function(_0x13c4a3){_0x784737(_0x13c4a3);},function(_0x46da48){fs[_0x49a3('0x2a')](_0x22aa72,_0x49a3('0x2b'));_0xe9925b(_0x46da48);});});})['then'](function(_0x5472f1){_0x2bd88f=path[_0x49a3('0x23')](__dirname,_0x49a3('0x37'),rs[_0x49a3('0x24')](0x4)+_0x49a3('0x25'));return convertFile(_0x22aa72,_0x2bd88f);})[_0x49a3('0x28')](function(){try{fs[_0x49a3('0x29')](_0x22aa72);fs[_0x49a3('0x2a')](_0x2bd88f,'777');}catch(_0x300be1){logger[_0x49a3('0x16')](_0x300be1);}logger[_0x49a3('0x1c')]('googleCloudTTS\x20path',_0x2bd88f[_0x49a3('0x2c')]('.')[0x0]);return _0x2bd88f[_0x49a3('0x2c')]('.')[0x0];});};exports[_0x49a3('0x3b')]=function(_0x12032f,_0x3e852f){var _0xb29ef1,_0x196e12;return tts(_0x12032f,_0x3e852f||'en',0x1)['then'](function(_0x3d23e3){logger[_0x49a3('0x1c')](_0x3d23e3);_0xb29ef1=path[_0x49a3('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0x49a3('0x38'));return downloadFile(_0x3d23e3,_0xb29ef1);})[_0x49a3('0x28')](function(){_0x196e12=path[_0x49a3('0x23')](__dirname,_0x49a3('0x37'),rs[_0x49a3('0x24')](0x4)+_0x49a3('0x25'));return convertFile(_0xb29ef1,_0x196e12);})[_0x49a3('0x28')](function(){try{fs[_0x49a3('0x29')](_0xb29ef1);fs['chmodSync'](_0x196e12,_0x49a3('0x2b'));}catch(_0x589839){logger[_0x49a3('0x16')](_0x589839);}logger['info']('goggleTTS\x20path',_0x196e12[_0x49a3('0x2c')]('.')[0x0]);return _0x196e12[_0x49a3('0x2c')]('.')[0x0];});};exports[_0x49a3('0x3c')]=function(_0x169ee7,_0xbeedc3,_0x2ec76c){return google['asr'](_0x169ee7,_0xbeedc3,_0x2ec76c)[_0x49a3('0x28')](function(_0x133c7c){logger['info'](_0x133c7c['uri']);return rp(_0x133c7c);})[_0x49a3('0x28')](function(_0x5aebdf){var _0x27c9aa='';var _0xf91f3e=0x0;try{fs[_0x49a3('0x29')](_0x169ee7);}catch(_0x5bf3db){logger[_0x49a3('0x16')](_0x5bf3db);}if(_0x5aebdf&&_0x5aebdf[_0x49a3('0x3d')]){_0x27c9aa=_0x5aebdf[_0x49a3('0x3d')][_0x49a3('0x3e')](function(_0x40481d){return _0x40481d&&_0x40481d['alternatives'][0x0]&&_0x40481d['alternatives'][0x0][_0x49a3('0x3f')]?_0x40481d[_0x49a3('0x40')][0x0]['transcript']:'';})[_0x49a3('0x41')]('\x0a');_0xf91f3e=_0x5aebdf['results'][_0x49a3('0x3e')](function(_0x2e9c2f){return _0x2e9c2f&&_0x2e9c2f[_0x49a3('0x40')][0x0]&&_0x2e9c2f['alternatives'][0x0][_0x49a3('0x42')]?_0x2e9c2f['alternatives'][0x0][_0x49a3('0x42')]:0x0;})[_0x49a3('0x41')]('\x0a');}logger[_0x49a3('0x1c')](_0x49a3('0x43'),_0x27c9aa);logger[_0x49a3('0x1c')]('googleASR\x20confidence',_0xf91f3e);return{'transcript':_0x27c9aa,'confidence':_0xf91f3e};})[_0x49a3('0x44')](function(_0xc312c1){logger[_0x49a3('0x16')](_0x49a3('0x45'),_0xc312c1[_0x49a3('0x15')],_0xc312c1[_0x49a3('0x46')],_0xc312c1[_0x49a3('0x47')]);});};exports[_0x49a3('0x48')]=function(_0xa59feb,_0x1dea48,_0x300444,_0xa950fc){var _0x21975a=apiai(_0x1dea48,{'language':_0xa950fc||'en'});return _0x21975a[_0x49a3('0x49')](_0x300444,{'sessionId':md5(_0xa59feb)})[_0x49a3('0x28')](function(_0x564329){logger[_0x49a3('0x1c')](JSON[_0x49a3('0x4a')](_0x564329));return{'source':_0x564329[_0x49a3('0x4b')][_0x49a3('0x4c')],'resolvedQuery':_0x564329[_0x49a3('0x4b')][_0x49a3('0x4d')],'action':_0x564329[_0x49a3('0x4b')][_0x49a3('0x4e')],'actionIncomplete':_0x564329[_0x49a3('0x4b')][_0x49a3('0x4f')],'speech':_0x564329['result'][_0x49a3('0x50')][_0x49a3('0x51')],'score':_0x564329['result'][_0x49a3('0x52')],'statusCode':_0x564329[_0x49a3('0x53')][_0x49a3('0x54')],'endConversation':_0x564329[_0x49a3('0x4b')][_0x49a3('0x55')][_0x49a3('0x56')]||![],'isFallbackIntent':_0x564329[_0x49a3('0x4b')][_0x49a3('0x55')][_0x49a3('0x57')]};});};exports[_0x49a3('0x58')]=function(_0x3f1f21,_0x1f492,_0x2c586c,_0x288f2d){return tilde[_0x49a3('0x59')](_0x3f1f21,_0x1f492,_0x2c586c,_0x288f2d)[_0x49a3('0x28')](function(_0x1bd313){try{fs['unlink'](_0x3f1f21);}catch(_0x5c5d12){logger[_0x49a3('0x16')](_0x5c5d12);}logger[_0x49a3('0x1c')](_0x49a3('0x5a'),_0x1bd313['transcript']);logger[_0x49a3('0x1c')](_0x49a3('0x5b'),_0x1bd313[_0x49a3('0x42')]);return _0x1bd313;});};exports[_0x49a3('0x5c')]=function(_0x380477,_0x56301d,_0x53e8c4,_0x5187a5,_0x3e2abd,_0x5bf420){var _0x4a7ef0=path['resolve'](__dirname,'tmp',rs[_0x49a3('0x24')](0x4)+'.mp3');var _0x44db53;return aws['polly'](_0x380477,_0x56301d,_0x53e8c4,_0x5187a5,_0x3e2abd,_0x5bf420,_0x4a7ef0)[_0x49a3('0x28')](function(){_0x44db53=path[_0x49a3('0x23')](__dirname,_0x49a3('0x37'),rs[_0x49a3('0x24')](0x4)+_0x49a3('0x25'));return convertFile(_0x4a7ef0,_0x44db53);})[_0x49a3('0x28')](function(){try{fs[_0x49a3('0x29')](_0x4a7ef0);fs[_0x49a3('0x2a')](_0x44db53,'777');}catch(_0x449cfe){logger[_0x49a3('0x16')](_0x449cfe);}return _0x44db53[_0x49a3('0x2c')]('.')[0x0];});};exports[_0x49a3('0x5d')]=function(_0x47be78,_0x3b48e3,_0x4d0fef,_0x3b0a51,_0x486f90,_0x2fb99a){return aws['lex'](_0x47be78,_0x3b48e3,_0x4d0fef,_0x3b0a51,_0x486f90,_0x2fb99a)['then'](function(_0x592b5b){logger['info'](JSON['stringify'](_0x592b5b));return _0x592b5b;});};exports[_0x49a3('0x5e')]=function(_0x59fc44,_0x2d9b27,_0x360992,_0x3000a2){var _0x22e818=util['format'](_0x49a3('0x5f'),ISPEECH_API,_0x59fc44,encodeURIComponent(_0x2d9b27),_0x360992,_0x3000a2);var _0x286b5d=path[_0x49a3('0x23')](__dirname,_0x49a3('0x37'),rs[_0x49a3('0x24')](0x4)+_0x49a3('0x38'));var _0x47df62;return downloadFile(_0x22e818,_0x286b5d)['then'](function(){_0x47df62=path['resolve'](__dirname,_0x49a3('0x37'),rs['generate'](0x4)+_0x49a3('0x25'));return convertFile(_0x286b5d,_0x47df62);})[_0x49a3('0x28')](function(){try{fs[_0x49a3('0x29')](_0x286b5d);fs['chmodSync'](_0x47df62,'777');}catch(_0x4ca3d7){logger[_0x49a3('0x16')](_0x4ca3d7);}return _0x47df62[_0x49a3('0x2c')]('.')[0x0];});};exports[_0x49a3('0x60')]=function(_0x6372ad,_0x21d52f,_0x5070e7,_0xfc0193){var _0x146c16=util[_0x49a3('0x61')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x21d52f,_0x5070e7,base64Encode(_0x6372ad),_0xfc0193?util[_0x49a3('0x61')](_0x49a3('0x62'),encodeURIComponent(_0xfc0193)):_0x49a3('0x63'));return uploadFile(_0x146c16)[_0x49a3('0x28')](function(_0x31183a){return querystring[_0x49a3('0x64')](_0x31183a);});};exports[_0x49a3('0x65')]=function(_0x1a8094,_0xf177d6){return sestek[_0x49a3('0x66')](_0x1a8094,_0xf177d6)[_0x49a3('0x28')](function(_0x4d5484){logger[_0x49a3('0x1c')](JSON['stringify'](_0x4d5484));var _0x2a4463={'speech':_0x4d5484[_0x49a3('0x67')],'action':_0x4d5484[_0x49a3('0x68')]?_0x4d5484[_0x49a3('0x68')]['CustomAction']:undefined,'actiondata':_0x4d5484[_0x49a3('0x68')]?_0x4d5484[_0x49a3('0x68')][_0x49a3('0x69')]:undefined};if(_0x4d5484[_0x49a3('0x68')]&&_0x4d5484[_0x49a3('0x68')][_0x49a3('0x6a')]){return base64Decode(_0x4d5484[_0x49a3('0x68')][_0x49a3('0x6a')][_0x49a3('0x6b')],path[_0x49a3('0x23')](__dirname,'tmp',rs[_0x49a3('0x24')](0x4)+_0x49a3('0x25')))['then'](function(_0x39bdbe){_0x2a4463[_0x49a3('0x6c')]=_0x39bdbe;return _0x2a4463;});}return _0x2a4463;});};exports[_0x49a3('0x6d')]=function(){return __dirname;};
\ No newline at end of file
index 244a385..8f34e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9975=['exports'];(function(_0x3d9b23,_0x52894d){var _0xf22517=function(_0x1933d0){while(--_0x1933d0){_0x3d9b23['push'](_0x3d9b23['shift']());}};_0xf22517(++_0x52894d);}(_0x9975,0x8f));var _0x5997=function(_0x3528b0,_0x55a72b){_0x3528b0=_0x3528b0-0x0;var _0x3f11e0=_0x9975[_0x3528b0];return _0x3f11e0;};var nda=require('./nda');module[_0x5997('0x0')]={'nda':nda};
\ No newline at end of file
+var nda=require('./nda');module['exports']={'nda':nda};
\ No newline at end of file
index 8340b85..d929588 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x209e=['Nda','uniqueid','calleridname','dnid','text','Bearer\x20','access_token','body','ProjectName','project','ndagenerate_audio','channelData','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','username','then','ndassistant_url','message'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x209e,0x17a));var _0xe209=function(_0x135c48,_0x1b0495){_0x135c48=_0x135c48-0x0;var _0x2f10a9=_0x209e[_0x135c48];return _0x2f10a9;};'use strict';var rp=require(_0xe209('0x0'));var url=require('url');var logger=require(_0xe209('0x1'))(_0xe209('0x2'));module[_0xe209('0x3')]=function(_0x537459,_0x51487a){var _0x33f0d3={'method':_0xe209('0x4'),'uri':url['resolve'](_0x51487a[_0xe209('0x5')],_0xe209('0x6')),'form':{'grant_type':_0xe209('0x7'),'username':_0x51487a[_0xe209('0x8')],'password':_0x51487a[_0xe209('0x7')]},'json':!![]};return rp(_0x33f0d3)[_0xe209('0x9')](function(_0x1bf95c){var _0x25f8df={'method':'POST','uri':url['resolve'](_0x51487a[_0xe209('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x51487a['ndaactivity_type']||_0xe209('0xb'),'channelId':_0xe209('0xc'),'conversation':{'id':_0x537459[_0xe209('0xd')]},'from':{'id':_0x537459['callerid'],'name':_0x537459[_0xe209('0xe')]},'recipient':{'id':_0x537459[_0xe209('0xf')],'name':_0x537459['extension']},'text':_0x51487a[_0xe209('0x10')],'channelData':{}},'headers':{'Authorization':_0xe209('0x11')+_0x1bf95c[_0xe209('0x12')]},'json':!![]};if(_0x51487a['project']){_0x25f8df[_0xe209('0x13')]['channelData'][_0xe209('0x14')]=_0x51487a[_0xe209('0x15')];}if(_0x51487a[_0xe209('0x16')]=='1'){_0x25f8df[_0xe209('0x13')][_0xe209('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe209('0x18')};}if(_0x51487a[_0xe209('0x19')]){_0x25f8df[_0xe209('0x13')][_0xe209('0x17')][_0xe209('0x1a')]=_0x51487a['custom_action'];if(_0x51487a[_0xe209('0x1b')]){_0x25f8df[_0xe209('0x13')][_0xe209('0x17')][_0xe209('0x1c')]=_0x51487a[_0xe209('0x1b')];}}logger[_0xe209('0x1d')](JSON['stringify'](_0x25f8df));return rp(_0x25f8df);});};
\ No newline at end of file
+var _0xb9a6=['resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','then'];(function(_0x209003,_0x4df2a8){var _0xf696eb=function(_0x4e0063){while(--_0x4e0063){_0x209003['push'](_0x209003['shift']());}};_0xf696eb(++_0x4df2a8);}(_0xb9a6,0x137));var _0x6b9a=function(_0x162565,_0x56dcf9){_0x162565=_0x162565-0x0;var _0x24537f=_0xb9a6[_0x162565];return _0x24537f;};'use strict';var rp=require('request-promise');var url=require(_0x6b9a('0x0'));var logger=require(_0x6b9a('0x1'))(_0x6b9a('0x2'));module[_0x6b9a('0x3')]=function(_0x296ed6,_0x1b0fee){var _0x173255={'method':_0x6b9a('0x4'),'uri':url['resolve'](_0x1b0fee[_0x6b9a('0x5')],_0x6b9a('0x6')),'form':{'grant_type':'password','username':_0x1b0fee['username'],'password':_0x1b0fee[_0x6b9a('0x7')]},'json':!![]};return rp(_0x173255)[_0x6b9a('0x8')](function(_0x380b11){var _0x2df9c0={'method':'POST','uri':url[_0x6b9a('0x9')](_0x1b0fee[_0x6b9a('0xa')],_0x6b9a('0xb')),'body':{'type':_0x1b0fee[_0x6b9a('0xc')]||_0x6b9a('0xd'),'channelId':_0x6b9a('0xe'),'conversation':{'id':_0x296ed6[_0x6b9a('0xf')]},'from':{'id':_0x296ed6[_0x6b9a('0x10')],'name':_0x296ed6['calleridname']},'recipient':{'id':_0x296ed6[_0x6b9a('0x11')],'name':_0x296ed6[_0x6b9a('0x12')]},'text':_0x1b0fee['text'],'channelData':{}},'headers':{'Authorization':_0x6b9a('0x13')+_0x380b11[_0x6b9a('0x14')]},'json':!![]};if(_0x1b0fee[_0x6b9a('0x15')]){_0x2df9c0['body'][_0x6b9a('0x16')][_0x6b9a('0x17')]=_0x1b0fee['project'];}if(_0x1b0fee[_0x6b9a('0x18')]=='1'){_0x2df9c0[_0x6b9a('0x19')][_0x6b9a('0x16')][_0x6b9a('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x1b0fee['custom_action']){_0x2df9c0['body'][_0x6b9a('0x16')]['CustomAction']=_0x1b0fee[_0x6b9a('0x1b')];if(_0x1b0fee[_0x6b9a('0x1c')]){_0x2df9c0[_0x6b9a('0x19')]['channelData'][_0x6b9a('0x1d')]=_0x1b0fee[_0x6b9a('0x1c')];}}logger[_0x6b9a('0x1e')](JSON[_0x6b9a('0x1f')](_0x2df9c0));return rp(_0x2df9c0);});};
\ No newline at end of file
index 4b4dd90..a11c8c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa05c=['exports','./lib/api'];(function(_0x59e7e0,_0x3ec148){var _0x26b058=function(_0x212ee2){while(--_0x212ee2){_0x59e7e0['push'](_0x59e7e0['shift']());}};_0x26b058(++_0x3ec148);}(_0xa05c,0x167));var _0xca05=function(_0x2d3ce8,_0x3524ba){_0x2d3ce8=_0x2d3ce8-0x0;var _0x579bc4=_0xa05c[_0x2d3ce8];return _0x579bc4;};'use strict';var asr=require(_0xca05('0x0'));module[_0xca05('0x1')]=function(_0x35c496,_0x196b75,_0x24945f,_0x59fcfc){return asr(_0x35c496,_0x196b75,_0x24945f,_0x59fcfc);};
\ No newline at end of file
+var _0xaa7f=['exports','./lib/api'];(function(_0xd6ca7,_0xf8aca2){var _0x5f269f=function(_0x1c58b9){while(--_0x1c58b9){_0xd6ca7['push'](_0xd6ca7['shift']());}};_0x5f269f(++_0xf8aca2);}(_0xaa7f,0xc5));var _0xfaa7=function(_0x368c25,_0x4e1cd8){_0x368c25=_0x368c25-0x0;var _0xe78d2e=_0xaa7f[_0x368c25];return _0xe78d2e;};'use strict';var asr=require(_0xfaa7('0x0'));module[_0xfaa7('0x1')]=function(_0x46246b,_0x387983,_0x1e7f70,_0x2854c2){return asr(_0x46246b,_0x387983,_0x1e7f70,_0x2854c2);};
\ No newline at end of file
index 8ce626b..58d1829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11ef=['createReadStream','EOS','error','stringify','terminate','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','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','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','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','send'];(function(_0x3e5d57,_0x3a7805){var _0x99548=function(_0x1287fd){while(--_0x1287fd){_0x3e5d57['push'](_0x3e5d57['shift']());}};_0x99548(++_0x3a7805);}(_0x11ef,0x121));var _0xf11e=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x11ef[_0x4a53d];return _0x27410e;};'use strict';var BPromise=require(_0xf11e('0x0'));var _=require(_0xf11e('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf11e('0x2'));var crypto=require(_0xf11e('0x3'));var logger=require(_0xf11e('0x4'))(_0xf11e('0x5'));module['exports']=function(_0x4b72fe,_0x66436e,_0x4105a0,_0x2c0085){return new BPromise(function(_0xb5f780,_0x342e03){logger[_0xf11e('0x6')](_0xf11e('0x7'),_0x2c0085||_0xf11e('0x8'));var _0xd33f11=new WebSocket(_0x2c0085||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x48f7bf='';var _0x421090='0';var _0x3f3566='1';var _0x534aab=_0xf11e('0x9');function _0x708e7(_0x4df7a4){var _0x4c253d=crypto['createHash'](_0xf11e('0xa'));_0x4c253d[_0xf11e('0xb')](_0x4df7a4);return _0x4c253d['digest'](_0xf11e('0xc'));}function _0x1f7ccd(){try{logger[_0xf11e('0x6')](_0xf11e('0xd'));var _0x47c779=moment()['unix']();var _0x5321b1=_0x708e7(_0x47c779+_0x66436e+_0x4105a0);_0xd33f11[_0xf11e('0xe')](JSON['stringify']({'appID':_0x66436e,'timestamp':_0x47c779,'appKey':_0x5321b1}));var _0x4aa1a8=fs[_0xf11e('0xf')](_0x4b72fe);_0x4aa1a8['on']('data',function(_0x503d7f){_0xd33f11[_0xf11e('0xe')](_0x503d7f);});_0x4aa1a8['on']('close',function(){_0xd33f11[_0xf11e('0xe')](_0xf11e('0x10'));});}catch(_0x1b6e8e){logger[_0xf11e('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf11e('0x12')](_0x1b6e8e));_0xd33f11[_0xf11e('0x13')]();}}function _0x2ecd03(_0x1587a5){try{if(_0x1587a5){var _0x406825=JSON['parse'](_0x1587a5);switch(_0x406825['status']){case 0x0:if(_0x406825[_0xf11e('0x14')]){if(_0x406825[_0xf11e('0x14')][_0xf11e('0x15')]){logger[_0xf11e('0x6')](_0xf11e('0x16'),JSON[_0xf11e('0x12')](_0x406825[_0xf11e('0x14')]['hypotheses']));_0x48f7bf=_0x406825[_0xf11e('0x14')][_0xf11e('0x17')][0x0][_0xf11e('0x18')];_0x421090=_0x406825[_0xf11e('0x14')][_0xf11e('0x17')][0x0][_0xf11e('0x19')];_0x3f3566='0';_0x534aab=_0xf11e('0x1a');_0xd33f11[_0xf11e('0x13')]();}}break;case 0x1:logger['info'](_0xf11e('0x9'));_0x3f3566='1';_0x534aab=_0xf11e('0x9');break;case 0x2:logger[_0xf11e('0x6')](_0xf11e('0x1b'));_0x3f3566='2';_0x534aab=_0xf11e('0x1b');break;case 0x9:logger[_0xf11e('0x6')](_0xf11e('0x1c'));_0x3f3566='9';_0x534aab=_0xf11e('0x1c');break;case 0xa:logger[_0xf11e('0x6')](_0xf11e('0x1d'));_0x3f3566='10';_0x534aab='Authentication\x20failed.';break;case 0xb:logger[_0xf11e('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x3f3566='11';_0x534aab=_0xf11e('0x1e');}}}catch(_0x3e1abc){logger[_0xf11e('0x11')](_0xf11e('0x1f'),JSON[_0xf11e('0x12')](_0x3e1abc));_0xd33f11[_0xf11e('0x13')]();}}function _0x2ccc82(){logger[_0xf11e('0x6')](_0xf11e('0x20'));_0xb5f780({'transcript':_0x48f7bf,'confidence':_0x421090,'status':_0x3f3566,'status_message':_0x534aab});}function _0x216090(_0x4fe185){logger[_0xf11e('0x11')](_0xf11e('0x21'));if(!_[_0xf11e('0x22')](_0x4fe185)){logger[_0xf11e('0x11')](_[_0xf11e('0x23')](_0x4fe185)?JSON[_0xf11e('0x12')](_0x4fe185):_0x4fe185);}}_0xd33f11['on'](_0xf11e('0x24'),_0x1f7ccd);_0xd33f11['on']('message',_0x2ecd03);_0xd33f11['on'](_0xf11e('0x25'),_0x2ccc82);_0xd33f11['on']('error',_0x216090);});};
\ No newline at end of file
+var _0xe8b1=['terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','bluebird','lodash','moment','crypto','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error'];(function(_0x51d167,_0x3920de){var _0x1607bf=function(_0x325dc3){while(--_0x325dc3){_0x51d167['push'](_0x51d167['shift']());}};_0x1607bf(++_0x3920de);}(_0xe8b1,0x17a));var _0x1e8b=function(_0x1ed99c,_0x52bb43){_0x1ed99c=_0x1ed99c-0x0;var _0x19c308=_0xe8b1[_0x1ed99c];return _0x19c308;};'use strict';var BPromise=require(_0x1e8b('0x0'));var _=require(_0x1e8b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x1e8b('0x2'));var crypto=require(_0x1e8b('0x3'));var logger=require('../../../../../../config/logger')(_0x1e8b('0x4'));module[_0x1e8b('0x5')]=function(_0x57e782,_0x1c81a1,_0x31ce64,_0x1f5590){return new BPromise(function(_0x2a804e,_0x32580e){logger[_0x1e8b('0x6')]('Tilde\x20URI',_0x1f5590||_0x1e8b('0x7'));var _0x4d2c61=new WebSocket(_0x1f5590||_0x1e8b('0x7'),{'perMessageDeflate':![]});var _0x38ea3b='';var _0x34996e='0';var _0x35c7ee='1';var _0x52ecfe='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4c9853(_0x165be4){var _0x46ed5b=crypto[_0x1e8b('0x8')](_0x1e8b('0x9'));_0x46ed5b['update'](_0x165be4);return _0x46ed5b[_0x1e8b('0xa')](_0x1e8b('0xb'));}function _0x4a90cd(){try{logger[_0x1e8b('0x6')](_0x1e8b('0xc'));var _0x3195b3=moment()[_0x1e8b('0xd')]();var _0x414379=_0x4c9853(_0x3195b3+_0x1c81a1+_0x31ce64);_0x4d2c61['send'](JSON[_0x1e8b('0xe')]({'appID':_0x1c81a1,'timestamp':_0x3195b3,'appKey':_0x414379}));var _0x19fd42=fs[_0x1e8b('0xf')](_0x57e782);_0x19fd42['on'](_0x1e8b('0x10'),function(_0x1f55e8){_0x4d2c61[_0x1e8b('0x11')](_0x1f55e8);});_0x19fd42['on'](_0x1e8b('0x12'),function(){_0x4d2c61[_0x1e8b('0x11')](_0x1e8b('0x13'));});}catch(_0x7be64f){logger[_0x1e8b('0x14')](_0x1e8b('0x15'),JSON['stringify'](_0x7be64f));_0x4d2c61[_0x1e8b('0x16')]();}}function _0x14bb51(_0x465ca6){try{if(_0x465ca6){var _0x4c0682=JSON[_0x1e8b('0x17')](_0x465ca6);switch(_0x4c0682[_0x1e8b('0x18')]){case 0x0:if(_0x4c0682[_0x1e8b('0x19')]){if(_0x4c0682[_0x1e8b('0x19')][_0x1e8b('0x1a')]){logger['info'](_0x1e8b('0x1b'),JSON['stringify'](_0x4c0682['result'][_0x1e8b('0x1c')]));_0x38ea3b=_0x4c0682[_0x1e8b('0x19')]['hypotheses'][0x0][_0x1e8b('0x1d')];_0x34996e=_0x4c0682['result']['hypotheses'][0x0][_0x1e8b('0x1e')];_0x35c7ee='0';_0x52ecfe='Success.';_0x4d2c61[_0x1e8b('0x16')]();}}break;case 0x1:logger[_0x1e8b('0x6')](_0x1e8b('0x1f'));_0x35c7ee='1';_0x52ecfe=_0x1e8b('0x1f');break;case 0x2:logger[_0x1e8b('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x35c7ee='2';_0x52ecfe=_0x1e8b('0x20');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x35c7ee='9';_0x52ecfe='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x1e8b('0x6')](_0x1e8b('0x21'));_0x35c7ee='10';_0x52ecfe=_0x1e8b('0x21');break;case 0xb:logger[_0x1e8b('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x35c7ee='11';_0x52ecfe=_0x1e8b('0x22');}}}catch(_0x656a66){logger[_0x1e8b('0x14')](_0x1e8b('0x23'),JSON[_0x1e8b('0xe')](_0x656a66));_0x4d2c61['terminate']();}}function _0x42869a(){logger['info'](_0x1e8b('0x24'));_0x2a804e({'transcript':_0x38ea3b,'confidence':_0x34996e,'status':_0x35c7ee,'status_message':_0x52ecfe});}function _0x10fd43(_0x279484){logger[_0x1e8b('0x14')](_0x1e8b('0x25'));if(!_[_0x1e8b('0x26')](_0x279484)){logger['error'](_[_0x1e8b('0x27')](_0x279484)?JSON['stringify'](_0x279484):_0x279484);}}_0x4d2c61['on']('open',_0x4a90cd);_0x4d2c61['on']('message',_0x14bb51);_0x4d2c61['on'](_0x1e8b('0x12'),_0x42869a);_0x4d2c61['on']('error',_0x10fd43);});};
\ No newline at end of file
index fd6e06a..ec968c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3134=['./asr'];(function(_0x584399,_0x4775bd){var _0x524bcd=function(_0x3030eb){while(--_0x3030eb){_0x584399['push'](_0x584399['shift']());}};_0x524bcd(++_0x4775bd);}(_0x3134,0x99));var _0x4313=function(_0x5afdf7,_0x52f885){_0x5afdf7=_0x5afdf7-0x0;var _0x714c35=_0x3134[_0x5afdf7];return _0x714c35;};var asr=require(_0x4313('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0xada7=['./asr'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xada7,0x120));var _0x7ada=function(_0x120c88,_0x2d7ce4){_0x120c88=_0x120c88-0x0;var _0x447024=_0xada7[_0x120c88];return _0x447024;};var asr=require(_0x7ada('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index 02794ee..39045f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb04a=['EventEmitter','./channel','127.0.0.1','error','listening','emit','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xab04('0x0'));var net=require(_0xab04('0x1'));var EventEmitter=require(_0xab04('0x2'))[_0xab04('0x3')];var AGIError=require('./error');var AGIChannel=require(_0xab04('0x4'));var AGIServer=function(_0x4657c4,_0x20639d,_0x4b8c0f){var _0x2b5b06=this,_0x4657c4=_0x4657c4||0x11dd,_0x20639d=_0x20639d||_0xab04('0x5'),_0x488ced=null,_0x3b68e3=0x0;EventEmitter['call'](_0x2b5b06);function _0x53a969(){if(!_0x4657c4){_0x2b5b06['emit'](_0xab04('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x488ced=net['createServer']();_0x488ced['listen'](_0x4657c4,_0x20639d);_0x488ced['on'](_0xab04('0x7'),function(){_0x2b5b06[_0xab04('0x8')](_0xab04('0x7'));});_0x488ced['on'](_0xab04('0x9'),function(_0x3bbc4a){_0x488ced[_0xab04('0xa')](function(_0x2aa7a2,_0x332501){if(_0x2aa7a2){_0x2b5b06[_0xab04('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x2aa7a2));}else if(_0x4b8c0f&&_0x4b8c0f<0x0){_0x2b5b06[_0xab04('0x8')](_0xab04('0x6'),new AGIError(_0xab04('0xb')));_0x3bbc4a[_0xab04('0xc')]();}else if(_0x4b8c0f&&_0x4b8c0f>0x0&&_0x4b8c0f<_0x332501){_0x3b68e3+=0x1;_0x2b5b06['emit'](_0xab04('0x6'),new AGIError(_0xab04('0xd'),_0x3b68e3));_0x3bbc4a['destroy']();}else{var _0x233a8d=new AGIChannel(_0x3bbc4a);_0x233a8d['on'](_0xab04('0xe'),function(){_0x2b5b06[_0xab04('0x8')](_0xab04('0x9'),_0x233a8d);});}});});_0x488ced['on'](_0xab04('0x6'),function(_0x523c51){_0x2b5b06[_0xab04('0x8')](_0xab04('0x6'),new AGIError(_0xab04('0xf'),_0x523c51[_0xab04('0x10')]));});_0x488ced['on'](_0xab04('0x11'),function(){_0x2b5b06['emit']('close',new AGIError(_0xab04('0x12')));});}process[_0xab04('0x13')](function(){_0x53a969();});};util[_0xab04('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x597abc,_0x39cc0d,_0x287011){return new AGIServer(_0x597abc,_0x39cc0d,_0x287011);};
\ No newline at end of file
+var _0x2285=['net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','inherits','exports'];(function(_0x32c78e,_0x32cc40){var _0x5dc750=function(_0x1ff439){while(--_0x1ff439){_0x32c78e['push'](_0x32c78e['shift']());}};_0x5dc750(++_0x32cc40);}(_0x2285,0x177));var _0x5228=function(_0x6ad5d5,_0x1ebdc7){_0x6ad5d5=_0x6ad5d5-0x0;var _0x5c8001=_0x2285[_0x6ad5d5];return _0x5c8001;};'use strict';var util=require('util');var net=require(_0x5228('0x0'));var EventEmitter=require(_0x5228('0x1'))[_0x5228('0x2')];var AGIError=require(_0x5228('0x3'));var AGIChannel=require(_0x5228('0x4'));var AGIServer=function(_0x4f0eae,_0x2cb384,_0x527cb3){var _0x5bf024=this,_0x4f0eae=_0x4f0eae||0x11dd,_0x2cb384=_0x2cb384||_0x5228('0x5'),_0x322927=null,_0x5ef1d3=0x0;EventEmitter[_0x5228('0x6')](_0x5bf024);function _0x192393(){if(!_0x4f0eae){_0x5bf024[_0x5228('0x7')](_0x5228('0x8'),new AGIError(_0x5228('0x9')));return![];}_0x322927=net[_0x5228('0xa')]();_0x322927[_0x5228('0xb')](_0x4f0eae,_0x2cb384);_0x322927['on'](_0x5228('0xc'),function(){_0x5bf024[_0x5228('0x7')]('listening');});_0x322927['on'](_0x5228('0xd'),function(_0x3a7e5){_0x322927[_0x5228('0xe')](function(_0x128f28,_0x594038){if(_0x128f28){_0x5bf024[_0x5228('0x7')](_0x5228('0x8'),new AGIError(_0x5228('0xf'),_0x128f28));}else if(_0x527cb3&&_0x527cb3<0x0){_0x5bf024[_0x5228('0x7')]('error',new AGIError(_0x5228('0x10')));_0x3a7e5[_0x5228('0x11')]();}else if(_0x527cb3&&_0x527cb3>0x0&&_0x527cb3<_0x594038){_0x5ef1d3+=0x1;_0x5bf024[_0x5228('0x7')](_0x5228('0x8'),new AGIError(_0x5228('0x12'),_0x5ef1d3));_0x3a7e5[_0x5228('0x11')]();}else{var _0x4d74d7=new AGIChannel(_0x3a7e5);_0x4d74d7['on'](_0x5228('0x13'),function(){_0x5bf024[_0x5228('0x7')]('connection',_0x4d74d7);});}});});_0x322927['on'](_0x5228('0x8'),function(_0x271e3b){_0x5bf024['emit'](_0x5228('0x8'),new AGIError(_0x5228('0xf'),_0x271e3b[_0x5228('0x14')]));});_0x322927['on'](_0x5228('0x15'),function(){_0x5bf024['emit'](_0x5228('0x15'),new AGIError(_0x5228('0x16')));});}process['nextTick'](function(){_0x192393();});};util[_0x5228('0x17')](AGIServer,EventEmitter);module[_0x5228('0x18')]=function(_0x2bcbd0,_0x47cc51,_0x2dfc47){return new AGIServer(_0x2bcbd0,_0x47cc51,_0x2dfc47);};
\ No newline at end of file
index df28879..3525d01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1ba=['render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','split','extra','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','result','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','label','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','.wav','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','no\x20operation\x20configured','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','getPause','pause_id','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','QUEUE','gosub','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','escape_digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','service','host','port','secure','user','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','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','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','prototype','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','interval','map','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','MP3','googleTTS','url','timeout','number','includes','POST','PUT','method','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','parse'];(function(_0x4b6507,_0x5518b5){var _0x2001ec=function(_0x330ddf){while(--_0x330ddf){_0x4b6507['push'](_0x4b6507['shift']());}};_0x2001ec(++_0x5518b5);}(_0xf1ba,0x144));var _0xaf1b=function(_0x492a1a,_0x9c4d65){_0x492a1a=_0x492a1a-0x0;var _0x2faf3a=_0xf1ba[_0x492a1a];return _0x2faf3a;};'use strict';var fs=require('fs');var path=require(_0xaf1b('0x0'));var util=require(_0xaf1b('0x1'));var _=require(_0xaf1b('0x2'));var sh=require(_0xaf1b('0x3'));var odbc=require(_0xaf1b('0x4'))();var rs=require(_0xaf1b('0x5'));var moment=require(_0xaf1b('0x6'));var Mustache=require(_0xaf1b('0x7'));var rp=require(_0xaf1b('0x8'));var logger=require(_0xaf1b('0x9'))(_0xaf1b('0xa'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0xaf1b('0xb');var recursiveMapAttributes=[_0xaf1b('0xc'),_0xaf1b('0xd')];var verticesWithRetry=[_0xaf1b('0xe'),_0xaf1b('0xf'),_0xaf1b('0x10')];var AGIVertices=function(_0x516622,_0x3bf323,_0x1c4938){this[_0xaf1b('0x11')]=_0x516622;this[_0xaf1b('0x12')]=_0x3bf323;this[_0xaf1b('0x13')]=_0x1c4938;};AGIVertices['prototype'][_0xaf1b('0x14')]=function(_0x35cd4e,_0x4f121c){this[_0xaf1b('0x12')][_0xaf1b('0x15')](_0x35cd4e)[_0xaf1b('0x16')](function(_0x17b8b5){_0x4f121c(null,_0x17b8b5?_0x17b8b5[_0xaf1b('0x17')]:![]);})[_0xaf1b('0x18')](function(_0x5f2692){_0x4f121c(_0x5f2692);});};AGIVertices['prototype'][_0xaf1b('0x19')]=function(_0x15fad1,_0x1897b9){this[_0xaf1b('0x12')][_0xaf1b('0x1a')](_0x15fad1)[_0xaf1b('0x16')](function(_0x2772bf){_0x1897b9(null,_0x2772bf?_0x2772bf[_0xaf1b('0x17')]:![]);})[_0xaf1b('0x18')](function(_0x4d1281){_0x1897b9(_0x4d1281);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x1c')]=function(_0x12b29f,_0x396f78){this['rpc'][_0xaf1b('0x1d')](_0x12b29f)['then'](function(_0x5373d5){_0x396f78(null,_0x5373d5?_0x5373d5[_0xaf1b('0x17')]:![]);})[_0xaf1b('0x18')](function(_0x4e9709){_0x396f78(_0x4e9709);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x1e')]=function(_0x33494b,_0x5af3b6){this[_0xaf1b('0x12')][_0xaf1b('0x1f')](_0x33494b)[_0xaf1b('0x16')](function(_0x45a239){_0x5af3b6(null,_0x45a239?_0x45a239[_0xaf1b('0x20')]:![]);})[_0xaf1b('0x18')](function(_0x52df3d){_0x5af3b6(_0x52df3d);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x21')]=function(_0x27b225,_0x39a4a3){this[_0xaf1b('0x12')][_0xaf1b('0x22')](_0x27b225)['then'](function(_0x2c09a2){_0x39a4a3(null,_0x2c09a2?_0x2c09a2['name']:![]);})[_0xaf1b('0x18')](function(_0x566693){_0x39a4a3(_0x566693);});};AGIVertices[_0xaf1b('0x1b')]['getTrunk']=function(_0x1298a3,_0x39cc7b){this[_0xaf1b('0x12')]['getTrunkById'](_0x1298a3)[_0xaf1b('0x16')](function(_0x44cbda){_0x39cc7b(null,_0x44cbda?_0x44cbda[_0xaf1b('0x17')]:![]);})['catch'](function(_0x5c8abc){_0x39cc7b(_0x5c8abc);});};AGIVertices['prototype'][_0xaf1b('0x23')]=function(_0x478c6a,_0x3a9d8d){var _0x4c2544=this;this['rpc'][_0xaf1b('0x24')](_0x478c6a)[_0xaf1b('0x16')](function(_0x33143c){_0x3a9d8d(null,_0x33143c?_0x4c2544[_0xaf1b('0x25')](_0x33143c[_0xaf1b('0x26')]):![]);})[_0xaf1b('0x18')](function(_0x32dab5){_0x3a9d8d(_0x32dab5);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x27')]=function(_0x5a067a,_0x5e39bc){this[_0xaf1b('0x12')]['getMailAccountById'](_0x5a067a)[_0xaf1b('0x16')](function(_0xa90584){_0x5e39bc(null,_0xa90584?_0xa90584:![]);})[_0xaf1b('0x18')](function(_0x2edf13){_0x5e39bc(_0x2edf13);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x28')]=function(_0x4c5a87,_0x100275,_0x76dd8){this['mailRpc'][_0xaf1b('0x28')](_0x4c5a87,_0x100275)[_0xaf1b('0x16')](function(){_0x76dd8(null);})[_0xaf1b('0x18')](function(_0x165d25){_0x76dd8(_0x165d25);});};AGIVertices['prototype'][_0xaf1b('0x29')]=function(_0x499fb4,_0x31d256){this[_0xaf1b('0x12')]['getIntervalById'](_0x499fb4)[_0xaf1b('0x16')](function(_0x50ee37){if(_0x50ee37){if(_0x50ee37['IntervalId']){_0x31d256(null,[_0x50ee37[_0xaf1b('0x2a')]]);}else{_0x31d256(null,_[_0xaf1b('0x2b')](_0x50ee37['Intervals'],_0xaf1b('0x2a')));}}else{_0x31d256(null,![]);}})[_0xaf1b('0x18')](function(_0x26fc51){_0x31d256(_0x26fc51);});};AGIVertices['prototype'][_0xaf1b('0x25')]=function(_0x1faac3){return util['format'](_0xaf1b('0x2c'),FILES_PATH,_0x1faac3);};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x2d')]=function(_0x29b8e0,_0xadebb5,_0x52aaed){odbc[_0xaf1b('0x2e')](_0x29b8e0,function(_0x95429f){if(_0x95429f){logger['error'](_0xaf1b('0x2f'),_0x95429f);_0x52aaed(_0x95429f);}else{logger[_0xaf1b('0x30')]('ODBC\x20connection\x20successfully');odbc[_0xaf1b('0x31')](_0xadebb5,function(_0x6b7831,_0x14f5ff){if(_0x6b7831){logger[_0xaf1b('0x30')](_0xaf1b('0x32'),_0xadebb5);_0x52aaed(_0x6b7831);}else{logger[_0xaf1b('0x30')](_0xaf1b('0x33'),_0xadebb5);odbc[_0xaf1b('0x34')](function(_0x39cf17){if(_0x39cf17){logger[_0xaf1b('0x35')](_0xaf1b('0x36'),_0x39cf17);}_0x52aaed(null,_0x14f5ff);});}});}});};AGIVertices[_0xaf1b('0x1b')]['getSmsAccount']=function(_0x568128,_0x2e0c6f){this[_0xaf1b('0x12')]['getSmsAccountById'](_0x568128)['then'](function(_0x524f08){_0x2e0c6f(null,_0x524f08?_0x524f08:![]);})[_0xaf1b('0x18')](function(_0x41f369){_0x2e0c6f(_0x41f369);});};AGIVertices['prototype'][_0xaf1b('0x37')]=function(_0xe401e2,_0x460455){this[_0xaf1b('0x12')][_0xaf1b('0x37')](_0xe401e2)[_0xaf1b('0x16')](function(_0x1b9749){_0x460455(null,_0x1b9749);})['catch'](function(_0xe10155){_0x460455(_0xe10155);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x38')]=function(_0x7a041f,_0x1e03fe,_0x142bd0){this[_0xaf1b('0x12')][_0xaf1b('0x38')]({'uniqueid':this[_0xaf1b('0x11')][_0xaf1b('0x39')],'node':_0x7a041f['label'],'application':_0x7a041f[_0xaf1b('0x3a')],'data':_0x1e03fe||null,'project_name':this[_0xaf1b('0x11')][_0xaf1b('0x3b')],'callerid':this[_0xaf1b('0x11')][_0xaf1b('0x3c')]})[_0xaf1b('0x16')](function(_0x146c3d){if(_0x142bd0){_0x142bd0(null,_0x146c3d);}})['catch'](function(_0x2e97a5){if(_0x142bd0){_0x142bd0(_0x2e97a5);}});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x3d')]=function(_0x4f6e73,_0x59dd1f,_0x25e5ac,_0x30fcf6){this[_0xaf1b('0x12')][_0xaf1b('0x3d')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0xaf1b('0x11')]['callerid'],'calleridname':this[_0xaf1b('0x11')][_0xaf1b('0x3e')],'context':this[_0xaf1b('0x11')][_0xaf1b('0x3f')],'extension':this[_0xaf1b('0x11')][_0xaf1b('0x40')],'priority':this[_0xaf1b('0x11')][_0xaf1b('0x41')],'accountcode':this[_0xaf1b('0x11')][_0xaf1b('0x42')],'dnid':this[_0xaf1b('0x11')][_0xaf1b('0x43')],'projectName':this[_0xaf1b('0x11')][_0xaf1b('0x3b')],'saveName':_0x59dd1f,'filename':_0x4f6e73['file']||_0x59dd1f,'savePath':_0x25e5ac})[_0xaf1b('0x16')](function(_0xbca727){_0x30fcf6(null,_0xbca727);})[_0xaf1b('0x18')](function(_0x760054){_0x30fcf6(_0x760054);});};AGIVertices['prototype'][_0xaf1b('0x44')]=function(_0x40563c,_0x1f3e40,_0x4ead57){this[_0xaf1b('0x12')][_0xaf1b('0x44')]({'uniqueid':this['channel']['uniqueid'],'body':_0x40563c,'direction':_0x1f3e40})[_0xaf1b('0x16')](function(_0x2d222a){if(_0x4ead57){_0x4ead57(null,_0x2d222a);}})[_0xaf1b('0x18')](function(_0x4cf1e9){if(_0x4ead57){_0x4ead57(_0x4cf1e9);}});};AGIVertices[_0xaf1b('0x1b')]['createCmContact']=function(_0x497360,_0x19eb43){this['rpc'][_0xaf1b('0x45')]({'firstName':_[_0xaf1b('0x46')](_0x497360['name'])||_[_0xaf1b('0x47')](_0x497360['name'])?_0xaf1b('0x48')+Math[_0xaf1b('0x49')]():_0x497360[_0xaf1b('0x17')],'lastName':_['isEmpty'](_0x497360[_0xaf1b('0x4a')])||_[_0xaf1b('0x47')](_0x497360[_0xaf1b('0x4a')])?null:_0x497360[_0xaf1b('0x4a')],'phone':_0x497360[_0xaf1b('0x4b')],'ListId':_0x497360[_0xaf1b('0x4c')],'scheduledat':_0x497360[_0xaf1b('0x4d')],'callbackUniqueid':this['channel'][_0xaf1b('0x39')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x497360['scheduledAt'][_0xaf1b('0x4e')](),'priority':_0x497360[_0xaf1b('0x4f')]})[_0xaf1b('0x16')](function(_0x46a56d){_0x19eb43(null,_0x46a56d);})[_0xaf1b('0x18')](function(_0x188549){_0x19eb43(_0x188549);});};AGIVertices[_0xaf1b('0x1b')]['getPause']=function(_0x10cfcd,_0x58c228){this[_0xaf1b('0x12')]['getPauseById'](_0x10cfcd)['then'](function(_0x206217){_0x58c228(null,_0x206217?_0x206217['name']:![]);})[_0xaf1b('0x18')](function(_0x1a7110){_0x58c228(_0x1a7110);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x50')]=function(_0x182588,_0x1965fe,_0x43d7ef){var _0x210aff={'role':_0xaf1b('0x51')};_0x210aff[_0x182588]=this['channel']['callerid'];this[_0xaf1b('0x12')][_0xaf1b('0x50')](_0x210aff,_0x1965fe,this[_0xaf1b('0x11')][_0xaf1b('0x39')])['then'](function(_0x51e567){_0x43d7ef(null,_[_0xaf1b('0x47')](_0x51e567)?![]:!![]);})['catch'](function(_0x2b02ac){logger['error'](_0x2b02ac);_0x43d7ef(null,![]);});};AGIVertices[_0xaf1b('0x1b')]['agentUnpause']=function(_0x361cfe,_0x1ee68a){var _0x38866e={'role':'agent'};_0x38866e[_0x361cfe]=this[_0xaf1b('0x11')]['callerid'];this['rpc'][_0xaf1b('0x52')](_0x38866e)[_0xaf1b('0x16')](function(_0x120113){_0x1ee68a(null,_[_0xaf1b('0x47')](_0x120113)?![]:!![]);})['catch'](function(_0x48d03e){logger[_0xaf1b('0x35')](_0x48d03e);_0x1ee68a(null,![]);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x53')]=function(_0x5d29f3,_0x36b5ba){var _0x2e294f={'role':_0xaf1b('0x51')};_0x2e294f[_0x5d29f3]=this[_0xaf1b('0x11')][_0xaf1b('0x3c')];this[_0xaf1b('0x12')][_0xaf1b('0x53')](_0x2e294f)[_0xaf1b('0x16')](function(_0x5f2b82){_0x36b5ba(null,_[_0xaf1b('0x47')](_0x5f2b82)?![]:!![]);})[_0xaf1b('0x18')](function(_0x1e691b){logger[_0xaf1b('0x35')](_0x1e691b);_0x36b5ba(null,![]);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x54')]=function(_0x4536d8,_0x1a26ad){var _0x2afaf3={'role':_0xaf1b('0x51')};_0x2afaf3[_0x4536d8]=this[_0xaf1b('0x11')]['callerid'];var _0x463234=_0x4536d8!=_0xaf1b('0x55')?util[_0xaf1b('0x56')](_0xaf1b('0x57'),_0xaf1b('0x58'),this[_0xaf1b('0x11')]['callerid']):undefined;this[_0xaf1b('0x12')][_0xaf1b('0x54')](_0x2afaf3,_0x463234)['then'](function(_0x46149e){_0x1a26ad(null,_[_0xaf1b('0x47')](_0x46149e)?![]:!![]);})[_0xaf1b('0x18')](function(_0x215d60){logger[_0xaf1b('0x35')](_0x215d60);_0x1a26ad(null,![]);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x59')]=function(_0x3a8df9,_0x5ac102){sh[_0xaf1b('0x5a')](_[_0xaf1b('0x5b')](_0x3a8df9),function(_0x353f30,_0x47756e){var _0x500828=_0x47756e[_0xaf1b('0x5c')](/(\r\n|\n|\r)/gm,'');_0x5ac102(null,_0x500828);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x5d')]=function(_0x277e7d,_0xacfe98){scripts[_0xaf1b('0x5d')](_0x277e7d['apiKey'],_0x277e7d[_0xaf1b('0x5e')]||_0xaf1b('0x5f'),_0x277e7d[_0xaf1b('0x5f')],_0x277e7d['languageCode']||_0xaf1b('0x60'),_0x277e7d[_0xaf1b('0x61')]||_0xaf1b('0x62'),_0x277e7d['audioEncoding']||_0xaf1b('0x63'))['then'](function(_0x5ee68e){_0xacfe98(null,_0x5ee68e);})[_0xaf1b('0x18')](function(_0x27c056){_0xacfe98(_0x27c056);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x64')]=function(_0x3605c5,_0xee4e9a){scripts['googleTTS'](_0x3605c5[_0xaf1b('0x5f')],_0x3605c5['google_tts_language']||'en',0x1)[_0xaf1b('0x16')](function(_0x3def5d){_0xee4e9a(null,_0x3def5d);})[_0xaf1b('0x18')](function(_0x57b3ac){_0xee4e9a(_0x57b3ac);});};AGIVertices[_0xaf1b('0x1b')]['restAPI']=function(_0x55cb41,_0x58ca7d){var _0x216e18={'uri':_0x55cb41[_0xaf1b('0x65')],'method':_0x55cb41['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x55cb41[_0xaf1b('0x66')])===_0xaf1b('0x67')&&parseInt(_0x55cb41[_0xaf1b('0x66')])>=0x1?parseInt(_0x55cb41[_0xaf1b('0x66')])*0x3e8:0x5*0x3e8};if(_[_0xaf1b('0x68')]([_0xaf1b('0x69'),_0xaf1b('0x6a')],_0x216e18[_0xaf1b('0x6b')][_0xaf1b('0x6c')]())){try{_0x216e18[_0xaf1b('0x6d')]=_0x55cb41[_0xaf1b('0xd')]?JSON['parse'](_0x55cb41[_0xaf1b('0xd')]):{};}catch(_0x1e37f1){logger[_0xaf1b('0x35')](_0xaf1b('0x6e'),_0x1e37f1);}}try{_0x216e18[_0xaf1b('0x6f')]=_0x55cb41[_0xaf1b('0xc')]?JSON['parse'](_0x55cb41[_0xaf1b('0xc')]):{};}catch(_0x5a078c){logger['error'](_0xaf1b('0x70'),_0x5a078c);}if(_0x55cb41['computedVariables']){try{var _0x507e85=require(_0x55cb41['computedVariables'])[_0xaf1b('0x71')](this,_0x216e18);_0x216e18[_0xaf1b('0x72')]=Mustache['render'](_0x55cb41[_0xaf1b('0x65')],_0x507e85,{},['$$','$$']);if(_0x216e18['headers']){_0x216e18['headers']=JSON[_0xaf1b('0x73')](Mustache[_0xaf1b('0x74')](JSON[_0xaf1b('0x75')](_0x216e18[_0xaf1b('0x6f')]),_0x507e85,{},['$$','$$']));}if(_0x216e18[_0xaf1b('0x6d')]){_0x216e18[_0xaf1b('0x6d')]=JSON['parse'](Mustache[_0xaf1b('0x74')](JSON[_0xaf1b('0x75')](_0x216e18[_0xaf1b('0x6d')]),_0x507e85,{},['$$','$$']));}}catch(_0x270fa0){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x270fa0);}}rp(_0x216e18)[_0xaf1b('0x16')](function(_0x1c49b7){var _0x37c211={'statusCode':_0x1c49b7[_0xaf1b('0x76')]||0xc8,'statusMessage':_0x1c49b7[_0xaf1b('0x77')]||'OK','headers':_0x1c49b7[_0xaf1b('0x6f')]||{},'body':_0x1c49b7['body']||{}};_0x58ca7d(null,_0x37c211);})[_0xaf1b('0x18')](function(_0x500c80){var _0x2a94cb={'statusCode':_0x500c80['statusCode']||0x1f4,'statusMessage':_0x500c80[_0xaf1b('0x78')]||_0xaf1b('0x79'),'headers':_0x500c80[_0xaf1b('0x7a')]['headers']||{},'body':_0x500c80[_0xaf1b('0x7a')][_0xaf1b('0x6d')]||{}};_0x58ca7d(null,_0x2a94cb);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x7b')]=function(_0x5eb992,_0x5f1b3c){scripts['googleDialogflow'](this['channel'][_0xaf1b('0x39')],_0x5eb992[_0xaf1b('0x7c')],_0x5eb992[_0xaf1b('0x5f')],_0x5eb992[_0xaf1b('0x7d')]||'en')[_0xaf1b('0x16')](function(_0x4666a6){_0x5f1b3c(null,_0x4666a6);})['catch'](function(_0x41d0de){_0x5f1b3c(_0x41d0de);});};AGIVertices[_0xaf1b('0x1b')]['sestekNDA']=function(_0x2bf5ff,_0x5cb68f){scripts[_0xaf1b('0x7e')](this[_0xaf1b('0x11')],_0x2bf5ff)['then'](function(_0x31ce43){_0x5cb68f(null,_0x31ce43);})[_0xaf1b('0x18')](function(_0x5015bb){_0x5cb68f(_0x5015bb);});};AGIVertices[_0xaf1b('0x1b')]['ispeechTTS']=function(_0x4b3c0b,_0xfac77d){scripts[_0xaf1b('0x7f')](_0x4b3c0b[_0xaf1b('0x7c')],_0x4b3c0b[_0xaf1b('0x5f')],_0x4b3c0b['ispeech_tts_language']||_0xaf1b('0x60'),_0x4b3c0b[_0xaf1b('0x80')])[_0xaf1b('0x16')](function(_0x120752){_0xfac77d(null,_0x120752);})[_0xaf1b('0x18')](function(_0x1e3d81){_0xfac77d(_0x1e3d81);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x81')]=function(_0x437468,_0x472060,_0x59a602){scripts[_0xaf1b('0x81')](_0x472060,_0x437468[_0xaf1b('0x7c')],_0x437468[_0xaf1b('0x82')]||_0xaf1b('0x60'),this['isConfigured'](_0x437468[_0xaf1b('0x83')])?_0x437468['model']:undefined)[_0xaf1b('0x16')](function(_0x5392c7){_0x59a602(null,_0x5392c7);})['catch'](function(_0x19de8f){_0x59a602(_0x19de8f);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x84')]=function(_0x384df7,_0x545693){scripts[_0xaf1b('0x84')](_0x384df7[_0xaf1b('0x85')],_0x384df7[_0xaf1b('0x86')],_0x384df7[_0xaf1b('0x87')],_0x384df7['aws_polly_voice']||_0xaf1b('0x88'),_0x384df7[_0xaf1b('0x5f')],_0x384df7[_0xaf1b('0x89')]||_0xaf1b('0x5f'))['then'](function(_0x1b268c){_0x545693(null,_0x1b268c);})[_0xaf1b('0x18')](function(_0x3d938e){_0x545693(_0x3d938e);});};AGIVertices['prototype'][_0xaf1b('0x8a')]=function(_0x30becf,_0x3c35db){scripts[_0xaf1b('0x8a')](this[_0xaf1b('0x11')]['uniqueid'],_0x30becf['aws_access_key_id'],_0x30becf['aws_secret_access_key'],_0x30becf[_0xaf1b('0x8b')],_0x30becf[_0xaf1b('0x5f')],_0x30becf[_0xaf1b('0x8c')])[_0xaf1b('0x16')](function(_0x289596){_0x3c35db(null,_0x289596);})[_0xaf1b('0x18')](function(_0x13419e){_0x3c35db(_0x13419e);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x8d')]=function(_0xab6da3,_0x251f81,_0x16a9fa){scripts[_0xaf1b('0x8d')](_0x251f81,_0xab6da3['key'],_0xab6da3[_0xaf1b('0x8e')]||_0xaf1b('0x60'))[_0xaf1b('0x16')](function(_0x6c1cdc){_0x16a9fa(null,_0x6c1cdc);})[_0xaf1b('0x18')](function(_0x32cc5f){_0x16a9fa(_0x32cc5f);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x8f')]=function(_0x19a443,_0x2c7e66,_0x2eb89d){scripts[_0xaf1b('0x8f')](_0x2c7e66,_0x19a443[_0xaf1b('0x90')],_0x19a443[_0xaf1b('0x91')],_0x19a443[_0xaf1b('0x72')])['then'](function(_0x13af91){_0x2eb89d(null,_0x13af91);})[_0xaf1b('0x18')](function(_0x42b7d4){_0x2eb89d(_0x42b7d4);});};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x92')]=function(_0x87dd65){var _0x3f2f3a=_['includes'](verticesWithRetry,_0x87dd65[_0xaf1b('0x3a')])?_0x87dd65:_[_0xaf1b('0x93')](_0x87dd65);for(var _0x5a17be in _0x3f2f3a){if(_0x3f2f3a[_0xaf1b('0x94')](_0x5a17be)){if(_0x3f2f3a[_0x5a17be]&&_[_0xaf1b('0x95')](_0x3f2f3a[_0x5a17be])){if(_[_0xaf1b('0x68')](recursiveMapAttributes,_0x5a17be)){_0x3f2f3a[_0x5a17be]=this[_0xaf1b('0x96')](_0x3f2f3a[_0x5a17be]);}else{_0x3f2f3a[_0x5a17be]=this[_0xaf1b('0x97')](_0x3f2f3a[_0x5a17be]);}}}}return _0x3f2f3a;};AGIVertices[_0xaf1b('0x1b')]['recursiveNodeIndex']=function(_0x2936a1){for(var _0x61a91 in _0x2936a1){if(_0x2936a1[_0xaf1b('0x94')](_0x61a91)){if(_[_0xaf1b('0x98')](_0x2936a1[_0x61a91])){this[_0xaf1b('0x99')](_0x2936a1[_0x61a91]);}else if(_[_0xaf1b('0x9a')](_0x2936a1[_0x61a91])){for(var _0x462f05=0x0;_0x462f05<_0x2936a1[_0x61a91][_0xaf1b('0x9b')];_0x462f05++){this[_0xaf1b('0x99')](_0x2936a1[_0x61a91][_0x462f05]);}}else if(_[_0xaf1b('0x95')](_0x2936a1[_0x61a91])){_0x2936a1[_0x61a91]=this[_0xaf1b('0x97')](_0x2936a1[_0x61a91]);}}}};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x9c')]=function(_0x126bb0,_0x45b82e){for(var _0x91d65b in _0x126bb0){if(_0x126bb0[_0xaf1b('0x94')](_0x91d65b)){if(_['isPlainObject'](_0x126bb0[_0x91d65b])){if(!_['isEmpty'](_0x126bb0[_0x91d65b])){this[_0xaf1b('0x9c')](_0x126bb0[_0x91d65b],util[_0xaf1b('0x56')](_0xaf1b('0x9d'),_0x45b82e,_0x91d65b));}}else if(_[_0xaf1b('0x9a')](_0x126bb0[_0x91d65b])){for(var _0x2e0c2b=0x0;_0x2e0c2b<_0x126bb0[_0x91d65b]['length'];_0x2e0c2b++){this[_0xaf1b('0x9c')](_0x126bb0[_0x91d65b][_0x2e0c2b],util['format'](_0xaf1b('0x9d'),_0x45b82e,_0x91d65b+'['+_0x2e0c2b+']'));}}else{if(!_[_0xaf1b('0x47')](_0x126bb0[_0x91d65b])){this['channel']['setVariable'](util[_0xaf1b('0x56')](_0xaf1b('0x9d'),_0x45b82e,_0x91d65b),_0x126bb0[_0x91d65b]);}}}}};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x96')]=function(_0x51f06b){try{var _0x33d54a=JSON[_0xaf1b('0x73')](_0x51f06b);this[_0xaf1b('0x99')](_0x33d54a);return JSON['stringify'](_0x33d54a);}catch(_0x275ff8){return this[_0xaf1b('0x97')](_0x51f06b);}};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x97')]=function(_0x59d301){var _0x3bcf6e=_0x59d301[_0xaf1b('0x9e')]('{');for(var _0x437d96=0x1;_0x437d96<_0x3bcf6e[_0xaf1b('0x9b')];_0x437d96+=0x1){var _0x5aa713=_0x3bcf6e[_0x437d96][_0xaf1b('0x9e')]('}');if(_0x5aa713['length']>0x1){_0x59d301=_0x59d301['replaceAll']('{'+_0x5aa713[0x0]+'}',this['channel'][_0xaf1b('0x14')](_0x5aa713[0x0])[_0xaf1b('0x9f')]||_0x5aa713[0x0]);}}if(_0x3bcf6e['length']===0x1){return _0x59d301[_0xaf1b('0x4e')]();}return this[_0xaf1b('0x97')](_0x59d301);};AGIVertices[_0xaf1b('0x1b')]['getAndSetVariable']=function(_0x1a06b0,_0x44d7ed){var _0x325dc8=this['channel'][_0xaf1b('0x14')](_0x1a06b0);if(_0x325dc8['result']===-0x1){return _0x325dc8;}logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0xa0'),_0x44d7ed,_0x325dc8[_0xaf1b('0x9f')]));return this['channel']['setVariable'](_0x44d7ed,_0x325dc8[_0xaf1b('0x9f')]);};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xa1')]=function(_0x26b5df){return _0x26b5df&&_0x26b5df!=='0'&&_0x26b5df!=='-1'&&_0x26b5df!=='';};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xa2')]=function(_0x540a55){this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x540a55,'-');_0x540a55[_0xaf1b('0xa3')]=_0x540a55[_0xaf1b('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xa4')]=function(_0x5c2fcb){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0xa5'),_0x5c2fcb['label']));if(!this[_0xaf1b('0xa1')](_0x5c2fcb['text'])){return this[_0xaf1b('0x11')]['noop'](_0xaf1b('0xa6'));}var _0x580c69='\x22'+_0x5c2fcb[_0xaf1b('0x5f')]+'\x22';if(this[_0xaf1b('0xa1')](_0x5c2fcb[_0xaf1b('0x7a')])){_0x580c69+=','+_0x5c2fcb[_0xaf1b('0x7a')];}var _0x1bb2c4=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0xaf1b('0xa7'),_0x580c69);if(_0x1bb2c4['result']===-0x1){return _0x1bb2c4;}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('Executed\x20command\x20MRCPSynth\x20%s',_0x580c69));};AGIVertices[_0xaf1b('0x1b')]['mrcprecog']=function(_0x1e3d83){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0xa9'),_0x1e3d83['label']));if(!this[_0xaf1b('0xa1')](_0x1e3d83[_0xaf1b('0xaa')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')]('no\x20grammar\x20configured');}var _0x34f90c=_0x1e3d83[_0xaf1b('0xaa')];if(this[_0xaf1b('0xa1')](_0x1e3d83['options'])){_0x34f90c+=','+_0x1e3d83[_0xaf1b('0x7a')];}var _0x342bcd=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0xaf1b('0xab'),_0x34f90c);if(_0x342bcd['result']===-0x1){return _0x342bcd;}var _0x46098b=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xaf1b('0xac'));if(_0x46098b[_0xaf1b('0xad')]===-0x1){return _0x46098b;}var _0x257436=this[_0xaf1b('0xae')](_0xaf1b('0xaf'),_0xaf1b('0xb0'));if(_0x257436['result']===-0x1){return _0x257436;}var _0xf0ba52=this[_0xaf1b('0xae')](_0xaf1b('0xb1'),_0xaf1b('0xb2'));if(_0xf0ba52[_0xaf1b('0xad')]===-0x1){return _0xf0ba52;}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0xb3'),_0x34f90c));};AGIVertices['prototype'][_0xaf1b('0xa')]=function(_0x205c35){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0xb4'),_0x205c35[_0xaf1b('0xb5')]));return this[_0xaf1b('0x11')]['agi']([_0x205c35['command'],_0x205c35[_0xaf1b('0xb6')]]);};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xb7')]=function(_0x396110){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0xb8'),_0x396110[_0xaf1b('0xb5')]));if(this[_0xaf1b('0xa1')](_0x396110[_0xaf1b('0x66')])){logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0xb9'),_0x396110['timeout']));var _0x4487b6=this[_0xaf1b('0x11')][_0xaf1b('0xba')](_0x396110[_0xaf1b('0x66')]);if(_0x4487b6['result']===-0x1){return _0x4487b6;}}return this['channel'][_0xaf1b('0xb7')]();};AGIVertices['prototype'][_0xaf1b('0xbb')]=function(_0x5737b3){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0xbc'),_0x5737b3[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x5737b3[_0xaf1b('0x4c')])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x5737b3,'no\x20list\x20selected');}_0x5737b3[_0xaf1b('0x4d')]=moment();if(this[_0xaf1b('0xa1')](_0x5737b3[_0xaf1b('0xbd')])){_0x5737b3[_0xaf1b('0x4d')]=moment()['add'](_0x5737b3[_0xaf1b('0xbd')],_0xaf1b('0xbe'));}if(!this[_0xaf1b('0xa1')](_0x5737b3[_0xaf1b('0x4f')])){_0x5737b3[_0xaf1b('0x4f')]=0x2;}this[_0xaf1b('0x45')]['sync'](this,_0x5737b3);return this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0xbf'),_0x5737b3['phone'],_0x5737b3[_0xaf1b('0x4c')],_0x5737b3['scheduledAt']));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xc0')]=function(_0x4fe816){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0xc1'),_0x4fe816[_0xaf1b('0xb5')]));var _0x36a6ff=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0x4fe816[_0xaf1b('0xc2')],_0x4fe816[_0xaf1b('0x7a')]);if(_0x36a6ff[_0xaf1b('0xad')]===-0x1){return _0x36a6ff;}return this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0xc3'),_0x4fe816['application'],_0x4fe816['options']));};AGIVertices[_0xaf1b('0x1b')]['lumenvoxtts']=function(_0x27a3cb){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0xc4'),_0x27a3cb['label']));if(!this['isConfigured'](_0x27a3cb[_0xaf1b('0x5f')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')]('no\x20text\x20configured');}var _0x119f16='\x22'+_0x27a3cb[_0xaf1b('0x5f')]+'\x22';if(this[_0xaf1b('0xa1')](_0x27a3cb['options'])){_0x119f16+=','+_0x27a3cb['options'];}var _0x1db2f4=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0xaf1b('0xa7'),_0x119f16);if(_0x1db2f4['result']===-0x1){return _0x1db2f4;}return this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0xc5'),_0x119f16));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xc6')]=function(_0x237d86){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x237d86[_0xaf1b('0xb5')]));if(!this['isConfigured'](_0x237d86[_0xaf1b('0x5f')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')]('no\x20text\x20configured');}var _0x526cb3='\x22'+_0x237d86[_0xaf1b('0x5f')]+'\x22';if(this[_0xaf1b('0xa1')](_0x237d86['options'])){_0x526cb3+=','+_0x237d86[_0xaf1b('0x7a')];}var _0x6b8d20=this[_0xaf1b('0x11')][_0xaf1b('0x5a')]('MRCPSynth',_0x526cb3);if(_0x6b8d20['result']===-0x1){return _0x6b8d20;}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0xc5'),_0x526cb3));};AGIVertices[_0xaf1b('0x1b')]['lumenvoxasr']=function(_0x457de9){logger['info'](util['format'](_0xaf1b('0xc7'),_0x457de9[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x457de9[_0xaf1b('0xaa')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xc8'));}var _0x118ba9=_0x457de9[_0xaf1b('0xaa')];if(this[_0xaf1b('0xa1')](_0x457de9[_0xaf1b('0x7a')])){_0x118ba9+=','+_0x457de9[_0xaf1b('0x7a')];}var _0x103b0c=this[_0xaf1b('0x11')]['exec'](_0xaf1b('0xab'),_0x118ba9);if(_0x103b0c[_0xaf1b('0xad')]===-0x1){return _0x103b0c;}var _0x54eb34=this[_0xaf1b('0xae')](_0xaf1b('0xc9'),_0xaf1b('0xca'));if(_0x54eb34[_0xaf1b('0xad')]===-0x1){return _0x54eb34;}var _0xf1e589=this[_0xaf1b('0xae')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0xf1e589[_0xaf1b('0xad')]===-0x1){return _0xf1e589;}var _0x132eee=this[_0xaf1b('0xae')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x132eee[_0xaf1b('0xad')]===-0x1){return _0x132eee;}return this['channel']['noop'](util[_0xaf1b('0x56')](_0xaf1b('0xb3'),_0x118ba9));};AGIVertices[_0xaf1b('0x1b')]['sestekasr']=function(_0x2dc67f){logger['info'](util['format'](_0xaf1b('0xcb'),_0x2dc67f['label']));if(!this['isConfigured'](_0x2dc67f[_0xaf1b('0xaa')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xc8'));}var _0x51ce99=_0x2dc67f[_0xaf1b('0xaa')];if(this[_0xaf1b('0xa1')](_0x2dc67f[_0xaf1b('0x7a')])){_0x51ce99+=','+_0x2dc67f[_0xaf1b('0x7a')];}var _0xb7f3b7=this[_0xaf1b('0x11')]['exec'](_0xaf1b('0xab'),_0x51ce99);if(_0xb7f3b7[_0xaf1b('0xad')]===-0x1){return _0xb7f3b7;}var _0x24990c=this['getAndSetVariable'](_0xaf1b('0xc9'),'SESTEK_ASR_CONFIDENCE');if(_0x24990c[_0xaf1b('0xad')]===-0x1){return _0x24990c;}var _0x1ba0b5=this[_0xaf1b('0xae')]('RECOG_INPUT()',_0xaf1b('0xcc'));if(_0x1ba0b5['result']===-0x1){return _0x1ba0b5;}var _0x52f9f0=this[_0xaf1b('0xae')]('RECOG_INSTANCE()',_0xaf1b('0xcd'));if(_0x52f9f0[_0xaf1b('0xad')]===-0x1){return _0x52f9f0;}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0xb3'),_0x51ce99));};AGIVertices[_0xaf1b('0x1b')]['database']=function(_0x37c5c6){logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0xce'),_0x37c5c6['label']));if(!this[_0xaf1b('0xa1')](_0x37c5c6[_0xaf1b('0xcf')])){return this[_0xaf1b('0x11')]['error'](_0x37c5c6,_0xaf1b('0xd0'));}var _0x111fcb=this[_0xaf1b('0x1e')][_0xaf1b('0x71')](this,_0x37c5c6[_0xaf1b('0xcf')]);if(!_0x111fcb){return this[_0xaf1b('0x11')]['error'](_0x37c5c6,'no\x20odbc\x20database\x20found');}if(!this[_0xaf1b('0xa1')](_0x37c5c6[_0xaf1b('0x31')])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x37c5c6,_0xaf1b('0xd1'));}var _0x18fec8=_0x37c5c6['query'][_0xaf1b('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xaf1b('0xa8')](util['format'](_0xaf1b('0xd2'),_0x18fec8));var _0x502297=this['getQueryOdbc'][_0xaf1b('0x71')](this,_0x111fcb,_0x18fec8);this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x37c5c6,_0x18fec8);if(!this[_0xaf1b('0xa1')](_0x37c5c6[_0xaf1b('0xd3')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x35c2ea=this[_0xaf1b('0x14')][_0xaf1b('0x71')](this,_0x37c5c6['variable_id']);if(!_0x35c2ea){return this['channel']['error'](_0x37c5c6,_0xaf1b('0xd4'));}var _0x4ef763=this;_0x502297[_0xaf1b('0xd5')](function(_0x3aa053,_0x157338){Object['keys'](_0x3aa053)[_0xaf1b('0xd5')](function(_0x279e65){_0x4ef763[_0xaf1b('0x11')]['setVariable'](util[_0xaf1b('0x56')]('%s[%s][%s]',_0x35c2ea,_0x157338,_0x279e65),_0x3aa053[_0x279e65]);});});this['channel'][_0xaf1b('0xd6')](util[_0xaf1b('0x56')](_0xaf1b('0xd7'),_0x35c2ea),_0x502297['length']);return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util['format'](_0xaf1b('0xd8'),_0x35c2ea));};AGIVertices[_0xaf1b('0x1b')]['dial']=function(_0x5005c4){logger[_0xaf1b('0xd9')](util[_0xaf1b('0x56')](_0xaf1b('0xda'),_0x5005c4[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x5005c4[_0xaf1b('0xdb')])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x5005c4,_0xaf1b('0xdc'));}var _0x5f8837=this['getUser'][_0xaf1b('0x71')](this,_0x5005c4[_0xaf1b('0xdb')]);if(!_0x5f8837){return this[_0xaf1b('0x11')]['error'](_0x5005c4,'no\x20user\x20found');}var _0x80966=this[_0xaf1b('0x11')]['exec'](_0xaf1b('0xdd'),[util[_0xaf1b('0x56')](_0xaf1b('0xde'),_0x5f8837),_0x5005c4[_0xaf1b('0x66')],_0x5005c4[_0xaf1b('0xdf')],_0x5005c4[_0xaf1b('0x65')]]);if(_0x80966[_0xaf1b('0xad')]===-0x1){return _0x80966;}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('Executed\x20command\x20%s',_0xaf1b('0xdd')));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xe0')]=function(_0x437dd9){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0xe1'),_0x437dd9[_0xaf1b('0xb5')]));if(!this['isConfigured'](_0x437dd9[_0xaf1b('0x7c')])){return this['channel'][_0xaf1b('0xa8')]('no\x20key\x20configured');}if(!this[_0xaf1b('0xa1')](_0x437dd9['text'])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xa6'));}this['channel'][_0xaf1b('0xe2')]=!![];this[_0xaf1b('0x38')](_0x437dd9);this[_0xaf1b('0x44')](_0x437dd9['text'],'in');this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0xe3'),_0x437dd9['text']));var _0x3d4545=this[_0xaf1b('0x7b')][_0xaf1b('0x71')](this,_0x437dd9);if(_0x3d4545){for(var _0x5a1ad1 in _0x3d4545){if(_0x3d4545[_0xaf1b('0x94')](_0x5a1ad1)){this[_0xaf1b('0x11')][_0xaf1b('0xd6')](util['format'](_0xaf1b('0xe4'),_0x5a1ad1['toUpperCase']()),_0x3d4545[_0x5a1ad1]);}}this[_0xaf1b('0x44')](_0x3d4545[_0xaf1b('0xe5')],_0xaf1b('0xe6'));return this[_0xaf1b('0x11')]['noop'](util['format'](_0xaf1b('0xe7'),_0x3d4545['speech']));}return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x437dd9,_0xaf1b('0xe8'));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xe9')]=function(_0x251381){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0xea'),_0x251381['label']));if(!this['isConfigured'](_0x251381[_0xaf1b('0xeb')])){return this['channel'][_0xaf1b('0xa8')](_0xaf1b('0xec'));}if(!this[_0xaf1b('0xa1')](_0x251381[_0xaf1b('0xed')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xee'));}if(!this[_0xaf1b('0xa1')](_0x251381['password'])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xef'));}if(!this[_0xaf1b('0xa1')](_0x251381[_0xaf1b('0xf0')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xa6'));}this[_0xaf1b('0x11')][_0xaf1b('0xe2')]=!![];this[_0xaf1b('0x38')](_0x251381);this[_0xaf1b('0x44')](_0x251381[_0xaf1b('0x5f')],'in');this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util['format'](_0xaf1b('0xf1'),_0x251381[_0xaf1b('0x5f')]));var _0x50d45f=this[_0xaf1b('0x7e')][_0xaf1b('0x71')](this,_0x251381);if(_0x50d45f){for(var _0x3af715 in _0x50d45f){if(_0x50d45f['hasOwnProperty'](_0x3af715)){this[_0xaf1b('0x11')][_0xaf1b('0xd6')](util['format'](_0xaf1b('0xf2'),_0x3af715['toUpperCase']()),_0x50d45f[_0x3af715]);}}this[_0xaf1b('0x44')](_0x50d45f[_0xaf1b('0xe5')],'out');if(_0x50d45f[_0xaf1b('0xf3')]){this['channel']['noop'](util[_0xaf1b('0x56')](_0xaf1b('0xf4'),_0x50d45f['audiofile']));var _0x554856=this[_0xaf1b('0x11')][_0xaf1b('0xf5')](_0x50d45f[_0xaf1b('0xf3')]);try{fs[_0xaf1b('0xf6')](_0x50d45f[_0xaf1b('0xf3')]+'.wav');}catch(_0x5484a4){logger[_0xaf1b('0x35')](_0x5484a4);}return _0x554856;}else{return this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0xf7'),_0x50d45f['speech']));}}return this[_0xaf1b('0x11')]['error'](_0x251381,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xaf1b('0x1b')]['end']=function(_0x474526){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0xf8'),_0x474526['label']));return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xf9'));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xfa')]=function(_0x25e8d9){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0xfb'),_0x25e8d9[_0xaf1b('0xb5')]));var _0x3f25ab='';if(_0x25e8d9[_0xaf1b('0xfc')]){if(!this[_0xaf1b('0xa1')](_0x25e8d9[_0xaf1b('0xfc')])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x25e8d9,_0xaf1b('0xfd'));}else{var _0x549d45=parseInt(_0x25e8d9[_0xaf1b('0xfc')],0xa);if(isNaN(_0x549d45)){_0x3f25ab=_0x25e8d9[_0xaf1b('0xfc')];}else{_0x3f25ab=this['getTrunk'][_0xaf1b('0x71')](this,_0x25e8d9[_0xaf1b('0xfc')]);if(!_0x3f25ab){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x25e8d9,_0xaf1b('0xfe'));}}}}else if(_0x25e8d9[_0xaf1b('0xff')]){_0x3f25ab=_0x25e8d9['trunk_name'];}else{return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x25e8d9,_0xaf1b('0xfd'));}var _0xbe5854=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0xaf1b('0xdd'),[util[_0xaf1b('0x56')](_0xaf1b('0x100'),_0x3f25ab,_0x25e8d9[_0xaf1b('0x4b')]),_0x25e8d9['timeout'],_0x25e8d9[_0xaf1b('0xdf')],_0x25e8d9[_0xaf1b('0x65')]]);if(_0xbe5854[_0xaf1b('0xad')]===-0x1){return _0xbe5854;}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x101'),'DIAL'));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x102')]=function(_0x56c7ef){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x103'),_0x56c7ef[_0xaf1b('0xb5')]));return this[_0xaf1b('0x11')]['noop'](_0xaf1b('0x102'));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xf')]=function(_0x44adf4){logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0x104'),_0x44adf4[_0xaf1b('0xb5')]));if(_0x44adf4[_0xaf1b('0xa3')]===0x0){return this[_0xaf1b('0xa2')](_0x44adf4);}_0x44adf4[_0xaf1b('0xa3')]-=0x1;if(!this[_0xaf1b('0xa1')](_0x44adf4['file_id'])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x44adf4,_0xaf1b('0x105'));}var _0xb95122=this[_0xaf1b('0x23')][_0xaf1b('0x71')](this,_0x44adf4['file_id']);if(!_0xb95122){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x44adf4,'no\x20file\x20audio\x20found');}if(!this[_0xaf1b('0xa1')](_0x44adf4[_0xaf1b('0xd3')])){return this['channel']['error'](_0xaf1b('0x106'));}var _0x2dca03=this[_0xaf1b('0x11')][_0xaf1b('0x107')](_0xb95122,_0x44adf4[_0xaf1b('0x108')],_0x44adf4[_0xaf1b('0x109')]);var _0x2157d2=_0x2dca03[_0xaf1b('0xad')]?_0x2dca03[_0xaf1b('0xad')]['toString']():'';logger['info'](_0xaf1b('0x10a'),JSON['stringify'](_0x2dca03));if(_0x2dca03[_0xaf1b('0xad')]===-0x1){this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x44adf4,_0x2157d2);return _0x2dca03;}else if(_0x2dca03[_0xaf1b('0x9f')]===_0xaf1b('0x66')){_0x2dca03['result']=_0x2157d2['length']>=parseInt(_0x44adf4[_0xaf1b('0x10b')])?'x':'i';}else{_0x2dca03[_0xaf1b('0xad')]=_0x2157d2['length']>=parseInt(_0x44adf4['mindigit'])&&_0x2157d2[_0xaf1b('0x9b')]<=parseInt(_0x44adf4['maxdigit'])?'x':'i';}var _0x24edb1=this[_0xaf1b('0x14')][_0xaf1b('0x71')](this,_0x44adf4[_0xaf1b('0xd3')]);if(!_0x24edb1){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x44adf4,'no\x20variable\x20found');}this[_0xaf1b('0x11')]['setVariable'](_0x24edb1,_0x2157d2);if(this[_0xaf1b('0xa1')](_0x44adf4[_0xaf1b('0x10c')])){var _0x182ee1=parseInt(_0x44adf4[_0xaf1b('0x10c')],0xa);var _0x498b69=rs['generate']({'charset':'*','length':_0x182ee1});var _0x48ca95=_0x2157d2['length'];if(_0x48ca95>0x0){if(_0x48ca95>_0x182ee1){this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x44adf4,_0x44adf4[_0xaf1b('0x10d')]===_0xaf1b('0x10e')?_0x498b69+_0x2157d2[_0xaf1b('0x10f')](_0x182ee1):_0x2157d2[_0xaf1b('0x10f')](0x0,_0x48ca95-_0x182ee1)+_0x498b69);}else{this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x44adf4,rs[_0xaf1b('0x110')]({'charset':'*','length':_0x48ca95}));}}else{this[_0xaf1b('0x38')]['sync'](this,_0x44adf4,'');}}else{this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x44adf4,_0x2157d2);}return _0x2dca03;};AGIVertices[_0xaf1b('0x1b')]['getsecretdigits']=function(_0x24a371){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x24a371[_0xaf1b('0xb5')]));return this[_0xaf1b('0xf')](_0x24a371);};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x111')]=function(_0x353264){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x112'),_0x353264[_0xaf1b('0xb5')]));this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x353264,_0x353264[_0xaf1b('0x113')]);return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('GOAL\x20%s',_0x353264['goalname']));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x114')]=function(_0x3b9686){logger['info'](util[_0xaf1b('0x56')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x3b9686[_0xaf1b('0xb5')]));if(!this['isConfigured'](_0x3b9686['aws_access_key_id'])||!this[_0xaf1b('0xa1')](_0x3b9686[_0xaf1b('0x86')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xaf1b('0xa1')](_0x3b9686[_0xaf1b('0x5f')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xa6'));}this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x115'),_0x3b9686['text']));var _0x1c7fe3=this['awsPolly'][_0xaf1b('0x71')](this,_0x3b9686);if(_0x1c7fe3){this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x1c7fe3));var _0x26909a=this[_0xaf1b('0x11')][_0xaf1b('0xf5')](_0x1c7fe3);try{fs['unlink'](_0x1c7fe3+_0xaf1b('0x116'));}catch(_0x58ed10){logger[_0xaf1b('0x35')](_0x58ed10);}return _0x26909a;}return this[_0xaf1b('0x11')]['error'](_0x3b9686,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x117')]=function(_0xde899b){logger['info'](util[_0xaf1b('0x56')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0xde899b[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0xde899b[_0xaf1b('0x85')])||!this[_0xaf1b('0xa1')](_0xde899b[_0xaf1b('0x86')])){return this['channel']['noop'](_0xaf1b('0x118'));}if(!this[_0xaf1b('0xa1')](_0xde899b['aws_bot_name'])){return this['channel'][_0xaf1b('0xa8')](_0xaf1b('0x119'));}if(!this[_0xaf1b('0xa1')](_0xde899b[_0xaf1b('0x5f')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xa6'));}this[_0xaf1b('0x11')][_0xaf1b('0xe2')]=!![];this[_0xaf1b('0x38')](_0xde899b);this[_0xaf1b('0x44')](_0xde899b[_0xaf1b('0x5f')],'in');this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('Trying\x20Amazon\x20Lex:\x20%s',_0xde899b[_0xaf1b('0x5f')]));var _0x2b63e0=this['awsLex'][_0xaf1b('0x71')](this,_0xde899b);if(_0x2b63e0){for(var _0x42fc01 in _0x2b63e0){if(_0x2b63e0[_0xaf1b('0x94')](_0x42fc01)&&_[_0xaf1b('0x95')](_0x2b63e0[_0x42fc01])){this[_0xaf1b('0x11')][_0xaf1b('0xd6')](util[_0xaf1b('0x56')](_0xaf1b('0x11a'),_0x42fc01[_0xaf1b('0x6c')]()),_0x2b63e0[_0x42fc01]);}}if(_['isNil'](_0x2b63e0['message'])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x11b'));}else{this['createSquareMessage'](_0x2b63e0[_0xaf1b('0x78')],_0xaf1b('0xe6'));return this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('Amazon\x20Lex\x20Result\x20%s',_0x2b63e0['message']));}}return this[_0xaf1b('0x11')]['error'](_0xde899b,_0xaf1b('0x11c'));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x11d')]=function(_0x539ba4){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x11e'),_0x539ba4[_0xaf1b('0xb5')],_0x539ba4['timeout']));if(!this[_0xaf1b('0xa1')](_0x539ba4[_0xaf1b('0x7c')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x11f'));}var _0x615664='wav';var _0x4bb6f2=util[_0xaf1b('0x56')](_0xaf1b('0x120'),FILES_PATH,rs['generate'](0x4));var _0x594415=util[_0xaf1b('0x56')]('%s.%s',_0x4bb6f2,_0x615664);var _0xc894d=!![];if(_0x539ba4[_0xaf1b('0x121')]===_0xaf1b('0x122')){_0xc894d=![];}var _0x568772=this[_0xaf1b('0x11')][_0xaf1b('0x123')](_0x4bb6f2,_0x615664,_0x539ba4[_0xaf1b('0x124')],_0x539ba4['timeout'],undefined,_0xc894d);if(_0x568772['result']!==-0x1){this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x125'),_0x594415));var _0x51585a=this[_0xaf1b('0x8d')][_0xaf1b('0x71')](this,_0x539ba4,_0x594415);if(_0x51585a){for(var _0x37286d in _0x51585a){if(_0x51585a[_0xaf1b('0x94')](_0x37286d)){this[_0xaf1b('0x11')][_0xaf1b('0xd6')](util['format'](_0xaf1b('0x126'),_0x37286d[_0xaf1b('0x6c')]()),_0x51585a[_0x37286d]);}}return this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0x127'),JSON[_0xaf1b('0x75')](_0x51585a)));}}return _0x568772;};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x128')]=function(_0x43f231){logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0x129'),_0x43f231[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x43f231[_0xaf1b('0x90')])){return this['channel']['noop']('no\x20appid\x20configured');}if(!this[_0xaf1b('0xa1')](_0x43f231['appsecret'])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x12a'));}var _0x2153c8=_0xaf1b('0x12b');var _0x100a0c=util['format'](_0xaf1b('0x120'),FILES_PATH,rs[_0xaf1b('0x110')](0x4));var _0xd5df70=util['format'](_0xaf1b('0x9d'),_0x100a0c,_0x2153c8);var _0x1c21f3=!![];if(_0x43f231[_0xaf1b('0x121')]===_0xaf1b('0x122')){_0x1c21f3=![];}var _0x4f8700=this[_0xaf1b('0x11')]['recordFile'](_0x100a0c,_0x2153c8,_0x43f231['intKey'],_0x43f231[_0xaf1b('0x66')],undefined,_0x1c21f3);if(_0x4f8700[_0xaf1b('0xad')]!==-0x1){this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x12c'),_0xd5df70));var _0x4be87f=this[_0xaf1b('0x8f')]['sync'](this,_0x43f231,_0xd5df70);if(_0x4be87f){for(var _0x490de9 in _0x4be87f){if(_0x4be87f[_0xaf1b('0x94')](_0x490de9)){this['channel']['setVariable'](util[_0xaf1b('0x56')]('TILDE_ASR_%s',_0x490de9['toUpperCase']()),_0x4be87f[_0x490de9]);}}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x12d'),JSON[_0xaf1b('0x75')](_0x4be87f)));}}return _0x4f8700;};AGIVertices[_0xaf1b('0x1b')]['gotoc']=function(_0x149def){logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0x12e'),_0x149def[_0xaf1b('0xb5')]));return this[_0xaf1b('0x11')]['continueAt'](_0x149def[_0xaf1b('0x3f')],_0x149def[_0xaf1b('0x40')],_0x149def[_0xaf1b('0x41')]);};AGIVertices['prototype']['gotoif']=function(_0x2e0490){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x12f'),_0x2e0490[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x2e0490[_0xaf1b('0x130')])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x2e0490,_0xaf1b('0x131'));}try{var _0x47c2d7=eval(_0x2e0490[_0xaf1b('0x130')])?'true':_0xaf1b('0x132');this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2e0490[_0xaf1b('0x130')],_0x47c2d7));return{'code':0xc8,'result':_0x47c2d7};}catch(_0x297124){return{'code':0xc8,'result':_0xaf1b('0x132')};}};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x133')]=function(_0x284617){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x134'),_0x284617[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x284617[_0xaf1b('0x135')])){return this['channel'][_0xaf1b('0x35')](_0x284617,'no\x20interval\x20configured');}var _0x2a726f=this['getIntervals'][_0xaf1b('0x71')](this,_0x284617['interval_id']);if(!_0x2a726f){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x284617,_0xaf1b('0x136'));}for(var _0x374947=0x0;_0x374947<_0x2a726f[_0xaf1b('0x9b')];_0x374947+=0x1){var _0x5f0899=this[_0xaf1b('0x11')][_0xaf1b('0x14')](util['format']('IFTIME(%s?true:false)',_0x2a726f[_0x374947]));if(_0x5f0899[_0xaf1b('0xad')]===-0x1){return _0x5f0899;}logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x137'),_0x2a726f[_0x374947],_0x5f0899[_0xaf1b('0x9f')]));if(_0x5f0899[_0xaf1b('0x9f')]==='true'){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x137'),_0x2a726f[_0x374947],'true'));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x137'),_0x2a726f[_0x374947],_0xaf1b('0x138')));return{'code':0xc8,'result':_0xaf1b('0x138')};}else{logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0x137'),_0x2a726f[_0x374947],'false'));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x137'),_0x2a726f[_0x374947],_0xaf1b('0x132')));}}return{'code':0xc8,'result':_0xaf1b('0x132')};};AGIVertices['prototype']['hangup']=function(_0x58fdbb){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x139'),_0x58fdbb['label']));return this['channel'][_0xaf1b('0x13a')]();};AGIVertices['prototype'][_0xaf1b('0x13b')]=function(_0x403271){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x403271[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x403271[_0xaf1b('0x7c')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x11f'));}var _0x4ce90e=_0xaf1b('0x12b');var _0x148256=util['format'](_0xaf1b('0x120'),FILES_PATH,rs[_0xaf1b('0x110')](0x4));var _0x271154=util['format']('%s.%s',_0x148256,_0x4ce90e);var _0x487b5f=!![];if(_0x403271[_0xaf1b('0x121')]===_0xaf1b('0x122')){_0x487b5f=![];}var _0x49401c=this[_0xaf1b('0x11')]['recordFile'](_0x148256,_0x4ce90e,_0x403271[_0xaf1b('0x124')],_0x403271[_0xaf1b('0x66')],undefined,_0x487b5f);if(_0x49401c[_0xaf1b('0xad')]!==-0x1){this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0x13c'),_0x271154));var _0x4b1c47=this['ispeechASR'][_0xaf1b('0x71')](this,_0x403271,_0x271154);if(_0x4b1c47){for(var _0x1ae3e3 in _0x4b1c47){if(_0x4b1c47[_0xaf1b('0x94')](_0x1ae3e3)){this[_0xaf1b('0x11')][_0xaf1b('0xd6')](util[_0xaf1b('0x56')]('ISPEECH_ASR_%s',_0x1ae3e3['toUpperCase']()),_0x4b1c47[_0x1ae3e3]);}}return this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0x13d'),JSON[_0xaf1b('0x75')](_0x4b1c47)));}}return _0x49401c;};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x13e')]=function(_0x6a24f3){logger['info'](util['format'](_0xaf1b('0x13f'),_0x6a24f3[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x6a24f3[_0xaf1b('0x7c')])){return this[_0xaf1b('0x11')]['noop'](_0xaf1b('0x11f'));}if(!this[_0xaf1b('0xa1')](_0x6a24f3[_0xaf1b('0x5f')])){return this[_0xaf1b('0x11')]['noop'](_0xaf1b('0xa6'));}this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x140'),_0x6a24f3['text']));var _0x2d5cd1=this[_0xaf1b('0x7f')][_0xaf1b('0x71')](this,_0x6a24f3);if(_0x2d5cd1){this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('ispeech\x20%s\x20file\x20created',_0x2d5cd1));var _0x1ab4b0=this['channel']['streamFile'](_0x2d5cd1,_0x6a24f3['intKey']);try{fs[_0xaf1b('0xf6')](_0x2d5cd1+_0xaf1b('0x116'));}catch(_0x3f25ea){logger[_0xaf1b('0x35')](_0x3f25ea);}return _0x1ab4b0;}return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x6a24f3,_0xaf1b('0x141'));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x142')]=function(_0x205415){logger[_0xaf1b('0x30')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x205415[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x205415['findBy'])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x205415,_0xaf1b('0x143'));}logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0x144'),this['channel'][_0xaf1b('0x3c')],_0x205415[_0xaf1b('0x145')]));var _0x285cf5=this[_0xaf1b('0x54')][_0xaf1b('0x71')](this,_0x205415['findBy']);if(_0x285cf5){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x146'),this[_0xaf1b('0x11')]['callerid'],_0x205415[_0xaf1b('0x145')]));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x146'),this[_0xaf1b('0x11')]['callerid'],_0x205415[_0xaf1b('0x145')]));return{'code':0xc8,'result':'success'};}else{logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x147'),this[_0xaf1b('0x11')][_0xaf1b('0x3c')],_0x205415[_0xaf1b('0x145')]));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x147'),this['channel'][_0xaf1b('0x3c')],_0x205415[_0xaf1b('0x145')]));return{'code':0xc8,'result':_0xaf1b('0x148')};}};AGIVertices[_0xaf1b('0x1b')]['logout']=function(_0x3adb54){logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0x149'),_0x3adb54['label']));if(!this[_0xaf1b('0xa1')](_0x3adb54[_0xaf1b('0x145')])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x3adb54,_0xaf1b('0x143'));}logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x144'),this['channel'][_0xaf1b('0x3c')],_0x3adb54[_0xaf1b('0x145')]));var _0x5f06d9=this['agentLogout'][_0xaf1b('0x71')](this,_0x3adb54[_0xaf1b('0x145')]);if(_0x5f06d9){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xaf1b('0x11')][_0xaf1b('0x3c')],_0x3adb54[_0xaf1b('0x145')]));this[_0xaf1b('0x11')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x3adb54['findBy']));return{'code':0xc8,'result':_0xaf1b('0x14a')};}else{logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x147'),this[_0xaf1b('0x11')]['callerid'],_0x3adb54['findBy']));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x147'),this['channel'][_0xaf1b('0x3c')],_0x3adb54[_0xaf1b('0x145')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xaf1b('0x14b')]=function(_0x252def){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x252def[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x252def['operation'])){return this['channel'][_0xaf1b('0x35')](_0x252def,_0xaf1b('0x14c'));}this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('math\x20%s',_0x252def[_0xaf1b('0x14d')]));var _0x271ca6=eval(_0x252def['operation']);if(!this[_0xaf1b('0xa1')](_0x252def['variable_id'])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x106'));}var _0x3fbe1c=this[_0xaf1b('0x14')][_0xaf1b('0x71')](this,_0x252def[_0xaf1b('0xd3')]);if(!_0x3fbe1c){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x252def,_0xaf1b('0xd4'));}if(_[_0xaf1b('0x9a')](_0x271ca6)){var _0x282cd7=this;_0x271ca6[_0xaf1b('0xd5')](function(_0x5ece2d,_0x31ddae){_0x282cd7['channel'][_0xaf1b('0xd6')](util[_0xaf1b('0x56')](_0xaf1b('0x14e'),_0x3fbe1c,_0x31ddae),_0x5ece2d);});return this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('variable\x20%s[key]\x20set',_0x3fbe1c));}else{return this[_0xaf1b('0x11')]['setVariable'](_0x3fbe1c,_0x271ca6);}};AGIVertices['prototype'][_0xaf1b('0xe')]=function(_0x46acd8){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x14f'),_0x46acd8[_0xaf1b('0xb5')]));if(_0x46acd8[_0xaf1b('0xa3')]===0x0){return this[_0xaf1b('0xa2')](_0x46acd8);}_0x46acd8[_0xaf1b('0xa3')]-=0x1;if(!this['isConfigured'](_0x46acd8[_0xaf1b('0x150')])){return this['channel'][_0xaf1b('0x35')](_0x46acd8,_0xaf1b('0x105'));}var _0x20933e=this[_0xaf1b('0x23')][_0xaf1b('0x71')](this,_0x46acd8[_0xaf1b('0x150')]);if(!_0x20933e){return this['channel']['error'](_0x46acd8,_0xaf1b('0x151'));}var _0x59e5d7=this[_0xaf1b('0x11')]['getData'](_0x20933e,_0x46acd8[_0xaf1b('0x108')],_0x46acd8[_0xaf1b('0x152')]);var _0x4b77dd=_0x59e5d7[_0xaf1b('0xad')];if(_0x59e5d7[_0xaf1b('0xad')]===-0x1){this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x46acd8,'-1');return _0x59e5d7;}else if(_0x59e5d7[_0xaf1b('0x9f')]===_0xaf1b('0x66')){_0x59e5d7[_0xaf1b('0xad')]=_0x59e5d7[_0xaf1b('0xad')][_0xaf1b('0x9b')]>0x0?_0x59e5d7[_0xaf1b('0xad')]:'t';}else if(_['isEmpty'](_0x59e5d7['result'])){_0x59e5d7[_0xaf1b('0xad')]='#';_0x4b77dd='#';}if(!this[_0xaf1b('0xa1')](_0x46acd8[_0xaf1b('0xd3')])){this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x106'));}else{var _0x12fa43=this[_0xaf1b('0x14')][_0xaf1b('0x71')](this,_0x46acd8['variable_id']);if(!_0x12fa43){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x46acd8,_0xaf1b('0xd4'));}this[_0xaf1b('0x11')]['setVariable'](_0x12fa43,_0x4b77dd);}this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x46acd8,_0x4b77dd);return _0x59e5d7;};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0xa8')]=function(_0x51a6db){logger['info'](util['format'](_0xaf1b('0x153'),_0x51a6db[_0xaf1b('0xb5')]));return this['channel']['noop'](_0x51a6db[_0xaf1b('0x154')]||_0x51a6db['label']);};AGIVertices[_0xaf1b('0x1b')]['pause']=function(_0x174d40){logger['info'](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x174d40[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x174d40['findBy'])){return this['channel'][_0xaf1b('0x35')](_0x174d40,_0xaf1b('0x143'));}logger['info'](util[_0xaf1b('0x56')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xaf1b('0x11')][_0xaf1b('0x3c')],_0x174d40[_0xaf1b('0x145')]));var _0x651fd1=this[_0xaf1b('0x155')][_0xaf1b('0x71')](this,_0x174d40[_0xaf1b('0x156')]);var _0x92352=this[_0xaf1b('0x50')][_0xaf1b('0x71')](this,_0x174d40[_0xaf1b('0x145')],_0x651fd1);if(_0x92352){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x146'),this[_0xaf1b('0x11')][_0xaf1b('0x3c')],_0x174d40['findBy']));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xaf1b('0x11')]['callerid'],_0x174d40[_0xaf1b('0x145')]));return{'code':0xc8,'result':_0xaf1b('0x14a')};}else{logger[_0xaf1b('0x30')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xaf1b('0x11')]['callerid'],_0x174d40[_0xaf1b('0x145')]));this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0x146'),this[_0xaf1b('0x11')][_0xaf1b('0x3c')],_0x174d40[_0xaf1b('0x145')]));return{'code':0xc8,'result':_0xaf1b('0x148')};}};AGIVertices[_0xaf1b('0x1b')]['playback']=function(_0x2c6eef){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x157'),_0x2c6eef[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x2c6eef[_0xaf1b('0x150')])){return this[_0xaf1b('0x11')]['error'](_0x2c6eef,_0xaf1b('0x105'));}var _0x4b7638=this[_0xaf1b('0x23')][_0xaf1b('0x71')](this,_0x2c6eef[_0xaf1b('0x150')]);if(!_0x4b7638){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x2c6eef,'no\x20file\x20audio\x20found');}var _0x51342f=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0xaf1b('0x158'),[_0x4b7638,_0x2c6eef[_0xaf1b('0xdf')]]);if(_0x51342f[_0xaf1b('0xad')]===-0x1){return _0x51342f;}return this['channel']['noop'](util['format'](_0xaf1b('0xc3'),_0xaf1b('0x158'),_0x4b7638));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x159')]=function(_0x436633){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x15a'),_0x436633[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x436633[_0xaf1b('0x15b')])){return this[_0xaf1b('0x11')]['error'](_0x436633,_0xaf1b('0x15c'));}var _0x4e4bb7='';var _0x45e007=parseInt(_0x436633[_0xaf1b('0x15b')],0xa);if(isNaN(_0x45e007)){_0x4e4bb7=_0x436633[_0xaf1b('0x15b')];}else{_0x4e4bb7=this[_0xaf1b('0x19')][_0xaf1b('0x71')](this,_0x436633[_0xaf1b('0x15b')]);if(!_0x4e4bb7){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x436633,_0xaf1b('0x15d'));}}var _0x5cc061='';if(this[_0xaf1b('0xa1')](_0x436633[_0xaf1b('0x150')])){var _0x3e6673=this[_0xaf1b('0x23')]['sync'](this,_0x436633[_0xaf1b('0x150')]);if(_0x3e6673){_0x5cc061=_0x3e6673;}}this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x436633,_0x4e4bb7);if(_0x436633[_0xaf1b('0xdf')][_0xaf1b('0x15e')]('x')<0x0){_0x436633['opts']+='x';}if(_0x436633[_0xaf1b('0xdf')][_0xaf1b('0x15e')]('X')<0x0){_0x436633[_0xaf1b('0xdf')]+='X';}this[_0xaf1b('0x11')][_0xaf1b('0xd6')](_0xaf1b('0x15f'),_0x4e4bb7?_0x4e4bb7['toLowerCase']():'');var _0x2c3699=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0xaf1b('0x160'),[_0x4e4bb7,_0x436633['opts'],_0x436633[_0xaf1b('0x65')],_0x5cc061,_0x436633['timeout'],_0x436633[_0xaf1b('0xa')],_0x436633['macro'],_0x436633[_0xaf1b('0x161')],'',_0x436633[_0xaf1b('0x162')]]);if(_0x2c3699[_0xaf1b('0xad')]===-0x1){return _0x2c3699;}return this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0xc3'),_0xaf1b('0x160'),_0x4e4bb7));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x163')]=function(_0x2d8f43){logger['info'](util[_0xaf1b('0x56')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x2d8f43[_0xaf1b('0xb5')]));var _0x3287fb=_0x2d8f43[_0xaf1b('0x164')]||'wav';var _0x478924=util[_0xaf1b('0x56')](_0xaf1b('0x165'),this[_0xaf1b('0x11')]['uniqueid'],rs['generate'](0x5));var _0x5807a1=util[_0xaf1b('0x56')](_0xaf1b('0x166'),FILES_PATH,_0x478924,_0x3287fb);var _0x1da003=util[_0xaf1b('0x56')](_0xaf1b('0x120'),FILES_PATH,_0x478924);this['createSquareRecording'][_0xaf1b('0x71')](this,_0x2d8f43,_0x478924,_0x5807a1);this[_0xaf1b('0x11')][_0xaf1b('0xd6')](_0xaf1b('0x167'),_0x478924);logger[_0xaf1b('0x30')](_0xaf1b('0x168'),_0x1da003,_0x3287fb,_0x2d8f43['escape_digits'],_0x2d8f43[_0xaf1b('0x66')]);return this[_0xaf1b('0x11')][_0xaf1b('0x123')](_0x1da003,_0x3287fb,_0x2d8f43['escape_digits'],_0x2d8f43[_0xaf1b('0x66')],undefined,!![]);};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x169')]=function(_0x17b2c7){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x16a'),_0x17b2c7[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x17b2c7[_0xaf1b('0x65')])){return this['channel']['noop'](_0xaf1b('0x16b'));}var _0x1f5426=this['restAPI'][_0xaf1b('0x71')](this,_0x17b2c7);logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x16c'),util['inspect'](_0x1f5426,{'showHidden':![],'depth':null})));if(!this[_0xaf1b('0xa1')](_0x17b2c7[_0xaf1b('0xd3')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x16d'));}var _0x3c5e91=this[_0xaf1b('0x14')][_0xaf1b('0x71')](this,_0x17b2c7[_0xaf1b('0xd3')]);if(!_0x3c5e91){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x17b2c7,_0xaf1b('0xd4'));}this[_0xaf1b('0x11')]['setVariable'](util[_0xaf1b('0x56')](_0xaf1b('0x16e'),_0x3c5e91),_0x1f5426['statusCode']?_0x1f5426[_0xaf1b('0x76')]:'200');this['channel'][_0xaf1b('0xd6')](util[_0xaf1b('0x56')](_0xaf1b('0x16f'),_0x3c5e91),_0x1f5426[_0xaf1b('0x77')]?_0x1f5426[_0xaf1b('0x77')]:'OK');if(_0x1f5426[_0xaf1b('0x6d')]){try{this[_0xaf1b('0x9c')](_0x1f5426['body'],_0x3c5e91);}catch(_0x4e3dff){logger[_0xaf1b('0x35')](util[_0xaf1b('0x56')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x3c5e91));}}return this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0xd8'),_0x3c5e91));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x170')]=function(_0x154e37){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x171'),_0x154e37[_0xaf1b('0xb5')]));return this[_0xaf1b('0x11')]['sayDigits'](_0x154e37['digits'][_0xaf1b('0x5c')](/\s+/g,''),_0x154e37[_0xaf1b('0x172')]);};AGIVertices[_0xaf1b('0x1b')]['saynumber']=function(_0x493bc9){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x173'),_0x493bc9[_0xaf1b('0xb5')]));return this[_0xaf1b('0x11')][_0xaf1b('0x174')](_0x493bc9[_0xaf1b('0x67')]['replace'](/\s+/g,''),_0x493bc9[_0xaf1b('0x172')]);};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x175')]=function(_0x247f9f){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x176'),_0x247f9f['label']));return this[_0xaf1b('0x11')][_0xaf1b('0x177')](_0x247f9f[_0xaf1b('0x5f')],_0x247f9f[_0xaf1b('0x172')]);};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x178')]=function(_0x5e8232){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x179'),_0x5e8232[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x5e8232[_0xaf1b('0x17a')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x17b'));}var _0x188bab=this[_0xaf1b('0x27')][_0xaf1b('0x71')](this,_0x5e8232[_0xaf1b('0x17a')]);if(!_0x188bab||!_0x188bab[_0xaf1b('0x17c')]){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x5e8232,'no\x20mail\x20account\x20found');}var _0x397762={'from':util[_0xaf1b('0x56')](_0xaf1b('0x17d'),_0x188bab[_0xaf1b('0x17')],_0x188bab['email']||_0x188bab[_0xaf1b('0x17c')]['user']),'to':_0x5e8232['to']||'','cc':_0x5e8232['cc']||'','bcc':_0x5e8232['bcc']||'','subject':_0x5e8232['subject'],'html':_0x5e8232[_0xaf1b('0x5f')],'text':_0x5e8232[_0xaf1b('0x5f')]};var _0x390bc3={'tls':{'rejectUnauthorized':![]}};if(_0x188bab['Smtp']['service']){_0x390bc3['service']=_0x188bab[_0xaf1b('0x17c')][_0xaf1b('0x17e')];}else{_0x390bc3['host']=_0x188bab['Smtp'][_0xaf1b('0x17f')];_0x390bc3['port']=_0x188bab[_0xaf1b('0x17c')][_0xaf1b('0x180')];_0x390bc3['secure']=_0x188bab[_0xaf1b('0x17c')][_0xaf1b('0x181')];}if(_0x188bab[_0xaf1b('0x17c')]['authentication']){_0x390bc3['auth']={'user':_0x188bab['Smtp'][_0xaf1b('0x182')],'pass':_0x188bab[_0xaf1b('0x17c')][_0xaf1b('0x183')]};}if(this[_0xaf1b('0xa1')](_0x5e8232[_0xaf1b('0x184')])){}logger['debug']('sendMail\x20message',JSON['stringify'](_0x397762));this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x5e8232,_0x5e8232[_0xaf1b('0x17a')]);this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x185'),_0x188bab[_0xaf1b('0x17')]));this[_0xaf1b('0x28')]['sync'](this,_0x390bc3,_0x397762);return this['channel'][_0xaf1b('0xa8')](_0xaf1b('0x186'));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x187')]=function(_0x1d27c4){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x188'),_0x1d27c4[_0xaf1b('0xb5')]));return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x189'));};AGIVertices[_0xaf1b('0x1b')]['sendSMS']=function(_0x4202a1){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x18a'),_0x4202a1[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x4202a1[_0xaf1b('0x18b')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')]('no\x20sms\x20account\x20configured');}var _0x3d33d8=this[_0xaf1b('0x18c')][_0xaf1b('0x71')](this,_0x4202a1[_0xaf1b('0x18b')]);if(!_0x3d33d8){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x4202a1,_0xaf1b('0x18d'));}var _0x15b57a={'body':_0x4202a1[_0xaf1b('0x18e')],'phone':_0x4202a1['to']||'','SmsAccountId':_0x3d33d8['id']};logger['debug'](_0xaf1b('0x18f'),JSON[_0xaf1b('0x75')](_0x15b57a));this[_0xaf1b('0x38')]['sync'](this,_0x4202a1,_0x4202a1[_0xaf1b('0x18b')]);this['channel'][_0xaf1b('0xa8')](util['format'](_0xaf1b('0x190'),_0x3d33d8[_0xaf1b('0x17')]));this[_0xaf1b('0x37')]['sync'](this,_0x15b57a);return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x191'));};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x192')]=function(_0x30fbd4){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x193'),_0x30fbd4[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x30fbd4[_0xaf1b('0xd3')])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x30fbd4,_0xaf1b('0x194'));}var _0x181843=this['getVariable'][_0xaf1b('0x71')](this,_0x30fbd4[_0xaf1b('0xd3')]);if(!_0x181843){return this['channel'][_0xaf1b('0x35')](_0x30fbd4,_0xaf1b('0xd4'));}return this[_0xaf1b('0x11')][_0xaf1b('0xd6')](_0x181843,_0x30fbd4[_0xaf1b('0x195')]);};AGIVertices[_0xaf1b('0x1b')]['start']=function(_0x373990){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x196'),_0x373990['label']));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x197'));if(_0x373990[_0xaf1b('0xb7')]==='yes'){this[_0xaf1b('0x11')]['noop'](_0xaf1b('0x198'));return this[_0xaf1b('0x11')][_0xaf1b('0xb7')]();}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0x199'));};AGIVertices['prototype'][_0xaf1b('0x19a')]=function(_0x42c8dd){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x19b'),_0x42c8dd[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x42c8dd[_0xaf1b('0x19c')])){return this[_0xaf1b('0x11')]['error'](_0x42c8dd,_0xaf1b('0x19d'));}var _0x3518f3=this[_0xaf1b('0x1c')]['sync'](this,_0x42c8dd['project_id']);if(!this['isConfigured'](_0x3518f3)){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x42c8dd,util[_0xaf1b('0x56')](_0xaf1b('0x19e'),_0x42c8dd[_0xaf1b('0x19c')]));}if(_0x3518f3===this[_0xaf1b('0x11')][_0xaf1b('0x3b')]){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x42c8dd,_0xaf1b('0x19f'));}this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x42c8dd,_0x3518f3);var _0x361cde=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0xaf1b('0x1a0'),util['format'](_0xaf1b('0x1a1'),config[_0xaf1b('0xa')][_0xaf1b('0x17f')]||_0xaf1b('0x1a2'),_0x3518f3,this['channel'][_0xaf1b('0x3b')]));if(_0x361cde[_0xaf1b('0xad')]===-0x1){return _0x361cde;}return this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0xc3'),_0xaf1b('0x1a0'),_0x3518f3));};AGIVertices['prototype'][_0xaf1b('0x1a3')]=function(_0x3d8bd6){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x1a4'),_0x3d8bd6[_0xaf1b('0xb5')]));var _0x1b9d48=this['shellCommand'][_0xaf1b('0x71')](this,_0x3d8bd6[_0xaf1b('0x1a5')]);this[_0xaf1b('0x38')][_0xaf1b('0x71')](this,_0x3d8bd6,_0x3d8bd6[_0xaf1b('0x1a5')]);if(this[_0xaf1b('0xa1')](_0x3d8bd6[_0xaf1b('0xd3')])){var _0x30fa8f=this[_0xaf1b('0x14')]['sync'](this,_0x3d8bd6[_0xaf1b('0xd3')]);if(_0x30fa8f){this[_0xaf1b('0x11')][_0xaf1b('0xd6')](_0x30fa8f,_0x1b9d48);return this[_0xaf1b('0x11')]['noop'](util['format'](_0xaf1b('0x1a6'),_0x3d8bd6[_0xaf1b('0x1a5')],_0x30fa8f));}}return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x1a7'),_0x3d8bd6['command']));};AGIVertices['prototype']['google_cloud_tts']=function(_0x2b1a37){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x1a8'),_0x2b1a37[_0xaf1b('0xb5')]));_0x2b1a37[_0xaf1b('0x5f')]=_0x2b1a37[_0xaf1b('0x5f')][_0xaf1b('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xaf1b('0xa1')](_0x2b1a37[_0xaf1b('0x1a9')])){return this[_0xaf1b('0x11')]['noop'](_0xaf1b('0x1aa'));}if(!this['isConfigured'](_0x2b1a37[_0xaf1b('0x5f')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')](_0xaf1b('0xa6'));}this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0x1ab'),_0x2b1a37['text']));var _0x5542e8=this['googleCloudTTS'][_0xaf1b('0x71')](this,_0x2b1a37);if(_0x5542e8){this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')](_0xaf1b('0x1ac'),_0x5542e8));var _0x12ca73=this[_0xaf1b('0x11')][_0xaf1b('0xf5')](_0x5542e8);try{fs['unlink'](_0x5542e8+_0xaf1b('0x116'));}catch(_0x45d0b8){logger['error'](_0x45d0b8);}return _0x12ca73;}return this['channel'][_0xaf1b('0x35')](_0x2b1a37,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x1ad')]=function(_0x2ae12b){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x1ae'),_0x2ae12b['label']));_0x2ae12b[_0xaf1b('0x5f')]=_0x2ae12b[_0xaf1b('0x5f')][_0xaf1b('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2ae12b[_0xaf1b('0x5f')])){return this[_0xaf1b('0x11')][_0xaf1b('0xa8')]('no\x20text\x20configured');}this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util['format'](_0xaf1b('0x1af'),_0x2ae12b['text']));var _0x29fa75=this['googleTTS'][_0xaf1b('0x71')](this,_0x2ae12b);if(_0x29fa75){this['channel'][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('Google\x20TTS\x20%s\x20file\x20created',_0x29fa75));var _0x49d4a4=this[_0xaf1b('0x11')]['streamFile'](_0x29fa75);try{fs[_0xaf1b('0xf6')](_0x29fa75+_0xaf1b('0x116'));}catch(_0x54f76b){logger['error'](_0x54f76b);}return _0x49d4a4;}return this['channel'][_0xaf1b('0x35')](_0x2ae12b,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xaf1b('0x1b')]['unpause']=function(_0x2cfdc4){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x2cfdc4[_0xaf1b('0xb5')]));if(!this[_0xaf1b('0xa1')](_0x2cfdc4['findBy'])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x2cfdc4,_0xaf1b('0x143'));}logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xaf1b('0x11')][_0xaf1b('0x3c')],_0x2cfdc4[_0xaf1b('0x145')]));var _0x5dade4=this[_0xaf1b('0x52')][_0xaf1b('0x71')](this,_0x2cfdc4['findBy']);if(_0x5dade4){logger[_0xaf1b('0x30')](util['format'](_0xaf1b('0x146'),this[_0xaf1b('0x11')][_0xaf1b('0x3c')],_0x2cfdc4[_0xaf1b('0x145')]));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util['format'](_0xaf1b('0x146'),this['channel'][_0xaf1b('0x3c')],_0x2cfdc4['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')](_0xaf1b('0x147'),this[_0xaf1b('0x11')]['callerid'],_0x2cfdc4['findBy']));this[_0xaf1b('0x11')][_0xaf1b('0xa8')](util[_0xaf1b('0x56')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xaf1b('0x11')][_0xaf1b('0x3c')],_0x2cfdc4['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xaf1b('0x1b')][_0xaf1b('0x1b0')]=function(_0x2754d5){logger[_0xaf1b('0x30')](util[_0xaf1b('0x56')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x2754d5[_0xaf1b('0xb5')]));var _0x2efad1=this[_0xaf1b('0x11')][_0xaf1b('0x5a')](_0xaf1b('0x1b1'),[_0x2754d5[_0xaf1b('0x1b2')],_0x2754d5['options']]);if(_0x2efad1['result']===-0x1){return _0x2efad1;}return this[_0xaf1b('0x11')]['noop'](util[_0xaf1b('0x56')](_0xaf1b('0xc3'),_0xaf1b('0x1b1'),_0x2754d5[_0xaf1b('0x1b2')]));};AGIVertices['prototype'][_0xaf1b('0x1b3')]=function(_0x51b0d3){logger['info'](util[_0xaf1b('0x56')](_0xaf1b('0x1b4'),_0x51b0d3[_0xaf1b('0xb5')]));if(!this['isConfigured'](_0x51b0d3[_0xaf1b('0xd3')])){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x51b0d3,_0xaf1b('0x194'));}var _0x3b380d=this['getVariable'][_0xaf1b('0x71')](this,_0x51b0d3['variable_id']);if(!_0x3b380d){return this[_0xaf1b('0x11')][_0xaf1b('0x35')](_0x51b0d3,'no\x20variable\x20found');}var _0x2354a7=this[_0xaf1b('0x11')]['getVariable'](_0x3b380d);return{'code':0xc8,'result':_0x2354a7[_0xaf1b('0x9f')]?_0x2354a7['extra']:'-'};};String['prototype'][_0xaf1b('0x1b5')]=function(_0x340303,_0x2e7c1c){return this['split'](_0x340303)[_0xaf1b('0x1b6')](_0x2e7c1c);};module[_0xaf1b('0x1b7')]=AGIVertices;
\ No newline at end of file
+var _0x01b5=['out','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%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','mindigit','hiddendigitsnum','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','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','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','method','timeout','PUT','toUpperCase','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','url','headers','render','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','options','googleDialogflow','key','sestekNDA','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','includes','recursiveNodeIndex','isArray','replaceAllVariables','saveRestApiResult','isPlainObject','%s.%s','length','setVariable','replaceObjectAllVariables','stringify','split','replaceAll','extra','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','command','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','list_id','delay','add','minutes','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x01b5,0xca));var _0x501b=function(_0x43b96b,_0x3bc895){_0x43b96b=_0x43b96b-0x0;var _0x3f6e99=_0x01b5[_0x43b96b];return _0x3f6e99;};'use strict';var fs=require('fs');var path=require(_0x501b('0x0'));var util=require(_0x501b('0x1'));var _=require(_0x501b('0x2'));var sh=require(_0x501b('0x3'));var odbc=require(_0x501b('0x4'))();var rs=require(_0x501b('0x5'));var moment=require('moment');var Mustache=require(_0x501b('0x6'));var rp=require(_0x501b('0x7'));var logger=require(_0x501b('0x8'))(_0x501b('0x9'));var config=require('../../config/environment');var scripts=require(_0x501b('0xa'));var FILES_PATH=_0x501b('0xb');var recursiveMapAttributes=[_0x501b('0xc'),'rawBody'];var verticesWithRetry=[_0x501b('0xd'),_0x501b('0xe'),_0x501b('0xf')];var AGIVertices=function(_0x4c0526,_0x1e06cd,_0x444bc3){this[_0x501b('0x10')]=_0x4c0526;this[_0x501b('0x11')]=_0x1e06cd;this[_0x501b('0x12')]=_0x444bc3;};AGIVertices[_0x501b('0x13')][_0x501b('0x14')]=function(_0x316a7e,_0x1bf904){this['rpc']['getVariableById'](_0x316a7e)[_0x501b('0x15')](function(_0x2c3191){_0x1bf904(null,_0x2c3191?_0x2c3191[_0x501b('0x16')]:![]);})['catch'](function(_0x425c63){_0x1bf904(_0x425c63);});};AGIVertices[_0x501b('0x13')][_0x501b('0x17')]=function(_0x257452,_0x31ee8e){this[_0x501b('0x11')][_0x501b('0x18')](_0x257452)[_0x501b('0x15')](function(_0x46c6c3){_0x31ee8e(null,_0x46c6c3?_0x46c6c3[_0x501b('0x16')]:![]);})[_0x501b('0x19')](function(_0x11d417){_0x31ee8e(_0x11d417);});};AGIVertices[_0x501b('0x13')][_0x501b('0x1a')]=function(_0x4bf03e,_0x5547d9){this[_0x501b('0x11')][_0x501b('0x1b')](_0x4bf03e)['then'](function(_0x1554b0){_0x5547d9(null,_0x1554b0?_0x1554b0['name']:![]);})[_0x501b('0x19')](function(_0x4f0b3b){_0x5547d9(_0x4f0b3b);});};AGIVertices[_0x501b('0x13')][_0x501b('0x1c')]=function(_0x88a27c,_0x38f904){this[_0x501b('0x11')][_0x501b('0x1d')](_0x88a27c)[_0x501b('0x15')](function(_0x1b6e06){_0x38f904(null,_0x1b6e06?_0x1b6e06['dsn']:![]);})['catch'](function(_0x574386){_0x38f904(_0x574386);});};AGIVertices['prototype'][_0x501b('0x1e')]=function(_0x4c2461,_0x2a9802){this[_0x501b('0x11')][_0x501b('0x1f')](_0x4c2461)['then'](function(_0x74bd33){_0x2a9802(null,_0x74bd33?_0x74bd33[_0x501b('0x16')]:![]);})[_0x501b('0x19')](function(_0x11a0b3){_0x2a9802(_0x11a0b3);});};AGIVertices['prototype'][_0x501b('0x20')]=function(_0x554a68,_0x1b29a2){this[_0x501b('0x11')][_0x501b('0x21')](_0x554a68)['then'](function(_0x40a19d){_0x1b29a2(null,_0x40a19d?_0x40a19d[_0x501b('0x16')]:![]);})['catch'](function(_0x1eec86){_0x1b29a2(_0x1eec86);});};AGIVertices[_0x501b('0x13')][_0x501b('0x22')]=function(_0x21f4de,_0x5b170b){var _0x205269=this;this[_0x501b('0x11')][_0x501b('0x23')](_0x21f4de)['then'](function(_0x31e108){_0x5b170b(null,_0x31e108?_0x205269[_0x501b('0x24')](_0x31e108[_0x501b('0x25')]):![]);})[_0x501b('0x19')](function(_0xc0172a){_0x5b170b(_0xc0172a);});};AGIVertices['prototype'][_0x501b('0x26')]=function(_0x22fabd,_0x3e31fd){this['rpc'][_0x501b('0x27')](_0x22fabd)[_0x501b('0x15')](function(_0x3395b1){_0x3e31fd(null,_0x3395b1?_0x3395b1:![]);})[_0x501b('0x19')](function(_0x148d8b){_0x3e31fd(_0x148d8b);});};AGIVertices['prototype']['sendMailMessage']=function(_0x154902,_0x2dbf9b,_0x4372fa){this[_0x501b('0x12')][_0x501b('0x28')](_0x154902,_0x2dbf9b)['then'](function(){_0x4372fa(null);})[_0x501b('0x19')](function(_0x10769d){_0x4372fa(_0x10769d);});};AGIVertices[_0x501b('0x13')]['getIntervals']=function(_0x43b144,_0x337f5a){this[_0x501b('0x11')]['getIntervalById'](_0x43b144)[_0x501b('0x15')](function(_0x326c5c){if(_0x326c5c){if(_0x326c5c[_0x501b('0x29')]){_0x337f5a(null,[_0x326c5c[_0x501b('0x2a')]]);}else{_0x337f5a(null,_[_0x501b('0x2b')](_0x326c5c['Intervals'],'interval'));}}else{_0x337f5a(null,![]);}})[_0x501b('0x19')](function(_0x1a08d5){_0x337f5a(_0x1a08d5);});};AGIVertices[_0x501b('0x13')]['getSoundPath']=function(_0x1e81a8){return util[_0x501b('0x2c')](_0x501b('0x2d'),FILES_PATH,_0x1e81a8);};AGIVertices['prototype'][_0x501b('0x2e')]=function(_0x301372,_0x4619bf,_0x66f556){odbc[_0x501b('0x2f')](_0x301372,function(_0x3493a0){if(_0x3493a0){logger[_0x501b('0x30')](_0x501b('0x31'),_0x3493a0);_0x66f556(_0x3493a0);}else{logger['info'](_0x501b('0x32'));odbc['query'](_0x4619bf,function(_0x16e73a,_0x5ada01){if(_0x16e73a){logger['info'](_0x501b('0x33'),_0x4619bf);_0x66f556(_0x16e73a);}else{logger[_0x501b('0x34')](_0x501b('0x35'),_0x4619bf);odbc[_0x501b('0x36')](function(_0xb18d47){if(_0xb18d47){logger[_0x501b('0x30')](_0x501b('0x37'),_0xb18d47);}_0x66f556(null,_0x5ada01);});}});}});};AGIVertices[_0x501b('0x13')][_0x501b('0x38')]=function(_0x448a58,_0x5b6926){this[_0x501b('0x11')][_0x501b('0x39')](_0x448a58)[_0x501b('0x15')](function(_0x5609de){_0x5b6926(null,_0x5609de?_0x5609de:![]);})['catch'](function(_0x17eade){_0x5b6926(_0x17eade);});};AGIVertices[_0x501b('0x13')]['createSmsMessage']=function(_0x281318,_0x485c73){this[_0x501b('0x11')][_0x501b('0x3a')](_0x281318)[_0x501b('0x15')](function(_0x4efcba){_0x485c73(null,_0x4efcba);})[_0x501b('0x19')](function(_0x267140){_0x485c73(_0x267140);});};AGIVertices[_0x501b('0x13')][_0x501b('0x3b')]=function(_0x4cd237,_0x304a90,_0x2e7e65){this[_0x501b('0x11')][_0x501b('0x3b')]({'uniqueid':this['channel'][_0x501b('0x3c')],'node':_0x4cd237[_0x501b('0x3d')],'application':_0x4cd237[_0x501b('0x3e')],'data':_0x304a90||null,'project_name':this[_0x501b('0x10')][_0x501b('0x3f')],'callerid':this[_0x501b('0x10')][_0x501b('0x40')]})[_0x501b('0x15')](function(_0x520eac){if(_0x2e7e65){_0x2e7e65(null,_0x520eac);}})['catch'](function(_0x5f0b4a){if(_0x2e7e65){_0x2e7e65(_0x5f0b4a);}});};AGIVertices[_0x501b('0x13')][_0x501b('0x41')]=function(_0x221ac5,_0x40d4e6,_0x4bacf3,_0x37e6cd){this[_0x501b('0x11')][_0x501b('0x41')]({'uniqueid':this[_0x501b('0x10')][_0x501b('0x3c')],'callerid':this[_0x501b('0x10')][_0x501b('0x40')],'calleridname':this[_0x501b('0x10')][_0x501b('0x42')],'context':this[_0x501b('0x10')]['context'],'extension':this[_0x501b('0x10')][_0x501b('0x43')],'priority':this[_0x501b('0x10')]['priority'],'accountcode':this[_0x501b('0x10')]['accountcode'],'dnid':this['channel'][_0x501b('0x44')],'projectName':this[_0x501b('0x10')][_0x501b('0x3f')],'saveName':_0x40d4e6,'filename':_0x221ac5[_0x501b('0x45')]||_0x40d4e6,'savePath':_0x4bacf3})['then'](function(_0xb49c4e){_0x37e6cd(null,_0xb49c4e);})[_0x501b('0x19')](function(_0x128ea3){_0x37e6cd(_0x128ea3);});};AGIVertices[_0x501b('0x13')]['createSquareMessage']=function(_0x53da17,_0x32e47a,_0x33047a){this[_0x501b('0x11')][_0x501b('0x46')]({'uniqueid':this[_0x501b('0x10')][_0x501b('0x3c')],'body':_0x53da17,'direction':_0x32e47a})['then'](function(_0x1f12c8){if(_0x33047a){_0x33047a(null,_0x1f12c8);}})['catch'](function(_0x4da2bc){if(_0x33047a){_0x33047a(_0x4da2bc);}});};AGIVertices['prototype'][_0x501b('0x47')]=function(_0x168920,_0x443656){this['rpc']['createCmContact']({'firstName':_[_0x501b('0x48')](_0x168920[_0x501b('0x16')])||_[_0x501b('0x49')](_0x168920['name'])?_0x501b('0x4a')+Math[_0x501b('0x4b')]():_0x168920[_0x501b('0x16')],'lastName':_[_0x501b('0x48')](_0x168920['lastName'])||_[_0x501b('0x49')](_0x168920[_0x501b('0x4c')])?null:_0x168920[_0x501b('0x4c')],'phone':_0x168920[_0x501b('0x4d')],'ListId':_0x168920['list_id'],'scheduledat':_0x168920[_0x501b('0x4e')],'callbackUniqueid':this[_0x501b('0x10')]['uniqueid'],'tags':_0x501b('0x4f'),'description':_0x501b('0x50')+_0x168920[_0x501b('0x4e')]['toString'](),'priority':_0x168920[_0x501b('0x51')]})[_0x501b('0x15')](function(_0x34d5d7){_0x443656(null,_0x34d5d7);})[_0x501b('0x19')](function(_0x4184df){_0x443656(_0x4184df);});};AGIVertices['prototype'][_0x501b('0x52')]=function(_0x48a7f9,_0x1d77db){this['rpc'][_0x501b('0x53')](_0x48a7f9)[_0x501b('0x15')](function(_0x4b93c2){_0x1d77db(null,_0x4b93c2?_0x4b93c2[_0x501b('0x16')]:![]);})[_0x501b('0x19')](function(_0xb02b08){_0x1d77db(_0xb02b08);});};AGIVertices[_0x501b('0x13')][_0x501b('0x54')]=function(_0x379fa4,_0x16eee7,_0x4bc399){var _0x1e9639={'role':_0x501b('0x55')};_0x1e9639[_0x379fa4]=this['channel']['callerid'];this[_0x501b('0x11')][_0x501b('0x54')](_0x1e9639,_0x16eee7,this[_0x501b('0x10')][_0x501b('0x3c')])[_0x501b('0x15')](function(_0x35008b){_0x4bc399(null,_[_0x501b('0x49')](_0x35008b)?![]:!![]);})[_0x501b('0x19')](function(_0x4eb8c6){logger[_0x501b('0x30')](_0x4eb8c6);_0x4bc399(null,![]);});};AGIVertices[_0x501b('0x13')]['agentUnpause']=function(_0x2c6f93,_0x1d68e9){var _0x182ca4={'role':_0x501b('0x55')};_0x182ca4[_0x2c6f93]=this[_0x501b('0x10')][_0x501b('0x40')];this[_0x501b('0x11')][_0x501b('0x56')](_0x182ca4)[_0x501b('0x15')](function(_0x1ee5df){_0x1d68e9(null,_[_0x501b('0x49')](_0x1ee5df)?![]:!![]);})[_0x501b('0x19')](function(_0x1eb230){logger['error'](_0x1eb230);_0x1d68e9(null,![]);});};AGIVertices['prototype'][_0x501b('0x57')]=function(_0x4db6f4,_0x49001b){var _0x1f5f7b={'role':_0x501b('0x55')};_0x1f5f7b[_0x4db6f4]=this['channel']['callerid'];this['rpc'][_0x501b('0x57')](_0x1f5f7b)[_0x501b('0x15')](function(_0x5c3184){_0x49001b(null,_[_0x501b('0x49')](_0x5c3184)?![]:!![]);})[_0x501b('0x19')](function(_0x3bcbb5){logger[_0x501b('0x30')](_0x3bcbb5);_0x49001b(null,![]);});};AGIVertices[_0x501b('0x13')]['agentLogin']=function(_0x2df48e,_0x5d8f57){var _0x19052b={'role':_0x501b('0x55')};_0x19052b[_0x2df48e]=this[_0x501b('0x10')]['callerid'];var _0x160fdf=_0x2df48e!=_0x501b('0x58')?util[_0x501b('0x2c')](_0x501b('0x59'),'LOCAL',this[_0x501b('0x10')]['callerid']):undefined;this[_0x501b('0x11')][_0x501b('0x5a')](_0x19052b,_0x160fdf)['then'](function(_0x2907ac){_0x5d8f57(null,_[_0x501b('0x49')](_0x2907ac)?![]:!![]);})['catch'](function(_0x5b57a9){logger[_0x501b('0x30')](_0x5b57a9);_0x5d8f57(null,![]);});};AGIVertices['prototype'][_0x501b('0x5b')]=function(_0x34a4c6,_0x40eb44){sh[_0x501b('0x5c')](_['trim'](_0x34a4c6),function(_0x32dd4b,_0x553eef){var _0x443c8d=_0x553eef[_0x501b('0x5d')](/(\r\n|\n|\r)/gm,'');_0x40eb44(null,_0x443c8d);});};AGIVertices[_0x501b('0x13')][_0x501b('0x5e')]=function(_0x25fec1,_0x52e10a){scripts[_0x501b('0x5e')](_0x25fec1[_0x501b('0x5f')],_0x25fec1[_0x501b('0x60')]||_0x501b('0x61'),_0x25fec1[_0x501b('0x61')],_0x25fec1[_0x501b('0x62')]||_0x501b('0x63'),_0x25fec1[_0x501b('0x64')]||_0x501b('0x65'),_0x25fec1[_0x501b('0x66')]||'MP3')[_0x501b('0x15')](function(_0x443a61){_0x52e10a(null,_0x443a61);})[_0x501b('0x19')](function(_0x20421e){_0x52e10a(_0x20421e);});};AGIVertices['prototype'][_0x501b('0x67')]=function(_0x864434,_0x22440e){scripts['googleTTS'](_0x864434[_0x501b('0x61')],_0x864434[_0x501b('0x68')]||'en',0x1)[_0x501b('0x15')](function(_0x34ce26){_0x22440e(null,_0x34ce26);})['catch'](function(_0x1eb94e){_0x22440e(_0x1eb94e);});};AGIVertices[_0x501b('0x13')]['restAPI']=function(_0x4f70d1,_0x1528c7){var _0x52bb7b={'uri':_0x4f70d1['url'],'method':_0x4f70d1[_0x501b('0x69')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4f70d1['timeout'])==='number'&&parseInt(_0x4f70d1[_0x501b('0x6a')])>=0x1?parseInt(_0x4f70d1[_0x501b('0x6a')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0x501b('0x6b')],_0x52bb7b[_0x501b('0x69')][_0x501b('0x6c')]())){try{_0x52bb7b['body']=_0x4f70d1[_0x501b('0x6d')]?JSON['parse'](_0x4f70d1[_0x501b('0x6d')]):{};}catch(_0x4453f3){logger[_0x501b('0x30')](_0x501b('0x6e'),_0x4453f3);}}try{_0x52bb7b['headers']=_0x4f70d1['rawHeaders']?JSON[_0x501b('0x6f')](_0x4f70d1[_0x501b('0xc')]):{};}catch(_0x5c0010){logger[_0x501b('0x30')](_0x501b('0x70'),_0x5c0010);}if(_0x4f70d1[_0x501b('0x71')]){try{var _0xbe13e4=require(_0x4f70d1[_0x501b('0x71')])[_0x501b('0x72')](this,_0x52bb7b);_0x52bb7b[_0x501b('0x73')]=Mustache['render'](_0x4f70d1[_0x501b('0x74')],_0xbe13e4,{},['$$','$$']);if(_0x52bb7b[_0x501b('0x75')]){_0x52bb7b[_0x501b('0x75')]=JSON[_0x501b('0x6f')](Mustache[_0x501b('0x76')](JSON['stringify'](_0x52bb7b[_0x501b('0x75')]),_0xbe13e4,{},['$$','$$']));}if(_0x52bb7b[_0x501b('0x77')]){_0x52bb7b['body']=JSON['parse'](Mustache[_0x501b('0x76')](JSON['stringify'](_0x52bb7b[_0x501b('0x77')]),_0xbe13e4,{},['$$','$$']));}}catch(_0x2de008){logger[_0x501b('0x30')](_0x501b('0x78'),_0x2de008);}}rp(_0x52bb7b)[_0x501b('0x15')](function(_0x59dc24){var _0x3c6f86={'statusCode':_0x59dc24[_0x501b('0x79')]||0xc8,'statusMessage':_0x59dc24[_0x501b('0x7a')]||'OK','headers':_0x59dc24[_0x501b('0x75')]||{},'body':_0x59dc24[_0x501b('0x77')]||{}};_0x1528c7(null,_0x3c6f86);})[_0x501b('0x19')](function(_0x425052){var _0x145b5c={'statusCode':_0x425052['statusCode']||0x1f4,'statusMessage':_0x425052['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x425052[_0x501b('0x7b')][_0x501b('0x75')]||{},'body':_0x425052[_0x501b('0x7b')]['body']||{}};_0x1528c7(null,_0x145b5c);});};AGIVertices['prototype']['googleDialogflow']=function(_0x13bb5f,_0x129b11){scripts[_0x501b('0x7c')](this[_0x501b('0x10')][_0x501b('0x3c')],_0x13bb5f[_0x501b('0x7d')],_0x13bb5f['text'],_0x13bb5f['dialogflow_language']||'en')[_0x501b('0x15')](function(_0x254aa6){_0x129b11(null,_0x254aa6);})[_0x501b('0x19')](function(_0x12b9cf){_0x129b11(_0x12b9cf);});};AGIVertices['prototype'][_0x501b('0x7e')]=function(_0x195b94,_0x21e535){scripts[_0x501b('0x7e')](this[_0x501b('0x10')],_0x195b94)[_0x501b('0x15')](function(_0x4d3c94){_0x21e535(null,_0x4d3c94);})[_0x501b('0x19')](function(_0x3b4386){_0x21e535(_0x3b4386);});};AGIVertices[_0x501b('0x13')]['ispeechTTS']=function(_0x37d633,_0xac8f2a){scripts['ispeechTTS'](_0x37d633['key'],_0x37d633[_0x501b('0x61')],_0x37d633[_0x501b('0x7f')]||_0x501b('0x63'),_0x37d633['speed'])[_0x501b('0x15')](function(_0x95d84f){_0xac8f2a(null,_0x95d84f);})[_0x501b('0x19')](function(_0x1de687){_0xac8f2a(_0x1de687);});};AGIVertices['prototype'][_0x501b('0x80')]=function(_0x135cb2,_0x2ee46d,_0x4c39ce){scripts[_0x501b('0x80')](_0x2ee46d,_0x135cb2[_0x501b('0x7d')],_0x135cb2[_0x501b('0x81')]||'en-US',this['isConfigured'](_0x135cb2[_0x501b('0x82')])?_0x135cb2['model']:undefined)[_0x501b('0x15')](function(_0x1cb38a){_0x4c39ce(null,_0x1cb38a);})[_0x501b('0x19')](function(_0x153707){_0x4c39ce(_0x153707);});};AGIVertices[_0x501b('0x13')][_0x501b('0x83')]=function(_0x2c4a5d,_0x5b9f0){scripts[_0x501b('0x83')](_0x2c4a5d[_0x501b('0x84')],_0x2c4a5d['aws_secret_access_key'],_0x2c4a5d[_0x501b('0x85')],_0x2c4a5d['aws_polly_voice']||_0x501b('0x86'),_0x2c4a5d[_0x501b('0x61')],_0x2c4a5d['aws_text_type']||_0x501b('0x61'))[_0x501b('0x15')](function(_0x2646d7){_0x5b9f0(null,_0x2646d7);})[_0x501b('0x19')](function(_0x4b4d42){_0x5b9f0(_0x4b4d42);});};AGIVertices['prototype'][_0x501b('0x87')]=function(_0x3a2e92,_0x3516dc){scripts[_0x501b('0x87')](this[_0x501b('0x10')][_0x501b('0x3c')],_0x3a2e92[_0x501b('0x84')],_0x3a2e92['aws_secret_access_key'],_0x3a2e92['aws_lex_region'],_0x3a2e92[_0x501b('0x61')],_0x3a2e92[_0x501b('0x88')])['then'](function(_0x5f1779){_0x3516dc(null,_0x5f1779);})[_0x501b('0x19')](function(_0x23bea4){_0x3516dc(_0x23bea4);});};AGIVertices[_0x501b('0x13')][_0x501b('0x89')]=function(_0x20ddb0,_0x4b6b1a,_0x38e8a1){scripts[_0x501b('0x89')](_0x4b6b1a,_0x20ddb0[_0x501b('0x7d')],_0x20ddb0[_0x501b('0x8a')]||_0x501b('0x63'))[_0x501b('0x15')](function(_0x2599a3){_0x38e8a1(null,_0x2599a3);})[_0x501b('0x19')](function(_0x4db3d8){_0x38e8a1(_0x4db3d8);});};AGIVertices['prototype']['tildeASR']=function(_0x119edb,_0x19b1da,_0x3c2ccc){scripts[_0x501b('0x8b')](_0x19b1da,_0x119edb['appid'],_0x119edb[_0x501b('0x8c')],_0x119edb['uri'])[_0x501b('0x15')](function(_0x589e97){_0x3c2ccc(null,_0x589e97);})[_0x501b('0x19')](function(_0x4de7f7){_0x3c2ccc(_0x4de7f7);});};AGIVertices[_0x501b('0x13')][_0x501b('0x8d')]=function(_0x5f0b61){var _0x1d76af=_['includes'](verticesWithRetry,_0x5f0b61[_0x501b('0x3e')])?_0x5f0b61:_[_0x501b('0x8e')](_0x5f0b61);for(var _0x4ad8a7 in _0x1d76af){if(_0x1d76af[_0x501b('0x8f')](_0x4ad8a7)){if(_0x1d76af[_0x4ad8a7]&&_[_0x501b('0x90')](_0x1d76af[_0x4ad8a7])){if(_[_0x501b('0x91')](recursiveMapAttributes,_0x4ad8a7)){_0x1d76af[_0x4ad8a7]=this['replaceObjectAllVariables'](_0x1d76af[_0x4ad8a7]);}else{_0x1d76af[_0x4ad8a7]=this['replaceAllVariables'](_0x1d76af[_0x4ad8a7]);}}}}return _0x1d76af;};AGIVertices[_0x501b('0x13')]['recursiveNodeIndex']=function(_0x11580b){for(var _0x50be02 in _0x11580b){if(_0x11580b[_0x501b('0x8f')](_0x50be02)){if(_['isPlainObject'](_0x11580b[_0x50be02])){this[_0x501b('0x92')](_0x11580b[_0x50be02]);}else if(_[_0x501b('0x93')](_0x11580b[_0x50be02])){for(var _0x141c48=0x0;_0x141c48<_0x11580b[_0x50be02]['length'];_0x141c48++){this[_0x501b('0x92')](_0x11580b[_0x50be02][_0x141c48]);}}else if(_[_0x501b('0x90')](_0x11580b[_0x50be02])){_0x11580b[_0x50be02]=this[_0x501b('0x94')](_0x11580b[_0x50be02]);}}}};AGIVertices[_0x501b('0x13')][_0x501b('0x95')]=function(_0x50062f,_0x311c93){for(var _0x37e1b2 in _0x50062f){if(_0x50062f['hasOwnProperty'](_0x37e1b2)){if(_[_0x501b('0x96')](_0x50062f[_0x37e1b2])){if(!_['isEmpty'](_0x50062f[_0x37e1b2])){this[_0x501b('0x95')](_0x50062f[_0x37e1b2],util['format'](_0x501b('0x97'),_0x311c93,_0x37e1b2));}}else if(_[_0x501b('0x93')](_0x50062f[_0x37e1b2])){for(var _0x26590f=0x0;_0x26590f<_0x50062f[_0x37e1b2][_0x501b('0x98')];_0x26590f++){this[_0x501b('0x95')](_0x50062f[_0x37e1b2][_0x26590f],util[_0x501b('0x2c')](_0x501b('0x97'),_0x311c93,_0x37e1b2+'['+_0x26590f+']'));}}else{if(!_[_0x501b('0x49')](_0x50062f[_0x37e1b2])){this[_0x501b('0x10')][_0x501b('0x99')](util[_0x501b('0x2c')](_0x501b('0x97'),_0x311c93,_0x37e1b2),_0x50062f[_0x37e1b2]);}}}}};AGIVertices['prototype'][_0x501b('0x9a')]=function(_0x21e71b){try{var _0x2ffa8e=JSON[_0x501b('0x6f')](_0x21e71b);this[_0x501b('0x92')](_0x2ffa8e);return JSON[_0x501b('0x9b')](_0x2ffa8e);}catch(_0x205d8b){return this['replaceAllVariables'](_0x21e71b);}};AGIVertices['prototype'][_0x501b('0x94')]=function(_0x860aca){var _0x2cb030=_0x860aca[_0x501b('0x9c')]('{');for(var _0x144c27=0x1;_0x144c27<_0x2cb030[_0x501b('0x98')];_0x144c27+=0x1){var _0x4210a6=_0x2cb030[_0x144c27][_0x501b('0x9c')]('}');if(_0x4210a6['length']>0x1){_0x860aca=_0x860aca[_0x501b('0x9d')]('{'+_0x4210a6[0x0]+'}',this[_0x501b('0x10')][_0x501b('0x14')](_0x4210a6[0x0])[_0x501b('0x9e')]||_0x4210a6[0x0]);}}if(_0x2cb030[_0x501b('0x98')]===0x1){return _0x860aca[_0x501b('0x9f')]();}return this['replaceAllVariables'](_0x860aca);};AGIVertices[_0x501b('0x13')][_0x501b('0xa0')]=function(_0x49c128,_0x1e61b4){var _0x5813f1=this[_0x501b('0x10')][_0x501b('0x14')](_0x49c128);if(_0x5813f1['result']===-0x1){return _0x5813f1;}logger['info'](util[_0x501b('0x2c')](_0x501b('0xa1'),_0x1e61b4,_0x5813f1['extra']));return this[_0x501b('0x10')][_0x501b('0x99')](_0x1e61b4,_0x5813f1[_0x501b('0x9e')]);};AGIVertices[_0x501b('0x13')][_0x501b('0xa2')]=function(_0x36ee71){return _0x36ee71&&_0x36ee71!=='0'&&_0x36ee71!=='-1'&&_0x36ee71!=='';};AGIVertices[_0x501b('0x13')][_0x501b('0xa3')]=function(_0x3c7051){this[_0x501b('0x3b')]['sync'](this,_0x3c7051,'-');_0x3c7051[_0x501b('0xa4')]=_0x3c7051[_0x501b('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x501b('0x13')]['mrcpsynth']=function(_0x4a88b3){logger['info'](util[_0x501b('0x2c')](_0x501b('0xa5'),_0x4a88b3[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x4a88b3[_0x501b('0x61')])){return this['channel'][_0x501b('0xa6')](_0x501b('0xa7'));}var _0x332b3a='\x22'+_0x4a88b3['text']+'\x22';if(this[_0x501b('0xa2')](_0x4a88b3[_0x501b('0x7b')])){_0x332b3a+=','+_0x4a88b3[_0x501b('0x7b')];}var _0x21a0b1=this[_0x501b('0x10')][_0x501b('0x5c')](_0x501b('0xa8'),_0x332b3a);if(_0x21a0b1[_0x501b('0xa9')]===-0x1){return _0x21a0b1;}return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x332b3a));};AGIVertices[_0x501b('0x13')][_0x501b('0xaa')]=function(_0x3f25d4){logger['info'](util[_0x501b('0x2c')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x3f25d4[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x3f25d4[_0x501b('0xab')])){return this['channel'][_0x501b('0xa6')](_0x501b('0xac'));}var _0x75ee42=_0x3f25d4[_0x501b('0xab')];if(this[_0x501b('0xa2')](_0x3f25d4['options'])){_0x75ee42+=','+_0x3f25d4[_0x501b('0x7b')];}var _0x340441=this[_0x501b('0x10')][_0x501b('0x5c')](_0x501b('0xad'),_0x75ee42);if(_0x340441[_0x501b('0xa9')]===-0x1){return _0x340441;}var _0x537d8c=this[_0x501b('0xa0')](_0x501b('0xae'),_0x501b('0xaf'));if(_0x537d8c[_0x501b('0xa9')]===-0x1){return _0x537d8c;}var _0x5270b0=this[_0x501b('0xa0')](_0x501b('0xb0'),'MRCP_RECOG_TRANSCRIPT');if(_0x5270b0['result']===-0x1){return _0x5270b0;}var _0x19c955=this[_0x501b('0xa0')]('RECOG_INSTANCE()',_0x501b('0xb1'));if(_0x19c955[_0x501b('0xa9')]===-0x1){return _0x19c955;}return this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0x75ee42));};AGIVertices[_0x501b('0x13')]['agi']=function(_0x143cb8){logger[_0x501b('0x34')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x143cb8[_0x501b('0x3d')]));return this['channel'][_0x501b('0x9')]([_0x143cb8[_0x501b('0xb2')],_0x143cb8[_0x501b('0xb3')]]);};AGIVertices[_0x501b('0x13')]['answer']=function(_0xda5e6e){logger['info'](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xda5e6e[_0x501b('0x3d')]));if(this[_0x501b('0xa2')](_0xda5e6e['timeout'])){logger['info'](util[_0x501b('0x2c')](_0x501b('0xb4'),_0xda5e6e[_0x501b('0x6a')]));var _0x2cb220=this[_0x501b('0x10')][_0x501b('0xb5')](_0xda5e6e[_0x501b('0x6a')]);if(_0x2cb220[_0x501b('0xa9')]===-0x1){return _0x2cb220;}}return this[_0x501b('0x10')][_0x501b('0xb6')]();};AGIVertices['prototype']['callback']=function(_0xf8371d){logger[_0x501b('0x34')](util[_0x501b('0x2c')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0xf8371d[_0x501b('0x3d')]));if(!this['isConfigured'](_0xf8371d[_0x501b('0xb7')])){return this[_0x501b('0x10')]['error'](_0xf8371d,'no\x20list\x20selected');}_0xf8371d[_0x501b('0x4e')]=moment();if(this[_0x501b('0xa2')](_0xf8371d[_0x501b('0xb8')])){_0xf8371d['scheduledAt']=moment()[_0x501b('0xb9')](_0xf8371d['delay'],_0x501b('0xba'));}if(!this[_0x501b('0xa2')](_0xf8371d[_0x501b('0x51')])){_0xf8371d[_0x501b('0x51')]=0x2;}this[_0x501b('0x47')][_0x501b('0x72')](this,_0xf8371d);return this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xf8371d[_0x501b('0x4d')],_0xf8371d[_0x501b('0xb7')],_0xf8371d[_0x501b('0x4e')]));};AGIVertices[_0x501b('0x13')]['custom_app']=function(_0x495004){logger[_0x501b('0x34')](util['format'](_0x501b('0xbb'),_0x495004[_0x501b('0x3d')]));var _0x21e37b=this[_0x501b('0x10')][_0x501b('0x5c')](_0x495004[_0x501b('0xbc')],_0x495004[_0x501b('0x7b')]);if(_0x21e37b[_0x501b('0xa9')]===-0x1){return _0x21e37b;}return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0xbd'),_0x495004[_0x501b('0xbc')],_0x495004[_0x501b('0x7b')]));};AGIVertices[_0x501b('0x13')][_0x501b('0xbe')]=function(_0x32553e){logger[_0x501b('0x34')](util[_0x501b('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x32553e['label']));if(!this[_0x501b('0xa2')](_0x32553e[_0x501b('0x61')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xa7'));}var _0x5de2a8='\x22'+_0x32553e[_0x501b('0x61')]+'\x22';if(this[_0x501b('0xa2')](_0x32553e[_0x501b('0x7b')])){_0x5de2a8+=','+_0x32553e[_0x501b('0x7b')];}var _0xd6320d=this['channel'][_0x501b('0x5c')](_0x501b('0xa8'),_0x5de2a8);if(_0xd6320d[_0x501b('0xa9')]===-0x1){return _0xd6320d;}return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0xbf'),_0x5de2a8));};AGIVertices[_0x501b('0x13')][_0x501b('0xc0')]=function(_0x4f1a5a){logger['info'](util[_0x501b('0x2c')](_0x501b('0xc1'),_0x4f1a5a['label']));if(!this[_0x501b('0xa2')](_0x4f1a5a[_0x501b('0x61')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xa7'));}var _0x59f6a6='\x22'+_0x4f1a5a['text']+'\x22';if(this['isConfigured'](_0x4f1a5a[_0x501b('0x7b')])){_0x59f6a6+=','+_0x4f1a5a['options'];}var _0x36ce52=this[_0x501b('0x10')]['exec'](_0x501b('0xa8'),_0x59f6a6);if(_0x36ce52[_0x501b('0xa9')]===-0x1){return _0x36ce52;}return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0xbf'),_0x59f6a6));};AGIVertices[_0x501b('0x13')][_0x501b('0xc2')]=function(_0x67efaa){logger['info'](util[_0x501b('0x2c')](_0x501b('0xc3'),_0x67efaa['label']));if(!this[_0x501b('0xa2')](_0x67efaa[_0x501b('0xab')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xac'));}var _0x51c72f=_0x67efaa['grammar'];if(this['isConfigured'](_0x67efaa[_0x501b('0x7b')])){_0x51c72f+=','+_0x67efaa['options'];}var _0xee8dc6=this[_0x501b('0x10')][_0x501b('0x5c')](_0x501b('0xad'),_0x51c72f);if(_0xee8dc6[_0x501b('0xa9')]===-0x1){return _0xee8dc6;}var _0x193a4a=this['getAndSetVariable'](_0x501b('0xae'),_0x501b('0xc4'));if(_0x193a4a['result']===-0x1){return _0x193a4a;}var _0x391461=this[_0x501b('0xa0')](_0x501b('0xb0'),_0x501b('0xc5'));if(_0x391461[_0x501b('0xa9')]===-0x1){return _0x391461;}var _0x4ce3a6=this[_0x501b('0xa0')](_0x501b('0xc6'),'LUMENVOX_ASR_INSTANCE');if(_0x4ce3a6[_0x501b('0xa9')]===-0x1){return _0x4ce3a6;}return this[_0x501b('0x10')]['noop'](util[_0x501b('0x2c')](_0x501b('0xc7'),_0x51c72f));};AGIVertices[_0x501b('0x13')][_0x501b('0xc8')]=function(_0x44e258){logger[_0x501b('0x34')](util['format'](_0x501b('0xc9'),_0x44e258['label']));if(!this['isConfigured'](_0x44e258[_0x501b('0xab')])){return this['channel'][_0x501b('0xa6')](_0x501b('0xac'));}var _0x3ecca=_0x44e258[_0x501b('0xab')];if(this[_0x501b('0xa2')](_0x44e258[_0x501b('0x7b')])){_0x3ecca+=','+_0x44e258[_0x501b('0x7b')];}var _0x29001e=this[_0x501b('0x10')][_0x501b('0x5c')](_0x501b('0xad'),_0x3ecca);if(_0x29001e['result']===-0x1){return _0x29001e;}var _0x282d44=this[_0x501b('0xa0')](_0x501b('0xae'),'SESTEK_ASR_CONFIDENCE');if(_0x282d44[_0x501b('0xa9')]===-0x1){return _0x282d44;}var _0x554395=this['getAndSetVariable']('RECOG_INPUT()',_0x501b('0xca'));if(_0x554395[_0x501b('0xa9')]===-0x1){return _0x554395;}var _0xc76a87=this[_0x501b('0xa0')](_0x501b('0xc6'),'SESTEK_ASR_INSTANCE');if(_0xc76a87['result']===-0x1){return _0xc76a87;}return this['channel']['noop'](util[_0x501b('0x2c')](_0x501b('0xc7'),_0x3ecca));};AGIVertices[_0x501b('0x13')][_0x501b('0xcb')]=function(_0x3c3cdb){logger['info'](util['format'](_0x501b('0xcc'),_0x3c3cdb[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x3c3cdb['odbc_id'])){return this[_0x501b('0x10')]['error'](_0x3c3cdb,'no\x20database\x20selected');}var _0x36ffdc=this[_0x501b('0x1c')][_0x501b('0x72')](this,_0x3c3cdb[_0x501b('0xcd')]);if(!_0x36ffdc){return this['channel'][_0x501b('0x30')](_0x3c3cdb,_0x501b('0xce'));}if(!this[_0x501b('0xa2')](_0x3c3cdb['query'])){return this['channel'][_0x501b('0x30')](_0x3c3cdb,'no\x20query\x20configured');}var _0x3f2652=_0x3c3cdb[_0x501b('0xcf')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x501b('0x10')][_0x501b('0xa6')](util['format']('query:\x20%s',_0x3f2652));var _0x397a25=this[_0x501b('0x2e')][_0x501b('0x72')](this,_0x36ffdc,_0x3f2652);this['createSquareDetailsReport'][_0x501b('0x72')](this,_0x3c3cdb,_0x3f2652);if(!this[_0x501b('0xa2')](_0x3c3cdb[_0x501b('0xd0')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xd1'));}var _0x4f63c7=this['getVariable'][_0x501b('0x72')](this,_0x3c3cdb[_0x501b('0xd0')]);if(!_0x4f63c7){return this[_0x501b('0x10')][_0x501b('0x30')](_0x3c3cdb,_0x501b('0xd2'));}var _0xf88d21=this;_0x397a25[_0x501b('0xd3')](function(_0x21d7de,_0x495047){Object[_0x501b('0xd4')](_0x21d7de)[_0x501b('0xd3')](function(_0x549cb1){_0xf88d21[_0x501b('0x10')][_0x501b('0x99')](util['format'](_0x501b('0xd5'),_0x4f63c7,_0x495047,_0x549cb1),_0x21d7de[_0x549cb1]);});});this[_0x501b('0x10')]['setVariable'](util[_0x501b('0x2c')](_0x501b('0xd6'),_0x4f63c7),_0x397a25[_0x501b('0x98')]);return this[_0x501b('0x10')][_0x501b('0xa6')](util['format']('variable\x20%s\x20set',_0x4f63c7));};AGIVertices[_0x501b('0x13')]['dial']=function(_0x23b336){logger[_0x501b('0xd7')](util[_0x501b('0x2c')](_0x501b('0xd8'),_0x23b336[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x23b336['sip_id'])){return this[_0x501b('0x10')][_0x501b('0x30')](_0x23b336,_0x501b('0xd9'));}var _0x58822a=this[_0x501b('0x1e')][_0x501b('0x72')](this,_0x23b336[_0x501b('0xda')]);if(!_0x58822a){return this[_0x501b('0x10')]['error'](_0x23b336,'no\x20user\x20found');}var _0x35d3cb=this[_0x501b('0x10')][_0x501b('0x5c')](_0x501b('0xdb'),[util['format'](_0x501b('0xdc'),_0x58822a),_0x23b336[_0x501b('0x6a')],_0x23b336[_0x501b('0xdd')],_0x23b336[_0x501b('0x74')]]);if(_0x35d3cb[_0x501b('0xa9')]===-0x1){return _0x35d3cb;}return this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')]('Executed\x20command\x20%s',_0x501b('0xdb')));};AGIVertices[_0x501b('0x13')][_0x501b('0xde')]=function(_0xfa46e3){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0xdf'),_0xfa46e3['label']));if(!this[_0x501b('0xa2')](_0xfa46e3['key'])){return this['channel'][_0x501b('0xa6')]('no\x20key\x20configured');}if(!this['isConfigured'](_0xfa46e3[_0x501b('0x61')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xa7'));}this['channel'][_0x501b('0xe0')]=!![];this[_0x501b('0x3b')](_0xfa46e3);this[_0x501b('0x46')](_0xfa46e3['text'],'in');this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0xe1'),_0xfa46e3['text']));var _0x46d6e9=this[_0x501b('0x7c')]['sync'](this,_0xfa46e3);if(_0x46d6e9){for(var _0x3a5fa6 in _0x46d6e9){if(_0x46d6e9[_0x501b('0x8f')](_0x3a5fa6)){this[_0x501b('0x10')][_0x501b('0x99')](util[_0x501b('0x2c')](_0x501b('0xe2'),_0x3a5fa6['toUpperCase']()),_0x46d6e9[_0x3a5fa6]);}}this[_0x501b('0x46')](_0x46d6e9[_0x501b('0xe3')],'out');return this[_0x501b('0x10')]['noop'](util[_0x501b('0x2c')]('Dialogflow\x20Result\x20%s',_0x46d6e9['speech']));}return this[_0x501b('0x10')][_0x501b('0x30')](_0xfa46e3,_0x501b('0xe4'));};AGIVertices[_0x501b('0x13')][_0x501b('0xe5')]=function(_0x3305b7){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0xe6'),_0x3305b7['label']));if(!this['isConfigured'](_0x3305b7[_0x501b('0xe7')])){return this['channel'][_0x501b('0xa6')](_0x501b('0xe8'));}if(!this[_0x501b('0xa2')](_0x3305b7['username'])){return this['channel'][_0x501b('0xa6')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x3305b7[_0x501b('0xe9')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xea'));}if(!this['isConfigured'](_0x3305b7['ndassistant_url'])){return this['channel']['noop'](_0x501b('0xa7'));}this[_0x501b('0x10')][_0x501b('0xe0')]=!![];this[_0x501b('0x3b')](_0x3305b7);this['createSquareMessage'](_0x3305b7[_0x501b('0x61')],'in');this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')]('Trying\x20SestekNDA:\x20%s',_0x3305b7[_0x501b('0x61')]));var _0x20a143=this[_0x501b('0x7e')][_0x501b('0x72')](this,_0x3305b7);if(_0x20a143){for(var _0x15279d in _0x20a143){if(_0x20a143[_0x501b('0x8f')](_0x15279d)){this[_0x501b('0x10')][_0x501b('0x99')](util[_0x501b('0x2c')]('SESTEK_NDA_%s',_0x15279d[_0x501b('0x6c')]()),_0x20a143[_0x15279d]);}}this['createSquareMessage'](_0x20a143['speech'],_0x501b('0xeb'));if(_0x20a143['audiofile']){this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x20a143[_0x501b('0xec')]));var _0x5dfcbe=this[_0x501b('0x10')][_0x501b('0xed')](_0x20a143[_0x501b('0xec')]);try{fs[_0x501b('0xee')](_0x20a143[_0x501b('0xec')]+_0x501b('0xef'));}catch(_0x168ce5){logger[_0x501b('0x30')](_0x168ce5);}return _0x5dfcbe;}else{return this[_0x501b('0x10')]['noop'](util[_0x501b('0x2c')](_0x501b('0xf0'),_0x20a143[_0x501b('0xe3')]));}}return this['channel'][_0x501b('0x30')](_0x3305b7,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x501b('0x13')]['end']=function(_0x50b339){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0xf1'),_0x50b339[_0x501b('0x3d')]));return this[_0x501b('0x10')][_0x501b('0xa6')]('end');};AGIVertices[_0x501b('0x13')][_0x501b('0xf2')]=function(_0xb24e32){logger['info'](util['format'](_0x501b('0xf3'),_0xb24e32[_0x501b('0x3d')]));var _0x597c40='';if(_0xb24e32[_0x501b('0xf4')]){if(!this['isConfigured'](_0xb24e32[_0x501b('0xf4')])){return this[_0x501b('0x10')][_0x501b('0x30')](_0xb24e32,_0x501b('0xf5'));}else{var _0x186866=parseInt(_0xb24e32[_0x501b('0xf4')],0xa);if(isNaN(_0x186866)){_0x597c40=_0xb24e32['trunk_id'];}else{_0x597c40=this['getTrunk'][_0x501b('0x72')](this,_0xb24e32[_0x501b('0xf4')]);if(!_0x597c40){return this[_0x501b('0x10')]['error'](_0xb24e32,_0x501b('0xf6'));}}}}else if(_0xb24e32[_0x501b('0xf7')]){_0x597c40=_0xb24e32[_0x501b('0xf7')];}else{return this[_0x501b('0x10')][_0x501b('0x30')](_0xb24e32,'no\x20trunk\x20selected');}var _0x45f758=this[_0x501b('0x10')][_0x501b('0x5c')](_0x501b('0xdb'),[util[_0x501b('0x2c')](_0x501b('0xf8'),_0x597c40,_0xb24e32[_0x501b('0x4d')]),_0xb24e32[_0x501b('0x6a')],_0xb24e32[_0x501b('0xdd')],_0xb24e32[_0x501b('0x74')]]);if(_0x45f758[_0x501b('0xa9')]===-0x1){return _0x45f758;}return this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0xf9'),'DIAL'));};AGIVertices[_0x501b('0x13')][_0x501b('0xfa')]=function(_0x415cdf){logger['info'](util['format'](_0x501b('0xfb'),_0x415cdf[_0x501b('0x3d')]));return this[_0x501b('0x10')]['noop'](_0x501b('0xfa'));};AGIVertices['prototype']['getdigits']=function(_0x29a164){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0xfc'),_0x29a164[_0x501b('0x3d')]));if(_0x29a164['retry']===0x0){return this[_0x501b('0xa3')](_0x29a164);}_0x29a164[_0x501b('0xa4')]-=0x1;if(!this[_0x501b('0xa2')](_0x29a164['file_id'])){return this[_0x501b('0x10')]['error'](_0x29a164,_0x501b('0xfd'));}var _0x2cb649=this[_0x501b('0x22')][_0x501b('0x72')](this,_0x29a164[_0x501b('0xfe')]);if(!_0x2cb649){return this[_0x501b('0x10')][_0x501b('0x30')](_0x29a164,_0x501b('0xff'));}if(!this[_0x501b('0xa2')](_0x29a164[_0x501b('0xd0')])){return this[_0x501b('0x10')]['error'](_0x501b('0xd1'));}var _0x6c0e2b=this[_0x501b('0x10')][_0x501b('0x100')](_0x2cb649,_0x29a164[_0x501b('0x101')],_0x29a164[_0x501b('0x102')]);var _0x3dfb7a=_0x6c0e2b[_0x501b('0xa9')]?_0x6c0e2b[_0x501b('0xa9')][_0x501b('0x9f')]():'';logger[_0x501b('0x34')](_0x501b('0x103'),JSON[_0x501b('0x9b')](_0x6c0e2b));if(_0x6c0e2b[_0x501b('0xa9')]===-0x1){this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x29a164,_0x3dfb7a);return _0x6c0e2b;}else if(_0x6c0e2b[_0x501b('0x9e')]===_0x501b('0x6a')){_0x6c0e2b[_0x501b('0xa9')]=_0x3dfb7a[_0x501b('0x98')]>=parseInt(_0x29a164[_0x501b('0x104')])?'x':'i';}else{_0x6c0e2b[_0x501b('0xa9')]=_0x3dfb7a[_0x501b('0x98')]>=parseInt(_0x29a164['mindigit'])&&_0x3dfb7a[_0x501b('0x98')]<=parseInt(_0x29a164[_0x501b('0x102')])?'x':'i';}var _0x27969f=this[_0x501b('0x14')][_0x501b('0x72')](this,_0x29a164['variable_id']);if(!_0x27969f){return this[_0x501b('0x10')]['error'](_0x29a164,_0x501b('0xd2'));}this['channel'][_0x501b('0x99')](_0x27969f,_0x3dfb7a);if(this[_0x501b('0xa2')](_0x29a164[_0x501b('0x105')])){var _0x593b1f=parseInt(_0x29a164[_0x501b('0x105')],0xa);var _0x283470=rs[_0x501b('0x106')]({'charset':'*','length':_0x593b1f});var _0x5d26c7=_0x3dfb7a[_0x501b('0x98')];if(_0x5d26c7>0x0){if(_0x5d26c7>_0x593b1f){this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x29a164,_0x29a164['hiddendigitspos']===_0x501b('0x107')?_0x283470+_0x3dfb7a[_0x501b('0x108')](_0x593b1f):_0x3dfb7a[_0x501b('0x108')](0x0,_0x5d26c7-_0x593b1f)+_0x283470);}else{this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x29a164,rs[_0x501b('0x106')]({'charset':'*','length':_0x5d26c7}));}}else{this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x29a164,'');}}else{this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x29a164,_0x3dfb7a);}return _0x6c0e2b;};AGIVertices['prototype'][_0x501b('0xf')]=function(_0x2678d2){logger[_0x501b('0x34')](util[_0x501b('0x2c')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2678d2[_0x501b('0x3d')]));return this[_0x501b('0xe')](_0x2678d2);};AGIVertices[_0x501b('0x13')][_0x501b('0x109')]=function(_0x16ab2e){logger['info'](util[_0x501b('0x2c')](_0x501b('0x10a'),_0x16ab2e['label']));this['createSquareDetailsReport']['sync'](this,_0x16ab2e,_0x16ab2e['goalname']);return this[_0x501b('0x10')]['noop'](util[_0x501b('0x2c')](_0x501b('0x10b'),_0x16ab2e['goalname']));};AGIVertices['prototype'][_0x501b('0x10c')]=function(_0x57b8c1){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x10d'),_0x57b8c1[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x57b8c1[_0x501b('0x84')])||!this[_0x501b('0xa2')](_0x57b8c1[_0x501b('0x10e')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x10f'));}if(!this[_0x501b('0xa2')](_0x57b8c1[_0x501b('0x61')])){return this['channel']['noop'](_0x501b('0xa7'));}this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x110'),_0x57b8c1[_0x501b('0x61')]));var _0x32b6d7=this[_0x501b('0x83')][_0x501b('0x72')](this,_0x57b8c1);if(_0x32b6d7){this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x111'),_0x32b6d7));var _0x244366=this['channel'][_0x501b('0xed')](_0x32b6d7);try{fs[_0x501b('0xee')](_0x32b6d7+_0x501b('0xef'));}catch(_0x611ba1){logger[_0x501b('0x30')](_0x611ba1);}return _0x244366;}return this[_0x501b('0x10')][_0x501b('0x30')](_0x57b8c1,_0x501b('0x112'));};AGIVertices[_0x501b('0x13')]['awslex']=function(_0x3cd441){logger['info'](util[_0x501b('0x2c')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x3cd441[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x3cd441['aws_access_key_id'])||!this[_0x501b('0xa2')](_0x3cd441[_0x501b('0x10e')])){return this[_0x501b('0x10')][_0x501b('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x501b('0xa2')](_0x3cd441[_0x501b('0x88')])){return this['channel'][_0x501b('0xa6')](_0x501b('0x113'));}if(!this[_0x501b('0xa2')](_0x3cd441['text'])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xa7'));}this[_0x501b('0x10')][_0x501b('0xe0')]=!![];this[_0x501b('0x3b')](_0x3cd441);this[_0x501b('0x46')](_0x3cd441[_0x501b('0x61')],'in');this[_0x501b('0x10')][_0x501b('0xa6')](util['format'](_0x501b('0x114'),_0x3cd441[_0x501b('0x61')]));var _0x5df21e=this[_0x501b('0x87')][_0x501b('0x72')](this,_0x3cd441);if(_0x5df21e){for(var _0x4320f0 in _0x5df21e){if(_0x5df21e[_0x501b('0x8f')](_0x4320f0)&&_[_0x501b('0x90')](_0x5df21e[_0x4320f0])){this['channel'][_0x501b('0x99')](util[_0x501b('0x2c')](_0x501b('0x115'),_0x4320f0[_0x501b('0x6c')]()),_0x5df21e[_0x4320f0]);}}if(_[_0x501b('0x49')](_0x5df21e[_0x501b('0x116')])){return this['channel'][_0x501b('0xa6')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x501b('0x46')](_0x5df21e[_0x501b('0x116')],_0x501b('0xeb'));return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x117'),_0x5df21e[_0x501b('0x116')]));}}return this[_0x501b('0x10')][_0x501b('0x30')](_0x3cd441,_0x501b('0x118'));};AGIVertices[_0x501b('0x13')][_0x501b('0x119')]=function(_0x5abf5c){logger['info'](util[_0x501b('0x2c')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5abf5c[_0x501b('0x3d')],_0x5abf5c[_0x501b('0x6a')]));if(!this['isConfigured'](_0x5abf5c['key'])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x11a'));}var _0x4d0d77=_0x501b('0x11b');var _0x45358d=util['format'](_0x501b('0x11c'),FILES_PATH,rs[_0x501b('0x106')](0x4));var _0x5051ef=util['format'](_0x501b('0x97'),_0x45358d,_0x4d0d77);var _0x4b8d31=!![];if(_0x5abf5c[_0x501b('0x11d')]===_0x501b('0x11e')){_0x4b8d31=![];}var _0x54ee7d=this[_0x501b('0x10')][_0x501b('0x11f')](_0x45358d,_0x4d0d77,_0x5abf5c[_0x501b('0x120')],_0x5abf5c['timeout'],undefined,_0x4b8d31);if(_0x54ee7d[_0x501b('0xa9')]!==-0x1){this[_0x501b('0x10')][_0x501b('0xa6')](util['format']('google\x20%s\x20file\x20created',_0x5051ef));var _0x4c4055=this[_0x501b('0x89')][_0x501b('0x72')](this,_0x5abf5c,_0x5051ef);if(_0x4c4055){for(var _0xad0770 in _0x4c4055){if(_0x4c4055[_0x501b('0x8f')](_0xad0770)){this['channel'][_0x501b('0x99')](util[_0x501b('0x2c')](_0x501b('0x121'),_0xad0770[_0x501b('0x6c')]()),_0x4c4055[_0xad0770]);}}return this[_0x501b('0x10')]['noop'](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x501b('0x9b')](_0x4c4055)));}}return _0x54ee7d;};AGIVertices[_0x501b('0x13')][_0x501b('0x122')]=function(_0x115c0f){logger[_0x501b('0x34')](util['format'](_0x501b('0x123'),_0x115c0f[_0x501b('0x3d')]));if(!this['isConfigured'](_0x115c0f[_0x501b('0x124')])){return this[_0x501b('0x10')]['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x115c0f['appsecret'])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x125'));}var _0x6cf758=_0x501b('0x11b');var _0x400105=util[_0x501b('0x2c')](_0x501b('0x11c'),FILES_PATH,rs[_0x501b('0x106')](0x4));var _0x2874e6=util[_0x501b('0x2c')](_0x501b('0x97'),_0x400105,_0x6cf758);var _0x23a8b2=!![];if(_0x115c0f[_0x501b('0x11d')]===_0x501b('0x11e')){_0x23a8b2=![];}var _0x28ab22=this[_0x501b('0x10')][_0x501b('0x11f')](_0x400105,_0x6cf758,_0x115c0f[_0x501b('0x120')],_0x115c0f[_0x501b('0x6a')],undefined,_0x23a8b2);if(_0x28ab22['result']!==-0x1){this[_0x501b('0x10')]['noop'](util[_0x501b('0x2c')](_0x501b('0x126'),_0x2874e6));var _0x4f4b73=this[_0x501b('0x8b')][_0x501b('0x72')](this,_0x115c0f,_0x2874e6);if(_0x4f4b73){for(var _0x4b9642 in _0x4f4b73){if(_0x4f4b73[_0x501b('0x8f')](_0x4b9642)){this[_0x501b('0x10')]['setVariable'](util[_0x501b('0x2c')]('TILDE_ASR_%s',_0x4b9642['toUpperCase']()),_0x4f4b73[_0x4b9642]);}}return this[_0x501b('0x10')][_0x501b('0xa6')](util['format'](_0x501b('0x127'),JSON[_0x501b('0x9b')](_0x4f4b73)));}}return _0x28ab22;};AGIVertices[_0x501b('0x13')][_0x501b('0x128')]=function(_0x33b5e5){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x129'),_0x33b5e5[_0x501b('0x3d')]));return this[_0x501b('0x10')]['continueAt'](_0x33b5e5[_0x501b('0x12a')],_0x33b5e5[_0x501b('0x43')],_0x33b5e5[_0x501b('0x12b')]);};AGIVertices[_0x501b('0x13')][_0x501b('0x12c')]=function(_0x3da583){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x12d'),_0x3da583['label']));if(!this[_0x501b('0xa2')](_0x3da583['condition'])){return this['channel'][_0x501b('0x30')](_0x3da583,_0x501b('0x12e'));}try{var _0x26d1bc=eval(_0x3da583[_0x501b('0x12f')])?_0x501b('0x130'):_0x501b('0x131');this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')]('EVAL\x20CONDITION\x20%s\x20%s',_0x3da583[_0x501b('0x12f')],_0x26d1bc));return{'code':0xc8,'result':_0x26d1bc};}catch(_0x54f4d5){return{'code':0xc8,'result':_0x501b('0x131')};}};AGIVertices['prototype'][_0x501b('0x132')]=function(_0x5dd2bb){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x133'),_0x5dd2bb[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x5dd2bb[_0x501b('0x134')])){return this[_0x501b('0x10')][_0x501b('0x30')](_0x5dd2bb,_0x501b('0x135'));}var _0x1e4b55=this['getIntervals'][_0x501b('0x72')](this,_0x5dd2bb[_0x501b('0x134')]);if(!_0x1e4b55){return this[_0x501b('0x10')][_0x501b('0x30')](_0x5dd2bb,_0x501b('0x136'));}for(var _0x432022=0x0;_0x432022<_0x1e4b55['length'];_0x432022+=0x1){var _0x4ef8f6=this[_0x501b('0x10')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0x1e4b55[_0x432022]));if(_0x4ef8f6[_0x501b('0xa9')]===-0x1){return _0x4ef8f6;}logger['info'](util[_0x501b('0x2c')](_0x501b('0x137'),_0x1e4b55[_0x432022],_0x4ef8f6[_0x501b('0x9e')]));if(_0x4ef8f6[_0x501b('0x9e')]===_0x501b('0x130')){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x137'),_0x1e4b55[_0x432022],_0x501b('0x130')));this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x137'),_0x1e4b55[_0x432022],_0x501b('0x130')));return{'code':0xc8,'result':'true'};}else{logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x1e4b55[_0x432022],'false'));this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x137'),_0x1e4b55[_0x432022],_0x501b('0x131')));}}return{'code':0xc8,'result':_0x501b('0x131')};};AGIVertices[_0x501b('0x13')][_0x501b('0x138')]=function(_0x396c30){logger[_0x501b('0x34')](util['format'](_0x501b('0x139'),_0x396c30[_0x501b('0x3d')]));return this[_0x501b('0x10')][_0x501b('0x138')]();};AGIVertices[_0x501b('0x13')]['ispeechasr']=function(_0x3833a8){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x13a'),_0x3833a8['label']));if(!this[_0x501b('0xa2')](_0x3833a8[_0x501b('0x7d')])){return this['channel'][_0x501b('0xa6')](_0x501b('0x11a'));}var _0x13e2d6=_0x501b('0x11b');var _0x383376=util[_0x501b('0x2c')](_0x501b('0x11c'),FILES_PATH,rs[_0x501b('0x106')](0x4));var _0x4cc21e=util['format'](_0x501b('0x97'),_0x383376,_0x13e2d6);var _0x7d36ff=!![];if(_0x3833a8[_0x501b('0x11d')]===_0x501b('0x11e')){_0x7d36ff=![];}var _0x5474bf=this[_0x501b('0x10')]['recordFile'](_0x383376,_0x13e2d6,_0x3833a8['intKey'],_0x3833a8['timeout'],undefined,_0x7d36ff);if(_0x5474bf[_0x501b('0xa9')]!==-0x1){this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x13b'),_0x4cc21e));var _0x45c595=this['ispeechASR'][_0x501b('0x72')](this,_0x3833a8,_0x4cc21e);if(_0x45c595){for(var _0x59aaf2 in _0x45c595){if(_0x45c595[_0x501b('0x8f')](_0x59aaf2)){this[_0x501b('0x10')][_0x501b('0x99')](util[_0x501b('0x2c')](_0x501b('0x13c'),_0x59aaf2[_0x501b('0x6c')]()),_0x45c595[_0x59aaf2]);}}return this['channel']['noop'](util[_0x501b('0x2c')](_0x501b('0x13d'),JSON['stringify'](_0x45c595)));}}return _0x5474bf;};AGIVertices['prototype'][_0x501b('0x13e')]=function(_0x7cbc39){logger['info'](util[_0x501b('0x2c')](_0x501b('0x13f'),_0x7cbc39[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x7cbc39[_0x501b('0x7d')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x11a'));}if(!this['isConfigured'](_0x7cbc39[_0x501b('0x61')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x140'),_0x7cbc39['text']));var _0x1fa480=this[_0x501b('0x141')][_0x501b('0x72')](this,_0x7cbc39);if(_0x1fa480){this['channel'][_0x501b('0xa6')](util['format'](_0x501b('0x13b'),_0x1fa480));var _0x31ad55=this[_0x501b('0x10')][_0x501b('0xed')](_0x1fa480,_0x7cbc39[_0x501b('0x120')]);try{fs[_0x501b('0xee')](_0x1fa480+_0x501b('0xef'));}catch(_0x22340e){logger[_0x501b('0x30')](_0x22340e);}return _0x31ad55;}return this['channel'][_0x501b('0x30')](_0x7cbc39,_0x501b('0x142'));};AGIVertices[_0x501b('0x13')][_0x501b('0x143')]=function(_0x43bf61){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x144'),_0x43bf61['label']));if(!this[_0x501b('0xa2')](_0x43bf61['findBy'])){return this[_0x501b('0x10')]['error'](_0x43bf61,_0x501b('0x145'));}logger[_0x501b('0x34')](util[_0x501b('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x501b('0x10')][_0x501b('0x40')],_0x43bf61[_0x501b('0x146')]));var _0x31b5af=this['agentLogin'][_0x501b('0x72')](this,_0x43bf61['findBy']);if(_0x31b5af){logger[_0x501b('0x34')](util['format'](_0x501b('0x147'),this[_0x501b('0x10')][_0x501b('0x40')],_0x43bf61[_0x501b('0x146')]));this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x147'),this[_0x501b('0x10')][_0x501b('0x40')],_0x43bf61[_0x501b('0x146')]));return{'code':0xc8,'result':_0x501b('0x148')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x501b('0x40')],_0x43bf61['findBy']));this[_0x501b('0x10')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x501b('0x10')][_0x501b('0x40')],_0x43bf61['findBy']));return{'code':0xc8,'result':_0x501b('0x149')};}};AGIVertices[_0x501b('0x13')][_0x501b('0x14a')]=function(_0x4968e5){logger['info'](util[_0x501b('0x2c')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4968e5['label']));if(!this[_0x501b('0xa2')](_0x4968e5[_0x501b('0x146')])){return this[_0x501b('0x10')][_0x501b('0x30')](_0x4968e5,_0x501b('0x145'));}logger['info'](util['format'](_0x501b('0x14b'),this['channel'][_0x501b('0x40')],_0x4968e5[_0x501b('0x146')]));var _0x1c5937=this[_0x501b('0x57')][_0x501b('0x72')](this,_0x4968e5[_0x501b('0x146')]);if(_0x1c5937){logger[_0x501b('0x34')](util['format'](_0x501b('0x147'),this['channel'][_0x501b('0x40')],_0x4968e5['findBy']));this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x147'),this[_0x501b('0x10')]['callerid'],_0x4968e5[_0x501b('0x146')]));return{'code':0xc8,'result':'success'};}else{logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x14c'),this[_0x501b('0x10')][_0x501b('0x40')],_0x4968e5['findBy']));this['channel'][_0x501b('0xa6')](util['format'](_0x501b('0x14c'),this[_0x501b('0x10')]['callerid'],_0x4968e5[_0x501b('0x146')]));return{'code':0xc8,'result':_0x501b('0x149')};}};AGIVertices['prototype'][_0x501b('0x14d')]=function(_0x45f5b9){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x14e'),_0x45f5b9[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x45f5b9['operation'])){return this['channel'][_0x501b('0x30')](_0x45f5b9,_0x501b('0x14f'));}this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')]('math\x20%s',_0x45f5b9[_0x501b('0x150')]));var _0xbda7ca=eval(_0x45f5b9['operation']);if(!this[_0x501b('0xa2')](_0x45f5b9[_0x501b('0xd0')])){return this['channel'][_0x501b('0xa6')](_0x501b('0xd1'));}var _0x4f26b0=this[_0x501b('0x14')][_0x501b('0x72')](this,_0x45f5b9[_0x501b('0xd0')]);if(!_0x4f26b0){return this[_0x501b('0x10')][_0x501b('0x30')](_0x45f5b9,_0x501b('0xd2'));}if(_[_0x501b('0x93')](_0xbda7ca)){var _0x2fd3cd=this;_0xbda7ca[_0x501b('0xd3')](function(_0x5556b5,_0x35b1fb){_0x2fd3cd[_0x501b('0x10')][_0x501b('0x99')](util[_0x501b('0x2c')](_0x501b('0x151'),_0x4f26b0,_0x35b1fb),_0x5556b5);});return this['channel']['noop'](util[_0x501b('0x2c')]('variable\x20%s[key]\x20set',_0x4f26b0));}else{return this['channel'][_0x501b('0x99')](_0x4f26b0,_0xbda7ca);}};AGIVertices[_0x501b('0x13')][_0x501b('0xd')]=function(_0x40190e){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x152'),_0x40190e[_0x501b('0x3d')]));if(_0x40190e['retry']===0x0){return this['maxRetry'](_0x40190e);}_0x40190e[_0x501b('0xa4')]-=0x1;if(!this[_0x501b('0xa2')](_0x40190e[_0x501b('0xfe')])){return this[_0x501b('0x10')]['error'](_0x40190e,_0x501b('0xfd'));}var _0x28ec1b=this['getSound'][_0x501b('0x72')](this,_0x40190e[_0x501b('0xfe')]);if(!_0x28ec1b){return this[_0x501b('0x10')][_0x501b('0x30')](_0x40190e,'no\x20file\x20audio\x20found');}var _0x4d65db=this[_0x501b('0x10')][_0x501b('0x100')](_0x28ec1b,_0x40190e[_0x501b('0x101')],_0x40190e[_0x501b('0x153')]);var _0x5dc0dd=_0x4d65db['result'];if(_0x4d65db['result']===-0x1){this['createSquareDetailsReport'][_0x501b('0x72')](this,_0x40190e,'-1');return _0x4d65db;}else if(_0x4d65db[_0x501b('0x9e')]===_0x501b('0x6a')){_0x4d65db['result']=_0x4d65db[_0x501b('0xa9')][_0x501b('0x98')]>0x0?_0x4d65db[_0x501b('0xa9')]:'t';}else if(_[_0x501b('0x48')](_0x4d65db['result'])){_0x4d65db['result']='#';_0x5dc0dd='#';}if(!this[_0x501b('0xa2')](_0x40190e['variable_id'])){this[_0x501b('0x10')][_0x501b('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4b20e8=this[_0x501b('0x14')]['sync'](this,_0x40190e[_0x501b('0xd0')]);if(!_0x4b20e8){return this[_0x501b('0x10')][_0x501b('0x30')](_0x40190e,_0x501b('0xd2'));}this['channel'][_0x501b('0x99')](_0x4b20e8,_0x5dc0dd);}this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x40190e,_0x5dc0dd);return _0x4d65db;};AGIVertices['prototype'][_0x501b('0xa6')]=function(_0x1c2e40){logger['info'](util[_0x501b('0x2c')](_0x501b('0x154'),_0x1c2e40['label']));return this[_0x501b('0x10')][_0x501b('0xa6')](_0x1c2e40[_0x501b('0x155')]||_0x1c2e40[_0x501b('0x3d')]);};AGIVertices['prototype'][_0x501b('0x156')]=function(_0x810e94){logger['info'](util[_0x501b('0x2c')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x810e94['label']));if(!this[_0x501b('0xa2')](_0x810e94['findBy'])){return this[_0x501b('0x10')]['error'](_0x810e94,'no\x20find\x20by\x20configured');}logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x14b'),this[_0x501b('0x10')][_0x501b('0x40')],_0x810e94[_0x501b('0x146')]));var _0x21e427=this[_0x501b('0x52')][_0x501b('0x72')](this,_0x810e94['pause_id']);var _0x3ec967=this[_0x501b('0x54')][_0x501b('0x72')](this,_0x810e94[_0x501b('0x146')],_0x21e427);if(_0x3ec967){logger['info'](util[_0x501b('0x2c')](_0x501b('0x147'),this[_0x501b('0x10')][_0x501b('0x40')],_0x810e94['findBy']));this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x147'),this[_0x501b('0x10')]['callerid'],_0x810e94['findBy']));return{'code':0xc8,'result':_0x501b('0x148')};}else{logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x14c'),this[_0x501b('0x10')][_0x501b('0x40')],_0x810e94[_0x501b('0x146')]));this['channel'][_0x501b('0xa6')](util['format'](_0x501b('0x147'),this[_0x501b('0x10')][_0x501b('0x40')],_0x810e94[_0x501b('0x146')]));return{'code':0xc8,'result':_0x501b('0x149')};}};AGIVertices[_0x501b('0x13')][_0x501b('0x157')]=function(_0x58b962){logger['info'](util['format'](_0x501b('0x158'),_0x58b962[_0x501b('0x3d')]));if(!this['isConfigured'](_0x58b962[_0x501b('0xfe')])){return this['channel'][_0x501b('0x30')](_0x58b962,_0x501b('0xfd'));}var _0x4aab8b=this[_0x501b('0x22')][_0x501b('0x72')](this,_0x58b962['file_id']);if(!_0x4aab8b){return this[_0x501b('0x10')][_0x501b('0x30')](_0x58b962,'no\x20file\x20audio\x20found');}var _0x274880=this[_0x501b('0x10')]['exec'](_0x501b('0x159'),[_0x4aab8b,_0x58b962[_0x501b('0xdd')]]);if(_0x274880[_0x501b('0xa9')]===-0x1){return _0x274880;}return this[_0x501b('0x10')][_0x501b('0xa6')](util['format'](_0x501b('0xbd'),_0x501b('0x159'),_0x4aab8b));};AGIVertices[_0x501b('0x13')]['queue']=function(_0x339743){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x15a'),_0x339743[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x339743[_0x501b('0x15b')])){return this[_0x501b('0x10')][_0x501b('0x30')](_0x339743,'no\x20queue\x20selected');}var _0x2cd29d='';var _0xb09589=parseInt(_0x339743[_0x501b('0x15b')],0xa);if(isNaN(_0xb09589)){_0x2cd29d=_0x339743[_0x501b('0x15b')];}else{_0x2cd29d=this[_0x501b('0x17')][_0x501b('0x72')](this,_0x339743[_0x501b('0x15b')]);if(!_0x2cd29d){return this['channel'][_0x501b('0x30')](_0x339743,'no\x20queue\x20found');}}var _0x1a2ae2='';if(this['isConfigured'](_0x339743['file_id'])){var _0x3bfcf8=this[_0x501b('0x22')][_0x501b('0x72')](this,_0x339743['file_id']);if(_0x3bfcf8){_0x1a2ae2=_0x3bfcf8;}}this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x339743,_0x2cd29d);if(_0x339743[_0x501b('0xdd')]['indexOf']('x')<0x0){_0x339743[_0x501b('0xdd')]+='x';}if(_0x339743[_0x501b('0xdd')][_0x501b('0x15c')]('X')<0x0){_0x339743[_0x501b('0xdd')]+='X';}this['channel']['setVariable'](_0x501b('0x15d'),_0x2cd29d?_0x2cd29d['toLowerCase']():'');var _0x57ab09=this[_0x501b('0x10')]['exec'](_0x501b('0x15e'),[_0x2cd29d,_0x339743[_0x501b('0xdd')],_0x339743[_0x501b('0x74')],_0x1a2ae2,_0x339743[_0x501b('0x6a')],_0x339743['agi'],_0x339743['macro'],_0x339743[_0x501b('0x15f')],'',_0x339743[_0x501b('0x160')]]);if(_0x57ab09[_0x501b('0xa9')]===-0x1){return _0x57ab09;}return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0xbd'),_0x501b('0x15e'),_0x2cd29d));};AGIVertices['prototype'][_0x501b('0x161')]=function(_0xee4153){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x162'),_0xee4153[_0x501b('0x3d')]));var _0x5abb85=_0xee4153[_0x501b('0x163')]||'wav';var _0x54f450=util[_0x501b('0x2c')]('%s_%s',this['channel'][_0x501b('0x3c')],rs[_0x501b('0x106')](0x5));var _0x4a26ea=util[_0x501b('0x2c')]('%s/recordings/%s.%s',FILES_PATH,_0x54f450,_0x5abb85);var _0x47f0a2=util[_0x501b('0x2c')]('%s/recordings/%s',FILES_PATH,_0x54f450);this['createSquareRecording'][_0x501b('0x72')](this,_0xee4153,_0x54f450,_0x4a26ea);this[_0x501b('0x10')][_0x501b('0x99')](_0x501b('0x164'),_0x54f450);logger['info'](_0x501b('0x165'),_0x47f0a2,_0x5abb85,_0xee4153['escape_digits'],_0xee4153['timeout']);return this[_0x501b('0x10')][_0x501b('0x11f')](_0x47f0a2,_0x5abb85,_0xee4153[_0x501b('0x166')],_0xee4153[_0x501b('0x6a')],undefined,!![]);};AGIVertices[_0x501b('0x13')][_0x501b('0x167')]=function(_0x4ee06e){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x168'),_0x4ee06e[_0x501b('0x3d')]));if(!this['isConfigured'](_0x4ee06e[_0x501b('0x74')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x169'));}var _0x15e652=this[_0x501b('0x16a')]['sync'](this,_0x4ee06e);logger[_0x501b('0x34')](util[_0x501b('0x2c')]('Response:',util['inspect'](_0x15e652,{'showHidden':![],'depth':null})));if(!this[_0x501b('0xa2')](_0x4ee06e[_0x501b('0xd0')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x16b'));}var _0x297fc1=this[_0x501b('0x14')][_0x501b('0x72')](this,_0x4ee06e[_0x501b('0xd0')]);if(!_0x297fc1){return this[_0x501b('0x10')][_0x501b('0x30')](_0x4ee06e,'no\x20variable\x20found');}this[_0x501b('0x10')][_0x501b('0x99')](util['format'](_0x501b('0x16c'),_0x297fc1),_0x15e652['statusCode']?_0x15e652[_0x501b('0x79')]:_0x501b('0x16d'));this['channel'][_0x501b('0x99')](util[_0x501b('0x2c')]('%s_STATUS_MESSAGE',_0x297fc1),_0x15e652['statusMessage']?_0x15e652['statusMessage']:'OK');if(_0x15e652[_0x501b('0x77')]){try{this[_0x501b('0x95')](_0x15e652['body'],_0x297fc1);}catch(_0x37c6af){logger[_0x501b('0x30')](util[_0x501b('0x2c')](_0x501b('0x16e'),_0x297fc1));}}return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x16f'),_0x297fc1));};AGIVertices[_0x501b('0x13')]['saydigits']=function(_0x4041e3){logger[_0x501b('0x34')](util['format'](_0x501b('0x170'),_0x4041e3[_0x501b('0x3d')]));return this[_0x501b('0x10')][_0x501b('0x171')](_0x4041e3[_0x501b('0x172')][_0x501b('0x5d')](/\s+/g,''),_0x4041e3[_0x501b('0x166')]);};AGIVertices['prototype'][_0x501b('0x173')]=function(_0x46204b){logger['info'](util[_0x501b('0x2c')](_0x501b('0x174'),_0x46204b[_0x501b('0x3d')]));return this[_0x501b('0x10')][_0x501b('0x175')](_0x46204b[_0x501b('0x176')][_0x501b('0x5d')](/\s+/g,''),_0x46204b['escape_digits']);};AGIVertices['prototype'][_0x501b('0x177')]=function(_0x52006e){logger['info'](util[_0x501b('0x2c')](_0x501b('0x178'),_0x52006e['label']));return this[_0x501b('0x10')]['sayPhonetic'](_0x52006e[_0x501b('0x61')],_0x52006e[_0x501b('0x166')]);};AGIVertices[_0x501b('0x13')][_0x501b('0x179')]=function(_0x5322d4){logger['info'](util[_0x501b('0x2c')](_0x501b('0x17a'),_0x5322d4[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x5322d4[_0x501b('0x17b')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x17c'));}var _0x5bffa9=this[_0x501b('0x26')]['sync'](this,_0x5322d4[_0x501b('0x17b')]);if(!_0x5bffa9||!_0x5bffa9[_0x501b('0x17d')]){return this['channel'][_0x501b('0x30')](_0x5322d4,'no\x20mail\x20account\x20found');}var _0x4f6ae2={'from':util['format'](_0x501b('0x17e'),_0x5bffa9[_0x501b('0x16')],_0x5bffa9[_0x501b('0x17f')]||_0x5bffa9[_0x501b('0x17d')][_0x501b('0x180')]),'to':_0x5322d4['to']||'','cc':_0x5322d4['cc']||'','bcc':_0x5322d4[_0x501b('0x181')]||'','subject':_0x5322d4['subject'],'html':_0x5322d4[_0x501b('0x61')],'text':_0x5322d4[_0x501b('0x61')]};var _0x41876e={'tls':{'rejectUnauthorized':![]}};if(_0x5bffa9[_0x501b('0x17d')][_0x501b('0x182')]){_0x41876e['service']=_0x5bffa9['Smtp']['service'];}else{_0x41876e[_0x501b('0x183')]=_0x5bffa9[_0x501b('0x17d')][_0x501b('0x183')];_0x41876e['port']=_0x5bffa9['Smtp'][_0x501b('0x184')];_0x41876e[_0x501b('0x185')]=_0x5bffa9['Smtp']['secure'];}if(_0x5bffa9[_0x501b('0x17d')]['authentication']){_0x41876e['auth']={'user':_0x5bffa9[_0x501b('0x17d')][_0x501b('0x180')],'pass':_0x5bffa9['Smtp'][_0x501b('0x186')]};}if(this['isConfigured'](_0x5322d4[_0x501b('0x187')])){}logger[_0x501b('0xd7')](_0x501b('0x188'),JSON[_0x501b('0x9b')](_0x4f6ae2));this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x5322d4,_0x5322d4['account_id']);this[_0x501b('0x10')]['noop'](util[_0x501b('0x2c')](_0x501b('0x189'),_0x5bffa9[_0x501b('0x16')]));this[_0x501b('0x28')]['sync'](this,_0x41876e,_0x4f6ae2);return this[_0x501b('0x10')][_0x501b('0xa6')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x501b('0x13')]['sendFax']=function(_0x6e7bb3){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x18a'),_0x6e7bb3[_0x501b('0x3d')]));return this[_0x501b('0x10')]['noop'](_0x501b('0x18b'));};AGIVertices[_0x501b('0x13')][_0x501b('0x18c')]=function(_0x551044){logger[_0x501b('0x34')](util['format'](_0x501b('0x18d'),_0x551044['label']));if(!this[_0x501b('0xa2')](_0x551044[_0x501b('0x18e')])){return this[_0x501b('0x10')]['noop']('no\x20sms\x20account\x20configured');}var _0x1ed41e=this[_0x501b('0x38')][_0x501b('0x72')](this,_0x551044[_0x501b('0x18e')]);if(!_0x1ed41e){return this[_0x501b('0x10')][_0x501b('0x30')](_0x551044,'no\x20sms\x20account\x20found');}var _0x25bc8a={'body':_0x551044[_0x501b('0x18f')],'phone':_0x551044['to']||'','SmsAccountId':_0x1ed41e['id']};logger[_0x501b('0xd7')](_0x501b('0x190'),JSON[_0x501b('0x9b')](_0x25bc8a));this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x551044,_0x551044[_0x501b('0x18e')]);this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x191'),_0x1ed41e[_0x501b('0x16')]));this[_0x501b('0x3a')]['sync'](this,_0x25bc8a);return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x192'));};AGIVertices['prototype'][_0x501b('0x193')]=function(_0x7edf43){logger['info'](util[_0x501b('0x2c')](_0x501b('0x194'),_0x7edf43[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x7edf43['variable_id'])){return this[_0x501b('0x10')][_0x501b('0x30')](_0x7edf43,_0x501b('0x195'));}var _0x3c8f28=this['getVariable'][_0x501b('0x72')](this,_0x7edf43['variable_id']);if(!_0x3c8f28){return this[_0x501b('0x10')][_0x501b('0x30')](_0x7edf43,_0x501b('0xd2'));}return this[_0x501b('0x10')][_0x501b('0x99')](_0x3c8f28,_0x7edf43['variable_value']);};AGIVertices['prototype']['start']=function(_0x55a47c){logger[_0x501b('0x34')](util['format'](_0x501b('0x196'),_0x55a47c[_0x501b('0x3d')]));this[_0x501b('0x10')]['noop']('START\x20CALLY\x20SQUARE');if(_0x55a47c[_0x501b('0xb6')]===_0x501b('0x197')){this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x198'));return this[_0x501b('0x10')]['answer']();}return this[_0x501b('0x10')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x501b('0x199')]=function(_0x795a4d){logger['info'](util[_0x501b('0x2c')](_0x501b('0x19a'),_0x795a4d['label']));if(!this['isConfigured'](_0x795a4d[_0x501b('0x19b')])){return this[_0x501b('0x10')][_0x501b('0x30')](_0x795a4d,_0x501b('0x19c'));}var _0x3e28cc=this[_0x501b('0x1a')]['sync'](this,_0x795a4d[_0x501b('0x19b')]);if(!this[_0x501b('0xa2')](_0x3e28cc)){return this[_0x501b('0x10')]['error'](_0x795a4d,util['format'](_0x501b('0x19d'),_0x795a4d[_0x501b('0x19b')]));}if(_0x3e28cc===this[_0x501b('0x10')][_0x501b('0x3f')]){return this[_0x501b('0x10')][_0x501b('0x30')](_0x795a4d,_0x501b('0x19e'));}this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x795a4d,_0x3e28cc);var _0x2cb219=this[_0x501b('0x10')][_0x501b('0x5c')](_0x501b('0x19f'),util[_0x501b('0x2c')](_0x501b('0x1a0'),config[_0x501b('0x9')][_0x501b('0x183')]||'127.0.0.1',_0x3e28cc,this['channel'][_0x501b('0x3f')]));if(_0x2cb219[_0x501b('0xa9')]===-0x1){return _0x2cb219;}return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0xbd'),_0x501b('0x19f'),_0x3e28cc));};AGIVertices[_0x501b('0x13')][_0x501b('0x1a1')]=function(_0x202d58){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x1a2'),_0x202d58[_0x501b('0x3d')]));var _0x343f3f=this[_0x501b('0x5b')][_0x501b('0x72')](this,_0x202d58[_0x501b('0xb2')]);this[_0x501b('0x3b')][_0x501b('0x72')](this,_0x202d58,_0x202d58[_0x501b('0xb2')]);if(this[_0x501b('0xa2')](_0x202d58['variable_id'])){var _0x1fce12=this[_0x501b('0x14')]['sync'](this,_0x202d58[_0x501b('0xd0')]);if(_0x1fce12){this[_0x501b('0x10')][_0x501b('0x99')](_0x1fce12,_0x343f3f);return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x202d58['command'],_0x1fce12));}}return this['channel'][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x1a3'),_0x202d58[_0x501b('0xb2')]));};AGIVertices['prototype'][_0x501b('0x1a4')]=function(_0x4390fb){logger[_0x501b('0x34')](util['format'](_0x501b('0x1a5'),_0x4390fb[_0x501b('0x3d')]));_0x4390fb[_0x501b('0x61')]=_0x4390fb['text'][_0x501b('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x501b('0xa2')](_0x4390fb['apiKey'])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0x1a6'));}if(!this['isConfigured'](_0x4390fb[_0x501b('0x61')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xa7'));}this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x4390fb[_0x501b('0x61')]));var _0x17d0a6=this[_0x501b('0x5e')][_0x501b('0x72')](this,_0x4390fb);if(_0x17d0a6){this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x1a7'),_0x17d0a6));var _0x3e9cd4=this[_0x501b('0x10')]['streamFile'](_0x17d0a6);try{fs['unlink'](_0x17d0a6+_0x501b('0xef'));}catch(_0x2dc46b){logger['error'](_0x2dc46b);}return _0x3e9cd4;}return this[_0x501b('0x10')][_0x501b('0x30')](_0x4390fb,_0x501b('0x1a8'));};AGIVertices[_0x501b('0x13')][_0x501b('0x1a9')]=function(_0x1bcd61){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x1aa'),_0x1bcd61[_0x501b('0x3d')]));_0x1bcd61[_0x501b('0x61')]=_0x1bcd61['text'][_0x501b('0x5d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x501b('0xa2')](_0x1bcd61[_0x501b('0x61')])){return this[_0x501b('0x10')][_0x501b('0xa6')](_0x501b('0xa7'));}this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')]('Trying\x20Google\x20TTS\x20%s',_0x1bcd61['text']));var _0x2cf03d=this['googleTTS']['sync'](this,_0x1bcd61);if(_0x2cf03d){this[_0x501b('0x10')][_0x501b('0xa6')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x2cf03d));var _0x2d3ec5=this['channel']['streamFile'](_0x2cf03d);try{fs['unlink'](_0x2cf03d+_0x501b('0xef'));}catch(_0x1df6b1){logger['error'](_0x1df6b1);}return _0x2d3ec5;}return this['channel'][_0x501b('0x30')](_0x1bcd61,_0x501b('0x1ab'));};AGIVertices[_0x501b('0x13')][_0x501b('0x1ac')]=function(_0x1a3417){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x1ad'),_0x1a3417['label']));if(!this[_0x501b('0xa2')](_0x1a3417[_0x501b('0x146')])){return this[_0x501b('0x10')][_0x501b('0x30')](_0x1a3417,_0x501b('0x145'));}logger[_0x501b('0x34')](util['format'](_0x501b('0x14b'),this[_0x501b('0x10')][_0x501b('0x40')],_0x1a3417[_0x501b('0x146')]));var _0x4f0ab7=this[_0x501b('0x56')][_0x501b('0x72')](this,_0x1a3417[_0x501b('0x146')]);if(_0x4f0ab7){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x147'),this['channel'][_0x501b('0x40')],_0x1a3417[_0x501b('0x146')]));this['channel'][_0x501b('0xa6')](util['format'](_0x501b('0x147'),this[_0x501b('0x10')]['callerid'],_0x1a3417[_0x501b('0x146')]));return{'code':0xc8,'result':'success'};}else{logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x14c'),this['channel'][_0x501b('0x40')],_0x1a3417[_0x501b('0x146')]));this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0x14c'),this[_0x501b('0x10')]['callerid'],_0x1a3417[_0x501b('0x146')]));return{'code':0xc8,'result':_0x501b('0x149')};}};AGIVertices['prototype'][_0x501b('0x1ae')]=function(_0x5fa261){logger[_0x501b('0x34')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x5fa261[_0x501b('0x3d')]));var _0x4f6862=this['channel'][_0x501b('0x5c')](_0x501b('0x1af'),[_0x5fa261[_0x501b('0x1b0')],_0x5fa261[_0x501b('0x7b')]]);if(_0x4f6862[_0x501b('0xa9')]===-0x1){return _0x4f6862;}return this[_0x501b('0x10')][_0x501b('0xa6')](util[_0x501b('0x2c')](_0x501b('0xbd'),_0x501b('0x1af'),_0x5fa261[_0x501b('0x1b0')]));};AGIVertices[_0x501b('0x13')][_0x501b('0x1b1')]=function(_0x38546e){logger[_0x501b('0x34')](util[_0x501b('0x2c')](_0x501b('0x1b2'),_0x38546e[_0x501b('0x3d')]));if(!this[_0x501b('0xa2')](_0x38546e[_0x501b('0xd0')])){return this[_0x501b('0x10')][_0x501b('0x30')](_0x38546e,'no\x20variable\x20selected');}var _0xc66c3d=this[_0x501b('0x14')]['sync'](this,_0x38546e['variable_id']);if(!_0xc66c3d){return this[_0x501b('0x10')]['error'](_0x38546e,_0x501b('0xd2'));}var _0x53384f=this[_0x501b('0x10')][_0x501b('0x14')](_0xc66c3d);return{'code':0xc8,'result':_0x53384f[_0x501b('0x9e')]?_0x53384f[_0x501b('0x9e')]:'-'};};String[_0x501b('0x13')][_0x501b('0x9d')]=function(_0x30cb5f,_0x4945a0){return this[_0x501b('0x9c')](_0x30cb5f)[_0x501b('0x1b3')](_0x4945a0);};module[_0x501b('0x1b4')]=AGIVertices;
\ No newline at end of file
index 4f50352..c7877df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0bb=['name','mandatoryDispositionPause','Action','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','prototype','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','startAcw','queue','mandatoryDisposition'];(function(_0x35b8ad,_0x545575){var _0x189f92=function(_0x232797){while(--_0x232797){_0x35b8ad['push'](_0x35b8ad['shift']());}};_0x189f92(++_0x545575);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x36eb7f,_0x57dca4){_0x36eb7f=_0x36eb7f-0x0;var _0x50023b=_0xd0bb[_0x36eb7f];return _0x50023b;};'use strict';var util=require(_0xbd0b('0x0'));var _=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var ami=require('../ami');var logger=require(_0xbd0b('0x3'))('acw');var RpcUser=require(_0xbd0b('0x4'));var RpcVoiceAgentReport=require(_0xbd0b('0x5'));function Acw(_0x53e6ce){this[_0xbd0b('0x6')]=_0x53e6ce['voiceQueues'];this[_0xbd0b('0x7')]=_0x53e6ce[_0xbd0b('0x7')];this[_0xbd0b('0x8')]=_0x53e6ce[_0xbd0b('0x8')];this[_0xbd0b('0x9')]={};ami['on']('agentconnect',this[_0xbd0b('0xa')][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xc'),this[_0xbd0b('0xd')][_0xbd0b('0xb')](this));ami['on']('hangup',this['syncHangup'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xe'),this['syncAgentRingNoAnswer'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0xf'),this['syncAttendedTransfer'][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0x10'),this[_0xbd0b('0x11')][_0xbd0b('0xb')](this));ami['on'](_0xbd0b('0x12'),this[_0xbd0b('0x13')][_0xbd0b('0xb')](this));}function getDiff(_0x1f25b6){var _0x1a55ab=moment()[_0xbd0b('0x14')](0x0);var _0x2d4664=moment(_0x1f25b6)['milliseconds'](0x0);return _0x1a55ab[_0xbd0b('0x15')](_0x2d4664,'seconds');}Acw['prototype'][_0xbd0b('0x16')]=function(_0x4c0e52){try{var _0x3183cf=this;var _0x40b075=this[_0xbd0b('0x9')][_0x4c0e52]['interface'];var _0x55e0a1=this[_0xbd0b('0x9')][_0x4c0e52][_0xbd0b('0x17')];var _0x1f2a6e=this[_0xbd0b('0x6')][_0x55e0a1];var _0x1c0a7c=![];var _0x40b798='ACW';if(_0x1f2a6e[_0xbd0b('0x18')]){if(_0x1f2a6e['mandatoryDispositionPause'][_0xbd0b('0x19')]){_0x1c0a7c=!![];_0x40b798=_0x1f2a6e[_0xbd0b('0x1a')][_0xbd0b('0x19')];}}ami[_0xbd0b('0x1b')]({'action':'QueuePause','interface':_0x40b075,'paused':!![],'reason':_0x40b798})[_0xbd0b('0x1c')](function(_0x38c27f){if(_0x3183cf[_0xbd0b('0x7')][_0x40b075]){return RpcUser['getAgent'](_0x3183cf[_0xbd0b('0x7')][_0x40b075]['id'])['then'](function(_0xc66b8){if(_0xc66b8&&!_0xc66b8[_0xbd0b('0x1d')]){logger[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x4c0e52,_0x40b075,_0x55e0a1);var _0x297c85=_0x3183cf['channels'][_0x4c0e52][_0xbd0b('0x20')]&&_0x3183cf['channels'][_0x4c0e52][_0xbd0b('0x21')]?_0x3183cf[_0xbd0b('0x9')][_0x4c0e52][_0xbd0b('0x21')]:_0x4c0e52;return RpcUser[_0xbd0b('0x22')](_0x3183cf[_0xbd0b('0x7')][_0x40b075],_0x40b798,_0x297c85)[_0xbd0b('0x1c')](function(_0x4fe9ed){if(!_0x1c0a7c){_0x3183cf[_0xbd0b('0x8')][_0x40b075]={};logger[_0xbd0b('0x1e')](_0xbd0b('0x23'),_0x4c0e52,_0x3183cf[_0xbd0b('0x6')][_0x55e0a1][_0xbd0b('0x24')],_0x40b075,_0x55e0a1);_0x3183cf[_0xbd0b('0x8')][_0x40b075]['timer']=setTimeout(_0x3183cf[_0xbd0b('0x25')][_0xbd0b('0xb')](_0x3183cf,_0x40b075),_0x3183cf[_0xbd0b('0x6')][_0x55e0a1]['acwTimeout']*0x3e8);_0x3183cf['timers'][_0x40b075][_0xbd0b('0x26')]=moment()[_0xbd0b('0x27')](_0xbd0b('0x28'));_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x29')]=_0x4c0e52;_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x17')]=_0x55e0a1;_0x3183cf['timers'][_0x40b075][_0xbd0b('0x2a')]=function(){var _0x3b70b4=getDiff(_0x3183cf['timers'][_0x40b075]['lastPauseAt']);clearTimeout(_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x2b')]);_0x3183cf['timers'][_0x40b075][_0xbd0b('0x2b')]=![];RpcVoiceAgentReport[_0xbd0b('0x2c')]({'acwtime':_0x3b70b4},_0x3183cf[_0xbd0b('0x8')][_0x40b075][_0xbd0b('0x29')],_0x40b075)[_0xbd0b('0x1c')](function(_0x27c478){logger['info'](_0xbd0b('0x2d'),_0x4c0e52,_0x3b70b4,_0x27c478);})[_0xbd0b('0x2e')](function(_0x32572e){logger[_0xbd0b('0x2f')](_0xbd0b('0x30'),_0x4c0e52,_0x32572e);});delete _0x3183cf[_0xbd0b('0x8')][_0x40b075];};}});}else{logger[_0xbd0b('0x1e')](_0xbd0b('0x31'),_0x4c0e52,_0x40b075,_0x55e0a1);}});}})[_0xbd0b('0x2e')](function(_0x3ac75f){logger[_0xbd0b('0x2f')](_0xbd0b('0x23'),_0x4c0e52,_0x3183cf[_0xbd0b('0x6')][_0x55e0a1][_0xbd0b('0x24')],_0x40b075,_0x55e0a1);})['finally'](function(){delete _0x3183cf[_0xbd0b('0x9')][_0x4c0e52];});}catch(_0x23b0fa){logger['error'](_0xbd0b('0x32'),_0x23b0fa[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x25')]=function(_0x27ad8b){try{var _0x288715=this;if(_0x288715['timers'][_0x27ad8b]){_0x288715[_0xbd0b('0x8')][_0x27ad8b][_0xbd0b('0x2b')]=![];var _0x3b5098=_0x288715[_0xbd0b('0x8')][_0x27ad8b][_0xbd0b('0x29')];var _0x47c961=_0x288715['timers'][_0x27ad8b][_0xbd0b('0x17')];var _0x8db305=_0x288715[_0xbd0b('0x6')][_0x47c961][_0xbd0b('0x24')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x27ad8b);RpcUser[_0xbd0b('0x35')](this['agents'][_0x27ad8b]);RpcVoiceAgentReport[_0xbd0b('0x2c')]({'acwtime':_0x8db305,'agentacw':!![]},_0x3b5098,_0x27ad8b)[_0xbd0b('0x1c')](function(_0x3f34dc){logger[_0xbd0b('0x1e')](_0xbd0b('0x2d'),_0x3b5098,_0x8db305,_0x3f34dc);})[_0xbd0b('0x2e')](function(_0x43115e){logger[_0xbd0b('0x2f')](_0xbd0b('0x30'),_0x3b5098,_0x43115e);});}else{logger[_0xbd0b('0x2f')](_0xbd0b('0x36'),_0x27ad8b);if(_0x288715[_0xbd0b('0x8')]){logger[_0xbd0b('0x1e')](_0xbd0b('0x37'),JSON[_0xbd0b('0x38')](_0x288715[_0xbd0b('0x8')]));}}}catch(_0x16c77c){logger[_0xbd0b('0x2f')]('[ACW][STOP]\x20%s',_0x16c77c[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0xa')]=function(_0x3f4d9b){try{if(this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]]&&(this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]][_0xbd0b('0x39')]||this[_0xbd0b('0x6')][_0x3f4d9b[_0xbd0b('0x17')]][_0xbd0b('0x18')])){if(this['agents'][_0x3f4d9b[_0xbd0b('0x3a')]]){this['channels'][_0x3f4d9b['uniqueid']]={'queue':_0x3f4d9b[_0xbd0b('0x17')],'interface':_0x3f4d9b[_0xbd0b('0x3a')],'destlinkedid':_0x3f4d9b[_0xbd0b('0x21')]};}}}catch(_0x580fa2){logger[_0xbd0b('0x2f')](_0xbd0b('0x3b'),_0x580fa2[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x13')]=function(_0x4f1e3a){try{if(this[_0xbd0b('0x6')][_0x4f1e3a[_0xbd0b('0x17')]]&&(this[_0xbd0b('0x6')][_0x4f1e3a[_0xbd0b('0x17')]][_0xbd0b('0x39')]||this[_0xbd0b('0x6')][_0x4f1e3a['queue']][_0xbd0b('0x18')])){if(this[_0xbd0b('0x7')][_0x4f1e3a[_0xbd0b('0x3a')]]){this[_0xbd0b('0x9')][_0x4f1e3a[_0xbd0b('0x29')]]={'queue':_0x4f1e3a[_0xbd0b('0x17')],'interface':_0x4f1e3a[_0xbd0b('0x3a')]};}}}catch(_0x563c64){logger[_0xbd0b('0x2f')](_0xbd0b('0x3c'),_0x563c64[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0xd')]=function(_0x30f77e){try{if(this[_0xbd0b('0x9')][_0x30f77e[_0xbd0b('0x29')]]&&_[_0xbd0b('0x3d')](this[_0xbd0b('0x9')][_0x30f77e[_0xbd0b('0x29')]][_0xbd0b('0x20')])){logger[_0xbd0b('0x1e')](_0xbd0b('0x3e'),_0x30f77e[_0xbd0b('0x29')]);this['startAcw'](_0x30f77e[_0xbd0b('0x29')]);}else if(this[_0xbd0b('0x9')][_0x30f77e['linkedid']]&&_['isUndefined'](this['channels'][_0x30f77e[_0xbd0b('0x3f')]]['attended'])){logger[_0xbd0b('0x1e')](_0xbd0b('0x40'),_0x30f77e[_0xbd0b('0x3f')]);this[_0xbd0b('0x16')](_0x30f77e['linkedid']);}}catch(_0x2d2e58){logger['error'](_0xbd0b('0x41'),_0x2d2e58['message']);}};Acw['prototype'][_0xbd0b('0x42')]=function(_0x22f741){try{if(this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x29')]]&&this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x29')]][_0xbd0b('0x20')]){logger[_0xbd0b('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x22f741['uniqueid']);this[_0xbd0b('0x16')](_0x22f741[_0xbd0b('0x29')]);}else if(this['channels'][_0x22f741['linkedid']]&&this[_0xbd0b('0x9')][_0x22f741[_0xbd0b('0x3f')]][_0xbd0b('0x20')]){logger[_0xbd0b('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x22f741[_0xbd0b('0x3f')]);this[_0xbd0b('0x16')](_0x22f741[_0xbd0b('0x3f')]);}}catch(_0x183029){logger['error'](_0xbd0b('0x43'),_0x183029[_0xbd0b('0x33')]);}};Acw['prototype'][_0xbd0b('0x44')]=function(_0x1ea443){try{if(!_[_0xbd0b('0x45')](this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x46')]])){this[_0xbd0b('0x16')](_0x1ea443[_0xbd0b('0x46')]);if(this[_0xbd0b('0x9')][_0x1ea443['secondtransfereruniqueid']]){this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x47')]][_0xbd0b('0x20')]=!![];this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x48')]]=this[_0xbd0b('0x9')][_0x1ea443['secondtransfereruniqueid']];delete this['channels'][_0x1ea443[_0xbd0b('0x47')]];}}else if(!_[_0xbd0b('0x45')](this['channels'][_0x1ea443[_0xbd0b('0x48')]])){this[_0xbd0b('0x16')](_0x1ea443[_0xbd0b('0x48')]);if(this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]]){this['channels'][_0x1ea443[_0xbd0b('0x49')]][_0xbd0b('0x20')]=!![];this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x46')]]=this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]];delete this[_0xbd0b('0x9')][_0x1ea443[_0xbd0b('0x49')]];}}}catch(_0x429534){logger[_0xbd0b('0x2f')](_0xbd0b('0x4a'),_0x429534[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x11')]=function(_0x164a2e){try{if(this[_0xbd0b('0x9')][_0x164a2e[_0xbd0b('0x4b')]]){logger['info'](_0xbd0b('0x4c'),JSON[_0xbd0b('0x38')](_0x164a2e[_0xbd0b('0x4b')]));this[_0xbd0b('0x16')](_0x164a2e['transfereruniqueid']);}else if(this['channels'][_0x164a2e[_0xbd0b('0x4d')]]){logger[_0xbd0b('0x1e')](_0xbd0b('0x4e'),JSON[_0xbd0b('0x38')](_0x164a2e[_0xbd0b('0x4d')]));this['startAcw'](_0x164a2e[_0xbd0b('0x4d')]);}}catch(_0x4d3664){logger[_0xbd0b('0x2f')](_0xbd0b('0x4f'),_0x4d3664[_0xbd0b('0x33')]);}};Acw[_0xbd0b('0x34')][_0xbd0b('0x50')]=function(_0x463db8){try{if(this['voiceQueues'][_0x463db8[_0xbd0b('0x17')]]&&this[_0xbd0b('0x6')][_0x463db8[_0xbd0b('0x17')]][_0xbd0b('0x51')]==='all'){if(this[_0xbd0b('0x7')][_0x463db8[_0xbd0b('0x3a')]]){logger[_0xbd0b('0x1e')](_0xbd0b('0x52'),_0x463db8[_0xbd0b('0x29')],_0x463db8['interface'],_0x463db8['queue']);return RpcUser[_0xbd0b('0x22')](this['agents'][_0x463db8[_0xbd0b('0x3a')]],_0xbd0b('0x53'),_0x463db8[_0xbd0b('0x29')]);}}}catch(_0x1876ae){logger[_0xbd0b('0x2f')](_0xbd0b('0x54'),_0x1876ae['message']);}};module[_0xbd0b('0x55')]=Acw;
\ No newline at end of file
+var _0xe14d=['agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','uniqueid','updateAcw','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','startAcw','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup'];(function(_0xf78361,_0x1e4739){var _0x326050=function(_0x5188be){while(--_0x5188be){_0xf78361['push'](_0xf78361['shift']());}};_0x326050(++_0x1e4739);}(_0xe14d,0x1ee));var _0xde14=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xe14d[_0x494d1f];return _0x457b6e;};'use strict';var util=require(_0xde14('0x0'));var _=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var ami=require(_0xde14('0x3'));var logger=require('../../../config/logger')(_0xde14('0x4'));var RpcUser=require(_0xde14('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1c3e94){this[_0xde14('0x6')]=_0x1c3e94[_0xde14('0x6')];this[_0xde14('0x7')]=_0x1c3e94[_0xde14('0x7')];this[_0xde14('0x8')]=_0x1c3e94['timers'];this['channels']={};ami['on'](_0xde14('0x9'),this[_0xde14('0xa')][_0xde14('0xb')](this));ami['on'](_0xde14('0xc'),this[_0xde14('0xd')][_0xde14('0xb')](this));ami['on'](_0xde14('0xe'),this[_0xde14('0xf')]['bind'](this));ami['on'](_0xde14('0x10'),this[_0xde14('0x11')][_0xde14('0xb')](this));ami['on'](_0xde14('0x12'),this[_0xde14('0x13')][_0xde14('0xb')](this));ami['on'](_0xde14('0x14'),this[_0xde14('0x15')][_0xde14('0xb')](this));ami['on'](_0xde14('0x16'),this[_0xde14('0x17')][_0xde14('0xb')](this));}function getDiff(_0x3521d4){var _0x281c54=moment()[_0xde14('0x18')](0x0);var _0x54c58b=moment(_0x3521d4)['milliseconds'](0x0);return _0x281c54[_0xde14('0x19')](_0x54c58b,_0xde14('0x1a'));}Acw[_0xde14('0x1b')]['startAcw']=function(_0x16aa55){try{var _0x31adb3=this;var _0x257390=this[_0xde14('0x1c')][_0x16aa55][_0xde14('0x1d')];var _0x1b9d4b=this[_0xde14('0x1c')][_0x16aa55][_0xde14('0x1e')];var _0x3cc317=this[_0xde14('0x6')][_0x1b9d4b];var _0x590a8b=![];var _0x3f5fcf=_0xde14('0x1f');if(_0x3cc317[_0xde14('0x20')]){if(_0x3cc317[_0xde14('0x21')]['name']){_0x590a8b=!![];_0x3f5fcf=_0x3cc317[_0xde14('0x21')]['name'];}}ami[_0xde14('0x22')]({'action':'QueuePause','interface':_0x257390,'paused':!![],'reason':_0x3f5fcf})[_0xde14('0x23')](function(_0x30fcf1){if(_0x31adb3[_0xde14('0x7')][_0x257390]){return RpcUser[_0xde14('0x24')](_0x31adb3[_0xde14('0x7')][_0x257390]['id'])[_0xde14('0x23')](function(_0x40b648){if(_0x40b648&&!_0x40b648[_0xde14('0x25')]){logger[_0xde14('0x26')](_0xde14('0x27'),_0x16aa55,_0x257390,_0x1b9d4b);var _0x475f2f=_0x31adb3[_0xde14('0x1c')][_0x16aa55][_0xde14('0x28')]&&_0x31adb3['channels'][_0x16aa55][_0xde14('0x29')]?_0x31adb3[_0xde14('0x1c')][_0x16aa55][_0xde14('0x29')]:_0x16aa55;return RpcUser[_0xde14('0x2a')](_0x31adb3[_0xde14('0x7')][_0x257390],_0x3f5fcf,_0x475f2f)[_0xde14('0x23')](function(_0x310d75){if(!_0x590a8b){_0x31adb3[_0xde14('0x8')][_0x257390]={};logger[_0xde14('0x26')](_0xde14('0x2b'),_0x16aa55,_0x31adb3['voiceQueues'][_0x1b9d4b][_0xde14('0x2c')],_0x257390,_0x1b9d4b);_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x2d')]=setTimeout(_0x31adb3[_0xde14('0x2e')]['bind'](_0x31adb3,_0x257390),_0x31adb3[_0xde14('0x6')][_0x1b9d4b][_0xde14('0x2c')]*0x3e8);_0x31adb3[_0xde14('0x8')][_0x257390]['lastPauseAt']=moment()[_0xde14('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x30')]=_0x16aa55;_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x1e')]=_0x1b9d4b;_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x31')]=function(){var _0xae9dca=getDiff(_0x31adb3[_0xde14('0x8')][_0x257390]['lastPauseAt']);clearTimeout(_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x2d')]);_0x31adb3['timers'][_0x257390][_0xde14('0x2d')]=![];RpcVoiceAgentReport['update']({'acwtime':_0xae9dca},_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x30')],_0x257390)[_0xde14('0x23')](function(_0x21a916){logger[_0xde14('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x16aa55,_0xae9dca,_0x21a916);})[_0xde14('0x32')](function(_0x57b98b){logger['error'](_0xde14('0x33'),_0x16aa55,_0x57b98b);});delete _0x31adb3[_0xde14('0x8')][_0x257390];};}});}else{logger[_0xde14('0x26')](_0xde14('0x34'),_0x16aa55,_0x257390,_0x1b9d4b);}});}})[_0xde14('0x32')](function(_0xa41c1e){logger[_0xde14('0x35')](_0xde14('0x2b'),_0x16aa55,_0x31adb3[_0xde14('0x6')][_0x1b9d4b]['acwTimeout'],_0x257390,_0x1b9d4b);})['finally'](function(){delete _0x31adb3[_0xde14('0x1c')][_0x16aa55];});}catch(_0x403007){logger[_0xde14('0x35')](_0xde14('0x36'),_0x403007[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x2e')]=function(_0x2b0bc4){try{var _0x2ac7ba=this;if(_0x2ac7ba['timers'][_0x2b0bc4]){_0x2ac7ba[_0xde14('0x8')][_0x2b0bc4]['timer']=![];var _0x4a363c=_0x2ac7ba['timers'][_0x2b0bc4][_0xde14('0x30')];var _0x258759=_0x2ac7ba[_0xde14('0x8')][_0x2b0bc4][_0xde14('0x1e')];var _0x1228d8=_0x2ac7ba[_0xde14('0x6')][_0x258759][_0xde14('0x2c')];logger[_0xde14('0x26')]('[TIMER][STOP][AGENT:%s]',_0x2b0bc4);RpcUser[_0xde14('0x38')](this[_0xde14('0x7')][_0x2b0bc4]);RpcVoiceAgentReport[_0xde14('0x39')]({'acwtime':_0x1228d8,'agentacw':!![]},_0x4a363c,_0x2b0bc4)[_0xde14('0x23')](function(_0x346566){logger[_0xde14('0x26')](_0xde14('0x3a'),_0x4a363c,_0x1228d8,_0x346566);})[_0xde14('0x32')](function(_0x50db0d){logger[_0xde14('0x35')](_0xde14('0x33'),_0x4a363c,_0x50db0d);});}else{logger[_0xde14('0x35')](_0xde14('0x3b'),_0x2b0bc4);if(_0x2ac7ba['timers']){logger['info'](_0xde14('0x3c'),JSON[_0xde14('0x3d')](_0x2ac7ba[_0xde14('0x8')]));}}}catch(_0x171080){logger[_0xde14('0x35')]('[ACW][STOP]\x20%s',_0x171080[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0xa')]=function(_0x595fd5){try{if(this[_0xde14('0x6')][_0x595fd5['queue']]&&(this[_0xde14('0x6')][_0x595fd5['queue']][_0xde14('0x4')]||this[_0xde14('0x6')][_0x595fd5[_0xde14('0x1e')]][_0xde14('0x20')])){if(this[_0xde14('0x7')][_0x595fd5[_0xde14('0x1d')]]){this[_0xde14('0x1c')][_0x595fd5[_0xde14('0x30')]]={'queue':_0x595fd5['queue'],'interface':_0x595fd5[_0xde14('0x1d')],'destlinkedid':_0x595fd5['destlinkedid']};}}}catch(_0x430b22){logger['error'](_0xde14('0x3e'),_0x430b22[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x17')]=function(_0x40e7ae){try{if(this[_0xde14('0x6')][_0x40e7ae[_0xde14('0x1e')]]&&(this[_0xde14('0x6')][_0x40e7ae['queue']][_0xde14('0x4')]||this[_0xde14('0x6')][_0x40e7ae[_0xde14('0x1e')]][_0xde14('0x20')])){if(this['agents'][_0x40e7ae[_0xde14('0x1d')]]){this[_0xde14('0x1c')][_0x40e7ae[_0xde14('0x30')]]={'queue':_0x40e7ae[_0xde14('0x1e')],'interface':_0x40e7ae[_0xde14('0x1d')]};}}}catch(_0x19e12c){logger['error'](_0xde14('0x3f'),_0x19e12c['message']);}};Acw[_0xde14('0x1b')][_0xde14('0xd')]=function(_0x48a677){try{if(this[_0xde14('0x1c')][_0x48a677[_0xde14('0x30')]]&&_[_0xde14('0x40')](this[_0xde14('0x1c')][_0x48a677[_0xde14('0x30')]][_0xde14('0x28')])){logger[_0xde14('0x26')]('[%s][HANGUP:UNIQUEID]',_0x48a677[_0xde14('0x30')]);this['startAcw'](_0x48a677[_0xde14('0x30')]);}else if(this[_0xde14('0x1c')][_0x48a677[_0xde14('0x41')]]&&_[_0xde14('0x40')](this[_0xde14('0x1c')][_0x48a677[_0xde14('0x41')]][_0xde14('0x28')])){logger[_0xde14('0x26')](_0xde14('0x42'),_0x48a677[_0xde14('0x41')]);this['startAcw'](_0x48a677[_0xde14('0x41')]);}}catch(_0x1688c6){logger[_0xde14('0x35')](_0xde14('0x43'),_0x1688c6[_0xde14('0x37')]);}};Acw['prototype'][_0xde14('0xf')]=function(_0x4dc2e3){try{if(this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x30')]]&&this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x30')]][_0xde14('0x28')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4dc2e3[_0xde14('0x30')]);this['startAcw'](_0x4dc2e3[_0xde14('0x30')]);}else if(this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x41')]]&&this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x41')]][_0xde14('0x28')]){logger[_0xde14('0x26')](_0xde14('0x44'),_0x4dc2e3[_0xde14('0x41')]);this['startAcw'](_0x4dc2e3[_0xde14('0x41')]);}}catch(_0x2c972b){logger[_0xde14('0x35')](_0xde14('0x45'),_0x2c972b[_0xde14('0x37')]);}};Acw['prototype'][_0xde14('0x13')]=function(_0x58790d){try{if(!_[_0xde14('0x46')](this[_0xde14('0x1c')][_0x58790d[_0xde14('0x47')]])){this[_0xde14('0x48')](_0x58790d[_0xde14('0x47')]);if(this[_0xde14('0x1c')][_0x58790d[_0xde14('0x49')]]){this[_0xde14('0x1c')][_0x58790d['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x58790d[_0xde14('0x4a')]]=this['channels'][_0x58790d['secondtransfereruniqueid']];delete this[_0xde14('0x1c')][_0x58790d[_0xde14('0x49')]];}}else if(!_[_0xde14('0x46')](this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4a')]])){this[_0xde14('0x48')](_0x58790d[_0xde14('0x4a')]);if(this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4b')]]){this['channels'][_0x58790d[_0xde14('0x4b')]][_0xde14('0x28')]=!![];this[_0xde14('0x1c')][_0x58790d['transfereeuniqueid']]=this[_0xde14('0x1c')][_0x58790d['origtransfereruniqueid']];delete this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4b')]];}}}catch(_0x40ab83){logger[_0xde14('0x35')](_0xde14('0x4c'),_0x40ab83[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')]['syncBlindTransfer']=function(_0x3a357a){try{if(this[_0xde14('0x1c')][_0x3a357a[_0xde14('0x4d')]]){logger[_0xde14('0x26')](_0xde14('0x4e'),JSON[_0xde14('0x3d')](_0x3a357a[_0xde14('0x4d')]));this['startAcw'](_0x3a357a['transfereruniqueid']);}else if(this[_0xde14('0x1c')][_0x3a357a[_0xde14('0x4f')]]){logger[_0xde14('0x26')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xde14('0x3d')](_0x3a357a[_0xde14('0x4f')]));this[_0xde14('0x48')](_0x3a357a[_0xde14('0x4f')]);}}catch(_0x51e8ca){logger['error'](_0xde14('0x50'),_0x51e8ca[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x11')]=function(_0x136c21){try{if(this[_0xde14('0x6')][_0x136c21[_0xde14('0x1e')]]&&this[_0xde14('0x6')][_0x136c21[_0xde14('0x1e')]][_0xde14('0x51')]===_0xde14('0x52')){if(this[_0xde14('0x7')][_0x136c21[_0xde14('0x1d')]]){logger[_0xde14('0x26')](_0xde14('0x53'),_0x136c21[_0xde14('0x30')],_0x136c21[_0xde14('0x1d')],_0x136c21[_0xde14('0x1e')]);return RpcUser[_0xde14('0x2a')](this[_0xde14('0x7')][_0x136c21[_0xde14('0x1d')]],_0xde14('0x54'),_0x136c21[_0xde14('0x30')]);}}}catch(_0x4809fa){logger[_0xde14('0x35')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x4809fa[_0xde14('0x37')]);}};module['exports']=Acw;
\ No newline at end of file
index 2dcf4c7..b431e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4f=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','actionDeviceStateList','catch','log','exports','asterisk-manager','bluebird','util','ami','asterisk','username','password','keepConnected','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','error'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xac4f,0x1c6));var _0xfac4=function(_0x16b992,_0x43d74c){_0x16b992=_0x16b992-0x0;var _0x385c78=_0xac4f[_0x16b992];return _0x385c78;};'use strict';var Manager=require(_0xfac4('0x0'));var BPromise=require(_0xfac4('0x1'));var moment=require('moment');var util=require(_0xfac4('0x2'));var _=require('lodash');var logger=require('../../config/logger')(_0xfac4('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0xfac4('0x4')]['port'],config[_0xfac4('0x4')]['ip'],config[_0xfac4('0x4')][_0xfac4('0x5')],config[_0xfac4('0x4')][_0xfac4('0x6')],!![]);ami[_0xfac4('0x7')]();ami['Action']=BPromise['promisify'](ami[_0xfac4('0x8')]);function error(_0x3b202c){logger['error'](util[_0xfac4('0x9')](_0xfac4('0xa'),config[_0xfac4('0x4')]['username'],config['asterisk']['ip'],config[_0xfac4('0x4')][_0xfac4('0xb')],util[_0xfac4('0xc')](_0x3b202c,![],null)));}function close(){logger[_0xfac4('0xd')](util[_0xfac4('0x9')](_0xfac4('0xe'),config[_0xfac4('0x4')]['username'],config[_0xfac4('0x4')]['ip'],config[_0xfac4('0x4')][_0xfac4('0xb')]));}ami[_0xfac4('0xf')]=function(){return function(){return ami[_0xfac4('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xfac4('0x11')});};};ami[_0xfac4('0x12')]=function(){return function(){return ami['Action']({'action':_0xfac4('0x13')});};};ami[_0xfac4('0x14')]=function(){return function(){return ami[_0xfac4('0x10')]({'action':'queuesummary'});};};ami[_0xfac4('0x15')]=function(){return function(){return ami[_0xfac4('0x10')]({'action':_0xfac4('0x16')});};};function connect(_0x286993){logger['info'](util['format'](_0xfac4('0x17'),config['asterisk'][_0xfac4('0x5')],config[_0xfac4('0x4')]['ip'],config[_0xfac4('0x4')]['port']));ami['once'](_0xfac4('0xd'),error);ami[_0xfac4('0x18')](_0xfac4('0x19'),close);}ami['on'](_0xfac4('0x1a'),connect);ami['on'](_0xfac4('0x1b'),function(_0x4f9a4e){logger[_0xfac4('0x1c')](util[_0xfac4('0x9')](_0xfac4('0x1d'),config['asterisk'][_0xfac4('0x5')],config[_0xfac4('0x4')]['ip'],config[_0xfac4('0x4')][_0xfac4('0xb')],util[_0xfac4('0xc')](_0x4f9a4e,![],null)));});ami['on'](_0xfac4('0x1e'),function(_0x4a469d){logger[_0xfac4('0x1c')](util[_0xfac4('0x9')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk']['username'],config[_0xfac4('0x4')]['ip'],config[_0xfac4('0x4')][_0xfac4('0xb')]));return BPromise['resolve']()[_0xfac4('0x1f')](ami[_0xfac4('0xf')]())['then'](ami[_0xfac4('0x20')]())[_0xfac4('0x1f')](ami[_0xfac4('0x12')]())[_0xfac4('0x1f')](ami[_0xfac4('0x14')]())[_0xfac4('0x1f')](ami[_0xfac4('0x15')]())[_0xfac4('0x21')](function(_0x1c99e6){console[_0xfac4('0x22')](_0x1c99e6);});});ami[_0xfac4('0x18')](_0xfac4('0xd'),error);ami[_0xfac4('0x18')]('close',close);module[_0xfac4('0x23')]=ami;
\ No newline at end of file
+var _0xa80a=['port','username','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','log','asterisk-manager','bluebird','moment','util','ami','../../config/environment','asterisk'];(function(_0x34f683,_0xb0184){var _0x49c0bd=function(_0x395f64){while(--_0x395f64){_0x34f683['push'](_0x34f683['shift']());}};_0x49c0bd(++_0xb0184);}(_0xa80a,0x1e3));var _0xaa80=function(_0x54deeb,_0x6dbfc4){_0x54deeb=_0x54deeb-0x0;var _0x3cffa8=_0xa80a[_0x54deeb];return _0x3cffa8;};'use strict';var Manager=require(_0xaa80('0x0'));var BPromise=require(_0xaa80('0x1'));var moment=require(_0xaa80('0x2'));var util=require(_0xaa80('0x3'));var _=require('lodash');var logger=require('../../config/logger')(_0xaa80('0x4'));var config=require(_0xaa80('0x5'));var ami=new Manager(config[_0xaa80('0x6')][_0xaa80('0x7')],config[_0xaa80('0x6')]['ip'],config[_0xaa80('0x6')][_0xaa80('0x8')],config['asterisk']['password'],!![]);ami['keepConnected']();ami[_0xaa80('0x9')]=BPromise[_0xaa80('0xa')](ami['action']);function error(_0x16cef2){logger[_0xaa80('0xb')](util[_0xaa80('0xc')](_0xaa80('0xd'),config[_0xaa80('0x6')]['username'],config['asterisk']['ip'],config[_0xaa80('0x6')][_0xaa80('0x7')],util[_0xaa80('0xe')](_0x16cef2,![],null)));}function close(){logger[_0xaa80('0xb')](util[_0xaa80('0xc')](_0xaa80('0xf'),config[_0xaa80('0x6')][_0xaa80('0x8')],config[_0xaa80('0x6')]['ip'],config[_0xaa80('0x6')][_0xaa80('0x7')]));}ami[_0xaa80('0x10')]=function(){return function(){return ami['Action']({'action':_0xaa80('0x11')});};};ami[_0xaa80('0x12')]=function(){return function(){return ami['Action']({'action':_0xaa80('0x13')});};};ami[_0xaa80('0x14')]=function(){return function(){return ami[_0xaa80('0x9')]({'action':_0xaa80('0x15')});};};ami[_0xaa80('0x16')]=function(){return function(){return ami[_0xaa80('0x9')]({'action':'queuesummary'});};};ami[_0xaa80('0x17')]=function(){return function(){return ami[_0xaa80('0x9')]({'action':'coreshowchannels'});};};function connect(_0x151562){logger[_0xaa80('0x18')](util[_0xaa80('0xc')](_0xaa80('0x19'),config[_0xaa80('0x6')]['username'],config['asterisk']['ip'],config[_0xaa80('0x6')][_0xaa80('0x7')]));ami[_0xaa80('0x1a')]('error',error);ami['once'](_0xaa80('0x1b'),close);}ami['on'](_0xaa80('0x1c'),connect);ami['on'](_0xaa80('0x1d'),function(_0x1581af){logger[_0xaa80('0x18')](util[_0xaa80('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xaa80('0x8')],config[_0xaa80('0x6')]['ip'],config[_0xaa80('0x6')][_0xaa80('0x7')],util[_0xaa80('0xe')](_0x1581af,![],null)));});ami['on']('fullybooted',function(_0x340c40){logger[_0xaa80('0x18')](util[_0xaa80('0xc')](_0xaa80('0x1e'),config[_0xaa80('0x6')]['username'],config[_0xaa80('0x6')]['ip'],config[_0xaa80('0x6')][_0xaa80('0x7')]));return BPromise[_0xaa80('0x1f')]()[_0xaa80('0x20')](ami[_0xaa80('0x10')]())[_0xaa80('0x20')](ami[_0xaa80('0x12')]())['then'](ami[_0xaa80('0x14')]())['then'](ami[_0xaa80('0x16')]())['then'](ami[_0xaa80('0x17')]())[_0xaa80('0x21')](function(_0x1c13b0){console[_0xaa80('0x22')](_0x1c13b0);});});ami['once'](_0xaa80('0xb'),error);ami['once'](_0xaa80('0x1b'),close);module['exports']=ami;
\ No newline at end of file
index 0edaf82..e7e4559 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8b1=['debug','rpc','error','message','result','catch','memberReport','bluebird','../../config/logger','ami','Request','request','then'];(function(_0x14d600,_0x597e96){var _0x16f46f=function(_0x57a7ee){while(--_0x57a7ee){_0x14d600['push'](_0x14d600['shift']());}};_0x16f46f(++_0x597e96);}(_0xc8b1,0x125));var _0x1c8b=function(_0x42277c,_0x549503){_0x42277c=_0x42277c-0x0;var _0x16302e=_0xc8b1[_0x42277c];return _0x16302e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1c8b('0x0'));var logger=require(_0x1c8b('0x1'))(_0x1c8b('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x1c8b('0x3')]=function(_0x1fcf10,_0x48163b){return new BPromise(function(_0x17be46,_0x3dc744){return client[_0x1c8b('0x4')](_0x1fcf10,_0x48163b)[_0x1c8b('0x5')](function(_0x3a7849){logger[_0x1c8b('0x6')](_0x1c8b('0x7'),'memberReport',_0x1fcf10,_0x48163b,_0x3a7849);if(_0x3a7849[_0x1c8b('0x8')]){logger[_0x1c8b('0x8')](_0x1c8b('0x7'),'memberReport',_0x1fcf10,_0x3a7849[_0x1c8b('0x8')][_0x1c8b('0x9')],_0x48163b);return _0x3dc744(_0x3a7849[_0x1c8b('0x8')][_0x1c8b('0x9')]);}else{return _0x17be46(_0x3a7849[_0x1c8b('0xa')]);}})[_0x1c8b('0xb')](function(_0x333b73){logger['error'](_0x1c8b('0x7'),_0x1c8b('0xc'),_0x1fcf10,_0x333b73,_0x48163b);return _0x3dc744(_0x333b73);});});};module['exports']=client;
\ No newline at end of file
+var _0xaa06=['ami','client','http','Request','request','then','rpc','error','memberReport','message','result','jayson/promise','bluebird'];(function(_0x2dbd54,_0x173004){var _0x4e0233=function(_0x50854e){while(--_0x50854e){_0x2dbd54['push'](_0x2dbd54['shift']());}};_0x4e0233(++_0x173004);}(_0xaa06,0xa7));var _0x6aa0=function(_0x49abe3,_0x469007){_0x49abe3=_0x49abe3-0x0;var _0x4fd200=_0xaa06[_0x49abe3];return _0x4fd200;};'use strict';var jayson=require(_0x6aa0('0x0'));var BPromise=require(_0x6aa0('0x1'));var logger=require('../../config/logger')(_0x6aa0('0x2'));var client=jayson[_0x6aa0('0x3')][_0x6aa0('0x4')]({'port':0x2329});client[_0x6aa0('0x5')]=function(_0x27a63a,_0x5aa9ad){return new BPromise(function(_0x422fc6,_0x4a1b25){return client[_0x6aa0('0x6')](_0x27a63a,_0x5aa9ad)[_0x6aa0('0x7')](function(_0x1f77ff){logger['debug'](_0x6aa0('0x8'),'memberReport',_0x27a63a,_0x5aa9ad,_0x1f77ff);if(_0x1f77ff[_0x6aa0('0x9')]){logger[_0x6aa0('0x9')](_0x6aa0('0x8'),_0x6aa0('0xa'),_0x27a63a,_0x1f77ff['error'][_0x6aa0('0xb')],_0x5aa9ad);return _0x4a1b25(_0x1f77ff[_0x6aa0('0x9')][_0x6aa0('0xb')]);}else{return _0x422fc6(_0x1f77ff[_0x6aa0('0xc')]);}})['catch'](function(_0x4977ad){logger[_0x6aa0('0x9')](_0x6aa0('0x8'),_0x6aa0('0xa'),_0x27a63a,_0x4977ad,_0x5aa9ad);return _0x4a1b25(_0x4977ad);});});};module['exports']=client;
\ No newline at end of file
index 57e4b5c..85e3703 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9091=['originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','prototype','getQueue','queue','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme'];(function(_0x753ca7,_0x49f14c){var _0x228836=function(_0x87803b){while(--_0x87803b){_0x753ca7['push'](_0x753ca7['shift']());}};_0x228836(++_0x49f14c);}(_0x9091,0x1ed));var _0x1909=function(_0x14ad70,_0x162335){_0x14ad70=_0x14ad70-0x0;var _0x570a04=_0x9091[_0x14ad70];return _0x570a04;};'use strict';var util=require(_0x1909('0x0'));var _=require('lodash');var moment=require(_0x1909('0x1'));function checkNameSurname(_0x5e82fd,_0xc9d95e,_0x530368){var _0xcf58d6='';if(!_[_0x1909('0x2')](_0xc9d95e)&&_0x1909('0x3')===typeof _0xc9d95e){_0xcf58d6+=_0xc9d95e;}if(!_['isNil'](_0x530368)&&'string'===typeof _0x530368){_0xcf58d6+='\x20'+_0x530368;}if(_0xcf58d6!==''){return _0xcf58d6;}return _0x5e82fd;}function Action(_0x4d2624,_0x15ae85,_0x53bf6b){this[_0x1909('0x4')]=_0x4d2624;this[_0x1909('0x5')]=_0x53bf6b||undefined;this[_0x1909('0x6')]=checkNameSurname(_0x15ae85[_0x1909('0x7')][_0x1909('0x8')],_0x15ae85[_0x1909('0x7')]['firstName'],_0x15ae85[_0x1909('0x7')]['lastName']);this['number']=_0x15ae85[_0x1909('0x7')][_0x1909('0x8')];this['queue']=_0x4d2624[_0x1909('0x6')];this[_0x1909('0x9')]=_0x15ae85['active']||![];this[_0x1909('0xa')]=_0x4d2624['type'];this[_0x1909('0xb')]=_0x4d2624[_0x1909('0xb')]||0x3;this['scheduledat']=_0x15ae85['scheduledat'];this[_0x1909('0xc')]=_0x15ae85[_0x1909('0xc')];this[_0x1909('0xd')]=_0x15ae85['countcongestionretry'];this[_0x1909('0xe')]=_0x15ae85[_0x1909('0xe')];this[_0x1909('0xf')]=_0x15ae85[_0x1909('0xf')];this[_0x1909('0x10')]=_0x15ae85['countdropretry'];this[_0x1909('0x11')]=_0x15ae85[_0x1909('0x11')];this[_0x1909('0x12')]=_0x15ae85[_0x1909('0x12')];this[_0x1909('0x13')]=_0x15ae85['countagentrejectretry'];this[_0x1909('0x14')]=_0x15ae85[_0x1909('0x14')];this['ListId']=_0x15ae85[_0x1909('0x15')];this['UserId']=_0x15ae85[_0x1909('0x16')];this[_0x1909('0x17')]=_0x15ae85[_0x1909('0x17')];this[_0x1909('0x18')]=_0x15ae85[_0x1909('0x18')];this[_0x1909('0x19')]=_0x15ae85['id'];this[_0x1909('0x1a')]=_0x15ae85[_0x1909('0x7')][_0x1909('0x1b')]||'';this[_0x1909('0x1c')]=moment()[_0x1909('0x1d')](_0x1909('0x1e'));this[_0x1909('0x1f')]=_0x15ae85[_0x1909('0x1f')];this['callbackuniqueid']=_0x15ae85[_0x1909('0x20')];this[_0x1909('0x21')]=_0x15ae85[_0x1909('0x21')];this[_0x1909('0x22')]=_0x15ae85[_0x1909('0x22')];this[_0x1909('0x23')]='';this[_0x1909('0x24')]='';}Action['prototype'][_0x1909('0x25')]=function(){return util[_0x1909('0x1d')](_0x1909('0x26'),this['name'],this['voiceQueue'][_0x1909('0x27')]>0x0?this[_0x1909('0x28')]['substring'](this['voiceQueue'][_0x1909('0x27')]):this[_0x1909('0x28')]);};Action[_0x1909('0x29')][_0x1909('0x2a')]=function(){return this[_0x1909('0x2b')];};module['exports']=Action;
\ No newline at end of file
+var _0xe773=['countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','queue','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x16ebd6,_0xc374c2){var _0x424208=function(_0x58befb){while(--_0x58befb){_0x16ebd6['push'](_0x16ebd6['shift']());}};_0x424208(++_0xc374c2);}(_0xe773,0x19a));var _0x3e77=function(_0x3c1f48,_0x16817b){_0x3c1f48=_0x3c1f48-0x0;var _0x27d379=_0xe773[_0x3c1f48];return _0x27d379;};'use strict';var util=require('util');var _=require(_0x3e77('0x0'));var moment=require(_0x3e77('0x1'));function checkNameSurname(_0x2f35f5,_0x532e5e,_0x22ad46){var _0x1fc5fb='';if(!_[_0x3e77('0x2')](_0x532e5e)&&_0x3e77('0x3')===typeof _0x532e5e){_0x1fc5fb+=_0x532e5e;}if(!_[_0x3e77('0x2')](_0x22ad46)&&'string'===typeof _0x22ad46){_0x1fc5fb+='\x20'+_0x22ad46;}if(_0x1fc5fb!==''){return _0x1fc5fb;}return _0x2f35f5;}function Action(_0x21828a,_0x33cc7c,_0x1fc36e){this[_0x3e77('0x4')]=_0x21828a;this[_0x3e77('0x5')]=_0x1fc36e||undefined;this[_0x3e77('0x6')]=checkNameSurname(_0x33cc7c[_0x3e77('0x7')][_0x3e77('0x8')],_0x33cc7c[_0x3e77('0x7')][_0x3e77('0x9')],_0x33cc7c[_0x3e77('0x7')]['lastName']);this['number']=_0x33cc7c[_0x3e77('0x7')][_0x3e77('0x8')];this[_0x3e77('0xa')]=_0x21828a[_0x3e77('0x6')];this[_0x3e77('0xb')]=_0x33cc7c['active']||![];this[_0x3e77('0xc')]=_0x21828a['type'];this['dialQueueTimeout']=_0x21828a[_0x3e77('0xd')]||0x3;this['scheduledat']=_0x33cc7c['scheduledat'];this[_0x3e77('0xe')]=_0x33cc7c[_0x3e77('0xe')];this[_0x3e77('0xf')]=_0x33cc7c['countcongestionretry'];this[_0x3e77('0x10')]=_0x33cc7c['countnoanswerretry'];this[_0x3e77('0x11')]=_0x33cc7c[_0x3e77('0x11')];this['countdropretry']=_0x33cc7c[_0x3e77('0x12')];this[_0x3e77('0x13')]=_0x33cc7c[_0x3e77('0x13')];this[_0x3e77('0x14')]=_0x33cc7c[_0x3e77('0x14')];this[_0x3e77('0x15')]=_0x33cc7c['countagentrejectretry'];this[_0x3e77('0x16')]=_0x33cc7c[_0x3e77('0x16')];this[_0x3e77('0x17')]=_0x33cc7c[_0x3e77('0x17')];this['UserId']=_0x33cc7c['UserId'];this[_0x3e77('0x18')]=_0x33cc7c['VoiceQueueId'];this[_0x3e77('0x19')]=_0x33cc7c[_0x3e77('0x19')];this[_0x3e77('0x1a')]=_0x33cc7c['id'];this[_0x3e77('0x1b')]=_0x33cc7c[_0x3e77('0x7')][_0x3e77('0x9')]||'';this['starttime']=moment()[_0x3e77('0x1c')](_0x3e77('0x1d'));this[_0x3e77('0x1e')]=_0x33cc7c[_0x3e77('0x1e')];this[_0x3e77('0x1f')]=_0x33cc7c[_0x3e77('0x1f')];this[_0x3e77('0x20')]=_0x33cc7c[_0x3e77('0x20')];this['recallme']=_0x33cc7c[_0x3e77('0x21')];this[_0x3e77('0x22')]='';this[_0x3e77('0x23')]='';}Action[_0x3e77('0x24')]['getCaller']=function(){return util[_0x3e77('0x1c')](_0x3e77('0x25'),this[_0x3e77('0x6')],this[_0x3e77('0x4')][_0x3e77('0x26')]>0x0?this[_0x3e77('0x27')][_0x3e77('0x28')](this[_0x3e77('0x4')][_0x3e77('0x26')]):this[_0x3e77('0x27')]);};Action[_0x3e77('0x24')][_0x3e77('0x29')]=function(){return this['queue'];};module[_0x3e77('0x2a')]=Action;
\ No newline at end of file
index 2d65f37..ae6e466 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e1e=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','diff','seconds','state','statedesc','Answer','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x4550a9,_0x31ac59){var _0x504ce6=function(_0x2691da){while(--_0x2691da){_0x4550a9['push'](_0x4550a9['shift']());}};_0x504ce6(++_0x31ac59);}(_0x3e1e,0x14a));var _0xe3e1=function(_0x5a6fb5,_0x284062){_0x5a6fb5=_0x5a6fb5-0x0;var _0x5275ce=_0x3e1e[_0x5a6fb5];return _0x5275ce;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x429b7f,_0x353ffb){var _0x357e68=moment(_0x429b7f)['milliseconds'](0x0);var _0x28582e=moment(_0x353ffb)['milliseconds'](0x0);return _0x357e68[_0xe3e1('0x0')](_0x28582e,_0xe3e1('0x1'));}function AgentComplete(_0x3f46dc,_0x4e8795){this[_0xe3e1('0x2')]=0x4;this[_0xe3e1('0x3')]=_0xe3e1('0x4');this['scheduledat']=_0x3f46dc['scheduledat'];this['type']=_0x3f46dc[_0xe3e1('0x5')];this[_0xe3e1('0x6')]=_0x3f46dc[_0xe3e1('0x5')]==='outbound'?_0xe3e1('0x7'):_0x3f46dc[_0xe3e1('0x5')];this[_0xe3e1('0x8')]=_0x3f46dc[_0xe3e1('0x8')];this['countcongestionretry']=_0x3f46dc[_0xe3e1('0x9')];this[_0xe3e1('0xa')]=_0x3f46dc[_0xe3e1('0xa')];this[_0xe3e1('0xb')]=_0x3f46dc[_0xe3e1('0x8')]+_0x3f46dc[_0xe3e1('0x9')]+_0x3f46dc[_0xe3e1('0xa')]+_0x3f46dc[_0xe3e1('0xc')]+_0x3f46dc[_0xe3e1('0xd')]+_0x3f46dc[_0xe3e1('0xe')]+_0x3f46dc[_0xe3e1('0xf')]+_0x3f46dc['countagentrejectretry'];this[_0xe3e1('0xc')]=_0x3f46dc[_0xe3e1('0xc')];this[_0xe3e1('0xd')]=_0x3f46dc[_0xe3e1('0xd')];this[_0xe3e1('0xe')]=_0x3f46dc[_0xe3e1('0xe')];this[_0xe3e1('0xf')]=_0x3f46dc[_0xe3e1('0xf')];this[_0xe3e1('0x10')]=_0x3f46dc[_0xe3e1('0x10')];this[_0xe3e1('0x11')]=_0x4e8795[_0xe3e1('0x11')];this[_0xe3e1('0x12')]=_0x3f46dc[_0xe3e1('0x13')];this[_0xe3e1('0x14')]=_0x3f46dc['number'];this[_0xe3e1('0x15')]=_0x3f46dc[_0xe3e1('0x15')];this[_0xe3e1('0x16')]=_0x3f46dc[_0xe3e1('0x16')];this['answertime']=_0x3f46dc[_0xe3e1('0x17')];this[_0xe3e1('0x18')]=moment()[_0xe3e1('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe3e1('0x1a')]=getSeconds(_0x3f46dc[_0xe3e1('0x16')],_0x3f46dc[_0xe3e1('0x15')]);this[_0xe3e1('0x1b')]=getSeconds(_0x3f46dc[_0xe3e1('0x17')],_0x3f46dc[_0xe3e1('0x16')]);this[_0xe3e1('0x1c')]=getSeconds(this[_0xe3e1('0x18')],_0x3f46dc[_0xe3e1('0x17')]);this[_0xe3e1('0x7')]=_0x4e8795[_0xe3e1('0x7')];this[_0xe3e1('0x1d')]=_0x4e8795[_0xe3e1('0x1d')];this[_0xe3e1('0x1e')]=_0x4e8795[_0xe3e1('0x1e')];this[_0xe3e1('0x1f')]=_0x3f46dc[_0xe3e1('0x1f')];this[_0xe3e1('0x20')]=_0x3f46dc[_0xe3e1('0x20')];this[_0xe3e1('0x21')]=_0x3f46dc[_0xe3e1('0x21')];this[_0xe3e1('0x22')]=_0x3f46dc[_0xe3e1('0x22')];this[_0xe3e1('0x23')]=_0x3f46dc[_0xe3e1('0x23')];this[_0xe3e1('0x24')]=_0x3f46dc[_0xe3e1('0x24')];this[_0xe3e1('0x25')]=_0x3f46dc[_0xe3e1('0x25')];this[_0xe3e1('0x26')]=_0x3f46dc['VoiceQueueId'];this[_0xe3e1('0x27')]=_0x3f46dc[_0xe3e1('0x27')];this[_0xe3e1('0x28')]=_0x3f46dc[_0xe3e1('0x28')]||'';this['originatecalleridname']=_0x3f46dc[_0xe3e1('0x29')]||'';}module[_0xe3e1('0x2a')]=AgentComplete;
\ No newline at end of file
+var _0x2ff6=['starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2ff6,0x96));var _0x62ff=function(_0x1895e2,_0x26731a){_0x1895e2=_0x1895e2-0x0;var _0x29ab2f=_0x2ff6[_0x1895e2];return _0x29ab2f;};'use strict';var util=require(_0x62ff('0x0'));var _=require(_0x62ff('0x1'));var moment=require('moment');function getSeconds(_0x4f9294,_0x3bd72e){var _0x53cef3=moment(_0x4f9294)[_0x62ff('0x2')](0x0);var _0x2e914b=moment(_0x3bd72e)['milliseconds'](0x0);return _0x53cef3[_0x62ff('0x3')](_0x2e914b,_0x62ff('0x4'));}function AgentComplete(_0x42a37f,_0xb46272){this[_0x62ff('0x5')]=0x4;this[_0x62ff('0x6')]='Answer';this[_0x62ff('0x7')]=_0x42a37f[_0x62ff('0x7')];this[_0x62ff('0x8')]=_0x42a37f['type'];this['campaigntype']=_0x42a37f[_0x62ff('0x8')]===_0x62ff('0x9')?_0x62ff('0xa'):_0x42a37f[_0x62ff('0x8')];this[_0x62ff('0xb')]=_0x42a37f[_0x62ff('0xb')];this[_0x62ff('0xc')]=_0x42a37f['countcongestionretry'];this['countnoanswerretry']=_0x42a37f[_0x62ff('0xd')];this['countglobal']=_0x42a37f['countbusyretry']+_0x42a37f[_0x62ff('0xc')]+_0x42a37f[_0x62ff('0xd')]+_0x42a37f[_0x62ff('0xe')]+_0x42a37f[_0x62ff('0xf')]+_0x42a37f[_0x62ff('0x10')]+_0x42a37f[_0x62ff('0x11')]+_0x42a37f[_0x62ff('0x12')];this[_0x62ff('0xe')]=_0x42a37f[_0x62ff('0xe')];this[_0x62ff('0xf')]=_0x42a37f[_0x62ff('0xf')];this['countabandonedretry']=_0x42a37f[_0x62ff('0x10')];this['countmachineretry']=_0x42a37f[_0x62ff('0x11')];this['countagentrejectretry']=_0x42a37f[_0x62ff('0x12')];this[_0x62ff('0x13')]=_0xb46272[_0x62ff('0x13')];this['calleridname']=_0x42a37f[_0x62ff('0x14')];this[_0x62ff('0x15')]=_0x42a37f['number'];this[_0x62ff('0x16')]=_0x42a37f[_0x62ff('0x16')];this[_0x62ff('0x17')]=_0x42a37f[_0x62ff('0x17')];this[_0x62ff('0x18')]=_0x42a37f['answertime'];this[_0x62ff('0x19')]=moment()[_0x62ff('0x1a')](_0x62ff('0x1b'));this[_0x62ff('0x1c')]=getSeconds(_0x42a37f[_0x62ff('0x17')],_0x42a37f[_0x62ff('0x16')]);this[_0x62ff('0x1d')]=getSeconds(_0x42a37f[_0x62ff('0x18')],_0x42a37f[_0x62ff('0x17')]);this['talktime']=getSeconds(this['endtime'],_0x42a37f['answertime']);this['queue']=_0xb46272['queue'];this[_0x62ff('0x1e')]=_0xb46272[_0x62ff('0x1e')];this['reason']=_0xb46272[_0x62ff('0x1f')];this[_0x62ff('0x20')]=_0x42a37f['callback'];this[_0x62ff('0x21')]=_0x42a37f[_0x62ff('0x21')];this[_0x62ff('0x22')]=_0x42a37f['callbackat'];this[_0x62ff('0x23')]=_0x42a37f[_0x62ff('0x23')];this['ContactId']=_0x42a37f['ContactId'];this[_0x62ff('0x24')]=_0x42a37f[_0x62ff('0x24')];this[_0x62ff('0x25')]=_0x42a37f[_0x62ff('0x25')];this[_0x62ff('0x26')]=_0x42a37f[_0x62ff('0x26')];this[_0x62ff('0x27')]=_0x42a37f[_0x62ff('0x27')];this[_0x62ff('0x28')]=_0x42a37f[_0x62ff('0x28')]||'';this['originatecalleridname']=_0x42a37f[_0x62ff('0x29')]||'';}module[_0x62ff('0x2a')]=AgentComplete;
\ No newline at end of file
index 5944979..e9e5124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb805=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x141ea1,_0x285f90){var _0x63d53a=function(_0x18dc57){while(--_0x18dc57){_0x141ea1['push'](_0x141ea1['shift']());}};_0x63d53a(++_0x285f90);}(_0xb805,0xea));var _0x5b80=function(_0x5d5ddf,_0x40592d){_0x5d5ddf=_0x5d5ddf-0x0;var _0x5a34c6=_0xb805[_0x5d5ddf];return _0x5a34c6;};'use strict';var util=require(_0x5b80('0x0'));var _=require(_0x5b80('0x1'));var moment=require(_0x5b80('0x2'));function getSeconds(_0x2a748e,_0x53856d){var _0x1021b7=moment(_0x2a748e)[_0x5b80('0x3')](0x0);var _0x3c7cbe=moment(_0x53856d)[_0x5b80('0x3')](0x0);return _0x1021b7[_0x5b80('0x4')](_0x3c7cbe,'seconds');}function Final(_0x406fd4){this['uniqueid']=_0x406fd4['uniqueid'];this[_0x5b80('0x5')]=_0x406fd4[_0x5b80('0x5')];this[_0x5b80('0x6')]=_0x406fd4[_0x5b80('0x6')];this['campaigntype']=_0x406fd4['type']===_0x5b80('0x7')?_0x5b80('0x8'):_0x406fd4['type'];this[_0x5b80('0x9')]=_0x406fd4['countbusyretry'];this['countcongestionretry']=_0x406fd4[_0x5b80('0xa')];this[_0x5b80('0xb')]=_0x406fd4[_0x5b80('0xb')];this[_0x5b80('0xc')]=_0x406fd4[_0x5b80('0x9')]+_0x406fd4['countcongestionretry']+_0x406fd4['countnoanswerretry']+_0x406fd4[_0x5b80('0xd')]+_0x406fd4[_0x5b80('0xe')]+_0x406fd4[_0x5b80('0xf')]+_0x406fd4[_0x5b80('0x10')]+_0x406fd4[_0x5b80('0x11')];this[_0x5b80('0xd')]=_0x406fd4[_0x5b80('0xd')];this[_0x5b80('0xe')]=_0x406fd4[_0x5b80('0xe')];this[_0x5b80('0xf')]=_0x406fd4[_0x5b80('0xf')];this[_0x5b80('0x10')]=_0x406fd4[_0x5b80('0x10')];this['countagentrejectretry']=_0x406fd4['countagentrejectretry'];this[_0x5b80('0x8')]=_0x406fd4['queue'];this[_0x5b80('0x12')]=_0x406fd4[_0x5b80('0x12')];this[_0x5b80('0x13')]=_0x406fd4[_0x5b80('0x13')];this['starttime']=_0x406fd4[_0x5b80('0x14')];this[_0x5b80('0x15')]=_0x406fd4[_0x5b80('0x15')];this[_0x5b80('0x16')]=_0x406fd4[_0x5b80('0x15')];this[_0x5b80('0x17')]=_0x406fd4[_0x5b80('0x17')]||0x0;this[_0x5b80('0x18')]=_0x406fd4[_0x5b80('0x18')]||0x0;this[_0x5b80('0x19')]=_0x406fd4[_0x5b80('0x19')]||0x0;this[_0x5b80('0x1a')]=_0x406fd4[_0x5b80('0x1a')];this[_0x5b80('0x1b')]=_0x406fd4[_0x5b80('0x1b')];this[_0x5b80('0x1c')]=_0x406fd4['callbackat'];this['recallme']=_0x406fd4[_0x5b80('0x1d')];this[_0x5b80('0x1e')]=_0x406fd4['ContactId'];this[_0x5b80('0x1f')]=_0x406fd4[_0x5b80('0x1f')];this[_0x5b80('0x20')]=_0x406fd4['UserId'];this[_0x5b80('0x21')]=_0x406fd4[_0x5b80('0x21')];this[_0x5b80('0x22')]=_0x406fd4[_0x5b80('0x22')];this[_0x5b80('0x23')]=_0x406fd4[_0x5b80('0x23')]||'';this['originatecalleridname']=_0x406fd4[_0x5b80('0x24')]||'';}module[_0x5b80('0x25')]=Final;
\ No newline at end of file
+var _0x08cb=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x3e65c7,_0x10f83e){var _0x4085ec=function(_0x18938d){while(--_0x18938d){_0x3e65c7['push'](_0x3e65c7['shift']());}};_0x4085ec(++_0x10f83e);}(_0x08cb,0xf2));var _0xb08c=function(_0x2f3b2b,_0x23bfb8){_0x2f3b2b=_0x2f3b2b-0x0;var _0x59c2b9=_0x08cb[_0x2f3b2b];return _0x59c2b9;};'use strict';var util=require(_0xb08c('0x0'));var _=require('lodash');var moment=require(_0xb08c('0x1'));function getSeconds(_0x14f159,_0x458a63){var _0x46aa15=moment(_0x14f159)[_0xb08c('0x2')](0x0);var _0x181b99=moment(_0x458a63)[_0xb08c('0x2')](0x0);return _0x46aa15['diff'](_0x181b99,_0xb08c('0x3'));}function Final(_0x130f25){this['uniqueid']=_0x130f25[_0xb08c('0x4')];this[_0xb08c('0x5')]=_0x130f25[_0xb08c('0x5')];this[_0xb08c('0x6')]=_0x130f25[_0xb08c('0x6')];this[_0xb08c('0x7')]=_0x130f25[_0xb08c('0x6')]===_0xb08c('0x8')?_0xb08c('0x9'):_0x130f25[_0xb08c('0x6')];this[_0xb08c('0xa')]=_0x130f25[_0xb08c('0xa')];this['countcongestionretry']=_0x130f25[_0xb08c('0xb')];this[_0xb08c('0xc')]=_0x130f25[_0xb08c('0xc')];this[_0xb08c('0xd')]=_0x130f25[_0xb08c('0xa')]+_0x130f25[_0xb08c('0xb')]+_0x130f25[_0xb08c('0xc')]+_0x130f25[_0xb08c('0xe')]+_0x130f25[_0xb08c('0xf')]+_0x130f25[_0xb08c('0x10')]+_0x130f25[_0xb08c('0x11')]+_0x130f25[_0xb08c('0x12')];this['countnosuchnumberretry']=_0x130f25[_0xb08c('0xe')];this[_0xb08c('0xf')]=_0x130f25[_0xb08c('0xf')];this[_0xb08c('0x10')]=_0x130f25[_0xb08c('0x10')];this[_0xb08c('0x11')]=_0x130f25[_0xb08c('0x11')];this[_0xb08c('0x12')]=_0x130f25[_0xb08c('0x12')];this[_0xb08c('0x9')]=_0x130f25[_0xb08c('0x9')];this[_0xb08c('0x13')]=_0x130f25[_0xb08c('0x13')];this[_0xb08c('0x14')]=_0x130f25[_0xb08c('0x14')];this['starttime']=_0x130f25[_0xb08c('0x15')];this[_0xb08c('0x16')]=_0x130f25[_0xb08c('0x16')];this[_0xb08c('0x17')]=_0x130f25['responsetime'];this['ringtime']=_0x130f25[_0xb08c('0x18')]||0x0;this[_0xb08c('0x19')]=_0x130f25[_0xb08c('0x19')]||0x0;this[_0xb08c('0x1a')]=_0x130f25['talktime']||0x0;this['callback']=_0x130f25[_0xb08c('0x1b')];this['callbackuniqueid']=_0x130f25[_0xb08c('0x1c')];this['callbackat']=_0x130f25[_0xb08c('0x1d')];this[_0xb08c('0x1e')]=_0x130f25['recallme'];this[_0xb08c('0x1f')]=_0x130f25['ContactId'];this['ListId']=_0x130f25[_0xb08c('0x20')];this['UserId']=_0x130f25[_0xb08c('0x21')];this['VoiceQueueId']=_0x130f25[_0xb08c('0x22')];this[_0xb08c('0x23')]=_0x130f25['CampaignId'];this[_0xb08c('0x24')]=_0x130f25['originatecalleridnum']||'';this[_0xb08c('0x25')]=_0x130f25[_0xb08c('0x25')]||'';}module[_0xb08c('0x26')]=Final;
\ No newline at end of file
index 3d6ba0b..c8e6694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x496e=['endtime','format','ringtime','talktime','membername','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','name','number','starttime','responsetime'];(function(_0x45bccd,_0x130e52){var _0x561467=function(_0xb653dc){while(--_0xb653dc){_0x45bccd['push'](_0x45bccd['shift']());}};_0x561467(++_0x130e52);}(_0x496e,0x1e9));var _0xe496=function(_0x10a152,_0x16e1a2){_0x10a152=_0x10a152-0x0;var _0x6b5800=_0x496e[_0x10a152];return _0x6b5800;};'use strict';var util=require(_0xe496('0x0'));var _=require('lodash');var moment=require(_0xe496('0x1'));function getSeconds(_0x2cafa9,_0x25ac07){var _0x4e266a=moment(_0x2cafa9)[_0xe496('0x2')](0x0);var _0x359a32=moment(_0x25ac07)['milliseconds'](0x0);return _0x4e266a[_0xe496('0x3')](_0x359a32,_0xe496('0x4'));}function Hangup(_0x1c3e37,_0x14ccb4){this[_0xe496('0x5')]=0x4;this[_0xe496('0x6')]='Answer';this[_0xe496('0x7')]=_0x1c3e37[_0xe496('0x7')];this[_0xe496('0x8')]=_0x1c3e37[_0xe496('0x8')];this[_0xe496('0x9')]=_0x1c3e37[_0xe496('0x8')]===_0xe496('0xa')?_0xe496('0xb'):_0x1c3e37[_0xe496('0x8')];this[_0xe496('0xc')]=_0x1c3e37['countbusyretry'];this[_0xe496('0xd')]=_0x1c3e37[_0xe496('0xd')];this['countnoanswerretry']=_0x1c3e37[_0xe496('0xe')];this[_0xe496('0xf')]=_0x1c3e37[_0xe496('0xc')]+_0x1c3e37['countcongestionretry']+_0x1c3e37[_0xe496('0xe')]+_0x1c3e37['countnosuchnumberretry']+_0x1c3e37['countdropretry']+_0x1c3e37[_0xe496('0x10')]+_0x1c3e37[_0xe496('0x11')]+_0x1c3e37[_0xe496('0x12')];this[_0xe496('0x13')]=_0x1c3e37[_0xe496('0x13')];this[_0xe496('0x14')]=_0x1c3e37[_0xe496('0x14')];this[_0xe496('0x10')]=_0x1c3e37['countabandonedretry'];this['countmachineretry']=_0x1c3e37[_0xe496('0x11')];this['countagentrejectretry']=_0x1c3e37['countagentrejectretry'];this[_0xe496('0x15')]=_0x14ccb4['uniqueid'];this[_0xe496('0x16')]=_0x1c3e37[_0xe496('0x17')];this['calleridnum']=_0x1c3e37[_0xe496('0x18')];this[_0xe496('0x19')]=_0x1c3e37[_0xe496('0x19')];this[_0xe496('0x1a')]=_0x1c3e37[_0xe496('0x1a')];this[_0xe496('0x1b')]=moment()[_0xe496('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe496('0x1d')]=getSeconds(_0x1c3e37['responsetime'],_0x1c3e37[_0xe496('0x19')]);this['holdtime']=0x0;this[_0xe496('0x1e')]=getSeconds(this[_0xe496('0x1b')],_0x1c3e37[_0xe496('0x1a')]);this['queue']=_0x1c3e37['queue'];this[_0xe496('0x1f')]='IVR';this[_0xe496('0x20')]=_0x14ccb4[_0xe496('0x21')];this['callback']=_0x1c3e37['callback'];this['callbackuniqueid']=_0x1c3e37[_0xe496('0x22')];this['callbackat']=_0x1c3e37[_0xe496('0x23')];this['recallme']=_0x1c3e37[_0xe496('0x24')];this[_0xe496('0x25')]=_0x1c3e37[_0xe496('0x25')];this[_0xe496('0x26')]=_0x1c3e37[_0xe496('0x26')];this[_0xe496('0x27')]=_0x1c3e37[_0xe496('0x27')];this[_0xe496('0x28')]=_0x1c3e37['VoiceQueueId'];this[_0xe496('0x29')]=_0x1c3e37[_0xe496('0x29')];}module[_0xe496('0x2a')]=Hangup;
\ No newline at end of file
+var _0x6d6a=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','lodash','moment','milliseconds','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry'];(function(_0x458945,_0x34e95d){var _0x1ae546=function(_0x5dbd47){while(--_0x5dbd47){_0x458945['push'](_0x458945['shift']());}};_0x1ae546(++_0x34e95d);}(_0x6d6a,0x1a4));var _0xa6d6=function(_0x4fa489,_0x4cba6b){_0x4fa489=_0x4fa489-0x0;var _0x41d2ce=_0x6d6a[_0x4fa489];return _0x41d2ce;};'use strict';var util=require('util');var _=require(_0xa6d6('0x0'));var moment=require(_0xa6d6('0x1'));function getSeconds(_0x1af644,_0x2c3b91){var _0xb11cac=moment(_0x1af644)[_0xa6d6('0x2')](0x0);var _0x326630=moment(_0x2c3b91)['milliseconds'](0x0);return _0xb11cac['diff'](_0x326630,_0xa6d6('0x3'));}function Hangup(_0x3f6935,_0x58df16){this['state']=0x4;this[_0xa6d6('0x4')]=_0xa6d6('0x5');this[_0xa6d6('0x6')]=_0x3f6935[_0xa6d6('0x6')];this[_0xa6d6('0x7')]=_0x3f6935[_0xa6d6('0x7')];this[_0xa6d6('0x8')]=_0x3f6935[_0xa6d6('0x7')]===_0xa6d6('0x9')?_0xa6d6('0xa'):_0x3f6935['type'];this[_0xa6d6('0xb')]=_0x3f6935[_0xa6d6('0xb')];this[_0xa6d6('0xc')]=_0x3f6935[_0xa6d6('0xc')];this[_0xa6d6('0xd')]=_0x3f6935[_0xa6d6('0xd')];this[_0xa6d6('0xe')]=_0x3f6935['countbusyretry']+_0x3f6935['countcongestionretry']+_0x3f6935[_0xa6d6('0xd')]+_0x3f6935['countnosuchnumberretry']+_0x3f6935[_0xa6d6('0xf')]+_0x3f6935[_0xa6d6('0x10')]+_0x3f6935[_0xa6d6('0x11')]+_0x3f6935[_0xa6d6('0x12')];this[_0xa6d6('0x13')]=_0x3f6935['countnosuchnumberretry'];this[_0xa6d6('0xf')]=_0x3f6935[_0xa6d6('0xf')];this[_0xa6d6('0x10')]=_0x3f6935[_0xa6d6('0x10')];this[_0xa6d6('0x11')]=_0x3f6935['countmachineretry'];this[_0xa6d6('0x12')]=_0x3f6935[_0xa6d6('0x12')];this[_0xa6d6('0x14')]=_0x58df16[_0xa6d6('0x14')];this[_0xa6d6('0x15')]=_0x3f6935[_0xa6d6('0x16')];this[_0xa6d6('0x17')]=_0x3f6935[_0xa6d6('0x18')];this[_0xa6d6('0x19')]=_0x3f6935[_0xa6d6('0x19')];this[_0xa6d6('0x1a')]=_0x3f6935[_0xa6d6('0x1a')];this[_0xa6d6('0x1b')]=moment()[_0xa6d6('0x1c')](_0xa6d6('0x1d'));this[_0xa6d6('0x1e')]=getSeconds(_0x3f6935[_0xa6d6('0x1a')],_0x3f6935[_0xa6d6('0x19')]);this[_0xa6d6('0x1f')]=0x0;this[_0xa6d6('0x20')]=getSeconds(this[_0xa6d6('0x1b')],_0x3f6935[_0xa6d6('0x1a')]);this[_0xa6d6('0xa')]=_0x3f6935[_0xa6d6('0xa')];this[_0xa6d6('0x21')]=_0xa6d6('0x22');this[_0xa6d6('0x23')]=_0x58df16['cause-txt'];this[_0xa6d6('0x24')]=_0x3f6935['callback'];this['callbackuniqueid']=_0x3f6935[_0xa6d6('0x25')];this[_0xa6d6('0x26')]=_0x3f6935[_0xa6d6('0x26')];this[_0xa6d6('0x27')]=_0x3f6935[_0xa6d6('0x27')];this['ContactId']=_0x3f6935[_0xa6d6('0x28')];this[_0xa6d6('0x29')]=_0x3f6935[_0xa6d6('0x29')];this[_0xa6d6('0x2a')]=_0x3f6935[_0xa6d6('0x2a')];this['VoiceQueueId']=_0x3f6935['VoiceQueueId'];this[_0xa6d6('0x2b')]=_0x3f6935[_0xa6d6('0x2b')];}module['exports']=Hangup;
\ No newline at end of file
index cbc444d..ac85f73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d04=['type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat'];(function(_0x16f475,_0x22b4b4){var _0x53372e=function(_0x507a7d){while(--_0x507a7d){_0x16f475['push'](_0x16f475['shift']());}};_0x53372e(++_0x22b4b4);}(_0x6d04,0x11f));var _0x46d0=function(_0x275676,_0x3377a6){_0x275676=_0x275676-0x0;var _0x5550b=_0x6d04[_0x275676];return _0x5550b;};'use strict';var util=require('util');var _=require(_0x46d0('0x0'));var moment=require(_0x46d0('0x1'));function getSeconds(_0x1a8197,_0x4f0ffb){var _0x4a3ba9=moment(_0x1a8197)[_0x46d0('0x2')](0x0);var _0x2b1d14=moment(_0x4f0ffb)[_0x46d0('0x2')](0x0);return _0x4a3ba9[_0x46d0('0x3')](_0x2b1d14,_0x46d0('0x4'));}function History(_0x15a8ec){this['uniqueid']=_0x15a8ec[_0x46d0('0x5')];this[_0x46d0('0x6')]=_0x15a8ec[_0x46d0('0x6')]||undefined;this['type']=_0x15a8ec[_0x46d0('0x7')];this[_0x46d0('0x8')]=_0x15a8ec[_0x46d0('0x7')]===_0x46d0('0x9')?'queue':_0x15a8ec[_0x46d0('0x7')];this[_0x46d0('0xa')]=_0x15a8ec['countbusyretry'];this[_0x46d0('0xb')]=_0x15a8ec['countcongestionretry'];this[_0x46d0('0xc')]=_0x15a8ec[_0x46d0('0xc')];this[_0x46d0('0xd')]=_0x15a8ec[_0x46d0('0xa')]+_0x15a8ec['countcongestionretry']+_0x15a8ec[_0x46d0('0xc')]+_0x15a8ec[_0x46d0('0xe')]+_0x15a8ec[_0x46d0('0xf')]+_0x15a8ec[_0x46d0('0x10')]+_0x15a8ec[_0x46d0('0x11')]+_0x15a8ec[_0x46d0('0x12')];this['countnosuchnumberretry']=_0x15a8ec[_0x46d0('0xe')];this['countdropretry']=_0x15a8ec[_0x46d0('0xf')];this[_0x46d0('0x10')]=_0x15a8ec['countabandonedretry'];this['countmachineretry']=_0x15a8ec['countmachineretry'];this[_0x46d0('0x12')]=_0x15a8ec[_0x46d0('0x12')];this[_0x46d0('0x13')]=_0x15a8ec[_0x46d0('0x13')];this[_0x46d0('0x14')]=_0x15a8ec[_0x46d0('0x15')];this[_0x46d0('0x16')]=_0x15a8ec[_0x46d0('0x17')];this[_0x46d0('0x18')]=_0x15a8ec[_0x46d0('0x18')];this[_0x46d0('0x19')]=_0x15a8ec[_0x46d0('0x19')];this[_0x46d0('0x1a')]=_0x15a8ec['responsetime'];this[_0x46d0('0x1b')]=getSeconds(_0x15a8ec[_0x46d0('0x19')],_0x15a8ec[_0x46d0('0x18')]);this[_0x46d0('0x1c')]=0x0;this[_0x46d0('0x1d')]=0x0;this[_0x46d0('0x1e')]=_0x15a8ec[_0x46d0('0x1e')];this[_0x46d0('0x1f')]=_0x15a8ec[_0x46d0('0x1f')];this[_0x46d0('0x20')]=_0x15a8ec[_0x46d0('0x20')];this[_0x46d0('0x21')]=_0x15a8ec[_0x46d0('0x21')];this[_0x46d0('0x22')]=_0x15a8ec[_0x46d0('0x22')];this[_0x46d0('0x23')]=_0x15a8ec[_0x46d0('0x23')];this['UserId']=_0x15a8ec[_0x46d0('0x24')];this[_0x46d0('0x25')]=_0x15a8ec[_0x46d0('0x25')];this[_0x46d0('0x26')]=_0x15a8ec['CampaignId'];this[_0x46d0('0x27')]=_0x15a8ec['originatecalleridnum']||'';this['originatecalleridname']=_0x15a8ec[_0x46d0('0x28')]||'';}module[_0x46d0('0x29')]=History;
\ No newline at end of file
+var _0x96c8=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5ab5e3,_0x3862ba){var _0x4200e4=function(_0x41eb38){while(--_0x41eb38){_0x5ab5e3['push'](_0x5ab5e3['shift']());}};_0x4200e4(++_0x3862ba);}(_0x96c8,0xa3));var _0x896c=function(_0x2f3808,_0x584dc8){_0x2f3808=_0x2f3808-0x0;var _0x48c811=_0x96c8[_0x2f3808];return _0x48c811;};'use strict';var util=require('util');var _=require(_0x896c('0x0'));var moment=require(_0x896c('0x1'));function getSeconds(_0x53809d,_0x2d7278){var _0x317cea=moment(_0x53809d)['milliseconds'](0x0);var _0x5e3506=moment(_0x2d7278)[_0x896c('0x2')](0x0);return _0x317cea[_0x896c('0x3')](_0x5e3506,_0x896c('0x4'));}function History(_0x28ad5c){this['uniqueid']=_0x28ad5c[_0x896c('0x5')];this[_0x896c('0x6')]=_0x28ad5c[_0x896c('0x6')]||undefined;this[_0x896c('0x7')]=_0x28ad5c[_0x896c('0x7')];this[_0x896c('0x8')]=_0x28ad5c['type']===_0x896c('0x9')?_0x896c('0xa'):_0x28ad5c[_0x896c('0x7')];this[_0x896c('0xb')]=_0x28ad5c[_0x896c('0xb')];this[_0x896c('0xc')]=_0x28ad5c[_0x896c('0xc')];this['countnoanswerretry']=_0x28ad5c[_0x896c('0xd')];this[_0x896c('0xe')]=_0x28ad5c[_0x896c('0xb')]+_0x28ad5c[_0x896c('0xc')]+_0x28ad5c['countnoanswerretry']+_0x28ad5c[_0x896c('0xf')]+_0x28ad5c[_0x896c('0x10')]+_0x28ad5c['countabandonedretry']+_0x28ad5c['countmachineretry']+_0x28ad5c[_0x896c('0x11')];this[_0x896c('0xf')]=_0x28ad5c[_0x896c('0xf')];this['countdropretry']=_0x28ad5c['countdropretry'];this[_0x896c('0x12')]=_0x28ad5c[_0x896c('0x12')];this['countmachineretry']=_0x28ad5c[_0x896c('0x13')];this[_0x896c('0x11')]=_0x28ad5c['countagentrejectretry'];this[_0x896c('0xa')]=_0x28ad5c[_0x896c('0xa')];this[_0x896c('0x14')]=_0x28ad5c[_0x896c('0x15')];this['calleridnum']=_0x28ad5c[_0x896c('0x16')];this[_0x896c('0x17')]=_0x28ad5c[_0x896c('0x17')];this[_0x896c('0x18')]=_0x28ad5c['responsetime'];this[_0x896c('0x19')]=_0x28ad5c[_0x896c('0x18')];this[_0x896c('0x1a')]=getSeconds(_0x28ad5c[_0x896c('0x18')],_0x28ad5c[_0x896c('0x17')]);this[_0x896c('0x1b')]=0x0;this['talktime']=0x0;this['callback']=_0x28ad5c[_0x896c('0x1c')];this[_0x896c('0x1d')]=_0x28ad5c['callbackuniqueid'];this[_0x896c('0x1e')]=_0x28ad5c[_0x896c('0x1e')];this[_0x896c('0x1f')]=_0x28ad5c['recallme'];this[_0x896c('0x20')]=_0x28ad5c[_0x896c('0x20')];this['ListId']=_0x28ad5c[_0x896c('0x21')];this[_0x896c('0x22')]=_0x28ad5c['UserId'];this[_0x896c('0x23')]=_0x28ad5c[_0x896c('0x23')];this[_0x896c('0x24')]=_0x28ad5c[_0x896c('0x24')];this[_0x896c('0x25')]=_0x28ad5c[_0x896c('0x25')]||'';this[_0x896c('0x26')]=_0x28ad5c[_0x896c('0x26')]||'';}module['exports']=History;
\ No newline at end of file
index 44cd56c..02f219c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3eb=['CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','actions','syncQueueMember','actionid','locked','paused','stateinterface','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','pick','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','dialMethod','handlePower','power','booked','Queue','method\x20not\x20recognized','launchHandleIvr','loggedIn','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','log','EMITTING\x20status_nosuchnumber\x20for','nosuchnumber','custom:status_nosuchnumber','buildObj','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:status_noanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','custom:status_busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','outboundQueuePauses','[CatchErlangB]','check\x20failure','[handlePredictive]','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','emptyContact','[actionOriginate]\x20','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','reachable','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\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]','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:save','info','Total\x20Calls:\x20\x20\x20\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','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','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','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','resolve','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','then','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','ContactId','ListId','UserId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','AMD','saveInDb','[syncHangupInAMD]','uniqueid','Machine','membername','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','reason19\x20machine....','createStateFinal','VoiceQueueId','syncHangup','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','[syncHangupIvr][createHistory]','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason'];(function(_0x5d219d,_0x5d51bf){var _0x552ff8=function(_0x265aa3){while(--_0x265aa3){_0x5d219d['push'](_0x5d219d['shift']());}};_0x552ff8(++_0x5d51bf);}(_0xf3eb,0x102));var _0xbf3e=function(_0x1c43ea,_0x2dab83){_0x1c43ea=_0x1c43ea-0x0;var _0x54390e=_0xf3eb[_0x1c43ea];return _0x54390e;};'use strict';var util=require(_0xbf3e('0x0'));var _=require(_0xbf3e('0x1'));var BPromise=require('bluebird');var uuid=require(_0xbf3e('0x2'));var moment=require(_0xbf3e('0x3'));var rr=require('rr');var md5=require(_0xbf3e('0x4'));var Redis=require(_0xbf3e('0x5'));var config=require(_0xbf3e('0x6'));var logger=require(_0xbf3e('0x7'))(_0xbf3e('0x8'));var loggerBooked=require(_0xbf3e('0x7'))('booked');var loggerPredictive=require(_0xbf3e('0x7'))(_0xbf3e('0x9'));var loggerPredictiveCalls=require(_0xbf3e('0x7'))(_0xbf3e('0xa'));var loggerSyncQueueSummary=require(_0xbf3e('0x7'))(_0xbf3e('0xb'));var ami=require('../ami');config[_0xbf3e('0xc')]=_[_0xbf3e('0xd')](config[_0xbf3e('0xc')],{'host':_0xbf3e('0xe'),'port':0x18eb});var io=require(_0xbf3e('0xf'))(new Redis(config[_0xbf3e('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xbf3e('0x10'));var cmHopperHistory=require(_0xbf3e('0x11'));var cmHopperBlack=require(_0xbf3e('0x12'));var voiceQueueRt=require(_0xbf3e('0x13'));var Action=require(_0xbf3e('0x14'));var History=require(_0xbf3e('0x15'));var Final=require('./final');var AgentComplete=require(_0xbf3e('0x16'));var QueueCallerAbandon=require(_0xbf3e('0x17'));var Hangup=require(_0xbf3e('0x18'));var ipAgi=process[_0xbf3e('0x19')]['XCALLY_IP_AGI']||_0xbf3e('0x1a');var strategy={'rrmemory':_0xbf3e('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xbf3e('0x1c')][_0xbf3e('0x1d')]=function(_0x368380){this[_0xbf3e('0x1e')]=this[_0xbf3e('0x1e')]?this[_0xbf3e('0x1e')][_0xbf3e('0x1f')](_0x368380):_0x368380();};function Dialer(_0x189d95,_0x5283ec){this[_0xbf3e('0x20')]=new Sequence();this[_0xbf3e('0x21')]=_0x5283ec;this[_0xbf3e('0x22')]=_0x189d95['voiceQueues'];this[_0xbf3e('0x23')]=_0x189d95[_0xbf3e('0x23')];this[_0xbf3e('0x24')]=_0x189d95[_0xbf3e('0x24')];this[_0xbf3e('0x25')]=_0x189d95[_0xbf3e('0x25')];this['maxNumberOriginate']=config[_0xbf3e('0x26')]||0x2;this[_0xbf3e('0x27')]={};this['actions']={};this[_0xbf3e('0x28')]={};this[_0xbf3e('0x29')]={};this[_0xbf3e('0x2a')]={};this[_0xbf3e('0x2b')]={};this[_0xbf3e('0x2c')]={};this[_0xbf3e('0x2d')]={};this[_0xbf3e('0x2e')]={};this[_0xbf3e('0x2f')]={};ami['on'](_0xbf3e('0x30'),this[_0xbf3e('0x31')][_0xbf3e('0x32')](this));ami['on'](_0xbf3e('0x33'),this[_0xbf3e('0x34')]['bind'](this));ami['on'](_0xbf3e('0x35'),this[_0xbf3e('0x36')][_0xbf3e('0x32')](this));ami['on'](_0xbf3e('0x37'),this[_0xbf3e('0x38')][_0xbf3e('0x32')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0xbf3e('0x32')](this));ami['on'](_0xbf3e('0x39'),this['syncHangup'][_0xbf3e('0x32')](this));ami['on'](_0xbf3e('0x3a'),this[_0xbf3e('0x3b')][_0xbf3e('0x32')](this));ami['on'](_0xbf3e('0x3c'),this[_0xbf3e('0x3d')][_0xbf3e('0x32')](this));ami['on']('queuemember',this['syncQueueMember'][_0xbf3e('0x32')](this));ami['on'](_0xbf3e('0x3e'),this[_0xbf3e('0x3f')]['bind'](this));this[_0xbf3e('0x40')]();this[_0xbf3e('0x41')]();}function isNotNull(_0x5663c0){return _0x5663c0!==null&&!_[_0xbf3e('0x42')](_0x5663c0);}function checkIsLoggedIn(_0x168048,_0x4c59bc){return function(){if(_0x4c59bc<=0x0){_0x168048['message']=_0xbf3e('0x43');throw _0x168048[_0xbf3e('0x44')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x27a3d3){return _0x27a3d3;}function checkIsActive(_0x15a7bc,_0x316d20){return function(){if(!isActive(_0x316d20)){_0x15a7bc['message']=_0xbf3e('0x45');throw _0x15a7bc[_0xbf3e('0x44')]+_0xbf3e('0x46');}};}function checkInterval(_0x332c88){return function(){if(!isNotNull(_0x332c88['Interval'])){_0x332c88[_0xbf3e('0x47')]=_0xbf3e('0x48');throw _0x332c88[_0xbf3e('0x44')]+_0xbf3e('0x49');}if(!isNotNull(_0x332c88[_0xbf3e('0x4a')][_0xbf3e('0x4b')])){_0x332c88['message']=_0xbf3e('0x48');throw _0x332c88[_0xbf3e('0x44')]+_0xbf3e('0x49');}if(!isNotNull(_[_0xbf3e('0x4c')](_0x332c88[_0xbf3e('0x4a')]['Intervals']))){_0x332c88[_0xbf3e('0x47')]=_0xbf3e('0x48');throw _0x332c88[_0xbf3e('0x44')]+_0xbf3e('0x49');}};}function msgResponse(_0x44e3ad,_0xce44aa,_0x3788de){return{'action':_0x44e3ad,'response':_0xce44aa,'message':_0x3788de,'stack':_0x3788de};}function myreject(_0x5e81ce){return function(_0x477ac5){return _0x5e81ce(msgResponse(_0xbf3e('0x4d'),_0xbf3e('0x4e'),JSON[_0xbf3e('0x4f')](_0x477ac5)));};}function getSeconds(_0xe0d9a0,_0xaacd1e){var _0x179500=moment(_0xe0d9a0)[_0xbf3e('0x50')](0x0);var _0x2f53d8=moment(_0xaacd1e)[_0xbf3e('0x50')](0x0);return _0x179500[_0xbf3e('0x51')](_0x2f53d8,_0xbf3e('0x52'));}function emit(_0x145930,_0x5e473f,_0x3517ef){io['to'](_0x145930)[_0xbf3e('0x53')](_0x5e473f,_0x3517ef);}function emitVoiceQueueSummary(_0x1dc3f2){if(_0x1dc3f2[_0xbf3e('0x54')]===_0xbf3e('0x55')){var _0x4deb22={'id':_0x1dc3f2['id'],'name':_0x1dc3f2['name'],'strategy':_0x1dc3f2[_0xbf3e('0x56')],'answered':_0x1dc3f2[_0xbf3e('0x57')],'available':_0x1dc3f2[_0xbf3e('0x58')],'loggedIn':_0x1dc3f2['loggedIn'],'pTalking':_0x1dc3f2[_0xbf3e('0x59')],'sumBillable':_0x1dc3f2[_0xbf3e('0x5a')],'sumDuration':_0x1dc3f2[_0xbf3e('0x5b')],'sumHoldTime':_0x1dc3f2[_0xbf3e('0x5c')]||0x0,'talking':_0x1dc3f2[_0xbf3e('0x5d')],'total':_0x1dc3f2[_0xbf3e('0x5e')],'type':_0x1dc3f2['type'],'unmanaged':_0x1dc3f2[_0xbf3e('0x5f')],'abandoned':_0x1dc3f2[_0xbf3e('0x60')],'waiting':_0x1dc3f2[_0xbf3e('0x61')],'loggedInDb':_0x1dc3f2[_0xbf3e('0x62')],'dialActive':_0x1dc3f2[_0xbf3e('0x63')],'dialMethod':_0x1dc3f2['dialMethod'],'dialOriginateCallerIdName':_0x1dc3f2['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1dc3f2['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1dc3f2[_0xbf3e('0x64')],'dialPrefix':_0x1dc3f2[_0xbf3e('0x65')],'outboundAnswerAgiCallsDay':_0x1dc3f2[_0xbf3e('0x66')],'outboundAnswerCallsDay':_0x1dc3f2[_0xbf3e('0x67')],'outboundBlacklistCallsDay':_0x1dc3f2[_0xbf3e('0x68')],'outboundBusyCallsDay':_0x1dc3f2[_0xbf3e('0x69')],'outboundCongestionCallsDay':_0x1dc3f2['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1dc3f2['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1dc3f2[_0xbf3e('0x6a')],'outboundDropCallsDayTimeout':_0x1dc3f2[_0xbf3e('0x6b')],'outboundNoAnswerCallsDay':_0x1dc3f2[_0xbf3e('0x6c')],'outboundNoSuchCallsDay':_0x1dc3f2[_0xbf3e('0x6d')],'outboundOriginateFailureCallsDay':_0x1dc3f2['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1dc3f2[_0xbf3e('0x6e')],'outboundRejectCallsDay':_0x1dc3f2[_0xbf3e('0x6f')],'outboundUnknownCallsDay':_0x1dc3f2[_0xbf3e('0x70')],'predictiveIntervalAnsweredCalls':_0x1dc3f2[_0xbf3e('0x71')],'predictiveIntervalAvgHoldtime':_0x1dc3f2['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1dc3f2[_0xbf3e('0x72')],'predictiveIntervalDroppedCallsCallersExit':_0x1dc3f2[_0xbf3e('0x73')],'predictiveIntervalDroppedCallsTimeout':_0x1dc3f2['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1dc3f2[_0xbf3e('0x74')],'predictiveIntervalErlangCallsDroppedCalls':_0x1dc3f2[_0xbf3e('0x75')],'predictiveIntervalHitRate':_0x1dc3f2[_0xbf3e('0x76')],'predictiveIntervalMultiplicativeFactor':_0x1dc3f2[_0xbf3e('0x77')],'predictiveIntervalPauses':_0x1dc3f2[_0xbf3e('0x78')],'predictiveIntervalAvailable':_0x1dc3f2['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1dc3f2[_0xbf3e('0x79')],'message':_0x1dc3f2['message'],'originated':_0x1dc3f2[_0xbf3e('0x7a')],'erlangCalls':_0x1dc3f2[_0xbf3e('0x7b')],'erlangCallToSecond':_0x1dc3f2[_0xbf3e('0x7c')],'erlangAbandonmentRate':_0x1dc3f2[_0xbf3e('0x7d')],'erlangBusyFactor':_0x1dc3f2[_0xbf3e('0x7e')],'startPredictive':_0x1dc3f2[_0xbf3e('0x2b')],'startProgressive':_0x1dc3f2['startProgressive']};if(_0x1dc3f2['Trunk']){_0x4deb22[_0xbf3e('0x7f')]={'id':_0x1dc3f2[_0xbf3e('0x7f')]['id'],'name':_0x1dc3f2[_0xbf3e('0x7f')][_0xbf3e('0x44')],'active':_0x1dc3f2['Trunk'][_0xbf3e('0x80')],'callerid':_0x1dc3f2['Trunk'][_0xbf3e('0x81')]};}if(_0x1dc3f2[_0xbf3e('0x4a')]){_0x4deb22[_0xbf3e('0x4a')]={'id':_0x1dc3f2[_0xbf3e('0x4a')]['id'],'name':_0x1dc3f2[_0xbf3e('0x4a')][_0xbf3e('0x44')]};}var _0x52155f=md5(JSON[_0xbf3e('0x4f')](_0x4deb22));if(_0x1dc3f2['md5']!==_0x52155f){_0x1dc3f2[_0xbf3e('0x4')]=_0x52155f;emit(util[_0xbf3e('0x82')](_0xbf3e('0x83'),_0x4deb22[_0xbf3e('0x44')]),_0xbf3e('0x84'),_0x4deb22);}}}function emitCampaignSummary(_0x50abea){if(_0x50abea[_0xbf3e('0x54')]==='ivr'){emit(util[_0xbf3e('0x82')]('campaign:ivr:%s',_0x50abea[_0xbf3e('0x44')]),_0xbf3e('0x85'),_0x50abea);}}function checkGetDataPredictive(_0x39a523){if(isNotNull(_0x39a523)){if(!_[_0xbf3e('0x4c')](_0x39a523)){loggerPredictive[_0xbf3e('0x86')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x87'),_0x39a523['predictiveIntervalTotalCalls']);loggerPredictive[_0xbf3e('0x86')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x39a523['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x88'),_0x39a523[_0xbf3e('0x89')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x39a523[_0xbf3e('0x73')]);loggerPredictive[_0xbf3e('0x86')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x39a523[_0xbf3e('0x8a')]);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x8b'),_0x39a523[_0xbf3e('0x72')]);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x8c'));if(_0x39a523['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x39a523['predictiveIntervalAvgTalktime'])&&_0x39a523['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x8d'));}if(!_['isUndefined'](_0x39a523[_0xbf3e('0x8a')])&&_0x39a523[_0xbf3e('0x8a')]>0x0){return!![];}else{loggerPredictive['info'](_0xbf3e('0x8e'));}}else{loggerPredictive[_0xbf3e('0x86')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x8f'));}}else{loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x8f'));}return![];}function mergeDataErlangB(_0x239f5c){return function(_0x436ad1){loggerPredictive['info'](_0xbf3e('0x90'));loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x91'),_0x436ad1[_0xbf3e('0x7b')]);loggerPredictive['info'](_0xbf3e('0x92'),_0x436ad1['erlangCallToSecond']);loggerPredictive['info'](_0xbf3e('0x93'),_0x436ad1['erlangAbandonmentRate']);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x94'),_0x436ad1[_0xbf3e('0x7e')]);loggerPredictive[_0xbf3e('0x86')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x436ad1['erlangAbandonmentRate']);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x8c'));_[_0xbf3e('0x95')](_0x239f5c,_0x436ad1);};}function getDiff(_0x2dd7d7){var _0x23eea5=moment()[_0xbf3e('0x50')](0x0);var _0x4053c2=moment(_0x2dd7d7)[_0xbf3e('0x50')](0x0);return _0x23eea5[_0xbf3e('0x51')](_0x4053c2,_0xbf3e('0x52'));}function ifInterval(_0x1d879e,_0x2361df){if(_['isUndefined'](_0x2361df)){return![];}if(getDiff(_0x2361df)<_0x1d879e*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x41e3c9){if(isNotNull(_0x41e3c9)){if(!_[_0xbf3e('0x42')](_0x41e3c9[_0xbf3e('0x2c')])){_0x41e3c9['startProgressive']=undefined;loggerPredictive[_0xbf3e('0x86')](_0x41e3c9[_0xbf3e('0x44')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x41e3c9[_0xbf3e('0x2b')])){_0x41e3c9[_0xbf3e('0x2b')]=undefined;loggerPredictive[_0xbf3e('0x86')](_0x41e3c9[_0xbf3e('0x44')],_0xbf3e('0x96'));}if(!_['isUndefined'](_0x41e3c9[_0xbf3e('0x97')])){clearInterval(_0x41e3c9['handlePredictive']);_0x41e3c9[_0xbf3e('0x97')]=undefined;loggerPredictive['info'](_0x41e3c9[_0xbf3e('0x44')],_0xbf3e('0x98'));}}}function erlangb(_0xd88080,_0xaf2fb8){if(_0xaf2fb8===0x0){return 0x0;}var _0x5977f7=0x1;for(var _0x2a9216=0x1;_0x2a9216<=_0xaf2fb8;_0x2a9216+=0x1){_0x5977f7=0x1+_0x5977f7*_0x2a9216/_0xd88080;}return 0x1/_0x5977f7;}function isVoiceQueueOutbound(_0x5323e9){return _0x5323e9==='outbound';}function isNotPreview(_0x5be49a){return _0x5be49a!==_0xbf3e('0x21');}function isCampaignIvr(_0x12494d){return _0x12494d===_0xbf3e('0x99');}function getCallerId(_0x25e30e,_0x1b07eb,_0x1dac27){if(!_[_0xbf3e('0x42')](_0x1dac27)&&_0xbf3e('0x9a')===typeof _0x1dac27&&!_[_0xbf3e('0x4c')](_0x1dac27)){if(!_[_0xbf3e('0x42')](_0x1b07eb)&&_0xbf3e('0x9a')===typeof _0x1b07eb&&!_[_0xbf3e('0x4c')](_0x1b07eb)){return util['format'](_0xbf3e('0x9b'),_0x1b07eb,_0x1dac27);}return util[_0xbf3e('0x82')]('\x22%s\x22\x20<%s>',_0x1dac27,_0x1dac27);}if(!_['isUndefined'](_0x25e30e)&&_0xbf3e('0x9a')===typeof _0x25e30e&&!_[_0xbf3e('0x4c')](_0x25e30e)){return _0x25e30e;}return _0xbf3e('0x9c');}function loggerCatchQueueSummary(_0x46caae,_0x40acc1){return function(_0xbfad56){freeVariablesPredictive(_0x40acc1);emitVoiceQueueSummary(_0x40acc1);emitCampaignSummary(_0x40acc1);loggerSyncQueueSummary[_0xbf3e('0x9d')](_0x46caae,util[_0xbf3e('0x9e')](_0xbfad56,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x33834e,_0x325f67){return function(_0x1e0870){loggerPredictive[_0xbf3e('0x9d')](_0x325f67[_0xbf3e('0x44')],_0x33834e);loggerPredictive[_0xbf3e('0x9d')](_0x1e0870[_0xbf3e('0x9f')]);freeVariablesPredictive(_0x325f67);};}function loggerCatch(_0x38d1c9){return function(_0x1b2cfb){logger['error'](_0x38d1c9,util[_0xbf3e('0x9e')](_0x1b2cfb,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5012fb){return _0x5012fb&&!_[_0xbf3e('0x42')](_0x5012fb)&&_0x5012fb['length']>0x0;}function decremetOriginate(_0x912ac4){if(!_[_0xbf3e('0x42')](_0x912ac4)&&_0x912ac4!==null){if(_0x912ac4[_0xbf3e('0xa0')](_0xbf3e('0x7a'))){if(_0x912ac4[_0xbf3e('0x7a')]>0x0){_0x912ac4[_0xbf3e('0x7a')]-=0x1;}else{logger['error'](_0xbf3e('0xa1'));}}}else{logger[_0xbf3e('0x9d')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5cfca4,_0x47251d,_0x3ed831){if(_0x47251d>_0x3ed831){for(var _0x5d212=0x0;_0x5d212<_0x47251d-_0x3ed831;_0x5d212+=0x1){decremetOriginate(_0x5cfca4);}}}function loggerGetContactDialer(_0x4481db,_0x50f683,_0x37fb48){return function(_0x24cea9){checkContactLowerLimitOriginate(_0x50f683,_0x37fb48,0x0);logger[_0xbf3e('0x9d')](_0x4481db,util['inspect'](_0x24cea9,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x21fa60){return function(_0x544433){if(isNotNull(_0x544433)&&isNotNull(_0x544433[0x0])){if(_0x544433[0x0][_0xbf3e('0xa2')]>0x0){_0x21fa60['message']=_0xbf3e('0xa3');logger['info']('[getContactDialer2][ReScheduled]'+_0x21fa60['name'],_0x544433[0x0]['contactsRescheduled'],_0xbf3e('0xa4'));}else{_0x21fa60[_0xbf3e('0x47')]=_0xbf3e('0xa5');logger[_0xbf3e('0x86')](_0xbf3e('0xa6')+_0x21fa60[_0xbf3e('0x44')]);}}};}function notSendMessagesQueue(_0x3bf7e0){if(_0x3bf7e0[_0xbf3e('0xa7')]){freeVariablesPredictive(_0x3bf7e0);if(_0x3bf7e0[_0xbf3e('0x7a')]===0x0&&_0x3bf7e0[_0xbf3e('0x5d')]===0x0&&_0x3bf7e0[_0xbf3e('0x61')]===0x0&&(_0x3bf7e0[_0xbf3e('0x59')]||0x0)===0x0){_0x3bf7e0[_0xbf3e('0xa7')]=![];_0x3bf7e0['available']=0x0;_0x3bf7e0['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xbf3e('0x9d')](_0xbf3e('0xa8'),_0x3bf7e0[_0xbf3e('0x44')],'is\x20not\x20active');}else{_0x3bf7e0['message']=_0xbf3e('0xa9');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3bf7e0['name'],_0xbf3e('0xaa'));}emitVoiceQueueSummary(_0x3bf7e0);}}function notSendMessagesCampaign(_0x127a12){if(_0x127a12[_0xbf3e('0xa7')]){if(_0x127a12[_0xbf3e('0x7a')]===0x0){_0x127a12[_0xbf3e('0xa7')]=![];_0x127a12[_0xbf3e('0x47')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xbf3e('0xab'),_0x127a12[_0xbf3e('0x44')],_0xbf3e('0xac'));}else{_0x127a12[_0xbf3e('0x47')]=_0xbf3e('0xa9');loggerSyncQueueSummary[_0xbf3e('0x9d')](_0xbf3e('0xab'),_0x127a12[_0xbf3e('0x44')],_0xbf3e('0xaa'));}emitCampaignSummary(_0x127a12);}}function createObjHistory(_0x3bed5b,_0x231a60,_0x57bdc2,_0x32b3a6,_0x41bcd7){_0x3bed5b[_0xbf3e('0x47')]=_0x57bdc2;var _0x4d0601=new Action(_0x3bed5b,_0x231a60);var _0x40b3d4=new History(_0x4d0601);_0x40b3d4[_0xbf3e('0xad')]=_0x32b3a6;_0x40b3d4[_0xbf3e('0xae')]=_0x41bcd7;_0x40b3d4[_0xbf3e('0xaf')]=_0x4d0601[_0xbf3e('0xb0')];return _0x40b3d4;}Dialer[_0xbf3e('0x1c')]['loopClearZombieChannels']=function(){var _0x32c323=this;setInterval(function(){_0x32c323[_0xbf3e('0xb1')](_0x32c323[_0xbf3e('0x29')],_0xbf3e('0xb2'));_0x32c323[_0xbf3e('0xb1')](_0x32c323['actions'],_0xbf3e('0xb3'));},0x32c8);};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xb1')]=function(_0x10c31c,_0x37c719){var _0xdf18eb=this;for(var _0x24a036 in _0x10c31c){if(_0x10c31c[_0xbf3e('0xa0')](_0x24a036)){this[_0xbf3e('0x20')][_0xbf3e('0x1d')](function(){if(!_['isNil'](_0x10c31c[_0x24a036])){return ami[_0xbf3e('0xb4')]({'action':_0xbf3e('0xb5'),'channel':_0x10c31c[_0x24a036][_0xbf3e('0xb6')]})[_0xbf3e('0xb7')](function(_0x3c6c46){if(_0x3c6c46[_0xbf3e('0x47')]===_0xbf3e('0xb8')){setTimeout(function(){if(_0x10c31c[_0x24a036]&&_0x10c31c[_0x24a036][_0xbf3e('0x54')]!==_0xbf3e('0x99')){_0xdf18eb[_0xbf3e('0xb9')](_0xdf18eb[_0xbf3e('0x22')][_0x10c31c[_0x24a036]['queue']]);logger[_0xbf3e('0x9d')](_0xbf3e('0xba'),_0x37c719,_0x24a036,_0x10c31c[_0x24a036][_0xbf3e('0xbb')]);delete _0x10c31c[_0x24a036];}if(_0x10c31c[_0x24a036]&&_0x10c31c[_0x24a036][_0xbf3e('0x54')]===_0xbf3e('0x99')){_0xdf18eb['updateOriginated'](_0xdf18eb[_0xbf3e('0x23')][_0x10c31c[_0x24a036]['queue']]);logger[_0xbf3e('0x9d')](_0xbf3e('0xbc'),_0x37c719,_0x24a036,_0x10c31c[_0x24a036][_0xbf3e('0xbb')]);delete _0x10c31c[_0x24a036];}},0x2328);}});}});}}};Dialer[_0xbf3e('0x1c')]['countReScheduled']=function(_0x580bc2){return BPromise[_0xbf3e('0xbd')]()['then'](cmHopper[_0xbf3e('0xbe')](_0x580bc2))[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xbf')));};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xc0')]=function(_0x2b93a2){return BPromise[_0xbf3e('0xbd')]()['then'](cmHopperBlack['checkIsBlackList'](_0x2b93a2))[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xc1')));};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xc2')]=function(_0x52c226){return BPromise[_0xbf3e('0xbd')]()[_0xbf3e('0xc3')](cmHopperBlack[_0xbf3e('0xc2')](_0x52c226))[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xc4')));};Dialer[_0xbf3e('0x1c')]['averageHandleTime']=function(_0x1682c3){return BPromise[_0xbf3e('0xbd')]()[_0xbf3e('0xc3')](cmHopperHistory[_0xbf3e('0xc5')](_0x1682c3))[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xc6')));};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xc7')]=function(_0x1f3df1){return BPromise[_0xbf3e('0xbd')]()[_0xbf3e('0xc3')](cmHopper[_0xbf3e('0xc7')](_0x1f3df1))[_0xbf3e('0xb7')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xc8')]=function(_0x4c73f0,_0x5df2a2,_0x4811ca){return BPromise[_0xbf3e('0xbd')]()['then'](cmHopper[_0xbf3e('0xc8')](_0x4c73f0,_0x5df2a2,_0x4811ca))['catch'](loggerCatch(_0xbf3e('0xc9')));};Dialer[_0xbf3e('0x1c')]['getContactDialer']=function(_0x5bf9c1,_0x1c19a7,_0x1d12ff,_0x32c9e9){return BPromise['resolve']()[_0xbf3e('0xc3')](cmHopper[_0xbf3e('0xca')](_0x5bf9c1,_0x1c19a7,_0x1d12ff,_0x32c9e9))[_0xbf3e('0xb7')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xcb')]=function(_0x1e7b55,_0x1ecd25,_0x122e56){return BPromise[_0xbf3e('0xbd')]()[_0xbf3e('0xc3')](cmHopper[_0xbf3e('0xcb')](_0x1e7b55,_0x1ecd25,_0x122e56))['catch'](loggerCatch(_0xbf3e('0xcc')));};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xcd')]=function(_0x80d4c){return BPromise[_0xbf3e('0xbd')]()[_0xbf3e('0xc3')](voiceQueueRt[_0xbf3e('0xcd')](_0x80d4c))[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xce')));};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xcf')]=function(_0x5dedd5){return BPromise[_0xbf3e('0xbd')]()[_0xbf3e('0xc3')](cmHopper[_0xbf3e('0xcf')](_0x5dedd5))[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xd0')));};Dialer['prototype'][_0xbf3e('0xd1')]=function(_0xeef2d1){return BPromise[_0xbf3e('0xbd')]()[_0xbf3e('0xc3')](cmHopperHistory['createHistory'](_0xeef2d1))[_0xbf3e('0xb7')](loggerCatch('[createHistory]\x20'));};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xb9')]=function(_0x41adc9){if(!_['isUndefined'](_0x41adc9)&&_0x41adc9!==null){if(_0x41adc9['hasOwnProperty'](_0xbf3e('0x7a'))){if(_0x41adc9[_0xbf3e('0x7a')]>0x0){_0x41adc9[_0xbf3e('0x7a')]-=0x1;}else{logger['error'](_0xbf3e('0xd2'));}}}else{logger[_0xbf3e('0x9d')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0xbf3e('0xd3')]=function(_0x4ae21e,_0x4db27f){var _0x56af85=this;return function(_0x29216e){_0x56af85['updateOriginated'](_0x4db27f);logger[_0xbf3e('0x9d')](_0x4ae21e,util['inspect'](_0x29216e,{'showHidden':![],'depth':null}));};};Dialer[_0xbf3e('0x1c')]['emptyContact']=function(_0x2dda5,_0x4a11bf,_0x4c444a){var _0x219fcc={'state':0x19,'statedesc':_0xbf3e('0xd4')};this['updateOriginated'](_0x4a11bf);this['saveInDb'](_[_0xbf3e('0x95')](_0x219fcc,_['pick'](_0x4c444a,[_0xbf3e('0xd5'),_0xbf3e('0xd6'),_0xbf3e('0xd7'),'VoiceQueueId','CampaignId'])),_0xbf3e('0xd8'),_0xbf3e('0xd9'));logger[_0xbf3e('0x9d')](_0x2dda5);};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xda')]=function(_0x529c18){return _0x529c18===_0xbf3e('0xdb');};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xdc')]=function(_0x5518cb){return!_[_0xbf3e('0x42')](_0x5518cb)&&_0x5518cb&&!_['isUndefined'](_0x5518cb[_0xbf3e('0x44')])&&!_[_0xbf3e('0x42')](_0x5518cb[_0xbf3e('0x80')])&&_0x5518cb['active']&&(this[_0xbf3e('0x25')][util['format'](_0xbf3e('0xdd'),_0x5518cb[_0xbf3e('0x44')])][_0xbf3e('0xb5')]==='reachable'||this[_0xbf3e('0x25')][util[_0xbf3e('0x82')]('SIP/%s',_0x5518cb['name'])]['status']===_0xbf3e('0xde'));};Dialer['prototype']['saveInDb']=function(_0x1b134c,_0x45a044,_0x2f7d9f){this[_0xbf3e('0xd1')](_0x1b134c)['catch'](loggerCatch(_0x45a044));this['moveContactManagedDialer'](_0x1b134c)[_0xbf3e('0xb7')](loggerCatch(_0x2f7d9f));};Dialer[_0xbf3e('0x1c')]['syncVarSet']=function(_0x309035){var _0x21bb37=this[_0xbf3e('0x29')][_0x309035['uniqueid']];var _0x4222ab;if(!_[_0xbf3e('0xdf')](_0x309035)&&!_[_0xbf3e('0xdf')](_0x309035[_0xbf3e('0xe0')])&&!_[_0xbf3e('0xdf')](_0x309035[_0xbf3e('0xe0')][_0xbf3e('0xe1')])&&_0x309035[_0xbf3e('0xe2')]===_0xbf3e('0xe3')&&_0x21bb37){if(_0x21bb37[_0xbf3e('0x54')]!==_0xbf3e('0x99')&&this[_0xbf3e('0x22')][_0x21bb37[_0xbf3e('0xbb')]][_0xbf3e('0xe4')]&&_0x309035[_0xbf3e('0xe5')]===_0xbf3e('0xe6')){delete this[_0xbf3e('0x29')][_0x309035['uniqueid']];this[_0xbf3e('0xb9')](this[_0xbf3e('0x22')][_0x21bb37[_0xbf3e('0xbb')]]);this[_0xbf3e('0x22')][_0x21bb37[_0xbf3e('0xbb')]][_0xbf3e('0x67')]+=0x1;this[_0xbf3e('0x22')][_0x21bb37[_0xbf3e('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4222ab=new Hangup(_0x21bb37,_0x309035);_0x4222ab[_0xbf3e('0xad')]=0x12;_0x4222ab['statedesc']=_0xbf3e('0xe7');_0x4222ab['membername']=_0xbf3e('0xe8');this[_0xbf3e('0xe9')](_0x4222ab,'[syncHangupInAMD][createHistory]',_0xbf3e('0xea'));}if(_0x21bb37[_0xbf3e('0x54')]!==_0xbf3e('0x99')&&this[_0xbf3e('0x22')][_0x21bb37[_0xbf3e('0xbb')]][_0xbf3e('0xe4')]&&_0x309035[_0xbf3e('0xe5')]==='MACHINE'){var _0x274b9d=this;return new BPromise(function(_0x502a32,_0x19800c){delete _0x274b9d['uniqueId'][_0x309035[_0xbf3e('0xeb')]];_0x274b9d[_0xbf3e('0xb9')](_0x274b9d['voiceQueues'][_0x21bb37[_0xbf3e('0xbb')]]);_0x274b9d['voiceQueues'][_0x21bb37[_0xbf3e('0xbb')]][_0xbf3e('0x67')]+=0x1;_0x274b9d[_0xbf3e('0x22')][_0x21bb37[_0xbf3e('0xbb')]][_0xbf3e('0x66')]+=0x1;var _0x155e7a=_0x274b9d[_0xbf3e('0x22')][_0x21bb37[_0xbf3e('0xbb')]];var _0xcd332d=new Hangup(_0x21bb37,_0x309035);_0xcd332d[_0xbf3e('0xad')]=0x13;_0xcd332d[_0xbf3e('0xae')]=_0xbf3e('0xec');_0xcd332d[_0xbf3e('0xed')]=_0xbf3e('0xe8');_0xcd332d[_0xbf3e('0xee')]+=0x1;_0xcd332d[_0xbf3e('0xef')]+=0x1;_0xcd332d[_0xbf3e('0xf0')]=!![];_0x274b9d[_0xbf3e('0xd1')](_0xcd332d)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xf1')));if(_0xcd332d[_0xbf3e('0xf2')]+_0xcd332d[_0xbf3e('0xf3')]+_0xcd332d[_0xbf3e('0xf4')]+_0xcd332d[_0xbf3e('0xf5')]+_0xcd332d[_0xbf3e('0xf6')]+_0xcd332d[_0xbf3e('0xf7')]+_0xcd332d['countmachineretry']+_0xcd332d[_0xbf3e('0xf8')]>=_0x155e7a[_0xbf3e('0xf9')]){_0x274b9d[_0xbf3e('0xfa')](_0xcd332d,_0x502a32,_0x19800c,'reason19\x20machine....');}else{if(_0xcd332d[_0xbf3e('0xee')]>=_0x155e7a[_0xbf3e('0xfb')]){_0x274b9d['createStateFinal'](_0xcd332d,_0x502a32,_0x19800c,_0xbf3e('0xfc'));}else{_0x274b9d[_0xbf3e('0xc7')]({'active':![],'countmachineretry':_0xcd332d[_0xbf3e('0xee')],'scheduledat':moment()[_0xbf3e('0xfd')](_0x155e7a[_0xbf3e('0xfe')],_0xbf3e('0xff'))[_0xbf3e('0x82')](_0xbf3e('0x100')),'ContactId':_0xcd332d['ContactId'],'ListId':_0xcd332d[_0xbf3e('0xd6')],'VoiceQueueId':_0xcd332d['VoiceQueueId']||undefined,'CampaignId':_0xcd332d[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x102')));_0x502a32({'reschedule':0x1});}}});}if(_0x21bb37[_0xbf3e('0x54')]===_0xbf3e('0x99')&&this['campaigns'][_0x21bb37[_0xbf3e('0xbb')]][_0xbf3e('0xe4')]&&_0x309035[_0xbf3e('0xe5')]===_0xbf3e('0xe6')){delete this[_0xbf3e('0x29')][_0x309035[_0xbf3e('0xeb')]];this['updateOriginated'](this[_0xbf3e('0x23')][_0x21bb37[_0xbf3e('0xbb')]]);_0x4222ab=new Hangup(_0x21bb37,_0x309035);_0x4222ab[_0xbf3e('0xad')]=0x12;_0x4222ab[_0xbf3e('0xae')]=_0xbf3e('0xe7');_0x4222ab[_0xbf3e('0xed')]=_0xbf3e('0xe8');this[_0xbf3e('0xe9')](_0x4222ab,_0xbf3e('0x103'),_0xbf3e('0x104'));}if(_0x21bb37[_0xbf3e('0x54')]==='ivr'&&this['campaigns'][_0x21bb37[_0xbf3e('0xbb')]][_0xbf3e('0xe4')]&&_0x309035[_0xbf3e('0xe5')]==='MACHINE'){var _0x274b9d=this;return new BPromise(function(_0x443f60,_0x374260){delete _0x274b9d['uniqueId'][_0x309035['uniqueid']];_0x274b9d['updateOriginated'](_0x274b9d[_0xbf3e('0x23')][_0x21bb37[_0xbf3e('0xbb')]]);_0x274b9d[_0xbf3e('0x23')][_0x21bb37['queue']]['outboundAnswerCallsDay']+=0x1;_0x274b9d[_0xbf3e('0x23')][_0x21bb37[_0xbf3e('0xbb')]][_0xbf3e('0x66')]+=0x1;var _0x154f28=_0x274b9d[_0xbf3e('0x23')][_0x21bb37[_0xbf3e('0xbb')]];var _0x2256b=new Hangup(_0x21bb37,_0x309035);_0x2256b['state']=0x13;_0x2256b[_0xbf3e('0xae')]=_0xbf3e('0xec');_0x2256b[_0xbf3e('0xed')]='AMD';_0x2256b[_0xbf3e('0xee')]+=0x1;_0x2256b[_0xbf3e('0xef')]+=0x1;_0x2256b['amd']=!![];_0x274b9d[_0xbf3e('0xd1')](_0x2256b)['catch'](loggerCatch(_0xbf3e('0xf1')));if(_0x2256b[_0xbf3e('0xf2')]+_0x2256b['countcongestionretry']+_0x2256b['countnoanswerretry']+_0x2256b[_0xbf3e('0xf5')]+_0x2256b[_0xbf3e('0xf6')]+_0x2256b['countabandonedretry']+_0x2256b[_0xbf3e('0xee')]+_0x2256b[_0xbf3e('0xf8')]>=_0x154f28[_0xbf3e('0xf9')]){_0x274b9d['stateGlobal'](_0x2256b,_0x443f60,_0x374260,_0xbf3e('0x105'));}else{if(_0x2256b[_0xbf3e('0xee')]>=_0x154f28[_0xbf3e('0xfb')]){_0x274b9d[_0xbf3e('0x106')](_0x2256b,_0x443f60,_0x374260,_0xbf3e('0xfc'));}else{_0x274b9d['rescheduleContact']({'active':![],'countmachineretry':_0x2256b[_0xbf3e('0xee')],'scheduledat':moment()[_0xbf3e('0xfd')](_0x154f28[_0xbf3e('0xfe')],_0xbf3e('0xff'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2256b['ContactId'],'ListId':_0x2256b[_0xbf3e('0xd6')],'VoiceQueueId':_0x2256b[_0xbf3e('0x107')]||undefined,'CampaignId':_0x2256b[_0xbf3e('0x101')]||undefined})['catch'](loggerCatch(_0xbf3e('0x102')));_0x443f60({'reschedule':0x1});}}});}}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x108')]=function(_0x1bcdd0){var _0x77fdb5=this[_0xbf3e('0x29')][_0x1bcdd0[_0xbf3e('0xeb')]];var _0x31eb62=this;var _0x34efe9;if(_0x77fdb5&&_0x77fdb5['type']===_0xbf3e('0x99')){delete this['uniqueId'][_0x1bcdd0[_0xbf3e('0xeb')]];this[_0xbf3e('0xb9')](this['campaigns'][_0x77fdb5[_0xbf3e('0xbb')]]);this[_0xbf3e('0x23')][_0x77fdb5[_0xbf3e('0xbb')]][_0xbf3e('0x109')]+=0x1;_0x34efe9=new Hangup(_0x77fdb5,_0x1bcdd0);this[_0xbf3e('0xd1')](_0x34efe9)[_0xbf3e('0xb7')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x34efe9)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x10a')));}if(_0x77fdb5&&_0x77fdb5['type']!==_0xbf3e('0x99')&&isNotNull(this[_0xbf3e('0x22')][_0x77fdb5[_0xbf3e('0xbb')]][_0xbf3e('0x10b')])){delete this[_0xbf3e('0x29')][_0x1bcdd0[_0xbf3e('0xeb')]];this[_0xbf3e('0xb9')](this[_0xbf3e('0x22')][_0x77fdb5[_0xbf3e('0xbb')]]);this[_0xbf3e('0x22')][_0x77fdb5[_0xbf3e('0xbb')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x77fdb5[_0xbf3e('0xbb')]][_0xbf3e('0x66')]+=0x1;_0x34efe9=new Hangup(_0x77fdb5,_0x1bcdd0);_0x34efe9[_0xbf3e('0xad')]=0x10;_0x34efe9['statedesc']=_0xbf3e('0x10c');_0x34efe9[_0xbf3e('0xed')]='AGI';this[_0xbf3e('0xd1')](_0x34efe9)[_0xbf3e('0xb7')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x34efe9)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x10a')));}if(_0x77fdb5&&_0x77fdb5[_0xbf3e('0x54')]!=='ivr'&&!isNotNull(this[_0xbf3e('0x22')][_0x77fdb5[_0xbf3e('0xbb')]][_0xbf3e('0x10b')])){delete this[_0xbf3e('0x29')][_0x1bcdd0[_0xbf3e('0xeb')]];this['updateOriginated'](this[_0xbf3e('0x22')][_0x77fdb5[_0xbf3e('0xbb')]]);this['voiceQueues'][_0x77fdb5[_0xbf3e('0xbb')]][_0xbf3e('0x70')]+=0x1;_0x34efe9=new Hangup(_0x77fdb5,_0x1bcdd0);_0x34efe9[_0xbf3e('0xad')]=0xc;_0x34efe9[_0xbf3e('0xae')]=_0x1bcdd0[_0xbf3e('0x10d')];_0x34efe9[_0xbf3e('0xed')]=_0xbf3e('0x10e');this[_0xbf3e('0xd1')](_0x34efe9)['catch'](loggerCatch(_0xbf3e('0x10f')));this['moveContactManagedDialer'](_0x34efe9)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x38')]=function(_0x917d71){var _0x4e3111=this[_0xbf3e('0x29')][_0x917d71[_0xbf3e('0xeb')]];var _0x2625e1=this;if(this['voiceQueues'][_0x917d71[_0xbf3e('0xbb')]]){if(_0x4e3111&&_0x4e3111[_0xbf3e('0x54')]!==_0xbf3e('0x99')){delete this[_0xbf3e('0x29')][_0x917d71[_0xbf3e('0xeb')]];this['voiceQueues'][_0x917d71[_0xbf3e('0xbb')]][_0xbf3e('0x67')]+=0x1;var _0x35fc83=new AgentComplete(_0x4e3111,_0x917d71);if(_0x917d71[_0xbf3e('0x110')]===_0xbf3e('0x111')){_0x35fc83[_0xbf3e('0x112')]=this['voiceQueues'][_0x917d71[_0xbf3e('0xbb')]][_0xbf3e('0x113')]&&this[_0xbf3e('0x22')][_0x917d71[_0xbf3e('0xbb')]][_0xbf3e('0x114')]?moment()['format'](_0xbf3e('0x100')):undefined;}this[_0xbf3e('0xd1')](_0x35fc83)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x115')));this[_0xbf3e('0xcf')](_0x35fc83)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x31')]=function(_0x3a681a){if(this[_0xbf3e('0x22')][_0x3a681a['queue']]){if(this[_0xbf3e('0x29')][_0x3a681a[_0xbf3e('0xeb')]]&&this['uniqueId'][_0x3a681a['uniqueid']]['type']!==_0xbf3e('0x99')){this[_0xbf3e('0xb9')](this['voiceQueues'][_0x3a681a['queue']]);this[_0xbf3e('0x29')][_0x3a681a[_0xbf3e('0xeb')]][_0xbf3e('0x116')]=moment()[_0xbf3e('0x82')](_0xbf3e('0x100'));}}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x117')]=function(_0x5846e5){this[_0xbf3e('0xd1')](_0x5846e5)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x115')));this[_0xbf3e('0xcf')](_0x5846e5)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x118')));};Dialer['prototype'][_0xbf3e('0x34')]=function(_0x2bea96){var _0x1b22f7=this['uniqueId'][_0x2bea96[_0xbf3e('0xeb')]];var _0x1e90b7=this;if(this[_0xbf3e('0x22')][_0x2bea96[_0xbf3e('0xbb')]]){if(_0x1b22f7&&_0x1b22f7['type']!==_0xbf3e('0x99')){delete this[_0xbf3e('0x29')][_0x2bea96[_0xbf3e('0xeb')]];this[_0xbf3e('0xb9')](this['voiceQueues'][_0x2bea96[_0xbf3e('0xbb')]]);_0x1b22f7[_0xbf3e('0x119')]=moment()[_0xbf3e('0x82')]('YYYY-MM-DD\x20HH:mm:ss');var _0x246eaa=new QueueCallerAbandon(_0x1b22f7,_0x2bea96);if(getSeconds(_0x1b22f7['droptime'],_0x1b22f7['responsetime'])>=_0x1b22f7[_0xbf3e('0x11a')]){this['voiceQueues'][_0x2bea96['queue']][_0xbf3e('0x89')]+=0x1;this[_0xbf3e('0x22')][_0x2bea96[_0xbf3e('0xbb')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xbf3e('0x22')][_0x2bea96[_0xbf3e('0xbb')]][_0xbf3e('0x75')]+=0x1;_0x246eaa[_0xbf3e('0xad')]=0xa;_0x246eaa[_0xbf3e('0xae')]=_0xbf3e('0x11b');_0x246eaa['dropreason']='TIMEOUT';_0x246eaa['agiafterat']=this['voiceQueues'][_0x2bea96[_0xbf3e('0xbb')]][_0xbf3e('0x113')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x246eaa[_0xbf3e('0xf6')]+=0x1;_0x246eaa[_0xbf3e('0xef')]+=0x1;if(_0x246eaa[_0xbf3e('0xf6')]>=this['voiceQueues'][_0x2bea96[_0xbf3e('0xbb')]][_0xbf3e('0x11c')]){this[_0xbf3e('0x117')](_0x246eaa);}else{this[_0xbf3e('0xc7')]({'active':![],'countdropretry':_0x246eaa[_0xbf3e('0xf6')],'scheduledat':moment()['add'](this[_0xbf3e('0x22')][_0x2bea96[_0xbf3e('0xbb')]]['dialDropRetryFrequency'],_0xbf3e('0xff'))['format'](_0xbf3e('0x100')),'ContactId':_0x1b22f7[_0xbf3e('0xd5')],'ListId':_0x1b22f7['ListId'],'VoiceQueueId':_0x1b22f7['VoiceQueueId']||undefined,'CampaignId':_0x1b22f7['CampaignId']||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x11d')));var _0x39c6a1=new History(_0x246eaa);_0x39c6a1[_0xbf3e('0xad')]=0xa;_0x39c6a1[_0xbf3e('0xae')]=_0xbf3e('0x11b');_0x39c6a1[_0xbf3e('0xb0')]=moment()[_0xbf3e('0x82')]('YYYY-MM-DD\x20HH:mm:ss');_0x39c6a1[_0xbf3e('0xaf')]=_0x39c6a1[_0xbf3e('0xb0')];_0x39c6a1[_0xbf3e('0x11e')]=_0x246eaa[_0xbf3e('0x11e')];_0x39c6a1[_0xbf3e('0x11f')]=_0x246eaa['calleridnum'];this['createHistory'](_0x39c6a1)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x120')));}}else{this[_0xbf3e('0x22')][_0x2bea96[_0xbf3e('0xbb')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xbf3e('0x22')][_0x2bea96[_0xbf3e('0xbb')]]['outboundDropCallsDayCallersExit']+=0x1;_0x246eaa['state']=0xb;_0x246eaa[_0xbf3e('0xae')]=_0xbf3e('0x121');_0x246eaa[_0xbf3e('0x122')]=_0xbf3e('0x123');_0x246eaa[_0xbf3e('0xf7')]+=0x1;_0x246eaa[_0xbf3e('0xef')]+=0x1;if(_0x246eaa[_0xbf3e('0xf7')]>=this['voiceQueues'][_0x2bea96['queue']][_0xbf3e('0x124')]){this['queueCallerAbandonCreateState'](_0x246eaa);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x246eaa[_0xbf3e('0xf7')],'scheduledat':moment()[_0xbf3e('0xfd')](this['voiceQueues'][_0x2bea96[_0xbf3e('0xbb')]][_0xbf3e('0x125')],'minutes')[_0xbf3e('0x82')](_0xbf3e('0x100')),'ContactId':_0x1b22f7[_0xbf3e('0xd5')],'ListId':_0x1b22f7[_0xbf3e('0xd6')],'VoiceQueueId':_0x1b22f7[_0xbf3e('0x107')]||undefined,'CampaignId':_0x1b22f7[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x126')));var _0x39c6a1=new History(_0x246eaa);_0x39c6a1[_0xbf3e('0xad')]=0xb;_0x39c6a1[_0xbf3e('0xae')]=_0xbf3e('0x121');_0x39c6a1[_0xbf3e('0xb0')]=moment()['format'](_0xbf3e('0x100'));_0x39c6a1[_0xbf3e('0xaf')]=_0x39c6a1[_0xbf3e('0xb0')];_0x39c6a1[_0xbf3e('0x11e')]=_0x246eaa[_0xbf3e('0x11e')];_0x39c6a1[_0xbf3e('0x11f')]=_0x246eaa[_0xbf3e('0x11f')];this[_0xbf3e('0xd1')](_0x39c6a1)[_0xbf3e('0xb7')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x3b')]=function(_0x2df4a6){if(this['actions'][_0x2df4a6[_0xbf3e('0xeb')]]){this[_0xbf3e('0x127')][_0x2df4a6[_0xbf3e('0xeb')]][_0xbf3e('0xb6')]=_0x2df4a6[_0xbf3e('0xb6')];}if(this[_0xbf3e('0x29')][_0x2df4a6['uniqueid']]){this[_0xbf3e('0x29')][_0x2df4a6['uniqueid']]['channel']=_0x2df4a6['channel'];}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x128')]=function(_0x636b78){if(strategy[this['voiceQueues'][this[_0xbf3e('0x127')][_0x636b78[_0xbf3e('0x129')]][_0xbf3e('0xbb')]][_0xbf3e('0x56')]]==='roundrobin'){if(this[_0xbf3e('0x127')][_0x636b78['actionid']]&&_[_0xbf3e('0xdf')](this[_0xbf3e('0x127')][_0x636b78[_0xbf3e('0x129')]][_0xbf3e('0x12a')])&&_0x636b78[_0xbf3e('0xb5')]==='1'&&_0x636b78[_0xbf3e('0x12b')]==='0'){if(this['agents'][_0x636b78[_0xbf3e('0x12c')]]){if(!this[_0xbf3e('0x24')][_0x636b78[_0xbf3e('0x12c')]][_0xbf3e('0x12a')]){this[_0xbf3e('0x24')][_0x636b78[_0xbf3e('0x12c')]]['locked']=!![];this[_0xbf3e('0x127')][_0x636b78[_0xbf3e('0x129')]]['locked']=!![];this[_0xbf3e('0x127')][_0x636b78[_0xbf3e('0x129')]][_0xbf3e('0x12c')]=_0x636b78['stateinterface'];}}}}else if((strategy[this[_0xbf3e('0x22')][this[_0xbf3e('0x127')][_0x636b78[_0xbf3e('0x129')]][_0xbf3e('0xbb')]][_0xbf3e('0x56')]]||'rrmemory')===_0xbf3e('0x1b')){if(this[_0xbf3e('0x127')][_0x636b78[_0xbf3e('0x129')]]){if(this[_0xbf3e('0x24')][_0x636b78[_0xbf3e('0x12c')]]){this['actions'][_0x636b78['actionid']]['stateinterface']=_0x636b78['stateinterface'];if(_[_0xbf3e('0xdf')](this[_0xbf3e('0x2e')][this[_0xbf3e('0x127')][_0x636b78[_0xbf3e('0x129')]][_0xbf3e('0xbb')]])){this['queueBooked'][this['actions'][_0x636b78[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]=[];}this['queueBooked'][this[_0xbf3e('0x127')][_0x636b78['actionid']][_0xbf3e('0xbb')]]['push'](_[_0xbf3e('0x95')](_['pick'](this['actions'][_0x636b78[_0xbf3e('0x129')]],[_0xbf3e('0x12d'),_0xbf3e('0x12c')]),{'status':_0x636b78[_0xbf3e('0xb5')],'paused':_0x636b78[_0xbf3e('0x12b')]}));}}}};function unlockQueueStatus(_0x3ffe6e,_0x4e40e9){setTimeout(function(){if(_[_0xbf3e('0x42')](_0x3ffe6e['queueStatusComplete'])){loggerBooked[_0xbf3e('0x9d')](_0xbf3e('0x12e'),_0x4e40e9);}_0x3ffe6e[_0xbf3e('0x12f')]=!![];loggerBooked[_0xbf3e('0x86')](_0xbf3e('0x130'),_0x4e40e9,JSON[_0xbf3e('0x4f')](_[_0xbf3e('0x131')](_0x3ffe6e,[_0xbf3e('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0xead5f4){var _0x12f867=this;var _0x3ad04c=_0x12f867[_0xbf3e('0x22')][_0x12f867[_0xbf3e('0x127')][_0xead5f4['actionid']]['queue']];if(strategy[this[_0xbf3e('0x22')][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]][_0xbf3e('0x56')]]===_0xbf3e('0x132')){if(this['actions'][_0xead5f4[_0xbf3e('0x129')]]&&this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0x12c')]){this['preview'][_0xbf3e('0x133')](this[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0x12d')],this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]]['stateinterface'])[_0xbf3e('0xb7')](function(_0x3e47d9){logger[_0xbf3e('0x9d')](_0xbf3e('0x134'),util[_0xbf3e('0x9e')](_0x3e47d9,{'showHidden':![],'depth':null}));})['finally'](function(){_0x12f867[_0xbf3e('0xb9')](_0x12f867[_0xbf3e('0x22')][_0x12f867[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]);_0x12f867[_0xbf3e('0x24')][_0x12f867['actions'][_0xead5f4['actionid']]['stateinterface']]['locked']=![];delete _0x12f867[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]];unlockQueueStatus(_0x3ad04c);});}else{this[_0xbf3e('0xb9')](this[_0xbf3e('0x22')][this[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0xbb')]]);this[_0xbf3e('0xc7')]({'active':![],'ContactId':this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xd5')],'ListId':this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xd6')],'VoiceQueueId':this['actions'][_0xead5f4['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0x101')]||undefined})['catch'](loggerCatch(_0xbf3e('0x135')));delete this[_0xbf3e('0x127')][_0xead5f4['actionid']];unlockQueueStatus(_0x3ad04c);}}else if((strategy[this[_0xbf3e('0x22')][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]][_0xbf3e('0x56')]]||_0xbf3e('0x1b'))===_0xbf3e('0x1b')){var _0x30f7d1;if(this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]]&&!_['isEmpty'](this['queueBooked'][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]])){if(this[_0xbf3e('0x2f')][_0x12f867[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]]['queue']]){this['queueBookedRR'][_0x12f867[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]=this[_0xbf3e('0x2f')][this['actions'][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]?this['queueBookedRR'][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]:this[_0xbf3e('0x2e')][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]?this[_0xbf3e('0x2e')][this[_0xbf3e('0x127')][_0xead5f4['actionid']]['queue']]['_rr']||0x0:0x0;}this[_0xbf3e('0x2e')][this[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0xbb')]][_0xbf3e('0x136')]=this[_0xbf3e('0x2f')][this['actions'][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]];for(var _0x7ba496=0x0;_0x7ba496<this[_0xbf3e('0x2e')][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]][_0xbf3e('0x137')];_0x7ba496+=0x1){_0x30f7d1=rr(this[_0xbf3e('0x2e')][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]]['queue']]);this['queueBookedRR'][_0x12f867['actions'][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]=this[_0xbf3e('0x2e')][this[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0xbb')]][_0xbf3e('0x136')];if(_0x30f7d1[_0xbf3e('0xb5')]==='1'&&_0x30f7d1['paused']==='0'){break;}}if(!_[_0xbf3e('0xdf')](_0x30f7d1)){this[_0xbf3e('0x24')][_0x30f7d1['stateinterface']][_0xbf3e('0x138')]=_[_0xbf3e('0x42')](this[_0xbf3e('0x24')][_0x30f7d1['stateinterface']][_0xbf3e('0x138')])?!![]:this[_0xbf3e('0x24')][_0x30f7d1['stateinterface']][_0xbf3e('0x138')];}loggerBooked[_0xbf3e('0x86')](_0xbf3e('0x139'),_0xead5f4[_0xbf3e('0x129')],'Agent:\x20',JSON[_0xbf3e('0x4f')](_[_0xbf3e('0x131')](this[_0xbf3e('0x24')][_0x30f7d1[_0xbf3e('0x12c')]],['name',_0xbf3e('0x138')])),_0xbf3e('0x13a'),JSON['stringify'](_0x30f7d1[_0xbf3e('0x12d')]));if(!_[_0xbf3e('0xdf')](_0x30f7d1)&&_0x30f7d1['status']==='1'&&_0x30f7d1[_0xbf3e('0x12b')]==='0'&&this[_0xbf3e('0x24')][_0x30f7d1[_0xbf3e('0x12c')]][_0xbf3e('0x138')]){this[_0xbf3e('0x24')][_0x30f7d1[_0xbf3e('0x12c')]][_0xbf3e('0x138')]=![];this['queueBooked'][_0x12f867[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]]['queue']]=[];this[_0xbf3e('0x21')]['run'](_0x30f7d1[_0xbf3e('0x12d')],_0x30f7d1[_0xbf3e('0x12c')])[_0xbf3e('0xb7')](function(_0x552d32){logger['error'](_0xbf3e('0x134'),util[_0xbf3e('0x9e')](_0x552d32,{'showHidden':![],'depth':null}));})[_0xbf3e('0x1f')](function(){_0x12f867[_0xbf3e('0xb9')](_0x12f867[_0xbf3e('0x22')][_0x12f867[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0xbb')]]);setTimeout(function(){_0x12f867[_0xbf3e('0x24')][_0x30f7d1[_0xbf3e('0x12c')]][_0xbf3e('0x138')]=!![];loggerBooked['info'](_0xbf3e('0x13b'),_0xead5f4[_0xbf3e('0x129')],_0xbf3e('0x13c'),JSON[_0xbf3e('0x4f')](_[_0xbf3e('0x131')](_0x12f867[_0xbf3e('0x24')][_0x30f7d1[_0xbf3e('0x12c')]],[_0xbf3e('0x44'),_0xbf3e('0x138')])),'contactAgent-idHopper:\x20',JSON[_0xbf3e('0x4f')](_0x30f7d1[_0xbf3e('0x12d')]));},0xc7);delete _0x12f867[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]];unlockQueueStatus(_0x3ad04c,_0xead5f4[_0xbf3e('0x129')]);});}else{loggerBooked[_0xbf3e('0x86')](_0xbf3e('0x13d'));this[_0xbf3e('0xb9')](this[_0xbf3e('0x22')][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]);this[_0xbf3e('0xc7')]({'active':![],'ContactId':this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xd5')],'ListId':this['actions'][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xd6')],'VoiceQueueId':this['actions'][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0x107')]||undefined,'CampaignId':this[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x135')));delete this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]];unlockQueueStatus(_0x3ad04c);}}else{loggerBooked[_0xbf3e('0x86')](_0xbf3e('0x13e'));this['updateOriginated'](this['voiceQueues'][this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xbb')]]);this[_0xbf3e('0xc7')]({'active':![],'ContactId':this[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0xd5')],'ListId':this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xd6')],'VoiceQueueId':this[_0xbf3e('0x127')][_0xead5f4['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0x101')]||undefined})['catch'](loggerCatch(_0xbf3e('0x13f')));delete this['actions'][_0xead5f4['actionid']];unlockQueueStatus(_0x3ad04c);}}else{loggerBooked['info'](_0xbf3e('0x140'));this[_0xbf3e('0xb9')](this[_0xbf3e('0x22')][this[_0xbf3e('0x127')][_0xead5f4['actionid']][_0xbf3e('0xbb')]]);this[_0xbf3e('0xc7')]({'active':![],'ContactId':this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]][_0xbf3e('0xd5')],'ListId':this['actions'][_0xead5f4['actionid']][_0xbf3e('0xd6')],'VoiceQueueId':this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]]['CampaignId']||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x141')));delete this[_0xbf3e('0x127')][_0xead5f4[_0xbf3e('0x129')]];unlockQueueStatus(_0x3ad04c);}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x40')]=function(){var _0x1f338e=this;setInterval(function(){_0x1f338e[_0xbf3e('0x142')]();},0x3e8);};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x143')]=function(_0x763b30){var _0x43e402=this;return function(){if(!_0x43e402[_0xbf3e('0xdc')](_0x763b30[_0xbf3e('0x7f')])){if(!_0x43e402[_0xbf3e('0xdc')](_0x763b30[_0xbf3e('0x144')])){_0x763b30[_0xbf3e('0x47')]=_0xbf3e('0x145');throw _0x763b30[_0xbf3e('0x44')]+_0xbf3e('0x146');}}};};Dialer['prototype'][_0xbf3e('0x147')]=function(_0x1b8f79,_0x44a782,_0xf8594e,_0x1865d7){var _0x4980f7=this;return function(){var _0x28c603=!![];return _0x4980f7[_0xbf3e('0x148')](_0x1b8f79,_0x44a782,_0xf8594e,_0x1865d7,_0x28c603);};};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x149')]=function(_0x5571e3,_0x58e289,_0x38310d,_0x357f3c){var _0x1952ff=this;return function(){var _0x10ecba=![];return _0x1952ff['ifTime'](_0x5571e3[_0xbf3e('0x4b')],_0x58e289,_0x38310d,_0x357f3c,_0x10ecba);};};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x148')]=function(_0x318e12,_0x549a9f,_0x1a1f54,_0x4030ed,_0x44431e){var _0x54da6a=[];return new BPromise(function(_0x4b2e21,_0x5d8d75){if(!isNotNull(_0x318e12)){_0x4030ed[_0xbf3e('0x47')]='INTERVAL_IS_NULL';return _0x5d8d75(msgResponse(_0xbf3e('0x148'),_0xbf3e('0x14a'),_0x1a1f54+_0xbf3e('0x14b')));}if(_[_0xbf3e('0x4c')](_0x318e12)){_0x4030ed[_0xbf3e('0x47')]=_0xbf3e('0x14c');return _0x5d8d75(msgResponse(_0xbf3e('0x148'),_0xbf3e('0x14a'),_0x1a1f54+_0xbf3e('0x14d')));}if(_0x549a9f&&_[_0xbf3e('0x42')](config[_0xbf3e('0x14e')][_0x549a9f])){_0x4030ed[_0xbf3e('0x47')]=_0xbf3e('0x14f');return _0x5d8d75(msgResponse(_0xbf3e('0x148'),_0xbf3e('0x14a'),_0x1a1f54+_0xbf3e('0x150')+_0x549a9f));}if(_[_0xbf3e('0x151')](_0x318e12)){for(var _0x561742=0x0;_0x561742<_0x318e12[_0xbf3e('0x137')];_0x561742+=0x1){_0x54da6a[_0xbf3e('0x152')](ami[_0xbf3e('0xb4')]({'action':_0xbf3e('0x153'),'command':util[_0xbf3e('0x82')](_0xbf3e('0x154'),_0x318e12[_0x561742][_0xbf3e('0x155')],!_[_0xbf3e('0x42')](config[_0xbf3e('0x14e')][_0x549a9f])?_0x549a9f:'')})[_0xbf3e('0xc3')](function(_0x5b7617){return _0x5b7617[_0xbf3e('0x156')][_0xbf3e('0x157')](_0xbf3e('0x158'))>=0x0?!![]:![];})['catch'](myreject(_0x5d8d75)));}}else{_0x54da6a[_0xbf3e('0x152')](ami['Action']({'action':_0xbf3e('0x153'),'command':util['format'](_0xbf3e('0x154'),_0x318e12,!_[_0xbf3e('0x42')](config['timezones'][_0x549a9f])?_0x549a9f:'')})[_0xbf3e('0xc3')](function(_0x2ed3b0){return _0x2ed3b0[_0xbf3e('0x156')][_0xbf3e('0x157')](_0xbf3e('0x158'))>=0x0?!![]:![];})['catch'](myreject(_0x5d8d75)));}BPromise[_0xbf3e('0x159')](_0x54da6a)[_0xbf3e('0xc3')](function(_0x41ceb3){var _0x3cc2c2=_['some'](_0x41ceb3);if(_0x3cc2c2){return _0x4b2e21(_0x3cc2c2);}else{_0x4030ed[_0xbf3e('0x47')]=_0x44431e?_0xbf3e('0x15a'):'INTERVAL_IS_OVERTIME';return _0x5d8d75(msgResponse(_0xbf3e('0x15b'),_0xbf3e('0x14a'),_0xbf3e('0x15c')+_0x44431e+'\x20'+_0x1a1f54+'\x20Interval\x20is\x20overtime:\x20'+util[_0xbf3e('0x9e')](_0x318e12,{'showHidden':![],'depth':null})+_0xbf3e('0x15d')+_0x549a9f));}})[_0xbf3e('0xb7')](function(_0x41246d){return _0x5d8d75(msgResponse('ifTime',_0xbf3e('0x14a'),JSON['stringify'](_0x41246d)));});});};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x15e')]=function(_0x13b535){var _0x3b63dd=this;return function(){switch(_0x13b535[_0xbf3e('0x15f')]){case'progressive':freeVariablesPredictive(_0x13b535);_0x3b63dd[_0xbf3e('0x160')](_0x13b535,0x1);break;case _0xbf3e('0x161'):freeVariablesPredictive(_0x13b535);_0x3b63dd['handlePower'](_0x13b535,_0x13b535['dialPowerLevel']);break;case _0xbf3e('0x9'):_0x3b63dd['predictive'](_0x13b535);break;case _0xbf3e('0x162'):freeVariablesPredictive(_0x13b535);_0x3b63dd['handlePower'](_0x13b535,0x1);break;default:freeVariablesPredictive(_0x13b535);logger[_0xbf3e('0x9d')](_0xbf3e('0x163'),_0x13b535[_0xbf3e('0x44')],_0xbf3e('0x164'));}};};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x165')]=function(_0x5a2387){var _0xf5d2eb=this;return function(){_0xf5d2eb['handleIvr'](_0x5a2387);};};Dialer[_0xbf3e('0x1c')][_0xbf3e('0xb')]=function(_0x3431e3){var _0x4db5da=this;if(isNotPreview(_0x3431e3[_0xbf3e('0x15f')])){if(isVoiceQueueOutbound(_0x3431e3[_0xbf3e('0x54')])&&isActive(_0x3431e3['dialActive'])){_0x3431e3['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xbf3e('0xc3')](checkIsLoggedIn(_0x3431e3,_0x3431e3[_0xbf3e('0x166')]))[_0xbf3e('0xc3')](checkIsActive(_0x3431e3,_0x3431e3['dialActive']))[_0xbf3e('0xc3')](checkInterval(_0x3431e3))[_0xbf3e('0xc3')](_0x4db5da[_0xbf3e('0x143')](_0x3431e3))['then'](_0x4db5da[_0xbf3e('0x147')](_0x3431e3['dialGlobalInterval'],_0x3431e3[_0xbf3e('0x167')],_0x3431e3[_0xbf3e('0x44')],_0x3431e3))[_0xbf3e('0xc3')](_0x4db5da[_0xbf3e('0x149')](_0x3431e3[_0xbf3e('0x4a')],_0x3431e3[_0xbf3e('0x167')],_0x3431e3[_0xbf3e('0x44')],_0x3431e3))[_0xbf3e('0xc3')](_0x4db5da[_0xbf3e('0x15e')](_0x3431e3))[_0xbf3e('0xb7')](loggerCatchQueueSummary(_0xbf3e('0x168'),_0x3431e3));}else{notSendMessagesQueue(_0x3431e3);}}else{freeVariablesPredictive(_0x3431e3);}};Dialer[_0xbf3e('0x1c')]['syncCampaigns']=function(){var _0x3c7f6f=this;var _0x3a46ab;for(var _0x556558 in this[_0xbf3e('0x23')]){if(this[_0xbf3e('0x23')][_0xbf3e('0xa0')](_0x556558)){_0x3a46ab=this['campaigns'][_0x556558];if(isCampaignIvr(_0x3a46ab[_0xbf3e('0x54')])&&isActive(_0x3a46ab[_0xbf3e('0x80')])){_0x3a46ab['sendMessageOneNotActive']=!![];BPromise[_0xbf3e('0xbd')]()['then'](checkIsActive(_0x3a46ab,_0x3a46ab[_0xbf3e('0x80')]))[_0xbf3e('0xc3')](checkInterval(_0x3a46ab))[_0xbf3e('0xc3')](_0x3c7f6f[_0xbf3e('0x143')](_0x3a46ab))[_0xbf3e('0xc3')](_0x3c7f6f['checkIfTime'](_0x3a46ab[_0xbf3e('0x169')],_0x3a46ab[_0xbf3e('0x167')],_0x3a46ab['name'],_0x3a46ab))[_0xbf3e('0xc3')](_0x3c7f6f[_0xbf3e('0x149')](_0x3a46ab[_0xbf3e('0x4a')],_0x3a46ab[_0xbf3e('0x167')],_0x3a46ab['name'],_0x3a46ab))['then'](_0x3c7f6f[_0xbf3e('0x165')](_0x3a46ab))[_0xbf3e('0xb7')](loggerCatchQueueSummary(_0xbf3e('0x16a'),_0x3a46ab));}else{notSendMessagesCampaign(_0x3a46ab);}}}};function getCallerIdRandom(_0x344d11,_0x57679b){var _0x671d97,_0x4c0fe8,_0x27d7e9;if(_0x57679b<=0x0){_0x57679b=0x1;}_0x671d97=new RegExp(_0xbf3e('0x16b')+_0x57679b+'}$');_0x4c0fe8=Math[_0xbf3e('0x16c')](0xa,_0x57679b-0x1);_0x27d7e9=Math[_0xbf3e('0x16c')](0xa,_0x57679b)-0x1;return util[_0xbf3e('0x82')]('%s',_[_0xbf3e('0x16d')](_0x344d11,_0x671d97,_['random'](_0x4c0fe8,_0x27d7e9)));}function extractCalleridName(_0x205cbf){var _0x29ede2=_0x205cbf[_0xbf3e('0x16e')](/"(.*?)"/);return _0x29ede2?_0x29ede2[0x1]:_0x205cbf;}function extractCalleridNumber(_0xcffc77){var _0x179049=_0xcffc77[_0xbf3e('0x16e')](/<(.*?)>/);return _0x179049?_0x179049[0x1]:_0xcffc77;}Dialer[_0xbf3e('0x1c')][_0xbf3e('0x16f')]=function(_0x4a9184,_0x578624){var _0x39217a=this;var _0x30f6d4=uuid['v4']();this[_0xbf3e('0x127')][_0x30f6d4]=new Action(_0x4a9184,_0x578624,_0x30f6d4);return new BPromise(function(_0x2da042,_0x5e503e){if(_[_0xbf3e('0x42')](_0x4a9184)&&_0xbf3e('0x170')!==typeof _0x4a9184){return _0x5e503e(msgResponse(_0xbf3e('0x171'),_0xbf3e('0x14a'),_0xbf3e('0x172')));}if(_['isUndefined'](_0x578624[_0xbf3e('0x173')][_0xbf3e('0x174')])||_0x578624['Contact'][_0xbf3e('0x174')]===null){return _0x5e503e(msgResponse(_0xbf3e('0x171'),_0xbf3e('0x14a'),_0xbf3e('0x175')));}var _0x33abb9={'XMD-CALLERID':_0x39217a[_0xbf3e('0x127')][_0x30f6d4][_0xbf3e('0x176')](),'XMD-AGI':_0x4a9184['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x4a9184['dialQueueProject']):_0xbf3e('0x177'),'XMD-AGIAFTER':_0x4a9184[_0xbf3e('0x113')]?util['format'](_0xbf3e('0x178'),ipAgi,_0x4a9184['dialQueueProject2']):'NONE','XMD-QUEUE':_0x4a9184[_0xbf3e('0x54')]===_0xbf3e('0x55')?util['format']('\x22%s,%s%s,,,%s\x22',_0x4a9184[_0xbf3e('0x44')],_0x4a9184[_0xbf3e('0x179')]||'',_0x4a9184[_0xbf3e('0x114')]?'c':'',_0x4a9184['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x578624[_0xbf3e('0xd5')],'XMD-CDRTYPE':_0xbf3e('0x8'),'CALLERID(all)':_0x39217a[_0xbf3e('0x127')][_0x30f6d4]['getCaller'](),'XMD-AMD':_0x4a9184[_0xbf3e('0xe4')]?_0xbf3e('0x17a'):_0xbf3e('0x177'),'XMD-DESTINATION':_0xbf3e('0xe3')};if(_0x4a9184[_0xbf3e('0xe4')]){_0x33abb9[_0xbf3e('0x17b')]=_0x4a9184[_0xbf3e('0x17c')]||0x9c4;_0x33abb9[_0xbf3e('0x17d')]=_0x4a9184[_0xbf3e('0x17e')]||0x5dc;_0x33abb9[_0xbf3e('0x17f')]=_0x4a9184[_0xbf3e('0x180')]||0x320;_0x33abb9['XMD-AMDTOTALANALYSISTIME']=_0x4a9184[_0xbf3e('0x181')]||0x1388;_0x33abb9[_0xbf3e('0x182')]=_0x4a9184[_0xbf3e('0x183')]||0x64;_0x33abb9[_0xbf3e('0x184')]=_0x4a9184[_0xbf3e('0x185')]||0x32;_0x33abb9['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x4a9184[_0xbf3e('0x186')]||0x3;_0x33abb9['XMD-AMDSILENCETHRESHOLD']=_0x4a9184[_0xbf3e('0x187')]||0x100;_0x33abb9[_0xbf3e('0x188')]=_0x4a9184['dialAMDMaximumWordLength']||0x1388;}if(_0x4a9184[_0xbf3e('0x54')]==='outbound'){_0x33abb9[_0xbf3e('0x189')]=_0x578624['VoiceQueueId'];}else{_0x33abb9['XMD-CAMPAIGNID']=_0x578624['CampaignId'];}for(var _0x39491e in _0x578624[_0xbf3e('0x173')]){if(_0x578624[_0xbf3e('0x173')][_0xbf3e('0xa0')](_0x39491e)){if(isNotNull(_0x578624[_0xbf3e('0x173')][_0x39491e])&&_0x39491e!=='id'&&_0x39491e!==_0xbf3e('0x18a')&&_0x39491e!==_0xbf3e('0x18b')&&_0x39491e!==_0xbf3e('0x18c')){_0x33abb9[util[_0xbf3e('0x82')](_0xbf3e('0x18d'),_0xbf3e('0x18e'),_[_0xbf3e('0x18f')](_0x39491e))]=_0x578624[_0xbf3e('0x173')][_0x39491e];}}}var _0x3e131b=_0x39217a[_0xbf3e('0xdc')](_0x4a9184[_0xbf3e('0x7f')])?getCallerId(_0x4a9184['Trunk']['callerid'],_0x4a9184['dialOriginateCallerIdName'],_0x4a9184[_0xbf3e('0x190')]>0x0?getCallerIdRandom(_0x4a9184[_0xbf3e('0x191')],_0x4a9184['dialRandomLastDigitCallerIdNumber']):_0x4a9184[_0xbf3e('0x191')]):getCallerId(_[_0xbf3e('0xdf')](_0x4a9184[_0xbf3e('0x144')])?_0x4a9184[_0xbf3e('0x7f')][_0xbf3e('0x81')]:_0x4a9184[_0xbf3e('0x144')]['callerid'],_0x4a9184['dialOriginateCallerIdName'],_0x4a9184[_0xbf3e('0x190')]>0x0?getCallerIdRandom(_0x4a9184[_0xbf3e('0x191')],_0x4a9184[_0xbf3e('0x190')]):_0x4a9184['dialOriginateCallerIdNumber']);if(_0x3e131b){_0x33abb9[_0xbf3e('0x192')]=_0x39217a['actions'][_0x30f6d4][_0xbf3e('0x193')]=extractCalleridName(_0x3e131b);_0x33abb9[_0xbf3e('0x194')]=_0x39217a[_0xbf3e('0x127')][_0x30f6d4]['originatecalleridnum']=extractCalleridNumber(_0x3e131b);}return ami[_0xbf3e('0xb4')]({'actionid':_0x30f6d4,'action':'originate','channel':_0x39217a[_0xbf3e('0xdc')](_0x4a9184[_0xbf3e('0x7f')])?util['format'](_0xbf3e('0x195'),_0x4a9184['Trunk'][_0xbf3e('0x44')],isNotNull(_0x4a9184[_0xbf3e('0x65')])?_0x4a9184['dialPrefix'][_0xbf3e('0x196')]()||'':'',_0x4a9184[_0xbf3e('0x197')]>0x0?_0x578624[_0xbf3e('0x173')]['phone'][_0xbf3e('0x198')](_0x4a9184[_0xbf3e('0x197')]):_0x578624[_0xbf3e('0x173')]['phone']):util[_0xbf3e('0x82')](_0xbf3e('0x195'),_[_0xbf3e('0xdf')](_0x4a9184[_0xbf3e('0x144')])?_0x4a9184[_0xbf3e('0x7f')][_0xbf3e('0x44')]:_0x4a9184[_0xbf3e('0x144')][_0xbf3e('0x44')],isNotNull(_0x4a9184[_0xbf3e('0x65')])?_0x4a9184['dialPrefix'][_0xbf3e('0x196')]()||'':'',_0x4a9184[_0xbf3e('0x197')]>0x0?_0x578624[_0xbf3e('0x173')][_0xbf3e('0x174')][_0xbf3e('0x198')](_0x4a9184[_0xbf3e('0x197')]):_0x578624[_0xbf3e('0x173')][_0xbf3e('0x174')]),'callerid':_0x3e131b,'Exten':_0xbf3e('0xe3'),'Context':_0xbf3e('0x199'),'Priority':'1','variable':_0x33abb9,'timeout':(_0x4a9184[_0xbf3e('0x64')]||0x1e)*0x3e8,'async':!![],'channelid':_0x30f6d4})[_0xbf3e('0xc3')](function(_0x1348a9){return _0x2da042(_0x1348a9);})[_0xbf3e('0xb7')](function(_0x424a9a){_0x4a9184['outboundOriginateFailureCallsDay']+=0x1;var _0xabb304=new History(_0x39217a[_0xbf3e('0x127')][_0x30f6d4]);logger[_0xbf3e('0x9d')](util[_0xbf3e('0x82')](_0xbf3e('0x19a'),JSON['stringify'](_0x424a9a)));_0xabb304['state']=0xe;_0xabb304['statedesc']=_0xbf3e('0x19b');_0xabb304[_0xbf3e('0xb0')]=moment()[_0xbf3e('0x82')](_0xbf3e('0x100'));_0xabb304[_0xbf3e('0xaf')]=_0xabb304['starttime'];_0x39217a[_0xbf3e('0xd1')](_0xabb304)['catch'](loggerCatch(_0xbf3e('0x19c')));_0x39217a[_0xbf3e('0xcf')](_0xabb304)[_0xbf3e('0xb7')](loggerCatch('[originate][error]'))[_0xbf3e('0x1f')](function(){delete _0x39217a['actions'][_0x30f6d4];return _0x5e503e(msgResponse(_0xbf3e('0x171'),_0xbf3e('0x4e'),_0xbf3e('0x19d')));});});});};Dialer['prototype'][_0xbf3e('0x36')]=function(_0x3e4578){var _0x474cc7=this['actions'][_0x3e4578[_0xbf3e('0x129')]];var _0x439c3c=this;if(_0x474cc7){delete this['actions'][_0x3e4578[_0xbf3e('0x129')]];_0x474cc7[_0xbf3e('0x19e')]=moment()[_0xbf3e('0x82')](_0xbf3e('0x100'));var _0x8522c3=_0x474cc7['type']===_0xbf3e('0x99')?this[_0xbf3e('0x23')][_0x474cc7[_0xbf3e('0xbb')]]:this[_0xbf3e('0x22')][_0x474cc7['getQueue']()];if(!this[_0xbf3e('0xda')](_0x3e4578[_0xbf3e('0x19f')])){this[_0xbf3e('0xb9')](_0x8522c3);return this[_0xbf3e('0x1a0')](_0x474cc7,_0x8522c3,_0x3e4578)[_0xbf3e('0xc3')](function(_0x5c9af4){})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1a1')));}else{this['uniqueId'][_0x3e4578[_0xbf3e('0xeb')]]=_0x474cc7;}}};Dialer['prototype'][_0xbf3e('0x1a2')]=function(_0x3676ba,_0x2817d5,_0x5b325d){var _0xa4531d=new History(_0x2817d5);if(_0xa4531d[_0xbf3e('0xf2')]+_0xa4531d[_0xbf3e('0xf3')]+_0xa4531d['countnoanswerretry']+_0xa4531d[_0xbf3e('0xf5')]+_0xa4531d[_0xbf3e('0xf6')]+_0xa4531d[_0xbf3e('0xf7')]+_0xa4531d[_0xbf3e('0xee')]+_0xa4531d[_0xbf3e('0xf8')]>=_0x5b325d['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3676ba){case 0x3:if(_0xa4531d[_0xbf3e('0xf4')]>=_0x5b325d['dialNoAnswerMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0xa4531d[_0xbf3e('0xf4')]+=0x1,'scheduledat':moment()[_0xbf3e('0xfd')](_0x5b325d[_0xbf3e('0x1a3')],_0xbf3e('0xff'))[_0xbf3e('0x82')](_0xbf3e('0x100')),'ContactId':_0xa4531d['ContactId'],'ListId':_0xa4531d[_0xbf3e('0xd6')],'VoiceQueueId':_0xa4531d['VoiceQueueId']||undefined,'CampaignId':_0xa4531d[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1a4')));}break;case 0x5:if(_0xa4531d[_0xbf3e('0xf2')]>=_0x5b325d[_0xbf3e('0x1a5')]-0x1){return!![];}else{this[_0xbf3e('0xc7')]({'active':![],'countbusyretry':_0xa4531d[_0xbf3e('0xf2')]+=0x1,'scheduledat':moment()[_0xbf3e('0xfd')](_0x5b325d[_0xbf3e('0x1a6')],_0xbf3e('0xff'))['format'](_0xbf3e('0x100')),'ContactId':_0xa4531d[_0xbf3e('0xd5')],'ListId':_0xa4531d[_0xbf3e('0xd6')],'VoiceQueueId':_0xa4531d[_0xbf3e('0x107')]||undefined,'CampaignId':_0xa4531d[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1a7')));}break;case 0x8:if(_0xa4531d[_0xbf3e('0xf3')]>=_0x5b325d[_0xbf3e('0x1a8')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0xa4531d[_0xbf3e('0xf3')]+=0x1,'scheduledat':moment()[_0xbf3e('0xfd')](_0x5b325d['dialCongestionRetryFrequency'],_0xbf3e('0xff'))[_0xbf3e('0x82')](_0xbf3e('0x100')),'ContactId':_0xa4531d[_0xbf3e('0xd5')],'ListId':_0xa4531d[_0xbf3e('0xd6')],'VoiceQueueId':_0xa4531d['VoiceQueueId']||undefined,'CampaignId':_0xa4531d['CampaignId']||undefined})['catch'](loggerCatch(_0xbf3e('0x1a9')));}break;case 0x0:if(_0xa4531d[_0xbf3e('0xf5')]>=_0x5b325d[_0xbf3e('0x1aa')]-0x1){return!![];}else{this[_0xbf3e('0xc7')]({'active':![],'countnosuchnumberretry':_0xa4531d[_0xbf3e('0xf5')]+=0x1,'scheduledat':moment()[_0xbf3e('0xfd')](_0x5b325d[_0xbf3e('0x1ab')],'minutes')[_0xbf3e('0x82')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa4531d['ContactId'],'ListId':_0xa4531d[_0xbf3e('0xd6')],'VoiceQueueId':_0xa4531d[_0xbf3e('0x107')]||undefined,'CampaignId':_0xa4531d[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1ac')));}break;case 0xa:if(_0xa4531d[_0xbf3e('0xf6')]>=_0x5b325d[_0xbf3e('0x11c')]-0x1){return!![];}else{this[_0xbf3e('0xc7')]({'active':![],'countdropretry':_0xa4531d['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x5b325d['dialDropRetryFrequency'],'minutes')[_0xbf3e('0x82')](_0xbf3e('0x100')),'ContactId':_0xa4531d[_0xbf3e('0xd5')],'ListId':_0xa4531d['ListId'],'VoiceQueueId':_0xa4531d[_0xbf3e('0x107')]||undefined,'CampaignId':_0xa4531d[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x11d')));}break;case 0xb:if(_0xa4531d['countabandonedretry']>=_0x5b325d[_0xbf3e('0x124')]-0x1){return!![];}else{this[_0xbf3e('0xc7')]({'active':![],'countabandonedretry':_0xa4531d['countabandonedretry']+=0x1,'scheduledat':moment()[_0xbf3e('0xfd')](_0x5b325d['dialAbandonedRetryFrequency'],_0xbf3e('0xff'))['format'](_0xbf3e('0x100')),'ContactId':_0xa4531d[_0xbf3e('0xd5')],'ListId':_0xa4531d[_0xbf3e('0xd6')],'VoiceQueueId':_0xa4531d['VoiceQueueId']||undefined,'CampaignId':_0xa4531d['CampaignId']||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x126')));}break;case 0x13:if(_0xa4531d['countmachineretry']>=_0x5b325d[_0xbf3e('0xfb')]-0x1){return!![];}else{this[_0xbf3e('0xc7')]({'active':![],'countmachineretry':_0xa4531d[_0xbf3e('0xee')]+=0x1,'scheduledat':moment()[_0xbf3e('0xfd')](_0x5b325d[_0xbf3e('0xfe')],'minutes')[_0xbf3e('0x82')](_0xbf3e('0x100')),'ContactId':_0xa4531d['ContactId'],'ListId':_0xa4531d['ListId'],'VoiceQueueId':_0xa4531d[_0xbf3e('0x107')]||undefined,'CampaignId':_0xa4531d[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x102')));}break;case 0x14:if(_0xa4531d[_0xbf3e('0xf8')]>=_0x5b325d[_0xbf3e('0x1ad')]-0x1){return!![];}else{this[_0xbf3e('0xc7')]({'active':![],'countagentrejectretry':_0xa4531d['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xbf3e('0xfd')](_0x5b325d['dialAgentRejectRetryFrequency'],_0xbf3e('0xff'))[_0xbf3e('0x82')](_0xbf3e('0x100')),'ContactId':_0xa4531d[_0xbf3e('0xd5')],'ListId':_0xa4531d[_0xbf3e('0xd6')],'VoiceQueueId':_0xa4531d[_0xbf3e('0x107')]||undefined,'CampaignId':_0xa4531d[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1ae')));}break;default:return!![];}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x1a0')]=function(_0x19afd9,_0x3ba2c6,_0x258f40){var _0xdbd4f0=this;var _0x37e7dd=new History(_0x19afd9);return new BPromise(function(_0x5ef604,_0x2215c0){if(_[_0xbf3e('0x42')](_0x3ba2c6)&&_0xbf3e('0x170')!==typeof _0x3ba2c6){return _0x2215c0(msgResponse(_0xbf3e('0x1af'),'Failure',_0xbf3e('0x1b0')));}if(_['isUndefined'](_0x258f40)&&_0xbf3e('0x170')!==typeof _0x258f40){return _0x2215c0(msgResponse('[callProgressDetecting]',_0xbf3e('0x14a'),_0xbf3e('0x1b1')));}switch(_0x258f40[_0xbf3e('0x110')]){case'0':_0x3ba2c6[_0xbf3e('0x6d')]+=0x1;_0x37e7dd['state']=0x0;_0x37e7dd[_0xbf3e('0xae')]='NoSuchNumber';_0x37e7dd[_0xbf3e('0xf5')]+=0x1;_0x37e7dd['countglobal']+=0x1;console[_0xbf3e('0x1b2')](_0xbf3e('0x1b3'),util['buildObj'](_0x19afd9,_0xbf3e('0x1b4')));ami['emit'](_0xbf3e('0x1b5'),util[_0xbf3e('0x1b6')](_0x19afd9,'nosuchnumber'));_0xdbd4f0[_0xbf3e('0xd1')](_0x37e7dd)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xf1')));if(_0xdbd4f0[_0xbf3e('0x1a2')](0x0,_0x19afd9,_0x3ba2c6)){if(_0x37e7dd[_0xbf3e('0xf5')]>=_0x3ba2c6[_0xbf3e('0x1aa')]){_0xdbd4f0[_0xbf3e('0x106')](_0x37e7dd,_0x5ef604,_0x2215c0,'reason\x200\x20no\x20such\x20number....');}else{_0xdbd4f0['stateGlobal'](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1b7'));}}break;case'3':_0x3ba2c6['outboundNoAnswerCallsDay']+=0x1;_0x37e7dd[_0xbf3e('0xad')]=0x3;_0x37e7dd[_0xbf3e('0xae')]=_0xbf3e('0x1b8');_0x37e7dd['countnoanswerretry']+=0x1;_0x37e7dd[_0xbf3e('0xef')]+=0x1;console[_0xbf3e('0x1b2')]('EMITTING\x20status_noanswer\x20for',util[_0xbf3e('0x1b6')](_0x19afd9,'noanswer'));ami[_0xbf3e('0x53')](_0xbf3e('0x1b9'),util[_0xbf3e('0x1b6')](_0x19afd9,_0xbf3e('0x1ba')));_0xdbd4f0['createHistory'](_0x37e7dd)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1bb')));if(_0xdbd4f0[_0xbf3e('0x1a2')](0x3,_0x19afd9,_0x3ba2c6)){if(_0x37e7dd[_0xbf3e('0xf4')]>=_0x3ba2c6[_0xbf3e('0x1bc')]){_0xdbd4f0[_0xbf3e('0x106')](_0x37e7dd,_0x5ef604,_0x2215c0,'reason\x203\x20ringing\x20no\x20answer');}else{_0xdbd4f0[_0xbf3e('0xfa')](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1bd'));}}break;case'5':_0x3ba2c6[_0xbf3e('0x69')]+=0x1;_0x37e7dd[_0xbf3e('0xad')]=0x5;_0x37e7dd[_0xbf3e('0xae')]=_0xbf3e('0x1be');_0x37e7dd[_0xbf3e('0xf2')]+=0x1;_0x37e7dd['countglobal']+=0x1;console['log']('EMITTING\x20status_busy\x20for',util[_0xbf3e('0x1b6')](_0x19afd9,_0xbf3e('0x1bf')));ami['emit'](_0xbf3e('0x1c0'),util[_0xbf3e('0x1b6')](_0x19afd9,_0xbf3e('0x1bf')));_0xdbd4f0['createHistory'](_0x37e7dd)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1c1')));if(_0xdbd4f0['checkRetriveMax'](0x5,_0x19afd9,_0x3ba2c6)){if(_0x37e7dd['countbusyretry']>=_0x3ba2c6[_0xbf3e('0x1a5')]){_0xdbd4f0[_0xbf3e('0x106')](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1c2'));}else{_0xdbd4f0['stateGlobal'](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1c2'));}}break;case'8':_0x3ba2c6[_0xbf3e('0x1c3')]+=0x1;_0x37e7dd[_0xbf3e('0xad')]=0x8;_0x37e7dd[_0xbf3e('0xae')]=_0xbf3e('0x1c4');_0x37e7dd[_0xbf3e('0xf3')]+=0x1;_0x37e7dd[_0xbf3e('0xef')]+=0x1;_0xdbd4f0[_0xbf3e('0xd1')](_0x37e7dd)[_0xbf3e('0xb7')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xdbd4f0[_0xbf3e('0x1a2')](0x8,_0x19afd9,_0x3ba2c6)){if(_0x37e7dd[_0xbf3e('0xf3')]>=_0x3ba2c6[_0xbf3e('0x1a8')]){_0xdbd4f0[_0xbf3e('0x106')](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1c5'));}else{_0xdbd4f0[_0xbf3e('0xfa')](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1c5'));}}break;case'11':_0x3ba2c6[_0xbf3e('0x1c6')]+=0x1;_0x37e7dd[_0xbf3e('0xad')]=0xb;_0x37e7dd[_0xbf3e('0xae')]='Abandoned';_0x37e7dd['countabandonedretry']+=0x1;_0x37e7dd[_0xbf3e('0xef')]+=0x1;_0xdbd4f0[_0xbf3e('0xd1')](_0x37e7dd)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1c7')));if(_0xdbd4f0[_0xbf3e('0x1a2')](0xb,_0x19afd9,_0x3ba2c6)){if(_0x37e7dd['countabandonedretry']>=_0x3ba2c6[_0xbf3e('0x124')]){_0xdbd4f0[_0xbf3e('0x106')](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1c8'));}else{_0xdbd4f0[_0xbf3e('0xfa')](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1c8'));}}break;case'20':_0x3ba2c6[_0xbf3e('0x6f')]+=0x1;_0x37e7dd[_0xbf3e('0xad')]=0x14;_0x37e7dd['statedesc']='AgentReject';_0x37e7dd[_0xbf3e('0xf8')]+=0x1;_0x37e7dd[_0xbf3e('0xef')]+=0x1;_0xdbd4f0[_0xbf3e('0xd1')](_0x37e7dd)[_0xbf3e('0xb7')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0xdbd4f0['checkRetriveMax'](0x14,_0x19afd9,_0x3ba2c6)){if(_0x37e7dd[_0xbf3e('0xf8')]>=_0x3ba2c6[_0xbf3e('0x1ad')]){_0xdbd4f0[_0xbf3e('0x106')](_0x37e7dd,_0x5ef604,_0x2215c0,'reason\x2020\x20agentreject');}else{_0xdbd4f0[_0xbf3e('0xfa')](_0x37e7dd,_0x5ef604,_0x2215c0,_0xbf3e('0x1c9'));}}break;default:_0x3ba2c6[_0xbf3e('0x70')]+=0x1;_0x37e7dd[_0xbf3e('0xad')]=0xc;_0x37e7dd[_0xbf3e('0xae')]=_0x258f40['reason'];_0xdbd4f0['createHistory'](_0x37e7dd)[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1ca')));if(_0xdbd4f0['checkRetriveMax'](_0x258f40[_0xbf3e('0x110')],_0x19afd9,_0x3ba2c6)){if(_0x37e7dd[_0xbf3e('0xf2')]+_0x37e7dd[_0xbf3e('0xf3')]+_0x37e7dd[_0xbf3e('0xf4')]+_0x37e7dd['countnosuchnumberretry']+_0x37e7dd[_0xbf3e('0xf6')]+_0x37e7dd[_0xbf3e('0xf7')]+_0x37e7dd[_0xbf3e('0xee')]+_0x37e7dd[_0xbf3e('0xf8')]>=_0x3ba2c6['dialGlobalMaxRetry']){_0xdbd4f0[_0xbf3e('0xfa')](_0x37e7dd,_0x5ef604,_0x2215c0,_0x258f40['reason']);}else{_0xdbd4f0[_0xbf3e('0x106')](_0x37e7dd,_0x5ef604,_0x2215c0,_0x258f40['reason']);}}}});};Dialer[_0xbf3e('0x1c')]['stateGlobal']=function(_0x3bfcaa,_0x292225,_0x10dee5,_0x22582a){var _0x37bc10=new Final(_0x3bfcaa);_0x37bc10[_0xbf3e('0xad')]=0xf;_0x37bc10[_0xbf3e('0xae')]=_0xbf3e('0x1cb');this[_0xbf3e('0x106')](_0x37bc10,_0x292225,_0x10dee5,_0x22582a);};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x106')]=function(_0x4c97e7,_0x3b42a3,_0xf499b,_0x220e30){this['moveContactManagedDialer'](_0x4c97e7)['then'](function(_0x1cd03d){return _0x3b42a3(msgResponse(_0xbf3e('0x1af'),'Success',_0x220e30));})['catch'](function(_0x62e1bd){return _0xf499b(msgResponse(_0xbf3e('0x1cc'),_0xbf3e('0x14a'),_0xbf3e('0x1cd')));});};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x9')]=function(_0x547b0e){var _0x41550c=this;var _0x526818=_0x547b0e[_0xbf3e('0x1ce')]/0x64;var _0x5a7084=_0x547b0e[_0xbf3e('0x6b')]/(_0x547b0e[_0xbf3e('0x6b')]+_0x547b0e['outboundAnswerCallsDay']);var _0x3c66ba=Math[_0xbf3e('0x1cf')](_0x547b0e[_0xbf3e('0x1d0')]*(_0x547b0e[_0xbf3e('0x1d1')]/0x64));var _0x2804c3=Math[_0xbf3e('0x1cf')](_0x547b0e[_0xbf3e('0x1d0')]*(_0x547b0e[_0xbf3e('0x1d2')]/0x64));var _0x25e03c=_0x547b0e['available']+_0x547b0e['talking'];var _0x3f6e95=Math[_0xbf3e('0x1d3')](_0x547b0e[_0xbf3e('0x7b')]*_0x547b0e['erlangAbandonmentRate']*_0x547b0e[_0xbf3e('0x76')]*_0x547b0e['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x547b0e['startProgressive'])){if(!_['isUndefined'](_0x547b0e[_0xbf3e('0x2b')])){_0x547b0e[_0xbf3e('0x2b')]=undefined;loggerPredictive[_0xbf3e('0x9d')](_0xbf3e('0x1d4'),_0xbf3e('0x1d5'));}if(!_[_0xbf3e('0x42')](_0x547b0e['handlePredictive'])){loggerPredictive['error'](_0xbf3e('0x1d4'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x547b0e[_0xbf3e('0x97')]);_0x547b0e[_0xbf3e('0x97')]=undefined;}_0x547b0e[_0xbf3e('0x2c')]=moment()['format'](_0xbf3e('0x100'));loggerPredictive[_0xbf3e('0x86')](_0x547b0e['name'],_0xbf3e('0x1d6'),_0x547b0e[_0xbf3e('0x2c')]);this['handlePower'](_0x547b0e,0x1);}else if(ifInterval(_0x547b0e[_0xbf3e('0x1d7')],_0x547b0e[_0xbf3e('0x2c')])){this[_0xbf3e('0x160')](_0x547b0e,0x1);loggerPredictiveCalls[_0xbf3e('0x86')]('[startMethodPredictive][StartProgressive][Loop]',_0x547b0e['startProgressive'],_0x547b0e['name']);_0x547b0e[_0xbf3e('0x7b')]=0x0;_0x547b0e[_0xbf3e('0x75')]=0x0;}else if(_0x526818<_0x5a7084&&_0x547b0e[_0xbf3e('0x1d8')]===_0xbf3e('0x1d9')){freeVariablesPredictive(_0x547b0e);loggerPredictive[_0xbf3e('0x86')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x5a7084,_0xbf3e('0x2c'),_0x547b0e[_0xbf3e('0x44')]);}else if(_0x3f6e95<_0x547b0e[_0xbf3e('0x75')]&&_0x547b0e[_0xbf3e('0x1d8')]===_0xbf3e('0x1d9')){freeVariablesPredictive(_0x547b0e);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x1da'),_0xbf3e('0x1db'),_0x3f6e95,_0xbf3e('0x1dc'),_0x547b0e[_0xbf3e('0x75')],_0xbf3e('0x2c'),_0x547b0e['name']);}else if(!ifInterval(_0x547b0e[_0xbf3e('0x1d7')],_0x547b0e[_0xbf3e('0x2c')])&&_[_0xbf3e('0x42')](_0x547b0e[_0xbf3e('0x2b')])&&!_[_0xbf3e('0x42')](_0x547b0e[_0xbf3e('0x2c')])){_0x547b0e[_0xbf3e('0x2b')]=moment()['format'](_0xbf3e('0x100'));loggerPredictive[_0xbf3e('0x86')](_0x547b0e[_0xbf3e('0x44')],_0xbf3e('0x1dd'),_0x547b0e['startPredictive']);this[_0xbf3e('0x1de')](_0x547b0e[_0xbf3e('0x1d7')])[_0xbf3e('0xc3')](this[_0xbf3e('0x1df')](_0x547b0e))[_0xbf3e('0xc3')](mergeDataErlangB(_0x547b0e))[_0xbf3e('0xc3')](this[_0xbf3e('0x1e0')](_0x547b0e))['catch'](loggerCatchPredictive(_0xbf3e('0x1e1'),_0x547b0e));}else if(!ifInterval(_0x547b0e[_0xbf3e('0x1d7')],_0x547b0e[_0xbf3e('0x2b')])){_0x547b0e[_0xbf3e('0x75')]=0x0;_0x547b0e[_0xbf3e('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbf3e('0x86')](_0x547b0e[_0xbf3e('0x44')],'recalculate\x20predictive\x20at',_0x547b0e[_0xbf3e('0x2b')]);clearInterval(_0x547b0e[_0xbf3e('0x97')]);_0x547b0e[_0xbf3e('0x97')]=undefined;this[_0xbf3e('0x1de')](_0x547b0e[_0xbf3e('0x1d7')])[_0xbf3e('0xc3')](this[_0xbf3e('0x1df')](_0x547b0e))['then'](mergeDataErlangB(_0x547b0e))[_0xbf3e('0xc3')](this[_0xbf3e('0x1e0')](_0x547b0e))[_0xbf3e('0xb7')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x547b0e));}else if(_0x547b0e['predictiveIntervalAvailable']&&_0x25e03c<_0x547b0e[_0xbf3e('0x1d0')]-_0x2804c3){freeVariablesPredictive(_0x547b0e);loggerPredictive[_0xbf3e('0x86')](_0x547b0e[_0xbf3e('0x44')],_0xbf3e('0x1e2'),_0x25e03c,_0xbf3e('0x1e3'),_0x547b0e[_0xbf3e('0x1d0')],'-',_0x2804c3,'=',_0x547b0e['predictiveIntervalAvailable']-_0x2804c3,')');}else if(_0x547b0e[_0xbf3e('0x1d0')]&&_0x25e03c>_0x547b0e[_0xbf3e('0x1d0')]+_0x3c66ba){freeVariablesPredictive(_0x547b0e);loggerPredictive['info'](_0x547b0e[_0xbf3e('0x44')],_0xbf3e('0x1e2'),_0x25e03c,')\x20are\x20more\x20than\x20threshold\x20(',_0x547b0e['predictiveIntervalAvailable'],'+',_0x3c66ba,'=',_0x547b0e['predictiveIntervalAvailable']+_0x3c66ba,')');}};Dialer['prototype']['getDataPredictive']=function(_0x516957){var _0x1fbb42=this;return function(_0x4c73da){return new BPromise(function(_0x5d02d1,_0x17601d){_[_0xbf3e('0x95')](_0x516957,_0x4c73da[0x0]);if(checkGetDataPredictive(_0x4c73da[0x0])){var _0x30adf8=_0x516957['predictiveIntervalAvailable']=_0x516957[_0xbf3e('0x5d')]+_0x516957['available'];var _0x2c3064=_0x516957[_0xbf3e('0x1d7')]*0x3c;var _0x2328d3=_0x4c73da[0x0][_0xbf3e('0x72')]+_0x4c73da[0x0]['predictiveIntervalAvgHoldtime'];var _0x2f3549=(_0x4c73da[0x0][_0xbf3e('0x71')]+_0x4c73da[0x0][_0xbf3e('0x89')]+_0x4c73da[0x0][_0xbf3e('0x73')])/_0x4c73da[0x0][_0xbf3e('0x79')];_0x516957['predictiveIntervalHitRate']=_0x2f3549>0x0?_0x2f3549:0x1;switch(_0x516957[_0xbf3e('0x1d8')]){case _0xbf3e('0x1d9'):var _0x5bc9a7=_0x516957[_0xbf3e('0x1ce')]/0x64;return _0x1fbb42[_0xbf3e('0x1e4')](_0x30adf8,_0x2c3064,_0x2328d3,_0x2f3549,_0x5bc9a7)[_0xbf3e('0xc3')](function(_0x2ac7c7){return _0x5d02d1(_0x2ac7c7);});case _0xbf3e('0x1e5'):var _0x8ba339=_0x516957[_0xbf3e('0x1ce')]/0x64;return _0x1fbb42[_0xbf3e('0x1e6')](_0x30adf8,_0x2c3064,_0x2328d3,_0x2f3549,_0x8ba339)[_0xbf3e('0xc3')](function(_0x7838b){return _0x5d02d1(_0x7838b);});default:return _0x17601d(msgResponse('[getDataPredictive]',_0xbf3e('0x14a'),_0xbf3e('0x1e7')));}}else{return _0x17601d(msgResponse(_0xbf3e('0x1e8'),_0xbf3e('0x14a'),'check\x20failure'));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x3e5c57){var _0x46e184=this;return function(_0x422b34){return new BPromise(function(_0x4fe845,_0x1780c6){_['merge'](_0x3e5c57,_0x422b34[0x0]);if(checkGetDataPredictive(_0x422b34[0x0])){loggerPredictive['info'](JSON['stringify'](_0x422b34[0x0]));if(_0x3e5c57[_0xbf3e('0x1d8')]===_0xbf3e('0x1d9')){return _0x46e184[_0xbf3e('0xcd')](_0x3e5c57['id'])[_0xbf3e('0xc3')](function(_0x33d431){var _0x725b56=_0x3e5c57[_0xbf3e('0x166')]-_0x33d431[0x0]['outboundQueuePauses'];var _0x38dbc6=_0x3e5c57[_0xbf3e('0x1d7')]*0x3c;var _0x5dd2a1=_0x422b34[0x0]['predictiveIntervalAvgTalktime']+_0x422b34[0x0][_0xbf3e('0x8a')];var _0x52aaf0=(_0x422b34[0x0][_0xbf3e('0x71')]+_0x422b34[0x0][_0xbf3e('0x89')]+_0x422b34[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x422b34[0x0][_0xbf3e('0x79')];var _0x59edfe=_0x3e5c57[_0xbf3e('0x1ce')]/0x64;_0x3e5c57[_0xbf3e('0x78')]=_0x33d431[0x0][_0xbf3e('0x1e9')]||0x0;_0x3e5c57[_0xbf3e('0x76')]=_0x52aaf0>0x0?_0x52aaf0:0x1;return _0x46e184['abandonmentRate'](_0x725b56,_0x38dbc6,_0x5dd2a1,_0x52aaf0,_0x59edfe);})['then'](function(_0x991092){return _0x4fe845(_0x991092);})[_0xbf3e('0xb7')](function(_0x3a9017){return _0x1780c6(msgResponse('[CatchErlangB]',_0xbf3e('0x14a'),JSON[_0xbf3e('0x4f')](_0x3a9017)));});}if(_0x3e5c57[_0xbf3e('0x1d8')]===_0xbf3e('0x1e5')){return _0x46e184[_0xbf3e('0xcd')](_0x3e5c57['id'])[_0xbf3e('0xc3')](function(_0x28e90c){var _0x4d61a8=_0x3e5c57['loggedIn']-_0x28e90c[0x0][_0xbf3e('0x1e9')];var _0x480b3c=_0x3e5c57[_0xbf3e('0x1d7')]*0x3c;var _0x51f11e=_0x422b34[0x0][_0xbf3e('0x72')]+_0x422b34[0x0][_0xbf3e('0x8a')];var _0x1ee853=(_0x422b34[0x0][_0xbf3e('0x71')]+_0x422b34[0x0][_0xbf3e('0x89')]+_0x422b34[0x0][_0xbf3e('0x73')])/_0x422b34[0x0][_0xbf3e('0x79')];var _0x3c50f3=_0x3e5c57[_0xbf3e('0x1ce')]/0x64;_0x3e5c57[_0xbf3e('0x78')]=_0x28e90c[0x0]['outboundQueuePauses']||0x0;_0x3e5c57['predictiveIntervalHitRate']=_0x1ee853>0x0?_0x1ee853:0x1;return _0x46e184['busyFactor'](_0x4d61a8,_0x480b3c,_0x51f11e,_0x1ee853,_0x3c50f3);})[_0xbf3e('0xc3')](function(_0x306462){return _0x4fe845(_0x306462);})[_0xbf3e('0xb7')](function(_0x4c4c8f){return _0x1780c6(msgResponse(_0xbf3e('0x1ea'),_0xbf3e('0x14a'),JSON['stringify'](_0x4c4c8f)));});}}else{return _0x1780c6(msgResponse('[getDataPredictive]',_0xbf3e('0x14a'),_0xbf3e('0x1eb')));}});};};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x1e0')]=function(_0x189e2c){var _0x409b80=this;return function(){var _0xfac8c3=0x0;var _0x1ba93d=Math[_0xbf3e('0x1d3')](_0x189e2c[_0xbf3e('0x7c')]*0x3e8);if(_0x1ba93d>0x0){_0x1ba93d=_0x1ba93d<0x64?0x64:_0x1ba93d;loggerPredictive[_0xbf3e('0x86')](_0x189e2c[_0xbf3e('0x44')],'one\x20call\x20every:',_0x1ba93d,_0xbf3e('0x50'));_0x189e2c[_0xbf3e('0x97')]=setInterval(function(){_0x409b80[_0xbf3e('0x97')](_0x189e2c);loggerPredictiveCalls[_0xbf3e('0x86')](_0xbf3e('0x1ec'),_0xfac8c3+=0x1);},_0x1ba93d);}else{loggerPredictive[_0xbf3e('0x86')](_0x189e2c[_0xbf3e('0x44')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype']['checkContactBlack']=function(_0x5e5209,_0x1e1192){var _0x2e20bc=this;return function(_0x4ad355){if(_[_0xbf3e('0x4c')](_0x4ad355)){if(_[_0xbf3e('0xdf')](_0x1e1192['UserId'])||!_0x1e1192[_0xbf3e('0x1ed')]){if(_0x5e5209[_0xbf3e('0x15f')]===_0xbf3e('0x162')){_0x5e5209[_0xbf3e('0x12f')]=_['isUndefined'](_0x5e5209[_0xbf3e('0x12f')])?!![]:_0x5e5209[_0xbf3e('0x12f')];var _0x88c187=uuid['v4']();_0x2e20bc['actions'][_0x88c187]=new Action(_0x5e5209,_0x1e1192,_0x88c187);loggerBooked[_0xbf3e('0x86')](_0xbf3e('0x1ee'),_0x88c187,_0xbf3e('0x1ef'),JSON[_0xbf3e('0x4f')](_0x5e5209[_0xbf3e('0x12f')]),_0xbf3e('0x1f0'),_0x5e5209[_0xbf3e('0x44')]);if(_0x5e5209[_0xbf3e('0x12f')]){_0x5e5209[_0xbf3e('0x12f')]=![];_0x2e20bc[_0xbf3e('0x2e')][_0x2e20bc[_0xbf3e('0x127')][_0x88c187][_0xbf3e('0xbb')]]=[];ami[_0xbf3e('0xb4')]({'actionid':_0x88c187,'action':_0xbf3e('0x1f1'),'queue':_0x5e5209[_0xbf3e('0x44')]})[_0xbf3e('0xb7')](function(_0x1fbc66){_0x2e20bc[_0xbf3e('0xb9')](_0x5e5209);_0x2e20bc[_0xbf3e('0xc7')]({'active':![],'ContactId':_0x2e20bc[_0xbf3e('0x127')][_0x88c187][_0xbf3e('0xd5')],'ListId':_0x2e20bc[_0xbf3e('0x127')][_0x88c187][_0xbf3e('0xd6')],'VoiceQueueId':_0x2e20bc[_0xbf3e('0x127')][_0x88c187][_0xbf3e('0x107')]||undefined,'CampaignId':_0x2e20bc[_0xbf3e('0x127')][_0x88c187]['CampaignId']||undefined})['catch'](loggerCatch(_0xbf3e('0x1f2')));delete _0x2e20bc[_0xbf3e('0x127')][_0x88c187];});}else{loggerBooked[_0xbf3e('0x86')](_0xbf3e('0x1f3'),JSON['stringify'](_0x5e5209[_0xbf3e('0x12f')]),_0xbf3e('0x1f0'),_0x5e5209[_0xbf3e('0x44')]);_0x2e20bc['updateOriginated'](_0x5e5209);_0x2e20bc[_0xbf3e('0xc7')]({'active':![],'ContactId':_0x2e20bc['actions'][_0x88c187]['ContactId'],'ListId':_0x2e20bc[_0xbf3e('0x127')][_0x88c187][_0xbf3e('0xd6')],'VoiceQueueId':_0x2e20bc['actions'][_0x88c187]['VoiceQueueId']||undefined,'CampaignId':_0x2e20bc[_0xbf3e('0x127')][_0x88c187][_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1f2')));delete _0x2e20bc[_0xbf3e('0x127')][_0x88c187];}}else{return _0x2e20bc[_0xbf3e('0x16f')](_0x5e5209,_0x1e1192);}}else{if(getDiff(_0x1e1192['scheduledat'])<_0x5e5209[_0xbf3e('0x1f4')]*0x3c){if(_0x1e1192[_0xbf3e('0x1f5')]&&!_0x1e1192[_0xbf3e('0x1f5')][_0xbf3e('0x1f6')]){_0x2e20bc[_0xbf3e('0x21')][_0xbf3e('0x133')](_0x1e1192['id'])[_0xbf3e('0x1f')](function(){_0x2e20bc[_0xbf3e('0xb9')](_0x5e5209);});}else{_0x2e20bc[_0xbf3e('0xc8')]({'active':![]},_0x1e1192['id'],0x1)['finally'](function(){console['log']('Contact\x20updated');_0x2e20bc[_0xbf3e('0xb9')](_0x5e5209);});}}else{_0x5e5209[_0xbf3e('0x6e')]+=0x1;_0x2e20bc[_0xbf3e('0xb9')](_0x5e5209);if(_0x5e5209['dialRecallInQueue']){_0x2e20bc[_0xbf3e('0xc7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1e1192[_0xbf3e('0xd5')],'ListId':_0x1e1192[_0xbf3e('0xd6')],'VoiceQueueId':_0x1e1192['VoiceQueueId']||undefined,'CampaignId':_0x1e1192[_0xbf3e('0x101')]||undefined})[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0x1f7')));_0x2e20bc[_0xbf3e('0xd1')](createObjHistory(_0x5e5209,_0x1e1192,_0xbf3e('0x1f8'),0x17,_0xbf3e('0x1f9')))[_0xbf3e('0xb7')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x2e20bc['saveInDb'](createObjHistory(_0x5e5209,_0x1e1192,_0xbf3e('0x1fa'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0xbf3e('0x1fb'));}}}}else{_0x5e5209['outboundBlacklistCallsDay']+=0x1;_0x2e20bc[_0xbf3e('0xe9')](createObjHistory(_0x5e5209,_0x1e1192,_0xbf3e('0x1fc'),0xd,_0xbf3e('0x1fd')),_0xbf3e('0x1fe'),_0xbf3e('0x1ff'));throw _0xbf3e('0x200');}};};Dialer['prototype']['handleIvr']=function(_0x5d13d3){var _0x2b66c1=this;var _0x5b62b5=[];var _0x251dff=_0x5d13d3[_0xbf3e('0x201')]-_0x5d13d3[_0xbf3e('0x7a')]-_0x5d13d3[_0xbf3e('0x202')];emitCampaignSummary(_0x5d13d3);if(_0x251dff>0x0){if(_0x251dff>this[_0xbf3e('0x26')]){_0x251dff=this[_0xbf3e('0x26')];}_0x5d13d3[_0xbf3e('0x202')]+=_0x251dff;this[_0xbf3e('0xcb')](_0x5d13d3['id'],_0x251dff,_0x5d13d3[_0xbf3e('0x203')])['then'](function(_0x1f9add){_0x5d13d3[_0xbf3e('0x202')]-=_0x251dff;_0x5d13d3['temp']=_0x5d13d3[_0xbf3e('0x202')]>0x0?_0x5d13d3['temp']:0x0;if(!checkContactEmpty(_0x1f9add)){_0x5d13d3['message']=_0xbf3e('0xa5');logger[_0xbf3e('0x86')](_0xbf3e('0x204')+_0x5d13d3[_0xbf3e('0x44')]);}else{_0x5d13d3[_0xbf3e('0x7a')]+=_0x1f9add['length'];_0x5d13d3[_0xbf3e('0x47')]=_0xbf3e('0x205');for(var _0x223ef8=0x0;_0x223ef8<_0x1f9add['length'];_0x223ef8+=0x1){_0x5d13d3[_0xbf3e('0x206')]+=0x1;if(_[_0xbf3e('0xdf')](_0x1f9add[_0x223ef8])||_[_0xbf3e('0xdf')](_0x1f9add[_0x223ef8][_0xbf3e('0x173')])||_[_0xbf3e('0xdf')](_0x1f9add[_0x223ef8][_0xbf3e('0x173')]['phone'])){_0x2b66c1['emptyContact']('[actionOriginate]\x20',_0x5d13d3,_0x1f9add[_0x223ef8]);}else{_0x2b66c1[_0xbf3e('0xc2')](_[_0xbf3e('0x131')](_0x1f9add[_0x223ef8],['CampaignId',_0xbf3e('0x207')]))['then'](_0x2b66c1['checkContactBlack'](_0x5d13d3,_0x1f9add[_0x223ef8]))[_0xbf3e('0xb7')](_0x2b66c1[_0xbf3e('0xd3')](_0xbf3e('0x208'),_0x5d13d3));}}}})['catch'](loggerGetContactDialer(_0xbf3e('0x209'),_0x5d13d3,_0x251dff));}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x160')]=function(_0x12307d,_0x4f7a2e){var _0x13fc92=this;var _0x412c7f=[];var _0x5d9afb=_0x4f7a2e>=0x1?_0x4f7a2e:0x1;var _0x5d16bc=[];if(_0x12307d[_0xbf3e('0x15f')]==='booked'){_0x5d9afb=0x1;}var _0x2957f8=Math[_0xbf3e('0x1d3')](_0x12307d[_0xbf3e('0x58')]*_0x5d9afb)-_0x12307d['originated']-_0x12307d['temp'];emitVoiceQueueSummary(_0x12307d);if(_0x12307d[_0xbf3e('0x20a')]>0x0){var _0x12f07a=_0x12307d[_0xbf3e('0x20a')]-_0x12307d[_0xbf3e('0x7a')]-_0x12307d[_0xbf3e('0x5d')]-_0x12307d[_0xbf3e('0x202')]-_0x12307d['pTalking'];if(_0x2957f8>_0x12f07a){_0x2957f8=_0x12f07a;}}if(_0x2957f8>0x0){if(_0x12307d['dialMethod']===_0xbf3e('0x162')){_0x2957f8=0x1;}if(_0x2957f8>this[_0xbf3e('0x26')]){_0x2957f8=this[_0xbf3e('0x26')];}_0x12307d[_0xbf3e('0x202')]+=_0x2957f8;for(var _0x580886 in this['agents']){if(this[_0xbf3e('0x24')][_0xbf3e('0xa0')](_0x580886)){if(this['agents'][_0x580886][_0xbf3e('0xad')]===_0xbf3e('0x20b')&&this['agents'][_0x580886][_0xbf3e('0xb5')]==='reachable'){_0x412c7f[_0xbf3e('0x152')](this[_0xbf3e('0x24')][_0x580886]['id']);}}}this['getContactDialer'](_0x12307d['id'],_0x412c7f,_0x2957f8,_0x12307d[_0xbf3e('0x203')])[_0xbf3e('0xc3')](function(_0x23d5d7){_0x12307d[_0xbf3e('0x202')]-=_0x2957f8;_0x12307d[_0xbf3e('0x202')]=_0x12307d[_0xbf3e('0x202')]>0x0?_0x12307d[_0xbf3e('0x202')]:0x0;if(!checkContactEmpty(_0x23d5d7)){_0x13fc92[_0xbf3e('0xbe')](_0x12307d)['then'](sendMessageReschedule(_0x12307d))[_0xbf3e('0xb7')](loggerCatch(_0xbf3e('0xbf')));}else{_0x12307d[_0xbf3e('0x7a')]+=_0x23d5d7['length'];_0x12307d[_0xbf3e('0x47')]=_0x12307d[_0xbf3e('0x15f')]===_0xbf3e('0x162')?_0xbf3e('0x17a'):_0xbf3e('0x205');for(var _0x355b0b=0x0;_0x355b0b<_0x23d5d7[_0xbf3e('0x137')];_0x355b0b+=0x1){if(_[_0xbf3e('0xdf')](_0x23d5d7[_0x355b0b])||_['isNil'](_0x23d5d7[_0x355b0b][_0xbf3e('0x173')])||_['isNil'](_0x23d5d7[_0x355b0b][_0xbf3e('0x173')]['phone'])){_0x13fc92[_0xbf3e('0x20c')](_0xbf3e('0x20d'),_0x12307d,_0x23d5d7[_0x355b0b]);}else{_0x13fc92[_0xbf3e('0xc0')](_['pick'](_0x23d5d7[_0x355b0b],[_0xbf3e('0x107'),_0xbf3e('0x207')]))[_0xbf3e('0xc3')](_0x13fc92[_0xbf3e('0x20e')](_0x12307d,_0x23d5d7[_0x355b0b]))[_0xbf3e('0xb7')](_0x13fc92[_0xbf3e('0xd3')]('[actionOriginate]\x20',_0x12307d));}}}})['catch'](loggerGetContactDialer(_0xbf3e('0x20f'),_0x12307d,_0x2957f8));}};Dialer['prototype'][_0xbf3e('0x97')]=function(_0x42b149){var _0x2c4f9c=this;if(_0x42b149[_0xbf3e('0x20a')]>0x0){var _0x5e98d6=_0x42b149['dialLimitQueue']-_0x42b149[_0xbf3e('0x7a')]-_0x42b149[_0xbf3e('0x5d')];if(_0x5e98d6>0x0){this[_0xbf3e('0x210')](_0x42b149);}else{loggerPredictiveCalls[_0xbf3e('0x86')](_0xbf3e('0x211'));}}else{this[_0xbf3e('0x210')](_0x42b149);}};Dialer[_0xbf3e('0x1c')][_0xbf3e('0x210')]=function(_0x288273){var _0x1da1ed=this;var _0x2b6fc3=[];_0x288273['originated']+=0x1;for(var _0x38cf31 in this[_0xbf3e('0x24')]){if(this[_0xbf3e('0x24')][_0xbf3e('0xa0')](_0x38cf31)){if(this[_0xbf3e('0x24')][_0x38cf31][_0xbf3e('0xad')]==='not_inuse'&&this[_0xbf3e('0x24')][_0x38cf31]['status']===_0xbf3e('0x212')){_0x2b6fc3[_0xbf3e('0x152')](this[_0xbf3e('0x24')][_0x38cf31]['id']);}}}this[_0xbf3e('0xca')](_0x288273['id'],_0x2b6fc3,0x1,_0x288273[_0xbf3e('0x203')])[_0xbf3e('0xc3')](function(_0x1a9185){if(!checkContactEmpty(_0x1a9185)){checkContactLowerLimitOriginate(_0x288273,0x1,0x0);_0x1da1ed['countReScheduled'](_0x288273)[_0xbf3e('0xc3')](sendMessageReschedule(_0x288273))[_0xbf3e('0xb7')](loggerCatch('[countReScheduled]\x20'));}else{_0x288273['message']=_0xbf3e('0x205');if(_['isNil'](_0x1a9185[0x0])||_[_0xbf3e('0xdf')](_0x1a9185[0x0][_0xbf3e('0x173')])||_[_0xbf3e('0xdf')](_0x1a9185[0x0][_0xbf3e('0x173')][_0xbf3e('0x174')])){_0x1da1ed['emptyContact'](_0xbf3e('0x20d'),_0x288273,_0x1a9185[0x0]);}else{_0x1da1ed[_0xbf3e('0xc0')](_[_0xbf3e('0x131')](_0x1a9185[0x0],[_0xbf3e('0x107'),_0xbf3e('0x207')]))[_0xbf3e('0xc3')](_0x1da1ed[_0xbf3e('0x20e')](_0x288273,_0x1a9185[0x0]))['catch'](_0x1da1ed['loggerHandler'](_0xbf3e('0x213'),_0x288273));}}})[_0xbf3e('0xb7')](loggerGetContactDialer(_0xbf3e('0x214'),_0x288273,0x1));emitVoiceQueueSummary(_0x288273);};Dialer['prototype'][_0xbf3e('0x1e4')]=function(_0x1a6590,_0x3d58ba,_0x145165,_0x134d87,_0x4fade0,_0xbcc8e6){loggerPredictive[_0xbf3e('0x86')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x215'),_0x1a6590);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x216'),_0x3d58ba);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x217'),_0x145165);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x218'),_0x134d87);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x219'),_0x4fade0);loggerPredictive['info'](_0xbf3e('0x8c'));return new BPromise(function(_0x3d4e8d,_0x4e402a){if(_0x1a6590<=0x0||isNaN(_0x1a6590)){return _0x4e402a(msgResponse(_0xbf3e('0x21a'),_0xbf3e('0x4e'),_0xbf3e('0x21b')+_0x1a6590));}if(_0x145165<=0x0||isNaN(_0x145165)){return _0x4e402a(msgResponse(_0xbf3e('0x21a'),'Error',_0xbf3e('0x21c')+_0x145165));}if(_0x134d87<=0x0||isNaN(_0x134d87)){return _0x4e402a(msgResponse(_0xbf3e('0x21a'),'Error',_0xbf3e('0x21d')+_0x134d87));}if(_0x3d58ba<=0x0||isNaN(_0x3d58ba)){return _0x4e402a(msgResponse(_0xbf3e('0x21a'),_0xbf3e('0x4e'),_0xbf3e('0x21e')+_0x3d58ba));}if(_0x4fade0<=0x0||isNaN(_0x4fade0)){return _0x4e402a(msgResponse('[abandonmentRate]',_0xbf3e('0x4e'),_0xbf3e('0x21f')+_0x4fade0));}_0xbcc8e6=_0xbcc8e6||0x0;var _0x291ebc=0x1/_0x145165;var _0x17ff69=0x0;var _0x2de6c7=0x0;var _0x49be0c=0x0;var _0x2ec33=0x0;for(var _0x57dfcf=0x0;_0x49be0c<_0x4fade0;_0x57dfcf+=0x1){_0x2de6c7=_0x57dfcf/_0x3d58ba;_0x17ff69=(_0x134d87*_0x2de6c7+_0xbcc8e6)/_0x291ebc;_0x49be0c=erlangb(_0x17ff69,_0x1a6590);_0x2ec33=_0x17ff69/_0x1a6590*(0x1-erlangb(_0x17ff69,_0x1a6590));}return _0x3d4e8d({'erlangCalls':_0x57dfcf,'erlangCallToSecond':_0x3d58ba/_0x57dfcf,'erlangAbandonmentRate':_0x49be0c,'erlangBusyFactor':_0x2ec33});});};Dialer['prototype'][_0xbf3e('0x1e6')]=function(_0x20e1e8,_0x2b06a9,_0x492358,_0x59fa04,_0x9799e1,_0x33b89a){loggerPredictive['info'](_0xbf3e('0x220'));loggerPredictive['info']('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',_0x20e1e8);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x216'),_0x2b06a9);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x217'),_0x492358);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x218'),_0x59fa04);loggerPredictive[_0xbf3e('0x86')](_0xbf3e('0x221'),_0x9799e1);loggerPredictive[_0xbf3e('0x86')]('---------------------------');return new BPromise(function(_0x217ee6,_0x1d0227){if(_0x20e1e8<=0x0||isNaN(_0x20e1e8)){return _0x1d0227(msgResponse('[busyFactor]',_0xbf3e('0x4e'),_0xbf3e('0x21b')+_0x20e1e8));}if(_0x492358<=0x0||isNaN(_0x492358)){return _0x1d0227(msgResponse(_0xbf3e('0x222'),_0xbf3e('0x4e'),_0xbf3e('0x21c')+_0x492358));}if(_0x59fa04<=0x0||isNaN(_0x59fa04)){return _0x1d0227(msgResponse(_0xbf3e('0x222'),'Error','p\x20=\x20'+_0x59fa04));}if(_0x2b06a9<=0x0||isNaN(_0x2b06a9)){return _0x1d0227(msgResponse(_0xbf3e('0x222'),_0xbf3e('0x4e'),'interval\x20=\x20'+_0x2b06a9));}if(_0x9799e1<=0x0||isNaN(_0x9799e1)){return _0x1d0227(msgResponse(_0xbf3e('0x222'),_0xbf3e('0x4e'),_0xbf3e('0x223')+_0x9799e1));}_0x33b89a=_0x33b89a||0x0;var _0x1393dd=0x1/_0x492358;var _0x4f40b3=0x0;var _0x231f9d=0x0;var _0x4d526f=0x0;var _0x3f91db=0x0;for(var _0x5061cc=0x0;_0x3f91db<_0x9799e1;_0x5061cc+=0x1){_0x231f9d=_0x5061cc/_0x2b06a9;_0x4f40b3=(_0x59fa04*_0x231f9d+_0x33b89a)/_0x1393dd;_0x4d526f=erlangb(_0x4f40b3,_0x20e1e8);_0x3f91db=_0x4f40b3/_0x20e1e8*(0x1-erlangb(_0x4f40b3,_0x20e1e8));}return _0x217ee6({'erlangCalls':_0x5061cc,'erlangCallToSecond':_0x2b06a9/_0x5061cc,'erlangAbandonmentRate':_0x4d526f,'erlangBusyFactor':_0x3f91db});});};module[_0xbf3e('0x224')]=Dialer;
\ No newline at end of file
+var _0xb658=['getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','merge','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerAgiCallsDay','state','statedesc','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','HangupInAMD','[syncHangupInAMDIvr][createHistory]','countnoanswerretry','countdropretry','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','dropreason','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','queueBooked','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','rrmemory','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','booked','Queue','method\x20not\x20recognized','dialActive','checkIsTrunkReachable','dialGlobalInterval','checkIfTimeIntervals','dialTimezone','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','dialPrefix','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','log','buildObj','nosuchnumber','custom:status_nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','NO\x20ANSWER\x20evt','NO\x20ANSWER\x20action','NO\x20ANSWER\x20history','noanswer','custom:status_noanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','EMITTING\x20status_busy\x20for','busy','[syncAgentComplete][createHistory][5]','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','agentBusyFactor','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','Contact\x20updated','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','--------\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','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','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\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','[busyFactor]','p\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','isEmpty','-----\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','info','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','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','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','diff','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','waiting','sendMessageOneNotActive','available','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','starttime','[uniqueid]','clearZombieChannels','enqueue','isNil','Action','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb658,0x15a));var _0x8b65=function(_0x14fdc0,_0x3fc782){_0x14fdc0=_0x14fdc0-0x0;var _0x4242b2=_0xb658[_0x14fdc0];return _0x4242b2;};'use strict';var util=require(_0x8b65('0x0'));var _=require('lodash');var BPromise=require(_0x8b65('0x1'));var uuid=require('uuid');var moment=require(_0x8b65('0x2'));var rr=require('rr');var md5=require(_0x8b65('0x3'));var Redis=require(_0x8b65('0x4'));var ut=require(_0x8b65('0x5'));var config=require(_0x8b65('0x6'));var logger=require(_0x8b65('0x7'))('dialer');var loggerBooked=require(_0x8b65('0x7'))('booked');var loggerPredictive=require(_0x8b65('0x7'))('predictive');var loggerPredictiveCalls=require(_0x8b65('0x7'))(_0x8b65('0x8'));var loggerSyncQueueSummary=require(_0x8b65('0x7'))(_0x8b65('0x9'));var ami=require(_0x8b65('0xa'));config[_0x8b65('0xb')]=_[_0x8b65('0xc')](config[_0x8b65('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x8b65('0xd'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x8b65('0xe'));var cmHopperBlack=require(_0x8b65('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x8b65('0x10'));var History=require(_0x8b65('0x11'));var Final=require(_0x8b65('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x8b65('0x13'));var Hangup=require(_0x8b65('0x14'));var ipAgi=process['env'][_0x8b65('0x15')]||_0x8b65('0x16');var strategy={'rrmemory':'rrmemory','roundrobin':_0x8b65('0x17')};var Sequence=function(){};Sequence[_0x8b65('0x18')]['enqueue']=function(_0x4aabc1){this[_0x8b65('0x19')]=this[_0x8b65('0x19')]?this['tail']['finally'](_0x4aabc1):_0x4aabc1();};function Dialer(_0x449f01,_0x5a6275){this[_0x8b65('0x1a')]=new Sequence();this[_0x8b65('0x1b')]=_0x5a6275;this[_0x8b65('0x1c')]=_0x449f01[_0x8b65('0x1c')];this[_0x8b65('0x1d')]=_0x449f01['campaigns'];this[_0x8b65('0x1e')]=_0x449f01['agents'];this[_0x8b65('0x1f')]=_0x449f01[_0x8b65('0x1f')];this[_0x8b65('0x20')]=config['maxNumberOriginate']||0x2;this[_0x8b65('0x21')]={};this[_0x8b65('0x22')]={};this[_0x8b65('0x23')]={};this[_0x8b65('0x24')]={};this[_0x8b65('0x25')]={};this[_0x8b65('0x26')]={};this[_0x8b65('0x27')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x8b65('0x28')]={};ami['on'](_0x8b65('0x29'),this[_0x8b65('0x2a')][_0x8b65('0x2b')](this));ami['on'](_0x8b65('0x2c'),this[_0x8b65('0x2d')]['bind'](this));ami['on'](_0x8b65('0x2e'),this[_0x8b65('0x2f')][_0x8b65('0x2b')](this));ami['on'](_0x8b65('0x30'),this[_0x8b65('0x31')]['bind'](this));ami['on'](_0x8b65('0x32'),this[_0x8b65('0x9')][_0x8b65('0x2b')](this));ami['on']('hangup',this[_0x8b65('0x33')]['bind'](this));ami['on']('newexten',this[_0x8b65('0x34')][_0x8b65('0x2b')](this));ami['on'](_0x8b65('0x35'),this[_0x8b65('0x36')][_0x8b65('0x2b')](this));ami['on'](_0x8b65('0x37'),this[_0x8b65('0x38')][_0x8b65('0x2b')](this));ami['on']('queuestatuscomplete',this[_0x8b65('0x39')][_0x8b65('0x2b')](this));this[_0x8b65('0x3a')]();this[_0x8b65('0x3b')]();}function isNotNull(_0x1a1255){return _0x1a1255!==null&&!_['isUndefined'](_0x1a1255);}function checkIsLoggedIn(_0x234232,_0x1fe749){return function(){if(_0x1fe749<=0x0){_0x234232[_0x8b65('0x3c')]=_0x8b65('0x3d');throw _0x234232['name']+_0x8b65('0x3e');}};}function isActive(_0x148728){return _0x148728;}function checkIsActive(_0x118203,_0x11a02f){return function(){if(!isActive(_0x11a02f)){_0x118203[_0x8b65('0x3c')]=_0x8b65('0x3f');throw _0x118203[_0x8b65('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x12228a){return function(){if(!isNotNull(_0x12228a[_0x8b65('0x41')])){_0x12228a['message']=_0x8b65('0x42');throw _0x12228a[_0x8b65('0x40')]+_0x8b65('0x43');}if(!isNotNull(_0x12228a[_0x8b65('0x41')][_0x8b65('0x44')])){_0x12228a[_0x8b65('0x3c')]=_0x8b65('0x42');throw _0x12228a[_0x8b65('0x40')]+_0x8b65('0x43');}if(!isNotNull(_['isEmpty'](_0x12228a[_0x8b65('0x41')][_0x8b65('0x44')]))){_0x12228a[_0x8b65('0x3c')]=_0x8b65('0x42');throw _0x12228a['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x490cc1,_0x31df27,_0x3e4be6){return{'action':_0x490cc1,'response':_0x31df27,'message':_0x3e4be6,'stack':_0x3e4be6};}function myreject(_0x334213){return function(_0x2d7719){return _0x334213(msgResponse(_0x8b65('0x45'),_0x8b65('0x46'),JSON[_0x8b65('0x47')](_0x2d7719)));};}function getSeconds(_0x549656,_0x12fd65){var _0x530615=moment(_0x549656)['milliseconds'](0x0);var _0x2c6158=moment(_0x12fd65)[_0x8b65('0x48')](0x0);return _0x530615['diff'](_0x2c6158,'seconds');}function emit(_0x3e300f,_0x260228,_0x5ba2d2){io['to'](_0x3e300f)[_0x8b65('0x49')](_0x260228,_0x5ba2d2);}function emitVoiceQueueSummary(_0x372e4d){if(_0x372e4d[_0x8b65('0x4a')]===_0x8b65('0x4b')){var _0x36fe11={'id':_0x372e4d['id'],'name':_0x372e4d[_0x8b65('0x40')],'strategy':_0x372e4d[_0x8b65('0x4c')],'answered':_0x372e4d[_0x8b65('0x4d')],'available':_0x372e4d['available'],'loggedIn':_0x372e4d[_0x8b65('0x4e')],'pTalking':_0x372e4d[_0x8b65('0x4f')],'sumBillable':_0x372e4d['sumBillable'],'sumDuration':_0x372e4d['sumDuration'],'sumHoldTime':_0x372e4d[_0x8b65('0x50')]||0x0,'talking':_0x372e4d[_0x8b65('0x51')],'total':_0x372e4d[_0x8b65('0x52')],'type':_0x372e4d[_0x8b65('0x4a')],'unmanaged':_0x372e4d[_0x8b65('0x53')],'abandoned':_0x372e4d[_0x8b65('0x54')],'waiting':_0x372e4d['waiting'],'loggedInDb':_0x372e4d[_0x8b65('0x55')],'dialActive':_0x372e4d['dialActive'],'dialMethod':_0x372e4d[_0x8b65('0x56')],'dialOriginateCallerIdName':_0x372e4d[_0x8b65('0x57')],'dialOriginateCallerIdNumber':_0x372e4d[_0x8b65('0x58')],'dialOriginateTimeout':_0x372e4d[_0x8b65('0x59')],'dialPrefix':_0x372e4d['dialPrefix'],'outboundAnswerAgiCallsDay':_0x372e4d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x372e4d[_0x8b65('0x5a')],'outboundBlacklistCallsDay':_0x372e4d[_0x8b65('0x5b')],'outboundBusyCallsDay':_0x372e4d['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x372e4d[_0x8b65('0x5c')],'outboundDropCallsDayACS':_0x372e4d[_0x8b65('0x5d')],'outboundDropCallsDayCallersExit':_0x372e4d[_0x8b65('0x5e')],'outboundDropCallsDayTimeout':_0x372e4d[_0x8b65('0x5f')],'outboundNoAnswerCallsDay':_0x372e4d[_0x8b65('0x60')],'outboundNoSuchCallsDay':_0x372e4d[_0x8b65('0x61')],'outboundOriginateFailureCallsDay':_0x372e4d[_0x8b65('0x62')],'outboundReCallsDay':_0x372e4d[_0x8b65('0x63')],'outboundRejectCallsDay':_0x372e4d['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x372e4d['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x372e4d[_0x8b65('0x64')],'predictiveIntervalAvgHoldtime':_0x372e4d[_0x8b65('0x65')],'predictiveIntervalAvgTalktime':_0x372e4d[_0x8b65('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x372e4d['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x372e4d[_0x8b65('0x67')],'predictiveIntervalErlangCalls':_0x372e4d['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x372e4d[_0x8b65('0x68')],'predictiveIntervalHitRate':_0x372e4d[_0x8b65('0x69')],'predictiveIntervalMultiplicativeFactor':_0x372e4d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x372e4d[_0x8b65('0x6a')],'predictiveIntervalAvailable':_0x372e4d[_0x8b65('0x6b')],'predictiveIntervalTotalCalls':_0x372e4d[_0x8b65('0x6c')],'message':_0x372e4d[_0x8b65('0x3c')],'originated':_0x372e4d['originated'],'erlangCalls':_0x372e4d[_0x8b65('0x6d')],'erlangCallToSecond':_0x372e4d['erlangCallToSecond'],'erlangAbandonmentRate':_0x372e4d[_0x8b65('0x6e')],'erlangBusyFactor':_0x372e4d[_0x8b65('0x6f')],'startPredictive':_0x372e4d[_0x8b65('0x26')],'startProgressive':_0x372e4d[_0x8b65('0x27')]};if(_0x372e4d[_0x8b65('0x70')]){_0x36fe11[_0x8b65('0x70')]={'id':_0x372e4d['Trunk']['id'],'name':_0x372e4d[_0x8b65('0x70')]['name'],'active':_0x372e4d[_0x8b65('0x70')]['active'],'callerid':_0x372e4d[_0x8b65('0x70')]['callerid']};}if(_0x372e4d['Interval']){_0x36fe11['Interval']={'id':_0x372e4d[_0x8b65('0x41')]['id'],'name':_0x372e4d[_0x8b65('0x41')][_0x8b65('0x40')]};}var _0xbdfb5a=md5(JSON[_0x8b65('0x47')](_0x36fe11));if(_0x372e4d[_0x8b65('0x3')]!==_0xbdfb5a){_0x372e4d[_0x8b65('0x3')]=_0xbdfb5a;emit(util[_0x8b65('0x71')](_0x8b65('0x72'),_0x36fe11[_0x8b65('0x40')]),_0x8b65('0x73'),_0x36fe11);}}}function emitCampaignSummary(_0x19797f){if(_0x19797f['type']===_0x8b65('0x74')){emit(util['format'](_0x8b65('0x75'),_0x19797f[_0x8b65('0x40')]),'campaign:save',_0x19797f);}}function checkGetDataPredictive(_0x57cdf9){if(isNotNull(_0x57cdf9)){if(!_[_0x8b65('0x76')](_0x57cdf9)){loggerPredictive['info'](_0x8b65('0x77'));loggerPredictive['info'](_0x8b65('0x78'),_0x57cdf9[_0x8b65('0x6c')]);loggerPredictive['info'](_0x8b65('0x79'),_0x57cdf9[_0x8b65('0x64')]);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x7b'),_0x57cdf9[_0x8b65('0x67')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57cdf9[_0x8b65('0x7c')]);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x7d'),_0x57cdf9[_0x8b65('0x65')]);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x7e'),_0x57cdf9['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x8b65('0x7f'));if(_0x57cdf9[_0x8b65('0x6c')]>0x0){if(!_[_0x8b65('0x80')](_0x57cdf9['predictiveIntervalAvgTalktime'])&&_0x57cdf9['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x81'));}if(!_[_0x8b65('0x80')](_0x57cdf9[_0x8b65('0x65')])&&_0x57cdf9[_0x8b65('0x65')]>0x0){return!![];}else{loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x82'));}}else{loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x83'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0x8b65('0x7a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x187e2f){return function(_0x34833c){loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x84'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34833c[_0x8b65('0x6d')]);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x85'),_0x34833c['erlangCallToSecond']);loggerPredictive[_0x8b65('0x7a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34833c[_0x8b65('0x6e')]);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x86'),_0x34833c[_0x8b65('0x6f')]);loggerPredictive[_0x8b65('0x7a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34833c[_0x8b65('0x6e')]);loggerPredictive['info'](_0x8b65('0x7f'));_['merge'](_0x187e2f,_0x34833c);};}function getDiff(_0x422512){var _0xa5fc96=moment()['milliseconds'](0x0);var _0x371bc6=moment(_0x422512)['milliseconds'](0x0);return _0xa5fc96[_0x8b65('0x87')](_0x371bc6,_0x8b65('0x88'));}function ifInterval(_0xf66b24,_0x4761ed){if(_[_0x8b65('0x80')](_0x4761ed)){return![];}if(getDiff(_0x4761ed)<_0xf66b24*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x6597ea){if(isNotNull(_0x6597ea)){if(!_[_0x8b65('0x80')](_0x6597ea[_0x8b65('0x27')])){_0x6597ea[_0x8b65('0x27')]=undefined;loggerPredictive[_0x8b65('0x7a')](_0x6597ea[_0x8b65('0x40')],_0x8b65('0x89'));}if(!_['isUndefined'](_0x6597ea[_0x8b65('0x26')])){_0x6597ea['startPredictive']=undefined;loggerPredictive[_0x8b65('0x7a')](_0x6597ea[_0x8b65('0x40')],_0x8b65('0x8a'));}if(!_[_0x8b65('0x80')](_0x6597ea[_0x8b65('0x8b')])){clearInterval(_0x6597ea[_0x8b65('0x8b')]);_0x6597ea[_0x8b65('0x8b')]=undefined;loggerPredictive[_0x8b65('0x7a')](_0x6597ea[_0x8b65('0x40')],_0x8b65('0x8c'));}}}function erlangb(_0x40f04c,_0x1b71b4){if(_0x1b71b4===0x0){return 0x0;}var _0x66505a=0x1;for(var _0x43f08c=0x1;_0x43f08c<=_0x1b71b4;_0x43f08c+=0x1){_0x66505a=0x1+_0x66505a*_0x43f08c/_0x40f04c;}return 0x1/_0x66505a;}function isVoiceQueueOutbound(_0x240146){return _0x240146==='outbound';}function isNotPreview(_0x3c91a3){return _0x3c91a3!==_0x8b65('0x1b');}function isCampaignIvr(_0x316db9){return _0x316db9===_0x8b65('0x74');}function getCallerId(_0x54e78c,_0xaf73a,_0x1077a6){if(!_['isUndefined'](_0x1077a6)&&'string'===typeof _0x1077a6&&!_[_0x8b65('0x76')](_0x1077a6)){if(!_[_0x8b65('0x80')](_0xaf73a)&&'string'===typeof _0xaf73a&&!_[_0x8b65('0x76')](_0xaf73a)){return util[_0x8b65('0x71')](_0x8b65('0x8d'),_0xaf73a,_0x1077a6);}return util['format'](_0x8b65('0x8d'),_0x1077a6,_0x1077a6);}if(!_[_0x8b65('0x80')](_0x54e78c)&&_0x8b65('0x8e')===typeof _0x54e78c&&!_['isEmpty'](_0x54e78c)){return _0x54e78c;}return _0x8b65('0x8f');}function loggerCatchQueueSummary(_0x1da343,_0x6e9b6e){return function(_0x3e15f8){freeVariablesPredictive(_0x6e9b6e);emitVoiceQueueSummary(_0x6e9b6e);emitCampaignSummary(_0x6e9b6e);loggerSyncQueueSummary[_0x8b65('0x90')](_0x1da343,util[_0x8b65('0x91')](_0x3e15f8,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x48e347,_0x3c0c6d){return function(_0x409aa9){loggerPredictive[_0x8b65('0x90')](_0x3c0c6d[_0x8b65('0x40')],_0x48e347);loggerPredictive['error'](_0x409aa9[_0x8b65('0x92')]);freeVariablesPredictive(_0x3c0c6d);};}function loggerCatch(_0x507cb3){return function(_0x392cab){logger[_0x8b65('0x90')](_0x507cb3,util[_0x8b65('0x91')](_0x392cab,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5cc366){return _0x5cc366&&!_[_0x8b65('0x80')](_0x5cc366)&&_0x5cc366[_0x8b65('0x93')]>0x0;}function decremetOriginate(_0x1d9032){if(!_[_0x8b65('0x80')](_0x1d9032)&&_0x1d9032!==null){if(_0x1d9032[_0x8b65('0x94')](_0x8b65('0x95'))){if(_0x1d9032[_0x8b65('0x95')]>0x0){_0x1d9032[_0x8b65('0x95')]-=0x1;}else{logger[_0x8b65('0x90')](_0x8b65('0x96'));}}}else{logger['error'](_0x8b65('0x97'));}}function checkContactLowerLimitOriginate(_0x5e00ad,_0x24ad05,_0x5d9e0b){if(_0x24ad05>_0x5d9e0b){for(var _0x2fd9c8=0x0;_0x2fd9c8<_0x24ad05-_0x5d9e0b;_0x2fd9c8+=0x1){decremetOriginate(_0x5e00ad);}}}function loggerGetContactDialer(_0x11f337,_0x270b2b,_0x4f9b82){return function(_0x3f1562){checkContactLowerLimitOriginate(_0x270b2b,_0x4f9b82,0x0);logger[_0x8b65('0x90')](_0x11f337,util[_0x8b65('0x91')](_0x3f1562,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x217148){return function(_0x15c488){if(isNotNull(_0x15c488)&&isNotNull(_0x15c488[0x0])){if(_0x15c488[0x0][_0x8b65('0x98')]>0x0){_0x217148['message']='RESCHEDULED_CONTACTS';logger[_0x8b65('0x7a')](_0x8b65('0x99')+_0x217148[_0x8b65('0x40')],_0x15c488[0x0][_0x8b65('0x98')],'contacts');}else{_0x217148[_0x8b65('0x3c')]=_0x8b65('0x9a');logger['info'](_0x8b65('0x9b')+_0x217148[_0x8b65('0x40')]);}}};}function notSendMessagesQueue(_0x590634){if(_0x590634['sendMessageOneNotActive']){freeVariablesPredictive(_0x590634);if(_0x590634[_0x8b65('0x95')]===0x0&&_0x590634[_0x8b65('0x51')]===0x0&&_0x590634[_0x8b65('0x9c')]===0x0&&(_0x590634[_0x8b65('0x4f')]||0x0)===0x0){_0x590634[_0x8b65('0x9d')]=![];_0x590634[_0x8b65('0x9e')]=0x0;_0x590634['message']=_0x8b65('0x3f');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x590634[_0x8b65('0x40')],_0x8b65('0x9f'));}else{_0x590634['message']=_0x8b65('0xa0');loggerSyncQueueSummary[_0x8b65('0x90')](_0x8b65('0xa1'),_0x590634[_0x8b65('0x40')],_0x8b65('0xa2'));}emitVoiceQueueSummary(_0x590634);}}function notSendMessagesCampaign(_0xbff27d){if(_0xbff27d[_0x8b65('0x9d')]){if(_0xbff27d['originated']===0x0){_0xbff27d[_0x8b65('0x9d')]=![];_0xbff27d['message']=_0x8b65('0x3f');loggerSyncQueueSummary[_0x8b65('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xbff27d[_0x8b65('0x40')],'is\x20not\x20active');}else{_0xbff27d[_0x8b65('0x3c')]=_0x8b65('0xa0');loggerSyncQueueSummary[_0x8b65('0x90')](_0x8b65('0xa3'),_0xbff27d[_0x8b65('0x40')],_0x8b65('0xa2'));}emitCampaignSummary(_0xbff27d);}}function createObjHistory(_0xb838b9,_0x4c6845,_0x2f0e51,_0x467c90,_0x389b56){_0xb838b9['message']=_0x2f0e51;var _0x575e59=new Action(_0xb838b9,_0x4c6845);var _0x3d0ea2=new History(_0x575e59);_0x3d0ea2['state']=_0x467c90;_0x3d0ea2['statedesc']=_0x389b56;_0x3d0ea2[_0x8b65('0xa4')]=_0x575e59[_0x8b65('0xa5')];return _0x3d0ea2;}Dialer[_0x8b65('0x18')][_0x8b65('0x3b')]=function(){var _0x242dfb=this;setInterval(function(){_0x242dfb['clearZombieChannels'](_0x242dfb[_0x8b65('0x24')],_0x8b65('0xa6'));_0x242dfb[_0x8b65('0xa7')](_0x242dfb[_0x8b65('0x22')],'[actions]');},0x32c8);};Dialer['prototype'][_0x8b65('0xa7')]=function(_0x29b24c,_0x32e8c5){var _0x23a301=this;for(var _0x301983 in _0x29b24c){if(_0x29b24c['hasOwnProperty'](_0x301983)){this[_0x8b65('0x1a')][_0x8b65('0xa8')](function(){if(!_[_0x8b65('0xa9')](_0x29b24c[_0x301983])){return ami[_0x8b65('0xaa')]({'action':'status','channel':_0x29b24c[_0x301983]['channel']})[_0x8b65('0xab')](function(_0x465d8b){if(_0x465d8b[_0x8b65('0x3c')]===_0x8b65('0xac')){setTimeout(function(){if(_0x29b24c[_0x301983]&&_0x29b24c[_0x301983]['type']!==_0x8b65('0x74')){_0x23a301['updateOriginated'](_0x23a301[_0x8b65('0x1c')][_0x29b24c[_0x301983][_0x8b65('0xad')]]);logger[_0x8b65('0x90')](_0x8b65('0xae'),_0x32e8c5,_0x301983,_0x29b24c[_0x301983][_0x8b65('0xad')]);delete _0x29b24c[_0x301983];}if(_0x29b24c[_0x301983]&&_0x29b24c[_0x301983][_0x8b65('0x4a')]===_0x8b65('0x74')){_0x23a301[_0x8b65('0xaf')](_0x23a301[_0x8b65('0x1d')][_0x29b24c[_0x301983][_0x8b65('0xad')]]);logger[_0x8b65('0x90')](_0x8b65('0xb0'),_0x32e8c5,_0x301983,_0x29b24c[_0x301983][_0x8b65('0xad')]);delete _0x29b24c[_0x301983];}},0x2328);}});}});}}};Dialer[_0x8b65('0x18')][_0x8b65('0xb1')]=function(_0x4c41f7){return BPromise['resolve']()[_0x8b65('0xb2')](cmHopper[_0x8b65('0xb1')](_0x4c41f7))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xb3')));};Dialer[_0x8b65('0x18')]['checkIsBlackList']=function(_0x157cce){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](cmHopperBlack[_0x8b65('0xb5')](_0x157cce))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xb6')));};Dialer[_0x8b65('0x18')][_0x8b65('0xb7')]=function(_0x4fc669){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](cmHopperBlack['checkIsBlackListIvr'](_0x4fc669))[_0x8b65('0xab')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x8b65('0xb8')]=function(_0x59620d){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](cmHopperHistory[_0x8b65('0xb9')](_0x59620d))[_0x8b65('0xab')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x8b65('0x18')]['rescheduleContact']=function(_0x2a9f26){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](cmHopper[_0x8b65('0xba')](_0x2a9f26))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xbb')));};Dialer[_0x8b65('0x18')]['unlockContact']=function(_0x46ab14,_0x55a97b,_0xf10cc1){return BPromise[_0x8b65('0xb4')]()['then'](cmHopper[_0x8b65('0xbc')](_0x46ab14,_0x55a97b,_0xf10cc1))['catch'](loggerCatch(_0x8b65('0xbd')));};Dialer[_0x8b65('0x18')][_0x8b65('0xbe')]=function(_0x2f14c6,_0x3e3b65,_0x44c881,_0x1dbcb4){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](cmHopper[_0x8b65('0xbe')](_0x2f14c6,_0x3e3b65,_0x44c881,_0x1dbcb4))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xbf')));};Dialer[_0x8b65('0x18')]['getContactDialerIvr']=function(_0x44ccb8,_0x3889dc,_0x4faf4e){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](cmHopper[_0x8b65('0xc0')](_0x44ccb8,_0x3889dc,_0x4faf4e))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xbf')));};Dialer[_0x8b65('0x18')][_0x8b65('0xc1')]=function(_0x38aee9){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](voiceQueueRt['getVoiceQueueRtPauses'](_0x38aee9))[_0x8b65('0xab')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x8b65('0x18')][_0x8b65('0xc2')]=function(_0x75986f){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](cmHopper[_0x8b65('0xc2')](_0x75986f))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xc3')));};Dialer[_0x8b65('0x18')][_0x8b65('0xc4')]=function(_0x30341b){return BPromise[_0x8b65('0xb4')]()[_0x8b65('0xb2')](cmHopperHistory[_0x8b65('0xc4')](_0x30341b))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xc5')));};Dialer[_0x8b65('0x18')][_0x8b65('0xaf')]=function(_0x45b066){if(!_['isUndefined'](_0x45b066)&&_0x45b066!==null){if(_0x45b066['hasOwnProperty'](_0x8b65('0x95'))){if(_0x45b066['originated']>0x0){_0x45b066[_0x8b65('0x95')]-=0x1;}else{logger['error'](_0x8b65('0xc6'));}}}else{logger[_0x8b65('0x90')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x8b65('0x18')][_0x8b65('0xc7')]=function(_0x4856cf,_0xa3fb93){var _0x10469d=this;return function(_0x292964){_0x10469d[_0x8b65('0xaf')](_0xa3fb93);logger[_0x8b65('0x90')](_0x4856cf,util['inspect'](_0x292964,{'showHidden':![],'depth':null}));};};Dialer[_0x8b65('0x18')][_0x8b65('0xc8')]=function(_0xb9999,_0x449e62,_0x4ee75a){var _0xbda5c4={'state':0x19,'statedesc':'notFound'};this[_0x8b65('0xaf')](_0x449e62);this[_0x8b65('0xc9')](_[_0x8b65('0xca')](_0xbda5c4,_['pick'](_0x4ee75a,[_0x8b65('0xcb'),_0x8b65('0xcc'),_0x8b65('0xcd'),_0x8b65('0xce'),_0x8b65('0xcf')])),_0x8b65('0xd0'),'[emptyContact]');logger[_0x8b65('0x90')](_0xb9999);};Dialer[_0x8b65('0x18')][_0x8b65('0xd1')]=function(_0x2819fa){return _0x2819fa==='Success';};Dialer[_0x8b65('0x18')][_0x8b65('0xd2')]=function(_0x4320b1){return!_[_0x8b65('0x80')](_0x4320b1)&&_0x4320b1&&!_['isUndefined'](_0x4320b1['name'])&&!_['isUndefined'](_0x4320b1['active'])&&_0x4320b1[_0x8b65('0xd3')]&&(this[_0x8b65('0x1f')][util[_0x8b65('0x71')]('SIP/%s',_0x4320b1[_0x8b65('0x40')])][_0x8b65('0xd4')]===_0x8b65('0xd5')||this['trunks'][util[_0x8b65('0x71')](_0x8b65('0xd6'),_0x4320b1['name'])]['status']===_0x8b65('0xd7'));};Dialer[_0x8b65('0x18')][_0x8b65('0xc9')]=function(_0x2ae80d,_0x2f1652,_0x535094){this[_0x8b65('0xc4')](_0x2ae80d)['catch'](loggerCatch(_0x2f1652));this[_0x8b65('0xc2')](_0x2ae80d)[_0x8b65('0xab')](loggerCatch(_0x535094));};Dialer[_0x8b65('0x18')]['syncVarSet']=function(_0x3a8a86){var _0xbd1c0=this[_0x8b65('0x24')][_0x3a8a86[_0x8b65('0xd8')]];var _0x2b8f7a;if(!_[_0x8b65('0xa9')](_0x3a8a86)&&!_['isNil'](_0x3a8a86[_0x8b65('0xd9')])&&!_[_0x8b65('0xa9')](_0x3a8a86[_0x8b65('0xd9')][_0x8b65('0xda')])&&_0x3a8a86[_0x8b65('0xdb')]===_0x8b65('0xdc')&&_0xbd1c0){if(_0xbd1c0['type']!==_0x8b65('0x74')&&this['voiceQueues'][_0xbd1c0[_0x8b65('0xad')]][_0x8b65('0xdd')]&&_0x3a8a86[_0x8b65('0xde')]==='HANGUP'){delete this[_0x8b65('0x24')][_0x3a8a86['uniqueid']];this[_0x8b65('0xaf')](this[_0x8b65('0x1c')][_0xbd1c0[_0x8b65('0xad')]]);this[_0x8b65('0x1c')][_0xbd1c0[_0x8b65('0xad')]][_0x8b65('0x5a')]+=0x1;this[_0x8b65('0x1c')][_0xbd1c0['queue']][_0x8b65('0xdf')]+=0x1;_0x2b8f7a=new Hangup(_0xbd1c0,_0x3a8a86);_0x2b8f7a[_0x8b65('0xe0')]=0x12;_0x2b8f7a[_0x8b65('0xe1')]='HangupInAMD';_0x2b8f7a[_0x8b65('0xe2')]=_0x8b65('0xe3');this[_0x8b65('0xc9')](_0x2b8f7a,_0x8b65('0xe4'),_0x8b65('0xe5'));}if(_0xbd1c0[_0x8b65('0x4a')]!==_0x8b65('0x74')&&this[_0x8b65('0x1c')][_0xbd1c0[_0x8b65('0xad')]]['dialAMDActive']&&_0x3a8a86[_0x8b65('0xde')]===_0x8b65('0xe6')){var _0x25297f=this;return new BPromise(function(_0x3b6790,_0x21522f){delete _0x25297f[_0x8b65('0x24')][_0x3a8a86[_0x8b65('0xd8')]];_0x25297f[_0x8b65('0xaf')](_0x25297f[_0x8b65('0x1c')][_0xbd1c0['queue']]);_0x25297f[_0x8b65('0x1c')][_0xbd1c0[_0x8b65('0xad')]]['outboundAnswerCallsDay']+=0x1;_0x25297f[_0x8b65('0x1c')][_0xbd1c0['queue']][_0x8b65('0xdf')]+=0x1;var _0x127908=_0x25297f['voiceQueues'][_0xbd1c0[_0x8b65('0xad')]];var _0x5f555b=new Hangup(_0xbd1c0,_0x3a8a86);_0x5f555b[_0x8b65('0xe0')]=0x13;_0x5f555b[_0x8b65('0xe1')]=_0x8b65('0xe7');_0x5f555b[_0x8b65('0xe2')]=_0x8b65('0xe3');_0x5f555b[_0x8b65('0xe8')]+=0x1;_0x5f555b[_0x8b65('0xe9')]+=0x1;_0x5f555b[_0x8b65('0xea')]=!![];_0x25297f[_0x8b65('0xc4')](_0x5f555b)[_0x8b65('0xab')](loggerCatch(_0x8b65('0xeb')));if(_0x5f555b[_0x8b65('0xec')]+_0x5f555b[_0x8b65('0xed')]+_0x5f555b['countnoanswerretry']+_0x5f555b[_0x8b65('0xee')]+_0x5f555b['countdropretry']+_0x5f555b[_0x8b65('0xef')]+_0x5f555b['countmachineretry']+_0x5f555b[_0x8b65('0xf0')]>=_0x127908[_0x8b65('0xf1')]){_0x25297f['stateGlobal'](_0x5f555b,_0x3b6790,_0x21522f,_0x8b65('0xf2'));}else{if(_0x5f555b[_0x8b65('0xe8')]>=_0x127908[_0x8b65('0xf3')]){_0x25297f[_0x8b65('0xf4')](_0x5f555b,_0x3b6790,_0x21522f,_0x8b65('0xf5'));}else{_0x25297f[_0x8b65('0xba')]({'active':![],'countmachineretry':_0x5f555b[_0x8b65('0xe8')],'scheduledat':moment()[_0x8b65('0xf6')](_0x127908[_0x8b65('0xf7')],_0x8b65('0xf8'))[_0x8b65('0x71')](_0x8b65('0xf9')),'ContactId':_0x5f555b['ContactId'],'ListId':_0x5f555b[_0x8b65('0xcc')],'VoiceQueueId':_0x5f555b[_0x8b65('0xce')]||undefined,'CampaignId':_0x5f555b[_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0xfa')));_0x3b6790({'reschedule':0x1});}}});}if(_0xbd1c0['type']===_0x8b65('0x74')&&this[_0x8b65('0x1d')][_0xbd1c0['queue']]['dialAMDActive']&&_0x3a8a86['value']===_0x8b65('0xfb')){delete this[_0x8b65('0x24')][_0x3a8a86[_0x8b65('0xd8')]];this[_0x8b65('0xaf')](this[_0x8b65('0x1d')][_0xbd1c0[_0x8b65('0xad')]]);_0x2b8f7a=new Hangup(_0xbd1c0,_0x3a8a86);_0x2b8f7a['state']=0x12;_0x2b8f7a[_0x8b65('0xe1')]=_0x8b65('0xfc');_0x2b8f7a['membername']=_0x8b65('0xe3');this[_0x8b65('0xc9')](_0x2b8f7a,_0x8b65('0xfd'),'[syncHangupInAMDIvr]');}if(_0xbd1c0[_0x8b65('0x4a')]==='ivr'&&this['campaigns'][_0xbd1c0[_0x8b65('0xad')]][_0x8b65('0xdd')]&&_0x3a8a86[_0x8b65('0xde')]===_0x8b65('0xe6')){var _0x25297f=this;return new BPromise(function(_0xb928f0,_0x5e7b07){delete _0x25297f['uniqueId'][_0x3a8a86[_0x8b65('0xd8')]];_0x25297f[_0x8b65('0xaf')](_0x25297f[_0x8b65('0x1d')][_0xbd1c0[_0x8b65('0xad')]]);_0x25297f[_0x8b65('0x1d')][_0xbd1c0['queue']][_0x8b65('0x5a')]+=0x1;_0x25297f[_0x8b65('0x1d')][_0xbd1c0[_0x8b65('0xad')]][_0x8b65('0xdf')]+=0x1;var _0x552b03=_0x25297f[_0x8b65('0x1d')][_0xbd1c0[_0x8b65('0xad')]];var _0x371db8=new Hangup(_0xbd1c0,_0x3a8a86);_0x371db8[_0x8b65('0xe0')]=0x13;_0x371db8[_0x8b65('0xe1')]=_0x8b65('0xe7');_0x371db8[_0x8b65('0xe2')]=_0x8b65('0xe3');_0x371db8[_0x8b65('0xe8')]+=0x1;_0x371db8['countglobal']+=0x1;_0x371db8[_0x8b65('0xea')]=!![];_0x25297f[_0x8b65('0xc4')](_0x371db8)['catch'](loggerCatch(_0x8b65('0xeb')));if(_0x371db8[_0x8b65('0xec')]+_0x371db8[_0x8b65('0xed')]+_0x371db8[_0x8b65('0xfe')]+_0x371db8[_0x8b65('0xee')]+_0x371db8[_0x8b65('0xff')]+_0x371db8[_0x8b65('0xef')]+_0x371db8[_0x8b65('0xe8')]+_0x371db8[_0x8b65('0xf0')]>=_0x552b03['dialGlobalMaxRetry']){_0x25297f[_0x8b65('0x100')](_0x371db8,_0xb928f0,_0x5e7b07,_0x8b65('0xf2'));}else{if(_0x371db8['countmachineretry']>=_0x552b03[_0x8b65('0xf3')]){_0x25297f[_0x8b65('0xf4')](_0x371db8,_0xb928f0,_0x5e7b07,_0x8b65('0xf5'));}else{_0x25297f[_0x8b65('0xba')]({'active':![],'countmachineretry':_0x371db8[_0x8b65('0xe8')],'scheduledat':moment()[_0x8b65('0xf6')](_0x552b03[_0x8b65('0xf7')],_0x8b65('0xf8'))['format'](_0x8b65('0xf9')),'ContactId':_0x371db8['ContactId'],'ListId':_0x371db8[_0x8b65('0xcc')],'VoiceQueueId':_0x371db8[_0x8b65('0xce')]||undefined,'CampaignId':_0x371db8[_0x8b65('0xcf')]||undefined})['catch'](loggerCatch(_0x8b65('0xfa')));_0xb928f0({'reschedule':0x1});}}});}}};Dialer[_0x8b65('0x18')][_0x8b65('0x33')]=function(_0x50b1d7){var _0x168795=this[_0x8b65('0x24')][_0x50b1d7[_0x8b65('0xd8')]];var _0x2b704c=this;var _0x431e31;if(_0x168795&&_0x168795[_0x8b65('0x4a')]===_0x8b65('0x74')){delete this[_0x8b65('0x24')][_0x50b1d7['uniqueid']];this['updateOriginated'](this['campaigns'][_0x168795['queue']]);this[_0x8b65('0x1d')][_0x168795[_0x8b65('0xad')]][_0x8b65('0x101')]+=0x1;_0x431e31=new Hangup(_0x168795,_0x50b1d7);this['createHistory'](_0x431e31)[_0x8b65('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8b65('0xc2')](_0x431e31)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x102')));}if(_0x168795&&_0x168795['type']!=='ivr'&&isNotNull(this[_0x8b65('0x1c')][_0x168795[_0x8b65('0xad')]][_0x8b65('0x103')])){delete this[_0x8b65('0x24')][_0x50b1d7['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x168795['queue']]);this['voiceQueues'][_0x168795['queue']][_0x8b65('0x5a')]+=0x1;this[_0x8b65('0x1c')][_0x168795[_0x8b65('0xad')]][_0x8b65('0xdf')]+=0x1;_0x431e31=new Hangup(_0x168795,_0x50b1d7);_0x431e31['state']=0x10;_0x431e31['statedesc']=_0x8b65('0x104');_0x431e31[_0x8b65('0xe2')]=_0x8b65('0x105');this['createHistory'](_0x431e31)[_0x8b65('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8b65('0xc2')](_0x431e31)['catch'](loggerCatch(_0x8b65('0x102')));}if(_0x168795&&_0x168795[_0x8b65('0x4a')]!==_0x8b65('0x74')&&!isNotNull(this['voiceQueues'][_0x168795[_0x8b65('0xad')]][_0x8b65('0x103')])){delete this['uniqueId'][_0x50b1d7[_0x8b65('0xd8')]];this[_0x8b65('0xaf')](this['voiceQueues'][_0x168795[_0x8b65('0xad')]]);this['voiceQueues'][_0x168795[_0x8b65('0xad')]][_0x8b65('0x106')]+=0x1;_0x431e31=new Hangup(_0x168795,_0x50b1d7);_0x431e31[_0x8b65('0xe0')]=0xc;_0x431e31['statedesc']=_0x50b1d7[_0x8b65('0x107')];_0x431e31[_0x8b65('0xe2')]='Unknow';this[_0x8b65('0xc4')](_0x431e31)[_0x8b65('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8b65('0xc2')](_0x431e31)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x102')));}};Dialer[_0x8b65('0x18')]['syncAgentComplete']=function(_0x18eea0){var _0x2bc988=this[_0x8b65('0x24')][_0x18eea0[_0x8b65('0xd8')]];var _0x15cbd5=this;if(this['voiceQueues'][_0x18eea0['queue']]){if(_0x2bc988&&_0x2bc988['type']!==_0x8b65('0x74')){delete this[_0x8b65('0x24')][_0x18eea0[_0x8b65('0xd8')]];this['voiceQueues'][_0x18eea0[_0x8b65('0xad')]][_0x8b65('0x5a')]+=0x1;var _0x2671d9=new AgentComplete(_0x2bc988,_0x18eea0);if(_0x18eea0['reason']===_0x8b65('0x108')){_0x2671d9['agiafterat']=this[_0x8b65('0x1c')][_0x18eea0[_0x8b65('0xad')]][_0x8b65('0x109')]&&this[_0x8b65('0x1c')][_0x18eea0[_0x8b65('0xad')]][_0x8b65('0x10a')]?moment()[_0x8b65('0x71')](_0x8b65('0xf9')):undefined;}this[_0x8b65('0xc4')](_0x2671d9)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x10b')));this[_0x8b65('0xc2')](_0x2671d9)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x10c')));}}};Dialer[_0x8b65('0x18')][_0x8b65('0x2a')]=function(_0xcb7f0c){if(this[_0x8b65('0x1c')][_0xcb7f0c['queue']]){if(this[_0x8b65('0x24')][_0xcb7f0c[_0x8b65('0xd8')]]&&this[_0x8b65('0x24')][_0xcb7f0c[_0x8b65('0xd8')]][_0x8b65('0x4a')]!==_0x8b65('0x74')){this[_0x8b65('0xaf')](this[_0x8b65('0x1c')][_0xcb7f0c[_0x8b65('0xad')]]);this[_0x8b65('0x24')][_0xcb7f0c[_0x8b65('0xd8')]][_0x8b65('0x10d')]=moment()[_0x8b65('0x71')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x8b65('0x18')][_0x8b65('0x10e')]=function(_0x3c3fe6){this[_0x8b65('0xc4')](_0x3c3fe6)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x10b')));this[_0x8b65('0xc2')](_0x3c3fe6)[_0x8b65('0xab')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x8b65('0x18')][_0x8b65('0x2d')]=function(_0x282f45){var _0x176564=this[_0x8b65('0x24')][_0x282f45['uniqueid']];var _0x47ba4a=this;if(this[_0x8b65('0x1c')][_0x282f45[_0x8b65('0xad')]]){if(_0x176564&&_0x176564[_0x8b65('0x4a')]!==_0x8b65('0x74')){delete this[_0x8b65('0x24')][_0x282f45['uniqueid']];this[_0x8b65('0xaf')](this['voiceQueues'][_0x282f45[_0x8b65('0xad')]]);_0x176564[_0x8b65('0x10f')]=moment()[_0x8b65('0x71')](_0x8b65('0xf9'));var _0x8150f3=new QueueCallerAbandon(_0x176564,_0x282f45);if(getSeconds(_0x176564[_0x8b65('0x10f')],_0x176564[_0x8b65('0x110')])>=_0x176564[_0x8b65('0x111')]){this['voiceQueues'][_0x282f45['queue']][_0x8b65('0x67')]+=0x1;this[_0x8b65('0x1c')][_0x282f45[_0x8b65('0xad')]][_0x8b65('0x5f')]+=0x1;this['voiceQueues'][_0x282f45['queue']][_0x8b65('0x68')]+=0x1;_0x8150f3[_0x8b65('0xe0')]=0xa;_0x8150f3[_0x8b65('0xe1')]='Drop';_0x8150f3[_0x8b65('0x112')]='TIMEOUT';_0x8150f3[_0x8b65('0x113')]=this[_0x8b65('0x1c')][_0x282f45[_0x8b65('0xad')]]['dialQueueProject2']?moment()[_0x8b65('0x71')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x8150f3['countdropretry']+=0x1;_0x8150f3[_0x8b65('0xe9')]+=0x1;if(_0x8150f3[_0x8b65('0xff')]>=this[_0x8b65('0x1c')][_0x282f45[_0x8b65('0xad')]][_0x8b65('0x114')]){this['queueCallerAbandonCreateState'](_0x8150f3);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x8150f3[_0x8b65('0xff')],'scheduledat':moment()[_0x8b65('0xf6')](this[_0x8b65('0x1c')][_0x282f45['queue']][_0x8b65('0x115')],'minutes')['format'](_0x8b65('0xf9')),'ContactId':_0x176564[_0x8b65('0xcb')],'ListId':_0x176564[_0x8b65('0xcc')],'VoiceQueueId':_0x176564[_0x8b65('0xce')]||undefined,'CampaignId':_0x176564[_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x116')));var _0x40c9cd=new History(_0x8150f3);_0x40c9cd[_0x8b65('0xe0')]=0xa;_0x40c9cd[_0x8b65('0xe1')]=_0x8b65('0x117');_0x40c9cd[_0x8b65('0xa5')]=moment()[_0x8b65('0x71')](_0x8b65('0xf9'));_0x40c9cd[_0x8b65('0xa4')]=_0x40c9cd['starttime'];_0x40c9cd[_0x8b65('0x118')]=_0x8150f3[_0x8b65('0x118')];_0x40c9cd['calleridnum']=_0x8150f3[_0x8b65('0x119')];this['createHistory'](_0x40c9cd)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x11a')));}}else{this[_0x8b65('0x1c')][_0x282f45[_0x8b65('0xad')]][_0x8b65('0x7c')]+=0x1;this['voiceQueues'][_0x282f45[_0x8b65('0xad')]]['outboundDropCallsDayCallersExit']+=0x1;_0x8150f3[_0x8b65('0xe0')]=0xb;_0x8150f3[_0x8b65('0xe1')]=_0x8b65('0x11b');_0x8150f3[_0x8b65('0x112')]=_0x8b65('0x11c');_0x8150f3[_0x8b65('0xef')]+=0x1;_0x8150f3['countglobal']+=0x1;if(_0x8150f3[_0x8b65('0xef')]>=this['voiceQueues'][_0x282f45[_0x8b65('0xad')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x8150f3);}else{this[_0x8b65('0xba')]({'active':![],'countabandonedretry':_0x8150f3[_0x8b65('0xef')],'scheduledat':moment()['add'](this[_0x8b65('0x1c')][_0x282f45['queue']][_0x8b65('0x11d')],_0x8b65('0xf8'))[_0x8b65('0x71')](_0x8b65('0xf9')),'ContactId':_0x176564[_0x8b65('0xcb')],'ListId':_0x176564[_0x8b65('0xcc')],'VoiceQueueId':_0x176564[_0x8b65('0xce')]||undefined,'CampaignId':_0x176564[_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x40c9cd=new History(_0x8150f3);_0x40c9cd[_0x8b65('0xe0')]=0xb;_0x40c9cd[_0x8b65('0xe1')]=_0x8b65('0x11b');_0x40c9cd[_0x8b65('0xa5')]=moment()[_0x8b65('0x71')](_0x8b65('0xf9'));_0x40c9cd[_0x8b65('0xa4')]=_0x40c9cd['starttime'];_0x40c9cd['calleridname']=_0x8150f3['calleridname'];_0x40c9cd['calleridnum']=_0x8150f3[_0x8b65('0x119')];this[_0x8b65('0xc4')](_0x40c9cd)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x11e')));}}}}};Dialer[_0x8b65('0x18')][_0x8b65('0x34')]=function(_0x47a8c9){if(this['actions'][_0x47a8c9['uniqueid']]){this[_0x8b65('0x22')][_0x47a8c9[_0x8b65('0xd8')]][_0x8b65('0x11f')]=_0x47a8c9[_0x8b65('0x11f')];}if(this[_0x8b65('0x24')][_0x47a8c9[_0x8b65('0xd8')]]){this[_0x8b65('0x24')][_0x47a8c9['uniqueid']][_0x8b65('0x11f')]=_0x47a8c9[_0x8b65('0x11f')];}};Dialer[_0x8b65('0x18')][_0x8b65('0x38')]=function(_0x3f9057){if(strategy[this[_0x8b65('0x1c')][this['actions'][_0x3f9057[_0x8b65('0x120')]][_0x8b65('0xad')]][_0x8b65('0x4c')]]==='roundrobin'){if(this[_0x8b65('0x22')][_0x3f9057[_0x8b65('0x120')]]&&_[_0x8b65('0xa9')](this[_0x8b65('0x22')][_0x3f9057[_0x8b65('0x120')]][_0x8b65('0x121')])&&_0x3f9057[_0x8b65('0xd4')]==='1'&&_0x3f9057[_0x8b65('0x122')]==='0'){if(this[_0x8b65('0x1e')][_0x3f9057[_0x8b65('0x123')]]){if(!this['agents'][_0x3f9057[_0x8b65('0x123')]]['locked']){this[_0x8b65('0x1e')][_0x3f9057['stateinterface']][_0x8b65('0x121')]=!![];this[_0x8b65('0x22')][_0x3f9057[_0x8b65('0x120')]][_0x8b65('0x121')]=!![];this['actions'][_0x3f9057[_0x8b65('0x120')]][_0x8b65('0x123')]=_0x3f9057[_0x8b65('0x123')];}}}}else if((strategy[this[_0x8b65('0x1c')][this['actions'][_0x3f9057[_0x8b65('0x120')]][_0x8b65('0xad')]][_0x8b65('0x4c')]]||'rrmemory')==='rrmemory'){if(this[_0x8b65('0x22')][_0x3f9057[_0x8b65('0x120')]]){if(this[_0x8b65('0x1e')][_0x3f9057['stateinterface']]){this[_0x8b65('0x22')][_0x3f9057[_0x8b65('0x120')]]['stateinterface']=_0x3f9057[_0x8b65('0x123')];if(_['isNil'](this[_0x8b65('0x124')][this[_0x8b65('0x22')][_0x3f9057[_0x8b65('0x120')]][_0x8b65('0xad')]])){this[_0x8b65('0x124')][this['actions'][_0x3f9057[_0x8b65('0x120')]][_0x8b65('0xad')]]=[];}this[_0x8b65('0x124')][this[_0x8b65('0x22')][_0x3f9057[_0x8b65('0x120')]]['queue']][_0x8b65('0x125')](_[_0x8b65('0xca')](_[_0x8b65('0x126')](this['actions'][_0x3f9057[_0x8b65('0x120')]],[_0x8b65('0x127'),_0x8b65('0x123')]),{'status':_0x3f9057[_0x8b65('0xd4')],'paused':_0x3f9057[_0x8b65('0x122')]}));}}}};function unlockQueueStatus(_0x2c359a,_0x5a2349){setTimeout(function(){if(_[_0x8b65('0x80')](_0x2c359a[_0x8b65('0x128')])){loggerBooked[_0x8b65('0x90')](_0x8b65('0x129'),_0x5a2349);}_0x2c359a[_0x8b65('0x128')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x5a2349,JSON[_0x8b65('0x47')](_[_0x8b65('0x126')](_0x2c359a,['name',_0x8b65('0x128')])));},0x1f3);}Dialer['prototype'][_0x8b65('0x39')]=function(_0x43f4bb){var _0x2380db=this;var _0x17a6b5=_0x2380db[_0x8b65('0x1c')][_0x2380db[_0x8b65('0x22')][_0x43f4bb['actionid']]['queue']];if(strategy[this[_0x8b65('0x1c')][this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]][_0x8b65('0x4c')]]===_0x8b65('0x17')){if(this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]]&&this['actions'][_0x43f4bb['actionid']]['stateinterface']){this['preview'][_0x8b65('0x12a')](this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]]['idHopper'],this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0x123')])['catch'](function(_0x13cd2e){logger[_0x8b65('0x90')](_0x8b65('0x12b'),util[_0x8b65('0x91')](_0x13cd2e,{'showHidden':![],'depth':null}));})[_0x8b65('0x12c')](function(){_0x2380db[_0x8b65('0xaf')](_0x2380db[_0x8b65('0x1c')][_0x2380db[_0x8b65('0x22')][_0x43f4bb['actionid']][_0x8b65('0xad')]]);_0x2380db[_0x8b65('0x1e')][_0x2380db[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0x123')]]['locked']=![];delete _0x2380db[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]];unlockQueueStatus(_0x17a6b5);});}else{this['updateOriginated'](this[_0x8b65('0x1c')][this['actions'][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]]);this[_0x8b65('0xba')]({'active':![],'ContactId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xcb')],'ListId':this['actions'][_0x43f4bb[_0x8b65('0x120')]]['ListId'],'VoiceQueueId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xce')]||undefined,'CampaignId':this['actions'][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xcf')]||undefined})['catch'](loggerCatch(_0x8b65('0x12d')));delete this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]];unlockQueueStatus(_0x17a6b5);}}else if((strategy[this[_0x8b65('0x1c')][this['actions'][_0x43f4bb[_0x8b65('0x120')]]['queue']]['strategy']]||_0x8b65('0x12e'))==='rrmemory'){var _0x360a3a;if(this[_0x8b65('0x22')][_0x43f4bb['actionid']]&&!_[_0x8b65('0x76')](this['queueBooked'][this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]])){if(this[_0x8b65('0x28')][_0x2380db[_0x8b65('0x22')][_0x43f4bb['actionid']][_0x8b65('0xad')]]){this[_0x8b65('0x28')][_0x2380db[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]]=this[_0x8b65('0x28')][this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]]['queue']]?this[_0x8b65('0x28')][this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]]:this[_0x8b65('0x124')][this['actions'][_0x43f4bb[_0x8b65('0x120')]]['queue']]?this[_0x8b65('0x124')][this['actions'][_0x43f4bb[_0x8b65('0x120')]]['queue']][_0x8b65('0x12f')]||0x0:0x0;}this['queueBooked'][this[_0x8b65('0x22')][_0x43f4bb['actionid']][_0x8b65('0xad')]]['_rr']=this['queueBookedRR'][this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]]['queue']];for(var _0x5a374d=0x0;_0x5a374d<this['queueBooked'][this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]][_0x8b65('0x93')];_0x5a374d+=0x1){_0x360a3a=rr(this[_0x8b65('0x124')][this[_0x8b65('0x22')][_0x43f4bb['actionid']][_0x8b65('0xad')]]);this[_0x8b65('0x28')][_0x2380db[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]]=this[_0x8b65('0x124')][this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]][_0x8b65('0x12f')];if(_0x360a3a[_0x8b65('0xd4')]==='1'&&_0x360a3a['paused']==='0'){break;}}if(!_[_0x8b65('0xa9')](_0x360a3a)){this[_0x8b65('0x1e')][_0x360a3a['stateinterface']][_0x8b65('0x130')]=_[_0x8b65('0x80')](this[_0x8b65('0x1e')][_0x360a3a[_0x8b65('0x123')]][_0x8b65('0x130')])?!![]:this[_0x8b65('0x1e')][_0x360a3a[_0x8b65('0x123')]][_0x8b65('0x130')];}loggerBooked['info'](_0x8b65('0x131'),_0x43f4bb[_0x8b65('0x120')],'Agent:\x20',JSON['stringify'](_['pick'](this['agents'][_0x360a3a['stateinterface']],[_0x8b65('0x40'),_0x8b65('0x130')])),_0x8b65('0x132'),JSON['stringify'](_0x360a3a[_0x8b65('0x127')]));if(!_[_0x8b65('0xa9')](_0x360a3a)&&_0x360a3a[_0x8b65('0xd4')]==='1'&&_0x360a3a['paused']==='0'&&this[_0x8b65('0x1e')][_0x360a3a[_0x8b65('0x123')]]['unlockRR']){this[_0x8b65('0x1e')][_0x360a3a[_0x8b65('0x123')]][_0x8b65('0x130')]=![];this[_0x8b65('0x124')][_0x2380db[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]]=[];this[_0x8b65('0x1b')]['run'](_0x360a3a['idHopper'],_0x360a3a[_0x8b65('0x123')])[_0x8b65('0xab')](function(_0x1822f2){logger[_0x8b65('0x90')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x8b65('0x91')](_0x1822f2,{'showHidden':![],'depth':null}));})[_0x8b65('0x12c')](function(){_0x2380db['updateOriginated'](_0x2380db[_0x8b65('0x1c')][_0x2380db[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]]);setTimeout(function(){_0x2380db['agents'][_0x360a3a[_0x8b65('0x123')]][_0x8b65('0x130')]=!![];loggerBooked[_0x8b65('0x7a')]('[booked][RR][finaly]',_0x43f4bb[_0x8b65('0x120')],'Agent:\x20',JSON[_0x8b65('0x47')](_[_0x8b65('0x126')](_0x2380db[_0x8b65('0x1e')][_0x360a3a[_0x8b65('0x123')]],[_0x8b65('0x40'),_0x8b65('0x130')])),_0x8b65('0x132'),JSON['stringify'](_0x360a3a['idHopper']));},0xc7);delete _0x2380db[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]];unlockQueueStatus(_0x17a6b5,_0x43f4bb['actionid']);});}else{loggerBooked[_0x8b65('0x7a')](_0x8b65('0x133'));this[_0x8b65('0xaf')](this[_0x8b65('0x1c')][this['actions'][_0x43f4bb[_0x8b65('0x120')]]['queue']]);this[_0x8b65('0xba')]({'active':![],'ContactId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]]['ContactId'],'ListId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xcc')],'VoiceQueueId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8b65('0x22')][_0x43f4bb['actionid']]['CampaignId']||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x12d')));delete this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]];unlockQueueStatus(_0x17a6b5);}}else{loggerBooked[_0x8b65('0x7a')](_0x8b65('0x134'));this[_0x8b65('0xaf')](this['voiceQueues'][this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xcb')],'ListId':this['actions'][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xcc')],'VoiceQueueId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]]['CampaignId']||undefined})[_0x8b65('0xab')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]];unlockQueueStatus(_0x17a6b5);}}else{loggerBooked[_0x8b65('0x7a')](_0x8b65('0x135'));this['updateOriginated'](this[_0x8b65('0x1c')][this['actions'][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xad')]]);this[_0x8b65('0xba')]({'active':![],'ContactId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xcb')],'ListId':this['actions'][_0x43f4bb['actionid']][_0x8b65('0xcc')],'VoiceQueueId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xce')]||undefined,'CampaignId':this[_0x8b65('0x22')][_0x43f4bb[_0x8b65('0x120')]][_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x136')));delete this[_0x8b65('0x22')][_0x43f4bb['actionid']];unlockQueueStatus(_0x17a6b5);}};Dialer[_0x8b65('0x18')][_0x8b65('0x3a')]=function(){var _0x4b70ae=this;setInterval(function(){_0x4b70ae[_0x8b65('0x137')]();},0x3e8);};Dialer['prototype']['checkIsTrunkReachable']=function(_0x10a517){var _0x2bff96=this;return function(){if(!_0x2bff96[_0x8b65('0xd2')](_0x10a517[_0x8b65('0x70')])){if(!_0x2bff96['isTrunkReachable'](_0x10a517[_0x8b65('0x138')])){_0x10a517[_0x8b65('0x3c')]=_0x8b65('0x139');throw _0x10a517[_0x8b65('0x40')]+_0x8b65('0x13a');}}};};Dialer[_0x8b65('0x18')][_0x8b65('0x13b')]=function(_0x4b0532,_0x42d8ab,_0x51ac40,_0x40d652){var _0xb1f793=this;return function(){var _0x3e910e=!![];return _0xb1f793[_0x8b65('0x13c')](_0x4b0532,_0x42d8ab,_0x51ac40,_0x40d652,_0x3e910e);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0xe984d9,_0x2533f8,_0x512c37,_0x374729){var _0x2248e7=this;return function(){var _0x4bf4dd=![];return _0x2248e7['ifTime'](_0xe984d9[_0x8b65('0x44')],_0x2533f8,_0x512c37,_0x374729,_0x4bf4dd);};};Dialer[_0x8b65('0x18')][_0x8b65('0x13c')]=function(_0x3d9bae,_0x2ac632,_0x3c2c1e,_0x57748e,_0x309db0){var _0x31485e=[];return new BPromise(function(_0x3478a2,_0x2d22fd){if(!isNotNull(_0x3d9bae)){_0x57748e[_0x8b65('0x3c')]='INTERVAL_IS_NULL';return _0x2d22fd(msgResponse(_0x8b65('0x13c'),'Failure',_0x3c2c1e+_0x8b65('0x13d')));}if(_['isEmpty'](_0x3d9bae)){_0x57748e[_0x8b65('0x3c')]=_0x8b65('0x13e');return _0x2d22fd(msgResponse(_0x8b65('0x13c'),_0x8b65('0x13f'),_0x3c2c1e+_0x8b65('0x140')));}if(_0x2ac632&&_[_0x8b65('0x80')](config[_0x8b65('0x141')][_0x2ac632])){_0x57748e['message']=_0x8b65('0x142');return _0x2d22fd(msgResponse(_0x8b65('0x13c'),_0x8b65('0x13f'),_0x3c2c1e+_0x8b65('0x143')+_0x2ac632));}if(_['isArray'](_0x3d9bae)){for(var _0xf9ae0=0x0;_0xf9ae0<_0x3d9bae['length'];_0xf9ae0+=0x1){_0x31485e[_0x8b65('0x125')](ami[_0x8b65('0xaa')]({'action':_0x8b65('0x144'),'command':util['format'](_0x8b65('0x145'),_0x3d9bae[_0xf9ae0][_0x8b65('0x146')],!_[_0x8b65('0x80')](config[_0x8b65('0x141')][_0x2ac632])?_0x2ac632:'')})['then'](function(_0x54686a){return _0x54686a[_0x8b65('0x147')][_0x8b65('0x148')](_0x8b65('0x149'))>=0x0?!![]:![];})['catch'](myreject(_0x2d22fd)));}}else{_0x31485e[_0x8b65('0x125')](ami['Action']({'action':'command','command':util[_0x8b65('0x71')](_0x8b65('0x145'),_0x3d9bae,!_[_0x8b65('0x80')](config[_0x8b65('0x141')][_0x2ac632])?_0x2ac632:'')})[_0x8b65('0xb2')](function(_0x30867d){return _0x30867d[_0x8b65('0x147')]['indexOf'](_0x8b65('0x149'))>=0x0?!![]:![];})[_0x8b65('0xab')](myreject(_0x2d22fd)));}BPromise[_0x8b65('0x14a')](_0x31485e)[_0x8b65('0xb2')](function(_0x37be25){var _0x225c54=_[_0x8b65('0x14b')](_0x37be25);if(_0x225c54){return _0x3478a2(_0x225c54);}else{_0x57748e[_0x8b65('0x3c')]=_0x309db0?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x2d22fd(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x309db0+'\x20'+_0x3c2c1e+_0x8b65('0x14c')+util[_0x8b65('0x91')](_0x3d9bae,{'showHidden':![],'depth':null})+_0x8b65('0x14d')+_0x2ac632));}})[_0x8b65('0xab')](function(_0x49728b){return _0x2d22fd(msgResponse(_0x8b65('0x13c'),_0x8b65('0x13f'),JSON[_0x8b65('0x47')](_0x49728b)));});});};Dialer[_0x8b65('0x18')][_0x8b65('0x14e')]=function(_0x287dbf){var _0x3b1d3d=this;return function(){switch(_0x287dbf[_0x8b65('0x56')]){case _0x8b65('0x14f'):freeVariablesPredictive(_0x287dbf);_0x3b1d3d[_0x8b65('0x150')](_0x287dbf,0x1);break;case'power':freeVariablesPredictive(_0x287dbf);_0x3b1d3d[_0x8b65('0x150')](_0x287dbf,_0x287dbf[_0x8b65('0x151')]);break;case _0x8b65('0x152'):_0x3b1d3d['predictive'](_0x287dbf);break;case _0x8b65('0x153'):freeVariablesPredictive(_0x287dbf);_0x3b1d3d[_0x8b65('0x150')](_0x287dbf,0x1);break;default:freeVariablesPredictive(_0x287dbf);logger['error'](_0x8b65('0x154'),_0x287dbf[_0x8b65('0x40')],_0x8b65('0x155'));}};};Dialer[_0x8b65('0x18')]['launchHandleIvr']=function(_0xa98604){var _0x39d36b=this;return function(){_0x39d36b['handleIvr'](_0xa98604);};};Dialer[_0x8b65('0x18')][_0x8b65('0x9')]=function(_0x17e3dd){var _0x184b16=this;if(isNotPreview(_0x17e3dd[_0x8b65('0x56')])){if(isVoiceQueueOutbound(_0x17e3dd['type'])&&isActive(_0x17e3dd[_0x8b65('0x156')])){_0x17e3dd[_0x8b65('0x9d')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x17e3dd,_0x17e3dd[_0x8b65('0x4e')]))[_0x8b65('0xb2')](checkIsActive(_0x17e3dd,_0x17e3dd[_0x8b65('0x156')]))[_0x8b65('0xb2')](checkInterval(_0x17e3dd))[_0x8b65('0xb2')](_0x184b16[_0x8b65('0x157')](_0x17e3dd))[_0x8b65('0xb2')](_0x184b16[_0x8b65('0x13b')](_0x17e3dd[_0x8b65('0x158')],_0x17e3dd['dialTimezone'],_0x17e3dd[_0x8b65('0x40')],_0x17e3dd))[_0x8b65('0xb2')](_0x184b16[_0x8b65('0x159')](_0x17e3dd[_0x8b65('0x41')],_0x17e3dd[_0x8b65('0x15a')],_0x17e3dd[_0x8b65('0x40')],_0x17e3dd))[_0x8b65('0xb2')](_0x184b16[_0x8b65('0x14e')](_0x17e3dd))[_0x8b65('0xab')](loggerCatchQueueSummary(_0x8b65('0x15b'),_0x17e3dd));}else{notSendMessagesQueue(_0x17e3dd);}}else{freeVariablesPredictive(_0x17e3dd);}};Dialer['prototype'][_0x8b65('0x137')]=function(){var _0x5e174c=this;var _0x3f8805;for(var _0x316721 in this['campaigns']){if(this['campaigns'][_0x8b65('0x94')](_0x316721)){_0x3f8805=this[_0x8b65('0x1d')][_0x316721];if(isCampaignIvr(_0x3f8805[_0x8b65('0x4a')])&&isActive(_0x3f8805[_0x8b65('0xd3')])){_0x3f8805[_0x8b65('0x9d')]=!![];BPromise['resolve']()[_0x8b65('0xb2')](checkIsActive(_0x3f8805,_0x3f8805[_0x8b65('0xd3')]))[_0x8b65('0xb2')](checkInterval(_0x3f8805))[_0x8b65('0xb2')](_0x5e174c[_0x8b65('0x157')](_0x3f8805))[_0x8b65('0xb2')](_0x5e174c[_0x8b65('0x13b')](_0x3f8805[_0x8b65('0x158')],_0x3f8805[_0x8b65('0x15a')],_0x3f8805[_0x8b65('0x40')],_0x3f8805))[_0x8b65('0xb2')](_0x5e174c[_0x8b65('0x159')](_0x3f8805['Interval'],_0x3f8805['dialTimezone'],_0x3f8805[_0x8b65('0x40')],_0x3f8805))['then'](_0x5e174c[_0x8b65('0x15c')](_0x3f8805))['catch'](loggerCatchQueueSummary(_0x8b65('0x15d'),_0x3f8805));}else{notSendMessagesCampaign(_0x3f8805);}}}};function getCallerIdRandom(_0x4d3a9b,_0x59be67){var _0x3916d9,_0x23cdc4,_0x3beeb0;if(_0x59be67<=0x0){_0x59be67=0x1;}_0x3916d9=new RegExp(_0x8b65('0x15e')+_0x59be67+'}$');_0x23cdc4=Math[_0x8b65('0x15f')](0xa,_0x59be67-0x1);_0x3beeb0=Math[_0x8b65('0x15f')](0xa,_0x59be67)-0x1;return util['format']('%s',_[_0x8b65('0x160')](_0x4d3a9b,_0x3916d9,_[_0x8b65('0x161')](_0x23cdc4,_0x3beeb0)));}function extractCalleridName(_0x16fddd){var _0x4a970a=_0x16fddd[_0x8b65('0x162')](/"(.*?)"/);return _0x4a970a?_0x4a970a[0x1]:_0x16fddd;}function extractCalleridNumber(_0x1e59e5){var _0x5cee4b=_0x1e59e5[_0x8b65('0x162')](/<(.*?)>/);return _0x5cee4b?_0x5cee4b[0x1]:_0x1e59e5;}Dialer['prototype']['actionOriginate']=function(_0x2e296b,_0x5d6bf8){var _0x5e4aa5=this;var _0x545a3d=uuid['v4']();this[_0x8b65('0x22')][_0x545a3d]=new Action(_0x2e296b,_0x5d6bf8,_0x545a3d);return new BPromise(function(_0x147008,_0x8fddee){if(_[_0x8b65('0x80')](_0x2e296b)&&_0x8b65('0x163')!==typeof _0x2e296b){return _0x8fddee(msgResponse('originate',_0x8b65('0x13f'),_0x8b65('0x164')));}if(_[_0x8b65('0x80')](_0x5d6bf8[_0x8b65('0x165')][_0x8b65('0x166')])||_0x5d6bf8[_0x8b65('0x165')][_0x8b65('0x166')]===null){return _0x8fddee(msgResponse(_0x8b65('0x167'),'Failure',_0x8b65('0x168')));}var _0x36b383={'XMD-CALLERID':_0x5e4aa5['actions'][_0x545a3d][_0x8b65('0x169')](),'XMD-AGI':_0x2e296b[_0x8b65('0x103')]?util[_0x8b65('0x71')](_0x8b65('0x16a'),ipAgi,_0x2e296b[_0x8b65('0x103')]):_0x8b65('0x16b'),'XMD-AGIAFTER':_0x2e296b[_0x8b65('0x109')]?util[_0x8b65('0x71')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2e296b['dialQueueProject2']):_0x8b65('0x16b'),'XMD-QUEUE':_0x2e296b[_0x8b65('0x4a')]===_0x8b65('0x4b')?util['format']('\x22%s,%s%s,,,%s\x22',_0x2e296b[_0x8b65('0x40')],_0x2e296b[_0x8b65('0x16c')]||'',_0x2e296b['dialAgiAfterHangupAgent']?'c':'',_0x2e296b['dialQueueTimeout']||0x3):_0x8b65('0x16b'),'XMD-CONTACTID':_0x5d6bf8['ContactId'],'XMD-CDRTYPE':_0x8b65('0x16d'),'CALLERID(all)':_0x5e4aa5[_0x8b65('0x22')][_0x545a3d]['getCaller'](),'XMD-AMD':_0x2e296b[_0x8b65('0xdd')]?_0x8b65('0x16e'):'NONE','XMD-DESTINATION':_0x8b65('0xdc')};if(_0x2e296b[_0x8b65('0xdd')]){_0x36b383[_0x8b65('0x16f')]=_0x2e296b['dialAMDInitialSilence']||0x9c4;_0x36b383[_0x8b65('0x170')]=_0x2e296b[_0x8b65('0x171')]||0x5dc;_0x36b383[_0x8b65('0x172')]=_0x2e296b[_0x8b65('0x173')]||0x320;_0x36b383[_0x8b65('0x174')]=_0x2e296b['dialAMDTotalAnalysisTime']||0x1388;_0x36b383[_0x8b65('0x175')]=_0x2e296b[_0x8b65('0x176')]||0x64;_0x36b383['XMD-AMDBETWEENWORDSSILENCE']=_0x2e296b[_0x8b65('0x177')]||0x32;_0x36b383[_0x8b65('0x178')]=_0x2e296b[_0x8b65('0x179')]||0x3;_0x36b383['XMD-AMDSILENCETHRESHOLD']=_0x2e296b[_0x8b65('0x17a')]||0x100;_0x36b383[_0x8b65('0x17b')]=_0x2e296b['dialAMDMaximumWordLength']||0x1388;}if(_0x2e296b[_0x8b65('0x4a')]==='outbound'){_0x36b383[_0x8b65('0x17c')]=_0x5d6bf8[_0x8b65('0xce')];}else{_0x36b383[_0x8b65('0x17d')]=_0x5d6bf8[_0x8b65('0xcf')];}for(var _0x55b343 in _0x5d6bf8[_0x8b65('0x165')]){if(_0x5d6bf8[_0x8b65('0x165')]['hasOwnProperty'](_0x55b343)){if(isNotNull(_0x5d6bf8[_0x8b65('0x165')][_0x55b343])&&_0x55b343!=='id'&&_0x55b343!==_0x8b65('0x17e')&&_0x55b343!=='createdAt'&&_0x55b343!=='updatedAt'){_0x36b383[util['format'](_0x8b65('0x17f'),_0x8b65('0x180'),_[_0x8b65('0x181')](_0x55b343))]=_0x5d6bf8[_0x8b65('0x165')][_0x55b343];}}}var _0x49f1b3=_0x5e4aa5[_0x8b65('0xd2')](_0x2e296b['Trunk'])?getCallerId(_0x2e296b[_0x8b65('0x70')][_0x8b65('0x182')],_0x2e296b[_0x8b65('0x57')],_0x2e296b[_0x8b65('0x183')]>0x0?getCallerIdRandom(_0x2e296b[_0x8b65('0x58')],_0x2e296b[_0x8b65('0x183')]):_0x2e296b[_0x8b65('0x58')]):getCallerId(_['isNil'](_0x2e296b[_0x8b65('0x138')])?_0x2e296b[_0x8b65('0x70')][_0x8b65('0x182')]:_0x2e296b[_0x8b65('0x138')][_0x8b65('0x182')],_0x2e296b[_0x8b65('0x57')],_0x2e296b[_0x8b65('0x183')]>0x0?getCallerIdRandom(_0x2e296b[_0x8b65('0x58')],_0x2e296b['dialRandomLastDigitCallerIdNumber']):_0x2e296b[_0x8b65('0x58')]);if(_0x49f1b3){_0x36b383[_0x8b65('0x184')]=_0x5e4aa5[_0x8b65('0x22')][_0x545a3d][_0x8b65('0x185')]=extractCalleridName(_0x49f1b3);_0x36b383[_0x8b65('0x186')]=_0x5e4aa5[_0x8b65('0x22')][_0x545a3d][_0x8b65('0x187')]=extractCalleridNumber(_0x49f1b3);}return ami[_0x8b65('0xaa')]({'actionid':_0x545a3d,'action':'originate','channel':_0x5e4aa5[_0x8b65('0xd2')](_0x2e296b[_0x8b65('0x70')])?util[_0x8b65('0x71')](_0x8b65('0x188'),_0x2e296b['Trunk']['name'],isNotNull(_0x2e296b['dialPrefix'])?_0x2e296b['dialPrefix'][_0x8b65('0x189')]()||'':'',_0x2e296b[_0x8b65('0x18a')]>0x0?_0x5d6bf8['Contact']['phone'][_0x8b65('0x18b')](_0x2e296b[_0x8b65('0x18a')]):_0x5d6bf8[_0x8b65('0x165')][_0x8b65('0x166')]):util['format'](_0x8b65('0x188'),_['isNil'](_0x2e296b[_0x8b65('0x138')])?_0x2e296b[_0x8b65('0x70')]['name']:_0x2e296b[_0x8b65('0x138')][_0x8b65('0x40')],isNotNull(_0x2e296b[_0x8b65('0x18c')])?_0x2e296b[_0x8b65('0x18c')]['trim']()||'':'',_0x2e296b[_0x8b65('0x18a')]>0x0?_0x5d6bf8['Contact'][_0x8b65('0x166')][_0x8b65('0x18b')](_0x2e296b[_0x8b65('0x18a')]):_0x5d6bf8[_0x8b65('0x165')][_0x8b65('0x166')]),'callerid':_0x49f1b3,'Exten':_0x8b65('0xdc'),'Context':'from-sip','Priority':'1','variable':_0x36b383,'timeout':(_0x2e296b[_0x8b65('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x545a3d})[_0x8b65('0xb2')](function(_0x233b5a){return _0x147008(_0x233b5a);})[_0x8b65('0xab')](function(_0x3810c4){_0x2e296b[_0x8b65('0x62')]+=0x1;var _0x2c1ec4=new History(_0x5e4aa5[_0x8b65('0x22')][_0x545a3d]);logger[_0x8b65('0x90')](util[_0x8b65('0x71')](_0x8b65('0x18d'),JSON[_0x8b65('0x47')](_0x3810c4)));_0x2c1ec4['state']=0xe;_0x2c1ec4[_0x8b65('0xe1')]='OriginateError';_0x2c1ec4['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c1ec4[_0x8b65('0xa4')]=_0x2c1ec4['starttime'];_0x5e4aa5[_0x8b65('0xc4')](_0x2c1ec4)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x18e')));_0x5e4aa5[_0x8b65('0xc2')](_0x2c1ec4)[_0x8b65('0xab')](loggerCatch('[originate][error]'))[_0x8b65('0x12c')](function(){delete _0x5e4aa5[_0x8b65('0x22')][_0x545a3d];return _0x8fddee(msgResponse(_0x8b65('0x167'),_0x8b65('0x46'),_0x8b65('0x18f')));});});});};Dialer[_0x8b65('0x18')][_0x8b65('0x2f')]=function(_0x58179b){var _0x36d315=this['actions'][_0x58179b[_0x8b65('0x120')]];var _0x2cce43=this;if(_0x36d315){delete this[_0x8b65('0x22')][_0x58179b[_0x8b65('0x120')]];_0x36d315[_0x8b65('0x110')]=moment()[_0x8b65('0x71')](_0x8b65('0xf9'));var _0x6ca1a6=_0x36d315['type']===_0x8b65('0x74')?this[_0x8b65('0x1d')][_0x36d315['queue']]:this['voiceQueues'][_0x36d315['getQueue']()];if(!this[_0x8b65('0xd1')](_0x58179b[_0x8b65('0x190')])){this[_0x8b65('0xaf')](_0x6ca1a6);return this[_0x8b65('0x191')](_0x36d315,_0x6ca1a6,_0x58179b)[_0x8b65('0xb2')](function(_0x3dc573){})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x192')));}else{this[_0x8b65('0x24')][_0x58179b['uniqueid']]=_0x36d315;}}};Dialer[_0x8b65('0x18')][_0x8b65('0x193')]=function(_0x2e42e9,_0x24424f,_0x5658c7){var _0x59c389=new History(_0x24424f);if(_0x59c389[_0x8b65('0xec')]+_0x59c389[_0x8b65('0xed')]+_0x59c389[_0x8b65('0xfe')]+_0x59c389['countnosuchnumberretry']+_0x59c389['countdropretry']+_0x59c389[_0x8b65('0xef')]+_0x59c389[_0x8b65('0xe8')]+_0x59c389[_0x8b65('0xf0')]>=_0x5658c7[_0x8b65('0xf1')]-0x1){return!![];}switch(_0x2e42e9){case 0x3:if(_0x59c389['countnoanswerretry']>=_0x5658c7[_0x8b65('0x194')]-0x1){return!![];}else{this[_0x8b65('0xba')]({'active':![],'countnoanswerretry':_0x59c389[_0x8b65('0xfe')]+=0x1,'scheduledat':moment()[_0x8b65('0xf6')](_0x5658c7[_0x8b65('0x195')],_0x8b65('0xf8'))[_0x8b65('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59c389[_0x8b65('0xcb')],'ListId':_0x59c389['ListId'],'VoiceQueueId':_0x59c389[_0x8b65('0xce')]||undefined,'CampaignId':_0x59c389['CampaignId']||undefined})['catch'](loggerCatch(_0x8b65('0x196')));}break;case 0x5:if(_0x59c389['countbusyretry']>=_0x5658c7[_0x8b65('0x197')]-0x1){return!![];}else{this[_0x8b65('0xba')]({'active':![],'countbusyretry':_0x59c389['countbusyretry']+=0x1,'scheduledat':moment()[_0x8b65('0xf6')](_0x5658c7[_0x8b65('0x198')],'minutes')[_0x8b65('0x71')](_0x8b65('0xf9')),'ContactId':_0x59c389[_0x8b65('0xcb')],'ListId':_0x59c389[_0x8b65('0xcc')],'VoiceQueueId':_0x59c389[_0x8b65('0xce')]||undefined,'CampaignId':_0x59c389[_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x199')));}break;case 0x8:if(_0x59c389[_0x8b65('0xed')]>=_0x5658c7[_0x8b65('0x19a')]-0x1){return!![];}else{this[_0x8b65('0xba')]({'active':![],'countcongestionretry':_0x59c389[_0x8b65('0xed')]+=0x1,'scheduledat':moment()[_0x8b65('0xf6')](_0x5658c7[_0x8b65('0x19b')],'minutes')[_0x8b65('0x71')](_0x8b65('0xf9')),'ContactId':_0x59c389[_0x8b65('0xcb')],'ListId':_0x59c389[_0x8b65('0xcc')],'VoiceQueueId':_0x59c389['VoiceQueueId']||undefined,'CampaignId':_0x59c389[_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x59c389['countnosuchnumberretry']>=_0x5658c7[_0x8b65('0x19c')]-0x1){return!![];}else{this[_0x8b65('0xba')]({'active':![],'countnosuchnumberretry':_0x59c389[_0x8b65('0xee')]+=0x1,'scheduledat':moment()[_0x8b65('0xf6')](_0x5658c7[_0x8b65('0x19d')],_0x8b65('0xf8'))[_0x8b65('0x71')](_0x8b65('0xf9')),'ContactId':_0x59c389[_0x8b65('0xcb')],'ListId':_0x59c389[_0x8b65('0xcc')],'VoiceQueueId':_0x59c389[_0x8b65('0xce')]||undefined,'CampaignId':_0x59c389[_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x19e')));}break;case 0xa:if(_0x59c389['countdropretry']>=_0x5658c7[_0x8b65('0x114')]-0x1){return!![];}else{this[_0x8b65('0xba')]({'active':![],'countdropretry':_0x59c389[_0x8b65('0xff')]+=0x1,'scheduledat':moment()[_0x8b65('0xf6')](_0x5658c7[_0x8b65('0x115')],_0x8b65('0xf8'))[_0x8b65('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59c389[_0x8b65('0xcb')],'ListId':_0x59c389[_0x8b65('0xcc')],'VoiceQueueId':_0x59c389[_0x8b65('0xce')]||undefined,'CampaignId':_0x59c389[_0x8b65('0xcf')]||undefined})['catch'](loggerCatch(_0x8b65('0x116')));}break;case 0xb:if(_0x59c389[_0x8b65('0xef')]>=_0x5658c7[_0x8b65('0x19f')]-0x1){return!![];}else{this[_0x8b65('0xba')]({'active':![],'countabandonedretry':_0x59c389[_0x8b65('0xef')]+=0x1,'scheduledat':moment()['add'](_0x5658c7[_0x8b65('0x11d')],_0x8b65('0xf8'))[_0x8b65('0x71')](_0x8b65('0xf9')),'ContactId':_0x59c389[_0x8b65('0xcb')],'ListId':_0x59c389['ListId'],'VoiceQueueId':_0x59c389[_0x8b65('0xce')]||undefined,'CampaignId':_0x59c389['CampaignId']||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x1a0')));}break;case 0x13:if(_0x59c389[_0x8b65('0xe8')]>=_0x5658c7[_0x8b65('0xf3')]-0x1){return!![];}else{this[_0x8b65('0xba')]({'active':![],'countmachineretry':_0x59c389[_0x8b65('0xe8')]+=0x1,'scheduledat':moment()[_0x8b65('0xf6')](_0x5658c7[_0x8b65('0xf7')],_0x8b65('0xf8'))[_0x8b65('0x71')](_0x8b65('0xf9')),'ContactId':_0x59c389[_0x8b65('0xcb')],'ListId':_0x59c389[_0x8b65('0xcc')],'VoiceQueueId':_0x59c389['VoiceQueueId']||undefined,'CampaignId':_0x59c389['CampaignId']||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0xfa')));}break;case 0x14:if(_0x59c389[_0x8b65('0xf0')]>=_0x5658c7[_0x8b65('0x1a1')]-0x1){return!![];}else{this[_0x8b65('0xba')]({'active':![],'countagentrejectretry':_0x59c389[_0x8b65('0xf0')]+=0x1,'scheduledat':moment()[_0x8b65('0xf6')](_0x5658c7[_0x8b65('0x1a2')],'minutes')[_0x8b65('0x71')](_0x8b65('0xf9')),'ContactId':_0x59c389[_0x8b65('0xcb')],'ListId':_0x59c389[_0x8b65('0xcc')],'VoiceQueueId':_0x59c389[_0x8b65('0xce')]||undefined,'CampaignId':_0x59c389[_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x1a3')));}break;default:return!![];}};Dialer[_0x8b65('0x18')][_0x8b65('0x191')]=function(_0x382720,_0x536c6b,_0x1725c7){var _0x351428=this;var _0x36a2c2=new History(_0x382720);return new BPromise(function(_0x48a3f0,_0x2fa09f){if(_[_0x8b65('0x80')](_0x536c6b)&&'object'!==typeof _0x536c6b){return _0x2fa09f(msgResponse(_0x8b65('0x1a4'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x1725c7)&&_0x8b65('0x163')!==typeof _0x1725c7){return _0x2fa09f(msgResponse('[callProgressDetecting]',_0x8b65('0x13f'),_0x8b65('0x1a5')));}switch(_0x1725c7[_0x8b65('0x1a6')]){case'0':_0x536c6b['outboundNoSuchCallsDay']+=0x1;_0x36a2c2['state']=0x0;_0x36a2c2[_0x8b65('0xe1')]=_0x8b65('0x1a7');_0x36a2c2[_0x8b65('0xee')]+=0x1;_0x36a2c2['countglobal']+=0x1;console[_0x8b65('0x1a8')]('EMITTING\x20status_nosuchnumber\x20for',ut[_0x8b65('0x1a9')](_0x382720,_0x8b65('0x1aa')));ami[_0x8b65('0x49')](_0x8b65('0x1ab'),ut[_0x8b65('0x1a9')](_0x382720,'nosuchnumber'));_0x351428['createHistory'](_0x36a2c2)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x351428[_0x8b65('0x193')](0x0,_0x382720,_0x536c6b)){if(_0x36a2c2[_0x8b65('0xee')]>=_0x536c6b[_0x8b65('0x19c')]){_0x351428['createStateFinal'](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1ac'));}else{_0x351428[_0x8b65('0x100')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1ac'));}}break;case'3':_0x536c6b[_0x8b65('0x60')]+=0x1;_0x36a2c2[_0x8b65('0xe0')]=0x3;_0x36a2c2[_0x8b65('0xe1')]=_0x8b65('0x1ad');_0x36a2c2['countnoanswerretry']+=0x1;_0x36a2c2[_0x8b65('0xe9')]+=0x1;console[_0x8b65('0x1a8')](_0x8b65('0x1ae'),_0x1725c7);console['log'](_0x8b65('0x1af'),_0x382720);console[_0x8b65('0x1a8')]('NO\x20ANSWER\x20entity',_0x536c6b);console[_0x8b65('0x1a8')](_0x8b65('0x1b0'),_0x36a2c2);console[_0x8b65('0x1a8')]('EMITTING\x20status_noanswer\x20for',ut[_0x8b65('0x1a9')](_0x382720,_0x8b65('0x1b1')));ami[_0x8b65('0x49')](_0x8b65('0x1b2'),ut[_0x8b65('0x1a9')](_0x382720,_0x8b65('0x1b1')));_0x351428[_0x8b65('0xc4')](_0x36a2c2)[_0x8b65('0xab')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x351428[_0x8b65('0x193')](0x3,_0x382720,_0x536c6b)){if(_0x36a2c2[_0x8b65('0xfe')]>=_0x536c6b['dialNoAnswerMaxRetry']){_0x351428['createStateFinal'](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1b3'));}else{_0x351428[_0x8b65('0x100')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1b3'));}}break;case'5':_0x536c6b[_0x8b65('0x1b4')]+=0x1;_0x36a2c2['state']=0x5;_0x36a2c2['statedesc']=_0x8b65('0x1b5');_0x36a2c2[_0x8b65('0xec')]+=0x1;_0x36a2c2['countglobal']+=0x1;console['log'](_0x8b65('0x1b6'),ut[_0x8b65('0x1a9')](_0x382720,'busy'));ami[_0x8b65('0x49')]('custom:status_busy',ut[_0x8b65('0x1a9')](_0x382720,_0x8b65('0x1b7')));_0x351428[_0x8b65('0xc4')](_0x36a2c2)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x1b8')));if(_0x351428[_0x8b65('0x193')](0x5,_0x382720,_0x536c6b)){if(_0x36a2c2['countbusyretry']>=_0x536c6b[_0x8b65('0x197')]){_0x351428[_0x8b65('0xf4')](_0x36a2c2,_0x48a3f0,_0x2fa09f,'reason\x205\x20busy');}else{_0x351428[_0x8b65('0x100')](_0x36a2c2,_0x48a3f0,_0x2fa09f,'reason\x205\x20busy');}}break;case'8':_0x536c6b[_0x8b65('0x5c')]+=0x1;_0x36a2c2[_0x8b65('0xe0')]=0x8;_0x36a2c2['statedesc']=_0x8b65('0x1b9');_0x36a2c2[_0x8b65('0xed')]+=0x1;_0x36a2c2[_0x8b65('0xe9')]+=0x1;_0x351428[_0x8b65('0xc4')](_0x36a2c2)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x1ba')));if(_0x351428['checkRetriveMax'](0x8,_0x382720,_0x536c6b)){if(_0x36a2c2[_0x8b65('0xed')]>=_0x536c6b['dialCongestionMaxRetry']){_0x351428[_0x8b65('0xf4')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1bb'));}else{_0x351428[_0x8b65('0x100')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1bb'));}}break;case'11':_0x536c6b[_0x8b65('0x1bc')]+=0x1;_0x36a2c2[_0x8b65('0xe0')]=0xb;_0x36a2c2[_0x8b65('0xe1')]=_0x8b65('0x11b');_0x36a2c2[_0x8b65('0xef')]+=0x1;_0x36a2c2[_0x8b65('0xe9')]+=0x1;_0x351428[_0x8b65('0xc4')](_0x36a2c2)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x11e')));if(_0x351428[_0x8b65('0x193')](0xb,_0x382720,_0x536c6b)){if(_0x36a2c2[_0x8b65('0xef')]>=_0x536c6b[_0x8b65('0x19f')]){_0x351428[_0x8b65('0xf4')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1bd'));}else{_0x351428[_0x8b65('0x100')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1bd'));}}break;case'20':_0x536c6b[_0x8b65('0x1be')]+=0x1;_0x36a2c2['state']=0x14;_0x36a2c2['statedesc']='AgentReject';_0x36a2c2['countagentrejectretry']+=0x1;_0x36a2c2[_0x8b65('0xe9')]+=0x1;_0x351428[_0x8b65('0xc4')](_0x36a2c2)[_0x8b65('0xab')](loggerCatch(_0x8b65('0x1bf')));if(_0x351428[_0x8b65('0x193')](0x14,_0x382720,_0x536c6b)){if(_0x36a2c2[_0x8b65('0xf0')]>=_0x536c6b[_0x8b65('0x1a1')]){_0x351428[_0x8b65('0xf4')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1c0'));}else{_0x351428[_0x8b65('0x100')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x8b65('0x1c0'));}}break;default:_0x536c6b[_0x8b65('0x106')]+=0x1;_0x36a2c2[_0x8b65('0xe0')]=0xc;_0x36a2c2[_0x8b65('0xe1')]=_0x1725c7[_0x8b65('0x1a6')];_0x351428[_0x8b65('0xc4')](_0x36a2c2)[_0x8b65('0xab')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x351428[_0x8b65('0x193')](_0x1725c7[_0x8b65('0x1a6')],_0x382720,_0x536c6b)){if(_0x36a2c2[_0x8b65('0xec')]+_0x36a2c2['countcongestionretry']+_0x36a2c2[_0x8b65('0xfe')]+_0x36a2c2[_0x8b65('0xee')]+_0x36a2c2[_0x8b65('0xff')]+_0x36a2c2[_0x8b65('0xef')]+_0x36a2c2[_0x8b65('0xe8')]+_0x36a2c2[_0x8b65('0xf0')]>=_0x536c6b['dialGlobalMaxRetry']){_0x351428[_0x8b65('0x100')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x1725c7[_0x8b65('0x1a6')]);}else{_0x351428[_0x8b65('0xf4')](_0x36a2c2,_0x48a3f0,_0x2fa09f,_0x1725c7[_0x8b65('0x1a6')]);}}}});};Dialer[_0x8b65('0x18')][_0x8b65('0x100')]=function(_0xd97558,_0x176256,_0x2a08e1,_0xf20676){var _0x18f44c=new Final(_0xd97558);_0x18f44c[_0x8b65('0xe0')]=0xf;_0x18f44c[_0x8b65('0xe1')]=_0x8b65('0x1c1');this['createStateFinal'](_0x18f44c,_0x176256,_0x2a08e1,_0xf20676);};Dialer[_0x8b65('0x18')][_0x8b65('0xf4')]=function(_0x4fd996,_0x1ee819,_0x3341dc,_0x4bfa57){this[_0x8b65('0xc2')](_0x4fd996)['then'](function(_0x48e3a8){return _0x1ee819(msgResponse(_0x8b65('0x1a4'),_0x8b65('0x1c2'),_0x4bfa57));})[_0x8b65('0xab')](function(_0x2d8c7b){return _0x3341dc(msgResponse(_0x8b65('0x1c3'),_0x8b65('0x13f'),_0x8b65('0x1c4')));});};Dialer[_0x8b65('0x18')][_0x8b65('0x152')]=function(_0x1828dc){var _0x461282=this;var _0x1e3d46=_0x1828dc['dialPredictiveOptimizationPercentage']/0x64;var _0xc0dc75=_0x1828dc[_0x8b65('0x5f')]/(_0x1828dc[_0x8b65('0x5f')]+_0x1828dc[_0x8b65('0x5a')]);var _0x4404e9=Math['round'](_0x1828dc[_0x8b65('0x6b')]*(_0x1828dc['predictiveIntervalMaxThreshold']/0x64));var _0x314884=Math[_0x8b65('0x1c5')](_0x1828dc[_0x8b65('0x6b')]*(_0x1828dc['predictiveIntervalMinThreshold']/0x64));var _0x412cb6=_0x1828dc[_0x8b65('0x9e')]+_0x1828dc['talking'];var _0x179e68=Math[_0x8b65('0x1c6')](_0x1828dc[_0x8b65('0x6d')]*_0x1828dc[_0x8b65('0x6e')]*_0x1828dc['predictiveIntervalHitRate']*_0x1828dc[_0x8b65('0x1c7')]);if(_[_0x8b65('0x80')](_0x1828dc[_0x8b65('0x27')])){if(!_[_0x8b65('0x80')](_0x1828dc[_0x8b65('0x26')])){_0x1828dc[_0x8b65('0x26')]=undefined;loggerPredictive['error'](_0x8b65('0x1c8'),_0x8b65('0x1c9'));}if(!_[_0x8b65('0x80')](_0x1828dc['handlePredictive'])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x8b65('0x1ca'));clearInterval(_0x1828dc['handlePredictive']);_0x1828dc['handlePredictive']=undefined;}_0x1828dc[_0x8b65('0x27')]=moment()[_0x8b65('0x71')](_0x8b65('0xf9'));loggerPredictive[_0x8b65('0x7a')](_0x1828dc[_0x8b65('0x40')],_0x8b65('0x1cb'),_0x1828dc[_0x8b65('0x27')]);this[_0x8b65('0x150')](_0x1828dc,0x1);}else if(ifInterval(_0x1828dc[_0x8b65('0x1cc')],_0x1828dc[_0x8b65('0x27')])){this[_0x8b65('0x150')](_0x1828dc,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x1828dc[_0x8b65('0x27')],_0x1828dc[_0x8b65('0x40')]);_0x1828dc['erlangCalls']=0x0;_0x1828dc[_0x8b65('0x68')]=0x0;}else if(_0x1e3d46<_0xc0dc75&&_0x1828dc[_0x8b65('0x1cd')]===_0x8b65('0x1ce')){freeVariablesPredictive(_0x1828dc);loggerPredictive['info'](_0x8b65('0x1cf'),_0x8b65('0x1d0'),_0xc0dc75,'startProgressive',_0x1828dc[_0x8b65('0x40')]);}else if(_0x179e68<_0x1828dc['predictiveIntervalErlangCallsDroppedCalls']&&_0x1828dc[_0x8b65('0x1cd')]===_0x8b65('0x1ce')){freeVariablesPredictive(_0x1828dc);loggerPredictive['info'](_0x8b65('0x1d1'),_0x8b65('0x1d2'),_0x179e68,_0x8b65('0x1d3'),_0x1828dc[_0x8b65('0x68')],_0x8b65('0x27'),_0x1828dc[_0x8b65('0x40')]);}else if(!ifInterval(_0x1828dc[_0x8b65('0x1cc')],_0x1828dc[_0x8b65('0x27')])&&_['isUndefined'](_0x1828dc['startPredictive'])&&!_[_0x8b65('0x80')](_0x1828dc[_0x8b65('0x27')])){_0x1828dc[_0x8b65('0x26')]=moment()[_0x8b65('0x71')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8b65('0x7a')](_0x1828dc[_0x8b65('0x40')],'started\x20in\x20predictive\x20at',_0x1828dc[_0x8b65('0x26')]);this[_0x8b65('0xb8')](_0x1828dc[_0x8b65('0x1cc')])['then'](this[_0x8b65('0x1d4')](_0x1828dc))[_0x8b65('0xb2')](mergeDataErlangB(_0x1828dc))['then'](this[_0x8b65('0x1d5')](_0x1828dc))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1828dc));}else if(!ifInterval(_0x1828dc[_0x8b65('0x1cc')],_0x1828dc[_0x8b65('0x26')])){_0x1828dc['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x1828dc[_0x8b65('0x26')]=moment()[_0x8b65('0x71')](_0x8b65('0xf9'));loggerPredictive[_0x8b65('0x7a')](_0x1828dc[_0x8b65('0x40')],_0x8b65('0x1d6'),_0x1828dc[_0x8b65('0x26')]);clearInterval(_0x1828dc[_0x8b65('0x8b')]);_0x1828dc['handlePredictive']=undefined;this[_0x8b65('0xb8')](_0x1828dc[_0x8b65('0x1cc')])['then'](this[_0x8b65('0x1d4')](_0x1828dc))[_0x8b65('0xb2')](mergeDataErlangB(_0x1828dc))[_0x8b65('0xb2')](this[_0x8b65('0x1d5')](_0x1828dc))[_0x8b65('0xab')](loggerCatchPredictive(_0x8b65('0x1d7'),_0x1828dc));}else if(_0x1828dc[_0x8b65('0x6b')]&&_0x412cb6<_0x1828dc[_0x8b65('0x6b')]-_0x314884){freeVariablesPredictive(_0x1828dc);loggerPredictive[_0x8b65('0x7a')](_0x1828dc[_0x8b65('0x40')],_0x8b65('0x1d8'),_0x412cb6,_0x8b65('0x1d9'),_0x1828dc[_0x8b65('0x6b')],'-',_0x314884,'=',_0x1828dc[_0x8b65('0x6b')]-_0x314884,')');}else if(_0x1828dc[_0x8b65('0x6b')]&&_0x412cb6>_0x1828dc[_0x8b65('0x6b')]+_0x4404e9){freeVariablesPredictive(_0x1828dc);loggerPredictive[_0x8b65('0x7a')](_0x1828dc['name'],_0x8b65('0x1d8'),_0x412cb6,_0x8b65('0x1da'),_0x1828dc['predictiveIntervalAvailable'],'+',_0x4404e9,'=',_0x1828dc[_0x8b65('0x6b')]+_0x4404e9,')');}};Dialer['prototype']['getDataPredictive']=function(_0x21d913){var _0x862725=this;return function(_0x33331e){return new BPromise(function(_0x3f7719,_0xd10d3b){_[_0x8b65('0xca')](_0x21d913,_0x33331e[0x0]);if(checkGetDataPredictive(_0x33331e[0x0])){var _0x1dd36e=_0x21d913[_0x8b65('0x6b')]=_0x21d913[_0x8b65('0x51')]+_0x21d913[_0x8b65('0x9e')];var _0x515577=_0x21d913[_0x8b65('0x1cc')]*0x3c;var _0x3f32c6=_0x33331e[0x0][_0x8b65('0x66')]+_0x33331e[0x0][_0x8b65('0x65')];var _0x4877b2=(_0x33331e[0x0][_0x8b65('0x64')]+_0x33331e[0x0][_0x8b65('0x67')]+_0x33331e[0x0][_0x8b65('0x7c')])/_0x33331e[0x0][_0x8b65('0x6c')];_0x21d913['predictiveIntervalHitRate']=_0x4877b2>0x0?_0x4877b2:0x1;switch(_0x21d913[_0x8b65('0x1cd')]){case _0x8b65('0x1ce'):var _0x2fa119=_0x21d913[_0x8b65('0x1db')]/0x64;return _0x862725['abandonmentRate'](_0x1dd36e,_0x515577,_0x3f32c6,_0x4877b2,_0x2fa119)[_0x8b65('0xb2')](function(_0xd94ec8){return _0x3f7719(_0xd94ec8);});case'agentBusyFactor':var _0x102460=_0x21d913['dialPredictiveOptimizationPercentage']/0x64;return _0x862725[_0x8b65('0x1dc')](_0x1dd36e,_0x515577,_0x3f32c6,_0x4877b2,_0x102460)[_0x8b65('0xb2')](function(_0x57c0b7){return _0x3f7719(_0x57c0b7);});default:return _0xd10d3b(msgResponse(_0x8b65('0x1dd'),_0x8b65('0x13f'),_0x8b65('0x1de')));}}else{return _0xd10d3b(msgResponse(_0x8b65('0x1dd'),_0x8b65('0x13f'),_0x8b65('0x1df')));}});};};Dialer[_0x8b65('0x18')][_0x8b65('0x1e0')]=function(_0x35249c){var _0xaa91d3=this;return function(_0x307fc0){return new BPromise(function(_0x477772,_0xff8560){_[_0x8b65('0xca')](_0x35249c,_0x307fc0[0x0]);if(checkGetDataPredictive(_0x307fc0[0x0])){loggerPredictive[_0x8b65('0x7a')](JSON[_0x8b65('0x47')](_0x307fc0[0x0]));if(_0x35249c[_0x8b65('0x1cd')]===_0x8b65('0x1ce')){return _0xaa91d3['getVoiceQueueRtPauses'](_0x35249c['id'])[_0x8b65('0xb2')](function(_0x13c35d){var _0x35b856=_0x35249c[_0x8b65('0x4e')]-_0x13c35d[0x0]['outboundQueuePauses'];var _0x5cdffc=_0x35249c[_0x8b65('0x1cc')]*0x3c;var _0xfd5509=_0x307fc0[0x0][_0x8b65('0x66')]+_0x307fc0[0x0]['predictiveIntervalAvgHoldtime'];var _0xfa8aa6=(_0x307fc0[0x0][_0x8b65('0x64')]+_0x307fc0[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x307fc0[0x0][_0x8b65('0x7c')])/_0x307fc0[0x0][_0x8b65('0x6c')];var _0x29a725=_0x35249c[_0x8b65('0x1db')]/0x64;_0x35249c['predictiveIntervalPauses']=_0x13c35d[0x0][_0x8b65('0x1e1')]||0x0;_0x35249c['predictiveIntervalHitRate']=_0xfa8aa6>0x0?_0xfa8aa6:0x1;return _0xaa91d3[_0x8b65('0x1e2')](_0x35b856,_0x5cdffc,_0xfd5509,_0xfa8aa6,_0x29a725);})[_0x8b65('0xb2')](function(_0x163f3c){return _0x477772(_0x163f3c);})['catch'](function(_0x3231b3){return _0xff8560(msgResponse('[CatchErlangB]',_0x8b65('0x13f'),JSON[_0x8b65('0x47')](_0x3231b3)));});}if(_0x35249c[_0x8b65('0x1cd')]===_0x8b65('0x1e3')){return _0xaa91d3[_0x8b65('0xc1')](_0x35249c['id'])[_0x8b65('0xb2')](function(_0x2459b3){var _0x3b51f1=_0x35249c['loggedIn']-_0x2459b3[0x0]['outboundQueuePauses'];var _0x1210e3=_0x35249c[_0x8b65('0x1cc')]*0x3c;var _0x529469=_0x307fc0[0x0][_0x8b65('0x66')]+_0x307fc0[0x0][_0x8b65('0x65')];var _0x470a73=(_0x307fc0[0x0][_0x8b65('0x64')]+_0x307fc0[0x0][_0x8b65('0x67')]+_0x307fc0[0x0][_0x8b65('0x7c')])/_0x307fc0[0x0][_0x8b65('0x6c')];var _0x6e29f7=_0x35249c[_0x8b65('0x1db')]/0x64;_0x35249c[_0x8b65('0x6a')]=_0x2459b3[0x0][_0x8b65('0x1e1')]||0x0;_0x35249c[_0x8b65('0x69')]=_0x470a73>0x0?_0x470a73:0x1;return _0xaa91d3[_0x8b65('0x1dc')](_0x3b51f1,_0x1210e3,_0x529469,_0x470a73,_0x6e29f7);})[_0x8b65('0xb2')](function(_0x118617){return _0x477772(_0x118617);})['catch'](function(_0x38eeb2){return _0xff8560(msgResponse(_0x8b65('0x1e4'),_0x8b65('0x13f'),JSON['stringify'](_0x38eeb2)));});}}else{return _0xff8560(msgResponse(_0x8b65('0x1dd'),_0x8b65('0x13f'),_0x8b65('0x1df')));}});};};Dialer[_0x8b65('0x18')]['startMethodPredictive']=function(_0x2b0d5f){var _0x31c6cc=this;return function(){var _0xd33f73=0x0;var _0x3efb7e=Math[_0x8b65('0x1c6')](_0x2b0d5f['erlangCallToSecond']*0x3e8);if(_0x3efb7e>0x0){_0x3efb7e=_0x3efb7e<0x64?0x64:_0x3efb7e;loggerPredictive['info'](_0x2b0d5f[_0x8b65('0x40')],_0x8b65('0x1e5'),_0x3efb7e,_0x8b65('0x48'));_0x2b0d5f[_0x8b65('0x8b')]=setInterval(function(){_0x31c6cc['handlePredictive'](_0x2b0d5f);loggerPredictiveCalls[_0x8b65('0x7a')](_0x8b65('0x1e6'),_0xd33f73+=0x1);},_0x3efb7e);}else{loggerPredictive[_0x8b65('0x7a')](_0x2b0d5f[_0x8b65('0x40')],_0x8b65('0x1e7'));}};};Dialer[_0x8b65('0x18')][_0x8b65('0x1e8')]=function(_0x3f68ba,_0x4b163c){var _0x5dab0d=this;return function(_0x371e34){if(_['isEmpty'](_0x371e34)){if(_[_0x8b65('0xa9')](_0x4b163c['UserId'])||!_0x4b163c['recallme']){if(_0x3f68ba[_0x8b65('0x56')]===_0x8b65('0x153')){_0x3f68ba['queueStatusComplete']=_[_0x8b65('0x80')](_0x3f68ba['queueStatusComplete'])?!![]:_0x3f68ba['queueStatusComplete'];var _0x546ba2=uuid['v4']();_0x5dab0d['actions'][_0x546ba2]=new Action(_0x3f68ba,_0x4b163c,_0x546ba2);loggerBooked[_0x8b65('0x7a')](_0x8b65('0x1e9'),_0x546ba2,_0x8b65('0x1ea'),JSON[_0x8b65('0x47')](_0x3f68ba[_0x8b65('0x128')]),_0x8b65('0x1eb'),_0x3f68ba['name']);if(_0x3f68ba[_0x8b65('0x128')]){_0x3f68ba[_0x8b65('0x128')]=![];_0x5dab0d[_0x8b65('0x124')][_0x5dab0d[_0x8b65('0x22')][_0x546ba2]['queue']]=[];ami['Action']({'actionid':_0x546ba2,'action':_0x8b65('0x1ec'),'queue':_0x3f68ba[_0x8b65('0x40')]})['catch'](function(_0x3252e7){_0x5dab0d[_0x8b65('0xaf')](_0x3f68ba);_0x5dab0d[_0x8b65('0xba')]({'active':![],'ContactId':_0x5dab0d[_0x8b65('0x22')][_0x546ba2][_0x8b65('0xcb')],'ListId':_0x5dab0d[_0x8b65('0x22')][_0x546ba2][_0x8b65('0xcc')],'VoiceQueueId':_0x5dab0d[_0x8b65('0x22')][_0x546ba2][_0x8b65('0xce')]||undefined,'CampaignId':_0x5dab0d[_0x8b65('0x22')][_0x546ba2][_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x1ed')));delete _0x5dab0d[_0x8b65('0x22')][_0x546ba2];});}else{loggerBooked[_0x8b65('0x7a')](_0x8b65('0x1ee'),JSON[_0x8b65('0x47')](_0x3f68ba['queueStatusComplete']),'Queue:\x20',_0x3f68ba[_0x8b65('0x40')]);_0x5dab0d[_0x8b65('0xaf')](_0x3f68ba);_0x5dab0d[_0x8b65('0xba')]({'active':![],'ContactId':_0x5dab0d[_0x8b65('0x22')][_0x546ba2][_0x8b65('0xcb')],'ListId':_0x5dab0d[_0x8b65('0x22')][_0x546ba2][_0x8b65('0xcc')],'VoiceQueueId':_0x5dab0d[_0x8b65('0x22')][_0x546ba2]['VoiceQueueId']||undefined,'CampaignId':_0x5dab0d[_0x8b65('0x22')][_0x546ba2][_0x8b65('0xcf')]||undefined})[_0x8b65('0xab')](loggerCatch(_0x8b65('0x1ed')));delete _0x5dab0d[_0x8b65('0x22')][_0x546ba2];}}else{return _0x5dab0d['actionOriginate'](_0x3f68ba,_0x4b163c);}}else{if(getDiff(_0x4b163c[_0x8b65('0x1ef')])<_0x3f68ba['dialRecallMeTimeout']*0x3c){if(_0x4b163c[_0x8b65('0x1f0')]&&!_0x4b163c['Agent'][_0x8b65('0x1f1')]){_0x5dab0d[_0x8b65('0x1b')][_0x8b65('0x12a')](_0x4b163c['id'])[_0x8b65('0x12c')](function(){_0x5dab0d[_0x8b65('0xaf')](_0x3f68ba);});}else{_0x5dab0d['unlockContact']({'active':![]},_0x4b163c['id'],0x1)[_0x8b65('0x12c')](function(){console['log'](_0x8b65('0x1f2'));_0x5dab0d[_0x8b65('0xaf')](_0x3f68ba);});}}else{_0x3f68ba[_0x8b65('0x63')]+=0x1;_0x5dab0d[_0x8b65('0xaf')](_0x3f68ba);if(_0x3f68ba[_0x8b65('0x1f3')]){_0x5dab0d[_0x8b65('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4b163c[_0x8b65('0xcb')],'ListId':_0x4b163c[_0x8b65('0xcc')],'VoiceQueueId':_0x4b163c[_0x8b65('0xce')]||undefined,'CampaignId':_0x4b163c['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5dab0d[_0x8b65('0xc4')](createObjHistory(_0x3f68ba,_0x4b163c,_0x8b65('0x1f4'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x8b65('0x1f5')));}else{_0x5dab0d[_0x8b65('0xc9')](createObjHistory(_0x3f68ba,_0x4b163c,_0x8b65('0x1f6'),0x16,_0x8b65('0x1f7')),_0x8b65('0x1f8'),_0x8b65('0x1f9'));}}}}else{_0x3f68ba[_0x8b65('0x5b')]+=0x1;_0x5dab0d[_0x8b65('0xc9')](createObjHistory(_0x3f68ba,_0x4b163c,_0x8b65('0x1fa'),0xd,_0x8b65('0x1fb')),_0x8b65('0x1fc'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer['prototype']['handleIvr']=function(_0x4bdcb9){var _0x3f2c26=this;var _0x410554=[];var _0x523d78=_0x4bdcb9['limitCalls']-_0x4bdcb9[_0x8b65('0x95')]-_0x4bdcb9[_0x8b65('0x1fd')];emitCampaignSummary(_0x4bdcb9);if(_0x523d78>0x0){if(_0x523d78>this['maxNumberOriginate']){_0x523d78=this[_0x8b65('0x20')];}_0x4bdcb9['temp']+=_0x523d78;this[_0x8b65('0xc0')](_0x4bdcb9['id'],_0x523d78,_0x4bdcb9[_0x8b65('0x1fe')])[_0x8b65('0xb2')](function(_0x4a0801){_0x4bdcb9[_0x8b65('0x1fd')]-=_0x523d78;_0x4bdcb9[_0x8b65('0x1fd')]=_0x4bdcb9['temp']>0x0?_0x4bdcb9[_0x8b65('0x1fd')]:0x0;if(!checkContactEmpty(_0x4a0801)){_0x4bdcb9[_0x8b65('0x3c')]=_0x8b65('0x9a');logger[_0x8b65('0x7a')](_0x8b65('0x1ff')+_0x4bdcb9[_0x8b65('0x40')]);}else{_0x4bdcb9[_0x8b65('0x95')]+=_0x4a0801[_0x8b65('0x93')];_0x4bdcb9[_0x8b65('0x3c')]=_0x8b65('0x200');for(var _0x284a1a=0x0;_0x284a1a<_0x4a0801[_0x8b65('0x93')];_0x284a1a+=0x1){_0x4bdcb9[_0x8b65('0x201')]+=0x1;if(_['isNil'](_0x4a0801[_0x284a1a])||_[_0x8b65('0xa9')](_0x4a0801[_0x284a1a][_0x8b65('0x165')])||_[_0x8b65('0xa9')](_0x4a0801[_0x284a1a][_0x8b65('0x165')]['phone'])){_0x3f2c26['emptyContact'](_0x8b65('0x202'),_0x4bdcb9,_0x4a0801[_0x284a1a]);}else{_0x3f2c26[_0x8b65('0xb7')](_['pick'](_0x4a0801[_0x284a1a],['CampaignId',_0x8b65('0x203')]))[_0x8b65('0xb2')](_0x3f2c26[_0x8b65('0x1e8')](_0x4bdcb9,_0x4a0801[_0x284a1a]))[_0x8b65('0xab')](_0x3f2c26['loggerHandler'](_0x8b65('0x204'),_0x4bdcb9));}}}})[_0x8b65('0xab')](loggerGetContactDialer(_0x8b65('0x205'),_0x4bdcb9,_0x523d78));}};Dialer[_0x8b65('0x18')][_0x8b65('0x150')]=function(_0x5cfb17,_0xad5606){var _0x1f0d8e=this;var _0x3ceb10=[];var _0x5dec86=_0xad5606>=0x1?_0xad5606:0x1;var _0x3069fc=[];if(_0x5cfb17['dialMethod']===_0x8b65('0x153')){_0x5dec86=0x1;}var _0x34d841=Math[_0x8b65('0x1c6')](_0x5cfb17['available']*_0x5dec86)-_0x5cfb17['originated']-_0x5cfb17['temp'];emitVoiceQueueSummary(_0x5cfb17);if(_0x5cfb17[_0x8b65('0x206')]>0x0){var _0x585639=_0x5cfb17['dialLimitQueue']-_0x5cfb17['originated']-_0x5cfb17['talking']-_0x5cfb17[_0x8b65('0x1fd')]-_0x5cfb17['pTalking'];if(_0x34d841>_0x585639){_0x34d841=_0x585639;}}if(_0x34d841>0x0){if(_0x5cfb17[_0x8b65('0x56')]===_0x8b65('0x153')){_0x34d841=0x1;}if(_0x34d841>this[_0x8b65('0x20')]){_0x34d841=this[_0x8b65('0x20')];}_0x5cfb17['temp']+=_0x34d841;for(var _0x503ecb in this[_0x8b65('0x1e')]){if(this['agents'][_0x8b65('0x94')](_0x503ecb)){if(this[_0x8b65('0x1e')][_0x503ecb][_0x8b65('0xe0')]===_0x8b65('0x207')&&this['agents'][_0x503ecb][_0x8b65('0xd4')]===_0x8b65('0xd5')){_0x3ceb10[_0x8b65('0x125')](this[_0x8b65('0x1e')][_0x503ecb]['id']);}}}this[_0x8b65('0xbe')](_0x5cfb17['id'],_0x3ceb10,_0x34d841,_0x5cfb17[_0x8b65('0x1fe')])['then'](function(_0x1af58b){_0x5cfb17[_0x8b65('0x1fd')]-=_0x34d841;_0x5cfb17['temp']=_0x5cfb17[_0x8b65('0x1fd')]>0x0?_0x5cfb17[_0x8b65('0x1fd')]:0x0;if(!checkContactEmpty(_0x1af58b)){_0x1f0d8e[_0x8b65('0xb1')](_0x5cfb17)[_0x8b65('0xb2')](sendMessageReschedule(_0x5cfb17))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xb3')));}else{_0x5cfb17['originated']+=_0x1af58b[_0x8b65('0x93')];_0x5cfb17[_0x8b65('0x3c')]=_0x5cfb17['dialMethod']===_0x8b65('0x153')?_0x8b65('0x16e'):_0x8b65('0x200');for(var _0x2286c1=0x0;_0x2286c1<_0x1af58b[_0x8b65('0x93')];_0x2286c1+=0x1){if(_[_0x8b65('0xa9')](_0x1af58b[_0x2286c1])||_[_0x8b65('0xa9')](_0x1af58b[_0x2286c1]['Contact'])||_[_0x8b65('0xa9')](_0x1af58b[_0x2286c1][_0x8b65('0x165')][_0x8b65('0x166')])){_0x1f0d8e['emptyContact']('[actionOriginate]\x20',_0x5cfb17,_0x1af58b[_0x2286c1]);}else{_0x1f0d8e[_0x8b65('0xb5')](_['pick'](_0x1af58b[_0x2286c1],['VoiceQueueId','Contact.phone']))[_0x8b65('0xb2')](_0x1f0d8e['checkContactBlack'](_0x5cfb17,_0x1af58b[_0x2286c1]))[_0x8b65('0xab')](_0x1f0d8e['loggerHandler']('[actionOriginate]\x20',_0x5cfb17));}}}})[_0x8b65('0xab')](loggerGetContactDialer(_0x8b65('0x208'),_0x5cfb17,_0x34d841));}};Dialer[_0x8b65('0x18')][_0x8b65('0x8b')]=function(_0x2f30de){var _0x502294=this;if(_0x2f30de[_0x8b65('0x206')]>0x0){var _0x3ace0c=_0x2f30de[_0x8b65('0x206')]-_0x2f30de[_0x8b65('0x95')]-_0x2f30de[_0x8b65('0x51')];if(_0x3ace0c>0x0){this[_0x8b65('0x209')](_0x2f30de);}else{loggerPredictiveCalls[_0x8b65('0x7a')]('[handlePredictive][limitChannel]');}}else{this[_0x8b65('0x209')](_0x2f30de);}};Dialer[_0x8b65('0x18')]['tryOriginatePredictive']=function(_0x282abb){var _0x9a0a46=this;var _0x5eb7c3=[];_0x282abb['originated']+=0x1;for(var _0x390da6 in this[_0x8b65('0x1e')]){if(this[_0x8b65('0x1e')][_0x8b65('0x94')](_0x390da6)){if(this['agents'][_0x390da6][_0x8b65('0xe0')]===_0x8b65('0x207')&&this['agents'][_0x390da6]['status']===_0x8b65('0xd5')){_0x5eb7c3[_0x8b65('0x125')](this['agents'][_0x390da6]['id']);}}}this[_0x8b65('0xbe')](_0x282abb['id'],_0x5eb7c3,0x1,_0x282abb['dialOrderByScheduledAt'])[_0x8b65('0xb2')](function(_0x5bb096){if(!checkContactEmpty(_0x5bb096)){checkContactLowerLimitOriginate(_0x282abb,0x1,0x0);_0x9a0a46[_0x8b65('0xb1')](_0x282abb)['then'](sendMessageReschedule(_0x282abb))[_0x8b65('0xab')](loggerCatch(_0x8b65('0xb3')));}else{_0x282abb['message']=_0x8b65('0x200');if(_[_0x8b65('0xa9')](_0x5bb096[0x0])||_[_0x8b65('0xa9')](_0x5bb096[0x0][_0x8b65('0x165')])||_['isNil'](_0x5bb096[0x0][_0x8b65('0x165')][_0x8b65('0x166')])){_0x9a0a46[_0x8b65('0xc8')](_0x8b65('0x202'),_0x282abb,_0x5bb096[0x0]);}else{_0x9a0a46[_0x8b65('0xb5')](_[_0x8b65('0x126')](_0x5bb096[0x0],[_0x8b65('0xce'),_0x8b65('0x203')]))[_0x8b65('0xb2')](_0x9a0a46['checkContactBlack'](_0x282abb,_0x5bb096[0x0]))[_0x8b65('0xab')](_0x9a0a46[_0x8b65('0xc7')](_0x8b65('0x20a'),_0x282abb));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x282abb,0x1));emitVoiceQueueSummary(_0x282abb);};Dialer[_0x8b65('0x18')][_0x8b65('0x1e2')]=function(_0xc8736a,_0x50a97b,_0x54719a,_0x413c93,_0x184c5c,_0x3042a2){loggerPredictive['info'](_0x8b65('0x20b'));loggerPredictive['info'](_0x8b65('0x20c'),_0xc8736a);loggerPredictive[_0x8b65('0x7a')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50a97b);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x20d'),_0x54719a);loggerPredictive['info']('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',_0x413c93);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x20e'),_0x184c5c);loggerPredictive[_0x8b65('0x7a')]('---------------------------');return new BPromise(function(_0x1d7263,_0x1018b5){if(_0xc8736a<=0x0||isNaN(_0xc8736a)){return _0x1018b5(msgResponse(_0x8b65('0x20f'),'Error',_0x8b65('0x210')+_0xc8736a));}if(_0x54719a<=0x0||isNaN(_0x54719a)){return _0x1018b5(msgResponse(_0x8b65('0x20f'),_0x8b65('0x46'),_0x8b65('0x211')+_0x54719a));}if(_0x413c93<=0x0||isNaN(_0x413c93)){return _0x1018b5(msgResponse('[abandonmentRate]','Error','p\x20=\x20'+_0x413c93));}if(_0x50a97b<=0x0||isNaN(_0x50a97b)){return _0x1018b5(msgResponse('[abandonmentRate]',_0x8b65('0x46'),'interval\x20=\x20'+_0x50a97b));}if(_0x184c5c<=0x0||isNaN(_0x184c5c)){return _0x1018b5(msgResponse(_0x8b65('0x20f'),'Error','Amax\x20=\x20'+_0x184c5c));}_0x3042a2=_0x3042a2||0x0;var _0x6ebfe9=0x1/_0x54719a;var _0x128150=0x0;var _0x3a0037=0x0;var _0x56ab72=0x0;var _0x34973e=0x0;for(var _0x470d3a=0x0;_0x56ab72<_0x184c5c;_0x470d3a+=0x1){_0x3a0037=_0x470d3a/_0x50a97b;_0x128150=(_0x413c93*_0x3a0037+_0x3042a2)/_0x6ebfe9;_0x56ab72=erlangb(_0x128150,_0xc8736a);_0x34973e=_0x128150/_0xc8736a*(0x1-erlangb(_0x128150,_0xc8736a));}return _0x1d7263({'erlangCalls':_0x470d3a,'erlangCallToSecond':_0x50a97b/_0x470d3a,'erlangAbandonmentRate':_0x56ab72,'erlangBusyFactor':_0x34973e});});};Dialer[_0x8b65('0x18')][_0x8b65('0x1dc')]=function(_0x59080a,_0x50e0fa,_0x343900,_0x396a3d,_0x4abe87,_0x1ff011){loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x212'));loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x20c'),_0x59080a);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x213'),_0x50e0fa);loggerPredictive[_0x8b65('0x7a')](_0x8b65('0x20d'),_0x343900);loggerPredictive['info'](_0x8b65('0x214'),_0x396a3d);loggerPredictive[_0x8b65('0x7a')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4abe87);loggerPredictive['info'](_0x8b65('0x7f'));return new BPromise(function(_0x93079,_0x38255b){if(_0x59080a<=0x0||isNaN(_0x59080a)){return _0x38255b(msgResponse(_0x8b65('0x215'),_0x8b65('0x46'),_0x8b65('0x210')+_0x59080a));}if(_0x343900<=0x0||isNaN(_0x343900)){return _0x38255b(msgResponse(_0x8b65('0x215'),_0x8b65('0x46'),_0x8b65('0x211')+_0x343900));}if(_0x396a3d<=0x0||isNaN(_0x396a3d)){return _0x38255b(msgResponse('[busyFactor]',_0x8b65('0x46'),_0x8b65('0x216')+_0x396a3d));}if(_0x50e0fa<=0x0||isNaN(_0x50e0fa)){return _0x38255b(msgResponse(_0x8b65('0x215'),'Error',_0x8b65('0x217')+_0x50e0fa));}if(_0x4abe87<=0x0||isNaN(_0x4abe87)){return _0x38255b(msgResponse(_0x8b65('0x215'),_0x8b65('0x46'),_0x8b65('0x218')+_0x4abe87));}_0x1ff011=_0x1ff011||0x0;var _0x201ed4=0x1/_0x343900;var _0xca7b6e=0x0;var _0x1e6b71=0x0;var _0x2ee683=0x0;var _0x34bb3e=0x0;for(var _0x249533=0x0;_0x34bb3e<_0x4abe87;_0x249533+=0x1){_0x1e6b71=_0x249533/_0x50e0fa;_0xca7b6e=(_0x396a3d*_0x1e6b71+_0x1ff011)/_0x201ed4;_0x2ee683=erlangb(_0xca7b6e,_0x59080a);_0x34bb3e=_0xca7b6e/_0x59080a*(0x1-erlangb(_0xca7b6e,_0x59080a));}return _0x93079({'erlangCalls':_0x249533,'erlangCallToSecond':_0x50e0fa/_0x249533,'erlangAbandonmentRate':_0x2ee683,'erlangBusyFactor':_0x34bb3e});});};module[_0x8b65('0x219')]=Dialer;
\ No newline at end of file
index d16b0e7..c784895 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32eb=['ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','number','starttime','responsetime','endtime','droptime'];(function(_0x5cf132,_0x3b3804){var _0x202bd4=function(_0x161f9a){while(--_0x161f9a){_0x5cf132['push'](_0x5cf132['shift']());}};_0x202bd4(++_0x3b3804);}(_0x32eb,0xdd));var _0xb32e=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x32eb[_0x352e09];return _0x1b7094;};'use strict';var util=require('util');var _=require(_0xb32e('0x0'));var moment=require(_0xb32e('0x1'));function getSeconds(_0x46044a,_0x119572){var _0x198877=moment(_0x46044a)[_0xb32e('0x2')](0x0);var _0x322f3a=moment(_0x119572)[_0xb32e('0x2')](0x0);return _0x198877[_0xb32e('0x3')](_0x322f3a,'seconds');}function QueueCallerAbandon(_0x5ace59,_0x33fe0c){this[_0xb32e('0x4')]=_0x5ace59[_0xb32e('0x4')];this['type']=_0x5ace59[_0xb32e('0x5')];this[_0xb32e('0x6')]=_0x5ace59[_0xb32e('0x5')]===_0xb32e('0x7')?_0xb32e('0x8'):_0x5ace59[_0xb32e('0x5')];this[_0xb32e('0x9')]=_0x5ace59[_0xb32e('0x9')];this['countcongestionretry']=_0x5ace59[_0xb32e('0xa')];this[_0xb32e('0xb')]=_0x5ace59[_0xb32e('0xb')];this[_0xb32e('0xc')]=_0x5ace59['countbusyretry']+_0x5ace59['countcongestionretry']+_0x5ace59[_0xb32e('0xb')]+_0x5ace59[_0xb32e('0xd')]+_0x5ace59[_0xb32e('0xe')]+_0x5ace59[_0xb32e('0xf')]+_0x5ace59['countmachineretry']+_0x5ace59[_0xb32e('0x10')];this[_0xb32e('0xd')]=_0x5ace59['countnosuchnumberretry'];this[_0xb32e('0xe')]=_0x5ace59[_0xb32e('0xe')];this[_0xb32e('0xf')]=_0x5ace59['countabandonedretry'];this[_0xb32e('0x11')]=_0x5ace59[_0xb32e('0x11')];this[_0xb32e('0x10')]=_0x5ace59[_0xb32e('0x10')];this[_0xb32e('0x12')]=_0x33fe0c[_0xb32e('0x12')];this['calleridname']=_0x5ace59[_0xb32e('0x13')];this['calleridnum']=_0x5ace59[_0xb32e('0x14')];this[_0xb32e('0x15')]=_0x5ace59[_0xb32e('0x15')];this[_0xb32e('0x16')]=_0x5ace59[_0xb32e('0x16')];this['droptime']=_0x5ace59['droptime'];this[_0xb32e('0x17')]=this[_0xb32e('0x18')];this[_0xb32e('0x19')]=getSeconds(_0x5ace59[_0xb32e('0x16')],_0x5ace59[_0xb32e('0x15')]);this[_0xb32e('0x1a')]=getSeconds(this[_0xb32e('0x18')],_0x5ace59[_0xb32e('0x16')]);this[_0xb32e('0x1b')]=0x0;this['queue']=_0x33fe0c['queue'];this[_0xb32e('0x1c')]=_0x33fe0c['connectedlinename'];this[_0xb32e('0x1d')]=_0x33fe0c[_0xb32e('0x1d')];this[_0xb32e('0x1e')]=_0x5ace59[_0xb32e('0x1e')];this[_0xb32e('0x1f')]=_0x5ace59[_0xb32e('0x1f')];this[_0xb32e('0x20')]=_0x5ace59[_0xb32e('0x20')];this[_0xb32e('0x21')]=_0x5ace59[_0xb32e('0x21')];this[_0xb32e('0x22')]=_0x5ace59[_0xb32e('0x22')];this[_0xb32e('0x23')]=_0x5ace59[_0xb32e('0x23')];this[_0xb32e('0x24')]=_0x5ace59['UserId'];this[_0xb32e('0x25')]=_0x5ace59['VoiceQueueId'];this['CampaignId']=_0x5ace59['CampaignId'];this[_0xb32e('0x26')]=_0x5ace59[_0xb32e('0x26')]||'';this[_0xb32e('0x27')]=_0x5ace59[_0xb32e('0x27')]||'';}module[_0xb32e('0x28')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x1c10=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x2210ff,_0x85bbb0){var _0x1e21fb=function(_0xdfa158){while(--_0xdfa158){_0x2210ff['push'](_0x2210ff['shift']());}};_0x1e21fb(++_0x85bbb0);}(_0x1c10,0x15e));var _0x01c1=function(_0x6ff427,_0x1ebe10){_0x6ff427=_0x6ff427-0x0;var _0x28820c=_0x1c10[_0x6ff427];return _0x28820c;};'use strict';var util=require(_0x01c1('0x0'));var _=require(_0x01c1('0x1'));var moment=require('moment');function getSeconds(_0xc00c11,_0x55e7e8){var _0xda1e3e=moment(_0xc00c11)[_0x01c1('0x2')](0x0);var _0x4013b7=moment(_0x55e7e8)[_0x01c1('0x2')](0x0);return _0xda1e3e[_0x01c1('0x3')](_0x4013b7,_0x01c1('0x4'));}function QueueCallerAbandon(_0x31ac31,_0x363874){this[_0x01c1('0x5')]=_0x31ac31[_0x01c1('0x5')];this['type']=_0x31ac31[_0x01c1('0x6')];this['campaigntype']=_0x31ac31[_0x01c1('0x6')]==='outbound'?_0x01c1('0x7'):_0x31ac31[_0x01c1('0x6')];this[_0x01c1('0x8')]=_0x31ac31['countbusyretry'];this[_0x01c1('0x9')]=_0x31ac31[_0x01c1('0x9')];this[_0x01c1('0xa')]=_0x31ac31[_0x01c1('0xa')];this[_0x01c1('0xb')]=_0x31ac31['countbusyretry']+_0x31ac31['countcongestionretry']+_0x31ac31[_0x01c1('0xa')]+_0x31ac31[_0x01c1('0xc')]+_0x31ac31[_0x01c1('0xd')]+_0x31ac31[_0x01c1('0xe')]+_0x31ac31[_0x01c1('0xf')]+_0x31ac31[_0x01c1('0x10')];this['countnosuchnumberretry']=_0x31ac31[_0x01c1('0xc')];this[_0x01c1('0xd')]=_0x31ac31[_0x01c1('0xd')];this[_0x01c1('0xe')]=_0x31ac31[_0x01c1('0xe')];this[_0x01c1('0xf')]=_0x31ac31[_0x01c1('0xf')];this[_0x01c1('0x10')]=_0x31ac31[_0x01c1('0x10')];this[_0x01c1('0x11')]=_0x363874[_0x01c1('0x11')];this[_0x01c1('0x12')]=_0x31ac31[_0x01c1('0x13')];this[_0x01c1('0x14')]=_0x31ac31[_0x01c1('0x15')];this[_0x01c1('0x16')]=_0x31ac31[_0x01c1('0x16')];this[_0x01c1('0x17')]=_0x31ac31[_0x01c1('0x17')];this[_0x01c1('0x18')]=_0x31ac31[_0x01c1('0x18')];this[_0x01c1('0x19')]=this[_0x01c1('0x18')];this[_0x01c1('0x1a')]=getSeconds(_0x31ac31[_0x01c1('0x17')],_0x31ac31[_0x01c1('0x16')]);this['holdtime']=getSeconds(this[_0x01c1('0x18')],_0x31ac31[_0x01c1('0x17')]);this[_0x01c1('0x1b')]=0x0;this['queue']=_0x363874['queue'];this[_0x01c1('0x1c')]=_0x363874[_0x01c1('0x1d')];this[_0x01c1('0x1e')]=_0x363874['reason'];this[_0x01c1('0x1f')]=_0x31ac31['callback'];this[_0x01c1('0x20')]=_0x31ac31[_0x01c1('0x20')];this[_0x01c1('0x21')]=_0x31ac31['callbackat'];this[_0x01c1('0x22')]=_0x31ac31['recallme'];this[_0x01c1('0x23')]=_0x31ac31[_0x01c1('0x23')];this['ListId']=_0x31ac31[_0x01c1('0x24')];this['UserId']=_0x31ac31[_0x01c1('0x25')];this[_0x01c1('0x26')]=_0x31ac31[_0x01c1('0x26')];this[_0x01c1('0x27')]=_0x31ac31['CampaignId'];this[_0x01c1('0x28')]=_0x31ac31[_0x01c1('0x28')]||'';this['originatecalleridname']=_0x31ac31[_0x01c1('0x29')]||'';}module[_0x01c1('0x2a')]=QueueCallerAbandon;
\ No newline at end of file
index 06d77b4..5844c64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87e9=['format','Trunk','name','localstationid','headerinfo','path','AttachmentId','util','lodash','uniqueid','channel'];(function(_0x494d52,_0x2b3e98){var _0x123124=function(_0x32b789){while(--_0x32b789){_0x494d52['push'](_0x494d52['shift']());}};_0x123124(++_0x2b3e98);}(_0x87e9,0x1a9));var _0x987e=function(_0x5780e7,_0xf1a1b8){_0x5780e7=_0x5780e7-0x0;var _0x2b9450=_0x87e9[_0x5780e7];return _0x2b9450;};'use strict';var util=require(_0x987e('0x0'));var _=require(_0x987e('0x1'));var moment=require('moment');function Action(_0xc6c91f,_0x5c334d,_0x355fa6){this[_0x987e('0x2')]=_0xc6c91f||undefined;this[_0x987e('0x3')]=util[_0x987e('0x4')]('%s/%s/%s',_0x5c334d['tech'],_0x5c334d[_0x987e('0x5')][_0x987e('0x6')],_0x355fa6['fax']);this['localstationid']=_0x5c334d[_0x987e('0x7')];this[_0x987e('0x8')]=_0x5c334d[_0x987e('0x8')];this['path']=_0x355fa6[_0x987e('0x9')];this[_0x987e('0xa')]=_0x355fa6[_0x987e('0xa')];}module['exports']=Action;
\ No newline at end of file
+var _0xdbdd=['AttachmentId','exports','util','lodash','moment','uniqueid','format','%s/%s/%s','tech','Trunk','name','localstationid','headerinfo','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xdbdd,0x72));var _0xddbd=function(_0x49fb96,_0x3ad5f5){_0x49fb96=_0x49fb96-0x0;var _0x30c4c7=_0xdbdd[_0x49fb96];return _0x30c4c7;};'use strict';var util=require(_0xddbd('0x0'));var _=require(_0xddbd('0x1'));var moment=require(_0xddbd('0x2'));function Action(_0x3739fc,_0x34b595,_0xb3f1c7){this[_0xddbd('0x3')]=_0x3739fc||undefined;this['channel']=util[_0xddbd('0x4')](_0xddbd('0x5'),_0x34b595[_0xddbd('0x6')],_0x34b595[_0xddbd('0x7')][_0xddbd('0x8')],_0xb3f1c7['fax']);this[_0xddbd('0x9')]=_0x34b595[_0xddbd('0x9')];this[_0xddbd('0xa')]=_0x34b595['headerinfo'];this['path']=_0xb3f1c7[_0xddbd('0xb')];this[_0xddbd('0xc')]=_0xb3f1c7[_0xddbd('0xc')];}module[_0xddbd('0xd')]=Action;
\ No newline at end of file
index 7643cc4..057b2a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e79=['%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid','moment','path','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','../rpc/attachment','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncFaxStatus','receivefax','syncHangup','originateresponse','prototype','context','from-voip-provider','faxAccounts','uniqueid','channels','name','info','\x20syncNewchannel\x20','channel','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','localstationid','filename','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','fax','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','syncOriginateResponse','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format'];(function(_0x14b090,_0x3367cc){var _0x5d3efb=function(_0x483e9c){while(--_0x483e9c){_0x14b090['push'](_0x14b090['shift']());}};_0x5d3efb(++_0x3367cc);}(_0x9e79,0x1ec));var _0x99e7=function(_0x41a3be,_0x3bf035){_0x41a3be=_0x41a3be-0x0;var _0x3a4105=_0x9e79[_0x41a3be];return _0x3a4105;};'use strict';var util=require(_0x99e7('0x0'));var _=require('lodash');var BPromise=require(_0x99e7('0x1'));var uuid=require(_0x99e7('0x2'));var moment=require(_0x99e7('0x3'));var path=require(_0x99e7('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x99e7('0x5'));var logger=require(_0x99e7('0x6'))('fax');var ami=require(_0x99e7('0x7'));var rpcDb=require(_0x99e7('0x8'));var Channel=require(_0x99e7('0x9'));var ut=require(_0x99e7('0xa'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x99e7('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x39ef88){this['channels']={};this['faxAccounts']=_0x39ef88['faxAccounts'];this[_0x99e7('0xc')]=_0x39ef88[_0x99e7('0xc')];this[_0x99e7('0xd')]={};ami['on'](_0x99e7('0xe'),this[_0x99e7('0xf')][_0x99e7('0x10')](this));ami['on']('varset',this[_0x99e7('0x11')][_0x99e7('0x10')](this));ami['on'](_0x99e7('0x12'),this[_0x99e7('0x13')][_0x99e7('0x10')](this));ami['on'](_0x99e7('0x14'),this['syncNewExten'][_0x99e7('0x10')](this));ami['on']('faxstatus',this[_0x99e7('0x15')][_0x99e7('0x10')](this));ami['on'](_0x99e7('0x16'),this['syncReceiveFax']['bind'](this));ami['on']('hangup',this[_0x99e7('0x17')][_0x99e7('0x10')](this));ami['on'](_0x99e7('0x18'),this['syncOriginateResponse'][_0x99e7('0x10')](this));}Fax[_0x99e7('0x19')][_0x99e7('0xf')]=function(_0x290e3e){if(_0x290e3e[_0x99e7('0x1a')]===_0x99e7('0x1b')){for(var _0x5c82d3 in this[_0x99e7('0x1c')]){if(this[_0x99e7('0x1c')]['hasOwnProperty'](_0x5c82d3)){if(_0x290e3e['exten']===this[_0x99e7('0x1c')][_0x5c82d3]['localstationid']){this['channels'][_0x290e3e[_0x99e7('0x1d')]]={};this['channels'][_0x290e3e[_0x99e7('0x1d')]]['channel']=_0x290e3e['channel'];this[_0x99e7('0x1e')][_0x290e3e[_0x99e7('0x1d')]]['id']=this[_0x99e7('0x1c')][_0x5c82d3]['id'];this['channels'][_0x290e3e['uniqueid']][_0x99e7('0x1f')]=this['faxAccounts'][_0x5c82d3]['name'];logger[_0x99e7('0x20')](_0x290e3e[_0x99e7('0x1d')],_0x99e7('0x21'));}}}}if(this['actions'][_0x290e3e[_0x99e7('0x1d')]]){this[_0x99e7('0x1e')][_0x290e3e[_0x99e7('0x1d')]]={};this['channels'][_0x290e3e['uniqueid']][_0x99e7('0x22')]=_0x290e3e[_0x99e7('0x22')];logger['info'](_0x290e3e[_0x99e7('0x1d')],_0x99e7('0x21'));}};Fax[_0x99e7('0x19')][_0x99e7('0x11')]=function(_0x3e9fea){if(this[_0x99e7('0x1e')][_0x3e9fea[_0x99e7('0x1d')]]){for(var _0x2eabff in _0x3e9fea[_0x99e7('0x23')]){if(_0x3e9fea['variable'][_0x99e7('0x24')](_0x2eabff)){this[_0x99e7('0x1e')][_0x3e9fea[_0x99e7('0x1d')]][_0x2eabff]=_0x3e9fea[_0x99e7('0x25')];}}}};Fax[_0x99e7('0x19')][_0x99e7('0x13')]=function(_0xd4af84){if(this[_0x99e7('0x1e')][_0xd4af84[_0x99e7('0x1d')]]){this[_0x99e7('0x1e')][_0xd4af84[_0x99e7('0x1d')]][_0x99e7('0x26')]=_0xd4af84[_0x99e7('0x26')];this['channels'][_0xd4af84['uniqueid']][_0x99e7('0x27')]=_0xd4af84[_0x99e7('0x27')];}};Fax['prototype']['syncNewExten']=function(_0x220121){if(this[_0x99e7('0x1e')][_0x220121[_0x99e7('0x1d')]]){for(var _0x3d27ae in _0x220121['variable']){if(_0x220121[_0x99e7('0x23')]['hasOwnProperty'](_0x3d27ae)){this[_0x99e7('0x1e')][_0x220121[_0x99e7('0x1d')]][_0x3d27ae]=_0x220121[_0x99e7('0x25')];}}}};Fax['prototype'][_0x99e7('0x15')]=function(_0x334463){if(this[_0x99e7('0x1e')][_0x334463[_0x99e7('0x1d')]]){this[_0x99e7('0x1e')][_0x334463['uniqueid']][_0x99e7('0x28')]=_0x334463[_0x99e7('0x28')];this[_0x99e7('0x1e')][_0x334463[_0x99e7('0x1d')]][_0x99e7('0x29')]=_0x334463['status'];this[_0x99e7('0x1e')][_0x334463[_0x99e7('0x1d')]][_0x99e7('0x2a')]=_0x334463[_0x99e7('0x2a')];this['channels'][_0x334463['uniqueid']][_0x99e7('0x2b')]=_0x334463[_0x99e7('0x2b')];logger[_0x99e7('0x20')](_0x334463[_0x99e7('0x1d')],'\x20syncFaxStatus\x20');}};Fax[_0x99e7('0x19')][_0x99e7('0x2c')]=function(_0x56c170){var _0x4b4d56=this;if(this[_0x99e7('0x1e')][_0x56c170['uniqueid']]){var _0x4ce4d2=this['channels'][_0x56c170[_0x99e7('0x1d')]]['id'];this['channels'][_0x56c170[_0x99e7('0x1d')]][_0x99e7('0x2d')]=_0x56c170[_0x99e7('0x2d')];this[_0x99e7('0x1e')][_0x56c170[_0x99e7('0x1d')]][_0x99e7('0x2e')]=_0x56c170[_0x99e7('0x2e')];this[_0x99e7('0x1e')][_0x56c170[_0x99e7('0x1d')]][_0x99e7('0x2a')]=_0x56c170[_0x99e7('0x2a')];this['channels'][_0x56c170['uniqueid']][_0x99e7('0x2f')]=_0x56c170['resolution'];this['channels'][_0x56c170[_0x99e7('0x1d')]][_0x99e7('0x30')]=_0x56c170[_0x99e7('0x30')];this[_0x99e7('0x1e')][_0x56c170[_0x99e7('0x1d')]][_0x99e7('0x2b')]=_0x56c170[_0x99e7('0x2b')];this[_0x99e7('0x1e')][_0x56c170[_0x99e7('0x1d')]]['calleridnum']=_0x56c170['calleridnum'];if(this['channels'][_0x56c170['uniqueid']][_0x99e7('0x2e')]>0x0){tiff2pdf(_0x56c170[_0x99e7('0x2b')],_0x99e7('0x31'),function(_0x58a47c){logger[_0x99e7('0x20')](_0x56c170['uniqueid'],_0x99e7('0x32'),_0x58a47c[_0x99e7('0x33')]);attachment[_0x99e7('0x34')]({'name':path[_0x99e7('0x35')](_0x56c170['filename'])['name'],'basename':path[_0x99e7('0x35')](_0x56c170[_0x99e7('0x2b')])[_0x99e7('0x1f')]+_0x99e7('0x36'),'type':'application/pdf'})[_0x99e7('0x37')](function(_0x4fedf3){faxAccount[_0x99e7('0x38')](_0x4ce4d2,{'from':_0x56c170['calleridnum'],'mapKey':_0x99e7('0x39'),'body':path[_0x99e7('0x35')](_0x56c170['filename'])['name']+_0x99e7('0x36'),'AttachmentId':_0x4fedf3['id']})[_0x99e7('0x3a')](function(_0xc8200a){logger[_0x99e7('0x3b')](_0x56c170[_0x99e7('0x1d')],_0x99e7('0x3c'),JSON['stringify'](_0xc8200a));});})['catch'](function(_0x4f1c4e){logger[_0x99e7('0x3b')](_0x56c170[_0x99e7('0x1d')],_0x99e7('0x3d'),JSON[_0x99e7('0x3e')](_0x4f1c4e));});});}logger['info'](_0x56c170[_0x99e7('0x1d')],_0x99e7('0x3d'));}};Fax[_0x99e7('0x19')][_0x99e7('0x3f')]=function(_0x38320e){if(this[_0x99e7('0xd')][_0x38320e['uniqueid']]){_[_0x99e7('0x40')](this['channels'][_0x38320e['uniqueid']],_[_0x99e7('0x41')](_0x38320e,['response',_0x99e7('0x42')]));}};function updateStatus(_0xc431d2){if(_0xc431d2[_0x99e7('0x43')]){faxMessage[_0x99e7('0x44')](_0xc431d2[_0x99e7('0x43')],{'failMessage':_0x99e7('0x45')})[_0x99e7('0x37')](function(_0x4c9a23){ut[_0x99e7('0x46')]('[Fax][Message][Error][Updated]',_0x4c9a23);})['catch'](function(_0x3c2d5a){ut['logger'](_0x99e7('0x47'),_0x3c2d5a);});}else{ut[_0x99e7('0x46')](_0x99e7('0x48'));}}Fax[_0x99e7('0x19')][_0x99e7('0x49')]=function(_0x6f243,_0x1e90df,_0x438c61){var _0x126cb3=this;var _0x89247e={};if(_0x1e90df){_0x89247e={'read':_0x1e90df};}else{_0x89247e={'failMessage':_0x438c61};}if(this[_0x99e7('0xd')][_0x6f243][_0x99e7('0x43')]){faxMessage['update'](this['actions'][_0x6f243]['AttachmentId'],_0x89247e)[_0x99e7('0x37')](function(_0x4f1d11){ut[_0x99e7('0x46')](_0x99e7('0x4a'),_0x4f1d11);})['catch'](function(_0x83ece2){ut[_0x99e7('0x46')](_0x99e7('0x4b'),_0x83ece2);})[_0x99e7('0x4c')](function(){delete _0x126cb3[_0x99e7('0x1e')][_0x6f243];delete _0x126cb3[_0x99e7('0xd')][_0x6f243];});}else{ut[_0x99e7('0x46')](_0x99e7('0x4d'));delete this[_0x99e7('0x1e')][_0x6f243];delete this['actions'][_0x6f243];}};Fax[_0x99e7('0x19')][_0x99e7('0x17')]=function(_0xa5f21){var _0x1c1c27=this;if(this[_0x99e7('0x1e')][_0xa5f21[_0x99e7('0x1d')]]){if(this[_0x99e7('0xd')][_0xa5f21[_0x99e7('0x1d')]]){this[_0x99e7('0x1e')][_0xa5f21[_0x99e7('0x1d')]]['id']=this['actions'][_0xa5f21[_0x99e7('0x1d')]]['id'];this[_0x99e7('0x1e')][_0xa5f21['uniqueid']][_0x99e7('0x1f')]=this[_0x99e7('0xd')][_0xa5f21[_0x99e7('0x1d')]][_0x99e7('0x1f')];}logger[_0x99e7('0x20')](_0xa5f21[_0x99e7('0x1d')],this[_0x99e7('0xd')][_0xa5f21[_0x99e7('0x1d')]]?_0x99e7('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0x99e7('0x3e')](this[_0x99e7('0x1e')][_0xa5f21['uniqueid']]));if(this['actions'][_0xa5f21[_0x99e7('0x1d')]]){if(this[_0x99e7('0x1e')][_0xa5f21[_0x99e7('0x1d')]][_0x99e7('0x4f')]>0x0&&this[_0x99e7('0x1e')][_0xa5f21[_0x99e7('0x1d')]][_0x99e7('0x50')]===_0x99e7('0x51')){this['updateStatus'](_0xa5f21[_0x99e7('0x1d')],!![]);}else{this[_0x99e7('0x49')](_0xa5f21[_0x99e7('0x1d')],![],this[_0x99e7('0x1e')][_0xa5f21[_0x99e7('0x1d')]][_0x99e7('0x52')]?_0x99e7('0x53')+this[_0x99e7('0x1e')][_0xa5f21[_0x99e7('0x1d')]][_0x99e7('0x52')]:_0x99e7('0x54'));}}}};Fax[_0x99e7('0x19')][_0x99e7('0x55')]=function(_0x2db60f){var _0x20798d=this;return new BPromise(function(_0x4f2d83,_0x1bb15f){_0x20798d['execOriginate'](_0x2db60f,_0x20798d[_0x99e7('0x1c')][_0x2db60f[_0x99e7('0x56')]])[_0x99e7('0x37')](function(_0x22d6f6){ut[_0x99e7('0x46')](_0x99e7('0x57'),_0x22d6f6);_0x4f2d83(ut['message']('Fax\x20received'));})[_0x99e7('0x3a')](function(_0x36f0d1){ut[_0x99e7('0x46')](_0x99e7('0x58'),_0x36f0d1);updateStatus(_0x2db60f);_0x1bb15f(ut[_0x99e7('0x33')](_0x99e7('0x59')));});});};Fax[_0x99e7('0x19')][_0x99e7('0x5a')]=function(_0x3b6091){var _0x3070b1=this;return new BPromise(function(_0x4c1128,_0x3d8e9c){var _0x5ce7c6=_0x3070b1[_0x99e7('0x5b')](_0x3070b1['faxAccounts'][_0x3b6091['FaxAccountId']][_0x99e7('0x5c')],_0x3b6091);if(_0x5ce7c6[_0x99e7('0x5d')]){_0x4c1128(ut[_0x99e7('0x33')](_0x99e7('0x5e')));}else{_0x3d8e9c(ut['message'](_0x5ce7c6[_0x99e7('0x33')]));}});};function originate(_0x268124,_0xd93986,_0x36dc70){return new BPromise(function(_0x313b18,_0x14e94b){if(_0x36dc70){var _0x5d69e1=util['format'](_0x99e7('0x5f'),path['parse'](_0x268124[_0x99e7('0x4')])[_0x99e7('0x1f')],_0x268124[_0x99e7('0x4')]);gs[_0x99e7('0x60')](_0x5d69e1)[_0x99e7('0x37')](function(){_0x268124[_0x99e7('0x4')]=util[_0x99e7('0x61')](_0x99e7('0x62'),path[_0x99e7('0x35')](_0x268124[_0x99e7('0x4')])[_0x99e7('0x63')],path[_0x99e7('0x35')](_0x268124[_0x99e7('0x4')])['name']);_0xd93986[_0x99e7('0x64')]=_0x268124[_0x99e7('0x4')];ut[_0x99e7('0x46')](_0x99e7('0x65'),'');ami[_0x99e7('0x66')](ut[_0x99e7('0x67')](_0x268124,_0xd93986))[_0x99e7('0x37')](function(_0x104c42){_0x313b18(_0x104c42);})[_0x99e7('0x3a')](function(_0x28f8e1){_0x14e94b(_0x28f8e1);});})[_0x99e7('0x3a')](function(_0x162d9f){_0x14e94b(_0x162d9f);});}else{ami[_0x99e7('0x66')](ut[_0x99e7('0x67')](_0x268124,_0xd93986))['then'](function(_0x12ce9c){_0x313b18(_0x12ce9c);})[_0x99e7('0x3a')](function(_0x331888){_0x14e94b(_0x331888);});}});}Fax[_0x99e7('0x19')][_0x99e7('0x68')]=function(_0x1c5477,_0xe94ec){var _0x8f4669=this;return new BPromise(function(_0x263150,_0x5cc8e1){var _0x1a8dce=uuid['v4']();var _0x32bd34=ut[_0x99e7('0x69')](_0x1c5477,_0xe94ec);_0x8f4669[_0x99e7('0xd')][_0x1a8dce]=new Action(_0x1a8dce,_0xe94ec,_0x1c5477);var _0x1d22b8=_0x8f4669['actions'][_0x1a8dce];if(path['parse'](_0x1c5477[_0x99e7('0x4')])[_0x99e7('0x6a')]==='.pdf'){originate(_0x1d22b8,_0x32bd34,!![])[_0x99e7('0x37')](function(_0x5804b3){_0x263150(_0x5804b3);})[_0x99e7('0x3a')](function(_0x53d23d){_0x5cc8e1(_0x53d23d);});}else{originate(_0x1d22b8,_0x32bd34,![])[_0x99e7('0x37')](function(_0x19d37f){_0x263150(_0x19d37f);})[_0x99e7('0x3a')](function(_0x5dc2a9){_0x5cc8e1(_0x5dc2a9);});}});};Fax[_0x99e7('0x19')][_0x99e7('0x6b')]=function(_0x3829fb){return!_[_0x99e7('0x6c')](_0x3829fb)&&!_[_0x99e7('0x6c')](_0x3829fb[_0x99e7('0x1f')])&&!_[_0x99e7('0x6c')](_0x3829fb[_0x99e7('0x6d')])&&_0x3829fb[_0x99e7('0x6d')]&&!_[_0x99e7('0x6c')](this['trunks'][util[_0x99e7('0x61')](_0x99e7('0x6e'),_0x3829fb[_0x99e7('0x1f')])])&&!_[_0x99e7('0x6c')](this['trunks'][util[_0x99e7('0x61')](_0x99e7('0x6e'),_0x3829fb[_0x99e7('0x1f')])][_0x99e7('0x29')])&&(this[_0x99e7('0xc')][util[_0x99e7('0x61')](_0x99e7('0x6e'),_0x3829fb[_0x99e7('0x1f')])][_0x99e7('0x29')]==='reachable'||this[_0x99e7('0xc')][util['format'](_0x99e7('0x6e'),_0x3829fb['name'])][_0x99e7('0x29')]===_0x99e7('0x6f'));};Fax[_0x99e7('0x19')][_0x99e7('0x5b')]=function(_0x56b3f5,_0x40df86){if(!this[_0x99e7('0x6b')](_0x56b3f5)){ut[_0x99e7('0x46')](_0x99e7('0x70'),_['isNil'](_0x56b3f5)?'':_0x56b3f5[_0x99e7('0x1f')]+_0x99e7('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x99e7('0x6c')](_0x40df86[_0x99e7('0x39')])){ut[_0x99e7('0x46')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x99e7('0x3e')](_0x40df86));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x99e7('0x6c')](_0x40df86[_0x99e7('0x4')])){ut[_0x99e7('0x46')](_0x99e7('0x72'),JSON['stringify'](_0x40df86));return{'isValid':![],'message':_0x99e7('0x73')};}return{'isValid':!![],'message':_0x99e7('0x74')};};module[_0x99e7('0x75')]=Fax;
\ No newline at end of file
+var _0x2843=['merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','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','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','value','channelstate','channelstatedesc','variable','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','fax','\x20notify\x20','stringify','catch','\x20receiveFax\x20'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2843,0x18e));var _0x3284=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x2843[_0x3cb6dc];return _0x47ec89;};'use strict';var util=require(_0x3284('0x0'));var _=require(_0x3284('0x1'));var BPromise=require(_0x3284('0x2'));var uuid=require(_0x3284('0x3'));var moment=require('moment');var path=require(_0x3284('0x4'));var tiff2pdf=require(_0x3284('0x5'));var gs=require(_0x3284('0x6'));var logger=require(_0x3284('0x7'))('fax');var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x3284('0x8'));var ut=require(_0x3284('0x9'));var Action=require(_0x3284('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x3284('0xb'));var faxMessage=require(_0x3284('0xc'));function Fax(_0x5abbf3){this[_0x3284('0xd')]={};this[_0x3284('0xe')]=_0x5abbf3[_0x3284('0xe')];this[_0x3284('0xf')]=_0x5abbf3[_0x3284('0xf')];this[_0x3284('0x10')]={};ami['on'](_0x3284('0x11'),this[_0x3284('0x12')][_0x3284('0x13')](this));ami['on'](_0x3284('0x14'),this[_0x3284('0x15')][_0x3284('0x13')](this));ami['on'](_0x3284('0x16'),this[_0x3284('0x17')]['bind'](this));ami['on']('newexten',this[_0x3284('0x18')][_0x3284('0x13')](this));ami['on'](_0x3284('0x19'),this[_0x3284('0x1a')][_0x3284('0x13')](this));ami['on'](_0x3284('0x1b'),this[_0x3284('0x1c')][_0x3284('0x13')](this));ami['on'](_0x3284('0x1d'),this[_0x3284('0x1e')][_0x3284('0x13')](this));ami['on'](_0x3284('0x1f'),this[_0x3284('0x20')][_0x3284('0x13')](this));}Fax['prototype'][_0x3284('0x12')]=function(_0x91b1a3){if(_0x91b1a3[_0x3284('0x21')]===_0x3284('0x22')){for(var _0x5412bc in this[_0x3284('0xe')]){if(this[_0x3284('0xe')][_0x3284('0x23')](_0x5412bc)){if(_0x91b1a3[_0x3284('0x24')]===this['faxAccounts'][_0x5412bc][_0x3284('0x25')]){this['channels'][_0x91b1a3[_0x3284('0x26')]]={};this[_0x3284('0xd')][_0x91b1a3['uniqueid']]['channel']=_0x91b1a3[_0x3284('0x27')];this['channels'][_0x91b1a3[_0x3284('0x26')]]['id']=this[_0x3284('0xe')][_0x5412bc]['id'];this[_0x3284('0xd')][_0x91b1a3['uniqueid']][_0x3284('0x28')]=this[_0x3284('0xe')][_0x5412bc][_0x3284('0x28')];logger[_0x3284('0x29')](_0x91b1a3[_0x3284('0x26')],_0x3284('0x2a'));}}}}if(this[_0x3284('0x10')][_0x91b1a3[_0x3284('0x26')]]){this[_0x3284('0xd')][_0x91b1a3[_0x3284('0x26')]]={};this[_0x3284('0xd')][_0x91b1a3[_0x3284('0x26')]][_0x3284('0x27')]=_0x91b1a3[_0x3284('0x27')];logger['info'](_0x91b1a3[_0x3284('0x26')],_0x3284('0x2a'));}};Fax[_0x3284('0x2b')]['syncVarSet']=function(_0x40f6db){if(this['channels'][_0x40f6db[_0x3284('0x26')]]){for(var _0x5f4295 in _0x40f6db['variable']){if(_0x40f6db['variable'][_0x3284('0x23')](_0x5f4295)){this[_0x3284('0xd')][_0x40f6db['uniqueid']][_0x5f4295]=_0x40f6db[_0x3284('0x2c')];}}}};Fax[_0x3284('0x2b')][_0x3284('0x17')]=function(_0x532feb){if(this[_0x3284('0xd')][_0x532feb[_0x3284('0x26')]]){this['channels'][_0x532feb[_0x3284('0x26')]][_0x3284('0x2d')]=_0x532feb[_0x3284('0x2d')];this[_0x3284('0xd')][_0x532feb[_0x3284('0x26')]]['channelstatedesc']=_0x532feb[_0x3284('0x2e')];}};Fax[_0x3284('0x2b')][_0x3284('0x18')]=function(_0x3a0e59){if(this['channels'][_0x3a0e59['uniqueid']]){for(var _0x326f89 in _0x3a0e59[_0x3284('0x2f')]){if(_0x3a0e59['variable'][_0x3284('0x23')](_0x326f89)){this[_0x3284('0xd')][_0x3a0e59[_0x3284('0x26')]][_0x326f89]=_0x3a0e59[_0x3284('0x2c')];}}}};Fax[_0x3284('0x2b')][_0x3284('0x1a')]=function(_0x2dcc6e){if(this['channels'][_0x2dcc6e[_0x3284('0x26')]]){this['channels'][_0x2dcc6e[_0x3284('0x26')]][_0x3284('0x30')]=_0x2dcc6e[_0x3284('0x30')];this[_0x3284('0xd')][_0x2dcc6e[_0x3284('0x26')]][_0x3284('0x31')]=_0x2dcc6e[_0x3284('0x31')];this['channels'][_0x2dcc6e[_0x3284('0x26')]][_0x3284('0x25')]=_0x2dcc6e[_0x3284('0x25')];this[_0x3284('0xd')][_0x2dcc6e[_0x3284('0x26')]][_0x3284('0x32')]=_0x2dcc6e[_0x3284('0x32')];logger['info'](_0x2dcc6e[_0x3284('0x26')],_0x3284('0x33'));}};Fax[_0x3284('0x2b')][_0x3284('0x1c')]=function(_0x2c63f0){var _0x17348a=this;if(this['channels'][_0x2c63f0[_0x3284('0x26')]]){var _0x2d8c35=this[_0x3284('0xd')][_0x2c63f0[_0x3284('0x26')]]['id'];this[_0x3284('0xd')][_0x2c63f0[_0x3284('0x26')]][_0x3284('0x34')]=_0x2c63f0[_0x3284('0x34')];this['channels'][_0x2c63f0[_0x3284('0x26')]][_0x3284('0x35')]=_0x2c63f0[_0x3284('0x35')];this[_0x3284('0xd')][_0x2c63f0[_0x3284('0x26')]][_0x3284('0x25')]=_0x2c63f0[_0x3284('0x25')];this[_0x3284('0xd')][_0x2c63f0['uniqueid']]['resolution']=_0x2c63f0[_0x3284('0x36')];this[_0x3284('0xd')][_0x2c63f0['uniqueid']][_0x3284('0x37')]=_0x2c63f0[_0x3284('0x37')];this[_0x3284('0xd')][_0x2c63f0[_0x3284('0x26')]][_0x3284('0x32')]=_0x2c63f0[_0x3284('0x32')];this['channels'][_0x2c63f0[_0x3284('0x26')]][_0x3284('0x38')]=_0x2c63f0['calleridnum'];if(this['channels'][_0x2c63f0[_0x3284('0x26')]][_0x3284('0x35')]>0x0){tiff2pdf(_0x2c63f0[_0x3284('0x32')],_0x3284('0x39'),function(_0x112ff2){logger[_0x3284('0x29')](_0x2c63f0[_0x3284('0x26')],_0x3284('0x3a'),_0x112ff2[_0x3284('0x3b')]);attachment[_0x3284('0x3c')]({'name':path[_0x3284('0x3d')](_0x2c63f0[_0x3284('0x32')])['name'],'basename':path[_0x3284('0x3d')](_0x2c63f0[_0x3284('0x32')])[_0x3284('0x28')]+_0x3284('0x3e'),'type':_0x3284('0x3f')})['then'](function(_0x203861){faxAccount[_0x3284('0x40')](_0x2d8c35,{'from':_0x2c63f0['calleridnum'],'mapKey':_0x3284('0x41'),'body':path[_0x3284('0x3d')](_0x2c63f0[_0x3284('0x32')])['name']+_0x3284('0x3e'),'AttachmentId':_0x203861['id']})['catch'](function(_0x358ce0){logger['error'](_0x2c63f0[_0x3284('0x26')],_0x3284('0x42'),JSON[_0x3284('0x43')](_0x358ce0));});})[_0x3284('0x44')](function(_0x27d49f){logger['error'](_0x2c63f0[_0x3284('0x26')],'\x20receiveFax\x20',JSON[_0x3284('0x43')](_0x27d49f));});});}logger[_0x3284('0x29')](_0x2c63f0['uniqueid'],_0x3284('0x45'));}};Fax[_0x3284('0x2b')][_0x3284('0x20')]=function(_0xbc33fa){if(this[_0x3284('0x10')][_0xbc33fa[_0x3284('0x26')]]){_[_0x3284('0x46')](this[_0x3284('0xd')][_0xbc33fa[_0x3284('0x26')]],_[_0x3284('0x47')](_0xbc33fa,[_0x3284('0x48'),_0x3284('0x49')]));}};function updateStatus(_0x169520){if(_0x169520[_0x3284('0x4a')]){faxMessage[_0x3284('0x4b')](_0x169520['AttachmentId'],{'failMessage':_0x3284('0x4c')})[_0x3284('0x4d')](function(_0x39665c){ut[_0x3284('0x4e')]('[Fax][Message][Error][Updated]',_0x39665c);})['catch'](function(_0x3bc9cf){ut[_0x3284('0x4e')](_0x3284('0x4f'),_0x3bc9cf);});}else{ut['logger'](_0x3284('0x50'));}}Fax[_0x3284('0x2b')]['updateStatus']=function(_0x20eebd,_0x373093,_0xfa5c31){var _0x20e1c3=this;var _0x4d8063={};if(_0x373093){_0x4d8063={'read':_0x373093};}else{_0x4d8063={'failMessage':_0xfa5c31};}if(this[_0x3284('0x10')][_0x20eebd][_0x3284('0x4a')]){faxMessage[_0x3284('0x4b')](this[_0x3284('0x10')][_0x20eebd][_0x3284('0x4a')],_0x4d8063)['then'](function(_0x566258){ut[_0x3284('0x4e')](_0x3284('0x51'),_0x566258);})[_0x3284('0x44')](function(_0x58c5d7){ut[_0x3284('0x4e')](_0x3284('0x52'),_0x58c5d7);})[_0x3284('0x53')](function(){delete _0x20e1c3['channels'][_0x20eebd];delete _0x20e1c3[_0x3284('0x10')][_0x20eebd];});}else{ut[_0x3284('0x4e')]('[Fax][Message][NoUpdate2]');delete this[_0x3284('0xd')][_0x20eebd];delete this['actions'][_0x20eebd];}};Fax['prototype'][_0x3284('0x1e')]=function(_0xa714ef){var _0x1624e4=this;if(this[_0x3284('0xd')][_0xa714ef[_0x3284('0x26')]]){if(this[_0x3284('0x10')][_0xa714ef[_0x3284('0x26')]]){this[_0x3284('0xd')][_0xa714ef[_0x3284('0x26')]]['id']=this['actions'][_0xa714ef['uniqueid']]['id'];this['channels'][_0xa714ef[_0x3284('0x26')]][_0x3284('0x28')]=this[_0x3284('0x10')][_0xa714ef[_0x3284('0x26')]]['name'];}logger[_0x3284('0x29')](_0xa714ef[_0x3284('0x26')],this['actions'][_0xa714ef[_0x3284('0x26')]]?'\x20hangup\x20sendFile\x20':_0x3284('0x54'),JSON[_0x3284('0x43')](this['channels'][_0xa714ef[_0x3284('0x26')]]));if(this[_0x3284('0x10')][_0xa714ef['uniqueid']]){if(this[_0x3284('0xd')][_0xa714ef[_0x3284('0x26')]][_0x3284('0x55')]>0x0&&this[_0x3284('0xd')][_0xa714ef[_0x3284('0x26')]][_0x3284('0x19')]==='SUCCESS'){this['updateStatus'](_0xa714ef[_0x3284('0x26')],!![]);}else{this[_0x3284('0x56')](_0xa714ef[_0x3284('0x26')],![],this[_0x3284('0xd')][_0xa714ef[_0x3284('0x26')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0x3284('0xd')][_0xa714ef[_0x3284('0x26')]][_0x3284('0x57')]:_0x3284('0x58'));}}}};Fax[_0x3284('0x2b')][_0x3284('0x59')]=function(_0x301ee8){var _0x252398=this;return new BPromise(function(_0x235b28,_0x3085a0){_0x252398[_0x3284('0x5a')](_0x301ee8,_0x252398[_0x3284('0xe')][_0x301ee8[_0x3284('0x5b')]])[_0x3284('0x4d')](function(_0x2605a2){ut[_0x3284('0x4e')](_0x3284('0x5c'),_0x2605a2);_0x235b28(ut[_0x3284('0x3b')](_0x3284('0x5d')));})['catch'](function(_0x32c344){ut[_0x3284('0x4e')](_0x3284('0x5e'),_0x32c344);updateStatus(_0x301ee8);_0x3085a0(ut[_0x3284('0x3b')](_0x3284('0x5f')));});});};Fax[_0x3284('0x2b')][_0x3284('0x60')]=function(_0x5f2b7f){var _0xdcdbb0=this;return new BPromise(function(_0x28945f,_0xe392da){var _0x39858c=_0xdcdbb0[_0x3284('0x61')](_0xdcdbb0[_0x3284('0xe')][_0x5f2b7f[_0x3284('0x5b')]]['Trunk'],_0x5f2b7f);if(_0x39858c['isValid']){_0x28945f(ut[_0x3284('0x3b')]('Trunk\x20Reachable'));}else{_0xe392da(ut[_0x3284('0x3b')](_0x39858c['message']));}});};function originate(_0x4ea980,_0x426419,_0x252822){return new BPromise(function(_0x376fe0,_0x70a43f){if(_0x252822){var _0x55465c=util[_0x3284('0x62')](_0x3284('0x63'),path[_0x3284('0x3d')](_0x4ea980[_0x3284('0x4')])[_0x3284('0x28')],_0x4ea980[_0x3284('0x4')]);gs[_0x3284('0x64')](_0x55465c)[_0x3284('0x4d')](function(){_0x4ea980[_0x3284('0x4')]=util[_0x3284('0x62')]('%s/%s.tif',path[_0x3284('0x3d')](_0x4ea980['path'])[_0x3284('0x65')],path[_0x3284('0x3d')](_0x4ea980[_0x3284('0x4')])[_0x3284('0x28')]);_0x426419['XMF-PATH']=_0x4ea980[_0x3284('0x4')];ut['logger'](_0x3284('0x66'),'');ami[_0x3284('0x67')](ut[_0x3284('0x68')](_0x4ea980,_0x426419))[_0x3284('0x4d')](function(_0xe7ae99){_0x376fe0(_0xe7ae99);})[_0x3284('0x44')](function(_0x23a617){_0x70a43f(_0x23a617);});})[_0x3284('0x44')](function(_0x412846){_0x70a43f(_0x412846);});}else{ami['Action'](ut[_0x3284('0x68')](_0x4ea980,_0x426419))['then'](function(_0xf2eb96){_0x376fe0(_0xf2eb96);})[_0x3284('0x44')](function(_0x2d03fa){_0x70a43f(_0x2d03fa);});}});}Fax[_0x3284('0x2b')][_0x3284('0x5a')]=function(_0x3e1132,_0x1574d6){var _0x3525d1=this;return new BPromise(function(_0x49b287,_0x3b9d5d){var _0x1f5890=uuid['v4']();var _0x1a84b3=ut[_0x3284('0x69')](_0x3e1132,_0x1574d6);_0x3525d1['actions'][_0x1f5890]=new Action(_0x1f5890,_0x1574d6,_0x3e1132);var _0x3e66db=_0x3525d1['actions'][_0x1f5890];if(path[_0x3284('0x3d')](_0x3e1132[_0x3284('0x4')])[_0x3284('0x6a')]===_0x3284('0x3e')){originate(_0x3e66db,_0x1a84b3,!![])[_0x3284('0x4d')](function(_0x95ce8){_0x49b287(_0x95ce8);})[_0x3284('0x44')](function(_0x2bf8cd){_0x3b9d5d(_0x2bf8cd);});}else{originate(_0x3e66db,_0x1a84b3,![])[_0x3284('0x4d')](function(_0x529ad9){_0x49b287(_0x529ad9);})[_0x3284('0x44')](function(_0x2269a9){_0x3b9d5d(_0x2269a9);});}});};Fax[_0x3284('0x2b')][_0x3284('0x6b')]=function(_0x54e69){return!_[_0x3284('0x6c')](_0x54e69)&&!_['isNil'](_0x54e69['name'])&&!_[_0x3284('0x6c')](_0x54e69[_0x3284('0x6d')])&&_0x54e69['active']&&!_[_0x3284('0x6c')](this['trunks'][util[_0x3284('0x62')](_0x3284('0x6e'),_0x54e69[_0x3284('0x28')])])&&!_[_0x3284('0x6c')](this[_0x3284('0xf')][util[_0x3284('0x62')](_0x3284('0x6e'),_0x54e69[_0x3284('0x28')])][_0x3284('0x31')])&&(this[_0x3284('0xf')][util[_0x3284('0x62')](_0x3284('0x6e'),_0x54e69['name'])][_0x3284('0x31')]==='reachable'||this['trunks'][util[_0x3284('0x62')](_0x3284('0x6e'),_0x54e69[_0x3284('0x28')])][_0x3284('0x31')]==='unmonitored');};Fax['prototype'][_0x3284('0x61')]=function(_0xe1bf,_0x2afa26){if(!this['isTrunkReachable'](_0xe1bf)){ut['logger'](_0x3284('0x6f'),_[_0x3284('0x6c')](_0xe1bf)?'':_0xe1bf['name']+_0x3284('0x70'));return{'isValid':![],'message':_0x3284('0x71')};}if(_['isNil'](_0x2afa26[_0x3284('0x41')])){ut['logger'](_0x3284('0x72'),JSON['stringify'](_0x2afa26));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3284('0x6c')](_0x2afa26[_0x3284('0x4')])){ut[_0x3284('0x4e')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x2afa26));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x3284('0x73')};};module[_0x3284('0x74')]=Fax;
\ No newline at end of file
index b6c2f36..c4e1df6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fb9=['notify','resolve','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x1924db,_0x4cfc8c){var _0x250a11=function(_0x187999){while(--_0x187999){_0x1924db['push'](_0x1924db['shift']());}};_0x250a11(++_0x4cfc8c);}(_0x5fb9,0x111));var _0x95fb=function(_0x239519,_0x229ced){_0x239519=_0x239519-0x0;var _0x4f1755=_0x5fb9[_0x239519];return _0x4f1755;};'use strict';var util=require(_0x95fb('0x0'));var BPromise=require(_0x95fb('0x1'));var logger=require(_0x95fb('0x2'))(_0x95fb('0x3'));var _=require(_0x95fb('0x4'));var faxAccount=require(_0x95fb('0x5'));function loggerCatch(_0x15604c){return function(_0x2ea30c){logger['error'](_0x15604c,util['inspect'](_0x2ea30c,{'showHidden':![],'depth':null}));};}exports[_0x95fb('0x6')]=function(_0xe48262,_0x5bdb8f){return BPromise[_0x95fb('0x7')]()['then'](faxAccount['notify'](_0xe48262,_0x5bdb8f))['catch'](loggerCatch(_0x95fb('0x8')));};
\ No newline at end of file
+var _0xcece=['util','bluebird','preview','../rpc/faxAccount','error','notify','resolve','then','catch','[Notify]\x20'];(function(_0xe9c8e4,_0x3aa2f6){var _0x2037fa=function(_0xcb43b1){while(--_0xcb43b1){_0xe9c8e4['push'](_0xe9c8e4['shift']());}};_0x2037fa(++_0x3aa2f6);}(_0xcece,0x1a4));var _0xecec=function(_0x3fcc3d,_0xf8278){_0x3fcc3d=_0x3fcc3d-0x0;var _0x5300db=_0xcece[_0x3fcc3d];return _0x5300db;};'use strict';var util=require(_0xecec('0x0'));var BPromise=require(_0xecec('0x1'));var logger=require('../../../config/logger')(_0xecec('0x2'));var _=require('lodash');var faxAccount=require(_0xecec('0x3'));function loggerCatch(_0x35b08f){return function(_0x535d83){logger[_0xecec('0x4')](_0x35b08f,util['inspect'](_0x535d83,{'showHidden':![],'depth':null}));};}exports[_0xecec('0x5')]=function(_0x4121c6,_0x13dde4){return BPromise[_0xecec('0x6')]()[_0xecec('0x7')](faxAccount[_0xecec('0x5')](_0x4121c6,_0x13dde4))[_0xecec('0x8')](loggerCatch(_0xecec('0x9')));};
\ No newline at end of file
index bfdef81..5d21c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa866=['Exec\x20gs','\x20Error\x20:','inspect','util','exec','execute','info'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xa866,0x88));var _0x6a86=function(_0x1844b7,_0x9efef5){_0x1844b7=_0x1844b7-0x0;var _0x20ff52=_0xa866[_0x1844b7];return _0x20ff52;};'use strict';var util=require(_0x6a86('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require('bluebird');var exec=require('child_process')[_0x6a86('0x1')];exports[_0x6a86('0x2')]=function(_0x3a66cb){return new BPromise(function(_0x3678d8,_0x21451f){exec(_0x3a66cb,function(_0x42e99e,_0x3a38ed,_0x382500){logger[_0x6a86('0x3')](_0x6a86('0x4'),_0x3a38ed);if(_0x42e99e){logger['info'](_0x6a86('0x4'),_0x6a86('0x5'),util[_0x6a86('0x6')](_0x42e99e,{'showHidden':![],'depth':null}),_0x3a38ed,_0x382500);_0x21451f(_0x42e99e);}_0x3678d8(_0x3a38ed);});});};
\ No newline at end of file
+var _0x43a6=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','inspect'];(function(_0x4db3d2,_0x1d0a57){var _0x5c655c=function(_0x5975bb){while(--_0x5975bb){_0x4db3d2['push'](_0x4db3d2['shift']());}};_0x5c655c(++_0x1d0a57);}(_0x43a6,0xe8));var _0x643a=function(_0xee2e7a,_0x58354d){_0xee2e7a=_0xee2e7a-0x0;var _0x319dd3=_0x43a6[_0xee2e7a];return _0x319dd3;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x643a('0x0'));var BPromise=require(_0x643a('0x1'));var exec=require(_0x643a('0x2'))[_0x643a('0x3')];exports[_0x643a('0x4')]=function(_0x312ab5){return new BPromise(function(_0x54ab15,_0x25e1e3){exec(_0x312ab5,function(_0x42cd8f,_0x60f9ab,_0x1c80ea){logger[_0x643a('0x5')](_0x643a('0x6'),_0x60f9ab);if(_0x42cd8f){logger['info'](_0x643a('0x6'),'\x20Error\x20:',util[_0x643a('0x7')](_0x42cd8f,{'showHidden':![],'depth':null}),_0x60f9ab,_0x1c80ea);_0x25e1e3(_0x42cd8f);}_0x54ab15(_0x60f9ab);});});};
\ No newline at end of file
index 45d2c38..c6ce453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['from-sip','\x22%s\x22\x20<%s>','moment','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate'];(function(_0x2d0eca,_0x20460a){var _0x31bc4a=function(_0x55a479){while(--_0x55a479){_0x2d0eca['push'](_0x2d0eca['shift']());}};_0x31bc4a(++_0x20460a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3071('0x0'));var logger=require(_0x3071('0x1'))(_0x3071('0x2'));exports[_0x3071('0x3')]=function(_0x864539){return{'message':_0x864539};};exports['logger']=function(_0x2c547f,_0x7b18a4){logger[_0x3071('0x4')](_0x2c547f,util[_0x3071('0x5')](_0x7b18a4,{'showHidden':![],'depth':null}));};exports[_0x3071('0x6')]=function(_0x41cf76,_0x1d3dd6){var _0x2f1e87={'XMF-ECM':_0x1d3dd6[_0x3071('0x7')],'XMF-HEADERINFO':_0x1d3dd6[_0x3071('0x8')],'XMF-MINRATE':_0x1d3dd6[_0x3071('0x9')],'XMF-MAXRATE':_0x1d3dd6[_0x3071('0xa')],'XMF-MODEM':util[_0x3071('0xb')]('\x22%s\x22',_0x1d3dd6[_0x3071('0xc')]),'XMF-GATEWAY':_0x1d3dd6[_0x3071('0xd')],'XMF-FAXDETECT':_0x1d3dd6[_0x3071('0xe')],'XMF-T38TIMEOUT':_0x1d3dd6[_0x3071('0xf')],'XMF-LOCALSTATIONID':_0x1d3dd6[_0x3071('0x10')],'XMF-PATH':_0x41cf76['path']};return _0x2f1e87;};exports[_0x3071('0x11')]=function(_0x11a7ee,_0x401b4d){return{'actionid':_0x11a7ee[_0x3071('0x12')],'action':_0x3071('0x13'),'channel':_0x11a7ee['channel'],'Exten':'xcally-motion-fax','Context':_0x3071('0x14'),'Priority':'1','callerid':util['format'](_0x3071('0x15'),_0x11a7ee[_0x3071('0x8')]?_0x11a7ee['headerinfo']:'',_0x11a7ee[_0x3071('0x10')]),'variable':_0x401b4d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x11a7ee['uniqueid']};};
\ No newline at end of file
+var _0x878f=['inspect','maxrate','modem','gateway','faxdetect','localstationid','path','uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','lodash','moment','../../../../config/logger','fax','message','logger','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x878f,0x173));var _0xf878=function(_0x17610c,_0x20331c){_0x17610c=_0x17610c-0x0;var _0x23e333=_0x878f[_0x17610c];return _0x23e333;};'use strict';var util=require('util');var _=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var logger=require(_0xf878('0x2'))(_0xf878('0x3'));exports[_0xf878('0x4')]=function(_0x3d74cf){return{'message':_0x3d74cf};};exports[_0xf878('0x5')]=function(_0x45a37b,_0x240b48){logger[_0xf878('0x6')](_0x45a37b,util[_0xf878('0x7')](_0x240b48,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4ac8d8,_0x3c5f5c){var _0x62b420={'XMF-ECM':_0x3c5f5c['ecm'],'XMF-HEADERINFO':_0x3c5f5c['headerinfo'],'XMF-MINRATE':_0x3c5f5c['minrate'],'XMF-MAXRATE':_0x3c5f5c[_0xf878('0x8')],'XMF-MODEM':util['format']('\x22%s\x22',_0x3c5f5c[_0xf878('0x9')]),'XMF-GATEWAY':_0x3c5f5c[_0xf878('0xa')],'XMF-FAXDETECT':_0x3c5f5c[_0xf878('0xb')],'XMF-T38TIMEOUT':_0x3c5f5c['t38timeout'],'XMF-LOCALSTATIONID':_0x3c5f5c[_0xf878('0xc')],'XMF-PATH':_0x4ac8d8[_0xf878('0xd')]};return _0x62b420;};exports['variablesAction']=function(_0xdf76,_0x4f7e7f){return{'actionid':_0xdf76[_0xf878('0xe')],'action':_0xf878('0xf'),'channel':_0xdf76[_0xf878('0x10')],'Exten':'xcally-motion-fax','Context':_0xf878('0x11'),'Priority':'1','callerid':util[_0xf878('0x12')](_0xf878('0x13'),_0xdf76['headerinfo']?_0xdf76[_0xf878('0x14')]:'',_0xdf76[_0xf878('0xc')]),'variable':_0x4f7e7f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xdf76[_0xf878('0xe')]};};
\ No newline at end of file
index 719926b..b621d9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ac=['getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','log','sync','bluebird','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','getAgents','initAgents','then','getTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initVoiceQueueReports'];(function(_0x13b8a1,_0x5b7fff){var _0x5c5d09=function(_0x477483){while(--_0x477483){_0x13b8a1['push'](_0x13b8a1['shift']());}};_0x5c5d09(++_0x5b7fff);}(_0xa9ac,0x10b));var _0xca9a=function(_0x4c922c,_0x54a49e){_0x4c922c=_0x4c922c-0x0;var _0x504ddc=_0xa9ac[_0x4c922c];return _0x504ddc;};'use strict';var BPromise=require(_0xca9a('0x0'));var util=require(_0xca9a('0x1'));var moment=require(_0xca9a('0x2'));var server=require('./server');var Realtime=require(_0xca9a('0x3'));var Report=require(_0xca9a('0x4'));var Acw=require(_0xca9a('0x5'));var Trigger=require(_0xca9a('0x6'));var Dialer=require(_0xca9a('0x7'));var Preview=require(_0xca9a('0x8'));var Fax=require(_0xca9a('0x9'));var user=require(_0xca9a('0xa'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xca9a('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xca9a('0xc'));var trigger=require(_0xca9a('0xd'));var template=require(_0xca9a('0xe'));var cmHopperHistory=require(_0xca9a('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xca9a('0x10'));var faxAccount=require(_0xca9a('0x11'));var zendesk=require(_0xca9a('0x12'));var salesforce=require(_0xca9a('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xca9a('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xca9a('0x15'));var vtiger=require(_0xca9a('0x16'));var freshsales=require(_0xca9a('0x17'));var servicenow=require(_0xca9a('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xca9a('0x19')](_0xca9a('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xca9a('0x19')](_0xca9a('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xca9a('0x1b')]()['then'](user[_0xca9a('0x1c')]())['then'](realtime[_0xca9a('0x1d')]())[_0xca9a('0x1e')](user[_0xca9a('0x1f')]())[_0xca9a('0x1e')](realtime['initTelephones']())[_0xca9a('0x1e')](trunk[_0xca9a('0x20')]())['then'](realtime['initTrunks']())['then'](voiceQueue[_0xca9a('0x21')]())[_0xca9a('0x1e')](realtime[_0xca9a('0x22')]())[_0xca9a('0x1e')](trigger[_0xca9a('0x23')]())['then'](realtime[_0xca9a('0x24')]())['then'](template[_0xca9a('0x25')]())[_0xca9a('0x1e')](realtime[_0xca9a('0x26')]())[_0xca9a('0x1e')](zendesk['getZendeskAccounts']())[_0xca9a('0x1e')](realtime[_0xca9a('0x27')]())['then'](salesforce['getSalesforceAccounts']())['then'](realtime['initSalesforceAccounts']())[_0xca9a('0x1e')](sugarcrm[_0xca9a('0x28')]())[_0xca9a('0x1e')](realtime['initSugarcrmAccounts']())[_0xca9a('0x1e')](freshdesk[_0xca9a('0x29')]())[_0xca9a('0x1e')](realtime[_0xca9a('0x2a')]())[_0xca9a('0x1e')](desk[_0xca9a('0x2b')]())['then'](realtime[_0xca9a('0x2c')]())[_0xca9a('0x1e')](zoho[_0xca9a('0x2d')]())[_0xca9a('0x1e')](realtime[_0xca9a('0x2e')]())['then'](vtiger[_0xca9a('0x2f')]())['then'](realtime[_0xca9a('0x30')]())['then'](freshsales['getFreshsalesAccounts']())[_0xca9a('0x1e')](realtime[_0xca9a('0x31')]())[_0xca9a('0x1e')](servicenow[_0xca9a('0x32')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xca9a('0x33')]())[_0xca9a('0x1e')](realtime[_0xca9a('0x34')]())[_0xca9a('0x1e')](campaign[_0xca9a('0x35')]())[_0xca9a('0x1e')](realtime[_0xca9a('0x36')]())['then'](voiceExtension['getVoiceExtensions']())[_0xca9a('0x1e')](realtime[_0xca9a('0x37')]())[_0xca9a('0x1e')](faxAccount[_0xca9a('0x38')]())[_0xca9a('0x1e')](realtime['initFaxAccounts']())[_0xca9a('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xca9a('0x1e')](voiceQueueReport['getVoiceQueueReports']())[_0xca9a('0x1e')](realtime[_0xca9a('0x39')]())[_0xca9a('0x1e')](cmHopperHistory[_0xca9a('0x3a')]())[_0xca9a('0x1e')](realtime[_0xca9a('0x3b')]())['then'](cmHopperHistory[_0xca9a('0x3c')]())[_0xca9a('0x1e')](realtime[_0xca9a('0x3d')]())[_0xca9a('0x1e')](voiceCallReport['getVoiceCallReports']())['then'](realtime['initVoiceCallReports']())['then'](function(_0x32f529){})[_0xca9a('0x3e')](function(_0x311aeb){console[_0xca9a('0x3f')](_0x311aeb);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x198b06){return initRealtime();})[_0xca9a('0x1e')](function(){return initParams();})[_0xca9a('0x1e')](function(){report[_0xca9a('0x40')]();setInterval(initRealtime,0x1388);})[_0xca9a('0x3e')](function(_0x55d474){console['log'](_0x55d474);});}main();
\ No newline at end of file
+var _0xf9f7=['./rpc/integrations/dynamics365','get','hour','resolve','getAgents','initAgents','then','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger'];(function(_0x17d8cb,_0x26c927){var _0x2e632a=function(_0x52a165){while(--_0x52a165){_0x17d8cb['push'](_0x17d8cb['shift']());}};_0x2e632a(++_0x26c927);}(_0xf9f7,0x12c));var _0x7f9f=function(_0x246346,_0x335ee5){_0x246346=_0x246346-0x0;var _0x5e0957=_0xf9f7[_0x246346];return _0x5e0957;};'use strict';var BPromise=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var moment=require(_0x7f9f('0x2'));var server=require(_0x7f9f('0x3'));var Realtime=require(_0x7f9f('0x4'));var Report=require(_0x7f9f('0x5'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0x7f9f('0x6'));var Preview=require(_0x7f9f('0x7'));var Fax=require(_0x7f9f('0x8'));var user=require(_0x7f9f('0x9'));var voiceQueue=require(_0x7f9f('0xa'));var voiceQueueReport=require(_0x7f9f('0xb'));var voiceCallReport=require(_0x7f9f('0xc'));var trunk=require(_0x7f9f('0xd'));var trigger=require(_0x7f9f('0xe'));var template=require(_0x7f9f('0xf'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x7f9f('0x10'));var voiceExtension=require(_0x7f9f('0x11'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x7f9f('0x12'));var salesforce=require(_0x7f9f('0x13'));var sugarcrm=require(_0x7f9f('0x14'));var freshdesk=require(_0x7f9f('0x15'));var desk=require(_0x7f9f('0x16'));var zoho=require(_0x7f9f('0x17'));var vtiger=require(_0x7f9f('0x18'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x7f9f('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7f9f('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7f9f('0x1a')](_0x7f9f('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7f9f('0x1c')]()['then'](user[_0x7f9f('0x1d')]())['then'](realtime[_0x7f9f('0x1e')]())[_0x7f9f('0x1f')](user['getTelephones']())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x20')]())['then'](trunk['getTrunks']())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x21')]())[_0x7f9f('0x1f')](voiceQueue[_0x7f9f('0x22')]())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x23')]())[_0x7f9f('0x1f')](trigger['getTriggers']())['then'](realtime[_0x7f9f('0x24')]())[_0x7f9f('0x1f')](template['getTemplates']())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x25')]())[_0x7f9f('0x1f')](zendesk[_0x7f9f('0x26')]())[_0x7f9f('0x1f')](realtime['initZendeskAccounts']())['then'](salesforce[_0x7f9f('0x27')]())['then'](realtime['initSalesforceAccounts']())[_0x7f9f('0x1f')](sugarcrm[_0x7f9f('0x28')]())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x29')]())[_0x7f9f('0x1f')](freshdesk[_0x7f9f('0x2a')]())[_0x7f9f('0x1f')](realtime['initFreshdeskAccounts']())[_0x7f9f('0x1f')](desk['getDeskAccounts']())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x2b')]())[_0x7f9f('0x1f')](zoho[_0x7f9f('0x2c')]())[_0x7f9f('0x1f')](realtime['initZohoAccounts']())['then'](vtiger[_0x7f9f('0x2d')]())[_0x7f9f('0x1f')](realtime['initVtigerAccounts']())[_0x7f9f('0x1f')](freshsales[_0x7f9f('0x2e')]())[_0x7f9f('0x1f')](realtime['initFreshsalesAccounts']())[_0x7f9f('0x1f')](servicenow[_0x7f9f('0x2f')]())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x30')]())[_0x7f9f('0x1f')](dynamics365[_0x7f9f('0x31')]())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x32')]())[_0x7f9f('0x1f')](campaign[_0x7f9f('0x33')]())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x34')]())[_0x7f9f('0x1f')](voiceExtension[_0x7f9f('0x35')]())[_0x7f9f('0x1f')](realtime['initVoiceExtensions']())[_0x7f9f('0x1f')](faxAccount[_0x7f9f('0x36')]())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x37')]())[_0x7f9f('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0x7f9f('0x1c')]()[_0x7f9f('0x1f')](voiceQueueReport[_0x7f9f('0x38')]())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x39')]())[_0x7f9f('0x1f')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x3a')]())[_0x7f9f('0x1f')](cmHopperHistory[_0x7f9f('0x3b')]())[_0x7f9f('0x1f')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport['getVoiceCallReports']())[_0x7f9f('0x1f')](realtime[_0x7f9f('0x3c')]())['then'](function(_0x1596e6){})[_0x7f9f('0x3d')](function(_0x47a471){console[_0x7f9f('0x3e')](_0x47a471);});}function main(){return server[_0x7f9f('0x3f')](realtime,preview,fax)[_0x7f9f('0x1f')](function(_0x24e2d0){return initRealtime();})[_0x7f9f('0x1f')](function(){return initParams();})['then'](function(){report[_0x7f9f('0x40')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x482207){console[_0x7f9f('0x3e')](_0x482207);});}main();
\ No newline at end of file
index dab4310..b9c4951 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd974=['voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','voiceStatusTime','toNumber','format','stateTime','stringify','user:%s','emit','user:save','lodash','util','moment','md5','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','email','accountcode','fullname','state','unknown','status','address','mobile','online'];(function(_0x5817d5,_0x171369){var _0xe5f86f=function(_0x40936d){while(--_0x40936d){_0x5817d5['push'](_0x5817d5['shift']());}};_0xe5f86f(++_0x171369);}(_0xd974,0x1ce));var _0x4d97=function(_0x2f6ad9,_0x598293){_0x2f6ad9=_0x2f6ad9-0x0;var _0x30492f=_0xd974[_0x2f6ad9];return _0x30492f;};'use strict';var _=require(_0x4d97('0x0'));var util=require(_0x4d97('0x1'));var moment=require(_0x4d97('0x2'));var md5=require(_0x4d97('0x3'));var Redis=require(_0x4d97('0x4'));var config=require(_0x4d97('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x4d97('0x6'),'port':0x18eb});var io=require(_0x4d97('0x7'))(new Redis(config[_0x4d97('0x8')]));function Agent(_0x58c2c4){this['id']=_0x58c2c4['id']||0x0;this[_0x4d97('0x9')]=_0x58c2c4[_0x4d97('0x9')]||'';this[_0x4d97('0xa')]=_0x58c2c4[_0x4d97('0xa')]||'';this['accountcode']=_0x58c2c4[_0x4d97('0xb')]||'';this[_0x4d97('0xc')]=_0x58c2c4[_0x4d97('0xc')]||'';this[_0x4d97('0xd')]=_0x4d97('0xe');this['stateTime']=0x0;this[_0x4d97('0xf')]=_0x4d97('0xe');this[_0x4d97('0x10')]='';this['phone']='';this[_0x4d97('0x11')]='';this['interface']='';this[_0x4d97('0x12')]=_0x58c2c4[_0x4d97('0x12')]||![];this[_0x4d97('0x13')]=_0x4d97('0xe');this['voiceStatusTime']=0x0;this[_0x4d97('0x14')]='';this[_0x4d97('0x15')]='';this[_0x4d97('0x16')]=![];this['local']=![];this['md5']='';}Agent[_0x4d97('0x17')][_0x4d97('0x18')]=function(_0x4674ce){var _0x36da76;if(_0x4674ce&&_0x4674ce[_0x4d97('0xd')]){_0x36da76=_0x4674ce[_0x4d97('0xd')][_0x4d97('0x19')]();switch(_0x36da76){case _0x4d97('0x1a'):_0x36da76=_0x4d97('0x1b');break;case _0x4d97('0x1c'):_0x36da76='talking';break;}}if(_0x36da76&&this['voiceStatus']!==_0x36da76||_0x4674ce['statePause']){this[_0x4d97('0x1d')]=_[_0x4d97('0x1e')](moment()[_0x4d97('0x1f')]('x'));}if(_0x36da76){this[_0x4d97('0x13')]=_0x36da76;}var _0x50ba90={'id':this['id'],'name':this['name'],'email':this[_0x4d97('0xa')],'accountcode':this[_0x4d97('0xb')],'fullname':this[_0x4d97('0xc')],'state':this['state'],'stateTime':this[_0x4d97('0x20')],'status':this['status'],'address':this[_0x4d97('0x10')],'online':this[_0x4d97('0x12')],'voiceStatus':this[_0x4d97('0x13')],'voiceStatusTime':this[_0x4d97('0x1d')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x4d97('0x15')],'interface':this['interface'],'onhold':this[_0x4d97('0x16')]};var _0x2bf712=md5(JSON[_0x4d97('0x21')](_0x50ba90));if(this['md5']!==_0x2bf712){this[_0x4d97('0x3')]=_0x2bf712;io['to'](util['format'](_0x4d97('0x22'),_0x50ba90[_0x4d97('0x9')]))[_0x4d97('0x23')](_0x4d97('0x24'),_0x50ba90);}};module['exports']=Agent;
\ No newline at end of file
+var _0xbfb3=['not_inuse','inuse','statePause','toNumber','format','interface','user:%s','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase'];(function(_0x3566d0,_0x34a49f){var _0x3fd4da=function(_0xa00005){while(--_0xa00005){_0x3566d0['push'](_0x3566d0['shift']());}};_0x3fd4da(++_0x34a49f);}(_0xbfb3,0xa5));var _0x3bfb=function(_0x51ec85,_0x1b1be3){_0x51ec85=_0x51ec85-0x0;var _0x233598=_0xbfb3[_0x51ec85];return _0x233598;};'use strict';var _=require(_0x3bfb('0x0'));var util=require(_0x3bfb('0x1'));var moment=require(_0x3bfb('0x2'));var md5=require(_0x3bfb('0x3'));var Redis=require(_0x3bfb('0x4'));var config=require(_0x3bfb('0x5'));config[_0x3bfb('0x6')]=_[_0x3bfb('0x7')](config[_0x3bfb('0x6')],{'host':_0x3bfb('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3bfb('0x6')]));function Agent(_0x1c86a6){this['id']=_0x1c86a6['id']||0x0;this[_0x3bfb('0x9')]=_0x1c86a6[_0x3bfb('0x9')]||'';this['email']=_0x1c86a6[_0x3bfb('0xa')]||'';this[_0x3bfb('0xb')]=_0x1c86a6[_0x3bfb('0xb')]||'';this[_0x3bfb('0xc')]=_0x1c86a6[_0x3bfb('0xc')]||'';this[_0x3bfb('0xd')]=_0x3bfb('0xe');this[_0x3bfb('0xf')]=0x0;this[_0x3bfb('0x10')]=_0x3bfb('0xe');this[_0x3bfb('0x11')]='';this[_0x3bfb('0x12')]='';this[_0x3bfb('0x13')]='';this['interface']='';this[_0x3bfb('0x14')]=_0x1c86a6['online']||![];this[_0x3bfb('0x15')]='unknown';this[_0x3bfb('0x16')]=0x0;this[_0x3bfb('0x17')]='';this[_0x3bfb('0x18')]='';this[_0x3bfb('0x19')]=![];this[_0x3bfb('0x1a')]=![];this['md5']='';}Agent[_0x3bfb('0x1b')][_0x3bfb('0x1c')]=function(_0x26c1cc){var _0xeea0da;if(_0x26c1cc&&_0x26c1cc[_0x3bfb('0xd')]){_0xeea0da=_0x26c1cc[_0x3bfb('0xd')][_0x3bfb('0x1d')]();switch(_0xeea0da){case _0x3bfb('0x1e'):_0xeea0da='idle';break;case _0x3bfb('0x1f'):_0xeea0da='talking';break;}}if(_0xeea0da&&this[_0x3bfb('0x15')]!==_0xeea0da||_0x26c1cc[_0x3bfb('0x20')]){this['voiceStatusTime']=_[_0x3bfb('0x21')](moment()[_0x3bfb('0x22')]('x'));}if(_0xeea0da){this[_0x3bfb('0x15')]=_0xeea0da;}var _0x1ae217={'id':this['id'],'name':this[_0x3bfb('0x9')],'email':this[_0x3bfb('0xa')],'accountcode':this[_0x3bfb('0xb')],'fullname':this['fullname'],'state':this[_0x3bfb('0xd')],'stateTime':this[_0x3bfb('0xf')],'status':this[_0x3bfb('0x10')],'address':this['address'],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x3bfb('0x17')],'voiceStatusQueue':this[_0x3bfb('0x18')],'interface':this[_0x3bfb('0x23')],'onhold':this[_0x3bfb('0x19')]};var _0x3bc7d6=md5(JSON['stringify'](_0x1ae217));if(this['md5']!==_0x3bc7d6){this[_0x3bfb('0x3')]=_0x3bc7d6;io['to'](util[_0x3bfb('0x22')](_0x3bfb('0x24'),_0x1ae217[_0x3bfb('0x9')]))['emit'](_0x3bfb('0x25'),_0x1ae217);}};module[_0x3bfb('0x26')]=Agent;
\ No newline at end of file
index 7f7f8bd..c73a2e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb5b=['dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting'];(function(_0x47e3ef,_0x551b2c){var _0x502417=function(_0x500211){while(--_0x500211){_0x47e3ef['push'](_0x47e3ef['shift']());}};_0x502417(++_0x551b2c);}(_0xbb5b,0xc8));var _0xbbb5=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0xbb5b[_0x35c5a8];return _0x34782c;};'use strict';function Campaign(_0x248342){this['id']=_0x248342['id']||0x0;this[_0xbbb5('0x0')]=_0x248342['name']||'';this['type']=_0x248342['type']||_0xbbb5('0x1');this[_0xbbb5('0x2')]=0x0;this[_0xbbb5('0x3')]=0x0;this[_0xbbb5('0x4')]=0x0;this[_0xbbb5('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x248342['active'];this['limitCalls']=_0x248342[_0xbbb5('0x6')];this[_0xbbb5('0x7')]=_0x248342[_0xbbb5('0x7')]||null;this[_0xbbb5('0x8')]=_0x248342['dialGlobalInterval']?_0x248342['dialGlobalInterval']:null;this[_0xbbb5('0x9')]=_0x248342[_0xbbb5('0x9')];this[_0xbbb5('0xa')]=_0x248342[_0xbbb5('0xa')];this['dialOriginateTimeout']=_0x248342[_0xbbb5('0xb')]||0x1e;this[_0xbbb5('0xc')]=_0x248342[_0xbbb5('0xc')];this[_0xbbb5('0xd')]=_0x248342[_0xbbb5('0xd')];this[_0xbbb5('0xe')]=_0x248342[_0xbbb5('0xe')];this[_0xbbb5('0xf')]=_0x248342[_0xbbb5('0xf')];this['dialNoAnswerMaxRetry']=_0x248342[_0xbbb5('0x10')];this[_0xbbb5('0x11')]=_0x248342['dialNoAnswerRetryFrequency'];this[_0xbbb5('0x12')]=_0x248342['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x248342[_0xbbb5('0x13')]||0x3;this[_0xbbb5('0x14')]=_0x248342['dialNoSuchNumberRetryFrequency']||0x96;this[_0xbbb5('0x15')]=_0x248342[_0xbbb5('0x15')]||0x3;this[_0xbbb5('0x16')]=_0x248342['dialDropRetryFrequency']||0x96;this[_0xbbb5('0x17')]=_0x248342[_0xbbb5('0x17')]||0x3;this[_0xbbb5('0x18')]=_0x248342['dialAbandonedRetryFrequency']||0x96;this[_0xbbb5('0x19')]=_0x248342[_0xbbb5('0x19')]||0x3;this[_0xbbb5('0x1a')]=_0x248342[_0xbbb5('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x248342['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x248342[_0xbbb5('0x1b')]||0x96;this[_0xbbb5('0x1c')]=_0x248342[_0xbbb5('0x1c')]||'DESC';this[_0xbbb5('0x1d')]=_0x248342[_0xbbb5('0x1d')]||undefined;this[_0xbbb5('0x1e')]=_0x248342['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xbbb5('0x1f')]=_0x248342[_0xbbb5('0x1f')]||undefined;this[_0xbbb5('0x20')]=_0x248342[_0xbbb5('0x20')]?_0x248342[_0xbbb5('0x20')]:undefined;this[_0xbbb5('0x21')]=_0x248342[_0xbbb5('0x21')]?_0x248342[_0xbbb5('0x21')]:undefined;this[_0xbbb5('0x22')]=_0x248342['Interval']?_0x248342[_0xbbb5('0x22')]:undefined;this['SquareProject']=_0x248342[_0xbbb5('0x23')]?_0x248342[_0xbbb5('0x23')]:undefined;this[_0xbbb5('0x24')]=_0x248342[_0xbbb5('0x23')]?_0x248342[_0xbbb5('0x23')]['name']:undefined;this[_0xbbb5('0x25')]=_0x248342[_0xbbb5('0x25')]||![];this[_0xbbb5('0x26')]=_0x248342['dialAMDInitialSilence'];this[_0xbbb5('0x27')]=_0x248342[_0xbbb5('0x27')];this[_0xbbb5('0x28')]=_0x248342['dialAMDAfterGreetingSilence'];this[_0xbbb5('0x29')]=_0x248342[_0xbbb5('0x29')];this[_0xbbb5('0x2a')]=_0x248342[_0xbbb5('0x2a')];this['dialAMDBetweenWordsSilence']=_0x248342[_0xbbb5('0x2b')];this[_0xbbb5('0x2c')]=_0x248342[_0xbbb5('0x2c')];this[_0xbbb5('0x2d')]=_0x248342[_0xbbb5('0x2d')];this[_0xbbb5('0x2e')]=_0x248342[_0xbbb5('0x2e')];}module[_0xbbb5('0x2f')]=Campaign;
\ No newline at end of file
+var _0xfad1=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xfad1,0x12a));var _0x1fad=function(_0xd217f7,_0x30c4d6){_0xd217f7=_0xd217f7-0x0;var _0x31c9f6=_0xfad1[_0xd217f7];return _0x31c9f6;};'use strict';function Campaign(_0xda6746){this['id']=_0xda6746['id']||0x0;this['name']=_0xda6746[_0x1fad('0x0')]||'';this[_0x1fad('0x1')]=_0xda6746[_0x1fad('0x1')]||_0x1fad('0x2');this[_0x1fad('0x3')]=0x0;this[_0x1fad('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x1fad('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x1fad('0x6')]=_0xda6746[_0x1fad('0x6')];this[_0x1fad('0x7')]=_0xda6746['limitCalls'];this[_0x1fad('0x8')]=_0xda6746[_0x1fad('0x8')]||null;this[_0x1fad('0x9')]=_0xda6746[_0x1fad('0x9')]?_0xda6746['dialGlobalInterval']:null;this[_0x1fad('0xa')]=_0xda6746[_0x1fad('0xa')];this[_0x1fad('0xb')]=_0xda6746[_0x1fad('0xb')];this['dialOriginateTimeout']=_0xda6746[_0x1fad('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0xda6746[_0x1fad('0xd')];this[_0x1fad('0xe')]=_0xda6746[_0x1fad('0xe')];this['dialBusyMaxRetry']=_0xda6746[_0x1fad('0xf')];this[_0x1fad('0x10')]=_0xda6746['dialBusyRetryFrequency'];this[_0x1fad('0x11')]=_0xda6746['dialNoAnswerMaxRetry'];this[_0x1fad('0x12')]=_0xda6746[_0x1fad('0x12')];this[_0x1fad('0x13')]=_0xda6746[_0x1fad('0x13')];this[_0x1fad('0x14')]=_0xda6746[_0x1fad('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xda6746[_0x1fad('0x15')]||0x96;this['dialDropMaxRetry']=_0xda6746[_0x1fad('0x16')]||0x3;this[_0x1fad('0x17')]=_0xda6746['dialDropRetryFrequency']||0x96;this[_0x1fad('0x18')]=_0xda6746['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0xda6746['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0xda6746['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0xda6746[_0x1fad('0x19')]||0x96;this[_0x1fad('0x1a')]=_0xda6746[_0x1fad('0x1a')]||0x3;this[_0x1fad('0x1b')]=_0xda6746[_0x1fad('0x1b')]||0x96;this[_0x1fad('0x1c')]=_0xda6746[_0x1fad('0x1c')]||'DESC';this[_0x1fad('0x1d')]=_0xda6746[_0x1fad('0x1d')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0xda6746[_0x1fad('0x1e')]||undefined;this[_0x1fad('0x1f')]=_0xda6746[_0x1fad('0x1f')]||undefined;this['TrunkBackup']=_0xda6746[_0x1fad('0x20')]?_0xda6746['TrunkBackup']:undefined;this[_0x1fad('0x21')]=_0xda6746[_0x1fad('0x21')]?_0xda6746['Trunk']:undefined;this[_0x1fad('0x22')]=_0xda6746['Interval']?_0xda6746[_0x1fad('0x22')]:undefined;this['SquareProject']=_0xda6746[_0x1fad('0x23')]?_0xda6746['SquareProject']:undefined;this[_0x1fad('0x24')]=_0xda6746['SquareProject']?_0xda6746[_0x1fad('0x23')]['name']:undefined;this[_0x1fad('0x25')]=_0xda6746[_0x1fad('0x25')]||![];this['dialAMDInitialSilence']=_0xda6746[_0x1fad('0x26')];this[_0x1fad('0x27')]=_0xda6746[_0x1fad('0x27')];this[_0x1fad('0x28')]=_0xda6746['dialAMDAfterGreetingSilence'];this[_0x1fad('0x29')]=_0xda6746[_0x1fad('0x29')];this[_0x1fad('0x2a')]=_0xda6746['dialAMDMinWordLength'];this[_0x1fad('0x2b')]=_0xda6746[_0x1fad('0x2b')];this[_0x1fad('0x2c')]=_0xda6746[_0x1fad('0x2c')];this[_0x1fad('0x2d')]=_0xda6746[_0x1fad('0x2d')];this[_0x1fad('0x2e')]=_0xda6746[_0x1fad('0x2e')];}module[_0x1fad('0x2f')]=Campaign;
\ No newline at end of file
index a869303..13a92dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6888=['accountcode','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x2bb1bc,_0x2e69e5){var _0x170492=function(_0x561bbd){while(--_0x561bbd){_0x2bb1bc['push'](_0x2bb1bc['shift']());}};_0x170492(++_0x2e69e5);}(_0x6888,0xd2));var _0x8688=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x6888[_0x53ccf2];return _0x5a2964;};'use strict';function Channel(){this[_0x8688('0x0')]=null;this['channel']='';this[_0x8688('0x1')]='';this[_0x8688('0x2')]=0x0;this[_0x8688('0x3')]='';this[_0x8688('0x4')]=undefined;this[_0x8688('0x5')]=undefined;this[_0x8688('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x8688('0x7')]=0x0;this[_0x8688('0x8')]=0x0;this[_0x8688('0x9')]=![];this[_0x8688('0xa')]=null;this[_0x8688('0xb')]=null;this[_0x8688('0xc')]=![];this['abandoned']=![];this[_0x8688('0xd')]='';this[_0x8688('0xe')]='';this[_0x8688('0xf')]=0x0;this[_0x8688('0x10')]=0x0;this[_0x8688('0x11')]=0x0;this['type']=null;this['tag']=null;this[_0x8688('0x12')]=null;this[_0x8688('0x13')]=![];this[_0x8688('0x14')]=null;this[_0x8688('0x15')]=null;this[_0x8688('0x16')]=[];this[_0x8688('0x17')]=undefined;this[_0x8688('0x18')]=undefined;this[_0x8688('0x19')]=0x0;}module[_0x8688('0x1a')]=Channel;
\ No newline at end of file
+var _0xe6da=['unmanaged','lastapplication','duration','billableseconds','holdtime','type','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','answered','endtime'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xe6da,0x1ee));var _0xae6d=function(_0x192115,_0x3fec0a){_0x192115=_0x192115-0x0;var _0x1b9282=_0xe6da[_0x192115];return _0x1b9282;};'use strict';function Channel(){this['starttime']=null;this[_0xae6d('0x0')]='';this[_0xae6d('0x1')]='';this[_0xae6d('0x2')]=0x0;this[_0xae6d('0x3')]='';this[_0xae6d('0x4')]=undefined;this[_0xae6d('0x5')]=undefined;this[_0xae6d('0x6')]=0x0;this['context']='';this[_0xae6d('0x7')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0xae6d('0x8')]=![];this['answertime']=null;this[_0xae6d('0x9')]=null;this[_0xae6d('0xa')]=![];this['abandoned']=![];this[_0xae6d('0xb')]='';this['lastdata']='';this[_0xae6d('0xc')]=0x0;this[_0xae6d('0xd')]=0x0;this[_0xae6d('0xe')]=0x0;this[_0xae6d('0xf')]=null;this['tag']=null;this[_0xae6d('0x10')]=null;this['monitor']=![];this[_0xae6d('0x11')]=null;this[_0xae6d('0x12')]=null;this[_0xae6d('0x13')]=[];this[_0xae6d('0x14')]=undefined;this[_0xae6d('0x15')]=undefined;this[_0xae6d('0x16')]=0x0;}module[_0xae6d('0x17')]=Channel;
\ No newline at end of file
index dd07f36..e771e52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x202c=['type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0xeb39e9,_0xe81711){var _0x213eff=function(_0x5a90cd){while(--_0x5a90cd){_0xeb39e9['push'](_0xeb39e9['shift']());}};_0x213eff(++_0xe81711);}(_0x202c,0x178));var _0xc202=function(_0x3e0eee,_0x5ea422){_0x3e0eee=_0x3e0eee-0x0;var _0xaf9897=_0x202c[_0x3e0eee];return _0xaf9897;};'use strict';function DeskAccount(_0x5a4b6c){this['id']=_0x5a4b6c['id']||0x0;this['name']=_0x5a4b6c['name']||'';this[_0xc202('0x0')]=_0x5a4b6c[_0xc202('0x0')]||'';this[_0xc202('0x1')]=_0x5a4b6c['remoteUri']||'';this[_0xc202('0x2')]=_0x5a4b6c[_0xc202('0x2')]||'';this[_0xc202('0x3')]=_0x5a4b6c[_0xc202('0x3')]||'';this['consumerKey']=_0x5a4b6c[_0xc202('0x4')]||'';this[_0xc202('0x5')]=_0x5a4b6c['consumerSecret']||'';this[_0xc202('0x6')]=_0x5a4b6c['token']||'';this[_0xc202('0x7')]=_0x5a4b6c[_0xc202('0x7')]||'';this[_0xc202('0x8')]=_0x5a4b6c[_0xc202('0x8')]||'';this[_0xc202('0x9')]=_0x5a4b6c[_0xc202('0x9')]||'';this[_0xc202('0xa')]=_0x5a4b6c[_0xc202('0xa')]||{};}module[_0xc202('0xb')]=DeskAccount;
\ No newline at end of file
+var _0xc43c=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x3569bb,_0x1c4977){var _0x44bdbc=function(_0x24ffda){while(--_0x24ffda){_0x3569bb['push'](_0x3569bb['shift']());}};_0x44bdbc(++_0x1c4977);}(_0xc43c,0x152));var _0xcc43=function(_0x760548,_0x589699){_0x760548=_0x760548-0x0;var _0x1a6009=_0xc43c[_0x760548];return _0x1a6009;};'use strict';function DeskAccount(_0x5a04d4){this['id']=_0x5a04d4['id']||0x0;this[_0xcc43('0x0')]=_0x5a04d4[_0xcc43('0x0')]||'';this[_0xcc43('0x1')]=_0x5a04d4[_0xcc43('0x1')]||'';this[_0xcc43('0x2')]=_0x5a04d4['remoteUri']||'';this[_0xcc43('0x3')]=_0x5a04d4[_0xcc43('0x3')]||'';this['password']=_0x5a04d4[_0xcc43('0x4')]||'';this[_0xcc43('0x5')]=_0x5a04d4[_0xcc43('0x5')]||'';this[_0xcc43('0x6')]=_0x5a04d4[_0xcc43('0x6')]||'';this[_0xcc43('0x7')]=_0x5a04d4[_0xcc43('0x7')]||'';this[_0xcc43('0x8')]=_0x5a04d4[_0xcc43('0x8')]||'';this[_0xcc43('0x9')]=_0x5a04d4['type']||'';this[_0xcc43('0xa')]=_0x5a04d4[_0xcc43('0xa')]||'';this[_0xcc43('0xb')]=_0x5a04d4[_0xcc43('0xb')]||{};}module[_0xcc43('0xc')]=DeskAccount;
\ No newline at end of file
index 64b52d8..c5f80be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf0d=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0xcf0d,0xf6));var _0xdcf0=function(_0x1411e8,_0x249a68){_0x1411e8=_0x1411e8-0x0;var _0x5b844e=_0xcf0d[_0x1411e8];return _0x5b844e;};'use strict';function Dynamics365Account(_0x2628aa){this['id']=_0x2628aa['id']||0x0;this[_0xdcf0('0x0')]=_0x2628aa[_0xdcf0('0x0')]||'';this[_0xdcf0('0x1')]=_0x2628aa['username']||'';this[_0xdcf0('0x2')]=_0x2628aa[_0xdcf0('0x2')]||'';this[_0xdcf0('0x3')]=_0x2628aa[_0xdcf0('0x3')]||'';this[_0xdcf0('0x4')]=_0x2628aa[_0xdcf0('0x4')]||'';this[_0xdcf0('0x5')]=_0x2628aa[_0xdcf0('0x5')]||'';this[_0xdcf0('0x6')]=_0x2628aa[_0xdcf0('0x6')]||{};this[_0xdcf0('0x7')]=_0x2628aa[_0xdcf0('0x7')]||'';this[_0xdcf0('0x8')]=_0x2628aa[_0xdcf0('0x8')]||{};}module[_0xdcf0('0x9')]=Dynamics365Account;
\ No newline at end of file
+var _0x263e=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x6ca1db,_0x569d05){var _0x5bcc1b=function(_0x5346ca){while(--_0x5346ca){_0x6ca1db['push'](_0x6ca1db['shift']());}};_0x5bcc1b(++_0x569d05);}(_0x263e,0x1c8));var _0xe263=function(_0x241eb9,_0x5ccc3f){_0x241eb9=_0x241eb9-0x0;var _0x4f916b=_0x263e[_0x241eb9];return _0x4f916b;};'use strict';function Dynamics365Account(_0x50ee3e){this['id']=_0x50ee3e['id']||0x0;this[_0xe263('0x0')]=_0x50ee3e[_0xe263('0x0')]||'';this['username']=_0x50ee3e[_0xe263('0x1')]||'';this['password']=_0x50ee3e['password']||'';this[_0xe263('0x2')]=_0x50ee3e[_0xe263('0x2')]||'';this[_0xe263('0x3')]=_0x50ee3e[_0xe263('0x3')]||'';this[_0xe263('0x4')]=_0x50ee3e['clientId']||'';this[_0xe263('0x5')]=_0x50ee3e[_0xe263('0x5')]||{};this[_0xe263('0x6')]=_0x50ee3e[_0xe263('0x6')]||'';this[_0xe263('0x7')]=_0x50ee3e[_0xe263('0x7')]||{};}module[_0xe263('0x8')]=Dynamics365Account;
\ No newline at end of file
index 309c5b7..bda83a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0546=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x0546,0xe5));var _0x6054=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x0546[_0x1b3a5c];return _0x2ae8cb;};'use strict';function FaxAccount(_0x33400b){this['id']=_0x33400b['id']||0x0;this['name']=_0x33400b[_0x6054('0x0')]||'';this[_0x6054('0x1')]=_0x33400b[_0x6054('0x1')];this[_0x6054('0x2')]=_0x33400b[_0x6054('0x2')];this[_0x6054('0x3')]=_0x33400b[_0x6054('0x3')];this[_0x6054('0x4')]=_0x33400b['localstationid'];this[_0x6054('0x5')]=_0x33400b[_0x6054('0x5')]||0x960;this[_0x6054('0x6')]=_0x33400b['maxrate']||0x3840;this[_0x6054('0x7')]=_0x33400b[_0x6054('0x7')]||_0x6054('0x8');this[_0x6054('0x9')]=_0x33400b[_0x6054('0x9')]||'no';this['faxdetect']=_0x33400b[_0x6054('0xa')]||'no';this[_0x6054('0xb')]=_0x33400b[_0x6054('0xb')]||0x1388;this[_0x6054('0xc')]=_0x33400b[_0x6054('0xc')]||_0x6054('0xd');this[_0x6054('0xe')]=_0x33400b[_0x6054('0xe')]?_0x33400b[_0x6054('0xe')]:undefined;this[_0x6054('0xf')]=_0x33400b['ListId'];this[_0x6054('0x10')]=_0x33400b[_0x6054('0x10')];}module[_0x6054('0x11')]=FaxAccount;
\ No newline at end of file
+var _0x5900=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x2c0fe4,_0x3c60cc){var _0x19c3ed=function(_0x52ad20){while(--_0x52ad20){_0x2c0fe4['push'](_0x2c0fe4['shift']());}};_0x19c3ed(++_0x3c60cc);}(_0x5900,0x184));var _0x0590=function(_0x18063f,_0x3efbaf){_0x18063f=_0x18063f-0x0;var _0x116771=_0x5900[_0x18063f];return _0x116771;};'use strict';function FaxAccount(_0x30ee0b){this['id']=_0x30ee0b['id']||0x0;this[_0x0590('0x0')]=_0x30ee0b[_0x0590('0x0')]||'';this[_0x0590('0x1')]=_0x30ee0b[_0x0590('0x1')];this[_0x0590('0x2')]=_0x30ee0b['ecm'];this[_0x0590('0x3')]=_0x30ee0b[_0x0590('0x3')];this[_0x0590('0x4')]=_0x30ee0b[_0x0590('0x4')];this['minrate']=_0x30ee0b[_0x0590('0x5')]||0x960;this[_0x0590('0x6')]=_0x30ee0b[_0x0590('0x6')]||0x3840;this[_0x0590('0x7')]=_0x30ee0b[_0x0590('0x7')]||_0x0590('0x8');this[_0x0590('0x9')]=_0x30ee0b[_0x0590('0x9')]||'no';this[_0x0590('0xa')]=_0x30ee0b[_0x0590('0xa')]||'no';this[_0x0590('0xb')]=_0x30ee0b[_0x0590('0xb')]||0x1388;this[_0x0590('0xc')]=_0x30ee0b['tech']||_0x0590('0xd');this[_0x0590('0xe')]=_0x30ee0b['Trunk']?_0x30ee0b[_0x0590('0xe')]:undefined;this[_0x0590('0xf')]=_0x30ee0b[_0x0590('0xf')];this[_0x0590('0x10')]=_0x30ee0b[_0x0590('0x10')];}module[_0x0590('0x11')]=FaxAccount;
\ No newline at end of file
index bb7ff47..5e96cf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a1=['name','apiKey','token','remoteUri','serverUrl'];(function(_0x4b4ba1,_0x125066){var _0x13a30e=function(_0x256593){while(--_0x256593){_0x4b4ba1['push'](_0x4b4ba1['shift']());}};_0x13a30e(++_0x125066);}(_0x16a1,0xdc));var _0x116a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x16a1[_0x3b380d];return _0x54502b;};'use strict';function FreshdeskAccount(_0x47e57a){this['id']=_0x47e57a['id']||0x0;this['name']=_0x47e57a[_0x116a('0x0')]||'';this['username']=_0x47e57a['username']||'';this[_0x116a('0x1')]=_0x47e57a[_0x116a('0x2')]||'';this[_0x116a('0x3')]=_0x47e57a[_0x116a('0x3')]||'';this[_0x116a('0x4')]=_0x47e57a[_0x116a('0x4')]||'';this['Configurations']=_0x47e57a['Configurations']||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
+var _0xb40e=['Configurations','name','username','apiKey','token','serverUrl'];(function(_0x411a57,_0x569f06){var _0x482ac9=function(_0x3aefe1){while(--_0x3aefe1){_0x411a57['push'](_0x411a57['shift']());}};_0x482ac9(++_0x569f06);}(_0xb40e,0x14b));var _0xeb40=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0xb40e[_0xf34109];return _0x570bfc;};'use strict';function FreshdeskAccount(_0x32e2fe){this['id']=_0x32e2fe['id']||0x0;this['name']=_0x32e2fe[_0xeb40('0x0')]||'';this[_0xeb40('0x1')]=_0x32e2fe[_0xeb40('0x1')]||'';this[_0xeb40('0x2')]=_0x32e2fe[_0xeb40('0x3')]||'';this['remoteUri']=_0x32e2fe['remoteUri']||'';this[_0xeb40('0x4')]=_0x32e2fe[_0xeb40('0x4')]||'';this[_0xeb40('0x5')]=_0x32e2fe['Configurations']||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index ccd8116..f02014e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5058=['remoteUri','serverUrl','Configurations','token'];(function(_0x12fdd9,_0x2bd94a){var _0x5afecf=function(_0x1febe3){while(--_0x1febe3){_0x12fdd9['push'](_0x12fdd9['shift']());}};_0x5afecf(++_0x2bd94a);}(_0x5058,0x1bb));var _0x8505=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x5058[_0x1d1219];return _0x5b5b89;};'use strict';function FreshsalesAccount(_0x3a3348){this['id']=_0x3a3348['id']||0x0;this['name']=_0x3a3348['name']||'';this['username']=_0x3a3348['username']||'';this['apiKey']=_0x3a3348[_0x8505('0x0')]||'';this[_0x8505('0x1')]=_0x3a3348[_0x8505('0x1')]||'';this[_0x8505('0x2')]=_0x3a3348['serverUrl']||'';this['Configurations']=_0x3a3348[_0x8505('0x3')]||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
+var _0xcd94=['remoteUri','serverUrl','Configurations','exports','name','apiKey','token'];(function(_0x5cb903,_0x14f1c2){var _0x10940f=function(_0x58a8e3){while(--_0x58a8e3){_0x5cb903['push'](_0x5cb903['shift']());}};_0x10940f(++_0x14f1c2);}(_0xcd94,0x1ee));var _0x4cd9=function(_0x10b2d5,_0x5a7743){_0x10b2d5=_0x10b2d5-0x0;var _0x14b8d1=_0xcd94[_0x10b2d5];return _0x14b8d1;};'use strict';function FreshsalesAccount(_0x7bcc5e){this['id']=_0x7bcc5e['id']||0x0;this[_0x4cd9('0x0')]=_0x7bcc5e[_0x4cd9('0x0')]||'';this['username']=_0x7bcc5e['username']||'';this[_0x4cd9('0x1')]=_0x7bcc5e[_0x4cd9('0x2')]||'';this['remoteUri']=_0x7bcc5e[_0x4cd9('0x3')]||'';this[_0x4cd9('0x4')]=_0x7bcc5e[_0x4cd9('0x4')]||'';this[_0x4cd9('0x5')]=_0x7bcc5e[_0x4cd9('0x5')]||{};}module[_0x4cd9('0x6')]=FreshsalesAccount;
\ No newline at end of file
index 77bd0e4..332afb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcc6=['calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','exten','holdtime','assigned','lastAssignedTo','mohtime','exports','type','inbound','uniqueid','calleridnum'];(function(_0x2c275f,_0x3cb215){var _0x3d738a=function(_0x156b95){while(--_0x156b95){_0x2c275f['push'](_0x2c275f['shift']());}};_0x3d738a(++_0x3cb215);}(_0xdcc6,0xf9));var _0x6dcc=function(_0x56d1b5,_0x289333){_0x56d1b5=_0x56d1b5-0x0;var _0x4ad91e=_0xdcc6[_0x56d1b5];return _0x4ad91e;};'use strict';function QueueReport(){this[_0x6dcc('0x0')]=_0x6dcc('0x1');this[_0x6dcc('0x2')]='';this[_0x6dcc('0x3')]='';this[_0x6dcc('0x4')]='';this[_0x6dcc('0x5')]='';this[_0x6dcc('0x6')]=null;this['queuecallerleaveAt']=null;this[_0x6dcc('0x7')]=0x1;this[_0x6dcc('0x8')]=0x1;this[_0x6dcc('0x9')]=![];this['queuecallerabandonAt']=null;this[_0x6dcc('0xa')]=![];this[_0x6dcc('0xb')]=null;this[_0x6dcc('0xc')]=![];this[_0x6dcc('0xd')]=null;this[_0x6dcc('0xe')]=0x1;this['channel']='';this[_0x6dcc('0xf')]='';this[_0x6dcc('0x10')]='';this['accountcode']='';this['context']='';this[_0x6dcc('0x11')]='';this['priority']='';this[_0x6dcc('0x12')]=0x0;this[_0x6dcc('0x13')]=![];this[_0x6dcc('0x14')]='';this[_0x6dcc('0x15')]=0x0;this['variables']={};}module[_0x6dcc('0x16')]=QueueReport;
\ No newline at end of file
+var _0xc4b9=['count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','variables','exports','type','inbound','uniqueid','calleridname','queuecallerleaveAt'];(function(_0x1513ee,_0x53c62b){var _0x27d56b=function(_0x2ef6c8){while(--_0x2ef6c8){_0x1513ee['push'](_0x1513ee['shift']());}};_0x27d56b(++_0x53c62b);}(_0xc4b9,0x12f));var _0x9c4b=function(_0x5ba6e5,_0x51c613){_0x5ba6e5=_0x5ba6e5-0x0;var _0x26f3af=_0xc4b9[_0x5ba6e5];return _0x26f3af;};'use strict';function QueueReport(){this[_0x9c4b('0x0')]=_0x9c4b('0x1');this[_0x9c4b('0x2')]='';this['calleridnum']='';this[_0x9c4b('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x9c4b('0x4')]=null;this['position']=0x1;this[_0x9c4b('0x5')]=0x1;this[_0x9c4b('0x6')]=![];this['queuecallerabandonAt']=null;this[_0x9c4b('0x7')]=![];this[_0x9c4b('0x8')]=null;this[_0x9c4b('0x9')]=![];this[_0x9c4b('0xa')]=null;this[_0x9c4b('0xb')]=0x1;this['channel']='';this[_0x9c4b('0xc')]='';this['connectedlinename']='';this[_0x9c4b('0xd')]='';this[_0x9c4b('0xe')]='';this[_0x9c4b('0xf')]='';this[_0x9c4b('0x10')]='';this[_0x9c4b('0x11')]=0x0;this[_0x9c4b('0x12')]=![];this[_0x9c4b('0x13')]='';this['mohtime']=0x0;this[_0x9c4b('0x14')]={};}module[_0x9c4b('0x15')]=QueueReport;
\ No newline at end of file
index 49c878f..571164b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d78=['clientSecret','securityToken','integrationTab','serverUrl','exports','name','username','remoteUri','password','clientId'];(function(_0x4f7576,_0x138a8f){var _0x45d522=function(_0x1662ee){while(--_0x1662ee){_0x4f7576['push'](_0x4f7576['shift']());}};_0x45d522(++_0x138a8f);}(_0x2d78,0x109));var _0x82d7=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x2d78[_0x1d80be];return _0xf9a4f3;};'use strict';function SalesforceAccount(_0x356533){this['id']=_0x356533['id']||0x0;this[_0x82d7('0x0')]=_0x356533[_0x82d7('0x0')]||'';this[_0x82d7('0x1')]=_0x356533[_0x82d7('0x1')]||'';this[_0x82d7('0x2')]=_0x356533[_0x82d7('0x2')]||'';this['password']=_0x356533[_0x82d7('0x3')]||'';this[_0x82d7('0x4')]=_0x356533[_0x82d7('0x4')]||'';this[_0x82d7('0x5')]=_0x356533[_0x82d7('0x5')]||'';this[_0x82d7('0x6')]=_0x356533[_0x82d7('0x6')]||'';this['type']=_0x356533['type']||_0x82d7('0x7');this[_0x82d7('0x8')]=_0x356533[_0x82d7('0x8')]||'';this['Configurations']=_0x356533['Configurations']||{};}module[_0x82d7('0x9')]=SalesforceAccount;
\ No newline at end of file
+var _0x32e9=['type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x3098eb,_0x2f36ec){var _0x18e3f6=function(_0x228a3c){while(--_0x228a3c){_0x3098eb['push'](_0x3098eb['shift']());}};_0x18e3f6(++_0x2f36ec);}(_0x32e9,0xf6));var _0x932e=function(_0xee1ec9,_0x2f0599){_0xee1ec9=_0xee1ec9-0x0;var _0x102a53=_0x32e9[_0xee1ec9];return _0x102a53;};'use strict';function SalesforceAccount(_0x27c0d4){this['id']=_0x27c0d4['id']||0x0;this[_0x932e('0x0')]=_0x27c0d4[_0x932e('0x0')]||'';this['username']=_0x27c0d4[_0x932e('0x1')]||'';this[_0x932e('0x2')]=_0x27c0d4['remoteUri']||'';this['password']=_0x27c0d4[_0x932e('0x3')]||'';this[_0x932e('0x4')]=_0x27c0d4[_0x932e('0x4')]||'';this[_0x932e('0x5')]=_0x27c0d4[_0x932e('0x5')]||'';this[_0x932e('0x6')]=_0x27c0d4[_0x932e('0x6')]||'';this[_0x932e('0x7')]=_0x27c0d4[_0x932e('0x7')]||'integrationTab';this[_0x932e('0x8')]=_0x27c0d4['serverUrl']||'';this[_0x932e('0x9')]=_0x27c0d4['Configurations']||{};}module[_0x932e('0xa')]=SalesforceAccount;
\ No newline at end of file
index 5cff876..c22707f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6b5=['remoteUri','serverUrl','Configurations','exports','username','password'];(function(_0x470c5b,_0x53f574){var _0xa4b21e=function(_0x2a19aa){while(--_0x2a19aa){_0x470c5b['push'](_0x470c5b['shift']());}};_0xa4b21e(++_0x53f574);}(_0xc6b5,0xac));var _0x5c6b=function(_0x4113ed,_0x7f7c22){_0x4113ed=_0x4113ed-0x0;var _0x4ac139=_0xc6b5[_0x4113ed];return _0x4ac139;};'use strict';function ServicenowAccount(_0x328a22){this['id']=_0x328a22['id']||0x0;this['name']=_0x328a22['name']||'';this[_0x5c6b('0x0')]=_0x328a22[_0x5c6b('0x0')]||'';this[_0x5c6b('0x1')]=_0x328a22[_0x5c6b('0x1')]||'';this['remoteUri']=_0x328a22[_0x5c6b('0x2')]||'';this[_0x5c6b('0x3')]=_0x328a22['serverUrl']||'';this[_0x5c6b('0x4')]=_0x328a22['Configurations']||{};}module[_0x5c6b('0x5')]=ServicenowAccount;
\ No newline at end of file
+var _0x1ce8=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x3f7cd5,_0x4d1a60){var _0x429e2a=function(_0x161b02){while(--_0x161b02){_0x3f7cd5['push'](_0x3f7cd5['shift']());}};_0x429e2a(++_0x4d1a60);}(_0x1ce8,0x1ee));var _0x81ce=function(_0x2d939c,_0xfc448f){_0x2d939c=_0x2d939c-0x0;var _0x908e5b=_0x1ce8[_0x2d939c];return _0x908e5b;};'use strict';function ServicenowAccount(_0x13189f){this['id']=_0x13189f['id']||0x0;this[_0x81ce('0x0')]=_0x13189f[_0x81ce('0x0')]||'';this[_0x81ce('0x1')]=_0x13189f[_0x81ce('0x1')]||'';this[_0x81ce('0x2')]=_0x13189f[_0x81ce('0x2')]||'';this[_0x81ce('0x3')]=_0x13189f[_0x81ce('0x3')]||'';this['serverUrl']=_0x13189f[_0x81ce('0x4')]||'';this[_0x81ce('0x5')]=_0x13189f[_0x81ce('0x5')]||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
index 9f60c6e..0e8d66f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa845=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x228f15,_0x4ff405){var _0x52f2b5=function(_0x16d7e8){while(--_0x16d7e8){_0x228f15['push'](_0x228f15['shift']());}};_0x52f2b5(++_0x4ff405);}(_0xa845,0xb2));var _0x5a84=function(_0x404de9,_0x597f24){_0x404de9=_0x404de9-0x0;var _0x54ad94=_0xa845[_0x404de9];return _0x54ad94;};'use strict';function SugarcrmAccount(_0x29da68){this['id']=_0x29da68['id']||0x0;this['name']=_0x29da68[_0x5a84('0x0')]||'';this[_0x5a84('0x1')]=_0x29da68[_0x5a84('0x1')]||'';this[_0x5a84('0x2')]=_0x29da68['password']||'';this[_0x5a84('0x3')]=_0x29da68[_0x5a84('0x3')]||'';this[_0x5a84('0x4')]=_0x29da68[_0x5a84('0x4')]||'';this[_0x5a84('0x5')]=_0x29da68[_0x5a84('0x5')]||{};}module[_0x5a84('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xba8b=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x2e2f84,_0x24e46f){var _0x448191=function(_0x336e06){while(--_0x336e06){_0x2e2f84['push'](_0x2e2f84['shift']());}};_0x448191(++_0x24e46f);}(_0xba8b,0xa1));var _0xbba8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xba8b[_0x4565bf];return _0x5610ba;};'use strict';function SugarcrmAccount(_0x2f07c9){this['id']=_0x2f07c9['id']||0x0;this[_0xbba8('0x0')]=_0x2f07c9['name']||'';this['username']=_0x2f07c9[_0xbba8('0x1')]||'';this[_0xbba8('0x2')]=_0x2f07c9['password']||'';this['remoteUri']=_0x2f07c9[_0xbba8('0x3')]||'';this['serverUrl']=_0x2f07c9[_0xbba8('0x4')]||'';this[_0xbba8('0x5')]=_0x2f07c9[_0xbba8('0x5')]||{};}module[_0xbba8('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 3f9aa09..28c7e6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ced=['accountcode','state','stateTime','address','exports','name'];(function(_0x31c878,_0x16f984){var _0x38c4ab=function(_0x29cd31){while(--_0x29cd31){_0x31c878['push'](_0x31c878['shift']());}};_0x38c4ab(++_0x16f984);}(_0x8ced,0x1a9));var _0xd8ce=function(_0x1d7466,_0x161771){_0x1d7466=_0x1d7466-0x0;var _0x3ebbb6=_0x8ced[_0x1d7466];return _0x3ebbb6;};'use strict';function Telephone(_0x21a0d3){this['id']=_0x21a0d3['id']||0x0;this[_0xd8ce('0x0')]=_0x21a0d3[_0xd8ce('0x0')]||'';this[_0xd8ce('0x1')]=_0x21a0d3[_0xd8ce('0x1')]||'';this[_0xd8ce('0x2')]='unknown';this[_0xd8ce('0x3')]=0x0;this['status']='unknown';this[_0xd8ce('0x4')]='';}module[_0xd8ce('0x5')]=Telephone;
\ No newline at end of file
+var _0x3018=['accountcode','state','unknown','status','address','exports','name'];(function(_0x439f8f,_0x32e76b){var _0x3b4b59=function(_0x11853a){while(--_0x11853a){_0x439f8f['push'](_0x439f8f['shift']());}};_0x3b4b59(++_0x32e76b);}(_0x3018,0x164));var _0x8301=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3018[_0x2be8c2];return _0x97f531;};'use strict';function Telephone(_0x2b164f){this['id']=_0x2b164f['id']||0x0;this['name']=_0x2b164f[_0x8301('0x0')]||'';this[_0x8301('0x1')]=_0x2b164f[_0x8301('0x1')]||'';this[_0x8301('0x2')]=_0x8301('0x3');this['stateTime']=0x0;this[_0x8301('0x4')]=_0x8301('0x3');this[_0x8301('0x5')]='';}module[_0x8301('0x6')]=Telephone;
\ No newline at end of file
index 566abc1..7bea600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1ed=['name','html','exports'];(function(_0xea46d,_0x254082){var _0x1fa4c5=function(_0x4d7817){while(--_0x4d7817){_0xea46d['push'](_0xea46d['shift']());}};_0x1fa4c5(++_0x254082);}(_0xd1ed,0xcc));var _0xdd1e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd1ed[_0x14add3];return _0x4a174f;};'use strict';function template(_0x220cf2){this['id']=_0x220cf2['id']||0x0;this[_0xdd1e('0x0')]=_0x220cf2[_0xdd1e('0x0')]||'';this['html']=_0x220cf2[_0xdd1e('0x1')]||'';}module[_0xdd1e('0x2')]=template;
\ No newline at end of file
+var _0x9048=['name','html'];(function(_0x1d43cd,_0x518b48){var _0x1f9d90=function(_0x49484c){while(--_0x49484c){_0x1d43cd['push'](_0x1d43cd['shift']());}};_0x1f9d90(++_0x518b48);}(_0x9048,0x1b2));var _0x8904=function(_0x57399d,_0x44c083){_0x57399d=_0x57399d-0x0;var _0x146276=_0x9048[_0x57399d];return _0x146276;};'use strict';function template(_0x8121e6){this['id']=_0x8121e6['id']||0x0;this[_0x8904('0x0')]=_0x8121e6[_0x8904('0x0')]||'';this['html']=_0x8121e6[_0x8904('0x1')]||'';}module['exports']=template;
\ No newline at end of file
index ae6ab89..e8b5d00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['Actions','name','channel','status','AllConditions','AnyConditions'];(function(_0x280af6,_0x11180e){var _0x368479=function(_0x519330){while(--_0x519330){_0x280af6['push'](_0x280af6['shift']());}};_0x368479(++_0x11180e);}(_0x3e74,0x175));var _0x43e7=function(_0x5b357c,_0x47030f){_0x5b357c=_0x5b357c-0x0;var _0x4f3e9c=_0x3e74[_0x5b357c];return _0x4f3e9c;};'use strict';function Trigger(_0x284ef8){this['id']=_0x284ef8['id']||0x0;this['name']=_0x284ef8[_0x43e7('0x0')]||'';this[_0x43e7('0x1')]=_0x284ef8[_0x43e7('0x1')]||'voice';this['status']=_0x284ef8[_0x43e7('0x2')]||![];this['AllConditions']=_0x284ef8[_0x43e7('0x3')]||[];this[_0x43e7('0x4')]=_0x284ef8[_0x43e7('0x4')]||[];this[_0x43e7('0x5')]=_0x284ef8[_0x43e7('0x5')]||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0x54ef=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x5ba391,_0x9a6ea2){var _0x8434ad=function(_0x352884){while(--_0x352884){_0x5ba391['push'](_0x5ba391['shift']());}};_0x8434ad(++_0x9a6ea2);}(_0x54ef,0x112));var _0xf54e=function(_0x32515f,_0x45169c){_0x32515f=_0x32515f-0x0;var _0x3f567e=_0x54ef[_0x32515f];return _0x3f567e;};'use strict';function Trigger(_0x19d4d5){this['id']=_0x19d4d5['id']||0x0;this[_0xf54e('0x0')]=_0x19d4d5[_0xf54e('0x0')]||'';this['channel']=_0x19d4d5[_0xf54e('0x1')]||_0xf54e('0x2');this[_0xf54e('0x3')]=_0x19d4d5[_0xf54e('0x3')]||![];this[_0xf54e('0x4')]=_0x19d4d5[_0xf54e('0x4')]||[];this[_0xf54e('0x5')]=_0x19d4d5['AnyConditions']||[];this['Actions']=_0x19d4d5[_0xf54e('0x6')]||[];}module[_0xf54e('0x7')]=Trigger;
\ No newline at end of file
index 8cde7b5..bb4f214 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0936=['state','unknown','stateTime','status','registry','split','domain','domainport','refresh','registrationtime','address','exports','active','name'];(function(_0x958810,_0x402f2e){var _0x514bf4=function(_0x4a68ba){while(--_0x4a68ba){_0x958810['push'](_0x958810['shift']());}};_0x514bf4(++_0x402f2e);}(_0x0936,0xb4));var _0x6093=function(_0xeef0e9,_0xf38491){_0xeef0e9=_0xeef0e9-0x0;var _0x2654a6=_0x0936[_0xeef0e9];return _0x2654a6;};'use strict';function Trunk(_0x103236){this['id']=_0x103236['id']||0x0;this[_0x6093('0x0')]=_0x103236['active']||![];this[_0x6093('0x1')]=_0x103236['name']||'';this[_0x6093('0x2')]=_0x6093('0x3');this[_0x6093('0x4')]=0x0;this[_0x6093('0x5')]='unknown';this[_0x6093('0x6')]=_0x103236[_0x6093('0x6')]&&_0x103236[_0x6093('0x6')]['indexOf'](':')?_0x103236[_0x6093('0x6')][_0x6093('0x7')](':')[0x0]:'';this['host']='';this['port']='';this[_0x6093('0x8')]='';this[_0x6093('0x9')]='';this[_0x6093('0xa')]='';this['stateRegistry']=_0x6093('0x3');this[_0x6093('0xb')]='';this[_0x6093('0xc')]='';}module[_0x6093('0xd')]=Trunk;
\ No newline at end of file
+var _0x2d3d=['name','state','stateTime','status','registry','host','port','domain','refresh','stateRegistry','unknown','registrationtime','exports','active'];(function(_0xc34fca,_0x3e149d){var _0x3dd217=function(_0x8b7893){while(--_0x8b7893){_0xc34fca['push'](_0xc34fca['shift']());}};_0x3dd217(++_0x3e149d);}(_0x2d3d,0x1a3));var _0xd2d3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2d3d[_0x4565bf];return _0x5610ba;};'use strict';function Trunk(_0x2cea71){this['id']=_0x2cea71['id']||0x0;this[_0xd2d3('0x0')]=_0x2cea71[_0xd2d3('0x0')]||![];this[_0xd2d3('0x1')]=_0x2cea71[_0xd2d3('0x1')]||'';this[_0xd2d3('0x2')]='unknown';this[_0xd2d3('0x3')]=0x0;this[_0xd2d3('0x4')]='unknown';this['registry']=_0x2cea71[_0xd2d3('0x5')]&&_0x2cea71[_0xd2d3('0x5')]['indexOf'](':')?_0x2cea71[_0xd2d3('0x5')]['split'](':')[0x0]:'';this[_0xd2d3('0x6')]='';this[_0xd2d3('0x7')]='';this[_0xd2d3('0x8')]='';this['domainport']='';this[_0xd2d3('0x9')]='';this[_0xd2d3('0xa')]=_0xd2d3('0xb');this[_0xd2d3('0xc')]='';this['address']='';}module[_0xd2d3('0xd')]=Trunk;
\ No newline at end of file
index 56b189e..86e8076 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e0=['exten','recordingFormat','mandatoryDisposition'];(function(_0x4a6ef0,_0x55c872){var _0x23186f=function(_0x124b1c){while(--_0x124b1c){_0x4a6ef0['push'](_0x4a6ef0['shift']());}};_0x23186f(++_0x55c872);}(_0x55e0,0xde));var _0x055e=function(_0x50f74f,_0xa92d63){_0x50f74f=_0x50f74f-0x0;var _0x39072a=_0x55e0[_0x50f74f];return _0x39072a;};'use strict';function voiceExtension(_0x521168){this['id']=_0x521168['id']||0x0;this[_0x055e('0x0')]=_0x521168[_0x055e('0x0')]||'';this['recordingFormat']=_0x521168[_0x055e('0x1')]||'none';this['mandatoryDisposition']=_0x521168[_0x055e('0x2')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x8ecb=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x8ecb,0xe9));var _0xb8ec=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x8ecb[_0x23e7c1];return _0x1add43;};'use strict';function voiceExtension(_0x2748fc){this['id']=_0x2748fc['id']||0x0;this[_0xb8ec('0x0')]=_0x2748fc[_0xb8ec('0x0')]||'';this[_0xb8ec('0x1')]=_0x2748fc['recordingFormat']||'none';this[_0xb8ec('0x2')]=_0x2748fc[_0xb8ec('0x2')]||![];}module[_0xb8ec('0x3')]=voiceExtension;
\ No newline at end of file
index 6fef80d..5ad889b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c57=['wav','wav49','rrmemory','roundrobin','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','unavailable','ringinuse','onhold'];(function(_0x3a4820,_0x4b3404){var _0x27cafc=function(_0x132f15){while(--_0x132f15){_0x3a4820['push'](_0x3a4820['shift']());}};_0x27cafc(++_0x4b3404);}(_0x0c57,0x157));var _0x70c5=function(_0xed5170,_0x399a7f){_0xed5170=_0xed5170-0x0;var _0x46ad8f=_0x0c57[_0xed5170];return _0x46ad8f;};'use strict';var statusDesc=[_0x70c5('0x0'),'not_inuse',_0x70c5('0x1'),'busy','invalid',_0x70c5('0x2'),'ringing',_0x70c5('0x3'),_0x70c5('0x4')];var monitorFormat={'wav':_0x70c5('0x5'),'wav49':_0x70c5('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x70c5('0x7'),'roundrobin':_0x70c5('0x8')};function VoiceQueue(_0x2e7ab6){this['id']=_0x2e7ab6['id']||0x0;this['name']=_0x2e7ab6['name']||'';this[_0x70c5('0x9')]=_0x2e7ab6[_0x70c5('0x9')]||'';this[_0x70c5('0xa')]=_0x2e7ab6[_0x70c5('0xa')]||_0x70c5('0xb');this['waiting']=0x0;this[_0x70c5('0xc')]=0x0;this[_0x70c5('0xd')]=0x0;this[_0x70c5('0xe')]=0x0;this[_0x70c5('0xf')]=0x0;this[_0x70c5('0x10')]=0x0;this[_0x70c5('0x11')]=0x0;this[_0x70c5('0x12')]=0x0;this['abandoned']=0x0;this[_0x70c5('0x13')]=0x0;this[_0x70c5('0x14')]=0x0;this[_0x70c5('0x15')]=_0x2e7ab6[_0x70c5('0x15')]||![];this[_0x70c5('0x16')]=_0x2e7ab6[_0x70c5('0x16')]||0xa;this[_0x70c5('0x17')]=_0x2e7ab6[_0x70c5('0x17')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x70c5('0x18')]=0x0;this[_0x70c5('0x19')]=0x0;this['dialTimezone']=_0x2e7ab6[_0x70c5('0x1a')]||null;this[_0x70c5('0x1b')]=_0x2e7ab6['dialGlobalInterval']?_0x2e7ab6['dialGlobalInterval']:null;this[_0x70c5('0x1c')]=_0x2e7ab6[_0x70c5('0x1c')];this[_0x70c5('0x1d')]=_0x2e7ab6[_0x70c5('0x1d')]||_0x70c5('0x1e');this['dialLimitChannel']=_0x2e7ab6[_0x70c5('0x1f')]||0x0;this[_0x70c5('0x20')]=_0x2e7ab6[_0x70c5('0x20')]||0x0;this[_0x70c5('0x21')]=_0x2e7ab6[_0x70c5('0x21')]||0x1;this[_0x70c5('0x22')]=_0x2e7ab6['dialPredictiveOptimization']||_0x70c5('0x23');this[_0x70c5('0x24')]=_0x2e7ab6['dialPredictiveOptimizationPercentage']||0.03;this[_0x70c5('0x25')]=_0x2e7ab6[_0x70c5('0x25')]||0x258;this[_0x70c5('0x26')]=_0x2e7ab6['dialOriginateCallerIdName']||_0x70c5('0x27');this[_0x70c5('0x28')]=_0x2e7ab6[_0x70c5('0x28')]||_0x70c5('0x27');this['dialOriginateTimeout']=_0x2e7ab6[_0x70c5('0x29')]||0x1e;this['dialQueueOptions']=_0x2e7ab6[_0x70c5('0x2a')]||'tTxX';this[_0x70c5('0x2b')]=_0x2e7ab6[_0x70c5('0x2b')]||0x3;this[_0x70c5('0x2c')]=_0x2e7ab6['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x2e7ab6[_0x70c5('0x2d')]||0x3;this[_0x70c5('0x2e')]=_0x2e7ab6[_0x70c5('0x2e')]||0x96;this[_0x70c5('0x2f')]=_0x2e7ab6['dialBusyMaxRetry']||0x3;this[_0x70c5('0x30')]=_0x2e7ab6[_0x70c5('0x30')]||0x96;this[_0x70c5('0x31')]=_0x2e7ab6[_0x70c5('0x31')]||0x3;this[_0x70c5('0x32')]=_0x2e7ab6['dialNoAnswerRetryFrequency']||0x96;this[_0x70c5('0x33')]=_0x2e7ab6['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2e7ab6['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x2e7ab6[_0x70c5('0x34')]||0x3;this[_0x70c5('0x35')]=_0x2e7ab6[_0x70c5('0x35')]||0x96;this['dialAbandonedMaxRetry']=_0x2e7ab6[_0x70c5('0x36')]||0x3;this[_0x70c5('0x37')]=_0x2e7ab6['dialAbandonedRetryFrequency']||0x96;this[_0x70c5('0x38')]=_0x2e7ab6['dialMachineMaxRetry']||0x3;this[_0x70c5('0x39')]=_0x2e7ab6[_0x70c5('0x39')]||0x96;this[_0x70c5('0x3a')]=_0x2e7ab6['dialAgentRejectMaxRetry']||0x3;this[_0x70c5('0x3b')]=_0x2e7ab6[_0x70c5('0x3b')]||0x96;this['dialGlobalMaxRetry']=_0x2e7ab6[_0x70c5('0x3c')]||0x4;this[_0x70c5('0x3d')]=_0x2e7ab6[_0x70c5('0x3d')]?_0x2e7ab6['Trunk']:undefined;this[_0x70c5('0x3e')]=_0x2e7ab6[_0x70c5('0x3e')]?_0x2e7ab6['TrunkBackup']:undefined;this[_0x70c5('0x3f')]=_0x2e7ab6['dialPrefix']||undefined;this[_0x70c5('0x40')]=_0x2e7ab6[_0x70c5('0x40')]?_0x2e7ab6[_0x70c5('0x40')]:undefined;this[_0x70c5('0x41')]=_0x2e7ab6[_0x70c5('0x41')]||'DESC';this[_0x70c5('0x42')]=_0x2e7ab6[_0x70c5('0x42')]||undefined;this[_0x70c5('0x43')]=_0x2e7ab6[_0x70c5('0x43')]||undefined;this[_0x70c5('0x44')]=strategy[_0x2e7ab6[_0x70c5('0x44')]]||_0x70c5('0x7');this[_0x70c5('0x45')]=!![];this[_0x70c5('0x46')]=_0x2e7ab6[_0x70c5('0x46')]||![];this['dialAMDInitialSilence']=_0x2e7ab6[_0x70c5('0x47')];this[_0x70c5('0x48')]=_0x2e7ab6[_0x70c5('0x48')];this[_0x70c5('0x49')]=_0x2e7ab6['dialAMDAfterGreetingSilence'];this[_0x70c5('0x4a')]=_0x2e7ab6['dialAMDTotalAnalysisTime'];this[_0x70c5('0x4b')]=_0x2e7ab6[_0x70c5('0x4b')];this[_0x70c5('0x4c')]=_0x2e7ab6[_0x70c5('0x4c')];this['dialAMDMaximumNumberOfWords']=_0x2e7ab6['dialAMDMaximumNumberOfWords'];this[_0x70c5('0x4d')]=_0x2e7ab6[_0x70c5('0x4d')];this[_0x70c5('0x4e')]=_0x2e7ab6[_0x70c5('0x4e')];this[_0x70c5('0x4f')]=0x0;this[_0x70c5('0x50')]=0x0;this[_0x70c5('0x51')]=_0x2e7ab6[_0x70c5('0x51')];this[_0x70c5('0x52')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x70c5('0x53')]=0x0;this[_0x70c5('0x54')]=0x0;this[_0x70c5('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x70c5('0x56')]=0x0;this[_0x70c5('0x57')]=0x0;this[_0x70c5('0x58')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x70c5('0x59')]=0x0;this[_0x70c5('0x5a')]=0x0;this[_0x70c5('0x5b')]=0x0;this['startProgressive']=undefined;this[_0x70c5('0x5c')]=undefined;this[_0x70c5('0x5d')]=undefined;this[_0x70c5('0x5e')]=1.05;this[_0x70c5('0x5f')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x70c5('0x60')]=0x0;this[_0x70c5('0x61')]=0x0;this[_0x70c5('0x62')]=0x0;this[_0x70c5('0x63')]=0x0;this[_0x70c5('0x64')]=0x0;this[_0x70c5('0x65')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2e7ab6[_0x70c5('0x66')]||0x14;this[_0x70c5('0x67')]=_0x2e7ab6['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x70c5('0x68')]=0x0;this[_0x70c5('0x69')]=0x1;this[_0x70c5('0x6a')]=0x0;this[_0x70c5('0x6b')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x70c5('0x6c')]=0x0;this['dialRecallMeTimeout']=_0x2e7ab6['dialRecallMeTimeout']||0x1e;this[_0x70c5('0x6d')]=_0x2e7ab6['dialRecallInQueue']||![];this[_0x70c5('0x6e')]=_0x2e7ab6[_0x70c5('0x6e')]||undefined;this[_0x70c5('0x6f')]=_0x2e7ab6['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x2e7ab6[_0x70c5('0x70')]||![];this[_0x70c5('0x9')]=monitorFormat[_0x2e7ab6[_0x70c5('0x9')]]?monitorFormat[_0x2e7ab6[_0x70c5('0x9')]]:undefined;this[_0x70c5('0x71')]=_0x2e7ab6[_0x70c5('0x71')]||![];this[_0x70c5('0x72')]=_0x2e7ab6[_0x70c5('0x72')]?_0x2e7ab6['mandatoryDispositionPause']:undefined;}module[_0x70c5('0x73')]=VoiceQueue;
\ No newline at end of file
+var _0xf6ce=['abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','total','answered','sumDuration','sumHoldTime','unmanaged'];(function(_0x53a882,_0x5a2537){var _0x1a6bea=function(_0x393a1d){while(--_0x393a1d){_0x53a882['push'](_0x53a882['shift']());}};_0x1a6bea(++_0x5a2537);}(_0xf6ce,0x15a));var _0xef6c=function(_0x3c64dd,_0x536fa1){_0x3c64dd=_0x3c64dd-0x0;var _0x213167=_0xf6ce[_0x3c64dd];return _0x213167;};'use strict';var statusDesc=[_0xef6c('0x0'),_0xef6c('0x1'),_0xef6c('0x2'),_0xef6c('0x3'),_0xef6c('0x4'),_0xef6c('0x5'),'ringing','ringinuse',_0xef6c('0x6')];var monitorFormat={'wav':_0xef6c('0x7'),'wav49':_0xef6c('0x8'),'gsm':_0xef6c('0x9')};var strategy={'rrmemory':_0xef6c('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x30e8aa){this['id']=_0x30e8aa['id']||0x0;this['name']=_0x30e8aa[_0xef6c('0xb')]||'';this[_0xef6c('0xc')]=_0x30e8aa[_0xef6c('0xc')]||'';this['type']=_0x30e8aa[_0xef6c('0xd')]||_0xef6c('0xe');this['waiting']=0x0;this['talking']=0x0;this[_0xef6c('0xf')]=0x0;this[_0xef6c('0x10')]=0x0;this[_0xef6c('0x11')]=0x0;this[_0xef6c('0x12')]=0x0;this['sumBillable']=0x0;this[_0xef6c('0x13')]=0x0;this[_0xef6c('0x14')]=0x0;this['loggedIn']=0x0;this[_0xef6c('0x15')]=0x0;this['acw']=_0x30e8aa[_0xef6c('0x16')]||![];this[_0xef6c('0x17')]=_0x30e8aa[_0xef6c('0x17')]||0xa;this['autopause']=_0x30e8aa[_0xef6c('0x18')]||'no';this[_0xef6c('0x19')]=!![];this[_0xef6c('0x1a')]='';this[_0xef6c('0x1b')]=0x0;this[_0xef6c('0x1c')]=0x0;this[_0xef6c('0x1d')]=_0x30e8aa[_0xef6c('0x1d')]||null;this[_0xef6c('0x1e')]=_0x30e8aa[_0xef6c('0x1e')]?_0x30e8aa[_0xef6c('0x1e')]:null;this[_0xef6c('0x1f')]=_0x30e8aa[_0xef6c('0x1f')];this['dialMethod']=_0x30e8aa[_0xef6c('0x20')]||_0xef6c('0x21');this[_0xef6c('0x22')]=_0x30e8aa['dialLimitChannel']||0x0;this[_0xef6c('0x23')]=_0x30e8aa[_0xef6c('0x23')]||0x0;this[_0xef6c('0x24')]=_0x30e8aa['dialPowerLevel']||0x1;this[_0xef6c('0x25')]=_0x30e8aa[_0xef6c('0x25')]||_0xef6c('0x26');this[_0xef6c('0x27')]=_0x30e8aa[_0xef6c('0x27')]||0.03;this[_0xef6c('0x28')]=_0x30e8aa['dialPredictiveInterval']||0x258;this[_0xef6c('0x29')]=_0x30e8aa[_0xef6c('0x29')]||_0xef6c('0x2a');this[_0xef6c('0x2b')]=_0x30e8aa['dialOriginateCallerIdNumber']||_0xef6c('0x2a');this['dialOriginateTimeout']=_0x30e8aa[_0xef6c('0x2c')]||0x1e;this[_0xef6c('0x2d')]=_0x30e8aa[_0xef6c('0x2d')]||_0xef6c('0x2e');this[_0xef6c('0x2f')]=_0x30e8aa[_0xef6c('0x2f')]||0x3;this[_0xef6c('0x30')]=_0x30e8aa['dialQueueProject']||undefined;this[_0xef6c('0x31')]=_0x30e8aa[_0xef6c('0x31')]||0x3;this[_0xef6c('0x32')]=_0x30e8aa[_0xef6c('0x32')]||0x96;this[_0xef6c('0x33')]=_0x30e8aa[_0xef6c('0x33')]||0x3;this['dialBusyRetryFrequency']=_0x30e8aa['dialBusyRetryFrequency']||0x96;this[_0xef6c('0x34')]=_0x30e8aa[_0xef6c('0x34')]||0x3;this[_0xef6c('0x35')]=_0x30e8aa[_0xef6c('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x30e8aa[_0xef6c('0x36')]||0x3;this[_0xef6c('0x37')]=_0x30e8aa[_0xef6c('0x37')]||0x96;this[_0xef6c('0x38')]=_0x30e8aa[_0xef6c('0x38')]||0x3;this[_0xef6c('0x39')]=_0x30e8aa['dialDropRetryFrequency']||0x96;this[_0xef6c('0x3a')]=_0x30e8aa[_0xef6c('0x3a')]||0x3;this[_0xef6c('0x3b')]=_0x30e8aa[_0xef6c('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x30e8aa['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x30e8aa[_0xef6c('0x3c')]||0x96;this[_0xef6c('0x3d')]=_0x30e8aa[_0xef6c('0x3d')]||0x3;this[_0xef6c('0x3e')]=_0x30e8aa[_0xef6c('0x3e')]||0x96;this['dialGlobalMaxRetry']=_0x30e8aa[_0xef6c('0x3f')]||0x4;this[_0xef6c('0x40')]=_0x30e8aa[_0xef6c('0x40')]?_0x30e8aa['Trunk']:undefined;this[_0xef6c('0x41')]=_0x30e8aa['TrunkBackup']?_0x30e8aa[_0xef6c('0x41')]:undefined;this[_0xef6c('0x42')]=_0x30e8aa[_0xef6c('0x42')]||undefined;this[_0xef6c('0x43')]=_0x30e8aa[_0xef6c('0x43')]?_0x30e8aa[_0xef6c('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x30e8aa[_0xef6c('0x44')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x30e8aa[_0xef6c('0x45')]||undefined;this[_0xef6c('0x46')]=_0x30e8aa['dialCutDigit']||undefined;this[_0xef6c('0x47')]=strategy[_0x30e8aa[_0xef6c('0x47')]]||'rrmemory';this[_0xef6c('0x48')]=!![];this['dialAMDActive']=_0x30e8aa[_0xef6c('0x49')]||![];this[_0xef6c('0x4a')]=_0x30e8aa['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x30e8aa[_0xef6c('0x4b')];this[_0xef6c('0x4c')]=_0x30e8aa[_0xef6c('0x4c')];this[_0xef6c('0x4d')]=_0x30e8aa[_0xef6c('0x4d')];this[_0xef6c('0x4e')]=_0x30e8aa[_0xef6c('0x4e')];this[_0xef6c('0x4f')]=_0x30e8aa[_0xef6c('0x4f')];this[_0xef6c('0x50')]=_0x30e8aa['dialAMDMaximumNumberOfWords'];this[_0xef6c('0x51')]=_0x30e8aa['dialAMDSilenceThreshold'];this[_0xef6c('0x52')]=_0x30e8aa[_0xef6c('0x52')];this[_0xef6c('0x53')]=0x0;this[_0xef6c('0x54')]=0x0;this[_0xef6c('0x55')]=_0x30e8aa[_0xef6c('0x55')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xef6c('0x56')]=0x0;this[_0xef6c('0x57')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xef6c('0x58')]=0x0;this[_0xef6c('0x59')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xef6c('0x5a')]=0x0;this[_0xef6c('0x5b')]=0x0;this[_0xef6c('0x5c')]=0x0;this[_0xef6c('0x5d')]=0x0;this[_0xef6c('0x5e')]=0x0;this[_0xef6c('0x5f')]=0x0;this[_0xef6c('0x60')]=undefined;this['startPredictive']=undefined;this[_0xef6c('0x61')]=undefined;this[_0xef6c('0x62')]=1.05;this[_0xef6c('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xef6c('0x64')]=0x0;this[_0xef6c('0x65')]=0x0;this[_0xef6c('0x66')]=0x0;this[_0xef6c('0x67')]=0x0;this[_0xef6c('0x68')]=0x0;this[_0xef6c('0x69')]=_0x30e8aa[_0xef6c('0x6a')]||0x14;this[_0xef6c('0x6b')]=_0x30e8aa[_0xef6c('0x6a')]||0xa;this[_0xef6c('0x6c')]=0x0;this[_0xef6c('0x6d')]=0x0;this[_0xef6c('0x6e')]=0x1;this['erlangCalls']=0x0;this[_0xef6c('0x6f')]=0x0;this[_0xef6c('0x70')]=0x0;this[_0xef6c('0x71')]=0x0;this[_0xef6c('0x72')]=_0x30e8aa[_0xef6c('0x72')]||0x1e;this[_0xef6c('0x73')]=_0x30e8aa[_0xef6c('0x73')]||![];this[_0xef6c('0x74')]=_0x30e8aa[_0xef6c('0x74')]||undefined;this[_0xef6c('0x75')]=_0x30e8aa[_0xef6c('0x75')]||![];this[_0xef6c('0x76')]=_0x30e8aa[_0xef6c('0x76')]||![];this[_0xef6c('0xc')]=monitorFormat[_0x30e8aa['monitor_format']]?monitorFormat[_0x30e8aa[_0xef6c('0xc')]]:undefined;this[_0xef6c('0x77')]=_0x30e8aa['mandatoryDisposition']||![];this[_0xef6c('0x78')]=_0x30e8aa['mandatoryDispositionPause']?_0x30e8aa[_0xef6c('0x78')]:undefined;}module[_0xef6c('0x79')]=VoiceQueue;
\ No newline at end of file
index afa4e40..fc582fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78d8=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x44f470,_0x74d1a8){var _0x54f0f5=function(_0x1bddbe){while(--_0x1bddbe){_0x44f470['push'](_0x44f470['shift']());}};_0x54f0f5(++_0x74d1a8);}(_0x78d8,0x1a7));var _0x878d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x78d8[_0x14add3];return _0x4a174f;};'use strict';function VtigerAccount(_0x4d5347){this['id']=_0x4d5347['id']||0x0;this[_0x878d('0x0')]=_0x4d5347[_0x878d('0x0')]||'';this['username']=_0x4d5347[_0x878d('0x1')]||'';this[_0x878d('0x2')]=_0x4d5347['accessKey']||'';this[_0x878d('0x3')]=_0x4d5347[_0x878d('0x3')]||'';this[_0x878d('0x4')]=_0x4d5347[_0x878d('0x4')]||'';this[_0x878d('0x5')]=_0x4d5347[_0x878d('0x5')]||{};}module[_0x878d('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x7d6e=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x333535,_0x5171a1){var _0x4b96f1=function(_0x209bb3){while(--_0x209bb3){_0x333535['push'](_0x333535['shift']());}};_0x4b96f1(++_0x5171a1);}(_0x7d6e,0x1c8));var _0xe7d6=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0x7d6e[_0x2d0d9f];return _0x30243d;};'use strict';function VtigerAccount(_0x39bfad){this['id']=_0x39bfad['id']||0x0;this[_0xe7d6('0x0')]=_0x39bfad[_0xe7d6('0x0')]||'';this[_0xe7d6('0x1')]=_0x39bfad[_0xe7d6('0x1')]||'';this[_0xe7d6('0x2')]=_0x39bfad[_0xe7d6('0x2')]||'';this[_0xe7d6('0x3')]=_0x39bfad['remoteUri']||'';this[_0xe7d6('0x4')]=_0x39bfad[_0xe7d6('0x4')]||'';this[_0xe7d6('0x5')]=_0x39bfad[_0xe7d6('0x5')]||{};}module[_0xe7d6('0x6')]=VtigerAccount;
\ No newline at end of file
index 33f7d7d..e6ee511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x527f8b,_0x9e6e3a){_0x527f8b=_0x527f8b-0x0;var _0x2dbe22=_0xdb28[_0x527f8b];return _0x2dbe22;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x2c72d2,_0x568409){_0x2c72d2=_0x2c72d2-0x0;var _0x46cbed=_0xdb28[_0x2c72d2];return _0x46cbed;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('0x9')]=ZendeskAccount;
\ No newline at end of file
index 00cc5ea..af2e3b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2ab=['clientId','clientSecret','serverUrl','code','refreshToken','exports','name','description','host','zone'];(function(_0x13e8cc,_0x7151ee){var _0x5da4d0=function(_0x2626c2){while(--_0x2626c2){_0x13e8cc['push'](_0x13e8cc['shift']());}};_0x5da4d0(++_0x7151ee);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x2f882a,_0x1152e1){_0x2f882a=_0x2f882a-0x0;var _0x2df202=_0xe2ab[_0x2f882a];return _0x2df202;};'use strict';function ZohoAccount(_0x3fe77e){this['id']=_0x3fe77e['id']||0x0;this[_0xbe2a('0x0')]=_0x3fe77e[_0xbe2a('0x0')]||'';this[_0xbe2a('0x1')]=_0x3fe77e[_0xbe2a('0x1')]||'';this[_0xbe2a('0x2')]=_0x3fe77e['host']||'';this[_0xbe2a('0x3')]=_0x3fe77e[_0xbe2a('0x3')]||'';this[_0xbe2a('0x4')]=_0x3fe77e[_0xbe2a('0x4')]||'';this['clientSecret']=_0x3fe77e[_0xbe2a('0x5')]||'';this['serverUrl']=_0x3fe77e[_0xbe2a('0x6')]||'';this['code']=_0x3fe77e[_0xbe2a('0x7')]||'';this[_0xbe2a('0x8')]=_0x3fe77e[_0xbe2a('0x8')]||'';this['Configurations']=_0x3fe77e['Configurations']||{};}module[_0xbe2a('0x9')]=ZohoAccount;
\ No newline at end of file
+var _0xa478=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x153c6a,_0x2a217a){var _0xce898f=function(_0x84c97c){while(--_0x84c97c){_0x153c6a['push'](_0x153c6a['shift']());}};_0xce898f(++_0x2a217a);}(_0xa478,0x136));var _0x8a47=function(_0x34f0fb,_0x3323b2){_0x34f0fb=_0x34f0fb-0x0;var _0x9b7b2b=_0xa478[_0x34f0fb];return _0x9b7b2b;};'use strict';function ZohoAccount(_0x22222c){this['id']=_0x22222c['id']||0x0;this[_0x8a47('0x0')]=_0x22222c[_0x8a47('0x0')]||'';this[_0x8a47('0x1')]=_0x22222c[_0x8a47('0x1')]||'';this[_0x8a47('0x2')]=_0x22222c[_0x8a47('0x2')]||'';this[_0x8a47('0x3')]=_0x22222c[_0x8a47('0x3')]||'';this[_0x8a47('0x4')]=_0x22222c[_0x8a47('0x4')]||'';this[_0x8a47('0x5')]=_0x22222c['clientSecret']||'';this[_0x8a47('0x6')]=_0x22222c[_0x8a47('0x6')]||'';this[_0x8a47('0x7')]=_0x22222c[_0x8a47('0x7')]||'';this['refreshToken']=_0x22222c[_0x8a47('0x8')]||'';this['Configurations']=_0x22222c[_0x8a47('0x9')]||{};}module[_0x8a47('0xa')]=ZohoAccount;
\ No newline at end of file
index b0553ce..a956649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd26f=['originatecalleridnum','originatecalleridname','prototype','getCaller','format','exports','util','lodash','moment','isNil','string','uniqueid','idContact','type','campaigntype','dialAnswer','membername','Agent','channelAgent','calleridname','Contact','active','phone','scheduledat','countcongestionretry','countglobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x6d31ab,_0x2c5b8a){var _0x4f88b8=function(_0x3866c1){while(--_0x3866c1){_0x6d31ab['push'](_0x6d31ab['shift']());}};_0x4f88b8(++_0x2c5b8a);}(_0xd26f,0x81));var _0xfd26=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xd26f[_0xb0f7c3];return _0x28ea68;};'use strict';var util=require(_0xfd26('0x0'));var _=require(_0xfd26('0x1'));var moment=require(_0xfd26('0x2'));function checkNameSurname(_0x386240,_0x2b2b99,_0x247c7a){var _0x191f4f='';if(!_[_0xfd26('0x3')](_0x2b2b99)&&'string'===typeof _0x2b2b99){_0x191f4f+=_0x2b2b99;}if(!_[_0xfd26('0x3')](_0x247c7a)&&_0xfd26('0x4')===typeof _0x247c7a){_0x191f4f+='\x20'+_0x247c7a;}if(_0x191f4f!==''){return _0x191f4f;}return _0x386240;}function Action(_0x522d9b,_0x1f2d69,_0x7ae95f,_0xf04182,_0x599edd){this[_0xfd26('0x5')]=_0x7ae95f||undefined;this[_0xfd26('0x6')]=_0x522d9b['id'];this['queue']=_0x1f2d69['name'];this['type']=_0x1f2d69[_0xfd26('0x7')];this[_0xfd26('0x8')]='queue';this[_0xfd26('0x9')]=![];this[_0xfd26('0xa')]=_[_0xfd26('0x3')](_0x522d9b[_0xfd26('0xb')])?undefined:_0x522d9b[_0xfd26('0xb')]['name'];this[_0xfd26('0xc')]=this[_0xfd26('0xa')]?util['format']('SIP/%s',this[_0xfd26('0xa')]):_0xf04182||undefined;this[_0xfd26('0xd')]=checkNameSurname(_0x522d9b[_0xfd26('0xe')]['phone'],_0x522d9b[_0xfd26('0xe')]['firstName'],_0x522d9b[_0xfd26('0xe')]['lastName']);this[_0xfd26('0xf')]=_0x522d9b[_0xfd26('0xf')]||![];this['calleridnum']=_0x522d9b[_0xfd26('0xe')][_0xfd26('0x10')];this['scheduledat']=_0x522d9b[_0xfd26('0x11')];this['countbusyretry']=_0x522d9b['countbusyretry']||0x0;this[_0xfd26('0x12')]=_0x522d9b[_0xfd26('0x12')]||0x0;this['countnoanswerretry']=_0x522d9b['countnoanswerretry']||0x0;this[_0xfd26('0x13')]=(_0x522d9b[_0xfd26('0x14')]||0x0)+(_0x522d9b['countcongestionretry']||0x0)+(_0x522d9b[_0xfd26('0x15')]||0x0)+(_0x522d9b[_0xfd26('0x16')]||0x0)+(_0x522d9b[_0xfd26('0x17')]||0x0)+(_0x522d9b['countabandonedretry']||0x0)+(_0x522d9b[_0xfd26('0x18')]||0x0)+(_0x522d9b[_0xfd26('0x19')]||0x0);this[_0xfd26('0x16')]=_0x522d9b[_0xfd26('0x16')]||0x0;this[_0xfd26('0x17')]=_0x522d9b[_0xfd26('0x17')]||0x0;this['countabandonedretry']=_0x522d9b[_0xfd26('0x1a')]||0x0;this['countmachineretry']=_0x522d9b['countmachineretry']||0x0;this['countagentrejectretry']=_0x522d9b['countagentrejectretry']||0x0;this[_0xfd26('0x1b')]=_0x522d9b['callback'];this[_0xfd26('0x1c')]=_0x522d9b[_0xfd26('0x1c')];this[_0xfd26('0x1d')]=_0x522d9b[_0xfd26('0x1d')];this['recallme']=_0x522d9b[_0xfd26('0x1e')];this['ContactId']=_0x522d9b[_0xfd26('0x1f')];this[_0xfd26('0x20')]=_0x522d9b[_0xfd26('0x20')];this[_0xfd26('0x21')]=_['isNil'](_0x522d9b[_0xfd26('0xb')])?_0x522d9b[_0xfd26('0x21')]:_0x522d9b[_0xfd26('0xb')]['id'];this[_0xfd26('0x22')]=_0x522d9b['VoiceQueueId'];this[_0xfd26('0x23')]='';this[_0xfd26('0x24')]='';}Action[_0xfd26('0x25')][_0xfd26('0x26')]=function(){return util[_0xfd26('0x27')]('\x22%s\x22\x20<%s>',this['calleridname'],this['number']);};module[_0xfd26('0x28')]=Action;
\ No newline at end of file
+var _0x303a=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','phone','Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry'];(function(_0x59ea35,_0x473755){var _0x1bc334=function(_0x3536a5){while(--_0x3536a5){_0x59ea35['push'](_0x59ea35['shift']());}};_0x1bc334(++_0x473755);}(_0x303a,0x114));var _0xa303=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0x303a[_0x13ac10];return _0x28eda2;};'use strict';var util=require(_0xa303('0x0'));var _=require(_0xa303('0x1'));var moment=require(_0xa303('0x2'));function checkNameSurname(_0x5edc0b,_0x16ca52,_0x25a379){var _0xcf3730='';if(!_[_0xa303('0x3')](_0x16ca52)&&_0xa303('0x4')===typeof _0x16ca52){_0xcf3730+=_0x16ca52;}if(!_[_0xa303('0x3')](_0x25a379)&&_0xa303('0x4')===typeof _0x25a379){_0xcf3730+='\x20'+_0x25a379;}if(_0xcf3730!==''){return _0xcf3730;}return _0x5edc0b;}function Action(_0x3445f7,_0x586c67,_0x31475e,_0x6c988d,_0x4f40d6){this[_0xa303('0x5')]=_0x31475e||undefined;this[_0xa303('0x6')]=_0x3445f7['id'];this[_0xa303('0x7')]=_0x586c67[_0xa303('0x8')];this[_0xa303('0x9')]=_0x586c67[_0xa303('0x9')];this[_0xa303('0xa')]=_0xa303('0x7');this[_0xa303('0xb')]=![];this[_0xa303('0xc')]=_[_0xa303('0x3')](_0x3445f7[_0xa303('0xd')])?undefined:_0x3445f7[_0xa303('0xd')][_0xa303('0x8')];this[_0xa303('0xe')]=this[_0xa303('0xc')]?util[_0xa303('0xf')]('SIP/%s',this[_0xa303('0xc')]):_0x6c988d||undefined;this[_0xa303('0x10')]=checkNameSurname(_0x3445f7['Contact'][_0xa303('0x11')],_0x3445f7[_0xa303('0x12')][_0xa303('0x13')],_0x3445f7['Contact'][_0xa303('0x14')]);this[_0xa303('0x15')]=_0x3445f7[_0xa303('0x15')]||![];this['calleridnum']=_0x3445f7[_0xa303('0x12')][_0xa303('0x11')];this[_0xa303('0x16')]=_0x3445f7['scheduledat'];this[_0xa303('0x17')]=_0x3445f7[_0xa303('0x17')]||0x0;this['countcongestionretry']=_0x3445f7[_0xa303('0x18')]||0x0;this[_0xa303('0x19')]=_0x3445f7[_0xa303('0x19')]||0x0;this['countglobal']=(_0x3445f7[_0xa303('0x17')]||0x0)+(_0x3445f7['countcongestionretry']||0x0)+(_0x3445f7[_0xa303('0x19')]||0x0)+(_0x3445f7[_0xa303('0x1a')]||0x0)+(_0x3445f7[_0xa303('0x1b')]||0x0)+(_0x3445f7[_0xa303('0x1c')]||0x0)+(_0x3445f7['countmachineretry']||0x0)+(_0x3445f7['countagentrejectretry']||0x0);this[_0xa303('0x1a')]=_0x3445f7[_0xa303('0x1a')]||0x0;this[_0xa303('0x1b')]=_0x3445f7[_0xa303('0x1b')]||0x0;this[_0xa303('0x1c')]=_0x3445f7[_0xa303('0x1c')]||0x0;this[_0xa303('0x1d')]=_0x3445f7[_0xa303('0x1d')]||0x0;this[_0xa303('0x1e')]=_0x3445f7[_0xa303('0x1e')]||0x0;this[_0xa303('0x1f')]=_0x3445f7[_0xa303('0x1f')];this[_0xa303('0x20')]=_0x3445f7[_0xa303('0x20')];this[_0xa303('0x21')]=_0x3445f7[_0xa303('0x21')];this['recallme']=_0x3445f7['recallme'];this[_0xa303('0x22')]=_0x3445f7['ContactId'];this[_0xa303('0x23')]=_0x3445f7[_0xa303('0x23')];this['UserId']=_['isNil'](_0x3445f7[_0xa303('0xd')])?_0x3445f7[_0xa303('0x24')]:_0x3445f7[_0xa303('0xd')]['id'];this['VoiceQueueId']=_0x3445f7[_0xa303('0x25')];this['originatecalleridnum']='';this[_0xa303('0x26')]='';}Action[_0xa303('0x27')][_0xa303('0x28')]=function(){return util[_0xa303('0xf')](_0xa303('0x29'),this[_0xa303('0x10')],this['number']);};module[_0xa303('0x2a')]=Action;
\ No newline at end of file
index c264b4c..8caad43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa466=['getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','channel','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','clockClearZombieChannels','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','name','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','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','sendMessageOneNotActive','originated','pTalking','paused','NOT_ACTIVE','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','booked','type','outbound','hasOwnProperty','dialActive','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','actions','originated:\x20','queue','pTalking:\x20','VoiceQueueId','ListId','Action','catch','No\x20such\x20channel','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','agents','then','length','getDiff','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','emit','custom:agentconnect','buildObj','connect','custom:agentConnectPreview','buildAcw','complete','Answer','talktime','uniqueid','BUSY','countbusyretry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','lookAgent','isEmpty','execCall','Queue:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','pick','unlock','unlockContact','getContactPreview','recallme','isValid','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName'];(function(_0x30f1f4,_0x9906cc){var _0x3fe530=function(_0x60171e){while(--_0x60171e){_0x30f1f4['push'](_0x30f1f4['shift']());}};_0x3fe530(++_0x9906cc);}(_0xa466,0x169));var _0x6a46=function(_0x5afba1,_0x2afea8){_0x5afba1=_0x5afba1-0x0;var _0xe5d8b=_0xa466[_0x5afba1];return _0xe5d8b;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x6a46('0x0'));var moment=require(_0x6a46('0x1'));var md5=require(_0x6a46('0x2'));var Redis=require('ioredis');var config=require(_0x6a46('0x3'));var logger=require(_0x6a46('0x4'))(_0x6a46('0x5'));var loggerAction=require(_0x6a46('0x4'))(_0x6a46('0x6'));var ami=require('../ami');var rpcDb=require(_0x6a46('0x7'));var Action=require('./action');var ut=require(_0x6a46('0x8'));config[_0x6a46('0x9')]=_[_0x6a46('0xa')](config[_0x6a46('0x9')],{'host':_0x6a46('0xb'),'port':0x18eb});var io=require(_0x6a46('0xc'))(new Redis(config[_0x6a46('0x9')]));var Sequence=function(){};Sequence[_0x6a46('0xd')][_0x6a46('0xe')]=function(_0x264a7d){this[_0x6a46('0xf')]=this['tail']?this[_0x6a46('0xf')]['finally'](_0x264a7d):_0x264a7d();};function Preview(_0x51b59c){this[_0x6a46('0x10')]=new Sequence();this[_0x6a46('0x11')]=_0x51b59c[_0x6a46('0x12')];this[_0x6a46('0x13')]=_0x51b59c[_0x6a46('0x13')];this['actions']={};this['agents']=_0x51b59c['agents'];this[_0x6a46('0x14')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on'](_0x6a46('0x15'),this[_0x6a46('0x16')][_0x6a46('0x17')](this));ami['on'](_0x6a46('0x18'),this[_0x6a46('0x19')]['bind'](this));ami['on'](_0x6a46('0x1a'),this[_0x6a46('0x1b')][_0x6a46('0x17')](this));ami['on']('newexten',this[_0x6a46('0x1c')]['bind'](this));ami['on'](_0x6a46('0x1d'),this[_0x6a46('0x1e')][_0x6a46('0x17')](this));ami['on'](_0x6a46('0x1f'),this['syncAttendedTransfer'][_0x6a46('0x17')](this));ami['on']('blindtransfer',this[_0x6a46('0x20')][_0x6a46('0x17')](this));this[_0x6a46('0x21')](this[_0x6a46('0x11')]);}function emit(_0x5c56d0,_0x532780,_0x2a0052){io['to'](_0x5c56d0)['emit'](_0x532780,_0x2a0052);}function emitCampaignPreview(_0xff5846){if(_0xff5846['type']==='outbound'){var _0x532770={'id':_0xff5846['id'],'name':_0xff5846[_0x6a46('0x22')],'strategy':_0xff5846['strategy'],'answered':_0xff5846[_0x6a46('0x23')],'available':_0xff5846[_0x6a46('0x24')],'loggedIn':_0xff5846[_0x6a46('0x25')],'pTalking':_0xff5846['pTalking'],'sumBillable':_0xff5846[_0x6a46('0x26')],'sumDuration':_0xff5846[_0x6a46('0x27')],'sumHoldTime':_0xff5846[_0x6a46('0x28')]||0x0,'talking':_0xff5846[_0x6a46('0x29')],'total':_0xff5846[_0x6a46('0x2a')],'type':_0xff5846['type'],'unmanaged':_0xff5846['unmanaged'],'abandoned':_0xff5846[_0x6a46('0x2b')],'waiting':_0xff5846[_0x6a46('0x2c')],'loggedInDb':_0xff5846[_0x6a46('0x2d')],'dialActive':_0xff5846['dialActive'],'dialMethod':_0xff5846[_0x6a46('0x2e')],'dialOriginateCallerIdName':_0xff5846['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xff5846[_0x6a46('0x2f')],'dialOriginateTimeout':_0xff5846[_0x6a46('0x30')],'dialPrefix':_0xff5846[_0x6a46('0x31')],'outboundAnswerAgiCallsDay':_0xff5846[_0x6a46('0x32')],'outboundAnswerCallsDay':_0xff5846[_0x6a46('0x33')],'outboundBlacklistCallsDay':_0xff5846['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0xff5846[_0x6a46('0x34')],'outboundCongestionCallsDay':_0xff5846[_0x6a46('0x35')],'outboundDropCallsDayACS':_0xff5846[_0x6a46('0x36')],'outboundDropCallsDayCallersExit':_0xff5846[_0x6a46('0x37')],'outboundDropCallsDayTimeout':_0xff5846['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xff5846[_0x6a46('0x38')],'outboundNoSuchCallsDay':_0xff5846[_0x6a46('0x39')],'outboundOriginateFailureCallsDay':_0xff5846[_0x6a46('0x3a')],'outboundReCallsDay':_0xff5846[_0x6a46('0x3b')],'outboundRejectCallsDay':_0xff5846[_0x6a46('0x3c')],'outboundUnknownCallsDay':_0xff5846[_0x6a46('0x3d')],'outboundAbandonedCallsDay':_0xff5846[_0x6a46('0x3e')],'predictiveIntervalAnsweredCalls':_0xff5846[_0x6a46('0x3f')],'predictiveIntervalAvgHoldtime':_0xff5846[_0x6a46('0x40')],'predictiveIntervalAvgTalktime':_0xff5846[_0x6a46('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0xff5846[_0x6a46('0x42')],'predictiveIntervalDroppedCallsTimeout':_0xff5846['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xff5846['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xff5846[_0x6a46('0x43')],'predictiveIntervalHitRate':_0xff5846[_0x6a46('0x44')],'predictiveIntervalMultiplicativeFactor':_0xff5846[_0x6a46('0x45')],'predictiveIntervalPauses':_0xff5846[_0x6a46('0x46')],'predictiveIntervalAvailable':_0xff5846[_0x6a46('0x47')],'predictiveIntervalTotalCalls':_0xff5846[_0x6a46('0x48')],'message':_0xff5846[_0x6a46('0x49')],'originated':_0xff5846['originated'],'erlangCalls':_0xff5846[_0x6a46('0x4a')],'erlangCallToSecond':_0xff5846[_0x6a46('0x4b')],'erlangAbandonmentRate':_0xff5846[_0x6a46('0x4c')],'erlangBusyFactor':_0xff5846[_0x6a46('0x4d')],'startPredictive':_0xff5846[_0x6a46('0x4e')],'startProgressive':_0xff5846[_0x6a46('0x4f')]};if(_0xff5846[_0x6a46('0x50')]){_0x532770[_0x6a46('0x50')]={'id':_0xff5846['Trunk']['id'],'name':_0xff5846[_0x6a46('0x50')][_0x6a46('0x22')],'active':_0xff5846[_0x6a46('0x50')]['active'],'callerid':_0xff5846['Trunk'][_0x6a46('0x51')]};}if(_0xff5846['Interval']){_0x532770[_0x6a46('0x52')]={'id':_0xff5846[_0x6a46('0x52')]['id'],'name':_0xff5846[_0x6a46('0x52')][_0x6a46('0x22')]};}var _0x4d2dc5=md5(JSON[_0x6a46('0x53')](_0x532770));if(_0xff5846[_0x6a46('0x2')]!==_0x4d2dc5){_0xff5846[_0x6a46('0x2')]=_0x4d2dc5;emit(util['format'](_0x6a46('0x54'),_0x532770[_0x6a46('0x22')]),_0x6a46('0x55'),_0x532770);}}}function emitVoiceQueueChannelRemove(_0x155393){logger[_0x6a46('0x56')](_0x6a46('0x57'),JSON['stringify'](_0x155393));emit(util['format'](_0x6a46('0x54'),_0x155393[_0x6a46('0x22')]),_0x6a46('0x58'),_0x155393);}function notSendMessagesQueue(_0x250cd9){if(_0x250cd9[_0x6a46('0x59')]){if(_0x250cd9[_0x6a46('0x5a')]===0x0&&_0x250cd9[_0x6a46('0x5b')]===0x0){_0x250cd9[_0x6a46('0x59')]=![];_0x250cd9[_0x6a46('0x24')]=0x0;_0x250cd9[_0x6a46('0x5c')]=0x0;_0x250cd9[_0x6a46('0x49')]=_0x6a46('0x5d');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x250cd9[_0x6a46('0x22')]+_0x6a46('0x5e'));}else{_0x250cd9[_0x6a46('0x49')]=_0x6a46('0x5f');ut[_0x6a46('0x60')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x250cd9[_0x6a46('0x22')]+_0x6a46('0x61'));}emitCampaignPreview(_0x250cd9);}}Preview[_0x6a46('0xd')]['loopCampaigns']=function(){var _0x438ce4=this;setInterval(function(){_0x438ce4[_0x6a46('0x62')]();},0x7cf);};Preview[_0x6a46('0xd')][_0x6a46('0x62')]=function(){var _0x398eef=this[_0x6a46('0x11')];this[_0x6a46('0x14')]+=0x1;for(var _0x5e7920 in _0x398eef){if(_0x398eef['hasOwnProperty'](_0x5e7920)&&(_0x398eef[_0x5e7920][_0x6a46('0x2e')]==='preview'||_0x398eef[_0x5e7920][_0x6a46('0x2e')]===_0x6a46('0x63'))&&_0x398eef[_0x5e7920][_0x6a46('0x64')]===_0x6a46('0x65')){if(this[_0x6a46('0x14')]>0x7){this[_0x6a46('0x14')]=0x0;this['clearZombieChannels']();}}if(_0x398eef[_0x6a46('0x66')](_0x5e7920)&&_0x398eef[_0x5e7920][_0x6a46('0x2e')]===_0x6a46('0x5')&&_0x398eef[_0x5e7920][_0x6a46('0x64')]===_0x6a46('0x65')){if(_0x398eef[_0x5e7920][_0x6a46('0x67')]){this['setMessage'](_0x398eef[_0x5e7920]);this[_0x6a46('0x68')](_0x398eef[_0x5e7920]);}else{notSendMessagesQueue(_0x398eef[_0x5e7920]);}}}};Preview[_0x6a46('0xd')][_0x6a46('0x69')]=function(_0x2268ae){var _0x16caa3=this;this['sequence'][_0x6a46('0xe')](function(){if(!_[_0x6a46('0x6a')](_0x16caa3['actions'][_0x2268ae])){loggerAction['info'](_0x6a46('0x6b'),_0x2268ae,_0x6a46('0x6c'),_0x16caa3[_0x6a46('0x6d')][_0x2268ae]['queue'],_0x6a46('0x6e'),JSON[_0x6a46('0x53')](_0x16caa3['campaignsPreview'][_0x16caa3[_0x6a46('0x6d')][_0x2268ae][_0x6a46('0x6f')]][_0x6a46('0x5a')]),_0x6a46('0x70'),JSON[_0x6a46('0x53')](_0x16caa3[_0x6a46('0x11')][_0x16caa3[_0x6a46('0x6d')][_0x2268ae]['queue']][_0x6a46('0x5b')]),JSON[_0x6a46('0x53')](_0x16caa3['actions'][_0x2268ae]['dialAnswer']),JSON['stringify'](_['pick'](_0x16caa3[_0x6a46('0x6d')][_0x2268ae],['contactId','UserId',_0x6a46('0x71'),_0x6a46('0x72')])));return ami[_0x6a46('0x73')]({'action':'status','channel':_0x16caa3[_0x6a46('0x6d')][_0x2268ae]['channel']})[_0x6a46('0x74')](function(_0x166e89){if(_0x166e89['message']===_0x6a46('0x75')){setTimeout(function(){if(_0x16caa3['actions'][_0x2268ae]){ut['updateOriginated'](_0x16caa3[_0x6a46('0x11')][_0x16caa3[_0x6a46('0x6d')][_0x2268ae][_0x6a46('0x6f')]],'[clearZombieChannel]');if(_0x16caa3[_0x6a46('0x6d')][_0x2268ae][_0x6a46('0x76')]===!![]){ut[_0x6a46('0x77')](_0x16caa3['campaignsPreview'][_0x16caa3[_0x6a46('0x6d')][_0x2268ae][_0x6a46('0x6f')]],'[clearZombieChannel]');ut[_0x6a46('0x78')](_0x6a46('0x79')+_0x2268ae,_0x16caa3['actions'][_0x2268ae][_0x6a46('0x6f')]);}ut['loggerError'](_0x6a46('0x7a')+_0x2268ae,_0x16caa3['actions'][_0x2268ae][_0x6a46('0x6f')]);delete _0x16caa3[_0x6a46('0x6d')][_0x2268ae];}},0x2328);}});}});};Preview[_0x6a46('0xd')][_0x6a46('0x7b')]=function(){var _0x565444=this;loggerAction[_0x6a46('0x56')](_0x6a46('0x7c'),_[_0x6a46('0x7d')](this['actions']));for(var _0x5ef050 in this['actions']){if(_0x565444[_0x6a46('0x6d')][_0x6a46('0x66')](_0x5ef050)){_0x565444[_0x6a46('0x69')](_0x5ef050);}}};Preview[_0x6a46('0xd')][_0x6a46('0x68')]=function(_0x53c82c){var _0x4c3534=this;rpcDb[_0x6a46('0x7e')](_0x53c82c['id'],ut[_0x6a46('0x7f')](this[_0x6a46('0x80')]))[_0x6a46('0x81')](function(_0x3f1081){if(!_[_0x6a46('0x6a')](_0x3f1081)){for(var _0x2cb809=0x0;_0x2cb809<_0x3f1081[_0x6a46('0x82')];_0x2cb809+=0x1){if(ut[_0x6a46('0x83')](_0x3f1081[_0x2cb809]['scheduledat'])<_0x53c82c[_0x6a46('0x84')]*0x3c){if(_0x3f1081[_0x2cb809][_0x6a46('0x85')]&&!_0x3f1081[_0x2cb809]['Agent']['voicePause']){_0x4c3534[_0x6a46('0x86')](_0x3f1081[_0x2cb809]['id'])[_0x6a46('0x81')](ut[_0x6a46('0x87')](_0x6a46('0x88')))[_0x6a46('0x74')](ut[_0x6a46('0x87')](_0x6a46('0x88')));}else{rpcDb[_0x6a46('0x89')](_0x3f1081[_0x2cb809]['id']);}}else{var _0x48038e=new Action(_0x3f1081[_0x2cb809],_0x53c82c);_0x48038e[_0x6a46('0x8a')]=moment()[_0x6a46('0x8b')](_0x6a46('0x8c'));_0x53c82c[_0x6a46('0x3b')]+=0x1;ut[_0x6a46('0x8d')](_0x48038e,0x17,'RecallInQueue');if(_0x53c82c[_0x6a46('0x8e')]){rpcDb[_0x6a46('0x8f')](ut['createBody'](_0x3f1081[_0x2cb809]));rpcDb['createCustomerHistory'](_0x48038e,_0x6a46('0x90'));}else{ut['logCustomer'](_0x48038e,0x16,'RecallFailedTimeout');rpcDb[_0x6a46('0x91')](_0x48038e,_0x6a46('0x92'));rpcDb[_0x6a46('0x93')](_0x48038e,_0x6a46('0x92'));}}}}})[_0x6a46('0x74')](ut['logger2'](_0x6a46('0x94')));};Preview[_0x6a46('0xd')][_0x6a46('0x95')]=function(_0x4acae0){_0x4acae0[_0x6a46('0x59')]=!![];if(ut[_0x6a46('0x96')](_0x4acae0[_0x6a46('0x25')])){_0x4acae0[_0x6a46('0x49')]=_0x6a46('0x97');}else if(!ut[_0x6a46('0x98')](_0x4acae0[_0x6a46('0x67')])){_0x4acae0[_0x6a46('0x49')]='NOT_ACTIVE';}else if(!this[_0x6a46('0x99')](_0x4acae0[_0x6a46('0x50')])){if(!this['isTrunkReachable'](_0x4acae0[_0x6a46('0x9a')])){_0x4acae0[_0x6a46('0x49')]=_0x6a46('0x9b');}else{_0x4acae0[_0x6a46('0x49')]=_0x6a46('0x9c');}}else{_0x4acae0[_0x6a46('0x49')]=_0x6a46('0x9c');}emitCampaignPreview(_0x4acae0);};Preview[_0x6a46('0xd')][_0x6a46('0x9d')]=function(_0x2ee546,_0x5873ed,_0xfe3be5){var _0x14624f=this;var _0x33506c=this['actions'][_0x5873ed];var _0x555922=this['campaignsPreview'][_0x33506c[_0x6a46('0x6f')]];var _0x37a616;if(_0x555922){switch(_0xfe3be5){case'1':_0x555922[_0x6a46('0x39')]+=0x1;_0x33506c[_0x6a46('0x9e')]+=0x1;_0x33506c[_0x6a46('0x9f')]=ut[_0x6a46('0xa0')](_0x33506c);ut[_0x6a46('0x8d')](_0x33506c,0x0,_0x6a46('0xa1'));rpcDb[_0x6a46('0x91')](_0x33506c,_0x6a46('0xa2'));if(ut[_0x6a46('0xa0')](_0x33506c)>=_0x555922[_0x6a46('0xa3')]){_0x37a616=ut[_0x6a46('0xa4')](_0x33506c,0xf,_0x6a46('0xa5'));rpcDb[_0x6a46('0x93')](_0x37a616,_0x6a46('0xa6'));}else{if(_0x33506c[_0x6a46('0x9e')]>=_0x555922[_0x6a46('0xa7')]){rpcDb[_0x6a46('0x93')](_0x33506c,_0x6a46('0xa6'));}else{rpcDb[_0x6a46('0xa8')](ut[_0x6a46('0xa9')](_0x33506c,_0x6a46('0x9e'),_0x555922[_0x6a46('0xaa')]),_0x33506c[_0x6a46('0xab')],_0x33506c['activeContact']);}}delete this[_0x6a46('0x6d')][_0x2ee546[_0x6a46('0xac')]];break;case _0x6a46('0xad'):var _0x282f6d=moment()['format'](_0x6a46('0x8c'));_0x33506c[_0x6a46('0xae')]=_0x282f6d;_0x33506c[_0x6a46('0xaf')]=_0x282f6d;_0x33506c[_0x6a46('0x76')]=!![];_0x555922['pTalking']+=0x1;logger[_0x6a46('0x56')](_0x6a46('0xb0'),_0x33506c['uniqueid'],_0x6a46('0xb1'),_0x555922[_0x6a46('0x22')],_0x6a46('0x70'),_0x555922[_0x6a46('0x5b')]);ami[_0x6a46('0xb2')](_0x6a46('0xb3'),ut[_0x6a46('0xb4')](_0x33506c,_0x6a46('0xb5')));if(_0x555922['acw']){ami['emit'](_0x6a46('0xb6'),ut[_0x6a46('0xb7')](_0x33506c));}break;case'16':ami[_0x6a46('0xb2')]('custom:agentcomplete',ut[_0x6a46('0xb4')](_0x33506c,_0x6a46('0xb8')));emitVoiceQueueChannelRemove(ut[_0x6a46('0xb4')](_0x33506c,_0x6a46('0xb8')));_0x555922[_0x6a46('0x33')]+=0x1;_0x555922[_0x6a46('0x2a')]+=0x1;_0x555922[_0x6a46('0x23')]+=0x1;ut[_0x6a46('0x77')](_0x555922,'[16]');_0x33506c[_0x6a46('0x9f')]=ut[_0x6a46('0xa0')](_0x33506c);ut['logCustomer'](_0x33506c,0x4,_0x6a46('0xb9'));rpcDb[_0x6a46('0x91')](_0x33506c,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x6a46('0x93')](_0x33506c,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x33506c);_0x555922['sumDuration']+=_0x33506c[_0x6a46('0xba')];_0x555922[_0x6a46('0x26')]+=_0x33506c[_0x6a46('0xba')];logger[_0x6a46('0x56')]('[syncHangup][talking][decrement]',_0x33506c[_0x6a46('0xbb')],_0x6a46('0xb1'),_0x555922[_0x6a46('0x22')],_0x6a46('0x70'),_0x555922['pTalking']);delete this['actions'][_0x2ee546['linkedid']];break;case _0x6a46('0xbc'):_0x555922['outboundBusyCallsDay']+=0x1;_0x33506c[_0x6a46('0xbd')]+=0x1;_0x33506c[_0x6a46('0x9f')]=ut[_0x6a46('0xa0')](_0x33506c);ut[_0x6a46('0x8d')](_0x33506c,0x5,'Busy');rpcDb[_0x6a46('0x91')](_0x33506c,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x6a46('0xa0')](_0x33506c)>=_0x555922[_0x6a46('0xa3')]){_0x37a616=ut[_0x6a46('0xa4')](_0x33506c,0xf,_0x6a46('0xa5'));rpcDb[_0x6a46('0x93')](_0x37a616,_0x6a46('0xbe'));}else{if(_0x33506c[_0x6a46('0xbd')]>=_0x555922[_0x6a46('0xbf')]){rpcDb[_0x6a46('0x93')](_0x33506c,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x6a46('0xa8')](ut[_0x6a46('0xa9')](_0x33506c,_0x6a46('0xbd'),_0x555922[_0x6a46('0xc0')]),_0x33506c[_0x6a46('0xab')],_0x33506c[_0x6a46('0xc1')]);}}break;case _0x6a46('0xc2'):_0x555922['outboundNoAnswerCallsDay']+=0x1;_0x33506c[_0x6a46('0xc3')]+=0x1;_0x33506c[_0x6a46('0x9f')]=ut['totalGlobal'](_0x33506c);ut['logCustomer'](_0x33506c,0x3,_0x6a46('0xc4'));rpcDb['createCustomerHistory'](_0x33506c,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x33506c)>=_0x555922['dialGlobalMaxRetry']){_0x37a616=ut[_0x6a46('0xa4')](_0x33506c,0xf,_0x6a46('0xa5'));rpcDb[_0x6a46('0x93')](_0x37a616,_0x6a46('0xc5'));}else{if(_0x33506c[_0x6a46('0xc3')]>=_0x555922[_0x6a46('0xc6')]){rpcDb[_0x6a46('0x93')](_0x33506c,_0x6a46('0xc7'));}else{rpcDb[_0x6a46('0xa8')](ut[_0x6a46('0xa9')](_0x33506c,_0x6a46('0xc3'),_0x555922[_0x6a46('0xc8')]),_0x33506c[_0x6a46('0xab')],_0x33506c[_0x6a46('0xc1')]);}}break;case'CONGESTION':_0x555922['outboundCongestionCallsDay']+=0x1;_0x33506c['countcongestionretry']+=0x1;_0x33506c['countglobal']=ut['totalGlobal'](_0x33506c);ut[_0x6a46('0x8d')](_0x33506c,0x8,_0x6a46('0xc9'));rpcDb[_0x6a46('0x91')](_0x33506c,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x6a46('0xa0')](_0x33506c)>=_0x555922[_0x6a46('0xa3')]){_0x37a616=ut[_0x6a46('0xa4')](_0x33506c,0xf,_0x6a46('0xa5'));rpcDb['createCustomerFinal'](_0x37a616,_0x6a46('0xca'));}else{if(_0x33506c[_0x6a46('0xcb')]>=_0x555922[_0x6a46('0xcc')]){rpcDb[_0x6a46('0x93')](_0x33506c,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x6a46('0xa9')](_0x33506c,_0x6a46('0xcb'),_0x555922[_0x6a46('0xc0')]),_0x33506c[_0x6a46('0xab')],_0x33506c[_0x6a46('0xc1')]);}}break;case _0x6a46('0xcd'):_0x555922['outboundRejectCallsDay']+=0x1;_0x33506c[_0x6a46('0xce')]+=0x1;_0x33506c[_0x6a46('0x9f')]=ut['totalGlobal'](_0x33506c);ut[_0x6a46('0x8d')](_0x33506c,0x14,_0x6a46('0xcf'));rpcDb[_0x6a46('0x91')](_0x33506c,_0x6a46('0xd0'));if(ut[_0x6a46('0xa0')](_0x33506c)>=_0x555922[_0x6a46('0xa3')]){_0x37a616=ut['cloneAction'](_0x33506c,0x14,_0x6a46('0xcf'));rpcDb[_0x6a46('0x93')](_0x37a616,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x33506c['countagentrejectretry']>=_0x555922[_0x6a46('0xd1')]){rpcDb[_0x6a46('0x93')](_0x33506c,_0x6a46('0xd2'));}else{rpcDb[_0x6a46('0xa8')](ut[_0x6a46('0xa9')](_0x33506c,_0x6a46('0xce'),_0x555922[_0x6a46('0xd3')]),_0x33506c['unlockAgent'],_0x33506c[_0x6a46('0xc1')]);}}break;case _0x6a46('0xd4'):_0x555922[_0x6a46('0x3e')]+=0x1;_0x33506c[_0x6a46('0xd5')]+=0x1;_0x33506c['countglobal']=ut[_0x6a46('0xa0')](_0x33506c);ut['logCustomer'](_0x33506c,0xb,_0x6a46('0xd6'));rpcDb[_0x6a46('0x91')](_0x33506c,_0x6a46('0xd7'));if(ut[_0x6a46('0xa0')](_0x33506c)>=_0x555922['dialGlobalMaxRetry']){_0x37a616=ut[_0x6a46('0xa4')](_0x33506c,0xf,_0x6a46('0xa5'));rpcDb['createCustomerFinal'](_0x37a616,_0x6a46('0xd7'));}else{if(_0x33506c[_0x6a46('0xd8')]>=_0x555922[_0x6a46('0xd9')]){rpcDb[_0x6a46('0x93')](_0x33506c,_0x6a46('0xd7'));}else{rpcDb[_0x6a46('0xa8')](ut[_0x6a46('0xa9')](_0x33506c,'countabandonedretry',_0x555922[_0x6a46('0xda')]),_0x33506c[_0x6a46('0xab')],_0x33506c['activeContact']);}}break;default:if(_0x33506c['dialAnswer']){ut[_0x6a46('0x77')](_0x555922,_0x6a46('0xdb'));ut[_0x6a46('0x78')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x555922[_0x6a46('0x22')],_0x2ee546);}_0x555922[_0x6a46('0x3d')]+=0x1;_0x33506c['countglobal']=ut['totalGlobal'](_0x33506c);ut[_0x6a46('0x8d')](_0x33506c,0xc,_0x2ee546[_0x6a46('0xdc')]||_0x2ee546[_0x6a46('0xdd')]);rpcDb[_0x6a46('0x91')](_0x33506c,_0x6a46('0xde'));if(ut['totalGlobal'](_0x33506c)>=_0x555922[_0x6a46('0xa3')]){_0x37a616=ut[_0x6a46('0xa4')](_0x33506c,0xf,_0x6a46('0xa5'));rpcDb[_0x6a46('0x93')](_0x37a616,_0x6a46('0xdf'));}else{rpcDb[_0x6a46('0x93')](_0x33506c,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x6a46('0x6d')][_0x2ee546[_0x6a46('0xac')]];}if(!(_0x33506c[_0x6a46('0x76')]&&_0xfe3be5==='16')){ut[_0x6a46('0xe0')](_0x555922,_0x6a46('0xe1'));logger['info'](_0x6a46('0xe2'),_0x33506c['uniqueid'],_0x6a46('0xb1'),_0x555922[_0x6a46('0x22')],_0x6a46('0x6e'),_0x555922['originated']);}if(_0xfe3be5!==_0x6a46('0xad')){delete this['actions'][_0x2ee546['linkedid']];delete this[_0x6a46('0x6d')][_0x2ee546[_0x6a46('0xe3')]];}}};Preview[_0x6a46('0xd')][_0x6a46('0xe4')]=function(_0x5cf121,_0x3137de,_0x2c5471){if(_[_0x6a46('0xe5')](_0x3137de)&&'object'!==typeof _0x3137de){return;}if(_[_0x6a46('0xe5')](_0x2c5471)&&_0x6a46('0xe6')!==typeof _0x2c5471){return;}switch(_0x2c5471[_0x6a46('0xe7')]){case'0':ut[_0x6a46('0xe8')](_0x5cf121,0x0,_0x6a46('0xa1'));rpcDb[_0x6a46('0xe9')](_0x5cf121,_0x6a46('0xea'));break;case'3':ut['logAgent'](_0x5cf121,0x3,_0x6a46('0xc4'));rpcDb[_0x6a46('0xe9')](_0x5cf121,_0x6a46('0xeb'));break;case'5':ut[_0x6a46('0xe8')](_0x5cf121,0x5,'Busy');rpcDb['createAgentHistory'](_0x5cf121,_0x6a46('0xec'));break;case'8':ut['logAgent'](_0x5cf121,0x8,_0x6a46('0xc9'));rpcDb[_0x6a46('0xe9')](_0x5cf121,_0x6a46('0xed'));break;case'22':ut[_0x6a46('0xe8')](_0x5cf121,0x16,_0x6a46('0xee'));rpcDb['createAgentHistory'](_0x5cf121,_0x6a46('0xef'));break;default:ut[_0x6a46('0xe8')](_0x5cf121,0xc,_0x2c5471['reason']);rpcDb[_0x6a46('0xe9')](_0x5cf121,_0x6a46('0xed'));}ut[_0x6a46('0xe0')](_0x3137de,_0x6a46('0xf0'));logger['info'](_0x6a46('0xf1'),_0x5cf121[_0x6a46('0xbb')],'\x20Queue',_0x3137de[_0x6a46('0x22')],_0x6a46('0x6e'),_0x3137de['originated']);delete this[_0x6a46('0x6d')][_0x5cf121[_0x6a46('0xbb')]];};Preview[_0x6a46('0xd')]['checkInBlack']=function(_0x5ac2f1,_0x6f7108,_0x33fc8a,_0xa08bbb,_0x28fc41){var _0x4862cc=this;return new BPromise(function(_0x136fd2,_0x397c20){if(_['isNil'](_0x6f7108)||_[_0x6a46('0x6a')](_0x6f7108[_0x6a46('0xf2')])||_[_0x6a46('0x6a')](_0x6f7108[_0x6a46('0xf2')][_0x6a46('0xf3')])||_[_0x6a46('0x6a')](_0x6f7108['VoiceQueueId'])){_0x397c20(ut['message']('Contact\x20is\x20undefined',_0xa08bbb,_0x28fc41));return;}var _0x4822fd=uuid['v4']();var _0x2620b2=_0x4862cc[_0x6a46('0x11')][_0x6f7108[_0x6a46('0x6c')][_0x6a46('0x22')]];var _0x278656=_0x33fc8a?_0x4862cc['agents'][_0x33fc8a]['id']:undefined;_0x4862cc['actions'][_0x4822fd]=new Action(_0x6f7108,_0x2620b2,_0x4822fd,_0x33fc8a,_0x278656);var _0x262af6=_0x4862cc[_0x6a46('0x6d')][_0x4822fd];_0x262af6[_0x6a46('0xab')]=_0xa08bbb;_0x262af6[_0x6a46('0xc1')]=_0x28fc41;_0x262af6[_0x6a46('0xf4')]=_0x33fc8a;if(_[_0x6a46('0xf5')](_0x5ac2f1)){_0x4862cc[_0x6a46('0xf6')](_0x262af6,_0x2620b2,_0x6f7108,_0x33fc8a)[_0x6a46('0x81')](function(_0x40054d){logger[_0x6a46('0x56')]('[Preview][execCall][success]',_0x6a46('0xf7')+_0x262af6[_0x6a46('0x6f')]+'\x20IdHopper:\x20'+_0x262af6[_0x6a46('0xf8')],JSON['stringify'](_0x40054d));ami[_0x6a46('0xb2')](_0x6a46('0xf9'),ut['buildObj'](_0x262af6,_0x6a46('0xfa')));_0x136fd2(ut[_0x6a46('0x49')](_0x6a46('0xfb')));})[_0x6a46('0x74')](function(_0x1c9b68){ut['logger'](_0x6a46('0xfc'),_0x1c9b68);_0x397c20(ut['message'](_0x6a46('0xfd'),_0xa08bbb,_0x28fc41));});}else{_0x2620b2[_0x6a46('0xfe')]+=0x1;ut['logBlacklist'](_0x262af6);rpcDb[_0x6a46('0xff')](_0x262af6,_0x6a46('0x100'));delete _0x4862cc[_0x6a46('0x6d')][_0x4822fd];_0x397c20(ut[_0x6a46('0x49')](_0x6a46('0x101'),_0xa08bbb,_0x28fc41));}});};Preview['prototype'][_0x6a46('0x99')]=function(_0x78bad4){return!_[_0x6a46('0x6a')](_0x78bad4)&&!_[_0x6a46('0x6a')](_0x78bad4[_0x6a46('0x22')])&&!_[_0x6a46('0x6a')](_0x78bad4['active'])&&_0x78bad4[_0x6a46('0x102')]&&!_[_0x6a46('0x6a')](this[_0x6a46('0x13')][util[_0x6a46('0x8b')](_0x6a46('0x103'),_0x78bad4['name'])])&&!_['isNil'](this[_0x6a46('0x13')][util[_0x6a46('0x8b')]('SIP/%s',_0x78bad4[_0x6a46('0x22')])][_0x6a46('0x104')])&&(this['trunks'][util[_0x6a46('0x8b')](_0x6a46('0x103'),_0x78bad4[_0x6a46('0x22')])][_0x6a46('0x104')]===_0x6a46('0x105')||this[_0x6a46('0x13')][util['format']('SIP/%s',_0x78bad4[_0x6a46('0x22')])][_0x6a46('0x104')]===_0x6a46('0x106'));};Preview[_0x6a46('0xd')][_0x6a46('0x86')]=function(_0x33594b,_0x152ec1){var _0x5f0892=this;return new BPromise(function(_0x3317c4,_0x78f284){_0x5f0892[_0x6a46('0x107')](_0x33594b,_0x152ec1)[_0x6a46('0x81')](function(_0x4d18df){_0x3317c4(_[_0x6a46('0x108')](_0x4d18df,[_0x6a46('0x49')]));})[_0x6a46('0x74')](function(_0x436f75){if(_0x436f75[_0x6a46('0x109')]){rpcDb[_0x6a46('0x10a')](_0x33594b);}if(_0x436f75[_0x6a46('0x102')]){rpcDb[_0x6a46('0x89')](_0x33594b);}_0x78f284(_[_0x6a46('0x108')](_0x436f75,[_0x6a46('0x49')]));});});};Preview[_0x6a46('0xd')][_0x6a46('0x107')]=function(_0x4730be,_0xc739ca){var _0x1e5907=this;return new BPromise(function(_0x28ff8b,_0x433cb3){var _0x4b40e5,_0x3cc0ad;rpcDb[_0x6a46('0x10b')](_0x4730be)[_0x6a46('0x81')](function(_0x4c7263){if(!_[_0x6a46('0x6a')](_0x4c7263[0x0])){_0x3cc0ad=_0x4c7263[0x0][_0x6a46('0x10c')]?![]:!![];_0x4b40e5=_0x4c7263[0x0]['recallme']?!![]:![];_0x4b40e5=_0xc739ca?!![]:_0x4b40e5;}var _0x2b1543=_0x1e5907['validateContact'](_0x4c7263);if(_0x2b1543[_0x6a46('0x10d')]){rpcDb['checkIsBlackList'](_[_0x6a46('0x108')](_0x4c7263[0x0],[_0x6a46('0x71'),_0x6a46('0x10e')]))[_0x6a46('0x81')](function(_0x372e12){_0x1e5907[_0x6a46('0x10f')](_0x372e12,_0x4c7263[0x0],_0xc739ca,_0x3cc0ad,_0x4b40e5)[_0x6a46('0x81')](function(_0x577f78){_0x28ff8b(_0x577f78);})[_0x6a46('0x74')](function(_0x5b292b){_0x433cb3(_0x5b292b);});})['catch'](function(_0x142997){ut[_0x6a46('0x60')](_0x6a46('0x110'),_0x142997);_0x433cb3(ut[_0x6a46('0x49')](_0x6a46('0x111'),_0x3cc0ad,_0x4b40e5));});}else{_0x433cb3(ut[_0x6a46('0x49')](_0x2b1543[_0x6a46('0x49')],_0x3cc0ad,_0x4b40e5));}})[_0x6a46('0x74')](function(_0x3c3781){ut[_0x6a46('0x60')]('[Preview][getContactPreview]',_0x3c3781);_0x433cb3(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0x6a46('0xd')]['validateContact']=function(_0x579d34){if(_[_0x6a46('0x6a')](_0x579d34)||_[_0x6a46('0xf5')](_0x579d34)||!_[_0x6a46('0x6a')](_0x579d34[0x0]['Agent'])&&_[_0x6a46('0x6a')](_0x579d34[0x0][_0x6a46('0x85')][_0x6a46('0x22')])){ut[_0x6a46('0x60')](_0x6a46('0x112'),_0x579d34);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x275ab4=this[_0x6a46('0x11')][_0x579d34[0x0][_0x6a46('0x6c')][_0x6a46('0x22')]];_0x275ab4['message']=_0x6a46('0x9c');if(_[_0x6a46('0x6a')](_0x275ab4)){ut[_0x6a46('0x60')](_0x6a46('0x113'),_0x275ab4);return{'isValid':![],'message':_0x6a46('0x114')};}if(!this[_0x6a46('0x99')](_0x275ab4[_0x6a46('0x50')])){ut[_0x6a46('0x60')](_0x6a46('0x115'),_0x6a46('0x116')+_0x275ab4[_0x6a46('0x22')]+_0x6a46('0x117'));if(!this[_0x6a46('0x99')](_0x275ab4[_0x6a46('0x9a')])){ut[_0x6a46('0x60')](_0x6a46('0x115'),_0x275ab4['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x6a46('0x98')](_0x275ab4[_0x6a46('0x67')])){ut[_0x6a46('0x60')](_0x6a46('0x118'),_0x275ab4[_0x6a46('0x22')]+_0x6a46('0x119'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x275ab4[_0x6a46('0x22')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x6a46('0x11a')};};Preview[_0x6a46('0xd')][_0x6a46('0xf6')]=function(_0xc7280,_0x211b54,_0x43b90f,_0x54dc23){var _0x3be50e=this;return new BPromise(function(_0x454b81,_0x4cfa8c){var _0x41521f=_0xc7280[_0x6a46('0xbb')];var _0x36dcb3=_0x3be50e[_0x6a46('0x99')](_0x211b54[_0x6a46('0x50')])?util[_0x6a46('0x8b')](_0x6a46('0x11b'),_0x211b54[_0x6a46('0x50')][_0x6a46('0x22')],_[_0x6a46('0x6a')](_0x211b54[_0x6a46('0x31')])?'':_0x211b54[_0x6a46('0x31')][_0x6a46('0x11c')]()||'',_0x211b54[_0x6a46('0x11d')]>0x0?_0x43b90f[_0x6a46('0xf2')]['phone'][_0x6a46('0x11e')](_0x211b54[_0x6a46('0x11d')]):_0x43b90f['Contact']['phone']):util['format']('SIP/%s/%s%s',_['isNil'](_0x211b54[_0x6a46('0x9a')])?_0x211b54[_0x6a46('0x50')][_0x6a46('0x22')]:_0x211b54['TrunkBackup']['name'],_[_0x6a46('0x6a')](_0x211b54['dialPrefix'])?'':_0x211b54[_0x6a46('0x31')][_0x6a46('0x11c')]()||'',_0x211b54[_0x6a46('0x11d')]>0x0?_0x43b90f[_0x6a46('0xf2')][_0x6a46('0xf3')][_0x6a46('0x11e')](_0x211b54[_0x6a46('0x11d')]):_0x43b90f['Contact']['phone']);var _0x4b04fb=_0x3be50e[_0x6a46('0x99')](_0x211b54[_0x6a46('0x50')])?ut[_0x6a46('0x11f')](_0x211b54[_0x6a46('0x50')][_0x6a46('0x51')],_0x211b54[_0x6a46('0x120')],_0x211b54['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x6a46('0x121')](_0x211b54['dialOriginateCallerIdNumber'],_0x211b54[_0x6a46('0x122')]):_0x211b54[_0x6a46('0x2f')]):ut[_0x6a46('0x11f')](_[_0x6a46('0x6a')](_0x211b54['TrunkBackup'])?_0x211b54['Trunk']['callerid']:_0x211b54[_0x6a46('0x9a')][_0x6a46('0x51')],_0x211b54['dialOriginateCallerIdName'],_0x211b54[_0x6a46('0x122')]>0x0?ut['getCallerIdRandom'](_0x211b54['dialOriginateCallerIdNumber'],_0x211b54[_0x6a46('0x122')]):_0x211b54[_0x6a46('0x2f')]);if(_0x4b04fb){_0xc7280[_0x6a46('0x123')]=ut['extractCalleridName'](_0x4b04fb);_0xc7280[_0x6a46('0x124')]=ut['extractCalleridNumber'](_0x4b04fb);}var _0x474e4c=ut[_0x6a46('0x125')](_0x211b54,_0x43b90f,_0x36dcb3,_0x4b04fb,_0x41521f,_0xc7280);_[_0x6a46('0x126')](_0xc7280,ut[_0x6a46('0x127')](_0x474e4c));_0xc7280[_0x6a46('0x8a')]=moment()['format'](_0x6a46('0x8c'));ami[_0x6a46('0x73')](ut['variablesAction'](_0xc7280,_0x211b54,_0x474e4c,_0xc7280[_0x6a46('0xc1')],_0x54dc23))[_0x6a46('0x81')](function(_0x21e289){_0x211b54[_0x6a46('0x5a')]+=0x1;logger[_0x6a46('0x56')](_0x6a46('0x128'),_0x41521f,_0x6a46('0xb1'),_0x211b54[_0x6a46('0x22')],_0x6a46('0x6e'),_0x211b54['originated']);_0x454b81(_0x21e289);})['catch'](function(_0x3f22cf){ut[_0x6a46('0xe8')](_0xc7280,0xe,_0x6a46('0x129'));rpcDb[_0x6a46('0xe9')](_0xc7280,'[originateFailure][logOriginateFailure]');_0x4cfa8c(_0x3f22cf);});});};Preview[_0x6a46('0xd')][_0x6a46('0x1c')]=function(_0x1c3c04){if(this[_0x6a46('0x6d')][_0x1c3c04[_0x6a46('0xac')]]){this[_0x6a46('0x6d')][_0x1c3c04[_0x6a46('0xac')]][_0x6a46('0x12a')]=_0x1c3c04[_0x6a46('0x12a')];}};Preview['prototype']['syncOriginateResponse']=function(_0xdf4dce){var _0x58b56d=this;var _0x26ce31=this['actions'][_0xdf4dce[_0x6a46('0x12b')]];if(_0x26ce31){if(_0x26ce31[_0x6a46('0xf4')]&&this[_0x6a46('0x80')][_0x26ce31[_0x6a46('0xf4')]]){ut[_0x6a46('0x12c')](_0x26ce31,this['agents'][_0x26ce31[_0x6a46('0xf4')]][_0x6a46('0x22')],this[_0x6a46('0x80')][_0x26ce31[_0x6a46('0xf4')]]['id']);}var _0x956334=_[_0x6a46('0x12d')](_0x26ce31);_0x956334[_0x6a46('0xae')]=moment()[_0x6a46('0x8b')](_0x6a46('0x8c'));var _0x3b85de=_0x58b56d[_0x6a46('0x11')][_0x26ce31[_0x6a46('0x6f')]];if(ut[_0x6a46('0x12e')](_0xdf4dce['response'])){if(_0x26ce31[_0x6a46('0xab')]){rpcDb[_0x6a46('0x10a')](_0x26ce31['idContact']);}if(_0x26ce31[_0x6a46('0xc1')]){rpcDb[_0x6a46('0x89')](_0x26ce31[_0x6a46('0xf8')]);}ami[_0x6a46('0xb2')](_0x6a46('0x12f'),ut[_0x6a46('0xb4')](_0x26ce31,_0x6a46('0x130')));this[_0x6a46('0xe4')](_0x956334,_0x3b85de,_0xdf4dce);}else{_0x26ce31[_0x6a46('0x8a')]=moment()['format'](_0x6a46('0x8c'));ut['logAgent'](_0x956334,0x4,_0x6a46('0xb9'));rpcDb[_0x6a46('0xe9')](_0x956334,_0x6a46('0x131'));}}};Preview['prototype'][_0x6a46('0x16')]=function(_0x1f1574){var _0x2a4d13=this;var _0x14c0d7=this[_0x6a46('0x6d')][_0x1f1574[_0x6a46('0xac')]];var _0x58915c;if(_0x14c0d7){_0x58915c=this[_0x6a46('0x11')][_0x14c0d7[_0x6a46('0x6f')]];logger[_0x6a46('0x56')](_0x6a46('0x132'),_0x1f1574[_0x6a46('0xac')],_0x6a46('0xb1'),_0x58915c['name'],_0x6a46('0x70'),_0x58915c[_0x6a46('0x5b')]);}if(this[_0x6a46('0x6d')][_0x1f1574[_0x6a46('0xac')]]&&_0x1f1574[_0x6a46('0xac')]!==_0x1f1574['uniqueid']){if(_0x1f1574[_0x6a46('0x133')]==='16'&&this[_0x6a46('0x6d')][_0x1f1574[_0x6a46('0xac')]]['dialAnswer']){this[_0x6a46('0x9d')](_0x1f1574,_0x1f1574[_0x6a46('0xac')],_0x1f1574[_0x6a46('0x133')]);}else if(this[_0x6a46('0x6d')][_0x1f1574[_0x6a46('0xac')]][_0x6a46('0x76')]){logger['info'](_0x6a46('0x134'),_0x1f1574[_0x6a46('0xac')],_0x1f1574[_0x6a46('0x133')],_0x6a46('0xb1'),_0x58915c[_0x6a46('0x22')],_0x6a46('0x70'),_0x58915c[_0x6a46('0x5b')]);this['callProgressDetectingCustomer'](_0x1f1574,_0x1f1574[_0x6a46('0xac')],_0x1f1574[_0x6a46('0x133')]);}}else if(_0x14c0d7&&_[_0x6a46('0x6a')](_0x14c0d7[_0x6a46('0x135')])&&_0x58915c['dialQueueProject']&&_0x1f1574['linkedid']===_0x1f1574[_0x6a46('0xbb')]&&_[_0x6a46('0x6a')](_0x1f1574['reason'])&&_0x1f1574['cause']==='16'&&_0x1f1574[_0x6a46('0x136')]==='6'&&_[_0x6a46('0xe5')](_0x14c0d7['transfer'])){if(_0x14c0d7[_0x6a46('0xab')]){rpcDb[_0x6a46('0x10a')](_0x14c0d7[_0x6a46('0xf8')]);}if(_0x14c0d7[_0x6a46('0xc1')]){rpcDb['disableContact'](_0x14c0d7[_0x6a46('0xf8')]);}_0x1f1574[_0x6a46('0xe7')]='22';this[_0x6a46('0xe4')](_0x14c0d7,_0x58915c,_0x1f1574);}else if(_0x14c0d7&&_0x14c0d7[_0x6a46('0x137')]){if(_0x1f1574[_0x6a46('0x133')]==='16'&&this[_0x6a46('0x6d')][_0x1f1574[_0x6a46('0xac')]][_0x6a46('0x76')]){logger['info'](_0x6a46('0x138'),_0x1f1574[_0x6a46('0xac')],_0x1f1574['cause'],'\x20Queue',_0x58915c[_0x6a46('0x22')],_0x6a46('0x70'),_0x58915c[_0x6a46('0x5b')]);this['callProgressDetectingCustomer'](_0x1f1574,_0x1f1574[_0x6a46('0xac')],_0x1f1574['cause']);}else if(this['actions'][_0x1f1574[_0x6a46('0xac')]][_0x6a46('0x76')]){logger[_0x6a46('0x56')]('[syncHangup][talking][cause]',_0x1f1574[_0x6a46('0xac')],_0x1f1574['cause'],_0x6a46('0xb1'),_0x58915c[_0x6a46('0x22')],_0x6a46('0x70'),_0x58915c['pTalking']);this[_0x6a46('0x9d')](_0x1f1574,_0x1f1574[_0x6a46('0xac')],_0x1f1574[_0x6a46('0x133')]);}}};Preview[_0x6a46('0xd')]['syncDialEnd']=function(_0x5419f3){if(this[_0x6a46('0x6d')][_0x5419f3[_0x6a46('0xe3')]]&&_0x5419f3[_0x6a46('0xe3')]!==_0x5419f3['destuniqueid']){this['callProgressDetectingCustomer'](_0x5419f3,_0x5419f3[_0x6a46('0xe3')],_0x5419f3[_0x6a46('0xdd')]);}};Preview['prototype'][_0x6a46('0x19')]=function(_0x222aac){if(this[_0x6a46('0x6d')][_0x222aac['linkedid']]&&_0x222aac[_0x6a46('0xac')]!==_0x222aac[_0x6a46('0xbb')]&&!this['actions'][_0x222aac[_0x6a46('0xac')]]['dialAnswer']){if(_0x222aac[_0x6a46('0x133')]==='1'){this[_0x6a46('0x9d')](_0x222aac,_0x222aac[_0x6a46('0xac')],_0x222aac[_0x6a46('0x133')]);}}};Preview[_0x6a46('0xd')][_0x6a46('0x139')]=function(_0x223999,_0xb3a887,_0x56bab4){if(this[_0x6a46('0x6d')][_0x223999]){if(_[_0x6a46('0x6a')](this[_0x6a46('0x6d')][_0x223999]['variables'])){this[_0x6a46('0x6d')][_0x223999][_0x6a46('0x13a')]={};}this[_0x6a46('0x6d')][_0x223999][_0x6a46('0x13a')][_0xb3a887]=_0x56bab4;}};Preview[_0x6a46('0xd')][_0x6a46('0x1e')]=function(_0x53ae9b){try{if(!_[_0x6a46('0x6a')](_0x53ae9b)){if(ut[_0x6a46('0x13b')](_[_0x6a46('0x13c')](_0x53ae9b['variable'])[0x0])){this[_0x6a46('0x139')](_0x53ae9b['uniqueid'],_[_0x6a46('0x13c')](_0x53ae9b[_0x6a46('0x13d')])[0x0],_0x53ae9b[_0x6a46('0x13e')]);}}}catch(_0x24eac0){logger[_0x6a46('0x13f')](_0x6a46('0x140'),util[_0x6a46('0x141')](_0x24eac0,{'showHidden':![],'depth':null}));}};Preview[_0x6a46('0xd')][_0x6a46('0x142')]=function(_0x18dd5a){if(_0x18dd5a){if(this[_0x6a46('0x6d')][_0x18dd5a[_0x6a46('0x143')]]){this[_0x6a46('0x6d')][_0x18dd5a[_0x6a46('0x143')]][_0x6a46('0x137')]=!![];}}};Preview[_0x6a46('0xd')][_0x6a46('0x20')]=function(_0x66fbc2){if(_0x66fbc2){if(this['actions'][_0x66fbc2[_0x6a46('0x144')]]){this[_0x6a46('0x6d')][_0x66fbc2[_0x6a46('0x144')]][_0x6a46('0x137')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x24c6=['custom:agentcomplete','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','countabandonedretry','Abandoned','countabandonedetry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','[Blacklist][error]','active','SIP/%s','execRun','unlock','recallme','isValid','checkIsBlackList','Contact.phone','checkInBlack','Call\x20unsuccessful','validateContact','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','phone','substring','trim','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','[originateFailure][logOriginateFailure]','actionid','clone','responsetime','isFailure','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','[syncHangup][talking][cause]','callProgressDetectingCustomer','statedesc','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','filterKey','variable','keys','error','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','actionPreview','./rpcDb','./util/util','defaults','redis','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','bind','hanguprequest','syncHangupRequest','dialend','newexten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','sendMessageOneNotActive','available','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','syncCampaigns','prototype','hasOwnProperty','preview','booked','type','clearZombieChannels','setMessage','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createCustomerHistory','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw'];(function(_0x1c2ccf,_0x1a408c){var _0x1be606=function(_0x1b075e){while(--_0x1b075e){_0x1c2ccf['push'](_0x1c2ccf['shift']());}};_0x1be606(++_0x1a408c);}(_0x24c6,0x90));var _0x624c=function(_0x2bc5cc,_0x1bbb3e){_0x2bc5cc=_0x2bc5cc-0x0;var _0x1da473=_0x24c6[_0x2bc5cc];return _0x1da473;};'use strict';var util=require(_0x624c('0x0'));var _=require(_0x624c('0x1'));var BPromise=require(_0x624c('0x2'));var uuid=require(_0x624c('0x3'));var moment=require(_0x624c('0x4'));var md5=require(_0x624c('0x5'));var Redis=require('ioredis');var config=require(_0x624c('0x6'));var logger=require(_0x624c('0x7'))('preview');var loggerAction=require(_0x624c('0x7'))(_0x624c('0x8'));var ami=require('../ami');var rpcDb=require(_0x624c('0x9'));var Action=require('./action');var ut=require(_0x624c('0xa'));config['redis']=_[_0x624c('0xb')](config[_0x624c('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x624c('0xd'))(new Redis(config[_0x624c('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x624c('0xe')]=function(_0x3dfd82){this['tail']=this[_0x624c('0xf')]?this[_0x624c('0xf')][_0x624c('0x10')](_0x3dfd82):_0x3dfd82();};function Preview(_0x1c6b05){this[_0x624c('0x11')]=new Sequence();this[_0x624c('0x12')]=_0x1c6b05[_0x624c('0x13')];this['trunks']=_0x1c6b05[_0x624c('0x14')];this[_0x624c('0x15')]={};this['agents']=_0x1c6b05[_0x624c('0x16')];this[_0x624c('0x17')]=0x0;ami['on']('originateresponse',this[_0x624c('0x18')]['bind'](this));ami['on'](_0x624c('0x19'),this['syncHangup'][_0x624c('0x1a')](this));ami['on'](_0x624c('0x1b'),this[_0x624c('0x1c')][_0x624c('0x1a')](this));ami['on'](_0x624c('0x1d'),this['syncDialEnd']['bind'](this));ami['on'](_0x624c('0x1e'),this['syncNewExten'][_0x624c('0x1a')](this));ami['on']('varset',this[_0x624c('0x1f')]['bind'](this));ami['on']('attendedtransfer',this[_0x624c('0x20')][_0x624c('0x1a')](this));ami['on'](_0x624c('0x21'),this[_0x624c('0x22')]['bind'](this));this[_0x624c('0x23')](this[_0x624c('0x12')]);}function emit(_0x54278e,_0xeca39d,_0xa27e9d){io['to'](_0x54278e)[_0x624c('0x24')](_0xeca39d,_0xa27e9d);}function emitCampaignPreview(_0x154d8e){if(_0x154d8e['type']===_0x624c('0x25')){var _0x146e32={'id':_0x154d8e['id'],'name':_0x154d8e[_0x624c('0x26')],'strategy':_0x154d8e[_0x624c('0x27')],'answered':_0x154d8e[_0x624c('0x28')],'available':_0x154d8e['available'],'loggedIn':_0x154d8e[_0x624c('0x29')],'pTalking':_0x154d8e[_0x624c('0x2a')],'sumBillable':_0x154d8e[_0x624c('0x2b')],'sumDuration':_0x154d8e[_0x624c('0x2c')],'sumHoldTime':_0x154d8e['sumHoldTime']||0x0,'talking':_0x154d8e[_0x624c('0x2d')],'total':_0x154d8e['total'],'type':_0x154d8e['type'],'unmanaged':_0x154d8e[_0x624c('0x2e')],'abandoned':_0x154d8e[_0x624c('0x2f')],'waiting':_0x154d8e['waiting'],'loggedInDb':_0x154d8e['loggedInDb'],'dialActive':_0x154d8e[_0x624c('0x30')],'dialMethod':_0x154d8e[_0x624c('0x31')],'dialOriginateCallerIdName':_0x154d8e[_0x624c('0x32')],'dialOriginateCallerIdNumber':_0x154d8e[_0x624c('0x33')],'dialOriginateTimeout':_0x154d8e[_0x624c('0x34')],'dialPrefix':_0x154d8e[_0x624c('0x35')],'outboundAnswerAgiCallsDay':_0x154d8e['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x154d8e[_0x624c('0x36')],'outboundBlacklistCallsDay':_0x154d8e[_0x624c('0x37')],'outboundBusyCallsDay':_0x154d8e[_0x624c('0x38')],'outboundCongestionCallsDay':_0x154d8e[_0x624c('0x39')],'outboundDropCallsDayACS':_0x154d8e[_0x624c('0x3a')],'outboundDropCallsDayCallersExit':_0x154d8e['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x154d8e[_0x624c('0x3b')],'outboundNoAnswerCallsDay':_0x154d8e[_0x624c('0x3c')],'outboundNoSuchCallsDay':_0x154d8e[_0x624c('0x3d')],'outboundOriginateFailureCallsDay':_0x154d8e[_0x624c('0x3e')],'outboundReCallsDay':_0x154d8e['outboundReCallsDay'],'outboundRejectCallsDay':_0x154d8e['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x154d8e[_0x624c('0x3f')],'outboundAbandonedCallsDay':_0x154d8e['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x154d8e[_0x624c('0x40')],'predictiveIntervalAvgHoldtime':_0x154d8e['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x154d8e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x154d8e[_0x624c('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x154d8e[_0x624c('0x42')],'predictiveIntervalErlangCalls':_0x154d8e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x154d8e[_0x624c('0x43')],'predictiveIntervalHitRate':_0x154d8e[_0x624c('0x44')],'predictiveIntervalMultiplicativeFactor':_0x154d8e[_0x624c('0x45')],'predictiveIntervalPauses':_0x154d8e[_0x624c('0x46')],'predictiveIntervalAvailable':_0x154d8e[_0x624c('0x47')],'predictiveIntervalTotalCalls':_0x154d8e[_0x624c('0x48')],'message':_0x154d8e['message'],'originated':_0x154d8e[_0x624c('0x49')],'erlangCalls':_0x154d8e[_0x624c('0x4a')],'erlangCallToSecond':_0x154d8e[_0x624c('0x4b')],'erlangAbandonmentRate':_0x154d8e[_0x624c('0x4c')],'erlangBusyFactor':_0x154d8e[_0x624c('0x4d')],'startPredictive':_0x154d8e[_0x624c('0x4e')],'startProgressive':_0x154d8e[_0x624c('0x4f')]};if(_0x154d8e[_0x624c('0x50')]){_0x146e32[_0x624c('0x50')]={'id':_0x154d8e[_0x624c('0x50')]['id'],'name':_0x154d8e[_0x624c('0x50')][_0x624c('0x26')],'active':_0x154d8e['Trunk']['active'],'callerid':_0x154d8e['Trunk'][_0x624c('0x51')]};}if(_0x154d8e['Interval']){_0x146e32['Interval']={'id':_0x154d8e[_0x624c('0x52')]['id'],'name':_0x154d8e[_0x624c('0x52')][_0x624c('0x26')]};}var _0x5073f3=md5(JSON[_0x624c('0x53')](_0x146e32));if(_0x154d8e[_0x624c('0x5')]!==_0x5073f3){_0x154d8e[_0x624c('0x5')]=_0x5073f3;emit(util[_0x624c('0x54')](_0x624c('0x55'),_0x146e32[_0x624c('0x26')]),_0x624c('0x56'),_0x146e32);}}}function emitVoiceQueueChannelRemove(_0x1a4d54){logger[_0x624c('0x57')](_0x624c('0x58'),JSON[_0x624c('0x53')](_0x1a4d54));emit(util[_0x624c('0x54')](_0x624c('0x55'),_0x1a4d54[_0x624c('0x26')]),'voice_queue_channel:remove',_0x1a4d54);}function notSendMessagesQueue(_0x380ffe){if(_0x380ffe[_0x624c('0x59')]){if(_0x380ffe['originated']===0x0&&_0x380ffe['pTalking']===0x0){_0x380ffe[_0x624c('0x59')]=![];_0x380ffe[_0x624c('0x5a')]=0x0;_0x380ffe['paused']=0x0;_0x380ffe[_0x624c('0x5b')]=_0x624c('0x5c');ut[_0x624c('0x5d')](_0x624c('0x5e'),_0x380ffe[_0x624c('0x26')]+'\x20is\x20not\x20active');}else{_0x380ffe[_0x624c('0x5b')]=_0x624c('0x5f');ut[_0x624c('0x5d')](_0x624c('0x5e'),_0x380ffe[_0x624c('0x26')]+'\x20is\x20disactive');}emitCampaignPreview(_0x380ffe);}}Preview['prototype'][_0x624c('0x23')]=function(){var _0x57c857=this;setInterval(function(){_0x57c857[_0x624c('0x60')]();},0x7cf);};Preview[_0x624c('0x61')][_0x624c('0x60')]=function(){var _0x18696a=this[_0x624c('0x12')];this[_0x624c('0x17')]+=0x1;for(var _0x24b7f8 in _0x18696a){if(_0x18696a[_0x624c('0x62')](_0x24b7f8)&&(_0x18696a[_0x24b7f8][_0x624c('0x31')]===_0x624c('0x63')||_0x18696a[_0x24b7f8][_0x624c('0x31')]===_0x624c('0x64'))&&_0x18696a[_0x24b7f8][_0x624c('0x65')]===_0x624c('0x25')){if(this['clockClearZombieChannels']>0x7){this[_0x624c('0x17')]=0x0;this[_0x624c('0x66')]();}}if(_0x18696a[_0x624c('0x62')](_0x24b7f8)&&_0x18696a[_0x24b7f8][_0x624c('0x31')]===_0x624c('0x63')&&_0x18696a[_0x24b7f8]['type']==='outbound'){if(_0x18696a[_0x24b7f8][_0x624c('0x30')]){this[_0x624c('0x67')](_0x18696a[_0x24b7f8]);this['recallMe'](_0x18696a[_0x24b7f8]);}else{notSendMessagesQueue(_0x18696a[_0x24b7f8]);}}}};Preview[_0x624c('0x61')][_0x624c('0x68')]=function(_0x4d99cc){var _0x242d38=this;this[_0x624c('0x11')][_0x624c('0xe')](function(){if(!_[_0x624c('0x69')](_0x242d38[_0x624c('0x15')][_0x4d99cc])){loggerAction['info'](_0x624c('0x6a'),_0x4d99cc,_0x624c('0x6b'),_0x242d38[_0x624c('0x15')][_0x4d99cc][_0x624c('0x6c')],_0x624c('0x6d'),JSON[_0x624c('0x53')](_0x242d38[_0x624c('0x12')][_0x242d38[_0x624c('0x15')][_0x4d99cc]['queue']]['originated']),_0x624c('0x6e'),JSON['stringify'](_0x242d38['campaignsPreview'][_0x242d38[_0x624c('0x15')][_0x4d99cc][_0x624c('0x6c')]][_0x624c('0x2a')]),JSON[_0x624c('0x53')](_0x242d38[_0x624c('0x15')][_0x4d99cc][_0x624c('0x6f')]),JSON['stringify'](_[_0x624c('0x70')](_0x242d38['actions'][_0x4d99cc],[_0x624c('0x71'),'UserId',_0x624c('0x72'),_0x624c('0x73')])));return ami[_0x624c('0x74')]({'action':_0x624c('0x75'),'channel':_0x242d38[_0x624c('0x15')][_0x4d99cc][_0x624c('0x76')]})['catch'](function(_0x59aa0d){if(_0x59aa0d[_0x624c('0x5b')]===_0x624c('0x77')){setTimeout(function(){if(_0x242d38[_0x624c('0x15')][_0x4d99cc]){ut[_0x624c('0x78')](_0x242d38['campaignsPreview'][_0x242d38[_0x624c('0x15')][_0x4d99cc][_0x624c('0x6c')]],_0x624c('0x79'));if(_0x242d38[_0x624c('0x15')][_0x4d99cc][_0x624c('0x6f')]===!![]){ut['decrementTalkink'](_0x242d38[_0x624c('0x12')][_0x242d38[_0x624c('0x15')][_0x4d99cc][_0x624c('0x6c')]],_0x624c('0x79'));ut['loggerError'](_0x624c('0x7a')+_0x4d99cc,_0x242d38['actions'][_0x4d99cc][_0x624c('0x6c')]);}ut[_0x624c('0x7b')](_0x624c('0x7c')+_0x4d99cc,_0x242d38[_0x624c('0x15')][_0x4d99cc][_0x624c('0x6c')]);delete _0x242d38[_0x624c('0x15')][_0x4d99cc];}},0x2328);}});}});};Preview[_0x624c('0x61')][_0x624c('0x66')]=function(){var _0x1da596=this;loggerAction[_0x624c('0x57')]('[action]',_[_0x624c('0x7d')](this[_0x624c('0x15')]));for(var _0x37c4c6 in this[_0x624c('0x15')]){if(_0x1da596[_0x624c('0x15')][_0x624c('0x62')](_0x37c4c6)){_0x1da596[_0x624c('0x68')](_0x37c4c6);}}};Preview[_0x624c('0x61')][_0x624c('0x7e')]=function(_0x2b5ded){var _0x4276ce=this;rpcDb[_0x624c('0x7f')](_0x2b5ded['id'],ut[_0x624c('0x80')](this[_0x624c('0x16')]))[_0x624c('0x81')](function(_0x5f0cbb){if(!_[_0x624c('0x69')](_0x5f0cbb)){for(var _0xcc0c53=0x0;_0xcc0c53<_0x5f0cbb[_0x624c('0x82')];_0xcc0c53+=0x1){if(ut[_0x624c('0x83')](_0x5f0cbb[_0xcc0c53][_0x624c('0x84')])<_0x2b5ded[_0x624c('0x85')]*0x3c){if(_0x5f0cbb[_0xcc0c53]['Agent']&&!_0x5f0cbb[_0xcc0c53]['Agent'][_0x624c('0x86')]){_0x4276ce[_0x624c('0x87')](_0x5f0cbb[_0xcc0c53]['id'])[_0x624c('0x81')](ut[_0x624c('0x88')](_0x624c('0x89')))[_0x624c('0x8a')](ut[_0x624c('0x88')](_0x624c('0x89')));}else{rpcDb[_0x624c('0x8b')](_0x5f0cbb[_0xcc0c53]['id']);}}else{var _0x5c8983=new Action(_0x5f0cbb[_0xcc0c53],_0x2b5ded);_0x5c8983[_0x624c('0x8c')]=moment()['format'](_0x624c('0x8d'));_0x2b5ded[_0x624c('0x8e')]+=0x1;ut[_0x624c('0x8f')](_0x5c8983,0x17,_0x624c('0x90'));if(_0x2b5ded[_0x624c('0x91')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x5f0cbb[_0xcc0c53]));rpcDb[_0x624c('0x92')](_0x5c8983,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x5c8983,0x16,_0x624c('0x93'));rpcDb[_0x624c('0x92')](_0x5c8983,'[HistoryRecallClose]');rpcDb[_0x624c('0x94')](_0x5c8983,_0x624c('0x95'));}}}}})['catch'](ut['logger2'](_0x624c('0x96')));};Preview['prototype'][_0x624c('0x67')]=function(_0x404bcc){_0x404bcc[_0x624c('0x59')]=!![];if(ut[_0x624c('0x97')](_0x404bcc[_0x624c('0x29')])){_0x404bcc[_0x624c('0x5b')]=_0x624c('0x98');}else if(!ut[_0x624c('0x99')](_0x404bcc[_0x624c('0x30')])){_0x404bcc[_0x624c('0x5b')]='NOT_ACTIVE';}else if(!this[_0x624c('0x9a')](_0x404bcc[_0x624c('0x50')])){if(!this[_0x624c('0x9a')](_0x404bcc[_0x624c('0x9b')])){_0x404bcc['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x404bcc[_0x624c('0x5b')]='ACTIVE';}}else{_0x404bcc[_0x624c('0x5b')]='ACTIVE';}emitCampaignPreview(_0x404bcc);};Preview[_0x624c('0x61')]['callProgressDetectingCustomer']=function(_0x8443c6,_0x12e9ad,_0x13ad1d){var _0x10a367=this;var _0x26e869=this[_0x624c('0x15')][_0x12e9ad];var _0x2c42c4=this[_0x624c('0x12')][_0x26e869[_0x624c('0x6c')]];var _0x571616;if(_0x2c42c4){switch(_0x13ad1d){case'1':_0x2c42c4['outboundNoSuchCallsDay']+=0x1;_0x26e869[_0x624c('0x9c')]+=0x1;_0x26e869[_0x624c('0x9d')]=ut[_0x624c('0x9e')](_0x26e869);ut[_0x624c('0x8f')](_0x26e869,0x0,_0x624c('0x9f'));ami[_0x624c('0x24')](_0x624c('0xa0'),ut[_0x624c('0xa1')](_0x26e869,'nosuchnumber'));rpcDb[_0x624c('0x92')](_0x26e869,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x624c('0x9e')](_0x26e869)>=_0x2c42c4['dialGlobalMaxRetry']){_0x571616=ut[_0x624c('0xa2')](_0x26e869,0xf,_0x624c('0xa3'));rpcDb[_0x624c('0x94')](_0x571616,_0x624c('0xa4'));}else{if(_0x26e869['countnosuchnumberretry']>=_0x2c42c4['dialNoSuchNumberMaxRetry']){rpcDb[_0x624c('0x94')](_0x26e869,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0x624c('0xa5')](_0x26e869,_0x624c('0x9c'),_0x2c42c4[_0x624c('0xa6')]),_0x26e869[_0x624c('0xa7')],_0x26e869[_0x624c('0xa8')]);}}delete this[_0x624c('0x15')][_0x8443c6[_0x624c('0xa9')]];break;case'ANSWER':var _0xc4273=moment()[_0x624c('0x54')](_0x624c('0x8d'));_0x26e869['responsetime']=_0xc4273;_0x26e869['answertime']=_0xc4273;_0x26e869['dialAnswer']=!![];_0x2c42c4['pTalking']+=0x1;logger[_0x624c('0x57')](_0x624c('0xaa'),_0x26e869[_0x624c('0xab')],_0x624c('0xac'),_0x2c42c4[_0x624c('0x26')],_0x624c('0x6e'),_0x2c42c4[_0x624c('0x2a')]);ami[_0x624c('0x24')](_0x624c('0xad'),ut['buildObj'](_0x26e869,'connect'));if(_0x2c42c4[_0x624c('0xae')]){ami['emit'](_0x624c('0xaf'),ut[_0x624c('0xb0')](_0x26e869));}break;case'16':ami[_0x624c('0x24')](_0x624c('0xb1'),ut[_0x624c('0xa1')](_0x26e869,_0x624c('0xb2')));emitVoiceQueueChannelRemove(ut[_0x624c('0xa1')](_0x26e869,_0x624c('0xb2')));_0x2c42c4['outboundAnswerCallsDay']+=0x1;_0x2c42c4['total']+=0x1;_0x2c42c4['answered']+=0x1;ut[_0x624c('0xb3')](_0x2c42c4,_0x624c('0xb4'));_0x26e869[_0x624c('0x9d')]=ut['totalGlobal'](_0x26e869);ut[_0x624c('0x8f')](_0x26e869,0x4,_0x624c('0xb5'));rpcDb['createCustomerHistory'](_0x26e869,_0x624c('0xb6'));rpcDb[_0x624c('0x94')](_0x26e869,_0x624c('0xb7'));rpcDb[_0x624c('0xb8')](_0x26e869);_0x2c42c4[_0x624c('0x2c')]+=_0x26e869[_0x624c('0xb9')];_0x2c42c4[_0x624c('0x2b')]+=_0x26e869['talktime'];logger[_0x624c('0x57')](_0x624c('0xba'),_0x26e869['uniqueid'],_0x624c('0xac'),_0x2c42c4[_0x624c('0x26')],'pTalking:\x20',_0x2c42c4[_0x624c('0x2a')]);delete this[_0x624c('0x15')][_0x8443c6[_0x624c('0xa9')]];break;case _0x624c('0xbb'):_0x2c42c4[_0x624c('0x38')]+=0x1;_0x26e869[_0x624c('0xbc')]+=0x1;_0x26e869[_0x624c('0x9d')]=ut[_0x624c('0x9e')](_0x26e869);ut[_0x624c('0x8f')](_0x26e869,0x5,_0x624c('0xbd'));ami[_0x624c('0x24')](_0x624c('0xbe'),ut['buildObj'](_0x26e869,_0x624c('0xbf')));rpcDb['createCustomerHistory'](_0x26e869,_0x624c('0xc0'));if(ut[_0x624c('0x9e')](_0x26e869)>=_0x2c42c4[_0x624c('0xc1')]){_0x571616=ut[_0x624c('0xa2')](_0x26e869,0xf,_0x624c('0xa3'));rpcDb['createCustomerFinal'](_0x571616,_0x624c('0xc2'));}else{if(_0x26e869[_0x624c('0xbc')]>=_0x2c42c4[_0x624c('0xc3')]){rpcDb[_0x624c('0x94')](_0x26e869,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x26e869,'countbusyretry',_0x2c42c4[_0x624c('0xc4')]),_0x26e869[_0x624c('0xa7')],_0x26e869[_0x624c('0xa8')]);}}break;case _0x624c('0xc5'):_0x2c42c4[_0x624c('0x3c')]+=0x1;_0x26e869[_0x624c('0xc6')]+=0x1;_0x26e869['countglobal']=ut[_0x624c('0x9e')](_0x26e869);ut[_0x624c('0x8f')](_0x26e869,0x3,_0x624c('0xc7'));ami[_0x624c('0x24')]('custom:agentnoanswer',ut[_0x624c('0xa1')](_0x26e869,_0x624c('0xc8')));rpcDb[_0x624c('0x92')](_0x26e869,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x26e869)>=_0x2c42c4['dialGlobalMaxRetry']){_0x571616=ut[_0x624c('0xa2')](_0x26e869,0xf,'Global');rpcDb[_0x624c('0x94')](_0x571616,_0x624c('0xc9'));}else{if(_0x26e869[_0x624c('0xc6')]>=_0x2c42c4[_0x624c('0xca')]){rpcDb[_0x624c('0x94')](_0x26e869,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x624c('0xcb')](ut[_0x624c('0xa5')](_0x26e869,'countnoanswerretry',_0x2c42c4[_0x624c('0xcc')]),_0x26e869[_0x624c('0xa7')],_0x26e869[_0x624c('0xa8')]);}}break;case _0x624c('0xcd'):_0x2c42c4[_0x624c('0x39')]+=0x1;_0x26e869[_0x624c('0xce')]+=0x1;_0x26e869[_0x624c('0x9d')]=ut[_0x624c('0x9e')](_0x26e869);ut[_0x624c('0x8f')](_0x26e869,0x8,_0x624c('0xcf'));rpcDb[_0x624c('0x92')](_0x26e869,_0x624c('0xd0'));if(ut['totalGlobal'](_0x26e869)>=_0x2c42c4[_0x624c('0xc1')]){_0x571616=ut[_0x624c('0xa2')](_0x26e869,0xf,_0x624c('0xa3'));rpcDb[_0x624c('0x94')](_0x571616,_0x624c('0xd1'));}else{if(_0x26e869['countcongestionretry']>=_0x2c42c4[_0x624c('0xd2')]){rpcDb[_0x624c('0x94')](_0x26e869,_0x624c('0xd0'));}else{rpcDb['rescheduleContact'](ut[_0x624c('0xa5')](_0x26e869,_0x624c('0xce'),_0x2c42c4['dialBusyRetryFrequency']),_0x26e869['unlockAgent'],_0x26e869[_0x624c('0xa8')]);}}break;case _0x624c('0xd3'):_0x2c42c4[_0x624c('0xd4')]+=0x1;_0x26e869[_0x624c('0xd5')]+=0x1;_0x26e869[_0x624c('0x9d')]=ut[_0x624c('0x9e')](_0x26e869);ut[_0x624c('0x8f')](_0x26e869,0x14,_0x624c('0xd6'));rpcDb[_0x624c('0x92')](_0x26e869,'[syncHangupRequest][logAgentReject]');if(ut[_0x624c('0x9e')](_0x26e869)>=_0x2c42c4[_0x624c('0xc1')]){_0x571616=ut[_0x624c('0xa2')](_0x26e869,0x14,'AgentReject');rpcDb[_0x624c('0x94')](_0x571616,_0x624c('0xd7'));}else{if(_0x26e869['countagentrejectretry']>=_0x2c42c4[_0x624c('0xd8')]){rpcDb[_0x624c('0x94')](_0x26e869,_0x624c('0xd7'));}else{rpcDb[_0x624c('0xcb')](ut[_0x624c('0xa5')](_0x26e869,'countagentrejectretry',_0x2c42c4[_0x624c('0xd9')]),_0x26e869[_0x624c('0xa7')],_0x26e869[_0x624c('0xa8')]);}}break;case'ABANDONED':_0x2c42c4[_0x624c('0xda')]+=0x1;_0x26e869[_0x624c('0xdb')]+=0x1;_0x26e869[_0x624c('0x9d')]=ut[_0x624c('0x9e')](_0x26e869);ut[_0x624c('0x8f')](_0x26e869,0xb,_0x624c('0xdc'));rpcDb[_0x624c('0x92')](_0x26e869,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x624c('0x9e')](_0x26e869)>=_0x2c42c4[_0x624c('0xc1')]){_0x571616=ut['cloneAction'](_0x26e869,0xf,_0x624c('0xa3'));rpcDb[_0x624c('0x94')](_0x571616,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x26e869[_0x624c('0xdd')]>=_0x2c42c4['dialAbandonedMaxRety']){rpcDb[_0x624c('0x94')](_0x26e869,_0x624c('0xde'));}else{rpcDb[_0x624c('0xcb')](ut[_0x624c('0xa5')](_0x26e869,'countabandonedretry',_0x2c42c4[_0x624c('0xdf')]),_0x26e869[_0x624c('0xa7')],_0x26e869[_0x624c('0xa8')]);}}break;default:if(_0x26e869[_0x624c('0x6f')]){ut[_0x624c('0xb3')](_0x2c42c4,'[default]');ut[_0x624c('0x7b')](_0x624c('0xe0')+_0x2c42c4['name'],_0x8443c6);}_0x2c42c4[_0x624c('0x3f')]+=0x1;_0x26e869[_0x624c('0x9d')]=ut[_0x624c('0x9e')](_0x26e869);ut['logCustomer'](_0x26e869,0xc,_0x8443c6['cause-txt']||_0x8443c6[_0x624c('0xe1')]);rpcDb[_0x624c('0x92')](_0x26e869,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x624c('0x9e')](_0x26e869)>=_0x2c42c4[_0x624c('0xc1')]){_0x571616=ut[_0x624c('0xa2')](_0x26e869,0xf,_0x624c('0xa3'));rpcDb[_0x624c('0x94')](_0x571616,_0x624c('0xe2'));}else{rpcDb[_0x624c('0x94')](_0x26e869,_0x624c('0xe2'));}delete this[_0x624c('0x15')][_0x8443c6[_0x624c('0xa9')]];}if(!(_0x26e869[_0x624c('0x6f')]&&_0x13ad1d==='16')){ut[_0x624c('0x78')](_0x2c42c4,_0x624c('0xe3'));logger[_0x624c('0x57')](_0x624c('0xe4'),_0x26e869[_0x624c('0xab')],_0x624c('0xac'),_0x2c42c4[_0x624c('0x26')],_0x624c('0x6d'),_0x2c42c4[_0x624c('0x49')]);}if(_0x13ad1d!==_0x624c('0xe5')){delete this[_0x624c('0x15')][_0x8443c6['linkedid']];delete this[_0x624c('0x15')][_0x8443c6[_0x624c('0xe6')]];}}};Preview[_0x624c('0x61')][_0x624c('0xe7')]=function(_0x10c05b,_0x3326dd,_0xc44d6d){if(_[_0x624c('0xe8')](_0x3326dd)&&_0x624c('0xe9')!==typeof _0x3326dd){return;}if(_[_0x624c('0xe8')](_0xc44d6d)&&_0x624c('0xe9')!==typeof _0xc44d6d){return;}switch(_0xc44d6d[_0x624c('0xea')]){case'0':ut['logAgent'](_0x10c05b,0x0,_0x624c('0x9f'));rpcDb['createAgentHistory'](_0x10c05b,_0x624c('0xeb'));break;case'3':ut[_0x624c('0xec')](_0x10c05b,0x3,_0x624c('0xc7'));rpcDb[_0x624c('0xed')](_0x10c05b,_0x624c('0xee'));break;case'5':ut[_0x624c('0xec')](_0x10c05b,0x5,_0x624c('0xbd'));rpcDb[_0x624c('0xed')](_0x10c05b,_0x624c('0xef'));break;case'8':ut['logAgent'](_0x10c05b,0x8,_0x624c('0xcf'));rpcDb['createAgentHistory'](_0x10c05b,_0x624c('0xf0'));break;case'22':ut[_0x624c('0xec')](_0x10c05b,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x10c05b,_0x624c('0xf1'));break;default:ut[_0x624c('0xec')](_0x10c05b,0xc,_0xc44d6d[_0x624c('0xea')]);rpcDb[_0x624c('0xed')](_0x10c05b,_0x624c('0xf0'));}ut[_0x624c('0x78')](_0x3326dd,_0x624c('0xf2'));logger[_0x624c('0x57')](_0x624c('0xf3'),_0x10c05b[_0x624c('0xab')],'\x20Queue',_0x3326dd[_0x624c('0x26')],_0x624c('0x6d'),_0x3326dd[_0x624c('0x49')]);delete this[_0x624c('0x15')][_0x10c05b[_0x624c('0xab')]];};Preview[_0x624c('0x61')]['checkInBlack']=function(_0x36240b,_0x31fc90,_0x233b91,_0x36d698,_0x115575){var _0x3c2bcc=this;return new BPromise(function(_0x25c4f3,_0xd6726d){if(_[_0x624c('0x69')](_0x31fc90)||_['isNil'](_0x31fc90[_0x624c('0xf4')])||_[_0x624c('0x69')](_0x31fc90[_0x624c('0xf4')]['phone'])||_[_0x624c('0x69')](_0x31fc90[_0x624c('0x72')])){_0xd6726d(ut['message'](_0x624c('0xf5'),_0x36d698,_0x115575));return;}var _0x2e03cf=uuid['v4']();var _0x11808b=_0x3c2bcc[_0x624c('0x12')][_0x31fc90[_0x624c('0x6b')]['name']];var _0x200379=_0x233b91?_0x3c2bcc[_0x624c('0x16')][_0x233b91]['id']:undefined;_0x3c2bcc[_0x624c('0x15')][_0x2e03cf]=new Action(_0x31fc90,_0x11808b,_0x2e03cf,_0x233b91,_0x200379);var _0x19456a=_0x3c2bcc[_0x624c('0x15')][_0x2e03cf];_0x19456a[_0x624c('0xa7')]=_0x36d698;_0x19456a[_0x624c('0xa8')]=_0x115575;_0x19456a[_0x624c('0xf6')]=_0x233b91;if(_[_0x624c('0xf7')](_0x36240b)){_0x3c2bcc[_0x624c('0xf8')](_0x19456a,_0x11808b,_0x31fc90,_0x233b91)[_0x624c('0x81')](function(_0x4a83ef){logger[_0x624c('0x57')](_0x624c('0xf9'),'Queue:\x20'+_0x19456a[_0x624c('0x6c')]+_0x624c('0xfa')+_0x19456a[_0x624c('0xfb')],JSON[_0x624c('0x53')](_0x4a83ef));ami[_0x624c('0x24')](_0x624c('0xfc'),ut['buildObj'](_0x19456a,_0x624c('0xfd')));_0x25c4f3(ut['message'](_0x624c('0xfe')));})[_0x624c('0x8a')](function(_0x2c735e){ut[_0x624c('0x5d')](_0x624c('0xff'),_0x2c735e);_0xd6726d(ut['message']('Call\x20failed',_0x36d698,_0x115575));});}else{_0x11808b[_0x624c('0x37')]+=0x1;ut['logBlacklist'](_0x19456a);rpcDb['createHistory'](_0x19456a,_0x624c('0x100'));delete _0x3c2bcc['actions'][_0x2e03cf];_0xd6726d(ut['message']('Contact\x20in\x20black\x20List',_0x36d698,_0x115575));}});};Preview[_0x624c('0x61')][_0x624c('0x9a')]=function(_0x1e52bc){return!_[_0x624c('0x69')](_0x1e52bc)&&!_[_0x624c('0x69')](_0x1e52bc[_0x624c('0x26')])&&!_[_0x624c('0x69')](_0x1e52bc['active'])&&_0x1e52bc[_0x624c('0x101')]&&!_[_0x624c('0x69')](this[_0x624c('0x14')][util['format'](_0x624c('0x102'),_0x1e52bc[_0x624c('0x26')])])&&!_['isNil'](this[_0x624c('0x14')][util[_0x624c('0x54')](_0x624c('0x102'),_0x1e52bc[_0x624c('0x26')])]['status'])&&(this[_0x624c('0x14')][util[_0x624c('0x54')]('SIP/%s',_0x1e52bc[_0x624c('0x26')])]['status']==='reachable'||this[_0x624c('0x14')][util[_0x624c('0x54')](_0x624c('0x102'),_0x1e52bc[_0x624c('0x26')])][_0x624c('0x75')]==='unmonitored');};Preview['prototype'][_0x624c('0x87')]=function(_0xa61be6,_0x5dd1b3){var _0x1450bc=this;return new BPromise(function(_0x1b23ff,_0x4d485a){_0x1450bc[_0x624c('0x103')](_0xa61be6,_0x5dd1b3)[_0x624c('0x81')](function(_0x19816a){_0x1b23ff(_[_0x624c('0x70')](_0x19816a,[_0x624c('0x5b')]));})[_0x624c('0x8a')](function(_0x5b4082){if(_0x5b4082[_0x624c('0x104')]){rpcDb['unlockContact'](_0xa61be6);}if(_0x5b4082[_0x624c('0x101')]){rpcDb[_0x624c('0x8b')](_0xa61be6);}_0x4d485a(_[_0x624c('0x70')](_0x5b4082,[_0x624c('0x5b')]));});});};Preview[_0x624c('0x61')][_0x624c('0x103')]=function(_0x18ef54,_0x15f249){var _0x506b33=this;return new BPromise(function(_0x2cb88a,_0x3a9251){var _0x11a3be,_0x56746a;rpcDb['getContactPreview'](_0x18ef54)[_0x624c('0x81')](function(_0x49cba2){if(!_[_0x624c('0x69')](_0x49cba2[0x0])){_0x56746a=_0x49cba2[0x0][_0x624c('0x105')]?![]:!![];_0x11a3be=_0x49cba2[0x0][_0x624c('0x105')]?!![]:![];_0x11a3be=_0x15f249?!![]:_0x11a3be;}var _0xb56836=_0x506b33['validateContact'](_0x49cba2);if(_0xb56836[_0x624c('0x106')]){rpcDb[_0x624c('0x107')](_[_0x624c('0x70')](_0x49cba2[0x0],[_0x624c('0x72'),_0x624c('0x108')]))[_0x624c('0x81')](function(_0xb53ec2){_0x506b33[_0x624c('0x109')](_0xb53ec2,_0x49cba2[0x0],_0x15f249,_0x56746a,_0x11a3be)[_0x624c('0x81')](function(_0xefdb96){_0x2cb88a(_0xefdb96);})[_0x624c('0x8a')](function(_0x30c947){_0x3a9251(_0x30c947);});})['catch'](function(_0xf996a5){ut[_0x624c('0x5d')]('[Preview][checkIsBlackList]',_0xf996a5);_0x3a9251(ut[_0x624c('0x5b')](_0x624c('0x10a'),_0x56746a,_0x11a3be));});}else{_0x3a9251(ut[_0x624c('0x5b')](_0xb56836[_0x624c('0x5b')],_0x56746a,_0x11a3be));}})[_0x624c('0x8a')](function(_0x4bcdaa){ut[_0x624c('0x5d')]('[Preview][getContactPreview]',_0x4bcdaa);_0x3a9251(ut[_0x624c('0x5b')](_0x624c('0x10a'),![],!![]));});});};Preview[_0x624c('0x61')][_0x624c('0x10b')]=function(_0x8398a2){if(_[_0x624c('0x69')](_0x8398a2)||_[_0x624c('0xf7')](_0x8398a2)||!_['isNil'](_0x8398a2[0x0][_0x624c('0x10c')])&&_[_0x624c('0x69')](_0x8398a2[0x0][_0x624c('0x10c')][_0x624c('0x26')])){ut['logger'](_0x624c('0x10d'),_0x8398a2);return{'isValid':![],'message':_0x624c('0x10e')};}var _0x1087d6=this['campaignsPreview'][_0x8398a2[0x0][_0x624c('0x6b')][_0x624c('0x26')]];_0x1087d6['message']=_0x624c('0x10f');if(_[_0x624c('0x69')](_0x1087d6)){ut[_0x624c('0x5d')](_0x624c('0x110'),_0x1087d6);return{'isValid':![],'message':_0x624c('0x111')};}if(!this[_0x624c('0x9a')](_0x1087d6[_0x624c('0x50')])){ut[_0x624c('0x5d')](_0x624c('0x112'),_0x624c('0x113')+_0x1087d6[_0x624c('0x26')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x624c('0x9a')](_0x1087d6[_0x624c('0x9b')])){ut[_0x624c('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x1087d6['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x624c('0x99')](_0x1087d6[_0x624c('0x30')])){ut[_0x624c('0x5d')](_0x624c('0x114'),_0x1087d6[_0x624c('0x26')]+_0x624c('0x115'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1087d6[_0x624c('0x26')]+_0x624c('0x115')};}return{'isValid':!![],'message':_0x624c('0x116')};};Preview['prototype'][_0x624c('0xf8')]=function(_0x553e1c,_0x4a16cf,_0x307d90,_0x1f5e2e){var _0x16ff51=this;return new BPromise(function(_0x3ac71e,_0x573170){var _0x3758e5=_0x553e1c[_0x624c('0xab')];var _0x341541=_0x16ff51['isTrunkReachable'](_0x4a16cf[_0x624c('0x50')])?util[_0x624c('0x54')](_0x624c('0x117'),_0x4a16cf[_0x624c('0x50')][_0x624c('0x26')],_['isNil'](_0x4a16cf['dialPrefix'])?'':_0x4a16cf['dialPrefix']['trim']()||'',_0x4a16cf[_0x624c('0x118')]>0x0?_0x307d90[_0x624c('0xf4')][_0x624c('0x119')][_0x624c('0x11a')](_0x4a16cf[_0x624c('0x118')]):_0x307d90['Contact'][_0x624c('0x119')]):util['format'](_0x624c('0x117'),_['isNil'](_0x4a16cf[_0x624c('0x9b')])?_0x4a16cf['Trunk'][_0x624c('0x26')]:_0x4a16cf['TrunkBackup'][_0x624c('0x26')],_[_0x624c('0x69')](_0x4a16cf['dialPrefix'])?'':_0x4a16cf[_0x624c('0x35')][_0x624c('0x11b')]()||'',_0x4a16cf[_0x624c('0x118')]>0x0?_0x307d90[_0x624c('0xf4')][_0x624c('0x119')][_0x624c('0x11a')](_0x4a16cf[_0x624c('0x118')]):_0x307d90[_0x624c('0xf4')][_0x624c('0x119')]);var _0x437ee0=_0x16ff51[_0x624c('0x9a')](_0x4a16cf[_0x624c('0x50')])?ut['getCallerId'](_0x4a16cf[_0x624c('0x50')]['callerid'],_0x4a16cf[_0x624c('0x32')],_0x4a16cf[_0x624c('0x11c')]>0x0?ut['getCallerIdRandom'](_0x4a16cf[_0x624c('0x33')],_0x4a16cf[_0x624c('0x11c')]):_0x4a16cf['dialOriginateCallerIdNumber']):ut[_0x624c('0x11d')](_['isNil'](_0x4a16cf[_0x624c('0x9b')])?_0x4a16cf[_0x624c('0x50')][_0x624c('0x51')]:_0x4a16cf[_0x624c('0x9b')][_0x624c('0x51')],_0x4a16cf['dialOriginateCallerIdName'],_0x4a16cf['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x624c('0x11e')](_0x4a16cf['dialOriginateCallerIdNumber'],_0x4a16cf[_0x624c('0x11c')]):_0x4a16cf[_0x624c('0x33')]);if(_0x437ee0){_0x553e1c[_0x624c('0x11f')]=ut[_0x624c('0x120')](_0x437ee0);_0x553e1c[_0x624c('0x121')]=ut[_0x624c('0x122')](_0x437ee0);}var _0x40192a=ut[_0x624c('0x123')](_0x4a16cf,_0x307d90,_0x341541,_0x437ee0,_0x3758e5,_0x553e1c);_[_0x624c('0x124')](_0x553e1c,ut[_0x624c('0x125')](_0x40192a));_0x553e1c['starttime']=moment()[_0x624c('0x54')](_0x624c('0x8d'));ami[_0x624c('0x74')](ut['variablesAction'](_0x553e1c,_0x4a16cf,_0x40192a,_0x553e1c[_0x624c('0xa8')],_0x1f5e2e))['then'](function(_0x2a7f05){_0x4a16cf[_0x624c('0x49')]+=0x1;logger['info']('[originated][increment]',_0x3758e5,'\x20Queue',_0x4a16cf[_0x624c('0x26')],_0x624c('0x6d'),_0x4a16cf[_0x624c('0x49')]);_0x3ac71e(_0x2a7f05);})[_0x624c('0x8a')](function(_0x270182){ut[_0x624c('0xec')](_0x553e1c,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x553e1c,_0x624c('0x126'));_0x573170(_0x270182);});});};Preview[_0x624c('0x61')]['syncNewExten']=function(_0x6bc273){if(this['actions'][_0x6bc273[_0x624c('0xa9')]]){this['actions'][_0x6bc273[_0x624c('0xa9')]][_0x624c('0x76')]=_0x6bc273['channel'];}};Preview[_0x624c('0x61')][_0x624c('0x18')]=function(_0x3c17fd){var _0x51d06a=this;var _0x15c479=this[_0x624c('0x15')][_0x3c17fd[_0x624c('0x127')]];if(_0x15c479){if(_0x15c479[_0x624c('0xf6')]&&this[_0x624c('0x16')][_0x15c479[_0x624c('0xf6')]]){ut['logLookAgent'](_0x15c479,this[_0x624c('0x16')][_0x15c479[_0x624c('0xf6')]][_0x624c('0x26')],this[_0x624c('0x16')][_0x15c479[_0x624c('0xf6')]]['id']);}var _0x543708=_[_0x624c('0x128')](_0x15c479);_0x543708[_0x624c('0x129')]=moment()['format'](_0x624c('0x8d'));var _0x19172d=_0x51d06a[_0x624c('0x12')][_0x15c479[_0x624c('0x6c')]];if(ut[_0x624c('0x12a')](_0x3c17fd['response'])){if(_0x15c479['unlockAgent']){rpcDb[_0x624c('0x12b')](_0x15c479[_0x624c('0xfb')]);}if(_0x15c479['activeContact']){rpcDb['disableContact'](_0x15c479[_0x624c('0xfb')]);}ami[_0x624c('0x24')](_0x624c('0x12c'),ut['buildObj'](_0x15c479,_0x624c('0x12d')));this['callProgressDetectingAgent'](_0x543708,_0x19172d,_0x3c17fd);}else{_0x15c479['starttime']=moment()['format'](_0x624c('0x8d'));ut[_0x624c('0xec')](_0x543708,0x4,_0x624c('0xb5'));rpcDb[_0x624c('0xed')](_0x543708,_0x624c('0x12e'));}}};Preview[_0x624c('0x61')][_0x624c('0x12f')]=function(_0x46f429){var _0x599775=this;var _0x26b55a=this[_0x624c('0x15')][_0x46f429[_0x624c('0xa9')]];var _0x2d9779;if(_0x26b55a){_0x2d9779=this[_0x624c('0x12')][_0x26b55a['queue']];logger[_0x624c('0x57')]('[syncHangup][talking]',_0x46f429[_0x624c('0xa9')],'\x20Queue',_0x2d9779[_0x624c('0x26')],_0x624c('0x6e'),_0x2d9779[_0x624c('0x2a')]);}if(this[_0x624c('0x15')][_0x46f429['linkedid']]&&_0x46f429['linkedid']!==_0x46f429[_0x624c('0xab')]){if(_0x46f429[_0x624c('0x130')]==='16'&&this['actions'][_0x46f429['linkedid']]['dialAnswer']){this['callProgressDetectingCustomer'](_0x46f429,_0x46f429['linkedid'],_0x46f429[_0x624c('0x130')]);}else if(this[_0x624c('0x15')][_0x46f429[_0x624c('0xa9')]][_0x624c('0x6f')]){logger[_0x624c('0x57')](_0x624c('0x131'),_0x46f429[_0x624c('0xa9')],_0x46f429[_0x624c('0x130')],_0x624c('0xac'),_0x2d9779[_0x624c('0x26')],_0x624c('0x6e'),_0x2d9779[_0x624c('0x2a')]);this[_0x624c('0x132')](_0x46f429,_0x46f429[_0x624c('0xa9')],_0x46f429[_0x624c('0x130')]);}}else if(_0x26b55a&&_[_0x624c('0x69')](_0x26b55a[_0x624c('0x133')])&&_0x2d9779['dialQueueProject']&&_0x46f429[_0x624c('0xa9')]===_0x46f429[_0x624c('0xab')]&&_[_0x624c('0x69')](_0x46f429[_0x624c('0xea')])&&_0x46f429[_0x624c('0x130')]==='16'&&_0x46f429['channelstate']==='6'&&_[_0x624c('0xe8')](_0x26b55a[_0x624c('0x134')])){if(_0x26b55a[_0x624c('0xa7')]){rpcDb[_0x624c('0x12b')](_0x26b55a[_0x624c('0xfb')]);}if(_0x26b55a['activeContact']){rpcDb['disableContact'](_0x26b55a['idContact']);}_0x46f429[_0x624c('0xea')]='22';this[_0x624c('0xe7')](_0x26b55a,_0x2d9779,_0x46f429);}else if(_0x26b55a&&_0x26b55a[_0x624c('0x134')]){if(_0x46f429[_0x624c('0x130')]==='16'&&this['actions'][_0x46f429['linkedid']][_0x624c('0x6f')]){logger[_0x624c('0x57')](_0x624c('0x135'),_0x46f429['linkedid'],_0x46f429[_0x624c('0x130')],_0x624c('0xac'),_0x2d9779['name'],_0x624c('0x6e'),_0x2d9779['pTalking']);this['callProgressDetectingCustomer'](_0x46f429,_0x46f429['linkedid'],_0x46f429[_0x624c('0x130')]);}else if(this[_0x624c('0x15')][_0x46f429[_0x624c('0xa9')]][_0x624c('0x6f')]){logger[_0x624c('0x57')](_0x624c('0x131'),_0x46f429[_0x624c('0xa9')],_0x46f429[_0x624c('0x130')],_0x624c('0xac'),_0x2d9779[_0x624c('0x26')],_0x624c('0x6e'),_0x2d9779[_0x624c('0x2a')]);this[_0x624c('0x132')](_0x46f429,_0x46f429[_0x624c('0xa9')],_0x46f429[_0x624c('0x130')]);}}};Preview[_0x624c('0x61')][_0x624c('0x136')]=function(_0x2127d0){if(this['actions'][_0x2127d0[_0x624c('0xe6')]]&&_0x2127d0[_0x624c('0xe6')]!==_0x2127d0[_0x624c('0x137')]){this[_0x624c('0x132')](_0x2127d0,_0x2127d0['destlinkedid'],_0x2127d0[_0x624c('0xe1')]);}};Preview[_0x624c('0x61')]['syncHangupRequest']=function(_0x4489ed){if(this['actions'][_0x4489ed['linkedid']]&&_0x4489ed[_0x624c('0xa9')]!==_0x4489ed['uniqueid']&&!this[_0x624c('0x15')][_0x4489ed[_0x624c('0xa9')]][_0x624c('0x6f')]){if(_0x4489ed['cause']==='1'){this['callProgressDetectingCustomer'](_0x4489ed,_0x4489ed[_0x624c('0xa9')],_0x4489ed[_0x624c('0x130')]);}}};Preview['prototype'][_0x624c('0x138')]=function(_0x114dda,_0x5a9e28,_0x3a7b5a){if(this['actions'][_0x114dda]){if(_['isNil'](this[_0x624c('0x15')][_0x114dda][_0x624c('0x139')])){this[_0x624c('0x15')][_0x114dda][_0x624c('0x139')]={};}this['actions'][_0x114dda][_0x624c('0x139')][_0x5a9e28]=_0x3a7b5a;}};Preview[_0x624c('0x61')]['syncVarSet']=function(_0x2aac65){try{if(!_['isNil'](_0x2aac65)){if(ut[_0x624c('0x13a')](_['keys'](_0x2aac65[_0x624c('0x13b')])[0x0])){this[_0x624c('0x138')](_0x2aac65[_0x624c('0xab')],_[_0x624c('0x13c')](_0x2aac65[_0x624c('0x13b')])[0x0],_0x2aac65['value']);}}}catch(_0x93cab4){logger[_0x624c('0x13d')]('[syncVarSet][Preview]',util['inspect'](_0x93cab4,{'showHidden':![],'depth':null}));}};Preview[_0x624c('0x61')][_0x624c('0x20')]=function(_0x4174a4){if(_0x4174a4){if(this['actions'][_0x4174a4['transfertargetlinkedid']]){this[_0x624c('0x15')][_0x4174a4[_0x624c('0x13e')]][_0x624c('0x134')]=!![];}}};Preview[_0x624c('0x61')][_0x624c('0x22')]=function(_0x2ddafa){if(_0x2ddafa){if(this[_0x624c('0x15')][_0x2ddafa['transfererlinkedid']]){this['actions'][_0x2ddafa[_0x624c('0x13f')]][_0x624c('0x134')]=!![];}}};module[_0x624c('0x140')]=Preview;
\ No newline at end of file
index 323738a..298f3d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','then','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerFinal','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt'];(function(_0x1f48f5,_0x4e8932){var _0x22902a=function(_0x457c20){while(--_0x457c20){_0x1f48f5['push'](_0x1f48f5['shift']());}};_0x22902a(++_0x4e8932);}(_0xed1f,0x6a));var _0xfed1=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xed1f[_0x725b8e];return _0x43ac45;};'use strict';var util=require(_0xfed1('0x0'));var BPromise=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var _=require(_0xfed1('0x4'));var cmHopper=require(_0xfed1('0x5'));var cmHopperFinal=require(_0xfed1('0x6'));var cmHopperHistory=require(_0xfed1('0x7'));var cmHopperBlack=require(_0xfed1('0x8'));var voiceQueueRt=require(_0xfed1('0x9'));var agentReportPreview=require(_0xfed1('0xa'));var voiceQueueReport=require(_0xfed1('0xb'));function loggerCatch(_0x3d6706){return function(_0x42751d){logger[_0xfed1('0xc')](_0x3d6706,util[_0xfed1('0xd')](_0x42751d,{'showHidden':![],'depth':null}));};}function create(_0x2a6082){return BPromise[_0xfed1('0xe')]()['then'](cmHopperHistory[_0xfed1('0xf')](_0x2a6082))[_0xfed1('0x10')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x1414be){return BPromise[_0xfed1('0xe')]()['then'](agentReportPreview[_0xfed1('0xf')](_0x1414be))['catch'](loggerCatch(_0xfed1('0x11')));}function moveContact(_0x234f4e){return BPromise['resolve']()['then'](cmHopper[_0xfed1('0x12')](_0x234f4e,!![]))[_0xfed1('0x10')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xfed1('0x13')]=function(_0x5a3469){return BPromise['resolve']()[_0xfed1('0x14')](cmHopperBlack[_0xfed1('0x13')](_0x5a3469))['catch'](loggerCatch(_0xfed1('0x15')));};exports['getContactPreview']=function(_0x4cd9d1){return BPromise[_0xfed1('0xe')]()[_0xfed1('0x14')](cmHopper[_0xfed1('0x16')](_0x4cd9d1))[_0xfed1('0x10')](loggerCatch('[getContactPreview]\x20'));};exports[_0xfed1('0xf')]=function(_0x4af928,_0x36ff34){create(_0x4af928)[_0xfed1('0x10')](loggerCatch(_0x36ff34));moveContact(_0x4af928)['catch'](loggerCatch(_0x36ff34));};exports[_0xfed1('0x17')]=function(_0xa72a20,_0x5c0d9f){createAgent(_0xa72a20)['catch'](loggerCatch(_0x5c0d9f));};exports['createCustomerHistory']=function(_0x1e5afb,_0x51f12a){create(_0x1e5afb)[_0xfed1('0x10')](loggerCatch(_0x51f12a));};exports[_0xfed1('0x18')]=function(_0x51a860,_0x94cb84){moveContact(_0x51a860)[_0xfed1('0x10')](loggerCatch(_0x94cb84));};exports['rescheduleContact']=function(_0x3ce944,_0x2ea7a8,_0xff4842){if(_0x2ea7a8){_0x3ce944[_0xfed1('0x19')]=null;}if(_0xff4842){_0x3ce944['active']=![];}return BPromise[_0xfed1('0xe')]()['then'](cmHopper[_0xfed1('0x1a')](_0x3ce944))[_0xfed1('0x10')](loggerCatch(_0xfed1('0x1b')));};exports['countReScheduled']=function(_0x41d22c){return BPromise['resolve']()[_0xfed1('0x14')](cmHopper[_0xfed1('0x1c')](_0x41d22c))[_0xfed1('0x10')](loggerCatch(_0xfed1('0x1d')));};exports[_0xfed1('0x1e')]=function(_0x1199b7){return BPromise['resolve']()[_0xfed1('0x14')](cmHopper[_0xfed1('0x1e')]({'UserId':null},_0x1199b7,0x1))['catch'](loggerCatch(_0xfed1('0x1f')));};exports[_0xfed1('0x20')]=function(_0x1b871a){return BPromise[_0xfed1('0xe')]()[_0xfed1('0x14')](cmHopper[_0xfed1('0x1e')]({'active':![]},_0x1b871a,0x1))['catch'](loggerCatch(_0xfed1('0x21')));};exports['crateCustomerReportQueue']=function(_0x3106ee){var _0x4e5249={};_0x4e5249['type']=_0x3106ee[_0xfed1('0x22')];_0x4e5249[_0xfed1('0x23')]=_0x3106ee[_0xfed1('0x23')];_0x4e5249['calleridnum']=_0x3106ee[_0xfed1('0x24')];_0x4e5249[_0xfed1('0x25')]=_0x3106ee[_0xfed1('0x25')];_0x4e5249[_0xfed1('0x26')]=_0x3106ee[_0xfed1('0x26')];_0x4e5249[_0xfed1('0x27')]=_0x3106ee['answertime'];_0x4e5249[_0xfed1('0x28')]=_0x3106ee[_0xfed1('0x29')];_0x4e5249['queuecallercomplete']=0x1;_0x4e5249['queuecallercompleteAt']=_0x3106ee[_0xfed1('0x2a')];_0x4e5249[_0xfed1('0x2b')]=_0x3106ee[_0xfed1('0x2c')];_0x4e5249[_0xfed1('0x2d')]=_0xfed1('0x2e');_0x4e5249['exten']=_0xfed1('0x2f');_0x4e5249[_0xfed1('0x30')]=0x0;_0x4e5249[_0xfed1('0x31')]=0x1;_0x4e5249[_0xfed1('0x32')]=_0x3106ee[_0xfed1('0x2c')];_0x4e5249['queuecallerexitreason']=_0xfed1('0x33');return BPromise['resolve']()[_0xfed1('0x14')](voiceQueueReport[_0xfed1('0x34')](_0x4e5249))[_0xfed1('0x10')](loggerCatch(_0xfed1('0x35')));};exports[_0xfed1('0x36')]=function(_0x1f5dcf,_0x39db58){return BPromise[_0xfed1('0xe')]()['then'](cmHopper[_0xfed1('0x36')](_0x1f5dcf,_0x39db58))[_0xfed1('0x10')](loggerCatch(_0xfed1('0x37')));};exports[_0xfed1('0x38')]=function(_0x57da75){return BPromise['resolve']()[_0xfed1('0x14')](cmHopper[_0xfed1('0x1a')](_0x57da75,!![],!![]))[_0xfed1('0x10')](loggerCatch(_0xfed1('0x39')));};
\ No newline at end of file
+var _0xa41a=['queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','resolve','createHistory','catch','[createHistory]\x20','then','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned'];(function(_0x44e6fd,_0x25a37a){var _0x11e582=function(_0x4a0271){while(--_0x4a0271){_0x44e6fd['push'](_0x44e6fd['shift']());}};_0x11e582(++_0x25a37a);}(_0xa41a,0x6b));var _0xaa41=function(_0x530bee,_0x17c5b8){_0x530bee=_0x530bee-0x0;var _0x456c4b=_0xa41a[_0x530bee];return _0x456c4b;};'use strict';var util=require(_0xaa41('0x0'));var BPromise=require(_0xaa41('0x1'));var logger=require('../../../config/logger')(_0xaa41('0x2'));var _=require(_0xaa41('0x3'));var cmHopper=require(_0xaa41('0x4'));var cmHopperFinal=require(_0xaa41('0x5'));var cmHopperHistory=require(_0xaa41('0x6'));var cmHopperBlack=require(_0xaa41('0x7'));var voiceQueueRt=require(_0xaa41('0x8'));var agentReportPreview=require(_0xaa41('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2122a0){return function(_0x1ec9d4){logger['error'](_0x2122a0,util['inspect'](_0x1ec9d4,{'showHidden':![],'depth':null}));};}function create(_0x179545){return BPromise[_0xaa41('0xa')]()['then'](cmHopperHistory[_0xaa41('0xb')](_0x179545))[_0xaa41('0xc')](loggerCatch(_0xaa41('0xd')));}function createAgent(_0x1cc344){return BPromise[_0xaa41('0xa')]()[_0xaa41('0xe')](agentReportPreview[_0xaa41('0xb')](_0x1cc344))[_0xaa41('0xc')](loggerCatch(_0xaa41('0xd')));}function moveContact(_0x5c9fc7){return BPromise[_0xaa41('0xa')]()[_0xaa41('0xe')](cmHopper['moveContactManagedDialer'](_0x5c9fc7,!![]))['catch'](loggerCatch(_0xaa41('0xf')));}exports['checkIsBlackList']=function(_0x19bd69){return BPromise[_0xaa41('0xa')]()[_0xaa41('0xe')](cmHopperBlack[_0xaa41('0x10')](_0x19bd69))[_0xaa41('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xaa41('0x11')]=function(_0x178170){return BPromise[_0xaa41('0xa')]()[_0xaa41('0xe')](cmHopper[_0xaa41('0x11')](_0x178170))[_0xaa41('0xc')](loggerCatch(_0xaa41('0x12')));};exports['createHistory']=function(_0x2d868a,_0x16b930){create(_0x2d868a)[_0xaa41('0xc')](loggerCatch(_0x16b930));moveContact(_0x2d868a)[_0xaa41('0xc')](loggerCatch(_0x16b930));};exports[_0xaa41('0x13')]=function(_0xd20ddf,_0x29efe5){createAgent(_0xd20ddf)[_0xaa41('0xc')](loggerCatch(_0x29efe5));};exports[_0xaa41('0x14')]=function(_0x4fe1a4,_0x5cd936){create(_0x4fe1a4)[_0xaa41('0xc')](loggerCatch(_0x5cd936));};exports[_0xaa41('0x15')]=function(_0x35c753,_0x54c488){moveContact(_0x35c753)[_0xaa41('0xc')](loggerCatch(_0x54c488));};exports[_0xaa41('0x16')]=function(_0x4e768e,_0x513c61,_0x1b1910){if(_0x513c61){_0x4e768e['UserId']=null;}if(_0x1b1910){_0x4e768e[_0xaa41('0x17')]=![];}return BPromise[_0xaa41('0xa')]()[_0xaa41('0xe')](cmHopper[_0xaa41('0x16')](_0x4e768e))[_0xaa41('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xaa41('0x18')]=function(_0x43a85c){return BPromise[_0xaa41('0xa')]()[_0xaa41('0xe')](cmHopper[_0xaa41('0x18')](_0x43a85c))[_0xaa41('0xc')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x16aec5){return BPromise['resolve']()['then'](cmHopper[_0xaa41('0x19')]({'UserId':null},_0x16aec5,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0xaa41('0x1a')]=function(_0x9c8c21){return BPromise[_0xaa41('0xa')]()[_0xaa41('0xe')](cmHopper[_0xaa41('0x19')]({'active':![]},_0x9c8c21,0x1))[_0xaa41('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xaa41('0x1b')]=function(_0x1f0275){var _0x63c18c={};_0x63c18c[_0xaa41('0x1c')]=_0x1f0275[_0xaa41('0x1c')];_0x63c18c[_0xaa41('0x1d')]=_0x1f0275[_0xaa41('0x1d')];_0x63c18c[_0xaa41('0x1e')]=_0x1f0275['calleridnum'];_0x63c18c[_0xaa41('0x1f')]=_0x1f0275['calleridname'];_0x63c18c['queue']=_0x1f0275[_0xaa41('0x20')];_0x63c18c[_0xaa41('0x21')]=_0x1f0275['answertime'];_0x63c18c[_0xaa41('0x22')]=_0x1f0275[_0xaa41('0x23')];_0x63c18c['queuecallercomplete']=0x1;_0x63c18c['queuecallercompleteAt']=_0x1f0275['endtime'];_0x63c18c[_0xaa41('0x24')]=_0x1f0275[_0xaa41('0x25')];_0x63c18c[_0xaa41('0x26')]=_0xaa41('0x27');_0x63c18c['exten']=_0xaa41('0x28');_0x63c18c[_0xaa41('0x29')]=0x0;_0x63c18c[_0xaa41('0x2a')]=0x1;_0x63c18c['lastAssignedTo']=_0x1f0275[_0xaa41('0x25')];_0x63c18c[_0xaa41('0x2b')]=_0xaa41('0x2c');return BPromise['resolve']()[_0xaa41('0xe')](voiceQueueReport[_0xaa41('0x2d')](_0x63c18c))['catch'](loggerCatch(_0xaa41('0x2e')));};exports[_0xaa41('0x2f')]=function(_0x2298ed,_0x5cec87){return BPromise[_0xaa41('0xa')]()['then'](cmHopper[_0xaa41('0x2f')](_0x2298ed,_0x5cec87))[_0xaa41('0xc')](loggerCatch(_0xaa41('0x30')));};exports['rescheduleContactInQueue']=function(_0x526377){return BPromise['resolve']()[_0xaa41('0xe')](cmHopper[_0xaa41('0x16')](_0x526377,!![],!![]))[_0xaa41('0xc')](loggerCatch(_0xaa41('0x31')));};
\ No newline at end of file
index fa1e969..3b4752b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96f2=['agentReadyId','not_inuse','status','push','getDiff','filterKey','idContact','type','campaigntype','dialAnswer','membername','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridname','dialer','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','UserId','logCustomer','talktime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','calleridnum','timeout','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','cloneAction','clone','Global','active','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','interface','buildAcw','queue'];(function(_0x2bfbe9,_0x2eeb9a){var _0x4602da=function(_0x408d16){while(--_0x408d16){_0x2bfbe9['push'](_0x2bfbe9['shift']());}};_0x4602da(++_0x2eeb9a);}(_0x96f2,0xb0));var _0x296f=function(_0x4ebef6,_0x70643c){_0x4ebef6=_0x4ebef6-0x0;var _0x1f5fe5=_0x96f2[_0x4ebef6];return _0x1f5fe5;};'use strict';var util=require(_0x296f('0x0'));var _=require('lodash');var moment=require(_0x296f('0x1'));var logger=require(_0x296f('0x2'))(_0x296f('0x3'));var ipAgi=process['env'][_0x296f('0x4')]||_0x296f('0x5');function getSeconds(_0x334a4e,_0x57f54e){var _0x5fae7=moment(_0x334a4e)[_0x296f('0x6')](0x0);var _0x4c3626=moment(_0x57f54e)['milliseconds'](0x0);return _0x5fae7[_0x296f('0x7')](_0x4c3626,_0x296f('0x8'));}exports[_0x296f('0x9')]=function(_0x28f708){return function(_0x30ed43){logger[_0x296f('0xa')](_0x28f708,util[_0x296f('0xb')](_0x30ed43,{'showHidden':![],'depth':null}));};};exports[_0x296f('0xc')]=function(_0x2f81ac,_0x3729ab){logger['info'](_0x2f81ac,util[_0x296f('0xb')](_0x3729ab,{'showHidden':![],'depth':null}));};exports[_0x296f('0xd')]=function(_0x2aa644,_0x59c65d){logger[_0x296f('0xa')](_0x2aa644,util[_0x296f('0xb')](_0x59c65d,{'showHidden':![],'depth':null}));};exports[_0x296f('0xe')]=function(_0x28dad3){return function(_0x5710ac){logger['info'](_0x28dad3,util['inspect'](_0x5710ac,{'showHidden':![],'depth':null}));};};exports[_0x296f('0xf')]=function(_0x46c711,_0x2ae407,_0xe843fc){return{'message':_0x46c711,'unlock':_0x2ae407,'active':_0xe843fc};};exports['getCallerId']=function(_0xac5d0,_0x496675,_0x4e0b88){if(!_[_0x296f('0x10')](_0x4e0b88)&&_0x296f('0x11')===typeof _0x4e0b88&&!_[_0x296f('0x12')](_0x4e0b88)){if(!_[_0x296f('0x10')](_0x496675)&&'string'===typeof _0x496675&&!_['isEmpty'](_0x496675)){return util[_0x296f('0x13')]('\x22%s\x22\x20<%s>',_0x496675,_0x4e0b88);}return util[_0x296f('0x13')](_0x296f('0x14'),_0x4e0b88,_0x4e0b88);}if(!_[_0x296f('0x10')](_0xac5d0)&&'string'===typeof _0xac5d0&&!_[_0x296f('0x12')](_0xac5d0)){return _0xac5d0;}return _0x296f('0x15');};exports['isActive']=function(_0x33e62f){if(_[_0x296f('0x16')](_0x33e62f)){return![];}return _0x33e62f;};exports[_0x296f('0x17')]=function(_0x409ce1,_0x5cedbc,_0x132005,_0x474721,_0x54f5d8,_0x54005f){var _0x54e0de={'XMD-QUEUE':_0x5cedbc[_0x296f('0x18')]?_0x5cedbc[_0x296f('0x18')]['name']:'','XMD-CALLERID':_0x474721,'XMD-CALLERID-PREVIEW':_0x54005f?util[_0x296f('0x13')](_0x296f('0x14'),_0x54005f[_0x296f('0x19')],_0x54005f['calleridnum']):_0x474721,'XMD-DIALID':_0x54f5d8,'XMD-CONTACTID':_0x5cedbc['ContactId'],'XMD-CDRTYPE':_0x296f('0x1a'),'CALLERID(all)':_0x474721,'XMD-VOICEQUEUEID':_0x5cedbc['VoiceQueueId'],'XMD-DIALCHANNEL':_0x132005,'XMD-DIALTIMEOUT':_0x409ce1['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x296f('0x13')]('\x22rtTxX%s%s\x22',_0x409ce1['dialQueueProject2']?'g':'',_['isEmpty'](_0x409ce1[_0x296f('0x1b')])?'':_0x296f('0x1c')),'XMD-DIALURL':_0x409ce1[_0x296f('0x1d')]||'','XMD-AGI':_0x409ce1[_0x296f('0x1e')]?util[_0x296f('0x13')](_0x296f('0x1f'),ipAgi,_0x409ce1['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x409ce1[_0x296f('0x20')]?util['format'](_0x296f('0x1f'),ipAgi,_0x409ce1[_0x296f('0x20')]):_0x296f('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x54005f?_0x54005f[_0x296f('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x54005f?_0x54005f[_0x296f('0x23')]:'','XMD-DESTINATION':_0x296f('0x24')};if(!_['isEmpty'](_0x409ce1[_0x296f('0x1b')])){_0x54e0de[util['format']('%s',_0x296f('0x25'))]=_0x409ce1[_0x296f('0x1b')];_0x54e0de[util[_0x296f('0x13')]('%s',_0x296f('0x26'))]=_0x54f5d8;}if(_0x5cedbc&&_0x5cedbc[_0x296f('0x27')]){for(var _0xdf21e8 in _0x5cedbc[_0x296f('0x27')]){if(_0x5cedbc[_0x296f('0x27')][_0x296f('0x28')](_0xdf21e8)){if(!_[_0x296f('0x16')](_0x5cedbc[_0x296f('0x27')][_0xdf21e8])&&_0xdf21e8!=='id'&&_0xdf21e8!==_0x296f('0x29')&&_0xdf21e8!==_0x296f('0x2a')&&_0xdf21e8!=='updatedAt'){_0x54e0de[util[_0x296f('0x13')](_0x296f('0x2b'),_0x296f('0x2c'),_[_0x296f('0x2d')](_0xdf21e8))]=_0x5cedbc['Contact'][_0xdf21e8];}}}}return _0x54e0de;};exports['toLowerVariables']=function(_0x587058){var _0x3db139={};for(var _0x2ed857 in _0x587058){if(_0x587058['hasOwnProperty'](_0x2ed857)){_0x3db139[util[_0x296f('0x13')]('%s',_[_0x296f('0x2e')](_0x2ed857))]=_0x587058[_0x2ed857];}}return{'variables':_0x3db139};};exports['updateOriginated']=function(_0x513873,_0xe97345){if(!_[_0x296f('0x16')](_0x513873)){if(_0x513873['hasOwnProperty'](_0x296f('0x2f'))){if(_0x513873[_0x296f('0x2f')]>0x0){_0x513873[_0x296f('0x2f')]-=0x1;}else{logger[_0x296f('0xa')](_0x296f('0x30'),_0xe97345);}}}else{logger[_0x296f('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0xe97345);}};exports['logBlacklist']=function(_0x5a51e3){var _0x335964=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5a51e3[_0x296f('0x31')]=0xd;_0x5a51e3[_0x296f('0x32')]=_0x296f('0x33');_0x5a51e3[_0x296f('0x34')]=_0x335964;_0x5a51e3[_0x296f('0x35')]=_0x335964;_0x5a51e3[_0x296f('0x36')]=_0x335964;};exports[_0x296f('0x37')]=function(_0x4fdfcb,_0x2c46b8,_0x12dad2){var _0x2ee591=moment()[_0x296f('0x13')](_0x296f('0x38'));_0x4fdfcb[_0x296f('0x31')]=_0x2c46b8;_0x4fdfcb[_0x296f('0x32')]=_0x12dad2;_0x4fdfcb[_0x296f('0x35')]=_0x2ee591;_0x4fdfcb['ringtime']=getSeconds(_0x4fdfcb[_0x296f('0x35')],_0x4fdfcb[_0x296f('0x34')]);};exports['logLookAgent']=function(_0x13fe16,_0x134d5d,_0x4c9cc9){_0x13fe16['membername']=_0x134d5d;_0x13fe16[_0x296f('0x39')]=_0x4c9cc9;};exports[_0x296f('0x3a')]=function(_0x440813,_0x402ab7,_0x28111d){var _0x1b77ea=moment()[_0x296f('0x13')](_0x296f('0x38'));_0x440813[_0x296f('0x31')]=_0x402ab7;_0x440813['statedesc']=_0x28111d;_0x440813[_0x296f('0x35')]=_0x440813['responsetime']?_0x440813[_0x296f('0x35')]:_0x1b77ea;_0x440813[_0x296f('0x36')]=_0x440813[_0x296f('0x36')]?_0x440813[_0x296f('0x36')]:_0x1b77ea;_0x440813['ringtime']=getSeconds(_0x440813[_0x296f('0x35')]||0x0,_0x440813['starttime']||0x0);_0x440813[_0x296f('0x3b')]=_0x440813['answertime']?getSeconds(_0x440813['endtime'],_0x440813['answertime']):0x0;};exports[_0x296f('0x3c')]=function(_0xa8adf1){return _0xa8adf1===_0x296f('0x3d');};exports[_0x296f('0x3e')]=function(_0x908eb5,_0x2e962e,_0x2c98a1,_0x4edcc6,_0x5a1ad0){var _0x1da733=_0x4edcc6?'RECALL':_0x908eb5[_0x296f('0x19')];_0x1da733=_0x5a1ad0?_0x296f('0x3f'):_0x1da733;return{'actionid':_0x908eb5[_0x296f('0x40')],'action':_0x296f('0x41'),'channel':_0x908eb5[_0x296f('0x42')],'callerid':util[_0x296f('0x13')](_0x296f('0x14'),_0x1da733,_0x908eb5[_0x296f('0x43')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x2c98a1,'timeout':(_0x2e962e[_0x296f('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x908eb5[_0x296f('0x40')]};};exports[_0x296f('0x45')]=function(_0x420e0c){return _0x420e0c[_0x296f('0x46')]+_0x420e0c[_0x296f('0x47')]+_0x420e0c['countnoanswerretry']+_0x420e0c['countagentrejectretry']+_0x420e0c[_0x296f('0x48')];};exports[_0x296f('0x49')]=function(_0x4cf2b0){var _0x4b0c4d=_[_0x296f('0x4a')](_0x4cf2b0);_0x4b0c4d[_0x296f('0x31')]=0xf;_0x4b0c4d['statedesc']=_0x296f('0x4b');return _0x4b0c4d;};exports['scheduledAt']=function(_0x5d58dc,_0x5768ed,_0x164a60){var _0x25bacc={};_0x25bacc[_0x5768ed]=_0x5d58dc[_0x5768ed];_0x25bacc[_0x296f('0x4c')]=![];_0x25bacc['scheduledat']=moment()[_0x296f('0x4d')](_0x164a60,_0x296f('0x4e'))[_0x296f('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x25bacc[_0x296f('0x4f')]=_0x5d58dc[_0x296f('0x4f')];_0x25bacc['ListId']=_0x5d58dc[_0x296f('0x50')];_0x25bacc[_0x296f('0x51')]=_0x5d58dc['VoiceQueueId']||undefined;return _0x25bacc;};exports[_0x296f('0x52')]=function(_0x4d7caf,_0x4b50a3){if(!_['isNil'](_0x4d7caf)){if(_0x4d7caf[_0x296f('0x53')]>0x0){_0x4d7caf[_0x296f('0x53')]-=0x1;}else{logger['error'](_0x4b50a3,_0x296f('0x54'));}}else{logger[_0x296f('0xa')](_0x4b50a3,_0x296f('0x55'));}};exports[_0x296f('0x56')]=function(_0x568aaa){if(_0x568aaa<=0x0){return!![];}return![];};exports['buildObj']=function(_0x185ac4,_0x5425bc){_0x185ac4[_0x296f('0x57')]=_0x5425bc;_0x185ac4[_0x296f('0x58')]=_0x185ac4['queue'];_0x185ac4[_0x296f('0x59')]=_0x185ac4[_0x296f('0x42')];return _0x185ac4;};exports[_0x296f('0x5a')]=function(_0x53d408){var _0x2915fd={};_0x2915fd[_0x296f('0x5b')]=_0x53d408[_0x296f('0x5b')];_0x2915fd[_0x296f('0x59')]=_0x53d408[_0x296f('0x42')];_0x2915fd[_0x296f('0x40')]=_0x53d408['uniqueid'];return _0x2915fd;};exports[_0x296f('0x5c')]=function(_0x5d7541){var _0x21d5a2=[];for(var _0x364f37 in _0x5d7541){if(_0x5d7541[_0x296f('0x28')](_0x364f37)){if(!_[_0x296f('0x16')](_0x5d7541[_0x364f37])&&_0x5d7541[_0x364f37][_0x296f('0x31')]===_0x296f('0x5d')&&_0x5d7541[_0x364f37][_0x296f('0x5e')]==='reachable'){_0x21d5a2[_0x296f('0x5f')](_0x5d7541[_0x364f37]['id']);}}}return _0x21d5a2;};exports[_0x296f('0x60')]=function(_0x47c966){var _0x10b58c=moment()[_0x296f('0x6')](0x0);var _0x4e293b=moment(_0x47c966)[_0x296f('0x6')](0x0);return _0x10b58c[_0x296f('0x7')](_0x4e293b,_0x296f('0x8'));};exports['createBody']=function(_0x198832){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x198832[_0x296f('0x4f')],'ListId':_0x198832[_0x296f('0x50')],'VoiceQueueId':_0x198832[_0x296f('0x51')]||undefined,'CampaignId':_0x198832['CampaignId']||undefined};};exports[_0x296f('0x61')]=function(_0x4002b8){if(_0x4002b8==='uniqueid'||_0x4002b8===_0x296f('0x62')||_0x4002b8===_0x296f('0x5b')||_0x4002b8===_0x296f('0x63')||_0x4002b8===_0x296f('0x64')||_0x4002b8===_0x296f('0x65')||_0x4002b8===_0x296f('0x66')||_0x4002b8===_0x296f('0x42')||_0x4002b8===_0x296f('0x19')||_0x4002b8===_0x296f('0x4c')||_0x4002b8===_0x296f('0x43')||_0x4002b8==='scheduledat'||_0x4002b8===_0x296f('0x46')||_0x4002b8==='countcongestionretry'||_0x4002b8===_0x296f('0x67')||_0x4002b8===_0x296f('0x68')||_0x4002b8===_0x296f('0x69')||_0x4002b8===_0x296f('0x6a')||_0x4002b8===_0x296f('0x6b')||_0x4002b8==='recallme'||_0x4002b8==='ContactId'||_0x4002b8===_0x296f('0x50')||_0x4002b8===_0x296f('0x39')||_0x4002b8==='VoiceQueueId'||_0x4002b8===_0x296f('0x6c')||_0x4002b8===_0x296f('0x6d')||_0x4002b8===_0x296f('0x6e')||_0x4002b8==='xmd-phone'||_0x4002b8===_0x296f('0x6f')||_0x4002b8==='xmd-dialurl'||_0x4002b8===_0x296f('0x70')||_0x4002b8===_0x296f('0x71')||_0x4002b8==='xmd-dialid'||_0x4002b8===_0x296f('0x72')||_0x4002b8==='xmd-contactid'||_0x4002b8==='xmd-cdrtype'||_0x4002b8===_0x296f('0x73')||_0x4002b8===_0x296f('0x74')||_0x4002b8==='xmd-agi'||_0x4002b8===_0x296f('0x75')||_0x4002b8===_0x296f('0x76')||_0x4002b8===_0x296f('0x77')||_0x4002b8===_0x296f('0x78')||_0x4002b8===_0x296f('0x79')||_0x4002b8===_0x296f('0x7a')||_0x4002b8===_0x296f('0x7b')||_0x4002b8===_0x296f('0x7c')||_0x4002b8===_0x296f('0x75')||_0x4002b8===_0x296f('0x76')||_0x4002b8===_0x296f('0x77')||_0x4002b8===_0x296f('0x78')||_0x4002b8==='rtpaudioqosloss'||_0x4002b8===_0x296f('0x7a')||_0x4002b8===_0x296f('0x7b')||_0x4002b8===_0x296f('0x7c')||_0x4002b8===_0x296f('0x7d')||_0x4002b8===_0x296f('0x7e')||_0x4002b8===_0x296f('0x31')||_0x4002b8==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x39bb55,_0x349e83){var _0x4b8f3f,_0x50d51d,_0x3710a1;if(_0x349e83<=0x0){_0x349e83=0x1;}_0x4b8f3f=new RegExp(_0x296f('0x7f')+_0x349e83+'}$');_0x50d51d=Math[_0x296f('0x80')](0xa,_0x349e83-0x1);_0x3710a1=Math[_0x296f('0x80')](0xa,_0x349e83)-0x1;return util[_0x296f('0x13')]('%s',_[_0x296f('0x81')](_0x39bb55,_0x4b8f3f,_[_0x296f('0x82')](_0x50d51d,_0x3710a1)));};exports[_0x296f('0x83')]=function(_0x21f2dc){var _0x3eb46e=_0x21f2dc['match'](/"(.*?)"/);return _0x3eb46e?_0x3eb46e[0x1]:_0x21f2dc;};exports[_0x296f('0x84')]=function(_0x8fa1e6){var _0x5efda8=_0x8fa1e6[_0x296f('0x85')](/<(.*?)>/);return _0x5efda8?_0x5efda8[0x1]:_0x8fa1e6;};
\ No newline at end of file
+var _0xf108=['interface','channelAgent','buildAcw','hasOwnProperty','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','membername','calleridname','scheduledat','countcongestionretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-cdrtype','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isNil','addVariables','Queue','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','logLookAgent','UserId','logCustomer','statedesc','endtime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','name','queue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf108,0x1d9));var _0x8f10=function(_0x3994b3,_0x162e22){_0x3994b3=_0x3994b3-0x0;var _0x3e0325=_0xf108[_0x3994b3];return _0x3e0325;};'use strict';var util=require(_0x8f10('0x0'));var _=require('lodash');var moment=require(_0x8f10('0x1'));var logger=require(_0x8f10('0x2'))(_0x8f10('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x440ee7,_0x12a726){var _0x511ab7=moment(_0x440ee7)[_0x8f10('0x4')](0x0);var _0x2e3419=moment(_0x12a726)[_0x8f10('0x4')](0x0);return _0x511ab7[_0x8f10('0x5')](_0x2e3419,_0x8f10('0x6'));}exports[_0x8f10('0x7')]=function(_0x22e5df){return function(_0x3a5d06){logger['error'](_0x22e5df,util[_0x8f10('0x8')](_0x3a5d06,{'showHidden':![],'depth':null}));};};exports[_0x8f10('0x9')]=function(_0x1bbe48,_0x1d863a){logger[_0x8f10('0xa')](_0x1bbe48,util[_0x8f10('0x8')](_0x1d863a,{'showHidden':![],'depth':null}));};exports[_0x8f10('0xb')]=function(_0x3ebfd4,_0x440f86){logger[_0x8f10('0xc')](_0x3ebfd4,util[_0x8f10('0x8')](_0x440f86,{'showHidden':![],'depth':null}));};exports[_0x8f10('0xd')]=function(_0x236b4b){return function(_0x170036){logger[_0x8f10('0xa')](_0x236b4b,util['inspect'](_0x170036,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x22ad7e,_0x455d66,_0x472b6f){return{'message':_0x22ad7e,'unlock':_0x455d66,'active':_0x472b6f};};exports[_0x8f10('0xe')]=function(_0x1eaced,_0x1126c5,_0x34952c){if(!_[_0x8f10('0xf')](_0x34952c)&&_0x8f10('0x10')===typeof _0x34952c&&!_['isEmpty'](_0x34952c)){if(!_[_0x8f10('0xf')](_0x1126c5)&&_0x8f10('0x10')===typeof _0x1126c5&&!_[_0x8f10('0x11')](_0x1126c5)){return util['format'](_0x8f10('0x12'),_0x1126c5,_0x34952c);}return util[_0x8f10('0x13')]('\x22%s\x22\x20<%s>',_0x34952c,_0x34952c);}if(!_[_0x8f10('0xf')](_0x1eaced)&&_0x8f10('0x10')===typeof _0x1eaced&&!_[_0x8f10('0x11')](_0x1eaced)){return _0x1eaced;}return _0x8f10('0x14');};exports['isActive']=function(_0x56aa3f){if(_[_0x8f10('0x15')](_0x56aa3f)){return![];}return _0x56aa3f;};exports[_0x8f10('0x16')]=function(_0x3a6165,_0x34d6be,_0x301775,_0xfdb66e,_0x468fa9,_0x3fc95d){var _0x7bde34={'XMD-QUEUE':_0x34d6be[_0x8f10('0x17')]?_0x34d6be[_0x8f10('0x17')]['name']:'','XMD-CALLERID':_0xfdb66e,'XMD-CALLERID-PREVIEW':_0x3fc95d?util[_0x8f10('0x13')]('\x22%s\x22\x20<%s>',_0x3fc95d['calleridname'],_0x3fc95d['calleridnum']):_0xfdb66e,'XMD-DIALID':_0x468fa9,'XMD-CONTACTID':_0x34d6be[_0x8f10('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xfdb66e,'XMD-VOICEQUEUEID':_0x34d6be[_0x8f10('0x19')],'XMD-DIALCHANNEL':_0x301775,'XMD-DIALTIMEOUT':_0x3a6165[_0x8f10('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x8f10('0x13')](_0x8f10('0x1b'),_0x3a6165[_0x8f10('0x1c')]?'g':'',_[_0x8f10('0x11')](_0x3a6165[_0x8f10('0x1d')])?'':_0x8f10('0x1e')),'XMD-DIALURL':_0x3a6165[_0x8f10('0x1f')]||'','XMD-AGI':_0x3a6165[_0x8f10('0x20')]?util[_0x8f10('0x13')](_0x8f10('0x21'),ipAgi,_0x3a6165[_0x8f10('0x20')]):_0x8f10('0x22'),'XMD-AGIAFTER':_0x3a6165['dialQueueProject2']?util[_0x8f10('0x13')](_0x8f10('0x21'),ipAgi,_0x3a6165['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3fc95d?_0x3fc95d['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3fc95d?_0x3fc95d[_0x8f10('0x23')]:'','XMD-DESTINATION':_0x8f10('0x24')};if(!_[_0x8f10('0x11')](_0x3a6165[_0x8f10('0x1d')])){_0x7bde34[util[_0x8f10('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3a6165[_0x8f10('0x1d')];_0x7bde34[util['format']('%s',_0x8f10('0x25'))]=_0x468fa9;}if(_0x34d6be&&_0x34d6be[_0x8f10('0x26')]){for(var _0x429a99 in _0x34d6be['Contact']){if(_0x34d6be[_0x8f10('0x26')]['hasOwnProperty'](_0x429a99)){if(!_['isNil'](_0x34d6be[_0x8f10('0x26')][_0x429a99])&&_0x429a99!=='id'&&_0x429a99!==_0x8f10('0x27')&&_0x429a99!==_0x8f10('0x28')&&_0x429a99!==_0x8f10('0x29')){_0x7bde34[util[_0x8f10('0x13')](_0x8f10('0x2a'),_0x8f10('0x2b'),_['toUpper'](_0x429a99))]=_0x34d6be['Contact'][_0x429a99];}}}}return _0x7bde34;};exports[_0x8f10('0x2c')]=function(_0x57ecb0){var _0x38364b={};for(var _0x16ea79 in _0x57ecb0){if(_0x57ecb0['hasOwnProperty'](_0x16ea79)){_0x38364b[util['format']('%s',_[_0x8f10('0x2d')](_0x16ea79))]=_0x57ecb0[_0x16ea79];}}return{'variables':_0x38364b};};exports['updateOriginated']=function(_0x37a86b,_0x557deb){if(!_[_0x8f10('0x15')](_0x37a86b)){if(_0x37a86b['hasOwnProperty']('originated')){if(_0x37a86b[_0x8f10('0x2e')]>0x0){_0x37a86b['originated']-=0x1;}else{logger[_0x8f10('0xc')](_0x8f10('0x2f'),_0x557deb);}}}else{logger[_0x8f10('0xc')](_0x8f10('0x30'),_0x557deb);}};exports[_0x8f10('0x31')]=function(_0x4d48a9){var _0x2cd50e=moment()[_0x8f10('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d48a9[_0x8f10('0x32')]=0xd;_0x4d48a9['statedesc']=_0x8f10('0x33');_0x4d48a9['starttime']=_0x2cd50e;_0x4d48a9[_0x8f10('0x34')]=_0x2cd50e;_0x4d48a9['endtime']=_0x2cd50e;};exports[_0x8f10('0x35')]=function(_0x5d2fc7,_0x4b00ad,_0x18168a){var _0x5b1372=moment()[_0x8f10('0x13')](_0x8f10('0x36'));_0x5d2fc7[_0x8f10('0x32')]=_0x4b00ad;_0x5d2fc7['statedesc']=_0x18168a;_0x5d2fc7[_0x8f10('0x34')]=_0x5b1372;_0x5d2fc7[_0x8f10('0x37')]=getSeconds(_0x5d2fc7[_0x8f10('0x34')],_0x5d2fc7[_0x8f10('0x38')]);};exports[_0x8f10('0x39')]=function(_0x21d166,_0x236ad6,_0x7e540){_0x21d166['membername']=_0x236ad6;_0x21d166[_0x8f10('0x3a')]=_0x7e540;};exports[_0x8f10('0x3b')]=function(_0x529a6b,_0x1bdc54,_0x4c41bd){var _0x7eb2f1=moment()[_0x8f10('0x13')](_0x8f10('0x36'));_0x529a6b[_0x8f10('0x32')]=_0x1bdc54;_0x529a6b[_0x8f10('0x3c')]=_0x4c41bd;_0x529a6b[_0x8f10('0x34')]=_0x529a6b[_0x8f10('0x34')]?_0x529a6b[_0x8f10('0x34')]:_0x7eb2f1;_0x529a6b[_0x8f10('0x3d')]=_0x529a6b[_0x8f10('0x3d')]?_0x529a6b[_0x8f10('0x3d')]:_0x7eb2f1;_0x529a6b[_0x8f10('0x37')]=getSeconds(_0x529a6b[_0x8f10('0x34')]||0x0,_0x529a6b[_0x8f10('0x38')]||0x0);_0x529a6b['talktime']=_0x529a6b[_0x8f10('0x3e')]?getSeconds(_0x529a6b[_0x8f10('0x3d')],_0x529a6b['answertime']):0x0;};exports[_0x8f10('0x3f')]=function(_0x8309c1){return _0x8309c1===_0x8f10('0x40');};exports[_0x8f10('0x41')]=function(_0x982918,_0x134fed,_0x390ad6,_0x4ba4af,_0x42e0ad){var _0x24f320=_0x4ba4af?_0x8f10('0x42'):_0x982918['calleridname'];_0x24f320=_0x42e0ad?'BOOKED':_0x24f320;return{'actionid':_0x982918[_0x8f10('0x43')],'action':_0x8f10('0x44'),'channel':_0x982918['channelAgent'],'callerid':util[_0x8f10('0x13')](_0x8f10('0x12'),_0x24f320,_0x982918[_0x8f10('0x45')]),'Exten':_0x8f10('0x24'),'Context':_0x8f10('0x46'),'Priority':'1','variable':_0x390ad6,'timeout':(_0x134fed[_0x8f10('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x982918['uniqueid']};};exports[_0x8f10('0x48')]=function(_0x243982){return _0x243982[_0x8f10('0x49')]+_0x243982['countcongestionretry']+_0x243982[_0x8f10('0x4a')]+_0x243982[_0x8f10('0x4b')]+_0x243982[_0x8f10('0x4c')];};exports[_0x8f10('0x4d')]=function(_0x488b2d){var _0x190f91=_[_0x8f10('0x4e')](_0x488b2d);_0x190f91['state']=0xf;_0x190f91[_0x8f10('0x3c')]='Global';return _0x190f91;};exports['scheduledAt']=function(_0x414b4b,_0x351b47,_0x268275){var _0x362ce3={};_0x362ce3[_0x351b47]=_0x414b4b[_0x351b47];_0x362ce3[_0x8f10('0x4f')]=![];_0x362ce3['scheduledat']=moment()[_0x8f10('0x50')](_0x268275,_0x8f10('0x51'))[_0x8f10('0x13')](_0x8f10('0x36'));_0x362ce3[_0x8f10('0x18')]=_0x414b4b[_0x8f10('0x18')];_0x362ce3[_0x8f10('0x52')]=_0x414b4b[_0x8f10('0x52')];_0x362ce3[_0x8f10('0x19')]=_0x414b4b[_0x8f10('0x19')]||undefined;return _0x362ce3;};exports[_0x8f10('0x53')]=function(_0x452276,_0x16ada8){if(!_['isNil'](_0x452276)){if(_0x452276[_0x8f10('0x54')]>0x0){_0x452276[_0x8f10('0x54')]-=0x1;}else{logger[_0x8f10('0xc')](_0x16ada8,_0x8f10('0x55'));}}else{logger[_0x8f10('0xc')](_0x16ada8,_0x8f10('0x56'));}};exports[_0x8f10('0x57')]=function(_0x34eb2c){if(_0x34eb2c<=0x0){return!![];}return![];};exports[_0x8f10('0x58')]=function(_0x205140,_0x2dc85a){_0x205140['lastevent']=_0x2dc85a;_0x205140[_0x8f10('0x59')]=_0x205140[_0x8f10('0x5a')];_0x205140[_0x8f10('0x5b')]=_0x205140[_0x8f10('0x5c')];return _0x205140;};exports[_0x8f10('0x5d')]=function(_0x560aa4){var _0x5d6a24={};_0x5d6a24[_0x8f10('0x5a')]=_0x560aa4[_0x8f10('0x5a')];_0x5d6a24[_0x8f10('0x5b')]=_0x560aa4[_0x8f10('0x5c')];_0x5d6a24[_0x8f10('0x43')]=_0x560aa4[_0x8f10('0x43')];return _0x5d6a24;};exports['agentReadyId']=function(_0x189106){var _0xc73b90=[];for(var _0x152275 in _0x189106){if(_0x189106[_0x8f10('0x5e')](_0x152275)){if(!_[_0x8f10('0x15')](_0x189106[_0x152275])&&_0x189106[_0x152275][_0x8f10('0x32')]===_0x8f10('0x5f')&&_0x189106[_0x152275][_0x8f10('0x60')]===_0x8f10('0x61')){_0xc73b90[_0x8f10('0x62')](_0x189106[_0x152275]['id']);}}}return _0xc73b90;};exports[_0x8f10('0x63')]=function(_0x2b7eea){var _0x2c2c8d=moment()[_0x8f10('0x4')](0x0);var _0x41bdd7=moment(_0x2b7eea)[_0x8f10('0x4')](0x0);return _0x2c2c8d['diff'](_0x41bdd7,_0x8f10('0x6'));};exports[_0x8f10('0x64')]=function(_0x56304e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x56304e[_0x8f10('0x18')],'ListId':_0x56304e[_0x8f10('0x52')],'VoiceQueueId':_0x56304e[_0x8f10('0x19')]||undefined,'CampaignId':_0x56304e[_0x8f10('0x65')]||undefined};};exports[_0x8f10('0x66')]=function(_0x57b2aa){if(_0x57b2aa===_0x8f10('0x43')||_0x57b2aa==='idContact'||_0x57b2aa===_0x8f10('0x5a')||_0x57b2aa===_0x8f10('0x67')||_0x57b2aa===_0x8f10('0x68')||_0x57b2aa===_0x8f10('0x69')||_0x57b2aa===_0x8f10('0x6a')||_0x57b2aa==='channelAgent'||_0x57b2aa===_0x8f10('0x6b')||_0x57b2aa===_0x8f10('0x4f')||_0x57b2aa===_0x8f10('0x45')||_0x57b2aa===_0x8f10('0x6c')||_0x57b2aa===_0x8f10('0x49')||_0x57b2aa===_0x8f10('0x6d')||_0x57b2aa===_0x8f10('0x4a')||_0x57b2aa===_0x8f10('0x6e')||_0x57b2aa===_0x8f10('0x6f')||_0x57b2aa==='callbackuniqueid'||_0x57b2aa===_0x8f10('0x70')||_0x57b2aa===_0x8f10('0x71')||_0x57b2aa===_0x8f10('0x18')||_0x57b2aa===_0x8f10('0x52')||_0x57b2aa==='UserId'||_0x57b2aa===_0x8f10('0x19')||_0x57b2aa===_0x8f10('0x72')||_0x57b2aa===_0x8f10('0x73')||_0x57b2aa===_0x8f10('0x74')||_0x57b2aa===_0x8f10('0x75')||_0x57b2aa===_0x8f10('0x76')||_0x57b2aa===_0x8f10('0x77')||_0x57b2aa==='xmd-dialtimeout'||_0x57b2aa===_0x8f10('0x78')||_0x57b2aa===_0x8f10('0x79')||_0x57b2aa==='xmd-dialchannel'||_0x57b2aa==='xmd-contactid'||_0x57b2aa===_0x8f10('0x7a')||_0x57b2aa==='xmd-callerid'||_0x57b2aa===_0x8f10('0x7b')||_0x57b2aa==='xmd-agi'||_0x57b2aa===_0x8f10('0x7c')||_0x57b2aa===_0x8f10('0x7d')||_0x57b2aa===_0x8f10('0x7e')||_0x57b2aa===_0x8f10('0x7f')||_0x57b2aa===_0x8f10('0x80')||_0x57b2aa===_0x8f10('0x81')||_0x57b2aa===_0x8f10('0x82')||_0x57b2aa===_0x8f10('0x83')||_0x57b2aa===_0x8f10('0x7c')||_0x57b2aa==='rtpaudioqosbridged'||_0x57b2aa==='rtpaudioqosjitter'||_0x57b2aa===_0x8f10('0x7f')||_0x57b2aa===_0x8f10('0x80')||_0x57b2aa===_0x8f10('0x81')||_0x57b2aa===_0x8f10('0x82')||_0x57b2aa===_0x8f10('0x83')||_0x57b2aa===_0x8f10('0x84')||_0x57b2aa===_0x8f10('0x85')||_0x57b2aa==='state'||_0x57b2aa===_0x8f10('0x3c')){return![];}return!![];};exports[_0x8f10('0x86')]=function(_0x34d660,_0x56d447){var _0x2a74e8,_0x2f4c93,_0x38a979;if(_0x56d447<=0x0){_0x56d447=0x1;}_0x2a74e8=new RegExp('\x5cw{0,'+_0x56d447+'}$');_0x2f4c93=Math[_0x8f10('0x87')](0xa,_0x56d447-0x1);_0x38a979=Math[_0x8f10('0x87')](0xa,_0x56d447)-0x1;return util[_0x8f10('0x13')]('%s',_[_0x8f10('0x88')](_0x34d660,_0x2a74e8,_[_0x8f10('0x89')](_0x2f4c93,_0x38a979)));};exports[_0x8f10('0x8a')]=function(_0x41ad72){var _0x18bdb6=_0x41ad72[_0x8f10('0x8b')](/"(.*?)"/);return _0x18bdb6?_0x18bdb6[0x1]:_0x41ad72;};exports[_0x8f10('0x8c')]=function(_0x549c8c){var _0x2ab8d8=_0x549c8c[_0x8f10('0x8b')](/<(.*?)>/);return _0x2ab8d8?_0x2ab8d8[0x1]:_0x549c8c;};
\ No newline at end of file
index 3f38a39..6a99fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x15a029,_0x561f20){var _0x13625b=function(_0x262f6b){while(--_0x262f6b){_0x15a029['push'](_0x15a029['shift']());}};_0x13625b(++_0x561f20);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2eb9e9,_0x3dfdd7){_0x2eb9e9=_0x2eb9e9-0x0;var _0x3279aa=_0x5f2f[_0x2eb9e9];return _0x3279aa;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x2f3570,_0x4d7940){var _0x5bbab8=function(_0xf7e8e1){while(--_0xf7e8e1){_0x2f3570['push'](_0x2f3570['shift']());}};_0x5bbab8(++_0x4d7940);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a7cbc,_0x573d85){_0x5a7cbc=_0x5a7cbc-0x0;var _0x44d2cc=_0xb10b[_0x5a7cbc];return _0x44d2cc;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}};
\ No newline at end of file
index f7a77cd..fa4267c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cfd=['initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','faxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','triggers','templates','outbound','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','initTelephones','telephones','initTrunks','isUndefined','initVoiceQueues','initTriggers'];(function(_0x358858,_0x2c2e69){var _0x24ca83=function(_0x8a59d4){while(--_0x8a59d4){_0x358858['push'](_0x358858['shift']());}};_0x24ca83(++_0x2c2e69);}(_0x4cfd,0x178));var _0xd4cf=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x4cfd[_0xfa634c];return _0x73e478;};'use strict';var BPromise=require(_0xd4cf('0x0'));var util=require('util');var _=require(_0xd4cf('0x1'));var moment=require(_0xd4cf('0x2'));var Agent=require(_0xd4cf('0x3'));var Telephone=require(_0xd4cf('0x4'));var Trunk=require(_0xd4cf('0x5'));var VoiceQueue=require(_0xd4cf('0x6'));var Trigger=require(_0xd4cf('0x7'));var Template=require('../model/template');var Campaign=require(_0xd4cf('0x8'));var VoiceExtension=require(_0xd4cf('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xd4cf('0xa'));var FreshdeskAccount=require(_0xd4cf('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xd4cf('0xc'));var DeskAccount=require(_0xd4cf('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xd4cf('0xe'));var Dynamics365Account=require(_0xd4cf('0xf'));var FreshsalesAccount=require(_0xd4cf('0x10'));var FaxAccount=require(_0xd4cf('0x11'));var Realtime=function(){this[_0xd4cf('0x12')]={};this['telephones']={};this[_0xd4cf('0x13')]={};this[_0xd4cf('0x14')]={};this[_0xd4cf('0x15')]={};this['campaigns']={};this[_0xd4cf('0x16')]={};this[_0xd4cf('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xd4cf('0x18')]={};this[_0xd4cf('0x19')]={};this[_0xd4cf('0x1a')]={};this[_0xd4cf('0x1b')]={};this[_0xd4cf('0x1c')]={};this[_0xd4cf('0x1d')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xd4cf('0x1e')]={};this[_0xd4cf('0x1f')]={};this[_0xd4cf('0x20')]={};this[_0xd4cf('0x21')]={};this[_0xd4cf('0x22')]={};this[_0xd4cf('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0xe243bc,_0x52f73a,_0x356b1b){var _0x16d796=_[_0xd4cf('0x24')](_0xe243bc,function(_0x5e5b1e,_0x2e23d0){return _0x5e5b1e[_0x356b1b];});for(var _0x196c2c in _0x52f73a){if(_0x52f73a['hasOwnProperty'](_0x196c2c)){if(!_0x16d796[_0x196c2c]){delete _0x52f73a[_0x196c2c];}}}}function freeIsNotKeySip(_0xe76b87,_0x3c2101){var _0xf5c4c2=_[_0xd4cf('0x24')](_0xe76b87,function(_0x4c76c3,_0xc7537c){return util[_0xd4cf('0x25')](_0xd4cf('0x26'),_0x4c76c3[_0xd4cf('0x27')]);});for(var _0x54b99c in _0x3c2101){if(_0x3c2101[_0xd4cf('0x28')](_0x54b99c)){if(!_0xf5c4c2[_0x54b99c]){delete _0x3c2101[_0x54b99c];}}}}function freeIsNotKeyAgent(_0x142321,_0x19fb08){var _0x11bcd9=_[_0xd4cf('0x24')](_0x142321,function(_0x246905,_0xcb22f0){var _0x1e559b=_[_0xd4cf('0x29')](_0x246905[_0xd4cf('0x2a')])?util['format'](_0xd4cf('0x26'),_0x246905['name']):_0x246905[_0xd4cf('0x2a')];return _0x1e559b;});for(var _0x33ac6b in _0x19fb08){if(_0x19fb08['hasOwnProperty'](_0x33ac6b)){if(!_0x11bcd9[_0x33ac6b]){delete _0x19fb08[_0x33ac6b];}}}}function clearVoiceCallReports(_0x5723a8){_0x5723a8[_0xd4cf('0x2b')]=0x0;_0x5723a8[_0xd4cf('0x2c')]=0x0;_0x5723a8[_0xd4cf('0x2d')]=0x0;_0x5723a8[_0xd4cf('0x2e')]=0x0;_0x5723a8[_0xd4cf('0x2f')]=0x0;}function clearCampaigns(_0x377987){if(!_[_0xd4cf('0x30')](_0x377987)){for(var _0x6149a0 in _0x377987){if(_0x377987[_0xd4cf('0x28')](_0x6149a0)){_0x377987[_0x6149a0]['ivrTotalCallsDays']=0x0;_0x377987[_0x6149a0][_0xd4cf('0x31')]=0x0;}}}}function clearVoiceQueues(_0x4684f1){if(!_['isEmpty'](_0x4684f1)){for(var _0x444637 in _0x4684f1){if(_0x4684f1['hasOwnProperty'](_0x444637)){_0x4684f1[_0x444637][_0xd4cf('0x2b')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x2c')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x32')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x33')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x2d')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x2e')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x2f')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x34')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x35')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x36')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x37')]=0x0;_0x4684f1[_0x444637]['outboundNoSuchCallsDay']=0x0;_0x4684f1[_0x444637][_0xd4cf('0x38')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x39')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x3a')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x3b')]=0x0;_0x4684f1[_0x444637]['outboundOriginateFailureCallsDay']=0x0;_0x4684f1[_0x444637]['outboundRejectCallsDay']=0x0;_0x4684f1[_0x444637][_0xd4cf('0x3c')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x34')]=0x0;_0x4684f1[_0x444637][_0xd4cf('0x3d')]=0x0;_0x4684f1[_0x444637]['queueStatusComplete']=!![];}}}}Realtime[_0xd4cf('0x3e')][_0xd4cf('0x3f')]=function(_0x469c6f,_0x181c69){for(var _0x2c32f6 in _0x181c69){if(_0x469c6f[_0xd4cf('0x28')](_0x2c32f6)){_0x469c6f[_0x2c32f6]=_0x181c69[_0x2c32f6];}}};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x40')]=function(){var _0x25e517=this;return function(_0xf6c2ed){if(_0xf6c2ed){freeIsNotKeyAgent(_0xf6c2ed,_0x25e517['agents']);for(var _0x7ccfa2=0x0,_0x706f2={},_0x46b234={};_0x7ccfa2<_0xf6c2ed[_0xd4cf('0x41')];_0x7ccfa2+=0x1){_0x706f2=_0xf6c2ed[_0x7ccfa2];var _0x59fcf7=_[_0xd4cf('0x29')](_0x706f2['interface'])?util['format']('SIP/%s',_0x706f2[_0xd4cf('0x27')]):_0x706f2[_0xd4cf('0x2a')];if(_['isUndefined'](_0x25e517['agents'][_0x59fcf7])){_0x25e517[_0xd4cf('0x12')][_0x59fcf7]=new Agent(_0x706f2);}else{_0x25e517[_0xd4cf('0x3f')](_0x25e517[_0xd4cf('0x12')][_0x59fcf7],_0x706f2);}}}return _0x25e517['agents'];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x42')]=function(){var _0x342c72=this;return function(_0x44adfe){if(_0x44adfe){freeIsNotKeySip(_0x44adfe,_0x342c72[_0xd4cf('0x43')]);for(var _0x4349f9=0x0,_0x331d0c={},_0x599402={};_0x4349f9<_0x44adfe[_0xd4cf('0x41')];_0x4349f9+=0x1){_0x331d0c=_0x44adfe[_0x4349f9];if(_['isUndefined'](_0x342c72[_0xd4cf('0x43')][util['format'](_0xd4cf('0x26'),_0x331d0c[_0xd4cf('0x27')])])){_0x342c72['telephones'][util[_0xd4cf('0x25')]('SIP/%s',_0x331d0c[_0xd4cf('0x27')])]=new Telephone(_0x331d0c);}else{_0x342c72[_0xd4cf('0x3f')](_0x342c72[_0xd4cf('0x43')][util[_0xd4cf('0x25')](_0xd4cf('0x26'),_0x331d0c[_0xd4cf('0x27')])],_0x331d0c);}}}return _0x342c72['telephones'];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x44')]=function(){var _0x3bbeeb=this;return function(_0x3ec8c4){if(_0x3ec8c4){freeIsNotKeySip(_0x3ec8c4,_0x3bbeeb[_0xd4cf('0x13')]);for(var _0x3973b3=0x0,_0x2aefa3={},_0x1e7e8e={};_0x3973b3<_0x3ec8c4[_0xd4cf('0x41')];_0x3973b3+=0x1){_0x2aefa3=_0x3ec8c4[_0x3973b3];if(_[_0xd4cf('0x45')](_0x3bbeeb[_0xd4cf('0x13')][util['format'](_0xd4cf('0x26'),_0x2aefa3[_0xd4cf('0x27')])])){_0x3bbeeb[_0xd4cf('0x13')][util[_0xd4cf('0x25')](_0xd4cf('0x26'),_0x2aefa3[_0xd4cf('0x27')])]=new Trunk(_0x2aefa3);}else{_0x3bbeeb['mergeFromDatabase'](_0x3bbeeb[_0xd4cf('0x13')][util[_0xd4cf('0x25')]('SIP/%s',_0x2aefa3[_0xd4cf('0x27')])],_0x2aefa3);}}}return _0x3bbeeb['trunks'];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x46')]=function(){var _0x48fae0=this;return function(_0x2e713b){if(_0x2e713b){freeIsNotKey(_0x2e713b,_0x48fae0[_0xd4cf('0x14')],_0xd4cf('0x27'));for(var _0x347637=0x0,_0x34ed7d={},_0x3e0f3c={};_0x347637<_0x2e713b[_0xd4cf('0x41')];_0x347637+=0x1){_0x34ed7d=_0x2e713b[_0x347637];if(_[_0xd4cf('0x45')](_0x48fae0[_0xd4cf('0x14')][_0x34ed7d[_0xd4cf('0x27')]])){_0x48fae0[_0xd4cf('0x14')][_0x34ed7d[_0xd4cf('0x27')]]=new VoiceQueue(_0x34ed7d);}else{_0x48fae0[_0xd4cf('0x3f')](_0x48fae0[_0xd4cf('0x14')][_0x34ed7d[_0xd4cf('0x27')]],_0x34ed7d);}}}return _0x48fae0[_0xd4cf('0x14')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x47')]=function(){var _0x32edf1=this;return function(_0x590d0c){if(_0x590d0c){freeIsNotKey(_0x590d0c,_0x32edf1[_0xd4cf('0x15')],'id');for(var _0x38d78e=0x0,_0x54ca02={},_0x59424d={};_0x38d78e<_0x590d0c['length'];_0x38d78e+=0x1){_0x54ca02=_0x590d0c[_0x38d78e];if(_[_0xd4cf('0x45')](_0x32edf1['triggers'][_0x54ca02['id']])){_0x32edf1[_0xd4cf('0x15')][_0x54ca02['id']]=new Trigger(_0x54ca02);}else{_0x32edf1['mergeFromDatabase'](_0x32edf1[_0xd4cf('0x15')][_0x54ca02['id']],_0x54ca02);}}}return _0x32edf1[_0xd4cf('0x15')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x48')]=function(){var _0x334fb1=this;return function(_0xdb3f58){if(_0xdb3f58){freeIsNotKey(_0xdb3f58,_0x334fb1[_0xd4cf('0x16')],'id');for(var _0x387810=0x0,_0x2af4bf={},_0x3a9b89={};_0x387810<_0xdb3f58[_0xd4cf('0x41')];_0x387810+=0x1){_0x2af4bf=_0xdb3f58[_0x387810];if(_['isUndefined'](_0x334fb1[_0xd4cf('0x16')][_0x2af4bf['id']])){_0x334fb1[_0xd4cf('0x16')][_0x2af4bf['id']]=new Template(_0x2af4bf);}else{_0x334fb1['mergeFromDatabase'](_0x334fb1[_0xd4cf('0x16')][_0x2af4bf['id']],_0x2af4bf);}}}return _0x334fb1[_0xd4cf('0x16')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x49')]=function(){var _0x50d7aa=this;return function(_0x13bfb2){if(_0x13bfb2){freeIsNotKey(_0x13bfb2,_0x50d7aa['zendeskAccounts'],'id');for(var _0x451e1b=0x0,_0x4d2021={},_0x502d90={};_0x451e1b<_0x13bfb2[_0xd4cf('0x41')];_0x451e1b+=0x1){_0x4d2021=_0x13bfb2[_0x451e1b];if(_[_0xd4cf('0x45')](_0x50d7aa[_0xd4cf('0x1c')][_0x4d2021['id']])){_0x50d7aa[_0xd4cf('0x1c')][_0x4d2021['id']]=new ZendeskAccount(_0x4d2021);}else{_0x50d7aa[_0xd4cf('0x3f')](_0x50d7aa[_0xd4cf('0x1c')][_0x4d2021['id']],_0x4d2021);}}}return _0x50d7aa[_0xd4cf('0x1c')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x4a')]=function(){var _0x40fe90=this;return function(_0xa288f7){if(_0xa288f7){freeIsNotKey(_0xa288f7,_0x40fe90[_0xd4cf('0x1d')],'id');for(var _0x40774a=0x0,_0x2b278f={},_0x519e97={};_0x40774a<_0xa288f7[_0xd4cf('0x41')];_0x40774a+=0x1){_0x2b278f=_0xa288f7[_0x40774a];if(_['isUndefined'](_0x40fe90[_0xd4cf('0x1d')][_0x2b278f['id']])){_0x40fe90[_0xd4cf('0x1d')][_0x2b278f['id']]=new SalesforceAccount(_0x2b278f);}else{_0x40fe90['mergeFromDatabase'](_0x40fe90[_0xd4cf('0x1d')][_0x2b278f['id']],_0x2b278f);}}}return _0x40fe90['salesforceAccounts'];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x4b')]=function(){var _0x4a8f62=this;return function(_0x43a8c8){if(_0x43a8c8){freeIsNotKey(_0x43a8c8,_0x4a8f62[_0xd4cf('0x4c')],'id');for(var _0x5dfcf7=0x0,_0x80e614={},_0xdf866a={};_0x5dfcf7<_0x43a8c8[_0xd4cf('0x41')];_0x5dfcf7+=0x1){_0x80e614=_0x43a8c8[_0x5dfcf7];if(_[_0xd4cf('0x45')](_0x4a8f62[_0xd4cf('0x4c')][_0x80e614['id']])){_0x4a8f62[_0xd4cf('0x4c')][_0x80e614['id']]=new FreshdeskAccount(_0x80e614);}else{_0x4a8f62[_0xd4cf('0x3f')](_0x4a8f62[_0xd4cf('0x4c')][_0x80e614['id']],_0x80e614);}}}return _0x4a8f62[_0xd4cf('0x4c')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x4d')]=function(){var _0x156caf=this;return function(_0x530fdb){if(_0x530fdb){freeIsNotKey(_0x530fdb,_0x156caf[_0xd4cf('0x1e')],'id');for(var _0x281756=0x0,_0x16c316={},_0x346a25={};_0x281756<_0x530fdb[_0xd4cf('0x41')];_0x281756+=0x1){_0x16c316=_0x530fdb[_0x281756];if(_['isUndefined'](_0x156caf[_0xd4cf('0x1e')][_0x16c316['id']])){_0x156caf[_0xd4cf('0x1e')][_0x16c316['id']]=new ZohoAccount(_0x16c316);}else{_0x156caf[_0xd4cf('0x3f')](_0x156caf[_0xd4cf('0x1e')][_0x16c316['id']],_0x16c316);}}}return _0x156caf[_0xd4cf('0x1e')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x4e')]=function(){var _0x45184b=this;return function(_0x3600f9){if(_0x3600f9){freeIsNotKey(_0x3600f9,_0x45184b[_0xd4cf('0x1f')],'id');for(var _0x3170cc=0x0,_0x2d20ef={},_0x47df06={};_0x3170cc<_0x3600f9[_0xd4cf('0x41')];_0x3170cc+=0x1){_0x2d20ef=_0x3600f9[_0x3170cc];if(_['isUndefined'](_0x45184b['deskAccounts'][_0x2d20ef['id']])){_0x45184b[_0xd4cf('0x1f')][_0x2d20ef['id']]=new DeskAccount(_0x2d20ef);}else{_0x45184b[_0xd4cf('0x3f')](_0x45184b['deskAccounts'][_0x2d20ef['id']],_0x2d20ef);}}}return _0x45184b[_0xd4cf('0x1f')];};};Realtime['prototype'][_0xd4cf('0x4f')]=function(){var _0x567133=this;return function(_0x558c09){if(_0x558c09){freeIsNotKey(_0x558c09,_0x567133[_0xd4cf('0x50')],'id');for(var _0x31bdce=0x0,_0x387067={},_0x320f6c={};_0x31bdce<_0x558c09[_0xd4cf('0x41')];_0x31bdce+=0x1){_0x387067=_0x558c09[_0x31bdce];if(_[_0xd4cf('0x45')](_0x567133['sugarcrmAccounts'][_0x387067['id']])){_0x567133[_0xd4cf('0x50')][_0x387067['id']]=new SugarcrmAccount(_0x387067);}else{_0x567133['mergeFromDatabase'](_0x567133[_0xd4cf('0x50')][_0x387067['id']],_0x387067);}}}return _0x567133[_0xd4cf('0x50')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x51')]=function(){var _0x38864d=this;return function(_0x1d6087){if(_0x1d6087){freeIsNotKey(_0x1d6087,_0x38864d['vtigerAccounts'],'id');for(var _0x5edaf=0x0,_0x19c4c2={},_0x391829={};_0x5edaf<_0x1d6087[_0xd4cf('0x41')];_0x5edaf+=0x1){_0x19c4c2=_0x1d6087[_0x5edaf];if(_[_0xd4cf('0x45')](_0x38864d['vtigerAccounts'][_0x19c4c2['id']])){_0x38864d[_0xd4cf('0x20')][_0x19c4c2['id']]=new VtigerAccount(_0x19c4c2);}else{_0x38864d[_0xd4cf('0x3f')](_0x38864d[_0xd4cf('0x20')][_0x19c4c2['id']],_0x19c4c2);}}}return _0x38864d[_0xd4cf('0x20')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x52')]=function(){var _0x4189a6=this;return function(_0x14187b){if(_0x14187b){freeIsNotKey(_0x14187b,_0x4189a6[_0xd4cf('0x21')],'id');for(var _0x1bc114=0x0,_0x2ab76c={},_0x3cd2cd={};_0x1bc114<_0x14187b['length'];_0x1bc114+=0x1){_0x2ab76c=_0x14187b[_0x1bc114];if(_[_0xd4cf('0x45')](_0x4189a6[_0xd4cf('0x21')][_0x2ab76c['id']])){_0x4189a6[_0xd4cf('0x21')][_0x2ab76c['id']]=new ServicenowAccount(_0x2ab76c);}else{_0x4189a6['mergeFromDatabase'](_0x4189a6[_0xd4cf('0x21')][_0x2ab76c['id']],_0x2ab76c);}}}return _0x4189a6[_0xd4cf('0x21')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x53')]=function(){var _0x407e0a=this;return function(_0x25e81a){if(_0x25e81a){freeIsNotKey(_0x25e81a,_0x407e0a[_0xd4cf('0x22')],'id');for(var _0x1576aa=0x0,_0x4957ca={},_0x1f0f57={};_0x1576aa<_0x25e81a[_0xd4cf('0x41')];_0x1576aa+=0x1){_0x4957ca=_0x25e81a[_0x1576aa];if(_[_0xd4cf('0x45')](_0x407e0a[_0xd4cf('0x22')][_0x4957ca['id']])){_0x407e0a[_0xd4cf('0x22')][_0x4957ca['id']]=new Dynamics365Account(_0x4957ca);}else{_0x407e0a[_0xd4cf('0x3f')](_0x407e0a[_0xd4cf('0x22')][_0x4957ca['id']],_0x4957ca);}}}return _0x407e0a['dynamics365Accounts'];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x54')]=function(){var _0x5a06bb=this;return function(_0x5837d8){if(_0x5837d8){freeIsNotKey(_0x5837d8,_0x5a06bb[_0xd4cf('0x23')],'id');for(var _0x169e33=0x0,_0x1e4b3a={},_0x4a60cc={};_0x169e33<_0x5837d8[_0xd4cf('0x41')];_0x169e33+=0x1){_0x1e4b3a=_0x5837d8[_0x169e33];if(_['isUndefined'](_0x5a06bb['freshsalesAccounts'][_0x1e4b3a['id']])){_0x5a06bb[_0xd4cf('0x23')][_0x1e4b3a['id']]=new FreshsalesAccount(_0x1e4b3a);}else{_0x5a06bb['mergeFromDatabase'](_0x5a06bb[_0xd4cf('0x23')][_0x1e4b3a['id']],_0x1e4b3a);}}}return _0x5a06bb[_0xd4cf('0x23')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x55')]=function(){var _0x532afb=this;return function(_0x3540fe){for(var _0x4aed33=0x0;_0x4aed33<_0x3540fe[_0xd4cf('0x41')];_0x4aed33+=0x1){_[_0xd4cf('0x56')](_0x532afb[_0xd4cf('0x14')][_0x3540fe[_0x4aed33]['name']],_0x3540fe[_0x4aed33]);}return _0x532afb[_0xd4cf('0x14')];};};Realtime['prototype'][_0xd4cf('0x57')]=function(){var _0x54b316=this;return function(_0x4f208a){clearVoiceQueues(_0x54b316[_0xd4cf('0x14')]);if(_0x4f208a){_0x4f208a=_[_0xd4cf('0x58')](_0x4f208a,_0xd4cf('0x59'));for(var _0x1c6eda in _0x4f208a){if(_0x4f208a[_0xd4cf('0x28')](_0x1c6eda)){var _0x3a0ac5={};for(var _0x1d82d2=0x0;_0x1d82d2<_0x4f208a[_0x1c6eda][_0xd4cf('0x41')];_0x1d82d2+=0x1){var _0x34ba37=_0x4f208a[_0x1c6eda][_0x1d82d2]['queue'];if(_0x54b316['voiceQueues'][_0x34ba37]){if(_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x5a')]){_0x54b316[_0xd4cf('0x14')][_0x34ba37][_0xd4cf('0x32')]+=0x1;}if(_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x5b')]){_0x54b316[_0xd4cf('0x14')][_0x34ba37][_0xd4cf('0x33')]+=0x1;}_0x54b316[_0xd4cf('0x14')][_0x34ba37]['sumHoldTime']+=moment(_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x5c')])[_0xd4cf('0x5d')](moment(_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x5e')]),'seconds')||0x0;if(_0x1d82d2===_0x4f208a[_0x1c6eda]['length']-0x1){_0x54b316[_0xd4cf('0x14')][_0x34ba37]['sumDuration']+=moment(_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x5f')]||_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x60')]||_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x61')])[_0xd4cf('0x5d')](moment(_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x5e')]),_0xd4cf('0x62'))||0x0;_0x54b316[_0xd4cf('0x14')][_0x34ba37][_0xd4cf('0x2b')]+=0x1;if(_0x4f208a[_0x1c6eda][_0x1d82d2]['queuecallercomplete']){_0x54b316[_0xd4cf('0x14')][_0x34ba37][_0xd4cf('0x2c')]+=0x1;_0x54b316[_0xd4cf('0x14')][_0x34ba37][_0xd4cf('0x2f')]+=moment(_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x5f')])[_0xd4cf('0x5d')](moment(_0x4f208a[_0x1c6eda][_0x1d82d2][_0xd4cf('0x5c')]),_0xd4cf('0x62'))||0x0;}}else{_0x54b316[_0xd4cf('0x14')][_0x34ba37][_0xd4cf('0x2e')]+=_0x54b316['voiceQueues'][_0x34ba37][_0xd4cf('0x2d')]||0x0;}}}}}}return _0x54b316['voiceQueues'];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x811489=this;return function(_0x1f545a){clearVoiceCallReports(_0x811489['outbound']);if(_0x1f545a){for(var _0x848234=0x0;_0x848234<_0x1f545a['length'];_0x848234+=0x1){_0x811489[_0xd4cf('0x17')]['total']+=0x1;_0x811489[_0xd4cf('0x17')]['sumDuration']+=_0x1f545a[_0x848234][_0xd4cf('0x63')];if(_0x1f545a[_0x848234][_0xd4cf('0x64')]===_0xd4cf('0x65')){_0x811489['outbound'][_0xd4cf('0x2c')]+=0x1;_0x811489['outbound']['sumHoldTime']+=_0x1f545a[_0x848234][_0xd4cf('0x63')]-_0x1f545a[_0x848234][_0xd4cf('0x66')]||0x0;_0x811489[_0xd4cf('0x17')][_0xd4cf('0x2f')]+=_0x1f545a[_0x848234]['billableseconds'];}}}return _0x811489[_0xd4cf('0x17')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x67')]=function(){var _0x333105=this;return function(_0x5b5e32){if(_0x5b5e32){freeIsNotKey(_0x5b5e32,_0x333105['campaigns'],_0xd4cf('0x27'));for(var _0x2bb9e8=0x0,_0x43fba8={};_0x2bb9e8<_0x5b5e32['length'];_0x2bb9e8+=0x1){_0x43fba8=_0x5b5e32[_0x2bb9e8];if(_[_0xd4cf('0x45')](_0x333105[_0xd4cf('0x68')][_0x43fba8[_0xd4cf('0x27')]])){_0x333105['campaigns'][_0x43fba8[_0xd4cf('0x27')]]=new Campaign(_0x43fba8);}else{_0x333105[_0xd4cf('0x3f')](_0x333105[_0xd4cf('0x68')][_0x43fba8[_0xd4cf('0x27')]],_0x43fba8);_0x333105[_0xd4cf('0x68')][_0x43fba8['name']][_0xd4cf('0x69')]=_0x43fba8[_0xd4cf('0x6a')]?_0x43fba8[_0xd4cf('0x6a')]['name']:undefined;}}}return _0x333105[_0xd4cf('0x68')];};};Realtime[_0xd4cf('0x3e')][_0xd4cf('0x6b')]=function(){var _0x5a11f0=this;return function(_0x447bc6){if(_0x447bc6){freeIsNotKey(_0x447bc6,_0x5a11f0[_0xd4cf('0x6c')],'id');for(var _0x58c94e=0x0,_0x157b88={};_0x58c94e<_0x447bc6[_0xd4cf('0x41')];_0x58c94e+=0x1){_0x157b88=_0x447bc6[_0x58c94e];if(_[_0xd4cf('0x45')](_0x5a11f0[_0xd4cf('0x6c')][_0x157b88['id']])){_0x5a11f0[_0xd4cf('0x6c')][_0x157b88['id']]=new VoiceExtension(_0x157b88);}else{_0x5a11f0[_0xd4cf('0x3f')](_0x5a11f0['voiceExtensions'][_0x157b88['id']],_0x157b88);}}}return _0x5a11f0[_0xd4cf('0x6c')];};};Realtime['prototype'][_0xd4cf('0x6d')]=function(){var _0x51ff92=this;return function(_0x5cb7cd){clearCampaigns(_0x51ff92[_0xd4cf('0x68')]);for(var _0x34a8b8=0x0;_0x34a8b8<_0x5cb7cd[_0xd4cf('0x41')];_0x34a8b8+=0x1){_[_0xd4cf('0x56')](_0x51ff92['campaigns'][_0x5cb7cd[_0x34a8b8][_0xd4cf('0x27')]],_0x5cb7cd[_0x34a8b8]);}return _0x51ff92[_0xd4cf('0x68')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x2002c3=this;return function(_0x52f35f){if(_0x52f35f){freeIsNotKey(_0x52f35f,_0x2002c3['faxAccounts'],'id');for(var _0x10667a=0x0,_0x5a0b8e={},_0x140f85={};_0x10667a<_0x52f35f[_0xd4cf('0x41')];_0x10667a+=0x1){_0x5a0b8e=_0x52f35f[_0x10667a];if(_['isUndefined'](_0x2002c3[_0xd4cf('0x6e')][_0x5a0b8e['id']])){_0x2002c3[_0xd4cf('0x6e')][_0x5a0b8e['id']]=new FaxAccount(_0x5a0b8e);}else{_0x2002c3['mergeFromDatabase'](_0x2002c3['faxAccounts'][_0x5a0b8e['id']],_0x5a0b8e);}}}return _0x2002c3[_0xd4cf('0x6e')];};};module[_0xd4cf('0x6f')]=Realtime;
\ No newline at end of file
+var _0x70ed=['exports','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','SIP/%s','name','isNil','format','interface','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','length','telephones','initTrunks','isUndefined','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','initVoiceCallReports','disposition','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x164b84,_0x5296d2){var _0x46822b=function(_0x3998d8){while(--_0x3998d8){_0x164b84['push'](_0x164b84['shift']());}};_0x46822b(++_0x5296d2);}(_0x70ed,0x1b5));var _0xd70e=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0x70ed[_0x263a2f];return _0x8020e8;};'use strict';var BPromise=require(_0xd70e('0x0'));var util=require(_0xd70e('0x1'));var _=require(_0xd70e('0x2'));var moment=require(_0xd70e('0x3'));var Agent=require(_0xd70e('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0xd70e('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xd70e('0x6'));var Template=require(_0xd70e('0x7'));var Campaign=require(_0xd70e('0x8'));var VoiceExtension=require(_0xd70e('0x9'));var ZendeskAccount=require(_0xd70e('0xa'));var SalesforceAccount=require(_0xd70e('0xb'));var FreshdeskAccount=require(_0xd70e('0xc'));var SugarcrmAccount=require(_0xd70e('0xd'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xd70e('0xe'));var VtigerAccount=require(_0xd70e('0xf'));var ServicenowAccount=require(_0xd70e('0x10'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xd70e('0x11'));var FaxAccount=require(_0xd70e('0x12'));var Realtime=function(){this[_0xd70e('0x13')]={};this['telephones']={};this[_0xd70e('0x14')]={};this[_0xd70e('0x15')]={};this[_0xd70e('0x16')]={};this[_0xd70e('0x17')]={};this[_0xd70e('0x18')]={};this[_0xd70e('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xd70e('0x1a')]={};this[_0xd70e('0x1b')]={};this[_0xd70e('0x1c')]={};this[_0xd70e('0x1d')]={};this[_0xd70e('0x1e')]={};this[_0xd70e('0x1f')]={};this[_0xd70e('0x20')]={};this[_0xd70e('0x21')]={};this['zohoAccounts']={};this[_0xd70e('0x22')]={};this['vtigerAccounts']={};this[_0xd70e('0x23')]={};this[_0xd70e('0x24')]={};this['freshsalesAccounts']={};this[_0xd70e('0x25')]={};};function freeIsNotKey(_0xa2d53b,_0x3872bd,_0x221f5f){var _0x1f20b2=_['mapKeys'](_0xa2d53b,function(_0x26c29f,_0xa48a20){return _0x26c29f[_0x221f5f];});for(var _0x4be686 in _0x3872bd){if(_0x3872bd[_0xd70e('0x26')](_0x4be686)){if(!_0x1f20b2[_0x4be686]){delete _0x3872bd[_0x4be686];}}}}function freeIsNotKeySip(_0x2ea429,_0x4b3730){var _0x291c0c=_[_0xd70e('0x27')](_0x2ea429,function(_0x37f8fd,_0x5b32d6){return util['format'](_0xd70e('0x28'),_0x37f8fd[_0xd70e('0x29')]);});for(var _0x38f67f in _0x4b3730){if(_0x4b3730[_0xd70e('0x26')](_0x38f67f)){if(!_0x291c0c[_0x38f67f]){delete _0x4b3730[_0x38f67f];}}}}function freeIsNotKeyAgent(_0x318fe4,_0x58ceea){var _0x84edb=_['mapKeys'](_0x318fe4,function(_0x2a4a0a,_0x553394){var _0x2c03e3=_[_0xd70e('0x2a')](_0x2a4a0a['interface'])?util[_0xd70e('0x2b')](_0xd70e('0x28'),_0x2a4a0a[_0xd70e('0x29')]):_0x2a4a0a[_0xd70e('0x2c')];return _0x2c03e3;});for(var _0x417f2f in _0x58ceea){if(_0x58ceea['hasOwnProperty'](_0x417f2f)){if(!_0x84edb[_0x417f2f]){delete _0x58ceea[_0x417f2f];}}}}function clearVoiceCallReports(_0x457b2b){_0x457b2b[_0xd70e('0x2d')]=0x0;_0x457b2b[_0xd70e('0x2e')]=0x0;_0x457b2b[_0xd70e('0x2f')]=0x0;_0x457b2b[_0xd70e('0x30')]=0x0;_0x457b2b['sumBillable']=0x0;}function clearCampaigns(_0xd76889){if(!_['isEmpty'](_0xd76889)){for(var _0x169465 in _0xd76889){if(_0xd76889[_0xd70e('0x26')](_0x169465)){_0xd76889[_0x169465][_0xd70e('0x31')]=0x0;_0xd76889[_0x169465][_0xd70e('0x32')]=0x0;}}}}function clearVoiceQueues(_0x493e34){if(!_[_0xd70e('0x33')](_0x493e34)){for(var _0x12cf3c in _0x493e34){if(_0x493e34[_0xd70e('0x26')](_0x12cf3c)){_0x493e34[_0x12cf3c][_0xd70e('0x2d')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x2e')]=0x0;_0x493e34[_0x12cf3c]['unmanaged']=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x34')]=0x0;_0x493e34[_0x12cf3c]['sumHoldTime']=0x0;_0x493e34[_0x12cf3c]['sumDuration']=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x35')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x36')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x37')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x38')]=0x0;_0x493e34[_0x12cf3c]['outboundCongestionCallsDay']=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x39')]=0x0;_0x493e34[_0x12cf3c]['outboundUnknownCallsDay']=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x3a')]=0x0;_0x493e34[_0x12cf3c]['outboundDropCallsDayCallersExit']=0x0;_0x493e34[_0x12cf3c]['outboundBlacklistCallsDay']=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x3b')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x3c')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x3d')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x36')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x3e')]=0x0;_0x493e34[_0x12cf3c][_0xd70e('0x3f')]=!![];}}}}Realtime['prototype'][_0xd70e('0x40')]=function(_0x42f78e,_0x1c38bd){for(var _0x56eb4d in _0x1c38bd){if(_0x42f78e[_0xd70e('0x26')](_0x56eb4d)){_0x42f78e[_0x56eb4d]=_0x1c38bd[_0x56eb4d];}}};Realtime[_0xd70e('0x41')]['initAgents']=function(){var _0x37777c=this;return function(_0x140b34){if(_0x140b34){freeIsNotKeyAgent(_0x140b34,_0x37777c[_0xd70e('0x13')]);for(var _0x4b30c5=0x0,_0x28e2cb={},_0x5ef330={};_0x4b30c5<_0x140b34[_0xd70e('0x42')];_0x4b30c5+=0x1){_0x28e2cb=_0x140b34[_0x4b30c5];var _0x1dccc9=_[_0xd70e('0x2a')](_0x28e2cb['interface'])?util[_0xd70e('0x2b')](_0xd70e('0x28'),_0x28e2cb['name']):_0x28e2cb[_0xd70e('0x2c')];if(_['isUndefined'](_0x37777c[_0xd70e('0x13')][_0x1dccc9])){_0x37777c[_0xd70e('0x13')][_0x1dccc9]=new Agent(_0x28e2cb);}else{_0x37777c[_0xd70e('0x40')](_0x37777c[_0xd70e('0x13')][_0x1dccc9],_0x28e2cb);}}}return _0x37777c[_0xd70e('0x13')];};};Realtime[_0xd70e('0x41')]['initTelephones']=function(){var _0x4f8a59=this;return function(_0x2cbd27){if(_0x2cbd27){freeIsNotKeySip(_0x2cbd27,_0x4f8a59[_0xd70e('0x43')]);for(var _0x2d473f=0x0,_0x580290={},_0x4fddf1={};_0x2d473f<_0x2cbd27['length'];_0x2d473f+=0x1){_0x580290=_0x2cbd27[_0x2d473f];if(_['isUndefined'](_0x4f8a59[_0xd70e('0x43')][util[_0xd70e('0x2b')]('SIP/%s',_0x580290[_0xd70e('0x29')])])){_0x4f8a59[_0xd70e('0x43')][util[_0xd70e('0x2b')](_0xd70e('0x28'),_0x580290[_0xd70e('0x29')])]=new Telephone(_0x580290);}else{_0x4f8a59[_0xd70e('0x40')](_0x4f8a59['telephones'][util[_0xd70e('0x2b')](_0xd70e('0x28'),_0x580290['name'])],_0x580290);}}}return _0x4f8a59[_0xd70e('0x43')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x44')]=function(){var _0x1bd314=this;return function(_0x22a6d6){if(_0x22a6d6){freeIsNotKeySip(_0x22a6d6,_0x1bd314[_0xd70e('0x14')]);for(var _0x3edeba=0x0,_0x76d76a={},_0x285497={};_0x3edeba<_0x22a6d6['length'];_0x3edeba+=0x1){_0x76d76a=_0x22a6d6[_0x3edeba];if(_[_0xd70e('0x45')](_0x1bd314['trunks'][util['format']('SIP/%s',_0x76d76a[_0xd70e('0x29')])])){_0x1bd314[_0xd70e('0x14')][util['format'](_0xd70e('0x28'),_0x76d76a['name'])]=new Trunk(_0x76d76a);}else{_0x1bd314['mergeFromDatabase'](_0x1bd314[_0xd70e('0x14')][util[_0xd70e('0x2b')](_0xd70e('0x28'),_0x76d76a[_0xd70e('0x29')])],_0x76d76a);}}}return _0x1bd314[_0xd70e('0x14')];};};Realtime['prototype'][_0xd70e('0x46')]=function(){var _0x2d3dad=this;return function(_0x1fba18){if(_0x1fba18){freeIsNotKey(_0x1fba18,_0x2d3dad[_0xd70e('0x15')],_0xd70e('0x29'));for(var _0x12b393=0x0,_0x160923={},_0x297e63={};_0x12b393<_0x1fba18['length'];_0x12b393+=0x1){_0x160923=_0x1fba18[_0x12b393];if(_[_0xd70e('0x45')](_0x2d3dad['voiceQueues'][_0x160923[_0xd70e('0x29')]])){_0x2d3dad[_0xd70e('0x15')][_0x160923['name']]=new VoiceQueue(_0x160923);}else{_0x2d3dad['mergeFromDatabase'](_0x2d3dad[_0xd70e('0x15')][_0x160923[_0xd70e('0x29')]],_0x160923);}}}return _0x2d3dad['voiceQueues'];};};Realtime[_0xd70e('0x41')][_0xd70e('0x47')]=function(){var _0x546452=this;return function(_0x33968c){if(_0x33968c){freeIsNotKey(_0x33968c,_0x546452[_0xd70e('0x16')],'id');for(var _0x5e830a=0x0,_0x136433={},_0x210389={};_0x5e830a<_0x33968c['length'];_0x5e830a+=0x1){_0x136433=_0x33968c[_0x5e830a];if(_[_0xd70e('0x45')](_0x546452['triggers'][_0x136433['id']])){_0x546452[_0xd70e('0x16')][_0x136433['id']]=new Trigger(_0x136433);}else{_0x546452[_0xd70e('0x40')](_0x546452[_0xd70e('0x16')][_0x136433['id']],_0x136433);}}}return _0x546452['triggers'];};};Realtime['prototype'][_0xd70e('0x48')]=function(){var _0xcb0de0=this;return function(_0x38c76e){if(_0x38c76e){freeIsNotKey(_0x38c76e,_0xcb0de0['templates'],'id');for(var _0x428522=0x0,_0x2e7fb0={},_0x1d53ca={};_0x428522<_0x38c76e[_0xd70e('0x42')];_0x428522+=0x1){_0x2e7fb0=_0x38c76e[_0x428522];if(_[_0xd70e('0x45')](_0xcb0de0[_0xd70e('0x18')][_0x2e7fb0['id']])){_0xcb0de0[_0xd70e('0x18')][_0x2e7fb0['id']]=new Template(_0x2e7fb0);}else{_0xcb0de0['mergeFromDatabase'](_0xcb0de0[_0xd70e('0x18')][_0x2e7fb0['id']],_0x2e7fb0);}}}return _0xcb0de0[_0xd70e('0x18')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x49')]=function(){var _0x41a91a=this;return function(_0x51361e){if(_0x51361e){freeIsNotKey(_0x51361e,_0x41a91a[_0xd70e('0x1e')],'id');for(var _0x5000bc=0x0,_0x206767={},_0x43c443={};_0x5000bc<_0x51361e['length'];_0x5000bc+=0x1){_0x206767=_0x51361e[_0x5000bc];if(_[_0xd70e('0x45')](_0x41a91a[_0xd70e('0x1e')][_0x206767['id']])){_0x41a91a[_0xd70e('0x1e')][_0x206767['id']]=new ZendeskAccount(_0x206767);}else{_0x41a91a[_0xd70e('0x40')](_0x41a91a[_0xd70e('0x1e')][_0x206767['id']],_0x206767);}}}return _0x41a91a[_0xd70e('0x1e')];};};Realtime['prototype'][_0xd70e('0x4a')]=function(){var _0x44e99f=this;return function(_0x552efc){if(_0x552efc){freeIsNotKey(_0x552efc,_0x44e99f[_0xd70e('0x1f')],'id');for(var _0x10a00f=0x0,_0x41027f={},_0x16e90b={};_0x10a00f<_0x552efc[_0xd70e('0x42')];_0x10a00f+=0x1){_0x41027f=_0x552efc[_0x10a00f];if(_['isUndefined'](_0x44e99f[_0xd70e('0x1f')][_0x41027f['id']])){_0x44e99f[_0xd70e('0x1f')][_0x41027f['id']]=new SalesforceAccount(_0x41027f);}else{_0x44e99f['mergeFromDatabase'](_0x44e99f[_0xd70e('0x1f')][_0x41027f['id']],_0x41027f);}}}return _0x44e99f[_0xd70e('0x1f')];};};Realtime[_0xd70e('0x41')]['initFreshdeskAccounts']=function(){var _0x13e103=this;return function(_0x2d80fa){if(_0x2d80fa){freeIsNotKey(_0x2d80fa,_0x13e103[_0xd70e('0x21')],'id');for(var _0x335701=0x0,_0x290eae={},_0x32272c={};_0x335701<_0x2d80fa[_0xd70e('0x42')];_0x335701+=0x1){_0x290eae=_0x2d80fa[_0x335701];if(_[_0xd70e('0x45')](_0x13e103[_0xd70e('0x21')][_0x290eae['id']])){_0x13e103['freshdeskAccounts'][_0x290eae['id']]=new FreshdeskAccount(_0x290eae);}else{_0x13e103[_0xd70e('0x40')](_0x13e103[_0xd70e('0x21')][_0x290eae['id']],_0x290eae);}}}return _0x13e103[_0xd70e('0x21')];};};Realtime[_0xd70e('0x41')]['initZohoAccounts']=function(){var _0x4efef9=this;return function(_0x1f03ec){if(_0x1f03ec){freeIsNotKey(_0x1f03ec,_0x4efef9[_0xd70e('0x4b')],'id');for(var _0x5e0016=0x0,_0x291580={},_0x1be960={};_0x5e0016<_0x1f03ec['length'];_0x5e0016+=0x1){_0x291580=_0x1f03ec[_0x5e0016];if(_[_0xd70e('0x45')](_0x4efef9[_0xd70e('0x4b')][_0x291580['id']])){_0x4efef9[_0xd70e('0x4b')][_0x291580['id']]=new ZohoAccount(_0x291580);}else{_0x4efef9['mergeFromDatabase'](_0x4efef9[_0xd70e('0x4b')][_0x291580['id']],_0x291580);}}}return _0x4efef9[_0xd70e('0x4b')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x4c')]=function(){var _0x296edf=this;return function(_0x192a5a){if(_0x192a5a){freeIsNotKey(_0x192a5a,_0x296edf[_0xd70e('0x22')],'id');for(var _0x34f0ed=0x0,_0x23d04c={},_0x5e8b1c={};_0x34f0ed<_0x192a5a[_0xd70e('0x42')];_0x34f0ed+=0x1){_0x23d04c=_0x192a5a[_0x34f0ed];if(_[_0xd70e('0x45')](_0x296edf[_0xd70e('0x22')][_0x23d04c['id']])){_0x296edf['deskAccounts'][_0x23d04c['id']]=new DeskAccount(_0x23d04c);}else{_0x296edf[_0xd70e('0x40')](_0x296edf[_0xd70e('0x22')][_0x23d04c['id']],_0x23d04c);}}}return _0x296edf[_0xd70e('0x22')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x4d')]=function(){var _0xc5758=this;return function(_0x4ad73d){if(_0x4ad73d){freeIsNotKey(_0x4ad73d,_0xc5758[_0xd70e('0x20')],'id');for(var _0x4681d9=0x0,_0x3f5730={},_0x54e4b2={};_0x4681d9<_0x4ad73d[_0xd70e('0x42')];_0x4681d9+=0x1){_0x3f5730=_0x4ad73d[_0x4681d9];if(_['isUndefined'](_0xc5758[_0xd70e('0x20')][_0x3f5730['id']])){_0xc5758['sugarcrmAccounts'][_0x3f5730['id']]=new SugarcrmAccount(_0x3f5730);}else{_0xc5758['mergeFromDatabase'](_0xc5758[_0xd70e('0x20')][_0x3f5730['id']],_0x3f5730);}}}return _0xc5758['sugarcrmAccounts'];};};Realtime['prototype'][_0xd70e('0x4e')]=function(){var _0x5d0746=this;return function(_0x34867a){if(_0x34867a){freeIsNotKey(_0x34867a,_0x5d0746[_0xd70e('0x4f')],'id');for(var _0x579a5b=0x0,_0x355572={},_0x1c35ae={};_0x579a5b<_0x34867a[_0xd70e('0x42')];_0x579a5b+=0x1){_0x355572=_0x34867a[_0x579a5b];if(_[_0xd70e('0x45')](_0x5d0746['vtigerAccounts'][_0x355572['id']])){_0x5d0746[_0xd70e('0x4f')][_0x355572['id']]=new VtigerAccount(_0x355572);}else{_0x5d0746[_0xd70e('0x40')](_0x5d0746[_0xd70e('0x4f')][_0x355572['id']],_0x355572);}}}return _0x5d0746[_0xd70e('0x4f')];};};Realtime[_0xd70e('0x41')]['initServicenowAccounts']=function(){var _0x553841=this;return function(_0x5471a6){if(_0x5471a6){freeIsNotKey(_0x5471a6,_0x553841[_0xd70e('0x23')],'id');for(var _0xde12b9=0x0,_0x5812be={},_0x23fb35={};_0xde12b9<_0x5471a6['length'];_0xde12b9+=0x1){_0x5812be=_0x5471a6[_0xde12b9];if(_[_0xd70e('0x45')](_0x553841[_0xd70e('0x23')][_0x5812be['id']])){_0x553841['servicenowAccounts'][_0x5812be['id']]=new ServicenowAccount(_0x5812be);}else{_0x553841['mergeFromDatabase'](_0x553841[_0xd70e('0x23')][_0x5812be['id']],_0x5812be);}}}return _0x553841[_0xd70e('0x23')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x50')]=function(){var _0x67c8a4=this;return function(_0x4d624c){if(_0x4d624c){freeIsNotKey(_0x4d624c,_0x67c8a4[_0xd70e('0x24')],'id');for(var _0x5e36de=0x0,_0x384d06={},_0x2427b0={};_0x5e36de<_0x4d624c['length'];_0x5e36de+=0x1){_0x384d06=_0x4d624c[_0x5e36de];if(_[_0xd70e('0x45')](_0x67c8a4[_0xd70e('0x24')][_0x384d06['id']])){_0x67c8a4[_0xd70e('0x24')][_0x384d06['id']]=new Dynamics365Account(_0x384d06);}else{_0x67c8a4[_0xd70e('0x40')](_0x67c8a4[_0xd70e('0x24')][_0x384d06['id']],_0x384d06);}}}return _0x67c8a4[_0xd70e('0x24')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x51')]=function(){var _0x4a29e1=this;return function(_0x1d0079){if(_0x1d0079){freeIsNotKey(_0x1d0079,_0x4a29e1['freshsalesAccounts'],'id');for(var _0x1909a4=0x0,_0x129356={},_0x154821={};_0x1909a4<_0x1d0079['length'];_0x1909a4+=0x1){_0x129356=_0x1d0079[_0x1909a4];if(_['isUndefined'](_0x4a29e1[_0xd70e('0x52')][_0x129356['id']])){_0x4a29e1[_0xd70e('0x52')][_0x129356['id']]=new FreshsalesAccount(_0x129356);}else{_0x4a29e1[_0xd70e('0x40')](_0x4a29e1['freshsalesAccounts'][_0x129356['id']],_0x129356);}}}return _0x4a29e1[_0xd70e('0x52')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x53')]=function(){var _0x3eccd2=this;return function(_0x5a2f64){for(var _0x466825=0x0;_0x466825<_0x5a2f64[_0xd70e('0x42')];_0x466825+=0x1){_[_0xd70e('0x54')](_0x3eccd2['voiceQueues'][_0x5a2f64[_0x466825]['name']],_0x5a2f64[_0x466825]);}return _0x3eccd2['voiceQueues'];};};Realtime[_0xd70e('0x41')][_0xd70e('0x55')]=function(){var _0x2a516d=this;return function(_0x560419){clearVoiceQueues(_0x2a516d[_0xd70e('0x15')]);if(_0x560419){_0x560419=_[_0xd70e('0x56')](_0x560419,_0xd70e('0x57'));for(var _0x147f9d in _0x560419){if(_0x560419[_0xd70e('0x26')](_0x147f9d)){var _0x23ea7b={};for(var _0x4ce985=0x0;_0x4ce985<_0x560419[_0x147f9d][_0xd70e('0x42')];_0x4ce985+=0x1){var _0xe108b2=_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x58')];if(_0x2a516d[_0xd70e('0x15')][_0xe108b2]){if(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x59')]){_0x2a516d['voiceQueues'][_0xe108b2][_0xd70e('0x5a')]+=0x1;}if(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x5b')]){_0x2a516d['voiceQueues'][_0xe108b2]['abandoned']+=0x1;}_0x2a516d[_0xd70e('0x15')][_0xe108b2][_0xd70e('0x2f')]+=moment(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x5c')])['diff'](moment(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x5d')]),_0xd70e('0x5e'))||0x0;if(_0x4ce985===_0x560419[_0x147f9d]['length']-0x1){_0x2a516d[_0xd70e('0x15')][_0xe108b2]['sumDuration']+=moment(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x5f')]||_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x60')]||_0x560419[_0x147f9d][_0x4ce985]['queuecallerexitAt'])[_0xd70e('0x61')](moment(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x5d')]),_0xd70e('0x5e'))||0x0;_0x2a516d[_0xd70e('0x15')][_0xe108b2]['total']+=0x1;if(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x62')]){_0x2a516d[_0xd70e('0x15')][_0xe108b2]['answered']+=0x1;_0x2a516d[_0xd70e('0x15')][_0xe108b2][_0xd70e('0x35')]+=moment(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x5f')])[_0xd70e('0x61')](moment(_0x560419[_0x147f9d][_0x4ce985][_0xd70e('0x5c')]),'seconds')||0x0;}}else{_0x2a516d[_0xd70e('0x15')][_0xe108b2][_0xd70e('0x30')]+=_0x2a516d['voiceQueues'][_0xe108b2]['sumHoldTime']||0x0;}}}}}}return _0x2a516d[_0xd70e('0x15')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x63')]=function(){var _0x234018=this;return function(_0x2ee9df){clearVoiceCallReports(_0x234018[_0xd70e('0x19')]);if(_0x2ee9df){for(var _0x4094d0=0x0;_0x4094d0<_0x2ee9df[_0xd70e('0x42')];_0x4094d0+=0x1){_0x234018[_0xd70e('0x19')][_0xd70e('0x2d')]+=0x1;_0x234018[_0xd70e('0x19')][_0xd70e('0x30')]+=_0x2ee9df[_0x4094d0]['duration'];if(_0x2ee9df[_0x4094d0][_0xd70e('0x64')]==='ANSWERED'){_0x234018[_0xd70e('0x19')]['answered']+=0x1;_0x234018[_0xd70e('0x19')]['sumHoldTime']+=_0x2ee9df[_0x4094d0][_0xd70e('0x65')]-_0x2ee9df[_0x4094d0][_0xd70e('0x66')]||0x0;_0x234018[_0xd70e('0x19')]['sumBillable']+=_0x2ee9df[_0x4094d0][_0xd70e('0x66')];}}}return _0x234018[_0xd70e('0x19')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x67')]=function(){var _0x581879=this;return function(_0x1d6eb4){if(_0x1d6eb4){freeIsNotKey(_0x1d6eb4,_0x581879[_0xd70e('0x17')],'name');for(var _0x267d7b=0x0,_0x3b25d3={};_0x267d7b<_0x1d6eb4[_0xd70e('0x42')];_0x267d7b+=0x1){_0x3b25d3=_0x1d6eb4[_0x267d7b];if(_[_0xd70e('0x45')](_0x581879[_0xd70e('0x17')][_0x3b25d3[_0xd70e('0x29')]])){_0x581879[_0xd70e('0x17')][_0x3b25d3['name']]=new Campaign(_0x3b25d3);}else{_0x581879[_0xd70e('0x40')](_0x581879[_0xd70e('0x17')][_0x3b25d3[_0xd70e('0x29')]],_0x3b25d3);_0x581879[_0xd70e('0x17')][_0x3b25d3[_0xd70e('0x29')]][_0xd70e('0x68')]=_0x3b25d3[_0xd70e('0x69')]?_0x3b25d3[_0xd70e('0x69')][_0xd70e('0x29')]:undefined;}}}return _0x581879[_0xd70e('0x17')];};};Realtime[_0xd70e('0x41')][_0xd70e('0x6a')]=function(){var _0x9ffb91=this;return function(_0x460a3e){if(_0x460a3e){freeIsNotKey(_0x460a3e,_0x9ffb91['voiceExtensions'],'id');for(var _0x5894fb=0x0,_0x5daa2c={};_0x5894fb<_0x460a3e['length'];_0x5894fb+=0x1){_0x5daa2c=_0x460a3e[_0x5894fb];if(_['isUndefined'](_0x9ffb91[_0xd70e('0x6b')][_0x5daa2c['id']])){_0x9ffb91[_0xd70e('0x6b')][_0x5daa2c['id']]=new VoiceExtension(_0x5daa2c);}else{_0x9ffb91['mergeFromDatabase'](_0x9ffb91['voiceExtensions'][_0x5daa2c['id']],_0x5daa2c);}}}return _0x9ffb91[_0xd70e('0x6b')];};};Realtime[_0xd70e('0x41')]['initCampaignHopperHistory']=function(){var _0x22a620=this;return function(_0x5122b8){clearCampaigns(_0x22a620[_0xd70e('0x17')]);for(var _0x5e23f4=0x0;_0x5e23f4<_0x5122b8['length'];_0x5e23f4+=0x1){_[_0xd70e('0x54')](_0x22a620[_0xd70e('0x17')][_0x5122b8[_0x5e23f4][_0xd70e('0x29')]],_0x5122b8[_0x5e23f4]);}return _0x22a620[_0xd70e('0x17')];};};Realtime[_0xd70e('0x41')]['initFaxAccounts']=function(){var _0x5d6af3=this;return function(_0x1796e1){if(_0x1796e1){freeIsNotKey(_0x1796e1,_0x5d6af3['faxAccounts'],'id');for(var _0x1380f4=0x0,_0x278497={},_0x22f915={};_0x1380f4<_0x1796e1[_0xd70e('0x42')];_0x1380f4+=0x1){_0x278497=_0x1796e1[_0x1380f4];if(_[_0xd70e('0x45')](_0x5d6af3[_0xd70e('0x25')][_0x278497['id']])){_0x5d6af3[_0xd70e('0x25')][_0x278497['id']]=new FaxAccount(_0x278497);}else{_0x5d6af3[_0xd70e('0x40')](_0x5d6af3[_0xd70e('0x25')][_0x278497['id']],_0x278497);}}}return _0x5d6af3[_0xd70e('0x25')];};};module[_0xd70e('0x6c')]=Realtime;
\ No newline at end of file
index 42c7f31..3b251cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a5c=['startsWith','Local','substring','indexOf','phone','lastIndexOf','membername','lodash','moment','../../../config/environment','ami','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','format','length','connectedlinenum','assigned','lastAssignedTo','interface','isNil','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','\x22%s\x22\x20<%s>','monitor','monitors','filename','createdAt','xcally-motion-dialer','forEach'];(function(_0x5a2aa4,_0x3135ca){var _0x4f2d61=function(_0x19929a){while(--_0x19929a){_0x5a2aa4['push'](_0x5a2aa4['shift']());}};_0x4f2d61(++_0x3135ca);}(_0x6a5c,0x192));var _0xc6a5=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x6a5c[_0x38b14f];return _0x22a324;};'use strict';var BPromise=require('bluebird');var _=require(_0xc6a5('0x0'));var moment=require(_0xc6a5('0x1'));var util=require('util');var config=require(_0xc6a5('0x2'));var logger=require('../../../config/logger')(_0xc6a5('0x3'));var ami=require(_0xc6a5('0x4'));var RpcVoiceAgentReport=require(_0xc6a5('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xc6a5('0x6'));var RpcVoiceQueueReport=require(_0xc6a5('0x7'));var RpcVoiceRecording=require(_0xc6a5('0x8'));var RpcVoiceTransferReport=require(_0xc6a5('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xc6a5('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xc6a5('0xb'));var UserReport=require(_0xc6a5('0xc'));function Report(_0xc53b66){this[_0xc6a5('0xd')]=_0xc53b66;this[_0xc6a5('0xe')]=_0xc53b66[_0xc6a5('0xe')];this[_0xc6a5('0xf')]=_0xc53b66[_0xc6a5('0xf')];}Report[_0xc6a5('0x10')]['sync']=function(_0x47dc7a){var _0x5ce5a4=new VoiceQueueReport(this[_0xc6a5('0xd')]);var _0x1b4409=new VoiceAgentReport(this['realtime']);var _0x37541d=new VoiceDialReport(this['realtime']);var _0x329a64=new VoiceCallReport(this[_0xc6a5('0xd')]);var _0x4aaaf0=new UserReport(this[_0xc6a5('0xd')]);if(config[_0xc6a5('0x11')]&&config['xdr'][_0xc6a5('0x12')]){ami['on'](_0xc6a5('0x13'),this[_0xc6a5('0x14')][_0xc6a5('0x15')](this));ami['on']('custom:voiceCallReport',this[_0xc6a5('0x16')][_0xc6a5('0x15')](this));ami['on'](_0xc6a5('0x17'),this[_0xc6a5('0x18')][_0xc6a5('0x15')](this));ami['on']('custom:voiceDialReport',this[_0xc6a5('0x19')][_0xc6a5('0x15')](this));ami['on']('blindtransfer',this[_0xc6a5('0x1a')][_0xc6a5('0x15')](this));ami['on'](_0xc6a5('0x1b'),this[_0xc6a5('0x1c')][_0xc6a5('0x15')](this));}};Report[_0xc6a5('0x10')][_0xc6a5('0x1d')]=function(_0x25c981){var _0xfc54b5=undefined;_0xfc54b5=_[_0xc6a5('0x1e')](this[_0xc6a5('0xe')],function(_0x297d3d){return _0x297d3d[_0xc6a5('0x1f')]==_0x25c981||_0x297d3d['name']==_0x25c981;});if(_['isNil'](_0xfc54b5)){var _0x370a5b=_[_0xc6a5('0x1e')](this[_0xc6a5('0xf')],function(_0x3af717){return _0x3af717[_0xc6a5('0x1f')]==_0x25c981||_0x3af717[_0xc6a5('0x20')]==_0x25c981;});if(_0x370a5b){_0xfc54b5=_[_0xc6a5('0x1e')](this[_0xc6a5('0xe')],function(_0x2c413a){return _0x2c413a['interface']==util[_0xc6a5('0x21')]('SIP/%s',_0x370a5b[_0xc6a5('0x20')]);});}}return _0xfc54b5;};Report['prototype'][_0xc6a5('0x14')]=function(_0x5425f5){for(var _0xed9411=0x0;_0xed9411<_0x5425f5[_0xc6a5('0x22')];_0xed9411+=0x1){var _0xacb8bc=this['findAgent'](_0x5425f5[_0xed9411][_0xc6a5('0x23')]);if(_0xacb8bc){_0x5425f5[_0xed9411][_0xc6a5('0x1f')]=_0xacb8bc[_0xc6a5('0x1f')];_0x5425f5[_0xed9411][_0xc6a5('0x24')]=!![];_0x5425f5[_0xed9411][_0xc6a5('0x25')]=_0xacb8bc[_0xc6a5('0x20')];_0x5425f5[_0xed9411][_0xc6a5('0x26')]=_[_0xc6a5('0x27')](_0xacb8bc['interface'])?util[_0xc6a5('0x21')](_0xc6a5('0x28'),_0xacb8bc['name']):_0xacb8bc[_0xc6a5('0x26')];if(_0x5425f5[_0xed9411][_0xc6a5('0x29')]){_0x5425f5[_0xed9411][_0xc6a5('0x2a')]=moment()[_0xc6a5('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5425f5[_0xed9411][_0xc6a5('0x2b')]){_0x5425f5[_0xed9411][_0xc6a5('0x2c')]=moment()[_0xc6a5('0x21')](_0xc6a5('0x2d'));}RpcMemberReport['voiceQueueReport'](_0x5425f5[_0xed9411]);}RpcVoiceQueueReport[_0xc6a5('0x2e')](_0x5425f5[_0xed9411]);}};function extractCalleridNumber(_0x33bf1c){var _0x1b05d8=_0x33bf1c[_0xc6a5('0x2f')](/<(.*?)>/);return _0x1b05d8?_0x1b05d8[0x1]:_0x33bf1c;}Report[_0xc6a5('0x10')][_0xc6a5('0x16')]=function(_0x4440d0){_0x4440d0['destination']=_0x4440d0[_0xc6a5('0x30')]||_0x4440d0[_0xc6a5('0x31')];if(_0x4440d0[_0xc6a5('0x32')]=='dialer'){_0x4440d0[_0xc6a5('0x33')]=_0xc6a5('0x34');_0x4440d0[_0xc6a5('0x35')]=_0x4440d0[_0xc6a5('0x34')];if(_0x4440d0[_0xc6a5('0x36')]==_0xc6a5('0x37')){_0x4440d0['accountcode']='';_0x4440d0['destination']=extractCalleridNumber(_0x4440d0[_0xc6a5('0x38')]);}else if(_0x4440d0[_0xc6a5('0x36')]==_0xc6a5('0x39')){if(_0x4440d0[_0xc6a5('0x30')]==_0xc6a5('0x3a')){_0x4440d0[_0xc6a5('0x30')]=extractCalleridNumber(_0x4440d0[_0xc6a5('0x3b')]);_0x4440d0['calleridnum']=_0x4440d0[_0xc6a5('0x3c')];_0x4440d0[_0xc6a5('0x3d')]=[_0x4440d0[_0xc6a5('0x3e')],_0x4440d0[_0xc6a5('0x3e')]=_0x4440d0[_0xc6a5('0x3d')]][0x0];_0x4440d0[_0xc6a5('0x38')]=_0x4440d0[_0xc6a5('0x3b')];}else{_0x4440d0['destination']=_0x4440d0[_0xc6a5('0x3f')];_0x4440d0[_0xc6a5('0x3f')]=_0x4440d0[_0xc6a5('0x3c')];if(_0x4440d0[_0xc6a5('0x40')]=='ANSWERED'){_0x4440d0[_0xc6a5('0x1f')]=_0x4440d0['connectedlinenum'];}else{_0x4440d0[_0xc6a5('0x1f')]='';}}}}else{_0x4440d0[_0xc6a5('0x38')]=util[_0xc6a5('0x21')](_0xc6a5('0x41'),_0x4440d0['calleridname'],_0x4440d0[_0xc6a5('0x3f')]);}RpcVoiceCallReport[_0xc6a5('0x2e')](_0x4440d0);if(_0x4440d0[_0xc6a5('0x42')]){for(var _0x4c9d3f=0x0;_0x4c9d3f<_0x4440d0[_0xc6a5('0x43')][_0xc6a5('0x22')];_0x4c9d3f+=0x1){_0x4440d0['monitorFilename']=_0x4440d0[_0xc6a5('0x43')][_0x4c9d3f][_0xc6a5('0x44')];_0x4440d0[_0xc6a5('0x45')]=_0x4440d0['monitors'][_0x4c9d3f][_0xc6a5('0x45')];if(_0x4440d0['exten']==_0xc6a5('0x3a')){_0x4440d0[_0xc6a5('0x3f')]=_0x4440d0[_0xc6a5('0x23')];_0x4440d0['calleridname']=_0x4440d0['connectedlinename'];_0x4440d0[_0xc6a5('0x23')]=_0x4440d0[_0xc6a5('0x1f')];_0x4440d0['connectedlinename']=_0x4440d0['membername'];_0x4440d0[_0xc6a5('0x31')]=_0x4440d0[_0xc6a5('0x3c')];}else if(_0x4440d0[_0xc6a5('0x31')]==_0xc6a5('0x46')){_0x4440d0[_0xc6a5('0x3f')]=_0x4440d0['destination'];_0x4440d0[_0xc6a5('0x31')]=_0x4440d0[_0xc6a5('0x3c')];}RpcVoiceRecording[_0xc6a5('0x2e')](_0x4440d0);}}};Report[_0xc6a5('0x10')]['voiceAgentReport']=function(_0x31efee){if(_['isArray'](_0x31efee)){_0x31efee[_0xc6a5('0x47')](function(_0x14f36b){RpcVoiceAgentReport[_0xc6a5('0x2e')](_0x14f36b);});}else{RpcVoiceAgentReport[_0xc6a5('0x2e')](_0x31efee);}};Report[_0xc6a5('0x10')][_0xc6a5('0x19')]=function(_0x5c427a){RpcVoiceDialReport['create'](_0x5c427a);var _0x41bba9=undefined;var _0x1c50a0=_0x5c427a[_0xc6a5('0x3e')];if(_[_0xc6a5('0x48')](_0x1c50a0,_0xc6a5('0x49'))){var _0x130acd=_0x1c50a0[_0xc6a5('0x4a')](_0x1c50a0[_0xc6a5('0x4b')]('/')+0x1,_0x1c50a0['indexOf']('@'));_0x41bba9=_[_0xc6a5('0x1e')](this[_0xc6a5('0xe')],function(_0x5e6fd6){return _0x5e6fd6['mobile']==_0x130acd||_0x5e6fd6[_0xc6a5('0x4c')]==_0x130acd||_0x5e6fd6[_0xc6a5('0x1f')]==_0x130acd;});}else{var _0x130acd=_0x1c50a0[_0xc6a5('0x4a')](_0x1c50a0[_0xc6a5('0x4b')]('/')+0x1,_0x1c50a0[_0xc6a5('0x4d')]('-'));_0x41bba9=this[_0xc6a5('0x1d')](_0x130acd);}if(_0x41bba9){_0x5c427a['interface']=_[_0xc6a5('0x27')](_0x41bba9['interface'])?util[_0xc6a5('0x21')](_0xc6a5('0x28'),_0x41bba9[_0xc6a5('0x20')]):_0x41bba9['interface'];_0x5c427a[_0xc6a5('0x4e')]=_0x41bba9['name'];_0x5c427a[_0xc6a5('0x1f')]=_0x41bba9['accountcode'];RpcMemberReport['voiceDialReport'](_0x5c427a);}};Report['prototype'][_0xc6a5('0x1a')]=function(_0x3472b5){RpcVoiceTransferReport['blindTransfer'](_0x3472b5);};Report[_0xc6a5('0x10')][_0xc6a5('0x1c')]=function(_0x64cb3e){RpcVoiceTransferReport[_0xc6a5('0x1c')](_0x64cb3e);};module['exports']=Report;
\ No newline at end of file
+var _0xedc7=['exten','type','queue','lastdata','context','from-voip-provider','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','connectedlinename','membername','xcally-motion-dialer','isArray','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','blindTransfer','exports','bluebird','lodash','util','../../../config/environment','../../../config/logger','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','voiceCallReport','destination'];(function(_0x25f983,_0x352b9d){var _0x50a304=function(_0x2bc5db){while(--_0x2bc5db){_0x25f983['push'](_0x25f983['shift']());}};_0x50a304(++_0x352b9d);}(_0xedc7,0x117));var _0x7edc=function(_0x423106,_0x4c07e0){_0x423106=_0x423106-0x0;var _0x1611ae=_0xedc7[_0x423106];return _0x1611ae;};'use strict';var BPromise=require(_0x7edc('0x0'));var _=require(_0x7edc('0x1'));var moment=require('moment');var util=require(_0x7edc('0x2'));var config=require(_0x7edc('0x3'));var logger=require(_0x7edc('0x4'))('ami');var ami=require(_0x7edc('0x5'));var RpcVoiceAgentReport=require(_0x7edc('0x6'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x7edc('0x7'));var RpcMemberReport=require(_0x7edc('0x8'));var RpcVoiceQueueReport=require(_0x7edc('0x9'));var RpcVoiceRecording=require(_0x7edc('0xa'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x7edc('0xb'));var VoiceCallReport=require(_0x7edc('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x7edc('0xd'));function Report(_0x1a316b){this['realtime']=_0x1a316b;this[_0x7edc('0xe')]=_0x1a316b[_0x7edc('0xe')];this['telephones']=_0x1a316b[_0x7edc('0xf')];}Report['prototype'][_0x7edc('0x10')]=function(_0x10b04d){var _0x2d0bfe=new VoiceQueueReport(this[_0x7edc('0x11')]);var _0x5f11e3=new VoiceAgentReport(this['realtime']);var _0x2a88e9=new VoiceDialReport(this[_0x7edc('0x11')]);var _0x5ad380=new VoiceCallReport(this[_0x7edc('0x11')]);var _0x22116d=new UserReport(this['realtime']);if(config[_0x7edc('0x12')]&&config['xdr'][_0x7edc('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x7edc('0x14')][_0x7edc('0x15')](this));ami['on'](_0x7edc('0x16'),this['voiceCallReport'][_0x7edc('0x15')](this));ami['on'](_0x7edc('0x17'),this[_0x7edc('0x18')][_0x7edc('0x15')](this));ami['on'](_0x7edc('0x19'),this['voiceDialReport'][_0x7edc('0x15')](this));ami['on'](_0x7edc('0x1a'),this['blindTransfer']['bind'](this));ami['on'](_0x7edc('0x1b'),this[_0x7edc('0x1c')]['bind'](this));}};Report[_0x7edc('0x1d')][_0x7edc('0x1e')]=function(_0x2e18ff){var _0x16b1d8=undefined;_0x16b1d8=_[_0x7edc('0x1f')](this[_0x7edc('0xe')],function(_0x51f36d){return _0x51f36d[_0x7edc('0x20')]==_0x2e18ff||_0x51f36d['name']==_0x2e18ff;});if(_[_0x7edc('0x21')](_0x16b1d8)){var _0x325180=_[_0x7edc('0x1f')](this[_0x7edc('0xf')],function(_0x43e2f0){return _0x43e2f0['accountcode']==_0x2e18ff||_0x43e2f0[_0x7edc('0x22')]==_0x2e18ff;});if(_0x325180){_0x16b1d8=_[_0x7edc('0x1f')](this[_0x7edc('0xe')],function(_0x297202){return _0x297202[_0x7edc('0x23')]==util[_0x7edc('0x24')](_0x7edc('0x25'),_0x325180[_0x7edc('0x22')]);});}}return _0x16b1d8;};Report[_0x7edc('0x1d')][_0x7edc('0x14')]=function(_0x5f1d4c){for(var _0x379786=0x0;_0x379786<_0x5f1d4c[_0x7edc('0x26')];_0x379786+=0x1){var _0x4c47b=this[_0x7edc('0x1e')](_0x5f1d4c[_0x379786][_0x7edc('0x27')]);if(_0x4c47b){_0x5f1d4c[_0x379786][_0x7edc('0x20')]=_0x4c47b[_0x7edc('0x20')];_0x5f1d4c[_0x379786][_0x7edc('0x28')]=!![];_0x5f1d4c[_0x379786]['lastAssignedTo']=_0x4c47b[_0x7edc('0x22')];_0x5f1d4c[_0x379786][_0x7edc('0x23')]=_[_0x7edc('0x21')](_0x4c47b[_0x7edc('0x23')])?util[_0x7edc('0x24')]('SIP/%s',_0x4c47b[_0x7edc('0x22')]):_0x4c47b[_0x7edc('0x23')];if(_0x5f1d4c[_0x379786][_0x7edc('0x29')]){_0x5f1d4c[_0x379786][_0x7edc('0x2a')]=moment()[_0x7edc('0x24')](_0x7edc('0x2b'));}if(_0x5f1d4c[_0x379786][_0x7edc('0x2c')]){_0x5f1d4c[_0x379786]['queuecallerexitAt']=moment()[_0x7edc('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x5f1d4c[_0x379786]);}RpcVoiceQueueReport[_0x7edc('0x2d')](_0x5f1d4c[_0x379786]);}};function extractCalleridNumber(_0x1832c0){var _0x3b8301=_0x1832c0[_0x7edc('0x2e')](/<(.*?)>/);return _0x3b8301?_0x3b8301[0x1]:_0x1832c0;}Report[_0x7edc('0x1d')][_0x7edc('0x2f')]=function(_0x492d9f){_0x492d9f[_0x7edc('0x30')]=_0x492d9f[_0x7edc('0x30')]||_0x492d9f[_0x7edc('0x31')];if(_0x492d9f[_0x7edc('0x32')]=='dialer'){_0x492d9f['lastapplication']=_0x7edc('0x33');_0x492d9f[_0x7edc('0x34')]=_0x492d9f[_0x7edc('0x33')];if(_0x492d9f[_0x7edc('0x35')]==_0x7edc('0x36')){_0x492d9f[_0x7edc('0x20')]='';_0x492d9f[_0x7edc('0x30')]=extractCalleridNumber(_0x492d9f['callerid']);}else if(_0x492d9f[_0x7edc('0x35')]=='from-sip'){if(_0x492d9f[_0x7edc('0x30')]==_0x7edc('0x37')){_0x492d9f[_0x7edc('0x30')]=extractCalleridNumber(_0x492d9f['calleridpreview']);_0x492d9f[_0x7edc('0x38')]=_0x492d9f[_0x7edc('0x39')];_0x492d9f[_0x7edc('0x3a')]=[_0x492d9f[_0x7edc('0x3b')],_0x492d9f[_0x7edc('0x3b')]=_0x492d9f['destinationchannel']][0x0];_0x492d9f[_0x7edc('0x3c')]=_0x492d9f['calleridpreview'];}else{_0x492d9f[_0x7edc('0x30')]=_0x492d9f['calleridnum'];_0x492d9f[_0x7edc('0x38')]=_0x492d9f[_0x7edc('0x39')];if(_0x492d9f[_0x7edc('0x3d')]==_0x7edc('0x3e')){_0x492d9f['accountcode']=_0x492d9f['connectedlinenum'];}else{_0x492d9f[_0x7edc('0x20')]='';}}}}else{_0x492d9f['callerid']=util[_0x7edc('0x24')](_0x7edc('0x3f'),_0x492d9f[_0x7edc('0x40')],_0x492d9f['calleridnum']);}RpcVoiceCallReport['create'](_0x492d9f);if(_0x492d9f[_0x7edc('0x41')]){for(var _0x30e36f=0x0;_0x30e36f<_0x492d9f[_0x7edc('0x42')][_0x7edc('0x26')];_0x30e36f+=0x1){_0x492d9f[_0x7edc('0x43')]=_0x492d9f[_0x7edc('0x42')][_0x30e36f]['filename'];_0x492d9f['createdAt']=_0x492d9f[_0x7edc('0x42')][_0x30e36f]['createdAt'];if(_0x492d9f[_0x7edc('0x31')]==_0x7edc('0x37')){_0x492d9f[_0x7edc('0x38')]=_0x492d9f[_0x7edc('0x27')];_0x492d9f[_0x7edc('0x40')]=_0x492d9f[_0x7edc('0x44')];_0x492d9f[_0x7edc('0x27')]=_0x492d9f[_0x7edc('0x20')];_0x492d9f[_0x7edc('0x44')]=_0x492d9f[_0x7edc('0x45')];_0x492d9f[_0x7edc('0x31')]=_0x492d9f['originatecalleridnum'];}else if(_0x492d9f['exten']==_0x7edc('0x46')){_0x492d9f[_0x7edc('0x38')]=_0x492d9f[_0x7edc('0x30')];_0x492d9f[_0x7edc('0x31')]=_0x492d9f[_0x7edc('0x39')];}RpcVoiceRecording[_0x7edc('0x2d')](_0x492d9f);}}};Report[_0x7edc('0x1d')][_0x7edc('0x18')]=function(_0x3afeb5){if(_[_0x7edc('0x47')](_0x3afeb5)){_0x3afeb5['forEach'](function(_0x5304b7){RpcVoiceAgentReport['create'](_0x5304b7);});}else{RpcVoiceAgentReport[_0x7edc('0x2d')](_0x3afeb5);}};Report[_0x7edc('0x1d')][_0x7edc('0x48')]=function(_0x3aee8e){RpcVoiceDialReport['create'](_0x3aee8e);var _0x3e3e35=undefined;var _0x40e516=_0x3aee8e[_0x7edc('0x3b')];if(_[_0x7edc('0x49')](_0x40e516,_0x7edc('0x4a'))){var _0x1b6410=_0x40e516[_0x7edc('0x4b')](_0x40e516[_0x7edc('0x4c')]('/')+0x1,_0x40e516[_0x7edc('0x4c')]('@'));_0x3e3e35=_['find'](this[_0x7edc('0xe')],function(_0x786bf0){return _0x786bf0[_0x7edc('0x4d')]==_0x1b6410||_0x786bf0[_0x7edc('0x4e')]==_0x1b6410||_0x786bf0[_0x7edc('0x20')]==_0x1b6410;});}else{var _0x1b6410=_0x40e516[_0x7edc('0x4b')](_0x40e516[_0x7edc('0x4c')]('/')+0x1,_0x40e516[_0x7edc('0x4f')]('-'));_0x3e3e35=this['findAgent'](_0x1b6410);}if(_0x3e3e35){_0x3aee8e[_0x7edc('0x23')]=_[_0x7edc('0x21')](_0x3e3e35[_0x7edc('0x23')])?util[_0x7edc('0x24')](_0x7edc('0x25'),_0x3e3e35[_0x7edc('0x22')]):_0x3e3e35[_0x7edc('0x23')];_0x3aee8e['membername']=_0x3e3e35[_0x7edc('0x22')];_0x3aee8e[_0x7edc('0x20')]=_0x3e3e35[_0x7edc('0x20')];RpcMemberReport[_0x7edc('0x48')](_0x3aee8e);}};Report[_0x7edc('0x1d')]['blindTransfer']=function(_0x53fc56){RpcVoiceTransferReport[_0x7edc('0x50')](_0x53fc56);};Report['prototype'][_0x7edc('0x1c')]=function(_0x183516){RpcVoiceTransferReport['attendedTransfer'](_0x183516);};module[_0x7edc('0x51')]=Report;
\ No newline at end of file
index 97c4253..cce9f78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf70f=['trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','stateTime','format','toNumber','telephone:%s','telephone:save','startsWith','Queue','Local','substring','indexOf','find','mobile','phone','accountcode','updateStatusRealtime','[syncDeviceState][UserReport]','peer','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','loopSyncRealTimeShow','prototype','isNotNull','emit','username','stateRegistry','omit','event','actionid','state','trunk:%s','name'];(function(_0x21fad4,_0x3de188){var _0x2cc47d=function(_0x2862a5){while(--_0x2862a5){_0x21fad4['push'](_0x21fad4['shift']());}};_0x2cc47d(++_0x3de188);}(_0xf70f,0x132));var _0xff70=function(_0x1460ab,_0x74d06e){_0x1460ab=_0x1460ab-0x0;var _0x1eeb5c=_0xf70f[_0x1460ab];return _0x1eeb5c;};'use strict';var _=require(_0xff70('0x0'));var moment=require(_0xff70('0x1'));var BPromise=require(_0xff70('0x2'));var util=require(_0xff70('0x3'));var Redis=require(_0xff70('0x4'));var config=require(_0xff70('0x5'));var logger=require(_0xff70('0x6'))(_0xff70('0x7'));var ami=require('../ami');config[_0xff70('0x8')]=_[_0xff70('0x9')](config[_0xff70('0x8')],{'host':_0xff70('0xa'),'port':0x18eb});var io=require(_0xff70('0xb'))(new Redis(config[_0xff70('0x8')]));function UserReport(_0x5a68f4){this['trunks']=_0x5a68f4[_0xff70('0xc')];this[_0xff70('0xd')]=_0x5a68f4[_0xff70('0xd')];this['telephones']=_0x5a68f4[_0xff70('0xe')];ami['on'](_0xff70('0xf'),this[_0xff70('0x10')][_0xff70('0x11')](this));ami['on'](_0xff70('0x12'),this['syncRegistry'][_0xff70('0x11')](this));ami['on'](_0xff70('0x13'),this[_0xff70('0x14')][_0xff70('0x11')](this));ami['on'](_0xff70('0x15'),this[_0xff70('0x16')][_0xff70('0x11')](this));this['loopSyncRealTimeShow']();return BPromise[_0xff70('0x17')]()[_0xff70('0x18')](ami[_0xff70('0x19')]())[_0xff70('0x18')](ami[_0xff70('0x1a')]())['then'](ami[_0xff70('0x1b')]())[_0xff70('0x1c')](loggerCatch(_0xff70('0x1d')));}function loggerCatch(_0x2e470c){return function(_0x139edb){logger[_0xff70('0x1e')](_0x2e470c,util[_0xff70('0x1f')](_0x139edb,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0xff70('0x20')]=function(){setInterval(function(){BPromise[_0xff70('0x17')]()[_0xff70('0x18')](ami[_0xff70('0x19')]())[_0xff70('0x18')](ami[_0xff70('0x1a')]())['then'](ami[_0xff70('0x1b')]())[_0xff70('0x1c')](loggerCatch(_0xff70('0x1d')));},0x32c8);};UserReport[_0xff70('0x21')][_0xff70('0x22')]=function(_0x444ed1){return _0x444ed1!==null&&!_['isUndefined'](_0x444ed1);};UserReport[_0xff70('0x21')][_0xff70('0x23')]=function(_0x3936c3,_0x163bf2,_0x3a3834){io['to'](_0x3936c3)['emit'](_0x163bf2,_0x3a3834);};UserReport[_0xff70('0x21')][_0xff70('0x10')]=function(_0x898d28){try{if(this[_0xff70('0x22')](_0x898d28)){var _0x1c6cb3=_['find'](this[_0xff70('0xc')],{'registry':_0x898d28[_0xff70('0x24')]});if(_0x1c6cb3){_0x898d28[_0xff70('0x25')]=_0x898d28['state'];_['merge'](_0x1c6cb3,_[_0xff70('0x26')](_0x898d28,[_0xff70('0x27'),_0xff70('0x28'),_0xff70('0x24'),_0xff70('0x29')]));this[_0xff70('0x23')](util['format'](_0xff70('0x2a'),_0x1c6cb3[_0xff70('0x2b')]),_0xff70('0x2c'),_0x1c6cb3);}}}catch(_0x151170){logger[_0xff70('0x1e')](_0xff70('0x2d'),util[_0xff70('0x1f')](_0x151170,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xff70('0x14')]=function(_0x2851f4){try{if(this[_0xff70('0x22')](_0x2851f4)){if(this[_0xff70('0xd')][_0x2851f4[_0xff70('0x2e')]]){if(!this['agents'][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x2f')]||_0x2851f4['state'][_0xff70('0x30')]()=='inuse'){this[_0xff70('0xd')][_0x2851f4['device']][_0xff70('0x2f')]=![];if(this[_0xff70('0xd')][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x29')]!==_0x2851f4[_0xff70('0x29')][_0xff70('0x30')]()){this[_0xff70('0xd')][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x31')]=_['toNumber'](moment()[_0xff70('0x32')]('x'));}this[_0xff70('0xd')][_0x2851f4['device']][_0xff70('0x29')]=_0x2851f4[_0xff70('0x29')][_0xff70('0x30')]();this[_0xff70('0xd')][_0x2851f4[_0xff70('0x2e')]]['updateStatusRealtime'](_0x2851f4);}}else if(this[_0xff70('0xe')][_0x2851f4[_0xff70('0x2e')]]){if(this[_0xff70('0xe')][_0x2851f4['device']][_0xff70('0x29')]!==_0x2851f4[_0xff70('0x29')][_0xff70('0x30')]()){this[_0xff70('0xe')][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x31')]=_[_0xff70('0x33')](moment()[_0xff70('0x32')]('x'));}this[_0xff70('0xe')][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x29')]=_0x2851f4[_0xff70('0x29')][_0xff70('0x30')]();this[_0xff70('0x23')](util[_0xff70('0x32')](_0xff70('0x34'),this['telephones'][_0x2851f4['device']][_0xff70('0x2b')]),_0xff70('0x35'),this[_0xff70('0xe')][_0x2851f4[_0xff70('0x2e')]]);}else if(this[_0xff70('0xc')][_0x2851f4[_0xff70('0x2e')]]){if(this[_0xff70('0xc')][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x29')]!==_0x2851f4[_0xff70('0x29')][_0xff70('0x30')]()){this['trunks'][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x31')]=_['toNumber'](moment()['format']('x'));}this[_0xff70('0xc')][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x29')]=_0x2851f4[_0xff70('0x29')][_0xff70('0x30')]();this[_0xff70('0x23')](util[_0xff70('0x32')](_0xff70('0x2a'),this[_0xff70('0xc')][_0x2851f4[_0xff70('0x2e')]][_0xff70('0x2b')]),_0xff70('0x2c'),this[_0xff70('0xc')][_0x2851f4[_0xff70('0x2e')]]);}else if(_[_0xff70('0x36')](_0x2851f4[_0xff70('0x2e')],_0xff70('0x37'))){}else if(_[_0xff70('0x36')](_0x2851f4['device'],_0xff70('0x38'))){var _0x1b7957=_0x2851f4['device'];var _0x2b78d1=_0x1b7957[_0xff70('0x39')](_0x1b7957[_0xff70('0x3a')]('/')+0x1,_0x1b7957[_0xff70('0x3a')]('@'));var _0x3cc776=_[_0xff70('0x3b')](this[_0xff70('0xd')],function(_0x3348a0){return _0x3348a0[_0xff70('0x3c')]==_0x2b78d1||_0x3348a0[_0xff70('0x3d')]==_0x2b78d1||_0x3348a0[_0xff70('0x3e')]==_0x2b78d1;});if(_0x3cc776){if(_0x3cc776[_0xff70('0x29')]!==_0x2851f4[_0xff70('0x29')][_0xff70('0x30')]()){_0x3cc776[_0xff70('0x31')]=_[_0xff70('0x33')](moment()[_0xff70('0x32')]('x'));}_0x3cc776[_0xff70('0x29')]=_0x2851f4[_0xff70('0x29')]['toLowerCase']();_0x3cc776[_0xff70('0x2f')]=!![];_0x3cc776[_0xff70('0x3f')](_0x2851f4);}}else{}}}catch(_0x3ad559){logger[_0xff70('0x1e')](_0xff70('0x40'),util['inspect'](_0x3ad559,{'showHidden':![],'depth':null}));}};UserReport[_0xff70('0x21')][_0xff70('0x16')]=function(_0x577703){try{if(this[_0xff70('0x22')](_0x577703)&&this[_0xff70('0x22')](_0x577703[_0xff70('0x15')])){if(this['agents'][_0x577703[_0xff70('0x41')]]){if(!this[_0xff70('0xd')][_0x577703[_0xff70('0x41')]][_0xff70('0x2f')]||_0x577703[_0xff70('0x15')][_0xff70('0x30')]()=='registered'){this[_0xff70('0xd')][_0x577703['peer']]['local']=![];this[_0xff70('0xd')][_0x577703[_0xff70('0x41')]][_0xff70('0x42')]=_0x577703[_0xff70('0x15')][_0xff70('0x30')]();this['agents'][_0x577703[_0xff70('0x41')]][_0xff70('0x43')]=_0x577703[_0xff70('0x43')];this[_0xff70('0xd')][_0x577703[_0xff70('0x41')]][_0xff70('0x3f')](_0x577703);}}else if(this['telephones'][_0x577703[_0xff70('0x41')]]){this[_0xff70('0xe')][_0x577703[_0xff70('0x41')]][_0xff70('0x42')]=_0x577703[_0xff70('0x15')]['toLowerCase']();this[_0xff70('0xe')][_0x577703[_0xff70('0x41')]][_0xff70('0x43')]=_0x577703[_0xff70('0x43')];this[_0xff70('0x23')](util[_0xff70('0x32')]('telephone:%s',this['telephones'][_0x577703[_0xff70('0x41')]][_0xff70('0x2b')]),'telephone:save',this['telephones'][_0x577703[_0xff70('0x41')]]);}else if(this[_0xff70('0xc')][_0x577703[_0xff70('0x41')]]){this[_0xff70('0xc')][_0x577703[_0xff70('0x41')]]['status']=_0x577703[_0xff70('0x15')]['toLowerCase']();this['trunks'][_0x577703[_0xff70('0x41')]][_0xff70('0x43')]=_0x577703[_0xff70('0x43')];this['emit'](util[_0xff70('0x32')](_0xff70('0x2a'),this['trunks'][_0x577703['peer']]['name']),_0xff70('0x2c'),this[_0xff70('0xc')][_0x577703['peer']]);}else{}}}catch(_0x2096df){logger[_0xff70('0x1e')](_0xff70('0x44'),util[_0xff70('0x1f')](_0x2096df,{'showHidden':![],'depth':null}));}};module[_0xff70('0x45')]=UserReport;
\ No newline at end of file
+var _0x5cbe=['accountcode','peerstatus','peer','registered','status','address','[syncPeerStatus][UserReport]','lodash','bluebird','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','actionSipShowRegistry','prototype','isNotNull','isUndefined','emit','trunks','username','state','merge','omit','event','actionid','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','inspect','syncDeviceState','local','toLowerCase','inuse','device','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','substring','indexOf','mobile'];(function(_0x3e8449,_0x54e064){var _0x4a7b27=function(_0x12d9aa){while(--_0x12d9aa){_0x3e8449['push'](_0x3e8449['shift']());}};_0x4a7b27(++_0x54e064);}(_0x5cbe,0xca));var _0xe5cb=function(_0x28d124,_0x3ddb9a){_0x28d124=_0x28d124-0x0;var _0x15d6b9=_0x5cbe[_0x28d124];return _0x15d6b9;};'use strict';var _=require(_0xe5cb('0x0'));var moment=require('moment');var BPromise=require(_0xe5cb('0x1'));var util=require(_0xe5cb('0x2'));var Redis=require(_0xe5cb('0x3'));var config=require(_0xe5cb('0x4'));var logger=require(_0xe5cb('0x5'))('ami');var ami=require(_0xe5cb('0x6'));config[_0xe5cb('0x7')]=_[_0xe5cb('0x8')](config[_0xe5cb('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe5cb('0x7')]));function UserReport(_0xfc863e){this['trunks']=_0xfc863e['trunks'];this[_0xe5cb('0x9')]=_0xfc863e[_0xe5cb('0x9')];this[_0xe5cb('0xa')]=_0xfc863e[_0xe5cb('0xa')];ami['on'](_0xe5cb('0xb'),this['syncRegistry'][_0xe5cb('0xc')](this));ami['on'](_0xe5cb('0xd'),this[_0xe5cb('0xe')][_0xe5cb('0xc')](this));ami['on'](_0xe5cb('0xf'),this['syncDeviceState']['bind'](this));ami['on']('peerstatus',this[_0xe5cb('0x10')][_0xe5cb('0xc')](this));this[_0xe5cb('0x11')]();return BPromise[_0xe5cb('0x12')]()[_0xe5cb('0x13')](ami['actionSipShowRegistry']())[_0xe5cb('0x13')](ami[_0xe5cb('0x14')]())['then'](ami[_0xe5cb('0x15')]())[_0xe5cb('0x16')](loggerCatch(_0xe5cb('0x17')));}function loggerCatch(_0x5c0640){return function(_0x27b06d){logger[_0xe5cb('0x18')](_0x5c0640,util['inspect'](_0x27b06d,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0xe5cb('0x11')]=function(){setInterval(function(){BPromise[_0xe5cb('0x12')]()[_0xe5cb('0x13')](ami[_0xe5cb('0x19')]())[_0xe5cb('0x13')](ami[_0xe5cb('0x14')]())['then'](ami[_0xe5cb('0x15')]())['catch'](loggerCatch(_0xe5cb('0x17')));},0x32c8);};UserReport[_0xe5cb('0x1a')][_0xe5cb('0x1b')]=function(_0xdc192b){return _0xdc192b!==null&&!_[_0xe5cb('0x1c')](_0xdc192b);};UserReport['prototype'][_0xe5cb('0x1d')]=function(_0x1df416,_0xaefd22,_0x4cee09){io['to'](_0x1df416)[_0xe5cb('0x1d')](_0xaefd22,_0x4cee09);};UserReport['prototype']['syncRegistry']=function(_0x2e8e51){try{if(this[_0xe5cb('0x1b')](_0x2e8e51)){var _0x7fd316=_['find'](this[_0xe5cb('0x1e')],{'registry':_0x2e8e51[_0xe5cb('0x1f')]});if(_0x7fd316){_0x2e8e51['stateRegistry']=_0x2e8e51[_0xe5cb('0x20')];_[_0xe5cb('0x21')](_0x7fd316,_[_0xe5cb('0x22')](_0x2e8e51,[_0xe5cb('0x23'),_0xe5cb('0x24'),_0xe5cb('0x1f'),_0xe5cb('0x20')]));this[_0xe5cb('0x1d')](util[_0xe5cb('0x25')](_0xe5cb('0x26'),_0x7fd316[_0xe5cb('0x27')]),_0xe5cb('0x28'),_0x7fd316);}}}catch(_0x21ebe9){logger[_0xe5cb('0x18')](_0xe5cb('0x29'),util[_0xe5cb('0x2a')](_0x21ebe9,{'showHidden':![],'depth':null}));}};UserReport[_0xe5cb('0x1a')][_0xe5cb('0x2b')]=function(_0x3169b7){try{if(this[_0xe5cb('0x1b')](_0x3169b7)){if(this[_0xe5cb('0x9')][_0x3169b7['device']]){if(!this[_0xe5cb('0x9')][_0x3169b7['device']][_0xe5cb('0x2c')]||_0x3169b7['state'][_0xe5cb('0x2d')]()==_0xe5cb('0x2e')){this[_0xe5cb('0x9')][_0x3169b7[_0xe5cb('0x2f')]][_0xe5cb('0x2c')]=![];if(this['agents'][_0x3169b7['device']][_0xe5cb('0x20')]!==_0x3169b7['state'][_0xe5cb('0x2d')]()){this['agents'][_0x3169b7[_0xe5cb('0x2f')]][_0xe5cb('0x30')]=_[_0xe5cb('0x31')](moment()[_0xe5cb('0x25')]('x'));}this['agents'][_0x3169b7[_0xe5cb('0x2f')]]['state']=_0x3169b7[_0xe5cb('0x20')][_0xe5cb('0x2d')]();this[_0xe5cb('0x9')][_0x3169b7[_0xe5cb('0x2f')]][_0xe5cb('0x32')](_0x3169b7);}}else if(this[_0xe5cb('0xa')][_0x3169b7[_0xe5cb('0x2f')]]){if(this[_0xe5cb('0xa')][_0x3169b7['device']]['state']!==_0x3169b7[_0xe5cb('0x20')][_0xe5cb('0x2d')]()){this[_0xe5cb('0xa')][_0x3169b7[_0xe5cb('0x2f')]][_0xe5cb('0x30')]=_[_0xe5cb('0x31')](moment()[_0xe5cb('0x25')]('x'));}this[_0xe5cb('0xa')][_0x3169b7[_0xe5cb('0x2f')]][_0xe5cb('0x20')]=_0x3169b7['state'][_0xe5cb('0x2d')]();this['emit'](util['format'](_0xe5cb('0x33'),this['telephones'][_0x3169b7[_0xe5cb('0x2f')]][_0xe5cb('0x27')]),_0xe5cb('0x34'),this[_0xe5cb('0xa')][_0x3169b7[_0xe5cb('0x2f')]]);}else if(this['trunks'][_0x3169b7[_0xe5cb('0x2f')]]){if(this[_0xe5cb('0x1e')][_0x3169b7[_0xe5cb('0x2f')]][_0xe5cb('0x20')]!==_0x3169b7['state'][_0xe5cb('0x2d')]()){this[_0xe5cb('0x1e')][_0x3169b7[_0xe5cb('0x2f')]][_0xe5cb('0x30')]=_[_0xe5cb('0x31')](moment()[_0xe5cb('0x25')]('x'));}this[_0xe5cb('0x1e')][_0x3169b7['device']][_0xe5cb('0x20')]=_0x3169b7[_0xe5cb('0x20')][_0xe5cb('0x2d')]();this[_0xe5cb('0x1d')](util[_0xe5cb('0x25')](_0xe5cb('0x26'),this['trunks'][_0x3169b7[_0xe5cb('0x2f')]]['name']),'trunk:save',this[_0xe5cb('0x1e')][_0x3169b7[_0xe5cb('0x2f')]]);}else if(_[_0xe5cb('0x35')](_0x3169b7[_0xe5cb('0x2f')],_0xe5cb('0x36'))){}else if(_[_0xe5cb('0x35')](_0x3169b7[_0xe5cb('0x2f')],'Local')){var _0x1c9f91=_0x3169b7[_0xe5cb('0x2f')];var _0x1529c7=_0x1c9f91[_0xe5cb('0x37')](_0x1c9f91[_0xe5cb('0x38')]('/')+0x1,_0x1c9f91[_0xe5cb('0x38')]('@'));var _0x243694=_['find'](this[_0xe5cb('0x9')],function(_0x175758){return _0x175758[_0xe5cb('0x39')]==_0x1529c7||_0x175758['phone']==_0x1529c7||_0x175758[_0xe5cb('0x3a')]==_0x1529c7;});if(_0x243694){if(_0x243694[_0xe5cb('0x20')]!==_0x3169b7[_0xe5cb('0x20')][_0xe5cb('0x2d')]()){_0x243694[_0xe5cb('0x30')]=_['toNumber'](moment()[_0xe5cb('0x25')]('x'));}_0x243694[_0xe5cb('0x20')]=_0x3169b7['state'][_0xe5cb('0x2d')]();_0x243694[_0xe5cb('0x2c')]=!![];_0x243694[_0xe5cb('0x32')](_0x3169b7);}}else{}}}catch(_0x35a605){logger[_0xe5cb('0x18')]('[syncDeviceState][UserReport]',util[_0xe5cb('0x2a')](_0x35a605,{'showHidden':![],'depth':null}));}};UserReport[_0xe5cb('0x1a')][_0xe5cb('0x10')]=function(_0x400110){try{if(this['isNotNull'](_0x400110)&&this[_0xe5cb('0x1b')](_0x400110[_0xe5cb('0x3b')])){if(this[_0xe5cb('0x9')][_0x400110['peer']]){if(!this['agents'][_0x400110[_0xe5cb('0x3c')]][_0xe5cb('0x2c')]||_0x400110[_0xe5cb('0x3b')][_0xe5cb('0x2d')]()==_0xe5cb('0x3d')){this[_0xe5cb('0x9')][_0x400110['peer']]['local']=![];this['agents'][_0x400110[_0xe5cb('0x3c')]][_0xe5cb('0x3e')]=_0x400110[_0xe5cb('0x3b')][_0xe5cb('0x2d')]();this[_0xe5cb('0x9')][_0x400110['peer']][_0xe5cb('0x3f')]=_0x400110[_0xe5cb('0x3f')];this[_0xe5cb('0x9')][_0x400110[_0xe5cb('0x3c')]][_0xe5cb('0x32')](_0x400110);}}else if(this[_0xe5cb('0xa')][_0x400110['peer']]){this[_0xe5cb('0xa')][_0x400110[_0xe5cb('0x3c')]][_0xe5cb('0x3e')]=_0x400110['peerstatus'][_0xe5cb('0x2d')]();this[_0xe5cb('0xa')][_0x400110[_0xe5cb('0x3c')]][_0xe5cb('0x3f')]=_0x400110[_0xe5cb('0x3f')];this[_0xe5cb('0x1d')](util[_0xe5cb('0x25')](_0xe5cb('0x33'),this[_0xe5cb('0xa')][_0x400110['peer']][_0xe5cb('0x27')]),_0xe5cb('0x34'),this[_0xe5cb('0xa')][_0x400110[_0xe5cb('0x3c')]]);}else if(this[_0xe5cb('0x1e')][_0x400110[_0xe5cb('0x3c')]]){this[_0xe5cb('0x1e')][_0x400110[_0xe5cb('0x3c')]][_0xe5cb('0x3e')]=_0x400110['peerstatus'][_0xe5cb('0x2d')]();this[_0xe5cb('0x1e')][_0x400110['peer']][_0xe5cb('0x3f')]=_0x400110[_0xe5cb('0x3f')];this[_0xe5cb('0x1d')](util[_0xe5cb('0x25')](_0xe5cb('0x26'),this[_0xe5cb('0x1e')][_0x400110[_0xe5cb('0x3c')]][_0xe5cb('0x27')]),_0xe5cb('0x28'),this[_0xe5cb('0x1e')][_0x400110[_0xe5cb('0x3c')]]);}else{}}}catch(_0x1e0eb9){logger['error'](_0xe5cb('0x40'),util[_0xe5cb('0x2a')](_0x1e0eb9,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
index e4f207d..6126569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb20e=['acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','agentcompleteAt','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','diff','seconds','[syncBlindTransfer][VoiceAgentReport]','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','util','ioredis','ami','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','emit','isNotNull','isUndefined','prototype','syncAgentCalled','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','event','privilege','custom:agentcalled','membername','user:called','error','inspect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:%s','agentringnoanswer','agentringnoanswerAt','reason','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','hasOwnProperty','agentcomplete','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','complete','talktime','transfer','agent','acwtime'];(function(_0x3eddeb,_0x2b4007){var _0x28dfc9=function(_0x4e5885){while(--_0x4e5885){_0x3eddeb['push'](_0x3eddeb['shift']());}};_0x28dfc9(++_0x2b4007);}(_0xb20e,0x118));var _0xeb20=function(_0x21c0c4,_0x28ab5a){_0x21c0c4=_0x21c0c4-0x0;var _0x16791c=_0xb20e[_0x21c0c4];return _0x16791c;};'use strict';var _=require(_0xeb20('0x0'));var moment=require(_0xeb20('0x1'));var util=require(_0xeb20('0x2'));var Redis=require(_0xeb20('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xeb20('0x4'));var ami=require(_0xeb20('0x5'));config[_0xeb20('0x6')]=_[_0xeb20('0x7')](config['redis'],{'host':_0xeb20('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xeb20('0x6')]));function VoiceAgentReport(_0x1d2c7f){this[_0xeb20('0x9')]={};this[_0xeb20('0xa')]=_0x1d2c7f['voiceQueues'];this[_0xeb20('0xb')]=_0x1d2c7f[_0xeb20('0xb')];this[_0xeb20('0xc')]={};ami['on']('agentcalled',this['syncAgentCalled'][_0xeb20('0xd')](this));ami['on'](_0xeb20('0xe'),this[_0xeb20('0xf')]['bind'](this));ami['on']('agentringnoanswer',this[_0xeb20('0x10')][_0xeb20('0xd')](this));ami['on'](_0xeb20('0x11'),this[_0xeb20('0x12')][_0xeb20('0xd')](this));ami['on']('agentcomplete',this[_0xeb20('0x13')][_0xeb20('0xd')](this));ami['on'](_0xeb20('0x14'),this[_0xeb20('0x15')]['bind'](this));ami['on']('hangup',this[_0xeb20('0x16')][_0xeb20('0xd')](this));ami['on']('musiconholdstart',this[_0xeb20('0x17')][_0xeb20('0xd')](this));ami['on'](_0xeb20('0x18'),this[_0xeb20('0x19')]['bind'](this));ami['on']('attendedtransfer',this[_0xeb20('0x1a')]['bind'](this));ami['on']('blindtransfer',this[_0xeb20('0x1b')][_0xeb20('0xd')](this));}VoiceAgentReport['prototype']['emit']=function(_0x59b375,_0x1572f9,_0x40bcbd){io['to'](_0x59b375)[_0xeb20('0x1c')](_0x1572f9,_0x40bcbd);};VoiceAgentReport['prototype'][_0xeb20('0x1d')]=function(_0x5f06a3){return _0x5f06a3!==null&&!_[_0xeb20('0x1e')](_0x5f06a3);};VoiceAgentReport[_0xeb20('0x1f')][_0xeb20('0x20')]=function(_0xc13bd){try{if(this[_0xeb20('0x1d')](_0xc13bd)){if(_[_0xeb20('0x1e')](this[_0xeb20('0x9')][_0xc13bd['uniqueid']])){this[_0xeb20('0x9')][_0xc13bd[_0xeb20('0x21')]]={};}if(_[_0xeb20('0x1e')](this[_0xeb20('0x9')][_0xc13bd[_0xeb20('0x21')]][_0xc13bd[_0xeb20('0x22')]])){this[_0xeb20('0x9')][_0xc13bd['uniqueid']][_0xc13bd[_0xeb20('0x22')]]={'agentcalledAt':moment()[_0xeb20('0x23')](_0xeb20('0x24')),'lastevent':_0xeb20('0x25'),'variables':this['variables'][_0xc13bd['uniqueid']],'type':this['voiceQueues'][_0xc13bd[_0xeb20('0x26')]]?this[_0xeb20('0xa')][_0xc13bd[_0xeb20('0x26')]][_0xeb20('0x27')]||_0xeb20('0x28'):_0xeb20('0x28')};}_[_0xeb20('0x29')](this['channels'][_0xc13bd[_0xeb20('0x21')]][_0xc13bd[_0xeb20('0x22')]],_['omit'](_0xc13bd,[_0xeb20('0x2a'),_0xeb20('0x2b')]));ami[_0xeb20('0x1c')](_0xeb20('0x2c'),this['channels'][_0xc13bd[_0xeb20('0x21')]][_0xc13bd['destuniqueid']]);this[_0xeb20('0x1c')](util[_0xeb20('0x23')]('user:%s',_0xc13bd[_0xeb20('0x2d')]),_0xeb20('0x2e'),this[_0xeb20('0x9')][_0xc13bd[_0xeb20('0x21')]][_0xc13bd[_0xeb20('0x22')]]);}}catch(_0x5c7cfa){logger[_0xeb20('0x2f')]('[syncAgentCalled][VoiceAgentReport]',util[_0xeb20('0x30')](_0x5c7cfa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xeb20('0x1f')][_0xeb20('0xf')]=function(_0x1f1dc9){try{if(this[_0xeb20('0x1d')](_0x1f1dc9)){if(this['channels'][_0x1f1dc9['uniqueid']]){for(var _0x31e08b in this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]]){if(this['channels'][_0x1f1dc9[_0xeb20('0x21')]]['hasOwnProperty'](_0x31e08b)){if(_0x1f1dc9[_0xeb20('0x22')]===_0x31e08b){this[_0xeb20('0x9')][_0x1f1dc9['uniqueid']][_0x31e08b]['agentconnectAt']=moment()[_0xeb20('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b]['lastevent']='connect';this['channels'][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b]['holdtime']=_0x1f1dc9[_0xeb20('0x31')];this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b]['connectedlinenum']=_0x1f1dc9[_0xeb20('0x32')];this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b][_0xeb20('0x33')]=_0x1f1dc9[_0xeb20('0x33')];this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b][_0xeb20('0x34')]=_0x1f1dc9[_0xeb20('0x34')];this['channels'][_0x1f1dc9['uniqueid']][_0x31e08b][_0xeb20('0x35')]=_0x1f1dc9[_0xeb20('0x35')];_[_0xeb20('0x29')](this[_0xeb20('0xb')][_0x1f1dc9[_0xeb20('0x36')]],_[_0xeb20('0x37')](_0x1f1dc9,[_0xeb20('0x26'),_0xeb20('0x38')]));this[_0xeb20('0x1c')](util[_0xeb20('0x23')](_0xeb20('0x39'),_0x1f1dc9[_0xeb20('0x2d')]),'user:agentconnect',this['channels'][_0x1f1dc9[_0xeb20('0x21')]][_0x1f1dc9[_0xeb20('0x22')]]);ami[_0xeb20('0x1c')]('custom:agentconnect',this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b]);}else if(!this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b][_0xeb20('0x3a')]&&!this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b]['agentcomplete']){this[_0xeb20('0x9')][_0x1f1dc9['uniqueid']][_0x31e08b][_0xeb20('0x3a')]=!![];this[_0xeb20('0x9')][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b][_0xeb20('0x3b')]=moment()[_0xeb20('0x23')](_0xeb20('0x24'));this['channels'][_0x1f1dc9['uniqueid']][_0x31e08b][_0xeb20('0x3c')]=_0xeb20('0x3d');this['channels'][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b][_0xeb20('0x3e')]='answered_elsewhere';this['channels'][_0x1f1dc9['uniqueid']][_0x31e08b][_0xeb20('0x3f')]=_0x1f1dc9['destuniqueid'];this['channels'][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b][_0xeb20('0x40')]=_0x1f1dc9[_0xeb20('0x2d')];ami['emit'](_0xeb20('0x41'),this['channels'][_0x1f1dc9[_0xeb20('0x21')]][_0x31e08b]);}}}}}}catch(_0x55c55c){logger['error']('[syncAgentConnect][VoiceAgentReport]',util['inspect'](_0x55c55c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xeb20('0x1f')][_0xeb20('0x10')]=function(_0x40683e){try{if(this[_0xeb20('0x1d')](_0x40683e)){if(this[_0xeb20('0x9')][_0x40683e['uniqueid']]&&this[_0xeb20('0x9')][_0x40683e['uniqueid']][_0x40683e[_0xeb20('0x22')]]){this[_0xeb20('0x9')][_0x40683e[_0xeb20('0x21')]][_0x40683e[_0xeb20('0x22')]][_0xeb20('0x3a')]=!![];this[_0xeb20('0x9')][_0x40683e[_0xeb20('0x21')]][_0x40683e['destuniqueid']][_0xeb20('0x3b')]=moment()['format'](_0xeb20('0x24'));this[_0xeb20('0x9')][_0x40683e[_0xeb20('0x21')]][_0x40683e[_0xeb20('0x22')]]['reason']=_0xeb20('0x42');this[_0xeb20('0x9')][_0x40683e[_0xeb20('0x21')]][_0x40683e[_0xeb20('0x22')]][_0xeb20('0x3e')]=_0xeb20('0x42');ami['emit'](_0xeb20('0x43'),this[_0xeb20('0x9')][_0x40683e[_0xeb20('0x21')]][_0x40683e['destuniqueid']]);}}}catch(_0x1de724){logger[_0xeb20('0x2f')](_0xeb20('0x44'),util[_0xeb20('0x30')](_0x1de724,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xeb20('0x1f')]['syncQueueCallerAbandon']=function(_0x404fb5){try{if(this['isNotNull'](_0x404fb5)){if(this[_0xeb20('0x9')][_0x404fb5[_0xeb20('0x21')]]){for(var _0x39cc4b in this['channels'][_0x404fb5['uniqueid']]){if(this['channels'][_0x404fb5['uniqueid']][_0xeb20('0x45')](_0x39cc4b)&&!this[_0xeb20('0x9')][_0x404fb5[_0xeb20('0x21')]][_0x39cc4b][_0xeb20('0x3a')]&&!this[_0xeb20('0x9')][_0x404fb5[_0xeb20('0x21')]][_0x39cc4b][_0xeb20('0x46')]){this[_0xeb20('0x9')][_0x404fb5[_0xeb20('0x21')]][_0x39cc4b][_0xeb20('0x3a')]=!![];this[_0xeb20('0x9')][_0x404fb5[_0xeb20('0x21')]][_0x39cc4b]['agentringnoanswerAt']=moment()[_0xeb20('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xeb20('0x9')][_0x404fb5[_0xeb20('0x21')]][_0x39cc4b][_0xeb20('0x3c')]=_0xeb20('0x47');this[_0xeb20('0x9')][_0x404fb5[_0xeb20('0x21')]][_0x39cc4b][_0xeb20('0x3e')]=_0xeb20('0x47');ami[_0xeb20('0x1c')](_0xeb20('0x48'),this['channels'][_0x404fb5[_0xeb20('0x21')]][_0x39cc4b]);}}}}}catch(_0x33c962){logger['error'](_0xeb20('0x49'),util[_0xeb20('0x30')](_0x33c962,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xeb20('0x1f')][_0xeb20('0x13')]=function(_0x2b49cb){try{if(this[_0xeb20('0x1d')](_0x2b49cb)){if(this['channels'][_0x2b49cb['uniqueid']]){for(var _0x461b62 in this['channels'][_0x2b49cb[_0xeb20('0x21')]]){if(this['channels'][_0x2b49cb[_0xeb20('0x21')]]['hasOwnProperty'](_0x461b62)){if(this[_0xeb20('0x9')][_0x2b49cb['uniqueid']][_0x461b62][_0xeb20('0x4a')]&&!this[_0xeb20('0x9')][_0x2b49cb['uniqueid']][_0x461b62][_0xeb20('0x46')]){this[_0xeb20('0x9')][_0x2b49cb[_0xeb20('0x21')]][_0x461b62][_0xeb20('0x46')]=!![];this['channels'][_0x2b49cb[_0xeb20('0x21')]][_0x461b62]['agentcompleteAt']=moment()[_0xeb20('0x23')](_0xeb20('0x24'));this['channels'][_0x2b49cb['uniqueid']][_0x461b62][_0xeb20('0x3e')]=_0xeb20('0x4b');this[_0xeb20('0x9')][_0x2b49cb['uniqueid']][_0x461b62]['talktime']=_0x2b49cb[_0xeb20('0x4c')];this[_0xeb20('0x9')][_0x2b49cb[_0xeb20('0x21')]][_0x461b62][_0xeb20('0x3c')]=_0x2b49cb[_0xeb20('0x3c')]==_0xeb20('0x4d')?_0xeb20('0x4e'):_0x2b49cb['reason'];if(this[_0xeb20('0xa')][_0x2b49cb[_0xeb20('0x26')]]&&this[_0xeb20('0xa')][_0x2b49cb[_0xeb20('0x26')]]['acw']){this['channels'][_0x2b49cb[_0xeb20('0x21')]][_0x461b62]['agentacw']=!![];this[_0xeb20('0x9')][_0x2b49cb[_0xeb20('0x21')]][_0x461b62][_0xeb20('0x4f')]=this[_0xeb20('0xa')][_0x2b49cb[_0xeb20('0x26')]][_0xeb20('0x50')];}this[_0xeb20('0xb')][_0x2b49cb[_0xeb20('0x36')]]=_['omit'](this[_0xeb20('0xb')][_0x2b49cb['interface']],['queue',_0xeb20('0x38')]);this[_0xeb20('0x1c')](util[_0xeb20('0x23')](_0xeb20('0x39'),_0x2b49cb[_0xeb20('0x2d')]),_0xeb20('0x51'),this[_0xeb20('0x9')][_0x2b49cb[_0xeb20('0x21')]][_0x461b62]);ami[_0xeb20('0x1c')](_0xeb20('0x52'),this[_0xeb20('0x9')][_0x2b49cb[_0xeb20('0x21')]][_0x461b62]);}}}}}}catch(_0x805af8){logger[_0xeb20('0x2f')](_0xeb20('0x53'),util[_0xeb20('0x30')](_0x805af8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xeb20('0x1f')][_0xeb20('0x15')]=function(_0x5808c0){try{if(this[_0xeb20('0x1d')](_0x5808c0)){this[_0xeb20('0x54')](_0x5808c0[_0xeb20('0x21')],_['keys'](_0x5808c0[_0xeb20('0x55')])[0x0],_0x5808c0['value']);if(this[_0xeb20('0x9')][_0x5808c0[_0xeb20('0x21')]]){for(var _0x4165ad in this[_0xeb20('0x9')][_0x5808c0[_0xeb20('0x21')]]){if(this[_0xeb20('0x9')][_0x5808c0[_0xeb20('0x21')]][_0xeb20('0x45')](_0x4165ad)){if(_[_0xeb20('0x1e')](this[_0xeb20('0x9')][_0x5808c0[_0xeb20('0x21')]][_0x4165ad][_0xeb20('0xc')])){this['channels'][_0x5808c0[_0xeb20('0x21')]][_0x4165ad]['variables']={};}this['channels'][_0x5808c0[_0xeb20('0x21')]][_0x4165ad]['variables']=this[_0xeb20('0xc')][_0x5808c0[_0xeb20('0x21')]];}}}}}catch(_0x1dbaf9){logger[_0xeb20('0x2f')](_0xeb20('0x56'),util[_0xeb20('0x30')](_0x1dbaf9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xeb20('0x54')]=function(_0x2599f4,_0x3df529,_0xde84c2){var _0x3bce0b=[_0xeb20('0x57'),_0xeb20('0x58'),_0xeb20('0x59'),_0xeb20('0x5a'),_0xeb20('0x5b'),_0xeb20('0x5c'),_0xeb20('0x5d'),_0xeb20('0x5e'),_0xeb20('0x5f'),'sipuri',_0xeb20('0x60'),_0xeb20('0x61'),_0xeb20('0x62'),'memberdynamic','memberinterface','memberlastcall',_0xeb20('0x2d'),_0xeb20('0x63'),_0xeb20('0x64')];if(!_[_0xeb20('0x65')](_0x3df529)&&!_[_0xeb20('0x66')](_0x3bce0b,_0x3df529)){if(_[_0xeb20('0x1e')](this[_0xeb20('0xc')][_0x2599f4])){this['variables'][_0x2599f4]={};}this['variables'][_0x2599f4][_0x3df529]=_0xde84c2;}};VoiceAgentReport[_0xeb20('0x1f')]['syncHangup']=function(_0x23978c){try{if(this[_0xeb20('0x1d')](_0x23978c)){if(this['channels'][_0x23978c['uniqueid']]){for(var _0xbf933c in this[_0xeb20('0x9')][_0x23978c[_0xeb20('0x21')]]){if(this[_0xeb20('0x9')][_0x23978c['uniqueid']]['hasOwnProperty'](_0xbf933c)){if(this[_0xeb20('0x9')][_0x23978c['uniqueid']][_0xbf933c][_0xeb20('0x3c')]==_0xeb20('0x4d')&&this[_0xeb20('0x9')][_0x23978c[_0xeb20('0x21')]][_0xbf933c][_0xeb20('0x46')]){this[_0xeb20('0x9')][_0x23978c[_0xeb20('0x21')]][_0xbf933c]['agentcompleteAt']=moment()['format'](_0xeb20('0x24'));}}}ami['emit'](_0xeb20('0x67'),_[_0xeb20('0x68')](this[_0xeb20('0x9')][_0x23978c[_0xeb20('0x21')]]));delete this[_0xeb20('0x9')][_0x23978c['uniqueid']];}if(this[_0xeb20('0xc')][_0x23978c[_0xeb20('0x21')]]){delete this['variables'][_0x23978c['uniqueid']];}}}catch(_0x185e97){logger['error'](_0xeb20('0x69'),util['inspect'](_0x185e97,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xeb20('0x1a')]=function(_0x517a82){try{if(this['isNotNull'](_0x517a82)){if(this[_0xeb20('0x9')][_0x517a82[_0xeb20('0x6a')]]){for(var _0x4002f1 in this[_0xeb20('0x9')][_0x517a82[_0xeb20('0x6a')]]){if(this['channels'][_0x517a82[_0xeb20('0x6a')]][_0xeb20('0x45')](_0x4002f1)){if(_0x517a82['origtransfereruniqueid']===_0x4002f1){var _0x33159b=moment();this[_0xeb20('0x9')][_0x517a82[_0xeb20('0x6a')]][_0x4002f1][_0xeb20('0x46')]=!![];this['channels'][_0x517a82['transfereeuniqueid']][_0x4002f1][_0xeb20('0x6b')]=moment()[_0xeb20('0x23')](_0xeb20('0x24'));this[_0xeb20('0x9')][_0x517a82[_0xeb20('0x6a')]][_0x4002f1][_0xeb20('0x3c')]='transfer';this[_0xeb20('0x9')][_0x517a82[_0xeb20('0x6a')]][_0x4002f1]['lastevent']=_0xeb20('0x4b');this[_0xeb20('0x9')][_0x517a82['transfereeuniqueid']][_0x4002f1][_0xeb20('0x4c')]=_0x33159b['diff'](this['channels'][_0x517a82[_0xeb20('0x6a')]][_0x4002f1][_0xeb20('0x4a')],'seconds');}}}}if(this[_0xeb20('0x9')][_0x517a82[_0xeb20('0x6c')]]){var _0x46acb4=this['channels'][_0x517a82[_0xeb20('0x6c')]];this[_0xeb20('0x9')][_0x517a82[_0xeb20('0x6c')]]=this['channels'][_0x517a82[_0xeb20('0x6a')]];this[_0xeb20('0x9')][_0x517a82[_0xeb20('0x6a')]]=_0x46acb4;}}}catch(_0x284a38){logger[_0xeb20('0x2f')](_0xeb20('0x6d'),util[_0xeb20('0x30')](_0x284a38,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xeb20('0x1f')]['syncBlindTransfer']=function(_0x1aa004){try{if(this[_0xeb20('0x1d')](_0x1aa004)){if(this['channels'][_0x1aa004[_0xeb20('0x6a')]]){for(var _0x247681 in this[_0xeb20('0x9')][_0x1aa004[_0xeb20('0x6a')]]){if(this[_0xeb20('0x9')][_0x1aa004['transfereeuniqueid']][_0xeb20('0x45')](_0x247681)){if(_0x1aa004[_0xeb20('0x6e')]===_0x247681){var _0x29a46b=moment();this[_0xeb20('0x9')][_0x1aa004['transfereeuniqueid']][_0x247681][_0xeb20('0x46')]=!![];this[_0xeb20('0x9')][_0x1aa004['transfereeuniqueid']][_0x247681]['agentcompleteAt']=_0x29a46b;this[_0xeb20('0x9')][_0x1aa004['transfereeuniqueid']][_0x247681][_0xeb20('0x3c')]=_0xeb20('0x4d');this[_0xeb20('0x9')][_0x1aa004[_0xeb20('0x6a')]][_0x247681][_0xeb20('0x3e')]=_0xeb20('0x4b');this[_0xeb20('0x9')][_0x1aa004[_0xeb20('0x6a')]][_0x247681][_0xeb20('0x4c')]=_0x29a46b[_0xeb20('0x6f')](this[_0xeb20('0x9')][_0x1aa004[_0xeb20('0x6a')]][_0x247681][_0xeb20('0x4a')],_0xeb20('0x70'));}}}}}}catch(_0xdf3a54){logger[_0xeb20('0x2f')](_0xeb20('0x71'),util[_0xeb20('0x30')](_0xdf3a54,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xeb20('0x17')]=function(_0x9e762a){var _0x571cb0='';try{if(this[_0xeb20('0x1d')](_0x9e762a)){if(_0x9e762a[_0xeb20('0x72')]){_0x571cb0=_0x9e762a[_0xeb20('0x72')][_0xeb20('0x73')](0x0,_0x9e762a[_0xeb20('0x72')]['lastIndexOf']('-'));if(this[_0xeb20('0xb')][_0x571cb0]){this[_0xeb20('0xb')][_0x571cb0][_0xeb20('0x74')]=!![];}}}}catch(_0x54b95a){logger['error'](_0xeb20('0x75'),util[_0xeb20('0x30')](_0x54b95a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xeb20('0x1f')][_0xeb20('0x19')]=function(_0x12afaa){var _0x17ef1c='';try{if(this[_0xeb20('0x1d')](_0x12afaa)){if(_0x12afaa[_0xeb20('0x72')]){_0x17ef1c=_0x12afaa[_0xeb20('0x72')]['substring'](0x0,_0x12afaa['channel'][_0xeb20('0x76')]('-'));if(this[_0xeb20('0xb')][_0x17ef1c]){this[_0xeb20('0xb')][_0x17ef1c][_0xeb20('0x74')]=![];}}}}catch(_0x4ac89b){logger['error'](_0xeb20('0x77'),util[_0xeb20('0x30')](_0x4ac89b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0x5733=['bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','merge','omit','event','format','user:%s','membername','error','[syncAgentCalled][VoiceAgentReport]','inspect','lastevent','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','user:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','reason','rejected','custom:agentringnoanswer','syncQueueCallerAbandon','hasOwnProperty','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','agentcompleteAt','complete','talktime','transfer','agent','acw','acwtime','acwTimeout','destconnectedlinenum','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberrealtime','isNil','includes','syncHangup','custom:voiceAgentReport','values','syncAttendedTransfer','transfereeuniqueid','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','seconds','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled'];(function(_0x3a7ae8,_0x4bb95d){var _0x1f3726=function(_0xbdeb91){while(--_0xbdeb91){_0x3a7ae8['push'](_0x3a7ae8['shift']());}};_0x1f3726(++_0x4bb95d);}(_0x5733,0x66));var _0x3573=function(_0x4a1369,_0x50c255){_0x4a1369=_0x4a1369-0x0;var _0x2428fb=_0x5733[_0x4a1369];return _0x2428fb;};'use strict';var _=require(_0x3573('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x3573('0x1'));var config=require(_0x3573('0x2'));var logger=require(_0x3573('0x3'))(_0x3573('0x4'));var ami=require(_0x3573('0x5'));config[_0x3573('0x6')]=_[_0x3573('0x7')](config[_0x3573('0x6')],{'host':_0x3573('0x8'),'port':0x18eb});var io=require(_0x3573('0x9'))(new Redis(config[_0x3573('0x6')]));function VoiceAgentReport(_0x547f95){this[_0x3573('0xa')]={};this[_0x3573('0xb')]=_0x547f95[_0x3573('0xb')];this[_0x3573('0xc')]=_0x547f95[_0x3573('0xc')];this[_0x3573('0xd')]={};ami['on'](_0x3573('0xe'),this[_0x3573('0xf')][_0x3573('0x10')](this));ami['on'](_0x3573('0x11'),this[_0x3573('0x12')][_0x3573('0x10')](this));ami['on'](_0x3573('0x13'),this[_0x3573('0x14')][_0x3573('0x10')](this));ami['on'](_0x3573('0x15'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x3573('0x16'),this[_0x3573('0x17')]['bind'](this));ami['on'](_0x3573('0x18'),this['syncVarSet'][_0x3573('0x10')](this));ami['on'](_0x3573('0x19'),this['syncHangup']['bind'](this));ami['on'](_0x3573('0x1a'),this[_0x3573('0x1b')][_0x3573('0x10')](this));ami['on'](_0x3573('0x1c'),this[_0x3573('0x1d')][_0x3573('0x10')](this));ami['on'](_0x3573('0x1e'),this['syncAttendedTransfer'][_0x3573('0x10')](this));ami['on'](_0x3573('0x1f'),this[_0x3573('0x20')][_0x3573('0x10')](this));}VoiceAgentReport[_0x3573('0x21')]['emit']=function(_0x5bfc78,_0x4b9e1a,_0xd4fdc9){io['to'](_0x5bfc78)[_0x3573('0x22')](_0x4b9e1a,_0xd4fdc9);};VoiceAgentReport[_0x3573('0x21')][_0x3573('0x23')]=function(_0x14d639){return _0x14d639!==null&&!_[_0x3573('0x24')](_0x14d639);};VoiceAgentReport['prototype'][_0x3573('0xf')]=function(_0x5bccb9){try{if(this[_0x3573('0x23')](_0x5bccb9)){if(_['isUndefined'](this[_0x3573('0xa')][_0x5bccb9[_0x3573('0x25')]])){this[_0x3573('0xa')][_0x5bccb9['uniqueid']]={};}if(_['isUndefined'](this[_0x3573('0xa')][_0x5bccb9[_0x3573('0x25')]][_0x5bccb9[_0x3573('0x26')]])){this[_0x3573('0xa')][_0x5bccb9[_0x3573('0x25')]][_0x5bccb9['destuniqueid']]={'agentcalledAt':moment()['format'](_0x3573('0x27')),'lastevent':_0x3573('0x28'),'variables':this[_0x3573('0xd')][_0x5bccb9[_0x3573('0x25')]],'type':this[_0x3573('0xb')][_0x5bccb9[_0x3573('0x29')]]?this[_0x3573('0xb')][_0x5bccb9['queue']]['type']||'inbound':_0x3573('0x2a')};}_[_0x3573('0x2b')](this[_0x3573('0xa')][_0x5bccb9[_0x3573('0x25')]][_0x5bccb9[_0x3573('0x26')]],_[_0x3573('0x2c')](_0x5bccb9,[_0x3573('0x2d'),'privilege']));ami['emit']('custom:agentcalled',this[_0x3573('0xa')][_0x5bccb9[_0x3573('0x25')]][_0x5bccb9['destuniqueid']]);this[_0x3573('0x22')](util[_0x3573('0x2e')](_0x3573('0x2f'),_0x5bccb9[_0x3573('0x30')]),'user:called',this[_0x3573('0xa')][_0x5bccb9['uniqueid']][_0x5bccb9['destuniqueid']]);}}catch(_0x56115d){logger[_0x3573('0x31')](_0x3573('0x32'),util[_0x3573('0x33')](_0x56115d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3573('0x21')][_0x3573('0x12')]=function(_0x5928b5){try{if(this[_0x3573('0x23')](_0x5928b5)){if(this['channels'][_0x5928b5[_0x3573('0x25')]]){for(var _0x172813 in this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]]){if(this[_0x3573('0xa')][_0x5928b5['uniqueid']]['hasOwnProperty'](_0x172813)){if(_0x5928b5[_0x3573('0x26')]===_0x172813){this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813]['agentconnectAt']=moment()[_0x3573('0x2e')](_0x3573('0x27'));this['channels'][_0x5928b5[_0x3573('0x25')]][_0x172813][_0x3573('0x34')]='connect';this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813]['holdtime']=_0x5928b5['holdtime'];this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813][_0x3573('0x35')]=_0x5928b5[_0x3573('0x35')];this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813][_0x3573('0x36')]=_0x5928b5['connectedlinename'];this['channels'][_0x5928b5[_0x3573('0x25')]][_0x172813][_0x3573('0x37')]=_0x5928b5[_0x3573('0x37')];this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813][_0x3573('0x38')]=_0x5928b5[_0x3573('0x38')];_[_0x3573('0x2b')](this[_0x3573('0xc')][_0x5928b5[_0x3573('0x39')]],_[_0x3573('0x3a')](_0x5928b5,['queue','destconnectedlinenum']));this[_0x3573('0x22')](util[_0x3573('0x2e')](_0x3573('0x2f'),_0x5928b5[_0x3573('0x30')]),_0x3573('0x3b'),this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x5928b5[_0x3573('0x26')]]);ami[_0x3573('0x22')]('custom:agentconnect',this[_0x3573('0xa')][_0x5928b5['uniqueid']][_0x172813]);}else if(!this[_0x3573('0xa')][_0x5928b5['uniqueid']][_0x172813][_0x3573('0x13')]&&!this[_0x3573('0xa')][_0x5928b5['uniqueid']][_0x172813][_0x3573('0x16')]){this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813][_0x3573('0x13')]=!![];this['channels'][_0x5928b5['uniqueid']][_0x172813][_0x3573('0x3c')]=moment()[_0x3573('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813]['reason']=_0x3573('0x3d');this['channels'][_0x5928b5['uniqueid']][_0x172813][_0x3573('0x34')]=_0x3573('0x3d');this[_0x3573('0xa')][_0x5928b5['uniqueid']][_0x172813]['answeredelsewheredestinationuniqueid']=_0x5928b5['destuniqueid'];this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813][_0x3573('0x3e')]=_0x5928b5[_0x3573('0x30')];ami[_0x3573('0x22')](_0x3573('0x3f'),this[_0x3573('0xa')][_0x5928b5[_0x3573('0x25')]][_0x172813]);}}}}}}catch(_0x28b354){logger[_0x3573('0x31')](_0x3573('0x40'),util[_0x3573('0x33')](_0x28b354,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3573('0x14')]=function(_0x4fd8e3){try{if(this[_0x3573('0x23')](_0x4fd8e3)){if(this[_0x3573('0xa')][_0x4fd8e3['uniqueid']]&&this['channels'][_0x4fd8e3[_0x3573('0x25')]][_0x4fd8e3['destuniqueid']]){this[_0x3573('0xa')][_0x4fd8e3[_0x3573('0x25')]][_0x4fd8e3['destuniqueid']][_0x3573('0x13')]=!![];this['channels'][_0x4fd8e3['uniqueid']][_0x4fd8e3[_0x3573('0x26')]][_0x3573('0x3c')]=moment()[_0x3573('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4fd8e3[_0x3573('0x25')]][_0x4fd8e3['destuniqueid']][_0x3573('0x41')]=_0x3573('0x42');this[_0x3573('0xa')][_0x4fd8e3[_0x3573('0x25')]][_0x4fd8e3['destuniqueid']][_0x3573('0x34')]=_0x3573('0x42');ami[_0x3573('0x22')](_0x3573('0x43'),this['channels'][_0x4fd8e3[_0x3573('0x25')]][_0x4fd8e3['destuniqueid']]);}}}catch(_0x685e44){logger['error']('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x3573('0x33')](_0x685e44,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3573('0x21')][_0x3573('0x44')]=function(_0x133571){try{if(this[_0x3573('0x23')](_0x133571)){if(this[_0x3573('0xa')][_0x133571[_0x3573('0x25')]]){for(var _0x5275ae in this[_0x3573('0xa')][_0x133571[_0x3573('0x25')]]){if(this['channels'][_0x133571[_0x3573('0x25')]][_0x3573('0x45')](_0x5275ae)&&!this[_0x3573('0xa')][_0x133571[_0x3573('0x25')]][_0x5275ae]['agentringnoanswer']&&!this[_0x3573('0xa')][_0x133571[_0x3573('0x25')]][_0x5275ae]['agentcomplete']){this['channels'][_0x133571[_0x3573('0x25')]][_0x5275ae][_0x3573('0x13')]=!![];this[_0x3573('0xa')][_0x133571['uniqueid']][_0x5275ae][_0x3573('0x3c')]=moment()[_0x3573('0x2e')](_0x3573('0x27'));this[_0x3573('0xa')][_0x133571[_0x3573('0x25')]][_0x5275ae][_0x3573('0x41')]=_0x3573('0x46');this[_0x3573('0xa')][_0x133571[_0x3573('0x25')]][_0x5275ae][_0x3573('0x34')]=_0x3573('0x46');ami[_0x3573('0x22')]('custom:agentqueuecallerabandon',this['channels'][_0x133571[_0x3573('0x25')]][_0x5275ae]);}}}}}catch(_0x258284){logger['error'](_0x3573('0x47'),util[_0x3573('0x33')](_0x258284,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3573('0x17')]=function(_0x5d4941){try{if(this[_0x3573('0x23')](_0x5d4941)){if(this[_0x3573('0xa')][_0x5d4941[_0x3573('0x25')]]){for(var _0x30bfd4 in this['channels'][_0x5d4941[_0x3573('0x25')]]){if(this[_0x3573('0xa')][_0x5d4941[_0x3573('0x25')]][_0x3573('0x45')](_0x30bfd4)){if(this['channels'][_0x5d4941[_0x3573('0x25')]][_0x30bfd4][_0x3573('0x48')]&&!this['channels'][_0x5d4941['uniqueid']][_0x30bfd4][_0x3573('0x16')]){this[_0x3573('0xa')][_0x5d4941[_0x3573('0x25')]][_0x30bfd4][_0x3573('0x16')]=!![];this[_0x3573('0xa')][_0x5d4941['uniqueid']][_0x30bfd4][_0x3573('0x49')]=moment()['format'](_0x3573('0x27'));this[_0x3573('0xa')][_0x5d4941[_0x3573('0x25')]][_0x30bfd4]['lastevent']=_0x3573('0x4a');this[_0x3573('0xa')][_0x5d4941[_0x3573('0x25')]][_0x30bfd4][_0x3573('0x4b')]=_0x5d4941[_0x3573('0x4b')];this['channels'][_0x5d4941[_0x3573('0x25')]][_0x30bfd4][_0x3573('0x41')]=_0x5d4941[_0x3573('0x41')]==_0x3573('0x4c')?_0x3573('0x4d'):_0x5d4941['reason'];if(this[_0x3573('0xb')][_0x5d4941[_0x3573('0x29')]]&&this[_0x3573('0xb')][_0x5d4941[_0x3573('0x29')]][_0x3573('0x4e')]){this[_0x3573('0xa')][_0x5d4941['uniqueid']][_0x30bfd4]['agentacw']=!![];this[_0x3573('0xa')][_0x5d4941[_0x3573('0x25')]][_0x30bfd4][_0x3573('0x4f')]=this[_0x3573('0xb')][_0x5d4941[_0x3573('0x29')]][_0x3573('0x50')];}this[_0x3573('0xc')][_0x5d4941[_0x3573('0x39')]]=_[_0x3573('0x2c')](this['agents'][_0x5d4941['interface']],['queue',_0x3573('0x51')]);this[_0x3573('0x22')](util[_0x3573('0x2e')](_0x3573('0x2f'),_0x5d4941['membername']),'user:agentcomplete',this[_0x3573('0xa')][_0x5d4941[_0x3573('0x25')]][_0x30bfd4]);ami[_0x3573('0x22')](_0x3573('0x52'),this[_0x3573('0xa')][_0x5d4941[_0x3573('0x25')]][_0x30bfd4]);}}}}}}catch(_0x9f934a){logger[_0x3573('0x31')](_0x3573('0x53'),util[_0x3573('0x33')](_0x9f934a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3573('0x21')]['syncVarSet']=function(_0x1983a0){try{if(this['isNotNull'](_0x1983a0)){this[_0x3573('0x54')](_0x1983a0[_0x3573('0x25')],_[_0x3573('0x55')](_0x1983a0['variable'])[0x0],_0x1983a0[_0x3573('0x56')]);if(this[_0x3573('0xa')][_0x1983a0[_0x3573('0x25')]]){for(var _0x292fde in this[_0x3573('0xa')][_0x1983a0[_0x3573('0x25')]]){if(this[_0x3573('0xa')][_0x1983a0['uniqueid']]['hasOwnProperty'](_0x292fde)){if(_[_0x3573('0x24')](this['channels'][_0x1983a0['uniqueid']][_0x292fde][_0x3573('0xd')])){this['channels'][_0x1983a0[_0x3573('0x25')]][_0x292fde][_0x3573('0xd')]={};}this[_0x3573('0xa')][_0x1983a0[_0x3573('0x25')]][_0x292fde][_0x3573('0xd')]=this['variables'][_0x1983a0[_0x3573('0x25')]];}}}}}catch(_0x5eb4b0){logger[_0x3573('0x31')]('[syncVarSet][VoiceAgentReport]',util[_0x3573('0x33')](_0x5eb4b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3573('0x21')]['addVariable']=function(_0x36ffda,_0x461915,_0x5a3c79){var _0x395823=[_0x3573('0x57'),_0x3573('0x58'),_0x3573('0x59'),_0x3573('0x5a'),_0x3573('0x5b'),_0x3573('0x5c'),_0x3573('0x5d'),'rtpaudioqosrttbridged',_0x3573('0x5e'),'sipuri',_0x3573('0x5f'),_0x3573('0x60'),_0x3573('0x61'),_0x3573('0x62'),'memberinterface',_0x3573('0x63'),_0x3573('0x30'),'memberpenalty',_0x3573('0x64')];if(!_[_0x3573('0x65')](_0x461915)&&!_[_0x3573('0x66')](_0x395823,_0x461915)){if(_[_0x3573('0x24')](this[_0x3573('0xd')][_0x36ffda])){this[_0x3573('0xd')][_0x36ffda]={};}this[_0x3573('0xd')][_0x36ffda][_0x461915]=_0x5a3c79;}};VoiceAgentReport[_0x3573('0x21')][_0x3573('0x67')]=function(_0x5856b5){try{if(this[_0x3573('0x23')](_0x5856b5)){if(this[_0x3573('0xa')][_0x5856b5[_0x3573('0x25')]]){for(var _0x424a3c in this[_0x3573('0xa')][_0x5856b5[_0x3573('0x25')]]){if(this[_0x3573('0xa')][_0x5856b5['uniqueid']][_0x3573('0x45')](_0x424a3c)){if(this[_0x3573('0xa')][_0x5856b5[_0x3573('0x25')]][_0x424a3c][_0x3573('0x41')]=='transfer'&&this[_0x3573('0xa')][_0x5856b5[_0x3573('0x25')]][_0x424a3c][_0x3573('0x16')]){this[_0x3573('0xa')][_0x5856b5['uniqueid']][_0x424a3c][_0x3573('0x49')]=moment()[_0x3573('0x2e')](_0x3573('0x27'));}}}ami[_0x3573('0x22')](_0x3573('0x68'),_[_0x3573('0x69')](this[_0x3573('0xa')][_0x5856b5[_0x3573('0x25')]]));delete this['channels'][_0x5856b5[_0x3573('0x25')]];}if(this[_0x3573('0xd')][_0x5856b5[_0x3573('0x25')]]){delete this['variables'][_0x5856b5[_0x3573('0x25')]];}}}catch(_0x242eb6){logger[_0x3573('0x31')]('[syncHangup][VoiceAgentReport]',util[_0x3573('0x33')](_0x242eb6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3573('0x21')][_0x3573('0x6a')]=function(_0x53b4fc){try{if(this['isNotNull'](_0x53b4fc)){if(this['channels'][_0x53b4fc[_0x3573('0x6b')]]){for(var _0x588f69 in this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6b')]]){if(this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6b')]]['hasOwnProperty'](_0x588f69)){if(_0x53b4fc['origtransfereruniqueid']===_0x588f69){var _0x461ad9=moment();this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6b')]][_0x588f69][_0x3573('0x16')]=!![];this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6b')]][_0x588f69][_0x3573('0x49')]=moment()[_0x3573('0x2e')](_0x3573('0x27'));this['channels'][_0x53b4fc[_0x3573('0x6b')]][_0x588f69][_0x3573('0x41')]=_0x3573('0x4c');this['channels'][_0x53b4fc[_0x3573('0x6b')]][_0x588f69][_0x3573('0x34')]=_0x3573('0x4a');this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6b')]][_0x588f69][_0x3573('0x4b')]=_0x461ad9[_0x3573('0x6c')](this['channels'][_0x53b4fc[_0x3573('0x6b')]][_0x588f69][_0x3573('0x48')],'seconds');}}}}if(this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6d')]]){var _0x441961=this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6d')]];this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6d')]]=this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6b')]];this[_0x3573('0xa')][_0x53b4fc[_0x3573('0x6b')]]=_0x441961;}}}catch(_0x13b81f){logger[_0x3573('0x31')](_0x3573('0x6e'),util['inspect'](_0x13b81f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3573('0x21')]['syncBlindTransfer']=function(_0x5ed15f){try{if(this[_0x3573('0x23')](_0x5ed15f)){if(this[_0x3573('0xa')][_0x5ed15f[_0x3573('0x6b')]]){for(var _0xa60399 in this[_0x3573('0xa')][_0x5ed15f[_0x3573('0x6b')]]){if(this[_0x3573('0xa')][_0x5ed15f[_0x3573('0x6b')]][_0x3573('0x45')](_0xa60399)){if(_0x5ed15f[_0x3573('0x6f')]===_0xa60399){var _0x306865=moment();this[_0x3573('0xa')][_0x5ed15f['transfereeuniqueid']][_0xa60399][_0x3573('0x16')]=!![];this[_0x3573('0xa')][_0x5ed15f[_0x3573('0x6b')]][_0xa60399][_0x3573('0x49')]=_0x306865;this[_0x3573('0xa')][_0x5ed15f[_0x3573('0x6b')]][_0xa60399][_0x3573('0x41')]='transfer';this[_0x3573('0xa')][_0x5ed15f['transfereeuniqueid']][_0xa60399][_0x3573('0x34')]=_0x3573('0x4a');this[_0x3573('0xa')][_0x5ed15f[_0x3573('0x6b')]][_0xa60399][_0x3573('0x4b')]=_0x306865[_0x3573('0x6c')](this[_0x3573('0xa')][_0x5ed15f['transfereeuniqueid']][_0xa60399]['agentconnectAt'],_0x3573('0x70'));}}}}}}catch(_0x22c915){logger[_0x3573('0x31')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x3573('0x33')](_0x22c915,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3573('0x21')][_0x3573('0x1b')]=function(_0x3f44ba){var _0x14b3ab='';try{if(this[_0x3573('0x23')](_0x3f44ba)){if(_0x3f44ba['channel']){_0x14b3ab=_0x3f44ba[_0x3573('0x71')][_0x3573('0x72')](0x0,_0x3f44ba['channel'][_0x3573('0x73')]('-'));if(this[_0x3573('0xc')][_0x14b3ab]){this['agents'][_0x14b3ab][_0x3573('0x74')]=!![];}}}}catch(_0x41327c){logger[_0x3573('0x31')]('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0x3573('0x33')](_0x41327c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3573('0x21')][_0x3573('0x1d')]=function(_0x726ba9){var _0x3daf6f='';try{if(this[_0x3573('0x23')](_0x726ba9)){if(_0x726ba9[_0x3573('0x71')]){_0x3daf6f=_0x726ba9['channel'][_0x3573('0x72')](0x0,_0x726ba9[_0x3573('0x71')][_0x3573('0x73')]('-'));if(this[_0x3573('0xc')][_0x3daf6f]){this[_0x3573('0xc')][_0x3daf6f][_0x3573('0x74')]=![];}}}}catch(_0x5a9c9f){logger[_0x3573('0x31')](_0x3573('0x75'),util[_0x3573('0x33')](_0x5a9c9f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index ef4e27d..61fe6ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd04=['startsWith','cdr(','[syncNewExten][VoiceCallReport]','syncNewState','answered','answertime','diff','calleridnum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','monitor','endsWith','replace','monitorFilename','find','monitors','isNil','push','syncVarSet','variable','mixmonitor_filename','syncMixMonitorFilename','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','holdtime','omit','emit','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','BlindTransfer','transfererchannel','syncMusicOnHoldStart','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','moment','util','path','ioredis','../../../config/logger','ami','../ami','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','bind','syncNewExten','newchannel','syncNewChannel','newstate','varset','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','uniqueid','linkedid','merge','keys','error','channel','OutgoingSpoolFailed','starttime','channelstate','pick','context','from-sip','split','destconnectedlinenum','format','user:%s','name','accountcode','exten','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','appdata','applicationdata','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','disposition','includes','lastdata'];(function(_0x305975,_0x252d55){var _0x48f156=function(_0x30f239){while(--_0x30f239){_0x305975['push'](_0x305975['shift']());}};_0x48f156(++_0x252d55);}(_0xdd04,0xde));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var _=require(_0x4dd0('0x0'));var moment=require(_0x4dd0('0x1'));var util=require(_0x4dd0('0x2'));var path=require(_0x4dd0('0x3'));var Redis=require(_0x4dd0('0x4'));var config=require('../../../config/environment');var logger=require(_0x4dd0('0x5'))(_0x4dd0('0x6'));var ami=require(_0x4dd0('0x7'));var Channel=require('../model/channel');var statusDesc=[_0x4dd0('0x8'),_0x4dd0('0x9'),_0x4dd0('0xa'),'busy',_0x4dd0('0xb'),_0x4dd0('0xc'),_0x4dd0('0xd'),_0x4dd0('0xe'),_0x4dd0('0xf')];var applications=[_0x4dd0('0x10'),_0x4dd0('0x11'),_0x4dd0('0x12'),_0x4dd0('0x13'),_0x4dd0('0x14'),'voicemail'];var dispositions=[_0x4dd0('0x15'),_0x4dd0('0x16'),_0x4dd0('0x16'),_0x4dd0('0x15'),_0x4dd0('0x15'),'NO\x20ANSWER',_0x4dd0('0x17'),'BUSY',_0x4dd0('0x16'),'FAILED',_0x4dd0('0x16')];var actions={};config[_0x4dd0('0x18')]=_[_0x4dd0('0x19')](config[_0x4dd0('0x18')],{'host':_0x4dd0('0x1a'),'port':0x18eb});var io=require(_0x4dd0('0x1b'))(new Redis(config[_0x4dd0('0x18')]));function VoiceCallReport(_0x2a7c4c){this['channels']=_0x2a7c4c[_0x4dd0('0x1c')];this[_0x4dd0('0x1d')]=_0x2a7c4c[_0x4dd0('0x1d')];ami['on'](_0x4dd0('0x1e'),this['syncNewExten'][_0x4dd0('0x1f')](this));ami['on']('newexten',this[_0x4dd0('0x20')]['bind'](this));ami['on'](_0x4dd0('0x21'),this[_0x4dd0('0x22')][_0x4dd0('0x1f')](this));ami['on'](_0x4dd0('0x23'),this['syncNewState']['bind'](this));ami['on'](_0x4dd0('0x24'),this['syncVarSet'][_0x4dd0('0x1f')](this));ami['on']('hangup',this[_0x4dd0('0x25')][_0x4dd0('0x1f')](this));ami['on'](_0x4dd0('0x26'),this[_0x4dd0('0x27')][_0x4dd0('0x1f')](this));ami['on']('attendedtransfer',this[_0x4dd0('0x28')]['bind'](this));ami['on'](_0x4dd0('0x29'),this[_0x4dd0('0x2a')][_0x4dd0('0x1f')](this));ami['on'](_0x4dd0('0x2b'),this['syncMusicOnHoldStart'][_0x4dd0('0x1f')](this));ami['on'](_0x4dd0('0x2c'),this[_0x4dd0('0x2d')][_0x4dd0('0x1f')](this));return BPromise[_0x4dd0('0x2e')]()[_0x4dd0('0x2f')](ami[_0x4dd0('0x30')]())[_0x4dd0('0x31')](function(_0x2af65d){console[_0x4dd0('0x32')](_0x2af65d);});}VoiceCallReport[_0x4dd0('0x33')][_0x4dd0('0x34')]=function(_0x40fe0c){return _0x40fe0c!==null&&!_[_0x4dd0('0x35')](_0x40fe0c);};VoiceCallReport[_0x4dd0('0x33')]['emit']=function(_0x3e92e1,_0x531677,_0x371cc0){io['to'](_0x3e92e1)['emit'](_0x531677,_0x371cc0);};VoiceCallReport['prototype'][_0x4dd0('0x27')]=function(_0x533b55){try{if(this['isNotNull'](_0x533b55)){if(_0x533b55[_0x4dd0('0x36')]===_0x533b55[_0x4dd0('0x37')]){if(!_['isUndefined'](this[_0x4dd0('0x1c')][_0x533b55[_0x4dd0('0x36')]])){_[_0x4dd0('0x38')](this[_0x4dd0('0x1c')][_0x533b55[_0x4dd0('0x36')]],_['pick'](_0x533b55,_[_0x4dd0('0x39')](this['channels'][_0x533b55[_0x4dd0('0x36')]])));}}}}catch(_0x497e31){logger[_0x4dd0('0x3a')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x497e31,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4dd0('0x33')]['syncNewChannel']=function(_0x1975de){try{if(this['isNotNull'](_0x1975de)){if(_0x1975de[_0x4dd0('0x36')]===_0x1975de['linkedid']&&_0x1975de[_0x4dd0('0x3b')]!=_0x4dd0('0x3c')){if(_[_0x4dd0('0x35')](this['channels'][_0x1975de[_0x4dd0('0x36')]])){this[_0x4dd0('0x1c')][_0x1975de['uniqueid']]=new Channel();this['channels'][_0x1975de['uniqueid']][_0x4dd0('0x3d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x4dd0('0x1c')][_0x1975de[_0x4dd0('0x36')]]['disposition']=dispositions[_['toNumber'](_0x1975de[_0x4dd0('0x3e')])];_[_0x4dd0('0x38')](this[_0x4dd0('0x1c')][_0x1975de[_0x4dd0('0x36')]],_[_0x4dd0('0x3f')](_0x1975de,_['keys'](this[_0x4dd0('0x1c')][_0x1975de[_0x4dd0('0x36')]])));if(_0x1975de[_0x4dd0('0x40')]===_0x4dd0('0x41')){if(this['agents'][_0x1975de['channel'][_0x4dd0('0x42')]('-')[0x0]]){this['agents'][_0x1975de[_0x4dd0('0x3b')][_0x4dd0('0x42')]('-')[0x0]][_0x4dd0('0x43')]=_0x1975de['exten'];this['emit'](util[_0x4dd0('0x44')](_0x4dd0('0x45'),this[_0x4dd0('0x1d')][_0x1975de[_0x4dd0('0x3b')]['split']('-')[0x0]][_0x4dd0('0x46')]),'user:agentconnect',{'destaccountcode':this[_0x4dd0('0x1d')][_0x1975de['channel']['split']('-')[0x0]][_0x4dd0('0x47')],'destconnectedlinenum':_0x1975de[_0x4dd0('0x48')]});}}}}}}catch(_0x10c9d3){logger[_0x4dd0('0x3a')](_0x4dd0('0x49'),util[_0x4dd0('0x4a')](_0x10c9d3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4dd0('0x33')][_0x4dd0('0x20')]=function(_0x85488a){try{if(this[_0x4dd0('0x34')](_0x85488a)){if(_0x85488a[_0x4dd0('0x36')]===_0x85488a[_0x4dd0('0x37')]&&_0x85488a[_0x4dd0('0x48')]!='h'&&_0x85488a[_0x4dd0('0x3b')]!=_0x4dd0('0x3c')){_0x85488a[_0x4dd0('0x4b')]=_0x85488a[_0x4dd0('0x4b')][_0x4dd0('0x4c')]();_0x85488a['applicationdata']=(_0x85488a[_0x4dd0('0x4d')]||_0x85488a[_0x4dd0('0x4e')])[_0x4dd0('0x4c')]();if(_[_0x4dd0('0x35')](this[_0x4dd0('0x1c')][_0x85488a['uniqueid']])){this['channels'][_0x85488a[_0x4dd0('0x36')]]=new Channel();this[_0x4dd0('0x1c')][_0x85488a['uniqueid']]['starttime']=_0x85488a[_0x4dd0('0x4f')]?moment()[_0x4dd0('0x50')](moment[_0x4dd0('0x4f')](_0x85488a[_0x4dd0('0x4f')])['seconds'](),_0x4dd0('0x51'))[_0x4dd0('0x44')](_0x4dd0('0x52')):moment()['format'](_0x4dd0('0x52'));this[_0x4dd0('0x1c')][_0x85488a['uniqueid']][_0x4dd0('0x53')]='NO\x20ANSWER';}_['merge'](this[_0x4dd0('0x1c')][_0x85488a['uniqueid']],_['pick'](_0x85488a,_[_0x4dd0('0x39')](this[_0x4dd0('0x1c')][_0x85488a['uniqueid']])));if(_[_0x4dd0('0x54')](applications,_0x85488a[_0x4dd0('0x4b')])){this[_0x4dd0('0x1c')][_0x85488a['uniqueid']]['lastapplication']=_0x85488a[_0x4dd0('0x4b')];this[_0x4dd0('0x1c')][_0x85488a[_0x4dd0('0x36')]][_0x4dd0('0x55')]=_0x85488a['applicationdata'];if(_0x85488a['application']==='set'&&_[_0x4dd0('0x56')](_0x85488a[_0x4dd0('0x4e')],_0x4dd0('0x57'))){var _0x2d89b2=_0x85488a['applicationdata']['split']('=');var _0x17ce9a=_0x2d89b2[0x0]['match'](/cdr\((.*)\)/);if(_0x17ce9a){this[_0x4dd0('0x1c')][_0x85488a[_0x4dd0('0x36')]][_0x17ce9a[0x1]]=_0x2d89b2[0x1];}}else if(_0x85488a[_0x4dd0('0x4b')]==='queue'){this[_0x4dd0('0x1c')][_0x85488a['uniqueid']]['queue']=_0x85488a[_0x4dd0('0x4e')][_0x4dd0('0x42')](',')[0x0];}}}}}catch(_0x5ebb89){logger['error'](_0x4dd0('0x58'),util[_0x4dd0('0x4a')](_0x5ebb89,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4dd0('0x33')][_0x4dd0('0x59')]=function(_0x45b339){try{if(this['isNotNull'](_0x45b339)){if(_0x45b339['uniqueid']!==_0x45b339[_0x4dd0('0x37')]){if(this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]]){if(_0x45b339[_0x4dd0('0x3e')]==='6'){if(!this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]][_0x4dd0('0x5a')]){var _0x16d336=moment();this[_0x4dd0('0x1c')][_0x45b339['linkedid']]['answered']=!![];this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]][_0x4dd0('0x5b')]=_0x16d336['format'](_0x4dd0('0x52'));if(this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]][_0x4dd0('0x3d')]){this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]]['holdtime']=_0x16d336[_0x4dd0('0x5c')](this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]][_0x4dd0('0x3d')],'seconds');}}this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]]['linkedid']=_0x45b339[_0x4dd0('0x36')];if(_0x45b339[_0x4dd0('0x5d')]!=='xcally-motion-preview'){this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]]['connectedlinenum']=_0x45b339[_0x4dd0('0x5d')];}this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]][_0x4dd0('0x5e')]=_0x45b339[_0x4dd0('0x5f')];this[_0x4dd0('0x1c')][_0x45b339['linkedid']][_0x4dd0('0x60')]=_0x45b339[_0x4dd0('0x3b')];this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]][_0x4dd0('0x53')]=dispositions[_['toNumber'](_0x45b339['channelstate'])];if(this[_0x4dd0('0x1d')][_0x45b339[_0x4dd0('0x3b')]['split']('-')[0x0]]){this[_0x4dd0('0x1c')][_0x45b339['linkedid']][_0x4dd0('0x61')]=this['agents'][_0x45b339[_0x4dd0('0x3b')][_0x4dd0('0x42')]('-')[0x0]]['id'];this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x37')]][_0x4dd0('0x62')]=this['agents'][_0x45b339['channel'][_0x4dd0('0x42')]('-')[0x0]][_0x4dd0('0x46')];}}}}else{if(this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x36')]]){if(_0x45b339[_0x4dd0('0x3e')]==='6'){if(this[_0x4dd0('0x1d')][_0x45b339['channel']['split']('-')[0x0]]){this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x36')]]['UserId']=this[_0x4dd0('0x1d')][_0x45b339[_0x4dd0('0x3b')][_0x4dd0('0x42')]('-')[0x0]]['id'];this[_0x4dd0('0x1c')][_0x45b339[_0x4dd0('0x36')]][_0x4dd0('0x62')]=this[_0x4dd0('0x1d')][_0x45b339['channel'][_0x4dd0('0x42')]('-')[0x0]]['name'];}}}}}}catch(_0x181dd8){logger[_0x4dd0('0x3a')](_0x4dd0('0x63'),util[_0x4dd0('0x4a')](_0x181dd8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x4b77e2,_0x48227f){if(this[_0x4dd0('0x1c')][_0x4b77e2]){this[_0x4dd0('0x1c')][_0x4b77e2][_0x4dd0('0x64')]=!![];if(_[_0x4dd0('0x65')](_0x48227f,'.wav49')){_0x48227f=_0x48227f[_0x4dd0('0x66')]('.wav49','.WAV');}this[_0x4dd0('0x1c')][_0x4b77e2][_0x4dd0('0x67')]=_0x48227f;var _0x478b03=_[_0x4dd0('0x68')](this[_0x4dd0('0x1c')][_0x4b77e2][_0x4dd0('0x69')],{'filename':_0x48227f});if(_[_0x4dd0('0x6a')](_0x478b03)){this[_0x4dd0('0x1c')][_0x4b77e2][_0x4dd0('0x69')][_0x4dd0('0x6b')]({'filename':_0x48227f,'createdAt':moment()[_0x4dd0('0x44')](_0x4dd0('0x52')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport['prototype'][_0x4dd0('0x6c')]=function(_0x154b31){try{if(this['isNotNull'](_0x154b31)){if(this['channels'][_0x154b31[_0x4dd0('0x36')]]&&_0x154b31[_0x4dd0('0x3b')]!=_0x4dd0('0x3c')){if(this[_0x4dd0('0x34')](_0x154b31[_0x4dd0('0x6d')])){if(this[_0x4dd0('0x34')](_0x154b31['variable'][_0x4dd0('0x6e')])){this[_0x4dd0('0x6f')](_0x154b31[_0x4dd0('0x36')],_0x154b31[_0x4dd0('0x70')]);}else if(this[_0x4dd0('0x34')](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x71')])){this[_0x4dd0('0x1c')][_0x154b31[_0x4dd0('0x36')]]['calleridnum']=_0x154b31[_0x4dd0('0x70')];}else if(this[_0x4dd0('0x34')](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x72')])){this[_0x4dd0('0x1c')][_0x154b31[_0x4dd0('0x36')]][_0x4dd0('0x73')]=_0x154b31[_0x4dd0('0x70')];}else if(this[_0x4dd0('0x34')](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x74')])){this[_0x4dd0('0x1c')][_0x154b31[_0x4dd0('0x36')]][_0x4dd0('0x75')]=_0x154b31['value'];}else if(this[_0x4dd0('0x34')](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x76')])){this['channels'][_0x154b31['uniqueid']][_0x4dd0('0x11')]=_0x154b31['value'][_0x4dd0('0x42')](',')[0x0];}else if(this[_0x4dd0('0x34')](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x77')])){this['channels'][_0x154b31[_0x4dd0('0x36')]][_0x4dd0('0x78')]=_0x154b31[_0x4dd0('0x70')];}else if(this[_0x4dd0('0x34')](_0x154b31['variable']['xmd-destination'])){this[_0x4dd0('0x1c')][_0x154b31['uniqueid']][_0x4dd0('0x79')]=_0x154b31['value'];}else if(this[_0x4dd0('0x34')](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x7a')])){this[_0x4dd0('0x1c')][_0x154b31[_0x4dd0('0x36')]][_0x4dd0('0x7b')]=_0x154b31[_0x4dd0('0x70')];}else if(this[_0x4dd0('0x34')](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x7c')])){this[_0x4dd0('0x1c')][_0x154b31[_0x4dd0('0x36')]]['queue']=_0x154b31[_0x4dd0('0x70')];}else if(this['isNotNull'](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x7d')])){this[_0x4dd0('0x1c')][_0x154b31['uniqueid']][_0x4dd0('0x7e')]=_0x154b31[_0x4dd0('0x70')];}}}else if(this[_0x4dd0('0x34')](_0x154b31['variable'][_0x4dd0('0x6e')])){if(_0x154b31[_0x4dd0('0x70')]){var _0x4cd936=path['parse'](_0x154b31['value'])[_0x4dd0('0x46')];this[_0x4dd0('0x6f')](_0x4cd936,_0x154b31[_0x4dd0('0x70')]);}}else if(this[_0x4dd0('0x1c')][_0x154b31[_0x4dd0('0x37')]]){if(this[_0x4dd0('0x34')](_0x154b31['variable'])){if(this['isNotNull'](_0x154b31[_0x4dd0('0x6d')][_0x4dd0('0x7d')])){this[_0x4dd0('0x1c')][_0x154b31[_0x4dd0('0x37')]][_0x4dd0('0x7f')]=_0x154b31[_0x4dd0('0x70')];}}}}}catch(_0x180670){logger[_0x4dd0('0x3a')](_0x4dd0('0x80'),util[_0x4dd0('0x4a')](_0x180670,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4dd0('0x33')][_0x4dd0('0x25')]=function(_0x599a07){try{if(this[_0x4dd0('0x34')](_0x599a07)){if(this[_0x4dd0('0x1c')][_0x599a07['uniqueid']]){var _0x4fc5a0=moment();this['channels'][_0x599a07[_0x4dd0('0x36')]][_0x4dd0('0x81')]=_0x4fc5a0[_0x4dd0('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4dd0('0x1c')][_0x599a07['uniqueid']][_0x4dd0('0x4f')]=_0x4fc5a0[_0x4dd0('0x5c')](this[_0x4dd0('0x1c')][_0x599a07[_0x4dd0('0x36')]]['starttime'],_0x4dd0('0x51'));if(this[_0x4dd0('0x1c')][_0x599a07[_0x4dd0('0x36')]][_0x4dd0('0x5a')]){this[_0x4dd0('0x1c')][_0x599a07[_0x4dd0('0x36')]][_0x4dd0('0x82')]=_0x4fc5a0[_0x4dd0('0x5c')](this['channels'][_0x599a07[_0x4dd0('0x36')]][_0x4dd0('0x5b')],'seconds');this[_0x4dd0('0x1c')][_0x599a07['uniqueid']][_0x4dd0('0x83')]=this[_0x4dd0('0x1c')][_0x599a07[_0x4dd0('0x36')]][_0x4dd0('0x4f')]-this['channels'][_0x599a07[_0x4dd0('0x36')]][_0x4dd0('0x82')];}if(_0x599a07[_0x4dd0('0x40')]==='from-sip'){if(this[_0x4dd0('0x1d')][_0x599a07[_0x4dd0('0x3b')]['split']('-')[0x0]]){this['agents'][_0x599a07[_0x4dd0('0x3b')][_0x4dd0('0x42')]('-')[0x0]]=_[_0x4dd0('0x84')](this[_0x4dd0('0x1d')][_0x599a07[_0x4dd0('0x3b')][_0x4dd0('0x42')]('-')[0x0]],[_0x4dd0('0x43')]);this[_0x4dd0('0x85')](util[_0x4dd0('0x44')](_0x4dd0('0x45'),this[_0x4dd0('0x1d')][_0x599a07[_0x4dd0('0x3b')]['split']('-')[0x0]][_0x4dd0('0x46')]),'user:agentcomplete',{'destaccountcode':this[_0x4dd0('0x1d')][_0x599a07[_0x4dd0('0x3b')]['split']('-')[0x0]]['accountcode']});}}ami[_0x4dd0('0x85')](_0x4dd0('0x86'),this['channels'][_0x599a07[_0x4dd0('0x36')]]);delete this[_0x4dd0('0x1c')][_0x599a07[_0x4dd0('0x36')]];}}}catch(_0x1b9359){logger[_0x4dd0('0x3a')](_0x4dd0('0x87'),util[_0x4dd0('0x4a')](_0x1b9359,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4dd0('0x33')][_0x4dd0('0x28')]=function(_0x438474){try{if(this[_0x4dd0('0x34')](_0x438474)){if(this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x88')]]){this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x88')]][_0x4dd0('0x89')]=_0x438474[_0x4dd0('0x8a')];this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x88')]]['transferconnectedlinenum']=_0x438474[_0x4dd0('0x8b')];if(this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x8c')]]){var _0x10a634=this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x8c')]];this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x8c')]]=this['channels'][_0x438474['transfereeuniqueid']];this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x88')]]=_0x10a634;}}else if(this['channels'][_0x438474[_0x4dd0('0x8d')]]){this[_0x4dd0('0x1c')][_0x438474['transfertargetuniqueid']]['transfercalleridnum']=_0x438474['origtransferercalleridnum'];this['channels'][_0x438474[_0x4dd0('0x8d')]]['transferconnectedlinenum']=_0x438474[_0x4dd0('0x8b')];if(this['channels'][_0x438474['origtransfereruniqueid']]){var _0x10a634=this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x8e')]];this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x8e')]]=this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x8d')]];this[_0x4dd0('0x1c')][_0x438474[_0x4dd0('0x8d')]]=_0x10a634;}}}}catch(_0x3061cb){logger[_0x4dd0('0x3a')](_0x4dd0('0x8f'),util[_0x4dd0('0x4a')](_0x3061cb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4dd0('0x2a')]=function(_0x3eb19a){try{if(this[_0x4dd0('0x34')](_0x3eb19a)){if(this[_0x4dd0('0x1c')][_0x3eb19a['transfereeuniqueid']]){this[_0x4dd0('0x1c')][_0x3eb19a[_0x4dd0('0x88')]]['transfercalleridnum']=_0x3eb19a[_0x4dd0('0x90')];this[_0x4dd0('0x1c')][_0x3eb19a[_0x4dd0('0x88')]]['transferconnectedlinenum']=_0x3eb19a['extension'];this[_0x4dd0('0x25')]({'event':_0x4dd0('0x91'),'uniqueid':_0x3eb19a[_0x4dd0('0x88')],'context':_0x3eb19a[_0x4dd0('0x40')],'channel':_0x3eb19a[_0x4dd0('0x92')]});}}}catch(_0x16341b){logger['error']('[syncBlindTransfer][VoiceCallReport]',util['inspect'](_0x16341b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4dd0('0x93')]=function(_0xd880e4){try{if(this[_0x4dd0('0x34')](_0xd880e4)){if(this['channels'][_0xd880e4['uniqueid']]){if(!_[_0x4dd0('0x6a')](this[_0x4dd0('0x1c')][_0xd880e4[_0x4dd0('0x36')]]['answertime'])){this['channels'][_0xd880e4[_0x4dd0('0x36')]][_0x4dd0('0x94')]=moment()[_0x4dd0('0x44')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x2eb926){logger[_0x4dd0('0x3a')](_0x4dd0('0x95'),util[_0x4dd0('0x4a')](_0x2eb926,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4dd0('0x33')]['syncMusicOnHoldStop']=function(_0x358aeb){try{if(this[_0x4dd0('0x34')](_0x358aeb)){if(this[_0x4dd0('0x1c')][_0x358aeb[_0x4dd0('0x36')]]){if(!_[_0x4dd0('0x6a')](this['channels'][_0x358aeb[_0x4dd0('0x36')]][_0x4dd0('0x94')])){this['channels'][_0x358aeb[_0x4dd0('0x36')]][_0x4dd0('0x96')]+=moment()[_0x4dd0('0x97')](0x0)[_0x4dd0('0x5c')](this[_0x4dd0('0x1c')][_0x358aeb[_0x4dd0('0x36')]][_0x4dd0('0x94')],_0x4dd0('0x51'));delete this['channels'][_0x358aeb[_0x4dd0('0x36')]][_0x4dd0('0x94')];}}}}catch(_0x4abeb8){logger[_0x4dd0('0x3a')](_0x4dd0('0x98'),util[_0x4dd0('0x4a')](_0x4abeb8,{'showHidden':![],'depth':null}));}};module[_0x4dd0('0x99')]=VoiceCallReport;
\ No newline at end of file
+var _0x5e40=['[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','util','path','ioredis','../../../config/environment','../ami','../model/channel','not_inuse','inuse','unavailable','ringing','ringinuse','onhold','set','queue','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','channels','agents','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','newcallerid','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','then','actionCoreShowChannels','catch','log','prototype','isNotNull','syncNewCallerId','linkedid','uniqueid','[syncNewCallerId][VoiceCallReport]','inspect','OutgoingSpoolFailed','isUndefined','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','keys','from-sip','split','channel','destconnectedlinenum','format','user:%s','name','user:agentconnect','accountcode','error','[syncNewChannel][VoiceCallReport]','exten','application','applicationdata','appdata','duration','seconds','merge','pick','lastapplication','lastdata','match','[syncNewExten][VoiceCallReport]','syncNewState','channelstate','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinename','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','.wav49','find','monitors','isNil','push','rec','variable','value','xmd-callerid','callerid','type','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmcs-queue','sipcallid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','endtime','billableseconds','emit','user:agentcomplete','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','mohstarttime'];(function(_0x27e6e9,_0x58740b){var _0x509342=function(_0x3814d9){while(--_0x3814d9){_0x27e6e9['push'](_0x27e6e9['shift']());}};_0x509342(++_0x58740b);}(_0x5e40,0x1a4));var _0x05e4=function(_0xe836b8,_0xe8b231){_0xe836b8=_0xe836b8-0x0;var _0xfcf4e0=_0x5e40[_0xe836b8];return _0xfcf4e0;};'use strict';var BPromise=require(_0x05e4('0x0'));var _=require(_0x05e4('0x1'));var moment=require('moment');var util=require(_0x05e4('0x2'));var path=require(_0x05e4('0x3'));var Redis=require(_0x05e4('0x4'));var config=require(_0x05e4('0x5'));var logger=require('../../../config/logger')('ami');var ami=require(_0x05e4('0x6'));var Channel=require(_0x05e4('0x7'));var statusDesc=['unknown',_0x05e4('0x8'),_0x05e4('0x9'),'busy','invalid',_0x05e4('0xa'),_0x05e4('0xb'),_0x05e4('0xc'),_0x05e4('0xd')];var applications=[_0x05e4('0xe'),_0x05e4('0xf'),'agi',_0x05e4('0x10'),_0x05e4('0x11'),_0x05e4('0x12')];var dispositions=['NO\x20ANSWER',_0x05e4('0x13'),_0x05e4('0x13'),_0x05e4('0x14'),'NO\x20ANSWER','NO\x20ANSWER',_0x05e4('0x15'),_0x05e4('0x16'),_0x05e4('0x13'),_0x05e4('0x13'),_0x05e4('0x13')];var actions={};config[_0x05e4('0x17')]=_[_0x05e4('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x05e4('0x17')]));function VoiceCallReport(_0x340f93){this[_0x05e4('0x19')]=_0x340f93[_0x05e4('0x19')];this[_0x05e4('0x1a')]=_0x340f93['agents'];ami['on']('coreshowchannel',this[_0x05e4('0x1b')][_0x05e4('0x1c')](this));ami['on'](_0x05e4('0x1d'),this[_0x05e4('0x1b')][_0x05e4('0x1c')](this));ami['on'](_0x05e4('0x1e'),this[_0x05e4('0x1f')]['bind'](this));ami['on'](_0x05e4('0x20'),this['syncNewState']['bind'](this));ami['on'](_0x05e4('0x21'),this[_0x05e4('0x22')][_0x05e4('0x1c')](this));ami['on'](_0x05e4('0x23'),this['syncHangup'][_0x05e4('0x1c')](this));ami['on'](_0x05e4('0x24'),this['syncNewCallerId']['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x05e4('0x1c')](this));ami['on']('blindtransfer',this[_0x05e4('0x25')][_0x05e4('0x1c')](this));ami['on'](_0x05e4('0x26'),this[_0x05e4('0x27')]['bind'](this));ami['on'](_0x05e4('0x28'),this['syncMusicOnHoldStop'][_0x05e4('0x1c')](this));return BPromise['resolve']()[_0x05e4('0x29')](ami[_0x05e4('0x2a')]())[_0x05e4('0x2b')](function(_0x468b4e){console[_0x05e4('0x2c')](_0x468b4e);});}VoiceCallReport[_0x05e4('0x2d')][_0x05e4('0x2e')]=function(_0x492546){return _0x492546!==null&&!_['isUndefined'](_0x492546);};VoiceCallReport[_0x05e4('0x2d')]['emit']=function(_0x4249ac,_0x1bc5e2,_0xf4e96e){io['to'](_0x4249ac)['emit'](_0x1bc5e2,_0xf4e96e);};VoiceCallReport[_0x05e4('0x2d')][_0x05e4('0x2f')]=function(_0x13cae4){try{if(this[_0x05e4('0x2e')](_0x13cae4)){if(_0x13cae4['uniqueid']===_0x13cae4[_0x05e4('0x30')]){if(!_['isUndefined'](this[_0x05e4('0x19')][_0x13cae4['uniqueid']])){_['merge'](this[_0x05e4('0x19')][_0x13cae4[_0x05e4('0x31')]],_['pick'](_0x13cae4,_['keys'](this['channels'][_0x13cae4[_0x05e4('0x31')]])));}}}}catch(_0xc954cc){logger['error'](_0x05e4('0x32'),util[_0x05e4('0x33')](_0xc954cc,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x05e4('0x1f')]=function(_0x3ab528){try{if(this['isNotNull'](_0x3ab528)){if(_0x3ab528[_0x05e4('0x31')]===_0x3ab528[_0x05e4('0x30')]&&_0x3ab528['channel']!=_0x05e4('0x34')){if(_[_0x05e4('0x35')](this[_0x05e4('0x19')][_0x3ab528['uniqueid']])){this[_0x05e4('0x19')][_0x3ab528[_0x05e4('0x31')]]=new Channel();this[_0x05e4('0x19')][_0x3ab528[_0x05e4('0x31')]][_0x05e4('0x36')]=moment()['format'](_0x05e4('0x37'));this['channels'][_0x3ab528[_0x05e4('0x31')]][_0x05e4('0x38')]=dispositions[_[_0x05e4('0x39')](_0x3ab528['channelstate'])];_['merge'](this[_0x05e4('0x19')][_0x3ab528[_0x05e4('0x31')]],_['pick'](_0x3ab528,_[_0x05e4('0x3a')](this[_0x05e4('0x19')][_0x3ab528[_0x05e4('0x31')]])));if(_0x3ab528['context']===_0x05e4('0x3b')){if(this[_0x05e4('0x1a')][_0x3ab528['channel'][_0x05e4('0x3c')]('-')[0x0]]){this[_0x05e4('0x1a')][_0x3ab528[_0x05e4('0x3d')][_0x05e4('0x3c')]('-')[0x0]][_0x05e4('0x3e')]=_0x3ab528['exten'];this['emit'](util[_0x05e4('0x3f')](_0x05e4('0x40'),this[_0x05e4('0x1a')][_0x3ab528['channel']['split']('-')[0x0]][_0x05e4('0x41')]),_0x05e4('0x42'),{'destaccountcode':this['agents'][_0x3ab528['channel'][_0x05e4('0x3c')]('-')[0x0]][_0x05e4('0x43')],'destconnectedlinenum':_0x3ab528['exten']});}}}}}}catch(_0x22591c){logger[_0x05e4('0x44')](_0x05e4('0x45'),util[_0x05e4('0x33')](_0x22591c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x05e4('0x1b')]=function(_0x5e2359){try{if(this[_0x05e4('0x2e')](_0x5e2359)){if(_0x5e2359[_0x05e4('0x31')]===_0x5e2359['linkedid']&&_0x5e2359[_0x05e4('0x46')]!='h'&&_0x5e2359['channel']!=_0x05e4('0x34')){_0x5e2359[_0x05e4('0x47')]=_0x5e2359[_0x05e4('0x47')]['toLowerCase']();_0x5e2359[_0x05e4('0x48')]=(_0x5e2359[_0x05e4('0x49')]||_0x5e2359[_0x05e4('0x48')])['toLowerCase']();if(_[_0x05e4('0x35')](this[_0x05e4('0x19')][_0x5e2359[_0x05e4('0x31')]])){this[_0x05e4('0x19')][_0x5e2359[_0x05e4('0x31')]]=new Channel();this[_0x05e4('0x19')][_0x5e2359[_0x05e4('0x31')]][_0x05e4('0x36')]=_0x5e2359[_0x05e4('0x4a')]?moment()['subtract'](moment[_0x05e4('0x4a')](_0x5e2359[_0x05e4('0x4a')])[_0x05e4('0x4b')](),_0x05e4('0x4b'))[_0x05e4('0x3f')](_0x05e4('0x37')):moment()['format'](_0x05e4('0x37'));this['channels'][_0x5e2359[_0x05e4('0x31')]][_0x05e4('0x38')]=_0x05e4('0x14');}_[_0x05e4('0x4c')](this[_0x05e4('0x19')][_0x5e2359[_0x05e4('0x31')]],_[_0x05e4('0x4d')](_0x5e2359,_[_0x05e4('0x3a')](this[_0x05e4('0x19')][_0x5e2359[_0x05e4('0x31')]])));if(_['includes'](applications,_0x5e2359[_0x05e4('0x47')])){this[_0x05e4('0x19')][_0x5e2359['uniqueid']][_0x05e4('0x4e')]=_0x5e2359['application'];this[_0x05e4('0x19')][_0x5e2359['uniqueid']][_0x05e4('0x4f')]=_0x5e2359['applicationdata'];if(_0x5e2359['application']===_0x05e4('0xe')&&_['startsWith'](_0x5e2359[_0x05e4('0x48')],'cdr(')){var _0x98966a=_0x5e2359[_0x05e4('0x48')][_0x05e4('0x3c')]('=');var _0x53e0c2=_0x98966a[0x0][_0x05e4('0x50')](/cdr\((.*)\)/);if(_0x53e0c2){this[_0x05e4('0x19')][_0x5e2359[_0x05e4('0x31')]][_0x53e0c2[0x1]]=_0x98966a[0x1];}}else if(_0x5e2359[_0x05e4('0x47')]===_0x05e4('0xf')){this[_0x05e4('0x19')][_0x5e2359[_0x05e4('0x31')]][_0x05e4('0xf')]=_0x5e2359[_0x05e4('0x48')]['split'](',')[0x0];}}}}}catch(_0x1168c9){logger[_0x05e4('0x44')](_0x05e4('0x51'),util[_0x05e4('0x33')](_0x1168c9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05e4('0x2d')][_0x05e4('0x52')]=function(_0x5d6719){try{if(this[_0x05e4('0x2e')](_0x5d6719)){if(_0x5d6719[_0x05e4('0x31')]!==_0x5d6719[_0x05e4('0x30')]){if(this[_0x05e4('0x19')][_0x5d6719['linkedid']]){if(_0x5d6719[_0x05e4('0x53')]==='6'){if(!this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x54')]){var _0x25462d=moment();this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x54')]=!![];this['channels'][_0x5d6719['linkedid']][_0x05e4('0x55')]=_0x25462d[_0x05e4('0x3f')](_0x05e4('0x37'));if(this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x36')]){this['channels'][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x56')]=_0x25462d[_0x05e4('0x57')](this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x36')],'seconds');}}this['channels'][_0x5d6719['linkedid']]['linkedid']=_0x5d6719[_0x05e4('0x31')];if(_0x5d6719[_0x05e4('0x58')]!==_0x05e4('0x59')){this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]]['connectedlinenum']=_0x5d6719[_0x05e4('0x58')];}this['channels'][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x5a')]=_0x5d6719['calleridname'];this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x5b')]=_0x5d6719[_0x05e4('0x3d')];this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]]['disposition']=dispositions[_[_0x05e4('0x39')](_0x5d6719['channelstate'])];if(this['agents'][_0x5d6719[_0x05e4('0x3d')][_0x05e4('0x3c')]('-')[0x0]]){this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x5c')]=this['agents'][_0x5d6719[_0x05e4('0x3d')][_0x05e4('0x3c')]('-')[0x0]]['id'];this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x30')]][_0x05e4('0x5d')]=this[_0x05e4('0x1a')][_0x5d6719[_0x05e4('0x3d')]['split']('-')[0x0]][_0x05e4('0x41')];}}}}else{if(this[_0x05e4('0x19')][_0x5d6719[_0x05e4('0x31')]]){if(_0x5d6719[_0x05e4('0x53')]==='6'){if(this[_0x05e4('0x1a')][_0x5d6719[_0x05e4('0x3d')][_0x05e4('0x3c')]('-')[0x0]]){this[_0x05e4('0x19')][_0x5d6719['uniqueid']][_0x05e4('0x5c')]=this[_0x05e4('0x1a')][_0x5d6719[_0x05e4('0x3d')][_0x05e4('0x3c')]('-')[0x0]]['id'];this[_0x05e4('0x19')][_0x5d6719['uniqueid']][_0x05e4('0x5d')]=this[_0x05e4('0x1a')][_0x5d6719[_0x05e4('0x3d')]['split']('-')[0x0]][_0x05e4('0x41')];}}}}}}catch(_0x511e6d){logger['error'](_0x05e4('0x5e'),util['inspect'](_0x511e6d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05e4('0x2d')][_0x05e4('0x5f')]=function(_0x398e9b,_0x566051){if(this['channels'][_0x398e9b]){this[_0x05e4('0x19')][_0x398e9b]['monitor']=!![];if(_['endsWith'](_0x566051,'.wav49')){_0x566051=_0x566051['replace'](_0x05e4('0x60'),'.WAV');}this[_0x05e4('0x19')][_0x398e9b]['monitorFilename']=_0x566051;var _0xfd0efc=_[_0x05e4('0x61')](this[_0x05e4('0x19')][_0x398e9b][_0x05e4('0x62')],{'filename':_0x566051});if(_[_0x05e4('0x63')](_0xfd0efc)){this[_0x05e4('0x19')][_0x398e9b]['monitors'][_0x05e4('0x64')]({'filename':_0x566051,'createdAt':moment()[_0x05e4('0x3f')](_0x05e4('0x37')),'mixmonitorid':'','status':_0x05e4('0x65')});}}};VoiceCallReport[_0x05e4('0x2d')]['syncVarSet']=function(_0x11dd1d){try{if(this[_0x05e4('0x2e')](_0x11dd1d)){if(this[_0x05e4('0x19')][_0x11dd1d['uniqueid']]&&_0x11dd1d[_0x05e4('0x3d')]!=_0x05e4('0x34')){if(this[_0x05e4('0x2e')](_0x11dd1d['variable'])){if(this['isNotNull'](_0x11dd1d['variable']['mixmonitor_filename'])){this[_0x05e4('0x5f')](_0x11dd1d[_0x05e4('0x31')],_0x11dd1d['value']);}else if(this[_0x05e4('0x2e')](_0x11dd1d[_0x05e4('0x66')]['xmd-phone'])){this[_0x05e4('0x19')][_0x11dd1d[_0x05e4('0x31')]][_0x05e4('0x58')]=_0x11dd1d[_0x05e4('0x67')];}else if(this[_0x05e4('0x2e')](_0x11dd1d['variable'][_0x05e4('0x68')])){this[_0x05e4('0x19')][_0x11dd1d[_0x05e4('0x31')]][_0x05e4('0x69')]=_0x11dd1d[_0x05e4('0x67')];}else if(this[_0x05e4('0x2e')](_0x11dd1d[_0x05e4('0x66')]['xmd-cdrtype'])){this[_0x05e4('0x19')][_0x11dd1d['uniqueid']][_0x05e4('0x6a')]=_0x11dd1d[_0x05e4('0x67')];}else if(this[_0x05e4('0x2e')](_0x11dd1d[_0x05e4('0x66')]['xmd-queue'])){this[_0x05e4('0x19')][_0x11dd1d[_0x05e4('0x31')]][_0x05e4('0xf')]=_0x11dd1d[_0x05e4('0x67')][_0x05e4('0x3c')](',')[0x0];}else if(this[_0x05e4('0x2e')](_0x11dd1d[_0x05e4('0x66')][_0x05e4('0x6b')])){this[_0x05e4('0x19')][_0x11dd1d[_0x05e4('0x31')]][_0x05e4('0x6c')]=_0x11dd1d[_0x05e4('0x67')];}else if(this['isNotNull'](_0x11dd1d[_0x05e4('0x66')][_0x05e4('0x6d')])){this[_0x05e4('0x19')][_0x11dd1d[_0x05e4('0x31')]][_0x05e4('0x6e')]=_0x11dd1d['value'];}else if(this['isNotNull'](_0x11dd1d[_0x05e4('0x66')]['xmd-callerid-preview'])){this['channels'][_0x11dd1d[_0x05e4('0x31')]]['calleridpreview']=_0x11dd1d['value'];}else if(this[_0x05e4('0x2e')](_0x11dd1d[_0x05e4('0x66')][_0x05e4('0x6f')])){this[_0x05e4('0x19')][_0x11dd1d[_0x05e4('0x31')]]['queue']=_0x11dd1d[_0x05e4('0x67')];}else if(this[_0x05e4('0x2e')](_0x11dd1d['variable'][_0x05e4('0x70')])){this[_0x05e4('0x19')][_0x11dd1d[_0x05e4('0x31')]]['sipcalluniqueid']=_0x11dd1d['value'];}}}else if(this[_0x05e4('0x2e')](_0x11dd1d[_0x05e4('0x66')]['mixmonitor_filename'])){if(_0x11dd1d[_0x05e4('0x67')]){var _0x54fb9b=path[_0x05e4('0x71')](_0x11dd1d[_0x05e4('0x67')])['name'];this['syncMixMonitorFilename'](_0x54fb9b,_0x11dd1d[_0x05e4('0x67')]);}}else if(this[_0x05e4('0x19')][_0x11dd1d['linkedid']]){if(this['isNotNull'](_0x11dd1d[_0x05e4('0x66')])){if(this['isNotNull'](_0x11dd1d[_0x05e4('0x66')][_0x05e4('0x70')])){this[_0x05e4('0x19')][_0x11dd1d[_0x05e4('0x30')]][_0x05e4('0x72')]=_0x11dd1d[_0x05e4('0x67')];}}}}}catch(_0x3592d1){logger[_0x05e4('0x44')](_0x05e4('0x73'),util[_0x05e4('0x33')](_0x3592d1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05e4('0x2d')][_0x05e4('0x74')]=function(_0x3db185){try{if(this[_0x05e4('0x2e')](_0x3db185)){if(this[_0x05e4('0x19')][_0x3db185['uniqueid']]){var _0x5b832a=moment();this[_0x05e4('0x19')][_0x3db185['uniqueid']][_0x05e4('0x75')]=_0x5b832a[_0x05e4('0x3f')](_0x05e4('0x37'));this[_0x05e4('0x19')][_0x3db185[_0x05e4('0x31')]][_0x05e4('0x4a')]=_0x5b832a[_0x05e4('0x57')](this['channels'][_0x3db185[_0x05e4('0x31')]][_0x05e4('0x36')],_0x05e4('0x4b'));if(this[_0x05e4('0x19')][_0x3db185[_0x05e4('0x31')]]['answered']){this[_0x05e4('0x19')][_0x3db185[_0x05e4('0x31')]][_0x05e4('0x76')]=_0x5b832a[_0x05e4('0x57')](this['channels'][_0x3db185[_0x05e4('0x31')]][_0x05e4('0x55')],_0x05e4('0x4b'));this[_0x05e4('0x19')][_0x3db185[_0x05e4('0x31')]]['holdtime']=this[_0x05e4('0x19')][_0x3db185['uniqueid']][_0x05e4('0x4a')]-this[_0x05e4('0x19')][_0x3db185[_0x05e4('0x31')]][_0x05e4('0x76')];}if(_0x3db185['context']===_0x05e4('0x3b')){if(this[_0x05e4('0x1a')][_0x3db185[_0x05e4('0x3d')][_0x05e4('0x3c')]('-')[0x0]]){this[_0x05e4('0x1a')][_0x3db185['channel'][_0x05e4('0x3c')]('-')[0x0]]=_['omit'](this[_0x05e4('0x1a')][_0x3db185[_0x05e4('0x3d')]['split']('-')[0x0]],[_0x05e4('0x3e')]);this[_0x05e4('0x77')](util[_0x05e4('0x3f')](_0x05e4('0x40'),this[_0x05e4('0x1a')][_0x3db185[_0x05e4('0x3d')][_0x05e4('0x3c')]('-')[0x0]]['name']),_0x05e4('0x78'),{'destaccountcode':this['agents'][_0x3db185['channel'][_0x05e4('0x3c')]('-')[0x0]][_0x05e4('0x43')]});}}ami[_0x05e4('0x77')]('custom:voiceCallReport',this[_0x05e4('0x19')][_0x3db185[_0x05e4('0x31')]]);delete this[_0x05e4('0x19')][_0x3db185[_0x05e4('0x31')]];}}}catch(_0x349414){logger[_0x05e4('0x44')]('[syncHangup][VoiceCallReport]',util['inspect'](_0x349414,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05e4('0x2d')][_0x05e4('0x79')]=function(_0x46dbf1){try{if(this[_0x05e4('0x2e')](_0x46dbf1)){if(this[_0x05e4('0x19')][_0x46dbf1[_0x05e4('0x7a')]]){this[_0x05e4('0x19')][_0x46dbf1[_0x05e4('0x7a')]][_0x05e4('0x7b')]=_0x46dbf1[_0x05e4('0x7c')];this[_0x05e4('0x19')][_0x46dbf1['transfereeuniqueid']][_0x05e4('0x7d')]=_0x46dbf1[_0x05e4('0x7e')];if(this[_0x05e4('0x19')][_0x46dbf1[_0x05e4('0x7f')]]){var _0x499dda=this[_0x05e4('0x19')][_0x46dbf1['secondtransfereruniqueid']];this[_0x05e4('0x19')][_0x46dbf1[_0x05e4('0x7f')]]=this[_0x05e4('0x19')][_0x46dbf1[_0x05e4('0x7a')]];this[_0x05e4('0x19')][_0x46dbf1['transfereeuniqueid']]=_0x499dda;}}else if(this[_0x05e4('0x19')][_0x46dbf1[_0x05e4('0x80')]]){this[_0x05e4('0x19')][_0x46dbf1['transfertargetuniqueid']][_0x05e4('0x7b')]=_0x46dbf1[_0x05e4('0x7c')];this['channels'][_0x46dbf1[_0x05e4('0x80')]][_0x05e4('0x7d')]=_0x46dbf1['transfertargetcalleridnum'];if(this['channels'][_0x46dbf1[_0x05e4('0x81')]]){var _0x499dda=this[_0x05e4('0x19')][_0x46dbf1[_0x05e4('0x81')]];this['channels'][_0x46dbf1[_0x05e4('0x81')]]=this['channels'][_0x46dbf1[_0x05e4('0x80')]];this[_0x05e4('0x19')][_0x46dbf1[_0x05e4('0x80')]]=_0x499dda;}}}}catch(_0x1363a9){logger['error'](_0x05e4('0x82'),util['inspect'](_0x1363a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05e4('0x2d')][_0x05e4('0x25')]=function(_0x4e4e70){try{if(this['isNotNull'](_0x4e4e70)){if(this[_0x05e4('0x19')][_0x4e4e70[_0x05e4('0x7a')]]){this[_0x05e4('0x19')][_0x4e4e70[_0x05e4('0x7a')]]['transfercalleridnum']=_0x4e4e70[_0x05e4('0x83')];this[_0x05e4('0x19')][_0x4e4e70[_0x05e4('0x7a')]][_0x05e4('0x7d')]=_0x4e4e70[_0x05e4('0x84')];this[_0x05e4('0x74')]({'event':_0x05e4('0x85'),'uniqueid':_0x4e4e70[_0x05e4('0x7a')],'context':_0x4e4e70['context'],'channel':_0x4e4e70[_0x05e4('0x86')]});}}}catch(_0x59419a){logger[_0x05e4('0x44')]('[syncBlindTransfer][VoiceCallReport]',util[_0x05e4('0x33')](_0x59419a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x48ec7d){try{if(this[_0x05e4('0x2e')](_0x48ec7d)){if(this[_0x05e4('0x19')][_0x48ec7d[_0x05e4('0x31')]]){if(!_[_0x05e4('0x63')](this[_0x05e4('0x19')][_0x48ec7d['uniqueid']][_0x05e4('0x55')])){this['channels'][_0x48ec7d[_0x05e4('0x31')]][_0x05e4('0x87')]=moment()[_0x05e4('0x3f')](_0x05e4('0x37'));}}}}catch(_0x42d3a1){logger[_0x05e4('0x44')](_0x05e4('0x88'),util[_0x05e4('0x33')](_0x42d3a1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05e4('0x2d')]['syncMusicOnHoldStop']=function(_0x3c37ec){try{if(this['isNotNull'](_0x3c37ec)){if(this['channels'][_0x3c37ec['uniqueid']]){if(!_['isNil'](this['channels'][_0x3c37ec[_0x05e4('0x31')]]['mohstarttime'])){this[_0x05e4('0x19')][_0x3c37ec[_0x05e4('0x31')]]['mohtime']+=moment()[_0x05e4('0x89')](0x0)[_0x05e4('0x57')](this[_0x05e4('0x19')][_0x3c37ec[_0x05e4('0x31')]][_0x05e4('0x87')],'seconds');delete this[_0x05e4('0x19')][_0x3c37ec['uniqueid']]['mohstarttime'];}}}}catch(_0x5f43bd){logger[_0x05e4('0x44')](_0x05e4('0x8a'),util[_0x05e4('0x33')](_0x5f43bd,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 7e797eb..4cb5b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b6b=['sipuri','membercalls','memberinterface','memberlastcall','membername','memberrealtime','includes','syncHangup','endtime','duration','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','prototype','isNotNull','isUndefined','emit','channels','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','substring','omit','event','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','connect','custom:dialconnect','voice:outbound','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','value','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x5b6b,0x121));var _0xb5b6=function(_0x2fa703,_0x5aee30){_0x2fa703=_0x2fa703-0x0;var _0x39f598=_0x5b6b[_0x2fa703];return _0x39f598;};'use strict';var _=require(_0xb5b6('0x0'));var moment=require('moment');var util=require(_0xb5b6('0x1'));var Redis=require('ioredis');var config=require(_0xb5b6('0x2'));var logger=require(_0xb5b6('0x3'))(_0xb5b6('0x4'));var ami=require(_0xb5b6('0x5'));config[_0xb5b6('0x6')]=_[_0xb5b6('0x7')](config[_0xb5b6('0x6')],{'host':_0xb5b6('0x8'),'port':0x18eb});var io=require(_0xb5b6('0x9'))(new Redis(config[_0xb5b6('0x6')]));function VoiceDialReport(_0x464619){this['channels']=_0x464619[_0xb5b6('0xa')];this[_0xb5b6('0xb')]=_0x464619[_0xb5b6('0xb')];this[_0xb5b6('0xc')]={};ami['on'](_0xb5b6('0xd'),this[_0xb5b6('0xe')][_0xb5b6('0xf')](this));ami['on'](_0xb5b6('0x10'),this[_0xb5b6('0x11')]['bind'](this));ami['on'](_0xb5b6('0x12'),this[_0xb5b6('0x13')][_0xb5b6('0xf')](this));ami['on']('hangup',this['syncHangup'][_0xb5b6('0xf')](this));}VoiceDialReport[_0xb5b6('0x14')][_0xb5b6('0x15')]=function(_0x675c80){return _0x675c80!==null&&!_[_0xb5b6('0x16')](_0x675c80);};VoiceDialReport[_0xb5b6('0x14')][_0xb5b6('0x17')]=function(_0x2ee242,_0x24038a,_0x30f4d9){io['to'](_0x2ee242)[_0xb5b6('0x17')](_0x24038a,_0x30f4d9);};VoiceDialReport[_0xb5b6('0x14')][_0xb5b6('0xe')]=function(_0x1e46d5){try{if(this[_0xb5b6('0x15')](_0x1e46d5)){if(this[_0xb5b6('0x18')][_0x1e46d5[_0xb5b6('0x19')]]){_[_0xb5b6('0x1a')](this[_0xb5b6('0x18')][_0x1e46d5[_0xb5b6('0x19')]],{'starttime':moment()[_0xb5b6('0x1b')](_0xb5b6('0x1c')),'lastevent':_0xb5b6('0x1d'),'interface':_0x1e46d5[_0xb5b6('0x1e')]['substring'](0x0,_0x1e46d5['channel'][_0xb5b6('0x1f')]('-')),'membername':_0x1e46d5[_0xb5b6('0x1e')][_0xb5b6('0x20')](_0x1e46d5['channel'][_0xb5b6('0x1f')]('/')+0x1,_0x1e46d5['channel'][_0xb5b6('0x1f')]('-'))},_[_0xb5b6('0x21')](_0x1e46d5,[_0xb5b6('0x22'),'privilege']));this['emit']('voice:outbound',_0xb5b6('0x23'),this[_0xb5b6('0x18')][_0x1e46d5[_0xb5b6('0x19')]]);ami['emit']('custom:dialbegin',this[_0xb5b6('0x18')][_0x1e46d5[_0xb5b6('0x19')]]);}}}catch(_0x2ab1a9){logger[_0xb5b6('0x24')](_0xb5b6('0x25'),util[_0xb5b6('0x26')](_0x2ab1a9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb5b6('0x14')][_0xb5b6('0x11')]=function(_0x4cdea5){try{if(this[_0xb5b6('0x15')](_0x4cdea5)){if(this[_0xb5b6('0x18')][_0x4cdea5[_0xb5b6('0x19')]]){this[_0xb5b6('0x18')][_0x4cdea5[_0xb5b6('0x19')]][_0xb5b6('0x27')]=_0x4cdea5[_0xb5b6('0x27')];if(_0x4cdea5[_0xb5b6('0x27')]===_0xb5b6('0x28')){this[_0xb5b6('0x18')][_0x4cdea5[_0xb5b6('0x19')]][_0xb5b6('0x29')]=_0x4cdea5[_0xb5b6('0x29')];this[_0xb5b6('0x18')][_0x4cdea5[_0xb5b6('0x19')]]['connectedlinename']=_0x4cdea5[_0xb5b6('0x2a')];this['channels'][_0x4cdea5['uniqueid']]['answertime']=moment()['format'](_0xb5b6('0x1c'));this['channels'][_0x4cdea5[_0xb5b6('0x19')]][_0xb5b6('0x2b')]=_0xb5b6('0x2c');ami[_0xb5b6('0x17')](_0xb5b6('0x2d'),this[_0xb5b6('0x18')][_0x4cdea5[_0xb5b6('0x19')]]);}this[_0xb5b6('0x17')](_0xb5b6('0x2e'),_0xb5b6('0x23'),this[_0xb5b6('0x18')][_0x4cdea5[_0xb5b6('0x19')]]);}}}catch(_0x49cab7){logger['error'](_0xb5b6('0x2f'),util[_0xb5b6('0x26')](_0x49cab7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb5b6('0x14')][_0xb5b6('0x13')]=function(_0x2bb85f){try{if(this['isNotNull'](_0x2bb85f)){this[_0xb5b6('0x30')](_0x2bb85f[_0xb5b6('0x19')],_[_0xb5b6('0x31')](_0x2bb85f[_0xb5b6('0x32')])[0x0],_0x2bb85f[_0xb5b6('0x33')]);if(this[_0xb5b6('0x15')](_0x2bb85f[_0xb5b6('0x32')])&&this[_0xb5b6('0x15')](_0x2bb85f[_0xb5b6('0x32')]['outboundrouteid'])){if(_[_0xb5b6('0x16')](this[_0xb5b6('0x18')][_0x2bb85f[_0xb5b6('0x19')]])){this[_0xb5b6('0x18')][_0x2bb85f[_0xb5b6('0x19')]]={'routeId':_0x2bb85f[_0xb5b6('0x33')],'variables':this[_0xb5b6('0xc')][_0x2bb85f['uniqueid']]};this[_0xb5b6('0x17')](_0xb5b6('0x2e'),_0xb5b6('0x23'),this['channels'][_0x2bb85f['uniqueid']]);}}}}catch(_0x2f596d){logger['error'](_0xb5b6('0x34'),util['inspect'](_0x2f596d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb5b6('0x30')]=function(_0x458413,_0x3cfe69,_0x182973){var _0x55317d=[_0xb5b6('0x35'),_0xb5b6('0x36'),_0xb5b6('0x37'),_0xb5b6('0x38'),_0xb5b6('0x39'),'rtpaudioqoslossbridged',_0xb5b6('0x3a'),'rtpaudioqosrttbridged','sipcallid',_0xb5b6('0x3b'),'bridgepeer','bridgepvtcallid',_0xb5b6('0x3c'),'memberdynamic',_0xb5b6('0x3d'),_0xb5b6('0x3e'),_0xb5b6('0x3f'),'memberpenalty',_0xb5b6('0x40')];if(!_['isNil'](_0x3cfe69)&&!_[_0xb5b6('0x41')](_0x55317d,_0x3cfe69)){if(_['isUndefined'](this[_0xb5b6('0xc')][_0x458413])){this[_0xb5b6('0xc')][_0x458413]={};}this[_0xb5b6('0xc')][_0x458413][_0x3cfe69]=_0x182973;}};VoiceDialReport[_0xb5b6('0x14')][_0xb5b6('0x42')]=function(_0x558b65){try{if(this[_0xb5b6('0x15')](_0x558b65)){if(this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]]){this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x43')]=moment()[_0xb5b6('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x44')]=moment(this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x43')])[_0xb5b6('0x45')](this['channels'][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x46')],_0xb5b6('0x47'));this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x2b')]=_0xb5b6('0x48');this['outbound'][_0xb5b6('0x49')]+=0x1;if(this['channels'][_0x558b65[_0xb5b6('0x19')]]['answertime']){this[_0xb5b6('0xb')][_0xb5b6('0x4a')]+=0x1;this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x4b')]=moment(this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]]['answertime'])[_0xb5b6('0x45')](this['channels'][_0x558b65['uniqueid']][_0xb5b6('0x46')],_0xb5b6('0x47'));this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x4c')]=moment(this['channels'][_0x558b65[_0xb5b6('0x19')]]['endtime'])[_0xb5b6('0x45')](this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]]['answertime'],_0xb5b6('0x47'));this[_0xb5b6('0xb')][_0xb5b6('0x4d')]+=this[_0xb5b6('0x18')][_0x558b65['uniqueid']]['holdtime']||0x0;this[_0xb5b6('0xb')]['sumBillable']+=this['channels'][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x4c')];}this[_0xb5b6('0xb')]['sumDuration']+=this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]][_0xb5b6('0x44')];ami[_0xb5b6('0x17')](_0xb5b6('0x4e'),this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]]);ami[_0xb5b6('0x17')](_0xb5b6('0x4f'),this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]]);this[_0xb5b6('0x17')]('voice:outbound',_0xb5b6('0x50'),this[_0xb5b6('0xb')]);logger[_0xb5b6('0x51')](_0xb5b6('0x52'),JSON[_0xb5b6('0x53')](this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]]));this[_0xb5b6('0x17')](_0xb5b6('0x2e'),_0xb5b6('0x54'),this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]]);delete this[_0xb5b6('0x18')][_0x558b65[_0xb5b6('0x19')]];}if(this[_0xb5b6('0xc')][_0x558b65[_0xb5b6('0x19')]]){delete this[_0xb5b6('0xc')][_0x558b65[_0xb5b6('0x19')]];}}}catch(_0x56cbf2){logger[_0xb5b6('0x24')](_0xb5b6('0x55'),util[_0xb5b6('0x26')](_0x56cbf2,{'showHidden':![],'depth':null}));}};module[_0xb5b6('0x56')]=VoiceDialReport;
\ No newline at end of file
+var _0x29e0=['dialstatus','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','voice_outbound_channel:save','keys','variable','outboundrouteid','value','error','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipcallid','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','includes','syncHangup','duration','endtime','diff','starttime','seconds','complete','answered','holdtime','billableseconds','sumBillable','sumDuration','custom:voiceDialReport','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','channels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','event','voice:outbound','custom:dialbegin','inspect'];(function(_0x18d29b,_0x3034d2){var _0x3c354f=function(_0xb6ea2){while(--_0xb6ea2){_0x18d29b['push'](_0x18d29b['shift']());}};_0x3c354f(++_0x3034d2);}(_0x29e0,0x1c8));var _0x029e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x029e('0x0'));var moment=require(_0x029e('0x1'));var util=require(_0x029e('0x2'));var Redis=require(_0x029e('0x3'));var config=require(_0x029e('0x4'));var logger=require(_0x029e('0x5'))(_0x029e('0x6'));var ami=require(_0x029e('0x7'));config[_0x029e('0x8')]=_[_0x029e('0x9')](config[_0x029e('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x029e('0x8')]));function VoiceDialReport(_0x3571ef){this[_0x029e('0xa')]=_0x3571ef['outboundChannels'];this[_0x029e('0xb')]=_0x3571ef['outbound'];this[_0x029e('0xc')]={};ami['on'](_0x029e('0xd'),this[_0x029e('0xe')][_0x029e('0xf')](this));ami['on'](_0x029e('0x10'),this[_0x029e('0x11')]['bind'](this));ami['on'](_0x029e('0x12'),this[_0x029e('0x13')][_0x029e('0xf')](this));ami['on'](_0x029e('0x14'),this['syncHangup'][_0x029e('0xf')](this));}VoiceDialReport[_0x029e('0x15')][_0x029e('0x16')]=function(_0x1a9e07){return _0x1a9e07!==null&&!_[_0x029e('0x17')](_0x1a9e07);};VoiceDialReport[_0x029e('0x15')][_0x029e('0x18')]=function(_0x272d04,_0x31381c,_0x5a3708){io['to'](_0x272d04)[_0x029e('0x18')](_0x31381c,_0x5a3708);};VoiceDialReport['prototype'][_0x029e('0xe')]=function(_0x427f82){try{if(this[_0x029e('0x16')](_0x427f82)){if(this[_0x029e('0xa')][_0x427f82[_0x029e('0x19')]]){_[_0x029e('0x1a')](this[_0x029e('0xa')][_0x427f82['uniqueid']],{'starttime':moment()['format'](_0x029e('0x1b')),'lastevent':_0x029e('0x1c'),'interface':_0x427f82['channel'][_0x029e('0x1d')](0x0,_0x427f82[_0x029e('0x1e')][_0x029e('0x1f')]('-')),'membername':_0x427f82['channel'][_0x029e('0x1d')](_0x427f82[_0x029e('0x1e')][_0x029e('0x1f')]('/')+0x1,_0x427f82[_0x029e('0x1e')][_0x029e('0x1f')]('-'))},_['omit'](_0x427f82,[_0x029e('0x20'),'privilege']));this['emit'](_0x029e('0x21'),'voice_outbound_channel:save',this[_0x029e('0xa')][_0x427f82[_0x029e('0x19')]]);ami[_0x029e('0x18')](_0x029e('0x22'),this[_0x029e('0xa')][_0x427f82[_0x029e('0x19')]]);}}}catch(_0x42c41c){logger['error']('[syncDialBegin][VoiceDialReport]',util[_0x029e('0x23')](_0x42c41c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x029e('0x15')][_0x029e('0x11')]=function(_0x1c1dd9){try{if(this[_0x029e('0x16')](_0x1c1dd9)){if(this[_0x029e('0xa')][_0x1c1dd9[_0x029e('0x19')]]){this['channels'][_0x1c1dd9['uniqueid']][_0x029e('0x24')]=_0x1c1dd9[_0x029e('0x24')];if(_0x1c1dd9[_0x029e('0x24')]==='ANSWER'){this[_0x029e('0xa')][_0x1c1dd9['uniqueid']][_0x029e('0x25')]=_0x1c1dd9[_0x029e('0x25')];this['channels'][_0x1c1dd9[_0x029e('0x19')]]['connectedlinename']=_0x1c1dd9[_0x029e('0x26')];this['channels'][_0x1c1dd9[_0x029e('0x19')]][_0x029e('0x27')]=moment()[_0x029e('0x28')](_0x029e('0x1b'));this[_0x029e('0xa')][_0x1c1dd9['uniqueid']][_0x029e('0x29')]=_0x029e('0x2a');ami[_0x029e('0x18')]('custom:dialconnect',this[_0x029e('0xa')][_0x1c1dd9[_0x029e('0x19')]]);}this[_0x029e('0x18')](_0x029e('0x21'),_0x029e('0x2b'),this[_0x029e('0xa')][_0x1c1dd9[_0x029e('0x19')]]);}}}catch(_0x55c5b2){logger['error']('[syncDialEnd][VoiceDialReport]',util[_0x029e('0x23')](_0x55c5b2,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x2a2a13){try{if(this[_0x029e('0x16')](_0x2a2a13)){this['addVariable'](_0x2a2a13[_0x029e('0x19')],_[_0x029e('0x2c')](_0x2a2a13[_0x029e('0x2d')])[0x0],_0x2a2a13['value']);if(this['isNotNull'](_0x2a2a13['variable'])&&this[_0x029e('0x16')](_0x2a2a13['variable'][_0x029e('0x2e')])){if(_['isUndefined'](this[_0x029e('0xa')][_0x2a2a13[_0x029e('0x19')]])){this[_0x029e('0xa')][_0x2a2a13[_0x029e('0x19')]]={'routeId':_0x2a2a13[_0x029e('0x2f')],'variables':this[_0x029e('0xc')][_0x2a2a13[_0x029e('0x19')]]};this[_0x029e('0x18')](_0x029e('0x21'),'voice_outbound_channel:save',this[_0x029e('0xa')][_0x2a2a13[_0x029e('0x19')]]);}}}}catch(_0x3c4e84){logger[_0x029e('0x30')](_0x029e('0x31'),util['inspect'](_0x3c4e84,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x029e('0x15')]['addVariable']=function(_0x127f6e,_0x40f78c,_0xf6519e){var _0x418017=[_0x029e('0x32'),_0x029e('0x33'),_0x029e('0x34'),_0x029e('0x35'),_0x029e('0x36'),_0x029e('0x37'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x029e('0x38'),'sipuri','bridgepeer',_0x029e('0x39'),'membercalls',_0x029e('0x3a'),_0x029e('0x3b'),_0x029e('0x3c'),_0x029e('0x3d'),_0x029e('0x3e'),'memberrealtime'];if(!_['isNil'](_0x40f78c)&&!_[_0x029e('0x3f')](_0x418017,_0x40f78c)){if(_['isUndefined'](this['variables'][_0x127f6e])){this[_0x029e('0xc')][_0x127f6e]={};}this[_0x029e('0xc')][_0x127f6e][_0x40f78c]=_0xf6519e;}};VoiceDialReport[_0x029e('0x15')][_0x029e('0x40')]=function(_0x2ebbb3){try{if(this['isNotNull'](_0x2ebbb3)){if(this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]]){this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]]['endtime']=moment()['format'](_0x029e('0x1b'));this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x41')]=moment(this['channels'][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x42')])[_0x029e('0x43')](this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x44')],_0x029e('0x45'));this[_0x029e('0xa')][_0x2ebbb3['uniqueid']][_0x029e('0x29')]=_0x029e('0x46');this[_0x029e('0xb')]['total']+=0x1;if(this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x27')]){this[_0x029e('0xb')][_0x029e('0x47')]+=0x1;this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x48')]=moment(this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]]['answertime'])[_0x029e('0x43')](this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x44')],'seconds');this['channels'][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x49')]=moment(this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]]['endtime'])['diff'](this['channels'][_0x2ebbb3[_0x029e('0x19')]]['answertime'],'seconds');this[_0x029e('0xb')]['sumHoldTime']+=this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x48')]||0x0;this[_0x029e('0xb')][_0x029e('0x4a')]+=this['channels'][_0x2ebbb3[_0x029e('0x19')]][_0x029e('0x49')];}this[_0x029e('0xb')][_0x029e('0x4b')]+=this[_0x029e('0xa')][_0x2ebbb3['uniqueid']][_0x029e('0x41')];ami[_0x029e('0x18')](_0x029e('0x4c'),this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]]);ami[_0x029e('0x18')]('custom:dialend',this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]]);this[_0x029e('0x18')](_0x029e('0x21'),'voice_outbound:save',this[_0x029e('0xb')]);logger[_0x029e('0x4d')](_0x029e('0x4e'),JSON['stringify'](this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]]));this[_0x029e('0x18')](_0x029e('0x21'),_0x029e('0x4f'),this[_0x029e('0xa')][_0x2ebbb3['uniqueid']]);delete this[_0x029e('0xa')][_0x2ebbb3[_0x029e('0x19')]];}if(this[_0x029e('0xc')][_0x2ebbb3['uniqueid']]){delete this[_0x029e('0xc')][_0x2ebbb3[_0x029e('0x19')]];}}}catch(_0x336979){logger['error'](_0x029e('0x50'),util[_0x029e('0x23')](_0x336979,{'showHidden':![],'depth':null}));}};module[_0x029e('0x51')]=VoiceDialReport;
\ No newline at end of file
index 8ee3fdd..431ad70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b3d=['enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','agentconnect','syncAgentConnect','varset','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','isUndefined','originated','isEmpty','talking','pTalking','waiting','queueStatusComplete','unlockRR','hasOwnProperty','channels','switch','Action','catch','No\x20such\x20channel','[voiceQueueReport][checkChannel]','error','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','voice_queue_channel:save','info','stringify','type','name','strategy','answered','available','loggedIn','total','unmanaged','abandoned','Trunk','active','callerid','Interval','voice_queue:save','loopQueueShow','clearZombieChannels','[queues]','then','[queuesummary]','syncQueueSummary','isNotNull','queue','countBy','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','inbound','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','syncAgentComplete','membername','queuecallerexit','transfer','reason','startsWith','channel','toLowerCase','local/','queuecallerexitAt','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','linkedid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','syncVarSet','addVariable','value','variable','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberpenalty','memberrealtime','isNil','includes','length','sumHoldTime','diff','sumDuration','milliseconds','queuecallercompleteAt','custom:voiceQueueReport','transfereeuniqueid','transferexten','secondtransfereruniqueid','ATTENDEDTRANSFER','origtransfererexten','origtransfereruniqueid','transfertargetuniqueid','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','BlindTransfer','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','moment','bluebird','util','md5','ioredis','../../../config/logger','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype'];(function(_0x2007cf,_0x42a0c1){var _0x60255c=function(_0x32efaa){while(--_0x32efaa){_0x2007cf['push'](_0x2007cf['shift']());}};_0x60255c(++_0x42a0c1);}(_0x2b3d,0xb6));var _0xd2b3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2b3d[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var moment=require(_0xd2b3('0x0'));var BPromise=require(_0xd2b3('0x1'));var util=require(_0xd2b3('0x2'));var md5=require(_0xd2b3('0x3'));var Redis=require(_0xd2b3('0x4'));var config=require('../../../config/environment');var logger=require(_0xd2b3('0x5'))('ami');var ami=require(_0xd2b3('0x6'));var QueueReport=require(_0xd2b3('0x7'));config[_0xd2b3('0x8')]=_[_0xd2b3('0x9')](config[_0xd2b3('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd2b3('0xa'))(new Redis(config[_0xd2b3('0x8')]));var Sequence=function(){};Sequence[_0xd2b3('0xb')][_0xd2b3('0xc')]=function(_0x3a9a3a){this[_0xd2b3('0xd')]=this[_0xd2b3('0xd')]?this[_0xd2b3('0xd')][_0xd2b3('0xe')](_0x3a9a3a):_0x3a9a3a();};function VoiceQueueReport(_0x491651){this[_0xd2b3('0xf')]=new Sequence();this[_0xd2b3('0x10')]={};this[_0xd2b3('0x11')]=_0x491651[_0xd2b3('0x11')];this['channels']=_0x491651[_0xd2b3('0x12')];this[_0xd2b3('0x13')]=_0x491651[_0xd2b3('0x13')];this[_0xd2b3('0x14')]=!![];this[_0xd2b3('0x15')]=_0x491651[_0xd2b3('0x15')];this[_0xd2b3('0x16')]={};ami['on'](_0xd2b3('0x17'),this['syncQueueSummary']['bind'](this));ami['on'](_0xd2b3('0x18'),this[_0xd2b3('0x19')][_0xd2b3('0x1a')](this));ami['on'](_0xd2b3('0x1b'),this[_0xd2b3('0x1c')]['bind'](this));ami['on'](_0xd2b3('0x1d'),this[_0xd2b3('0x1e')]['bind'](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0xd2b3('0x1a')](this));ami['on'](_0xd2b3('0x1f'),this['syncAgentComplete'][_0xd2b3('0x1a')](this));ami['on'](_0xd2b3('0x20'),this[_0xd2b3('0x21')]['bind'](this));ami['on'](_0xd2b3('0x22'),this['syncVarSet'][_0xd2b3('0x1a')](this));ami['on']('hangup',this[_0xd2b3('0x23')][_0xd2b3('0x1a')](this));ami['on'](_0xd2b3('0x24'),this[_0xd2b3('0x25')][_0xd2b3('0x1a')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xd2b3('0x1a')](this));ami['on']('musiconholdstop',this[_0xd2b3('0x26')][_0xd2b3('0x1a')](this));ami['on'](_0xd2b3('0x27'),this[_0xd2b3('0x28')][_0xd2b3('0x1a')](this));ami['on'](_0xd2b3('0x29'),this['syncBlindTransfer'][_0xd2b3('0x1a')](this));this[_0xd2b3('0x2a')]();this['loopQueueShow']();}function isNotNull(_0x356f0f){return _0x356f0f!==null&&!_[_0xd2b3('0x2b')](_0x356f0f);}function clearChannels(_0x5a498e){if(!_['isEmpty'](_0x5a498e)){for(var _0x312b54 in _0x5a498e){if(_0x5a498e['hasOwnProperty'](_0x312b54)){delete _0x5a498e[_0x312b54];}}}}function clearCampaigns(_0x1551d4){if(!_['isEmpty'](_0x1551d4)){for(var _0x594d6b in _0x1551d4){if(_0x1551d4['hasOwnProperty'](_0x594d6b)){_0x1551d4[_0x594d6b][_0xd2b3('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x4c12b2){if(!_[_0xd2b3('0x2d')](_0x4c12b2)){for(var _0xbbebcb in _0x4c12b2){if(_0x4c12b2['hasOwnProperty'](_0xbbebcb)){_0x4c12b2[_0xbbebcb][_0xd2b3('0x2c')]=0x0;_0x4c12b2[_0xbbebcb][_0xd2b3('0x2e')]=0x0;_0x4c12b2[_0xbbebcb][_0xd2b3('0x2f')]=0x0;_0x4c12b2[_0xbbebcb][_0xd2b3('0x30')]=0x0;_0x4c12b2[_0xbbebcb][_0xd2b3('0x31')]=!![];}}}}function clearAgentBooked(_0x422319){if(!_[_0xd2b3('0x2d')](_0x422319)){for(var _0xbfd27f in _0x422319){if(_0x422319['hasOwnProperty'](_0xbfd27f)){_0x422319[_0xbfd27f][_0xd2b3('0x32')]=!![];}}}}VoiceQueueReport['prototype']['clearZombieChannels']=function(){var _0x374063=this;for(var _0x192f7e in this['channels']){if(this['channels'][_0xd2b3('0x33')](_0x192f7e)&&!this[_0xd2b3('0x34')][_0x192f7e][_0xd2b3('0x35')]){this['sequence'][_0xd2b3('0xc')](function(){if(!_['isNil'](_0x374063['channels'][_0x192f7e])){return ami[_0xd2b3('0x36')]({'action':'status','channel':_0x374063[_0xd2b3('0x34')][_0x192f7e]['channel']})[_0xd2b3('0x37')](function(_0x1ef8a3){if(_0x1ef8a3['message']===_0xd2b3('0x38')){setTimeout(function(){if(_0x374063['channels'][_0x192f7e]){delete _0x374063[_0xd2b3('0x34')][_0x192f7e];logger['error'](_0xd2b3('0x39'),_0x192f7e);}if(_0x374063[_0xd2b3('0x10')][_0x192f7e]){delete _0x374063['queueReports'][_0x192f7e];logger[_0xd2b3('0x3a')]('[voiceQueueReport][checkQueueReport]',_0x192f7e);}if(_0x374063[_0xd2b3('0x16')][_0x192f7e]){delete _0x374063[_0xd2b3('0x16')][_0x192f7e];logger[_0xd2b3('0x3a')](_0xd2b3('0x3b'),_0x192f7e);}},0x1f40);}});}});}}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x25')]=function(){logger[_0xd2b3('0x3a')](_0xd2b3('0x3c'));clearChannels(this['channels']);this[_0xd2b3('0x3d')](this[_0xd2b3('0x10')]);clearAgentBooked(this[_0xd2b3('0x11')]);clearVoiceQueues(this[_0xd2b3('0x13')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x3d')]=function(_0x44e176){var _0x5a3b76=this;if(!_[_0xd2b3('0x2d')](_0x44e176)){for(var _0x371d6e in _0x44e176){if(_0x44e176['hasOwnProperty'](_0x371d6e)){_0x5a3b76[_0xd2b3('0x3e')](_0x44e176[_0x371d6e]);delete _0x44e176[_0x371d6e];}}}};function loggerCatch(_0xdfd6c4){return function(_0x305299){logger[_0xd2b3('0x3a')](_0xdfd6c4,util[_0xd2b3('0x3f')](_0x305299,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x40')]=function(_0x3b2fe9,_0x550dfe,_0x1192bc){io['to'](_0x3b2fe9)[_0xd2b3('0x40')](_0x550dfe,_0x1192bc);};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x41')]=function(_0x1c5c46){this[_0xd2b3('0x40')](util[_0xd2b3('0x42')](_0xd2b3('0x43'),_0x1c5c46['name']),_0xd2b3('0x44'),_0x1c5c46);};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x3e')]=function(_0x53416b){logger[_0xd2b3('0x45')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd2b3('0x46')](_0x53416b));this[_0xd2b3('0x40')](util[_0xd2b3('0x42')](_0xd2b3('0x43'),_0x53416b['name']),'voice_queue_channel:remove',_0x53416b);};VoiceQueueReport[_0xd2b3('0xb')]['emitVoiceQueueSummary']=function(_0x463a6b){if(_0x463a6b[_0xd2b3('0x47')]==='inbound'){var _0x173d60={'id':_0x463a6b['id'],'name':_0x463a6b[_0xd2b3('0x48')],'strategy':_0x463a6b[_0xd2b3('0x49')],'answered':_0x463a6b[_0xd2b3('0x4a')],'available':_0x463a6b[_0xd2b3('0x4b')],'loggedIn':_0x463a6b[_0xd2b3('0x4c')],'pTalking':_0x463a6b[_0xd2b3('0x2f')],'sumBillable':_0x463a6b['sumBillable'],'sumDuration':_0x463a6b['sumDuration'],'sumHoldTime':_0x463a6b['sumHoldTime']||0x0,'talking':_0x463a6b[_0xd2b3('0x2e')],'total':_0x463a6b[_0xd2b3('0x4d')],'type':_0x463a6b[_0xd2b3('0x47')],'unmanaged':_0x463a6b[_0xd2b3('0x4e')],'abandoned':_0x463a6b[_0xd2b3('0x4f')],'waiting':_0x463a6b[_0xd2b3('0x30')]};if(_0x463a6b[_0xd2b3('0x50')]){_0x173d60[_0xd2b3('0x50')]={'id':_0x463a6b[_0xd2b3('0x50')]['id'],'name':_0x463a6b[_0xd2b3('0x50')][_0xd2b3('0x48')],'active':_0x463a6b[_0xd2b3('0x50')][_0xd2b3('0x51')],'callerid':_0x463a6b['Trunk'][_0xd2b3('0x52')]};}if(_0x463a6b[_0xd2b3('0x53')]){_0x173d60['Interval']={'id':_0x463a6b['Interval']['id'],'name':_0x463a6b[_0xd2b3('0x53')][_0xd2b3('0x48')]};}var _0x25f702=md5(JSON[_0xd2b3('0x46')](_0x173d60));if(_0x463a6b[_0xd2b3('0x3')]!==_0x25f702){_0x463a6b[_0xd2b3('0x3')]=_0x25f702;this[_0xd2b3('0x40')](util[_0xd2b3('0x42')]('voice:queue:%s',_0x173d60[_0xd2b3('0x48')]),_0xd2b3('0x54'),_0x173d60);}}};VoiceQueueReport['prototype']['isNotNull']=function(_0x3b3acd){return _0x3b3acd!==null&&!_[_0xd2b3('0x2b')](_0x3b3acd);};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x55')]=function(){var _0x1798e0=this;setInterval(function(){_0x1798e0[_0xd2b3('0x56')]();ami[_0xd2b3('0x36')]({'action':'queues'})['catch'](loggerCatch(_0xd2b3('0x57')));},0x2710);};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x2a')]=function(){var _0x211ece=this;setInterval(function(){if(_0x211ece[_0xd2b3('0x14')]){return ami['Action']({'action':'queuesummary'})[_0xd2b3('0x58')](function(_0x18ae02){_0x211ece[_0xd2b3('0x14')]=![];})[_0xd2b3('0x37')](loggerCatch(_0xd2b3('0x59')));}},0x3e8);};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x5a')]=function(_0xea9c1c){try{if(this[_0xd2b3('0x5b')](_0xea9c1c)&&this['isNotNull'](_0xea9c1c[_0xd2b3('0x5c')])){if(this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]]){var _0x51d4fb=_[_0xd2b3('0x5d')](this['channels'],_0xd2b3('0x5c'))[_0xea9c1c[_0xd2b3('0x5c')]]||0x0;var _0x21ee96=_0x51d4fb-_0xea9c1c[_0xd2b3('0x5e')];if(this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]]['waiting']!==_[_0xd2b3('0x5f')](_0xea9c1c[_0xd2b3('0x5e')])||this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x4c')]!==_[_0xd2b3('0x5f')](_0xea9c1c[_0xd2b3('0x60')])||this[_0xd2b3('0x13')][_0xea9c1c['queue']][_0xd2b3('0x4b')]!==_[_0xd2b3('0x5f')](_0xea9c1c[_0xd2b3('0x4b')])||this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x2e')]!==_0x21ee96){this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x30')]=_['toNumber'](_0xea9c1c[_0xd2b3('0x5e')]);this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x4c')]=_['toNumber'](_0xea9c1c[_0xd2b3('0x60')]);this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x4b')]=_[_0xd2b3('0x5f')](_0xea9c1c['available']);this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x2e')]=_0x21ee96>0x0?_0x21ee96:0x0;this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x2e')]=this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x2e')]>_[_0xd2b3('0x5f')](_0xea9c1c[_0xd2b3('0x60')])?_[_0xd2b3('0x5f')](_0xea9c1c[_0xd2b3('0x60')]):this['voiceQueues'][_0xea9c1c[_0xd2b3('0x5c')]][_0xd2b3('0x2e')];this[_0xd2b3('0x61')](this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]]);}ami[_0xd2b3('0x40')](_0xd2b3('0x62'),this[_0xd2b3('0x13')][_0xea9c1c[_0xd2b3('0x5c')]]);}}}catch(_0xe0be2a){logger[_0xd2b3('0x3a')](_0xd2b3('0x63'),util['inspect'](_0xe0be2a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2b3('0xb')]['syncQueueSummaryComplete']=function(_0x269003){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xd2b3('0x64')]=function(_0x524bf7){};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x1c')]=function(_0x2479af){try{if(this[_0xd2b3('0x5b')](_0x2479af)){if(_[_0xd2b3('0x2b')](this[_0xd2b3('0x10')][_0x2479af[_0xd2b3('0x65')]])){this[_0xd2b3('0x10')][_0x2479af['uniqueid']]=[];this[_0xd2b3('0x34')][_0x2479af[_0xd2b3('0x65')]]={};}var _0x2b0ea7=new QueueReport();_0x2b0ea7[_0xd2b3('0x48')]=_0x2479af[_0xd2b3('0x5c')];_0x2b0ea7[_0xd2b3('0x47')]=this[_0xd2b3('0x13')][_0x2b0ea7[_0xd2b3('0x48')]]&&this[_0xd2b3('0x13')][_0x2b0ea7['name']][_0xd2b3('0x47')]?this[_0xd2b3('0x13')][_0x2b0ea7[_0xd2b3('0x48')]]['type']||_0xd2b3('0x66'):_0xd2b3('0x66');_0x2b0ea7[_0xd2b3('0x5c')]=_0x2479af['queue'];_0x2b0ea7['queuecallerjoinAt']=moment()[_0xd2b3('0x42')](_0xd2b3('0x67'));_0x2b0ea7[_0xd2b3('0x68')]=_0x2479af[_0xd2b3('0x68')];_0x2b0ea7[_0xd2b3('0x69')]=_0x2479af[_0xd2b3('0x69')];_[_0xd2b3('0x6a')](_0x2b0ea7,_[_0xd2b3('0x6b')](_0x2479af,_[_0xd2b3('0x6c')](_0x2b0ea7)));this['queueReports'][_0x2479af['uniqueid']]['push'](_0x2b0ea7);this['channels'][_0x2479af[_0xd2b3('0x65')]]=_0x2b0ea7;this[_0xd2b3('0x41')](_0x2b0ea7);}}catch(_0x598656){logger[_0xd2b3('0x3a')](_0xd2b3('0x6d'),util['inspect'](_0x598656,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x1e')]=function(_0x469721){try{if(this[_0xd2b3('0x5b')](_0x469721)){if(this[_0xd2b3('0x10')][_0x469721[_0xd2b3('0x65')]]){var _0x42a427=_[_0xd2b3('0x6e')](this['queueReports'][_0x469721['uniqueid']]);_0x42a427[_0xd2b3('0x6f')]=![];_0x42a427['queuecallercompleteAt']=null;_0x42a427[_0xd2b3('0x70')]=_0x469721['holdtime'];_0x42a427[_0xd2b3('0x71')]=_0x469721['originalposition'];_0x42a427[_0xd2b3('0x1d')]=!![];_0x42a427[_0xd2b3('0x72')]=moment()[_0xd2b3('0x42')](_0xd2b3('0x67'));_0x42a427[_0xd2b3('0x73')]=_0xd2b3('0x74');_0x42a427[_0xd2b3('0x75')]=null;this[_0xd2b3('0x34')][_0x469721[_0xd2b3('0x65')]]=_0x42a427;this[_0xd2b3('0x3e')](_0x42a427);}}}catch(_0x7ef0e8){logger[_0xd2b3('0x3a')](_0xd2b3('0x76'),util[_0xd2b3('0x3f')](_0x7ef0e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd2b3('0x77')]=function(_0x392a64){try{if(this[_0xd2b3('0x5b')](_0x392a64)){if(this[_0xd2b3('0x10')][_0x392a64[_0xd2b3('0x65')]]){var _0x6b0570=_['last'](this[_0xd2b3('0x10')][_0x392a64['uniqueid']]);_0x6b0570[_0xd2b3('0x78')]=moment()[_0xd2b3('0x42')](_0xd2b3('0x67'));_0x6b0570['connectedlinenum']=_0x392a64[_0xd2b3('0x79')];_0x6b0570[_0xd2b3('0x7a')]=_0x392a64[_0xd2b3('0x7a')];this[_0xd2b3('0x34')][_0x392a64[_0xd2b3('0x65')]]=_0x6b0570;this[_0xd2b3('0x41')](_0x6b0570);}}}catch(_0x2ef7eb){logger[_0xd2b3('0x3a')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0xd2b3('0x3f')](_0x2ef7eb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x21')]=function(_0xa123ce){try{if(this['isNotNull'](_0xa123ce)){if(this['queueReports'][_0xa123ce[_0xd2b3('0x65')]]){var _0x2c94d0=_[_0xd2b3('0x6e')](this['queueReports'][_0xa123ce['uniqueid']]);_0x2c94d0['queuecallercomplete']=!![];_0x2c94d0['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x2f97f4){logger[_0xd2b3('0x3a')]('[syncAgentConnect][VoiceQueueReport]',util[_0xd2b3('0x3f')](_0x2f97f4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x7b')]=function(_0x54afc6){try{if(this['isNotNull'](_0x54afc6)){if(this['queueReports'][_0x54afc6[_0xd2b3('0x65')]]){var _0x2d4465=_['last'](this[_0xd2b3('0x10')][_0x54afc6[_0xd2b3('0x65')]]);_0x2d4465[_0xd2b3('0x1d')]=![];_0x2d4465[_0xd2b3('0x72')]=null;_0x2d4465['assigned']=!![];_0x2d4465[_0xd2b3('0x75')]=_0x54afc6[_0xd2b3('0x7c')];_0x2d4465[_0xd2b3('0x70')]=_0x54afc6[_0xd2b3('0x70')];_0x2d4465['queuecallercomplete']=!![];_0x2d4465[_0xd2b3('0x7d')]=![];_0x2d4465['queuecallerexitAt']=null;if(!_0x2d4465[_0xd2b3('0x7e')]){if(_0x54afc6[_0xd2b3('0x7f')]==_0xd2b3('0x7e')){_0x2d4465[_0xd2b3('0x73')]='COMPLETED';}else{if(_[_0xd2b3('0x80')](_0x54afc6[_0xd2b3('0x81')][_0xd2b3('0x82')](),_0xd2b3('0x83'))){if(this['queueReports'][_0x54afc6['linkedid']]){var _0x1bd642=_[_0xd2b3('0x6e')](this[_0xd2b3('0x10')][_0x54afc6['linkedid']]);_0x1bd642[_0xd2b3('0x6f')]=![];_0x1bd642[_0xd2b3('0x7d')]=!![];_0x1bd642[_0xd2b3('0x84')]=moment(_0x2d4465[_0xd2b3('0x85')])[_0xd2b3('0x86')](_0x54afc6['holdtime'],_0xd2b3('0x87'))[_0xd2b3('0x42')](_0xd2b3('0x67'));_0x1bd642[_0xd2b3('0x73')]=_0xd2b3('0x88');_0x1bd642[_0xd2b3('0x7e')]=!![];_0x1bd642[_0xd2b3('0x89')]=_0xd2b3('0x8a');_0x1bd642['transferexten']=_0x54afc6[_0xd2b3('0x8b')];_0x1bd642[_0xd2b3('0x8c')]=_0x54afc6[_0xd2b3('0x65')];var _0xaa8ff9=this['queueReports'][_0x54afc6[_0xd2b3('0x8d')]];this[_0xd2b3('0x10')][_0x54afc6['linkedid']]=this[_0xd2b3('0x10')][_0x54afc6[_0xd2b3('0x65')]];this[_0xd2b3('0x10')][_0x54afc6[_0xd2b3('0x65')]]=_0xaa8ff9;}}else{_0x2d4465[_0xd2b3('0x73')]=_0xd2b3('0x8e')+_0x54afc6['reason'][_0xd2b3('0x8f')]();}}}this[_0xd2b3('0x34')][_0x54afc6[_0xd2b3('0x65')]]=_0x2d4465;this[_0xd2b3('0x3e')](_0x2d4465);}}}catch(_0x1b04f4){logger[_0xd2b3('0x3a')](_0xd2b3('0x90'),util[_0xd2b3('0x3f')](_0x1b04f4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x91')]=function(_0x3d8c08){try{if(this[_0xd2b3('0x5b')](_0x3d8c08)){this[_0xd2b3('0x92')](_0x3d8c08[_0xd2b3('0x65')],_[_0xd2b3('0x6c')](_0x3d8c08['variable'])[0x0],_0x3d8c08[_0xd2b3('0x93')]);if(this[_0xd2b3('0x10')][_0x3d8c08[_0xd2b3('0x65')]]){var _0x225ccb=_[_0xd2b3('0x6e')](this[_0xd2b3('0x10')][_0x3d8c08[_0xd2b3('0x65')]]);if(_0x225ccb){if(this[_0xd2b3('0x5b')](_0x3d8c08[_0xd2b3('0x94')])&&this[_0xd2b3('0x5b')](_0x3d8c08[_0xd2b3('0x94')][_0xd2b3('0x95')])){switch(_0x3d8c08[_0xd2b3('0x93')]){case _0xd2b3('0x96'):_0x225ccb[_0xd2b3('0x7d')]=![];_0x225ccb[_0xd2b3('0x84')]=null;break;case _0xd2b3('0x97'):_0x225ccb[_0xd2b3('0x98')]=_0xd2b3('0x99');ami[_0xd2b3('0x40')](_0xd2b3('0x9a'),_0x225ccb);break;default:_0x225ccb[_0xd2b3('0x7d')]=!![];_0x225ccb[_0xd2b3('0x84')]=moment()['format'](_0xd2b3('0x67'));_0x225ccb['queuecallerleaveAt']=moment()[_0xd2b3('0x42')](_0xd2b3('0x67'));}_0x225ccb[_0xd2b3('0x1d')]=![];_0x225ccb[_0xd2b3('0x72')]=null;_0x225ccb['queuecallerexitreason']=_0x3d8c08['value'];this[_0xd2b3('0x34')][_0x3d8c08[_0xd2b3('0x65')]]=_0x225ccb;this[_0xd2b3('0x3e')](_0x225ccb);}else if(this[_0xd2b3('0x5b')](_0x3d8c08[_0xd2b3('0x94')])&&this[_0xd2b3('0x5b')](_0x3d8c08['variable'][_0xd2b3('0x9b')])){if(!_0x225ccb[_0xd2b3('0x1d')]){_0x225ccb[_0xd2b3('0x7d')]=!![];_0x225ccb[_0xd2b3('0x84')]=moment()[_0xd2b3('0x42')](_0xd2b3('0x67'));_0x225ccb[_0xd2b3('0x73')]=_0xd2b3('0x9c');_0x225ccb['queuecallerleaveAt']=moment()[_0xd2b3('0x42')](_0xd2b3('0x67'));this['channels'][_0x3d8c08['uniqueid']]=_0x225ccb;}}_0x225ccb[_0xd2b3('0x16')]=this['variables'][_0x3d8c08[_0xd2b3('0x65')]];}}}}catch(_0xec94a9){logger['error']('[syncVarSet][VoiceQueueReport]',util[_0xd2b3('0x3f')](_0xec94a9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x92')]=function(_0x4d3701,_0x145221,_0xe5e23a){var _0x431a95=[_0xd2b3('0x9d'),_0xd2b3('0x9e'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xd2b3('0x9f'),'rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged',_0xd2b3('0xa0'),_0xd2b3('0xa1'),_0xd2b3('0xa2'),'bridgepvtcallid',_0xd2b3('0xa3'),'memberdynamic',_0xd2b3('0xa4'),'memberlastcall',_0xd2b3('0x7c'),_0xd2b3('0xa5'),_0xd2b3('0xa6')];if(!_[_0xd2b3('0xa7')](_0x145221)&&!_[_0xd2b3('0xa8')](_0x431a95,_0x145221)){if(_['isUndefined'](this[_0xd2b3('0x16')][_0x4d3701])){this['variables'][_0x4d3701]={};}this[_0xd2b3('0x16')][_0x4d3701][_0x145221]=_0xe5e23a;}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x23')]=function(_0x24895f){try{if(this[_0xd2b3('0x5b')](_0x24895f)){if(this['queueReports'][_0x24895f[_0xd2b3('0x65')]]){for(var _0x2b5b3e=0x0,_0x389911={};_0x2b5b3e<this['queueReports'][_0x24895f[_0xd2b3('0x65')]][_0xd2b3('0xa9')];_0x2b5b3e+=0x1){_0x389911=this['queueReports'][_0x24895f['uniqueid']][_0x2b5b3e];if(this[_0xd2b3('0x13')][_0x389911['queue']]){if(_0x389911['queuecallerexit']){this[_0xd2b3('0x13')][_0x389911[_0xd2b3('0x5c')]][_0xd2b3('0x4e')]+=0x1;}if(_0x389911[_0xd2b3('0x1d')]){this[_0xd2b3('0x13')][_0x389911[_0xd2b3('0x5c')]]['abandoned']+=0x1;}this[_0xd2b3('0x13')][_0x389911['queue']][_0xd2b3('0xaa')]+=moment(_0x389911[_0xd2b3('0x78')])[_0xd2b3('0xab')](_0x389911[_0xd2b3('0x85')],_0xd2b3('0x87'))||0x0;if(_0x2b5b3e===this[_0xd2b3('0x10')][_0x24895f[_0xd2b3('0x65')]][_0xd2b3('0xa9')]-0x1){this[_0xd2b3('0x13')][_0x389911[_0xd2b3('0x5c')]][_0xd2b3('0xac')]+=moment()[_0xd2b3('0xad')](0x0)[_0xd2b3('0xab')](_0x389911[_0xd2b3('0x85')],_0xd2b3('0x87'));this[_0xd2b3('0x13')][_0x389911['queue']][_0xd2b3('0x4d')]+=0x1;if(_0x389911[_0xd2b3('0x6f')]){this['voiceQueues'][_0x389911[_0xd2b3('0x5c')]][_0xd2b3('0x4a')]+=0x1;this[_0xd2b3('0x13')][_0x389911[_0xd2b3('0x5c')]]['sumBillable']+=moment()[_0xd2b3('0xad')](0x0)['diff'](_0x389911[_0xd2b3('0x78')],_0xd2b3('0x87'));_0x389911[_0xd2b3('0xae')]=moment()[_0xd2b3('0x42')](_0xd2b3('0x67'));_0x389911[_0xd2b3('0x7d')]=![];_0x389911['queuecallerexitAt']=null;}if(_0x389911['queuecallerexit']){_0x389911['lastevent']=_0xd2b3('0x4e');ami['emit']('custom:queuecallerunmanaged',_0x389911);}if(_0x389911[_0xd2b3('0x1d')]){_0x389911[_0xd2b3('0x98')]=_0xd2b3('0x4f');ami['emit']('custom:queuecallerabandon',_0x389911);}}else{this[_0xd2b3('0x13')][_0x389911[_0xd2b3('0x5c')]][_0xd2b3('0xac')]+=this['voiceQueues'][_0x389911[_0xd2b3('0x5c')]][_0xd2b3('0xaa')];}this[_0xd2b3('0x34')][_0x24895f[_0xd2b3('0x65')]]=_0x389911;this[_0xd2b3('0x3e')](_0x389911);this['emitVoiceQueueSummary'](this[_0xd2b3('0x13')][_0x389911[_0xd2b3('0x5c')]]);}}ami[_0xd2b3('0x40')](_0xd2b3('0xaf'),this['queueReports'][_0x24895f[_0xd2b3('0x65')]]);delete this['queueReports'][_0x24895f[_0xd2b3('0x65')]];delete this[_0xd2b3('0x34')][_0x24895f['uniqueid']];}if(this['variables'][_0x24895f[_0xd2b3('0x65')]]){delete this[_0xd2b3('0x16')][_0x24895f[_0xd2b3('0x65')]];}}}catch(_0x22d824){logger[_0xd2b3('0x3a')]('[syncHangup][VoiceQueueReport]',util[_0xd2b3('0x3f')](_0x22d824,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x28')]=function(_0x2db433){try{if(this['isNotNull'](_0x2db433)){var _0x2c89ab;if(this[_0xd2b3('0x10')][_0x2db433[_0xd2b3('0xb0')]]){_0x2c89ab=_[_0xd2b3('0x6e')](this['queueReports'][_0x2db433['transfereeuniqueid']]);_0x2c89ab[_0xd2b3('0xb1')]=_0x2db433['secondtransfererexten'];_0x2c89ab[_0xd2b3('0x8c')]=_0x2db433[_0xd2b3('0xb2')];_0x2c89ab[_0xd2b3('0x73')]=_0xd2b3('0xb3');_0x2c89ab[_0xd2b3('0x7e')]=!![];_0x2c89ab[_0xd2b3('0x89')]='ATTENDED';if(this['queueReports'][_0x2db433[_0xd2b3('0xb2')]]){var _0x464725=this['queueReports'][_0x2db433['secondtransfereruniqueid']];this['queueReports'][_0x2db433[_0xd2b3('0xb2')]]=this[_0xd2b3('0x10')][_0x2db433['transfereeuniqueid']];this['queueReports'][_0x2db433[_0xd2b3('0xb0')]]=_0x464725;var _0x2d946a=_[_0xd2b3('0x6e')](this[_0xd2b3('0x10')][_0x2db433['transfereeuniqueid']]);_0x2d946a['switch']=!![];}}else if(this[_0xd2b3('0x10')][_0x2db433['transfertargetuniqueid']]){_0x2c89ab=_[_0xd2b3('0x6e')](this['queueReports'][_0x2db433['transfertargetuniqueid']]);_0x2c89ab[_0xd2b3('0xb1')]=_0x2db433[_0xd2b3('0xb4')];_0x2c89ab[_0xd2b3('0x8c')]=_0x2db433[_0xd2b3('0xb5')];_0x2c89ab[_0xd2b3('0x73')]=_0xd2b3('0xb3');_0x2c89ab[_0xd2b3('0x7e')]=!![];_0x2c89ab['transfertype']='ATTENDED';if(this[_0xd2b3('0x10')][_0x2db433['origtransfereruniqueid']]){var _0x464725=this['queueReports'][_0x2db433[_0xd2b3('0xb5')]];this[_0xd2b3('0x10')][_0x2db433[_0xd2b3('0xb5')]]=this[_0xd2b3('0x10')][_0x2db433[_0xd2b3('0xb6')]];this[_0xd2b3('0x10')][_0x2db433[_0xd2b3('0xb6')]]=_0x464725;var _0x2d946a=_[_0xd2b3('0x6e')](this[_0xd2b3('0x10')][_0x2db433['transfertargetuniqueid']]);_0x2d946a[_0xd2b3('0x35')]=!![];}}}}catch(_0x18d79e){logger['error'](_0xd2b3('0xb7'),util[_0xd2b3('0x3f')](_0x18d79e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd2b3('0xb8')]=function(_0x2ec734){try{if(this['isNotNull'](_0x2ec734)){if(this[_0xd2b3('0x10')][_0x2ec734[_0xd2b3('0xb0')]]){var _0x4b32a6=_['last'](this['queueReports'][_0x2ec734['transfereeuniqueid']]);_0x4b32a6[_0xd2b3('0x73')]=_0xd2b3('0xb9');_0x4b32a6[_0xd2b3('0x7e')]=!![];_0x4b32a6[_0xd2b3('0x89')]=_0xd2b3('0xba');_0x4b32a6[_0xd2b3('0xb1')]=_0x2ec734[_0xd2b3('0xbb')];_0x4b32a6['transferuniqueid']=_0x2ec734[_0xd2b3('0xb0')];this[_0xd2b3('0x23')]({'event':_0xd2b3('0xbc'),'uniqueid':_0x2ec734[_0xd2b3('0xb0')],'context':_0x2ec734['context'],'channel':_0x2ec734['transfererchannel']});}}}catch(_0x1a49fe){logger[_0xd2b3('0x3a')](_0xd2b3('0xbd'),util[_0xd2b3('0x3f')](_0x1a49fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd2b3('0xbe')]=function(_0x4dc997){try{if(this[_0xd2b3('0x5b')](_0x4dc997)){if(this[_0xd2b3('0x10')][_0x4dc997['uniqueid']]){var _0x2514cd=_['last'](this['queueReports'][_0x4dc997[_0xd2b3('0x65')]]);if(!_['isNil'](_0x2514cd[_0xd2b3('0x78')])){_0x2514cd[_0xd2b3('0xbf')]=moment()[_0xd2b3('0x42')](_0xd2b3('0x67'));}}}}catch(_0x557acb){logger[_0xd2b3('0x3a')]('[syncMusicOnHoldStart][VoiceQueueReport]',util['inspect'](_0x557acb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2b3('0xb')][_0xd2b3('0x26')]=function(_0x156d0e){try{if(this[_0xd2b3('0x5b')](_0x156d0e)){if(this[_0xd2b3('0x10')][_0x156d0e[_0xd2b3('0x65')]]){var _0x46f7dd=_[_0xd2b3('0x6e')](this['queueReports'][_0x156d0e[_0xd2b3('0x65')]]);if(!_[_0xd2b3('0xa7')](_0x46f7dd['mohstarttime'])){_0x46f7dd[_0xd2b3('0xc0')]+=moment()[_0xd2b3('0xad')](0x0)[_0xd2b3('0xab')](_0x46f7dd[_0xd2b3('0xbf')],'seconds');delete _0x46f7dd[_0xd2b3('0xbf')];}}}}catch(_0x556b1e){logger[_0xd2b3('0x3a')](_0xd2b3('0xc1'),util[_0xd2b3('0x3f')](_0x556b1e,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0xdffd=['syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','channels','switch','Action','status','channel','catch','message','No\x20such\x20channel','[voiceQueueReport][checkChannel]','queueReports','error','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','pTalking','sumDuration','sumHoldTime','unmanaged','abandoned','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','queues','queuesummary','then','[queuesummary]','queue','countBy','callers','toNumber','loggedIn','available','loggedin','custom:queuesummary','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','keys','[syncQueueCallerJoin][VoiceQueueReport]','syncQueueCallerAbandon','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','syncAgentComplete','lastAssignedTo','membername','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','queuecallerabandonAt','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','length','diff','total','sumBillable','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','ATTENDEDTRANSFER','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','BlindTransfer','context','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','mohstarttime','syncMusicOnHoldStop','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceQueueReport]','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','enqueue','tail','sequence','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','varset','syncVarSet'];(function(_0x468c23,_0x2aac29){var _0x4a88f0=function(_0x1b6e6b){while(--_0x1b6e6b){_0x468c23['push'](_0x468c23['shift']());}};_0x4a88f0(++_0x2aac29);}(_0xdffd,0x17b));var _0xddff=function(_0xc8e0dc,_0x44f34b){_0xc8e0dc=_0xc8e0dc-0x0;var _0x56ccbf=_0xdffd[_0xc8e0dc];return _0x56ccbf;};'use strict';var _=require('lodash');var moment=require(_0xddff('0x0'));var BPromise=require(_0xddff('0x1'));var util=require('util');var md5=require(_0xddff('0x2'));var Redis=require(_0xddff('0x3'));var config=require(_0xddff('0x4'));var logger=require(_0xddff('0x5'))(_0xddff('0x6'));var ami=require(_0xddff('0x7'));var QueueReport=require('../model/queueReport');config[_0xddff('0x8')]=_[_0xddff('0x9')](config[_0xddff('0x8')],{'host':_0xddff('0xa'),'port':0x18eb});var io=require(_0xddff('0xb'))(new Redis(config[_0xddff('0x8')]));var Sequence=function(){};Sequence['prototype'][_0xddff('0xc')]=function(_0x337f67){this[_0xddff('0xd')]=this['tail']?this['tail']['finally'](_0x337f67):_0x337f67();};function VoiceQueueReport(_0x23f048){this[_0xddff('0xe')]=new Sequence();this['queueReports']={};this[_0xddff('0xf')]=_0x23f048[_0xddff('0xf')];this['channels']=_0x23f048[_0xddff('0x10')];this[_0xddff('0x11')]=_0x23f048[_0xddff('0x11')];this[_0xddff('0x12')]=!![];this[_0xddff('0x13')]=_0x23f048[_0xddff('0x13')];this[_0xddff('0x14')]={};ami['on']('queuesummary',this[_0xddff('0x15')][_0xddff('0x16')](this));ami['on'](_0xddff('0x17'),this[_0xddff('0x18')][_0xddff('0x16')](this));ami['on']('queuecallerjoin',this[_0xddff('0x19')]['bind'](this));ami['on'](_0xddff('0x1a'),this['syncQueueCallerAbandon'][_0xddff('0x16')](this));ami['on'](_0xddff('0x1b'),this[_0xddff('0x1c')][_0xddff('0x16')](this));ami['on'](_0xddff('0x1d'),this['syncAgentComplete'][_0xddff('0x16')](this));ami['on'](_0xddff('0x1e'),this['syncAgentConnect'][_0xddff('0x16')](this));ami['on'](_0xddff('0x1f'),this[_0xddff('0x20')][_0xddff('0x16')](this));ami['on']('hangup',this[_0xddff('0x21')][_0xddff('0x16')](this));ami['on'](_0xddff('0x22'),this[_0xddff('0x23')][_0xddff('0x16')](this));ami['on'](_0xddff('0x24'),this['syncMusicOnHoldStart'][_0xddff('0x16')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0xddff('0x16')](this));ami['on']('attendedtransfer',this[_0xddff('0x25')][_0xddff('0x16')](this));ami['on'](_0xddff('0x26'),this[_0xddff('0x27')][_0xddff('0x16')](this));this[_0xddff('0x28')]();this[_0xddff('0x29')]();}function isNotNull(_0x3ddd8f){return _0x3ddd8f!==null&&!_[_0xddff('0x2a')](_0x3ddd8f);}function clearChannels(_0x1ccb9e){if(!_[_0xddff('0x2b')](_0x1ccb9e)){for(var _0x114875 in _0x1ccb9e){if(_0x1ccb9e[_0xddff('0x2c')](_0x114875)){delete _0x1ccb9e[_0x114875];}}}}function clearCampaigns(_0x129f24){if(!_[_0xddff('0x2b')](_0x129f24)){for(var _0x402053 in _0x129f24){if(_0x129f24[_0xddff('0x2c')](_0x402053)){_0x129f24[_0x402053][_0xddff('0x2d')]=0x0;}}}}function clearVoiceQueues(_0xb51af9){if(!_[_0xddff('0x2b')](_0xb51af9)){for(var _0x115835 in _0xb51af9){if(_0xb51af9[_0xddff('0x2c')](_0x115835)){_0xb51af9[_0x115835][_0xddff('0x2d')]=0x0;_0xb51af9[_0x115835][_0xddff('0x2e')]=0x0;_0xb51af9[_0x115835]['pTalking']=0x0;_0xb51af9[_0x115835][_0xddff('0x2f')]=0x0;_0xb51af9[_0x115835][_0xddff('0x30')]=!![];}}}}function clearAgentBooked(_0x5e2b59){if(!_[_0xddff('0x2b')](_0x5e2b59)){for(var _0x40089a in _0x5e2b59){if(_0x5e2b59['hasOwnProperty'](_0x40089a)){_0x5e2b59[_0x40089a][_0xddff('0x31')]=!![];}}}}VoiceQueueReport[_0xddff('0x32')][_0xddff('0x33')]=function(){var _0x10ebe5=this;for(var _0x4afbf5 in this['channels']){if(this[_0xddff('0x34')][_0xddff('0x2c')](_0x4afbf5)&&!this[_0xddff('0x34')][_0x4afbf5][_0xddff('0x35')]){this[_0xddff('0xe')][_0xddff('0xc')](function(){if(!_['isNil'](_0x10ebe5[_0xddff('0x34')][_0x4afbf5])){return ami[_0xddff('0x36')]({'action':_0xddff('0x37'),'channel':_0x10ebe5[_0xddff('0x34')][_0x4afbf5][_0xddff('0x38')]})[_0xddff('0x39')](function(_0x31b106){if(_0x31b106[_0xddff('0x3a')]===_0xddff('0x3b')){setTimeout(function(){if(_0x10ebe5[_0xddff('0x34')][_0x4afbf5]){delete _0x10ebe5[_0xddff('0x34')][_0x4afbf5];logger['error'](_0xddff('0x3c'),_0x4afbf5);}if(_0x10ebe5[_0xddff('0x3d')][_0x4afbf5]){delete _0x10ebe5['queueReports'][_0x4afbf5];logger[_0xddff('0x3e')]('[voiceQueueReport][checkQueueReport]',_0x4afbf5);}if(_0x10ebe5[_0xddff('0x14')][_0x4afbf5]){delete _0x10ebe5['variables'][_0x4afbf5];logger[_0xddff('0x3e')](_0xddff('0x3f'),_0x4afbf5);}},0x1f40);}});}});}}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x23')]=function(){logger[_0xddff('0x3e')](_0xddff('0x40'));clearChannels(this[_0xddff('0x34')]);this[_0xddff('0x41')](this[_0xddff('0x3d')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xddff('0x11')]);clearCampaigns(this[_0xddff('0x13')]);};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x41')]=function(_0x3405e7){var _0x4f2286=this;if(!_['isEmpty'](_0x3405e7)){for(var _0x1dae29 in _0x3405e7){if(_0x3405e7[_0xddff('0x2c')](_0x1dae29)){_0x4f2286[_0xddff('0x42')](_0x3405e7[_0x1dae29]);delete _0x3405e7[_0x1dae29];}}}};function loggerCatch(_0x4befdb){return function(_0x41dca3){logger[_0xddff('0x3e')](_0x4befdb,util[_0xddff('0x43')](_0x41dca3,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xddff('0x32')][_0xddff('0x44')]=function(_0x29976a,_0x53e586,_0x3afc33){io['to'](_0x29976a)[_0xddff('0x44')](_0x53e586,_0x3afc33);};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x45')]=function(_0x10a72c){this[_0xddff('0x44')](util[_0xddff('0x46')](_0xddff('0x47'),_0x10a72c[_0xddff('0x48')]),'voice_queue_channel:save',_0x10a72c);};VoiceQueueReport['prototype'][_0xddff('0x42')]=function(_0x54fecb){logger[_0xddff('0x49')](_0xddff('0x4a'),JSON[_0xddff('0x4b')](_0x54fecb));this[_0xddff('0x44')](util['format'](_0xddff('0x47'),_0x54fecb[_0xddff('0x48')]),_0xddff('0x4c'),_0x54fecb);};VoiceQueueReport['prototype'][_0xddff('0x4d')]=function(_0x22e3b7){if(_0x22e3b7[_0xddff('0x4e')]===_0xddff('0x4f')){var _0x5b1f6f={'id':_0x22e3b7['id'],'name':_0x22e3b7['name'],'strategy':_0x22e3b7[_0xddff('0x50')],'answered':_0x22e3b7[_0xddff('0x51')],'available':_0x22e3b7['available'],'loggedIn':_0x22e3b7['loggedIn'],'pTalking':_0x22e3b7[_0xddff('0x52')],'sumBillable':_0x22e3b7['sumBillable'],'sumDuration':_0x22e3b7[_0xddff('0x53')],'sumHoldTime':_0x22e3b7[_0xddff('0x54')]||0x0,'talking':_0x22e3b7['talking'],'total':_0x22e3b7['total'],'type':_0x22e3b7[_0xddff('0x4e')],'unmanaged':_0x22e3b7[_0xddff('0x55')],'abandoned':_0x22e3b7[_0xddff('0x56')],'waiting':_0x22e3b7[_0xddff('0x2f')]};if(_0x22e3b7[_0xddff('0x57')]){_0x5b1f6f[_0xddff('0x57')]={'id':_0x22e3b7[_0xddff('0x57')]['id'],'name':_0x22e3b7[_0xddff('0x57')][_0xddff('0x48')],'active':_0x22e3b7[_0xddff('0x57')][_0xddff('0x58')],'callerid':_0x22e3b7['Trunk'][_0xddff('0x59')]};}if(_0x22e3b7['Interval']){_0x5b1f6f[_0xddff('0x5a')]={'id':_0x22e3b7[_0xddff('0x5a')]['id'],'name':_0x22e3b7[_0xddff('0x5a')]['name']};}var _0x229279=md5(JSON[_0xddff('0x4b')](_0x5b1f6f));if(_0x22e3b7[_0xddff('0x2')]!==_0x229279){_0x22e3b7['md5']=_0x229279;this['emit'](util[_0xddff('0x46')](_0xddff('0x47'),_0x5b1f6f[_0xddff('0x48')]),_0xddff('0x5b'),_0x5b1f6f);}}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x5c')]=function(_0x5bda48){return _0x5bda48!==null&&!_['isUndefined'](_0x5bda48);};VoiceQueueReport[_0xddff('0x32')]['loopQueueShow']=function(){var _0x2f8c6f=this;setInterval(function(){_0x2f8c6f['clearZombieChannels']();ami['Action']({'action':_0xddff('0x5d')})[_0xddff('0x39')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport['prototype'][_0xddff('0x28')]=function(){var _0x3bc1d1=this;setInterval(function(){if(_0x3bc1d1['flagQueueSummary']){return ami[_0xddff('0x36')]({'action':_0xddff('0x5e')})[_0xddff('0x5f')](function(_0x53539e){_0x3bc1d1[_0xddff('0x12')]=![];})[_0xddff('0x39')](loggerCatch(_0xddff('0x60')));}},0x3e8);};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x15')]=function(_0x35f260){try{if(this[_0xddff('0x5c')](_0x35f260)&&this[_0xddff('0x5c')](_0x35f260['queue'])){if(this['voiceQueues'][_0x35f260[_0xddff('0x61')]]){var _0x2d6bc9=_[_0xddff('0x62')](this[_0xddff('0x34')],_0xddff('0x61'))[_0x35f260[_0xddff('0x61')]]||0x0;var _0x195240=_0x2d6bc9-_0x35f260[_0xddff('0x63')];if(this[_0xddff('0x11')][_0x35f260[_0xddff('0x61')]][_0xddff('0x2f')]!==_[_0xddff('0x64')](_0x35f260[_0xddff('0x63')])||this['voiceQueues'][_0x35f260[_0xddff('0x61')]][_0xddff('0x65')]!==_['toNumber'](_0x35f260['loggedin'])||this['voiceQueues'][_0x35f260[_0xddff('0x61')]][_0xddff('0x66')]!==_[_0xddff('0x64')](_0x35f260[_0xddff('0x66')])||this[_0xddff('0x11')][_0x35f260[_0xddff('0x61')]][_0xddff('0x2e')]!==_0x195240){this[_0xddff('0x11')][_0x35f260[_0xddff('0x61')]][_0xddff('0x2f')]=_['toNumber'](_0x35f260[_0xddff('0x63')]);this[_0xddff('0x11')][_0x35f260[_0xddff('0x61')]][_0xddff('0x65')]=_[_0xddff('0x64')](_0x35f260[_0xddff('0x67')]);this[_0xddff('0x11')][_0x35f260[_0xddff('0x61')]]['available']=_[_0xddff('0x64')](_0x35f260['available']);this[_0xddff('0x11')][_0x35f260[_0xddff('0x61')]][_0xddff('0x2e')]=_0x195240>0x0?_0x195240:0x0;this[_0xddff('0x11')][_0x35f260[_0xddff('0x61')]][_0xddff('0x2e')]=this['voiceQueues'][_0x35f260[_0xddff('0x61')]][_0xddff('0x2e')]>_[_0xddff('0x64')](_0x35f260[_0xddff('0x67')])?_[_0xddff('0x64')](_0x35f260[_0xddff('0x67')]):this[_0xddff('0x11')][_0x35f260['queue']][_0xddff('0x2e')];this[_0xddff('0x4d')](this['voiceQueues'][_0x35f260['queue']]);}ami[_0xddff('0x44')](_0xddff('0x68'),this['voiceQueues'][_0x35f260[_0xddff('0x61')]]);}}}catch(_0x2788d8){logger['error']('[syncQueueSummary][VoiceQueueReport]',util[_0xddff('0x43')](_0x2788d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xddff('0x18')]=function(_0x380320){this['flagQueueSummary']=!![];};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x69')]=function(_0x392320){};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x19')]=function(_0x4dab78){try{if(this[_0xddff('0x5c')](_0x4dab78)){if(_[_0xddff('0x2a')](this[_0xddff('0x3d')][_0x4dab78[_0xddff('0x6a')]])){this[_0xddff('0x3d')][_0x4dab78[_0xddff('0x6a')]]=[];this['channels'][_0x4dab78[_0xddff('0x6a')]]={};}var _0x6baee=new QueueReport();_0x6baee['name']=_0x4dab78['queue'];_0x6baee[_0xddff('0x4e')]=this['voiceQueues'][_0x6baee[_0xddff('0x48')]]&&this[_0xddff('0x11')][_0x6baee[_0xddff('0x48')]][_0xddff('0x4e')]?this[_0xddff('0x11')][_0x6baee['name']]['type']||_0xddff('0x4f'):_0xddff('0x4f');_0x6baee[_0xddff('0x61')]=_0x4dab78[_0xddff('0x61')];_0x6baee[_0xddff('0x6b')]=moment()[_0xddff('0x46')](_0xddff('0x6c'));_0x6baee[_0xddff('0x6d')]=_0x4dab78[_0xddff('0x6d')];_0x6baee['count']=_0x4dab78[_0xddff('0x6e')];_[_0xddff('0x6f')](_0x6baee,_['pick'](_0x4dab78,_[_0xddff('0x70')](_0x6baee)));this[_0xddff('0x3d')][_0x4dab78[_0xddff('0x6a')]]['push'](_0x6baee);this[_0xddff('0x34')][_0x4dab78[_0xddff('0x6a')]]=_0x6baee;this[_0xddff('0x45')](_0x6baee);}}catch(_0x324fbd){logger[_0xddff('0x3e')](_0xddff('0x71'),util[_0xddff('0x43')](_0x324fbd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x72')]=function(_0xe91d17){try{if(this[_0xddff('0x5c')](_0xe91d17)){if(this[_0xddff('0x3d')][_0xe91d17[_0xddff('0x6a')]]){var _0x23af04=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0xe91d17[_0xddff('0x6a')]]);_0x23af04[_0xddff('0x74')]=![];_0x23af04[_0xddff('0x75')]=null;_0x23af04[_0xddff('0x76')]=_0xe91d17[_0xddff('0x76')];_0x23af04[_0xddff('0x77')]=_0xe91d17[_0xddff('0x77')];_0x23af04[_0xddff('0x1a')]=!![];_0x23af04['queuecallerabandonAt']=moment()[_0xddff('0x46')](_0xddff('0x6c'));_0x23af04[_0xddff('0x78')]=_0xddff('0x79');_0x23af04['lastAssignedTo']=null;this['channels'][_0xe91d17[_0xddff('0x6a')]]=_0x23af04;this[_0xddff('0x42')](_0x23af04);}}}catch(_0x5c7ebb){logger[_0xddff('0x3e')](_0xddff('0x7a'),util['inspect'](_0x5c7ebb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x1c')]=function(_0x15c814){try{if(this[_0xddff('0x5c')](_0x15c814)){if(this['queueReports'][_0x15c814[_0xddff('0x6a')]]){var _0x364ee5=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0x15c814[_0xddff('0x6a')]]);_0x364ee5[_0xddff('0x7b')]=moment()[_0xddff('0x46')](_0xddff('0x6c'));_0x364ee5[_0xddff('0x7c')]=_0x15c814[_0xddff('0x7c')];_0x364ee5[_0xddff('0x7d')]=_0x15c814[_0xddff('0x7d')];this['channels'][_0x15c814[_0xddff('0x6a')]]=_0x364ee5;this[_0xddff('0x45')](_0x364ee5);}}}catch(_0x2843a8){logger[_0xddff('0x3e')](_0xddff('0x7e'),util['inspect'](_0x2843a8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')]['syncAgentConnect']=function(_0x4e4935){try{if(this['isNotNull'](_0x4e4935)){if(this[_0xddff('0x3d')][_0x4e4935[_0xddff('0x6a')]]){var _0x1890de=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0x4e4935[_0xddff('0x6a')]]);_0x1890de['queuecallercomplete']=!![];_0x1890de[_0xddff('0x78')]=_0xddff('0x7f');}}}catch(_0x4185d2){logger[_0xddff('0x3e')]('[syncAgentConnect][VoiceQueueReport]',util[_0xddff('0x43')](_0x4185d2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x80')]=function(_0x5a803c){try{if(this[_0xddff('0x5c')](_0x5a803c)){if(this[_0xddff('0x3d')][_0x5a803c[_0xddff('0x6a')]]){var _0x3440cd=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0x5a803c[_0xddff('0x6a')]]);_0x3440cd[_0xddff('0x1a')]=![];_0x3440cd['queuecallerabandonAt']=null;_0x3440cd['assigned']=!![];_0x3440cd[_0xddff('0x81')]=_0x5a803c[_0xddff('0x82')];_0x3440cd[_0xddff('0x76')]=_0x5a803c[_0xddff('0x76')];_0x3440cd[_0xddff('0x74')]=!![];_0x3440cd['queuecallerexit']=![];_0x3440cd[_0xddff('0x83')]=null;if(!_0x3440cd[_0xddff('0x84')]){if(_0x5a803c[_0xddff('0x85')]==_0xddff('0x84')){_0x3440cd[_0xddff('0x78')]=_0xddff('0x86');}else{if(_[_0xddff('0x87')](_0x5a803c[_0xddff('0x38')][_0xddff('0x88')](),_0xddff('0x89'))){if(this[_0xddff('0x3d')][_0x5a803c[_0xddff('0x8a')]]){var _0x4fdd69=_['last'](this['queueReports'][_0x5a803c['linkedid']]);_0x4fdd69[_0xddff('0x74')]=![];_0x4fdd69[_0xddff('0x8b')]=!![];_0x4fdd69[_0xddff('0x83')]=moment(_0x3440cd[_0xddff('0x6b')])[_0xddff('0x8c')](_0x5a803c['holdtime'],_0xddff('0x8d'))[_0xddff('0x46')](_0xddff('0x6c'));_0x4fdd69[_0xddff('0x78')]=_0xddff('0x8e');_0x4fdd69['transfer']=!![];_0x4fdd69[_0xddff('0x8f')]=_0xddff('0x90');_0x4fdd69[_0xddff('0x91')]=_0x5a803c[_0xddff('0x92')];_0x4fdd69[_0xddff('0x93')]=_0x5a803c['uniqueid'];var _0x147078=this[_0xddff('0x3d')][_0x5a803c['linkedid']];this[_0xddff('0x3d')][_0x5a803c['linkedid']]=this[_0xddff('0x3d')][_0x5a803c[_0xddff('0x6a')]];this[_0xddff('0x3d')][_0x5a803c[_0xddff('0x6a')]]=_0x147078;}}else{_0x3440cd[_0xddff('0x78')]=_0xddff('0x94')+_0x5a803c[_0xddff('0x85')]['toUpperCase']();}}}this[_0xddff('0x34')][_0x5a803c[_0xddff('0x6a')]]=_0x3440cd;this[_0xddff('0x42')](_0x3440cd);}}}catch(_0x205b6a){logger['error'](_0xddff('0x95'),util['inspect'](_0x205b6a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xddff('0x20')]=function(_0x238c13){try{if(this[_0xddff('0x5c')](_0x238c13)){this[_0xddff('0x96')](_0x238c13[_0xddff('0x6a')],_[_0xddff('0x70')](_0x238c13[_0xddff('0x97')])[0x0],_0x238c13[_0xddff('0x98')]);if(this[_0xddff('0x3d')][_0x238c13[_0xddff('0x6a')]]){var _0x398372=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0x238c13[_0xddff('0x6a')]]);if(_0x398372){if(this[_0xddff('0x5c')](_0x238c13[_0xddff('0x97')])&&this[_0xddff('0x5c')](_0x238c13[_0xddff('0x97')][_0xddff('0x99')])){switch(_0x238c13[_0xddff('0x98')]){case _0xddff('0x9a'):_0x398372[_0xddff('0x8b')]=![];_0x398372[_0xddff('0x83')]=null;break;case _0xddff('0x9b'):_0x398372[_0xddff('0x9c')]=_0xddff('0x9d');ami[_0xddff('0x44')](_0xddff('0x9e'),_0x398372);break;default:_0x398372[_0xddff('0x8b')]=!![];_0x398372[_0xddff('0x83')]=moment()[_0xddff('0x46')](_0xddff('0x6c'));_0x398372[_0xddff('0x7b')]=moment()[_0xddff('0x46')](_0xddff('0x6c'));}_0x398372[_0xddff('0x1a')]=![];_0x398372[_0xddff('0x9f')]=null;_0x398372[_0xddff('0x78')]=_0x238c13[_0xddff('0x98')];this[_0xddff('0x34')][_0x238c13[_0xddff('0x6a')]]=_0x398372;this[_0xddff('0x42')](_0x398372);}else if(this[_0xddff('0x5c')](_0x238c13[_0xddff('0x97')])&&this[_0xddff('0x5c')](_0x238c13[_0xddff('0x97')][_0xddff('0xa0')])){if(!_0x398372[_0xddff('0x1a')]){_0x398372[_0xddff('0x8b')]=!![];_0x398372['queuecallerexitAt']=moment()['format'](_0xddff('0x6c'));_0x398372[_0xddff('0x78')]=_0xddff('0xa1');_0x398372[_0xddff('0x7b')]=moment()[_0xddff('0x46')](_0xddff('0x6c'));this[_0xddff('0x34')][_0x238c13[_0xddff('0x6a')]]=_0x398372;}}_0x398372[_0xddff('0x14')]=this['variables'][_0x238c13[_0xddff('0x6a')]];}}}}catch(_0x2a2ff3){logger[_0xddff('0x3e')](_0xddff('0xa2'),util[_0xddff('0x43')](_0x2a2ff3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x96')]=function(_0x458df1,_0x420f36,_0x17ab09){var _0x1d8373=['rtpaudioqos',_0xddff('0xa3'),_0xddff('0xa4'),_0xddff('0xa5'),_0xddff('0xa6'),'rtpaudioqoslossbridged',_0xddff('0xa7'),_0xddff('0xa8'),_0xddff('0xa9'),_0xddff('0xaa'),_0xddff('0xab'),_0xddff('0xac'),_0xddff('0xad'),'memberdynamic',_0xddff('0xae'),_0xddff('0xaf'),_0xddff('0x82'),_0xddff('0xb0'),_0xddff('0xb1')];if(!_[_0xddff('0xb2')](_0x420f36)&&!_[_0xddff('0xb3')](_0x1d8373,_0x420f36)){if(_[_0xddff('0x2a')](this[_0xddff('0x14')][_0x458df1])){this[_0xddff('0x14')][_0x458df1]={};}this[_0xddff('0x14')][_0x458df1][_0x420f36]=_0x17ab09;}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x21')]=function(_0xf115ac){try{if(this[_0xddff('0x5c')](_0xf115ac)){if(this[_0xddff('0x3d')][_0xf115ac[_0xddff('0x6a')]]){for(var _0x1620c1=0x0,_0x1aa3c3={};_0x1620c1<this['queueReports'][_0xf115ac[_0xddff('0x6a')]][_0xddff('0xb4')];_0x1620c1+=0x1){_0x1aa3c3=this[_0xddff('0x3d')][_0xf115ac['uniqueid']][_0x1620c1];if(this['voiceQueues'][_0x1aa3c3['queue']]){if(_0x1aa3c3['queuecallerexit']){this[_0xddff('0x11')][_0x1aa3c3[_0xddff('0x61')]][_0xddff('0x55')]+=0x1;}if(_0x1aa3c3[_0xddff('0x1a')]){this['voiceQueues'][_0x1aa3c3[_0xddff('0x61')]][_0xddff('0x56')]+=0x1;}this['voiceQueues'][_0x1aa3c3[_0xddff('0x61')]]['sumHoldTime']+=moment(_0x1aa3c3[_0xddff('0x7b')])[_0xddff('0xb5')](_0x1aa3c3[_0xddff('0x6b')],'seconds')||0x0;if(_0x1620c1===this[_0xddff('0x3d')][_0xf115ac['uniqueid']][_0xddff('0xb4')]-0x1){this[_0xddff('0x11')][_0x1aa3c3['queue']]['sumDuration']+=moment()['milliseconds'](0x0)[_0xddff('0xb5')](_0x1aa3c3[_0xddff('0x6b')],_0xddff('0x8d'));this[_0xddff('0x11')][_0x1aa3c3[_0xddff('0x61')]][_0xddff('0xb6')]+=0x1;if(_0x1aa3c3[_0xddff('0x74')]){this[_0xddff('0x11')][_0x1aa3c3[_0xddff('0x61')]][_0xddff('0x51')]+=0x1;this[_0xddff('0x11')][_0x1aa3c3[_0xddff('0x61')]][_0xddff('0xb7')]+=moment()['milliseconds'](0x0)['diff'](_0x1aa3c3['queuecallerleaveAt'],'seconds');_0x1aa3c3['queuecallercompleteAt']=moment()[_0xddff('0x46')](_0xddff('0x6c'));_0x1aa3c3[_0xddff('0x8b')]=![];_0x1aa3c3['queuecallerexitAt']=null;}if(_0x1aa3c3['queuecallerexit']){_0x1aa3c3[_0xddff('0x9c')]=_0xddff('0x55');ami['emit']('custom:queuecallerunmanaged',_0x1aa3c3);}if(_0x1aa3c3['queuecallerabandon']){_0x1aa3c3[_0xddff('0x9c')]=_0xddff('0x56');ami['emit'](_0xddff('0xb8'),_0x1aa3c3);}}else{this['voiceQueues'][_0x1aa3c3[_0xddff('0x61')]][_0xddff('0x53')]+=this[_0xddff('0x11')][_0x1aa3c3[_0xddff('0x61')]][_0xddff('0x54')];}this[_0xddff('0x34')][_0xf115ac[_0xddff('0x6a')]]=_0x1aa3c3;this[_0xddff('0x42')](_0x1aa3c3);this['emitVoiceQueueSummary'](this[_0xddff('0x11')][_0x1aa3c3[_0xddff('0x61')]]);}}ami['emit'](_0xddff('0xb9'),this[_0xddff('0x3d')][_0xf115ac['uniqueid']]);delete this['queueReports'][_0xf115ac[_0xddff('0x6a')]];delete this[_0xddff('0x34')][_0xf115ac[_0xddff('0x6a')]];}if(this[_0xddff('0x14')][_0xf115ac[_0xddff('0x6a')]]){delete this[_0xddff('0x14')][_0xf115ac[_0xddff('0x6a')]];}}}catch(_0x5f4dde){logger[_0xddff('0x3e')](_0xddff('0xba'),util[_0xddff('0x43')](_0x5f4dde,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')]['syncAttendedTransfer']=function(_0x1d27d9){try{if(this[_0xddff('0x5c')](_0x1d27d9)){var _0x4ebd32;if(this['queueReports'][_0x1d27d9[_0xddff('0xbb')]]){_0x4ebd32=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xbb')]]);_0x4ebd32['transferexten']=_0x1d27d9['secondtransfererexten'];_0x4ebd32[_0xddff('0x93')]=_0x1d27d9['secondtransfereruniqueid'];_0x4ebd32[_0xddff('0x78')]=_0xddff('0xbc');_0x4ebd32[_0xddff('0x84')]=!![];_0x4ebd32[_0xddff('0x8f')]='ATTENDED';if(this[_0xddff('0x3d')][_0x1d27d9['secondtransfereruniqueid']]){var _0x47d3f6=this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xbd')]];this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xbd')]]=this[_0xddff('0x3d')][_0x1d27d9['transfereeuniqueid']];this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xbb')]]=_0x47d3f6;var _0x2da1de=_['last'](this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xbb')]]);_0x2da1de[_0xddff('0x35')]=!![];}}else if(this[_0xddff('0x3d')][_0x1d27d9['transfertargetuniqueid']]){_0x4ebd32=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xbe')]]);_0x4ebd32[_0xddff('0x91')]=_0x1d27d9[_0xddff('0xbf')];_0x4ebd32[_0xddff('0x93')]=_0x1d27d9[_0xddff('0xc0')];_0x4ebd32[_0xddff('0x78')]=_0xddff('0xbc');_0x4ebd32['transfer']=!![];_0x4ebd32[_0xddff('0x8f')]='ATTENDED';if(this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xc0')]]){var _0x47d3f6=this['queueReports'][_0x1d27d9[_0xddff('0xc0')]];this['queueReports'][_0x1d27d9['origtransfereruniqueid']]=this['queueReports'][_0x1d27d9[_0xddff('0xbe')]];this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xbe')]]=_0x47d3f6;var _0x2da1de=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0x1d27d9[_0xddff('0xbe')]]);_0x2da1de['switch']=!![];}}}}catch(_0x34bd6d){logger[_0xddff('0x3e')](_0xddff('0xc1'),util['inspect'](_0x34bd6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0x27')]=function(_0x2c0783){try{if(this[_0xddff('0x5c')](_0x2c0783)){if(this[_0xddff('0x3d')][_0x2c0783[_0xddff('0xbb')]]){var _0xc1deec=_[_0xddff('0x73')](this[_0xddff('0x3d')][_0x2c0783[_0xddff('0xbb')]]);_0xc1deec['queuecallerexitreason']=_0xddff('0xc2');_0xc1deec['transfer']=!![];_0xc1deec[_0xddff('0x8f')]=_0xddff('0xc3');_0xc1deec[_0xddff('0x91')]=_0x2c0783['extension'];_0xc1deec['transferuniqueid']=_0x2c0783[_0xddff('0xbb')];this[_0xddff('0x21')]({'event':_0xddff('0xc4'),'uniqueid':_0x2c0783['transfereeuniqueid'],'context':_0x2c0783[_0xddff('0xc5')],'channel':_0x2c0783['transfererchannel']});}}}catch(_0x53cdeb){logger[_0xddff('0x3e')](_0xddff('0xc6'),util[_0xddff('0x43')](_0x53cdeb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0xc7')]=function(_0x55b16c){try{if(this[_0xddff('0x5c')](_0x55b16c)){if(this['queueReports'][_0x55b16c[_0xddff('0x6a')]]){var _0x408068=_['last'](this[_0xddff('0x3d')][_0x55b16c[_0xddff('0x6a')]]);if(!_[_0xddff('0xb2')](_0x408068[_0xddff('0x7b')])){_0x408068[_0xddff('0xc8')]=moment()[_0xddff('0x46')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x576b79){logger[_0xddff('0x3e')]('[syncMusicOnHoldStart][VoiceQueueReport]',util[_0xddff('0x43')](_0x576b79,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xddff('0x32')][_0xddff('0xc9')]=function(_0x9cfc34){try{if(this[_0xddff('0x5c')](_0x9cfc34)){if(this[_0xddff('0x3d')][_0x9cfc34[_0xddff('0x6a')]]){var _0x4f5266=_['last'](this[_0xddff('0x3d')][_0x9cfc34[_0xddff('0x6a')]]);if(!_[_0xddff('0xb2')](_0x4f5266[_0xddff('0xc8')])){_0x4f5266[_0xddff('0xca')]+=moment()[_0xddff('0xcb')](0x0)['diff'](_0x4f5266[_0xddff('0xc8')],'seconds');delete _0x4f5266[_0xddff('0xc8')];}}}}catch(_0x1279e8){logger[_0xddff('0x3e')](_0xddff('0xcc'),util['inspect'](_0x1279e8,{'showHidden':![],'depth':null}));}};module[_0xddff('0xcd')]=VoiceQueueReport;
\ No newline at end of file
index 426d24c..7eeea55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0424=['CreateReportAgentPreview','campaign','queue','Request'];(function(_0x4c8792,_0x47cd84){var _0x182fbd=function(_0x14ee81){while(--_0x14ee81){_0x4c8792['push'](_0x4c8792['shift']());}};_0x182fbd(++_0x47cd84);}(_0x0424,0x159));var _0x4042=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0x0424[_0xf8886b];return _0x321bd5;};'use strict';var client=require('../client');exports['createHistory']=function(_0x27e499){return function(){_0x27e499[_0x4042('0x0')]=_0x27e499[_0x4042('0x1')];return client[_0x4042('0x2')]('CreateReportAgentPreview',{'body':_0x27e499,'log':_0x4042('0x3')});};};
\ No newline at end of file
+var _0xe944=['../client','campaign','CreateReportAgentPreview'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xe944,0x174));var _0x4e94=function(_0x19e80e,_0x37a3b1){_0x19e80e=_0x19e80e-0x0;var _0x32bdd8=_0xe944[_0x19e80e];return _0x32bdd8;};'use strict';var client=require(_0x4e94('0x0'));exports['createHistory']=function(_0x490afd){return function(){_0x490afd[_0x4e94('0x1')]=_0x490afd['queue'];return client['Request'](_0x4e94('0x2'),{'body':_0x490afd,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index edfb539..aafc55e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd222=['../client','create','Request','CreateAttachment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd222,0x64));var _0x2d22=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xd222[_0x3b90ab];return _0x206e92;};'use strict';var client=require(_0x2d22('0x0'));exports[_0x2d22('0x1')]=function(_0x50b003){return client[_0x2d22('0x2')](_0x2d22('0x3'),{'body':_0x50b003,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0x7116=['CreateAttachment','../client','Request'];(function(_0x3952bf,_0x482703){var _0x36e623=function(_0x33abf5){while(--_0x33abf5){_0x3952bf['push'](_0x3952bf['shift']());}};_0x36e623(++_0x482703);}(_0x7116,0x11b));var _0x6711=function(_0x4fd136,_0x21bf89){_0x4fd136=_0x4fd136-0x0;var _0xb365e=_0x7116[_0x4fd136];return _0xb365e;};'use strict';var client=require(_0x6711('0x0'));exports['create']=function(_0x9945f3){return client[_0x6711('0x1')]('CreateAttachment',{'body':_0x9945f3,'log':_0x6711('0x2')});};
\ No newline at end of file
index f50c43a..746a3ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f92=['Request','GetCampaign','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client'];(function(_0x3f1f11,_0x1d1205){var _0xba9003=function(_0x46446b){while(--_0x46446b){_0x3f1f11['push'](_0x3f1f11['shift']());}};_0xba9003(++_0x1d1205);}(_0x1f92,0x1ad));var _0x21f9=function(_0x3a0514,_0x25cc16){_0x3a0514=_0x3a0514-0x0;var _0x4c6939=_0x1f92[_0x3a0514];return _0x4c6939;};'use strict';var client=require(_0x21f9('0x0'));exports['getCampaigns']=function(){return function(){return client[_0x21f9('0x1')](_0x21f9('0x2'),{'options':{'raw':![],'attributes':['id','name','type',_0x21f9('0x3'),_0x21f9('0x4'),_0x21f9('0x5'),_0x21f9('0x6'),_0x21f9('0x7'),_0x21f9('0x8'),_0x21f9('0x9'),_0x21f9('0xa'),_0x21f9('0xb'),_0x21f9('0xc'),_0x21f9('0xd'),_0x21f9('0xe'),'dialNoSuchNumberMaxRetry',_0x21f9('0xf'),_0x21f9('0x10'),_0x21f9('0x11'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x21f9('0x12'),_0x21f9('0x13'),'dialAgentRejectMaxRetry',_0x21f9('0x14'),_0x21f9('0x15'),_0x21f9('0x16'),_0x21f9('0x17'),_0x21f9('0x18'),_0x21f9('0x19'),_0x21f9('0x1a'),_0x21f9('0x1b'),_0x21f9('0x1c'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x21f9('0x1d'),'dialAMDMaximumWordLength',_0x21f9('0x1e'),_0x21f9('0x1f'),_0x21f9('0x20'),_0x21f9('0x21')],'include':[{'model':_0x21f9('0x22'),'as':_0x21f9('0x22'),'attributes':['id',_0x21f9('0x23'),'callerid',_0x21f9('0x3')]},{'model':_0x21f9('0x22'),'as':_0x21f9('0x24'),'attributes':['id',_0x21f9('0x23'),_0x21f9('0x25'),_0x21f9('0x3')]},{'model':_0x21f9('0x26'),'as':_0x21f9('0x26'),'attributes':['id',_0x21f9('0x23')],'include':[{'model':_0x21f9('0x26'),'as':_0x21f9('0x27'),'attributes':['id',_0x21f9('0x23'),_0x21f9('0x28')]}]},{'model':_0x21f9('0x29'),'as':_0x21f9('0x29'),'attributes':['id',_0x21f9('0x23')]}]},'log':_0x21f9('0x2a')});};};
\ No newline at end of file
+var _0xce9e=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','active','TrunkBackup','Interval','SquareProject','../client','getCampaigns','Request','name','limitCalls','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x2769fb,_0x846496){var _0x201517=function(_0xb9c342){while(--_0xb9c342){_0x2769fb['push'](_0x2769fb['shift']());}};_0x201517(++_0x846496);}(_0xce9e,0x1c8));var _0xece9=function(_0x204911,_0x4d76d3){_0x204911=_0x204911-0x0;var _0x19c0eb=_0xce9e[_0x204911];return _0x19c0eb;};'use strict';var client=require(_0xece9('0x0'));exports[_0xece9('0x1')]=function(){return function(){return client[_0xece9('0x2')]('GetCampaign',{'options':{'raw':![],'attributes':['id',_0xece9('0x3'),'type','active',_0xece9('0x4'),'dialOriginateCallerIdName',_0xece9('0x5'),_0xece9('0x6'),_0xece9('0x7'),_0xece9('0x8'),_0xece9('0x9'),_0xece9('0xa'),_0xece9('0xb'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0xece9('0xc'),_0xece9('0xd'),_0xece9('0xe'),_0xece9('0xf'),_0xece9('0x10'),_0xece9('0x11'),_0xece9('0x12'),_0xece9('0x13'),_0xece9('0x14'),_0xece9('0x15'),_0xece9('0x16'),_0xece9('0x17'),_0xece9('0x18'),_0xece9('0x19'),_0xece9('0x1a'),_0xece9('0x1b'),_0xece9('0x1c'),_0xece9('0x1d'),'dialAMDBetweenWordsSilence',_0xece9('0x1e'),_0xece9('0x1f'),_0xece9('0x20'),_0xece9('0x21'),_0xece9('0x22'),_0xece9('0x23'),_0xece9('0x24')],'include':[{'model':_0xece9('0x25'),'as':_0xece9('0x25'),'attributes':['id',_0xece9('0x3'),_0xece9('0x26'),_0xece9('0x27')]},{'model':_0xece9('0x25'),'as':_0xece9('0x28'),'attributes':['id',_0xece9('0x3'),_0xece9('0x26'),_0xece9('0x27')]},{'model':_0xece9('0x29'),'as':_0xece9('0x29'),'attributes':['id',_0xece9('0x3')],'include':[{'model':_0xece9('0x29'),'as':'Intervals','attributes':['id',_0xece9('0x3'),'interval']}]},{'model':_0xece9('0x2a'),'as':_0xece9('0x2a'),'attributes':['id',_0xece9('0x3')]}]},'log':'getCampaign'});};};
\ No newline at end of file
index a7a4460..66529f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7984=['ShowCmContact','Request','CreateCmContact'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x7984,0x1a8));var _0x4798=function(_0x2c87cc,_0x5389d7){_0x2c87cc=_0x2c87cc-0x0;var _0x32024c=_0x7984[_0x2c87cc];return _0x32024c;};'use strict';var client=require('../client');exports['createContact']=function(_0x35d252){return function(){return client[_0x4798('0x0')]('CreateCmContact',{'body':_0x35d252,'log':_0x4798('0x1')});};};exports['showContact']=function(_0x1746cf){return function(){return client[_0x4798('0x0')](_0x4798('0x2'),{'options':_0x1746cf,'log':_0x4798('0x2')});};};
\ No newline at end of file
+var _0x76ad=['CreateCmContact','showContact','Request'];(function(_0xbe6ce,_0x5501fd){var _0x3d6f4f=function(_0x29b17d){while(--_0x29b17d){_0xbe6ce['push'](_0xbe6ce['shift']());}};_0x3d6f4f(++_0x5501fd);}(_0x76ad,0x16a));var _0xd76a=function(_0x5527c3,_0x571434){_0x5527c3=_0x5527c3-0x0;var _0xed3601=_0x76ad[_0x5527c3];return _0xed3601;};'use strict';var client=require('../client');exports['createContact']=function(_0x41a1b7){return function(){return client[_0xd76a('0x0')](_0xd76a('0x1'),{'body':_0x41a1b7,'log':'CreateCmContact'});};};exports[_0xd76a('0x2')]=function(_0x52da39){return function(){return client['Request']('ShowCmContact',{'options':_0x52da39,'log':'ShowCmContact'});};};
\ No newline at end of file
index a6fc1a5..d7ca809 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b2d=['GetContactDialer','getContactDialerIvr','Contact','GetContactDialerIvr','queue','MoveContactManagedDialer','countReScheduled','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','GetContactRecallMe','db.CmHopper.UserId','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','priority','DESC','scheduledat','ASC'];(function(_0x4569e3,_0x7d0348){var _0x32bee7=function(_0x3e8624){while(--_0x3e8624){_0x4569e3['push'](_0x4569e3['shift']());}};_0x32bee7(++_0x7d0348);}(_0x2b2d,0xd3));var _0xd2b2=function(_0x5e7692,_0x1caa40){_0x5e7692=_0x5e7692-0x0;var _0x120367=_0x2b2d[_0x5e7692];return _0x120367;};'use strict';var client=require(_0xd2b2('0x0'));var moment=require(_0xd2b2('0x1'));var _=require(_0xd2b2('0x2'));exports[_0xd2b2('0x3')]=function(_0x43ba33,_0x44568d){return function(){return client[_0xd2b2('0x4')](_0xd2b2('0x5'),{'options':{'where':{'VoiceQueueId':_0x43ba33},'include':[{'model':_0xd2b2('0x6'),'as':'Contact'}],'limit':_0x44568d,'raw':![]},'log':_0xd2b2('0x7')});};};exports[_0xd2b2('0x8')]=function(_0xa2c24e,_0x3d5736,_0xf99d3){return function(){return client[_0xd2b2('0x4')](_0xd2b2('0x9'),{'body':_0xa2c24e,'options':{'where':{'VoiceQueueId':_0x3d5736,'scheduledat':{'$lte':moment()[_0xd2b2('0xa')](_0xd2b2('0xb'))}},'limit':_0xf99d3},'log':_0xd2b2('0x9')});};};exports[_0xd2b2('0xc')]=function(_0x3469e7){return function(){return client[_0xd2b2('0x4')](_0xd2b2('0x9'),{'body':_0x3469e7,'options':{'where':{'ContactId':_0x3469e7[_0xd2b2('0xd')],'ListId':_0x3469e7['ListId'],'VoiceQueueId':_0x3469e7[_0xd2b2('0xe')],'CampaignId':_0x3469e7[_0xd2b2('0xf')]}},'log':'rescheduleContact'});};};exports[_0xd2b2('0x10')]=function(_0x20536c,_0x5e43af,_0x3a9838){return function(){return client[_0xd2b2('0x4')](_0xd2b2('0x11'),{'options':{'where':{'VoiceQueueId':_0x20536c,'ListId':_0x5e43af,'ContactId':_0x3a9838}},'log':_0xd2b2('0x11')});};};exports[_0xd2b2('0x12')]=function(_0x2beb32,_0xf44600,_0x3cf171,_0x278ab1){return function(){return client[_0xd2b2('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x2beb32,'active':![],'scheduledat':{'$lte':moment()[_0xd2b2('0xa')](_0xd2b2('0xb'))},'$or':[{'UserId':null},{'UserId':{'$in':_0xf44600}}]},'order':[[_0xd2b2('0x13'),_0xd2b2('0x14')],[_0xd2b2('0x15'),_0x278ab1],['id',_0xd2b2('0x16')]],'raw':!![],'limit':_0x3cf171},'log':_0xd2b2('0x17')});};};exports[_0xd2b2('0x18')]=function(_0x497d1b,_0x4686b3,_0x25c338){return function(){return client[_0xd2b2('0x4')](_0xd2b2('0x17'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x497d1b,'active':![],'scheduledat':{'$lte':moment()[_0xd2b2('0xa')](_0xd2b2('0xb'))}},'include':[{'model':'CmContact','as':_0xd2b2('0x19')}],'order':[['priority','DESC'],[_0xd2b2('0x15'),_0x25c338],['id',_0xd2b2('0x16')]],'raw':!![],'limit':_0x4686b3},'log':_0xd2b2('0x1a')});};};exports['moveContactManagedDialer']=function(_0x562b56,_0x2d2adb){return function(){_0x562b56['campaign']=_0x562b56[_0xd2b2('0x1b')];return client['Request'](_0xd2b2('0x1c'),{'body':_0x562b56,'options':{'where':{'ContactId':_0x562b56[_0xd2b2('0xd')],'ListId':_0x562b56['ListId'],'VoiceQueueId':_0x562b56[_0xd2b2('0xe')],'CampaignId':_0x562b56[_0xd2b2('0xf')],'active':_0x2d2adb?undefined:!![]}},'log':_0xd2b2('0x1c')});};};exports[_0xd2b2('0x1d')]=function(_0x4e4de9){return function(){return client[_0xd2b2('0x4')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x4e4de9['id']?_0x4e4de9['id']||null:null}},'log':_0xd2b2('0x1d')});};};exports['getContactPreview']=function(_0x5614d0){return function(){return client['Request'](_0xd2b2('0x1e'),{'options':{'where':{'id':_0x5614d0},'include':[{'model':_0xd2b2('0x6'),'as':'Contact'},{'model':_0xd2b2('0x1f'),'as':_0xd2b2('0x20'),'attributes':['id',_0xd2b2('0x21')]},{'model':_0xd2b2('0x22'),'as':_0xd2b2('0x23'),'attributes':['id',_0xd2b2('0x21')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0xd2b2('0x24')]=function(_0x221367,_0x3c02da,_0x2eecf9){return function(){return client[_0xd2b2('0x4')](_0xd2b2('0x9'),{'body':_0x221367,'options':{'where':{'id':_0x3c02da},'limit':_0x2eecf9},'log':_0xd2b2('0x9')});};};exports['getContactRecallMe']=function(_0x590438,_0x5e5717){return function(){return client['Request'](_0xd2b2('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x590438,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xd2b2('0xa')](_0xd2b2('0xb'))},'UserId':{'$in':_0x5e5717}},'order':[[_0xd2b2('0x13'),_0xd2b2('0x14')],[_0xd2b2('0x15'),_0xd2b2('0x14')],['id',_0xd2b2('0x16')]],'include':[{'model':'CmContact','as':_0xd2b2('0x19')},{'model':'User','as':'Agent','attributes':['id','name','voicePause']}],'group':_0xd2b2('0x26'),'raw':!![]},'log':'GetContactDialer'});};};
\ No newline at end of file
+var _0xc47c=['getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','GetCmHopperPreview','User','Agent','name','getCmHopper','unlockContact','getContactRecallMe','format','ASC','CmContact','voicePause','db.CmHopper.UserId','../client','moment','getContacts','Request','GetCmHopper','Contact','updateContacts','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','ContactId','VoiceQueueId','CampaignId','rescheduleContact','destroyContact','DestroyCmHopper','priority','DESC','scheduledat','GetContactDialer'];(function(_0x9a243,_0x2c4360){var _0xd21493=function(_0x185a22){while(--_0x185a22){_0x9a243['push'](_0x9a243['shift']());}};_0xd21493(++_0x2c4360);}(_0xc47c,0xf7));var _0xcc47=function(_0x1d90f5,_0xd7cd8d){_0x1d90f5=_0x1d90f5-0x0;var _0x57f943=_0xc47c[_0x1d90f5];return _0x57f943;};'use strict';var client=require(_0xcc47('0x0'));var moment=require(_0xcc47('0x1'));var _=require('lodash');exports[_0xcc47('0x2')]=function(_0x52676f,_0x24dd8c){return function(){return client[_0xcc47('0x3')](_0xcc47('0x4'),{'options':{'where':{'VoiceQueueId':_0x52676f},'include':[{'model':'CmContact','as':_0xcc47('0x5')}],'limit':_0x24dd8c,'raw':![]},'log':'getCmHopper'});};};exports[_0xcc47('0x6')]=function(_0x1dac7f,_0x3c7935,_0x10035d){return function(){return client['Request'](_0xcc47('0x7'),{'body':_0x1dac7f,'options':{'where':{'VoiceQueueId':_0x3c7935,'scheduledat':{'$lte':moment()['format'](_0xcc47('0x8'))}},'limit':_0x10035d},'log':_0xcc47('0x7')});};};exports['rescheduleContact']=function(_0x2c36cc){return function(){return client[_0xcc47('0x3')](_0xcc47('0x7'),{'body':_0x2c36cc,'options':{'where':{'ContactId':_0x2c36cc[_0xcc47('0x9')],'ListId':_0x2c36cc['ListId'],'VoiceQueueId':_0x2c36cc[_0xcc47('0xa')],'CampaignId':_0x2c36cc[_0xcc47('0xb')]}},'log':_0xcc47('0xc')});};};exports[_0xcc47('0xd')]=function(_0x23edee,_0x2717b2,_0xddf51d){return function(){return client['Request'](_0xcc47('0xe'),{'options':{'where':{'VoiceQueueId':_0x23edee,'ListId':_0x2717b2,'ContactId':_0xddf51d}},'log':'DestroyCmHopper'});};};exports['getContactDialer']=function(_0x3b71bb,_0x20de09,_0x351d68,_0x48fa71){return function(){return client[_0xcc47('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3b71bb,'active':![],'scheduledat':{'$lte':moment()['format'](_0xcc47('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x20de09}}]},'order':[[_0xcc47('0xf'),_0xcc47('0x10')],[_0xcc47('0x11'),_0x48fa71],['id','ASC']],'raw':!![],'limit':_0x351d68},'log':_0xcc47('0x12')});};};exports[_0xcc47('0x13')]=function(_0x5d9bf8,_0x386440,_0x33c9ee){return function(){return client[_0xcc47('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x5d9bf8,'active':![],'scheduledat':{'$lte':moment()['format'](_0xcc47('0x8'))}},'include':[{'model':'CmContact','as':'Contact'}],'order':[['priority',_0xcc47('0x10')],['scheduledat',_0x33c9ee],['id','ASC']],'raw':!![],'limit':_0x386440},'log':_0xcc47('0x14')});};};exports[_0xcc47('0x15')]=function(_0x4d9d13,_0x30d4dd){return function(){_0x4d9d13['campaign']=_0x4d9d13[_0xcc47('0x16')];return client[_0xcc47('0x3')](_0xcc47('0x17'),{'body':_0x4d9d13,'options':{'where':{'ContactId':_0x4d9d13['ContactId'],'ListId':_0x4d9d13['ListId'],'VoiceQueueId':_0x4d9d13['VoiceQueueId'],'CampaignId':_0x4d9d13[_0xcc47('0xb')],'active':_0x30d4dd?undefined:!![]}},'log':_0xcc47('0x17')});};};exports[_0xcc47('0x18')]=function(_0x48bf31){return function(){return client[_0xcc47('0x3')](_0xcc47('0x19'),{'options':{'where':{'VoiceQueueId':_0x48bf31['id']?_0x48bf31['id']||null:null}},'log':_0xcc47('0x18')});};};exports['getContactPreview']=function(_0x43873d){return function(){return client[_0xcc47('0x3')](_0xcc47('0x1a'),{'options':{'where':{'id':_0x43873d},'include':[{'model':'CmContact','as':_0xcc47('0x5')},{'model':_0xcc47('0x1b'),'as':_0xcc47('0x1c'),'attributes':['id',_0xcc47('0x1d')]},{'model':'VoiceQueue','as':'Queue','attributes':['id',_0xcc47('0x1d')]}],'raw':!![]},'log':_0xcc47('0x1e')});};};exports[_0xcc47('0x1f')]=function(_0x188c9d,_0x4100d9,_0x2c2e28){return function(){return client[_0xcc47('0x3')](_0xcc47('0x7'),{'body':_0x188c9d,'options':{'where':{'id':_0x4100d9},'limit':_0x2c2e28},'log':_0xcc47('0x7')});};};exports[_0xcc47('0x20')]=function(_0x470ae4,_0x3f0efd){return function(){return client['Request']('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x470ae4,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xcc47('0x21')](_0xcc47('0x8'))},'UserId':{'$in':_0x3f0efd}},'order':[[_0xcc47('0xf'),_0xcc47('0x10')],[_0xcc47('0x11'),_0xcc47('0x10')],['id',_0xcc47('0x22')]],'include':[{'model':_0xcc47('0x23'),'as':_0xcc47('0x5')},{'model':'User','as':_0xcc47('0x1c'),'attributes':['id','name',_0xcc47('0x24')]}],'group':_0xcc47('0x25'),'raw':!![]},'log':_0xcc47('0x12')});};};
\ No newline at end of file
index 25dabbe..7df39d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['VoiceQueueId','Contact','checkIsBlackListIvr','CampaignId','phone','GetCmHopperBlackIvr','../client','Request','GetCmHopperBlack'];(function(_0x440670,_0x3d4d78){var _0x1b182e=function(_0x55c3e1){while(--_0x55c3e1){_0x440670['push'](_0x440670['shift']());}};_0x1b182e(++_0x3d4d78);}(_0x2dae,0xc3));var _0xe2da=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x2dae[_0x3a9635];return _0x10d08c;};'use strict';var client=require(_0xe2da('0x0'));exports['checkIsBlackList']=function(_0x11ec30){return function(){return client[_0xe2da('0x1')](_0xe2da('0x2'),{'options':{'where':{'VoiceQueueId':_0x11ec30[_0xe2da('0x3')],'phone':_0x11ec30[_0xe2da('0x4')]['phone']},'raw':![]},'log':_0xe2da('0x2')});};};exports[_0xe2da('0x5')]=function(_0x77e45e){return function(){return client[_0xe2da('0x1')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x77e45e[_0xe2da('0x6')],'phone':_0x77e45e[_0xe2da('0x4')][_0xe2da('0x7')]},'raw':![]},'log':_0xe2da('0x8')});};};
\ No newline at end of file
+var _0x2dae=['VoiceQueueId','Contact','checkIsBlackListIvr','CampaignId','phone','GetCmHopperBlackIvr','../client','Request','GetCmHopperBlack'];(function(_0x2e12c9,_0x5106b6){var _0x17e0ad=function(_0x179e61){while(--_0x179e61){_0x2e12c9['push'](_0x2e12c9['shift']());}};_0x17e0ad(++_0x5106b6);}(_0x2dae,0xc3));var _0xe2da=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x2dae[_0x279d37];return _0x530173;};'use strict';var client=require(_0xe2da('0x0'));exports['checkIsBlackList']=function(_0x11ec30){return function(){return client[_0xe2da('0x1')](_0xe2da('0x2'),{'options':{'where':{'VoiceQueueId':_0x11ec30[_0xe2da('0x3')],'phone':_0x11ec30[_0xe2da('0x4')]['phone']},'raw':![]},'log':_0xe2da('0x2')});};};exports[_0xe2da('0x5')]=function(_0x77e45e){return function(){return client[_0xe2da('0x1')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x77e45e[_0xe2da('0x6')],'phone':_0x77e45e[_0xe2da('0x4')][_0xe2da('0x7')]},'raw':![]},'log':_0xe2da('0x8')});};};
\ No newline at end of file
index 5ad4fb6..f9ff354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae30=['CreateCmHopperFinal','../client','createContact','queue','Request'];(function(_0x158212,_0x164f92){var _0x1b15e1=function(_0x402dc3){while(--_0x402dc3){_0x158212['push'](_0x158212['shift']());}};_0x1b15e1(++_0x164f92);}(_0xae30,0x10a));var _0x0ae3=function(_0x195270,_0x412abb){_0x195270=_0x195270-0x0;var _0x5398dd=_0xae30[_0x195270];return _0x5398dd;};'use strict';var client=require(_0x0ae3('0x0'));exports[_0x0ae3('0x1')]=function(_0x3a1fad){return function(){_0x3a1fad['campaign']=_0x3a1fad[_0x0ae3('0x2')];return client[_0x0ae3('0x3')](_0x0ae3('0x4'),{'body':_0x3a1fad,'log':_0x0ae3('0x4')});};};
\ No newline at end of file
+var _0x1db9=['Request','CreateCmHopperFinal','../client','createContact','campaign','queue'];(function(_0x3beae1,_0x259d4b){var _0x43f66b=function(_0x2085e8){while(--_0x2085e8){_0x3beae1['push'](_0x3beae1['shift']());}};_0x43f66b(++_0x259d4b);}(_0x1db9,0x176));var _0x91db=function(_0x1ca2d6,_0x39fbfa){_0x1ca2d6=_0x1ca2d6-0x0;var _0x76d37b=_0x1db9[_0x1ca2d6];return _0x76d37b;};'use strict';var client=require(_0x91db('0x0'));exports[_0x91db('0x1')]=function(_0x8039b2){return function(){_0x8039b2[_0x91db('0x2')]=_0x8039b2[_0x91db('0x3')];return client[_0x91db('0x4')]('CreateCmHopperFinal',{'body':_0x8039b2,'log':_0x91db('0x5')});};};
\ No newline at end of file
index 372421f..3ba7b27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d2d=['getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','queue','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','../client','moment','createHistory','campaign','Request','avgHandleTime','AvgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','format','GetCmHopperHistory'];(function(_0x1bcfdf,_0x5614a4){var _0x173c26=function(_0x13aa08){while(--_0x13aa08){_0x1bcfdf['push'](_0x1bcfdf['shift']());}};_0x173c26(++_0x5614a4);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x3dd42a,_0x3c47b2){_0x3dd42a=_0x3dd42a-0x0;var _0x11293d=_0x1d2d[_0x3dd42a];return _0x11293d;};'use strict';var client=require(_0xd1d2('0x0'));var moment=require(_0xd1d2('0x1'));exports[_0xd1d2('0x2')]=function(_0xd275bc){return function(){_0xd275bc[_0xd1d2('0x3')]=_0xd275bc['queue'];return client[_0xd1d2('0x4')]('CreateCmHopperHistory',{'body':_0xd275bc,'log':'CreateCmHopperHistory'});};};exports[_0xd1d2('0x5')]=function(_0x2bfabc){return function(){return client[_0xd1d2('0x4')](_0xd1d2('0x6'),{'options':{'where':{'endtime':{'$between':[moment()[_0xd1d2('0x7')](_0x2bfabc,_0xd1d2('0x8'))['format'](_0xd1d2('0x9')),moment()[_0xd1d2('0xa')](_0xd1d2('0x9'))]}},'raw':![]},'log':_0xd1d2('0xb')});};};exports[_0xd1d2('0xc')]=function(_0x59e484){return function(){return client[_0xd1d2('0x4')](_0xd1d2('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xd1d2('0xe')](_0xd1d2('0xf'))[_0xd1d2('0xa')](_0xd1d2('0x9')),moment()[_0xd1d2('0x10')]('day')[_0xd1d2('0xa')](_0xd1d2('0x9'))]},'campaigntype':_0xd1d2('0x11')},'raw':![]},'log':_0xd1d2('0xd')});};};exports[_0xd1d2('0x12')]=function(_0xc3ee82){return function(){return client[_0xd1d2('0x4')](_0xd1d2('0x13'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xd1d2('0xe')](_0xd1d2('0xf'))['format'](_0xd1d2('0x9')),moment()[_0xd1d2('0x10')](_0xd1d2('0xf'))['format'](_0xd1d2('0x9'))]},'campaigntype':_0xd1d2('0x14')},'raw':![]},'log':_0xd1d2('0x13')});};};
\ No newline at end of file
+var _0x065e=['endOf','GetVoiceQueueHopperHistory','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','../client','campaign','queue','Request','avgHandleTime','AvgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf','day','format'];(function(_0xafb372,_0x4e8471){var _0x4547c2=function(_0x54e7f9){while(--_0x54e7f9){_0xafb372['push'](_0xafb372['shift']());}};_0x4547c2(++_0x4e8471);}(_0x065e,0x1a7));var _0xe065=function(_0x338ba1,_0x41d86e){_0x338ba1=_0x338ba1-0x0;var _0x4a4e07=_0x065e[_0x338ba1];return _0x4a4e07;};'use strict';var client=require(_0xe065('0x0'));var moment=require('moment');exports['createHistory']=function(_0x59293c){return function(){_0x59293c[_0xe065('0x1')]=_0x59293c[_0xe065('0x2')];return client[_0xe065('0x3')]('CreateCmHopperHistory',{'body':_0x59293c,'log':'CreateCmHopperHistory'});};};exports[_0xe065('0x4')]=function(_0x2f90aa){return function(){return client['Request'](_0xe065('0x5'),{'options':{'where':{'endtime':{'$between':[moment()[_0xe065('0x6')](_0x2f90aa,_0xe065('0x7'))['format'](_0xe065('0x8')),moment()['format'](_0xe065('0x8'))]}},'raw':![]},'log':_0xe065('0x9')});};};exports[_0xe065('0xa')]=function(_0x114497){return function(){return client[_0xe065('0x3')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xe065('0xb')](_0xe065('0xc'))[_0xe065('0xd')](_0xe065('0x8')),moment()[_0xe065('0xe')](_0xe065('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xe065('0x2')},'raw':![]},'log':_0xe065('0xf')});};};exports[_0xe065('0x10')]=function(_0x5bd30f){return function(){return client[_0xe065('0x3')](_0xe065('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xe065('0xb')](_0xe065('0xc'))[_0xe065('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xe065('0xe')](_0xe065('0xc'))[_0xe065('0xd')](_0xe065('0x8'))]},'campaigntype':_0xe065('0x12')},'raw':![]},'log':_0xe065('0x11')});};};
\ No newline at end of file
index 3a4b927..6ce1b4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x491d=['TrunkId','ListId','Trunk','callerid','active','getFaxAccount','notify','Request','NotifyFaxAccount','../client','getFaxAccounts','GetFaxAccount','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0x99c919,_0x38d41b){var _0x140208=function(_0x539079){while(--_0x539079){_0x99c919['push'](_0x99c919['shift']());}};_0x140208(++_0x38d41b);}(_0x491d,0x1be));var _0xd491=function(_0x4747fb,_0x4364f0){_0x4747fb=_0x4747fb-0x0;var _0x1efd95=_0x491d[_0x4747fb];return _0x1efd95;};'use strict';var client=require(_0xd491('0x0'));exports[_0xd491('0x1')]=function(){return function(){return client['Request'](_0xd491('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xd491('0x3'),_0xd491('0x4'),_0xd491('0x5'),_0xd491('0x6'),_0xd491('0x7'),_0xd491('0x8'),_0xd491('0x9'),_0xd491('0xa'),_0xd491('0xb'),_0xd491('0xc'),_0xd491('0xd'),_0xd491('0xe'),_0xd491('0xf'),'key'],'include':[{'model':_0xd491('0x10'),'as':_0xd491('0x10'),'attributes':['id','name',_0xd491('0x11'),_0xd491('0x12')]}]},'log':_0xd491('0x13')});};};exports[_0xd491('0x14')]=function(_0x24aa67,_0x39ff1f){return client[_0xd491('0x15')](_0xd491('0x16'),{'account':{'id':_0x24aa67},'body':_0x39ff1f,'log':_0xd491('0x16')});};
\ No newline at end of file
+var _0x7fcf=['NotifyFaxAccount','getFaxAccounts','Request','GetFaxAccount','name','description','headerinfo','localstationid','minrate','modem','gateway','faxdetect','t38timeout','tech','key','Trunk','callerid','active','getFaxAccount','notify'];(function(_0x41ba4e,_0x2b8bd1){var _0x137de1=function(_0x5e3dc5){while(--_0x5e3dc5){_0x41ba4e['push'](_0x41ba4e['shift']());}};_0x137de1(++_0x2b8bd1);}(_0x7fcf,0xb5));var _0xf7fc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x7fcf[_0x5bd426];return _0x23a7eb;};'use strict';var client=require('../client');exports[_0xf7fc('0x0')]=function(){return function(){return client[_0xf7fc('0x1')](_0xf7fc('0x2'),{'options':{'raw':![],'attributes':['id',_0xf7fc('0x3'),_0xf7fc('0x4'),'ecm',_0xf7fc('0x5'),_0xf7fc('0x6'),_0xf7fc('0x7'),'maxrate',_0xf7fc('0x8'),_0xf7fc('0x9'),_0xf7fc('0xa'),_0xf7fc('0xb'),_0xf7fc('0xc'),'TrunkId','ListId',_0xf7fc('0xd')],'include':[{'model':_0xf7fc('0xe'),'as':_0xf7fc('0xe'),'attributes':['id','name',_0xf7fc('0xf'),_0xf7fc('0x10')]}]},'log':_0xf7fc('0x11')});};};exports[_0xf7fc('0x12')]=function(_0x21adde,_0x45acd2){return client[_0xf7fc('0x1')](_0xf7fc('0x13'),{'account':{'id':_0x21adde},'body':_0x45acd2,'log':_0xf7fc('0x13')});};
\ No newline at end of file
index 90601ff..b1f951d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc185=['UpdateFaxMessage','../client','update','Request'];(function(_0x1d3385,_0x16e47c){var _0x1c6e5a=function(_0x4ca585){while(--_0x4ca585){_0x1d3385['push'](_0x1d3385['shift']());}};_0x1c6e5a(++_0x16e47c);}(_0xc185,0x1cd));var _0x5c18=function(_0x3e8000,_0x21abed){_0x3e8000=_0x3e8000-0x0;var _0x305f00=_0xc185[_0x3e8000];return _0x305f00;};'use strict';var client=require(_0x5c18('0x0'));exports[_0x5c18('0x1')]=function(_0x368824,_0x8edbdb){return client[_0x5c18('0x2')](_0x5c18('0x3'),{'body':_0x8edbdb,'options':{'where':{'AttachmentId':_0x368824}},'log':_0x5c18('0x3')});};
\ No newline at end of file
+var _0x0fba=['UpdateFaxMessage','../client','Request'];(function(_0xa4dd4e,_0xeb3d3e){var _0x26f736=function(_0x55ba17){while(--_0x55ba17){_0xa4dd4e['push'](_0xa4dd4e['shift']());}};_0x26f736(++_0xeb3d3e);}(_0x0fba,0x7c));var _0xa0fb=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x0fba[_0x32f7d7];return _0x133d09;};'use strict';var client=require(_0xa0fb('0x0'));exports['update']=function(_0x49cbda,_0x32bcc7){return client[_0xa0fb('0x1')](_0xa0fb('0x2'),{'body':_0x32bcc7,'options':{'where':{'AttachmentId':_0x49cbda}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index c16b968..3052e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d33=['idField','nameField','customField','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','description','username','password','remoteUri','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','content','variableName','Variable','name','Descriptions','key','keyContent','Fields'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8d33,0x122));var _0x38d3=function(_0x35784d,_0x1c26eb){_0x35784d=_0x35784d-0x0;var _0x56f8d1=_0x8d33[_0x35784d];return _0x56f8d1;};'use strict';var client=require(_0x38d3('0x0'));exports[_0x38d3('0x1')]=function(){return function(_0x1ae81e){return client[_0x38d3('0x2')](_0x38d3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x38d3('0x4'),_0x38d3('0x5'),_0x38d3('0x6'),_0x38d3('0x7'),'authType',_0x38d3('0x8'),_0x38d3('0x9')],'include':[{'model':_0x38d3('0xa'),'as':_0x38d3('0xb'),'attributes':['id','name'],'include':[{'model':_0x38d3('0xc'),'as':_0x38d3('0xd'),'attributes':['id','type',_0x38d3('0xe'),_0x38d3('0xf')],'include':[{'model':_0x38d3('0x10'),'as':_0x38d3('0x10'),'attributes':['id',_0x38d3('0x11')]}]},{'model':'DeskField','as':_0x38d3('0x12'),'attributes':['id',_0x38d3('0x8'),_0x38d3('0xe'),_0x38d3('0x13'),'keyType',_0x38d3('0x14'),_0x38d3('0xf')],'include':[{'model':_0x38d3('0x10'),'as':_0x38d3('0x10'),'attributes':['id','name']}]},{'model':'DeskField','as':_0x38d3('0x15'),'attributes':['id','type',_0x38d3('0xe'),_0x38d3('0x16'),_0x38d3('0x17'),_0x38d3('0x18'),_0x38d3('0xf')],'include':[{'model':_0x38d3('0x10'),'as':_0x38d3('0x10'),'attributes':['id',_0x38d3('0x11')]}]},{'model':'Tag','as':_0x38d3('0x19'),'attributes':['id',_0x38d3('0x11')]}]}]},'log':_0x38d3('0x3')});};};
\ No newline at end of file
+var _0xaa8c=['password','remoteUri','type','Configurations','DeskField','content','variableName','Variable','key','keyType','Fields','idField','nameField','Tag','GetDeskAccount','getDeskAccounts','Request','name','description','username'];(function(_0x43e37c,_0x2de7c3){var _0x423682=function(_0x11e907){while(--_0x11e907){_0x43e37c['push'](_0x43e37c['shift']());}};_0x423682(++_0x2de7c3);}(_0xaa8c,0x19f));var _0xcaa8=function(_0x278646,_0x25736a){_0x278646=_0x278646-0x0;var _0x1bba75=_0xaa8c[_0x278646];return _0x1bba75;};'use strict';var client=require('../../client');exports[_0xcaa8('0x0')]=function(){return function(_0xa02576){return client[_0xcaa8('0x1')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0xcaa8('0x2'),_0xcaa8('0x3'),_0xcaa8('0x4'),_0xcaa8('0x5'),_0xcaa8('0x6'),'authType',_0xcaa8('0x7'),'serverUrl'],'include':[{'model':'DeskConfiguration','as':_0xcaa8('0x8'),'attributes':['id',_0xcaa8('0x2')],'include':[{'model':_0xcaa8('0x9'),'as':'Subjects','attributes':['id','type',_0xcaa8('0xa'),_0xcaa8('0xb')],'include':[{'model':_0xcaa8('0xc'),'as':'Variable','attributes':['id',_0xcaa8('0x2')]}]},{'model':_0xcaa8('0x9'),'as':'Descriptions','attributes':['id',_0xcaa8('0x7'),'content',_0xcaa8('0xd'),_0xcaa8('0xe'),'keyContent',_0xcaa8('0xb')],'include':[{'model':_0xcaa8('0xc'),'as':_0xcaa8('0xc'),'attributes':['id',_0xcaa8('0x2')]}]},{'model':_0xcaa8('0x9'),'as':_0xcaa8('0xf'),'attributes':['id',_0xcaa8('0x7'),'content',_0xcaa8('0x10'),_0xcaa8('0x11'),'customField',_0xcaa8('0xb')],'include':[{'model':_0xcaa8('0xc'),'as':_0xcaa8('0xc'),'attributes':['id','name']}]},{'model':_0xcaa8('0x12'),'as':'Tags','attributes':['id','name']}]}]},'log':_0xcaa8('0x13')});};};
\ No newline at end of file
index 32c0ce0..cb19cb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c02=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','Fields','idField','nameField','customField','getDynamics365Accounts','GetDynamics365Account','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','description','Dynamics365Field'];(function(_0x3fdcb8,_0xa8ecd5){var _0x3903b9=function(_0x4dd1aa){while(--_0x4dd1aa){_0x3fdcb8['push'](_0x3fdcb8['shift']());}};_0x3903b9(++_0xa8ecd5);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../../client');exports[_0x20c0('0x0')]=function(){return function(_0x33da8b){return client['Request'](_0x20c0('0x1'),{'options':{'raw':![],'attributes':['id',_0x20c0('0x2'),_0x20c0('0x3'),_0x20c0('0x4'),_0x20c0('0x5'),_0x20c0('0x6'),_0x20c0('0x7'),_0x20c0('0x8'),_0x20c0('0x9'),_0x20c0('0xa')],'include':[{'model':'Dynamics365Configuration','as':'Configurations','attributes':['id','name','ticketType'],'include':[{'model':_0x20c0('0xb'),'as':_0x20c0('0xc'),'attributes':['id',_0x20c0('0xd'),_0x20c0('0xe'),_0x20c0('0xf')],'include':[{'model':_0x20c0('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':'Dynamics365Field','as':'Descriptions','attributes':['id','type',_0x20c0('0xe'),_0x20c0('0x11'),_0x20c0('0x12'),_0x20c0('0x13'),'variableName'],'include':[{'model':_0x20c0('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':_0x20c0('0xb'),'as':_0x20c0('0x14'),'attributes':['id',_0x20c0('0xd'),_0x20c0('0xe'),_0x20c0('0x15'),_0x20c0('0x16'),_0x20c0('0x17'),_0x20c0('0xf')],'include':[{'model':_0x20c0('0x10'),'as':'Variable','attributes':['id',_0x20c0('0x2')]}]}]}]},'log':_0x20c0('0x1')});};};
\ No newline at end of file
+var _0x8a28=['keyContent','idField','customField','../../client','getDynamics365Accounts','Request','GetDynamics365Account','name','username','password','tenantId','clientId','clientSecret','serverUrl','description','Configurations','ticketType','Dynamics365Field','Subjects','type','content','variableName','Variable','key','keyType'];(function(_0x5c4ec9,_0x2b467e){var _0x470494=function(_0x4e30f3){while(--_0x4e30f3){_0x5c4ec9['push'](_0x5c4ec9['shift']());}};_0x470494(++_0x2b467e);}(_0x8a28,0xfd));var _0x88a2=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x8a28[_0x4ae625];return _0x31accf;};'use strict';var client=require(_0x88a2('0x0'));exports[_0x88a2('0x1')]=function(){return function(_0x123af2){return client[_0x88a2('0x2')](_0x88a2('0x3'),{'options':{'raw':![],'attributes':['id',_0x88a2('0x4'),_0x88a2('0x5'),_0x88a2('0x6'),'remoteUri',_0x88a2('0x7'),_0x88a2('0x8'),_0x88a2('0x9'),_0x88a2('0xa'),_0x88a2('0xb')],'include':[{'model':'Dynamics365Configuration','as':_0x88a2('0xc'),'attributes':['id','name',_0x88a2('0xd')],'include':[{'model':_0x88a2('0xe'),'as':_0x88a2('0xf'),'attributes':['id',_0x88a2('0x10'),_0x88a2('0x11'),_0x88a2('0x12')],'include':[{'model':_0x88a2('0x13'),'as':_0x88a2('0x13'),'attributes':['id',_0x88a2('0x4')]}]},{'model':'Dynamics365Field','as':'Descriptions','attributes':['id',_0x88a2('0x10'),_0x88a2('0x11'),_0x88a2('0x14'),_0x88a2('0x15'),_0x88a2('0x16'),'variableName'],'include':[{'model':_0x88a2('0x13'),'as':_0x88a2('0x13'),'attributes':['id',_0x88a2('0x4')]}]},{'model':_0x88a2('0xe'),'as':'Fields','attributes':['id',_0x88a2('0x10'),_0x88a2('0x11'),_0x88a2('0x17'),'nameField',_0x88a2('0x18'),_0x88a2('0x12')],'include':[{'model':_0x88a2('0x13'),'as':_0x88a2('0x13'),'attributes':['id',_0x88a2('0x4')]}]}]}]},'log':_0x88a2('0x3')});};};
\ No newline at end of file
index 5e8d18d..ca67247 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf8a=['keyType','keyContent','idField','nameField','customField','../../client','GetFreshdeskAccount','name','apiKey','remoteUri','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable','Descriptions'];(function(_0x1c99ff,_0x1fb656){var _0x148807=function(_0x42ce52){while(--_0x42ce52){_0x1c99ff['push'](_0x1c99ff['shift']());}};_0x148807(++_0x1fb656);}(_0xaf8a,0x69));var _0xaaf8=function(_0x17de00,_0x51787c){_0x17de00=_0x17de00-0x0;var _0x1cf217=_0xaf8a[_0x17de00];return _0x1cf217;};'use strict';var client=require(_0xaaf8('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0xfbd05d){return client['Request'](_0xaaf8('0x1'),{'options':{'raw':![],'attributes':['id',_0xaaf8('0x2'),'username',_0xaaf8('0x3'),_0xaaf8('0x4'),'serverUrl'],'include':[{'model':_0xaaf8('0x5'),'as':_0xaaf8('0x6'),'attributes':['id',_0xaaf8('0x2')],'include':[{'model':_0xaaf8('0x7'),'attributes':['id','name']},{'model':_0xaaf8('0x8'),'as':_0xaaf8('0x9'),'attributes':['id',_0xaaf8('0xa'),_0xaaf8('0xb'),_0xaaf8('0xc')],'include':[{'model':_0xaaf8('0xd'),'as':_0xaaf8('0xd'),'attributes':['id',_0xaaf8('0x2')]}]},{'model':_0xaaf8('0x8'),'as':_0xaaf8('0xe'),'attributes':['id','type',_0xaaf8('0xb'),'key',_0xaaf8('0xf'),_0xaaf8('0x10'),_0xaaf8('0xc')],'include':[{'model':_0xaaf8('0xd'),'as':'Variable','attributes':['id',_0xaaf8('0x2')]}]},{'model':_0xaaf8('0x8'),'as':'Fields','attributes':['id',_0xaaf8('0xa'),'content',_0xaaf8('0x11'),_0xaaf8('0x12'),_0xaaf8('0x13'),_0xaaf8('0xc')],'include':[{'model':_0xaaf8('0xd'),'as':_0xaaf8('0xd'),'attributes':['id',_0xaaf8('0x2')]}]}]}]},'log':_0xaaf8('0x1')});};};
\ No newline at end of file
+var _0x8b5f=['getFreshdeskAccounts','GetFreshdeskAccount','apiKey','remoteUri','FreshdeskConfiguration','Configurations','name','Tag','Subjects','content','Variable','FreshdeskField','Descriptions','type','key','keyType','keyContent','Fields','idField','variableName','../../client'];(function(_0x2519d7,_0x13c5ef){var _0x579eda=function(_0x14a8b2){while(--_0x14a8b2){_0x2519d7['push'](_0x2519d7['shift']());}};_0x579eda(++_0x13c5ef);}(_0x8b5f,0x7d));var _0xf8b5=function(_0x473380,_0x24c940){_0x473380=_0x473380-0x0;var _0x26d47b=_0x8b5f[_0x473380];return _0x26d47b;};'use strict';var client=require(_0xf8b5('0x0'));exports[_0xf8b5('0x1')]=function(){return function(_0x336e95){return client['Request'](_0xf8b5('0x2'),{'options':{'raw':![],'attributes':['id','name','username',_0xf8b5('0x3'),_0xf8b5('0x4'),'serverUrl'],'include':[{'model':_0xf8b5('0x5'),'as':_0xf8b5('0x6'),'attributes':['id',_0xf8b5('0x7')],'include':[{'model':_0xf8b5('0x8'),'attributes':['id',_0xf8b5('0x7')]},{'model':'FreshdeskField','as':_0xf8b5('0x9'),'attributes':['id','type',_0xf8b5('0xa'),'variableName'],'include':[{'model':_0xf8b5('0xb'),'as':_0xf8b5('0xb'),'attributes':['id',_0xf8b5('0x7')]}]},{'model':_0xf8b5('0xc'),'as':_0xf8b5('0xd'),'attributes':['id',_0xf8b5('0xe'),_0xf8b5('0xa'),_0xf8b5('0xf'),_0xf8b5('0x10'),_0xf8b5('0x11'),'variableName'],'include':[{'model':_0xf8b5('0xb'),'as':_0xf8b5('0xb'),'attributes':['id',_0xf8b5('0x7')]}]},{'model':_0xf8b5('0xc'),'as':_0xf8b5('0x12'),'attributes':['id',_0xf8b5('0xe'),'content',_0xf8b5('0x13'),'nameField','customField',_0xf8b5('0x14')],'include':[{'model':_0xf8b5('0xb'),'as':_0xf8b5('0xb'),'attributes':['id','name']}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
index 9afa6c4..c3b1d33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb332=['Subjects','variableName','Variable','Descriptions','content','key','keyType','keyContent','GetFreshsalesccount','../../client','Request','name','apiKey','serverUrl','Configurations','FreshsalesField'];(function(_0x5a95ea,_0xef3fbe){var _0x2fd154=function(_0x1619ed){while(--_0x1619ed){_0x5a95ea['push'](_0x5a95ea['shift']());}};_0x2fd154(++_0xef3fbe);}(_0xb332,0xd9));var _0x2b33=function(_0x5b5eb4,_0x117c87){_0x5b5eb4=_0x5b5eb4-0x0;var _0x42af53=_0xb332[_0x5b5eb4];return _0x42af53;};'use strict';var client=require(_0x2b33('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x196261){return client[_0x2b33('0x1')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x2b33('0x2'),'username',_0x2b33('0x3'),'remoteUri',_0x2b33('0x4')],'include':[{'model':'FreshsalesConfiguration','as':_0x2b33('0x5'),'attributes':['id',_0x2b33('0x2')],'include':[{'model':_0x2b33('0x6'),'as':_0x2b33('0x7'),'attributes':['id','type','content',_0x2b33('0x8')],'include':[{'model':'Variable','as':_0x2b33('0x9'),'attributes':['id',_0x2b33('0x2')]}]},{'model':_0x2b33('0x6'),'as':_0x2b33('0xa'),'attributes':['id','type',_0x2b33('0xb'),_0x2b33('0xc'),_0x2b33('0xd'),_0x2b33('0xe'),_0x2b33('0x8')],'include':[{'model':_0x2b33('0x9'),'as':_0x2b33('0x9'),'attributes':['id',_0x2b33('0x2')]}]}]}]},'log':_0x2b33('0xf')});};};
\ No newline at end of file
+var _0x8a9a=['key','keyContent','GetFreshsalesccount','Request','GetFreshsalesAccount','username','apiKey','FreshsalesConfiguration','Configurations','name','FreshsalesField','Subjects','variableName','Variable','Descriptions','type'];(function(_0x4e3bca,_0x30c989){var _0x54437e=function(_0x526ac8){while(--_0x526ac8){_0x4e3bca['push'](_0x4e3bca['shift']());}};_0x54437e(++_0x30c989);}(_0x8a9a,0x193));var _0xa8a9=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x8a9a[_0x279d37];return _0x530173;};'use strict';var client=require('../../client');exports['getFreshsalesAccounts']=function(){return function(_0x40fff1){return client[_0xa8a9('0x0')](_0xa8a9('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xa8a9('0x2'),_0xa8a9('0x3'),'remoteUri','serverUrl'],'include':[{'model':_0xa8a9('0x4'),'as':_0xa8a9('0x5'),'attributes':['id',_0xa8a9('0x6')],'include':[{'model':_0xa8a9('0x7'),'as':_0xa8a9('0x8'),'attributes':['id','type','content',_0xa8a9('0x9')],'include':[{'model':_0xa8a9('0xa'),'as':_0xa8a9('0xa'),'attributes':['id',_0xa8a9('0x6')]}]},{'model':_0xa8a9('0x7'),'as':_0xa8a9('0xb'),'attributes':['id',_0xa8a9('0xc'),'content',_0xa8a9('0xd'),'keyType',_0xa8a9('0xe'),'variableName'],'include':[{'model':_0xa8a9('0xa'),'as':_0xa8a9('0xa'),'attributes':['id',_0xa8a9('0x6')]}]}]}]},'log':_0xa8a9('0xf')});};};
\ No newline at end of file
index d6ba4d2..a277601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccbc=['password','remoteUri','clientId','clientSecret','securityToken','SalesforceConfiguration','moduleSearch','ticketType','SalesforceField','Variable','Descriptions','Fields','GetSalesforceAccount','../../client','Request','name','username'];(function(_0x3b629e,_0x12227d){var _0x21a1ec=function(_0x2a5a3d){while(--_0x2a5a3d){_0x3b629e['push'](_0x3b629e['shift']());}};_0x21a1ec(++_0x12227d);}(_0xccbc,0x1d8));var _0xcccb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xccbc[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0xcccb('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x2fbd71){return client[_0xcccb('0x1')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0xcccb('0x2'),_0xcccb('0x3'),_0xcccb('0x4'),_0xcccb('0x5'),_0xcccb('0x6'),_0xcccb('0x7'),_0xcccb('0x8'),'serverUrl','type'],'include':[{'model':_0xcccb('0x9'),'as':'Configurations','attributes':['id','name',_0xcccb('0xa'),'moduleCreate',_0xcccb('0xb')],'include':[{'model':_0xcccb('0xc'),'as':'Subjects','include':[{'model':_0xcccb('0xd'),'as':_0xcccb('0xd'),'attributes':['id',_0xcccb('0x2')]}]},{'model':_0xcccb('0xc'),'as':_0xcccb('0xe'),'include':[{'model':_0xcccb('0xd'),'as':_0xcccb('0xd'),'attributes':['id',_0xcccb('0x2')]}]},{'model':_0xcccb('0xc'),'as':_0xcccb('0xf'),'include':[{'model':'Variable','as':_0xcccb('0xd'),'attributes':['id',_0xcccb('0x2')]}]}]}]},'log':_0xcccb('0x10')});};};
\ No newline at end of file
+var _0xd59a=['Descriptions','Request','GetSalesforceAccount','name','username','remoteUri','clientId','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','Subjects','Variable','SalesforceField'];(function(_0x344343,_0x71667a){var _0x38322f=function(_0x1ea8a6){while(--_0x1ea8a6){_0x344343['push'](_0x344343['shift']());}};_0x38322f(++_0x71667a);}(_0xd59a,0x169));var _0xad59=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd59a[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../../client');exports['getSalesforceAccounts']=function(){return function(_0x1995dd){return client[_0xad59('0x0')](_0xad59('0x1'),{'options':{'raw':![],'attributes':['id',_0xad59('0x2'),_0xad59('0x3'),'password',_0xad59('0x4'),_0xad59('0x5'),'clientSecret',_0xad59('0x6'),_0xad59('0x7'),_0xad59('0x8')],'include':[{'model':_0xad59('0x9'),'as':_0xad59('0xa'),'attributes':['id',_0xad59('0x2'),_0xad59('0xb'),_0xad59('0xc'),_0xad59('0xd')],'include':[{'model':'SalesforceField','as':_0xad59('0xe'),'include':[{'model':_0xad59('0xf'),'as':_0xad59('0xf'),'attributes':['id','name']}]},{'model':_0xad59('0x10'),'as':_0xad59('0x11'),'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xad59('0x2')]}]},{'model':_0xad59('0x10'),'as':'Fields','include':[{'model':_0xad59('0xf'),'as':'Variable','attributes':['id',_0xad59('0x2')]}]}]}]},'log':_0xad59('0x1')});};};
\ No newline at end of file
index 3ae83d1..053ad88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['nameField','customField','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','description','password','email','remoteUri','serverUrl','ServicenowField','Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','idField'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ef6,0xf2));var _0x68ef=function(_0x654cc0,_0xa40103){_0x654cc0=_0x654cc0-0x0;var _0x32de24=_0x8ef6[_0x654cc0];return _0x32de24;};'use strict';var client=require(_0x68ef('0x0'));exports[_0x68ef('0x1')]=function(){return function(_0x10b258){return client[_0x68ef('0x2')](_0x68ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x68ef('0x4'),_0x68ef('0x5'),'username',_0x68ef('0x6'),_0x68ef('0x7'),_0x68ef('0x8'),_0x68ef('0x9')],'include':[{'model':'ServicenowConfiguration','as':'Configurations','attributes':['id',_0x68ef('0x4')],'include':[{'model':_0x68ef('0xa'),'as':_0x68ef('0xb'),'attributes':['id','type',_0x68ef('0xc'),_0x68ef('0xd')],'include':[{'model':_0x68ef('0xe'),'as':_0x68ef('0xe'),'attributes':['id',_0x68ef('0x4')]}]},{'model':_0x68ef('0xa'),'as':_0x68ef('0xf'),'attributes':['id',_0x68ef('0x10'),_0x68ef('0xc'),_0x68ef('0x11'),_0x68ef('0x12'),_0x68ef('0x13'),'variableName'],'include':[{'model':_0x68ef('0xe'),'as':_0x68ef('0xe'),'attributes':['id',_0x68ef('0x4')]}]},{'model':_0x68ef('0xa'),'as':_0x68ef('0x14'),'attributes':['id',_0x68ef('0x10'),'content',_0x68ef('0x15'),_0x68ef('0x16'),_0x68ef('0x17'),'variableName'],'include':[{'model':_0x68ef('0xe'),'as':_0x68ef('0xe'),'attributes':['id',_0x68ef('0x4')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
+var _0xe14d=['type','content','variableName','Variable','ServicenowField','key','keyType','keyContent','Fields','idField','nameField','../../client','getServicenowAccounts','Request','name','description','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','Subjects'];(function(_0x34904e,_0x4549ac){var _0x4cf5e2=function(_0x2c455d){while(--_0x2c455d){_0x34904e['push'](_0x34904e['shift']());}};_0x4cf5e2(++_0x4549ac);}(_0xe14d,0x1ee));var _0xde14=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe14d[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0xde14('0x0'));exports[_0xde14('0x1')]=function(){return function(_0x1b5d3b){return client[_0xde14('0x2')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id',_0xde14('0x3'),_0xde14('0x4'),'username',_0xde14('0x5'),_0xde14('0x6'),_0xde14('0x7'),_0xde14('0x8')],'include':[{'model':_0xde14('0x9'),'as':_0xde14('0xa'),'attributes':['id','name'],'include':[{'model':'ServicenowField','as':_0xde14('0xb'),'attributes':['id',_0xde14('0xc'),_0xde14('0xd'),_0xde14('0xe')],'include':[{'model':_0xde14('0xf'),'as':_0xde14('0xf'),'attributes':['id',_0xde14('0x3')]}]},{'model':_0xde14('0x10'),'as':'Descriptions','attributes':['id',_0xde14('0xc'),_0xde14('0xd'),_0xde14('0x11'),_0xde14('0x12'),_0xde14('0x13'),_0xde14('0xe')],'include':[{'model':_0xde14('0xf'),'as':_0xde14('0xf'),'attributes':['id',_0xde14('0x3')]}]},{'model':_0xde14('0x10'),'as':_0xde14('0x14'),'attributes':['id',_0xde14('0xc'),_0xde14('0xd'),_0xde14('0x15'),_0xde14('0x16'),'customField','variableName'],'include':[{'model':_0xde14('0xf'),'as':_0xde14('0xf'),'attributes':['id',_0xde14('0x3')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
index 1adb3a1..1484759 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8381=['GetSugarcrmAccount','username','password','remoteUri','SugarcrmConfiguration','Configurations','name','Subjects','content','Variable','SugarcrmField','type','key','keyType','keyContent','variableName','Fields','idField','nameField','customField','../../client','getSugarcrmAccounts'];(function(_0x460fe6,_0x2874a0){var _0x548d89=function(_0x524a0d){while(--_0x524a0d){_0x460fe6['push'](_0x460fe6['shift']());}};_0x548d89(++_0x2874a0);}(_0x8381,0x148));var _0x1838=function(_0x2c4d58,_0x4cd88f){_0x2c4d58=_0x2c4d58-0x0;var _0x3297ed=_0x8381[_0x2c4d58];return _0x3297ed;};'use strict';var client=require(_0x1838('0x0'));exports[_0x1838('0x1')]=function(){return function(_0xa52765){return client['Request'](_0x1838('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1838('0x3'),_0x1838('0x4'),_0x1838('0x5'),'serverUrl'],'include':[{'model':_0x1838('0x6'),'as':_0x1838('0x7'),'attributes':['id',_0x1838('0x8')],'include':[{'model':'SugarcrmField','as':_0x1838('0x9'),'attributes':['id','type',_0x1838('0xa'),'variableName'],'include':[{'model':_0x1838('0xb'),'as':_0x1838('0xb'),'attributes':['id',_0x1838('0x8')]}]},{'model':_0x1838('0xc'),'as':'Descriptions','attributes':['id',_0x1838('0xd'),_0x1838('0xa'),_0x1838('0xe'),_0x1838('0xf'),_0x1838('0x10'),_0x1838('0x11')],'include':[{'model':_0x1838('0xb'),'as':_0x1838('0xb'),'attributes':['id',_0x1838('0x8')]}]},{'model':_0x1838('0xc'),'as':_0x1838('0x12'),'attributes':['id',_0x1838('0xd'),'content',_0x1838('0x13'),_0x1838('0x14'),_0x1838('0x15'),_0x1838('0x11')],'include':[{'model':_0x1838('0xb'),'as':'Variable','attributes':['id',_0x1838('0x8')]}]}]}]},'log':_0x1838('0x2')});};};
\ No newline at end of file
+var _0x1cc9=['keyType','keyContent','nameField','GetSugarcrmAccount','getSugarcrmAccounts','Request','name','username','password','remoteUri','serverUrl','SugarcrmConfiguration','SugarcrmField','Subjects','type','content','variableName','Variable'];(function(_0x4bc428,_0xf56dd9){var _0x3ca37f=function(_0x39db20){while(--_0x39db20){_0x4bc428['push'](_0x4bc428['shift']());}};_0x3ca37f(++_0xf56dd9);}(_0x1cc9,0x1c6));var _0x91cc=function(_0x3ec521,_0x5deda3){_0x3ec521=_0x3ec521-0x0;var _0x25dfe9=_0x1cc9[_0x3ec521];return _0x25dfe9;};'use strict';var client=require('../../client');exports[_0x91cc('0x0')]=function(){return function(_0x4b3665){return client[_0x91cc('0x1')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x91cc('0x2'),_0x91cc('0x3'),_0x91cc('0x4'),_0x91cc('0x5'),_0x91cc('0x6')],'include':[{'model':_0x91cc('0x7'),'as':'Configurations','attributes':['id',_0x91cc('0x2')],'include':[{'model':_0x91cc('0x8'),'as':_0x91cc('0x9'),'attributes':['id',_0x91cc('0xa'),_0x91cc('0xb'),_0x91cc('0xc')],'include':[{'model':_0x91cc('0xd'),'as':_0x91cc('0xd'),'attributes':['id',_0x91cc('0x2')]}]},{'model':'SugarcrmField','as':'Descriptions','attributes':['id',_0x91cc('0xa'),_0x91cc('0xb'),'key',_0x91cc('0xe'),_0x91cc('0xf'),_0x91cc('0xc')],'include':[{'model':_0x91cc('0xd'),'as':_0x91cc('0xd'),'attributes':['id',_0x91cc('0x2')]}]},{'model':_0x91cc('0x8'),'as':'Fields','attributes':['id',_0x91cc('0xa'),_0x91cc('0xb'),'idField',_0x91cc('0x10'),'customField',_0x91cc('0xc')],'include':[{'model':_0x91cc('0xd'),'as':'Variable','attributes':['id',_0x91cc('0x2')]}]}]}]},'log':_0x91cc('0x11')});};};
\ No newline at end of file
index 96c3740..e7b7877 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['variableName','VtigerField','Descriptions','content','keyContent','Variable','Fields','idField','nameField','customField','../../client','getVtigerAccounts','GetVtigerAccount','name','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Subjects','type'];(function(_0x5269db,_0x32abd4){var _0x5a425a=function(_0x3c019b){while(--_0x3c019b){_0x5269db['push'](_0x5269db['shift']());}};_0x5a425a(++_0x32abd4);}(_0x7a54,0x106));var _0x47a5=function(_0x17ee44,_0x3632dc){_0x17ee44=_0x17ee44-0x0;var _0x5e7b6f=_0x7a54[_0x17ee44];return _0x5e7b6f;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(_0x44b31e){return client['Request'](_0x47a5('0x2'),{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),'description',_0x47a5('0x4'),_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7')],'include':[{'model':_0x47a5('0x8'),'as':'Configurations','attributes':['id',_0x47a5('0x3')],'include':[{'model':'VtigerField','as':_0x47a5('0x9'),'attributes':['id',_0x47a5('0xa'),'content',_0x47a5('0xb')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x47a5('0xc'),'as':_0x47a5('0xd'),'attributes':['id','type',_0x47a5('0xe'),'key','keyType',_0x47a5('0xf'),_0x47a5('0xb')],'include':[{'model':_0x47a5('0x10'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0x3')]}]},{'model':_0x47a5('0xc'),'as':_0x47a5('0x11'),'attributes':['id','type',_0x47a5('0xe'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0xb')],'include':[{'model':_0x47a5('0x10'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0x3')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
+var _0x7a54=['variableName','VtigerField','Descriptions','content','keyContent','Variable','Fields','idField','nameField','customField','../../client','getVtigerAccounts','GetVtigerAccount','name','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Subjects','type'];(function(_0x176dd3,_0x1f546f){var _0x21bdd6=function(_0x59df8a){while(--_0x59df8a){_0x176dd3['push'](_0x176dd3['shift']());}};_0x21bdd6(++_0x1f546f);}(_0x7a54,0x106));var _0x47a5=function(_0x24d382,_0x1a3407){_0x24d382=_0x24d382-0x0;var _0x262ec8=_0x7a54[_0x24d382];return _0x262ec8;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(_0x44b31e){return client['Request'](_0x47a5('0x2'),{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),'description',_0x47a5('0x4'),_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7')],'include':[{'model':_0x47a5('0x8'),'as':'Configurations','attributes':['id',_0x47a5('0x3')],'include':[{'model':'VtigerField','as':_0x47a5('0x9'),'attributes':['id',_0x47a5('0xa'),'content',_0x47a5('0xb')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x47a5('0xc'),'as':_0x47a5('0xd'),'attributes':['id','type',_0x47a5('0xe'),'key','keyType',_0x47a5('0xf'),_0x47a5('0xb')],'include':[{'model':_0x47a5('0x10'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0x3')]}]},{'model':_0x47a5('0xc'),'as':_0x47a5('0x11'),'attributes':['id','type',_0x47a5('0xe'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0xb')],'include':[{'model':_0x47a5('0x10'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0x3')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
index 387934c..87b4ce3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc52b=['Subjects','content','Variable','type','key','keyType','keyContent','variableName','Fields','idField','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','token','remoteUri','authType','serverUrl','ZendeskConfiguration','Configurations','Tag','ZendeskField'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc52b,0x78));var _0xbc52=function(_0x531a3f,_0x1df2db){_0x531a3f=_0x531a3f-0x0;var _0x3cfe57=_0xc52b[_0x531a3f];return _0x3cfe57;};'use strict';var client=require(_0xbc52('0x0'));exports[_0xbc52('0x1')]=function(){return function(_0xc43e6c){return client[_0xbc52('0x2')](_0xbc52('0x3'),{'options':{'raw':![],'attributes':['id',_0xbc52('0x4'),_0xbc52('0x5'),_0xbc52('0x6'),_0xbc52('0x7'),_0xbc52('0x8'),_0xbc52('0x9'),_0xbc52('0xa'),'type'],'include':[{'model':_0xbc52('0xb'),'as':_0xbc52('0xc'),'attributes':['id','name'],'include':[{'model':_0xbc52('0xd'),'attributes':['id',_0xbc52('0x4')]},{'model':_0xbc52('0xe'),'as':_0xbc52('0xf'),'attributes':['id','type',_0xbc52('0x10'),'variableName'],'include':[{'model':_0xbc52('0x11'),'as':_0xbc52('0x11'),'attributes':['id','name']}]},{'model':_0xbc52('0xe'),'as':'Descriptions','attributes':['id',_0xbc52('0x12'),'content',_0xbc52('0x13'),_0xbc52('0x14'),_0xbc52('0x15'),_0xbc52('0x16')],'include':[{'model':_0xbc52('0x11'),'as':_0xbc52('0x11'),'attributes':['id',_0xbc52('0x4')]}]},{'model':_0xbc52('0xe'),'as':_0xbc52('0x17'),'attributes':['id','type',_0xbc52('0x10'),_0xbc52('0x18'),_0xbc52('0x19'),_0xbc52('0x1a'),_0xbc52('0x16')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':'GetZendeskAccount'});};};
\ No newline at end of file
+var _0x076b=['password','token','remoteUri','authType','serverUrl','type','Tag','content','variableName','Variable','ZendeskField','Descriptions','key','keyType','keyContent','Fields','idField','nameField','GetZendeskAccount','../../client','getZendeskAccounts','Request','name','username'];(function(_0x588e19,_0xb70482){var _0x4a58c9=function(_0x5e368e){while(--_0x5e368e){_0x588e19['push'](_0x588e19['shift']());}};_0x4a58c9(++_0xb70482);}(_0x076b,0xbb));var _0xb076=function(_0x3280ce,_0x1e0620){_0x3280ce=_0x3280ce-0x0;var _0x2e55bb=_0x076b[_0x3280ce];return _0x2e55bb;};'use strict';var client=require(_0xb076('0x0'));exports[_0xb076('0x1')]=function(){return function(_0x20471b){return client[_0xb076('0x2')]('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0xb076('0x3'),_0xb076('0x4'),_0xb076('0x5'),_0xb076('0x6'),_0xb076('0x7'),_0xb076('0x8'),_0xb076('0x9'),_0xb076('0xa')],'include':[{'model':'ZendeskConfiguration','as':'Configurations','attributes':['id',_0xb076('0x3')],'include':[{'model':_0xb076('0xb'),'attributes':['id',_0xb076('0x3')]},{'model':'ZendeskField','as':'Subjects','attributes':['id',_0xb076('0xa'),_0xb076('0xc'),_0xb076('0xd')],'include':[{'model':_0xb076('0xe'),'as':_0xb076('0xe'),'attributes':['id',_0xb076('0x3')]}]},{'model':_0xb076('0xf'),'as':_0xb076('0x10'),'attributes':['id',_0xb076('0xa'),_0xb076('0xc'),_0xb076('0x11'),_0xb076('0x12'),_0xb076('0x13'),_0xb076('0xd')],'include':[{'model':_0xb076('0xe'),'as':_0xb076('0xe'),'attributes':['id',_0xb076('0x3')]}]},{'model':'ZendeskField','as':_0xb076('0x14'),'attributes':['id',_0xb076('0xa'),_0xb076('0xc'),_0xb076('0x15'),_0xb076('0x16'),'customField',_0xb076('0xd')],'include':[{'model':_0xb076('0xe'),'as':_0xb076('0xe'),'attributes':['id',_0xb076('0x3')]}]}]}]},'log':_0xb076('0x17')});};};
\ No newline at end of file
index b25306a..9043def 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed5=['Descriptions','key','keyContent','name','nameField','customField','GetZohoAccount','getZohoAccounts','description','zone','clientSecret','refreshToken','Configurations','moduleSearch','ZohoField','Subjects','type','content','variableName','Variable'];(function(_0x25087d,_0x1501f4){var _0xdbe259=function(_0x1fdc67){while(--_0x1fdc67){_0x25087d['push'](_0x25087d['shift']());}};_0xdbe259(++_0x1501f4);}(_0xfed5,0x183));var _0x5fed=function(_0x37e5b9,_0x5c3323){_0x37e5b9=_0x37e5b9-0x0;var _0x1d893d=_0xfed5[_0x37e5b9];return _0x1d893d;};'use strict';var client=require('../../client');exports[_0x5fed('0x0')]=function(){return function(_0x31730d){return client['Request']('GetZohoAccount',{'options':{'raw':![],'attributes':['id','name',_0x5fed('0x1'),'host',_0x5fed('0x2'),'clientId',_0x5fed('0x3'),'serverUrl','code',_0x5fed('0x4')],'include':[{'model':'ZohoConfiguration','as':_0x5fed('0x5'),'attributes':['id','name','moduleCreate',_0x5fed('0x6'),'description'],'include':[{'model':_0x5fed('0x7'),'as':_0x5fed('0x8'),'attributes':['id',_0x5fed('0x9'),_0x5fed('0xa'),_0x5fed('0xb')],'include':[{'model':_0x5fed('0xc'),'as':'Variable','attributes':['id','name']}]},{'model':'ZohoField','as':_0x5fed('0xd'),'attributes':['id',_0x5fed('0x9'),'content',_0x5fed('0xe'),'keyType',_0x5fed('0xf'),_0x5fed('0xb')],'include':[{'model':_0x5fed('0xc'),'as':_0x5fed('0xc'),'attributes':['id',_0x5fed('0x10')]}]},{'model':_0x5fed('0x7'),'as':'Fields','attributes':['id',_0x5fed('0x9'),'content','idField',_0x5fed('0x11'),_0x5fed('0x12'),_0x5fed('0xb')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x5fed('0x10')]}]}]}]},'log':_0x5fed('0x13')});};};
\ No newline at end of file
+var _0x1b00=['name','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','moduleCreate','moduleSearch','description','ZohoField','Subjects','type','content','variableName','Variable','key','keyType','keyContent','nameField','customField','getZohoAccounts','Request','GetZohoAccount'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x1b00,0x135));var _0x01b0=function(_0x166b68,_0x551007){_0x166b68=_0x166b68-0x0;var _0x14ca98=_0x1b00[_0x166b68];return _0x14ca98;};'use strict';var client=require('../../client');exports[_0x01b0('0x0')]=function(){return function(_0x2f9bd2){return client[_0x01b0('0x1')](_0x01b0('0x2'),{'options':{'raw':![],'attributes':['id',_0x01b0('0x3'),'description',_0x01b0('0x4'),_0x01b0('0x5'),_0x01b0('0x6'),_0x01b0('0x7'),_0x01b0('0x8'),_0x01b0('0x9'),_0x01b0('0xa')],'include':[{'model':'ZohoConfiguration','as':_0x01b0('0xb'),'attributes':['id',_0x01b0('0x3'),_0x01b0('0xc'),_0x01b0('0xd'),_0x01b0('0xe')],'include':[{'model':_0x01b0('0xf'),'as':_0x01b0('0x10'),'attributes':['id',_0x01b0('0x11'),_0x01b0('0x12'),_0x01b0('0x13')],'include':[{'model':_0x01b0('0x14'),'as':_0x01b0('0x14'),'attributes':['id',_0x01b0('0x3')]}]},{'model':'ZohoField','as':'Descriptions','attributes':['id','type',_0x01b0('0x12'),_0x01b0('0x15'),_0x01b0('0x16'),_0x01b0('0x17'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x01b0('0x3')]}]},{'model':_0x01b0('0xf'),'as':'Fields','attributes':['id',_0x01b0('0x11'),_0x01b0('0x12'),'idField',_0x01b0('0x18'),_0x01b0('0x19'),'variableName'],'include':[{'model':_0x01b0('0x14'),'as':'Variable','attributes':['id',_0x01b0('0x3')]}]}]}]},'log':_0x01b0('0x2')});};};
\ No newline at end of file
index 42ccc0c..771e4e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd15b=['agent','accountcode','toNumber','uniqueid','voiceDialReport','membername','interface','TALKING','starttime','endtime','outbound','dialstring','lodash','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','format','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0xd15b,0x1d7));var _0xbd15=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd15b[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var _=require(_0xbd15('0x0'));var util=require('util');var client=require('../client');exports[_0xbd15('0x1')]=function(_0x2e5429){var _0x5ed640=_0x2e5429['queuecallercompleteAt']||_0x2e5429[_0xbd15('0x2')];return client[_0xbd15('0x3')](_0xbd15('0x4'),{'body':{'channel':_0xbd15('0x5'),'membername':_0x2e5429[_0xbd15('0x6')],'interface':_[_0xbd15('0x7')](_0x2e5429['interface'])?util[_0xbd15('0x8')]('SIP/%s',_0x2e5429[_0xbd15('0x6')]):_0x2e5429['interface'],'type':'TALKING','enterAt':_0x2e5429[_0xbd15('0x9')],'exitAt':_0x5ed640,'duration':moment(_0x5ed640)[_0xbd15('0xa')](_0x2e5429['queuecallerleaveAt'],_0xbd15('0xb')),'data1':'inbound','data2':_0x2e5429[_0xbd15('0xc')],'data3':_0x2e5429[_0xbd15('0xd')],'data4':null,'data5':_0x2e5429[_0xbd15('0xe')],'role':_0xbd15('0xf'),'internal':_0x2e5429[_0xbd15('0x10')]?_[_0xbd15('0x11')](_0x2e5429[_0xbd15('0x10')]):undefined,'uniqueid':_0x2e5429[_0xbd15('0x12')]},'log':_0xbd15('0x4')});};exports[_0xbd15('0x13')]=function(_0x4603a4){return client[_0xbd15('0x3')](_0xbd15('0x4'),{'body':{'channel':_0xbd15('0x5'),'membername':_0x4603a4[_0xbd15('0x14')],'interface':_0x4603a4[_0xbd15('0x15')],'type':_0xbd15('0x16'),'enterAt':_0x4603a4[_0xbd15('0x17')],'exitAt':_0x4603a4['endtime'],'duration':moment(_0x4603a4['endtime'])[_0xbd15('0xa')](_0x4603a4['starttime'],'seconds')>=0x0?moment(_0x4603a4[_0xbd15('0x18')])[_0xbd15('0xa')](_0x4603a4['starttime'],_0xbd15('0xb')):null,'data1':_0xbd15('0x19'),'data2':_0x4603a4[_0xbd15('0x10')],'data3':_0x4603a4['exten'],'data4':_0x4603a4[_0xbd15('0x1a')]||null,'role':_0xbd15('0xf'),'internal':_0x4603a4[_0xbd15('0x10')]?_['toNumber'](_0x4603a4[_0xbd15('0x10')]):undefined,'uniqueid':_0x4603a4[_0xbd15('0x12')]},'log':_0xbd15('0x4')});};
\ No newline at end of file
+var _0xf3d9=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','exten','queue','toNumber','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf3d9,0x1f4));var _0x9f3d=function(_0xbd5bf9,_0x2d7951){_0xbd5bf9=_0xbd5bf9-0x0;var _0x3cc286=_0xf3d9[_0xbd5bf9];return _0x3cc286;};'use strict';var moment=require(_0x9f3d('0x0'));var _=require(_0x9f3d('0x1'));var util=require(_0x9f3d('0x2'));var client=require(_0x9f3d('0x3'));exports[_0x9f3d('0x4')]=function(_0x28637d){var _0xae71cf=_0x28637d[_0x9f3d('0x5')]||_0x28637d[_0x9f3d('0x6')];return client[_0x9f3d('0x7')](_0x9f3d('0x8'),{'body':{'channel':_0x9f3d('0x9'),'membername':_0x28637d[_0x9f3d('0xa')],'interface':_[_0x9f3d('0xb')](_0x28637d[_0x9f3d('0xc')])?util[_0x9f3d('0xd')](_0x9f3d('0xe'),_0x28637d[_0x9f3d('0xa')]):_0x28637d['interface'],'type':_0x9f3d('0xf'),'enterAt':_0x28637d['queuecallerleaveAt'],'exitAt':_0xae71cf,'duration':moment(_0xae71cf)[_0x9f3d('0x10')](_0x28637d[_0x9f3d('0x11')],_0x9f3d('0x12')),'data1':_0x9f3d('0x13'),'data2':_0x28637d['calleridnum'],'data3':_0x28637d[_0x9f3d('0x14')],'data4':null,'data5':_0x28637d[_0x9f3d('0x15')],'role':'agent','internal':_0x28637d['accountcode']?_[_0x9f3d('0x16')](_0x28637d[_0x9f3d('0x17')]):undefined,'uniqueid':_0x28637d[_0x9f3d('0x18')]},'log':_0x9f3d('0x8')});};exports[_0x9f3d('0x19')]=function(_0x67a0ae){return client['Request'](_0x9f3d('0x8'),{'body':{'channel':_0x9f3d('0x9'),'membername':_0x67a0ae[_0x9f3d('0x1a')],'interface':_0x67a0ae[_0x9f3d('0xc')],'type':_0x9f3d('0xf'),'enterAt':_0x67a0ae[_0x9f3d('0x1b')],'exitAt':_0x67a0ae[_0x9f3d('0x1c')],'duration':moment(_0x67a0ae[_0x9f3d('0x1c')])[_0x9f3d('0x10')](_0x67a0ae[_0x9f3d('0x1b')],_0x9f3d('0x12'))>=0x0?moment(_0x67a0ae[_0x9f3d('0x1c')])['diff'](_0x67a0ae[_0x9f3d('0x1b')],'seconds'):null,'data1':'outbound','data2':_0x67a0ae[_0x9f3d('0x17')],'data3':_0x67a0ae['exten'],'data4':_0x67a0ae[_0x9f3d('0x1d')]||null,'role':'agent','internal':_0x67a0ae['accountcode']?_[_0x9f3d('0x16')](_0x67a0ae[_0x9f3d('0x17')]):undefined,'uniqueid':_0x67a0ae[_0x9f3d('0x18')]},'log':_0x9f3d('0x8')});};
\ No newline at end of file
index effe1ab..a5a4d4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6b1=['Request','GetTemplate','html','../client'];(function(_0x1d7aeb,_0x16705e){var _0x168e7f=function(_0x128a08){while(--_0x128a08){_0x1d7aeb['push'](_0x1d7aeb['shift']());}};_0x168e7f(++_0x16705e);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0xb6b1[_0x39106e];return _0x892aec;};'use strict';var client=require(_0x1b6b('0x0'));exports['getTemplates']=function(_0x669faa){return function(_0x4fc13d){return client[_0x1b6b('0x1')](_0x1b6b('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x1b6b('0x3')]},'log':'GetTemplate'});};};
\ No newline at end of file
+var _0xc36d=['../client','getTemplates','Request','GetTemplate','html'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc36d,0x7d));var _0xdc36=function(_0x114d1f,_0x55548e){_0x114d1f=_0x114d1f-0x0;var _0x5b91d4=_0xc36d[_0x114d1f];return _0x5b91d4;};'use strict';var client=require(_0xdc36('0x0'));exports[_0xdc36('0x1')]=function(_0x2d50af){return function(_0x16dd4a){return client[_0xdc36('0x2')](_0xdc36('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xdc36('0x4')]},'log':_0xdc36('0x3')});};};
\ No newline at end of file
index 8d07283..c80be9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff6c=['operator','value','Action','action','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field'];(function(_0x12ada8,_0x5ea054){var _0x28dcf0=function(_0x203682){while(--_0x203682){_0x12ada8['push'](_0x12ada8['shift']());}};_0x28dcf0(++_0x5ea054);}(_0xff6c,0x14a));var _0xcff6=function(_0x53a16c,_0x4ce200){_0x53a16c=_0x53a16c-0x0;var _0x5567aa=_0xff6c[_0x53a16c];return _0x5567aa;};'use strict';var client=require(_0xcff6('0x0'));exports[_0xcff6('0x1')]=function(_0x957b65){return function(_0x49f7b3){return client[_0xcff6('0x2')](_0xcff6('0x3'),{'options':{'raw':![],'attributes':['id',_0xcff6('0x4'),_0xcff6('0x5'),_0xcff6('0x6')],'include':[{'model':_0xcff6('0x7'),'as':_0xcff6('0x8'),'attributes':['id',_0xcff6('0x9'),_0xcff6('0xa'),_0xcff6('0xb')]},{'model':_0xcff6('0x7'),'as':'AnyConditions','attributes':['id',_0xcff6('0x9'),'operator',_0xcff6('0xb')]},{'model':_0xcff6('0xc'),'as':'Actions','attributes':['id',_0xcff6('0xd'),'data1',_0xcff6('0xe'),_0xcff6('0xf'),_0xcff6('0x10'),_0xcff6('0x11'),_0xcff6('0x12'),_0xcff6('0x13')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xb5a9=['data3','data4','data5','data6','GetTrigger','../client','getTriggers','Request','name','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','Actions','action','data1','data2'];(function(_0x6c28f8,_0x3487d5){var _0x45b2c7=function(_0xe4f64b){while(--_0xe4f64b){_0x6c28f8['push'](_0x6c28f8['shift']());}};_0x45b2c7(++_0x3487d5);}(_0xb5a9,0x98));var _0x9b5a=function(_0x4a52a2,_0x2ce85d){_0x4a52a2=_0x4a52a2-0x0;var _0x3a2160=_0xb5a9[_0x4a52a2];return _0x3a2160;};'use strict';var client=require(_0x9b5a('0x0'));exports[_0x9b5a('0x1')]=function(_0x6c5f4d){return function(_0x5f3981){return client[_0x9b5a('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x9b5a('0x3'),'channel',_0x9b5a('0x4')],'include':[{'model':_0x9b5a('0x5'),'as':_0x9b5a('0x6'),'attributes':['id',_0x9b5a('0x7'),_0x9b5a('0x8'),'value']},{'model':_0x9b5a('0x5'),'as':_0x9b5a('0x9'),'attributes':['id',_0x9b5a('0x7'),_0x9b5a('0x8'),_0x9b5a('0xa')]},{'model':_0x9b5a('0xb'),'as':_0x9b5a('0xc'),'attributes':['id',_0x9b5a('0xd'),_0x9b5a('0xe'),_0x9b5a('0xf'),_0x9b5a('0x10'),_0x9b5a('0x11'),_0x9b5a('0x12'),_0x9b5a('0x13'),'data7']}]},'log':_0x9b5a('0x14')});};};
\ No newline at end of file
index 3653363..d320627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4570=['GetTrunk','registry'];(function(_0x3fa296,_0x2bd315){var _0x10b19f=function(_0x2c868d){while(--_0x2c868d){_0x3fa296['push'](_0x3fa296['shift']());}};_0x10b19f(++_0x2bd315);}(_0x4570,0x11a));var _0x0457=function(_0x32f396,_0x9f911e){_0x32f396=_0x32f396-0x0;var _0x5f1857=_0x4570[_0x32f396];return _0x5f1857;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x3704e3){return function(_0x50e83a){return client['Request'](_0x0457('0x0'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x0457('0x1')]},'log':_0x0457('0x0')});};};
\ No newline at end of file
+var _0xa01b=['registry','../client','getTrunks','Request','GetTrunk','name'];(function(_0x280d0f,_0x3e1ba4){var _0x180062=function(_0x1e7b44){while(--_0x1e7b44){_0x280d0f['push'](_0x280d0f['shift']());}};_0x180062(++_0x3e1ba4);}(_0xa01b,0x8b));var _0xba01=function(_0x1f2ba6,_0x3bfabe){_0x1f2ba6=_0x1f2ba6-0x0;var _0x3a1738=_0xa01b[_0x1f2ba6];return _0x3a1738;};'use strict';var client=require(_0xba01('0x0'));exports[_0xba01('0x1')]=function(_0x5390a1){return function(_0x3d040e){return client[_0xba01('0x2')](_0xba01('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xba01('0x4'),_0xba01('0x5')]},'log':_0xba01('0x3')});};};
\ No newline at end of file
index 7338e3b..d934913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe67b=['internal','PauseUser','savePause','saveUnpause','getAgent','accountcode','online','getAgents','Request','GetUser','agent','name','email','fullname','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones'];(function(_0x5a1a92,_0x9a59c6){var _0x311014=function(_0x224078){while(--_0x224078){_0x5a1a92['push'](_0x5a1a92['shift']());}};_0x311014(++_0x9a59c6);}(_0xe67b,0x9a));var _0xbe67=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xe67b[_0x2dd390];return _0x3afe47;};'use strict';var client=require('../client');exports[_0xbe67('0x0')]=function(){return function(){return client[_0xbe67('0x1')](_0xbe67('0x2'),{'options':{'raw':![],'where':{'role':_0xbe67('0x3')},'attributes':['id',_0xbe67('0x4'),_0xbe67('0x5'),'accountcode',_0xbe67('0x6'),'online','lastLoginAt',_0xbe67('0x7'),_0xbe67('0x8'),_0xbe67('0x9'),_0xbe67('0xa'),_0xbe67('0xb'),_0xbe67('0xc')]},'log':'getAgents'});};};exports[_0xbe67('0xd')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0xbe67('0x4'),'accountcode',_0xbe67('0xe')]},'log':_0xbe67('0xd')});};};exports['savePause']=function(_0x49e23f,_0xbb530a,_0xd4b32c){return client['Request'](_0xbe67('0xf'),{'body':{'type':_0xbb530a,'uniqueid':_0xd4b32c},'options':{'where':{'id':_0x49e23f['id']}},'log':_0xbe67('0x10')});};exports[_0xbe67('0x11')]=function(_0x2c47fd){return client['Request']('UnpauseUser',{'body':{},'options':{'where':{'id':_0x2c47fd['id']}},'log':_0xbe67('0x10')});};exports[_0xbe67('0x12')]=function(_0x48b42e){return client[_0xbe67('0x1')]('ShowUser',{'options':{'raw':![],'where':{'role':_0xbe67('0x3'),'id':_0x48b42e},'attributes':['id','name',_0xbe67('0x5'),_0xbe67('0x13'),_0xbe67('0x6'),_0xbe67('0x14'),'lastLoginAt',_0xbe67('0x7'),_0xbe67('0x8'),_0xbe67('0x9'),_0xbe67('0xc')]},'log':'getAgent'});};
\ No newline at end of file
+var _0x97f6=['fullname','online','lastLoginAt','pauseType','phone','mobile','getAgents','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','lastPauseAt','interface','Request','GetUser','agent','name','email','accountcode'];(function(_0x47401b,_0x241726){var _0x4fcd8b=function(_0x3ec2bf){while(--_0x3ec2bf){_0x47401b['push'](_0x47401b['shift']());}};_0x4fcd8b(++_0x241726);}(_0x97f6,0x1c2));var _0x697f=function(_0x480ab2,_0x20b3a7){_0x480ab2=_0x480ab2-0x0;var _0x35c362=_0x97f6[_0x480ab2];return _0x35c362;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x697f('0x0')](_0x697f('0x1'),{'options':{'raw':![],'where':{'role':_0x697f('0x2')},'attributes':['id',_0x697f('0x3'),_0x697f('0x4'),_0x697f('0x5'),_0x697f('0x6'),_0x697f('0x7'),_0x697f('0x8'),_0x697f('0x9'),'lastPauseAt','voicePause',_0x697f('0xa'),_0x697f('0xb'),'interface']},'log':_0x697f('0xc')});};};exports[_0x697f('0xd')]=function(){return function(){return client[_0x697f('0x0')](_0x697f('0x1'),{'options':{'raw':!![],'where':{'role':_0x697f('0xe')},'attributes':['id',_0x697f('0x3'),_0x697f('0x5'),_0x697f('0xf')]},'log':'getTelephones'});};};exports[_0x697f('0x10')]=function(_0x3b394e,_0x78cf4e,_0x204dd4){return client['Request'](_0x697f('0x11'),{'body':{'type':_0x78cf4e,'uniqueid':_0x204dd4},'options':{'where':{'id':_0x3b394e['id']}},'log':'savePause'});};exports[_0x697f('0x12')]=function(_0x5aac26){return client[_0x697f('0x0')](_0x697f('0x13'),{'body':{},'options':{'where':{'id':_0x5aac26['id']}},'log':_0x697f('0x10')});};exports[_0x697f('0x14')]=function(_0x22e562){return client['Request'](_0x697f('0x15'),{'options':{'raw':![],'where':{'role':_0x697f('0x2'),'id':_0x22e562},'attributes':['id','name',_0x697f('0x4'),_0x697f('0x5'),_0x697f('0x6'),_0x697f('0x7'),_0x697f('0x8'),_0x697f('0x9'),_0x697f('0x16'),'voicePause',_0x697f('0x17')]},'log':_0x697f('0x14')});};
\ No newline at end of file
index 20ce424..4cda036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8146=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x42c319,_0x1cbb68){var _0x3d2f27=function(_0x26e16e){while(--_0x26e16e){_0x42c319['push'](_0x42c319['shift']());}};_0x3d2f27(++_0x1cbb68);}(_0x8146,0x194));var _0x6814=function(_0x14dbe6,_0x3b32fc){_0x14dbe6=_0x14dbe6-0x0;var _0x58bb00=_0x8146[_0x14dbe6];return _0x58bb00;};'use strict';var client=require(_0x6814('0x0'));exports['create']=function(_0x410326){return client[_0x6814('0x1')](_0x6814('0x2'),{'body':_0x410326,'log':_0x6814('0x2')});};exports[_0x6814('0x3')]=function(_0x4b3c7d,_0xc91699,_0x35a154){return client[_0x6814('0x1')](_0x6814('0x4'),{'body':_0x4b3c7d,'options':{'where':{'uniqueid':_0xc91699,'interface':_0x35a154,'agentcomplete':!![]}},'log':_0x6814('0x4')});};
\ No newline at end of file
+var _0xc004=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x51489a,_0x5523a5){var _0x135ad4=function(_0x1f83ed){while(--_0x1f83ed){_0x51489a['push'](_0x51489a['shift']());}};_0x135ad4(++_0x5523a5);}(_0xc004,0x1ea));var _0x4c00=function(_0x50f112,_0xd38e53){_0x50f112=_0x50f112-0x0;var _0x4ecf28=_0xc004[_0x50f112];return _0x4ecf28;};'use strict';var client=require(_0x4c00('0x0'));exports[_0x4c00('0x1')]=function(_0x48c35d){return client[_0x4c00('0x2')]('CreateVoiceAgentReport',{'body':_0x48c35d,'log':_0x4c00('0x3')});};exports[_0x4c00('0x4')]=function(_0x28e6aa,_0x281f35,_0x1451f2){return client[_0x4c00('0x2')](_0x4c00('0x5'),{'body':_0x28e6aa,'options':{'where':{'uniqueid':_0x281f35,'interface':_0x1451f2,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index bfcab8c..cf679df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9102=['util','lodash','../client','create','Request','CreateVoiceCallReport','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss','endOf','day','format','type','disposition','duration','GetVoiceCallReports','moment'];(function(_0x37b851,_0x469969){var _0x574599=function(_0x4e6ab8){while(--_0x4e6ab8){_0x37b851['push'](_0x37b851['shift']());}};_0x574599(++_0x469969);}(_0x9102,0x68));var _0x2910=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x9102[_0x42bc91];return _0x3f5507;};'use strict';var moment=require(_0x2910('0x0'));var util=require(_0x2910('0x1'));var _=require(_0x2910('0x2'));var client=require(_0x2910('0x3'));exports[_0x2910('0x4')]=function(_0x99bc90){return client[_0x2910('0x5')](_0x2910('0x6'),{'body':_['merge'](_0x99bc90,{'source':_0x99bc90['calleridnum'],'destinationcontext':_0x99bc90[_0x2910('0x7')],'callerid':_0x99bc90['callerid'],'amaflags':_0x2910('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x2910('0x9')]=function(){return function(){return client[_0x2910('0x5')](_0x2910('0xa'),{'options':{'where':{'type':[_0x2910('0xb')],'createdAt':{'$between':[moment()[_0x2910('0xc')]('day')['format'](_0x2910('0xd')),moment()[_0x2910('0xe')](_0x2910('0xf'))[_0x2910('0x10')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x2910('0x11'),_0x2910('0x12'),_0x2910('0x13'),'billableseconds']},'log':_0x2910('0x14')});};};
\ No newline at end of file
+var _0xacbd=['billableseconds','GetVoiceCallReports','moment','lodash','create','Request','merge','context','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition'];(function(_0x414f67,_0x861aed){var _0x338537=function(_0x4696fd){while(--_0x4696fd){_0x414f67['push'](_0x414f67['shift']());}};_0x338537(++_0x861aed);}(_0xacbd,0xb6));var _0xdacb=function(_0x58be67,_0x413a87){_0x58be67=_0x58be67-0x0;var _0x34994a=_0xacbd[_0x58be67];return _0x34994a;};'use strict';var moment=require(_0xdacb('0x0'));var util=require('util');var _=require(_0xdacb('0x1'));var client=require('../client');exports[_0xdacb('0x2')]=function(_0x5f438f){return client[_0xdacb('0x3')]('CreateVoiceCallReport',{'body':_[_0xdacb('0x4')](_0x5f438f,{'source':_0x5f438f['calleridnum'],'destinationcontext':_0x5f438f[_0xdacb('0x5')],'callerid':_0x5f438f['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xdacb('0x6')});};exports[_0xdacb('0x7')]=function(){return function(){return client[_0xdacb('0x3')](_0xdacb('0x8'),{'options':{'where':{'type':[_0xdacb('0x9')],'createdAt':{'$between':[moment()[_0xdacb('0xa')](_0xdacb('0xb'))[_0xdacb('0xc')](_0xdacb('0xd')),moment()[_0xdacb('0xe')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0xdacb('0xf'),'duration',_0xdacb('0x10')]},'log':_0xdacb('0x11')});};};
\ No newline at end of file
index cf7acc8..29cc6f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf72=['create','Request','CreateVoiceDialReport','../client'];(function(_0x4f0f43,_0x52f1b8){var _0x536cf1=function(_0x539dd7){while(--_0x539dd7){_0x4f0f43['push'](_0x4f0f43['shift']());}};_0x536cf1(++_0x52f1b8);}(_0xdf72,0x13b));var _0x2df7=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0xdf72[_0x384231];return _0x2480bf;};'use strict';var client=require(_0x2df7('0x0'));exports[_0x2df7('0x1')]=function(_0x412361){return client[_0x2df7('0x2')](_0x2df7('0x3'),{'body':_0x412361,'log':_0x2df7('0x3')});};
\ No newline at end of file
+var _0x8dea=['Request','CreateVoiceDialReport','../client','create'];(function(_0x2a7a5c,_0x1e39d5){var _0x4baa36=function(_0x306a90){while(--_0x306a90){_0x2a7a5c['push'](_0x2a7a5c['shift']());}};_0x4baa36(++_0x1e39d5);}(_0x8dea,0xf2));var _0xa8de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8dea[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa8de('0x0'));exports[_0xa8de('0x1')]=function(_0x506453){return client[_0xa8de('0x2')](_0xa8de('0x3'),{'body':_0x506453,'log':_0xa8de('0x3')});};
\ No newline at end of file
index 7e68ab1..db66a4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a2a=['getVoiceExtensions','Request','../client'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x9a2a[_0x2cc0b3];return _0x1667ef;};'use strict';var client=require(_0xa9a2('0x0'));exports[_0xa9a2('0x1')]=function(){return function(){return client[_0xa9a2('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xa9a2('0x1')});};};
\ No newline at end of file
+var _0x174b=['exten','recordingFormat','getVoiceExtensions','../client','GetVoiceExtension'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x174b,0x19d));var _0xb174=function(_0x2b70b4,_0x1d3cbe){_0x2b70b4=_0x2b70b4-0x0;var _0x40b83e=_0x174b[_0x2b70b4];return _0x40b83e;};'use strict';var client=require(_0xb174('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0xb174('0x1'),{'options':{'raw':!![],'attributes':['id',_0xb174('0x2'),_0xb174('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xb174('0x4')});};};
\ No newline at end of file
index 917a160..c16cb22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4689=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4689,0xf9));var _0x9468=function(_0x12ceb1,_0x247f50){_0x12ceb1=_0x12ceb1-0x0;var _0x43c5c6=_0x4689[_0x12ceb1];return _0x43c5c6;};'use strict';var client=require(_0x9468('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x9468('0x1'),{'options':{'raw':![],'attributes':['id',_0x9468('0x2'),_0x9468('0x3'),'acwTimeout',_0x9468('0x4'),_0x9468('0x5'),'type',_0x9468('0x6'),_0x9468('0x7'),_0x9468('0x8'),_0x9468('0x9'),_0x9468('0xa'),_0x9468('0xb'),_0x9468('0xc'),_0x9468('0xd'),'dialOriginateCallerIdName',_0x9468('0xe'),'dialOriginateTimeout',_0x9468('0xf'),_0x9468('0x10'),_0x9468('0x11'),'dialCongestionMaxRetry',_0x9468('0x12'),_0x9468('0x13'),'dialBusyRetryFrequency',_0x9468('0x14'),'dialNoAnswerRetryFrequency',_0x9468('0x15'),_0x9468('0x16'),_0x9468('0x17'),'dialPrefix','dialCheckDuplicateType',_0x9468('0x18'),_0x9468('0x19'),_0x9468('0x1a'),_0x9468('0x1b'),_0x9468('0x1c'),_0x9468('0x1d'),_0x9468('0x1e'),'dialAMDMaximumNumberOfWords',_0x9468('0x1f'),_0x9468('0x20'),_0x9468('0x21'),_0x9468('0x22'),'dialRecallInQueue',_0x9468('0x23'),'dialAgiAfterHangupAgent',_0x9468('0x24'),_0x9468('0x25'),_0x9468('0x5'),_0x9468('0x26'),_0x9468('0x27'),_0x9468('0x28'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x9468('0x29'),_0x9468('0x2a'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x9468('0x2b'),_0x9468('0x2c'),_0x9468('0x2d'),_0x9468('0x2e'),_0x9468('0x2f')],'include':[{'model':_0x9468('0x30'),'as':'Trunk','attributes':['id',_0x9468('0x2'),_0x9468('0x31'),_0x9468('0x32')]},{'model':_0x9468('0x33'),'as':_0x9468('0x34'),'attributes':['id',_0x9468('0x2')]},{'model':'Trunk','as':_0x9468('0x35'),'attributes':['id',_0x9468('0x2'),'callerid',_0x9468('0x32')]},{'model':_0x9468('0x36'),'as':_0x9468('0x36'),'attributes':['id',_0x9468('0x2')],'include':[{'model':'Interval','as':_0x9468('0x37'),'attributes':['id',_0x9468('0x2'),_0x9468('0x38')]}]}]},'log':_0x9468('0x39')});};};
\ No newline at end of file
+var _0x041c=['dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','interval','../client','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x041c,0x1c7));var _0xc041=function(_0x36a909,_0x352857){_0x36a909=_0x36a909-0x0;var _0x532ace=_0x041c[_0x36a909];return _0x532ace;};'use strict';var client=require(_0xc041('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xc041('0x1')](_0xc041('0x2'),{'options':{'raw':![],'attributes':['id',_0xc041('0x3'),_0xc041('0x4'),_0xc041('0x5'),'autopause',_0xc041('0x6'),_0xc041('0x7'),'dialActive',_0xc041('0x8'),'dialLimitChannel',_0xc041('0x9'),_0xc041('0xa'),_0xc041('0xb'),_0xc041('0xc'),'dialPredictiveInterval',_0xc041('0xd'),_0xc041('0xe'),'dialOriginateTimeout',_0xc041('0xf'),'dialQueueTimeout',_0xc041('0x10'),'dialCongestionMaxRetry',_0xc041('0x11'),'dialBusyMaxRetry',_0xc041('0x12'),_0xc041('0x13'),'dialNoAnswerRetryFrequency',_0xc041('0x14'),'dialTimezone',_0xc041('0x15'),_0xc041('0x16'),'dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence',_0xc041('0x17'),_0xc041('0x18'),'dialAMDTotalAnalysisTime',_0xc041('0x19'),_0xc041('0x1a'),_0xc041('0x1b'),'dialAMDSilenceThreshold',_0xc041('0x1c'),_0xc041('0x1d'),_0xc041('0x1e'),'dialRecallInQueue',_0xc041('0x1f'),_0xc041('0x20'),_0xc041('0x21'),'dialQueueProject2',_0xc041('0x6'),_0xc041('0x22'),_0xc041('0x23'),_0xc041('0x24'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0xc041('0x25'),_0xc041('0x26'),_0xc041('0x27'),'dialAbandonedRetryFrequency',_0xc041('0x28'),_0xc041('0x29'),_0xc041('0x2a'),_0xc041('0x2b'),_0xc041('0x2c'),'dialPredictiveIntervalMaxThreshold',_0xc041('0x2d')],'include':[{'model':_0xc041('0x2e'),'as':_0xc041('0x2e'),'attributes':['id',_0xc041('0x3'),'callerid',_0xc041('0x2f')]},{'model':_0xc041('0x30'),'as':_0xc041('0x31'),'attributes':['id',_0xc041('0x3')]},{'model':_0xc041('0x2e'),'as':_0xc041('0x32'),'attributes':['id',_0xc041('0x3'),_0xc041('0x33'),_0xc041('0x2f')]},{'model':'Interval','as':_0xc041('0x34'),'attributes':['id','name'],'include':[{'model':_0xc041('0x34'),'as':'Intervals','attributes':['id',_0xc041('0x3'),_0xc041('0x35')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
index 3d3f374..3fb9d34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62ce=['queuecallerabandon','queuecallerabandonAt','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x21ebdd,_0x2388bc){var _0x2508c9=function(_0x280370){while(--_0x280370){_0x21ebdd['push'](_0x21ebdd['shift']());}};_0x2508c9(++_0x2388bc);}(_0x62ce,0x1a6));var _0xe62c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x62ce[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require('moment');var _=require(_0xe62c('0x0'));var client=require(_0xe62c('0x1'));exports['create']=function(_0x53afb0){return client[_0xe62c('0x2')](_0xe62c('0x3'),{'body':_0x53afb0,'log':'CreateVoiceQueueReport'});};exports[_0xe62c('0x4')]=function(){return function(){return client[_0xe62c('0x2')](_0xe62c('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xe62c('0x6')](_0xe62c('0x7'))[_0xe62c('0x8')](_0xe62c('0x9')),moment()[_0xe62c('0xa')]('day')['format'](_0xe62c('0x9'))]}},'attributes':[_0xe62c('0xb'),_0xe62c('0xc'),_0xe62c('0xd'),_0xe62c('0xe'),_0xe62c('0xf'),_0xe62c('0x10'),_0xe62c('0x11'),_0xe62c('0x12'),_0xe62c('0x13'),_0xe62c('0x14')]},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0x7672=['queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','uniqueid'];(function(_0x5d7bc3,_0x1f37b3){var _0x497220=function(_0x2aabe9){while(--_0x2aabe9){_0x5d7bc3['push'](_0x5d7bc3['shift']());}};_0x497220(++_0x1f37b3);}(_0x7672,0xb2));var _0x2767=function(_0x1e8e3f,_0x311a59){_0x1e8e3f=_0x1e8e3f-0x0;var _0x780985=_0x7672[_0x1e8e3f];return _0x780985;};'use strict';var moment=require(_0x2767('0x0'));var _=require(_0x2767('0x1'));var client=require('../client');exports[_0x2767('0x2')]=function(_0x29bd7d){return client[_0x2767('0x3')](_0x2767('0x4'),{'body':_0x29bd7d,'log':_0x2767('0x4')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x2767('0x3')](_0x2767('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x2767('0x6'))['format'](_0x2767('0x7')),moment()[_0x2767('0x8')](_0x2767('0x6'))[_0x2767('0x9')](_0x2767('0x7'))]}},'attributes':[_0x2767('0xa'),_0x2767('0xb'),_0x2767('0xc'),_0x2767('0xd'),_0x2767('0xe'),_0x2767('0xf'),_0x2767('0x10'),_0x2767('0x11'),_0x2767('0x12'),_0x2767('0x13')]},'log':_0x2767('0x14')});};};
\ No newline at end of file
index a9a8503..406aef2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd134=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x409405,_0x4a48a2){var _0x5a862f=function(_0x29c6de){while(--_0x29c6de){_0x409405['push'](_0x409405['shift']());}};_0x5a862f(++_0x4a48a2);}(_0xd134,0x173));var _0x4d13=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd134[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x4d13('0x0'));exports[_0x4d13('0x1')]=function(_0x5591d5){return function(){return client[_0x4d13('0x2')](_0x4d13('0x3'),{'options':{'where':{'VoiceQueueId':_0x5591d5,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
+var _0x5094=['../client','Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x95a12,_0x38bed8){var _0x3805e9=function(_0x1c0874){while(--_0x1c0874){_0x95a12['push'](_0x95a12['shift']());}};_0x3805e9(++_0x38bed8);}(_0x5094,0x18c));var _0x4509=function(_0x820d7b,_0xa5564c){_0x820d7b=_0x820d7b-0x0;var _0x249af0=_0x5094[_0x820d7b];return _0x249af0;};'use strict';var client=require(_0x4509('0x0'));exports['getVoiceQueueRtPauses']=function(_0x1e3d71){return function(){return client[_0x4509('0x1')](_0x4509('0x2'),{'options':{'where':{'VoiceQueueId':_0x1e3d71,'paused':!![]},'raw':!![]},'log':_0x4509('0x3')});};};
\ No newline at end of file
index cf8f8b3..f13ab17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fe4=['../client','create','Request','CreateVoiceRecording','monitorFilename'];(function(_0x29b0ea,_0x1ab7f9){var _0x406917=function(_0x4a99cf){while(--_0x4a99cf){_0x29b0ea['push'](_0x29b0ea['shift']());}};_0x406917(++_0x1ab7f9);}(_0x5fe4,0x109));var _0x45fe=function(_0x4a5c1b,_0x50a666){_0x4a5c1b=_0x4a5c1b-0x0;var _0x139b46=_0x5fe4[_0x4a5c1b];return _0x139b46;};'use strict';var _=require('lodash');var client=require(_0x45fe('0x0'));exports[_0x45fe('0x1')]=function(_0xaaf0e0){return client[_0x45fe('0x2')](_0x45fe('0x3'),{'body':_['merge'](_0xaaf0e0,{'value':_0xaaf0e0[_0x45fe('0x4')]}),'log':_0x45fe('0x3')});};
\ No newline at end of file
+var _0x4162=['create','Request','monitorFilename','lodash'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0x4162,0xdb));var _0x2416=function(_0x4725a8,_0x42c3dc){_0x4725a8=_0x4725a8-0x0;var _0x4eb754=_0x4162[_0x4725a8];return _0x4eb754;};'use strict';var _=require(_0x2416('0x0'));var client=require('../client');exports[_0x2416('0x1')]=function(_0x4c50d8){return client[_0x2416('0x2')]('CreateVoiceRecording',{'body':_['merge'](_0x4c50d8,{'value':_0x4c50d8[_0x2416('0x3')]}),'log':'CreateVoiceRecording'});};
\ No newline at end of file
index 8f12bd8..d8c4af4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87ee=['transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid'];(function(_0x16dced,_0x2f8d60){var _0x40e9d7=function(_0x1fc94a){while(--_0x1fc94a){_0x16dced['push'](_0x16dced['shift']());}};_0x40e9d7(++_0x2f8d60);}(_0x87ee,0x16d));var _0xe87e=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x87ee[_0x2e4aa2];return _0x5e6092;};'use strict';var client=require(_0xe87e('0x0'));exports[_0xe87e('0x1')]=function(_0x4f6b90){return client[_0xe87e('0x2')](_0xe87e('0x3'),{'body':{'result':_0x4f6b90[_0xe87e('0x4')],'transfererchannel':_0x4f6b90[_0xe87e('0x5')],'transferercalleridnum':_0x4f6b90[_0xe87e('0x6')],'transferercalleridname':_0x4f6b90['transferercalleridname'],'transfererconnectedlinenum':_0x4f6b90[_0xe87e('0x7')],'transfererconnectedlinename':_0x4f6b90[_0xe87e('0x8')],'transfereraccountcode':_0x4f6b90[_0xe87e('0x9')],'transferercontext':_0x4f6b90[_0xe87e('0xa')],'transfererexten':_0x4f6b90[_0xe87e('0xb')],'transfererlinkedid':_0x4f6b90[_0xe87e('0xc')],'transfereechannel':_0x4f6b90[_0xe87e('0xd')],'transfereecalleridnum':_0x4f6b90[_0xe87e('0xe')],'transfereecalleridname':_0x4f6b90[_0xe87e('0xf')],'transfereeconnectedlinenum':_0x4f6b90[_0xe87e('0x10')],'transfereeconnectedlinename':_0x4f6b90[_0xe87e('0x11')],'transfereeaccountcode':_0x4f6b90[_0xe87e('0x12')],'transfereecontext':_0x4f6b90[_0xe87e('0x13')],'transfereeexten':_0x4f6b90[_0xe87e('0x14')],'transfereelinkedid':_0x4f6b90[_0xe87e('0x15')],'isexternal':_0x4f6b90[_0xe87e('0x16')],'context':_0x4f6b90[_0xe87e('0x17')],'extension':_0x4f6b90[_0xe87e('0x18')],'type':'blind'},'log':_0xe87e('0x3')});};exports['attendedTransfer']=function(_0xd1d06){return client[_0xe87e('0x2')](_0xe87e('0x3'),{'body':{'result':_0xd1d06[_0xe87e('0x4')],'transfererchannel':_0xd1d06[_0xe87e('0x19')],'transferercalleridnum':_0xd1d06[_0xe87e('0x1a')],'transferercalleridname':_0xd1d06[_0xe87e('0x1b')],'transfererconnectedlinenum':_0xd1d06['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xd1d06[_0xe87e('0x1c')],'transfereraccountcode':_0xd1d06[_0xe87e('0x1d')],'transferercontext':_0xd1d06[_0xe87e('0x1e')],'transfererexten':_0xd1d06[_0xe87e('0x1f')],'transfererlinkedid':_0xd1d06[_0xe87e('0x20')],'transfereechannel':_0xd1d06[_0xe87e('0x21')],'transfereecalleridnum':_0xd1d06[_0xe87e('0x22')],'transfereecalleridname':_0xd1d06[_0xe87e('0x23')],'transfereeconnectedlinenum':_0xd1d06[_0xe87e('0x24')],'transfereeconnectedlinename':_0xd1d06[_0xe87e('0x25')],'transfereeaccountcode':_0xd1d06[_0xe87e('0x26')],'transfereecontext':_0xd1d06['transfertargetcontext'],'transfereeexten':_0xd1d06[_0xe87e('0x27')],'transfereelinkedid':_0xd1d06[_0xe87e('0x28')],'isexternal':_0xd1d06[_0xe87e('0x16')],'context':_0xd1d06['origtransferercontext'],'extension':_0xd1d06['origtransfererexten'],'type':_0xe87e('0x29')},'log':_0xe87e('0x3')});};
\ No newline at end of file
+var _0xe90b=['CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','Request'];(function(_0xd67ffb,_0x2f7ebc){var _0x51d5fb=function(_0x1e2dfd){while(--_0x1e2dfd){_0xd67ffb['push'](_0xd67ffb['shift']());}};_0x51d5fb(++_0x2f7ebc);}(_0xe90b,0xf5));var _0xbe90=function(_0x372ce7,_0x556ad1){_0x372ce7=_0x372ce7-0x0;var _0xf3232a=_0xe90b[_0x372ce7];return _0xf3232a;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0x3a1fe3){return client[_0xbe90('0x0')](_0xbe90('0x1'),{'body':{'result':_0x3a1fe3['result'],'transfererchannel':_0x3a1fe3[_0xbe90('0x2')],'transferercalleridnum':_0x3a1fe3[_0xbe90('0x3')],'transferercalleridname':_0x3a1fe3['transferercalleridname'],'transfererconnectedlinenum':_0x3a1fe3[_0xbe90('0x4')],'transfererconnectedlinename':_0x3a1fe3[_0xbe90('0x5')],'transfereraccountcode':_0x3a1fe3[_0xbe90('0x6')],'transferercontext':_0x3a1fe3['transferercontext'],'transfererexten':_0x3a1fe3[_0xbe90('0x7')],'transfererlinkedid':_0x3a1fe3[_0xbe90('0x8')],'transfereechannel':_0x3a1fe3['transfereechannel'],'transfereecalleridnum':_0x3a1fe3[_0xbe90('0x9')],'transfereecalleridname':_0x3a1fe3[_0xbe90('0xa')],'transfereeconnectedlinenum':_0x3a1fe3[_0xbe90('0xb')],'transfereeconnectedlinename':_0x3a1fe3[_0xbe90('0xc')],'transfereeaccountcode':_0x3a1fe3['transfereeaccountcode'],'transfereecontext':_0x3a1fe3[_0xbe90('0xd')],'transfereeexten':_0x3a1fe3[_0xbe90('0xe')],'transfereelinkedid':_0x3a1fe3[_0xbe90('0xf')],'isexternal':_0x3a1fe3[_0xbe90('0x10')],'context':_0x3a1fe3[_0xbe90('0x11')],'extension':_0x3a1fe3[_0xbe90('0x12')],'type':_0xbe90('0x13')},'log':_0xbe90('0x1')});};exports[_0xbe90('0x14')]=function(_0x42f408){return client[_0xbe90('0x0')](_0xbe90('0x1'),{'body':{'result':_0x42f408[_0xbe90('0x15')],'transfererchannel':_0x42f408[_0xbe90('0x16')],'transferercalleridnum':_0x42f408[_0xbe90('0x17')],'transferercalleridname':_0x42f408['origtransferercalleridname'],'transfererconnectedlinenum':_0x42f408[_0xbe90('0x18')],'transfererconnectedlinename':_0x42f408[_0xbe90('0x19')],'transfereraccountcode':_0x42f408[_0xbe90('0x1a')],'transferercontext':_0x42f408[_0xbe90('0x1b')],'transfererexten':_0x42f408[_0xbe90('0x1c')],'transfererlinkedid':_0x42f408['origtransfererlinkedid'],'transfereechannel':_0x42f408[_0xbe90('0x1d')],'transfereecalleridnum':_0x42f408[_0xbe90('0x1e')],'transfereecalleridname':_0x42f408[_0xbe90('0x1f')],'transfereeconnectedlinenum':_0x42f408[_0xbe90('0x20')],'transfereeconnectedlinename':_0x42f408[_0xbe90('0x21')],'transfereeaccountcode':_0x42f408[_0xbe90('0x22')],'transfereecontext':_0x42f408[_0xbe90('0x23')],'transfereeexten':_0x42f408[_0xbe90('0x24')],'transfereelinkedid':_0x42f408[_0xbe90('0x25')],'isexternal':_0x42f408[_0xbe90('0x10')],'context':_0x42f408[_0xbe90('0x26')],'extension':_0x42f408[_0xbe90('0x27')],'type':_0xbe90('0x28')},'log':_0xbe90('0x1')});};
\ No newline at end of file
index c2b88be..82ad3d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed24=['jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','error','command','Command','content','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumDuration','talking','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','Interval','push','channels','voicechannel','find','uniqueid','channel','filename','wav','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','length','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','map','Hangup','voicequeuechannelredirect','Redirect','exten','context','values','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util'];(function(_0x276c5f,_0x2dc898){var _0x13a828=function(_0x487c4d){while(--_0x487c4d){_0x276c5f['push'](_0x276c5f['shift']());}};_0x13a828(++_0x2dc898);}(_0xed24,0x19f));var _0x4ed2=function(_0x381a2e,_0xb6eb12){_0x381a2e=_0x381a2e-0x0;var _0x1f8d49=_0xed24[_0x381a2e];return _0x1f8d49;};'use strict';var _=require(_0x4ed2('0x0'));var util=require(_0x4ed2('0x1'));var jayson=require(_0x4ed2('0x2'));var schema=require(_0x4ed2('0x3'));var BPromise=require(_0x4ed2('0x4'));var moment=require(_0x4ed2('0x5'));var config=require(_0x4ed2('0x6'));var properties=require(_0x4ed2('0x7'));var ami=require('../ami');exports[_0x4ed2('0x8')]=function(_0x13ae3e,_0x471fca,_0x168e02){return new BPromise(function(_0x18a33e,_0x50639b){var _0x541f89={'QueuePause':function(_0x5a759f){return new Promise(function(_0x315674,_0x5a80d7){var _0x2ecbb0=util[_0x4ed2('0x9')](_0x4ed2('0xa'),_0x4ed2('0xb'),_0x5a759f[_0x4ed2('0xc')]);if(_0x13ae3e[_0x4ed2('0xd')]&&_0x13ae3e[_0x4ed2('0xd')][_0x2ecbb0]&&_0x13ae3e[_0x4ed2('0xd')][_0x2ecbb0][_0x4ed2('0xe')]){_0x13ae3e[_0x4ed2('0xd')][_0x2ecbb0][_0x4ed2('0xf')]();}if(_0x13ae3e[_0x4ed2('0x10')][_0x2ecbb0]){_0x13ae3e[_0x4ed2('0x10')][_0x2ecbb0]['updateStatusRealtime']({'statePause':_0x5a759f[_0x4ed2('0x11')]?!![]:![]});}_0x315674({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x22bf21){var _0xa9c939=this;return new Promise(function(_0x48fafd,_0x38c048){if(ami[_0x4ed2('0x12')]()==![]){return _0x38c048(_0xa9c939['error'](0x1f4,[config['asterisk']['ip'],config[_0x4ed2('0x13')][_0x4ed2('0x14')],_0x4ed2('0x15')][_0x4ed2('0x16')]('\x20')));}_0x22bf21=_[_0x4ed2('0x17')](_0x22bf21,_[_0x4ed2('0x18')](properties[_0x4ed2('0x19')]));_0x22bf21[_0x4ed2('0x1a')]=_0x4ed2('0x1b');return ami[_0x4ed2('0x1c')](_0x22bf21)[_0x4ed2('0x1d')](function(_0x3e6598){_0x48fafd({'code':0xc8,'message':_0x3e6598[_0x4ed2('0x1e')]});})['catch'](function(_0x5549f1){_0x38c048(_0xa9c939[_0x4ed2('0x1f')](0x1f5,_0x5549f1[_0x4ed2('0x1e')]));});});},'Command':function(_0x17751d){var _0x20c03f=this;return new Promise(function(_0x563f19,_0x3bc48d){if(ami['isConnected']()==![]){return _0x3bc48d(_0x20c03f['error'](0x1f4,[config[_0x4ed2('0x13')]['ip'],config[_0x4ed2('0x13')][_0x4ed2('0x14')],_0x4ed2('0x15')][_0x4ed2('0x16')]('\x20')));}_0x17751d=_[_0x4ed2('0x17')](_0x17751d,_0x4ed2('0x20'));_0x17751d['action']=_0x4ed2('0x21');return ami[_0x4ed2('0x1c')](_0x17751d)['then'](function(_0x2a082b){_0x563f19({'code':0xc8,'message':_0x2a082b[_0x4ed2('0x22')]});})[_0x4ed2('0x23')](function(_0x2a902c){_0x3bc48d(_0x20c03f[_0x4ed2('0x1f')](0x1f5,_0x2a902c['message']));});});},'VoiceQueues':function(_0x2a73b3){return new Promise(function(_0x28b019,_0x303ba4){var _0x233360=[];for(var _0x42c356 in _0x13ae3e[_0x4ed2('0x24')]){if(_0x13ae3e['voiceQueues'][_0x4ed2('0x25')](_0x42c356)){var _0x443351=_0x13ae3e['voiceQueues'][_0x42c356];var _0x3ad1a4={'id':_0x443351['id'],'name':_0x443351[_0x4ed2('0xc')],'strategy':_0x443351[_0x4ed2('0x26')],'answered':_0x443351[_0x4ed2('0x27')],'available':_0x443351[_0x4ed2('0x28')],'loggedIn':_0x443351[_0x4ed2('0x29')],'pTalking':_0x443351['pTalking'],'sumBillable':_0x443351['sumBillable'],'sumDuration':_0x443351[_0x4ed2('0x2a')],'sumHoldTime':_0x443351['sumHoldTime']||0x0,'talking':_0x443351[_0x4ed2('0x2b')],'total':_0x443351['total'],'type':_0x443351[_0x4ed2('0x2c')],'unmanaged':_0x443351[_0x4ed2('0x2d')],'abandoned':_0x443351['abandoned'],'waiting':_0x443351[_0x4ed2('0x2e')],'loggedInDb':_0x443351[_0x4ed2('0x2f')]};if(_0x443351[_0x4ed2('0x2c')]===_0x4ed2('0x30')){_0x3ad1a4[_0x4ed2('0x31')]=_0x443351['dialActive'];_0x3ad1a4[_0x4ed2('0x32')]=_0x443351[_0x4ed2('0x32')];_0x3ad1a4['dialOriginateCallerIdName']=_0x443351[_0x4ed2('0x33')];_0x3ad1a4[_0x4ed2('0x34')]=_0x443351[_0x4ed2('0x34')];_0x3ad1a4[_0x4ed2('0x35')]=_0x443351[_0x4ed2('0x35')];_0x3ad1a4[_0x4ed2('0x36')]=_0x443351['dialPrefix'];_0x3ad1a4['outboundAnswerAgiCallsDay']=_0x443351[_0x4ed2('0x37')];_0x3ad1a4['outboundAnswerCallsDay']=_0x443351[_0x4ed2('0x38')];_0x3ad1a4[_0x4ed2('0x39')]=_0x443351[_0x4ed2('0x39')];_0x3ad1a4[_0x4ed2('0x3a')]=_0x443351[_0x4ed2('0x3a')];_0x3ad1a4['outboundCongestionCallsDay']=_0x443351['outboundCongestionCallsDay'];_0x3ad1a4[_0x4ed2('0x3b')]=_0x443351[_0x4ed2('0x3b')];_0x3ad1a4['outboundDropCallsDayCallersExit']=_0x443351[_0x4ed2('0x3c')];_0x3ad1a4[_0x4ed2('0x3d')]=_0x443351[_0x4ed2('0x3d')];_0x3ad1a4[_0x4ed2('0x3e')]=_0x443351[_0x4ed2('0x3e')];_0x3ad1a4[_0x4ed2('0x3f')]=_0x443351['outboundNoSuchCallsDay'];_0x3ad1a4['outboundOriginateFailureCallsDay']=_0x443351[_0x4ed2('0x40')];_0x3ad1a4['outboundReCallsDay']=_0x443351[_0x4ed2('0x41')];_0x3ad1a4[_0x4ed2('0x42')]=_0x443351[_0x4ed2('0x42')];_0x3ad1a4[_0x4ed2('0x43')]=_0x443351[_0x4ed2('0x43')];_0x3ad1a4['predictiveIntervalAnsweredCalls']=_0x443351[_0x4ed2('0x44')];_0x3ad1a4[_0x4ed2('0x45')]=_0x443351[_0x4ed2('0x45')];_0x3ad1a4['predictiveIntervalAvgTalktime']=_0x443351['predictiveIntervalAvgTalktime'];_0x3ad1a4[_0x4ed2('0x46')]=_0x443351[_0x4ed2('0x46')];_0x3ad1a4[_0x4ed2('0x47')]=_0x443351['predictiveIntervalDroppedCallsTimeout'];_0x3ad1a4['predictiveIntervalErlangCalls']=_0x443351[_0x4ed2('0x48')];_0x3ad1a4[_0x4ed2('0x49')]=_0x443351[_0x4ed2('0x49')];_0x3ad1a4[_0x4ed2('0x4a')]=_0x443351[_0x4ed2('0x4a')];_0x3ad1a4[_0x4ed2('0x4b')]=_0x443351[_0x4ed2('0x4b')];_0x3ad1a4['predictiveIntervalPauses']=_0x443351[_0x4ed2('0x4c')];_0x3ad1a4[_0x4ed2('0x4d')]=_0x443351[_0x4ed2('0x4d')];_0x3ad1a4[_0x4ed2('0x4e')]=_0x443351[_0x4ed2('0x4e')];_0x3ad1a4[_0x4ed2('0x1e')]=_0x443351[_0x4ed2('0x1e')];_0x3ad1a4[_0x4ed2('0x4f')]=_0x443351[_0x4ed2('0x4f')];_0x3ad1a4['erlangCalls']=_0x443351[_0x4ed2('0x50')];_0x3ad1a4[_0x4ed2('0x51')]=_0x443351[_0x4ed2('0x51')];_0x3ad1a4[_0x4ed2('0x52')]=_0x443351[_0x4ed2('0x52')];_0x3ad1a4[_0x4ed2('0x53')]=_0x443351['erlangBusyFactor'];_0x3ad1a4['startPredictive']=_0x443351['startPredictive'];_0x3ad1a4[_0x4ed2('0x54')]=_0x443351[_0x4ed2('0x54')];}if(_0x443351[_0x4ed2('0x55')]){_0x3ad1a4['Trunk']={'id':_0x443351[_0x4ed2('0x55')]['id'],'name':_0x443351['Trunk'][_0x4ed2('0xc')],'active':_0x443351['Trunk']['active'],'callerid':_0x443351[_0x4ed2('0x55')]['callerid']};}if(_0x443351['Interval']){_0x3ad1a4[_0x4ed2('0x56')]={'id':_0x443351[_0x4ed2('0x56')]['id'],'name':_0x443351[_0x4ed2('0x56')]['name']};}_0x233360[_0x4ed2('0x57')](_0x3ad1a4);}}_0x28b019({'count':_0x233360['length'],'rows':_0x233360});});},'VoiceChannels':function(_0x1d2483){return new Promise(function(_0x2bd21f,_0x5c400f){var _0x835fc1=_['values'](_0x13ae3e[_0x4ed2('0x58')]);_0x2bd21f({'count':_0x835fc1['length'],'rows':_0x835fc1});});},'VoiceChannelMixMonitor':function(_0x40c939){var _0x487653=this;return new Promise(function(_0x2e95f4,_0x44c1e5){if(ami['isConnected']()==![]){return _0x44c1e5(_0x487653['error'](0x1f4,[config[_0x4ed2('0x13')]['ip'],config[_0x4ed2('0x13')]['username'],_0x4ed2('0x15')]['join']('\x20')));}var _0x537e13=schema(properties[_0x4ed2('0x59')])[_0x4ed2('0x3')](_0x40c939);if(_0x537e13['length']>0x0){return _0x44c1e5(_0x487653[_0x4ed2('0x1f')](0x1f4,_['map'](_0x537e13,_0x4ed2('0x1e'))[_0x4ed2('0x16')](',\x20')));}var _0x22d33b=_[_0x4ed2('0x5a')](_0x13ae3e[_0x4ed2('0x58')],{'uniqueid':_0x40c939[_0x4ed2('0x5b')]});if(_0x22d33b&&_0x22d33b[_0x4ed2('0x5c')]){var _0x39e2c6=util['format']('%s.%s',_0x40c939[_0x4ed2('0x5d')]||_0x40c939['uniqueid'],_0x40c939['format']||_0x4ed2('0x5e'));return ami[_0x4ed2('0x1c')]({'action':'MixMonitor','channel':_0x22d33b[_0x4ed2('0x5c')],'file':_0x39e2c6,'options':'ai(mixmonitorid)'})[_0x4ed2('0x1d')](function(_0x14e7c3){var _0x13456b=_[_0x4ed2('0x5a')](_0x22d33b[_0x4ed2('0x5f')],{'filename':_0x4ed2('0x60')+_0x39e2c6[_0x4ed2('0x61')]()});if(_[_0x4ed2('0x62')](_0x13456b)){_0x22d33b[_0x4ed2('0x5f')][_0x4ed2('0x57')]({'filename':'/var/spool/asterisk/monitor/'+_0x39e2c6[_0x4ed2('0x61')](),'createdAt':moment()[_0x4ed2('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x14e7c3['mixmonitorid'],'status':_0x4ed2('0x63')});}else{_0x13456b['mixmonitorid']=_0x14e7c3[_0x4ed2('0x64')];_0x13456b[_0x4ed2('0x65')]=_0x4ed2('0x63');}_0x2e95f4({'code':0xc8,'message':[_0x40c939[_0x4ed2('0x5b')],_0x4ed2('0x66'),_0x14e7c3[_0x4ed2('0x64')]][_0x4ed2('0x16')]('\x20'),'mixmonitorid':_0x14e7c3[_0x4ed2('0x64')]});})[_0x4ed2('0x23')](function(_0x20edae){_0x44c1e5(_0x487653[_0x4ed2('0x1f')](0x1f5,[_0x40c939[_0x4ed2('0x5b')],_0x20edae['message'][_0x4ed2('0x61')]()]['join']('\x20')));});}else{return _0x44c1e5(_0x487653[_0x4ed2('0x1f')](0x1f5,_0x4ed2('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x54890e){var _0x15d794=this;return new Promise(function(_0x2eb7e5,_0x4a6df8){if(ami['isConnected']()==![]){return _0x4a6df8(_0x15d794[_0x4ed2('0x1f')](0x1f4,[config[_0x4ed2('0x13')]['ip'],config[_0x4ed2('0x13')][_0x4ed2('0x14')],_0x4ed2('0x15')][_0x4ed2('0x16')]('\x20')));}var _0x1f97eb=schema(properties[_0x4ed2('0x59')])['validate'](_0x54890e);if(_0x1f97eb[_0x4ed2('0x68')]>0x0){return _0x4a6df8(_0x15d794['error'](0x1f4,_['map'](_0x1f97eb,_0x4ed2('0x1e'))[_0x4ed2('0x16')](',\x20')));}var _0x2771b8=_['find'](_0x13ae3e[_0x4ed2('0x58')],{'uniqueid':_0x54890e['uniqueid']});if(_0x2771b8){return BPromise[_0x4ed2('0x69')]()[_0x4ed2('0x1d')](function(){if(_0x2771b8[_0x4ed2('0x5c')]){return ami[_0x4ed2('0x1c')]({'action':_0x4ed2('0x6a'),'channel':_0x2771b8[_0x4ed2('0x5c')],'mixmonitorid':_0x54890e[_0x4ed2('0x64')]})[_0x4ed2('0x23')](function(_0xc99d80){});}})[_0x4ed2('0x1d')](function(){if(_0x2771b8[_0x4ed2('0x6b')]){return ami[_0x4ed2('0x1c')]({'action':_0x4ed2('0x6a'),'channel':_0x2771b8[_0x4ed2('0x6b')],'mixmonitorid':_0x54890e[_0x4ed2('0x64')]})[_0x4ed2('0x23')](function(_0x3a1a9c){});}})['then'](function(_0x15af46){var _0x122d58=_[_0x4ed2('0x5a')](_0x2771b8[_0x4ed2('0x5f')],{'mixmonitorid':_0x54890e[_0x4ed2('0x64')]});if(_0x122d58){_0x122d58[_0x4ed2('0x65')]=_0x4ed2('0x6c');}})[_0x4ed2('0x1d')](function(){var _0x184f89=util[_0x4ed2('0x9')](_0x4ed2('0x6d'),_0x54890e['filename']||_0x54890e[_0x4ed2('0x5b')],_0x54890e[_0x4ed2('0x9')]||'wav');var _0xba48eb=_[_0x4ed2('0x5a')](_0x2771b8[_0x4ed2('0x5f')],{'filename':_0x4ed2('0x60')+_0x184f89[_0x4ed2('0x61')]()});if(_0xba48eb){_0xba48eb[_0x4ed2('0x65')]=_0x4ed2('0x6c');}})[_0x4ed2('0x1d')](function(){_0x2eb7e5({'code':0xc8,'message':[_0x54890e['uniqueid'],_0x4ed2('0x6e')][_0x4ed2('0x16')]('\x20')});})[_0x4ed2('0x23')](function(_0x1e6a23){_0x4a6df8(_0x15d794[_0x4ed2('0x1f')](0x1f5,[_0x54890e[_0x4ed2('0x5b')],_0x1e6a23[_0x4ed2('0x1e')]['toLowerCase']()][_0x4ed2('0x16')]('\x20')));});}else{return _0x4a6df8(_0x15d794[_0x4ed2('0x1f')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x50abd8){return new Promise(function(_0x21cfb1,_0x56f018){var _0x578bea=_['values'](_0x13ae3e['queueChannels']);_0x21cfb1({'count':_0x578bea[_0x4ed2('0x68')],'rows':_0x578bea});});},'VoiceQueuesChannel':function(_0x2b4fdf){var _0x254557=this;return new Promise(function(_0x3e7ada,_0x27097e){var _0x55dc1a=schema(properties[_0x4ed2('0x6f')])[_0x4ed2('0x3')](_0x2b4fdf);if(_0x55dc1a[_0x4ed2('0x68')]>0x0){return _0x27097e(_0x254557[_0x4ed2('0x1f')](0x1f4,_['map'](_0x55dc1a,'message')[_0x4ed2('0x16')](',\x20')));}var _0x3bd7d0=_[_0x4ed2('0x5a')](_0x13ae3e[_0x4ed2('0x70')],{'uniqueid':_0x2b4fdf[_0x4ed2('0x5b')]});if(_0x3bd7d0){_0x3e7ada(_0x3bd7d0);}else{return _0x27097e(_0x254557[_0x4ed2('0x1f')](0x1f5,_0x4ed2('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x11edc1){var _0x2bb5f2=this;return new Promise(function(_0x1c5279,_0x4b37a0){if(ami['isConnected']()==![]){return _0x4b37a0(_0x2bb5f2[_0x4ed2('0x1f')](0x1f4,[config[_0x4ed2('0x13')]['ip'],config[_0x4ed2('0x13')]['username'],_0x4ed2('0x15')]['join']('\x20')));}var _0x5bc0d7=schema(properties[_0x4ed2('0x71')])[_0x4ed2('0x3')](_0x11edc1);if(_0x5bc0d7[_0x4ed2('0x68')]>0x0){return _0x4b37a0(_0x2bb5f2[_0x4ed2('0x1f')](0x1f4,_[_0x4ed2('0x72')](_0x5bc0d7,_0x4ed2('0x1e'))[_0x4ed2('0x16')](',\x20')));}var _0x22459c=_[_0x4ed2('0x5a')](_0x13ae3e[_0x4ed2('0x70')],{'uniqueid':_0x11edc1[_0x4ed2('0x5b')]});if(_0x22459c&&_0x22459c[_0x4ed2('0x5c')]){return ami[_0x4ed2('0x1c')]({'action':_0x4ed2('0x73'),'channel':_0x22459c[_0x4ed2('0x5c')]})[_0x4ed2('0x1d')](function(_0x441caa){_0x1c5279({'code':0xc8,'message':[_0x11edc1[_0x4ed2('0x5b')],_0x441caa[_0x4ed2('0x1e')][_0x4ed2('0x61')]()][_0x4ed2('0x16')]('\x20')});})['catch'](function(_0x31b557){_0x4b37a0(_0x2bb5f2['error'](0x1f5,[_0x11edc1['uniqueid'],_0x31b557[_0x4ed2('0x1e')]['toLowerCase']()]['join']('\x20')));});}else{return _0x4b37a0(_0x2bb5f2[_0x4ed2('0x1f')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5710fd){var _0x148a21=this;return new Promise(function(_0xd1775f,_0x4ce79f){if(ami[_0x4ed2('0x12')]()==![]){return _0x4ce79f(_0x148a21['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x4ed2('0x14')],_0x4ed2('0x15')][_0x4ed2('0x16')]('\x20')));}var _0x5dbaad=schema(properties[_0x4ed2('0x74')])[_0x4ed2('0x3')](_0x5710fd);if(_0x5dbaad[_0x4ed2('0x68')]>0x0){return _0x4ce79f(_0x148a21[_0x4ed2('0x1f')](0x1f4,_[_0x4ed2('0x72')](_0x5dbaad,_0x4ed2('0x1e'))['join'](',\x20')));}var _0x35aa61=_[_0x4ed2('0x5a')](_0x13ae3e['queueChannels'],{'uniqueid':_0x5710fd[_0x4ed2('0x5b')]});if(_0x35aa61&&_0x35aa61[_0x4ed2('0x5c')]){return ami[_0x4ed2('0x1c')]({'action':_0x4ed2('0x75'),'channel':_0x35aa61[_0x4ed2('0x5c')],'exten':_0x5710fd[_0x4ed2('0x76')],'context':_0x5710fd[_0x4ed2('0x77')]||_0x35aa61[_0x4ed2('0x77')],'priority':0x1})[_0x4ed2('0x1d')](function(_0x4c00ab){_0xd1775f({'code':0xc8,'message':[_0x5710fd[_0x4ed2('0x5b')],_0x4c00ab[_0x4ed2('0x1e')][_0x4ed2('0x61')]()][_0x4ed2('0x16')]('\x20')});})[_0x4ed2('0x23')](function(_0x37fb9d){_0x4ce79f(_0x148a21[_0x4ed2('0x1f')](0x1f5,[_0x5710fd[_0x4ed2('0x5b')],_0x37fb9d[_0x4ed2('0x1e')][_0x4ed2('0x61')]()][_0x4ed2('0x16')]('\x20')));});}else{return _0x4ce79f(_0x148a21[_0x4ed2('0x1f')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x363290){return new Promise(function(_0x56c3db,_0x49e067){var _0x257843=_[_0x4ed2('0x78')](_0x13ae3e[_0x4ed2('0x10')]);_0x56c3db({'count':_0x257843['length'],'rows':_0x257843});});},'Telephones':function(_0xc2c1e5){return new Promise(function(_0x9a0a05,_0x2004f6){var _0x5a60c4=_[_0x4ed2('0x78')](_0x13ae3e[_0x4ed2('0x79')]);_0x9a0a05({'count':_0x5a60c4[_0x4ed2('0x68')],'rows':_0x5a60c4});});},'Trunks':function(_0x44da07){return new Promise(function(_0x11da91,_0x2bf74f){var _0x3a2a0e=_[_0x4ed2('0x78')](_0x13ae3e[_0x4ed2('0x7a')]);_0x11da91({'count':_0x3a2a0e[_0x4ed2('0x68')],'rows':_0x3a2a0e});});},'OutboundChannels':function(_0x2c8563){return new Promise(function(_0x2d572a,_0x19e04a){var _0x205093=_['values'](_0x13ae3e[_0x4ed2('0x7b')]);_0x2d572a({'count':_0x205093['length'],'rows':_0x205093});});},'Outbound':function(_0x1a745e){return new Promise(function(_0x4ec6cf,_0x1da693){_0x4ec6cf(_0x13ae3e[_0x4ed2('0x30')]);});},'Campaigns':function(_0x5a981e){return new Promise(function(_0x51aa0e,_0x57eb8a){var _0x23af7c=_[_0x4ed2('0x78')](_0x13ae3e[_0x4ed2('0x7c')]);_0x51aa0e({'count':_0x23af7c[_0x4ed2('0x68')],'rows':_0x23af7c});});},'VoiceQueuesPreview':function(_0x13a6ea){var _0xef50c=this;return new Promise(function(_0x56f1ec,_0x2633b1){_0x471fca[_0x4ed2('0x7d')](_0x13a6ea['id'])['then'](function(_0xe113a3){_0x56f1ec({'code':0xc8,'message':_0xe113a3[_0x4ed2('0x1e')]});})['catch'](function(_0x109bf1){_0x2633b1(_0xef50c[_0x4ed2('0x1f')](0x1f4,_0x109bf1['message']));});});},'EventManager':function(_0x4f2f3f){var _0x1d3c66=this;return new Promise(function(_0x3fca5a,_0x674291){if(!_0x4f2f3f[_0x4ed2('0x7e')]){return _0x674291(_0x1d3c66[_0x4ed2('0x1f')](0x1f4,_0x4ed2('0x7f')));}ami[_0x4ed2('0x80')](_0x4ed2('0x81')+_0x4f2f3f[_0x4ed2('0x7e')],_0x4f2f3f[_0x4ed2('0x1e')]);_0x3fca5a({'code':0xc8,'message':_0x4f2f3f});});},'FaxAccounts':function(_0x32dc58){return new Promise(function(_0x2e6d7a,_0x586bf2){var _0x5c0b85=_[_0x4ed2('0x78')](_0x13ae3e[_0x4ed2('0x82')]);_0x2e6d7a({'count':_0x5c0b85[_0x4ed2('0x68')],'rows':_0x5c0b85});});},'SendFax':function(_0x2900c2){var _0x279a3f=this;return new Promise(function(_0x201f6a,_0x6f5964){_0x168e02[_0x4ed2('0x83')](_0x2900c2)[_0x4ed2('0x1d')](function(_0x784a8){_0x201f6a({'code':0xc8,'message':_0x784a8[_0x4ed2('0x1e')]});})[_0x4ed2('0x23')](function(_0x1091c5){_0x6f5964(_0x279a3f[_0x4ed2('0x1f')](0x1f4,_0x1091c5[_0x4ed2('0x1e')]));});});},'CheckAfterSend':function(_0x255abe){var _0x3413c7=this;return new Promise(function(_0x77c024,_0x361229){_0x168e02[_0x4ed2('0x84')](_0x255abe)[_0x4ed2('0x1d')](function(_0x126530){_0x77c024({'code':0xc8,'message':_0x126530[_0x4ed2('0x1e')]});})[_0x4ed2('0x23')](function(_0x37aff3){_0x361229(_0x3413c7[_0x4ed2('0x1f')](0x1f4,_0x37aff3[_0x4ed2('0x1e')]));});});}};var _0x4ef3a2=jayson[_0x4ed2('0x85')](_0x541f89)[_0x4ed2('0x86')]();_0x4ef3a2['on'](_0x4ed2('0x1f'),function(_0x49f910){return _0x50639b(_0x49f910);});_0x4ef3a2[_0x4ed2('0x8')](0x232a,_0x4ed2('0x87'),function(){console[_0x4ed2('0x88')](_0x4ed2('0x89'),0x232a);return _0x18a33e(_0x4ed2('0x8a')+0x232a);});});};
\ No newline at end of file
+var _0xf41e=['Action','message','catch','isConnected','username','command','content','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','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','startProgressive','Trunk','active','callerid','Interval','push','channels','length','ami\x20disconnected','voicechannel','validate','map','find','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','then','isNil','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','status','stop','wav','toLowerCase','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','error','asterisk','join','pick','keys','module','action','Reload'];(function(_0x1ec653,_0x98f8ba){var _0x205bed=function(_0x36922b){while(--_0x36922b){_0x1ec653['push'](_0x1ec653['shift']());}};_0x205bed(++_0x98f8ba);}(_0xf41e,0x195));var _0xef41=function(_0x485329,_0x4b3930){_0x485329=_0x485329-0x0;var _0x4df2ab=_0xf41e[_0x485329];return _0x4df2ab;};'use strict';var _=require(_0xef41('0x0'));var util=require(_0xef41('0x1'));var jayson=require(_0xef41('0x2'));var schema=require('validate');var BPromise=require(_0xef41('0x3'));var moment=require(_0xef41('0x4'));var config=require(_0xef41('0x5'));var properties=require(_0xef41('0x6'));var ami=require(_0xef41('0x7'));exports[_0xef41('0x8')]=function(_0x5bf199,_0x38ab1e,_0x3d11fd){return new BPromise(function(_0x4edfbd,_0x5d0562){var _0x2d334f={'QueuePause':function(_0x1d6f30){return new Promise(function(_0x4e1d4d,_0x30ab97){var _0x172760=util[_0xef41('0x9')](_0xef41('0xa'),_0xef41('0xb'),_0x1d6f30[_0xef41('0xc')]);if(_0x5bf199['timers']&&_0x5bf199[_0xef41('0xd')][_0x172760]&&_0x5bf199[_0xef41('0xd')][_0x172760][_0xef41('0xe')]){_0x5bf199[_0xef41('0xd')][_0x172760][_0xef41('0xf')]();}if(_0x5bf199[_0xef41('0x10')][_0x172760]){_0x5bf199[_0xef41('0x10')][_0x172760]['updateStatusRealtime']({'statePause':_0x1d6f30[_0xef41('0x11')]?!![]:![]});}_0x4e1d4d({'code':0xc8,'message':_0xef41('0x12')});});},'Reload':function(_0x4c79f7){var _0x1d25d4=this;return new Promise(function(_0x206af4,_0xd3c954){if(ami['isConnected']()==![]){return _0xd3c954(_0x1d25d4[_0xef41('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xef41('0x14')]['username'],'ami\x20disconnected'][_0xef41('0x15')]('\x20')));}_0x4c79f7=_[_0xef41('0x16')](_0x4c79f7,_[_0xef41('0x17')](properties[_0xef41('0x18')]));_0x4c79f7[_0xef41('0x19')]=_0xef41('0x1a');return ami[_0xef41('0x1b')](_0x4c79f7)['then'](function(_0x8cc98){_0x206af4({'code':0xc8,'message':_0x8cc98[_0xef41('0x1c')]});})[_0xef41('0x1d')](function(_0x141fcf){_0xd3c954(_0x1d25d4['error'](0x1f5,_0x141fcf[_0xef41('0x1c')]));});});},'Command':function(_0x46aa23){var _0x9f8c10=this;return new Promise(function(_0x5f3b8d,_0xdc47e7){if(ami[_0xef41('0x1e')]()==![]){return _0xdc47e7(_0x9f8c10['error'](0x1f4,[config[_0xef41('0x14')]['ip'],config[_0xef41('0x14')][_0xef41('0x1f')],'ami\x20disconnected']['join']('\x20')));}_0x46aa23=_[_0xef41('0x16')](_0x46aa23,_0xef41('0x20'));_0x46aa23[_0xef41('0x19')]='Command';return ami[_0xef41('0x1b')](_0x46aa23)['then'](function(_0x1ef809){_0x5f3b8d({'code':0xc8,'message':_0x1ef809[_0xef41('0x21')]});})[_0xef41('0x1d')](function(_0x3cbdde){_0xdc47e7(_0x9f8c10[_0xef41('0x13')](0x1f5,_0x3cbdde[_0xef41('0x1c')]));});});},'VoiceQueues':function(_0x8bf02c){return new Promise(function(_0x42a648,_0x2abcef){var _0xf91dd2=[];for(var _0x3b461d in _0x5bf199['voiceQueues']){if(_0x5bf199[_0xef41('0x22')][_0xef41('0x23')](_0x3b461d)){var _0x1a9371=_0x5bf199['voiceQueues'][_0x3b461d];var _0x2a8441={'id':_0x1a9371['id'],'name':_0x1a9371[_0xef41('0xc')],'strategy':_0x1a9371[_0xef41('0x24')],'answered':_0x1a9371[_0xef41('0x25')],'available':_0x1a9371['available'],'loggedIn':_0x1a9371[_0xef41('0x26')],'pTalking':_0x1a9371['pTalking'],'sumBillable':_0x1a9371['sumBillable'],'sumDuration':_0x1a9371[_0xef41('0x27')],'sumHoldTime':_0x1a9371[_0xef41('0x28')]||0x0,'talking':_0x1a9371['talking'],'total':_0x1a9371[_0xef41('0x29')],'type':_0x1a9371[_0xef41('0x2a')],'unmanaged':_0x1a9371[_0xef41('0x2b')],'abandoned':_0x1a9371[_0xef41('0x2c')],'waiting':_0x1a9371[_0xef41('0x2d')],'loggedInDb':_0x1a9371[_0xef41('0x2e')]};if(_0x1a9371[_0xef41('0x2a')]===_0xef41('0x2f')){_0x2a8441['dialActive']=_0x1a9371['dialActive'];_0x2a8441[_0xef41('0x30')]=_0x1a9371[_0xef41('0x30')];_0x2a8441[_0xef41('0x31')]=_0x1a9371[_0xef41('0x31')];_0x2a8441['dialOriginateCallerIdNumber']=_0x1a9371[_0xef41('0x32')];_0x2a8441[_0xef41('0x33')]=_0x1a9371[_0xef41('0x33')];_0x2a8441['dialPrefix']=_0x1a9371[_0xef41('0x34')];_0x2a8441[_0xef41('0x35')]=_0x1a9371[_0xef41('0x35')];_0x2a8441[_0xef41('0x36')]=_0x1a9371[_0xef41('0x36')];_0x2a8441[_0xef41('0x37')]=_0x1a9371['outboundBlacklistCallsDay'];_0x2a8441[_0xef41('0x38')]=_0x1a9371[_0xef41('0x38')];_0x2a8441[_0xef41('0x39')]=_0x1a9371[_0xef41('0x39')];_0x2a8441[_0xef41('0x3a')]=_0x1a9371[_0xef41('0x3a')];_0x2a8441[_0xef41('0x3b')]=_0x1a9371[_0xef41('0x3b')];_0x2a8441[_0xef41('0x3c')]=_0x1a9371[_0xef41('0x3c')];_0x2a8441[_0xef41('0x3d')]=_0x1a9371['outboundNoAnswerCallsDay'];_0x2a8441['outboundNoSuchCallsDay']=_0x1a9371[_0xef41('0x3e')];_0x2a8441[_0xef41('0x3f')]=_0x1a9371[_0xef41('0x3f')];_0x2a8441[_0xef41('0x40')]=_0x1a9371['outboundReCallsDay'];_0x2a8441[_0xef41('0x41')]=_0x1a9371[_0xef41('0x41')];_0x2a8441[_0xef41('0x42')]=_0x1a9371[_0xef41('0x42')];_0x2a8441['predictiveIntervalAnsweredCalls']=_0x1a9371[_0xef41('0x43')];_0x2a8441['predictiveIntervalAvgHoldtime']=_0x1a9371[_0xef41('0x44')];_0x2a8441[_0xef41('0x45')]=_0x1a9371[_0xef41('0x45')];_0x2a8441['predictiveIntervalDroppedCallsCallersExit']=_0x1a9371[_0xef41('0x46')];_0x2a8441['predictiveIntervalDroppedCallsTimeout']=_0x1a9371[_0xef41('0x47')];_0x2a8441['predictiveIntervalErlangCalls']=_0x1a9371[_0xef41('0x48')];_0x2a8441[_0xef41('0x49')]=_0x1a9371[_0xef41('0x49')];_0x2a8441[_0xef41('0x4a')]=_0x1a9371[_0xef41('0x4a')];_0x2a8441[_0xef41('0x4b')]=_0x1a9371[_0xef41('0x4b')];_0x2a8441[_0xef41('0x4c')]=_0x1a9371[_0xef41('0x4c')];_0x2a8441[_0xef41('0x4d')]=_0x1a9371[_0xef41('0x4d')];_0x2a8441[_0xef41('0x4e')]=_0x1a9371['predictiveIntervalTotalCalls'];_0x2a8441[_0xef41('0x1c')]=_0x1a9371['message'];_0x2a8441[_0xef41('0x4f')]=_0x1a9371[_0xef41('0x4f')];_0x2a8441['erlangCalls']=_0x1a9371[_0xef41('0x50')];_0x2a8441['erlangCallToSecond']=_0x1a9371[_0xef41('0x51')];_0x2a8441[_0xef41('0x52')]=_0x1a9371[_0xef41('0x52')];_0x2a8441[_0xef41('0x53')]=_0x1a9371[_0xef41('0x53')];_0x2a8441['startPredictive']=_0x1a9371['startPredictive'];_0x2a8441[_0xef41('0x54')]=_0x1a9371[_0xef41('0x54')];}if(_0x1a9371[_0xef41('0x55')]){_0x2a8441[_0xef41('0x55')]={'id':_0x1a9371[_0xef41('0x55')]['id'],'name':_0x1a9371[_0xef41('0x55')]['name'],'active':_0x1a9371[_0xef41('0x55')][_0xef41('0x56')],'callerid':_0x1a9371['Trunk'][_0xef41('0x57')]};}if(_0x1a9371['Interval']){_0x2a8441[_0xef41('0x58')]={'id':_0x1a9371[_0xef41('0x58')]['id'],'name':_0x1a9371['Interval']['name']};}_0xf91dd2[_0xef41('0x59')](_0x2a8441);}}_0x42a648({'count':_0xf91dd2['length'],'rows':_0xf91dd2});});},'VoiceChannels':function(_0x2ab47f){return new Promise(function(_0x1d986d,_0x3449a5){var _0x2f7cac=_['values'](_0x5bf199[_0xef41('0x5a')]);_0x1d986d({'count':_0x2f7cac[_0xef41('0x5b')],'rows':_0x2f7cac});});},'VoiceChannelMixMonitor':function(_0x22f146){var _0x388afe=this;return new Promise(function(_0x1b000d,_0x40c855){if(ami[_0xef41('0x1e')]()==![]){return _0x40c855(_0x388afe[_0xef41('0x13')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xef41('0x1f')],_0xef41('0x5c')][_0xef41('0x15')]('\x20')));}var _0x562b84=schema(properties[_0xef41('0x5d')])[_0xef41('0x5e')](_0x22f146);if(_0x562b84[_0xef41('0x5b')]>0x0){return _0x40c855(_0x388afe[_0xef41('0x13')](0x1f4,_[_0xef41('0x5f')](_0x562b84,_0xef41('0x1c'))['join'](',\x20')));}var _0x32b855=_[_0xef41('0x60')](_0x5bf199[_0xef41('0x5a')],{'uniqueid':_0x22f146[_0xef41('0x61')]});if(_0x32b855&&_0x32b855[_0xef41('0x62')]){var _0x4b1623=util[_0xef41('0x9')](_0xef41('0x63'),_0x22f146[_0xef41('0x64')]||_0x22f146['uniqueid'],_0x22f146[_0xef41('0x9')]||'wav');return ami['Action']({'action':_0xef41('0x65'),'channel':_0x32b855['channel'],'file':_0x4b1623,'options':_0xef41('0x66')})[_0xef41('0x67')](function(_0x43d10e){var _0x237689=_['find'](_0x32b855['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x4b1623['toLowerCase']()});if(_[_0xef41('0x68')](_0x237689)){_0x32b855[_0xef41('0x69')][_0xef41('0x59')]({'filename':_0xef41('0x6a')+_0x4b1623['toLowerCase'](),'createdAt':moment()[_0xef41('0x9')](_0xef41('0x6b')),'mixmonitorid':_0x43d10e[_0xef41('0x6c')],'status':_0xef41('0x6d')});}else{_0x237689['mixmonitorid']=_0x43d10e[_0xef41('0x6c')];_0x237689['status']=_0xef41('0x6d');}_0x1b000d({'code':0xc8,'message':[_0x22f146['uniqueid'],_0xef41('0x6e'),_0x43d10e[_0xef41('0x6c')]][_0xef41('0x15')]('\x20'),'mixmonitorid':_0x43d10e[_0xef41('0x6c')]});})['catch'](function(_0x1bf3fe){_0x40c855(_0x388afe[_0xef41('0x13')](0x1f5,[_0x22f146['uniqueid'],_0x1bf3fe[_0xef41('0x1c')]['toLowerCase']()][_0xef41('0x15')]('\x20')));});}else{return _0x40c855(_0x388afe[_0xef41('0x13')](0x1f5,_0xef41('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x514746){var _0x1470f2=this;return new Promise(function(_0x4a7375,_0x401198){if(ami[_0xef41('0x1e')]()==![]){return _0x401198(_0x1470f2['error'](0x1f4,[config[_0xef41('0x14')]['ip'],config['asterisk'][_0xef41('0x1f')],_0xef41('0x5c')][_0xef41('0x15')]('\x20')));}var _0x1dda90=schema(properties[_0xef41('0x5d')])[_0xef41('0x5e')](_0x514746);if(_0x1dda90[_0xef41('0x5b')]>0x0){return _0x401198(_0x1470f2['error'](0x1f4,_[_0xef41('0x5f')](_0x1dda90,_0xef41('0x1c'))[_0xef41('0x15')](',\x20')));}var _0x585f50=_[_0xef41('0x60')](_0x5bf199[_0xef41('0x5a')],{'uniqueid':_0x514746[_0xef41('0x61')]});if(_0x585f50){return BPromise[_0xef41('0x70')]()[_0xef41('0x67')](function(){if(_0x585f50[_0xef41('0x62')]){return ami['Action']({'action':_0xef41('0x71'),'channel':_0x585f50[_0xef41('0x62')],'mixmonitorid':_0x514746[_0xef41('0x6c')]})['catch'](function(_0x375336){});}})[_0xef41('0x67')](function(){if(_0x585f50['destinationchannel']){return ami[_0xef41('0x1b')]({'action':'StopMixMonitor','channel':_0x585f50['destinationchannel'],'mixmonitorid':_0x514746[_0xef41('0x6c')]})[_0xef41('0x1d')](function(_0x420039){});}})[_0xef41('0x67')](function(_0x37492f){var _0x52c220=_[_0xef41('0x60')](_0x585f50['monitors'],{'mixmonitorid':_0x514746[_0xef41('0x6c')]});if(_0x52c220){_0x52c220[_0xef41('0x72')]=_0xef41('0x73');}})[_0xef41('0x67')](function(){var _0x4fa482=util[_0xef41('0x9')](_0xef41('0x63'),_0x514746['filename']||_0x514746[_0xef41('0x61')],_0x514746['format']||_0xef41('0x74'));var _0x1ba05d=_[_0xef41('0x60')](_0x585f50['monitors'],{'filename':_0xef41('0x6a')+_0x4fa482[_0xef41('0x75')]()});if(_0x1ba05d){_0x1ba05d[_0xef41('0x72')]='stop';}})['then'](function(){_0x4a7375({'code':0xc8,'message':[_0x514746[_0xef41('0x61')],_0xef41('0x76')]['join']('\x20')});})['catch'](function(_0x5ccb29){_0x401198(_0x1470f2[_0xef41('0x13')](0x1f5,[_0x514746[_0xef41('0x61')],_0x5ccb29[_0xef41('0x1c')]['toLowerCase']()][_0xef41('0x15')]('\x20')));});}else{return _0x401198(_0x1470f2[_0xef41('0x13')](0x1f5,_0xef41('0x6f')));}});},'VoiceQueuesChannels':function(_0x395f4b){return new Promise(function(_0x212f63,_0x4ca38d){var _0x200d14=_[_0xef41('0x77')](_0x5bf199[_0xef41('0x78')]);_0x212f63({'count':_0x200d14[_0xef41('0x5b')],'rows':_0x200d14});});},'VoiceQueuesChannel':function(_0x85aad5){var _0x4f660c=this;return new Promise(function(_0xb797da,_0xcb6bdd){var _0x47a0c0=schema(properties[_0xef41('0x79')])['validate'](_0x85aad5);if(_0x47a0c0[_0xef41('0x5b')]>0x0){return _0xcb6bdd(_0x4f660c['error'](0x1f4,_[_0xef41('0x5f')](_0x47a0c0,'message')['join'](',\x20')));}var _0x2c0eac=_['find'](_0x5bf199['queueChannels'],{'uniqueid':_0x85aad5[_0xef41('0x61')]});if(_0x2c0eac){_0xb797da(_0x2c0eac);}else{return _0xcb6bdd(_0x4f660c[_0xef41('0x13')](0x1f5,_0xef41('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0x4e77a5){var _0x2c509a=this;return new Promise(function(_0x138985,_0x2fade9){if(ami[_0xef41('0x1e')]()==![]){return _0x2fade9(_0x2c509a['error'](0x1f4,[config[_0xef41('0x14')]['ip'],config['asterisk'][_0xef41('0x1f')],'ami\x20disconnected']['join']('\x20')));}var _0xad1e9b=schema(properties[_0xef41('0x7a')])[_0xef41('0x5e')](_0x4e77a5);if(_0xad1e9b['length']>0x0){return _0x2fade9(_0x2c509a[_0xef41('0x13')](0x1f4,_[_0xef41('0x5f')](_0xad1e9b,'message')[_0xef41('0x15')](',\x20')));}var _0x7f082f=_[_0xef41('0x60')](_0x5bf199[_0xef41('0x78')],{'uniqueid':_0x4e77a5[_0xef41('0x61')]});if(_0x7f082f&&_0x7f082f[_0xef41('0x62')]){return ami[_0xef41('0x1b')]({'action':_0xef41('0x7b'),'channel':_0x7f082f[_0xef41('0x62')]})['then'](function(_0x27d4ea){_0x138985({'code':0xc8,'message':[_0x4e77a5['uniqueid'],_0x27d4ea['message']['toLowerCase']()][_0xef41('0x15')]('\x20')});})[_0xef41('0x1d')](function(_0x4838fe){_0x2fade9(_0x2c509a['error'](0x1f5,[_0x4e77a5['uniqueid'],_0x4838fe[_0xef41('0x1c')]['toLowerCase']()][_0xef41('0x15')]('\x20')));});}else{return _0x2fade9(_0x2c509a[_0xef41('0x13')](0x1f5,_0xef41('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x4bd0b0){var _0x4dbab0=this;return new Promise(function(_0x263449,_0x10aaa5){if(ami['isConnected']()==![]){return _0x10aaa5(_0x4dbab0[_0xef41('0x13')](0x1f4,[config[_0xef41('0x14')]['ip'],config[_0xef41('0x14')][_0xef41('0x1f')],'ami\x20disconnected']['join']('\x20')));}var _0x280f56=schema(properties[_0xef41('0x7c')])[_0xef41('0x5e')](_0x4bd0b0);if(_0x280f56['length']>0x0){return _0x10aaa5(_0x4dbab0[_0xef41('0x13')](0x1f4,_[_0xef41('0x5f')](_0x280f56,_0xef41('0x1c'))['join'](',\x20')));}var _0x4f56bb=_[_0xef41('0x60')](_0x5bf199['queueChannels'],{'uniqueid':_0x4bd0b0[_0xef41('0x61')]});if(_0x4f56bb&&_0x4f56bb[_0xef41('0x62')]){return ami[_0xef41('0x1b')]({'action':_0xef41('0x7d'),'channel':_0x4f56bb[_0xef41('0x62')],'exten':_0x4bd0b0['exten'],'context':_0x4bd0b0[_0xef41('0x7e')]||_0x4f56bb[_0xef41('0x7e')],'priority':0x1})[_0xef41('0x67')](function(_0x575c45){_0x263449({'code':0xc8,'message':[_0x4bd0b0['uniqueid'],_0x575c45['message'][_0xef41('0x75')]()][_0xef41('0x15')]('\x20')});})[_0xef41('0x1d')](function(_0x35b991){_0x10aaa5(_0x4dbab0['error'](0x1f5,[_0x4bd0b0[_0xef41('0x61')],_0x35b991[_0xef41('0x1c')][_0xef41('0x75')]()][_0xef41('0x15')]('\x20')));});}else{return _0x10aaa5(_0x4dbab0['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x4bb497){return new Promise(function(_0x403a64,_0x5298a9){var _0xa409bd=_[_0xef41('0x77')](_0x5bf199[_0xef41('0x10')]);_0x403a64({'count':_0xa409bd['length'],'rows':_0xa409bd});});},'Telephones':function(_0x378d9c){return new Promise(function(_0x549f7e,_0x1ca3d6){var _0x19f39c=_['values'](_0x5bf199[_0xef41('0x7f')]);_0x549f7e({'count':_0x19f39c[_0xef41('0x5b')],'rows':_0x19f39c});});},'Trunks':function(_0x57a189){return new Promise(function(_0x1b9281,_0x278031){var _0x2aa966=_[_0xef41('0x77')](_0x5bf199[_0xef41('0x80')]);_0x1b9281({'count':_0x2aa966[_0xef41('0x5b')],'rows':_0x2aa966});});},'OutboundChannels':function(_0x4d1ee8){return new Promise(function(_0x1eff66,_0x3153cd){var _0x589dd3=_[_0xef41('0x77')](_0x5bf199[_0xef41('0x81')]);_0x1eff66({'count':_0x589dd3[_0xef41('0x5b')],'rows':_0x589dd3});});},'Outbound':function(_0x1bcb24){return new Promise(function(_0x58941d,_0x529b52){_0x58941d(_0x5bf199['outbound']);});},'Campaigns':function(_0x5392d0){return new Promise(function(_0x23752a,_0x1a6160){var _0x44cf25=_[_0xef41('0x77')](_0x5bf199[_0xef41('0x82')]);_0x23752a({'count':_0x44cf25['length'],'rows':_0x44cf25});});},'VoiceQueuesPreview':function(_0x220888){var _0x48c59a=this;return new Promise(function(_0x33ff12,_0x312eb1){_0x38ab1e[_0xef41('0x83')](_0x220888['id'])[_0xef41('0x67')](function(_0x13b648){_0x33ff12({'code':0xc8,'message':_0x13b648['message']});})[_0xef41('0x1d')](function(_0x3f762a){_0x312eb1(_0x48c59a['error'](0x1f4,_0x3f762a[_0xef41('0x1c')]));});});},'EventManager':function(_0xf18628){var _0x5c5b96=this;return new Promise(function(_0x43c242,_0xa45791){if(!_0xf18628['event']){return _0xa45791(_0x5c5b96[_0xef41('0x13')](0x1f4,_0xef41('0x84')));}ami[_0xef41('0x85')](_0xef41('0x86')+_0xf18628['event'],_0xf18628[_0xef41('0x1c')]);_0x43c242({'code':0xc8,'message':_0xf18628});});},'FaxAccounts':function(_0x2147a6){return new Promise(function(_0x407199,_0x365e8e){var _0x41504e=_[_0xef41('0x77')](_0x5bf199[_0xef41('0x87')]);_0x407199({'count':_0x41504e[_0xef41('0x5b')],'rows':_0x41504e});});},'SendFax':function(_0x1c00bc){var _0x431c8c=this;return new Promise(function(_0xc20e25,_0x19a7de){_0x3d11fd[_0xef41('0x88')](_0x1c00bc)[_0xef41('0x67')](function(_0x2c3a24){_0xc20e25({'code':0xc8,'message':_0x2c3a24['message']});})[_0xef41('0x1d')](function(_0x3cf356){_0x19a7de(_0x431c8c[_0xef41('0x13')](0x1f4,_0x3cf356['message']));});});},'CheckAfterSend':function(_0x46ff76){var _0x34c711=this;return new Promise(function(_0x98e8e9,_0x36867d){_0x3d11fd[_0xef41('0x89')](_0x46ff76)[_0xef41('0x67')](function(_0x588076){_0x98e8e9({'code':0xc8,'message':_0x588076['message']});})[_0xef41('0x1d')](function(_0x66c765){_0x36867d(_0x34c711[_0xef41('0x13')](0x1f4,_0x66c765[_0xef41('0x1c')]));});});}};var _0x35990a=jayson[_0xef41('0x8a')](_0x2d334f)[_0xef41('0x8b')]();_0x35990a['on'](_0xef41('0x13'),function(_0x4e7a6e){return _0x5d0562(_0x4e7a6e);});_0x35990a[_0xef41('0x8')](0x232a,_0xef41('0x8c'),function(){console[_0xef41('0x8d')](_0xef41('0x8e'),0x232a);return _0x4edfbd(_0xef41('0x8f')+0x232a);});});};
\ No newline at end of file
index 0c11522..480860e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','localhost','socket.io-emitter','redis','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','<unknown>','uniqueid','destcalleridname','phone','destcalleridnum','resolve','then','showContact','omit','[%s][%s]\x20Contact\x20found:%s','xmd-contactid2','format','user:%s','name','trigger:%s','action','toLowerCase','merge','createContact','[%s][%s]\x20Contact\x20created:%s'];(function(_0x51293c,_0x1a01e8){var _0x2cabbe=function(_0x5714f3){while(--_0x5714f3){_0x51293c['push'](_0x51293c['shift']());}};_0x2cabbe(++_0x1a01e8);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x431581,_0x1100e2){_0x431581=_0x431581-0x0;var _0x3e2565=_0xf4f4[_0x431581];return _0x3e2565;};'use strict';var BPromise=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var _=require('lodash');var Redis=require(_0x4f4f('0x2'));var config=require(_0x4f4f('0x3'));var logger=require(_0x4f4f('0x4'))(_0x4f4f('0x5'));var cmContactRpc=require(_0x4f4f('0x6'));config['redis']=_[_0x4f4f('0x7')](config['redis'],{'host':_0x4f4f('0x8'),'port':0x18eb});var io=require(_0x4f4f('0x9'))(new Redis(config[_0x4f4f('0xa')]));function emit(_0x1ff75a,_0x3c4877,_0x249f8a,_0x2faba9){logger[_0x4f4f('0xb')]('[%s][%s]',_0x1ff75a,'',_0x3c4877,_0x249f8a,JSON[_0x4f4f('0xc')](_0x2faba9));io['to'](_0x3c4877)[_0x4f4f('0xd')](_0x249f8a,_0x2faba9);}exports[_0x4f4f('0xe')]=function(_0x2d86d1,_0x116f22,_0x11940f){_0x11940f[_0x4f4f('0xf')]=0x0;if(_0x116f22[_0x4f4f('0x10')]&&parseInt(_0x116f22['data2'],0xa)){var _0x5956c6={'ListId':parseInt(_0x116f22[_0x4f4f('0x11')],0xa),'phone':_0x11940f[_0x4f4f('0x12')]};if(_[_0x4f4f('0x13')](_0x11940f[_0x4f4f('0x14')])){_0x5956c6[_0x4f4f('0x15')]=_0x11940f[_0x4f4f('0x16')]&&_0x11940f['calleridname']!==_0x4f4f('0x17')?_0x11940f['calleridname']:_0x11940f[_0x4f4f('0x12')]||_0x11940f[_0x4f4f('0x18')];}else{_0x5956c6[_0x4f4f('0x15')]=_0x11940f[_0x4f4f('0x19')]&&_0x11940f['destcalleridname']!==_0x4f4f('0x17')?_0x11940f['destcalleridname']:_0x11940f['destcalleridnum']||_0x11940f['uniqueid'];_0x5956c6[_0x4f4f('0x1a')]=_0x11940f[_0x4f4f('0x19')]&&_0x11940f[_0x4f4f('0x19')]!==_0x4f4f('0x17')?_0x11940f[_0x4f4f('0x19')]:_0x11940f[_0x4f4f('0x1b')]||_0x11940f[_0x4f4f('0x18')];}BPromise[_0x4f4f('0x1c')]()[_0x4f4f('0x1d')](cmContactRpc[_0x4f4f('0x1e')]({'where':_[_0x4f4f('0x1f')](_0x5956c6,[_0x4f4f('0x15')])}))['then'](function(_0x93877a){if(_0x93877a){logger[_0x4f4f('0xb')](_0x4f4f('0x20'),_0x11940f[_0x4f4f('0x18')],'',_0x93877a['id']);if(_0x2d86d1){_0x11940f[_0x4f4f('0x21')]=_0x93877a['id'];emit(_0x11940f[_0x4f4f('0x18')],util[_0x4f4f('0x22')](_0x4f4f('0x23'),_0x2d86d1[_0x4f4f('0x24')]),util[_0x4f4f('0x22')](_0x4f4f('0x25'),_0x116f22[_0x4f4f('0x26')][_0x4f4f('0x27')]()),_[_0x4f4f('0x28')](_0x11940f,{'ListId':parseInt(_0x116f22['data1'],0xa)}));}return;}else{logger['info']('[%s][%s]\x20Contact\x20not\x20found',_0x11940f[_0x4f4f('0x18')],'');return BPromise[_0x4f4f('0x1c')]()['then'](cmContactRpc[_0x4f4f('0x29')](_0x5956c6));}})[_0x4f4f('0x1d')](function(_0xcf19ac){if(_0xcf19ac){logger[_0x4f4f('0xb')](_0x4f4f('0x2a'),_0x11940f[_0x4f4f('0x18')],'',_0xcf19ac['id']);if(_0x2d86d1){_0x11940f[_0x4f4f('0x21')]=_0xcf19ac['id'];emit(_0x11940f['uniqueid'],util[_0x4f4f('0x22')](_0x4f4f('0x23'),_0x2d86d1[_0x4f4f('0x24')]),util[_0x4f4f('0x22')](_0x4f4f('0x25'),_0x116f22['action'][_0x4f4f('0x27')]()),_[_0x4f4f('0x28')](_0x11940f,{'ListId':parseInt(_0x116f22[_0x4f4f('0x11')],0xa)}));}}})['catch'](function(_0x534075){logger['error'](_0x4f4f('0x2b'),_0x11940f['uniqueid'],'',JSON[_0x4f4f('0xc')](_0x534075));});}else{if(_0x2d86d1){logger[_0x4f4f('0xb')](_0x4f4f('0x2c'),_0x11940f['uniqueid'],'');emit(_0x11940f[_0x4f4f('0x18')],util[_0x4f4f('0x22')]('user:%s',_0x2d86d1[_0x4f4f('0x24')]),util[_0x4f4f('0x22')](_0x4f4f('0x25'),_0x116f22['action'][_0x4f4f('0x27')]()),_[_0x4f4f('0x28')]({'ListId':parseInt(_0x116f22['data1'],0xa)},_0x11940f));}}};
\ No newline at end of file
+var _0xd527=['[%s][%s]\x20Contact\x20found:%s','xmd-contactid2','user:%s','format','trigger:%s','merge','[%s][%s]\x20Contact\x20not\x20found','resolve','createContact','name','action','toLowerCase','catch','[%s][%s]\x20Error\x20creating\x20contact','stringify','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','[%s][%s]','emit','data2','data1','firstName','calleridname','destcalleridname','<unknown>','destcalleridnum','uniqueid','then','showContact','omit'];(function(_0x18bf62,_0x5c27d6){var _0x49c15d=function(_0x102d94){while(--_0x102d94){_0x18bf62['push'](_0x18bf62['shift']());}};_0x49c15d(++_0x5c27d6);}(_0xd527,0x195));var _0x7d52=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xd527[_0x51c819];return _0x15c5d2;};'use strict';var BPromise=require('bluebird');var util=require(_0x7d52('0x0'));var _=require(_0x7d52('0x1'));var Redis=require(_0x7d52('0x2'));var config=require(_0x7d52('0x3'));var logger=require(_0x7d52('0x4'))(_0x7d52('0x5'));var cmContactRpc=require(_0x7d52('0x6'));config[_0x7d52('0x7')]=_[_0x7d52('0x8')](config[_0x7d52('0x7')],{'host':_0x7d52('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4788b2,_0x4c9005,_0x4228df,_0xb2b79e){logger[_0x7d52('0xa')](_0x7d52('0xb'),_0x4788b2,'',_0x4c9005,_0x4228df,JSON['stringify'](_0xb2b79e));io['to'](_0x4c9005)[_0x7d52('0xc')](_0x4228df,_0xb2b79e);}exports['exec']=function(_0x12b704,_0x31f3ce,_0x1c9d26){_0x1c9d26['autoCreate']=0x0;if(_0x31f3ce[_0x7d52('0xd')]&&parseInt(_0x31f3ce[_0x7d52('0xd')],0xa)){var _0x3d6eed={'ListId':parseInt(_0x31f3ce[_0x7d52('0xe')],0xa),'phone':_0x1c9d26['calleridnum']};if(_['isNil'](_0x1c9d26['routeId'])){_0x3d6eed[_0x7d52('0xf')]=_0x1c9d26[_0x7d52('0x10')]&&_0x1c9d26[_0x7d52('0x10')]!=='<unknown>'?_0x1c9d26['calleridname']:_0x1c9d26['calleridnum']||_0x1c9d26['uniqueid'];}else{_0x3d6eed['firstName']=_0x1c9d26['destcalleridname']&&_0x1c9d26[_0x7d52('0x11')]!==_0x7d52('0x12')?_0x1c9d26[_0x7d52('0x11')]:_0x1c9d26[_0x7d52('0x13')]||_0x1c9d26[_0x7d52('0x14')];_0x3d6eed['phone']=_0x1c9d26[_0x7d52('0x11')]&&_0x1c9d26[_0x7d52('0x11')]!==_0x7d52('0x12')?_0x1c9d26[_0x7d52('0x11')]:_0x1c9d26[_0x7d52('0x13')]||_0x1c9d26['uniqueid'];}BPromise['resolve']()[_0x7d52('0x15')](cmContactRpc[_0x7d52('0x16')]({'where':_[_0x7d52('0x17')](_0x3d6eed,[_0x7d52('0xf')])}))[_0x7d52('0x15')](function(_0xb05603){if(_0xb05603){logger[_0x7d52('0xa')](_0x7d52('0x18'),_0x1c9d26[_0x7d52('0x14')],'',_0xb05603['id']);if(_0x12b704){_0x1c9d26[_0x7d52('0x19')]=_0xb05603['id'];emit(_0x1c9d26['uniqueid'],util['format'](_0x7d52('0x1a'),_0x12b704['name']),util[_0x7d52('0x1b')](_0x7d52('0x1c'),_0x31f3ce['action']['toLowerCase']()),_[_0x7d52('0x1d')](_0x1c9d26,{'ListId':parseInt(_0x31f3ce['data1'],0xa)}));}return;}else{logger['info'](_0x7d52('0x1e'),_0x1c9d26[_0x7d52('0x14')],'');return BPromise[_0x7d52('0x1f')]()[_0x7d52('0x15')](cmContactRpc[_0x7d52('0x20')](_0x3d6eed));}})[_0x7d52('0x15')](function(_0x552e87){if(_0x552e87){logger[_0x7d52('0xa')]('[%s][%s]\x20Contact\x20created:%s',_0x1c9d26[_0x7d52('0x14')],'',_0x552e87['id']);if(_0x12b704){_0x1c9d26['xmd-contactid2']=_0x552e87['id'];emit(_0x1c9d26[_0x7d52('0x14')],util[_0x7d52('0x1b')](_0x7d52('0x1a'),_0x12b704[_0x7d52('0x21')]),util[_0x7d52('0x1b')]('trigger:%s',_0x31f3ce[_0x7d52('0x22')][_0x7d52('0x23')]()),_[_0x7d52('0x1d')](_0x1c9d26,{'ListId':parseInt(_0x31f3ce[_0x7d52('0xe')],0xa)}));}}})[_0x7d52('0x24')](function(_0xa618b0){logger['error'](_0x7d52('0x25'),_0x1c9d26[_0x7d52('0x14')],'',JSON[_0x7d52('0x26')](_0xa618b0));});}else{if(_0x12b704){logger['info']('[%s][%s]\x20Autocreate\x20disabled',_0x1c9d26[_0x7d52('0x14')],'');emit(_0x1c9d26[_0x7d52('0x14')],util[_0x7d52('0x1b')](_0x7d52('0x1a'),_0x12b704[_0x7d52('0x21')]),util['format'](_0x7d52('0x1c'),_0x31f3ce[_0x7d52('0x22')]['toLowerCase']()),_[_0x7d52('0x1d')]({'ListId':parseInt(_0x31f3ce[_0x7d52('0xe')],0xa)},_0x1c9d26));}}};
\ No newline at end of file
index e81ee74..daccfce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb09=['custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','emit','info','stringify','prototype','clone','checkTriggers','log','SYNCCUSTOMNEW!!!','interface','hasOwnProperty','checkTrigger','merge','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','template\x20not\x20found','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','render','format','name','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','integration','accounts','queue','urlforward','script','parse','query','replace','AllConditions','checkConditions','AnyConditions','some','channel','field','account','ChatWebsiteId','operator','value','upperFirst','interaction','message','event','agent','membername','lastevent','routeId','exports','util','lodash','ioredis','./urlforward','../../../config/environment','../../../config/logger','trigger','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:status_nosuchnumber','syncCustomEventNew','custom:status_noanswer','custom:status_busy','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial'];(function(_0x4dde97,_0x520eee){var _0x2bebcf=function(_0x147175){while(--_0x147175){_0x4dde97['push'](_0x4dde97['shift']());}};_0x2bebcf(++_0x520eee);}(_0xcb09,0x1a0));var _0x9cb0=function(_0x168913,_0x5ed694){_0x168913=_0x168913-0x0;var _0x6c0caa=_0xcb09[_0x168913];return _0x6c0caa;};'use strict';var util=require(_0x9cb0('0x0'));var _=require(_0x9cb0('0x1'));var url=require('url');var Mustache=require('mustache');var Redis=require(_0x9cb0('0x2'));var urlforward=require(_0x9cb0('0x3'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require('./script');var cmContactRpc=require('../rpc/cmContact');var config=require(_0x9cb0('0x4'));var logger=require(_0x9cb0('0x5'))(_0x9cb0('0x6'));var ami=require('../ami');config['redis']=_[_0x9cb0('0x7')](config['redis'],{'host':_0x9cb0('0x8'),'port':0x18eb});var io=require(_0x9cb0('0x9'))(new Redis(config['redis']));var operators={'equals':function(_0x1a1eb2,_0x2cf642){return _0x1a1eb2==_0x2cf642;},'not_equals':function(_0x26e483,_0x42ecff){return _0x26e483!=_0x42ecff;}};var barAndWebActions=[_0x9cb0('0xa'),_0x9cb0('0xb'),_0x9cb0('0xc')];function Trigger(_0x537f1){this[_0x9cb0('0xd')]=_0x537f1['triggers'];this[_0x9cb0('0xe')]=_0x537f1[_0x9cb0('0xe')];this[_0x9cb0('0xf')]=_0x537f1['voiceQueues'];this[_0x9cb0('0x10')]=_0x537f1['templates'];this[_0x9cb0('0x11')]=_0x537f1[_0x9cb0('0x11')];this['zendeskAccounts']=_0x537f1[_0x9cb0('0x12')];this[_0x9cb0('0x13')]=_0x537f1[_0x9cb0('0x13')];this[_0x9cb0('0x14')]=_0x537f1[_0x9cb0('0x14')];this[_0x9cb0('0x15')]=_0x537f1[_0x9cb0('0x15')];this[_0x9cb0('0x16')]=_0x537f1[_0x9cb0('0x16')];this[_0x9cb0('0x17')]=_0x537f1[_0x9cb0('0x17')];this[_0x9cb0('0x18')]=_0x537f1[_0x9cb0('0x18')];this[_0x9cb0('0x19')]=_0x537f1[_0x9cb0('0x19')];this[_0x9cb0('0x1a')]=_0x537f1['dynamics365Accounts'];this[_0x9cb0('0x1b')]=_0x537f1[_0x9cb0('0x1b')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x9cb0('0x14')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x9cb0('0x15')],'zoho':this[_0x9cb0('0x16')],'desk':this[_0x9cb0('0x17')],'vtiger':this[_0x9cb0('0x18')],'dynamics365':this[_0x9cb0('0x1a')],'freshsales':this[_0x9cb0('0x1b')],'servicenow':this[_0x9cb0('0x19')]};ami['on']('custom:agentcalled',this[_0x9cb0('0x1c')]['bind'](this));ami['on']('custom:agentconnect',this[_0x9cb0('0x1c')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x1e'),this['syncCustomEvent'][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x1f'),this[_0x9cb0('0x1c')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x20'),this[_0x9cb0('0x21')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x22'),this[_0x9cb0('0x21')]['bind'](this));ami['on'](_0x9cb0('0x23'),this['syncCustomEventNew']['bind'](this));ami['on']('custom:queuecallerabandon',this[_0x9cb0('0x1c')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x24'),this[_0x9cb0('0x1c')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x25'),this['syncAgentDial']['bind'](this));ami['on'](_0x9cb0('0x26'),this[_0x9cb0('0x27')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x28'),this[_0x9cb0('0x27')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x29'),this[_0x9cb0('0x1c')][_0x9cb0('0x1d')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x2a'),this[_0x9cb0('0x1c')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x2b'),this[_0x9cb0('0x1c')][_0x9cb0('0x1d')](this));ami['on'](_0x9cb0('0x2c'),this[_0x9cb0('0x1c')][_0x9cb0('0x1d')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0x9cb0('0x1d')](this));}Trigger['prototype'][_0x9cb0('0x2d')]=function(_0x4c0b08,_0x5e956f,_0x2b9baa){logger[_0x9cb0('0x2e')](_0x4c0b08,_0x5e956f,JSON[_0x9cb0('0x2f')](_0x2b9baa));io['to'](_0x4c0b08)[_0x9cb0('0x2d')](_0x5e956f,_0x2b9baa);};Trigger[_0x9cb0('0x30')][_0x9cb0('0x1c')]=function(_0x249167){var _0x26d23f=_[_0x9cb0('0x31')](_0x249167);this[_0x9cb0('0x32')](_0x26d23f);};Trigger[_0x9cb0('0x30')][_0x9cb0('0x21')]=function(_0x5a8688){console[_0x9cb0('0x33')](_0x9cb0('0x34'),_0x5a8688);var _0x571f7=_[_0x9cb0('0x31')](_0x5a8688);this[_0x9cb0('0x32')](_0x571f7);};Trigger[_0x9cb0('0x30')]['syncAgentDial']=function(_0x5e4675){if(this['agents'][_0x5e4675[_0x9cb0('0x35')]]){this[_0x9cb0('0x1c')](_0x5e4675);}};Trigger['prototype'][_0x9cb0('0x32')]=function(_0x26b7d5){var _0x3f0563;for(var _0x42d15f in this[_0x9cb0('0xd')]){if(this[_0x9cb0('0xd')][_0x9cb0('0x36')](_0x42d15f)){if(this[_0x9cb0('0xd')][_0x42d15f]['status']){_0x3f0563=this[_0x9cb0('0x37')](this[_0x9cb0('0xd')][_0x42d15f],_0x26b7d5);if(_0x3f0563){_[_0x9cb0('0x38')](_0x26b7d5,_0x26b7d5['variables']);for(var _0x1a4461=0x0,_0x27df76,_0x22137a,_0x14e669;_0x1a4461<this[_0x9cb0('0xd')][_0x42d15f]['Actions'][_0x9cb0('0x39')];_0x1a4461+=0x1){_0x27df76=this['triggers'][_0x42d15f]['Actions'][_0x1a4461];if(this[_0x9cb0('0xe')][_0x26b7d5[_0x9cb0('0x35')]]){switch(_0x27df76[_0x9cb0('0x3a')][_0x9cb0('0x3b')]()){case _0x9cb0('0x3c'):break;case _0x9cb0('0x3d'):case _0x9cb0('0x3e'):var _0x20c211={};switch(barAndWebActions[_0x27df76[_0x9cb0('0x3f')]]){case _0x9cb0('0xa'):_0x20c211[_0x9cb0('0x40')]=_0x27df76[_0x9cb0('0x41')];_0x20c211['html']=this['templates'][_0x27df76['data2']]?Mustache['render'](this[_0x9cb0('0x10')][_0x27df76['data2']]['html'],_0x26b7d5):_0x9cb0('0x42');break;case _0x9cb0('0xb'):_0x20c211['uri']=this['buildUri'](_0x27df76['data2'],_0x26b7d5,_[_0x9cb0('0x43')](_0x27df76[_0x9cb0('0x44')])?!![]:parseInt(_0x27df76[_0x9cb0('0x44')],0xa));if(_[_0x9cb0('0x43')](_0x27df76[_0x9cb0('0x45')])){_0x20c211[_0x9cb0('0x46')]='0';}else{_0x20c211['uriLocation']=_0x27df76['data4'];_0x20c211[_0x9cb0('0x47')]=_[_0x9cb0('0x43')](_0x27df76[_0x9cb0('0x48')])?_0x9cb0('0x49'):_0x27df76[_0x9cb0('0x48')];_0x20c211[_0x9cb0('0x4a')]=_[_0x9cb0('0x43')](_0x27df76[_0x9cb0('0x4b')])?_0x9cb0('0x4c'):_0x27df76[_0x9cb0('0x4b')];}break;case'winapp':_0x20c211[_0x9cb0('0x4d')]=_0x27df76[_0x9cb0('0x41')]?Mustache['render'](_0x27df76[_0x9cb0('0x41')],_0x26b7d5):'';_0x20c211[_0x9cb0('0x4e')]=_0x27df76['data3']?Mustache[_0x9cb0('0x4f')](_0x27df76['data3'],_0x26b7d5):'';break;}this[_0x9cb0('0x2d')](util[_0x9cb0('0x50')]('user:%s',this[_0x9cb0('0xe')][_0x26b7d5[_0x9cb0('0x35')]][_0x9cb0('0x51')]),util[_0x9cb0('0x50')](_0x9cb0('0x52'),_0x27df76[_0x9cb0('0x3a')][_0x9cb0('0x3b')](),barAndWebActions[_0x27df76['data1']]),_[_0x9cb0('0x38')](_0x20c211,_0x26b7d5));break;case _0x9cb0('0x53'):this[_0x9cb0('0x2d')](util['format'](_0x9cb0('0x54'),this[_0x9cb0('0xe')][_0x26b7d5[_0x9cb0('0x35')]][_0x9cb0('0x51')]),util[_0x9cb0('0x50')](_0x9cb0('0x55'),_0x27df76[_0x9cb0('0x3a')][_0x9cb0('0x3b')]()),_['merge']({'ProjectId':parseInt(_0x27df76[_0x9cb0('0x3f')],0xa)},_0x26b7d5));break;default:this[_0x9cb0('0x2d')](util[_0x9cb0('0x50')](_0x9cb0('0x54'),this[_0x9cb0('0xe')][_0x26b7d5['interface']][_0x9cb0('0x51')]),util[_0x9cb0('0x50')](_0x9cb0('0x55'),_0x27df76[_0x9cb0('0x3a')][_0x9cb0('0x3b')]()),_[_0x9cb0('0x38')]({},_0x27df76,_0x26b7d5));}}switch(_0x27df76[_0x9cb0('0x3a')]['toLowerCase']()){case'contactmanager':cmContact[_0x9cb0('0x56')](this[_0x9cb0('0xe')][_0x26b7d5[_0x9cb0('0x35')]],_0x27df76,_0x26b7d5,cmContactRpc);break;case _0x9cb0('0x57'):integration['exec'](_0x27df76,_0x26b7d5,this[_0x9cb0('0x58')],this[_0x9cb0('0xe')][_0x26b7d5[_0x9cb0('0x35')]],this['voiceQueues'][_0x26b7d5[_0x9cb0('0x59')]],this['voiceExtensions'][_0x26b7d5['routeId']]);break;case _0x9cb0('0x5a'):urlforward[_0x9cb0('0x56')](_0x27df76,_0x26b7d5);break;case _0x9cb0('0x5b'):script[_0x9cb0('0x56')](_0x27df76,_0x26b7d5);break;}}}}}}};Trigger['prototype']['buildUri']=function(_0x74243b,_0x27faa3,_0xdce58d){var _0x2cf243=url[_0x9cb0('0x5c')](Mustache[_0x9cb0('0x4f')](_0x74243b,_0x27faa3),!![]);if(_0xdce58d){_[_0x9cb0('0x38')](_0x2cf243[_0x9cb0('0x5d')],_0x27faa3);}delete _0x2cf243['search'];var _0x3e249d=url['format'](_0x2cf243);_0x3e249d=_0x3e249d[_0x9cb0('0x5e')](/\/\?/g,'?');return _0x3e249d;};Trigger[_0x9cb0('0x30')][_0x9cb0('0x37')]=function(_0x9a040e,_0x21583d){var _0x35fb17=!![],_0x2cefd4=!![];if(_0x9a040e[_0x9cb0('0x5f')][_0x9cb0('0x39')]){_0x35fb17=_['every'](_0x9a040e[_0x9cb0('0x5f')],this[_0x9cb0('0x60')](_0x21583d,_0x9a040e['channel']));}if(_0x9a040e[_0x9cb0('0x61')][_0x9cb0('0x39')]){_0x2cefd4=_[_0x9cb0('0x62')](_0x9a040e[_0x9cb0('0x61')],this['checkConditions'](_0x21583d,_0x9a040e[_0x9cb0('0x63')]));}return _0x35fb17&&_0x2cefd4;};Trigger['prototype']['checkConditions']=function(_0x522ab4,_0x5f499c){return function(_0x122916){switch(_0x122916[_0x9cb0('0x64')]){case _0x9cb0('0x65'):if(_0x522ab4[_0x9cb0('0x63')]===_0x5f499c){if(_0x5f499c==='chat'){return _0x522ab4[_0x9cb0('0x66')]?operators[_0x122916[_0x9cb0('0x67')]](Number(_0x122916[_0x9cb0('0x68')]),_0x522ab4[_0x9cb0('0x66')]):![];}else{return _0x522ab4[_[_0x9cb0('0x69')](_0x5f499c)+'AccountId']?operators[_0x122916[_0x9cb0('0x67')]](Number(_0x122916['value']),_0x522ab4[_['upperFirst'](_0x5f499c)+'AccountId']):![];}}break;case _0x9cb0('0x6a'):case _0x9cb0('0x6b'):if(_0x522ab4[_0x9cb0('0x63')]===_0x5f499c){return _0x522ab4[_0x9cb0('0x6c')]?operators[_0x122916[_0x9cb0('0x67')]](_0x122916[_0x9cb0('0x68')],_0x522ab4[_0x9cb0('0x6c')]):![];}break;case _0x9cb0('0x59'):return _0x522ab4[_0x9cb0('0x59')]?operators[_0x122916['operator']](_0x122916[_0x9cb0('0x68')],_0x522ab4[_0x9cb0('0x59')]):![];case _0x9cb0('0x6d'):return _0x522ab4[_0x9cb0('0x6e')]?operators[_0x122916['operator']](_0x122916[_0x9cb0('0x68')],_0x522ab4[_0x9cb0('0x6e')]):![];case _0x9cb0('0x6f'):return _0x522ab4[_0x9cb0('0x6f')]?operators[_0x122916[_0x9cb0('0x67')]](_0x122916['value'],_0x522ab4['lastevent']):![];case _0x9cb0('0x70'):return _0x522ab4[_0x9cb0('0x70')]?operators[_0x122916['operator']](_0x122916['value'],_0x522ab4[_0x9cb0('0x70')]):![];}return![];};};module[_0x9cb0('0x71')]=Trigger;
\ No newline at end of file
+var _0x93cc=['winArguments','format','user:%s','name','trigger:%s:%s','action','jscripty','trigger:%s','exec','integration','accounts','queue','urlforward','parse','search','AllConditions','length','checkConditions','channel','AnyConditions','some','account','chat','ChatWebsiteId','value','upperFirst','operator','AccountId','interaction','message','event','agent','membername','lastevent','routeId','exports','lodash','mustache','ioredis','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','log','SYNCCUSTOMNEW!!!','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','Actions','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','windowHeight','600','data6','winApplication'];(function(_0x382946,_0x52c2a1){var _0x21ed2c=function(_0x529a94){while(--_0x529a94){_0x382946['push'](_0x382946['shift']());}};_0x21ed2c(++_0x52c2a1);}(_0x93cc,0x116));var _0xc93c=function(_0x5e0ef5,_0xd6da15){_0x5e0ef5=_0x5e0ef5-0x0;var _0x5e6ac4=_0x93cc[_0x5e0ef5];return _0x5e6ac4;};'use strict';var util=require('util');var _=require(_0xc93c('0x0'));var url=require('url');var Mustache=require(_0xc93c('0x1'));var Redis=require(_0xc93c('0x2'));var urlforward=require('./urlforward');var integration=require(_0xc93c('0x3'));var cmContact=require(_0xc93c('0x4'));var script=require(_0xc93c('0x5'));var cmContactRpc=require('../rpc/cmContact');var config=require(_0xc93c('0x6'));var logger=require(_0xc93c('0x7'))(_0xc93c('0x8'));var ami=require(_0xc93c('0x9'));config[_0xc93c('0xa')]=_[_0xc93c('0xb')](config[_0xc93c('0xa')],{'host':_0xc93c('0xc'),'port':0x18eb});var io=require(_0xc93c('0xd'))(new Redis(config[_0xc93c('0xa')]));var operators={'equals':function(_0x41aa41,_0x2f1929){return _0x41aa41==_0x2f1929;},'not_equals':function(_0x4a71d3,_0x176879){return _0x4a71d3!=_0x176879;}};var barAndWebActions=[_0xc93c('0xe'),_0xc93c('0xf'),_0xc93c('0x10')];function Trigger(_0x3e01a9){this[_0xc93c('0x11')]=_0x3e01a9[_0xc93c('0x11')];this['agents']=_0x3e01a9[_0xc93c('0x12')];this['voiceQueues']=_0x3e01a9[_0xc93c('0x13')];this[_0xc93c('0x14')]=_0x3e01a9[_0xc93c('0x14')];this[_0xc93c('0x15')]=_0x3e01a9['voiceExtensions'];this[_0xc93c('0x16')]=_0x3e01a9[_0xc93c('0x16')];this[_0xc93c('0x17')]=_0x3e01a9[_0xc93c('0x17')];this[_0xc93c('0x18')]=_0x3e01a9[_0xc93c('0x18')];this['sugarcrmAccounts']=_0x3e01a9[_0xc93c('0x19')];this[_0xc93c('0x1a')]=_0x3e01a9[_0xc93c('0x1a')];this[_0xc93c('0x1b')]=_0x3e01a9[_0xc93c('0x1b')];this[_0xc93c('0x1c')]=_0x3e01a9[_0xc93c('0x1c')];this['servicenowAccounts']=_0x3e01a9['servicenowAccounts'];this['dynamics365Accounts']=_0x3e01a9[_0xc93c('0x1d')];this[_0xc93c('0x1e')]=_0x3e01a9['freshsalesAccounts'];this['accounts']={'zendesk':this[_0xc93c('0x16')],'salesforce':this[_0xc93c('0x18')],'freshdesk':this[_0xc93c('0x17')],'sugarcrm':this[_0xc93c('0x19')],'zoho':this['zohoAccounts'],'desk':this[_0xc93c('0x1b')],'vtiger':this[_0xc93c('0x1c')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xc93c('0x1e')],'servicenow':this[_0xc93c('0x1f')]};ami['on'](_0xc93c('0x20'),this[_0xc93c('0x21')]['bind'](this));ami['on'](_0xc93c('0x22'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x24'),this['syncCustomEvent'][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x25'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x26'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x27'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x28'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x29'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on']('custom:timeout',this[_0xc93c('0x21')]['bind'](this));ami['on']('custom:dialbegin',this[_0xc93c('0x2a')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x2b'),this[_0xc93c('0x2a')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x2c'),this[_0xc93c('0x2a')]['bind'](this));ami['on'](_0xc93c('0x2d'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x2e'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x2f'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x30'),this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on']('custom:acceptmessage',this[_0xc93c('0x21')][_0xc93c('0x23')](this));ami['on'](_0xc93c('0x31'),this[_0xc93c('0x21')]['bind'](this));}Trigger[_0xc93c('0x32')][_0xc93c('0x33')]=function(_0xc2e021,_0x3cfef9,_0x4c7d5e){logger[_0xc93c('0x34')](_0xc2e021,_0x3cfef9,JSON[_0xc93c('0x35')](_0x4c7d5e));io['to'](_0xc2e021)[_0xc93c('0x33')](_0x3cfef9,_0x4c7d5e);};Trigger['prototype']['syncCustomEvent']=function(_0x5b4f23){var _0x43f554=_[_0xc93c('0x36')](_0x5b4f23);this['checkTriggers'](_0x43f554);};Trigger[_0xc93c('0x32')]['syncCustomEventNew']=function(_0x81ee){console[_0xc93c('0x37')](_0xc93c('0x38'),_0x81ee);var _0x581ffc=_[_0xc93c('0x36')](_0x81ee);this[_0xc93c('0x39')](_0x581ffc);};Trigger[_0xc93c('0x32')][_0xc93c('0x2a')]=function(_0x28d318){if(this[_0xc93c('0x12')][_0x28d318[_0xc93c('0x3a')]]){this['syncCustomEvent'](_0x28d318);}};Trigger[_0xc93c('0x32')][_0xc93c('0x39')]=function(_0x3aeb8c){var _0x350b2b;for(var _0x4be143 in this[_0xc93c('0x11')]){if(this['triggers'][_0xc93c('0x3b')](_0x4be143)){if(this[_0xc93c('0x11')][_0x4be143]['status']){_0x350b2b=this[_0xc93c('0x3c')](this[_0xc93c('0x11')][_0x4be143],_0x3aeb8c);if(_0x350b2b){_[_0xc93c('0x3d')](_0x3aeb8c,_0x3aeb8c['variables']);for(var _0x5393ab=0x0,_0x234865,_0x3a0351,_0x3f8721;_0x5393ab<this[_0xc93c('0x11')][_0x4be143][_0xc93c('0x3e')]['length'];_0x5393ab+=0x1){_0x234865=this[_0xc93c('0x11')][_0x4be143]['Actions'][_0x5393ab];if(this[_0xc93c('0x12')][_0x3aeb8c[_0xc93c('0x3a')]]){switch(_0x234865['action'][_0xc93c('0x3f')]()){case _0xc93c('0x40'):break;case _0xc93c('0x41'):case _0xc93c('0x42'):var _0x28b905={};switch(barAndWebActions[_0x234865[_0xc93c('0x43')]]){case _0xc93c('0xe'):_0x28b905[_0xc93c('0x44')]=_0x234865[_0xc93c('0x45')];_0x28b905[_0xc93c('0x46')]=this[_0xc93c('0x14')][_0x234865[_0xc93c('0x45')]]?Mustache[_0xc93c('0x47')](this[_0xc93c('0x14')][_0x234865[_0xc93c('0x45')]][_0xc93c('0x46')],_0x3aeb8c):'template\x20not\x20found';break;case _0xc93c('0xf'):_0x28b905[_0xc93c('0x48')]=this[_0xc93c('0x49')](_0x234865[_0xc93c('0x45')],_0x3aeb8c,_[_0xc93c('0x4a')](_0x234865['data3'])?!![]:parseInt(_0x234865[_0xc93c('0x4b')],0xa));if(_[_0xc93c('0x4a')](_0x234865['data4'])){_0x28b905[_0xc93c('0x4c')]='0';}else{_0x28b905[_0xc93c('0x4d')]=_0x234865[_0xc93c('0x4e')];_0x28b905[_0xc93c('0x4f')]=_[_0xc93c('0x4a')](_0x234865[_0xc93c('0x50')])?'800':_0x234865[_0xc93c('0x50')];_0x28b905[_0xc93c('0x51')]=_[_0xc93c('0x4a')](_0x234865['data6'])?_0xc93c('0x52'):_0x234865[_0xc93c('0x53')];}break;case _0xc93c('0x10'):_0x28b905[_0xc93c('0x54')]=_0x234865['data2']?Mustache[_0xc93c('0x47')](_0x234865['data2'],_0x3aeb8c):'';_0x28b905[_0xc93c('0x55')]=_0x234865[_0xc93c('0x4b')]?Mustache[_0xc93c('0x47')](_0x234865[_0xc93c('0x4b')],_0x3aeb8c):'';break;}this[_0xc93c('0x33')](util[_0xc93c('0x56')](_0xc93c('0x57'),this[_0xc93c('0x12')][_0x3aeb8c['interface']][_0xc93c('0x58')]),util[_0xc93c('0x56')](_0xc93c('0x59'),_0x234865[_0xc93c('0x5a')][_0xc93c('0x3f')](),barAndWebActions[_0x234865[_0xc93c('0x43')]]),_[_0xc93c('0x3d')](_0x28b905,_0x3aeb8c));break;case _0xc93c('0x5b'):this[_0xc93c('0x33')](util['format']('user:%s',this[_0xc93c('0x12')][_0x3aeb8c[_0xc93c('0x3a')]][_0xc93c('0x58')]),util[_0xc93c('0x56')]('trigger:%s',_0x234865[_0xc93c('0x5a')]['toLowerCase']()),_[_0xc93c('0x3d')]({'ProjectId':parseInt(_0x234865[_0xc93c('0x43')],0xa)},_0x3aeb8c));break;default:this[_0xc93c('0x33')](util['format'](_0xc93c('0x57'),this[_0xc93c('0x12')][_0x3aeb8c[_0xc93c('0x3a')]][_0xc93c('0x58')]),util[_0xc93c('0x56')](_0xc93c('0x5c'),_0x234865[_0xc93c('0x5a')][_0xc93c('0x3f')]()),_['merge']({},_0x234865,_0x3aeb8c));}}switch(_0x234865['action']['toLowerCase']()){case _0xc93c('0x40'):cmContact[_0xc93c('0x5d')](this[_0xc93c('0x12')][_0x3aeb8c[_0xc93c('0x3a')]],_0x234865,_0x3aeb8c,cmContactRpc);break;case _0xc93c('0x5e'):integration[_0xc93c('0x5d')](_0x234865,_0x3aeb8c,this[_0xc93c('0x5f')],this[_0xc93c('0x12')][_0x3aeb8c[_0xc93c('0x3a')]],this[_0xc93c('0x13')][_0x3aeb8c[_0xc93c('0x60')]],this[_0xc93c('0x15')][_0x3aeb8c['routeId']]);break;case _0xc93c('0x61'):urlforward[_0xc93c('0x5d')](_0x234865,_0x3aeb8c);break;case'script':script[_0xc93c('0x5d')](_0x234865,_0x3aeb8c);break;}}}}}}};Trigger[_0xc93c('0x32')][_0xc93c('0x49')]=function(_0x3edc4c,_0x277d9e,_0x2df2be){var _0x437a99=url[_0xc93c('0x62')](Mustache[_0xc93c('0x47')](_0x3edc4c,_0x277d9e),!![]);if(_0x2df2be){_[_0xc93c('0x3d')](_0x437a99['query'],_0x277d9e);}delete _0x437a99[_0xc93c('0x63')];var _0x4883e7=url[_0xc93c('0x56')](_0x437a99);_0x4883e7=_0x4883e7['replace'](/\/\?/g,'?');return _0x4883e7;};Trigger[_0xc93c('0x32')]['checkTrigger']=function(_0x1559ce,_0x5df8da){var _0x5d1c45=!![],_0xd2c253=!![];if(_0x1559ce[_0xc93c('0x64')][_0xc93c('0x65')]){_0x5d1c45=_['every'](_0x1559ce[_0xc93c('0x64')],this[_0xc93c('0x66')](_0x5df8da,_0x1559ce[_0xc93c('0x67')]));}if(_0x1559ce[_0xc93c('0x68')][_0xc93c('0x65')]){_0xd2c253=_[_0xc93c('0x69')](_0x1559ce[_0xc93c('0x68')],this[_0xc93c('0x66')](_0x5df8da,_0x1559ce['channel']));}return _0x5d1c45&&_0xd2c253;};Trigger[_0xc93c('0x32')][_0xc93c('0x66')]=function(_0xb43fc1,_0xafcb58){return function(_0x232933){switch(_0x232933['field']){case _0xc93c('0x6a'):if(_0xb43fc1[_0xc93c('0x67')]===_0xafcb58){if(_0xafcb58===_0xc93c('0x6b')){return _0xb43fc1[_0xc93c('0x6c')]?operators[_0x232933['operator']](Number(_0x232933[_0xc93c('0x6d')]),_0xb43fc1[_0xc93c('0x6c')]):![];}else{return _0xb43fc1[_[_0xc93c('0x6e')](_0xafcb58)+'AccountId']?operators[_0x232933[_0xc93c('0x6f')]](Number(_0x232933[_0xc93c('0x6d')]),_0xb43fc1[_[_0xc93c('0x6e')](_0xafcb58)+_0xc93c('0x70')]):![];}}break;case _0xc93c('0x71'):case _0xc93c('0x72'):if(_0xb43fc1[_0xc93c('0x67')]===_0xafcb58){return _0xb43fc1[_0xc93c('0x73')]?operators[_0x232933[_0xc93c('0x6f')]](_0x232933[_0xc93c('0x6d')],_0xb43fc1[_0xc93c('0x73')]):![];}break;case _0xc93c('0x60'):return _0xb43fc1['queue']?operators[_0x232933[_0xc93c('0x6f')]](_0x232933[_0xc93c('0x6d')],_0xb43fc1[_0xc93c('0x60')]):![];case _0xc93c('0x74'):return _0xb43fc1[_0xc93c('0x75')]?operators[_0x232933[_0xc93c('0x6f')]](_0x232933[_0xc93c('0x6d')],_0xb43fc1[_0xc93c('0x75')]):![];case _0xc93c('0x76'):return _0xb43fc1['lastevent']?operators[_0x232933[_0xc93c('0x6f')]](_0x232933[_0xc93c('0x6d')],_0xb43fc1['lastevent']):![];case _0xc93c('0x77'):return _0xb43fc1[_0xc93c('0x77')]?operators[_0x232933[_0xc93c('0x6f')]](_0x232933[_0xc93c('0x6d')],_0xb43fc1['routeId']):![];}return![];};};module[_0xc93c('0x78')]=Trigger;
\ No newline at end of file
index c6f700c..dc70688 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','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','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});};
\ No newline at end of file
+var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','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','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});};
\ No newline at end of file
index 1580d69..23f61ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4266=['Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','outbound','calleridnum','contacts','/systemusers(','odata-entityid','lastIndexOf','enduserId','message','GET','contacts?$select=telephone1','destcalleridnum','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','substring','indexOf','content','ticketType','getString','Subjects','/contacts(','Fields','phonecall','assign','Descriptions','callDirection','queue','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid'];(function(_0x3db39b,_0x44dc1f){var _0x441ad3=function(_0x5eff1a){while(--_0x5eff1a){_0x3db39b['push'](_0x3db39b['shift']());}};_0x441ad3(++_0x44dc1f);}(_0x4266,0x10a));var _0x6426=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x4266[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x6426('0x0'));var BPromise=require('bluebird');var rp=require(_0x6426('0x1'));var util=require(_0x6426('0x2'));var intUtil=require(_0x6426('0x3'));var md5=require(_0x6426('0x4'));var Redis=require(_0x6426('0x5'));var logger=require(_0x6426('0x6'))(_0x6426('0x7'));var config=require('../../../../config/environment');config[_0x6426('0x8')]=_['defaults'](config[_0x6426('0x8')],{'host':_0x6426('0x9'),'port':0x18eb});var io=require(_0x6426('0xa'))(new Redis(config[_0x6426('0x8')]));function getAuthToken(_0x1f3830,_0x70dee,_0x3e38ee){var _0xf996da={'method':_0x6426('0xb'),'uri':_0x70dee,'form':{'client_id':_0x1f3830['clientId'],'resource':_0x1f3830[_0x6426('0xc')],'username':_0x1f3830[_0x6426('0xd')],'password':_0x1f3830[_0x6426('0xe')],'grant_type':_0x6426('0xe'),'client_secret':_0x1f3830[_0x6426('0xf')]},'json':!![]};return rp(_0xf996da)[_0x6426('0x10')](function(_0x2e44b4){return _0x2e44b4[_0x6426('0x11')];})[_0x6426('0x12')](function(_0xa1d836){logger['error']('['+[_0x3e38ee[_0x6426('0x13')]()]+_0x6426('0x14'));return _0xa1d836['message'];});}function getUser(_0x3ec0f3,_0x266fd0,_0x29ea5f,_0x30929c,_0xc236a4,_0x46c628){return new BPromise(function(_0xec390c,_0x1d3539){return getAuthToken(_0x266fd0,_0x30929c,_0x46c628)[_0x6426('0x10')](function(_0x5a49a6){var _0x204c38={'method':'GET','uri':_0xc236a4+_0x6426('0x15'),'headers':{'Authorization':_0x6426('0x16')+_0x5a49a6,'OData-Version':_0x6426('0x17')},'json':!![]};return rp(_0x204c38);})[_0x6426('0x10')](function(_0x3583a0){var _0x5aff96=_0x3583a0[_0x6426('0x18')];var _0x5784b4=![];var _0x3ba3e6=null;if(!_['isNil'](_0x29ea5f)){if(intUtil[_0x6426('0x19')](_0x29ea5f[_0x6426('0x1a')])){_0x3ec0f3[_0x6426('0x1b')]=_0x29ea5f['email'];for(_0x3ba3e6=0x0;_0x3ba3e6<_0x5aff96[_0x6426('0x1c')];_0x3ba3e6++){if(_0x5aff96[_0x3ba3e6][_0x6426('0x1d')]===_0x29ea5f['email']&&!_0x5aff96[_0x3ba3e6][_0x6426('0x1e')]){_0x5784b4=!![];logger[_0x6426('0x1f')]('['+[_0x46c628[_0x6426('0x13')]()]+_0x6426('0x20')+_0x5aff96[_0x3ba3e6][_0x6426('0x21')]+'!');_0x3ec0f3['userId']=_0x5aff96[_0x3ba3e6][_0x6426('0x21')];}}}}if(!_0x5784b4){logger[_0x6426('0x1f')]('['+[_0x46c628[_0x6426('0x13')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3ec0f3[_0x6426('0x1b')]=_0x266fd0[_0x6426('0xd')];for(_0x3ba3e6=0x0;_0x3ba3e6<_0x5aff96[_0x6426('0x1c')];_0x3ba3e6++){if(_0x5aff96[_0x3ba3e6][_0x6426('0x1d')]===_0x266fd0['username']){_0x3ec0f3[_0x6426('0x22')]=_0x5aff96[_0x3ba3e6][_0x6426('0x21')];}}}_0xec390c(_0x3ec0f3);})['catch'](function(_0x1d4392){_0x1d3539(_0x1d4392['message']);});});}function createEndUser(_0x5c86a0,_0x4ab886,_0x9e27c8,_0x5b608b,_0x4e9747,_0x4cd861){return new BPromise(function(_0x5074b2,_0x571495){return getAuthToken(_0x4ab886,_0x9e27c8,_0x4cd861)[_0x6426('0x10')](function(_0x516de9){var _0x53025d=_0x4cd861[_0x6426('0x23')]()===_0x6426('0x24')?_0x4e9747['destcalleridnum']:_0x4e9747[_0x6426('0x25')];var _0x5adff3={'method':_0x6426('0xb'),'uri':_0x5b608b+_0x6426('0x26'),'body':{'telephone1':_0x53025d,'fullname':_0x53025d,'firstname':_0x53025d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6426('0x27')+_0x5c86a0[_0x6426('0x22')]+')'},'headers':{'Authorization':_0x6426('0x16')+_0x516de9,'OData-Version':_0x6426('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5adff3);})['then'](function(_0x3fa27c){var _0x5129c4=_0x3fa27c['headers'][_0x6426('0x28')];var _0x258259=_0x5129c4['substring'](_0x5129c4[_0x6426('0x29')]('(')+0x1,_0x5129c4['lastIndexOf'](')'));_0x5c86a0[_0x6426('0x2a')]=_0x258259;_0x5074b2(_0x5c86a0);})[_0x6426('0x12')](function(_0x98295f){_0x571495(_0x98295f[_0x6426('0x2b')]);});});}function getEndUser(_0x9d647a,_0x5461f2,_0x55e8ba,_0x3ae040,_0x12f863,_0x548633){return new BPromise(function(_0x286275,_0x49f1f3){return getAuthToken(_0x5461f2,_0x55e8ba,_0x548633)[_0x6426('0x10')](function(_0x5f0cdb){var _0x379c90={'method':_0x6426('0x2c'),'uri':_0x3ae040+_0x6426('0x2d'),'headers':{'Authorization':_0x6426('0x16')+_0x5f0cdb,'If-None-Match':null,'OData-Version':_0x6426('0x17')},'json':!![]};return rp(_0x379c90);})['then'](function(_0x14693a){var _0x306463=null;if(_0x14693a){var _0x5eed69=_0x14693a[_0x6426('0x18')];var _0x2dc39a=![];for(_0x306463=0x0;_0x306463<_0x5eed69['length'];_0x306463++){var _0x2349d5=_0x548633[_0x6426('0x23')]()===_0x6426('0x24')?_0x12f863[_0x6426('0x2e')]:_0x12f863[_0x6426('0x25')];if(_0x5eed69[_0x306463][_0x6426('0x2f')]===_0x2349d5){_0x2dc39a=!![];_0x9d647a['enduserId']=_0x5eed69[_0x306463][_0x6426('0x30')];}}if(_0x2dc39a){_0x286275(_0x9d647a);}else{return createEndUser(_0x9d647a,_0x5461f2,_0x55e8ba,_0x3ae040,_0x12f863,_0x548633)['then'](function(_0x2c7591){logger['info']('['+[_0x548633[_0x6426('0x13')]()]+_0x6426('0x31'),_0x2c7591[_0x6426('0x2a')]);_0x286275(_0x2c7591);});}}else{return createEndUser(_0x9d647a,_0x5461f2,_0x55e8ba,_0x3ae040,_0x12f863,_0x548633)[_0x6426('0x10')](function(_0x54a4ff){logger[_0x6426('0x1f')]('['+[_0x548633['toUpperCase']()]+_0x6426('0x32'),_0x54a4ff['enduserId']);_0x286275(_0x54a4ff);});}});});}function getCustomFields(_0x326796,_0xf9552d,_0x4041f8){var _0x839f6={};if(_0x326796[_0x6426('0x1c')]>0x0){_[_0x6426('0x33')](_0x326796,function(_0x1dda3c){if(_0x1dda3c[_0x6426('0x34')]===_0x6426('0x35')&&_0x1dda3c[_0x6426('0x36')]&&!_0x1dda3c[_0x6426('0x37')]){var _0x3f3262=_0x1dda3c[_0x6426('0x38')][_0x6426('0x23')]();var _0x11a8d3=_0x3f3262[_0x6426('0x39')](0x0,_0x3f3262[_0x6426('0x3a')]('_'));var _0x23eeea=_0x3f3262[_0x6426('0x39')](_0x3f3262[_0x6426('0x3a')]('_')+0x1);if(_0x11a8d3===_0x4041f8){_0x839f6[_0x23eeea]=_0x1dda3c[_0x6426('0x3b')];}}});}return _0x839f6;}function getTicket(_0x15f954,_0x22bede,_0x32c312,_0x51cc7a,_0x550aaf,_0x7811ad,_0x20bb1a){return new BPromise(function(_0x205e20,_0x19aaf6){var _0x52d2fc;return getAuthToken(_0x22bede,_0x32c312,_0x20bb1a)[_0x6426('0x10')](function(_0x2d1f22){if(_0x7811ad[_0x6426('0x3c')]==='incident'){_0x52d2fc={'method':_0x6426('0xb'),'uri':_0x51cc7a+'incidents','body':Object['assign']({},{'title':intUtil[_0x6426('0x3d')](_0x7811ad[_0x6426('0x3e')],_0x550aaf,'\x20'),'description':intUtil['getString'](_0x7811ad['Descriptions'],_0x550aaf,'\x0a'),'customerid_contact@odata.bind':_0x6426('0x3f')+_0x15f954['enduserId']+')','ownerid@odata.bind':_0x6426('0x27')+_0x15f954[_0x6426('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x7811ad[_0x6426('0x40')],_0x550aaf,_0x7811ad[_0x6426('0x3c')])),'headers':{'Authorization':_0x6426('0x16')+_0x2d1f22,'OData-Version':_0x6426('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x7811ad['ticketType']===_0x6426('0x41')){_0x52d2fc={'method':_0x6426('0xb'),'uri':_0x51cc7a+'phonecalls','body':Object[_0x6426('0x42')]({},{'subject':intUtil['getString'](_0x7811ad['Subjects'],_0x550aaf,'\x20'),'phonenumber':String(_0x550aaf[_0x6426('0x25')]),'description':intUtil[_0x6426('0x3d')](_0x7811ad[_0x6426('0x43')],_0x550aaf,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6426('0x3f')+_0x15f954[_0x6426('0x2a')]+')','ownerid@odata.bind':_0x6426('0x27')+_0x15f954[_0x6426('0x22')]+')','directioncode':_0x15f954[_0x6426('0x44')]===_0x6426('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6426('0x27')+_0x15f954['userId']+')','participationtypemask':_0x15f954[_0x6426('0x44')]===_0x6426('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x6426('0x3f')+_0x15f954[_0x6426('0x2a')]+')','participationtypemask':_0x15f954[_0x6426('0x44')]==='queue'?0x1:0x2}]},getCustomFields(_0x7811ad['Fields'],_0x550aaf,_0x7811ad[_0x6426('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x2d1f22,'OData-Version':_0x6426('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x52d2fc);})[_0x6426('0x10')](function(_0x1adb19){var _0xbc08de=_0x1adb19[_0x6426('0x46')]['odata-entityid'];var _0x1d0e54=_0xbc08de[_0x6426('0x39')](_0xbc08de['lastIndexOf']('(')+0x1,_0xbc08de[_0x6426('0x29')](')'));_0x15f954[_0x6426('0x47')]=_0x1d0e54;_0x205e20(_0x15f954);})['catch'](function(_0x4fe2f5){_0x19aaf6(_0x4fe2f5[_0x6426('0x2b')]);});});}function emit(_0x1771cc,_0x3cf107,_0x468d18,_0x5eecbf){var _0xe1f820={'uri':util[_0x6426('0x48')](_0x6426('0x49'),_0x1771cc,_0x468d18,_0x5eecbf)};io['to'](util[_0x6426('0x48')](_0x6426('0x4a'),_0x3cf107))[_0x6426('0x4b')](_0x6426('0x4c'),_0xe1f820);}exports['cs']=function(_0x59a0c5,_0x3c382c,_0x33fdb4,_0x3b4519,_0x59a50a,_0x27d7aa,_0x55d9e1,_0x3b8423){var _0x380341={};_0x27d7aa[_0x6426('0xc')]=intUtil[_0x6426('0x4d')](_0x27d7aa[_0x6426('0xc')]);_0x27d7aa['serverUrl']=intUtil[_0x6426('0x4d')](_0x27d7aa[_0x6426('0x4e')]);_0x380341[_0x6426('0x44')]=_0x3b8423===_0x6426('0x45')||_0x3b8423===_0x6426('0x4f')?'queue':_0x6426('0x24');var _0x26b5cd=util[_0x6426('0x48')]('%s/api/data/v9.0/',_0x27d7aa[_0x6426('0xc')]);var _0x45bea8=util[_0x6426('0x48')]('https://login.microsoftonline.com/%s/oauth2/token',_0x27d7aa['tenantId']);var _0x4049ee=util[_0x6426('0x48')](_0x6426('0x50'),_0x27d7aa[_0x6426('0x4e')],_0x3c382c[_0x6426('0x51')],md5(_0x3c382c[_0x6426('0x51')]));if(_0x59a50a&&_0x59a50a[_0x6426('0x52')]){logger[_0x6426('0x1f')](_0x6426('0x53'),'Recording\x20is\x20enabled!');_0x3c382c[_0x6426('0x54')]=_0x4049ee;}else if(_0x55d9e1&&_0x55d9e1[_0x6426('0x55')]&&_0x55d9e1[_0x6426('0x55')]!==_0x6426('0x56')){logger[_0x6426('0x1f')]('[OUTBOUND]',_0x6426('0x57'));_0x3c382c[_0x6426('0x54')]=_0x4049ee;}else{_0x3c382c[_0x6426('0x54')]='';}return getUser(_0x380341,_0x27d7aa,_0x3b4519,_0x45bea8,_0x26b5cd,_0x3b8423)[_0x6426('0x10')](function(_0x19c570){logger[_0x6426('0x1f')]('['+_0x3b8423['toUpperCase']()+_0x6426('0x58'),_0x19c570[_0x6426('0x22')]);logger[_0x6426('0x1f')]('['+_0x3b8423[_0x6426('0x13')]()+_0x6426('0x59'),_0x19c570['userEmail']);return getEndUser(_0x19c570,_0x27d7aa,_0x45bea8,_0x26b5cd,_0x3c382c,_0x3b8423);})['then'](function(_0x3592c7){logger[_0x6426('0x1f')]('['+_0x3b8423[_0x6426('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3592c7[_0x6426('0x2a')]);logger['info']('['+_0x3b8423[_0x6426('0x13')]()+_0x6426('0x5a'),_0x3c382c[_0x6426('0x25')]);return getTicket(_0x3592c7,_0x27d7aa,_0x45bea8,_0x26b5cd,_0x3c382c,_0x33fdb4,_0x3b8423);})[_0x6426('0x10')](function(_0x2570ce){logger[_0x6426('0x1f')](util[_0x6426('0x48')]('['+_0x3b8423[_0x6426('0x13')]()+_0x6426('0x5b'),_0x33fdb4[_0x6426('0x3c')],_0x2570ce[_0x6426('0x47')]));logger['info'](util[_0x6426('0x48')]('['+_0x3b8423['toUpperCase']()+_0x6426('0x5c'),_0x3b8423));if(_0x3b8423!==_0x6426('0x4f')){logger[_0x6426('0x1f')]('['+_0x3b8423[_0x6426('0x13')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x27d7aa['remoteUri'],_0x3b4519['name'],_0x33fdb4[_0x6426('0x3c')],_0x2570ce['ticketId']);}})[_0x6426('0x12')](function(_0x4d9d30){logger[_0x6426('0x5d')]('['+_0x3b8423[_0x6426('0x13')]()+_0x6426('0x5e'),util[_0x6426('0x5f')](_0x4d9d30,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x1521=['content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','destcalleridnum','calleridnum','/systemusers(','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1','toLowerCase','outbound','telephone1',']\x20Enduser\x20created!','string','nameField','customField','idField','indexOf'];(function(_0x2e7a43,_0x3b3df4){var _0x52e9e1=function(_0x2c08cf){while(--_0x2c08cf){_0x2e7a43['push'](_0x2e7a43['shift']());}};_0x52e9e1(++_0x3b3df4);}(_0x1521,0x19d));var _0x1152=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x1521[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0x1152('0x0'));var BPromise=require(_0x1152('0x1'));var rp=require('request-promise');var util=require(_0x1152('0x2'));var intUtil=require(_0x1152('0x3'));var md5=require(_0x1152('0x4'));var Redis=require(_0x1152('0x5'));var logger=require(_0x1152('0x6'))(_0x1152('0x7'));var config=require(_0x1152('0x8'));config[_0x1152('0x9')]=_[_0x1152('0xa')](config[_0x1152('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1152('0xb'))(new Redis(config[_0x1152('0x9')]));function getAuthToken(_0x340eae,_0x23a150,_0x25e0de){var _0x446b6b={'method':_0x1152('0xc'),'uri':_0x23a150,'form':{'client_id':_0x340eae[_0x1152('0xd')],'resource':_0x340eae[_0x1152('0xe')],'username':_0x340eae[_0x1152('0xf')],'password':_0x340eae[_0x1152('0x10')],'grant_type':_0x1152('0x10'),'client_secret':_0x340eae[_0x1152('0x11')]},'json':!![]};return rp(_0x446b6b)[_0x1152('0x12')](function(_0x1b193c){return _0x1b193c[_0x1152('0x13')];})[_0x1152('0x14')](function(_0x449070){logger[_0x1152('0x15')]('['+[_0x25e0de[_0x1152('0x16')]()]+']\x20Wrong\x20credentials!');return _0x449070[_0x1152('0x17')];});}function getUser(_0x47853f,_0x8bea0b,_0x2e2e7a,_0x56b5f8,_0x564438,_0x3c992d){return new BPromise(function(_0x1a653b,_0x34573e){return getAuthToken(_0x8bea0b,_0x56b5f8,_0x3c992d)[_0x1152('0x12')](function(_0x29d963){var _0x2468ae={'method':'GET','uri':_0x564438+_0x1152('0x18'),'headers':{'Authorization':_0x1152('0x19')+_0x29d963,'OData-Version':'4.0'},'json':!![]};return rp(_0x2468ae);})[_0x1152('0x12')](function(_0x1947f9){var _0x5977ae=_0x1947f9[_0x1152('0x1a')];var _0x6a305c=![];var _0x4eb8ac=null;if(!_['isNil'](_0x2e2e7a)){if(intUtil['validateEmail'](_0x2e2e7a[_0x1152('0x1b')])){_0x47853f[_0x1152('0x1c')]=_0x2e2e7a[_0x1152('0x1b')];for(_0x4eb8ac=0x0;_0x4eb8ac<_0x5977ae[_0x1152('0x1d')];_0x4eb8ac++){if(_0x5977ae[_0x4eb8ac][_0x1152('0x1e')]===_0x2e2e7a['email']&&!_0x5977ae[_0x4eb8ac][_0x1152('0x1f')]){_0x6a305c=!![];logger['info']('['+[_0x3c992d['toUpperCase']()]+_0x1152('0x20')+_0x5977ae[_0x4eb8ac][_0x1152('0x21')]+'!');_0x47853f[_0x1152('0x22')]=_0x5977ae[_0x4eb8ac][_0x1152('0x21')];}}}}if(!_0x6a305c){logger[_0x1152('0x23')]('['+[_0x3c992d[_0x1152('0x16')]()]+_0x1152('0x24'));_0x47853f[_0x1152('0x1c')]=_0x8bea0b['username'];for(_0x4eb8ac=0x0;_0x4eb8ac<_0x5977ae[_0x1152('0x1d')];_0x4eb8ac++){if(_0x5977ae[_0x4eb8ac][_0x1152('0x1e')]===_0x8bea0b[_0x1152('0xf')]){_0x47853f[_0x1152('0x22')]=_0x5977ae[_0x4eb8ac][_0x1152('0x21')];}}}_0x1a653b(_0x47853f);})[_0x1152('0x14')](function(_0x45c7cb){_0x34573e(_0x45c7cb[_0x1152('0x17')]);});});}function createEndUser(_0x48e542,_0x23d635,_0x27be86,_0x24ec50,_0x39ca60,_0x5cf272){return new BPromise(function(_0x4f230d,_0x240c7b){return getAuthToken(_0x23d635,_0x27be86,_0x5cf272)[_0x1152('0x12')](function(_0x27e87d){var _0x43e81b=_0x5cf272['toLowerCase']()==='outbound'?_0x39ca60[_0x1152('0x25')]:_0x39ca60[_0x1152('0x26')];var _0x3aead2={'method':_0x1152('0xc'),'uri':_0x24ec50+'contacts','body':{'telephone1':_0x43e81b,'fullname':_0x43e81b,'firstname':_0x43e81b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1152('0x27')+_0x48e542[_0x1152('0x22')]+')'},'headers':{'Authorization':_0x1152('0x19')+_0x27e87d,'OData-Version':_0x1152('0x28')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3aead2);})[_0x1152('0x12')](function(_0xa5bec7){var _0x311600=_0xa5bec7[_0x1152('0x29')][_0x1152('0x2a')];var _0x4aa61f=_0x311600[_0x1152('0x2b')](_0x311600[_0x1152('0x2c')]('(')+0x1,_0x311600[_0x1152('0x2c')](')'));_0x48e542[_0x1152('0x2d')]=_0x4aa61f;_0x4f230d(_0x48e542);})[_0x1152('0x14')](function(_0x36a7ca){_0x240c7b(_0x36a7ca[_0x1152('0x17')]);});});}function getEndUser(_0x3040b9,_0x3ce4ef,_0x53b684,_0x44a4ec,_0x37427c,_0x442466){return new BPromise(function(_0x3b2b9c,_0x5f2330){return getAuthToken(_0x3ce4ef,_0x53b684,_0x442466)[_0x1152('0x12')](function(_0x59ccb7){var _0x1566f8={'method':_0x1152('0x2e'),'uri':_0x44a4ec+_0x1152('0x2f'),'headers':{'Authorization':_0x1152('0x19')+_0x59ccb7,'If-None-Match':null,'OData-Version':_0x1152('0x28')},'json':!![]};return rp(_0x1566f8);})['then'](function(_0x1cf070){var _0xdea7ef=null;if(_0x1cf070){var _0x43c7e9=_0x1cf070['value'];var _0x32f5d2=![];for(_0xdea7ef=0x0;_0xdea7ef<_0x43c7e9[_0x1152('0x1d')];_0xdea7ef++){var _0x160744=_0x442466[_0x1152('0x30')]()===_0x1152('0x31')?_0x37427c[_0x1152('0x25')]:_0x37427c['calleridnum'];if(_0x43c7e9[_0xdea7ef][_0x1152('0x32')]===_0x160744){_0x32f5d2=!![];_0x3040b9[_0x1152('0x2d')]=_0x43c7e9[_0xdea7ef]['contactid'];}}if(_0x32f5d2){_0x3b2b9c(_0x3040b9);}else{return createEndUser(_0x3040b9,_0x3ce4ef,_0x53b684,_0x44a4ec,_0x37427c,_0x442466)[_0x1152('0x12')](function(_0x18ad66){logger[_0x1152('0x23')]('['+[_0x442466['toUpperCase']()]+_0x1152('0x33'),_0x18ad66[_0x1152('0x2d')]);_0x3b2b9c(_0x18ad66);});}}else{return createEndUser(_0x3040b9,_0x3ce4ef,_0x53b684,_0x44a4ec,_0x37427c,_0x442466)['then'](function(_0x54bdfc){logger[_0x1152('0x23')]('['+[_0x442466[_0x1152('0x16')]()]+']\x20Enduser\x20Created!',_0x54bdfc[_0x1152('0x2d')]);_0x3b2b9c(_0x54bdfc);});}});});}function getCustomFields(_0x3c4908,_0x36fb6e,_0x81f75d){var _0x15ff2d={};if(_0x3c4908[_0x1152('0x1d')]>0x0){_['forEach'](_0x3c4908,function(_0x140bf0){if(_0x140bf0['type']===_0x1152('0x34')&&_0x140bf0[_0x1152('0x35')]&&!_0x140bf0[_0x1152('0x36')]){var _0x1588d9=_0x140bf0[_0x1152('0x37')][_0x1152('0x30')]();var _0x5d4260=_0x1588d9[_0x1152('0x2b')](0x0,_0x1588d9['indexOf']('_'));var _0x59e5a9=_0x1588d9[_0x1152('0x2b')](_0x1588d9[_0x1152('0x38')]('_')+0x1);if(_0x5d4260===_0x81f75d){_0x15ff2d[_0x59e5a9]=_0x140bf0[_0x1152('0x39')];}}});}return _0x15ff2d;}function getTicket(_0x3e6687,_0x155b2c,_0x4b1c8e,_0x490a1f,_0x4edcd6,_0x30c2de,_0x1d1c44){return new BPromise(function(_0x212276,_0x295562){var _0x102dbf;return getAuthToken(_0x155b2c,_0x4b1c8e,_0x1d1c44)[_0x1152('0x12')](function(_0x433298){if(_0x30c2de[_0x1152('0x3a')]===_0x1152('0x3b')){_0x102dbf={'method':_0x1152('0xc'),'uri':_0x490a1f+_0x1152('0x3c'),'body':Object[_0x1152('0x3d')]({},{'title':intUtil[_0x1152('0x3e')](_0x30c2de[_0x1152('0x3f')],_0x4edcd6,'\x20'),'description':intUtil['getString'](_0x30c2de[_0x1152('0x40')],_0x4edcd6,'\x0a'),'customerid_contact@odata.bind':_0x1152('0x41')+_0x3e6687['enduserId']+')','ownerid@odata.bind':_0x1152('0x27')+_0x3e6687['userId']+')','caseorigincode':'1'},getCustomFields(_0x30c2de[_0x1152('0x42')],_0x4edcd6,_0x30c2de['ticketType'])),'headers':{'Authorization':_0x1152('0x19')+_0x433298,'OData-Version':_0x1152('0x28')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x30c2de[_0x1152('0x3a')]===_0x1152('0x43')){_0x102dbf={'method':'POST','uri':_0x490a1f+_0x1152('0x44'),'body':Object[_0x1152('0x3d')]({},{'subject':intUtil[_0x1152('0x3e')](_0x30c2de['Subjects'],_0x4edcd6,'\x20'),'phonenumber':String(_0x4edcd6[_0x1152('0x26')]),'description':intUtil['getString'](_0x30c2de['Descriptions'],_0x4edcd6,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1152('0x41')+_0x3e6687['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x3e6687[_0x1152('0x22')]+')','directioncode':_0x3e6687[_0x1152('0x45')]===_0x1152('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x3e6687[_0x1152('0x22')]+')','participationtypemask':_0x3e6687[_0x1152('0x45')]===_0x1152('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x1152('0x41')+_0x3e6687[_0x1152('0x2d')]+')','participationtypemask':_0x3e6687[_0x1152('0x45')]===_0x1152('0x46')?0x1:0x2}]},getCustomFields(_0x30c2de[_0x1152('0x42')],_0x4edcd6,_0x30c2de[_0x1152('0x3a')])),'headers':{'Authorization':'Bearer\x20'+_0x433298,'OData-Version':_0x1152('0x28')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x102dbf);})[_0x1152('0x12')](function(_0x1caad5){var _0x47ef79=_0x1caad5[_0x1152('0x29')][_0x1152('0x2a')];var _0x2c9614=_0x47ef79[_0x1152('0x2b')](_0x47ef79[_0x1152('0x2c')]('(')+0x1,_0x47ef79[_0x1152('0x2c')](')'));_0x3e6687['ticketId']=_0x2c9614;_0x212276(_0x3e6687);})[_0x1152('0x14')](function(_0x377213){_0x295562(_0x377213['message']);});});}function emit(_0x478602,_0x280c4a,_0x43e732,_0x286a7a){var _0x2e6a36={'uri':util[_0x1152('0x47')](_0x1152('0x48'),_0x478602,_0x43e732,_0x286a7a)};io['to'](util[_0x1152('0x47')]('user:%s',_0x280c4a))[_0x1152('0x49')](_0x1152('0x4a'),_0x2e6a36);}exports['cs']=function(_0x3445ac,_0x414a3d,_0x4446f3,_0x130f61,_0x2d24ca,_0x1c7bed,_0x15156e,_0x2f294c){var _0x2b64cd={};_0x1c7bed[_0x1152('0xe')]=intUtil[_0x1152('0x4b')](_0x1c7bed[_0x1152('0xe')]);_0x1c7bed[_0x1152('0x4c')]=intUtil['stripTrailingSlash'](_0x1c7bed[_0x1152('0x4c')]);_0x2b64cd[_0x1152('0x45')]=_0x2f294c===_0x1152('0x46')||_0x2f294c===_0x1152('0x4d')?'queue':_0x1152('0x31');var _0x3f6a55=util['format']('%s/api/data/v9.0/',_0x1c7bed['remoteUri']);var _0x4f3293=util[_0x1152('0x47')](_0x1152('0x4e'),_0x1c7bed[_0x1152('0x4f')]);var _0x4c2f78=util[_0x1152('0x47')](_0x1152('0x50'),_0x1c7bed[_0x1152('0x4c')],_0x414a3d[_0x1152('0x51')],md5(_0x414a3d['uniqueid']));if(_0x2d24ca&&_0x2d24ca[_0x1152('0x52')]){logger[_0x1152('0x23')](_0x1152('0x53'),_0x1152('0x54'));_0x414a3d[_0x1152('0x55')]=_0x4c2f78;}else if(_0x15156e&&_0x15156e['recordingFormat']&&_0x15156e['recordingFormat']!=='none'){logger[_0x1152('0x23')](_0x1152('0x56'),_0x1152('0x54'));_0x414a3d[_0x1152('0x55')]=_0x4c2f78;}else{_0x414a3d[_0x1152('0x55')]='';}return getUser(_0x2b64cd,_0x1c7bed,_0x130f61,_0x4f3293,_0x3f6a55,_0x2f294c)[_0x1152('0x12')](function(_0x3cede4){logger[_0x1152('0x23')]('['+_0x2f294c['toUpperCase']()+_0x1152('0x57'),_0x3cede4['userId']);logger[_0x1152('0x23')]('['+_0x2f294c[_0x1152('0x16')]()+']\x20The\x20User\x20email\x20is:',_0x3cede4[_0x1152('0x1c')]);return getEndUser(_0x3cede4,_0x1c7bed,_0x4f3293,_0x3f6a55,_0x414a3d,_0x2f294c);})[_0x1152('0x12')](function(_0x2ded3d){logger['info']('['+_0x2f294c['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x2ded3d[_0x1152('0x2d')]);logger[_0x1152('0x23')]('['+_0x2f294c[_0x1152('0x16')]()+_0x1152('0x58'),_0x414a3d[_0x1152('0x26')]);return getTicket(_0x2ded3d,_0x1c7bed,_0x4f3293,_0x3f6a55,_0x414a3d,_0x4446f3,_0x2f294c);})['then'](function(_0x4af4e1){logger['info'](util[_0x1152('0x47')]('['+_0x2f294c['toUpperCase']()+_0x1152('0x59'),_0x4446f3[_0x1152('0x3a')],_0x4af4e1[_0x1152('0x5a')]));logger['info'](util[_0x1152('0x47')]('['+_0x2f294c[_0x1152('0x16')]()+']\x20Call\x20direction:\x20%s',_0x2f294c));if(_0x2f294c!==_0x1152('0x4d')){logger['info']('['+_0x2f294c['toUpperCase']()+']',_0x1152('0x5b'));emit(_0x1c7bed['remoteUri'],_0x130f61[_0x1152('0x5c')],_0x4446f3[_0x1152('0x3a')],_0x4af4e1[_0x1152('0x5a')]);}})['catch'](function(_0x46b7f6){logger[_0x1152('0x15')]('['+_0x2f294c['toUpperCase']()+_0x1152('0x5d'),util['inspect'](_0x46b7f6,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 815c061..af6bb82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f25=['name','Fields','mapValues','keyBy','custom_fields','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','[HTTP]','stringify','GET','forEach','type','nameField','customField','toLowerCase','content','idField','push','variableName','customVariable','Variable','queue','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','The\x20Enduser\x20ID\x20is:','%s/helpdesk/tickets/%d','unmanaged','monitor_format','toUpperCase','The\x20User\x20ID\x20is:','lastevent','lodash','request-promise','util','ioredis','../../../../config/logger','freshdesk','redis','defaults','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Descriptions','<br>','Tags'];(function(_0x3a07c1,_0x34d57f){var _0x2bbe15=function(_0x5a02fb){while(--_0x5a02fb){_0x3a07c1['push'](_0x3a07c1['shift']());}};_0x2bbe15(++_0x34d57f);}(_0x2f25,0xf5));var _0x52f2=function(_0x22c8df,_0x1bc042){_0x22c8df=_0x22c8df-0x0;var _0x220ab4=_0x2f25[_0x22c8df];return _0x220ab4;};'use strict';var _=require(_0x52f2('0x0'));var rp=require(_0x52f2('0x1'));var md5=require('md5');var util=require(_0x52f2('0x2'));var Redis=require(_0x52f2('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x52f2('0x4'))(_0x52f2('0x5'));config[_0x52f2('0x6')]=_[_0x52f2('0x7')](config[_0x52f2('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x52f2('0x6')]));var headers={'Content-Type':_0x52f2('0x8'),'Accept':_0x52f2('0x8')};function emit(_0x5a589d,_0x377107,_0x552955){io['to'](_0x5a589d)[_0x52f2('0x9')](_0x377107,_0x552955);}function getTicket(_0x38df3e,_0x4ae767,_0x31d513,_0x1d6fb1,_0x14c8cf){logger[_0x52f2('0xa')](_0x52f2('0xb'));var _0x523a23=_[_0x52f2('0xc')]({'responder_id':_0x4ae767['id'],'requester_id':_0x31d513['id'],'name':util['format'](_0x52f2('0xd'),_0x14c8cf[_0x52f2('0xe')]),'phone':_0x14c8cf['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x52f2('0xf')](_0x1d6fb1['Subjects'],_0x14c8cf,'\x20'),'description':intUtil['getString'](_0x1d6fb1[_0x52f2('0x10')],_0x14c8cf,_0x52f2('0x11')),'tags':getTags(_0x1d6fb1[_0x52f2('0x12')],_0x52f2('0x13'))},getCustomFields(_0x1d6fb1[_0x52f2('0x14')],_0x14c8cf));_0x523a23['custom_fields']=_[_0x52f2('0x15')](_[_0x52f2('0x16')](_0x523a23[_0x52f2('0x17')],'id'),_0x52f2('0x18'));return request({'uri':util[_0x52f2('0x19')](_0x52f2('0x1a'),_0x38df3e[_0x52f2('0x1b')]),'method':_0x52f2('0x1c'),'body':_0x523a23})[_0x52f2('0x1d')](function(_0x2e6da9){logger['info'](_0x52f2('0x1e'));return _0x2e6da9;});}function getUser(_0x4c8b1b,_0x13e173){if(intUtil[_0x52f2('0x1f')](_0x13e173)){return request({'uri':util['format'](_0x52f2('0x20'),_0x4c8b1b[_0x52f2('0x1b')]),'qs':{'email':_0x13e173}})[_0x52f2('0x1d')](function(_0x136c47){if(_0x136c47[_0x52f2('0x21')]){logger[_0x52f2('0xa')](_0x52f2('0x22'));return _[_0x52f2('0x23')](_0x136c47,function(_0x47c008){return _0x47c008['contact']['email']===_0x13e173;});}else{logger[_0x52f2('0xa')](_0x52f2('0x24'));return request({'uri':util[_0x52f2('0x19')](_0x52f2('0x25'),_0x4c8b1b['remoteUri'])})[_0x52f2('0x1d')](function(_0x2552b0){logger[_0x52f2('0xa')](_0x52f2('0x26'));return _0x2552b0;});}});}else{logger[_0x52f2('0xa')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x52f2('0x19')](_0x52f2('0x25'),_0x4c8b1b['remoteUri'])})['then'](function(_0x4639ff){logger['info'](_0x52f2('0x26'));return _0x4639ff;});}}function getEndUser(_0x42d9db,_0x2525fe,_0x4d3ab){logger['info']('Searching\x20enduser\x20with\x20phone',_0x4d3ab);return request({'uri':util['format'](_0x52f2('0x27'),_0x42d9db[_0x52f2('0x1b')]),'qs':{'phone':_0x4d3ab}})[_0x52f2('0x1d')](function(_0xa21343){if(_0xa21343[_0x52f2('0x21')]){logger[_0x52f2('0xa')](_0x52f2('0x28'));return _[_0x52f2('0x23')](_0xa21343,{'phone':_0x4d3ab});}else{logger[_0x52f2('0xa')](_0x52f2('0x29'));return request({'uri':util['format']('%s/api/v2/contacts',_0x42d9db[_0x52f2('0x1b')]),'method':'POST','body':{'name':_0x2525fe,'phone':_0x4d3ab}})['then'](function(_0x1c988b){logger[_0x52f2('0xa')](_0x52f2('0x2a'));return _0x1c988b;});}});}function getAuth(_0x349b09){return util[_0x52f2('0x19')]('Basic\x20%s',new Buffer(_0x349b09[_0x52f2('0x2b')]+':X')[_0x52f2('0x2c')]('base64'));}function request(_0x58102a){logger['debug'](_0x52f2('0x2d'),JSON[_0x52f2('0x2e')](_0x58102a));return rp(_[_0x52f2('0x7')](_0x58102a,{'method':_0x52f2('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x2af189,_0x575439){var _0x3926d6=[];if(_0x2af189&&_0x2af189['length']>0x0){_0x3926d6=_['map'](_0x2af189,_0x575439);}return _0x3926d6;}function getCustomFields(_0x373fe5,_0x37da1a){var _0x4a391c=[];var _0x56cfc3={'custom_fields':[]};if(_0x373fe5['length']>0x0){_[_0x52f2('0x30')](_0x373fe5,function(_0x24172d){if(_0x24172d[_0x52f2('0x31')]==='string'&&_0x24172d[_0x52f2('0x32')]&&!_0x24172d[_0x52f2('0x33')]){_0x56cfc3[_0x24172d[_0x52f2('0x32')][_0x52f2('0x34')]()]=_0x24172d[_0x52f2('0x35')][_0x52f2('0x2c')]();}else if(_0x24172d[_0x52f2('0x31')]==='string'&&_0x24172d[_0x52f2('0x36')]&&_0x24172d[_0x52f2('0x33')]){_0x56cfc3[_0x52f2('0x17')][_0x52f2('0x37')]({'id':_0x24172d[_0x52f2('0x36')],'value':_0x24172d[_0x52f2('0x35')]['toString']()});}else if(_0x24172d[_0x52f2('0x31')]==='variable'&&_0x24172d[_0x52f2('0x38')]&&_0x24172d['idField']&&_0x24172d[_0x52f2('0x33')]){_0x37da1a[_0x24172d['variableName']]&&_0x56cfc3[_0x52f2('0x17')]['push']({'id':_0x24172d[_0x52f2('0x36')],'value':_0x37da1a[_0x24172d[_0x52f2('0x38')]][_0x52f2('0x2c')]()});}else if(_0x24172d[_0x52f2('0x31')]===_0x52f2('0x39')&&_0x24172d[_0x52f2('0x3a')]&&_0x24172d[_0x52f2('0x3a')]['name']&&_0x24172d[_0x52f2('0x36')]&&_0x24172d[_0x52f2('0x33')]){_0x37da1a[_0x24172d['Variable']['name'][_0x52f2('0x34')]()]&&_0x56cfc3[_0x52f2('0x17')][_0x52f2('0x37')]({'id':_0x24172d[_0x52f2('0x36')],'value':_0x37da1a[_0x24172d[_0x52f2('0x3a')][_0x52f2('0x13')][_0x52f2('0x34')]()][_0x52f2('0x2c')]()});}});}return _0x56cfc3;}exports[_0x52f2('0x3b')]=function(_0x12c6cf,_0x2b3f8a,_0x15b809,_0x11559d,_0x336c49,_0x33e4f6){var _0x1240fb,_0x507553;_0x33e4f6[_0x52f2('0x1b')]=intUtil['stripTrailingSlash'](_0x33e4f6['remoteUri']);_0x33e4f6['serverUrl']=intUtil['stripTrailingSlash'](_0x33e4f6[_0x52f2('0x3c')]);if(_0x336c49&&_0x336c49['monitor_format']){logger[_0x52f2('0xa')](_0x52f2('0x3d'),_0x52f2('0x3e'));_0x2b3f8a[_0x52f2('0x3f')]=util[_0x52f2('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x33e4f6[_0x52f2('0x3c')],_0x2b3f8a[_0x52f2('0x40')],md5(_0x2b3f8a[_0x52f2('0x40')]));}else{_0x2b3f8a['recordingURL']='';}headers[_0x52f2('0x41')]=getAuth(_0x33e4f6);return getUser(_0x33e4f6,_0x11559d[_0x52f2('0x42')])[_0x52f2('0x1d')](function(_0x3005ee){_0x1240fb=_0x3005ee;logger[_0x52f2('0xa')]('The\x20User\x20ID\x20is:',_0x1240fb['id']);return getEndUser(_0x33e4f6,_0x2b3f8a['calleridname'],_0x2b3f8a[_0x52f2('0x43')]);})[_0x52f2('0x1d')](function(_0x103ffa){_0x507553=_0x103ffa;logger['info']('The\x20Enduser\x20ID\x20is:',_0x507553['id']);return getTicket(_0x33e4f6,_0x1240fb,_0x507553,_0x15b809,_0x2b3f8a);})['then'](function(_0x5de070){if(_0x5de070&&_0x5de070['id']){logger[_0x52f2('0xa')]('Ticket\x20created!');logger[_0x52f2('0xa')](_0x52f2('0x44'),_0x5de070['id']);logger[_0x52f2('0xa')]('[QUEUE]',_0x52f2('0x45'));emit(util['format'](_0x52f2('0x46'),_0x11559d[_0x52f2('0x13')]),_0x52f2('0x47'),{'uri':util[_0x52f2('0x19')]('%s/helpdesk/tickets/%d',_0x33e4f6[_0x52f2('0x1b')],_0x5de070['id'])});}})[_0x52f2('0x48')](function(_0x3f071b){logger[_0x52f2('0x49')](_0x52f2('0x3d'),JSON[_0x52f2('0x2e')](_0x3f071b));});};exports[_0x52f2('0x4a')]=function(_0x200866,_0x2426af,_0xfdf5ec,_0x3f01a0,_0x56815c,_0x165f27,_0x3df5d9){var _0x213f5a,_0x32d3ae;_0x165f27[_0x52f2('0x1b')]=intUtil[_0x52f2('0x4b')](_0x165f27[_0x52f2('0x1b')]);_0x165f27[_0x52f2('0x3c')]=intUtil[_0x52f2('0x4b')](_0x165f27[_0x52f2('0x3c')]);if(_0x3df5d9&&_0x3df5d9[_0x52f2('0x4c')]&&_0x3df5d9[_0x52f2('0x4c')]!==_0x52f2('0x4d')){logger['info'](_0x52f2('0x4e'),_0x52f2('0x3e'));_0x2426af[_0x52f2('0x3f')]=util[_0x52f2('0x19')](_0x52f2('0x4f'),_0x165f27[_0x52f2('0x3c')],_0x2426af[_0x52f2('0x40')],md5(_0x2426af[_0x52f2('0x40')]));}headers['Authorization']=getAuth(_0x165f27);return getUser(_0x165f27,_0x3f01a0[_0x52f2('0x42')])[_0x52f2('0x1d')](function(_0x592d72){_0x213f5a=_0x592d72;logger[_0x52f2('0xa')]('The\x20User\x20ID\x20is:',_0x213f5a['id']);return getEndUser(_0x165f27,_0x2426af[_0x52f2('0x50')],_0x2426af['destcalleridnum']);})[_0x52f2('0x1d')](function(_0x2ea3cc){_0x32d3ae=_0x2ea3cc;logger[_0x52f2('0xa')](_0x52f2('0x51'),_0x32d3ae['id']);return getTicket(_0x165f27,_0x213f5a,_0x32d3ae,_0xfdf5ec,_0x2426af);})[_0x52f2('0x1d')](function(_0x42c7a5){if(_0x42c7a5&&_0x42c7a5['id']){logger[_0x52f2('0xa')](_0x52f2('0x1e'));logger[_0x52f2('0xa')](_0x52f2('0x44'),_0x42c7a5['id']);logger['info']('[OUTBOUND]',_0x52f2('0x45'));emit(util['format'](_0x52f2('0x46'),_0x3f01a0[_0x52f2('0x13')]),'trigger:browser:url',{'uri':util['format'](_0x52f2('0x52'),_0x165f27['remoteUri'],_0x42c7a5['id'])});}})[_0x52f2('0x48')](function(_0x549a6c){logger[_0x52f2('0x49')](_0x52f2('0x4e'),JSON[_0x52f2('0x2e')](_0x549a6c));});};exports[_0x52f2('0x53')]=function(_0x301b0a,_0x26bef6,_0x3a2e0a,_0x3cec34,_0x47ec3f,_0x2ef124){var _0x2ba23c,_0x3c77b8;_0x2ef124['remoteUri']=intUtil[_0x52f2('0x4b')](_0x2ef124['remoteUri']);_0x2ef124[_0x52f2('0x3c')]=intUtil[_0x52f2('0x4b')](_0x2ef124[_0x52f2('0x3c')]);if(_0x47ec3f&&_0x47ec3f[_0x52f2('0x54')]){logger[_0x52f2('0xa')]('['+_0x26bef6['lastevent'][_0x52f2('0x55')]()+']',_0x52f2('0x3e'));_0x26bef6[_0x52f2('0x3f')]=util['format'](_0x52f2('0x4f'),_0x2ef124[_0x52f2('0x3c')],_0x26bef6[_0x52f2('0x40')],md5(_0x26bef6['uniqueid']));}else{_0x26bef6[_0x52f2('0x3f')]='';}headers[_0x52f2('0x41')]=getAuth(_0x2ef124);return getUser(_0x2ef124,'')[_0x52f2('0x1d')](function(_0x14a1fe){_0x2ba23c=_0x14a1fe;logger[_0x52f2('0xa')](_0x52f2('0x56'),_0x2ba23c['id']);return getEndUser(_0x2ef124,_0x26bef6[_0x52f2('0xe')],_0x26bef6[_0x52f2('0x43')]);})[_0x52f2('0x1d')](function(_0x5c3818){_0x3c77b8=_0x5c3818;logger[_0x52f2('0xa')](_0x52f2('0x51'),_0x3c77b8['id']);return getTicket(_0x2ef124,_0x2ba23c,_0x3c77b8,_0x3a2e0a,_0x26bef6);})[_0x52f2('0x1d')](function(_0x342cd3){if(_0x342cd3){logger['info'](_0x52f2('0x1e'));logger['info'](_0x52f2('0x44'),_0x342cd3['id']);}})[_0x52f2('0x48')](function(_0x38e5fb){logger[_0x52f2('0x49')]('['+_0x26bef6[_0x52f2('0x57')][_0x52f2('0x55')]()+']',JSON[_0x52f2('0x2e')](_0x38e5fb));});};
\ No newline at end of file
+var _0x762e=['merge','format','calleridnum','Subjects','getString','Descriptions','<br>','Tags','name','Fields','custom_fields','mapValues','value','remoteUri','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','info','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','POST','Enduser\x20created.','Basic\x20%s','toString','base64','debug','stringify','map','forEach','type','string','nameField','customField','toLowerCase','content','variable','variableName','idField','customVariable','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','catch','error','unmanaged','lastevent','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...'];(function(_0x18b9bd,_0x43663f){var _0x1a9a03=function(_0xaeaa55){while(--_0xaeaa55){_0x18b9bd['push'](_0x18b9bd['shift']());}};_0x1a9a03(++_0x43663f);}(_0x762e,0x1c7));var _0xe762=function(_0x4a1726,_0x32eab5){_0x4a1726=_0x4a1726-0x0;var _0x45ddd0=_0x762e[_0x4a1726];return _0x45ddd0;};'use strict';var _=require(_0xe762('0x0'));var rp=require('request-promise');var md5=require(_0xe762('0x1'));var util=require(_0xe762('0x2'));var Redis=require(_0xe762('0x3'));var intUtil=require(_0xe762('0x4'));var config=require(_0xe762('0x5'));var logger=require(_0xe762('0x6'))(_0xe762('0x7'));config[_0xe762('0x8')]=_[_0xe762('0x9')](config[_0xe762('0x8')],{'host':_0xe762('0xa'),'port':0x18eb});var io=require(_0xe762('0xb'))(new Redis(config[_0xe762('0x8')]));var headers={'Content-Type':'application/json','Accept':_0xe762('0xc')};function emit(_0x45e221,_0x1dd925,_0x21153d){io['to'](_0x45e221)[_0xe762('0xd')](_0x1dd925,_0x21153d);}function getTicket(_0x2960d2,_0x3ef84a,_0x21e1bb,_0x3fbb7d,_0x350a73){logger['info'](_0xe762('0xe'));var _0x39cdfa=_[_0xe762('0xf')]({'responder_id':_0x3ef84a['id'],'requester_id':_0x21e1bb['id'],'name':util[_0xe762('0x10')]('Caller\x20-\x20%s',_0x350a73['calleridname']),'phone':_0x350a73[_0xe762('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3fbb7d[_0xe762('0x12')],_0x350a73,'\x20'),'description':intUtil[_0xe762('0x13')](_0x3fbb7d[_0xe762('0x14')],_0x350a73,_0xe762('0x15')),'tags':getTags(_0x3fbb7d[_0xe762('0x16')],_0xe762('0x17'))},getCustomFields(_0x3fbb7d[_0xe762('0x18')],_0x350a73));_0x39cdfa[_0xe762('0x19')]=_[_0xe762('0x1a')](_['keyBy'](_0x39cdfa[_0xe762('0x19')],'id'),_0xe762('0x1b'));return request({'uri':util[_0xe762('0x10')]('%s/api/v2/tickets',_0x2960d2[_0xe762('0x1c')]),'method':'POST','body':_0x39cdfa})['then'](function(_0x31b28d){logger['info'](_0xe762('0x1d'));return _0x31b28d;});}function getUser(_0x701a5b,_0x4fa1ee){if(intUtil[_0xe762('0x1e')](_0x4fa1ee)){return request({'uri':util[_0xe762('0x10')](_0xe762('0x1f'),_0x701a5b[_0xe762('0x1c')]),'qs':{'email':_0x4fa1ee}})[_0xe762('0x20')](function(_0x39b78c){if(_0x39b78c[_0xe762('0x21')]){logger[_0xe762('0x22')](_0xe762('0x23'));return _[_0xe762('0x24')](_0x39b78c,function(_0xeb1078){return _0xeb1078[_0xe762('0x25')][_0xe762('0x26')]===_0x4fa1ee;});}else{logger[_0xe762('0x22')](_0xe762('0x27'));return request({'uri':util[_0xe762('0x10')](_0xe762('0x28'),_0x701a5b[_0xe762('0x1c')])})[_0xe762('0x20')](function(_0x41cf1c){logger[_0xe762('0x22')](_0xe762('0x29'));return _0x41cf1c;});}});}else{logger[_0xe762('0x22')](_0xe762('0x2a'));return request({'uri':util['format'](_0xe762('0x28'),_0x701a5b[_0xe762('0x1c')])})['then'](function(_0x5c641a){logger['info'](_0xe762('0x29'));return _0x5c641a;});}}function getEndUser(_0x4dbfb8,_0x536b66,_0x2572d4){logger[_0xe762('0x22')]('Searching\x20enduser\x20with\x20phone',_0x2572d4);return request({'uri':util[_0xe762('0x10')](_0xe762('0x2b'),_0x4dbfb8[_0xe762('0x1c')]),'qs':{'phone':_0x2572d4}})[_0xe762('0x20')](function(_0x5d8399){if(_0x5d8399[_0xe762('0x21')]){logger[_0xe762('0x22')](_0xe762('0x2c'));return _['find'](_0x5d8399,{'phone':_0x2572d4});}else{logger[_0xe762('0x22')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xe762('0x2b'),_0x4dbfb8[_0xe762('0x1c')]),'method':_0xe762('0x2d'),'body':{'name':_0x536b66,'phone':_0x2572d4}})['then'](function(_0x54482b){logger[_0xe762('0x22')](_0xe762('0x2e'));return _0x54482b;});}});}function getAuth(_0x2acb0e){return util['format'](_0xe762('0x2f'),new Buffer(_0x2acb0e['apiKey']+':X')[_0xe762('0x30')](_0xe762('0x31')));}function request(_0x55605c){logger[_0xe762('0x32')]('[HTTP]',JSON[_0xe762('0x33')](_0x55605c));return rp(_['defaults'](_0x55605c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x352ccd,_0x2e77e2){var _0x4a7c73=[];if(_0x352ccd&&_0x352ccd[_0xe762('0x21')]>0x0){_0x4a7c73=_[_0xe762('0x34')](_0x352ccd,_0x2e77e2);}return _0x4a7c73;}function getCustomFields(_0x4815cf,_0x3d8416){var _0x1ef58=[];var _0x58c9b4={'custom_fields':[]};if(_0x4815cf['length']>0x0){_[_0xe762('0x35')](_0x4815cf,function(_0x2f7c50){if(_0x2f7c50[_0xe762('0x36')]===_0xe762('0x37')&&_0x2f7c50[_0xe762('0x38')]&&!_0x2f7c50[_0xe762('0x39')]){_0x58c9b4[_0x2f7c50[_0xe762('0x38')][_0xe762('0x3a')]()]=_0x2f7c50[_0xe762('0x3b')][_0xe762('0x30')]();}else if(_0x2f7c50[_0xe762('0x36')]===_0xe762('0x37')&&_0x2f7c50['idField']&&_0x2f7c50[_0xe762('0x39')]){_0x58c9b4['custom_fields']['push']({'id':_0x2f7c50['idField'],'value':_0x2f7c50[_0xe762('0x3b')][_0xe762('0x30')]()});}else if(_0x2f7c50[_0xe762('0x36')]===_0xe762('0x3c')&&_0x2f7c50[_0xe762('0x3d')]&&_0x2f7c50[_0xe762('0x3e')]&&_0x2f7c50[_0xe762('0x39')]){_0x3d8416[_0x2f7c50[_0xe762('0x3d')]]&&_0x58c9b4[_0xe762('0x19')]['push']({'id':_0x2f7c50[_0xe762('0x3e')],'value':_0x3d8416[_0x2f7c50[_0xe762('0x3d')]][_0xe762('0x30')]()});}else if(_0x2f7c50[_0xe762('0x36')]===_0xe762('0x3f')&&_0x2f7c50['Variable']&&_0x2f7c50['Variable'][_0xe762('0x17')]&&_0x2f7c50[_0xe762('0x3e')]&&_0x2f7c50[_0xe762('0x39')]){_0x3d8416[_0x2f7c50['Variable'][_0xe762('0x17')][_0xe762('0x3a')]()]&&_0x58c9b4[_0xe762('0x19')][_0xe762('0x40')]({'id':_0x2f7c50[_0xe762('0x3e')],'value':_0x3d8416[_0x2f7c50['Variable'][_0xe762('0x17')][_0xe762('0x3a')]()][_0xe762('0x30')]()});}});}return _0x58c9b4;}exports[_0xe762('0x41')]=function(_0x30e239,_0x5a0d38,_0x4f6790,_0x249759,_0x3b9641,_0x425b76){var _0x190249,_0x3ad1d6;_0x425b76[_0xe762('0x1c')]=intUtil[_0xe762('0x42')](_0x425b76[_0xe762('0x1c')]);_0x425b76[_0xe762('0x43')]=intUtil[_0xe762('0x42')](_0x425b76[_0xe762('0x43')]);if(_0x3b9641&&_0x3b9641[_0xe762('0x44')]){logger['info'](_0xe762('0x45'),_0xe762('0x46'));_0x5a0d38[_0xe762('0x47')]=util[_0xe762('0x10')](_0xe762('0x48'),_0x425b76[_0xe762('0x43')],_0x5a0d38[_0xe762('0x49')],md5(_0x5a0d38['uniqueid']));}else{_0x5a0d38[_0xe762('0x47')]='';}headers['Authorization']=getAuth(_0x425b76);return getUser(_0x425b76,_0x249759[_0xe762('0x26')])[_0xe762('0x20')](function(_0x5015a7){_0x190249=_0x5015a7;logger[_0xe762('0x22')](_0xe762('0x4a'),_0x190249['id']);return getEndUser(_0x425b76,_0x5a0d38[_0xe762('0x4b')],_0x5a0d38[_0xe762('0x11')]);})['then'](function(_0x1f40c5){_0x3ad1d6=_0x1f40c5;logger['info'](_0xe762('0x4c'),_0x3ad1d6['id']);return getTicket(_0x425b76,_0x190249,_0x3ad1d6,_0x4f6790,_0x5a0d38);})[_0xe762('0x20')](function(_0x3e0b9b){if(_0x3e0b9b&&_0x3e0b9b['id']){logger[_0xe762('0x22')](_0xe762('0x1d'));logger['info'](_0xe762('0x4d'),_0x3e0b9b['id']);logger[_0xe762('0x22')](_0xe762('0x45'),_0xe762('0x4e'));emit(util['format'](_0xe762('0x4f'),_0x249759[_0xe762('0x17')]),_0xe762('0x50'),{'uri':util[_0xe762('0x10')](_0xe762('0x51'),_0x425b76['remoteUri'],_0x3e0b9b['id'])});}})['catch'](function(_0x10bd09){logger['error']('[QUEUE]',JSON[_0xe762('0x33')](_0x10bd09));});};exports[_0xe762('0x52')]=function(_0x2910b3,_0x25bee1,_0x2763f9,_0x24d318,_0x19d46f,_0x13dfd9,_0xf8c714){var _0x2d21cc,_0x75b42;_0x13dfd9[_0xe762('0x1c')]=intUtil['stripTrailingSlash'](_0x13dfd9[_0xe762('0x1c')]);_0x13dfd9['serverUrl']=intUtil[_0xe762('0x42')](_0x13dfd9[_0xe762('0x43')]);if(_0xf8c714&&_0xf8c714[_0xe762('0x53')]&&_0xf8c714[_0xe762('0x53')]!==_0xe762('0x54')){logger[_0xe762('0x22')](_0xe762('0x55'),_0xe762('0x46'));_0x25bee1[_0xe762('0x47')]=util[_0xe762('0x10')](_0xe762('0x48'),_0x13dfd9[_0xe762('0x43')],_0x25bee1[_0xe762('0x49')],md5(_0x25bee1[_0xe762('0x49')]));}headers[_0xe762('0x56')]=getAuth(_0x13dfd9);return getUser(_0x13dfd9,_0x24d318[_0xe762('0x26')])[_0xe762('0x20')](function(_0x486b6b){_0x2d21cc=_0x486b6b;logger[_0xe762('0x22')]('The\x20User\x20ID\x20is:',_0x2d21cc['id']);return getEndUser(_0x13dfd9,_0x25bee1[_0xe762('0x57')],_0x25bee1[_0xe762('0x58')]);})[_0xe762('0x20')](function(_0x6200a){_0x75b42=_0x6200a;logger[_0xe762('0x22')]('The\x20Enduser\x20ID\x20is:',_0x75b42['id']);return getTicket(_0x13dfd9,_0x2d21cc,_0x75b42,_0x2763f9,_0x25bee1);})[_0xe762('0x20')](function(_0x3e833c){if(_0x3e833c&&_0x3e833c['id']){logger['info'](_0xe762('0x1d'));logger[_0xe762('0x22')](_0xe762('0x4d'),_0x3e833c['id']);logger[_0xe762('0x22')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe762('0x10')](_0xe762('0x4f'),_0x24d318[_0xe762('0x17')]),_0xe762('0x50'),{'uri':util['format'](_0xe762('0x51'),_0x13dfd9[_0xe762('0x1c')],_0x3e833c['id'])});}})[_0xe762('0x59')](function(_0x17f46a){logger[_0xe762('0x5a')]('[OUTBOUND]',JSON[_0xe762('0x33')](_0x17f46a));});};exports[_0xe762('0x5b')]=function(_0x3837ac,_0x5becae,_0x57e3b4,_0x497abe,_0x353246,_0x21b659){var _0x54955c,_0x4d635e;_0x21b659['remoteUri']=intUtil[_0xe762('0x42')](_0x21b659['remoteUri']);_0x21b659[_0xe762('0x43')]=intUtil[_0xe762('0x42')](_0x21b659['serverUrl']);if(_0x353246&&_0x353246[_0xe762('0x44')]){logger[_0xe762('0x22')]('['+_0x5becae[_0xe762('0x5c')][_0xe762('0x5d')]()+']','Recording\x20is\x20enabled!');_0x5becae[_0xe762('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21b659[_0xe762('0x43')],_0x5becae[_0xe762('0x49')],md5(_0x5becae[_0xe762('0x49')]));}else{_0x5becae[_0xe762('0x47')]='';}headers[_0xe762('0x56')]=getAuth(_0x21b659);return getUser(_0x21b659,'')[_0xe762('0x20')](function(_0xf9a422){_0x54955c=_0xf9a422;logger[_0xe762('0x22')](_0xe762('0x4a'),_0x54955c['id']);return getEndUser(_0x21b659,_0x5becae[_0xe762('0x4b')],_0x5becae[_0xe762('0x11')]);})[_0xe762('0x20')](function(_0x2e7db8){_0x4d635e=_0x2e7db8;logger[_0xe762('0x22')](_0xe762('0x4c'),_0x4d635e['id']);return getTicket(_0x21b659,_0x54955c,_0x4d635e,_0x57e3b4,_0x5becae);})[_0xe762('0x20')](function(_0xc6f5e4){if(_0xc6f5e4){logger[_0xe762('0x22')](_0xe762('0x1d'));logger[_0xe762('0x22')](_0xe762('0x4d'),_0xc6f5e4['id']);}})[_0xe762('0x59')](function(_0x3520ae){logger['error']('['+_0x5becae['lastevent'][_0xe762('0x5d')]()+']',JSON['stringify'](_0x3520ae));});};
\ No newline at end of file
index eb5c5cf..f626253 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbc3=['[QUEUE]','recordingFormat','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','headers','Getting\x20admin\x20information','then','users','email','info','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','GET','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','/api/contacts/filters','filters','name','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','work_number','mobile_number','Contact\x20found:','endUserId','Contact\x20created:','catch','POST','format','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','toLowerCase','outbound','destcalleridnum','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format'];(function(_0x4a8d42,_0x5077dd){var _0x309a83=function(_0x4b9315){while(--_0x4b9315){_0x4a8d42['push'](_0x4a8d42['shift']());}};_0x309a83(++_0x5077dd);}(_0xbbc3,0x14f));var _0x3bbc=function(_0x57f67b,_0x12c55b){_0x57f67b=_0x57f67b-0x0;var _0x33c9db=_0xbbc3[_0x57f67b];return _0x33c9db;};'use strict';var _=require(_0x3bbc('0x0'));var rp=require(_0x3bbc('0x1'));var md5=require('md5');var util=require(_0x3bbc('0x2'));var moment=require(_0x3bbc('0x3'));var Promise=require(_0x3bbc('0x4'));var Redis=require(_0x3bbc('0x5'));var intUtil=require('./util');var config=require(_0x3bbc('0x6'));var logger=require(_0x3bbc('0x7'))(_0x3bbc('0x8'));config[_0x3bbc('0x9')]=_[_0x3bbc('0xa')](config['redis'],{'host':_0x3bbc('0xb'),'port':0x18eb});var io=require(_0x3bbc('0xc'))(new Redis(config[_0x3bbc('0x9')]));function getAdminId(_0x38f174,_0x34c7dd,_0x2609c9,_0x1cd075){return new Promise(function(_0x1670a4,_0x33807e){var _0x994ca7=![];var _0x47054c={'method':'GET','uri':_0x1cd075+'/api/selector/owners','json':!![]};_0x47054c[_0x3bbc('0xd')]=_0x2609c9;logger['info'](_0x3bbc('0xe'));return rp(_0x47054c)[_0x3bbc('0xf')](function(_0x36ce9c){if(_0x36ce9c){var _0x506da=_0x36ce9c[_0x3bbc('0x10')];var _0x5200d1=null;for(_0x5200d1=0x0;_0x5200d1<_0x506da['length'];_0x5200d1++){if(_0x506da[_0x5200d1][_0x3bbc('0x11')]===_0x38f174['adminEmail']){_0x38f174['adminId']=_0x506da[_0x5200d1]['id'];_0x994ca7=!![];}}if(_0x994ca7){logger[_0x3bbc('0x12')]('Admin\x20found:',_0x38f174[_0x3bbc('0x13')]);_0x1670a4(_0x38f174);}else{_0x33807e({'statusCode':0x194,'message':_0x3bbc('0x14')});}}else{_0x33807e({'statusCode':0x194,'message':_0x3bbc('0x14')});}})['catch'](function(_0x737ffd){logger[_0x3bbc('0x15')]('['+[_0x34c7dd[_0x3bbc('0x16')]()]+']',_0x737ffd[_0x3bbc('0x17')]);_0x33807e(_0x737ffd);});});}function getUser(_0x472b69,_0x26c442,_0x1df2a7){return function(_0x523be9){return new Promise(function(_0x2d77d1,_0x81ea62){var _0x32665b={'method':_0x3bbc('0x18'),'uri':_0x1df2a7+_0x3bbc('0x19'),'json':!![]};_0x32665b[_0x3bbc('0xd')]=_0x26c442;logger[_0x3bbc('0x12')](_0x3bbc('0x1a'));return rp(_0x32665b)[_0x3bbc('0xf')](function(_0x46f236){if(_0x46f236){var _0x577a11=_0x46f236[_0x3bbc('0x10')];var _0x443f37=![];var _0x12a648=null;if(_0x523be9[_0x3bbc('0x1b')]!==null){logger[_0x3bbc('0x12')](_0x3bbc('0x1c'),_0x523be9[_0x3bbc('0x1b')]);_0x523be9[_0x3bbc('0x1d')]=_0x523be9[_0x3bbc('0x1b')];for(_0x12a648=0x0;_0x12a648<_0x577a11[_0x3bbc('0x1e')];_0x12a648++){if(_0x577a11[_0x12a648]['email']===_0x523be9[_0x3bbc('0x1b')]){_0x443f37=!![];_0x523be9[_0x3bbc('0x1f')]=_0x577a11[_0x12a648]['id'];logger[_0x3bbc('0x12')](_0x3bbc('0x20'),_0x523be9[_0x3bbc('0x1f')]);}}}if(!_0x443f37){logger[_0x3bbc('0x12')](_0x3bbc('0x21'));_0x523be9['userEmail']=_0x523be9['adminEmail'];_0x523be9['userId']=_0x523be9[_0x3bbc('0x13')];_0x443f37=!![];}if(_0x443f37){_0x2d77d1(_0x523be9);}else{_0x81ea62({'statusCode':0x194,'message':_0x3bbc('0x14')});}}else{_0x81ea62({'statusCode':0x194,'message':_0x3bbc('0x14')});}})['catch'](function(_0x193383){logger[_0x3bbc('0x15')]('['+[_0x472b69[_0x3bbc('0x16')]()]+']',_0x193383[_0x3bbc('0x17')]);_0x81ea62(_0x193383);});});};}function getEndUser(_0x55e783,_0x301aba,_0x394902){return function(_0x1b6a5a){return new Promise(function(_0x13cf9e,_0x5ad74a){var _0xcd167e=0x0;var _0x5d9698={'method':_0x3bbc('0x18'),'uri':_0x394902+_0x3bbc('0x22'),'json':!![]};_0x5d9698[_0x3bbc('0xd')]=_0x301aba;logger[_0x3bbc('0x12')]('Getting\x20contacts\x20filter');return rp(_0x5d9698)[_0x3bbc('0xf')](function(_0x53fc6f){_0x53fc6f[_0x3bbc('0x23')]['forEach'](function(_0x406d7b){if(_0x406d7b[_0x3bbc('0x24')]==='All\x20Contacts'){_0xcd167e=_0x406d7b['id'];}});})[_0x3bbc('0xf')](function(){logger['info']('Getting\x20contact\x20list');var _0x217cdd={'method':_0x3bbc('0x18'),'uri':_0x394902+_0x3bbc('0x25')+_0xcd167e,'json':!![]};_0x217cdd[_0x3bbc('0xd')]=_0x301aba;return rp(_0x217cdd);})[_0x3bbc('0xf')](function(_0x94b0dc){logger[_0x3bbc('0x12')](_0x3bbc('0x26'),_0x1b6a5a[_0x3bbc('0x27')]);if(_0x94b0dc[_0x3bbc('0x28')][_0x3bbc('0x1e')]>0x0){var _0x2a43a3=_['find'](_0x94b0dc[_0x3bbc('0x28')],function(_0x345ebe){if(_0x345ebe[_0x3bbc('0x29')]===_0x1b6a5a['contactNumber']||_0x345ebe[_0x3bbc('0x2a')]===_0x1b6a5a[_0x3bbc('0x27')]){return _0x345ebe;}});if(_0x2a43a3){_0x1b6a5a['endUserId']=_0x2a43a3['id'];logger['info'](_0x3bbc('0x2b'),_0x1b6a5a[_0x3bbc('0x2c')]);_0x13cf9e(_0x1b6a5a);}else{return createEndUser(_0x1b6a5a,_0x55e783,_0x301aba,_0x394902)['then'](function(_0x133698){logger[_0x3bbc('0x12')]('Contact\x20created:',_0x1b6a5a[_0x3bbc('0x2c')]);_0x13cf9e(_0x133698);});}}else{return createEndUser(_0x1b6a5a,_0x55e783,_0x301aba,_0x394902)[_0x3bbc('0xf')](function(_0x4374f3){logger[_0x3bbc('0x12')](_0x3bbc('0x2d'),_0x1b6a5a['endUserId']);_0x13cf9e(_0x4374f3);});}})[_0x3bbc('0x2e')](function(_0xf3d153){throw new Error(_0xf3d153['message']);});});};}function createEndUser(_0x1d9ea7,_0x496e38,_0x159aab,_0x201c57){return new Promise(function(_0x38be4e,_0x1e9181){var _0x1f9272=moment();var _0x32184f={'method':_0x3bbc('0x2f'),'uri':_0x201c57+'/api/contacts','body':{'contact':{'last_name':_0x1d9ea7[_0x3bbc('0x27')],'work_number':_0x1d9ea7['contactNumber'],'mobile_number':_0x1d9ea7[_0x3bbc('0x27')],'owner_id':_0x1d9ea7[_0x3bbc('0x1f')],'created_at':_0x1f9272[_0x3bbc('0x30')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x32184f[_0x3bbc('0xd')]=_0x159aab;logger[_0x3bbc('0x12')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x32184f)[_0x3bbc('0xf')](function(_0x327d4e){_0x1d9ea7['endUserId']=_0x327d4e[_0x3bbc('0x31')]['id'];_0x38be4e(_0x1d9ea7);})[_0x3bbc('0x2e')](function(_0x3b5d01){logger[_0x3bbc('0x15')]('['+[_0x496e38['toUpperCase']()]+']',_0x3b5d01[_0x3bbc('0x17')]);_0x1e9181(_0x3b5d01[_0x3bbc('0x17')]);});});}function getTicket(_0x2516b,_0x53ce50,_0x4d1fe0,_0x3a367a,_0x1c5722){return function(_0x5e4380){logger[_0x3bbc('0x12')](_0x3bbc('0x32'));return new Promise(function(_0x2678b8,_0x457a47){var _0x2e6b55=moment();var _0x13f2b7={'method':_0x3bbc('0x2f'),'uri':_0x4d1fe0+_0x3bbc('0x33'),'body':{'title':intUtil[_0x3bbc('0x34')](_0x3a367a[_0x3bbc('0x35')],_0x1c5722,'\x20'),'description':intUtil['getString'](_0x3a367a['Descriptions'],_0x1c5722,'\x0a'),'owner_id':_0x5e4380[_0x3bbc('0x1f')],'creater_id':_0x5e4380[_0x3bbc('0x13')],'targetable_id':_0x5e4380['endUserId'],'targetable_type':_0x3bbc('0x36'),'created_at':_0x2e6b55[_0x3bbc('0x30')](_0x3bbc('0x37')),'due_date':_0x2e6b55[_0x3bbc('0x38')](0x1e,'m')['format'](_0x3bbc('0x37'))},'json':!![]};_0x13f2b7[_0x3bbc('0xd')]=_0x53ce50;return rp(_0x13f2b7)[_0x3bbc('0xf')](function(_0x2c996b){_0x5e4380['ticketId']=_0x2c996b[_0x3bbc('0x39')]['id'];logger[_0x3bbc('0x12')](_0x3bbc('0x3a'),_0x5e4380[_0x3bbc('0x3b')]);_0x2678b8(_0x5e4380);})[_0x3bbc('0x2e')](function(_0x5d5d10){logger['error']('['+[_0x2516b['toUpperCase']()]+']',_0x5d5d10[_0x3bbc('0x17')]);_0x457a47(_0x5d5d10[_0x3bbc('0x17')]);});});};}function emit(_0x154c1a,_0x2b92a3,_0x1b02ac){var _0x4dac6f={'uri':_0x154c1a+'/contacts/'+_0x1b02ac};io['to'](util[_0x3bbc('0x30')]('user:%s',_0x2b92a3))[_0x3bbc('0x3c')]('trigger:browser:url',_0x4dac6f);}exports['cs']=function(_0x1d262b,_0xf18fa7,_0x5ee216,_0x161903,_0x58b159,_0x299a27,_0x5b6e96,_0x3da5c4){var _0x23eb60={};var _0x3c2f11={'Authorization':_0x3bbc('0x3d')+_0x299a27[_0x3bbc('0x3e')]};_0x299a27[_0x3bbc('0x3f')]=intUtil[_0x3bbc('0x40')](_0x299a27[_0x3bbc('0x3f')]);_0x299a27[_0x3bbc('0x41')]=intUtil['stripTrailingSlash'](_0x299a27[_0x3bbc('0x41')]);var _0x22d1c9=_0x299a27['remoteUri'];_0x23eb60[_0x3bbc('0x42')]=_0x299a27[_0x3bbc('0x43')];_0x23eb60[_0x3bbc('0x27')]=_0x3da5c4[_0x3bbc('0x44')]()===_0x3bbc('0x45')?_0xf18fa7[_0x3bbc('0x46')]:_0xf18fa7['calleridnum'];_0x23eb60['callDirection']=_0x3da5c4==='queue'||_0x3da5c4===_0x3bbc('0x47')?'queue':_0x3bbc('0x45');if(_0x161903){_0x23eb60[_0x3bbc('0x1b')]=_0x161903['email'];}var _0x54ce00=util[_0x3bbc('0x30')](_0x3bbc('0x48'),_0x299a27['serverUrl'],_0xf18fa7['uniqueid'],md5(_0xf18fa7[_0x3bbc('0x49')]));if(_0x58b159&&_0x58b159[_0x3bbc('0x4a')]){logger['info'](_0x3bbc('0x4b'),'Recording\x20is\x20enabled!');_0xf18fa7['recordingURL']=_0x54ce00;}else if(_0x5b6e96&&_0x5b6e96['recordingFormat']&&_0x5b6e96[_0x3bbc('0x4c')]!=='none'){logger[_0x3bbc('0x12')]('[OUTBOUND]',_0x3bbc('0x4d'));_0xf18fa7[_0x3bbc('0x4e')]=_0x54ce00;}else{_0xf18fa7[_0x3bbc('0x4e')]='';}return getAdminId(_0x23eb60,_0x3da5c4,_0x3c2f11,_0x22d1c9)[_0x3bbc('0xf')](getUser(_0x3da5c4,_0x3c2f11,_0x22d1c9))[_0x3bbc('0xf')](getEndUser(_0x3da5c4,_0x3c2f11,_0x22d1c9))[_0x3bbc('0xf')](getTicket(_0x3da5c4,_0x3c2f11,_0x22d1c9,_0x5ee216,_0xf18fa7))[_0x3bbc('0xf')](function(_0x39dbd1){logger[_0x3bbc('0x12')](util[_0x3bbc('0x30')](_0x3bbc('0x4f'),_0x39dbd1[_0x3bbc('0x3b')]));if(_0x3da5c4!==_0x3bbc('0x47')){logger[_0x3bbc('0x12')]('['+[_0x3da5c4[_0x3bbc('0x16')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x22d1c9,_0x161903[_0x3bbc('0x24')],_0x39dbd1[_0x3bbc('0x2c')]);}})[_0x3bbc('0x2e')](function(_0x4e4391){logger['error']('['+[_0x3da5c4[_0x3bbc('0x16')]()]+_0x3bbc('0x50'),util[_0x3bbc('0x51')](_0x4e4391,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x6e37=['stripTrailingSlash','adminEmail','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','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','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','users','length','email','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','Admin\x20selected','userEmail','message','/api/contacts/filters','headers','Getting\x20contacts\x20filter','filters','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','find','work_number','mobile_number','Contact\x20found:','endUserId','Contact\x20created:','POST','format','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','apiKey','remoteUri','serverUrl'];(function(_0x434e0a,_0x1ebc29){var _0xe3c6f6=function(_0x28d1d7){while(--_0x28d1d7){_0x434e0a['push'](_0x434e0a['shift']());}};_0xe3c6f6(++_0x1ebc29);}(_0x6e37,0x16c));var _0x76e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e37[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x76e3('0x0'));var rp=require(_0x76e3('0x1'));var md5=require(_0x76e3('0x2'));var util=require(_0x76e3('0x3'));var moment=require(_0x76e3('0x4'));var Promise=require(_0x76e3('0x5'));var Redis=require(_0x76e3('0x6'));var intUtil=require(_0x76e3('0x7'));var config=require(_0x76e3('0x8'));var logger=require('../../../../config/logger')('freshsales');config['redis']=_[_0x76e3('0x9')](config[_0x76e3('0xa')],{'host':_0x76e3('0xb'),'port':0x18eb});var io=require(_0x76e3('0xc'))(new Redis(config[_0x76e3('0xa')]));function getAdminId(_0x43249a,_0x1ad960,_0x5ef48,_0x3440ae){return new Promise(function(_0x40bd29,_0x4c09a9){var _0x3cc726=![];var _0x113574={'method':_0x76e3('0xd'),'uri':_0x3440ae+_0x76e3('0xe'),'json':!![]};_0x113574['headers']=_0x5ef48;logger[_0x76e3('0xf')]('Getting\x20admin\x20information');return rp(_0x113574)[_0x76e3('0x10')](function(_0x2b8d3b){if(_0x2b8d3b){var _0x4dc686=_0x2b8d3b[_0x76e3('0x11')];var _0x4e7742=null;for(_0x4e7742=0x0;_0x4e7742<_0x4dc686[_0x76e3('0x12')];_0x4e7742++){if(_0x4dc686[_0x4e7742][_0x76e3('0x13')]===_0x43249a['adminEmail']){_0x43249a['adminId']=_0x4dc686[_0x4e7742]['id'];_0x3cc726=!![];}}if(_0x3cc726){logger['info'](_0x76e3('0x14'),_0x43249a[_0x76e3('0x15')]);_0x40bd29(_0x43249a);}else{_0x4c09a9({'statusCode':0x194,'message':_0x76e3('0x16')});}}else{_0x4c09a9({'statusCode':0x194,'message':_0x76e3('0x16')});}})[_0x76e3('0x17')](function(_0xabb647){logger[_0x76e3('0x18')]('['+[_0x1ad960[_0x76e3('0x19')]()]+']',_0xabb647['message']);_0x4c09a9(_0xabb647);});});}function getUser(_0x123383,_0xe9ed20,_0xffd91f){return function(_0x25ed70){return new Promise(function(_0x162ecb,_0x5016b8){var _0x3ccb7c={'method':_0x76e3('0xd'),'uri':_0xffd91f+'/api/selector/owners','json':!![]};_0x3ccb7c['headers']=_0xe9ed20;logger[_0x76e3('0xf')](_0x76e3('0x1a'));return rp(_0x3ccb7c)[_0x76e3('0x10')](function(_0x3e4601){if(_0x3e4601){var _0x1fab86=_0x3e4601[_0x76e3('0x11')];var _0x1dfb21=![];var _0x1bbbaa=null;if(_0x25ed70[_0x76e3('0x1b')]!==null){logger[_0x76e3('0xf')](_0x76e3('0x1c'),_0x25ed70[_0x76e3('0x1b')]);_0x25ed70['userEmail']=_0x25ed70[_0x76e3('0x1b')];for(_0x1bbbaa=0x0;_0x1bbbaa<_0x1fab86[_0x76e3('0x12')];_0x1bbbaa++){if(_0x1fab86[_0x1bbbaa]['email']===_0x25ed70['agentEmail']){_0x1dfb21=!![];_0x25ed70['userId']=_0x1fab86[_0x1bbbaa]['id'];logger[_0x76e3('0xf')]('User\x20found:',_0x25ed70[_0x76e3('0x1d')]);}}}if(!_0x1dfb21){logger[_0x76e3('0xf')](_0x76e3('0x1e'));_0x25ed70[_0x76e3('0x1f')]=_0x25ed70['adminEmail'];_0x25ed70[_0x76e3('0x1d')]=_0x25ed70['adminId'];_0x1dfb21=!![];}if(_0x1dfb21){_0x162ecb(_0x25ed70);}else{_0x5016b8({'statusCode':0x194,'message':_0x76e3('0x16')});}}else{_0x5016b8({'statusCode':0x194,'message':_0x76e3('0x16')});}})[_0x76e3('0x17')](function(_0x2e46a5){logger[_0x76e3('0x18')]('['+[_0x123383[_0x76e3('0x19')]()]+']',_0x2e46a5[_0x76e3('0x20')]);_0x5016b8(_0x2e46a5);});});};}function getEndUser(_0x410a52,_0x1e7f66,_0x41f129){return function(_0x50c8bf){return new Promise(function(_0x1d641b,_0x25644b){var _0x3b2ffa=0x0;var _0x2437cc={'method':_0x76e3('0xd'),'uri':_0x41f129+_0x76e3('0x21'),'json':!![]};_0x2437cc[_0x76e3('0x22')]=_0x1e7f66;logger[_0x76e3('0xf')](_0x76e3('0x23'));return rp(_0x2437cc)[_0x76e3('0x10')](function(_0x5761dc){_0x5761dc[_0x76e3('0x24')]['forEach'](function(_0x3272ef){if(_0x3272ef['name']==='All\x20Contacts'){_0x3b2ffa=_0x3272ef['id'];}});})[_0x76e3('0x10')](function(){logger[_0x76e3('0xf')]('Getting\x20contact\x20list');var _0x3a1a93={'method':_0x76e3('0xd'),'uri':_0x41f129+_0x76e3('0x25')+_0x3b2ffa,'json':!![]};_0x3a1a93[_0x76e3('0x22')]=_0x1e7f66;return rp(_0x3a1a93);})[_0x76e3('0x10')](function(_0x5d2339){logger[_0x76e3('0xf')](_0x76e3('0x26'),_0x50c8bf[_0x76e3('0x27')]);if(_0x5d2339['contacts'][_0x76e3('0x12')]>0x0){var _0x123c16=_[_0x76e3('0x28')](_0x5d2339['contacts'],function(_0x1da638){if(_0x1da638[_0x76e3('0x29')]===_0x50c8bf[_0x76e3('0x27')]||_0x1da638[_0x76e3('0x2a')]===_0x50c8bf['contactNumber']){return _0x1da638;}});if(_0x123c16){_0x50c8bf['endUserId']=_0x123c16['id'];logger[_0x76e3('0xf')](_0x76e3('0x2b'),_0x50c8bf[_0x76e3('0x2c')]);_0x1d641b(_0x50c8bf);}else{return createEndUser(_0x50c8bf,_0x410a52,_0x1e7f66,_0x41f129)['then'](function(_0x202de1){logger[_0x76e3('0xf')](_0x76e3('0x2d'),_0x50c8bf[_0x76e3('0x2c')]);_0x1d641b(_0x202de1);});}}else{return createEndUser(_0x50c8bf,_0x410a52,_0x1e7f66,_0x41f129)[_0x76e3('0x10')](function(_0x3bd687){logger[_0x76e3('0xf')]('Contact\x20created:',_0x50c8bf['endUserId']);_0x1d641b(_0x3bd687);});}})['catch'](function(_0x1568ec){throw new Error(_0x1568ec[_0x76e3('0x20')]);});});};}function createEndUser(_0xb43c08,_0x15e2a2,_0x379b57,_0x369b8b){return new Promise(function(_0xbc5ea9,_0x5f51fd){var _0x588a0e=moment();var _0x3aa3da={'method':_0x76e3('0x2e'),'uri':_0x369b8b+'/api/contacts','body':{'contact':{'last_name':_0xb43c08[_0x76e3('0x27')],'work_number':_0xb43c08[_0x76e3('0x27')],'mobile_number':_0xb43c08[_0x76e3('0x27')],'owner_id':_0xb43c08[_0x76e3('0x1d')],'created_at':_0x588a0e[_0x76e3('0x2f')](_0x76e3('0x30'))}},'json':!![]};_0x3aa3da['headers']=_0x379b57;logger[_0x76e3('0xf')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3aa3da)['then'](function(_0x3be60e){_0xb43c08[_0x76e3('0x2c')]=_0x3be60e[_0x76e3('0x31')]['id'];_0xbc5ea9(_0xb43c08);})['catch'](function(_0x2682b9){logger['error']('['+[_0x15e2a2[_0x76e3('0x19')]()]+']',_0x2682b9[_0x76e3('0x20')]);_0x5f51fd(_0x2682b9[_0x76e3('0x20')]);});});}function getTicket(_0x42d1f4,_0x1ae8b9,_0x1c593b,_0x56ceee,_0x2d2ba6){return function(_0x4479c0){logger[_0x76e3('0xf')](_0x76e3('0x32'));return new Promise(function(_0xb1efdf,_0x2bca0d){var _0x4319f3=moment();var _0x8eeb3={'method':'POST','uri':_0x1c593b+_0x76e3('0x33'),'body':{'title':intUtil[_0x76e3('0x34')](_0x56ceee[_0x76e3('0x35')],_0x2d2ba6,'\x20'),'description':intUtil[_0x76e3('0x34')](_0x56ceee[_0x76e3('0x36')],_0x2d2ba6,'\x0a'),'owner_id':_0x4479c0[_0x76e3('0x1d')],'creater_id':_0x4479c0[_0x76e3('0x15')],'targetable_id':_0x4479c0['endUserId'],'targetable_type':_0x76e3('0x37'),'created_at':_0x4319f3[_0x76e3('0x2f')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4319f3[_0x76e3('0x38')](0x1e,'m')[_0x76e3('0x2f')](_0x76e3('0x30'))},'json':!![]};_0x8eeb3['headers']=_0x1ae8b9;return rp(_0x8eeb3)[_0x76e3('0x10')](function(_0xae7008){_0x4479c0[_0x76e3('0x39')]=_0xae7008[_0x76e3('0x3a')]['id'];logger[_0x76e3('0xf')](_0x76e3('0x3b'),_0x4479c0[_0x76e3('0x39')]);_0xb1efdf(_0x4479c0);})['catch'](function(_0x58648b){logger['error']('['+[_0x42d1f4[_0x76e3('0x19')]()]+']',_0x58648b[_0x76e3('0x20')]);_0x2bca0d(_0x58648b[_0x76e3('0x20')]);});});};}function emit(_0xb45feb,_0x522c2e,_0x1150e5){var _0x1f73cf={'uri':_0xb45feb+'/contacts/'+_0x1150e5};io['to'](util[_0x76e3('0x2f')](_0x76e3('0x3c'),_0x522c2e))[_0x76e3('0x3d')](_0x76e3('0x3e'),_0x1f73cf);}exports['cs']=function(_0x5e7d7f,_0x36d922,_0x259176,_0x16119d,_0x536e65,_0xa9025b,_0x3d710a,_0x3e1f43){var _0x430cd9={};var _0xd04ef5={'Authorization':'Token\x20token='+_0xa9025b[_0x76e3('0x3f')]};_0xa9025b[_0x76e3('0x40')]=intUtil['stripTrailingSlash'](_0xa9025b[_0x76e3('0x40')]);_0xa9025b[_0x76e3('0x41')]=intUtil[_0x76e3('0x42')](_0xa9025b['serverUrl']);var _0x50f4ea=_0xa9025b[_0x76e3('0x40')];_0x430cd9[_0x76e3('0x43')]=_0xa9025b[_0x76e3('0x44')];_0x430cd9[_0x76e3('0x27')]=_0x3e1f43[_0x76e3('0x45')]()===_0x76e3('0x46')?_0x36d922['destcalleridnum']:_0x36d922[_0x76e3('0x47')];_0x430cd9[_0x76e3('0x48')]=_0x3e1f43===_0x76e3('0x49')||_0x3e1f43===_0x76e3('0x4a')?'queue':_0x76e3('0x46');if(_0x16119d){_0x430cd9['agentEmail']=_0x16119d[_0x76e3('0x13')];}var _0x1999ba=util[_0x76e3('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa9025b['serverUrl'],_0x36d922[_0x76e3('0x4b')],md5(_0x36d922[_0x76e3('0x4b')]));if(_0x536e65&&_0x536e65[_0x76e3('0x4c')]){logger[_0x76e3('0xf')](_0x76e3('0x4d'),_0x76e3('0x4e'));_0x36d922['recordingURL']=_0x1999ba;}else if(_0x3d710a&&_0x3d710a['recordingFormat']&&_0x3d710a[_0x76e3('0x4f')]!==_0x76e3('0x50')){logger[_0x76e3('0xf')]('[OUTBOUND]',_0x76e3('0x4e'));_0x36d922[_0x76e3('0x51')]=_0x1999ba;}else{_0x36d922[_0x76e3('0x51')]='';}return getAdminId(_0x430cd9,_0x3e1f43,_0xd04ef5,_0x50f4ea)[_0x76e3('0x10')](getUser(_0x3e1f43,_0xd04ef5,_0x50f4ea))[_0x76e3('0x10')](getEndUser(_0x3e1f43,_0xd04ef5,_0x50f4ea))[_0x76e3('0x10')](getTicket(_0x3e1f43,_0xd04ef5,_0x50f4ea,_0x259176,_0x36d922))[_0x76e3('0x10')](function(_0x499f14){logger[_0x76e3('0xf')](util[_0x76e3('0x2f')](_0x76e3('0x52'),_0x499f14['ticketId']));if(_0x3e1f43!==_0x76e3('0x4a')){logger[_0x76e3('0xf')]('['+[_0x3e1f43[_0x76e3('0x19')]()]+']',_0x76e3('0x53'));emit(_0x50f4ea,_0x16119d[_0x76e3('0x54')],_0x499f14[_0x76e3('0x2c')]);}})[_0x76e3('0x17')](function(_0x123a00){logger['error']('['+[_0x3e1f43['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x76e3('0x55')](_0x123a00,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 6e0ddeb..9059617 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','./freshsales','zendesk','freshdesk','zoho','desk','freshsales','data1','toLowerCase','data2','find','Configurations','queue','outbound','log','unmanaged','salesforce','sugarcrm','vtiger','servicenow','dynamics365'];(function(_0x55cd87,_0x1f08e2){var _0x434fb8=function(_0xe7051b){while(--_0xe7051b){_0x55cd87['push'](_0x55cd87['shift']());}};_0x434fb8(++_0x1f08e2);}(_0x14a0,0x8e));var _0x014a=function(_0x4c5b65,_0x10244b){_0x4c5b65=_0x4c5b65-0x0;var _0x5400f0=_0x14a0[_0x4c5b65];return _0x5400f0;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var zendesk=require(_0x014a('0x1'));var salesforce=require(_0x014a('0x2'));var sugarcrm=require(_0x014a('0x3'));var freshdesk=require(_0x014a('0x4'));var zoho=require(_0x014a('0x5'));var desk=require(_0x014a('0x6'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x014a('0x7'));var freshsales=require(_0x014a('0x8'));var integrations=[_0x014a('0x9'),'salesforce','sugarcrm',_0x014a('0xa'),_0x014a('0xb'),_0x014a('0xc'),'vtiger','dynamics365',_0x014a('0xd'),'servicenow'];exports['exec']=function(_0x5aa52f,_0x4f3539,_0x330469,_0x4c7418,_0x431be8,_0x168c70){if(_0x330469){if(_['includes'](integrations,_0x5aa52f[_0x014a('0xe')][_0x014a('0xf')]())){try{var _0x2c84ad=null;var _0x43bfeb='';var _0x1bcd1=_0x330469[_0x5aa52f[_0x014a('0xe')][_0x014a('0xf')]()];if(_0x1bcd1){var _0x23c917=_0x1bcd1[_0x5aa52f[_0x014a('0x10')]];if(_0x23c917){var _0x71535d=_[_0x014a('0x11')](_0x23c917[_0x014a('0x12')],{'id':parseInt(_0x5aa52f['data3'],0xa)});if(_0x71535d){if(_0x4c7418){if(_0x431be8&&_0x4f3539[_0x014a('0x13')]){_0x43bfeb=_0x014a('0x13');}else if(_0x4f3539['routeId']){_0x43bfeb=_0x014a('0x14');}else{console[_0x014a('0x15')]('EVENT\x20UNKNOWN',_0x4f3539);}}else{_0x43bfeb=_0x014a('0x16');}switch(_0x5aa52f[_0x014a('0xe')][_0x014a('0xf')]()){case _0x014a('0x9'):zendesk[_0x43bfeb](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70);break;case _0x014a('0x17'):salesforce[_0x43bfeb](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70);break;case _0x014a('0x18'):sugarcrm[_0x43bfeb](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70);break;case _0x014a('0xa'):freshdesk[_0x43bfeb](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70);break;case _0x014a('0xb'):zoho[_0x43bfeb](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70);break;case _0x014a('0xc'):desk[_0x43bfeb](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70);break;case _0x014a('0x19'):vtiger[_0x43bfeb](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70);break;case _0x014a('0xd'):freshsales['cs'](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70,_0x43bfeb);break;case _0x014a('0x1a'):servicenow['cs'](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70,_0x43bfeb);break;case _0x014a('0x1b'):dynamics365['cs'](_0x5aa52f,_0x4f3539,_0x71535d,_0x4c7418,_0x431be8,_0x23c917,_0x168c70,_0x43bfeb);break;default:console[_0x014a('0x15')]('unknown\x20integration');}}else{_0x2c84ad=require(_0x014a('0x1c'))(_0x5aa52f[_0x014a('0xe')][_0x014a('0xf')]());_0x2c84ad[_0x014a('0x1d')](_0x014a('0x1e'),util[_0x014a('0x1f')](_0x014a('0x20'),_0x5aa52f[_0x014a('0xe')][_0x014a('0xf')](),_0x5aa52f['data3']));}}else{_0x2c84ad=require(_0x014a('0x1c'))(_0x5aa52f['data1'][_0x014a('0xf')]());_0x2c84ad[_0x014a('0x1d')](_0x014a('0x1e'),util[_0x014a('0x1f')](_0x014a('0x21'),_0x5aa52f[_0x014a('0xe')][_0x014a('0xf')](),_0x5aa52f[_0x014a('0x10')]));}}else{}}catch(_0x165a42){console['error'](_0x165a42);}}}};
\ No newline at end of file
+var _0xe605=['./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','freshdesk','vtiger','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho'];(function(_0x37e3d3,_0x48a25a){var _0x5b3db5=function(_0x126b52){while(--_0x126b52){_0x37e3d3['push'](_0x37e3d3['shift']());}};_0x5b3db5(++_0x48a25a);}(_0xe605,0x92));var _0x5e60=function(_0x1cb0ec,_0x66923e){_0x1cb0ec=_0x1cb0ec-0x0;var _0x4d64e0=_0xe605[_0x1cb0ec];return _0x4d64e0;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x5e60('0x2'));var sugarcrm=require(_0x5e60('0x3'));var freshdesk=require(_0x5e60('0x4'));var zoho=require(_0x5e60('0x5'));var desk=require(_0x5e60('0x6'));var vtiger=require(_0x5e60('0x7'));var servicenow=require(_0x5e60('0x8'));var dynamics365=require(_0x5e60('0x9'));var freshsales=require(_0x5e60('0xa'));var integrations=[_0x5e60('0xb'),_0x5e60('0xc'),_0x5e60('0xd'),'freshdesk',_0x5e60('0xe'),'desk','vtiger','dynamics365',_0x5e60('0xf'),_0x5e60('0x10')];exports[_0x5e60('0x11')]=function(_0x2c5425,_0x331b3e,_0x2cbe4e,_0x56f05a,_0x6ab0ce,_0x527f7b){if(_0x2cbe4e){if(_[_0x5e60('0x12')](integrations,_0x2c5425[_0x5e60('0x13')][_0x5e60('0x14')]())){try{var _0x51e7f6=null;var _0x371df7='';var _0x178782=_0x2cbe4e[_0x2c5425[_0x5e60('0x13')][_0x5e60('0x14')]()];if(_0x178782){var _0x2874c4=_0x178782[_0x2c5425[_0x5e60('0x15')]];if(_0x2874c4){var _0x4fd10e=_[_0x5e60('0x16')](_0x2874c4[_0x5e60('0x17')],{'id':parseInt(_0x2c5425[_0x5e60('0x18')],0xa)});if(_0x4fd10e){if(_0x56f05a){if(_0x6ab0ce&&_0x331b3e[_0x5e60('0x19')]){_0x371df7='queue';}else if(_0x331b3e[_0x5e60('0x1a')]){_0x371df7='outbound';}else{console[_0x5e60('0x1b')](_0x5e60('0x1c'),_0x331b3e);}}else{_0x371df7='unmanaged';}switch(_0x2c5425[_0x5e60('0x13')][_0x5e60('0x14')]()){case _0x5e60('0xb'):zendesk[_0x371df7](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b);break;case _0x5e60('0xc'):salesforce[_0x371df7](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b);break;case'sugarcrm':sugarcrm[_0x371df7](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b);break;case _0x5e60('0x1d'):freshdesk[_0x371df7](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b);break;case _0x5e60('0xe'):zoho[_0x371df7](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b);break;case'desk':desk[_0x371df7](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b);break;case _0x5e60('0x1e'):vtiger[_0x371df7](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b);break;case _0x5e60('0xf'):freshsales['cs'](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b,_0x371df7);break;case _0x5e60('0x10'):servicenow['cs'](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b,_0x371df7);break;case _0x5e60('0x1f'):dynamics365['cs'](_0x2c5425,_0x331b3e,_0x4fd10e,_0x56f05a,_0x6ab0ce,_0x2874c4,_0x527f7b,_0x371df7);break;default:console[_0x5e60('0x1b')](_0x5e60('0x20'));}}else{_0x51e7f6=require(_0x5e60('0x21'))(_0x2c5425[_0x5e60('0x13')][_0x5e60('0x14')]());_0x51e7f6[_0x5e60('0x22')](_0x5e60('0x23'),util['format'](_0x5e60('0x24'),_0x2c5425['data1'][_0x5e60('0x14')](),_0x2c5425[_0x5e60('0x18')]));}}else{_0x51e7f6=require(_0x5e60('0x21'))(_0x2c5425[_0x5e60('0x13')][_0x5e60('0x14')]());_0x51e7f6[_0x5e60('0x22')](_0x5e60('0x23'),util['format'](_0x5e60('0x25'),_0x2c5425[_0x5e60('0x13')][_0x5e60('0x14')](),_0x2c5425['data2']));}}else{}}catch(_0x45cb62){console[_0x5e60('0x22')](_0x45cb62);}}}};
\ No newline at end of file
index 62ed973..8959ce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1737=['[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','Recording\x20is\x20enabled!','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','assign','getString','Subjects','WhoId','Case','Descriptions','ContactId','sobject','isNil','validateEmail','User','execute','length','find','Email','Agent\x20%s\x20found.','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','then','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','<unknown>','Caller\x20-\x20%s','moduleCreate','Task','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','create','forEach','type','string','idField','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','password','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','none','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x1737,0x161));var _0x7173=function(_0x2c5224,_0x38a225){_0x2c5224=_0x2c5224-0x0;var _0x4f02a3=_0x1737[_0x2c5224];return _0x4f02a3;};'use strict';var _=require(_0x7173('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7173('0x1'));var md5=require(_0x7173('0x2'));var jsforce=require(_0x7173('0x3'));var util=require(_0x7173('0x4'));var Redis=require(_0x7173('0x5'));var intUtil=require(_0x7173('0x6'));var config=require(_0x7173('0x7'));var logger=require('../../../../config/logger')(_0x7173('0x8'));config[_0x7173('0x9')]=_[_0x7173('0xa')](config[_0x7173('0x9')],{'host':_0x7173('0xb'),'port':0x18eb});var io=require(_0x7173('0xc'))(new Redis(config[_0x7173('0x9')]));function emit(_0x560fdb,_0x3ecaf5,_0x3885b0){io['to'](_0x560fdb)['emit'](_0x3ecaf5,_0x3885b0);}function getTicket(_0x59b52f,_0x3ff5ad,_0x4af743,_0x12d74c,_0x30b474,_0xce4664,_0x1ccfd8,_0x1c4601){var _0x2037c8={};if(_0x12d74c[_0x7173('0xd')]==='Task'){_0x2037c8=Object[_0x7173('0xe')]({},{'OwnerId':_0x3ff5ad['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x7173('0xf')](_0x12d74c[_0x7173('0x10')],_0x30b474,'\x20'),'Description':intUtil[_0x7173('0xf')](_0x12d74c['Descriptions'],_0x30b474,'\x0a')},getCustomFields(_0xce4664,_0x30b474));if(_0x4af743){_0x2037c8[_0x7173('0x11')]=_0x4af743['id'];}}else if(_0x12d74c[_0x7173('0xd')]===_0x7173('0x12')){_0x2037c8=Object[_0x7173('0xe')]({},{'OwnerId':_0x3ff5ad['id'],'Subject':intUtil[_0x7173('0xf')](_0x12d74c[_0x7173('0x10')],_0x30b474,'\x20'),'Description':intUtil[_0x7173('0xf')](_0x12d74c[_0x7173('0x13')],_0x30b474,'\x0a')},getCustomFields(_0xce4664,_0x30b474));if(_0x4af743){_0x2037c8[_0x7173('0x14')]=_0x4af743['id'];}}return _0x1ccfd8[_0x7173('0x15')](_0x12d74c['ticketType'])['create'](_0x2037c8);}function getUser(_0x1852b3,_0x268a95,_0x586d86){if(!_[_0x7173('0x16')](_0x268a95)&&intUtil[_0x7173('0x17')](_0x268a95)){var _0x38e9cf={'Email':_0x268a95};var _0x57221e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x586d86[_0x7173('0x15')](_0x7173('0x18'))['find'](_0x38e9cf,_0x57221e)[_0x7173('0x19')]()['then'](function(_0x39eed8){if(_0x39eed8[_0x7173('0x1a')]){var _0x47d38c=_[_0x7173('0x1b')](_0x39eed8,function(_0x147df4){return _0x147df4[_0x7173('0x1c')]===_0x268a95;});if(_0x47d38c){logger['info'](_0x7173('0x1d'),_0x268a95);return BPromise[_0x7173('0x1e')]({'id':_0x47d38c['Id'],'name':_0x47d38c[_0x7173('0x1f')]});}}else{logger[_0x7173('0x20')](_0x7173('0x21'),_0x268a95);return _0x586d86[_0x7173('0x22')]()['then'](function(_0x21238f){return BPromise[_0x7173('0x1e')]({'id':_0x21238f[_0x7173('0x23')],'name':_0x21238f['display_name']});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x268a95);return _0x586d86[_0x7173('0x22')]()[_0x7173('0x24')](function(_0x1b6fbd){return BPromise[_0x7173('0x1e')]({'id':_0x1b6fbd[_0x7173('0x23')],'name':_0x1b6fbd[_0x7173('0x25')]});});}}function getEndUser(_0x164d56,_0x2f8815,_0x12ffa9,_0x311e34,_0x319ced){var _0x5c16b8={'Phone':_0x311e34};var _0x441c15={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7173('0x1e')]()[_0x7173('0x24')](function(){if(_0x2f8815[_0x7173('0xd')]==='Task'){logger[_0x7173('0x20')](_0x7173('0x26'),_0x311e34,_0x2f8815[_0x7173('0x27')]);switch(_0x2f8815[_0x7173('0x27')]){case'contact_lead':return _0x319ced[_0x7173('0x15')](_0x7173('0x28'))[_0x7173('0x1b')](_0x5c16b8,_0x441c15)[_0x7173('0x19')]()['then'](function(_0x2c7013){if(_0x2c7013&&_0x2c7013[_0x7173('0x1a')]){return _0x2c7013;}else{return _0x319ced[_0x7173('0x15')](_0x7173('0x29'))[_0x7173('0x1b')](_0x5c16b8,_0x441c15);}});case _0x7173('0x2a'):return _0x319ced['sobject'](_0x7173('0x28'))['find'](_0x5c16b8,_0x441c15)[_0x7173('0x19')]();case _0x7173('0x2b'):return _0x319ced[_0x7173('0x15')]('Lead')[_0x7173('0x1b')](_0x5c16b8,_0x441c15);default:return null;}}else if(_0x2f8815['ticketType']===_0x7173('0x12')){logger[_0x7173('0x20')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x311e34,_0x7173('0x2a'));return _0x319ced[_0x7173('0x15')](_0x7173('0x28'))[_0x7173('0x1b')](_0x5c16b8,_0x441c15)[_0x7173('0x19')]();}})[_0x7173('0x24')](function(_0xc4591d){if(_0xc4591d&&_0xc4591d['length']){var _0x416096=_[_0x7173('0x1b')](_0xc4591d,function(_0x48f4da){return _0x48f4da[_0x7173('0x2c')]===_0x311e34;});if(_0x416096){return BPromise[_0x7173('0x1e')]({'id':_0x416096['Id'],'name':_0x416096[_0x7173('0x1f')],'phone':_0x416096[_0x7173('0x2c')]});}}})[_0x7173('0x24')](function(_0x5b695c){if(_0x5b695c){logger[_0x7173('0x20')](_0x7173('0x2d'),_0x311e34);return BPromise[_0x7173('0x1e')](_0x5b695c);}else{logger[_0x7173('0x20')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x311e34);var _0xc53d10={'LastName':_0x12ffa9!==_0x7173('0x2e')?_0x12ffa9:util['format'](_0x7173('0x2f'),_0x311e34),'Phone':_0x311e34};if(_0x2f8815[_0x7173('0x30')]){if(_0x2f8815[_0x7173('0x30')]===_0x7173('0x2a')){logger[_0x7173('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x311e34,_0x2f8815['moduleCreate']);}else if(_0x2f8815[_0x7173('0x30')]===_0x7173('0x2b')&&_0x2f8815[_0x7173('0xd')]===_0x7173('0x31')){logger[_0x7173('0x20')](_0x7173('0x32'),_0x311e34,_0x2f8815['moduleCreate']);_0xc53d10[_0x7173('0x33')]='No\x20Company';}else{return null;}}return _0x319ced[_0x7173('0x15')](_[_0x7173('0x34')](_0x2f8815['moduleCreate']))[_0x7173('0x35')](_0xc53d10);}});}function getCustomFields(_0x5af699,_0x29a112){var _0x439b14={};if(_0x5af699['length']>0x0){_[_0x7173('0x36')](_0x5af699,function(_0x33f710){if(_0x33f710[_0x7173('0x37')]===_0x7173('0x38')&&_0x33f710['idField']){_0x439b14[_0x33f710[_0x7173('0x39')]]=_0x33f710[_0x7173('0x3a')]['toString']();}else if(_0x33f710[_0x7173('0x37')]===_0x7173('0x3b')&&_0x33f710[_0x7173('0x3c')]&&_0x33f710['idField']){_0x29a112[_0x33f710[_0x7173('0x3c')]]&&(_0x439b14[_0x33f710['idField']]=_0x29a112[_0x33f710[_0x7173('0x3c')]]['toString']());}else if(_0x33f710['type']===_0x7173('0x3d')&&_0x33f710['Variable']&&_0x33f710['Variable']['name']&&_0x33f710['idField']){_0x29a112[_0x33f710[_0x7173('0x3e')][_0x7173('0x3f')][_0x7173('0x40')]()]&&(_0x439b14[_0x33f710[_0x7173('0x39')]]=_0x29a112[_0x33f710['Variable'][_0x7173('0x3f')][_0x7173('0x40')]()][_0x7173('0x41')]());}});}return _0x439b14;}function getConnection(_0x52f88a){var _0x45f7a6=_0x52f88a[_0x7173('0x42')]['concat'](_0x52f88a[_0x7173('0x43')]);var _0x22fc15=new jsforce[(_0x7173('0x44'))]({'oauth2':{'loginUrl':_0x52f88a['remoteUri']||_0x7173('0x45'),'clientId':_0x52f88a[_0x7173('0x46')],'clientSecret':_0x52f88a[_0x7173('0x47')]}});return _0x22fc15[_0x7173('0x48')](_0x52f88a[_0x7173('0x49')],_0x45f7a6)[_0x7173('0x24')](function(){logger['info'](_0x7173('0x4a'));return _0x22fc15;});}exports[_0x7173('0x4b')]=function(_0x16ca2c,_0x359b62,_0x175ecd,_0x380c9b,_0x3a0598,_0x36bd05){var _0x13f1c0,_0x2b162a,_0x3602c7,_0x2942dc;_0x36bd05[_0x7173('0x4c')]=intUtil['stripTrailingSlash'](_0x36bd05[_0x7173('0x4c')]);_0x36bd05[_0x7173('0x4d')]=intUtil[_0x7173('0x4e')](_0x36bd05['remoteUri']);if(_0x3a0598&&_0x3a0598[_0x7173('0x4f')]){logger[_0x7173('0x20')](_0x7173('0x50'),'Recording\x20is\x20enabled!');_0x359b62[_0x7173('0x51')]=util[_0x7173('0x52')](_0x7173('0x53'),_0x36bd05['serverUrl'],_0x359b62[_0x7173('0x54')],md5(_0x359b62[_0x7173('0x54')]));}else{_0x359b62[_0x7173('0x51')]='';}return getConnection(_0x36bd05)[_0x7173('0x24')](function(_0xc416b7){_0x2942dc=_0xc416b7;return getUser(_0x36bd05,_0x380c9b[_0x7173('0x55')],_0x2942dc);})[_0x7173('0x24')](function(_0x502fa3){_0x13f1c0=_0x502fa3;return getEndUser(_0x36bd05,_0x175ecd,_0x359b62[_0x7173('0x56')],_0x359b62[_0x7173('0x57')],_0x2942dc);})[_0x7173('0x24')](function(_0x4446e4){_0x2b162a=_0x4446e4;return getTicket(_0x36bd05,_0x13f1c0,_0x2b162a,_0x175ecd,_0x359b62,_0x175ecd[_0x7173('0x58')],_0x2942dc,'queue');})[_0x7173('0x24')](function(_0x2daae2){_0x3602c7=_0x2daae2;logger[_0x7173('0x20')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3602c7['id']);logger['info'](_0x7173('0x59'),_0x3602c7['id'],_0x380c9b['name'],_0x36bd05[_0x7173('0x37')]);switch(_0x36bd05[_0x7173('0x37')]){case _0x7173('0x5a'):emit(util[_0x7173('0x52')](_0x7173('0x5b'),_0x380c9b[_0x7173('0x3f')]),_0x7173('0x5c'),{'recordId':_0x3602c7['id']});break;case'newTab':emit(util[_0x7173('0x52')](_0x7173('0x5b'),_0x380c9b[_0x7173('0x3f')]),_0x7173('0x5d'),{'uri':util[_0x7173('0x52')](_0x7173('0x5e'),_0x2942dc[_0x7173('0x5f')],_0x3602c7['id'])});break;default:logger[_0x7173('0x60')](_0x7173('0x61'));}})[_0x7173('0x62')](function(_0x5b7ae0){logger['error'](_0x7173('0x50'),JSON[_0x7173('0x63')](_0x5b7ae0));});};exports[_0x7173('0x64')]=function(_0x5f51bb,_0x91dc85,_0x34f281,_0x285967,_0x4d4309,_0x56e91f,_0x2bb44d){var _0x42cd5d,_0x42bfd8,_0x458ae6,_0x42d3eb;_0x56e91f['serverUrl']=intUtil['stripTrailingSlash'](_0x56e91f[_0x7173('0x4c')]);_0x56e91f['remoteUri']=intUtil[_0x7173('0x4e')](_0x56e91f[_0x7173('0x4d')]);if(_0x2bb44d&&_0x2bb44d[_0x7173('0x65')]&&_0x2bb44d[_0x7173('0x65')]!==_0x7173('0x66')){logger[_0x7173('0x20')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x91dc85[_0x7173('0x51')]=util[_0x7173('0x52')](_0x7173('0x53'),_0x56e91f['serverUrl'],_0x91dc85[_0x7173('0x54')],md5(_0x91dc85['uniqueid']));}return getConnection(_0x56e91f)['then'](function(_0x5bb031){_0x42d3eb=_0x5bb031;return getUser(_0x56e91f,_0x285967[_0x7173('0x55')],_0x42d3eb);})[_0x7173('0x24')](function(_0x33c35e){_0x42cd5d=_0x33c35e;return getEndUser(_0x56e91f,_0x34f281,_0x91dc85['destcalleridname'],_0x91dc85[_0x7173('0x67')],_0x42d3eb);})[_0x7173('0x24')](function(_0x30b6f5){_0x42bfd8=_0x30b6f5;return getTicket(_0x56e91f,_0x42cd5d,_0x42bfd8,_0x34f281,_0x91dc85,_0x34f281[_0x7173('0x58')],_0x42d3eb,'outbound');})[_0x7173('0x24')](function(_0x30692a){_0x458ae6=_0x30692a;logger['info'](_0x7173('0x68'),_0x458ae6['id']);logger[_0x7173('0x20')](_0x7173('0x69'),_0x458ae6['id'],_0x285967[_0x7173('0x3f')],_0x56e91f[_0x7173('0x37')]);switch(_0x56e91f[_0x7173('0x37')]){case _0x7173('0x5a'):emit(util['format']('user:%s',_0x285967[_0x7173('0x3f')]),_0x7173('0x5c'),{'recordId':_0x458ae6['id']});break;case _0x7173('0x6a'):emit(util['format'](_0x7173('0x5b'),_0x285967[_0x7173('0x3f')]),_0x7173('0x5d'),{'uri':util[_0x7173('0x52')]('%s/%s/e',_0x42d3eb[_0x7173('0x5f')],_0x458ae6['id'])});break;default:logger['error'](_0x7173('0x6b'),_0x7173('0x6c'));}})[_0x7173('0x62')](function(_0x127e0e){logger[_0x7173('0x60')](_0x7173('0x6b'),JSON[_0x7173('0x63')](_0x127e0e));});};exports[_0x7173('0x6d')]=function(_0x105b29,_0x5a56ba,_0x152391,_0x59f9cb,_0x1aeafd,_0x434ca6){var _0x494cca,_0x576989,_0x276810,_0x5a29be;_0x434ca6[_0x7173('0x4c')]=intUtil[_0x7173('0x4e')](_0x434ca6[_0x7173('0x4c')]);_0x434ca6[_0x7173('0x4d')]=intUtil[_0x7173('0x4e')](_0x434ca6['remoteUri']);if(_0x1aeafd&&_0x1aeafd[_0x7173('0x4f')]){logger[_0x7173('0x20')]('['+_0x5a56ba['lastevent'][_0x7173('0x6e')]()+']',_0x7173('0x6f'));_0x5a56ba[_0x7173('0x51')]=util['format'](_0x7173('0x53'),_0x434ca6[_0x7173('0x4c')],_0x5a56ba[_0x7173('0x54')],md5(_0x5a56ba[_0x7173('0x54')]));}else{_0x5a56ba[_0x7173('0x51')]='';}return getConnection(_0x434ca6)['then'](function(_0x17f2db){_0x5a29be=_0x17f2db;if(!_['isNil'](_0x59f9cb)){return getUser(_0x434ca6,_0x59f9cb[_0x7173('0x3f')],_0x5a29be);}else{return getUser(_0x434ca6,null,_0x5a29be);}})[_0x7173('0x24')](function(_0x21d772){_0x494cca=_0x21d772;return getEndUser(_0x434ca6,_0x152391,_0x5a56ba[_0x7173('0x56')],_0x5a56ba['calleridnum'],_0x5a29be);})[_0x7173('0x24')](function(_0x2139d){_0x576989=_0x2139d;return getTicket(_0x434ca6,_0x494cca,_0x576989,_0x152391,_0x5a56ba,_0x152391[_0x7173('0x58')],_0x5a29be);})[_0x7173('0x24')](function(_0x5bddd3){_0x276810=_0x5bddd3;logger[_0x7173('0x20')]('['+_0x5a56ba[_0x7173('0x70')][_0x7173('0x6e')]()+_0x7173('0x71'),_0x276810['id']);logger[_0x7173('0x20')]('['+_0x5a56ba[_0x7173('0x70')]['toUpperCase']()+_0x7173('0x72'),_0x434ca6[_0x7173('0x37')]);})['catch'](function(_0x1e0b2e){logger[_0x7173('0x60')]('['+_0x5a56ba[_0x7173('0x70')][_0x7173('0x6e')]()+']',JSON['stringify'](_0x1e0b2e));});};
\ No newline at end of file
+var _0xe3d1=['Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','type','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[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','error','catch','stringify','outbound','recordingFormat','none','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','utc','getString','Subjects','Descriptions','Case','assign','ContactId','isNil','validateEmail','sobject','User','then','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','info','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Contact','execute','length','Lead','contact','lead','Phone','format'];(function(_0x5695a2,_0xf3ce4a){var _0x4bc1f3=function(_0x4c8c81){while(--_0x4c8c81){_0x5695a2['push'](_0x5695a2['shift']());}};_0x4bc1f3(++_0xf3ce4a);}(_0xe3d1,0x17e));var _0x1e3d=function(_0x47604d,_0x15a014){_0x47604d=_0x47604d-0x0;var _0x388e4c=_0xe3d1[_0x47604d];return _0x388e4c;};'use strict';var _=require(_0x1e3d('0x0'));var rp=require(_0x1e3d('0x1'));var moment=require(_0x1e3d('0x2'));var BPromise=require(_0x1e3d('0x3'));var md5=require('md5');var jsforce=require(_0x1e3d('0x4'));var util=require('util');var Redis=require(_0x1e3d('0x5'));var intUtil=require('./util');var config=require(_0x1e3d('0x6'));var logger=require(_0x1e3d('0x7'))('salesforce');config[_0x1e3d('0x8')]=_[_0x1e3d('0x9')](config[_0x1e3d('0x8')],{'host':_0x1e3d('0xa'),'port':0x18eb});var io=require(_0x1e3d('0xb'))(new Redis(config[_0x1e3d('0x8')]));function emit(_0x6bd1ef,_0x3eeed8,_0x1ad720){io['to'](_0x6bd1ef)[_0x1e3d('0xc')](_0x3eeed8,_0x1ad720);}function getTicket(_0x3a80df,_0x4860e3,_0x26f885,_0x43d173,_0x2ca3a2,_0x21c84c,_0x2aefdd,_0x277680){var _0x4e9da4={};if(_0x43d173[_0x1e3d('0xd')]===_0x1e3d('0xe')){_0x4e9da4=Object['assign']({},{'OwnerId':_0x4860e3['id'],'ActivityDate':moment[_0x1e3d('0xf')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x1e3d('0x10')](_0x43d173[_0x1e3d('0x11')],_0x2ca3a2,'\x20'),'Description':intUtil[_0x1e3d('0x10')](_0x43d173[_0x1e3d('0x12')],_0x2ca3a2,'\x0a')},getCustomFields(_0x21c84c,_0x2ca3a2));if(_0x26f885){_0x4e9da4['WhoId']=_0x26f885['id'];}}else if(_0x43d173[_0x1e3d('0xd')]===_0x1e3d('0x13')){_0x4e9da4=Object[_0x1e3d('0x14')]({},{'OwnerId':_0x4860e3['id'],'Subject':intUtil[_0x1e3d('0x10')](_0x43d173[_0x1e3d('0x11')],_0x2ca3a2,'\x20'),'Description':intUtil[_0x1e3d('0x10')](_0x43d173[_0x1e3d('0x12')],_0x2ca3a2,'\x0a')},getCustomFields(_0x21c84c,_0x2ca3a2));if(_0x26f885){_0x4e9da4[_0x1e3d('0x15')]=_0x26f885['id'];}}return _0x2aefdd['sobject'](_0x43d173['ticketType'])['create'](_0x4e9da4);}function getUser(_0x58bb88,_0x255281,_0xd34003){if(!_[_0x1e3d('0x16')](_0x255281)&&intUtil[_0x1e3d('0x17')](_0x255281)){var _0xe73c90={'Email':_0x255281};var _0x527902={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xd34003[_0x1e3d('0x18')](_0x1e3d('0x19'))['find'](_0xe73c90,_0x527902)['execute']()[_0x1e3d('0x1a')](function(_0xbcf7ca){if(_0xbcf7ca['length']){var _0x37df57=_[_0x1e3d('0x1b')](_0xbcf7ca,function(_0x4f2d3e){return _0x4f2d3e[_0x1e3d('0x1c')]===_0x255281;});if(_0x37df57){logger['info'](_0x1e3d('0x1d'),_0x255281);return BPromise[_0x1e3d('0x1e')]({'id':_0x37df57['Id'],'name':_0x37df57[_0x1e3d('0x1f')]});}}else{logger['info'](_0x1e3d('0x20'),_0x255281);return _0xd34003[_0x1e3d('0x21')]()[_0x1e3d('0x1a')](function(_0x5c76f4){return BPromise[_0x1e3d('0x1e')]({'id':_0x5c76f4['user_id'],'name':_0x5c76f4[_0x1e3d('0x22')]});});}});}else{logger[_0x1e3d('0x23')](_0x1e3d('0x20'),_0x255281);return _0xd34003[_0x1e3d('0x21')]()['then'](function(_0x2049e2){return BPromise[_0x1e3d('0x1e')]({'id':_0x2049e2[_0x1e3d('0x24')],'name':_0x2049e2[_0x1e3d('0x22')]});});}}function getEndUser(_0x3647c0,_0x82fef6,_0x2fa3b9,_0x419301,_0x4260fb){var _0x35c693={'Phone':_0x419301};var _0x50fd38={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x1e3d('0x1a')](function(){if(_0x82fef6[_0x1e3d('0xd')]===_0x1e3d('0xe')){logger['info'](_0x1e3d('0x25'),_0x419301,_0x82fef6['moduleSearch']);switch(_0x82fef6['moduleSearch']){case'contact_lead':return _0x4260fb['sobject'](_0x1e3d('0x26'))['find'](_0x35c693,_0x50fd38)[_0x1e3d('0x27')]()[_0x1e3d('0x1a')](function(_0x171fb1){if(_0x171fb1&&_0x171fb1[_0x1e3d('0x28')]){return _0x171fb1;}else{return _0x4260fb[_0x1e3d('0x18')](_0x1e3d('0x29'))[_0x1e3d('0x1b')](_0x35c693,_0x50fd38);}});case _0x1e3d('0x2a'):return _0x4260fb[_0x1e3d('0x18')]('Contact')[_0x1e3d('0x1b')](_0x35c693,_0x50fd38)['execute']();case _0x1e3d('0x2b'):return _0x4260fb[_0x1e3d('0x18')](_0x1e3d('0x29'))[_0x1e3d('0x1b')](_0x35c693,_0x50fd38);default:return null;}}else if(_0x82fef6[_0x1e3d('0xd')]==='Case'){logger[_0x1e3d('0x23')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x419301,_0x1e3d('0x2a'));return _0x4260fb[_0x1e3d('0x18')](_0x1e3d('0x26'))[_0x1e3d('0x1b')](_0x35c693,_0x50fd38)[_0x1e3d('0x27')]();}})[_0x1e3d('0x1a')](function(_0x2c1439){if(_0x2c1439&&_0x2c1439[_0x1e3d('0x28')]){var _0x512d40=_['find'](_0x2c1439,function(_0x4cceb6){return _0x4cceb6['Phone']===_0x419301;});if(_0x512d40){return BPromise[_0x1e3d('0x1e')]({'id':_0x512d40['Id'],'name':_0x512d40[_0x1e3d('0x1f')],'phone':_0x512d40[_0x1e3d('0x2c')]});}}})[_0x1e3d('0x1a')](function(_0x534302){if(_0x534302){logger['info']('Enduser\x20with\x20phone\x20%s\x20found.',_0x419301);return BPromise[_0x1e3d('0x1e')](_0x534302);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x419301);var _0x4a3217={'LastName':_0x2fa3b9!=='<unknown>'?_0x2fa3b9:util[_0x1e3d('0x2d')](_0x1e3d('0x2e'),_0x419301),'Phone':_0x419301};if(_0x82fef6[_0x1e3d('0x2f')]){if(_0x82fef6['moduleCreate']===_0x1e3d('0x2a')){logger[_0x1e3d('0x23')](_0x1e3d('0x30'),_0x419301,_0x82fef6[_0x1e3d('0x2f')]);}else if(_0x82fef6[_0x1e3d('0x2f')]===_0x1e3d('0x2b')&&_0x82fef6[_0x1e3d('0xd')]===_0x1e3d('0xe')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x419301,_0x82fef6[_0x1e3d('0x2f')]);_0x4a3217[_0x1e3d('0x31')]=_0x1e3d('0x32');}else{return null;}}return _0x4260fb[_0x1e3d('0x18')](_[_0x1e3d('0x33')](_0x82fef6[_0x1e3d('0x2f')]))[_0x1e3d('0x34')](_0x4a3217);}});}function getCustomFields(_0x24c9d5,_0x684988){var _0x1bf352={};if(_0x24c9d5[_0x1e3d('0x28')]>0x0){_['forEach'](_0x24c9d5,function(_0x3356c2){if(_0x3356c2[_0x1e3d('0x35')]==='string'&&_0x3356c2[_0x1e3d('0x36')]){_0x1bf352[_0x3356c2[_0x1e3d('0x36')]]=_0x3356c2[_0x1e3d('0x37')]['toString']();}else if(_0x3356c2['type']===_0x1e3d('0x38')&&_0x3356c2[_0x1e3d('0x39')]&&_0x3356c2[_0x1e3d('0x36')]){_0x684988[_0x3356c2[_0x1e3d('0x39')]]&&(_0x1bf352[_0x3356c2[_0x1e3d('0x36')]]=_0x684988[_0x3356c2[_0x1e3d('0x39')]][_0x1e3d('0x3a')]());}else if(_0x3356c2[_0x1e3d('0x35')]===_0x1e3d('0x3b')&&_0x3356c2[_0x1e3d('0x3c')]&&_0x3356c2[_0x1e3d('0x3c')][_0x1e3d('0x3d')]&&_0x3356c2[_0x1e3d('0x36')]){_0x684988[_0x3356c2['Variable'][_0x1e3d('0x3d')]['toLowerCase']()]&&(_0x1bf352[_0x3356c2['idField']]=_0x684988[_0x3356c2['Variable'][_0x1e3d('0x3d')]['toLowerCase']()][_0x1e3d('0x3a')]());}});}return _0x1bf352;}function getConnection(_0x22c858){var _0x872262=_0x22c858[_0x1e3d('0x3e')][_0x1e3d('0x3f')](_0x22c858['securityToken']);var _0x4d10bd=new jsforce[(_0x1e3d('0x40'))]({'oauth2':{'loginUrl':_0x22c858[_0x1e3d('0x41')]||'https://login.salesforce.com','clientId':_0x22c858[_0x1e3d('0x42')],'clientSecret':_0x22c858[_0x1e3d('0x43')]}});return _0x4d10bd[_0x1e3d('0x44')](_0x22c858[_0x1e3d('0x45')],_0x872262)[_0x1e3d('0x1a')](function(){logger[_0x1e3d('0x23')](_0x1e3d('0x46'));return _0x4d10bd;});}exports[_0x1e3d('0x47')]=function(_0x478edc,_0x37702c,_0x594469,_0x19404f,_0x1dd6fb,_0x2e7b2a){var _0x1e07e7,_0x3e3ac0,_0x3df026,_0x5778a9;_0x2e7b2a[_0x1e3d('0x48')]=intUtil[_0x1e3d('0x49')](_0x2e7b2a['serverUrl']);_0x2e7b2a[_0x1e3d('0x41')]=intUtil['stripTrailingSlash'](_0x2e7b2a[_0x1e3d('0x41')]);if(_0x1dd6fb&&_0x1dd6fb[_0x1e3d('0x4a')]){logger[_0x1e3d('0x23')](_0x1e3d('0x4b'),_0x1e3d('0x4c'));_0x37702c[_0x1e3d('0x4d')]=util[_0x1e3d('0x2d')](_0x1e3d('0x4e'),_0x2e7b2a[_0x1e3d('0x48')],_0x37702c['uniqueid'],md5(_0x37702c[_0x1e3d('0x4f')]));}else{_0x37702c[_0x1e3d('0x4d')]='';}return getConnection(_0x2e7b2a)[_0x1e3d('0x1a')](function(_0x182969){_0x5778a9=_0x182969;return getUser(_0x2e7b2a,_0x19404f[_0x1e3d('0x50')],_0x5778a9);})[_0x1e3d('0x1a')](function(_0x5e9b40){_0x1e07e7=_0x5e9b40;return getEndUser(_0x2e7b2a,_0x594469,_0x37702c[_0x1e3d('0x51')],_0x37702c[_0x1e3d('0x52')],_0x5778a9);})['then'](function(_0x4d2575){_0x3e3ac0=_0x4d2575;return getTicket(_0x2e7b2a,_0x1e07e7,_0x3e3ac0,_0x594469,_0x37702c,_0x594469[_0x1e3d('0x53')],_0x5778a9,_0x1e3d('0x47'));})[_0x1e3d('0x1a')](function(_0x4beb9c){_0x3df026=_0x4beb9c;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x3df026['id']);logger[_0x1e3d('0x23')](_0x1e3d('0x54'),_0x3df026['id'],_0x19404f[_0x1e3d('0x3d')],_0x2e7b2a[_0x1e3d('0x35')]);switch(_0x2e7b2a['type']){case _0x1e3d('0x55'):emit(util['format'](_0x1e3d('0x56'),_0x19404f[_0x1e3d('0x3d')]),'trigger:salesforce:display',{'recordId':_0x3df026['id']});break;case _0x1e3d('0x57'):emit(util['format'](_0x1e3d('0x56'),_0x19404f[_0x1e3d('0x3d')]),_0x1e3d('0x58'),{'uri':util['format'](_0x1e3d('0x59'),_0x5778a9[_0x1e3d('0x5a')],_0x3df026['id'])});break;default:logger[_0x1e3d('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x1e3d('0x5c')](function(_0x55447e){logger[_0x1e3d('0x5b')](_0x1e3d('0x4b'),JSON[_0x1e3d('0x5d')](_0x55447e));});};exports[_0x1e3d('0x5e')]=function(_0x25cf25,_0x4adf84,_0x333299,_0x53574a,_0x176e37,_0x36d14f,_0x3ba006){var _0x47e091,_0x7a37b9,_0x124956,_0x187593;_0x36d14f[_0x1e3d('0x48')]=intUtil[_0x1e3d('0x49')](_0x36d14f[_0x1e3d('0x48')]);_0x36d14f[_0x1e3d('0x41')]=intUtil['stripTrailingSlash'](_0x36d14f['remoteUri']);if(_0x3ba006&&_0x3ba006[_0x1e3d('0x5f')]&&_0x3ba006[_0x1e3d('0x5f')]!==_0x1e3d('0x60')){logger[_0x1e3d('0x23')]('[OUTBOUND]',_0x1e3d('0x4c'));_0x4adf84[_0x1e3d('0x4d')]=util[_0x1e3d('0x2d')](_0x1e3d('0x4e'),_0x36d14f['serverUrl'],_0x4adf84['uniqueid'],md5(_0x4adf84[_0x1e3d('0x4f')]));}return getConnection(_0x36d14f)[_0x1e3d('0x1a')](function(_0x4987c8){_0x187593=_0x4987c8;return getUser(_0x36d14f,_0x53574a[_0x1e3d('0x50')],_0x187593);})['then'](function(_0x5d3741){_0x47e091=_0x5d3741;return getEndUser(_0x36d14f,_0x333299,_0x4adf84['destcalleridname'],_0x4adf84[_0x1e3d('0x61')],_0x187593);})[_0x1e3d('0x1a')](function(_0x4d9638){_0x7a37b9=_0x4d9638;return getTicket(_0x36d14f,_0x47e091,_0x7a37b9,_0x333299,_0x4adf84,_0x333299[_0x1e3d('0x53')],_0x187593,_0x1e3d('0x5e'));})[_0x1e3d('0x1a')](function(_0x2b31e0){_0x124956=_0x2b31e0;logger[_0x1e3d('0x23')](_0x1e3d('0x62'),_0x124956['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x124956['id'],_0x53574a[_0x1e3d('0x3d')],_0x36d14f[_0x1e3d('0x35')]);switch(_0x36d14f[_0x1e3d('0x35')]){case _0x1e3d('0x55'):emit(util[_0x1e3d('0x2d')](_0x1e3d('0x56'),_0x53574a['name']),_0x1e3d('0x63'),{'recordId':_0x124956['id']});break;case _0x1e3d('0x57'):emit(util[_0x1e3d('0x2d')](_0x1e3d('0x56'),_0x53574a['name']),_0x1e3d('0x58'),{'uri':util[_0x1e3d('0x2d')](_0x1e3d('0x59'),_0x187593['instanceUrl'],_0x124956['id'])});break;default:logger[_0x1e3d('0x5b')](_0x1e3d('0x64'),_0x1e3d('0x65'));}})[_0x1e3d('0x5c')](function(_0x5b6b76){logger[_0x1e3d('0x5b')](_0x1e3d('0x64'),JSON[_0x1e3d('0x5d')](_0x5b6b76));});};exports[_0x1e3d('0x66')]=function(_0xdb5e8,_0x2f891d,_0x340a01,_0x4d359b,_0x172663,_0x2092b2){var _0x432565,_0x33f510,_0x43edf0,_0x41e72b;_0x2092b2[_0x1e3d('0x48')]=intUtil[_0x1e3d('0x49')](_0x2092b2['serverUrl']);_0x2092b2[_0x1e3d('0x41')]=intUtil[_0x1e3d('0x49')](_0x2092b2[_0x1e3d('0x41')]);if(_0x172663&&_0x172663[_0x1e3d('0x4a')]){logger[_0x1e3d('0x23')]('['+_0x2f891d[_0x1e3d('0x67')][_0x1e3d('0x68')]()+']','Recording\x20is\x20enabled!');_0x2f891d['recordingURL']=util['format'](_0x1e3d('0x4e'),_0x2092b2[_0x1e3d('0x48')],_0x2f891d[_0x1e3d('0x4f')],md5(_0x2f891d['uniqueid']));}else{_0x2f891d[_0x1e3d('0x4d')]='';}return getConnection(_0x2092b2)[_0x1e3d('0x1a')](function(_0x1931ca){_0x41e72b=_0x1931ca;if(!_[_0x1e3d('0x16')](_0x4d359b)){return getUser(_0x2092b2,_0x4d359b[_0x1e3d('0x3d')],_0x41e72b);}else{return getUser(_0x2092b2,null,_0x41e72b);}})[_0x1e3d('0x1a')](function(_0xf19df){_0x432565=_0xf19df;return getEndUser(_0x2092b2,_0x340a01,_0x2f891d['calleridname'],_0x2f891d[_0x1e3d('0x52')],_0x41e72b);})[_0x1e3d('0x1a')](function(_0x4bb007){_0x33f510=_0x4bb007;return getTicket(_0x2092b2,_0x432565,_0x33f510,_0x340a01,_0x2f891d,_0x340a01[_0x1e3d('0x53')],_0x41e72b);})[_0x1e3d('0x1a')](function(_0x227aba){_0x43edf0=_0x227aba;logger[_0x1e3d('0x23')]('['+_0x2f891d['lastevent'][_0x1e3d('0x68')]()+_0x1e3d('0x69'),_0x43edf0['id']);logger[_0x1e3d('0x23')]('['+_0x2f891d[_0x1e3d('0x67')][_0x1e3d('0x68')]()+_0x1e3d('0x6a'),_0x2092b2[_0x1e3d('0x35')]);})[_0x1e3d('0x5c')](function(_0x30b760){logger[_0x1e3d('0x5b')]('['+_0x2f891d[_0x1e3d('0x67')][_0x1e3d('0x68')]()+']',JSON['stringify'](_0x30b760));});};
\ No newline at end of file
index 4f61497..ed5bed7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20entity','length','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','Variable','name','POST','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','ticketId','Incident\x20-\x20','forEach','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','unmanaged'];(function(_0xed271e,_0x123658){var _0x1e88a9=function(_0x41ed13){while(--_0x41ed13){_0xed271e['push'](_0xed271e['shift']());}};_0x1e88a9(++_0x123658);}(_0x814b,0x1a2));var _0xb814=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0x814b[_0x1e7701];return _0x3ab707;};'use strict';var _=require(_0xb814('0x0'));var Promise=require(_0xb814('0x1'));var rp=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var md5=require(_0xb814('0x4'));var Redis=require(_0xb814('0x5'));var intUtil=require('./util');var config=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));config[_0xb814('0x9')]=_[_0xb814('0xa')](config[_0xb814('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb814('0xb'))(new Redis(config[_0xb814('0x9')]));function getAdminUser(_0x5c8539,_0x271af9,_0x2913a6,_0x186d5a,_0x41166c,_0x1fea33){return new Promise(function(_0x21d4a5,_0x1086f8){var _0x19aad8={'method':_0xb814('0xc'),'uri':_0x186d5a+_0xb814('0xd')+'&'+_0x41166c+'&'+_0x1fea33,'auth':_0x271af9,'json':!![]};return rp(_0x19aad8)[_0xb814('0xe')](function(_0x4b5f14){if(_0x4b5f14[_0xb814('0xf')]['length']>0x0){_0x2913a6[_0xb814('0x10')]=_0x4b5f14[_0xb814('0xf')][0x0][_0xb814('0x11')];}logger[_0xb814('0x12')]('['+[_0x5c8539[_0xb814('0x13')]()]+_0xb814('0x14'),_0x2913a6);_0x21d4a5(_0x2913a6);})[_0xb814('0x15')](function(_0x41ed7b){logger[_0xb814('0x16')]('['+[_0x5c8539[_0xb814('0x13')]()]+']',_0x41ed7b[_0xb814('0x17')]);_0x1086f8(_0x41ed7b[_0xb814('0x17')]);});});}function getUser(_0x17f5bd,_0x39bfcf,_0x303aca,_0x3a71d6,_0x45e0d0){return function(_0x265a83){logger[_0xb814('0x12')]('['+[_0x17f5bd[_0xb814('0x13')]()]+_0xb814('0x18'),_0x265a83);return new Promise(function(_0x48c9df,_0x168a48){if(intUtil['validateEmail'](_0x265a83[_0xb814('0x19')])){var _0xfac75b={'method':'GET','uri':_0x303aca+'sys_user?sysparm_query=email%3D'+_0x265a83['userEmail']+'&'+_0x3a71d6+'&'+_0x45e0d0,'auth':_0x39bfcf,'json':!![]};logger[_0xb814('0x12')]('['+[_0x17f5bd['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0xfac75b);return rp(_0xfac75b)[_0xb814('0xe')](function(_0x24211d){logger[_0xb814('0x12')]('['+[_0x17f5bd['toUpperCase']()]+_0xb814('0x1a'),_0x24211d);if(_0x24211d['result'][_0xb814('0x1b')]>0x0&&String(_0x24211d[_0xb814('0xf')][0x0][_0xb814('0x1c')])===_0xb814('0x1d')){_0x265a83[_0xb814('0x1e')]=_0x24211d[_0xb814('0xf')][0x0][_0xb814('0x11')];}else{_0x265a83['userId']=_0x265a83[_0xb814('0x10')];_0x265a83['userEmail']=_0x265a83[_0xb814('0x1f')];}logger[_0xb814('0x12')]('['+[_0x17f5bd[_0xb814('0x13')]()]+_0xb814('0x20'),_0x265a83);_0x48c9df(_0x265a83);})[_0xb814('0x15')](function(_0xb9e57d){logger[_0xb814('0x16')]('['+[_0x17f5bd['toUpperCase']()]+']',_0xb9e57d[_0xb814('0x17')]);_0x168a48(_0xb9e57d[_0xb814('0x17')]);});}else{logger[_0xb814('0x12')]('['+[_0x17f5bd[_0xb814('0x13')]()]+_0xb814('0x21'));_0x265a83[_0xb814('0x1e')]=_0x265a83[_0xb814('0x10')];_0x265a83[_0xb814('0x19')]=_0x265a83['adminEmail'];_0x48c9df(_0x265a83);}});};}function createEndUser(_0x271aa8,_0x328a08,_0x52ed64,_0x9008b2,_0x37d24d){logger[_0xb814('0x12')]('['+[_0x271aa8['toUpperCase']()]+_0xb814('0x22'),_0x52ed64);return new Promise(function(_0x2051d0,_0x58c3ca){var _0x338a28={'method':'POST','uri':_0x9008b2+_0xb814('0x23')+_0x37d24d,'body':{'user_name':_0x52ed64['endUserNumber'],'roles':'user','first_name':_0x52ed64[_0xb814('0x24')],'active':'true','date_format':_0xb814('0x25'),'phone':_0x52ed64[_0xb814('0x24')]},'auth':_0x328a08,'json':!![]};return rp(_0x338a28)[_0xb814('0xe')](function(_0x599f9f){logger['info']('['+[_0x271aa8[_0xb814('0x13')]()]+_0xb814('0x26'),_0x599f9f['result']);_0x52ed64[_0xb814('0x27')]=_0x599f9f[_0xb814('0xf')][_0xb814('0x11')];_0x2051d0(_0x52ed64);})[_0xb814('0x15')](function(_0x1b78de){logger[_0xb814('0x16')]('['+[_0x271aa8[_0xb814('0x13')]()]+']',_0x1b78de['message']);_0x58c3ca(_0x1b78de[_0xb814('0x17')]);});});}function getEndUser(_0x2263f6,_0x30de5a,_0x424e2b,_0x14100d,_0x4ff31a){return function(_0x16ef82){logger['info']('['+[_0x2263f6[_0xb814('0x13')]()]+_0xb814('0x28'),_0x16ef82);return new Promise(function(_0xe0f509,_0x492d5e){var _0x40b885={'method':_0xb814('0xc'),'uri':_0x424e2b+'sys_user?sysparm_query=phone%3D'+_0x16ef82[_0xb814('0x24')]+'&'+_0x14100d+'&'+_0x4ff31a,'auth':_0x30de5a,'json':!![]};return rp(_0x40b885)[_0xb814('0xe')](function(_0x1a8bd0){if(_0x1a8bd0[_0xb814('0xf')][_0xb814('0x1b')]>0x0){_0x16ef82[_0xb814('0x27')]=_0x1a8bd0['result'][0x0][_0xb814('0x11')];logger['info']('['+[_0x2263f6[_0xb814('0x13')]()]+'],\x20getEndUser\x20crm',_0x16ef82);_0xe0f509(_0x16ef82);}else{return createEndUser(_0x2263f6,_0x30de5a,_0x16ef82,_0x424e2b,_0x14100d)[_0xb814('0xe')](function(_0x4b9233){logger[_0xb814('0x12')]('['+[_0x2263f6[_0xb814('0x13')]()]+'],\x20createEndUser\x20crm',_0x4b9233);_0xe0f509(_0x4b9233);});}})['catch'](function(_0x5dd6bc){logger['error']('['+[_0x2263f6[_0xb814('0x13')]()]+']',_0x5dd6bc[_0xb814('0x17')]);_0x492d5e(_0x5dd6bc[_0xb814('0x17')]);});});};}function getCustomFields(_0x42c2ed,_0x51cdba){var _0x47d782={};if(_0x42c2ed[_0xb814('0x1b')]>0x0){_['forEach'](_0x42c2ed,function(_0x2a93da){if(_0x2a93da[_0xb814('0x29')]===_0xb814('0x2a')&&_0x2a93da[_0xb814('0x2b')]&&!_0x2a93da[_0xb814('0x2c')]){_0x47d782[_0x2a93da[_0xb814('0x2d')][_0xb814('0x2e')]()]=_0x2a93da[_0xb814('0x2f')][_0xb814('0x30')]();}else if(_0x2a93da['type']==='string'&&_0x2a93da['idField']&&_0x2a93da[_0xb814('0x2c')]){_0x47d782[_0x2a93da['idField'][_0xb814('0x2e')]()]=_0x2a93da['content'][_0xb814('0x30')]();}else if(_0x2a93da[_0xb814('0x29')]===_0xb814('0x31')&&_0x2a93da[_0xb814('0x32')]&&_0x2a93da['idField']&&_0x2a93da[_0xb814('0x2c')]){_0x47d782[_0x2a93da[_0xb814('0x2d')][_0xb814('0x2e')]()]=_0x51cdba[_0x2a93da[_0xb814('0x32')]][_0xb814('0x30')]();}else if(_0x2a93da[_0xb814('0x29')]==='customVariable'&&_0x2a93da[_0xb814('0x33')]&&_0x2a93da[_0xb814('0x33')][_0xb814('0x34')]&&_0x2a93da[_0xb814('0x2d')]&&_0x2a93da[_0xb814('0x2c')]){_0x47d782[_0x2a93da[_0xb814('0x2d')][_0xb814('0x2e')]()]=_0x51cdba[_0x2a93da['Variable']['name'][_0xb814('0x2e')]()][_0xb814('0x30')]();}});}return _0x47d782;}function getTicket(_0x4c08d6,_0x2bf906,_0x43f1b,_0x40e627,_0x24b697,_0x40af85){return function(_0x2eb9b6){logger[_0xb814('0x12')]('['+[_0x4c08d6[_0xb814('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x2eb9b6);return new Promise(function(_0x37800a,_0x17510c){var _0x4a76bb=_0x4c08d6[_0xb814('0x2e')]()==='outbound'?_0x2eb9b6[_0xb814('0x1e')]:_0x2eb9b6[_0xb814('0x27')];var _0xc71270={'method':_0xb814('0x35'),'uri':_0x43f1b+_0xb814('0x36')+'?'+_0x40af85,'body':Object[_0xb814('0x37')]({},{'active':_0xb814('0x1d'),'caller_id':_0x4a76bb,'assigned_to':_0x2eb9b6[_0xb814('0x1e')],'short_description':intUtil[_0xb814('0x38')](_0x40e627[_0xb814('0x39')],_0x24b697,'\x20'),'description':intUtil['getString'](_0x40e627['Descriptions'],_0x24b697,'\x0a')},getCustomFields(_0x40e627[_0xb814('0x3a')],_0x24b697)),'auth':_0x2bf906,'json':!![]};return rp(_0xc71270)[_0xb814('0xe')](function(_0x4156d8){logger[_0xb814('0x12')]('['+[_0x4c08d6[_0xb814('0x13')]()]+_0xb814('0x3b'),_0x4156d8[_0xb814('0xf')]);_0x2eb9b6['ticketId']=_0x4156d8[_0xb814('0xf')][_0xb814('0x11')];_0x2eb9b6[_0xb814('0x3c')]=_0x4156d8['result'][_0xb814('0x3d')];logger['info']('['+[_0x4c08d6[_0xb814('0x13')]()]+']\x20getTicket\x20crm',_0x2eb9b6);_0x37800a(_0x2eb9b6);})[_0xb814('0x15')](function(_0x3cf8f8){logger['error']('['+[_0x4c08d6[_0xb814('0x13')]()]+']',_0x3cf8f8[_0xb814('0x17')]);_0x17510c(_0x3cf8f8[_0xb814('0x17')]);});});};}function createRemoteTag(_0x5209d1,_0x3da050,_0x5f0e58,_0x13bdcf){return new Promise(function(_0x158893,_0x4aed78){var _0x39952d={'method':'POST','uri':_0x5f0e58+'label'+'?'+_0x13bdcf,'body':{'short_description':_0x5209d1,'global':!![],'active':!![],'name':_0x5209d1},'auth':_0x3da050,'json':!![]};return rp(_0x39952d)[_0xb814('0xe')](function(_0x35f59a){var _0x34935b=_0x35f59a['result'][_0xb814('0x11')];_0x158893(_0x34935b);});});}function getRemoteTag(_0x538b0f,_0xf88d23,_0x2174e5,_0x58d6e5,_0x2db5a6){return new Promise(function(_0x5c32c2,_0x25a607){var _0x1656ed={'method':_0xb814('0xc'),'uri':_0x2174e5+_0xb814('0x3e')+_0xb814('0x3f')+_0x538b0f+'&'+_0x58d6e5,'auth':_0xf88d23,'json':!![]};return rp(_0x1656ed)[_0xb814('0xe')](function(_0x21d3e9){if(_0x21d3e9[_0xb814('0xf')]['length']>0x0){var _0x374532=_0x21d3e9[_0xb814('0xf')][0x0]['sys_id'];_0x5c32c2(_0x374532);}else{return createRemoteTag(_0x538b0f,_0xf88d23,_0x2174e5,_0x58d6e5)[_0xb814('0xe')](function(_0xe14249){_0x5c32c2(_0xe14249);});}});});}function assignTagToIncident(_0x4d13db,_0x371000,_0x58b9a6,_0x48362c,_0x2114ca){return new Promise(function(_0x5257be,_0x3ff213){var _0xd1cd8b={'method':_0xb814('0x35'),'uri':_0x58b9a6+'label_entry'+'?'+_0x2114ca,'body':{'label':_0x4d13db,'table':_0xb814('0x36'),'id_type':'Incident','table_key':_0x48362c[_0xb814('0x40')],'title':_0xb814('0x41')+_0x48362c[_0xb814('0x3c')],'id_display':_0x48362c[_0xb814('0x3c')]},'auth':_0x371000,'json':!![]};return rp(_0xd1cd8b)[_0xb814('0xe')](function(_0x3b374b){_0x5257be();})[_0xb814('0x15')](function(){_0x5257be();});});}function manageTags(_0x113350,_0x46014f,_0x4d611d,_0x211194,_0x111884,_0x3852ae,_0x1ac6d0){return new Promise(function(_0x3b35a8,_0x3d4843){var _0x52edfa=[];_0x46014f[_0xb814('0x42')](function(_0x4ccd94){_0x52edfa[_0xb814('0x43')](getRemoteTag(_0x4ccd94,_0x4d611d,_0x211194,_0x3852ae,_0x1ac6d0));});return Promise[_0xb814('0x44')](_0x52edfa)[_0xb814('0xe')](function(_0x4c884c){if(_0x4c884c[_0xb814('0x1b')]){logger['info']('['+[_0x113350[_0xb814('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4c884c);var _0x2f0c94=[];_0x4c884c[_0xb814('0x42')](function(_0xa03cd2){_0x2f0c94[_0xb814('0x43')](assignTagToIncident(_0xa03cd2,_0x4d611d,_0x211194,_0x111884,_0x3852ae));});return Promise[_0xb814('0x44')](_0x2f0c94)[_0xb814('0xe')](function(){_0x3b35a8();})[_0xb814('0x15')](function(){_0x3b35a8();});}else{_0x3b35a8();}});});}function getTags(_0x4d44e3,_0x44088d,_0x51ca51,_0x255047,_0x22c73f,_0x1b989d){return function(_0x3dcaeb){return new Promise(function(_0x19fa45,_0x139531){var _0x514dab=[];var _0x12882a=_0x255047[_0xb814('0x45')];if(_0x12882a&&_0x12882a['length']>0x0){_0x514dab=_[_0xb814('0x46')](_0x12882a,_0xb814('0x34'));}if(_0x514dab[_0xb814('0x1b')]>0x0){return manageTags(_0x4d44e3,_0x514dab,_0x44088d,_0x51ca51,_0x3dcaeb,_0x22c73f,_0x1b989d)[_0xb814('0xe')](function(){_0x19fa45(_0x3dcaeb);});}else{_0x19fa45(_0x3dcaeb);}});};}function emit(_0x2161eb,_0x51d834,_0x3a4d4b){var _0x5e8e8e=_0xb814('0x47')+_0xb814('0x48')+_0xb814('0x49')+_0xb814('0x4a');var _0x2e39b1={'uri':_0x2161eb+_0xb814('0x4b')+_0x3a4d4b+_0x5e8e8e};io['to'](util['format']('user:%s',_0x51d834))['emit'](_0xb814('0x4c'),_0x2e39b1);}exports['cs']=function(_0x490e5c,_0x45a8b9,_0x1d3954,_0x25db89,_0x5e966c,_0x1b76fa,_0x3e5ce8,_0xee204){var _0x5aabbe={};var _0x30f717={'user':_0x1b76fa[_0xb814('0x4d')],'pass':_0x1b76fa[_0xb814('0x4e')]};var _0x3564e0='sysparm_limit=1';var _0x5dedd7=_0xb814('0x4f');_0x1b76fa[_0xb814('0x50')]=intUtil[_0xb814('0x51')](_0x1b76fa[_0xb814('0x50')]);_0x1b76fa[_0xb814('0x52')]=intUtil[_0xb814('0x51')](_0x1b76fa[_0xb814('0x52')]);var _0xe47442=util[_0xb814('0x53')](_0xb814('0x54'),_0x1b76fa[_0xb814('0x50')]);_0x5aabbe[_0xb814('0x19')]=!_[_0xb814('0x55')](_0x25db89)?_0x25db89[_0xb814('0x56')]:null;_0x5aabbe[_0xb814('0x1f')]=_0x1b76fa['email'];_0x5aabbe[_0xb814('0x24')]=_0xee204[_0xb814('0x2e')]()===_0xb814('0x57')?_0x45a8b9[_0xb814('0x58')]:_0x45a8b9[_0xb814('0x59')];_0x5aabbe[_0xb814('0x5a')]=_0xee204==='queue'||_0xee204===_0xb814('0x5b')?'queue':_0xb814('0x57');var _0x39aa00=util[_0xb814('0x53')](_0xb814('0x5c'),_0x1b76fa[_0xb814('0x52')],_0x45a8b9['uniqueid'],md5(_0x45a8b9['uniqueid']));if(_0x5e966c&&_0x5e966c[_0xb814('0x5d')]){logger[_0xb814('0x12')](_0xb814('0x5e'),_0xb814('0x5f'));_0x45a8b9['recordingURL']=_0x39aa00;}else if(_0x3e5ce8&&_0x3e5ce8[_0xb814('0x60')]&&_0x3e5ce8['recordingFormat']!==_0xb814('0x61')){logger[_0xb814('0x12')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x45a8b9[_0xb814('0x62')]=_0x39aa00;}else{_0x45a8b9['recordingURL']='';}return getAdminUser(_0xee204,_0x30f717,_0x5aabbe,_0xe47442,_0x5dedd7,_0x3564e0)[_0xb814('0xe')](getUser(_0xee204,_0x30f717,_0xe47442,_0x5dedd7,_0x3564e0))[_0xb814('0xe')](getEndUser(_0xee204,_0x30f717,_0xe47442,_0x5dedd7,_0x3564e0))[_0xb814('0xe')](getTicket(_0xee204,_0x30f717,_0xe47442,_0x1d3954,_0x45a8b9,_0x5dedd7))[_0xb814('0xe')](function(_0x46784f){logger[_0xb814('0x12')](util[_0xb814('0x53')]('The\x20ticket\x20ID\x20is:\x20%s',_0x46784f[_0xb814('0x40')]));logger['info'](util[_0xb814('0x53')]('call\x20direction:\x20%s',_0xee204));if(_0xee204!==_0xb814('0x5b')){logger[_0xb814('0x12')]('['+[_0xee204['toUpperCase']()]+']',_0xb814('0x63'));emit(_0x1b76fa['remoteUri'],_0x25db89[_0xb814('0x34')],_0x46784f[_0xb814('0x40')]);}})['catch'](function(_0x5a0c4a){logger[_0xb814('0x16')]('['+[_0xee204[_0xb814('0x13')]()]+_0xb814('0x64'),util[_0xb814('0x65')](_0x5a0c4a,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x814b=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20entity','length','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','Variable','name','POST','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number','label','?sysparm_query=name%3D','ticketId','Incident\x20-\x20','forEach','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','unmanaged'];(function(_0x489226,_0x2a54d1){var _0x35377f=function(_0x1002dd){while(--_0x1002dd){_0x489226['push'](_0x489226['shift']());}};_0x35377f(++_0x2a54d1);}(_0x814b,0x1a2));var _0xb814=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x814b[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xb814('0x0'));var Promise=require(_0xb814('0x1'));var rp=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var md5=require(_0xb814('0x4'));var Redis=require(_0xb814('0x5'));var intUtil=require('./util');var config=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));config[_0xb814('0x9')]=_[_0xb814('0xa')](config[_0xb814('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb814('0xb'))(new Redis(config[_0xb814('0x9')]));function getAdminUser(_0x5c8539,_0x271af9,_0x2913a6,_0x186d5a,_0x41166c,_0x1fea33){return new Promise(function(_0x21d4a5,_0x1086f8){var _0x19aad8={'method':_0xb814('0xc'),'uri':_0x186d5a+_0xb814('0xd')+'&'+_0x41166c+'&'+_0x1fea33,'auth':_0x271af9,'json':!![]};return rp(_0x19aad8)[_0xb814('0xe')](function(_0x4b5f14){if(_0x4b5f14[_0xb814('0xf')]['length']>0x0){_0x2913a6[_0xb814('0x10')]=_0x4b5f14[_0xb814('0xf')][0x0][_0xb814('0x11')];}logger[_0xb814('0x12')]('['+[_0x5c8539[_0xb814('0x13')]()]+_0xb814('0x14'),_0x2913a6);_0x21d4a5(_0x2913a6);})[_0xb814('0x15')](function(_0x41ed7b){logger[_0xb814('0x16')]('['+[_0x5c8539[_0xb814('0x13')]()]+']',_0x41ed7b[_0xb814('0x17')]);_0x1086f8(_0x41ed7b[_0xb814('0x17')]);});});}function getUser(_0x17f5bd,_0x39bfcf,_0x303aca,_0x3a71d6,_0x45e0d0){return function(_0x265a83){logger[_0xb814('0x12')]('['+[_0x17f5bd[_0xb814('0x13')]()]+_0xb814('0x18'),_0x265a83);return new Promise(function(_0x48c9df,_0x168a48){if(intUtil['validateEmail'](_0x265a83[_0xb814('0x19')])){var _0xfac75b={'method':'GET','uri':_0x303aca+'sys_user?sysparm_query=email%3D'+_0x265a83['userEmail']+'&'+_0x3a71d6+'&'+_0x45e0d0,'auth':_0x39bfcf,'json':!![]};logger[_0xb814('0x12')]('['+[_0x17f5bd['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0xfac75b);return rp(_0xfac75b)[_0xb814('0xe')](function(_0x24211d){logger[_0xb814('0x12')]('['+[_0x17f5bd['toUpperCase']()]+_0xb814('0x1a'),_0x24211d);if(_0x24211d['result'][_0xb814('0x1b')]>0x0&&String(_0x24211d[_0xb814('0xf')][0x0][_0xb814('0x1c')])===_0xb814('0x1d')){_0x265a83[_0xb814('0x1e')]=_0x24211d[_0xb814('0xf')][0x0][_0xb814('0x11')];}else{_0x265a83['userId']=_0x265a83[_0xb814('0x10')];_0x265a83['userEmail']=_0x265a83[_0xb814('0x1f')];}logger[_0xb814('0x12')]('['+[_0x17f5bd[_0xb814('0x13')]()]+_0xb814('0x20'),_0x265a83);_0x48c9df(_0x265a83);})[_0xb814('0x15')](function(_0xb9e57d){logger[_0xb814('0x16')]('['+[_0x17f5bd['toUpperCase']()]+']',_0xb9e57d[_0xb814('0x17')]);_0x168a48(_0xb9e57d[_0xb814('0x17')]);});}else{logger[_0xb814('0x12')]('['+[_0x17f5bd[_0xb814('0x13')]()]+_0xb814('0x21'));_0x265a83[_0xb814('0x1e')]=_0x265a83[_0xb814('0x10')];_0x265a83[_0xb814('0x19')]=_0x265a83['adminEmail'];_0x48c9df(_0x265a83);}});};}function createEndUser(_0x271aa8,_0x328a08,_0x52ed64,_0x9008b2,_0x37d24d){logger[_0xb814('0x12')]('['+[_0x271aa8['toUpperCase']()]+_0xb814('0x22'),_0x52ed64);return new Promise(function(_0x2051d0,_0x58c3ca){var _0x338a28={'method':'POST','uri':_0x9008b2+_0xb814('0x23')+_0x37d24d,'body':{'user_name':_0x52ed64['endUserNumber'],'roles':'user','first_name':_0x52ed64[_0xb814('0x24')],'active':'true','date_format':_0xb814('0x25'),'phone':_0x52ed64[_0xb814('0x24')]},'auth':_0x328a08,'json':!![]};return rp(_0x338a28)[_0xb814('0xe')](function(_0x599f9f){logger['info']('['+[_0x271aa8[_0xb814('0x13')]()]+_0xb814('0x26'),_0x599f9f['result']);_0x52ed64[_0xb814('0x27')]=_0x599f9f[_0xb814('0xf')][_0xb814('0x11')];_0x2051d0(_0x52ed64);})[_0xb814('0x15')](function(_0x1b78de){logger[_0xb814('0x16')]('['+[_0x271aa8[_0xb814('0x13')]()]+']',_0x1b78de['message']);_0x58c3ca(_0x1b78de[_0xb814('0x17')]);});});}function getEndUser(_0x2263f6,_0x30de5a,_0x424e2b,_0x14100d,_0x4ff31a){return function(_0x16ef82){logger['info']('['+[_0x2263f6[_0xb814('0x13')]()]+_0xb814('0x28'),_0x16ef82);return new Promise(function(_0xe0f509,_0x492d5e){var _0x40b885={'method':_0xb814('0xc'),'uri':_0x424e2b+'sys_user?sysparm_query=phone%3D'+_0x16ef82[_0xb814('0x24')]+'&'+_0x14100d+'&'+_0x4ff31a,'auth':_0x30de5a,'json':!![]};return rp(_0x40b885)[_0xb814('0xe')](function(_0x1a8bd0){if(_0x1a8bd0[_0xb814('0xf')][_0xb814('0x1b')]>0x0){_0x16ef82[_0xb814('0x27')]=_0x1a8bd0['result'][0x0][_0xb814('0x11')];logger['info']('['+[_0x2263f6[_0xb814('0x13')]()]+'],\x20getEndUser\x20crm',_0x16ef82);_0xe0f509(_0x16ef82);}else{return createEndUser(_0x2263f6,_0x30de5a,_0x16ef82,_0x424e2b,_0x14100d)[_0xb814('0xe')](function(_0x4b9233){logger[_0xb814('0x12')]('['+[_0x2263f6[_0xb814('0x13')]()]+'],\x20createEndUser\x20crm',_0x4b9233);_0xe0f509(_0x4b9233);});}})['catch'](function(_0x5dd6bc){logger['error']('['+[_0x2263f6[_0xb814('0x13')]()]+']',_0x5dd6bc[_0xb814('0x17')]);_0x492d5e(_0x5dd6bc[_0xb814('0x17')]);});});};}function getCustomFields(_0x42c2ed,_0x51cdba){var _0x47d782={};if(_0x42c2ed[_0xb814('0x1b')]>0x0){_['forEach'](_0x42c2ed,function(_0x2a93da){if(_0x2a93da[_0xb814('0x29')]===_0xb814('0x2a')&&_0x2a93da[_0xb814('0x2b')]&&!_0x2a93da[_0xb814('0x2c')]){_0x47d782[_0x2a93da[_0xb814('0x2d')][_0xb814('0x2e')]()]=_0x2a93da[_0xb814('0x2f')][_0xb814('0x30')]();}else if(_0x2a93da['type']==='string'&&_0x2a93da['idField']&&_0x2a93da[_0xb814('0x2c')]){_0x47d782[_0x2a93da['idField'][_0xb814('0x2e')]()]=_0x2a93da['content'][_0xb814('0x30')]();}else if(_0x2a93da[_0xb814('0x29')]===_0xb814('0x31')&&_0x2a93da[_0xb814('0x32')]&&_0x2a93da['idField']&&_0x2a93da[_0xb814('0x2c')]){_0x47d782[_0x2a93da[_0xb814('0x2d')][_0xb814('0x2e')]()]=_0x51cdba[_0x2a93da[_0xb814('0x32')]][_0xb814('0x30')]();}else if(_0x2a93da[_0xb814('0x29')]==='customVariable'&&_0x2a93da[_0xb814('0x33')]&&_0x2a93da[_0xb814('0x33')][_0xb814('0x34')]&&_0x2a93da[_0xb814('0x2d')]&&_0x2a93da[_0xb814('0x2c')]){_0x47d782[_0x2a93da[_0xb814('0x2d')][_0xb814('0x2e')]()]=_0x51cdba[_0x2a93da['Variable']['name'][_0xb814('0x2e')]()][_0xb814('0x30')]();}});}return _0x47d782;}function getTicket(_0x4c08d6,_0x2bf906,_0x43f1b,_0x40e627,_0x24b697,_0x40af85){return function(_0x2eb9b6){logger[_0xb814('0x12')]('['+[_0x4c08d6[_0xb814('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x2eb9b6);return new Promise(function(_0x37800a,_0x17510c){var _0x4a76bb=_0x4c08d6[_0xb814('0x2e')]()==='outbound'?_0x2eb9b6[_0xb814('0x1e')]:_0x2eb9b6[_0xb814('0x27')];var _0xc71270={'method':_0xb814('0x35'),'uri':_0x43f1b+_0xb814('0x36')+'?'+_0x40af85,'body':Object[_0xb814('0x37')]({},{'active':_0xb814('0x1d'),'caller_id':_0x4a76bb,'assigned_to':_0x2eb9b6[_0xb814('0x1e')],'short_description':intUtil[_0xb814('0x38')](_0x40e627[_0xb814('0x39')],_0x24b697,'\x20'),'description':intUtil['getString'](_0x40e627['Descriptions'],_0x24b697,'\x0a')},getCustomFields(_0x40e627[_0xb814('0x3a')],_0x24b697)),'auth':_0x2bf906,'json':!![]};return rp(_0xc71270)[_0xb814('0xe')](function(_0x4156d8){logger[_0xb814('0x12')]('['+[_0x4c08d6[_0xb814('0x13')]()]+_0xb814('0x3b'),_0x4156d8[_0xb814('0xf')]);_0x2eb9b6['ticketId']=_0x4156d8[_0xb814('0xf')][_0xb814('0x11')];_0x2eb9b6[_0xb814('0x3c')]=_0x4156d8['result'][_0xb814('0x3d')];logger['info']('['+[_0x4c08d6[_0xb814('0x13')]()]+']\x20getTicket\x20crm',_0x2eb9b6);_0x37800a(_0x2eb9b6);})[_0xb814('0x15')](function(_0x3cf8f8){logger['error']('['+[_0x4c08d6[_0xb814('0x13')]()]+']',_0x3cf8f8[_0xb814('0x17')]);_0x17510c(_0x3cf8f8[_0xb814('0x17')]);});});};}function createRemoteTag(_0x5209d1,_0x3da050,_0x5f0e58,_0x13bdcf){return new Promise(function(_0x158893,_0x4aed78){var _0x39952d={'method':'POST','uri':_0x5f0e58+'label'+'?'+_0x13bdcf,'body':{'short_description':_0x5209d1,'global':!![],'active':!![],'name':_0x5209d1},'auth':_0x3da050,'json':!![]};return rp(_0x39952d)[_0xb814('0xe')](function(_0x35f59a){var _0x34935b=_0x35f59a['result'][_0xb814('0x11')];_0x158893(_0x34935b);});});}function getRemoteTag(_0x538b0f,_0xf88d23,_0x2174e5,_0x58d6e5,_0x2db5a6){return new Promise(function(_0x5c32c2,_0x25a607){var _0x1656ed={'method':_0xb814('0xc'),'uri':_0x2174e5+_0xb814('0x3e')+_0xb814('0x3f')+_0x538b0f+'&'+_0x58d6e5,'auth':_0xf88d23,'json':!![]};return rp(_0x1656ed)[_0xb814('0xe')](function(_0x21d3e9){if(_0x21d3e9[_0xb814('0xf')]['length']>0x0){var _0x374532=_0x21d3e9[_0xb814('0xf')][0x0]['sys_id'];_0x5c32c2(_0x374532);}else{return createRemoteTag(_0x538b0f,_0xf88d23,_0x2174e5,_0x58d6e5)[_0xb814('0xe')](function(_0xe14249){_0x5c32c2(_0xe14249);});}});});}function assignTagToIncident(_0x4d13db,_0x371000,_0x58b9a6,_0x48362c,_0x2114ca){return new Promise(function(_0x5257be,_0x3ff213){var _0xd1cd8b={'method':_0xb814('0x35'),'uri':_0x58b9a6+'label_entry'+'?'+_0x2114ca,'body':{'label':_0x4d13db,'table':_0xb814('0x36'),'id_type':'Incident','table_key':_0x48362c[_0xb814('0x40')],'title':_0xb814('0x41')+_0x48362c[_0xb814('0x3c')],'id_display':_0x48362c[_0xb814('0x3c')]},'auth':_0x371000,'json':!![]};return rp(_0xd1cd8b)[_0xb814('0xe')](function(_0x3b374b){_0x5257be();})[_0xb814('0x15')](function(){_0x5257be();});});}function manageTags(_0x113350,_0x46014f,_0x4d611d,_0x211194,_0x111884,_0x3852ae,_0x1ac6d0){return new Promise(function(_0x3b35a8,_0x3d4843){var _0x52edfa=[];_0x46014f[_0xb814('0x42')](function(_0x4ccd94){_0x52edfa[_0xb814('0x43')](getRemoteTag(_0x4ccd94,_0x4d611d,_0x211194,_0x3852ae,_0x1ac6d0));});return Promise[_0xb814('0x44')](_0x52edfa)[_0xb814('0xe')](function(_0x4c884c){if(_0x4c884c[_0xb814('0x1b')]){logger['info']('['+[_0x113350[_0xb814('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4c884c);var _0x2f0c94=[];_0x4c884c[_0xb814('0x42')](function(_0xa03cd2){_0x2f0c94[_0xb814('0x43')](assignTagToIncident(_0xa03cd2,_0x4d611d,_0x211194,_0x111884,_0x3852ae));});return Promise[_0xb814('0x44')](_0x2f0c94)[_0xb814('0xe')](function(){_0x3b35a8();})[_0xb814('0x15')](function(){_0x3b35a8();});}else{_0x3b35a8();}});});}function getTags(_0x4d44e3,_0x44088d,_0x51ca51,_0x255047,_0x22c73f,_0x1b989d){return function(_0x3dcaeb){return new Promise(function(_0x19fa45,_0x139531){var _0x514dab=[];var _0x12882a=_0x255047[_0xb814('0x45')];if(_0x12882a&&_0x12882a['length']>0x0){_0x514dab=_[_0xb814('0x46')](_0x12882a,_0xb814('0x34'));}if(_0x514dab[_0xb814('0x1b')]>0x0){return manageTags(_0x4d44e3,_0x514dab,_0x44088d,_0x51ca51,_0x3dcaeb,_0x22c73f,_0x1b989d)[_0xb814('0xe')](function(){_0x19fa45(_0x3dcaeb);});}else{_0x19fa45(_0x3dcaeb);}});};}function emit(_0x2161eb,_0x51d834,_0x3a4d4b){var _0x5e8e8e=_0xb814('0x47')+_0xb814('0x48')+_0xb814('0x49')+_0xb814('0x4a');var _0x2e39b1={'uri':_0x2161eb+_0xb814('0x4b')+_0x3a4d4b+_0x5e8e8e};io['to'](util['format']('user:%s',_0x51d834))['emit'](_0xb814('0x4c'),_0x2e39b1);}exports['cs']=function(_0x490e5c,_0x45a8b9,_0x1d3954,_0x25db89,_0x5e966c,_0x1b76fa,_0x3e5ce8,_0xee204){var _0x5aabbe={};var _0x30f717={'user':_0x1b76fa[_0xb814('0x4d')],'pass':_0x1b76fa[_0xb814('0x4e')]};var _0x3564e0='sysparm_limit=1';var _0x5dedd7=_0xb814('0x4f');_0x1b76fa[_0xb814('0x50')]=intUtil[_0xb814('0x51')](_0x1b76fa[_0xb814('0x50')]);_0x1b76fa[_0xb814('0x52')]=intUtil[_0xb814('0x51')](_0x1b76fa[_0xb814('0x52')]);var _0xe47442=util[_0xb814('0x53')](_0xb814('0x54'),_0x1b76fa[_0xb814('0x50')]);_0x5aabbe[_0xb814('0x19')]=!_[_0xb814('0x55')](_0x25db89)?_0x25db89[_0xb814('0x56')]:null;_0x5aabbe[_0xb814('0x1f')]=_0x1b76fa['email'];_0x5aabbe[_0xb814('0x24')]=_0xee204[_0xb814('0x2e')]()===_0xb814('0x57')?_0x45a8b9[_0xb814('0x58')]:_0x45a8b9[_0xb814('0x59')];_0x5aabbe[_0xb814('0x5a')]=_0xee204==='queue'||_0xee204===_0xb814('0x5b')?'queue':_0xb814('0x57');var _0x39aa00=util[_0xb814('0x53')](_0xb814('0x5c'),_0x1b76fa[_0xb814('0x52')],_0x45a8b9['uniqueid'],md5(_0x45a8b9['uniqueid']));if(_0x5e966c&&_0x5e966c[_0xb814('0x5d')]){logger[_0xb814('0x12')](_0xb814('0x5e'),_0xb814('0x5f'));_0x45a8b9['recordingURL']=_0x39aa00;}else if(_0x3e5ce8&&_0x3e5ce8[_0xb814('0x60')]&&_0x3e5ce8['recordingFormat']!==_0xb814('0x61')){logger[_0xb814('0x12')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x45a8b9[_0xb814('0x62')]=_0x39aa00;}else{_0x45a8b9['recordingURL']='';}return getAdminUser(_0xee204,_0x30f717,_0x5aabbe,_0xe47442,_0x5dedd7,_0x3564e0)[_0xb814('0xe')](getUser(_0xee204,_0x30f717,_0xe47442,_0x5dedd7,_0x3564e0))[_0xb814('0xe')](getEndUser(_0xee204,_0x30f717,_0xe47442,_0x5dedd7,_0x3564e0))[_0xb814('0xe')](getTicket(_0xee204,_0x30f717,_0xe47442,_0x1d3954,_0x45a8b9,_0x5dedd7))[_0xb814('0xe')](function(_0x46784f){logger[_0xb814('0x12')](util[_0xb814('0x53')]('The\x20ticket\x20ID\x20is:\x20%s',_0x46784f[_0xb814('0x40')]));logger['info'](util[_0xb814('0x53')]('call\x20direction:\x20%s',_0xee204));if(_0xee204!==_0xb814('0x5b')){logger[_0xb814('0x12')]('['+[_0xee204['toUpperCase']()]+']',_0xb814('0x63'));emit(_0x1b76fa['remoteUri'],_0x25db89[_0xb814('0x34')],_0x46784f[_0xb814('0x40')]);}})['catch'](function(_0x5a0c4a){logger[_0xb814('0x16')]('['+[_0xee204[_0xb814('0x13')]()]+_0xb814('0x64'),util[_0xb814('0x65')](_0x5a0c4a,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 054dc8a..2cf354e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e5=['[HTTP]','map','type','nameField','toLowerCase','toString','string','customField','custom_fields','content','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','users','version','catch','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','assigned_user_id','description','Descriptions','date_start','toISOString','replace','duration_minutes','Contacts','parent_name','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','length','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug'];(function(_0x5b4bc3,_0x19cf03){var _0x1514a2=function(_0xf0f522){while(--_0xf0f522){_0x5b4bc3['push'](_0x5b4bc3['shift']());}};_0x1514a2(++_0x19cf03);}(_0x50e5,0xb7));var _0x550e=function(_0x2ca460,_0x2f10e5){_0x2ca460=_0x2ca460-0x0;var _0x2f07b8=_0x50e5[_0x2ca460];return _0x2f07b8;};'use strict';var _=require(_0x550e('0x0'));var rp=require(_0x550e('0x1'));var BPromise=require('bluebird');var md5=require(_0x550e('0x2'));var util=require(_0x550e('0x3'));var Redis=require(_0x550e('0x4'));var intUtil=require(_0x550e('0x5'));var config=require(_0x550e('0x6'));var logger=require(_0x550e('0x7'))(_0x550e('0x8'));config[_0x550e('0x9')]=_[_0x550e('0xa')](config[_0x550e('0x9')],{'host':_0x550e('0xb'),'port':0x18eb});var io=require(_0x550e('0xc'))(new Redis(config['redis']));var def={'method':_0x550e('0xd'),'json':!![]};function emit(_0x20707a,_0x51318e,_0xebedae){io['to'](_0x20707a)[_0x550e('0xe')](_0x51318e,_0xebedae);}function getTicket(_0x1390a4,_0x4d236d,_0x1a1e3e,_0x49cc53,_0x59c6c9,_0x116691,_0x144514,_0x5ed9fa){logger[_0x550e('0xf')](_0x550e('0x10'));var _0x2e3852=new Date();var _0x3fa395=[{'name':'name','value':intUtil[_0x550e('0x11')](_0x49cc53['Subjects'],_0x59c6c9,'\x20')},{'name':_0x550e('0x12'),'value':_0x4d236d['id']},{'name':'created_by','value':_0x4d236d['id']},{'name':_0x550e('0x13'),'value':intUtil[_0x550e('0x11')](_0x49cc53[_0x550e('0x14')],_0x59c6c9,'\x0a')},{'name':_0x550e('0x15'),'value':_0x2e3852[_0x550e('0x16')]()['slice'](0x0,0x13)[_0x550e('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x550e('0x18'),'value':'15'},{'name':'parent_id','value':_0x1a1e3e['id']},{'name':'parent_type','value':_0x550e('0x19')},{'name':_0x550e('0x1a'),'value':_0x1a1e3e['name']},{'name':'direction','value':_0x5ed9fa}];if(_0x116691['length']){_[_0x550e('0x1b')](_0x116691,function(_0x5ed213){if(_0x59c6c9[_0x5ed213['variableName']]){_0x3fa395[_0x550e('0x1c')]({'name':_0x5ed213[_0x550e('0x1d')],'value':_0x59c6c9[_0x5ed213[_0x550e('0x1e')]]});}});}return request({'form':{'method':_0x550e('0x1f'),'input_type':_0x550e('0x20'),'response_type':_0x550e('0x20'),'rest_data':JSON[_0x550e('0x21')]({'session':_0x144514['id'],'module_name':_0x550e('0x22'),'name_value_list':_0x3fa395})}});}function getAuth(_0x1b9799){return util['format'](_0x550e('0x23'),new Buffer(_0x1b9799[_0x550e('0x24')]+':X')['toString']('base64'));}function getServerInfo(_0x3e9822){return request({'form':{'method':_0x550e('0x25'),'input_type':'JSON','response_type':_0x550e('0x20'),'rest_data':JSON[_0x550e('0x21')]({'session':_0x3e9822['id']})}});}function getUser(_0x1762c3,_0x317249,_0x3aa1b8){if(!_[_0x550e('0x26')](_0x317249)){logger['info'](_0x550e('0x27'),_0x317249);return request({'form':{'method':_0x550e('0x28'),'input_type':_0x550e('0x20'),'response_type':_0x550e('0x20'),'rest_data':JSON[_0x550e('0x21')]({'session':_0x3aa1b8['id'],'module_name':_0x550e('0x29'),'query':util[_0x550e('0x2a')](_0x550e('0x2b'),_0x317249),'order_by':'','offset':'0','select_fields':['id',_0x550e('0x2c'),_0x550e('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x550e('0x2e')](function(_0x362d21){if(_0x362d21['entry_list'][_0x550e('0x2f')]){var _0x11bec0=_['find'](_0x362d21[_0x550e('0x30')],function(_0x78f04c){return _0x78f04c[_0x550e('0x31')][_0x550e('0x2d')][_0x550e('0x32')]===_0x317249;});if(_0x11bec0){logger[_0x550e('0xf')](_0x550e('0x33'));return BPromise[_0x550e('0x34')]({'id':_0x11bec0[_0x550e('0x31')]['id'][_0x550e('0x32')],'name':_0x11bec0[_0x550e('0x31')][_0x550e('0x2c')][_0x550e('0x32')]});}}logger[_0x550e('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x550e('0x34')]({'id':_0x3aa1b8[_0x550e('0x31')]['user_id'][_0x550e('0x32')],'name':_0x3aa1b8[_0x550e('0x31')]['user_name'][_0x550e('0x32')]});});}else{logger[_0x550e('0xf')](_0x550e('0x35'));return BPromise[_0x550e('0x34')]({'id':_0x3aa1b8[_0x550e('0x31')][_0x550e('0x36')][_0x550e('0x32')],'name':_0x3aa1b8[_0x550e('0x31')]['user_name'][_0x550e('0x32')]});}}function getEndUser(_0x5ef4b3,_0x281c6f,_0x1d94cd,_0x554e50){logger[_0x550e('0xf')](_0x550e('0x37'),_0x1d94cd);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x554e50['id'],'module_name':_0x550e('0x19'),'query':util[_0x550e('0x2a')](_0x550e('0x38'),_0x1d94cd),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2b01a6){if(_0x2b01a6[_0x550e('0x30')]['length']){var _0x5342bf=_['find'](_0x2b01a6[_0x550e('0x30')],function(_0x1a3419){return _0x1a3419[_0x550e('0x31')]['phone_home']['value']===_0x1d94cd;});if(_0x5342bf){logger[_0x550e('0xf')](_0x550e('0x39'));return BPromise[_0x550e('0x34')]({'id':_0x5342bf[_0x550e('0x31')]['id']['value'],'name':_0x5342bf[_0x550e('0x31')][_0x550e('0x2c')]['value'],'phone':_0x5342bf['name_value_list'][_0x550e('0x3a')][_0x550e('0x32')]});}}else{logger[_0x550e('0xf')](_0x550e('0x3b'));return request({'form':{'method':'set_entry','input_type':_0x550e('0x20'),'response_type':_0x550e('0x20'),'rest_data':JSON[_0x550e('0x21')]({'session':_0x554e50['id'],'module_name':_0x550e('0x19'),'name_value_list':[{'name':'first_name','value':_0x281c6f!==_0x550e('0x3c')?_0x281c6f:util[_0x550e('0x2a')](_0x550e('0x3d'),_0x1d94cd)},{'name':_0x550e('0x3a'),'value':_0x1d94cd}]})}})[_0x550e('0x2e')](function(_0x19357c){logger['info'](_0x550e('0x3e'));return BPromise[_0x550e('0x34')]({'id':_0x19357c['id'],'name':_0x19357c[_0x550e('0x30')][_0x550e('0x3f')][_0x550e('0x32')],'phone':_0x19357c['entry_list'][_0x550e('0x3a')][_0x550e('0x32')]});});}});}function request(_0x5ca5fc){logger[_0x550e('0x40')](_0x550e('0x41'),JSON[_0x550e('0x21')](_0x5ca5fc));return rp(_['merge'](def,_0x5ca5fc));}function getTags(_0x4c26b4,_0xa5e4e2){var _0x254444=[];if(_0x4c26b4&&_0x4c26b4['length']>0x0){_0x254444=_[_0x550e('0x42')](_0x4c26b4,_0xa5e4e2);}return _0x254444;}function getCustomFields(_0x7dda5e,_0x48a02e){var _0xc76dba=[];var _0x1aca37={'custom_fields':[]};if(_0x7dda5e[_0x550e('0x2f')]>0x0){_[_0x550e('0x1b')](_0x7dda5e,function(_0x101952){if(_0x101952[_0x550e('0x43')]==='string'&&_0x101952[_0x550e('0x44')]&&!_0x101952['customField']){_0x1aca37[_0x101952[_0x550e('0x44')][_0x550e('0x45')]()]=_0x101952['content'][_0x550e('0x46')]();}else if(_0x101952[_0x550e('0x43')]===_0x550e('0x47')&&_0x101952[_0x550e('0x1d')]&&_0x101952[_0x550e('0x48')]){_0x1aca37[_0x550e('0x49')]['push']({'id':_0x101952[_0x550e('0x1d')],'value':_0x101952[_0x550e('0x4a')][_0x550e('0x46')]()});}else if(_0x101952[_0x550e('0x43')]===_0x550e('0x4b')&&_0x101952[_0x550e('0x1e')]&&_0x101952[_0x550e('0x1d')]&&_0x101952[_0x550e('0x48')]){_0x48a02e[_0x101952[_0x550e('0x1e')]]&&_0x1aca37[_0x550e('0x49')][_0x550e('0x1c')]({'id':_0x101952[_0x550e('0x1d')],'value':_0x48a02e[_0x101952[_0x550e('0x1e')]][_0x550e('0x46')]()});}else if(_0x101952[_0x550e('0x43')]===_0x550e('0x4c')&&_0x101952[_0x550e('0x4d')]&&_0x101952[_0x550e('0x4d')][_0x550e('0x2c')]&&_0x101952[_0x550e('0x1d')]&&_0x101952[_0x550e('0x48')]){_0x48a02e[_0x101952[_0x550e('0x4d')]['name'][_0x550e('0x45')]()]&&_0x1aca37[_0x550e('0x49')][_0x550e('0x1c')]({'id':_0x101952[_0x550e('0x1d')],'value':_0x48a02e[_0x101952[_0x550e('0x4d')][_0x550e('0x2c')][_0x550e('0x45')]()]['toString']()});}});}return _0x1aca37;}function getConnection(_0x3e6e1b){return request({'method':_0x550e('0xd'),'form':{'method':_0x550e('0x4e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3e6e1b[_0x550e('0x4f')],'password':_0x3e6e1b[_0x550e('0x50')],'encryption':_0x550e('0x51')},'application':_0x550e('0x52')})}})[_0x550e('0x2e')](function(_0xffba1f){var _0x5586a3=_0xffba1f;if(_0x5586a3['id']){def[_0x550e('0x53')]=_0x5586a3['id'];return BPromise[_0x550e('0x34')](_0x5586a3);}else{throw new Error(util[_0x550e('0x2a')]('Account\x20%d\x20is\x20not\x20valid',_0x3e6e1b['id']));}});}function setRelationship(_0x3523aa,_0x4ba38b,_0x25e933,_0x57549d){return request({'form':{'method':_0x550e('0x54'),'input_type':_0x550e('0x20'),'response_type':'JSON','rest_data':JSON[_0x550e('0x21')]({'session':_0x3523aa['id'],'module_name':'Calls','module_id':_0x25e933['id'],'link_field_name':_0x57549d,'related_ids':[_0x4ba38b['id']]})}});}exports[_0x550e('0x55')]=function(_0x5ca965,_0x1db1ec,_0x45b188,_0x5b3d6c,_0x130dfd,_0x4c4643){var _0xbab6b9,_0x897986,_0x2c8734,_0x417fe6;_0x4c4643['remoteUri']=intUtil['stripTrailingSlash'](_0x4c4643[_0x550e('0x56')]);_0x4c4643['serverUrl']=intUtil['stripTrailingSlash'](_0x4c4643[_0x550e('0x57')]);def[_0x550e('0x58')]=util[_0x550e('0x2a')](_0x550e('0x59'),_0x4c4643[_0x550e('0x56')]);if(_0x130dfd&&_0x130dfd[_0x550e('0x5a')]){logger['info'](_0x550e('0x5b'),_0x550e('0x5c'));_0x1db1ec[_0x550e('0x5d')]=util[_0x550e('0x2a')](_0x550e('0x5e'),_0x4c4643[_0x550e('0x57')],_0x1db1ec[_0x550e('0x5f')],md5(_0x1db1ec[_0x550e('0x5f')]));}else{_0x1db1ec[_0x550e('0x5d')]='';}return getConnection(_0x4c4643)['then'](function(_0x2929c0){_0x417fe6=_0x2929c0;return getUser(_0x4c4643,_0x5b3d6c[_0x550e('0x2c')],_0x417fe6);})[_0x550e('0x2e')](function(_0x1ece5e){_0xbab6b9=_0x1ece5e;logger[_0x550e('0xf')](_0x550e('0x60'),_0xbab6b9['id']);return getEndUser(_0x4c4643,_0x1db1ec[_0x550e('0x61')],_0x1db1ec[_0x550e('0x62')],_0x417fe6);})[_0x550e('0x2e')](function(_0x368cd8){_0x897986=_0x368cd8;logger['info'](_0x550e('0x63'),_0x897986['id']);return getTicket(_0x4c4643,_0xbab6b9,_0x897986,_0x45b188,_0x1db1ec,_0x45b188[_0x550e('0x64')],_0x417fe6,_0x550e('0x65'));})[_0x550e('0x2e')](function(_0x4056fb){_0x2c8734=_0x4056fb;logger[_0x550e('0xf')](_0x550e('0x66'));logger[_0x550e('0xf')]('The\x20Ticket\x20ID\x20is:',_0x2c8734['id']);return setRelationship(_0x417fe6,_0xbab6b9,_0x2c8734,'users');})[_0x550e('0x2e')](function(){return setRelationship(_0x417fe6,_0x897986,_0x2c8734,_0x550e('0x67'));})[_0x550e('0x2e')](function(){return getServerInfo(_0x417fe6);})[_0x550e('0x2e')](function(_0x3b027f){var _0x1e577e=parseInt(_0x3b027f['version'][_0x550e('0x68')](0x0));var _0x3a0051=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4c4643[_0x550e('0x56')],_0x2c8734['id']);if(_0x1e577e>0x6){_0x3a0051=util[_0x550e('0x2a')](_0x550e('0x69'),_0x4c4643[_0x550e('0x56')],_0x2c8734['id']);}logger[_0x550e('0xf')](_0x550e('0x5b'),_0x550e('0x6a'));emit(util[_0x550e('0x2a')]('user:%s',_0x5b3d6c[_0x550e('0x2c')]),_0x550e('0x6b'),{'uri':_0x3a0051});})['catch'](function(_0x228699){logger[_0x550e('0x6c')](_0x550e('0x5b'),JSON[_0x550e('0x21')](_0x228699));});};exports[_0x550e('0x6d')]=function(_0x46c396,_0x181430,_0x576476,_0x12c813,_0x46dcc9,_0x360c37,_0x1bb74d){var _0xcd0ced,_0x59bf83,_0x3cb5d6,_0xa35df8;_0x360c37['remoteUri']=intUtil[_0x550e('0x6e')](_0x360c37[_0x550e('0x56')]);_0x360c37['serverUrl']=intUtil[_0x550e('0x6e')](_0x360c37[_0x550e('0x57')]);def[_0x550e('0x58')]=util[_0x550e('0x2a')]('%s/service/v4_1/rest.php',_0x360c37[_0x550e('0x56')]);if(_0x1bb74d&&_0x1bb74d['recordingFormat']&&_0x1bb74d[_0x550e('0x6f')]!==_0x550e('0x70')){logger['info'](_0x550e('0x71'),'Recording\x20is\x20enabled!');_0x181430[_0x550e('0x5d')]=util['format'](_0x550e('0x5e'),_0x360c37[_0x550e('0x57')],_0x181430[_0x550e('0x5f')],md5(_0x181430[_0x550e('0x5f')]));}return getConnection(_0x360c37)[_0x550e('0x2e')](function(_0x229832){_0xa35df8=_0x229832;return getUser(_0x360c37,_0x12c813[_0x550e('0x2c')],_0xa35df8);})[_0x550e('0x2e')](function(_0x17413b){_0xcd0ced=_0x17413b;logger[_0x550e('0xf')](_0x550e('0x60'),_0xcd0ced['id']);return getEndUser(_0x360c37,_0x181430[_0x550e('0x72')],_0x181430[_0x550e('0x73')],_0xa35df8);})[_0x550e('0x2e')](function(_0xea30f7){_0x59bf83=_0xea30f7;logger[_0x550e('0xf')]('The\x20Enduser\x20ID\x20is:',_0x59bf83['id']);return getTicket(_0x360c37,_0xcd0ced,_0x59bf83,_0x576476,_0x181430,_0x576476[_0x550e('0x64')],_0xa35df8,_0x550e('0x74'));})['then'](function(_0x42d77a){_0x3cb5d6=_0x42d77a;logger['info'](_0x550e('0x66'));logger[_0x550e('0xf')](_0x550e('0x75'),_0x3cb5d6['id']);return setRelationship(_0xa35df8,_0xcd0ced,_0x3cb5d6,_0x550e('0x76'));})[_0x550e('0x2e')](function(){return setRelationship(_0xa35df8,_0x59bf83,_0x3cb5d6,_0x550e('0x67'));})['then'](function(){return getServerInfo(_0xa35df8);})[_0x550e('0x2e')](function(_0x59bf02){var _0x5e6aa2=parseInt(_0x59bf02[_0x550e('0x77')]['charAt'](0x0));var _0x2fc090=util[_0x550e('0x2a')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x360c37['remoteUri'],_0x3cb5d6['id']);if(_0x5e6aa2>0x6){_0x2fc090=util[_0x550e('0x2a')](_0x550e('0x69'),_0x360c37['remoteUri'],_0x3cb5d6['id']);}logger['info']('[OUTBOUND]',_0x550e('0x6a'));emit(util[_0x550e('0x2a')]('user:%s',_0x12c813[_0x550e('0x2c')]),_0x550e('0x6b'),{'uri':_0x2fc090});})[_0x550e('0x78')](function(_0x5de59b){logger[_0x550e('0x6c')]('[OUTBOUND]',JSON['stringify'](_0x5de59b));});};exports[_0x550e('0x79')]=function(_0x530f90,_0x270534,_0x478009,_0x49ae13,_0x2ac505,_0x6011c7){var _0x2058c7,_0x18e24f,_0x2784bb,_0x5c7385;_0x6011c7['remoteUri']=intUtil[_0x550e('0x6e')](_0x6011c7[_0x550e('0x56')]);_0x6011c7[_0x550e('0x57')]=intUtil[_0x550e('0x6e')](_0x6011c7['serverUrl']);def['uri']=util[_0x550e('0x2a')](_0x550e('0x59'),_0x6011c7[_0x550e('0x56')]);if(_0x2ac505&&_0x2ac505[_0x550e('0x5a')]){logger[_0x550e('0xf')]('['+_0x270534[_0x550e('0x7a')][_0x550e('0x7b')]()+']',_0x550e('0x5c'));_0x270534[_0x550e('0x5d')]=util[_0x550e('0x2a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6011c7[_0x550e('0x57')],_0x270534[_0x550e('0x5f')],md5(_0x270534['uniqueid']));}else{_0x270534[_0x550e('0x5d')]='';}return getConnection(_0x6011c7)[_0x550e('0x2e')](function(_0x1a1c57){_0x5c7385=_0x1a1c57;if(!_[_0x550e('0x26')](_0x49ae13)){return getUser(_0x6011c7,_0x49ae13[_0x550e('0x2c')],_0x5c7385);}else{return getUser(_0x6011c7,null,_0x5c7385);}})['then'](function(_0xb1dcfd){_0x2058c7=_0xb1dcfd;logger[_0x550e('0xf')](_0x550e('0x60'),_0x2058c7['id']);return getEndUser(_0x6011c7,_0x270534['calleridname'],_0x270534[_0x550e('0x62')],_0x5c7385);})['then'](function(_0x205f49){_0x18e24f=_0x205f49;logger[_0x550e('0xf')](_0x550e('0x63'),_0x18e24f['id']);return getTicket(_0x6011c7,_0x2058c7,_0x18e24f,_0x478009,_0x270534,_0x478009[_0x550e('0x64')],_0x5c7385,'Inbound');})[_0x550e('0x2e')](function(_0x4a65bc){_0x2784bb=_0x4a65bc;logger[_0x550e('0xf')](_0x550e('0x66'));logger['info'](_0x550e('0x75'),_0x2784bb['id']);return setRelationship(_0x5c7385,_0x2058c7,_0x2784bb,'users');})[_0x550e('0x2e')](function(){return setRelationship(_0x5c7385,_0x18e24f,_0x2784bb,'contacts');})['then'](function(){return getServerInfo(_0x5c7385);})['catch'](function(_0xf898e6){logger[_0x550e('0x6c')]('['+_0x270534[_0x550e('0x7a')][_0x550e('0x7b')]()+']',JSON[_0x550e('0x21')](_0xf898e6));});};
\ No newline at end of file
+var _0xdb7e=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','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...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','isNil','calleridname','calleridnum','Inbound','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','duration_hours','duration_minutes','parent_id','Contacts','parent_name','name','direction','length','variableName','push','idField','JSON','stringify','Basic\x20%s','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','Agent\x20found!','resolve','value','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','merge','map','forEach','string','customField','nameField','toLowerCase','content','type','custom_fields','variable','customVariable','Variable','login','username','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xdb7e,0x11a));var _0xedb7=function(_0x518a85,_0x16ceb1){_0x518a85=_0x518a85-0x0;var _0x39646b=_0xdb7e[_0x518a85];return _0x39646b;};'use strict';var _=require(_0xedb7('0x0'));var rp=require(_0xedb7('0x1'));var BPromise=require(_0xedb7('0x2'));var md5=require('md5');var util=require(_0xedb7('0x3'));var Redis=require(_0xedb7('0x4'));var intUtil=require(_0xedb7('0x5'));var config=require('../../../../config/environment');var logger=require(_0xedb7('0x6'))(_0xedb7('0x7'));config[_0xedb7('0x8')]=_[_0xedb7('0x9')](config[_0xedb7('0x8')],{'host':_0xedb7('0xa'),'port':0x18eb});var io=require(_0xedb7('0xb'))(new Redis(config[_0xedb7('0x8')]));var def={'method':_0xedb7('0xc'),'json':!![]};function emit(_0x2ae0f7,_0x5a8650,_0x3540dd){io['to'](_0x2ae0f7)[_0xedb7('0xd')](_0x5a8650,_0x3540dd);}function getTicket(_0x12c7ba,_0x269b94,_0x18e9ee,_0x1d71d9,_0x10dc75,_0x10b19d,_0x103da0,_0x591ec){logger[_0xedb7('0xe')](_0xedb7('0xf'));var _0x351203=new Date();var _0x51fee0=[{'name':'name','value':intUtil[_0xedb7('0x10')](_0x1d71d9[_0xedb7('0x11')],_0x10dc75,'\x20')},{'name':_0xedb7('0x12'),'value':_0x269b94['id']},{'name':_0xedb7('0x13'),'value':_0x269b94['id']},{'name':_0xedb7('0x14'),'value':intUtil[_0xedb7('0x10')](_0x1d71d9[_0xedb7('0x15')],_0x10dc75,'\x0a')},{'name':_0xedb7('0x16'),'value':_0x351203[_0xedb7('0x17')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0xedb7('0x18'),'value':'0'},{'name':_0xedb7('0x19'),'value':'15'},{'name':_0xedb7('0x1a'),'value':_0x18e9ee['id']},{'name':'parent_type','value':_0xedb7('0x1b')},{'name':_0xedb7('0x1c'),'value':_0x18e9ee[_0xedb7('0x1d')]},{'name':_0xedb7('0x1e'),'value':_0x591ec}];if(_0x10b19d[_0xedb7('0x1f')]){_['forEach'](_0x10b19d,function(_0x5d2d6a){if(_0x10dc75[_0x5d2d6a[_0xedb7('0x20')]]){_0x51fee0[_0xedb7('0x21')]({'name':_0x5d2d6a[_0xedb7('0x22')],'value':_0x10dc75[_0x5d2d6a[_0xedb7('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xedb7('0x23'),'response_type':_0xedb7('0x23'),'rest_data':JSON[_0xedb7('0x24')]({'session':_0x103da0['id'],'module_name':'Calls','name_value_list':_0x51fee0})}});}function getAuth(_0xecf33d){return util['format'](_0xedb7('0x25'),new Buffer(_0xecf33d[_0xedb7('0x26')]+':X')[_0xedb7('0x27')]('base64'));}function getServerInfo(_0x54d68f){return request({'form':{'method':_0xedb7('0x28'),'input_type':_0xedb7('0x23'),'response_type':'JSON','rest_data':JSON[_0xedb7('0x24')]({'session':_0x54d68f['id']})}});}function getUser(_0xff6827,_0x4cde11,_0x16d887){if(!_['isNil'](_0x4cde11)){logger['info'](_0xedb7('0x29'),_0x4cde11);return request({'form':{'method':_0xedb7('0x2a'),'input_type':'JSON','response_type':_0xedb7('0x23'),'rest_data':JSON[_0xedb7('0x24')]({'session':_0x16d887['id'],'module_name':_0xedb7('0x2b'),'query':util[_0xedb7('0x2c')](_0xedb7('0x2d'),_0x4cde11),'order_by':'','offset':'0','select_fields':['id',_0xedb7('0x1d'),_0xedb7('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xedb7('0x2f')](function(_0x4dd696){if(_0x4dd696[_0xedb7('0x30')]['length']){var _0x4d269e=_[_0xedb7('0x31')](_0x4dd696[_0xedb7('0x30')],function(_0x55fe73){return _0x55fe73['name_value_list'][_0xedb7('0x2e')]['value']===_0x4cde11;});if(_0x4d269e){logger[_0xedb7('0xe')](_0xedb7('0x32'));return BPromise[_0xedb7('0x33')]({'id':_0x4d269e['name_value_list']['id'][_0xedb7('0x34')],'name':_0x4d269e[_0xedb7('0x35')][_0xedb7('0x1d')][_0xedb7('0x34')]});}}logger[_0xedb7('0xe')](_0xedb7('0x36'));return BPromise['resolve']({'id':_0x16d887[_0xedb7('0x35')]['user_id'][_0xedb7('0x34')],'name':_0x16d887['name_value_list'][_0xedb7('0x2e')]['value']});});}else{logger[_0xedb7('0xe')](_0xedb7('0x37'));return BPromise[_0xedb7('0x33')]({'id':_0x16d887['name_value_list']['user_id'][_0xedb7('0x34')],'name':_0x16d887[_0xedb7('0x35')][_0xedb7('0x2e')]['value']});}}function getEndUser(_0x1cb974,_0x572e30,_0x3f18cd,_0x182fcc){logger[_0xedb7('0xe')](_0xedb7('0x38'),_0x3f18cd);return request({'form':{'method':_0xedb7('0x2a'),'input_type':_0xedb7('0x23'),'response_type':'JSON','rest_data':JSON[_0xedb7('0x24')]({'session':_0x182fcc['id'],'module_name':_0xedb7('0x1b'),'query':util['format'](_0xedb7('0x39'),_0x3f18cd),'order_by':'','offset':'0','select_fields':['id',_0xedb7('0x1d'),_0xedb7('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xedb7('0x2f')](function(_0x481a24){if(_0x481a24[_0xedb7('0x30')][_0xedb7('0x1f')]){var _0x197a62=_[_0xedb7('0x31')](_0x481a24[_0xedb7('0x30')],function(_0x33dbc0){return _0x33dbc0[_0xedb7('0x35')][_0xedb7('0x3a')][_0xedb7('0x34')]===_0x3f18cd;});if(_0x197a62){logger['info'](_0xedb7('0x3b'));return BPromise[_0xedb7('0x33')]({'id':_0x197a62[_0xedb7('0x35')]['id'][_0xedb7('0x34')],'name':_0x197a62['name_value_list'][_0xedb7('0x1d')][_0xedb7('0x34')],'phone':_0x197a62[_0xedb7('0x35')][_0xedb7('0x3a')]['value']});}}else{logger[_0xedb7('0xe')](_0xedb7('0x3c'));return request({'form':{'method':_0xedb7('0x3d'),'input_type':_0xedb7('0x23'),'response_type':'JSON','rest_data':JSON[_0xedb7('0x24')]({'session':_0x182fcc['id'],'module_name':_0xedb7('0x1b'),'name_value_list':[{'name':_0xedb7('0x3e'),'value':_0x572e30!==_0xedb7('0x3f')?_0x572e30:util[_0xedb7('0x2c')](_0xedb7('0x40'),_0x3f18cd)},{'name':_0xedb7('0x3a'),'value':_0x3f18cd}]})}})['then'](function(_0x14ebb7){logger['info'](_0xedb7('0x41'));return BPromise[_0xedb7('0x33')]({'id':_0x14ebb7['id'],'name':_0x14ebb7[_0xedb7('0x30')]['first_name'][_0xedb7('0x34')],'phone':_0x14ebb7[_0xedb7('0x30')][_0xedb7('0x3a')][_0xedb7('0x34')]});});}});}function request(_0x2ff566){logger['debug']('[HTTP]',JSON[_0xedb7('0x24')](_0x2ff566));return rp(_[_0xedb7('0x42')](def,_0x2ff566));}function getTags(_0x218dfc,_0x3ca3cc){var _0x372a7c=[];if(_0x218dfc&&_0x218dfc[_0xedb7('0x1f')]>0x0){_0x372a7c=_[_0xedb7('0x43')](_0x218dfc,_0x3ca3cc);}return _0x372a7c;}function getCustomFields(_0x223fbf,_0x1c71af){var _0x157ccf=[];var _0x2711ef={'custom_fields':[]};if(_0x223fbf[_0xedb7('0x1f')]>0x0){_[_0xedb7('0x44')](_0x223fbf,function(_0x46c06d){if(_0x46c06d['type']===_0xedb7('0x45')&&_0x46c06d['nameField']&&!_0x46c06d[_0xedb7('0x46')]){_0x2711ef[_0x46c06d[_0xedb7('0x47')][_0xedb7('0x48')]()]=_0x46c06d[_0xedb7('0x49')][_0xedb7('0x27')]();}else if(_0x46c06d[_0xedb7('0x4a')]===_0xedb7('0x45')&&_0x46c06d[_0xedb7('0x22')]&&_0x46c06d[_0xedb7('0x46')]){_0x2711ef[_0xedb7('0x4b')][_0xedb7('0x21')]({'id':_0x46c06d[_0xedb7('0x22')],'value':_0x46c06d[_0xedb7('0x49')][_0xedb7('0x27')]()});}else if(_0x46c06d[_0xedb7('0x4a')]===_0xedb7('0x4c')&&_0x46c06d['variableName']&&_0x46c06d[_0xedb7('0x22')]&&_0x46c06d[_0xedb7('0x46')]){_0x1c71af[_0x46c06d[_0xedb7('0x20')]]&&_0x2711ef[_0xedb7('0x4b')][_0xedb7('0x21')]({'id':_0x46c06d[_0xedb7('0x22')],'value':_0x1c71af[_0x46c06d[_0xedb7('0x20')]][_0xedb7('0x27')]()});}else if(_0x46c06d[_0xedb7('0x4a')]===_0xedb7('0x4d')&&_0x46c06d[_0xedb7('0x4e')]&&_0x46c06d[_0xedb7('0x4e')][_0xedb7('0x1d')]&&_0x46c06d[_0xedb7('0x22')]&&_0x46c06d[_0xedb7('0x46')]){_0x1c71af[_0x46c06d[_0xedb7('0x4e')][_0xedb7('0x1d')][_0xedb7('0x48')]()]&&_0x2711ef['custom_fields']['push']({'id':_0x46c06d[_0xedb7('0x22')],'value':_0x1c71af[_0x46c06d[_0xedb7('0x4e')][_0xedb7('0x1d')][_0xedb7('0x48')]()][_0xedb7('0x27')]()});}});}return _0x2711ef;}function getConnection(_0x14a11f){return request({'method':'POST','form':{'method':_0xedb7('0x4f'),'input_type':_0xedb7('0x23'),'response_type':'JSON','rest_data':JSON[_0xedb7('0x24')]({'user_auth':{'user_name':_0x14a11f[_0xedb7('0x50')],'password':_0x14a11f['password'],'encryption':'PLAIN'},'application':_0xedb7('0x51')})}})['then'](function(_0x3a1c90){var _0x2d5035=_0x3a1c90;if(_0x2d5035['id']){def['sessionID']=_0x2d5035['id'];return BPromise['resolve'](_0x2d5035);}else{throw new Error(util[_0xedb7('0x2c')](_0xedb7('0x52'),_0x14a11f['id']));}});}function setRelationship(_0x1d19bf,_0x5bf945,_0x2a7384,_0x41d0b0){return request({'form':{'method':'set_relationship','input_type':_0xedb7('0x23'),'response_type':_0xedb7('0x23'),'rest_data':JSON[_0xedb7('0x24')]({'session':_0x1d19bf['id'],'module_name':_0xedb7('0x53'),'module_id':_0x2a7384['id'],'link_field_name':_0x41d0b0,'related_ids':[_0x5bf945['id']]})}});}exports[_0xedb7('0x54')]=function(_0x2cb54a,_0x588920,_0x523175,_0x3ced72,_0x2f546d,_0x2bbf80){var _0x16e046,_0x4516e0,_0x1db5c8,_0x5a8f3a;_0x2bbf80[_0xedb7('0x55')]=intUtil['stripTrailingSlash'](_0x2bbf80[_0xedb7('0x55')]);_0x2bbf80['serverUrl']=intUtil[_0xedb7('0x56')](_0x2bbf80[_0xedb7('0x57')]);def[_0xedb7('0x58')]=util['format'](_0xedb7('0x59'),_0x2bbf80[_0xedb7('0x55')]);if(_0x2f546d&&_0x2f546d[_0xedb7('0x5a')]){logger[_0xedb7('0xe')](_0xedb7('0x5b'),_0xedb7('0x5c'));_0x588920[_0xedb7('0x5d')]=util[_0xedb7('0x2c')](_0xedb7('0x5e'),_0x2bbf80['serverUrl'],_0x588920[_0xedb7('0x5f')],md5(_0x588920['uniqueid']));}else{_0x588920[_0xedb7('0x5d')]='';}return getConnection(_0x2bbf80)[_0xedb7('0x2f')](function(_0x912765){_0x5a8f3a=_0x912765;return getUser(_0x2bbf80,_0x3ced72[_0xedb7('0x1d')],_0x5a8f3a);})[_0xedb7('0x2f')](function(_0xfaadd8){_0x16e046=_0xfaadd8;logger[_0xedb7('0xe')]('The\x20User\x20ID\x20is:',_0x16e046['id']);return getEndUser(_0x2bbf80,_0x588920['calleridname'],_0x588920['calleridnum'],_0x5a8f3a);})[_0xedb7('0x2f')](function(_0x1d3247){_0x4516e0=_0x1d3247;logger['info'](_0xedb7('0x60'),_0x4516e0['id']);return getTicket(_0x2bbf80,_0x16e046,_0x4516e0,_0x523175,_0x588920,_0x523175[_0xedb7('0x61')],_0x5a8f3a,'Inbound');})[_0xedb7('0x2f')](function(_0x5d04cd){_0x1db5c8=_0x5d04cd;logger[_0xedb7('0xe')](_0xedb7('0x62'));logger['info'](_0xedb7('0x63'),_0x1db5c8['id']);return setRelationship(_0x5a8f3a,_0x16e046,_0x1db5c8,_0xedb7('0x64'));})[_0xedb7('0x2f')](function(){return setRelationship(_0x5a8f3a,_0x4516e0,_0x1db5c8,_0xedb7('0x65'));})[_0xedb7('0x2f')](function(){return getServerInfo(_0x5a8f3a);})['then'](function(_0x334ffa){var _0x37ad03=parseInt(_0x334ffa[_0xedb7('0x66')][_0xedb7('0x67')](0x0));var _0x4ac22b=util[_0xedb7('0x2c')](_0xedb7('0x68'),_0x2bbf80[_0xedb7('0x55')],_0x1db5c8['id']);if(_0x37ad03>0x6){_0x4ac22b=util['format'](_0xedb7('0x69'),_0x2bbf80[_0xedb7('0x55')],_0x1db5c8['id']);}logger['info'](_0xedb7('0x5b'),_0xedb7('0x6a'));emit(util[_0xedb7('0x2c')](_0xedb7('0x6b'),_0x3ced72[_0xedb7('0x1d')]),_0xedb7('0x6c'),{'uri':_0x4ac22b});})[_0xedb7('0x6d')](function(_0x1e72e7){logger[_0xedb7('0x6e')](_0xedb7('0x5b'),JSON[_0xedb7('0x24')](_0x1e72e7));});};exports['outbound']=function(_0x554014,_0x54e279,_0x1a7d66,_0x21bc5e,_0x45e42b,_0x4c8e4f,_0x2e1de7){var _0x2b5fb8,_0x56bb6f,_0x40391f,_0x537865;_0x4c8e4f[_0xedb7('0x55')]=intUtil[_0xedb7('0x56')](_0x4c8e4f['remoteUri']);_0x4c8e4f[_0xedb7('0x57')]=intUtil['stripTrailingSlash'](_0x4c8e4f[_0xedb7('0x57')]);def[_0xedb7('0x58')]=util['format']('%s/service/v4_1/rest.php',_0x4c8e4f[_0xedb7('0x55')]);if(_0x2e1de7&&_0x2e1de7[_0xedb7('0x6f')]&&_0x2e1de7[_0xedb7('0x6f')]!==_0xedb7('0x70')){logger[_0xedb7('0xe')](_0xedb7('0x71'),_0xedb7('0x5c'));_0x54e279[_0xedb7('0x5d')]=util[_0xedb7('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c8e4f[_0xedb7('0x57')],_0x54e279['uniqueid'],md5(_0x54e279[_0xedb7('0x5f')]));}return getConnection(_0x4c8e4f)[_0xedb7('0x2f')](function(_0x18d142){_0x537865=_0x18d142;return getUser(_0x4c8e4f,_0x21bc5e[_0xedb7('0x1d')],_0x537865);})[_0xedb7('0x2f')](function(_0x28448c){_0x2b5fb8=_0x28448c;logger[_0xedb7('0xe')](_0xedb7('0x72'),_0x2b5fb8['id']);return getEndUser(_0x4c8e4f,_0x54e279[_0xedb7('0x73')],_0x54e279[_0xedb7('0x74')],_0x537865);})[_0xedb7('0x2f')](function(_0x11e29e){_0x56bb6f=_0x11e29e;logger['info'](_0xedb7('0x60'),_0x56bb6f['id']);return getTicket(_0x4c8e4f,_0x2b5fb8,_0x56bb6f,_0x1a7d66,_0x54e279,_0x1a7d66['Fields'],_0x537865,_0xedb7('0x75'));})[_0xedb7('0x2f')](function(_0x479883){_0x40391f=_0x479883;logger[_0xedb7('0xe')]('Ticket\x20created!');logger[_0xedb7('0xe')](_0xedb7('0x63'),_0x40391f['id']);return setRelationship(_0x537865,_0x2b5fb8,_0x40391f,_0xedb7('0x64'));})[_0xedb7('0x2f')](function(){return setRelationship(_0x537865,_0x56bb6f,_0x40391f,_0xedb7('0x65'));})['then'](function(){return getServerInfo(_0x537865);})[_0xedb7('0x2f')](function(_0x59ad35){var _0x4c507e=parseInt(_0x59ad35[_0xedb7('0x66')][_0xedb7('0x67')](0x0));var _0xb3c627=util[_0xedb7('0x2c')](_0xedb7('0x68'),_0x4c8e4f[_0xedb7('0x55')],_0x40391f['id']);if(_0x4c507e>0x6){_0xb3c627=util[_0xedb7('0x2c')](_0xedb7('0x69'),_0x4c8e4f[_0xedb7('0x55')],_0x40391f['id']);}logger[_0xedb7('0xe')](_0xedb7('0x71'),_0xedb7('0x6a'));emit(util[_0xedb7('0x2c')](_0xedb7('0x6b'),_0x21bc5e[_0xedb7('0x1d')]),'trigger:browser:url',{'uri':_0xb3c627});})[_0xedb7('0x6d')](function(_0xac01cf){logger[_0xedb7('0x6e')](_0xedb7('0x71'),JSON['stringify'](_0xac01cf));});};exports[_0xedb7('0x76')]=function(_0x529ebc,_0x19a3e2,_0x513d99,_0x2d807d,_0x5ebe89,_0xc49439){var _0x1d7164,_0x18d32a,_0x5f4532,_0x4a3e38;_0xc49439['remoteUri']=intUtil[_0xedb7('0x56')](_0xc49439['remoteUri']);_0xc49439[_0xedb7('0x57')]=intUtil[_0xedb7('0x56')](_0xc49439[_0xedb7('0x57')]);def['uri']=util[_0xedb7('0x2c')](_0xedb7('0x59'),_0xc49439[_0xedb7('0x55')]);if(_0x5ebe89&&_0x5ebe89[_0xedb7('0x5a')]){logger['info']('['+_0x19a3e2[_0xedb7('0x77')][_0xedb7('0x78')]()+']',_0xedb7('0x5c'));_0x19a3e2[_0xedb7('0x5d')]=util[_0xedb7('0x2c')](_0xedb7('0x5e'),_0xc49439[_0xedb7('0x57')],_0x19a3e2[_0xedb7('0x5f')],md5(_0x19a3e2[_0xedb7('0x5f')]));}else{_0x19a3e2[_0xedb7('0x5d')]='';}return getConnection(_0xc49439)[_0xedb7('0x2f')](function(_0x33c188){_0x4a3e38=_0x33c188;if(!_[_0xedb7('0x79')](_0x2d807d)){return getUser(_0xc49439,_0x2d807d['name'],_0x4a3e38);}else{return getUser(_0xc49439,null,_0x4a3e38);}})[_0xedb7('0x2f')](function(_0x1611d0){_0x1d7164=_0x1611d0;logger[_0xedb7('0xe')](_0xedb7('0x72'),_0x1d7164['id']);return getEndUser(_0xc49439,_0x19a3e2[_0xedb7('0x7a')],_0x19a3e2[_0xedb7('0x7b')],_0x4a3e38);})[_0xedb7('0x2f')](function(_0x4e6c39){_0x18d32a=_0x4e6c39;logger[_0xedb7('0xe')](_0xedb7('0x60'),_0x18d32a['id']);return getTicket(_0xc49439,_0x1d7164,_0x18d32a,_0x513d99,_0x19a3e2,_0x513d99['Fields'],_0x4a3e38,_0xedb7('0x7c'));})[_0xedb7('0x2f')](function(_0x51e1a4){_0x5f4532=_0x51e1a4;logger['info'](_0xedb7('0x62'));logger[_0xedb7('0xe')]('The\x20Ticket\x20ID\x20is:',_0x5f4532['id']);return setRelationship(_0x4a3e38,_0x1d7164,_0x5f4532,_0xedb7('0x64'));})['then'](function(){return setRelationship(_0x4a3e38,_0x18d32a,_0x5f4532,_0xedb7('0x65'));})[_0xedb7('0x2f')](function(){return getServerInfo(_0x4a3e38);})[_0xedb7('0x6d')](function(_0x4b4de2){logger[_0xedb7('0x6e')]('['+_0x19a3e2[_0xedb7('0x77')][_0xedb7('0x78')]()+']',JSON[_0xedb7('0x24')](_0x4b4de2));});};
\ No newline at end of file
index 5e807f1..9dc2714 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5d2=['join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','type','string','content','push','variableName','Variable','name','toLowerCase','keyValue','key','%s:\x20%s','keyContent','keyType','variable','format'];(function(_0x45a2e6,_0x1b2222){var _0x2f2641=function(_0x2c4c91){while(--_0x2c4c91){_0x45a2e6['push'](_0x45a2e6['shift']());}};_0x2f2641(++_0x1b2222);}(_0xd5d2,0x14b));var _0x2d5d=function(_0x34ffd5,_0x54c037){_0x34ffd5=_0x34ffd5-0x0;var _0x491cec=_0xd5d2[_0x34ffd5];return _0x491cec;};'use strict';var _=require(_0x2d5d('0x0'));var util=require(_0x2d5d('0x1'));exports[_0x2d5d('0x2')]=function(_0x138a6b,_0x3eab49,_0x497ca1){var _0x34f073=[];if(_0x138a6b[_0x2d5d('0x3')]>0x0){var _0x44bf72=_['sortBy'](_0x138a6b,['id']);for(var _0x55519a=0x0;_0x55519a<_0x44bf72['length'];_0x55519a++){var _0x1df2a9=_0x44bf72[_0x55519a];if(_0x1df2a9[_0x2d5d('0x4')]===_0x2d5d('0x5')){_0x34f073['push'](_0x1df2a9[_0x2d5d('0x6')]);}else if(_0x1df2a9[_0x2d5d('0x4')]==='variable'&&_0x1df2a9['variableName']){_0x3eab49[_0x1df2a9['variableName']]&&_0x34f073[_0x2d5d('0x7')](_0x3eab49[_0x1df2a9[_0x2d5d('0x8')]]['toString']());}else if(_0x1df2a9['type']==='customVariable'&&_0x1df2a9[_0x2d5d('0x9')]&&_0x1df2a9[_0x2d5d('0x9')][_0x2d5d('0xa')]){_0x3eab49[_0x1df2a9[_0x2d5d('0x9')][_0x2d5d('0xa')][_0x2d5d('0xb')]()]&&_0x34f073['push'](_0x3eab49[_0x1df2a9[_0x2d5d('0x9')][_0x2d5d('0xa')]['toLowerCase']()]['toString']());}else if(_0x1df2a9[_0x2d5d('0x4')]===_0x2d5d('0xc')){if(_0x1df2a9['keyType']===_0x2d5d('0x5')&&_0x1df2a9[_0x2d5d('0xd')]){_0x34f073[_0x2d5d('0x7')](util['format'](_0x2d5d('0xe'),_0x1df2a9['key'],_0x1df2a9[_0x2d5d('0xf')]));}else if(_0x1df2a9[_0x2d5d('0x10')]===_0x2d5d('0x11')&&_0x1df2a9['variableName']&&_0x1df2a9[_0x2d5d('0xd')]){_0x3eab49[_0x1df2a9[_0x2d5d('0x8')]]&&_0x34f073['push'](util[_0x2d5d('0x12')]('%s:\x20%s',_0x1df2a9[_0x2d5d('0xd')],_0x3eab49[_0x1df2a9['variableName']]));}else if(_0x1df2a9[_0x2d5d('0x10')]==='customVariable'&&_0x1df2a9[_0x2d5d('0x9')]&&_0x1df2a9[_0x2d5d('0x9')][_0x2d5d('0xa')]&&_0x1df2a9[_0x2d5d('0xd')]){_0x3eab49[_0x1df2a9[_0x2d5d('0x9')]['name'][_0x2d5d('0xb')]()]&&_0x34f073[_0x2d5d('0x7')](util[_0x2d5d('0x12')](_0x2d5d('0xe'),_0x1df2a9['key'],_0x3eab49[_0x1df2a9['Variable']['name'][_0x2d5d('0xb')]()]));}}}}return _0x34f073[_0x2d5d('0x13')](_0x497ca1);};exports[_0x2d5d('0x14')]=function(_0xbf6221){var _0xf57759=_0xbf6221['slice'](-0x1);if(_0xf57759==='/'){_0xbf6221=_0xbf6221[_0x2d5d('0x15')](0x0,_0xbf6221[_0x2d5d('0x16')](_0xf57759));}return _0xbf6221;};exports[_0x2d5d('0x17')]=function(_0x1af57e){if(!_[_0x2d5d('0x18')](_0x1af57e)&&_0x1af57e!==''){var _0x552441=/^(([^<>()\[\]\\.,;:\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 _0x552441['test'](String(_0x1af57e)[_0x2d5d('0xb')]());}else{return![];}};
\ No newline at end of file
+var _0xfbc1=['toLowerCase','keyType','key','%s:\x20%s','keyContent','format','join','slice','substring','lastIndexOf','validateEmail','test','util','getString','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','name'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfbc1,0x183));var _0x1fbc=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0xfbc1[_0x1d80be];return _0xf9a4f3;};'use strict';var _=require('lodash');var util=require(_0x1fbc('0x0'));exports[_0x1fbc('0x1')]=function(_0x488dd0,_0x19727a,_0x5619bf){var _0x511c8c=[];if(_0x488dd0[_0x1fbc('0x2')]>0x0){var _0x336c43=_[_0x1fbc('0x3')](_0x488dd0,['id']);for(var _0x57fda7=0x0;_0x57fda7<_0x336c43[_0x1fbc('0x2')];_0x57fda7++){var _0x1e41bc=_0x336c43[_0x57fda7];if(_0x1e41bc[_0x1fbc('0x4')]===_0x1fbc('0x5')){_0x511c8c[_0x1fbc('0x6')](_0x1e41bc['content']);}else if(_0x1e41bc['type']===_0x1fbc('0x7')&&_0x1e41bc[_0x1fbc('0x8')]){_0x19727a[_0x1e41bc[_0x1fbc('0x8')]]&&_0x511c8c['push'](_0x19727a[_0x1e41bc['variableName']][_0x1fbc('0x9')]());}else if(_0x1e41bc[_0x1fbc('0x4')]===_0x1fbc('0xa')&&_0x1e41bc[_0x1fbc('0xb')]&&_0x1e41bc[_0x1fbc('0xb')]['name']){_0x19727a[_0x1e41bc['Variable'][_0x1fbc('0xc')][_0x1fbc('0xd')]()]&&_0x511c8c[_0x1fbc('0x6')](_0x19727a[_0x1e41bc[_0x1fbc('0xb')]['name'][_0x1fbc('0xd')]()][_0x1fbc('0x9')]());}else if(_0x1e41bc[_0x1fbc('0x4')]==='keyValue'){if(_0x1e41bc[_0x1fbc('0xe')]===_0x1fbc('0x5')&&_0x1e41bc[_0x1fbc('0xf')]){_0x511c8c[_0x1fbc('0x6')](util['format'](_0x1fbc('0x10'),_0x1e41bc[_0x1fbc('0xf')],_0x1e41bc[_0x1fbc('0x11')]));}else if(_0x1e41bc[_0x1fbc('0xe')]===_0x1fbc('0x7')&&_0x1e41bc[_0x1fbc('0x8')]&&_0x1e41bc[_0x1fbc('0xf')]){_0x19727a[_0x1e41bc['variableName']]&&_0x511c8c[_0x1fbc('0x6')](util[_0x1fbc('0x12')](_0x1fbc('0x10'),_0x1e41bc[_0x1fbc('0xf')],_0x19727a[_0x1e41bc[_0x1fbc('0x8')]]));}else if(_0x1e41bc[_0x1fbc('0xe')]===_0x1fbc('0xa')&&_0x1e41bc[_0x1fbc('0xb')]&&_0x1e41bc[_0x1fbc('0xb')][_0x1fbc('0xc')]&&_0x1e41bc[_0x1fbc('0xf')]){_0x19727a[_0x1e41bc[_0x1fbc('0xb')][_0x1fbc('0xc')][_0x1fbc('0xd')]()]&&_0x511c8c[_0x1fbc('0x6')](util[_0x1fbc('0x12')](_0x1fbc('0x10'),_0x1e41bc['key'],_0x19727a[_0x1e41bc[_0x1fbc('0xb')][_0x1fbc('0xc')]['toLowerCase']()]));}}}}return _0x511c8c[_0x1fbc('0x13')](_0x5619bf);};exports['stripTrailingSlash']=function(_0x258ed3){var _0x3fdbe9=_0x258ed3[_0x1fbc('0x14')](-0x1);if(_0x3fdbe9==='/'){_0x258ed3=_0x258ed3[_0x1fbc('0x15')](0x0,_0x258ed3[_0x1fbc('0x16')](_0x3fdbe9));}return _0x258ed3;};exports[_0x1fbc('0x17')]=function(_0xd9aca4){if(!_['isNil'](_0xd9aca4)&&_0xd9aca4!==''){var _0x8aa6a2=/^(([^<>()\[\]\\.,;:\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 _0x8aa6a2[_0x1fbc('0x18')](String(_0xd9aca4)['toLowerCase']());}else{return![];}};
\ No newline at end of file
index f77fa42..24584ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0f4=['getEndUser','accessKey','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','[QUEUE]','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','user:%s','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','calleridname','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','emit','length','forEach','string','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','getString','Descriptions','format','%s/webservice.php','create','HelpDesk','stringify','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','username','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','lastname','POST','Contacts','Enduser\x20created.','phone'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xc0f4,0xef));var _0x4c0f=function(_0xad88f,_0x4761fb){_0xad88f=_0xad88f-0x0;var _0x43aeb4=_0xc0f4[_0xad88f];return _0x43aeb4;};'use strict';var _=require('lodash');var rp=require(_0x4c0f('0x0'));var BPromise=require(_0x4c0f('0x1'));var md5=require(_0x4c0f('0x2'));var util=require(_0x4c0f('0x3'));var Redis=require('ioredis');var intUtil=require(_0x4c0f('0x4'));var config=require(_0x4c0f('0x5'));var logger=require(_0x4c0f('0x6'))(_0x4c0f('0x7'));config[_0x4c0f('0x8')]=_[_0x4c0f('0x9')](config[_0x4c0f('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4c0f('0x8')]));function emit(_0x43dde5,_0x404250,_0xfea081){io['to'](_0x43dde5)[_0x4c0f('0xa')](_0x404250,_0xfea081);}function getCustomFields(_0x3e96d0,_0x41852a){var _0xdaadce={};if(_0x3e96d0[_0x4c0f('0xb')]>0x0){_[_0x4c0f('0xc')](_0x3e96d0,function(_0x2fec27){if(_0x2fec27['type']===_0x4c0f('0xd')&&_0x2fec27[_0x4c0f('0xe')]){_0xdaadce[_0x2fec27[_0x4c0f('0xe')]]=_0x2fec27['content'][_0x4c0f('0xf')]();}else if(_0x2fec27[_0x4c0f('0x10')]===_0x4c0f('0x11')&&_0x2fec27[_0x4c0f('0x12')]&&_0x2fec27[_0x4c0f('0xe')]&&_0x41852a[_0x2fec27[_0x4c0f('0x12')]]){_0xdaadce[_0x2fec27['idField']]=_0x41852a[_0x2fec27['variableName']][_0x4c0f('0xf')]();}else if(_0x2fec27['type']===_0x4c0f('0x13')&&_0x2fec27[_0x4c0f('0x14')]&&_0x2fec27[_0x4c0f('0x14')][_0x4c0f('0x15')]&&_0x2fec27[_0x4c0f('0xe')]&&_0x41852a[_0x2fec27[_0x4c0f('0x14')][_0x4c0f('0x15')][_0x4c0f('0x16')]()]){_0xdaadce[_0x2fec27[_0x4c0f('0xe')]]=_0x41852a[_0x2fec27[_0x4c0f('0x14')]['name'][_0x4c0f('0x16')]()][_0x4c0f('0xf')]();}});}return _0xdaadce;}function createTicket(_0x1ae03e,_0x2642f6,_0x219827,_0xf85a8a,_0x86d051,_0x10f3a7,_0x587eaf){logger[_0x4c0f('0x17')](_0x4c0f('0x18'));var _0x5e75d2=_['merge']({'parent_id':'','assigned_user_id':_0x2642f6['id'],'ticketpriorities':_0x4c0f('0x19'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0xf85a8a['Subjects'],_0x86d051,'\x20'),'description':intUtil[_0x4c0f('0x1a')](_0xf85a8a[_0x4c0f('0x1b')],_0x86d051,'\x0a'),'contact_id':_0x219827['id']},getCustomFields(_0x10f3a7,_0x86d051));var _0x5ba0d5={'method':'POST','uri':util[_0x4c0f('0x1c')](_0x4c0f('0x1d'),_0x1ae03e['remoteUri']),'form':{'operation':_0x4c0f('0x1e'),'username':_0x1ae03e['username'],'sessionName':_0x587eaf['sessionName'],'elementType':_0x4c0f('0x1f'),'element':JSON[_0x4c0f('0x20')](_0x5e75d2)},'json':!![]};return request(_0x5ba0d5)[_0x4c0f('0x21')](function(_0x9bc553){if(_0x9bc553[_0x4c0f('0x22')]){return BPromise[_0x4c0f('0x23')]({'id':_0x9bc553[_0x4c0f('0x24')]['id']});}else{throw new Error(util[_0x4c0f('0x1c')](_0x4c0f('0x25'),JSON['stringify'](_0x9bc553[_0x4c0f('0x26')])));}})[_0x4c0f('0x27')](function(_0x1cd07d){var _0x47a09f=_0x1cd07d['statusCode']||0x1f4;logger[_0x4c0f('0x26')](_0x4c0f('0x28'),_0x4c0f('0x29'),_0x47a09f,JSON[_0x4c0f('0x20')](_0x1cd07d));});}function getUser(_0x1a9bcc,_0x20c705,_0x2b9a93){if(intUtil[_0x4c0f('0x2a')](_0x20c705)){logger[_0x4c0f('0x17')](_0x4c0f('0x2b'),_0x20c705);return request({'method':'GET','uri':util['format'](_0x4c0f('0x1d'),_0x1a9bcc[_0x4c0f('0x2c')]),'qs':{'operation':'query','username':_0x1a9bcc[_0x4c0f('0x2d')],'sessionName':_0x2b9a93[_0x4c0f('0x2e')],'query':util[_0x4c0f('0x1c')](_0x4c0f('0x2f'),_0x20c705)},'json':!![]})[_0x4c0f('0x21')](function(_0x3e954d){if(_0x3e954d[_0x4c0f('0x22')]&&_0x3e954d['result'][_0x4c0f('0xb')]){logger[_0x4c0f('0x17')](_0x4c0f('0x30'));return BPromise[_0x4c0f('0x23')]({'id':_0x3e954d['result'][0x0]['id'],'email':_0x3e954d[_0x4c0f('0x24')][0x0][_0x4c0f('0x31')],'name':_0x3e954d[_0x4c0f('0x24')][0x0][_0x4c0f('0x32')]+'\x20'+_0x3e954d[_0x4c0f('0x24')][_0x4c0f('0x33')]});}else{logger[_0x4c0f('0x17')](_0x4c0f('0x34'));return BPromise[_0x4c0f('0x23')]({'id':_0x2b9a93[_0x4c0f('0x35')],'email':_0x1a9bcc[_0x4c0f('0x2d')],'name':_0x4c0f('0x36')});}})[_0x4c0f('0x27')](function(_0x3a57a8){var _0x5e5a94=_0x3a57a8[_0x4c0f('0x37')]||0x1f4;logger[_0x4c0f('0x26')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x4c0f('0x38'),_0x5e5a94,JSON[_0x4c0f('0x20')](_0x3a57a8));});}else{logger['info'](_0x4c0f('0x34'));return BPromise[_0x4c0f('0x23')]({'id':_0x2b9a93[_0x4c0f('0x35')],'email':_0x1a9bcc[_0x4c0f('0x2d')],'name':'admin'})[_0x4c0f('0x27')](function(_0x527e3b){var _0xfe2ba4=_0x527e3b[_0x4c0f('0x37')]||0x1f4;logger[_0x4c0f('0x26')](_0x4c0f('0x28'),_0x4c0f('0x38'),_0xfe2ba4,JSON[_0x4c0f('0x20')](_0x527e3b));});}}function getEndUser(_0x2246d6,_0x233b2c,_0x437fe6,_0x18ecd2){logger[_0x4c0f('0x17')](_0x4c0f('0x39'),_0x437fe6);return request({'method':_0x4c0f('0x3a'),'uri':util[_0x4c0f('0x1c')]('%s/webservice.php',_0x2246d6[_0x4c0f('0x2c')]),'qs':{'operation':_0x4c0f('0x3b'),'username':_0x2246d6[_0x4c0f('0x2d')],'sessionName':_0x18ecd2[_0x4c0f('0x2e')],'query':util['format']('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;',_0x437fe6,_0x437fe6,_0x437fe6,_0x437fe6,_0x437fe6)},'json':!![]})['then'](function(_0x417ea1){if(_0x417ea1[_0x4c0f('0x22')]&&_0x417ea1[_0x4c0f('0x24')][_0x4c0f('0xb')]){logger[_0x4c0f('0x17')](_0x4c0f('0x3c'));return BPromise[_0x4c0f('0x23')]({'id':_0x417ea1[_0x4c0f('0x24')][0x0]['id'],'name':_0x417ea1[_0x4c0f('0x24')][0x0][_0x4c0f('0x3d')]+'\x20'+_0x417ea1['result'][0x0][_0x4c0f('0x3e')],'phone':_0x437fe6});}else{logger[_0x4c0f('0x17')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x4c0f('0x3f'),'uri':util['format'](_0x4c0f('0x1d'),_0x2246d6[_0x4c0f('0x2c')]),'form':{'operation':_0x4c0f('0x1e'),'sessionName':_0x18ecd2[_0x4c0f('0x2e')],'elementType':_0x4c0f('0x40'),'element':JSON[_0x4c0f('0x20')]({'lastname':_0x233b2c,'phone':_0x437fe6,'assigned_user_id':'\x20'})},'json':!![]})[_0x4c0f('0x21')](function(_0x1372f5){logger[_0x4c0f('0x17')](_0x4c0f('0x41'));return BPromise[_0x4c0f('0x23')]({'id':_0x1372f5[_0x4c0f('0x24')]['id'],'name':_0x1372f5['result'][_0x4c0f('0x3e')],'phone':_0x1372f5[_0x4c0f('0x24')][_0x4c0f('0x42')]});})[_0x4c0f('0x27')](function(_0x48cea9){var _0x5b0e16=_0x48cea9['statusCode']||0x1f4;logger[_0x4c0f('0x26')](_0x4c0f('0x28'),_0x4c0f('0x43'),_0x5b0e16,JSON[_0x4c0f('0x20')](_0x48cea9));});}});}function getConnection(_0x9a6ff6){var _0x211f3a=_0x9a6ff6[_0x4c0f('0x2d')];var _0x2903bb=_0x9a6ff6[_0x4c0f('0x44')];return request({'method':_0x4c0f('0x3a'),'uri':util[_0x4c0f('0x1c')](_0x4c0f('0x1d'),_0x9a6ff6[_0x4c0f('0x2c')]),'qs':{'operation':'getchallenge','username':_0x211f3a},'json':!![]})['then'](function(_0x2174d2){if(_0x2174d2[_0x4c0f('0x22')]){return request({'method':_0x4c0f('0x3f'),'uri':util[_0x4c0f('0x1c')](_0x4c0f('0x1d'),_0x9a6ff6[_0x4c0f('0x2c')]),'form':{'operation':_0x4c0f('0x45'),'username':_0x211f3a,'accessKey':md5(_0x2174d2[_0x4c0f('0x24')][_0x4c0f('0x46')]+_0x2903bb)},'json':!![]});}})['then'](function(_0x48889c){if(_0x48889c['success']){return BPromise['resolve'](_0x48889c[_0x4c0f('0x24')]);}else{throw new Error(util[_0x4c0f('0x1c')](_0x4c0f('0x47'),_0x9a6ff6['id']));}})[_0x4c0f('0x27')](function(_0x5222e8){var _0x5ba106=_0x5222e8[_0x4c0f('0x37')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x4c0f('0x48'),_0x5ba106,JSON[_0x4c0f('0x20')](_0x5222e8));});}function request(_0x1a706c){logger[_0x4c0f('0x17')](_0x4c0f('0x49'),JSON[_0x4c0f('0x20')](_0x1a706c));return rp(_0x1a706c);}exports[_0x4c0f('0x4a')]=function(_0x2b6233,_0x37a6b1,_0x1801d1,_0x48d09e,_0x55d26b,_0x4b9fbc){var _0x3cd9e6,_0x5f292c,_0x50375e,_0x3970b6;_0x4b9fbc[_0x4c0f('0x2c')]=intUtil['stripTrailingSlash'](_0x4b9fbc['remoteUri']);if(_0x55d26b&&_0x55d26b[_0x4c0f('0x4b')]){logger[_0x4c0f('0x17')](_0x4c0f('0x4c'),'Recording\x20is\x20enabled!');_0x37a6b1[_0x4c0f('0x4d')]=util[_0x4c0f('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b9fbc[_0x4c0f('0x4e')],_0x37a6b1[_0x4c0f('0x4f')],md5(_0x37a6b1[_0x4c0f('0x4f')]));}else{_0x37a6b1[_0x4c0f('0x4d')]='';}return getConnection(_0x4b9fbc)[_0x4c0f('0x21')](function(_0xb4aca5){_0x3970b6=_0xb4aca5;return getUser(_0x4b9fbc,_0x48d09e['email'],_0x3970b6);})[_0x4c0f('0x21')](function(_0x1291bd){_0x3cd9e6=_0x1291bd;logger['info'](_0x4c0f('0x50'),_0x3cd9e6['id']);return getEndUser(_0x4b9fbc,_0x37a6b1['calleridname'],_0x37a6b1[_0x4c0f('0x51')],_0x3970b6);})[_0x4c0f('0x21')](function(_0x3a0ab3){_0x5f292c=_0x3a0ab3;logger['info'](_0x4c0f('0x52'),_0x5f292c['id']);return createTicket(_0x4b9fbc,_0x3cd9e6,_0x5f292c,_0x1801d1,_0x37a6b1,_0x1801d1[_0x4c0f('0x53')],_0x3970b6);})[_0x4c0f('0x21')](function(_0x142bf4){_0x50375e=_0x142bf4;logger[_0x4c0f('0x17')](_0x4c0f('0x54'));logger[_0x4c0f('0x17')](_0x4c0f('0x55'),_0x50375e['id']);var _0x37215f=util[_0x4c0f('0x1c')](_0x4c0f('0x56'),_0x4b9fbc[_0x4c0f('0x2c')],_[_0x4c0f('0x57')](_0x50375e['id'],'x')[0x1]);logger[_0x4c0f('0x17')](_0x4c0f('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4c0f('0x1c')](_0x4c0f('0x58'),_0x48d09e['name']),'trigger:browser:url',{'uri':_0x37215f});})[_0x4c0f('0x27')](function(_0x53de67){logger['error'](_0x4c0f('0x4c'),JSON['stringify'](_0x53de67));});};exports[_0x4c0f('0x59')]=function(_0x308119,_0x223477,_0x237c9c,_0x573721,_0x1b0231,_0x162e80,_0x30f773){var _0x28960e,_0x1e7d05,_0x5ba65a,_0x3face0;_0x162e80[_0x4c0f('0x2c')]=intUtil[_0x4c0f('0x5a')](_0x162e80[_0x4c0f('0x2c')]);_0x162e80[_0x4c0f('0x4e')]=intUtil[_0x4c0f('0x5a')](_0x162e80['serverUrl']);if(_0x30f773&&_0x30f773[_0x4c0f('0x5b')]&&_0x30f773[_0x4c0f('0x5b')]!=='none'){logger[_0x4c0f('0x17')](_0x4c0f('0x5c'),_0x4c0f('0x5d'));_0x223477[_0x4c0f('0x4d')]=util[_0x4c0f('0x1c')](_0x4c0f('0x5e'),_0x162e80[_0x4c0f('0x4e')],_0x223477[_0x4c0f('0x4f')],md5(_0x223477[_0x4c0f('0x4f')]));}return getConnection(_0x162e80)[_0x4c0f('0x21')](function(_0x46a38c){_0x3face0=_0x46a38c;return getUser(_0x162e80,_0x573721[_0x4c0f('0x5f')],_0x3face0);})['then'](function(_0x3b51b7){_0x28960e=_0x3b51b7;logger[_0x4c0f('0x17')](_0x4c0f('0x50'),_0x28960e['id']);return getEndUser(_0x162e80,_0x223477[_0x4c0f('0x60')],_0x223477[_0x4c0f('0x61')],_0x3face0);})[_0x4c0f('0x21')](function(_0x3dfad6){_0x1e7d05=_0x3dfad6;logger[_0x4c0f('0x17')]('The\x20Enduser\x20ID\x20is:',_0x1e7d05['id']);return createTicket(_0x162e80,_0x28960e,_0x1e7d05,_0x237c9c,_0x223477,_0x237c9c[_0x4c0f('0x53')],_0x3face0);})['then'](function(_0xf05c4a){_0x5ba65a=_0xf05c4a;logger[_0x4c0f('0x17')](_0x4c0f('0x54'));logger[_0x4c0f('0x17')]('The\x20Ticket\x20ID\x20is:',_0x5ba65a['id']);var _0x529459=util[_0x4c0f('0x1c')](_0x4c0f('0x56'),_0x162e80[_0x4c0f('0x2c')],_[_0x4c0f('0x57')](_0x5ba65a['id'],'x')[0x1]);logger['info'](_0x4c0f('0x5c'),_0x4c0f('0x62'));emit(util[_0x4c0f('0x1c')](_0x4c0f('0x58'),_0x573721['name']),'trigger:browser:url',{'uri':_0x529459});})[_0x4c0f('0x27')](function(_0x1f1c2c){logger[_0x4c0f('0x26')](_0x4c0f('0x5c'),JSON[_0x4c0f('0x20')](_0x1f1c2c));});};exports[_0x4c0f('0x63')]=function(_0x218113,_0x195be9,_0x2da121,_0x344426,_0x2880e1,_0x332491){var _0x5ecb5b,_0x4a9671,_0x1b1238,_0x50e49e;_0x332491[_0x4c0f('0x2c')]=intUtil[_0x4c0f('0x5a')](_0x332491[_0x4c0f('0x2c')]);_0x332491[_0x4c0f('0x4e')]=intUtil[_0x4c0f('0x5a')](_0x332491[_0x4c0f('0x4e')]);if(_0x2880e1&&_0x2880e1[_0x4c0f('0x4b')]){logger[_0x4c0f('0x17')]('['+_0x195be9['lastevent'][_0x4c0f('0x64')]()+']','Recording\x20is\x20enabled!');_0x195be9[_0x4c0f('0x4d')]=util['format'](_0x4c0f('0x5e'),_0x332491['serverUrl'],_0x195be9['uniqueid'],md5(_0x195be9[_0x4c0f('0x4f')]));}else{_0x195be9[_0x4c0f('0x4d')]='';}return getConnection(_0x332491)[_0x4c0f('0x21')](function(_0x42db49){_0x50e49e=_0x42db49;return getUser(_0x332491,'',_0x50e49e);})['then'](function(_0x59773f){_0x5ecb5b=_0x59773f;logger[_0x4c0f('0x17')]('The\x20User\x20ID\x20is:',_0x5ecb5b['id']);return getEndUser(_0x332491,_0x195be9[_0x4c0f('0x65')],_0x195be9[_0x4c0f('0x51')],_0x50e49e);})[_0x4c0f('0x21')](function(_0x41b3a7){_0x4a9671=_0x41b3a7;logger[_0x4c0f('0x17')](_0x4c0f('0x52'),_0x4a9671['id']);return createTicket(_0x332491,_0x5ecb5b,_0x4a9671,_0x2da121,_0x195be9,_0x2da121[_0x4c0f('0x53')],_0x50e49e);})[_0x4c0f('0x21')](function(_0x57fe67){_0x1b1238=_0x57fe67;logger[_0x4c0f('0x17')](_0x4c0f('0x54'));logger[_0x4c0f('0x17')](_0x4c0f('0x55'),_0x1b1238['id']);})['catch'](function(_0x4e5470){logger[_0x4c0f('0x26')]('['+_0x195be9['lastevent'][_0x4c0f('0x64')]()+']',JSON[_0x4c0f('0x20')](_0x4e5470));});};
\ No newline at end of file
+var _0xcca3=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Contacts','phone','accessKey','getchallenge','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','split','trigger:browser:url','outbound','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Fields','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','toUpperCase','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','string','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','getString','Subjects','format','%s/webservice.php','remoteUri','create','username','sessionName','then','success','resolve','result','stringify','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','GET','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','userId','admin','getUser','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20end\x20user\x20with\x20phone','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname'];(function(_0x5de02c,_0x2bca83){var _0x5bee77=function(_0x447356){while(--_0x447356){_0x5de02c['push'](_0x5de02c['shift']());}};_0x5bee77(++_0x2bca83);}(_0xcca3,0xe7));var _0x3cca=function(_0x30df37,_0x48ad64){_0x30df37=_0x30df37-0x0;var _0x41ab55=_0xcca3[_0x30df37];return _0x41ab55;};'use strict';var _=require('lodash');var rp=require(_0x3cca('0x0'));var BPromise=require(_0x3cca('0x1'));var md5=require(_0x3cca('0x2'));var util=require(_0x3cca('0x3'));var Redis=require(_0x3cca('0x4'));var intUtil=require(_0x3cca('0x5'));var config=require(_0x3cca('0x6'));var logger=require(_0x3cca('0x7'))(_0x3cca('0x8'));config[_0x3cca('0x9')]=_[_0x3cca('0xa')](config[_0x3cca('0x9')],{'host':_0x3cca('0xb'),'port':0x18eb});var io=require(_0x3cca('0xc'))(new Redis(config[_0x3cca('0x9')]));function emit(_0x4d287c,_0x27a567,_0x3280ef){io['to'](_0x4d287c)['emit'](_0x27a567,_0x3280ef);}function getCustomFields(_0x359341,_0x476d0e){var _0x3a1db3={};if(_0x359341[_0x3cca('0xd')]>0x0){_['forEach'](_0x359341,function(_0x4adb7c){if(_0x4adb7c['type']===_0x3cca('0xe')&&_0x4adb7c[_0x3cca('0xf')]){_0x3a1db3[_0x4adb7c['idField']]=_0x4adb7c[_0x3cca('0x10')][_0x3cca('0x11')]();}else if(_0x4adb7c[_0x3cca('0x12')]==='variable'&&_0x4adb7c[_0x3cca('0x13')]&&_0x4adb7c[_0x3cca('0xf')]&&_0x476d0e[_0x4adb7c[_0x3cca('0x13')]]){_0x3a1db3[_0x4adb7c[_0x3cca('0xf')]]=_0x476d0e[_0x4adb7c[_0x3cca('0x13')]][_0x3cca('0x11')]();}else if(_0x4adb7c[_0x3cca('0x12')]===_0x3cca('0x14')&&_0x4adb7c[_0x3cca('0x15')]&&_0x4adb7c[_0x3cca('0x15')]['name']&&_0x4adb7c[_0x3cca('0xf')]&&_0x476d0e[_0x4adb7c['Variable'][_0x3cca('0x16')][_0x3cca('0x17')]()]){_0x3a1db3[_0x4adb7c['idField']]=_0x476d0e[_0x4adb7c[_0x3cca('0x15')][_0x3cca('0x16')][_0x3cca('0x17')]()][_0x3cca('0x11')]();}});}return _0x3a1db3;}function createTicket(_0x1086e6,_0x33a284,_0x43949d,_0x4de889,_0x1e386b,_0x2d6728,_0x2b33c7){logger[_0x3cca('0x18')](_0x3cca('0x19'));var _0x339447=_['merge']({'parent_id':'','assigned_user_id':_0x33a284['id'],'ticketpriorities':_0x3cca('0x1a'),'ticketstatus':_0x3cca('0x1b'),'ticket_title':intUtil[_0x3cca('0x1c')](_0x4de889[_0x3cca('0x1d')],_0x1e386b,'\x20'),'description':intUtil['getString'](_0x4de889['Descriptions'],_0x1e386b,'\x0a'),'contact_id':_0x43949d['id']},getCustomFields(_0x2d6728,_0x1e386b));var _0x10d7b0={'method':'POST','uri':util[_0x3cca('0x1e')](_0x3cca('0x1f'),_0x1086e6[_0x3cca('0x20')]),'form':{'operation':_0x3cca('0x21'),'username':_0x1086e6[_0x3cca('0x22')],'sessionName':_0x2b33c7[_0x3cca('0x23')],'elementType':'HelpDesk','element':JSON['stringify'](_0x339447)},'json':!![]};return request(_0x10d7b0)[_0x3cca('0x24')](function(_0xcccfbb){if(_0xcccfbb[_0x3cca('0x25')]){return BPromise[_0x3cca('0x26')]({'id':_0xcccfbb[_0x3cca('0x27')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x3cca('0x28')](_0xcccfbb[_0x3cca('0x29')])));}})[_0x3cca('0x2a')](function(_0x57e0cb){var _0x511aaa=_0x57e0cb[_0x3cca('0x2b')]||0x1f4;logger[_0x3cca('0x29')](_0x3cca('0x2c'),_0x3cca('0x2d'),_0x511aaa,JSON[_0x3cca('0x28')](_0x57e0cb));});}function getUser(_0x41dd84,_0x1477ac,_0x5dd612){if(intUtil[_0x3cca('0x2e')](_0x1477ac)){logger[_0x3cca('0x18')]('Getting\x20agent\x20with\x20email',_0x1477ac);return request({'method':_0x3cca('0x2f'),'uri':util[_0x3cca('0x1e')](_0x3cca('0x1f'),_0x41dd84[_0x3cca('0x20')]),'qs':{'operation':'query','username':_0x41dd84[_0x3cca('0x22')],'sessionName':_0x5dd612[_0x3cca('0x23')],'query':util[_0x3cca('0x1e')](_0x3cca('0x30'),_0x1477ac)},'json':!![]})[_0x3cca('0x24')](function(_0xc901e1){if(_0xc901e1[_0x3cca('0x25')]&&_0xc901e1[_0x3cca('0x27')][_0x3cca('0xd')]){logger[_0x3cca('0x18')](_0x3cca('0x31'));return BPromise[_0x3cca('0x26')]({'id':_0xc901e1[_0x3cca('0x27')][0x0]['id'],'email':_0xc901e1[_0x3cca('0x27')][0x0][_0x3cca('0x32')],'name':_0xc901e1[_0x3cca('0x27')][0x0][_0x3cca('0x33')]+'\x20'+_0xc901e1['result'][_0x3cca('0x34')]});}else{logger[_0x3cca('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3cca('0x26')]({'id':_0x5dd612[_0x3cca('0x35')],'email':_0x41dd84[_0x3cca('0x22')],'name':_0x3cca('0x36')});}})['catch'](function(_0x41f567){var _0x212e05=_0x41f567[_0x3cca('0x2b')]||0x1f4;logger['error'](_0x3cca('0x2c'),_0x3cca('0x37'),_0x212e05,JSON[_0x3cca('0x28')](_0x41f567));});}else{logger[_0x3cca('0x18')](_0x3cca('0x38'));return BPromise['resolve']({'id':_0x5dd612[_0x3cca('0x35')],'email':_0x41dd84[_0x3cca('0x22')],'name':_0x3cca('0x36')})[_0x3cca('0x2a')](function(_0x13d417){var _0x3fa008=_0x13d417[_0x3cca('0x2b')]||0x1f4;logger[_0x3cca('0x29')](_0x3cca('0x2c'),_0x3cca('0x37'),_0x3fa008,JSON[_0x3cca('0x28')](_0x13d417));});}}function getEndUser(_0x838fba,_0x20c944,_0x5ab2fd,_0x11096e){logger[_0x3cca('0x18')](_0x3cca('0x39'),_0x5ab2fd);return request({'method':'GET','uri':util[_0x3cca('0x1e')](_0x3cca('0x1f'),_0x838fba[_0x3cca('0x20')]),'qs':{'operation':_0x3cca('0x3a'),'username':_0x838fba[_0x3cca('0x22')],'sessionName':_0x11096e[_0x3cca('0x23')],'query':util[_0x3cca('0x1e')](_0x3cca('0x3b'),_0x5ab2fd,_0x5ab2fd,_0x5ab2fd,_0x5ab2fd,_0x5ab2fd)},'json':!![]})[_0x3cca('0x24')](function(_0x583f6c){if(_0x583f6c[_0x3cca('0x25')]&&_0x583f6c[_0x3cca('0x27')][_0x3cca('0xd')]){logger[_0x3cca('0x18')](_0x3cca('0x3c'));return BPromise[_0x3cca('0x26')]({'id':_0x583f6c[_0x3cca('0x27')][0x0]['id'],'name':_0x583f6c[_0x3cca('0x27')][0x0][_0x3cca('0x3d')]+'\x20'+_0x583f6c[_0x3cca('0x27')][0x0][_0x3cca('0x3e')],'phone':_0x5ab2fd});}else{logger[_0x3cca('0x18')](_0x3cca('0x3f'));return request({'method':_0x3cca('0x40'),'uri':util['format'](_0x3cca('0x1f'),_0x838fba[_0x3cca('0x20')]),'form':{'operation':_0x3cca('0x21'),'sessionName':_0x11096e['sessionName'],'elementType':_0x3cca('0x41'),'element':JSON[_0x3cca('0x28')]({'lastname':_0x20c944,'phone':_0x5ab2fd,'assigned_user_id':'\x20'})},'json':!![]})[_0x3cca('0x24')](function(_0x3ab6d6){logger[_0x3cca('0x18')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x3ab6d6[_0x3cca('0x27')]['id'],'name':_0x3ab6d6[_0x3cca('0x27')][_0x3cca('0x3e')],'phone':_0x3ab6d6[_0x3cca('0x27')][_0x3cca('0x42')]});})[_0x3cca('0x2a')](function(_0x2f4458){var _0x4ea00f=_0x2f4458['statusCode']||0x1f4;logger[_0x3cca('0x29')](_0x3cca('0x2c'),'getEndUser',_0x4ea00f,JSON[_0x3cca('0x28')](_0x2f4458));});}});}function getConnection(_0x5034bb){var _0x370db4=_0x5034bb[_0x3cca('0x22')];var _0x3646a=_0x5034bb[_0x3cca('0x43')];return request({'method':_0x3cca('0x2f'),'uri':util['format'](_0x3cca('0x1f'),_0x5034bb[_0x3cca('0x20')]),'qs':{'operation':_0x3cca('0x44'),'username':_0x370db4},'json':!![]})['then'](function(_0x5b1dec){if(_0x5b1dec[_0x3cca('0x25')]){return request({'method':_0x3cca('0x40'),'uri':util['format']('%s/webservice.php',_0x5034bb[_0x3cca('0x20')]),'form':{'operation':'login','username':_0x370db4,'accessKey':md5(_0x5b1dec[_0x3cca('0x27')]['token']+_0x3646a)},'json':!![]});}})[_0x3cca('0x24')](function(_0x206eeb){if(_0x206eeb[_0x3cca('0x25')]){return BPromise['resolve'](_0x206eeb[_0x3cca('0x27')]);}else{throw new Error(util['format'](_0x3cca('0x45'),_0x5034bb['id']));}})[_0x3cca('0x2a')](function(_0x144d5a){var _0x51ef54=_0x144d5a[_0x3cca('0x2b')]||0x1f4;logger[_0x3cca('0x29')](_0x3cca('0x2c'),_0x3cca('0x46'),_0x51ef54,JSON[_0x3cca('0x28')](_0x144d5a));});}function request(_0xbe93eb){logger[_0x3cca('0x18')](_0x3cca('0x47'),JSON[_0x3cca('0x28')](_0xbe93eb));return rp(_0xbe93eb);}exports['queue']=function(_0x45687a,_0x31cf66,_0x43fe73,_0x2df491,_0x10ad22,_0x2bc964){var _0x1dc9c8,_0x53d9fb,_0x399f66,_0x2f3361;_0x2bc964['remoteUri']=intUtil[_0x3cca('0x48')](_0x2bc964['remoteUri']);if(_0x10ad22&&_0x10ad22[_0x3cca('0x49')]){logger[_0x3cca('0x18')](_0x3cca('0x4a'),_0x3cca('0x4b'));_0x31cf66[_0x3cca('0x4c')]=util['format'](_0x3cca('0x4d'),_0x2bc964[_0x3cca('0x4e')],_0x31cf66['uniqueid'],md5(_0x31cf66[_0x3cca('0x4f')]));}else{_0x31cf66[_0x3cca('0x4c')]='';}return getConnection(_0x2bc964)[_0x3cca('0x24')](function(_0x275f42){_0x2f3361=_0x275f42;return getUser(_0x2bc964,_0x2df491['email'],_0x2f3361);})[_0x3cca('0x24')](function(_0x4c990b){_0x1dc9c8=_0x4c990b;logger['info'](_0x3cca('0x50'),_0x1dc9c8['id']);return getEndUser(_0x2bc964,_0x31cf66[_0x3cca('0x51')],_0x31cf66[_0x3cca('0x52')],_0x2f3361);})[_0x3cca('0x24')](function(_0x4fef5b){_0x53d9fb=_0x4fef5b;logger[_0x3cca('0x18')](_0x3cca('0x53'),_0x53d9fb['id']);return createTicket(_0x2bc964,_0x1dc9c8,_0x53d9fb,_0x43fe73,_0x31cf66,_0x43fe73['Fields'],_0x2f3361);})[_0x3cca('0x24')](function(_0xc9c1a0){_0x399f66=_0xc9c1a0;logger[_0x3cca('0x18')]('Ticket\x20created!');logger[_0x3cca('0x18')](_0x3cca('0x54'),_0x399f66['id']);var _0x1bd910=util[_0x3cca('0x1e')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x2bc964['remoteUri'],_[_0x3cca('0x55')](_0x399f66['id'],'x')[0x1]);logger[_0x3cca('0x18')](_0x3cca('0x4a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3cca('0x1e')]('user:%s',_0x2df491[_0x3cca('0x16')]),_0x3cca('0x56'),{'uri':_0x1bd910});})[_0x3cca('0x2a')](function(_0x3b318d){logger[_0x3cca('0x29')]('[QUEUE]',JSON[_0x3cca('0x28')](_0x3b318d));});};exports[_0x3cca('0x57')]=function(_0x270ab4,_0x33fa84,_0x1af612,_0x1353ac,_0x54aa13,_0x29414e,_0x120944){var _0x1cf295,_0x20c5d2,_0x74a230,_0x238c88;_0x29414e[_0x3cca('0x20')]=intUtil[_0x3cca('0x48')](_0x29414e[_0x3cca('0x20')]);_0x29414e[_0x3cca('0x4e')]=intUtil[_0x3cca('0x48')](_0x29414e[_0x3cca('0x4e')]);if(_0x120944&&_0x120944['recordingFormat']&&_0x120944['recordingFormat']!==_0x3cca('0x58')){logger[_0x3cca('0x18')](_0x3cca('0x59'),_0x3cca('0x4b'));_0x33fa84[_0x3cca('0x4c')]=util['format'](_0x3cca('0x4d'),_0x29414e['serverUrl'],_0x33fa84[_0x3cca('0x4f')],md5(_0x33fa84[_0x3cca('0x4f')]));}return getConnection(_0x29414e)[_0x3cca('0x24')](function(_0x3977c7){_0x238c88=_0x3977c7;return getUser(_0x29414e,_0x1353ac[_0x3cca('0x5a')],_0x238c88);})[_0x3cca('0x24')](function(_0x2775d6){_0x1cf295=_0x2775d6;logger[_0x3cca('0x18')](_0x3cca('0x50'),_0x1cf295['id']);return getEndUser(_0x29414e,_0x33fa84[_0x3cca('0x5b')],_0x33fa84[_0x3cca('0x5c')],_0x238c88);})['then'](function(_0x1b28d3){_0x20c5d2=_0x1b28d3;logger[_0x3cca('0x18')]('The\x20Enduser\x20ID\x20is:',_0x20c5d2['id']);return createTicket(_0x29414e,_0x1cf295,_0x20c5d2,_0x1af612,_0x33fa84,_0x1af612[_0x3cca('0x5d')],_0x238c88);})[_0x3cca('0x24')](function(_0x21cddf){_0x74a230=_0x21cddf;logger['info'](_0x3cca('0x5e'));logger[_0x3cca('0x18')](_0x3cca('0x54'),_0x74a230['id']);var _0x5a2639=util[_0x3cca('0x1e')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x29414e['remoteUri'],_[_0x3cca('0x55')](_0x74a230['id'],'x')[0x1]);logger[_0x3cca('0x18')]('[OUTBOUND]',_0x3cca('0x5f'));emit(util[_0x3cca('0x1e')](_0x3cca('0x60'),_0x1353ac[_0x3cca('0x16')]),_0x3cca('0x56'),{'uri':_0x5a2639});})[_0x3cca('0x2a')](function(_0x2a40c3){logger[_0x3cca('0x29')](_0x3cca('0x59'),JSON['stringify'](_0x2a40c3));});};exports['unmanaged']=function(_0x546541,_0x1dbc40,_0x1ab8ff,_0x591ebe,_0x2a61c3,_0x434119){var _0x3a9aa3,_0x281d87,_0xc82932,_0x2d7c52;_0x434119[_0x3cca('0x20')]=intUtil[_0x3cca('0x48')](_0x434119[_0x3cca('0x20')]);_0x434119[_0x3cca('0x4e')]=intUtil[_0x3cca('0x48')](_0x434119[_0x3cca('0x4e')]);if(_0x2a61c3&&_0x2a61c3['monitor_format']){logger[_0x3cca('0x18')]('['+_0x1dbc40['lastevent'][_0x3cca('0x61')]()+']',_0x3cca('0x4b'));_0x1dbc40[_0x3cca('0x4c')]=util[_0x3cca('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x434119[_0x3cca('0x4e')],_0x1dbc40[_0x3cca('0x4f')],md5(_0x1dbc40[_0x3cca('0x4f')]));}else{_0x1dbc40[_0x3cca('0x4c')]='';}return getConnection(_0x434119)[_0x3cca('0x24')](function(_0x1c36b0){_0x2d7c52=_0x1c36b0;return getUser(_0x434119,'',_0x2d7c52);})[_0x3cca('0x24')](function(_0x405614){_0x3a9aa3=_0x405614;logger['info'](_0x3cca('0x50'),_0x3a9aa3['id']);return getEndUser(_0x434119,_0x1dbc40[_0x3cca('0x51')],_0x1dbc40[_0x3cca('0x52')],_0x2d7c52);})['then'](function(_0x301a09){_0x281d87=_0x301a09;logger[_0x3cca('0x18')](_0x3cca('0x53'),_0x281d87['id']);return createTicket(_0x434119,_0x3a9aa3,_0x281d87,_0x1ab8ff,_0x1dbc40,_0x1ab8ff['Fields'],_0x2d7c52);})[_0x3cca('0x24')](function(_0x4d6299){_0xc82932=_0x4d6299;logger[_0x3cca('0x18')](_0x3cca('0x5e'));logger[_0x3cca('0x18')]('The\x20Ticket\x20ID\x20is:',_0xc82932['id']);})[_0x3cca('0x2a')](function(_0x3bc534){logger[_0x3cca('0x29')]('['+_0x1dbc40['lastevent'][_0x3cca('0x61')]()+']',JSON['stringify'](_0x3bc534));});};
\ No newline at end of file
index 5ffe096..06feb7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e9f=['Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','results','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','%s/token:%s','token','Basic\x20%s','toString','debug','[HTTP]','GET','map','forEach','type','string','nameField','customField','content','push','idField','variableName','custom_fields','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','none','[OUTBOUND]','destcalleridname','Displaying\x20ticket\x20to\x20agent...','newTab','lastevent','calleridnum','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','ioredis','../../../../config/logger','defaults','redis','socket.io-emitter','application/json','info','format','%s/tickets.json','remoteUri','POST'];(function(_0x16a72a,_0x1f5057){var _0x532d66=function(_0x47a319){while(--_0x47a319){_0x16a72a['push'](_0x16a72a['shift']());}};_0x532d66(++_0x1f5057);}(_0x0e9f,0x116));var _0xf0e9=function(_0x3c4559,_0x5a531b){_0x3c4559=_0x3c4559-0x0;var _0xd96d5b=_0x0e9f[_0x3c4559];return _0xd96d5b;};'use strict';var _=require(_0xf0e9('0x0'));var rp=require(_0xf0e9('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xf0e9('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xf0e9('0x3'))('zendesk');config['redis']=_[_0xf0e9('0x4')](config[_0xf0e9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf0e9('0x6'))(new Redis(config['redis']));function emit(_0x3f9792,_0x2fa08f,_0x106ba0){io['to'](_0x3f9792)['emit'](_0x2fa08f,_0x106ba0);}var headers={'Content-Type':'application/json','Accept':_0xf0e9('0x7')};function getTicket(_0x7b3146,_0x55278c,_0x5071a4,_0x3cbdd8,_0x3c498e){logger[_0xf0e9('0x8')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xf0e9('0x9')](_0xf0e9('0xa'),_0x7b3146[_0xf0e9('0xb')]),'method':_0xf0e9('0xc'),'body':{'ticket':_['merge']({'requester_id':_0x5071a4['id'],'submitter_id':_0x55278c?_0x55278c['id']:undefined,'assignee_id':_0x55278c?_0x55278c['id']:undefined,'tags':getTags(_0x3cbdd8[_0xf0e9('0xd')],'name'),'subject':intUtil[_0xf0e9('0xe')](_0x3cbdd8[_0xf0e9('0xf')],_0x3c498e,'\x20'),'description':intUtil['getString'](_0x3cbdd8[_0xf0e9('0x10')],_0x3c498e,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf0e9('0xe')](_0x3cbdd8[_0xf0e9('0x10')],_0x3c498e,'\x0a')}},getCustomFields(_0x3cbdd8[_0xf0e9('0x11')],_0x3c498e))}})[_0xf0e9('0x12')](function(_0x273510){logger['info'](_0xf0e9('0x13'));return _0x273510[_0xf0e9('0x14')];});}function getUser(_0x4f37b5,_0x320a29){if(intUtil[_0xf0e9('0x15')](_0x320a29)){logger[_0xf0e9('0x8')](_0xf0e9('0x16'),_0x320a29);return request({'uri':util['format'](_0xf0e9('0x17'),_0x4f37b5[_0xf0e9('0xb')]),'qs':{'query':util[_0xf0e9('0x9')](_0xf0e9('0x18'),_0x320a29)}})['then'](function(_0x50df7a){if(_0x50df7a[_0xf0e9('0x19')]){logger[_0xf0e9('0x8')](_0xf0e9('0x1a'));return _['find'](_0x50df7a['results'],{'email':_0x320a29,'role':_0xf0e9('0x1b')});}else{logger[_0xf0e9('0x8')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf0e9('0x9')]('%s/users/me.json',_0x4f37b5[_0xf0e9('0xb')])})[_0xf0e9('0x12')](function(_0x4afcff){logger['info'](_0xf0e9('0x1c'));return _0x4afcff[_0xf0e9('0x1d')];});}});}else{logger['info'](_0xf0e9('0x1e'));return request({'uri':util[_0xf0e9('0x9')]('%s/users/me.json',_0x4f37b5[_0xf0e9('0xb')])})[_0xf0e9('0x12')](function(_0x4c0d73){logger[_0xf0e9('0x8')](_0xf0e9('0x1c'));return _0x4c0d73[_0xf0e9('0x1d')];});}}function getEndUser(_0x3a74fe,_0x33048a,_0x25eacb){logger[_0xf0e9('0x8')]('Searching\x20enduser\x20with\x20phone',_0x25eacb);return request({'uri':util['format'](_0xf0e9('0x17'),_0x3a74fe['remoteUri']),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x25eacb)}})[_0xf0e9('0x12')](function(_0x8fd443){var _0x5620a5;if(_0x8fd443[_0xf0e9('0x1f')][_0xf0e9('0x20')]){_0x8fd443[_0xf0e9('0x1f')]=_['filter'](_0x8fd443[_0xf0e9('0x1f')],{'suspended':![],'role':_0xf0e9('0x21')});if(_0x8fd443[_0xf0e9('0x1f')][_0xf0e9('0x20')]){_0x5620a5=_[_0xf0e9('0x22')](_0x8fd443[_0xf0e9('0x1f')]);}}if(_0x5620a5){logger[_0xf0e9('0x8')](_0xf0e9('0x23'));return _0x5620a5;}else{logger['info'](_0xf0e9('0x24'));return request({'uri':util[_0xf0e9('0x9')]('%s/users.json',_0x3a74fe['remoteUri']),'method':_0xf0e9('0xc'),'body':{'user':{'role':_0xf0e9('0x21'),'name':util['format'](_0xf0e9('0x25'),_0x33048a||_0x25eacb),'phone':_0x25eacb}}})[_0xf0e9('0x12')](function(_0x92e4b2){logger[_0xf0e9('0x8')](_0xf0e9('0x26'));return _0x92e4b2[_0xf0e9('0x1d')];});}});}function getAuth(_0x2009ba){var _0x11812e;if(_0x2009ba['authType']===_0xf0e9('0x27')){_0x11812e=util[_0xf0e9('0x9')]('%s:%s',_0x2009ba[_0xf0e9('0x28')],_0x2009ba['password']);}else if(_0x2009ba[_0xf0e9('0x29')]==='token'){_0x11812e=util['format'](_0xf0e9('0x2a'),_0x2009ba[_0xf0e9('0x28')],_0x2009ba[_0xf0e9('0x2b')]);}return util[_0xf0e9('0x9')](_0xf0e9('0x2c'),new Buffer(_0x11812e)[_0xf0e9('0x2d')]('base64'));}function request(_0x233132){logger[_0xf0e9('0x2e')](_0xf0e9('0x2f'),JSON['stringify'](_0x233132));return rp(_[_0xf0e9('0x4')](_0x233132,{'method':_0xf0e9('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x16023a,_0xfb8a73){var _0x3b7ef4=[];if(_0x16023a&&_0x16023a[_0xf0e9('0x20')]>0x0){_0x3b7ef4=_[_0xf0e9('0x31')](_0x16023a,_0xfb8a73);}return _0x3b7ef4;}function getCustomFields(_0x2dd0d7,_0x4012f8){var _0x346250=[];var _0x48040c={'custom_fields':[]};if(_0x2dd0d7[_0xf0e9('0x20')]>0x0){_[_0xf0e9('0x32')](_0x2dd0d7,function(_0x49a95c){if(_0x49a95c[_0xf0e9('0x33')]===_0xf0e9('0x34')&&_0x49a95c[_0xf0e9('0x35')]&&!_0x49a95c[_0xf0e9('0x36')]){_0x48040c[_0x49a95c[_0xf0e9('0x35')]['toLowerCase']()]=_0x49a95c[_0xf0e9('0x37')][_0xf0e9('0x2d')]();}else if(_0x49a95c['type']===_0xf0e9('0x34')&&_0x49a95c['idField']&&_0x49a95c[_0xf0e9('0x36')]){_0x48040c['custom_fields'][_0xf0e9('0x38')]({'id':_0x49a95c[_0xf0e9('0x39')],'value':_0x49a95c['content'][_0xf0e9('0x2d')]()});}else if(_0x49a95c['type']==='variable'&&_0x49a95c['variableName']&&_0x49a95c[_0xf0e9('0x39')]&&_0x49a95c[_0xf0e9('0x36')]){_0x4012f8[_0x49a95c[_0xf0e9('0x3a')]]&&_0x48040c[_0xf0e9('0x3b')]['push']({'id':_0x49a95c[_0xf0e9('0x39')],'value':_0x4012f8[_0x49a95c[_0xf0e9('0x3a')]]['toString']()});}else if(_0x49a95c['type']===_0xf0e9('0x3c')&&_0x49a95c[_0xf0e9('0x3d')]&&_0x49a95c[_0xf0e9('0x3d')][_0xf0e9('0x3e')]&&_0x49a95c[_0xf0e9('0x39')]&&_0x49a95c['customField']){_0x4012f8[_0x49a95c[_0xf0e9('0x3d')][_0xf0e9('0x3e')][_0xf0e9('0x3f')]()]&&_0x48040c[_0xf0e9('0x3b')][_0xf0e9('0x38')]({'id':_0x49a95c[_0xf0e9('0x39')],'value':_0x4012f8[_0x49a95c[_0xf0e9('0x3d')]['name'][_0xf0e9('0x3f')]()][_0xf0e9('0x2d')]()});}});}return _0x48040c;}exports[_0xf0e9('0x40')]=function(_0x16ddd8,_0x5c11c5,_0x20f502,_0x372f4b,_0x1ef9e9,_0x4e9261){var _0x27d3ae,_0x33f702;_0x4e9261[_0xf0e9('0xb')]=intUtil[_0xf0e9('0x41')](_0x4e9261[_0xf0e9('0xb')]);_0x4e9261[_0xf0e9('0x42')]=intUtil[_0xf0e9('0x41')](_0x4e9261[_0xf0e9('0x42')]);if(_0x1ef9e9&&_0x1ef9e9[_0xf0e9('0x43')]){logger[_0xf0e9('0x8')](_0xf0e9('0x44'),_0xf0e9('0x45'));_0x5c11c5[_0xf0e9('0x46')]=util[_0xf0e9('0x9')](_0xf0e9('0x47'),_0x4e9261[_0xf0e9('0x42')],_0x5c11c5[_0xf0e9('0x48')],md5(_0x5c11c5[_0xf0e9('0x48')]));}else{_0x5c11c5[_0xf0e9('0x46')]='';}headers[_0xf0e9('0x49')]=getAuth(_0x4e9261);return getUser(_0x4e9261,_0x372f4b[_0xf0e9('0x4a')])[_0xf0e9('0x12')](function(_0x4769e1){_0x27d3ae=_0x4769e1;logger[_0xf0e9('0x8')](_0xf0e9('0x4b'),_0x27d3ae['id']);return getEndUser(_0x4e9261,_0x5c11c5[_0xf0e9('0x4c')],_0x5c11c5['calleridnum']);})[_0xf0e9('0x12')](function(_0x2ea9e0){_0x33f702=_0x2ea9e0;logger['info'](_0xf0e9('0x4d'),_0x33f702['id']);return getTicket(_0x4e9261,_0x27d3ae,_0x33f702,_0x20f502,_0x5c11c5);})[_0xf0e9('0x12')](function(_0x26789c){if(_0x26789c){logger[_0xf0e9('0x8')](_0xf0e9('0x4e'),_0x26789c['id']);switch(_0x4e9261['type']){case _0xf0e9('0x4f'):logger['info'](_0xf0e9('0x44'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf0e9('0x9')](_0xf0e9('0x50'),_0x4e9261[_0xf0e9('0xb')],_0x27d3ae['id'],_0x26789c['id']),'method':_0xf0e9('0xc')});case'newTab':logger['info'](_0xf0e9('0x44'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf0e9('0x9')](_0xf0e9('0x51'),_0x372f4b['name']),_0xf0e9('0x52'),{'uri':util['format'](_0xf0e9('0x53'),_0x4e9261['remoteUri'],_0x26789c['id'])});break;default:logger[_0xf0e9('0x54')]('[QUEUE]',_0xf0e9('0x55'));}}})[_0xf0e9('0x56')](function(_0x367624){logger[_0xf0e9('0x54')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf0e9('0x57')](_0x367624,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0xabea45,_0x4f176b,_0x341c85,_0xdf199b,_0x43fdc5,_0x21cddd,_0x5335f6){var _0x1988b4,_0x503149;_0x21cddd[_0xf0e9('0xb')]=intUtil['stripTrailingSlash'](_0x21cddd[_0xf0e9('0xb')]);_0x21cddd[_0xf0e9('0x42')]=intUtil[_0xf0e9('0x41')](_0x21cddd[_0xf0e9('0x42')]);if(_0x5335f6&&_0x5335f6['recordingFormat']&&_0x5335f6['recordingFormat']!==_0xf0e9('0x58')){logger[_0xf0e9('0x8')](_0xf0e9('0x59'),_0xf0e9('0x45'));_0x4f176b[_0xf0e9('0x46')]=util[_0xf0e9('0x9')](_0xf0e9('0x47'),_0x21cddd[_0xf0e9('0x42')],_0x4f176b[_0xf0e9('0x48')],md5(_0x4f176b[_0xf0e9('0x48')]));}headers[_0xf0e9('0x49')]=getAuth(_0x21cddd);return getUser(_0x21cddd,_0xdf199b[_0xf0e9('0x4a')])[_0xf0e9('0x12')](function(_0x1794b6){_0x1988b4=_0x1794b6;logger['info']('The\x20User\x20ID\x20is:',_0x1988b4['id']);return getEndUser(_0x21cddd,_0x4f176b[_0xf0e9('0x5a')],_0x4f176b['destcalleridnum']);})[_0xf0e9('0x12')](function(_0x42189e){_0x503149=_0x42189e;logger['info'](_0xf0e9('0x4d'),_0x503149['id']);return getTicket(_0x21cddd,_0x1988b4,_0x503149,_0x341c85,_0x4f176b);})[_0xf0e9('0x12')](function(_0x1c92ba){if(_0x1c92ba){logger[_0xf0e9('0x8')](_0xf0e9('0x4e'),_0x1c92ba['id']);switch(_0x21cddd[_0xf0e9('0x33')]){case _0xf0e9('0x4f'):logger[_0xf0e9('0x8')](_0xf0e9('0x59'),_0xf0e9('0x5b'));return request({'uri':util['format'](_0xf0e9('0x50'),_0x21cddd['remoteUri'],_0x1988b4['id'],_0x1c92ba['id']),'method':'POST'});case _0xf0e9('0x5c'):logger[_0xf0e9('0x8')](_0xf0e9('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf0e9('0x9')](_0xf0e9('0x51'),_0xdf199b['name']),'trigger:browser:url',{'uri':util[_0xf0e9('0x9')](_0xf0e9('0x53'),_0x21cddd[_0xf0e9('0xb')],_0x1c92ba['id'])});break;default:logger[_0xf0e9('0x54')](_0xf0e9('0x59'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xf0e9('0x56')](function(_0xcfb77b){logger[_0xf0e9('0x54')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf0e9('0x57')](_0xcfb77b,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x8e52ea,_0x19061d,_0x53fbc7,_0x418a20,_0x20a111,_0x42dc3c){var _0xcd3178,_0x21fac1;_0x42dc3c[_0xf0e9('0xb')]=intUtil[_0xf0e9('0x41')](_0x42dc3c[_0xf0e9('0xb')]);_0x42dc3c[_0xf0e9('0x42')]=intUtil[_0xf0e9('0x41')](_0x42dc3c[_0xf0e9('0x42')]);if(_0x20a111&&_0x20a111[_0xf0e9('0x43')]){logger['info']('['+_0x19061d[_0xf0e9('0x5d')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x19061d['recordingURL']=util[_0xf0e9('0x9')](_0xf0e9('0x47'),_0x42dc3c[_0xf0e9('0x42')],_0x19061d['uniqueid'],md5(_0x19061d[_0xf0e9('0x48')]));}else{_0x19061d['recordingURL']='';}headers[_0xf0e9('0x49')]=getAuth(_0x42dc3c);return getUser(_0x42dc3c)[_0xf0e9('0x12')](function(_0x35bd7f){_0xcd3178=_0x35bd7f;logger['info'](_0xf0e9('0x4b'),_0xcd3178['id']);return getEndUser(_0x42dc3c,_0x19061d[_0xf0e9('0x4c')],_0x19061d[_0xf0e9('0x5e')]);})[_0xf0e9('0x12')](function(_0x317c75){_0x21fac1=_0x317c75;logger[_0xf0e9('0x8')](_0xf0e9('0x4d'),_0x21fac1['id']);return getTicket(_0x42dc3c,_0xcd3178,_0x21fac1,_0x53fbc7,_0x19061d);})[_0xf0e9('0x12')](function(_0x4be17d){if(_0x4be17d){logger[_0xf0e9('0x8')]('The\x20Ticket\x20ID\x20is:',_0x4be17d['id']);}})[_0xf0e9('0x56')](function(_0x968c43){logger['error']('['+_0x19061d['lastevent'][_0xf0e9('0x5f')]()+']'+_0xf0e9('0x60'),util['inspect'](_0x968c43,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xd52a=['redis','defaults','emit','application/json','info','Creating\x20new\x20ticket...','format','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','filter','end-user','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','GET','map','forEach','string','customField','nameField','toLowerCase','content','idField','push','type','variableName','customVariable','Variable','custom_fields','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','POST','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','toUpperCase','recordingURL','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/logger','zendesk'];(function(_0x4d8744,_0x203345){var _0x17fb37=function(_0x216209){while(--_0x216209){_0x4d8744['push'](_0x4d8744['shift']());}};_0x17fb37(++_0x203345);}(_0xd52a,0xca));var _0xad52=function(_0x70fe4d,_0x6b8f){_0x70fe4d=_0x70fe4d-0x0;var _0x108927=_0xd52a[_0x70fe4d];return _0x108927;};'use strict';var _=require('lodash');var rp=require(_0xad52('0x0'));var md5=require('md5');var util=require(_0xad52('0x1'));var Redis=require(_0xad52('0x2'));var intUtil=require(_0xad52('0x3'));var config=require('../../../../config/environment');var logger=require(_0xad52('0x4'))(_0xad52('0x5'));config[_0xad52('0x6')]=_[_0xad52('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad52('0x6')]));function emit(_0x55f7a7,_0x23fc23,_0x4bbff0){io['to'](_0x55f7a7)[_0xad52('0x8')](_0x23fc23,_0x4bbff0);}var headers={'Content-Type':_0xad52('0x9'),'Accept':'application/json'};function getTicket(_0x39c078,_0x47db32,_0x46fbc5,_0x5ab3d2,_0x125d8a){logger[_0xad52('0xa')](_0xad52('0xb'));return request({'uri':util[_0xad52('0xc')]('%s/tickets.json',_0x39c078['remoteUri']),'method':'POST','body':{'ticket':_[_0xad52('0xd')]({'requester_id':_0x46fbc5['id'],'submitter_id':_0x47db32?_0x47db32['id']:undefined,'assignee_id':_0x47db32?_0x47db32['id']:undefined,'tags':getTags(_0x5ab3d2[_0xad52('0xe')],_0xad52('0xf')),'subject':intUtil[_0xad52('0x10')](_0x5ab3d2[_0xad52('0x11')],_0x125d8a,'\x20'),'description':intUtil[_0xad52('0x10')](_0x5ab3d2[_0xad52('0x12')],_0x125d8a,'\x0a'),'comment':{'public':![],'body':intUtil[_0xad52('0x10')](_0x5ab3d2[_0xad52('0x12')],_0x125d8a,'\x0a')}},getCustomFields(_0x5ab3d2['Fields'],_0x125d8a))}})[_0xad52('0x13')](function(_0x139305){logger[_0xad52('0xa')](_0xad52('0x14'));return _0x139305[_0xad52('0x15')];});}function getUser(_0xcb6cd5,_0x2bbaad){if(intUtil[_0xad52('0x16')](_0x2bbaad)){logger[_0xad52('0xa')]('Getting\x20agent\x20with\x20email',_0x2bbaad);return request({'uri':util['format'](_0xad52('0x17'),_0xcb6cd5[_0xad52('0x18')]),'qs':{'query':util[_0xad52('0xc')](_0xad52('0x19'),_0x2bbaad)}})[_0xad52('0x13')](function(_0x59a5e4){if(_0x59a5e4[_0xad52('0x1a')]){logger['info'](_0xad52('0x1b'));return _[_0xad52('0x1c')](_0x59a5e4[_0xad52('0x1d')],{'email':_0x2bbaad,'role':'agent'});}else{logger[_0xad52('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xad52('0xc')](_0xad52('0x1e'),_0xcb6cd5[_0xad52('0x18')])})[_0xad52('0x13')](function(_0x2c182f){logger[_0xad52('0xa')]('Admin\x20account\x20selected.');return _0x2c182f[_0xad52('0x1f')];});}});}else{logger['info'](_0xad52('0x20'));return request({'uri':util[_0xad52('0xc')](_0xad52('0x1e'),_0xcb6cd5[_0xad52('0x18')])})[_0xad52('0x13')](function(_0x579b9d){logger['info'](_0xad52('0x21'));return _0x579b9d['user'];});}}function getEndUser(_0x477b47,_0x3a54a1,_0x537df0){logger['info'](_0xad52('0x22'),_0x537df0);return request({'uri':util[_0xad52('0xc')](_0xad52('0x17'),_0x477b47['remoteUri']),'qs':{'query':util[_0xad52('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x537df0)}})[_0xad52('0x13')](function(_0x3b5613){var _0x25fd54;if(_0x3b5613[_0xad52('0x1d')]['length']){_0x3b5613[_0xad52('0x1d')]=_[_0xad52('0x23')](_0x3b5613['results'],{'suspended':![],'role':_0xad52('0x24')});if(_0x3b5613[_0xad52('0x1d')][_0xad52('0x25')]){_0x25fd54=_[_0xad52('0x26')](_0x3b5613[_0xad52('0x1d')]);}}if(_0x25fd54){logger['info']('Enduser\x20found!');return _0x25fd54;}else{logger['info'](_0xad52('0x27'));return request({'uri':util[_0xad52('0xc')](_0xad52('0x28'),_0x477b47['remoteUri']),'method':'POST','body':{'user':{'role':_0xad52('0x24'),'name':util[_0xad52('0xc')](_0xad52('0x29'),_0x3a54a1||_0x537df0),'phone':_0x537df0}}})[_0xad52('0x13')](function(_0x919c28){logger[_0xad52('0xa')]('Enduser\x20created.');return _0x919c28[_0xad52('0x1f')];});}});}function getAuth(_0x1bb823){var _0x44f745;if(_0x1bb823[_0xad52('0x2a')]===_0xad52('0x2b')){_0x44f745=util[_0xad52('0xc')](_0xad52('0x2c'),_0x1bb823[_0xad52('0x2d')],_0x1bb823[_0xad52('0x2b')]);}else if(_0x1bb823[_0xad52('0x2a')]===_0xad52('0x2e')){_0x44f745=util['format'](_0xad52('0x2f'),_0x1bb823[_0xad52('0x2d')],_0x1bb823[_0xad52('0x2e')]);}return util[_0xad52('0xc')](_0xad52('0x30'),new Buffer(_0x44f745)[_0xad52('0x31')]('base64'));}function request(_0x244140){logger[_0xad52('0x32')](_0xad52('0x33'),JSON['stringify'](_0x244140));return rp(_[_0xad52('0x7')](_0x244140,{'method':_0xad52('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x268353,_0x4ad21c){var _0x3e2687=[];if(_0x268353&&_0x268353[_0xad52('0x25')]>0x0){_0x3e2687=_[_0xad52('0x35')](_0x268353,_0x4ad21c);}return _0x3e2687;}function getCustomFields(_0x49260f,_0x964452){var _0x437366=[];var _0xe562e4={'custom_fields':[]};if(_0x49260f[_0xad52('0x25')]>0x0){_[_0xad52('0x36')](_0x49260f,function(_0x2dc1f2){if(_0x2dc1f2['type']===_0xad52('0x37')&&_0x2dc1f2['nameField']&&!_0x2dc1f2[_0xad52('0x38')]){_0xe562e4[_0x2dc1f2[_0xad52('0x39')][_0xad52('0x3a')]()]=_0x2dc1f2[_0xad52('0x3b')][_0xad52('0x31')]();}else if(_0x2dc1f2['type']===_0xad52('0x37')&&_0x2dc1f2[_0xad52('0x3c')]&&_0x2dc1f2[_0xad52('0x38')]){_0xe562e4['custom_fields'][_0xad52('0x3d')]({'id':_0x2dc1f2[_0xad52('0x3c')],'value':_0x2dc1f2[_0xad52('0x3b')]['toString']()});}else if(_0x2dc1f2[_0xad52('0x3e')]==='variable'&&_0x2dc1f2[_0xad52('0x3f')]&&_0x2dc1f2[_0xad52('0x3c')]&&_0x2dc1f2[_0xad52('0x38')]){_0x964452[_0x2dc1f2[_0xad52('0x3f')]]&&_0xe562e4['custom_fields'][_0xad52('0x3d')]({'id':_0x2dc1f2[_0xad52('0x3c')],'value':_0x964452[_0x2dc1f2[_0xad52('0x3f')]][_0xad52('0x31')]()});}else if(_0x2dc1f2[_0xad52('0x3e')]===_0xad52('0x40')&&_0x2dc1f2[_0xad52('0x41')]&&_0x2dc1f2[_0xad52('0x41')]['name']&&_0x2dc1f2[_0xad52('0x3c')]&&_0x2dc1f2['customField']){_0x964452[_0x2dc1f2[_0xad52('0x41')][_0xad52('0xf')][_0xad52('0x3a')]()]&&_0xe562e4[_0xad52('0x42')][_0xad52('0x3d')]({'id':_0x2dc1f2[_0xad52('0x3c')],'value':_0x964452[_0x2dc1f2[_0xad52('0x41')][_0xad52('0xf')][_0xad52('0x3a')]()][_0xad52('0x31')]()});}});}return _0xe562e4;}exports[_0xad52('0x43')]=function(_0xa68d10,_0x4411eb,_0x791225,_0xd00d28,_0x472191,_0x2911de){var _0x5eb35e,_0x711cc6;_0x2911de[_0xad52('0x18')]=intUtil['stripTrailingSlash'](_0x2911de[_0xad52('0x18')]);_0x2911de[_0xad52('0x44')]=intUtil[_0xad52('0x45')](_0x2911de['serverUrl']);if(_0x472191&&_0x472191[_0xad52('0x46')]){logger['info'](_0xad52('0x47'),'Recording\x20is\x20enabled!');_0x4411eb['recordingURL']=util[_0xad52('0xc')](_0xad52('0x48'),_0x2911de[_0xad52('0x44')],_0x4411eb[_0xad52('0x49')],md5(_0x4411eb['uniqueid']));}else{_0x4411eb['recordingURL']='';}headers[_0xad52('0x4a')]=getAuth(_0x2911de);return getUser(_0x2911de,_0xd00d28['email'])[_0xad52('0x13')](function(_0x581f41){_0x5eb35e=_0x581f41;logger[_0xad52('0xa')](_0xad52('0x4b'),_0x5eb35e['id']);return getEndUser(_0x2911de,_0x4411eb[_0xad52('0x4c')],_0x4411eb[_0xad52('0x4d')]);})[_0xad52('0x13')](function(_0x382b60){_0x711cc6=_0x382b60;logger['info'](_0xad52('0x4e'),_0x711cc6['id']);return getTicket(_0x2911de,_0x5eb35e,_0x711cc6,_0x791225,_0x4411eb);})[_0xad52('0x13')](function(_0x44c401){if(_0x44c401){logger[_0xad52('0xa')]('The\x20Ticket\x20ID\x20is:',_0x44c401['id']);switch(_0x2911de[_0xad52('0x3e')]){case _0xad52('0x4f'):logger[_0xad52('0xa')]('[QUEUE]',_0xad52('0x50'));return request({'uri':util[_0xad52('0xc')](_0xad52('0x51'),_0x2911de[_0xad52('0x18')],_0x5eb35e['id'],_0x44c401['id']),'method':'POST'});case _0xad52('0x52'):logger[_0xad52('0xa')](_0xad52('0x47'),_0xad52('0x53'));emit(util[_0xad52('0xc')]('user:%s',_0xd00d28['name']),_0xad52('0x54'),{'uri':util[_0xad52('0xc')](_0xad52('0x55'),_0x2911de[_0xad52('0x18')],_0x44c401['id'])});break;default:logger[_0xad52('0x56')]('[QUEUE]',_0xad52('0x57'));}}})['catch'](function(_0x5fe34c){logger[_0xad52('0x56')](_0xad52('0x58'),util['inspect'](_0x5fe34c,{'showHidden':!![],'depth':null}));});};exports[_0xad52('0x59')]=function(_0x525485,_0x3784b5,_0x4218c6,_0xc95e44,_0x506889,_0x490866,_0xf0fc0d){var _0x4a5def,_0x14154e;_0x490866[_0xad52('0x18')]=intUtil['stripTrailingSlash'](_0x490866[_0xad52('0x18')]);_0x490866['serverUrl']=intUtil[_0xad52('0x45')](_0x490866[_0xad52('0x44')]);if(_0xf0fc0d&&_0xf0fc0d[_0xad52('0x5a')]&&_0xf0fc0d[_0xad52('0x5a')]!=='none'){logger['info'](_0xad52('0x5b'),_0xad52('0x5c'));_0x3784b5['recordingURL']=util[_0xad52('0xc')](_0xad52('0x48'),_0x490866[_0xad52('0x44')],_0x3784b5[_0xad52('0x49')],md5(_0x3784b5['uniqueid']));}headers[_0xad52('0x4a')]=getAuth(_0x490866);return getUser(_0x490866,_0xc95e44[_0xad52('0x5d')])[_0xad52('0x13')](function(_0x4082d7){_0x4a5def=_0x4082d7;logger[_0xad52('0xa')](_0xad52('0x4b'),_0x4a5def['id']);return getEndUser(_0x490866,_0x3784b5[_0xad52('0x5e')],_0x3784b5[_0xad52('0x5f')]);})['then'](function(_0x561d41){_0x14154e=_0x561d41;logger[_0xad52('0xa')](_0xad52('0x4e'),_0x14154e['id']);return getTicket(_0x490866,_0x4a5def,_0x14154e,_0x4218c6,_0x3784b5);})[_0xad52('0x13')](function(_0x4a6ccd){if(_0x4a6ccd){logger[_0xad52('0xa')](_0xad52('0x60'),_0x4a6ccd['id']);switch(_0x490866[_0xad52('0x3e')]){case'integrationTab':logger[_0xad52('0xa')]('[OUTBOUND]',_0xad52('0x50'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x490866[_0xad52('0x18')],_0x4a5def['id'],_0x4a6ccd['id']),'method':_0xad52('0x61')});case'newTab':logger['info']('[OUTBOUND]',_0xad52('0x53'));emit(util[_0xad52('0xc')]('user:%s',_0xc95e44[_0xad52('0xf')]),_0xad52('0x54'),{'uri':util[_0xad52('0xc')]('%s/agent/tickets/%s',_0x490866[_0xad52('0x18')],_0x4a6ccd['id'])});break;default:logger[_0xad52('0x56')](_0xad52('0x5b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x45a065){logger[_0xad52('0x56')](_0xad52('0x62'),util[_0xad52('0x63')](_0x45a065,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x4d6b7a,_0x5d0daf,_0x19a102,_0x5d4abc,_0x122753,_0x3043f7){var _0x9204ff,_0x255008;_0x3043f7[_0xad52('0x18')]=intUtil[_0xad52('0x45')](_0x3043f7[_0xad52('0x18')]);_0x3043f7[_0xad52('0x44')]=intUtil[_0xad52('0x45')](_0x3043f7[_0xad52('0x44')]);if(_0x122753&&_0x122753[_0xad52('0x46')]){logger['info']('['+_0x5d0daf['lastevent'][_0xad52('0x64')]()+']','Recording\x20is\x20enabled!');_0x5d0daf[_0xad52('0x65')]=util[_0xad52('0xc')](_0xad52('0x48'),_0x3043f7['serverUrl'],_0x5d0daf[_0xad52('0x49')],md5(_0x5d0daf['uniqueid']));}else{_0x5d0daf['recordingURL']='';}headers[_0xad52('0x4a')]=getAuth(_0x3043f7);return getUser(_0x3043f7)[_0xad52('0x13')](function(_0x221cae){_0x9204ff=_0x221cae;logger[_0xad52('0xa')](_0xad52('0x4b'),_0x9204ff['id']);return getEndUser(_0x3043f7,_0x5d0daf['calleridname'],_0x5d0daf[_0xad52('0x4d')]);})['then'](function(_0x2d160e){_0x255008=_0x2d160e;logger[_0xad52('0xa')]('The\x20Enduser\x20ID\x20is:',_0x255008['id']);return getTicket(_0x3043f7,_0x9204ff,_0x255008,_0x19a102,_0x5d0daf);})[_0xad52('0x13')](function(_0x42a679){if(_0x42a679){logger[_0xad52('0xa')](_0xad52('0x60'),_0x42a679['id']);}})['catch'](function(_0xeface6){logger[_0xad52('0x56')]('['+_0x5d0daf[_0xad52('0x66')][_0xad52('0x64')]()+']'+_0xad52('0x67'),util[_0xad52('0x63')](_0xeface6,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 9baec82..6bcdc16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd4d=['Leads','nothing','contact','lead','Owner','administrator','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','utc','mm:ss','answertime','Call_Duration','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','code','Call\x20created!','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','calleridnum','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Agent\x20found!','findIndex','Administrator','profile','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0xcd4d,0xe4));var _0xdcd4=function(_0x2b86d1,_0x581096){_0x2b86d1=_0x2b86d1-0x0;var _0x1bd3f4=_0xcd4d[_0x2b86d1];return _0x1bd3f4;};'use strict';var _=require(_0xdcd4('0x0'));var rp=require(_0xdcd4('0x1'));var md5=require('md5');var util=require(_0xdcd4('0x2'));var intUtil=require(_0xdcd4('0x3'));var moment=require(_0xdcd4('0x4'));var Redis=require(_0xdcd4('0x5'));var BPromise=require(_0xdcd4('0x6'));var config=require(_0xdcd4('0x7'));var logger=require(_0xdcd4('0x8'))(_0xdcd4('0x9'));config[_0xdcd4('0xa')]=_[_0xdcd4('0xb')](config[_0xdcd4('0xa')],{'host':_0xdcd4('0xc'),'port':0x18eb});var io=require(_0xdcd4('0xd'))(new Redis(config[_0xdcd4('0xa')]));function emit(_0x198d6c,_0xc0cf59,_0x482c4f){io['to'](_0x198d6c)[_0xdcd4('0xe')](_0xc0cf59,_0x482c4f);}function request(_0x3cae6d){logger['debug'](_0xdcd4('0xf'),JSON[_0xdcd4('0x10')](_0x3cae6d));return rp(_0x3cae6d);}function getCustomFields(_0x47549c,_0x35e653){var _0x7273b6={};if(_0x47549c['length']>0x0){_[_0xdcd4('0x11')](_0x47549c,function(_0x2e5246){if(_0x2e5246[_0xdcd4('0x12')]===_0xdcd4('0x13')&&_0x2e5246[_0xdcd4('0x14')]){_0x7273b6[_0x2e5246['idField']]=_0x2e5246[_0xdcd4('0x15')][_0xdcd4('0x16')]();}else if(_0x2e5246['type']===_0xdcd4('0x17')&&_0x2e5246[_0xdcd4('0x18')]&&_0x2e5246['idField']&&_0x35e653[_0x2e5246['variableName']]){_0x7273b6[_0x2e5246[_0xdcd4('0x14')]]=_0x35e653[_0x2e5246[_0xdcd4('0x18')]][_0xdcd4('0x16')]();}else if(_0x2e5246[_0xdcd4('0x12')]===_0xdcd4('0x19')&&_0x2e5246[_0xdcd4('0x1a')]&&_0x2e5246[_0xdcd4('0x1a')][_0xdcd4('0x1b')]&&_0x2e5246[_0xdcd4('0x14')]&&_0x35e653[_0x2e5246[_0xdcd4('0x1a')][_0xdcd4('0x1b')]['toLowerCase']()]){_0x7273b6[_0x2e5246['idField']]=_0x35e653[_0x2e5246[_0xdcd4('0x1a')][_0xdcd4('0x1b')][_0xdcd4('0x1c')]()][_0xdcd4('0x16')]();}});}return _0x7273b6;}function getName(_0x1bcf0f){if(_0x1bcf0f[_0xdcd4('0x1d')]('\x20')>0x0){var _0x12919f=_0x1bcf0f[_0xdcd4('0x1e')](/ (.+)/);if(_0x12919f[0x1]){return _0x12919f;}}return[_0x1bcf0f,_0x1bcf0f];}var accountsTokens={};function getAccessToken(_0x9e8fa2){return new Promise(function(_0xa8920c,_0x28bec2){if(!_[_0xdcd4('0x1f')](accountsTokens[_0x9e8fa2['id']])&&!_[_0xdcd4('0x1f')](accountsTokens[_0x9e8fa2['id']][_0xdcd4('0x20')])){if(moment()[_0xdcd4('0x21')](accountsTokens[_0x9e8fa2['id']]['expires_in'])){_0xa8920c(accountsTokens[_0x9e8fa2['id']][_0xdcd4('0x20')]);}}var _0xb4414e;switch(_0x9e8fa2['zone']){case'US':_0xb4414e=_0xdcd4('0x22');break;case'AU':_0xb4414e=_0xdcd4('0x23');break;case'EU':_0xb4414e=_0xdcd4('0x24');break;case'IN':_0xb4414e='https://accounts.zoho.in';break;case'CN':_0xb4414e=_0xdcd4('0x25');break;default:_0xb4414e=_0xdcd4('0x24');break;}var _0x66052d={'method':'POST','uri':_0xb4414e+_0xdcd4('0x26'),'qs':{'refresh_token':_0x9e8fa2[_0xdcd4('0x27')],'client_id':_0x9e8fa2['clientId'],'client_secret':_0x9e8fa2[_0xdcd4('0x28')],'grant_type':_0xdcd4('0x29')},'json':!![]};return rp(_0x66052d)[_0xdcd4('0x2a')](function(_0x8f8ea4){accountsTokens[_0x9e8fa2['id']]={'access_token':_0x8f8ea4[_0xdcd4('0x20')],'expires_in':moment()[_0xdcd4('0x2b')](_0x8f8ea4[_0xdcd4('0x2c')],_0xdcd4('0x2d'))};_0xa8920c(_0x8f8ea4['access_token']);})[_0xdcd4('0x2e')](function(_0x54599c){logger[_0xdcd4('0x2f')](_0xdcd4('0x30'),_0x54599c['stack']);_0x28bec2(_0x54599c);});});}function getUser(_0x583fef,_0x574e84,_0x58cf67,_0x18d0e1){logger[_0xdcd4('0x31')](_0xdcd4('0x32'));return request({'method':'GET','uri':util[_0xdcd4('0x33')](_0xdcd4('0x34'),_0x574e84),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xdcd4('0x35')+_0x583fef},'json':!![]})[_0xdcd4('0x2a')](function(_0x21aaaf){if(_0x21aaaf[_0xdcd4('0x36')]){var _0x1cebfd=-0x1;if(_[_0xdcd4('0x37')](_0x21aaaf['users'])){if(!_[_0xdcd4('0x1f')](_0x18d0e1)){_0x1cebfd=_['findIndex'](_0x21aaaf[_0xdcd4('0x36')],function(_0x2be6d4){return _0x2be6d4[_0xdcd4('0x38')]===_0x18d0e1;});}if(_0x1cebfd>=0x0){logger[_0xdcd4('0x31')](_0xdcd4('0x39'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x1cebfd=_[_0xdcd4('0x3a')](_0x21aaaf[_0xdcd4('0x36')],function(_0x22d43a){return _0x22d43a['profile'][_0xdcd4('0x1b')]===_0xdcd4('0x3b');});}return _0x21aaaf['users'][_0x1cebfd];}else{if(_0x21aaaf['user'][_0xdcd4('0x3c')][_0xdcd4('0x1b')]===_0xdcd4('0x3b')){logger[_0xdcd4('0x31')](_0xdcd4('0x3d'));user=_0x21aaaf[_0xdcd4('0x3e')];return user;}else{logger['error'](_0xdcd4('0x3f'),JSON['stringify'](_0x21aaaf));throw new Error(_0xdcd4('0x40')+JSON[_0xdcd4('0x10')](_0x21aaaf));}}}else{logger[_0xdcd4('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xdcd4('0x10')](_0x21aaaf));throw new Error(_0xdcd4('0x40')+JSON[_0xdcd4('0x10')](_0x21aaaf));}})[_0xdcd4('0x2e')](function(_0x57cf9e){console['error'](_0x57cf9e);});}function getZohoUser(_0x5bc94f,_0x3232e6){return new BPromise(function(_0x5b06c5,_0x454084){request(_0x5bc94f)[_0xdcd4('0x2a')](function(_0x2e4e7e){var _0x2482af=null;if(_0x2e4e7e){_0x2482af=_0x2e4e7e[_0xdcd4('0x41')][0x0];_0x2482af[_0xdcd4('0x42')]=_0x3232e6;}_0x5b06c5(_0x2482af);})[_0xdcd4('0x2e')](function(_0x1ec88b){_0x454084(_0x1ec88b);});});}function createEndUser(_0x4af6c3,_0x14219d,_0x5369ce,_0xf0b2c8,_0x933d07,_0x3bd358){var _0x5369ce=getName(_0x5369ce);return request({'method':_0xdcd4('0x43'),'uri':_0xdcd4('0x44')+_0x14219d+_0xdcd4('0x45')+_[_0xdcd4('0x46')](_0x3bd358[_0xdcd4('0x47')])+'s','body':{'data':[{'Last_Name':_0x5369ce[0x1],'First_Name':_0x5369ce[0x0],'Phone':_0xf0b2c8,'Owner':{'name':!_[_0xdcd4('0x1f')](_0x933d07['role'][_0xdcd4('0x1b')])?_0x933d07[_0xdcd4('0x48')]['name']:!_[_0xdcd4('0x1f')](_0x933d07['first_name'])?_0x933d07[_0xdcd4('0x49')]+'\x20'+_0x933d07[_0xdcd4('0x4a')]:_0x933d07[_0xdcd4('0x4a')],'id':_0x933d07['id']}}]},'headers':{'Authorization':_0xdcd4('0x35')+_0x4af6c3},'json':!![]})['then'](function(_0x282089){if(_0x282089&&_0x282089[_0xdcd4('0x41')][0x0]['code']===_0xdcd4('0x4b')){var _0x196e90=_0x282089[_0xdcd4('0x41')][0x0][_0xdcd4('0x4c')];_0x196e90[_0xdcd4('0x42')]=_[_0xdcd4('0x46')](_0x3bd358[_0xdcd4('0x47')])+'s';return _0x196e90;}logger[_0xdcd4('0x2f')](_0xdcd4('0x3f'),JSON[_0xdcd4('0x10')](data));throw new Error(_0xdcd4('0x4d')+JSON['stringify'](data));})[_0xdcd4('0x2e')](function(_0x2c8283){console[_0xdcd4('0x4e')](_0xdcd4('0x4f'),_0x2c8283);});}function getEndUser(_0x1ff3b8,_0x1410cd,_0xc5717d,_0x4e7b05,_0x56df3d,_0x4556b2,_0x53dd36){var _0x572579={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1ff3b8},'json':!![]};switch(_0x53dd36[_0xdcd4('0x50')]){case _0xdcd4('0x51'):_0x572579['uri']=_0xdcd4('0x44')+_0x1410cd+_0xdcd4('0x52')+_0x56df3d+'))';return getZohoUser(_0x572579,_0xdcd4('0x53'))['then'](function(_0x15f124){if(_0x15f124)return _0x15f124;_0x572579[_0xdcd4('0x54')]=_0xdcd4('0x44')+_0x1410cd+_0xdcd4('0x55')+_0x56df3d+'))';return getZohoUser(_0x572579,_0xdcd4('0x56'))[_0xdcd4('0x2a')](function(_0x330ca2){if(_0x330ca2)return _0x330ca2;if(_0x53dd36[_0xdcd4('0x47')]!=_0xdcd4('0x57')){return createEndUser(_0x1ff3b8,_0x1410cd,_0x4e7b05,_0x56df3d,_0x4556b2,_0x53dd36);}else{return{};}});});break;case _0xdcd4('0x58'):_0x572579['uri']=_0xdcd4('0x44')+_0x1410cd+_0xdcd4('0x52')+_0x56df3d+'))';return getZohoUser(_0x572579,_0xdcd4('0x53'))[_0xdcd4('0x2a')](function(_0x535de8){if(_0x535de8)return _0x535de8;if(_0x53dd36['moduleCreate']!=_0xdcd4('0x57')){return createEndUser(_0x1ff3b8,_0x1410cd,_0x4e7b05,_0x56df3d,_0x4556b2,_0x53dd36);}else{return{};}});break;case _0xdcd4('0x59'):_0x572579['uri']='https://www.zohoapis.'+_0x1410cd+_0xdcd4('0x55')+_0x56df3d+'))';return getZohoUser(_0x572579,_0xdcd4('0x56'))['then'](function(_0x25154b){if(_0x25154b)return _0x25154b;if(_0x53dd36[_0xdcd4('0x47')]!=_0xdcd4('0x57')){return createEndUser(_0x1ff3b8,_0x1410cd,_0x4e7b05,_0x56df3d,_0x4556b2,_0x53dd36);}else{return{};}});break;}}function getCall(_0x36e39f,_0x57fec9,_0x1bc801,_0x175bca,_0x4d256a,_0x27f5f6,_0x2f5f44,_0x4598d4){logger[_0xdcd4('0x31')]('Creating\x20new\x20call...');var _0x4ce6bc={};_0x4ce6bc[_0xdcd4('0x5a')]={'name':!_[_0xdcd4('0x1f')](_0x175bca[_0xdcd4('0x48')][_0xdcd4('0x1b')])&&!_[_0xdcd4('0x1f')](_0x175bca['profile'][_0xdcd4('0x1b')])&&_0x175bca['profile'][_0xdcd4('0x1b')]===_0xdcd4('0x5b')?_0x175bca[_0xdcd4('0x48')][_0xdcd4('0x1b')]:!_[_0xdcd4('0x1f')](_0x175bca['first_name'])?_0x175bca['first_name']+'\x20'+_0x175bca['last_name']:_0x175bca[_0xdcd4('0x4a')],'id':_0x175bca['id']};_0x4ce6bc[_0xdcd4('0x5c')]=intUtil[_0xdcd4('0x5d')](_0x27f5f6[_0xdcd4('0x5e')],_0x2f5f44,'\x20');_0x4ce6bc[_0xdcd4('0x5f')]=intUtil[_0xdcd4('0x5d')](_0x27f5f6['Descriptions'],_0x2f5f44,'\x0a');if(_0x4d256a[_0xdcd4('0x42')]===_0xdcd4('0x53')){_0x4ce6bc[_0xdcd4('0x60')]={'name':!_[_0xdcd4('0x1f')](_0x4d256a[_0xdcd4('0x61')])?_0x4d256a[_0xdcd4('0x61')]:!_[_0xdcd4('0x1f')](_0x4d256a[_0xdcd4('0x62')])?_0x4d256a[_0xdcd4('0x62')]+'\x20'+_0x4d256a[_0xdcd4('0x63')]:_0x4d256a[_0xdcd4('0x63')],'id':_0x4d256a['id']};}if(_0x4d256a[_0xdcd4('0x42')]===_0xdcd4('0x56')){_0x4ce6bc['What_Id']={'name':!_[_0xdcd4('0x1f')](_0x4d256a[_0xdcd4('0x61')])?_0x4d256a['Full_Name']:!_[_0xdcd4('0x1f')](_0x4d256a[_0xdcd4('0x62')])?_0x4d256a['First_Name']+'\x20'+_0x4d256a[_0xdcd4('0x63')]:_0x4d256a[_0xdcd4('0x63')],'id':_0x4d256a['id']};_0x4ce6bc[_0xdcd4('0x64')]=_[_0xdcd4('0x46')](_0x4d256a[_0xdcd4('0x42')]);}if(_0x2f5f44[_0xdcd4('0x65')]){_0x4ce6bc['Call_Duration']=moment[_0xdcd4('0x66')](parseInt(_0x2f5f44['talktime'])*0x3e8)[_0xdcd4('0x33')](_0xdcd4('0x67'));}else if(_0x2f5f44[_0xdcd4('0x68')]&&_0x2f5f44['endtime']){_0x4ce6bc[_0xdcd4('0x69')]=moment['utc'](moment(_0x2f5f44['endtime'],_0xdcd4('0x6a'))['diff'](moment(_0x2f5f44['starttime'],_0xdcd4('0x6a'))))[_0xdcd4('0x33')](_0xdcd4('0x67'));}switch(_0x2f5f44[_0xdcd4('0x6b')]){case _0xdcd4('0x6c'):_0x4ce6bc[_0xdcd4('0x6d')]=_0xdcd4('0x6e');break;case _0xdcd4('0x6f'):case _0xdcd4('0x70'):_0x4ce6bc[_0xdcd4('0x6d')]=_0xdcd4('0x71');break;case'rejected':_0x4ce6bc['Call_Result']=_0xdcd4('0x72');break;case _0xdcd4('0x73'):_0x4ce6bc[_0xdcd4('0x6d')]=_0xdcd4('0x74');break;case _0xdcd4('0x75'):_0x4ce6bc['Call_Result']=_0xdcd4('0x76');default:}_0x4ce6bc[_0xdcd4('0x77')]=(_0x4598d4===_0xdcd4('0x78')?moment(_0x2f5f44['starttime'])[_0xdcd4('0x33')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x2f5f44[_0xdcd4('0x79')])[_0xdcd4('0x33')](_0xdcd4('0x6a')))||moment()[_0xdcd4('0x33')]('YYYY-MM-DDTHH:mm:ss');_0x4ce6bc[_0xdcd4('0x7a')]=_0x4598d4||_0xdcd4('0x7b');_0x4ce6bc=_[_0xdcd4('0x7c')](_0x4ce6bc,getCustomFields(_0x27f5f6['Fields'],_0x2f5f44));return request({'method':'POST','uri':_0xdcd4('0x44')+_0x57fec9+_0xdcd4('0x7d'),'headers':{'Authorization':_0xdcd4('0x35')+_0x36e39f},'body':{'data':[_0x4ce6bc]},'json':!![]})[_0xdcd4('0x2a')](function(_0x4bcf76){if(_0x4bcf76&&_0x4bcf76[_0xdcd4('0x41')][0x0][_0xdcd4('0x7e')]===_0xdcd4('0x4b')){logger[_0xdcd4('0x31')](_0xdcd4('0x7f'));return{'id':_0x4bcf76[_0xdcd4('0x41')][0x0][_0xdcd4('0x4c')]['id']};}})[_0xdcd4('0x2e')](function(_0x1e50fd){logger['info']('err',_0x1e50fd['stack']);console[_0xdcd4('0x4e')]('err',_0x1e50fd);});}exports[_0xdcd4('0x80')]=function(_0x35a71f,_0x14dbf5,_0xec0217,_0x2986d5,_0x4eeca7,_0x3dd7d5){var _0x25a6e4,_0x4deb02,_0x135ff8;_0x3dd7d5['host']=intUtil[_0xdcd4('0x81')](_0x3dd7d5[_0xdcd4('0x82')]);_0x3dd7d5['serverUrl']=intUtil[_0xdcd4('0x81')](_0x3dd7d5[_0xdcd4('0x83')]);if(_0x4eeca7&&_0x4eeca7[_0xdcd4('0x84')]){logger['info']('[QUEUE]',_0xdcd4('0x85'));_0x14dbf5[_0xdcd4('0x86')]=_0x3dd7d5['serverUrl']+_0xdcd4('0x87')+_0x14dbf5['uniqueid']+_0xdcd4('0x88')+md5(_0x14dbf5[_0xdcd4('0x89')]);}else{_0x14dbf5['recordingURL']='';}var _0x4f198d=_0x3dd7d5[_0xdcd4('0x82')]===_0xdcd4('0x8a')?'eu':_0xdcd4('0x8b');return getAccessToken(_0x3dd7d5)[_0xdcd4('0x2a')](function(_0x2427fe){_0x135ff8=_0x2427fe;return getUser(_0x135ff8,_0x4f198d,_0x3dd7d5,_0x2986d5[_0xdcd4('0x38')]);})[_0xdcd4('0x2a')](function(_0x3e81e6){_0x25a6e4=_0x3e81e6;logger['info'](_0xdcd4('0x8c'),_0x25a6e4['id']);return getEndUser(_0x135ff8,_0x4f198d,_0x3dd7d5,_0x14dbf5[_0xdcd4('0x8d')],_0x14dbf5['calleridnum'],_0x25a6e4,_0xec0217);})['then'](function(_0x4cdf93){_0x4deb02=_0x4cdf93;return getCall(_0x135ff8,_0x4f198d,_0x3dd7d5,_0x25a6e4,_0x4deb02,_0xec0217,_0x14dbf5,'Inbound');})[_0xdcd4('0x2a')](function(_0x2b4497){if(_0x2b4497){logger['info']('The\x20Call\x20ID\x20is:',_0x2b4497['id']);logger[_0xdcd4('0x31')](_0xdcd4('0x8e'),_0xdcd4('0x8f'));emit(util[_0xdcd4('0x33')](_0xdcd4('0x90'),_0x2986d5['name']),'trigger:browser:url',{'uri':_0xdcd4('0x91')+_0x3dd7d5[_0xdcd4('0x82')]+_0xdcd4('0x92')+_0x2b4497['id']});}})[_0xdcd4('0x2e')](function(_0x190c86){logger[_0xdcd4('0x2f')](_0xdcd4('0x8e'),JSON[_0xdcd4('0x10')](_0x190c86));});};exports[_0xdcd4('0x78')]=function(_0x1d212b,_0x4b8114,_0x356ea5,_0x479ec9,_0x5461c7,_0x55d517,_0x29de66){var _0x3c202f,_0x12d103,_0x41b50e;_0x55d517['host']=intUtil[_0xdcd4('0x81')](_0x55d517['host']);_0x55d517[_0xdcd4('0x83')]=intUtil[_0xdcd4('0x81')](_0x55d517[_0xdcd4('0x83')]);if(_0x29de66&&_0x29de66[_0xdcd4('0x93')]&&_0x29de66['recordingFormat']!==_0xdcd4('0x94')){logger['info'](_0xdcd4('0x95'),_0xdcd4('0x85'));_0x4b8114[_0xdcd4('0x86')]=_0x55d517['serverUrl']+'/api/voice/recordings/'+_0x4b8114[_0xdcd4('0x89')]+_0xdcd4('0x88')+md5(_0x4b8114[_0xdcd4('0x89')]);}var _0x5e4a98=_0x55d517[_0xdcd4('0x82')]===_0xdcd4('0x8a')?'eu':'com';return getAccessToken(_0x55d517)[_0xdcd4('0x2a')](function(_0x1dc6b9){_0x41b50e=_0x1dc6b9;return getUser(_0x41b50e,_0x5e4a98,_0x55d517,_0x479ec9[_0xdcd4('0x38')]);})[_0xdcd4('0x2a')](function(_0x231163){_0x3c202f=_0x231163;logger[_0xdcd4('0x31')]('The\x20User\x20ID\x20is:',_0x3c202f['id']);return getEndUser(_0x41b50e,_0x5e4a98,_0x55d517,_0x4b8114[_0xdcd4('0x96')],_0x4b8114[_0xdcd4('0x97')],_0x3c202f,_0x356ea5);})[_0xdcd4('0x2a')](function(_0x1b7707){_0x12d103=_0x1b7707;return getCall(_0x41b50e,_0x5e4a98,_0x55d517,_0x3c202f,_0x12d103,_0x356ea5,_0x4b8114,_0xdcd4('0x98'));})['then'](function(_0xa20522){if(_0xa20522){logger['info'](_0xdcd4('0x99'),_0xa20522['id']);logger['info'](_0xdcd4('0x95'),_0xdcd4('0x8f'));emit(util[_0xdcd4('0x33')](_0xdcd4('0x90'),_0x479ec9[_0xdcd4('0x1b')]),'trigger:browser:url',{'uri':_0xdcd4('0x91')+_0x55d517['host']+_0xdcd4('0x92')+_0xa20522['id']});}})[_0xdcd4('0x2e')](function(_0x781881){logger[_0xdcd4('0x2f')](_0xdcd4('0x95'),JSON['stringify'](_0x781881));});};exports[_0xdcd4('0x9a')]=function(_0x176dae,_0xaa7459,_0x4825cf,_0x21c354,_0x35c346,_0x5e8d7f){var _0x57f910,_0x4e667e,_0x11c97b;_0x5e8d7f['host']=intUtil['stripTrailingSlash'](_0x5e8d7f[_0xdcd4('0x82')]);_0x5e8d7f['serverUrl']=intUtil[_0xdcd4('0x81')](_0x5e8d7f['serverUrl']);if(_0x35c346&&_0x35c346['monitor_format']){logger[_0xdcd4('0x31')]('['+_0xaa7459[_0xdcd4('0x6b')][_0xdcd4('0x9b')]()+']','Recording\x20is\x20enabled!');_0xaa7459['recordingURL']=_0x5e8d7f[_0xdcd4('0x83')]+_0xdcd4('0x87')+_0xaa7459[_0xdcd4('0x89')]+_0xdcd4('0x88')+md5(_0xaa7459['uniqueid']);}else{_0xaa7459[_0xdcd4('0x86')]='';}var _0x4ddc72=_0x5e8d7f[_0xdcd4('0x82')]==='zoho.eu'?'eu':_0xdcd4('0x8b');return getAccessToken(_0x5e8d7f)[_0xdcd4('0x2a')](function(_0x3060cf){_0x11c97b=_0x3060cf;return getUser(_0x11c97b,_0x4ddc72,_0x5e8d7f);})[_0xdcd4('0x2a')](function(_0x1691bc){_0x57f910=_0x1691bc;logger['info'](_0xdcd4('0x8c'),_0x57f910['id']);return getEndUser(_0x11c97b,_0x4ddc72,_0x5e8d7f,_0xaa7459['calleridname'],_0xaa7459[_0xdcd4('0x9c')],_0x57f910,_0x4825cf);})['then'](function(_0x2167b2){_0x4e667e=_0x2167b2;return getCall(_0x11c97b,_0x4ddc72,_0x5e8d7f,_0x57f910,_0x4e667e,_0x4825cf,_0xaa7459,_0xdcd4('0x7b'));})['then'](function(_0xbcb5c1){if(_0xbcb5c1){logger[_0xdcd4('0x31')]('The\x20Call\x20ID\x20is:',_0xbcb5c1['id']);}})[_0xdcd4('0x2e')](function(_0x2d0f2a){logger[_0xdcd4('0x2f')]('['+_0xaa7459['lastevent'][_0xdcd4('0x9b')]()+']',JSON['stringify'](_0x2d0f2a));});};
\ No newline at end of file
+var _0xd7cf=['destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','toUpperCase','md5','util','moment','ioredis','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','catch','stack','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','info','profile','user','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','Creating\x20new\x20call...','Owner','administrator','getString','Description','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!'];(function(_0xff659d,_0x2283a1){var _0x19c170=function(_0x15358e){while(--_0x15358e){_0xff659d['push'](_0xff659d['shift']());}};_0x19c170(++_0x2283a1);}(_0xd7cf,0x12b));var _0xfd7c=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0xd7cf[_0x2c2980];return _0x2a20a9;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xfd7c('0x0'));var util=require(_0xfd7c('0x1'));var intUtil=require('./util');var moment=require(_0xfd7c('0x2'));var Redis=require(_0xfd7c('0x3'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0xfd7c('0x4'))(_0xfd7c('0x5'));config[_0xfd7c('0x6')]=_[_0xfd7c('0x7')](config['redis'],{'host':_0xfd7c('0x8'),'port':0x18eb});var io=require(_0xfd7c('0x9'))(new Redis(config[_0xfd7c('0x6')]));function emit(_0x2c7574,_0x4aace1,_0x36f338){io['to'](_0x2c7574)[_0xfd7c('0xa')](_0x4aace1,_0x36f338);}function request(_0xbe723c){logger['debug'](_0xfd7c('0xb'),JSON[_0xfd7c('0xc')](_0xbe723c));return rp(_0xbe723c);}function getCustomFields(_0x1adb82,_0x4d4395){var _0x21db6b={};if(_0x1adb82[_0xfd7c('0xd')]>0x0){_[_0xfd7c('0xe')](_0x1adb82,function(_0x3dc2a4){if(_0x3dc2a4[_0xfd7c('0xf')]==='string'&&_0x3dc2a4[_0xfd7c('0x10')]){_0x21db6b[_0x3dc2a4[_0xfd7c('0x10')]]=_0x3dc2a4[_0xfd7c('0x11')][_0xfd7c('0x12')]();}else if(_0x3dc2a4[_0xfd7c('0xf')]==='variable'&&_0x3dc2a4[_0xfd7c('0x13')]&&_0x3dc2a4[_0xfd7c('0x10')]&&_0x4d4395[_0x3dc2a4[_0xfd7c('0x13')]]){_0x21db6b[_0x3dc2a4[_0xfd7c('0x10')]]=_0x4d4395[_0x3dc2a4['variableName']]['toString']();}else if(_0x3dc2a4['type']===_0xfd7c('0x14')&&_0x3dc2a4[_0xfd7c('0x15')]&&_0x3dc2a4['Variable'][_0xfd7c('0x16')]&&_0x3dc2a4[_0xfd7c('0x10')]&&_0x4d4395[_0x3dc2a4['Variable'][_0xfd7c('0x16')][_0xfd7c('0x17')]()]){_0x21db6b[_0x3dc2a4[_0xfd7c('0x10')]]=_0x4d4395[_0x3dc2a4['Variable'][_0xfd7c('0x16')][_0xfd7c('0x17')]()]['toString']();}});}return _0x21db6b;}function getName(_0x2d96cb){if(_0x2d96cb[_0xfd7c('0x18')]('\x20')>0x0){var _0x1e8d4b=_0x2d96cb['split'](/ (.+)/);if(_0x1e8d4b[0x1]){return _0x1e8d4b;}}return[_0x2d96cb,_0x2d96cb];}var accountsTokens={};function getAccessToken(_0x58a155){return new Promise(function(_0x4d86c4,_0x483cc4){if(!_['isNil'](accountsTokens[_0x58a155['id']])&&!_[_0xfd7c('0x19')](accountsTokens[_0x58a155['id']][_0xfd7c('0x1a')])){if(moment()[_0xfd7c('0x1b')](accountsTokens[_0x58a155['id']]['expires_in'])){_0x4d86c4(accountsTokens[_0x58a155['id']][_0xfd7c('0x1a')]);}}var _0x1e62a2;switch(_0x58a155[_0xfd7c('0x1c')]){case'US':_0x1e62a2=_0xfd7c('0x1d');break;case'AU':_0x1e62a2=_0xfd7c('0x1e');break;case'EU':_0x1e62a2=_0xfd7c('0x1f');break;case'IN':_0x1e62a2='https://accounts.zoho.in';break;case'CN':_0x1e62a2=_0xfd7c('0x20');break;default:_0x1e62a2=_0xfd7c('0x1f');break;}var _0x2d7791={'method':_0xfd7c('0x21'),'uri':_0x1e62a2+_0xfd7c('0x22'),'qs':{'refresh_token':_0x58a155[_0xfd7c('0x23')],'client_id':_0x58a155[_0xfd7c('0x24')],'client_secret':_0x58a155[_0xfd7c('0x25')],'grant_type':_0xfd7c('0x26')},'json':!![]};return rp(_0x2d7791)[_0xfd7c('0x27')](function(_0x3cf58a){accountsTokens[_0x58a155['id']]={'access_token':_0x3cf58a['access_token'],'expires_in':moment()[_0xfd7c('0x28')](_0x3cf58a[_0xfd7c('0x29')],'seconds')};_0x4d86c4(_0x3cf58a[_0xfd7c('0x1a')]);})[_0xfd7c('0x2a')](function(_0x339b24){logger['error']('Failing\x20creating\x20the\x20access_token',_0x339b24[_0xfd7c('0x2b')]);_0x483cc4(_0x339b24);});});}function getUser(_0x1bd79b,_0x423407,_0x12a760,_0x59ca9f){logger['info']('Search\x20user');return request({'method':_0xfd7c('0x2c'),'uri':util[_0xfd7c('0x2d')](_0xfd7c('0x2e'),_0x423407),'qs':{'type':_0xfd7c('0x2f')},'headers':{'Authorization':_0xfd7c('0x30')+_0x1bd79b},'json':!![]})[_0xfd7c('0x27')](function(_0x15b6ec){if(_0x15b6ec['users']){var _0x310d40=-0x1;if(_['isArrayLikeObject'](_0x15b6ec[_0xfd7c('0x31')])){if(!_['isNil'](_0x59ca9f)){_0x310d40=_[_0xfd7c('0x32')](_0x15b6ec[_0xfd7c('0x31')],function(_0x4043dc){return _0x4043dc[_0xfd7c('0x33')]===_0x59ca9f;});}if(_0x310d40>=0x0){logger[_0xfd7c('0x34')]('Agent\x20found!');}else{logger[_0xfd7c('0x34')]('Using\x20the\x20admin\x20account!');_0x310d40=_[_0xfd7c('0x32')](_0x15b6ec[_0xfd7c('0x31')],function(_0x259d1e){return _0x259d1e[_0xfd7c('0x35')][_0xfd7c('0x16')]==='Administrator';});}return _0x15b6ec['users'][_0x310d40];}else{if(_0x15b6ec[_0xfd7c('0x36')][_0xfd7c('0x35')]['name']===_0xfd7c('0x37')){logger[_0xfd7c('0x34')]('Using\x20the\x20admin\x20account!');user=_0x15b6ec[_0xfd7c('0x36')];return user;}else{logger[_0xfd7c('0x38')](_0xfd7c('0x39'),JSON[_0xfd7c('0xc')](_0x15b6ec));throw new Error(_0xfd7c('0x3a')+JSON['stringify'](_0x15b6ec));}}}else{logger[_0xfd7c('0x38')](_0xfd7c('0x39'),JSON[_0xfd7c('0xc')](_0x15b6ec));throw new Error(_0xfd7c('0x3a')+JSON[_0xfd7c('0xc')](_0x15b6ec));}})[_0xfd7c('0x2a')](function(_0x37c9f5){console[_0xfd7c('0x38')](_0x37c9f5);});}function getZohoUser(_0x1ea83a,_0x5e3d23){return new BPromise(function(_0x160304,_0x2977aa){request(_0x1ea83a)['then'](function(_0x1470eb){var _0x203cc8=null;if(_0x1470eb){_0x203cc8=_0x1470eb[_0xfd7c('0x3b')][0x0];_0x203cc8[_0xfd7c('0x3c')]=_0x5e3d23;}_0x160304(_0x203cc8);})[_0xfd7c('0x2a')](function(_0x484ebf){_0x2977aa(_0x484ebf);});});}function createEndUser(_0x17ba0e,_0x1fe1aa,_0x16b0a5,_0x405a71,_0xdaabae,_0x570dea){var _0x16b0a5=getName(_0x16b0a5);return request({'method':'POST','uri':_0xfd7c('0x3d')+_0x1fe1aa+_0xfd7c('0x3e')+_[_0xfd7c('0x3f')](_0x570dea[_0xfd7c('0x40')])+'s','body':{'data':[{'Last_Name':_0x16b0a5[0x1],'First_Name':_0x16b0a5[0x0],'Phone':_0x405a71,'Owner':{'name':!_[_0xfd7c('0x19')](_0xdaabae['role']['name'])?_0xdaabae[_0xfd7c('0x41')][_0xfd7c('0x16')]:!_[_0xfd7c('0x19')](_0xdaabae[_0xfd7c('0x42')])?_0xdaabae['first_name']+'\x20'+_0xdaabae[_0xfd7c('0x43')]:_0xdaabae['last_name'],'id':_0xdaabae['id']}}]},'headers':{'Authorization':_0xfd7c('0x30')+_0x17ba0e},'json':!![]})[_0xfd7c('0x27')](function(_0x269c06){if(_0x269c06&&_0x269c06['data'][0x0][_0xfd7c('0x44')]===_0xfd7c('0x45')){var _0x3c30d5=_0x269c06[_0xfd7c('0x3b')][0x0][_0xfd7c('0x46')];_0x3c30d5[_0xfd7c('0x3c')]=_[_0xfd7c('0x3f')](_0x570dea['moduleCreate'])+'s';return _0x3c30d5;}logger[_0xfd7c('0x38')](_0xfd7c('0x39'),JSON['stringify'](data));throw new Error(_0xfd7c('0x47')+JSON[_0xfd7c('0xc')](data));})[_0xfd7c('0x2a')](function(_0x6dbec5){console[_0xfd7c('0x48')]('CREATE\x20ERROR',_0x6dbec5);});}function getEndUser(_0x4775fa,_0x3d5c95,_0x3ea4e9,_0x1f0d66,_0x28adff,_0x266578,_0x4166fb){var _0x38276f={'method':_0xfd7c('0x2c'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4775fa},'json':!![]};switch(_0x4166fb[_0xfd7c('0x49')]){case _0xfd7c('0x4a'):_0x38276f[_0xfd7c('0x4b')]=_0xfd7c('0x3d')+_0x3d5c95+_0xfd7c('0x4c')+_0x28adff+'))';return getZohoUser(_0x38276f,_0xfd7c('0x4d'))[_0xfd7c('0x27')](function(_0x4504f6){if(_0x4504f6)return _0x4504f6;_0x38276f[_0xfd7c('0x4b')]=_0xfd7c('0x3d')+_0x3d5c95+_0xfd7c('0x4e')+_0x28adff+'))';return getZohoUser(_0x38276f,_0xfd7c('0x4f'))[_0xfd7c('0x27')](function(_0x13472c){if(_0x13472c)return _0x13472c;if(_0x4166fb[_0xfd7c('0x40')]!='nothing'){return createEndUser(_0x4775fa,_0x3d5c95,_0x1f0d66,_0x28adff,_0x266578,_0x4166fb);}else{return{};}});});break;case _0xfd7c('0x50'):_0x38276f[_0xfd7c('0x4b')]=_0xfd7c('0x3d')+_0x3d5c95+_0xfd7c('0x4c')+_0x28adff+'))';return getZohoUser(_0x38276f,'Contacts')[_0xfd7c('0x27')](function(_0x4af2d3){if(_0x4af2d3)return _0x4af2d3;if(_0x4166fb['moduleCreate']!=_0xfd7c('0x51')){return createEndUser(_0x4775fa,_0x3d5c95,_0x1f0d66,_0x28adff,_0x266578,_0x4166fb);}else{return{};}});break;case'lead':_0x38276f[_0xfd7c('0x4b')]='https://www.zohoapis.'+_0x3d5c95+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x28adff+'))';return getZohoUser(_0x38276f,'Leads')[_0xfd7c('0x27')](function(_0x3a33bc){if(_0x3a33bc)return _0x3a33bc;if(_0x4166fb['moduleCreate']!=_0xfd7c('0x51')){return createEndUser(_0x4775fa,_0x3d5c95,_0x1f0d66,_0x28adff,_0x266578,_0x4166fb);}else{return{};}});break;}}function getCall(_0x528b0a,_0x4a54ee,_0x26b5f0,_0x23a172,_0x270e5e,_0x25ad1a,_0x22fb87,_0x1b3344){logger[_0xfd7c('0x34')](_0xfd7c('0x52'));var _0x476dbd={};_0x476dbd[_0xfd7c('0x53')]={'name':!_[_0xfd7c('0x19')](_0x23a172[_0xfd7c('0x41')][_0xfd7c('0x16')])&&!_[_0xfd7c('0x19')](_0x23a172[_0xfd7c('0x35')]['name'])&&_0x23a172[_0xfd7c('0x35')][_0xfd7c('0x16')]===_0xfd7c('0x54')?_0x23a172[_0xfd7c('0x41')]['name']:!_[_0xfd7c('0x19')](_0x23a172['first_name'])?_0x23a172[_0xfd7c('0x42')]+'\x20'+_0x23a172[_0xfd7c('0x43')]:_0x23a172[_0xfd7c('0x43')],'id':_0x23a172['id']};_0x476dbd['Subject']=intUtil[_0xfd7c('0x55')](_0x25ad1a['Subjects'],_0x22fb87,'\x20');_0x476dbd[_0xfd7c('0x56')]=intUtil[_0xfd7c('0x55')](_0x25ad1a['Descriptions'],_0x22fb87,'\x0a');if(_0x270e5e['enduserType']===_0xfd7c('0x4d')){_0x476dbd[_0xfd7c('0x57')]={'name':!_[_0xfd7c('0x19')](_0x270e5e[_0xfd7c('0x58')])?_0x270e5e[_0xfd7c('0x58')]:!_[_0xfd7c('0x19')](_0x270e5e['First_Name'])?_0x270e5e[_0xfd7c('0x59')]+'\x20'+_0x270e5e[_0xfd7c('0x5a')]:_0x270e5e[_0xfd7c('0x5a')],'id':_0x270e5e['id']};}if(_0x270e5e[_0xfd7c('0x3c')]===_0xfd7c('0x4f')){_0x476dbd['What_Id']={'name':!_[_0xfd7c('0x19')](_0x270e5e['Full_Name'])?_0x270e5e[_0xfd7c('0x58')]:!_[_0xfd7c('0x19')](_0x270e5e[_0xfd7c('0x59')])?_0x270e5e[_0xfd7c('0x59')]+'\x20'+_0x270e5e[_0xfd7c('0x5a')]:_0x270e5e[_0xfd7c('0x5a')],'id':_0x270e5e['id']};_0x476dbd[_0xfd7c('0x5b')]=_['startCase'](_0x270e5e[_0xfd7c('0x3c')]);}if(_0x22fb87[_0xfd7c('0x5c')]){_0x476dbd[_0xfd7c('0x5d')]=moment['utc'](parseInt(_0x22fb87['talktime'])*0x3e8)[_0xfd7c('0x2d')]('mm:ss');}else if(_0x22fb87[_0xfd7c('0x5e')]&&_0x22fb87[_0xfd7c('0x5f')]){_0x476dbd[_0xfd7c('0x5d')]=moment['utc'](moment(_0x22fb87[_0xfd7c('0x5f')],_0xfd7c('0x60'))[_0xfd7c('0x61')](moment(_0x22fb87[_0xfd7c('0x62')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0xfd7c('0x63'));}switch(_0x22fb87[_0xfd7c('0x64')]){case _0xfd7c('0x65'):_0x476dbd[_0xfd7c('0x66')]=_0xfd7c('0x67');break;case _0xfd7c('0x68'):case _0xfd7c('0x69'):_0x476dbd[_0xfd7c('0x66')]='Answered';break;case _0xfd7c('0x6a'):_0x476dbd[_0xfd7c('0x66')]=_0xfd7c('0x6b');break;case _0xfd7c('0x6c'):_0x476dbd[_0xfd7c('0x66')]=_0xfd7c('0x6d');break;case _0xfd7c('0x6e'):_0x476dbd[_0xfd7c('0x66')]='Timeout';default:}_0x476dbd[_0xfd7c('0x6f')]=(_0x1b3344===_0xfd7c('0x70')?moment(_0x22fb87[_0xfd7c('0x62')])[_0xfd7c('0x2d')](_0xfd7c('0x60')):moment(_0x22fb87[_0xfd7c('0x71')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0xfd7c('0x60'));_0x476dbd[_0xfd7c('0x72')]=_0x1b3344||_0xfd7c('0x73');_0x476dbd=_[_0xfd7c('0x74')](_0x476dbd,getCustomFields(_0x25ad1a[_0xfd7c('0x75')],_0x22fb87));return request({'method':_0xfd7c('0x21'),'uri':_0xfd7c('0x3d')+_0x4a54ee+'/crm/v2/Calls','headers':{'Authorization':_0xfd7c('0x30')+_0x528b0a},'body':{'data':[_0x476dbd]},'json':!![]})[_0xfd7c('0x27')](function(_0x2be9cf){if(_0x2be9cf&&_0x2be9cf['data'][0x0]['code']===_0xfd7c('0x45')){logger['info'](_0xfd7c('0x76'));return{'id':_0x2be9cf['data'][0x0]['details']['id']};}})['catch'](function(_0x4bfd3e){logger[_0xfd7c('0x34')](_0xfd7c('0x77'),_0x4bfd3e[_0xfd7c('0x2b')]);console[_0xfd7c('0x48')](_0xfd7c('0x77'),_0x4bfd3e);});}exports[_0xfd7c('0x78')]=function(_0x30c4af,_0x3ae837,_0x30d125,_0x17a047,_0x5d54a1,_0x109bee){var _0x3ce11d,_0x5e3ea6,_0x1a65ae;_0x109bee['host']=intUtil['stripTrailingSlash'](_0x109bee[_0xfd7c('0x79')]);_0x109bee[_0xfd7c('0x7a')]=intUtil[_0xfd7c('0x7b')](_0x109bee[_0xfd7c('0x7a')]);if(_0x5d54a1&&_0x5d54a1[_0xfd7c('0x7c')]){logger[_0xfd7c('0x34')](_0xfd7c('0x7d'),'Recording\x20is\x20enabled!');_0x3ae837[_0xfd7c('0x7e')]=_0x109bee[_0xfd7c('0x7a')]+_0xfd7c('0x7f')+_0x3ae837['uniqueid']+_0xfd7c('0x80')+md5(_0x3ae837[_0xfd7c('0x81')]);}else{_0x3ae837['recordingURL']='';}var _0x17bd4f=_0x109bee[_0xfd7c('0x79')]===_0xfd7c('0x82')?'eu':_0xfd7c('0x83');return getAccessToken(_0x109bee)[_0xfd7c('0x27')](function(_0x1d6d7d){_0x1a65ae=_0x1d6d7d;return getUser(_0x1a65ae,_0x17bd4f,_0x109bee,_0x17a047[_0xfd7c('0x33')]);})[_0xfd7c('0x27')](function(_0x4763b9){_0x3ce11d=_0x4763b9;logger[_0xfd7c('0x34')](_0xfd7c('0x84'),_0x3ce11d['id']);return getEndUser(_0x1a65ae,_0x17bd4f,_0x109bee,_0x3ae837[_0xfd7c('0x85')],_0x3ae837[_0xfd7c('0x86')],_0x3ce11d,_0x30d125);})['then'](function(_0x5ac421){_0x5e3ea6=_0x5ac421;return getCall(_0x1a65ae,_0x17bd4f,_0x109bee,_0x3ce11d,_0x5e3ea6,_0x30d125,_0x3ae837,_0xfd7c('0x73'));})[_0xfd7c('0x27')](function(_0x560bc4){if(_0x560bc4){logger[_0xfd7c('0x34')](_0xfd7c('0x87'),_0x560bc4['id']);logger[_0xfd7c('0x34')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xfd7c('0x88'),_0x17a047[_0xfd7c('0x16')]),'trigger:browser:url',{'uri':_0xfd7c('0x89')+_0x109bee[_0xfd7c('0x79')]+_0xfd7c('0x8a')+_0x560bc4['id']});}})[_0xfd7c('0x2a')](function(_0x5165d0){logger[_0xfd7c('0x38')](_0xfd7c('0x7d'),JSON[_0xfd7c('0xc')](_0x5165d0));});};exports[_0xfd7c('0x70')]=function(_0x493aee,_0x2fb80a,_0x43d889,_0x4f3e9f,_0x13da6f,_0x2cb8d3,_0xd6668d){var _0x1cd2e5,_0x18dc35,_0x5420ed;_0x2cb8d3['host']=intUtil['stripTrailingSlash'](_0x2cb8d3['host']);_0x2cb8d3[_0xfd7c('0x7a')]=intUtil['stripTrailingSlash'](_0x2cb8d3[_0xfd7c('0x7a')]);if(_0xd6668d&&_0xd6668d[_0xfd7c('0x8b')]&&_0xd6668d[_0xfd7c('0x8b')]!==_0xfd7c('0x8c')){logger[_0xfd7c('0x34')]('[OUTBOUND]',_0xfd7c('0x8d'));_0x2fb80a[_0xfd7c('0x7e')]=_0x2cb8d3[_0xfd7c('0x7a')]+_0xfd7c('0x7f')+_0x2fb80a[_0xfd7c('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x2fb80a[_0xfd7c('0x81')]);}var _0x508971=_0x2cb8d3[_0xfd7c('0x79')]===_0xfd7c('0x82')?'eu':'com';return getAccessToken(_0x2cb8d3)[_0xfd7c('0x27')](function(_0x5bafb7){_0x5420ed=_0x5bafb7;return getUser(_0x5420ed,_0x508971,_0x2cb8d3,_0x4f3e9f[_0xfd7c('0x33')]);})[_0xfd7c('0x27')](function(_0x4afff9){_0x1cd2e5=_0x4afff9;logger['info'](_0xfd7c('0x84'),_0x1cd2e5['id']);return getEndUser(_0x5420ed,_0x508971,_0x2cb8d3,_0x2fb80a[_0xfd7c('0x8e')],_0x2fb80a[_0xfd7c('0x8f')],_0x1cd2e5,_0x43d889);})['then'](function(_0x3f45f4){_0x18dc35=_0x3f45f4;return getCall(_0x5420ed,_0x508971,_0x2cb8d3,_0x1cd2e5,_0x18dc35,_0x43d889,_0x2fb80a,'Outbound');})['then'](function(_0x2bcea5){if(_0x2bcea5){logger[_0xfd7c('0x34')](_0xfd7c('0x87'),_0x2bcea5['id']);logger[_0xfd7c('0x34')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfd7c('0x2d')](_0xfd7c('0x88'),_0x4f3e9f['name']),_0xfd7c('0x90'),{'uri':_0xfd7c('0x89')+_0x2cb8d3[_0xfd7c('0x79')]+_0xfd7c('0x8a')+_0x2bcea5['id']});}})[_0xfd7c('0x2a')](function(_0x3307e4){logger[_0xfd7c('0x38')]('[OUTBOUND]',JSON['stringify'](_0x3307e4));});};exports[_0xfd7c('0x91')]=function(_0x48ddde,_0x1d19d9,_0x572af8,_0x468ea6,_0x1cb1a2,_0x52eeaa){var _0x5a42b9,_0x1941bf,_0x24da84;_0x52eeaa['host']=intUtil[_0xfd7c('0x7b')](_0x52eeaa['host']);_0x52eeaa['serverUrl']=intUtil[_0xfd7c('0x7b')](_0x52eeaa['serverUrl']);if(_0x1cb1a2&&_0x1cb1a2[_0xfd7c('0x7c')]){logger['info']('['+_0x1d19d9['lastevent']['toUpperCase']()+']',_0xfd7c('0x8d'));_0x1d19d9[_0xfd7c('0x7e')]=_0x52eeaa[_0xfd7c('0x7a')]+_0xfd7c('0x7f')+_0x1d19d9[_0xfd7c('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x1d19d9[_0xfd7c('0x81')]);}else{_0x1d19d9[_0xfd7c('0x7e')]='';}var _0x44fdee=_0x52eeaa['host']==='zoho.eu'?'eu':_0xfd7c('0x83');return getAccessToken(_0x52eeaa)[_0xfd7c('0x27')](function(_0x376130){_0x24da84=_0x376130;return getUser(_0x24da84,_0x44fdee,_0x52eeaa);})['then'](function(_0x1b5c4e){_0x5a42b9=_0x1b5c4e;logger[_0xfd7c('0x34')](_0xfd7c('0x84'),_0x5a42b9['id']);return getEndUser(_0x24da84,_0x44fdee,_0x52eeaa,_0x1d19d9['calleridname'],_0x1d19d9[_0xfd7c('0x86')],_0x5a42b9,_0x572af8);})[_0xfd7c('0x27')](function(_0x2ecccd){_0x1941bf=_0x2ecccd;return getCall(_0x24da84,_0x44fdee,_0x52eeaa,_0x5a42b9,_0x1941bf,_0x572af8,_0x1d19d9,_0xfd7c('0x73'));})[_0xfd7c('0x27')](function(_0x237a95){if(_0x237a95){logger[_0xfd7c('0x34')]('The\x20Call\x20ID\x20is:',_0x237a95['id']);}})['catch'](function(_0x19da43){logger[_0xfd7c('0x38')]('['+_0x1d19d9['lastevent'][_0xfd7c('0x92')]()+']',JSON[_0xfd7c('0xc')](_0x19da43));});};
\ No newline at end of file
index 425aa94..7ceb3e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x11edc3,_0x481577){var _0x3c35a3=function(_0x151967){while(--_0x151967){_0x11edc3['push'](_0x11edc3['shift']());}};_0x3c35a3(++_0x481577);}(_0x7a54,0x106));var _0x47a5=function(_0x2b0714,_0x2bf9dc){_0x2b0714=_0x2b0714-0x0;var _0x4b7b08=_0x7a54[_0x2b0714];return _0x4b7b08;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
+var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x3aef5a,_0x3424d5){var _0x2c7331=function(_0x10d7a3){while(--_0x10d7a3){_0x3aef5a['push'](_0x3aef5a['shift']());}};_0x2c7331(++_0x3424d5);}(_0x7a54,0x106));var _0x47a5=function(_0x51f626,_0x41e4e3){_0x51f626=_0x51f626-0x0;var _0x11424d=_0x7a54[_0x51f626];return _0x11424d;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
index 3fa1df7..e021ffc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x2389d4,_0x3a9f64){var _0x5ac6b1=function(_0x44bf64){while(--_0x44bf64){_0x2389d4['push'](_0x2389d4['shift']());}};_0x5ac6b1(++_0x3a9f64);}(_0x7a54,0x106));var _0x47a5=function(_0x504286,_0x4e92db){_0x504286=_0x504286-0x0;var _0x40416d=_0x7a54[_0x504286];return _0x40416d;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});};
\ No newline at end of file
+var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x2b4eaa,_0x332e1d){var _0x4e4c07=function(_0x1aef54){while(--_0x1aef54){_0x2b4eaa['push'](_0x2b4eaa['shift']());}};_0x4e4c07(++_0x332e1d);}(_0x7a54,0x106));var _0x47a5=function(_0x482645,_0x4afa76){_0x482645=_0x482645-0x0;var _0x31a5ce=_0x7a54[_0x482645];return _0x31a5ce;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});};
\ No newline at end of file
index 717b0e1..6f57a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1061=['message','result','catch','rpc','routing','jayson/promise','client','http','Request','request','debug','error'];(function(_0x37ec3a,_0x4a6da9){var _0x430a93=function(_0x414411){while(--_0x414411){_0x37ec3a['push'](_0x37ec3a['shift']());}};_0x430a93(++_0x4a6da9);}(_0x1061,0x1b5));var _0x1106=function(_0x3eac42,_0x48dde3){_0x3eac42=_0x3eac42-0x0;var _0x39147b=_0x1061[_0x3eac42];return _0x39147b;};'use strict';var jayson=require(_0x1106('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson[_0x1106('0x1')][_0x1106('0x2')]({'port':0x2329});client[_0x1106('0x3')]=function(_0x222f76,_0x1c1bae){return new BPromise(function(_0x13fcfc,_0x75d67b){return client[_0x1106('0x4')](_0x222f76,_0x1c1bae)['then'](function(_0x1f098a){logger[_0x1106('0x5')]('rpc','routing',_0x222f76,_0x1c1bae,_0x1f098a);if(_0x1f098a[_0x1106('0x6')]){logger[_0x1106('0x6')]('rpc','routing',_0x222f76,_0x1f098a[_0x1106('0x6')][_0x1106('0x7')],_0x1c1bae);return _0x75d67b(_0x1f098a[_0x1106('0x6')][_0x1106('0x7')]);}else{return _0x13fcfc(_0x1f098a[_0x1106('0x8')]);}})[_0x1106('0x9')](function(_0x9bcbfb){logger[_0x1106('0x6')](_0x1106('0xa'),_0x1106('0xb'),_0x222f76,_0x9bcbfb,_0x1c1bae);return _0x75d67b(_0x9bcbfb);});});};module['exports']=client;
\ No newline at end of file
+var _0xadec=['exports','jayson/promise','bluebird','../../config/logger','routing','client','rpc','error','message','result','catch'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0xadec,0x156));var _0xcade=function(_0x38185a,_0x2f3522){_0x38185a=_0x38185a-0x0;var _0x3e531b=_0xadec[_0x38185a];return _0x3e531b;};'use strict';var jayson=require(_0xcade('0x0'));var BPromise=require(_0xcade('0x1'));var logger=require(_0xcade('0x2'))(_0xcade('0x3'));var client=jayson[_0xcade('0x4')]['http']({'port':0x2329});client['Request']=function(_0x570d9c,_0x475533){return new BPromise(function(_0x875b81,_0xc0b40e){return client['request'](_0x570d9c,_0x475533)['then'](function(_0x5c8b77){logger['debug'](_0xcade('0x5'),'routing',_0x570d9c,_0x475533,_0x5c8b77);if(_0x5c8b77[_0xcade('0x6')]){logger['error']('rpc',_0xcade('0x3'),_0x570d9c,_0x5c8b77[_0xcade('0x6')][_0xcade('0x7')],_0x475533);return _0xc0b40e(_0x5c8b77['error'][_0xcade('0x7')]);}else{return _0x875b81(_0x5c8b77[_0xcade('0x8')]);}})[_0xcade('0x9')](function(_0x148930){logger[_0xcade('0x6')](_0xcade('0x5'),_0xcade('0x3'),_0x570d9c,_0x148930,_0x475533);return _0xc0b40e(_0x148930);});});};module[_0xcade('0xa')]=client;
\ No newline at end of file
index 809b8a8..99758e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x565f=['resolve','then','getMailAccounts','mailAccounts','Setting','loginMailFrequency','catch','log','./server','./realtime','./lib/email','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x565f,0x68));var _0xf565=function(_0x44be01,_0x318316){_0x44be01=_0x44be01-0x0;var _0x3fc884=_0x565f[_0x44be01];return _0x3fc884;};'use strict';var BPromise=require('bluebird');var server=require(_0xf565('0x0'));var Realtime=require(_0xf565('0x1'));var EmailChannel=require(_0xf565('0x2'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xf565('0x3'))['db'];function initRealtime(){return BPromise[_0xf565('0x4')]()[_0xf565('0x5')](mailAccount[_0xf565('0x6')]())[_0xf565('0x5')](realtime['initMailAccounts']())['then'](function(){email['refresh'](realtime[_0xf565('0x7')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xf565('0x5')](function(_0x45db1b){return initRealtime();})[_0xf565('0x5')](function(_0x55685c){return db[_0xf565('0x8')]['findOne']({'attributes':['id',_0xf565('0x9')],'raw':!![]});})['then'](function(_0x2d7f4e){return setInterval(initRealtime,_0x2d7f4e[_0xf565('0x9')]*0x3e8);})[_0xf565('0xa')](function(_0x1bc33c){console[_0xf565('0xb')](_0x1bc33c);});}main();
\ No newline at end of file
+var _0x4be6=['listen','Setting','loginMailFrequency','catch','log','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x1ff770,_0x2b5842){var _0x2e41da=function(_0x28059c){while(--_0x28059c){_0x1ff770['push'](_0x1ff770['shift']());}};_0x2e41da(++_0x2b5842);}(_0x4be6,0xb5));var _0x64be=function(_0x31a180,_0x3924b9){_0x31a180=_0x31a180-0x0;var _0x4b0502=_0x4be6[_0x31a180];return _0x4b0502;};'use strict';var BPromise=require('bluebird');var server=require(_0x64be('0x0'));var Realtime=require(_0x64be('0x1'));var EmailChannel=require(_0x64be('0x2'));var mailAccount=require(_0x64be('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x64be('0x4'))['db'];function initRealtime(){return BPromise[_0x64be('0x5')]()[_0x64be('0x6')](mailAccount[_0x64be('0x7')]())[_0x64be('0x6')](realtime[_0x64be('0x8')]())['then'](function(){email[_0x64be('0x9')](realtime[_0x64be('0xa')]);return realtime;});}function main(){return server[_0x64be('0xb')](realtime,email)['then'](function(_0x19bdb3){return initRealtime();})[_0x64be('0x6')](function(_0x50d57f){return db[_0x64be('0xc')]['findOne']({'attributes':['id',_0x64be('0xd')],'raw':!![]});})[_0x64be('0x6')](function(_0x490a80){return setInterval(initRealtime,_0x490a80[_0x64be('0xd')]*0x3e8);})[_0x64be('0xe')](function(_0xb45222){console[_0x64be('0xf')](_0xb45222);});}main();
\ No newline at end of file
index 562fc9c..124d392 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4eb=['active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','connected','messages','firstName','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','smtp','verifySmtp','Smtp','verify','exports','moment','md5','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key'];(function(_0x410cb5,_0x18ec2){var _0x25fd31=function(_0x2b2ca9){while(--_0x2b2ca9){_0x410cb5['push'](_0x410cb5['shift']());}};_0x25fd31(++_0x18ec2);}(_0xb4eb,0x1a7));var _0xbb4e=function(_0x5967fa,_0x3ea93e){_0x5967fa=_0x5967fa-0x0;var _0x1c744d=_0xb4eb[_0x5967fa];return _0x1c744d;};'use strict';var _=require('lodash');var moment=require(_0xbb4e('0x0'));var BPromise=require('bluebird');var md5=require(_0xbb4e('0x1'));var Redis=require('ioredis');var config=require(_0xbb4e('0x2'));var logger=require(_0xbb4e('0x3'))(_0xbb4e('0x4'));config['redis']=_['defaults'](config[_0xbb4e('0x5')],{'host':_0xbb4e('0x6'),'port':0x18eb});var io=require(_0xbb4e('0x7'))(new Redis(config[_0xbb4e('0x5')]));var EmailImap=require(_0xbb4e('0x8'));var EmailSmtp=require(_0xbb4e('0x9'));var mailAccount=require(_0xbb4e('0xa'));var md5Accounts={};function EmailChannel(_0xa85597){logger['info'](_0xbb4e('0xb'));this[_0xbb4e('0xc')]=_0xa85597[_0xbb4e('0xc')];this[_0xbb4e('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xbb4e('0xe')][_0xbb4e('0xf')]=function(_0x28960a){var _0x2fde97=this[_0xbb4e('0xc')][_0x28960a];var _0x1537e4={'id':_0x2fde97['id'],'name':_0x2fde97[_0xbb4e('0x10')],'key':_0x2fde97[_0xbb4e('0x11')],'active':_0x2fde97[_0xbb4e('0x12')],'Imap':{'status':_0x2fde97[_0xbb4e('0x13')][_0xbb4e('0x14')],'messageStatus':_0x2fde97[_0xbb4e('0x13')][_0xbb4e('0x15')],'total':_0x2fde97['Imap'][_0xbb4e('0x16')]}};if(_[_0xbb4e('0x17')](md5Accounts[_0x28960a])){md5Accounts[_0x28960a]={};}var _0xde0bca=md5(JSON[_0xbb4e('0x18')](_0x1537e4));if(md5Accounts[_0x28960a][_0xbb4e('0x1')]!==_0xde0bca){md5Accounts[_0x28960a][_0xbb4e('0x1')]=_0xde0bca;io[_0xbb4e('0xf')](_0xbb4e('0x19'),_0x1537e4);}};EmailChannel[_0xbb4e('0xe')]['refresh']=function(_0x21857c){for(var _0x2134ae in _0x21857c){if(_0x21857c[_0xbb4e('0x1a')](_0x2134ae)){if(_0x21857c[_0x2134ae][_0xbb4e('0x13')]&&_0x21857c[_0x2134ae][_0xbb4e('0x12')]){var _0x597a39=_0x21857c[_0x2134ae][_0xbb4e('0x13')];if(!this[_0xbb4e('0xd')][_0xbb4e('0x1a')](_0x597a39['id'])){this['imapAccounts'][_0x597a39['id']]=new EmailImap(_0x597a39,_0x21857c[_0x2134ae][_0xbb4e('0x4')]);this[_0xbb4e('0xd')][_0x597a39['id']]['on'](_0xbb4e('0x1b'),this[_0xbb4e('0x1c')][_0xbb4e('0x1d')](this,_0x2134ae));this[_0xbb4e('0xd')][_0x597a39['id']]['on'](_0xbb4e('0x4'),this['handleImapEmail']['bind'](this,_0x2134ae));this[_0xbb4e('0xd')][_0x597a39['id']]['on'](_0xbb4e('0x1e'),this[_0xbb4e('0x1f')][_0xbb4e('0x1d')](this,_0x2134ae));this[_0xbb4e('0xd')][_0x597a39['id']]['on'](_0xbb4e('0x20'),this[_0xbb4e('0x21')][_0xbb4e('0x1d')](this,_0x2134ae));}}else{if(_['isNil'](this[_0xbb4e('0xc')][_0x2134ae][_0xbb4e('0x13')])){this['mailAccounts'][_0x2134ae][_0xbb4e('0x13')]={};}this['mailAccounts'][_0x2134ae][_0xbb4e('0x13')][_0xbb4e('0x14')]='disabled';this[_0xbb4e('0xc')][_0x2134ae]['Imap']['messageStatus']='';this[_0xbb4e('0xf')](_0x2134ae);}}}};EmailChannel['prototype'][_0xbb4e('0x1c')]=function(_0x4f1945,_0xcf8b76){if(this[_0xbb4e('0xc')][_0x4f1945]){this[_0xbb4e('0xc')][_0x4f1945][_0xbb4e('0x13')]['status']=_0xbb4e('0x22');this[_0xbb4e('0xc')][_0x4f1945][_0xbb4e('0x13')][_0xbb4e('0x15')]=_0xcf8b76[_0xbb4e('0x10')];if(_0xcf8b76[_0xbb4e('0x23')]){this[_0xbb4e('0xc')][_0x4f1945]['Imap'][_0xbb4e('0x16')]=_0xcf8b76[_0xbb4e('0x23')][_0xbb4e('0x16')];}return this[_0xbb4e('0xf')](_0x4f1945);}};EmailChannel['prototype']['handleImapEmail']=function(_0x2dab69,_0x41653d){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x41653d[_0xbb4e('0x24')],_0x41653d[_0xbb4e('0x25')],_0x41653d[_0xbb4e('0x26')],_0x2dab69);if(this[_0xbb4e('0xc')][_0x2dab69]){return mailAccount[_0xbb4e('0x27')](_0x2dab69,_0x41653d)[_0xbb4e('0x28')](function(_0x270f0e){if(_0x270f0e){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0xbb4e('0x29')](function(_0x575cb4){logger[_0xbb4e('0x20')](_0xbb4e('0x2a'),JSON[_0xbb4e('0x18')](_0x575cb4));});}};EmailChannel[_0xbb4e('0xe')][_0xbb4e('0x1f')]=function(_0x1f9913){if(this['mailAccounts'][_0x1f9913]&&this[_0xbb4e('0xc')][_0x1f9913][_0xbb4e('0x13')]){if(this['imapAccounts'][this[_0xbb4e('0xc')][_0x1f9913][_0xbb4e('0x13')]['id']]){delete this[_0xbb4e('0xd')][this[_0xbb4e('0xc')][_0x1f9913][_0xbb4e('0x13')]['id']];}this[_0xbb4e('0xc')][_0x1f9913][_0xbb4e('0x13')][_0xbb4e('0x2b')]=moment();this[_0xbb4e('0xf')](_0x1f9913);}};EmailChannel['prototype'][_0xbb4e('0x21')]=function(_0x4750cc,_0x1e4220){if(this['mailAccounts'][_0x4750cc]){this[_0xbb4e('0xc')][_0x4750cc][_0xbb4e('0x13')][_0xbb4e('0x14')]=_0xbb4e('0x20');this[_0xbb4e('0xc')][_0x4750cc]['Imap'][_0xbb4e('0x15')]=_0x1e4220;return this[_0xbb4e('0xf')](_0x4750cc);}};EmailChannel['prototype']['sendMail']=function(_0x46bb0c,_0x180b72){return this[_0xbb4e('0x2c')]['send'](_0x46bb0c,_0x180b72);};EmailChannel[_0xbb4e('0xe')][_0xbb4e('0x2d')]=function(_0x31b092){var _0x24f724=this;if(this[_0xbb4e('0xc')][_0x31b092['id']]){if(_[_0xbb4e('0x17')](this[_0xbb4e('0xc')][_0x31b092['id']][_0xbb4e('0x2e')])){this[_0xbb4e('0xc')][_0x31b092['id']][_0xbb4e('0x2e')]={};}this['mailAccounts'][_0x31b092['id']][_0xbb4e('0x2e')][_0xbb4e('0x2b')]=moment();return new BPromise(function(_0x529b52,_0x3039bf){return _0x24f724[_0xbb4e('0x2c')]['verify'](_0x31b092)[_0xbb4e('0x28')](function(_0x5e91eb){_0x24f724[_0xbb4e('0xc')][_0x31b092['id']][_0xbb4e('0x2e')][_0xbb4e('0x14')]='verified';_0x24f724[_0xbb4e('0xc')][_0x31b092['id']][_0xbb4e('0x2e')][_0xbb4e('0x15')]='';_0x24f724[_0xbb4e('0xf')](_0x31b092['id']);_0x529b52(_0x5e91eb);})[_0xbb4e('0x29')](function(_0x139701){_0x24f724[_0xbb4e('0xc')][_0x31b092['id']][_0xbb4e('0x2e')]['status']=_0xbb4e('0x20');_0x24f724[_0xbb4e('0xc')][_0x31b092['id']]['Smtp'][_0xbb4e('0x15')]=_0x139701;_0x24f724[_0xbb4e('0xf')](_0x31b092['id']);_0x3039bf(_0x139701);});});}return this['smtp'][_0xbb4e('0x2f')](_0x31b092);};module[_0xbb4e('0x30')]=EmailChannel;
\ No newline at end of file
+var _0xe1bf=['status','messageStatus','total','isNil','stringify','emit','mailAccount:update','hasOwnProperty','active','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','../../../config/environment','email','defaults','redis','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','Imap'];(function(_0x20befa,_0x1a35ca){var _0x3b136e=function(_0x453d08){while(--_0x453d08){_0x20befa['push'](_0x20befa['shift']());}};_0x3b136e(++_0x1a35ca);}(_0xe1bf,0xf0));var _0xfe1b=function(_0x264b21,_0x34526d){_0x264b21=_0x264b21-0x0;var _0x3560f4=_0xe1bf[_0x264b21];return _0x3560f4;};'use strict';var _=require(_0xfe1b('0x0'));var moment=require(_0xfe1b('0x1'));var BPromise=require(_0xfe1b('0x2'));var md5=require(_0xfe1b('0x3'));var Redis=require('ioredis');var config=require(_0xfe1b('0x4'));var logger=require('../../../config/logger')(_0xfe1b('0x5'));config['redis']=_[_0xfe1b('0x6')](config[_0xfe1b('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfe1b('0x7')]));var EmailImap=require(_0xfe1b('0x8'));var EmailSmtp=require(_0xfe1b('0x9'));var mailAccount=require(_0xfe1b('0xa'));var md5Accounts={};function EmailChannel(_0x2a7d7b){logger[_0xfe1b('0xb')](_0xfe1b('0xc'));this[_0xfe1b('0xd')]=_0x2a7d7b[_0xfe1b('0xd')];this[_0xfe1b('0xe')]={};this[_0xfe1b('0xf')]=new EmailSmtp();}EmailChannel[_0xfe1b('0x10')]['emit']=function(_0x12d619){var _0x23093d=this['mailAccounts'][_0x12d619];var _0x33d5de={'id':_0x23093d['id'],'name':_0x23093d[_0xfe1b('0x11')],'key':_0x23093d[_0xfe1b('0x12')],'active':_0x23093d['active'],'Imap':{'status':_0x23093d[_0xfe1b('0x13')][_0xfe1b('0x14')],'messageStatus':_0x23093d[_0xfe1b('0x13')][_0xfe1b('0x15')],'total':_0x23093d['Imap'][_0xfe1b('0x16')]}};if(_[_0xfe1b('0x17')](md5Accounts[_0x12d619])){md5Accounts[_0x12d619]={};}var _0x326521=md5(JSON[_0xfe1b('0x18')](_0x33d5de));if(md5Accounts[_0x12d619]['md5']!==_0x326521){md5Accounts[_0x12d619][_0xfe1b('0x3')]=_0x326521;io[_0xfe1b('0x19')](_0xfe1b('0x1a'),_0x33d5de);}};EmailChannel['prototype']['refresh']=function(_0x459b5a){for(var _0x3031a8 in _0x459b5a){if(_0x459b5a[_0xfe1b('0x1b')](_0x3031a8)){if(_0x459b5a[_0x3031a8][_0xfe1b('0x13')]&&_0x459b5a[_0x3031a8][_0xfe1b('0x1c')]){var _0xd3a607=_0x459b5a[_0x3031a8][_0xfe1b('0x13')];if(!this[_0xfe1b('0xe')]['hasOwnProperty'](_0xd3a607['id'])){this[_0xfe1b('0xe')][_0xd3a607['id']]=new EmailImap(_0xd3a607,_0x459b5a[_0x3031a8][_0xfe1b('0x5')]);this[_0xfe1b('0xe')][_0xd3a607['id']]['on'](_0xfe1b('0x1d'),this['handleImapBox'][_0xfe1b('0x1e')](this,_0x3031a8));this[_0xfe1b('0xe')][_0xd3a607['id']]['on'](_0xfe1b('0x5'),this[_0xfe1b('0x1f')][_0xfe1b('0x1e')](this,_0x3031a8));this[_0xfe1b('0xe')][_0xd3a607['id']]['on'](_0xfe1b('0x20'),this[_0xfe1b('0x21')][_0xfe1b('0x1e')](this,_0x3031a8));this[_0xfe1b('0xe')][_0xd3a607['id']]['on'](_0xfe1b('0x22'),this[_0xfe1b('0x23')][_0xfe1b('0x1e')](this,_0x3031a8));}}else{if(_[_0xfe1b('0x17')](this[_0xfe1b('0xd')][_0x3031a8][_0xfe1b('0x13')])){this[_0xfe1b('0xd')][_0x3031a8][_0xfe1b('0x13')]={};}this['mailAccounts'][_0x3031a8][_0xfe1b('0x13')][_0xfe1b('0x14')]=_0xfe1b('0x24');this[_0xfe1b('0xd')][_0x3031a8][_0xfe1b('0x13')][_0xfe1b('0x15')]='';this['emit'](_0x3031a8);}}}};EmailChannel[_0xfe1b('0x10')][_0xfe1b('0x25')]=function(_0x492467,_0x53565f){if(this[_0xfe1b('0xd')][_0x492467]){this[_0xfe1b('0xd')][_0x492467]['Imap'][_0xfe1b('0x14')]=_0xfe1b('0x26');this[_0xfe1b('0xd')][_0x492467][_0xfe1b('0x13')]['messageStatus']=_0x53565f[_0xfe1b('0x11')];if(_0x53565f['messages']){this[_0xfe1b('0xd')][_0x492467][_0xfe1b('0x13')][_0xfe1b('0x16')]=_0x53565f[_0xfe1b('0x27')][_0xfe1b('0x16')];}return this[_0xfe1b('0x19')](_0x492467);}};EmailChannel[_0xfe1b('0x10')][_0xfe1b('0x1f')]=function(_0x41ec9b,_0x75d5e5){logger['info'](_0xfe1b('0x28'),_0x75d5e5['firstName'],_0x75d5e5['lastName'],_0x75d5e5[_0xfe1b('0x29')],_0x41ec9b);if(this[_0xfe1b('0xd')][_0x41ec9b]){return mailAccount[_0xfe1b('0x2a')](_0x41ec9b,_0x75d5e5)[_0xfe1b('0x2b')](function(_0xdf012a){if(_0xdf012a){logger[_0xfe1b('0xb')](_0xfe1b('0x2c'));}})[_0xfe1b('0x2d')](function(_0x28130d){logger[_0xfe1b('0x22')](_0xfe1b('0x2e'),JSON[_0xfe1b('0x18')](_0x28130d));});}};EmailChannel['prototype'][_0xfe1b('0x21')]=function(_0x50ce81){if(this[_0xfe1b('0xd')][_0x50ce81]&&this[_0xfe1b('0xd')][_0x50ce81][_0xfe1b('0x13')]){if(this['imapAccounts'][this[_0xfe1b('0xd')][_0x50ce81][_0xfe1b('0x13')]['id']]){delete this[_0xfe1b('0xe')][this['mailAccounts'][_0x50ce81][_0xfe1b('0x13')]['id']];}this[_0xfe1b('0xd')][_0x50ce81][_0xfe1b('0x13')][_0xfe1b('0x2f')]=moment();this['emit'](_0x50ce81);}};EmailChannel[_0xfe1b('0x10')][_0xfe1b('0x23')]=function(_0x1dd2fc,_0x302aac){if(this['mailAccounts'][_0x1dd2fc]){this[_0xfe1b('0xd')][_0x1dd2fc][_0xfe1b('0x13')]['status']=_0xfe1b('0x22');this[_0xfe1b('0xd')][_0x1dd2fc][_0xfe1b('0x13')][_0xfe1b('0x15')]=_0x302aac;return this['emit'](_0x1dd2fc);}};EmailChannel[_0xfe1b('0x10')]['sendMail']=function(_0x3dbca6,_0x43e7ca){return this[_0xfe1b('0xf')]['send'](_0x3dbca6,_0x43e7ca);};EmailChannel['prototype']['verifySmtp']=function(_0x3e8cb3){var _0x13a644=this;if(this['mailAccounts'][_0x3e8cb3['id']]){if(_[_0xfe1b('0x17')](this[_0xfe1b('0xd')][_0x3e8cb3['id']][_0xfe1b('0x30')])){this[_0xfe1b('0xd')][_0x3e8cb3['id']]['Smtp']={};}this[_0xfe1b('0xd')][_0x3e8cb3['id']][_0xfe1b('0x30')][_0xfe1b('0x2f')]=moment();return new BPromise(function(_0x4f650b,_0x242a1f){return _0x13a644[_0xfe1b('0xf')][_0xfe1b('0x31')](_0x3e8cb3)['then'](function(_0x1bb2a2){_0x13a644['mailAccounts'][_0x3e8cb3['id']][_0xfe1b('0x30')]['status']=_0xfe1b('0x32');_0x13a644[_0xfe1b('0xd')][_0x3e8cb3['id']][_0xfe1b('0x30')][_0xfe1b('0x15')]='';_0x13a644[_0xfe1b('0x19')](_0x3e8cb3['id']);_0x4f650b(_0x1bb2a2);})[_0xfe1b('0x2d')](function(_0x1614c1){_0x13a644[_0xfe1b('0xd')][_0x3e8cb3['id']][_0xfe1b('0x30')][_0xfe1b('0x14')]=_0xfe1b('0x22');_0x13a644[_0xfe1b('0xd')][_0x3e8cb3['id']]['Smtp'][_0xfe1b('0x15')]=_0x1614c1;_0x13a644['emit'](_0x3e8cb3['id']);_0x242a1f(_0x1614c1);});});}return this[_0xfe1b('0xf')][_0xfe1b('0x31')](_0x3e8cb3);};module[_0xfe1b('0x33')]=EmailChannel;
\ No newline at end of file
index 3f141f0..53fc5e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0f8=['handleReady','handleEnd','error','bind','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','openBox','handleOpenBox','handleError','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','handleCloseBox','handleMessageBody','handleMessageEnd','handleMessageAttributes','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','emit','exports','util','lodash','randomstring','simpleParser','Iconv','events','../../../config/logger','email','mailbox','account','imap','once','ready'];(function(_0x64d8bd,_0x5a8313){var _0x337e0d=function(_0x158638){while(--_0x158638){_0x64d8bd['push'](_0x64d8bd['shift']());}};_0x337e0d(++_0x5a8313);}(_0xb0f8,0x15b));var _0x8b0f=function(_0x4b8ba0,_0x468e84){_0x4b8ba0=_0x4b8ba0-0x0;var _0x31fe29=_0xb0f8[_0x4b8ba0];return _0x31fe29;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x8b0f('0x0'));var Imap=require('imap');var _=require(_0x8b0f('0x1'));var rs=require(_0x8b0f('0x2'));var simpleParser=require('mailparser')[_0x8b0f('0x3')];var Iconv=require('iconv')[_0x8b0f('0x4')];var EventEmitter=require(_0x8b0f('0x5'))['EventEmitter'];var utils=require('./utils');var logger=require(_0x8b0f('0x6'))(_0x8b0f('0x7'));function EmailImap(_0x2ab961,_0x1e8a68){this[_0x8b0f('0x8')]='INBOX';this[_0x8b0f('0x9')]=this['getAccount'](_0x2ab961,_0x1e8a68);this[_0x8b0f('0xa')]=new Imap(this[_0x8b0f('0x9')]);this[_0x8b0f('0xa')][_0x8b0f('0xb')](_0x8b0f('0xc'),this[_0x8b0f('0xd')]['bind'](this));this[_0x8b0f('0xa')][_0x8b0f('0xb')]('end',this[_0x8b0f('0xe')]['bind'](this));this[_0x8b0f('0xa')]['on'](_0x8b0f('0xf'),this['handleError'][_0x8b0f('0x10')](this));this[_0x8b0f('0xa')][_0x8b0f('0x11')]();}util[_0x8b0f('0x12')](EmailImap,EventEmitter);EmailImap[_0x8b0f('0x13')][_0x8b0f('0x14')]=function(_0xdf8f9,_0x1f2771){var _0x41c90e={'connTimeout':_0xdf8f9[_0x8b0f('0x15')]?_0xdf8f9['connTimeout']*0x3e8:0x2710,'authTimeout':_0xdf8f9[_0x8b0f('0x16')]?_0xdf8f9[_0x8b0f('0x16')]*0x3e8:0x1388};if(_[_0x8b0f('0x17')](_0xdf8f9[_0x8b0f('0x18')])){if(_0xdf8f9[_0x8b0f('0x19')]){_0x41c90e[_0x8b0f('0x1a')]=_0xdf8f9['user'];_0x41c90e[_0x8b0f('0x1b')]=_0xdf8f9['password'];}_0x41c90e[_0x8b0f('0x1c')]=_0xdf8f9[_0x8b0f('0x1c')];_0x41c90e[_0x8b0f('0x1d')]=_0xdf8f9[_0x8b0f('0x1d')]||0x3e1;if(_0xdf8f9[_0x8b0f('0x1e')]){_0x41c90e[_0x8b0f('0x1e')]=!![];}else{_0x41c90e[_0x8b0f('0x1e')]=![];_0x41c90e[_0x8b0f('0x1f')]='required';}}else{_0x41c90e['user']=_0xdf8f9[_0x8b0f('0x1a')];_0x41c90e[_0x8b0f('0x1b')]=_0xdf8f9[_0x8b0f('0x1b')];_0x41c90e['host']=utils[_0x8b0f('0x20')](_0xdf8f9['service']);_0x41c90e[_0x8b0f('0x1d')]=0x3e1;_0x41c90e[_0x8b0f('0x1e')]=!![];}_0x41c90e[_0x8b0f('0x7')]=_0x1f2771||_0xdf8f9[_0x8b0f('0x1a')]||'anonymous@xcally.com';return _0x41c90e;};EmailImap['prototype'][_0x8b0f('0xd')]=function(){this[_0x8b0f('0xa')][_0x8b0f('0x21')](this[_0x8b0f('0x8')],![],this[_0x8b0f('0x22')][_0x8b0f('0x10')](this));};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x22')]=function(_0x48b82f,_0x4c884b){if(_0x48b82f){this[_0x8b0f('0x23')](_0x48b82f,!![]);}else{this['emit'](_0x8b0f('0x24'),_0x4c884b);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x50912f){if(_0x50912f){this[_0x8b0f('0x23')](_0x50912f,!![]);}else{this[_0x8b0f('0xa')]['end']();}};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x25')]=function(){this[_0x8b0f('0xa')][_0x8b0f('0x26')]([_0x8b0f('0x27')],this[_0x8b0f('0x28')]['bind'](this));};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x28')]=function(_0x5d7a8e,_0x70a18){if(_0x5d7a8e){this[_0x8b0f('0x23')](_0x5d7a8e,!![]);}else{if(_0x70a18[_0x8b0f('0x29')]){try{var _0xb3c118=this[_0x8b0f('0xa')][_0x8b0f('0x2a')](_0x70a18,{'bodies':'','markSeen':!![]});_0xb3c118['on']('message',this[_0x8b0f('0x2b')][_0x8b0f('0x10')](this));_0xb3c118[_0x8b0f('0xb')](_0x8b0f('0xf'),this[_0x8b0f('0x2c')][_0x8b0f('0x10')](this));_0xb3c118[_0x8b0f('0xb')](_0x8b0f('0x2d'),this[_0x8b0f('0x2e')]['bind'](this));}catch(_0x28eb24){logger[_0x8b0f('0xf')](_0x28eb24);}}else{this[_0x8b0f('0xa')][_0x8b0f('0x2f')](!![],this[_0x8b0f('0x30')]['bind'](this));}}};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x2b')]=function(_0x2a0019,_0x3beebd){_0x2a0019['on']('body',this[_0x8b0f('0x31')][_0x8b0f('0x10')](this));_0x2a0019[_0x8b0f('0xb')]('attributes',this['handleMessageAttributes']['bind'](this));_0x2a0019[_0x8b0f('0xb')](_0x8b0f('0x2d'),this[_0x8b0f('0x32')][_0x8b0f('0x10')](this));};EmailImap['prototype'][_0x8b0f('0x31')]=function(_0x4c97b1,_0x3fd00b){simpleParser(_0x4c97b1,{'Iconv':Iconv},this['handleSimpleParser'][_0x8b0f('0x10')](this));};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x33')]=function(_0x3b24d5){};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x32')]=function(){};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x34')]=function(_0x19516c,_0x4e9029){if(_0x19516c){logger[_0x8b0f('0xf')](_0x19516c);}else{var _0xc94f7a=this;utils[_0x8b0f('0x35')](this[_0x8b0f('0x9')],_0x4e9029,function(_0x1851fb){_0xc94f7a['emit']('email',_0x1851fb);});}};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x2e')]=function(){this['imap']['closeBox'](!![],this[_0x8b0f('0x30')][_0x8b0f('0x10')](this));};EmailImap[_0x8b0f('0x13')][_0x8b0f('0x2c')]=function(_0x4b065b){this['handleError'](_0x4b065b);this[_0x8b0f('0xa')][_0x8b0f('0x2f')](!![],this[_0x8b0f('0x30')]['bind'](this));};EmailImap[_0x8b0f('0x13')][_0x8b0f('0xe')]=function(){this['emit']('end');};EmailImap['prototype'][_0x8b0f('0x23')]=function(_0x93b4c,_0x4f9f5e){logger[_0x8b0f('0xf')](_0x8b0f('0x23'),this[_0x8b0f('0x9')][_0x8b0f('0x7')],JSON[_0x8b0f('0x36')](_0x93b4c));var _0x254780='';if(_0x93b4c){if(_0x93b4c[_0x8b0f('0x37')]){_0x254780=_0x93b4c[_0x8b0f('0x37')];}else{for(var _0x54da0f in _0x93b4c){if(_0x93b4c[_0x8b0f('0x38')](_0x54da0f)){_0x254780+=_[_0x8b0f('0x39')](_0x54da0f)+':\x20'+_0x93b4c[_0x54da0f]+'\x0a';}}}}if(_0x4f9f5e){this[_0x8b0f('0xa')][_0x8b0f('0x2d')]();}else{this[_0x8b0f('0x3a')]('error',_0x254780);this['emit']('end');}};module[_0x8b0f('0x3b')]=EmailImap;
\ No newline at end of file
+var _0x3489=['attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','email','stringify','textCode','upperFirst','util','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','mailbox','account','getAccount','imap','once','handleReady','end','handleEnd','bind','handleError','connect','prototype','connTimeout','isNil','authentication','user','password','host','port','tls','autotls','getHost','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','handleCloseBox'];(function(_0x1e9a57,_0x102485){var _0x348e39=function(_0x6a45ca){while(--_0x6a45ca){_0x1e9a57['push'](_0x1e9a57['shift']());}};_0x348e39(++_0x102485);}(_0x3489,0x1ef));var _0x9348=function(_0x4c668a,_0x47dd1c){_0x4c668a=_0x4c668a-0x0;var _0x61d015=_0x3489[_0x4c668a];return _0x61d015;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x9348('0x0'));var Imap=require('imap');var _=require(_0x9348('0x1'));var rs=require(_0x9348('0x2'));var simpleParser=require(_0x9348('0x3'))[_0x9348('0x4')];var Iconv=require(_0x9348('0x5'))[_0x9348('0x6')];var EventEmitter=require('events')[_0x9348('0x7')];var utils=require(_0x9348('0x8'));var logger=require(_0x9348('0x9'))('email');function EmailImap(_0x41ba59,_0x30f7ae){this[_0x9348('0xa')]='INBOX';this[_0x9348('0xb')]=this[_0x9348('0xc')](_0x41ba59,_0x30f7ae);this[_0x9348('0xd')]=new Imap(this[_0x9348('0xb')]);this['imap'][_0x9348('0xe')]('ready',this[_0x9348('0xf')]['bind'](this));this[_0x9348('0xd')]['once'](_0x9348('0x10'),this[_0x9348('0x11')][_0x9348('0x12')](this));this[_0x9348('0xd')]['on']('error',this[_0x9348('0x13')]['bind'](this));this[_0x9348('0xd')][_0x9348('0x14')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x9348('0x15')][_0x9348('0xc')]=function(_0x2ab184,_0x2a0956){var _0x203b70={'connTimeout':_0x2ab184[_0x9348('0x16')]?_0x2ab184['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2ab184['authTimeout']?_0x2ab184['authTimeout']*0x3e8:0x1388};if(_[_0x9348('0x17')](_0x2ab184['service'])){if(_0x2ab184[_0x9348('0x18')]){_0x203b70[_0x9348('0x19')]=_0x2ab184[_0x9348('0x19')];_0x203b70[_0x9348('0x1a')]=_0x2ab184[_0x9348('0x1a')];}_0x203b70[_0x9348('0x1b')]=_0x2ab184[_0x9348('0x1b')];_0x203b70[_0x9348('0x1c')]=_0x2ab184['port']||0x3e1;if(_0x2ab184[_0x9348('0x1d')]){_0x203b70[_0x9348('0x1d')]=!![];}else{_0x203b70[_0x9348('0x1d')]=![];_0x203b70[_0x9348('0x1e')]='required';}}else{_0x203b70[_0x9348('0x19')]=_0x2ab184[_0x9348('0x19')];_0x203b70['password']=_0x2ab184[_0x9348('0x1a')];_0x203b70['host']=utils[_0x9348('0x1f')](_0x2ab184['service']);_0x203b70[_0x9348('0x1c')]=0x3e1;_0x203b70[_0x9348('0x1d')]=!![];}_0x203b70['email']=_0x2a0956||_0x2ab184[_0x9348('0x19')]||'anonymous@xcally.com';return _0x203b70;};EmailImap[_0x9348('0x15')][_0x9348('0xf')]=function(){this[_0x9348('0xd')]['openBox'](this[_0x9348('0xa')],![],this[_0x9348('0x20')][_0x9348('0x12')](this));};EmailImap[_0x9348('0x15')][_0x9348('0x20')]=function(_0x59142b,_0x26d59b){if(_0x59142b){this['handleError'](_0x59142b,!![]);}else{this[_0x9348('0x21')](_0x9348('0x22'),_0x26d59b);this[_0x9348('0x23')]();}};EmailImap[_0x9348('0x15')]['handleCloseBox']=function(_0x4787ca){if(_0x4787ca){this['handleError'](_0x4787ca,!![]);}else{this[_0x9348('0xd')]['end']();}};EmailImap[_0x9348('0x15')][_0x9348('0x23')]=function(){this['imap'][_0x9348('0x24')]([_0x9348('0x25')],this[_0x9348('0x26')][_0x9348('0x12')](this));};EmailImap[_0x9348('0x15')][_0x9348('0x26')]=function(_0x7d6e50,_0x3663de){if(_0x7d6e50){this[_0x9348('0x13')](_0x7d6e50,!![]);}else{if(_0x3663de['length']){try{var _0x224db7=this[_0x9348('0xd')]['fetch'](_0x3663de,{'bodies':'','markSeen':!![]});_0x224db7['on']('message',this[_0x9348('0x27')][_0x9348('0x12')](this));_0x224db7[_0x9348('0xe')](_0x9348('0x28'),this[_0x9348('0x29')]['bind'](this));_0x224db7[_0x9348('0xe')](_0x9348('0x10'),this[_0x9348('0x2a')][_0x9348('0x12')](this));}catch(_0x39d892){logger[_0x9348('0x28')](_0x39d892);}}else{this[_0x9348('0xd')][_0x9348('0x2b')](!![],this[_0x9348('0x2c')][_0x9348('0x12')](this));}}};EmailImap[_0x9348('0x15')][_0x9348('0x27')]=function(_0x4f6a3b,_0x4c67c3){_0x4f6a3b['on']('body',this['handleMessageBody']['bind'](this));_0x4f6a3b['once'](_0x9348('0x2d'),this[_0x9348('0x2e')][_0x9348('0x12')](this));_0x4f6a3b[_0x9348('0xe')](_0x9348('0x10'),this[_0x9348('0x2f')][_0x9348('0x12')](this));};EmailImap['prototype'][_0x9348('0x30')]=function(_0x33e0fd,_0x44c539){simpleParser(_0x33e0fd,{'Iconv':Iconv},this[_0x9348('0x31')]['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(_0x3f5dca){};EmailImap[_0x9348('0x15')][_0x9348('0x2f')]=function(){};EmailImap[_0x9348('0x15')]['handleSimpleParser']=function(_0x3e56f6,_0x4f7731){if(_0x3e56f6){logger[_0x9348('0x28')](_0x3e56f6);}else{var _0x2b51ff=this;utils['parser'](this['account'],_0x4f7731,function(_0x1545d4){_0x2b51ff[_0x9348('0x21')]('email',_0x1545d4);});}};EmailImap[_0x9348('0x15')]['handleFetchEnd']=function(){this[_0x9348('0xd')]['closeBox'](!![],this[_0x9348('0x2c')]['bind'](this));};EmailImap[_0x9348('0x15')][_0x9348('0x29')]=function(_0x34b0eb){this['handleError'](_0x34b0eb);this[_0x9348('0xd')][_0x9348('0x2b')](!![],this[_0x9348('0x2c')][_0x9348('0x12')](this));};EmailImap[_0x9348('0x15')][_0x9348('0x11')]=function(){this['emit']('end');};EmailImap[_0x9348('0x15')]['handleError']=function(_0x513275,_0x4cf8f3){logger['error'](_0x9348('0x13'),this[_0x9348('0xb')][_0x9348('0x32')],JSON[_0x9348('0x33')](_0x513275));var _0x6075b7='';if(_0x513275){if(_0x513275[_0x9348('0x34')]){_0x6075b7=_0x513275[_0x9348('0x34')];}else{for(var _0x12ec32 in _0x513275){if(_0x513275['hasOwnProperty'](_0x12ec32)){_0x6075b7+=_[_0x9348('0x35')](_0x12ec32)+':\x20'+_0x513275[_0x12ec32]+'\x0a';}}}}if(_0x4cf8f3){this[_0x9348('0xd')][_0x9348('0x10')]();}else{this[_0x9348('0x21')]('error',_0x6075b7);this['emit'](_0x9348('0x10'));}};module['exports']=EmailImap;
\ No newline at end of file
index a9cc0ad..7bee815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cd4=['verify','toString','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail'];(function(_0x414a4e,_0x181824){var _0x13025f=function(_0x395d93){while(--_0x395d93){_0x414a4e['push'](_0x414a4e['shift']());}};_0x13025f(++_0x181824);}(_0x9cd4,0x122));var _0x49cd=function(_0x17a754,_0x5f1052){_0x17a754=_0x17a754-0x0;var _0x545d3e=_0x9cd4[_0x17a754];return _0x545d3e;};'use strict';var nodemailer=require(_0x49cd('0x0'));var BPromise=require(_0x49cd('0x1'));var inlineBase64=require(_0x49cd('0x2'));function EmailSmtp(){}EmailSmtp[_0x49cd('0x3')][_0x49cd('0x4')]=function(_0x4f26f6,_0x5ce9f6){return new BPromise(function(_0x3be1f0,_0x31a125){var _0x45a52e=nodemailer[_0x49cd('0x5')](_0x4f26f6);_0x45a52e[_0x49cd('0x6')](_0x49cd('0x7'),inlineBase64());_0x45a52e[_0x49cd('0x8')](_0x5ce9f6,function(_0x1fa4af,_0x23cfdc){if(_0x1fa4af){_0x31a125(_0x1fa4af['toString']());}else{_0x3be1f0(_0x23cfdc);}});});};EmailSmtp[_0x49cd('0x3')][_0x49cd('0x9')]=function(_0x2f4ded){return new BPromise(function(_0x32d7ac,_0x578c5d){var _0x2694e7=nodemailer[_0x49cd('0x5')](_0x2f4ded);_0x2694e7[_0x49cd('0x9')](function(_0x2a5085,_0x521aab){if(_0x2a5085){_0x578c5d(_0x2a5085[_0x49cd('0xa')]());}else{if(_0x521aab){_0x32d7ac(_0x521aab);}else{_0x578c5d(_0x49cd('0xb'));}}});});};module[_0x49cd('0xc')]=EmailSmtp;
\ No newline at end of file
+var _0x0211=['send','use','sendMail','prototype','verify','toString','Not\x20verifired','exports'];(function(_0x371845,_0x59e055){var _0x3534fc=function(_0x40ed55){while(--_0x40ed55){_0x371845['push'](_0x371845['shift']());}};_0x3534fc(++_0x59e055);}(_0x0211,0x148));var _0x1021=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x0211[_0x4154a6];return _0x3b2786;};'use strict';var nodemailer=require('nodemailer');var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x1021('0x0')]=function(_0x274dc7,_0x2aaf4e){return new BPromise(function(_0x3caca8,_0x4ceba6){var _0x501127=nodemailer['createTransport'](_0x274dc7);_0x501127[_0x1021('0x1')]('compile',inlineBase64());_0x501127[_0x1021('0x2')](_0x2aaf4e,function(_0x118d7f,_0x538759){if(_0x118d7f){_0x4ceba6(_0x118d7f['toString']());}else{_0x3caca8(_0x538759);}});});};EmailSmtp[_0x1021('0x3')][_0x1021('0x4')]=function(_0x11a3ca){return new BPromise(function(_0x59673b,_0x117038){var _0x26f591=nodemailer['createTransport'](_0x11a3ca);_0x26f591['verify'](function(_0x196345,_0x1c1a12){if(_0x196345){_0x117038(_0x196345[_0x1021('0x5')]());}else{if(_0x1c1a12){_0x59673b(_0x1c1a12);}else{_0x117038(_0x1021('0x6'));}}});});};module[_0x1021('0x7')]=EmailSmtp;
\ No newline at end of file
index afd6c20..6dc6d47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fc5=['<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','includes','bcc','attachments','type','filename','format','%s-%s','root','server/files/attachments/','writeFileSync','content','contentType','from','subject','messageId','inReplyTo','date','textAsHtml','info','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','push','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','split','length','slice','join','Anonymous','name','pop','isEmpty','html','replace','body'];(function(_0x17c7ca,_0x7634){var _0x41684f=function(_0x35cb70){while(--_0x35cb70){_0x17c7ca['push'](_0x17c7ca['shift']());}};_0x41684f(++_0x7634);}(_0x3fc5,0xa7));var _0x53fc=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x3fc5[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x53fc('0x0'));var moment=require(_0x53fc('0x1'));var random=require(_0x53fc('0x2'));var fs=require('fs');var path=require(_0x53fc('0x3'));var util=require(_0x53fc('0x4'));var tnef=require(_0x53fc('0x5'));var logger=require(_0x53fc('0x6'))(_0x53fc('0x7'));var config=require(_0x53fc('0x8'));function getAddress(_0x4cae63){var _0x4891a8=_['head'](_0x4cae63[_0x53fc('0x9')]);return _0x4891a8&&_0x4891a8[_0x53fc('0xa')]?_0x4891a8[_0x53fc('0xa')]:_0x53fc('0xb')+random[_0x53fc('0xc')](0x6)+_0x53fc('0xd');}function getFirstName(_0x22cdae){var _0x1f0b16=_['head'](_0x22cdae[_0x53fc('0x9')]);if(_0x1f0b16&&_0x1f0b16['name']){var _0x47ee13=_0x1f0b16['name'][_0x53fc('0xe')](/\s+/);return _0x47ee13[_0x53fc('0xf')]?_0x47ee13[_0x53fc('0x10')](0x0,-0x1)[_0x53fc('0x11')]('\x20'):_0x1f0b16['name'];}return _0x53fc('0x12');}function getLastName(_0x5020ce){var _0x2b484c=_['head'](_0x5020ce['value']);if(_0x2b484c&&_0x2b484c[_0x53fc('0x13')]){var _0x33f7c9=_0x2b484c[_0x53fc('0x13')][_0x53fc('0xe')](/\s+/);return _0x33f7c9[_0x53fc('0xf')]>0x1?_0x33f7c9[_0x53fc('0x14')]():'';}return'';}function getMails(_0x27c3bf,_0xe9cf80){var _0x5a7e7c='';for(var _0x119040=0x0;_0x119040<_0xe9cf80[_0x53fc('0x9')][_0x53fc('0xf')];_0x119040+=0x1){if(_0xe9cf80[_0x53fc('0x9')][_0x119040][_0x53fc('0xa')]!==_0x27c3bf){if(!_[_0x53fc('0x15')](_0x5a7e7c)){_0x5a7e7c+=',';}_0x5a7e7c+=_0xe9cf80['value'][_0x119040][_0x53fc('0x13')]||_0xe9cf80[_0x53fc('0x9')][_0x119040][_0x53fc('0xa')]||'';_0x5a7e7c+='\x20<';_0x5a7e7c+=_0xe9cf80[_0x53fc('0x9')][_0x119040][_0x53fc('0xa')]?_0xe9cf80[_0x53fc('0x9')][_0x119040][_0x53fc('0xa')]:'anonymous'+random[_0x53fc('0xc')](0x6)+_0x53fc('0xd');_0x5a7e7c+='>';}}return _0x5a7e7c;}function parseEmail(_0x8a6849,_0x278dc7,_0x526a2e){if(_0x278dc7[_0x53fc('0x16')]){var _0x482492=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x482492['test'](_0x278dc7['html'])){_0x278dc7[_0x53fc('0x16')]=_0x278dc7[_0x53fc('0x16')][_0x53fc('0x17')](_0x482492,'');}_0x526a2e[_0x53fc('0x18')]=_0x278dc7[_0x53fc('0x16')];}else{_0x526a2e[_0x53fc('0x18')]=_0x278dc7['textAsHtml'];}if(_0x526a2e['body']){_0x526a2e[_0x53fc('0x18')]=_0x526a2e[_0x53fc('0x18')][_0x53fc('0x17')](/<a\s+/gi,_0x53fc('0x19'));}if(_0x278dc7['to']){_0x526a2e[_0x53fc('0x1a')][_0x53fc('0x1b')]=getMails(null,_0x278dc7['to']);var _0x54e513=getMails(_0x8a6849[_0x53fc('0x7')],_0x278dc7['to']);if(!_[_0x53fc('0x15')](_0x54e513)){_0x526a2e[_0x53fc('0x1a')]['cc']+=_0x54e513;}}if(_0x278dc7['cc']){_0x526a2e[_0x53fc('0x1a')][_0x53fc('0x1c')]=getMails(null,_0x278dc7['cc']);var _0x34bb09=getMails(_0x8a6849['email'],_0x278dc7['cc']);if(!_[_0x53fc('0x15')](_0x34bb09)){if(!_[_0x53fc('0x15')](_0x526a2e['message']['cc'])){_0x526a2e[_0x53fc('0x1a')]['cc']+=',';}_0x526a2e['message']['cc']+=_0x34bb09;}}if(!_[_0x53fc('0x1d')](_0x526a2e[_0x53fc('0x1a')]['originTo'],_0x8a6849[_0x53fc('0x7')])&&!_[_0x53fc('0x1d')](_0x526a2e[_0x53fc('0x1a')][_0x53fc('0x1c')],_0x8a6849[_0x53fc('0x7')])){_0x526a2e[_0x53fc('0x1a')][_0x53fc('0x1e')]=_0x8a6849[_0x53fc('0x7')];}if(_0x278dc7['attachments']&&_0x278dc7[_0x53fc('0x1f')][_0x53fc('0xf')]){_0x526a2e[_0x53fc('0x1a')]['attach']=_0x278dc7[_0x53fc('0x1f')]['length'];for(var _0x437d2c=0x0,_0x255655,_0x8910,_0x52c150;_0x437d2c<_0x278dc7[_0x53fc('0x1f')][_0x53fc('0xf')];_0x437d2c+=0x1){if(_0x278dc7[_0x53fc('0x1f')][_0x437d2c][_0x53fc('0x20')]==='attachment'){_0x52c150=_0x278dc7[_0x53fc('0x1f')][_0x437d2c][_0x53fc('0x21')]||'attachment-'+_0x437d2c;_0x255655=util[_0x53fc('0x22')](_0x53fc('0x23'),Date['now'](),_0x52c150);_0x8910=path['join'](config[_0x53fc('0x24')],_0x53fc('0x25'),_0x255655);fs[_0x53fc('0x26')](_0x8910,_0x278dc7['attachments'][_0x437d2c][_0x53fc('0x27')]);_0x526a2e[_0x53fc('0x1a')]['attachments']['push']({'name':_0x52c150,'basename':_0x255655,'type':_0x278dc7['attachments'][_0x437d2c][_0x53fc('0x28')],'filepath':_0x8910});}}}return _0x526a2e;}exports['parser']=function(_0xe68190,_0x362025,_0x48eecb){var _0x6d50ba={'from':getAddress(_0x362025[_0x53fc('0x29')]),'firstName':getFirstName(_0x362025['from']),'lastName':getLastName(_0x362025['from']),'mapKey':_0x53fc('0x7'),'message':{'from':getMails(_0xe68190['email'],_0x362025[_0x53fc('0x29')]),'to':_0xe68190['email'],'cc':'','subject':_0x362025[_0x53fc('0x2a')]||'','messageId':_0x362025[_0x53fc('0x2b')],'inReplyTo':_0x362025[_0x53fc('0x2c')],'sentAt':moment(_0x362025[_0x53fc('0x2d')])[_0x53fc('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x362025[_0x53fc('0x16')]&&!_0x362025[_0x53fc('0x2e')]){var _0x28e74b=_['filter'](_0x362025['attachments'],{'contentType':'application/ms-tnef'});if(_0x28e74b[_0x53fc('0xf')]){logger[_0x53fc('0x2f')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x362025[_0x53fc('0x2b')]));tnef[_0x53fc('0x30')](_[_0x53fc('0x31')](_0x28e74b)[_0x53fc('0x27')],function(_0x2a94d3,_0x1d608e){if(_0x1d608e){_0x362025[_0x53fc('0x16')]=_0x1d608e[_0x53fc('0x32')]||_0x53fc('0x33');if(_0x1d608e[_0x53fc('0x34')]){for(var _0x4e6ca9=0x0;_0x4e6ca9<_0x1d608e[_0x53fc('0x34')][_0x53fc('0xf')];_0x4e6ca9++){var _0x5a8434=_0x1d608e[_0x53fc('0x34')][_0x4e6ca9];_0x6d50ba[_0x53fc('0x1a')][_0x53fc('0x1f')][_0x53fc('0x35')]({'filename':_0x5a8434['Title'],'content':new Buffer(_0x5a8434[_0x53fc('0x36')])});}}}_0x48eecb(parseEmail(_0xe68190,_0x362025,_0x6d50ba));});}else{_0x362025['html']=_0x53fc('0x33');_0x48eecb(parseEmail(_0xe68190,_0x362025,_0x6d50ba));}}else{_0x48eecb(parseEmail(_0xe68190,_0x362025,_0x6d50ba));}};exports[_0x53fc('0x37')]=function(_0x2742a4){switch(_0x2742a4){case _0x53fc('0x38'):return _0x53fc('0x39');case _0x53fc('0x3a'):return _0x53fc('0x3b');case _0x53fc('0x3c'):return _0x53fc('0x3d');case _0x53fc('0x3e'):return _0x53fc('0x3f');}return'127.0.0.1';};
\ No newline at end of file
+var _0xa876=['type','filename','attachment-','root','server/files/attachments/','writeFileSync','content','push','contentType','from','messageId','inReplyTo','date','format','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','Attachments','Title','Data','<p>Empty\x20message</p>','getHost','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','path','util','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','split','slice','join','Anonymous','length','isEmpty','generate','html','test','replace','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','originCc','message','includes','bcc','attachments'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0xa876,0x10d));var _0x6a87=function(_0x2fdf18,_0x61958c){_0x2fdf18=_0x2fdf18-0x0;var _0x207782=_0xa876[_0x2fdf18];return _0x207782;};'use strict';var _=require(_0x6a87('0x0'));var moment=require(_0x6a87('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x6a87('0x2'));var util=require(_0x6a87('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x6a87('0x4'));var config=require(_0x6a87('0x5'));function getAddress(_0x350a4b){var _0xab757=_[_0x6a87('0x6')](_0x350a4b[_0x6a87('0x7')]);return _0xab757&&_0xab757[_0x6a87('0x8')]?_0xab757[_0x6a87('0x8')]:_0x6a87('0x9')+random['generate'](0x6)+_0x6a87('0xa');}function getFirstName(_0x2b2860){var _0xdda17e=_[_0x6a87('0x6')](_0x2b2860[_0x6a87('0x7')]);if(_0xdda17e&&_0xdda17e['name']){var _0x3a2761=_0xdda17e[_0x6a87('0xb')][_0x6a87('0xc')](/\s+/);return _0x3a2761['length']?_0x3a2761[_0x6a87('0xd')](0x0,-0x1)[_0x6a87('0xe')]('\x20'):_0xdda17e[_0x6a87('0xb')];}return _0x6a87('0xf');}function getLastName(_0x3f2ac5){var _0x48b8cc=_[_0x6a87('0x6')](_0x3f2ac5[_0x6a87('0x7')]);if(_0x48b8cc&&_0x48b8cc[_0x6a87('0xb')]){var _0x2e89ef=_0x48b8cc[_0x6a87('0xb')][_0x6a87('0xc')](/\s+/);return _0x2e89ef['length']>0x1?_0x2e89ef['pop']():'';}return'';}function getMails(_0xfa75f3,_0x5bdc75){var _0x59f81e='';for(var _0xf10141=0x0;_0xf10141<_0x5bdc75[_0x6a87('0x7')][_0x6a87('0x10')];_0xf10141+=0x1){if(_0x5bdc75[_0x6a87('0x7')][_0xf10141][_0x6a87('0x8')]!==_0xfa75f3){if(!_[_0x6a87('0x11')](_0x59f81e)){_0x59f81e+=',';}_0x59f81e+=_0x5bdc75['value'][_0xf10141][_0x6a87('0xb')]||_0x5bdc75[_0x6a87('0x7')][_0xf10141][_0x6a87('0x8')]||'';_0x59f81e+='\x20<';_0x59f81e+=_0x5bdc75['value'][_0xf10141][_0x6a87('0x8')]?_0x5bdc75['value'][_0xf10141][_0x6a87('0x8')]:_0x6a87('0x9')+random[_0x6a87('0x12')](0x6)+_0x6a87('0xa');_0x59f81e+='>';}}return _0x59f81e;}function parseEmail(_0x5498b4,_0x36ad70,_0x8e8ce){if(_0x36ad70[_0x6a87('0x13')]){var _0x19927e=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x19927e[_0x6a87('0x14')](_0x36ad70[_0x6a87('0x13')])){_0x36ad70[_0x6a87('0x13')]=_0x36ad70['html'][_0x6a87('0x15')](_0x19927e,'');}_0x8e8ce['body']=_0x36ad70['html'];}else{_0x8e8ce[_0x6a87('0x16')]=_0x36ad70[_0x6a87('0x17')];}if(_0x8e8ce['body']){_0x8e8ce[_0x6a87('0x16')]=_0x8e8ce['body'][_0x6a87('0x15')](/<a\s+/gi,_0x6a87('0x18'));}if(_0x36ad70['to']){_0x8e8ce['message'][_0x6a87('0x19')]=getMails(null,_0x36ad70['to']);var _0x5b7d6d=getMails(_0x5498b4['email'],_0x36ad70['to']);if(!_[_0x6a87('0x11')](_0x5b7d6d)){_0x8e8ce['message']['cc']+=_0x5b7d6d;}}if(_0x36ad70['cc']){_0x8e8ce['message'][_0x6a87('0x1a')]=getMails(null,_0x36ad70['cc']);var _0x52499c=getMails(_0x5498b4['email'],_0x36ad70['cc']);if(!_[_0x6a87('0x11')](_0x52499c)){if(!_['isEmpty'](_0x8e8ce[_0x6a87('0x1b')]['cc'])){_0x8e8ce['message']['cc']+=',';}_0x8e8ce[_0x6a87('0x1b')]['cc']+=_0x52499c;}}if(!_[_0x6a87('0x1c')](_0x8e8ce[_0x6a87('0x1b')][_0x6a87('0x19')],_0x5498b4[_0x6a87('0x4')])&&!_[_0x6a87('0x1c')](_0x8e8ce[_0x6a87('0x1b')][_0x6a87('0x1a')],_0x5498b4['email'])){_0x8e8ce[_0x6a87('0x1b')][_0x6a87('0x1d')]=_0x5498b4[_0x6a87('0x4')];}if(_0x36ad70[_0x6a87('0x1e')]&&_0x36ad70[_0x6a87('0x1e')][_0x6a87('0x10')]){_0x8e8ce[_0x6a87('0x1b')]['attach']=_0x36ad70[_0x6a87('0x1e')][_0x6a87('0x10')];for(var _0x1e0c47=0x0,_0x3f36ea,_0x4adeb4,_0x35d25f;_0x1e0c47<_0x36ad70['attachments']['length'];_0x1e0c47+=0x1){if(_0x36ad70[_0x6a87('0x1e')][_0x1e0c47][_0x6a87('0x1f')]==='attachment'){_0x35d25f=_0x36ad70[_0x6a87('0x1e')][_0x1e0c47][_0x6a87('0x20')]||_0x6a87('0x21')+_0x1e0c47;_0x3f36ea=util['format']('%s-%s',Date['now'](),_0x35d25f);_0x4adeb4=path['join'](config[_0x6a87('0x22')],_0x6a87('0x23'),_0x3f36ea);fs[_0x6a87('0x24')](_0x4adeb4,_0x36ad70['attachments'][_0x1e0c47][_0x6a87('0x25')]);_0x8e8ce[_0x6a87('0x1b')][_0x6a87('0x1e')][_0x6a87('0x26')]({'name':_0x35d25f,'basename':_0x3f36ea,'type':_0x36ad70[_0x6a87('0x1e')][_0x1e0c47][_0x6a87('0x27')],'filepath':_0x4adeb4});}}}return _0x8e8ce;}exports['parser']=function(_0x5feee7,_0x296ac9,_0x5ef316){var _0x416242={'from':getAddress(_0x296ac9[_0x6a87('0x28')]),'firstName':getFirstName(_0x296ac9[_0x6a87('0x28')]),'lastName':getLastName(_0x296ac9[_0x6a87('0x28')]),'mapKey':'email','message':{'from':getMails(_0x5feee7['email'],_0x296ac9[_0x6a87('0x28')]),'to':_0x5feee7[_0x6a87('0x4')],'cc':'','subject':_0x296ac9['subject']||'','messageId':_0x296ac9[_0x6a87('0x29')],'inReplyTo':_0x296ac9[_0x6a87('0x2a')],'sentAt':moment(_0x296ac9[_0x6a87('0x2b')])[_0x6a87('0x2c')](_0x6a87('0x2d')),'attach':![],'attachments':[]}};if(!_0x296ac9[_0x6a87('0x13')]&&!_0x296ac9[_0x6a87('0x17')]){var _0x1515c0=_['filter'](_0x296ac9[_0x6a87('0x1e')],{'contentType':'application/ms-tnef'});if(_0x1515c0[_0x6a87('0x10')]){logger[_0x6a87('0x2e')](util[_0x6a87('0x2c')](_0x6a87('0x2f'),_0x296ac9['messageId']));tnef[_0x6a87('0x30')](_[_0x6a87('0x31')](_0x1515c0)[_0x6a87('0x25')],function(_0x440644,_0x2fd0fa){if(_0x2fd0fa){_0x296ac9[_0x6a87('0x13')]=_0x2fd0fa['BodyHTML']||'<p>Empty\x20message</p>';if(_0x2fd0fa[_0x6a87('0x32')]){for(var _0x124d47=0x0;_0x124d47<_0x2fd0fa[_0x6a87('0x32')][_0x6a87('0x10')];_0x124d47++){var _0x448dfc=_0x2fd0fa[_0x6a87('0x32')][_0x124d47];_0x416242['message']['attachments'][_0x6a87('0x26')]({'filename':_0x448dfc[_0x6a87('0x33')],'content':new Buffer(_0x448dfc[_0x6a87('0x34')])});}}}_0x5ef316(parseEmail(_0x5feee7,_0x296ac9,_0x416242));});}else{_0x296ac9[_0x6a87('0x13')]=_0x6a87('0x35');_0x5ef316(parseEmail(_0x5feee7,_0x296ac9,_0x416242));}}else{_0x5ef316(parseEmail(_0x5feee7,_0x296ac9,_0x416242));}};exports[_0x6a87('0x36')]=function(_0x4f7674){switch(_0x4f7674){case'gmail':return'imap.gmail.com';case _0x6a87('0x37'):return'imap.mail.yahoo.com';case _0x6a87('0x38'):return _0x6a87('0x39');case _0x6a87('0x3a'):return _0x6a87('0x3b');}return'127.0.0.1';};
\ No newline at end of file
index e5ca7e6..f7d2483 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c27=['active','Imap','Smtp','exports','lodash','name','Service','key','SERV'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4c27,0x13f));var _0x74c2=function(_0x2cc437,_0x38d62f){_0x2cc437=_0x2cc437-0x0;var _0x40e2fd=_0x4c27[_0x2cc437];return _0x40e2fd;};'use strict';var _=require(_0x74c2('0x0'));function MailAccount(_0x3cef87){this['id']=_0x3cef87['id']||0x0;this['name']=_0x3cef87[_0x74c2('0x1')]||_0x74c2('0x2');this['key']=_0x3cef87[_0x74c2('0x3')]||_0x74c2('0x4');this['active']=_0x3cef87[_0x74c2('0x5')]||![];this[_0x74c2('0x6')]=_0x3cef87[_0x74c2('0x6')]||[];this[_0x74c2('0x7')]=_0x3cef87[_0x74c2('0x7')]||[];}module[_0x74c2('0x8')]=MailAccount;
\ No newline at end of file
+var _0xa35b=['key','SERV','active','Imap','Smtp','lodash','name','Service'];(function(_0x2116b8,_0x5bcb07){var _0x342fff=function(_0x5e72a6){while(--_0x5e72a6){_0x2116b8['push'](_0x2116b8['shift']());}};_0x342fff(++_0x5bcb07);}(_0xa35b,0x17d));var _0xba35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa35b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xba35('0x0'));function MailAccount(_0xd3f47d){this['id']=_0xd3f47d['id']||0x0;this[_0xba35('0x1')]=_0xd3f47d[_0xba35('0x1')]||_0xba35('0x2');this['key']=_0xd3f47d[_0xba35('0x3')]||_0xba35('0x4');this[_0xba35('0x5')]=_0xd3f47d[_0xba35('0x5')]||![];this[_0xba35('0x6')]=_0xd3f47d[_0xba35('0x6')]||[];this[_0xba35('0x7')]=_0xd3f47d[_0xba35('0x7')]||[];}module['exports']=MailAccount;
\ No newline at end of file
index 4bd15d3..c7b0964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc3d=['exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','length','isUndefined'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcc3d,0x106));var _0xdcc3=function(_0x4fe747,_0x197dd7){_0x4fe747=_0x4fe747-0x0;var _0x15549f=_0xcc3d[_0x4fe747];return _0x15549f;};'use strict';var _=require('lodash');var MailAccount=require(_0xdcc3('0x0'));var Realtime=function(){this[_0xdcc3('0x1')]={};};function freeIsNotKey(_0x1ae328,_0x3dc589,_0x5bf68d){var _0xf30cb9=_[_0xdcc3('0x2')](_0x1ae328,function(_0x54e2f9,_0xb53be0){return _0x54e2f9[_0x5bf68d];});for(var _0x28ef32 in _0x3dc589){if(_0x3dc589[_0xdcc3('0x3')](_0x28ef32)){if(!_0xf30cb9[_0x28ef32]){delete _0x3dc589[_0x28ef32];}}}}Realtime['prototype'][_0xdcc3('0x4')]=function(_0x179b70,_0x3b65e0){for(var _0x10cddc in _0x3b65e0){if(_0x179b70[_0xdcc3('0x3')](_0x10cddc)){_0x179b70[_0x10cddc]=_0x3b65e0[_0x10cddc];}}};Realtime[_0xdcc3('0x5')]['initMailAccounts']=function(){var _0x11fe8f=this;return function(_0x35ee2f){if(_0x35ee2f){freeIsNotKey(_0x35ee2f,_0x11fe8f[_0xdcc3('0x1')],'id');for(var _0xb0400a=0x0,_0x58980c={},_0xcf2a51={};_0xb0400a<_0x35ee2f[_0xdcc3('0x6')];_0xb0400a+=0x1){_0x58980c=_0x35ee2f[_0xb0400a];if(_[_0xdcc3('0x7')](_0x11fe8f[_0xdcc3('0x1')][_0x58980c['id']])){_0x11fe8f['mailAccounts'][_0x58980c['id']]=new MailAccount(_0x58980c);}else{_['merge'](_0x11fe8f[_0xdcc3('0x1')][_0x58980c['id']],_0x58980c);}}}return _0x11fe8f[_0xdcc3('0x1')];};};module[_0xdcc3('0x8')]=Realtime;
\ No newline at end of file
+var _0x8be4=['mergeFromDatabase','initMailAccounts','mailAccounts','length','merge','exports','lodash','hasOwnProperty','prototype'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x8be4,0x15c));var _0x48be=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x8be4[_0x3e961c];return _0x474f9c;};'use strict';var _=require(_0x48be('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x20b7e3,_0x3236eb,_0x31cedf){var _0x15a2bf=_['mapKeys'](_0x20b7e3,function(_0x1a8e7e,_0x3ceb71){return _0x1a8e7e[_0x31cedf];});for(var _0x1a1c1c in _0x3236eb){if(_0x3236eb[_0x48be('0x1')](_0x1a1c1c)){if(!_0x15a2bf[_0x1a1c1c]){delete _0x3236eb[_0x1a1c1c];}}}}Realtime[_0x48be('0x2')][_0x48be('0x3')]=function(_0x166f4b,_0x553cce){for(var _0x49298c in _0x553cce){if(_0x166f4b[_0x48be('0x1')](_0x49298c)){_0x166f4b[_0x49298c]=_0x553cce[_0x49298c];}}};Realtime['prototype'][_0x48be('0x4')]=function(){var _0x586e00=this;return function(_0xa5dee4){if(_0xa5dee4){freeIsNotKey(_0xa5dee4,_0x586e00[_0x48be('0x5')],'id');for(var _0x288245=0x0,_0x27808a={},_0x1aead4={};_0x288245<_0xa5dee4[_0x48be('0x6')];_0x288245+=0x1){_0x27808a=_0xa5dee4[_0x288245];if(_['isUndefined'](_0x586e00['mailAccounts'][_0x27808a['id']])){_0x586e00['mailAccounts'][_0x27808a['id']]=new MailAccount(_0x27808a);}else{_[_0x48be('0x7')](_0x586e00[_0x48be('0x5')][_0x27808a['id']],_0x27808a);}}}return _0x586e00['mailAccounts'];};};module[_0x48be('0x8')]=Realtime;
\ No newline at end of file
index 30f36a8..8e36c93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4745=['ListId','TemplateId','MailServerIn','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','active','key'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4745,0x1e7));var _0x5474=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x4745[_0x187ee1];return _0x388160;};'use strict';var client=require(_0x5474('0x0'));exports[_0x5474('0x1')]=function(){return function(){return client[_0x5474('0x2')](_0x5474('0x3'),{'options':{'attributes':['id',_0x5474('0x4'),_0x5474('0x5'),_0x5474('0x6'),_0x5474('0x7'),_0x5474('0x8'),_0x5474('0x9'),_0x5474('0xa')],'raw':![],'include':[{'model':_0x5474('0xb'),'as':'Imap'},{'model':_0x5474('0xc'),'as':_0x5474('0xd')}]},'log':'getMailAccount'});};};exports[_0x5474('0xe')]=function(_0x5d778b,_0x902ba8){return client[_0x5474('0x2')]('NotifyMailAccount',{'account':{'id':_0x5d778b},'body':_0x902ba8,'log':_0x5474('0xf')});};
\ No newline at end of file
+var _0x3a0f=['Request','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','Smtp','getMailAccount','notify','NotifyMailAccount'];(function(_0x411a5b,_0x4235ce){var _0x4fc3a3=function(_0x4a85de){while(--_0x4a85de){_0x411a5b['push'](_0x411a5b['shift']());}};_0x4fc3a3(++_0x4235ce);}(_0x3a0f,0x145));var _0xf3a0=function(_0x2dbdc1,_0x997346){_0x2dbdc1=_0x2dbdc1-0x0;var _0x169411=_0x3a0f[_0x2dbdc1];return _0x169411;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0xf3a0('0x0')]('GetMailAccount',{'options':{'attributes':['id','name',_0xf3a0('0x1'),_0xf3a0('0x2'),_0xf3a0('0x3'),_0xf3a0('0x4'),_0xf3a0('0x5'),_0xf3a0('0x6')],'raw':![],'include':[{'model':_0xf3a0('0x7'),'as':_0xf3a0('0x8')},{'model':'MailServerOut','as':_0xf3a0('0x9')}]},'log':_0xf3a0('0xa')});};};exports[_0xf3a0('0xb')]=function(_0xb2784d,_0x5d64bc){return client[_0xf3a0('0x0')](_0xf3a0('0xc'),{'account':{'id':_0xb2784d},'body':_0x5d64bc,'log':_0xf3a0('0xc')});};
\ No newline at end of file
index d1511bc..e2dbdc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x997d=['verifySmtp','values','mailAccounts','length','Imap','password','Smtp','pass','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','../../../config/logger','email','listen','sendMail','message','then','catch'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x997d,0x121));var _0xd997=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0x997d[_0x1d8119];return _0x3e30f6;};'use strict';var jayson=require(_0xd997('0x0'));var BPromise=require(_0xd997('0x1'));var _=require(_0xd997('0x2'));var logger=require(_0xd997('0x3'))(_0xd997('0x4'));exports[_0xd997('0x5')]=function(_0x518d3f,_0x59aa3a){return new BPromise(function(_0xbfdda4,_0x2bcbb8){var _0x9beeb8={'SendMail':function(_0x49a029){var _0x6ac553=this;return new Promise(function(_0x6185cd,_0x3c39fa){_0x59aa3a[_0xd997('0x6')](_0x49a029['account'],_0x49a029[_0xd997('0x7')])[_0xd997('0x8')](function(_0x3dd514){_0x6185cd({'code':0xc8,'message':_0x3dd514});})[_0xd997('0x9')](function(_0x2087d4){_0x3c39fa(_0x6ac553['error'](0x1f4,_0x2087d4));});});},'VerifySmtp':function(_0x18ed59){var _0x205141=this;return new Promise(function(_0x29f7ec,_0x3ca365){_0x59aa3a[_0xd997('0xa')](_0x18ed59['account'])[_0xd997('0x8')](function(_0x3e2533){_0x29f7ec({'code':0xc8,'message':'Verified'});})[_0xd997('0x9')](function(_0x2c9a86){_0x3ca365(_0x205141['error'](0x1f4,_0x2c9a86));});});},'MailAccounts':function(_0x54664a){return new Promise(function(_0x1d4746,_0x501c13){var _0xf2c98c=_[_0xd997('0xb')](_0x518d3f[_0xd997('0xc')]);for(var _0x3b9d3f=0x0;_0x3b9d3f<_0xf2c98c[_0xd997('0xd')];_0x3b9d3f+=0x1){if(_0xf2c98c[_0x3b9d3f][_0xd997('0xe')]&&_0xf2c98c[_0x3b9d3f][_0xd997('0xe')][_0xd997('0xf')]){delete _0xf2c98c[_0x3b9d3f][_0xd997('0xe')][_0xd997('0xf')];}if(_0xf2c98c[_0x3b9d3f]['Smtp']&&_0xf2c98c[_0x3b9d3f][_0xd997('0x10')][_0xd997('0x11')]){delete _0xf2c98c[_0x3b9d3f][_0xd997('0x10')]['pass'];}}_0x1d4746({'count':_0xf2c98c[_0xd997('0xd')],'rows':_0xf2c98c});});}};var _0x5e7b3d=jayson['server'](_0x9beeb8)['http']();_0x5e7b3d['on']('error',function(_0x47591f){logger['error'](JSON[_0xd997('0x12')](_0x47591f));return _0x2bcbb8(_0x47591f);});_0x5e7b3d['listen'](0x232b,_0xd997('0x13'),function(){console[_0xd997('0x14')](_0xd997('0x15'),0x232b);return _0xbfdda4(_0xd997('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa210=['Imap','password','Smtp','pass','server','stringify','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','email','listen','sendMail','message','then','catch','verifySmtp','account','error','values','mailAccounts','length'];(function(_0x1bf1e3,_0x48506e){var _0x4955d7=function(_0x553eab){while(--_0x553eab){_0x1bf1e3['push'](_0x1bf1e3['shift']());}};_0x4955d7(++_0x48506e);}(_0xa210,0x141));var _0x0a21=function(_0x38af75,_0x33972b){_0x38af75=_0x38af75-0x0;var _0xba0aa=_0xa210[_0x38af75];return _0xba0aa;};'use strict';var jayson=require(_0x0a21('0x0'));var BPromise=require(_0x0a21('0x1'));var _=require(_0x0a21('0x2'));var logger=require('../../../config/logger')(_0x0a21('0x3'));exports[_0x0a21('0x4')]=function(_0x21fd92,_0x583d1a){return new BPromise(function(_0x4942e9,_0x204c68){var _0x2e508f={'SendMail':function(_0x4329c7){var _0x4a56f8=this;return new Promise(function(_0x3fddd6,_0x4d6cd7){_0x583d1a[_0x0a21('0x5')](_0x4329c7['account'],_0x4329c7[_0x0a21('0x6')])[_0x0a21('0x7')](function(_0x1c136c){_0x3fddd6({'code':0xc8,'message':_0x1c136c});})[_0x0a21('0x8')](function(_0x3b64ad){_0x4d6cd7(_0x4a56f8['error'](0x1f4,_0x3b64ad));});});},'VerifySmtp':function(_0x4fc000){var _0x488ef4=this;return new Promise(function(_0x212ba5,_0x8aff3b){_0x583d1a[_0x0a21('0x9')](_0x4fc000[_0x0a21('0xa')])[_0x0a21('0x7')](function(_0x1db9a3){_0x212ba5({'code':0xc8,'message':'Verified'});})['catch'](function(_0x2c259f){_0x8aff3b(_0x488ef4[_0x0a21('0xb')](0x1f4,_0x2c259f));});});},'MailAccounts':function(_0x5344f8){return new Promise(function(_0x578b15,_0x26c765){var _0x4abaf2=_[_0x0a21('0xc')](_0x21fd92[_0x0a21('0xd')]);for(var _0x38a9c3=0x0;_0x38a9c3<_0x4abaf2[_0x0a21('0xe')];_0x38a9c3+=0x1){if(_0x4abaf2[_0x38a9c3][_0x0a21('0xf')]&&_0x4abaf2[_0x38a9c3][_0x0a21('0xf')][_0x0a21('0x10')]){delete _0x4abaf2[_0x38a9c3][_0x0a21('0xf')][_0x0a21('0x10')];}if(_0x4abaf2[_0x38a9c3][_0x0a21('0x11')]&&_0x4abaf2[_0x38a9c3][_0x0a21('0x11')][_0x0a21('0x12')]){delete _0x4abaf2[_0x38a9c3]['Smtp'][_0x0a21('0x12')];}}_0x578b15({'count':_0x4abaf2['length'],'rows':_0x4abaf2});});}};var _0x33c149=jayson[_0x0a21('0x13')](_0x2e508f)['http']();_0x33c149['on'](_0x0a21('0xb'),function(_0x326916){logger[_0x0a21('0xb')](JSON[_0x0a21('0x14')](_0x326916));return _0x204c68(_0x326916);});_0x33c149[_0x0a21('0x4')](0x232b,'127.0.0.1',function(){console[_0x0a21('0x15')](_0x0a21('0x16'),0x232b);return _0x4942e9(_0x0a21('0x17')+0x232b);});});};
\ No newline at end of file
index ce6781b..61af87c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75a9=['localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','http','express','ioredis','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75a9,0xc3));var _0x975a=function(_0x1df973,_0x2e7efd){_0x1df973=_0x1df973-0x0;var _0x59ccb0=_0x75a9[_0x1df973];return _0x59ccb0;};'use strict';var _=require('lodash');var http=require(_0x975a('0x0'));var express=require(_0x975a('0x1'));var sticky=require('sticky-session');var Redis=require(_0x975a('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0x975a('0x3')](app);server[_0x975a('0x4')]=0xdbba0;if(sticky[_0x975a('0x5')](server,config[_0x975a('0x6')])){var socketio=require(_0x975a('0x7'))(server,{'transports':[_0x975a('0x8'),_0x975a('0x9')]});config[_0x975a('0xa')]=_[_0x975a('0xb')](config['redis'],{'host':_0x975a('0xc'),'port':0x18eb});socketio[_0x975a('0xd')](require(_0x975a('0xe'))({'pubClient':new Redis(config[_0x975a('0xa')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x975a('0xf')]();require(_0x975a('0x10'))[_0x975a('0xf')](socketio);require(_0x975a('0x11'))[_0x975a('0xf')](app);require(_0x975a('0x12'))['default'](app);}else{server[_0x975a('0x13')](_0x975a('0x14'),function(){console[_0x975a('0x15')](_0x975a('0x16'),config[_0x975a('0x6')]);});}exports=module['exports']=app;
\ No newline at end of file
+var _0xe8d3=['listen','port','socket.io','websocket','polling','defaults','localhost','adapter','socket.io-redis','redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','../../config/environment','createServer','timeout'];(function(_0x23d2e9,_0x52da13){var _0x36fe73=function(_0x5abada){while(--_0x5abada){_0x23d2e9['push'](_0x23d2e9['shift']());}};_0x36fe73(++_0x52da13);}(_0xe8d3,0x157));var _0x3e8d=function(_0x405323,_0x1aa3ed){_0x405323=_0x405323-0x0;var _0x4dd4fd=_0xe8d3[_0x405323];return _0x4dd4fd;};'use strict';var _=require(_0x3e8d('0x0'));var http=require(_0x3e8d('0x1'));var express=require(_0x3e8d('0x2'));var sticky=require(_0x3e8d('0x3'));var Redis=require('ioredis');var config=require(_0x3e8d('0x4'));var app=express();var server=http[_0x3e8d('0x5')](app);server[_0x3e8d('0x6')]=0xdbba0;if(sticky[_0x3e8d('0x7')](server,config[_0x3e8d('0x8')])){var socketio=require(_0x3e8d('0x9'))(server,{'transports':[_0x3e8d('0xa'),_0x3e8d('0xb')]});config['redis']=_[_0x3e8d('0xc')](config['redis'],{'host':_0x3e8d('0xd'),'port':0x18eb});socketio[_0x3e8d('0xe')](require(_0x3e8d('0xf'))({'pubClient':new Redis(config[_0x3e8d('0x10')]),'subClient':new Redis(config[_0x3e8d('0x10')])}));require(_0x3e8d('0x11'))['default']();require(_0x3e8d('0x12'))[_0x3e8d('0x13')](socketio);require(_0x3e8d('0x14'))[_0x3e8d('0x13')](app);require(_0x3e8d('0x15'))['default'](app);}else{server['once'](_0x3e8d('0x16'),function(){console[_0x3e8d('0x17')](_0x3e8d('0x18'),config[_0x3e8d('0x8')]);});}exports=module['exports']=app;
\ No newline at end of file
index 589b91d..2b3f824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d6a=['rpc','error','message','catch','exports','jayson/promise','bluebird','routing','client','http','Request','request','then','debug'];(function(_0x29de96,_0x42cc38){var _0x1b9352=function(_0x4a288a){while(--_0x4a288a){_0x29de96['push'](_0x29de96['shift']());}};_0x1b9352(++_0x42cc38);}(_0x0d6a,0xc9));var _0xa0d6=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x0d6a[_0x4e9d3c];return _0x2d0825;};'use strict';var jayson=require(_0xa0d6('0x0'));var BPromise=require(_0xa0d6('0x1'));var logger=require('../../config/logger')(_0xa0d6('0x2'));var client=jayson[_0xa0d6('0x3')][_0xa0d6('0x4')]({'port':0x2329});client[_0xa0d6('0x5')]=function(_0x71d654,_0x236047){return new BPromise(function(_0x344b8d,_0x3454b6){return client[_0xa0d6('0x6')](_0x71d654,_0x236047)[_0xa0d6('0x7')](function(_0x4857ce){logger[_0xa0d6('0x8')](_0xa0d6('0x9'),_0xa0d6('0x2'),_0x71d654,_0x236047,_0x4857ce);if(_0x4857ce[_0xa0d6('0xa')]){logger[_0xa0d6('0xa')]('rpc',_0xa0d6('0x2'),_0x71d654,_0x4857ce['error'][_0xa0d6('0xb')],_0x236047);return _0x3454b6(_0x4857ce['error'][_0xa0d6('0xb')]);}else{return _0x344b8d(_0x4857ce['result']);}})[_0xa0d6('0xc')](function(_0x831250){logger[_0xa0d6('0xa')](_0xa0d6('0x9'),_0xa0d6('0x2'),_0x71d654,_0x831250,_0x236047);return _0x3454b6(_0x831250);});});};module[_0xa0d6('0xd')]=client;
\ No newline at end of file
+var _0xf776=['http','Request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf776,0x169));var _0x6f77=function(_0x38ea06,_0x131d20){_0x38ea06=_0x38ea06-0x0;var _0x516abd=_0xf776[_0x38ea06];return _0x516abd;};'use strict';var jayson=require(_0x6f77('0x0'));var BPromise=require('bluebird');var logger=require(_0x6f77('0x1'))(_0x6f77('0x2'));var client=jayson['client'][_0x6f77('0x3')]({'port':0x2329});client[_0x6f77('0x4')]=function(_0x3897be,_0x16874b){return new BPromise(function(_0x53ec9b,_0xf025ec){return client['request'](_0x3897be,_0x16874b)[_0x6f77('0x5')](function(_0x21909a){logger[_0x6f77('0x6')](_0x6f77('0x7'),'routing',_0x3897be,_0x16874b,_0x21909a);if(_0x21909a[_0x6f77('0x8')]){logger['error'](_0x6f77('0x7'),_0x6f77('0x2'),_0x3897be,_0x21909a[_0x6f77('0x8')][_0x6f77('0x9')],_0x16874b);return _0xf025ec(_0x21909a['error'][_0x6f77('0x9')]);}else{return _0x53ec9b(_0x21909a[_0x6f77('0xa')]);}})[_0x6f77('0xb')](function(_0x288848){logger[_0x6f77('0x8')](_0x6f77('0x7'),'routing',_0x3897be,_0x288848,_0x16874b);return _0xf025ec(_0x288848);});});};module[_0x6f77('0xc')]=client;
\ No newline at end of file
index d8a7f9a..21a335f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b37=['initWhatsappQueues','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues'];(function(_0xd0e84,_0x126b42){var _0x57e202=function(_0x34f3df){while(--_0x34f3df){_0xd0e84['push'](_0xd0e84['shift']());}};_0x57e202(++_0x126b42);}(_0x5b37,0x13b));var _0x75b3=function(_0x5252a1,_0x32b917){_0x5252a1=_0x5252a1-0x0;var _0x39973f=_0x5b37[_0x5252a1];return _0x39973f;};'use strict';var BPromise=require('bluebird');var server=require(_0x75b3('0x0'));var Realtime=require(_0x75b3('0x1'));var user=require(_0x75b3('0x2'));var interval=require(_0x75b3('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x75b3('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x75b3('0x5'));var faxQueue=require(_0x75b3('0x6'));var whatsappQueue=require(_0x75b3('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x75b3('0x8')]()['then'](user[_0x75b3('0x9')]())[_0x75b3('0xa')](realtime[_0x75b3('0xb')]())['then'](interval[_0x75b3('0xc')]())[_0x75b3('0xa')](realtime[_0x75b3('0xd')]())[_0x75b3('0xa')](openchannelQueue[_0x75b3('0xe')]())['then'](realtime[_0x75b3('0xf')]())[_0x75b3('0xa')](chatQueue[_0x75b3('0x10')]())[_0x75b3('0xa')](realtime[_0x75b3('0x11')]())['then'](smsQueue['getSmsQueues']())[_0x75b3('0xa')](realtime['initSmsQueues']())['then'](mailQueue[_0x75b3('0x12')]())[_0x75b3('0xa')](realtime[_0x75b3('0x13')]())['then'](faxQueue[_0x75b3('0x14')]())[_0x75b3('0xa')](realtime[_0x75b3('0x15')]())[_0x75b3('0xa')](whatsappQueue[_0x75b3('0x16')]())[_0x75b3('0xa')](realtime[_0x75b3('0x17')]())[_0x75b3('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x75b3('0xa')](function(_0x255bba){return initRealtime();})[_0x75b3('0xa')](function(_0x172009){return setInterval(initRealtime,0x1388);})[_0x75b3('0x18')](function(_0x5d1042){console[_0x75b3('0x19')](_0x5d1042);});}main();
\ No newline at end of file
+var _0x503f=['getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','listen','log','bluebird','./server','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents'];(function(_0x380f16,_0xa4a25d){var _0x4f652c=function(_0x14633f){while(--_0x14633f){_0x380f16['push'](_0x380f16['shift']());}};_0x4f652c(++_0xa4a25d);}(_0x503f,0x8a));var _0xf503=function(_0x13e843,_0x3179d7){_0x13e843=_0x13e843-0x0;var _0xc53867=_0x503f[_0x13e843];return _0xc53867;};'use strict';var BPromise=require(_0xf503('0x0'));var server=require(_0xf503('0x1'));var Realtime=require('./realtime');var user=require(_0xf503('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xf503('0x3'));var chatQueue=require(_0xf503('0x4'));var smsQueue=require(_0xf503('0x5'));var mailQueue=require(_0xf503('0x6'));var faxQueue=require(_0xf503('0x7'));var whatsappQueue=require(_0xf503('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xf503('0x9')](user[_0xf503('0xa')]())['then'](realtime[_0xf503('0xb')]())[_0xf503('0x9')](interval[_0xf503('0xc')]())[_0xf503('0x9')](realtime[_0xf503('0xd')]())[_0xf503('0x9')](openchannelQueue[_0xf503('0xe')]())['then'](realtime[_0xf503('0xf')]())[_0xf503('0x9')](chatQueue['getChatQueues']())['then'](realtime[_0xf503('0x10')]())['then'](smsQueue[_0xf503('0x11')]())[_0xf503('0x9')](realtime[_0xf503('0x12')]())['then'](mailQueue[_0xf503('0x13')]())[_0xf503('0x9')](realtime[_0xf503('0x14')]())[_0xf503('0x9')](faxQueue[_0xf503('0x15')]())[_0xf503('0x9')](realtime[_0xf503('0x16')]())[_0xf503('0x9')](whatsappQueue['getWhatsappQueues']())[_0xf503('0x9')](realtime['initWhatsappQueues']())[_0xf503('0x9')](function(){return realtime;});}function main(){return server[_0xf503('0x17')](realtime)['then'](function(_0x144aad){return initRealtime();})[_0xf503('0x9')](function(_0x230ae8){return setInterval(initRealtime,0x1388);})['catch'](function(_0x47d4b2){console[_0xf503('0x18')](_0x47d4b2);});}main();
\ No newline at end of file
index 4d65dc9..c86d8dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1b=['orderBy','asc','result','consequence','name','nextTick','push','ruleRef','call','isEqual','clone','restart','length','condition','matchPath','noop','findRules','turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','ignoreFactChanges','inherits','prototype','rules','register','isArray','isObject','sync','filter','isNil','activeRules'];(function(_0xfdaafd,_0x3a554a){var _0x36ca96=function(_0x149caf){while(--_0x149caf){_0xfdaafd['push'](_0xfdaafd['shift']());}};_0x36ca96(++_0x3a554a);}(_0xaf1b,0xbf));var _0xbaf1=function(_0x3243bb,_0x508137){_0x3243bb=_0x3243bb-0x0;var _0x17c1d4=_0xaf1b[_0x3243bb];return _0x17c1d4;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var EventEmitter=require(_0xbaf1('0x2'))['EventEmitter'];function RuleEngine(_0x3df919,_0x191493){this['init']();if(!_['isNil'](_0x3df919)){this['register'](_0x3df919);}if(_0x191493){this[_0xbaf1('0x3')]=_0x191493[_0xbaf1('0x3')];}return this;}util[_0xbaf1('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbaf1('0x5')]['init']=function(_0x5d23e5){this[_0xbaf1('0x6')]=[];this['activeRules']=[];};RuleEngine[_0xbaf1('0x5')][_0xbaf1('0x7')]=function(_0x17f0af){if(Array[_0xbaf1('0x8')](_0x17f0af)){this['rules']=this[_0xbaf1('0x6')]['concat'](_0x17f0af);}else if(_0x17f0af!==null&&_[_0xbaf1('0x9')](_0x17f0af)){this[_0xbaf1('0x6')]['push'](_0x17f0af);}this[_0xbaf1('0xa')]();};RuleEngine[_0xbaf1('0x5')][_0xbaf1('0xa')]=function(){this['activeRules']=this[_0xbaf1('0x6')][_0xbaf1('0xb')](function(_0x3f8985){if(_[_0xbaf1('0xc')](_0x3f8985['on'])){_0x3f8985['on']=!![];}if(_0x3f8985['on']===!![]){return _0x3f8985;}});this[_0xbaf1('0xd')]=_[_0xbaf1('0xe')](this[_0xbaf1('0xd')],['p'],[_0xbaf1('0xf')]);};RuleEngine['prototype']['execute']=function(_0x5aa580,_0x3f197a){var _0x3376d9=![];_0x5aa580[_0xbaf1('0x10')]=!![];var _0x5209ed=_['clone'](_0x5aa580);var _0x2e3cd4=_['clone'](_0x5aa580);var _0x149673=this['activeRules'];var _0x1d4b0c=[];var _0x279bf9=this[_0xbaf1('0x3')];(function FnRuleLoop(_0x42031c){var _0x3b23c5={'rules':function(){return _0x149673;},'rule':function(){return _0x149673[_0x42031c];},'when':function(_0x5c9d7a){if(_0x5c9d7a){var _0x337eb1=_0x149673[_0x42031c][_0xbaf1('0x11')];_0x337eb1['ruleRef']=_0x149673[_0x42031c]['id']||_0x149673[_0x42031c][_0xbaf1('0x12')]||'index_'+_0x42031c;process[_0xbaf1('0x13')](function(){_0x1d4b0c[_0xbaf1('0x14')](_0x337eb1[_0xbaf1('0x15')]);_0x337eb1[_0xbaf1('0x16')](_0x5209ed,_0x3b23c5);});}else{process[_0xbaf1('0x13')](function(){_0x3b23c5['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x3376d9=!![];return FnRuleLoop(0x0);},'next':function(_0x27842c){if(!_0x279bf9&&!_[_0xbaf1('0x17')](_0x2e3cd4,_0x5209ed)){_0x2e3cd4=_[_0xbaf1('0x18')](_0x5209ed);process[_0xbaf1('0x13')](function(){_0x3b23c5[_0xbaf1('0x19')]();});}else{process['nextTick'](function(){if(_[_0xbaf1('0xc')](_0x27842c)){return FnRuleLoop(_0x42031c+0x1);}else{return FnRuleLoop(_0x27842c);}});}}};if(_0x42031c<_0x149673[_0xbaf1('0x1a')]&&_0x3376d9===![]){var _0x463cb1=_0x149673[_0x42031c][_0xbaf1('0x1b')];_0x463cb1[_0xbaf1('0x16')](_0x5209ed,_0x3b23c5);}else{process[_0xbaf1('0x13')](function(){_0x5209ed[_0xbaf1('0x1c')]=_0x1d4b0c;return _0x3f197a?_0x3f197a(_0x5209ed):_[_0xbaf1('0x1d')]();});}}(0x0));};RuleEngine['prototype'][_0xbaf1('0x1e')]=function(_0x49c965){if(_[_0xbaf1('0xc')](_0x49c965)){return this['rules'];}else{var _0x5a3486=_['matches'](_0x49c965);return _[_0xbaf1('0xb')](this['rules'],_0x5a3486);}};RuleEngine[_0xbaf1('0x5')][_0xbaf1('0x1f')]=function(_0x4a496e,_0x45ed54){var _0x205ed7=_0x4a496e==='on'||_0x4a496e==='ON'?!![]:![];var _0x27e7e7=this[_0xbaf1('0x1e')](_0x45ed54);for(var _0x2da88a=0x0,_0x1a45f8=_0x27e7e7[_0xbaf1('0x1a')];_0x2da88a<_0x1a45f8;_0x2da88a+=0x1){_0x27e7e7[_0x2da88a]['on']=_0x205ed7;}this[_0xbaf1('0xa')]();};RuleEngine[_0xbaf1('0x5')][_0xbaf1('0x20')]=function(_0x16caa8,_0x54a984){_0x16caa8=parseInt(_0x16caa8,0xa);var _0xc16739=this['findRules'](_0x54a984);for(var _0x1488e9=0x0,_0x33fbfc=_0xc16739[_0xbaf1('0x1a')];_0x1488e9<_0x33fbfc;_0x1488e9+=0x1){_0xc16739[_0x1488e9][_0xbaf1('0x21')]=_0x16caa8;}this['sync']();};RuleEngine['prototype'][_0xbaf1('0x22')]=function(){var _0x12913f=this['rules'];if(_0x12913f instanceof Array){_0x12913f=_0x12913f[_0xbaf1('0x23')](function(_0x524e31){_0x524e31[_0xbaf1('0x1b')]=_0x524e31['condition']['toString']();_0x524e31[_0xbaf1('0x11')]=_0x524e31[_0xbaf1('0x11')][_0xbaf1('0x24')]();return _0x524e31;});}else if(!_[_0xbaf1('0xc')](_0x12913f)){_0x12913f[_0xbaf1('0x1b')]=_0x12913f[_0xbaf1('0x1b')][_0xbaf1('0x24')]();_0x12913f['consequence']=_0x12913f[_0xbaf1('0x11')][_0xbaf1('0x24')]();}return _0x12913f;};RuleEngine['prototype'][_0xbaf1('0x25')]=function(_0x40d171){this['init']();if(_[_0xbaf1('0x26')](_0x40d171)){_0x40d171=JSON['parse'](_0x40d171);}if(_0x40d171 instanceof Array){_0x40d171=_0x40d171['map'](function(_0x3ab67f){_0x3ab67f[_0xbaf1('0x1b')]=eval('('+_0x3ab67f[_0xbaf1('0x1b')]+')');_0x3ab67f[_0xbaf1('0x11')]=eval('('+_0x3ab67f['consequence']+')');return _0x3ab67f;});}else if(_0x40d171!==null&&typeof _0x40d171==_0xbaf1('0x27')){_0x40d171[_0xbaf1('0x1b')]=eval('('+_0x40d171['condition']+')');_0x40d171[_0xbaf1('0x11')]=eval('('+_0x40d171[_0xbaf1('0x11')]+')');}this[_0xbaf1('0x7')](_0x40d171);};module[_0xbaf1('0x28')]=RuleEngine;
\ No newline at end of file
+var _0x4e85=['exports','lodash','util','events','EventEmitter','init','isNil','register','ignoreFactChanges','prototype','rules','activeRules','isArray','concat','push','sync','filter','orderBy','execute','clone','consequence','name','index_','nextTick','ruleRef','call','next','isEqual','restart','length','condition','matchPath','findRules','matches','turn','prioritize','toJSON','map','toString','fromJSON','isString','parse','object'];(function(_0x1d0d73,_0x4785b7){var _0x5a29f9=function(_0x1a84db){while(--_0x1a84db){_0x1d0d73['push'](_0x1d0d73['shift']());}};_0x5a29f9(++_0x4785b7);}(_0x4e85,0x1af));var _0x54e8=function(_0x8326a9,_0x2dd6fc){_0x8326a9=_0x8326a9-0x0;var _0x553564=_0x4e85[_0x8326a9];return _0x553564;};'use strict';var _=require(_0x54e8('0x0'));var util=require(_0x54e8('0x1'));var EventEmitter=require(_0x54e8('0x2'))[_0x54e8('0x3')];function RuleEngine(_0x58bc76,_0xa283cc){this[_0x54e8('0x4')]();if(!_[_0x54e8('0x5')](_0x58bc76)){this[_0x54e8('0x6')](_0x58bc76);}if(_0xa283cc){this['ignoreFactChanges']=_0xa283cc[_0x54e8('0x7')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine[_0x54e8('0x8')][_0x54e8('0x4')]=function(_0x54da94){this[_0x54e8('0x9')]=[];this[_0x54e8('0xa')]=[];};RuleEngine[_0x54e8('0x8')]['register']=function(_0x4f4696){if(Array[_0x54e8('0xb')](_0x4f4696)){this[_0x54e8('0x9')]=this[_0x54e8('0x9')][_0x54e8('0xc')](_0x4f4696);}else if(_0x4f4696!==null&&_['isObject'](_0x4f4696)){this['rules'][_0x54e8('0xd')](_0x4f4696);}this[_0x54e8('0xe')]();};RuleEngine[_0x54e8('0x8')][_0x54e8('0xe')]=function(){this[_0x54e8('0xa')]=this[_0x54e8('0x9')][_0x54e8('0xf')](function(_0x3c85a7){if(_[_0x54e8('0x5')](_0x3c85a7['on'])){_0x3c85a7['on']=!![];}if(_0x3c85a7['on']===!![]){return _0x3c85a7;}});this[_0x54e8('0xa')]=_[_0x54e8('0x10')](this[_0x54e8('0xa')],['p'],['asc']);};RuleEngine[_0x54e8('0x8')][_0x54e8('0x11')]=function(_0x45fffd,_0xe049c3){var _0x186d7c=![];_0x45fffd['result']=!![];var _0x12311b=_['clone'](_0x45fffd);var _0x274e00=_[_0x54e8('0x12')](_0x45fffd);var _0x1c8f79=this[_0x54e8('0xa')];var _0x5bee57=[];var _0x49b4da=this[_0x54e8('0x7')];(function FnRuleLoop(_0x3a426d){var _0x46bcd3={'rules':function(){return _0x1c8f79;},'rule':function(){return _0x1c8f79[_0x3a426d];},'when':function(_0x1cd019){if(_0x1cd019){var _0x4772c8=_0x1c8f79[_0x3a426d][_0x54e8('0x13')];_0x4772c8['ruleRef']=_0x1c8f79[_0x3a426d]['id']||_0x1c8f79[_0x3a426d][_0x54e8('0x14')]||_0x54e8('0x15')+_0x3a426d;process[_0x54e8('0x16')](function(){_0x5bee57[_0x54e8('0xd')](_0x4772c8[_0x54e8('0x17')]);_0x4772c8[_0x54e8('0x18')](_0x12311b,_0x46bcd3);});}else{process[_0x54e8('0x16')](function(){_0x46bcd3[_0x54e8('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x186d7c=!![];return FnRuleLoop(0x0);},'next':function(_0x40c90b){if(!_0x49b4da&&!_[_0x54e8('0x1a')](_0x274e00,_0x12311b)){_0x274e00=_[_0x54e8('0x12')](_0x12311b);process['nextTick'](function(){_0x46bcd3[_0x54e8('0x1b')]();});}else{process['nextTick'](function(){if(_['isNil'](_0x40c90b)){return FnRuleLoop(_0x3a426d+0x1);}else{return FnRuleLoop(_0x40c90b);}});}}};if(_0x3a426d<_0x1c8f79[_0x54e8('0x1c')]&&_0x186d7c===![]){var _0x270b1b=_0x1c8f79[_0x3a426d][_0x54e8('0x1d')];_0x270b1b['call'](_0x12311b,_0x46bcd3);}else{process[_0x54e8('0x16')](function(){_0x12311b[_0x54e8('0x1e')]=_0x5bee57;return _0xe049c3?_0xe049c3(_0x12311b):_['noop']();});}}(0x0));};RuleEngine[_0x54e8('0x8')][_0x54e8('0x1f')]=function(_0x27726c){if(_['isNil'](_0x27726c)){return this[_0x54e8('0x9')];}else{var _0x8ce0fd=_[_0x54e8('0x20')](_0x27726c);return _['filter'](this[_0x54e8('0x9')],_0x8ce0fd);}};RuleEngine['prototype'][_0x54e8('0x21')]=function(_0x35b631,_0x10408a){var _0x22b29d=_0x35b631==='on'||_0x35b631==='ON'?!![]:![];var _0x535a6a=this[_0x54e8('0x1f')](_0x10408a);for(var _0x44cdea=0x0,_0x537dff=_0x535a6a[_0x54e8('0x1c')];_0x44cdea<_0x537dff;_0x44cdea+=0x1){_0x535a6a[_0x44cdea]['on']=_0x22b29d;}this[_0x54e8('0xe')]();};RuleEngine[_0x54e8('0x8')][_0x54e8('0x22')]=function(_0x9f9792,_0x1a485c){_0x9f9792=parseInt(_0x9f9792,0xa);var _0x1803bf=this[_0x54e8('0x1f')](_0x1a485c);for(var _0x1fb132=0x0,_0x16e077=_0x1803bf['length'];_0x1fb132<_0x16e077;_0x1fb132+=0x1){_0x1803bf[_0x1fb132]['priority']=_0x9f9792;}this['sync']();};RuleEngine['prototype'][_0x54e8('0x23')]=function(){var _0x4f96e5=this['rules'];if(_0x4f96e5 instanceof Array){_0x4f96e5=_0x4f96e5[_0x54e8('0x24')](function(_0x7d6152){_0x7d6152[_0x54e8('0x1d')]=_0x7d6152[_0x54e8('0x1d')]['toString']();_0x7d6152['consequence']=_0x7d6152['consequence'][_0x54e8('0x25')]();return _0x7d6152;});}else if(!_[_0x54e8('0x5')](_0x4f96e5)){_0x4f96e5[_0x54e8('0x1d')]=_0x4f96e5[_0x54e8('0x1d')]['toString']();_0x4f96e5[_0x54e8('0x13')]=_0x4f96e5[_0x54e8('0x13')][_0x54e8('0x25')]();}return _0x4f96e5;};RuleEngine[_0x54e8('0x8')][_0x54e8('0x26')]=function(_0x38479e){this[_0x54e8('0x4')]();if(_[_0x54e8('0x27')](_0x38479e)){_0x38479e=JSON[_0x54e8('0x28')](_0x38479e);}if(_0x38479e instanceof Array){_0x38479e=_0x38479e['map'](function(_0x1ac722){_0x1ac722[_0x54e8('0x1d')]=eval('('+_0x1ac722[_0x54e8('0x1d')]+')');_0x1ac722[_0x54e8('0x13')]=eval('('+_0x1ac722['consequence']+')');return _0x1ac722;});}else if(_0x38479e!==null&&typeof _0x38479e==_0x54e8('0x29')){_0x38479e[_0x54e8('0x1d')]=eval('('+_0x38479e[_0x54e8('0x1d')]+')');_0x38479e[_0x54e8('0x13')]=eval('('+_0x38479e[_0x54e8('0x13')]+')');}this[_0x54e8('0x6')](_0x38479e);};module[_0x54e8('0x2a')]=RuleEngine;
\ No newline at end of file
index 4631757..919d509 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x45a2df,_0x114fe5){var _0xbe5c64=function(_0x39bb71){while(--_0x39bb71){_0x45a2df['push'](_0x45a2df['shift']());}};_0xbe5c64(++_0x114fe5);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
+var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x43a47f,_0x367404){var _0x48ce8f=function(_0x5f1606){while(--_0x5f1606){_0x43a47f['push'](_0x43a47f['shift']());}};_0x48ce8f(++_0x367404);}(_0x34e8,0x12c));var _0x834e=function(_0x5ebd4a,_0x8fc233){_0x5ebd4a=_0x5ebd4a-0x0;var _0x676d6c=_0x34e8[_0x5ebd4a];return _0x676d6c;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});};
\ No newline at end of file
index 43ca116..85c7b7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0833=['mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','maxcapacity','working','idle','mail','chat','fax','length','Status','StatusTime','format','voicePause','faxStatus','smsCurrentCapacity','whatsappStatus','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','localhost','redis','name','online','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus'];(function(_0x2cb91f,_0x406af5){var _0x51c7e3=function(_0x5d2c67){while(--_0x5d2c67){_0x2cb91f['push'](_0x2cb91f['shift']());}};_0x51c7e3(++_0x406af5);}(_0x0833,0x1bd));var _0x3083=function(_0x35b8cb,_0xe7775){_0x35b8cb=_0x35b8cb-0x0;var _0x3c0178=_0x0833[_0x35b8cb];return _0x3c0178;};'use strict';var _=require(_0x3083('0x0'));var moment=require(_0x3083('0x1'));var md5=require(_0x3083('0x2'));var Redis=require(_0x3083('0x3'));var config=require(_0x3083('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x3083('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3083('0x6')]));function Agent(_0x1d8d6e){this['id']=_0x1d8d6e['id']||0x0;this[_0x3083('0x7')]=_0x1d8d6e['name']||'';this[_0x3083('0x8')]=_0x1d8d6e[_0x3083('0x8')]||!![];this['voicePause']=_0x1d8d6e['voicePause']||![];this['chatPause']=_0x1d8d6e[_0x3083('0x9')]||![];this['mailPause']=_0x1d8d6e['mailPause']||![];this[_0x3083('0xa')]=_0x1d8d6e[_0x3083('0xa')]||![];this[_0x3083('0xb')]=_0x1d8d6e[_0x3083('0xb')]||![];this[_0x3083('0xc')]=_0x1d8d6e[_0x3083('0xc')]||![];this[_0x3083('0xd')]=_0x3083('0xe');this[_0x3083('0xf')]=0x0;this[_0x3083('0x10')]=_0x1d8d6e[_0x3083('0x10')]||0x0;this[_0x3083('0x11')]=0x0;this[_0x3083('0x12')]=_0x3083('0xe');this[_0x3083('0x13')]=0x0;this['mailCapacity']=_0x1d8d6e[_0x3083('0x14')]||0x0;this[_0x3083('0x15')]=0x0;this['faxStatus']=_0x3083('0xe');this[_0x3083('0x16')]=0x0;this['faxCapacity']=_0x1d8d6e[_0x3083('0x17')]||0x0;this[_0x3083('0x18')]=0x0;this[_0x3083('0x19')]=_0x3083('0xe');this[_0x3083('0x1a')]=0x0;this[_0x3083('0x1b')]=_0x1d8d6e[_0x3083('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x3083('0x1c')]=0x0;this['whatsappCapacity']=_0x1d8d6e[_0x3083('0x1d')]||0x0;this[_0x3083('0x1e')]=0x0;this[_0x3083('0x1f')]=_0x3083('0xe');this[_0x3083('0x20')]=0x0;this[_0x3083('0x21')]=_0x1d8d6e[_0x3083('0x21')]||0x0;this[_0x3083('0x22')]=0x0;this[_0x3083('0x23')]=![];this[_0x3083('0x24')]=undefined;this[_0x3083('0x2')]='';this[_0x3083('0x25')]();}Agent[_0x3083('0x26')][_0x3083('0x27')]=function(_0x51afc7){if(this[_0x51afc7+'CurrentCapacity']>0x0){if(this[_0x51afc7+_0x3083('0x28')]>0x0&&this[_0x51afc7+'CurrentCapacity']>=this[_0x51afc7+_0x3083('0x28')]){return _0x3083('0x29');}else{return _0x3083('0x2a');}}else{return _0x3083('0x2b');}};Agent[_0x3083('0x26')][_0x3083('0x25')]=function(){var _0x266370=[_0x3083('0x2c'),_0x3083('0x2d'),'openchannel',_0x3083('0x2e'),'sms','whatsapp'];for(var _0x1bea50=0x0;_0x1bea50<_0x266370[_0x3083('0x2f')];_0x1bea50+=0x1){var _0x2afe80=this[_0x3083('0x27')](_0x266370[_0x1bea50]);if(this[_0x266370[_0x1bea50]+_0x3083('0x30')]!==_0x2afe80){this[_0x266370[_0x1bea50]+_0x3083('0x31')]=_['toNumber'](moment()[_0x3083('0x32')]('x'));}this[_0x266370[_0x1bea50]+_0x3083('0x30')]=_0x2afe80;}var _0x1d8600={'id':this['id'],'name':this[_0x3083('0x7')],'online':this['online'],'voicePause':this[_0x3083('0x33')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x3083('0xb')],'faxPause':this[_0x3083('0xa')],'openchannelPause':this[_0x3083('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x3083('0xf')],'chatCapacity':this[_0x3083('0x10')],'chatCurrentCapacity':this[_0x3083('0x11')],'mailStatus':this[_0x3083('0x12')],'mailStatusTime':this[_0x3083('0x13')],'mailCapacity':this[_0x3083('0x14')],'mailCurrentCapacity':this[_0x3083('0x15')],'faxStatus':this[_0x3083('0x34')],'faxStatusTime':this[_0x3083('0x16')],'faxCapacity':this[_0x3083('0x17')],'faxCurrentCapacity':this[_0x3083('0x18')],'smsStatus':this[_0x3083('0x19')],'smsStatusTime':this[_0x3083('0x1a')],'smsCapacity':this[_0x3083('0x1b')],'smsCurrentCapacity':this[_0x3083('0x35')],'whatsappStatus':this[_0x3083('0x36')],'whatsappStatusTime':this[_0x3083('0x1c')],'whatsappCapacity':this[_0x3083('0x1d')],'whatsappCurrentCapacity':this[_0x3083('0x1e')],'openchannelStatus':this[_0x3083('0x1f')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x3083('0x21')],'openchannelCurrentCapacity':this[_0x3083('0x22')],'busy':this['busy'],'busyQueue':this[_0x3083('0x24')]};var _0x473f0b=md5(JSON['stringify'](_0x1d8600));if(this['md5']!==_0x473f0b){this[_0x3083('0x2')]=_0x473f0b;io[_0x3083('0x37')](_0x3083('0x38'),_0x1d8600);}};module[_0x3083('0x39')]=Agent;
\ No newline at end of file
+var _0x1d21=['unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime','mail','chat','openchannel','sms','whatsapp','length','Status','toNumber','format','chatStatusTime','faxStatus','whatsappCurrentCapacity','openchannelStatus','stringify','exports','lodash','moment','md5','ioredis','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus'];(function(_0x1760ee,_0x76c810){var _0x29e9dc=function(_0x52866b){while(--_0x52866b){_0x1760ee['push'](_0x1760ee['shift']());}};_0x29e9dc(++_0x76c810);}(_0x1d21,0x158));var _0x11d2=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0x1d21[_0x23e6bb];return _0x1e3b4c;};'use strict';var _=require(_0x11d2('0x0'));var moment=require(_0x11d2('0x1'));var md5=require(_0x11d2('0x2'));var Redis=require(_0x11d2('0x3'));var config=require('../../../config/environment');config[_0x11d2('0x4')]=_[_0x11d2('0x5')](config[_0x11d2('0x4')],{'host':_0x11d2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x11d2('0x4')]));function Agent(_0x121715){this['id']=_0x121715['id']||0x0;this[_0x11d2('0x7')]=_0x121715[_0x11d2('0x7')]||'';this[_0x11d2('0x8')]=_0x121715[_0x11d2('0x8')]||!![];this[_0x11d2('0x9')]=_0x121715['voicePause']||![];this[_0x11d2('0xa')]=_0x121715[_0x11d2('0xa')]||![];this['mailPause']=_0x121715[_0x11d2('0xb')]||![];this['faxPause']=_0x121715[_0x11d2('0xc')]||![];this[_0x11d2('0xd')]=_0x121715['smsPause']||![];this[_0x11d2('0xe')]=_0x121715[_0x11d2('0xe')]||![];this[_0x11d2('0xf')]=_0x11d2('0x10');this['chatStatusTime']=0x0;this['chatCapacity']=_0x121715[_0x11d2('0x11')]||0x0;this[_0x11d2('0x12')]=0x0;this[_0x11d2('0x13')]='unknown';this[_0x11d2('0x14')]=0x0;this[_0x11d2('0x15')]=_0x121715[_0x11d2('0x15')]||0x0;this[_0x11d2('0x16')]=0x0;this['faxStatus']=_0x11d2('0x10');this[_0x11d2('0x17')]=0x0;this['faxCapacity']=_0x121715[_0x11d2('0x18')]||0x0;this[_0x11d2('0x19')]=0x0;this[_0x11d2('0x1a')]=_0x11d2('0x10');this[_0x11d2('0x1b')]=0x0;this[_0x11d2('0x1c')]=_0x121715[_0x11d2('0x1c')]||0x0;this[_0x11d2('0x1d')]=0x0;this[_0x11d2('0x1e')]=_0x11d2('0x10');this[_0x11d2('0x1f')]=0x0;this[_0x11d2('0x20')]=_0x121715[_0x11d2('0x20')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x11d2('0x10');this[_0x11d2('0x21')]=0x0;this['openchannelCapacity']=_0x121715[_0x11d2('0x22')]||0x0;this[_0x11d2('0x23')]=0x0;this[_0x11d2('0x24')]=![];this[_0x11d2('0x25')]=undefined;this[_0x11d2('0x2')]='';this['updateRealtime']();}Agent[_0x11d2('0x26')][_0x11d2('0x27')]=function(_0x48ece4){if(this[_0x48ece4+_0x11d2('0x28')]>0x0){if(this[_0x48ece4+_0x11d2('0x29')]>0x0&&this[_0x48ece4+_0x11d2('0x28')]>=this[_0x48ece4+_0x11d2('0x29')]){return'maxcapacity';}else{return _0x11d2('0x2a');}}else{return _0x11d2('0x2b');}};Agent[_0x11d2('0x26')][_0x11d2('0x2c')]=function(){var _0xf8c803=[_0x11d2('0x2d'),_0x11d2('0x2e'),_0x11d2('0x2f'),'fax',_0x11d2('0x30'),_0x11d2('0x31')];for(var _0x51f474=0x0;_0x51f474<_0xf8c803[_0x11d2('0x32')];_0x51f474+=0x1){var _0x51d4b6=this['getChannelStatus'](_0xf8c803[_0x51f474]);if(this[_0xf8c803[_0x51f474]+_0x11d2('0x33')]!==_0x51d4b6){this[_0xf8c803[_0x51f474]+'StatusTime']=_[_0x11d2('0x34')](moment()[_0x11d2('0x35')]('x'));}this[_0xf8c803[_0x51f474]+_0x11d2('0x33')]=_0x51d4b6;}var _0x426523={'id':this['id'],'name':this[_0x11d2('0x7')],'online':this[_0x11d2('0x8')],'voicePause':this[_0x11d2('0x9')],'chatPause':this[_0x11d2('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x11d2('0xd')],'faxPause':this[_0x11d2('0xc')],'openchannelPause':this[_0x11d2('0xe')],'chatStatus':this[_0x11d2('0xf')],'chatStatusTime':this[_0x11d2('0x36')],'chatCapacity':this[_0x11d2('0x11')],'chatCurrentCapacity':this[_0x11d2('0x12')],'mailStatus':this[_0x11d2('0x13')],'mailStatusTime':this[_0x11d2('0x14')],'mailCapacity':this[_0x11d2('0x15')],'mailCurrentCapacity':this[_0x11d2('0x16')],'faxStatus':this[_0x11d2('0x37')],'faxStatusTime':this[_0x11d2('0x17')],'faxCapacity':this[_0x11d2('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x11d2('0x1a')],'smsStatusTime':this[_0x11d2('0x1b')],'smsCapacity':this[_0x11d2('0x1c')],'smsCurrentCapacity':this[_0x11d2('0x1d')],'whatsappStatus':this[_0x11d2('0x1e')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x11d2('0x20')],'whatsappCurrentCapacity':this[_0x11d2('0x38')],'openchannelStatus':this[_0x11d2('0x39')],'openchannelStatusTime':this[_0x11d2('0x21')],'openchannelCapacity':this[_0x11d2('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x11d2('0x25')]};var _0x435641=md5(JSON[_0x11d2('0x3a')](_0x426523));if(this[_0x11d2('0x2')]!==_0x435641){this[_0x11d2('0x2')]=_0x435641;io['emit']('user:save',_0x426523);}};module[_0x11d2('0x3b')]=Agent;
\ No newline at end of file
index a15b47e..55d2a4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aef=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','online','chatPause','available','paused','loggedIn','format','chat:queue:%s','chat_queue:save'];(function(_0x104963,_0x412a30){var _0x34514a=function(_0x30fd74){while(--_0x30fd74){_0x104963['push'](_0x104963['shift']());}};_0x34514a(++_0x412a30);}(_0x6aef,0x145));var _0xf6ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ae('0x0'));var md5=require(_0xf6ae('0x1'));var util=require(_0xf6ae('0x2'));var Redis=require(_0xf6ae('0x3'));var config=require(_0xf6ae('0x4'));config[_0xf6ae('0x5')]=_[_0xf6ae('0x6')](config['redis'],{'host':_0xf6ae('0x7'),'port':0x18eb});var io=require(_0xf6ae('0x8'))(new Redis(config['redis']));function ChatQueue(_0x1892ef){this['id']=_0x1892ef['id']||0x0;this[_0xf6ae('0x9')]=_0x1892ef[_0xf6ae('0x9')]||'';this[_0xf6ae('0xa')]=_0x1892ef[_0xf6ae('0xa')]||0xa;this[_0xf6ae('0xb')]=_0x1892ef[_0xf6ae('0xb')]||'beepall';this['Agents']=_0x1892ef[_0xf6ae('0xc')];this[_0xf6ae('0xd')]={};this[_0xf6ae('0xe')]=0x0;this[_0xf6ae('0x1')]='';this[_0xf6ae('0xf')]();this['updateRealtime']();}ChatQueue[_0xf6ae('0x10')][_0xf6ae('0xf')]=function(){var _0x5334c3=this[_0xf6ae('0xd')]['_rr'];this[_0xf6ae('0xd')]=_['map'](this['Agents'],'id');this[_0xf6ae('0xd')][_0xf6ae('0x11')]=_0x5334c3;};ChatQueue[_0xf6ae('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xb47096=0x0;_0xb47096<this[_0xf6ae('0xc')]['length'];_0xb47096+=0x1){if(this[_0xf6ae('0xc')][_0xb47096][_0xf6ae('0x12')]){this['loggedIn']+=0x1;}if(this[_0xf6ae('0xc')][_0xb47096][_0xf6ae('0x13')]){this['paused']+=0x1;}}this[_0xf6ae('0x14')]=this['loggedIn']-this[_0xf6ae('0x15')];this[_0xf6ae('0x14')]=this[_0xf6ae('0x14')]>=0x0?this[_0xf6ae('0x14')]:0x0;var _0x406372={'id':this['id'],'available':this[_0xf6ae('0x14')],'loggedIn':this[_0xf6ae('0x16')],'name':this['name'],'paused':this[_0xf6ae('0x15')],'waiting':this[_0xf6ae('0xe')]};var _0xf95c=md5(JSON['stringify'](_0x406372));if(this[_0xf6ae('0x1')]!==_0xf95c){this[_0xf6ae('0x1')]=_0xf95c;io['to'](util[_0xf6ae('0x17')](_0xf6ae('0x18'),_0x406372['name']))['emit'](_0xf6ae('0x19'),_0x406372);}};module[_0xf6ae('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0x5bfe=['ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','chatPause','available','stringify','format','emit','chat_queue:save','lodash','md5'];(function(_0x1ec506,_0x1e882d){var _0x56381f=function(_0x5bc395){while(--_0x5bc395){_0x1ec506['push'](_0x1ec506['shift']());}};_0x56381f(++_0x1e882d);}(_0x5bfe,0xdf));var _0xe5bf=function(_0x2ff2ff,_0x2563d8){_0x2ff2ff=_0x2ff2ff-0x0;var _0x252433=_0x5bfe[_0x2ff2ff];return _0x252433;};'use strict';var _=require(_0xe5bf('0x0'));var md5=require(_0xe5bf('0x1'));var util=require('util');var Redis=require(_0xe5bf('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xe5bf('0x3')](config[_0xe5bf('0x4')],{'host':_0xe5bf('0x5'),'port':0x18eb});var io=require(_0xe5bf('0x6'))(new Redis(config[_0xe5bf('0x4')]));function ChatQueue(_0x1e2a5f){this['id']=_0x1e2a5f['id']||0x0;this['name']=_0x1e2a5f[_0xe5bf('0x7')]||'';this[_0xe5bf('0x8')]=_0x1e2a5f[_0xe5bf('0x8')]||0xa;this['strategy']=_0x1e2a5f['strategy']||_0xe5bf('0x9');this['Agents']=_0x1e2a5f[_0xe5bf('0xa')];this[_0xe5bf('0xb')]={};this[_0xe5bf('0xc')]=0x0;this[_0xe5bf('0x1')]='';this[_0xe5bf('0xd')]();this[_0xe5bf('0xe')]();}ChatQueue[_0xe5bf('0xf')][_0xe5bf('0xd')]=function(){var _0x48cceb=this[_0xe5bf('0xb')]['_rr'];this[_0xe5bf('0xb')]=_['map'](this[_0xe5bf('0xa')],'id');this[_0xe5bf('0xb')][_0xe5bf('0x10')]=_0x48cceb;};ChatQueue[_0xe5bf('0xf')][_0xe5bf('0xe')]=function(){this[_0xe5bf('0x11')]=0x0;this[_0xe5bf('0x12')]=0x0;for(var _0x11794d=0x0;_0x11794d<this[_0xe5bf('0xa')]['length'];_0x11794d+=0x1){if(this[_0xe5bf('0xa')][_0x11794d]['online']){this[_0xe5bf('0x11')]+=0x1;}if(this['Agents'][_0x11794d][_0xe5bf('0x13')]){this[_0xe5bf('0x12')]+=0x1;}}this[_0xe5bf('0x14')]=this[_0xe5bf('0x11')]-this[_0xe5bf('0x12')];this[_0xe5bf('0x14')]=this[_0xe5bf('0x14')]>=0x0?this['available']:0x0;var _0x4a5367={'id':this['id'],'available':this[_0xe5bf('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xe5bf('0x7')],'paused':this[_0xe5bf('0x12')],'waiting':this[_0xe5bf('0xc')]};var _0x339252=md5(JSON[_0xe5bf('0x15')](_0x4a5367));if(this[_0xe5bf('0x1')]!==_0x339252){this[_0xe5bf('0x1')]=_0x339252;io['to'](util[_0xe5bf('0x16')]('chat:queue:%s',_0x4a5367[_0xe5bf('0x7')]))[_0xe5bf('0x17')](_0xe5bf('0x18'),_0x4a5367);}};module['exports']=ChatQueue;
\ No newline at end of file
index ae6efb6..59e57e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x2d01b5,_0x26e53a){var _0x3585af=function(_0x5518cc){while(--_0x5518cc){_0x2d01b5['push'](_0x2d01b5['shift']());}};_0x3585af(++_0x26e53a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227<this[_0x0a9e('0xf')][_0x0a9e('0x13')];_0x2b4227+=0x1){if(this[_0x0a9e('0xf')][_0x2b4227]['online']){this[_0x0a9e('0x11')]+=0x1;}if(this['Agents'][_0x2b4227][_0x0a9e('0x14')]){this['paused']+=0x1;}}this[_0x0a9e('0x15')]=this[_0x0a9e('0x11')]-this['paused'];this[_0x0a9e('0x15')]=this['available']>=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue;
\ No newline at end of file
+var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x92412b,_0x45bce4){var _0x35f1a4=function(_0x1cebc9){while(--_0x1cebc9){_0x92412b['push'](_0x92412b['shift']());}};_0x35f1a4(++_0x45bce4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227<this[_0x0a9e('0xf')][_0x0a9e('0x13')];_0x2b4227+=0x1){if(this[_0x0a9e('0xf')][_0x2b4227]['online']){this[_0x0a9e('0x11')]+=0x1;}if(this['Agents'][_0x2b4227][_0x0a9e('0x14')]){this['paused']+=0x1;}}this[_0x0a9e('0x15')]=this[_0x0a9e('0x11')]-this['paused'];this[_0x0a9e('0x15')]=this['available']>=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue;
\ No newline at end of file
index e584518..3535d92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb76b=['name'];(function(_0x1c1585,_0x15c6ff){var _0x3eac78=function(_0x47bc2b){while(--_0x47bc2b){_0x1c1585['push'](_0x1c1585['shift']());}};_0x3eac78(++_0x15c6ff);}(_0xb76b,0x75));var _0xbb76=function(_0x480425,_0x1b778c){_0x480425=_0x480425-0x0;var _0x435a4b=_0xb76b[_0x480425];return _0x435a4b;};'use strict';function Interval(_0x17020d){this['id']=_0x17020d['id']||0x0;this['name']=_0x17020d[_0xbb76('0x0')]||'';this['Intervals']=_0x17020d['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
+var _0x7be6=['exports','Intervals'];(function(_0x5ac1f4,_0x10f637){var _0x1997c1=function(_0x5dffec){while(--_0x5dffec){_0x5ac1f4['push'](_0x5ac1f4['shift']());}};_0x1997c1(++_0x10f637);}(_0x7be6,0x171));var _0x67be=function(_0x340de5,_0x1b5796){_0x340de5=_0x340de5-0x0;var _0x4c40bd=_0x7be6[_0x340de5];return _0x4c40bd;};'use strict';function Interval(_0x4d1f3a){this['id']=_0x4d1f3a['id']||0x0;this['name']=_0x4d1f3a['name']||'';this[_0x67be('0x0')]=_0x4d1f3a[_0x67be('0x0')]||{};}module[_0x67be('0x1')]=Interval;
\ No newline at end of file
index 5b04461..e2401c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c58=['name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','mailPause','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x5a87a,_0x127eaf){var _0x40f271=function(_0x9febe8){while(--_0x9febe8){_0x5a87a['push'](_0x5a87a['shift']());}};_0x40f271(++_0x127eaf);}(_0x2c58,0x8f));var _0x82c5=function(_0x2e3980,_0x22cc14){_0x2e3980=_0x2e3980-0x0;var _0x1fd53f=_0x2c58[_0x2e3980];return _0x1fd53f;};'use strict';var _=require('lodash');var md5=require(_0x82c5('0x0'));var util=require(_0x82c5('0x1'));var Redis=require(_0x82c5('0x2'));var config=require(_0x82c5('0x3'));config['redis']=_[_0x82c5('0x4')](config[_0x82c5('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x82c5('0x6'))(new Redis(config[_0x82c5('0x5')]));function MailQueue(_0x4e4401){this['id']=_0x4e4401['id']||0x0;this[_0x82c5('0x7')]=_0x4e4401[_0x82c5('0x7')]||'';this[_0x82c5('0x8')]=_0x4e4401['timeout']||0xa;this[_0x82c5('0x9')]=_0x4e4401[_0x82c5('0x9')]||_0x82c5('0xa');this[_0x82c5('0xb')]=_0x4e4401[_0x82c5('0xb')];this[_0x82c5('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x82c5('0xd')]();this[_0x82c5('0xe')]();}MailQueue[_0x82c5('0xf')][_0x82c5('0xd')]=function(){var _0x4cd15c=this[_0x82c5('0xc')]['_rr'];this['mapAgentsId']=_[_0x82c5('0x10')](this[_0x82c5('0xb')],'id');this[_0x82c5('0xc')][_0x82c5('0x11')]=_0x4cd15c;};MailQueue[_0x82c5('0xf')]['updateRealtime']=function(){this[_0x82c5('0x12')]=0x0;this[_0x82c5('0x13')]=0x0;for(var _0x203301=0x0;_0x203301<this[_0x82c5('0xb')]['length'];_0x203301+=0x1){if(this[_0x82c5('0xb')][_0x203301][_0x82c5('0x14')]){this[_0x82c5('0x12')]+=0x1;}if(this[_0x82c5('0xb')][_0x203301][_0x82c5('0x15')]){this[_0x82c5('0x13')]+=0x1;}}this[_0x82c5('0x16')]=this['loggedIn']-this[_0x82c5('0x13')];this[_0x82c5('0x16')]=this[_0x82c5('0x16')]>=0x0?this[_0x82c5('0x16')]:0x0;var _0xcc715={'id':this['id'],'available':this['available'],'loggedIn':this[_0x82c5('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x82c5('0x17')]};var _0x25aac7=md5(JSON[_0x82c5('0x18')](_0xcc715));if(this[_0x82c5('0x0')]!==_0x25aac7){this[_0x82c5('0x0')]=_0x25aac7;io['to'](util[_0x82c5('0x19')](_0x82c5('0x1a'),_0xcc715['name']))[_0x82c5('0x1b')](_0x82c5('0x1c'),_0xcc715);}};module[_0x82c5('0x1d')]=MailQueue;
\ No newline at end of file
+var _0x6b3e=['lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','online','mailPause','available','stringify','emit','mail_queue:save','exports'];(function(_0x1eeb62,_0x59c3ea){var _0x498632=function(_0x848fdb){while(--_0x848fdb){_0x1eeb62['push'](_0x1eeb62['shift']());}};_0x498632(++_0x59c3ea);}(_0x6b3e,0x122));var _0xe6b3=function(_0x3dd7d2,_0xae66d8){_0x3dd7d2=_0x3dd7d2-0x0;var _0x1665fa=_0x6b3e[_0x3dd7d2];return _0x1665fa;};'use strict';var _=require(_0xe6b3('0x0'));var md5=require(_0xe6b3('0x1'));var util=require(_0xe6b3('0x2'));var Redis=require(_0xe6b3('0x3'));var config=require(_0xe6b3('0x4'));config['redis']=_[_0xe6b3('0x5')](config[_0xe6b3('0x6')],{'host':_0xe6b3('0x7'),'port':0x18eb});var io=require(_0xe6b3('0x8'))(new Redis(config[_0xe6b3('0x6')]));function MailQueue(_0x546da4){this['id']=_0x546da4['id']||0x0;this[_0xe6b3('0x9')]=_0x546da4[_0xe6b3('0x9')]||'';this['timeout']=_0x546da4[_0xe6b3('0xa')]||0xa;this[_0xe6b3('0xb')]=_0x546da4[_0xe6b3('0xb')]||_0xe6b3('0xc');this[_0xe6b3('0xd')]=_0x546da4[_0xe6b3('0xd')];this['mapAgentsId']={};this[_0xe6b3('0xe')]=0x0;this[_0xe6b3('0x1')]='';this[_0xe6b3('0xf')]();this[_0xe6b3('0x10')]();}MailQueue[_0xe6b3('0x11')]['updateRouting']=function(){var _0xe88bf4=this[_0xe6b3('0x12')][_0xe6b3('0x13')];this['mapAgentsId']=_['map'](this[_0xe6b3('0xd')],'id');this[_0xe6b3('0x12')][_0xe6b3('0x13')]=_0xe88bf4;};MailQueue[_0xe6b3('0x11')]['updateRealtime']=function(){this[_0xe6b3('0x14')]=0x0;this[_0xe6b3('0x15')]=0x0;for(var _0x18a2b5=0x0;_0x18a2b5<this[_0xe6b3('0xd')]['length'];_0x18a2b5+=0x1){if(this[_0xe6b3('0xd')][_0x18a2b5][_0xe6b3('0x16')]){this['loggedIn']+=0x1;}if(this[_0xe6b3('0xd')][_0x18a2b5][_0xe6b3('0x17')]){this[_0xe6b3('0x15')]+=0x1;}}this[_0xe6b3('0x18')]=this[_0xe6b3('0x14')]-this[_0xe6b3('0x15')];this[_0xe6b3('0x18')]=this[_0xe6b3('0x18')]>=0x0?this[_0xe6b3('0x18')]:0x0;var _0x43b618={'id':this['id'],'available':this[_0xe6b3('0x18')],'loggedIn':this[_0xe6b3('0x14')],'name':this[_0xe6b3('0x9')],'paused':this['paused'],'waiting':this[_0xe6b3('0xe')]};var _0x27f70b=md5(JSON[_0xe6b3('0x19')](_0x43b618));if(this[_0xe6b3('0x1')]!==_0x27f70b){this[_0xe6b3('0x1')]=_0x27f70b;io['to'](util['format']('mail:queue:%s',_0x43b618[_0xe6b3('0x9')]))[_0xe6b3('0x1a')](_0xe6b3('0x1b'),_0x43b618);}};module[_0xe6b3('0x1c')]=MailQueue;
\ No newline at end of file
index a737f01..a0a5faf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf11=['defaults','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','openchannelPause','available','openchannel:queue:%s','name','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0xdf11,0xa2));var _0x1df1=function(_0xdd6d72,_0xf51f31){_0xdd6d72=_0xdd6d72-0x0;var _0x55d5d0=_0xdf11[_0xdd6d72];return _0x55d5d0;};'use strict';var _=require(_0x1df1('0x0'));var md5=require(_0x1df1('0x1'));var util=require(_0x1df1('0x2'));var Redis=require(_0x1df1('0x3'));var config=require(_0x1df1('0x4'));config[_0x1df1('0x5')]=_[_0x1df1('0x6')](config[_0x1df1('0x5')],{'host':_0x1df1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1df1('0x5')]));function OpenchannelQueue(_0x2e3541){this['id']=_0x2e3541['id']||0x0;this['name']=_0x2e3541['name']||'';this['timeout']=_0x2e3541[_0x1df1('0x8')]||0xa;this[_0x1df1('0x9')]=_0x2e3541[_0x1df1('0x9')]||_0x1df1('0xa');this[_0x1df1('0xb')]=_0x2e3541['Agents'];this[_0x1df1('0xc')]={};this[_0x1df1('0xd')]=0x0;this[_0x1df1('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x1df1('0xe')]=function(){var _0x458d84=this[_0x1df1('0xc')][_0x1df1('0xf')];this[_0x1df1('0xc')]=_[_0x1df1('0x10')](this[_0x1df1('0xb')],'id');this['mapAgentsId'][_0x1df1('0xf')]=_0x458d84;};OpenchannelQueue[_0x1df1('0x11')][_0x1df1('0x12')]=function(){this[_0x1df1('0x13')]=0x0;this[_0x1df1('0x14')]=0x0;for(var _0x389758=0x0;_0x389758<this[_0x1df1('0xb')][_0x1df1('0x15')];_0x389758+=0x1){if(this[_0x1df1('0xb')][_0x389758][_0x1df1('0x16')]){this[_0x1df1('0x13')]+=0x1;}if(this[_0x1df1('0xb')][_0x389758][_0x1df1('0x17')]){this[_0x1df1('0x14')]+=0x1;}}this[_0x1df1('0x18')]=this[_0x1df1('0x13')]-this['paused'];this[_0x1df1('0x18')]=this[_0x1df1('0x18')]>=0x0?this[_0x1df1('0x18')]:0x0;var _0x36393e={'id':this['id'],'available':this[_0x1df1('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x1df1('0x14')],'waiting':this[_0x1df1('0xd')]};var _0xafb906=md5(JSON['stringify'](_0x36393e));if(this['md5']!==_0xafb906){this['md5']=_0xafb906;io['to'](util['format'](_0x1df1('0x19'),_0x36393e[_0x1df1('0x1a')]))['emit'](_0x1df1('0x1b'),_0x36393e);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
+var _0x1846=['online','openchannelPause','paused','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','util','ioredis','defaults','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRealtime','updateRouting','_rr','map','loggedIn','length'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1846,0xd5));var _0x6184=function(_0xb39e3b,_0x2be5df){_0xb39e3b=_0xb39e3b-0x0;var _0x40515c=_0x1846[_0xb39e3b];return _0x40515c;};'use strict';var _=require(_0x6184('0x0'));var md5=require('md5');var util=require(_0x6184('0x1'));var Redis=require(_0x6184('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x6184('0x3')](config[_0x6184('0x4')],{'host':_0x6184('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function OpenchannelQueue(_0x4fad59){this['id']=_0x4fad59['id']||0x0;this[_0x6184('0x6')]=_0x4fad59['name']||'';this[_0x6184('0x7')]=_0x4fad59[_0x6184('0x7')]||0xa;this['strategy']=_0x4fad59[_0x6184('0x8')]||'beepall';this[_0x6184('0x9')]=_0x4fad59[_0x6184('0x9')];this[_0x6184('0xa')]={};this[_0x6184('0xb')]=0x0;this[_0x6184('0xc')]='';this['updateRouting']();this[_0x6184('0xd')]();}OpenchannelQueue['prototype'][_0x6184('0xe')]=function(){var _0x474980=this[_0x6184('0xa')][_0x6184('0xf')];this['mapAgentsId']=_[_0x6184('0x10')](this[_0x6184('0x9')],'id');this[_0x6184('0xa')][_0x6184('0xf')]=_0x474980;};OpenchannelQueue['prototype'][_0x6184('0xd')]=function(){this[_0x6184('0x11')]=0x0;this['paused']=0x0;for(var _0x4b0237=0x0;_0x4b0237<this[_0x6184('0x9')][_0x6184('0x12')];_0x4b0237+=0x1){if(this['Agents'][_0x4b0237][_0x6184('0x13')]){this['loggedIn']+=0x1;}if(this[_0x6184('0x9')][_0x4b0237][_0x6184('0x14')]){this[_0x6184('0x15')]+=0x1;}}this['available']=this['loggedIn']-this[_0x6184('0x15')];this['available']=this[_0x6184('0x16')]>=0x0?this[_0x6184('0x16')]:0x0;var _0x4bd73c={'id':this['id'],'available':this[_0x6184('0x16')],'loggedIn':this[_0x6184('0x11')],'name':this['name'],'paused':this[_0x6184('0x15')],'waiting':this[_0x6184('0xb')]};var _0x1e85c6=md5(JSON[_0x6184('0x17')](_0x4bd73c));if(this[_0x6184('0xc')]!==_0x1e85c6){this[_0x6184('0xc')]=_0x1e85c6;io['to'](util[_0x6184('0x18')](_0x6184('0x19'),_0x4bd73c[_0x6184('0x6')]))[_0x6184('0x1a')](_0x6184('0x1b'),_0x4bd73c);}};module[_0x6184('0x1c')]=OpenchannelQueue;
\ No newline at end of file
index 0752f45..b5332b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','length','online','loggedIn','smsPause','paused','available','format','sms:queue:%s','emit','md5','util','defaults'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0x757a,0xde));var _0xa757=function(_0x341386,_0x415643){_0x341386=_0x341386-0x0;var _0x568d03=_0x757a[_0x341386];return _0x568d03;};'use strict';var _=require('lodash');var md5=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xa757('0x2')](config[_0xa757('0x3')],{'host':_0xa757('0x4'),'port':0x18eb});var io=require(_0xa757('0x5'))(new Redis(config[_0xa757('0x3')]));function SmsQueue(_0x3caeb0){this['id']=_0x3caeb0['id']||0x0;this['name']=_0x3caeb0[_0xa757('0x6')]||'';this[_0xa757('0x7')]=_0x3caeb0['timeout']||0xa;this[_0xa757('0x8')]=_0x3caeb0[_0xa757('0x8')]||_0xa757('0x9');this[_0xa757('0xa')]=_0x3caeb0[_0xa757('0xa')];this['mapAgentsId']={};this[_0xa757('0xb')]=0x0;this[_0xa757('0x0')]='';this[_0xa757('0xc')]();this[_0xa757('0xd')]();}SmsQueue[_0xa757('0xe')][_0xa757('0xc')]=function(){var _0x17408b=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0xa757('0xf')]['_rr']=_0x17408b;};SmsQueue['prototype'][_0xa757('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x32112b=0x0;_0x32112b<this[_0xa757('0xa')][_0xa757('0x10')];_0x32112b+=0x1){if(this[_0xa757('0xa')][_0x32112b][_0xa757('0x11')]){this[_0xa757('0x12')]+=0x1;}if(this[_0xa757('0xa')][_0x32112b][_0xa757('0x13')]){this[_0xa757('0x14')]+=0x1;}}this[_0xa757('0x15')]=this['loggedIn']-this[_0xa757('0x14')];this[_0xa757('0x15')]=this[_0xa757('0x15')]>=0x0?this['available']:0x0;var _0x54b305={'id':this['id'],'available':this[_0xa757('0x15')],'loggedIn':this[_0xa757('0x12')],'name':this[_0xa757('0x6')],'paused':this[_0xa757('0x14')],'waiting':this[_0xa757('0xb')]};var _0xe2d567=md5(JSON['stringify'](_0x54b305));if(this[_0xa757('0x0')]!==_0xe2d567){this['md5']=_0xe2d567;io['to'](util[_0xa757('0x16')](_0xa757('0x17'),_0x54b305[_0xa757('0x6')]))[_0xa757('0x18')]('sms_queue:save',_0x54b305);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0x0713=['smsPause','paused','available','stringify','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online'];(function(_0x560f2c,_0x55b4f1){var _0x44d73a=function(_0x18065e){while(--_0x18065e){_0x560f2c['push'](_0x560f2c['shift']());}};_0x44d73a(++_0x55b4f1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x3071('0x0'));var Redis=require(_0x3071('0x1'));var config=require(_0x3071('0x2'));config[_0x3071('0x3')]=_[_0x3071('0x4')](config['redis'],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x3')]));function SmsQueue(_0x3137c8){this['id']=_0x3137c8['id']||0x0;this[_0x3071('0x7')]=_0x3137c8[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x3137c8[_0x3071('0x8')]||0xa;this[_0x3071('0x9')]=_0x3137c8[_0x3071('0x9')]||_0x3071('0xa');this[_0x3071('0xb')]=_0x3137c8[_0x3071('0xb')];this['mapAgentsId']={};this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]='';this[_0x3071('0xe')]();this[_0x3071('0xf')]();}SmsQueue[_0x3071('0x10')]['updateRouting']=function(){var _0x2ace21=this[_0x3071('0x11')][_0x3071('0x12')];this[_0x3071('0x11')]=_[_0x3071('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x3071('0x12')]=_0x2ace21;};SmsQueue['prototype'][_0x3071('0xf')]=function(){this[_0x3071('0x14')]=0x0;this['paused']=0x0;for(var _0x104e73=0x0;_0x104e73<this['Agents'][_0x3071('0x15')];_0x104e73+=0x1){if(this[_0x3071('0xb')][_0x104e73][_0x3071('0x16')]){this[_0x3071('0x14')]+=0x1;}if(this[_0x3071('0xb')][_0x104e73][_0x3071('0x17')]){this[_0x3071('0x18')]+=0x1;}}this[_0x3071('0x19')]=this[_0x3071('0x14')]-this[_0x3071('0x18')];this['available']=this[_0x3071('0x19')]>=0x0?this[_0x3071('0x19')]:0x0;var _0x1068d9={'id':this['id'],'available':this[_0x3071('0x19')],'loggedIn':this[_0x3071('0x14')],'name':this[_0x3071('0x7')],'paused':this[_0x3071('0x18')],'waiting':this[_0x3071('0xc')]};var _0x502a16=md5(JSON[_0x3071('0x1a')](_0x1068d9));if(this[_0x3071('0xd')]!==_0x502a16){this[_0x3071('0xd')]=_0x502a16;io['to'](util['format'](_0x3071('0x1b'),_0x1068d9['name']))[_0x3071('0x1c')](_0x3071('0x1d'),_0x1068d9);}};module[_0x3071('0x1e')]=SmsQueue;
\ No newline at end of file
index 32bf0bc..778a8eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe985=['socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe985,0x94));var _0x5e98=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0xe985[_0x280f4a];return _0x1bb157;};'use strict';var _=require(_0x5e98('0x0'));var md5=require(_0x5e98('0x1'));var util=require('util');var Redis=require(_0x5e98('0x2'));var config=require(_0x5e98('0x3'));config[_0x5e98('0x4')]=_[_0x5e98('0x5')](config['redis'],{'host':_0x5e98('0x6'),'port':0x18eb});var io=require(_0x5e98('0x7'))(new Redis(config[_0x5e98('0x4')]));function WhatsappQueue(_0x314555){this['id']=_0x314555['id']||0x0;this[_0x5e98('0x8')]=_0x314555[_0x5e98('0x8')]||'';this['timeout']=_0x314555[_0x5e98('0x9')]||0xa;this[_0x5e98('0xa')]=_0x314555[_0x5e98('0xa')]||'beepall';this[_0x5e98('0xb')]=_0x314555['Agents'];this[_0x5e98('0xc')]={};this[_0x5e98('0xd')]=0x0;this[_0x5e98('0x1')]='';this[_0x5e98('0xe')]();this[_0x5e98('0xf')]();}WhatsappQueue['prototype'][_0x5e98('0xe')]=function(){var _0x534165=this[_0x5e98('0xc')]['_rr'];this[_0x5e98('0xc')]=_[_0x5e98('0x10')](this[_0x5e98('0xb')],'id');this[_0x5e98('0xc')][_0x5e98('0x11')]=_0x534165;};WhatsappQueue[_0x5e98('0x12')][_0x5e98('0xf')]=function(){this[_0x5e98('0x13')]=0x0;this[_0x5e98('0x14')]=0x0;for(var _0x4038f0=0x0;_0x4038f0<this[_0x5e98('0xb')][_0x5e98('0x15')];_0x4038f0+=0x1){if(this[_0x5e98('0xb')][_0x4038f0][_0x5e98('0x16')]){this[_0x5e98('0x13')]+=0x1;}if(this[_0x5e98('0xb')][_0x4038f0][_0x5e98('0x17')]){this['paused']+=0x1;}}this['available']=this['loggedIn']-this[_0x5e98('0x14')];this[_0x5e98('0x18')]=this[_0x5e98('0x18')]>=0x0?this[_0x5e98('0x18')]:0x0;var _0x41d76a={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x5e98('0x8')],'paused':this[_0x5e98('0x14')],'waiting':this[_0x5e98('0xd')]};var _0x5db26a=md5(JSON[_0x5e98('0x19')](_0x41d76a));if(this[_0x5e98('0x1')]!==_0x5db26a){this['md5']=_0x5db26a;io['to'](util[_0x5e98('0x1a')](_0x5e98('0x1b'),_0x41d76a[_0x5e98('0x8')]))[_0x5e98('0x1c')](_0x5e98('0x1d'),_0x41d76a);}};module[_0x5e98('0x1e')]=WhatsappQueue;
\ No newline at end of file
+var _0xf97b=['_rr','length','online','loggedIn','paused','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf97b,0x97));var _0xbf97=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf97b[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xbf97('0x0'));var md5=require('md5');var util=require(_0xbf97('0x1'));var Redis=require(_0xbf97('0x2'));var config=require(_0xbf97('0x3'));config[_0xbf97('0x4')]=_['defaults'](config[_0xbf97('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xbf97('0x5'))(new Redis(config[_0xbf97('0x4')]));function WhatsappQueue(_0x176f73){this['id']=_0x176f73['id']||0x0;this['name']=_0x176f73[_0xbf97('0x6')]||'';this[_0xbf97('0x7')]=_0x176f73[_0xbf97('0x7')]||0xa;this['strategy']=_0x176f73[_0xbf97('0x8')]||_0xbf97('0x9');this[_0xbf97('0xa')]=_0x176f73[_0xbf97('0xa')];this[_0xbf97('0xb')]={};this[_0xbf97('0xc')]=0x0;this[_0xbf97('0xd')]='';this[_0xbf97('0xe')]();this[_0xbf97('0xf')]();}WhatsappQueue[_0xbf97('0x10')][_0xbf97('0xe')]=function(){var _0x11872e=this['mapAgentsId'][_0xbf97('0x11')];this[_0xbf97('0xb')]=_['map'](this[_0xbf97('0xa')],'id');this['mapAgentsId']['_rr']=_0x11872e;};WhatsappQueue['prototype'][_0xbf97('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x4590b8=0x0;_0x4590b8<this[_0xbf97('0xa')][_0xbf97('0x12')];_0x4590b8+=0x1){if(this[_0xbf97('0xa')][_0x4590b8][_0xbf97('0x13')]){this[_0xbf97('0x14')]+=0x1;}if(this[_0xbf97('0xa')][_0x4590b8]['whatsappPause']){this[_0xbf97('0x15')]+=0x1;}}this[_0xbf97('0x16')]=this[_0xbf97('0x14')]-this[_0xbf97('0x15')];this['available']=this[_0xbf97('0x16')]>=0x0?this['available']:0x0;var _0x4a29e4={'id':this['id'],'available':this[_0xbf97('0x16')],'loggedIn':this[_0xbf97('0x14')],'name':this[_0xbf97('0x6')],'paused':this[_0xbf97('0x15')],'waiting':this['waiting']};var _0x2bf717=md5(JSON['stringify'](_0x4a29e4));if(this[_0xbf97('0xd')]!==_0x2bf717){this[_0xbf97('0xd')]=_0x2bf717;io['to'](util[_0xbf97('0x17')](_0xbf97('0x18'),_0x4a29e4[_0xbf97('0x6')]))[_0xbf97('0x19')](_0xbf97('0x1a'),_0x4a29e4);}};module[_0xbf97('0x1b')]=WhatsappQueue;
\ No newline at end of file
index f48c510..23b7fad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','agents','intervals','updateRealtime','initSmsQueues','updateRouting','initMailQueues','initWhatsappQueues','exports','bluebird','util','lodash','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/mailQueue','../model/faxQueue'];(function(_0x5587c8,_0x577e55){var _0x8704d5=function(_0x6fe7b0){while(--_0x6fe7b0){_0x5587c8['push'](_0x5587c8['shift']());}};_0x8704d5(++_0x577e55);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x00bb[_0x47e7cb];return _0x2a8874;};'use strict';var BPromise=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var _=require(_0xb00b('0x2'));var moment=require('moment');var Agent=require(_0xb00b('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xb00b('0x4'));var ChatQueue=require(_0xb00b('0x5'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0xb00b('0x6'));var FaxQueue=require(_0xb00b('0x7'));var WhatsappQueue=require('../model/whatsappQueue');var Realtime=function(){this['agents']={};this['intervals']={};this[_0xb00b('0x8')]={};this[_0xb00b('0x9')]={};this[_0xb00b('0xa')]={};this[_0xb00b('0xb')]={};this[_0xb00b('0xc')]={};this[_0xb00b('0xd')]={};this['chatQueuesWaitingInteractions']={};this['mailQueuesWaitingInteractions']={};this[_0xb00b('0xe')]={};this[_0xb00b('0xf')]={};this[_0xb00b('0x10')]={};this[_0xb00b('0x11')]={};};function freeIsNotKey(_0x28d3cc,_0x48e125,_0x3182db){var _0x5a63ed=_['mapKeys'](_0x28d3cc,function(_0x594075,_0x4ff792){return _0x594075[_0x3182db];});for(var _0x2d8ddf in _0x48e125){if(_0x48e125[_0xb00b('0x12')](_0x2d8ddf)){if(!_0x5a63ed[_0x2d8ddf]){delete _0x48e125[_0x2d8ddf];}}}}Realtime[_0xb00b('0x13')][_0xb00b('0x14')]=function(_0x1f1c1d,_0x4ada81){for(var _0x218de2 in _0x4ada81){if(_0x1f1c1d[_0xb00b('0x12')](_0x218de2)){_0x1f1c1d[_0x218de2]=_0x4ada81[_0x218de2];}}};Realtime['prototype'][_0xb00b('0x15')]=function(){var _0x1084a6=this;return function(_0x540b79){if(_0x540b79){freeIsNotKey(_0x540b79,_0x1084a6['agents'],'id');for(var _0x9b471e=0x0,_0x4dcd45={},_0x51d136={};_0x9b471e<_0x540b79[_0xb00b('0x16')];_0x9b471e+=0x1){_0x4dcd45=_0x540b79[_0x9b471e];if(_[_0xb00b('0x17')](_0x1084a6[_0xb00b('0x18')][_0x4dcd45['id']])){_0x1084a6[_0xb00b('0x18')][_0x4dcd45['id']]=new Agent(_0x4dcd45);}else{_0x1084a6['mergeFromDatabase'](_0x1084a6[_0xb00b('0x18')][_0x4dcd45['id']],_0x4dcd45);}}}return _0x1084a6['agents'];};};Realtime[_0xb00b('0x13')]['initIntervals']=function(){var _0x25d7a0=this;return function(_0x5e8d7b){if(_0x5e8d7b){freeIsNotKey(_0x5e8d7b,_0x25d7a0[_0xb00b('0x19')],'id');for(var _0x3355a3=0x0,_0x53ee68={},_0x55770c={};_0x3355a3<_0x5e8d7b[_0xb00b('0x16')];_0x3355a3+=0x1){_0x53ee68=_0x5e8d7b[_0x3355a3];if(_['isUndefined'](_0x25d7a0[_0xb00b('0x19')][_0x53ee68['id']])){_0x25d7a0[_0xb00b('0x19')][_0x53ee68['id']]=new Interval(_0x53ee68);}else{_0x25d7a0[_0xb00b('0x14')](_0x25d7a0[_0xb00b('0x19')][_0x53ee68['id']],_0x53ee68);}}}return _0x25d7a0['intervals'];};};Realtime[_0xb00b('0x13')]['initOpenchannelQueues']=function(){var _0x25a973=this;return function(_0x121ec7){if(_0x121ec7){freeIsNotKey(_0x121ec7,_0x25a973['openchannelQueues'],'id');for(var _0x231293=0x0,_0x2896d1={},_0x520444={};_0x231293<_0x121ec7[_0xb00b('0x16')];_0x231293+=0x1){_0x2896d1=_0x121ec7[_0x231293];if(_[_0xb00b('0x17')](_0x25a973['openchannelQueues'][_0x2896d1['id']])){_0x25a973[_0xb00b('0x8')][_0x2896d1['id']]=new OpenchannelQueue(_0x2896d1);}else{_0x25a973[_0xb00b('0x14')](_0x25a973[_0xb00b('0x8')][_0x2896d1['id']],_0x2896d1);}_0x25a973[_0xb00b('0x8')][_0x2896d1['id']]['updateRouting']();_0x25a973['openchannelQueues'][_0x2896d1['id']][_0xb00b('0x1a')]();}}return _0x25a973['openchannelQueues'];};};Realtime['prototype']['initChatQueues']=function(){var _0x16ac55=this;return function(_0x73b6b0){if(_0x73b6b0){freeIsNotKey(_0x73b6b0,_0x16ac55[_0xb00b('0x9')],'id');for(var _0x3825af=0x0,_0x1f14fa={},_0x197379={};_0x3825af<_0x73b6b0[_0xb00b('0x16')];_0x3825af+=0x1){_0x1f14fa=_0x73b6b0[_0x3825af];if(_['isUndefined'](_0x16ac55[_0xb00b('0x9')][_0x1f14fa['id']])){_0x16ac55['chatQueues'][_0x1f14fa['id']]=new ChatQueue(_0x1f14fa);}else{_0x16ac55[_0xb00b('0x14')](_0x16ac55[_0xb00b('0x9')][_0x1f14fa['id']],_0x1f14fa);}_0x16ac55[_0xb00b('0x9')][_0x1f14fa['id']]['updateRouting']();_0x16ac55[_0xb00b('0x9')][_0x1f14fa['id']][_0xb00b('0x1a')]();}}return _0x16ac55[_0xb00b('0x9')];};};Realtime[_0xb00b('0x13')][_0xb00b('0x1b')]=function(){var _0x2b9824=this;return function(_0x2e160a){if(_0x2e160a){freeIsNotKey(_0x2e160a,_0x2b9824[_0xb00b('0xa')],'id');for(var _0x149c1a=0x0,_0x54e247={},_0x2b5f41={};_0x149c1a<_0x2e160a[_0xb00b('0x16')];_0x149c1a+=0x1){_0x54e247=_0x2e160a[_0x149c1a];if(_['isUndefined'](_0x2b9824[_0xb00b('0xa')][_0x54e247['id']])){_0x2b9824[_0xb00b('0xa')][_0x54e247['id']]=new SmsQueue(_0x54e247);}else{_0x2b9824['mergeFromDatabase'](_0x2b9824[_0xb00b('0xa')][_0x54e247['id']],_0x54e247);}_0x2b9824['smsQueues'][_0x54e247['id']][_0xb00b('0x1c')]();_0x2b9824[_0xb00b('0xa')][_0x54e247['id']][_0xb00b('0x1a')]();}}return _0x2b9824[_0xb00b('0xa')];};};Realtime[_0xb00b('0x13')][_0xb00b('0x1d')]=function(){var _0x17f613=this;return function(_0x594840){if(_0x594840){freeIsNotKey(_0x594840,_0x17f613['mailQueues'],'id');for(var _0x5b04c2=0x0,_0x347e73={},_0xc21102={};_0x5b04c2<_0x594840[_0xb00b('0x16')];_0x5b04c2+=0x1){_0x347e73=_0x594840[_0x5b04c2];if(_[_0xb00b('0x17')](_0x17f613['mailQueues'][_0x347e73['id']])){_0x17f613[_0xb00b('0xb')][_0x347e73['id']]=new MailQueue(_0x347e73);}else{_0x17f613[_0xb00b('0x14')](_0x17f613[_0xb00b('0xb')][_0x347e73['id']],_0x347e73);}_0x17f613[_0xb00b('0xb')][_0x347e73['id']][_0xb00b('0x1c')]();_0x17f613[_0xb00b('0xb')][_0x347e73['id']][_0xb00b('0x1a')]();}}return _0x17f613[_0xb00b('0xb')];};};Realtime['prototype']['initFaxQueues']=function(){var _0x2ea41d=this;return function(_0x56022e){if(_0x56022e){freeIsNotKey(_0x56022e,_0x2ea41d[_0xb00b('0xc')],'id');for(var _0x1c5400=0x0,_0x29579b={},_0x45ca74={};_0x1c5400<_0x56022e[_0xb00b('0x16')];_0x1c5400+=0x1){_0x29579b=_0x56022e[_0x1c5400];if(_[_0xb00b('0x17')](_0x2ea41d[_0xb00b('0xc')][_0x29579b['id']])){_0x2ea41d['faxQueues'][_0x29579b['id']]=new FaxQueue(_0x29579b);}else{_0x2ea41d[_0xb00b('0x14')](_0x2ea41d[_0xb00b('0xc')][_0x29579b['id']],_0x29579b);}_0x2ea41d[_0xb00b('0xc')][_0x29579b['id']][_0xb00b('0x1c')]();_0x2ea41d[_0xb00b('0xc')][_0x29579b['id']][_0xb00b('0x1a')]();}}return _0x2ea41d['faxQueues'];};};Realtime[_0xb00b('0x13')][_0xb00b('0x1e')]=function(){var _0x4801e7=this;return function(_0x17ff34){if(_0x17ff34){freeIsNotKey(_0x17ff34,_0x4801e7[_0xb00b('0xd')],'id');for(var _0xa2ae04=0x0,_0x2d8620={},_0x2954e8={};_0xa2ae04<_0x17ff34['length'];_0xa2ae04+=0x1){_0x2d8620=_0x17ff34[_0xa2ae04];if(_[_0xb00b('0x17')](_0x4801e7[_0xb00b('0xd')][_0x2d8620['id']])){_0x4801e7[_0xb00b('0xd')][_0x2d8620['id']]=new WhatsappQueue(_0x2d8620);}else{_0x4801e7[_0xb00b('0x14')](_0x4801e7['whatsappQueues'][_0x2d8620['id']],_0x2d8620);}_0x4801e7['whatsappQueues'][_0x2d8620['id']][_0xb00b('0x1c')]();_0x4801e7[_0xb00b('0xd')][_0x2d8620['id']][_0xb00b('0x1a')]();}}return _0x4801e7[_0xb00b('0xd')];};};module[_0xb00b('0x1f')]=Realtime;
\ No newline at end of file
+var _0xe14b=['initMailQueues','mailQueues','initFaxQueues','faxQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','../model/agent','../model/interval','../model/chatQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues'];(function(_0x3cb30b,_0x504b3e){var _0x2ca717=function(_0x32a3d9){while(--_0x32a3d9){_0x3cb30b['push'](_0x3cb30b['shift']());}};_0x2ca717(++_0x504b3e);}(_0xe14b,0x93));var _0xbe14=function(_0x292941,_0x58ca24){_0x292941=_0x292941-0x0;var _0x32fe89=_0xe14b[_0x292941];return _0x32fe89;};'use strict';var BPromise=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0xbe14('0x2'));var Interval=require(_0xbe14('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0xbe14('0x4'));var SmsQueue=require('../model/smsQueue');var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0xbe14('0x5'));var WhatsappQueue=require(_0xbe14('0x6'));var Realtime=function(){this[_0xbe14('0x7')]={};this[_0xbe14('0x8')]={};this[_0xbe14('0x9')]={};this[_0xbe14('0xa')]={};this[_0xbe14('0xb')]={};this['mailQueues']={};this['faxQueues']={};this['whatsappQueues']={};this[_0xbe14('0xc')]={};this[_0xbe14('0xd')]={};this[_0xbe14('0xe')]={};this[_0xbe14('0xf')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x113243,_0x3f70cb,_0x4935cc){var _0x254c3b=_[_0xbe14('0x10')](_0x113243,function(_0x886a5e,_0x3d38c2){return _0x886a5e[_0x4935cc];});for(var _0x27792f in _0x3f70cb){if(_0x3f70cb[_0xbe14('0x11')](_0x27792f)){if(!_0x254c3b[_0x27792f]){delete _0x3f70cb[_0x27792f];}}}}Realtime[_0xbe14('0x12')][_0xbe14('0x13')]=function(_0x16893f,_0xa2cf72){for(var _0x1e4826 in _0xa2cf72){if(_0x16893f[_0xbe14('0x11')](_0x1e4826)){_0x16893f[_0x1e4826]=_0xa2cf72[_0x1e4826];}}};Realtime[_0xbe14('0x12')]['initAgents']=function(){var _0x55b3a7=this;return function(_0x3f58f5){if(_0x3f58f5){freeIsNotKey(_0x3f58f5,_0x55b3a7[_0xbe14('0x7')],'id');for(var _0xf4ac9=0x0,_0x37ce4e={},_0x4e8f34={};_0xf4ac9<_0x3f58f5[_0xbe14('0x14')];_0xf4ac9+=0x1){_0x37ce4e=_0x3f58f5[_0xf4ac9];if(_[_0xbe14('0x15')](_0x55b3a7[_0xbe14('0x7')][_0x37ce4e['id']])){_0x55b3a7[_0xbe14('0x7')][_0x37ce4e['id']]=new Agent(_0x37ce4e);}else{_0x55b3a7[_0xbe14('0x13')](_0x55b3a7[_0xbe14('0x7')][_0x37ce4e['id']],_0x37ce4e);}}}return _0x55b3a7[_0xbe14('0x7')];};};Realtime['prototype'][_0xbe14('0x16')]=function(){var _0x456ca8=this;return function(_0x329588){if(_0x329588){freeIsNotKey(_0x329588,_0x456ca8[_0xbe14('0x8')],'id');for(var _0x3249da=0x0,_0x37e4c1={},_0x59a9e3={};_0x3249da<_0x329588[_0xbe14('0x14')];_0x3249da+=0x1){_0x37e4c1=_0x329588[_0x3249da];if(_[_0xbe14('0x15')](_0x456ca8[_0xbe14('0x8')][_0x37e4c1['id']])){_0x456ca8[_0xbe14('0x8')][_0x37e4c1['id']]=new Interval(_0x37e4c1);}else{_0x456ca8[_0xbe14('0x13')](_0x456ca8['intervals'][_0x37e4c1['id']],_0x37e4c1);}}}return _0x456ca8[_0xbe14('0x8')];};};Realtime['prototype'][_0xbe14('0x17')]=function(){var _0x56e80c=this;return function(_0x32e8eb){if(_0x32e8eb){freeIsNotKey(_0x32e8eb,_0x56e80c['openchannelQueues'],'id');for(var _0x274018=0x0,_0x3d3608={},_0x505dbd={};_0x274018<_0x32e8eb[_0xbe14('0x14')];_0x274018+=0x1){_0x3d3608=_0x32e8eb[_0x274018];if(_['isUndefined'](_0x56e80c[_0xbe14('0x9')][_0x3d3608['id']])){_0x56e80c['openchannelQueues'][_0x3d3608['id']]=new OpenchannelQueue(_0x3d3608);}else{_0x56e80c[_0xbe14('0x13')](_0x56e80c[_0xbe14('0x9')][_0x3d3608['id']],_0x3d3608);}_0x56e80c[_0xbe14('0x9')][_0x3d3608['id']][_0xbe14('0x18')]();_0x56e80c[_0xbe14('0x9')][_0x3d3608['id']][_0xbe14('0x19')]();}}return _0x56e80c['openchannelQueues'];};};Realtime[_0xbe14('0x12')][_0xbe14('0x1a')]=function(){var _0x391556=this;return function(_0x169369){if(_0x169369){freeIsNotKey(_0x169369,_0x391556['chatQueues'],'id');for(var _0x16f884=0x0,_0x29fc64={},_0x59bf34={};_0x16f884<_0x169369[_0xbe14('0x14')];_0x16f884+=0x1){_0x29fc64=_0x169369[_0x16f884];if(_[_0xbe14('0x15')](_0x391556[_0xbe14('0xa')][_0x29fc64['id']])){_0x391556[_0xbe14('0xa')][_0x29fc64['id']]=new ChatQueue(_0x29fc64);}else{_0x391556[_0xbe14('0x13')](_0x391556[_0xbe14('0xa')][_0x29fc64['id']],_0x29fc64);}_0x391556[_0xbe14('0xa')][_0x29fc64['id']][_0xbe14('0x18')]();_0x391556[_0xbe14('0xa')][_0x29fc64['id']][_0xbe14('0x19')]();}}return _0x391556[_0xbe14('0xa')];};};Realtime[_0xbe14('0x12')][_0xbe14('0x1b')]=function(){var _0x10ae36=this;return function(_0x223f7a){if(_0x223f7a){freeIsNotKey(_0x223f7a,_0x10ae36[_0xbe14('0xb')],'id');for(var _0x6ba36c=0x0,_0x2ff48e={},_0x29e76a={};_0x6ba36c<_0x223f7a[_0xbe14('0x14')];_0x6ba36c+=0x1){_0x2ff48e=_0x223f7a[_0x6ba36c];if(_['isUndefined'](_0x10ae36[_0xbe14('0xb')][_0x2ff48e['id']])){_0x10ae36['smsQueues'][_0x2ff48e['id']]=new SmsQueue(_0x2ff48e);}else{_0x10ae36['mergeFromDatabase'](_0x10ae36[_0xbe14('0xb')][_0x2ff48e['id']],_0x2ff48e);}_0x10ae36['smsQueues'][_0x2ff48e['id']][_0xbe14('0x18')]();_0x10ae36[_0xbe14('0xb')][_0x2ff48e['id']]['updateRealtime']();}}return _0x10ae36['smsQueues'];};};Realtime['prototype'][_0xbe14('0x1c')]=function(){var _0xa3d24=this;return function(_0x5f27b6){if(_0x5f27b6){freeIsNotKey(_0x5f27b6,_0xa3d24[_0xbe14('0x1d')],'id');for(var _0x1faf3e=0x0,_0x452635={},_0x1aa849={};_0x1faf3e<_0x5f27b6[_0xbe14('0x14')];_0x1faf3e+=0x1){_0x452635=_0x5f27b6[_0x1faf3e];if(_['isUndefined'](_0xa3d24['mailQueues'][_0x452635['id']])){_0xa3d24[_0xbe14('0x1d')][_0x452635['id']]=new MailQueue(_0x452635);}else{_0xa3d24['mergeFromDatabase'](_0xa3d24['mailQueues'][_0x452635['id']],_0x452635);}_0xa3d24['mailQueues'][_0x452635['id']][_0xbe14('0x18')]();_0xa3d24[_0xbe14('0x1d')][_0x452635['id']][_0xbe14('0x19')]();}}return _0xa3d24[_0xbe14('0x1d')];};};Realtime[_0xbe14('0x12')][_0xbe14('0x1e')]=function(){var _0xcdc50=this;return function(_0x10ec3c){if(_0x10ec3c){freeIsNotKey(_0x10ec3c,_0xcdc50[_0xbe14('0x1f')],'id');for(var _0x2dfd5a=0x0,_0x41652d={},_0x32c59d={};_0x2dfd5a<_0x10ec3c['length'];_0x2dfd5a+=0x1){_0x41652d=_0x10ec3c[_0x2dfd5a];if(_['isUndefined'](_0xcdc50[_0xbe14('0x1f')][_0x41652d['id']])){_0xcdc50[_0xbe14('0x1f')][_0x41652d['id']]=new FaxQueue(_0x41652d);}else{_0xcdc50[_0xbe14('0x13')](_0xcdc50['faxQueues'][_0x41652d['id']],_0x41652d);}_0xcdc50[_0xbe14('0x1f')][_0x41652d['id']][_0xbe14('0x18')]();_0xcdc50[_0xbe14('0x1f')][_0x41652d['id']][_0xbe14('0x19')]();}}return _0xcdc50[_0xbe14('0x1f')];};};Realtime[_0xbe14('0x12')][_0xbe14('0x20')]=function(){var _0x128843=this;return function(_0x1b2608){if(_0x1b2608){freeIsNotKey(_0x1b2608,_0x128843['whatsappQueues'],'id');for(var _0xe51424=0x0,_0x841b71={},_0x3463c4={};_0xe51424<_0x1b2608[_0xbe14('0x14')];_0xe51424+=0x1){_0x841b71=_0x1b2608[_0xe51424];if(_[_0xbe14('0x15')](_0x128843[_0xbe14('0x21')][_0x841b71['id']])){_0x128843['whatsappQueues'][_0x841b71['id']]=new WhatsappQueue(_0x841b71);}else{_0x128843[_0xbe14('0x13')](_0x128843[_0xbe14('0x21')][_0x841b71['id']],_0x841b71);}_0x128843[_0xbe14('0x21')][_0x841b71['id']][_0xbe14('0x18')]();_0x128843['whatsappQueues'][_0x841b71['id']]['updateRealtime']();}}return _0x128843[_0xbe14('0x21')];};};module[_0xbe14('0x22')]=Realtime;
\ No newline at end of file
index cca73aa..0660aed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35db=['update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x35db,0x1aa));var _0xb35d=function(_0x4b8c13,_0x46fffc){_0x4b8c13=_0x4b8c13-0x0;var _0x4b3272=_0x35db[_0x4b8c13];return _0x4b3272;};'use strict';var client=require(_0xb35d('0x0'));exports[_0xb35d('0x1')]=function(_0x1da747,_0xda38c6){return client[_0xb35d('0x2')]('UpdateChatInteraction',{'body':_0xda38c6,'options':{'where':{'id':_0x1da747}},'log':_0xb35d('0x3')});};exports[_0xb35d('0x4')]=function(_0x17a94e,_0x13fe7c){return client[_0xb35d('0x2')](_0xb35d('0x5'),{'body':_0x13fe7c,'options':{'where':{'id':_0x17a94e}},'log':_0xb35d('0x6')});};
\ No newline at end of file
+var _0xdeb5=['addTagsToChatInteraction','updateChatInteraction','Request','AddTagsToChatInteraction'];(function(_0x57c0bd,_0x74a622){var _0x279c96=function(_0x137a41){while(--_0x137a41){_0x57c0bd['push'](_0x57c0bd['shift']());}};_0x279c96(++_0x74a622);}(_0xdeb5,0x179));var _0x5deb=function(_0x39bf4d,_0x13f45b){_0x39bf4d=_0x39bf4d-0x0;var _0x453884=_0xdeb5[_0x39bf4d];return _0x453884;};'use strict';var client=require('../client');exports['update']=function(_0x2320e7,_0xdd5ce1){return client['Request']('UpdateChatInteraction',{'body':_0xdd5ce1,'options':{'where':{'id':_0x2320e7}},'log':_0x5deb('0x0')});};exports['addTags']=function(_0x2c3954,_0xa81416){return client[_0x5deb('0x1')](_0x5deb('0x2'),{'body':_0xa81416,'options':{'where':{'id':_0x2c3954}},'log':_0x5deb('0x3')});};
\ No newline at end of file
index 6a365ab..21cf937 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236d=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0xa61eb9,_0x5ca44d){var _0x53a885=function(_0x14536d){while(--_0x14536d){_0xa61eb9['push'](_0xa61eb9['shift']());}};_0x53a885(++_0x5ca44d);}(_0x236d,0xf9));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xd236('0x0'));exports[_0xd236('0x1')]=function(_0x44b954){return client[_0xd236('0x2')](_0xd236('0x3'),{'body':_0x44b954,'log':_0xd236('0x4')});};
\ No newline at end of file
+var _0x604f=['Request','CreateChatMessage','createChatMessage','../client'];(function(_0x15703d,_0x5cac2e){var _0x364368=function(_0x4bc6f0){while(--_0x4bc6f0){_0x15703d['push'](_0x15703d['shift']());}};_0x364368(++_0x5cac2e);}(_0x604f,0x183));var _0xf604=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x604f[_0x2d2c16];return _0x53f2fb;};'use strict';var client=require(_0xf604('0x0'));exports['create']=function(_0x50e5dc){return client[_0xf604('0x1')](_0xf604('0x2'),{'body':_0x50e5dc,'log':_0xf604('0x3')});};
\ No newline at end of file
index 3552cc9..f633ea0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed40=['getChatQueues','Request','name','timeout','User','Agents','online','chatPause','../client'];(function(_0x12d2f2,_0x34643f){var _0x2c6264=function(_0xfdb9b7){while(--_0xfdb9b7){_0x12d2f2['push'](_0x12d2f2['shift']());}};_0x2c6264(++_0x34643f);}(_0xed40,0x13a));var _0x0ed4=function(_0x30a545,_0x13a349){_0x30a545=_0x30a545-0x0;var _0x2b961f=_0xed40[_0x30a545];return _0x2b961f;};'use strict';var client=require(_0x0ed4('0x0'));exports[_0x0ed4('0x1')]=function(){return function(){return client[_0x0ed4('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x0ed4('0x3'),_0x0ed4('0x4'),'strategy'],'include':[{'model':_0x0ed4('0x5'),'as':_0x0ed4('0x6'),'attributes':['id',_0x0ed4('0x3'),_0x0ed4('0x7'),_0x0ed4('0x8')]}]},'log':_0x0ed4('0x1')});};};
\ No newline at end of file
+var _0x5984=['GetChatQueue','strategy','User','Agents','online','chatPause','getChatQueues','Request'];(function(_0x445975,_0x3df67c){var _0x4bf86a=function(_0x3fffc5){while(--_0x3fffc5){_0x445975['push'](_0x445975['shift']());}};_0x4bf86a(++_0x3df67c);}(_0x5984,0x12e));var _0x4598=function(_0x1fd0a0,_0x10990d){_0x1fd0a0=_0x1fd0a0-0x0;var _0x16b07a=_0x5984[_0x1fd0a0];return _0x16b07a;};'use strict';var client=require('../client');exports[_0x4598('0x0')]=function(){return function(){return client[_0x4598('0x1')](_0x4598('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x4598('0x3')],'include':[{'model':_0x4598('0x4'),'as':_0x4598('0x5'),'attributes':['id','name',_0x4598('0x6'),_0x4598('0x7')]}]},'log':_0x4598('0x0')});};};
\ No newline at end of file
index 3625af4..192b89f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf5c=['DESC','UpdateChatQueueReport','../client','create','CreateChatQueueReport','update','Request'];(function(_0x5ae541,_0x541b4b){var _0x5badba=function(_0x2ce159){while(--_0x2ce159){_0x5ae541['push'](_0x5ae541['shift']());}};_0x5badba(++_0x541b4b);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x92116d,_0xa6ee1b){_0x92116d=_0x92116d-0x0;var _0xfe4f60=_0xbf5c[_0x92116d];return _0xfe4f60;};'use strict';var client=require(_0xcbf5('0x0'));exports[_0xcbf5('0x1')]=function(_0x20db36){return client['Request'](_0xcbf5('0x2'),{'body':_0x20db36,'log':_0xcbf5('0x2')});};exports[_0xcbf5('0x3')]=function(_0x536351,_0xbbe51d){return client[_0xcbf5('0x4')]('UpdateChatQueueReport',{'body':_0xbbe51d,'options':{'where':{'uniqueid':_0x536351},'order':[['id',_0xcbf5('0x5')]],'limit':0x1},'log':_0xcbf5('0x6')});};
\ No newline at end of file
+var _0x2830=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0xb1e999,_0x5f064d){var _0x209e88=function(_0x4b35f4){while(--_0x4b35f4){_0xb1e999['push'](_0xb1e999['shift']());}};_0x209e88(++_0x5f064d);}(_0x2830,0x117));var _0x0283=function(_0xa0accc,_0x25033b){_0xa0accc=_0xa0accc-0x0;var _0x4ca5df=_0x2830[_0xa0accc];return _0x4ca5df;};'use strict';var client=require(_0x0283('0x0'));exports[_0x0283('0x1')]=function(_0x4ee0cd){return client[_0x0283('0x2')](_0x0283('0x3'),{'body':_0x4ee0cd,'log':_0x0283('0x3')});};exports[_0x0283('0x4')]=function(_0x56984a,_0x414c89){return client['Request'](_0x0283('0x5'),{'body':_0x414c89,'options':{'where':{'uniqueid':_0x56984a},'order':[['id',_0x0283('0x6')]],'limit':0x1},'log':_0x0283('0x5')});};
\ No newline at end of file
index 353882b..c6baf13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x768e=['../client','update','Request','UpdateFaxInteraction','updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x768e,0x128));var _0xe768=function(_0x31bd4f,_0x3ff41c){_0x31bd4f=_0x31bd4f-0x0;var _0x3bf38a=_0x768e[_0x31bd4f];return _0x3bf38a;};'use strict';var client=require(_0xe768('0x0'));exports[_0xe768('0x1')]=function(_0x5a4abc,_0x34affb){return client[_0xe768('0x2')](_0xe768('0x3'),{'body':_0x34affb,'options':{'where':{'id':_0x5a4abc}},'log':_0xe768('0x4')});};exports[_0xe768('0x5')]=function(_0x894a1b,_0x5f29f6){return client[_0xe768('0x2')](_0xe768('0x6'),{'body':_0x5f29f6,'options':{'where':{'id':_0x894a1b}},'log':_0xe768('0x7')});};
\ No newline at end of file
+var _0xa831=['updateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction'];(function(_0x52d2d4,_0x4b8337){var _0x8925c1=function(_0x464b45){while(--_0x464b45){_0x52d2d4['push'](_0x52d2d4['shift']());}};_0x8925c1(++_0x4b8337);}(_0xa831,0x1ca));var _0x1a83=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0xa831[_0x2142c8];return _0x4286e9;};'use strict';var client=require(_0x1a83('0x0'));exports[_0x1a83('0x1')]=function(_0x3c86c0,_0x2db900){return client[_0x1a83('0x2')](_0x1a83('0x3'),{'body':_0x2db900,'options':{'where':{'id':_0x3c86c0}},'log':_0x1a83('0x4')});};exports['addTags']=function(_0x330633,_0x3cd06a){return client[_0x1a83('0x2')](_0x1a83('0x5'),{'body':_0x3cd06a,'options':{'where':{'id':_0x330633}},'log':_0x1a83('0x6')});};
\ No newline at end of file
index d02117d..a469802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e78=['create','CreateFaxMessage','../client'];(function(_0x55257d,_0x3998ec){var _0x4d296d=function(_0x522f05){while(--_0x522f05){_0x55257d['push'](_0x55257d['shift']());}};_0x4d296d(++_0x3998ec);}(_0x0e78,0x1e2));var _0x80e7=function(_0x2cd7e6,_0x254f5e){_0x2cd7e6=_0x2cd7e6-0x0;var _0x78374e=_0x0e78[_0x2cd7e6];return _0x78374e;};'use strict';var client=require(_0x80e7('0x0'));exports[_0x80e7('0x1')]=function(_0x17bf03){return client['Request'](_0x80e7('0x2'),{'body':_0x17bf03,'log':'createFaxMessage'});};
\ No newline at end of file
+var _0xcedf=['createFaxMessage','../client','create'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xcedf,0x19f));var _0xfced=function(_0x5a461b,_0x306e5c){_0x5a461b=_0x5a461b-0x0;var _0x118877=_0xcedf[_0x5a461b];return _0x118877;};'use strict';var client=require(_0xfced('0x0'));exports[_0xfced('0x1')]=function(_0x2b9cc7){return client['Request']('CreateFaxMessage',{'body':_0x2b9cc7,'log':_0xfced('0x2')});};
\ No newline at end of file
index eb5791e..8c06f8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe25d=['online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xe25d,0x1ba));var _0xde25=function(_0x4c7422,_0x118e89){_0x4c7422=_0x4c7422-0x0;var _0xbad45e=_0xe25d[_0x4c7422];return _0xbad45e;};'use strict';var client=require(_0xde25('0x0'));exports[_0xde25('0x1')]=function(){return function(){return client[_0xde25('0x2')](_0xde25('0x3'),{'options':{'raw':![],'attributes':['id',_0xde25('0x4'),_0xde25('0x5'),_0xde25('0x6')],'include':[{'model':_0xde25('0x7'),'as':_0xde25('0x8'),'attributes':['id',_0xde25('0x4'),_0xde25('0x9'),_0xde25('0xa')]}]},'log':_0xde25('0x1')});};};
\ No newline at end of file
+var _0x560f=['getFaxQueues','GetFaxQueue','name','strategy','User','Agents','online','faxPause','../client'];(function(_0x19dd4c,_0x181548){var _0x13b58e=function(_0x12b466){while(--_0x12b466){_0x19dd4c['push'](_0x19dd4c['shift']());}};_0x13b58e(++_0x181548);}(_0x560f,0x74));var _0xf560=function(_0x1cf96e,_0x383742){_0x1cf96e=_0x1cf96e-0x0;var _0xc79dc7=_0x560f[_0x1cf96e];return _0xc79dc7;};'use strict';var client=require(_0xf560('0x0'));exports[_0xf560('0x1')]=function(){return function(){return client['Request'](_0xf560('0x2'),{'options':{'raw':![],'attributes':['id',_0xf560('0x3'),'timeout',_0xf560('0x4')],'include':[{'model':_0xf560('0x5'),'as':_0xf560('0x6'),'attributes':['id',_0xf560('0x3'),_0xf560('0x7'),_0xf560('0x8')]}]},'log':_0xf560('0x1')});};};
\ No newline at end of file
index 8d88508..0f8a331 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0af1=['DESC','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x35279b,_0x337eae){var _0x36da9d=function(_0x5a2f15){while(--_0x5a2f15){_0x35279b['push'](_0x35279b['shift']());}};_0x36da9d(++_0x337eae);}(_0x0af1,0x135));var _0x10af=function(_0x2c8570,_0x102d1b){_0x2c8570=_0x2c8570-0x0;var _0x3621c0=_0x0af1[_0x2c8570];return _0x3621c0;};'use strict';var client=require('../client');exports['create']=function(_0x4189e8){return client[_0x10af('0x0')](_0x10af('0x1'),{'body':_0x4189e8,'log':_0x10af('0x1')});};exports['update']=function(_0x36be51,_0x30a103){return client['Request'](_0x10af('0x2'),{'body':_0x30a103,'options':{'where':{'uniqueid':_0x36be51},'order':[['id',_0x10af('0x3')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0x9a14=['Request','CreateFaxQueueReport','update'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0x9a14,0xa8));var _0x49a1=function(_0x188970,_0x1e51e2){_0x188970=_0x188970-0x0;var _0x134c1f=_0x9a14[_0x188970];return _0x134c1f;};'use strict';var client=require('../client');exports['create']=function(_0xece3f3){return client[_0x49a1('0x0')](_0x49a1('0x1'),{'body':_0xece3f3,'log':_0x49a1('0x1')});};exports[_0x49a1('0x2')]=function(_0x26467b,_0x10de2e){return client[_0x49a1('0x0')]('UpdateFaxQueueReport',{'body':_0x10de2e,'options':{'where':{'uniqueid':_0x26467b},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index 22c5f03..c498b4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3495=['Request','GetInterval','name','Interval','Intervals','interval','../client','getIntervals'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0x3495,0x1de));var _0x5349=function(_0x19f617,_0x2c78db){_0x19f617=_0x19f617-0x0;var _0x434ac8=_0x3495[_0x19f617];return _0x434ac8;};'use strict';var client=require(_0x5349('0x0'));exports[_0x5349('0x1')]=function(){return function(){return client[_0x5349('0x2')](_0x5349('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5349('0x4')],'include':[{'model':_0x5349('0x5'),'as':_0x5349('0x6'),'attributes':['id',_0x5349('0x4'),_0x5349('0x7')]}]},'log':'getIntervals'});};};
\ No newline at end of file
+var _0xdd6e=['GetInterval','Interval','Intervals','name','interval','../client','getIntervals','Request'];(function(_0x48026e,_0x2bb295){var _0x4b42aa=function(_0x42c647){while(--_0x42c647){_0x48026e['push'](_0x48026e['shift']());}};_0x4b42aa(++_0x2bb295);}(_0xdd6e,0xa5));var _0xedd6=function(_0x29b90f,_0x1f6cb5){_0x29b90f=_0x29b90f-0x0;var _0x5672d1=_0xdd6e[_0x29b90f];return _0x5672d1;};'use strict';var client=require(_0xedd6('0x0'));exports[_0xedd6('0x1')]=function(){return function(){return client[_0xedd6('0x2')](_0xedd6('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xedd6('0x4'),'as':_0xedd6('0x5'),'attributes':['id',_0xedd6('0x6'),_0xedd6('0x7')]}]},'log':'getIntervals'});};};
\ No newline at end of file
index 798edbd..3320afa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc328=['update','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xc328,0x15d));var _0x8c32=function(_0x4de8c4,_0xe40b2a){_0x4de8c4=_0x4de8c4-0x0;var _0x1eca7f=_0xc328[_0x4de8c4];return _0x1eca7f;};'use strict';var client=require(_0x8c32('0x0'));exports[_0x8c32('0x1')]=function(_0x14689e,_0x5ee35f){return client[_0x8c32('0x2')](_0x8c32('0x3'),{'body':_0x5ee35f,'options':{'where':{'id':_0x14689e}},'log':'updateMailInteraction'});};exports[_0x8c32('0x4')]=function(_0x3921e0,_0xc4d9fa){return client[_0x8c32('0x2')](_0x8c32('0x5'),{'body':_0xc4d9fa,'options':{'where':{'id':_0x3921e0}},'log':_0x8c32('0x6')});};
\ No newline at end of file
+var _0x3bc1=['UpdateMailInteraction','AddTagsToMailInteraction','../client','update','Request'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x3bc1,0x7a));var _0x13bc=function(_0x22dcb7,_0x124a13){_0x22dcb7=_0x22dcb7-0x0;var _0x385622=_0x3bc1[_0x22dcb7];return _0x385622;};'use strict';var client=require(_0x13bc('0x0'));exports[_0x13bc('0x1')]=function(_0x6f611d,_0x71382){return client[_0x13bc('0x2')](_0x13bc('0x3'),{'body':_0x71382,'options':{'where':{'id':_0x6f611d}},'log':'updateMailInteraction'});};exports['addTags']=function(_0xb7c44,_0x565284){return client[_0x13bc('0x2')](_0x13bc('0x4'),{'body':_0x565284,'options':{'where':{'id':_0xb7c44}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index e35ce64..5bbc089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dca=['../client','create','Request','createMailMessage'];(function(_0x119c7a,_0x2b9118){var _0x319ee4=function(_0x48f682){while(--_0x48f682){_0x119c7a['push'](_0x119c7a['shift']());}};_0x319ee4(++_0x2b9118);}(_0x3dca,0x84));var _0xa3dc=function(_0x181d64,_0x21239c){_0x181d64=_0x181d64-0x0;var _0x3d6c65=_0x3dca[_0x181d64];return _0x3d6c65;};'use strict';var client=require(_0xa3dc('0x0'));exports[_0xa3dc('0x1')]=function(_0x597ea1){return client[_0xa3dc('0x2')]('CreateMailMessage',{'body':_0x597ea1,'log':_0xa3dc('0x3')});};
\ No newline at end of file
+var _0xff02=['Request'];(function(_0x157042,_0x5101e7){var _0x18dd54=function(_0x3ac994){while(--_0x3ac994){_0x157042['push'](_0x157042['shift']());}};_0x18dd54(++_0x5101e7);}(_0xff02,0xb4));var _0x2ff0=function(_0x14b748,_0x48ba0b){_0x14b748=_0x14b748-0x0;var _0x5f28e9=_0xff02[_0x14b748];return _0x5f28e9;};'use strict';var client=require('../client');exports['create']=function(_0x561363){return client[_0x2ff0('0x0')]('CreateMailMessage',{'body':_0x561363,'log':'createMailMessage'});};
\ No newline at end of file
index 939cfbd..3eac20f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cdd=['../client','getMailQueues','name','timeout','strategy','User','Agents','online','mailPause'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x7cdd,0x144));var _0xd7cd=function(_0x4215d4,_0x371a83){_0x4215d4=_0x4215d4-0x0;var _0x433650=_0x7cdd[_0x4215d4];return _0x433650;};'use strict';var client=require(_0xd7cd('0x0'));exports[_0xd7cd('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xd7cd('0x2'),_0xd7cd('0x3'),_0xd7cd('0x4')],'include':[{'model':_0xd7cd('0x5'),'as':_0xd7cd('0x6'),'attributes':['id',_0xd7cd('0x2'),_0xd7cd('0x7'),_0xd7cd('0x8')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0x27c8=['online','getMailQueues','GetMailQueue','name','timeout','Agents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27c8,0x1db));var _0x827c=function(_0x32aece,_0x18a8da){_0x32aece=_0x32aece-0x0;var _0x1e3683=_0x27c8[_0x32aece];return _0x1e3683;};'use strict';var client=require('../client');exports[_0x827c('0x0')]=function(){return function(){return client['Request'](_0x827c('0x1'),{'options':{'raw':![],'attributes':['id',_0x827c('0x2'),_0x827c('0x3'),'strategy'],'include':[{'model':'User','as':_0x827c('0x4'),'attributes':['id',_0x827c('0x2'),_0x827c('0x5'),'mailPause']}]},'log':_0x827c('0x0')});};};
\ No newline at end of file
index f55c698..621b018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30f4=['Request','UpdateMailQueueReport','DESC','../client','create','update'];(function(_0x4abbe0,_0x538b86){var _0x56fee9=function(_0x5b9ead){while(--_0x5b9ead){_0x4abbe0['push'](_0x4abbe0['shift']());}};_0x56fee9(++_0x538b86);}(_0x30f4,0x1ad));var _0x430f=function(_0x1b62f1,_0xbff968){_0x1b62f1=_0x1b62f1-0x0;var _0x582f72=_0x30f4[_0x1b62f1];return _0x582f72;};'use strict';var client=require(_0x430f('0x0'));exports[_0x430f('0x1')]=function(_0x2843bc){return client['Request']('CreateMailQueueReport',{'body':_0x2843bc,'log':'CreateMailQueueReport'});};exports[_0x430f('0x2')]=function(_0x4458f6,_0x4e1ef2){return client[_0x430f('0x3')](_0x430f('0x4'),{'body':_0x4e1ef2,'options':{'where':{'uniqueid':_0x4458f6},'order':[['id',_0x430f('0x5')]],'limit':0x1},'log':_0x430f('0x4')});};
\ No newline at end of file
+var _0x2b13=['DESC','../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x4776f8,_0x207e21){var _0x1b5aba=function(_0x36f081){while(--_0x36f081){_0x4776f8['push'](_0x4776f8['shift']());}};_0x1b5aba(++_0x207e21);}(_0x2b13,0x1a5));var _0x32b1=function(_0x5728c8,_0xa240b4){_0x5728c8=_0x5728c8-0x0;var _0x7801a2=_0x2b13[_0x5728c8];return _0x7801a2;};'use strict';var client=require(_0x32b1('0x0'));exports[_0x32b1('0x1')]=function(_0x59bd4e){return client[_0x32b1('0x2')]('CreateMailQueueReport',{'body':_0x59bd4e,'log':_0x32b1('0x3')});};exports['update']=function(_0x5ef3de,_0x994c12){return client[_0x32b1('0x2')](_0x32b1('0x4'),{'body':_0x994c12,'options':{'where':{'uniqueid':_0x5ef3de},'order':[['id',_0x32b1('0x5')]],'limit':0x1},'log':_0x32b1('0x4')});};
\ No newline at end of file
index c65043a..32b35b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x639c=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x199853,_0x3b006f){var _0x5bac31=function(_0x12ab53){while(--_0x12ab53){_0x199853['push'](_0x199853['shift']());}};_0x5bac31(++_0x3b006f);}(_0x639c,0x1b3));var _0xc639=function(_0x3fadd1,_0x289fee){_0x3fadd1=_0x3fadd1-0x0;var _0x22cb57=_0x639c[_0x3fadd1];return _0x22cb57;};'use strict';var client=require(_0xc639('0x0'));exports[_0xc639('0x1')]=function(_0x3ba1a5,_0x10a3ca){return client[_0xc639('0x2')]('UpdateOpenchannelInteraction',{'body':_0x10a3ca,'options':{'where':{'id':_0x3ba1a5}},'log':_0xc639('0x3')});};exports['addTags']=function(_0x32003a,_0x5230){return client[_0xc639('0x2')](_0xc639('0x4'),{'body':_0x5230,'options':{'where':{'id':_0x32003a}},'log':_0xc639('0x5')});};
\ No newline at end of file
+var _0xc313=['updateOpenchannelInteraction','addTags','Request','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction'];(function(_0x4d3526,_0x2e3181){var _0x5ef3d5=function(_0x45f068){while(--_0x45f068){_0x4d3526['push'](_0x4d3526['shift']());}};_0x5ef3d5(++_0x2e3181);}(_0xc313,0x17e));var _0x3c31=function(_0x2ddd2f,_0x3430aa){_0x2ddd2f=_0x2ddd2f-0x0;var _0x231908=_0xc313[_0x2ddd2f];return _0x231908;};'use strict';var client=require(_0x3c31('0x0'));exports[_0x3c31('0x1')]=function(_0x5b3269,_0x95d259){return client['Request'](_0x3c31('0x2'),{'body':_0x95d259,'options':{'where':{'id':_0x5b3269}},'log':_0x3c31('0x3')});};exports[_0x3c31('0x4')]=function(_0x29009d,_0x31e249){return client[_0x3c31('0x5')]('AddTagsToOpenchannelInteraction',{'body':_0x31e249,'options':{'where':{'id':_0x29009d}},'log':_0x3c31('0x6')});};
\ No newline at end of file
index 24ad0f7..329951e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['CreateOpenchannelMessage','createOpenchannelMessage','Request'];(function(_0x4f83ea,_0x5a6539){var _0xcd7ee5=function(_0x13532b){while(--_0x13532b){_0x4f83ea['push'](_0x4f83ea['shift']());}};_0xcd7ee5(++_0x5a6539);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xcb91[_0x533e4e];return _0x1f14bb;};'use strict';var client=require('../client');exports['create']=function(_0x26fe42){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'body':_0x26fe42,'log':_0x1cb9('0x2')});};
\ No newline at end of file
+var _0xb43b=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2969f3,_0x33aedb){_0x2969f3=_0x2969f3-0x0;var _0x292c7b=_0xb43b[_0x2969f3];return _0x292c7b;};'use strict';var client=require(_0xbb43('0x0'));exports[_0xbb43('0x1')]=function(_0x5c45dd){return client[_0xbb43('0x2')](_0xbb43('0x3'),{'body':_0x5c45dd,'log':_0xbb43('0x4')});};
\ No newline at end of file
index 7c76cbc..62e4a8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6113=['Request','GetOpenchannelQueue','name','timeout','User','Agents','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x549363,_0x15cf16){var _0x4df0fd=function(_0x565d44){while(--_0x565d44){_0x549363['push'](_0x549363['shift']());}};_0x4df0fd(++_0x15cf16);}(_0x6113,0x1f2));var _0x3611=function(_0x19c535,_0x2ad2b5){_0x19c535=_0x19c535-0x0;var _0x282e28=_0x6113[_0x19c535];return _0x282e28;};'use strict';var client=require(_0x3611('0x0'));exports[_0x3611('0x1')]=function(){return function(){return client[_0x3611('0x2')](_0x3611('0x3'),{'options':{'raw':![],'attributes':['id',_0x3611('0x4'),_0x3611('0x5'),'strategy'],'include':[{'model':_0x3611('0x6'),'as':_0x3611('0x7'),'attributes':['id',_0x3611('0x4'),_0x3611('0x8'),_0x3611('0x9')]}]},'log':_0x3611('0x1')});};};
\ No newline at end of file
+var _0x7356=['GetOpenchannelQueue','name','timeout','strategy','User','openchannelPause','Request'];(function(_0x1ed010,_0x734e0b){var _0x6e22bf=function(_0x1ffe15){while(--_0x1ffe15){_0x1ed010['push'](_0x1ed010['shift']());}};_0x6e22bf(++_0x734e0b);}(_0x7356,0x15d));var _0x6735=function(_0x40783f,_0x3d6472){_0x40783f=_0x40783f-0x0;var _0x4fc23a=_0x7356[_0x40783f];return _0x4fc23a;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x6735('0x0')](_0x6735('0x1'),{'options':{'raw':![],'attributes':['id',_0x6735('0x2'),_0x6735('0x3'),_0x6735('0x4')],'include':[{'model':_0x6735('0x5'),'as':'Agents','attributes':['id','name','online',_0x6735('0x6')]}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
index 5bbd0ac..9fd5cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6a7=['Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','create'];(function(_0x5ee0ee,_0x3ce413){var _0x198093=function(_0x29dcc9){while(--_0x29dcc9){_0x5ee0ee['push'](_0x5ee0ee['shift']());}};_0x198093(++_0x3ce413);}(_0xc6a7,0xcb));var _0x7c6a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc6a7[_0x565ed7];return _0x183ad7;};'use strict';var client=require('../client');exports[_0x7c6a('0x0')]=function(_0x1dbc19){return client[_0x7c6a('0x1')]('CreateOpenchannelQueueReport',{'body':_0x1dbc19,'log':_0x7c6a('0x2')});};exports[_0x7c6a('0x3')]=function(_0x3c104a,_0x58779a){return client[_0x7c6a('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x58779a,'options':{'where':{'uniqueid':_0x3c104a},'order':[['id',_0x7c6a('0x4')]],'limit':0x1},'log':_0x7c6a('0x5')});};
\ No newline at end of file
+var _0xa5f7=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5f7,0xec));var _0x7a5f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xa5f7[_0x5f09c5];return _0x426ad9;};'use strict';var client=require(_0x7a5f('0x0'));exports[_0x7a5f('0x1')]=function(_0x4f7995){return client[_0x7a5f('0x2')](_0x7a5f('0x3'),{'body':_0x4f7995,'log':_0x7a5f('0x3')});};exports[_0x7a5f('0x4')]=function(_0x41976d,_0x5d6a2d){return client[_0x7a5f('0x2')](_0x7a5f('0x5'),{'body':_0x5d6a2d,'options':{'where':{'uniqueid':_0x41976d},'order':[['id',_0x7a5f('0x6')]],'limit':0x1},'log':_0x7a5f('0x5')});};
\ No newline at end of file
index c4ee5da..22059c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd442=['updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','UpdateSmsInteraction'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xd442,0x1b5));var _0x2d44=function(_0x5d8c29,_0x3bdc76){_0x5d8c29=_0x5d8c29-0x0;var _0x3e1951=_0xd442[_0x5d8c29];return _0x3e1951;};'use strict';var client=require('../client');exports['update']=function(_0x454a40,_0x4af95f){return client['Request'](_0x2d44('0x0'),{'body':_0x4af95f,'options':{'where':{'id':_0x454a40}},'log':_0x2d44('0x1')});};exports[_0x2d44('0x2')]=function(_0x4649c2,_0x44c13b){return client[_0x2d44('0x3')](_0x2d44('0x4'),{'body':_0x44c13b,'options':{'where':{'id':_0x4649c2}},'log':_0x2d44('0x5')});};
\ No newline at end of file
+var _0x63eb=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x25f184,_0xad0573){var _0x39feaa=function(_0x3d2a01){while(--_0x3d2a01){_0x25f184['push'](_0x25f184['shift']());}};_0x39feaa(++_0xad0573);}(_0x63eb,0x195));var _0xb63e=function(_0x4d9f51,_0x2c2a44){_0x4d9f51=_0x4d9f51-0x0;var _0x26b34c=_0x63eb[_0x4d9f51];return _0x26b34c;};'use strict';var client=require(_0xb63e('0x0'));exports[_0xb63e('0x1')]=function(_0x11139c,_0x43fd16){return client[_0xb63e('0x2')]('UpdateSmsInteraction',{'body':_0x43fd16,'options':{'where':{'id':_0x11139c}},'log':_0xb63e('0x3')});};exports['addTags']=function(_0x1994f6,_0x455b0d){return client[_0xb63e('0x2')](_0xb63e('0x4'),{'body':_0x455b0d,'options':{'where':{'id':_0x1994f6}},'log':_0xb63e('0x5')});};
\ No newline at end of file
index 2420f39..007a047 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x085f=['../client'];(function(_0xfc220e,_0x5ded41){var _0x2be14d=function(_0xb336e4){while(--_0xb336e4){_0xfc220e['push'](_0xfc220e['shift']());}};_0x2be14d(++_0x5ded41);}(_0x085f,0x74));var _0xf085=function(_0x487a0f,_0xbc78b7){_0x487a0f=_0x487a0f-0x0;var _0x17dd78=_0x085f[_0x487a0f];return _0x17dd78;};'use strict';var client=require(_0xf085('0x0'));exports['create']=function(_0x46406a){return client['Request']('CreateSmsMessage',{'body':_0x46406a,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0x8e4c=['createSmsMessage','create','Request','CreateSmsMessage'];(function(_0x18307e,_0x1898e8){var _0x24186b=function(_0x5ee12b){while(--_0x5ee12b){_0x18307e['push'](_0x18307e['shift']());}};_0x24186b(++_0x1898e8);}(_0x8e4c,0x69));var _0xc8e4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x8e4c[_0x16b9ed];return _0x66b1f8;};'use strict';var client=require('../client');exports[_0xc8e4('0x0')]=function(_0x24efb4){return client[_0xc8e4('0x1')](_0xc8e4('0x2'),{'body':_0x24efb4,'log':_0xc8e4('0x3')});};
\ No newline at end of file
index e50a773..2ba5c3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x720f=['strategy','Agents','getSmsQueues','Request','GetSmsQueue','name','timeout'];(function(_0x3cdb32,_0x4c5009){var _0x954eca=function(_0x58ab72){while(--_0x58ab72){_0x3cdb32['push'](_0x3cdb32['shift']());}};_0x954eca(++_0x4c5009);}(_0x720f,0x80));var _0xf720=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x720f[_0x4099ee];return _0x1b7bfc;};'use strict';var client=require('../client');exports[_0xf720('0x0')]=function(){return function(){return client[_0xf720('0x1')](_0xf720('0x2'),{'options':{'raw':![],'attributes':['id',_0xf720('0x3'),_0xf720('0x4'),_0xf720('0x5')],'include':[{'model':'User','as':_0xf720('0x6'),'attributes':['id','name','online','smsPause']}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0x102c=['name','strategy','Agents','smsPause','../client','getSmsQueues','Request'];(function(_0x2566a8,_0x5cfd02){var _0x12ea51=function(_0x4a1db6){while(--_0x4a1db6){_0x2566a8['push'](_0x2566a8['shift']());}};_0x12ea51(++_0x5cfd02);}(_0x102c,0xf9));var _0xc102=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x102c[_0x266618];return _0x54dbf5;};'use strict';var client=require(_0xc102('0x0'));exports[_0xc102('0x1')]=function(){return function(){return client[_0xc102('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0xc102('0x3'),'timeout',_0xc102('0x4')],'include':[{'model':'User','as':_0xc102('0x5'),'attributes':['id',_0xc102('0x3'),'online',_0xc102('0x6')]}]},'log':_0xc102('0x1')});};};
\ No newline at end of file
index 86b896a..22b3d25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2484=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x623e7,_0x1bef7d){var _0x121131=function(_0x59b734){while(--_0x59b734){_0x623e7['push'](_0x623e7['shift']());}};_0x121131(++_0x1bef7d);}(_0x2484,0x1b9));var _0x4248=function(_0x37d4ac,_0x4e47d6){_0x37d4ac=_0x37d4ac-0x0;var _0x5e727a=_0x2484[_0x37d4ac];return _0x5e727a;};'use strict';var client=require(_0x4248('0x0'));exports[_0x4248('0x1')]=function(_0x33978f){return client[_0x4248('0x2')](_0x4248('0x3'),{'body':_0x33978f,'log':'CreateSmsQueueReport'});};exports[_0x4248('0x4')]=function(_0x133fe1,_0x1b3da0){return client[_0x4248('0x2')](_0x4248('0x5'),{'body':_0x1b3da0,'options':{'where':{'uniqueid':_0x133fe1},'order':[['id',_0x4248('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});};
\ No newline at end of file
+var _0x83e4=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x83e4,0x137));var _0x483e=function(_0x4193b3,_0x2e3447){_0x4193b3=_0x4193b3-0x0;var _0xce194d=_0x83e4[_0x4193b3];return _0xce194d;};'use strict';var client=require(_0x483e('0x0'));exports[_0x483e('0x1')]=function(_0x4ac0b3){return client[_0x483e('0x2')](_0x483e('0x3'),{'body':_0x4ac0b3,'log':_0x483e('0x3')});};exports[_0x483e('0x4')]=function(_0x24804c,_0x5d1fe3){return client[_0x483e('0x2')](_0x483e('0x5'),{'body':_0x5d1fe3,'options':{'where':{'uniqueid':_0x24804c},'order':[['id','DESC']],'limit':0x1},'log':_0x483e('0x5')});};
\ No newline at end of file
index b308e71..6c9c428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x300c=['mailPause','faxPause','whatsappPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','whatsappCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','name','online','lastPauseAt','voicePause','chatPause'];(function(_0x385628,_0x5ea467){var _0x486406=function(_0x127b0d){while(--_0x127b0d){_0x385628['push'](_0x385628['shift']());}};_0x486406(++_0x5ea467);}(_0x300c,0x96));var _0xc300=function(_0x3978ea,_0xffa0d3){_0x3978ea=_0x3978ea-0x0;var _0x4a4be2=_0x300c[_0x3978ea];return _0x4a4be2;};'use strict';var client=require(_0xc300('0x0'));exports[_0xc300('0x1')]=function(){return function(){return client[_0xc300('0x2')](_0xc300('0x3'),{'options':{'raw':!![],'where':{'role':_0xc300('0x4')},'attributes':['id',_0xc300('0x5'),_0xc300('0x6'),'pauseType',_0xc300('0x7'),_0xc300('0x8'),_0xc300('0x9'),_0xc300('0xa'),_0xc300('0xb'),'smsPause',_0xc300('0xc'),_0xc300('0xd'),_0xc300('0xe'),_0xc300('0xf'),_0xc300('0x10'),_0xc300('0x11'),_0xc300('0x12'),_0xc300('0x13')]},'log':_0xc300('0x1')});};};
\ No newline at end of file
+var _0x59a3=['online','faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','whatsappCapacity','openchannelCapacity','../client','getAgents','Request','agent'];(function(_0x4decae,_0x140515){var _0x1fc6b5=function(_0x946925){while(--_0x946925){_0x4decae['push'](_0x4decae['shift']());}};_0x1fc6b5(++_0x140515);}(_0x59a3,0x18f));var _0x359a=function(_0x1c2c76,_0x341779){_0x1c2c76=_0x1c2c76-0x0;var _0x2e5751=_0x59a3[_0x1c2c76];return _0x2e5751;};'use strict';var client=require(_0x359a('0x0'));exports[_0x359a('0x1')]=function(){return function(){return client[_0x359a('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x359a('0x3')},'attributes':['id','name',_0x359a('0x4'),'pauseType','lastPauseAt','voicePause','chatPause','mailPause',_0x359a('0x5'),_0x359a('0x6'),'whatsappPause',_0x359a('0x7'),_0x359a('0x8'),_0x359a('0x9'),_0x359a('0xa'),'smsCapacity',_0x359a('0xb'),_0x359a('0xc')]},'log':_0x359a('0x1')});};};
\ No newline at end of file
index 13c293b..7ee9c86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fb8=['../client','UpdateWhatsappInteraction','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x3573fa,_0x14d37c){var _0x4f05ab=function(_0x50acd1){while(--_0x50acd1){_0x3573fa['push'](_0x3573fa['shift']());}};_0x4f05ab(++_0x14d37c);}(_0x6fb8,0x104));var _0x86fb=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x6fb8[_0x1c8c28];return _0x1f59b4;};'use strict';var client=require(_0x86fb('0x0'));exports['update']=function(_0x151f71,_0x46267e){return client['Request'](_0x86fb('0x1'),{'body':_0x46267e,'options':{'where':{'id':_0x151f71}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x23cc99,_0x3838ac){return client[_0x86fb('0x2')](_0x86fb('0x3'),{'body':_0x3838ac,'options':{'where':{'id':_0x23cc99}},'log':_0x86fb('0x4')});};
\ No newline at end of file
+var _0x9658=['addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x2d9196,_0x26f48d){var _0x4002e3=function(_0x583174){while(--_0x583174){_0x2d9196['push'](_0x2d9196['shift']());}};_0x4002e3(++_0x26f48d);}(_0x9658,0x6f));var _0x8965=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0x9658[_0x59342a];return _0x17abc9;};'use strict';var client=require(_0x8965('0x0'));exports['update']=function(_0x1f5bb6,_0xa89576){return client['Request'](_0x8965('0x1'),{'body':_0xa89576,'options':{'where':{'id':_0x1f5bb6}},'log':'updateWhatsappInteraction'});};exports[_0x8965('0x2')]=function(_0x761b45,_0x254d05){return client['Request'](_0x8965('0x3'),{'body':_0x254d05,'options':{'where':{'id':_0x761b45}},'log':_0x8965('0x4')});};
\ No newline at end of file
index 33aa0e3..647c4fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x631a=['create','Request','createWhatsappMessage'];(function(_0x76f5a6,_0x9ee918){var _0x13e872=function(_0x353e76){while(--_0x353e76){_0x76f5a6['push'](_0x76f5a6['shift']());}};_0x13e872(++_0x9ee918);}(_0x631a,0x19e));var _0xa631=function(_0x226d9c,_0x2ac869){_0x226d9c=_0x226d9c-0x0;var _0x50aaf6=_0x631a[_0x226d9c];return _0x50aaf6;};'use strict';var client=require('../client');exports[_0xa631('0x0')]=function(_0x1be5dd){return client[_0xa631('0x1')]('CreateWhatsappMessage',{'body':_0x1be5dd,'log':_0xa631('0x2')});};
\ No newline at end of file
+var _0xe677=['createWhatsappMessage','../client','create'];(function(_0x331348,_0x3bfceb){var _0x47705c=function(_0x3f6c48){while(--_0x3f6c48){_0x331348['push'](_0x331348['shift']());}};_0x47705c(++_0x3bfceb);}(_0xe677,0x11b));var _0x7e67=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xe677[_0x4bc65f];return _0x44f85f;};'use strict';var client=require(_0x7e67('0x0'));exports[_0x7e67('0x1')]=function(_0x32f36e){return client['Request']('CreateWhatsappMessage',{'body':_0x32f36e,'log':_0x7e67('0x2')});};
\ No newline at end of file
index 9773c91..53c7bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['../client','Request','GetWhatsappQueue','name','strategy','Agents','whatsappPause','getWhatsappQueues'];(function(_0x18b2d5,_0x544076){var _0x1e0030=function(_0x1a2c82){while(--_0x1a2c82){_0x18b2d5['push'](_0x18b2d5['shift']());}};_0x1e0030(++_0x544076);}(_0x351d,0x90));var _0xd351=function(_0x57a60e,_0xa6ff1c){_0x57a60e=_0x57a60e-0x0;var _0x5a96db=_0x351d[_0x57a60e];return _0x5a96db;};'use strict';var client=require(_0xd351('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xd351('0x1')](_0xd351('0x2'),{'options':{'raw':![],'attributes':['id',_0xd351('0x3'),'timeout',_0xd351('0x4')],'include':[{'model':'User','as':_0xd351('0x5'),'attributes':['id',_0xd351('0x3'),'online',_0xd351('0x6')]}]},'log':_0xd351('0x7')});};};
\ No newline at end of file
+var _0x63a5=['getWhatsappQueues','Request','name','strategy','User','Agents','../client'];(function(_0x19a7d3,_0x487155){var _0x569a8e=function(_0x456e99){while(--_0x456e99){_0x19a7d3['push'](_0x19a7d3['shift']());}};_0x569a8e(++_0x487155);}(_0x63a5,0x18e));var _0x563a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x63a5[_0x5f1391];return _0x50ebe3;};'use strict';var client=require(_0x563a('0x0'));exports[_0x563a('0x1')]=function(){return function(){return client[_0x563a('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x563a('0x3'),'timeout',_0x563a('0x4')],'include':[{'model':_0x563a('0x5'),'as':_0x563a('0x6'),'attributes':['id',_0x563a('0x3'),'online','whatsappPause']}]},'log':_0x563a('0x1')});};};
\ No newline at end of file
index 4538a24..c8010bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5f0=['create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport'];(function(_0xe2dd55,_0x196e96){var _0x2b0c59=function(_0x5c7f0b){while(--_0x5c7f0b){_0xe2dd55['push'](_0xe2dd55['shift']());}};_0x2b0c59(++_0x196e96);}(_0xe5f0,0xaf));var _0x0e5f=function(_0x5db221,_0x45952f){_0x5db221=_0x5db221-0x0;var _0x437b3a=_0xe5f0[_0x5db221];return _0x437b3a;};'use strict';var client=require('../client');exports[_0x0e5f('0x0')]=function(_0x468427){return client['Request'](_0x0e5f('0x1'),{'body':_0x468427,'log':_0x0e5f('0x1')});};exports[_0x0e5f('0x2')]=function(_0x24f7a0,_0x28494a){return client[_0x0e5f('0x3')]('UpdateWhatsappQueueReport',{'body':_0x28494a,'options':{'where':{'uniqueid':_0x24f7a0},'order':[['id','DESC']],'limit':0x1},'log':_0x0e5f('0x4')});};
\ No newline at end of file
+var _0x4f69=['DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x260e9f,_0x5790ca){var _0x2e799e=function(_0x204d2c){while(--_0x204d2c){_0x260e9f['push'](_0x260e9f['shift']());}};_0x2e799e(++_0x5790ca);}(_0x4f69,0x1c2));var _0x94f6=function(_0x54fea7,_0x33e39c){_0x54fea7=_0x54fea7-0x0;var _0x502ed1=_0x4f69[_0x54fea7];return _0x502ed1;};'use strict';var client=require(_0x94f6('0x0'));exports[_0x94f6('0x1')]=function(_0x2ebef3){return client[_0x94f6('0x2')](_0x94f6('0x3'),{'body':_0x2ebef3,'log':'CreateWhatsappQueueReport'});};exports[_0x94f6('0x4')]=function(_0x2c0f4d,_0x53fe89){return client[_0x94f6('0x2')]('UpdateWhatsappQueueReport',{'body':_0x53fe89,'options':{'where':{'uniqueid':_0x2c0f4d},'order':[['id',_0x94f6('0x5')]],'limit':0x1},'log':_0x94f6('0x6')});};
\ No newline at end of file
index 8f60829..4947df1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6de=['join','stop','agents','timeout','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','info','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message'];(function(_0x1a336e,_0x40fd63){var _0x159a07=function(_0x7bc97a){while(--_0x7bc97a){_0x1a336e['push'](_0x1a336e['shift']());}};_0x159a07(++_0x40fd63);}(_0xf6de,0x171));var _0xef6d=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0xf6de[_0x5a5395];return _0x4da43d;};'use strict';var schema=require(_0xef6d('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xef6d('0x1'));var logger=require(_0xef6d('0x2'))(_0xef6d('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xef6d('0x4'),'required':!![],'message':_0xef6d('0x5')},'timeout':{'type':'number','message':_0xef6d('0x6')}});function writeLog(_0x5b845c,_0x5a556c,_0x31aa54){return logger['info'](util['format'](_0xef6d('0x7'),_0x5b845c,_0x5a556c['name'],_0x31aa54));}function handleFindAgent(_0x20a19b){return function(_0x342d49){return _0x342d49[_0xef6d('0x8')][_0xef6d('0x9')]()===_0x20a19b[_0xef6d('0x9')]();};}exports[_0xef6d('0xa')]=function(_0x449e10,_0x4d5b1f,_0x20bbc1,_0x82e5ad){return function(_0x599316){try{var _0x54e217={'name':_0x4d5b1f[0x0],'timeout':_0x4d5b1f[0x1]};var _0x1e94dc=queue[_0xef6d('0x0')](_0x54e217,{'typecast':!![]});if(_0x1e94dc[_0xef6d('0xb')]){logger[_0xef6d('0xc')](_0xef6d('0xd'),_0x449e10,_[_0xef6d('0xe')](_0x1e94dc,_0xef6d('0xf'))[_0xef6d('0x10')](',\x20'));_0x599316[_0xef6d('0x11')]();}else{var _0x170aca=_['find'](_0x20bbc1[_0xef6d('0x12')],handleFindAgent(_0x54e217[_0xef6d('0x8')]));if(_0x170aca){var _0x5c2981=(_0x54e217[_0xef6d('0x13')]||0xa)*0x3e8;var _0x3536d2,_0x1a3215;var _0x228a74=seqqueue['createQueue'](_0x5c2981);_0x228a74['id']=_0x449e10;_0x228a74[_0xef6d('0x14')]=_0x5c2981;_0x228a74['channel']=_0x82e5ad[_0xef6d('0x15')];writeLog(_0x449e10,_0x170aca,util[_0xef6d('0x16')](_0xef6d('0x17'),_0x5c2981));_0x20bbc1[_0xef6d('0x18')][_0x449e10]['on'](_0xef6d('0x19'),function(){logger['info'](_0xef6d('0x1a'),_0x449e10);clearTimeout(_0x1a3215);_0x1a3215=undefined;_0x228a74[_0xef6d('0x1b')]();if(_0x20bbc1[_0xef6d('0x18')][_0x449e10]){delete _0x20bbc1[_0xef6d('0x18')][_0x449e10];}_0x599316[_0xef6d('0x11')]();});_0x20bbc1['rules'][_0x449e10]['on'](_0xef6d('0x1c'),function(){if(_0x20bbc1[_0xef6d('0x18')][_0x449e10]){delete _0x20bbc1[_0xef6d('0x18')][_0x449e10];}});_0x1a3215=setTimeout(function(){logger[_0xef6d('0x1d')](_0xef6d('0x1e'),_0x449e10);clearTimeout(_0x1a3215);_0x228a74['close']();_0x599316['next']();},_0x5c2981);strategy[_0xef6d('0x1f')](_0x228a74,_0x170aca,_0x20bbc1,_0x82e5ad);}else{logger[_0xef6d('0xc')](_0xef6d('0x20'),_0x449e10,_0x54e217[_0xef6d('0x8')]);_0x599316[_0xef6d('0x11')]();}}}catch(_0x576dd4){console[_0xef6d('0x21')](_0x576dd4);logger[_0xef6d('0xc')]('[%s][QUEUE]\x20%s',_0x449e10,_0x576dd4[_0xef6d('0x22')]);_0x599316[_0xef6d('0x11')]();}};};
\ No newline at end of file
+var _0x218c=['channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','length','map','message','join','stop','find','agents','timeout','createQueue','atimeout'];(function(_0x1f6b07,_0x29b3f5){var _0x41fd7c=function(_0x13ef39){while(--_0x13ef39){_0x1f6b07['push'](_0x1f6b07['shift']());}};_0x41fd7c(++_0x29b3f5);}(_0x218c,0x1ee));var _0xc218=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x218c[_0x235f49];return _0x551139;};'use strict';var schema=require(_0xc218('0x0'));var _=require(_0xc218('0x1'));var util=require(_0xc218('0x2'));var seqqueue=require(_0xc218('0x3'));var logger=require('../../../../config/logger')(_0xc218('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xc218('0x5'),'required':!![],'message':_0xc218('0x6')},'timeout':{'type':_0xc218('0x7'),'message':_0xc218('0x8')}});function writeLog(_0x568779,_0x1f1baa,_0xc5251){return logger[_0xc218('0x9')](util[_0xc218('0xa')](_0xc218('0xb'),_0x568779,_0x1f1baa[_0xc218('0xc')],_0xc5251));}function handleFindAgent(_0x3ed954){return function(_0x23a390){return _0x23a390[_0xc218('0xc')]['toLowerCase']()===_0x3ed954['toLowerCase']();};}exports[_0xc218('0xd')]=function(_0x24716b,_0x47252c,_0x1a68b2,_0x38bcab){return function(_0x47ff62){try{var _0x52ef10={'name':_0x47252c[0x0],'timeout':_0x47252c[0x1]};var _0x44023b=queue['validate'](_0x52ef10,{'typecast':!![]});if(_0x44023b[_0xc218('0xe')]){logger['error']('[%s][AGENT]\x20%s',_0x24716b,_[_0xc218('0xf')](_0x44023b,_0xc218('0x10'))[_0xc218('0x11')](',\x20'));_0x47ff62[_0xc218('0x12')]();}else{var _0x5816be=_[_0xc218('0x13')](_0x1a68b2[_0xc218('0x14')],handleFindAgent(_0x52ef10[_0xc218('0xc')]));if(_0x5816be){var _0x4f6f68=(_0x52ef10[_0xc218('0x15')]||0xa)*0x3e8;var _0x361dbc,_0x344be6;var _0x44e246=seqqueue[_0xc218('0x16')](_0x4f6f68);_0x44e246['id']=_0x24716b;_0x44e246[_0xc218('0x17')]=_0x4f6f68;_0x44e246['channel']=_0x38bcab[_0xc218('0x18')];writeLog(_0x24716b,_0x5816be,util[_0xc218('0xa')](_0xc218('0x19'),_0x4f6f68));_0x1a68b2[_0xc218('0x1a')][_0x24716b]['on'](_0xc218('0x1b'),function(){logger['info'](_0xc218('0x1c'),_0x24716b);clearTimeout(_0x344be6);_0x344be6=undefined;_0x44e246[_0xc218('0x1d')]();if(_0x1a68b2[_0xc218('0x1a')][_0x24716b]){delete _0x1a68b2[_0xc218('0x1a')][_0x24716b];}_0x47ff62[_0xc218('0x12')]();});_0x1a68b2[_0xc218('0x1a')][_0x24716b]['on'](_0xc218('0x1e'),function(){if(_0x1a68b2[_0xc218('0x1a')][_0x24716b]){delete _0x1a68b2[_0xc218('0x1a')][_0x24716b];}});_0x344be6=setTimeout(function(){logger['info'](_0xc218('0x1f'),_0x24716b);clearTimeout(_0x344be6);_0x44e246[_0xc218('0x1d')]();_0x47ff62[_0xc218('0x20')]();},_0x4f6f68);strategy[_0xc218('0x21')](_0x44e246,_0x5816be,_0x1a68b2,_0x38bcab);}else{logger[_0xc218('0x22')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x24716b,_0x52ef10[_0xc218('0xc')]);_0x47ff62['stop']();}}}catch(_0x302621){console[_0xc218('0x23')](_0x302621);logger[_0xc218('0x22')](_0xc218('0x24'),_0x24716b,_0x302621['stack']);_0x47ff62[_0xc218('0x12')]();}};};
\ No newline at end of file
index 17c44a5..a361e4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','postText','amazonlex','dialogState','Failed','catch','error','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','Message','create','then','[%s][AMAZONLEX]\x20%s','body','stringify','finally'];(function(_0x4b4dd0,_0x4b7586){var _0x42da25=function(_0x48ed2c){while(--_0x48ed2c){_0x4b4dd0['push'](_0x4b4dd0['shift']());}};_0x42da25(++_0x4b7586);}(_0x31f0,0xb7));var _0x031f=function(_0x5abc53,_0x407e33){_0x5abc53=_0x5abc53-0x0;var _0x1d7fe0=_0x31f0[_0x5abc53];return _0x1d7fe0;};'use strict';var _=require(_0x031f('0x0'));var moment=require('moment');var AWS=require(_0x031f('0x1'));var utils=require('./utils');var logger=require(_0x031f('0x2'))(_0x031f('0x3'));var rpc={'chatMessage':require(_0x031f('0x4')),'openchannelMessage':require(_0x031f('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x031f('0x6')),'faxMessage':require(_0x031f('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x56328c,_0x3dc98e){return function(_0x487e65){try{if(!_[_0x031f('0x8')](this[_0x031f('0x9')][_0x031f('0xa')])){logger[_0x031f('0xb')]('[%s][AMAZONLEX]\x20%s',_0x56328c,_0x031f('0xc'));return _0x487e65[_0x031f('0xd')]();}var _0x327f11={'ContactId':this[_0x031f('0xe')]['id'],'sentAt':moment()[_0x031f('0xf')](_0x031f('0x10')),'direction':_0x031f('0x11')};var _0x3fd541=this['channel'];if(_0x3fd541===_0x031f('0x12')){_0x327f11[_0x031f('0x13')]=this[_0x031f('0x14')]['id'];}else{_0x327f11[_[_0x031f('0x15')](_0x3fd541)+_0x031f('0x16')]=this[_0x031f('0x14')]['id'];}_0x327f11[_[_0x031f('0x15')](_0x3fd541)+'InteractionId']=this[_0x031f('0x9')]['id'];if(this[_0x031f('0x9')][_0x031f('0x17')]){var _0x2e3dfe=_0x3dc98e[0x4];if(!_[_0x031f('0x18')](_0x2e3dfe)){_0x327f11['body']=utils['getMustacheRender'](_0x2e3dfe,this);return rpc[_0x3fd541+_0x031f('0x19')][_0x031f('0x1a')](_0x327f11)[_0x031f('0x1b')](function(_0x286177){logger['info'](_0x031f('0x1c'),_0x56328c,_0x327f11[_0x031f('0x1d')]);})['catch'](function(_0xcdae16){logger['error'](_0x031f('0x1c'),_0x56328c,JSON[_0x031f('0x1e')](_0xcdae16));})[_0x031f('0x1f')](function(){logger[_0x031f('0xb')](_0x031f('0x20'),_0x56328c);_0x487e65[_0x031f('0x21')]();});}else{logger[_0x031f('0xb')](_0x031f('0x22'),_0x56328c);_0x487e65[_0x031f('0x21')]();}}else{var _0x345bde=this;var _0x29dd6e=new AWS['LexRuntime']({'accessKeyId':_0x3dc98e[0x0],'secretAccessKey':_0x3dc98e[0x1],'region':_0x3dc98e[0x2]});var _0xf72793={'botAlias':_0x031f('0x23'),'botName':_0x3dc98e[0x3],'inputText':this[_0x031f('0x24')]['body'],'userId':this['channel']+':'+this[_0x031f('0x9')]['id']['toString']()};_0x29dd6e[_0x031f('0x25')](_0xf72793,function(_0x57f6c4,_0x54d054){if(_0x57f6c4){logger['error'](_0x031f('0x1c'),_0x56328c,_0x57f6c4[_0x031f('0x24')]);_0x487e65[_0x031f('0xd')]();}else if(_0x54d054&&_0x54d054[_0x031f('0x24')]){_0x345bde['body'][_0x031f('0x26')]=_0x54d054;_0x327f11['body']=_0x54d054[_0x031f('0x24')];return rpc[_0x3fd541+_0x031f('0x19')][_0x031f('0x1a')](_0x327f11)['then'](function(_0x35af16){logger[_0x031f('0xb')]('[%s][AMAZONLEX]\x20%s',_0x56328c,_0x327f11[_0x031f('0x1d')]);if(_0x54d054[_0x031f('0x27')]==_0x031f('0x28')){_0x487e65['next']();}else{_0x487e65[_0x031f('0x21')]();}})[_0x031f('0x29')](function(_0xb6ed6c){logger[_0x031f('0x2a')](_0x031f('0x1c'),_0x56328c,JSON[_0x031f('0x1e')](_0xb6ed6c));_0x487e65['next']();});}else{_0x487e65[_0x031f('0xd')]();}});}}catch(_0xab24ad){logger[_0x031f('0x2a')](_0x031f('0x1c'),_0x56328c,JSON[_0x031f('0x1e')](_0xab24ad));_0x487e65[_0x031f('0x21')]();}};};
\ No newline at end of file
+var _0xda19=['../../rpc/whatsappMessage','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','account','AccountId','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','body','catch','error','info','[%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','postText','next','amazonlex','dialogState','Failed','stringify','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x57504a,_0x355841){var _0x274712=function(_0xd6b759){while(--_0xd6b759){_0x57504a['push'](_0x57504a['shift']());}};_0x274712(++_0x355841);}(_0xda19,0xd5));var _0x9da1=function(_0x34f0fb,_0x3c78b7){_0x34f0fb=_0x34f0fb-0x0;var _0x35789e=_0xda19[_0x34f0fb];return _0x35789e;};'use strict';var _=require('lodash');var moment=require(_0x9da1('0x0'));var AWS=require(_0x9da1('0x1'));var utils=require('./utils');var logger=require(_0x9da1('0x2'))('routing');var rpc={'chatMessage':require(_0x9da1('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9da1('0x4')),'smsMessage':require(_0x9da1('0x5')),'faxMessage':require(_0x9da1('0x6')),'whatsappMessage':require(_0x9da1('0x7'))};exports[_0x9da1('0x8')]=function(_0x2dcbc6,_0x23e4f7){return function(_0x2c3cdd){try{if(!_[_0x9da1('0x9')](this[_0x9da1('0xa')]['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x2dcbc6,_0x9da1('0xb'));return _0x2c3cdd['next']();}var _0x33cfe5={'ContactId':this[_0x9da1('0xc')]['id'],'sentAt':moment()[_0x9da1('0xd')](_0x9da1('0xe')),'direction':_0x9da1('0xf')};var _0x396e23=this[_0x9da1('0x10')];if(_0x396e23==='chat'){_0x33cfe5['ChatWebsiteId']=this[_0x9da1('0x11')]['id'];}else{_0x33cfe5[_['upperFirst'](_0x396e23)+_0x9da1('0x12')]=this[_0x9da1('0x11')]['id'];}_0x33cfe5[_[_0x9da1('0x13')](_0x396e23)+_0x9da1('0x14')]=this['interaction']['id'];if(this[_0x9da1('0xa')]['created']){var _0x4d17e1=_0x23e4f7[0x4];if(!_[_0x9da1('0x15')](_0x4d17e1)){_0x33cfe5['body']=utils[_0x9da1('0x16')](_0x4d17e1,this);return rpc[_0x396e23+_0x9da1('0x17')][_0x9da1('0x18')](_0x33cfe5)[_0x9da1('0x19')](function(_0x7f1a64){logger['info'](_0x9da1('0x1a'),_0x2dcbc6,_0x33cfe5[_0x9da1('0x1b')]);})[_0x9da1('0x1c')](function(_0x77347a){logger[_0x9da1('0x1d')](_0x9da1('0x1a'),_0x2dcbc6,JSON['stringify'](_0x77347a));})['finally'](function(){logger[_0x9da1('0x1e')](_0x9da1('0x1f'),_0x2dcbc6);_0x2c3cdd[_0x9da1('0x20')]();});}else{logger[_0x9da1('0x1e')](_0x9da1('0x21'),_0x2dcbc6);_0x2c3cdd[_0x9da1('0x20')]();}}else{var _0xe56279=this;var _0x47e5cf=new AWS[(_0x9da1('0x22'))]({'accessKeyId':_0x23e4f7[0x0],'secretAccessKey':_0x23e4f7[0x1],'region':_0x23e4f7[0x2]});var _0x554845={'botAlias':_0x9da1('0x23'),'botName':_0x23e4f7[0x3],'inputText':this[_0x9da1('0x24')][_0x9da1('0x1b')],'userId':this['channel']+':'+this['interaction']['id'][_0x9da1('0x25')]()};_0x47e5cf[_0x9da1('0x26')](_0x554845,function(_0x16ee0c,_0x330219){if(_0x16ee0c){logger[_0x9da1('0x1d')](_0x9da1('0x1a'),_0x2dcbc6,_0x16ee0c['message']);_0x2c3cdd[_0x9da1('0x27')]();}else if(_0x330219&&_0x330219[_0x9da1('0x24')]){_0xe56279['body'][_0x9da1('0x28')]=_0x330219;_0x33cfe5[_0x9da1('0x1b')]=_0x330219['message'];return rpc[_0x396e23+_0x9da1('0x17')][_0x9da1('0x18')](_0x33cfe5)['then'](function(_0x36b87a){logger[_0x9da1('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x2dcbc6,_0x33cfe5['body']);if(_0x330219[_0x9da1('0x29')]==_0x9da1('0x2a')){_0x2c3cdd['next']();}else{_0x2c3cdd[_0x9da1('0x20')]();}})['catch'](function(_0x5a6f2d){logger['error'](_0x9da1('0x1a'),_0x2dcbc6,JSON[_0x9da1('0x2b')](_0x5a6f2d));_0x2c3cdd[_0x9da1('0x27')]();});}else{_0x2c3cdd[_0x9da1('0x27')]();}});}}catch(_0x140c6c){logger['error'](_0x9da1('0x1a'),_0x2dcbc6,JSON['stringify'](_0x140c6c));_0x2c3cdd[_0x9da1('0x20')]();}};};
\ No newline at end of file
index fdbf7cb..1b903af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd5f=['then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','body','catch','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../mailRpc','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','getMustacheRender','format','out','from','message','phone','read','subject','Re:','chat','ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId','Message','mail','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','<div\x20id=\x22xm-mail-content\x22','<div','</div>','sendMailMessage'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xfd5f,0xb7));var _0xffd5=function(_0x51f95a,_0x5e694b){_0x51f95a=_0x51f95a-0x0;var _0x39bfb7=_0xfd5f[_0x51f95a];return _0x39bfb7;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0xffd5('0x0'));var logger=require(_0xffd5('0x1'))('routing');var rpc={'chatMessage':require(_0xffd5('0x2')),'openchannelMessage':require(_0xffd5('0x3')),'mailMessage':require(_0xffd5('0x4')),'smsMessage':require(_0xffd5('0x5')),'faxMessage':require(_0xffd5('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};var mailRpc=require(_0xffd5('0x7'));exports['consequence']=function(_0x576b85,_0x5784f3){return function(_0x232f18){try{if(_0x5784f3[0x0]==='1'&&(_[_0xffd5('0x8')](this[_0xffd5('0x9')][_0xffd5('0xa')])||!this[_0xffd5('0x9')][_0xffd5('0xa')])){logger[_0xffd5('0xb')](_0xffd5('0xc'),_0x576b85,_0xffd5('0xd'));return _0x232f18['next']();}var _0x97d862=this['channel'];var _0x40f2db={'body':utils[_0xffd5('0xe')](_0x5784f3[0x1],this),'ContactId':this['contact']['id'],'sentAt':moment()[_0xffd5('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xffd5('0x10')};if(this['message']){_0x40f2db['to']=this['message'][_0xffd5('0x11')]||'';_0x40f2db['cc']=this['message']['cc']||'';_0x40f2db['from']=this[_0xffd5('0x12')]['to']||'';_0x40f2db[_0xffd5('0x13')]=this[_0xffd5('0x12')]['phone']||'';_0x40f2db[_0xffd5('0x14')]=!![];if(this[_0xffd5('0x12')]['subject']){_0x40f2db['subject']='';_0x40f2db[_0xffd5('0x15')]+=_['startsWith'](this[_0xffd5('0x12')][_0xffd5('0x15')],_0xffd5('0x16'))?'':'Re:\x20';_0x40f2db[_0xffd5('0x15')]+=this[_0xffd5('0x12')]['subject'];}}if(this['channel']===_0xffd5('0x17')){_0x40f2db[_0xffd5('0x18')]=this[_0xffd5('0x19')]['id'];}else{_0x40f2db[_[_0xffd5('0x1a')](this[_0xffd5('0x1b')])+_0xffd5('0x1c')]=this[_0xffd5('0x19')]['id'];}_0x40f2db[_[_0xffd5('0x1a')](this[_0xffd5('0x1b')])+_0xffd5('0x1d')]=this[_0xffd5('0x9')]['id'];if(rpc[this[_0xffd5('0x1b')]+_0xffd5('0x1e')]){if(this[_0xffd5('0x1b')]===_0xffd5('0x1f')){var _0x2e7025={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xffd5('0x20')][_0xffd5('0x21')]){_0x2e7025[_0xffd5('0x21')]=this[_0xffd5('0x19')][_0xffd5('0x20')][_0xffd5('0x21')];}else{_0x2e7025[_0xffd5('0x22')]=this['account']['Smtp'][_0xffd5('0x22')];_0x2e7025['port']=this[_0xffd5('0x19')][_0xffd5('0x20')][_0xffd5('0x23')];_0x2e7025[_0xffd5('0x24')]=this[_0xffd5('0x19')][_0xffd5('0x20')][_0xffd5('0x24')];}if(this[_0xffd5('0x19')][_0xffd5('0x20')][_0xffd5('0x25')]){_0x2e7025[_0xffd5('0x26')]={'user':this[_0xffd5('0x19')]['Smtp'][_0xffd5('0x27')],'pass':this[_0xffd5('0x19')][_0xffd5('0x20')][_0xffd5('0x28')]};}_0x40f2db[_0xffd5('0x29')]=this[_0xffd5('0x12')][_0xffd5('0x2a')];_0x40f2db[_0xffd5('0x2b')]=_0xffd5('0x2c')+_['replace'](_0x40f2db['body'],_0xffd5('0x2d'),_0xffd5('0x2e'))+_0xffd5('0x2f');return mailRpc[_0xffd5('0x30')](_0x2e7025,_0x40f2db)[_0xffd5('0x31')](function(_0x1da850){logger['info'](_0xffd5('0x32'),_0x576b85);_0x40f2db[_0xffd5('0x2a')]=_0x1da850[_0xffd5('0x12')][_0xffd5('0x2a')];return rpc[_0x97d862+_0xffd5('0x1e')][_0xffd5('0x33')](_0x40f2db);})[_0xffd5('0x31')](function(_0xe01482){logger[_0xffd5('0xb')]('[%s][AUTOREPLY]\x20%s',_0x576b85,JSON['stringify'](_0xe01482));})['catch'](function(_0x4aeca8){logger[_0xffd5('0x34')](_0xffd5('0x35'),_0x576b85,JSON[_0xffd5('0x36')](_0x4aeca8));})[_0xffd5('0x37')](function(){_0x232f18['next']();});}else{return rpc[this['channel']+_0xffd5('0x1e')]['create'](_0x40f2db)[_0xffd5('0x31')](function(_0x1b4b7a){logger[_0xffd5('0xb')]('[%s][AUTOREPLY]\x20%s',_0x576b85,_0x40f2db[_0xffd5('0x38')]);})[_0xffd5('0x39')](function(_0x27db5f){logger['error'](_0xffd5('0xc'),_0x576b85,JSON[_0xffd5('0x36')](_0x27db5f));})[_0xffd5('0x37')](function(){_0x232f18['next']();});}}}catch(_0xa8a7a0){logger[_0xffd5('0x34')](_0xffd5('0xc'),_0x576b85,JSON[_0xffd5('0x36')](_0xa8a7a0));_0x232f18['stop']();}};};
\ No newline at end of file
+var _0x28c0=['lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../mailRpc','consequence','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','getMustacheRender','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:\x20','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','Message','mail','account','Smtp','service','port','auth','user','pass','inReplyTo','html','replace','body','<div','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','error','stop'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0x28c0,0x122));var _0x028c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28c0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x028c('0x0'));var moment=require(_0x028c('0x1'));var utils=require(_0x028c('0x2'));var logger=require(_0x028c('0x3'))(_0x028c('0x4'));var rpc={'chatMessage':require(_0x028c('0x5')),'openchannelMessage':require(_0x028c('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x028c('0x7')),'whatsappMessage':require(_0x028c('0x8'))};var mailRpc=require(_0x028c('0x9'));exports[_0x028c('0xa')]=function(_0x40576d,_0x2688af){return function(_0x5b8a57){try{if(_0x2688af[0x0]==='1'&&(_['isNil'](this[_0x028c('0xb')][_0x028c('0xc')])||!this[_0x028c('0xb')][_0x028c('0xc')])){logger[_0x028c('0xd')](_0x028c('0xe'),_0x40576d,_0x028c('0xf'));return _0x5b8a57[_0x028c('0x10')]();}var _0x13153c=this['channel'];var _0x253d2e={'body':utils[_0x028c('0x11')](_0x2688af[0x1],this),'ContactId':this[_0x028c('0x12')]['id'],'sentAt':moment()['format'](_0x028c('0x13')),'direction':_0x028c('0x14')};if(this[_0x028c('0x15')]){_0x253d2e['to']=this[_0x028c('0x15')]['from']||'';_0x253d2e['cc']=this[_0x028c('0x15')]['cc']||'';_0x253d2e[_0x028c('0x16')]=this['message']['to']||'';_0x253d2e[_0x028c('0x17')]=this[_0x028c('0x15')][_0x028c('0x17')]||'';_0x253d2e[_0x028c('0x18')]=!![];if(this[_0x028c('0x15')][_0x028c('0x19')]){_0x253d2e[_0x028c('0x19')]='';_0x253d2e[_0x028c('0x19')]+=_[_0x028c('0x1a')](this[_0x028c('0x15')]['subject'],'Re:')?'':_0x028c('0x1b');_0x253d2e[_0x028c('0x19')]+=this['message']['subject'];}}if(this[_0x028c('0x1c')]===_0x028c('0x1d')){_0x253d2e[_0x028c('0x1e')]=this['account']['id'];}else{_0x253d2e[_[_0x028c('0x1f')](this[_0x028c('0x1c')])+_0x028c('0x20')]=this['account']['id'];}_0x253d2e[_[_0x028c('0x1f')](this['channel'])+_0x028c('0x21')]=this[_0x028c('0xb')]['id'];if(rpc[this[_0x028c('0x1c')]+_0x028c('0x22')]){if(this['channel']===_0x028c('0x23')){var _0x1ef660={'tls':{'rejectUnauthorized':![]}};if(this[_0x028c('0x24')][_0x028c('0x25')][_0x028c('0x26')]){_0x1ef660[_0x028c('0x26')]=this[_0x028c('0x24')][_0x028c('0x25')][_0x028c('0x26')];}else{_0x1ef660['host']=this[_0x028c('0x24')][_0x028c('0x25')]['host'];_0x1ef660['port']=this[_0x028c('0x24')]['Smtp'][_0x028c('0x27')];_0x1ef660['secure']=this[_0x028c('0x24')]['Smtp']['secure'];}if(this['account'][_0x028c('0x25')]['authentication']){_0x1ef660[_0x028c('0x28')]={'user':this[_0x028c('0x24')]['Smtp'][_0x028c('0x29')],'pass':this[_0x028c('0x24')][_0x028c('0x25')][_0x028c('0x2a')]};}_0x253d2e[_0x028c('0x2b')]=this[_0x028c('0x15')]['messageId'];_0x253d2e[_0x028c('0x2c')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0x028c('0x2d')](_0x253d2e[_0x028c('0x2e')],'<div\x20id=\x22xm-mail-content\x22',_0x028c('0x2f'))+'</div>';return mailRpc[_0x028c('0x30')](_0x1ef660,_0x253d2e)[_0x028c('0x31')](function(_0x35ac59){logger[_0x028c('0xd')](_0x028c('0x32'),_0x40576d);_0x253d2e['messageId']=_0x35ac59[_0x028c('0x15')][_0x028c('0x33')];return rpc[_0x13153c+_0x028c('0x22')][_0x028c('0x34')](_0x253d2e);})['then'](function(_0x5a368d){logger['info'](_0x028c('0xe'),_0x40576d,JSON[_0x028c('0x35')](_0x5a368d));})[_0x028c('0x36')](function(_0x4e3847){logger['error'](_0x028c('0x37'),_0x40576d,JSON[_0x028c('0x35')](_0x4e3847));})['finally'](function(){_0x5b8a57[_0x028c('0x10')]();});}else{return rpc[this['channel']+'Message']['create'](_0x253d2e)[_0x028c('0x31')](function(_0xbe082){logger[_0x028c('0xd')]('[%s][AUTOREPLY]\x20%s',_0x40576d,_0x253d2e['body']);})[_0x028c('0x36')](function(_0xddfd43){logger[_0x028c('0x38')]('[%s][AUTOREPLY]\x20%s',_0x40576d,JSON[_0x028c('0x35')](_0xddfd43));})['finally'](function(){_0x5b8a57[_0x028c('0x10')]();});}}}catch(_0x3153de){logger[_0x028c('0x38')](_0x028c('0xe'),_0x40576d,JSON[_0x028c('0x35')](_0x3153de));_0x5b8a57[_0x028c('0x39')]();}};};
\ No newline at end of file
index 6c44fd5..4b0f26a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ed1=['../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','stringify','finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7ed1,0xca));var _0x17ed=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x7ed1[_0x4fde08];return _0x12e725;};'use strict';var moment=require(_0x17ed('0x0'));var logger=require('../../../../config/logger')(_0x17ed('0x1'));var rpc={'chatInteraction':require(_0x17ed('0x2')),'openchannelInteraction':require(_0x17ed('0x3')),'smsInteraction':require(_0x17ed('0x4')),'mailInteraction':require(_0x17ed('0x5')),'faxInteraction':require(_0x17ed('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x17ed('0x7')]=function(_0x7b29db,_0x1897a6,_0x15583a,_0x569334){return function(_0x566a07){try{logger[_0x17ed('0x8')](_0x17ed('0x9'),_0x7b29db,_0x1897a6[0x0]);var _0xcd3d39={'closed':0x1,'closedAt':moment()[_0x17ed('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x17ed('0xb'),'disposition':_0x1897a6[0x0]};if(rpc[_0x569334[_0x17ed('0xc')]+_0x17ed('0xd')]){rpc[_0x569334[_0x17ed('0xc')]+_0x17ed('0xd')][_0x17ed('0xe')](_0x569334['interaction']['id'],_0xcd3d39)[_0x17ed('0xf')](function(_0x4935aa){logger['info'](_0x17ed('0x10'),_0x7b29db,_0x569334[_0x17ed('0x11')]['id']);})[_0x17ed('0x12')](function(_0x10d961){logger[_0x17ed('0x13')]('[%s][CLOSE]\x20%s',_0x7b29db,JSON[_0x17ed('0x14')](_0x10d961));})[_0x17ed('0x15')](function(){_0x566a07[_0x17ed('0x16')]();});}}catch(_0x5f408e){logger[_0x17ed('0x13')]('[%s][CLOSE]\x20%s',_0x7b29db,JSON['stringify'](_0x5f408e));_0x566a07[_0x17ed('0x16')]();}};};
\ No newline at end of file
+var _0x4312=['interaction','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','then'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x4312,0xaf));var _0x2431=function(_0x2b2dd1,_0x2c6ac7){_0x2b2dd1=_0x2b2dd1-0x0;var _0x5d2ef5=_0x4312[_0x2b2dd1];return _0x5d2ef5;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x2431('0x0'));var rpc={'chatInteraction':require(_0x2431('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x2431('0x2')),'mailInteraction':require(_0x2431('0x3')),'faxInteraction':require(_0x2431('0x4')),'whatsappInteraction':require(_0x2431('0x5'))};exports[_0x2431('0x6')]=function(_0xbf4fd6,_0x5bc042,_0x3781eb,_0x54c720){return function(_0xa2cabe){try{logger[_0x2431('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0xbf4fd6,_0x5bc042[0x0]);var _0x9647b4={'closed':0x1,'closedAt':moment()[_0x2431('0x8')](_0x2431('0x9')),'closeReason':'system','disposition':_0x5bc042[0x0]};if(rpc[_0x54c720[_0x2431('0xa')]+_0x2431('0xb')]){rpc[_0x54c720[_0x2431('0xa')]+'Interaction'][_0x2431('0xc')](_0x54c720['interaction']['id'],_0x9647b4)[_0x2431('0xd')](function(_0x22b796){logger[_0x2431('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xbf4fd6,_0x54c720[_0x2431('0xe')]['id']);})[_0x2431('0xf')](function(_0xf39eaa){logger[_0x2431('0x10')]('[%s][CLOSE]\x20%s',_0xbf4fd6,JSON[_0x2431('0x11')](_0xf39eaa));})[_0x2431('0x12')](function(){_0xa2cabe[_0x2431('0x13')]();});}}catch(_0x41b8cd){logger[_0x2431('0x10')](_0x2431('0x14'),_0xbf4fd6,JSON[_0x2431('0x11')](_0x41b8cd));_0xa2cabe[_0x2431('0x13')]();}};};
\ No newline at end of file
index 57888b1..e9ee835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3e3=['[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','result','fulfillment','speech','create','metadata','endConversation','lodash','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','[%s][DIALOGFLOW]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','Message','then','body','catch','error','stringify','finally','info'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xe3e3,0x120));var _0x3e3e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe3e3[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x3e3e('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x3e3e('0x1'));var utils=require(_0x3e3e('0x2'));var logger=require(_0x3e3e('0x3'))(_0x3e3e('0x4'));var rpc={'chatMessage':require(_0x3e3e('0x5')),'openchannelMessage':require(_0x3e3e('0x6')),'mailMessage':require(_0x3e3e('0x7')),'smsMessage':require(_0x3e3e('0x8')),'faxMessage':require(_0x3e3e('0x9')),'whatsappMessage':require(_0x3e3e('0xa'))};exports[_0x3e3e('0xb')]=function(_0x5109e6,_0x24c6fe){return function(_0x4ed6ad){try{if(!_['isNil'](this[_0x3e3e('0xc')][_0x3e3e('0xd')])){logger['info'](_0x3e3e('0xe'),_0x5109e6,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4ed6ad[_0x3e3e('0xf')]();}var _0x550f84={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3e3e('0x10')](_0x3e3e('0x11')),'direction':'out'};var _0x236633=this[_0x3e3e('0x12')];if(_0x236633===_0x3e3e('0x13')){_0x550f84[_0x3e3e('0x14')]=this['account']['id'];}else{_0x550f84[_[_0x3e3e('0x15')](_0x236633)+_0x3e3e('0x16')]=this[_0x3e3e('0x17')]['id'];}_0x550f84[_['upperFirst'](_0x236633)+_0x3e3e('0x18')]=this[_0x3e3e('0xc')]['id'];if(this[_0x3e3e('0xc')]['created']){var _0x61ca77=_0x24c6fe[0x2];if(!_[_0x3e3e('0x19')](_0x61ca77)){_0x550f84['body']=utils['getMustacheRender'](_0x61ca77,this);return rpc[_0x236633+_0x3e3e('0x1a')]['create'](_0x550f84)[_0x3e3e('0x1b')](function(_0x37f19b){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x5109e6,_0x550f84[_0x3e3e('0x1c')]);})[_0x3e3e('0x1d')](function(_0x545b01){logger[_0x3e3e('0x1e')](_0x3e3e('0xe'),_0x5109e6,JSON[_0x3e3e('0x1f')](_0x545b01));})[_0x3e3e('0x20')](function(){logger[_0x3e3e('0x21')](_0x3e3e('0x22'),_0x5109e6);_0x4ed6ad['stop']();});}else{logger['info'](_0x3e3e('0x23'),_0x5109e6);_0x4ed6ad[_0x3e3e('0x24')]();}}else{var _0x26f6f8=this;var _0x1efa77=apiai(_0x24c6fe[0x0],{'language':_0x24c6fe[0x1]||'en'});return _0x1efa77[_0x3e3e('0x25')](this[_0x3e3e('0x26')][_0x3e3e('0x1c')],{'sessionId':md5(this[_0x3e3e('0xc')]['id'])})[_0x3e3e('0x1b')](function(_0x3289b7){_0x26f6f8['body'][_0x3e3e('0x27')]=_0x3289b7;_0x550f84[_0x3e3e('0x1c')]=_0x3289b7[_0x3e3e('0x28')][_0x3e3e('0x29')][_0x3e3e('0x2a')];return rpc[_0x236633+_0x3e3e('0x1a')][_0x3e3e('0x2b')](_0x550f84)['then'](function(_0x120af2){logger[_0x3e3e('0x21')](_0x3e3e('0xe'),_0x5109e6,_0x550f84[_0x3e3e('0x1c')]);if(_0x3289b7['result'][_0x3e3e('0x2c')][_0x3e3e('0x2d')]){_0x4ed6ad[_0x3e3e('0xf')]();}else{_0x4ed6ad[_0x3e3e('0x24')]();}})[_0x3e3e('0x1d')](function(_0x232c96){logger[_0x3e3e('0x1e')](_0x3e3e('0xe'),_0x5109e6,JSON[_0x3e3e('0x1f')](_0x232c96));_0x4ed6ad[_0x3e3e('0xf')]();});})['catch'](function(_0xcf3e32){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x5109e6,_0xcf3e32[_0x3e3e('0x26')]);_0x4ed6ad[_0x3e3e('0xf')]();});}}catch(_0x1a0403){logger[_0x3e3e('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x5109e6,JSON[_0x3e3e('0x1f')](_0x1a0403));_0x4ed6ad['stop']();}};};
\ No newline at end of file
+var _0x25af=['metadata','endConversation','catch','lodash','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','result','fulfillment','speech'];(function(_0xc6b2fd,_0x20fede){var _0x17de0f=function(_0x2daccb){while(--_0x2daccb){_0xc6b2fd['push'](_0xc6b2fd['shift']());}};_0x17de0f(++_0x20fede);}(_0x25af,0x117));var _0xf25a=function(_0x482141,_0x2c4fdb){_0x482141=_0x482141-0x0;var _0x121620=_0x25af[_0x482141];return _0x121620;};'use strict';var _=require(_0xf25a('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0xf25a('0x1'));var utils=require(_0xf25a('0x2'));var logger=require('../../../../config/logger')(_0xf25a('0x3'));var rpc={'chatMessage':require(_0xf25a('0x4')),'openchannelMessage':require(_0xf25a('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf25a('0x6')),'whatsappMessage':require(_0xf25a('0x7'))};exports[_0xf25a('0x8')]=function(_0x2c4d5e,_0x992427){return function(_0x196902){try{if(!_['isNil'](this[_0xf25a('0x9')][_0xf25a('0xa')])){logger[_0xf25a('0xb')](_0xf25a('0xc'),_0x2c4d5e,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x196902[_0xf25a('0xd')]();}var _0x2a22cf={'ContactId':this[_0xf25a('0xe')]['id'],'sentAt':moment()[_0xf25a('0xf')](_0xf25a('0x10')),'direction':_0xf25a('0x11')};var _0x49e51b=this['channel'];if(_0x49e51b===_0xf25a('0x12')){_0x2a22cf[_0xf25a('0x13')]=this[_0xf25a('0x14')]['id'];}else{_0x2a22cf[_[_0xf25a('0x15')](_0x49e51b)+_0xf25a('0x16')]=this[_0xf25a('0x14')]['id'];}_0x2a22cf[_[_0xf25a('0x15')](_0x49e51b)+_0xf25a('0x17')]=this[_0xf25a('0x9')]['id'];if(this[_0xf25a('0x9')][_0xf25a('0x18')]){var _0x4f78f3=_0x992427[0x2];if(!_[_0xf25a('0x19')](_0x4f78f3)){_0x2a22cf[_0xf25a('0x1a')]=utils[_0xf25a('0x1b')](_0x4f78f3,this);return rpc[_0x49e51b+_0xf25a('0x1c')][_0xf25a('0x1d')](_0x2a22cf)[_0xf25a('0x1e')](function(_0xac057c){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x2c4d5e,_0x2a22cf[_0xf25a('0x1a')]);})['catch'](function(_0x596fe8){logger[_0xf25a('0x1f')](_0xf25a('0xc'),_0x2c4d5e,JSON[_0xf25a('0x20')](_0x596fe8));})[_0xf25a('0x21')](function(){logger[_0xf25a('0xb')](_0xf25a('0x22'),_0x2c4d5e);_0x196902['stop']();});}else{logger[_0xf25a('0xb')](_0xf25a('0x23'),_0x2c4d5e);_0x196902[_0xf25a('0x24')]();}}else{var _0x3edc8b=this;var _0x19362e=apiai(_0x992427[0x0],{'language':_0x992427[0x1]||'en'});return _0x19362e[_0xf25a('0x25')](this[_0xf25a('0x26')]['body'],{'sessionId':md5(this[_0xf25a('0x9')]['id'])})['then'](function(_0x161eab){_0x3edc8b[_0xf25a('0x1a')][_0xf25a('0x27')]=_0x161eab;_0x2a22cf['body']=_0x161eab[_0xf25a('0x28')][_0xf25a('0x29')][_0xf25a('0x2a')];return rpc[_0x49e51b+'Message'][_0xf25a('0x1d')](_0x2a22cf)[_0xf25a('0x1e')](function(_0xc3257b){logger['info'](_0xf25a('0xc'),_0x2c4d5e,_0x2a22cf['body']);if(_0x161eab[_0xf25a('0x28')][_0xf25a('0x2b')][_0xf25a('0x2c')]){_0x196902[_0xf25a('0xd')]();}else{_0x196902['stop']();}})[_0xf25a('0x2d')](function(_0x3310b4){logger[_0xf25a('0x1f')](_0xf25a('0xc'),_0x2c4d5e,JSON[_0xf25a('0x20')](_0x3310b4));_0x196902[_0xf25a('0xd')]();});})['catch'](function(_0x42756b){logger['error'](_0xf25a('0xc'),_0x2c4d5e,_0x42756b[_0xf25a('0x26')]);_0x196902['next']();});}}catch(_0x30f3f7){logger[_0xf25a('0x1f')](_0xf25a('0xc'),_0x2c4d5e,JSON[_0xf25a('0x20')](_0x30f3f7));_0x196902['stop']();}};};
\ No newline at end of file
index 2a3f4c6..a5488e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cd0=['../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityFalse','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x4cd0,0x1bf));var _0x04cd=function(_0x1e22b4,_0x4c061e){_0x1e22b4=_0x1e22b4-0x0;var _0x564051=_0x4cd0[_0x1e22b4];return _0x564051;};'use strict';var schema=require(_0x04cd('0x0'));var _=require(_0x04cd('0x1'));var htmlToText=require(_0x04cd('0x2'));var utils=require('./utils');var logger=require(_0x04cd('0x3'))(_0x04cd('0x4'));var gotoif=schema({'condition':{'type':_0x04cd('0x5'),'required':!![],'message':_0x04cd('0x6')},'priorityTrue':{'type':_0x04cd('0x7'),'message':_0x04cd('0x8')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x404384,_0x11235b){return function(_0xe29702){try{var _0x4b15e8={'condition':htmlToText[_0x04cd('0x9')](utils[_0x04cd('0xa')](_0x11235b[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x11235b[0x1],'priorityFalse':_0x11235b[0x2]};var _0x51fe7c=gotoif[_0x04cd('0x0')](_0x4b15e8,{'typecast':!![]});if(_0x51fe7c[_0x04cd('0xb')]){logger[_0x04cd('0xc')](_0x04cd('0xd'),_0x404384,_[_0x04cd('0xe')](_0x51fe7c,_0x04cd('0xf'))['join'](',\x20'));_0xe29702[_0x04cd('0x10')]();}else{try{var _0x1b586b=eval('('+_0x4b15e8[_0x04cd('0x11')]+')');var _0x1bf077=_0x1b586b?_0x4b15e8['priorityTrue']:_0x4b15e8[_0x04cd('0x12')];logger[_0x04cd('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x404384,_0x4b15e8[_0x04cd('0x11')],_0x1b586b,_0x1bf077||_0x04cd('0x14'));if(_0x1bf077){var _0x105c57=_['findIndex'](_0xe29702[_0x04cd('0x15')](),{'p':_0x1bf077});if(_0x105c57>=0x0){logger[_0x04cd('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x404384,_0x1bf077||'next',_0x105c57);_0xe29702['next'](_0x105c57);}else{logger[_0x04cd('0x13')](_0x04cd('0x16'),_0x404384,_0x1bf077||_0x04cd('0x14'));_0xe29702[_0x04cd('0x10')]();}}else{_0xe29702['next']();}}catch(_0x5a06f0){logger[_0x04cd('0xc')](_0x04cd('0x17'),_0x404384,_0x5a06f0['message']);_0xe29702[_0x04cd('0x10')]();}}}catch(_0x56ddd6){logger[_0x04cd('0xc')](_0x04cd('0xd'),_0x404384,JSON[_0x04cd('0x18')](_0x56ddd6));_0xe29702[_0x04cd('0x10')]();}};};
\ No newline at end of file
+var _0x453f=['priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number'];(function(_0x40db7f,_0x2c209b){var _0xe98de8=function(_0x636b4e){while(--_0x636b4e){_0x40db7f['push'](_0x40db7f['shift']());}};_0xe98de8(++_0x2c209b);}(_0x453f,0x18d));var _0xf453=function(_0x73d88a,_0x5160c7){_0x73d88a=_0x73d88a-0x0;var _0x9f7072=_0x453f[_0x73d88a];return _0x9f7072;};'use strict';var schema=require(_0xf453('0x0'));var _=require(_0xf453('0x1'));var htmlToText=require(_0xf453('0x2'));var utils=require(_0xf453('0x3'));var logger=require(_0xf453('0x4'))('routing');var gotoif=schema({'condition':{'type':_0xf453('0x5'),'required':!![],'message':_0xf453('0x6')},'priorityTrue':{'type':'number','message':_0xf453('0x7')},'priorityFalse':{'type':'number','message':_0xf453('0x8')}});exports[_0xf453('0x9')]=function(_0x37b3bf,_0x397cc0){return function(_0x451080){try{var _0x4c5398={'condition':htmlToText[_0xf453('0xa')](utils['getMustacheRender'](_0x397cc0[0x0],this),{'wordwrap':![]})[_0xf453('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x397cc0[0x1],'priorityFalse':_0x397cc0[0x2]};var _0x536e3b=gotoif[_0xf453('0x0')](_0x4c5398,{'typecast':!![]});if(_0x536e3b[_0xf453('0xc')]){logger['error'](_0xf453('0xd'),_0x37b3bf,_[_0xf453('0xe')](_0x536e3b,_0xf453('0xf'))['join'](',\x20'));_0x451080[_0xf453('0x10')]();}else{try{var _0x2e5675=eval('('+_0x4c5398[_0xf453('0x11')]+')');var _0x1a6e19=_0x2e5675?_0x4c5398[_0xf453('0x12')]:_0x4c5398[_0xf453('0x13')];logger[_0xf453('0x14')](_0xf453('0x15'),_0x37b3bf,_0x4c5398[_0xf453('0x11')],_0x2e5675,_0x1a6e19||_0xf453('0x16'));if(_0x1a6e19){var _0x3eb66b=_[_0xf453('0x17')](_0x451080[_0xf453('0x18')](),{'p':_0x1a6e19});if(_0x3eb66b>=0x0){logger[_0xf453('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x37b3bf,_0x1a6e19||_0xf453('0x16'),_0x3eb66b);_0x451080[_0xf453('0x16')](_0x3eb66b);}else{logger[_0xf453('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x37b3bf,_0x1a6e19||_0xf453('0x16'));_0x451080[_0xf453('0x10')]();}}else{_0x451080[_0xf453('0x16')]();}}catch(_0x114202){logger[_0xf453('0x19')](_0xf453('0x1a'),_0x37b3bf,_0x114202[_0xf453('0xf')]);_0x451080[_0xf453('0x10')]();}}}catch(_0x494d36){logger[_0xf453('0x19')](_0xf453('0xd'),_0x37b3bf,JSON['stringify'](_0x494d36));_0x451080[_0xf453('0x10')]();}};};
\ No newline at end of file
index 8f3ade5..9cdb959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x823d=['[%s][GOTOP]\x20%s','map','message','info','[%s][GOTOP]\x20priority\x20%s','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','stringify','stop','validate','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x823d,0x1dc));var _0xd823=function(_0x962fc5,_0x58f074){_0x962fc5=_0x962fc5-0x0;var _0x43667c=_0x823d[_0x962fc5];return _0x43667c;};'use strict';var schema=require(_0xd823('0x0'));var _=require(_0xd823('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xd823('0x2'),'required':!![],'message':_0xd823('0x3')}});exports['consequence']=function(_0x1340e7,_0x450dcf){return function(_0x2c354f){try{var _0x47836e={'priority':_0x450dcf[0x0]};var _0x5e4a04=gotop[_0xd823('0x0')](_0x47836e,{'typecast':!![]});if(_0x5e4a04['length']){logger['error'](_0xd823('0x4'),_0x1340e7,_[_0xd823('0x5')](_0x5e4a04,_0xd823('0x6'))['join'](',\x20'));_0x2c354f['stop']();}else{logger[_0xd823('0x7')](_0xd823('0x8'),_0x1340e7,_0x47836e['priority']);if(_0x47836e['priority']){var _0x1b674f=_[_0xd823('0x9')](_0x2c354f[_0xd823('0xa')](),{'p':_0x47836e['priority']});if(_0x1b674f>=0x0){logger[_0xd823('0x7')](_0xd823('0xb'),_0x1340e7,_0x47836e['priority']||_0xd823('0xc'),_0x1b674f);_0x2c354f[_0xd823('0xc')](_0x1b674f);}else{logger[_0xd823('0x7')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1340e7,_0x47836e['priority']||_0xd823('0xc'));_0x2c354f['stop']();}}else{_0x2c354f['next']();}}}catch(_0x23c087){logger[_0xd823('0xd')](_0xd823('0x4'),_0x1340e7,JSON[_0xd823('0xe')](_0x23c087));_0x2c354f[_0xd823('0xf')]();}};};
\ No newline at end of file
+var _0x949b=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','../../../../config/logger','routing','consequence','length','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules'];(function(_0x9f2ab0,_0x1a983a){var _0x21885d=function(_0x41575b){while(--_0x41575b){_0x9f2ab0['push'](_0x9f2ab0['shift']());}};_0x21885d(++_0x1a983a);}(_0x949b,0x7d));var _0xb949=function(_0x521ad0,_0x2b2845){_0x521ad0=_0x521ad0-0x0;var _0x288a5d=_0x949b[_0x521ad0];return _0x288a5d;};'use strict';var schema=require(_0xb949('0x0'));var _=require(_0xb949('0x1'));var logger=require(_0xb949('0x2'))(_0xb949('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xb949('0x4')]=function(_0x4dd7bc,_0x439351){return function(_0x22d98e){try{var _0x4e944d={'priority':_0x439351[0x0]};var _0x43a0c9=gotop['validate'](_0x4e944d,{'typecast':!![]});if(_0x43a0c9[_0xb949('0x5')]){logger['error'](_0xb949('0x6'),_0x4dd7bc,_[_0xb949('0x7')](_0x43a0c9,_0xb949('0x8'))[_0xb949('0x9')](',\x20'));_0x22d98e[_0xb949('0xa')]();}else{logger[_0xb949('0xb')](_0xb949('0xc'),_0x4dd7bc,_0x4e944d[_0xb949('0xd')]);if(_0x4e944d[_0xb949('0xd')]){var _0x42a6b0=_['findIndex'](_0x22d98e[_0xb949('0xe')](),{'p':_0x4e944d['priority']});if(_0x42a6b0>=0x0){logger[_0xb949('0xb')](_0xb949('0xf'),_0x4dd7bc,_0x4e944d[_0xb949('0xd')]||_0xb949('0x10'),_0x42a6b0);_0x22d98e[_0xb949('0x10')](_0x42a6b0);}else{logger[_0xb949('0xb')](_0xb949('0x11'),_0x4dd7bc,_0x4e944d[_0xb949('0xd')]||'next');_0x22d98e['stop']();}}else{_0x22d98e[_0xb949('0x10')]();}}}catch(_0x2d1823){logger[_0xb949('0x12')](_0xb949('0x6'),_0x4dd7bc,JSON[_0xb949('0x13')](_0x2d1823));_0x22d98e[_0xb949('0xa')]();}};};
\ No newline at end of file
index 59f77d0..196d5ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c0e=['stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify'];(function(_0x2608e4,_0x4be971){var _0x13911f=function(_0x17b295){while(--_0x17b295){_0x2608e4['push'](_0x2608e4['shift']());}};_0x13911f(++_0x4be971);}(_0x4c0e,0x83));var _0xe4c0=function(_0x5457a1,_0x2478b3){_0x5457a1=_0x5457a1-0x0;var _0x52ad60=_0x4c0e[_0x5457a1];return _0x52ad60;};'use strict';var _=require(_0xe4c0('0x0'));var utils=require(_0xe4c0('0x1'));var logger=require(_0xe4c0('0x2'))('routing');var rpc={'chatMessage':require(_0xe4c0('0x3')),'openchannelMessage':require(_0xe4c0('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe4c0('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xe4c0('0x6'))};exports['consequence']=function(_0x4fcea7,_0x44c427){return function(_0x217ad2){try{var _0x1bdc33={'body':utils[_0xe4c0('0x7')](_0x44c427[0x0],this),'ContactId':this[_0xe4c0('0x8')]['id']};if(this[_0xe4c0('0x9')]===_0xe4c0('0xa')){_0x1bdc33['ChatWebsiteId']=this[_0xe4c0('0xb')]['id'];}else{_0x1bdc33[_[_0xe4c0('0xc')](this['channel'])+_0xe4c0('0xd')]=this[_0xe4c0('0xb')]['id'];}_0x1bdc33[_['upperFirst'](this[_0xe4c0('0x9')])+_0xe4c0('0xe')]=this[_0xe4c0('0xf')]['id'];if(rpc[this[_0xe4c0('0x9')]+_0xe4c0('0x10')]){return rpc[this[_0xe4c0('0x9')]+'Message']['create'](_0x1bdc33)[_0xe4c0('0x11')](function(_0x271f94){logger[_0xe4c0('0x12')](_0xe4c0('0x13'),_0x4fcea7,_0x1bdc33[_0xe4c0('0x14')]);_0x217ad2[_0xe4c0('0x15')]();})[_0xe4c0('0x16')](function(_0x27e28b){logger[_0xe4c0('0x17')](_0xe4c0('0x13'),_0x4fcea7,JSON[_0xe4c0('0x18')](_0x27e28b));_0x217ad2[_0xe4c0('0x19')]();});}}catch(_0x97e541){logger[_0xe4c0('0x17')]('[%s][MESSAGE]\x20%s',_0x4fcea7,JSON['stringify'](_0x97e541));_0x217ad2['stop']();}};};
\ No newline at end of file
+var _0x0577=['catch','stringify','stop','error','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0x0577,0x78));var _0x7057=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x0577[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var utils=require(_0x7057('0x0'));var logger=require(_0x7057('0x1'))(_0x7057('0x2'));var rpc={'chatMessage':require(_0x7057('0x3')),'openchannelMessage':require(_0x7057('0x4')),'mailMessage':require(_0x7057('0x5')),'smsMessage':require(_0x7057('0x6')),'faxMessage':require(_0x7057('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7057('0x8')]=function(_0x18a708,_0x18d8e3){return function(_0x37552e){try{var _0x5d4f88={'body':utils[_0x7057('0x9')](_0x18d8e3[0x0],this),'ContactId':this[_0x7057('0xa')]['id']};if(this[_0x7057('0xb')]===_0x7057('0xc')){_0x5d4f88[_0x7057('0xd')]=this[_0x7057('0xe')]['id'];}else{_0x5d4f88[_[_0x7057('0xf')](this['channel'])+_0x7057('0x10')]=this[_0x7057('0xe')]['id'];}_0x5d4f88[_[_0x7057('0xf')](this[_0x7057('0xb')])+_0x7057('0x11')]=this[_0x7057('0x12')]['id'];if(rpc[this[_0x7057('0xb')]+'Message']){return rpc[this[_0x7057('0xb')]+_0x7057('0x13')][_0x7057('0x14')](_0x5d4f88)['then'](function(_0x43cf68){logger[_0x7057('0x15')](_0x7057('0x16'),_0x18a708,_0x5d4f88[_0x7057('0x17')]);_0x37552e[_0x7057('0x18')]();})[_0x7057('0x19')](function(_0x2334de){logger['error']('[%s][MESSAGE]\x20%s',_0x18a708,JSON[_0x7057('0x1a')](_0x2334de));_0x37552e[_0x7057('0x1b')]();});}}catch(_0x41bae3){logger[_0x7057('0x1c')](_0x7057('0x16'),_0x18a708,JSON[_0x7057('0x1a')](_0x41bae3));_0x37552e[_0x7057('0x1b')]();}};};
\ No newline at end of file
index 94dbbf0..17d3212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8450=['stop','./utils','routing','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0x8450,0xf4));var _0x0845=function(_0x2b5c57,_0x40f29b){_0x2b5c57=_0x2b5c57-0x0;var _0x26d2fb=_0x8450[_0x2b5c57];return _0x26d2fb;};'use strict';var utils=require(_0x0845('0x0'));var logger=require('../../../../config/logger')(_0x0845('0x1'));exports['consequence']=function(_0x48ff7a,_0x5a541a){return function(_0x248b74){try{logger[_0x0845('0x2')](_0x0845('0x3'),_0x48ff7a,utils[_0x0845('0x4')](_0x5a541a[0x0],this));_0x248b74[_0x0845('0x5')]();}catch(_0x325d47){logger[_0x0845('0x6')](_0x0845('0x3'),_0x48ff7a,JSON[_0x0845('0x7')](_0x325d47));_0x248b74[_0x0845('0x8')]();}};};
\ No newline at end of file
+var _0x8a9e=['error','stringify','stop','./utils','../../../../config/logger','routing','consequence','getMustacheRender','next'];(function(_0x1a7b68,_0x30a625){var _0x3b7799=function(_0x1b4bab){while(--_0x1b4bab){_0x1a7b68['push'](_0x1a7b68['shift']());}};_0x3b7799(++_0x30a625);}(_0x8a9e,0xed));var _0xe8a9=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x8a9e[_0x13e741];return _0x3f8bb3;};'use strict';var utils=require(_0xe8a9('0x0'));var logger=require(_0xe8a9('0x1'))(_0xe8a9('0x2'));exports[_0xe8a9('0x3')]=function(_0x25cebd,_0x21ba9b){return function(_0x220fa8){try{logger['info']('[%s][NOOP]\x20%s',_0x25cebd,utils[_0xe8a9('0x4')](_0x21ba9b[0x0],this));_0x220fa8[_0xe8a9('0x5')]();}catch(_0x5c0f85){logger[_0xe8a9('0x6')]('[%s][NOOP]\x20%s',_0x25cebd,JSON[_0xe8a9('0x7')](_0x5c0f85));_0x220fa8[_0xe8a9('0x8')]();}};};
\ No newline at end of file
index 25670f5..d438101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['contact','list','upperFirst','QueueId','InteractionId','interaction','message','channel','info','[%s][START:QUEUE][NAME:%s]','name','account','QueueReport','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','timeout','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','clone','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x17ff3b,_0x1735a6){var _0x497839=function(_0x51f8b2){while(--_0x51f8b2){_0x17ff3b['push'](_0x17ff3b['shift']());}};_0x497839(++_0x1735a6);}(_0x008c,0x188));var _0xc008=function(_0x572644,_0x543d79){_0x572644=_0x572644-0x0;var _0x17efa9=_0x008c[_0x572644];return _0x17efa9;};'use strict';var schema=require(_0xc008('0x0'));var _=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var seqqueue=require(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var Redis=require('ioredis');var config=require(_0xc008('0x5'));var logger=require(_0xc008('0x6'))(_0xc008('0x7'));var strategy=require(_0xc008('0x8'));config[_0xc008('0x9')]=_[_0xc008('0xa')](config[_0xc008('0x9')],{'host':_0xc008('0xb'),'port':0x18eb});var io=require(_0xc008('0xc'))(new Redis(config['redis']));var attributes=['id',_0xc008('0xd'),'account',_0xc008('0xe'),'from','joinAt'];function emit(_0x27830d,_0x7231b4,_0x57c46d){io['to'](_0x27830d)['emit'](_0x7231b4,_0x57c46d);}function emitChannelQueueInteraction(_0x543eb8,_0x1eacfa,_0xc881aa,_0x5b2004,_0xae2dab,_0x332fd4,_0x2ea200,_0x2a5b4e){var _0x9ffa93=_[_0xc008('0xf')](_0xc881aa);_0x9ffa93[_0xc008('0xd')]=_0x2a5b4e;_0x9ffa93['queue']=_0x1eacfa;_0x9ffa93['account']=_0x5b2004;_0x9ffa93['id']=_0xae2dab;if(_0x332fd4){_0x2ea200[util[_0xc008('0x10')]('%sQueuesWaitingInteractions',_0x543eb8)][_0xae2dab]=_[_0xc008('0x11')](_0x9ffa93,attributes);}else{delete _0x2ea200[util[_0xc008('0x10')](_0xc008('0x12'),_0x543eb8)][_0xae2dab];}emit(util[_0xc008('0x10')](_0xc008('0x13'),_0x543eb8,_0x1eacfa),util['format']('%s_queue_waiting_interaction:%s',_0x543eb8,_0x332fd4?'save':_0xc008('0x14')),_[_0xc008('0x11')](_0x9ffa93,attributes));}var rpc={'openchannelQueueReport':require(_0xc008('0x15')),'mailQueueReport':require(_0xc008('0x16')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xc008('0x17'),'required':!![],'message':_0xc008('0x18')},'timeout':{'type':'number','message':_0xc008('0x19')}});function startRouting(_0x5906e6,_0x4bd611,_0x543e5d,_0x50261c){if(_0x5906e6&&_0x4bd611&&_0x543e5d){_0x4bd611[_0xc008('0x1a')]+=0x1;var _0x4b9726={'uniqueid':_0x5906e6,'from':_0x543e5d['body']?_0x543e5d['body']['from']:'','joinAt':moment()['format'](_0xc008('0x1b')),'ContactId':_0x543e5d[_0xc008('0x1c')]?_0x543e5d[_0xc008('0x1c')]['id']:null,'ListId':_0x543e5d[_0xc008('0x1d')]?_0x543e5d[_0xc008('0x1d')]['id']:null};_0x4b9726[_[_0xc008('0x1e')](_0x543e5d['channel'])+_0xc008('0x1f')]=_0x4bd611['id']||null;_0x4b9726[_['upperFirst'](_0x543e5d['channel'])+_0xc008('0x20')]=_0x543e5d[_0xc008('0x21')]?_0x543e5d[_0xc008('0x21')]['id']:null;_0x4b9726[_[_0xc008('0x1e')](_0x543e5d['channel'])+'MessageId']=_0x543e5d['message']?_0x543e5d[_0xc008('0x22')]['id']:null;_0x4b9726[_[_0xc008('0x1e')](_0x543e5d[_0xc008('0x23')])+(_0x543e5d[_0xc008('0x23')]!=='chat'?'AccountId':'WebsiteId')]=_0x543e5d['account']?_0x543e5d['account']['id']:null;logger[_0xc008('0x24')](util[_0xc008('0x10')](_0xc008('0x25'),_0x5906e6,_0x4bd611['name']));emitChannelQueueInteraction(_0x543e5d[_0xc008('0x23')],_0x4bd611[_0xc008('0x26')],_0x4b9726,_0x543e5d[_0xc008('0x27')][_0xc008('0x26')],_0x543e5d['message']['id'],!![],_0x50261c,_0x4bd611['id']);if(rpc[_0x543e5d[_0xc008('0x23')]+_0xc008('0x28')]){return rpc[_0x543e5d['channel']+'QueueReport']['create'](_0x4b9726)[_0xc008('0x29')](function(_0x267abd){logger[_0xc008('0x2a')](_0xc008('0x2b'));});}}}function stopRouting(_0x1de04b,_0xceebc3,_0x294f97,_0x22d8e8){if(_0x1de04b&&_0xceebc3){_0xceebc3[_0xc008('0x1a')]-=0x1;var _0x2b862d={'leaveAt':moment()[_0xc008('0x10')](_0xc008('0x1b')),'acceptAt':moment()['format'](_0xc008('0x1b')),'reason':_0xc008('0x2c')};logger['info'](util[_0xc008('0x10')](_0xc008('0x2d'),_0x1de04b,_0xceebc3[_0xc008('0x26')]));emitChannelQueueInteraction(_0x294f97[_0xc008('0x23')],_0xceebc3[_0xc008('0x26')],_0x294f97[_0xc008('0x2e')],_0x294f97[_0xc008('0x27')][_0xc008('0x26')],_0x294f97[_0xc008('0x22')]['id'],![],_0x22d8e8,_0xceebc3['id']);if(rpc[_0x294f97['channel']+_0xc008('0x28')]){return rpc[_0x294f97[_0xc008('0x23')]+_0xc008('0x28')][_0xc008('0x2f')](_0x1de04b,_0x2b862d)[_0xc008('0x29')](function(_0x315562){logger[_0xc008('0x2a')]('update\x20queue\x20report');});}}}function endRouting(_0x35f360,_0x21763f,_0x50e1d4,_0x399b64){if(_0x35f360&&_0x21763f){_0x21763f[_0xc008('0x1a')]-=0x1;var _0x5e38d5={'leaveAt':moment()[_0xc008('0x10')](_0xc008('0x1b')),'exitAt':moment()[_0xc008('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger['info'](util[_0xc008('0x10')]('[%s][END:QUEUE][NAME:%s]',_0x35f360,_0x21763f[_0xc008('0x26')]));emitChannelQueueInteraction(_0x50e1d4[_0xc008('0x23')],_0x21763f[_0xc008('0x26')],_0x50e1d4[_0xc008('0x2e')],_0x50e1d4[_0xc008('0x27')][_0xc008('0x26')],_0x50e1d4[_0xc008('0x22')]['id'],![],_0x399b64);if(rpc[_0x50e1d4[_0xc008('0x23')]+_0xc008('0x28')]){return rpc[_0x50e1d4[_0xc008('0x23')]+_0xc008('0x28')][_0xc008('0x2f')](_0x35f360,_0x5e38d5)[_0xc008('0x29')](function(_0x2bf3fd){logger['error'](_0xc008('0x30'));});}}}function handleFindQueue(_0x23c4db){return function(_0x30b7df){return _0x30b7df[_0xc008('0x26')]['toLowerCase']()===_0x23c4db[_0xc008('0x31')]();};}exports[_0xc008('0x32')]=function(_0xc8cb91,_0x36e7ae,_0x2d142d,_0x5706bb){return function(_0x398cdd){try{var _0x3323f4={'name':_0x36e7ae[0x0],'timeout':_0x36e7ae[0x1]};var _0x3794b0=queue[_0xc008('0x0')](_0x3323f4,{'typecast':!![]});if(_0x3794b0[_0xc008('0x33')]){logger['error'](_0xc008('0x34'),_0xc8cb91,_[_0xc008('0x35')](_0x3794b0,_0xc008('0x22'))[_0xc008('0x36')](',\x20'));_0x398cdd['stop']();}else{var _0x26cd05=_[_0xc008('0x37')](_0x2d142d[_0x5706bb[_0xc008('0x23')]+'Queues'],handleFindQueue(_0x3323f4[_0xc008('0x26')]));if(_0x26cd05){startRouting(_0xc8cb91,_0x26cd05,_0x5706bb,_0x2d142d);var _0x49a176=(_0x26cd05[_0xc008('0x38')]||0xa)*0x3e8;var _0x5d3a72=(_0x3323f4[_0xc008('0x38')]||0x14)*0x3e8;var _0x213014,_0x5a5d85;if(_0x49a176>_0x5d3a72){_0x5d3a72=_0x49a176;}var _0x31007c=seqqueue[_0xc008('0x39')](_0x49a176);_0x31007c['id']=_0xc8cb91;_0x31007c[_0xc008('0x3a')]=_0x49a176;_0x31007c['qtimeout']=_0x5d3a72;_0x31007c[_0xc008('0x23')]=_0x5706bb[_0xc008('0x23')];_0x2d142d[_0xc008('0x3b')][_0xc8cb91]['on'](_0xc008('0x3c'),function(){logger[_0xc008('0x24')](_0xc008('0x3d'),_0xc8cb91);stopRouting(_0xc8cb91,_0x26cd05,_0x5706bb,_0x2d142d);clearTimeout(_0x213014);_0x213014=undefined;_0x31007c['close'](!![]);if(_0x2d142d['rules'][_0xc8cb91]){delete _0x2d142d['rules'][_0xc8cb91];}_0x398cdd[_0xc008('0x3e')]();});_0x2d142d[_0xc008('0x3b')][_0xc8cb91]['on'](_0xc008('0x3f'),function(){if(_0x2d142d[_0xc008('0x3b')][_0xc8cb91]){delete _0x2d142d[_0xc008('0x3b')][_0xc8cb91];}});_0x213014=setTimeout(function(){logger[_0xc008('0x24')](_0xc008('0x40'),_0xc8cb91);endRouting(_0xc8cb91,_0x26cd05,_0x5706bb,_0x2d142d);clearTimeout(_0x213014);_0x31007c[_0xc008('0x41')](!![]);_0x398cdd['next']();},_0x5d3a72);switch(_0x26cd05['strategy']){case'rrmemory':strategy[_0xc008('0x42')](_0x31007c,_0x26cd05,_0x2d142d,_0x5706bb);break;default:strategy[_0xc008('0x43')](_0x31007c,_0x26cd05,_0x2d142d,_0x5706bb);}}else{logger[_0xc008('0x2a')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0xc8cb91,_0x3323f4[_0xc008('0x26')]);_0x398cdd[_0xc008('0x3e')]();}}}catch(_0x17ab1a){console[_0xc008('0x44')](_0x17ab1a);logger[_0xc008('0x2a')](_0xc008('0x34'),_0xc8cb91,_0x17ab1a[_0xc008('0x45')]);_0x398cdd[_0xc008('0x3e')]();}};};
\ No newline at end of file
+var _0x3e74=['beepall','log','stack','validate','util','seq-queue','moment','../../../../config/logger','./strategy','redis','defaults','localhost','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','InteractionId','interaction','MessageId','message','channel','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','next','strategy','rrmemory'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x3e74,0x175));var _0x43e7=function(_0xf8c516,_0x22c6ee){_0xf8c516=_0xf8c516-0x0;var _0x2a6eb7=_0x3e74[_0xf8c516];return _0x2a6eb7;};'use strict';var schema=require(_0x43e7('0x0'));var _=require('lodash');var util=require(_0x43e7('0x1'));var seqqueue=require(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('routing');var strategy=require(_0x43e7('0x5'));config[_0x43e7('0x6')]=_[_0x43e7('0x7')](config[_0x43e7('0x6')],{'host':_0x43e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0x6')]));var attributes=['id',_0x43e7('0x9'),_0x43e7('0xa'),_0x43e7('0xb'),_0x43e7('0xc'),'joinAt'];function emit(_0x212c6c,_0x554d44,_0x54948c){io['to'](_0x212c6c)[_0x43e7('0xd')](_0x554d44,_0x54948c);}function emitChannelQueueInteraction(_0x4139c9,_0x5c34f4,_0x2803d9,_0x513707,_0xf7c520,_0x37302c,_0x4ebc8e,_0x3eb206){var _0xc960ea=_[_0x43e7('0xe')](_0x2803d9);_0xc960ea[_0x43e7('0x9')]=_0x3eb206;_0xc960ea['queue']=_0x5c34f4;_0xc960ea['account']=_0x513707;_0xc960ea['id']=_0xf7c520;if(_0x37302c){_0x4ebc8e[util[_0x43e7('0xf')](_0x43e7('0x10'),_0x4139c9)][_0xf7c520]=_[_0x43e7('0x11')](_0xc960ea,attributes);}else{delete _0x4ebc8e[util['format']('%sQueuesWaitingInteractions',_0x4139c9)][_0xf7c520];}emit(util[_0x43e7('0xf')](_0x43e7('0x12'),_0x4139c9,_0x5c34f4),util[_0x43e7('0xf')](_0x43e7('0x13'),_0x4139c9,_0x37302c?'save':'remove'),_[_0x43e7('0x11')](_0xc960ea,attributes));}var rpc={'openchannelQueueReport':require(_0x43e7('0x14')),'mailQueueReport':require(_0x43e7('0x15')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x43e7('0x16')),'whatsappQueueReport':require(_0x43e7('0x17'))};var queue=schema({'name':{'type':_0x43e7('0x18'),'required':!![],'message':_0x43e7('0x19')},'timeout':{'type':_0x43e7('0x1a'),'message':_0x43e7('0x1b')}});function startRouting(_0x619236,_0x1441ef,_0x2377a3,_0xab63cf){if(_0x619236&&_0x1441ef&&_0x2377a3){_0x1441ef[_0x43e7('0x1c')]+=0x1;var _0x177ee1={'uniqueid':_0x619236,'from':_0x2377a3['body']?_0x2377a3[_0x43e7('0x1d')][_0x43e7('0xc')]:'','joinAt':moment()['format'](_0x43e7('0x1e')),'ContactId':_0x2377a3[_0x43e7('0x1f')]?_0x2377a3[_0x43e7('0x1f')]['id']:null,'ListId':_0x2377a3[_0x43e7('0x20')]?_0x2377a3[_0x43e7('0x20')]['id']:null};_0x177ee1[_[_0x43e7('0x21')](_0x2377a3['channel'])+_0x43e7('0x22')]=_0x1441ef['id']||null;_0x177ee1[_['upperFirst'](_0x2377a3['channel'])+_0x43e7('0x23')]=_0x2377a3[_0x43e7('0x24')]?_0x2377a3['interaction']['id']:null;_0x177ee1[_[_0x43e7('0x21')](_0x2377a3['channel'])+_0x43e7('0x25')]=_0x2377a3['message']?_0x2377a3[_0x43e7('0x26')]['id']:null;_0x177ee1[_[_0x43e7('0x21')](_0x2377a3[_0x43e7('0x27')])+(_0x2377a3[_0x43e7('0x27')]!=='chat'?'AccountId':_0x43e7('0x28'))]=_0x2377a3['account']?_0x2377a3[_0x43e7('0xa')]['id']:null;logger[_0x43e7('0x29')](util[_0x43e7('0xf')](_0x43e7('0x2a'),_0x619236,_0x1441ef['name']));emitChannelQueueInteraction(_0x2377a3[_0x43e7('0x27')],_0x1441ef[_0x43e7('0x2b')],_0x177ee1,_0x2377a3[_0x43e7('0xa')][_0x43e7('0x2b')],_0x2377a3[_0x43e7('0x26')]['id'],!![],_0xab63cf,_0x1441ef['id']);if(rpc[_0x2377a3[_0x43e7('0x27')]+_0x43e7('0x2c')]){return rpc[_0x2377a3[_0x43e7('0x27')]+_0x43e7('0x2c')][_0x43e7('0x2d')](_0x177ee1)[_0x43e7('0x2e')](function(_0x19725a){logger[_0x43e7('0x2f')](_0x43e7('0x30'));});}}}function stopRouting(_0x4bdb17,_0x238321,_0x44f6b0,_0x3b8f78){if(_0x4bdb17&&_0x238321){_0x238321[_0x43e7('0x1c')]-=0x1;var _0x4251c8={'leaveAt':moment()['format'](_0x43e7('0x1e')),'acceptAt':moment()[_0x43e7('0xf')](_0x43e7('0x1e')),'reason':_0x43e7('0x31')};logger['info'](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x4bdb17,_0x238321[_0x43e7('0x2b')]));emitChannelQueueInteraction(_0x44f6b0[_0x43e7('0x27')],_0x238321[_0x43e7('0x2b')],_0x44f6b0[_0x43e7('0x1d')],_0x44f6b0[_0x43e7('0xa')][_0x43e7('0x2b')],_0x44f6b0['message']['id'],![],_0x3b8f78,_0x238321['id']);if(rpc[_0x44f6b0['channel']+'QueueReport']){return rpc[_0x44f6b0['channel']+'QueueReport']['update'](_0x4bdb17,_0x4251c8)['catch'](function(_0x14d888){logger['error'](_0x43e7('0x32'));});}}}function endRouting(_0x8e9f40,_0x31bc78,_0x50a2d0,_0x40f72f){if(_0x8e9f40&&_0x31bc78){_0x31bc78[_0x43e7('0x1c')]-=0x1;var _0x101d45={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x43e7('0x1e')),'reason':_0x43e7('0x33')};logger[_0x43e7('0x29')](util[_0x43e7('0xf')](_0x43e7('0x34'),_0x8e9f40,_0x31bc78[_0x43e7('0x2b')]));emitChannelQueueInteraction(_0x50a2d0[_0x43e7('0x27')],_0x31bc78[_0x43e7('0x2b')],_0x50a2d0['body'],_0x50a2d0[_0x43e7('0xa')][_0x43e7('0x2b')],_0x50a2d0['message']['id'],![],_0x40f72f);if(rpc[_0x50a2d0[_0x43e7('0x27')]+'QueueReport']){return rpc[_0x50a2d0[_0x43e7('0x27')]+_0x43e7('0x2c')][_0x43e7('0x35')](_0x8e9f40,_0x101d45)[_0x43e7('0x2e')](function(_0x35ac85){logger[_0x43e7('0x2f')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x574a93){return function(_0x30dfa9){return _0x30dfa9[_0x43e7('0x2b')][_0x43e7('0x36')]()===_0x574a93[_0x43e7('0x36')]();};}exports[_0x43e7('0x37')]=function(_0x4a4a85,_0x32a451,_0x4227c4,_0x575439){return function(_0x3628e0){try{var _0x51a69c={'name':_0x32a451[0x0],'timeout':_0x32a451[0x1]};var _0x2ad8ef=queue['validate'](_0x51a69c,{'typecast':!![]});if(_0x2ad8ef[_0x43e7('0x38')]){logger[_0x43e7('0x2f')](_0x43e7('0x39'),_0x4a4a85,_[_0x43e7('0x3a')](_0x2ad8ef,'message')['join'](',\x20'));_0x3628e0[_0x43e7('0x3b')]();}else{var _0x40c509=_[_0x43e7('0x3c')](_0x4227c4[_0x575439[_0x43e7('0x27')]+'Queues'],handleFindQueue(_0x51a69c['name']));if(_0x40c509){startRouting(_0x4a4a85,_0x40c509,_0x575439,_0x4227c4);var _0x5dd988=(_0x40c509[_0x43e7('0x33')]||0xa)*0x3e8;var _0x57f5d0=(_0x51a69c[_0x43e7('0x33')]||0x14)*0x3e8;var _0x4b3a59,_0x5b28db;if(_0x5dd988>_0x57f5d0){_0x57f5d0=_0x5dd988;}var _0x46b2e6=seqqueue['createQueue'](_0x5dd988);_0x46b2e6['id']=_0x4a4a85;_0x46b2e6[_0x43e7('0x3d')]=_0x5dd988;_0x46b2e6[_0x43e7('0x3e')]=_0x57f5d0;_0x46b2e6[_0x43e7('0x27')]=_0x575439[_0x43e7('0x27')];_0x4227c4['rules'][_0x4a4a85]['on'](_0x43e7('0x3f'),function(){logger[_0x43e7('0x29')](_0x43e7('0x40'),_0x4a4a85);stopRouting(_0x4a4a85,_0x40c509,_0x575439,_0x4227c4);clearTimeout(_0x4b3a59);_0x4b3a59=undefined;_0x46b2e6[_0x43e7('0x41')](!![]);if(_0x4227c4[_0x43e7('0x42')][_0x4a4a85]){delete _0x4227c4[_0x43e7('0x42')][_0x4a4a85];}_0x3628e0['stop']();});_0x4227c4['rules'][_0x4a4a85]['on'](_0x43e7('0x43'),function(){if(_0x4227c4[_0x43e7('0x42')][_0x4a4a85]){delete _0x4227c4[_0x43e7('0x42')][_0x4a4a85];}});_0x4b3a59=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x4a4a85);endRouting(_0x4a4a85,_0x40c509,_0x575439,_0x4227c4);clearTimeout(_0x4b3a59);_0x46b2e6['close'](!![]);_0x3628e0[_0x43e7('0x44')]();},_0x57f5d0);switch(_0x40c509[_0x43e7('0x45')]){case'rrmemory':strategy[_0x43e7('0x46')](_0x46b2e6,_0x40c509,_0x4227c4,_0x575439);break;default:strategy[_0x43e7('0x47')](_0x46b2e6,_0x40c509,_0x4227c4,_0x575439);}}else{logger[_0x43e7('0x2f')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4a4a85,_0x51a69c['name']);_0x3628e0['stop']();}}}catch(_0x4de644){console[_0x43e7('0x48')](_0x4de644);logger[_0x43e7('0x2f')]('[%s][QUEUE]\x20%s',_0x4a4a85,_0x4de644[_0x43e7('0x49')]);_0x3628e0[_0x43e7('0x3b')]();}};};
\ No newline at end of file
index 1716d90..ddc8f1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07c8=['busyQueue','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy'];(function(_0x5a488c,_0x4cc470){var _0x53a7d6=function(_0x43a0d8){while(--_0x43a0d8){_0x5a488c['push'](_0x5a488c['shift']());}};_0x53a7d6(++_0x4cc470);}(_0x07c8,0xef));var _0x807c=function(_0x3ecc65,_0x19cd71){_0x3ecc65=_0x3ecc65-0x0;var _0x22dd96=_0x07c8[_0x3ecc65];return _0x22dd96;};'use strict';var _=require(_0x807c('0x0'));var uuid=require(_0x807c('0x1'));var util=require(_0x807c('0x2'));var logger=require(_0x807c('0x3'))(_0x807c('0x4'));var Agent=function(_0x54499d,_0x11985f,_0x412650,_0x473be5){this[_0x807c('0x5')]=uuid['v4']();this[_0x807c('0x6')]=_0x54499d;this[_0x807c('0x7')]=_0x11985f;this[_0x807c('0x8')]=_0x412650;this[_0x807c('0x4')]=_0x473be5;this[_0x807c('0x6')]['push'](this['handleRun'][_0x807c('0x9')](this),this[_0x807c('0xa')]['bind'](this));this[_0x807c('0x6')]['on'](_0x807c('0xb'),this[_0x807c('0xa')][_0x807c('0x9')](this));this[_0x807c('0x6')]['on'](_0x807c('0xc'),this[_0x807c('0xd')][_0x807c('0x9')](this));};Agent[_0x807c('0xe')][_0x807c('0xf')]=function(){this[_0x807c('0x6')][_0x807c('0xf')](this['handleRun'][_0x807c('0x9')](this),this[_0x807c('0xa')][_0x807c('0x9')](this));};Agent['prototype']['handleDrained']=function(){this[_0x807c('0xa')](!![]);};Agent['prototype']['handleRun']=function(_0x459348){logger[_0x807c('0x10')](_0x807c('0x11'),this[_0x807c('0x6')]['id'],this[_0x807c('0x7')]['id']);if(_[_0x807c('0x12')](this['realtime'][_0x807c('0x13')][this['agent']['id']])){logger[_0x807c('0x10')](_0x807c('0x14'),this[_0x807c('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0x807c('0x9')](this),0x3e8);}else{if(this[_0x807c('0x4')][_0x807c('0x15')]||util[_0x807c('0x16')](this['squeue']['id'],this['realtime'][_0x807c('0x13')][this[_0x807c('0x7')]['id']],this[_0x807c('0x6')][_0x807c('0x17')],![])){this[_0x807c('0x8')][_0x807c('0x13')][this['agent']['id']][_0x807c('0x18')]=!![];this['realtime']['agents'][this[_0x807c('0x7')]['id']][_0x807c('0x19')]=undefined;util['showNotification'](this[_0x807c('0x5')],this[_0x807c('0x6')]['id'],this[_0x807c('0x8')]['agents'][this[_0x807c('0x7')]['id']],null,this[_0x807c('0x4')]);util[_0x807c('0x1a')](this[_0x807c('0x6')]['id'],this[_0x807c('0x8')][_0x807c('0x13')][this['agent']['id']],_0x807c('0x1b')+(this[_0x807c('0x4')][_0x807c('0x15')]?':FORCED':''));}else{logger[_0x807c('0x10')](_0x807c('0x1c'),this['squeue']['id'],this[_0x807c('0x7')]['id']);setTimeout(this['push'][_0x807c('0x9')](this),0x3e8);}}};Agent['prototype'][_0x807c('0xa')]=function(_0x45e6fa){if(_[_0x807c('0x12')](this[_0x807c('0x8')][_0x807c('0x13')][this[_0x807c('0x7')]['id']])){return logger[_0x807c('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x807c('0x6')]['id'],this[_0x807c('0x7')]['id']);}else{logger[_0x807c('0x10')](_0x807c('0x1d'),this[_0x807c('0x6')]['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this[_0x807c('0x6')]['id'],this[_0x807c('0x8')][_0x807c('0x13')][this[_0x807c('0x7')]['id']],null,this['routing']);this['realtime'][_0x807c('0x13')][this['agent']['id']][_0x807c('0x18')]=![];this[_0x807c('0x8')]['agents'][this[_0x807c('0x7')]['id']][_0x807c('0x19')]=undefined;util[_0x807c('0x1a')](this[_0x807c('0x6')]['id'],this[_0x807c('0x8')][_0x807c('0x13')][this['agent']['id']],_0x45e6fa?_0x807c('0x1e'):_0x807c('0x1f'));}if(!_0x45e6fa){setTimeout(this[_0x807c('0xf')][_0x807c('0x9')](this),0x3e8);}};function agent(_0x17a683,_0x15cb31,_0x41a0cd,_0x40b685){return new Agent(_0x17a683,_0x15cb31,_0x41a0cd,_0x40b685);}module[_0x807c('0x20')]=agent;
\ No newline at end of file
+var _0x62a5=['realtime','push','handleRun','handleTimeout','squeue','timeout','bind','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','isAgentAvailable','channel','busy','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','TIMEOUT','lodash','uuid','routing','notificationId','agent'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x62a5,0x127));var _0x562a=function(_0x5cd3e1,_0x265a3b){_0x5cd3e1=_0x5cd3e1-0x0;var _0x47468a=_0x62a5[_0x5cd3e1];return _0x47468a;};'use strict';var _=require(_0x562a('0x0'));var uuid=require(_0x562a('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x562a('0x2'));var Agent=function(_0x1d1e89,_0xbc9b5d,_0x23a55f,_0x560ec0){this[_0x562a('0x3')]=uuid['v4']();this['squeue']=_0x1d1e89;this[_0x562a('0x4')]=_0xbc9b5d;this[_0x562a('0x5')]=_0x23a55f;this[_0x562a('0x2')]=_0x560ec0;this['squeue'][_0x562a('0x6')](this[_0x562a('0x7')]['bind'](this),this[_0x562a('0x8')]['bind'](this));this[_0x562a('0x9')]['on'](_0x562a('0xa'),this['handleTimeout'][_0x562a('0xb')](this));this[_0x562a('0x9')]['on'](_0x562a('0xc'),this[_0x562a('0xd')][_0x562a('0xb')](this));};Agent[_0x562a('0xe')]['push']=function(){this['squeue']['push'](this[_0x562a('0x7')][_0x562a('0xb')](this),this[_0x562a('0x8')]['bind'](this));};Agent[_0x562a('0xe')][_0x562a('0xd')]=function(){this[_0x562a('0x8')](!![]);};Agent[_0x562a('0xe')]['handleRun']=function(_0x2786d7){logger[_0x562a('0xf')](_0x562a('0x10'),this['squeue']['id'],this[_0x562a('0x4')]['id']);if(_[_0x562a('0x11')](this[_0x562a('0x5')][_0x562a('0x12')][this[_0x562a('0x4')]['id']])){logger[_0x562a('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x562a('0x9')]['id'],this['agent']['id']);setTimeout(this[_0x562a('0x6')][_0x562a('0xb')](this),0x3e8);}else{if(this[_0x562a('0x2')]['forcedOwnership']||util[_0x562a('0x13')](this[_0x562a('0x9')]['id'],this[_0x562a('0x5')]['agents'][this[_0x562a('0x4')]['id']],this[_0x562a('0x9')][_0x562a('0x14')],![])){this[_0x562a('0x5')][_0x562a('0x12')][this[_0x562a('0x4')]['id']][_0x562a('0x15')]=!![];this[_0x562a('0x5')][_0x562a('0x12')][this[_0x562a('0x4')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0x562a('0x3')],this['squeue']['id'],this[_0x562a('0x5')][_0x562a('0x12')][this[_0x562a('0x4')]['id']],null,this[_0x562a('0x2')]);util[_0x562a('0x16')](this[_0x562a('0x9')]['id'],this[_0x562a('0x5')][_0x562a('0x12')][this['agent']['id']],_0x562a('0x17')+(this[_0x562a('0x2')][_0x562a('0x18')]?_0x562a('0x19'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x562a('0x9')]['id'],this[_0x562a('0x4')]['id']);setTimeout(this['push'][_0x562a('0xb')](this),0x3e8);}}};Agent[_0x562a('0xe')][_0x562a('0x8')]=function(_0x3dbada){if(_[_0x562a('0x11')](this['realtime'][_0x562a('0x12')][this[_0x562a('0x4')]['id']])){return logger[_0x562a('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x562a('0x4')]['id']);}else{logger[_0x562a('0xf')](_0x562a('0x1a'),this['squeue']['id'],this[_0x562a('0x4')]['id']);util[_0x562a('0x1b')](this[_0x562a('0x3')],this[_0x562a('0x9')]['id'],this[_0x562a('0x5')]['agents'][this[_0x562a('0x4')]['id']],null,this['routing']);this['realtime'][_0x562a('0x12')][this[_0x562a('0x4')]['id']][_0x562a('0x15')]=![];this['realtime'][_0x562a('0x12')][this[_0x562a('0x4')]['id']][_0x562a('0x1c')]=undefined;util[_0x562a('0x16')](this[_0x562a('0x9')]['id'],this['realtime']['agents'][this[_0x562a('0x4')]['id']],_0x3dbada?'STOP':_0x562a('0x1d'));}if(!_0x3dbada){setTimeout(this[_0x562a('0x6')]['bind'](this),0x3e8);}};function agent(_0x382012,_0x3f26ea,_0x378121,_0x1a0066){return new Agent(_0x382012,_0x3f26ea,_0x378121,_0x1a0066);}module['exports']=agent;
\ No newline at end of file
index ce00772..155ad7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7800=['handleTimeout','bind','drained','handleDrained','prototype','Agents','length','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','RINGING','busy','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','busyQueue','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun'];(function(_0xf40305,_0x40b986){var _0x403701=function(_0x1da13f){while(--_0x1da13f){_0xf40305['push'](_0xf40305['shift']());}};_0x403701(++_0x40b986);}(_0x7800,0x156));var _0x0780=function(_0x50d7bf,_0x217a52){_0x50d7bf=_0x50d7bf-0x0;var _0x5eeea5=_0x7800[_0x50d7bf];return _0x5eeea5;};'use strict';var _=require(_0x0780('0x0'));var uuid=require(_0x0780('0x1'));var util=require('./util');var logger=require(_0x0780('0x2'))(_0x0780('0x3'));var Beepall=function(_0x1f9c57,_0x5799be,_0x1e2708,_0x10dce0){this[_0x0780('0x4')]=uuid['v4']();this[_0x0780('0x5')]=_0x1f9c57;this[_0x0780('0x6')]=_0x5799be;this[_0x0780('0x7')]=_0x1e2708;this['routing']=_0x10dce0;this[_0x0780('0x5')][_0x0780('0x8')](this[_0x0780('0x9')]['bind'](this),this[_0x0780('0xa')][_0x0780('0xb')](this));this['squeue']['on']('timeout',this['handleTimeout']['bind'](this));this[_0x0780('0x5')]['on'](_0x0780('0xc'),this[_0x0780('0xd')][_0x0780('0xb')](this));};Beepall[_0x0780('0xe')]['push']=function(){this[_0x0780('0x5')][_0x0780('0x8')](this['handleRun'][_0x0780('0xb')](this),this[_0x0780('0xa')][_0x0780('0xb')](this));};Beepall[_0x0780('0xe')][_0x0780('0xd')]=function(_0x48c6d9){this['handleTimeout'](!![]);};Beepall[_0x0780('0xe')]['handleRun']=function(_0x25344c){var _0x567ed4=!![];if(!_['isNil'](this['queue'])&&!_['isNil'](this[_0x0780('0x6')][_0x0780('0xf')])&&this[_0x0780('0x6')][_0x0780('0xf')][_0x0780('0x10')]>0x0){for(var _0x19916f=0x0,_0x4f6d2e;_0x19916f<this[_0x0780('0x6')][_0x0780('0xf')][_0x0780('0x10')];_0x19916f+=0x1){_0x4f6d2e=this['queue'][_0x0780('0xf')][_0x19916f]['id'];if(_[_0x0780('0x11')](this[_0x0780('0x7')]['agents'][_0x4f6d2e])){logger['info'](_0x0780('0x12'),this[_0x0780('0x5')]['id'],_0x4f6d2e);}else{if(util[_0x0780('0x13')](this[_0x0780('0x5')]['id'],this[_0x0780('0x7')][_0x0780('0x14')][_0x4f6d2e],this[_0x0780('0x5')][_0x0780('0x15')],!![])){_0x567ed4=![];util['writeLog'](this['squeue']['id'],this[_0x0780('0x7')][_0x0780('0x14')][_0x4f6d2e],_0x0780('0x16'));this[_0x0780('0x7')][_0x0780('0x14')][_0x4f6d2e][_0x0780('0x17')]=!![];this[_0x0780('0x7')][_0x0780('0x14')][_0x4f6d2e]['busyQueue']=this[_0x0780('0x6')][_0x0780('0x18')];util[_0x0780('0x19')](this[_0x0780('0x4')],this['squeue']['id'],this[_0x0780('0x7')][_0x0780('0x14')][_0x4f6d2e],this[_0x0780('0x6')],this[_0x0780('0x3')]);}}}if(_0x567ed4){logger[_0x0780('0x1a')](_0x0780('0x1b'),this[_0x0780('0x5')]['id']);setTimeout(this[_0x0780('0x8')][_0x0780('0xb')](this),0x3e8);}}else{logger[_0x0780('0x1a')]('[%s][QUEUE]\x20EMPTY',this[_0x0780('0x5')]['id']);setTimeout(this[_0x0780('0x8')][_0x0780('0xb')](this),0x3e8);}};Beepall['prototype'][_0x0780('0xa')]=function(_0x238f1d){if(!_[_0x0780('0x11')](this[_0x0780('0x6')])&&!_[_0x0780('0x11')](this[_0x0780('0x6')]['Agents'])){for(var _0x346848=0x0,_0x5f4894;_0x346848<this[_0x0780('0x6')][_0x0780('0xf')][_0x0780('0x10')];_0x346848+=0x1){_0x5f4894=this[_0x0780('0x6')]['Agents'][_0x346848]['id'];if(_[_0x0780('0x11')](this[_0x0780('0x7')]['agents'][_0x5f4894])){logger[_0x0780('0x1a')](_0x0780('0x12'),this[_0x0780('0x5')]['id'],_0x5f4894);}else{util[_0x0780('0x1c')](this['notificationId'],this[_0x0780('0x5')]['id'],this[_0x0780('0x7')]['agents'][_0x5f4894],this[_0x0780('0x6')],this[_0x0780('0x3')]);util['writeLog'](this[_0x0780('0x5')]['id'],this[_0x0780('0x7')][_0x0780('0x14')][_0x5f4894],_0x238f1d?_0x0780('0x1d'):_0x0780('0x1e'));this[_0x0780('0x7')][_0x0780('0x14')][_0x5f4894]['busy']=![];this['realtime']['agents'][_0x5f4894][_0x0780('0x1f')]=undefined;}}}if(!_0x238f1d){setTimeout(this['push']['bind'](this),0x3e8);}};function beepall(_0x277736,_0x56baa3,_0x5f036d,_0x5238d8){return new Beepall(_0x277736,_0x56baa3,_0x5f036d,_0x5238d8);}module['exports']=beepall;
\ No newline at end of file
+var _0x99cb=['exports','lodash','uuid','./util','routing','notificationId','squeue','queue','realtime','bind','handleTimeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','push','hideNotification','STOP','TIMEOUT','busy'];(function(_0x165cbe,_0x267c13){var _0x734bfc=function(_0x421ecb){while(--_0x421ecb){_0x165cbe['push'](_0x165cbe['shift']());}};_0x734bfc(++_0x267c13);}(_0x99cb,0xa6));var _0xb99c=function(_0x23cc83,_0x5a1a1e){_0x23cc83=_0x23cc83-0x0;var _0x5b1b11=_0x99cb[_0x23cc83];return _0x5b1b11;};'use strict';var _=require(_0xb99c('0x0'));var uuid=require(_0xb99c('0x1'));var util=require(_0xb99c('0x2'));var logger=require('../../../../../config/logger')(_0xb99c('0x3'));var Beepall=function(_0x5d53ac,_0x3a0c6a,_0x1fe886,_0x1a36a0){this[_0xb99c('0x4')]=uuid['v4']();this[_0xb99c('0x5')]=_0x5d53ac;this[_0xb99c('0x6')]=_0x3a0c6a;this[_0xb99c('0x7')]=_0x1fe886;this[_0xb99c('0x3')]=_0x1a36a0;this[_0xb99c('0x5')]['push'](this['handleRun'][_0xb99c('0x8')](this),this[_0xb99c('0x9')]['bind'](this));this[_0xb99c('0x5')]['on']('timeout',this['handleTimeout'][_0xb99c('0x8')](this));this[_0xb99c('0x5')]['on'](_0xb99c('0xa'),this[_0xb99c('0xb')][_0xb99c('0x8')](this));};Beepall[_0xb99c('0xc')]['push']=function(){this[_0xb99c('0x5')]['push'](this[_0xb99c('0xd')]['bind'](this),this[_0xb99c('0x9')][_0xb99c('0x8')](this));};Beepall[_0xb99c('0xc')][_0xb99c('0xb')]=function(_0xc0e2c){this[_0xb99c('0x9')](!![]);};Beepall[_0xb99c('0xc')]['handleRun']=function(_0x297448){var _0x349c7a=!![];if(!_[_0xb99c('0xe')](this[_0xb99c('0x6')])&&!_[_0xb99c('0xe')](this[_0xb99c('0x6')]['Agents'])&&this['queue'][_0xb99c('0xf')][_0xb99c('0x10')]>0x0){for(var _0x15a160=0x0,_0x338591;_0x15a160<this[_0xb99c('0x6')]['Agents'][_0xb99c('0x10')];_0x15a160+=0x1){_0x338591=this['queue'][_0xb99c('0xf')][_0x15a160]['id'];if(_[_0xb99c('0xe')](this['realtime'][_0xb99c('0x11')][_0x338591])){logger[_0xb99c('0x12')](_0xb99c('0x13'),this[_0xb99c('0x5')]['id'],_0x338591);}else{if(util['isAgentAvailable'](this[_0xb99c('0x5')]['id'],this['realtime']['agents'][_0x338591],this[_0xb99c('0x5')][_0xb99c('0x14')],!![])){_0x349c7a=![];util[_0xb99c('0x15')](this['squeue']['id'],this[_0xb99c('0x7')][_0xb99c('0x11')][_0x338591],_0xb99c('0x16'));this[_0xb99c('0x7')][_0xb99c('0x11')][_0x338591]['busy']=!![];this[_0xb99c('0x7')][_0xb99c('0x11')][_0x338591][_0xb99c('0x17')]=this['queue'][_0xb99c('0x18')];util[_0xb99c('0x19')](this[_0xb99c('0x4')],this[_0xb99c('0x5')]['id'],this[_0xb99c('0x7')]['agents'][_0x338591],this[_0xb99c('0x6')],this[_0xb99c('0x3')]);}}}if(_0x349c7a){logger[_0xb99c('0x12')](_0xb99c('0x1a'),this[_0xb99c('0x5')]['id']);setTimeout(this[_0xb99c('0x1b')]['bind'](this),0x3e8);}}else{logger[_0xb99c('0x12')]('[%s][QUEUE]\x20EMPTY',this['squeue']['id']);setTimeout(this[_0xb99c('0x1b')][_0xb99c('0x8')](this),0x3e8);}};Beepall[_0xb99c('0xc')]['handleTimeout']=function(_0xbb8838){if(!_[_0xb99c('0xe')](this[_0xb99c('0x6')])&&!_[_0xb99c('0xe')](this[_0xb99c('0x6')]['Agents'])){for(var _0x4b3464=0x0,_0x475f19;_0x4b3464<this[_0xb99c('0x6')][_0xb99c('0xf')]['length'];_0x4b3464+=0x1){_0x475f19=this[_0xb99c('0x6')]['Agents'][_0x4b3464]['id'];if(_[_0xb99c('0xe')](this['realtime']['agents'][_0x475f19])){logger[_0xb99c('0x12')](_0xb99c('0x13'),this[_0xb99c('0x5')]['id'],_0x475f19);}else{util[_0xb99c('0x1c')](this['notificationId'],this[_0xb99c('0x5')]['id'],this[_0xb99c('0x7')][_0xb99c('0x11')][_0x475f19],this['queue'],this[_0xb99c('0x3')]);util[_0xb99c('0x15')](this[_0xb99c('0x5')]['id'],this[_0xb99c('0x7')][_0xb99c('0x11')][_0x475f19],_0xbb8838?_0xb99c('0x1d'):_0xb99c('0x1e'));this[_0xb99c('0x7')][_0xb99c('0x11')][_0x475f19][_0xb99c('0x1f')]=![];this[_0xb99c('0x7')][_0xb99c('0x11')][_0x475f19][_0xb99c('0x17')]=undefined;}}}if(!_0xbb8838){setTimeout(this[_0xb99c('0x1b')][_0xb99c('0x8')](this),0x3e8);}};function beepall(_0x3639de,_0x379e81,_0x1817cc,_0x570d32){return new Beepall(_0x3639de,_0x379e81,_0x1817cc,_0x570d32);}module[_0xb99c('0x20')]=beepall;
\ No newline at end of file
index 8beeab3..6af4224 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe574=['./agent','exports','./beepall'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xe574,0x100));var _0x4e57=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe574[_0x42cae2];return _0x5f256f;};'use strict';module[_0x4e57('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x4e57('0x1')),'agent':require(_0x4e57('0x2'))};
\ No newline at end of file
+var _0xf69d=['./rrmemory','./beepall','./agent','exports'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xf69d,0xd3));var _0xdf69=function(_0x5b9fad,_0x8a0f7f){_0x5b9fad=_0x5b9fad-0x0;var _0x54a484=_0xf69d[_0x5b9fad];return _0x54a484;};'use strict';module[_0xdf69('0x0')]={'rrmemory':require(_0xdf69('0x1')),'beepall':require(_0xdf69('0x2')),'agent':require(_0xdf69('0x3'))};
\ No newline at end of file
index 2c34cbd..d079378 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb975=['[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','intervals','push','handleTimeout','bind','module','squeue','drained','handleDrained','prototype','handleRun','handleCheckReject','realtime','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','done','queue','mapAgentsId','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','showNotification','writeLog'];(function(_0x4ff25b,_0x31aad2){var _0x4bcaee=function(_0x58237f){while(--_0x58237f){_0x4ff25b['push'](_0x4ff25b['shift']());}};_0x4bcaee(++_0x31aad2);}(_0xb975,0x74));var _0x5b97=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xb975[_0x3ba924];return _0x4cc1df;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x5b97('0x0'));var util=require(_0x5b97('0x1'));var logger=require(_0x5b97('0x2'))(_0x5b97('0x3'));var RRMemory=function(_0x1eea17,_0x5068d2,_0x5b3f47,_0x3359f6){this[_0x5b97('0x4')]=uuid['v4']();this['squeue']=_0x1eea17;this['queue']=_0x5068d2;this['realtime']=_0x5b3f47;this['routing']=_0x3359f6;this[_0x5b97('0x5')]={};this['squeue'][_0x5b97('0x6')](this['handleRun']['bind'](this),this[_0x5b97('0x7')][_0x5b97('0x8')](this),this[_0x5b97('0x9')]);this['squeue']['on']('timeout',this['handleTimeout']['bind'](this));this[_0x5b97('0xa')]['on'](_0x5b97('0xb'),this[_0x5b97('0xc')][_0x5b97('0x8')](this));};RRMemory[_0x5b97('0xd')][_0x5b97('0x6')]=function(){this[_0x5b97('0xa')][_0x5b97('0x6')](this[_0x5b97('0xe')][_0x5b97('0x8')](this),this['handleTimeout'][_0x5b97('0x8')](this));};RRMemory['prototype'][_0x5b97('0xc')]=function(_0x4915c9){this[_0x5b97('0x7')](!![]);};RRMemory[_0x5b97('0xd')][_0x5b97('0xf')]=function(_0x1f6e30){if(util['isAgentAvailable'](this[_0x5b97('0xa')]['id'],this[_0x5b97('0x10')][_0x5b97('0x11')][this[_0x5b97('0x12')]],this[_0x5b97('0xa')][_0x5b97('0x13')],!![])){logger[_0x5b97('0x14')](_0x5b97('0x15'),this[_0x5b97('0xa')]['id'],this['agentId']);clearInterval(this[_0x5b97('0x5')][this[_0x5b97('0x12')]]);_0x1f6e30[_0x5b97('0x16')]();setTimeout(this['push'][_0x5b97('0x8')](this),0x3e8);}};RRMemory[_0x5b97('0xd')][_0x5b97('0xe')]=function(_0x1e3ad2){this[_0x5b97('0x12')]=rr(this[_0x5b97('0x17')][_0x5b97('0x18')]);logger[_0x5b97('0x14')]('[%s][QUEUE]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x5b97('0x12')]);if(_[_0x5b97('0x19')](this[_0x5b97('0x10')][_0x5b97('0x11')][this[_0x5b97('0x12')]])){logger[_0x5b97('0x14')](_0x5b97('0x1a'),this[_0x5b97('0xa')]['id'],this[_0x5b97('0x12')]);_0x1e3ad2[_0x5b97('0x16')]();setTimeout(this[_0x5b97('0x6')][_0x5b97('0x8')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x5b97('0xa')]['id'],this[_0x5b97('0x10')]['agents'][this[_0x5b97('0x12')]],this['squeue'][_0x5b97('0x13')],!![])){this[_0x5b97('0x10')][_0x5b97('0x11')][this[_0x5b97('0x12')]][_0x5b97('0x1b')]=!![];this[_0x5b97('0x10')][_0x5b97('0x11')][this[_0x5b97('0x12')]][_0x5b97('0x1c')]=this['queue'][_0x5b97('0x1d')];util[_0x5b97('0x1e')](this['notificationId'],this[_0x5b97('0xa')]['id'],this['realtime'][_0x5b97('0x11')][this['agentId']],this['queue'],this[_0x5b97('0x3')]);util[_0x5b97('0x1f')](this[_0x5b97('0xa')]['id'],this[_0x5b97('0x10')][_0x5b97('0x11')][this[_0x5b97('0x12')]],'RINGING');this[_0x5b97('0x5')][this[_0x5b97('0x12')]]=setInterval(this[_0x5b97('0xf')][_0x5b97('0x8')](this,_0x1e3ad2),0x3e8);}else{logger['info'](_0x5b97('0x20'),this['squeue']['id'],this[_0x5b97('0x12')]);_0x1e3ad2['done']();setTimeout(this[_0x5b97('0x6')][_0x5b97('0x8')](this),0x3e8);}}};RRMemory[_0x5b97('0xd')][_0x5b97('0x7')]=function(_0x57906d){logger[_0x5b97('0x14')](_0x5b97('0x21'),this[_0x5b97('0xa')]['id'],this['agentId']);if(_['isNil'](this[_0x5b97('0x10')][_0x5b97('0x11')][this['agentId']])){logger[_0x5b97('0x14')](_0x5b97('0x1a'),this[_0x5b97('0xa')]['id'],this[_0x5b97('0x12')]);}else{clearInterval(this[_0x5b97('0x5')][this[_0x5b97('0x12')]]);util[_0x5b97('0x22')](this[_0x5b97('0x4')],this[_0x5b97('0xa')]['id'],this['realtime']['agents'][this[_0x5b97('0x12')]],this[_0x5b97('0x17')],this[_0x5b97('0x3')]);util[_0x5b97('0x1f')](this[_0x5b97('0xa')]['id'],this[_0x5b97('0x10')][_0x5b97('0x11')][this['agentId']],_0x5b97('0x23'));this['realtime'][_0x5b97('0x11')][this['agentId']][_0x5b97('0x1b')]=![];this[_0x5b97('0x10')][_0x5b97('0x11')][this[_0x5b97('0x12')]][_0x5b97('0x1c')]=undefined;}if(!_0x57906d){setTimeout(this[_0x5b97('0x6')][_0x5b97('0x8')](this),0x3e8);}};function rrmemory(_0x43f3fc,_0x27075f,_0x25bce7,_0x5702d6){return new RRMemory(_0x43f3fc,_0x27075f,_0x25bce7,_0x5702d6);}module[_0x5b97('0x24')]=rrmemory;
\ No newline at end of file
+var _0x6367=['[%s][QUEUE]\x20available\x20again\x20%s','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busyQueue','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','intervals','hideNotification','TIMEOUT','busy','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','handleRun','prototype','handleCheckReject','isAgentAvailable','agents','agentId','channel'];(function(_0x2820fb,_0x2cd3b5){var _0x99138f=function(_0x3b9361){while(--_0x3b9361){_0x2820fb['push'](_0x2820fb['shift']());}};_0x99138f(++_0x2cd3b5);}(_0x6367,0x170));var _0x7636=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x6367[_0x236d24];return _0x1574cf;};'use strict';var rr=require('rr');var _=require(_0x7636('0x0'));var uuid=require(_0x7636('0x1'));var util=require(_0x7636('0x2'));var logger=require(_0x7636('0x3'))(_0x7636('0x4'));var RRMemory=function(_0x506f43,_0x2d07f7,_0x13301e,_0x44f57f){this[_0x7636('0x5')]=uuid['v4']();this[_0x7636('0x6')]=_0x506f43;this[_0x7636('0x7')]=_0x2d07f7;this[_0x7636('0x8')]=_0x13301e;this[_0x7636('0x4')]=_0x44f57f;this['intervals']={};this[_0x7636('0x6')][_0x7636('0x9')](this['handleRun'][_0x7636('0xa')](this),this[_0x7636('0xb')][_0x7636('0xa')](this),this['module']);this[_0x7636('0x6')]['on'](_0x7636('0xc'),this['handleTimeout']['bind'](this));this[_0x7636('0x6')]['on'](_0x7636('0xd'),this[_0x7636('0xe')][_0x7636('0xa')](this));};RRMemory['prototype'][_0x7636('0x9')]=function(){this[_0x7636('0x6')][_0x7636('0x9')](this[_0x7636('0xf')][_0x7636('0xa')](this),this[_0x7636('0xb')][_0x7636('0xa')](this));};RRMemory['prototype'][_0x7636('0xe')]=function(_0x6b8fff){this[_0x7636('0xb')](!![]);};RRMemory[_0x7636('0x10')][_0x7636('0x11')]=function(_0x439d83){if(util[_0x7636('0x12')](this[_0x7636('0x6')]['id'],this[_0x7636('0x8')][_0x7636('0x13')][this[_0x7636('0x14')]],this['squeue'][_0x7636('0x15')],!![])){logger['info'](_0x7636('0x16'),this[_0x7636('0x6')]['id'],this[_0x7636('0x14')]);clearInterval(this['intervals'][this[_0x7636('0x14')]]);_0x439d83[_0x7636('0x17')]();setTimeout(this[_0x7636('0x9')][_0x7636('0xa')](this),0x3e8);}};RRMemory[_0x7636('0x10')][_0x7636('0xf')]=function(_0x5b7b01){this[_0x7636('0x14')]=rr(this[_0x7636('0x7')][_0x7636('0x18')]);logger['info'](_0x7636('0x19'),this[_0x7636('0x6')]['id'],this[_0x7636('0x14')]);if(_[_0x7636('0x1a')](this[_0x7636('0x8')][_0x7636('0x13')][this[_0x7636('0x14')]])){logger[_0x7636('0x1b')](_0x7636('0x1c'),this[_0x7636('0x6')]['id'],this['agentId']);_0x5b7b01['done']();setTimeout(this[_0x7636('0x9')][_0x7636('0xa')](this),0x3e8);}else{if(util[_0x7636('0x12')](this[_0x7636('0x6')]['id'],this[_0x7636('0x8')][_0x7636('0x13')][this[_0x7636('0x14')]],this[_0x7636('0x6')][_0x7636('0x15')],!![])){this['realtime'][_0x7636('0x13')][this['agentId']]['busy']=!![];this[_0x7636('0x8')]['agents'][this[_0x7636('0x14')]][_0x7636('0x1d')]=this[_0x7636('0x7')]['name'];util[_0x7636('0x1e')](this[_0x7636('0x5')],this[_0x7636('0x6')]['id'],this[_0x7636('0x8')][_0x7636('0x13')][this[_0x7636('0x14')]],this[_0x7636('0x7')],this[_0x7636('0x4')]);util[_0x7636('0x1f')](this[_0x7636('0x6')]['id'],this['realtime'][_0x7636('0x13')][this[_0x7636('0x14')]],_0x7636('0x20'));this['intervals'][this[_0x7636('0x14')]]=setInterval(this['handleCheckReject'][_0x7636('0xa')](this,_0x5b7b01),0x3e8);}else{logger['info'](_0x7636('0x21'),this[_0x7636('0x6')]['id'],this[_0x7636('0x14')]);_0x5b7b01[_0x7636('0x17')]();setTimeout(this[_0x7636('0x9')]['bind'](this),0x3e8);}}};RRMemory[_0x7636('0x10')][_0x7636('0xb')]=function(_0x27b3da){logger[_0x7636('0x1b')](_0x7636('0x22'),this[_0x7636('0x6')]['id'],this[_0x7636('0x14')]);if(_[_0x7636('0x1a')](this['realtime'][_0x7636('0x13')][this[_0x7636('0x14')]])){logger['info'](_0x7636('0x1c'),this[_0x7636('0x6')]['id'],this['agentId']);}else{clearInterval(this[_0x7636('0x23')][this[_0x7636('0x14')]]);util[_0x7636('0x24')](this[_0x7636('0x5')],this[_0x7636('0x6')]['id'],this[_0x7636('0x8')][_0x7636('0x13')][this[_0x7636('0x14')]],this[_0x7636('0x7')],this[_0x7636('0x4')]);util[_0x7636('0x1f')](this[_0x7636('0x6')]['id'],this[_0x7636('0x8')][_0x7636('0x13')][this[_0x7636('0x14')]],_0x7636('0x25'));this[_0x7636('0x8')]['agents'][this[_0x7636('0x14')]][_0x7636('0x26')]=![];this[_0x7636('0x8')][_0x7636('0x13')][this[_0x7636('0x14')]][_0x7636('0x1d')]=undefined;}if(!_0x27b3da){setTimeout(this['push'][_0x7636('0xa')](this),0x3e8);}};function rrmemory(_0x8bd040,_0xbbd88d,_0x2f8bb6,_0x4682ce){return new RRMemory(_0x8bd040,_0xbbd88d,_0x2f8bb6,_0x4682ce);}module['exports']=rrmemory;
\ No newline at end of file
index d4338d6..4e7ac69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0e8=['online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','lodash','util','mustache','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','name','emit','user:save','split','\x20interaction','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','message','user:%s','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xf0e8,0x81));var _0x8f0e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf0e8[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x8f0e('0x0'));var util=require(_0x8f0e('0x1'));var utils=require('../utils');var Mustache=require(_0x8f0e('0x2'));var Redis=require('ioredis');var config=require(_0x8f0e('0x3'));var logger=require(_0x8f0e('0x4'))('routing');config[_0x8f0e('0x5')]=_[_0x8f0e('0x6')](config[_0x8f0e('0x5')],{'host':_0x8f0e('0x7'),'port':0x18eb});var io=require(_0x8f0e('0x8'))(new Redis(config['redis']));function emit(_0x4a0ab8,_0x3d757e,_0x13ba6c){io['to'](_0x4a0ab8)['emit'](_0x3d757e,_0x13ba6c);}function sendNotification(_0x110f39,_0x2dca8a,_0x4139fe,_0x4986cd,_0x51db18,_0x11e11b){io['to'](util[_0x8f0e('0x9')]('user:%s',_0x4986cd[_0x8f0e('0xa')]))[_0x8f0e('0xb')](_0x8f0e('0xc'),_0x4986cd);var _0x1547e9=_0x11e11b||{};var _0x589980=_0x4139fe[_0x8f0e('0xd')]('.');var _0x3ee208={'uniqueid':_0x2dca8a,'channel':_0x589980[0x0],'id':_0x589980[0x1],'title':_0x589980[0x0]+_0x8f0e('0xe'),'interactionId':_0x589980[0x2],'queue':_0x51db18?_0x51db18['name']:null,'sound':_0x1547e9[_0x8f0e('0xf')]['notificationSound'],'shake':_0x1547e9[_0x8f0e('0xf')][_0x8f0e('0x10')]};try{if(!_0x1547e9['body']){_0x1547e9[_0x8f0e('0x11')]={};}if(_0x51db18){_0x1547e9[_0x8f0e('0x11')][_0x8f0e('0x12')]=_0x51db18;}else if(_0x1547e9[_0x8f0e('0x11')][_0x8f0e('0x12')]){delete _0x1547e9[_0x8f0e('0x11')]['queue'];}_0x3ee208[_0x8f0e('0x13')]=utils[_0x8f0e('0x14')](_0x1547e9['account'][_0x8f0e('0x15')],_0x1547e9);}catch(_0x19f6d2){_0x3ee208[_0x8f0e('0x13')]=_0x8f0e('0x16');logger['error'](util['format']('[%s][QUEUE]\x20%s',_0x2dca8a,_0x19f6d2[_0x8f0e('0x17')]));}io['to'](util[_0x8f0e('0x9')](_0x8f0e('0x18'),_0x4986cd[_0x8f0e('0xa')]))[_0x8f0e('0xb')](util[_0x8f0e('0x9')](_0x8f0e('0x19'),_0x110f39?_0x8f0e('0x1a'):_0x8f0e('0x1b')),_0x3ee208);}function writeLog(_0xdd2cd9,_0x270433,_0x293483){return logger['info'](util[_0x8f0e('0x9')](_0x8f0e('0x1c'),_0xdd2cd9,_0x270433[_0x8f0e('0xa')],_0x293483));}exports['isAgentAvailable']=function(_0xb7ae5c,_0x55dc37,_0x47c838,_0x2c5bc2){if(_0x55dc37[_0x8f0e('0x1d')]){writeLog(_0xb7ae5c,_0x55dc37,_0x8f0e('0x1e'));return![];}if(!_0x55dc37[_0x8f0e('0x1f')]){writeLog(_0xb7ae5c,_0x55dc37,_0x8f0e('0x20'));return![];}if(_0x55dc37[_0x47c838+_0x8f0e('0x21')]){writeLog(_0xb7ae5c,_0x55dc37,'PAUSE');return![];}if(_0x2c5bc2&&_0x55dc37[_0x8f0e('0x22')](_0x47c838+_0x8f0e('0x23'))&&_0x55dc37[_0x8f0e('0x22')](_0x47c838+_0x8f0e('0x24'))){if(_0x55dc37[_0x47c838+_0x8f0e('0x23')]>0x0&&_0x55dc37[_0x47c838+_0x8f0e('0x24')]>=_0x55dc37[_0x47c838+_0x8f0e('0x23')]){writeLog(_0xb7ae5c,_0x55dc37,_0x47c838[_0x8f0e('0x25')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x8f0e('0x26')]=function(_0x3fcd92,_0x4ff79f,_0x17b982,_0x2c7ab7,_0xb6965c){return sendNotification(!![],_0x3fcd92,_0x4ff79f,_0x17b982,_0x2c7ab7,_0xb6965c);};exports[_0x8f0e('0x27')]=function(_0x435758,_0xbb72c4,_0x2e600f,_0x396fe6,_0xcf2476){return sendNotification(![],_0x435758,_0xbb72c4,_0x2e600f,_0x396fe6,_0xcf2476);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x7c80=['info','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','Capacity','CurrentCapacity','hideNotification','writeLog','lodash','util','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','socket.io-emitter','emit','user:%s','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','name'];(function(_0x522811,_0x444a17){var _0x55d665=function(_0x3ef6b2){while(--_0x3ef6b2){_0x522811['push'](_0x522811['shift']());}};_0x55d665(++_0x444a17);}(_0x7c80,0xa4));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x07c8('0x0'));var util=require(_0x07c8('0x1'));var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x07c8('0x2'));var config=require(_0x07c8('0x3'));var logger=require(_0x07c8('0x4'))('routing');config[_0x07c8('0x5')]=_[_0x07c8('0x6')](config[_0x07c8('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x07c8('0x7'))(new Redis(config['redis']));function emit(_0x4a5354,_0x204052,_0xc0c7bf){io['to'](_0x4a5354)[_0x07c8('0x8')](_0x204052,_0xc0c7bf);}function sendNotification(_0x20dd0c,_0x359f52,_0x198a56,_0x58ae16,_0x11f91d,_0x5cc84d){io['to'](util['format'](_0x07c8('0x9'),_0x58ae16['name']))[_0x07c8('0x8')]('user:save',_0x58ae16);var _0x48ba40=_0x5cc84d||{};var _0x1ecc8c=_0x198a56[_0x07c8('0xa')]('.');var _0x2c62f5={'uniqueid':_0x359f52,'channel':_0x1ecc8c[0x0],'id':_0x1ecc8c[0x1],'title':_0x1ecc8c[0x0]+_0x07c8('0xb'),'interactionId':_0x1ecc8c[0x2],'queue':_0x11f91d?_0x11f91d['name']:null,'sound':_0x48ba40[_0x07c8('0xc')][_0x07c8('0xd')],'shake':_0x48ba40[_0x07c8('0xc')][_0x07c8('0xe')]};try{if(!_0x48ba40['body']){_0x48ba40['body']={};}if(_0x11f91d){_0x48ba40[_0x07c8('0xf')]['queue']=_0x11f91d;}else if(_0x48ba40[_0x07c8('0xf')][_0x07c8('0x10')]){delete _0x48ba40[_0x07c8('0xf')][_0x07c8('0x10')];}_0x2c62f5[_0x07c8('0x11')]=utils[_0x07c8('0x12')](_0x48ba40[_0x07c8('0xc')][_0x07c8('0x13')],_0x48ba40);}catch(_0x3ef8fb){_0x2c62f5[_0x07c8('0x11')]=_0x07c8('0x14');logger[_0x07c8('0x15')](util[_0x07c8('0x16')](_0x07c8('0x17'),_0x359f52,_0x3ef8fb[_0x07c8('0x18')]));}io['to'](util[_0x07c8('0x16')](_0x07c8('0x9'),_0x58ae16[_0x07c8('0x19')]))['emit'](util[_0x07c8('0x16')]('notification:%s',_0x20dd0c?'save':'remove'),_0x2c62f5);}function writeLog(_0xeb1372,_0x270875,_0x2750a2){return logger[_0x07c8('0x1a')](util[_0x07c8('0x16')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0xeb1372,_0x270875[_0x07c8('0x19')],_0x2750a2));}exports[_0x07c8('0x1b')]=function(_0x2fe4a4,_0x5a96d5,_0xefbb7d,_0x356d4f){if(_0x5a96d5[_0x07c8('0x1c')]){writeLog(_0x2fe4a4,_0x5a96d5,_0x07c8('0x1d'));return![];}if(!_0x5a96d5[_0x07c8('0x1e')]){writeLog(_0x2fe4a4,_0x5a96d5,_0x07c8('0x1f'));return![];}if(_0x5a96d5[_0xefbb7d+_0x07c8('0x20')]){writeLog(_0x2fe4a4,_0x5a96d5,_0x07c8('0x21'));return![];}if(_0x356d4f&&_0x5a96d5['hasOwnProperty'](_0xefbb7d+'Capacity')&&_0x5a96d5['hasOwnProperty'](_0xefbb7d+'CurrentCapacity')){if(_0x5a96d5[_0xefbb7d+_0x07c8('0x22')]>0x0&&_0x5a96d5[_0xefbb7d+_0x07c8('0x23')]>=_0x5a96d5[_0xefbb7d+_0x07c8('0x22')]){writeLog(_0x2fe4a4,_0x5a96d5,_0xefbb7d['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x13086a,_0x694f82,_0x5faab8,_0x6dbc13,_0x129455){return sendNotification(!![],_0x13086a,_0x694f82,_0x5faab8,_0x6dbc13,_0x129455);};exports[_0x07c8('0x24')]=function(_0x1ff6b9,_0x5b93c5,_0x2e317d,_0x5cf4b3,_0xd851e0){return sendNotification(![],_0x1ff6b9,_0x5b93c5,_0x2e317d,_0x5cf4b3,_0xd851e0);};exports[_0x07c8('0x25')]=writeLog;
\ No newline at end of file
index 09a4e0c..c177113 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf90a=['isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','error','isObject','stringify','validate','shelljs','lodash','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace'];(function(_0x498bb8,_0x44fbe5){var _0x230fde=function(_0x1d4a5b){while(--_0x1d4a5b){_0x498bb8['push'](_0x498bb8['shift']());}};_0x230fde(++_0x44fbe5);}(_0xf90a,0x1ee));var _0xaf90=function(_0x321b1a,_0x5dfdef){_0x321b1a=_0x321b1a-0x0;var _0x5eaf99=_0xf90a[_0x321b1a];return _0x5eaf99;};'use strict';var schema=require(_0xaf90('0x0'));var sh=require(_0xaf90('0x1'));var _=require(_0xaf90('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0xaf90('0x3'),'required':!![],'message':_0xaf90('0x4')}});exports[_0xaf90('0x5')]=function(_0xd7d042,_0x36d51a){return function(_0x43adc4){try{var _0x424dea={'command':_0x36d51a[0x0]};var _0x45f61a=system[_0xaf90('0x0')](_0x424dea,{'typecast':!![]});if(_0x45f61a[_0xaf90('0x6')]){logger['error'](_0xaf90('0x7'),_0xd7d042,_[_0xaf90('0x8')](_0x45f61a,_0xaf90('0x9'))[_0xaf90('0xa')](',\x20'));logger['info'](_0xaf90('0xb'),_0xd7d042);_0x43adc4[_0xaf90('0xc')]();}else{var _0x447d39=this;var _0x2fe3a2=utils['getMustacheRender'](_0x36d51a[0x0],this);logger[_0xaf90('0xd')](_0xaf90('0xe'),_0xd7d042,_0x2fe3a2);sh[_0xaf90('0xf')](_[_0xaf90('0x10')](_0x2fe3a2),function(_0x12da6a,_0xf92f4){logger[_0xaf90('0xd')](_0xaf90('0x11'),_0xd7d042,_0x12da6a);if(_0x12da6a==0x0){var _0x15d21e=_0xf92f4[_0xaf90('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xaf90('0x13')](_0x36d51a[0x1])||_[_0xaf90('0x14')](_0x36d51a[0x1])){logger[_0xaf90('0xd')](_0xaf90('0x15'),_0xd7d042);_0x447d39['body'][_0x36d51a[0x1]]=_0x15d21e;}else{logger[_0xaf90('0xd')](_0xaf90('0x16'),_0xd7d042,_0x36d51a[0x1],_0x15d21e);_0x447d39[_0xaf90('0x17')][_0x36d51a[0x1]]=_0x15d21e;}}_0x43adc4[_0xaf90('0xc')]();});}}catch(_0x426c21){logger[_0xaf90('0x18')](_0xaf90('0x7'),_0xd7d042,_[_0xaf90('0x19')](_0x426c21)?JSON[_0xaf90('0x1a')](_0x426c21):_0x426c21);logger[_0xaf90('0xd')](_0xaf90('0xb'),_0xd7d042);_0x43adc4[_0xaf90('0xc')]();}};};
\ No newline at end of file
+var _0x8331=['next','stringify','shelljs','lodash','routing','string','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body'];(function(_0x3ba527,_0x446a5e){var _0x5ee6ad=function(_0x5978c7){while(--_0x5978c7){_0x3ba527['push'](_0x3ba527['shift']());}};_0x5ee6ad(++_0x446a5e);}(_0x8331,0x16a));var _0x1833=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x8331[_0x3c4a7c];return _0xf13d1e;};'use strict';var schema=require('validate');var sh=require(_0x1833('0x0'));var _=require(_0x1833('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x1833('0x2'));var system=schema({'command':{'type':_0x1833('0x3'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x1833('0x4')]=function(_0x132853,_0x2ef9f2){return function(_0x69f664){try{var _0x1cb964={'command':_0x2ef9f2[0x0]};var _0x45e2cd=system[_0x1833('0x5')](_0x1cb964,{'typecast':!![]});if(_0x45e2cd[_0x1833('0x6')]){logger[_0x1833('0x7')](_0x1833('0x8'),_0x132853,_[_0x1833('0x9')](_0x45e2cd,_0x1833('0xa'))[_0x1833('0xb')](',\x20'));logger[_0x1833('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x132853);_0x69f664['next']();}else{var _0x53e6ed=this;var _0x125fde=utils[_0x1833('0xd')](_0x2ef9f2[0x0],this);logger[_0x1833('0xc')](_0x1833('0xe'),_0x132853,_0x125fde);sh[_0x1833('0xf')](_[_0x1833('0x10')](_0x125fde),function(_0x386885,_0x2458d1){logger[_0x1833('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x132853,_0x386885);if(_0x386885==0x0){var _0x3e7f76=_0x2458d1[_0x1833('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x1833('0x12')](_0x2ef9f2[0x1])||_['isEmpty'](_0x2ef9f2[0x1])){logger[_0x1833('0xc')](_0x1833('0x13'),_0x132853);_0x53e6ed['body'][_0x2ef9f2[0x1]]=_0x3e7f76;}else{logger['info'](_0x1833('0x14'),_0x132853,_0x2ef9f2[0x1],_0x3e7f76);_0x53e6ed[_0x1833('0x15')][_0x2ef9f2[0x1]]=_0x3e7f76;}}_0x69f664[_0x1833('0x16')]();});}}catch(_0x367b46){logger[_0x1833('0x7')](_0x1833('0x8'),_0x132853,_['isObject'](_0x367b46)?JSON[_0x1833('0x17')](_0x367b46):_0x367b46);logger[_0x1833('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x132853);_0x69f664[_0x1833('0x16')]();}};};
\ No newline at end of file
index 6a0e5eb..670c223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7590=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','number','consequence','length','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','interaction','catch','error','stringify','finally','isObject','validate'];(function(_0x16a5f3,_0x57fddc){var _0x184742=function(_0x4efd0e){while(--_0x4efd0e){_0x16a5f3['push'](_0x16a5f3['shift']());}};_0x184742(++_0x57fddc);}(_0x7590,0x12a));var _0x0759=function(_0x864853,_0x1b7287){_0x864853=_0x864853-0x0;var _0x2d1509=_0x7590[_0x864853];return _0x2d1509;};'use strict';var schema=require(_0x0759('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x0759('0x1')),'openchannelInteraction':require(_0x0759('0x2')),'smsInteraction':require(_0x0759('0x3')),'mailInteraction':require(_0x0759('0x4')),'faxInteraction':require(_0x0759('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x0759('0x6'));var tag=schema({'tag':{'type':_0x0759('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x0759('0x8')]=function(_0x50c54e,_0x55ce36,_0x5aad13,_0x393331){return function(_0x4b49df){try{var _0x2168d0={'tag':_0x55ce36[0x0]};var _0x477073=tag[_0x0759('0x0')](_0x2168d0,{'typecast':!![]});if(_0x477073[_0x0759('0x9')]){logger['error'](_0x0759('0xa'),_0x50c54e,_['map'](_0x477073,'message')[_0x0759('0xb')](',\x20'));logger[_0x0759('0xc')](_0x0759('0xd'),_0x50c54e);_0x4b49df[_0x0759('0xe')]();}else{var _0x1117de={'ids':[_0x55ce36[0x0]]};if(rpc[_0x393331['channel']+_0x0759('0xf')]){rpc[_0x393331[_0x0759('0x10')]+_0x0759('0xf')]['addTags'](_0x393331[_0x0759('0x11')]['id'],_0x1117de)['then'](function(_0x5af21a){logger[_0x0759('0xc')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x50c54e,_0x55ce36[0x1],_0x393331['channel'],_0x393331[_0x0759('0x11')]['id']);})[_0x0759('0x12')](function(_0x259382){logger[_0x0759('0x13')]('[%s][TAG]\x20%s',_0x50c54e,JSON[_0x0759('0x14')](_0x259382));logger['info'](_0x0759('0xd'),_0x50c54e);})[_0x0759('0x15')](function(){_0x4b49df[_0x0759('0xe')]();});}}}catch(_0x15d2e7){logger[_0x0759('0x13')](_0x0759('0xa'),_0x50c54e,_[_0x0759('0x16')](_0x15d2e7)?JSON[_0x0759('0x14')](_0x15d2e7):_0x15d2e7);logger[_0x0759('0xc')](_0x0759('0xd'),_0x50c54e);_0x4b49df[_0x0759('0xe')]();}};};
\ No newline at end of file
+var _0x5aea=['error','[%s][TAG]\x20%s','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','interaction','catch','stringify','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','number','consequence','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5aea,0x18e));var _0xa5ae=function(_0x5f43d6,_0x25b98d){_0x5f43d6=_0x5f43d6-0x0;var _0x431701=_0x5aea[_0x5f43d6];return _0x431701;};'use strict';var schema=require(_0xa5ae('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xa5ae('0x1')),'openchannelInteraction':require(_0xa5ae('0x2')),'smsInteraction':require(_0xa5ae('0x3')),'mailInteraction':require(_0xa5ae('0x4')),'faxInteraction':require(_0xa5ae('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0xa5ae('0x6'));var tag=schema({'tag':{'type':_0xa5ae('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xa5ae('0x8')]=function(_0x561555,_0x2de454,_0x311f83,_0x360030){return function(_0x1dcbcd){try{var _0x3fa7d4={'tag':_0x2de454[0x0]};var _0x5aed9d=tag['validate'](_0x3fa7d4,{'typecast':!![]});if(_0x5aed9d[_0xa5ae('0x9')]){logger[_0xa5ae('0xa')](_0xa5ae('0xb'),_0x561555,_[_0xa5ae('0xc')](_0x5aed9d,'message')['join'](',\x20'));logger[_0xa5ae('0xd')](_0xa5ae('0xe'),_0x561555);_0x1dcbcd[_0xa5ae('0xf')]();}else{var _0x4dc026={'ids':[_0x2de454[0x0]]};if(rpc[_0x360030[_0xa5ae('0x10')]+_0xa5ae('0x11')]){rpc[_0x360030[_0xa5ae('0x10')]+_0xa5ae('0x11')][_0xa5ae('0x12')](_0x360030['interaction']['id'],_0x4dc026)[_0xa5ae('0x13')](function(_0x4a5ec5){logger[_0xa5ae('0xd')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x561555,_0x2de454[0x1],_0x360030[_0xa5ae('0x10')],_0x360030[_0xa5ae('0x14')]['id']);})[_0xa5ae('0x15')](function(_0x291e19){logger['error'](_0xa5ae('0xb'),_0x561555,JSON[_0xa5ae('0x16')](_0x291e19));logger[_0xa5ae('0xd')](_0xa5ae('0xe'),_0x561555);})['finally'](function(){_0x1dcbcd[_0xa5ae('0xf')]();});}}}catch(_0x2b31a6){logger['error'](_0xa5ae('0xb'),_0x561555,_[_0xa5ae('0x17')](_0x2b31a6)?JSON[_0xa5ae('0x16')](_0x2b31a6):_0x2b31a6);logger[_0xa5ae('0xd')](_0xa5ae('0xe'),_0x561555);_0x1dcbcd[_0xa5ae('0xf')]();}};};
\ No newline at end of file
index c741b46..12cb0c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd240=['lodash','render','merge','body','contact','message','list'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xd240,0x1c7));var _0x0d24=function(_0x8b083b,_0x5b85e9){_0x8b083b=_0x8b083b-0x0;var _0x56639d=_0xd240[_0x8b083b];return _0x56639d;};'use strict';var Mustache=require('mustache');var _=require(_0x0d24('0x0'));module['exports']={'getMustacheRender':function(_0x5afecc,_0x1c5100){return Mustache[_0x0d24('0x1')](_0x5afecc,_[_0x0d24('0x2')](_0x1c5100[_0x0d24('0x3')],{'contact':_0x1c5100[_0x0d24('0x4')],'message':_0x1c5100[_0x0d24('0x5')],'account':_0x1c5100['account'],'interaction':_0x1c5100['interaction'],'list':_0x1c5100[_0x0d24('0x6')]}))||'';}};
\ No newline at end of file
+var _0x1bb2=['contact','message','account','interaction','list','lodash','exports','merge','body'];(function(_0x5c6319,_0x305706){var _0x4bbf66=function(_0x305625){while(--_0x305625){_0x5c6319['push'](_0x5c6319['shift']());}};_0x4bbf66(++_0x305706);}(_0x1bb2,0x152));var _0x21bb=function(_0x5292fc,_0x325502){_0x5292fc=_0x5292fc-0x0;var _0x583038=_0x1bb2[_0x5292fc];return _0x583038;};'use strict';var Mustache=require('mustache');var _=require(_0x21bb('0x0'));module[_0x21bb('0x1')]={'getMustacheRender':function(_0x29a202,_0x480fcb){return Mustache['render'](_0x29a202,_[_0x21bb('0x2')](_0x480fcb[_0x21bb('0x3')],{'contact':_0x480fcb[_0x21bb('0x4')],'message':_0x480fcb[_0x21bb('0x5')],'account':_0x480fcb[_0x21bb('0x6')],'interaction':_0x480fcb[_0x21bb('0x7')],'list':_0x480fcb[_0x21bb('0x8')]}))||'';}};
\ No newline at end of file
index 3c93d0b..5f33601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe700=['push','slice','dialogflow','amazonlex','message','tag','TagId','format','%s:%s:%s','condition','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','info','Applications\x20executed','matchPath','No\x20applications\x20to\x20execute','stack','end','QueueReport','update','message\x20is\x20empty','agent','agents','busy','busyQueue','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split'];(function(_0x12ab9c,_0x1ad557){var _0x2a3e39=function(_0x5f0653){while(--_0x5f0653){_0x12ab9c['push'](_0x12ab9c['shift']());}};_0x2a3e39(++_0x1ad557);}(_0xe700,0xf9));var _0x0e70=function(_0x1d8eef,_0x3e11e9){_0x1d8eef=_0x1d8eef-0x0;var _0x524a1c=_0xe700[_0x1d8eef];return _0x524a1c;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x0e70('0x2'));var BPromise=require(_0x0e70('0x3'));var uuid=require('uuid');var config=require(_0x0e70('0x4'));var logger=require(_0x0e70('0x5'))(_0x0e70('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x0e70('0x7')),'chatQueueReport':require(_0x0e70('0x8')),'smsQueueReport':require(_0x0e70('0x9')),'faxQueueReport':require(_0x0e70('0xa')),'whatsappQueueReport':require(_0x0e70('0xb'))};var RuleEngine=require(_0x0e70('0xc'));function getId(_0x4a6227,_0x17093d,_0x1fc270){return util['format'](_0x0e70('0xd'),_0x4a6227,_0x17093d||0x0,_0x1fc270||0x0);}function getIntervals(_0x4f4c76,_0x5c162d){var _0x426aa2=[];if(!_[_0x0e70('0xe')](_0x5c162d[_0x0e70('0xf')])&&!_['isNil'](_0x4f4c76[_0x5c162d['IntervalId']])&&!_['isNil'](_0x4f4c76[_0x5c162d[_0x0e70('0xf')]][_0x0e70('0x10')])){_0x426aa2=_[_0x0e70('0x11')](_0x4f4c76[_0x5c162d['IntervalId']][_0x0e70('0x10')],_0x0e70('0x12'));}else if(!_[_0x0e70('0xe')](_0x5c162d[_0x0e70('0x12')])){_0x426aa2=[_0x5c162d[_0x0e70('0x12')]];}return _0x426aa2;}exports[_0x0e70('0x13')]=function(_0x413e4f){_0x413e4f[_0x0e70('0x14')]={};return new BPromise(function(_0x4bb11e,_0x13d476){var _0x195ddf={'Start':function(_0x572067){var _0x37610e=this;return new Promise(function(_0x210496,_0x29465f){if(_0x572067){try{var _0x54b609=[];var _0x3ce0da=getId(_0x572067[_0x0e70('0x15')],_0x572067['message']?_0x572067['message']['id']:0x0,_0x572067['interaction']?_0x572067[_0x0e70('0x16')]['id']:0x0);if(_0x572067[_0x0e70('0x17')]&&_['isArray'](_0x572067[_0x0e70('0x17')])&&_0x572067[_0x0e70('0x17')][_0x0e70('0x18')]){for(var _0x133efd=0x0;_0x133efd<_0x572067['applications'][_0x0e70('0x18')];_0x133efd+=0x1){var _0xe42c49=_0x572067['applications'][_0x133efd];if(fs[_0x0e70('0x19')](path[_0x0e70('0x1a')](__dirname,'applications',_0xe42c49[_0x0e70('0x1b')]+_0x0e70('0x1c')))){var _0x4a91e0=[];switch(_0xe42c49[_0x0e70('0x1b')][_0x0e70('0x1d')]()){case _0x0e70('0x1e'):var _0x5bd8cb=_0xe42c49[_0x0e70('0x1f')][_0x0e70('0x20')](',');_0x4a91e0[_0x0e70('0x21')](_0x5bd8cb[0x0]);_0x4a91e0[_0x0e70('0x21')](_0x5bd8cb[_0x0e70('0x22')](0x1,_0x5bd8cb[_0x0e70('0x18')])[_0x0e70('0x1a')](','));break;case _0x0e70('0x23'):var _0xd9d283=_0xe42c49['appdata'][_0x0e70('0x20')](',');_0x4a91e0[_0x0e70('0x21')](_0xd9d283[0x0]);_0x4a91e0['push'](_0xd9d283[0x1]);_0x4a91e0[_0x0e70('0x21')](_0xd9d283[_0x0e70('0x22')](0x2,_0xd9d283[_0x0e70('0x18')])[_0x0e70('0x1a')](','));break;case _0x0e70('0x24'):var _0x1b4da3=_0xe42c49[_0x0e70('0x1f')][_0x0e70('0x20')](',');_0x4a91e0[_0x0e70('0x21')](_0x1b4da3[0x0]);_0x4a91e0['push'](_0x1b4da3[0x1]);_0x4a91e0['push'](_0x1b4da3[0x2]);_0x4a91e0[_0x0e70('0x21')](_0x1b4da3[0x3]);_0x4a91e0['push'](_0x1b4da3[_0x0e70('0x22')](0x4,_0x1b4da3[_0x0e70('0x18')])[_0x0e70('0x1a')](','));break;case _0x0e70('0x25'):_0x4a91e0[_0x0e70('0x21')](_0xe42c49[_0x0e70('0x1f')]);break;case _0x0e70('0x26'):_0x4a91e0[_0x0e70('0x21')](_0xe42c49[_0x0e70('0x27')]);_0x4a91e0[_0x0e70('0x21')](_0xe42c49['appdata']);break;default:_0x4a91e0=_[_0x0e70('0xe')](_0xe42c49['appdata'])?[]:_0xe42c49[_0x0e70('0x1f')][_0x0e70('0x20')](',');}var _0x343a0c={'id':util[_0x0e70('0x28')](_0x0e70('0x29'),_0x3ce0da,_0xe42c49['id'],_0xe42c49[_0x0e70('0x1b')]),'condition':require('./interval')[_0x0e70('0x2a')](_0x3ce0da,getIntervals(_0x413e4f['intervals'],_0xe42c49),_0x413e4f),'consequence':require(_0x0e70('0x2b')+_0xe42c49[_0x0e70('0x1b')])[_0x0e70('0x2c')](_0x3ce0da,_0x4a91e0,_0x413e4f,_0x572067),'p':_0xe42c49[_0x0e70('0x2d')]||0x0};logger['info'](_0x0e70('0x2e'),_0x343a0c['id'],_0x0e70('0x2f'),getIntervals(_0x413e4f[_0x0e70('0x30')],_0xe42c49)[_0x0e70('0x1a')](_0x0e70('0x31')));_0x54b609[_0x0e70('0x21')](_0x343a0c);}else{logger[_0x0e70('0x32')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x0e70('0x17'),_0xe42c49[_0x0e70('0x1b')]+'.js'));}}_0x413e4f['rules'][_0x3ce0da]=new RuleEngine(_0x54b609);_0x413e4f[_0x0e70('0x14')][_0x3ce0da]['execute'](_0x572067,function(_0xdd1830){logger[_0x0e70('0x33')](_0x0e70('0x34'),JSON['stringify'](_0xdd1830[_0x0e70('0x35')]));if(_0x413e4f[_0x0e70('0x14')][_0x3ce0da]){_0x413e4f[_0x0e70('0x14')][_0x3ce0da]['emit']('complete');}});return _0x210496({'code':0xc8,'message':_0x572067});}else{logger[_0x0e70('0x33')](_0x0e70('0x36'));return _0x210496({'code':0xc8,'message':_0x572067});}}catch(_0x345e2b){logger[_0x0e70('0x32')](_0x345e2b[_0x0e70('0x37')]);return _0x29465f(_0x37610e[_0x0e70('0x32')](0x1f4,_0x345e2b));}}return _0x29465f('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3d9097){var _0x2bcec5=this;return new Promise(function(_0x3d4a08,_0x5d0d5c){if(_0x3d9097[_0x0e70('0x25')]&&_0x3d9097[_0x0e70('0x25')]['id']){try{var _0x51f410=getId(_0x3d9097[_0x0e70('0x15')],_0x3d9097[_0x0e70('0x25')]?_0x3d9097[_0x0e70('0x25')]['id']:0x0,_0x3d9097[_0x0e70('0x16')]?_0x3d9097[_0x0e70('0x16')]['id']:0x0);if(_0x413e4f[_0x0e70('0x14')][_0x51f410]){_0x413e4f['rules'][_0x51f410]['emit'](_0x0e70('0x38'));if(rpc[_0x3d9097[_0x0e70('0x15')]+_0x0e70('0x39')]){rpc[_0x3d9097[_0x0e70('0x15')]+'QueueReport'][_0x0e70('0x3a')](_0x51f410,{'UserId':_0x3d9097[_0x0e70('0x25')]['UserId']})['catch'](function(_0x462842){logger[_0x0e70('0x32')]('error\x20update\x20queue\x20report');});}}return _0x3d4a08({'code':0xc8,'message':_0x3d9097});}catch(_0x53da32){logger['error'](_0x53da32[_0x0e70('0x37')]);return _0x5d0d5c(_0x2bcec5[_0x0e70('0x32')](0x1f4,_0x53da32));}}logger[_0x0e70('0x32')](_0x0e70('0x3b'));return _0x5d0d5c(_0x2bcec5[_0x0e70('0x32')](0x1f4,_0x0e70('0x3b')));});},'RejectMessage':function(_0x57ec56){var _0x497903=this;return new Promise(function(_0x476215,_0x1aa6bf){if(_0x57ec56[_0x0e70('0x3c')]&&_0x57ec56[_0x0e70('0x3c')]['id']){try{if(_0x413e4f[_0x0e70('0x3d')][_0x57ec56[_0x0e70('0x3c')]['id']]){_0x413e4f[_0x0e70('0x3d')][_0x57ec56[_0x0e70('0x3c')]['id']][_0x0e70('0x3e')]=![];_0x413e4f[_0x0e70('0x3d')][_0x57ec56['agent']['id']][_0x0e70('0x3f')]=undefined;}return _0x476215({'code':0xc8,'message':_0x57ec56});}catch(_0x1fabc5){logger['error'](_0x1fabc5[_0x0e70('0x37')]);return _0x1aa6bf(_0x497903[_0x0e70('0x32')](0x1f4,_0x1fabc5));}}logger[_0x0e70('0x32')](_0x0e70('0x3b'));return _0x1aa6bf(_0x497903['error'](0x1f4,_0x0e70('0x3b')));});},'AbandonInteraction':function(_0x3ccc90){var _0x112e17=this;return new Promise(function(_0x33080f,_0x443e62){if(_0x3ccc90[_0x0e70('0x15')]&&_0x3ccc90[_0x0e70('0x16')]&&_0x3ccc90[_0x0e70('0x16')]['id']){try{var _0x486f73=getId(_0x3ccc90[_0x0e70('0x15')],_0x3ccc90['message']?_0x3ccc90['message']['id']:0x0,_0x3ccc90['interaction']?_0x3ccc90['interaction']['id']:0x0);if(_0x413e4f[_0x0e70('0x14')][_0x486f73]){_0x413e4f['rules'][_0x486f73][_0x0e70('0x40')](_0x0e70('0x38'));}return _0x33080f({'code':0xc8,'message':_0x3ccc90});}catch(_0x2e23cd){logger[_0x0e70('0x32')](_0x2e23cd[_0x0e70('0x37')]);return _0x443e62(_0x112e17['error'](0x1f4,_0x2e23cd));}}logger[_0x0e70('0x32')](_0x0e70('0x3b'));return _0x443e62(_0x112e17['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1f8abf){var _0x593919=this;return new Promise(function(_0x480026,_0x13ebf2){if(_0x413e4f['agents'][_0x0e70('0x41')](_0x1f8abf['id'])){for(var _0x56c633 in _0x1f8abf[_0x0e70('0x42')]){if(_0x1f8abf[_0x0e70('0x42')][_0x0e70('0x41')](_0x56c633)){if(_0x413e4f[_0x0e70('0x3d')][_0x1f8abf['id']][_0x0e70('0x41')](_0x56c633+_0x0e70('0x43'))){_0x413e4f[_0x0e70('0x3d')][_0x1f8abf['id']][_0x56c633+'CurrentCapacity']=parseInt(_0x1f8abf[_0x0e70('0x42')][_0x56c633],0xa);}}}_0x413e4f['agents'][_0x1f8abf['id']][_0x0e70('0x44')]();return _0x480026({'code':0xc8,'message':_0x413e4f[_0x0e70('0x3d')][_0x1f8abf['id']]});}else{return _0x13ebf2(_0x593919[_0x0e70('0x32')](0x1f4,_0x0e70('0x45')));}});},'Agents':function(_0x218be7){return new Promise(function(_0x10ddee,_0x85ecf){var _0x3cacec=_[_0x0e70('0x46')](_0x413e4f[_0x0e70('0x3d')]);_0x10ddee({'count':_0x3cacec[_0x0e70('0x18')],'rows':_0x3cacec});});},'ChatQueues':function(_0x138f5d){return new Promise(function(_0x42665e,_0x4b16ba){var _0x532c07=[];for(var _0x4575e5 in _0x413e4f[_0x0e70('0x47')]){if(_0x413e4f[_0x0e70('0x47')][_0x0e70('0x41')](_0x4575e5)){var _0x22550d=_0x413e4f['chatQueues'][_0x4575e5];var _0x4cc7f7={'id':_0x22550d['id'],'available':_0x22550d[_0x0e70('0x48')],'loggedIn':_0x22550d[_0x0e70('0x49')],'name':_0x22550d[_0x0e70('0x4a')],'paused':_0x22550d[_0x0e70('0x4b')],'waiting':_0x22550d[_0x0e70('0x4c')]};_0x532c07['push'](_0x4cc7f7);}}_0x42665e({'count':_0x532c07[_0x0e70('0x18')],'rows':_0x532c07});});},'MailQueues':function(_0x45b901){return new Promise(function(_0x164eeb,_0x411a1f){var _0x2098fd=[];for(var _0x54ea66 in _0x413e4f[_0x0e70('0x4d')]){if(_0x413e4f['mailQueues'][_0x0e70('0x41')](_0x54ea66)){var _0x2fffda=_0x413e4f[_0x0e70('0x4d')][_0x54ea66];var _0x1736b6={'id':_0x2fffda['id'],'available':_0x2fffda['available'],'loggedIn':_0x2fffda['loggedIn'],'name':_0x2fffda[_0x0e70('0x4a')],'paused':_0x2fffda['paused'],'waiting':_0x2fffda['waiting']};_0x2098fd[_0x0e70('0x21')](_0x1736b6);}}_0x164eeb({'count':_0x2098fd['length'],'rows':_0x2098fd});});},'OpenchannelQueues':function(_0x29a765){return new Promise(function(_0x59d486,_0x4ed1f9){var _0x5e8d55=[];for(var _0x2b3e0d in _0x413e4f['openchannelQueues']){if(_0x413e4f[_0x0e70('0x4e')]['hasOwnProperty'](_0x2b3e0d)){var _0x5b8d8f=_0x413e4f[_0x0e70('0x4e')][_0x2b3e0d];var _0x418ea3={'id':_0x5b8d8f['id'],'available':_0x5b8d8f[_0x0e70('0x48')],'loggedIn':_0x5b8d8f[_0x0e70('0x49')],'name':_0x5b8d8f[_0x0e70('0x4a')],'paused':_0x5b8d8f[_0x0e70('0x4b')],'waiting':_0x5b8d8f['waiting']};_0x5e8d55[_0x0e70('0x21')](_0x418ea3);}}_0x59d486({'count':_0x5e8d55[_0x0e70('0x18')],'rows':_0x5e8d55});});},'SmsQueues':function(_0x1ecc8c){return new Promise(function(_0x3202f0,_0x1fd74b){var _0x3360e0=[];for(var _0x54459a in _0x413e4f['smsQueues']){if(_0x413e4f['smsQueues'][_0x0e70('0x41')](_0x54459a)){var _0x50064f=_0x413e4f[_0x0e70('0x4f')][_0x54459a];var _0xaf2c9b={'id':_0x50064f['id'],'available':_0x50064f[_0x0e70('0x48')],'loggedIn':_0x50064f[_0x0e70('0x49')],'name':_0x50064f[_0x0e70('0x4a')],'paused':_0x50064f['paused'],'waiting':_0x50064f[_0x0e70('0x4c')]};_0x3360e0[_0x0e70('0x21')](_0xaf2c9b);}}_0x3202f0({'count':_0x3360e0['length'],'rows':_0x3360e0});});},'FaxQueues':function(_0x3c19ad){return new Promise(function(_0x3afa7f,_0x1213dc){var _0x147f0b=[];for(var _0x5e3604 in _0x413e4f[_0x0e70('0x50')]){if(_0x413e4f[_0x0e70('0x50')]['hasOwnProperty'](_0x5e3604)){var _0x182f51=_0x413e4f[_0x0e70('0x50')][_0x5e3604];var _0xae6efe={'id':_0x182f51['id'],'available':_0x182f51[_0x0e70('0x48')],'loggedIn':_0x182f51[_0x0e70('0x49')],'name':_0x182f51[_0x0e70('0x4a')],'paused':_0x182f51[_0x0e70('0x4b')],'waiting':_0x182f51[_0x0e70('0x4c')]};_0x147f0b[_0x0e70('0x21')](_0xae6efe);}}_0x3afa7f({'count':_0x147f0b[_0x0e70('0x18')],'rows':_0x147f0b});});},'WhatsappQueues':function(_0x2233c6){return new Promise(function(_0x370e28,_0x5074b9){var _0x3b12f7=[];for(var _0x5522a1 in _0x413e4f[_0x0e70('0x51')]){if(_0x413e4f[_0x0e70('0x51')][_0x0e70('0x41')](_0x5522a1)){var _0x5c1973=_0x413e4f[_0x0e70('0x51')][_0x5522a1];var _0x1abd61={'id':_0x5c1973['id'],'available':_0x5c1973[_0x0e70('0x48')],'loggedIn':_0x5c1973['loggedIn'],'name':_0x5c1973[_0x0e70('0x4a')],'paused':_0x5c1973[_0x0e70('0x4b')],'waiting':_0x5c1973[_0x0e70('0x4c')]};_0x3b12f7['push'](_0x1abd61);}}_0x370e28({'count':_0x3b12f7[_0x0e70('0x18')],'rows':_0x3b12f7});});},'ChatQueuesWaitingInteractions':function(_0x145e0f){return new Promise(function(_0x40ac96,_0x4d38da){var _0x3fa7f1=_[_0x0e70('0x46')](_0x413e4f[_0x0e70('0x52')]);_0x40ac96({'count':_0x3fa7f1[_0x0e70('0x18')],'rows':_0x3fa7f1});});},'MailQueuesWaitingInteractions':function(_0x4cd8b9){return new Promise(function(_0x40204c,_0x3ba1f0){var _0x5c524d=_[_0x0e70('0x46')](_0x413e4f[_0x0e70('0x53')]);_0x40204c({'count':_0x5c524d[_0x0e70('0x18')],'rows':_0x5c524d});});},'OpenchannelQueuesWaitingInteractions':function(_0x665a22){return new Promise(function(_0x2103fc,_0x344509){var _0xc81115=_[_0x0e70('0x46')](_0x413e4f[_0x0e70('0x54')]);_0x2103fc({'count':_0xc81115[_0x0e70('0x18')],'rows':_0xc81115});});},'SmsQueuesWaitingInteractions':function(_0x56b2cf){return new Promise(function(_0x5d9781,_0x5941ca){var _0x5073cc=_[_0x0e70('0x46')](_0x413e4f[_0x0e70('0x55')]);_0x5d9781({'count':_0x5073cc[_0x0e70('0x18')],'rows':_0x5073cc});});},'FaxQueuesWaitingInteractions':function(_0xf9ea71){return new Promise(function(_0x36333c,_0xbce6d9){var _0x324572=_[_0x0e70('0x46')](_0x413e4f[_0x0e70('0x56')]);_0x36333c({'count':_0x324572[_0x0e70('0x18')],'rows':_0x324572});});},'WhatsappQueuesWaitingInteractions':function(_0x1c6ced){return new Promise(function(_0x3ae22a,_0x1be5c2){var _0x4b1e02=_[_0x0e70('0x46')](_0x413e4f[_0x0e70('0x57')]);_0x3ae22a({'count':_0x4b1e02[_0x0e70('0x18')],'rows':_0x4b1e02});});}};var _0x16d2ac=jayson[_0x0e70('0x58')](_0x195ddf)[_0x0e70('0x59')]();_0x16d2ac['on']('error',function(_0x3983b8){logger[_0x0e70('0x32')](JSON[_0x0e70('0x5a')](_0x3983b8));return _0x13d476(_0x3983b8);});_0x16d2ac[_0x0e70('0x13')](0x232c,_0x0e70('0x5b'),function(){console['log'](_0x0e70('0x5c'),0x232c);return _0x4bb11e(_0x0e70('0x5d')+0x232c);});});};
\ No newline at end of file
+var _0x4724=['error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','existsSync','join','app','appdata','push','slice','length','amazonlex','split','tag','TagId','%s:%s:%s','condition','intervals','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','emit','end','QueueReport','update'];(function(_0x28a5ad,_0x520afa){var _0x176b8a=function(_0x3d71b){while(--_0x3d71b){_0x28a5ad['push'](_0x28a5ad['shift']());}};_0x176b8a(++_0x520afa);}(_0x4724,0xcf));var _0x4472=function(_0x30c83b,_0x1773d9){_0x30c83b=_0x30c83b-0x0;var _0x14bbc9=_0x4724[_0x30c83b];return _0x14bbc9;};'use strict';var _=require(_0x4472('0x0'));var util=require(_0x4472('0x1'));var path=require(_0x4472('0x2'));var fs=require('fs');var jayson=require(_0x4472('0x3'));var BPromise=require(_0x4472('0x4'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x4472('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x4472('0x6')),'smsQueueReport':require(_0x4472('0x7')),'faxQueueReport':require(_0x4472('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x4472('0x9'));function getId(_0x1a8af3,_0x330383,_0x2c079b){return util[_0x4472('0xa')]('%s.%s.%s',_0x1a8af3,_0x330383||0x0,_0x2c079b||0x0);}function getIntervals(_0x5650b6,_0x47f2e8){var _0xfc919b=[];if(!_[_0x4472('0xb')](_0x47f2e8[_0x4472('0xc')])&&!_['isNil'](_0x5650b6[_0x47f2e8[_0x4472('0xc')]])&&!_['isNil'](_0x5650b6[_0x47f2e8[_0x4472('0xc')]][_0x4472('0xd')])){_0xfc919b=_[_0x4472('0xe')](_0x5650b6[_0x47f2e8[_0x4472('0xc')]][_0x4472('0xd')],_0x4472('0xf'));}else if(!_[_0x4472('0xb')](_0x47f2e8[_0x4472('0xf')])){_0xfc919b=[_0x47f2e8[_0x4472('0xf')]];}return _0xfc919b;}exports[_0x4472('0x10')]=function(_0x2328e3){_0x2328e3[_0x4472('0x11')]={};return new BPromise(function(_0x255ad7,_0x359483){var _0x154788={'Start':function(_0x47f325){var _0x3de221=this;return new Promise(function(_0x2165ae,_0x26ea2d){if(_0x47f325){try{var _0x55cf28=[];var _0x22d34c=getId(_0x47f325[_0x4472('0x12')],_0x47f325[_0x4472('0x13')]?_0x47f325['message']['id']:0x0,_0x47f325[_0x4472('0x14')]?_0x47f325[_0x4472('0x14')]['id']:0x0);if(_0x47f325[_0x4472('0x15')]&&_[_0x4472('0x16')](_0x47f325[_0x4472('0x15')])&&_0x47f325[_0x4472('0x15')]['length']){for(var _0x21ce82=0x0;_0x21ce82<_0x47f325[_0x4472('0x15')]['length'];_0x21ce82+=0x1){var _0x547857=_0x47f325[_0x4472('0x15')][_0x21ce82];if(fs[_0x4472('0x17')](path[_0x4472('0x18')](__dirname,_0x4472('0x15'),_0x547857[_0x4472('0x19')]+'.js'))){var _0x236db0=[];switch(_0x547857['app']['toLowerCase']()){case'autoreply':var _0x13b05c=_0x547857[_0x4472('0x1a')]['split'](',');_0x236db0[_0x4472('0x1b')](_0x13b05c[0x0]);_0x236db0[_0x4472('0x1b')](_0x13b05c[_0x4472('0x1c')](0x1,_0x13b05c[_0x4472('0x1d')])[_0x4472('0x18')](','));break;case'dialogflow':var _0x1d3940=_0x547857[_0x4472('0x1a')]['split'](',');_0x236db0[_0x4472('0x1b')](_0x1d3940[0x0]);_0x236db0[_0x4472('0x1b')](_0x1d3940[0x1]);_0x236db0[_0x4472('0x1b')](_0x1d3940[_0x4472('0x1c')](0x2,_0x1d3940[_0x4472('0x1d')])['join'](','));break;case _0x4472('0x1e'):var _0x1acd3f=_0x547857[_0x4472('0x1a')][_0x4472('0x1f')](',');_0x236db0['push'](_0x1acd3f[0x0]);_0x236db0['push'](_0x1acd3f[0x1]);_0x236db0['push'](_0x1acd3f[0x2]);_0x236db0['push'](_0x1acd3f[0x3]);_0x236db0[_0x4472('0x1b')](_0x1acd3f[_0x4472('0x1c')](0x4,_0x1acd3f[_0x4472('0x1d')])[_0x4472('0x18')](','));break;case _0x4472('0x13'):_0x236db0[_0x4472('0x1b')](_0x547857[_0x4472('0x1a')]);break;case _0x4472('0x20'):_0x236db0['push'](_0x547857[_0x4472('0x21')]);_0x236db0[_0x4472('0x1b')](_0x547857[_0x4472('0x1a')]);break;default:_0x236db0=_[_0x4472('0xb')](_0x547857[_0x4472('0x1a')])?[]:_0x547857[_0x4472('0x1a')][_0x4472('0x1f')](',');}var _0x19769b={'id':util[_0x4472('0xa')](_0x4472('0x22'),_0x22d34c,_0x547857['id'],_0x547857[_0x4472('0x19')]),'condition':require('./interval')[_0x4472('0x23')](_0x22d34c,getIntervals(_0x2328e3[_0x4472('0x24')],_0x547857),_0x2328e3),'consequence':require('./applications/'+_0x547857[_0x4472('0x19')])[_0x4472('0x25')](_0x22d34c,_0x236db0,_0x2328e3,_0x47f325),'p':_0x547857[_0x4472('0x26')]||0x0};logger[_0x4472('0x27')]('Push\x20new\x20rule',_0x19769b['id'],_0x4472('0x28'),getIntervals(_0x2328e3[_0x4472('0x24')],_0x547857)['join'](_0x4472('0x29')));_0x55cf28[_0x4472('0x1b')](_0x19769b);}else{logger[_0x4472('0x2a')](_0x4472('0x2b'),path['join'](__dirname,_0x4472('0x15'),_0x547857[_0x4472('0x19')]+_0x4472('0x2c')));}}_0x2328e3[_0x4472('0x11')][_0x22d34c]=new RuleEngine(_0x55cf28);_0x2328e3['rules'][_0x22d34c][_0x4472('0x2d')](_0x47f325,function(_0x125835){logger[_0x4472('0x27')](_0x4472('0x2e'),JSON['stringify'](_0x125835['matchPath']));if(_0x2328e3[_0x4472('0x11')][_0x22d34c]){_0x2328e3[_0x4472('0x11')][_0x22d34c]['emit']('complete');}});return _0x2165ae({'code':0xc8,'message':_0x47f325});}else{logger[_0x4472('0x27')](_0x4472('0x2f'));return _0x2165ae({'code':0xc8,'message':_0x47f325});}}catch(_0x2164f4){logger[_0x4472('0x2a')](_0x2164f4[_0x4472('0x30')]);return _0x26ea2d(_0x3de221['error'](0x1f4,_0x2164f4));}}return _0x26ea2d(_0x4472('0x31'));});},'AcceptMessage':function(_0x3bbaed){var _0x2cb816=this;return new Promise(function(_0xefb4c0,_0xbd2b5f){if(_0x3bbaed[_0x4472('0x13')]&&_0x3bbaed[_0x4472('0x13')]['id']){try{var _0x2e3c23=getId(_0x3bbaed[_0x4472('0x12')],_0x3bbaed[_0x4472('0x13')]?_0x3bbaed['message']['id']:0x0,_0x3bbaed[_0x4472('0x14')]?_0x3bbaed[_0x4472('0x14')]['id']:0x0);if(_0x2328e3['rules'][_0x2e3c23]){_0x2328e3['rules'][_0x2e3c23][_0x4472('0x32')](_0x4472('0x33'));if(rpc[_0x3bbaed[_0x4472('0x12')]+_0x4472('0x34')]){rpc[_0x3bbaed['channel']+'QueueReport'][_0x4472('0x35')](_0x2e3c23,{'UserId':_0x3bbaed[_0x4472('0x13')]['UserId']})['catch'](function(_0x899658){logger[_0x4472('0x2a')](_0x4472('0x36'));});}}return _0xefb4c0({'code':0xc8,'message':_0x3bbaed});}catch(_0x399852){logger[_0x4472('0x2a')](_0x399852[_0x4472('0x30')]);return _0xbd2b5f(_0x2cb816[_0x4472('0x2a')](0x1f4,_0x399852));}}logger[_0x4472('0x2a')](_0x4472('0x37'));return _0xbd2b5f(_0x2cb816[_0x4472('0x2a')](0x1f4,_0x4472('0x37')));});},'RejectMessage':function(_0x261b7f){var _0x5ee230=this;return new Promise(function(_0xf166,_0x4969b1){if(_0x261b7f['agent']&&_0x261b7f[_0x4472('0x38')]['id']){try{if(_0x2328e3[_0x4472('0x39')][_0x261b7f[_0x4472('0x38')]['id']]){_0x2328e3[_0x4472('0x39')][_0x261b7f[_0x4472('0x38')]['id']][_0x4472('0x3a')]=![];_0x2328e3[_0x4472('0x39')][_0x261b7f['agent']['id']]['busyQueue']=undefined;}return _0xf166({'code':0xc8,'message':_0x261b7f});}catch(_0x53130d){logger['error'](_0x53130d[_0x4472('0x30')]);return _0x4969b1(_0x5ee230['error'](0x1f4,_0x53130d));}}logger[_0x4472('0x2a')](_0x4472('0x37'));return _0x4969b1(_0x5ee230[_0x4472('0x2a')](0x1f4,_0x4472('0x37')));});},'AbandonInteraction':function(_0x17366c){var _0x5a41f6=this;return new Promise(function(_0x755129,_0x578f38){if(_0x17366c[_0x4472('0x12')]&&_0x17366c[_0x4472('0x14')]&&_0x17366c['interaction']['id']){try{var _0x361471=getId(_0x17366c[_0x4472('0x12')],_0x17366c['message']?_0x17366c[_0x4472('0x13')]['id']:0x0,_0x17366c[_0x4472('0x14')]?_0x17366c[_0x4472('0x14')]['id']:0x0);if(_0x2328e3[_0x4472('0x11')][_0x361471]){_0x2328e3['rules'][_0x361471][_0x4472('0x32')](_0x4472('0x33'));}return _0x755129({'code':0xc8,'message':_0x17366c});}catch(_0x24cbcd){logger[_0x4472('0x2a')](_0x24cbcd[_0x4472('0x30')]);return _0x578f38(_0x5a41f6[_0x4472('0x2a')](0x1f4,_0x24cbcd));}}logger[_0x4472('0x2a')](_0x4472('0x37'));return _0x578f38(_0x5a41f6[_0x4472('0x2a')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x43c15a){var _0x2041d1=this;return new Promise(function(_0x734750,_0x5142eb){if(_0x2328e3[_0x4472('0x39')][_0x4472('0x3b')](_0x43c15a['id'])){for(var _0x13967b in _0x43c15a[_0x4472('0x3c')]){if(_0x43c15a[_0x4472('0x3c')][_0x4472('0x3b')](_0x13967b)){if(_0x2328e3[_0x4472('0x39')][_0x43c15a['id']][_0x4472('0x3b')](_0x13967b+_0x4472('0x3d'))){_0x2328e3['agents'][_0x43c15a['id']][_0x13967b+'CurrentCapacity']=parseInt(_0x43c15a[_0x4472('0x3c')][_0x13967b],0xa);}}}_0x2328e3[_0x4472('0x39')][_0x43c15a['id']][_0x4472('0x3e')]();return _0x734750({'code':0xc8,'message':_0x2328e3['agents'][_0x43c15a['id']]});}else{return _0x5142eb(_0x2041d1[_0x4472('0x2a')](0x1f4,_0x4472('0x3f')));}});},'Agents':function(_0x2300c1){return new Promise(function(_0x3364aa,_0x40d406){var _0xe57dcb=_[_0x4472('0x40')](_0x2328e3['agents']);_0x3364aa({'count':_0xe57dcb[_0x4472('0x1d')],'rows':_0xe57dcb});});},'ChatQueues':function(_0x4aa449){return new Promise(function(_0x161a3d,_0x20c855){var _0xfb75e3=[];for(var _0x35c860 in _0x2328e3['chatQueues']){if(_0x2328e3['chatQueues'][_0x4472('0x3b')](_0x35c860)){var _0x4495cc=_0x2328e3[_0x4472('0x41')][_0x35c860];var _0x56715b={'id':_0x4495cc['id'],'available':_0x4495cc[_0x4472('0x42')],'loggedIn':_0x4495cc[_0x4472('0x43')],'name':_0x4495cc['name'],'paused':_0x4495cc[_0x4472('0x44')],'waiting':_0x4495cc[_0x4472('0x45')]};_0xfb75e3[_0x4472('0x1b')](_0x56715b);}}_0x161a3d({'count':_0xfb75e3[_0x4472('0x1d')],'rows':_0xfb75e3});});},'MailQueues':function(_0x829ef){return new Promise(function(_0x47a2b2,_0x355040){var _0x18d42a=[];for(var _0x21f125 in _0x2328e3[_0x4472('0x46')]){if(_0x2328e3[_0x4472('0x46')][_0x4472('0x3b')](_0x21f125)){var _0x3ae32f=_0x2328e3[_0x4472('0x46')][_0x21f125];var _0x40646c={'id':_0x3ae32f['id'],'available':_0x3ae32f[_0x4472('0x42')],'loggedIn':_0x3ae32f[_0x4472('0x43')],'name':_0x3ae32f[_0x4472('0x47')],'paused':_0x3ae32f['paused'],'waiting':_0x3ae32f[_0x4472('0x45')]};_0x18d42a['push'](_0x40646c);}}_0x47a2b2({'count':_0x18d42a[_0x4472('0x1d')],'rows':_0x18d42a});});},'OpenchannelQueues':function(_0x19093a){return new Promise(function(_0x2b2b1a,_0x43c677){var _0x189ac6=[];for(var _0x47738e in _0x2328e3[_0x4472('0x48')]){if(_0x2328e3['openchannelQueues'][_0x4472('0x3b')](_0x47738e)){var _0x1e7182=_0x2328e3[_0x4472('0x48')][_0x47738e];var _0x49a779={'id':_0x1e7182['id'],'available':_0x1e7182[_0x4472('0x42')],'loggedIn':_0x1e7182[_0x4472('0x43')],'name':_0x1e7182[_0x4472('0x47')],'paused':_0x1e7182[_0x4472('0x44')],'waiting':_0x1e7182['waiting']};_0x189ac6['push'](_0x49a779);}}_0x2b2b1a({'count':_0x189ac6['length'],'rows':_0x189ac6});});},'SmsQueues':function(_0x164be6){return new Promise(function(_0xc4f6e9,_0x28bb0f){var _0xd07391=[];for(var _0x4d5130 in _0x2328e3['smsQueues']){if(_0x2328e3['smsQueues'][_0x4472('0x3b')](_0x4d5130)){var _0x3769fe=_0x2328e3[_0x4472('0x49')][_0x4d5130];var _0x5a1d3c={'id':_0x3769fe['id'],'available':_0x3769fe[_0x4472('0x42')],'loggedIn':_0x3769fe['loggedIn'],'name':_0x3769fe[_0x4472('0x47')],'paused':_0x3769fe[_0x4472('0x44')],'waiting':_0x3769fe['waiting']};_0xd07391['push'](_0x5a1d3c);}}_0xc4f6e9({'count':_0xd07391[_0x4472('0x1d')],'rows':_0xd07391});});},'FaxQueues':function(_0x17d688){return new Promise(function(_0x404149,_0x26c150){var _0x29bb7b=[];for(var _0x23f303 in _0x2328e3[_0x4472('0x4a')]){if(_0x2328e3[_0x4472('0x4a')][_0x4472('0x3b')](_0x23f303)){var _0x5a47e4=_0x2328e3[_0x4472('0x4a')][_0x23f303];var _0x57f241={'id':_0x5a47e4['id'],'available':_0x5a47e4[_0x4472('0x42')],'loggedIn':_0x5a47e4[_0x4472('0x43')],'name':_0x5a47e4[_0x4472('0x47')],'paused':_0x5a47e4['paused'],'waiting':_0x5a47e4['waiting']};_0x29bb7b[_0x4472('0x1b')](_0x57f241);}}_0x404149({'count':_0x29bb7b[_0x4472('0x1d')],'rows':_0x29bb7b});});},'WhatsappQueues':function(_0x4c7d7b){return new Promise(function(_0x147005,_0x5a9f76){var _0x14d6cf=[];for(var _0x3a1666 in _0x2328e3[_0x4472('0x4b')]){if(_0x2328e3[_0x4472('0x4b')][_0x4472('0x3b')](_0x3a1666)){var _0x2b633a=_0x2328e3[_0x4472('0x4b')][_0x3a1666];var _0x346d4a={'id':_0x2b633a['id'],'available':_0x2b633a['available'],'loggedIn':_0x2b633a[_0x4472('0x43')],'name':_0x2b633a[_0x4472('0x47')],'paused':_0x2b633a['paused'],'waiting':_0x2b633a[_0x4472('0x45')]};_0x14d6cf[_0x4472('0x1b')](_0x346d4a);}}_0x147005({'count':_0x14d6cf[_0x4472('0x1d')],'rows':_0x14d6cf});});},'ChatQueuesWaitingInteractions':function(_0x5ee6b8){return new Promise(function(_0x1472f5,_0x574331){var _0x357aa1=_[_0x4472('0x40')](_0x2328e3[_0x4472('0x4c')]);_0x1472f5({'count':_0x357aa1['length'],'rows':_0x357aa1});});},'MailQueuesWaitingInteractions':function(_0x25d0a5){return new Promise(function(_0x5ea41e,_0x10afc3){var _0x49e14b=_[_0x4472('0x40')](_0x2328e3[_0x4472('0x4d')]);_0x5ea41e({'count':_0x49e14b[_0x4472('0x1d')],'rows':_0x49e14b});});},'OpenchannelQueuesWaitingInteractions':function(_0x233328){return new Promise(function(_0x122a22,_0x462535){var _0x52bfd4=_[_0x4472('0x40')](_0x2328e3[_0x4472('0x4e')]);_0x122a22({'count':_0x52bfd4[_0x4472('0x1d')],'rows':_0x52bfd4});});},'SmsQueuesWaitingInteractions':function(_0x270d01){return new Promise(function(_0x3f9df8,_0xa4a147){var _0x509749=_[_0x4472('0x40')](_0x2328e3[_0x4472('0x4f')]);_0x3f9df8({'count':_0x509749[_0x4472('0x1d')],'rows':_0x509749});});},'FaxQueuesWaitingInteractions':function(_0x2f0dcd){return new Promise(function(_0x4cd6b7,_0x100d79){var _0x3a5766=_[_0x4472('0x40')](_0x2328e3['faxQueuesWaitingInteractions']);_0x4cd6b7({'count':_0x3a5766[_0x4472('0x1d')],'rows':_0x3a5766});});},'WhatsappQueuesWaitingInteractions':function(_0x24248c){return new Promise(function(_0x2ced72,_0x10105a){var _0x305d55=_[_0x4472('0x40')](_0x2328e3[_0x4472('0x50')]);_0x2ced72({'count':_0x305d55[_0x4472('0x1d')],'rows':_0x305d55});});}};var _0x35a36c=jayson[_0x4472('0x51')](_0x154788)[_0x4472('0x52')]();_0x35a36c['on'](_0x4472('0x2a'),function(_0x2e94b3){logger['error'](JSON['stringify'](_0x2e94b3));return _0x359483(_0x2e94b3);});_0x35a36c[_0x4472('0x10')](0x232c,_0x4472('0x53'),function(){console[_0x4472('0x54')](_0x4472('0x55'),0x232c);return _0x255ad7(_0x4472('0x56')+0x232c);});});};
\ No newline at end of file
index 88069a0..6f3ee70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0473=['catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','then','indexOf','true','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','http','error','message','result'];(function(_0x459879,_0x3ac20c){var _0x5f5b00=function(_0x9e0b7c){while(--_0x9e0b7c){_0x459879['push'](_0x459879['shift']());}};_0x5f5b00(++_0x3ac20c);}(_0x0473,0x119));var _0x3047=function(_0x269147,_0x45dfc7){_0x269147=_0x269147-0x0;var _0x38ab4c=_0x0473[_0x269147];return _0x38ab4c;};'use strict';var util=require(_0x3047('0x0'));var BPromise=require(_0x3047('0x1'));var jayson=require(_0x3047('0x2'));var _=require(_0x3047('0x3'));var logger=require(_0x3047('0x4'))('routing');var client=jayson['client'][_0x3047('0x5')]({'port':0x232a});function request(_0x52047f,_0x2fcc57){return new BPromise(function(_0x2cb94c,_0x3811d4){return client['request'](_0x52047f,_0x2fcc57)['then'](function(_0x2d0ff6){if(_0x2d0ff6[_0x3047('0x6')]){return _0x3811d4(_0x2d0ff6[_0x3047('0x6')][_0x3047('0x7')]);}else{return _0x2cb94c(_0x2d0ff6[_0x3047('0x8')]);}})[_0x3047('0x9')](function(_0xe59800){return _0x3811d4(_0xe59800);});});}exports[_0x3047('0xa')]=function(_0x1eb8f5,_0x5567dc,_0x33dabc){return function(_0x3cea72){if(_0x33dabc[_0x3047('0xb')]&&!_0x33dabc[_0x3047('0xb')][_0x1eb8f5]){logger[_0x3047('0xc')](_0x3047('0xd'),_0x1eb8f5);return _0x3cea72[_0x3047('0xe')]();}var _0x2fa59e=[];for(var _0x2c949a=0x0;_0x2c949a<_0x5567dc[_0x3047('0xf')];_0x2c949a+=0x1){_0x2fa59e[_0x3047('0x10')](request(_0x3047('0x11'),{'command':util[_0x3047('0x12')](_0x3047('0x13'),_0x5567dc[_0x2c949a])})[_0x3047('0x14')](function(_0x4e64f2){return _0x4e64f2&&_0x4e64f2[_0x3047('0x7')]&&_0x4e64f2[_0x3047('0x7')][_0x3047('0x15')](_0x3047('0x16'))>=0x0?!![]:![];})[_0x3047('0x9')](function(_0xdbb5a5){logger['error']('[%s][INTERVAL]\x20%s',_0x1eb8f5,_0x5567dc[_0x2c949a]);}));}BPromise['all'](_0x2fa59e)[_0x3047('0x14')](function(_0x6668f8){var _0x121dbd=_[_0x3047('0x17')](_0x6668f8);logger[_0x3047('0xc')](_0x3047('0x18'),_0x1eb8f5,_0x5567dc[_0x3047('0x19')](_0x3047('0x1a')),_0x121dbd);_0x3cea72[_0x3047('0x1b')](_0x121dbd);})[_0x3047('0x9')](function(_0x164713){console['log'](_0x164713);logger[_0x3047('0x6')]('[%s][INTERVAL]\x20%s\x20%s',_0x1eb8f5,_0x5567dc[_0x3047('0x19')](_0x3047('0x1a')),_0x164713[_0x3047('0x1c')]);_0x3cea72[_0x3047('0xe')]();});};};
\ No newline at end of file
+var _0x51b5=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','then','error','result','catch'];(function(_0x446d6d,_0x5aa756){var _0x22364d=function(_0x4322f3){while(--_0x4322f3){_0x446d6d['push'](_0x446d6d['shift']());}};_0x22364d(++_0x5aa756);}(_0x51b5,0x135));var _0x551b=function(_0xfdb14f,_0x49d076){_0xfdb14f=_0xfdb14f-0x0;var _0x37daa7=_0x51b5[_0xfdb14f];return _0x37daa7;};'use strict';var util=require(_0x551b('0x0'));var BPromise=require(_0x551b('0x1'));var jayson=require(_0x551b('0x2'));var _=require(_0x551b('0x3'));var logger=require(_0x551b('0x4'))('routing');var client=jayson[_0x551b('0x5')][_0x551b('0x6')]({'port':0x232a});function request(_0x59a71e,_0x31f86c){return new BPromise(function(_0x581e8b,_0x3f4bc5){return client['request'](_0x59a71e,_0x31f86c)[_0x551b('0x7')](function(_0x32e1f8){if(_0x32e1f8['error']){return _0x3f4bc5(_0x32e1f8[_0x551b('0x8')]['message']);}else{return _0x581e8b(_0x32e1f8[_0x551b('0x9')]);}})[_0x551b('0xa')](function(_0x2893df){return _0x3f4bc5(_0x2893df);});});}exports[_0x551b('0xb')]=function(_0x5df08d,_0x1575e1,_0x29bcc8){return function(_0x848a61){if(_0x29bcc8[_0x551b('0xc')]&&!_0x29bcc8[_0x551b('0xc')][_0x5df08d]){logger[_0x551b('0xd')](_0x551b('0xe'),_0x5df08d);return _0x848a61[_0x551b('0xf')]();}var _0x53ff4c=[];for(var _0x1c596e=0x0;_0x1c596e<_0x1575e1[_0x551b('0x10')];_0x1c596e+=0x1){_0x53ff4c[_0x551b('0x11')](request(_0x551b('0x12'),{'command':util[_0x551b('0x13')](_0x551b('0x14'),_0x1575e1[_0x1c596e])})[_0x551b('0x7')](function(_0x1925b9){return _0x1925b9&&_0x1925b9[_0x551b('0x15')]&&_0x1925b9['message'][_0x551b('0x16')](_0x551b('0x17'))>=0x0?!![]:![];})[_0x551b('0xa')](function(_0x5d532b){logger['error'](_0x551b('0x18'),_0x5df08d,_0x1575e1[_0x1c596e]);}));}BPromise[_0x551b('0x19')](_0x53ff4c)[_0x551b('0x7')](function(_0x15822a){var _0x32fad2=_[_0x551b('0x1a')](_0x15822a);logger[_0x551b('0xd')](_0x551b('0x1b'),_0x5df08d,_0x1575e1[_0x551b('0x1c')](_0x551b('0x1d')),_0x32fad2);_0x848a61[_0x551b('0x1e')](_0x32fad2);})[_0x551b('0xa')](function(_0x15d715){console[_0x551b('0x1f')](_0x15d715);logger[_0x551b('0x8')](_0x551b('0x1b'),_0x5df08d,_0x1575e1[_0x551b('0x1c')](_0x551b('0x1d')),_0x15d715['stack']);_0x848a61[_0x551b('0xf')]();});};};
\ No newline at end of file
index 1bdb6d6..793d382 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa237=['calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acw','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinename','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','holdtime','ringtime','push','error','includes','reason','abandoned','agentconnect','agentconnectAt','connect','answeredelsewheredestinationuniqueid','talktime','diffTime','agentcompleteAt','transfereruniqueid','transfer','transfertype','extension','transferuniqueid','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','calleridname','transferexten','secondtransfererexten','transfertargetuniqueid','clone','cause','rejected','splice','agentcomplete','agent','complete','lodash','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','queue','membername','interface'];(function(_0x289c65,_0x5641bd){var _0x567395=function(_0x460bdf){while(--_0x460bdf){_0x289c65['push'](_0x289c65['shift']());}};_0x567395(++_0x5641bd);}(_0xa237,0x7c));var _0x7a23=function(_0x196b0d,_0x852e09){_0x196b0d=_0x196b0d-0x0;var _0x2b0e95=_0xa237[_0x196b0d];return _0x2b0e95;};'use strict';var _=require(_0x7a23('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1a5387,_0x41e213){utils[_0x7a23('0x1')](util[_0x7a23('0x2')](_0x7a23('0x3'),_0x1a5387['uniqueid'],_0x1a5387[_0x7a23('0x4')],_0x1a5387[_0x7a23('0x5')],_0x1a5387[_0x7a23('0x6')],_0x1a5387[_0x7a23('0x7')],_0x1a5387[_0x7a23('0x8')],_0x1a5387[_0x7a23('0x9')],_0x1a5387[_0x7a23('0xa')]));if(_0x1a5387[_0x7a23('0x5')]){utils[_0x7a23('0xb')](_0x1a5387['queue'])[_0x7a23('0xc')](function(_0x2e3136){if(_0x2e3136){_0x1a5387[_0x7a23('0xd')]=_0x2e3136[_0x7a23('0xd')];_0x1a5387[_0x7a23('0xe')]=_0x1a5387['agentcomplete']?_0x2e3136[_0x7a23('0xf')]:![];_0x1a5387[_0x7a23('0x10')]=_0x1a5387[_0x7a23('0xe')]?_0x2e3136['acwTimeout']:0x0;}utils[_0x7a23('0x11')]('CreateVoiceAgentReport',_0x1a5387);});}else{utils[_0x7a23('0x11')](_0x7a23('0x12'),_0x1a5387);}if(_0x41e213){delete transfers[_0x1a5387[_0x7a23('0x13')]];}else{delete agents[_0x1a5387[_0x7a23('0x14')]];}}exports[_0x7a23('0x15')]=function(_0x23a905){try{agents[_0x23a905['destuniqueid']]=_0x23a905;agents[_0x23a905['destuniqueid']][_0x7a23('0x16')]=utils[_0x7a23('0x17')]();agents[_0x23a905['destuniqueid']]['lastevent']=_0x7a23('0x18');agents[_0x23a905[_0x7a23('0x14')]]['connectedlinenum']=null;agents[_0x23a905[_0x7a23('0x14')]][_0x7a23('0x19')]=null;}catch(_0x47161d){utils['error'](_0x47161d[_0x7a23('0x1a')]);}};exports[_0x7a23('0x1b')]=function(_0x550ac1){try{if(!_[_0x7a23('0x1c')](agents[_0x550ac1[_0x7a23('0x14')]])){agents[_0x550ac1[_0x7a23('0x14')]][_0x7a23('0x1b')]=!![];agents[_0x550ac1[_0x7a23('0x14')]][_0x7a23('0x1d')]=utils['now']();agents[_0x550ac1[_0x7a23('0x14')]][_0x7a23('0xa')]=_0x7a23('0x1e');agents[_0x550ac1[_0x7a23('0x14')]]['reason']=_0x7a23('0x1e');agents[_0x550ac1[_0x7a23('0x14')]][_0x7a23('0x1f')]=_0x550ac1[_0x7a23('0x20')]?parseInt(_0x550ac1[_0x7a23('0x20')])/0x3e8:0x0;agents[_0x550ac1[_0x7a23('0x14')]]['talktime']=0x0;unanswered[_0x7a23('0x21')](_0x550ac1[_0x7a23('0x14')]);}}catch(_0x256217){utils[_0x7a23('0x22')](_0x256217['stack']);}};exports['queuecallerabandon']=function(_0x3e0e21){try{_['forIn'](agents,function(_0x3ca77c,_0x43ea3a){if(_0x3ca77c[_0x7a23('0x13')]==_0x3e0e21['uniqueid']&&!_[_0x7a23('0x23')](unanswered,_0x3ca77c[_0x7a23('0x14')])){_0x3ca77c['agentringnoanswer']=!![];_0x3ca77c[_0x7a23('0x1d')]=utils[_0x7a23('0x17')]();_0x3ca77c['lastevent']='abandoned';_0x3ca77c[_0x7a23('0x24')]=_0x7a23('0x25');_0x3ca77c[_0x7a23('0x1f')]=_0x3e0e21[_0x7a23('0x1f')];_0x3ca77c['talktime']=0x0;writeDB(_0x3ca77c);}});}catch(_0x1a55e6){utils[_0x7a23('0x22')](_0x1a55e6[_0x7a23('0x1a')]);}};exports[_0x7a23('0x26')]=function(_0x34a869){try{if(agents[_0x34a869[_0x7a23('0x14')]]){agents[_0x34a869[_0x7a23('0x14')]][_0x7a23('0x27')]=utils[_0x7a23('0x17')]();agents[_0x34a869[_0x7a23('0x14')]][_0x7a23('0x9')]=_0x34a869['connectedlinenum'];agents[_0x34a869[_0x7a23('0x14')]][_0x7a23('0x19')]=_0x34a869[_0x7a23('0x19')];agents[_0x34a869[_0x7a23('0x14')]]['holdtime']=_0x34a869[_0x7a23('0x20')];agents[_0x34a869[_0x7a23('0x14')]][_0x7a23('0xa')]=_0x7a23('0x28');_['forIn'](agents,function(_0x14ab2f,_0x1b27ac){if(_0x14ab2f[_0x7a23('0x14')]!=_0x34a869['destuniqueid']&&_0x14ab2f[_0x7a23('0x13')]==_0x34a869[_0x7a23('0x13')]){_0x14ab2f['talktime']=0x0;_0x14ab2f[_0x7a23('0x1f')]=_0x34a869[_0x7a23('0x20')];_0x14ab2f['agentringnoanswer']=!![];_0x14ab2f['agentringnoanswerAt']=utils[_0x7a23('0x17')]();_0x14ab2f[_0x7a23('0xa')]='answered_elsewhere';_0x14ab2f[_0x7a23('0x24')]='answered_elsewhere';_0x14ab2f[_0x7a23('0x29')]=_0x34a869[_0x7a23('0x14')];_0x14ab2f['answeredelsewheremembername']=_0x34a869[_0x7a23('0x6')];writeDB(_0x14ab2f);}});}}catch(_0x5a390a){utils[_0x7a23('0x22')](_0x5a390a['stack']);}};exports['agentcomplete']=function(_0x5dc53c){try{if(!_[_0x7a23('0x1c')](agents[_0x5dc53c[_0x7a23('0x14')]])){agents[_0x5dc53c[_0x7a23('0x14')]]['agentcomplete']=!![];agents[_0x5dc53c[_0x7a23('0x14')]]['agentcompleteAt']=utils['now']();agents[_0x5dc53c[_0x7a23('0x14')]][_0x7a23('0x2a')]=utils[_0x7a23('0x2b')](agents[_0x5dc53c[_0x7a23('0x14')]][_0x7a23('0x2c')],agents[_0x5dc53c[_0x7a23('0x14')]][_0x7a23('0x27')]);agents[_0x5dc53c[_0x7a23('0x14')]][_0x7a23('0x24')]=_0x5dc53c['reason'];agents[_0x5dc53c[_0x7a23('0x14')]]['lastevent']='complete';writeDB(agents[_0x5dc53c[_0x7a23('0x14')]]);}}catch(_0x2e369c){utils['error'](_0x2e369c[_0x7a23('0x1a')]);}};exports['blindtransfer']=function(_0x5dffbb){try{if(!_[_0x7a23('0x1c')](agents[_0x5dffbb['transfereruniqueid']])){agents[_0x5dffbb[_0x7a23('0x2d')]][_0x7a23('0x2e')]=!![];agents[_0x5dffbb[_0x7a23('0x2d')]][_0x7a23('0x2f')]='blind';agents[_0x5dffbb[_0x7a23('0x2d')]]['transferexten']=_0x5dffbb[_0x7a23('0x30')];agents[_0x5dffbb[_0x7a23('0x2d')]][_0x7a23('0x31')]=agents[_0x5dffbb[_0x7a23('0x2d')]][_0x7a23('0x13')];}}catch(_0x31be3b){utils[_0x7a23('0x22')](_0x31be3b[_0x7a23('0x1a')]);}};exports['attendedtransfer']=function(_0x1035e3){try{if(_0x1035e3[_0x7a23('0x32')]==_0x1035e3['origtransfererlinkedid']){if(!_[_0x7a23('0x1c')](agents[_0x1035e3[_0x7a23('0x33')]])){agents[_0x1035e3[_0x7a23('0x33')]][_0x7a23('0x2e')]=!![];agents[_0x1035e3[_0x7a23('0x33')]][_0x7a23('0x2f')]=_0x7a23('0x34');agents[_0x1035e3['secondtransfereruniqueid']]['transferexten']=_0x1035e3['origtransfererexten'];agents[_0x1035e3[_0x7a23('0x33')]][_0x7a23('0x31')]=_0x1035e3[_0x7a23('0x32')];}if(_0x1035e3[_0x7a23('0x35')]&&agents[_0x1035e3[_0x7a23('0x35')]]){agents[_0x1035e3[_0x7a23('0x35')]][_0x7a23('0x36')]=0x1;transfers[_0x1035e3[_0x7a23('0x35')]]=_['clone'](agents[_0x1035e3['transfereeuniqueid']]);transfers[_0x1035e3['transfereeuniqueid']][_0x7a23('0x8')]=agents[_0x1035e3[_0x7a23('0x33')]][_0x7a23('0x8')];transfers[_0x1035e3[_0x7a23('0x35')]][_0x7a23('0x37')]=agents[_0x1035e3[_0x7a23('0x33')]][_0x7a23('0x37')];transfers[_0x1035e3[_0x7a23('0x35')]][_0x7a23('0x16')]=utils['now']();transfers[_0x1035e3['transfereeuniqueid']][_0x7a23('0x27')]=utils['now']();transfers[_0x1035e3['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x1035e3[_0x7a23('0x35')]]['agententerreason']=0x2;}}else if(_0x1035e3[_0x7a23('0x33')]==_0x1035e3['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x1035e3[_0x7a23('0x32')]])){agents[_0x1035e3[_0x7a23('0x32')]]['transfer']=!![];agents[_0x1035e3[_0x7a23('0x32')]][_0x7a23('0x2f')]=_0x7a23('0x34');agents[_0x1035e3[_0x7a23('0x32')]][_0x7a23('0x38')]=_0x1035e3[_0x7a23('0x39')];agents[_0x1035e3[_0x7a23('0x32')]][_0x7a23('0x31')]=_0x1035e3[_0x7a23('0x33')];}if(_0x1035e3[_0x7a23('0x3a')]&&agents[_0x1035e3[_0x7a23('0x3a')]]){agents[_0x1035e3[_0x7a23('0x3a')]][_0x7a23('0x36')]=0x1;transfers[_0x1035e3['transfertargetuniqueid']]=_[_0x7a23('0x3b')](agents[_0x1035e3[_0x7a23('0x3a')]]);transfers[_0x1035e3['transfertargetuniqueid']]['calleridnum']=agents[_0x1035e3[_0x7a23('0x32')]][_0x7a23('0x8')];transfers[_0x1035e3[_0x7a23('0x3a')]][_0x7a23('0x37')]=agents[_0x1035e3[_0x7a23('0x32')]][_0x7a23('0x37')];transfers[_0x1035e3[_0x7a23('0x3a')]]['agentcalledAt']=utils[_0x7a23('0x17')]();transfers[_0x1035e3['transfertargetuniqueid']][_0x7a23('0x27')]=utils[_0x7a23('0x17')]();transfers[_0x1035e3[_0x7a23('0x3a')]]['holdtime']=0x0;transfers[_0x1035e3['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x39e71c){utils[_0x7a23('0x22')](_0x39e71c[_0x7a23('0x1a')]);}};exports['hangup']=function(_0x326a85){try{if(agents[_0x326a85[_0x7a23('0x13')]]&&agents[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x24')]===_0x7a23('0x1e')){if(_0x326a85[_0x7a23('0x3c')]==='21'){agents[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x24')]=_0x7a23('0x3d');agents[_0x326a85[_0x7a23('0x13')]][_0x7a23('0xa')]='rejected';}writeDB(agents[_0x326a85[_0x7a23('0x13')]]);var _0x23867b=unanswered['indexOf'](_0x326a85[_0x7a23('0x13')]);if(_0x23867b>-0x1)unanswered[_0x7a23('0x3e')](_0x23867b,0x1);}if(transfers[_0x326a85[_0x7a23('0x13')]]){transfers[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x3f')]=!![];transfers[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x2c')]=utils[_0x7a23('0x17')]();transfers[_0x326a85['uniqueid']]['talktime']=utils['diffTime'](transfers[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x2c')],transfers[_0x326a85[_0x7a23('0x13')]]['agentconnectAt']);transfers[_0x326a85[_0x7a23('0x13')]]['reason']=_0x7a23('0x40');transfers[_0x326a85[_0x7a23('0x13')]]['lastevent']=_0x7a23('0x41');writeDB(transfers[_0x326a85[_0x7a23('0x13')]],!![]);}if(agents[_0x326a85[_0x7a23('0x13')]]&&agents[_0x326a85[_0x7a23('0x13')]]['agentconnectAt']){agents[_0x326a85[_0x7a23('0x13')]]['agentcomplete']=!![];agents[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x2c')]=utils['now']();agents[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x2a')]=utils['diffTime'](agents[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x2c')],agents[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x27')]);agents[_0x326a85[_0x7a23('0x13')]][_0x7a23('0x24')]=agents[_0x326a85['uniqueid']][_0x7a23('0x2e')]?_0x7a23('0x2e'):'agent';agents[_0x326a85[_0x7a23('0x13')]]['lastevent']=_0x7a23('0x41');writeDB(agents[_0x326a85[_0x7a23('0x13')]]);}}catch(_0x4fb1d2){utils[_0x7a23('0x22')](_0x4fb1d2[_0x7a23('0x1a')]);}};
\ No newline at end of file
+var _0xaf8e=['rejected','indexOf','splice','agent','complete','lodash','util','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','ringtime','talktime','push','queuecallerabandon','includes','abandoned','reason','holdtime','agentconnect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','transfer','transfertype','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid'];(function(_0x867b4a,_0x1441ca){var _0x1260f4=function(_0xae9a96){while(--_0xae9a96){_0x867b4a['push'](_0x867b4a['shift']());}};_0x1260f4(++_0x1441ca);}(_0xaf8e,0x95));var _0xeaf8=function(_0x12cc8f,_0x342dee){_0x12cc8f=_0x12cc8f-0x0;var _0x2e2c9e=_0xaf8e[_0x12cc8f];return _0x2e2c9e;};'use strict';var _=require(_0xeaf8('0x0'));var util=require(_0xeaf8('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x58f12d,_0x1cdeb5){utils[_0xeaf8('0x2')](util[_0xeaf8('0x3')](_0xeaf8('0x4'),_0x58f12d[_0xeaf8('0x5')],_0x58f12d[_0xeaf8('0x6')],_0x58f12d[_0xeaf8('0x7')],_0x58f12d[_0xeaf8('0x8')],_0x58f12d['interface'],_0x58f12d[_0xeaf8('0x9')],_0x58f12d[_0xeaf8('0xa')],_0x58f12d[_0xeaf8('0xb')]));if(_0x58f12d[_0xeaf8('0x7')]){utils['getVoiceQueueByName'](_0x58f12d[_0xeaf8('0x7')])['then'](function(_0x24441a){if(_0x24441a){_0x58f12d[_0xeaf8('0xc')]=_0x24441a['type'];_0x58f12d['agentacw']=_0x58f12d[_0xeaf8('0xd')]?_0x24441a[_0xeaf8('0xe')]:![];_0x58f12d[_0xeaf8('0xf')]=_0x58f12d[_0xeaf8('0x10')]?_0x24441a[_0xeaf8('0x11')]:0x0;}utils[_0xeaf8('0x12')](_0xeaf8('0x13'),_0x58f12d);});}else{utils['request'](_0xeaf8('0x13'),_0x58f12d);}if(_0x1cdeb5){delete transfers[_0x58f12d[_0xeaf8('0x5')]];}else{delete agents[_0x58f12d[_0xeaf8('0x14')]];}}exports[_0xeaf8('0x15')]=function(_0x5ca90e){try{agents[_0x5ca90e['destuniqueid']]=_0x5ca90e;agents[_0x5ca90e[_0xeaf8('0x14')]][_0xeaf8('0x16')]=utils[_0xeaf8('0x17')]();agents[_0x5ca90e['destuniqueid']][_0xeaf8('0xb')]=_0xeaf8('0x18');agents[_0x5ca90e[_0xeaf8('0x14')]][_0xeaf8('0xa')]=null;agents[_0x5ca90e[_0xeaf8('0x14')]][_0xeaf8('0x19')]=null;}catch(_0x45c7bb){utils[_0xeaf8('0x1a')](_0x45c7bb[_0xeaf8('0x1b')]);}};exports[_0xeaf8('0x1c')]=function(_0x3cf307){try{if(!_[_0xeaf8('0x1d')](agents[_0x3cf307[_0xeaf8('0x14')]])){agents[_0x3cf307[_0xeaf8('0x14')]][_0xeaf8('0x1c')]=!![];agents[_0x3cf307[_0xeaf8('0x14')]][_0xeaf8('0x1e')]=utils['now']();agents[_0x3cf307[_0xeaf8('0x14')]][_0xeaf8('0xb')]=_0xeaf8('0x1f');agents[_0x3cf307[_0xeaf8('0x14')]]['reason']='timeout';agents[_0x3cf307[_0xeaf8('0x14')]]['holdtime']=_0x3cf307[_0xeaf8('0x20')]?parseInt(_0x3cf307['ringtime'])/0x3e8:0x0;agents[_0x3cf307[_0xeaf8('0x14')]][_0xeaf8('0x21')]=0x0;unanswered[_0xeaf8('0x22')](_0x3cf307['destuniqueid']);}}catch(_0x2e4d27){utils[_0xeaf8('0x1a')](_0x2e4d27['stack']);}};exports[_0xeaf8('0x23')]=function(_0x8da0c7){try{_['forIn'](agents,function(_0x500435,_0x50aa9e){if(_0x500435[_0xeaf8('0x5')]==_0x8da0c7[_0xeaf8('0x5')]&&!_[_0xeaf8('0x24')](unanswered,_0x500435[_0xeaf8('0x14')])){_0x500435[_0xeaf8('0x1c')]=!![];_0x500435['agentringnoanswerAt']=utils[_0xeaf8('0x17')]();_0x500435['lastevent']=_0xeaf8('0x25');_0x500435[_0xeaf8('0x26')]='abandoned';_0x500435[_0xeaf8('0x27')]=_0x8da0c7['holdtime'];_0x500435[_0xeaf8('0x21')]=0x0;writeDB(_0x500435);}});}catch(_0x3e6caf){utils[_0xeaf8('0x1a')](_0x3e6caf[_0xeaf8('0x1b')]);}};exports[_0xeaf8('0x28')]=function(_0x3fab53){try{if(agents[_0x3fab53[_0xeaf8('0x14')]]){agents[_0x3fab53['destuniqueid']][_0xeaf8('0x29')]=utils[_0xeaf8('0x17')]();agents[_0x3fab53[_0xeaf8('0x14')]][_0xeaf8('0xa')]=_0x3fab53['connectedlinenum'];agents[_0x3fab53['destuniqueid']][_0xeaf8('0x19')]=_0x3fab53['connectedlinename'];agents[_0x3fab53[_0xeaf8('0x14')]]['holdtime']=_0x3fab53[_0xeaf8('0x20')];agents[_0x3fab53['destuniqueid']]['lastevent']=_0xeaf8('0x2a');_[_0xeaf8('0x2b')](agents,function(_0xb5c8ba,_0x2e2428){if(_0xb5c8ba['destuniqueid']!=_0x3fab53[_0xeaf8('0x14')]&&_0xb5c8ba[_0xeaf8('0x5')]==_0x3fab53['uniqueid']){_0xb5c8ba[_0xeaf8('0x21')]=0x0;_0xb5c8ba['holdtime']=_0x3fab53[_0xeaf8('0x20')];_0xb5c8ba[_0xeaf8('0x1c')]=!![];_0xb5c8ba[_0xeaf8('0x1e')]=utils[_0xeaf8('0x17')]();_0xb5c8ba[_0xeaf8('0xb')]=_0xeaf8('0x2c');_0xb5c8ba[_0xeaf8('0x26')]=_0xeaf8('0x2c');_0xb5c8ba[_0xeaf8('0x2d')]=_0x3fab53[_0xeaf8('0x14')];_0xb5c8ba[_0xeaf8('0x2e')]=_0x3fab53['membername'];writeDB(_0xb5c8ba);}});}}catch(_0x122751){utils['error'](_0x122751[_0xeaf8('0x1b')]);}};exports[_0xeaf8('0xd')]=function(_0x33a886){try{if(!_['isNil'](agents[_0x33a886[_0xeaf8('0x14')]])){agents[_0x33a886[_0xeaf8('0x14')]]['agentcomplete']=!![];agents[_0x33a886[_0xeaf8('0x14')]]['agentcompleteAt']=utils[_0xeaf8('0x17')]();agents[_0x33a886[_0xeaf8('0x14')]][_0xeaf8('0x21')]=utils[_0xeaf8('0x2f')](agents[_0x33a886[_0xeaf8('0x14')]][_0xeaf8('0x30')],agents[_0x33a886[_0xeaf8('0x14')]][_0xeaf8('0x29')]);agents[_0x33a886[_0xeaf8('0x14')]][_0xeaf8('0x26')]=_0x33a886[_0xeaf8('0x26')];agents[_0x33a886[_0xeaf8('0x14')]]['lastevent']='complete';writeDB(agents[_0x33a886[_0xeaf8('0x14')]]);}}catch(_0x21c8c3){utils[_0xeaf8('0x1a')](_0x21c8c3[_0xeaf8('0x1b')]);}};exports[_0xeaf8('0x31')]=function(_0x2d8d39){try{if(!_[_0xeaf8('0x1d')](agents[_0x2d8d39[_0xeaf8('0x32')]])){agents[_0x2d8d39[_0xeaf8('0x32')]][_0xeaf8('0x33')]=!![];agents[_0x2d8d39[_0xeaf8('0x32')]][_0xeaf8('0x34')]='blind';agents[_0x2d8d39['transfereruniqueid']][_0xeaf8('0x35')]=_0x2d8d39[_0xeaf8('0x36')];agents[_0x2d8d39[_0xeaf8('0x32')]][_0xeaf8('0x37')]=agents[_0x2d8d39[_0xeaf8('0x32')]][_0xeaf8('0x5')];}}catch(_0x58b145){utils[_0xeaf8('0x1a')](_0x58b145['stack']);}};exports['attendedtransfer']=function(_0xc9756f){try{if(_0xc9756f[_0xeaf8('0x38')]==_0xc9756f[_0xeaf8('0x39')]){if(!_['isNil'](agents[_0xc9756f['secondtransfereruniqueid']])){agents[_0xc9756f[_0xeaf8('0x3a')]][_0xeaf8('0x33')]=!![];agents[_0xc9756f[_0xeaf8('0x3a')]][_0xeaf8('0x34')]='ATTENDED';agents[_0xc9756f[_0xeaf8('0x3a')]][_0xeaf8('0x35')]=_0xc9756f[_0xeaf8('0x3b')];agents[_0xc9756f[_0xeaf8('0x3a')]][_0xeaf8('0x37')]=_0xc9756f[_0xeaf8('0x38')];}if(_0xc9756f[_0xeaf8('0x3c')]&&agents[_0xc9756f[_0xeaf8('0x3c')]]){agents[_0xc9756f[_0xeaf8('0x3c')]][_0xeaf8('0x3d')]=0x1;transfers[_0xc9756f[_0xeaf8('0x3c')]]=_[_0xeaf8('0x3e')](agents[_0xc9756f[_0xeaf8('0x3c')]]);transfers[_0xc9756f[_0xeaf8('0x3c')]][_0xeaf8('0x9')]=agents[_0xc9756f[_0xeaf8('0x3a')]][_0xeaf8('0x9')];transfers[_0xc9756f[_0xeaf8('0x3c')]][_0xeaf8('0x3f')]=agents[_0xc9756f['secondtransfereruniqueid']][_0xeaf8('0x3f')];transfers[_0xc9756f[_0xeaf8('0x3c')]][_0xeaf8('0x16')]=utils[_0xeaf8('0x17')]();transfers[_0xc9756f[_0xeaf8('0x3c')]][_0xeaf8('0x29')]=utils[_0xeaf8('0x17')]();transfers[_0xc9756f['transfereeuniqueid']][_0xeaf8('0x27')]=0x0;transfers[_0xc9756f['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0xc9756f[_0xeaf8('0x3a')]==_0xc9756f[_0xeaf8('0x40')]){if(!_['isNil'](agents[_0xc9756f[_0xeaf8('0x38')]])){agents[_0xc9756f[_0xeaf8('0x38')]][_0xeaf8('0x33')]=!![];agents[_0xc9756f[_0xeaf8('0x38')]]['transfertype']=_0xeaf8('0x41');agents[_0xc9756f['origtransfereruniqueid']][_0xeaf8('0x35')]=_0xc9756f['secondtransfererexten'];agents[_0xc9756f[_0xeaf8('0x38')]][_0xeaf8('0x37')]=_0xc9756f['secondtransfereruniqueid'];}if(_0xc9756f[_0xeaf8('0x42')]&&agents[_0xc9756f[_0xeaf8('0x42')]]){agents[_0xc9756f['transfertargetuniqueid']][_0xeaf8('0x3d')]=0x1;transfers[_0xc9756f[_0xeaf8('0x42')]]=_[_0xeaf8('0x3e')](agents[_0xc9756f[_0xeaf8('0x42')]]);transfers[_0xc9756f[_0xeaf8('0x42')]][_0xeaf8('0x9')]=agents[_0xc9756f['origtransfereruniqueid']]['calleridnum'];transfers[_0xc9756f['transfertargetuniqueid']][_0xeaf8('0x3f')]=agents[_0xc9756f[_0xeaf8('0x38')]]['calleridname'];transfers[_0xc9756f[_0xeaf8('0x42')]]['agentcalledAt']=utils[_0xeaf8('0x17')]();transfers[_0xc9756f[_0xeaf8('0x42')]][_0xeaf8('0x29')]=utils[_0xeaf8('0x17')]();transfers[_0xc9756f[_0xeaf8('0x42')]][_0xeaf8('0x27')]=0x0;transfers[_0xc9756f[_0xeaf8('0x42')]][_0xeaf8('0x3d')]=0x2;}}}catch(_0x58c5cd){utils[_0xeaf8('0x1a')](_0x58c5cd[_0xeaf8('0x1b')]);}};exports['hangup']=function(_0x2a885a){try{if(agents[_0x2a885a[_0xeaf8('0x5')]]&&agents[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0x26')]==='timeout'){if(_0x2a885a['cause']==='21'){agents[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0x26')]=_0xeaf8('0x43');agents[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0xb')]=_0xeaf8('0x43');}writeDB(agents[_0x2a885a[_0xeaf8('0x5')]]);var _0x3b8d39=unanswered[_0xeaf8('0x44')](_0x2a885a[_0xeaf8('0x5')]);if(_0x3b8d39>-0x1)unanswered[_0xeaf8('0x45')](_0x3b8d39,0x1);}if(transfers[_0x2a885a['uniqueid']]){transfers[_0x2a885a[_0xeaf8('0x5')]]['agentcomplete']=!![];transfers[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0x30')]=utils[_0xeaf8('0x17')]();transfers[_0x2a885a[_0xeaf8('0x5')]]['talktime']=utils[_0xeaf8('0x2f')](transfers[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0x30')],transfers[_0x2a885a[_0xeaf8('0x5')]]['agentconnectAt']);transfers[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0x26')]=_0xeaf8('0x46');transfers[_0x2a885a[_0xeaf8('0x5')]]['lastevent']=_0xeaf8('0x47');writeDB(transfers[_0x2a885a[_0xeaf8('0x5')]],!![]);}if(agents[_0x2a885a[_0xeaf8('0x5')]]&&agents[_0x2a885a['uniqueid']][_0xeaf8('0x29')]){agents[_0x2a885a[_0xeaf8('0x5')]]['agentcomplete']=!![];agents[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0x30')]=utils[_0xeaf8('0x17')]();agents[_0x2a885a[_0xeaf8('0x5')]]['talktime']=utils[_0xeaf8('0x2f')](agents[_0x2a885a[_0xeaf8('0x5')]]['agentcompleteAt'],agents[_0x2a885a['uniqueid']]['agentconnectAt']);agents[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0x26')]=agents[_0x2a885a[_0xeaf8('0x5')]]['transfer']?_0xeaf8('0x33'):_0xeaf8('0x46');agents[_0x2a885a[_0xeaf8('0x5')]][_0xeaf8('0xb')]=_0xeaf8('0x47');writeDB(agents[_0x2a885a[_0xeaf8('0x5')]]);}}catch(_0x5bb34c){utils[_0xeaf8('0x1a')](_0x5bb34c['stack']);}};
\ No newline at end of file
index 3a0dbb7..337a76b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26eb=['gotoif','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','destination','callerid','disposition','getUserByInternal','UserId','request','CreateVoiceCallReport','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','stack','newstate','isNil','channelstate','systemanswertime','linkedid','transfer','answertime','ANSWERED','hangup','calleridname','duration','diffTime','endtime','starttime','billableseconds','secondtransfererchannel','userfield','_attended','localtwolinkedid','destinationchannel','musiconholdstart','musiconholdstartAt','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','queue','xmd-cdrtype','outboundrouteid','routeid','sipcallid','application','toLowerCase','startsWith','appdata','split','substring','includes','noop','execif','set'];(function(_0x11f4cc,_0x40d102){var _0x53cabb=function(_0x3a7be4){while(--_0x3a7be4){_0x11f4cc['push'](_0x11f4cc['shift']());}};_0x53cabb(++_0x40d102);}(_0x26eb,0xf2));var _0xb26e=function(_0x127c7b,_0x48bacb){_0x127c7b=_0x127c7b-0x0;var _0x5f1e61=_0x26eb[_0x127c7b];return _0x5f1e61;};'use strict';var _=require(_0xb26e('0x0'));var util=require(_0xb26e('0x1'));var utils=require(_0xb26e('0x2'));var dispositions=[_0xb26e('0x3'),_0xb26e('0x4'),_0xb26e('0x4'),_0xb26e('0x3'),_0xb26e('0x3'),_0xb26e('0x3'),'ANSWERED',_0xb26e('0x5'),_0xb26e('0x4'),_0xb26e('0x4'),_0xb26e('0x4')];var channels={};function writeDB(_0x199d18){utils[_0xb26e('0x6')](util[_0xb26e('0x7')](_0xb26e('0x8'),_0x199d18[_0xb26e('0x9')],_0x199d18[_0xb26e('0xa')],_0x199d18[_0xb26e('0xb')],_0x199d18[_0xb26e('0xc')],_0x199d18[_0xb26e('0xd')],_0x199d18[_0xb26e('0xe')],_0x199d18[_0xb26e('0xf')],_0x199d18[_0xb26e('0x10')]));if(_0x199d18[_0xb26e('0xc')]){utils[_0xb26e('0x11')](_0x199d18[_0xb26e('0xc')])['then'](function(_0x2ee569){if(_0x2ee569){_0x199d18[_0xb26e('0x12')]=_0x2ee569['id'];}utils[_0xb26e('0x13')](_0xb26e('0x14'),_0x199d18);});}else{utils[_0xb26e('0x13')](_0xb26e('0x14'),_0x199d18);}if(channels[_0x199d18[_0xb26e('0x9')]]){delete channels[_0x199d18[_0xb26e('0x9')]];}}exports['newchannel']=function(_0xc4f46c){try{if(_0xc4f46c[_0xb26e('0x9')]==_0xc4f46c['linkedid']&&_0xc4f46c[_0xb26e('0xa')]!=_0xb26e('0x15')){channels[_0xc4f46c[_0xb26e('0x9')]]={'uniqueid':_0xc4f46c[_0xb26e('0x9')],'accountcode':_0xc4f46c[_0xb26e('0xc')],'source':_0xc4f46c[_0xb26e('0x16')],'destination':_0xc4f46c[_0xb26e('0x17')],'destinationcontext':_0xc4f46c[_0xb26e('0x18')],'channel':_0xc4f46c[_0xb26e('0xa')],'starttime':utils[_0xb26e('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb26e('0x3'),'amaflags':_0xb26e('0x1a')};}}catch(_0x1cd52a){utils[_0xb26e('0x1b')](_0x1cd52a[_0xb26e('0x1c')]);}};exports[_0xb26e('0x1d')]=function(_0x4337ea){try{if(!_[_0xb26e('0x1e')](channels[_0x4337ea['uniqueid']])&&_0x4337ea[_0xb26e('0x1f')]==0x6){if(_[_0xb26e('0x1e')](channels[_0x4337ea[_0xb26e('0x9')]][_0xb26e('0x20')])){channels[_0x4337ea[_0xb26e('0x9')]][_0xb26e('0x20')]=utils[_0xb26e('0x19')]();}}else if(!_[_0xb26e('0x1e')](channels[_0x4337ea[_0xb26e('0x21')]])&&_0x4337ea[_0xb26e('0x1f')]==0x6&&_0x4337ea[_0xb26e('0x18')]!=_0xb26e('0x22')){channels[_0x4337ea['linkedid']][_0xb26e('0xc')]=_0x4337ea[_0xb26e('0xc')];channels[_0x4337ea[_0xb26e('0x21')]]['destinationchannel']=_0x4337ea[_0xb26e('0xa')];if(_[_0xb26e('0x1e')](channels[_0x4337ea['linkedid']][_0xb26e('0x23')])){channels[_0x4337ea[_0xb26e('0x21')]][_0xb26e('0x23')]=utils[_0xb26e('0x19')]();}channels[_0x4337ea[_0xb26e('0x21')]]['disposition']=dispositions[_['toNumber'](_0x4337ea[_0xb26e('0x1f')])]||_0xb26e('0x24');}}catch(_0x6407c9){utils[_0xb26e('0x1b')](_0x6407c9[_0xb26e('0x1c')]);}};exports[_0xb26e('0x25')]=function(_0x371d91){try{if(!_[_0xb26e('0x1e')](channels[_0x371d91[_0xb26e('0x9')]])){if(_['isNil'](channels[_0x371d91[_0xb26e('0x9')]][_0xb26e('0xf')])){channels[_0x371d91['uniqueid']][_0xb26e('0xf')]=_0x371d91[_0xb26e('0x26')]+'\x20<'+_0x371d91[_0xb26e('0x16')]+'>';}channels[_0x371d91[_0xb26e('0x9')]]['endtime']=utils[_0xb26e('0x19')]();channels[_0x371d91[_0xb26e('0x9')]][_0xb26e('0x27')]=utils[_0xb26e('0x28')](channels[_0x371d91[_0xb26e('0x9')]][_0xb26e('0x29')],channels[_0x371d91[_0xb26e('0x9')]][_0xb26e('0x2a')]);channels[_0x371d91[_0xb26e('0x9')]][_0xb26e('0x2b')]=channels[_0x371d91[_0xb26e('0x9')]][_0xb26e('0x23')]?utils[_0xb26e('0x28')](channels[_0x371d91[_0xb26e('0x9')]][_0xb26e('0x29')],channels[_0x371d91['uniqueid']][_0xb26e('0x23')]):0x0;writeDB(channels[_0x371d91[_0xb26e('0x9')]]);}}catch(_0x863067){utils[_0xb26e('0x1b')](_0x863067[_0xb26e('0x1c')]);}};exports['attendedtransfer']=function(_0x1649f5){try{if(!_['isNil'](channels[_0x1649f5['localtwolinkedid']])){if(channels[_0x1649f5['localtwolinkedid']][_0xb26e('0xa')]==_0x1649f5['transfereechannel']){channels[_0x1649f5['localtwolinkedid']]['destinationchannel']=_0x1649f5[_0xb26e('0x2c')];channels[_0x1649f5['localtwolinkedid']][_0xb26e('0x2d')]=_0xb26e('0x2e');}else if(channels[_0x1649f5[_0xb26e('0x2f')]]['channel']=_0x1649f5['transfertargetchannel']){channels[_0x1649f5['localtwolinkedid']][_0xb26e('0x30')]=_0x1649f5['origtransfererchannel'];channels[_0x1649f5[_0xb26e('0x2f')]][_0xb26e('0x2d')]=_0xb26e('0x2e');}}}catch(_0x224ac1){utils[_0xb26e('0x1b')](_0x224ac1['stack']);}};exports[_0xb26e('0x31')]=function(_0xed5980){try{if(!_[_0xb26e('0x1e')](channels[_0xed5980[_0xb26e('0x9')]])){channels[_0xed5980[_0xb26e('0x9')]][_0xb26e('0x32')]=utils[_0xb26e('0x19')]();}}catch(_0x1dc9a3){utils['error'](_0x1dc9a3[_0xb26e('0x1c')]);}};exports['musiconholdstop']=function(_0x451366){try{if(!_[_0xb26e('0x1e')](channels[_0x451366['uniqueid']])){if(!_[_0xb26e('0x1e')](channels[_0x451366['uniqueid']][_0xb26e('0x32')])){channels[_0x451366['uniqueid']][_0xb26e('0x33')]+=utils['diffTime'](utils[_0xb26e('0x19')](),channels[_0x451366[_0xb26e('0x9')]][_0xb26e('0x32')]);delete channels[_0x451366['uniqueid']][_0xb26e('0x32')];}}}catch(_0x3cedbe){utils[_0xb26e('0x1b')](_0x3cedbe[_0xb26e('0x1c')]);}};exports[_0xb26e('0x34')]=function(_0x4f43ff){try{if(!_['isNil'](channels[_0x4f43ff[_0xb26e('0x9')]])){if(!_[_0xb26e('0x1e')](_0x4f43ff[_0xb26e('0x35')][_0xb26e('0x36')])){channels[_0x4f43ff[_0xb26e('0x9')]][_0xb26e('0xd')]=_0x4f43ff[_0xb26e('0x37')];}if(!_[_0xb26e('0x1e')](_0x4f43ff[_0xb26e('0x35')][_0xb26e('0x38')])){channels[_0x4f43ff[_0xb26e('0x9')]][_0xb26e('0xe')]=_0x4f43ff['value'];channels[_0x4f43ff[_0xb26e('0x9')]][_0xb26e('0xf')]='\x22'+_0x4f43ff[_0xb26e('0x37')]+'\x22\x20<'+_0x4f43ff['value']+'>';}if(!_[_0xb26e('0x1e')](_0x4f43ff['variable'][_0xb26e('0x39')])||!_['isNil'](_0x4f43ff['variable'][_0xb26e('0x3a')])){channels[_0x4f43ff[_0xb26e('0x9')]][_0xb26e('0xf')]=_0x4f43ff[_0xb26e('0x37')];}if(!_[_0xb26e('0x1e')](_0x4f43ff['variable'][_0xb26e('0x3b')])||!_[_0xb26e('0x1e')](_0x4f43ff['variable'][_0xb26e('0x3c')])){channels[_0x4f43ff['uniqueid']]['lastapplication']=_0xb26e('0x3d');channels[_0x4f43ff[_0xb26e('0x9')]][_0xb26e('0x3e')]=_0x4f43ff['value'];channels[_0x4f43ff['uniqueid']][_0xb26e('0x3f')]=!![];}if(!_[_0xb26e('0x1e')](_0x4f43ff[_0xb26e('0x35')]['xmd-contactid'])){channels[_0x4f43ff[_0xb26e('0x9')]]['ContactId']=_0x4f43ff[_0xb26e('0x37')];}if(!_[_0xb26e('0x1e')](_0x4f43ff[_0xb26e('0x35')][_0xb26e('0x40')])){channels[_0x4f43ff[_0xb26e('0x9')]][_0xb26e('0xb')]=_0x4f43ff['value'];}if(!_['isNil'](_0x4f43ff['variable'][_0xb26e('0x41')])){channels[_0x4f43ff[_0xb26e('0x9')]][_0xb26e('0x42')]=_0x4f43ff[_0xb26e('0x37')];}if(!_[_0xb26e('0x1e')](_0x4f43ff[_0xb26e('0x35')][_0xb26e('0x43')])){channels[_0x4f43ff[_0xb26e('0x9')]][_0xb26e('0x43')]=_0x4f43ff[_0xb26e('0x37')];}}}catch(_0x351676){utils[_0xb26e('0x1b')](_0x351676[_0xb26e('0x1c')]);}};exports['newexten']=function(_0x5f42fa){try{if(!_[_0xb26e('0x1e')](channels[_0x5f42fa[_0xb26e('0x9')]])){if(_0x5f42fa[_0xb26e('0x44')][_0xb26e('0x45')]()=='set'&&_[_0xb26e('0x46')](_0x5f42fa[_0xb26e('0x47')][_0xb26e('0x45')](),'cdr')){var _0x19be6d=_0x5f42fa[_0xb26e('0x47')][_0xb26e('0x48')]('=');var _0x541d68=_0x19be6d[0x0][_0xb26e('0x49')](_0x19be6d[0x0]['lastIndexOf']('(')+0x1,_0x19be6d[0x0]['lastIndexOf'](')'));var _0x2e6778=_0x19be6d[0x1];channels[_0x5f42fa[_0xb26e('0x9')]][_0x541d68]=_0x2e6778;}if(!_[_0xb26e('0x4a')](['hangup',_0xb26e('0x4b'),_0xb26e('0x4c'),_0xb26e('0x4d'),_0xb26e('0x4e')],_0x5f42fa[_0xb26e('0x44')]['toLowerCase']())){channels[_0x5f42fa[_0xb26e('0x9')]][_0xb26e('0x4f')]=_0x5f42fa[_0xb26e('0x44')];channels[_0x5f42fa[_0xb26e('0x9')]][_0xb26e('0x3e')]=_0x5f42fa[_0xb26e('0x47')];}}}catch(_0x5a6ee4){utils[_0xb26e('0x1b')](_0x5a6ee4['stack']);}};
\ No newline at end of file
+var _0x209d=['set','gotoif','lastapplication','application','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','type','accountcode','source','destination','getUserByInternal','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','stack','newstate','isNil','systemanswertime','channelstate','transfer','answertime','disposition','toNumber','error','callerid','calleridname','endtime','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstartAt','musiconholdstop','mohtime','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmcs-queue','Queue','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','toLowerCase','startsWith','appdata','cdr','substring','lastIndexOf','noop'];(function(_0x22541b,_0x5c49e3){var _0x2985ce=function(_0x88a1d5){while(--_0x88a1d5){_0x22541b['push'](_0x22541b['shift']());}};_0x2985ce(++_0x5c49e3);}(_0x209d,0x18f));var _0xd209=function(_0x377d25,_0x31c28d){_0x377d25=_0x377d25-0x0;var _0x3cb2e2=_0x209d[_0x377d25];return _0x3cb2e2;};'use strict';var _=require(_0xd209('0x0'));var util=require(_0xd209('0x1'));var utils=require(_0xd209('0x2'));var dispositions=['NO\x20ANSWER',_0xd209('0x3'),_0xd209('0x3'),_0xd209('0x4'),_0xd209('0x4'),_0xd209('0x4'),_0xd209('0x5'),_0xd209('0x6'),'FAILED',_0xd209('0x3'),_0xd209('0x3')];var channels={};function writeDB(_0x46f5a2){utils[_0xd209('0x7')](util[_0xd209('0x8')](_0xd209('0x9'),_0x46f5a2['uniqueid'],_0x46f5a2[_0xd209('0xa')],_0x46f5a2[_0xd209('0xb')],_0x46f5a2[_0xd209('0xc')],_0x46f5a2[_0xd209('0xd')],_0x46f5a2[_0xd209('0xe')],_0x46f5a2['callerid'],_0x46f5a2['disposition']));if(_0x46f5a2['accountcode']){utils[_0xd209('0xf')](_0x46f5a2[_0xd209('0xc')])['then'](function(_0x3f71fc){if(_0x3f71fc){_0x46f5a2[_0xd209('0x10')]=_0x3f71fc['id'];}utils[_0xd209('0x11')](_0xd209('0x12'),_0x46f5a2);});}else{utils[_0xd209('0x11')](_0xd209('0x12'),_0x46f5a2);}if(channels[_0x46f5a2[_0xd209('0x13')]]){delete channels[_0x46f5a2[_0xd209('0x13')]];}}exports[_0xd209('0x14')]=function(_0x57d784){try{if(_0x57d784[_0xd209('0x13')]==_0x57d784[_0xd209('0x15')]&&_0x57d784[_0xd209('0xa')]!=_0xd209('0x16')){channels[_0x57d784['uniqueid']]={'uniqueid':_0x57d784[_0xd209('0x13')],'accountcode':_0x57d784[_0xd209('0xc')],'source':_0x57d784[_0xd209('0x17')],'destination':_0x57d784[_0xd209('0x18')],'destinationcontext':_0x57d784[_0xd209('0x19')],'channel':_0x57d784[_0xd209('0xa')],'starttime':utils[_0xd209('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xd209('0x1b')};}}catch(_0x2e39e7){utils['error'](_0x2e39e7[_0xd209('0x1c')]);}};exports[_0xd209('0x1d')]=function(_0x59c07e){try{if(!_[_0xd209('0x1e')](channels[_0x59c07e['uniqueid']])&&_0x59c07e['channelstate']==0x6){if(_['isNil'](channels[_0x59c07e[_0xd209('0x13')]][_0xd209('0x1f')])){channels[_0x59c07e[_0xd209('0x13')]]['systemanswertime']=utils[_0xd209('0x1a')]();}}else if(!_[_0xd209('0x1e')](channels[_0x59c07e[_0xd209('0x15')]])&&_0x59c07e[_0xd209('0x20')]==0x6&&_0x59c07e['context']!=_0xd209('0x21')){channels[_0x59c07e[_0xd209('0x15')]][_0xd209('0xc')]=_0x59c07e[_0xd209('0xc')];channels[_0x59c07e[_0xd209('0x15')]]['destinationchannel']=_0x59c07e[_0xd209('0xa')];if(_[_0xd209('0x1e')](channels[_0x59c07e[_0xd209('0x15')]][_0xd209('0x22')])){channels[_0x59c07e['linkedid']][_0xd209('0x22')]=utils[_0xd209('0x1a')]();}channels[_0x59c07e['linkedid']][_0xd209('0x23')]=dispositions[_[_0xd209('0x24')](_0x59c07e['channelstate'])]||_0xd209('0x5');}}catch(_0x37ff3e){utils[_0xd209('0x25')](_0x37ff3e[_0xd209('0x1c')]);}};exports['hangup']=function(_0x357aa5){try{if(!_[_0xd209('0x1e')](channels[_0x357aa5[_0xd209('0x13')]])){if(_[_0xd209('0x1e')](channels[_0x357aa5[_0xd209('0x13')]][_0xd209('0x26')])){channels[_0x357aa5['uniqueid']]['callerid']=_0x357aa5[_0xd209('0x27')]+'\x20<'+_0x357aa5[_0xd209('0x17')]+'>';}channels[_0x357aa5[_0xd209('0x13')]][_0xd209('0x28')]=utils[_0xd209('0x1a')]();channels[_0x357aa5[_0xd209('0x13')]]['duration']=utils[_0xd209('0x29')](channels[_0x357aa5[_0xd209('0x13')]]['endtime'],channels[_0x357aa5[_0xd209('0x13')]][_0xd209('0x2a')]);channels[_0x357aa5[_0xd209('0x13')]][_0xd209('0x2b')]=channels[_0x357aa5[_0xd209('0x13')]][_0xd209('0x22')]?utils[_0xd209('0x29')](channels[_0x357aa5['uniqueid']][_0xd209('0x28')],channels[_0x357aa5['uniqueid']][_0xd209('0x22')]):0x0;writeDB(channels[_0x357aa5[_0xd209('0x13')]]);}}catch(_0x3af040){utils[_0xd209('0x25')](_0x3af040[_0xd209('0x1c')]);}};exports[_0xd209('0x2c')]=function(_0x565640){try{if(!_[_0xd209('0x1e')](channels[_0x565640[_0xd209('0x2d')]])){if(channels[_0x565640[_0xd209('0x2d')]]['channel']==_0x565640[_0xd209('0x2e')]){channels[_0x565640['localtwolinkedid']][_0xd209('0x2f')]=_0x565640[_0xd209('0x30')];channels[_0x565640[_0xd209('0x2d')]][_0xd209('0x31')]=_0xd209('0x32');}else if(channels[_0x565640[_0xd209('0x2d')]][_0xd209('0xa')]=_0x565640['transfertargetchannel']){channels[_0x565640[_0xd209('0x2d')]][_0xd209('0x2f')]=_0x565640[_0xd209('0x33')];channels[_0x565640['localtwolinkedid']][_0xd209('0x31')]='_attended';}}}catch(_0xf2ef6f){utils[_0xd209('0x25')](_0xf2ef6f['stack']);}};exports['musiconholdstart']=function(_0x2d3513){try{if(!_[_0xd209('0x1e')](channels[_0x2d3513[_0xd209('0x13')]])){channels[_0x2d3513['uniqueid']][_0xd209('0x34')]=utils[_0xd209('0x1a')]();}}catch(_0x17ee20){utils['error'](_0x17ee20[_0xd209('0x1c')]);}};exports[_0xd209('0x35')]=function(_0x26b90d){try{if(!_[_0xd209('0x1e')](channels[_0x26b90d[_0xd209('0x13')]])){if(!_[_0xd209('0x1e')](channels[_0x26b90d[_0xd209('0x13')]][_0xd209('0x34')])){channels[_0x26b90d[_0xd209('0x13')]][_0xd209('0x36')]+=utils[_0xd209('0x29')](utils[_0xd209('0x1a')](),channels[_0x26b90d['uniqueid']]['musiconholdstartAt']);delete channels[_0x26b90d[_0xd209('0x13')]][_0xd209('0x34')];}}}catch(_0x1f05cf){utils[_0xd209('0x25')](_0x1f05cf['stack']);}};exports['varset']=function(_0x3214e2){try{if(!_[_0xd209('0x1e')](channels[_0x3214e2[_0xd209('0x13')]])){if(!_[_0xd209('0x1e')](_0x3214e2[_0xd209('0x37')][_0xd209('0x38')])){channels[_0x3214e2['uniqueid']][_0xd209('0xd')]=_0x3214e2[_0xd209('0x39')];}if(!_[_0xd209('0x1e')](_0x3214e2[_0xd209('0x37')][_0xd209('0x3a')])){channels[_0x3214e2[_0xd209('0x13')]][_0xd209('0xe')]=_0x3214e2[_0xd209('0x39')];channels[_0x3214e2[_0xd209('0x13')]][_0xd209('0x26')]='\x22'+_0x3214e2[_0xd209('0x39')]+'\x22\x20<'+_0x3214e2[_0xd209('0x39')]+'>';}if(!_['isNil'](_0x3214e2[_0xd209('0x37')][_0xd209('0x3b')])||!_[_0xd209('0x1e')](_0x3214e2[_0xd209('0x37')][_0xd209('0x3c')])){channels[_0x3214e2['uniqueid']]['callerid']=_0x3214e2[_0xd209('0x39')];}if(!_[_0xd209('0x1e')](_0x3214e2[_0xd209('0x37')]['xmd-queue'])||!_[_0xd209('0x1e')](_0x3214e2[_0xd209('0x37')][_0xd209('0x3d')])){channels[_0x3214e2[_0xd209('0x13')]]['lastapplication']=_0xd209('0x3e');channels[_0x3214e2['uniqueid']]['lastdata']=_0x3214e2[_0xd209('0x39')];channels[_0x3214e2[_0xd209('0x13')]]['queue']=!![];}if(!_[_0xd209('0x1e')](_0x3214e2[_0xd209('0x37')]['xmd-contactid'])){channels[_0x3214e2[_0xd209('0x13')]]['ContactId']=_0x3214e2[_0xd209('0x39')];}if(!_[_0xd209('0x1e')](_0x3214e2[_0xd209('0x37')][_0xd209('0x3f')])){channels[_0x3214e2[_0xd209('0x13')]][_0xd209('0xb')]=_0x3214e2['value'];}if(!_['isNil'](_0x3214e2[_0xd209('0x37')][_0xd209('0x40')])){channels[_0x3214e2[_0xd209('0x13')]][_0xd209('0x41')]=_0x3214e2[_0xd209('0x39')];}if(!_[_0xd209('0x1e')](_0x3214e2[_0xd209('0x37')][_0xd209('0x42')])){channels[_0x3214e2[_0xd209('0x13')]][_0xd209('0x42')]=_0x3214e2['value'];}}}catch(_0x580ff3){utils[_0xd209('0x25')](_0x580ff3['stack']);}};exports[_0xd209('0x43')]=function(_0x59be3f){try{if(!_[_0xd209('0x1e')](channels[_0x59be3f[_0xd209('0x13')]])){if(_0x59be3f['application'][_0xd209('0x44')]()=='set'&&_[_0xd209('0x45')](_0x59be3f[_0xd209('0x46')][_0xd209('0x44')](),_0xd209('0x47'))){var _0x45359d=_0x59be3f['appdata']['split']('=');var _0x46b1fa=_0x45359d[0x0][_0xd209('0x48')](_0x45359d[0x0][_0xd209('0x49')]('(')+0x1,_0x45359d[0x0]['lastIndexOf'](')'));var _0x23be0c=_0x45359d[0x1];channels[_0x59be3f[_0xd209('0x13')]][_0x46b1fa]=_0x23be0c;}if(!_['includes'](['hangup',_0xd209('0x4a'),'execif',_0xd209('0x4b'),_0xd209('0x4c')],_0x59be3f['application'][_0xd209('0x44')]())){channels[_0x59be3f[_0xd209('0x13')]][_0xd209('0x4d')]=_0x59be3f[_0xd209('0x4e')];channels[_0x59be3f[_0xd209('0x13')]]['lastdata']=_0x59be3f[_0xd209('0x46')];}}}catch(_0x21d98d){utils['error'](_0x21d98d[_0xd209('0x1c')]);}};
\ No newline at end of file
index 9db10b6..a2be4bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['CLOSE','managerevent','./utils','connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error'];(function(_0x5b0d01,_0x7d9da0){var _0x410fb5=function(_0xf41df3){while(--_0xf41df3){_0x5b0d01['push'](_0x5b0d01['shift']());}};_0x410fb5(++_0x7d9da0);}(_0x4975,0x86));var _0x5497=function(_0x5bb095,_0x62bc2a){_0x5bb095=_0x5bb095-0x0;var _0x57d33d=_0x4975[_0x5bb095];return _0x57d33d;};'use strict';var utils=require(_0x5497('0x0'));var _=require('lodash');exports[_0x5497('0x1')]=function(){utils[_0x5497('0x2')](_0x5497('0x3'));};exports[_0x5497('0x4')]=function(){utils[_0x5497('0x2')](_0x5497('0x5'));};exports[_0x5497('0x6')]=function(){utils[_0x5497('0x2')](_0x5497('0x7'));};exports[_0x5497('0x8')]=function(_0x539a27){utils[_0x5497('0x8')](_0x539a27);};exports['close']=function(){utils[_0x5497('0x2')](_0x5497('0x9'));};exports[_0x5497('0xa')]=function(_0x57f930){};
\ No newline at end of file
+var _0x7046=['shutdown','SHUTDOWN','FULLYBOOTED','error','./utils','lodash','connect','info'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x7046,0x144));var _0x6704=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7046[_0x4e676e];return _0x336a3c;};'use strict';var utils=require(_0x6704('0x0'));var _=require(_0x6704('0x1'));exports[_0x6704('0x2')]=function(){utils[_0x6704('0x3')]('CONNECTED');};exports[_0x6704('0x4')]=function(){utils[_0x6704('0x3')](_0x6704('0x5'));};exports['fullybooted']=function(){utils[_0x6704('0x3')](_0x6704('0x6'));};exports[_0x6704('0x7')]=function(_0x626a14){utils[_0x6704('0x7')](_0x626a14);};exports['close']=function(){utils[_0x6704('0x3')]('CLOSE');};exports['managerevent']=function(_0x390ace){};
\ No newline at end of file
index e474d80..632ca37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe361=['starttime','now','lastevent','called','stack','dialend','ANSWER','answertime','connect','hangup','duration','diffTime','endtime','holdtime','billableseconds','util','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','appdata','cdr(routeid)','error','variable','outboundrouteid','value','dialbegin','isNil','assign'];(function(_0xee57da,_0x239ff4){var _0x435af6=function(_0x275e3d){while(--_0x275e3d){_0xee57da['push'](_0xee57da['shift']());}};_0x435af6(++_0x239ff4);}(_0xe361,0x7e));var _0x1e36=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0xe361[_0x459423];return _0x42ed14;};'use strict';var _=require('lodash');var util=require(_0x1e36('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x4ff22b){utils['info'](util['format']('DIAL|%s|%s|%s|%s|%s|%s',_0x4ff22b[_0x1e36('0x1')],_0x4ff22b[_0x1e36('0x2')],_0x4ff22b[_0x1e36('0x3')],_0x4ff22b[_0x1e36('0x4')],_0x4ff22b[_0x1e36('0x5')],_0x4ff22b[_0x1e36('0x6')]));utils[_0x1e36('0x7')](_0x1e36('0x8'),_0x4ff22b);delete dials[_0x4ff22b[_0x1e36('0x1')]];}exports[_0x1e36('0x9')]=function(_0x23f8ef){try{if(_0x23f8ef[_0x1e36('0xa')][_0x1e36('0xb')]()==_0x1e36('0xc')&&_['startsWith'](_0x23f8ef[_0x1e36('0xd')]['toLowerCase'](),_0x1e36('0xe'))){var _0x84f564=_0x23f8ef['appdata']['split']('=');dials[_0x23f8ef[_0x1e36('0x1')]]={'routeId':_0x84f564[0x1]};}}catch(_0x458f87){utils[_0x1e36('0xf')](_0x458f87['stack']);}};exports['varset']=function(_0xcb4d5c){try{if(!_['isNil'](_0xcb4d5c[_0x1e36('0x10')][_0x1e36('0x11')])){dials[_0xcb4d5c[_0x1e36('0x1')]]={'routeId':_0xcb4d5c[_0x1e36('0x12')]};}}catch(_0x22c700){utils[_0x1e36('0xf')](_0x22c700['stack']);}};exports[_0x1e36('0x13')]=function(_0x1838f4){try{if(!_[_0x1e36('0x14')](dials[_0x1838f4[_0x1e36('0x1')]])){dials[_0x1838f4[_0x1e36('0x1')]]=_[_0x1e36('0x15')](dials[_0x1838f4['uniqueid']],_0x1838f4);dials[_0x1838f4['uniqueid']][_0x1e36('0x16')]=utils[_0x1e36('0x17')]();dials[_0x1838f4[_0x1e36('0x1')]][_0x1e36('0x18')]=_0x1e36('0x19');}}catch(_0x5349fc){utils[_0x1e36('0xf')](_0x5349fc[_0x1e36('0x1a')]);}};exports[_0x1e36('0x1b')]=function(_0x43e771){try{if(!_['isNil'](dials[_0x43e771['uniqueid']])){dials[_0x43e771['uniqueid']]['dialstatus']=_0x43e771[_0x1e36('0x6')];if(_0x43e771[_0x1e36('0x6')]==_0x1e36('0x1c')){dials[_0x43e771['uniqueid']]=_[_0x1e36('0x15')](dials[_0x43e771['uniqueid']],_0x43e771);dials[_0x43e771['uniqueid']][_0x1e36('0x1d')]=utils['now']();dials[_0x43e771[_0x1e36('0x1')]][_0x1e36('0x18')]=_0x1e36('0x1e');}}}catch(_0x222ac7){utils['error'](_0x222ac7[_0x1e36('0x1a')]);}};exports[_0x1e36('0x1f')]=function(_0x5e10a1){try{if(!_[_0x1e36('0x14')](dials[_0x5e10a1[_0x1e36('0x1')]])){dials[_0x5e10a1[_0x1e36('0x1')]]=_[_0x1e36('0x15')](dials[_0x5e10a1[_0x1e36('0x1')]],{'endtime':utils[_0x1e36('0x17')](),'lastevent':'complete'});dials[_0x5e10a1[_0x1e36('0x1')]][_0x1e36('0x20')]=utils[_0x1e36('0x21')](dials[_0x5e10a1[_0x1e36('0x1')]][_0x1e36('0x22')],dials[_0x5e10a1[_0x1e36('0x1')]]['starttime']);dials[_0x5e10a1['uniqueid']][_0x1e36('0x23')]=utils['diffTime'](dials[_0x5e10a1[_0x1e36('0x1')]][_0x1e36('0x1d')]||dials[_0x5e10a1[_0x1e36('0x1')]][_0x1e36('0x22')],dials[_0x5e10a1['uniqueid']][_0x1e36('0x16')]);dials[_0x5e10a1[_0x1e36('0x1')]][_0x1e36('0x24')]=dials[_0x5e10a1[_0x1e36('0x1')]][_0x1e36('0x1d')]?utils[_0x1e36('0x21')](dials[_0x5e10a1[_0x1e36('0x1')]][_0x1e36('0x22')],dials[_0x5e10a1[_0x1e36('0x1')]][_0x1e36('0x1d')]):0x0;writeDB(dials[_0x5e10a1[_0x1e36('0x1')]]);}}catch(_0x24ac80){utils[_0x1e36('0xf')](_0x24ac80[_0x1e36('0x1a')]);}};
\ No newline at end of file
+var _0x62a5=['dialend','isNil','dialstatus','ANSWER','answertime','lastevent','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','uniqueid','channel','dialstring','request','CreateVoiceDialReport','application','toLowerCase','appdata','split','stack','varset','value','error','dialbegin','assign','starttime','now','called'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x62a5,0x14b));var _0x562a=function(_0x57e535,_0x2861f7){_0x57e535=_0x57e535-0x0;var _0x40bf4f=_0x62a5[_0x57e535];return _0x40bf4f;};'use strict';var _=require(_0x562a('0x0'));var util=require(_0x562a('0x1'));var utils=require(_0x562a('0x2'));var dials={};function writeDB(_0x2d51f1){utils['info'](util['format']('DIAL|%s|%s|%s|%s|%s|%s',_0x2d51f1[_0x562a('0x3')],_0x2d51f1[_0x562a('0x4')],_0x2d51f1[_0x562a('0x5')],_0x2d51f1['calleridnum'],_0x2d51f1['connectedlinenum'],_0x2d51f1['dialstatus']));utils[_0x562a('0x6')](_0x562a('0x7'),_0x2d51f1);delete dials[_0x2d51f1[_0x562a('0x3')]];}exports['newexten']=function(_0x5e6808){try{if(_0x5e6808[_0x562a('0x8')][_0x562a('0x9')]()=='set'&&_['startsWith'](_0x5e6808[_0x562a('0xa')][_0x562a('0x9')](),'cdr(routeid)')){var _0x3ad706=_0x5e6808[_0x562a('0xa')][_0x562a('0xb')]('=');dials[_0x5e6808[_0x562a('0x3')]]={'routeId':_0x3ad706[0x1]};}}catch(_0x24f128){utils['error'](_0x24f128[_0x562a('0xc')]);}};exports[_0x562a('0xd')]=function(_0x4b87d1){try{if(!_['isNil'](_0x4b87d1['variable']['outboundrouteid'])){dials[_0x4b87d1[_0x562a('0x3')]]={'routeId':_0x4b87d1[_0x562a('0xe')]};}}catch(_0x142863){utils[_0x562a('0xf')](_0x142863[_0x562a('0xc')]);}};exports[_0x562a('0x10')]=function(_0x212ef6){try{if(!_['isNil'](dials[_0x212ef6[_0x562a('0x3')]])){dials[_0x212ef6[_0x562a('0x3')]]=_[_0x562a('0x11')](dials[_0x212ef6[_0x562a('0x3')]],_0x212ef6);dials[_0x212ef6['uniqueid']][_0x562a('0x12')]=utils[_0x562a('0x13')]();dials[_0x212ef6[_0x562a('0x3')]]['lastevent']=_0x562a('0x14');}}catch(_0x23962d){utils[_0x562a('0xf')](_0x23962d['stack']);}};exports[_0x562a('0x15')]=function(_0x19f4c4){try{if(!_[_0x562a('0x16')](dials[_0x19f4c4[_0x562a('0x3')]])){dials[_0x19f4c4['uniqueid']][_0x562a('0x17')]=_0x19f4c4[_0x562a('0x17')];if(_0x19f4c4['dialstatus']==_0x562a('0x18')){dials[_0x19f4c4[_0x562a('0x3')]]=_[_0x562a('0x11')](dials[_0x19f4c4[_0x562a('0x3')]],_0x19f4c4);dials[_0x19f4c4[_0x562a('0x3')]][_0x562a('0x19')]=utils[_0x562a('0x13')]();dials[_0x19f4c4[_0x562a('0x3')]][_0x562a('0x1a')]='connect';}}}catch(_0xabab56){utils[_0x562a('0xf')](_0xabab56[_0x562a('0xc')]);}};exports['hangup']=function(_0x26b4fd){try{if(!_['isNil'](dials[_0x26b4fd['uniqueid']])){dials[_0x26b4fd[_0x562a('0x3')]]=_[_0x562a('0x11')](dials[_0x26b4fd[_0x562a('0x3')]],{'endtime':utils[_0x562a('0x13')](),'lastevent':'complete'});dials[_0x26b4fd[_0x562a('0x3')]][_0x562a('0x1b')]=utils[_0x562a('0x1c')](dials[_0x26b4fd[_0x562a('0x3')]][_0x562a('0x1d')],dials[_0x26b4fd[_0x562a('0x3')]]['starttime']);dials[_0x26b4fd[_0x562a('0x3')]][_0x562a('0x1e')]=utils[_0x562a('0x1c')](dials[_0x26b4fd[_0x562a('0x3')]]['answertime']||dials[_0x26b4fd[_0x562a('0x3')]][_0x562a('0x1d')],dials[_0x26b4fd[_0x562a('0x3')]][_0x562a('0x12')]);dials[_0x26b4fd['uniqueid']][_0x562a('0x1f')]=dials[_0x26b4fd[_0x562a('0x3')]][_0x562a('0x19')]?utils['diffTime'](dials[_0x26b4fd[_0x562a('0x3')]]['endtime'],dials[_0x26b4fd[_0x562a('0x3')]][_0x562a('0x19')]):0x0;writeDB(dials[_0x26b4fd['uniqueid']]);}}catch(_0x4e765d){utils[_0x562a('0xf')](_0x4e765d[_0x562a('0xc')]);}};
\ No newline at end of file
index df168fa..5743cd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd337=['connect','shutdown','error','close','managerevent','devicestatechange','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller'];(function(_0xb99e70,_0x1cfe10){var _0x1044e1=function(_0x3cc9ac){while(--_0x3cc9ac){_0xb99e70['push'](_0xb99e70['shift']());}};_0x1044e1(++_0x1cfe10);}(_0xd337,0x160));var _0x7d33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd337[_0x3dd15e];return _0x231fd0;};var AsteriskManager=require(_0x7d33('0x0'));var config=require(_0x7d33('0x1'));var utils=require(_0x7d33('0x2'));var ami=new AsteriskManager(config[_0x7d33('0x3')][_0x7d33('0x4')],config[_0x7d33('0x3')]['ip'],config[_0x7d33('0x3')][_0x7d33('0x5')],config[_0x7d33('0x3')]['password'],!![]);ami[_0x7d33('0x6')]();if(config[_0x7d33('0x7')]&&config[_0x7d33('0x7')]['disabled']){utils[_0x7d33('0x8')](_0x7d33('0x9'));}else{var agents=require(_0x7d33('0xa'));var calls=require('./calls.controller');var queues=require(_0x7d33('0xb'));var recordings=require(_0x7d33('0xc'));var members=require(_0x7d33('0xd'));var dials=require(_0x7d33('0xe'));var transfers=require(_0x7d33('0xf'));var core=require(_0x7d33('0x10'));ami['on'](_0x7d33('0x11'),core[_0x7d33('0x11')]);ami['on']('shutdown',core[_0x7d33('0x12')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x7d33('0x13'),core[_0x7d33('0x13')]);ami['on'](_0x7d33('0x14'),core[_0x7d33('0x14')]);ami['on'](_0x7d33('0x15'),core['managerevent']);ami['on'](_0x7d33('0x16'),function(_0x46c04d){try{members[_0x7d33('0x16')](_0x46c04d);}catch(_0x4e5bd1){utils[_0x7d33('0x13')](_0x4e5bd1);}});ami['on']('agentcalled',function(_0x24dd5b){try{agents['agentcalled'](_0x24dd5b);}catch(_0xac16af){utils[_0x7d33('0x13')](_0xac16af);}});ami['on'](_0x7d33('0x17'),function(_0x34e473){try{agents[_0x7d33('0x17')](_0x34e473);}catch(_0x46fcc3){utils[_0x7d33('0x13')](_0x46fcc3);}});ami['on'](_0x7d33('0x18'),function(_0x21a9e6){try{agents[_0x7d33('0x18')](_0x21a9e6);queues[_0x7d33('0x18')](_0x21a9e6);}catch(_0x445915){utils[_0x7d33('0x13')](_0x445915);}});ami['on'](_0x7d33('0x19'),function(_0x39c2cd){try{agents[_0x7d33('0x19')](_0x39c2cd);queues[_0x7d33('0x19')](_0x39c2cd);members[_0x7d33('0x19')](_0x39c2cd);}catch(_0x15c0e3){utils[_0x7d33('0x13')](_0x15c0e3);}});ami['on'](_0x7d33('0x1a'),function(_0x3ea1e3){try{agents['queuecallerabandon'](_0x3ea1e3);queues[_0x7d33('0x1a')](_0x3ea1e3);}catch(_0x5be89c){utils[_0x7d33('0x13')](_0x5be89c);}});ami['on']('queuecallerjoin',function(_0x249513){try{queues['queuecallerjoin'](_0x249513);recordings[_0x7d33('0x1b')](_0x249513);}catch(_0x11a67a){utils[_0x7d33('0x13')](_0x11a67a);}});ami['on'](_0x7d33('0x1c'),function(_0x5e5014){try{queues['queuecallerleave'](_0x5e5014);}catch(_0x68b7b5){utils[_0x7d33('0x13')](_0x68b7b5);}});ami['on'](_0x7d33('0x1d'),function(_0x295456){try{queues[_0x7d33('0x1d')](_0x295456);calls[_0x7d33('0x1d')](_0x295456);}catch(_0x14c750){utils['error'](_0x14c750);}});ami['on'](_0x7d33('0x1e'),function(_0x23691a){try{queues[_0x7d33('0x1e')](_0x23691a);calls[_0x7d33('0x1e')](_0x23691a);}catch(_0x19d303){utils[_0x7d33('0x13')](_0x19d303);}});ami['on']('newstate',function(_0x4845bf){try{calls[_0x7d33('0x1f')](_0x4845bf);recordings[_0x7d33('0x1f')](_0x4845bf);}catch(_0x2e19da){utils[_0x7d33('0x13')](_0x2e19da);}});ami['on'](_0x7d33('0x20'),function(_0x25d1dd){try{calls['hangup'](_0x25d1dd);recordings[_0x7d33('0x20')](_0x25d1dd);dials[_0x7d33('0x20')](_0x25d1dd);agents[_0x7d33('0x20')](_0x25d1dd);queues[_0x7d33('0x20')](_0x25d1dd);}catch(_0x4c41dc){utils[_0x7d33('0x13')](_0x4c41dc);}});ami['on'](_0x7d33('0x21'),function(_0x50a5cf){try{members[_0x7d33('0x21')](_0x50a5cf);}catch(_0x45b95c){utils['error'](_0x45b95c);}});ami['on'](_0x7d33('0x22'),function(_0x574b03){try{queues[_0x7d33('0x22')](_0x574b03);agents['blindtransfer'](_0x574b03);transfers['blindtransfer'](_0x574b03);}catch(_0xc2eb14){utils[_0x7d33('0x13')](_0xc2eb14);}});ami['on'](_0x7d33('0x23'),function(_0x5f9f9e){try{queues['attendedtransfer'](_0x5f9f9e);transfers[_0x7d33('0x23')](_0x5f9f9e);agents[_0x7d33('0x23')](_0x5f9f9e);calls[_0x7d33('0x23')](_0x5f9f9e);}catch(_0x6e1fbc){utils[_0x7d33('0x13')](_0x6e1fbc);}});ami['on'](_0x7d33('0x24'),function(_0x131218){try{queues[_0x7d33('0x24')](_0x131218);recordings[_0x7d33('0x24')](_0x131218);calls['varset'](_0x131218);dials[_0x7d33('0x24')](_0x131218);}catch(_0xb66b19){utils['error'](_0xb66b19);}});ami['on'](_0x7d33('0x25'),function(_0x1bf821){try{calls[_0x7d33('0x25')](_0x1bf821);recordings[_0x7d33('0x25')](_0x1bf821);dials[_0x7d33('0x25')](_0x1bf821);}catch(_0x5194f3){utils[_0x7d33('0x13')](_0x5194f3);}});ami['on'](_0x7d33('0x26'),function(_0x5765e0){try{calls[_0x7d33('0x26')](_0x5765e0);recordings[_0x7d33('0x26')](_0x5765e0);}catch(_0x2ee3e2){utils['error'](_0x2ee3e2);}});ami['on']('dialbegin',function(_0x1b3846){try{dials[_0x7d33('0x27')](_0x1b3846);}catch(_0x522a6c){utils[_0x7d33('0x13')](_0x522a6c);}});ami['on'](_0x7d33('0x28'),function(_0x208db3){try{dials[_0x7d33('0x28')](_0x208db3);}catch(_0x196514){utils[_0x7d33('0x13')](_0x196514);}});}
\ No newline at end of file
+var _0x5742=['XDR\x20DISABLED','./agents.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./utils','port','asterisk','username','password','xdr','disabled','info'];(function(_0x2865f0,_0x470cb7){var _0x4c1878=function(_0x5cb26f){while(--_0x5cb26f){_0x2865f0['push'](_0x2865f0['shift']());}};_0x4c1878(++_0x470cb7);}(_0x5742,0x97));var _0x2574=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x5742[_0x2c7618];return _0x5ce3f0;};var AsteriskManager=require(_0x2574('0x0'));var config=require('../../config/environment');var utils=require(_0x2574('0x1'));var ami=new AsteriskManager(config['asterisk'][_0x2574('0x2')],config[_0x2574('0x3')]['ip'],config[_0x2574('0x3')][_0x2574('0x4')],config['asterisk'][_0x2574('0x5')],!![]);ami['keepConnected']();if(config[_0x2574('0x6')]&&config[_0x2574('0x6')][_0x2574('0x7')]){utils[_0x2574('0x8')](_0x2574('0x9'));}else{var agents=require(_0x2574('0xa'));var calls=require('./calls.controller');var queues=require(_0x2574('0xb'));var recordings=require('./recordings.controller');var members=require(_0x2574('0xc'));var dials=require('./dials.controller');var transfers=require(_0x2574('0xd'));var core=require(_0x2574('0xe'));ami['on'](_0x2574('0xf'),core[_0x2574('0xf')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0x2574('0x10'),core[_0x2574('0x10')]);ami['on'](_0x2574('0x11'),core[_0x2574('0x11')]);ami['on'](_0x2574('0x12'),core[_0x2574('0x12')]);ami['on']('managerevent',core[_0x2574('0x13')]);ami['on'](_0x2574('0x14'),function(_0x298720){try{members[_0x2574('0x14')](_0x298720);}catch(_0x44490b){utils[_0x2574('0x11')](_0x44490b);}});ami['on'](_0x2574('0x15'),function(_0x1687a4){try{agents[_0x2574('0x15')](_0x1687a4);}catch(_0x5907f2){utils[_0x2574('0x11')](_0x5907f2);}});ami['on'](_0x2574('0x16'),function(_0x31ca48){try{agents[_0x2574('0x16')](_0x31ca48);}catch(_0x4f6018){utils[_0x2574('0x11')](_0x4f6018);}});ami['on'](_0x2574('0x17'),function(_0x5d3d6a){try{agents[_0x2574('0x17')](_0x5d3d6a);queues[_0x2574('0x17')](_0x5d3d6a);}catch(_0x2020cd){utils[_0x2574('0x11')](_0x2020cd);}});ami['on']('agentcomplete',function(_0x34c82b){try{agents['agentcomplete'](_0x34c82b);queues['agentcomplete'](_0x34c82b);members[_0x2574('0x18')](_0x34c82b);}catch(_0x53ec0c){utils['error'](_0x53ec0c);}});ami['on'](_0x2574('0x19'),function(_0x5f2272){try{agents[_0x2574('0x19')](_0x5f2272);queues[_0x2574('0x19')](_0x5f2272);}catch(_0x20c524){utils[_0x2574('0x11')](_0x20c524);}});ami['on']('queuecallerjoin',function(_0xd009b6){try{queues[_0x2574('0x1a')](_0xd009b6);recordings[_0x2574('0x1a')](_0xd009b6);}catch(_0x30cc69){utils[_0x2574('0x11')](_0x30cc69);}});ami['on'](_0x2574('0x1b'),function(_0x265166){try{queues['queuecallerleave'](_0x265166);}catch(_0x2067f4){utils[_0x2574('0x11')](_0x2067f4);}});ami['on']('musiconholdstart',function(_0x1ff6e4){try{queues[_0x2574('0x1c')](_0x1ff6e4);calls[_0x2574('0x1c')](_0x1ff6e4);}catch(_0x3c8a93){utils[_0x2574('0x11')](_0x3c8a93);}});ami['on']('musiconholdstop',function(_0x55a0de){try{queues[_0x2574('0x1d')](_0x55a0de);calls[_0x2574('0x1d')](_0x55a0de);}catch(_0x1937c8){utils[_0x2574('0x11')](_0x1937c8);}});ami['on'](_0x2574('0x1e'),function(_0x2be6f7){try{calls['newstate'](_0x2be6f7);recordings[_0x2574('0x1e')](_0x2be6f7);}catch(_0x10e0d0){utils[_0x2574('0x11')](_0x10e0d0);}});ami['on']('hangup',function(_0xb7e7d5){try{calls[_0x2574('0x1f')](_0xb7e7d5);recordings['hangup'](_0xb7e7d5);dials[_0x2574('0x1f')](_0xb7e7d5);agents['hangup'](_0xb7e7d5);queues[_0x2574('0x1f')](_0xb7e7d5);}catch(_0x525b53){utils['error'](_0x525b53);}});ami['on'](_0x2574('0x20'),function(_0x533721){try{members[_0x2574('0x20')](_0x533721);}catch(_0xf4773b){utils['error'](_0xf4773b);}});ami['on'](_0x2574('0x21'),function(_0x5611e7){try{queues['blindtransfer'](_0x5611e7);agents['blindtransfer'](_0x5611e7);transfers['blindtransfer'](_0x5611e7);}catch(_0x3e412c){utils['error'](_0x3e412c);}});ami['on']('attendedtransfer',function(_0x4217d6){try{queues['attendedtransfer'](_0x4217d6);transfers[_0x2574('0x22')](_0x4217d6);agents[_0x2574('0x22')](_0x4217d6);calls['attendedtransfer'](_0x4217d6);}catch(_0x3c4704){utils[_0x2574('0x11')](_0x3c4704);}});ami['on'](_0x2574('0x23'),function(_0x57910f){try{queues['varset'](_0x57910f);recordings[_0x2574('0x23')](_0x57910f);calls[_0x2574('0x23')](_0x57910f);dials[_0x2574('0x23')](_0x57910f);}catch(_0x90a401){utils[_0x2574('0x11')](_0x90a401);}});ami['on'](_0x2574('0x24'),function(_0x422dd7){try{calls[_0x2574('0x24')](_0x422dd7);recordings[_0x2574('0x24')](_0x422dd7);dials[_0x2574('0x24')](_0x422dd7);}catch(_0x4aa49a){utils[_0x2574('0x11')](_0x4aa49a);}});ami['on']('newchannel',function(_0x7a328d){try{calls[_0x2574('0x25')](_0x7a328d);recordings[_0x2574('0x25')](_0x7a328d);}catch(_0x405b71){utils[_0x2574('0x11')](_0x405b71);}});ami['on']('dialbegin',function(_0x314f2b){try{dials[_0x2574('0x26')](_0x314f2b);}catch(_0x4d03ae){utils[_0x2574('0x11')](_0x4d03ae);}});ami['on'](_0x2574('0x27'),function(_0x4637fc){try{dials['dialend'](_0x4637fc);}catch(_0x56b0cb){utils[_0x2574('0x11')](_0x56b0cb);}});}
\ No newline at end of file
index 18e32ad..2009f34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cfc=['source','destination','exitAt','destinationchannel','split','data3','util','./utils','Queue:','format','channel','data2','membername','type','interface','getUserByInterface','then','internal','request','getUserByName','name','catch','error','some','startsWith','devicestatechange','INUSE','device','TALKING','now','NOT_INUSE','isNil','duration','diffTime','uniqueid','agentcomplete','assign','queue','cdr','data1'];(function(_0x470178,_0x1aeaa5){var _0x3e29a7=function(_0x322bd5){while(--_0x322bd5){_0x470178['push'](_0x470178['shift']());}};_0x3e29a7(++_0x1aeaa5);}(_0x3cfc,0xa6));var _0xc3cf=function(_0x359674,_0x3faf0e){_0x359674=_0x359674-0x0;var _0x229b6a=_0x3cfc[_0x359674];return _0x229b6a;};'use strict';var _=require('lodash');var util=require(_0xc3cf('0x0'));var utils=require(_0xc3cf('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xc3cf('0x2')];function writeDB(_0x153112){utils['info'](util[_0xc3cf('0x3')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x153112['uniqueid'],_0x153112['interface'],_0x153112[_0xc3cf('0x4')],_0x153112[_0xc3cf('0x5')],_0x153112[_0xc3cf('0x6')],_0x153112[_0xc3cf('0x7')]));if(_0x153112[_0xc3cf('0x8')]){utils[_0xc3cf('0x9')](_0x153112[_0xc3cf('0x8')])[_0xc3cf('0xa')](function(_0x161b58){if(_0x161b58){_0x153112[_0xc3cf('0x6')]=_0x161b58['name'];_0x153112['internal']=_0x161b58[_0xc3cf('0xb')];utils[_0xc3cf('0xc')]('CreateMemberReport',_0x153112);}else{utils[_0xc3cf('0xd')](_0x153112[_0xc3cf('0x8')]['split']('/')[0x1])[_0xc3cf('0xa')](function(_0xc979a){if(_0xc979a){_0x153112['membername']=_0xc979a[_0xc3cf('0xe')];_0x153112[_0xc3cf('0xb')]=_0xc979a[_0xc3cf('0xb')];utils[_0xc3cf('0xc')]('CreateMemberReport',_0x153112);}});}})[_0xc3cf('0xf')](function(_0x50e84b){utils[_0xc3cf('0x10')](_0x50e84b);});}delete members[_0x153112[_0xc3cf('0x8')]];}function startsWith(_0x587805,_0x136f93){return _[_0xc3cf('0x11')](_0x587805,function(_0x3698a9){return _[_0xc3cf('0x12')](_0x136f93,_0x3698a9);});}exports[_0xc3cf('0x13')]=function(_0x32ba87){switch(_0x32ba87['state']){case _0xc3cf('0x14'):case'BUSY':if(!startsWith(exclude,_0x32ba87[_0xc3cf('0x15')])){members[_0x32ba87['device']]={'channel':'voice','interface':_0x32ba87[_0xc3cf('0x15')],'type':_0xc3cf('0x16'),'enterAt':utils[_0xc3cf('0x17')](),'role':'agent'};}break;case _0xc3cf('0x18'):if(!_[_0xc3cf('0x19')](members[_0x32ba87[_0xc3cf('0x15')]])){members[_0x32ba87[_0xc3cf('0x15')]]['exitAt']=utils[_0xc3cf('0x17')]();members[_0x32ba87['device']][_0xc3cf('0x1a')]=utils[_0xc3cf('0x1b')](members[_0x32ba87[_0xc3cf('0x15')]]['exitAt'],members[_0x32ba87[_0xc3cf('0x15')]]['enterAt']);if(members[_0x32ba87[_0xc3cf('0x15')]][_0xc3cf('0x1c')]){writeDB(members[_0x32ba87[_0xc3cf('0x15')]]);}}default:break;}};exports[_0xc3cf('0x1d')]=function(_0x157431){if(!_[_0xc3cf('0x19')](members[_0x157431[_0xc3cf('0x8')]])){members[_0x157431[_0xc3cf('0x8')]]=_[_0xc3cf('0x1e')](members[_0x157431[_0xc3cf('0x8')]],{'data4':_0x157431[_0xc3cf('0x1f')],'uniqueid':_0x157431[_0xc3cf('0x1c')]});}};exports[_0xc3cf('0x20')]=function(_0x3075c0){if(_0x3075c0[_0xc3cf('0x4')]){var _0xb6559c=_0x3075c0[_0xc3cf('0x4')]['split']('-')[0x0];if(!_[_0xc3cf('0x19')](members[_0xb6559c])){members[_0xb6559c]=_[_0xc3cf('0x1e')](members[_0xb6559c],{'data1':members[_0xb6559c][_0xc3cf('0x21')]||_0x3075c0['type'],'data2':members[_0xb6559c][_0xc3cf('0x5')]||_0x3075c0[_0xc3cf('0x22')],'data3':members[_0xb6559c]['data3']||_0x3075c0[_0xc3cf('0x23')],'uniqueid':members[_0xb6559c][_0xc3cf('0x1c')]||_0x3075c0[_0xc3cf('0x1c')]});if(members[_0xb6559c][_0xc3cf('0x24')]){writeDB(members[_0xb6559c]);}}}if(_0x3075c0[_0xc3cf('0x25')]){var _0x44c68f=_0x3075c0[_0xc3cf('0x25')][_0xc3cf('0x26')]('-')[0x0];if(!_[_0xc3cf('0x19')](members[_0x44c68f])){members[_0x44c68f]=_[_0xc3cf('0x1e')](members[_0x44c68f],{'data1':members[_0x44c68f][_0xc3cf('0x21')]||_0x3075c0[_0xc3cf('0x7')],'data2':members[_0x44c68f]['data2']||_0x3075c0[_0xc3cf('0x22')],'data3':members[_0x44c68f][_0xc3cf('0x27')]||_0x3075c0[_0xc3cf('0x23')],'uniqueid':members[_0x44c68f][_0xc3cf('0x1c')]||_0x3075c0[_0xc3cf('0x1c')]});if(members[_0x44c68f][_0xc3cf('0x24')]){writeDB(members[_0x44c68f]);}}}};
\ No newline at end of file
+var _0x199c=['INUSE','BUSY','device','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','enterAt','agentcomplete','assign','cdr','split','data1','data3','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','request','CreateMemberReport','name','internal','catch','error','some','startsWith','devicestatechange','state'];(function(_0x10fb18,_0x2fce92){var _0x5dd09a=function(_0x43ad4f){while(--_0x43ad4f){_0x10fb18['push'](_0x10fb18['shift']());}};_0x5dd09a(++_0x2fce92);}(_0x199c,0x1d6));var _0xc199=function(_0x410f06,_0x20a84e){_0x410f06=_0x410f06-0x0;var _0x4a8a65=_0x199c[_0x410f06];return _0x4a8a65;};'use strict';var _=require(_0xc199('0x0'));var util=require(_0xc199('0x1'));var utils=require(_0xc199('0x2'));var members={};var exclude=[_0xc199('0x3'),_0xc199('0x4')];function writeDB(_0x35706f){utils[_0xc199('0x5')](util['format'](_0xc199('0x6'),_0x35706f[_0xc199('0x7')],_0x35706f[_0xc199('0x8')],_0x35706f[_0xc199('0x9')],_0x35706f[_0xc199('0xa')],_0x35706f[_0xc199('0xb')],_0x35706f[_0xc199('0xc')]));if(_0x35706f['interface']){utils[_0xc199('0xd')](_0x35706f[_0xc199('0x8')])[_0xc199('0xe')](function(_0x3d8bd3){if(_0x3d8bd3){_0x35706f[_0xc199('0xb')]=_0x3d8bd3['name'];_0x35706f['internal']=_0x3d8bd3['internal'];utils[_0xc199('0xf')](_0xc199('0x10'),_0x35706f);}else{utils['getUserByName'](_0x35706f[_0xc199('0x8')]['split']('/')[0x1])['then'](function(_0x439a7f){if(_0x439a7f){_0x35706f[_0xc199('0xb')]=_0x439a7f[_0xc199('0x11')];_0x35706f[_0xc199('0x12')]=_0x439a7f['internal'];utils[_0xc199('0xf')](_0xc199('0x10'),_0x35706f);}});}})[_0xc199('0x13')](function(_0x20b8ea){utils[_0xc199('0x14')](_0x20b8ea);});}delete members[_0x35706f['interface']];}function startsWith(_0x3efa88,_0x2dc040){return _[_0xc199('0x15')](_0x3efa88,function(_0x4a3507){return _[_0xc199('0x16')](_0x2dc040,_0x4a3507);});}exports[_0xc199('0x17')]=function(_0x4ff570){switch(_0x4ff570[_0xc199('0x18')]){case _0xc199('0x19'):case _0xc199('0x1a'):if(!startsWith(exclude,_0x4ff570[_0xc199('0x1b')])){members[_0x4ff570['device']]={'channel':_0xc199('0x1c'),'interface':_0x4ff570[_0xc199('0x1b')],'type':_0xc199('0x1d'),'enterAt':utils['now'](),'role':_0xc199('0x1e')};}break;case _0xc199('0x1f'):if(!_[_0xc199('0x20')](members[_0x4ff570['device']])){members[_0x4ff570[_0xc199('0x1b')]][_0xc199('0x21')]=utils[_0xc199('0x22')]();members[_0x4ff570[_0xc199('0x1b')]][_0xc199('0x23')]=utils[_0xc199('0x24')](members[_0x4ff570[_0xc199('0x1b')]][_0xc199('0x21')],members[_0x4ff570[_0xc199('0x1b')]][_0xc199('0x25')]);if(members[_0x4ff570[_0xc199('0x1b')]][_0xc199('0x7')]){writeDB(members[_0x4ff570[_0xc199('0x1b')]]);}}default:break;}};exports[_0xc199('0x26')]=function(_0x425c4e){if(!_[_0xc199('0x20')](members[_0x425c4e['interface']])){members[_0x425c4e[_0xc199('0x8')]]=_[_0xc199('0x27')](members[_0x425c4e['interface']],{'data4':_0x425c4e['queue'],'uniqueid':_0x425c4e[_0xc199('0x7')]});}};exports[_0xc199('0x28')]=function(_0x47b7b1){if(_0x47b7b1[_0xc199('0x9')]){var _0x38d9b7=_0x47b7b1[_0xc199('0x9')][_0xc199('0x29')]('-')[0x0];if(!_[_0xc199('0x20')](members[_0x38d9b7])){members[_0x38d9b7]=_[_0xc199('0x27')](members[_0x38d9b7],{'data1':members[_0x38d9b7][_0xc199('0x2a')]||_0x47b7b1[_0xc199('0xc')],'data2':members[_0x38d9b7][_0xc199('0xa')]||_0x47b7b1['source'],'data3':members[_0x38d9b7][_0xc199('0x2b')]||_0x47b7b1[_0xc199('0x2c')],'uniqueid':members[_0x38d9b7]['uniqueid']||_0x47b7b1['uniqueid']});if(members[_0x38d9b7][_0xc199('0x21')]){writeDB(members[_0x38d9b7]);}}}if(_0x47b7b1['destinationchannel']){var _0x257d1b=_0x47b7b1['destinationchannel'][_0xc199('0x29')]('-')[0x0];if(!_[_0xc199('0x20')](members[_0x257d1b])){members[_0x257d1b]=_[_0xc199('0x27')](members[_0x257d1b],{'data1':members[_0x257d1b][_0xc199('0x2a')]||_0x47b7b1[_0xc199('0xc')],'data2':members[_0x257d1b][_0xc199('0xa')]||_0x47b7b1['source'],'data3':members[_0x257d1b][_0xc199('0x2b')]||_0x47b7b1[_0xc199('0x2c')],'uniqueid':members[_0x257d1b]['uniqueid']||_0x47b7b1[_0xc199('0x7')]});if(members[_0x257d1b][_0xc199('0x21')]){writeDB(members[_0x257d1b]);}}}};
\ No newline at end of file
index 14ed40f..e642725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94e6=['origtransfererlinkedid','secondtransfererlinkedid','transfertype','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','calleridname','mohtime','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','util','info','format','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','now','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerenterreason','varset','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','position','count','assigned','membername','reason','transfer','TRANSFER','COMPLETEDBY','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x94e6,0xf0));var _0x694e=function(_0x577000,_0x525edd){_0x577000=_0x577000-0x0;var _0x650fb1=_0x94e6[_0x577000];return _0x650fb1;};'use strict';var _=require('lodash');var util=require(_0x694e('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x49cdb7){utils[_0x694e('0x1')](util[_0x694e('0x2')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x49cdb7[_0x694e('0x3')],_0x49cdb7['channel'],_0x49cdb7['queue'],_0x49cdb7[_0x694e('0x4')],_0x49cdb7[_0x694e('0x5')],_0x49cdb7[_0x694e('0x6')],_0x49cdb7[_0x694e('0x7')]));if(_0x49cdb7[_0x694e('0x8')]){utils[_0x694e('0x9')](_0x49cdb7[_0x694e('0x8')])[_0x694e('0xa')](function(_0xf6b594){if(_0xf6b594){_0x49cdb7['type']=_0xf6b594[_0x694e('0xb')];}utils[_0x694e('0xc')]('CreateVoiceQueueReport',_0x49cdb7);});}else{utils[_0x694e('0xc')](_0x694e('0xd'),_0x49cdb7);}if(_0x49cdb7['transfereduniqueid']){delete queues[_0x49cdb7[_0x694e('0xe')]];}else{delete queues[_0x49cdb7[_0x694e('0x3')]];}}exports[_0x694e('0xf')]=function(_0xc919c5){queues[_0xc919c5['uniqueid']]=_[_0x694e('0x10')](_0xc919c5,{'originalposition':_0xc919c5['position'],'queuecallerjoinAt':utils[_0x694e('0x11')](),'mohtime':0x0});};exports[_0x694e('0x12')]=function(_0x9cd0fe){if(!_[_0x694e('0x13')](queues[_0x9cd0fe[_0x694e('0x3')]])){if(queues[_0x9cd0fe[_0x694e('0x3')]]['queuecallerleaveAt']){if(!queues[_0x9cd0fe[_0x694e('0x3')]][_0x694e('0x14')]&&!queues[_0x9cd0fe['uniqueid']][_0x694e('0x15')]){queues[_0x9cd0fe[_0x694e('0x3')]][_0x694e('0x16')]=!![];queues[_0x9cd0fe[_0x694e('0x3')]][_0x694e('0x17')]=utils[_0x694e('0x11')]();queues[_0x9cd0fe['uniqueid']]['queuecallerexitreason']='COMPLETEDBYAGENT';}writeDB(queues[_0x9cd0fe[_0x694e('0x3')]]);}else{if(queues[_0x9cd0fe[_0x694e('0x3')]]['transfereduniqueid']){queues[queues[_0x9cd0fe[_0x694e('0x3')]][_0x694e('0xe')]]=queues[_0x9cd0fe[_0x694e('0x3')]];queues[queues[_0x9cd0fe[_0x694e('0x3')]][_0x694e('0xe')]][_0x694e('0x18')]=0x2;delete queues[_0x9cd0fe['uniqueid']];}}}};exports[_0x694e('0x19')]=function(_0x102aaf){if(!_[_0x694e('0x13')](_0x102aaf[_0x694e('0x1a')][_0x694e('0x1b')])&&_0x102aaf[_0x694e('0x1c')]['toUpperCase']()!==_0x694e('0x1d')){if(!_['isNil'](queues[_0x102aaf[_0x694e('0x3')]])){queues[_0x102aaf[_0x694e('0x3')]]['queuecallerabandon']=![];queues[_0x102aaf[_0x694e('0x3')]][_0x694e('0x1e')]=null;queues[_0x102aaf[_0x694e('0x3')]][_0x694e('0x15')]=!![];queues[_0x102aaf[_0x694e('0x3')]][_0x694e('0x1f')]=utils[_0x694e('0x11')]();queues[_0x102aaf[_0x694e('0x3')]][_0x694e('0x7')]=_0x102aaf[_0x694e('0x1c')][_0x694e('0x20')]();writeDB(queues[_0x102aaf['uniqueid']]);}}else if(!_['isNil'](_0x102aaf[_0x694e('0x1a')][_0x694e('0x21')])){if(!_[_0x694e('0x13')](queues[_0x102aaf['uniqueid']])&&!queues[_0x102aaf[_0x694e('0x3')]]['queuecallerabandon']){queues[_0x102aaf['uniqueid']]['queuecallerabandon']=![];queues[_0x102aaf[_0x694e('0x3')]][_0x694e('0x1e')]=null;queues[_0x102aaf[_0x694e('0x3')]][_0x694e('0x15')]=!![];queues[_0x102aaf[_0x694e('0x3')]][_0x694e('0x1f')]=utils['now']();queues[_0x102aaf[_0x694e('0x3')]][_0x694e('0x7')]=_0x694e('0x22');}}};exports[_0x694e('0x14')]=function(_0x3eb30b){if(!_[_0x694e('0x13')](queues[_0x3eb30b[_0x694e('0x3')]])){queues[_0x3eb30b['uniqueid']][_0x694e('0x15')]=![];queues[_0x3eb30b[_0x694e('0x3')]]['queuecallerexitAt']=null;queues[_0x3eb30b[_0x694e('0x3')]]['queuecallerabandon']=!![];queues[_0x3eb30b[_0x694e('0x3')]][_0x694e('0x1e')]=utils['now']();queues[_0x3eb30b[_0x694e('0x3')]][_0x694e('0x7')]=_0x694e('0x23');}};exports[_0x694e('0x24')]=function(_0x304105){if(!_['isNil'](queues[_0x304105[_0x694e('0x3')]])){queues[_0x304105[_0x694e('0x3')]][_0x694e('0x24')]=!![];queues[_0x304105[_0x694e('0x3')]]['queuecallerleaveAt']=utils[_0x694e('0x11')]();queues[_0x304105[_0x694e('0x3')]][_0x694e('0x25')]=utils[_0x694e('0x26')](queues[_0x304105[_0x694e('0x3')]][_0x694e('0x27')],queues[_0x304105[_0x694e('0x3')]][_0x694e('0x28')]);queues[_0x304105['uniqueid']]['position']=_0x304105[_0x694e('0x29')];queues[_0x304105['uniqueid']][_0x694e('0x2a')]=_0x304105[_0x694e('0x2a')];queues[_0x304105[_0x694e('0x3')]]['connectedlinenum']=_0x304105['connectedlinenum'];queues[_0x304105[_0x694e('0x3')]]['connectedlinename']=_0x304105['connectedlinename'];}};exports['agentconnect']=function(_0xd4c4fa){if(!_[_0x694e('0x13')](queues[_0xd4c4fa[_0x694e('0x3')]])){queues[_0xd4c4fa['uniqueid']]['queuecallerabandon']=![];queues[_0xd4c4fa[_0x694e('0x3')]][_0x694e('0x14')]=![];queues[_0xd4c4fa[_0x694e('0x3')]]['queuecallerabandonAt']=null;queues[_0xd4c4fa[_0x694e('0x3')]][_0x694e('0x15')]=![];queues[_0xd4c4fa['uniqueid']][_0x694e('0x7')]=null;queues[_0xd4c4fa['uniqueid']]['queuecallerexitAt']=null;queues[_0xd4c4fa[_0x694e('0x3')]][_0x694e('0x2b')]=!![];queues[_0xd4c4fa[_0x694e('0x3')]][_0x694e('0x6')]=_0xd4c4fa['destaccountcode'];queues[_0xd4c4fa[_0x694e('0x3')]][_0x694e('0x4')]=_0xd4c4fa['membername'];}};exports['agentcomplete']=function(_0x4f7736){if(!_[_0x694e('0x13')](queues[_0x4f7736['uniqueid']])){if(queues[_0x4f7736['uniqueid']]['queuecallerleaveAt']){queues[_0x4f7736[_0x694e('0x3')]][_0x694e('0x14')]=![];queues[_0x4f7736['uniqueid']][_0x694e('0x14')]=![];queues[_0x4f7736[_0x694e('0x3')]][_0x694e('0x1e')]=null;queues[_0x4f7736['uniqueid']][_0x694e('0x15')]=![];queues[_0x4f7736['uniqueid']]['queuecallerexitAt']=null;queues[_0x4f7736['uniqueid']][_0x694e('0x2b')]=!![];queues[_0x4f7736[_0x694e('0x3')]][_0x694e('0x4')]=_0x4f7736[_0x694e('0x2c')];queues[_0x4f7736[_0x694e('0x3')]][_0x694e('0x16')]=!![];queues[_0x4f7736[_0x694e('0x3')]][_0x694e('0x17')]=utils[_0x694e('0x11')]();if(_0x4f7736[_0x694e('0x2d')]=='transfer'){if(!queues[_0x4f7736['uniqueid']][_0x694e('0x2e')]){queues[_0x4f7736[_0x694e('0x3')]]['queuecallerexitreason']=_0x694e('0x2f');}}else{queues[_0x4f7736[_0x694e('0x3')]][_0x694e('0x7')]=_0x694e('0x30')+_0x4f7736[_0x694e('0x2d')]['toUpperCase']();}writeDB(queues[_0x4f7736['uniqueid']]);}}};exports['blindtransfer']=function(_0x4b0eb8){if(!_[_0x694e('0x13')](queues[_0x4b0eb8[_0x694e('0x31')]])){queues[_0x4b0eb8[_0x694e('0x31')]][_0x694e('0x2e')]=!![];queues[_0x4b0eb8[_0x694e('0x31')]]['transfertype']=_0x694e('0x32');queues[_0x4b0eb8['transfereeuniqueid']][_0x694e('0x33')]=_0x4b0eb8[_0x694e('0x34')];queues[_0x4b0eb8[_0x694e('0x31')]][_0x694e('0x35')]=_0x4b0eb8[_0x694e('0x31')];queues[_0x4b0eb8[_0x694e('0x31')]][_0x694e('0x7')]=_0x694e('0x36');}};exports['attendedtransfer']=function(_0x56e376){try{if(_0x56e376[_0x694e('0x37')]==_0x56e376[_0x694e('0x38')]){if(!_['isNil'](queues[_0x56e376[_0x694e('0x39')]])){queues[_0x56e376[_0x694e('0x39')]]['transfer']=!![];queues[_0x56e376['secondtransfererlinkedid']][_0x694e('0x3a')]='ATTENDED';queues[_0x56e376[_0x694e('0x39')]]['transferexten']=_0x56e376[_0x694e('0x3b')];queues[_0x56e376[_0x694e('0x39')]][_0x694e('0x35')]=_0x56e376[_0x694e('0x37')];queues[_0x56e376[_0x694e('0x39')]]['queuecallerexitreason']=_0x694e('0x3c');}if(!_[_0x694e('0x13')](queues[_0x56e376[_0x694e('0x38')]])){if(_0x56e376[_0x694e('0x3d')]&&queues[_0x56e376[_0x694e('0x3d')]]){queues[_0x56e376[_0x694e('0x3d')]]['queuecallerenterreason']=0x1;queues[_0x56e376['transfereeuniqueid']]=_[_0x694e('0x3e')](queues[_0x56e376[_0x694e('0x3d')]]);queues[_0x56e376['transfereeuniqueid']][_0x694e('0xe')]=_0x56e376[_0x694e('0x3f')];queues[_0x56e376['transfereeuniqueid']][_0x694e('0x18')]=0x2;queues[_0x56e376[_0x694e('0x31')]]['calleridnum']=queues[_0x56e376['secondtransfererlinkedid']][_0x694e('0x5')];queues[_0x56e376[_0x694e('0x31')]]['calleridname']=queues[_0x56e376['secondtransfererlinkedid']]['calleridname'];queues[_0x56e376[_0x694e('0x31')]][_0x694e('0x28')]=utils[_0x694e('0x11')]();queues[_0x56e376[_0x694e('0x31')]][_0x694e('0x27')]=utils[_0x694e('0x11')]();queues[_0x56e376[_0x694e('0x31')]][_0x694e('0x25')]=0x0;queues[_0x56e376[_0x694e('0x31')]]['mohtime']=0x0;}else{queues[_0x56e376[_0x694e('0x38')]][_0x694e('0xe')]=_0x56e376[_0x694e('0x39')];}}}else if(_0x56e376[_0x694e('0x40')]==_0x56e376[_0x694e('0x39')]){if(!_[_0x694e('0x13')](queues[_0x56e376[_0x694e('0x38')]])){queues[_0x56e376[_0x694e('0x38')]][_0x694e('0x2e')]=!![];queues[_0x56e376[_0x694e('0x38')]][_0x694e('0x3a')]=_0x694e('0x41');queues[_0x56e376['origtransfererlinkedid']]['transferexten']=_0x56e376[_0x694e('0x42')];queues[_0x56e376[_0x694e('0x38')]][_0x694e('0x35')]=_0x56e376[_0x694e('0x40')];queues[_0x56e376[_0x694e('0x38')]][_0x694e('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x694e('0x13')](queues[_0x56e376[_0x694e('0x39')]])){if(_0x56e376[_0x694e('0x43')]&&queues[_0x56e376[_0x694e('0x43')]]){queues[_0x56e376[_0x694e('0x43')]][_0x694e('0x18')]=0x1;queues[_0x56e376[_0x694e('0x3f')]]=_[_0x694e('0x3e')](queues[_0x56e376[_0x694e('0x43')]]);queues[_0x56e376['transfertargetuniqueid']][_0x694e('0xe')]=_0x56e376[_0x694e('0x3f')];queues[_0x56e376[_0x694e('0x3f')]][_0x694e('0x18')]=0x2;queues[_0x56e376['transfertargetuniqueid']][_0x694e('0x5')]=queues[_0x56e376[_0x694e('0x38')]][_0x694e('0x5')];queues[_0x56e376[_0x694e('0x3f')]][_0x694e('0x44')]=queues[_0x56e376[_0x694e('0x38')]]['calleridname'];queues[_0x56e376[_0x694e('0x3f')]][_0x694e('0x28')]=utils[_0x694e('0x11')]();queues[_0x56e376['transfertargetuniqueid']][_0x694e('0x27')]=utils[_0x694e('0x11')]();queues[_0x56e376[_0x694e('0x3f')]][_0x694e('0x25')]=0x0;queues[_0x56e376['transfertargetuniqueid']][_0x694e('0x45')]=0x0;}else{queues[_0x56e376['secondtransfererlinkedid']][_0x694e('0xe')]=_0x56e376[_0x694e('0x38')];}}}}catch(_0x24aacc){utils['error'](_0x24aacc[_0x694e('0x46')]);}};exports[_0x694e('0x47')]=function(_0x489003){if(!_[_0x694e('0x13')](queues[_0x489003[_0x694e('0x3')]])){queues[_0x489003[_0x694e('0x3')]][_0x694e('0x48')]=utils[_0x694e('0x11')]();}};exports[_0x694e('0x49')]=function(_0x17782e){if(!_[_0x694e('0x13')](queues[_0x17782e['uniqueid']])){if(!_[_0x694e('0x13')](queues[_0x17782e[_0x694e('0x3')]][_0x694e('0x48')])){queues[_0x17782e[_0x694e('0x3')]]['mohtime']+=utils[_0x694e('0x26')](utils[_0x694e('0x11')](),queues[_0x17782e[_0x694e('0x3')]][_0x694e('0x48')]);delete queues[_0x17782e[_0x694e('0x3')]]['musiconholdstartAt'];}}};
\ No newline at end of file
+var _0x71ed=['queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','value','toUpperCase','CONTINUE','queueposition','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','accountcode','destaccountcode','membername','agentcomplete','assigned','reason','transfer','TRANSFER','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfertype','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','musiconholdstart','musiconholdstop','musiconholdstartAt','lodash','./utils','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','lastAssignedTo','calleridnum','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','now','hangup','isNil','uniqueid','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x71ed,0x128));var _0xd71e=function(_0x133d40,_0x49ebfc){_0x133d40=_0x133d40-0x0;var _0x4e480d=_0x71ed[_0x133d40];return _0x4e480d;};'use strict';var _=require(_0xd71e('0x0'));var util=require('util');var utils=require(_0xd71e('0x1'));var queues={};function writeDB(_0x27ad7d){utils['info'](util[_0xd71e('0x2')](_0xd71e('0x3'),_0x27ad7d['uniqueid'],_0x27ad7d[_0xd71e('0x4')],_0x27ad7d[_0xd71e('0x5')],_0x27ad7d[_0xd71e('0x6')],_0x27ad7d[_0xd71e('0x7')],_0x27ad7d['accountcode'],_0x27ad7d['queuecallerexitreason']));if(_0x27ad7d['queue']){utils['getVoiceQueueByName'](_0x27ad7d[_0xd71e('0x5')])[_0xd71e('0x8')](function(_0x6cfe29){if(_0x6cfe29){_0x27ad7d[_0xd71e('0x9')]=_0x6cfe29['type'];}utils['request']('CreateVoiceQueueReport',_0x27ad7d);});}else{utils[_0xd71e('0xa')](_0xd71e('0xb'),_0x27ad7d);}if(_0x27ad7d[_0xd71e('0xc')]){delete queues[_0x27ad7d['transfereduniqueid']];}else{delete queues[_0x27ad7d['uniqueid']];}}exports[_0xd71e('0xd')]=function(_0x175ad1){queues[_0x175ad1['uniqueid']]=_[_0xd71e('0xe')](_0x175ad1,{'originalposition':_0x175ad1[_0xd71e('0xf')],'queuecallerjoinAt':utils[_0xd71e('0x10')](),'mohtime':0x0});};exports[_0xd71e('0x11')]=function(_0x963bf4){if(!_[_0xd71e('0x12')](queues[_0x963bf4[_0xd71e('0x13')]])){if(queues[_0x963bf4[_0xd71e('0x13')]][_0xd71e('0x14')]){if(!queues[_0x963bf4[_0xd71e('0x13')]][_0xd71e('0x15')]&&!queues[_0x963bf4[_0xd71e('0x13')]][_0xd71e('0x16')]){queues[_0x963bf4[_0xd71e('0x13')]][_0xd71e('0x17')]=!![];queues[_0x963bf4[_0xd71e('0x13')]][_0xd71e('0x18')]=utils['now']();queues[_0x963bf4[_0xd71e('0x13')]][_0xd71e('0x19')]=_0xd71e('0x1a');}writeDB(queues[_0x963bf4[_0xd71e('0x13')]]);}else{if(queues[_0x963bf4[_0xd71e('0x13')]][_0xd71e('0xc')]){queues[queues[_0x963bf4[_0xd71e('0x13')]][_0xd71e('0xc')]]=queues[_0x963bf4['uniqueid']];queues[queues[_0x963bf4['uniqueid']]['transfereduniqueid']][_0xd71e('0x1b')]=0x2;delete queues[_0x963bf4[_0xd71e('0x13')]];}}}};exports[_0xd71e('0x1c')]=function(_0x5500bf){if(!_['isNil'](_0x5500bf[_0xd71e('0x1d')]['queuestatus'])&&_0x5500bf[_0xd71e('0x1e')][_0xd71e('0x1f')]()!==_0xd71e('0x20')){if(!_[_0xd71e('0x12')](queues[_0x5500bf[_0xd71e('0x13')]])){queues[_0x5500bf[_0xd71e('0x13')]]['queuecallerabandon']=![];queues[_0x5500bf[_0xd71e('0x13')]]['queuecallerabandonAt']=null;queues[_0x5500bf[_0xd71e('0x13')]][_0xd71e('0x16')]=!![];queues[_0x5500bf['uniqueid']]['queuecallerexitAt']=utils[_0xd71e('0x10')]();queues[_0x5500bf[_0xd71e('0x13')]][_0xd71e('0x19')]=_0x5500bf[_0xd71e('0x1e')][_0xd71e('0x1f')]();writeDB(queues[_0x5500bf[_0xd71e('0x13')]]);}}else if(!_[_0xd71e('0x12')](_0x5500bf[_0xd71e('0x1d')][_0xd71e('0x21')])){if(!_[_0xd71e('0x12')](queues[_0x5500bf[_0xd71e('0x13')]])&&!queues[_0x5500bf[_0xd71e('0x13')]][_0xd71e('0x15')]){queues[_0x5500bf[_0xd71e('0x13')]][_0xd71e('0x15')]=![];queues[_0x5500bf[_0xd71e('0x13')]][_0xd71e('0x22')]=null;queues[_0x5500bf[_0xd71e('0x13')]][_0xd71e('0x16')]=!![];queues[_0x5500bf['uniqueid']][_0xd71e('0x23')]=utils[_0xd71e('0x10')]();queues[_0x5500bf[_0xd71e('0x13')]][_0xd71e('0x19')]=_0xd71e('0x24');}}};exports[_0xd71e('0x15')]=function(_0x3ac4de){if(!_[_0xd71e('0x12')](queues[_0x3ac4de[_0xd71e('0x13')]])){queues[_0x3ac4de[_0xd71e('0x13')]][_0xd71e('0x16')]=![];queues[_0x3ac4de[_0xd71e('0x13')]][_0xd71e('0x23')]=null;queues[_0x3ac4de[_0xd71e('0x13')]][_0xd71e('0x15')]=!![];queues[_0x3ac4de[_0xd71e('0x13')]][_0xd71e('0x22')]=utils[_0xd71e('0x10')]();queues[_0x3ac4de[_0xd71e('0x13')]][_0xd71e('0x19')]=_0xd71e('0x25');}};exports[_0xd71e('0x26')]=function(_0x268cb7){if(!_['isNil'](queues[_0x268cb7[_0xd71e('0x13')]])){queues[_0x268cb7['uniqueid']][_0xd71e('0x26')]=!![];queues[_0x268cb7[_0xd71e('0x13')]]['queuecallerleaveAt']=utils[_0xd71e('0x10')]();queues[_0x268cb7[_0xd71e('0x13')]][_0xd71e('0x27')]=utils[_0xd71e('0x28')](queues[_0x268cb7['uniqueid']][_0xd71e('0x14')],queues[_0x268cb7[_0xd71e('0x13')]][_0xd71e('0x29')]);queues[_0x268cb7[_0xd71e('0x13')]][_0xd71e('0xf')]=_0x268cb7['position'];queues[_0x268cb7[_0xd71e('0x13')]][_0xd71e('0x2a')]=_0x268cb7[_0xd71e('0x2a')];queues[_0x268cb7[_0xd71e('0x13')]]['connectedlinenum']=_0x268cb7[_0xd71e('0x2b')];queues[_0x268cb7[_0xd71e('0x13')]][_0xd71e('0x2c')]=_0x268cb7['connectedlinename'];}};exports[_0xd71e('0x2d')]=function(_0x4d0de0){if(!_[_0xd71e('0x12')](queues[_0x4d0de0[_0xd71e('0x13')]])){queues[_0x4d0de0[_0xd71e('0x13')]][_0xd71e('0x15')]=![];queues[_0x4d0de0[_0xd71e('0x13')]][_0xd71e('0x15')]=![];queues[_0x4d0de0[_0xd71e('0x13')]][_0xd71e('0x22')]=null;queues[_0x4d0de0[_0xd71e('0x13')]]['queuecallerexit']=![];queues[_0x4d0de0[_0xd71e('0x13')]][_0xd71e('0x19')]=null;queues[_0x4d0de0[_0xd71e('0x13')]]['queuecallerexitAt']=null;queues[_0x4d0de0[_0xd71e('0x13')]]['assigned']=!![];queues[_0x4d0de0[_0xd71e('0x13')]][_0xd71e('0x2e')]=_0x4d0de0[_0xd71e('0x2f')];queues[_0x4d0de0['uniqueid']][_0xd71e('0x6')]=_0x4d0de0[_0xd71e('0x30')];}};exports[_0xd71e('0x31')]=function(_0x44fccf){if(!_[_0xd71e('0x12')](queues[_0x44fccf[_0xd71e('0x13')]])){if(queues[_0x44fccf[_0xd71e('0x13')]][_0xd71e('0x14')]){queues[_0x44fccf[_0xd71e('0x13')]][_0xd71e('0x15')]=![];queues[_0x44fccf[_0xd71e('0x13')]]['queuecallerabandon']=![];queues[_0x44fccf[_0xd71e('0x13')]][_0xd71e('0x22')]=null;queues[_0x44fccf[_0xd71e('0x13')]]['queuecallerexit']=![];queues[_0x44fccf[_0xd71e('0x13')]][_0xd71e('0x23')]=null;queues[_0x44fccf[_0xd71e('0x13')]][_0xd71e('0x32')]=!![];queues[_0x44fccf[_0xd71e('0x13')]]['lastAssignedTo']=_0x44fccf[_0xd71e('0x30')];queues[_0x44fccf[_0xd71e('0x13')]][_0xd71e('0x17')]=!![];queues[_0x44fccf['uniqueid']][_0xd71e('0x18')]=utils[_0xd71e('0x10')]();if(_0x44fccf[_0xd71e('0x33')]==_0xd71e('0x34')){if(!queues[_0x44fccf[_0xd71e('0x13')]]['transfer']){queues[_0x44fccf['uniqueid']][_0xd71e('0x19')]=_0xd71e('0x35');}}else{queues[_0x44fccf['uniqueid']][_0xd71e('0x19')]='COMPLETEDBY'+_0x44fccf['reason']['toUpperCase']();}writeDB(queues[_0x44fccf['uniqueid']]);}}};exports[_0xd71e('0x36')]=function(_0xd38f9e){if(!_[_0xd71e('0x12')](queues[_0xd38f9e[_0xd71e('0x37')]])){queues[_0xd38f9e[_0xd71e('0x37')]]['transfer']=!![];queues[_0xd38f9e[_0xd71e('0x37')]]['transfertype']=_0xd71e('0x38');queues[_0xd38f9e[_0xd71e('0x37')]][_0xd71e('0x39')]=_0xd38f9e[_0xd71e('0x3a')];queues[_0xd38f9e[_0xd71e('0x37')]][_0xd71e('0x3b')]=_0xd38f9e[_0xd71e('0x37')];queues[_0xd38f9e[_0xd71e('0x37')]][_0xd71e('0x19')]=_0xd71e('0x3c');}};exports['attendedtransfer']=function(_0x1ade7a){try{if(_0x1ade7a[_0xd71e('0x3d')]==_0x1ade7a[_0xd71e('0x3e')]){if(!_['isNil'](queues[_0x1ade7a[_0xd71e('0x3f')]])){queues[_0x1ade7a[_0xd71e('0x3f')]][_0xd71e('0x34')]=!![];queues[_0x1ade7a[_0xd71e('0x3f')]][_0xd71e('0x40')]=_0xd71e('0x41');queues[_0x1ade7a[_0xd71e('0x3f')]]['transferexten']=_0x1ade7a[_0xd71e('0x42')];queues[_0x1ade7a[_0xd71e('0x3f')]][_0xd71e('0x3b')]=_0x1ade7a[_0xd71e('0x3d')];queues[_0x1ade7a[_0xd71e('0x3f')]][_0xd71e('0x19')]=_0xd71e('0x43');}if(!_[_0xd71e('0x12')](queues[_0x1ade7a[_0xd71e('0x3e')]])){if(_0x1ade7a[_0xd71e('0x44')]&&queues[_0x1ade7a[_0xd71e('0x44')]]){queues[_0x1ade7a[_0xd71e('0x44')]][_0xd71e('0x1b')]=0x1;queues[_0x1ade7a[_0xd71e('0x37')]]=_[_0xd71e('0x45')](queues[_0x1ade7a[_0xd71e('0x44')]]);queues[_0x1ade7a['transfereeuniqueid']]['transfereduniqueid']=_0x1ade7a[_0xd71e('0x46')];queues[_0x1ade7a[_0xd71e('0x37')]][_0xd71e('0x1b')]=0x2;queues[_0x1ade7a['transfereeuniqueid']][_0xd71e('0x7')]=queues[_0x1ade7a[_0xd71e('0x3f')]][_0xd71e('0x7')];queues[_0x1ade7a[_0xd71e('0x37')]][_0xd71e('0x47')]=queues[_0x1ade7a[_0xd71e('0x3f')]][_0xd71e('0x47')];queues[_0x1ade7a[_0xd71e('0x37')]]['queuecallerjoinAt']=utils[_0xd71e('0x10')]();queues[_0x1ade7a[_0xd71e('0x37')]][_0xd71e('0x14')]=utils['now']();queues[_0x1ade7a['transfereeuniqueid']][_0xd71e('0x27')]=0x0;queues[_0x1ade7a[_0xd71e('0x37')]][_0xd71e('0x48')]=0x0;}else{queues[_0x1ade7a['origtransfererlinkedid']][_0xd71e('0xc')]=_0x1ade7a[_0xd71e('0x3f')];}}}else if(_0x1ade7a[_0xd71e('0x49')]==_0x1ade7a[_0xd71e('0x3f')]){if(!_[_0xd71e('0x12')](queues[_0x1ade7a[_0xd71e('0x3e')]])){queues[_0x1ade7a[_0xd71e('0x3e')]][_0xd71e('0x34')]=!![];queues[_0x1ade7a['origtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x1ade7a['origtransfererlinkedid']][_0xd71e('0x39')]=_0x1ade7a[_0xd71e('0x4a')];queues[_0x1ade7a[_0xd71e('0x3e')]][_0xd71e('0x3b')]=_0x1ade7a[_0xd71e('0x49')];queues[_0x1ade7a[_0xd71e('0x3e')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0xd71e('0x12')](queues[_0x1ade7a[_0xd71e('0x3f')]])){if(_0x1ade7a[_0xd71e('0x4b')]&&queues[_0x1ade7a['transfertargetlinkedid']]){queues[_0x1ade7a[_0xd71e('0x4b')]]['queuecallerenterreason']=0x1;queues[_0x1ade7a[_0xd71e('0x46')]]=_['clone'](queues[_0x1ade7a[_0xd71e('0x4b')]]);queues[_0x1ade7a[_0xd71e('0x46')]][_0xd71e('0xc')]=_0x1ade7a[_0xd71e('0x46')];queues[_0x1ade7a[_0xd71e('0x46')]][_0xd71e('0x1b')]=0x2;queues[_0x1ade7a[_0xd71e('0x46')]][_0xd71e('0x7')]=queues[_0x1ade7a['origtransfererlinkedid']][_0xd71e('0x7')];queues[_0x1ade7a['transfertargetuniqueid']][_0xd71e('0x47')]=queues[_0x1ade7a['origtransfererlinkedid']][_0xd71e('0x47')];queues[_0x1ade7a[_0xd71e('0x46')]][_0xd71e('0x29')]=utils[_0xd71e('0x10')]();queues[_0x1ade7a[_0xd71e('0x46')]][_0xd71e('0x14')]=utils['now']();queues[_0x1ade7a[_0xd71e('0x46')]][_0xd71e('0x27')]=0x0;queues[_0x1ade7a['transfertargetuniqueid']]['mohtime']=0x0;}else{queues[_0x1ade7a[_0xd71e('0x3f')]][_0xd71e('0xc')]=_0x1ade7a[_0xd71e('0x3e')];}}}}catch(_0x796a1d){utils[_0xd71e('0x4c')](_0x796a1d['stack']);}};exports[_0xd71e('0x4d')]=function(_0x5858e3){if(!_[_0xd71e('0x12')](queues[_0x5858e3[_0xd71e('0x13')]])){queues[_0x5858e3[_0xd71e('0x13')]]['musiconholdstartAt']=utils[_0xd71e('0x10')]();}};exports[_0xd71e('0x4e')]=function(_0x2d7cfe){if(!_[_0xd71e('0x12')](queues[_0x2d7cfe[_0xd71e('0x13')]])){if(!_[_0xd71e('0x12')](queues[_0x2d7cfe[_0xd71e('0x13')]][_0xd71e('0x4f')])){queues[_0x2d7cfe['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0xd71e('0x10')](),queues[_0x2d7cfe[_0xd71e('0x13')]][_0xd71e('0x4f')]);delete queues[_0x2d7cfe[_0xd71e('0x13')]][_0xd71e('0x4f')];}}};
\ No newline at end of file
index 2a66271..c8bf80c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0xd82ba9,_0x4c4b8e){var _0x1d2027=function(_0x27b8ad){while(--_0x27b8ad){_0xd82ba9['push'](_0xd82ba9['shift']());}};_0x1d2027(++_0x4c4b8e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0xcb91[_0x580971];return _0x16d873;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}};
\ No newline at end of file
+var _0x9c44=['getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','uniqueid','linkedid','context','channel','error','stack','isNil','transfer','variable','endsWith','value','replace','.wav49','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode'];(function(_0x63ef0f,_0x27dfd3){var _0x386a8e=function(_0x1dcc9a){while(--_0x1dcc9a){_0x63ef0f['push'](_0x63ef0f['shift']());}};_0x386a8e(++_0x27dfd3);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x1ffbbf){utils[_0x49c4('0x0')](_0x1ffbbf);if(_0x1ffbbf[_0x49c4('0x1')]){utils[_0x49c4('0x2')](_0x1ffbbf[_0x49c4('0x1')])[_0x49c4('0x3')](function(_0x4e0313){if(_0x4e0313){_0x1ffbbf['membername']=_0x4e0313[_0x49c4('0x4')];_0x1ffbbf['UserId']=_0x4e0313['id'];}utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);});}else{utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);}}exports[_0x49c4('0x7')]=function(_0x511d53){try{if(_0x511d53[_0x49c4('0x8')]==_0x511d53[_0x49c4('0x9')]){recordings[_0x511d53[_0x49c4('0x8')]]={'uniqueid':_0x511d53[_0x49c4('0x8')],'accountcode':_0x511d53['accountcode'],'exten':_0x511d53['exten'],'context':_0x511d53[_0x49c4('0xa')],'channel':_0x511d53[_0x49c4('0xb')],'monitors':[]};}}catch(_0x58cad7){utils[_0x49c4('0xc')](_0x58cad7[_0x49c4('0xd')]);}};exports['newstate']=function(_0x536d42){try{if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x8')]])&&_0x536d42['channelstate']==0x6){}else if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x9')]])&&_0x536d42['channelstate']==0x6&&_0x536d42[_0x49c4('0xa')]!=_0x49c4('0xf')){recordings[_0x536d42[_0x49c4('0x9')]][_0x49c4('0x1')]=_0x536d42[_0x49c4('0x1')];}}catch(_0x18211c){utils[_0x49c4('0xc')](_0x18211c[_0x49c4('0xd')]);}};exports['varset']=function(_0x3acd06){try{if(!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')])&&!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')]['mixmonitor_filename'])){if(_[_0x49c4('0x11')](_0x3acd06[_0x49c4('0x12')],'.wav49')){_0x3acd06['value']=_0x3acd06[_0x49c4('0x12')][_0x49c4('0x13')](_0x49c4('0x14'),'.WAV');}if(recordings[_0x3acd06[_0x49c4('0x9')]]){var _0x50b151=_[_0x49c4('0x15')](recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')],{'value':_0x3acd06[_0x49c4('0x12')]});if(_[_0x49c4('0xe')](_0x50b151)){recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')][_0x49c4('0x17')]({'value':_0x3acd06[_0x49c4('0x12')]});}}}}catch(_0x578447){utils['error'](_0x578447['stack']);}};exports[_0x49c4('0x18')]=function(_0x4f0b62){try{if(!_['isNil'](recordings[_0x4f0b62[_0x49c4('0x8')]])){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x19')]=_0x4f0b62[_0x49c4('0x19')];recordings[_0x4f0b62['uniqueid']]['calleridname']=_0x4f0b62[_0x49c4('0x1a')];recordings[_0x4f0b62[_0x49c4('0x8')]]['connectedlinenum']=_0x4f0b62[_0x49c4('0x1b')];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]=_0x4f0b62[_0x49c4('0x1c')];if(recordings[_0x4f0b62['uniqueid']]['type']==_0x49c4('0x1d')&&recordings[_0x4f0b62['uniqueid']][_0x49c4('0x1')]){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1b')]=recordings[_0x4f0b62[_0x49c4('0x8')]]['accountcode'];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]='';}recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x16')][_0x49c4('0x1e')](_0x29f835=>{var _0x26ba17=_[_0x49c4('0x1f')](recordings[_0x4f0b62[_0x49c4('0x8')]]);_0x26ba17[_0x49c4('0x12')]=_0x29f835[_0x49c4('0x12')];writeDB(_0x26ba17);});delete recordings[_0x4f0b62['uniqueid']];}}catch(_0x4f4495){utils['error'](_0x4f4495[_0x49c4('0xd')]);}};exports[_0x49c4('0x20')]=function(_0x1eb035){try{if(!_[_0x49c4('0xe')](recordings[_0x1eb035[_0x49c4('0x8')]])){if(_0x1eb035['application'][_0x49c4('0x21')]()==_0x49c4('0x22')&&_[_0x49c4('0x23')](_0x1eb035[_0x49c4('0x24')]['toLowerCase'](),'cdr')){var _0xce57ef=_0x1eb035[_0x49c4('0x24')][_0x49c4('0x25')]('=');var _0x13b3b4=_0xce57ef[0x0][_0x49c4('0x26')](_0xce57ef[0x0]['lastIndexOf']('(')+0x1,_0xce57ef[0x0][_0x49c4('0x27')](')'));var _0x84c621=_0xce57ef[0x1];recordings[_0x1eb035[_0x49c4('0x8')]][_0x13b3b4]=_0x84c621;}}}catch(_0x512d02){utils['error'](_0x512d02[_0x49c4('0xd')]);}};exports[_0x49c4('0x28')]=function(_0x3bec0a){try{if(!_[_0x49c4('0xe')](recordings[_0x3bec0a[_0x49c4('0x8')]])){recordings[_0x3bec0a[_0x49c4('0x8')]][_0x49c4('0x29')]=_0x3bec0a[_0x49c4('0x29')];}}catch(_0x3209cd){utils['error'](_0x3209cd[_0x49c4('0xd')]);}};
\ No newline at end of file
index 65a8fd5..1f65f0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c84=['secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','TRANSFER|%s','request','type','blind','error','stack','attendedtransfer','origtransfererchannel'];(function(_0x291ad1,_0x510409){var _0x67a5c1=function(_0x599edd){while(--_0x599edd){_0x291ad1['push'](_0x291ad1['shift']());}};_0x67a5c1(++_0x510409);}(_0x6c84,0x112));var _0x46c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c84[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var utils=require(_0x46c8('0x2'));function writeDB(_0x2d7030){utils[_0x46c8('0x3')](util['format'](_0x46c8('0x4'),_0x2d7030['type']));utils[_0x46c8('0x5')]('CreateVoiceTransferReport',_0x2d7030);}exports['blindtransfer']=function(_0x2b0d13){try{_0x2b0d13[_0x46c8('0x6')]=_0x46c8('0x7');writeDB(_0x2b0d13);}catch(_0x2d239a){utils[_0x46c8('0x8')](_0x2d239a[_0x46c8('0x9')]);}};exports[_0x46c8('0xa')]=function(_0x1727f4){try{_0x1727f4=_['assign'](_0x1727f4,{'transfererchannel':_0x1727f4[_0x46c8('0xb')],'transferercalleridnum':_0x1727f4['origtransferercalleridnum'],'transferercalleridname':_0x1727f4['origtransferercalleridname'],'transfererconnectedlinenum':_0x1727f4['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1727f4[_0x46c8('0xc')],'transfereraccountcode':_0x1727f4['origtransfereraccountcode'],'transferercontext':_0x1727f4[_0x46c8('0xd')],'transfererexten':_0x1727f4[_0x46c8('0xe')],'transfererlinkedid':_0x1727f4[_0x46c8('0xf')],'context':_0x1727f4[_0x46c8('0x10')],'extension':_0x1727f4[_0x46c8('0x11')],'type':_0x46c8('0x12')});if(_[_0x46c8('0x13')](_0x1727f4['transfereechannel'])){_0x1727f4=_['assign'](_0x1727f4,{'transfereechannel':_0x1727f4['transfertargetchannel'],'transfereecalleridnum':_0x1727f4[_0x46c8('0x14')],'transfereecalleridname':_0x1727f4['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1727f4[_0x46c8('0x15')],'transfereeconnectedlinename':_0x1727f4[_0x46c8('0x16')],'transfereeaccountcode':_0x1727f4[_0x46c8('0x17')],'transfereecontext':_0x1727f4[_0x46c8('0x18')],'transfereeexten':_0x1727f4[_0x46c8('0x19')],'transfereelinkedid':_0x1727f4['transfertargetlinkedid']});}writeDB(_0x1727f4);}catch(_0xb9f437){utils[_0x46c8('0x8')](_0xb9f437['stack']);}};
\ No newline at end of file
+var _0xcee0=['blind','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','TRANSFER|%s','type','request','blindtransfer'];(function(_0x323c04,_0x18c51f){var _0x2f63a3=function(_0x3b84cc){while(--_0x3b84cc){_0x323c04['push'](_0x323c04['shift']());}};_0x2f63a3(++_0x18c51f);}(_0xcee0,0x1e1));var _0x0cee=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0xcee0[_0x334d1e];return _0x3b33ba;};'use strict';var _=require(_0x0cee('0x0'));var util=require(_0x0cee('0x1'));var utils=require(_0x0cee('0x2'));function writeDB(_0xdc43c7){utils[_0x0cee('0x3')](util[_0x0cee('0x4')](_0x0cee('0x5'),_0xdc43c7[_0x0cee('0x6')]));utils[_0x0cee('0x7')]('CreateVoiceTransferReport',_0xdc43c7);}exports[_0x0cee('0x8')]=function(_0x29c25c){try{_0x29c25c[_0x0cee('0x6')]=_0x0cee('0x9');writeDB(_0x29c25c);}catch(_0x2af845){utils['error'](_0x2af845[_0x0cee('0xa')]);}};exports[_0x0cee('0xb')]=function(_0x34854d){try{_0x34854d=_[_0x0cee('0xc')](_0x34854d,{'transfererchannel':_0x34854d[_0x0cee('0xd')],'transferercalleridnum':_0x34854d[_0x0cee('0xe')],'transferercalleridname':_0x34854d[_0x0cee('0xf')],'transfererconnectedlinenum':_0x34854d[_0x0cee('0x10')],'transfererconnectedlinename':_0x34854d[_0x0cee('0x11')],'transfereraccountcode':_0x34854d[_0x0cee('0x12')],'transferercontext':_0x34854d[_0x0cee('0x13')],'transfererexten':_0x34854d[_0x0cee('0x14')],'transfererlinkedid':_0x34854d['origtransfererlinkedid'],'context':_0x34854d[_0x0cee('0x15')],'extension':_0x34854d[_0x0cee('0x16')],'type':_0x0cee('0x17')});if(_[_0x0cee('0x18')](_0x34854d[_0x0cee('0x19')])){_0x34854d=_[_0x0cee('0xc')](_0x34854d,{'transfereechannel':_0x34854d[_0x0cee('0x1a')],'transfereecalleridnum':_0x34854d[_0x0cee('0x1b')],'transfereecalleridname':_0x34854d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x34854d[_0x0cee('0x1c')],'transfereeconnectedlinename':_0x34854d[_0x0cee('0x1d')],'transfereeaccountcode':_0x34854d[_0x0cee('0x1e')],'transfereecontext':_0x34854d[_0x0cee('0x1f')],'transfereeexten':_0x34854d[_0x0cee('0x20')],'transfereelinkedid':_0x34854d[_0x0cee('0x21')]});}writeDB(_0x34854d);}catch(_0x465b35){utils[_0x0cee('0x22')](_0x465b35['stack']);}};
\ No newline at end of file
index 30f43ca..9078c53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd962=['isBefore','moment','bluebird','client','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','internal','name','interface','GETUSER|','result','FOUND','NOTFOUND','length','getUserByName','getVoiceQueueByName','type','acw','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter'];(function(_0x8f3f22,_0x3af49e){var _0x4b1941=function(_0xc9ee67){while(--_0xc9ee67){_0x8f3f22['push'](_0x8f3f22['shift']());}};_0x4b1941(++_0x3af49e);}(_0xd962,0x191));var _0x2d96=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xd962[_0x3511d3];return _0x5d6321;};'use strict';var jayson=require('jayson/promise');var moment=require(_0x2d96('0x0'));var BPromise=require(_0x2d96('0x1'));var client=jayson[_0x2d96('0x2')]['http']({'port':0x2329});var logger=require(_0x2d96('0x3'))(_0x2d96('0x4'));exports[_0x2d96('0x5')]=function(_0x4d427f){logger['info'](_0x4d427f);};exports[_0x2d96('0x6')]=function(_0x212db2){logger[_0x2d96('0x6')](JSON[_0x2d96('0x7')](_0x212db2));};exports['error']=function(_0x1a2158){logger[_0x2d96('0x8')](_0x1a2158[_0x2d96('0x9')]);};exports[_0x2d96('0xa')]=function(_0x8ac729,_0x595d48){return client[_0x2d96('0xa')](_0x8ac729,{'body':_0x595d48})[_0x2d96('0xb')](function(_0x187e85){logger[_0x2d96('0x6')](JSON[_0x2d96('0x7')](_0x187e85));})[_0x2d96('0xc')](function(_0x3e1e61){logger[_0x2d96('0x8')](_0x3e1e61[_0x2d96('0x9')]);});};function getUser(_0x4b029c){return client['request'](_0x2d96('0xd'),{'options':{'raw':!![],'attributes':['id',_0x2d96('0xe'),_0x2d96('0xf'),_0x2d96('0x10')],'where':_0x4b029c,'limit':0x1}})[_0x2d96('0xb')](function(_0x124a73){logger[_0x2d96('0x5')](_0x2d96('0x11')+JSON[_0x2d96('0x7')](_0x4b029c)+'|'+(_0x124a73[_0x2d96('0x12')]['length']?_0x2d96('0x13'):_0x2d96('0x14')));return _0x124a73['result'][_0x2d96('0x15')]?_0x124a73[_0x2d96('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x4a2ddc){return new BPromise(function(_0x5ca3d4,_0xf42aef){if(_0x4a2ddc){return getUser({'internal':_0x4a2ddc})[_0x2d96('0xb')](function(_0x5595a1){return _0x5ca3d4(_0x5595a1);})[_0x2d96('0xc')](function(_0x52b377){logger[_0x2d96('0x8')](_0x52b377[_0x2d96('0x9')]);return _0x5ca3d4(null);});}else{return _0x5ca3d4(null);}});};exports['getUserByInterface']=function(_0x293c7){return new BPromise(function(_0x2d4ef5,_0x2531e9){if(_0x293c7){return getUser({'interface':_0x293c7})[_0x2d96('0xb')](function(_0x22d88f){return _0x2d4ef5(_0x22d88f);})['catch'](function(_0x3aff91){logger[_0x2d96('0x8')](_0x3aff91[_0x2d96('0x9')]);return _0x2d4ef5(null);});}else{return _0x2d4ef5(null);}});};exports[_0x2d96('0x16')]=function(_0x40725c){return new BPromise(function(_0x26c303,_0x310d72){if(_0x40725c){return getUser({'name':_0x40725c})[_0x2d96('0xb')](function(_0x53fd82){return _0x26c303(_0x53fd82);})[_0x2d96('0xc')](function(_0x16ca23){logger[_0x2d96('0x8')](_0x16ca23['stack']);return _0x26c303(null);});}else{return _0x26c303(null);}});};exports[_0x2d96('0x17')]=function(_0x10fbca){return new BPromise(function(_0x3e38f5,_0x36e4f3){if(_0x10fbca){return client[_0x2d96('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x2d96('0x18'),_0x2d96('0x19'),'acwTimeout'],'where':{'name':_0x10fbca},'limit':0x1}})[_0x2d96('0xb')](function(_0x572c56){logger[_0x2d96('0x5')](_0x2d96('0x1a')+_0x10fbca+'|'+(_0x572c56[_0x2d96('0x12')][_0x2d96('0x15')]?_0x2d96('0x13'):_0x2d96('0x14')));return _0x3e38f5(_0x572c56[_0x2d96('0x12')][_0x2d96('0x15')]?_0x572c56[_0x2d96('0x12')][0x0]:null);})['catch'](function(_0x1081f7){logger['error'](_0x1081f7[_0x2d96('0x9')]);return _0x3e38f5(null);});}else{return _0x3e38f5(null);}});};exports[_0x2d96('0x1b')]=function(_0x393d81,_0x17a21e){return moment(_0x393d81)[_0x2d96('0x1c')](_0x17a21e,_0x2d96('0x1d'))[_0x2d96('0x1e')](_0x2d96('0x1f'));};exports[_0x2d96('0x20')]=function(_0xc75ed6,_0x34dc40){return moment(_0xc75ed6)[_0x2d96('0x21')](_0x34dc40,'seconds')[_0x2d96('0x1e')](_0x2d96('0x1f'));};exports[_0x2d96('0x22')]=function(_0xae0efb,_0x43275e){return moment(_0xae0efb)[_0x2d96('0x23')](moment(_0x43275e),_0x2d96('0x1d'));};exports[_0x2d96('0x24')]=function(_0x65d614,_0x24ec2f){return parseInt(_0x65d614,0xa)+parseInt(_0x24ec2f,0xa);};exports[_0x2d96('0x25')]=function(){return moment()[_0x2d96('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x2d96('0x26')]=function(_0x348f39,_0x41f8d3){if(_0x41f8d3){return moment(_0x348f39)['isAfter'](_0x41f8d3);}else{return!![];}};exports[_0x2d96('0x27')]=function(_0x375b7c,_0x5b816e){if(_0x5b816e){return moment(_0x375b7c)[_0x2d96('0x27')](_0x5b816e);}else if(_0x375b7c){return!![];}else{return![];}};
\ No newline at end of file
+var _0x0cf5=['name','then','stringify','result','length','NOTFOUND','getUserByInternal','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','type','acw','GETVOICEQUEUEBYNAME|','FOUND','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','seconds','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','info','debug','error','stack','request','catch','internal'];(function(_0x1d77b5,_0xedb4ff){var _0x57f0b4=function(_0x2826e5){while(--_0x2826e5){_0x1d77b5['push'](_0x1d77b5['shift']());}};_0x57f0b4(++_0xedb4ff);}(_0x0cf5,0x1c7));var _0x50cf=function(_0x2eed0d,_0x1bc37c){_0x2eed0d=_0x2eed0d-0x0;var _0x2420a5=_0x0cf5[_0x2eed0d];return _0x2420a5;};'use strict';var jayson=require(_0x50cf('0x0'));var moment=require(_0x50cf('0x1'));var BPromise=require(_0x50cf('0x2'));var client=jayson[_0x50cf('0x3')][_0x50cf('0x4')]({'port':0x2329});var logger=require(_0x50cf('0x5'))('xdr');exports[_0x50cf('0x6')]=function(_0x4869d6){logger['info'](_0x4869d6);};exports['debug']=function(_0x4b9504){logger[_0x50cf('0x7')](JSON['stringify'](_0x4b9504));};exports['error']=function(_0x4d337e){logger[_0x50cf('0x8')](_0x4d337e[_0x50cf('0x9')]);};exports[_0x50cf('0xa')]=function(_0x2c93b9,_0x5b09ef){return client[_0x50cf('0xa')](_0x2c93b9,{'body':_0x5b09ef})['then'](function(_0x529fec){logger[_0x50cf('0x7')](JSON['stringify'](_0x529fec));})[_0x50cf('0xb')](function(_0x587b36){logger[_0x50cf('0x8')](_0x587b36[_0x50cf('0x9')]);});};function getUser(_0x24a642){return client[_0x50cf('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x50cf('0xc'),_0x50cf('0xd'),'interface'],'where':_0x24a642,'limit':0x1}})[_0x50cf('0xe')](function(_0x5d7de7){logger[_0x50cf('0x6')]('GETUSER|'+JSON[_0x50cf('0xf')](_0x24a642)+'|'+(_0x5d7de7[_0x50cf('0x10')][_0x50cf('0x11')]?'FOUND':_0x50cf('0x12')));return _0x5d7de7[_0x50cf('0x10')][_0x50cf('0x11')]?_0x5d7de7[_0x50cf('0x10')][0x0]:null;});}exports[_0x50cf('0x13')]=function(_0x599943){return new BPromise(function(_0x48a34a,_0x86eb49){if(_0x599943){return getUser({'internal':_0x599943})[_0x50cf('0xe')](function(_0x5aff2c){return _0x48a34a(_0x5aff2c);})[_0x50cf('0xb')](function(_0x59a038){logger[_0x50cf('0x8')](_0x59a038[_0x50cf('0x9')]);return _0x48a34a(null);});}else{return _0x48a34a(null);}});};exports[_0x50cf('0x14')]=function(_0x43b4d8){return new BPromise(function(_0x505ed0,_0x5eb92c){if(_0x43b4d8){return getUser({'interface':_0x43b4d8})[_0x50cf('0xe')](function(_0x729c6){return _0x505ed0(_0x729c6);})[_0x50cf('0xb')](function(_0x5858bc){logger[_0x50cf('0x8')](_0x5858bc['stack']);return _0x505ed0(null);});}else{return _0x505ed0(null);}});};exports['getUserByName']=function(_0x1b8bc9){return new BPromise(function(_0x38d6f6,_0x555d0f){if(_0x1b8bc9){return getUser({'name':_0x1b8bc9})['then'](function(_0x5de5f9){return _0x38d6f6(_0x5de5f9);})[_0x50cf('0xb')](function(_0x639173){logger[_0x50cf('0x8')](_0x639173[_0x50cf('0x9')]);return _0x38d6f6(null);});}else{return _0x38d6f6(null);}});};exports[_0x50cf('0x15')]=function(_0x4fb919){return new BPromise(function(_0x2b448c,_0x116d77){if(_0x4fb919){return client[_0x50cf('0xa')](_0x50cf('0x16'),{'options':{'raw':!![],'attributes':['id',_0x50cf('0xd'),_0x50cf('0x17'),_0x50cf('0x18'),'acwTimeout'],'where':{'name':_0x4fb919},'limit':0x1}})['then'](function(_0x50967c){logger[_0x50cf('0x6')](_0x50cf('0x19')+_0x4fb919+'|'+(_0x50967c[_0x50cf('0x10')][_0x50cf('0x11')]?_0x50cf('0x1a'):_0x50cf('0x12')));return _0x2b448c(_0x50967c[_0x50cf('0x10')][_0x50cf('0x11')]?_0x50967c[_0x50cf('0x10')][0x0]:null);})[_0x50cf('0xb')](function(_0x1bcdd8){logger[_0x50cf('0x8')](_0x1bcdd8['stack']);return _0x2b448c(null);});}else{return _0x2b448c(null);}});};exports[_0x50cf('0x1b')]=function(_0x3f3f3f,_0x50af17){return moment(_0x3f3f3f)[_0x50cf('0x1c')](_0x50af17,'seconds')[_0x50cf('0x1d')](_0x50cf('0x1e'));};exports[_0x50cf('0x1f')]=function(_0x30ebbc,_0x3f967e){return moment(_0x30ebbc)[_0x50cf('0x20')](_0x3f967e,'seconds')[_0x50cf('0x1d')](_0x50cf('0x1e'));};exports[_0x50cf('0x21')]=function(_0x5c11cc,_0x1c64a){return moment(_0x5c11cc)['diff'](moment(_0x1c64a),_0x50cf('0x22'));};exports[_0x50cf('0x23')]=function(_0x4a5df9,_0x2cbd2d){return parseInt(_0x4a5df9,0xa)+parseInt(_0x2cbd2d,0xa);};exports[_0x50cf('0x24')]=function(){return moment()[_0x50cf('0x1d')](_0x50cf('0x1e'));};exports['isAfter']=function(_0x5e709c,_0x5decf5){if(_0x5decf5){return moment(_0x5e709c)[_0x50cf('0x25')](_0x5decf5);}else{return!![];}};exports[_0x50cf('0x26')]=function(_0x39d472,_0x5a10e1){if(_0x5a10e1){return moment(_0x39d472)['isBefore'](_0x5a10e1);}else if(_0x39d472){return!![];}else{return![];}};
\ No newline at end of file